Built motion from commit 029b8073.|2.5.35
authorAndrea Bianco <andrea.bianco@xcally.com>
Thu, 16 Sep 2021 10:13:38 +0000 (12:13 +0200)
committerAndrea Bianco <andrea.bianco@xcally.com>
Thu, 16 Sep 2021 10:13:38 +0000 (12:13 +0200)
1152 files changed:
apidoc/api_project.js
apidoc/api_project.json
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.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/tvox.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 121c23a..aece1c1 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-09-16T09:29:44.335Z",
+    "time": "2021-09-16T10:05:46.479Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 60b5adf..c26fc85 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-09-16T09:29:44.335Z",
+    "time": "2021-09-16T10:05:46.479Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index a3bd9ba..4ed7c30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf736=['urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','integration','jscripty','urlForward','browser','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)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x1af644,_0x44afc9){var _0x53aef9=function(_0x5d1b77){while(--_0x5d1b77){_0x1af644['push'](_0x1af644['shift']());}};_0x53aef9(++_0x44afc9);}(_0xf736,0x121));var _0x6f73=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf736[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6f73('0x0'));module[_0x6f73('0x1')]={'name':{'type':Sequelize[_0x6f73('0x2')],'get':function(_0x2598d4){return this['getDataValue'](_0x6f73('0x3'));}},'action':{'type':Sequelize[_0x6f73('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x6f73('0x5'),'motionbar',_0x6f73('0x6'),_0x6f73('0x7'),_0x6f73('0x8'),'bot',_0x6f73('0x9')]],'msg':_0x6f73('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x6f73('0x4')](0x1000),'comment':_0x6f73('0xb')},'data2':{'type':Sequelize[_0x6f73('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x6f73('0xc')},'data6':{'type':Sequelize[_0x6f73('0x4')],'comments':_0x6f73('0xd')},'data7':{'type':Sequelize[_0x6f73('0xe')],'comments':_0x6f73('0xf')}};
\ No newline at end of file
+var _0xfa6f=['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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','contactManager','integration','motionbar','jscripty','urlForward','bot','script'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xfa6f,0xa9));var _0xffa6=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0xfa6f[_0x2e2681];return _0x368a64;};'use strict';var Sequelize=require(_0xffa6('0x0'));module[_0xffa6('0x1')]={'name':{'type':Sequelize[_0xffa6('0x2')],'get':function(_0x588d3e){return this[_0xffa6('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xffa6('0x4'),_0xffa6('0x5'),_0xffa6('0x6'),_0xffa6('0x7'),_0xffa6('0x8'),'browser',_0xffa6('0x9'),_0xffa6('0xa')]],'msg':_0xffa6('0xb')}},'comment':_0xffa6('0xb')},'data1':{'type':Sequelize[_0xffa6('0xc')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xffa6('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xffa6('0xc')](0x1000),'comments':_0xffa6('0xe')},'data5':{'type':Sequelize[_0xffa6('0xc')](0x1000),'comments':_0xffa6('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xffa6('0x10')],'comments':_0xffa6('0x11')}};
\ No newline at end of file
index c556a2e..d9183be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9db3=['path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','body','params','then','catch','Action','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x53fa65,_0x44a5b0){var _0x4368a1=function(_0x5b4076){while(--_0x5b4076){_0x53fa65['push'](_0x53fa65['shift']());}};_0x4368a1(++_0x44a5b0);}(_0x9db3,0x8b));var _0x39db=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x9db3[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0x39db('0x0'));var rimraf=require(_0x39db('0x1'));var zipdir=require(_0x39db('0x2'));var jsonpatch=require(_0x39db('0x3'));var rp=require(_0x39db('0x4'));var moment=require('moment');var BPromise=require(_0x39db('0x5'));var Mustache=require(_0x39db('0x6'));var util=require(_0x39db('0x7'));var path=require(_0x39db('0x8'));var sox=require(_0x39db('0x9'));var csv=require(_0x39db('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x39db('0xb'));var _=require(_0x39db('0xc'));var squel=require(_0x39db('0xd'));var crypto=require(_0x39db('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x39db('0xa'));var querystring=require(_0x39db('0xf'));var Papa=require('papaparse');var Redis=require(_0x39db('0x10'));var authService=require(_0x39db('0x11'));var qs=require(_0x39db('0x12'));var as=require(_0x39db('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39db('0x14'))(_0x39db('0x15'));var utils=require('../../config/utils');var config=require(_0x39db('0x16'));var licenseUtil=require(_0x39db('0x17'));var db=require(_0x39db('0x18'))['db'];function respondWithStatusCode(_0x8dc07e,_0x48caf1){_0x48caf1=_0x48caf1||0xcc;return function(_0x374e9f){if(_0x374e9f){return _0x8dc07e[_0x39db('0x19')](_0x48caf1);}return _0x8dc07e[_0x39db('0x1a')](_0x48caf1)[_0x39db('0x1b')]();};}function respondWithResult(_0x2c62db,_0x5149d7){_0x5149d7=_0x5149d7||0xc8;return function(_0x5d368d){if(_0x5d368d){return _0x2c62db[_0x39db('0x1a')](_0x5149d7)[_0x39db('0x1c')](_0x5d368d);}};}function respondWithFilteredResult(_0x55feaa,_0x2502f6){return function(_0x376bc0){if(_0x376bc0){var _0x374c06=typeof _0x2502f6[_0x39db('0x1d')]===_0x39db('0x1e')&&typeof _0x2502f6[_0x39db('0x1f')]===_0x39db('0x1e');var _0x16385c=_0x376bc0[_0x39db('0x20')];var _0x4a5530=_0x374c06?0x0:_0x2502f6['offset'];var _0x566834=_0x374c06?_0x376bc0[_0x39db('0x20')]:_0x2502f6[_0x39db('0x1d')]+_0x2502f6[_0x39db('0x1f')];var _0x247913;if(_0x566834>=_0x16385c){_0x566834=_0x16385c;_0x247913=0xc8;}else{_0x247913=0xce;}_0x55feaa[_0x39db('0x1a')](_0x247913);return _0x55feaa[_0x39db('0x21')](_0x39db('0x22'),_0x4a5530+'-'+_0x566834+'/'+_0x16385c)['json'](_0x376bc0);}return null;};}function patchUpdates(_0x53be13){return function(_0x3bb259){try{jsonpatch[_0x39db('0x23')](_0x3bb259,_0x53be13,!![]);}catch(_0x142ec3){return BPromise[_0x39db('0x24')](_0x142ec3);}return _0x3bb259[_0x39db('0x25')]();};}function saveUpdates(_0x267ad8,_0x1eb409){return function(_0x4d57c3){if(_0x4d57c3){return _0x4d57c3[_0x39db('0x26')](_0x267ad8)['then'](function(_0x201568){return _0x201568;});}return null;};}function removeEntity(_0x56d5b0,_0x3b4c61){return function(_0x158d32){if(_0x158d32){return _0x158d32[_0x39db('0x27')]()['then'](function(){_0x56d5b0[_0x39db('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc28f,_0x5c47cf){return function(_0x51351e){if(!_0x51351e){_0x4fc28f[_0x39db('0x19')](0x194);}return _0x51351e;};}function handleError(_0x3e59f8,_0x69ee8a){_0x69ee8a=_0x69ee8a||0x1f4;return function(_0x242f27){logger[_0x39db('0x28')](_0x242f27[_0x39db('0x29')]);if(_0x242f27['name']){delete _0x242f27[_0x39db('0x2a')];}_0x3e59f8[_0x39db('0x1a')](_0x69ee8a)['send'](_0x242f27);};}exports[_0x39db('0x26')]=function(_0x341893,_0x33f90d){if(_0x341893[_0x39db('0x2b')]['id']){delete _0x341893['body']['id'];}return db['Action']['find']({'where':{'id':_0x341893[_0x39db('0x2c')]['id']}})[_0x39db('0x2d')](handleEntityNotFound(_0x33f90d,null))[_0x39db('0x2d')](saveUpdates(_0x341893['body'],null))['then'](respondWithResult(_0x33f90d,null))[_0x39db('0x2e')](handleError(_0x33f90d,null));};exports[_0x39db('0x27')]=function(_0x40652f,_0x1a31e0){return db[_0x39db('0x2f')][_0x39db('0x30')]({'where':{'id':_0x40652f[_0x39db('0x2c')]['id']}})[_0x39db('0x2d')](handleEntityNotFound(_0x1a31e0,null))[_0x39db('0x2d')](removeEntity(_0x1a31e0,null))[_0x39db('0x2e')](handleError(_0x1a31e0,null));};
\ No newline at end of file
+var _0x3ae1=['ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','update','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x45ca21,_0x5693e8){var _0x4cefe2=function(_0x1996d5){while(--_0x1996d5){_0x45ca21['push'](_0x45ca21['shift']());}};_0x4cefe2(++_0x5693e8);}(_0x3ae1,0x81));var _0x13ae=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x3ae1[_0x298ed3];return _0x5aad28;};'use strict';var emlformat=require(_0x13ae('0x0'));var rimraf=require(_0x13ae('0x1'));var zipdir=require(_0x13ae('0x2'));var jsonpatch=require(_0x13ae('0x3'));var rp=require(_0x13ae('0x4'));var moment=require(_0x13ae('0x5'));var BPromise=require(_0x13ae('0x6'));var Mustache=require(_0x13ae('0x7'));var util=require(_0x13ae('0x8'));var path=require(_0x13ae('0x9'));var sox=require(_0x13ae('0xa'));var csv=require(_0x13ae('0xb'));var ejs=require(_0x13ae('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x13ae('0xd'));var squel=require(_0x13ae('0xe'));var crypto=require(_0x13ae('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x13ae('0x10'));var toCsv=require('to-csv');var querystring=require(_0x13ae('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x13ae('0x12'));var qs=require(_0x13ae('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x13ae('0x14'));var config=require(_0x13ae('0x15'));var licenseUtil=require(_0x13ae('0x16'));var db=require(_0x13ae('0x17'))['db'];function respondWithStatusCode(_0x2be460,_0x279a28){_0x279a28=_0x279a28||0xcc;return function(_0x531176){if(_0x531176){return _0x2be460[_0x13ae('0x18')](_0x279a28);}return _0x2be460[_0x13ae('0x19')](_0x279a28)[_0x13ae('0x1a')]();};}function respondWithResult(_0x24cbbc,_0x1bbd85){_0x1bbd85=_0x1bbd85||0xc8;return function(_0x2983b7){if(_0x2983b7){return _0x24cbbc[_0x13ae('0x19')](_0x1bbd85)[_0x13ae('0x1b')](_0x2983b7);}};}function respondWithFilteredResult(_0x19d3cd,_0x417f7a){return function(_0x2d8fe2){if(_0x2d8fe2){var _0x51f37c=typeof _0x417f7a['offset']===_0x13ae('0x1c')&&typeof _0x417f7a[_0x13ae('0x1d')]==='undefined';var _0x5e3cba=_0x2d8fe2[_0x13ae('0x1e')];var _0x7ca6a4=_0x51f37c?0x0:_0x417f7a[_0x13ae('0x1f')];var _0x3ffebe=_0x51f37c?_0x2d8fe2[_0x13ae('0x1e')]:_0x417f7a[_0x13ae('0x1f')]+_0x417f7a['limit'];var _0x419dae;if(_0x3ffebe>=_0x5e3cba){_0x3ffebe=_0x5e3cba;_0x419dae=0xc8;}else{_0x419dae=0xce;}_0x19d3cd[_0x13ae('0x19')](_0x419dae);return _0x19d3cd[_0x13ae('0x20')](_0x13ae('0x21'),_0x7ca6a4+'-'+_0x3ffebe+'/'+_0x5e3cba)[_0x13ae('0x1b')](_0x2d8fe2);}return null;};}function patchUpdates(_0x4b3034){return function(_0x260bf3){try{jsonpatch['apply'](_0x260bf3,_0x4b3034,!![]);}catch(_0x3bc6a7){return BPromise[_0x13ae('0x22')](_0x3bc6a7);}return _0x260bf3[_0x13ae('0x23')]();};}function saveUpdates(_0x4f4797,_0x4ab0cc){return function(_0x2bba52){if(_0x2bba52){return _0x2bba52['update'](_0x4f4797)[_0x13ae('0x24')](function(_0x5cc65a){return _0x5cc65a;});}return null;};}function removeEntity(_0x536020,_0x409cc3){return function(_0x6418bc){if(_0x6418bc){return _0x6418bc[_0x13ae('0x25')]()[_0x13ae('0x24')](function(){_0x536020[_0x13ae('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52c8ab,_0x2c1367){return function(_0xb2f6eb){if(!_0xb2f6eb){_0x52c8ab[_0x13ae('0x18')](0x194);}return _0xb2f6eb;};}function handleError(_0x3dec26,_0xc913c1){_0xc913c1=_0xc913c1||0x1f4;return function(_0x590e8c){logger[_0x13ae('0x26')](_0x590e8c[_0x13ae('0x27')]);if(_0x590e8c['name']){delete _0x590e8c[_0x13ae('0x28')];}_0x3dec26[_0x13ae('0x19')](_0xc913c1)['send'](_0x590e8c);};}exports[_0x13ae('0x29')]=function(_0x4db155,_0x5cc0bc){if(_0x4db155[_0x13ae('0x2a')]['id']){delete _0x4db155[_0x13ae('0x2a')]['id'];}return db[_0x13ae('0x2b')][_0x13ae('0x2c')]({'where':{'id':_0x4db155[_0x13ae('0x2d')]['id']}})[_0x13ae('0x24')](handleEntityNotFound(_0x5cc0bc,null))['then'](saveUpdates(_0x4db155[_0x13ae('0x2a')],null))['then'](respondWithResult(_0x5cc0bc,null))[_0x13ae('0x2e')](handleError(_0x5cc0bc,null));};exports['destroy']=function(_0x3f66da,_0x393d9d){return db[_0x13ae('0x2b')][_0x13ae('0x2c')]({'where':{'id':_0x3f66da[_0x13ae('0x2d')]['id']}})['then'](handleEntityNotFound(_0x393d9d,null))['then'](removeEntity(_0x393d9d,null))[_0x13ae('0x2e')](handleError(_0x393d9d,null));};
\ No newline at end of file
index 7478d5f..7ca3f97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd452=['api','moment','bluebird','request-promise','../../config/environment','./action.attributes','exports','define','tools_actions','lodash','util'];(function(_0x58d431,_0x41995e){var _0x11fa25=function(_0x499b7a){while(--_0x499b7a){_0x58d431['push'](_0x58d431['shift']());}};_0x11fa25(++_0x41995e);}(_0xd452,0x98));var _0x2d45=function(_0x4bdf64,_0x3022b2){_0x4bdf64=_0x4bdf64-0x0;var _0x9a1a19=_0xd452[_0x4bdf64];return _0x9a1a19;};'use strict';var _=require(_0x2d45('0x0'));var util=require(_0x2d45('0x1'));var logger=require('../../config/logger')(_0x2d45('0x2'));var moment=require(_0x2d45('0x3'));var BPromise=require(_0x2d45('0x4'));var rp=require(_0x2d45('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2d45('0x6'));var attributes=require(_0x2d45('0x7'));module[_0x2d45('0x8')]=function(_0x13c884,_0x18150d){return _0x13c884[_0x2d45('0x9')]('Action',attributes,{'tableName':_0x2d45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7341=['../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','api','bluebird','path','rimraf'];(function(_0x56fbdb,_0xaad8a8){var _0x415e17=function(_0x419235){while(--_0x419235){_0x56fbdb['push'](_0x56fbdb['shift']());}};_0x415e17(++_0xaad8a8);}(_0x7341,0x1d1));var _0x1734=function(_0x52f727,_0x117d76){_0x52f727=_0x52f727-0x0;var _0x34863e=_0x7341[_0x52f727];return _0x34863e;};'use strict';var _=require(_0x1734('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1734('0x1'));var moment=require('moment');var BPromise=require(_0x1734('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1734('0x3'));var rimraf=require(_0x1734('0x4'));var config=require(_0x1734('0x5'));var attributes=require(_0x1734('0x6'));module[_0x1734('0x7')]=function(_0x52ebe3,_0x47a7cf){return _0x52ebe3['define'](_0x1734('0x8'),attributes,{'tableName':_0x1734('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e524661..a2d7590 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2c35e9,_0x4e90c1){var _0x3d626a=function(_0x24752c){while(--_0x24752c){_0x2c35e9['push'](_0x2c35e9['shift']());}};_0x3d626a(++_0x4e90c1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x386394,_0x543996){_0x386394=_0x386394-0x0;var _0x4f8d51=_0x7fbe[_0x386394];return _0x4f8d51;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x814b,0x1a2));var _0xb814=function(_0xb096ef,_0x20ebdf){_0xb096ef=_0xb096ef-0x0;var _0x5ac5b=_0x814b[_0xb096ef];return _0x5ac5b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}
\ No newline at end of file
index 9851bb5..3ccfa01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b26=['/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./action.controller','put'];(function(_0x57f91f,_0x21cf17){var _0x4deca6=function(_0x5c97bb){while(--_0x5c97bb){_0x57f91f['push'](_0x57f91f['shift']());}};_0x4deca6(++_0x21cf17);}(_0x0b26,0x1aa));var _0x60b2=function(_0x1979d8,_0x10d8f2){_0x1979d8=_0x1979d8-0x0;var _0x1d5bb3=_0x0b26[_0x1979d8];return _0x1d5bb3;};'use strict';var multer=require(_0x60b2('0x0'));var util=require(_0x60b2('0x1'));var path=require(_0x60b2('0x2'));var timeout=require(_0x60b2('0x3'));var express=require('express');var router=express[_0x60b2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x60b2('0x5'));var config=require('../../config/environment');var controller=require(_0x60b2('0x6'));router[_0x60b2('0x7')](_0x60b2('0x8'),auth[_0x60b2('0x9')](),controller[_0x60b2('0xa')]);router[_0x60b2('0xb')](_0x60b2('0x8'),auth[_0x60b2('0x9')](),controller[_0x60b2('0xc')]);module[_0x60b2('0xd')]=router;
\ No newline at end of file
+var _0xe091=['/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','delete'];(function(_0x4b2069,_0x46d675){var _0x2a2ae5=function(_0x495703){while(--_0x495703){_0x4b2069['push'](_0x4b2069['shift']());}};_0x2a2ae5(++_0x46d675);}(_0xe091,0x12e));var _0x1e09=function(_0x2de608,_0x652f30){_0x2de608=_0x2de608-0x0;var _0x4eb101=_0xe091[_0x2de608];return _0x4eb101;};'use strict';var multer=require(_0x1e09('0x0'));var util=require(_0x1e09('0x1'));var path=require(_0x1e09('0x2'));var timeout=require(_0x1e09('0x3'));var express=require('express');var router=express[_0x1e09('0x4')]();var fs_extra=require(_0x1e09('0x5'));var auth=require(_0x1e09('0x6'));var interaction=require(_0x1e09('0x7'));var config=require(_0x1e09('0x8'));var controller=require(_0x1e09('0x9'));router[_0x1e09('0xa')]('/:id',auth[_0x1e09('0xb')](),controller['update']);router[_0x1e09('0xc')](_0x1e09('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x1e09('0xe')]=router;
\ No newline at end of file
index 93d7744..b41153c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x69d7d1,_0x3ab141){var _0x10acf7=function(_0x139f59){while(--_0x139f59){_0x69d7d1['push'](_0x69d7d1['shift']());}};_0x10acf7(++_0x3ab141);}(_0x5fc3,0xa8));var _0x35fc=function(_0x22eb96,_0x3c2d8d){_0x22eb96=_0x22eb96-0x0;var _0x5e1adf=_0x5fc3[_0x22eb96];return _0x5e1adf;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
+var _0xc4aa=['STRING','sequelize','exports'];(function(_0xc23ede,_0x32e60f){var _0x579b42=function(_0x19be0f){while(--_0x19be0f){_0xc23ede['push'](_0xc23ede['shift']());}};_0x579b42(++_0x32e60f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index b4d06fe..45a445a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8553=['count','status','Content-Range','apply','reject','save','destroy','then','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','index','map','AnalyticCustomReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','update','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','metric','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','value','from','MetricId','alias','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','HOUR(%s)','debug','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','limit'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8553,0x1ca));var _0x3855=function(_0x1d619f,_0x45e7ed){_0x1d619f=_0x1d619f-0x0;var _0x35a956=_0x8553[_0x1d619f];return _0x35a956;};'use strict';var emlformat=require(_0x3855('0x0'));var rimraf=require(_0x3855('0x1'));var zipdir=require(_0x3855('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3855('0x3'));var moment=require(_0x3855('0x4'));var BPromise=require(_0x3855('0x5'));var Mustache=require(_0x3855('0x6'));var util=require(_0x3855('0x7'));var path=require(_0x3855('0x8'));var sox=require(_0x3855('0x9'));var csv=require(_0x3855('0xa'));var ejs=require(_0x3855('0xb'));var fs=require('fs');var fs_extra=require(_0x3855('0xc'));var _=require(_0x3855('0xd'));var squel=require(_0x3855('0xe'));var crypto=require(_0x3855('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3855('0xa'));var querystring=require('querystring');var Papa=require(_0x3855('0x10'));var Redis=require(_0x3855('0x11'));var authService=require(_0x3855('0x12'));var qs=require(_0x3855('0x13'));var as=require(_0x3855('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x3855('0x15'));var config=require(_0x3855('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3855('0x17'))['db'];var dbH=require(_0x3855('0x17'))['dbH'];function respondWithStatusCode(_0x5c0f0b,_0x41a6fe){_0x41a6fe=_0x41a6fe||0xcc;return function(_0x51f6da){if(_0x51f6da){return _0x5c0f0b['sendStatus'](_0x41a6fe);}return _0x5c0f0b['status'](_0x41a6fe)[_0x3855('0x18')]();};}function respondWithResult(_0x2df552,_0x1e4033){_0x1e4033=_0x1e4033||0xc8;return function(_0x147f45){if(_0x147f45){return _0x2df552['status'](_0x1e4033)[_0x3855('0x19')](_0x147f45);}};}function respondWithFilteredResult(_0x557d80,_0x8d57f4){return function(_0x3690d9){if(_0x3690d9){var _0xfbd99c=typeof _0x8d57f4[_0x3855('0x1a')]==='undefined'&&typeof _0x8d57f4[_0x3855('0x1b')]==='undefined';var _0x2d0343=_0x3690d9[_0x3855('0x1c')];var _0x42c097=_0xfbd99c?0x0:_0x8d57f4['offset'];var _0x3e98da=_0xfbd99c?_0x3690d9[_0x3855('0x1c')]:_0x8d57f4[_0x3855('0x1a')]+_0x8d57f4[_0x3855('0x1b')];var _0x22b706;if(_0x3e98da>=_0x2d0343){_0x3e98da=_0x2d0343;_0x22b706=0xc8;}else{_0x22b706=0xce;}_0x557d80[_0x3855('0x1d')](_0x22b706);return _0x557d80['set'](_0x3855('0x1e'),_0x42c097+'-'+_0x3e98da+'/'+_0x2d0343)[_0x3855('0x19')](_0x3690d9);}return null;};}function patchUpdates(_0x288c61){return function(_0x146730){try{jsonpatch[_0x3855('0x1f')](_0x146730,_0x288c61,!![]);}catch(_0x53c5cf){return BPromise[_0x3855('0x20')](_0x53c5cf);}return _0x146730[_0x3855('0x21')]();};}function saveUpdates(_0xe984c9,_0x511dc6){return function(_0x380981){if(_0x380981){return _0x380981['update'](_0xe984c9)['then'](function(_0x502f09){return _0x502f09;});}return null;};}function removeEntity(_0x19efb6,_0x15b063){return function(_0x3cfd7d){if(_0x3cfd7d){return _0x3cfd7d[_0x3855('0x22')]()[_0x3855('0x23')](function(){var _0x5db4b9=_0x3cfd7d[_0x3855('0x24')]({'plain':!![]});var _0xfb6418=_0x3855('0x25');return db[_0x3855('0x26')][_0x3855('0x22')]({'where':{'type':_0xfb6418,'resourceId':_0x5db4b9['id']}})[_0x3855('0x23')](function(){return _0x3cfd7d;});})[_0x3855('0x23')](function(){_0x19efb6[_0x3855('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5424d8,_0xf0b527){return function(_0x5778ab){if(!_0x5778ab){_0x5424d8[_0x3855('0x27')](0x194);}return _0x5778ab;};}function handleError(_0x48298c,_0x3b72a9){_0x3b72a9=_0x3b72a9||0x1f4;return function(_0x502107){logger[_0x3855('0x28')](_0x502107[_0x3855('0x29')]);if(_0x502107[_0x3855('0x2a')]){delete _0x502107[_0x3855('0x2a')];}_0x48298c['status'](_0x3b72a9)['send'](_0x502107);};}exports[_0x3855('0x2b')]=function(_0x3cecab,_0x57da57){var _0x11398a={},_0x58fb78={},_0xd5a063={'count':0x0,'rows':[]};var _0xecd342=_[_0x3855('0x2c')](db[_0x3855('0x2d')]['rawAttributes'],function(_0x36ea86){return{'name':_0x36ea86[_0x3855('0x2e')],'type':_0x36ea86[_0x3855('0x2f')][_0x3855('0x30')]};});_0x58fb78['model']=_['map'](_0xecd342,_0x3855('0x2a'));_0x58fb78[_0x3855('0x31')]=_[_0x3855('0x32')](_0x3cecab[_0x3855('0x31')]);_0x58fb78[_0x3855('0x33')]=_[_0x3855('0x34')](_0x58fb78[_0x3855('0x35')],_0x58fb78[_0x3855('0x31')]);_0x11398a['attributes']=_['intersection'](_0x58fb78[_0x3855('0x35')],qs[_0x3855('0x36')](_0x3cecab[_0x3855('0x31')]['fields']));_0x11398a[_0x3855('0x37')]=_0x11398a[_0x3855('0x37')][_0x3855('0x38')]?_0x11398a[_0x3855('0x37')]:_0x58fb78[_0x3855('0x35')];if(!_0x3cecab['query']['hasOwnProperty'](_0x3855('0x39'))){_0x11398a[_0x3855('0x1b')]=qs[_0x3855('0x1b')](_0x3cecab['query'][_0x3855('0x1b')]);_0x11398a[_0x3855('0x1a')]=qs[_0x3855('0x1a')](_0x3cecab[_0x3855('0x31')][_0x3855('0x1a')]);}_0x11398a[_0x3855('0x3a')]=qs[_0x3855('0x3b')](_0x3cecab[_0x3855('0x31')][_0x3855('0x3b')]);_0x11398a[_0x3855('0x3c')]=qs[_0x3855('0x33')](_[_0x3855('0x3d')](_0x3cecab[_0x3855('0x31')],_0x58fb78[_0x3855('0x33')]),_0xecd342);if(_0x3cecab[_0x3855('0x31')][_0x3855('0x3e')]){_0x11398a[_0x3855('0x3c')]=_[_0x3855('0x3f')](_0x11398a[_0x3855('0x3c')],{'$or':_[_0x3855('0x2c')](_0xecd342,function(_0x567145){if(_0x567145[_0x3855('0x2f')]!=='VIRTUAL'){var _0x389c8f={};_0x389c8f[_0x567145[_0x3855('0x2a')]]={'$like':'%'+_0x3cecab[_0x3855('0x31')][_0x3855('0x3e')]+'%'};return _0x389c8f;}})});}_0x11398a=_[_0x3855('0x3f')]({},_0x11398a,_0x3cecab[_0x3855('0x40')]);var _0x3d5328={'where':_0x11398a[_0x3855('0x3c')]};return db[_0x3855('0x2d')][_0x3855('0x1c')](_0x3d5328)[_0x3855('0x23')](function(_0x495d20){_0xd5a063[_0x3855('0x1c')]=_0x495d20;if(_0x3cecab['query'][_0x3855('0x41')]){_0x11398a[_0x3855('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3855('0x43')](_0x11398a);})[_0x3855('0x23')](function(_0x2348a3){_0xd5a063[_0x3855('0x44')]=_0x2348a3;return _0xd5a063;})['then'](respondWithFilteredResult(_0x57da57,_0x11398a))[_0x3855('0x45')](handleError(_0x57da57,null));};exports[_0x3855('0x46')]=function(_0x53ffb3,_0x4c361a){var _0x28dc74={'raw':![],'where':{'id':_0x53ffb3[_0x3855('0x47')]['id']}},_0x57762d={};_0x57762d[_0x3855('0x35')]=_[_0x3855('0x32')](db[_0x3855('0x2d')]['rawAttributes']);_0x57762d[_0x3855('0x31')]=_[_0x3855('0x32')](_0x53ffb3[_0x3855('0x31')]);_0x57762d[_0x3855('0x33')]=_[_0x3855('0x34')](_0x57762d[_0x3855('0x35')],_0x57762d['query']);_0x28dc74[_0x3855('0x37')]=_['intersection'](_0x57762d[_0x3855('0x35')],qs[_0x3855('0x36')](_0x53ffb3['query']['fields']));_0x28dc74[_0x3855('0x37')]=_0x28dc74[_0x3855('0x37')][_0x3855('0x38')]?_0x28dc74['attributes']:_0x57762d['model'];if(_0x53ffb3[_0x3855('0x31')][_0x3855('0x41')]){_0x28dc74[_0x3855('0x42')]=[{'all':!![]}];}_0x28dc74=_[_0x3855('0x3f')]({},_0x28dc74,_0x53ffb3[_0x3855('0x40')]);return db['AnalyticCustomReport'][_0x3855('0x48')](_0x28dc74)['then'](handleEntityNotFound(_0x4c361a,null))[_0x3855('0x23')](respondWithResult(_0x4c361a,null))[_0x3855('0x45')](handleError(_0x4c361a,null));};exports[_0x3855('0x49')]=function(_0x1705ad,_0x3abfde){return db[_0x3855('0x2d')][_0x3855('0x49')](_0x1705ad['body'],{})[_0x3855('0x23')](function(_0x5e624f){var _0x21addc=_0x1705ad['user'][_0x3855('0x24')]({'plain':!![]});if(!_0x21addc)throw new Error(_0x3855('0x4a'));if(_0x21addc[_0x3855('0x4b')]===_0x3855('0x4c')){var _0x22dd4a=_0x5e624f['get']({'plain':!![]});var _0x339bc5=_0x3855('0x4d');return db['UserProfileSection'][_0x3855('0x48')]({'where':{'name':_0x339bc5,'userProfileId':_0x21addc['userProfileId']},'raw':!![]})[_0x3855('0x23')](function(_0x3ee2f1){if(_0x3ee2f1&&_0x3ee2f1['autoAssociation']===0x0){return db[_0x3855('0x26')]['create']({'name':_0x22dd4a[_0x3855('0x2a')],'resourceId':_0x22dd4a['id'],'type':_0x3855('0x25'),'sectionId':_0x3ee2f1['id']},{})[_0x3855('0x23')](function(){return _0x5e624f;});}else{return _0x5e624f;}})[_0x3855('0x45')](function(_0x596d0c){logger[_0x3855('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x596d0c);throw _0x596d0c;});}return _0x5e624f;})[_0x3855('0x23')](respondWithResult(_0x3abfde,0xc9))[_0x3855('0x45')](handleError(_0x3abfde,null));};exports[_0x3855('0x4e')]=function(_0x2a041d,_0x3f727a){if(_0x2a041d[_0x3855('0x4f')]['id']){delete _0x2a041d[_0x3855('0x4f')]['id'];}return db[_0x3855('0x2d')]['find']({'where':{'id':_0x2a041d['params']['id']}})['then'](handleEntityNotFound(_0x3f727a,null))[_0x3855('0x23')](saveUpdates(_0x2a041d['body'],null))[_0x3855('0x23')](respondWithResult(_0x3f727a,null))[_0x3855('0x45')](handleError(_0x3f727a,null));};exports[_0x3855('0x22')]=function(_0x47c1fc,_0x5d8237){return db[_0x3855('0x2d')][_0x3855('0x48')]({'where':{'id':_0x47c1fc[_0x3855('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d8237,null))['then'](removeEntity(_0x5d8237,null))[_0x3855('0x45')](handleError(_0x5d8237,null));};exports[_0x3855('0x50')]=function(_0x5a32a5,_0x17cf6b){var _0x3378dd=0xa;var _0x1d87d0=[_0x3855('0x51'),_0x3855('0x52'),_0x3855('0x53'),_0x3855('0x54')];var _0x2c1485={'SUM':_0x3855('0x55'),'COUNT':_0x3855('0x56'),'COUNT DISTINCT':_0x3855('0x57'),'MAX':_0x3855('0x58'),'MIN':'MIN(%s)','AVG':_0x3855('0x59'),'GROUP_CONCAT':_0x3855('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x261a82={'SEC_TO_TIME':_0x3855('0x5b'),'DATE':_0x3855('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x3855('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x35bca4=function(_0x22b4a9){return!_[_0x3855('0x5e')]([_0x3855('0x5f'),_0x3855('0x60'),'IS\x20EMPTY',_0x3855('0x61')],_0x22b4a9);};var _0x3ac732=function(_0xb20655){if(!_0xb20655||!_0xb20655['rules'][_0x3855('0x38')]){return'';}for(var _0x1646c3='(',_0x33e001=0x0;_0x33e001<_0xb20655[_0x3855('0x62')][_0x3855('0x38')];_0x33e001+=0x1){_0x33e001>0x0&&(_0x1646c3+='\x20'+_0xb20655[_0x3855('0x63')]+'\x20');_0x1646c3+=_0xb20655[_0x3855('0x62')][_0x33e001][_0x3855('0x64')]?_0x3ac732(_0xb20655['rules'][_0x33e001]['group']):_0xb20655['rules'][_0x33e001][_0x3855('0x65')]+'\x20'+_0xb20655[_0x3855('0x62')][_0x33e001][_0x3855('0x66')]+(_0x35bca4(_0xb20655[_0x3855('0x62')][_0x33e001][_0x3855('0x66')])?'\x20'+_0xb20655['rules'][_0x33e001]['value']:'');}return _0x1646c3+')';};var _0x402d4d={'where':{'id':_0x5a32a5[_0x3855('0x47')]['id']}},_0x4f800c,_0x27605b,_0x21923c,_0x4bffbe,_0x4af6c0;_0x402d4d=_[_0x3855('0x3f')]({},_0x402d4d,_0x5a32a5[_0x3855('0x40')]);return db[_0x3855('0x2d')][_0x3855('0x48')](_0x402d4d)[_0x3855('0x23')](function(_0x3c4c55){if(_0x3c4c55){_0x4f800c=_0x3c4c55;return _0x3c4c55['getFields']();}return null;})[_0x3855('0x23')](function(_0x5bc0cc){if(_0x5bc0cc){if(!_0x5bc0cc[_0x3855('0x38')]){throw new db['Sequelize'][(_0x3855('0x67'))](_0x3855('0x68'),0x193);}_0x27605b=_0x5bc0cc;return db[_0x3855('0x69')][_0x3855('0x43')]({'raw':!![]});}return null;})[_0x3855('0x23')](function(_0x2a0209){if(_0x2a0209){_0x21923c=_[_0x3855('0x6a')](_0x2a0209,'id');var _0x9d5a4;var _0x27048d=squel[_0x3855('0x6b')]();_0x27048d['from'](_0x4f800c[_0x3855('0x6c')]);for(var _0x1f6a38=0x0;_0x1f6a38<_0x27605b[_0x3855('0x38')];_0x1f6a38+=0x1){_0x9d5a4=_0x27605b[_0x1f6a38]['MetricId']?_0x21923c[_0x27605b[_0x1f6a38]['MetricId']][_0x3855('0x6d')]:_0x27605b[_0x1f6a38][_0x3855('0x65')];_0x9d5a4=_0x27605b[_0x1f6a38][_0x3855('0x6e')]?_['replace'](_0x2c1485[_0x27605b[_0x1f6a38][_0x3855('0x6e')]],'%s',_0x9d5a4):_0x9d5a4;_0x9d5a4=_0x27605b[_0x1f6a38][_0x3855('0x6f')]?_[_0x3855('0x70')](_0x261a82[_0x27605b[_0x1f6a38][_0x3855('0x6f')]],'%s',_0x9d5a4):_0x9d5a4;if(_0x27605b[_0x1f6a38][_0x3855('0x71')]){_0x27048d['group'](_0x9d5a4);}_0x27605b[_0x1f6a38]['orderBy']&&_0x27048d[_0x3855('0x3a')](_0x9d5a4,_0x27605b[_0x1f6a38][_0x3855('0x72')]===_0x3855('0x73')?![]:!![]);_0x27048d[_0x3855('0x65')](_0x9d5a4,_0x27605b[_0x1f6a38]['alias']||_0x9d5a4);}if(_0x4f800c[_0x3855('0x74')]){_0x4f800c[_0x3855('0x74')]=JSON[_0x3855('0x75')](_0x4f800c['joins']);for(var _0x2e1afb=0x0;_0x2e1afb<_0x4f800c[_0x3855('0x74')][_0x3855('0x38')];_0x2e1afb+=0x1){if(_0x4f800c[_0x3855('0x74')][_0x2e1afb][_0x3855('0x2f')]&&_[_0x3855('0x5e')](_0x1d87d0,_0x4f800c[_0x3855('0x74')][_0x2e1afb][_0x3855('0x2f')])&&_0x4f800c[_0x3855('0x74')][_0x2e1afb][_0x3855('0x76')]&&_0x4f800c['joins'][_0x2e1afb][_0x3855('0x77')]&&_0x4f800c[_0x3855('0x74')][_0x2e1afb]['foreignKey']){_0x27048d[_0x4f800c[_0x3855('0x74')][_0x2e1afb][_0x3855('0x2f')]](_0x4f800c['joins'][_0x2e1afb][_0x3855('0x77')],null,util['format'](_0x3855('0x78'),_0x4f800c[_0x3855('0x6c')],_0x4f800c[_0x3855('0x74')][_0x2e1afb][_0x3855('0x76')],_0x4f800c[_0x3855('0x74')][_0x2e1afb][_0x3855('0x77')],_0x4f800c[_0x3855('0x74')][_0x2e1afb][_0x3855('0x79')]));}}}if(_0x4f800c[_0x3855('0x7a')]){_0x4f800c[_0x3855('0x7a')]=JSON[_0x3855('0x75')](_0x4f800c[_0x3855('0x7a')]);_0x27048d[_0x3855('0x3c')](_0x3ac732(_0x4f800c[_0x3855('0x7a')][_0x3855('0x64')]));}_0x4af6c0=_0x27048d[_0x3855('0x7b')]();_0x27048d[_0x3855('0x1b')](_0x3378dd);_0x27048d[_0x3855('0x1a')](0x0);logger['debug'](_0x3855('0x7c'),_0x27048d['toString']());return dbH[_0x3855('0x7d')][_0x3855('0x31')](_0x27048d[_0x3855('0x7e')](),{'type':dbH[_0x3855('0x7d')][_0x3855('0x7f')][_0x3855('0x80')]});}})['then'](respondWithResult(_0x17cf6b,null))[_0x3855('0x45')](handleError(_0x17cf6b,null));};function runReport(_0x20d13f,_0x370f09,_0x381450){var _0x324f0a=_0x370f09[_0x3855('0x2a')];var _0x4ad50a=0xa;var _0x4da3da=[_0x3855('0x51'),_0x3855('0x52'),_0x3855('0x53'),'cross_join'];var _0x4f5ab5={'SUM':_0x3855('0x55'),'COUNT':_0x3855('0x56'),'COUNT DISTINCT':_0x3855('0x57'),'MAX':_0x3855('0x58'),'MIN':_0x3855('0x81'),'AVG':_0x3855('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3855('0x82'),'GROUP_CONCAT DESC':_0x3855('0x83')};var _0x460d9b={'SEC_TO_TIME':_0x3855('0x5b'),'DATE':_0x3855('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x3855('0x5d'),'UNIX_TIMESTAMP':_0x3855('0x84')};var _0x4a3045=function(_0x4d5c17){return!_[_0x3855('0x5e')]([_0x3855('0x5f'),_0x3855('0x60'),_0x3855('0x85'),'IS\x20NOT\x20EMPTY'],_0x4d5c17);};var _0x294076=function(_0x34cb44){if(!_0x34cb44||!_0x34cb44[_0x3855('0x62')]['length']){return'';}for(var _0x49bc84='(',_0x71e214=0x0;_0x71e214<_0x34cb44[_0x3855('0x62')]['length'];_0x71e214+=0x1){_0x71e214>0x0&&(_0x49bc84+='\x20'+_0x34cb44[_0x3855('0x63')]+'\x20');_0x49bc84+=_0x34cb44['rules'][_0x71e214]['group']?_0x294076(_0x34cb44[_0x3855('0x62')][_0x71e214]['group']):_0x34cb44[_0x3855('0x62')][_0x71e214][_0x3855('0x65')]+'\x20'+_0x34cb44['rules'][_0x71e214][_0x3855('0x66')]+(_0x4a3045(_0x34cb44[_0x3855('0x62')][_0x71e214][_0x3855('0x66')])?'\x20'+_0x34cb44[_0x3855('0x62')][_0x71e214][_0x3855('0x86')]:'');}return _0x49bc84+')';};var _0x5c0aab={'where':{'id':_0x20d13f['id']}},_0x29f4a3,_0x351583,_0x2df27b,_0x108a83,_0x2761ee;_0x5c0aab=_[_0x3855('0x3f')]({},_0x5c0aab,_0x381450);return db['AnalyticCustomReport']['find'](_0x5c0aab)[_0x3855('0x23')](function(_0x335485){if(_0x335485){_0x29f4a3=_0x335485;return _0x335485['getFields']();}return null;})[_0x3855('0x23')](function(_0x5c1408){if(_0x5c1408){if(!_0x5c1408['length']){throw new db['Sequelize'][(_0x3855('0x67'))](_0x3855('0x68'),0x193);}_0x351583=_0x5c1408;return db[_0x3855('0x69')][_0x3855('0x43')]({'raw':!![]});}return null;})['then'](function(_0x143087){if(_0x143087){_0x2df27b=_[_0x3855('0x6a')](_0x143087,'id');var _0x1cd268;var _0x210e52=squel[_0x3855('0x6b')]();_0x210e52[_0x3855('0x87')](_0x29f4a3[_0x3855('0x6c')]);for(var _0xbe951b=0x0;_0xbe951b<_0x351583[_0x3855('0x38')];_0xbe951b+=0x1){_0x1cd268=_0x351583[_0xbe951b]['MetricId']?_0x2df27b[_0x351583[_0xbe951b][_0x3855('0x88')]]['metric']:_0x351583[_0xbe951b][_0x3855('0x65')];_0x1cd268=_0x351583[_0xbe951b][_0x3855('0x6e')]?_[_0x3855('0x70')](_0x4f5ab5[_0x351583[_0xbe951b][_0x3855('0x6e')]],'%s',_0x1cd268):_0x1cd268;_0x1cd268=_0x351583[_0xbe951b][_0x3855('0x6f')]?_[_0x3855('0x70')](_0x460d9b[_0x351583[_0xbe951b]['format']],'%s',_0x1cd268):_0x1cd268;if(_0x351583[_0xbe951b]['groupBy']){_0x210e52['group'](_0x1cd268);}_0x351583[_0xbe951b][_0x3855('0x72')]&&_0x210e52[_0x3855('0x3a')](_0x1cd268,_0x351583[_0xbe951b][_0x3855('0x72')]===_0x3855('0x73')?![]:!![]);_0x210e52[_0x3855('0x65')](_0x1cd268,_0x351583[_0xbe951b][_0x3855('0x89')]||_0x1cd268);}if(_0x29f4a3[_0x3855('0x74')]){_0x29f4a3[_0x3855('0x74')]=JSON[_0x3855('0x75')](_0x29f4a3[_0x3855('0x74')]);for(var _0x2d9565=0x0;_0x2d9565<_0x29f4a3[_0x3855('0x74')][_0x3855('0x38')];_0x2d9565+=0x1){if(_0x29f4a3[_0x3855('0x74')][_0x2d9565]['type']&&_[_0x3855('0x5e')](_0x4da3da,_0x29f4a3[_0x3855('0x74')][_0x2d9565]['type'])&&_0x29f4a3[_0x3855('0x74')][_0x2d9565]['parentKey']&&_0x29f4a3['joins'][_0x2d9565][_0x3855('0x77')]&&_0x29f4a3[_0x3855('0x74')][_0x2d9565]['foreignKey']){_0x210e52[_0x29f4a3['joins'][_0x2d9565][_0x3855('0x2f')]](_0x29f4a3[_0x3855('0x74')][_0x2d9565][_0x3855('0x77')],null,util[_0x3855('0x6f')](_0x3855('0x78'),_0x29f4a3[_0x3855('0x6c')],_0x29f4a3[_0x3855('0x74')][_0x2d9565][_0x3855('0x76')],_0x29f4a3[_0x3855('0x74')][_0x2d9565][_0x3855('0x77')],_0x29f4a3[_0x3855('0x74')][_0x2d9565][_0x3855('0x79')]));}}}if(_0x29f4a3[_0x3855('0x7a')]){_0x29f4a3['conditions']=JSON['parse'](_0x29f4a3[_0x3855('0x7a')]);_0x210e52[_0x3855('0x3c')](_0x294076(_0x29f4a3[_0x3855('0x7a')][_0x3855('0x64')]));}_0x2761ee=_0x210e52['clone']();_0x210e52[_0x3855('0x1b')](_0x4ad50a);_0x210e52[_0x3855('0x1a')](0x0);return;}})[_0x3855('0x23')](function(){if(_0x370f09['output']==='web'){return null;}var _0x4120d7=_['merge'](_0x370f09,{'name':_0x370f09[_0x3855('0x8a')]||_0x370f09[_0x3855('0x2a')]||_0x29f4a3[_0x3855('0x2a')],'basename':_0x324f0a,'savename':util['format'](_0x3855('0x8b'),_0x370f09[_0x3855('0x2a')]||_0x29f4a3[_0x3855('0x2a')],require(_0x3855('0x8c'))[_0x3855('0x8d')](0x4),_0x370f09[_0x3855('0x8e')]||_0x3855('0x8f')),'reportId':_0x29f4a3['id'],'reportType':_0x3855('0x90')});return db[_0x3855('0x91')][_0x3855('0x49')](_0x4120d7,{'raw':!![]});})[_0x3855('0x23')](function(_0x220117){if(_0x29f4a3[_0x3855('0x6c')]==='cdr'){_0x2761ee['where'](_0x29f4a3['table']+_0x3855('0x92'),_0x370f09[_0x3855('0x93')],_0x370f09['endDate']);}else{_0x2761ee['where'](_0x29f4a3['table']+_0x3855('0x94'),_0x370f09['startDate'],_0x370f09[_0x3855('0x95')]);}if(_0x220117){logger[_0x3855('0x96')](_0x3855('0x97'),_0x2761ee['toString']());require(_0x3855('0x98'))['fork'](path[_0x3855('0x51')](__dirname,_0x3855('0x99'),_0x220117['output']),[_0x220117['id'],_0x2761ee[_0x3855('0x7e')](),path['join'](__dirname,_0x3855('0x9a'),_0x220117[_0x3855('0x9b')]),_0x324f0a]);return _0x220117;}else{var _0x4fd6f1=squel[_0x3855('0x6b')]();_0x4fd6f1[_0x3855('0x87')]('('+_0x2761ee[_0x3855('0x7e')]()+')',_0x3855('0x9c'));_0x4fd6f1[_0x3855('0x65')](_0x3855('0x9d'),'count');_0x2761ee[_0x3855('0x1b')](_0x370f09['limit']||_0x4ad50a);_0x2761ee[_0x3855('0x1a')](_0x370f09[_0x3855('0x1a')]||0x0);return dbH[_0x3855('0x7d')][_0x3855('0x31')](_0x4fd6f1['toString'](),{'type':dbH[_0x3855('0x7d')][_0x3855('0x7f')][_0x3855('0x80')]})['then'](function(_0x24414c){if(!_0x24414c['length']){_0x108a83=0x0;}else{_0x108a83=_0x24414c[0x0][_0x3855('0x1c')]||0x0;}return dbH[_0x3855('0x7d')][_0x3855('0x31')](_0x2761ee[_0x3855('0x7e')](),{'type':dbH[_0x3855('0x7d')]['QueryTypes']['SELECT']});})['then'](function(_0x3157c0){return{'rows':_0x3157c0||[],'count':_0x108a83};});}});}exports[_0x3855('0x9e')]=function(_0x423791,_0x422ccd){return runReport(_0x423791[_0x3855('0x47')],_0x423791[_0x3855('0x31')],_0x423791[_0x3855('0x40')])[_0x3855('0x23')](respondWithResult(_0x422ccd,null))[_0x3855('0x45')](handleError(_0x422ccd,null));};exports[_0x3855('0x9f')]=runReport;exports[_0x3855('0x31')]=function(_0x285c6c,_0x3647c3){var _0x2c53ce=0xa;var _0x37f260=[_0x3855('0x51'),_0x3855('0x52'),'right_join',_0x3855('0x54')];var _0x5ad4e0={'SUM':_0x3855('0x55'),'COUNT':_0x3855('0x56'),'COUNT DISTINCT':_0x3855('0x57'),'MAX':_0x3855('0x58'),'MIN':_0x3855('0x81'),'AVG':_0x3855('0x59'),'GROUP_CONCAT':_0x3855('0x5a'),'GROUP_CONCAT ASC':_0x3855('0x82'),'GROUP_CONCAT DESC':_0x3855('0x83')};var _0x246536={'SEC_TO_TIME':_0x3855('0x5b'),'DATE':'DATE(%s)','HOUR':_0x3855('0xa0'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bac72=function(_0x5e8bcb){return!_['includes'](['IS\x20NULL',_0x3855('0x60'),_0x3855('0x85'),_0x3855('0x61')],_0x5e8bcb);};var _0x409e80=function(_0x361c35){if(!_0x361c35||!_0x361c35[_0x3855('0x62')]['length']){return'';}for(var _0x3d7f39='(',_0x143ff7=0x0;_0x143ff7<_0x361c35[_0x3855('0x62')][_0x3855('0x38')];_0x143ff7+=0x1){_0x143ff7>0x0&&(_0x3d7f39+='\x20'+_0x361c35['operator']+'\x20');_0x3d7f39+=_0x361c35['rules'][_0x143ff7][_0x3855('0x64')]?_0x409e80(_0x361c35[_0x3855('0x62')][_0x143ff7][_0x3855('0x64')]):_0x361c35['rules'][_0x143ff7][_0x3855('0x65')]+'\x20'+_0x361c35[_0x3855('0x62')][_0x143ff7][_0x3855('0x66')]+(_0x5bac72(_0x361c35['rules'][_0x143ff7]['condition'])?'\x20'+_0x361c35[_0x3855('0x62')][_0x143ff7][_0x3855('0x86')]:'');}return _0x3d7f39+')';};var _0x1041ed={'where':{'id':_0x285c6c['params']['id']}},_0x569b01,_0xc521d6,_0x3dc8e8,_0x4b1ebb,_0x5a087d;_0x1041ed=_['merge']({},_0x1041ed,_0x285c6c[_0x3855('0x40')]);return db[_0x3855('0x2d')]['find'](_0x1041ed)[_0x3855('0x23')](function(_0x534ef1){if(_0x534ef1){_0x569b01=_0x534ef1;return _0x534ef1['getFields']();}return null;})[_0x3855('0x23')](function(_0x39d911){if(_0x39d911){if(!_0x39d911[_0x3855('0x38')]){throw new db['Sequelize'][(_0x3855('0x67'))](_0x3855('0x68'),0x193);}_0xc521d6=_0x39d911;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x3855('0x23')](function(_0xcf4d75){if(_0xcf4d75){_0x3dc8e8=_[_0x3855('0x6a')](_0xcf4d75,'id');var _0x302814;var _0x52fb12=squel['select']();_0x52fb12[_0x3855('0x87')](_0x569b01['table']);for(var _0x185909=0x0;_0x185909<_0xc521d6[_0x3855('0x38')];_0x185909+=0x1){_0x302814=_0xc521d6[_0x185909][_0x3855('0x88')]?_0x3dc8e8[_0xc521d6[_0x185909][_0x3855('0x88')]][_0x3855('0x6d')]:_0xc521d6[_0x185909]['field'];_0x302814=_0xc521d6[_0x185909][_0x3855('0x6e')]?_[_0x3855('0x70')](_0x5ad4e0[_0xc521d6[_0x185909][_0x3855('0x6e')]],'%s',_0x302814):_0x302814;_0x302814=_0xc521d6[_0x185909][_0x3855('0x6f')]?_['replace'](_0x246536[_0xc521d6[_0x185909][_0x3855('0x6f')]],'%s',_0x302814):_0x302814;if(_0xc521d6[_0x185909][_0x3855('0x71')]){_0x52fb12['group'](_0x302814);}_0xc521d6[_0x185909][_0x3855('0x72')]&&_0x52fb12['order'](_0x302814,_0xc521d6[_0x185909][_0x3855('0x72')]===_0x3855('0x73')?![]:!![]);_0x52fb12[_0x3855('0x65')](_0x302814,_0xc521d6[_0x185909][_0x3855('0x89')]||_0x302814);}if(_0x569b01['joins']){_0x569b01[_0x3855('0x74')]=JSON['parse'](_0x569b01['joins']);for(var _0xf912b2=0x0;_0xf912b2<_0x569b01['joins'][_0x3855('0x38')];_0xf912b2+=0x1){if(_0x569b01[_0x3855('0x74')][_0xf912b2]['type']&&_[_0x3855('0x5e')](_0x37f260,_0x569b01[_0x3855('0x74')][_0xf912b2][_0x3855('0x2f')])&&_0x569b01[_0x3855('0x74')][_0xf912b2]['parentKey']&&_0x569b01[_0x3855('0x74')][_0xf912b2][_0x3855('0x77')]&&_0x569b01[_0x3855('0x74')][_0xf912b2][_0x3855('0x79')]){_0x52fb12[_0x569b01[_0x3855('0x74')][_0xf912b2][_0x3855('0x2f')]](_0x569b01['joins'][_0xf912b2][_0x3855('0x77')],null,util[_0x3855('0x6f')](_0x3855('0x78'),_0x569b01[_0x3855('0x6c')],_0x569b01['joins'][_0xf912b2][_0x3855('0x76')],_0x569b01[_0x3855('0x74')][_0xf912b2][_0x3855('0x77')],_0x569b01['joins'][_0xf912b2][_0x3855('0x79')]));}}}if(_0x569b01[_0x3855('0x7a')]){_0x569b01[_0x3855('0x7a')]=JSON[_0x3855('0x75')](_0x569b01['conditions']);_0x52fb12[_0x3855('0x3c')](_0x409e80(_0x569b01['conditions'][_0x3855('0x64')]));}_0x5a087d=_0x52fb12[_0x3855('0x7b')]();_0x52fb12[_0x3855('0x1b')](_0x2c53ce);_0x52fb12[_0x3855('0x1a')](0x0);logger[_0x3855('0xa1')](_0x3855('0x7c'),_0x52fb12[_0x3855('0x7e')]());return dbH[_0x3855('0x7d')][_0x3855('0x31')](_0x52fb12['toString'](),{'type':dbH[_0x3855('0x7d')][_0x3855('0x7f')]['SELECT']});}})[_0x3855('0x23')](function(){return{'sql':_0x5a087d[_0x3855('0x7e')]()};})['then'](respondWithResult(_0x3647c3,null))[_0x3855('0x45')](handleError(_0x3647c3,null));};
\ No newline at end of file
+var _0xb98b=['bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','CustomReports','sendStatus','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','function','format','groupBy','orderBy','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','MAX(%s)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','operator','Sequelize','replace','parentKey','clone','output','web','fullPath','%s-%s.%s','AnalyticExtractedReport','cdr','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','DESC','fast-json-patch','request-promise','moment'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xb98b,0x13b));var _0xbb98=function(_0x49b22c,_0x299df5){_0x49b22c=_0x49b22c-0x0;var _0x16d85b=_0xb98b[_0x49b22c];return _0x16d85b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbb98('0x0'));var rp=require(_0xbb98('0x1'));var moment=require(_0xbb98('0x2'));var BPromise=require(_0xbb98('0x3'));var Mustache=require(_0xbb98('0x4'));var util=require(_0xbb98('0x5'));var path=require(_0xbb98('0x6'));var sox=require(_0xbb98('0x7'));var csv=require(_0xbb98('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb98('0x9'));var _=require(_0xbb98('0xa'));var squel=require(_0xbb98('0xb'));var crypto=require(_0xbb98('0xc'));var jsforce=require(_0xbb98('0xd'));var deskjs=require(_0xbb98('0xe'));var toCsv=require(_0xbb98('0x8'));var querystring=require(_0xbb98('0xf'));var Papa=require(_0xbb98('0x10'));var Redis=require(_0xbb98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbb98('0x12'));var as=require(_0xbb98('0x13'));var hardwareService=require(_0xbb98('0x14'));var logger=require(_0xbb98('0x15'))(_0xbb98('0x16'));var utils=require(_0xbb98('0x17'));var config=require(_0xbb98('0x18'));var licenseUtil=require(_0xbb98('0x19'));var db=require(_0xbb98('0x1a'))['db'];var dbH=require(_0xbb98('0x1a'))['dbH'];function respondWithStatusCode(_0x3b9af9,_0x4cb4f2){_0x4cb4f2=_0x4cb4f2||0xcc;return function(_0x1492fa){if(_0x1492fa){return _0x3b9af9['sendStatus'](_0x4cb4f2);}return _0x3b9af9[_0xbb98('0x1b')](_0x4cb4f2)[_0xbb98('0x1c')]();};}function respondWithResult(_0x15e059,_0x51893d){_0x51893d=_0x51893d||0xc8;return function(_0x62f59b){if(_0x62f59b){return _0x15e059['status'](_0x51893d)[_0xbb98('0x1d')](_0x62f59b);}};}function respondWithFilteredResult(_0x2e7a84,_0x466c3a){return function(_0x19fa40){if(_0x19fa40){var _0x43ceba=typeof _0x466c3a[_0xbb98('0x1e')]===_0xbb98('0x1f')&&typeof _0x466c3a[_0xbb98('0x20')]===_0xbb98('0x1f');var _0x340a59=_0x19fa40[_0xbb98('0x21')];var _0x3c7297=_0x43ceba?0x0:_0x466c3a['offset'];var _0x149455=_0x43ceba?_0x19fa40['count']:_0x466c3a[_0xbb98('0x1e')]+_0x466c3a[_0xbb98('0x20')];var _0x475d84;if(_0x149455>=_0x340a59){_0x149455=_0x340a59;_0x475d84=0xc8;}else{_0x475d84=0xce;}_0x2e7a84[_0xbb98('0x1b')](_0x475d84);return _0x2e7a84[_0xbb98('0x22')](_0xbb98('0x23'),_0x3c7297+'-'+_0x149455+'/'+_0x340a59)[_0xbb98('0x1d')](_0x19fa40);}return null;};}function patchUpdates(_0x524a7e){return function(_0x292808){try{jsonpatch['apply'](_0x292808,_0x524a7e,!![]);}catch(_0x154828){return BPromise['reject'](_0x154828);}return _0x292808[_0xbb98('0x24')]();};}function saveUpdates(_0xa2c138,_0x4eebf3){return function(_0x161107){if(_0x161107){return _0x161107[_0xbb98('0x25')](_0xa2c138)[_0xbb98('0x26')](function(_0x38590b){return _0x38590b;});}return null;};}function removeEntity(_0x44734a,_0x5c04dc){return function(_0x4c7024){if(_0x4c7024){return _0x4c7024['destroy']()[_0xbb98('0x26')](function(){var _0x35c2f7=_0x4c7024[_0xbb98('0x27')]({'plain':!![]});var _0x1651af=_0xbb98('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x1651af,'resourceId':_0x35c2f7['id']}})[_0xbb98('0x26')](function(){return _0x4c7024;});})[_0xbb98('0x26')](function(){_0x44734a[_0xbb98('0x1b')](0xcc)[_0xbb98('0x1c')]();});}};}function handleEntityNotFound(_0x19d2e5,_0x949c22){return function(_0x5a1022){if(!_0x5a1022){_0x19d2e5[_0xbb98('0x29')](0x194);}return _0x5a1022;};}function handleError(_0x4bd18f,_0x2b6e37){_0x2b6e37=_0x2b6e37||0x1f4;return function(_0x155b76){logger['error'](_0x155b76[_0xbb98('0x2a')]);if(_0x155b76[_0xbb98('0x2b')]){delete _0x155b76['name'];}_0x4bd18f[_0xbb98('0x1b')](_0x2b6e37)[_0xbb98('0x2c')](_0x155b76);};}exports['index']=function(_0xa07dbd,_0x30d823){var _0x3e6cf8={},_0x2b94e3={},_0x3d0f43={'count':0x0,'rows':[]};var _0x2c3e7e=_[_0xbb98('0x2d')](db[_0xbb98('0x2e')][_0xbb98('0x2f')],function(_0x29dbdd){return{'name':_0x29dbdd[_0xbb98('0x30')],'type':_0x29dbdd['type']['key']};});_0x2b94e3['model']=_[_0xbb98('0x2d')](_0x2c3e7e,_0xbb98('0x2b'));_0x2b94e3[_0xbb98('0x31')]=_[_0xbb98('0x32')](_0xa07dbd[_0xbb98('0x31')]);_0x2b94e3[_0xbb98('0x33')]=_[_0xbb98('0x34')](_0x2b94e3[_0xbb98('0x35')],_0x2b94e3[_0xbb98('0x31')]);_0x3e6cf8[_0xbb98('0x36')]=_[_0xbb98('0x34')](_0x2b94e3['model'],qs['fields'](_0xa07dbd[_0xbb98('0x31')][_0xbb98('0x37')]));_0x3e6cf8['attributes']=_0x3e6cf8[_0xbb98('0x36')][_0xbb98('0x38')]?_0x3e6cf8[_0xbb98('0x36')]:_0x2b94e3[_0xbb98('0x35')];if(!_0xa07dbd[_0xbb98('0x31')][_0xbb98('0x39')]('nolimit')){_0x3e6cf8['limit']=qs[_0xbb98('0x20')](_0xa07dbd[_0xbb98('0x31')][_0xbb98('0x20')]);_0x3e6cf8[_0xbb98('0x1e')]=qs[_0xbb98('0x1e')](_0xa07dbd[_0xbb98('0x31')][_0xbb98('0x1e')]);}_0x3e6cf8['order']=qs[_0xbb98('0x3a')](_0xa07dbd[_0xbb98('0x31')]['sort']);_0x3e6cf8[_0xbb98('0x3b')]=qs[_0xbb98('0x33')](_[_0xbb98('0x3c')](_0xa07dbd[_0xbb98('0x31')],_0x2b94e3['filters']),_0x2c3e7e);if(_0xa07dbd[_0xbb98('0x31')][_0xbb98('0x3d')]){_0x3e6cf8['where']=_[_0xbb98('0x3e')](_0x3e6cf8[_0xbb98('0x3b')],{'$or':_[_0xbb98('0x2d')](_0x2c3e7e,function(_0x1ea068){if(_0x1ea068[_0xbb98('0x3f')]!=='VIRTUAL'){var _0x29dce2={};_0x29dce2[_0x1ea068[_0xbb98('0x2b')]]={'$like':'%'+_0xa07dbd[_0xbb98('0x31')]['filter']+'%'};return _0x29dce2;}})});}_0x3e6cf8=_[_0xbb98('0x3e')]({},_0x3e6cf8,_0xa07dbd[_0xbb98('0x40')]);var _0x47c579={'where':_0x3e6cf8[_0xbb98('0x3b')]};return db[_0xbb98('0x2e')]['count'](_0x47c579)[_0xbb98('0x26')](function(_0x103251){_0x3d0f43['count']=_0x103251;if(_0xa07dbd[_0xbb98('0x31')][_0xbb98('0x41')]){_0x3e6cf8[_0xbb98('0x42')]=[{'all':!![]}];}return db[_0xbb98('0x2e')][_0xbb98('0x43')](_0x3e6cf8);})[_0xbb98('0x26')](function(_0x53f215){_0x3d0f43[_0xbb98('0x44')]=_0x53f215;return _0x3d0f43;})[_0xbb98('0x26')](respondWithFilteredResult(_0x30d823,_0x3e6cf8))[_0xbb98('0x45')](handleError(_0x30d823,null));};exports[_0xbb98('0x46')]=function(_0x370030,_0x4537f9){var _0x282c47={'raw':![],'where':{'id':_0x370030[_0xbb98('0x47')]['id']}},_0x43b940={};_0x43b940[_0xbb98('0x35')]=_[_0xbb98('0x32')](db['AnalyticCustomReport'][_0xbb98('0x2f')]);_0x43b940['query']=_[_0xbb98('0x32')](_0x370030[_0xbb98('0x31')]);_0x43b940['filters']=_[_0xbb98('0x34')](_0x43b940[_0xbb98('0x35')],_0x43b940['query']);_0x282c47[_0xbb98('0x36')]=_[_0xbb98('0x34')](_0x43b940[_0xbb98('0x35')],qs[_0xbb98('0x37')](_0x370030[_0xbb98('0x31')][_0xbb98('0x37')]));_0x282c47[_0xbb98('0x36')]=_0x282c47[_0xbb98('0x36')][_0xbb98('0x38')]?_0x282c47['attributes']:_0x43b940[_0xbb98('0x35')];if(_0x370030['query'][_0xbb98('0x41')]){_0x282c47['include']=[{'all':!![]}];}_0x282c47=_['merge']({},_0x282c47,_0x370030['options']);return db['AnalyticCustomReport'][_0xbb98('0x48')](_0x282c47)[_0xbb98('0x26')](handleEntityNotFound(_0x4537f9,null))[_0xbb98('0x26')](respondWithResult(_0x4537f9,null))[_0xbb98('0x45')](handleError(_0x4537f9,null));};exports[_0xbb98('0x49')]=function(_0x14f271,_0x47ff8c){return db[_0xbb98('0x2e')][_0xbb98('0x49')](_0x14f271[_0xbb98('0x4a')],{})[_0xbb98('0x26')](function(_0x46fb0d){var _0x4cb54e=_0x14f271[_0xbb98('0x4b')]['get']({'plain':!![]});if(!_0x4cb54e)throw new Error(_0xbb98('0x4c'));if(_0x4cb54e['role']===_0xbb98('0x4b')){var _0x4e74a1=_0x46fb0d['get']({'plain':!![]});var _0x5ba2fe=_0xbb98('0x4d');return db[_0xbb98('0x4e')][_0xbb98('0x48')]({'where':{'name':_0x5ba2fe,'userProfileId':_0x4cb54e[_0xbb98('0x4f')]},'raw':!![]})[_0xbb98('0x26')](function(_0x2aec7e){if(_0x2aec7e&&_0x2aec7e[_0xbb98('0x50')]===0x0){return db[_0xbb98('0x51')][_0xbb98('0x49')]({'name':_0x4e74a1[_0xbb98('0x2b')],'resourceId':_0x4e74a1['id'],'type':_0xbb98('0x28'),'sectionId':_0x2aec7e['id']},{})[_0xbb98('0x26')](function(){return _0x46fb0d;});}else{return _0x46fb0d;}})[_0xbb98('0x45')](function(_0x5e272d){logger[_0xbb98('0x52')](_0xbb98('0x53'),_0x5e272d);throw _0x5e272d;});}return _0x46fb0d;})['then'](respondWithResult(_0x47ff8c,0xc9))[_0xbb98('0x45')](handleError(_0x47ff8c,null));};exports[_0xbb98('0x25')]=function(_0x2292dc,_0x39871f){if(_0x2292dc['body']['id']){delete _0x2292dc[_0xbb98('0x4a')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x2292dc[_0xbb98('0x47')]['id']}})[_0xbb98('0x26')](handleEntityNotFound(_0x39871f,null))[_0xbb98('0x26')](saveUpdates(_0x2292dc[_0xbb98('0x4a')],null))[_0xbb98('0x26')](respondWithResult(_0x39871f,null))[_0xbb98('0x45')](handleError(_0x39871f,null));};exports[_0xbb98('0x54')]=function(_0x37c6e3,_0x4c3c23){return db[_0xbb98('0x2e')][_0xbb98('0x48')]({'where':{'id':_0x37c6e3[_0xbb98('0x47')]['id']}})[_0xbb98('0x26')](handleEntityNotFound(_0x4c3c23,null))['then'](removeEntity(_0x4c3c23,null))[_0xbb98('0x45')](handleError(_0x4c3c23,null));};exports[_0xbb98('0x55')]=function(_0x4088d7,_0x222b95){var _0x11b1b1=0xa;var _0x576b87=[_0xbb98('0x56'),_0xbb98('0x57'),_0xbb98('0x58'),_0xbb98('0x59')];var _0x2f4065={'SUM':'SUM(%s)','COUNT':_0xbb98('0x5a'),'COUNT DISTINCT':_0xbb98('0x5b'),'MAX':'MAX(%s)','MIN':_0xbb98('0x5c'),'AVG':_0xbb98('0x5d'),'GROUP_CONCAT':_0xbb98('0x5e'),'GROUP_CONCAT ASC':_0xbb98('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x56addb={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbb98('0x60'),'HOUR':_0xbb98('0x61'),'ROUND':_0xbb98('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x31398c=function(_0xc8badf){return!_[_0xbb98('0x63')]([_0xbb98('0x64'),_0xbb98('0x65'),_0xbb98('0x66'),'IS\x20NOT\x20EMPTY'],_0xc8badf);};var _0x2f70bb=function(_0x15aae6){if(!_0x15aae6||!_0x15aae6['rules'][_0xbb98('0x38')]){return'';}for(var _0x380013='(',_0x37209f=0x0;_0x37209f<_0x15aae6[_0xbb98('0x67')][_0xbb98('0x38')];_0x37209f+=0x1){_0x37209f>0x0&&(_0x380013+='\x20'+_0x15aae6['operator']+'\x20');_0x380013+=_0x15aae6[_0xbb98('0x67')][_0x37209f][_0xbb98('0x68')]?_0x2f70bb(_0x15aae6[_0xbb98('0x67')][_0x37209f][_0xbb98('0x68')]):_0x15aae6['rules'][_0x37209f][_0xbb98('0x69')]+'\x20'+_0x15aae6[_0xbb98('0x67')][_0x37209f][_0xbb98('0x6a')]+(_0x31398c(_0x15aae6['rules'][_0x37209f]['condition'])?'\x20'+_0x15aae6[_0xbb98('0x67')][_0x37209f][_0xbb98('0x6b')]:'');}return _0x380013+')';};var _0xb40791={'where':{'id':_0x4088d7[_0xbb98('0x47')]['id']}},_0x41a0d7,_0x2146b3,_0x19109e,_0x548a2c,_0x24690e;_0xb40791=_[_0xbb98('0x3e')]({},_0xb40791,_0x4088d7['options']);return db[_0xbb98('0x2e')][_0xbb98('0x48')](_0xb40791)['then'](function(_0x2de5a2){if(_0x2de5a2){_0x41a0d7=_0x2de5a2;return _0x2de5a2[_0xbb98('0x6c')]();}return null;})['then'](function(_0xdf4de6){if(_0xdf4de6){if(!_0xdf4de6[_0xbb98('0x38')]){throw new db['Sequelize'][(_0xbb98('0x6d'))](_0xbb98('0x6e'),0x193);}_0x2146b3=_0xdf4de6;return db[_0xbb98('0x6f')][_0xbb98('0x43')]({'raw':!![]});}return null;})['then'](function(_0xa2922){if(_0xa2922){_0x19109e=_['keyBy'](_0xa2922,'id');var _0x2b8e5b;var _0x21ec59=squel[_0xbb98('0x70')]();_0x21ec59[_0xbb98('0x71')](_0x41a0d7[_0xbb98('0x72')]);for(var _0x20c408=0x0;_0x20c408<_0x2146b3[_0xbb98('0x38')];_0x20c408+=0x1){_0x2b8e5b=_0x2146b3[_0x20c408][_0xbb98('0x73')]?_0x19109e[_0x2146b3[_0x20c408][_0xbb98('0x73')]][_0xbb98('0x74')]:_0x2146b3[_0x20c408][_0xbb98('0x69')];_0x2b8e5b=_0x2146b3[_0x20c408][_0xbb98('0x75')]?_['replace'](_0x2f4065[_0x2146b3[_0x20c408][_0xbb98('0x75')]],'%s',_0x2b8e5b):_0x2b8e5b;_0x2b8e5b=_0x2146b3[_0x20c408]['format']?_['replace'](_0x56addb[_0x2146b3[_0x20c408][_0xbb98('0x76')]],'%s',_0x2b8e5b):_0x2b8e5b;if(_0x2146b3[_0x20c408][_0xbb98('0x77')]){_0x21ec59[_0xbb98('0x68')](_0x2b8e5b);}_0x2146b3[_0x20c408][_0xbb98('0x78')]&&_0x21ec59['order'](_0x2b8e5b,_0x2146b3[_0x20c408][_0xbb98('0x78')]==='DESC'?![]:!![]);_0x21ec59[_0xbb98('0x69')](_0x2b8e5b,_0x2146b3[_0x20c408][_0xbb98('0x79')]||_0x2b8e5b);}if(_0x41a0d7[_0xbb98('0x7a')]){_0x41a0d7[_0xbb98('0x7a')]=JSON['parse'](_0x41a0d7[_0xbb98('0x7a')]);for(var _0xb4c0ad=0x0;_0xb4c0ad<_0x41a0d7[_0xbb98('0x7a')][_0xbb98('0x38')];_0xb4c0ad+=0x1){if(_0x41a0d7['joins'][_0xb4c0ad][_0xbb98('0x3f')]&&_[_0xbb98('0x63')](_0x576b87,_0x41a0d7[_0xbb98('0x7a')][_0xb4c0ad]['type'])&&_0x41a0d7[_0xbb98('0x7a')][_0xb4c0ad]['parentKey']&&_0x41a0d7[_0xbb98('0x7a')][_0xb4c0ad][_0xbb98('0x7b')]&&_0x41a0d7[_0xbb98('0x7a')][_0xb4c0ad][_0xbb98('0x7c')]){_0x21ec59[_0x41a0d7[_0xbb98('0x7a')][_0xb4c0ad][_0xbb98('0x3f')]](_0x41a0d7['joins'][_0xb4c0ad][_0xbb98('0x7b')],null,util[_0xbb98('0x76')](_0xbb98('0x7d'),_0x41a0d7['table'],_0x41a0d7['joins'][_0xb4c0ad]['parentKey'],_0x41a0d7[_0xbb98('0x7a')][_0xb4c0ad]['foreignTable'],_0x41a0d7[_0xbb98('0x7a')][_0xb4c0ad][_0xbb98('0x7c')]));}}}if(_0x41a0d7[_0xbb98('0x7e')]){_0x41a0d7[_0xbb98('0x7e')]=JSON[_0xbb98('0x7f')](_0x41a0d7[_0xbb98('0x7e')]);_0x21ec59[_0xbb98('0x3b')](_0x2f70bb(_0x41a0d7[_0xbb98('0x7e')]['group']));}_0x24690e=_0x21ec59['clone']();_0x21ec59['limit'](_0x11b1b1);_0x21ec59[_0xbb98('0x1e')](0x0);logger[_0xbb98('0x80')](_0xbb98('0x81'),_0x21ec59[_0xbb98('0x82')]());return dbH[_0xbb98('0x83')][_0xbb98('0x31')](_0x21ec59[_0xbb98('0x82')](),{'type':dbH[_0xbb98('0x83')][_0xbb98('0x84')][_0xbb98('0x85')]});}})[_0xbb98('0x26')](respondWithResult(_0x222b95,null))[_0xbb98('0x45')](handleError(_0x222b95,null));};function runReport(_0x85a0b0,_0x17f06b,_0x1ff8a2){var _0x3719ef=_0x17f06b['name'];var _0x4c7440=0xa;var _0x4868a4=[_0xbb98('0x56'),_0xbb98('0x57'),_0xbb98('0x58'),'cross_join'];var _0x58100f={'SUM':_0xbb98('0x86'),'COUNT':_0xbb98('0x5a'),'COUNT DISTINCT':_0xbb98('0x5b'),'MAX':_0xbb98('0x87'),'MIN':_0xbb98('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb98('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1744fd={'SEC_TO_TIME':_0xbb98('0x88'),'DATE':_0xbb98('0x60'),'HOUR':_0xbb98('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xbb98('0x89')};var _0x185464=function(_0x356901){return!_['includes'](['IS\x20NULL',_0xbb98('0x65'),_0xbb98('0x66'),'IS\x20NOT\x20EMPTY'],_0x356901);};var _0x1a3dea=function(_0x2691f3){if(!_0x2691f3||!_0x2691f3[_0xbb98('0x67')]['length']){return'';}for(var _0x4dadd5='(',_0x384b81=0x0;_0x384b81<_0x2691f3[_0xbb98('0x67')][_0xbb98('0x38')];_0x384b81+=0x1){_0x384b81>0x0&&(_0x4dadd5+='\x20'+_0x2691f3[_0xbb98('0x8a')]+'\x20');_0x4dadd5+=_0x2691f3['rules'][_0x384b81][_0xbb98('0x68')]?_0x1a3dea(_0x2691f3[_0xbb98('0x67')][_0x384b81][_0xbb98('0x68')]):_0x2691f3['rules'][_0x384b81]['field']+'\x20'+_0x2691f3[_0xbb98('0x67')][_0x384b81][_0xbb98('0x6a')]+(_0x185464(_0x2691f3[_0xbb98('0x67')][_0x384b81][_0xbb98('0x6a')])?'\x20'+_0x2691f3[_0xbb98('0x67')][_0x384b81]['value']:'');}return _0x4dadd5+')';};var _0x4aebde={'where':{'id':_0x85a0b0['id']}},_0x4a42c8,_0x4721b6,_0x2e22d3,_0x420f03,_0x9cba49;_0x4aebde=_['merge']({},_0x4aebde,_0x1ff8a2);return db[_0xbb98('0x2e')][_0xbb98('0x48')](_0x4aebde)[_0xbb98('0x26')](function(_0x40f73d){if(_0x40f73d){_0x4a42c8=_0x40f73d;return _0x40f73d[_0xbb98('0x6c')]();}return null;})[_0xbb98('0x26')](function(_0x16edc3){if(_0x16edc3){if(!_0x16edc3['length']){throw new db[(_0xbb98('0x8b'))][(_0xbb98('0x6d'))](_0xbb98('0x6e'),0x193);}_0x4721b6=_0x16edc3;return db[_0xbb98('0x6f')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x18cce2){if(_0x18cce2){_0x2e22d3=_['keyBy'](_0x18cce2,'id');var _0x131047;var _0x46b6e3=squel['select']();_0x46b6e3[_0xbb98('0x71')](_0x4a42c8[_0xbb98('0x72')]);for(var _0xe92090=0x0;_0xe92090<_0x4721b6[_0xbb98('0x38')];_0xe92090+=0x1){_0x131047=_0x4721b6[_0xe92090]['MetricId']?_0x2e22d3[_0x4721b6[_0xe92090][_0xbb98('0x73')]][_0xbb98('0x74')]:_0x4721b6[_0xe92090]['field'];_0x131047=_0x4721b6[_0xe92090][_0xbb98('0x75')]?_[_0xbb98('0x8c')](_0x58100f[_0x4721b6[_0xe92090][_0xbb98('0x75')]],'%s',_0x131047):_0x131047;_0x131047=_0x4721b6[_0xe92090][_0xbb98('0x76')]?_[_0xbb98('0x8c')](_0x1744fd[_0x4721b6[_0xe92090]['format']],'%s',_0x131047):_0x131047;if(_0x4721b6[_0xe92090][_0xbb98('0x77')]){_0x46b6e3[_0xbb98('0x68')](_0x131047);}_0x4721b6[_0xe92090][_0xbb98('0x78')]&&_0x46b6e3['order'](_0x131047,_0x4721b6[_0xe92090][_0xbb98('0x78')]==='DESC'?![]:!![]);_0x46b6e3[_0xbb98('0x69')](_0x131047,_0x4721b6[_0xe92090]['alias']||_0x131047);}if(_0x4a42c8[_0xbb98('0x7a')]){_0x4a42c8['joins']=JSON[_0xbb98('0x7f')](_0x4a42c8[_0xbb98('0x7a')]);for(var _0x5b0e4b=0x0;_0x5b0e4b<_0x4a42c8[_0xbb98('0x7a')][_0xbb98('0x38')];_0x5b0e4b+=0x1){if(_0x4a42c8[_0xbb98('0x7a')][_0x5b0e4b][_0xbb98('0x3f')]&&_['includes'](_0x4868a4,_0x4a42c8[_0xbb98('0x7a')][_0x5b0e4b][_0xbb98('0x3f')])&&_0x4a42c8[_0xbb98('0x7a')][_0x5b0e4b][_0xbb98('0x8d')]&&_0x4a42c8[_0xbb98('0x7a')][_0x5b0e4b]['foreignTable']&&_0x4a42c8[_0xbb98('0x7a')][_0x5b0e4b]['foreignKey']){_0x46b6e3[_0x4a42c8[_0xbb98('0x7a')][_0x5b0e4b][_0xbb98('0x3f')]](_0x4a42c8[_0xbb98('0x7a')][_0x5b0e4b][_0xbb98('0x7b')],null,util[_0xbb98('0x76')](_0xbb98('0x7d'),_0x4a42c8[_0xbb98('0x72')],_0x4a42c8['joins'][_0x5b0e4b]['parentKey'],_0x4a42c8[_0xbb98('0x7a')][_0x5b0e4b][_0xbb98('0x7b')],_0x4a42c8[_0xbb98('0x7a')][_0x5b0e4b][_0xbb98('0x7c')]));}}}if(_0x4a42c8[_0xbb98('0x7e')]){_0x4a42c8['conditions']=JSON[_0xbb98('0x7f')](_0x4a42c8[_0xbb98('0x7e')]);_0x46b6e3[_0xbb98('0x3b')](_0x1a3dea(_0x4a42c8[_0xbb98('0x7e')][_0xbb98('0x68')]));}_0x9cba49=_0x46b6e3[_0xbb98('0x8e')]();_0x46b6e3['limit'](_0x4c7440);_0x46b6e3['offset'](0x0);return;}})[_0xbb98('0x26')](function(){if(_0x17f06b[_0xbb98('0x8f')]===_0xbb98('0x90')){return null;}var _0x456f0d=_[_0xbb98('0x3e')](_0x17f06b,{'name':_0x17f06b[_0xbb98('0x91')]||_0x17f06b[_0xbb98('0x2b')]||_0x4a42c8[_0xbb98('0x2b')],'basename':_0x3719ef,'savename':util[_0xbb98('0x76')](_0xbb98('0x92'),_0x17f06b[_0xbb98('0x2b')]||_0x4a42c8['name'],require('randomstring')['generate'](0x4),_0x17f06b[_0xbb98('0x8f')]||'csv'),'reportId':_0x4a42c8['id'],'reportType':'custom'});return db[_0xbb98('0x93')][_0xbb98('0x49')](_0x456f0d,{'raw':!![]});})[_0xbb98('0x26')](function(_0x16fdd1){if(_0x4a42c8['table']===_0xbb98('0x94')){_0x9cba49[_0xbb98('0x3b')](_0x4a42c8[_0xbb98('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x17f06b['startDate'],_0x17f06b[_0xbb98('0x95')]);}else{_0x9cba49[_0xbb98('0x3b')](_0x4a42c8[_0xbb98('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x17f06b['startDate'],_0x17f06b[_0xbb98('0x95')]);}if(_0x16fdd1){logger[_0xbb98('0x96')](_0xbb98('0x97'),_0x9cba49[_0xbb98('0x82')]());require(_0xbb98('0x98'))['fork'](path[_0xbb98('0x56')](__dirname,_0xbb98('0x99'),_0x16fdd1[_0xbb98('0x8f')]),[_0x16fdd1['id'],_0x9cba49[_0xbb98('0x82')](),path[_0xbb98('0x56')](__dirname,_0xbb98('0x9a'),_0x16fdd1['savename']),_0x3719ef]);return _0x16fdd1;}else{var _0x375def=squel['select']();_0x375def[_0xbb98('0x71')]('('+_0x9cba49[_0xbb98('0x82')]()+')','countTable');_0x375def[_0xbb98('0x69')](_0xbb98('0x9b'),_0xbb98('0x21'));_0x9cba49[_0xbb98('0x20')](_0x17f06b['limit']||_0x4c7440);_0x9cba49[_0xbb98('0x1e')](_0x17f06b[_0xbb98('0x1e')]||0x0);return dbH[_0xbb98('0x83')][_0xbb98('0x31')](_0x375def[_0xbb98('0x82')](),{'type':dbH[_0xbb98('0x83')][_0xbb98('0x84')][_0xbb98('0x85')]})['then'](function(_0x10ee06){if(!_0x10ee06[_0xbb98('0x38')]){_0x420f03=0x0;}else{_0x420f03=_0x10ee06[0x0][_0xbb98('0x21')]||0x0;}return dbH[_0xbb98('0x83')][_0xbb98('0x31')](_0x9cba49['toString'](),{'type':dbH[_0xbb98('0x83')][_0xbb98('0x84')][_0xbb98('0x85')]});})[_0xbb98('0x26')](function(_0x44a54f){return{'rows':_0x44a54f||[],'count':_0x420f03};});}});}exports['run']=function(_0x514566,_0x433ba1){return runReport(_0x514566['params'],_0x514566[_0xbb98('0x31')],_0x514566[_0xbb98('0x40')])['then'](respondWithResult(_0x433ba1,null))[_0xbb98('0x45')](handleError(_0x433ba1,null));};exports['runReport']=runReport;exports[_0xbb98('0x31')]=function(_0x46725d,_0x1fd6f2){var _0x5b3265=0xa;var _0x21cee9=[_0xbb98('0x56'),_0xbb98('0x57'),_0xbb98('0x58'),_0xbb98('0x59')];var _0x5a3154={'SUM':_0xbb98('0x86'),'COUNT':_0xbb98('0x5a'),'COUNT DISTINCT':_0xbb98('0x5b'),'MAX':_0xbb98('0x87'),'MIN':_0xbb98('0x5c'),'AVG':_0xbb98('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xbb98('0x5f'),'GROUP_CONCAT DESC':_0xbb98('0x9c')};var _0x283f64={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbb98('0x60'),'HOUR':_0xbb98('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xbb98('0x89')};var _0x36948d=function(_0x262d62){return!_['includes'](['IS\x20NULL',_0xbb98('0x65'),_0xbb98('0x66'),_0xbb98('0x9d')],_0x262d62);};var _0x2f2fd0=function(_0x4d9a88){if(!_0x4d9a88||!_0x4d9a88[_0xbb98('0x67')]['length']){return'';}for(var _0x462c9e='(',_0xce0508=0x0;_0xce0508<_0x4d9a88['rules']['length'];_0xce0508+=0x1){_0xce0508>0x0&&(_0x462c9e+='\x20'+_0x4d9a88[_0xbb98('0x8a')]+'\x20');_0x462c9e+=_0x4d9a88[_0xbb98('0x67')][_0xce0508][_0xbb98('0x68')]?_0x2f2fd0(_0x4d9a88[_0xbb98('0x67')][_0xce0508][_0xbb98('0x68')]):_0x4d9a88[_0xbb98('0x67')][_0xce0508][_0xbb98('0x69')]+'\x20'+_0x4d9a88['rules'][_0xce0508][_0xbb98('0x6a')]+(_0x36948d(_0x4d9a88[_0xbb98('0x67')][_0xce0508]['condition'])?'\x20'+_0x4d9a88[_0xbb98('0x67')][_0xce0508][_0xbb98('0x6b')]:'');}return _0x462c9e+')';};var _0x36dd49={'where':{'id':_0x46725d[_0xbb98('0x47')]['id']}},_0x2c7f71,_0x4989a9,_0x1e4066,_0x34e596,_0x3b2a4c;_0x36dd49=_[_0xbb98('0x3e')]({},_0x36dd49,_0x46725d['options']);return db[_0xbb98('0x2e')][_0xbb98('0x48')](_0x36dd49)[_0xbb98('0x26')](function(_0x10db6f){if(_0x10db6f){_0x2c7f71=_0x10db6f;return _0x10db6f['getFields']();}return null;})[_0xbb98('0x26')](function(_0x9c7709){if(_0x9c7709){if(!_0x9c7709['length']){throw new db[(_0xbb98('0x8b'))][(_0xbb98('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4989a9=_0x9c7709;return db[_0xbb98('0x6f')][_0xbb98('0x43')]({'raw':!![]});}return null;})['then'](function(_0x5161c8){if(_0x5161c8){_0x1e4066=_['keyBy'](_0x5161c8,'id');var _0x1628c5;var _0x18d99f=squel[_0xbb98('0x70')]();_0x18d99f['from'](_0x2c7f71[_0xbb98('0x72')]);for(var _0x45d81d=0x0;_0x45d81d<_0x4989a9[_0xbb98('0x38')];_0x45d81d+=0x1){_0x1628c5=_0x4989a9[_0x45d81d]['MetricId']?_0x1e4066[_0x4989a9[_0x45d81d][_0xbb98('0x73')]][_0xbb98('0x74')]:_0x4989a9[_0x45d81d]['field'];_0x1628c5=_0x4989a9[_0x45d81d][_0xbb98('0x75')]?_['replace'](_0x5a3154[_0x4989a9[_0x45d81d][_0xbb98('0x75')]],'%s',_0x1628c5):_0x1628c5;_0x1628c5=_0x4989a9[_0x45d81d][_0xbb98('0x76')]?_[_0xbb98('0x8c')](_0x283f64[_0x4989a9[_0x45d81d][_0xbb98('0x76')]],'%s',_0x1628c5):_0x1628c5;if(_0x4989a9[_0x45d81d][_0xbb98('0x77')]){_0x18d99f[_0xbb98('0x68')](_0x1628c5);}_0x4989a9[_0x45d81d][_0xbb98('0x78')]&&_0x18d99f['order'](_0x1628c5,_0x4989a9[_0x45d81d][_0xbb98('0x78')]===_0xbb98('0x9e')?![]:!![]);_0x18d99f[_0xbb98('0x69')](_0x1628c5,_0x4989a9[_0x45d81d][_0xbb98('0x79')]||_0x1628c5);}if(_0x2c7f71['joins']){_0x2c7f71['joins']=JSON[_0xbb98('0x7f')](_0x2c7f71[_0xbb98('0x7a')]);for(var _0xe5fa70=0x0;_0xe5fa70<_0x2c7f71[_0xbb98('0x7a')][_0xbb98('0x38')];_0xe5fa70+=0x1){if(_0x2c7f71[_0xbb98('0x7a')][_0xe5fa70]['type']&&_[_0xbb98('0x63')](_0x21cee9,_0x2c7f71[_0xbb98('0x7a')][_0xe5fa70][_0xbb98('0x3f')])&&_0x2c7f71['joins'][_0xe5fa70][_0xbb98('0x8d')]&&_0x2c7f71[_0xbb98('0x7a')][_0xe5fa70]['foreignTable']&&_0x2c7f71['joins'][_0xe5fa70][_0xbb98('0x7c')]){_0x18d99f[_0x2c7f71[_0xbb98('0x7a')][_0xe5fa70][_0xbb98('0x3f')]](_0x2c7f71[_0xbb98('0x7a')][_0xe5fa70][_0xbb98('0x7b')],null,util[_0xbb98('0x76')]('%s.%s\x20=\x20%s.%s',_0x2c7f71[_0xbb98('0x72')],_0x2c7f71[_0xbb98('0x7a')][_0xe5fa70][_0xbb98('0x8d')],_0x2c7f71['joins'][_0xe5fa70]['foreignTable'],_0x2c7f71[_0xbb98('0x7a')][_0xe5fa70]['foreignKey']));}}}if(_0x2c7f71[_0xbb98('0x7e')]){_0x2c7f71[_0xbb98('0x7e')]=JSON[_0xbb98('0x7f')](_0x2c7f71['conditions']);_0x18d99f[_0xbb98('0x3b')](_0x2f2fd0(_0x2c7f71[_0xbb98('0x7e')][_0xbb98('0x68')]));}_0x3b2a4c=_0x18d99f[_0xbb98('0x8e')]();_0x18d99f['limit'](_0x5b3265);_0x18d99f['offset'](0x0);logger[_0xbb98('0x80')](_0xbb98('0x81'),_0x18d99f[_0xbb98('0x82')]());return dbH['sequelize']['query'](_0x18d99f['toString'](),{'type':dbH['sequelize'][_0xbb98('0x84')][_0xbb98('0x85')]});}})[_0xbb98('0x26')](function(){return{'sql':_0x3b2a4c[_0xbb98('0x82')]()};})[_0xbb98('0x26')](respondWithResult(_0x1fd6f2,null))[_0xbb98('0x45')](handleError(_0x1fd6f2,null));};
\ No newline at end of file
index aa207de..b80facc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e03=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14664d,_0x3163e6){var _0x1ad12c=function(_0x195fbc){while(--_0x195fbc){_0x14664d['push'](_0x14664d['shift']());}};_0x1ad12c(++_0x3163e6);}(_0x1e03,0x19d));var _0x31e0=function(_0x3c3b7b,_0x27ff45){_0x3c3b7b=_0x3c3b7b-0x0;var _0x54232b=_0x1e03[_0x3c3b7b];return _0x54232b;};'use strict';var _=require(_0x31e0('0x0'));var util=require('util');var logger=require(_0x31e0('0x1'))(_0x31e0('0x2'));var moment=require(_0x31e0('0x3'));var BPromise=require(_0x31e0('0x4'));var rp=require(_0x31e0('0x5'));var fs=require('fs');var path=require(_0x31e0('0x6'));var rimraf=require(_0x31e0('0x7'));var config=require(_0x31e0('0x8'));var attributes=require(_0x31e0('0x9'));module[_0x31e0('0xa')]=function(_0x1de31f,_0x4fb64e){return _0x1de31f[_0x31e0('0xb')](_0x31e0('0xc'),attributes,{'tableName':_0x31e0('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa487=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','../../config/logger','api','moment'];(function(_0x1e3bc5,_0x95321a){var _0x587cfd=function(_0x309408){while(--_0x309408){_0x1e3bc5['push'](_0x1e3bc5['shift']());}};_0x587cfd(++_0x95321a);}(_0xa487,0x8b));var _0x7a48=function(_0x52ff63,_0x29e275){_0x52ff63=_0x52ff63-0x0;var _0x351a1a=_0xa487[_0x52ff63];return _0x351a1a;};'use strict';var _=require(_0x7a48('0x0'));var util=require('util');var logger=require(_0x7a48('0x1'))(_0x7a48('0x2'));var moment=require(_0x7a48('0x3'));var BPromise=require('bluebird');var rp=require(_0x7a48('0x4'));var fs=require('fs');var path=require(_0x7a48('0x5'));var rimraf=require('rimraf');var config=require(_0x7a48('0x6'));var attributes=require(_0x7a48('0x7'));module[_0x7a48('0x8')]=function(_0x54ea98,_0x798cca){return _0x54ea98[_0x7a48('0x9')](_0x7a48('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b6347ff..2b20dd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b7d=['then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x59ae56,_0x1a1aaf){var _0x839b0f=function(_0x56cc1c){while(--_0x56cc1c){_0x59ae56['push'](_0x59ae56['shift']());}};_0x839b0f(++_0x1a1aaf);}(_0x3b7d,0x127));var _0xd3b7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3b7d[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xd3b7('0x0'));var moment=require(_0xd3b7('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3b7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3b7('0x3'));var logger=require(_0xd3b7('0x4'))(_0xd3b7('0x5'));var config=require(_0xd3b7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd3b7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4141dc,_0x113d50,_0x587677){return new BPromise(function(_0x126ff0,_0x54793c){return client[_0xd3b7('0x8')](_0x4141dc,_0x587677)[_0xd3b7('0x9')](function(_0x332aab){logger[_0xd3b7('0xa')](_0xd3b7('0xb'),_0x113d50,_0xd3b7('0xc'));logger[_0xd3b7('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x113d50,'request\x20sent',JSON[_0xd3b7('0xe')](_0x332aab));if(_0x332aab['error']){if(_0x332aab[_0xd3b7('0xf')][_0xd3b7('0x10')]===0x1f4){logger[_0xd3b7('0xf')](_0xd3b7('0xb'),_0x113d50,_0x332aab[_0xd3b7('0xf')]['message']);return _0x54793c(_0x332aab[_0xd3b7('0xf')]['message']);}logger[_0xd3b7('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x113d50,_0x332aab['error'][_0xd3b7('0x11')]);return _0x126ff0(_0x332aab[_0xd3b7('0xf')][_0xd3b7('0x11')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x113d50,_0xd3b7('0xc'));_0x126ff0(_0x332aab[_0xd3b7('0x12')][_0xd3b7('0x11')]);}})['catch'](function(_0xdaa8b7){logger[_0xd3b7('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x113d50,_0xdaa8b7);_0x54793c(_0xdaa8b7);});});}
\ No newline at end of file
+var _0x639d=['client','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','jayson/promise'];(function(_0x363e75,_0x58bb32){var _0x2638df=function(_0x2fc26a){while(--_0x2fc26a){_0x363e75['push'](_0x363e75['shift']());}};_0x2638df(++_0x58bb32);}(_0x639d,0x10a));var _0xd639=function(_0xf547b5,_0x4e5a9d){_0xf547b5=_0xf547b5-0x0;var _0x3983d6=_0x639d[_0xf547b5];return _0x3983d6;};'use strict';var _=require(_0xd639('0x0'));var util=require(_0xd639('0x1'));var moment=require(_0xd639('0x2'));var BPromise=require('bluebird');var rs=require(_0xd639('0x3'));var fs=require('fs');var Redis=require(_0xd639('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd639('0x5'));var client=jayson[_0xd639('0x6')][_0xd639('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5635ed,_0x195d98,_0x5cff66){return new BPromise(function(_0x36661a,_0x272324){return client[_0xd639('0x8')](_0x5635ed,_0x5cff66)['then'](function(_0x3363ab){logger['info'](_0xd639('0x9'),_0x195d98,_0xd639('0xa'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x195d98,'request\x20sent',JSON['stringify'](_0x3363ab));if(_0x3363ab[_0xd639('0xb')]){if(_0x3363ab[_0xd639('0xb')][_0xd639('0xc')]===0x1f4){logger[_0xd639('0xb')](_0xd639('0x9'),_0x195d98,_0x3363ab[_0xd639('0xb')][_0xd639('0xd')]);return _0x272324(_0x3363ab['error'][_0xd639('0xd')]);}logger[_0xd639('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x195d98,_0x3363ab['error'][_0xd639('0xd')]);return _0x36661a(_0x3363ab[_0xd639('0xb')][_0xd639('0xd')]);}else{logger[_0xd639('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x195d98,_0xd639('0xa'));_0x36661a(_0x3363ab[_0xd639('0xf')][_0xd639('0xd')]);}})[_0xd639('0x10')](function(_0x4bc8f0){logger['error'](_0xd639('0x9'),_0x195d98,_0x4bc8f0);_0x272324(_0x4bc8f0);});});}
\ No newline at end of file
index 0bc4588..9f90228 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a8f=['util','connect-timeout','Router','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','/:id/query','query','put','destroy','exports','multer'];(function(_0x4b84df,_0x2d83b7){var _0x11f70d=function(_0x47df25){while(--_0x47df25){_0x4b84df['push'](_0x4b84df['shift']());}};_0x11f70d(++_0x2d83b7);}(_0x0a8f,0x1d3));var _0xf0a8=function(_0x2107c7,_0x35b64a){_0x2107c7=_0x2107c7-0x0;var _0x34fddc=_0x0a8f[_0x2107c7];return _0x34fddc;};'use strict';var multer=require(_0xf0a8('0x0'));var util=require(_0xf0a8('0x1'));var path=require('path');var timeout=require(_0xf0a8('0x2'));var express=require('express');var router=express[_0xf0a8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf0a8('0x4'));var config=require('../../config/environment');var controller=require(_0xf0a8('0x5'));router[_0xf0a8('0x6')]('/',auth[_0xf0a8('0x7')](),controller[_0xf0a8('0x8')]);router['get'](_0xf0a8('0x9'),auth[_0xf0a8('0x7')](),controller[_0xf0a8('0xa')]);router[_0xf0a8('0x6')]('/:id/preview',auth[_0xf0a8('0x7')](),controller['preview']);router[_0xf0a8('0x6')](_0xf0a8('0xb'),auth[_0xf0a8('0x7')](),controller[_0xf0a8('0xc')]);router['get'](_0xf0a8('0xd'),auth[_0xf0a8('0x7')](),controller[_0xf0a8('0xe')]);router['post']('/',auth[_0xf0a8('0x7')](),controller['create']);router[_0xf0a8('0xf')]('/:id',auth[_0xf0a8('0x7')](),controller['update']);router['delete'](_0xf0a8('0x9'),auth[_0xf0a8('0x7')](),controller[_0xf0a8('0x10')]);module[_0xf0a8('0x11')]=router;
\ No newline at end of file
+var _0xf5a3=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4b03d3,_0x32f1d2){var _0x58a968=function(_0x1661e5){while(--_0x1661e5){_0x4b03d3['push'](_0x4b03d3['shift']());}};_0x58a968(++_0x32f1d2);}(_0xf5a3,0x1b4));var _0x3f5a=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xf5a3[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require('multer');var util=require(_0x3f5a('0x0'));var path=require(_0x3f5a('0x1'));var timeout=require(_0x3f5a('0x2'));var express=require(_0x3f5a('0x3'));var router=express[_0x3f5a('0x4')]();var fs_extra=require(_0x3f5a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3f5a('0x6'));var config=require(_0x3f5a('0x7'));var controller=require(_0x3f5a('0x8'));router[_0x3f5a('0x9')]('/',auth['isAuthenticated'](),controller[_0x3f5a('0xa')]);router[_0x3f5a('0x9')](_0x3f5a('0xb'),auth[_0x3f5a('0xc')](),controller[_0x3f5a('0xd')]);router['get'](_0x3f5a('0xe'),auth['isAuthenticated'](),controller[_0x3f5a('0xf')]);router['get'](_0x3f5a('0x10'),auth[_0x3f5a('0xc')](),controller[_0x3f5a('0x11')]);router[_0x3f5a('0x9')](_0x3f5a('0x12'),auth[_0x3f5a('0xc')](),controller['query']);router[_0x3f5a('0x13')]('/',auth['isAuthenticated'](),controller[_0x3f5a('0x14')]);router[_0x3f5a('0x15')](_0x3f5a('0xb'),auth[_0x3f5a('0xc')](),controller[_0x3f5a('0x16')]);router[_0x3f5a('0x17')](_0x3f5a('0xb'),auth[_0x3f5a('0xc')](),controller[_0x3f5a('0x18')]);module[_0x3f5a('0x19')]=router;
\ No newline at end of file
index b0db75e..892b601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf5=['exports','STRING','TEXT'];(function(_0x3d459a,_0x526f75){var _0x2172a5=function(_0x17e45d){while(--_0x17e45d){_0x3d459a['push'](_0x3d459a['shift']());}};_0x2172a5(++_0x526f75);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x375dc0,_0x1dd4ea){_0x375dc0=_0x375dc0-0x0;var _0x37a0fb=_0xdbf5[_0x375dc0];return _0x37a0fb;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
+var _0xae24=['sequelize','STRING'];(function(_0x52e1bd,_0x17355e){var _0x5433c2=function(_0x3776f0){while(--_0x3776f0){_0x52e1bd['push'](_0x52e1bd['shift']());}};_0x5433c2(++_0x17355e);}(_0xae24,0x182));var _0x4ae2=function(_0xef54fb,_0x50cc8e){_0xef54fb=_0xef54fb-0x0;var _0x282068=_0xae24[_0xef54fb];return _0x282068;};'use strict';var Sequelize=require(_0x4ae2('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ae2('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4ae2('0x1')]},'table':{'type':Sequelize[_0x4ae2('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 9826334..dbdc83e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x2ef3,0xba));var _0x32ef=function(_0x35d0f0,_0xa1514e){_0x35d0f0=_0x35d0f0-0x0;var _0x60effb=_0x2ef3[_0x35d0f0];return _0x60effb;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
+var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d38,0x1ef));var _0x86d3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6d38[_0x432682];return _0x463d05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));};
\ No newline at end of file
index 56220ed..91aa227 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb45=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xfb45,0xa1));var _0x5fb4=function(_0x4a65cc,_0x21bba1){_0x4a65cc=_0x4a65cc-0x0;var _0x59fbeb=_0xfb45[_0x4a65cc];return _0x59fbeb;};'use strict';var _=require(_0x5fb4('0x0'));var util=require(_0x5fb4('0x1'));var logger=require(_0x5fb4('0x2'))(_0x5fb4('0x3'));var moment=require(_0x5fb4('0x4'));var BPromise=require(_0x5fb4('0x5'));var rp=require(_0x5fb4('0x6'));var fs=require('fs');var path=require(_0x5fb4('0x7'));var rimraf=require(_0x5fb4('0x8'));var config=require(_0x5fb4('0x9'));var attributes=require(_0x5fb4('0xa'));module[_0x5fb4('0xb')]=function(_0x3177c5,_0x5eb63f){return _0x3177c5[_0x5fb4('0xc')](_0x5fb4('0xd'),attributes,{'tableName':_0x5fb4('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b25=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports'];(function(_0x4e11e7,_0x42d0b6){var _0x1d7d39=function(_0x416030){while(--_0x416030){_0x4e11e7['push'](_0x4e11e7['shift']());}};_0x1d7d39(++_0x42d0b6);}(_0x3b25,0xc7));var _0x53b2=function(_0xfa92e1,_0x45b65c){_0xfa92e1=_0xfa92e1-0x0;var _0x318f81=_0x3b25[_0xfa92e1];return _0x318f81;};'use strict';var _=require(_0x53b2('0x0'));var util=require(_0x53b2('0x1'));var logger=require(_0x53b2('0x2'))(_0x53b2('0x3'));var moment=require(_0x53b2('0x4'));var BPromise=require(_0x53b2('0x5'));var rp=require(_0x53b2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x53b2('0x7')]=function(_0x48eb32,_0xa9b969){return _0x48eb32[_0x53b2('0x8')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f50122f..86f392b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ca=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','debug','request\x20sent','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result'];(function(_0xe8e91,_0x401ca3){var _0x1258fe=function(_0x45ac8a){while(--_0x45ac8a){_0xe8e91['push'](_0xe8e91['shift']());}};_0x1258fe(++_0x401ca3);}(_0xa9ca,0x109));var _0xaa9c=function(_0x546202,_0x3c8f6a){_0x546202=_0x546202-0x0;var _0x36179a=_0xa9ca[_0x546202];return _0x36179a;};'use strict';var _=require(_0xaa9c('0x0'));var util=require(_0xaa9c('0x1'));var moment=require('moment');var BPromise=require(_0xaa9c('0x2'));var rs=require(_0xaa9c('0x3'));var fs=require('fs');var Redis=require(_0xaa9c('0x4'));var db=require(_0xaa9c('0x5'))['db'];var utils=require(_0xaa9c('0x6'));var logger=require(_0xaa9c('0x7'))(_0xaa9c('0x8'));var config=require(_0xaa9c('0x9'));var jayson=require(_0xaa9c('0xa'));var client=jayson['client'][_0xaa9c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47387a,_0x949d97,_0x12b3e9){return new BPromise(function(_0x577aab,_0x1659bd){return client[_0xaa9c('0xc')](_0x47387a,_0x12b3e9)['then'](function(_0x25d40c){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x949d97,'request\x20sent');logger[_0xaa9c('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x949d97,_0xaa9c('0xe'),JSON[_0xaa9c('0xf')](_0x25d40c));if(_0x25d40c[_0xaa9c('0x10')]){if(_0x25d40c[_0xaa9c('0x10')][_0xaa9c('0x11')]===0x1f4){logger['error'](_0xaa9c('0x12'),_0x949d97,_0x25d40c[_0xaa9c('0x10')][_0xaa9c('0x13')]);return _0x1659bd(_0x25d40c[_0xaa9c('0x10')][_0xaa9c('0x13')]);}logger[_0xaa9c('0x10')](_0xaa9c('0x12'),_0x949d97,_0x25d40c['error'][_0xaa9c('0x13')]);return _0x577aab(_0x25d40c['error']['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x949d97,'request\x20sent');_0x577aab(_0x25d40c[_0xaa9c('0x14')][_0xaa9c('0x13')]);}})[_0xaa9c('0x15')](function(_0x9404){logger[_0xaa9c('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x949d97,_0x9404);_0x1659bd(_0x9404);});});}
\ No newline at end of file
+var _0x7d7e=['jayson/promise','http','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x229a81,_0x1016f9){var _0x2a19e1=function(_0x223e38){while(--_0x223e38){_0x229a81['push'](_0x229a81['shift']());}};_0x2a19e1(++_0x1016f9);}(_0x7d7e,0x156));var _0xe7d7=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7d7e[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xe7d7('0x0'));var util=require(_0xe7d7('0x1'));var moment=require(_0xe7d7('0x2'));var BPromise=require(_0xe7d7('0x3'));var rs=require(_0xe7d7('0x4'));var fs=require('fs');var Redis=require(_0xe7d7('0x5'));var db=require(_0xe7d7('0x6'))['db'];var utils=require(_0xe7d7('0x7'));var logger=require(_0xe7d7('0x8'))(_0xe7d7('0x9'));var config=require('../../config/environment');var jayson=require(_0xe7d7('0xa'));var client=jayson['client'][_0xe7d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e4d39,_0xe975b4,_0x4faebe){return new BPromise(function(_0x20e62d,_0x222a00){return client['request'](_0x5e4d39,_0x4faebe)[_0xe7d7('0xc')](function(_0x16bbdb){logger['info'](_0xe7d7('0xd'),_0xe975b4,_0xe7d7('0xe'));logger['debug'](_0xe7d7('0xf'),_0xe975b4,_0xe7d7('0xe'),JSON[_0xe7d7('0x10')](_0x16bbdb));if(_0x16bbdb['error']){if(_0x16bbdb[_0xe7d7('0x11')][_0xe7d7('0x12')]===0x1f4){logger[_0xe7d7('0x11')](_0xe7d7('0xd'),_0xe975b4,_0x16bbdb[_0xe7d7('0x11')][_0xe7d7('0x13')]);return _0x222a00(_0x16bbdb[_0xe7d7('0x11')][_0xe7d7('0x13')]);}logger[_0xe7d7('0x11')](_0xe7d7('0xd'),_0xe975b4,_0x16bbdb[_0xe7d7('0x11')][_0xe7d7('0x13')]);return _0x20e62d(_0x16bbdb['error'][_0xe7d7('0x13')]);}else{logger[_0xe7d7('0x14')](_0xe7d7('0xd'),_0xe975b4,_0xe7d7('0xe'));_0x20e62d(_0x16bbdb[_0xe7d7('0x15')]['message']);}})['catch'](function(_0x30b0ff){logger[_0xe7d7('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xe975b4,_0x30b0ff);_0x222a00(_0x30b0ff);});});}
\ No newline at end of file
index 2051476..d7f0b31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x150c=['/:id/query','query','post','create','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','/:id/preview','preview','run'];(function(_0x2f90af,_0x48f563){var _0x355d1c=function(_0x995c2d){while(--_0x995c2d){_0x2f90af['push'](_0x2f90af['shift']());}};_0x355d1c(++_0x48f563);}(_0x150c,0x12b));var _0xc150=function(_0x3f239d,_0x1e4675){_0x3f239d=_0x3f239d-0x0;var _0x46f035=_0x150c[_0x3f239d];return _0x46f035;};'use strict';var multer=require(_0xc150('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc150('0x1'));var express=require(_0xc150('0x2'));var router=express[_0xc150('0x3')]();var fs_extra=require(_0xc150('0x4'));var auth=require(_0xc150('0x5'));var interaction=require(_0xc150('0x6'));var config=require(_0xc150('0x7'));var controller=require(_0xc150('0x8'));router[_0xc150('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc150('0xa'),auth[_0xc150('0xb')](),controller[_0xc150('0xc')]);router[_0xc150('0x9')](_0xc150('0xd'),auth[_0xc150('0xb')](),controller[_0xc150('0xe')]);router[_0xc150('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0xc150('0xf')]);router[_0xc150('0x9')](_0xc150('0x10'),auth[_0xc150('0xb')](),controller[_0xc150('0x11')]);router[_0xc150('0x12')]('/',auth['isAuthenticated'](),controller[_0xc150('0x13')]);router['put'](_0xc150('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc150('0xa'),auth['isAuthenticated'](),controller[_0xc150('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xb153=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','post','put','update','delete','destroy','multer','path'];(function(_0x421acd,_0x317685){var _0x5ec7d2=function(_0x56835a){while(--_0x56835a){_0x421acd['push'](_0x421acd['shift']());}};_0x5ec7d2(++_0x317685);}(_0xb153,0x136));var _0x3b15=function(_0x214b14,_0x1cc3ab){_0x214b14=_0x214b14-0x0;var _0x37caed=_0xb153[_0x214b14];return _0x37caed;};'use strict';var multer=require(_0x3b15('0x0'));var util=require('util');var path=require(_0x3b15('0x1'));var timeout=require(_0x3b15('0x2'));var express=require(_0x3b15('0x3'));var router=express[_0x3b15('0x4')]();var fs_extra=require(_0x3b15('0x5'));var auth=require(_0x3b15('0x6'));var interaction=require(_0x3b15('0x7'));var config=require(_0x3b15('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0x3b15('0x9')]('/',auth['isAuthenticated'](),controller[_0x3b15('0xa')]);router['get'](_0x3b15('0xb'),auth[_0x3b15('0xc')](),controller[_0x3b15('0xd')]);router['get'](_0x3b15('0xe'),auth['isAuthenticated'](),controller[_0x3b15('0xf')]);router[_0x3b15('0x9')](_0x3b15('0x10'),auth['isAuthenticated'](),controller[_0x3b15('0x11')]);router[_0x3b15('0x9')](_0x3b15('0x12'),auth[_0x3b15('0xc')](),controller['query']);router[_0x3b15('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b15('0x14')](_0x3b15('0xb'),auth['isAuthenticated'](),controller[_0x3b15('0x15')]);router[_0x3b15('0x16')](_0x3b15('0xb'),auth['isAuthenticated'](),controller[_0x3b15('0x17')]);module['exports']=router;
\ No newline at end of file
index aa50cb4..303bb09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x579b=['DATE','manual','scheduled','UNSIGNED','exports','STRING','ENUM','csv','pdf'];(function(_0x1b5389,_0x2c2096){var _0x194dba=function(_0x559ce1){while(--_0x559ce1){_0x1b5389['push'](_0x1b5389['shift']());}};_0x194dba(++_0x2c2096);}(_0x579b,0x163));var _0xb579=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0x579b[_0x21f931];return _0x3f083c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xb579('0x0')]={'name':{'type':Sequelize[_0xb579('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xb579('0x2')](_0xb579('0x3'),_0xb579('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xb579('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb579('0x5')]},'endDate':{'type':Sequelize[_0xb579('0x5')]},'status':{'type':Sequelize[_0xb579('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xb579('0x2')](_0xb579('0x6'),_0xb579('0x7')),'allowNull':![],'defaultValue':_0xb579('0x6')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xb579('0x8')]},'reportType':{'type':Sequelize[_0xb579('0x1')]}};
\ No newline at end of file
+var _0x701c=['manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','csv','xlsx','DATE','Loading'];(function(_0x5bd95a,_0x5e47e3){var _0x79267e=function(_0xeeb292){while(--_0xeeb292){_0x5bd95a['push'](_0x5bd95a['shift']());}};_0x79267e(++_0x5e47e3);}(_0x701c,0x164));var _0xc701=function(_0x1e6e39,_0x3c98ed){_0x1e6e39=_0x1e6e39-0x0;var _0x2d9029=_0x701c[_0x1e6e39];return _0x2d9029;};'use strict';var Sequelize=require(_0xc701('0x0'));var moment=require('moment');module[_0xc701('0x1')]={'name':{'type':Sequelize[_0xc701('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xc701('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xc701('0x3'),'pdf',_0xc701('0x4')),'allowNull':![],'defaultValue':_0xc701('0x3')},'savename':{'type':Sequelize[_0xc701('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc701('0x5')]},'endDate':{'type':Sequelize[_0xc701('0x5')]},'status':{'type':Sequelize[_0xc701('0x2')],'defaultValue':_0xc701('0x6')},'type':{'type':Sequelize['ENUM'](_0xc701('0x7'),_0xc701('0x8')),'allowNull':![],'defaultValue':_0xc701('0x7')},'reportId':{'type':Sequelize[_0xc701('0x9')](0xb)[_0xc701('0xa')]},'reportType':{'type':Sequelize[_0xc701('0x2')]}};
\ No newline at end of file
index 27b68c1..09ee6bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaab4=['format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError'];(function(_0xdded02,_0x385f97){var _0x132d3f=function(_0x507177){while(--_0x507177){_0xdded02['push'](_0xdded02['shift']());}};_0x132d3f(++_0x385f97);}(_0xaab4,0x108));var _0x4aab=function(_0x12f2e3,_0xbbfb93){_0x12f2e3=_0x12f2e3-0x0;var _0x298852=_0xaab4[_0x12f2e3];return _0x298852;};'use strict';var emlformat=require(_0x4aab('0x0'));var rimraf=require(_0x4aab('0x1'));var zipdir=require(_0x4aab('0x2'));var jsonpatch=require(_0x4aab('0x3'));var rp=require(_0x4aab('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4aab('0x5'));var util=require(_0x4aab('0x6'));var path=require('path');var sox=require(_0x4aab('0x7'));var csv=require(_0x4aab('0x8'));var ejs=require(_0x4aab('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4aab('0xa'));var squel=require(_0x4aab('0xb'));var crypto=require(_0x4aab('0xc'));var jsforce=require(_0x4aab('0xd'));var deskjs=require(_0x4aab('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4aab('0xf'));var Papa=require(_0x4aab('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4aab('0x11'))(_0x4aab('0x12'));var utils=require(_0x4aab('0x13'));var config=require(_0x4aab('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4aab('0x15'))['db'];function respondWithStatusCode(_0xb886ca,_0xbf3127){_0xbf3127=_0xbf3127||0xcc;return function(_0x4983ea){if(_0x4983ea){return _0xb886ca[_0x4aab('0x16')](_0xbf3127);}return _0xb886ca[_0x4aab('0x17')](_0xbf3127)['end']();};}function respondWithResult(_0x2dee11,_0x40d36c){_0x40d36c=_0x40d36c||0xc8;return function(_0x3aaede){if(_0x3aaede){return _0x2dee11[_0x4aab('0x17')](_0x40d36c)['json'](_0x3aaede);}};}function respondWithFilteredResult(_0x49cefe,_0x112dc2){return function(_0x1b7cf6){if(_0x1b7cf6){var _0x117289=typeof _0x112dc2[_0x4aab('0x18')]===_0x4aab('0x19')&&typeof _0x112dc2[_0x4aab('0x1a')]===_0x4aab('0x19');var _0x33cf4f=_0x1b7cf6['count'];var _0x1fca17=_0x117289?0x0:_0x112dc2[_0x4aab('0x18')];var _0x2f1a83=_0x117289?_0x1b7cf6[_0x4aab('0x1b')]:_0x112dc2[_0x4aab('0x18')]+_0x112dc2[_0x4aab('0x1a')];var _0x14f395;if(_0x2f1a83>=_0x33cf4f){_0x2f1a83=_0x33cf4f;_0x14f395=0xc8;}else{_0x14f395=0xce;}_0x49cefe[_0x4aab('0x17')](_0x14f395);return _0x49cefe['set'](_0x4aab('0x1c'),_0x1fca17+'-'+_0x2f1a83+'/'+_0x33cf4f)[_0x4aab('0x1d')](_0x1b7cf6);}return null;};}function patchUpdates(_0x50c747){return function(_0x14eae1){try{jsonpatch['apply'](_0x14eae1,_0x50c747,!![]);}catch(_0x3a682e){return BPromise['reject'](_0x3a682e);}return _0x14eae1['save']();};}function saveUpdates(_0x2237cd,_0x2f90d2){return function(_0x52836c){if(_0x52836c){return _0x52836c[_0x4aab('0x1e')](_0x2237cd)[_0x4aab('0x1f')](function(_0x48c5fc){return _0x48c5fc;});}return null;};}function removeEntity(_0x23a03d,_0x184923){return function(_0x570768){if(_0x570768){return _0x570768[_0x4aab('0x20')]()[_0x4aab('0x1f')](function(){var _0x1dbf63=_0x570768[_0x4aab('0x21')]({'plain':!![]});var _0x5a38f4=_0x4aab('0x22');return db[_0x4aab('0x23')][_0x4aab('0x20')]({'where':{'type':_0x5a38f4,'resourceId':_0x1dbf63['id']}})[_0x4aab('0x1f')](function(){return _0x570768;});})[_0x4aab('0x1f')](function(){_0x23a03d[_0x4aab('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa7357,_0x501348){return function(_0x1f89f4){if(!_0x1f89f4){_0xa7357[_0x4aab('0x16')](0x194);}return _0x1f89f4;};}function handleError(_0x20dc09,_0xfce6e4){_0xfce6e4=_0xfce6e4||0x1f4;return function(_0x22e483){logger['error'](_0x22e483[_0x4aab('0x24')]);if(_0x22e483[_0x4aab('0x25')]){delete _0x22e483[_0x4aab('0x25')];}_0x20dc09[_0x4aab('0x17')](_0xfce6e4)[_0x4aab('0x26')](_0x22e483);};}exports[_0x4aab('0x27')]=function(_0x10c392,_0x1ea642){var _0x19cad6={},_0x4e552e={},_0x435594={'count':0x0,'rows':[]};var _0x1403b0=_[_0x4aab('0x28')](db[_0x4aab('0x29')][_0x4aab('0x2a')],function(_0x4e400d){return{'name':_0x4e400d['fieldName'],'type':_0x4e400d[_0x4aab('0x2b')][_0x4aab('0x2c')]};});_0x4e552e[_0x4aab('0x2d')]=_['map'](_0x1403b0,_0x4aab('0x25'));_0x4e552e[_0x4aab('0x2e')]=_['keys'](_0x10c392['query']);_0x4e552e['filters']=_[_0x4aab('0x2f')](_0x4e552e[_0x4aab('0x2d')],_0x4e552e[_0x4aab('0x2e')]);_0x19cad6[_0x4aab('0x30')]=_[_0x4aab('0x2f')](_0x4e552e['model'],qs[_0x4aab('0x31')](_0x10c392[_0x4aab('0x2e')][_0x4aab('0x31')]));_0x19cad6[_0x4aab('0x30')]=_0x19cad6['attributes'][_0x4aab('0x32')]?_0x19cad6['attributes']:_0x4e552e['model'];if(!_0x10c392['query'][_0x4aab('0x33')](_0x4aab('0x34'))){_0x19cad6[_0x4aab('0x1a')]=qs[_0x4aab('0x1a')](_0x10c392[_0x4aab('0x2e')]['limit']);_0x19cad6[_0x4aab('0x18')]=qs[_0x4aab('0x18')](_0x10c392[_0x4aab('0x2e')][_0x4aab('0x18')]);}_0x19cad6['order']=qs[_0x4aab('0x35')](_0x10c392['query']['sort']);_0x19cad6[_0x4aab('0x36')]=qs[_0x4aab('0x37')](_['pick'](_0x10c392[_0x4aab('0x2e')],_0x4e552e[_0x4aab('0x37')]),_0x1403b0);if(_0x10c392[_0x4aab('0x2e')][_0x4aab('0x38')]){_0x19cad6[_0x4aab('0x36')]=_[_0x4aab('0x39')](_0x19cad6[_0x4aab('0x36')],{'$or':_[_0x4aab('0x28')](_0x1403b0,function(_0x3f3689){if(_0x3f3689[_0x4aab('0x2b')]!==_0x4aab('0x3a')){var _0x1e8b81={};_0x1e8b81[_0x3f3689[_0x4aab('0x25')]]={'$like':'%'+_0x10c392[_0x4aab('0x2e')][_0x4aab('0x38')]+'%'};return _0x1e8b81;}})});}_0x19cad6=_[_0x4aab('0x39')]({},_0x19cad6,_0x10c392[_0x4aab('0x3b')]);var _0x1f7eca={'where':_0x19cad6['where']};return db[_0x4aab('0x29')][_0x4aab('0x1b')](_0x1f7eca)[_0x4aab('0x1f')](function(_0x1dfacf){_0x435594[_0x4aab('0x1b')]=_0x1dfacf;if(_0x10c392[_0x4aab('0x2e')][_0x4aab('0x3c')]){_0x19cad6[_0x4aab('0x3d')]=[{'all':!![]}];}return db[_0x4aab('0x29')][_0x4aab('0x3e')](_0x19cad6);})['then'](function(_0x14a616){_0x435594[_0x4aab('0x3f')]=_0x14a616;return _0x435594;})[_0x4aab('0x1f')](respondWithFilteredResult(_0x1ea642,_0x19cad6))[_0x4aab('0x40')](handleError(_0x1ea642,null));};exports[_0x4aab('0x41')]=function(_0x1e310d,_0x3bfb43){var _0x2dae45={'raw':!![],'where':{'id':_0x1e310d[_0x4aab('0x42')]['id']}},_0x3c95f9={};_0x3c95f9[_0x4aab('0x2d')]=_[_0x4aab('0x43')](db['AnalyticExtractedReport']['rawAttributes']);_0x3c95f9[_0x4aab('0x2e')]=_[_0x4aab('0x43')](_0x1e310d[_0x4aab('0x2e')]);_0x3c95f9[_0x4aab('0x37')]=_[_0x4aab('0x2f')](_0x3c95f9[_0x4aab('0x2d')],_0x3c95f9['query']);_0x2dae45['attributes']=_['intersection'](_0x3c95f9[_0x4aab('0x2d')],qs[_0x4aab('0x31')](_0x1e310d['query'][_0x4aab('0x31')]));_0x2dae45['attributes']=_0x2dae45[_0x4aab('0x30')]['length']?_0x2dae45[_0x4aab('0x30')]:_0x3c95f9[_0x4aab('0x2d')];if(_0x1e310d[_0x4aab('0x2e')]['includeAll']){_0x2dae45[_0x4aab('0x3d')]=[{'all':!![]}];}_0x2dae45=_[_0x4aab('0x39')]({},_0x2dae45,_0x1e310d[_0x4aab('0x3b')]);return db['AnalyticExtractedReport'][_0x4aab('0x44')](_0x2dae45)[_0x4aab('0x1f')](handleEntityNotFound(_0x3bfb43,null))[_0x4aab('0x1f')](respondWithResult(_0x3bfb43,null))['catch'](handleError(_0x3bfb43,null));};exports[_0x4aab('0x45')]=function(_0x4569b5,_0x14fccf){return db['AnalyticExtractedReport'][_0x4aab('0x45')](_0x4569b5['body'],{})[_0x4aab('0x1f')](function(_0x24faf4){var _0x4cefd0=_0x4569b5['user']['get']({'plain':!![]});if(!_0x4cefd0)throw new Error(_0x4aab('0x46'));if(_0x4cefd0['role']==='user'){var _0x3b52bb=_0x24faf4['get']({'plain':!![]});var _0x31b0ed=_0x4aab('0x22');return db[_0x4aab('0x47')][_0x4aab('0x44')]({'where':{'name':_0x31b0ed,'userProfileId':_0x4cefd0['userProfileId']},'raw':!![]})[_0x4aab('0x1f')](function(_0x1d19fa){if(_0x1d19fa&&_0x1d19fa[_0x4aab('0x48')]===0x0){return db['UserProfileResource'][_0x4aab('0x45')]({'name':_0x3b52bb[_0x4aab('0x25')],'resourceId':_0x3b52bb['id'],'type':_0x1d19fa[_0x4aab('0x25')],'sectionId':_0x1d19fa['id']},{})[_0x4aab('0x1f')](function(){return _0x24faf4;});}else{return _0x24faf4;}})[_0x4aab('0x40')](function(_0x569aa2){logger['error'](_0x4aab('0x49'),_0x569aa2);throw _0x569aa2;});}return _0x24faf4;})[_0x4aab('0x1f')](respondWithResult(_0x14fccf,0xc9))[_0x4aab('0x40')](handleError(_0x14fccf,null));};exports['update']=function(_0x2b35a7,_0x543a00){if(_0x2b35a7[_0x4aab('0x4a')]['id']){delete _0x2b35a7[_0x4aab('0x4a')]['id'];}return db[_0x4aab('0x29')][_0x4aab('0x44')]({'where':{'id':_0x2b35a7[_0x4aab('0x42')]['id']}})[_0x4aab('0x1f')](handleEntityNotFound(_0x543a00,null))[_0x4aab('0x1f')](saveUpdates(_0x2b35a7[_0x4aab('0x4a')],null))[_0x4aab('0x1f')](respondWithResult(_0x543a00,null))[_0x4aab('0x40')](handleError(_0x543a00,null));};exports[_0x4aab('0x20')]=function(_0x89a5b0,_0x109201){return db[_0x4aab('0x29')][_0x4aab('0x44')]({'where':{'id':_0x89a5b0[_0x4aab('0x42')]['id']}})[_0x4aab('0x1f')](handleEntityNotFound(_0x109201,null))[_0x4aab('0x1f')](removeEntity(_0x109201,null))[_0x4aab('0x40')](handleError(_0x109201,null));};exports[_0x4aab('0x4b')]=function(_0x46711a,_0x3afcf9,_0x2a4377){return db[_0x4aab('0x29')][_0x4aab('0x44')]({'where':{'id':_0x46711a[_0x4aab('0x42')]['id']},'attributes':[_0x4aab('0x25'),_0x4aab('0x4c'),_0x4aab('0x4d'),_0x4aab('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x3afcf9,null))[_0x4aab('0x1f')](function(_0x256f9c){if(_0x256f9c){if(!fs[_0x4aab('0x4f')](path['join'](config[_0x4aab('0x50')],_0x4aab('0x51'),_0x256f9c['savename']))){throw new db[(_0x4aab('0x52'))][(_0x4aab('0x53'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x46711a['query']['exists']){return _0x3afcf9[_0x4aab('0x16')](0xc8);}return _0x3afcf9[_0x4aab('0x4b')](path['join'](config[_0x4aab('0x50')],_0x4aab('0x51'),_0x256f9c['savename']),util[_0x4aab('0x54')](_0x4aab('0x55'),_0x256f9c[_0x4aab('0x4c')]||_0x256f9c[_0x4aab('0x25')],_0x256f9c[_0x4aab('0x4e')][_0x4aab('0x56')]()));}})[_0x4aab('0x40')](handleError(_0x3afcf9,null));};
\ No newline at end of file
+var _0xff1b=['autoAssociation','create','error','update','download','params','basename','savename','output','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0xff1b,0xe1));var _0xbff1=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xff1b[_0x215e65];return _0xa85842;};'use strict';var emlformat=require(_0xbff1('0x0'));var rimraf=require(_0xbff1('0x1'));var zipdir=require(_0xbff1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbff1('0x3'));var moment=require(_0xbff1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbff1('0x5'));var util=require(_0xbff1('0x6'));var path=require(_0xbff1('0x7'));var sox=require(_0xbff1('0x8'));var csv=require(_0xbff1('0x9'));var ejs=require(_0xbff1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbff1('0xb'));var squel=require(_0xbff1('0xc'));var crypto=require(_0xbff1('0xd'));var jsforce=require(_0xbff1('0xe'));var deskjs=require(_0xbff1('0xf'));var toCsv=require(_0xbff1('0x9'));var querystring=require(_0xbff1('0x10'));var Papa=require(_0xbff1('0x11'));var Redis=require(_0xbff1('0x12'));var authService=require(_0xbff1('0x13'));var qs=require(_0xbff1('0x14'));var as=require(_0xbff1('0x15'));var hardwareService=require(_0xbff1('0x16'));var logger=require(_0xbff1('0x17'))(_0xbff1('0x18'));var utils=require(_0xbff1('0x19'));var config=require(_0xbff1('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xbff1('0x1b'))['db'];function respondWithStatusCode(_0xa1c777,_0xe930c8){_0xe930c8=_0xe930c8||0xcc;return function(_0x1d4bfe){if(_0x1d4bfe){return _0xa1c777[_0xbff1('0x1c')](_0xe930c8);}return _0xa1c777[_0xbff1('0x1d')](_0xe930c8)[_0xbff1('0x1e')]();};}function respondWithResult(_0x5eec87,_0x337186){_0x337186=_0x337186||0xc8;return function(_0x501819){if(_0x501819){return _0x5eec87[_0xbff1('0x1d')](_0x337186)[_0xbff1('0x1f')](_0x501819);}};}function respondWithFilteredResult(_0x1fc500,_0x3c9610){return function(_0x199917){if(_0x199917){var _0x151b9f=typeof _0x3c9610[_0xbff1('0x20')]===_0xbff1('0x21')&&typeof _0x3c9610[_0xbff1('0x22')]===_0xbff1('0x21');var _0x5d0e60=_0x199917[_0xbff1('0x23')];var _0x3b5087=_0x151b9f?0x0:_0x3c9610[_0xbff1('0x20')];var _0x451d53=_0x151b9f?_0x199917[_0xbff1('0x23')]:_0x3c9610['offset']+_0x3c9610[_0xbff1('0x22')];var _0x1671f3;if(_0x451d53>=_0x5d0e60){_0x451d53=_0x5d0e60;_0x1671f3=0xc8;}else{_0x1671f3=0xce;}_0x1fc500[_0xbff1('0x1d')](_0x1671f3);return _0x1fc500['set'](_0xbff1('0x24'),_0x3b5087+'-'+_0x451d53+'/'+_0x5d0e60)[_0xbff1('0x1f')](_0x199917);}return null;};}function patchUpdates(_0x50d713){return function(_0x33d3af){try{jsonpatch[_0xbff1('0x25')](_0x33d3af,_0x50d713,!![]);}catch(_0xc42824){return BPromise[_0xbff1('0x26')](_0xc42824);}return _0x33d3af[_0xbff1('0x27')]();};}function saveUpdates(_0x40e233,_0x1f97c6){return function(_0x2a11d9){if(_0x2a11d9){return _0x2a11d9['update'](_0x40e233)[_0xbff1('0x28')](function(_0x1a2759){return _0x1a2759;});}return null;};}function removeEntity(_0x1ae533,_0xbc5b4){return function(_0x25ac84){if(_0x25ac84){return _0x25ac84[_0xbff1('0x29')]()[_0xbff1('0x28')](function(){var _0x2bab48=_0x25ac84[_0xbff1('0x2a')]({'plain':!![]});var _0x5aeab7=_0xbff1('0x2b');return db[_0xbff1('0x2c')]['destroy']({'where':{'type':_0x5aeab7,'resourceId':_0x2bab48['id']}})[_0xbff1('0x28')](function(){return _0x25ac84;});})[_0xbff1('0x28')](function(){_0x1ae533['status'](0xcc)[_0xbff1('0x1e')]();});}};}function handleEntityNotFound(_0x19eb7e,_0x6cbac6){return function(_0x192adc){if(!_0x192adc){_0x19eb7e[_0xbff1('0x1c')](0x194);}return _0x192adc;};}function handleError(_0x16f6f0,_0x7abd38){_0x7abd38=_0x7abd38||0x1f4;return function(_0x17ebab){logger['error'](_0x17ebab[_0xbff1('0x2d')]);if(_0x17ebab[_0xbff1('0x2e')]){delete _0x17ebab[_0xbff1('0x2e')];}_0x16f6f0[_0xbff1('0x1d')](_0x7abd38)[_0xbff1('0x2f')](_0x17ebab);};}exports[_0xbff1('0x30')]=function(_0x375678,_0x32bff2){var _0x38befb={},_0x1d15f3={},_0x3fa735={'count':0x0,'rows':[]};var _0x26ad00=_[_0xbff1('0x31')](db[_0xbff1('0x32')][_0xbff1('0x33')],function(_0x1a42fc){return{'name':_0x1a42fc[_0xbff1('0x34')],'type':_0x1a42fc[_0xbff1('0x35')][_0xbff1('0x36')]};});_0x1d15f3['model']=_[_0xbff1('0x31')](_0x26ad00,_0xbff1('0x2e'));_0x1d15f3[_0xbff1('0x37')]=_['keys'](_0x375678['query']);_0x1d15f3['filters']=_[_0xbff1('0x38')](_0x1d15f3[_0xbff1('0x39')],_0x1d15f3[_0xbff1('0x37')]);_0x38befb['attributes']=_[_0xbff1('0x38')](_0x1d15f3[_0xbff1('0x39')],qs[_0xbff1('0x3a')](_0x375678['query'][_0xbff1('0x3a')]));_0x38befb[_0xbff1('0x3b')]=_0x38befb[_0xbff1('0x3b')][_0xbff1('0x3c')]?_0x38befb['attributes']:_0x1d15f3[_0xbff1('0x39')];if(!_0x375678[_0xbff1('0x37')]['hasOwnProperty'](_0xbff1('0x3d'))){_0x38befb[_0xbff1('0x22')]=qs['limit'](_0x375678['query'][_0xbff1('0x22')]);_0x38befb[_0xbff1('0x20')]=qs['offset'](_0x375678[_0xbff1('0x37')][_0xbff1('0x20')]);}_0x38befb[_0xbff1('0x3e')]=qs['sort'](_0x375678[_0xbff1('0x37')][_0xbff1('0x3f')]);_0x38befb['where']=qs[_0xbff1('0x40')](_[_0xbff1('0x41')](_0x375678[_0xbff1('0x37')],_0x1d15f3[_0xbff1('0x40')]),_0x26ad00);if(_0x375678[_0xbff1('0x37')]['filter']){_0x38befb[_0xbff1('0x42')]=_[_0xbff1('0x43')](_0x38befb[_0xbff1('0x42')],{'$or':_[_0xbff1('0x31')](_0x26ad00,function(_0xfc30a9){if(_0xfc30a9[_0xbff1('0x35')]!==_0xbff1('0x44')){var _0x27657f={};_0x27657f[_0xfc30a9[_0xbff1('0x2e')]]={'$like':'%'+_0x375678[_0xbff1('0x37')][_0xbff1('0x45')]+'%'};return _0x27657f;}})});}_0x38befb=_['merge']({},_0x38befb,_0x375678[_0xbff1('0x46')]);var _0x83c71d={'where':_0x38befb[_0xbff1('0x42')]};return db[_0xbff1('0x32')][_0xbff1('0x23')](_0x83c71d)['then'](function(_0x4c2446){_0x3fa735[_0xbff1('0x23')]=_0x4c2446;if(_0x375678['query'][_0xbff1('0x47')]){_0x38befb[_0xbff1('0x48')]=[{'all':!![]}];}return db[_0xbff1('0x32')][_0xbff1('0x49')](_0x38befb);})[_0xbff1('0x28')](function(_0x38554c){_0x3fa735[_0xbff1('0x4a')]=_0x38554c;return _0x3fa735;})['then'](respondWithFilteredResult(_0x32bff2,_0x38befb))[_0xbff1('0x4b')](handleError(_0x32bff2,null));};exports[_0xbff1('0x4c')]=function(_0x544c07,_0x827213){var _0x48579d={'raw':!![],'where':{'id':_0x544c07['params']['id']}},_0x3f3c42={};_0x3f3c42['model']=_[_0xbff1('0x4d')](db['AnalyticExtractedReport']['rawAttributes']);_0x3f3c42[_0xbff1('0x37')]=_[_0xbff1('0x4d')](_0x544c07[_0xbff1('0x37')]);_0x3f3c42[_0xbff1('0x40')]=_[_0xbff1('0x38')](_0x3f3c42[_0xbff1('0x39')],_0x3f3c42[_0xbff1('0x37')]);_0x48579d[_0xbff1('0x3b')]=_[_0xbff1('0x38')](_0x3f3c42[_0xbff1('0x39')],qs[_0xbff1('0x3a')](_0x544c07[_0xbff1('0x37')][_0xbff1('0x3a')]));_0x48579d[_0xbff1('0x3b')]=_0x48579d[_0xbff1('0x3b')][_0xbff1('0x3c')]?_0x48579d[_0xbff1('0x3b')]:_0x3f3c42[_0xbff1('0x39')];if(_0x544c07['query'][_0xbff1('0x47')]){_0x48579d[_0xbff1('0x48')]=[{'all':!![]}];}_0x48579d=_[_0xbff1('0x43')]({},_0x48579d,_0x544c07[_0xbff1('0x46')]);return db[_0xbff1('0x32')]['find'](_0x48579d)[_0xbff1('0x28')](handleEntityNotFound(_0x827213,null))['then'](respondWithResult(_0x827213,null))[_0xbff1('0x4b')](handleError(_0x827213,null));};exports['create']=function(_0x2eb038,_0x2c86ea){return db[_0xbff1('0x32')]['create'](_0x2eb038[_0xbff1('0x4e')],{})[_0xbff1('0x28')](function(_0x577e88){var _0x2493a3=_0x2eb038[_0xbff1('0x4f')][_0xbff1('0x2a')]({'plain':!![]});if(!_0x2493a3)throw new Error(_0xbff1('0x50'));if(_0x2493a3[_0xbff1('0x51')]===_0xbff1('0x4f')){var _0x274fc2=_0x577e88[_0xbff1('0x2a')]({'plain':!![]});var _0x16c4c2=_0xbff1('0x2b');return db['UserProfileSection'][_0xbff1('0x52')]({'where':{'name':_0x16c4c2,'userProfileId':_0x2493a3[_0xbff1('0x53')]},'raw':!![]})[_0xbff1('0x28')](function(_0x43504c){if(_0x43504c&&_0x43504c[_0xbff1('0x54')]===0x0){return db['UserProfileResource'][_0xbff1('0x55')]({'name':_0x274fc2['name'],'resourceId':_0x274fc2['id'],'type':_0x43504c[_0xbff1('0x2e')],'sectionId':_0x43504c['id']},{})[_0xbff1('0x28')](function(){return _0x577e88;});}else{return _0x577e88;}})[_0xbff1('0x4b')](function(_0x474ea4){logger[_0xbff1('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x474ea4);throw _0x474ea4;});}return _0x577e88;})[_0xbff1('0x28')](respondWithResult(_0x2c86ea,0xc9))[_0xbff1('0x4b')](handleError(_0x2c86ea,null));};exports[_0xbff1('0x57')]=function(_0x20e565,_0xc0277f){if(_0x20e565[_0xbff1('0x4e')]['id']){delete _0x20e565['body']['id'];}return db[_0xbff1('0x32')][_0xbff1('0x52')]({'where':{'id':_0x20e565['params']['id']}})[_0xbff1('0x28')](handleEntityNotFound(_0xc0277f,null))[_0xbff1('0x28')](saveUpdates(_0x20e565[_0xbff1('0x4e')],null))[_0xbff1('0x28')](respondWithResult(_0xc0277f,null))['catch'](handleError(_0xc0277f,null));};exports[_0xbff1('0x29')]=function(_0x53ae59,_0x2a96bf){return db[_0xbff1('0x32')][_0xbff1('0x52')]({'where':{'id':_0x53ae59['params']['id']}})['then'](handleEntityNotFound(_0x2a96bf,null))[_0xbff1('0x28')](removeEntity(_0x2a96bf,null))[_0xbff1('0x4b')](handleError(_0x2a96bf,null));};exports[_0xbff1('0x58')]=function(_0x481dd2,_0x2ee967,_0x3b35cb){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x481dd2[_0xbff1('0x59')]['id']},'attributes':[_0xbff1('0x2e'),_0xbff1('0x5a'),_0xbff1('0x5b'),_0xbff1('0x5c')],'raw':!![]})['then'](handleEntityNotFound(_0x2ee967,null))[_0xbff1('0x28')](function(_0x2fbfad){if(_0x2fbfad){if(!fs[_0xbff1('0x5d')](path['join'](config[_0xbff1('0x5e')],_0xbff1('0x5f'),_0x2fbfad[_0xbff1('0x5b')]))){throw new db[(_0xbff1('0x60'))][(_0xbff1('0x61'))](_0xbff1('0x62'));}if(_0x481dd2['query']['exists']){return _0x2ee967[_0xbff1('0x1c')](0xc8);}return _0x2ee967[_0xbff1('0x58')](path[_0xbff1('0x63')](config[_0xbff1('0x5e')],_0xbff1('0x5f'),_0x2fbfad[_0xbff1('0x5b')]),util[_0xbff1('0x64')](_0xbff1('0x65'),_0x2fbfad['basename']||_0x2fbfad[_0xbff1('0x2e')],_0x2fbfad[_0xbff1('0x5c')][_0xbff1('0x66')]()));}})['catch'](handleError(_0x2ee967,null));};
\ No newline at end of file
index 431b444..f318133 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x954d=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x954d,0x179));var _0xd954=function(_0x31bad1,_0x163160){_0x31bad1=_0x31bad1-0x0;var _0x30c64e=_0x954d[_0x31bad1];return _0x30c64e;};'use strict';var _=require('lodash');var util=require(_0xd954('0x0'));var logger=require(_0xd954('0x1'))(_0xd954('0x2'));var moment=require(_0xd954('0x3'));var BPromise=require('bluebird');var rp=require(_0xd954('0x4'));var fs=require('fs');var path=require(_0xd954('0x5'));var rimraf=require(_0xd954('0x6'));var config=require(_0xd954('0x7'));var attributes=require(_0xd954('0x8'));module[_0xd954('0x9')]=function(_0x4affb8,_0x213fd7){return _0x4affb8[_0xd954('0xa')](_0xd954('0xb'),attributes,{'tableName':_0xd954('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c68=['path','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','moment','bluebird','request-promise'];(function(_0x45af9f,_0x329762){var _0x5abaa4=function(_0x40a42e){while(--_0x40a42e){_0x45af9f['push'](_0x45af9f['shift']());}};_0x5abaa4(++_0x329762);}(_0x9c68,0x145));var _0x89c6=function(_0x420ace,_0x548e47){_0x420ace=_0x420ace-0x0;var _0x31661d=_0x9c68[_0x420ace];return _0x31661d;};'use strict';var _=require(_0x89c6('0x0'));var util=require(_0x89c6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x89c6('0x2'));var BPromise=require(_0x89c6('0x3'));var rp=require(_0x89c6('0x4'));var fs=require('fs');var path=require(_0x89c6('0x5'));var rimraf=require('rimraf');var config=require(_0x89c6('0x6'));var attributes=require(_0x89c6('0x7'));module[_0x89c6('0x8')]=function(_0x304790,_0x39c26f){return _0x304790[_0x89c6('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x89c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 566ee73..4cacdd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9782=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x9782,0x73));var _0x2978=function(_0x211158,_0x5edf3c){_0x211158=_0x211158-0x0;var _0x197bef=_0x9782[_0x211158];return _0x197bef;};'use strict';var _=require(_0x2978('0x0'));var util=require(_0x2978('0x1'));var moment=require(_0x2978('0x2'));var BPromise=require(_0x2978('0x3'));var rs=require(_0x2978('0x4'));var fs=require('fs');var Redis=require(_0x2978('0x5'));var db=require(_0x2978('0x6'))['db'];var utils=require(_0x2978('0x7'));var logger=require(_0x2978('0x8'))(_0x2978('0x9'));var config=require(_0x2978('0xa'));var jayson=require(_0x2978('0xb'));var client=jayson['client'][_0x2978('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33da2f,_0x52c2e6,_0x22e2c2){return new BPromise(function(_0x159b2d,_0x2d895a){return client['request'](_0x33da2f,_0x22e2c2)['then'](function(_0x2c1389){logger['info'](_0x2978('0xd'),_0x52c2e6,_0x2978('0xe'));logger[_0x2978('0xf')](_0x2978('0x10'),_0x52c2e6,'request\x20sent',JSON[_0x2978('0x11')](_0x2c1389));if(_0x2c1389[_0x2978('0x12')]){if(_0x2c1389[_0x2978('0x12')][_0x2978('0x13')]===0x1f4){logger[_0x2978('0x12')](_0x2978('0xd'),_0x52c2e6,_0x2c1389[_0x2978('0x12')]['message']);return _0x2d895a(_0x2c1389['error'][_0x2978('0x14')]);}logger['error'](_0x2978('0xd'),_0x52c2e6,_0x2c1389['error'][_0x2978('0x14')]);return _0x159b2d(_0x2c1389[_0x2978('0x12')][_0x2978('0x14')]);}else{logger['info'](_0x2978('0xd'),_0x52c2e6,'request\x20sent');_0x159b2d(_0x2c1389[_0x2978('0x15')][_0x2978('0x14')]);}})[_0x2978('0x16')](function(_0x24f4af){logger[_0x2978('0x12')](_0x2978('0xd'),_0x52c2e6,_0x24f4af);_0x2d895a(_0x24f4af);});});}
\ No newline at end of file
+var _0x45f7=['moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x2979d3,_0x54ff61){var _0x2a9a36=function(_0x215f64){while(--_0x215f64){_0x2979d3['push'](_0x2979d3['shift']());}};_0x2a9a36(++_0x54ff61);}(_0x45f7,0x11e));var _0x745f=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x45f7[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x745f('0x0'));var util=require(_0x745f('0x1'));var moment=require(_0x745f('0x2'));var BPromise=require('bluebird');var rs=require(_0x745f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x745f('0x4'))['db'];var utils=require(_0x745f('0x5'));var logger=require('../../config/logger')(_0x745f('0x6'));var config=require(_0x745f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x745f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39a58e,_0x435767,_0x15da2e){return new BPromise(function(_0x193e22,_0x28b520){return client['request'](_0x39a58e,_0x15da2e)['then'](function(_0x976730){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x435767,_0x745f('0x9'));logger[_0x745f('0xa')](_0x745f('0xb'),_0x435767,_0x745f('0x9'),JSON['stringify'](_0x976730));if(_0x976730[_0x745f('0xc')]){if(_0x976730[_0x745f('0xc')][_0x745f('0xd')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x435767,_0x976730[_0x745f('0xc')][_0x745f('0xe')]);return _0x28b520(_0x976730[_0x745f('0xc')]['message']);}logger[_0x745f('0xc')](_0x745f('0xf'),_0x435767,_0x976730[_0x745f('0xc')][_0x745f('0xe')]);return _0x193e22(_0x976730['error'][_0x745f('0xe')]);}else{logger['info'](_0x745f('0xf'),_0x435767,_0x745f('0x9'));_0x193e22(_0x976730[_0x745f('0x10')][_0x745f('0xe')]);}})[_0x745f('0x11')](function(_0x50a2b6){logger[_0x745f('0xc')](_0x745f('0xf'),_0x435767,_0x50a2b6);_0x28b520(_0x50a2b6);});});}
\ No newline at end of file
index 5e9e7a9..d2dc573 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf299=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','index','/:id','isAuthenticated','show','get','download','create','destroy','exports','multer','util'];(function(_0xc5f38,_0xfa0151){var _0x25e36b=function(_0x39819a){while(--_0x39819a){_0xc5f38['push'](_0xc5f38['shift']());}};_0x25e36b(++_0xfa0151);}(_0xf299,0x1da));var _0x9f29=function(_0x3ae303,_0x5dac79){_0x3ae303=_0x3ae303-0x0;var _0x360292=_0xf299[_0x3ae303];return _0x360292;};'use strict';var multer=require(_0x9f29('0x0'));var util=require(_0x9f29('0x1'));var path=require('path');var timeout=require(_0x9f29('0x2'));var express=require(_0x9f29('0x3'));var router=express[_0x9f29('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9f29('0x5'));var config=require(_0x9f29('0x6'));var controller=require(_0x9f29('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9f29('0x8')]);router['get'](_0x9f29('0x9'),auth[_0x9f29('0xa')](),controller[_0x9f29('0xb')]);router[_0x9f29('0xc')]('/:id/download',auth['isAuthenticated'](),controller[_0x9f29('0xd')]);router['post']('/',auth[_0x9f29('0xa')](),controller[_0x9f29('0xe')]);router['put'](_0x9f29('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9f29('0x9'),auth['isAuthenticated'](),controller[_0x9f29('0xf')]);module[_0x9f29('0x10')]=router;
\ No newline at end of file
+var _0x50ef=['/:id','show','/:id/download','download','post','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x28ea90,_0x5be2e0){var _0x56ef0c=function(_0x5cea81){while(--_0x5cea81){_0x28ea90['push'](_0x28ea90['shift']());}};_0x56ef0c(++_0x5be2e0);}(_0x50ef,0xfa));var _0xf50e=function(_0x239514,_0xf6a09f){_0x239514=_0x239514-0x0;var _0x49fe09=_0x50ef[_0x239514];return _0x49fe09;};'use strict';var multer=require(_0xf50e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf50e('0x1'));var express=require('express');var router=express[_0xf50e('0x2')]();var fs_extra=require(_0xf50e('0x3'));var auth=require(_0xf50e('0x4'));var interaction=require(_0xf50e('0x5'));var config=require(_0xf50e('0x6'));var controller=require(_0xf50e('0x7'));router[_0xf50e('0x8')]('/',auth[_0xf50e('0x9')](),controller['index']);router[_0xf50e('0x8')](_0xf50e('0xa'),auth[_0xf50e('0x9')](),controller[_0xf50e('0xb')]);router['get'](_0xf50e('0xc'),auth[_0xf50e('0x9')](),controller[_0xf50e('0xd')]);router[_0xf50e('0xe')]('/',auth[_0xf50e('0x9')](),controller['create']);router[_0xf50e('0xf')](_0xf50e('0xa'),auth[_0xf50e('0x9')](),controller[_0xf50e('0x10')]);router[_0xf50e('0x11')](_0xf50e('0xa'),auth[_0xf50e('0x9')](),controller[_0xf50e('0x12')]);module[_0xf50e('0x13')]=router;
\ No newline at end of file
index 9416b89..0465706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2882=['BOOLEAN','exports','STRING'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2882,0x1c0));var _0x2288=function(_0x1596d5,_0x12c8ea){_0x1596d5=_0x1596d5-0x0;var _0x43a9c2=_0x2882[_0x1596d5];return _0x43a9c2;};'use strict';var Sequelize=require('sequelize');module[_0x2288('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x2288('0x1')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x2288('0x1')]},'groupBy':{'type':Sequelize[_0x2288('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2288('0x1')]},'custom':{'type':Sequelize[_0x2288('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3235=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3235,0x18b));var _0x5323=function(_0x1bf87e,_0x4f7d38){_0x1bf87e=_0x1bf87e-0x0;var _0x30efc3=_0x3235[_0x1bf87e];return _0x30efc3;};'use strict';var Sequelize=require(_0x5323('0x0'));module[_0x5323('0x1')]={'field':{'type':Sequelize[_0x5323('0x2')]},'alias':{'type':Sequelize[_0x5323('0x3')]},'function':{'type':Sequelize[_0x5323('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x5323('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x5323('0x3')]},'custom':{'type':Sequelize[_0x5323('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 28bd160..15341ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b2b=['rows','catch','params','length','include','find','create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticFieldReport','count','includeAll','findAll'];(function(_0x35584e,_0x1801b4){var _0x10cb23=function(_0x4d08b8){while(--_0x4d08b8){_0x35584e['push'](_0x35584e['shift']());}};_0x10cb23(++_0x1801b4);}(_0x3b2b,0x64));var _0xb3b2=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x3b2b[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require(_0xb3b2('0x0'));var rimraf=require(_0xb3b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3b2('0x2'));var rp=require(_0xb3b2('0x3'));var moment=require(_0xb3b2('0x4'));var BPromise=require(_0xb3b2('0x5'));var Mustache=require(_0xb3b2('0x6'));var util=require(_0xb3b2('0x7'));var path=require(_0xb3b2('0x8'));var sox=require(_0xb3b2('0x9'));var csv=require(_0xb3b2('0xa'));var ejs=require(_0xb3b2('0xb'));var fs=require('fs');var fs_extra=require(_0xb3b2('0xc'));var _=require(_0xb3b2('0xd'));var squel=require(_0xb3b2('0xe'));var crypto=require(_0xb3b2('0xf'));var jsforce=require(_0xb3b2('0x10'));var deskjs=require(_0xb3b2('0x11'));var toCsv=require('to-csv');var querystring=require(_0xb3b2('0x12'));var Papa=require(_0xb3b2('0x13'));var Redis=require(_0xb3b2('0x14'));var authService=require(_0xb3b2('0x15'));var qs=require(_0xb3b2('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3b2('0x17'));var logger=require(_0xb3b2('0x18'))(_0xb3b2('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb3b2('0x1a'));var db=require(_0xb3b2('0x1b'))['db'];function respondWithStatusCode(_0x2fe382,_0x57b0f6){_0x57b0f6=_0x57b0f6||0xcc;return function(_0x53e6cf){if(_0x53e6cf){return _0x2fe382[_0xb3b2('0x1c')](_0x57b0f6);}return _0x2fe382[_0xb3b2('0x1d')](_0x57b0f6)[_0xb3b2('0x1e')]();};}function respondWithResult(_0x2d6ceb,_0x3be52c){_0x3be52c=_0x3be52c||0xc8;return function(_0x14bc91){if(_0x14bc91){return _0x2d6ceb[_0xb3b2('0x1d')](_0x3be52c)['json'](_0x14bc91);}};}function respondWithFilteredResult(_0x47b2e0,_0x2ace90){return function(_0x5065bd){if(_0x5065bd){var _0x3d7001=typeof _0x2ace90[_0xb3b2('0x1f')]===_0xb3b2('0x20')&&typeof _0x2ace90[_0xb3b2('0x21')]===_0xb3b2('0x20');var _0x2f0e7f=_0x5065bd['count'];var _0x52065c=_0x3d7001?0x0:_0x2ace90[_0xb3b2('0x1f')];var _0x328d3e=_0x3d7001?_0x5065bd['count']:_0x2ace90[_0xb3b2('0x1f')]+_0x2ace90[_0xb3b2('0x21')];var _0xb21de;if(_0x328d3e>=_0x2f0e7f){_0x328d3e=_0x2f0e7f;_0xb21de=0xc8;}else{_0xb21de=0xce;}_0x47b2e0[_0xb3b2('0x1d')](_0xb21de);return _0x47b2e0[_0xb3b2('0x22')]('Content-Range',_0x52065c+'-'+_0x328d3e+'/'+_0x2f0e7f)['json'](_0x5065bd);}return null;};}function patchUpdates(_0x5afbee){return function(_0x43d226){try{jsonpatch[_0xb3b2('0x23')](_0x43d226,_0x5afbee,!![]);}catch(_0x55de6b){return BPromise[_0xb3b2('0x24')](_0x55de6b);}return _0x43d226['save']();};}function saveUpdates(_0x28d3b2,_0x5181aa){return function(_0x3578b0){if(_0x3578b0){return _0x3578b0[_0xb3b2('0x25')](_0x28d3b2)[_0xb3b2('0x26')](function(_0x17706e){return _0x17706e;});}return null;};}function removeEntity(_0x15e36b,_0x1abd14){return function(_0x2fe729){if(_0x2fe729){return _0x2fe729[_0xb3b2('0x27')]()[_0xb3b2('0x26')](function(){_0x15e36b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b88d0,_0x382661){return function(_0x4f90a9){if(!_0x4f90a9){_0x5b88d0['sendStatus'](0x194);}return _0x4f90a9;};}function handleError(_0x300dd7,_0x54441f){_0x54441f=_0x54441f||0x1f4;return function(_0x3e2610){logger[_0xb3b2('0x28')](_0x3e2610['stack']);if(_0x3e2610[_0xb3b2('0x29')]){delete _0x3e2610['name'];}_0x300dd7[_0xb3b2('0x1d')](_0x54441f)[_0xb3b2('0x2a')](_0x3e2610);};}exports[_0xb3b2('0x2b')]=function(_0x436344,_0x4899be){var _0x2fe6df={},_0x151833={},_0x3f7e34={'count':0x0,'rows':[]};var _0x5e5b4f=_[_0xb3b2('0x2c')](db['AnalyticFieldReport'][_0xb3b2('0x2d')],function(_0xe69793){return{'name':_0xe69793[_0xb3b2('0x2e')],'type':_0xe69793[_0xb3b2('0x2f')][_0xb3b2('0x30')]};});_0x151833[_0xb3b2('0x31')]=_[_0xb3b2('0x2c')](_0x5e5b4f,_0xb3b2('0x29'));_0x151833[_0xb3b2('0x32')]=_[_0xb3b2('0x33')](_0x436344['query']);_0x151833[_0xb3b2('0x34')]=_[_0xb3b2('0x35')](_0x151833[_0xb3b2('0x31')],_0x151833[_0xb3b2('0x32')]);_0x2fe6df[_0xb3b2('0x36')]=_[_0xb3b2('0x35')](_0x151833[_0xb3b2('0x31')],qs[_0xb3b2('0x37')](_0x436344[_0xb3b2('0x32')][_0xb3b2('0x37')]));_0x2fe6df[_0xb3b2('0x36')]=_0x2fe6df[_0xb3b2('0x36')]['length']?_0x2fe6df[_0xb3b2('0x36')]:_0x151833['model'];if(!_0x436344[_0xb3b2('0x32')]['hasOwnProperty'](_0xb3b2('0x38'))){_0x2fe6df['limit']=qs[_0xb3b2('0x21')](_0x436344[_0xb3b2('0x32')][_0xb3b2('0x21')]);_0x2fe6df[_0xb3b2('0x1f')]=qs['offset'](_0x436344[_0xb3b2('0x32')][_0xb3b2('0x1f')]);}_0x2fe6df['order']=qs[_0xb3b2('0x39')](_0x436344[_0xb3b2('0x32')][_0xb3b2('0x39')]);_0x2fe6df[_0xb3b2('0x3a')]=qs[_0xb3b2('0x34')](_[_0xb3b2('0x3b')](_0x436344[_0xb3b2('0x32')],_0x151833[_0xb3b2('0x34')]),_0x5e5b4f);if(_0x436344[_0xb3b2('0x32')][_0xb3b2('0x3c')]){_0x2fe6df['where']=_[_0xb3b2('0x3d')](_0x2fe6df['where'],{'$or':_[_0xb3b2('0x2c')](_0x5e5b4f,function(_0x15f4a6){if(_0x15f4a6[_0xb3b2('0x2f')]!==_0xb3b2('0x3e')){var _0x377720={};_0x377720[_0x15f4a6[_0xb3b2('0x29')]]={'$like':'%'+_0x436344[_0xb3b2('0x32')][_0xb3b2('0x3c')]+'%'};return _0x377720;}})});}_0x2fe6df=_[_0xb3b2('0x3d')]({},_0x2fe6df,_0x436344[_0xb3b2('0x3f')]);var _0x4be208={'where':_0x2fe6df['where']};return db[_0xb3b2('0x40')][_0xb3b2('0x41')](_0x4be208)[_0xb3b2('0x26')](function(_0x2cbfab){_0x3f7e34[_0xb3b2('0x41')]=_0x2cbfab;if(_0x436344[_0xb3b2('0x32')][_0xb3b2('0x42')]){_0x2fe6df['include']=[{'all':!![]}];}return db[_0xb3b2('0x40')][_0xb3b2('0x43')](_0x2fe6df);})['then'](function(_0x5e0b07){_0x3f7e34[_0xb3b2('0x44')]=_0x5e0b07;return _0x3f7e34;})[_0xb3b2('0x26')](respondWithFilteredResult(_0x4899be,_0x2fe6df))[_0xb3b2('0x45')](handleError(_0x4899be,null));};exports['show']=function(_0x1ddce9,_0x642b08){var _0x1a2402={'raw':![],'where':{'id':_0x1ddce9[_0xb3b2('0x46')]['id']}},_0x3274a6={};_0x3274a6['model']=_[_0xb3b2('0x33')](db[_0xb3b2('0x40')][_0xb3b2('0x2d')]);_0x3274a6[_0xb3b2('0x32')]=_[_0xb3b2('0x33')](_0x1ddce9['query']);_0x3274a6[_0xb3b2('0x34')]=_[_0xb3b2('0x35')](_0x3274a6['model'],_0x3274a6[_0xb3b2('0x32')]);_0x1a2402[_0xb3b2('0x36')]=_['intersection'](_0x3274a6[_0xb3b2('0x31')],qs[_0xb3b2('0x37')](_0x1ddce9[_0xb3b2('0x32')]['fields']));_0x1a2402[_0xb3b2('0x36')]=_0x1a2402[_0xb3b2('0x36')][_0xb3b2('0x47')]?_0x1a2402['attributes']:_0x3274a6[_0xb3b2('0x31')];if(_0x1ddce9['query'][_0xb3b2('0x42')]){_0x1a2402[_0xb3b2('0x48')]=[{'all':!![]}];}_0x1a2402=_[_0xb3b2('0x3d')]({},_0x1a2402,_0x1ddce9['options']);return db[_0xb3b2('0x40')][_0xb3b2('0x49')](_0x1a2402)[_0xb3b2('0x26')](handleEntityNotFound(_0x642b08,null))['then'](respondWithResult(_0x642b08,null))[_0xb3b2('0x45')](handleError(_0x642b08,null));};exports[_0xb3b2('0x4a')]=function(_0x467765,_0x43daab){return db['AnalyticFieldReport']['create'](_0x467765['body'],{})[_0xb3b2('0x26')](respondWithResult(_0x43daab,0xc9))[_0xb3b2('0x45')](handleError(_0x43daab,null));};exports[_0xb3b2('0x4b')]=function(_0x4a8896,_0x3218f0){return db[_0xb3b2('0x40')][_0xb3b2('0x4b')](_0x4a8896['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3218f0,0xc9))[_0xb3b2('0x45')](handleError(_0x3218f0,null));};exports[_0xb3b2('0x25')]=function(_0x475758,_0x35d12d){if(_0x475758[_0xb3b2('0x4c')]['id']){delete _0x475758[_0xb3b2('0x4c')]['id'];}return db[_0xb3b2('0x40')]['find']({'where':{'id':_0x475758[_0xb3b2('0x46')]['id']}})[_0xb3b2('0x26')](handleEntityNotFound(_0x35d12d,null))[_0xb3b2('0x26')](saveUpdates(_0x475758[_0xb3b2('0x4c')],null))[_0xb3b2('0x26')](respondWithResult(_0x35d12d,null))[_0xb3b2('0x45')](handleError(_0x35d12d,null));};exports[_0xb3b2('0x27')]=function(_0x373455,_0x27f705){return db['AnalyticFieldReport'][_0xb3b2('0x49')]({'where':{'id':_0x373455[_0xb3b2('0x46')]['id']}})[_0xb3b2('0x26')](handleEntityNotFound(_0x27f705,null))[_0xb3b2('0x26')](removeEntity(_0x27f705,null))[_0xb3b2('0x45')](handleError(_0x27f705,null));};exports[_0xb3b2('0x4d')]=function(_0x56d48e,_0x197529){return db[_0xb3b2('0x40')]['destroy']({'where':{'id':_0x56d48e[_0xb3b2('0x32')][_0xb3b2('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xb3b2('0x26')](respondWithResult(_0x197529,0xcc))[_0xb3b2('0x45')](handleError(_0x197529,null));};exports['addFields']=function(_0x20b611,_0x4f5109,_0x54634d){return db[_0xb3b2('0x4f')][_0xb3b2('0x50')]({'where':{'id':_0x20b611[_0xb3b2('0x46')]['id']}})[_0xb3b2('0x26')](handleEntityNotFound(_0x4f5109,null))[_0xb3b2('0x26')](function(_0x3e4af2){if(_0x3e4af2){return db[_0xb3b2('0x51')][_0xb3b2('0x52')](function(_0x13015a){return db[_0xb3b2('0x40')][_0xb3b2('0x27')]({'where':{'CustomReportId':_0x20b611[_0xb3b2('0x46')]['id']},'transaction':_0x13015a})[_0xb3b2('0x26')](function(_0x3e2708){var _0x582313=_[_0xb3b2('0x2c')](_0x20b611[_0xb3b2('0x4c')],function(_0x1b085a){delete _0x1b085a['id'];_0x1b085a[_0xb3b2('0x53')]=_0x20b611[_0xb3b2('0x46')]['id'];return _0x1b085a;});return db[_0xb3b2('0x40')][_0xb3b2('0x4b')](_0x582313,{'transaction':_0x13015a});});})[_0xb3b2('0x26')](function(){return db[_0xb3b2('0x40')][_0xb3b2('0x43')]({'where':{'CustomReportId':_0x20b611[_0xb3b2('0x46')]['id']}});});}})['then'](respondWithResult(_0x4f5109,null))['catch'](handleError(_0x4f5109,null));};
\ No newline at end of file
+var _0x78b3=['sort','where','filters','filter','merge','type','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','bulkCreate','body','update','bulkDestroy','ids','addFields','sequelize','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x176f57,_0x3f239a){var _0x48e68e=function(_0x3a007c){while(--_0x3a007c){_0x176f57['push'](_0x176f57['shift']());}};_0x48e68e(++_0x3f239a);}(_0x78b3,0x1b3));var _0x378b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78b3[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x378b('0x0'));var rimraf=require(_0x378b('0x1'));var zipdir=require(_0x378b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x378b('0x3'));var moment=require(_0x378b('0x4'));var BPromise=require(_0x378b('0x5'));var Mustache=require(_0x378b('0x6'));var util=require(_0x378b('0x7'));var path=require(_0x378b('0x8'));var sox=require('sox');var csv=require(_0x378b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x378b('0xa'));var _=require('lodash');var squel=require(_0x378b('0xb'));var crypto=require('crypto');var jsforce=require(_0x378b('0xc'));var deskjs=require(_0x378b('0xd'));var toCsv=require(_0x378b('0x9'));var querystring=require(_0x378b('0xe'));var Papa=require(_0x378b('0xf'));var Redis=require(_0x378b('0x10'));var authService=require(_0x378b('0x11'));var qs=require(_0x378b('0x12'));var as=require(_0x378b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x378b('0x14'))(_0x378b('0x15'));var utils=require(_0x378b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x378b('0x17'))['db'];function respondWithStatusCode(_0x214d6c,_0x5b790b){_0x5b790b=_0x5b790b||0xcc;return function(_0x785e54){if(_0x785e54){return _0x214d6c['sendStatus'](_0x5b790b);}return _0x214d6c[_0x378b('0x18')](_0x5b790b)[_0x378b('0x19')]();};}function respondWithResult(_0x476804,_0x4f9b5f){_0x4f9b5f=_0x4f9b5f||0xc8;return function(_0x4feeb2){if(_0x4feeb2){return _0x476804[_0x378b('0x18')](_0x4f9b5f)[_0x378b('0x1a')](_0x4feeb2);}};}function respondWithFilteredResult(_0x1c1375,_0xb0d9f3){return function(_0x453ea0){if(_0x453ea0){var _0x3f1c27=typeof _0xb0d9f3[_0x378b('0x1b')]==='undefined'&&typeof _0xb0d9f3['limit']===_0x378b('0x1c');var _0x5494db=_0x453ea0[_0x378b('0x1d')];var _0x1afc97=_0x3f1c27?0x0:_0xb0d9f3['offset'];var _0x22defa=_0x3f1c27?_0x453ea0[_0x378b('0x1d')]:_0xb0d9f3[_0x378b('0x1b')]+_0xb0d9f3[_0x378b('0x1e')];var _0x4ddc1e;if(_0x22defa>=_0x5494db){_0x22defa=_0x5494db;_0x4ddc1e=0xc8;}else{_0x4ddc1e=0xce;}_0x1c1375[_0x378b('0x18')](_0x4ddc1e);return _0x1c1375[_0x378b('0x1f')](_0x378b('0x20'),_0x1afc97+'-'+_0x22defa+'/'+_0x5494db)[_0x378b('0x1a')](_0x453ea0);}return null;};}function patchUpdates(_0x4177e2){return function(_0x1a6c1f){try{jsonpatch[_0x378b('0x21')](_0x1a6c1f,_0x4177e2,!![]);}catch(_0x54a6d1){return BPromise[_0x378b('0x22')](_0x54a6d1);}return _0x1a6c1f[_0x378b('0x23')]();};}function saveUpdates(_0x3fe2b2,_0x34591f){return function(_0x46791e){if(_0x46791e){return _0x46791e['update'](_0x3fe2b2)[_0x378b('0x24')](function(_0x36a620){return _0x36a620;});}return null;};}function removeEntity(_0x281ec3,_0x210332){return function(_0x421f87){if(_0x421f87){return _0x421f87[_0x378b('0x25')]()[_0x378b('0x24')](function(){_0x281ec3[_0x378b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10c8fb,_0x2b3dd3){return function(_0x4f6ef2){if(!_0x4f6ef2){_0x10c8fb[_0x378b('0x26')](0x194);}return _0x4f6ef2;};}function handleError(_0x8a4e1d,_0x10c139){_0x10c139=_0x10c139||0x1f4;return function(_0x503e51){logger[_0x378b('0x27')](_0x503e51[_0x378b('0x28')]);if(_0x503e51['name']){delete _0x503e51[_0x378b('0x29')];}_0x8a4e1d[_0x378b('0x18')](_0x10c139)[_0x378b('0x2a')](_0x503e51);};}exports[_0x378b('0x2b')]=function(_0x3acd7f,_0x4d28ac){var _0x196ba1={},_0x5c62be={},_0x25d01a={'count':0x0,'rows':[]};var _0x255ac7=_['map'](db[_0x378b('0x2c')][_0x378b('0x2d')],function(_0x56edf7){return{'name':_0x56edf7[_0x378b('0x2e')],'type':_0x56edf7['type']['key']};});_0x5c62be[_0x378b('0x2f')]=_[_0x378b('0x30')](_0x255ac7,_0x378b('0x29'));_0x5c62be[_0x378b('0x31')]=_['keys'](_0x3acd7f[_0x378b('0x31')]);_0x5c62be['filters']=_[_0x378b('0x32')](_0x5c62be[_0x378b('0x2f')],_0x5c62be['query']);_0x196ba1['attributes']=_[_0x378b('0x32')](_0x5c62be[_0x378b('0x2f')],qs[_0x378b('0x33')](_0x3acd7f[_0x378b('0x31')][_0x378b('0x33')]));_0x196ba1[_0x378b('0x34')]=_0x196ba1[_0x378b('0x34')][_0x378b('0x35')]?_0x196ba1['attributes']:_0x5c62be[_0x378b('0x2f')];if(!_0x3acd7f[_0x378b('0x31')][_0x378b('0x36')](_0x378b('0x37'))){_0x196ba1[_0x378b('0x1e')]=qs[_0x378b('0x1e')](_0x3acd7f['query'][_0x378b('0x1e')]);_0x196ba1[_0x378b('0x1b')]=qs[_0x378b('0x1b')](_0x3acd7f[_0x378b('0x31')]['offset']);}_0x196ba1[_0x378b('0x38')]=qs[_0x378b('0x39')](_0x3acd7f['query'][_0x378b('0x39')]);_0x196ba1[_0x378b('0x3a')]=qs[_0x378b('0x3b')](_['pick'](_0x3acd7f[_0x378b('0x31')],_0x5c62be[_0x378b('0x3b')]),_0x255ac7);if(_0x3acd7f[_0x378b('0x31')][_0x378b('0x3c')]){_0x196ba1[_0x378b('0x3a')]=_[_0x378b('0x3d')](_0x196ba1['where'],{'$or':_[_0x378b('0x30')](_0x255ac7,function(_0xd3a3c8){if(_0xd3a3c8[_0x378b('0x3e')]!=='VIRTUAL'){var _0x2777db={};_0x2777db[_0xd3a3c8[_0x378b('0x29')]]={'$like':'%'+_0x3acd7f[_0x378b('0x31')][_0x378b('0x3c')]+'%'};return _0x2777db;}})});}_0x196ba1=_[_0x378b('0x3d')]({},_0x196ba1,_0x3acd7f[_0x378b('0x3f')]);var _0x51a9de={'where':_0x196ba1[_0x378b('0x3a')]};return db[_0x378b('0x2c')][_0x378b('0x1d')](_0x51a9de)[_0x378b('0x24')](function(_0x4efc14){_0x25d01a[_0x378b('0x1d')]=_0x4efc14;if(_0x3acd7f[_0x378b('0x31')][_0x378b('0x40')]){_0x196ba1[_0x378b('0x41')]=[{'all':!![]}];}return db[_0x378b('0x2c')][_0x378b('0x42')](_0x196ba1);})[_0x378b('0x24')](function(_0x23005c){_0x25d01a[_0x378b('0x43')]=_0x23005c;return _0x25d01a;})[_0x378b('0x24')](respondWithFilteredResult(_0x4d28ac,_0x196ba1))['catch'](handleError(_0x4d28ac,null));};exports[_0x378b('0x44')]=function(_0x242d30,_0x2e4671){var _0xed66fc={'raw':![],'where':{'id':_0x242d30[_0x378b('0x45')]['id']}},_0x19b24e={};_0x19b24e['model']=_['keys'](db[_0x378b('0x2c')]['rawAttributes']);_0x19b24e[_0x378b('0x31')]=_[_0x378b('0x46')](_0x242d30['query']);_0x19b24e[_0x378b('0x3b')]=_[_0x378b('0x32')](_0x19b24e['model'],_0x19b24e['query']);_0xed66fc['attributes']=_[_0x378b('0x32')](_0x19b24e['model'],qs[_0x378b('0x33')](_0x242d30['query'][_0x378b('0x33')]));_0xed66fc['attributes']=_0xed66fc[_0x378b('0x34')][_0x378b('0x35')]?_0xed66fc[_0x378b('0x34')]:_0x19b24e[_0x378b('0x2f')];if(_0x242d30[_0x378b('0x31')][_0x378b('0x40')]){_0xed66fc[_0x378b('0x41')]=[{'all':!![]}];}_0xed66fc=_[_0x378b('0x3d')]({},_0xed66fc,_0x242d30[_0x378b('0x3f')]);return db[_0x378b('0x2c')][_0x378b('0x47')](_0xed66fc)['then'](handleEntityNotFound(_0x2e4671,null))[_0x378b('0x24')](respondWithResult(_0x2e4671,null))[_0x378b('0x48')](handleError(_0x2e4671,null));};exports['create']=function(_0x9c26d9,_0x4c52bf){return db['AnalyticFieldReport'][_0x378b('0x49')](_0x9c26d9['body'],{})[_0x378b('0x24')](respondWithResult(_0x4c52bf,0xc9))[_0x378b('0x48')](handleError(_0x4c52bf,null));};exports[_0x378b('0x4a')]=function(_0x245d0c,_0x54c76d){return db[_0x378b('0x2c')][_0x378b('0x4a')](_0x245d0c[_0x378b('0x4b')],{'raw':![],'individualHooks':!![]})[_0x378b('0x24')](respondWithResult(_0x54c76d,0xc9))[_0x378b('0x48')](handleError(_0x54c76d,null));};exports[_0x378b('0x4c')]=function(_0xfd57e0,_0x911d4f){if(_0xfd57e0['body']['id']){delete _0xfd57e0[_0x378b('0x4b')]['id'];}return db[_0x378b('0x2c')]['find']({'where':{'id':_0xfd57e0[_0x378b('0x45')]['id']}})[_0x378b('0x24')](handleEntityNotFound(_0x911d4f,null))[_0x378b('0x24')](saveUpdates(_0xfd57e0[_0x378b('0x4b')],null))[_0x378b('0x24')](respondWithResult(_0x911d4f,null))[_0x378b('0x48')](handleError(_0x911d4f,null));};exports[_0x378b('0x25')]=function(_0x59dfa7,_0xd0b594){return db[_0x378b('0x2c')][_0x378b('0x47')]({'where':{'id':_0x59dfa7[_0x378b('0x45')]['id']}})['then'](handleEntityNotFound(_0xd0b594,null))['then'](removeEntity(_0xd0b594,null))[_0x378b('0x48')](handleError(_0xd0b594,null));};exports[_0x378b('0x4d')]=function(_0x3d06f0,_0x3adb8f){return db[_0x378b('0x2c')]['destroy']({'where':{'id':_0x3d06f0[_0x378b('0x31')][_0x378b('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x378b('0x24')](respondWithResult(_0x3adb8f,0xcc))[_0x378b('0x48')](handleError(_0x3adb8f,null));};exports[_0x378b('0x4f')]=function(_0x2e515b,_0x271c12,_0x2d7fa7){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x2e515b['params']['id']}})[_0x378b('0x24')](handleEntityNotFound(_0x271c12,null))[_0x378b('0x24')](function(_0x4223ce){if(_0x4223ce){return db[_0x378b('0x50')]['transaction'](function(_0x3f0b04){return db[_0x378b('0x2c')][_0x378b('0x25')]({'where':{'CustomReportId':_0x2e515b[_0x378b('0x45')]['id']},'transaction':_0x3f0b04})[_0x378b('0x24')](function(_0x35e366){var _0x10e1fb=_[_0x378b('0x30')](_0x2e515b[_0x378b('0x4b')],function(_0x5d31ce){delete _0x5d31ce['id'];_0x5d31ce[_0x378b('0x51')]=_0x2e515b[_0x378b('0x45')]['id'];return _0x5d31ce;});return db['AnalyticFieldReport'][_0x378b('0x4a')](_0x10e1fb,{'transaction':_0x3f0b04});});})[_0x378b('0x24')](function(){return db[_0x378b('0x2c')][_0x378b('0x42')]({'where':{'CustomReportId':_0x2e515b[_0x378b('0x45')]['id']}});});}})['then'](respondWithResult(_0x271c12,null))[_0x378b('0x48')](handleError(_0x271c12,null));};
\ No newline at end of file
index 7bd77a0..434cc3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8bc=['exports','define','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x3666dc,_0x18701a){var _0x31c942=function(_0x315164){while(--_0x315164){_0x3666dc['push'](_0x3666dc['shift']());}};_0x31c942(++_0x18701a);}(_0xd8bc,0x142));var _0xcd8b=function(_0x38164,_0x50256b){_0x38164=_0x38164-0x0;var _0x2a095c=_0xd8bc[_0x38164];return _0x2a095c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcd8b('0x0'))('api');var moment=require(_0xcd8b('0x1'));var BPromise=require(_0xcd8b('0x2'));var rp=require(_0xcd8b('0x3'));var fs=require('fs');var path=require(_0xcd8b('0x4'));var rimraf=require(_0xcd8b('0x5'));var config=require(_0xcd8b('0x6'));var attributes=require(_0xcd8b('0x7'));module[_0xcd8b('0x8')]=function(_0x1b6b12,_0x2b3283){return _0x1b6b12[_0xcd8b('0x9')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2716=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x457b64,_0x49a219){var _0x437111=function(_0x3dad3d){while(--_0x3dad3d){_0x457b64['push'](_0x457b64['shift']());}};_0x437111(++_0x49a219);}(_0x2716,0xdd));var _0x6271=function(_0x3e7804,_0x121853){_0x3e7804=_0x3e7804-0x0;var _0x56efda=_0x2716[_0x3e7804];return _0x56efda;};'use strict';var _=require('lodash');var util=require(_0x6271('0x0'));var logger=require('../../config/logger')(_0x6271('0x1'));var moment=require(_0x6271('0x2'));var BPromise=require('bluebird');var rp=require(_0x6271('0x3'));var fs=require('fs');var path=require(_0x6271('0x4'));var rimraf=require(_0x6271('0x5'));var config=require(_0x6271('0x6'));var attributes=require(_0x6271('0x7'));module[_0x6271('0x8')]=function(_0x1d8381,_0xf5a146){return _0x1d8381[_0x6271('0x9')](_0x6271('0xa'),attributes,{'tableName':_0x6271('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 051071d..20636ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9e3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb'];(function(_0x12c65a,_0x1a861f){var _0x1680be=function(_0x44c796){while(--_0x44c796){_0x12c65a['push'](_0x12c65a['shift']());}};_0x1680be(++_0x1a861f);}(_0xe9e3,0x164));var _0x3e9e=function(_0x235356,_0x523789){_0x235356=_0x235356-0x0;var _0x1ecede=_0xe9e3[_0x235356];return _0x1ecede;};'use strict';var _=require(_0x3e9e('0x0'));var util=require('util');var moment=require(_0x3e9e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e9e('0x2'));var db=require(_0x3e9e('0x3'))['db'];var utils=require(_0x3e9e('0x4'));var logger=require(_0x3e9e('0x5'))('rpc');var config=require(_0x3e9e('0x6'));var jayson=require(_0x3e9e('0x7'));var client=jayson[_0x3e9e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a8897,_0x2b0a54,_0x380138){return new BPromise(function(_0x3319bc,_0x57cccc){return client['request'](_0x4a8897,_0x380138)[_0x3e9e('0x9')](function(_0x437f6b){logger['info'](_0x3e9e('0xa'),_0x2b0a54,_0x3e9e('0xb'));logger[_0x3e9e('0xc')](_0x3e9e('0xd'),_0x2b0a54,_0x3e9e('0xb'),JSON[_0x3e9e('0xe')](_0x437f6b));if(_0x437f6b[_0x3e9e('0xf')]){if(_0x437f6b['error'][_0x3e9e('0x10')]===0x1f4){logger[_0x3e9e('0xf')](_0x3e9e('0xa'),_0x2b0a54,_0x437f6b['error'][_0x3e9e('0x11')]);return _0x57cccc(_0x437f6b[_0x3e9e('0xf')][_0x3e9e('0x11')]);}logger[_0x3e9e('0xf')](_0x3e9e('0xa'),_0x2b0a54,_0x437f6b['error']['message']);return _0x3319bc(_0x437f6b[_0x3e9e('0xf')][_0x3e9e('0x11')]);}else{logger['info'](_0x3e9e('0xa'),_0x2b0a54,_0x3e9e('0xb'));_0x3319bc(_0x437f6b[_0x3e9e('0x12')][_0x3e9e('0x11')]);}})[_0x3e9e('0x13')](function(_0x3c8967){logger[_0x3e9e('0xf')](_0x3e9e('0xa'),_0x2b0a54,_0x3c8967);_0x57cccc(_0x3c8967);});});}
\ No newline at end of file
+var _0xfb8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','AnalyticFieldReport,\x20%s,\x20%s','info','result'];(function(_0x3ef1d4,_0x3fc67a){var _0x2c5f70=function(_0x4f9687){while(--_0x4f9687){_0x3ef1d4['push'](_0x3ef1d4['shift']());}};_0x2c5f70(++_0x3fc67a);}(_0xfb8a,0xfe));var _0xafb8=function(_0x27b4c7,_0xd847e6){_0x27b4c7=_0x27b4c7-0x0;var _0x3000b9=_0xfb8a[_0x27b4c7];return _0x3000b9;};'use strict';var _=require(_0xafb8('0x0'));var util=require(_0xafb8('0x1'));var moment=require(_0xafb8('0x2'));var BPromise=require(_0xafb8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xafb8('0x4'));var db=require(_0xafb8('0x5'))['db'];var utils=require(_0xafb8('0x6'));var logger=require(_0xafb8('0x7'))(_0xafb8('0x8'));var config=require('../../config/environment');var jayson=require(_0xafb8('0x9'));var client=jayson[_0xafb8('0xa')][_0xafb8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2639a3,_0x2a1343,_0x11ad1f){return new BPromise(function(_0x306c21,_0x590552){return client[_0xafb8('0xc')](_0x2639a3,_0x11ad1f)[_0xafb8('0xd')](function(_0x1d5788){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2a1343,_0xafb8('0xe'));logger[_0xafb8('0xf')](_0xafb8('0x10'),_0x2a1343,_0xafb8('0xe'),JSON['stringify'](_0x1d5788));if(_0x1d5788['error']){if(_0x1d5788['error']['code']===0x1f4){logger[_0xafb8('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2a1343,_0x1d5788['error'][_0xafb8('0x12')]);return _0x590552(_0x1d5788['error'][_0xafb8('0x12')]);}logger[_0xafb8('0x11')](_0xafb8('0x13'),_0x2a1343,_0x1d5788[_0xafb8('0x11')][_0xafb8('0x12')]);return _0x306c21(_0x1d5788[_0xafb8('0x11')][_0xafb8('0x12')]);}else{logger[_0xafb8('0x14')](_0xafb8('0x13'),_0x2a1343,_0xafb8('0xe'));_0x306c21(_0x1d5788[_0xafb8('0x15')]['message']);}})[_0xafb8('0x16')](function(_0x269f49){logger['error'](_0xafb8('0x13'),_0x2a1343,_0x269f49);_0x590552(_0x269f49);});});}
\ No newline at end of file
index f7d43b0..7e1c7f3 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(_0x37c378,_0xdf16f5){var _0x2df80c=function(_0x3c09df){while(--_0x3c09df){_0x37c378['push'](_0x37c378['shift']());}};_0x2df80c(++_0xdf16f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x35ef47,_0x4590ae){var _0x3a8b18=function(_0xecabda){while(--_0xecabda){_0x35ef47['push'](_0x35ef47['shift']());}};_0x3a8b18(++_0x4590ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 bf89696..52396b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e5c=['STRING','TEXT','sequelize'];(function(_0x261bbb,_0x3da796){var _0x53c6ef=function(_0x249ca3){while(--_0x249ca3){_0x261bbb['push'](_0x261bbb['shift']());}};_0x53c6ef(++_0x3da796);}(_0x4e5c,0x149));var _0xc4e5=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x4e5c[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xc4e5('0x0'));module['exports']={'name':{'type':Sequelize[_0xc4e5('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xc4e5('0x1')]},'metric':{'type':Sequelize[_0xc4e5('0x2')]},'description':{'type':Sequelize[_0xc4e5('0x1')]}};
\ No newline at end of file
+var _0x2179=['name','TEXT','sequelize','exports','STRING'];(function(_0x1be6d5,_0x1f7a51){var _0x293558=function(_0x167b7d){while(--_0x167b7d){_0x1be6d5['push'](_0x1be6d5['shift']());}};_0x293558(++_0x1f7a51);}(_0x2179,0xc0));var _0x9217=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0x2179[_0x4854d6];return _0x3885c0;};'use strict';var Sequelize=require(_0x9217('0x0'));module[_0x9217('0x1')]={'name':{'type':Sequelize[_0x9217('0x2')],'allowNull':![],'unique':_0x9217('0x3')},'table':{'type':Sequelize[_0x9217('0x2')]},'metric':{'type':Sequelize[_0x9217('0x4')]},'description':{'type':Sequelize[_0x9217('0x2')]}};
\ No newline at end of file
index d8ff0d2..8f1a47a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x1904c8,_0x5915d6){var _0x63269b=function(_0x10913b){while(--_0x10913b){_0x1904c8['push'](_0x1904c8['shift']());}};_0x63269b(++_0x5915d6);}(_0x8ef6,0xf2));var _0x68ef=function(_0x460a87,_0x3fbb5f){_0x460a87=_0x460a87-0x0;var _0x259d9e=_0x8ef6[_0x460a87];return _0x259d9e;};'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
+var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x2c0aaa,_0x37b985){var _0x27fec2=function(_0x19bde5){while(--_0x19bde5){_0x2c0aaa['push'](_0x2c0aaa['shift']());}};_0x27fec2(++_0x37b985);}(_0xe5b3,0x133));var _0x3e5b=function(_0x1e2754,_0x5510fe){_0x1e2754=_0x1e2754-0x0;var _0x316f76=_0xe5b3[_0x1e2754];return _0x316f76;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
index a294e8b..0885896 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e6=['lodash','util','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics'];(function(_0x49328c,_0x231fff){var _0x522185=function(_0x52f363){while(--_0x52f363){_0x49328c['push'](_0x49328c['shift']());}};_0x522185(++_0x231fff);}(_0x58e6,0x1c2));var _0x658e=function(_0x529811,_0x3cd4ed){_0x529811=_0x529811-0x0;var _0x4cc010=_0x58e6[_0x529811];return _0x4cc010;};'use strict';var _=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x658e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x658e('0x3'));var rimraf=require(_0x658e('0x4'));var config=require(_0x658e('0x5'));var attributes=require(_0x658e('0x6'));module[_0x658e('0x7')]=function(_0x2add44,_0x3251b8){return _0x2add44['define']('AnalyticMetric',attributes,{'tableName':_0x658e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa87e=['request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird'];(function(_0x1b16ca,_0xd4ce48){var _0x31a732=function(_0x4d5f0e){while(--_0x4d5f0e){_0x1b16ca['push'](_0x1b16ca['shift']());}};_0x31a732(++_0xd4ce48);}(_0xa87e,0x1c2));var _0xea87=function(_0xf13f62,_0x1fa2ec){_0xf13f62=_0xf13f62-0x0;var _0x5905e6=_0xa87e[_0xf13f62];return _0x5905e6;};'use strict';var _=require(_0xea87('0x0'));var util=require(_0xea87('0x1'));var logger=require(_0xea87('0x2'))(_0xea87('0x3'));var moment=require('moment');var BPromise=require(_0xea87('0x4'));var rp=require(_0xea87('0x5'));var fs=require('fs');var path=require(_0xea87('0x6'));var rimraf=require('rimraf');var config=require(_0xea87('0x7'));var attributes=require(_0xea87('0x8'));module[_0xea87('0x9')]=function(_0x33f15b,_0x5ea863){return _0x33f15b[_0xea87('0xa')](_0xea87('0xb'),attributes,{'tableName':_0xea87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c6eeaf0..2a59398 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x653f=['code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ff4c1,_0x15ee8f){var _0x1d66d3=function(_0x4867ad){while(--_0x4867ad){_0x1ff4c1['push'](_0x1ff4c1['shift']());}};_0x1d66d3(++_0x15ee8f);}(_0x653f,0x95));var _0xf653=function(_0x2faabb,_0x54853c){_0x2faabb=_0x2faabb-0x0;var _0x2d09c4=_0x653f[_0x2faabb];return _0x2d09c4;};'use strict';var _=require(_0xf653('0x0'));var util=require(_0xf653('0x1'));var moment=require(_0xf653('0x2'));var BPromise=require('bluebird');var rs=require(_0xf653('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf653('0x4'))['db'];var utils=require(_0xf653('0x5'));var logger=require(_0xf653('0x6'))(_0xf653('0x7'));var config=require(_0xf653('0x8'));var jayson=require(_0xf653('0x9'));var client=jayson[_0xf653('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4303da,_0x7468b1,_0x5a171e){return new BPromise(function(_0x47593c,_0x5a5f57){return client[_0xf653('0xb')](_0x4303da,_0x5a171e)[_0xf653('0xc')](function(_0xdfee88){logger[_0xf653('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x7468b1,_0xf653('0xe'));logger[_0xf653('0xf')](_0xf653('0x10'),_0x7468b1,_0xf653('0xe'),JSON[_0xf653('0x11')](_0xdfee88));if(_0xdfee88[_0xf653('0x12')]){if(_0xdfee88['error'][_0xf653('0x13')]===0x1f4){logger[_0xf653('0x12')](_0xf653('0x14'),_0x7468b1,_0xdfee88['error']['message']);return _0x5a5f57(_0xdfee88[_0xf653('0x12')][_0xf653('0x15')]);}logger[_0xf653('0x12')](_0xf653('0x14'),_0x7468b1,_0xdfee88[_0xf653('0x12')][_0xf653('0x15')]);return _0x47593c(_0xdfee88[_0xf653('0x12')][_0xf653('0x15')]);}else{logger[_0xf653('0xd')](_0xf653('0x14'),_0x7468b1,_0xf653('0xe'));_0x47593c(_0xdfee88[_0xf653('0x16')]['message']);}})[_0xf653('0x17')](function(_0x42d92c){logger['error'](_0xf653('0x14'),_0x7468b1,_0x42d92c);_0x5a5f57(_0x42d92c);});});}
\ No newline at end of file
+var _0x2b7a=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x2a6be5,_0x17992a){var _0x59031e=function(_0x475c74){while(--_0x475c74){_0x2a6be5['push'](_0x2a6be5['shift']());}};_0x59031e(++_0x17992a);}(_0x2b7a,0x1c1));var _0xa2b7=function(_0x452851,_0x22167f){_0x452851=_0x452851-0x0;var _0x438bd4=_0x2b7a[_0x452851];return _0x438bd4;};'use strict';var _=require(_0xa2b7('0x0'));var util=require(_0xa2b7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa2b7('0x2'));var fs=require('fs');var Redis=require(_0xa2b7('0x3'));var db=require(_0xa2b7('0x4'))['db'];var utils=require(_0xa2b7('0x5'));var logger=require('../../config/logger')(_0xa2b7('0x6'));var config=require(_0xa2b7('0x7'));var jayson=require(_0xa2b7('0x8'));var client=jayson['client'][_0xa2b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58eb7f,_0xec5791,_0x2d6403){return new BPromise(function(_0x142a50,_0x4b2462){return client[_0xa2b7('0xa')](_0x58eb7f,_0x2d6403)[_0xa2b7('0xb')](function(_0x1de8f7){logger[_0xa2b7('0xc')](_0xa2b7('0xd'),_0xec5791,_0xa2b7('0xe'));logger[_0xa2b7('0xf')](_0xa2b7('0x10'),_0xec5791,_0xa2b7('0xe'),JSON['stringify'](_0x1de8f7));if(_0x1de8f7[_0xa2b7('0x11')]){if(_0x1de8f7[_0xa2b7('0x11')][_0xa2b7('0x12')]===0x1f4){logger[_0xa2b7('0x11')](_0xa2b7('0xd'),_0xec5791,_0x1de8f7[_0xa2b7('0x11')]['message']);return _0x4b2462(_0x1de8f7[_0xa2b7('0x11')]['message']);}logger[_0xa2b7('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0xec5791,_0x1de8f7[_0xa2b7('0x11')][_0xa2b7('0x13')]);return _0x142a50(_0x1de8f7[_0xa2b7('0x11')][_0xa2b7('0x13')]);}else{logger[_0xa2b7('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0xec5791,_0xa2b7('0xe'));_0x142a50(_0x1de8f7['result']['message']);}})[_0xa2b7('0x14')](function(_0x2edb5d){logger['error'](_0xa2b7('0xd'),_0xec5791,_0x2edb5d);_0x4b2462(_0x2edb5d);});});}
\ No newline at end of file
index 1fb7789..818ae49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39d9=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0xd1ee6c,_0x344315){var _0x1faa39=function(_0x13a3f9){while(--_0x13a3f9){_0xd1ee6c['push'](_0xd1ee6c['shift']());}};_0x1faa39(++_0x344315);}(_0x39d9,0x17f));var _0x939d=function(_0x19cc47,_0x43df22){_0x19cc47=_0x19cc47-0x0;var _0x4bf1ee=_0x39d9[_0x19cc47];return _0x4bf1ee;};'use strict';var multer=require(_0x939d('0x0'));var util=require(_0x939d('0x1'));var path=require(_0x939d('0x2'));var timeout=require(_0x939d('0x3'));var express=require(_0x939d('0x4'));var router=express[_0x939d('0x5')]();var fs_extra=require(_0x939d('0x6'));var auth=require(_0x939d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x939d('0x8'));var controller=require(_0x939d('0x9'));router[_0x939d('0xa')]('/',auth['isAuthenticated'](),controller[_0x939d('0xb')]);router['get'](_0x939d('0xc'),auth[_0x939d('0xd')](),controller[_0x939d('0xe')]);router[_0x939d('0xf')]('/',auth[_0x939d('0xd')](),controller[_0x939d('0x10')]);router[_0x939d('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x939d('0x12')]);router[_0x939d('0x13')](_0x939d('0xc'),auth[_0x939d('0xd')](),controller[_0x939d('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x975f=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x3a4e7e,_0x154481){var _0x3a7bae=function(_0x3fecd0){while(--_0x3fecd0){_0x3a4e7e['push'](_0x3a4e7e['shift']());}};_0x3a7bae(++_0x154481);}(_0x975f,0x109));var _0xf975=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x975f[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf975('0x2'));var router=express[_0xf975('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf975('0x4'));var interaction=require(_0xf975('0x5'));var config=require(_0xf975('0x6'));var controller=require(_0xf975('0x7'));router['get']('/',auth[_0xf975('0x8')](),controller[_0xf975('0x9')]);router[_0xf975('0xa')](_0xf975('0xb'),auth['isAuthenticated'](),controller[_0xf975('0xc')]);router[_0xf975('0xd')]('/',auth[_0xf975('0x8')](),controller['create']);router[_0xf975('0xe')](_0xf975('0xb'),auth['isAuthenticated'](),controller[_0xf975('0xf')]);router[_0xf975('0x10')](_0xf975('0xb'),auth[_0xf975('0x8')](),controller[_0xf975('0x11')]);module[_0xf975('0x12')]=router;
\ No newline at end of file
index f287e28..e04ce00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4431=['sequelize','TEXT'];(function(_0x4d9aab,_0x5e3880){var _0x34a871=function(_0x34344f){while(--_0x34344f){_0x4d9aab['push'](_0x4d9aab['shift']());}};_0x34a871(++_0x5e3880);}(_0x4431,0x1b4));var _0x1443=function(_0x438745,_0x2bbf7b){_0x438745=_0x438745-0x0;var _0xc05aaa=_0x4431[_0x438745];return _0xc05aaa;};'use strict';var Sequelize=require(_0x1443('0x0'));module['exports']={'tree':{'type':Sequelize[_0x1443('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x74b1=['exports','sequelize'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x74b1,0xb5));var _0x174b=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0x74b1[_0x81f000];return _0x337aa2;};'use strict';var Sequelize=require(_0x174b('0x0'));module[_0x174b('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
index 9a786d8..320ffb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f5e=['Content-Range','save','update','then','destroy','name','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','pick','filter','merge','where','includeAll','include','rows','catch','params','keys','options','AnalyticTreeReport','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','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','count','set'];(function(_0x43f2ca,_0x1748a4){var _0x476cc4=function(_0x178030){while(--_0x178030){_0x43f2ca['push'](_0x43f2ca['shift']());}};_0x476cc4(++_0x1748a4);}(_0x8f5e,0x6c));var _0xe8f5=function(_0x5c133b,_0x528a6e){_0x5c133b=_0x5c133b-0x0;var _0x55b351=_0x8f5e[_0x5c133b];return _0x55b351;};'use strict';var emlformat=require(_0xe8f5('0x0'));var rimraf=require(_0xe8f5('0x1'));var zipdir=require(_0xe8f5('0x2'));var jsonpatch=require(_0xe8f5('0x3'));var rp=require(_0xe8f5('0x4'));var moment=require(_0xe8f5('0x5'));var BPromise=require(_0xe8f5('0x6'));var Mustache=require(_0xe8f5('0x7'));var util=require('util');var path=require(_0xe8f5('0x8'));var sox=require(_0xe8f5('0x9'));var csv=require(_0xe8f5('0xa'));var ejs=require(_0xe8f5('0xb'));var fs=require('fs');var fs_extra=require(_0xe8f5('0xc'));var _=require('lodash');var squel=require(_0xe8f5('0xd'));var crypto=require(_0xe8f5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe8f5('0xf'));var toCsv=require(_0xe8f5('0xa'));var querystring=require(_0xe8f5('0x10'));var Papa=require('papaparse');var Redis=require(_0xe8f5('0x11'));var authService=require(_0xe8f5('0x12'));var qs=require(_0xe8f5('0x13'));var as=require(_0xe8f5('0x14'));var hardwareService=require(_0xe8f5('0x15'));var logger=require(_0xe8f5('0x16'))(_0xe8f5('0x17'));var utils=require(_0xe8f5('0x18'));var config=require(_0xe8f5('0x19'));var licenseUtil=require(_0xe8f5('0x1a'));var db=require(_0xe8f5('0x1b'))['db'];function respondWithStatusCode(_0x3548bf,_0x12da77){_0x12da77=_0x12da77||0xcc;return function(_0x25b6da){if(_0x25b6da){return _0x3548bf[_0xe8f5('0x1c')](_0x12da77);}return _0x3548bf[_0xe8f5('0x1d')](_0x12da77)[_0xe8f5('0x1e')]();};}function respondWithResult(_0x3e80d7,_0x2caaab){_0x2caaab=_0x2caaab||0xc8;return function(_0x3d244e){if(_0x3d244e){return _0x3e80d7['status'](_0x2caaab)[_0xe8f5('0x1f')](_0x3d244e);}};}function respondWithFilteredResult(_0x5c6f7e,_0x587f7b){return function(_0x6cf2d5){if(_0x6cf2d5){var _0x5d3129=typeof _0x587f7b[_0xe8f5('0x20')]===_0xe8f5('0x21')&&typeof _0x587f7b['limit']===_0xe8f5('0x21');var _0x53d13a=_0x6cf2d5['count'];var _0xa6000d=_0x5d3129?0x0:_0x587f7b['offset'];var _0x459ef3=_0x5d3129?_0x6cf2d5[_0xe8f5('0x22')]:_0x587f7b['offset']+_0x587f7b['limit'];var _0x2c9c91;if(_0x459ef3>=_0x53d13a){_0x459ef3=_0x53d13a;_0x2c9c91=0xc8;}else{_0x2c9c91=0xce;}_0x5c6f7e['status'](_0x2c9c91);return _0x5c6f7e[_0xe8f5('0x23')](_0xe8f5('0x24'),_0xa6000d+'-'+_0x459ef3+'/'+_0x53d13a)['json'](_0x6cf2d5);}return null;};}function patchUpdates(_0x1c9916){return function(_0xbc11d4){try{jsonpatch['apply'](_0xbc11d4,_0x1c9916,!![]);}catch(_0x541fd9){return BPromise['reject'](_0x541fd9);}return _0xbc11d4[_0xe8f5('0x25')]();};}function saveUpdates(_0xee3c9c,_0x3b8ab1){return function(_0x27ee2a){if(_0x27ee2a){return _0x27ee2a[_0xe8f5('0x26')](_0xee3c9c)[_0xe8f5('0x27')](function(_0x3623b8){return _0x3623b8;});}return null;};}function removeEntity(_0x49c9c4,_0xdf8ef9){return function(_0x2966be){if(_0x2966be){return _0x2966be[_0xe8f5('0x28')]()[_0xe8f5('0x27')](function(){_0x49c9c4[_0xe8f5('0x1d')](0xcc)[_0xe8f5('0x1e')]();});}};}function handleEntityNotFound(_0x106fe8,_0xebd76d){return function(_0x4855b3){if(!_0x4855b3){_0x106fe8[_0xe8f5('0x1c')](0x194);}return _0x4855b3;};}function handleError(_0x4ac49d,_0x5682a5){_0x5682a5=_0x5682a5||0x1f4;return function(_0x3ed3b4){logger['error'](_0x3ed3b4['stack']);if(_0x3ed3b4[_0xe8f5('0x29')]){delete _0x3ed3b4['name'];}_0x4ac49d[_0xe8f5('0x1d')](_0x5682a5)['send'](_0x3ed3b4);};}exports[_0xe8f5('0x2a')]=function(_0x4ba8bb,_0x3a5ba3){var _0x2d4ad4={},_0x583d6c={},_0x5388a8={'count':0x0,'rows':[]};var _0x438953=_['map'](db['AnalyticTreeReport'][_0xe8f5('0x2b')],function(_0x350d71){return{'name':_0x350d71[_0xe8f5('0x2c')],'type':_0x350d71[_0xe8f5('0x2d')][_0xe8f5('0x2e')]};});_0x583d6c[_0xe8f5('0x2f')]=_['map'](_0x438953,'name');_0x583d6c[_0xe8f5('0x30')]=_['keys'](_0x4ba8bb[_0xe8f5('0x30')]);_0x583d6c[_0xe8f5('0x31')]=_[_0xe8f5('0x32')](_0x583d6c[_0xe8f5('0x2f')],_0x583d6c[_0xe8f5('0x30')]);_0x2d4ad4[_0xe8f5('0x33')]=_[_0xe8f5('0x32')](_0x583d6c[_0xe8f5('0x2f')],qs[_0xe8f5('0x34')](_0x4ba8bb['query'][_0xe8f5('0x34')]));_0x2d4ad4[_0xe8f5('0x33')]=_0x2d4ad4['attributes'][_0xe8f5('0x35')]?_0x2d4ad4[_0xe8f5('0x33')]:_0x583d6c[_0xe8f5('0x2f')];if(!_0x4ba8bb[_0xe8f5('0x30')]['hasOwnProperty'](_0xe8f5('0x36'))){_0x2d4ad4[_0xe8f5('0x37')]=qs[_0xe8f5('0x37')](_0x4ba8bb[_0xe8f5('0x30')][_0xe8f5('0x37')]);_0x2d4ad4[_0xe8f5('0x20')]=qs[_0xe8f5('0x20')](_0x4ba8bb['query'][_0xe8f5('0x20')]);}_0x2d4ad4['order']=qs['sort'](_0x4ba8bb['query'][_0xe8f5('0x38')]);_0x2d4ad4['where']=qs[_0xe8f5('0x31')](_[_0xe8f5('0x39')](_0x4ba8bb[_0xe8f5('0x30')],_0x583d6c[_0xe8f5('0x31')]),_0x438953);if(_0x4ba8bb[_0xe8f5('0x30')][_0xe8f5('0x3a')]){_0x2d4ad4['where']=_[_0xe8f5('0x3b')](_0x2d4ad4[_0xe8f5('0x3c')],{'$or':_['map'](_0x438953,function(_0x1e3ee6){if(_0x1e3ee6[_0xe8f5('0x2d')]!=='VIRTUAL'){var _0x2af5aa={};_0x2af5aa[_0x1e3ee6[_0xe8f5('0x29')]]={'$like':'%'+_0x4ba8bb[_0xe8f5('0x30')][_0xe8f5('0x3a')]+'%'};return _0x2af5aa;}})});}_0x2d4ad4=_[_0xe8f5('0x3b')]({},_0x2d4ad4,_0x4ba8bb['options']);var _0x52e241={'where':_0x2d4ad4[_0xe8f5('0x3c')]};return db['AnalyticTreeReport'][_0xe8f5('0x22')](_0x52e241)[_0xe8f5('0x27')](function(_0x40a983){_0x5388a8[_0xe8f5('0x22')]=_0x40a983;if(_0x4ba8bb[_0xe8f5('0x30')][_0xe8f5('0x3d')]){_0x2d4ad4[_0xe8f5('0x3e')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x2d4ad4);})[_0xe8f5('0x27')](function(_0x1e39d0){_0x5388a8[_0xe8f5('0x3f')]=_0x1e39d0;return _0x5388a8;})[_0xe8f5('0x27')](respondWithFilteredResult(_0x3a5ba3,_0x2d4ad4))[_0xe8f5('0x40')](handleError(_0x3a5ba3,null));};exports['show']=function(_0x3e309b,_0x4bddf4){var _0x4d3a12={'raw':!![],'where':{'id':_0x3e309b[_0xe8f5('0x41')]['id']}},_0x2f6790={};_0x2f6790[_0xe8f5('0x2f')]=_[_0xe8f5('0x42')](db['AnalyticTreeReport'][_0xe8f5('0x2b')]);_0x2f6790[_0xe8f5('0x30')]=_[_0xe8f5('0x42')](_0x3e309b[_0xe8f5('0x30')]);_0x2f6790[_0xe8f5('0x31')]=_[_0xe8f5('0x32')](_0x2f6790[_0xe8f5('0x2f')],_0x2f6790[_0xe8f5('0x30')]);_0x4d3a12[_0xe8f5('0x33')]=_[_0xe8f5('0x32')](_0x2f6790[_0xe8f5('0x2f')],qs[_0xe8f5('0x34')](_0x3e309b[_0xe8f5('0x30')][_0xe8f5('0x34')]));_0x4d3a12[_0xe8f5('0x33')]=_0x4d3a12['attributes']['length']?_0x4d3a12[_0xe8f5('0x33')]:_0x2f6790[_0xe8f5('0x2f')];if(_0x3e309b[_0xe8f5('0x30')][_0xe8f5('0x3d')]){_0x4d3a12['include']=[{'all':!![]}];}_0x4d3a12=_['merge']({},_0x4d3a12,_0x3e309b[_0xe8f5('0x43')]);return db[_0xe8f5('0x44')][_0xe8f5('0x45')](_0x4d3a12)[_0xe8f5('0x27')](handleEntityNotFound(_0x4bddf4,null))[_0xe8f5('0x27')](respondWithResult(_0x4bddf4,null))[_0xe8f5('0x40')](handleError(_0x4bddf4,null));};exports['create']=function(_0x1cf3d2,_0x32fb50){return db['AnalyticTreeReport'][_0xe8f5('0x46')](_0x1cf3d2[_0xe8f5('0x47')],{})[_0xe8f5('0x27')](respondWithResult(_0x32fb50,0xc9))['catch'](handleError(_0x32fb50,null));};exports[_0xe8f5('0x26')]=function(_0x62d4c,_0x52f594){if(_0x62d4c[_0xe8f5('0x47')]['id']){delete _0x62d4c['body']['id'];}return db['AnalyticTreeReport'][_0xe8f5('0x45')]({'where':{'id':_0x62d4c[_0xe8f5('0x41')]['id']}})['then'](handleEntityNotFound(_0x52f594,null))[_0xe8f5('0x27')](saveUpdates(_0x62d4c[_0xe8f5('0x47')],null))['then'](respondWithResult(_0x52f594,null))[_0xe8f5('0x40')](handleError(_0x52f594,null));};exports[_0xe8f5('0x28')]=function(_0x1ce7df,_0x5dbfbe){return db[_0xe8f5('0x44')][_0xe8f5('0x45')]({'where':{'id':_0x1ce7df[_0xe8f5('0x41')]['id']}})[_0xe8f5('0x27')](handleEntityNotFound(_0x5dbfbe,null))[_0xe8f5('0x27')](removeEntity(_0x5dbfbe,null))[_0xe8f5('0x40')](handleError(_0x5dbfbe,null));};
\ No newline at end of file
+var _0x1810=['end','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','apply','reject','save','then','destroy'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1810,0xfb));var _0x0181=function(_0x3dcc78,_0x5a3972){_0x3dcc78=_0x3dcc78-0x0;var _0x4c173c=_0x1810[_0x3dcc78];return _0x4c173c;};'use strict';var emlformat=require(_0x0181('0x0'));var rimraf=require(_0x0181('0x1'));var zipdir=require(_0x0181('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0181('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0181('0x4'));var util=require('util');var path=require(_0x0181('0x5'));var sox=require(_0x0181('0x6'));var csv=require(_0x0181('0x7'));var ejs=require(_0x0181('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0181('0x9'));var squel=require(_0x0181('0xa'));var crypto=require(_0x0181('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0181('0xc'));var toCsv=require(_0x0181('0x7'));var querystring=require('querystring');var Papa=require(_0x0181('0xd'));var Redis=require(_0x0181('0xe'));var authService=require(_0x0181('0xf'));var qs=require(_0x0181('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0181('0x11'));var logger=require(_0x0181('0x12'))(_0x0181('0x13'));var utils=require('../../config/utils');var config=require(_0x0181('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0181('0x15'))['db'];function respondWithStatusCode(_0x42a6d1,_0x46b7f7){_0x46b7f7=_0x46b7f7||0xcc;return function(_0x1680e2){if(_0x1680e2){return _0x42a6d1['sendStatus'](_0x46b7f7);}return _0x42a6d1['status'](_0x46b7f7)['end']();};}function respondWithResult(_0x2ac234,_0x549576){_0x549576=_0x549576||0xc8;return function(_0x440585){if(_0x440585){return _0x2ac234[_0x0181('0x16')](_0x549576)[_0x0181('0x17')](_0x440585);}};}function respondWithFilteredResult(_0x10e09d,_0x2f4d4f){return function(_0x463880){if(_0x463880){var _0x29e814=typeof _0x2f4d4f[_0x0181('0x18')]==='undefined'&&typeof _0x2f4d4f[_0x0181('0x19')]===_0x0181('0x1a');var _0x8816fb=_0x463880[_0x0181('0x1b')];var _0x31ea1a=_0x29e814?0x0:_0x2f4d4f['offset'];var _0xda7486=_0x29e814?_0x463880['count']:_0x2f4d4f[_0x0181('0x18')]+_0x2f4d4f[_0x0181('0x19')];var _0x17f8bb;if(_0xda7486>=_0x8816fb){_0xda7486=_0x8816fb;_0x17f8bb=0xc8;}else{_0x17f8bb=0xce;}_0x10e09d[_0x0181('0x16')](_0x17f8bb);return _0x10e09d['set']('Content-Range',_0x31ea1a+'-'+_0xda7486+'/'+_0x8816fb)[_0x0181('0x17')](_0x463880);}return null;};}function patchUpdates(_0x2d00ff){return function(_0x38d707){try{jsonpatch[_0x0181('0x1c')](_0x38d707,_0x2d00ff,!![]);}catch(_0x21dc34){return BPromise[_0x0181('0x1d')](_0x21dc34);}return _0x38d707[_0x0181('0x1e')]();};}function saveUpdates(_0x325ce0,_0x324621){return function(_0x1c2870){if(_0x1c2870){return _0x1c2870['update'](_0x325ce0)[_0x0181('0x1f')](function(_0x1b1011){return _0x1b1011;});}return null;};}function removeEntity(_0x8ae0d7,_0x315332){return function(_0x275f2a){if(_0x275f2a){return _0x275f2a[_0x0181('0x20')]()[_0x0181('0x1f')](function(){_0x8ae0d7[_0x0181('0x16')](0xcc)[_0x0181('0x21')]();});}};}function handleEntityNotFound(_0x24ecb3,_0x15769b){return function(_0x1f8437){if(!_0x1f8437){_0x24ecb3['sendStatus'](0x194);}return _0x1f8437;};}function handleError(_0x58aa11,_0x373cd6){_0x373cd6=_0x373cd6||0x1f4;return function(_0x341eb1){logger[_0x0181('0x22')](_0x341eb1['stack']);if(_0x341eb1[_0x0181('0x23')]){delete _0x341eb1[_0x0181('0x23')];}_0x58aa11[_0x0181('0x16')](_0x373cd6)[_0x0181('0x24')](_0x341eb1);};}exports[_0x0181('0x25')]=function(_0x25e0a3,_0x1f1646){var _0x1a4c40={},_0x5c7ce7={},_0x129fc6={'count':0x0,'rows':[]};var _0x59d060=_[_0x0181('0x26')](db[_0x0181('0x27')][_0x0181('0x28')],function(_0x15c817){return{'name':_0x15c817[_0x0181('0x29')],'type':_0x15c817['type'][_0x0181('0x2a')]};});_0x5c7ce7[_0x0181('0x2b')]=_[_0x0181('0x26')](_0x59d060,_0x0181('0x23'));_0x5c7ce7[_0x0181('0x2c')]=_[_0x0181('0x2d')](_0x25e0a3[_0x0181('0x2c')]);_0x5c7ce7[_0x0181('0x2e')]=_['intersection'](_0x5c7ce7['model'],_0x5c7ce7['query']);_0x1a4c40['attributes']=_[_0x0181('0x2f')](_0x5c7ce7[_0x0181('0x2b')],qs['fields'](_0x25e0a3[_0x0181('0x2c')][_0x0181('0x30')]));_0x1a4c40[_0x0181('0x31')]=_0x1a4c40['attributes'][_0x0181('0x32')]?_0x1a4c40[_0x0181('0x31')]:_0x5c7ce7['model'];if(!_0x25e0a3[_0x0181('0x2c')][_0x0181('0x33')](_0x0181('0x34'))){_0x1a4c40[_0x0181('0x19')]=qs['limit'](_0x25e0a3[_0x0181('0x2c')][_0x0181('0x19')]);_0x1a4c40[_0x0181('0x18')]=qs[_0x0181('0x18')](_0x25e0a3[_0x0181('0x2c')][_0x0181('0x18')]);}_0x1a4c40['order']=qs[_0x0181('0x35')](_0x25e0a3[_0x0181('0x2c')][_0x0181('0x35')]);_0x1a4c40[_0x0181('0x36')]=qs[_0x0181('0x2e')](_[_0x0181('0x37')](_0x25e0a3[_0x0181('0x2c')],_0x5c7ce7[_0x0181('0x2e')]),_0x59d060);if(_0x25e0a3[_0x0181('0x2c')][_0x0181('0x38')]){_0x1a4c40[_0x0181('0x36')]=_[_0x0181('0x39')](_0x1a4c40['where'],{'$or':_[_0x0181('0x26')](_0x59d060,function(_0x39fffa){if(_0x39fffa[_0x0181('0x3a')]!==_0x0181('0x3b')){var _0x477d5c={};_0x477d5c[_0x39fffa[_0x0181('0x23')]]={'$like':'%'+_0x25e0a3[_0x0181('0x2c')][_0x0181('0x38')]+'%'};return _0x477d5c;}})});}_0x1a4c40=_['merge']({},_0x1a4c40,_0x25e0a3[_0x0181('0x3c')]);var _0x1eb673={'where':_0x1a4c40[_0x0181('0x36')]};return db[_0x0181('0x27')][_0x0181('0x1b')](_0x1eb673)[_0x0181('0x1f')](function(_0x464236){_0x129fc6[_0x0181('0x1b')]=_0x464236;if(_0x25e0a3['query']['includeAll']){_0x1a4c40[_0x0181('0x3d')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0181('0x3e')](_0x1a4c40);})['then'](function(_0x21f40d){_0x129fc6[_0x0181('0x3f')]=_0x21f40d;return _0x129fc6;})[_0x0181('0x1f')](respondWithFilteredResult(_0x1f1646,_0x1a4c40))[_0x0181('0x40')](handleError(_0x1f1646,null));};exports[_0x0181('0x41')]=function(_0x44701d,_0x3dd461){var _0x5562c3={'raw':!![],'where':{'id':_0x44701d[_0x0181('0x42')]['id']}},_0xe17e={};_0xe17e[_0x0181('0x2b')]=_['keys'](db[_0x0181('0x27')][_0x0181('0x28')]);_0xe17e[_0x0181('0x2c')]=_[_0x0181('0x2d')](_0x44701d[_0x0181('0x2c')]);_0xe17e[_0x0181('0x2e')]=_[_0x0181('0x2f')](_0xe17e[_0x0181('0x2b')],_0xe17e[_0x0181('0x2c')]);_0x5562c3[_0x0181('0x31')]=_['intersection'](_0xe17e[_0x0181('0x2b')],qs['fields'](_0x44701d[_0x0181('0x2c')][_0x0181('0x30')]));_0x5562c3[_0x0181('0x31')]=_0x5562c3['attributes'][_0x0181('0x32')]?_0x5562c3[_0x0181('0x31')]:_0xe17e['model'];if(_0x44701d[_0x0181('0x2c')][_0x0181('0x43')]){_0x5562c3['include']=[{'all':!![]}];}_0x5562c3=_[_0x0181('0x39')]({},_0x5562c3,_0x44701d[_0x0181('0x3c')]);return db[_0x0181('0x27')][_0x0181('0x44')](_0x5562c3)[_0x0181('0x1f')](handleEntityNotFound(_0x3dd461,null))['then'](respondWithResult(_0x3dd461,null))[_0x0181('0x40')](handleError(_0x3dd461,null));};exports['create']=function(_0xe3b47f,_0x5702ce){return db[_0x0181('0x27')][_0x0181('0x45')](_0xe3b47f[_0x0181('0x46')],{})[_0x0181('0x1f')](respondWithResult(_0x5702ce,0xc9))[_0x0181('0x40')](handleError(_0x5702ce,null));};exports['update']=function(_0x235f7d,_0x16d083){if(_0x235f7d[_0x0181('0x46')]['id']){delete _0x235f7d[_0x0181('0x46')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x235f7d['params']['id']}})[_0x0181('0x1f')](handleEntityNotFound(_0x16d083,null))['then'](saveUpdates(_0x235f7d[_0x0181('0x46')],null))['then'](respondWithResult(_0x16d083,null))[_0x0181('0x40')](handleError(_0x16d083,null));};exports[_0x0181('0x20')]=function(_0x4e35f4,_0x32340e){return db[_0x0181('0x27')][_0x0181('0x44')]({'where':{'id':_0x4e35f4['params']['id']}})['then'](handleEntityNotFound(_0x32340e,null))[_0x0181('0x1f')](removeEntity(_0x32340e,null))[_0x0181('0x40')](handleError(_0x32340e,null));};
\ No newline at end of file
index 21eee7d..497c779 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c9c=['AnalyticTreeReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x19a615,_0xd4d958){var _0x212cc9=function(_0x3bbf87){while(--_0x3bbf87){_0x19a615['push'](_0x19a615['shift']());}};_0x212cc9(++_0xd4d958);}(_0x1c9c,0x12a));var _0xc1c9=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0x1c9c[_0x24fa1a];return _0xc5621f;};'use strict';var _=require(_0xc1c9('0x0'));var util=require(_0xc1c9('0x1'));var logger=require(_0xc1c9('0x2'))(_0xc1c9('0x3'));var moment=require(_0xc1c9('0x4'));var BPromise=require(_0xc1c9('0x5'));var rp=require(_0xc1c9('0x6'));var fs=require('fs');var path=require(_0xc1c9('0x7'));var rimraf=require(_0xc1c9('0x8'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xc1c9('0x9')]=function(_0x1f5a6c,_0x291616){return _0x1f5a6c['define'](_0xc1c9('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf0b5=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x42b218,_0x171e22){var _0x49db9e=function(_0x594df){while(--_0x594df){_0x42b218['push'](_0x42b218['shift']());}};_0x49db9e(++_0x171e22);}(_0xf0b5,0x116));var _0x5f0b=function(_0xe2dc9e,_0xeb3bc6){_0xe2dc9e=_0xe2dc9e-0x0;var _0x279417=_0xf0b5[_0xe2dc9e];return _0x279417;};'use strict';var _=require(_0x5f0b('0x0'));var util=require(_0x5f0b('0x1'));var logger=require(_0x5f0b('0x2'))(_0x5f0b('0x3'));var moment=require('moment');var BPromise=require(_0x5f0b('0x4'));var rp=require(_0x5f0b('0x5'));var fs=require('fs');var path=require(_0x5f0b('0x6'));var rimraf=require(_0x5f0b('0x7'));var config=require(_0x5f0b('0x8'));var attributes=require(_0x5f0b('0x9'));module[_0x5f0b('0xa')]=function(_0x55b22a,_0x4d5a96){return _0x55b22a[_0x5f0b('0xb')](_0x5f0b('0xc'),attributes,{'tableName':_0x5f0b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c4b5fa2..20fd122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3104f5,_0x5d84b2){var _0x49cf84=function(_0x143845){while(--_0x143845){_0x3104f5['push'](_0x3104f5['shift']());}};_0x49cf84(++_0x5d84b2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1c7f83,_0x535b10){var _0x4facee=function(_0x4c2a8e){while(--_0x4c2a8e){_0x1c7f83['push'](_0x1c7f83['shift']());}};_0x4facee(++_0x535b10);}(_0xdb28,0x106));var _0x8db2=function(_0x1d5c16,_0x520ce6){_0x1d5c16=_0x1d5c16-0x0;var _0x1c7f4b=_0xdb28[_0x1d5c16];return _0x1c7f4b;};'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')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index 1b0d969..e78fa42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39a3=['create','put','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post'];(function(_0x1f252a,_0x14c5a1){var _0x19b0ed=function(_0x198ead){while(--_0x198ead){_0x1f252a['push'](_0x1f252a['shift']());}};_0x19b0ed(++_0x14c5a1);}(_0x39a3,0x16c));var _0x339a=function(_0x1c6b61,_0x5d0fe0){_0x1c6b61=_0x1c6b61-0x0;var _0xb6c7e2=_0x39a3[_0x1c6b61];return _0xb6c7e2;};'use strict';var multer=require(_0x339a('0x0'));var util=require(_0x339a('0x1'));var path=require(_0x339a('0x2'));var timeout=require('connect-timeout');var express=require(_0x339a('0x3'));var router=express[_0x339a('0x4')]();var fs_extra=require(_0x339a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x339a('0x6'));var config=require(_0x339a('0x7'));var controller=require(_0x339a('0x8'));router[_0x339a('0x9')]('/',auth[_0x339a('0xa')](),controller[_0x339a('0xb')]);router['get'](_0x339a('0xc'),auth[_0x339a('0xa')](),controller['show']);router[_0x339a('0xd')]('/',auth[_0x339a('0xa')](),controller[_0x339a('0xe')]);router[_0x339a('0xf')](_0x339a('0xc'),auth[_0x339a('0xa')](),controller[_0x339a('0x10')]);router[_0x339a('0x11')]('/:id',auth[_0x339a('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc875=['Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','show','post','update','delete','multer','util','path','connect-timeout','express'];(function(_0x4d1e52,_0x12d194){var _0x4a5112=function(_0xfeea9f){while(--_0xfeea9f){_0x4d1e52['push'](_0x4d1e52['shift']());}};_0x4a5112(++_0x12d194);}(_0xc875,0x12d));var _0x5c87=function(_0x53690e,_0x3effcf){_0x53690e=_0x53690e-0x0;var _0x2248b9=_0xc875[_0x53690e];return _0x2248b9;};'use strict';var multer=require(_0x5c87('0x0'));var util=require(_0x5c87('0x1'));var path=require(_0x5c87('0x2'));var timeout=require(_0x5c87('0x3'));var express=require(_0x5c87('0x4'));var router=express[_0x5c87('0x5')]();var fs_extra=require(_0x5c87('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5c87('0x7'));var config=require('../../config/environment');var controller=require(_0x5c87('0x8'));router['get']('/',auth[_0x5c87('0x9')](),controller[_0x5c87('0xa')]);router[_0x5c87('0xb')](_0x5c87('0xc'),auth[_0x5c87('0x9')](),controller[_0x5c87('0xd')]);router[_0x5c87('0xe')]('/',auth[_0x5c87('0x9')](),controller['create']);router['put'](_0x5c87('0xc'),auth[_0x5c87('0x9')](),controller[_0x5c87('0xf')]);router[_0x5c87('0x10')](_0x5c87('0xc'),auth[_0x5c87('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 209503b..99026e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaba6=['sequelize','exports'];(function(_0x1e8bcb,_0x474a81){var _0x212080=function(_0x57a1f5){while(--_0x57a1f5){_0x1e8bcb['push'](_0x1e8bcb['shift']());}};_0x212080(++_0x474a81);}(_0xaba6,0xe2));var _0x6aba=function(_0x423c77,_0x468893){_0x423c77=_0x423c77-0x0;var _0x709302=_0xaba6[_0x423c77];return _0x709302;};'use strict';var Sequelize=require(_0x6aba('0x0'));module[_0x6aba('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xcf1c=['STRING','sequelize','exports'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xcf1c,0x18d));var _0xccf1=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0xcf1c[_0x400322];return _0xfdd597;};'use strict';var Sequelize=require(_0xccf1('0x0'));module[_0xccf1('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xccf1('0x2')]},'type':{'type':Sequelize[_0xccf1('0x2')]}};
\ No newline at end of file
index 6cffc3e..67eb4fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fcf=['rimraf','request-promise','moment','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/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','destroy','stack','name','send','Attachment','rawAttributes','type','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','then','include','findAll','catch','show','params','includeAll','options','find','clone','get','createdAt','updatedAt','body','update','create','file','originalname','basename','filename','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x5fcf,0x1c1));var _0xf5fc=function(_0x261e5a,_0x190061){_0x261e5a=_0x261e5a-0x0;var _0x344cd3=_0x5fcf[_0x261e5a];return _0x344cd3;};'use strict';var emlformat=require(_0xf5fc('0x0'));var rimraf=require(_0xf5fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf5fc('0x2'));var moment=require(_0xf5fc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf5fc('0x4'));var util=require(_0xf5fc('0x5'));var path=require(_0xf5fc('0x6'));var sox=require(_0xf5fc('0x7'));var csv=require(_0xf5fc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5fc('0x9'));var _=require(_0xf5fc('0xa'));var squel=require(_0xf5fc('0xb'));var crypto=require(_0xf5fc('0xc'));var jsforce=require(_0xf5fc('0xd'));var deskjs=require(_0xf5fc('0xe'));var toCsv=require(_0xf5fc('0x8'));var querystring=require(_0xf5fc('0xf'));var Papa=require(_0xf5fc('0x10'));var Redis=require(_0xf5fc('0x11'));var authService=require(_0xf5fc('0x12'));var qs=require(_0xf5fc('0x13'));var as=require(_0xf5fc('0x14'));var hardwareService=require(_0xf5fc('0x15'));var logger=require('../../config/logger')(_0xf5fc('0x16'));var utils=require(_0xf5fc('0x17'));var config=require(_0xf5fc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5fc('0x19'))['db'];function respondWithStatusCode(_0x36da35,_0x41085d){_0x41085d=_0x41085d||0xcc;return function(_0x1a14b1){if(_0x1a14b1){return _0x36da35[_0xf5fc('0x1a')](_0x41085d);}return _0x36da35[_0xf5fc('0x1b')](_0x41085d)['end']();};}function respondWithResult(_0x5e5b5a,_0x3e372a){_0x3e372a=_0x3e372a||0xc8;return function(_0x43a7d8){if(_0x43a7d8){return _0x5e5b5a[_0xf5fc('0x1b')](_0x3e372a)[_0xf5fc('0x1c')](_0x43a7d8);}};}function respondWithFilteredResult(_0x31ef1a,_0x593eb7){return function(_0x782067){if(_0x782067){var _0x1e9398=typeof _0x593eb7['offset']===_0xf5fc('0x1d')&&typeof _0x593eb7[_0xf5fc('0x1e')]===_0xf5fc('0x1d');var _0x26612a=_0x782067[_0xf5fc('0x1f')];var _0x2ea688=_0x1e9398?0x0:_0x593eb7[_0xf5fc('0x20')];var _0x133676=_0x1e9398?_0x782067[_0xf5fc('0x1f')]:_0x593eb7['offset']+_0x593eb7[_0xf5fc('0x1e')];var _0x300b27;if(_0x133676>=_0x26612a){_0x133676=_0x26612a;_0x300b27=0xc8;}else{_0x300b27=0xce;}_0x31ef1a[_0xf5fc('0x1b')](_0x300b27);return _0x31ef1a[_0xf5fc('0x21')](_0xf5fc('0x22'),_0x2ea688+'-'+_0x133676+'/'+_0x26612a)[_0xf5fc('0x1c')](_0x782067);}return null;};}function patchUpdates(_0x9456b6){return function(_0x52ab9){try{jsonpatch['apply'](_0x52ab9,_0x9456b6,!![]);}catch(_0x507b47){return BPromise[_0xf5fc('0x23')](_0x507b47);}return _0x52ab9[_0xf5fc('0x24')]();};}function saveUpdates(_0x3e4101,_0x2408a6){return function(_0x37bde5){if(_0x37bde5){return _0x37bde5['update'](_0x3e4101)['then'](function(_0x182f2e){return _0x182f2e;});}return null;};}function removeEntity(_0x28a3e0,_0x1fb3f){return function(_0x28a9e4){if(_0x28a9e4){return _0x28a9e4[_0xf5fc('0x25')]()['then'](function(){_0x28a3e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ff2c3,_0x444b02){return function(_0x27db54){if(!_0x27db54){_0x3ff2c3[_0xf5fc('0x1a')](0x194);}return _0x27db54;};}function handleError(_0x4646ec,_0x4dd5f8){_0x4dd5f8=_0x4dd5f8||0x1f4;return function(_0x41dbe3){logger['error'](_0x41dbe3[_0xf5fc('0x26')]);if(_0x41dbe3[_0xf5fc('0x27')]){delete _0x41dbe3['name'];}_0x4646ec['status'](_0x4dd5f8)[_0xf5fc('0x28')](_0x41dbe3);};}exports['index']=function(_0x4ab19b,_0x4eee7d){var _0x2b5253={},_0x2e7d48={},_0x5ac0d3={'count':0x0,'rows':[]};var _0x11c4f7=_['map'](db[_0xf5fc('0x29')][_0xf5fc('0x2a')],function(_0x294af3){return{'name':_0x294af3['fieldName'],'type':_0x294af3[_0xf5fc('0x2b')][_0xf5fc('0x2c')]};});_0x2e7d48['model']=_['map'](_0x11c4f7,_0xf5fc('0x27'));_0x2e7d48['query']=_[_0xf5fc('0x2d')](_0x4ab19b[_0xf5fc('0x2e')]);_0x2e7d48[_0xf5fc('0x2f')]=_[_0xf5fc('0x30')](_0x2e7d48['model'],_0x2e7d48[_0xf5fc('0x2e')]);_0x2b5253[_0xf5fc('0x31')]=_['intersection'](_0x2e7d48[_0xf5fc('0x32')],qs[_0xf5fc('0x33')](_0x4ab19b[_0xf5fc('0x2e')][_0xf5fc('0x33')]));_0x2b5253[_0xf5fc('0x31')]=_0x2b5253[_0xf5fc('0x31')][_0xf5fc('0x34')]?_0x2b5253[_0xf5fc('0x31')]:_0x2e7d48[_0xf5fc('0x32')];if(!_0x4ab19b[_0xf5fc('0x2e')]['hasOwnProperty'](_0xf5fc('0x35'))){_0x2b5253['limit']=qs[_0xf5fc('0x1e')](_0x4ab19b[_0xf5fc('0x2e')][_0xf5fc('0x1e')]);_0x2b5253['offset']=qs[_0xf5fc('0x20')](_0x4ab19b['query'][_0xf5fc('0x20')]);}_0x2b5253[_0xf5fc('0x36')]=qs[_0xf5fc('0x37')](_0x4ab19b[_0xf5fc('0x2e')][_0xf5fc('0x37')]);_0x2b5253[_0xf5fc('0x38')]=qs[_0xf5fc('0x2f')](_[_0xf5fc('0x39')](_0x4ab19b[_0xf5fc('0x2e')],_0x2e7d48[_0xf5fc('0x2f')]),_0x11c4f7);if(_0x4ab19b[_0xf5fc('0x2e')][_0xf5fc('0x3a')]){_0x2b5253[_0xf5fc('0x38')]=_[_0xf5fc('0x3b')](_0x2b5253[_0xf5fc('0x38')],{'$or':_[_0xf5fc('0x3c')](_0x11c4f7,function(_0x409057){if(_0x409057['type']!==_0xf5fc('0x3d')){var _0xaa15e9={};_0xaa15e9[_0x409057[_0xf5fc('0x27')]]={'$like':'%'+_0x4ab19b['query'][_0xf5fc('0x3a')]+'%'};return _0xaa15e9;}})});}_0x2b5253=_[_0xf5fc('0x3b')]({},_0x2b5253,_0x4ab19b['options']);var _0x296066={'where':_0x2b5253[_0xf5fc('0x38')]};return db[_0xf5fc('0x29')]['count'](_0x296066)[_0xf5fc('0x3e')](function(_0x5ad361){_0x5ac0d3[_0xf5fc('0x1f')]=_0x5ad361;if(_0x4ab19b[_0xf5fc('0x2e')]['includeAll']){_0x2b5253[_0xf5fc('0x3f')]=[{'all':!![]}];}return db[_0xf5fc('0x29')][_0xf5fc('0x40')](_0x2b5253);})[_0xf5fc('0x3e')](function(_0x291ccd){_0x5ac0d3['rows']=_0x291ccd;return _0x5ac0d3;})[_0xf5fc('0x3e')](respondWithFilteredResult(_0x4eee7d,_0x2b5253))[_0xf5fc('0x41')](handleError(_0x4eee7d,null));};exports[_0xf5fc('0x42')]=function(_0x52a03f,_0x338d64){var _0x3e0fe7={'raw':!![],'where':{'id':_0x52a03f[_0xf5fc('0x43')]['id']}},_0x997bf4={};_0x997bf4['model']=_[_0xf5fc('0x2d')](db[_0xf5fc('0x29')][_0xf5fc('0x2a')]);_0x997bf4[_0xf5fc('0x2e')]=_[_0xf5fc('0x2d')](_0x52a03f[_0xf5fc('0x2e')]);_0x997bf4[_0xf5fc('0x2f')]=_[_0xf5fc('0x30')](_0x997bf4[_0xf5fc('0x32')],_0x997bf4[_0xf5fc('0x2e')]);_0x3e0fe7[_0xf5fc('0x31')]=_['intersection'](_0x997bf4['model'],qs[_0xf5fc('0x33')](_0x52a03f[_0xf5fc('0x2e')][_0xf5fc('0x33')]));_0x3e0fe7['attributes']=_0x3e0fe7[_0xf5fc('0x31')][_0xf5fc('0x34')]?_0x3e0fe7['attributes']:_0x997bf4[_0xf5fc('0x32')];if(_0x52a03f[_0xf5fc('0x2e')][_0xf5fc('0x44')]){_0x3e0fe7['include']=[{'all':!![]}];}_0x3e0fe7=_[_0xf5fc('0x3b')]({},_0x3e0fe7,_0x52a03f[_0xf5fc('0x45')]);return db[_0xf5fc('0x29')][_0xf5fc('0x46')](_0x3e0fe7)['then'](handleEntityNotFound(_0x338d64,null))['then'](respondWithResult(_0x338d64,null))['catch'](handleError(_0x338d64,null));};exports[_0xf5fc('0x47')]=function(_0x449ed2,_0x10532f){var _0x569512={'where':{'id':_0x449ed2[_0xf5fc('0x43')]['id']}},_0x2d9fcb={};_0x2d9fcb[_0xf5fc('0x32')]=_[_0xf5fc('0x2d')](db[_0xf5fc('0x29')]['rawAttributes']);_0x569512['attributes']=_[_0xf5fc('0x30')](_0x2d9fcb['model'],qs['fields'](_0x449ed2[_0xf5fc('0x2e')][_0xf5fc('0x33')]));_0x569512['attributes']=_0x569512[_0xf5fc('0x31')][_0xf5fc('0x34')]?_0x569512['attributes']:_0x2d9fcb[_0xf5fc('0x32')];if(_0x449ed2[_0xf5fc('0x2e')]['includeAll']){_0x569512['include']=[{'all':!![]}];}_0x569512=_[_0xf5fc('0x3b')]({},_0x569512,_0x449ed2[_0xf5fc('0x45')]);return db[_0xf5fc('0x29')][_0xf5fc('0x46')](_0x569512)[_0xf5fc('0x3e')](handleEntityNotFound(_0x10532f,null))['then'](function(_0x48d869){if(_0x48d869){var _0x2df932=_0x48d869[_0xf5fc('0x48')]({'plain':!![]});_0x2df932=qs['omit'](_0x2df932,['id',_0xf5fc('0x49'),_0xf5fc('0x4a')]);_0x449ed2[_0xf5fc('0x4b')]=_['omit'](_0x449ed2[_0xf5fc('0x4b')],['id',_0xf5fc('0x49'),_0xf5fc('0x4a')]);return db[_0xf5fc('0x29')]['create'](_[_0xf5fc('0x3b')](_0x2df932,_0x449ed2[_0xf5fc('0x4b')]),{'include':_0x449ed2[_0xf5fc('0x2e')][_0xf5fc('0x44')]?[{'all':!![]}]:undefined});}})[_0xf5fc('0x3e')](respondWithResult(_0x10532f,0xc9))['catch'](handleError(_0x10532f,null));};exports[_0xf5fc('0x4c')]=function(_0x562d06,_0xdacc95){if(_0x562d06[_0xf5fc('0x4b')]['id']){delete _0x562d06['body']['id'];}return db['Attachment'][_0xf5fc('0x46')]({'where':{'id':_0x562d06[_0xf5fc('0x43')]['id']}})[_0xf5fc('0x3e')](handleEntityNotFound(_0xdacc95,null))[_0xf5fc('0x3e')](saveUpdates(_0x562d06['body'],null))['then'](respondWithResult(_0xdacc95,null))[_0xf5fc('0x41')](handleError(_0xdacc95,null));};exports[_0xf5fc('0x25')]=function(_0x240932,_0x143c44){return db[_0xf5fc('0x29')][_0xf5fc('0x46')]({'where':{'id':_0x240932[_0xf5fc('0x43')]['id']}})[_0xf5fc('0x3e')](handleEntityNotFound(_0x143c44,null))[_0xf5fc('0x3e')](removeEntity(_0x143c44,null))[_0xf5fc('0x41')](handleError(_0x143c44,null));};exports[_0xf5fc('0x4d')]=function(_0x3f97c9,_0x1c538d,_0x56d889){_0x3f97c9[_0xf5fc('0x4b')][_0xf5fc('0x27')]=_0x3f97c9[_0xf5fc('0x4e')][_0xf5fc('0x4f')];_0x3f97c9['body'][_0xf5fc('0x50')]=_0x3f97c9['file'][_0xf5fc('0x51')];_0x3f97c9[_0xf5fc('0x4b')]['type']=_0x3f97c9['file'][_0xf5fc('0x52')];return db[_0xf5fc('0x29')]['create'](_0x3f97c9['body'])[_0xf5fc('0x3e')](respondWithResult(_0x1c538d,0xc9))[_0xf5fc('0x41')](handleError(_0x1c538d,null));};exports['download']=function(_0x1f80fd,_0x2c2fc7,_0x8aa9a4){return db[_0xf5fc('0x29')][_0xf5fc('0x53')]({'where':{'id':_0x1f80fd['params']['id']},'raw':!![]})[_0xf5fc('0x3e')](handleEntityNotFound(_0x2c2fc7,null))[_0xf5fc('0x3e')](function(_0x26ce5c){if(_0x26ce5c){var _0x4540b4=_0x26ce5c[_0xf5fc('0x54')]!==null;var _0x79caf1=path[_0xf5fc('0x55')](config[_0xf5fc('0x56')],_0xf5fc('0x57'));if(_0x4540b4){_0x79caf1=path[_0xf5fc('0x55')](_0x79caf1,_0xf5fc('0x58'));}var _0x223df5=path[_0xf5fc('0x55')](_0x79caf1,_0x26ce5c['basename']);return _0x2c2fc7[_0xf5fc('0x59')](_0x223df5);}})[_0xf5fc('0x41')](handleError(_0x2c2fc7,null));};
\ No newline at end of file
+var _0xb448=['Attachment','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','omit','body','createdAt','updatedAt','file','originalname','basename','filename','create','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index'];(function(_0x131205,_0x57575c){var _0x305300=function(_0x179eea){while(--_0x179eea){_0x131205['push'](_0x131205['shift']());}};_0x305300(++_0x57575c);}(_0xb448,0x1df));var _0x8b44=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xb448[_0x36884e];return _0x1cc367;};'use strict';var emlformat=require(_0x8b44('0x0'));var rimraf=require(_0x8b44('0x1'));var zipdir=require(_0x8b44('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b44('0x3'));var moment=require(_0x8b44('0x4'));var BPromise=require(_0x8b44('0x5'));var Mustache=require(_0x8b44('0x6'));var util=require(_0x8b44('0x7'));var path=require(_0x8b44('0x8'));var sox=require(_0x8b44('0x9'));var csv=require(_0x8b44('0xa'));var ejs=require(_0x8b44('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8b44('0xc'));var crypto=require(_0x8b44('0xd'));var jsforce=require(_0x8b44('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b44('0xa'));var querystring=require(_0x8b44('0xf'));var Papa=require(_0x8b44('0x10'));var Redis=require(_0x8b44('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b44('0x12'));var logger=require(_0x8b44('0x13'))(_0x8b44('0x14'));var utils=require(_0x8b44('0x15'));var config=require(_0x8b44('0x16'));var licenseUtil=require(_0x8b44('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4611d9,_0x331bef){_0x331bef=_0x331bef||0xcc;return function(_0x244add){if(_0x244add){return _0x4611d9['sendStatus'](_0x331bef);}return _0x4611d9[_0x8b44('0x18')](_0x331bef)[_0x8b44('0x19')]();};}function respondWithResult(_0x3b8526,_0x2990f2){_0x2990f2=_0x2990f2||0xc8;return function(_0x1f4fe1){if(_0x1f4fe1){return _0x3b8526[_0x8b44('0x18')](_0x2990f2)[_0x8b44('0x1a')](_0x1f4fe1);}};}function respondWithFilteredResult(_0x366c46,_0x4e815d){return function(_0x410dd4){if(_0x410dd4){var _0x28e1a7=typeof _0x4e815d['offset']===_0x8b44('0x1b')&&typeof _0x4e815d[_0x8b44('0x1c')]===_0x8b44('0x1b');var _0xe98570=_0x410dd4[_0x8b44('0x1d')];var _0x3a97b8=_0x28e1a7?0x0:_0x4e815d['offset'];var _0xea366b=_0x28e1a7?_0x410dd4[_0x8b44('0x1d')]:_0x4e815d[_0x8b44('0x1e')]+_0x4e815d['limit'];var _0x55191d;if(_0xea366b>=_0xe98570){_0xea366b=_0xe98570;_0x55191d=0xc8;}else{_0x55191d=0xce;}_0x366c46[_0x8b44('0x18')](_0x55191d);return _0x366c46[_0x8b44('0x1f')](_0x8b44('0x20'),_0x3a97b8+'-'+_0xea366b+'/'+_0xe98570)[_0x8b44('0x1a')](_0x410dd4);}return null;};}function patchUpdates(_0x38dcec){return function(_0x13d07b){try{jsonpatch[_0x8b44('0x21')](_0x13d07b,_0x38dcec,!![]);}catch(_0x372f02){return BPromise[_0x8b44('0x22')](_0x372f02);}return _0x13d07b[_0x8b44('0x23')]();};}function saveUpdates(_0x2d8372,_0x3a2b04){return function(_0x4819e8){if(_0x4819e8){return _0x4819e8[_0x8b44('0x24')](_0x2d8372)[_0x8b44('0x25')](function(_0x5ea4fc){return _0x5ea4fc;});}return null;};}function removeEntity(_0x1e8f5d,_0x234083){return function(_0x2293b1){if(_0x2293b1){return _0x2293b1[_0x8b44('0x26')]()[_0x8b44('0x25')](function(){_0x1e8f5d[_0x8b44('0x18')](0xcc)[_0x8b44('0x19')]();});}};}function handleEntityNotFound(_0x218e82,_0x1fa627){return function(_0x563486){if(!_0x563486){_0x218e82[_0x8b44('0x27')](0x194);}return _0x563486;};}function handleError(_0x198c0f,_0x3d90da){_0x3d90da=_0x3d90da||0x1f4;return function(_0x15252f){logger['error'](_0x15252f[_0x8b44('0x28')]);if(_0x15252f[_0x8b44('0x29')]){delete _0x15252f['name'];}_0x198c0f[_0x8b44('0x18')](_0x3d90da)['send'](_0x15252f);};}exports[_0x8b44('0x2a')]=function(_0x5e0bc8,_0x151b64){var _0x186d11={},_0x17650c={},_0x583b90={'count':0x0,'rows':[]};var _0x4233ad=_['map'](db[_0x8b44('0x2b')][_0x8b44('0x2c')],function(_0x105a77){return{'name':_0x105a77[_0x8b44('0x2d')],'type':_0x105a77['type'][_0x8b44('0x2e')]};});_0x17650c[_0x8b44('0x2f')]=_[_0x8b44('0x30')](_0x4233ad,_0x8b44('0x29'));_0x17650c[_0x8b44('0x31')]=_[_0x8b44('0x32')](_0x5e0bc8[_0x8b44('0x31')]);_0x17650c[_0x8b44('0x33')]=_[_0x8b44('0x34')](_0x17650c['model'],_0x17650c[_0x8b44('0x31')]);_0x186d11[_0x8b44('0x35')]=_[_0x8b44('0x34')](_0x17650c['model'],qs[_0x8b44('0x36')](_0x5e0bc8[_0x8b44('0x31')][_0x8b44('0x36')]));_0x186d11[_0x8b44('0x35')]=_0x186d11['attributes'][_0x8b44('0x37')]?_0x186d11['attributes']:_0x17650c[_0x8b44('0x2f')];if(!_0x5e0bc8[_0x8b44('0x31')][_0x8b44('0x38')](_0x8b44('0x39'))){_0x186d11[_0x8b44('0x1c')]=qs[_0x8b44('0x1c')](_0x5e0bc8[_0x8b44('0x31')][_0x8b44('0x1c')]);_0x186d11[_0x8b44('0x1e')]=qs[_0x8b44('0x1e')](_0x5e0bc8[_0x8b44('0x31')][_0x8b44('0x1e')]);}_0x186d11[_0x8b44('0x3a')]=qs[_0x8b44('0x3b')](_0x5e0bc8[_0x8b44('0x31')][_0x8b44('0x3b')]);_0x186d11[_0x8b44('0x3c')]=qs[_0x8b44('0x33')](_[_0x8b44('0x3d')](_0x5e0bc8[_0x8b44('0x31')],_0x17650c[_0x8b44('0x33')]),_0x4233ad);if(_0x5e0bc8[_0x8b44('0x31')][_0x8b44('0x3e')]){_0x186d11[_0x8b44('0x3c')]=_[_0x8b44('0x3f')](_0x186d11[_0x8b44('0x3c')],{'$or':_[_0x8b44('0x30')](_0x4233ad,function(_0x31c794){if(_0x31c794['type']!=='VIRTUAL'){var _0x41bbe9={};_0x41bbe9[_0x31c794[_0x8b44('0x29')]]={'$like':'%'+_0x5e0bc8[_0x8b44('0x31')]['filter']+'%'};return _0x41bbe9;}})});}_0x186d11=_[_0x8b44('0x3f')]({},_0x186d11,_0x5e0bc8[_0x8b44('0x40')]);var _0x898df={'where':_0x186d11['where']};return db[_0x8b44('0x2b')][_0x8b44('0x1d')](_0x898df)[_0x8b44('0x25')](function(_0x19e8ff){_0x583b90[_0x8b44('0x1d')]=_0x19e8ff;if(_0x5e0bc8[_0x8b44('0x31')][_0x8b44('0x41')]){_0x186d11[_0x8b44('0x42')]=[{'all':!![]}];}return db[_0x8b44('0x2b')]['findAll'](_0x186d11);})[_0x8b44('0x25')](function(_0x29a83a){_0x583b90[_0x8b44('0x43')]=_0x29a83a;return _0x583b90;})[_0x8b44('0x25')](respondWithFilteredResult(_0x151b64,_0x186d11))[_0x8b44('0x44')](handleError(_0x151b64,null));};exports[_0x8b44('0x45')]=function(_0x57ebfe,_0x47f71a){var _0x15a3b8={'raw':!![],'where':{'id':_0x57ebfe[_0x8b44('0x46')]['id']}},_0xdc4594={};_0xdc4594[_0x8b44('0x2f')]=_[_0x8b44('0x32')](db[_0x8b44('0x2b')][_0x8b44('0x2c')]);_0xdc4594[_0x8b44('0x31')]=_['keys'](_0x57ebfe[_0x8b44('0x31')]);_0xdc4594[_0x8b44('0x33')]=_['intersection'](_0xdc4594[_0x8b44('0x2f')],_0xdc4594[_0x8b44('0x31')]);_0x15a3b8[_0x8b44('0x35')]=_['intersection'](_0xdc4594[_0x8b44('0x2f')],qs[_0x8b44('0x36')](_0x57ebfe[_0x8b44('0x31')][_0x8b44('0x36')]));_0x15a3b8[_0x8b44('0x35')]=_0x15a3b8['attributes'][_0x8b44('0x37')]?_0x15a3b8[_0x8b44('0x35')]:_0xdc4594[_0x8b44('0x2f')];if(_0x57ebfe[_0x8b44('0x31')][_0x8b44('0x41')]){_0x15a3b8[_0x8b44('0x42')]=[{'all':!![]}];}_0x15a3b8=_[_0x8b44('0x3f')]({},_0x15a3b8,_0x57ebfe['options']);return db[_0x8b44('0x2b')]['find'](_0x15a3b8)[_0x8b44('0x25')](handleEntityNotFound(_0x47f71a,null))[_0x8b44('0x25')](respondWithResult(_0x47f71a,null))[_0x8b44('0x44')](handleError(_0x47f71a,null));};exports['clone']=function(_0x3d0119,_0x30fe81){var _0x3e544b={'where':{'id':_0x3d0119[_0x8b44('0x46')]['id']}},_0x5a51e6={};_0x5a51e6[_0x8b44('0x2f')]=_[_0x8b44('0x32')](db[_0x8b44('0x2b')]['rawAttributes']);_0x3e544b[_0x8b44('0x35')]=_[_0x8b44('0x34')](_0x5a51e6[_0x8b44('0x2f')],qs[_0x8b44('0x36')](_0x3d0119[_0x8b44('0x31')]['fields']));_0x3e544b[_0x8b44('0x35')]=_0x3e544b[_0x8b44('0x35')][_0x8b44('0x37')]?_0x3e544b[_0x8b44('0x35')]:_0x5a51e6['model'];if(_0x3d0119[_0x8b44('0x31')][_0x8b44('0x41')]){_0x3e544b[_0x8b44('0x42')]=[{'all':!![]}];}_0x3e544b=_[_0x8b44('0x3f')]({},_0x3e544b,_0x3d0119['options']);return db['Attachment'][_0x8b44('0x47')](_0x3e544b)[_0x8b44('0x25')](handleEntityNotFound(_0x30fe81,null))[_0x8b44('0x25')](function(_0x22b724){if(_0x22b724){var _0x3e6e93=_0x22b724['get']({'plain':!![]});_0x3e6e93=qs[_0x8b44('0x48')](_0x3e6e93,['id','createdAt','updatedAt']);_0x3d0119[_0x8b44('0x49')]=_[_0x8b44('0x48')](_0x3d0119[_0x8b44('0x49')],['id',_0x8b44('0x4a'),_0x8b44('0x4b')]);return db['Attachment']['create'](_[_0x8b44('0x3f')](_0x3e6e93,_0x3d0119['body']),{'include':_0x3d0119['query'][_0x8b44('0x41')]?[{'all':!![]}]:undefined});}})[_0x8b44('0x25')](respondWithResult(_0x30fe81,0xc9))[_0x8b44('0x44')](handleError(_0x30fe81,null));};exports[_0x8b44('0x24')]=function(_0x377e49,_0x323bff){if(_0x377e49[_0x8b44('0x49')]['id']){delete _0x377e49[_0x8b44('0x49')]['id'];}return db[_0x8b44('0x2b')]['find']({'where':{'id':_0x377e49[_0x8b44('0x46')]['id']}})['then'](handleEntityNotFound(_0x323bff,null))['then'](saveUpdates(_0x377e49[_0x8b44('0x49')],null))[_0x8b44('0x25')](respondWithResult(_0x323bff,null))[_0x8b44('0x44')](handleError(_0x323bff,null));};exports[_0x8b44('0x26')]=function(_0x389fa0,_0x51650f){return db[_0x8b44('0x2b')]['find']({'where':{'id':_0x389fa0['params']['id']}})[_0x8b44('0x25')](handleEntityNotFound(_0x51650f,null))[_0x8b44('0x25')](removeEntity(_0x51650f,null))[_0x8b44('0x44')](handleError(_0x51650f,null));};exports['create']=function(_0x47ec0e,_0x45c90c,_0x13751c){_0x47ec0e[_0x8b44('0x49')][_0x8b44('0x29')]=_0x47ec0e[_0x8b44('0x4c')][_0x8b44('0x4d')];_0x47ec0e[_0x8b44('0x49')][_0x8b44('0x4e')]=_0x47ec0e['file'][_0x8b44('0x4f')];_0x47ec0e['body']['type']=_0x47ec0e[_0x8b44('0x4c')]['mimetype'];return db[_0x8b44('0x2b')][_0x8b44('0x50')](_0x47ec0e[_0x8b44('0x49')])[_0x8b44('0x25')](respondWithResult(_0x45c90c,0xc9))[_0x8b44('0x44')](handleError(_0x45c90c,null));};exports['download']=function(_0x2a2555,_0x2ab7c8,_0x36baaf){return db[_0x8b44('0x2b')][_0x8b44('0x51')]({'where':{'id':_0x2a2555[_0x8b44('0x46')]['id']},'raw':!![]})[_0x8b44('0x25')](handleEntityNotFound(_0x2ab7c8,null))[_0x8b44('0x25')](function(_0x39063c){if(_0x39063c){var _0xa0c7c2=_0x39063c[_0x8b44('0x52')]!==null;var _0x39ae9a=path[_0x8b44('0x53')](config['root'],_0x8b44('0x54'));if(_0xa0c7c2){_0x39ae9a=path[_0x8b44('0x53')](_0x39ae9a,_0x8b44('0x55'));}var _0x31b57d=path[_0x8b44('0x53')](_0x39ae9a,_0x39063c[_0x8b44('0x4e')]);return _0x2ab7c8[_0x8b44('0x56')](_0x31b57d);}})[_0x8b44('0x44')](handleError(_0x2ab7c8,null));};
\ No newline at end of file
index a37bb21..ce3ca55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe54=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','bluebird','request-promise','path'];(function(_0x44af89,_0x437e2f){var _0x1764b0=function(_0x39d001){while(--_0x39d001){_0x44af89['push'](_0x44af89['shift']());}};_0x1764b0(++_0x437e2f);}(_0xbe54,0x171));var _0x4be5=function(_0x455503,_0x8d5c66){_0x455503=_0x455503-0x0;var _0x310123=_0xbe54[_0x455503];return _0x310123;};'use strict';var _=require(_0x4be5('0x0'));var util=require(_0x4be5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4be5('0x2'));var rp=require(_0x4be5('0x3'));var fs=require('fs');var path=require(_0x4be5('0x4'));var rimraf=require('rimraf');var config=require(_0x4be5('0x5'));var attributes=require(_0x4be5('0x6'));module[_0x4be5('0x7')]=function(_0x274937,_0xc22f47){return _0x274937[_0x4be5('0x8')](_0x4be5('0x9'),attributes,{'tableName':_0x4be5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb353=['./attachment.attributes','define','Attachment','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x194ca7,_0x331309){var _0x556f62=function(_0xf5d58){while(--_0xf5d58){_0x194ca7['push'](_0x194ca7['shift']());}};_0x556f62(++_0x331309);}(_0xb353,0x87));var _0x3b35=function(_0x3906ef,_0x59df2f){_0x3906ef=_0x3906ef-0x0;var _0x3b9414=_0xb353[_0x3906ef];return _0x3b9414;};'use strict';var _=require(_0x3b35('0x0'));var util=require(_0x3b35('0x1'));var logger=require('../../config/logger')(_0x3b35('0x2'));var moment=require(_0x3b35('0x3'));var BPromise=require('bluebird');var rp=require(_0x3b35('0x4'));var fs=require('fs');var path=require(_0x3b35('0x5'));var rimraf=require(_0x3b35('0x6'));var config=require(_0x3b35('0x7'));var attributes=require(_0x3b35('0x8'));module['exports']=function(_0x214ac4,_0x5897b5){return _0x214ac4[_0x3b35('0x9')](_0x3b35('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e9b6f7f..cb2b0a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13c0=['message','result','catch','CreateAttachment','create','body','options','raw','then','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x556336,_0x3a2af7){var _0x2b886e=function(_0x1465d2){while(--_0x1465d2){_0x556336['push'](_0x556336['shift']());}};_0x2b886e(++_0x3a2af7);}(_0x13c0,0x79));var _0x013c=function(_0x55291a,_0x814018){_0x55291a=_0x55291a-0x0;var _0x3c870c=_0x13c0[_0x55291a];return _0x3c870c;};'use strict';var _=require(_0x013c('0x0'));var util=require(_0x013c('0x1'));var moment=require(_0x013c('0x2'));var BPromise=require(_0x013c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x013c('0x4'));var logger=require(_0x013c('0x5'))(_0x013c('0x6'));var config=require(_0x013c('0x7'));var jayson=require(_0x013c('0x8'));var client=jayson[_0x013c('0x9')][_0x013c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3decb5,_0x50caf2,_0x4cf99d){return new BPromise(function(_0x593053,_0x27c830){return client[_0x013c('0xb')](_0x3decb5,_0x4cf99d)['then'](function(_0x28c3a0){logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));logger[_0x013c('0xf')](_0x013c('0x10'),_0x50caf2,_0x013c('0xe'),JSON[_0x013c('0x11')](_0x28c3a0));if(_0x28c3a0[_0x013c('0x12')]){if(_0x28c3a0[_0x013c('0x12')]['code']===0x1f4){logger['error'](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x27c830(_0x28c3a0[_0x013c('0x12')]['message']);}logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x28c3a0[_0x013c('0x12')][_0x013c('0x13')]);return _0x593053(_0x28c3a0[_0x013c('0x12')]['message']);}else{logger[_0x013c('0xc')](_0x013c('0xd'),_0x50caf2,_0x013c('0xe'));_0x593053(_0x28c3a0[_0x013c('0x14')][_0x013c('0x13')]);}})[_0x013c('0x15')](function(_0x6b8b5){logger[_0x013c('0x12')](_0x013c('0xd'),_0x50caf2,_0x6b8b5);_0x27c830(_0x6b8b5);});});}exports[_0x013c('0x16')]=function(_0x34d59f){var _0x4268cf=this;return new Promise(function(_0x25eb26,_0x5a9142){return db['Attachment'][_0x013c('0x17')](_0x34d59f[_0x013c('0x18')],{'raw':_0x34d59f['options']?_0x34d59f[_0x013c('0x19')][_0x013c('0x1a')]===undefined?!![]:![]:!![]})[_0x013c('0x1b')](function(_0x38bac2){logger[_0x013c('0xc')]('CreateAttachment',_0x34d59f);logger[_0x013c('0xf')](_0x013c('0x16'),_0x34d59f,JSON['stringify'](_0x38bac2));_0x25eb26(_0x38bac2);})[_0x013c('0x15')](function(_0x82f9f1){logger['error']('CreateAttachment',_0x82f9f1[_0x013c('0x13')],_0x34d59f);_0x5a9142(_0x4268cf[_0x013c('0x12')](0x1f4,_0x82f9f1[_0x013c('0x13')]));});});};
\ No newline at end of file
+var _0xacfe=['CreateAttachment','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','create','options','raw'];(function(_0x1962e7,_0x42a7f5){var _0x4f159e=function(_0x4951cb){while(--_0x4951cb){_0x1962e7['push'](_0x1962e7['shift']());}};_0x4f159e(++_0x42a7f5);}(_0xacfe,0xfd));var _0xeacf=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xacfe[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeacf('0x0'));var BPromise=require(_0xeacf('0x1'));var rs=require(_0xeacf('0x2'));var fs=require('fs');var Redis=require(_0xeacf('0x3'));var db=require(_0xeacf('0x4'))['db'];var utils=require(_0xeacf('0x5'));var logger=require(_0xeacf('0x6'))(_0xeacf('0x7'));var config=require(_0xeacf('0x8'));var jayson=require(_0xeacf('0x9'));var client=jayson[_0xeacf('0xa')][_0xeacf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13cba2,_0x5eb516,_0x411634){return new BPromise(function(_0xce0437,_0x17b21c){return client[_0xeacf('0xc')](_0x13cba2,_0x411634)['then'](function(_0xfe344){logger['info'](_0xeacf('0xd'),_0x5eb516,_0xeacf('0xe'));logger[_0xeacf('0xf')](_0xeacf('0x10'),_0x5eb516,_0xeacf('0xe'),JSON[_0xeacf('0x11')](_0xfe344));if(_0xfe344[_0xeacf('0x12')]){if(_0xfe344[_0xeacf('0x12')][_0xeacf('0x13')]===0x1f4){logger[_0xeacf('0x12')]('Attachment,\x20%s,\x20%s',_0x5eb516,_0xfe344[_0xeacf('0x12')][_0xeacf('0x14')]);return _0x17b21c(_0xfe344[_0xeacf('0x12')][_0xeacf('0x14')]);}logger['error'](_0xeacf('0xd'),_0x5eb516,_0xfe344[_0xeacf('0x12')][_0xeacf('0x14')]);return _0xce0437(_0xfe344['error']['message']);}else{logger[_0xeacf('0x15')](_0xeacf('0xd'),_0x5eb516,'request\x20sent');_0xce0437(_0xfe344[_0xeacf('0x16')]['message']);}})[_0xeacf('0x17')](function(_0x1df080){logger['error'](_0xeacf('0xd'),_0x5eb516,_0x1df080);_0x17b21c(_0x1df080);});});}exports['CreateAttachment']=function(_0x650730){var _0xe87314=this;return new Promise(function(_0x18de20,_0x118932){return db['Attachment'][_0xeacf('0x18')](_0x650730['body'],{'raw':_0x650730[_0xeacf('0x19')]?_0x650730[_0xeacf('0x19')][_0xeacf('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x29b0d0){logger[_0xeacf('0x15')](_0xeacf('0x1b'),_0x650730);logger[_0xeacf('0xf')](_0xeacf('0x1b'),_0x650730,JSON[_0xeacf('0x11')](_0x29b0d0));_0x18de20(_0x29b0d0);})[_0xeacf('0x17')](function(_0x273d57){logger[_0xeacf('0x12')]('CreateAttachment',_0x273d57[_0xeacf('0x14')],_0x650730);_0x118932(_0xe87314[_0xeacf('0x12')](0x1f4,_0x273d57[_0xeacf('0x14')]));});});};
\ No newline at end of file
index e77891f..306bea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0x0b0e[_0x4b784d];return _0x2cdeaf;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _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(_0x9b3f2,_0x85d3b6){var _0x1fc12c=function(_0x35ac32){while(--_0x35ac32){_0x9b3f2['push'](_0x9b3f2['shift']());}};_0x1fc12c(++_0x85d3b6);}(_0x2032,0xd9));var _0x2203=function(_0x363db1,_0x154d4f){_0x363db1=_0x363db1-0x0;var _0x4bb0ad=_0x2032[_0x363db1];return _0x4bb0ad;};'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 f264326..846358c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63e7=['authenticate','google','profile','email','callback','/login','clientID','clientSecret','secret','callbackURL','Setting','findOne','blockDuration','then','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','login'];(function(_0x24bd83,_0x1830c4){var _0x3a047e=function(_0x5d8bc4){while(--_0x5d8bc4){_0x24bd83['push'](_0x24bd83['shift']());}};_0x3a047e(++_0x1830c4);}(_0x63e7,0x1a6));var _0x763e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x63e7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x763e('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x763e('0x1'))[_0x763e('0x2')];var moment=require(_0x763e('0x3'));var db=require(_0x763e('0x4'))['db'];var config=require(_0x763e('0x5'));var signToken=require('../../components/auth/service')['signToken'];var utils=require('../../config/utils');exports[_0x763e('0x6')]=passport[_0x763e('0x7')](_0x763e('0x8'),{'failureRedirect':'/login','scope':[_0x763e('0x9'),_0x763e('0xa')],'session':![]});exports[_0x763e('0xb')]=passport['authenticate'](_0x763e('0x8'),{'failureRedirect':_0x763e('0xc'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x763e('0x8')]?config[_0x763e('0x8')][_0x763e('0xd')]:'id','clientSecret':config[_0x763e('0x8')]?config['google'][_0x763e('0xe')]:_0x763e('0xf'),'callbackURL':config[_0x763e('0x8')]?config['google'][_0x763e('0x10')]:''},function(_0x45187f,_0x5d22ea,_0x1da892,_0x119ab4){var _0x349cb9,_0x149f11;return db[_0x763e('0x11')][_0x763e('0x12')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x763e('0x13')],'raw':!![]})[_0x763e('0x14')](function(_0x1a0a08){_0x349cb9=_0x1a0a08;return db['User']['find']({'where':{'email':_[_0x763e('0x15')](_0x1da892[_0x763e('0x16')],_0x763e('0x17')),'role':{'$or':[_0x763e('0x18'),'user',_0x763e('0x19')]}}});})[_0x763e('0x14')](function(_0x2d997c){_0x149f11=_0x2d997c;if(_0x149f11){if(_0x149f11[_0x763e('0x1a')]){return _0x119ab4(_0x763e('0x1b'));}else if(_0x349cb9[_0x763e('0x13')]>0x0){if(_0x149f11['blocked']){if(moment(_0x149f11['blockedAt'])[_0x763e('0x1c')](_0x349cb9[_0x763e('0x13')],_0x763e('0x1d'))>moment()){return _0x119ab4('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x763e('0x1e')](_0x149f11,0x0,![],null)[_0x763e('0x14')](function(){return utils[_0x763e('0x1f')](_0x149f11);})[_0x763e('0x14')](function(){return _0x119ab4(null,_0x149f11);});}}else{return utils[_0x763e('0x1f')](_0x149f11)[_0x763e('0x14')](function(){return _0x119ab4(null,_0x149f11);});}}else{return utils[_0x763e('0x1f')](_0x149f11)[_0x763e('0x14')](function(){return _0x119ab4(null,_0x149f11);});}}return _0x119ab4(_0x763e('0x1b'));})[_0x763e('0x20')](function(_0x13db70){_0x119ab4(_0x13db70);});}));
\ No newline at end of file
+var _0xb74e=['getLicense','catch','passport','passport-google-oauth20','../../config/environment','../../components/auth/service','signToken','login','authenticate','/login','profile','email','callback','use','google','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','then','User','map','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add'];(function(_0x36878a,_0x5872d3){var _0x4b83b2=function(_0x54687a){while(--_0x54687a){_0x36878a['push'](_0x36878a['shift']());}};_0x4b83b2(++_0x5872d3);}(_0xb74e,0xe9));var _0xeb74=function(_0x17e044,_0x5b5478){_0x17e044=_0x17e044-0x0;var _0x2db199=_0xb74e[_0x17e044];return _0x2db199;};'use strict';var _=require('lodash');var passport=require(_0xeb74('0x0'));var GoogleStrategy=require(_0xeb74('0x1'))['Strategy'];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0xeb74('0x2'));var signToken=require(_0xeb74('0x3'))[_0xeb74('0x4')];var utils=require('../../config/utils');exports[_0xeb74('0x5')]=passport[_0xeb74('0x6')]('google',{'failureRedirect':_0xeb74('0x7'),'scope':[_0xeb74('0x8'),_0xeb74('0x9')],'session':![]});exports[_0xeb74('0xa')]=passport[_0xeb74('0x6')]('google',{'failureRedirect':_0xeb74('0x7'),'session':![]});passport[_0xeb74('0xb')](new GoogleStrategy({'clientID':config[_0xeb74('0xc')]?config[_0xeb74('0xc')][_0xeb74('0xd')]:'id','clientSecret':config[_0xeb74('0xc')]?config['google'][_0xeb74('0xe')]:'secret','callbackURL':config['google']?config[_0xeb74('0xc')][_0xeb74('0xf')]:''},function(_0x130291,_0x5147f2,_0x1e4650,_0x1da2b8){var _0x30711c,_0x311ff7;return db[_0xeb74('0x10')][_0xeb74('0x11')]({'where':{'id':0x1},'attributes':[_0xeb74('0x12'),'blockDuration'],'raw':!![]})[_0xeb74('0x13')](function(_0x16a894){_0x30711c=_0x16a894;return db[_0xeb74('0x14')]['find']({'where':{'email':_[_0xeb74('0x15')](_0x1e4650['emails'],_0xeb74('0x16')),'role':{'$or':[_0xeb74('0x17'),'user',_0xeb74('0x18')]}}});})[_0xeb74('0x13')](function(_0x30cf30){_0x311ff7=_0x30cf30;if(_0x311ff7){if(_0x311ff7[_0xeb74('0x19')]){return _0x1da2b8(_0xeb74('0x1a'));}else if(_0x30711c[_0xeb74('0x1b')]>0x0){if(_0x311ff7[_0xeb74('0x1c')]){if(moment(_0x311ff7[_0xeb74('0x1d')])[_0xeb74('0x1e')](_0x30711c['blockDuration'],'minutes')>moment()){return _0x1da2b8('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x311ff7,0x0,![],null)[_0xeb74('0x13')](function(){return utils[_0xeb74('0x1f')](_0x311ff7);})[_0xeb74('0x13')](function(){return _0x1da2b8(null,_0x311ff7);});}}else{return utils[_0xeb74('0x1f')](_0x311ff7)[_0xeb74('0x13')](function(){return _0x1da2b8(null,_0x311ff7);});}}else{return utils[_0xeb74('0x1f')](_0x311ff7)['then'](function(){return _0x1da2b8(null,_0x311ff7);});}}return _0x1da2b8(_0xeb74('0x1a'));})[_0xeb74('0x20')](function(_0x1db0de){_0x1da2b8(_0x1db0de);});}));
\ No newline at end of file
index 9b64fa7..0657591 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2da7=['express','Router','./authGoogle.controller','../../components/auth/service','get','login','isMiddleware','setTokenCookie','exports'];(function(_0x2103e1,_0x4c706e){var _0x56af92=function(_0x411056){while(--_0x411056){_0x2103e1['push'](_0x2103e1['shift']());}};_0x56af92(++_0x4c706e);}(_0x2da7,0x99));var _0x72da=function(_0x51b7df,_0x1ddf47){_0x51b7df=_0x51b7df-0x0;var _0x2d8fe6=_0x2da7[_0x51b7df];return _0x2d8fe6;};'use strict';var express=require(_0x72da('0x0'));var passport=require('passport');var router=express[_0x72da('0x1')]();var controller=require(_0x72da('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x72da('0x3'));router[_0x72da('0x4')]('/',controller[_0x72da('0x5')]);router['get']('/callback',controller['callback'],authService[_0x72da('0x6')],userController[_0x72da('0x5')],authService[_0x72da('0x7')]);module[_0x72da('0x8')]=router;
\ No newline at end of file
+var _0x52b2=['get','login','/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','../user/user.controller.js','../../components/auth/service'];(function(_0x195d7e,_0x446643){var _0x31b063=function(_0x5778c8){while(--_0x5778c8){_0x195d7e['push'](_0x195d7e['shift']());}};_0x31b063(++_0x446643);}(_0x52b2,0x6a));var _0x252b=function(_0x142647,_0x83ac78){_0x142647=_0x142647-0x0;var _0x2a2cda=_0x52b2[_0x142647];return _0x2a2cda;};'use strict';var express=require('express');var passport=require(_0x252b('0x0'));var router=express[_0x252b('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x252b('0x2'));var authService=require(_0x252b('0x3'));router[_0x252b('0x4')]('/',controller[_0x252b('0x5')]);router[_0x252b('0x4')](_0x252b('0x6'),controller[_0x252b('0x7')],authService[_0x252b('0x8')],userController[_0x252b('0x5')],authService[_0x252b('0x9')]);module[_0x252b('0xa')]=router;
\ No newline at end of file
index 15775d8..e5e8f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03bc=['passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','role','blocked','blockedAt','loginAttempts','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','minutes','clearBlockUser','add','getLicense','MailAccount','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','email','generate','trim','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','catch','reset','User','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','util'];(function(_0x163f27,_0x367489){var _0x133b39=function(_0x24b14b){while(--_0x24b14b){_0x163f27['push'](_0x163f27['shift']());}};_0x133b39(++_0x367489);}(_0x03bc,0x1a8));var _0xc03b=function(_0x564e7a,_0x17a482){_0x564e7a=_0x564e7a-0x0;var _0x5b6985=_0x03bc[_0x564e7a];return _0x5b6985;};'use strict';var util=require(_0xc03b('0x0'));var passport=require(_0xc03b('0x1'));var LocalStrategy=require('passport-local')[_0xc03b('0x2')];var jayson=require(_0xc03b('0x3'));var _=require(_0xc03b('0x4'));var rs=require(_0xc03b('0x5'));var moment=require(_0xc03b('0x6'));var db=require(_0xc03b('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc03b('0x8'));var client=jayson[_0xc03b('0x9')][_0xc03b('0xa')]({'port':0x232b});function localAuthenticate(_0x4ab744,_0x2ea430,_0x6fa59d,_0x5187fb){var _0x328eda,_0x43fffa;return db[_0xc03b('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0xc03b('0xc'),_0xc03b('0xd')],'raw':!![]})[_0xc03b('0xe')](function(_0xb42bdc){_0x328eda=_0xb42bdc;return _0x4ab744[_0xc03b('0xf')]({'attributes':['id',_0xc03b('0x10'),_0xc03b('0x11'),_0xc03b('0x12'),_0xc03b('0x13'),'disabled',_0xc03b('0x14'),_0xc03b('0x15'),_0xc03b('0x16')],'where':{'name':_0x2ea430,'role':{'$or':['admin','user',_0xc03b('0x17')]}}});})['then'](function(_0x49c445){if(!_0x49c445||_0x49c445&&_0x49c445[_0xc03b('0x10')]!==_0x2ea430){throw new Error(_0xc03b('0x18'));}else{_0x43fffa=_0x49c445;return _0x43fffa;}})['then'](function(){_0x43fffa['authenticate'](_0x6fa59d,function(_0x411bc0,_0x49b416){var _0x3edfe5=_0x43fffa[_0xc03b('0x16')]+0x1;if(_0x411bc0){return _0x5187fb(_0x411bc0);}else if(!_0x49b416){if(_0x43fffa[_0xc03b('0x19')]){return _0x5187fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x328eda[_0xc03b('0xc')]>0x0){if(_0x43fffa[_0xc03b('0x14')]){if(_0x328eda[_0xc03b('0xd')]>0x0){if(moment(_0x43fffa['blockedAt'])['add'](_0x328eda[_0xc03b('0xd')],_0xc03b('0x1a'))>moment()){return _0x5187fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x43fffa,_0x3edfe5,![],null)[_0xc03b('0xe')](function(){return _0x5187fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x5187fb(null,![],{'message':_0xc03b('0x18')});}}else{if(_0x3edfe5>=_0x328eda['allowedLoginAttempts']){return utils['clearBlockUser'](_0x43fffa,0x0,!![],moment())[_0xc03b('0xe')](function(){return _0x5187fb(null,![],{'message':_0xc03b('0x18')});});}else{return utils[_0xc03b('0x1b')](_0x43fffa,_0x3edfe5,![],null)[_0xc03b('0xe')](function(){return _0x5187fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5187fb(null,![],{'message':_0xc03b('0x18')});}}else{if(_0x43fffa[_0xc03b('0x19')]){return _0x5187fb(null,![],{'message':_0xc03b('0x18')});}else if(_0x328eda[_0xc03b('0xc')]>0x0){if(_0x43fffa[_0xc03b('0x14')]){if(_0x328eda['blockDuration']>0x0){if(moment(_0x43fffa[_0xc03b('0x15')])[_0xc03b('0x1c')](_0x328eda[_0xc03b('0xd')],'minutes')>moment()){return _0x5187fb(null,![],{'message':_0xc03b('0x18')});}else{return utils[_0xc03b('0x1b')](_0x43fffa,0x0,![],null)[_0xc03b('0xe')](function(){return utils[_0xc03b('0x1d')](_0x43fffa);})[_0xc03b('0xe')](function(){return _0x5187fb(null,_0x43fffa);});}}else{return _0x5187fb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc03b('0x1b')](_0x43fffa,0x0,![],null)[_0xc03b('0xe')](function(){return utils['getLicense'](_0x43fffa);})[_0xc03b('0xe')](function(){return _0x5187fb(null,_0x43fffa);})['catch'](function(_0x200dc9){return _0x5187fb(null,![],_0x200dc9);});}}else{if(_0x43fffa[_0xc03b('0x14')]){return _0x5187fb(null,![],{'message':_0xc03b('0x18')});}else{return utils[_0xc03b('0x1d')](_0x43fffa)[_0xc03b('0xe')](function(){return _0x5187fb(null,_0x43fffa);});}}}});})['catch'](function(_0x4d5d65){return _0x5187fb(null,![],_0x4d5d65);});}function sendServiceMail(_0x4c80f0){return db[_0xc03b('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xc03b('0x10'),'email'],'include':[{'model':db[_0xc03b('0x1f')],'as':_0xc03b('0x20')}]})[_0xc03b('0xe')](function(_0x5b4426){if(!_0x5b4426){throw new Error(_0xc03b('0x21'));}var _0x3e9a14={'tls':{'rejectUnauthorized':![]}};if(_0x5b4426[_0xc03b('0x20')][_0xc03b('0x22')]){_0x3e9a14[_0xc03b('0x22')]=_0x5b4426[_0xc03b('0x20')][_0xc03b('0x22')];}else{_0x3e9a14[_0xc03b('0x23')]=_0x5b4426[_0xc03b('0x20')][_0xc03b('0x23')];_0x3e9a14['port']=_0x5b4426[_0xc03b('0x20')][_0xc03b('0x24')];_0x3e9a14[_0xc03b('0x25')]=_0x5b4426[_0xc03b('0x20')][_0xc03b('0x25')];}if(_0x5b4426[_0xc03b('0x20')]['authentication']){_0x3e9a14[_0xc03b('0x26')]={'user':_0x5b4426[_0xc03b('0x20')]['user'],'pass':_0x5b4426[_0xc03b('0x20')][_0xc03b('0x27')]};}var _0x4ab41d={'account':_0x3e9a14,'message':_[_0xc03b('0x28')]({'from':util[_0xc03b('0x29')](_0xc03b('0x2a'),_0x5b4426[_0xc03b('0x10')],_0x5b4426['email']||_0x5b4426['Smtp'][_0xc03b('0x2b')])},_0x4c80f0)};return client[_0xc03b('0x2c')]('SendMail',_0x4ab41d);})[_0xc03b('0xe')](function(_0x505a58){if(_0x505a58[_0xc03b('0x2d')]){throw new Error(util[_0xc03b('0x29')](_0xc03b('0x2e'),_0x505a58[_0xc03b('0x2d')][_0xc03b('0x2f')]||JSON[_0xc03b('0x30')](_0x505a58[_0xc03b('0x2d')])));}return!![];});}function handleError(_0x549ae9,_0x27a08d,_0xffabe9){return _0x549ae9[_0xc03b('0x31')](_0x27a08d||0x1f4)[_0xc03b('0x32')]({'message':_0xffabe9?_0xffabe9[_0xc03b('0x2f')]||_0xffabe9:''});}exports['login']=function(_0x46b6db,_0x28a568,_0x502027){passport[_0xc03b('0x33')]('local',function(_0xd3efa2,_0x14ae9c,_0x574a48){var _0x3a274b=_0xd3efa2||_0x574a48;if(_0x3a274b){return handleError(_0x28a568,0x191,_0x3a274b);}if(!_0x14ae9c){return handleError(_0x28a568,0x194,{'message':_0xc03b('0x34')});}else{var _0x2fb285={'payload':{'id':_0x14ae9c['id'],'role':_0x14ae9c[_0xc03b('0x13')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2fb285)[_0xc03b('0xe')](function(_0x166f50){_0x28a568[_0xc03b('0x35')]({'id':_0x14ae9c['id'],'token':_0x166f50,'statusCall':'','isAlreadyLogged':_0x14ae9c[_0xc03b('0x36')]});});}})(_0x46b6db,_0x28a568,_0x502027);};exports[_0xc03b('0x37')]=function(_0x3c0842,_0x3239f0,_0x18adb0){if(!_0x3c0842[_0xc03b('0x38')][_0xc03b('0x39')]){return handleError(_0x3239f0,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1f24c4=rs[_0xc03b('0x3a')]();_0x3c0842[_0xc03b('0x38')]['email']=_0x3c0842[_0xc03b('0x38')][_0xc03b('0x39')][_0xc03b('0x3b')]()[_0xc03b('0x3c')]();var _0x245d8f;return db[_0xc03b('0xb')][_0xc03b('0xf')]({'where':{'id':0x1},'attributes':[_0xc03b('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x3938a8){_0x245d8f=_0x3938a8;return db['User'][_0xc03b('0x3d')]({'where':{'email':_0x3c0842[_0xc03b('0x38')]['email']}});})[_0xc03b('0xe')](function(_0xae8067){if(!_0xae8067){throw new Error(_0xc03b('0x3e'));}if(_0xae8067['disabled']){throw new Error(_0xc03b('0x3f'));}if(_0xae8067[_0xc03b('0x14')]){if(moment(_0xae8067[_0xc03b('0x15')])[_0xc03b('0x1c')](_0x245d8f[_0xc03b('0xd')],_0xc03b('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xae8067[_0xc03b('0x14')]=![];_0xae8067[_0xc03b('0x15')]=null;}}_0xae8067['resetPasswordToken']=_0x1f24c4;_0xae8067[_0xc03b('0x40')]=Date[_0xc03b('0x41')]()+0x36ee80;return _0xae8067[_0xc03b('0x42')]();})[_0xc03b('0xe')](function(){return sendServiceMail({'to':_0x3c0842[_0xc03b('0x38')][_0xc03b('0x39')],'subject':_0xc03b('0x43'),'text':_0xc03b('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xc03b('0x45')+_0x3c0842[_0xc03b('0x46')][_0xc03b('0x23')]+'/reset/'+_0x1f24c4+'\x0a\x0a'+_0xc03b('0x47')});})[_0xc03b('0xe')](function(){_0x3239f0[_0xc03b('0x31')](0xc8)[_0xc03b('0x32')]({'message':'Reset\x20Email\x20sent!'});})[_0xc03b('0x48')](function(_0x2c85ca){return handleError(_0x3239f0,0x1f4,_0x2c85ca);});};exports[_0xc03b('0x49')]=function(_0x2f869e,_0x21949f,_0x56748d){return db[_0xc03b('0x4a')][_0xc03b('0x3d')]({'where':{'resetPasswordToken':_0x2f869e[_0xc03b('0x4b')]['token'],'resetPasswordExpires':{'$gt':Date[_0xc03b('0x41')]()}}})['then'](function(_0x326184){if(!_0x326184){throw new Error(_0xc03b('0x4c'));}return db['Setting'][_0xc03b('0xf')]({'attributes':['id',_0xc03b('0x4d'),_0xc03b('0x4e'),_0xc03b('0x4f')]})['then'](function(_0x2285a7){if(_0x2285a7[_0xc03b('0x4d')])authService['validatePasswordPattern'](_0x2f869e[_0xc03b('0x38')][_0xc03b('0x11')]);if(!_0x2285a7['enforcePasswordHistory']||!_0x326184[_0xc03b('0x50')])return _0x326184;authService[_0xc03b('0x51')](_0x2f869e[_0xc03b('0x38')][_0xc03b('0x11')],_0x326184['previousPasswords'],_0x2285a7[_0xc03b('0x4f')]);return _0x326184;})[_0xc03b('0xe')](function(){_0x326184['password']=_0x2f869e['body']['password'];_0x326184[_0xc03b('0x52')]=null;_0x326184[_0xc03b('0x40')]=null;return _0x326184[_0xc03b('0x42')]();});})[_0xc03b('0xe')](function(){_0x21949f[_0xc03b('0x31')](0xc8)[_0xc03b('0x32')]({'message':_0xc03b('0x53')});})[_0xc03b('0x48')](function(_0xb8e95a){return handleError(_0x21949f,0x1f4,_0xb8e95a);});};passport[_0xc03b('0x54')](new LocalStrategy({'usernameField':_0xc03b('0x10'),'passwordField':_0xc03b('0x11')},function(_0x342062,_0x4b025d,_0x5cee0f){return localAuthenticate(db['User'],_0x342062,_0x4b025d,_0x5cee0f);}));
\ No newline at end of file
+var _0x1eaa=['login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','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://','/reset/','send','Reset\x20Email\x20sent!','reset','token','passwordHistoryLimit','securePassword','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','use','util','Strategy','jayson/promise','randomstring','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','disabled','blockedAt','loginAttempts','admin','user','agent','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','blocked','add','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','email','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status'];(function(_0x331704,_0x4ff3b1){var _0xfb3a3c=function(_0xb36bf7){while(--_0xb36bf7){_0x331704['push'](_0x331704['shift']());}};_0xfb3a3c(++_0x4ff3b1);}(_0x1eaa,0x1c7));var _0xa1ea=function(_0x3118fe,_0x2cba78){_0x3118fe=_0x3118fe-0x0;var _0x14cef9=_0x1eaa[_0x3118fe];return _0x14cef9;};'use strict';var util=require(_0xa1ea('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0xa1ea('0x1')];var jayson=require(_0xa1ea('0x2'));var _=require('lodash');var rs=require(_0xa1ea('0x3'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xa1ea('0x4'));var utils=require(_0xa1ea('0x5'));var client=jayson['client'][_0xa1ea('0x6')]({'port':0x232b});function localAuthenticate(_0x7ad024,_0xceca77,_0x543c44,_0x38bfd5){var _0x58e238,_0x4b04bd;return db[_0xa1ea('0x7')][_0xa1ea('0x8')]({'where':{'id':0x1},'attributes':[_0xa1ea('0x9'),_0xa1ea('0xa')],'raw':!![]})[_0xa1ea('0xb')](function(_0x3a64c9){_0x58e238=_0x3a64c9;return _0x7ad024[_0xa1ea('0x8')]({'attributes':['id','name',_0xa1ea('0xc'),'salt','role',_0xa1ea('0xd'),'blocked',_0xa1ea('0xe'),_0xa1ea('0xf')],'where':{'name':_0xceca77,'role':{'$or':[_0xa1ea('0x10'),_0xa1ea('0x11'),_0xa1ea('0x12')]}}});})[_0xa1ea('0xb')](function(_0x2fc6fa){if(!_0x2fc6fa||_0x2fc6fa&&_0x2fc6fa[_0xa1ea('0x13')]!==_0xceca77){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x4b04bd=_0x2fc6fa;return _0x4b04bd;}})[_0xa1ea('0xb')](function(){_0x4b04bd[_0xa1ea('0x14')](_0x543c44,function(_0x49e059,_0x2dfeb1){var _0x46d6a6=_0x4b04bd[_0xa1ea('0xf')]+0x1;if(_0x49e059){return _0x38bfd5(_0x49e059);}else if(!_0x2dfeb1){if(_0x4b04bd[_0xa1ea('0xd')]){return _0x38bfd5(null,![],{'message':_0xa1ea('0x15')});}else if(_0x58e238[_0xa1ea('0x9')]>0x0){if(_0x4b04bd['blocked']){if(_0x58e238['blockDuration']>0x0){if(moment(_0x4b04bd[_0xa1ea('0xe')])['add'](_0x58e238[_0xa1ea('0xa')],'minutes')>moment()){return _0x38bfd5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa1ea('0x16')](_0x4b04bd,_0x46d6a6,![],null)[_0xa1ea('0xb')](function(){return _0x38bfd5(null,![],{'message':_0xa1ea('0x15')});});}}else{return _0x38bfd5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x46d6a6>=_0x58e238[_0xa1ea('0x9')]){return utils['clearBlockUser'](_0x4b04bd,0x0,!![],moment())['then'](function(){return _0x38bfd5(null,![],{'message':_0xa1ea('0x15')});});}else{return utils['clearBlockUser'](_0x4b04bd,_0x46d6a6,![],null)['then'](function(){return _0x38bfd5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x38bfd5(null,![],{'message':_0xa1ea('0x15')});}}else{if(_0x4b04bd['disabled']){return _0x38bfd5(null,![],{'message':_0xa1ea('0x15')});}else if(_0x58e238[_0xa1ea('0x9')]>0x0){if(_0x4b04bd[_0xa1ea('0x17')]){if(_0x58e238[_0xa1ea('0xa')]>0x0){if(moment(_0x4b04bd[_0xa1ea('0xe')])[_0xa1ea('0x18')](_0x58e238[_0xa1ea('0xa')],_0xa1ea('0x19'))>moment()){return _0x38bfd5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa1ea('0x16')](_0x4b04bd,0x0,![],null)[_0xa1ea('0xb')](function(){return utils[_0xa1ea('0x1a')](_0x4b04bd);})['then'](function(){return _0x38bfd5(null,_0x4b04bd);});}}else{return _0x38bfd5(null,![],{'message':_0xa1ea('0x15')});}}else{return utils[_0xa1ea('0x16')](_0x4b04bd,0x0,![],null)[_0xa1ea('0xb')](function(){return utils['getLicense'](_0x4b04bd);})['then'](function(){return _0x38bfd5(null,_0x4b04bd);})['catch'](function(_0x2fae01){return _0x38bfd5(null,![],_0x2fae01);});}}else{if(_0x4b04bd[_0xa1ea('0x17')]){return _0x38bfd5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa1ea('0x1a')](_0x4b04bd)[_0xa1ea('0xb')](function(){return _0x38bfd5(null,_0x4b04bd);});}}}});})[_0xa1ea('0x1b')](function(_0x392861){return _0x38bfd5(null,![],_0x392861);});}function sendServiceMail(_0x209121){return db[_0xa1ea('0x1c')][_0xa1ea('0x1d')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0xa1ea('0x1e')],'as':_0xa1ea('0x1f')}]})['then'](function(_0x526648){if(!_0x526648){throw new Error(_0xa1ea('0x20'));}var _0x431727={'tls':{'rejectUnauthorized':![]}};if(_0x526648['Smtp'][_0xa1ea('0x21')]){_0x431727[_0xa1ea('0x21')]=_0x526648['Smtp']['service'];}else{_0x431727[_0xa1ea('0x22')]=_0x526648['Smtp'][_0xa1ea('0x22')];_0x431727['port']=_0x526648[_0xa1ea('0x1f')][_0xa1ea('0x23')];_0x431727[_0xa1ea('0x24')]=_0x526648['Smtp'][_0xa1ea('0x24')];}if(_0x526648[_0xa1ea('0x1f')]['authentication']){_0x431727[_0xa1ea('0x25')]={'user':_0x526648[_0xa1ea('0x1f')][_0xa1ea('0x11')],'pass':_0x526648[_0xa1ea('0x1f')][_0xa1ea('0x26')]};}var _0x2d79d3={'account':_0x431727,'message':_[_0xa1ea('0x27')]({'from':util[_0xa1ea('0x28')](_0xa1ea('0x29'),_0x526648['name'],_0x526648[_0xa1ea('0x2a')]||_0x526648['Smtp'][_0xa1ea('0x11')])},_0x209121)};return client['request'](_0xa1ea('0x2b'),_0x2d79d3);})[_0xa1ea('0xb')](function(_0x4d4088){if(_0x4d4088[_0xa1ea('0x2c')]){throw new Error(util[_0xa1ea('0x28')](_0xa1ea('0x2d'),_0x4d4088['error'][_0xa1ea('0x2e')]||JSON[_0xa1ea('0x2f')](_0x4d4088[_0xa1ea('0x2c')])));}return!![];});}function handleError(_0x558bb9,_0x3514d9,_0x135de8){return _0x558bb9[_0xa1ea('0x30')](_0x3514d9||0x1f4)['send']({'message':_0x135de8?_0x135de8['message']||_0x135de8:''});}exports[_0xa1ea('0x31')]=function(_0x5ebb89,_0x17831b,_0x2afd33){passport['authenticate'](_0xa1ea('0x32'),function(_0x431cbe,_0x24a92d,_0x42ac72){var _0x110bbf=_0x431cbe||_0x42ac72;if(_0x110bbf){return handleError(_0x17831b,0x191,_0x110bbf);}if(!_0x24a92d){return handleError(_0x17831b,0x194,{'message':_0xa1ea('0x33')});}else{var _0x536d21={'payload':{'id':_0x24a92d['id'],'role':_0x24a92d[_0xa1ea('0x34')]},'options':{'expiresIn':0x15180}};return authService[_0xa1ea('0x35')](_0x536d21)[_0xa1ea('0xb')](function(_0x135e61){_0x17831b[_0xa1ea('0x36')]({'id':_0x24a92d['id'],'token':_0x135e61,'statusCall':'','isAlreadyLogged':_0x24a92d[_0xa1ea('0x37')]});});}})(_0x5ebb89,_0x17831b,_0x2afd33);};exports['forgot']=function(_0x2b0a91,_0x423c41,_0x28a613){if(!_0x2b0a91[_0xa1ea('0x38')][_0xa1ea('0x2a')]){return handleError(_0x423c41,0x1f4,{'message':_0xa1ea('0x39')});}var _0x4a7347=rs[_0xa1ea('0x3a')]();_0x2b0a91[_0xa1ea('0x38')][_0xa1ea('0x2a')]=_0x2b0a91['body'][_0xa1ea('0x2a')][_0xa1ea('0x3b')]()[_0xa1ea('0x3c')]();var _0x3a7c08;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xa1ea('0x9'),_0xa1ea('0xa')],'raw':!![]})[_0xa1ea('0xb')](function(_0x300f58){_0x3a7c08=_0x300f58;return db[_0xa1ea('0x3d')][_0xa1ea('0x1d')]({'where':{'email':_0x2b0a91[_0xa1ea('0x38')][_0xa1ea('0x2a')]}});})[_0xa1ea('0xb')](function(_0x353742){if(!_0x353742){throw new Error(_0xa1ea('0x3e'));}if(_0x353742[_0xa1ea('0xd')]){throw new Error(_0xa1ea('0x3f'));}if(_0x353742['blocked']){if(moment(_0x353742[_0xa1ea('0xe')])[_0xa1ea('0x18')](_0x3a7c08[_0xa1ea('0xa')],_0xa1ea('0x19'))>moment()){throw new Error(_0xa1ea('0x40'));}else{_0x353742[_0xa1ea('0x17')]=![];_0x353742[_0xa1ea('0xe')]=null;}}_0x353742[_0xa1ea('0x41')]=_0x4a7347;_0x353742[_0xa1ea('0x42')]=Date[_0xa1ea('0x43')]()+0x36ee80;return _0x353742[_0xa1ea('0x44')]();})[_0xa1ea('0xb')](function(){return sendServiceMail({'to':_0x2b0a91['body'][_0xa1ea('0x2a')],'subject':_0xa1ea('0x45'),'text':_0xa1ea('0x46')+_0xa1ea('0x47')+_0xa1ea('0x48')+_0x2b0a91['headers'][_0xa1ea('0x22')]+_0xa1ea('0x49')+_0x4a7347+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xa1ea('0xb')](function(){_0x423c41['status'](0xc8)[_0xa1ea('0x4a')]({'message':_0xa1ea('0x4b')});})[_0xa1ea('0x1b')](function(_0xebfc32){return handleError(_0x423c41,0x1f4,_0xebfc32);});};exports[_0xa1ea('0x4c')]=function(_0x133239,_0x508138,_0xfd88bc){return db['User'][_0xa1ea('0x1d')]({'where':{'resetPasswordToken':_0x133239['params'][_0xa1ea('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xa1ea('0x43')]()}}})[_0xa1ea('0xb')](function(_0x4a3885){if(!_0x4a3885){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xa1ea('0x7')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0xa1ea('0x4e')]})[_0xa1ea('0xb')](function(_0x10a568){if(_0x10a568[_0xa1ea('0x4f')])authService[_0xa1ea('0x50')](_0x133239['body'][_0xa1ea('0xc')]);if(!_0x10a568[_0xa1ea('0x51')]||!_0x4a3885['previousPasswords'])return _0x4a3885;authService[_0xa1ea('0x52')](_0x133239[_0xa1ea('0x38')][_0xa1ea('0xc')],_0x4a3885['previousPasswords'],_0x10a568[_0xa1ea('0x4e')]);return _0x4a3885;})[_0xa1ea('0xb')](function(){_0x4a3885[_0xa1ea('0xc')]=_0x133239[_0xa1ea('0x38')][_0xa1ea('0xc')];_0x4a3885[_0xa1ea('0x41')]=null;_0x4a3885[_0xa1ea('0x42')]=null;return _0x4a3885['save']();});})[_0xa1ea('0xb')](function(){_0x508138[_0xa1ea('0x30')](0xc8)[_0xa1ea('0x4a')]({'message':'Password\x20reset!'});})[_0xa1ea('0x1b')](function(_0x1e54d0){return handleError(_0x508138,0x1f4,_0x1e54d0);});};passport[_0xa1ea('0x53')](new LocalStrategy({'usernameField':_0xa1ea('0x13'),'passwordField':'password'},function(_0x2f05e6,_0x33039f,_0x1883c5){return localAuthenticate(db['User'],_0x2f05e6,_0x33039f,_0x1883c5);}));
\ No newline at end of file
index 710cfaf..83ed5d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x306b=['post','login','/forgot','forgot','/reset/:token','reset','./authLocal.controller'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x306b,0x15d));var _0xb306=function(_0x5c6bc9,_0x4276f7){_0x5c6bc9=_0x5c6bc9-0x0;var _0x5b1fa5=_0x306b[_0x5c6bc9];return _0x5b1fa5;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xb306('0x0'));router[_0xb306('0x1')]('/',controller[_0xb306('0x2')]);router[_0xb306('0x1')](_0xb306('0x3'),controller[_0xb306('0x4')]);router['post'](_0xb306('0x5'),controller[_0xb306('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x8437=['forgot','reset','exports','express','./authLocal.controller','post','login','/forgot'];(function(_0x268071,_0x2e2cf2){var _0x34b984=function(_0x33339c){while(--_0x33339c){_0x268071['push'](_0x268071['shift']());}};_0x34b984(++_0x2e2cf2);}(_0x8437,0x133));var _0x7843=function(_0x55c5e8,_0x2fea08){_0x55c5e8=_0x55c5e8-0x0;var _0x73668=_0x8437[_0x55c5e8];return _0x73668;};'use strict';var express=require(_0x7843('0x0'));var router=express['Router']();var controller=require(_0x7843('0x1'));router[_0x7843('0x2')]('/',controller[_0x7843('0x3')]);router['post'](_0x7843('0x4'),controller[_0x7843('0x5')]);router[_0x7843('0x2')]('/reset/:token',controller[_0x7843('0x6')]);module[_0x7843('0x7')]=router;
\ No newline at end of file
index af0e9b9..5abeacc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd8c=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfd8c,0x134));var _0xcfd8=function(_0x9d1180,_0x2f71fb){_0x9d1180=_0x9d1180-0x0;var _0x155274=_0xfd8c[_0x9d1180];return _0x155274;};'use strict';var Sequelize=require(_0xcfd8('0x0'));module[_0xcfd8('0x1')]={'name':{'type':Sequelize[_0xcfd8('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcfd8('0x2')]},'status':{'type':Sequelize[_0xcfd8('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcfd8('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xdb58=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x8a654b,_0x4be2f9){var _0x94bfbb=function(_0x29efa4){while(--_0x29efa4){_0x8a654b['push'](_0x8a654b['shift']());}};_0x94bfbb(++_0x4be2f9);}(_0xdb58,0x1d4));var _0x8db5=function(_0x2fb1c0,_0x40402a){_0x2fb1c0=_0x2fb1c0-0x0;var _0x41fad1=_0xdb58[_0x2fb1c0];return _0x41fad1;};'use strict';var Sequelize=require(_0x8db5('0x0'));module[_0x8db5('0x1')]={'name':{'type':Sequelize[_0x8db5('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x8db5('0x2')]},'description':{'type':Sequelize[_0x8db5('0x2')]},'status':{'type':Sequelize[_0x8db5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8db5('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index 9951a23..89f0899 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaf6=['length','pick','nolimit','addActions','Action','getActions','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','then','stack','name','send','index','map','Automation','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','keys','find','create','body','params','addConditions','ids','omit','getConditions','findOne','Condition'];(function(_0x10b408,_0xc557be){var _0x125b5b=function(_0x2d89d2){while(--_0x2d89d2){_0x10b408['push'](_0x10b408['shift']());}};_0x125b5b(++_0xc557be);}(_0xfaf6,0xa4));var _0x6faf=function(_0x399aa1,_0x31f1c8){_0x399aa1=_0x399aa1-0x0;var _0x4aabf4=_0xfaf6[_0x399aa1];return _0x4aabf4;};'use strict';var emlformat=require(_0x6faf('0x0'));var rimraf=require(_0x6faf('0x1'));var zipdir=require(_0x6faf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6faf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6faf('0x4'));var util=require(_0x6faf('0x5'));var path=require(_0x6faf('0x6'));var sox=require(_0x6faf('0x7'));var csv=require(_0x6faf('0x8'));var ejs=require(_0x6faf('0x9'));var fs=require('fs');var fs_extra=require(_0x6faf('0xa'));var _=require(_0x6faf('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6faf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6faf('0x8'));var querystring=require('querystring');var Papa=require(_0x6faf('0xd'));var Redis=require(_0x6faf('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6faf('0xf'));var as=require(_0x6faf('0x10'));var hardwareService=require(_0x6faf('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x6faf('0x12'));var config=require(_0x6faf('0x13'));var licenseUtil=require(_0x6faf('0x14'));var db=require(_0x6faf('0x15'))['db'];function respondWithStatusCode(_0x4460fc,_0x3972b2){_0x3972b2=_0x3972b2||0xcc;return function(_0x2227f4){if(_0x2227f4){return _0x4460fc[_0x6faf('0x16')](_0x3972b2);}return _0x4460fc[_0x6faf('0x17')](_0x3972b2)[_0x6faf('0x18')]();};}function respondWithResult(_0xb2b4e5,_0x4c98c7){_0x4c98c7=_0x4c98c7||0xc8;return function(_0x2ddf95){if(_0x2ddf95){return _0xb2b4e5[_0x6faf('0x17')](_0x4c98c7)[_0x6faf('0x19')](_0x2ddf95);}};}function respondWithFilteredResult(_0x43450b,_0x3ff81b){return function(_0x435df6){if(_0x435df6){var _0x1fe0a1=typeof _0x3ff81b[_0x6faf('0x1a')]==='undefined'&&typeof _0x3ff81b[_0x6faf('0x1b')]===_0x6faf('0x1c');var _0x556367=_0x435df6[_0x6faf('0x1d')];var _0x350758=_0x1fe0a1?0x0:_0x3ff81b[_0x6faf('0x1a')];var _0x52737e=_0x1fe0a1?_0x435df6[_0x6faf('0x1d')]:_0x3ff81b[_0x6faf('0x1a')]+_0x3ff81b[_0x6faf('0x1b')];var _0x30a816;if(_0x52737e>=_0x556367){_0x52737e=_0x556367;_0x30a816=0xc8;}else{_0x30a816=0xce;}_0x43450b['status'](_0x30a816);return _0x43450b[_0x6faf('0x1e')](_0x6faf('0x1f'),_0x350758+'-'+_0x52737e+'/'+_0x556367)[_0x6faf('0x19')](_0x435df6);}return null;};}function patchUpdates(_0x529401){return function(_0x3e629c){try{jsonpatch['apply'](_0x3e629c,_0x529401,!![]);}catch(_0x5bfa60){return BPromise['reject'](_0x5bfa60);}return _0x3e629c[_0x6faf('0x20')]();};}function saveUpdates(_0x400a22,_0x4a7a99){return function(_0x595c35){if(_0x595c35){return _0x595c35[_0x6faf('0x21')](_0x400a22)['then'](function(_0x5592a1){return _0x5592a1;});}return null;};}function removeEntity(_0x475fa4,_0x15ac89){return function(_0x1c423d){if(_0x1c423d){return _0x1c423d[_0x6faf('0x22')]()[_0x6faf('0x23')](function(){_0x475fa4[_0x6faf('0x17')](0xcc)[_0x6faf('0x18')]();});}};}function handleEntityNotFound(_0x27e77e,_0x4d48fb){return function(_0x54c582){if(!_0x54c582){_0x27e77e[_0x6faf('0x16')](0x194);}return _0x54c582;};}function handleError(_0x321320,_0x519531){_0x519531=_0x519531||0x1f4;return function(_0x3e5044){logger['error'](_0x3e5044[_0x6faf('0x24')]);if(_0x3e5044[_0x6faf('0x25')]){delete _0x3e5044['name'];}_0x321320[_0x6faf('0x17')](_0x519531)[_0x6faf('0x26')](_0x3e5044);};}exports[_0x6faf('0x27')]=function(_0x10fa7f,_0x2451ee){var _0x57612f={},_0x3249c7={},_0xdb0bd={'count':0x0,'rows':[]};var _0x28a103=_[_0x6faf('0x28')](db[_0x6faf('0x29')]['rawAttributes'],function(_0x39665){return{'name':_0x39665['fieldName'],'type':_0x39665[_0x6faf('0x2a')]['key']};});_0x3249c7[_0x6faf('0x2b')]=_[_0x6faf('0x28')](_0x28a103,_0x6faf('0x25'));_0x3249c7[_0x6faf('0x2c')]=_['keys'](_0x10fa7f[_0x6faf('0x2c')]);_0x3249c7[_0x6faf('0x2d')]=_['intersection'](_0x3249c7['model'],_0x3249c7[_0x6faf('0x2c')]);_0x57612f[_0x6faf('0x2e')]=_[_0x6faf('0x2f')](_0x3249c7['model'],qs['fields'](_0x10fa7f[_0x6faf('0x2c')][_0x6faf('0x30')]));_0x57612f[_0x6faf('0x2e')]=_0x57612f[_0x6faf('0x2e')]['length']?_0x57612f[_0x6faf('0x2e')]:_0x3249c7[_0x6faf('0x2b')];if(!_0x10fa7f[_0x6faf('0x2c')][_0x6faf('0x31')]('nolimit')){_0x57612f[_0x6faf('0x1b')]=qs[_0x6faf('0x1b')](_0x10fa7f[_0x6faf('0x2c')][_0x6faf('0x1b')]);_0x57612f['offset']=qs[_0x6faf('0x1a')](_0x10fa7f[_0x6faf('0x2c')]['offset']);}_0x57612f['order']=qs[_0x6faf('0x32')](_0x10fa7f[_0x6faf('0x2c')][_0x6faf('0x32')]);_0x57612f['where']=qs[_0x6faf('0x2d')](_['pick'](_0x10fa7f[_0x6faf('0x2c')],_0x3249c7['filters']),_0x28a103);if(_0x10fa7f['query'][_0x6faf('0x33')]){_0x57612f[_0x6faf('0x34')]=_[_0x6faf('0x35')](_0x57612f['where'],{'$or':_[_0x6faf('0x28')](_0x28a103,function(_0x32378c){if(_0x32378c[_0x6faf('0x2a')]!==_0x6faf('0x36')){var _0x485d89={};_0x485d89[_0x32378c['name']]={'$like':'%'+_0x10fa7f[_0x6faf('0x2c')][_0x6faf('0x33')]+'%'};return _0x485d89;}})});}_0x57612f=_[_0x6faf('0x35')]({},_0x57612f,_0x10fa7f[_0x6faf('0x37')]);var _0x4515eb={'where':_0x57612f[_0x6faf('0x34')]};return db[_0x6faf('0x29')][_0x6faf('0x1d')](_0x4515eb)[_0x6faf('0x23')](function(_0x2b8790){_0xdb0bd[_0x6faf('0x1d')]=_0x2b8790;if(_0x10fa7f[_0x6faf('0x2c')][_0x6faf('0x38')]){_0x57612f[_0x6faf('0x39')]=[{'all':!![]}];}return db[_0x6faf('0x29')]['findAll'](_0x57612f);})[_0x6faf('0x23')](function(_0x2634ef){_0xdb0bd[_0x6faf('0x3a')]=_0x2634ef;return _0xdb0bd;})[_0x6faf('0x23')](respondWithFilteredResult(_0x2451ee,_0x57612f))[_0x6faf('0x3b')](handleError(_0x2451ee,null));};exports[_0x6faf('0x3c')]=function(_0x106bc1,_0x100174){var _0xb1fc0d={'raw':![],'where':{'id':_0x106bc1['params']['id']}},_0x247019={};_0x247019[_0x6faf('0x2b')]=_['keys'](db[_0x6faf('0x29')][_0x6faf('0x3d')]);_0x247019[_0x6faf('0x2c')]=_[_0x6faf('0x3e')](_0x106bc1[_0x6faf('0x2c')]);_0x247019['filters']=_[_0x6faf('0x2f')](_0x247019[_0x6faf('0x2b')],_0x247019[_0x6faf('0x2c')]);_0xb1fc0d['attributes']=_[_0x6faf('0x2f')](_0x247019['model'],qs['fields'](_0x106bc1[_0x6faf('0x2c')][_0x6faf('0x30')]));_0xb1fc0d['attributes']=_0xb1fc0d[_0x6faf('0x2e')]['length']?_0xb1fc0d['attributes']:_0x247019[_0x6faf('0x2b')];if(_0x106bc1[_0x6faf('0x2c')][_0x6faf('0x38')]){_0xb1fc0d[_0x6faf('0x39')]=[{'all':!![]}];}_0xb1fc0d=_[_0x6faf('0x35')]({},_0xb1fc0d,_0x106bc1[_0x6faf('0x37')]);return db[_0x6faf('0x29')][_0x6faf('0x3f')](_0xb1fc0d)['then'](handleEntityNotFound(_0x100174,null))[_0x6faf('0x23')](respondWithResult(_0x100174,null))[_0x6faf('0x3b')](handleError(_0x100174,null));};exports[_0x6faf('0x40')]=function(_0x439fde,_0x54977f){return db[_0x6faf('0x29')]['create'](_0x439fde['body'],{})[_0x6faf('0x23')](respondWithResult(_0x54977f,0xc9))['catch'](handleError(_0x54977f,null));};exports[_0x6faf('0x21')]=function(_0x120e7e,_0x43a6aa){if(_0x120e7e[_0x6faf('0x41')]['id']){delete _0x120e7e[_0x6faf('0x41')]['id'];}return db[_0x6faf('0x29')][_0x6faf('0x3f')]({'where':{'id':_0x120e7e[_0x6faf('0x42')]['id']}})['then'](handleEntityNotFound(_0x43a6aa,null))['then'](saveUpdates(_0x120e7e[_0x6faf('0x41')],null))[_0x6faf('0x23')](respondWithResult(_0x43a6aa,null))[_0x6faf('0x3b')](handleError(_0x43a6aa,null));};exports[_0x6faf('0x22')]=function(_0x354fd8,_0x10d9e4){return db[_0x6faf('0x29')][_0x6faf('0x3f')]({'where':{'id':_0x354fd8[_0x6faf('0x42')]['id']}})[_0x6faf('0x23')](handleEntityNotFound(_0x10d9e4,null))['then'](removeEntity(_0x10d9e4,null))[_0x6faf('0x3b')](handleError(_0x10d9e4,null));};exports['addConditions']=function(_0x1591fe,_0x273f20,_0x461a68){return db['Condition'][_0x6faf('0x3f')]({'where':{'id':_0x1591fe[_0x6faf('0x42')]['id']}})[_0x6faf('0x23')](handleEntityNotFound(_0x273f20,null))[_0x6faf('0x23')](function(_0x266963){if(_0x266963){return _0x266963[_0x6faf('0x43')](_0x1591fe[_0x6faf('0x41')][_0x6faf('0x44')],_[_0x6faf('0x45')](_0x1591fe[_0x6faf('0x41')],[_0x6faf('0x44'),'id'])||{});}})['then'](respondWithResult(_0x273f20,null))['catch'](handleError(_0x273f20,null));};exports[_0x6faf('0x46')]=function(_0x2a14ae,_0xa8c3f8,_0x287aa3){var _0x1a5e50={};var _0x23d406={};var _0x360936;var _0x3e6131;return db[_0x6faf('0x29')][_0x6faf('0x47')]({'where':{'id':_0x2a14ae['params']['id']}})[_0x6faf('0x23')](handleEntityNotFound(_0xa8c3f8,null))[_0x6faf('0x23')](function(_0x4af886){if(_0x4af886){_0x360936=_0x4af886;_0x23d406[_0x6faf('0x2b')]=_['keys'](db[_0x6faf('0x48')][_0x6faf('0x3d')]);_0x23d406[_0x6faf('0x2c')]=_[_0x6faf('0x3e')](_0x2a14ae[_0x6faf('0x2c')]);_0x23d406[_0x6faf('0x2d')]=_[_0x6faf('0x2f')](_0x23d406[_0x6faf('0x2b')],_0x23d406[_0x6faf('0x2c')]);_0x1a5e50['attributes']=_[_0x6faf('0x2f')](_0x23d406[_0x6faf('0x2b')],qs[_0x6faf('0x30')](_0x2a14ae[_0x6faf('0x2c')]['fields']));_0x1a5e50[_0x6faf('0x2e')]=_0x1a5e50[_0x6faf('0x2e')][_0x6faf('0x49')]?_0x1a5e50[_0x6faf('0x2e')]:_0x23d406[_0x6faf('0x2b')];_0x1a5e50['order']=qs[_0x6faf('0x32')](_0x2a14ae['query'][_0x6faf('0x32')]);_0x1a5e50[_0x6faf('0x34')]=qs[_0x6faf('0x2d')](_[_0x6faf('0x4a')](_0x2a14ae[_0x6faf('0x2c')],_0x23d406['filters']));if(_0x2a14ae[_0x6faf('0x2c')][_0x6faf('0x33')]){_0x1a5e50[_0x6faf('0x34')]=_[_0x6faf('0x35')](_0x1a5e50[_0x6faf('0x34')],{'$or':_[_0x6faf('0x28')](_0x1a5e50[_0x6faf('0x2e')],function(_0x4d8307){var _0x47569d={};_0x47569d[_0x4d8307]={'$like':'%'+_0x2a14ae['query'][_0x6faf('0x33')]+'%'};return _0x47569d;})});}_0x1a5e50=_[_0x6faf('0x35')]({},_0x1a5e50,_0x2a14ae[_0x6faf('0x37')]);return _0x360936['getConditions'](_0x1a5e50);}})['then'](function(_0x21662d){if(_0x21662d){_0x3e6131=_0x21662d[_0x6faf('0x49')];if(!_0x2a14ae[_0x6faf('0x2c')]['hasOwnProperty'](_0x6faf('0x4b'))){_0x1a5e50[_0x6faf('0x1b')]=qs[_0x6faf('0x1b')](_0x2a14ae[_0x6faf('0x2c')][_0x6faf('0x1b')]);_0x1a5e50[_0x6faf('0x1a')]=qs['offset'](_0x2a14ae[_0x6faf('0x2c')][_0x6faf('0x1a')]);}return _0x360936[_0x6faf('0x46')](_0x1a5e50);}})[_0x6faf('0x23')](function(_0x4abd99){if(_0x4abd99){return _0x4abd99?{'count':_0x3e6131,'rows':_0x4abd99}:null;}})[_0x6faf('0x23')](respondWithResult(_0xa8c3f8,null))[_0x6faf('0x3b')](handleError(_0xa8c3f8,null));};exports[_0x6faf('0x4c')]=function(_0x4f7894,_0x2c3b3b,_0x5b8ad0){return db[_0x6faf('0x4d')]['find']({'where':{'id':_0x4f7894[_0x6faf('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c3b3b,null))[_0x6faf('0x23')](function(_0x4f9c0b){if(_0x4f9c0b){return _0x4f9c0b[_0x6faf('0x4c')](_0x4f7894[_0x6faf('0x41')][_0x6faf('0x44')],_[_0x6faf('0x45')](_0x4f7894[_0x6faf('0x41')],[_0x6faf('0x44'),'id'])||{});}})[_0x6faf('0x23')](respondWithResult(_0x2c3b3b,null))['catch'](handleError(_0x2c3b3b,null));};exports[_0x6faf('0x4e')]=function(_0x2bff85,_0x1f3424,_0x1be94a){var _0x3b8026={};var _0x2bc2e9={};var _0x3f7838;var _0x350054;return db[_0x6faf('0x29')]['findOne']({'where':{'id':_0x2bff85['params']['id']}})[_0x6faf('0x23')](handleEntityNotFound(_0x1f3424,null))[_0x6faf('0x23')](function(_0xca1c58){if(_0xca1c58){_0x3f7838=_0xca1c58;_0x2bc2e9['model']=_[_0x6faf('0x3e')](db[_0x6faf('0x4d')]['rawAttributes']);_0x2bc2e9[_0x6faf('0x2c')]=_[_0x6faf('0x3e')](_0x2bff85[_0x6faf('0x2c')]);_0x2bc2e9[_0x6faf('0x2d')]=_[_0x6faf('0x2f')](_0x2bc2e9[_0x6faf('0x2b')],_0x2bc2e9[_0x6faf('0x2c')]);_0x3b8026[_0x6faf('0x2e')]=_[_0x6faf('0x2f')](_0x2bc2e9['model'],qs['fields'](_0x2bff85[_0x6faf('0x2c')][_0x6faf('0x30')]));_0x3b8026[_0x6faf('0x2e')]=_0x3b8026['attributes'][_0x6faf('0x49')]?_0x3b8026[_0x6faf('0x2e')]:_0x2bc2e9[_0x6faf('0x2b')];_0x3b8026['order']=qs[_0x6faf('0x32')](_0x2bff85[_0x6faf('0x2c')][_0x6faf('0x32')]);_0x3b8026[_0x6faf('0x34')]=qs[_0x6faf('0x2d')](_[_0x6faf('0x4a')](_0x2bff85[_0x6faf('0x2c')],_0x2bc2e9[_0x6faf('0x2d')]));if(_0x2bff85[_0x6faf('0x2c')][_0x6faf('0x33')]){_0x3b8026['where']=_[_0x6faf('0x35')](_0x3b8026[_0x6faf('0x34')],{'$or':_['map'](_0x3b8026[_0x6faf('0x2e')],function(_0xf9922f){var _0x2784e8={};_0x2784e8[_0xf9922f]={'$like':'%'+_0x2bff85[_0x6faf('0x2c')]['filter']+'%'};return _0x2784e8;})});}_0x3b8026=_[_0x6faf('0x35')]({},_0x3b8026,_0x2bff85[_0x6faf('0x37')]);return _0x3f7838[_0x6faf('0x4e')](_0x3b8026);}})['then'](function(_0x66dece){if(_0x66dece){_0x350054=_0x66dece[_0x6faf('0x49')];if(!_0x2bff85[_0x6faf('0x2c')][_0x6faf('0x31')]('nolimit')){_0x3b8026[_0x6faf('0x1b')]=qs['limit'](_0x2bff85[_0x6faf('0x2c')][_0x6faf('0x1b')]);_0x3b8026[_0x6faf('0x1a')]=qs[_0x6faf('0x1a')](_0x2bff85[_0x6faf('0x2c')][_0x6faf('0x1a')]);}return _0x3f7838[_0x6faf('0x4e')](_0x3b8026);}})[_0x6faf('0x23')](function(_0x33bc82){if(_0x33bc82){return _0x33bc82?{'count':_0x350054,'rows':_0x33bc82}:null;}})[_0x6faf('0x23')](respondWithResult(_0x1f3424,null))[_0x6faf('0x3b')](handleError(_0x1f3424,null));};
\ No newline at end of file
+var _0xb5e2=['filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','find','destroy','Condition','addConditions','omit','ids','findOne','getConditions','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x45c59e,_0x20ee2d){var _0x53f2ad=function(_0x1f0b1d){while(--_0x1f0b1d){_0x45c59e['push'](_0x45c59e['shift']());}};_0x53f2ad(++_0x20ee2d);}(_0xb5e2,0x114));var _0x2b5e=function(_0x369994,_0x281aa0){_0x369994=_0x369994-0x0;var _0x3b9147=_0xb5e2[_0x369994];return _0x3b9147;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b5e('0x0'));var zipdir=require(_0x2b5e('0x1'));var jsonpatch=require(_0x2b5e('0x2'));var rp=require(_0x2b5e('0x3'));var moment=require(_0x2b5e('0x4'));var BPromise=require(_0x2b5e('0x5'));var Mustache=require(_0x2b5e('0x6'));var util=require('util');var path=require(_0x2b5e('0x7'));var sox=require(_0x2b5e('0x8'));var csv=require(_0x2b5e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b5e('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b5e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2b5e('0xc'));var toCsv=require(_0x2b5e('0x9'));var querystring=require(_0x2b5e('0xd'));var Papa=require(_0x2b5e('0xe'));var Redis=require(_0x2b5e('0xf'));var authService=require(_0x2b5e('0x10'));var qs=require(_0x2b5e('0x11'));var as=require(_0x2b5e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b5e('0x13'))(_0x2b5e('0x14'));var utils=require('../../config/utils');var config=require(_0x2b5e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2b5e('0x16'))['db'];function respondWithStatusCode(_0x1ea101,_0x311d04){_0x311d04=_0x311d04||0xcc;return function(_0x3f41ce){if(_0x3f41ce){return _0x1ea101[_0x2b5e('0x17')](_0x311d04);}return _0x1ea101[_0x2b5e('0x18')](_0x311d04)[_0x2b5e('0x19')]();};}function respondWithResult(_0x52ade9,_0x9df77f){_0x9df77f=_0x9df77f||0xc8;return function(_0x196141){if(_0x196141){return _0x52ade9[_0x2b5e('0x18')](_0x9df77f)[_0x2b5e('0x1a')](_0x196141);}};}function respondWithFilteredResult(_0x2d30f2,_0x5c8087){return function(_0x5a2af7){if(_0x5a2af7){var _0x583e06=typeof _0x5c8087[_0x2b5e('0x1b')]===_0x2b5e('0x1c')&&typeof _0x5c8087[_0x2b5e('0x1d')]===_0x2b5e('0x1c');var _0x259b2b=_0x5a2af7[_0x2b5e('0x1e')];var _0x5a7d3e=_0x583e06?0x0:_0x5c8087[_0x2b5e('0x1b')];var _0xd0cd14=_0x583e06?_0x5a2af7['count']:_0x5c8087[_0x2b5e('0x1b')]+_0x5c8087['limit'];var _0x426ab4;if(_0xd0cd14>=_0x259b2b){_0xd0cd14=_0x259b2b;_0x426ab4=0xc8;}else{_0x426ab4=0xce;}_0x2d30f2[_0x2b5e('0x18')](_0x426ab4);return _0x2d30f2[_0x2b5e('0x1f')]('Content-Range',_0x5a7d3e+'-'+_0xd0cd14+'/'+_0x259b2b)[_0x2b5e('0x1a')](_0x5a2af7);}return null;};}function patchUpdates(_0x2d97d2){return function(_0x59fd8a){try{jsonpatch[_0x2b5e('0x20')](_0x59fd8a,_0x2d97d2,!![]);}catch(_0x295ce0){return BPromise['reject'](_0x295ce0);}return _0x59fd8a[_0x2b5e('0x21')]();};}function saveUpdates(_0x97d171,_0x4b7e72){return function(_0x18d912){if(_0x18d912){return _0x18d912[_0x2b5e('0x22')](_0x97d171)[_0x2b5e('0x23')](function(_0x420853){return _0x420853;});}return null;};}function removeEntity(_0x4d8a53,_0x2fe8b6){return function(_0x1db6c6){if(_0x1db6c6){return _0x1db6c6['destroy']()[_0x2b5e('0x23')](function(){_0x4d8a53['status'](0xcc)[_0x2b5e('0x19')]();});}};}function handleEntityNotFound(_0x7994df,_0x37f230){return function(_0x20d15b){if(!_0x20d15b){_0x7994df['sendStatus'](0x194);}return _0x20d15b;};}function handleError(_0x15f0f7,_0x13c225){_0x13c225=_0x13c225||0x1f4;return function(_0x1fd31d){logger[_0x2b5e('0x24')](_0x1fd31d[_0x2b5e('0x25')]);if(_0x1fd31d[_0x2b5e('0x26')]){delete _0x1fd31d[_0x2b5e('0x26')];}_0x15f0f7['status'](_0x13c225)[_0x2b5e('0x27')](_0x1fd31d);};}exports[_0x2b5e('0x28')]=function(_0x1b6295,_0x277ecc){var _0x2a8e8f={},_0x2058ba={},_0xabec37={'count':0x0,'rows':[]};var _0x1c3cb6=_['map'](db[_0x2b5e('0x29')][_0x2b5e('0x2a')],function(_0x585ab6){return{'name':_0x585ab6[_0x2b5e('0x2b')],'type':_0x585ab6[_0x2b5e('0x2c')][_0x2b5e('0x2d')]};});_0x2058ba[_0x2b5e('0x2e')]=_['map'](_0x1c3cb6,_0x2b5e('0x26'));_0x2058ba[_0x2b5e('0x2f')]=_[_0x2b5e('0x30')](_0x1b6295[_0x2b5e('0x2f')]);_0x2058ba[_0x2b5e('0x31')]=_[_0x2b5e('0x32')](_0x2058ba['model'],_0x2058ba[_0x2b5e('0x2f')]);_0x2a8e8f['attributes']=_[_0x2b5e('0x32')](_0x2058ba[_0x2b5e('0x2e')],qs[_0x2b5e('0x33')](_0x1b6295[_0x2b5e('0x2f')][_0x2b5e('0x33')]));_0x2a8e8f['attributes']=_0x2a8e8f[_0x2b5e('0x34')][_0x2b5e('0x35')]?_0x2a8e8f[_0x2b5e('0x34')]:_0x2058ba['model'];if(!_0x1b6295[_0x2b5e('0x2f')][_0x2b5e('0x36')](_0x2b5e('0x37'))){_0x2a8e8f[_0x2b5e('0x1d')]=qs[_0x2b5e('0x1d')](_0x1b6295['query'][_0x2b5e('0x1d')]);_0x2a8e8f['offset']=qs[_0x2b5e('0x1b')](_0x1b6295['query'][_0x2b5e('0x1b')]);}_0x2a8e8f[_0x2b5e('0x38')]=qs[_0x2b5e('0x39')](_0x1b6295[_0x2b5e('0x2f')][_0x2b5e('0x39')]);_0x2a8e8f[_0x2b5e('0x3a')]=qs['filters'](_[_0x2b5e('0x3b')](_0x1b6295[_0x2b5e('0x2f')],_0x2058ba[_0x2b5e('0x31')]),_0x1c3cb6);if(_0x1b6295[_0x2b5e('0x2f')][_0x2b5e('0x3c')]){_0x2a8e8f[_0x2b5e('0x3a')]=_[_0x2b5e('0x3d')](_0x2a8e8f[_0x2b5e('0x3a')],{'$or':_[_0x2b5e('0x3e')](_0x1c3cb6,function(_0x596589){if(_0x596589[_0x2b5e('0x2c')]!==_0x2b5e('0x3f')){var _0x5354ed={};_0x5354ed[_0x596589[_0x2b5e('0x26')]]={'$like':'%'+_0x1b6295['query'][_0x2b5e('0x3c')]+'%'};return _0x5354ed;}})});}_0x2a8e8f=_[_0x2b5e('0x3d')]({},_0x2a8e8f,_0x1b6295[_0x2b5e('0x40')]);var _0x13445e={'where':_0x2a8e8f['where']};return db[_0x2b5e('0x29')][_0x2b5e('0x1e')](_0x13445e)[_0x2b5e('0x23')](function(_0x201e3d){_0xabec37['count']=_0x201e3d;if(_0x1b6295[_0x2b5e('0x2f')][_0x2b5e('0x41')]){_0x2a8e8f[_0x2b5e('0x42')]=[{'all':!![]}];}return db[_0x2b5e('0x29')][_0x2b5e('0x43')](_0x2a8e8f);})[_0x2b5e('0x23')](function(_0x567d51){_0xabec37['rows']=_0x567d51;return _0xabec37;})[_0x2b5e('0x23')](respondWithFilteredResult(_0x277ecc,_0x2a8e8f))['catch'](handleError(_0x277ecc,null));};exports[_0x2b5e('0x44')]=function(_0x5748c6,_0x57e584){var _0x328c6e={'raw':![],'where':{'id':_0x5748c6[_0x2b5e('0x45')]['id']}},_0x3033d0={};_0x3033d0[_0x2b5e('0x2e')]=_['keys'](db[_0x2b5e('0x29')]['rawAttributes']);_0x3033d0['query']=_[_0x2b5e('0x30')](_0x5748c6[_0x2b5e('0x2f')]);_0x3033d0[_0x2b5e('0x31')]=_[_0x2b5e('0x32')](_0x3033d0[_0x2b5e('0x2e')],_0x3033d0[_0x2b5e('0x2f')]);_0x328c6e[_0x2b5e('0x34')]=_[_0x2b5e('0x32')](_0x3033d0[_0x2b5e('0x2e')],qs[_0x2b5e('0x33')](_0x5748c6['query'][_0x2b5e('0x33')]));_0x328c6e[_0x2b5e('0x34')]=_0x328c6e[_0x2b5e('0x34')][_0x2b5e('0x35')]?_0x328c6e[_0x2b5e('0x34')]:_0x3033d0[_0x2b5e('0x2e')];if(_0x5748c6[_0x2b5e('0x2f')][_0x2b5e('0x41')]){_0x328c6e[_0x2b5e('0x42')]=[{'all':!![]}];}_0x328c6e=_['merge']({},_0x328c6e,_0x5748c6['options']);return db[_0x2b5e('0x29')]['find'](_0x328c6e)['then'](handleEntityNotFound(_0x57e584,null))[_0x2b5e('0x23')](respondWithResult(_0x57e584,null))[_0x2b5e('0x46')](handleError(_0x57e584,null));};exports[_0x2b5e('0x47')]=function(_0x13db1d,_0x19f476){return db[_0x2b5e('0x29')][_0x2b5e('0x47')](_0x13db1d[_0x2b5e('0x48')],{})[_0x2b5e('0x23')](respondWithResult(_0x19f476,0xc9))[_0x2b5e('0x46')](handleError(_0x19f476,null));};exports[_0x2b5e('0x22')]=function(_0x4918a9,_0x326f0a){if(_0x4918a9[_0x2b5e('0x48')]['id']){delete _0x4918a9[_0x2b5e('0x48')]['id'];}return db['Automation'][_0x2b5e('0x49')]({'where':{'id':_0x4918a9['params']['id']}})[_0x2b5e('0x23')](handleEntityNotFound(_0x326f0a,null))['then'](saveUpdates(_0x4918a9[_0x2b5e('0x48')],null))[_0x2b5e('0x23')](respondWithResult(_0x326f0a,null))[_0x2b5e('0x46')](handleError(_0x326f0a,null));};exports[_0x2b5e('0x4a')]=function(_0x5476f8,_0x262cd3){return db[_0x2b5e('0x29')][_0x2b5e('0x49')]({'where':{'id':_0x5476f8['params']['id']}})['then'](handleEntityNotFound(_0x262cd3,null))[_0x2b5e('0x23')](removeEntity(_0x262cd3,null))[_0x2b5e('0x46')](handleError(_0x262cd3,null));};exports['addConditions']=function(_0x3be665,_0x5edeba,_0x40c504){return db[_0x2b5e('0x4b')]['find']({'where':{'id':_0x3be665[_0x2b5e('0x45')]['id']}})[_0x2b5e('0x23')](handleEntityNotFound(_0x5edeba,null))[_0x2b5e('0x23')](function(_0x2f1d3c){if(_0x2f1d3c){return _0x2f1d3c[_0x2b5e('0x4c')](_0x3be665['body']['ids'],_[_0x2b5e('0x4d')](_0x3be665[_0x2b5e('0x48')],[_0x2b5e('0x4e'),'id'])||{});}})[_0x2b5e('0x23')](respondWithResult(_0x5edeba,null))[_0x2b5e('0x46')](handleError(_0x5edeba,null));};exports['getConditions']=function(_0x4b0b56,_0x300b86,_0x141aea){var _0x52f13a={};var _0x2ac85b={};var _0x2d467c;var _0x36a6eb;return db[_0x2b5e('0x29')][_0x2b5e('0x4f')]({'where':{'id':_0x4b0b56[_0x2b5e('0x45')]['id']}})[_0x2b5e('0x23')](handleEntityNotFound(_0x300b86,null))[_0x2b5e('0x23')](function(_0x291b38){if(_0x291b38){_0x2d467c=_0x291b38;_0x2ac85b['model']=_[_0x2b5e('0x30')](db[_0x2b5e('0x4b')][_0x2b5e('0x2a')]);_0x2ac85b[_0x2b5e('0x2f')]=_[_0x2b5e('0x30')](_0x4b0b56[_0x2b5e('0x2f')]);_0x2ac85b['filters']=_[_0x2b5e('0x32')](_0x2ac85b[_0x2b5e('0x2e')],_0x2ac85b[_0x2b5e('0x2f')]);_0x52f13a[_0x2b5e('0x34')]=_['intersection'](_0x2ac85b[_0x2b5e('0x2e')],qs[_0x2b5e('0x33')](_0x4b0b56[_0x2b5e('0x2f')][_0x2b5e('0x33')]));_0x52f13a[_0x2b5e('0x34')]=_0x52f13a[_0x2b5e('0x34')][_0x2b5e('0x35')]?_0x52f13a[_0x2b5e('0x34')]:_0x2ac85b['model'];_0x52f13a[_0x2b5e('0x38')]=qs[_0x2b5e('0x39')](_0x4b0b56[_0x2b5e('0x2f')][_0x2b5e('0x39')]);_0x52f13a['where']=qs[_0x2b5e('0x31')](_['pick'](_0x4b0b56[_0x2b5e('0x2f')],_0x2ac85b[_0x2b5e('0x31')]));if(_0x4b0b56[_0x2b5e('0x2f')][_0x2b5e('0x3c')]){_0x52f13a[_0x2b5e('0x3a')]=_[_0x2b5e('0x3d')](_0x52f13a[_0x2b5e('0x3a')],{'$or':_[_0x2b5e('0x3e')](_0x52f13a[_0x2b5e('0x34')],function(_0x41391a){var _0x42394a={};_0x42394a[_0x41391a]={'$like':'%'+_0x4b0b56[_0x2b5e('0x2f')][_0x2b5e('0x3c')]+'%'};return _0x42394a;})});}_0x52f13a=_[_0x2b5e('0x3d')]({},_0x52f13a,_0x4b0b56[_0x2b5e('0x40')]);return _0x2d467c['getConditions'](_0x52f13a);}})[_0x2b5e('0x23')](function(_0x567764){if(_0x567764){_0x36a6eb=_0x567764[_0x2b5e('0x35')];if(!_0x4b0b56[_0x2b5e('0x2f')][_0x2b5e('0x36')](_0x2b5e('0x37'))){_0x52f13a[_0x2b5e('0x1d')]=qs[_0x2b5e('0x1d')](_0x4b0b56[_0x2b5e('0x2f')][_0x2b5e('0x1d')]);_0x52f13a[_0x2b5e('0x1b')]=qs[_0x2b5e('0x1b')](_0x4b0b56['query']['offset']);}return _0x2d467c[_0x2b5e('0x50')](_0x52f13a);}})[_0x2b5e('0x23')](function(_0x1acf8e){if(_0x1acf8e){return _0x1acf8e?{'count':_0x36a6eb,'rows':_0x1acf8e}:null;}})[_0x2b5e('0x23')](respondWithResult(_0x300b86,null))[_0x2b5e('0x46')](handleError(_0x300b86,null));};exports[_0x2b5e('0x51')]=function(_0x443a2e,_0x25e2ea,_0x26c34b){return db[_0x2b5e('0x52')][_0x2b5e('0x49')]({'where':{'id':_0x443a2e[_0x2b5e('0x45')]['id']}})[_0x2b5e('0x23')](handleEntityNotFound(_0x25e2ea,null))[_0x2b5e('0x23')](function(_0x2ad6eb){if(_0x2ad6eb){return _0x2ad6eb['addActions'](_0x443a2e[_0x2b5e('0x48')][_0x2b5e('0x4e')],_['omit'](_0x443a2e[_0x2b5e('0x48')],[_0x2b5e('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x25e2ea,null))[_0x2b5e('0x46')](handleError(_0x25e2ea,null));};exports[_0x2b5e('0x53')]=function(_0x547f6e,_0x32ea5a,_0x2cd58f){var _0x558c0a={};var _0x5f2296={};var _0x28680a;var _0x40a103;return db['Automation']['findOne']({'where':{'id':_0x547f6e[_0x2b5e('0x45')]['id']}})['then'](handleEntityNotFound(_0x32ea5a,null))[_0x2b5e('0x23')](function(_0x5d772f){if(_0x5d772f){_0x28680a=_0x5d772f;_0x5f2296[_0x2b5e('0x2e')]=_[_0x2b5e('0x30')](db[_0x2b5e('0x52')][_0x2b5e('0x2a')]);_0x5f2296[_0x2b5e('0x2f')]=_[_0x2b5e('0x30')](_0x547f6e[_0x2b5e('0x2f')]);_0x5f2296[_0x2b5e('0x31')]=_['intersection'](_0x5f2296[_0x2b5e('0x2e')],_0x5f2296['query']);_0x558c0a['attributes']=_[_0x2b5e('0x32')](_0x5f2296[_0x2b5e('0x2e')],qs['fields'](_0x547f6e[_0x2b5e('0x2f')]['fields']));_0x558c0a[_0x2b5e('0x34')]=_0x558c0a['attributes'][_0x2b5e('0x35')]?_0x558c0a[_0x2b5e('0x34')]:_0x5f2296[_0x2b5e('0x2e')];_0x558c0a[_0x2b5e('0x38')]=qs[_0x2b5e('0x39')](_0x547f6e['query']['sort']);_0x558c0a[_0x2b5e('0x3a')]=qs[_0x2b5e('0x31')](_[_0x2b5e('0x3b')](_0x547f6e['query'],_0x5f2296[_0x2b5e('0x31')]));if(_0x547f6e[_0x2b5e('0x2f')][_0x2b5e('0x3c')]){_0x558c0a[_0x2b5e('0x3a')]=_[_0x2b5e('0x3d')](_0x558c0a[_0x2b5e('0x3a')],{'$or':_[_0x2b5e('0x3e')](_0x558c0a[_0x2b5e('0x34')],function(_0x4a999a){var _0x54e2fe={};_0x54e2fe[_0x4a999a]={'$like':'%'+_0x547f6e[_0x2b5e('0x2f')]['filter']+'%'};return _0x54e2fe;})});}_0x558c0a=_[_0x2b5e('0x3d')]({},_0x558c0a,_0x547f6e[_0x2b5e('0x40')]);return _0x28680a['getActions'](_0x558c0a);}})[_0x2b5e('0x23')](function(_0x10ab43){if(_0x10ab43){_0x40a103=_0x10ab43[_0x2b5e('0x35')];if(!_0x547f6e[_0x2b5e('0x2f')][_0x2b5e('0x36')](_0x2b5e('0x37'))){_0x558c0a[_0x2b5e('0x1d')]=qs['limit'](_0x547f6e[_0x2b5e('0x2f')]['limit']);_0x558c0a['offset']=qs[_0x2b5e('0x1b')](_0x547f6e['query'][_0x2b5e('0x1b')]);}return _0x28680a[_0x2b5e('0x53')](_0x558c0a);}})['then'](function(_0x4f342c){if(_0x4f342c){return _0x4f342c?{'count':_0x40a103,'rows':_0x4f342c}:null;}})[_0x2b5e('0x23')](respondWithResult(_0x32ea5a,null))['catch'](handleError(_0x32ea5a,null));};
\ No newline at end of file
index 555f0d7..f307710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4799=['Automation','lodash','api','path','../../config/environment','./automation.attributes','exports','define'];(function(_0x5219e4,_0x50cdef){var _0x390418=function(_0x589678){while(--_0x589678){_0x5219e4['push'](_0x5219e4['shift']());}};_0x390418(++_0x50cdef);}(_0x4799,0x179));var _0x9479=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4799[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x9479('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9479('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9479('0x2'));var rimraf=require('rimraf');var config=require(_0x9479('0x3'));var attributes=require(_0x9479('0x4'));module[_0x9479('0x5')]=function(_0x29c8e1,_0x2240b2){return _0x29c8e1[_0x9479('0x6')](_0x9479('0x7'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc2bc=['util','bluebird','request-promise','define','Automation','tools_automations','lodash'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xc2bc,0x14f));var _0xcc2b=function(_0x20948b,_0x4f5ad9){_0x20948b=_0x20948b-0x0;var _0x45a1ad=_0xc2bc[_0x20948b];return _0x45a1ad;};'use strict';var _=require(_0xcc2b('0x0'));var util=require(_0xcc2b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcc2b('0x2'));var rp=require(_0xcc2b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./automation.attributes');module['exports']=function(_0x382a9b,_0x1121c0){return _0x382a9b[_0xcc2b('0x4')](_0xcc2b('0x5'),attributes,{'tableName':_0xcc2b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b846e51..62ef70b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30d6=['client','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x5ad190,_0xd39c9e){var _0x518ed3=function(_0x57f03a){while(--_0x57f03a){_0x5ad190['push'](_0x5ad190['shift']());}};_0x518ed3(++_0xd39c9e);}(_0x30d6,0x1b0));var _0x630d=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0x30d6[_0x3c5e54];return _0x3ae1f3;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var moment=require('moment');var BPromise=require(_0x630d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630d('0x3'));var db=require(_0x630d('0x4'))['db'];var utils=require(_0x630d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x630d('0x6'));var jayson=require(_0x630d('0x7'));var client=jayson[_0x630d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8950bb,_0x3aa6f4,_0x2c1b77){return new BPromise(function(_0x4b60c1,_0x533e4f){return client[_0x630d('0x9')](_0x8950bb,_0x2c1b77)[_0x630d('0xa')](function(_0x24d260){logger[_0x630d('0xb')]('Automation,\x20%s,\x20%s',_0x3aa6f4,_0x630d('0xc'));logger[_0x630d('0xd')](_0x630d('0xe'),_0x3aa6f4,_0x630d('0xc'),JSON[_0x630d('0xf')](_0x24d260));if(_0x24d260[_0x630d('0x10')]){if(_0x24d260[_0x630d('0x10')][_0x630d('0x11')]===0x1f4){logger[_0x630d('0x10')](_0x630d('0x12'),_0x3aa6f4,_0x24d260['error'][_0x630d('0x13')]);return _0x533e4f(_0x24d260['error'][_0x630d('0x13')]);}logger[_0x630d('0x10')]('Automation,\x20%s,\x20%s',_0x3aa6f4,_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);return _0x4b60c1(_0x24d260[_0x630d('0x10')][_0x630d('0x13')]);}else{logger[_0x630d('0xb')](_0x630d('0x12'),_0x3aa6f4,_0x630d('0xc'));_0x4b60c1(_0x24d260[_0x630d('0x14')]['message']);}})[_0x630d('0x15')](function(_0x4db79d){logger[_0x630d('0x10')]('Automation,\x20%s,\x20%s',_0x3aa6f4,_0x4db79d);_0x533e4f(_0x4db79d);});});}
\ No newline at end of file
+var _0x337f=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x158130,_0x460536){var _0x56740e=function(_0x2f6712){while(--_0x2f6712){_0x158130['push'](_0x158130['shift']());}};_0x56740e(++_0x460536);}(_0x337f,0x11c));var _0xf337=function(_0x163df5,_0xf1211c){_0x163df5=_0x163df5-0x0;var _0x189b79=_0x337f[_0x163df5];return _0x189b79;};'use strict';var _=require(_0xf337('0x0'));var util=require(_0xf337('0x1'));var moment=require(_0xf337('0x2'));var BPromise=require('bluebird');var rs=require(_0xf337('0x3'));var fs=require('fs');var Redis=require(_0xf337('0x4'));var db=require(_0xf337('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf337('0x6'))(_0xf337('0x7'));var config=require('../../config/environment');var jayson=require(_0xf337('0x8'));var client=jayson['client'][_0xf337('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ae4d6,_0x2be604,_0x56bd39){return new BPromise(function(_0x4b80a2,_0x1f0a95){return client[_0xf337('0xa')](_0x5ae4d6,_0x56bd39)[_0xf337('0xb')](function(_0x2a4619){logger[_0xf337('0xc')](_0xf337('0xd'),_0x2be604,_0xf337('0xe'));logger[_0xf337('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x2be604,_0xf337('0xe'),JSON[_0xf337('0x10')](_0x2a4619));if(_0x2a4619[_0xf337('0x11')]){if(_0x2a4619[_0xf337('0x11')][_0xf337('0x12')]===0x1f4){logger[_0xf337('0x11')](_0xf337('0xd'),_0x2be604,_0x2a4619[_0xf337('0x11')][_0xf337('0x13')]);return _0x1f0a95(_0x2a4619[_0xf337('0x11')][_0xf337('0x13')]);}logger[_0xf337('0x11')]('Automation,\x20%s,\x20%s',_0x2be604,_0x2a4619[_0xf337('0x11')][_0xf337('0x13')]);return _0x4b80a2(_0x2a4619[_0xf337('0x11')]['message']);}else{logger[_0xf337('0xc')](_0xf337('0xd'),_0x2be604,'request\x20sent');_0x4b80a2(_0x2a4619[_0xf337('0x14')][_0xf337('0x13')]);}})[_0xf337('0x15')](function(_0x4a7e4c){logger[_0xf337('0x11')]('Automation,\x20%s,\x20%s',_0x2be604,_0x4a7e4c);_0x1f0a95(_0x4a7e4c);});});}
\ No newline at end of file
index a19777e..1b52da6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ba=['isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x43be21,_0x1a1140){var _0x535370=function(_0x5a8d39){while(--_0x5a8d39){_0x43be21['push'](_0x43be21['shift']());}};_0x535370(++_0x1a1140);}(_0x17ba,0xab));var _0xa17b=function(_0x484f44,_0x289ce0){_0x484f44=_0x484f44-0x0;var _0x468ae5=_0x17ba[_0x484f44];return _0x468ae5;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router['get'](_0xa17b('0x11'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x12')]);router[_0xa17b('0x13')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x14')]);router[_0xa17b('0x13')]('/:id/conditions',auth[_0xa17b('0xb')](),controller[_0xa17b('0x15')]);router[_0xa17b('0x13')]('/:id/actions',auth[_0xa17b('0xb')](),controller[_0xa17b('0x16')]);router[_0xa17b('0x17')](_0xa17b('0xd'),auth['isAuthenticated'](),controller[_0xa17b('0x18')]);router['delete'](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller['destroy']);module[_0xa17b('0x19')]=router;
\ No newline at end of file
+var _0x44d5=['put','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','post','addConditions'];(function(_0x15dae4,_0x1e71d0){var _0x51bd9f=function(_0x21cf95){while(--_0x21cf95){_0x15dae4['push'](_0x15dae4['shift']());}};_0x51bd9f(++_0x1e71d0);}(_0x44d5,0x1a5));var _0x544d=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0x44d5[_0x9b3efc];return _0x200f05;};'use strict';var multer=require(_0x544d('0x0'));var util=require(_0x544d('0x1'));var path=require('path');var timeout=require(_0x544d('0x2'));var express=require('express');var router=express[_0x544d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x544d('0x4'));var interaction=require(_0x544d('0x5'));var config=require(_0x544d('0x6'));var controller=require('./automation.controller');router[_0x544d('0x7')]('/',auth['isAuthenticated'](),controller[_0x544d('0x8')]);router[_0x544d('0x7')](_0x544d('0x9'),auth[_0x544d('0xa')](),controller[_0x544d('0xb')]);router[_0x544d('0x7')](_0x544d('0xc'),auth[_0x544d('0xa')](),controller[_0x544d('0xd')]);router[_0x544d('0x7')]('/:id/actions',auth[_0x544d('0xa')](),controller['getActions']);router[_0x544d('0xe')]('/',auth[_0x544d('0xa')](),controller['create']);router['post']('/:id/conditions',auth[_0x544d('0xa')](),controller[_0x544d('0xf')]);router[_0x544d('0xe')]('/:id/actions',auth['isAuthenticated'](),controller['addActions']);router[_0x544d('0x10')](_0x544d('0x9'),auth[_0x544d('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x544d('0x11')]);module[_0x544d('0x12')]=router;
\ No newline at end of file
index 673dbb6..8d9d376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0428=['sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\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)'];(function(_0x38c24b,_0x5a4734){var _0x4f8737=function(_0x4da2ee){while(--_0x4da2ee){_0x38c24b['push'](_0x38c24b['shift']());}};_0x4f8737(++_0x5a4734);}(_0x0428,0x128));var _0x8042=function(_0x168677,_0x479b42){_0x168677=_0x168677-0x0;var _0x171098=_0x0428[_0x168677];return _0x171098;};'use strict';var Sequelize=require(_0x8042('0x0'));module[_0x8042('0x1')]={'name':{'type':Sequelize[_0x8042('0x2')],'unique':_0x8042('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8042('0x4')](_0x8042('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x8042('0x2')]},'active':{'type':Sequelize[_0x8042('0x6')],'defaultValue':0x0,'comment':_0x8042('0x7')},'limitCalls':{'type':Sequelize[_0x8042('0x8')](0x4)[_0x8042('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8042('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8042('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8042('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8042('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8042('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8042('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8042('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8042('0x8')](0x5)[_0x8042('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8042('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x8042('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8042('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8042('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8042('0x9')],'defaultValue':0x3,'comment':_0x8042('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x8042('0x8')](0x5)[_0x8042('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8042('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8042('0x8')](0x3)[_0x8042('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x8042('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8042('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x8042('0x4')](_0x8042('0x11'),'never','onlyIfOpen'),'defaultValue':_0x8042('0x11')},'dialAMDActive':{'type':Sequelize[_0x8042('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8042('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8042('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x8042('0x8')](0x9)[_0x8042('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8042('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8042('0x8')](0x9)[_0x8042('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8042('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8042('0x8')](0x9)[_0x8042('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x8042('0x8')](0x9)[_0x8042('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x8042('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8042('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8042('0x8')](0x9)[_0x8042('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8042('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x8042('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8042('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8042('0x8')](0x9)[_0x8042('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8042('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8042('0x4')](_0x8042('0x19'),_0x8042('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x8042('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8042('0x1b')},'dialCutDigit':{'type':Sequelize[_0x8042('0x8')](0x3)[_0x8042('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8042('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8042('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8042('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8042('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8042('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x8042('0x8')](0x3)[_0x8042('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8042('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8042('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8042('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8042('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8042('0x8')](0x5)[_0x8042('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8042('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x8042('0x8')](0x3)[_0x8042('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8042('0x8')](0x5)[_0x8042('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8042('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8042('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8042('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8042('0x24')}};
\ No newline at end of file
+var _0x020c=['ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#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','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0x020c,0xf8));var _0xc020=function(_0x17ff81,_0x4da158){_0x17ff81=_0x17ff81-0x0;var _0x431729=_0x020c[_0x17ff81];return _0x431729;};'use strict';var Sequelize=require(_0xc020('0x0'));module[_0xc020('0x1')]={'name':{'type':Sequelize[_0xc020('0x2')],'unique':_0xc020('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc020('0x4')](_0xc020('0x5')),'allowNull':![],'defaultValue':_0xc020('0x5')},'description':{'type':Sequelize[_0xc020('0x2')]},'active':{'type':Sequelize[_0xc020('0x6')],'defaultValue':0x0,'comment':_0xc020('0x7')},'limitCalls':{'type':Sequelize[_0xc020('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xc020('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc020('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xc020('0x8')](0x3)[_0xc020('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc020('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc020('0x8')](0x3)[_0xc020('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc020('0x8')](0x5)[_0xc020('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc020('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xc020('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc020('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc020('0x8')](0x5)[_0xc020('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc020('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc020('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc020('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc020('0x8')](0x3)[_0xc020('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc020('0xe')},'dialTimezone':{'type':Sequelize[_0xc020('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0xc020('0xf'),_0xc020('0x10')),'defaultValue':_0xc020('0x11')},'dialAMDActive':{'type':Sequelize[_0xc020('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xc020('0x8')](0x9)[_0xc020('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc020('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xc020('0x8')](0x9)[_0xc020('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc020('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc020('0x8')](0x9)[_0xc020('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc020('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc020('0x8')](0x9)[_0xc020('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xc020('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc020('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc020('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc020('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc020('0x8')](0x9)[_0xc020('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc020('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc020('0x8')](0x5)[_0xc020('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc020('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc020('0x8')](0x9)[_0xc020('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc020('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xc020('0x1a'),_0xc020('0x1b')),'defaultValue':_0xc020('0x1a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xc020('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc020('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xc020('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc020('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc020('0x8')](0x3)[_0xc020('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc020('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc020('0x8')](0x5)[_0xc020('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xc020('0x8')](0x3)[_0xc020('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc020('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc020('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc020('0x8')](0x3)[_0xc020('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc020('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc020('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0xc020('0x8')](0x3)[_0xc020('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xc020('0x8')](0x5)[_0xc020('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc020('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xc020('0x8')](0x3)[_0xc020('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc020('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc020('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc020('0x23')}};
\ No newline at end of file
index 5269d5c..c7e3c24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a47=['getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','map','Campaign','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','omit','createdAt','updatedAt','userProfileId','update','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','sort'];(function(_0x5757e1,_0x1616a6){var _0x44400c=function(_0x3b93a6){while(--_0x3b93a6){_0x5757e1['push'](_0x5757e1['shift']());}};_0x44400c(++_0x1616a6);}(_0x8a47,0x1c3));var _0x78a4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8a47[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x78a4('0x0'));var rimraf=require(_0x78a4('0x1'));var zipdir=require(_0x78a4('0x2'));var jsonpatch=require(_0x78a4('0x3'));var rp=require('request-promise');var moment=require(_0x78a4('0x4'));var BPromise=require(_0x78a4('0x5'));var Mustache=require(_0x78a4('0x6'));var util=require(_0x78a4('0x7'));var path=require(_0x78a4('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x78a4('0x9'));var fs=require('fs');var fs_extra=require(_0x78a4('0xa'));var _=require('lodash');var squel=require(_0x78a4('0xb'));var crypto=require(_0x78a4('0xc'));var jsforce=require(_0x78a4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x78a4('0xe'));var querystring=require(_0x78a4('0xf'));var Papa=require(_0x78a4('0x10'));var Redis=require(_0x78a4('0x11'));var authService=require(_0x78a4('0x12'));var qs=require(_0x78a4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78a4('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x78a4('0x15'));var config=require(_0x78a4('0x16'));var licenseUtil=require(_0x78a4('0x17'));var db=require(_0x78a4('0x18'))['db'];function respondWithStatusCode(_0x25b38c,_0x5beba6){_0x5beba6=_0x5beba6||0xcc;return function(_0x2670bb){if(_0x2670bb){return _0x25b38c[_0x78a4('0x19')](_0x5beba6);}return _0x25b38c[_0x78a4('0x1a')](_0x5beba6)[_0x78a4('0x1b')]();};}function respondWithResult(_0x39f079,_0x17e9c5){_0x17e9c5=_0x17e9c5||0xc8;return function(_0x4914ca){if(_0x4914ca){return _0x39f079[_0x78a4('0x1a')](_0x17e9c5)['json'](_0x4914ca);}};}function respondWithFilteredResult(_0x1fe92e,_0x39bccd){return function(_0x3d1103){if(_0x3d1103){var _0x105b55=typeof _0x39bccd[_0x78a4('0x1c')]===_0x78a4('0x1d')&&typeof _0x39bccd[_0x78a4('0x1e')]===_0x78a4('0x1d');var _0x53a3ad=_0x3d1103[_0x78a4('0x1f')];var _0x23cdfe=_0x105b55?0x0:_0x39bccd['offset'];var _0x261562=_0x105b55?_0x3d1103[_0x78a4('0x1f')]:_0x39bccd[_0x78a4('0x1c')]+_0x39bccd['limit'];var _0x41f3a2;if(_0x261562>=_0x53a3ad){_0x261562=_0x53a3ad;_0x41f3a2=0xc8;}else{_0x41f3a2=0xce;}_0x1fe92e['status'](_0x41f3a2);return _0x1fe92e[_0x78a4('0x20')](_0x78a4('0x21'),_0x23cdfe+'-'+_0x261562+'/'+_0x53a3ad)['json'](_0x3d1103);}return null;};}function patchUpdates(_0x18bd6e){return function(_0x1206f3){try{jsonpatch[_0x78a4('0x22')](_0x1206f3,_0x18bd6e,!![]);}catch(_0x3ea42f){return BPromise[_0x78a4('0x23')](_0x3ea42f);}return _0x1206f3[_0x78a4('0x24')]();};}function saveUpdates(_0x4cd36e,_0x1ba20f){return function(_0x5c5e02){if(_0x5c5e02){return _0x5c5e02['update'](_0x4cd36e)[_0x78a4('0x25')](function(_0xcb28f4){return _0xcb28f4;});}return null;};}function removeEntity(_0x3aafcd,_0x587335){return function(_0x86a20f){if(_0x86a20f){return _0x86a20f[_0x78a4('0x26')]()[_0x78a4('0x25')](function(){var _0x4ff08b=_0x86a20f[_0x78a4('0x27')]({'plain':!![]});var _0x537465=_0x78a4('0x28');return db[_0x78a4('0x29')][_0x78a4('0x26')]({'where':{'type':_0x537465,'resourceId':_0x4ff08b['id']}})[_0x78a4('0x25')](function(){return _0x86a20f;});})[_0x78a4('0x25')](function(){_0x3aafcd[_0x78a4('0x1a')](0xcc)[_0x78a4('0x1b')]();});}};}function handleEntityNotFound(_0x2952ec,_0x3ae50a){return function(_0x330cfe){if(!_0x330cfe){_0x2952ec['sendStatus'](0x194);}return _0x330cfe;};}function handleError(_0x4fc901,_0x4cc1c1){_0x4cc1c1=_0x4cc1c1||0x1f4;return function(_0x498ab5){logger[_0x78a4('0x2a')](_0x498ab5[_0x78a4('0x2b')]);if(_0x498ab5[_0x78a4('0x2c')]){delete _0x498ab5[_0x78a4('0x2c')];}_0x4fc901['status'](_0x4cc1c1)['send'](_0x498ab5);};}exports[_0x78a4('0x2d')]=function(_0x49cead,_0x5bf082){var _0x1dd800={},_0x2e14c8={},_0x240acb={'count':0x0,'rows':[]};var _0x4108cb=_[_0x78a4('0x2e')](db[_0x78a4('0x2f')][_0x78a4('0x30')],function(_0x1a4dc8){return{'name':_0x1a4dc8[_0x78a4('0x31')],'type':_0x1a4dc8['type']['key']};});_0x2e14c8[_0x78a4('0x32')]=_[_0x78a4('0x2e')](_0x4108cb,'name');_0x2e14c8[_0x78a4('0x33')]=_[_0x78a4('0x34')](_0x49cead['query']);_0x2e14c8[_0x78a4('0x35')]=_[_0x78a4('0x36')](_0x2e14c8[_0x78a4('0x32')],_0x2e14c8['query']);_0x1dd800[_0x78a4('0x37')]=_[_0x78a4('0x36')](_0x2e14c8[_0x78a4('0x32')],qs[_0x78a4('0x38')](_0x49cead[_0x78a4('0x33')][_0x78a4('0x38')]));_0x1dd800['attributes']=_0x1dd800[_0x78a4('0x37')][_0x78a4('0x39')]?_0x1dd800[_0x78a4('0x37')]:_0x2e14c8[_0x78a4('0x32')];if(!_0x49cead[_0x78a4('0x33')][_0x78a4('0x3a')](_0x78a4('0x3b'))){_0x1dd800[_0x78a4('0x1e')]=qs[_0x78a4('0x1e')](_0x49cead[_0x78a4('0x33')][_0x78a4('0x1e')]);_0x1dd800['offset']=qs[_0x78a4('0x1c')](_0x49cead[_0x78a4('0x33')][_0x78a4('0x1c')]);}_0x1dd800[_0x78a4('0x3c')]=qs['sort'](_0x49cead[_0x78a4('0x33')]['sort']);_0x1dd800[_0x78a4('0x3d')]=qs[_0x78a4('0x35')](_[_0x78a4('0x3e')](_0x49cead[_0x78a4('0x33')],_0x2e14c8[_0x78a4('0x35')]),_0x4108cb);if(_0x49cead[_0x78a4('0x33')]['filter']){_0x1dd800['where']=_[_0x78a4('0x3f')](_0x1dd800['where'],{'$or':_['map'](_0x4108cb,function(_0x36c567){if(_0x36c567['type']!==_0x78a4('0x40')){var _0x4020a3={};_0x4020a3[_0x36c567[_0x78a4('0x2c')]]={'$like':'%'+_0x49cead['query'][_0x78a4('0x41')]+'%'};return _0x4020a3;}})});}_0x1dd800=_['merge']({},_0x1dd800,_0x49cead[_0x78a4('0x42')]);var _0x63f6e1={'where':_0x1dd800[_0x78a4('0x3d')]};return db[_0x78a4('0x2f')]['count'](_0x63f6e1)[_0x78a4('0x25')](function(_0x682e6a){_0x240acb[_0x78a4('0x1f')]=_0x682e6a;if(_0x49cead[_0x78a4('0x33')][_0x78a4('0x43')]){_0x1dd800[_0x78a4('0x44')]=[{'all':!![]}];}return db[_0x78a4('0x2f')][_0x78a4('0x45')](_0x1dd800);})[_0x78a4('0x25')](function(_0x27d1b9){_0x240acb[_0x78a4('0x46')]=_0x27d1b9;return _0x240acb;})[_0x78a4('0x25')](respondWithFilteredResult(_0x5bf082,_0x1dd800))['catch'](handleError(_0x5bf082,null));};exports['show']=function(_0x75320f,_0x2b4c01){var _0x236b11={'raw':![],'where':{'id':_0x75320f[_0x78a4('0x47')]['id']}},_0x13a266={};_0x13a266[_0x78a4('0x32')]=_[_0x78a4('0x34')](db[_0x78a4('0x2f')]['rawAttributes']);_0x13a266['query']=_[_0x78a4('0x34')](_0x75320f[_0x78a4('0x33')]);_0x13a266[_0x78a4('0x35')]=_[_0x78a4('0x36')](_0x13a266[_0x78a4('0x32')],_0x13a266[_0x78a4('0x33')]);_0x236b11[_0x78a4('0x37')]=_[_0x78a4('0x36')](_0x13a266[_0x78a4('0x32')],qs[_0x78a4('0x38')](_0x75320f[_0x78a4('0x33')][_0x78a4('0x38')]));_0x236b11['attributes']=_0x236b11[_0x78a4('0x37')][_0x78a4('0x39')]?_0x236b11[_0x78a4('0x37')]:_0x13a266[_0x78a4('0x32')];if(_0x75320f[_0x78a4('0x33')]['includeAll']){_0x236b11['include']=[{'all':!![]}];}_0x236b11=_['merge']({},_0x236b11,_0x75320f[_0x78a4('0x42')]);return db[_0x78a4('0x2f')][_0x78a4('0x48')](_0x236b11)['then'](handleEntityNotFound(_0x2b4c01,null))['then'](respondWithResult(_0x2b4c01,null))[_0x78a4('0x49')](handleError(_0x2b4c01,null));};exports[_0x78a4('0x4a')]=function(_0x42760c,_0x2f3f08){return db[_0x78a4('0x2f')]['create'](_0x42760c[_0x78a4('0x4b')],{})[_0x78a4('0x25')](function(_0xa6e05e){var _0x233e62=_0x42760c[_0x78a4('0x4c')][_0x78a4('0x27')]({'plain':!![]});if(!_0x233e62)throw new Error(_0x78a4('0x4d'));if(_0x233e62[_0x78a4('0x4e')]===_0x78a4('0x4c')){var _0xd29ad=_0xa6e05e[_0x78a4('0x27')]({'plain':!![]});var _0x47498b=_0x78a4('0x28');return db[_0x78a4('0x4f')][_0x78a4('0x48')]({'where':{'name':_0x47498b,'userProfileId':_0x233e62['userProfileId']},'raw':!![]})['then'](function(_0x45c827){if(_0x45c827&&_0x45c827[_0x78a4('0x50')]===0x0){return db[_0x78a4('0x29')][_0x78a4('0x4a')]({'name':_0xd29ad[_0x78a4('0x2c')],'resourceId':_0xd29ad['id'],'type':_0x45c827['name'],'sectionId':_0x45c827['id']},{})[_0x78a4('0x25')](function(){return _0xa6e05e;});}else{return _0xa6e05e;}})[_0x78a4('0x49')](function(_0x32f950){logger[_0x78a4('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32f950);throw _0x32f950;});}return _0xa6e05e;})[_0x78a4('0x25')](respondWithResult(_0x2f3f08,0xc9))[_0x78a4('0x49')](handleError(_0x2f3f08,null));};exports[_0x78a4('0x51')]=function(_0x30124d,_0x1046fd){var _0x360847={'where':{'id':_0x30124d[_0x78a4('0x47')]['id']}},_0x1e2293={};_0x1e2293[_0x78a4('0x32')]=_[_0x78a4('0x34')](db[_0x78a4('0x2f')][_0x78a4('0x30')]);_0x360847[_0x78a4('0x37')]=_[_0x78a4('0x36')](_0x1e2293['model'],qs[_0x78a4('0x38')](_0x30124d['query'][_0x78a4('0x38')]));_0x360847[_0x78a4('0x37')]=_0x360847[_0x78a4('0x37')][_0x78a4('0x39')]?_0x360847[_0x78a4('0x37')]:_0x1e2293[_0x78a4('0x32')];if(_0x30124d[_0x78a4('0x33')][_0x78a4('0x43')]){_0x360847[_0x78a4('0x44')]=[{'all':!![]}];}_0x360847=_[_0x78a4('0x3f')]({},_0x360847,_0x30124d[_0x78a4('0x42')]);return db[_0x78a4('0x2f')][_0x78a4('0x48')](_0x360847)[_0x78a4('0x25')](handleEntityNotFound(_0x1046fd,null))[_0x78a4('0x25')](function(_0x10edbf){if(_0x10edbf){var _0x1d28ce=_0x10edbf[_0x78a4('0x27')]({'plain':!![]});_0x1d28ce=qs[_0x78a4('0x52')](_0x1d28ce,['id',_0x78a4('0x53'),_0x78a4('0x54')]);_0x30124d[_0x78a4('0x4b')]=_[_0x78a4('0x52')](_0x30124d[_0x78a4('0x4b')],['id',_0x78a4('0x53'),_0x78a4('0x54')]);return db[_0x78a4('0x2f')][_0x78a4('0x4a')](_['merge'](_0x1d28ce,_0x30124d[_0x78a4('0x4b')]),{'include':_0x30124d[_0x78a4('0x33')][_0x78a4('0x43')]?[{'all':!![]}]:undefined})[_0x78a4('0x25')](function(_0x3a619b){var _0x273865=_0x30124d[_0x78a4('0x4c')][_0x78a4('0x27')]({'plain':!![]});if(!_0x273865)throw new Error(_0x78a4('0x4d'));if(_0x273865['role']==='user'){var _0x18e45d=_0x3a619b[_0x78a4('0x27')]({'plain':!![]});var _0x2e7dfc=_0x78a4('0x28');return db['UserProfileSection'][_0x78a4('0x48')]({'where':{'name':_0x2e7dfc,'userProfileId':_0x273865[_0x78a4('0x55')]},'raw':!![]})[_0x78a4('0x25')](function(_0x6ae9cb){if(_0x6ae9cb&&_0x6ae9cb['autoAssociation']===0x0){return db['UserProfileResource'][_0x78a4('0x4a')]({'name':_0x18e45d[_0x78a4('0x2c')],'resourceId':_0x18e45d['id'],'type':_0x6ae9cb['name'],'sectionId':_0x6ae9cb['id']},{})[_0x78a4('0x25')](function(){return _0x3a619b;});}else{return _0x3a619b;}})[_0x78a4('0x49')](function(_0x1790c3){logger[_0x78a4('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1790c3);throw _0x1790c3;});}return _0x3a619b;});}})[_0x78a4('0x25')](respondWithResult(_0x1046fd,0xc9))[_0x78a4('0x49')](handleError(_0x1046fd,null));};exports[_0x78a4('0x56')]=function(_0x5ebb01,_0x215665){if(_0x5ebb01[_0x78a4('0x4b')]['id']){delete _0x5ebb01[_0x78a4('0x4b')]['id'];}return db['Campaign'][_0x78a4('0x48')]({'where':{'id':_0x5ebb01['params']['id']}})[_0x78a4('0x25')](handleEntityNotFound(_0x215665,null))[_0x78a4('0x25')](saveUpdates(_0x5ebb01[_0x78a4('0x4b')],null))[_0x78a4('0x25')](respondWithResult(_0x215665,null))[_0x78a4('0x49')](handleError(_0x215665,null));};exports['destroy']=function(_0x1bfbad,_0x626568){return db[_0x78a4('0x2f')][_0x78a4('0x48')]({'where':{'id':_0x1bfbad[_0x78a4('0x47')]['id']}})[_0x78a4('0x25')](handleEntityNotFound(_0x626568,null))[_0x78a4('0x25')](removeEntity(_0x626568,null))[_0x78a4('0x49')](handleError(_0x626568,null));};exports['getHoppers']=function(_0x22f384,_0x3ed0a2,_0x1af881){var _0x23d795={'raw':!![],'where':{}};var _0x58d05e={};var _0xfa5265={'count':0x0,'rows':[]};return db['Campaign'][_0x78a4('0x57')]({'where':{'id':_0x22f384[_0x78a4('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ed0a2,null))['then'](function(_0x31afa7){if(_0x31afa7){_0x58d05e[_0x78a4('0x32')]=_['keys'](db[_0x78a4('0x58')][_0x78a4('0x30')]);_0x58d05e[_0x78a4('0x33')]=_[_0x78a4('0x34')](_0x22f384[_0x78a4('0x33')]);_0x58d05e[_0x78a4('0x35')]=_[_0x78a4('0x36')](_0x58d05e[_0x78a4('0x32')],_0x58d05e['query']);_0x23d795[_0x78a4('0x37')]=_['intersection'](_0x58d05e[_0x78a4('0x32')],qs[_0x78a4('0x38')](_0x22f384[_0x78a4('0x33')][_0x78a4('0x38')]));_0x23d795[_0x78a4('0x37')]=_0x23d795[_0x78a4('0x37')]['length']?_0x23d795[_0x78a4('0x37')]:_0x58d05e[_0x78a4('0x32')];if(!_0x22f384[_0x78a4('0x33')][_0x78a4('0x3a')](_0x78a4('0x3b'))){_0x23d795[_0x78a4('0x1e')]=qs[_0x78a4('0x1e')](_0x22f384['query']['limit']);_0x23d795['offset']=qs['offset'](_0x22f384[_0x78a4('0x33')][_0x78a4('0x1c')]);}_0x23d795['order']=qs['sort'](_0x22f384['query']['sort']);_0x23d795['where']=qs[_0x78a4('0x35')](_[_0x78a4('0x3e')](_0x22f384[_0x78a4('0x33')],_0x58d05e[_0x78a4('0x35')]));_0x23d795[_0x78a4('0x3d')][_0x78a4('0x59')]=_0x31afa7['id'];if(_0x22f384[_0x78a4('0x33')][_0x78a4('0x41')]){_0x23d795[_0x78a4('0x3d')]=_[_0x78a4('0x3f')](_0x23d795[_0x78a4('0x3d')],{'$or':_[_0x78a4('0x2e')](_0x23d795[_0x78a4('0x37')],function(_0x632bbf){var _0x40a84e={};_0x40a84e[_0x632bbf]={'$like':'%'+_0x22f384[_0x78a4('0x33')]['filter']+'%'};return _0x40a84e;})});}_0x23d795=_['merge']({},_0x23d795,_0x22f384[_0x78a4('0x42')]);return db['CmHopper'][_0x78a4('0x1f')]({'where':_0x23d795[_0x78a4('0x3d')]})['then'](function(_0x14351c){_0xfa5265[_0x78a4('0x1f')]=_0x14351c;if(_0x22f384[_0x78a4('0x33')]['includeAll']){_0x23d795[_0x78a4('0x44')]=[{'all':!![]}];}return db[_0x78a4('0x58')]['findAll'](_0x23d795);})['then'](function(_0xeb1054){_0xfa5265[_0x78a4('0x46')]=_0xeb1054;return _0xfa5265;});}})['then'](respondWithFilteredResult(_0x3ed0a2,_0x23d795))[_0x78a4('0x49')](handleError(_0x3ed0a2,null));};exports[_0x78a4('0x5a')]=function(_0x186df5,_0x1cb1f8,_0x3af413){var _0x84b6cf={'raw':!![],'where':{}};var _0x471f6d={};var _0x30811e={'count':0x0,'rows':[]};return db[_0x78a4('0x2f')]['findOne']({'where':{'id':_0x186df5[_0x78a4('0x47')]['id']}})[_0x78a4('0x25')](handleEntityNotFound(_0x1cb1f8,null))['then'](function(_0x24c425){if(_0x24c425){_0x471f6d['model']=_[_0x78a4('0x34')](db[_0x78a4('0x5b')]['rawAttributes']);_0x471f6d[_0x78a4('0x33')]=_[_0x78a4('0x34')](_0x186df5[_0x78a4('0x33')]);_0x471f6d['filters']=_[_0x78a4('0x36')](_0x471f6d[_0x78a4('0x32')],_0x471f6d['query']);_0x84b6cf[_0x78a4('0x37')]=_['intersection'](_0x471f6d[_0x78a4('0x32')],qs[_0x78a4('0x38')](_0x186df5[_0x78a4('0x33')][_0x78a4('0x38')]));_0x84b6cf['attributes']=_0x84b6cf[_0x78a4('0x37')][_0x78a4('0x39')]?_0x84b6cf[_0x78a4('0x37')]:_0x471f6d['model'];if(!_0x186df5[_0x78a4('0x33')]['hasOwnProperty'](_0x78a4('0x3b'))){_0x84b6cf[_0x78a4('0x1e')]=qs['limit'](_0x186df5[_0x78a4('0x33')][_0x78a4('0x1e')]);_0x84b6cf[_0x78a4('0x1c')]=qs[_0x78a4('0x1c')](_0x186df5[_0x78a4('0x33')][_0x78a4('0x1c')]);}_0x84b6cf['order']=qs[_0x78a4('0x5c')](_0x186df5[_0x78a4('0x33')][_0x78a4('0x5c')]);_0x84b6cf[_0x78a4('0x3d')]=qs['filters'](_[_0x78a4('0x3e')](_0x186df5['query'],_0x471f6d[_0x78a4('0x35')]));_0x84b6cf[_0x78a4('0x3d')]['CampaignId']=_0x24c425['id'];if(_0x186df5[_0x78a4('0x33')]['filter']){_0x84b6cf[_0x78a4('0x3d')]=_['merge'](_0x84b6cf['where'],{'$or':_['map'](_0x84b6cf['attributes'],function(_0x483b12){var _0xa9c820={};_0xa9c820[_0x483b12]={'$like':'%'+_0x186df5[_0x78a4('0x33')][_0x78a4('0x41')]+'%'};return _0xa9c820;})});}_0x84b6cf=_[_0x78a4('0x3f')]({},_0x84b6cf,_0x186df5['options']);return db['CmHopperHistory'][_0x78a4('0x1f')]({'where':_0x84b6cf[_0x78a4('0x3d')]})[_0x78a4('0x25')](function(_0x45f81d){_0x30811e[_0x78a4('0x1f')]=_0x45f81d;if(_0x186df5['query'][_0x78a4('0x43')]){_0x84b6cf[_0x78a4('0x44')]=[{'all':!![]}];}return db[_0x78a4('0x5b')][_0x78a4('0x45')](_0x84b6cf);})['then'](function(_0x847c42){_0x30811e[_0x78a4('0x46')]=_0x847c42;return _0x30811e;});}})[_0x78a4('0x25')](respondWithFilteredResult(_0x1cb1f8,_0x84b6cf))[_0x78a4('0x49')](handleError(_0x1cb1f8,null));};exports[_0x78a4('0x5d')]=function(_0x8eff79,_0x5a4a35,_0xbada63){var _0x2f2ed6={'raw':!![],'where':{}};var _0x32254d={};var _0x11c842={'count':0x0,'rows':[]};return db[_0x78a4('0x2f')][_0x78a4('0x57')]({'where':{'id':_0x8eff79[_0x78a4('0x47')]['id']}})[_0x78a4('0x25')](handleEntityNotFound(_0x5a4a35,null))[_0x78a4('0x25')](function(_0x195391){if(_0x195391){_0x32254d[_0x78a4('0x32')]=_[_0x78a4('0x34')](db[_0x78a4('0x5e')][_0x78a4('0x30')]);_0x32254d['query']=_[_0x78a4('0x34')](_0x8eff79[_0x78a4('0x33')]);_0x32254d['filters']=_[_0x78a4('0x36')](_0x32254d[_0x78a4('0x32')],_0x32254d[_0x78a4('0x33')]);_0x2f2ed6[_0x78a4('0x37')]=_[_0x78a4('0x36')](_0x32254d[_0x78a4('0x32')],qs[_0x78a4('0x38')](_0x8eff79[_0x78a4('0x33')][_0x78a4('0x38')]));_0x2f2ed6['attributes']=_0x2f2ed6['attributes'][_0x78a4('0x39')]?_0x2f2ed6[_0x78a4('0x37')]:_0x32254d[_0x78a4('0x32')];if(!_0x8eff79[_0x78a4('0x33')]['hasOwnProperty'](_0x78a4('0x3b'))){_0x2f2ed6[_0x78a4('0x1e')]=qs[_0x78a4('0x1e')](_0x8eff79[_0x78a4('0x33')]['limit']);_0x2f2ed6[_0x78a4('0x1c')]=qs[_0x78a4('0x1c')](_0x8eff79[_0x78a4('0x33')][_0x78a4('0x1c')]);}_0x2f2ed6[_0x78a4('0x3c')]=qs[_0x78a4('0x5c')](_0x8eff79[_0x78a4('0x33')][_0x78a4('0x5c')]);_0x2f2ed6['where']=qs[_0x78a4('0x35')](_['pick'](_0x8eff79[_0x78a4('0x33')],_0x32254d[_0x78a4('0x35')]));_0x2f2ed6[_0x78a4('0x3d')][_0x78a4('0x59')]=_0x195391['id'];if(_0x8eff79[_0x78a4('0x33')][_0x78a4('0x41')]){_0x2f2ed6[_0x78a4('0x3d')]=_[_0x78a4('0x3f')](_0x2f2ed6[_0x78a4('0x3d')],{'$or':_[_0x78a4('0x2e')](_0x2f2ed6[_0x78a4('0x37')],function(_0x375801){var _0x2a08b7={};_0x2a08b7[_0x375801]={'$like':'%'+_0x8eff79['query'][_0x78a4('0x41')]+'%'};return _0x2a08b7;})});}_0x2f2ed6=_['merge']({},_0x2f2ed6,_0x8eff79[_0x78a4('0x42')]);return db[_0x78a4('0x5e')][_0x78a4('0x1f')]({'where':_0x2f2ed6[_0x78a4('0x3d')]})[_0x78a4('0x25')](function(_0x42e9d2){_0x11c842['count']=_0x42e9d2;if(_0x8eff79['query'][_0x78a4('0x43')]){_0x2f2ed6['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x78a4('0x45')](_0x2f2ed6);})[_0x78a4('0x25')](function(_0x5899d1){_0x11c842[_0x78a4('0x46')]=_0x5899d1;return _0x11c842;});}})[_0x78a4('0x25')](respondWithFilteredResult(_0x5a4a35,_0x2f2ed6))[_0x78a4('0x49')](handleError(_0x5a4a35,null));};exports[_0x78a4('0x5f')]=function(_0x27a7dd,_0xf95589,_0x216b6f){var _0x203860={'raw':!![],'where':{}};var _0x431753={};var _0x4fda8d={'count':0x0,'rows':[]};return db[_0x78a4('0x2f')]['findOne']({'where':{'id':_0x27a7dd[_0x78a4('0x47')]['id']}})[_0x78a4('0x25')](handleEntityNotFound(_0xf95589,null))[_0x78a4('0x25')](function(_0x3a72fa){if(_0x3a72fa){_0x431753['model']=_[_0x78a4('0x34')](db['CmHopperBlack']['rawAttributes']);_0x431753[_0x78a4('0x33')]=_[_0x78a4('0x34')](_0x27a7dd['query']);_0x431753[_0x78a4('0x35')]=_['intersection'](_0x431753[_0x78a4('0x32')],_0x431753['query']);_0x203860[_0x78a4('0x37')]=_['intersection'](_0x431753[_0x78a4('0x32')],qs[_0x78a4('0x38')](_0x27a7dd[_0x78a4('0x33')][_0x78a4('0x38')]));_0x203860['attributes']=_0x203860[_0x78a4('0x37')][_0x78a4('0x39')]?_0x203860[_0x78a4('0x37')]:_0x431753[_0x78a4('0x32')];if(!_0x27a7dd['query']['hasOwnProperty'](_0x78a4('0x3b'))){_0x203860[_0x78a4('0x1e')]=qs[_0x78a4('0x1e')](_0x27a7dd['query'][_0x78a4('0x1e')]);_0x203860[_0x78a4('0x1c')]=qs[_0x78a4('0x1c')](_0x27a7dd['query'][_0x78a4('0x1c')]);}_0x203860['order']=qs['sort'](_0x27a7dd['query'][_0x78a4('0x5c')]);_0x203860[_0x78a4('0x3d')]=qs[_0x78a4('0x35')](_[_0x78a4('0x3e')](_0x27a7dd['query'],_0x431753['filters']));_0x203860['where']['CampaignId']=_0x3a72fa['id'];if(_0x27a7dd[_0x78a4('0x33')][_0x78a4('0x41')]){_0x203860[_0x78a4('0x3d')]=_[_0x78a4('0x3f')](_0x203860['where'],{'$or':_[_0x78a4('0x2e')](_0x203860[_0x78a4('0x37')],function(_0x3c02ae){var _0x42b53e={};_0x42b53e[_0x3c02ae]={'$like':'%'+_0x27a7dd['query'][_0x78a4('0x41')]+'%'};return _0x42b53e;})});}_0x203860=_[_0x78a4('0x3f')]({},_0x203860,_0x27a7dd['options']);return db[_0x78a4('0x60')][_0x78a4('0x1f')]({'where':_0x203860[_0x78a4('0x3d')]})[_0x78a4('0x25')](function(_0x3a38bc){_0x4fda8d[_0x78a4('0x1f')]=_0x3a38bc;if(_0x27a7dd[_0x78a4('0x33')][_0x78a4('0x43')]){_0x203860['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x78a4('0x45')](_0x203860);})[_0x78a4('0x25')](function(_0x3d756f){_0x4fda8d[_0x78a4('0x46')]=_0x3d756f;return _0x4fda8d;});}})[_0x78a4('0x25')](respondWithFilteredResult(_0xf95589,_0x203860))[_0x78a4('0x49')](handleError(_0xf95589,null));};exports[_0x78a4('0x61')]=function(_0x1af9fc,_0x52cede,_0x4f98db){var _0x4812d0={};var _0x1a91b9={};var _0xaa08af;var _0xec631;return db[_0x78a4('0x2f')][_0x78a4('0x57')]({'where':{'id':_0x1af9fc[_0x78a4('0x47')]['id']}})[_0x78a4('0x25')](handleEntityNotFound(_0x52cede,null))[_0x78a4('0x25')](function(_0x384ee7){if(_0x384ee7){_0xaa08af=_0x384ee7;_0x1a91b9[_0x78a4('0x32')]=_[_0x78a4('0x34')](db[_0x78a4('0x62')][_0x78a4('0x30')]);_0x1a91b9['query']=_[_0x78a4('0x34')](_0x1af9fc[_0x78a4('0x33')]);_0x1a91b9[_0x78a4('0x35')]=_[_0x78a4('0x36')](_0x1a91b9[_0x78a4('0x32')],_0x1a91b9[_0x78a4('0x33')]);_0x4812d0['attributes']=_[_0x78a4('0x36')](_0x1a91b9[_0x78a4('0x32')],qs[_0x78a4('0x38')](_0x1af9fc[_0x78a4('0x33')][_0x78a4('0x38')]));_0x4812d0['attributes']=_0x4812d0[_0x78a4('0x37')][_0x78a4('0x39')]?_0x4812d0[_0x78a4('0x37')]:_0x1a91b9[_0x78a4('0x32')];_0x4812d0[_0x78a4('0x3c')]=qs[_0x78a4('0x5c')](_0x1af9fc[_0x78a4('0x33')][_0x78a4('0x5c')]);_0x4812d0[_0x78a4('0x3d')]=qs['filters'](_['pick'](_0x1af9fc['query'],_0x1a91b9['filters']));if(_0x1af9fc[_0x78a4('0x33')][_0x78a4('0x41')]){_0x4812d0[_0x78a4('0x3d')]=_['merge'](_0x4812d0[_0x78a4('0x3d')],{'$or':_[_0x78a4('0x2e')](_0x4812d0[_0x78a4('0x37')],function(_0x37fb80){var _0x51ed34={};_0x51ed34[_0x37fb80]={'$like':'%'+_0x1af9fc[_0x78a4('0x33')][_0x78a4('0x41')]+'%'};return _0x51ed34;})});}_0x4812d0=_[_0x78a4('0x3f')]({},_0x4812d0,_0x1af9fc[_0x78a4('0x42')]);return _0xaa08af[_0x78a4('0x61')](_0x4812d0);}})['then'](function(_0x34d1ae){if(_0x34d1ae){_0xec631=_0x34d1ae[_0x78a4('0x39')];if(!_0x1af9fc[_0x78a4('0x33')][_0x78a4('0x3a')](_0x78a4('0x3b'))){_0x4812d0[_0x78a4('0x1e')]=qs['limit'](_0x1af9fc[_0x78a4('0x33')]['limit']);_0x4812d0['offset']=qs[_0x78a4('0x1c')](_0x1af9fc[_0x78a4('0x33')]['offset']);}return _0xaa08af[_0x78a4('0x61')](_0x4812d0);}})['then'](function(_0x59ef7e){if(_0x59ef7e){return _0x59ef7e?{'count':_0xec631,'rows':_0x59ef7e}:null;}})[_0x78a4('0x25')](respondWithResult(_0x52cede,null))[_0x78a4('0x49')](handleError(_0x52cede,null));};exports[_0x78a4('0x63')]=function(_0x2f1bf2,_0x15d647,_0x4cf8f4){var _0x25096a,_0x57e75a;return db[_0x78a4('0x2f')][_0x78a4('0x48')]({'where':{'id':_0x2f1bf2[_0x78a4('0x47')]['id']}})[_0x78a4('0x25')](handleEntityNotFound(_0x15d647,null))['then'](function(_0x249b38){if(_0x249b38){_0x57e75a=_0x249b38;return _0x249b38[_0x78a4('0x63')](_0x2f1bf2[_0x78a4('0x4b')]['ids'],_['omit'](_0x2f1bf2[_0x78a4('0x4b')],[_0x78a4('0x64'),'id'])||{});}return null;})[_0x78a4('0x65')](function(_0x4e0588){var _0x2a713b;_0x25096a=_0x4e0588||[];var _0x597aaf=[];if(_0x4e0588){for(var _0x41aa61=0x0;_0x41aa61<_0x4e0588['length'];_0x41aa61+=0x1){var _0x268693=_0x4e0588[_0x41aa61]['get']({'plain':!![]});_0x57e75a[_0x78a4('0x66')]=_0x2f1bf2[_0x78a4('0x4b')][_0x78a4('0x66')]?_0x2f1bf2[_0x78a4('0x4b')][_0x78a4('0x66')]:_0x57e75a['dialCheckDuplicateType'];switch(_0x57e75a[_0x78a4('0x66')]){case _0x78a4('0x67'):_0x2a713b=squel['insert']()[_0x78a4('0x68')]('cm_hopper')[_0x78a4('0x69')]([_0x78a4('0x6a'),'scheduledAt',_0x78a4('0x6b'),_0x78a4('0x6c'),'CampaignId',_0x78a4('0x53'),_0x78a4('0x54')],squel[_0x78a4('0x6d')]()[_0x78a4('0x6e')](_0x78a4('0x6a'),_0x78a4('0x6a'))[_0x78a4('0x6e')](_0x78a4('0x6f'),_0x78a4('0x70'))[_0x78a4('0x6e')]('id','ContactId')['field'](_0x268693[_0x78a4('0x71')][_0x78a4('0x72')](),_0x78a4('0x6c'))[_0x78a4('0x6e')](_0x2f1bf2[_0x78a4('0x47')]['id'][_0x78a4('0x72')](),'CampaignId')[_0x78a4('0x6e')]('NOW()',_0x78a4('0x53'))[_0x78a4('0x6e')]('NOW()',_0x78a4('0x54'))[_0x78a4('0x73')]('cm_contacts')['where'](_0x78a4('0x74'))[_0x78a4('0x3d')](_0x78a4('0x75'),_0x268693[_0x78a4('0x71')][_0x78a4('0x72')]())[_0x78a4('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x78a4('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x78a4('0x6d')]()[_0x78a4('0x6e')](_0x78a4('0x76'))[_0x78a4('0x73')](_0x78a4('0x77'))['where'](_0x78a4('0x78'),_0x2f1bf2[_0x78a4('0x47')]['id'][_0x78a4('0x72')]()))[_0x78a4('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x78a4('0x6d')]()[_0x78a4('0x6e')](_0x78a4('0x79'))[_0x78a4('0x73')](_0x78a4('0x7a'))['where'](_0x78a4('0x78'),_0x2f1bf2['params']['id'][_0x78a4('0x72')]())))[_0x78a4('0x72')]();break;case _0x78a4('0x7b'):_0x2a713b=squel[_0x78a4('0x7c')]()[_0x78a4('0x68')](_0x78a4('0x7a'))[_0x78a4('0x69')]([_0x78a4('0x6a'),_0x78a4('0x70'),_0x78a4('0x6b'),_0x78a4('0x6c'),_0x78a4('0x59'),_0x78a4('0x53'),'updatedAt'],squel[_0x78a4('0x6d')]()[_0x78a4('0x6e')]('phone',_0x78a4('0x6a'))[_0x78a4('0x6e')](_0x78a4('0x6f'),'scheduledAt')[_0x78a4('0x6e')]('id',_0x78a4('0x6b'))[_0x78a4('0x6e')](_0x268693['CmListId'][_0x78a4('0x72')](),_0x78a4('0x6c'))[_0x78a4('0x6e')](_0x2f1bf2[_0x78a4('0x47')]['id'][_0x78a4('0x72')](),_0x78a4('0x59'))[_0x78a4('0x6e')](_0x78a4('0x6f'),_0x78a4('0x53'))[_0x78a4('0x6e')](_0x78a4('0x6f'),'updatedAt')[_0x78a4('0x73')](_0x78a4('0x7d'))[_0x78a4('0x3d')](_0x78a4('0x74'))[_0x78a4('0x3d')]('ListId\x20=\x20?',_0x268693[_0x78a4('0x71')]['toString']())[_0x78a4('0x3d')](_0x78a4('0x7e'))[_0x78a4('0x3d')](_0x78a4('0x7f'),squel['select']()[_0x78a4('0x6e')](_0x78a4('0x79'))[_0x78a4('0x73')](_0x78a4('0x7a'))[_0x78a4('0x3d')](_0x78a4('0x78'),_0x2f1bf2[_0x78a4('0x47')]['id'][_0x78a4('0x72')]())))[_0x78a4('0x72')]();break;default:_0x2a713b=squel['insert']()[_0x78a4('0x68')](_0x78a4('0x7a'))[_0x78a4('0x69')]([_0x78a4('0x6a'),'scheduledAt',_0x78a4('0x6b'),_0x78a4('0x6c'),_0x78a4('0x59'),_0x78a4('0x53'),_0x78a4('0x54')],squel[_0x78a4('0x6d')]()[_0x78a4('0x6e')](_0x78a4('0x6a'),_0x78a4('0x6a'))['field'](_0x78a4('0x6f'),_0x78a4('0x70'))[_0x78a4('0x6e')]('id','ContactId')[_0x78a4('0x6e')](_0x268693['CmListId']['toString'](),_0x78a4('0x6c'))[_0x78a4('0x6e')](_0x2f1bf2[_0x78a4('0x47')]['id']['toString'](),'CampaignId')['field'](_0x78a4('0x6f'),_0x78a4('0x53'))[_0x78a4('0x6e')](_0x78a4('0x6f'),'updatedAt')['from']('cm_contacts')[_0x78a4('0x3d')]('deletedAt\x20IS\x20NULL')['where'](_0x78a4('0x75'),_0x268693['CmListId'][_0x78a4('0x72')]())['where'](_0x78a4('0x7e')))[_0x78a4('0x72')]();}_0x597aaf[_0x78a4('0x80')](db[_0x78a4('0x81')]['query'](_0x2a713b));}return BPromise[_0x78a4('0x82')](_0x597aaf);}})[_0x78a4('0x25')](function(){return _0x25096a;})[_0x78a4('0x25')](respondWithResult(_0x15d647,null))[_0x78a4('0x49')](handleError(_0x15d647,null));};exports[_0x78a4('0x83')]=function(_0x3c6c2d,_0x3e500f,_0x7219c){return db[_0x78a4('0x2f')][_0x78a4('0x48')]({'where':{'id':_0x3c6c2d[_0x78a4('0x47')]['id']}})[_0x78a4('0x25')](handleEntityNotFound(_0x3e500f,null))['then'](function(_0x54008b){if(_0x54008b){return _0x54008b[_0x78a4('0x83')](_0x3c6c2d[_0x78a4('0x33')][_0x78a4('0x64')]);}})[_0x78a4('0x25')](function(_0x46d881){if(_0x46d881){return db['CmHopper'][_0x78a4('0x26')]({'where':{'ListId':_0x3c6c2d[_0x78a4('0x33')][_0x78a4('0x64')],'CampaignId':_0x3c6c2d[_0x78a4('0x47')]['id']}})[_0x78a4('0x25')](function(){return _0x46d881;});}})[_0x78a4('0x25')](respondWithStatusCode(_0x3e500f,null))[_0x78a4('0x49')](handleError(_0x3e500f,null));};exports[_0x78a4('0x84')]=function(_0x3af37b,_0x36e461,_0xf123){var _0x4b1179={};var _0x159ec3={};var _0x5362c5;var _0xe7b0e3;return db['Campaign']['findOne']({'where':{'id':_0x3af37b[_0x78a4('0x47')]['id']}})['then'](handleEntityNotFound(_0x36e461,null))[_0x78a4('0x25')](function(_0x463ff8){if(_0x463ff8){_0x5362c5=_0x463ff8;_0x159ec3[_0x78a4('0x32')]=_['keys'](db['CmList'][_0x78a4('0x30')]);_0x159ec3[_0x78a4('0x33')]=_['keys'](_0x3af37b[_0x78a4('0x33')]);_0x159ec3['filters']=_[_0x78a4('0x36')](_0x159ec3['model'],_0x159ec3[_0x78a4('0x33')]);_0x4b1179[_0x78a4('0x37')]=_['intersection'](_0x159ec3[_0x78a4('0x32')],qs[_0x78a4('0x38')](_0x3af37b[_0x78a4('0x33')][_0x78a4('0x38')]));_0x4b1179[_0x78a4('0x37')]=_0x4b1179['attributes'][_0x78a4('0x39')]?_0x4b1179[_0x78a4('0x37')]:_0x159ec3[_0x78a4('0x32')];_0x4b1179[_0x78a4('0x3c')]=qs['sort'](_0x3af37b[_0x78a4('0x33')][_0x78a4('0x5c')]);_0x4b1179[_0x78a4('0x3d')]=qs[_0x78a4('0x35')](_[_0x78a4('0x3e')](_0x3af37b[_0x78a4('0x33')],_0x159ec3[_0x78a4('0x35')]));if(_0x3af37b[_0x78a4('0x33')][_0x78a4('0x41')]){_0x4b1179[_0x78a4('0x3d')]=_[_0x78a4('0x3f')](_0x4b1179[_0x78a4('0x3d')],{'$or':_[_0x78a4('0x2e')](_0x4b1179[_0x78a4('0x37')],function(_0x46a9c6){var _0xd3e0e2={};_0xd3e0e2[_0x46a9c6]={'$like':'%'+_0x3af37b['query']['filter']+'%'};return _0xd3e0e2;})});}_0x4b1179=_[_0x78a4('0x3f')]({},_0x4b1179,_0x3af37b[_0x78a4('0x42')]);return _0x5362c5[_0x78a4('0x84')](_0x4b1179);}})['then'](function(_0x3cef8e){if(_0x3cef8e){_0xe7b0e3=_0x3cef8e[_0x78a4('0x39')];if(!_0x3af37b[_0x78a4('0x33')]['hasOwnProperty']('nolimit')){_0x4b1179[_0x78a4('0x1e')]=qs[_0x78a4('0x1e')](_0x3af37b[_0x78a4('0x33')][_0x78a4('0x1e')]);_0x4b1179['offset']=qs[_0x78a4('0x1c')](_0x3af37b[_0x78a4('0x33')]['offset']);}return _0x5362c5[_0x78a4('0x84')](_0x4b1179);}})['then'](function(_0x553dae){if(_0x553dae){return _0x553dae?{'count':_0xe7b0e3,'rows':_0x553dae}:null;}})[_0x78a4('0x25')](respondWithResult(_0x36e461,null))['catch'](handleError(_0x36e461,null));};exports[_0x78a4('0x85')]=function(_0x5bc1b9,_0x5c93df,_0x51f06f){var _0x5381ca,_0x33996d;return db['Campaign']['find']({'where':{'id':_0x5bc1b9[_0x78a4('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c93df,null))[_0x78a4('0x25')](function(_0x1bf00c){if(_0x1bf00c){_0x33996d=_0x1bf00c;return _0x1bf00c[_0x78a4('0x85')](_0x5bc1b9[_0x78a4('0x4b')][_0x78a4('0x64')],_['omit'](_0x5bc1b9[_0x78a4('0x4b')],[_0x78a4('0x64'),'id'])||{});}return null;})[_0x78a4('0x65')](function(_0x36df31){var _0x2910e2;_0x5381ca=_0x36df31||[];var _0x4e5c0b=[];if(_0x36df31){for(var _0x4250fe=0x0;_0x4250fe<_0x36df31[_0x78a4('0x39')];_0x4250fe+=0x1){var _0x55f55d=_0x36df31[_0x4250fe]['get']({'plain':!![]});_0x2910e2=squel[_0x78a4('0x7c')]()[_0x78a4('0x68')](_0x78a4('0x86'))['fromQuery']([_0x78a4('0x6a'),_0x78a4('0x6b'),_0x78a4('0x6c'),_0x78a4('0x59'),_0x78a4('0x53'),_0x78a4('0x54')],squel[_0x78a4('0x6d')]()['field'](_0x78a4('0x6a'),_0x78a4('0x6a'))[_0x78a4('0x6e')]('id','ContactId')[_0x78a4('0x6e')](_0x55f55d[_0x78a4('0x71')]['toString'](),_0x78a4('0x6c'))[_0x78a4('0x6e')](_0x5bc1b9['params']['id'][_0x78a4('0x72')](),_0x78a4('0x59'))[_0x78a4('0x6e')](_0x78a4('0x6f'),_0x78a4('0x53'))[_0x78a4('0x6e')](_0x78a4('0x6f'),_0x78a4('0x54'))[_0x78a4('0x73')]('cm_contacts')[_0x78a4('0x3d')](_0x78a4('0x74'))[_0x78a4('0x3d')]('ListId\x20=\x20?',_0x55f55d[_0x78a4('0x71')][_0x78a4('0x72')]())[_0x78a4('0x3d')](_0x78a4('0x7e')))['toString']();_0x4e5c0b['push'](db[_0x78a4('0x81')][_0x78a4('0x33')](_0x2910e2));}return BPromise[_0x78a4('0x82')](_0x4e5c0b);}})[_0x78a4('0x25')](function(){return _0x5381ca;})['then'](respondWithResult(_0x5c93df,null))['catch'](handleError(_0x5c93df,null));};exports[_0x78a4('0x87')]=function(_0x4d2d7c,_0x35d3d9,_0x1b2dc5){return db[_0x78a4('0x2f')][_0x78a4('0x48')]({'where':{'id':_0x4d2d7c['params']['id']}})[_0x78a4('0x25')](handleEntityNotFound(_0x35d3d9,null))[_0x78a4('0x25')](function(_0x18164f){if(_0x18164f){return _0x18164f[_0x78a4('0x87')](_0x4d2d7c[_0x78a4('0x33')][_0x78a4('0x64')]);}})[_0x78a4('0x25')](function(_0x44bb57){if(_0x44bb57){return db[_0x78a4('0x60')][_0x78a4('0x26')]({'where':{'ListId':_0x4d2d7c[_0x78a4('0x33')][_0x78a4('0x64')],'CampaignId':_0x4d2d7c[_0x78a4('0x47')]['id']}})[_0x78a4('0x25')](function(){return _0x44bb57;});}})['then'](respondWithStatusCode(_0x35d3d9,null))[_0x78a4('0x49')](handleError(_0x35d3d9,null));};
\ No newline at end of file
+var _0x7919=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','omit','createdAt','getHoppers','CmHopper','nolimit','order','pick','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','insert','push','sequelize','removeLists','getBlackLists','addBlackLists','spread','all','removeBlackLists','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','then','end','error','name','send','index','map','Campaign','rawAttributes','fieldName','key','model'];(function(_0x361e40,_0x3ba443){var _0xbb3542=function(_0x8fd43d){while(--_0x8fd43d){_0x361e40['push'](_0x361e40['shift']());}};_0xbb3542(++_0x3ba443);}(_0x7919,0x168));var _0x9791=function(_0x4df9b2,_0x52aef3){_0x4df9b2=_0x4df9b2-0x0;var _0x4bd8f6=_0x7919[_0x4df9b2];return _0x4bd8f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9791('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9791('0x1'));var moment=require(_0x9791('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9791('0x3'));var util=require(_0x9791('0x4'));var path=require(_0x9791('0x5'));var sox=require(_0x9791('0x6'));var csv=require(_0x9791('0x7'));var ejs=require(_0x9791('0x8'));var fs=require('fs');var fs_extra=require(_0x9791('0x9'));var _=require(_0x9791('0xa'));var squel=require('squel');var crypto=require(_0x9791('0xb'));var jsforce=require(_0x9791('0xc'));var deskjs=require(_0x9791('0xd'));var toCsv=require(_0x9791('0x7'));var querystring=require(_0x9791('0xe'));var Papa=require(_0x9791('0xf'));var Redis=require(_0x9791('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9791('0x11'));var as=require(_0x9791('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9791('0x13'));var utils=require(_0x9791('0x14'));var config=require(_0x9791('0x15'));var licenseUtil=require(_0x9791('0x16'));var db=require(_0x9791('0x17'))['db'];function respondWithStatusCode(_0x1877cd,_0x53d7ad){_0x53d7ad=_0x53d7ad||0xcc;return function(_0x23cc05){if(_0x23cc05){return _0x1877cd[_0x9791('0x18')](_0x53d7ad);}return _0x1877cd['status'](_0x53d7ad)['end']();};}function respondWithResult(_0x120a60,_0x39d1e8){_0x39d1e8=_0x39d1e8||0xc8;return function(_0x1b0e3b){if(_0x1b0e3b){return _0x120a60[_0x9791('0x19')](_0x39d1e8)[_0x9791('0x1a')](_0x1b0e3b);}};}function respondWithFilteredResult(_0x59c33b,_0x195c71){return function(_0xaa9240){if(_0xaa9240){var _0x475a35=typeof _0x195c71[_0x9791('0x1b')]===_0x9791('0x1c')&&typeof _0x195c71[_0x9791('0x1d')]==='undefined';var _0x4e4a58=_0xaa9240[_0x9791('0x1e')];var _0x3837c5=_0x475a35?0x0:_0x195c71[_0x9791('0x1b')];var _0x1fa2fd=_0x475a35?_0xaa9240[_0x9791('0x1e')]:_0x195c71[_0x9791('0x1b')]+_0x195c71[_0x9791('0x1d')];var _0x1f0451;if(_0x1fa2fd>=_0x4e4a58){_0x1fa2fd=_0x4e4a58;_0x1f0451=0xc8;}else{_0x1f0451=0xce;}_0x59c33b[_0x9791('0x19')](_0x1f0451);return _0x59c33b[_0x9791('0x1f')](_0x9791('0x20'),_0x3837c5+'-'+_0x1fa2fd+'/'+_0x4e4a58)[_0x9791('0x1a')](_0xaa9240);}return null;};}function patchUpdates(_0x2005e0){return function(_0x58029b){try{jsonpatch[_0x9791('0x21')](_0x58029b,_0x2005e0,!![]);}catch(_0x3618fb){return BPromise[_0x9791('0x22')](_0x3618fb);}return _0x58029b['save']();};}function saveUpdates(_0x275ff1,_0x252abe){return function(_0x54b4d8){if(_0x54b4d8){return _0x54b4d8[_0x9791('0x23')](_0x275ff1)['then'](function(_0xf7eb1d){return _0xf7eb1d;});}return null;};}function removeEntity(_0x51b8a6,_0x14ed39){return function(_0x16d0be){if(_0x16d0be){return _0x16d0be[_0x9791('0x24')]()['then'](function(){var _0x2fb5fa=_0x16d0be[_0x9791('0x25')]({'plain':!![]});var _0x52266b='IvrCampaigns';return db[_0x9791('0x26')][_0x9791('0x24')]({'where':{'type':_0x52266b,'resourceId':_0x2fb5fa['id']}})[_0x9791('0x27')](function(){return _0x16d0be;});})[_0x9791('0x27')](function(){_0x51b8a6[_0x9791('0x19')](0xcc)[_0x9791('0x28')]();});}};}function handleEntityNotFound(_0x28cb3d,_0x468a16){return function(_0xb83982){if(!_0xb83982){_0x28cb3d[_0x9791('0x18')](0x194);}return _0xb83982;};}function handleError(_0x5a8437,_0x3f58ec){_0x3f58ec=_0x3f58ec||0x1f4;return function(_0x4b9aa6){logger[_0x9791('0x29')](_0x4b9aa6['stack']);if(_0x4b9aa6[_0x9791('0x2a')]){delete _0x4b9aa6[_0x9791('0x2a')];}_0x5a8437[_0x9791('0x19')](_0x3f58ec)[_0x9791('0x2b')](_0x4b9aa6);};}exports[_0x9791('0x2c')]=function(_0x13c13d,_0x543b31){var _0xbe3cd7={},_0x1e4878={},_0x444339={'count':0x0,'rows':[]};var _0x23062c=_[_0x9791('0x2d')](db[_0x9791('0x2e')][_0x9791('0x2f')],function(_0x607419){return{'name':_0x607419[_0x9791('0x30')],'type':_0x607419['type'][_0x9791('0x31')]};});_0x1e4878[_0x9791('0x32')]=_['map'](_0x23062c,'name');_0x1e4878[_0x9791('0x33')]=_[_0x9791('0x34')](_0x13c13d['query']);_0x1e4878[_0x9791('0x35')]=_[_0x9791('0x36')](_0x1e4878[_0x9791('0x32')],_0x1e4878[_0x9791('0x33')]);_0xbe3cd7[_0x9791('0x37')]=_[_0x9791('0x36')](_0x1e4878['model'],qs[_0x9791('0x38')](_0x13c13d['query'][_0x9791('0x38')]));_0xbe3cd7[_0x9791('0x37')]=_0xbe3cd7[_0x9791('0x37')][_0x9791('0x39')]?_0xbe3cd7[_0x9791('0x37')]:_0x1e4878['model'];if(!_0x13c13d['query'][_0x9791('0x3a')]('nolimit')){_0xbe3cd7[_0x9791('0x1d')]=qs['limit'](_0x13c13d[_0x9791('0x33')][_0x9791('0x1d')]);_0xbe3cd7[_0x9791('0x1b')]=qs['offset'](_0x13c13d['query'][_0x9791('0x1b')]);}_0xbe3cd7['order']=qs['sort'](_0x13c13d[_0x9791('0x33')][_0x9791('0x3b')]);_0xbe3cd7[_0x9791('0x3c')]=qs[_0x9791('0x35')](_['pick'](_0x13c13d[_0x9791('0x33')],_0x1e4878['filters']),_0x23062c);if(_0x13c13d[_0x9791('0x33')][_0x9791('0x3d')]){_0xbe3cd7[_0x9791('0x3c')]=_[_0x9791('0x3e')](_0xbe3cd7['where'],{'$or':_[_0x9791('0x2d')](_0x23062c,function(_0x497270){if(_0x497270[_0x9791('0x3f')]!==_0x9791('0x40')){var _0x38d353={};_0x38d353[_0x497270[_0x9791('0x2a')]]={'$like':'%'+_0x13c13d[_0x9791('0x33')][_0x9791('0x3d')]+'%'};return _0x38d353;}})});}_0xbe3cd7=_[_0x9791('0x3e')]({},_0xbe3cd7,_0x13c13d['options']);var _0x51d139={'where':_0xbe3cd7['where']};return db[_0x9791('0x2e')][_0x9791('0x1e')](_0x51d139)[_0x9791('0x27')](function(_0xccdf27){_0x444339[_0x9791('0x1e')]=_0xccdf27;if(_0x13c13d[_0x9791('0x33')][_0x9791('0x41')]){_0xbe3cd7['include']=[{'all':!![]}];}return db[_0x9791('0x2e')][_0x9791('0x42')](_0xbe3cd7);})['then'](function(_0x4cc14c){_0x444339[_0x9791('0x43')]=_0x4cc14c;return _0x444339;})[_0x9791('0x27')](respondWithFilteredResult(_0x543b31,_0xbe3cd7))[_0x9791('0x44')](handleError(_0x543b31,null));};exports[_0x9791('0x45')]=function(_0x4b5fa5,_0x4e8617){var _0x2d8dc9={'raw':![],'where':{'id':_0x4b5fa5[_0x9791('0x46')]['id']}},_0x13c648={};_0x13c648[_0x9791('0x32')]=_[_0x9791('0x34')](db[_0x9791('0x2e')][_0x9791('0x2f')]);_0x13c648[_0x9791('0x33')]=_[_0x9791('0x34')](_0x4b5fa5['query']);_0x13c648['filters']=_[_0x9791('0x36')](_0x13c648['model'],_0x13c648[_0x9791('0x33')]);_0x2d8dc9['attributes']=_[_0x9791('0x36')](_0x13c648[_0x9791('0x32')],qs[_0x9791('0x38')](_0x4b5fa5[_0x9791('0x33')][_0x9791('0x38')]));_0x2d8dc9[_0x9791('0x37')]=_0x2d8dc9[_0x9791('0x37')][_0x9791('0x39')]?_0x2d8dc9[_0x9791('0x37')]:_0x13c648[_0x9791('0x32')];if(_0x4b5fa5['query']['includeAll']){_0x2d8dc9[_0x9791('0x47')]=[{'all':!![]}];}_0x2d8dc9=_[_0x9791('0x3e')]({},_0x2d8dc9,_0x4b5fa5[_0x9791('0x48')]);return db[_0x9791('0x2e')][_0x9791('0x49')](_0x2d8dc9)['then'](handleEntityNotFound(_0x4e8617,null))[_0x9791('0x27')](respondWithResult(_0x4e8617,null))[_0x9791('0x44')](handleError(_0x4e8617,null));};exports[_0x9791('0x4a')]=function(_0x525200,_0x110af9){return db[_0x9791('0x2e')]['create'](_0x525200['body'],{})[_0x9791('0x27')](function(_0x91ecc4){var _0x31f463=_0x525200[_0x9791('0x4b')][_0x9791('0x25')]({'plain':!![]});if(!_0x31f463)throw new Error(_0x9791('0x4c'));if(_0x31f463[_0x9791('0x4d')]===_0x9791('0x4b')){var _0x57eb99=_0x91ecc4['get']({'plain':!![]});var _0x3d36be=_0x9791('0x4e');return db[_0x9791('0x4f')][_0x9791('0x49')]({'where':{'name':_0x3d36be,'userProfileId':_0x31f463[_0x9791('0x50')]},'raw':!![]})[_0x9791('0x27')](function(_0x5c3a8c){if(_0x5c3a8c&&_0x5c3a8c[_0x9791('0x51')]===0x0){return db[_0x9791('0x26')][_0x9791('0x4a')]({'name':_0x57eb99['name'],'resourceId':_0x57eb99['id'],'type':_0x5c3a8c[_0x9791('0x2a')],'sectionId':_0x5c3a8c['id']},{})[_0x9791('0x27')](function(){return _0x91ecc4;});}else{return _0x91ecc4;}})[_0x9791('0x44')](function(_0x61e9c5){logger[_0x9791('0x29')](_0x9791('0x52'),_0x61e9c5);throw _0x61e9c5;});}return _0x91ecc4;})[_0x9791('0x27')](respondWithResult(_0x110af9,0xc9))[_0x9791('0x44')](handleError(_0x110af9,null));};exports[_0x9791('0x53')]=function(_0x430784,_0x576c26){var _0x42ac79={'where':{'id':_0x430784['params']['id']}},_0x219fa7={};_0x219fa7[_0x9791('0x32')]=_[_0x9791('0x34')](db[_0x9791('0x2e')]['rawAttributes']);_0x42ac79[_0x9791('0x37')]=_['intersection'](_0x219fa7[_0x9791('0x32')],qs[_0x9791('0x38')](_0x430784['query'][_0x9791('0x38')]));_0x42ac79[_0x9791('0x37')]=_0x42ac79[_0x9791('0x37')][_0x9791('0x39')]?_0x42ac79[_0x9791('0x37')]:_0x219fa7[_0x9791('0x32')];if(_0x430784[_0x9791('0x33')][_0x9791('0x41')]){_0x42ac79['include']=[{'all':!![]}];}_0x42ac79=_[_0x9791('0x3e')]({},_0x42ac79,_0x430784['options']);return db[_0x9791('0x2e')][_0x9791('0x49')](_0x42ac79)[_0x9791('0x27')](handleEntityNotFound(_0x576c26,null))['then'](function(_0x2dbfec){if(_0x2dbfec){var _0x244ae8=_0x2dbfec['get']({'plain':!![]});_0x244ae8=qs['omit'](_0x244ae8,['id','createdAt',_0x9791('0x54')]);_0x430784[_0x9791('0x55')]=_[_0x9791('0x56')](_0x430784[_0x9791('0x55')],['id',_0x9791('0x57'),_0x9791('0x54')]);return db['Campaign'][_0x9791('0x4a')](_[_0x9791('0x3e')](_0x244ae8,_0x430784['body']),{'include':_0x430784[_0x9791('0x33')][_0x9791('0x41')]?[{'all':!![]}]:undefined})[_0x9791('0x27')](function(_0xaa0d42){var _0x2c93e9=_0x430784[_0x9791('0x4b')][_0x9791('0x25')]({'plain':!![]});if(!_0x2c93e9)throw new Error(_0x9791('0x4c'));if(_0x2c93e9[_0x9791('0x4d')]==='user'){var _0x43143a=_0xaa0d42[_0x9791('0x25')]({'plain':!![]});var _0x26aa27='IvrCampaigns';return db['UserProfileSection'][_0x9791('0x49')]({'where':{'name':_0x26aa27,'userProfileId':_0x2c93e9[_0x9791('0x50')]},'raw':!![]})[_0x9791('0x27')](function(_0x3a88c7){if(_0x3a88c7&&_0x3a88c7[_0x9791('0x51')]===0x0){return db[_0x9791('0x26')][_0x9791('0x4a')]({'name':_0x43143a[_0x9791('0x2a')],'resourceId':_0x43143a['id'],'type':_0x3a88c7[_0x9791('0x2a')],'sectionId':_0x3a88c7['id']},{})[_0x9791('0x27')](function(){return _0xaa0d42;});}else{return _0xaa0d42;}})[_0x9791('0x44')](function(_0x46304f){logger['error'](_0x9791('0x52'),_0x46304f);throw _0x46304f;});}return _0xaa0d42;});}})[_0x9791('0x27')](respondWithResult(_0x576c26,0xc9))[_0x9791('0x44')](handleError(_0x576c26,null));};exports['update']=function(_0x46b257,_0x1c41de){if(_0x46b257[_0x9791('0x55')]['id']){delete _0x46b257[_0x9791('0x55')]['id'];}return db['Campaign'][_0x9791('0x49')]({'where':{'id':_0x46b257[_0x9791('0x46')]['id']}})[_0x9791('0x27')](handleEntityNotFound(_0x1c41de,null))[_0x9791('0x27')](saveUpdates(_0x46b257['body'],null))[_0x9791('0x27')](respondWithResult(_0x1c41de,null))[_0x9791('0x44')](handleError(_0x1c41de,null));};exports[_0x9791('0x24')]=function(_0x18ff07,_0x3232ec){return db[_0x9791('0x2e')][_0x9791('0x49')]({'where':{'id':_0x18ff07[_0x9791('0x46')]['id']}})['then'](handleEntityNotFound(_0x3232ec,null))[_0x9791('0x27')](removeEntity(_0x3232ec,null))[_0x9791('0x44')](handleError(_0x3232ec,null));};exports[_0x9791('0x58')]=function(_0x5a2c8d,_0x3a6bd4,_0x4e627a){var _0x442a2e={'raw':!![],'where':{}};var _0x30511f={};var _0x42a829={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x5a2c8d[_0x9791('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a6bd4,null))[_0x9791('0x27')](function(_0x31e3de){if(_0x31e3de){_0x30511f[_0x9791('0x32')]=_[_0x9791('0x34')](db[_0x9791('0x59')][_0x9791('0x2f')]);_0x30511f[_0x9791('0x33')]=_[_0x9791('0x34')](_0x5a2c8d[_0x9791('0x33')]);_0x30511f[_0x9791('0x35')]=_[_0x9791('0x36')](_0x30511f[_0x9791('0x32')],_0x30511f[_0x9791('0x33')]);_0x442a2e[_0x9791('0x37')]=_[_0x9791('0x36')](_0x30511f[_0x9791('0x32')],qs[_0x9791('0x38')](_0x5a2c8d[_0x9791('0x33')][_0x9791('0x38')]));_0x442a2e[_0x9791('0x37')]=_0x442a2e[_0x9791('0x37')][_0x9791('0x39')]?_0x442a2e[_0x9791('0x37')]:_0x30511f[_0x9791('0x32')];if(!_0x5a2c8d[_0x9791('0x33')][_0x9791('0x3a')](_0x9791('0x5a'))){_0x442a2e[_0x9791('0x1d')]=qs['limit'](_0x5a2c8d[_0x9791('0x33')][_0x9791('0x1d')]);_0x442a2e['offset']=qs['offset'](_0x5a2c8d[_0x9791('0x33')][_0x9791('0x1b')]);}_0x442a2e[_0x9791('0x5b')]=qs[_0x9791('0x3b')](_0x5a2c8d[_0x9791('0x33')][_0x9791('0x3b')]);_0x442a2e[_0x9791('0x3c')]=qs[_0x9791('0x35')](_[_0x9791('0x5c')](_0x5a2c8d[_0x9791('0x33')],_0x30511f[_0x9791('0x35')]));_0x442a2e[_0x9791('0x3c')][_0x9791('0x5d')]=_0x31e3de['id'];if(_0x5a2c8d[_0x9791('0x33')][_0x9791('0x3d')]){_0x442a2e[_0x9791('0x3c')]=_[_0x9791('0x3e')](_0x442a2e[_0x9791('0x3c')],{'$or':_[_0x9791('0x2d')](_0x442a2e[_0x9791('0x37')],function(_0x13fba3){var _0x4a743c={};_0x4a743c[_0x13fba3]={'$like':'%'+_0x5a2c8d[_0x9791('0x33')][_0x9791('0x3d')]+'%'};return _0x4a743c;})});}_0x442a2e=_[_0x9791('0x3e')]({},_0x442a2e,_0x5a2c8d['options']);return db[_0x9791('0x59')][_0x9791('0x1e')]({'where':_0x442a2e[_0x9791('0x3c')]})[_0x9791('0x27')](function(_0xf3292c){_0x42a829[_0x9791('0x1e')]=_0xf3292c;if(_0x5a2c8d['query'][_0x9791('0x41')]){_0x442a2e[_0x9791('0x47')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x442a2e);})['then'](function(_0x200057){_0x42a829[_0x9791('0x43')]=_0x200057;return _0x42a829;});}})[_0x9791('0x27')](respondWithFilteredResult(_0x3a6bd4,_0x442a2e))[_0x9791('0x44')](handleError(_0x3a6bd4,null));};exports[_0x9791('0x5e')]=function(_0xfe6eea,_0x412365,_0x18089a){var _0x19b38e={'raw':!![],'where':{}};var _0x5ef8c2={};var _0x355c48={'count':0x0,'rows':[]};return db['Campaign'][_0x9791('0x5f')]({'where':{'id':_0xfe6eea[_0x9791('0x46')]['id']}})[_0x9791('0x27')](handleEntityNotFound(_0x412365,null))[_0x9791('0x27')](function(_0x47175a){if(_0x47175a){_0x5ef8c2[_0x9791('0x32')]=_['keys'](db['CmHopperHistory'][_0x9791('0x2f')]);_0x5ef8c2['query']=_[_0x9791('0x34')](_0xfe6eea['query']);_0x5ef8c2['filters']=_['intersection'](_0x5ef8c2[_0x9791('0x32')],_0x5ef8c2[_0x9791('0x33')]);_0x19b38e[_0x9791('0x37')]=_['intersection'](_0x5ef8c2['model'],qs[_0x9791('0x38')](_0xfe6eea[_0x9791('0x33')][_0x9791('0x38')]));_0x19b38e['attributes']=_0x19b38e[_0x9791('0x37')][_0x9791('0x39')]?_0x19b38e[_0x9791('0x37')]:_0x5ef8c2[_0x9791('0x32')];if(!_0xfe6eea[_0x9791('0x33')]['hasOwnProperty']('nolimit')){_0x19b38e[_0x9791('0x1d')]=qs[_0x9791('0x1d')](_0xfe6eea[_0x9791('0x33')][_0x9791('0x1d')]);_0x19b38e[_0x9791('0x1b')]=qs[_0x9791('0x1b')](_0xfe6eea[_0x9791('0x33')][_0x9791('0x1b')]);}_0x19b38e[_0x9791('0x5b')]=qs[_0x9791('0x3b')](_0xfe6eea[_0x9791('0x33')][_0x9791('0x3b')]);_0x19b38e[_0x9791('0x3c')]=qs[_0x9791('0x35')](_[_0x9791('0x5c')](_0xfe6eea[_0x9791('0x33')],_0x5ef8c2['filters']));_0x19b38e['where']['CampaignId']=_0x47175a['id'];if(_0xfe6eea[_0x9791('0x33')][_0x9791('0x3d')]){_0x19b38e[_0x9791('0x3c')]=_['merge'](_0x19b38e[_0x9791('0x3c')],{'$or':_[_0x9791('0x2d')](_0x19b38e['attributes'],function(_0x93e6a5){var _0x5b2b3e={};_0x5b2b3e[_0x93e6a5]={'$like':'%'+_0xfe6eea[_0x9791('0x33')]['filter']+'%'};return _0x5b2b3e;})});}_0x19b38e=_['merge']({},_0x19b38e,_0xfe6eea[_0x9791('0x48')]);return db[_0x9791('0x60')][_0x9791('0x1e')]({'where':_0x19b38e['where']})['then'](function(_0x5d210c){_0x355c48[_0x9791('0x1e')]=_0x5d210c;if(_0xfe6eea['query']['includeAll']){_0x19b38e[_0x9791('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9791('0x42')](_0x19b38e);})['then'](function(_0xf8ff1e){_0x355c48[_0x9791('0x43')]=_0xf8ff1e;return _0x355c48;});}})['then'](respondWithFilteredResult(_0x412365,_0x19b38e))[_0x9791('0x44')](handleError(_0x412365,null));};exports[_0x9791('0x61')]=function(_0x51f5ad,_0x638cf5,_0x190b71){var _0xaf9c61={'raw':!![],'where':{}};var _0x297a0c={};var _0x17de07={'count':0x0,'rows':[]};return db[_0x9791('0x2e')][_0x9791('0x5f')]({'where':{'id':_0x51f5ad['params']['id']}})[_0x9791('0x27')](handleEntityNotFound(_0x638cf5,null))[_0x9791('0x27')](function(_0x3d267a){if(_0x3d267a){_0x297a0c[_0x9791('0x32')]=_['keys'](db['CmHopperFinal'][_0x9791('0x2f')]);_0x297a0c[_0x9791('0x33')]=_[_0x9791('0x34')](_0x51f5ad['query']);_0x297a0c[_0x9791('0x35')]=_[_0x9791('0x36')](_0x297a0c[_0x9791('0x32')],_0x297a0c[_0x9791('0x33')]);_0xaf9c61[_0x9791('0x37')]=_[_0x9791('0x36')](_0x297a0c[_0x9791('0x32')],qs[_0x9791('0x38')](_0x51f5ad[_0x9791('0x33')][_0x9791('0x38')]));_0xaf9c61[_0x9791('0x37')]=_0xaf9c61[_0x9791('0x37')][_0x9791('0x39')]?_0xaf9c61[_0x9791('0x37')]:_0x297a0c[_0x9791('0x32')];if(!_0x51f5ad[_0x9791('0x33')][_0x9791('0x3a')](_0x9791('0x5a'))){_0xaf9c61[_0x9791('0x1d')]=qs[_0x9791('0x1d')](_0x51f5ad[_0x9791('0x33')]['limit']);_0xaf9c61['offset']=qs['offset'](_0x51f5ad[_0x9791('0x33')][_0x9791('0x1b')]);}_0xaf9c61[_0x9791('0x5b')]=qs[_0x9791('0x3b')](_0x51f5ad['query'][_0x9791('0x3b')]);_0xaf9c61[_0x9791('0x3c')]=qs[_0x9791('0x35')](_[_0x9791('0x5c')](_0x51f5ad[_0x9791('0x33')],_0x297a0c[_0x9791('0x35')]));_0xaf9c61[_0x9791('0x3c')][_0x9791('0x5d')]=_0x3d267a['id'];if(_0x51f5ad[_0x9791('0x33')][_0x9791('0x3d')]){_0xaf9c61[_0x9791('0x3c')]=_[_0x9791('0x3e')](_0xaf9c61['where'],{'$or':_['map'](_0xaf9c61[_0x9791('0x37')],function(_0x42d355){var _0x42c401={};_0x42c401[_0x42d355]={'$like':'%'+_0x51f5ad[_0x9791('0x33')][_0x9791('0x3d')]+'%'};return _0x42c401;})});}_0xaf9c61=_['merge']({},_0xaf9c61,_0x51f5ad[_0x9791('0x48')]);return db[_0x9791('0x62')][_0x9791('0x1e')]({'where':_0xaf9c61[_0x9791('0x3c')]})[_0x9791('0x27')](function(_0x3abcec){_0x17de07['count']=_0x3abcec;if(_0x51f5ad['query']['includeAll']){_0xaf9c61[_0x9791('0x47')]=[{'all':!![]}];}return db[_0x9791('0x62')][_0x9791('0x42')](_0xaf9c61);})[_0x9791('0x27')](function(_0x341fbf){_0x17de07[_0x9791('0x43')]=_0x341fbf;return _0x17de07;});}})[_0x9791('0x27')](respondWithFilteredResult(_0x638cf5,_0xaf9c61))[_0x9791('0x44')](handleError(_0x638cf5,null));};exports['getHopperBlacks']=function(_0x41de54,_0x57ad74,_0x505e29){var _0x3d0a12={'raw':!![],'where':{}};var _0x4a57ef={};var _0x106753={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x41de54['params']['id']}})[_0x9791('0x27')](handleEntityNotFound(_0x57ad74,null))[_0x9791('0x27')](function(_0x4a85c4){if(_0x4a85c4){_0x4a57ef[_0x9791('0x32')]=_[_0x9791('0x34')](db[_0x9791('0x63')][_0x9791('0x2f')]);_0x4a57ef[_0x9791('0x33')]=_[_0x9791('0x34')](_0x41de54[_0x9791('0x33')]);_0x4a57ef[_0x9791('0x35')]=_[_0x9791('0x36')](_0x4a57ef[_0x9791('0x32')],_0x4a57ef[_0x9791('0x33')]);_0x3d0a12[_0x9791('0x37')]=_['intersection'](_0x4a57ef['model'],qs[_0x9791('0x38')](_0x41de54['query']['fields']));_0x3d0a12[_0x9791('0x37')]=_0x3d0a12[_0x9791('0x37')][_0x9791('0x39')]?_0x3d0a12[_0x9791('0x37')]:_0x4a57ef[_0x9791('0x32')];if(!_0x41de54[_0x9791('0x33')]['hasOwnProperty'](_0x9791('0x5a'))){_0x3d0a12[_0x9791('0x1d')]=qs['limit'](_0x41de54[_0x9791('0x33')][_0x9791('0x1d')]);_0x3d0a12['offset']=qs[_0x9791('0x1b')](_0x41de54['query'][_0x9791('0x1b')]);}_0x3d0a12[_0x9791('0x5b')]=qs[_0x9791('0x3b')](_0x41de54['query'][_0x9791('0x3b')]);_0x3d0a12[_0x9791('0x3c')]=qs[_0x9791('0x35')](_['pick'](_0x41de54[_0x9791('0x33')],_0x4a57ef[_0x9791('0x35')]));_0x3d0a12[_0x9791('0x3c')][_0x9791('0x5d')]=_0x4a85c4['id'];if(_0x41de54[_0x9791('0x33')][_0x9791('0x3d')]){_0x3d0a12['where']=_[_0x9791('0x3e')](_0x3d0a12[_0x9791('0x3c')],{'$or':_[_0x9791('0x2d')](_0x3d0a12[_0x9791('0x37')],function(_0x49ff0c){var _0x76a1f1={};_0x76a1f1[_0x49ff0c]={'$like':'%'+_0x41de54[_0x9791('0x33')][_0x9791('0x3d')]+'%'};return _0x76a1f1;})});}_0x3d0a12=_[_0x9791('0x3e')]({},_0x3d0a12,_0x41de54[_0x9791('0x48')]);return db[_0x9791('0x63')][_0x9791('0x1e')]({'where':_0x3d0a12[_0x9791('0x3c')]})[_0x9791('0x27')](function(_0xd4b46b){_0x106753[_0x9791('0x1e')]=_0xd4b46b;if(_0x41de54[_0x9791('0x33')]['includeAll']){_0x3d0a12[_0x9791('0x47')]=[{'all':!![]}];}return db[_0x9791('0x63')][_0x9791('0x42')](_0x3d0a12);})['then'](function(_0x156dd9){_0x106753[_0x9791('0x43')]=_0x156dd9;return _0x106753;});}})['then'](respondWithFilteredResult(_0x57ad74,_0x3d0a12))['catch'](handleError(_0x57ad74,null));};exports[_0x9791('0x64')]=function(_0x8c53bb,_0x60ada0,_0x399dc2){var _0x3115c3={};var _0x341961={};var _0x36239d;var _0x3ab3f5;return db[_0x9791('0x2e')][_0x9791('0x5f')]({'where':{'id':_0x8c53bb[_0x9791('0x46')]['id']}})[_0x9791('0x27')](handleEntityNotFound(_0x60ada0,null))[_0x9791('0x27')](function(_0x3b4ac4){if(_0x3b4ac4){_0x36239d=_0x3b4ac4;_0x341961['model']=_[_0x9791('0x34')](db[_0x9791('0x65')][_0x9791('0x2f')]);_0x341961[_0x9791('0x33')]=_['keys'](_0x8c53bb[_0x9791('0x33')]);_0x341961[_0x9791('0x35')]=_[_0x9791('0x36')](_0x341961['model'],_0x341961[_0x9791('0x33')]);_0x3115c3[_0x9791('0x37')]=_[_0x9791('0x36')](_0x341961[_0x9791('0x32')],qs[_0x9791('0x38')](_0x8c53bb[_0x9791('0x33')]['fields']));_0x3115c3[_0x9791('0x37')]=_0x3115c3[_0x9791('0x37')][_0x9791('0x39')]?_0x3115c3[_0x9791('0x37')]:_0x341961['model'];_0x3115c3['order']=qs[_0x9791('0x3b')](_0x8c53bb[_0x9791('0x33')][_0x9791('0x3b')]);_0x3115c3['where']=qs[_0x9791('0x35')](_[_0x9791('0x5c')](_0x8c53bb['query'],_0x341961['filters']));if(_0x8c53bb['query'][_0x9791('0x3d')]){_0x3115c3[_0x9791('0x3c')]=_[_0x9791('0x3e')](_0x3115c3[_0x9791('0x3c')],{'$or':_[_0x9791('0x2d')](_0x3115c3['attributes'],function(_0x319222){var _0x10b47b={};_0x10b47b[_0x319222]={'$like':'%'+_0x8c53bb['query'][_0x9791('0x3d')]+'%'};return _0x10b47b;})});}_0x3115c3=_[_0x9791('0x3e')]({},_0x3115c3,_0x8c53bb[_0x9791('0x48')]);return _0x36239d['getLists'](_0x3115c3);}})[_0x9791('0x27')](function(_0x489c1f){if(_0x489c1f){_0x3ab3f5=_0x489c1f[_0x9791('0x39')];if(!_0x8c53bb['query']['hasOwnProperty'](_0x9791('0x5a'))){_0x3115c3[_0x9791('0x1d')]=qs[_0x9791('0x1d')](_0x8c53bb[_0x9791('0x33')][_0x9791('0x1d')]);_0x3115c3[_0x9791('0x1b')]=qs['offset'](_0x8c53bb[_0x9791('0x33')]['offset']);}return _0x36239d['getLists'](_0x3115c3);}})[_0x9791('0x27')](function(_0x148561){if(_0x148561){return _0x148561?{'count':_0x3ab3f5,'rows':_0x148561}:null;}})['then'](respondWithResult(_0x60ada0,null))[_0x9791('0x44')](handleError(_0x60ada0,null));};exports[_0x9791('0x66')]=function(_0x40d227,_0x58c205,_0x3f14cf){var _0xf5eaf3,_0x23c74f;return db[_0x9791('0x2e')][_0x9791('0x49')]({'where':{'id':_0x40d227['params']['id']}})[_0x9791('0x27')](handleEntityNotFound(_0x58c205,null))[_0x9791('0x27')](function(_0x241f9e){if(_0x241f9e){_0x23c74f=_0x241f9e;return _0x241f9e[_0x9791('0x66')](_0x40d227[_0x9791('0x55')][_0x9791('0x67')],_[_0x9791('0x56')](_0x40d227[_0x9791('0x55')],[_0x9791('0x67'),'id'])||{});}return null;})['spread'](function(_0xf254db){var _0x7dc26e;_0xf5eaf3=_0xf254db||[];var _0x503438=[];if(_0xf254db){for(var _0x56bdba=0x0;_0x56bdba<_0xf254db[_0x9791('0x39')];_0x56bdba+=0x1){var _0x11ecac=_0xf254db[_0x56bdba][_0x9791('0x25')]({'plain':!![]});_0x23c74f[_0x9791('0x68')]=_0x40d227[_0x9791('0x55')][_0x9791('0x68')]?_0x40d227[_0x9791('0x55')][_0x9791('0x68')]:_0x23c74f['dialCheckDuplicateType'];switch(_0x23c74f[_0x9791('0x68')]){case _0x9791('0x69'):_0x7dc26e=squel['insert']()[_0x9791('0x6a')](_0x9791('0x6b'))[_0x9791('0x6c')]([_0x9791('0x6d'),_0x9791('0x6e'),_0x9791('0x6f'),'ListId',_0x9791('0x5d'),_0x9791('0x57'),'updatedAt'],squel[_0x9791('0x70')]()['field'](_0x9791('0x6d'),_0x9791('0x6d'))[_0x9791('0x71')](_0x9791('0x72'),_0x9791('0x6e'))['field']('id','ContactId')[_0x9791('0x71')](_0x11ecac[_0x9791('0x73')][_0x9791('0x74')](),_0x9791('0x75'))[_0x9791('0x71')](_0x40d227[_0x9791('0x46')]['id'][_0x9791('0x74')](),_0x9791('0x5d'))[_0x9791('0x71')](_0x9791('0x72'),_0x9791('0x57'))[_0x9791('0x71')](_0x9791('0x72'),'updatedAt')['from'](_0x9791('0x76'))[_0x9791('0x3c')](_0x9791('0x77'))[_0x9791('0x3c')](_0x9791('0x78'),_0x11ecac[_0x9791('0x73')][_0x9791('0x74')]())[_0x9791('0x3c')](_0x9791('0x79'))[_0x9791('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x9791('0x71')](_0x9791('0x7a'))[_0x9791('0x7b')](_0x9791('0x7c'))['where']('CampaignId\x20=\x20?',_0x40d227['params']['id'][_0x9791('0x74')]()))[_0x9791('0x3c')](_0x9791('0x7d'),squel[_0x9791('0x70')]()[_0x9791('0x71')](_0x9791('0x7e'))[_0x9791('0x7b')](_0x9791('0x6b'))[_0x9791('0x3c')](_0x9791('0x7f'),_0x40d227[_0x9791('0x46')]['id'][_0x9791('0x74')]())))[_0x9791('0x74')]();break;case'onlyIfOpen':_0x7dc26e=squel['insert']()[_0x9791('0x6a')]('cm_hopper')['fromQuery']([_0x9791('0x6d'),_0x9791('0x6e'),_0x9791('0x6f'),_0x9791('0x75'),_0x9791('0x5d'),'createdAt',_0x9791('0x54')],squel[_0x9791('0x70')]()['field'](_0x9791('0x6d'),_0x9791('0x6d'))[_0x9791('0x71')](_0x9791('0x72'),_0x9791('0x6e'))['field']('id',_0x9791('0x6f'))['field'](_0x11ecac[_0x9791('0x73')][_0x9791('0x74')](),_0x9791('0x75'))[_0x9791('0x71')](_0x40d227[_0x9791('0x46')]['id'][_0x9791('0x74')](),_0x9791('0x5d'))[_0x9791('0x71')]('NOW()',_0x9791('0x57'))[_0x9791('0x71')](_0x9791('0x72'),_0x9791('0x54'))[_0x9791('0x7b')]('cm_contacts')[_0x9791('0x3c')](_0x9791('0x77'))[_0x9791('0x3c')](_0x9791('0x78'),_0x11ecac[_0x9791('0x73')][_0x9791('0x74')]())[_0x9791('0x3c')](_0x9791('0x79'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x9791('0x70')]()[_0x9791('0x71')](_0x9791('0x7e'))[_0x9791('0x7b')](_0x9791('0x6b'))[_0x9791('0x3c')](_0x9791('0x7f'),_0x40d227['params']['id'][_0x9791('0x74')]())))[_0x9791('0x74')]();break;default:_0x7dc26e=squel[_0x9791('0x80')]()[_0x9791('0x6a')](_0x9791('0x6b'))['fromQuery']([_0x9791('0x6d'),_0x9791('0x6e'),'ContactId',_0x9791('0x75'),_0x9791('0x5d'),_0x9791('0x57'),'updatedAt'],squel[_0x9791('0x70')]()['field']('phone',_0x9791('0x6d'))[_0x9791('0x71')](_0x9791('0x72'),'scheduledAt')[_0x9791('0x71')]('id',_0x9791('0x6f'))['field'](_0x11ecac[_0x9791('0x73')]['toString'](),_0x9791('0x75'))[_0x9791('0x71')](_0x40d227['params']['id'][_0x9791('0x74')](),_0x9791('0x5d'))['field'](_0x9791('0x72'),_0x9791('0x57'))[_0x9791('0x71')]('NOW()',_0x9791('0x54'))['from'](_0x9791('0x76'))[_0x9791('0x3c')](_0x9791('0x77'))['where'](_0x9791('0x78'),_0x11ecac[_0x9791('0x73')]['toString']())[_0x9791('0x3c')](_0x9791('0x79')))[_0x9791('0x74')]();}_0x503438[_0x9791('0x81')](db[_0x9791('0x82')][_0x9791('0x33')](_0x7dc26e));}return BPromise['all'](_0x503438);}})[_0x9791('0x27')](function(){return _0xf5eaf3;})[_0x9791('0x27')](respondWithResult(_0x58c205,null))['catch'](handleError(_0x58c205,null));};exports[_0x9791('0x83')]=function(_0xd83586,_0x597f20,_0x9ceb14){return db[_0x9791('0x2e')][_0x9791('0x49')]({'where':{'id':_0xd83586[_0x9791('0x46')]['id']}})[_0x9791('0x27')](handleEntityNotFound(_0x597f20,null))[_0x9791('0x27')](function(_0x80c63b){if(_0x80c63b){return _0x80c63b[_0x9791('0x83')](_0xd83586['query'][_0x9791('0x67')]);}})['then'](function(_0x3cfadd){if(_0x3cfadd){return db[_0x9791('0x59')][_0x9791('0x24')]({'where':{'ListId':_0xd83586[_0x9791('0x33')][_0x9791('0x67')],'CampaignId':_0xd83586[_0x9791('0x46')]['id']}})[_0x9791('0x27')](function(){return _0x3cfadd;});}})['then'](respondWithStatusCode(_0x597f20,null))[_0x9791('0x44')](handleError(_0x597f20,null));};exports[_0x9791('0x84')]=function(_0x338ebc,_0x42b385,_0x3ac6bd){var _0x2f109d={};var _0x505ea9={};var _0xb7ad77;var _0x52751c;return db['Campaign'][_0x9791('0x5f')]({'where':{'id':_0x338ebc[_0x9791('0x46')]['id']}})[_0x9791('0x27')](handleEntityNotFound(_0x42b385,null))['then'](function(_0x390bd7){if(_0x390bd7){_0xb7ad77=_0x390bd7;_0x505ea9[_0x9791('0x32')]=_[_0x9791('0x34')](db[_0x9791('0x65')][_0x9791('0x2f')]);_0x505ea9[_0x9791('0x33')]=_[_0x9791('0x34')](_0x338ebc[_0x9791('0x33')]);_0x505ea9[_0x9791('0x35')]=_[_0x9791('0x36')](_0x505ea9[_0x9791('0x32')],_0x505ea9[_0x9791('0x33')]);_0x2f109d[_0x9791('0x37')]=_['intersection'](_0x505ea9['model'],qs[_0x9791('0x38')](_0x338ebc[_0x9791('0x33')][_0x9791('0x38')]));_0x2f109d['attributes']=_0x2f109d[_0x9791('0x37')][_0x9791('0x39')]?_0x2f109d['attributes']:_0x505ea9[_0x9791('0x32')];_0x2f109d[_0x9791('0x5b')]=qs[_0x9791('0x3b')](_0x338ebc[_0x9791('0x33')][_0x9791('0x3b')]);_0x2f109d[_0x9791('0x3c')]=qs[_0x9791('0x35')](_[_0x9791('0x5c')](_0x338ebc[_0x9791('0x33')],_0x505ea9[_0x9791('0x35')]));if(_0x338ebc[_0x9791('0x33')][_0x9791('0x3d')]){_0x2f109d[_0x9791('0x3c')]=_[_0x9791('0x3e')](_0x2f109d[_0x9791('0x3c')],{'$or':_[_0x9791('0x2d')](_0x2f109d[_0x9791('0x37')],function(_0x30269c){var _0x5c59ba={};_0x5c59ba[_0x30269c]={'$like':'%'+_0x338ebc[_0x9791('0x33')][_0x9791('0x3d')]+'%'};return _0x5c59ba;})});}_0x2f109d=_[_0x9791('0x3e')]({},_0x2f109d,_0x338ebc[_0x9791('0x48')]);return _0xb7ad77[_0x9791('0x84')](_0x2f109d);}})['then'](function(_0xec3e73){if(_0xec3e73){_0x52751c=_0xec3e73[_0x9791('0x39')];if(!_0x338ebc['query'][_0x9791('0x3a')](_0x9791('0x5a'))){_0x2f109d['limit']=qs['limit'](_0x338ebc[_0x9791('0x33')][_0x9791('0x1d')]);_0x2f109d[_0x9791('0x1b')]=qs['offset'](_0x338ebc[_0x9791('0x33')]['offset']);}return _0xb7ad77['getBlackLists'](_0x2f109d);}})[_0x9791('0x27')](function(_0x24ab76){if(_0x24ab76){return _0x24ab76?{'count':_0x52751c,'rows':_0x24ab76}:null;}})[_0x9791('0x27')](respondWithResult(_0x42b385,null))[_0x9791('0x44')](handleError(_0x42b385,null));};exports[_0x9791('0x85')]=function(_0x3d56a6,_0x27f4f0,_0x40c0ec){var _0x4299a4,_0x43116e;return db[_0x9791('0x2e')][_0x9791('0x49')]({'where':{'id':_0x3d56a6['params']['id']}})['then'](handleEntityNotFound(_0x27f4f0,null))[_0x9791('0x27')](function(_0x5c584a){if(_0x5c584a){_0x43116e=_0x5c584a;return _0x5c584a['addBlackLists'](_0x3d56a6[_0x9791('0x55')][_0x9791('0x67')],_['omit'](_0x3d56a6['body'],[_0x9791('0x67'),'id'])||{});}return null;})[_0x9791('0x86')](function(_0x356526){var _0x589282;_0x4299a4=_0x356526||[];var _0x2d50d6=[];if(_0x356526){for(var _0x2be4fb=0x0;_0x2be4fb<_0x356526[_0x9791('0x39')];_0x2be4fb+=0x1){var _0x5aed4d=_0x356526[_0x2be4fb][_0x9791('0x25')]({'plain':!![]});_0x589282=squel[_0x9791('0x80')]()['into']('cm_hopper_black')[_0x9791('0x6c')]([_0x9791('0x6d'),'ContactId',_0x9791('0x75'),'CampaignId',_0x9791('0x57'),_0x9791('0x54')],squel[_0x9791('0x70')]()['field'](_0x9791('0x6d'),'phone')[_0x9791('0x71')]('id',_0x9791('0x6f'))['field'](_0x5aed4d[_0x9791('0x73')][_0x9791('0x74')](),'ListId')[_0x9791('0x71')](_0x3d56a6[_0x9791('0x46')]['id'][_0x9791('0x74')](),_0x9791('0x5d'))['field'](_0x9791('0x72'),_0x9791('0x57'))[_0x9791('0x71')](_0x9791('0x72'),_0x9791('0x54'))['from'](_0x9791('0x76'))[_0x9791('0x3c')](_0x9791('0x77'))[_0x9791('0x3c')](_0x9791('0x78'),_0x5aed4d[_0x9791('0x73')][_0x9791('0x74')]())[_0x9791('0x3c')](_0x9791('0x79')))[_0x9791('0x74')]();_0x2d50d6[_0x9791('0x81')](db[_0x9791('0x82')][_0x9791('0x33')](_0x589282));}return BPromise[_0x9791('0x87')](_0x2d50d6);}})['then'](function(){return _0x4299a4;})[_0x9791('0x27')](respondWithResult(_0x27f4f0,null))['catch'](handleError(_0x27f4f0,null));};exports[_0x9791('0x88')]=function(_0x1509ed,_0x66c698,_0x32db7f){return db[_0x9791('0x2e')][_0x9791('0x49')]({'where':{'id':_0x1509ed[_0x9791('0x46')]['id']}})[_0x9791('0x27')](handleEntityNotFound(_0x66c698,null))[_0x9791('0x27')](function(_0x11d890){if(_0x11d890){return _0x11d890[_0x9791('0x88')](_0x1509ed[_0x9791('0x33')][_0x9791('0x67')]);}})[_0x9791('0x27')](function(_0x1ba332){if(_0x1ba332){return db['CmHopperBlack'][_0x9791('0x24')]({'where':{'ListId':_0x1509ed['query'][_0x9791('0x67')],'CampaignId':_0x1509ed[_0x9791('0x46')]['id']}})['then'](function(){return _0x1ba332;});}})[_0x9791('0x27')](respondWithStatusCode(_0x66c698,null))[_0x9791('0x44')](handleError(_0x66c698,null));};
\ No newline at end of file
index 10de0b9..0105ef5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x39aa81,_0xa27032){var _0x58cddd=function(_0x3a1509){while(--_0x3a1509){_0x39aa81['push'](_0x39aa81['shift']());}};_0x58cddd(++_0xa27032);}(_0x7a54,0x106));var _0x47a5=function(_0x2c7887,_0x114d72){_0x2c7887=_0x2c7887-0x0;var _0x24e799=_0x7a54[_0x2c7887];return _0x24e799;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x195588,_0xacd327){var _0x5232f0=function(_0x571fe9){while(--_0x571fe9){_0x195588['push'](_0x195588['shift']());}};_0x5232f0(++_0xacd327);}(_0x7a54,0x106));var _0x47a5=function(_0x34bb34,_0x2b0300){_0x34bb34=_0x34bb34-0x0;var _0x3fdb1d=_0x7a54[_0x34bb34];return _0x3fdb1d;};'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 80052b3..69d6fba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb469=['include','model','map','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','debug','request\x20sent','error','message','info','result','GetCampaign','findAll','options','raw','attributes','limit'];(function(_0x345533,_0x5ab2d8){var _0x2cbd8c=function(_0x468bc1){while(--_0x468bc1){_0x345533['push'](_0x345533['shift']());}};_0x2cbd8c(++_0x5ab2d8);}(_0xb469,0x13b));var _0x9b46=function(_0x569ed9,_0x4bf013){_0x569ed9=_0x569ed9-0x0;var _0x253719=_0xb469[_0x569ed9];return _0x253719;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var BPromise=require(_0x9b46('0x3'));var rs=require(_0x9b46('0x4'));var fs=require('fs');var Redis=require(_0x9b46('0x5'));var db=require(_0x9b46('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b46('0x7'))(_0x9b46('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b46('0x9'));var client=jayson[_0x9b46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2dd3,_0x5bd834,_0x4c1ed9){return new BPromise(function(_0x34c0de,_0x545b6c){return client[_0x9b46('0xb')](_0x1b2dd3,_0x4c1ed9)[_0x9b46('0xc')](function(_0x43a112){logger['info'](_0x9b46('0xd'),_0x5bd834,'request\x20sent');logger[_0x9b46('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5bd834,_0x9b46('0xf'),JSON['stringify'](_0x43a112));if(_0x43a112[_0x9b46('0x10')]){if(_0x43a112[_0x9b46('0x10')]['code']===0x1f4){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112['error'][_0x9b46('0x11')]);return _0x545b6c(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);return _0x34c0de(_0x43a112[_0x9b46('0x10')][_0x9b46('0x11')]);}else{logger[_0x9b46('0x12')](_0x9b46('0xd'),_0x5bd834,_0x9b46('0xf'));_0x34c0de(_0x43a112[_0x9b46('0x13')]['message']);}})['catch'](function(_0x52c1b8){logger[_0x9b46('0x10')](_0x9b46('0xd'),_0x5bd834,_0x52c1b8);_0x545b6c(_0x52c1b8);});});}exports[_0x9b46('0x14')]=function(_0x5c5cc9){var _0x5dd7bd=this;return new Promise(function(_0x3d9efa,_0x4ccfd0){return db['Campaign'][_0x9b46('0x15')]({'raw':_0x5c5cc9[_0x9b46('0x16')]?_0x5c5cc9['options'][_0x9b46('0x17')]===undefined?!![]:![]:!![],'where':_0x5c5cc9[_0x9b46('0x16')]?_0x5c5cc9['options']['where']||null:null,'attributes':_0x5c5cc9[_0x9b46('0x16')]?_0x5c5cc9[_0x9b46('0x16')][_0x9b46('0x18')]||null:null,'limit':_0x5c5cc9['options']?_0x5c5cc9['options'][_0x9b46('0x19')]||null:null,'include':_0x5c5cc9['options']?_0x5c5cc9[_0x9b46('0x16')][_0x9b46('0x1a')]?_['map'](_0x5c5cc9[_0x9b46('0x16')]['include'],function(_0x141cb6){return{'model':db[_0x141cb6[_0x9b46('0x1b')]],'as':_0x141cb6['as'],'attributes':_0x141cb6['attributes'],'include':_0x141cb6[_0x9b46('0x1a')]?_[_0x9b46('0x1c')](_0x141cb6[_0x9b46('0x1a')],function(_0x319930){return{'model':db[_0x319930[_0x9b46('0x1b')]],'as':_0x319930['as'],'attributes':_0x319930[_0x9b46('0x18')],'include':_0x319930[_0x9b46('0x1a')]?_['map'](_0x319930[_0x9b46('0x1a')],function(_0x3ac37e){return{'model':db[_0x3ac37e[_0x9b46('0x1b')]],'as':_0x3ac37e['as'],'attributes':_0x3ac37e[_0x9b46('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9b46('0xc')](function(_0x2a79a5){logger[_0x9b46('0x12')]('GetCampaign',_0x5c5cc9);logger[_0x9b46('0xe')](_0x9b46('0x14'),_0x5c5cc9,JSON[_0x9b46('0x1d')](_0x2a79a5));_0x3d9efa(_0x2a79a5);})[_0x9b46('0x1e')](function(_0x28b289){logger[_0x9b46('0x10')](_0x9b46('0x14'),_0x28b289[_0x9b46('0x11')],_0x5c5cc9);_0x4ccfd0(_0x5dd7bd[_0x9b46('0x10')](0x1f4,_0x28b289[_0x9b46('0x11')]));});});};
\ No newline at end of file
+var _0xe6c1=['code','message','result','catch','GetCampaign','Campaign','options','raw','where','attributes','map','model','include','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c5c97,_0x4f85bf){var _0xd5d2cb=function(_0x1e6100){while(--_0x1e6100){_0x4c5c97['push'](_0x4c5c97['shift']());}};_0xd5d2cb(++_0x4f85bf);}(_0xe6c1,0xd8));var _0x1e6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6c1[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x1e6c('0x0'));var moment=require(_0x1e6c('0x1'));var BPromise=require(_0x1e6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e6c('0x3'))['db'];var utils=require(_0x1e6c('0x4'));var logger=require(_0x1e6c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1e6c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x22ee8b,_0x6c4a37,_0x42c541){return new BPromise(function(_0x21bf7a,_0x37e078){return client[_0x1e6c('0x7')](_0x22ee8b,_0x42c541)[_0x1e6c('0x8')](function(_0xe18dae){logger[_0x1e6c('0x9')](_0x1e6c('0xa'),_0x6c4a37,_0x1e6c('0xb'));logger[_0x1e6c('0xc')](_0x1e6c('0xd'),_0x6c4a37,_0x1e6c('0xb'),JSON[_0x1e6c('0xe')](_0xe18dae));if(_0xe18dae[_0x1e6c('0xf')]){if(_0xe18dae[_0x1e6c('0xf')][_0x1e6c('0x10')]===0x1f4){logger[_0x1e6c('0xf')](_0x1e6c('0xa'),_0x6c4a37,_0xe18dae['error'][_0x1e6c('0x11')]);return _0x37e078(_0xe18dae[_0x1e6c('0xf')]['message']);}logger[_0x1e6c('0xf')](_0x1e6c('0xa'),_0x6c4a37,_0xe18dae[_0x1e6c('0xf')][_0x1e6c('0x11')]);return _0x21bf7a(_0xe18dae[_0x1e6c('0xf')][_0x1e6c('0x11')]);}else{logger[_0x1e6c('0x9')]('Campaign,\x20%s,\x20%s',_0x6c4a37,_0x1e6c('0xb'));_0x21bf7a(_0xe18dae[_0x1e6c('0x12')][_0x1e6c('0x11')]);}})[_0x1e6c('0x13')](function(_0x3e0c94){logger['error'](_0x1e6c('0xa'),_0x6c4a37,_0x3e0c94);_0x37e078(_0x3e0c94);});});}exports[_0x1e6c('0x14')]=function(_0xe3ec5d){var _0xa72404=this;return new Promise(function(_0x4dc9d3,_0x43575d){return db[_0x1e6c('0x15')]['findAll']({'raw':_0xe3ec5d['options']?_0xe3ec5d[_0x1e6c('0x16')][_0x1e6c('0x17')]===undefined?!![]:![]:!![],'where':_0xe3ec5d[_0x1e6c('0x16')]?_0xe3ec5d[_0x1e6c('0x16')][_0x1e6c('0x18')]||null:null,'attributes':_0xe3ec5d['options']?_0xe3ec5d[_0x1e6c('0x16')][_0x1e6c('0x19')]||null:null,'limit':_0xe3ec5d[_0x1e6c('0x16')]?_0xe3ec5d['options']['limit']||null:null,'include':_0xe3ec5d[_0x1e6c('0x16')]?_0xe3ec5d[_0x1e6c('0x16')]['include']?_[_0x1e6c('0x1a')](_0xe3ec5d['options']['include'],function(_0x2e92d5){return{'model':db[_0x2e92d5[_0x1e6c('0x1b')]],'as':_0x2e92d5['as'],'attributes':_0x2e92d5[_0x1e6c('0x19')],'include':_0x2e92d5[_0x1e6c('0x1c')]?_[_0x1e6c('0x1a')](_0x2e92d5['include'],function(_0x2bdd9e){return{'model':db[_0x2bdd9e[_0x1e6c('0x1b')]],'as':_0x2bdd9e['as'],'attributes':_0x2bdd9e['attributes'],'include':_0x2bdd9e[_0x1e6c('0x1c')]?_[_0x1e6c('0x1a')](_0x2bdd9e['include'],function(_0x513338){return{'model':db[_0x513338[_0x1e6c('0x1b')]],'as':_0x513338['as'],'attributes':_0x513338[_0x1e6c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1e6c('0x8')](function(_0x2dad9a){logger['info'](_0x1e6c('0x14'),_0xe3ec5d);logger[_0x1e6c('0xc')](_0x1e6c('0x14'),_0xe3ec5d,JSON[_0x1e6c('0xe')](_0x2dad9a));_0x4dc9d3(_0x2dad9a);})[_0x1e6c('0x13')](function(_0x485620){logger['error'](_0x1e6c('0x14'),_0x485620[_0x1e6c('0x11')],_0xe3ec5d);_0x43575d(_0xa72404[_0x1e6c('0xf')](0x1f4,_0x485620['message']));});});};
\ No newline at end of file
index 26f4e0e..41447e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82a2=['../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','get','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','update','delete','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x464055,_0x8cf735){var _0x3eacc4=function(_0x52b45b){while(--_0x52b45b){_0x464055['push'](_0x464055['shift']());}};_0x3eacc4(++_0x8cf735);}(_0x82a2,0x17a));var _0x282a=function(_0x386b19,_0x4e2126){_0x386b19=_0x386b19-0x0;var _0x12af71=_0x82a2[_0x386b19];return _0x12af71;};'use strict';var multer=require(_0x282a('0x0'));var util=require('util');var path=require(_0x282a('0x1'));var timeout=require(_0x282a('0x2'));var express=require(_0x282a('0x3'));var router=express[_0x282a('0x4')]();var fs_extra=require(_0x282a('0x5'));var auth=require(_0x282a('0x6'));var interaction=require(_0x282a('0x7'));var config=require(_0x282a('0x8'));var controller=require(_0x282a('0x9'));router['get']('/',auth[_0x282a('0xa')](),controller['index']);router[_0x282a('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x282a('0xc')]);router[_0x282a('0xb')]('/:id/hoppers',auth[_0x282a('0xa')](),controller[_0x282a('0xd')]);router['get'](_0x282a('0xe'),auth['isAuthenticated'](),controller[_0x282a('0xf')]);router[_0x282a('0xb')](_0x282a('0x10'),auth[_0x282a('0xa')](),controller[_0x282a('0x11')]);router[_0x282a('0xb')]('/:id/hopper_black',auth[_0x282a('0xa')](),controller['getHopperBlacks']);router[_0x282a('0xb')](_0x282a('0x12'),auth[_0x282a('0xa')](),controller[_0x282a('0x13')]);router[_0x282a('0xb')](_0x282a('0x14'),auth[_0x282a('0xa')](),controller[_0x282a('0x15')]);router[_0x282a('0x16')]('/',auth['isAuthenticated'](),controller[_0x282a('0x17')]);router['post'](_0x282a('0x18'),auth['isAuthenticated'](),controller[_0x282a('0x19')]);router[_0x282a('0x16')](_0x282a('0x12'),auth[_0x282a('0xa')](),controller[_0x282a('0x1a')]);router['post'](_0x282a('0x14'),auth['isAuthenticated'](),controller[_0x282a('0x1b')]);router[_0x282a('0x1c')](_0x282a('0x1d'),auth[_0x282a('0xa')](),controller[_0x282a('0x1e')]);router[_0x282a('0x1f')](_0x282a('0x1d'),auth[_0x282a('0xa')](),controller['destroy']);router[_0x282a('0x1f')](_0x282a('0x12'),auth[_0x282a('0xa')](),controller[_0x282a('0x20')]);router[_0x282a('0x1f')](_0x282a('0x14'),auth[_0x282a('0xa')](),controller[_0x282a('0x21')]);module[_0x282a('0x22')]=router;
\ No newline at end of file
+var _0x63f1=['index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','clone','/:id/blacklists','put','destroy','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./campaign.controller','get','isAuthenticated'];(function(_0x4e15d8,_0x2fabaa){var _0xc73281=function(_0x532391){while(--_0x532391){_0x4e15d8['push'](_0x4e15d8['shift']());}};_0xc73281(++_0x2fabaa);}(_0x63f1,0x71));var _0x163f=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x63f1[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x163f('0x0'));var util=require(_0x163f('0x1'));var path=require(_0x163f('0x2'));var timeout=require(_0x163f('0x3'));var express=require(_0x163f('0x4'));var router=express[_0x163f('0x5')]();var fs_extra=require(_0x163f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x163f('0x7'));var config=require('../../config/environment');var controller=require(_0x163f('0x8'));router[_0x163f('0x9')]('/',auth[_0x163f('0xa')](),controller[_0x163f('0xb')]);router[_0x163f('0x9')](_0x163f('0xc'),auth[_0x163f('0xa')](),controller[_0x163f('0xd')]);router[_0x163f('0x9')](_0x163f('0xe'),auth[_0x163f('0xa')](),controller[_0x163f('0xf')]);router[_0x163f('0x9')](_0x163f('0x10'),auth[_0x163f('0xa')](),controller[_0x163f('0x11')]);router[_0x163f('0x9')]('/:id/hopper_finals',auth[_0x163f('0xa')](),controller['getHopperFinals']);router[_0x163f('0x9')](_0x163f('0x12'),auth[_0x163f('0xa')](),controller[_0x163f('0x13')]);router[_0x163f('0x9')](_0x163f('0x14'),auth['isAuthenticated'](),controller[_0x163f('0x15')]);router[_0x163f('0x9')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x163f('0x16')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x163f('0x17')]('/:id/clone',auth[_0x163f('0xa')](),controller[_0x163f('0x18')]);router[_0x163f('0x17')](_0x163f('0x14'),auth[_0x163f('0xa')](),controller['addLists']);router['post'](_0x163f('0x19'),auth[_0x163f('0xa')](),controller['addBlackLists']);router[_0x163f('0x1a')](_0x163f('0xc'),auth[_0x163f('0xa')](),controller['update']);router['delete'](_0x163f('0xc'),auth[_0x163f('0xa')](),controller[_0x163f('0x1b')]);router[_0x163f('0x1c')](_0x163f('0x14'),auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0x163f('0x19'),auth[_0x163f('0xa')](),controller[_0x163f('0x1d')]);module[_0x163f('0x1e')]=router;
\ No newline at end of file
index 6f32e11..2a9fc60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9466=['TEXT','STRING','VIRTUAL','key','sequelize','exports'];(function(_0x2c01d0,_0x4784b3){var _0x474bf7=function(_0x542035){while(--_0x542035){_0x2c01d0['push'](_0x2c01d0['shift']());}};_0x474bf7(++_0x4784b3);}(_0x9466,0x190));var _0x6946=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9466[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x6946('0x0'));module[_0x6946('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x6946('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6946('0x3')]},'name':{'type':Sequelize[_0x6946('0x4')],'get':function(){return this['getDataValue'](_0x6946('0x5'));}}};
\ No newline at end of file
+var _0x4c47=['STRING','TEXT','VIRTUAL','key','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c47,0xb2));var _0x74c4=function(_0x4f656d,_0x423ba9){_0x4f656d=_0x4f656d-0x0;var _0x5a9078=_0x4c47[_0x4f656d];return _0x5a9078;};'use strict';var Sequelize=require(_0x74c4('0x0'));module[_0x74c4('0x1')]={'key':{'type':Sequelize[_0x74c4('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x74c4('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x74c4('0x2')]},'name':{'type':Sequelize[_0x74c4('0x4')],'get':function(){return this['getDataValue'](_0x74c4('0x5'));}}};
\ No newline at end of file
index 489592b..9f88c1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc19=['OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','error','name','index','map','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','CannedAnswer','includeAll','include','rows','params','rawAttributes','length','options','find','catch','body','create','MailAccountId','SmsAccountId'];(function(_0x57051d,_0x418d0c){var _0x224615=function(_0x40b446){while(--_0x40b446){_0x57051d['push'](_0x57051d['shift']());}};_0x224615(++_0x418d0c);}(_0xcc19,0x67));var _0x9cc1=function(_0x4fc435,_0x45eddf){_0x4fc435=_0x4fc435-0x0;var _0x3c5db1=_0xcc19[_0x4fc435];return _0x3c5db1;};'use strict';var emlformat=require(_0x9cc1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9cc1('0x1'));var rp=require(_0x9cc1('0x2'));var moment=require(_0x9cc1('0x3'));var BPromise=require(_0x9cc1('0x4'));var Mustache=require(_0x9cc1('0x5'));var util=require(_0x9cc1('0x6'));var path=require('path');var sox=require(_0x9cc1('0x7'));var csv=require(_0x9cc1('0x8'));var ejs=require(_0x9cc1('0x9'));var fs=require('fs');var fs_extra=require(_0x9cc1('0xa'));var _=require(_0x9cc1('0xb'));var squel=require(_0x9cc1('0xc'));var crypto=require(_0x9cc1('0xd'));var jsforce=require(_0x9cc1('0xe'));var deskjs=require(_0x9cc1('0xf'));var toCsv=require(_0x9cc1('0x8'));var querystring=require(_0x9cc1('0x10'));var Papa=require(_0x9cc1('0x11'));var Redis=require(_0x9cc1('0x12'));var authService=require(_0x9cc1('0x13'));var qs=require(_0x9cc1('0x14'));var as=require(_0x9cc1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cc1('0x16'))(_0x9cc1('0x17'));var utils=require('../../config/utils');var config=require(_0x9cc1('0x18'));var licenseUtil=require(_0x9cc1('0x19'));var db=require(_0x9cc1('0x1a'))['db'];function respondWithStatusCode(_0x20c4df,_0x1430ac){_0x1430ac=_0x1430ac||0xcc;return function(_0x43d40c){if(_0x43d40c){return _0x20c4df[_0x9cc1('0x1b')](_0x1430ac);}return _0x20c4df[_0x9cc1('0x1c')](_0x1430ac)[_0x9cc1('0x1d')]();};}function respondWithResult(_0x5ad379,_0x46d56d){_0x46d56d=_0x46d56d||0xc8;return function(_0x57d2de){if(_0x57d2de){return _0x5ad379['status'](_0x46d56d)['json'](_0x57d2de);}};}function respondWithFilteredResult(_0x5c990c,_0x811831){return function(_0x5e4e4c){if(_0x5e4e4c){var _0x2c8c0b=typeof _0x811831[_0x9cc1('0x1e')]===_0x9cc1('0x1f')&&typeof _0x811831['limit']===_0x9cc1('0x1f');var _0x3c0d6d=_0x5e4e4c[_0x9cc1('0x20')];var _0x53c1c7=_0x2c8c0b?0x0:_0x811831['offset'];var _0x1e3893=_0x2c8c0b?_0x5e4e4c['count']:_0x811831[_0x9cc1('0x1e')]+_0x811831[_0x9cc1('0x21')];var _0x1d6828;if(_0x1e3893>=_0x3c0d6d){_0x1e3893=_0x3c0d6d;_0x1d6828=0xc8;}else{_0x1d6828=0xce;}_0x5c990c[_0x9cc1('0x1c')](_0x1d6828);return _0x5c990c[_0x9cc1('0x22')](_0x9cc1('0x23'),_0x53c1c7+'-'+_0x1e3893+'/'+_0x3c0d6d)[_0x9cc1('0x24')](_0x5e4e4c);}return null;};}function patchUpdates(_0x24d5cf){return function(_0xd35846){try{jsonpatch['apply'](_0xd35846,_0x24d5cf,!![]);}catch(_0x209f10){return BPromise[_0x9cc1('0x25')](_0x209f10);}return _0xd35846[_0x9cc1('0x26')]();};}function saveUpdates(_0x52c5f5,_0x32a708){return function(_0x4627e2){if(_0x4627e2){return _0x4627e2[_0x9cc1('0x27')](_0x52c5f5)[_0x9cc1('0x28')](function(_0x3c95d1){return _0x3c95d1;});}return null;};}function removeEntity(_0x3e4f37,_0x2719c5){return function(_0x577085){if(_0x577085){return _0x577085[_0x9cc1('0x29')]()[_0x9cc1('0x28')](function(){var _0x14c8eb=_0x577085['get']({'plain':!![]});var _0x9d7520=_0x9cc1('0x2a');return db[_0x9cc1('0x2b')]['destroy']({'where':{'type':_0x9d7520,'resourceId':_0x14c8eb['id']}})['then'](function(){return _0x577085;});})['then'](function(){_0x3e4f37[_0x9cc1('0x1c')](0xcc)[_0x9cc1('0x1d')]();});}};}function handleEntityNotFound(_0x3ba45c,_0x44ea02){return function(_0xf89c90){if(!_0xf89c90){_0x3ba45c[_0x9cc1('0x1b')](0x194);}return _0xf89c90;};}function handleError(_0x327adc,_0x3cb132){_0x3cb132=_0x3cb132||0x1f4;return function(_0x38fbe8){logger[_0x9cc1('0x2c')](_0x38fbe8['stack']);if(_0x38fbe8[_0x9cc1('0x2d')]){delete _0x38fbe8[_0x9cc1('0x2d')];}_0x327adc[_0x9cc1('0x1c')](_0x3cb132)['send'](_0x38fbe8);};}exports[_0x9cc1('0x2e')]=function(_0x22de9c,_0x6a8eac){var _0x1b1737={},_0x5c6431={},_0x312a97={'count':0x0,'rows':[]};var _0x1e484b=_[_0x9cc1('0x2f')](db['CannedAnswer']['rawAttributes'],function(_0x45871f){return{'name':_0x45871f['fieldName'],'type':_0x45871f['type'][_0x9cc1('0x30')]};});_0x5c6431[_0x9cc1('0x31')]=_[_0x9cc1('0x2f')](_0x1e484b,'name');_0x5c6431[_0x9cc1('0x32')]=_[_0x9cc1('0x33')](_0x22de9c[_0x9cc1('0x32')]);_0x5c6431['filters']=_['intersection'](_0x5c6431[_0x9cc1('0x31')],_0x5c6431[_0x9cc1('0x32')]);_0x1b1737[_0x9cc1('0x34')]=_[_0x9cc1('0x35')](_0x5c6431[_0x9cc1('0x31')],qs['fields'](_0x22de9c[_0x9cc1('0x32')][_0x9cc1('0x36')]));_0x1b1737[_0x9cc1('0x34')]=_0x1b1737[_0x9cc1('0x34')]['length']?_0x1b1737[_0x9cc1('0x34')]:_0x5c6431[_0x9cc1('0x31')];if(!_0x22de9c[_0x9cc1('0x32')]['hasOwnProperty'](_0x9cc1('0x37'))){_0x1b1737[_0x9cc1('0x21')]=qs[_0x9cc1('0x21')](_0x22de9c[_0x9cc1('0x32')][_0x9cc1('0x21')]);_0x1b1737[_0x9cc1('0x1e')]=qs[_0x9cc1('0x1e')](_0x22de9c[_0x9cc1('0x32')][_0x9cc1('0x1e')]);}_0x1b1737[_0x9cc1('0x38')]=qs[_0x9cc1('0x39')](_0x22de9c['query'][_0x9cc1('0x39')]);_0x1b1737[_0x9cc1('0x3a')]=qs[_0x9cc1('0x3b')](_[_0x9cc1('0x3c')](_0x22de9c[_0x9cc1('0x32')],_0x5c6431[_0x9cc1('0x3b')]),_0x1e484b);if(_0x22de9c['query'][_0x9cc1('0x3d')]){_0x1b1737['where']=_[_0x9cc1('0x3e')](_0x1b1737[_0x9cc1('0x3a')],{'$or':[{'key':{'$like':'%'+_0x22de9c['query'][_0x9cc1('0x3d')]+'%'}},{'value':{'$like':'%'+_0x22de9c['query'][_0x9cc1('0x3d')]+'%'}}]});}_0x1b1737=_[_0x9cc1('0x3e')]({},_0x1b1737,_0x22de9c['options']);var _0x487071={'where':_0x1b1737['where']};return db[_0x9cc1('0x3f')][_0x9cc1('0x20')](_0x487071)['then'](function(_0x541c9b){_0x312a97[_0x9cc1('0x20')]=_0x541c9b;if(_0x22de9c[_0x9cc1('0x32')][_0x9cc1('0x40')]){_0x1b1737[_0x9cc1('0x41')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1b1737);})['then'](function(_0x2275fc){_0x312a97[_0x9cc1('0x42')]=_0x2275fc;return _0x312a97;})[_0x9cc1('0x28')](respondWithFilteredResult(_0x6a8eac,_0x1b1737))['catch'](handleError(_0x6a8eac,null));};exports['show']=function(_0x43e154,_0xc31bc7){var _0x38276={'raw':!![],'where':{'id':_0x43e154[_0x9cc1('0x43')]['id']}},_0x3d953b={};_0x3d953b[_0x9cc1('0x31')]=_[_0x9cc1('0x33')](db['CannedAnswer'][_0x9cc1('0x44')]);_0x3d953b['query']=_[_0x9cc1('0x33')](_0x43e154['query']);_0x3d953b[_0x9cc1('0x3b')]=_['intersection'](_0x3d953b[_0x9cc1('0x31')],_0x3d953b['query']);_0x38276[_0x9cc1('0x34')]=_[_0x9cc1('0x35')](_0x3d953b[_0x9cc1('0x31')],qs['fields'](_0x43e154['query'][_0x9cc1('0x36')]));_0x38276[_0x9cc1('0x34')]=_0x38276[_0x9cc1('0x34')][_0x9cc1('0x45')]?_0x38276[_0x9cc1('0x34')]:_0x3d953b[_0x9cc1('0x31')];if(_0x43e154[_0x9cc1('0x32')][_0x9cc1('0x40')]){_0x38276[_0x9cc1('0x41')]=[{'all':!![]}];}_0x38276=_[_0x9cc1('0x3e')]({},_0x38276,_0x43e154[_0x9cc1('0x46')]);return db[_0x9cc1('0x3f')][_0x9cc1('0x47')](_0x38276)[_0x9cc1('0x28')](handleEntityNotFound(_0xc31bc7,null))[_0x9cc1('0x28')](respondWithResult(_0xc31bc7,null))[_0x9cc1('0x48')](handleError(_0xc31bc7,null));};exports[_0x9cc1('0x27')]=function(_0x22ac49,_0x42df39){if(_0x22ac49['body']['id']){delete _0x22ac49['body']['id'];}return db[_0x9cc1('0x3f')][_0x9cc1('0x47')]({'where':{'id':_0x22ac49[_0x9cc1('0x43')]['id']}})[_0x9cc1('0x28')](handleEntityNotFound(_0x42df39,null))[_0x9cc1('0x28')](saveUpdates(_0x22ac49[_0x9cc1('0x49')],null))[_0x9cc1('0x28')](respondWithResult(_0x42df39,null))[_0x9cc1('0x48')](handleError(_0x42df39,null));};exports[_0x9cc1('0x29')]=function(_0x578914,_0x451a69){return db[_0x9cc1('0x3f')][_0x9cc1('0x47')]({'where':{'id':_0x578914[_0x9cc1('0x43')]['id']}})[_0x9cc1('0x28')](handleEntityNotFound(_0x451a69,null))['then'](removeEntity(_0x451a69,null))[_0x9cc1('0x48')](handleError(_0x451a69,null));};exports[_0x9cc1('0x4a')]=function(_0x16f3a2,_0x35ef3a){var _0x195ff5={'key':_0x16f3a2[_0x9cc1('0x49')][_0x9cc1('0x30')]};if(_0x16f3a2[_0x9cc1('0x49')][_0x9cc1('0x4b')]){_0x195ff5['MailAccountId']=_0x16f3a2['body']['MailAccountId'];}else if(_0x16f3a2[_0x9cc1('0x49')]['SmsAccountId']){_0x195ff5['SmsAccountId']=_0x16f3a2[_0x9cc1('0x49')][_0x9cc1('0x4c')];}else if(_0x16f3a2[_0x9cc1('0x49')][_0x9cc1('0x4d')]){_0x195ff5[_0x9cc1('0x4d')]=_0x16f3a2[_0x9cc1('0x49')]['OpenchannelAccountId'];}else if(_0x16f3a2[_0x9cc1('0x49')][_0x9cc1('0x4e')]){_0x195ff5[_0x9cc1('0x4e')]=_0x16f3a2[_0x9cc1('0x49')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x195ff5})[_0x9cc1('0x28')](function(_0x511d8b){if(_0x511d8b){throw new db[(_0x9cc1('0x4f'))][(_0x9cc1('0x50'))](_0x9cc1('0x51'));}return db['CannedAnswer'][_0x9cc1('0x4a')](_0x16f3a2['body']);})[_0x9cc1('0x28')](function(_0x585660){var _0x1f6aed=_0x16f3a2[_0x9cc1('0x52')][_0x9cc1('0x53')]({'plain':!![]});if(!_0x1f6aed)throw new Error(_0x9cc1('0x54'));if(_0x1f6aed[_0x9cc1('0x55')]===_0x9cc1('0x52')){var _0x2d6133=_0x585660[_0x9cc1('0x53')]({'plain':!![]});return db[_0x9cc1('0x56')][_0x9cc1('0x47')]({'where':{'name':_0x9cc1('0x2a'),'userProfileId':_0x1f6aed[_0x9cc1('0x57')]},'raw':!![]})[_0x9cc1('0x28')](function(_0x38befb){if(_0x38befb&&_0x38befb[_0x9cc1('0x58')]===0x0){return db[_0x9cc1('0x2b')][_0x9cc1('0x4a')]({'name':_0x2d6133[_0x9cc1('0x2d')],'resourceId':_0x2d6133['id'],'type':_0x38befb[_0x9cc1('0x2d')],'sectionId':_0x38befb['id']},{})['then'](function(){return _0x585660;});}else{return _0x585660;}})['catch'](function(_0x3c2e1c){logger['error'](_0x9cc1('0x59'),_0x3c2e1c);throw _0x3c2e1c;});}return _0x585660;})[_0x9cc1('0x28')](respondWithResult(_0x35ef3a,0xc9))['catch'](handleError(_0x35ef3a,null));};
\ No newline at end of file
+var _0x883b=['ejs','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','UserProfileResource','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','filter','options','CannedAnswer','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv'];(function(_0x2e0c22,_0x4f2b78){var _0x521d31=function(_0x20f39d){while(--_0x20f39d){_0x2e0c22['push'](_0x2e0c22['shift']());}};_0x521d31(++_0x4f2b78);}(_0x883b,0x105));var _0xb883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb883('0x0'));var rimraf=require(_0xb883('0x1'));var zipdir=require(_0xb883('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb883('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb883('0x4'));var util=require(_0xb883('0x5'));var path=require(_0xb883('0x6'));var sox=require(_0xb883('0x7'));var csv=require(_0xb883('0x8'));var ejs=require(_0xb883('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb883('0xa'));var squel=require(_0xb883('0xb'));var crypto=require('crypto');var jsforce=require(_0xb883('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb883('0xd'));var Redis=require('ioredis');var authService=require(_0xb883('0xe'));var qs=require(_0xb883('0xf'));var as=require(_0xb883('0x10'));var hardwareService=require(_0xb883('0x11'));var logger=require('../../config/logger')(_0xb883('0x12'));var utils=require(_0xb883('0x13'));var config=require(_0xb883('0x14'));var licenseUtil=require(_0xb883('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5df546,_0x3b14ca){_0x3b14ca=_0x3b14ca||0xcc;return function(_0x295da3){if(_0x295da3){return _0x5df546[_0xb883('0x16')](_0x3b14ca);}return _0x5df546[_0xb883('0x17')](_0x3b14ca)[_0xb883('0x18')]();};}function respondWithResult(_0xabc875,_0x7add29){_0x7add29=_0x7add29||0xc8;return function(_0x430423){if(_0x430423){return _0xabc875[_0xb883('0x17')](_0x7add29)[_0xb883('0x19')](_0x430423);}};}function respondWithFilteredResult(_0x7bca33,_0x56ea9e){return function(_0x3c3d7f){if(_0x3c3d7f){var _0x10c698=typeof _0x56ea9e[_0xb883('0x1a')]===_0xb883('0x1b')&&typeof _0x56ea9e[_0xb883('0x1c')]===_0xb883('0x1b');var _0x2e4e8b=_0x3c3d7f['count'];var _0x52ac41=_0x10c698?0x0:_0x56ea9e[_0xb883('0x1a')];var _0xb5dfe=_0x10c698?_0x3c3d7f[_0xb883('0x1d')]:_0x56ea9e[_0xb883('0x1a')]+_0x56ea9e[_0xb883('0x1c')];var _0x28be01;if(_0xb5dfe>=_0x2e4e8b){_0xb5dfe=_0x2e4e8b;_0x28be01=0xc8;}else{_0x28be01=0xce;}_0x7bca33['status'](_0x28be01);return _0x7bca33[_0xb883('0x1e')](_0xb883('0x1f'),_0x52ac41+'-'+_0xb5dfe+'/'+_0x2e4e8b)['json'](_0x3c3d7f);}return null;};}function patchUpdates(_0x142062){return function(_0x6a7f22){try{jsonpatch[_0xb883('0x20')](_0x6a7f22,_0x142062,!![]);}catch(_0xbe17c){return BPromise[_0xb883('0x21')](_0xbe17c);}return _0x6a7f22[_0xb883('0x22')]();};}function saveUpdates(_0x296acb,_0x2e4372){return function(_0x57562b){if(_0x57562b){return _0x57562b[_0xb883('0x23')](_0x296acb)[_0xb883('0x24')](function(_0x3c5934){return _0x3c5934;});}return null;};}function removeEntity(_0x350e7b,_0x1e0454){return function(_0x1d5031){if(_0x1d5031){return _0x1d5031['destroy']()[_0xb883('0x24')](function(){var _0x32c2da=_0x1d5031[_0xb883('0x25')]({'plain':!![]});var _0x37aa57=_0xb883('0x26');return db[_0xb883('0x27')][_0xb883('0x28')]({'where':{'type':_0x37aa57,'resourceId':_0x32c2da['id']}})[_0xb883('0x24')](function(){return _0x1d5031;});})[_0xb883('0x24')](function(){_0x350e7b[_0xb883('0x17')](0xcc)[_0xb883('0x18')]();});}};}function handleEntityNotFound(_0xbb7be2,_0x5bb497){return function(_0x5c8c24){if(!_0x5c8c24){_0xbb7be2[_0xb883('0x16')](0x194);}return _0x5c8c24;};}function handleError(_0x4ae075,_0x3f5fdd){_0x3f5fdd=_0x3f5fdd||0x1f4;return function(_0x59775d){logger[_0xb883('0x29')](_0x59775d[_0xb883('0x2a')]);if(_0x59775d['name']){delete _0x59775d[_0xb883('0x2b')];}_0x4ae075[_0xb883('0x17')](_0x3f5fdd)[_0xb883('0x2c')](_0x59775d);};}exports[_0xb883('0x2d')]=function(_0x3e748a,_0x334d33){var _0x455cdd={},_0x30fce4={},_0x19e4c9={'count':0x0,'rows':[]};var _0x5804f8=_[_0xb883('0x2e')](db['CannedAnswer']['rawAttributes'],function(_0x116d21){return{'name':_0x116d21[_0xb883('0x2f')],'type':_0x116d21[_0xb883('0x30')]['key']};});_0x30fce4[_0xb883('0x31')]=_[_0xb883('0x2e')](_0x5804f8,_0xb883('0x2b'));_0x30fce4[_0xb883('0x32')]=_[_0xb883('0x33')](_0x3e748a[_0xb883('0x32')]);_0x30fce4[_0xb883('0x34')]=_[_0xb883('0x35')](_0x30fce4[_0xb883('0x31')],_0x30fce4[_0xb883('0x32')]);_0x455cdd[_0xb883('0x36')]=_[_0xb883('0x35')](_0x30fce4['model'],qs[_0xb883('0x37')](_0x3e748a['query'][_0xb883('0x37')]));_0x455cdd['attributes']=_0x455cdd[_0xb883('0x36')]['length']?_0x455cdd['attributes']:_0x30fce4[_0xb883('0x31')];if(!_0x3e748a[_0xb883('0x32')]['hasOwnProperty'](_0xb883('0x38'))){_0x455cdd['limit']=qs[_0xb883('0x1c')](_0x3e748a[_0xb883('0x32')][_0xb883('0x1c')]);_0x455cdd[_0xb883('0x1a')]=qs[_0xb883('0x1a')](_0x3e748a['query'][_0xb883('0x1a')]);}_0x455cdd['order']=qs['sort'](_0x3e748a[_0xb883('0x32')][_0xb883('0x39')]);_0x455cdd[_0xb883('0x3a')]=qs[_0xb883('0x34')](_[_0xb883('0x3b')](_0x3e748a[_0xb883('0x32')],_0x30fce4[_0xb883('0x34')]),_0x5804f8);if(_0x3e748a[_0xb883('0x32')]['filter']){_0x455cdd[_0xb883('0x3a')]=_[_0xb883('0x3c')](_0x455cdd[_0xb883('0x3a')],{'$or':[{'key':{'$like':'%'+_0x3e748a[_0xb883('0x32')][_0xb883('0x3d')]+'%'}},{'value':{'$like':'%'+_0x3e748a[_0xb883('0x32')][_0xb883('0x3d')]+'%'}}]});}_0x455cdd=_[_0xb883('0x3c')]({},_0x455cdd,_0x3e748a[_0xb883('0x3e')]);var _0x4568f9={'where':_0x455cdd['where']};return db[_0xb883('0x3f')][_0xb883('0x1d')](_0x4568f9)[_0xb883('0x24')](function(_0x3bc7a5){_0x19e4c9['count']=_0x3bc7a5;if(_0x3e748a[_0xb883('0x32')][_0xb883('0x40')]){_0x455cdd[_0xb883('0x41')]=[{'all':!![]}];}return db[_0xb883('0x3f')][_0xb883('0x42')](_0x455cdd);})[_0xb883('0x24')](function(_0x1000f0){_0x19e4c9[_0xb883('0x43')]=_0x1000f0;return _0x19e4c9;})[_0xb883('0x24')](respondWithFilteredResult(_0x334d33,_0x455cdd))['catch'](handleError(_0x334d33,null));};exports[_0xb883('0x44')]=function(_0x5d147e,_0x1d2986){var _0x416a0c={'raw':!![],'where':{'id':_0x5d147e[_0xb883('0x45')]['id']}},_0x1a7903={};_0x1a7903[_0xb883('0x31')]=_[_0xb883('0x33')](db[_0xb883('0x3f')][_0xb883('0x46')]);_0x1a7903[_0xb883('0x32')]=_['keys'](_0x5d147e[_0xb883('0x32')]);_0x1a7903['filters']=_[_0xb883('0x35')](_0x1a7903[_0xb883('0x31')],_0x1a7903[_0xb883('0x32')]);_0x416a0c[_0xb883('0x36')]=_[_0xb883('0x35')](_0x1a7903['model'],qs[_0xb883('0x37')](_0x5d147e['query'][_0xb883('0x37')]));_0x416a0c[_0xb883('0x36')]=_0x416a0c['attributes'][_0xb883('0x47')]?_0x416a0c[_0xb883('0x36')]:_0x1a7903[_0xb883('0x31')];if(_0x5d147e[_0xb883('0x32')]['includeAll']){_0x416a0c['include']=[{'all':!![]}];}_0x416a0c=_['merge']({},_0x416a0c,_0x5d147e['options']);return db['CannedAnswer'][_0xb883('0x48')](_0x416a0c)[_0xb883('0x24')](handleEntityNotFound(_0x1d2986,null))[_0xb883('0x24')](respondWithResult(_0x1d2986,null))[_0xb883('0x49')](handleError(_0x1d2986,null));};exports[_0xb883('0x23')]=function(_0x2a5f07,_0x575b9a){if(_0x2a5f07[_0xb883('0x4a')]['id']){delete _0x2a5f07[_0xb883('0x4a')]['id'];}return db[_0xb883('0x3f')][_0xb883('0x48')]({'where':{'id':_0x2a5f07[_0xb883('0x45')]['id']}})[_0xb883('0x24')](handleEntityNotFound(_0x575b9a,null))[_0xb883('0x24')](saveUpdates(_0x2a5f07['body'],null))[_0xb883('0x24')](respondWithResult(_0x575b9a,null))[_0xb883('0x49')](handleError(_0x575b9a,null));};exports[_0xb883('0x28')]=function(_0x1f69c7,_0x10d551){return db['CannedAnswer'][_0xb883('0x48')]({'where':{'id':_0x1f69c7[_0xb883('0x45')]['id']}})[_0xb883('0x24')](handleEntityNotFound(_0x10d551,null))[_0xb883('0x24')](removeEntity(_0x10d551,null))['catch'](handleError(_0x10d551,null));};exports['create']=function(_0x5dc15d,_0x5d769e){var _0x4f3320={'key':_0x5dc15d[_0xb883('0x4a')][_0xb883('0x4b')]};if(_0x5dc15d[_0xb883('0x4a')][_0xb883('0x4c')]){_0x4f3320[_0xb883('0x4c')]=_0x5dc15d[_0xb883('0x4a')][_0xb883('0x4c')];}else if(_0x5dc15d[_0xb883('0x4a')][_0xb883('0x4d')]){_0x4f3320['SmsAccountId']=_0x5dc15d[_0xb883('0x4a')][_0xb883('0x4d')];}else if(_0x5dc15d['body']['OpenchannelAccountId']){_0x4f3320[_0xb883('0x4e')]=_0x5dc15d[_0xb883('0x4a')][_0xb883('0x4e')];}else if(_0x5dc15d[_0xb883('0x4a')][_0xb883('0x4f')]){_0x4f3320[_0xb883('0x4f')]=_0x5dc15d[_0xb883('0x4a')][_0xb883('0x4f')];}return db[_0xb883('0x3f')][_0xb883('0x48')]({'where':_0x4f3320})[_0xb883('0x24')](function(_0x52feb5){if(_0x52feb5){throw new db[(_0xb883('0x50'))][(_0xb883('0x51'))](_0xb883('0x52'));}return db['CannedAnswer'][_0xb883('0x53')](_0x5dc15d[_0xb883('0x4a')]);})['then'](function(_0x2a35e3){var _0x16973d=_0x5dc15d[_0xb883('0x54')][_0xb883('0x25')]({'plain':!![]});if(!_0x16973d)throw new Error(_0xb883('0x55'));if(_0x16973d['role']===_0xb883('0x54')){var _0x356f40=_0x2a35e3['get']({'plain':!![]});return db[_0xb883('0x56')][_0xb883('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x16973d[_0xb883('0x57')]},'raw':!![]})[_0xb883('0x24')](function(_0x5ae1eb){if(_0x5ae1eb&&_0x5ae1eb[_0xb883('0x58')]===0x0){return db[_0xb883('0x27')]['create']({'name':_0x356f40['name'],'resourceId':_0x356f40['id'],'type':_0x5ae1eb[_0xb883('0x2b')],'sectionId':_0x5ae1eb['id']},{})['then'](function(){return _0x2a35e3;});}else{return _0x2a35e3;}})['catch'](function(_0x664ea0){logger[_0xb883('0x29')](_0xb883('0x59'),_0x664ea0);throw _0x664ea0;});}return _0x2a35e3;})[_0xb883('0x24')](respondWithResult(_0x5d769e,0xc9))[_0xb883('0x49')](handleError(_0x5d769e,null));};
\ No newline at end of file
index 91775c8..bd55f1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb93=['path','rimraf','../../config/environment','exports','CannedAnswer','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x8b4a9b,_0x3986ea){var _0x1fc71b=function(_0x487f94){while(--_0x487f94){_0x8b4a9b['push'](_0x8b4a9b['shift']());}};_0x1fc71b(++_0x3986ea);}(_0xfb93,0x118));var _0x3fb9=function(_0x49418f,_0x17cdd9){_0x49418f=_0x49418f-0x0;var _0x122c1c=_0xfb93[_0x49418f];return _0x122c1c;};'use strict';var _=require(_0x3fb9('0x0'));var util=require(_0x3fb9('0x1'));var logger=require(_0x3fb9('0x2'))(_0x3fb9('0x3'));var moment=require(_0x3fb9('0x4'));var BPromise=require('bluebird');var rp=require(_0x3fb9('0x5'));var fs=require('fs');var path=require(_0x3fb9('0x6'));var rimraf=require(_0x3fb9('0x7'));var config=require(_0x3fb9('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x3fb9('0x9')]=function(_0x1228b1,_0x3b364c){return _0x1228b1['define'](_0x3fb9('0xa'),attributes,{'tableName':_0x3fb9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3fb9('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x4f0f=['path','rimraf','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x523db7,_0x59fb11){var _0x1a4bfe=function(_0x848f76){while(--_0x848f76){_0x523db7['push'](_0x523db7['shift']());}};_0x1a4bfe(++_0x59fb11);}(_0x4f0f,0x1b4));var _0xf4f0=function(_0x4d26e4,_0xedc9db){_0x4d26e4=_0x4d26e4-0x0;var _0x36513d=_0x4f0f[_0x4d26e4];return _0x36513d;};'use strict';var _=require(_0xf4f0('0x0'));var util=require('util');var logger=require(_0xf4f0('0x1'))(_0xf4f0('0x2'));var moment=require(_0xf4f0('0x3'));var BPromise=require(_0xf4f0('0x4'));var rp=require(_0xf4f0('0x5'));var fs=require('fs');var path=require(_0xf4f0('0x6'));var rimraf=require(_0xf4f0('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x57b8fb,_0x59ce40){return _0x57b8fb[_0xf4f0('0x8')](_0xf4f0('0x9'),attributes,{'tableName':_0xf4f0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf4f0('0xb'),'collate':_0xf4f0('0xc')});};
\ No newline at end of file
index ce1c690..1afd1e1 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(_0xf55210,_0x19e0b2){var _0x56d4a2=function(_0x1f3987){while(--_0x1f3987){_0xf55210['push'](_0xf55210['shift']());}};_0x56d4a2(++_0x19e0b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x354727,_0x737910){var _0xa90710=function(_0x3ba956){while(--_0x3ba956){_0x354727['push'](_0x354727['shift']());}};_0xa90710(++_0x737910);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 898cbda..aaa9bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9801=['../../config/environment','./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1b6055,_0x4f9431){var _0x3a4be1=function(_0x56e8b4){while(--_0x56e8b4){_0x1b6055['push'](_0x1b6055['shift']());}};_0x3a4be1(++_0x4f9431);}(_0x9801,0x12c));var _0x1980=function(_0x4a0236,_0x45fb06){_0x4a0236=_0x4a0236-0x0;var _0x109cbb=_0x9801[_0x4a0236];return _0x109cbb;};'use strict';var multer=require(_0x1980('0x0'));var util=require('util');var path=require(_0x1980('0x1'));var timeout=require(_0x1980('0x2'));var express=require(_0x1980('0x3'));var router=express[_0x1980('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1980('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1980('0x6'));var controller=require(_0x1980('0x7'));router[_0x1980('0x8')]('/',auth['isAuthenticated'](),controller[_0x1980('0x9')]);router['get'](_0x1980('0xa'),auth[_0x1980('0xb')](),controller[_0x1980('0xc')]);router[_0x1980('0xd')]('/',auth[_0x1980('0xb')](),controller[_0x1980('0xe')]);router[_0x1980('0xf')](_0x1980('0xa'),auth[_0x1980('0xb')](),controller[_0x1980('0x10')]);router['delete'](_0x1980('0xa'),auth[_0x1980('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x66a6=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x4c04b1,_0xee7e14){var _0x432f22=function(_0x3e09ce){while(--_0x3e09ce){_0x4c04b1['push'](_0x4c04b1['shift']());}};_0x432f22(++_0xee7e14);}(_0x66a6,0xdf));var _0x666a=function(_0x1bd605,_0x2a61f8){_0x1bd605=_0x1bd605-0x0;var _0x28ee91=_0x66a6[_0x1bd605];return _0x28ee91;};'use strict';var multer=require(_0x666a('0x0'));var util=require(_0x666a('0x1'));var path=require(_0x666a('0x2'));var timeout=require(_0x666a('0x3'));var express=require(_0x666a('0x4'));var router=express[_0x666a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x666a('0x6'));var interaction=require(_0x666a('0x7'));var config=require(_0x666a('0x8'));var controller=require(_0x666a('0x9'));router[_0x666a('0xa')]('/',auth[_0x666a('0xb')](),controller['index']);router[_0x666a('0xa')](_0x666a('0xc'),auth['isAuthenticated'](),controller[_0x666a('0xd')]);router[_0x666a('0xe')]('/',auth[_0x666a('0xb')](),controller['create']);router[_0x666a('0xf')](_0x666a('0xc'),auth['isAuthenticated'](),controller[_0x666a('0x10')]);router[_0x666a('0x11')](_0x666a('0xc'),auth[_0x666a('0xb')](),controller['destroy']);module[_0x666a('0x12')]=router;
\ No newline at end of file
index 09a7fac..eba8148 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43c8=['1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x1d5a32,_0x47974a){var _0x361ca0=function(_0x287d62){while(--_0x287d62){_0x1d5a32['push'](_0x1d5a32['shift']());}};_0x361ca0(++_0x47974a);}(_0x43c8,0xaf));var _0x843c=function(_0x491873,_0x159927){_0x491873=_0x491873-0x0;var _0x28e57e=_0x43c8[_0x491873];return _0x28e57e;};'use strict';var Sequelize=require('sequelize');module[_0x843c('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x843c('0x1')},'clid':{'type':Sequelize[_0x843c('0x2')]},'src':{'type':Sequelize[_0x843c('0x2')]},'dst':{'type':Sequelize[_0x843c('0x2')]},'dcontext':{'type':Sequelize[_0x843c('0x2')]},'channel':{'type':Sequelize[_0x843c('0x2')]},'dstchannel':{'type':Sequelize[_0x843c('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x843c('0x2')]},'duration':{'type':Sequelize[_0x843c('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x843c('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x843c('0x2')]},'amaflags':{'type':Sequelize[_0x843c('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x843c('0x2')]},'uniqueid':{'type':Sequelize[_0x843c('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x843c('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x843c('0x2')]}};
\ No newline at end of file
+var _0xbd60=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xbd60,0x162));var _0x0bd6=function(_0x3fb743,_0x2b6886){_0x3fb743=_0x3fb743-0x0;var _0x135901=_0xbd60[_0x3fb743];return _0x135901;};'use strict';var Sequelize=require(_0x0bd6('0x0'));module[_0x0bd6('0x1')]={'calldate':{'type':Sequelize[_0x0bd6('0x2')],'allowNull':![],'defaultValue':_0x0bd6('0x3')},'clid':{'type':Sequelize[_0x0bd6('0x4')]},'src':{'type':Sequelize[_0x0bd6('0x4')]},'dst':{'type':Sequelize[_0x0bd6('0x4')]},'dcontext':{'type':Sequelize[_0x0bd6('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0bd6('0x4')]},'lastapp':{'type':Sequelize[_0x0bd6('0x4')]},'lastdata':{'type':Sequelize[_0x0bd6('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0bd6('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0bd6('0x4')]},'amaflags':{'type':Sequelize[_0x0bd6('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0bd6('0x4')]},'userfield':{'type':Sequelize[_0x0bd6('0x4')]},'uniqueid':{'type':Sequelize[_0x0bd6('0x4')]},'linkedid':{'type':Sequelize[_0x0bd6('0x4')]},'sequence':{'type':Sequelize[_0x0bd6('0x4')]},'peeraccount':{'type':Sequelize[_0x0bd6('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x0bd6('0x4')]}};
\ No newline at end of file
index e5c5273..5e3aed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe181=['keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','findAll','rows','catch','show','params','fields','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x231f6f,_0xf231e0){var _0xc621c4=function(_0x5c8549){while(--_0x5c8549){_0x231f6f['push'](_0x231f6f['shift']());}};_0xc621c4(++_0xf231e0);}(_0xe181,0x68));var _0x1e18=function(_0x305bdf,_0x1fd2d7){_0x305bdf=_0x305bdf-0x0;var _0x4b8c73=_0xe181[_0x305bdf];return _0x4b8c73;};'use strict';var emlformat=require(_0x1e18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e18('0x1'));var jsonpatch=require(_0x1e18('0x2'));var rp=require(_0x1e18('0x3'));var moment=require(_0x1e18('0x4'));var BPromise=require(_0x1e18('0x5'));var Mustache=require(_0x1e18('0x6'));var util=require(_0x1e18('0x7'));var path=require('path');var sox=require(_0x1e18('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e18('0x9'));var _=require(_0x1e18('0xa'));var squel=require(_0x1e18('0xb'));var crypto=require(_0x1e18('0xc'));var jsforce=require(_0x1e18('0xd'));var deskjs=require(_0x1e18('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e18('0xf'));var Papa=require(_0x1e18('0x10'));var Redis=require(_0x1e18('0x11'));var authService=require(_0x1e18('0x12'));var qs=require(_0x1e18('0x13'));var as=require(_0x1e18('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e18('0x15'))(_0x1e18('0x16'));var utils=require(_0x1e18('0x17'));var config=require(_0x1e18('0x18'));var licenseUtil=require(_0x1e18('0x19'));var db=require(_0x1e18('0x1a'))['db'];function respondWithStatusCode(_0x1743c3,_0x33a98d){_0x33a98d=_0x33a98d||0xcc;return function(_0x531e1b){if(_0x531e1b){return _0x1743c3[_0x1e18('0x1b')](_0x33a98d);}return _0x1743c3['status'](_0x33a98d)[_0x1e18('0x1c')]();};}function respondWithResult(_0x563eff,_0x404b7f){_0x404b7f=_0x404b7f||0xc8;return function(_0x36b583){if(_0x36b583){return _0x563eff[_0x1e18('0x1d')](_0x404b7f)[_0x1e18('0x1e')](_0x36b583);}};}function respondWithFilteredResult(_0x1687ba,_0x1e1ce6){return function(_0x39bc56){if(_0x39bc56){var _0x33fea1=typeof _0x1e1ce6[_0x1e18('0x1f')]===_0x1e18('0x20')&&typeof _0x1e1ce6[_0x1e18('0x21')]===_0x1e18('0x20');var _0x349f3c=_0x39bc56[_0x1e18('0x22')];var _0x21b851=_0x33fea1?0x0:_0x1e1ce6['offset'];var _0x1c91d2=_0x33fea1?_0x39bc56[_0x1e18('0x22')]:_0x1e1ce6[_0x1e18('0x1f')]+_0x1e1ce6[_0x1e18('0x21')];var _0x2834ee;if(_0x1c91d2>=_0x349f3c){_0x1c91d2=_0x349f3c;_0x2834ee=0xc8;}else{_0x2834ee=0xce;}_0x1687ba[_0x1e18('0x1d')](_0x2834ee);return _0x1687ba[_0x1e18('0x23')](_0x1e18('0x24'),_0x21b851+'-'+_0x1c91d2+'/'+_0x349f3c)[_0x1e18('0x1e')](_0x39bc56);}return null;};}function patchUpdates(_0x22baca){return function(_0x2489c3){try{jsonpatch[_0x1e18('0x25')](_0x2489c3,_0x22baca,!![]);}catch(_0x3c4fdf){return BPromise[_0x1e18('0x26')](_0x3c4fdf);}return _0x2489c3[_0x1e18('0x27')]();};}function saveUpdates(_0x975df0,_0x3fd0a7){return function(_0x5eb6b4){if(_0x5eb6b4){return _0x5eb6b4[_0x1e18('0x28')](_0x975df0)[_0x1e18('0x29')](function(_0x3e9b2c){return _0x3e9b2c;});}return null;};}function removeEntity(_0x52d5e2,_0xf74622){return function(_0xdda2ce){if(_0xdda2ce){return _0xdda2ce[_0x1e18('0x2a')]()[_0x1e18('0x29')](function(){_0x52d5e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6fa4db,_0x53f9d7){return function(_0x5bb03c){if(!_0x5bb03c){_0x6fa4db['sendStatus'](0x194);}return _0x5bb03c;};}function handleError(_0x32a196,_0x29cac0){_0x29cac0=_0x29cac0||0x1f4;return function(_0x41b67d){logger[_0x1e18('0x2b')](_0x41b67d[_0x1e18('0x2c')]);if(_0x41b67d[_0x1e18('0x2d')]){delete _0x41b67d[_0x1e18('0x2d')];}_0x32a196[_0x1e18('0x1d')](_0x29cac0)[_0x1e18('0x2e')](_0x41b67d);};}exports[_0x1e18('0x2f')]=function(_0x1015a3,_0x42c638){var _0x40d0af={},_0x1be225={},_0x558d01={'count':0x0,'rows':[]};var _0x57000b=_['map'](db[_0x1e18('0x30')][_0x1e18('0x31')],function(_0x1f75cd){return{'name':_0x1f75cd[_0x1e18('0x32')],'type':_0x1f75cd[_0x1e18('0x33')][_0x1e18('0x34')]};});_0x1be225[_0x1e18('0x35')]=_[_0x1e18('0x36')](_0x57000b,'name');_0x1be225[_0x1e18('0x37')]=_[_0x1e18('0x38')](_0x1015a3['query']);_0x1be225[_0x1e18('0x39')]=_[_0x1e18('0x3a')](_0x1be225[_0x1e18('0x35')],_0x1be225['query']);_0x40d0af[_0x1e18('0x3b')]=_['intersection'](_0x1be225['model'],qs['fields'](_0x1015a3[_0x1e18('0x37')]['fields']));_0x40d0af[_0x1e18('0x3b')]=_0x40d0af[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x40d0af['attributes']:_0x1be225['model'];if(!_0x1015a3[_0x1e18('0x37')][_0x1e18('0x3d')](_0x1e18('0x3e'))){_0x40d0af[_0x1e18('0x21')]=qs[_0x1e18('0x21')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x21')]);_0x40d0af[_0x1e18('0x1f')]=qs[_0x1e18('0x1f')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x1f')]);}_0x40d0af[_0x1e18('0x3f')]=qs['sort'](_0x1015a3['query'][_0x1e18('0x40')]);_0x40d0af[_0x1e18('0x41')]=qs[_0x1e18('0x39')](_['pick'](_0x1015a3[_0x1e18('0x37')],_0x1be225['filters']),_0x57000b);if(_0x1015a3[_0x1e18('0x37')]['filter']){_0x40d0af['where']=_[_0x1e18('0x42')](_0x40d0af[_0x1e18('0x41')],{'$or':_[_0x1e18('0x36')](_0x57000b,function(_0x206b44){if(_0x206b44[_0x1e18('0x33')]!==_0x1e18('0x43')){var _0x4e2ca3={};_0x4e2ca3[_0x206b44[_0x1e18('0x2d')]]={'$like':'%'+_0x1015a3[_0x1e18('0x37')][_0x1e18('0x44')]+'%'};return _0x4e2ca3;}})});}_0x40d0af=_[_0x1e18('0x42')]({},_0x40d0af,_0x1015a3['options']);var _0x11f839={'where':_0x40d0af['where']};return db[_0x1e18('0x30')][_0x1e18('0x22')](_0x11f839)['then'](function(_0x41c2bd){_0x558d01[_0x1e18('0x22')]=_0x41c2bd;if(_0x1015a3['query']['includeAll']){_0x40d0af['include']=[{'all':!![]}];}return db[_0x1e18('0x30')][_0x1e18('0x45')](_0x40d0af);})[_0x1e18('0x29')](function(_0x602a85){_0x558d01[_0x1e18('0x46')]=_0x602a85;return _0x558d01;})[_0x1e18('0x29')](respondWithFilteredResult(_0x42c638,_0x40d0af))[_0x1e18('0x47')](handleError(_0x42c638,null));};exports[_0x1e18('0x48')]=function(_0x1cae7e,_0x354832){var _0x16ee40={'raw':!![],'where':{'id':_0x1cae7e[_0x1e18('0x49')]['id']}},_0x4821f9={};_0x4821f9['model']=_[_0x1e18('0x38')](db[_0x1e18('0x30')]['rawAttributes']);_0x4821f9['query']=_['keys'](_0x1cae7e[_0x1e18('0x37')]);_0x4821f9[_0x1e18('0x39')]=_['intersection'](_0x4821f9[_0x1e18('0x35')],_0x4821f9[_0x1e18('0x37')]);_0x16ee40['attributes']=_['intersection'](_0x4821f9[_0x1e18('0x35')],qs[_0x1e18('0x4a')](_0x1cae7e[_0x1e18('0x37')][_0x1e18('0x4a')]));_0x16ee40[_0x1e18('0x3b')]=_0x16ee40[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x16ee40[_0x1e18('0x3b')]:_0x4821f9[_0x1e18('0x35')];if(_0x1cae7e[_0x1e18('0x37')]['includeAll']){_0x16ee40['include']=[{'all':!![]}];}_0x16ee40=_[_0x1e18('0x42')]({},_0x16ee40,_0x1cae7e[_0x1e18('0x4b')]);return db[_0x1e18('0x30')][_0x1e18('0x4c')](_0x16ee40)[_0x1e18('0x29')](handleEntityNotFound(_0x354832,null))[_0x1e18('0x29')](respondWithResult(_0x354832,null))[_0x1e18('0x47')](handleError(_0x354832,null));};exports['create']=function(_0x54f69b,_0x54cd71){return db[_0x1e18('0x30')][_0x1e18('0x4d')](_0x54f69b[_0x1e18('0x4e')],{})[_0x1e18('0x29')](respondWithResult(_0x54cd71,0xc9))[_0x1e18('0x47')](handleError(_0x54cd71,null));};exports[_0x1e18('0x28')]=function(_0x191c18,_0x190af4){if(_0x191c18[_0x1e18('0x4e')]['id']){delete _0x191c18[_0x1e18('0x4e')]['id'];}return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x191c18[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x190af4,null))[_0x1e18('0x29')](saveUpdates(_0x191c18[_0x1e18('0x4e')],null))[_0x1e18('0x29')](respondWithResult(_0x190af4,null))[_0x1e18('0x47')](handleError(_0x190af4,null));};exports[_0x1e18('0x2a')]=function(_0x11d573,_0x5d4cbb){return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x11d573[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x5d4cbb,null))[_0x1e18('0x29')](removeEntity(_0x5d4cbb,null))['catch'](handleError(_0x5d4cbb,null));};exports['describe']=function(_0x16b51a,_0x30dc06){return db['Cdr'][_0x1e18('0x4f')]()[_0x1e18('0x29')](respondWithResult(_0x30dc06,null))[_0x1e18('0x47')](handleError(_0x30dc06,null));};
\ No newline at end of file
+var _0x9c5a=['order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','Cdr','rows','catch','params','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x3e7f5a,_0x120038){var _0x20d3d5=function(_0x5a649b){while(--_0x5a649b){_0x3e7f5a['push'](_0x3e7f5a['shift']());}};_0x20d3d5(++_0x120038);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x1ac7be,_0x29f2bf){_0x1ac7be=_0x1ac7be-0x0;var _0x2b60bf=_0x9c5a[_0x1ac7be];return _0x2b60bf;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)[_0xa9c5('0x18')]();});}};}function handleEntityNotFound(_0x32fc7d,_0x4cbba1){return function(_0x40f08b){if(!_0x40f08b){_0x32fc7d[_0xa9c5('0x17')](0x194);}return _0x40f08b;};}function handleError(_0x51b64a,_0x4e8a7f){_0x4e8a7f=_0x4e8a7f||0x1f4;return function(_0x242771){logger['error'](_0x242771[_0xa9c5('0x25')]);if(_0x242771[_0xa9c5('0x26')]){delete _0x242771['name'];}_0x51b64a[_0xa9c5('0x19')](_0x4e8a7f)[_0xa9c5('0x27')](_0x242771);};}exports['index']=function(_0x413edf,_0x32baf9){var _0x198cdf={},_0x185eb8={},_0x325c65={'count':0x0,'rows':[]};var _0x4f6e70=_[_0xa9c5('0x28')](db['Cdr'][_0xa9c5('0x29')],function(_0x1ef388){return{'name':_0x1ef388[_0xa9c5('0x2a')],'type':_0x1ef388['type'][_0xa9c5('0x2b')]};});_0x185eb8[_0xa9c5('0x2c')]=_['map'](_0x4f6e70,_0xa9c5('0x26'));_0x185eb8[_0xa9c5('0x2d')]=_[_0xa9c5('0x2e')](_0x413edf[_0xa9c5('0x2d')]);_0x185eb8[_0xa9c5('0x2f')]=_[_0xa9c5('0x30')](_0x185eb8[_0xa9c5('0x2c')],_0x185eb8['query']);_0x198cdf[_0xa9c5('0x31')]=_[_0xa9c5('0x30')](_0x185eb8[_0xa9c5('0x2c')],qs[_0xa9c5('0x32')](_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x32')]));_0x198cdf[_0xa9c5('0x31')]=_0x198cdf[_0xa9c5('0x31')]['length']?_0x198cdf['attributes']:_0x185eb8[_0xa9c5('0x2c')];if(!_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x33')](_0xa9c5('0x34'))){_0x198cdf[_0xa9c5('0x1c')]=qs[_0xa9c5('0x1c')](_0x413edf['query']['limit']);_0x198cdf['offset']=qs[_0xa9c5('0x1e')](_0x413edf[_0xa9c5('0x2d')]['offset']);}_0x198cdf[_0xa9c5('0x35')]=qs['sort'](_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x36')]);_0x198cdf[_0xa9c5('0x37')]=qs[_0xa9c5('0x2f')](_['pick'](_0x413edf[_0xa9c5('0x2d')],_0x185eb8[_0xa9c5('0x2f')]),_0x4f6e70);if(_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x38')]){_0x198cdf[_0xa9c5('0x37')]=_[_0xa9c5('0x39')](_0x198cdf[_0xa9c5('0x37')],{'$or':_[_0xa9c5('0x28')](_0x4f6e70,function(_0x573fc0){if(_0x573fc0[_0xa9c5('0x3a')]!==_0xa9c5('0x3b')){var _0x841c18={};_0x841c18[_0x573fc0[_0xa9c5('0x26')]]={'$like':'%'+_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x38')]+'%'};return _0x841c18;}})});}_0x198cdf=_['merge']({},_0x198cdf,_0x413edf[_0xa9c5('0x3c')]);var _0x5b7a0a={'where':_0x198cdf[_0xa9c5('0x37')]};return db['Cdr'][_0xa9c5('0x1d')](_0x5b7a0a)[_0xa9c5('0x24')](function(_0x37fb1b){_0x325c65['count']=_0x37fb1b;if(_0x413edf[_0xa9c5('0x2d')][_0xa9c5('0x3d')]){_0x198cdf[_0xa9c5('0x3e')]=[{'all':!![]}];}return db[_0xa9c5('0x3f')]['findAll'](_0x198cdf);})[_0xa9c5('0x24')](function(_0x97803f){_0x325c65[_0xa9c5('0x40')]=_0x97803f;return _0x325c65;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x32baf9,_0x198cdf))[_0xa9c5('0x41')](handleError(_0x32baf9,null));};exports['show']=function(_0x2a1138,_0x566b60){var _0x1de605={'raw':!![],'where':{'id':_0x2a1138[_0xa9c5('0x42')]['id']}},_0x397614={};_0x397614[_0xa9c5('0x2c')]=_[_0xa9c5('0x2e')](db[_0xa9c5('0x3f')][_0xa9c5('0x29')]);_0x397614[_0xa9c5('0x2d')]=_[_0xa9c5('0x2e')](_0x2a1138[_0xa9c5('0x2d')]);_0x397614['filters']=_[_0xa9c5('0x30')](_0x397614[_0xa9c5('0x2c')],_0x397614[_0xa9c5('0x2d')]);_0x1de605[_0xa9c5('0x31')]=_[_0xa9c5('0x30')](_0x397614[_0xa9c5('0x2c')],qs['fields'](_0x2a1138[_0xa9c5('0x2d')][_0xa9c5('0x32')]));_0x1de605['attributes']=_0x1de605['attributes']['length']?_0x1de605['attributes']:_0x397614['model'];if(_0x2a1138[_0xa9c5('0x2d')][_0xa9c5('0x3d')]){_0x1de605[_0xa9c5('0x3e')]=[{'all':!![]}];}_0x1de605=_[_0xa9c5('0x39')]({},_0x1de605,_0x2a1138[_0xa9c5('0x3c')]);return db[_0xa9c5('0x3f')][_0xa9c5('0x43')](_0x1de605)[_0xa9c5('0x24')](handleEntityNotFound(_0x566b60,null))[_0xa9c5('0x24')](respondWithResult(_0x566b60,null))[_0xa9c5('0x41')](handleError(_0x566b60,null));};exports[_0xa9c5('0x44')]=function(_0x2c3dbf,_0x1c2ccf){return db['Cdr'][_0xa9c5('0x44')](_0x2c3dbf['body'],{})[_0xa9c5('0x24')](respondWithResult(_0x1c2ccf,0xc9))[_0xa9c5('0x41')](handleError(_0x1c2ccf,null));};exports['update']=function(_0x5cbd33,_0xf00970){if(_0x5cbd33[_0xa9c5('0x45')]['id']){delete _0x5cbd33[_0xa9c5('0x45')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5cbd33[_0xa9c5('0x42')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0xf00970,null))['then'](saveUpdates(_0x5cbd33[_0xa9c5('0x45')],null))[_0xa9c5('0x24')](respondWithResult(_0xf00970,null))[_0xa9c5('0x41')](handleError(_0xf00970,null));};exports[_0xa9c5('0x46')]=function(_0x34020f,_0xb369da){return db['Cdr']['find']({'where':{'id':_0x34020f['params']['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0xb369da,null))[_0xa9c5('0x24')](removeEntity(_0xb369da,null))[_0xa9c5('0x41')](handleError(_0xb369da,null));};exports[_0xa9c5('0x47')]=function(_0x380266,_0x15d044){return db['Cdr'][_0xa9c5('0x47')]()[_0xa9c5('0x24')](respondWithResult(_0x15d044,null))[_0xa9c5('0x41')](handleError(_0x15d044,null));};
\ No newline at end of file
index b6c1d02..db7a9fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x177436,_0x349f8b){var _0x59c78a=function(_0x4553d1){while(--_0x4553d1){_0x177436['push'](_0x177436['shift']());}};_0x59c78a(++_0x349f8b);}(_0x7a54,0x106));var _0x47a5=function(_0x55664b,_0x329ff4){_0x55664b=_0x55664b-0x0;var _0x3aa8b0=_0x7a54[_0x55664b];return _0x3aa8b0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x54d075,_0x39fc94){var _0x591c94=function(_0x5b3777){while(--_0x5b3777){_0x54d075['push'](_0x54d075['shift']());}};_0x591c94(++_0x39fc94);}(_0x7a54,0x106));var _0x47a5=function(_0x3c1ce0,_0x1c9a46){_0x3c1ce0=_0x3c1ce0-0x0;var _0x4fe5a4=_0x7a54[_0x3c1ce0];return _0x4fe5a4;};'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 dc3120d..a163379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccaf=['stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x4c1440,_0x39bfb0){var _0x14bc0b=function(_0x479c93){while(--_0x479c93){_0x4c1440['push'](_0x4c1440['shift']());}};_0x14bc0b(++_0x39bfb0);}(_0xccaf,0xe1));var _0xfcca=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0xccaf[_0x3299d1];return _0x44356e;};'use strict';var _=require(_0xfcca('0x0'));var util=require('util');var moment=require(_0xfcca('0x1'));var BPromise=require('bluebird');var rs=require(_0xfcca('0x2'));var fs=require('fs');var Redis=require(_0xfcca('0x3'));var db=require(_0xfcca('0x4'))['db'];var utils=require(_0xfcca('0x5'));var logger=require(_0xfcca('0x6'))(_0xfcca('0x7'));var config=require('../../config/environment');var jayson=require(_0xfcca('0x8'));var client=jayson[_0xfcca('0x9')][_0xfcca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35c385,_0x51b4ff,_0x2c266a){return new BPromise(function(_0x5831c1,_0x361a48){return client['request'](_0x35c385,_0x2c266a)[_0xfcca('0xb')](function(_0x52a83e){logger[_0xfcca('0xc')](_0xfcca('0xd'),_0x51b4ff,_0xfcca('0xe'));logger[_0xfcca('0xf')](_0xfcca('0x10'),_0x51b4ff,_0xfcca('0xe'),JSON[_0xfcca('0x11')](_0x52a83e));if(_0x52a83e['error']){if(_0x52a83e['error']['code']===0x1f4){logger[_0xfcca('0x12')](_0xfcca('0xd'),_0x51b4ff,_0x52a83e[_0xfcca('0x12')]['message']);return _0x361a48(_0x52a83e[_0xfcca('0x12')][_0xfcca('0x13')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x51b4ff,_0x52a83e[_0xfcca('0x12')][_0xfcca('0x13')]);return _0x5831c1(_0x52a83e['error'][_0xfcca('0x13')]);}else{logger[_0xfcca('0xc')](_0xfcca('0xd'),_0x51b4ff,_0xfcca('0xe'));_0x5831c1(_0x52a83e[_0xfcca('0x14')][_0xfcca('0x13')]);}})[_0xfcca('0x15')](function(_0x4a8d59){logger[_0xfcca('0x12')](_0xfcca('0xd'),_0x51b4ff,_0x4a8d59);_0x361a48(_0x4a8d59);});});}
\ No newline at end of file
+var _0xb3c5=['jayson/promise','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2c1f46,_0x842fea){var _0x145263=function(_0x224ef6){while(--_0x224ef6){_0x2c1f46['push'](_0x2c1f46['shift']());}};_0x145263(++_0x842fea);}(_0xb3c5,0x15d));var _0x5b3c=function(_0x18b5e8,_0x51e875){_0x18b5e8=_0x18b5e8-0x0;var _0x25baed=_0xb3c5[_0x18b5e8];return _0x25baed;};'use strict';var _=require(_0x5b3c('0x0'));var util=require(_0x5b3c('0x1'));var moment=require(_0x5b3c('0x2'));var BPromise=require(_0x5b3c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b3c('0x4'))['db'];var utils=require(_0x5b3c('0x5'));var logger=require(_0x5b3c('0x6'))('rpc');var config=require(_0x5b3c('0x7'));var jayson=require(_0x5b3c('0x8'));var client=jayson['client'][_0x5b3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13849c,_0x20e0f8,_0x131982){return new BPromise(function(_0x3bba5e,_0x441907){return client[_0x5b3c('0xa')](_0x13849c,_0x131982)['then'](function(_0x12764a){logger[_0x5b3c('0xb')](_0x5b3c('0xc'),_0x20e0f8,_0x5b3c('0xd'));logger[_0x5b3c('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x20e0f8,_0x5b3c('0xd'),JSON[_0x5b3c('0xf')](_0x12764a));if(_0x12764a[_0x5b3c('0x10')]){if(_0x12764a['error'][_0x5b3c('0x11')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x20e0f8,_0x12764a[_0x5b3c('0x10')][_0x5b3c('0x12')]);return _0x441907(_0x12764a[_0x5b3c('0x10')]['message']);}logger[_0x5b3c('0x10')](_0x5b3c('0xc'),_0x20e0f8,_0x12764a[_0x5b3c('0x10')]['message']);return _0x3bba5e(_0x12764a[_0x5b3c('0x10')][_0x5b3c('0x12')]);}else{logger[_0x5b3c('0xb')](_0x5b3c('0xc'),_0x20e0f8,_0x5b3c('0xd'));_0x3bba5e(_0x12764a[_0x5b3c('0x13')][_0x5b3c('0x12')]);}})[_0x5b3c('0x14')](function(_0x247457){logger['error'](_0x5b3c('0xc'),_0x20e0f8,_0x247457);_0x441907(_0x247457);});});}
\ No newline at end of file
index 2b578a7..0a77a6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x19cce8,_0x23a814){var _0x575f93=function(_0x515f8b){while(--_0x515f8b){_0x19cce8['push'](_0x19cce8['shift']());}};_0x575f93(++_0x23a814);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index 493ad68..e192827 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6138=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0xa2f2c0,_0x1bd315){var _0x3f2623=function(_0x38ff37){while(--_0x38ff37){_0xa2f2c0['push'](_0xa2f2c0['shift']());}};_0x3f2623(++_0x1bd315);}(_0x6138,0xbd));var _0x8613=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x6138[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x8613('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8613('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8613('0x2')],'allowNull':![],'defaultValue':_0x8613('0x3')},'appdata':{'type':Sequelize[_0x8613('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8613('0x2')],'defaultValue':_0x8613('0x5')}};
\ No newline at end of file
+var _0x6086=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x142735,_0x559761){var _0x358b8d=function(_0x17bf46){while(--_0x17bf46){_0x142735['push'](_0x142735['shift']());}};_0x358b8d(++_0x559761);}(_0x6086,0xca));var _0x6608=function(_0x520621,_0x186955){_0x520621=_0x520621-0x0;var _0x5232c1=_0x6086[_0x520621];return _0x5232c1;};'use strict';var Sequelize=require(_0x6608('0x0'));module[_0x6608('0x1')]={'priority':{'type':Sequelize[_0x6608('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6608('0x3')],'allowNull':![],'defaultValue':_0x6608('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6608('0x3')]},'interval':{'type':Sequelize[_0x6608('0x3')],'defaultValue':_0x6608('0x5')}};
\ No newline at end of file
index b1e47a3..118ea50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b1a=['ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','show','model','keys','ChatApplication','query','filters','intersection','attributes','length','includeAll','merge','options','find','catch','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x13bf09,_0x59c727){var _0x40e2db=function(_0x592df5){while(--_0x592df5){_0x13bf09['push'](_0x13bf09['shift']());}};_0x40e2db(++_0x59c727);}(_0x8b1a,0x152));var _0xa8b1=function(_0x2f695c,_0x4d7278){_0x2f695c=_0x2f695c-0x0;var _0x101d54=_0x8b1a[_0x2f695c];return _0x101d54;};'use strict';var emlformat=require(_0xa8b1('0x0'));var rimraf=require(_0xa8b1('0x1'));var zipdir=require(_0xa8b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8b1('0x3'));var moment=require(_0xa8b1('0x4'));var BPromise=require(_0xa8b1('0x5'));var Mustache=require('mustache');var util=require(_0xa8b1('0x6'));var path=require(_0xa8b1('0x7'));var sox=require(_0xa8b1('0x8'));var csv=require(_0xa8b1('0x9'));var ejs=require(_0xa8b1('0xa'));var fs=require('fs');var fs_extra=require(_0xa8b1('0xb'));var _=require('lodash');var squel=require(_0xa8b1('0xc'));var crypto=require(_0xa8b1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa8b1('0xe'));var toCsv=require(_0xa8b1('0x9'));var querystring=require('querystring');var Papa=require(_0xa8b1('0xf'));var Redis=require(_0xa8b1('0x10'));var authService=require(_0xa8b1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8b1('0x12'));var logger=require('../../config/logger')(_0xa8b1('0x13'));var utils=require(_0xa8b1('0x14'));var config=require(_0xa8b1('0x15'));var licenseUtil=require(_0xa8b1('0x16'));var db=require(_0xa8b1('0x17'))['db'];function respondWithStatusCode(_0x371ffc,_0x186fd3){_0x186fd3=_0x186fd3||0xcc;return function(_0x26bed2){if(_0x26bed2){return _0x371ffc['sendStatus'](_0x186fd3);}return _0x371ffc[_0xa8b1('0x18')](_0x186fd3)[_0xa8b1('0x19')]();};}function respondWithResult(_0x4adb3f,_0x193d69){_0x193d69=_0x193d69||0xc8;return function(_0x541cc6){if(_0x541cc6){return _0x4adb3f[_0xa8b1('0x18')](_0x193d69)['json'](_0x541cc6);}};}function respondWithFilteredResult(_0x130f9b,_0xb9662b){return function(_0x459cd7){if(_0x459cd7){var _0x1fbc70=typeof _0xb9662b[_0xa8b1('0x1a')]===_0xa8b1('0x1b')&&typeof _0xb9662b[_0xa8b1('0x1c')]===_0xa8b1('0x1b');var _0x4f8773=_0x459cd7[_0xa8b1('0x1d')];var _0x457967=_0x1fbc70?0x0:_0xb9662b[_0xa8b1('0x1a')];var _0x59ff94=_0x1fbc70?_0x459cd7['count']:_0xb9662b['offset']+_0xb9662b['limit'];var _0x38f4f5;if(_0x59ff94>=_0x4f8773){_0x59ff94=_0x4f8773;_0x38f4f5=0xc8;}else{_0x38f4f5=0xce;}_0x130f9b[_0xa8b1('0x18')](_0x38f4f5);return _0x130f9b[_0xa8b1('0x1e')]('Content-Range',_0x457967+'-'+_0x59ff94+'/'+_0x4f8773)['json'](_0x459cd7);}return null;};}function patchUpdates(_0x22918b){return function(_0x4c866d){try{jsonpatch[_0xa8b1('0x1f')](_0x4c866d,_0x22918b,!![]);}catch(_0x2563cc){return BPromise[_0xa8b1('0x20')](_0x2563cc);}return _0x4c866d[_0xa8b1('0x21')]();};}function saveUpdates(_0x240dc9,_0x5dfba3){return function(_0x2ab5a0){if(_0x2ab5a0){return _0x2ab5a0['update'](_0x240dc9)['then'](function(_0x1fa698){return _0x1fa698;});}return null;};}function removeEntity(_0xebc2c4,_0x1f7c45){return function(_0x8e156f){if(_0x8e156f){return _0x8e156f[_0xa8b1('0x22')]()[_0xa8b1('0x23')](function(){_0xebc2c4[_0xa8b1('0x18')](0xcc)[_0xa8b1('0x19')]();});}};}function handleEntityNotFound(_0x4b9667,_0x45f000){return function(_0x5c3f35){if(!_0x5c3f35){_0x4b9667[_0xa8b1('0x24')](0x194);}return _0x5c3f35;};}function handleError(_0x58a079,_0x55d3e1){_0x55d3e1=_0x55d3e1||0x1f4;return function(_0x7ffbc1){logger[_0xa8b1('0x25')](_0x7ffbc1[_0xa8b1('0x26')]);if(_0x7ffbc1[_0xa8b1('0x27')]){delete _0x7ffbc1[_0xa8b1('0x27')];}_0x58a079[_0xa8b1('0x18')](_0x55d3e1)[_0xa8b1('0x28')](_0x7ffbc1);};}exports[_0xa8b1('0x29')]=function(_0x1f5314,_0x13b5e2){var _0x315add={'raw':!![],'where':{'id':_0x1f5314['params']['id']}},_0x245632={};_0x245632[_0xa8b1('0x2a')]=_[_0xa8b1('0x2b')](db[_0xa8b1('0x2c')]['rawAttributes']);_0x245632[_0xa8b1('0x2d')]=_[_0xa8b1('0x2b')](_0x1f5314[_0xa8b1('0x2d')]);_0x245632[_0xa8b1('0x2e')]=_[_0xa8b1('0x2f')](_0x245632[_0xa8b1('0x2a')],_0x245632['query']);_0x315add['attributes']=_['intersection'](_0x245632['model'],qs['fields'](_0x1f5314['query']['fields']));_0x315add[_0xa8b1('0x30')]=_0x315add[_0xa8b1('0x30')][_0xa8b1('0x31')]?_0x315add[_0xa8b1('0x30')]:_0x245632['model'];if(_0x1f5314[_0xa8b1('0x2d')][_0xa8b1('0x32')]){_0x315add['include']=[{'all':!![]}];}_0x315add=_[_0xa8b1('0x33')]({},_0x315add,_0x1f5314[_0xa8b1('0x34')]);return db['ChatApplication'][_0xa8b1('0x35')](_0x315add)[_0xa8b1('0x23')](handleEntityNotFound(_0x13b5e2,null))['then'](respondWithResult(_0x13b5e2,null))[_0xa8b1('0x36')](handleError(_0x13b5e2,null));};exports[_0xa8b1('0x37')]=function(_0x1f63f7,_0x401c4e){if(_0x1f63f7['body']['id']){delete _0x1f63f7[_0xa8b1('0x38')]['id'];}return db[_0xa8b1('0x2c')][_0xa8b1('0x35')]({'where':{'id':_0x1f63f7[_0xa8b1('0x39')]['id']}})[_0xa8b1('0x23')](handleEntityNotFound(_0x401c4e,null))[_0xa8b1('0x23')](saveUpdates(_0x1f63f7[_0xa8b1('0x38')],null))['then'](respondWithResult(_0x401c4e,null))['catch'](handleError(_0x401c4e,null));};exports[_0xa8b1('0x22')]=function(_0x55dbe4,_0x4fe7b1){return db[_0xa8b1('0x2c')]['find']({'where':{'id':_0x55dbe4[_0xa8b1('0x39')]['id']}})[_0xa8b1('0x23')](handleEntityNotFound(_0x4fe7b1,null))['then'](removeEntity(_0x4fe7b1,null))[_0xa8b1('0x36')](handleError(_0x4fe7b1,null));};
\ No newline at end of file
+var _0x3299=['end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','name','params','keys','ChatApplication','query','filters','intersection','model','fields','attributes','length','includeAll','include','options','find','catch','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x227332,_0x1bf62b){var _0x26fb7f=function(_0x11c9c0){while(--_0x11c9c0){_0x227332['push'](_0x227332['shift']());}};_0x26fb7f(++_0x1bf62b);}(_0x3299,0x1bc));var _0x9329=function(_0xfa186e,_0x32ef4e){_0xfa186e=_0xfa186e-0x0;var _0x2d15f0=_0x3299[_0xfa186e];return _0x2d15f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9329('0x0'));var zipdir=require(_0x9329('0x1'));var jsonpatch=require(_0x9329('0x2'));var rp=require(_0x9329('0x3'));var moment=require(_0x9329('0x4'));var BPromise=require(_0x9329('0x5'));var Mustache=require(_0x9329('0x6'));var util=require(_0x9329('0x7'));var path=require(_0x9329('0x8'));var sox=require(_0x9329('0x9'));var csv=require(_0x9329('0xa'));var ejs=require(_0x9329('0xb'));var fs=require('fs');var fs_extra=require(_0x9329('0xc'));var _=require(_0x9329('0xd'));var squel=require(_0x9329('0xe'));var crypto=require(_0x9329('0xf'));var jsforce=require(_0x9329('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9329('0xa'));var querystring=require(_0x9329('0x11'));var Papa=require(_0x9329('0x12'));var Redis=require(_0x9329('0x13'));var authService=require(_0x9329('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9329('0x15'));var hardwareService=require(_0x9329('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9329('0x17'));var licenseUtil=require(_0x9329('0x18'));var db=require(_0x9329('0x19'))['db'];function respondWithStatusCode(_0x1302e8,_0x293b04){_0x293b04=_0x293b04||0xcc;return function(_0x523aff){if(_0x523aff){return _0x1302e8[_0x9329('0x1a')](_0x293b04);}return _0x1302e8[_0x9329('0x1b')](_0x293b04)[_0x9329('0x1c')]();};}function respondWithResult(_0x4cc89c,_0x1ee23e){_0x1ee23e=_0x1ee23e||0xc8;return function(_0x2a7c38){if(_0x2a7c38){return _0x4cc89c['status'](_0x1ee23e)[_0x9329('0x1d')](_0x2a7c38);}};}function respondWithFilteredResult(_0x1b2b98,_0x4adc7e){return function(_0x5e21ad){if(_0x5e21ad){var _0x73ec60=typeof _0x4adc7e[_0x9329('0x1e')]===_0x9329('0x1f')&&typeof _0x4adc7e['limit']===_0x9329('0x1f');var _0x522094=_0x5e21ad[_0x9329('0x20')];var _0x1b5eed=_0x73ec60?0x0:_0x4adc7e['offset'];var _0x41db73=_0x73ec60?_0x5e21ad[_0x9329('0x20')]:_0x4adc7e['offset']+_0x4adc7e[_0x9329('0x21')];var _0x4f5d6c;if(_0x41db73>=_0x522094){_0x41db73=_0x522094;_0x4f5d6c=0xc8;}else{_0x4f5d6c=0xce;}_0x1b2b98[_0x9329('0x1b')](_0x4f5d6c);return _0x1b2b98['set'](_0x9329('0x22'),_0x1b5eed+'-'+_0x41db73+'/'+_0x522094)['json'](_0x5e21ad);}return null;};}function patchUpdates(_0x6676d7){return function(_0x1af29b){try{jsonpatch[_0x9329('0x23')](_0x1af29b,_0x6676d7,!![]);}catch(_0x1dbebc){return BPromise[_0x9329('0x24')](_0x1dbebc);}return _0x1af29b[_0x9329('0x25')]();};}function saveUpdates(_0x4a7039,_0x1fa600){return function(_0x4f895c){if(_0x4f895c){return _0x4f895c[_0x9329('0x26')](_0x4a7039)[_0x9329('0x27')](function(_0x26f8a7){return _0x26f8a7;});}return null;};}function removeEntity(_0x59fb85,_0x22caa4){return function(_0x46019b){if(_0x46019b){return _0x46019b['destroy']()[_0x9329('0x27')](function(){_0x59fb85[_0x9329('0x1b')](0xcc)[_0x9329('0x1c')]();});}};}function handleEntityNotFound(_0x2da39d,_0x5584ae){return function(_0x49575f){if(!_0x49575f){_0x2da39d[_0x9329('0x1a')](0x194);}return _0x49575f;};}function handleError(_0x156626,_0x4419fc){_0x4419fc=_0x4419fc||0x1f4;return function(_0x4f5fbf){logger[_0x9329('0x28')](_0x4f5fbf['stack']);if(_0x4f5fbf[_0x9329('0x29')]){delete _0x4f5fbf[_0x9329('0x29')];}_0x156626[_0x9329('0x1b')](_0x4419fc)['send'](_0x4f5fbf);};}exports['show']=function(_0x36765a,_0x49d501){var _0x269964={'raw':!![],'where':{'id':_0x36765a[_0x9329('0x2a')]['id']}},_0x4a5d27={};_0x4a5d27['model']=_[_0x9329('0x2b')](db[_0x9329('0x2c')]['rawAttributes']);_0x4a5d27[_0x9329('0x2d')]=_[_0x9329('0x2b')](_0x36765a['query']);_0x4a5d27[_0x9329('0x2e')]=_[_0x9329('0x2f')](_0x4a5d27[_0x9329('0x30')],_0x4a5d27[_0x9329('0x2d')]);_0x269964['attributes']=_['intersection'](_0x4a5d27['model'],qs[_0x9329('0x31')](_0x36765a['query'][_0x9329('0x31')]));_0x269964['attributes']=_0x269964[_0x9329('0x32')][_0x9329('0x33')]?_0x269964['attributes']:_0x4a5d27[_0x9329('0x30')];if(_0x36765a[_0x9329('0x2d')][_0x9329('0x34')]){_0x269964[_0x9329('0x35')]=[{'all':!![]}];}_0x269964=_['merge']({},_0x269964,_0x36765a[_0x9329('0x36')]);return db[_0x9329('0x2c')][_0x9329('0x37')](_0x269964)[_0x9329('0x27')](handleEntityNotFound(_0x49d501,null))[_0x9329('0x27')](respondWithResult(_0x49d501,null))[_0x9329('0x38')](handleError(_0x49d501,null));};exports['update']=function(_0x96c433,_0xb49d9c){if(_0x96c433[_0x9329('0x39')]['id']){delete _0x96c433[_0x9329('0x39')]['id'];}return db[_0x9329('0x2c')][_0x9329('0x37')]({'where':{'id':_0x96c433[_0x9329('0x2a')]['id']}})[_0x9329('0x27')](handleEntityNotFound(_0xb49d9c,null))['then'](saveUpdates(_0x96c433[_0x9329('0x39')],null))['then'](respondWithResult(_0xb49d9c,null))[_0x9329('0x38')](handleError(_0xb49d9c,null));};exports[_0x9329('0x3a')]=function(_0x37475b,_0x2c7588){return db[_0x9329('0x2c')][_0x9329('0x37')]({'where':{'id':_0x37475b['params']['id']}})['then'](handleEntityNotFound(_0x2c7588,null))[_0x9329('0x27')](removeEntity(_0x2c7588,null))[_0x9329('0x38')](handleError(_0x2c7588,null));};
\ No newline at end of file
index f1cfd09..b1dc591 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e4e=['util','../../config/logger','api','moment','request-promise','path','rimraf','define','utf8mb4_unicode_ci','lodash'];(function(_0x361efe,_0x5b59b9){var _0x36dd74=function(_0x1c0ab5){while(--_0x1c0ab5){_0x361efe['push'](_0x361efe['shift']());}};_0x36dd74(++_0x5b59b9);}(_0x2e4e,0x9f));var _0xe2e4=function(_0x332963,_0x30669d){_0x332963=_0x332963-0x0;var _0xc26577=_0x2e4e[_0x332963];return _0xc26577;};'use strict';var _=require(_0xe2e4('0x0'));var util=require(_0xe2e4('0x1'));var logger=require(_0xe2e4('0x2'))(_0xe2e4('0x3'));var moment=require(_0xe2e4('0x4'));var BPromise=require('bluebird');var rp=require(_0xe2e4('0x5'));var fs=require('fs');var path=require(_0xe2e4('0x6'));var rimraf=require(_0xe2e4('0x7'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module['exports']=function(_0x15a37c,_0x3f58ea){return _0x15a37c[_0xe2e4('0x8')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe2e4('0x9')});};
\ No newline at end of file
+var _0x5b02=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','utf8mb4_unicode_ci','lodash'];(function(_0x2f04af,_0x335c0c){var _0x241d61=function(_0x124948){while(--_0x124948){_0x2f04af['push'](_0x2f04af['shift']());}};_0x241d61(++_0x335c0c);}(_0x5b02,0xbf));var _0x25b0=function(_0xbb5309,_0x50d6a8){_0xbb5309=_0xbb5309-0x0;var _0x32ea0d=_0x5b02[_0xbb5309];return _0x32ea0d;};'use strict';var _=require(_0x25b0('0x0'));var util=require('util');var logger=require(_0x25b0('0x1'))(_0x25b0('0x2'));var moment=require(_0x25b0('0x3'));var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require(_0x25b0('0x5'));var rimraf=require(_0x25b0('0x6'));var config=require(_0x25b0('0x7'));var attributes=require(_0x25b0('0x8'));module['exports']=function(_0x5061e1,_0x43a7a3){return _0x5061e1[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x25b0('0xb')});};
\ No newline at end of file
index 1757f04..eb86345 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40e3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x433106,_0x3b9c5c){var _0x1a7f76=function(_0x2374f5){while(--_0x2374f5){_0x433106['push'](_0x433106['shift']());}};_0x1a7f76(++_0x3b9c5c);}(_0x40e3,0x9d));var _0x340e=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x40e3[_0x474bc0];return _0x4b24cf;};'use strict';var _=require(_0x340e('0x0'));var util=require(_0x340e('0x1'));var moment=require(_0x340e('0x2'));var BPromise=require(_0x340e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x340e('0x4'));var db=require(_0x340e('0x5'))['db'];var utils=require(_0x340e('0x6'));var logger=require(_0x340e('0x7'))(_0x340e('0x8'));var config=require(_0x340e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x340e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf55609,_0x3bde65,_0x3bacc3){return new BPromise(function(_0x3a22b7,_0x3374b9){return client[_0x340e('0xb')](_0xf55609,_0x3bacc3)[_0x340e('0xc')](function(_0x4ccf30){logger[_0x340e('0xd')](_0x340e('0xe'),_0x3bde65,_0x340e('0xf'));logger['debug'](_0x340e('0x10'),_0x3bde65,'request\x20sent',JSON[_0x340e('0x11')](_0x4ccf30));if(_0x4ccf30['error']){if(_0x4ccf30[_0x340e('0x12')][_0x340e('0x13')]===0x1f4){logger[_0x340e('0x12')](_0x340e('0xe'),_0x3bde65,_0x4ccf30['error'][_0x340e('0x14')]);return _0x3374b9(_0x4ccf30[_0x340e('0x12')][_0x340e('0x14')]);}logger[_0x340e('0x12')]('ChatApplication,\x20%s,\x20%s',_0x3bde65,_0x4ccf30[_0x340e('0x12')]['message']);return _0x3a22b7(_0x4ccf30[_0x340e('0x12')]['message']);}else{logger['info'](_0x340e('0xe'),_0x3bde65,'request\x20sent');_0x3a22b7(_0x4ccf30[_0x340e('0x15')][_0x340e('0x14')]);}})[_0x340e('0x16')](function(_0x1b014f){logger[_0x340e('0x12')](_0x340e('0xe'),_0x3bde65,_0x1b014f);_0x3374b9(_0x1b014f);});});}
\ No newline at end of file
+var _0x9cf3=['../../mysqldb','../../config/logger','rpc','../../config/environment','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x2623a1,_0x38162d){var _0xd9f7bb=function(_0x41c774){while(--_0x41c774){_0x2623a1['push'](_0x2623a1['shift']());}};_0xd9f7bb(++_0x38162d);}(_0x9cf3,0x119));var _0x39cf=function(_0x5a6b00,_0x185feb){_0x5a6b00=_0x5a6b00-0x0;var _0xe559c2=_0x9cf3[_0x5a6b00];return _0xe559c2;};'use strict';var _=require('lodash');var util=require(_0x39cf('0x0'));var moment=require('moment');var BPromise=require(_0x39cf('0x1'));var rs=require(_0x39cf('0x2'));var fs=require('fs');var Redis=require(_0x39cf('0x3'));var db=require(_0x39cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x39cf('0x5'))(_0x39cf('0x6'));var config=require(_0x39cf('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x578707,_0x3a3db0,_0x3d1fee){return new BPromise(function(_0x52c18e,_0x343430){return client['request'](_0x578707,_0x3d1fee)['then'](function(_0xa6af9b){logger[_0x39cf('0x8')](_0x39cf('0x9'),_0x3a3db0,_0x39cf('0xa'));logger[_0x39cf('0xb')](_0x39cf('0xc'),_0x3a3db0,_0x39cf('0xa'),JSON[_0x39cf('0xd')](_0xa6af9b));if(_0xa6af9b[_0x39cf('0xe')]){if(_0xa6af9b[_0x39cf('0xe')][_0x39cf('0xf')]===0x1f4){logger['error'](_0x39cf('0x9'),_0x3a3db0,_0xa6af9b[_0x39cf('0xe')][_0x39cf('0x10')]);return _0x343430(_0xa6af9b[_0x39cf('0xe')][_0x39cf('0x10')]);}logger['error'](_0x39cf('0x9'),_0x3a3db0,_0xa6af9b[_0x39cf('0xe')][_0x39cf('0x10')]);return _0x52c18e(_0xa6af9b[_0x39cf('0xe')][_0x39cf('0x10')]);}else{logger[_0x39cf('0x8')](_0x39cf('0x9'),_0x3a3db0,_0x39cf('0xa'));_0x52c18e(_0xa6af9b[_0x39cf('0x11')][_0x39cf('0x10')]);}})[_0x39cf('0x12')](function(_0x50ad98){logger[_0x39cf('0xe')]('ChatApplication,\x20%s,\x20%s',_0x3a3db0,_0x50ad98);_0x343430(_0x50ad98);});});}
\ No newline at end of file
index 7eb999d..1d1a04e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93a1=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util'];(function(_0x36e7d3,_0xd816e4){var _0x1b9c66=function(_0x265104){while(--_0x265104){_0x36e7d3['push'](_0x36e7d3['shift']());}};_0x1b9c66(++_0xd816e4);}(_0x93a1,0x97));var _0x193a=function(_0x676880,_0x9d17cf){_0x676880=_0x676880-0x0;var _0x24fdb9=_0x93a1[_0x676880];return _0x24fdb9;};'use strict';var multer=require(_0x193a('0x0'));var util=require(_0x193a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x193a('0x2'));var router=express[_0x193a('0x3')]();var fs_extra=require(_0x193a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x193a('0x5'));var config=require(_0x193a('0x6'));var controller=require(_0x193a('0x7'));router[_0x193a('0x8')](_0x193a('0x9'),auth[_0x193a('0xa')](),controller[_0x193a('0xb')]);router[_0x193a('0xc')]('/:id',auth[_0x193a('0xa')](),controller[_0x193a('0xd')]);router[_0x193a('0xe')](_0x193a('0x9'),auth[_0x193a('0xa')](),controller[_0x193a('0xf')]);module[_0x193a('0x10')]=router;
\ No newline at end of file
+var _0x02fe=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','destroy','exports','multer','Router','fs-extra'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x02fe,0x1dd));var _0xe02f=function(_0x812028,_0x57429b){_0x812028=_0x812028-0x0;var _0x2b97d7=_0x02fe[_0x812028];return _0x2b97d7;};'use strict';var multer=require(_0xe02f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe02f('0x1')]();var fs_extra=require(_0xe02f('0x2'));var auth=require(_0xe02f('0x3'));var interaction=require(_0xe02f('0x4'));var config=require(_0xe02f('0x5'));var controller=require(_0xe02f('0x6'));router[_0xe02f('0x7')](_0xe02f('0x8'),auth[_0xe02f('0x9')](),controller['show']);router['put']('/:id',auth[_0xe02f('0x9')](),controller['update']);router['delete'](_0xe02f('0x8'),auth[_0xe02f('0x9')](),controller[_0xe02f('0xa')]);module[_0xe02f('0xb')]=router;
\ No newline at end of file
index 8f7159e..df01357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf068=['STRING'];(function(_0x58a4b5,_0x182439){var _0x51821d=function(_0x47c3c5){while(--_0x47c3c5){_0x58a4b5['push'](_0x58a4b5['shift']());}};_0x51821d(++_0x182439);}(_0xf068,0x8b));var _0x8f06=function(_0x31be4a,_0x366394){_0x31be4a=_0x31be4a-0x0;var _0x42802a=_0xf068[_0x31be4a];return _0x42802a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8f06('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x8f06('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x4813=['sequelize','STRING'];(function(_0x20dfff,_0x37cd86){var _0x5298a6=function(_0x58773b){while(--_0x58773b){_0x20dfff['push'](_0x20dfff['shift']());}};_0x5298a6(++_0x37cd86);}(_0x4813,0xdc));var _0x3481=function(_0x224384,_0x5cb77){_0x224384=_0x224384-0x0;var _0x1a0397=_0x4813[_0x224384];return _0x1a0397;};'use strict';var Sequelize=require(_0x3481('0x0'));module['exports']={'name':{'type':Sequelize[_0x3481('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index d986e83..c8a90b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe17c=['to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','socket.io-emitter','./chatGroup.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','send','index','map','ChatGroup','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','includeAll','findAll','catch','show','params','rawAttributes','include','merge','options','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','User','getMembers','nolimit','removeMembers','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox'];(function(_0x1a37df,_0x3ed536){var _0x5a7d5f=function(_0x4dd8a1){while(--_0x4dd8a1){_0x1a37df['push'](_0x1a37df['shift']());}};_0x5a7d5f(++_0x3ed536);}(_0xe17c,0x16f));var _0xce17=function(_0x29cd51,_0x368b5e){_0x29cd51=_0x29cd51-0x0;var _0x2a0365=_0xe17c[_0x29cd51];return _0x2a0365;};'use strict';var emlformat=require(_0xce17('0x0'));var rimraf=require(_0xce17('0x1'));var zipdir=require(_0xce17('0x2'));var jsonpatch=require(_0xce17('0x3'));var rp=require(_0xce17('0x4'));var moment=require(_0xce17('0x5'));var BPromise=require(_0xce17('0x6'));var Mustache=require('mustache');var util=require(_0xce17('0x7'));var path=require('path');var sox=require(_0xce17('0x8'));var csv=require(_0xce17('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce17('0xa'));var _=require('lodash');var squel=require(_0xce17('0xb'));var crypto=require(_0xce17('0xc'));var jsforce=require(_0xce17('0xd'));var deskjs=require(_0xce17('0xe'));var toCsv=require(_0xce17('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xce17('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xce17('0x10'));var hardwareService=require(_0xce17('0x11'));var logger=require(_0xce17('0x12'))(_0xce17('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xce17('0x14'));var db=require('../../mysqldb')['db'];config[_0xce17('0x15')]=_[_0xce17('0x16')](config[_0xce17('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xce17('0x17'))(new Redis(config['redis']));require(_0xce17('0x18'))[_0xce17('0x19')](socket);function respondWithStatusCode(_0xeb4b38,_0x361eac){_0x361eac=_0x361eac||0xcc;return function(_0x4c8192){if(_0x4c8192){return _0xeb4b38['sendStatus'](_0x361eac);}return _0xeb4b38['status'](_0x361eac)['end']();};}function respondWithResult(_0x17e84a,_0x10562c){_0x10562c=_0x10562c||0xc8;return function(_0x1c7b8d){if(_0x1c7b8d){return _0x17e84a[_0xce17('0x1a')](_0x10562c)[_0xce17('0x1b')](_0x1c7b8d);}};}function respondWithFilteredResult(_0x402254,_0x12c01d){return function(_0x31d375){if(_0x31d375){var _0x565473=typeof _0x12c01d[_0xce17('0x1c')]===_0xce17('0x1d')&&typeof _0x12c01d['limit']===_0xce17('0x1d');var _0x41d4a7=_0x31d375['count'];var _0x50b19b=_0x565473?0x0:_0x12c01d[_0xce17('0x1c')];var _0x3e32d2=_0x565473?_0x31d375[_0xce17('0x1e')]:_0x12c01d['offset']+_0x12c01d[_0xce17('0x1f')];var _0x3431a2;if(_0x3e32d2>=_0x41d4a7){_0x3e32d2=_0x41d4a7;_0x3431a2=0xc8;}else{_0x3431a2=0xce;}_0x402254[_0xce17('0x1a')](_0x3431a2);return _0x402254[_0xce17('0x20')](_0xce17('0x21'),_0x50b19b+'-'+_0x3e32d2+'/'+_0x41d4a7)[_0xce17('0x1b')](_0x31d375);}return null;};}function patchUpdates(_0x4fe104){return function(_0x237c99){try{jsonpatch[_0xce17('0x22')](_0x237c99,_0x4fe104,!![]);}catch(_0x5d2817){return BPromise[_0xce17('0x23')](_0x5d2817);}return _0x237c99['save']();};}function saveUpdates(_0x1fb0c9,_0x174ae4){return function(_0x5ee5a0){if(_0x5ee5a0){return _0x5ee5a0[_0xce17('0x24')](_0x1fb0c9)[_0xce17('0x25')](function(_0xf295e2){return _0xf295e2;});}return null;};}function removeEntity(_0x3a8d56,_0x194845){return function(_0x3d3ece){if(_0x3d3ece){return _0x3d3ece[_0xce17('0x26')]()[_0xce17('0x25')](function(){_0x3a8d56['status'](0xcc)[_0xce17('0x27')]();});}};}function handleEntityNotFound(_0x5c07fc,_0xc19fe3){return function(_0x1f307c){if(!_0x1f307c){_0x5c07fc['sendStatus'](0x194);}return _0x1f307c;};}function handleError(_0x3dd278,_0x25f65c){_0x25f65c=_0x25f65c||0x1f4;return function(_0x4e13e7){logger[_0xce17('0x28')](_0x4e13e7[_0xce17('0x29')]);if(_0x4e13e7['name']){delete _0x4e13e7['name'];}_0x3dd278['status'](_0x25f65c)[_0xce17('0x2a')](_0x4e13e7);};}exports[_0xce17('0x2b')]=function(_0x260fc5,_0x3c0efb){var _0x58e9ba={},_0x10fba7={},_0x44660a={'count':0x0,'rows':[]};var _0x1e969c=_[_0xce17('0x2c')](db[_0xce17('0x2d')]['rawAttributes'],function(_0x87ed07){return{'name':_0x87ed07[_0xce17('0x2e')],'type':_0x87ed07[_0xce17('0x2f')][_0xce17('0x30')]};});_0x10fba7[_0xce17('0x31')]=_[_0xce17('0x2c')](_0x1e969c,_0xce17('0x32'));_0x10fba7[_0xce17('0x33')]=_[_0xce17('0x34')](_0x260fc5[_0xce17('0x33')]);_0x10fba7[_0xce17('0x35')]=_[_0xce17('0x36')](_0x10fba7['model'],_0x10fba7[_0xce17('0x33')]);_0x58e9ba[_0xce17('0x37')]=_[_0xce17('0x36')](_0x10fba7['model'],qs[_0xce17('0x38')](_0x260fc5[_0xce17('0x33')][_0xce17('0x38')]));_0x58e9ba[_0xce17('0x37')]=_0x58e9ba[_0xce17('0x37')][_0xce17('0x39')]?_0x58e9ba[_0xce17('0x37')]:_0x10fba7[_0xce17('0x31')];if(!_0x260fc5[_0xce17('0x33')][_0xce17('0x3a')]('nolimit')){_0x58e9ba['limit']=qs[_0xce17('0x1f')](_0x260fc5[_0xce17('0x33')]['limit']);_0x58e9ba[_0xce17('0x1c')]=qs[_0xce17('0x1c')](_0x260fc5[_0xce17('0x33')]['offset']);}_0x58e9ba[_0xce17('0x3b')]=qs[_0xce17('0x3c')](_0x260fc5[_0xce17('0x33')][_0xce17('0x3c')]);_0x58e9ba[_0xce17('0x3d')]=qs[_0xce17('0x35')](_[_0xce17('0x3e')](_0x260fc5[_0xce17('0x33')],_0x10fba7[_0xce17('0x35')]),_0x1e969c);if(_0x260fc5[_0xce17('0x33')]['filter']){_0x58e9ba['where']=_['merge'](_0x58e9ba[_0xce17('0x3d')],{'$or':_[_0xce17('0x2c')](_0x1e969c,function(_0x4b82f9){if(_0x4b82f9[_0xce17('0x2f')]!=='VIRTUAL'){var _0x2f4d95={};_0x2f4d95[_0x4b82f9[_0xce17('0x32')]]={'$like':'%'+_0x260fc5[_0xce17('0x33')][_0xce17('0x3f')]+'%'};return _0x2f4d95;}})});}_0x58e9ba=_['merge']({},_0x58e9ba,_0x260fc5['options']);var _0x14dd23={'where':_0x58e9ba[_0xce17('0x3d')]};return db['ChatGroup']['count'](_0x14dd23)[_0xce17('0x25')](function(_0x4ecf40){_0x44660a['count']=_0x4ecf40;if(_0x260fc5[_0xce17('0x33')][_0xce17('0x40')]){_0x58e9ba['include']=[{'all':!![]}];}return db['ChatGroup'][_0xce17('0x41')](_0x58e9ba);})[_0xce17('0x25')](function(_0xababdf){_0x44660a['rows']=_0xababdf;return _0x44660a;})[_0xce17('0x25')](respondWithFilteredResult(_0x3c0efb,_0x58e9ba))[_0xce17('0x42')](handleError(_0x3c0efb,null));};exports[_0xce17('0x43')]=function(_0x508039,_0x188242){var _0x41cc60={'raw':!![],'where':{'id':_0x508039[_0xce17('0x44')]['id']}},_0x276c3c={};_0x276c3c['model']=_[_0xce17('0x34')](db[_0xce17('0x2d')][_0xce17('0x45')]);_0x276c3c['query']=_[_0xce17('0x34')](_0x508039[_0xce17('0x33')]);_0x276c3c[_0xce17('0x35')]=_[_0xce17('0x36')](_0x276c3c['model'],_0x276c3c['query']);_0x41cc60[_0xce17('0x37')]=_[_0xce17('0x36')](_0x276c3c[_0xce17('0x31')],qs[_0xce17('0x38')](_0x508039[_0xce17('0x33')][_0xce17('0x38')]));_0x41cc60['attributes']=_0x41cc60[_0xce17('0x37')][_0xce17('0x39')]?_0x41cc60[_0xce17('0x37')]:_0x276c3c['model'];if(_0x508039[_0xce17('0x33')][_0xce17('0x40')]){_0x41cc60[_0xce17('0x46')]=[{'all':!![]}];}_0x41cc60=_[_0xce17('0x47')]({},_0x41cc60,_0x508039[_0xce17('0x48')]);return db[_0xce17('0x2d')]['find'](_0x41cc60)[_0xce17('0x25')](handleEntityNotFound(_0x188242,null))[_0xce17('0x25')](respondWithResult(_0x188242,null))[_0xce17('0x42')](handleError(_0x188242,null));};exports[_0xce17('0x49')]=function(_0x384e37,_0x28d980){return db[_0xce17('0x2d')]['create'](_0x384e37[_0xce17('0x4a')],{})['then'](respondWithResult(_0x28d980,0xc9))['catch'](handleError(_0x28d980,null));};exports[_0xce17('0x24')]=function(_0x4f690e,_0x133a16){if(_0x4f690e[_0xce17('0x4a')]['id']){delete _0x4f690e[_0xce17('0x4a')]['id'];}return db[_0xce17('0x2d')][_0xce17('0x4b')]({'where':{'id':_0x4f690e[_0xce17('0x44')]['id']}})['then'](handleEntityNotFound(_0x133a16,null))[_0xce17('0x25')](saveUpdates(_0x4f690e[_0xce17('0x4a')],null))[_0xce17('0x25')](respondWithResult(_0x133a16,null))[_0xce17('0x42')](handleError(_0x133a16,null));};exports[_0xce17('0x26')]=function(_0x1c98c7,_0x227b4e){return db[_0xce17('0x2d')][_0xce17('0x4b')]({'where':{'id':_0x1c98c7[_0xce17('0x44')]['id']}})[_0xce17('0x25')](handleEntityNotFound(_0x227b4e,null))[_0xce17('0x25')](removeEntity(_0x227b4e,null))[_0xce17('0x42')](handleError(_0x227b4e,null));};exports[_0xce17('0x4c')]=function(_0x306143,_0x17d157){return db[_0xce17('0x2d')][_0xce17('0x4c')]()[_0xce17('0x25')](respondWithResult(_0x17d157,null))[_0xce17('0x42')](handleError(_0x17d157,null));};exports[_0xce17('0x4d')]=function(_0x5377c9,_0xf22b2e,_0x19e4b5){return db[_0xce17('0x4e')][_0xce17('0x1e')]({'where':{'ChatGroupId':_0x5377c9[_0xce17('0x44')]['id'],'ToId':_0x5377c9[_0xce17('0x4f')]['id'],'read':![]}})[_0xce17('0x25')](function(_0x2cd08e){return{'id':_[_0xce17('0x50')](_0x5377c9['params']['id']),'count':_0x2cd08e};})[_0xce17('0x25')](respondWithResult(_0xf22b2e,null))[_0xce17('0x42')](handleError(_0xf22b2e,null));};exports[_0xce17('0x51')]=function(_0x51c7dc,_0x2ec6f5,_0x109022){return db[_0xce17('0x2d')][_0xce17('0x4b')]({'where':{'id':_0x51c7dc[_0xce17('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ec6f5,null))['then'](function(_0x103aa2){if(_0x103aa2){return _0x103aa2[_0xce17('0x51')](_0x51c7dc['body'][_0xce17('0x52')],_['omit'](_0x51c7dc['body'],[_0xce17('0x52'),'id'])||{});}})[_0xce17('0x25')](respondWithResult(_0x2ec6f5,null))['catch'](handleError(_0x2ec6f5,null));};exports['getMembers']=function(_0x40ed67,_0x41975f,_0x38f58d){var _0x3d3782={};var _0x1cbf66={};var _0x25224f;var _0x530c43;return db[_0xce17('0x2d')][_0xce17('0x53')]({'where':{'id':_0x40ed67['params']['id']}})[_0xce17('0x25')](handleEntityNotFound(_0x41975f,null))[_0xce17('0x25')](function(_0x5b6e64){if(_0x5b6e64){_0x25224f=_0x5b6e64;_0x1cbf66[_0xce17('0x31')]=_[_0xce17('0x34')](db[_0xce17('0x54')][_0xce17('0x45')]);_0x1cbf66['query']=_[_0xce17('0x34')](_0x40ed67[_0xce17('0x33')]);_0x1cbf66['filters']=_[_0xce17('0x36')](_0x1cbf66[_0xce17('0x31')],_0x1cbf66['query']);_0x3d3782[_0xce17('0x37')]=_[_0xce17('0x36')](_0x1cbf66[_0xce17('0x31')],qs[_0xce17('0x38')](_0x40ed67[_0xce17('0x33')][_0xce17('0x38')]));_0x3d3782[_0xce17('0x37')]=_0x3d3782[_0xce17('0x37')][_0xce17('0x39')]?_0x3d3782['attributes']:_0x1cbf66['model'];_0x3d3782['order']=qs[_0xce17('0x3c')](_0x40ed67[_0xce17('0x33')]['sort']);_0x3d3782['where']=qs[_0xce17('0x35')](_[_0xce17('0x3e')](_0x40ed67['query'],_0x1cbf66['filters']));if(_0x40ed67[_0xce17('0x33')][_0xce17('0x3f')]){_0x3d3782[_0xce17('0x3d')]=_[_0xce17('0x47')](_0x3d3782[_0xce17('0x3d')],{'$or':_[_0xce17('0x2c')](_0x3d3782[_0xce17('0x37')],function(_0x2a7a77){var _0x4c339a={};_0x4c339a[_0x2a7a77]={'$like':'%'+_0x40ed67[_0xce17('0x33')][_0xce17('0x3f')]+'%'};return _0x4c339a;})});}_0x3d3782=_[_0xce17('0x47')]({},_0x3d3782,_0x40ed67[_0xce17('0x48')]);return _0x25224f[_0xce17('0x55')](_0x3d3782);}})['then'](function(_0x40b8d7){if(_0x40b8d7){_0x530c43=_0x40b8d7[_0xce17('0x39')];if(!_0x40ed67[_0xce17('0x33')][_0xce17('0x3a')](_0xce17('0x56'))){_0x3d3782['limit']=qs['limit'](_0x40ed67['query'][_0xce17('0x1f')]);_0x3d3782[_0xce17('0x1c')]=qs[_0xce17('0x1c')](_0x40ed67['query'][_0xce17('0x1c')]);}return _0x25224f[_0xce17('0x55')](_0x3d3782);}})['then'](function(_0x5bc8e8){if(_0x5bc8e8){return _0x5bc8e8?{'count':_0x530c43,'rows':_0x5bc8e8}:null;}})['then'](respondWithResult(_0x41975f,null))[_0xce17('0x42')](handleError(_0x41975f,null));};exports[_0xce17('0x57')]=function(_0x27aa48,_0x1beb0b,_0x101c42){return db['ChatGroup'][_0xce17('0x4b')]({'where':{'id':_0x27aa48[_0xce17('0x44')]['id']}})[_0xce17('0x25')](handleEntityNotFound(_0x1beb0b,null))[_0xce17('0x25')](function(_0x3fb1dd){if(_0x3fb1dd){return _0x3fb1dd[_0xce17('0x57')](_0x27aa48[_0xce17('0x33')][_0xce17('0x52')]);}})['then'](respondWithStatusCode(_0x1beb0b,null))[_0xce17('0x42')](handleError(_0x1beb0b,null));};exports['addMessage']=function(_0x5ead02,_0x590d05,_0x4bf165){if(_0x5ead02[_0xce17('0x4a')]['id']){delete _0x5ead02[_0xce17('0x4a')]['id'];}return db['ChatGroup'][_0xce17('0x4b')]({'where':{'id':_0x5ead02[_0xce17('0x44')]['id']}})[_0xce17('0x25')](handleEntityNotFound(_0x590d05,null))[_0xce17('0x25')](function(_0x33b9e8){if(_0x33b9e8){_0x5ead02[_0xce17('0x4a')][_0xce17('0x58')]=_0x33b9e8['id'];return db[_0xce17('0x4e')]['create'](_0x5ead02[_0xce17('0x4a')]);}})['then'](respondWithResult(_0x590d05,null))['catch'](handleError(_0x590d05,null));};exports['getMessages']=function(_0x550ed6,_0x48575e,_0x2938b7){var _0xc77351={};var _0x97bd92={};var _0x184ea2;var _0x332896;return db[_0xce17('0x2d')]['findOne']({'where':{'id':_0x550ed6[_0xce17('0x44')]['id']}})[_0xce17('0x25')](handleEntityNotFound(_0x48575e,null))[_0xce17('0x25')](function(_0x1722e9){if(_0x1722e9){_0x184ea2=_0x1722e9;_0x97bd92[_0xce17('0x31')]=_['keys'](db[_0xce17('0x4e')]['rawAttributes']);_0x97bd92[_0xce17('0x33')]=_[_0xce17('0x34')](_0x550ed6[_0xce17('0x33')]);_0x97bd92[_0xce17('0x35')]=_[_0xce17('0x36')](_0x97bd92['model'],_0x97bd92[_0xce17('0x33')]);_0xc77351[_0xce17('0x37')]=_[_0xce17('0x36')](_0x97bd92[_0xce17('0x31')],qs[_0xce17('0x38')](_0x550ed6[_0xce17('0x33')][_0xce17('0x38')]));_0xc77351['attributes']=_0xc77351['attributes'][_0xce17('0x39')]?_0xc77351['attributes']:_0x97bd92[_0xce17('0x31')];_0xc77351[_0xce17('0x3b')]=qs[_0xce17('0x3c')](_0x550ed6[_0xce17('0x33')][_0xce17('0x3c')]);_0xc77351[_0xce17('0x3d')]=qs[_0xce17('0x35')](_[_0xce17('0x3e')](_0x550ed6[_0xce17('0x33')],_0x97bd92['filters']));if(_0x550ed6[_0xce17('0x33')][_0xce17('0x3f')]){_0xc77351[_0xce17('0x3d')]=_[_0xce17('0x47')](_0xc77351[_0xce17('0x3d')],{'$or':_[_0xce17('0x2c')](_0xc77351['attributes'],function(_0x14b147){var _0x55db8d={};_0x55db8d[_0x14b147]={'$like':'%'+_0x550ed6[_0xce17('0x33')][_0xce17('0x3f')]+'%'};return _0x55db8d;})});}if(_0x550ed6['query'][_0xce17('0x59')]){var _0x1b093f=_0x550ed6[_0xce17('0x33')]['$gte'][_0xce17('0x5a')](',');var _0x56d184={};_0x56d184[_0x1b093f[0x0]]={'$gte':moment(_0x1b093f[0x1])[_0xce17('0x5b')](_0xce17('0x5c'))};_0xc77351[_0xce17('0x3d')]=_[_0xce17('0x47')](_0xc77351['where'],_0x56d184);}_0xc77351=_[_0xce17('0x47')]({},_0xc77351,_0x550ed6[_0xce17('0x48')]);return _0x184ea2[_0xce17('0x5d')](_0xc77351);}})[_0xce17('0x25')](function(_0x5dd761){if(_0x5dd761){_0x332896=_0x5dd761['length'];if(!_0x550ed6['query'][_0xce17('0x3a')](_0xce17('0x56'))){_0xc77351[_0xce17('0x1f')]=qs[_0xce17('0x1f')](_0x550ed6[_0xce17('0x33')][_0xce17('0x1f')]);_0xc77351['offset']=qs[_0xce17('0x1c')](_0x550ed6[_0xce17('0x33')][_0xce17('0x1c')]);}return _0x184ea2['getMessages'](_0xc77351);}})[_0xce17('0x25')](function(_0x4668e4){if(_0x4668e4){return _0x4668e4?{'count':_0x332896,'rows':_0x4668e4}:null;}})[_0xce17('0x25')](respondWithResult(_0x48575e,null))[_0xce17('0x42')](handleError(_0x48575e,null));};
\ No newline at end of file
+var _0x886f=['length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','user','addMembers','omit','getMembers','findOne','User','removeMembers','ids','addMessage','ChatGroupId','getMessages','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields'];(function(_0x4051be,_0x4e30dc){var _0x10d8e5=function(_0x1ae1c2){while(--_0x1ae1c2){_0x4051be['push'](_0x4051be['shift']());}};_0x10d8e5(++_0x4e30dc);}(_0x886f,0x193));var _0xf886=function(_0x4ffdb3,_0x3bf41f){_0x4ffdb3=_0x4ffdb3-0x0;var _0x563cc8=_0x886f[_0x4ffdb3];return _0x563cc8;};'use strict';var emlformat=require(_0xf886('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf886('0x1'));var rp=require(_0xf886('0x2'));var moment=require('moment');var BPromise=require(_0xf886('0x3'));var Mustache=require(_0xf886('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf886('0x5'));var ejs=require(_0xf886('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf886('0x7'));var squel=require(_0xf886('0x8'));var crypto=require(_0xf886('0x9'));var jsforce=require(_0xf886('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf886('0x5'));var querystring=require('querystring');var Papa=require(_0xf886('0xb'));var Redis=require(_0xf886('0xc'));var authService=require(_0xf886('0xd'));var qs=require(_0xf886('0xe'));var as=require(_0xf886('0xf'));var hardwareService=require(_0xf886('0x10'));var logger=require(_0xf886('0x11'))(_0xf886('0x12'));var utils=require(_0xf886('0x13'));var config=require(_0xf886('0x14'));var licenseUtil=require(_0xf886('0x15'));var db=require(_0xf886('0x16'))['db'];config['redis']=_[_0xf886('0x17')](config[_0xf886('0x18')],{'host':_0xf886('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf886('0x1a'))[_0xf886('0x1b')](socket);function respondWithStatusCode(_0x1a9fbc,_0x2ac068){_0x2ac068=_0x2ac068||0xcc;return function(_0x1bb141){if(_0x1bb141){return _0x1a9fbc['sendStatus'](_0x2ac068);}return _0x1a9fbc[_0xf886('0x1c')](_0x2ac068)[_0xf886('0x1d')]();};}function respondWithResult(_0x9199ea,_0x6dcf26){_0x6dcf26=_0x6dcf26||0xc8;return function(_0x508887){if(_0x508887){return _0x9199ea[_0xf886('0x1c')](_0x6dcf26)[_0xf886('0x1e')](_0x508887);}};}function respondWithFilteredResult(_0x5a9a48,_0x1a3799){return function(_0x509ba1){if(_0x509ba1){var _0x3b2a4c=typeof _0x1a3799[_0xf886('0x1f')]===_0xf886('0x20')&&typeof _0x1a3799[_0xf886('0x21')]===_0xf886('0x20');var _0x537644=_0x509ba1[_0xf886('0x22')];var _0x40b3ee=_0x3b2a4c?0x0:_0x1a3799[_0xf886('0x1f')];var _0x9b4c74=_0x3b2a4c?_0x509ba1[_0xf886('0x22')]:_0x1a3799['offset']+_0x1a3799[_0xf886('0x21')];var _0x560d4d;if(_0x9b4c74>=_0x537644){_0x9b4c74=_0x537644;_0x560d4d=0xc8;}else{_0x560d4d=0xce;}_0x5a9a48[_0xf886('0x1c')](_0x560d4d);return _0x5a9a48[_0xf886('0x23')]('Content-Range',_0x40b3ee+'-'+_0x9b4c74+'/'+_0x537644)[_0xf886('0x1e')](_0x509ba1);}return null;};}function patchUpdates(_0x6f4101){return function(_0x588cbc){try{jsonpatch[_0xf886('0x24')](_0x588cbc,_0x6f4101,!![]);}catch(_0x27a610){return BPromise[_0xf886('0x25')](_0x27a610);}return _0x588cbc[_0xf886('0x26')]();};}function saveUpdates(_0x109f62,_0x5b0bec){return function(_0x1ec918){if(_0x1ec918){return _0x1ec918[_0xf886('0x27')](_0x109f62)[_0xf886('0x28')](function(_0x1433e9){return _0x1433e9;});}return null;};}function removeEntity(_0x44a83d,_0x4c5cda){return function(_0x3ded1b){if(_0x3ded1b){return _0x3ded1b['destroy']()[_0xf886('0x28')](function(){_0x44a83d[_0xf886('0x1c')](0xcc)[_0xf886('0x1d')]();});}};}function handleEntityNotFound(_0x3e1af7,_0x10eaf0){return function(_0x153663){if(!_0x153663){_0x3e1af7['sendStatus'](0x194);}return _0x153663;};}function handleError(_0x42c927,_0x172a36){_0x172a36=_0x172a36||0x1f4;return function(_0x4f4f67){logger[_0xf886('0x29')](_0x4f4f67[_0xf886('0x2a')]);if(_0x4f4f67[_0xf886('0x2b')]){delete _0x4f4f67[_0xf886('0x2b')];}_0x42c927['status'](_0x172a36)[_0xf886('0x2c')](_0x4f4f67);};}exports['index']=function(_0x449d5a,_0x2be5ce){var _0x1ad895={},_0x2247b8={},_0x559f06={'count':0x0,'rows':[]};var _0x1c1ac0=_[_0xf886('0x2d')](db[_0xf886('0x2e')][_0xf886('0x2f')],function(_0x11aa7f){return{'name':_0x11aa7f[_0xf886('0x30')],'type':_0x11aa7f[_0xf886('0x31')]['key']};});_0x2247b8['model']=_[_0xf886('0x2d')](_0x1c1ac0,_0xf886('0x2b'));_0x2247b8[_0xf886('0x32')]=_[_0xf886('0x33')](_0x449d5a['query']);_0x2247b8[_0xf886('0x34')]=_[_0xf886('0x35')](_0x2247b8[_0xf886('0x36')],_0x2247b8['query']);_0x1ad895[_0xf886('0x37')]=_['intersection'](_0x2247b8[_0xf886('0x36')],qs[_0xf886('0x38')](_0x449d5a[_0xf886('0x32')][_0xf886('0x38')]));_0x1ad895[_0xf886('0x37')]=_0x1ad895[_0xf886('0x37')][_0xf886('0x39')]?_0x1ad895['attributes']:_0x2247b8[_0xf886('0x36')];if(!_0x449d5a[_0xf886('0x32')][_0xf886('0x3a')](_0xf886('0x3b'))){_0x1ad895['limit']=qs[_0xf886('0x21')](_0x449d5a['query'][_0xf886('0x21')]);_0x1ad895[_0xf886('0x1f')]=qs['offset'](_0x449d5a[_0xf886('0x32')][_0xf886('0x1f')]);}_0x1ad895['order']=qs[_0xf886('0x3c')](_0x449d5a[_0xf886('0x32')][_0xf886('0x3c')]);_0x1ad895[_0xf886('0x3d')]=qs[_0xf886('0x34')](_['pick'](_0x449d5a[_0xf886('0x32')],_0x2247b8['filters']),_0x1c1ac0);if(_0x449d5a[_0xf886('0x32')][_0xf886('0x3e')]){_0x1ad895[_0xf886('0x3d')]=_[_0xf886('0x3f')](_0x1ad895[_0xf886('0x3d')],{'$or':_[_0xf886('0x2d')](_0x1c1ac0,function(_0xb18b84){if(_0xb18b84[_0xf886('0x31')]!==_0xf886('0x40')){var _0x2c23b8={};_0x2c23b8[_0xb18b84[_0xf886('0x2b')]]={'$like':'%'+_0x449d5a[_0xf886('0x32')][_0xf886('0x3e')]+'%'};return _0x2c23b8;}})});}_0x1ad895=_[_0xf886('0x3f')]({},_0x1ad895,_0x449d5a[_0xf886('0x41')]);var _0x37e7f2={'where':_0x1ad895[_0xf886('0x3d')]};return db[_0xf886('0x2e')][_0xf886('0x22')](_0x37e7f2)[_0xf886('0x28')](function(_0x27bdad){_0x559f06[_0xf886('0x22')]=_0x27bdad;if(_0x449d5a['query'][_0xf886('0x42')]){_0x1ad895[_0xf886('0x43')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x1ad895);})['then'](function(_0x176dff){_0x559f06[_0xf886('0x44')]=_0x176dff;return _0x559f06;})[_0xf886('0x28')](respondWithFilteredResult(_0x2be5ce,_0x1ad895))[_0xf886('0x45')](handleError(_0x2be5ce,null));};exports[_0xf886('0x46')]=function(_0x963815,_0x43f860){var _0x3505c8={'raw':!![],'where':{'id':_0x963815[_0xf886('0x47')]['id']}},_0x10496a={};_0x10496a['model']=_[_0xf886('0x33')](db[_0xf886('0x2e')][_0xf886('0x2f')]);_0x10496a['query']=_[_0xf886('0x33')](_0x963815['query']);_0x10496a[_0xf886('0x34')]=_[_0xf886('0x35')](_0x10496a[_0xf886('0x36')],_0x10496a[_0xf886('0x32')]);_0x3505c8['attributes']=_['intersection'](_0x10496a[_0xf886('0x36')],qs[_0xf886('0x38')](_0x963815['query'][_0xf886('0x38')]));_0x3505c8[_0xf886('0x37')]=_0x3505c8[_0xf886('0x37')][_0xf886('0x39')]?_0x3505c8[_0xf886('0x37')]:_0x10496a['model'];if(_0x963815[_0xf886('0x32')]['includeAll']){_0x3505c8['include']=[{'all':!![]}];}_0x3505c8=_[_0xf886('0x3f')]({},_0x3505c8,_0x963815[_0xf886('0x41')]);return db[_0xf886('0x2e')][_0xf886('0x48')](_0x3505c8)['then'](handleEntityNotFound(_0x43f860,null))['then'](respondWithResult(_0x43f860,null))[_0xf886('0x45')](handleError(_0x43f860,null));};exports[_0xf886('0x49')]=function(_0x479c8c,_0x186605){return db[_0xf886('0x2e')][_0xf886('0x49')](_0x479c8c[_0xf886('0x4a')],{})[_0xf886('0x28')](respondWithResult(_0x186605,0xc9))[_0xf886('0x45')](handleError(_0x186605,null));};exports[_0xf886('0x27')]=function(_0x5f5cb1,_0x552f3c){if(_0x5f5cb1[_0xf886('0x4a')]['id']){delete _0x5f5cb1[_0xf886('0x4a')]['id'];}return db[_0xf886('0x2e')][_0xf886('0x48')]({'where':{'id':_0x5f5cb1['params']['id']}})[_0xf886('0x28')](handleEntityNotFound(_0x552f3c,null))[_0xf886('0x28')](saveUpdates(_0x5f5cb1['body'],null))[_0xf886('0x28')](respondWithResult(_0x552f3c,null))[_0xf886('0x45')](handleError(_0x552f3c,null));};exports['destroy']=function(_0x4e038f,_0x1004e7){return db['ChatGroup'][_0xf886('0x48')]({'where':{'id':_0x4e038f[_0xf886('0x47')]['id']}})[_0xf886('0x28')](handleEntityNotFound(_0x1004e7,null))[_0xf886('0x28')](removeEntity(_0x1004e7,null))[_0xf886('0x45')](handleError(_0x1004e7,null));};exports[_0xf886('0x4b')]=function(_0x151348,_0x2bb0ed){return db[_0xf886('0x2e')][_0xf886('0x4b')]()[_0xf886('0x28')](respondWithResult(_0x2bb0ed,null))[_0xf886('0x45')](handleError(_0x2bb0ed,null));};exports['getUnread']=function(_0x1136be,_0x5802bd,_0x3d7b54){return db['ChatInternalMessage'][_0xf886('0x22')]({'where':{'ChatGroupId':_0x1136be['params']['id'],'ToId':_0x1136be[_0xf886('0x4c')]['id'],'read':![]}})[_0xf886('0x28')](function(_0x4194df){return{'id':_['toInteger'](_0x1136be['params']['id']),'count':_0x4194df};})['then'](respondWithResult(_0x5802bd,null))[_0xf886('0x45')](handleError(_0x5802bd,null));};exports[_0xf886('0x4d')]=function(_0x45b577,_0x3c5498,_0x3e255b){return db['ChatGroup'][_0xf886('0x48')]({'where':{'id':_0x45b577['params']['id']}})['then'](handleEntityNotFound(_0x3c5498,null))['then'](function(_0x4e9fcf){if(_0x4e9fcf){return _0x4e9fcf[_0xf886('0x4d')](_0x45b577[_0xf886('0x4a')]['ids'],_[_0xf886('0x4e')](_0x45b577[_0xf886('0x4a')],['ids','id'])||{});}})[_0xf886('0x28')](respondWithResult(_0x3c5498,null))['catch'](handleError(_0x3c5498,null));};exports[_0xf886('0x4f')]=function(_0x4948f0,_0x2d806c,_0x4df567){var _0x200566={};var _0x2d2c0f={};var _0x130268;var _0x1d34c7;return db[_0xf886('0x2e')][_0xf886('0x50')]({'where':{'id':_0x4948f0[_0xf886('0x47')]['id']}})[_0xf886('0x28')](handleEntityNotFound(_0x2d806c,null))[_0xf886('0x28')](function(_0x2649b7){if(_0x2649b7){_0x130268=_0x2649b7;_0x2d2c0f[_0xf886('0x36')]=_[_0xf886('0x33')](db[_0xf886('0x51')][_0xf886('0x2f')]);_0x2d2c0f[_0xf886('0x32')]=_[_0xf886('0x33')](_0x4948f0[_0xf886('0x32')]);_0x2d2c0f[_0xf886('0x34')]=_['intersection'](_0x2d2c0f[_0xf886('0x36')],_0x2d2c0f[_0xf886('0x32')]);_0x200566[_0xf886('0x37')]=_[_0xf886('0x35')](_0x2d2c0f[_0xf886('0x36')],qs['fields'](_0x4948f0[_0xf886('0x32')][_0xf886('0x38')]));_0x200566[_0xf886('0x37')]=_0x200566[_0xf886('0x37')][_0xf886('0x39')]?_0x200566['attributes']:_0x2d2c0f[_0xf886('0x36')];_0x200566['order']=qs[_0xf886('0x3c')](_0x4948f0[_0xf886('0x32')][_0xf886('0x3c')]);_0x200566[_0xf886('0x3d')]=qs[_0xf886('0x34')](_['pick'](_0x4948f0[_0xf886('0x32')],_0x2d2c0f[_0xf886('0x34')]));if(_0x4948f0[_0xf886('0x32')]['filter']){_0x200566[_0xf886('0x3d')]=_[_0xf886('0x3f')](_0x200566[_0xf886('0x3d')],{'$or':_[_0xf886('0x2d')](_0x200566[_0xf886('0x37')],function(_0x347ddb){var _0x513f75={};_0x513f75[_0x347ddb]={'$like':'%'+_0x4948f0[_0xf886('0x32')][_0xf886('0x3e')]+'%'};return _0x513f75;})});}_0x200566=_['merge']({},_0x200566,_0x4948f0[_0xf886('0x41')]);return _0x130268[_0xf886('0x4f')](_0x200566);}})['then'](function(_0x366293){if(_0x366293){_0x1d34c7=_0x366293[_0xf886('0x39')];if(!_0x4948f0['query']['hasOwnProperty'](_0xf886('0x3b'))){_0x200566[_0xf886('0x21')]=qs[_0xf886('0x21')](_0x4948f0[_0xf886('0x32')]['limit']);_0x200566[_0xf886('0x1f')]=qs[_0xf886('0x1f')](_0x4948f0[_0xf886('0x32')][_0xf886('0x1f')]);}return _0x130268[_0xf886('0x4f')](_0x200566);}})[_0xf886('0x28')](function(_0x35c90a){if(_0x35c90a){return _0x35c90a?{'count':_0x1d34c7,'rows':_0x35c90a}:null;}})[_0xf886('0x28')](respondWithResult(_0x2d806c,null))[_0xf886('0x45')](handleError(_0x2d806c,null));};exports[_0xf886('0x52')]=function(_0x348547,_0x2720e2,_0x250b5d){return db[_0xf886('0x2e')]['find']({'where':{'id':_0x348547[_0xf886('0x47')]['id']}})[_0xf886('0x28')](handleEntityNotFound(_0x2720e2,null))['then'](function(_0xe46de1){if(_0xe46de1){return _0xe46de1[_0xf886('0x52')](_0x348547[_0xf886('0x32')][_0xf886('0x53')]);}})['then'](respondWithStatusCode(_0x2720e2,null))[_0xf886('0x45')](handleError(_0x2720e2,null));};exports[_0xf886('0x54')]=function(_0x3c2db1,_0x1a8328,_0x46d89e){if(_0x3c2db1[_0xf886('0x4a')]['id']){delete _0x3c2db1[_0xf886('0x4a')]['id'];}return db[_0xf886('0x2e')][_0xf886('0x48')]({'where':{'id':_0x3c2db1[_0xf886('0x47')]['id']}})[_0xf886('0x28')](handleEntityNotFound(_0x1a8328,null))[_0xf886('0x28')](function(_0x3ec83f){if(_0x3ec83f){_0x3c2db1['body'][_0xf886('0x55')]=_0x3ec83f['id'];return db['ChatInternalMessage'][_0xf886('0x49')](_0x3c2db1[_0xf886('0x4a')]);}})[_0xf886('0x28')](respondWithResult(_0x1a8328,null))[_0xf886('0x45')](handleError(_0x1a8328,null));};exports[_0xf886('0x56')]=function(_0x3fbc9a,_0x1193e5,_0x4f0f6e){var _0x358eb1={};var _0x2e265e={};var _0x516ff0;var _0x25876e;return db['ChatGroup'][_0xf886('0x50')]({'where':{'id':_0x3fbc9a[_0xf886('0x47')]['id']}})[_0xf886('0x28')](handleEntityNotFound(_0x1193e5,null))[_0xf886('0x28')](function(_0x388b0d){if(_0x388b0d){_0x516ff0=_0x388b0d;_0x2e265e[_0xf886('0x36')]=_[_0xf886('0x33')](db['ChatInternalMessage']['rawAttributes']);_0x2e265e['query']=_['keys'](_0x3fbc9a['query']);_0x2e265e[_0xf886('0x34')]=_[_0xf886('0x35')](_0x2e265e[_0xf886('0x36')],_0x2e265e[_0xf886('0x32')]);_0x358eb1[_0xf886('0x37')]=_['intersection'](_0x2e265e['model'],qs[_0xf886('0x38')](_0x3fbc9a[_0xf886('0x32')][_0xf886('0x38')]));_0x358eb1[_0xf886('0x37')]=_0x358eb1[_0xf886('0x37')]['length']?_0x358eb1[_0xf886('0x37')]:_0x2e265e[_0xf886('0x36')];_0x358eb1[_0xf886('0x57')]=qs[_0xf886('0x3c')](_0x3fbc9a[_0xf886('0x32')]['sort']);_0x358eb1['where']=qs[_0xf886('0x34')](_['pick'](_0x3fbc9a[_0xf886('0x32')],_0x2e265e[_0xf886('0x34')]));if(_0x3fbc9a['query']['filter']){_0x358eb1['where']=_[_0xf886('0x3f')](_0x358eb1[_0xf886('0x3d')],{'$or':_['map'](_0x358eb1['attributes'],function(_0x27a5f1){var _0x6c1cc8={};_0x6c1cc8[_0x27a5f1]={'$like':'%'+_0x3fbc9a[_0xf886('0x32')][_0xf886('0x3e')]+'%'};return _0x6c1cc8;})});}if(_0x3fbc9a[_0xf886('0x32')][_0xf886('0x58')]){var _0x44204e=_0x3fbc9a[_0xf886('0x32')][_0xf886('0x58')][_0xf886('0x59')](',');var _0x3167e6={};_0x3167e6[_0x44204e[0x0]]={'$gte':moment(_0x44204e[0x1])[_0xf886('0x5a')](_0xf886('0x5b'))};_0x358eb1[_0xf886('0x3d')]=_[_0xf886('0x3f')](_0x358eb1[_0xf886('0x3d')],_0x3167e6);}_0x358eb1=_[_0xf886('0x3f')]({},_0x358eb1,_0x3fbc9a[_0xf886('0x41')]);return _0x516ff0[_0xf886('0x56')](_0x358eb1);}})['then'](function(_0x4daece){if(_0x4daece){_0x25876e=_0x4daece[_0xf886('0x39')];if(!_0x3fbc9a[_0xf886('0x32')]['hasOwnProperty'](_0xf886('0x3b'))){_0x358eb1[_0xf886('0x21')]=qs[_0xf886('0x21')](_0x3fbc9a[_0xf886('0x32')]['limit']);_0x358eb1[_0xf886('0x1f')]=qs[_0xf886('0x1f')](_0x3fbc9a['query'][_0xf886('0x1f')]);}return _0x516ff0['getMessages'](_0x358eb1);}})[_0xf886('0x28')](function(_0x38f72d){if(_0x38f72d){return _0x38f72d?{'count':_0x25876e,'rows':_0x38f72d}:null;}})[_0xf886('0x28')](respondWithResult(_0x1193e5,null))[_0xf886('0x45')](handleError(_0x1193e5,null));};
\ No newline at end of file
index c8ce3a6..5ce5534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3411=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x16d680,_0x2e5937){var _0xdd9969=function(_0x330b2f){while(--_0x330b2f){_0x16d680['push'](_0x16d680['shift']());}};_0xdd9969(++_0x2e5937);}(_0x3411,0x105));var _0x1341=function(_0x1e6e3f,_0x41a3f3){_0x1e6e3f=_0x1e6e3f-0x0;var _0x4b72f9=_0x3411[_0x1e6e3f];return _0x4b72f9;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x1341('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x1341('0x1')](0x0);var events={'afterCreate':_0x1341('0x2'),'afterUpdate':_0x1341('0x3'),'afterDestroy':_0x1341('0x4')};function emitEvent(_0x2d327f){return function(_0xef6224,_0x538672,_0x23b08a){ChatGroupEvents['emit'](_0x2d327f+':'+_0xef6224['id'],_0xef6224);ChatGroupEvents[_0x1341('0x5')](_0x2d327f,_0xef6224);_0x23b08a(null);};}for(var e in events){if(events[_0x1341('0x6')](e)){var event=events[e];ChatGroup[_0x1341('0x7')](e,emitEvent(event));}}module[_0x1341('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xb04a=['remove','emit','exports','events','ChatGroup','setMaxListeners','save','update'];(function(_0x3abdf9,_0x4da677){var _0x48270=function(_0x8c1a6f){while(--_0x8c1a6f){_0x3abdf9['push'](_0x3abdf9['shift']());}};_0x48270(++_0x4da677);}(_0xb04a,0xbb));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xab04('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xab04('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xab04('0x2')](0x0);var events={'afterCreate':_0xab04('0x3'),'afterUpdate':_0xab04('0x4'),'afterDestroy':_0xab04('0x5')};function emitEvent(_0x535db0){return function(_0x47ef96,_0x211bbe,_0x14f3e8){ChatGroupEvents[_0xab04('0x6')](_0x535db0+':'+_0x47ef96['id'],_0x47ef96);ChatGroupEvents['emit'](_0x535db0,_0x47ef96);_0x14f3e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xab04('0x7')]=ChatGroupEvents;
\ No newline at end of file
index d05cea9..d91d326 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa286=['../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0xa286,0xf3));var _0x6a28=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xa286[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x6a28('0x0'));var util=require(_0x6a28('0x1'));var logger=require(_0x6a28('0x2'))(_0x6a28('0x3'));var moment=require(_0x6a28('0x4'));var BPromise=require(_0x6a28('0x5'));var rp=require(_0x6a28('0x6'));var fs=require('fs');var path=require(_0x6a28('0x7'));var rimraf=require(_0x6a28('0x8'));var config=require(_0x6a28('0x9'));var attributes=require('./chatGroup.attributes');module[_0x6a28('0xa')]=function(_0x47f6f1,_0x900515){return _0x47f6f1[_0x6a28('0xb')](_0x6a28('0xc'),attributes,{'tableName':_0x6a28('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x97d7=['api','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x2ae402,_0x59f27b){var _0x3e0430=function(_0xccaf5b){while(--_0xccaf5b){_0x2ae402['push'](_0x2ae402['shift']());}};_0x3e0430(++_0x59f27b);}(_0x97d7,0xa6));var _0x797d=function(_0x24e7d3,_0x46f920){_0x24e7d3=_0x24e7d3-0x0;var _0x3db220=_0x97d7[_0x24e7d3];return _0x3db220;};'use strict';var _=require(_0x797d('0x0'));var util=require(_0x797d('0x1'));var logger=require(_0x797d('0x2'))(_0x797d('0x3'));var moment=require('moment');var BPromise=require(_0x797d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x797d('0x5'));var rimraf=require(_0x797d('0x6'));var config=require(_0x797d('0x7'));var attributes=require(_0x797d('0x8'));module[_0x797d('0x9')]=function(_0x294c63,_0x2cc4d4){return _0x294c63[_0x797d('0xa')](_0x797d('0xb'),attributes,{'tableName':_0x797d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a9a3ff..77ea460 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb82=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x955658,_0x41c39c){var _0x551dba=function(_0x28c96f){while(--_0x28c96f){_0x955658['push'](_0x955658['shift']());}};_0x551dba(++_0x41c39c);}(_0xfb82,0x17f));var _0x2fb8=function(_0x8cd79d,_0x311f86){_0x8cd79d=_0x8cd79d-0x0;var _0x52eba4=_0xfb82[_0x8cd79d];return _0x52eba4;};'use strict';var _=require(_0x2fb8('0x0'));var util=require(_0x2fb8('0x1'));var moment=require(_0x2fb8('0x2'));var BPromise=require('bluebird');var rs=require(_0x2fb8('0x3'));var fs=require('fs');var Redis=require(_0x2fb8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2fb8('0x5'));var logger=require(_0x2fb8('0x6'))(_0x2fb8('0x7'));var config=require(_0x2fb8('0x8'));var jayson=require(_0x2fb8('0x9'));var client=jayson[_0x2fb8('0xa')][_0x2fb8('0xb')]({'port':0x232a});config[_0x2fb8('0xc')]=_[_0x2fb8('0xd')](config[_0x2fb8('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2fb8('0xe'))(new Redis(config[_0x2fb8('0xc')]));require(_0x2fb8('0xf'))[_0x2fb8('0x10')](socket);function respondWithRpcPromise(_0x3f1637,_0x22824a,_0x207a10){return new BPromise(function(_0x2928ef,_0x154d92){return client[_0x2fb8('0x11')](_0x3f1637,_0x207a10)[_0x2fb8('0x12')](function(_0x55bcfc){logger[_0x2fb8('0x13')](_0x2fb8('0x14'),_0x22824a,_0x2fb8('0x15'));logger[_0x2fb8('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x22824a,'request\x20sent',JSON[_0x2fb8('0x17')](_0x55bcfc));if(_0x55bcfc['error']){if(_0x55bcfc[_0x2fb8('0x18')][_0x2fb8('0x19')]===0x1f4){logger['error'](_0x2fb8('0x14'),_0x22824a,_0x55bcfc[_0x2fb8('0x18')]['message']);return _0x154d92(_0x55bcfc['error'][_0x2fb8('0x1a')]);}logger[_0x2fb8('0x18')](_0x2fb8('0x14'),_0x22824a,_0x55bcfc[_0x2fb8('0x18')]['message']);return _0x2928ef(_0x55bcfc[_0x2fb8('0x18')][_0x2fb8('0x1a')]);}else{logger['info'](_0x2fb8('0x14'),_0x22824a,_0x2fb8('0x15'));_0x2928ef(_0x55bcfc[_0x2fb8('0x1b')]['message']);}})['catch'](function(_0x1bee80){logger[_0x2fb8('0x18')](_0x2fb8('0x14'),_0x22824a,_0x1bee80);_0x154d92(_0x1bee80);});});}
\ No newline at end of file
+var _0x83f1=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x5f3562,_0x212f41){var _0x1b39b4=function(_0x153e49){while(--_0x153e49){_0x5f3562['push'](_0x5f3562['shift']());}};_0x1b39b4(++_0x212f41);}(_0x83f1,0x1cc));var _0x183f=function(_0x3affe3,_0x1fdbb1){_0x3affe3=_0x3affe3-0x0;var _0x55a7fb=_0x83f1[_0x3affe3];return _0x55a7fb;};'use strict';var _=require(_0x183f('0x0'));var util=require(_0x183f('0x1'));var moment=require(_0x183f('0x2'));var BPromise=require(_0x183f('0x3'));var rs=require(_0x183f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x183f('0x5'));var logger=require(_0x183f('0x6'))(_0x183f('0x7'));var config=require(_0x183f('0x8'));var jayson=require(_0x183f('0x9'));var client=jayson['client'][_0x183f('0xa')]({'port':0x232a});config[_0x183f('0xb')]=_[_0x183f('0xc')](config['redis'],{'host':_0x183f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x183f('0xb')]));require(_0x183f('0xe'))[_0x183f('0xf')](socket);function respondWithRpcPromise(_0x30f091,_0x22bcd6,_0x1848a6){return new BPromise(function(_0x333813,_0x5cc7bf){return client[_0x183f('0x10')](_0x30f091,_0x1848a6)[_0x183f('0x11')](function(_0x3a99ee){logger[_0x183f('0x12')](_0x183f('0x13'),_0x22bcd6,_0x183f('0x14'));logger[_0x183f('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x22bcd6,_0x183f('0x14'),JSON['stringify'](_0x3a99ee));if(_0x3a99ee['error']){if(_0x3a99ee[_0x183f('0x16')][_0x183f('0x17')]===0x1f4){logger[_0x183f('0x16')](_0x183f('0x13'),_0x22bcd6,_0x3a99ee[_0x183f('0x16')]['message']);return _0x5cc7bf(_0x3a99ee[_0x183f('0x16')]['message']);}logger[_0x183f('0x16')](_0x183f('0x13'),_0x22bcd6,_0x3a99ee[_0x183f('0x16')]['message']);return _0x333813(_0x3a99ee[_0x183f('0x16')][_0x183f('0x18')]);}else{logger[_0x183f('0x12')]('ChatGroup,\x20%s,\x20%s',_0x22bcd6,_0x183f('0x14'));_0x333813(_0x3a99ee[_0x183f('0x19')][_0x183f('0x18')]);}})[_0x183f('0x1a')](function(_0x2c7188){logger[_0x183f('0x16')]('ChatGroup,\x20%s,\x20%s',_0x22bcd6,_0x2c7188);_0x5cc7bf(_0x2c7188);});});}
\ No newline at end of file
index ddcd6c7..b6119c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57e5=['emit','removeListener','length','./chatGroup.events','save','remove','update'];(function(_0x4dfc30,_0x2f8ea3){var _0x4cabbe=function(_0xe9957c){while(--_0xe9957c){_0x4dfc30['push'](_0x4dfc30['shift']());}};_0x4cabbe(++_0x2f8ea3);}(_0x57e5,0xff));var _0x557e=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x57e5[_0x2ec461];return _0x28603d;};'use strict';var ChatGroupEvents=require(_0x557e('0x0'));var events=[_0x557e('0x1'),_0x557e('0x2'),_0x557e('0x3')];function createListener(_0x2e5c05,_0x2dddc8){return function(_0x1aef4d){_0x2dddc8[_0x557e('0x4')](_0x2e5c05,_0x1aef4d);};}function removeListener(_0x5d7f3a,_0x56b6ff){return function(){ChatGroupEvents[_0x557e('0x5')](_0x5d7f3a,_0x56b6ff);};}exports['register']=function(_0x54cd81){for(var _0x493913=0x0,_0x48e3b0=events[_0x557e('0x6')];_0x493913<_0x48e3b0;_0x493913++){var _0x326331=events[_0x493913];var _0x4db310=createListener('chatGroup:'+_0x326331,_0x54cd81);ChatGroupEvents['on'](_0x326331,_0x4db310);}};
\ No newline at end of file
+var _0xc811=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x32a993,_0x513490){var _0x150c79=function(_0x3eb4ac){while(--_0x3eb4ac){_0x32a993['push'](_0x32a993['shift']());}};_0x150c79(++_0x513490);}(_0xc811,0x1a2));var _0x1c81=function(_0x3d0a47,_0x582dfa){_0x3d0a47=_0x3d0a47-0x0;var _0x17e145=_0xc811[_0x3d0a47];return _0x17e145;};'use strict';var ChatGroupEvents=require(_0x1c81('0x0'));var events=[_0x1c81('0x1'),_0x1c81('0x2'),_0x1c81('0x3')];function createListener(_0x2844f,_0x11771a){return function(_0x3b9783){_0x11771a[_0x1c81('0x4')](_0x2844f,_0x3b9783);};}function removeListener(_0x364f53,_0x4102d4){return function(){ChatGroupEvents[_0x1c81('0x5')](_0x364f53,_0x4102d4);};}exports[_0x1c81('0x6')]=function(_0x3556d0){for(var _0x5903ec=0x0,_0x5cf76d=events[_0x1c81('0x7')];_0x5903ec<_0x5cf76d;_0x5903ec++){var _0x54e2ef=events[_0x5903ec];var _0x555c78=createListener(_0x1c81('0x8')+_0x54e2ef,_0x3556d0);ChatGroupEvents['on'](_0x54e2ef,_0x555c78);}};
\ No newline at end of file
index 1dee315..f696eb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38a8=['Router','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','destroy','delete','removeMembers','exports','multer','util','connect-timeout'];(function(_0x25234d,_0x536088){var _0x184afd=function(_0x57e00b){while(--_0x57e00b){_0x25234d['push'](_0x25234d['shift']());}};_0x184afd(++_0x536088);}(_0x38a8,0xba));var _0x838a=function(_0x1529a3,_0x529f63){_0x1529a3=_0x1529a3-0x0;var _0x1a0d4b=_0x38a8[_0x1529a3];return _0x1a0d4b;};'use strict';var multer=require(_0x838a('0x0'));var util=require(_0x838a('0x1'));var path=require('path');var timeout=require(_0x838a('0x2'));var express=require('express');var router=express[_0x838a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x838a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x838a('0x5'));var controller=require(_0x838a('0x6'));router['get']('/',auth[_0x838a('0x7')](),controller[_0x838a('0x8')]);router[_0x838a('0x9')](_0x838a('0xa'),auth[_0x838a('0x7')](),controller[_0x838a('0xb')]);router[_0x838a('0x9')](_0x838a('0xc'),auth[_0x838a('0x7')](),controller['show']);router['get'](_0x838a('0xd'),auth[_0x838a('0x7')](),controller[_0x838a('0xe')]);router[_0x838a('0x9')](_0x838a('0xf'),auth[_0x838a('0x7')](),controller['getMembers']);router[_0x838a('0x9')](_0x838a('0x10'),auth['isAuthenticated'](),controller[_0x838a('0x11')]);router[_0x838a('0x12')]('/',auth[_0x838a('0x7')](),controller[_0x838a('0x13')]);router[_0x838a('0x12')](_0x838a('0xf'),auth[_0x838a('0x7')](),controller[_0x838a('0x14')]);router['post']('/:id/messages',auth[_0x838a('0x7')](),controller[_0x838a('0x15')]);router[_0x838a('0x16')](_0x838a('0xc'),auth[_0x838a('0x7')](),controller['update']);router['delete'](_0x838a('0xc'),auth[_0x838a('0x7')](),controller[_0x838a('0x17')]);router[_0x838a('0x18')]('/:id/members',auth['isAuthenticated'](),controller[_0x838a('0x19')]);module[_0x838a('0x1a')]=router;
\ No newline at end of file
+var _0x14f8=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','show','/:id/unread','getMembers','/:id/messages','post','/:id/members','addMembers','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0xc0e3bd,_0x176a95){var _0x3caca0=function(_0x312de5){while(--_0x312de5){_0xc0e3bd['push'](_0xc0e3bd['shift']());}};_0x3caca0(++_0x176a95);}(_0x14f8,0xf7));var _0x814f=function(_0x674fff,_0x3fcfa8){_0x674fff=_0x674fff-0x0;var _0x49a365=_0x14f8[_0x674fff];return _0x49a365;};'use strict';var multer=require(_0x814f('0x0'));var util=require(_0x814f('0x1'));var path=require(_0x814f('0x2'));var timeout=require(_0x814f('0x3'));var express=require(_0x814f('0x4'));var router=express[_0x814f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x814f('0x6'));var interaction=require(_0x814f('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router['get']('/',auth[_0x814f('0x8')](),controller[_0x814f('0x9')]);router[_0x814f('0xa')](_0x814f('0xb'),auth[_0x814f('0x8')](),controller['describe']);router[_0x814f('0xa')]('/:id',auth[_0x814f('0x8')](),controller[_0x814f('0xc')]);router[_0x814f('0xa')](_0x814f('0xd'),auth[_0x814f('0x8')](),controller['getUnread']);router[_0x814f('0xa')]('/:id/members',auth[_0x814f('0x8')](),controller[_0x814f('0xe')]);router[_0x814f('0xa')](_0x814f('0xf'),auth[_0x814f('0x8')](),controller['getMessages']);router['post']('/',auth[_0x814f('0x8')](),controller['create']);router[_0x814f('0x10')](_0x814f('0x11'),auth[_0x814f('0x8')](),controller[_0x814f('0x12')]);router[_0x814f('0x10')](_0x814f('0xf'),auth['isAuthenticated'](),controller['addMessage']);router[_0x814f('0x13')](_0x814f('0x14'),auth['isAuthenticated'](),controller[_0x814f('0x15')]);router[_0x814f('0x16')](_0x814f('0x14'),auth[_0x814f('0x8')](),controller['destroy']);router[_0x814f('0x16')](_0x814f('0x11'),auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
index 93eaa30..92c3f39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x823c=['STRING','DATE','long','out','sequelize','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x823c,0x143));var _0xc823=function(_0x1d8f8f,_0xf1b4f6){_0x1d8f8f=_0x1d8f8f-0x0;var _0x427086=_0x823c[_0x1d8f8f];return _0x427086;};'use strict';var Sequelize=require(_0xc823('0x0'));module['exports']={'closed':{'type':Sequelize[_0xc823('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc823('0x2')]},'ratingType':{'type':Sequelize[_0xc823('0x3')](_0xc823('0x4'),_0xc823('0x5')),'defaultValue':_0xc823('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xc823('0x6')]},'mailTranscript':{'type':Sequelize[_0xc823('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc823('0x8')]},'disposition':{'type':Sequelize[_0xc823('0x7')]},'secondDisposition':{'type':Sequelize[_0xc823('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc823('0x7')]},'browserName':{'type':Sequelize[_0xc823('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xc823('0x7')]},'deviceModel':{'type':Sequelize[_0xc823('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xc823('0x7')]},'referer':{'type':Sequelize[_0xc823('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xc823('0x9'))},'read1stAt':{'type':Sequelize[_0xc823('0x8')]},'lastMsgAt':{'type':Sequelize[_0xc823('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xc823('0x3')]('in',_0xc823('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xc823('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xc823('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xc823('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb10b=['out','sequelize','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','STRING','DATE','long'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xb10b,0x12a));var _0xbb10=function(_0x37644a,_0x1a223a){_0x37644a=_0x37644a-0x0;var _0x48c516=_0xb10b[_0x37644a];return _0x48c516;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'closed':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xbb10('0x2')]},'ratingType':{'type':Sequelize[_0xbb10('0x3')]('star',_0xbb10('0x4')),'defaultValue':_0xbb10('0x5')},'ratingMessage':{'type':Sequelize[_0xbb10('0x6')]},'pathTranscript':{'type':Sequelize[_0xbb10('0x6')]},'mailTranscript':{'type':Sequelize[_0xbb10('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xbb10('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xbb10('0x7')]},'thirdDisposition':{'type':Sequelize[_0xbb10('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xbb10('0x7')]},'browserVersion':{'type':Sequelize[_0xbb10('0x7')]},'osName':{'type':Sequelize[_0xbb10('0x7')]},'osVersion':{'type':Sequelize[_0xbb10('0x7')]},'deviceModel':{'type':Sequelize[_0xbb10('0x7')]},'deviceVendor':{'type':Sequelize[_0xbb10('0x7')]},'deviceType':{'type':Sequelize[_0xbb10('0x7')]},'referer':{'type':Sequelize[_0xbb10('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xbb10('0x9'))},'read1stAt':{'type':Sequelize[_0xbb10('0x8')]},'lastMsgAt':{'type':Sequelize[_0xbb10('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb10('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xbb10('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xbb10('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':![]}};
\ No newline at end of file
index f3f9eb5..309decc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x087b=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','render','body','contact','agent','interaction','Users','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','show','params','rawAttributes','include','options','catch','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','disposition','file','filename','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','nolimit','filter','findAll','rows','getMyMessages','includeAll','addTags','setTags','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','firstName','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','out','lastName','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','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','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x2561e3,_0x54bfae){var _0x6da30=function(_0x3de592){while(--_0x3de592){_0x2561e3['push'](_0x2561e3['shift']());}};_0x6da30(++_0x54bfae);}(_0x087b,0x11a));var _0xb087=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x087b[_0x62c958];return _0x57ec61;};'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 pdf=require(_0xb087('0x15'));var hardwareService=require(_0xb087('0x16'));var logger=require(_0xb087('0x17'))(_0xb087('0x18'));var utils=require(_0xb087('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb087('0x1a'));var db=require(_0xb087('0x1b'))['db'];config[_0xb087('0x1c')]=_['defaults'](config[_0xb087('0x1c')],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1c')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);var jayson=require(_0xb087('0x21'));var client=jayson[_0xb087('0x22')][_0xb087('0x23')]({'port':0x232b});var client9004=jayson[_0xb087('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x43e576,_0x412b48,_0x597478,_0xcc4426){return new BPromise(function(_0x2b83b7,_0x2e9e74){var _0x5bb80b=_0xcc4426||client;return _0x5bb80b[_0xb087('0x24')](_0x43e576,_0x597478)[_0xb087('0x25')](function(_0x17200d){logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));logger[_0xb087('0x28')](_0xb087('0x29'),_0x412b48,_0xb087('0x27'),JSON['stringify'](_0x17200d));if(_0x17200d['error']){if(_0x17200d['error']['code']===0x1f4){logger[_0xb087('0x2a')](_0xb087('0x2b'),_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2e9e74(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}logger[_0xb087('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2b83b7(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}else{logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));_0x2b83b7(_0x17200d[_0xb087('0x2d')]['message']);}})['catch'](function(_0x50745a){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x50745a);_0x2e9e74(_0x50745a);});});}function respondWithStatusCode(_0x304840,_0x45685d){_0x45685d=_0x45685d||0xcc;return function(_0x1d124f){if(_0x1d124f){return _0x304840[_0xb087('0x2e')](_0x45685d);}return _0x304840[_0xb087('0x2f')](_0x45685d)[_0xb087('0x30')]();};}function respondWithResult(_0xf3f41f,_0x35a52c){_0x35a52c=_0x35a52c||0xc8;return function(_0x6cfb22){if(_0x6cfb22){return _0xf3f41f[_0xb087('0x2f')](_0x35a52c)[_0xb087('0x31')](_0x6cfb22);}};}function respondWithFilteredResult(_0x31e3e6,_0xb0baf6){return function(_0x263259){if(_0x263259){var _0x593b78=typeof _0xb0baf6[_0xb087('0x32')]===_0xb087('0x33')&&typeof _0xb0baf6[_0xb087('0x34')]===_0xb087('0x33');var _0x22d441=_0x263259[_0xb087('0x35')];var _0x2e1c57=_0x593b78?0x0:_0xb0baf6[_0xb087('0x32')];var _0x53a535=_0x593b78?_0x263259['count']:_0xb0baf6[_0xb087('0x32')]+_0xb0baf6[_0xb087('0x34')];var _0x4cb5a8;if(_0x53a535>=_0x22d441){_0x53a535=_0x22d441;_0x4cb5a8=0xc8;}else{_0x4cb5a8=0xce;}_0x31e3e6[_0xb087('0x2f')](_0x4cb5a8);return _0x31e3e6[_0xb087('0x36')](_0xb087('0x37'),_0x2e1c57+'-'+_0x53a535+'/'+_0x22d441)[_0xb087('0x31')](_0x263259);}return null;};}function patchUpdates(_0x3c61c4){return function(_0x427905){try{jsonpatch[_0xb087('0x38')](_0x427905,_0x3c61c4,!![]);}catch(_0x3b7ace){return BPromise[_0xb087('0x39')](_0x3b7ace);}return _0x427905[_0xb087('0x3a')]();};}function saveUpdates(_0x442a5e,_0x3069b5){return function(_0x57ae94){if(_0x57ae94){return _0x57ae94[_0xb087('0x3b')](_0x442a5e)['then'](function(_0x906987){return _0x906987;});}return null;};}function removeEntity(_0x296e9b,_0x738e68){return function(_0xd0659e){if(_0xd0659e){return _0xd0659e[_0xb087('0x3c')]()[_0xb087('0x25')](function(){_0x296e9b[_0xb087('0x2f')](0xcc)[_0xb087('0x30')]();});}};}function handleEntityNotFound(_0x8a4c3c,_0x521c3f){return function(_0x5814c2){if(!_0x5814c2){_0x8a4c3c[_0xb087('0x2e')](0x194);}return _0x5814c2;};}function handleError(_0x3c4f33,_0x1ce1ef){_0x1ce1ef=_0x1ce1ef||0x1f4;return function(_0x2d2902){logger[_0xb087('0x2a')](_0x2d2902['stack']);if(_0x2d2902[_0xb087('0x3d')]){delete _0x2d2902[_0xb087('0x3d')];}_0x3c4f33['status'](_0x1ce1ef)['send'](_0x2d2902);};}function getMustacheRender(_0x1726c2,_0x1c7d90){return Mustache[_0xb087('0x3e')](_0x1726c2,_['merge'](_0x1c7d90[_0xb087('0x3f')],{'contact':_0x1c7d90[_0xb087('0x40')],'message':_0x1c7d90[_0xb087('0x2c')],'agent':_0x1c7d90[_0xb087('0x41')],'interaction':_0x1c7d90[_0xb087('0x42')],'account':_0x1c7d90['account']}))||'';}function getInteractionUsers(_0x7e1315,_0x5bb6bc){return new BPromise(function(_0x18e23f,_0x5a582d){try{if(_0x5bb6bc[_0x7e1315['id']]){_0x7e1315[_0xb087('0x43')]=_[_0xb087('0x44')](_0x5bb6bc[_0x7e1315['id']],function(_0x513332){return{'id':_0x513332['id'],'fullname':_0x513332[_0xb087('0x45')]};});}}catch(_0x5aa11d){_0x5a582d(_0x5aa11d);}_0x18e23f(_0x7e1315);});}function getInteractionTags(_0x46d12a,_0x4a360c){return new BPromise(function(_0x2d2c74,_0x326934){try{if(_0x46d12a[_0xb087('0x46')]){_0x46d12a[_0xb087('0x47')]=[];_0x46d12a[_0xb087('0x46')][_0xb087('0x48')](',')[_0xb087('0x49')](function(_0x5e7690){_0x46d12a[_0xb087('0x47')]['push'](_0x4a360c[_0x5e7690]);});}delete _0x46d12a[_0xb087('0x46')];}catch(_0x2d71c2){_0x326934(_0x2d71c2);}_0x2d2c74(_0x46d12a);});}function updateChatInteraction(_0x5b6924,_0xb662bf,_0x45dc6f){return new BPromise(function(_0x7650c5,_0x4c33cc){return getInteractionUsers(_0x5b6924,_0x45dc6f)[_0xb087('0x25')](function(_0x4a9ccb){return getInteractionTags(_0x4a9ccb,_0xb662bf);})[_0xb087('0x25')](function(_0x32b9d3){_0x7650c5(_0x32b9d3);})['catch'](function(_0x38cb9d){_0x4c33cc(_0x38cb9d);});});}exports[_0xb087('0x4a')]=function(_0x4addbd,_0x2b969a){var _0x171778={},_0x54eb11={},_0x93ada7={'count':0x0,'rows':[]};var _0x46c713=_[_0xb087('0x44')](db[_0xb087('0x4b')]['rawAttributes'],function(_0x47902e){return{'name':_0x47902e[_0xb087('0x4c')],'type':_0x47902e[_0xb087('0x4d')][_0xb087('0x4e')]};});_0x54eb11[_0xb087('0x4f')]=_[_0xb087('0x44')](_0x46c713,_0xb087('0x3d'));_0x54eb11['query']=_['keys'](_0x4addbd[_0xb087('0x50')]);_0x54eb11['filters']=_[_0xb087('0x51')](_0x54eb11[_0xb087('0x4f')],_0x54eb11[_0xb087('0x50')]);_0x171778[_0xb087('0x52')]=_['intersection'](_0x54eb11[_0xb087('0x4f')],qs['fields'](_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]));_0x171778[_0xb087('0x52')]=_0x171778[_0xb087('0x52')][_0xb087('0x54')]?_0x171778['attributes']:_0x54eb11[_0xb087('0x4f')];if(!_0x4addbd[_0xb087('0x50')][_0xb087('0x55')]('nolimit')){_0x171778[_0xb087('0x34')]=qs['limit'](_0x4addbd['query'][_0xb087('0x34')]);_0x171778[_0xb087('0x32')]=qs['offset'](_0x4addbd[_0xb087('0x50')][_0xb087('0x32')]);}_0x171778[_0xb087('0x56')]=qs['sort'](_0x4addbd['query'][_0xb087('0x57')]);_0x171778['where']=qs['filters'](_[_0xb087('0x58')](_0x4addbd[_0xb087('0x50')],_0x54eb11[_0xb087('0x59')]),_0x46c713);var _0x4067cf=[];var _0x2bf92f=squel[_0xb087('0x5a')]()[_0xb087('0x5b')]('id')[_0xb087('0x5b')](_0xb087('0x3d'))[_0xb087('0x5b')](_0xb087('0x5c'))[_0xb087('0x5d')]('tools_tags');var _0x46d570=squel[_0xb087('0x5a')]()['field'](_0xb087('0x5e'))[_0xb087('0x5b')](_0xb087('0x5f'))[_0xb087('0x5b')](_0xb087('0x60'))[_0xb087('0x5d')](_0xb087('0x61'),'ui')[_0xb087('0x62')](_0xb087('0x63'),'u',_0xb087('0x64'));var _0x17c6d0=squel['select']()[_0xb087('0x5d')]('chat_interactions','i')[_0xb087('0x62')]('cm_contacts','c',_0xb087('0x65'))[_0xb087('0x62')](_0xb087('0x63'),'o',_0xb087('0x66'))[_0xb087('0x62')](_0xb087('0x67'),'a',_0xb087('0x68'))[_0xb087('0x62')](_0xb087('0x69'),'me',_0xb087('0x6a'))[_0xb087('0x62')](_0xb087('0x6b'),'it',_0xb087('0x6c'))[_0xb087('0x62')](_0xb087('0x6d'),'t',_0xb087('0x6e'));var _0x217f26=squel[_0xb087('0x6f')]();var _0x40ff74=[];var _0xe3cb2=squel[_0xb087('0x6f')]();var _0x459c5b;if(_0x4addbd['query'][_0xb087('0x70')]){_0x459c5b=as[_0xb087('0x71')](_0x4addbd[_0xb087('0x50')]['search']);var _0x4099cc=_0x459c5b[_0xb087('0x72')];for(var _0x5685b1=0x0;_0x5685b1<_0x459c5b[_0xb087('0x73')][_0xb087('0x54')];_0x5685b1++){var _0x2e3a14=_0x459c5b['conditions'][_0x5685b1];var _0x133c58='i';var _0x257894=_[_0xb087('0x74')](_0x46c713,[_0xb087('0x3d'),_0x2e3a14[_0xb087('0x5b')]]);if(!_0x257894){switch(_0x2e3a14[_0xb087('0x5b')]){case _0xb087('0x75'):if(_0x2e3a14[_0xb087('0x76')]==0x1){_0x17c6d0['having']('`'+_0x2e3a14[_0xb087('0x5b')]+_0xb087('0x77'));}else{_0x17c6d0[_0xb087('0x78')]('`'+_0x2e3a14['field']+_0xb087('0x79'));}break;case'Contact':if(_0x2e3a14['operator']===_0xb087('0x7a')){if(_0x2e3a14[_0xb087('0x76')]['split']('\x20')[_0xb087('0x54')]>0x1){_0x217f26[_0x4099cc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb087('0x7b')](_0x2e3a14[_0xb087('0x76')]),null);}else{var _0x5938ad='%'+_0x2e3a14['value']+'%';_0x217f26[_0x4099cc](_0xb087('0x7c'),_0x5938ad,_0x5938ad,_0x5938ad);}}else{_0x257894=_['find'](_0x46c713,['name',_0xb087('0x7d')]);_0x2e3a14['field']=_0xb087('0x7d');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case'Tag':var _0x200869=_0x2e3a14['value'][_0xb087('0x48')](',')[_0xb087('0x44')](function(_0x1060e1){return Number(_0x1060e1);});_0x200869['forEach'](function(_0x298bbb){_0xe3cb2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x298bbb+',%');});_0x40ff74=_[_0xb087('0x80')](_0x40ff74,_0x200869);break;case _0xb087('0x81'):if(_0x2e3a14[_0xb087('0x82')]===_0xb087('0x7a')){_0x217f26[_0x4099cc](_0xb087('0x83'),'%'+_0x2e3a14[_0xb087('0x76')]+'%',null);}else{_0x257894=_['find'](_0x46c713,[_0xb087('0x3d'),_0xb087('0x84')]);_0x2e3a14['field']=_0xb087('0x84');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case _0xb087('0x3f'):_0x390309=as[_0xb087('0x85')]('me',null,_0x2e3a14);_0x217f26[_0x4099cc](_0x390309['text'],_0x390309['value']['start'],_0x390309[_0xb087('0x76')]['end']);break;}}else{var _0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309['value'][_0xb087('0x30')]);}}}else{var _0x53f04a=_(_0x4addbd[_0xb087('0x50')])[_0xb087('0x86')]()[_0xb087('0x44')](function(_0x42f4a3){return _['some'](_0x46c713,['name',_0x42f4a3])?_0x42f4a3:undefined;})[_0xb087('0x87')]()['value']();if(!_[_0xb087('0x88')](_0x53f04a)){_0x53f04a[_0xb087('0x49')](function(_0x2ca987){if(_0x2ca987===_0xb087('0x89')){_0x17c6d0['where']('i.ChatWebsiteId\x20IN\x20?',[][_0xb087('0x8a')](_0x4addbd['query'][_0x2ca987]));}else if(_0x2ca987===_0xb087('0x8b')){var _0x1c7cd7=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])[_0xb087('0x8d')];var _0x581ad4=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])['$lte'];_0x17c6d0['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1c7cd7,_0x581ad4);}else{if(_0x4addbd[_0xb087('0x50')][_0x2ca987]===_0xb087('0x8e')){_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x90'));}else{_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x91'),_0x4addbd['query'][_0x2ca987]);}}});}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]==0x1){_0x17c6d0[_0xb087('0x78')](_0xb087('0x93'));}else{_0x17c6d0[_0xb087('0x78')]('`unreadMessages`\x20>\x200');}}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]){_0x40ff74=_[_0xb087('0x95')](_0x4addbd['query'][_0xb087('0x94')])?_0x4addbd['query'][_0xb087('0x94')]:new Array(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]);_0x40ff74[_0xb087('0x49')](function(_0x463791){_0xe3cb2['or'](_0xb087('0x96'),'%,'+_0x463791+',%');});}if(_0x4addbd['query']['filter']){var _0x1e7a22=_0x4addbd[_0xb087('0x50')]['filter'][_0xb087('0x97')]('\x5c','\x5c\x5c')[_0xb087('0x97')](/'/g,'\x27\x27');if(qs[_0xb087('0x98')](_0x1e7a22)){_0x217f26['or'](_0xb087('0x99'),_0x1e7a22+'%');}else{_0x217f26['or'](_0xb087('0x9a'),qs[_0xb087('0x7b')](_0x1e7a22))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1e7a22+'%');}}}_0x17c6d0[_0xb087('0x8f')](_0x217f26);_0x17c6d0[_0xb087('0x9b')](_0xb087('0x9c'));var _0x3114ce={'type':db[_0xb087('0x9d')][_0xb087('0x9e')][_0xb087('0x9f')],'raw':!![]};var _0x1fc613=_0x17c6d0[_0xb087('0xa0')]();_0x1fc613['field'](_0xb087('0x9c'));_0x1fc613['field'](_0xb087('0xa1'),_0xb087('0x75'));if(_0x171778['order']){_0x171778[_0xb087('0x56')][_0xb087('0x49')](function(_0x8b1a5b){var _0x2a076b=_0x8b1a5b[0x0]===_0xb087('0xa2')?_0x8b1a5b[0x0]:'i.'+_0x8b1a5b[0x0];_0x17c6d0[_0xb087('0x56')](_0x2a076b,_0x8b1a5b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb087('0x88')](_0x40ff74)){_0x17c6d0[_0xb087('0x78')](_0xe3cb2);_0x1fc613[_0xb087('0x8f')](_0xb087('0xa3'),_0x40ff74);}BPromise[_0xb087('0xa4')]()['then'](function(){if(!_0x459c5b){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x89')])return;_0x1fc613[_0xb087('0x8f')](_0xb087('0xa5'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa5'));return;}if(_0x4addbd[_0xb087('0xa6')][_0xb087('0xa7')]!==_0xb087('0x41'))return;return _0x4addbd[_0xb087('0xa6')][_0xb087('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59121a){if(_[_0xb087('0x88')](_0x59121a)){_0x1fc613[_0xb087('0x8f')](_0xb087('0xa9'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa9'));}else{_0x1fc613['where'](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));}});})[_0xb087('0x25')](function(){if(_0x4addbd['user'][_0xb087('0xa7')]==='agent'&&!_0x459c5b&&!_0x4addbd['query'][_0xb087('0x89')])return[];return db[_0xb087('0xab')][_0xb087('0x50')](_0x1fc613[_0xb087('0xac')](),_0x3114ce);})['then'](function(_0x313c9b){_0x93ada7[_0xb087('0x35')]=_0x313c9b['length'];if(_0x93ada7[_0xb087('0x35')]===0x0)return[];return db['sequelize']['query'](_0x2bf92f[_0xb087('0xac')](),_0x3114ce)[_0xb087('0x25')](function(_0x414cb4){_0x4067cf=_[_0xb087('0xad')](_0x414cb4,'id');_0x3114ce=_[_0xb087('0xae')](_0x3114ce,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]){_0x171778[_0xb087('0x52')][_0xb087('0x49')](function(_0x48e2c6){_0x17c6d0['field']('i.'+_0x48e2c6);});}else{_0x17c6d0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb087('0x75'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xaf'),_0xb087('0xb0'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb1'),_0xb087('0xb2'));_0x17c6d0['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xb087('0xa2'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb3'));_0x17c6d0[_0xb087('0x5b')]('c.firstName',_0xb087('0xb4'));_0x17c6d0['field'](_0xb087('0xb5'),'Contact.lastName');_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb6'),_0xb087('0xb7'));_0x17c6d0[_0xb087('0x5b')]('c.phone',_0xb087('0xb8'));_0x17c6d0['field']('c.mobile','Contact.mobile');_0x17c6d0[_0xb087('0x5b')]('c.fax',_0xb087('0xb9'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xba'),_0xb087('0xbb'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbc'),_0xb087('0xbd'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbe'),_0xb087('0x46'));}if(_0x171778[_0xb087('0x34')])_0x17c6d0[_0xb087('0x34')](_0x171778[_0xb087('0x34')]);if(_0x171778[_0xb087('0x32')])_0x17c6d0[_0xb087('0x32')](_0x171778[_0xb087('0x32')]);return db[_0xb087('0xab')][_0xb087('0x50')](_0x17c6d0['toString'](),_0x3114ce);})[_0xb087('0x25')](function(_0x5c2a14){if(_0x5c2a14[_0xb087('0x54')]>0x0)_0x46d570[_0xb087('0x8f')](_0xb087('0xbf'),_[_0xb087('0x44')](_0x5c2a14,'id'));return db[_0xb087('0xab')][_0xb087('0x50')](_0x46d570[_0xb087('0xac')](),_0x3114ce)['then'](function(_0x5103ab){var _0x5194f2=_[_0xb087('0xc0')](_0x5103ab,_0xb087('0xc1'));var _0x3a403f=[];_0x5c2a14[_0xb087('0x49')](function(_0x18b90b){_0x3a403f[_0xb087('0xc2')](updateChatInteraction(_0x18b90b,_0x4067cf,_0x5194f2));});return BPromise[_0xb087('0xc3')](_0x3a403f);});});})[_0xb087('0x25')](function(_0x181c56){_0x93ada7['rows']=_0x181c56;return _0x93ada7;})[_0xb087('0x25')](respondWithFilteredResult(_0x2b969a,_0x171778))['catch'](handleError(_0x2b969a,null));};exports[_0xb087('0xc4')]=function(_0x25910a,_0x597d80){var _0x4c3aef={'raw':![],'where':{'id':_0x25910a[_0xb087('0xc5')]['id']}},_0x2f2597={};_0x2f2597[_0xb087('0x4f')]=_[_0xb087('0x86')](db['ChatInteraction'][_0xb087('0xc6')]);_0x2f2597[_0xb087('0x50')]=_['keys'](_0x25910a['query']);_0x2f2597[_0xb087('0x59')]=_['intersection'](_0x2f2597['model'],_0x2f2597[_0xb087('0x50')]);_0x4c3aef['attributes']=_[_0xb087('0x51')](_0x2f2597[_0xb087('0x4f')],qs[_0xb087('0x53')](_0x25910a[_0xb087('0x50')][_0xb087('0x53')]));_0x4c3aef[_0xb087('0x52')]=_0x4c3aef[_0xb087('0x52')][_0xb087('0x54')]?_0x4c3aef['attributes']:_0x2f2597[_0xb087('0x4f')];if(_0x25910a['query']['includeAll']){_0x4c3aef[_0xb087('0xc7')]=[{'all':!![]}];}_0x4c3aef=_[_0xb087('0xae')]({},_0x4c3aef,_0x25910a[_0xb087('0xc8')]);return db['ChatInteraction'][_0xb087('0x74')](_0x4c3aef)[_0xb087('0x25')](handleEntityNotFound(_0x597d80,null))[_0xb087('0x25')](respondWithResult(_0x597d80,null))[_0xb087('0xc9')](handleError(_0x597d80,null));};exports['create']=function(_0x1f3ecb,_0x3e865d){return db[_0xb087('0x4b')][_0xb087('0xca')](_0x1f3ecb[_0xb087('0x3f')],{})[_0xb087('0x25')](respondWithResult(_0x3e865d,0xc9))[_0xb087('0xc9')](handleError(_0x3e865d,null));};exports['update']=function(_0x1de68b,_0xfc3490){if(_0x1de68b[_0xb087('0x3f')]['id']){delete _0x1de68b[_0xb087('0x3f')]['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1de68b['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xfc3490,null))[_0xb087('0x25')](saveUpdates(_0x1de68b[_0xb087('0x3f')],null))['then'](respondWithResult(_0xfc3490,null))['catch'](handleError(_0xfc3490,null));};exports[_0xb087('0x3c')]=function(_0x12c676,_0xee09f5){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x12c676[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xee09f5,null))[_0xb087('0x25')](removeEntity(_0xee09f5,null))[_0xb087('0xc9')](handleError(_0xee09f5,null));};exports[_0xb087('0xcb')]=function(_0x5ef263,_0x1a7486){return db[_0xb087('0x4b')][_0xb087('0xcb')]()[_0xb087('0x25')](respondWithResult(_0x1a7486,null))[_0xb087('0xc9')](handleError(_0x1a7486,null));};exports['createVidaooSession']=function(_0x33756c,_0x2e8eb1){var _0x189e0a=_0x33756c[_0xb087('0xc5')]['id'];var _0x52268a;var _0x259ac0;var _0x547968;return db[_0xb087('0x4b')]['findOne']({'where':{'id':_0x189e0a}})['then'](function(_0x321da9){_0x52268a=_0x321da9;return db[_0xb087('0xcc')][_0xb087('0xcd')]({'where':{'id':_0x321da9['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xb087('0xce'),_0xb087('0xcf'),_0xb087('0xd0'),_0xb087('0xd1')],'raw':!![]});})[_0xb087('0x25')](function(_0x48a94f){if(_0x48a94f&&_0x48a94f[_0xb087('0xd2')]&&_0x48a94f[_0xb087('0xce')]){_0x259ac0=_0x48a94f;var _0x290338={'interaction':{'id':_0x189e0a},'agent':{'id':_0x33756c[_0xb087('0xa6')]['id'],'name':_0x33756c[_0xb087('0xa6')][_0xb087('0x3d')],'fullname':_0x33756c['user']['fullname'],'email':_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]},'contact':_0x33756c['body'][_0xb087('0x40')],'account':_0x33756c['body']['account']};var _0x471c54={'rejectUnauthorized':![],'method':_0xb087('0xd4'),'url':_0xb087('0xd5'),'headers':{'X-APIKEY':_0x48a94f[_0xb087('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]],'buttons':null,'topic':_0x259ac0[_0xb087('0xcf')],'note':_[_0xb087('0xd6')](_0x259ac0[_0xb087('0xd0')])?null:getMustacheRender(_0x259ac0[_0xb087('0xd0')],_0x290338),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x259ac0['vidaooMetadata'])){var _0x2ebe58=getMustacheRender(_0x259ac0['vidaooMetadata'],_0x290338);var _0x173a1b=JSON['parse'](_0x2ebe58);_0x471c54['body'][_0xb087('0xd7')]=_0x173a1b;}}catch(_0x2e3036){throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xd9'));}return rp(_0x471c54);}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xda'));}})[_0xb087('0x25')](function(_0x2fdcee){_0x547968=_0x2fdcee;if(_0x547968['id']){var _0x5ae13d={'body':_0x547968[_0xb087('0xdb')],'ChatWebsiteId':_0x259ac0['id'],'ChatInteractionId':_0x52268a['id'],'direction':'out','UserId':_0x33756c[_0xb087('0xa6')]['id']};return db[_0xb087('0xdc')]['create'](_0x5ae13d,{});}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x52268a[_0xb087('0xdd')]({'vidaooSessionId':_0x547968['id']});})['then'](respondWithResult(_0x2e8eb1,null))[_0xb087('0xc9')](handleError(_0x2e8eb1,null));};exports['customUpdate']=function(_0x1e04ff,_0x1a99a3){if(_0x1e04ff[_0xb087('0x3f')]['id']){delete _0x1e04ff['body']['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1e04ff[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xde')],'as':_0xb087('0xdf')}]})[_0xb087('0x25')](handleEntityNotFound(_0x1a99a3,null))[_0xb087('0x25')](saveUpdates(_0x1e04ff[_0xb087('0x3f')],null))[_0xb087('0x25')](respondWithResult(_0x1a99a3,null))[_0xb087('0xc9')](handleError(_0x1a99a3,null));};exports['abandon']=function(_0x3a5432,_0x520aa9,_0x31d03d){if(_0x3a5432[_0xb087('0x3f')]['id']){delete _0x3a5432[_0xb087('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3a5432['params']['id']}})[_0xb087('0x25')](function(_0xfaa17f){if(!_0xfaa17f){logger[_0xb087('0x2a')](_0xb087('0xe0'),_0xb087('0xe1'),0x194,_0xb087('0xe2'));_0x520aa9[_0xb087('0x2e')](0x194);}else{if(_0xfaa17f['UserId']){throw new db[(_0xb087('0x9d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0xfaa17f;})['then'](function(_0x4cde01){if(_0x4cde01){return _0x4cde01[_0xb087('0x3b')]({'closed':_0x3a5432[_0xb087('0x3f')]['closed'],'disposition':_0x3a5432[_0xb087('0x3f')][_0xb087('0xe3')]})[_0xb087('0x25')](function(_0x500a2b){return _0x500a2b;});}})[_0xb087('0x25')](function(_0x11a1a5){return respondWithRpcPromise('AbandonInteraction',_0xb087('0xe1'),_0x3a5432[_0xb087('0x3f')],client9004);})[_0xb087('0x25')](respondWithResult(_0x520aa9,null))[_0xb087('0xc9')](handleError(_0x520aa9,null));};exports['attachmentUpload']=function(_0x270e65,_0x10c680,_0x164371){_0x270e65[_0xb087('0x3f')][_0xb087('0x3d')]=_0x270e65[_0xb087('0xe4')]['originalname'];_0x270e65[_0xb087('0x3f')]['basename']=_0x270e65[_0xb087('0xe4')][_0xb087('0xe5')];_0x270e65['body'][_0xb087('0x4d')]=_0x270e65['file']['mimetype'];return db['Attachment'][_0xb087('0xca')](_0x270e65[_0xb087('0x3f')])[_0xb087('0x25')](respondWithResult(_0x10c680,0xc9))[_0xb087('0xc9')](handleError(_0x10c680,null));};exports[_0xb087('0xe6')]=function(_0x1e0751,_0x2831b4,_0x218fe3){return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1e0751['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2831b4,null))[_0xb087('0x25')](function(_0x1babd3){if(_0x1babd3){if(_0x1babd3[_0xb087('0xe7')]){return _0x2831b4['status'](0x193)['json']({'status':0x193,'message':_0xb087('0xe8')});}return db[_0xb087('0xe9')][_0xb087('0xcd')]({'where':{'id':_0x1e0751[_0xb087('0x50')][_0xb087('0xea')]},'raw':!![]})[_0xb087('0x25')](handleEntityNotFound(_0x2831b4,null));}})['then'](function(_0x52341e){if(_0x52341e){var _0x54eed6=_0x52341e[_0xb087('0xeb')]!==null;var _0x12d277=path[_0xb087('0xec')](config[_0xb087('0xed')],'server/files/attachments/');if(_0x54eed6){_0x12d277=path[_0xb087('0xec')](_0x12d277,_0xb087('0xee'));}var _0x1b5422=path[_0xb087('0xec')](_0x12d277,_0x52341e[_0xb087('0xef')]);return _0x2831b4[_0xb087('0xf0')](_0x1b5422);}})[_0xb087('0xc9')](handleError(_0x2831b4,null));};exports[_0xb087('0xf1')]=function(_0x120012,_0x385065){var _0x56e768=null;var _0x5a2142=null;var _0x24171a=null;var _0x39577d=null;if(_0x120012[_0xb087('0x3f')]['id']){delete _0x120012[_0xb087('0x3f')]['id'];}if(_0x120012[_0xb087('0x3f')][_0xb087('0xf2')]){_0x39577d=path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0xf3'),util[_0xb087('0xf4')](_0xb087('0xf5'),Date[_0xb087('0xf6')]()));_0x120012[_0xb087('0x3f')][_0xb087('0xf7')]=_0x39577d;}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x120012[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xdc')],'as':_0xb087('0xf8'),'include':[{'model':db[_0xb087('0x81')],'as':_0xb087('0x81')}]}]})[_0xb087('0x25')](handleEntityNotFound(_0x385065,null))[_0xb087('0x25')](saveUpdates(_0x120012[_0xb087('0x3f')],null))[_0xb087('0x25')](function(_0x365d41){if(_0x365d41){_0x56e768=_0x365d41;return db[_0xb087('0xcc')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x89')]}});}})[_0xb087('0x25')](function(_0x159082){if(_0x159082){_0x24171a=_0x159082;return db[_0xb087('0xde')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x7d')]}});}})[_0xb087('0x25')](function(_0x2d8c34){if(_0x2d8c34){_0x5a2142=_0x2d8c34;if(_0x39577d){var _0x5a50a1=null;for(var _0x57186a=0x1;_0x57186a<_0x56e768['Messages'][_0xb087('0x54')];++_0x57186a){_0x5a50a1=_0x56e768[_0xb087('0xf8')][_0x57186a];var _0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util['format'](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');var _0x39f701=_0x120012[_0xb087('0x3f')][_0xb087('0xfc')]||util[_0xb087('0xf4')](_0xb087('0xf9'),_0xb087('0xfd'),_0x5a50a1[_0xb087('0x7d')]);switch(_0x24171a['agentIdentifier']){case _0xb087('0xfe'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a['agentAlias'],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');break;case _0xb087('0xff'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x100')]||_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;case _0xb087('0x101'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;default:_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1['UserId']):_0xb087('0xfb');}var _0x2c85ed=util[_0xb087('0xf4')](_0xb087('0x102'),moment(_0x5a50a1['createdAt'])[_0xb087('0xf4')](_0xb087('0x103')),_0x5a50a1[_0xb087('0x104')]==='in'?_0x39f701:_0x4cbc90,_0x5a50a1[_0xb087('0x3f')]);if(!_0x5a50a1[_0xb087('0x105')]){fs['appendFileSync'](_0x39577d,_0x2c85ed);}}return db[_0xb087('0x106')][_0xb087('0xcd')]({'where':{'service':!![]},'include':[{'model':db[_0xb087('0x107')],'as':_0xb087('0x108'),'raw':!![]}]});}}})[_0xb087('0x25')](function(_0x17ad89){if(_0x17ad89&&_0x17ad89[_0xb087('0x108')]&&_0x120012[_0xb087('0x3f')]){var _0x58a76b={'tls':{'rejectUnauthorized':![]}};if(_0x17ad89[_0xb087('0x108')][_0xb087('0x109')]){_0x58a76b['service']=_0x17ad89[_0xb087('0x108')][_0xb087('0x109')];}else{_0x58a76b['host']=_0x17ad89[_0xb087('0x108')][_0xb087('0x10a')];_0x58a76b[_0xb087('0x10b')]=_0x17ad89[_0xb087('0x108')][_0xb087('0x10b')];_0x58a76b[_0xb087('0x10c')]=_0x17ad89[_0xb087('0x108')]['secure'];}if(_0x17ad89[_0xb087('0x108')][_0xb087('0x10d')]){_0x58a76b[_0xb087('0x10e')]={'user':_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')],'pass':_0x17ad89[_0xb087('0x108')]['pass']};}return respondWithRpcPromise(_0xb087('0x10f'),_0xb087('0x110'),{'account':_0x58a76b,'message':{'from':util[_0xb087('0xf4')](_0xb087('0x111'),_0x17ad89[_0xb087('0x3d')],_0x17ad89['email']||_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')]),'to':_0x120012[_0xb087('0x3f')]['mailTranscript'],'subject':_0xb087('0x112'),'text':util['format'](_0xb087('0x113'),_0x120012['body'][_0xb087('0xf2')]),'attachments':[{'path':_0x39577d}]}})['then'](function(){return _0x56e768;})[_0xb087('0xc9')](function(_0x3d916e){console['error'](_0x3d916e);});}else{return _0x56e768;}})[_0xb087('0x25')](respondWithStatusCode(_0x385065,0xc8))['catch'](handleError(_0x385065,null));};exports['addMessage']=function(_0x5180ad,_0x396660,_0x4b2169){return db[_0xb087('0xdc')]['find']({'where':{'id':_0x5180ad['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x396660,null))[_0xb087('0x25')](function(_0x371655){if(_0x371655){return _0x371655[_0xb087('0x114')](_0x5180ad[_0xb087('0x3f')]['ids'],_[_0xb087('0x115')](_0x5180ad[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{});}})[_0xb087('0x25')](respondWithResult(_0x396660,null))[_0xb087('0xc9')](handleError(_0x396660,null));};exports[_0xb087('0x117')]=function(_0x1ca818,_0x2ec638,_0x57d42a){var _0x451c8a={'raw':![],'where':{}};var _0x3768db={};var _0x1db8ba={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1ca818[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x2ec638,null))['then'](function(_0x4904ea){if(_0x4904ea){_0x3768db[_0xb087('0x4f')]=_[_0xb087('0x86')](db[_0xb087('0xdc')][_0xb087('0xc6')]);_0x3768db['query']=_[_0xb087('0x86')](_0x1ca818[_0xb087('0x50')]);_0x3768db[_0xb087('0x59')]=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],_0x3768db['query']);_0x451c8a['attributes']=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],qs['fields'](_0x1ca818[_0xb087('0x50')][_0xb087('0x53')]));_0x451c8a[_0xb087('0x52')]=_0x451c8a[_0xb087('0x52')][_0xb087('0x54')]?_0x451c8a[_0xb087('0x52')]:_0x3768db[_0xb087('0x4f')];if(!_0x1ca818['query'][_0xb087('0x55')](_0xb087('0x118'))){_0x451c8a[_0xb087('0x34')]=qs['limit'](_0x1ca818['query'][_0xb087('0x34')]);_0x451c8a[_0xb087('0x32')]=qs[_0xb087('0x32')](_0x1ca818[_0xb087('0x50')]['offset']);}_0x451c8a[_0xb087('0x56')]=qs[_0xb087('0x57')](_0x1ca818[_0xb087('0x50')]['sort']);_0x451c8a['where']=qs[_0xb087('0x59')](_['pick'](_0x1ca818[_0xb087('0x50')],_0x3768db[_0xb087('0x59')]));_0x451c8a['where']['ChatInteractionId']=_0x4904ea['id'];if(_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]){_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a['where'],{'$or':_[_0xb087('0x44')](_0x451c8a['attributes'],function(_0x52cc1a){var _0x117552={};_0x117552[_0x52cc1a]={'$like':'%'+_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]+'%'};return _0x117552;})});}if(_0x1ca818[_0xb087('0x50')][_0xb087('0x8d')]){var _0x484bb5=_0x1ca818[_0xb087('0x50')]['$gte']['split'](',');var _0x46f8cf={};_0x46f8cf[_0x484bb5[0x0]]={'$gte':moment(_0x484bb5[0x1])[_0xb087('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a[_0xb087('0x8f')],_0x46f8cf);}_0x451c8a=_[_0xb087('0xae')]({},_0x451c8a,_0x1ca818['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x451c8a[_0xb087('0x8f')]})[_0xb087('0x25')](function(_0x2c3d1b){_0x1db8ba['count']=_0x2c3d1b;if(_0x1ca818['query']['includeAll']){_0x451c8a[_0xb087('0xc7')]=[{'all':!![]}];}return db['ChatMessage'][_0xb087('0x11a')](_0x451c8a);})[_0xb087('0x25')](function(_0x4c1577){_0x1db8ba[_0xb087('0x11b')]=_0x4c1577;return _0x1db8ba;});}})[_0xb087('0x25')](respondWithFilteredResult(_0x2ec638,_0x451c8a))[_0xb087('0xc9')](handleError(_0x2ec638,null));};exports[_0xb087('0x11c')]=function(_0xad3eae,_0xb6682a,_0x1dbeb1){var _0x2caa79={'where':{}},_0x521e0c={},_0x1ffbd9={'count':0x0,'rows':[]};return db[_0xb087('0x4b')][_0xb087('0xcd')]({'where':{'id':_0xad3eae['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xb6682a,null))[_0xb087('0x25')](function(_0x3fd51b){if(_0x3fd51b){_0x521e0c[_0xb087('0x4f')]=_['keys'](db['ChatMessage'][_0xb087('0xc6')]);_0x521e0c[_0xb087('0x50')]=_[_0xb087('0x86')](_0xad3eae[_0xb087('0x50')]);_0x521e0c[_0xb087('0x59')]=_[_0xb087('0x51')](_0x521e0c['model'],_0x521e0c['query']);_0x2caa79[_0xb087('0x52')]=_[_0xb087('0x51')](_0x521e0c[_0xb087('0x4f')],qs[_0xb087('0x53')](_0xad3eae['query'][_0xb087('0x53')]));_0x2caa79[_0xb087('0x52')]=_0x2caa79[_0xb087('0x52')][_0xb087('0x54')]?_0x2caa79[_0xb087('0x52')]:_0x521e0c[_0xb087('0x4f')];if(!_0xad3eae[_0xb087('0x50')][_0xb087('0x55')](_0xb087('0x118'))){_0x2caa79[_0xb087('0x34')]=qs[_0xb087('0x34')](_0xad3eae[_0xb087('0x50')][_0xb087('0x34')]);_0x2caa79[_0xb087('0x32')]=qs[_0xb087('0x32')](_0xad3eae[_0xb087('0x50')][_0xb087('0x32')]);}_0x2caa79[_0xb087('0x56')]=qs[_0xb087('0x57')](_0xad3eae[_0xb087('0x50')]['sort']);_0x2caa79[_0xb087('0x8f')]=qs[_0xb087('0x59')](_['pick'](_0xad3eae[_0xb087('0x50')],_0x521e0c[_0xb087('0x59')]));_0x2caa79[_0xb087('0x8f')]['ChatInteractionId']=_0x3fd51b['id'];if(_0xad3eae[_0xb087('0x50')]['filter']){_0x2caa79['where']=_[_0xb087('0xae')](_0x2caa79[_0xb087('0x8f')],{'$or':_[_0xb087('0x44')](_0x2caa79[_0xb087('0x52')],function(_0x4a1749){var _0x300e08={};_0x300e08[_0x4a1749]={'$like':'%'+_0xad3eae['query'][_0xb087('0x119')]+'%'};return _0x300e08;})});}_0x2caa79[_0xb087('0x8f')][_0xb087('0x105')]=![];if(_0xad3eae['query']['id']){_0x2caa79['where']['id']={'$gt':_0xad3eae[_0xb087('0x50')]['id']};}_0x2caa79=_['merge']({},_0x2caa79,_0xad3eae['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x2caa79['where']})[_0xb087('0x25')](function(_0x241c68){_0x1ffbd9[_0xb087('0x35')]=_0x241c68;_0x2caa79[_0xb087('0xc7')]=[];if(_0xad3eae['query']['includeAgent']){_0x2caa79[_0xb087('0xc7')][_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id','fullname',_0xb087('0x100')]});}if(_0xad3eae[_0xb087('0x50')][_0xb087('0x11d')]){_0x2caa79[_0xb087('0xc7')]=[{'all':!![]}];}return db[_0xb087('0xdc')][_0xb087('0x11a')](_0x2caa79);})[_0xb087('0x25')](function(_0x3b5740){_0x1ffbd9['rows']=_0x3b5740;return _0x1ffbd9;});}})[_0xb087('0x25')](respondWithFilteredResult(_0xb6682a,_0x2caa79))[_0xb087('0xc9')](handleError(_0xb6682a,null));};exports[_0xb087('0x11e')]=function(_0x594ddc,_0x30521e,_0x13acd8){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x594ddc[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x30521e,null))['then'](function(_0x528edd){if(_0x528edd){return _0x528edd[_0xb087('0x11f')](_0x594ddc[_0xb087('0x3f')][_0xb087('0x116')],_[_0xb087('0x115')](_0x594ddc[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{})['spread'](function(){return db['Tag'][_0xb087('0x11a')]({'attributes':['id',_0xb087('0x3d'),'color'],'where':{'id':_0x594ddc['body'][_0xb087('0x116')]}});})[_0xb087('0x25')](function(_0x24ae87){socket['emit'](_0xb087('0x120'),{'id':Number(_0x594ddc[_0xb087('0xc5')]['id']),'tags':_0x24ae87||[]});return{'id':Number(_0x594ddc['params']['id']),'tags':_0x24ae87||[]};});}})[_0xb087('0x25')](respondWithResult(_0x30521e,null))['catch'](handleError(_0x30521e,null));};exports['removeTags']=function(_0x592d18,_0x5cbda4,_0x5a182e){return db[_0xb087('0x4b')]['find']({'where':{'id':_0x592d18[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x5cbda4,null))['then'](function(_0x12f2b2){if(_0x12f2b2){return _0x12f2b2[_0xb087('0x121')](_0x592d18[_0xb087('0x50')][_0xb087('0x116')]);}})['then'](respondWithStatusCode(_0x5cbda4,null))[_0xb087('0xc9')](handleError(_0x5cbda4,null));};exports[_0xb087('0xf0')]=function(_0x17d60b,_0x5df18d){var _0x538812=moment()[_0xb087('0x122')]()[_0xb087('0xac')]();var _0x39732b=path[_0xb087('0xec')](config[_0xb087('0xed')],'server',_0xb087('0x123'),'tmp');var _0x1d8582=path[_0xb087('0xec')](config['root'],_0xb087('0x124'),'files',_0xb087('0x125'));var _0x3f2e19=path[_0xb087('0xec')](_0x39732b,_0x538812);var _0x2d500c=util[_0xb087('0xf4')](_0xb087('0x126'),_0x17d60b[_0xb087('0xc5')]['id'],_0x538812);var _0x407837=path['join'](_0x39732b,_0x2d500c);var _0x220896=[];_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id',_0xb087('0x45')],'raw':!![]});_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xde')],'as':_0xb087('0xdf'),'attributes':['id',_0xb087('0x127'),'lastName'],'raw':!![]});if(_0x17d60b[_0xb087('0x50')][_0xb087('0x125')]){_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xe9')],'as':_0xb087('0xe9'),'raw':!![]});}var _0x6fa760=[{'model':db['ChatMessage'],'as':_0xb087('0xf8'),'attributes':['id',_0xb087('0x3f'),_0xb087('0x8b'),'direction',_0xb087('0x105'),_0xb087('0x92')],'include':_0x220896}];_0x6fa760[_0xb087('0xc2')]({'model':db['ChatWebsite'],'as':_0xb087('0x128'),'attributes':['id',_0xb087('0x3d')]});_0x6fa760['push']({'model':db[_0xb087('0x81')],'as':_0xb087('0x129'),'attributes':['id',_0xb087('0x45')]});return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x17d60b['params']['id']},'include':_0x6fa760})[_0xb087('0x25')](handleEntityNotFound(_0x5df18d,null))[_0xb087('0x25')](function(_0x196111){if(_0x196111){var _0x2711ed=_0x196111['get']({'plain':!![]});fs['mkdirSync'](_0x3f2e19);var _0x2aa136={'channel':'Chat','account':_0x2711ed[_0xb087('0x128')][_0xb087('0x3d')],'agent':_0x2711ed['Owner']?_0x2711ed[_0xb087('0x129')][_0xb087('0x45')]:'N.A.','createdAt':moment(_0x2711ed['createdAt'])[_0xb087('0xf4')](_0xb087('0x12a'))[_0xb087('0xac')](),'closedAt':_0x2711ed['closed']?moment(_0x2711ed['closedAt'])['format'](_0xb087('0x12a'))[_0xb087('0xac')]():'','disposition':_0x2711ed[_0xb087('0xe3')],'chatInfo':{'browser':_0x2711ed['browserName'],'os':_0x2711ed['osName'],'referer':_0x2711ed[_0xb087('0x12b')],'customerIp':_0x2711ed[_0xb087('0x12c')],'customerPort':_0x2711ed[_0xb087('0x12d')]?_0x2711ed[_0xb087('0x12d')]:_0xb087('0x12e')},'messages':_(_0x2711ed[_0xb087('0xf8')])[_0xb087('0x12f')]()[_0xb087('0x119')]({'secret':![]})[_0xb087('0x44')](function(_0x4392f7){if(_0x4392f7[_0xb087('0xe9')]){var _0x2ce41b=path[_0xb087('0xec')](_0x1d8582,_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]);if(fs[_0xb087('0x130')](_0x2ce41b)){fs['createReadStream'](_0x2ce41b)[_0xb087('0x131')](fs[_0xb087('0x132')](path['join'](_0x3f2e19,_0x4392f7['Attachment'][_0xb087('0xef')])));}}return{'date':moment(_0x4392f7[_0xb087('0x8b')])[_0xb087('0xf4')](_0xb087('0x12a'))['toString'](),'sender':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?_0x4392f7['User']?_0x4392f7['User'][_0xb087('0x45')]:_0xb087('0xfb'):_0x4392f7[_0xb087('0xdf')]['firstName']+(_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]?'\x20'+_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]:''),'body':_0x4392f7[_0xb087('0xe9')]?_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]:_0x4392f7['body'],'direction':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?'A':'C','secret':_0x4392f7[_0xb087('0x105')],'read':_0x4392f7[_0xb087('0x92')],'attachment':_0x4392f7[_0xb087('0xe9')]};})['value']()};return ejs['renderFile'](path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0x124'),'views',_0xb087('0x135')),{'interaction':_0x2aa136})[_0xb087('0x25')](function(_0x3e4bec){var _0x52b038=path[_0xb087('0xec')](_0x3f2e19,_0xb087('0x136')+_0x2711ed['id']+'-'+_0x538812+_0xb087('0x137'));var _0x4e6b9f={'path':_0x52b038,'channel':'Chat','interactionId':_0x2711ed['id']};return pdf['createPdfFromHTML'](_0x3e4bec,_0x4e6b9f);})[_0xb087('0x25')](function(){return new BPromise(function(_0x22dea9,_0x1c9337){zipdir(_0x3f2e19,{'saveTo':_0x407837},function(_0x3d0278,_0x1c8982){if(_0x3d0278)return _0x1c9337(_0x3d0278);return _0x22dea9(_0x1c8982);});})[_0xb087('0x25')](function(){return new BPromise(function(_0x31b3e7,_0x6b8337){rimraf(_0x3f2e19,function(_0x348c92){if(_0x348c92)_0x6b8337(_0x348c92);return _0x31b3e7();});});})[_0xb087('0x25')](function(){return _0x5df18d[_0xb087('0xf0')](_0x407837,_0x2d500c,function(_0x218e1c){if(_0x218e1c){console[_0xb087('0x138')](_0xb087('0x139'),_0x218e1c);}else{fs[_0xb087('0x13a')](_0x407837);}});});});}else{return _0x5df18d[_0xb087('0x2e')](0xc8);}})[_0xb087('0xc9')](handleError(_0x5df18d,null));};
\ No newline at end of file
+var _0x087b=['jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','render','body','contact','agent','interaction','Users','map','fullname','TagIds','Tags','split','forEach','index','ChatInteraction','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','show','params','rawAttributes','include','options','catch','create','describe','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','disposition','file','filename','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','nolimit','filter','findAll','rows','getMyMessages','includeAll','addTags','setTags','chatInteractionTags:save','removeTags','unix','files','server','attachments','transcript-%d-%s.zip','firstName','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','referer','customerIp','customerPort','N.A.','tail','existsSync','pipe','createWriteStream','out','lastName','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','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','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x6ec16,_0x2e8212){var _0x2b62ac=function(_0x3aa462){while(--_0x3aa462){_0x6ec16['push'](_0x6ec16['shift']());}};_0x2b62ac(++_0x2e8212);}(_0x087b,0x11a));var _0xb087=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x087b[_0x4b7895];return _0x264180;};'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 pdf=require(_0xb087('0x15'));var hardwareService=require(_0xb087('0x16'));var logger=require(_0xb087('0x17'))(_0xb087('0x18'));var utils=require(_0xb087('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb087('0x1a'));var db=require(_0xb087('0x1b'))['db'];config[_0xb087('0x1c')]=_['defaults'](config[_0xb087('0x1c')],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1c')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);var jayson=require(_0xb087('0x21'));var client=jayson[_0xb087('0x22')][_0xb087('0x23')]({'port':0x232b});var client9004=jayson[_0xb087('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x43e576,_0x412b48,_0x597478,_0xcc4426){return new BPromise(function(_0x2b83b7,_0x2e9e74){var _0x5bb80b=_0xcc4426||client;return _0x5bb80b[_0xb087('0x24')](_0x43e576,_0x597478)[_0xb087('0x25')](function(_0x17200d){logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));logger[_0xb087('0x28')](_0xb087('0x29'),_0x412b48,_0xb087('0x27'),JSON['stringify'](_0x17200d));if(_0x17200d['error']){if(_0x17200d['error']['code']===0x1f4){logger[_0xb087('0x2a')](_0xb087('0x2b'),_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2e9e74(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}logger[_0xb087('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);return _0x2b83b7(_0x17200d[_0xb087('0x2a')][_0xb087('0x2c')]);}else{logger[_0xb087('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0xb087('0x27'));_0x2b83b7(_0x17200d[_0xb087('0x2d')]['message']);}})['catch'](function(_0x50745a){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x412b48,_0x50745a);_0x2e9e74(_0x50745a);});});}function respondWithStatusCode(_0x304840,_0x45685d){_0x45685d=_0x45685d||0xcc;return function(_0x1d124f){if(_0x1d124f){return _0x304840[_0xb087('0x2e')](_0x45685d);}return _0x304840[_0xb087('0x2f')](_0x45685d)[_0xb087('0x30')]();};}function respondWithResult(_0xf3f41f,_0x35a52c){_0x35a52c=_0x35a52c||0xc8;return function(_0x6cfb22){if(_0x6cfb22){return _0xf3f41f[_0xb087('0x2f')](_0x35a52c)[_0xb087('0x31')](_0x6cfb22);}};}function respondWithFilteredResult(_0x31e3e6,_0xb0baf6){return function(_0x263259){if(_0x263259){var _0x593b78=typeof _0xb0baf6[_0xb087('0x32')]===_0xb087('0x33')&&typeof _0xb0baf6[_0xb087('0x34')]===_0xb087('0x33');var _0x22d441=_0x263259[_0xb087('0x35')];var _0x2e1c57=_0x593b78?0x0:_0xb0baf6[_0xb087('0x32')];var _0x53a535=_0x593b78?_0x263259['count']:_0xb0baf6[_0xb087('0x32')]+_0xb0baf6[_0xb087('0x34')];var _0x4cb5a8;if(_0x53a535>=_0x22d441){_0x53a535=_0x22d441;_0x4cb5a8=0xc8;}else{_0x4cb5a8=0xce;}_0x31e3e6[_0xb087('0x2f')](_0x4cb5a8);return _0x31e3e6[_0xb087('0x36')](_0xb087('0x37'),_0x2e1c57+'-'+_0x53a535+'/'+_0x22d441)[_0xb087('0x31')](_0x263259);}return null;};}function patchUpdates(_0x3c61c4){return function(_0x427905){try{jsonpatch[_0xb087('0x38')](_0x427905,_0x3c61c4,!![]);}catch(_0x3b7ace){return BPromise[_0xb087('0x39')](_0x3b7ace);}return _0x427905[_0xb087('0x3a')]();};}function saveUpdates(_0x442a5e,_0x3069b5){return function(_0x57ae94){if(_0x57ae94){return _0x57ae94[_0xb087('0x3b')](_0x442a5e)['then'](function(_0x906987){return _0x906987;});}return null;};}function removeEntity(_0x296e9b,_0x738e68){return function(_0xd0659e){if(_0xd0659e){return _0xd0659e[_0xb087('0x3c')]()[_0xb087('0x25')](function(){_0x296e9b[_0xb087('0x2f')](0xcc)[_0xb087('0x30')]();});}};}function handleEntityNotFound(_0x8a4c3c,_0x521c3f){return function(_0x5814c2){if(!_0x5814c2){_0x8a4c3c[_0xb087('0x2e')](0x194);}return _0x5814c2;};}function handleError(_0x3c4f33,_0x1ce1ef){_0x1ce1ef=_0x1ce1ef||0x1f4;return function(_0x2d2902){logger[_0xb087('0x2a')](_0x2d2902['stack']);if(_0x2d2902[_0xb087('0x3d')]){delete _0x2d2902[_0xb087('0x3d')];}_0x3c4f33['status'](_0x1ce1ef)['send'](_0x2d2902);};}function getMustacheRender(_0x1726c2,_0x1c7d90){return Mustache[_0xb087('0x3e')](_0x1726c2,_['merge'](_0x1c7d90[_0xb087('0x3f')],{'contact':_0x1c7d90[_0xb087('0x40')],'message':_0x1c7d90[_0xb087('0x2c')],'agent':_0x1c7d90[_0xb087('0x41')],'interaction':_0x1c7d90[_0xb087('0x42')],'account':_0x1c7d90['account']}))||'';}function getInteractionUsers(_0x7e1315,_0x5bb6bc){return new BPromise(function(_0x18e23f,_0x5a582d){try{if(_0x5bb6bc[_0x7e1315['id']]){_0x7e1315[_0xb087('0x43')]=_[_0xb087('0x44')](_0x5bb6bc[_0x7e1315['id']],function(_0x513332){return{'id':_0x513332['id'],'fullname':_0x513332[_0xb087('0x45')]};});}}catch(_0x5aa11d){_0x5a582d(_0x5aa11d);}_0x18e23f(_0x7e1315);});}function getInteractionTags(_0x46d12a,_0x4a360c){return new BPromise(function(_0x2d2c74,_0x326934){try{if(_0x46d12a[_0xb087('0x46')]){_0x46d12a[_0xb087('0x47')]=[];_0x46d12a[_0xb087('0x46')][_0xb087('0x48')](',')[_0xb087('0x49')](function(_0x5e7690){_0x46d12a[_0xb087('0x47')]['push'](_0x4a360c[_0x5e7690]);});}delete _0x46d12a[_0xb087('0x46')];}catch(_0x2d71c2){_0x326934(_0x2d71c2);}_0x2d2c74(_0x46d12a);});}function updateChatInteraction(_0x5b6924,_0xb662bf,_0x45dc6f){return new BPromise(function(_0x7650c5,_0x4c33cc){return getInteractionUsers(_0x5b6924,_0x45dc6f)[_0xb087('0x25')](function(_0x4a9ccb){return getInteractionTags(_0x4a9ccb,_0xb662bf);})[_0xb087('0x25')](function(_0x32b9d3){_0x7650c5(_0x32b9d3);})['catch'](function(_0x38cb9d){_0x4c33cc(_0x38cb9d);});});}exports[_0xb087('0x4a')]=function(_0x4addbd,_0x2b969a){var _0x171778={},_0x54eb11={},_0x93ada7={'count':0x0,'rows':[]};var _0x46c713=_[_0xb087('0x44')](db[_0xb087('0x4b')]['rawAttributes'],function(_0x47902e){return{'name':_0x47902e[_0xb087('0x4c')],'type':_0x47902e[_0xb087('0x4d')][_0xb087('0x4e')]};});_0x54eb11[_0xb087('0x4f')]=_[_0xb087('0x44')](_0x46c713,_0xb087('0x3d'));_0x54eb11['query']=_['keys'](_0x4addbd[_0xb087('0x50')]);_0x54eb11['filters']=_[_0xb087('0x51')](_0x54eb11[_0xb087('0x4f')],_0x54eb11[_0xb087('0x50')]);_0x171778[_0xb087('0x52')]=_['intersection'](_0x54eb11[_0xb087('0x4f')],qs['fields'](_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]));_0x171778[_0xb087('0x52')]=_0x171778[_0xb087('0x52')][_0xb087('0x54')]?_0x171778['attributes']:_0x54eb11[_0xb087('0x4f')];if(!_0x4addbd[_0xb087('0x50')][_0xb087('0x55')]('nolimit')){_0x171778[_0xb087('0x34')]=qs['limit'](_0x4addbd['query'][_0xb087('0x34')]);_0x171778[_0xb087('0x32')]=qs['offset'](_0x4addbd[_0xb087('0x50')][_0xb087('0x32')]);}_0x171778[_0xb087('0x56')]=qs['sort'](_0x4addbd['query'][_0xb087('0x57')]);_0x171778['where']=qs['filters'](_[_0xb087('0x58')](_0x4addbd[_0xb087('0x50')],_0x54eb11[_0xb087('0x59')]),_0x46c713);var _0x4067cf=[];var _0x2bf92f=squel[_0xb087('0x5a')]()[_0xb087('0x5b')]('id')[_0xb087('0x5b')](_0xb087('0x3d'))[_0xb087('0x5b')](_0xb087('0x5c'))[_0xb087('0x5d')]('tools_tags');var _0x46d570=squel[_0xb087('0x5a')]()['field'](_0xb087('0x5e'))[_0xb087('0x5b')](_0xb087('0x5f'))[_0xb087('0x5b')](_0xb087('0x60'))[_0xb087('0x5d')](_0xb087('0x61'),'ui')[_0xb087('0x62')](_0xb087('0x63'),'u',_0xb087('0x64'));var _0x17c6d0=squel['select']()[_0xb087('0x5d')]('chat_interactions','i')[_0xb087('0x62')]('cm_contacts','c',_0xb087('0x65'))[_0xb087('0x62')](_0xb087('0x63'),'o',_0xb087('0x66'))[_0xb087('0x62')](_0xb087('0x67'),'a',_0xb087('0x68'))[_0xb087('0x62')](_0xb087('0x69'),'me',_0xb087('0x6a'))[_0xb087('0x62')](_0xb087('0x6b'),'it',_0xb087('0x6c'))[_0xb087('0x62')](_0xb087('0x6d'),'t',_0xb087('0x6e'));var _0x217f26=squel[_0xb087('0x6f')]();var _0x40ff74=[];var _0xe3cb2=squel[_0xb087('0x6f')]();var _0x459c5b;if(_0x4addbd['query'][_0xb087('0x70')]){_0x459c5b=as[_0xb087('0x71')](_0x4addbd[_0xb087('0x50')]['search']);var _0x4099cc=_0x459c5b[_0xb087('0x72')];for(var _0x5685b1=0x0;_0x5685b1<_0x459c5b[_0xb087('0x73')][_0xb087('0x54')];_0x5685b1++){var _0x2e3a14=_0x459c5b['conditions'][_0x5685b1];var _0x133c58='i';var _0x257894=_[_0xb087('0x74')](_0x46c713,[_0xb087('0x3d'),_0x2e3a14[_0xb087('0x5b')]]);if(!_0x257894){switch(_0x2e3a14[_0xb087('0x5b')]){case _0xb087('0x75'):if(_0x2e3a14[_0xb087('0x76')]==0x1){_0x17c6d0['having']('`'+_0x2e3a14[_0xb087('0x5b')]+_0xb087('0x77'));}else{_0x17c6d0[_0xb087('0x78')]('`'+_0x2e3a14['field']+_0xb087('0x79'));}break;case'Contact':if(_0x2e3a14['operator']===_0xb087('0x7a')){if(_0x2e3a14[_0xb087('0x76')]['split']('\x20')[_0xb087('0x54')]>0x1){_0x217f26[_0x4099cc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb087('0x7b')](_0x2e3a14[_0xb087('0x76')]),null);}else{var _0x5938ad='%'+_0x2e3a14['value']+'%';_0x217f26[_0x4099cc](_0xb087('0x7c'),_0x5938ad,_0x5938ad,_0x5938ad);}}else{_0x257894=_['find'](_0x46c713,['name',_0xb087('0x7d')]);_0x2e3a14['field']=_0xb087('0x7d');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case'Tag':var _0x200869=_0x2e3a14['value'][_0xb087('0x48')](',')[_0xb087('0x44')](function(_0x1060e1){return Number(_0x1060e1);});_0x200869['forEach'](function(_0x298bbb){_0xe3cb2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x298bbb+',%');});_0x40ff74=_[_0xb087('0x80')](_0x40ff74,_0x200869);break;case _0xb087('0x81'):if(_0x2e3a14[_0xb087('0x82')]===_0xb087('0x7a')){_0x217f26[_0x4099cc](_0xb087('0x83'),'%'+_0x2e3a14[_0xb087('0x76')]+'%',null);}else{_0x257894=_['find'](_0x46c713,[_0xb087('0x3d'),_0xb087('0x84')]);_0x2e3a14['field']=_0xb087('0x84');_0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309[_0xb087('0x76')][_0xb087('0x30')]);}break;case _0xb087('0x3f'):_0x390309=as[_0xb087('0x85')]('me',null,_0x2e3a14);_0x217f26[_0x4099cc](_0x390309['text'],_0x390309['value']['start'],_0x390309[_0xb087('0x76')]['end']);break;}}else{var _0x390309=as['buildExpression'](_0x133c58,_0x257894[_0xb087('0x4d')],_0x2e3a14);_0x217f26[_0x4099cc](_0x390309[_0xb087('0x7e')],_0x390309[_0xb087('0x76')][_0xb087('0x7f')],_0x390309['value'][_0xb087('0x30')]);}}}else{var _0x53f04a=_(_0x4addbd[_0xb087('0x50')])[_0xb087('0x86')]()[_0xb087('0x44')](function(_0x42f4a3){return _['some'](_0x46c713,['name',_0x42f4a3])?_0x42f4a3:undefined;})[_0xb087('0x87')]()['value']();if(!_[_0xb087('0x88')](_0x53f04a)){_0x53f04a[_0xb087('0x49')](function(_0x2ca987){if(_0x2ca987===_0xb087('0x89')){_0x17c6d0['where']('i.ChatWebsiteId\x20IN\x20?',[][_0xb087('0x8a')](_0x4addbd['query'][_0x2ca987]));}else if(_0x2ca987===_0xb087('0x8b')){var _0x1c7cd7=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])[_0xb087('0x8d')];var _0x581ad4=JSON[_0xb087('0x8c')](_0x4addbd[_0xb087('0x50')][_0x2ca987])['$lte'];_0x17c6d0['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1c7cd7,_0x581ad4);}else{if(_0x4addbd[_0xb087('0x50')][_0x2ca987]===_0xb087('0x8e')){_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x90'));}else{_0x17c6d0[_0xb087('0x8f')]('i.'+_0x2ca987+_0xb087('0x91'),_0x4addbd['query'][_0x2ca987]);}}});}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x92')]==0x1){_0x17c6d0[_0xb087('0x78')](_0xb087('0x93'));}else{_0x17c6d0[_0xb087('0x78')]('`unreadMessages`\x20>\x200');}}if(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]){_0x40ff74=_[_0xb087('0x95')](_0x4addbd['query'][_0xb087('0x94')])?_0x4addbd['query'][_0xb087('0x94')]:new Array(_0x4addbd[_0xb087('0x50')][_0xb087('0x94')]);_0x40ff74[_0xb087('0x49')](function(_0x463791){_0xe3cb2['or'](_0xb087('0x96'),'%,'+_0x463791+',%');});}if(_0x4addbd['query']['filter']){var _0x1e7a22=_0x4addbd[_0xb087('0x50')]['filter'][_0xb087('0x97')]('\x5c','\x5c\x5c')[_0xb087('0x97')](/'/g,'\x27\x27');if(qs[_0xb087('0x98')](_0x1e7a22)){_0x217f26['or'](_0xb087('0x99'),_0x1e7a22+'%');}else{_0x217f26['or'](_0xb087('0x9a'),qs[_0xb087('0x7b')](_0x1e7a22))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1e7a22+'%');}}}_0x17c6d0[_0xb087('0x8f')](_0x217f26);_0x17c6d0[_0xb087('0x9b')](_0xb087('0x9c'));var _0x3114ce={'type':db[_0xb087('0x9d')][_0xb087('0x9e')][_0xb087('0x9f')],'raw':!![]};var _0x1fc613=_0x17c6d0[_0xb087('0xa0')]();_0x1fc613['field'](_0xb087('0x9c'));_0x1fc613['field'](_0xb087('0xa1'),_0xb087('0x75'));if(_0x171778['order']){_0x171778[_0xb087('0x56')][_0xb087('0x49')](function(_0x8b1a5b){var _0x2a076b=_0x8b1a5b[0x0]===_0xb087('0xa2')?_0x8b1a5b[0x0]:'i.'+_0x8b1a5b[0x0];_0x17c6d0[_0xb087('0x56')](_0x2a076b,_0x8b1a5b[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb087('0x88')](_0x40ff74)){_0x17c6d0[_0xb087('0x78')](_0xe3cb2);_0x1fc613[_0xb087('0x8f')](_0xb087('0xa3'),_0x40ff74);}BPromise[_0xb087('0xa4')]()['then'](function(){if(!_0x459c5b){if(_0x4addbd[_0xb087('0x50')][_0xb087('0x89')])return;_0x1fc613[_0xb087('0x8f')](_0xb087('0xa5'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa5'));return;}if(_0x4addbd[_0xb087('0xa6')][_0xb087('0xa7')]!==_0xb087('0x41'))return;return _0x4addbd[_0xb087('0xa6')][_0xb087('0xa8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59121a){if(_[_0xb087('0x88')](_0x59121a)){_0x1fc613[_0xb087('0x8f')](_0xb087('0xa9'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xa9'));}else{_0x1fc613['where'](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));_0x17c6d0[_0xb087('0x8f')](_0xb087('0xaa'),_[_0xb087('0x44')](_0x59121a,'id'));}});})[_0xb087('0x25')](function(){if(_0x4addbd['user'][_0xb087('0xa7')]==='agent'&&!_0x459c5b&&!_0x4addbd['query'][_0xb087('0x89')])return[];return db[_0xb087('0xab')][_0xb087('0x50')](_0x1fc613[_0xb087('0xac')](),_0x3114ce);})['then'](function(_0x313c9b){_0x93ada7[_0xb087('0x35')]=_0x313c9b['length'];if(_0x93ada7[_0xb087('0x35')]===0x0)return[];return db['sequelize']['query'](_0x2bf92f[_0xb087('0xac')](),_0x3114ce)[_0xb087('0x25')](function(_0x414cb4){_0x4067cf=_[_0xb087('0xad')](_0x414cb4,'id');_0x3114ce=_[_0xb087('0xae')](_0x3114ce,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4addbd[_0xb087('0x50')][_0xb087('0x53')]){_0x171778[_0xb087('0x52')][_0xb087('0x49')](function(_0x48e2c6){_0x17c6d0['field']('i.'+_0x48e2c6);});}else{_0x17c6d0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb087('0x75'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xaf'),_0xb087('0xb0'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb1'),_0xb087('0xb2'));_0x17c6d0['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xb087('0xa2'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb3'));_0x17c6d0[_0xb087('0x5b')]('c.firstName',_0xb087('0xb4'));_0x17c6d0['field'](_0xb087('0xb5'),'Contact.lastName');_0x17c6d0[_0xb087('0x5b')](_0xb087('0xb6'),_0xb087('0xb7'));_0x17c6d0[_0xb087('0x5b')]('c.phone',_0xb087('0xb8'));_0x17c6d0['field']('c.mobile','Contact.mobile');_0x17c6d0[_0xb087('0x5b')]('c.fax',_0xb087('0xb9'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xba'),_0xb087('0xbb'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbc'),_0xb087('0xbd'));_0x17c6d0[_0xb087('0x5b')](_0xb087('0xbe'),_0xb087('0x46'));}if(_0x171778[_0xb087('0x34')])_0x17c6d0[_0xb087('0x34')](_0x171778[_0xb087('0x34')]);if(_0x171778[_0xb087('0x32')])_0x17c6d0[_0xb087('0x32')](_0x171778[_0xb087('0x32')]);return db[_0xb087('0xab')][_0xb087('0x50')](_0x17c6d0['toString'](),_0x3114ce);})[_0xb087('0x25')](function(_0x5c2a14){if(_0x5c2a14[_0xb087('0x54')]>0x0)_0x46d570[_0xb087('0x8f')](_0xb087('0xbf'),_[_0xb087('0x44')](_0x5c2a14,'id'));return db[_0xb087('0xab')][_0xb087('0x50')](_0x46d570[_0xb087('0xac')](),_0x3114ce)['then'](function(_0x5103ab){var _0x5194f2=_[_0xb087('0xc0')](_0x5103ab,_0xb087('0xc1'));var _0x3a403f=[];_0x5c2a14[_0xb087('0x49')](function(_0x18b90b){_0x3a403f[_0xb087('0xc2')](updateChatInteraction(_0x18b90b,_0x4067cf,_0x5194f2));});return BPromise[_0xb087('0xc3')](_0x3a403f);});});})[_0xb087('0x25')](function(_0x181c56){_0x93ada7['rows']=_0x181c56;return _0x93ada7;})[_0xb087('0x25')](respondWithFilteredResult(_0x2b969a,_0x171778))['catch'](handleError(_0x2b969a,null));};exports[_0xb087('0xc4')]=function(_0x25910a,_0x597d80){var _0x4c3aef={'raw':![],'where':{'id':_0x25910a[_0xb087('0xc5')]['id']}},_0x2f2597={};_0x2f2597[_0xb087('0x4f')]=_[_0xb087('0x86')](db['ChatInteraction'][_0xb087('0xc6')]);_0x2f2597[_0xb087('0x50')]=_['keys'](_0x25910a['query']);_0x2f2597[_0xb087('0x59')]=_['intersection'](_0x2f2597['model'],_0x2f2597[_0xb087('0x50')]);_0x4c3aef['attributes']=_[_0xb087('0x51')](_0x2f2597[_0xb087('0x4f')],qs[_0xb087('0x53')](_0x25910a[_0xb087('0x50')][_0xb087('0x53')]));_0x4c3aef[_0xb087('0x52')]=_0x4c3aef[_0xb087('0x52')][_0xb087('0x54')]?_0x4c3aef['attributes']:_0x2f2597[_0xb087('0x4f')];if(_0x25910a['query']['includeAll']){_0x4c3aef[_0xb087('0xc7')]=[{'all':!![]}];}_0x4c3aef=_[_0xb087('0xae')]({},_0x4c3aef,_0x25910a[_0xb087('0xc8')]);return db['ChatInteraction'][_0xb087('0x74')](_0x4c3aef)[_0xb087('0x25')](handleEntityNotFound(_0x597d80,null))[_0xb087('0x25')](respondWithResult(_0x597d80,null))[_0xb087('0xc9')](handleError(_0x597d80,null));};exports['create']=function(_0x1f3ecb,_0x3e865d){return db[_0xb087('0x4b')][_0xb087('0xca')](_0x1f3ecb[_0xb087('0x3f')],{})[_0xb087('0x25')](respondWithResult(_0x3e865d,0xc9))[_0xb087('0xc9')](handleError(_0x3e865d,null));};exports['update']=function(_0x1de68b,_0xfc3490){if(_0x1de68b[_0xb087('0x3f')]['id']){delete _0x1de68b[_0xb087('0x3f')]['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1de68b['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xfc3490,null))[_0xb087('0x25')](saveUpdates(_0x1de68b[_0xb087('0x3f')],null))['then'](respondWithResult(_0xfc3490,null))['catch'](handleError(_0xfc3490,null));};exports[_0xb087('0x3c')]=function(_0x12c676,_0xee09f5){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x12c676[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xee09f5,null))[_0xb087('0x25')](removeEntity(_0xee09f5,null))[_0xb087('0xc9')](handleError(_0xee09f5,null));};exports[_0xb087('0xcb')]=function(_0x5ef263,_0x1a7486){return db[_0xb087('0x4b')][_0xb087('0xcb')]()[_0xb087('0x25')](respondWithResult(_0x1a7486,null))[_0xb087('0xc9')](handleError(_0x1a7486,null));};exports['createVidaooSession']=function(_0x33756c,_0x2e8eb1){var _0x189e0a=_0x33756c[_0xb087('0xc5')]['id'];var _0x52268a;var _0x259ac0;var _0x547968;return db[_0xb087('0x4b')]['findOne']({'where':{'id':_0x189e0a}})['then'](function(_0x321da9){_0x52268a=_0x321da9;return db[_0xb087('0xcc')][_0xb087('0xcd')]({'where':{'id':_0x321da9['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0xb087('0xce'),_0xb087('0xcf'),_0xb087('0xd0'),_0xb087('0xd1')],'raw':!![]});})[_0xb087('0x25')](function(_0x48a94f){if(_0x48a94f&&_0x48a94f[_0xb087('0xd2')]&&_0x48a94f[_0xb087('0xce')]){_0x259ac0=_0x48a94f;var _0x290338={'interaction':{'id':_0x189e0a},'agent':{'id':_0x33756c[_0xb087('0xa6')]['id'],'name':_0x33756c[_0xb087('0xa6')][_0xb087('0x3d')],'fullname':_0x33756c['user']['fullname'],'email':_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]},'contact':_0x33756c['body'][_0xb087('0x40')],'account':_0x33756c['body']['account']};var _0x471c54={'rejectUnauthorized':![],'method':_0xb087('0xd4'),'url':_0xb087('0xd5'),'headers':{'X-APIKEY':_0x48a94f[_0xb087('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x33756c[_0xb087('0xa6')][_0xb087('0xd3')]],'buttons':null,'topic':_0x259ac0[_0xb087('0xcf')],'note':_[_0xb087('0xd6')](_0x259ac0[_0xb087('0xd0')])?null:getMustacheRender(_0x259ac0[_0xb087('0xd0')],_0x290338),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x259ac0['vidaooMetadata'])){var _0x2ebe58=getMustacheRender(_0x259ac0['vidaooMetadata'],_0x290338);var _0x173a1b=JSON['parse'](_0x2ebe58);_0x471c54['body'][_0xb087('0xd7')]=_0x173a1b;}}catch(_0x2e3036){throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xd9'));}return rp(_0x471c54);}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))](_0xb087('0xda'));}})[_0xb087('0x25')](function(_0x2fdcee){_0x547968=_0x2fdcee;if(_0x547968['id']){var _0x5ae13d={'body':_0x547968[_0xb087('0xdb')],'ChatWebsiteId':_0x259ac0['id'],'ChatInteractionId':_0x52268a['id'],'direction':'out','UserId':_0x33756c[_0xb087('0xa6')]['id']};return db[_0xb087('0xdc')]['create'](_0x5ae13d,{});}else{throw new db[(_0xb087('0x9d'))][(_0xb087('0xd8'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x52268a[_0xb087('0xdd')]({'vidaooSessionId':_0x547968['id']});})['then'](respondWithResult(_0x2e8eb1,null))[_0xb087('0xc9')](handleError(_0x2e8eb1,null));};exports['customUpdate']=function(_0x1e04ff,_0x1a99a3){if(_0x1e04ff[_0xb087('0x3f')]['id']){delete _0x1e04ff['body']['id'];}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x1e04ff[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xde')],'as':_0xb087('0xdf')}]})[_0xb087('0x25')](handleEntityNotFound(_0x1a99a3,null))[_0xb087('0x25')](saveUpdates(_0x1e04ff[_0xb087('0x3f')],null))[_0xb087('0x25')](respondWithResult(_0x1a99a3,null))[_0xb087('0xc9')](handleError(_0x1a99a3,null));};exports['abandon']=function(_0x3a5432,_0x520aa9,_0x31d03d){if(_0x3a5432[_0xb087('0x3f')]['id']){delete _0x3a5432[_0xb087('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3a5432['params']['id']}})[_0xb087('0x25')](function(_0xfaa17f){if(!_0xfaa17f){logger[_0xb087('0x2a')](_0xb087('0xe0'),_0xb087('0xe1'),0x194,_0xb087('0xe2'));_0x520aa9[_0xb087('0x2e')](0x194);}else{if(_0xfaa17f['UserId']){throw new db[(_0xb087('0x9d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0xfaa17f;})['then'](function(_0x4cde01){if(_0x4cde01){return _0x4cde01[_0xb087('0x3b')]({'closed':_0x3a5432[_0xb087('0x3f')]['closed'],'disposition':_0x3a5432[_0xb087('0x3f')][_0xb087('0xe3')]})[_0xb087('0x25')](function(_0x500a2b){return _0x500a2b;});}})[_0xb087('0x25')](function(_0x11a1a5){return respondWithRpcPromise('AbandonInteraction',_0xb087('0xe1'),_0x3a5432[_0xb087('0x3f')],client9004);})[_0xb087('0x25')](respondWithResult(_0x520aa9,null))[_0xb087('0xc9')](handleError(_0x520aa9,null));};exports['attachmentUpload']=function(_0x270e65,_0x10c680,_0x164371){_0x270e65[_0xb087('0x3f')][_0xb087('0x3d')]=_0x270e65[_0xb087('0xe4')]['originalname'];_0x270e65[_0xb087('0x3f')]['basename']=_0x270e65[_0xb087('0xe4')][_0xb087('0xe5')];_0x270e65['body'][_0xb087('0x4d')]=_0x270e65['file']['mimetype'];return db['Attachment'][_0xb087('0xca')](_0x270e65[_0xb087('0x3f')])[_0xb087('0x25')](respondWithResult(_0x10c680,0xc9))[_0xb087('0xc9')](handleError(_0x10c680,null));};exports[_0xb087('0xe6')]=function(_0x1e0751,_0x2831b4,_0x218fe3){return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1e0751['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2831b4,null))[_0xb087('0x25')](function(_0x1babd3){if(_0x1babd3){if(_0x1babd3[_0xb087('0xe7')]){return _0x2831b4['status'](0x193)['json']({'status':0x193,'message':_0xb087('0xe8')});}return db[_0xb087('0xe9')][_0xb087('0xcd')]({'where':{'id':_0x1e0751[_0xb087('0x50')][_0xb087('0xea')]},'raw':!![]})[_0xb087('0x25')](handleEntityNotFound(_0x2831b4,null));}})['then'](function(_0x52341e){if(_0x52341e){var _0x54eed6=_0x52341e[_0xb087('0xeb')]!==null;var _0x12d277=path[_0xb087('0xec')](config[_0xb087('0xed')],'server/files/attachments/');if(_0x54eed6){_0x12d277=path[_0xb087('0xec')](_0x12d277,_0xb087('0xee'));}var _0x1b5422=path[_0xb087('0xec')](_0x12d277,_0x52341e[_0xb087('0xef')]);return _0x2831b4[_0xb087('0xf0')](_0x1b5422);}})[_0xb087('0xc9')](handleError(_0x2831b4,null));};exports[_0xb087('0xf1')]=function(_0x120012,_0x385065){var _0x56e768=null;var _0x5a2142=null;var _0x24171a=null;var _0x39577d=null;if(_0x120012[_0xb087('0x3f')]['id']){delete _0x120012[_0xb087('0x3f')]['id'];}if(_0x120012[_0xb087('0x3f')][_0xb087('0xf2')]){_0x39577d=path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0xf3'),util[_0xb087('0xf4')](_0xb087('0xf5'),Date[_0xb087('0xf6')]()));_0x120012[_0xb087('0x3f')][_0xb087('0xf7')]=_0x39577d;}return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x120012[_0xb087('0xc5')]['id']},'include':[{'model':db[_0xb087('0xdc')],'as':_0xb087('0xf8'),'include':[{'model':db[_0xb087('0x81')],'as':_0xb087('0x81')}]}]})[_0xb087('0x25')](handleEntityNotFound(_0x385065,null))[_0xb087('0x25')](saveUpdates(_0x120012[_0xb087('0x3f')],null))[_0xb087('0x25')](function(_0x365d41){if(_0x365d41){_0x56e768=_0x365d41;return db[_0xb087('0xcc')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x89')]}});}})[_0xb087('0x25')](function(_0x159082){if(_0x159082){_0x24171a=_0x159082;return db[_0xb087('0xde')][_0xb087('0x74')]({'where':{'id':_0x56e768[_0xb087('0x7d')]}});}})[_0xb087('0x25')](function(_0x2d8c34){if(_0x2d8c34){_0x5a2142=_0x2d8c34;if(_0x39577d){var _0x5a50a1=null;for(var _0x57186a=0x1;_0x57186a<_0x56e768['Messages'][_0xb087('0x54')];++_0x57186a){_0x5a50a1=_0x56e768[_0xb087('0xf8')][_0x57186a];var _0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util['format'](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');var _0x39f701=_0x120012[_0xb087('0x3f')][_0xb087('0xfc')]||util[_0xb087('0xf4')](_0xb087('0xf9'),_0xb087('0xfd'),_0x5a50a1[_0xb087('0x7d')]);switch(_0x24171a['agentIdentifier']){case _0xb087('0xfe'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a['agentAlias'],_0x5a50a1[_0xb087('0x84')]):_0xb087('0xfb');break;case _0xb087('0xff'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x100')]||_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;case _0xb087('0x101'):_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?_0x5a50a1[_0xb087('0x81')][_0xb087('0x45')]:_0xb087('0xfb');break;default:_0x4cbc90=_0x5a50a1[_0xb087('0x84')]?util[_0xb087('0xf4')](_0xb087('0xf9'),_0x24171a[_0xb087('0xfa')],_0x5a50a1['UserId']):_0xb087('0xfb');}var _0x2c85ed=util[_0xb087('0xf4')](_0xb087('0x102'),moment(_0x5a50a1['createdAt'])[_0xb087('0xf4')](_0xb087('0x103')),_0x5a50a1[_0xb087('0x104')]==='in'?_0x39f701:_0x4cbc90,_0x5a50a1[_0xb087('0x3f')]);if(!_0x5a50a1[_0xb087('0x105')]){fs['appendFileSync'](_0x39577d,_0x2c85ed);}}return db[_0xb087('0x106')][_0xb087('0xcd')]({'where':{'service':!![]},'include':[{'model':db[_0xb087('0x107')],'as':_0xb087('0x108'),'raw':!![]}]});}}})[_0xb087('0x25')](function(_0x17ad89){if(_0x17ad89&&_0x17ad89[_0xb087('0x108')]&&_0x120012[_0xb087('0x3f')]){var _0x58a76b={'tls':{'rejectUnauthorized':![]}};if(_0x17ad89[_0xb087('0x108')][_0xb087('0x109')]){_0x58a76b['service']=_0x17ad89[_0xb087('0x108')][_0xb087('0x109')];}else{_0x58a76b['host']=_0x17ad89[_0xb087('0x108')][_0xb087('0x10a')];_0x58a76b[_0xb087('0x10b')]=_0x17ad89[_0xb087('0x108')][_0xb087('0x10b')];_0x58a76b[_0xb087('0x10c')]=_0x17ad89[_0xb087('0x108')]['secure'];}if(_0x17ad89[_0xb087('0x108')][_0xb087('0x10d')]){_0x58a76b[_0xb087('0x10e')]={'user':_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')],'pass':_0x17ad89[_0xb087('0x108')]['pass']};}return respondWithRpcPromise(_0xb087('0x10f'),_0xb087('0x110'),{'account':_0x58a76b,'message':{'from':util[_0xb087('0xf4')](_0xb087('0x111'),_0x17ad89[_0xb087('0x3d')],_0x17ad89['email']||_0x17ad89[_0xb087('0x108')][_0xb087('0xa6')]),'to':_0x120012[_0xb087('0x3f')]['mailTranscript'],'subject':_0xb087('0x112'),'text':util['format'](_0xb087('0x113'),_0x120012['body'][_0xb087('0xf2')]),'attachments':[{'path':_0x39577d}]}})['then'](function(){return _0x56e768;})[_0xb087('0xc9')](function(_0x3d916e){console['error'](_0x3d916e);});}else{return _0x56e768;}})[_0xb087('0x25')](respondWithStatusCode(_0x385065,0xc8))['catch'](handleError(_0x385065,null));};exports['addMessage']=function(_0x5180ad,_0x396660,_0x4b2169){return db[_0xb087('0xdc')]['find']({'where':{'id':_0x5180ad['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x396660,null))[_0xb087('0x25')](function(_0x371655){if(_0x371655){return _0x371655[_0xb087('0x114')](_0x5180ad[_0xb087('0x3f')]['ids'],_[_0xb087('0x115')](_0x5180ad[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{});}})[_0xb087('0x25')](respondWithResult(_0x396660,null))[_0xb087('0xc9')](handleError(_0x396660,null));};exports[_0xb087('0x117')]=function(_0x1ca818,_0x2ec638,_0x57d42a){var _0x451c8a={'raw':![],'where':{}};var _0x3768db={};var _0x1db8ba={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xb087('0xcd')]({'where':{'id':_0x1ca818[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x2ec638,null))['then'](function(_0x4904ea){if(_0x4904ea){_0x3768db[_0xb087('0x4f')]=_[_0xb087('0x86')](db[_0xb087('0xdc')][_0xb087('0xc6')]);_0x3768db['query']=_[_0xb087('0x86')](_0x1ca818[_0xb087('0x50')]);_0x3768db[_0xb087('0x59')]=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],_0x3768db['query']);_0x451c8a['attributes']=_[_0xb087('0x51')](_0x3768db[_0xb087('0x4f')],qs['fields'](_0x1ca818[_0xb087('0x50')][_0xb087('0x53')]));_0x451c8a[_0xb087('0x52')]=_0x451c8a[_0xb087('0x52')][_0xb087('0x54')]?_0x451c8a[_0xb087('0x52')]:_0x3768db[_0xb087('0x4f')];if(!_0x1ca818['query'][_0xb087('0x55')](_0xb087('0x118'))){_0x451c8a[_0xb087('0x34')]=qs['limit'](_0x1ca818['query'][_0xb087('0x34')]);_0x451c8a[_0xb087('0x32')]=qs[_0xb087('0x32')](_0x1ca818[_0xb087('0x50')]['offset']);}_0x451c8a[_0xb087('0x56')]=qs[_0xb087('0x57')](_0x1ca818[_0xb087('0x50')]['sort']);_0x451c8a['where']=qs[_0xb087('0x59')](_['pick'](_0x1ca818[_0xb087('0x50')],_0x3768db[_0xb087('0x59')]));_0x451c8a['where']['ChatInteractionId']=_0x4904ea['id'];if(_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]){_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a['where'],{'$or':_[_0xb087('0x44')](_0x451c8a['attributes'],function(_0x52cc1a){var _0x117552={};_0x117552[_0x52cc1a]={'$like':'%'+_0x1ca818[_0xb087('0x50')][_0xb087('0x119')]+'%'};return _0x117552;})});}if(_0x1ca818[_0xb087('0x50')][_0xb087('0x8d')]){var _0x484bb5=_0x1ca818[_0xb087('0x50')]['$gte']['split'](',');var _0x46f8cf={};_0x46f8cf[_0x484bb5[0x0]]={'$gte':moment(_0x484bb5[0x1])[_0xb087('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x451c8a[_0xb087('0x8f')]=_[_0xb087('0xae')](_0x451c8a[_0xb087('0x8f')],_0x46f8cf);}_0x451c8a=_[_0xb087('0xae')]({},_0x451c8a,_0x1ca818['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x451c8a[_0xb087('0x8f')]})[_0xb087('0x25')](function(_0x2c3d1b){_0x1db8ba['count']=_0x2c3d1b;if(_0x1ca818['query']['includeAll']){_0x451c8a[_0xb087('0xc7')]=[{'all':!![]}];}return db['ChatMessage'][_0xb087('0x11a')](_0x451c8a);})[_0xb087('0x25')](function(_0x4c1577){_0x1db8ba[_0xb087('0x11b')]=_0x4c1577;return _0x1db8ba;});}})[_0xb087('0x25')](respondWithFilteredResult(_0x2ec638,_0x451c8a))[_0xb087('0xc9')](handleError(_0x2ec638,null));};exports[_0xb087('0x11c')]=function(_0xad3eae,_0xb6682a,_0x1dbeb1){var _0x2caa79={'where':{}},_0x521e0c={},_0x1ffbd9={'count':0x0,'rows':[]};return db[_0xb087('0x4b')][_0xb087('0xcd')]({'where':{'id':_0xad3eae['params']['id']}})[_0xb087('0x25')](handleEntityNotFound(_0xb6682a,null))[_0xb087('0x25')](function(_0x3fd51b){if(_0x3fd51b){_0x521e0c[_0xb087('0x4f')]=_['keys'](db['ChatMessage'][_0xb087('0xc6')]);_0x521e0c[_0xb087('0x50')]=_[_0xb087('0x86')](_0xad3eae[_0xb087('0x50')]);_0x521e0c[_0xb087('0x59')]=_[_0xb087('0x51')](_0x521e0c['model'],_0x521e0c['query']);_0x2caa79[_0xb087('0x52')]=_[_0xb087('0x51')](_0x521e0c[_0xb087('0x4f')],qs[_0xb087('0x53')](_0xad3eae['query'][_0xb087('0x53')]));_0x2caa79[_0xb087('0x52')]=_0x2caa79[_0xb087('0x52')][_0xb087('0x54')]?_0x2caa79[_0xb087('0x52')]:_0x521e0c[_0xb087('0x4f')];if(!_0xad3eae[_0xb087('0x50')][_0xb087('0x55')](_0xb087('0x118'))){_0x2caa79[_0xb087('0x34')]=qs[_0xb087('0x34')](_0xad3eae[_0xb087('0x50')][_0xb087('0x34')]);_0x2caa79[_0xb087('0x32')]=qs[_0xb087('0x32')](_0xad3eae[_0xb087('0x50')][_0xb087('0x32')]);}_0x2caa79[_0xb087('0x56')]=qs[_0xb087('0x57')](_0xad3eae[_0xb087('0x50')]['sort']);_0x2caa79[_0xb087('0x8f')]=qs[_0xb087('0x59')](_['pick'](_0xad3eae[_0xb087('0x50')],_0x521e0c[_0xb087('0x59')]));_0x2caa79[_0xb087('0x8f')]['ChatInteractionId']=_0x3fd51b['id'];if(_0xad3eae[_0xb087('0x50')]['filter']){_0x2caa79['where']=_[_0xb087('0xae')](_0x2caa79[_0xb087('0x8f')],{'$or':_[_0xb087('0x44')](_0x2caa79[_0xb087('0x52')],function(_0x4a1749){var _0x300e08={};_0x300e08[_0x4a1749]={'$like':'%'+_0xad3eae['query'][_0xb087('0x119')]+'%'};return _0x300e08;})});}_0x2caa79[_0xb087('0x8f')][_0xb087('0x105')]=![];if(_0xad3eae['query']['id']){_0x2caa79['where']['id']={'$gt':_0xad3eae[_0xb087('0x50')]['id']};}_0x2caa79=_['merge']({},_0x2caa79,_0xad3eae['options']);return db[_0xb087('0xdc')][_0xb087('0x35')]({'where':_0x2caa79['where']})[_0xb087('0x25')](function(_0x241c68){_0x1ffbd9[_0xb087('0x35')]=_0x241c68;_0x2caa79[_0xb087('0xc7')]=[];if(_0xad3eae['query']['includeAgent']){_0x2caa79[_0xb087('0xc7')][_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id','fullname',_0xb087('0x100')]});}if(_0xad3eae[_0xb087('0x50')][_0xb087('0x11d')]){_0x2caa79[_0xb087('0xc7')]=[{'all':!![]}];}return db[_0xb087('0xdc')][_0xb087('0x11a')](_0x2caa79);})[_0xb087('0x25')](function(_0x3b5740){_0x1ffbd9['rows']=_0x3b5740;return _0x1ffbd9;});}})[_0xb087('0x25')](respondWithFilteredResult(_0xb6682a,_0x2caa79))[_0xb087('0xc9')](handleError(_0xb6682a,null));};exports[_0xb087('0x11e')]=function(_0x594ddc,_0x30521e,_0x13acd8){return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x594ddc[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x30521e,null))['then'](function(_0x528edd){if(_0x528edd){return _0x528edd[_0xb087('0x11f')](_0x594ddc[_0xb087('0x3f')][_0xb087('0x116')],_[_0xb087('0x115')](_0x594ddc[_0xb087('0x3f')],[_0xb087('0x116'),'id'])||{})['spread'](function(){return db['Tag'][_0xb087('0x11a')]({'attributes':['id',_0xb087('0x3d'),'color'],'where':{'id':_0x594ddc['body'][_0xb087('0x116')]}});})[_0xb087('0x25')](function(_0x24ae87){socket['emit'](_0xb087('0x120'),{'id':Number(_0x594ddc[_0xb087('0xc5')]['id']),'tags':_0x24ae87||[]});return{'id':Number(_0x594ddc['params']['id']),'tags':_0x24ae87||[]};});}})[_0xb087('0x25')](respondWithResult(_0x30521e,null))['catch'](handleError(_0x30521e,null));};exports['removeTags']=function(_0x592d18,_0x5cbda4,_0x5a182e){return db[_0xb087('0x4b')]['find']({'where':{'id':_0x592d18[_0xb087('0xc5')]['id']}})[_0xb087('0x25')](handleEntityNotFound(_0x5cbda4,null))['then'](function(_0x12f2b2){if(_0x12f2b2){return _0x12f2b2[_0xb087('0x121')](_0x592d18[_0xb087('0x50')][_0xb087('0x116')]);}})['then'](respondWithStatusCode(_0x5cbda4,null))[_0xb087('0xc9')](handleError(_0x5cbda4,null));};exports[_0xb087('0xf0')]=function(_0x17d60b,_0x5df18d){var _0x538812=moment()[_0xb087('0x122')]()[_0xb087('0xac')]();var _0x39732b=path[_0xb087('0xec')](config[_0xb087('0xed')],'server',_0xb087('0x123'),'tmp');var _0x1d8582=path[_0xb087('0xec')](config['root'],_0xb087('0x124'),'files',_0xb087('0x125'));var _0x3f2e19=path[_0xb087('0xec')](_0x39732b,_0x538812);var _0x2d500c=util[_0xb087('0xf4')](_0xb087('0x126'),_0x17d60b[_0xb087('0xc5')]['id'],_0x538812);var _0x407837=path['join'](_0x39732b,_0x2d500c);var _0x220896=[];_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0x81')],'as':_0xb087('0x81'),'attributes':['id',_0xb087('0x45')],'raw':!![]});_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xde')],'as':_0xb087('0xdf'),'attributes':['id',_0xb087('0x127'),'lastName'],'raw':!![]});if(_0x17d60b[_0xb087('0x50')][_0xb087('0x125')]){_0x220896[_0xb087('0xc2')]({'model':db[_0xb087('0xe9')],'as':_0xb087('0xe9'),'raw':!![]});}var _0x6fa760=[{'model':db['ChatMessage'],'as':_0xb087('0xf8'),'attributes':['id',_0xb087('0x3f'),_0xb087('0x8b'),'direction',_0xb087('0x105'),_0xb087('0x92')],'include':_0x220896}];_0x6fa760[_0xb087('0xc2')]({'model':db['ChatWebsite'],'as':_0xb087('0x128'),'attributes':['id',_0xb087('0x3d')]});_0x6fa760['push']({'model':db[_0xb087('0x81')],'as':_0xb087('0x129'),'attributes':['id',_0xb087('0x45')]});return db[_0xb087('0x4b')][_0xb087('0x74')]({'where':{'id':_0x17d60b['params']['id']},'include':_0x6fa760})[_0xb087('0x25')](handleEntityNotFound(_0x5df18d,null))[_0xb087('0x25')](function(_0x196111){if(_0x196111){var _0x2711ed=_0x196111['get']({'plain':!![]});fs['mkdirSync'](_0x3f2e19);var _0x2aa136={'channel':'Chat','account':_0x2711ed[_0xb087('0x128')][_0xb087('0x3d')],'agent':_0x2711ed['Owner']?_0x2711ed[_0xb087('0x129')][_0xb087('0x45')]:'N.A.','createdAt':moment(_0x2711ed['createdAt'])[_0xb087('0xf4')](_0xb087('0x12a'))[_0xb087('0xac')](),'closedAt':_0x2711ed['closed']?moment(_0x2711ed['closedAt'])['format'](_0xb087('0x12a'))[_0xb087('0xac')]():'','disposition':_0x2711ed[_0xb087('0xe3')],'chatInfo':{'browser':_0x2711ed['browserName'],'os':_0x2711ed['osName'],'referer':_0x2711ed[_0xb087('0x12b')],'customerIp':_0x2711ed[_0xb087('0x12c')],'customerPort':_0x2711ed[_0xb087('0x12d')]?_0x2711ed[_0xb087('0x12d')]:_0xb087('0x12e')},'messages':_(_0x2711ed[_0xb087('0xf8')])[_0xb087('0x12f')]()[_0xb087('0x119')]({'secret':![]})[_0xb087('0x44')](function(_0x4392f7){if(_0x4392f7[_0xb087('0xe9')]){var _0x2ce41b=path[_0xb087('0xec')](_0x1d8582,_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]);if(fs[_0xb087('0x130')](_0x2ce41b)){fs['createReadStream'](_0x2ce41b)[_0xb087('0x131')](fs[_0xb087('0x132')](path['join'](_0x3f2e19,_0x4392f7['Attachment'][_0xb087('0xef')])));}}return{'date':moment(_0x4392f7[_0xb087('0x8b')])[_0xb087('0xf4')](_0xb087('0x12a'))['toString'](),'sender':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?_0x4392f7['User']?_0x4392f7['User'][_0xb087('0x45')]:_0xb087('0xfb'):_0x4392f7[_0xb087('0xdf')]['firstName']+(_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]?'\x20'+_0x4392f7[_0xb087('0xdf')][_0xb087('0x134')]:''),'body':_0x4392f7[_0xb087('0xe9')]?_0x4392f7[_0xb087('0xe9')][_0xb087('0xef')]:_0x4392f7['body'],'direction':_0x4392f7[_0xb087('0x104')]===_0xb087('0x133')?'A':'C','secret':_0x4392f7[_0xb087('0x105')],'read':_0x4392f7[_0xb087('0x92')],'attachment':_0x4392f7[_0xb087('0xe9')]};})['value']()};return ejs['renderFile'](path[_0xb087('0xec')](config[_0xb087('0xed')],_0xb087('0x124'),'views',_0xb087('0x135')),{'interaction':_0x2aa136})[_0xb087('0x25')](function(_0x3e4bec){var _0x52b038=path[_0xb087('0xec')](_0x3f2e19,_0xb087('0x136')+_0x2711ed['id']+'-'+_0x538812+_0xb087('0x137'));var _0x4e6b9f={'path':_0x52b038,'channel':'Chat','interactionId':_0x2711ed['id']};return pdf['createPdfFromHTML'](_0x3e4bec,_0x4e6b9f);})[_0xb087('0x25')](function(){return new BPromise(function(_0x22dea9,_0x1c9337){zipdir(_0x3f2e19,{'saveTo':_0x407837},function(_0x3d0278,_0x1c8982){if(_0x3d0278)return _0x1c9337(_0x3d0278);return _0x22dea9(_0x1c8982);});})[_0xb087('0x25')](function(){return new BPromise(function(_0x31b3e7,_0x6b8337){rimraf(_0x3f2e19,function(_0x348c92){if(_0x348c92)_0x6b8337(_0x348c92);return _0x31b3e7();});});})[_0xb087('0x25')](function(){return _0x5df18d[_0xb087('0xf0')](_0x407837,_0x2d500c,function(_0x218e1c){if(_0x218e1c){console[_0xb087('0x138')](_0xb087('0x139'),_0x218e1c);}else{fs[_0xb087('0x13a')](_0x407837);}});});});}else{return _0x5df18d[_0xb087('0x2e')](0xc8);}})[_0xb087('0xc9')](handleError(_0x5df18d,null));};
\ No newline at end of file
index 5ef434e..793c49a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70fe=['map','findAll','unreadMessages','length','emit','catch','hook','exports','events','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x18b468,_0x54b673){var _0xd3c95d=function(_0x315b2d){while(--_0x315b2d){_0x18b468['push'](_0x18b468['shift']());}};_0xd3c95d(++_0x54b673);}(_0x70fe,0x8d));var _0xe70f=function(_0x506dfa,_0x2d00a0){_0x506dfa=_0x506dfa-0x0;var _0x589600=_0x70fe[_0x506dfa];return _0x589600;};'use strict';var EventEmitter=require(_0xe70f('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xe70f('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xe70f('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe70f('0x3')](0x0);var events={'afterCreate':_0xe70f('0x4'),'afterUpdate':_0xe70f('0x5'),'afterDestroy':_0xe70f('0x6')};function emitEvent(_0xddefbb){return function(_0x593998,_0x33e2cc,_0x455525){_0x593998[_0xe70f('0x7')]({'attributes':['id'],'raw':!![]})[_0xe70f('0x8')](function(_0xb61ed4){_0x593998[_0xe70f('0x9')](_0xe70f('0xa'),_0xb61ed4[_0xe70f('0xb')](function(_0x126e50){return{'id':_0x126e50['id']};}));return ChatMessage[_0xe70f('0xc')]({'where':{'ChatInteractionId':_0x593998['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe70f('0x8')](function(_0x4fd3eb){_0x593998['setDataValue'](_0xe70f('0xd'),_0x4fd3eb[_0xe70f('0xe')]);ChatInteractionEvents[_0xe70f('0xf')](_0xddefbb+':'+_0x593998['id'],_0x593998);ChatInteractionEvents[_0xe70f('0xf')](_0xddefbb,_0x593998);_0x455525(null);})[_0xe70f('0x10')](_0x455525(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xe70f('0x11')](e,emitEvent(event));}}module[_0xe70f('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x23b0=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','getUsers','map','findAll','then','setDataValue','unreadMessages','length','emit'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x23b0,0xee));var _0x023b=function(_0x54edc0,_0x5abdba){_0x54edc0=_0x54edc0-0x0;var _0x4c7fe5=_0x23b0[_0x54edc0];return _0x4c7fe5;};'use strict';var EventEmitter=require(_0x023b('0x0'));var ChatInteraction=require(_0x023b('0x1'))['db'][_0x023b('0x2')];var ChatMessage=require(_0x023b('0x1'))['db'][_0x023b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x023b('0x4'),'afterUpdate':_0x023b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3ad7fd){return function(_0x1510da,_0x26f06c,_0x21178a){_0x1510da[_0x023b('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x26da69){_0x1510da['setDataValue']('Users',_0x26da69[_0x023b('0x7')](function(_0x5f5bc5){return{'id':_0x5f5bc5['id']};}));return ChatMessage[_0x023b('0x8')]({'where':{'ChatInteractionId':_0x1510da['id'],'direction':'in','read':![]},'raw':!![]});})[_0x023b('0x9')](function(_0x2babf0){_0x1510da[_0x023b('0xa')](_0x023b('0xb'),_0x2babf0[_0x023b('0xc')]);ChatInteractionEvents[_0x023b('0xd')](_0x3ad7fd+':'+_0x1510da['id'],_0x1510da);ChatInteractionEvents[_0x023b('0xd')](_0x3ad7fd,_0x1510da);_0x21178a(null);})[_0x023b('0xe')](_0x21178a(null));};}for(var e in events){if(events[_0x023b('0xf')](e)){var event=events[e];ChatInteraction[_0x023b('0x10')](e,emitEvent(event));}}module[_0x023b('0x11')]=ChatInteractionEvents;
\ No newline at end of file
index e3f18a3..7277631 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32b6=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','exports','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5525b6,_0x4ac0f6){var _0x1b3b82=function(_0x1391e6){while(--_0x1391e6){_0x5525b6['push'](_0x5525b6['shift']());}};_0x1b3b82(++_0x4ac0f6);}(_0x32b6,0x70));var _0x632b=function(_0x417391,_0x3a3a9c){_0x417391=_0x417391-0x0;var _0xf8a432=_0x32b6[_0x417391];return _0xf8a432;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var logger=require(_0x632b('0x2'))('api');var moment=require(_0x632b('0x3'));var BPromise=require(_0x632b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x632b('0x5'));var rimraf=require('rimraf');var config=require(_0x632b('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x632b('0x7')]=function(_0xb7bc0e,_0x4ffcc5){return _0xb7bc0e['define'](_0x632b('0x8'),attributes,{'tableName':_0x632b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x458fc4,_0x2b14f4,_0x25dd6b){if(_0x458fc4['changed'](_0x632b('0xa'))){_0x458fc4[_0x632b('0xb')]=moment()[_0x632b('0xc')](_0x632b('0xd'));}_0x25dd6b(null,_0x458fc4);}},'charset':_0x632b('0xe'),'collate':_0x632b('0xf')});};
\ No newline at end of file
+var _0xbabf=['chat_interactions','changed','format','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define'];(function(_0x3a29ee,_0x86801d){var _0x337fd9=function(_0x2ad3eb){while(--_0x2ad3eb){_0x3a29ee['push'](_0x3a29ee['shift']());}};_0x337fd9(++_0x86801d);}(_0xbabf,0x93));var _0xfbab=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xbabf[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0xfbab('0x0'));var logger=require(_0xfbab('0x1'))(_0xfbab('0x2'));var moment=require('moment');var BPromise=require(_0xfbab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbab('0x4'));var rimraf=require(_0xfbab('0x5'));var config=require(_0xfbab('0x6'));var attributes=require(_0xfbab('0x7'));module['exports']=function(_0xf610bc,_0x1e518c){return _0xf610bc[_0xfbab('0x8')]('ChatInteraction',attributes,{'tableName':_0xfbab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b629d,_0x463d9e,_0x337bf6){if(_0x1b629d[_0xfbab('0xa')]('closed')){_0x1b629d['closedAt']=moment()[_0xfbab('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x337bf6(null,_0x1b629d);}},'charset':'utf8mb4','collate':_0xfbab('0xc')});};
\ No newline at end of file
index ea8a2d7..3b07223 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd92=['jayson/promise','client','http','defaults','redis','localhost','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateChatInteraction','ChatInteraction','update','options','raw','where','attributes','limit','info','debug','catch','AddTagsToChatInteraction','addTags','body','omit','spread','AddTags','lodash','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3e8a11,_0xacbcdd){var _0x2bfdbb=function(_0x738ba2){while(--_0x738ba2){_0x3e8a11['push'](_0x3e8a11['shift']());}};_0x2bfdbb(++_0xacbcdd);}(_0xfd92,0x132));var _0x2fd9=function(_0x7d5a8b,_0x2aedef){_0x7d5a8b=_0x7d5a8b-0x0;var _0x56ac46=_0xfd92[_0x7d5a8b];return _0x56ac46;};'use strict';var _=require(_0x2fd9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fd9('0x1'))['db'];var utils=require(_0x2fd9('0x2'));var logger=require(_0x2fd9('0x3'))(_0x2fd9('0x4'));var config=require(_0x2fd9('0x5'));var jayson=require(_0x2fd9('0x6'));var client=jayson[_0x2fd9('0x7')][_0x2fd9('0x8')]({'port':0x232a});config['redis']=_[_0x2fd9('0x9')](config[_0x2fd9('0xa')],{'host':_0x2fd9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2fd9('0xc'))[_0x2fd9('0xd')](socket);function respondWithRpcPromise(_0xf99409,_0x3040c6,_0x506825){return new BPromise(function(_0x1d1347,_0x20ca52){return client['request'](_0xf99409,_0x506825)[_0x2fd9('0xe')](function(_0x3a38e9){logger['info'](_0x2fd9('0xf'),_0x3040c6,_0x2fd9('0x10'));logger['debug'](_0x2fd9('0x11'),_0x3040c6,_0x2fd9('0x10'),JSON[_0x2fd9('0x12')](_0x3a38e9));if(_0x3a38e9[_0x2fd9('0x13')]){if(_0x3a38e9[_0x2fd9('0x13')]['code']===0x1f4){logger[_0x2fd9('0x13')](_0x2fd9('0xf'),_0x3040c6,_0x3a38e9['error'][_0x2fd9('0x14')]);return _0x20ca52(_0x3a38e9[_0x2fd9('0x13')]['message']);}logger[_0x2fd9('0x13')](_0x2fd9('0xf'),_0x3040c6,_0x3a38e9[_0x2fd9('0x13')]['message']);return _0x1d1347(_0x3a38e9['error']['message']);}else{logger['info'](_0x2fd9('0xf'),_0x3040c6,_0x2fd9('0x10'));_0x1d1347(_0x3a38e9[_0x2fd9('0x15')][_0x2fd9('0x14')]);}})['catch'](function(_0x93b33d){logger[_0x2fd9('0x13')](_0x2fd9('0xf'),_0x3040c6,_0x93b33d);_0x20ca52(_0x93b33d);});});}exports[_0x2fd9('0x16')]=function(_0x14fb04){var _0x4b040c=this;return new Promise(function(_0x5da620,_0x1d7bc2){return db[_0x2fd9('0x17')][_0x2fd9('0x18')](_0x14fb04['body'],{'raw':_0x14fb04[_0x2fd9('0x19')]?_0x14fb04['options'][_0x2fd9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14fb04['options']?_0x14fb04['options'][_0x2fd9('0x1b')]||null:null,'attributes':_0x14fb04[_0x2fd9('0x19')]?_0x14fb04[_0x2fd9('0x19')][_0x2fd9('0x1c')]||null:null,'limit':_0x14fb04[_0x2fd9('0x19')]?_0x14fb04['options'][_0x2fd9('0x1d')]||null:null})[_0x2fd9('0xe')](function(_0x35ebf3){logger[_0x2fd9('0x1e')](_0x2fd9('0x16'),_0x14fb04);logger[_0x2fd9('0x1f')](_0x2fd9('0x16'),_0x14fb04,JSON[_0x2fd9('0x12')](_0x35ebf3));_0x5da620(_0x35ebf3);})[_0x2fd9('0x20')](function(_0x13114e){logger[_0x2fd9('0x13')]('UpdateChatInteraction',_0x13114e[_0x2fd9('0x14')],_0x14fb04);_0x1d7bc2(_0x4b040c[_0x2fd9('0x13')](0x1f4,_0x13114e[_0x2fd9('0x14')]));});});};exports[_0x2fd9('0x21')]=function(_0x174e7b){return new Promise(function(_0x7c27d,_0x3a3647){return db[_0x2fd9('0x17')]['find']({'where':_0x174e7b[_0x2fd9('0x19')]?_0x174e7b[_0x2fd9('0x19')][_0x2fd9('0x1b')]||null:null})[_0x2fd9('0xe')](function(_0x255525){if(_0x255525){return _0x255525[_0x2fd9('0x22')](_0x174e7b[_0x2fd9('0x23')]['ids'],_[_0x2fd9('0x24')](_0x174e7b[_0x2fd9('0x23')],['ids','id'])||{});}})[_0x2fd9('0x25')](function(_0x2717a6){logger['info'](_0x2fd9('0x26'),_0x174e7b);logger[_0x2fd9('0x1f')](_0x2fd9('0x26'),_0x174e7b,JSON[_0x2fd9('0x12')](_0x2717a6));_0x7c27d(_0x2717a6);})[_0x2fd9('0x20')](function(_0x1aa219){logger['error']('AddTags',_0x1aa219['message'],_0x174e7b);_0x3a3647(_this[_0x2fd9('0x13')](0x1f4,_0x1aa219['message']));});});};
\ No newline at end of file
+var _0x4cd5=['addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','info','debug','request\x20sent','stringify','error','message','ChatInteraction,\x20%s,\x20%s','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','then','AddTagsToChatInteraction'];(function(_0x2fe9cf,_0x418069){var _0x3a1fe0=function(_0x329a54){while(--_0x329a54){_0x2fe9cf['push'](_0x2fe9cf['shift']());}};_0x3a1fe0(++_0x418069);}(_0x4cd5,0x7a));var _0x54cd=function(_0x4ada12,_0x4a2689){_0x4ada12=_0x4ada12-0x0;var _0x2dbf6c=_0x4cd5[_0x4ada12];return _0x2dbf6c;};'use strict';var _=require(_0x54cd('0x0'));var util=require(_0x54cd('0x1'));var moment=require('moment');var BPromise=require(_0x54cd('0x2'));var rs=require(_0x54cd('0x3'));var fs=require('fs');var Redis=require(_0x54cd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x54cd('0x5'))(_0x54cd('0x6'));var config=require('../../config/environment');var jayson=require(_0x54cd('0x7'));var client=jayson[_0x54cd('0x8')][_0x54cd('0x9')]({'port':0x232a});config['redis']=_[_0x54cd('0xa')](config[_0x54cd('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x54cd('0xc'))(new Redis(config[_0x54cd('0xb')]));require(_0x54cd('0xd'))[_0x54cd('0xe')](socket);function respondWithRpcPromise(_0xb6f48d,_0x2d5525,_0x59b63e){return new BPromise(function(_0x5d5ac2,_0x3b8870){return client[_0x54cd('0xf')](_0xb6f48d,_0x59b63e)['then'](function(_0x158cb6){logger[_0x54cd('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x2d5525,'request\x20sent');logger[_0x54cd('0x11')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2d5525,_0x54cd('0x12'),JSON[_0x54cd('0x13')](_0x158cb6));if(_0x158cb6[_0x54cd('0x14')]){if(_0x158cb6[_0x54cd('0x14')]['code']===0x1f4){logger[_0x54cd('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2d5525,_0x158cb6[_0x54cd('0x14')][_0x54cd('0x15')]);return _0x3b8870(_0x158cb6[_0x54cd('0x14')][_0x54cd('0x15')]);}logger[_0x54cd('0x14')](_0x54cd('0x16'),_0x2d5525,_0x158cb6[_0x54cd('0x14')]['message']);return _0x5d5ac2(_0x158cb6[_0x54cd('0x14')][_0x54cd('0x15')]);}else{logger[_0x54cd('0x10')](_0x54cd('0x16'),_0x2d5525,_0x54cd('0x12'));_0x5d5ac2(_0x158cb6['result'][_0x54cd('0x15')]);}})[_0x54cd('0x17')](function(_0x2afa78){logger[_0x54cd('0x14')](_0x54cd('0x16'),_0x2d5525,_0x2afa78);_0x3b8870(_0x2afa78);});});}exports[_0x54cd('0x18')]=function(_0x320224){var _0x1b9277=this;return new Promise(function(_0x4f53fd,_0x16fdeb){return db[_0x54cd('0x19')][_0x54cd('0x1a')](_0x320224[_0x54cd('0x1b')],{'raw':_0x320224[_0x54cd('0x1c')]?_0x320224[_0x54cd('0x1c')][_0x54cd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x320224['options']?_0x320224[_0x54cd('0x1c')][_0x54cd('0x1e')]||null:null,'attributes':_0x320224[_0x54cd('0x1c')]?_0x320224['options'][_0x54cd('0x1f')]||null:null,'limit':_0x320224[_0x54cd('0x1c')]?_0x320224[_0x54cd('0x1c')]['limit']||null:null})[_0x54cd('0x20')](function(_0x147696){logger[_0x54cd('0x10')](_0x54cd('0x18'),_0x320224);logger[_0x54cd('0x11')](_0x54cd('0x18'),_0x320224,JSON['stringify'](_0x147696));_0x4f53fd(_0x147696);})[_0x54cd('0x17')](function(_0x5648d5){logger[_0x54cd('0x14')](_0x54cd('0x18'),_0x5648d5[_0x54cd('0x15')],_0x320224);_0x16fdeb(_0x1b9277[_0x54cd('0x14')](0x1f4,_0x5648d5['message']));});});};exports[_0x54cd('0x21')]=function(_0x684a96){return new Promise(function(_0x55efc8,_0x34947f){return db[_0x54cd('0x19')]['find']({'where':_0x684a96['options']?_0x684a96[_0x54cd('0x1c')][_0x54cd('0x1e')]||null:null})['then'](function(_0x54752f){if(_0x54752f){return _0x54752f[_0x54cd('0x22')](_0x684a96[_0x54cd('0x1b')][_0x54cd('0x23')],_[_0x54cd('0x24')](_0x684a96[_0x54cd('0x1b')],[_0x54cd('0x23'),'id'])||{});}})[_0x54cd('0x25')](function(_0x2da6bd){logger['info'](_0x54cd('0x26'),_0x684a96);logger[_0x54cd('0x11')](_0x54cd('0x26'),_0x684a96,JSON[_0x54cd('0x13')](_0x2da6bd));_0x55efc8(_0x2da6bd);})[_0x54cd('0x17')](function(_0x31073b){logger['error'](_0x54cd('0x26'),_0x31073b[_0x54cd('0x15')],_0x684a96);_0x34947f(_this['error'](0x1f4,_0x31073b['message']));});});};
\ No newline at end of file
index d844bb7..1ff88fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5f0=['./chatInteraction.events','save','remove','update','emit','removeListener','register','length','chatInteraction:'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf5f0,0xd8));var _0x0f5f=function(_0x34fed3,_0x1ca687){_0x34fed3=_0x34fed3-0x0;var _0x41be34=_0xf5f0[_0x34fed3];return _0x41be34;};'use strict';var ChatInteractionEvents=require(_0x0f5f('0x0'));var events=[_0x0f5f('0x1'),_0x0f5f('0x2'),_0x0f5f('0x3')];function createListener(_0x4520de,_0x5787ee){return function(_0x54af45){_0x5787ee[_0x0f5f('0x4')](_0x4520de,_0x54af45);};}function removeListener(_0x22a3f4,_0x2db36a){return function(){ChatInteractionEvents[_0x0f5f('0x5')](_0x22a3f4,_0x2db36a);};}exports[_0x0f5f('0x6')]=function(_0x36b42b){for(var _0x113ef4=0x0,_0x158328=events[_0x0f5f('0x7')];_0x113ef4<_0x158328;_0x113ef4++){var _0x7b2e27=events[_0x113ef4];var _0x5d2e3d=createListener(_0x0f5f('0x8')+_0x7b2e27,_0x36b42b);ChatInteractionEvents['on'](_0x7b2e27,_0x5d2e3d);}};
\ No newline at end of file
+var _0x42b1=['length','chatInteraction:','save','emit','removeListener','register'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x42b1,0x164));var _0x142b=function(_0x2da8c4,_0x27adda){_0x2da8c4=_0x2da8c4-0x0;var _0x3ee006=_0x42b1[_0x2da8c4];return _0x3ee006;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x142b('0x0'),'remove','update'];function createListener(_0x3982eb,_0x58fb43){return function(_0x568fbc){_0x58fb43[_0x142b('0x1')](_0x3982eb,_0x568fbc);};}function removeListener(_0x3d790d,_0x520711){return function(){ChatInteractionEvents[_0x142b('0x2')](_0x3d790d,_0x520711);};}exports[_0x142b('0x3')]=function(_0x343358){for(var _0x41c968=0x0,_0x40f8aa=events[_0x142b('0x4')];_0x41c968<_0x40f8aa;_0x41c968++){var _0x11bd23=events[_0x41c968];var _0x5931ff=createListener(_0x142b('0x5')+_0x11bd23,_0x343358);ChatInteractionEvents['on'](_0x11bd23,_0x5931ff);}};
\ No newline at end of file
index 7a6bb32..26318d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c9f=['/describe','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','/:id/tags','chatinteraction:addtags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','destroy','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','./chatInteraction.controller','get','index'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0x0c9f,0x187));var _0xf0c9=function(_0x4999e9,_0x34f3a9){_0x4999e9=_0x4999e9-0x0;var _0x2a6e16=_0x0c9f[_0x4999e9];return _0x2a6e16;};'use strict';var multer=require('multer');var util=require(_0xf0c9('0x0'));var path=require(_0xf0c9('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0c9('0x2'));var router=express[_0xf0c9('0x3')]();var fs_extra=require(_0xf0c9('0x4'));var auth=require(_0xf0c9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf0c9('0x6'));router[_0xf0c9('0x7')]('/',auth['isAuthenticated'](),controller[_0xf0c9('0x8')]);router[_0xf0c9('0x7')](_0xf0c9('0x9'),auth[_0xf0c9('0xa')](),controller['describe']);router[_0xf0c9('0x7')](_0xf0c9('0xb'),auth[_0xf0c9('0xc')](),controller[_0xf0c9('0xd')]);router['get'](_0xf0c9('0xe'),auth[_0xf0c9('0xc')](),controller[_0xf0c9('0xf')]);router[_0xf0c9('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf0c9('0x10')]);router[_0xf0c9('0x7')](_0xf0c9('0x11'),auth[_0xf0c9('0xc')](),controller['getMyMessages']);router['get'](_0xf0c9('0x12'),auth[_0xf0c9('0xa')](),controller[_0xf0c9('0x13')]);router[_0xf0c9('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf0c9('0x14')](_0xf0c9('0x15'),auth[_0xf0c9('0xa')](),controller[_0xf0c9('0x16')]);var upload=multer({'storage':multer[_0xf0c9('0x17')]({'destination':function(_0x1a8e6e,_0x38bca1,_0x45be20){_0x45be20(null,path[_0xf0c9('0x18')](config[_0xf0c9('0x19')],_0xf0c9('0x1a')));},'filename':function(_0x101d7e,_0x36aa7d,_0x3c85fa){_0x3c85fa(null,util[_0xf0c9('0x1b')]('%s-%s',Date[_0xf0c9('0x1c')](),_0x36aa7d['originalname'][_0xf0c9('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf0c9('0x14')](_0xf0c9('0x1e'),upload[_0xf0c9('0x1f')]('file'),controller[_0xf0c9('0x20')]);router[_0xf0c9('0x14')](_0xf0c9('0x21'),auth[_0xf0c9('0xc')](),controller['addMessage']);router[_0xf0c9('0x14')](_0xf0c9('0x22'),auth[_0xf0c9('0xa')](),interaction['tracked']('chat',_0xf0c9('0x23')),controller['addTags']);router[_0xf0c9('0x24')]('/:id',auth['isAuthenticated'](),interaction[_0xf0c9('0x25')](_0xf0c9('0x26'),_0xf0c9('0x27')),controller[_0xf0c9('0x28')]);router[_0xf0c9('0x24')](_0xf0c9('0x29'),controller[_0xf0c9('0x2a')]);router[_0xf0c9('0x24')](_0xf0c9('0x2b'),auth[_0xf0c9('0xc')](),controller[_0xf0c9('0x2c')]);router[_0xf0c9('0x24')](_0xf0c9('0x2d'),controller['close']);router[_0xf0c9('0x2e')](_0xf0c9('0xb'),auth[_0xf0c9('0xa')](),interaction[_0xf0c9('0x25')](_0xf0c9('0x26'),'chatinteraction:destroy'),controller[_0xf0c9('0x2f')]);router['delete'](_0xf0c9('0x22'),auth[_0xf0c9('0xa')](),controller[_0xf0c9('0x30')]);module[_0xf0c9('0x31')]=router;
\ No newline at end of file
+var _0x96ef=['put','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','now','originalname','replace','/:id/attachment_upload','single','/:id/tags','chatinteraction:addtags','addTags','tracked','chat'];(function(_0x337748,_0x402b05){var _0x3bb03f=function(_0x2fcdf4){while(--_0x2fcdf4){_0x337748['push'](_0x337748['shift']());}};_0x3bb03f(++_0x402b05);}(_0x96ef,0x19f));var _0xf96e=function(_0x565dd7,_0x1bb08c){_0x565dd7=_0x565dd7-0x0;var _0x418ae1=_0x96ef[_0x565dd7];return _0x418ae1;};'use strict';var multer=require(_0xf96e('0x0'));var util=require('util');var path=require(_0xf96e('0x1'));var timeout=require(_0xf96e('0x2'));var express=require(_0xf96e('0x3'));var router=express[_0xf96e('0x4')]();var fs_extra=require(_0xf96e('0x5'));var auth=require(_0xf96e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf96e('0x7'));var controller=require(_0xf96e('0x8'));router[_0xf96e('0x9')]('/',auth[_0xf96e('0xa')](),controller['index']);router[_0xf96e('0x9')](_0xf96e('0xb'),auth[_0xf96e('0xa')](),controller['describe']);router[_0xf96e('0x9')](_0xf96e('0xc'),auth[_0xf96e('0xd')](),controller[_0xf96e('0xe')]);router['get'](_0xf96e('0xf'),auth[_0xf96e('0xd')](),controller['attachmentDownload']);router[_0xf96e('0x9')](_0xf96e('0x10'),auth[_0xf96e('0xa')](),controller['getMessages']);router[_0xf96e('0x9')](_0xf96e('0x11'),auth[_0xf96e('0xd')](),controller['getMyMessages']);router[_0xf96e('0x9')](_0xf96e('0x12'),auth[_0xf96e('0xa')](),controller[_0xf96e('0x13')]);router[_0xf96e('0x14')]('/',auth['isAuthenticated'](),controller[_0xf96e('0x15')]);router[_0xf96e('0x14')](_0xf96e('0x16'),auth['isAuthenticated'](),controller[_0xf96e('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x41af1c,_0x1e2038,_0x56f74a){_0x56f74a(null,path[_0xf96e('0x18')](config['root'],'server/files/attachments/'));},'filename':function(_0x17f7f6,_0x526644,_0x403e1e){_0x403e1e(null,util['format']('%s-%s',Date[_0xf96e('0x19')](),_0x526644[_0xf96e('0x1a')][_0xf96e('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf96e('0x14')](_0xf96e('0x1c'),upload[_0xf96e('0x1d')]('file'),controller['attachmentUpload']);router[_0xf96e('0x14')]('/:id/messages',auth[_0xf96e('0xd')](),controller['addMessage']);router[_0xf96e('0x14')](_0xf96e('0x1e'),auth[_0xf96e('0xa')](),interaction['tracked']('chat',_0xf96e('0x1f')),controller[_0xf96e('0x20')]);router['put'](_0xf96e('0xc'),auth['isAuthenticated'](),interaction[_0xf96e('0x21')](_0xf96e('0x22'),'chatinteraction:update'),controller['update']);router[_0xf96e('0x23')]('/:id/custom_update',controller[_0xf96e('0x24')]);router[_0xf96e('0x23')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xf96e('0x25')]);router[_0xf96e('0x23')](_0xf96e('0x26'),controller[_0xf96e('0x27')]);router[_0xf96e('0x28')](_0xf96e('0xc'),auth[_0xf96e('0xa')](),interaction[_0xf96e('0x21')](_0xf96e('0x22'),_0xf96e('0x29')),controller[_0xf96e('0x2a')]);router[_0xf96e('0x28')](_0xf96e('0x1e'),auth['isAuthenticated'](),controller[_0xf96e('0x2b')]);module[_0xf96e('0x2c')]=router;
\ No newline at end of file
index b138980..a29af52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d5e=['sequelize','exports','medium','BOOLEAN','INTEGER'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x4d5e,0x14a));var _0xe4d5=function(_0x46698b,_0x47d763){_0x46698b=_0x46698b-0x0;var _0x997398=_0x4d5e[_0x46698b];return _0x997398;};'use strict';var Sequelize=require(_0xe4d5('0x0'));module[_0xe4d5('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe4d5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe4d5('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe4d5('0x4')]}};
\ No newline at end of file
+var _0x473b=['sequelize','exports','TEXT','medium','INTEGER'];(function(_0x1439e6,_0x2634b8){var _0x1101a9=function(_0x591d44){while(--_0x591d44){_0x1439e6['push'](_0x1439e6['shift']());}};_0x1101a9(++_0x2634b8);}(_0x473b,0xaa));var _0xb473=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x473b[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require(_0xb473('0x0'));module[_0xb473('0x1')]={'body':{'type':Sequelize[_0xb473('0x2')](_0xb473('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb473('0x4')]}};
\ No newline at end of file
index fc7cd28..430e851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa212=['request-promise','moment','mustache','path','sox','to-csv','ejs','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','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ChatInternalMessage','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','show','params','includeAll','find','create','body','catch','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x327259,_0x401134){var _0x42c219=function(_0x103dbe){while(--_0x103dbe){_0x327259['push'](_0x327259['shift']());}};_0x42c219(++_0x401134);}(_0xa212,0x1c4));var _0x2a21=function(_0xd326f4,_0x4ec6c0){_0xd326f4=_0xd326f4-0x0;var _0x19cf66=_0xa212[_0xd326f4];return _0x19cf66;};'use strict';var emlformat=require(_0x2a21('0x0'));var rimraf=require(_0x2a21('0x1'));var zipdir=require(_0x2a21('0x2'));var jsonpatch=require(_0x2a21('0x3'));var rp=require(_0x2a21('0x4'));var moment=require(_0x2a21('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2a21('0x6'));var util=require('util');var path=require(_0x2a21('0x7'));var sox=require(_0x2a21('0x8'));var csv=require(_0x2a21('0x9'));var ejs=require(_0x2a21('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2a21('0xb'));var squel=require(_0x2a21('0xc'));var crypto=require(_0x2a21('0xd'));var jsforce=require(_0x2a21('0xe'));var deskjs=require(_0x2a21('0xf'));var toCsv=require(_0x2a21('0x9'));var querystring=require(_0x2a21('0x10'));var Papa=require(_0x2a21('0x11'));var Redis=require(_0x2a21('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2a21('0x13'));var as=require(_0x2a21('0x14'));var hardwareService=require(_0x2a21('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x2a21('0x16'));var config=require(_0x2a21('0x17'));var licenseUtil=require(_0x2a21('0x18'));var db=require(_0x2a21('0x19'))['db'];config['redis']=_[_0x2a21('0x1a')](config['redis'],{'host':_0x2a21('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2a21('0x1c'))[_0x2a21('0x1d')](socket);function respondWithStatusCode(_0x125cbd,_0x2abc1f){_0x2abc1f=_0x2abc1f||0xcc;return function(_0x24d530){if(_0x24d530){return _0x125cbd[_0x2a21('0x1e')](_0x2abc1f);}return _0x125cbd[_0x2a21('0x1f')](_0x2abc1f)['end']();};}function respondWithResult(_0x3c2fb6,_0x25cbd3){_0x25cbd3=_0x25cbd3||0xc8;return function(_0xaa8faf){if(_0xaa8faf){return _0x3c2fb6[_0x2a21('0x1f')](_0x25cbd3)['json'](_0xaa8faf);}};}function respondWithFilteredResult(_0x13c396,_0x3a9349){return function(_0x37365e){if(_0x37365e){var _0x470fa5=typeof _0x3a9349[_0x2a21('0x20')]===_0x2a21('0x21')&&typeof _0x3a9349[_0x2a21('0x22')]==='undefined';var _0x46ea10=_0x37365e[_0x2a21('0x23')];var _0x1b89d7=_0x470fa5?0x0:_0x3a9349[_0x2a21('0x20')];var _0x2098c3=_0x470fa5?_0x37365e[_0x2a21('0x23')]:_0x3a9349[_0x2a21('0x20')]+_0x3a9349['limit'];var _0x10de9a;if(_0x2098c3>=_0x46ea10){_0x2098c3=_0x46ea10;_0x10de9a=0xc8;}else{_0x10de9a=0xce;}_0x13c396[_0x2a21('0x1f')](_0x10de9a);return _0x13c396[_0x2a21('0x24')](_0x2a21('0x25'),_0x1b89d7+'-'+_0x2098c3+'/'+_0x46ea10)[_0x2a21('0x26')](_0x37365e);}return null;};}function patchUpdates(_0x27734f){return function(_0x40bd14){try{jsonpatch[_0x2a21('0x27')](_0x40bd14,_0x27734f,!![]);}catch(_0x8e247c){return BPromise[_0x2a21('0x28')](_0x8e247c);}return _0x40bd14[_0x2a21('0x29')]();};}function saveUpdates(_0x4e7887,_0x2756a1){return function(_0x55ad8c){if(_0x55ad8c){return _0x55ad8c[_0x2a21('0x2a')](_0x4e7887)[_0x2a21('0x2b')](function(_0xbc3623){return _0xbc3623;});}return null;};}function removeEntity(_0x378cdf,_0x184c63){return function(_0x11a178){if(_0x11a178){return _0x11a178[_0x2a21('0x2c')]()[_0x2a21('0x2b')](function(){_0x378cdf[_0x2a21('0x1f')](0xcc)[_0x2a21('0x2d')]();});}};}function handleEntityNotFound(_0x2adcf7,_0x2c4b23){return function(_0x5742c9){if(!_0x5742c9){_0x2adcf7[_0x2a21('0x1e')](0x194);}return _0x5742c9;};}function handleError(_0x4109a3,_0xcc3d35){_0xcc3d35=_0xcc3d35||0x1f4;return function(_0x514d87){logger[_0x2a21('0x2e')](_0x514d87[_0x2a21('0x2f')]);if(_0x514d87[_0x2a21('0x30')]){delete _0x514d87[_0x2a21('0x30')];}_0x4109a3[_0x2a21('0x1f')](_0xcc3d35)[_0x2a21('0x31')](_0x514d87);};}exports['index']=function(_0x3d645c,_0x254fea){var _0x38604a={},_0x1fc4e3={},_0x1801c7={'count':0x0,'rows':[]};var _0x4f7116=_[_0x2a21('0x32')](db[_0x2a21('0x33')][_0x2a21('0x34')],function(_0x18c185){return{'name':_0x18c185['fieldName'],'type':_0x18c185['type'][_0x2a21('0x35')]};});_0x1fc4e3[_0x2a21('0x36')]=_[_0x2a21('0x32')](_0x4f7116,_0x2a21('0x30'));_0x1fc4e3['query']=_[_0x2a21('0x37')](_0x3d645c[_0x2a21('0x38')]);_0x1fc4e3[_0x2a21('0x39')]=_[_0x2a21('0x3a')](_0x1fc4e3[_0x2a21('0x36')],_0x1fc4e3[_0x2a21('0x38')]);_0x38604a['attributes']=_[_0x2a21('0x3a')](_0x1fc4e3[_0x2a21('0x36')],qs['fields'](_0x3d645c[_0x2a21('0x38')][_0x2a21('0x3b')]));_0x38604a[_0x2a21('0x3c')]=_0x38604a[_0x2a21('0x3c')][_0x2a21('0x3d')]?_0x38604a[_0x2a21('0x3c')]:_0x1fc4e3[_0x2a21('0x36')];if(!_0x3d645c[_0x2a21('0x38')][_0x2a21('0x3e')](_0x2a21('0x3f'))){_0x38604a[_0x2a21('0x22')]=qs[_0x2a21('0x22')](_0x3d645c[_0x2a21('0x38')]['limit']);_0x38604a[_0x2a21('0x20')]=qs['offset'](_0x3d645c[_0x2a21('0x38')][_0x2a21('0x20')]);}_0x38604a[_0x2a21('0x40')]=qs[_0x2a21('0x41')](_0x3d645c[_0x2a21('0x38')][_0x2a21('0x41')]);_0x38604a[_0x2a21('0x42')]=qs['filters'](_[_0x2a21('0x43')](_0x3d645c['query'],_0x1fc4e3[_0x2a21('0x39')]),_0x4f7116);if(_0x3d645c[_0x2a21('0x38')][_0x2a21('0x44')]){_0x38604a[_0x2a21('0x42')]=_[_0x2a21('0x45')](_0x38604a['where'],{'$or':_['map'](_0x4f7116,function(_0x3c0ff4){if(_0x3c0ff4[_0x2a21('0x46')]!==_0x2a21('0x47')){var _0x4f7981={};_0x4f7981[_0x3c0ff4['name']]={'$like':'%'+_0x3d645c[_0x2a21('0x38')][_0x2a21('0x44')]+'%'};return _0x4f7981;}})});}_0x38604a=_[_0x2a21('0x45')]({},_0x38604a,_0x3d645c[_0x2a21('0x48')]);var _0x293c8b={'where':_0x38604a[_0x2a21('0x42')]};return db[_0x2a21('0x33')][_0x2a21('0x23')](_0x293c8b)['then'](function(_0x4d08aa){_0x1801c7[_0x2a21('0x23')]=_0x4d08aa;if(_0x3d645c[_0x2a21('0x38')]['includeAll']){_0x38604a[_0x2a21('0x49')]=[{'all':!![]}];}return db[_0x2a21('0x33')]['findAll'](_0x38604a);})[_0x2a21('0x2b')](function(_0x4c11a7){_0x1801c7[_0x2a21('0x4a')]=_0x4c11a7;return _0x1801c7;})[_0x2a21('0x2b')](respondWithFilteredResult(_0x254fea,_0x38604a))['catch'](handleError(_0x254fea,null));};exports[_0x2a21('0x4b')]=function(_0x50d9b0,_0x119291){var _0x537210={'raw':!![],'where':{'id':_0x50d9b0[_0x2a21('0x4c')]['id']}},_0x13dbd4={};_0x13dbd4['model']=_[_0x2a21('0x37')](db[_0x2a21('0x33')][_0x2a21('0x34')]);_0x13dbd4['query']=_[_0x2a21('0x37')](_0x50d9b0['query']);_0x13dbd4['filters']=_['intersection'](_0x13dbd4['model'],_0x13dbd4[_0x2a21('0x38')]);_0x537210[_0x2a21('0x3c')]=_[_0x2a21('0x3a')](_0x13dbd4[_0x2a21('0x36')],qs['fields'](_0x50d9b0[_0x2a21('0x38')][_0x2a21('0x3b')]));_0x537210['attributes']=_0x537210['attributes'][_0x2a21('0x3d')]?_0x537210[_0x2a21('0x3c')]:_0x13dbd4[_0x2a21('0x36')];if(_0x50d9b0[_0x2a21('0x38')][_0x2a21('0x4d')]){_0x537210[_0x2a21('0x49')]=[{'all':!![]}];}_0x537210=_[_0x2a21('0x45')]({},_0x537210,_0x50d9b0[_0x2a21('0x48')]);return db[_0x2a21('0x33')][_0x2a21('0x4e')](_0x537210)['then'](handleEntityNotFound(_0x119291,null))[_0x2a21('0x2b')](respondWithResult(_0x119291,null))['catch'](handleError(_0x119291,null));};exports[_0x2a21('0x4f')]=function(_0xf25f69,_0x2d26f7){return db[_0x2a21('0x33')]['create'](_0xf25f69['body'],{})['then'](respondWithResult(_0x2d26f7,0xc9))['catch'](handleError(_0x2d26f7,null));};exports[_0x2a21('0x2a')]=function(_0xdae4e2,_0x9aa83a){if(_0xdae4e2[_0x2a21('0x50')]['id']){delete _0xdae4e2[_0x2a21('0x50')]['id'];}return db[_0x2a21('0x33')][_0x2a21('0x4e')]({'where':{'id':_0xdae4e2[_0x2a21('0x4c')]['id']}})[_0x2a21('0x2b')](handleEntityNotFound(_0x9aa83a,null))[_0x2a21('0x2b')](saveUpdates(_0xdae4e2['body'],null))[_0x2a21('0x2b')](respondWithResult(_0x9aa83a,null))[_0x2a21('0x51')](handleError(_0x9aa83a,null));};exports[_0x2a21('0x2c')]=function(_0x1c68f9,_0x31ae3e){return db[_0x2a21('0x33')][_0x2a21('0x4e')]({'where':{'id':_0x1c68f9['params']['id']}})[_0x2a21('0x2b')](handleEntityNotFound(_0x31ae3e,null))['then'](removeEntity(_0x31ae3e,null))[_0x2a21('0x51')](handleError(_0x31ae3e,null));};exports['describe']=function(_0x1ceb8b,_0x40892d){return db['ChatInternalMessage'][_0x2a21('0x52')]()[_0x2a21('0x2b')](respondWithResult(_0x40892d,null))[_0x2a21('0x51')](handleError(_0x40892d,null));};function wrapUser(_0x2d8c36){return function(_0x433dfe){var _0x5daecb=_0x2d8c36[_0x2a21('0x53')]({'plain':!![]});_0x5daecb[_0x2a21('0x54')]=[];if(_0x433dfe){_0x5daecb[_0x2a21('0x55')]=_0x433dfe[_0x2a21('0x56')];_0x5daecb[_0x2a21('0x57')]=_0x433dfe;}else{_0x5daecb[_0x2a21('0x55')]=moment(0x0)[_0x2a21('0x58')](_0x2a21('0x59'));_0x5daecb[_0x2a21('0x57')]={};}return _0x5daecb;};}exports[_0x2a21('0x5a')]=function(_0x4c68fc,_0x2e9132,_0x5b4081){var _0x497059=[];return db[_0x2a21('0x5b')]['findAll']({'where':{'role':[_0x2a21('0x5c'),_0x2a21('0x5d'),'user']},'attributes':['id',_0x2a21('0x5e'),_0x2a21('0x30'),'role','userpic',_0x2a21('0x5f'),_0x2a21('0x60'),_0x2a21('0x61'),_0x2a21('0x62'),_0x2a21('0x63')],'order':qs[_0x2a21('0x41')](_0x2a21('0x64')),'include':[{'model':db[_0x2a21('0x65')],'as':_0x2a21('0x66'),'attributes':['id',_0x2a21('0x30'),_0x2a21('0x46')],'through':{'attributes':[]}}]})['then'](function(_0xc508d2){if(_0xc508d2){var _0x2e7627=_0x4c68fc[_0x2a21('0x67')][_0x2a21('0x53')]({'plain':!![]});if(!_0x2e7627)throw new Error(_0x2a21('0x68'));if(_0x2e7627[_0x2a21('0x69')]===_0x2a21('0x67')){return db[_0x2a21('0x6a')]['find']({'where':{'name':'Agents','userProfileId':_0x2e7627[_0x2a21('0x6b')]},'raw':!![]})[_0x2a21('0x2b')](function(_0xca279f){if(_0xca279f){if(_0xca279f['autoAssociation']===0x0){return db[_0x2a21('0x6c')]['findAll']({'where':{'sectionId':_0xca279f['id']},'raw':!![]})['then'](function(_0x412b87){var _0x90210c=[];if(_['isEmpty'](_0x412b87)){_0x90210c=_['filter'](_0xc508d2,function(_0x38e4ae){if(_0x38e4ae['role']!==_0x2a21('0x5c')){return _0x38e4ae;}});return _0x90210c;}else{for(var _0xe5fdb5=0x0;_0xe5fdb5<_0xc508d2['length'];_0xe5fdb5++){var _0x37a296=_0xc508d2[_0xe5fdb5];if(_0x37a296[_0x2a21('0x69')]===_0x2a21('0x5c')){var _0x5d656c=_[_0x2a21('0x4e')](_0x412b87,function(_0x486bb1){return _0x486bb1['resourceId']===_0x37a296['id'];});if(_0x5d656c)_0x90210c['push'](_0x37a296);}else{_0x90210c[_0x2a21('0x6d')](_0x37a296);}}return _0x90210c;}});}else{return _0xc508d2;}}else{var _0x43aca2=_[_0x2a21('0x44')](_0xc508d2,function(_0x50dcd3){if(_0x50dcd3[_0x2a21('0x69')]!==_0x2a21('0x5c')){return _0x50dcd3;}});return _0x43aca2;}});}else{return _0xc508d2;}}})[_0x2a21('0x2b')](function(_0x339429){var _0x3d3cec=[];if(_0x339429){_0x497059=_0x339429;for(var _0x160a61=0x0;_0x160a61<_0x339429[_0x2a21('0x3d')];_0x160a61+=0x1){_0x497059[_0x160a61][_0x2a21('0x54')]=[];_0x3d3cec[_0x2a21('0x6d')](db[_0x2a21('0x33')]['find']({'where':{'FromId':[_0x4c68fc[_0x2a21('0x67')]['id'],_0x339429[_0x160a61]['id']],'ToId':[_0x4c68fc[_0x2a21('0x67')]['id'],_0x339429[_0x160a61]['id']],'ChatGroupId':null},'attributes':['id',_0x2a21('0x56'),'FromId',_0x2a21('0x6e'),_0x2a21('0x6f'),_0x2a21('0x50')],'order':qs[_0x2a21('0x41')](_0x2a21('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x339429[_0x160a61])));}return BPromise[_0x2a21('0x71')](_0x3d3cec);}return[];})[_0x2a21('0x2b')](function(_0x5d8c5d){return{'rows':_0x5d8c5d,'count':_0x5d8c5d[_0x2a21('0x3d')]};})[_0x2a21('0x2b')](respondWithResult(_0x2e9132,null))[_0x2a21('0x51')](handleError(_0x2e9132,null));};
\ No newline at end of file
+var _0xdbd5=['filters','intersection','model','attributes','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','params','fields','includeAll','find','create','body','describe','messages','createdAt','lastMessage','lastMessageAt','getUsers','User','admin','fullname','role','userpic','allowmessenger','showWebBar','-online','VoiceQueues','user','Agents','autoAssociation','UserProfileResource','isEmpty','length','agent','resourceId','push','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','name','send','map','ChatInternalMessage','rawAttributes','fieldName','query','keys'];(function(_0x3e6ebf,_0x190b54){var _0x38e295=function(_0x239875){while(--_0x239875){_0x3e6ebf['push'](_0x3e6ebf['shift']());}};_0x38e295(++_0x190b54);}(_0xdbd5,0x94));var _0x5dbd=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0xdbd5[_0x74745d];return _0x174ab3;};'use strict';var emlformat=require(_0x5dbd('0x0'));var rimraf=require(_0x5dbd('0x1'));var zipdir=require(_0x5dbd('0x2'));var jsonpatch=require(_0x5dbd('0x3'));var rp=require(_0x5dbd('0x4'));var moment=require(_0x5dbd('0x5'));var BPromise=require(_0x5dbd('0x6'));var Mustache=require('mustache');var util=require(_0x5dbd('0x7'));var path=require('path');var sox=require(_0x5dbd('0x8'));var csv=require(_0x5dbd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5dbd('0xa'));var _=require('lodash');var squel=require(_0x5dbd('0xb'));var crypto=require(_0x5dbd('0xc'));var jsforce=require(_0x5dbd('0xd'));var deskjs=require(_0x5dbd('0xe'));var toCsv=require(_0x5dbd('0x9'));var querystring=require(_0x5dbd('0xf'));var Papa=require(_0x5dbd('0x10'));var Redis=require(_0x5dbd('0x11'));var authService=require(_0x5dbd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbd('0x13'));var hardwareService=require(_0x5dbd('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5dbd('0x15'));var licenseUtil=require(_0x5dbd('0x16'));var db=require(_0x5dbd('0x17'))['db'];config[_0x5dbd('0x18')]=_['defaults'](config[_0x5dbd('0x18')],{'host':_0x5dbd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5dbd('0x18')]));require('./chatInternalMessage.socket')[_0x5dbd('0x1a')](socket);function respondWithStatusCode(_0x1eadd7,_0x591d8e){_0x591d8e=_0x591d8e||0xcc;return function(_0x1fb0af){if(_0x1fb0af){return _0x1eadd7[_0x5dbd('0x1b')](_0x591d8e);}return _0x1eadd7[_0x5dbd('0x1c')](_0x591d8e)[_0x5dbd('0x1d')]();};}function respondWithResult(_0x3aa404,_0x3dbecd){_0x3dbecd=_0x3dbecd||0xc8;return function(_0x223d5f){if(_0x223d5f){return _0x3aa404[_0x5dbd('0x1c')](_0x3dbecd)[_0x5dbd('0x1e')](_0x223d5f);}};}function respondWithFilteredResult(_0x325d92,_0x50421b){return function(_0x3bd844){if(_0x3bd844){var _0x53ffc6=typeof _0x50421b[_0x5dbd('0x1f')]===_0x5dbd('0x20')&&typeof _0x50421b[_0x5dbd('0x21')]===_0x5dbd('0x20');var _0x55a0d9=_0x3bd844[_0x5dbd('0x22')];var _0xfa1c81=_0x53ffc6?0x0:_0x50421b[_0x5dbd('0x1f')];var _0x26fe08=_0x53ffc6?_0x3bd844[_0x5dbd('0x22')]:_0x50421b['offset']+_0x50421b[_0x5dbd('0x21')];var _0x95cc63;if(_0x26fe08>=_0x55a0d9){_0x26fe08=_0x55a0d9;_0x95cc63=0xc8;}else{_0x95cc63=0xce;}_0x325d92['status'](_0x95cc63);return _0x325d92[_0x5dbd('0x23')](_0x5dbd('0x24'),_0xfa1c81+'-'+_0x26fe08+'/'+_0x55a0d9)[_0x5dbd('0x1e')](_0x3bd844);}return null;};}function patchUpdates(_0x181437){return function(_0x4404ef){try{jsonpatch['apply'](_0x4404ef,_0x181437,!![]);}catch(_0x4cd423){return BPromise[_0x5dbd('0x25')](_0x4cd423);}return _0x4404ef['save']();};}function saveUpdates(_0x465f04,_0x54df47){return function(_0x55b24d){if(_0x55b24d){return _0x55b24d[_0x5dbd('0x26')](_0x465f04)['then'](function(_0x6fa072){return _0x6fa072;});}return null;};}function removeEntity(_0x259564,_0x52a6de){return function(_0x5950ef){if(_0x5950ef){return _0x5950ef[_0x5dbd('0x27')]()[_0x5dbd('0x28')](function(){_0x259564[_0x5dbd('0x1c')](0xcc)[_0x5dbd('0x1d')]();});}};}function handleEntityNotFound(_0x3bc7f7,_0x373e88){return function(_0x52f95b){if(!_0x52f95b){_0x3bc7f7[_0x5dbd('0x1b')](0x194);}return _0x52f95b;};}function handleError(_0x557398,_0x20bf79){_0x20bf79=_0x20bf79||0x1f4;return function(_0x23732f){logger[_0x5dbd('0x29')](_0x23732f['stack']);if(_0x23732f[_0x5dbd('0x2a')]){delete _0x23732f[_0x5dbd('0x2a')];}_0x557398['status'](_0x20bf79)[_0x5dbd('0x2b')](_0x23732f);};}exports['index']=function(_0xe88200,_0x530fd8){var _0x95d875={},_0x1e9d1f={},_0x54d0a2={'count':0x0,'rows':[]};var _0x7f9ff0=_[_0x5dbd('0x2c')](db[_0x5dbd('0x2d')][_0x5dbd('0x2e')],function(_0x530880){return{'name':_0x530880[_0x5dbd('0x2f')],'type':_0x530880['type']['key']};});_0x1e9d1f['model']=_[_0x5dbd('0x2c')](_0x7f9ff0,_0x5dbd('0x2a'));_0x1e9d1f[_0x5dbd('0x30')]=_[_0x5dbd('0x31')](_0xe88200[_0x5dbd('0x30')]);_0x1e9d1f[_0x5dbd('0x32')]=_[_0x5dbd('0x33')](_0x1e9d1f[_0x5dbd('0x34')],_0x1e9d1f[_0x5dbd('0x30')]);_0x95d875['attributes']=_[_0x5dbd('0x33')](_0x1e9d1f['model'],qs['fields'](_0xe88200[_0x5dbd('0x30')]['fields']));_0x95d875[_0x5dbd('0x35')]=_0x95d875[_0x5dbd('0x35')]['length']?_0x95d875[_0x5dbd('0x35')]:_0x1e9d1f[_0x5dbd('0x34')];if(!_0xe88200['query']['hasOwnProperty'](_0x5dbd('0x36'))){_0x95d875[_0x5dbd('0x21')]=qs[_0x5dbd('0x21')](_0xe88200['query'][_0x5dbd('0x21')]);_0x95d875[_0x5dbd('0x1f')]=qs[_0x5dbd('0x1f')](_0xe88200[_0x5dbd('0x30')][_0x5dbd('0x1f')]);}_0x95d875[_0x5dbd('0x37')]=qs[_0x5dbd('0x38')](_0xe88200[_0x5dbd('0x30')][_0x5dbd('0x38')]);_0x95d875[_0x5dbd('0x39')]=qs['filters'](_[_0x5dbd('0x3a')](_0xe88200[_0x5dbd('0x30')],_0x1e9d1f[_0x5dbd('0x32')]),_0x7f9ff0);if(_0xe88200[_0x5dbd('0x30')][_0x5dbd('0x3b')]){_0x95d875['where']=_[_0x5dbd('0x3c')](_0x95d875[_0x5dbd('0x39')],{'$or':_['map'](_0x7f9ff0,function(_0x3c98f7){if(_0x3c98f7[_0x5dbd('0x3d')]!=='VIRTUAL'){var _0x237560={};_0x237560[_0x3c98f7[_0x5dbd('0x2a')]]={'$like':'%'+_0xe88200['query']['filter']+'%'};return _0x237560;}})});}_0x95d875=_[_0x5dbd('0x3c')]({},_0x95d875,_0xe88200[_0x5dbd('0x3e')]);var _0x5a3313={'where':_0x95d875[_0x5dbd('0x39')]};return db['ChatInternalMessage'][_0x5dbd('0x22')](_0x5a3313)['then'](function(_0x11a403){_0x54d0a2[_0x5dbd('0x22')]=_0x11a403;if(_0xe88200[_0x5dbd('0x30')]['includeAll']){_0x95d875[_0x5dbd('0x3f')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x5dbd('0x40')](_0x95d875);})[_0x5dbd('0x28')](function(_0x2ab0d5){_0x54d0a2[_0x5dbd('0x41')]=_0x2ab0d5;return _0x54d0a2;})[_0x5dbd('0x28')](respondWithFilteredResult(_0x530fd8,_0x95d875))[_0x5dbd('0x42')](handleError(_0x530fd8,null));};exports['show']=function(_0x292c0d,_0x3e23bf){var _0x50d5fa={'raw':!![],'where':{'id':_0x292c0d[_0x5dbd('0x43')]['id']}},_0x27a8d5={};_0x27a8d5[_0x5dbd('0x34')]=_[_0x5dbd('0x31')](db[_0x5dbd('0x2d')][_0x5dbd('0x2e')]);_0x27a8d5[_0x5dbd('0x30')]=_['keys'](_0x292c0d[_0x5dbd('0x30')]);_0x27a8d5[_0x5dbd('0x32')]=_[_0x5dbd('0x33')](_0x27a8d5[_0x5dbd('0x34')],_0x27a8d5['query']);_0x50d5fa[_0x5dbd('0x35')]=_['intersection'](_0x27a8d5[_0x5dbd('0x34')],qs[_0x5dbd('0x44')](_0x292c0d[_0x5dbd('0x30')]['fields']));_0x50d5fa[_0x5dbd('0x35')]=_0x50d5fa[_0x5dbd('0x35')]['length']?_0x50d5fa[_0x5dbd('0x35')]:_0x27a8d5[_0x5dbd('0x34')];if(_0x292c0d[_0x5dbd('0x30')][_0x5dbd('0x45')]){_0x50d5fa[_0x5dbd('0x3f')]=[{'all':!![]}];}_0x50d5fa=_[_0x5dbd('0x3c')]({},_0x50d5fa,_0x292c0d['options']);return db[_0x5dbd('0x2d')][_0x5dbd('0x46')](_0x50d5fa)[_0x5dbd('0x28')](handleEntityNotFound(_0x3e23bf,null))['then'](respondWithResult(_0x3e23bf,null))[_0x5dbd('0x42')](handleError(_0x3e23bf,null));};exports[_0x5dbd('0x47')]=function(_0x1ffb9b,_0x1e9cf6){return db[_0x5dbd('0x2d')][_0x5dbd('0x47')](_0x1ffb9b[_0x5dbd('0x48')],{})[_0x5dbd('0x28')](respondWithResult(_0x1e9cf6,0xc9))['catch'](handleError(_0x1e9cf6,null));};exports[_0x5dbd('0x26')]=function(_0x4e8baa,_0x2d0802){if(_0x4e8baa[_0x5dbd('0x48')]['id']){delete _0x4e8baa['body']['id'];}return db['ChatInternalMessage'][_0x5dbd('0x46')]({'where':{'id':_0x4e8baa[_0x5dbd('0x43')]['id']}})[_0x5dbd('0x28')](handleEntityNotFound(_0x2d0802,null))['then'](saveUpdates(_0x4e8baa[_0x5dbd('0x48')],null))[_0x5dbd('0x28')](respondWithResult(_0x2d0802,null))['catch'](handleError(_0x2d0802,null));};exports['destroy']=function(_0x27be98,_0xcd67ac){return db[_0x5dbd('0x2d')][_0x5dbd('0x46')]({'where':{'id':_0x27be98[_0x5dbd('0x43')]['id']}})[_0x5dbd('0x28')](handleEntityNotFound(_0xcd67ac,null))['then'](removeEntity(_0xcd67ac,null))[_0x5dbd('0x42')](handleError(_0xcd67ac,null));};exports['describe']=function(_0x55870e,_0x405d9d){return db[_0x5dbd('0x2d')][_0x5dbd('0x49')]()[_0x5dbd('0x28')](respondWithResult(_0x405d9d,null))[_0x5dbd('0x42')](handleError(_0x405d9d,null));};function wrapUser(_0x48a68f){return function(_0x3c46e8){var _0x533990=_0x48a68f['get']({'plain':!![]});_0x533990[_0x5dbd('0x4a')]=[];if(_0x3c46e8){_0x533990['lastMessageAt']=_0x3c46e8[_0x5dbd('0x4b')];_0x533990[_0x5dbd('0x4c')]=_0x3c46e8;}else{_0x533990[_0x5dbd('0x4d')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x533990[_0x5dbd('0x4c')]={};}return _0x533990;};}exports[_0x5dbd('0x4e')]=function(_0x40a6c8,_0x5c4ff4,_0x41c32b){var _0xcad3dd=[];return db[_0x5dbd('0x4f')][_0x5dbd('0x40')]({'where':{'role':['agent',_0x5dbd('0x50'),'user']},'attributes':['id',_0x5dbd('0x51'),_0x5dbd('0x2a'),_0x5dbd('0x52'),_0x5dbd('0x53'),'internal','online','lastLoginAt',_0x5dbd('0x54'),_0x5dbd('0x55')],'order':qs[_0x5dbd('0x38')](_0x5dbd('0x56')),'include':[{'model':db['VoiceQueue'],'as':_0x5dbd('0x57'),'attributes':['id',_0x5dbd('0x2a'),_0x5dbd('0x3d')],'through':{'attributes':[]}}]})[_0x5dbd('0x28')](function(_0x196dbf){if(_0x196dbf){var _0x32cdbf=_0x40a6c8[_0x5dbd('0x58')]['get']({'plain':!![]});if(!_0x32cdbf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32cdbf[_0x5dbd('0x52')]==='user'){return db['UserProfileSection'][_0x5dbd('0x46')]({'where':{'name':_0x5dbd('0x59'),'userProfileId':_0x32cdbf['userProfileId']},'raw':!![]})[_0x5dbd('0x28')](function(_0x1569de){if(_0x1569de){if(_0x1569de[_0x5dbd('0x5a')]===0x0){return db[_0x5dbd('0x5b')]['findAll']({'where':{'sectionId':_0x1569de['id']},'raw':!![]})['then'](function(_0x11c63f){var _0x513b90=[];if(_[_0x5dbd('0x5c')](_0x11c63f)){_0x513b90=_[_0x5dbd('0x3b')](_0x196dbf,function(_0x2dbebf){if(_0x2dbebf[_0x5dbd('0x52')]!=='agent'){return _0x2dbebf;}});return _0x513b90;}else{for(var _0x1503c1=0x0;_0x1503c1<_0x196dbf[_0x5dbd('0x5d')];_0x1503c1++){var _0x42031d=_0x196dbf[_0x1503c1];if(_0x42031d[_0x5dbd('0x52')]===_0x5dbd('0x5e')){var _0x2e72a6=_[_0x5dbd('0x46')](_0x11c63f,function(_0x349669){return _0x349669[_0x5dbd('0x5f')]===_0x42031d['id'];});if(_0x2e72a6)_0x513b90['push'](_0x42031d);}else{_0x513b90[_0x5dbd('0x60')](_0x42031d);}}return _0x513b90;}});}else{return _0x196dbf;}}else{var _0x289eab=_[_0x5dbd('0x3b')](_0x196dbf,function(_0x3b6755){if(_0x3b6755[_0x5dbd('0x52')]!==_0x5dbd('0x5e')){return _0x3b6755;}});return _0x289eab;}});}else{return _0x196dbf;}}})[_0x5dbd('0x28')](function(_0x2d7396){var _0x13258a=[];if(_0x2d7396){_0xcad3dd=_0x2d7396;for(var _0xc545cf=0x0;_0xc545cf<_0x2d7396[_0x5dbd('0x5d')];_0xc545cf+=0x1){_0xcad3dd[_0xc545cf][_0x5dbd('0x4a')]=[];_0x13258a[_0x5dbd('0x60')](db[_0x5dbd('0x2d')][_0x5dbd('0x46')]({'where':{'FromId':[_0x40a6c8['user']['id'],_0x2d7396[_0xc545cf]['id']],'ToId':[_0x40a6c8[_0x5dbd('0x58')]['id'],_0x2d7396[_0xc545cf]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId','read','body'],'order':qs[_0x5dbd('0x38')](_0x5dbd('0x61')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5dbd('0x28')](wrapUser(_0x2d7396[_0xc545cf])));}return BPromise[_0x5dbd('0x62')](_0x13258a);}return[];})[_0x5dbd('0x28')](function(_0xc1b11c){return{'rows':_0xc1b11c,'count':_0xc1b11c[_0x5dbd('0x5d')]};})[_0x5dbd('0x28')](respondWithResult(_0x5c4ff4,null))[_0x5dbd('0x42')](handleError(_0x5c4ff4,null));};
\ No newline at end of file
index 07373e9..16b1cd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc94b=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x10a9d3,_0x3c96f3){var _0x18ca70=function(_0x26299f){while(--_0x26299f){_0x10a9d3['push'](_0x10a9d3['shift']());}};_0x18ca70(++_0x3c96f3);}(_0xc94b,0x17a));var _0xbc94=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xc94b[_0x1d24eb];return _0x1dc576;};'use strict';var EventEmitter=require(_0xbc94('0x0'));var ChatInternalMessage=require(_0xbc94('0x1'))['db'][_0xbc94('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xbc94('0x3')](0x0);var events={'afterCreate':_0xbc94('0x4'),'afterUpdate':'update','afterDestroy':_0xbc94('0x5')};function emitEvent(_0x6f4994){return function(_0x36d687,_0x407291,_0x3d9cae){ChatInternalMessageEvents[_0xbc94('0x6')](_0x6f4994+':'+_0x36d687['id'],_0x36d687);ChatInternalMessageEvents['emit'](_0x6f4994,_0x36d687);_0x3d9cae(null);};}for(var e in events){if(events[_0xbc94('0x7')](e)){var event=events[e];ChatInternalMessage[_0xbc94('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x7461=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','emit'];(function(_0x4db1a6,_0x255276){var _0x2796a8=function(_0x39d010){while(--_0x39d010){_0x4db1a6['push'](_0x4db1a6['shift']());}};_0x2796a8(++_0x255276);}(_0x7461,0xdb));var _0x1746=function(_0x268ad0,_0x50c35b){_0x268ad0=_0x268ad0-0x0;var _0x4619ea=_0x7461[_0x268ad0];return _0x4619ea;};'use strict';var EventEmitter=require(_0x1746('0x0'));var ChatInternalMessage=require(_0x1746('0x1'))['db'][_0x1746('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1746('0x3')](0x0);var events={'afterCreate':_0x1746('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x56c2b8){return function(_0x4aa336,_0x89a445,_0x32106d){ChatInternalMessageEvents[_0x1746('0x5')](_0x56c2b8+':'+_0x4aa336['id'],_0x4aa336);ChatInternalMessageEvents[_0x1746('0x5')](_0x56c2b8,_0x4aa336);_0x32106d(null);};}for(var e in events){if(events[_0x1746('0x6')](e)){var event=events[e];ChatInternalMessage[_0x1746('0x7')](e,emitEvent(event));}}module[_0x1746('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
index de43f67..ec8457b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7970=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_internal_messages','utf8mb4'];(function(_0x218e99,_0x4a364f){var _0x47da41=function(_0x483838){while(--_0x483838){_0x218e99['push'](_0x218e99['shift']());}};_0x47da41(++_0x4a364f);}(_0x7970,0x160));var _0x0797=function(_0x5ef3ad,_0x145000){_0x5ef3ad=_0x5ef3ad-0x0;var _0x171bbb=_0x7970[_0x5ef3ad];return _0x171bbb;};'use strict';var _=require(_0x0797('0x0'));var util=require(_0x0797('0x1'));var logger=require(_0x0797('0x2'))('api');var moment=require(_0x0797('0x3'));var BPromise=require(_0x0797('0x4'));var rp=require(_0x0797('0x5'));var fs=require('fs');var path=require(_0x0797('0x6'));var rimraf=require(_0x0797('0x7'));var config=require(_0x0797('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0x0797('0x9')]=function(_0x4b3f14,_0x16e150){return _0x4b3f14['define']('ChatInternalMessage',attributes,{'tableName':_0x0797('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0797('0xb'),'collate':_0x0797('0xc')});};
\ No newline at end of file
+var _0x096a=['util','api','moment','bluebird','request-promise','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x4f4d5f,_0x6d3210){var _0x51d83e=function(_0x4d439f){while(--_0x4d439f){_0x4f4d5f['push'](_0x4f4d5f['shift']());}};_0x51d83e(++_0x6d3210);}(_0x096a,0x1c7));var _0xa096=function(_0x21dd4e,_0x3270cd){_0x21dd4e=_0x21dd4e-0x0;var _0x3d7fe9=_0x096a[_0x21dd4e];return _0x3d7fe9;};'use strict';var _=require(_0xa096('0x0'));var util=require(_0xa096('0x1'));var logger=require('../../config/logger')(_0xa096('0x2'));var moment=require(_0xa096('0x3'));var BPromise=require(_0xa096('0x4'));var rp=require(_0xa096('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xa096('0x6')]=function(_0x520f00,_0x216860){return _0x520f00[_0xa096('0x7')](_0xa096('0x8'),attributes,{'tableName':_0xa096('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa096('0xa'),'collate':_0xa096('0xb')});};
\ No newline at end of file
index 8b81180..5c515cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2982=['error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','./chatInternalMessage.socket','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x6e38c8,_0x5cae54){var _0x342932=function(_0x374c83){while(--_0x374c83){_0x6e38c8['push'](_0x6e38c8['shift']());}};_0x342932(++_0x5cae54);}(_0x2982,0x8d));var _0x2298=function(_0x40db95,_0x179c51){_0x40db95=_0x40db95-0x0;var _0x1289ab=_0x2982[_0x40db95];return _0x1289ab;};'use strict';var _=require(_0x2298('0x0'));var util=require('util');var moment=require(_0x2298('0x1'));var BPromise=require(_0x2298('0x2'));var rs=require(_0x2298('0x3'));var fs=require('fs');var Redis=require(_0x2298('0x4'));var db=require(_0x2298('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2298('0x6'))(_0x2298('0x7'));var config=require('../../config/environment');var jayson=require(_0x2298('0x8'));var client=jayson[_0x2298('0x9')][_0x2298('0xa')]({'port':0x232a});config['redis']=_[_0x2298('0xb')](config[_0x2298('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2298('0xd'))['register'](socket);function respondWithRpcPromise(_0x1b34b2,_0xf6e6d9,_0x123b9e){return new BPromise(function(_0x493b7b,_0x11a3f9){return client[_0x2298('0xe')](_0x1b34b2,_0x123b9e)[_0x2298('0xf')](function(_0x1636ab){logger[_0x2298('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6e6d9,_0x2298('0x11'));logger[_0x2298('0x12')](_0x2298('0x13'),_0xf6e6d9,_0x2298('0x11'),JSON[_0x2298('0x14')](_0x1636ab));if(_0x1636ab[_0x2298('0x15')]){if(_0x1636ab['error'][_0x2298('0x16')]===0x1f4){logger['error'](_0x2298('0x17'),_0xf6e6d9,_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);return _0x11a3f9(_0x1636ab['error'][_0x2298('0x18')]);}logger[_0x2298('0x15')](_0x2298('0x17'),_0xf6e6d9,_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);return _0x493b7b(_0x1636ab[_0x2298('0x15')][_0x2298('0x18')]);}else{logger[_0x2298('0x10')](_0x2298('0x17'),_0xf6e6d9,_0x2298('0x11'));_0x493b7b(_0x1636ab[_0x2298('0x19')][_0x2298('0x18')]);}})[_0x2298('0x1a')](function(_0x453862){logger[_0x2298('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0xf6e6d9,_0x453862);_0x11a3f9(_0x453862);});});}
\ No newline at end of file
+var _0x3677=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0x3677,0x1e9));var _0x7367=function(_0x225634,_0x2822e2){_0x225634=_0x225634-0x0;var _0x2f3c62=_0x3677[_0x225634];return _0x2f3c62;};'use strict';var _=require(_0x7367('0x0'));var util=require(_0x7367('0x1'));var moment=require(_0x7367('0x2'));var BPromise=require(_0x7367('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7367('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7367('0x5'));var logger=require(_0x7367('0x6'))(_0x7367('0x7'));var config=require(_0x7367('0x8'));var jayson=require(_0x7367('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x7367('0xa')](config[_0x7367('0xb')],{'host':_0x7367('0xc'),'port':0x18eb});var socket=require(_0x7367('0xd'))(new Redis(config['redis']));require(_0x7367('0xe'))[_0x7367('0xf')](socket);function respondWithRpcPromise(_0x25a66a,_0x529514,_0x1b2beb){return new BPromise(function(_0x481ad0,_0x558568){return client[_0x7367('0x10')](_0x25a66a,_0x1b2beb)[_0x7367('0x11')](function(_0x4ee8ce){logger[_0x7367('0x12')](_0x7367('0x13'),_0x529514,_0x7367('0x14'));logger[_0x7367('0x15')](_0x7367('0x16'),_0x529514,_0x7367('0x14'),JSON[_0x7367('0x17')](_0x4ee8ce));if(_0x4ee8ce[_0x7367('0x18')]){if(_0x4ee8ce[_0x7367('0x18')]['code']===0x1f4){logger[_0x7367('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x529514,_0x4ee8ce['error'][_0x7367('0x19')]);return _0x558568(_0x4ee8ce[_0x7367('0x18')][_0x7367('0x19')]);}logger['error'](_0x7367('0x13'),_0x529514,_0x4ee8ce[_0x7367('0x18')][_0x7367('0x19')]);return _0x481ad0(_0x4ee8ce[_0x7367('0x18')][_0x7367('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x529514,_0x7367('0x14'));_0x481ad0(_0x4ee8ce[_0x7367('0x1a')][_0x7367('0x19')]);}})[_0x7367('0x1b')](function(_0xe743f9){logger[_0x7367('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x529514,_0xe743f9);_0x558568(_0xe743f9);});});}
\ No newline at end of file
index b1be4b8..b874501 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7183=['chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0x3bd2c8,_0x395b96){var _0x25374f=function(_0x5ee528){while(--_0x5ee528){_0x3bd2c8['push'](_0x3bd2c8['shift']());}};_0x25374f(++_0x395b96);}(_0x7183,0x173));var _0x3718=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x7183[_0x11005e];return _0x29338f;};'use strict';var ChatInternalMessageEvents=require(_0x3718('0x0'));var events=[_0x3718('0x1'),'remove',_0x3718('0x2')];function createListener(_0x1dbf47,_0x55937c){return function(_0x4dd442){_0x55937c[_0x3718('0x3')](_0x1dbf47,_0x4dd442);};}function removeListener(_0x2f8cb9,_0xbecaca){return function(){ChatInternalMessageEvents['removeListener'](_0x2f8cb9,_0xbecaca);};}exports['register']=function(_0x4130db){for(var _0x1d5beb=0x0,_0x5d09c9=events['length'];_0x1d5beb<_0x5d09c9;_0x1d5beb++){var _0x3641d8=events[_0x1d5beb];var _0x301fb5=createListener(_0x3718('0x4')+_0x3641d8,_0x4130db);ChatInternalMessageEvents['on'](_0x3641d8,_0x301fb5);}};
\ No newline at end of file
+var _0x5090=['update','removeListener','register','length','./chatInternalMessage.events','save','remove'];(function(_0x1db3b3,_0x545d3f){var _0x29651e=function(_0x381433){while(--_0x381433){_0x1db3b3['push'](_0x1db3b3['shift']());}};_0x29651e(++_0x545d3f);}(_0x5090,0x1a8));var _0x0509=function(_0x17643a,_0x22ee27){_0x17643a=_0x17643a-0x0;var _0x29777a=_0x5090[_0x17643a];return _0x29777a;};'use strict';var ChatInternalMessageEvents=require(_0x0509('0x0'));var events=[_0x0509('0x1'),_0x0509('0x2'),_0x0509('0x3')];function createListener(_0x427b95,_0x37c6f6){return function(_0x5c2fdd){_0x37c6f6['emit'](_0x427b95,_0x5c2fdd);};}function removeListener(_0x1dd390,_0x1930b3){return function(){ChatInternalMessageEvents[_0x0509('0x4')](_0x1dd390,_0x1930b3);};}exports[_0x0509('0x5')]=function(_0x5b1b41){for(var _0x4e0f1c=0x0,_0x1e18f6=events[_0x0509('0x6')];_0x4e0f1c<_0x1e18f6;_0x4e0f1c++){var _0x3bb358=events[_0x4e0f1c];var _0x366a9f=createListener('chatInternalMessage:'+_0x3bb358,_0x5b1b41);ChatInternalMessageEvents['on'](_0x3bb358,_0x366a9f);}};
\ No newline at end of file
index a77eed4..45afda8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbff7=['../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','getUsers','/:id','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xbff7,0x159));var _0x7bff=function(_0x513c7f,_0x5da353){_0x513c7f=_0x513c7f-0x0;var _0x5720c7=_0xbff7[_0x513c7f];return _0x5720c7;};'use strict';var multer=require('multer');var util=require(_0x7bff('0x0'));var path=require(_0x7bff('0x1'));var timeout=require(_0x7bff('0x2'));var express=require(_0x7bff('0x3'));var router=express[_0x7bff('0x4')]();var fs_extra=require(_0x7bff('0x5'));var auth=require(_0x7bff('0x6'));var interaction=require(_0x7bff('0x7'));var config=require(_0x7bff('0x8'));var controller=require(_0x7bff('0x9'));router[_0x7bff('0xa')]('/',auth[_0x7bff('0xb')](),controller[_0x7bff('0xc')]);router['get'](_0x7bff('0xd'),auth[_0x7bff('0xb')](),controller[_0x7bff('0xe')]);router[_0x7bff('0xa')]('/users',auth['isAuthenticated'](),controller[_0x7bff('0xf')]);router[_0x7bff('0xa')](_0x7bff('0x10'),auth[_0x7bff('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x7bff('0x11')]);router[_0x7bff('0x12')]('/:id',controller[_0x7bff('0x13')]);router['delete'](_0x7bff('0x10'),auth[_0x7bff('0xb')](),controller[_0x7bff('0x14')]);module[_0x7bff('0x15')]=router;
\ No newline at end of file
+var _0xf860=['describe','/users','getUsers','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xf860,0x16a));var _0x0f86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf860[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0f86('0x0'));var timeout=require(_0x0f86('0x1'));var express=require(_0x0f86('0x2'));var router=express[_0x0f86('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0f86('0x4'));var interaction=require(_0x0f86('0x5'));var config=require(_0x0f86('0x6'));var controller=require(_0x0f86('0x7'));router[_0x0f86('0x8')]('/',auth[_0x0f86('0x9')](),controller[_0x0f86('0xa')]);router[_0x0f86('0x8')](_0x0f86('0xb'),auth['isAuthenticated'](),controller[_0x0f86('0xc')]);router[_0x0f86('0x8')](_0x0f86('0xd'),auth[_0x0f86('0x9')](),controller[_0x0f86('0xe')]);router['get']('/:id',auth[_0x0f86('0x9')](),controller['show']);router[_0x0f86('0xf')]('/',auth[_0x0f86('0x9')](),controller['create']);router[_0x0f86('0x10')](_0x0f86('0x11'),controller[_0x0f86('0x12')]);router[_0x0f86('0x13')](_0x0f86('0x11'),auth['isAuthenticated'](),controller[_0x0f86('0x14')]);module[_0x0f86('0x15')]=router;
\ No newline at end of file
index ddb3e4c..ba9c96a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4817f9,_0x4070d1){_0x4817f9=_0x4817f9-0x0;var _0x2dcfa6=_0x0b0e[_0x4817f9];return _0x2dcfa6;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0b0('0x3')]('in',_0xe0b0('0x4')),'defaultValue':_0xe0b0('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe0b0('0x5')]},'providerName':{'type':Sequelize[_0xe0b0('0x6')]},'providerResponse':{'type':Sequelize[_0xe0b0('0x1')]}};
\ No newline at end of file
+var _0xf894=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf894,0xfd));var _0x4f89=function(_0x544f45,_0x445641){_0x544f45=_0x544f45-0x0;var _0x78ceec=_0xf894[_0x544f45];return _0x78ceec;};'use strict';var Sequelize=require(_0x4f89('0x0'));module[_0x4f89('0x1')]={'body':{'type':Sequelize[_0x4f89('0x2')](_0x4f89('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4f89('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x4f89('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4f89('0x5')]('in',_0x4f89('0x6')),'defaultValue':_0x4f89('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4f89('0x7')]},'providerName':{'type':Sequelize[_0x4f89('0x8')]},'providerResponse':{'type':Sequelize[_0x4f89('0x2')]}};
\ No newline at end of file
index 29dd6a3..c542b84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a58=['acceptmessage','parse','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','contact','interface','rejectmessage','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','request\x20sent','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','ChatMessage','fieldName','type','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows','show','keys','rawAttributes','merge','find','create','body','params','describe','chat-interactions','accept','readAt','format','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager'];(function(_0x49d4f0,_0x415675){var _0x32dc99=function(_0x184fb8){while(--_0x184fb8){_0x49d4f0['push'](_0x49d4f0['shift']());}};_0x32dc99(++_0x415675);}(_0x9a58,0x93));var _0x89a5=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x9a58[_0x2fbd0e];return _0x481c9f;};'use strict';var emlformat=require(_0x89a5('0x0'));var rimraf=require(_0x89a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x89a5('0x2'));var moment=require(_0x89a5('0x3'));var BPromise=require(_0x89a5('0x4'));var Mustache=require(_0x89a5('0x5'));var util=require('util');var path=require(_0x89a5('0x6'));var sox=require(_0x89a5('0x7'));var csv=require(_0x89a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x89a5('0x9'));var _=require(_0x89a5('0xa'));var squel=require(_0x89a5('0xb'));var crypto=require('crypto');var jsforce=require(_0x89a5('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x89a5('0xd'));var Papa=require(_0x89a5('0xe'));var Redis=require(_0x89a5('0xf'));var authService=require(_0x89a5('0x10'));var qs=require(_0x89a5('0x11'));var as=require(_0x89a5('0x12'));var hardwareService=require(_0x89a5('0x13'));var logger=require(_0x89a5('0x14'))(_0x89a5('0x15'));var utils=require(_0x89a5('0x16'));var config=require(_0x89a5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x89a5('0x18'))['db'];config[_0x89a5('0x19')]=_[_0x89a5('0x1a')](config[_0x89a5('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x89a5('0x19')]));require(_0x89a5('0x1b'))[_0x89a5('0x1c')](socket);var jayson=require(_0x89a5('0x1d'));var client=jayson[_0x89a5('0x1e')][_0x89a5('0x1f')]({'port':0x232c});var client9002=jayson[_0x89a5('0x1e')][_0x89a5('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xf04207,_0x1d4e16,_0x20dd81,_0x623859){return new BPromise(function(_0xcdae26,_0x388801){var _0x11c6f9=_0x623859||client;return _0x11c6f9[_0x89a5('0x20')](_0xf04207,_0x20dd81)[_0x89a5('0x21')](function(_0x572790){logger[_0x89a5('0x22')]('ChatMessage,\x20%s,\x20%s',_0x1d4e16,'request\x20sent');logger[_0x89a5('0x23')](_0x89a5('0x24'),_0x1d4e16,'request\x20sent',JSON[_0x89a5('0x25')](_0x572790));if(_0x572790[_0x89a5('0x26')]){if(_0x572790[_0x89a5('0x26')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1d4e16,_0x572790[_0x89a5('0x26')][_0x89a5('0x27')]);return _0x388801(_0x572790[_0x89a5('0x26')][_0x89a5('0x27')]);}logger[_0x89a5('0x26')](_0x89a5('0x28'),_0x1d4e16,_0x572790[_0x89a5('0x26')][_0x89a5('0x27')]);return _0xcdae26(_0x572790[_0x89a5('0x26')][_0x89a5('0x27')]);}else{logger['info'](_0x89a5('0x28'),_0x1d4e16,_0x89a5('0x29'));_0xcdae26(_0x572790[_0x89a5('0x2a')][_0x89a5('0x27')]);}})[_0x89a5('0x2b')](function(_0x162425){logger[_0x89a5('0x26')](_0x89a5('0x28'),_0x1d4e16,_0x162425);_0x388801(_0x162425);});});}function respondWithStatusCode(_0x5be2ab,_0x5ee5ac){_0x5ee5ac=_0x5ee5ac||0xcc;return function(_0x281346){if(_0x281346){return _0x5be2ab[_0x89a5('0x2c')](_0x5ee5ac);}return _0x5be2ab[_0x89a5('0x2d')](_0x5ee5ac)[_0x89a5('0x2e')]();};}function respondWithResult(_0x514d6a,_0x44dd5f){_0x44dd5f=_0x44dd5f||0xc8;return function(_0x44da78){if(_0x44da78){return _0x514d6a[_0x89a5('0x2d')](_0x44dd5f)['json'](_0x44da78);}};}function respondWithFilteredResult(_0x353a8b,_0x3b0ee7){return function(_0x111885){if(_0x111885){var _0x180019=typeof _0x3b0ee7[_0x89a5('0x2f')]===_0x89a5('0x30')&&typeof _0x3b0ee7[_0x89a5('0x31')]===_0x89a5('0x30');var _0x40735a=_0x111885[_0x89a5('0x32')];var _0x39bbdc=_0x180019?0x0:_0x3b0ee7[_0x89a5('0x2f')];var _0x209150=_0x180019?_0x111885[_0x89a5('0x32')]:_0x3b0ee7[_0x89a5('0x2f')]+_0x3b0ee7[_0x89a5('0x31')];var _0x319f32;if(_0x209150>=_0x40735a){_0x209150=_0x40735a;_0x319f32=0xc8;}else{_0x319f32=0xce;}_0x353a8b['status'](_0x319f32);return _0x353a8b[_0x89a5('0x33')](_0x89a5('0x34'),_0x39bbdc+'-'+_0x209150+'/'+_0x40735a)[_0x89a5('0x35')](_0x111885);}return null;};}function patchUpdates(_0x3d5011){return function(_0x1cb3bd){try{jsonpatch[_0x89a5('0x36')](_0x1cb3bd,_0x3d5011,!![]);}catch(_0x351330){return BPromise[_0x89a5('0x37')](_0x351330);}return _0x1cb3bd[_0x89a5('0x38')]();};}function saveUpdates(_0x1a5a8c,_0xd5ba1){return function(_0x8e549){if(_0x8e549){return _0x8e549[_0x89a5('0x39')](_0x1a5a8c)[_0x89a5('0x21')](function(_0x5b2bda){return _0x5b2bda;});}return null;};}function removeEntity(_0x3e3e79,_0x332179){return function(_0x37b178){if(_0x37b178){return _0x37b178[_0x89a5('0x3a')]()[_0x89a5('0x21')](function(){_0x3e3e79['status'](0xcc)[_0x89a5('0x2e')]();});}};}function handleEntityNotFound(_0x4223ce,_0x1a9b6d){return function(_0x25f5b8){if(!_0x25f5b8){_0x4223ce[_0x89a5('0x2c')](0x194);}return _0x25f5b8;};}function handleError(_0x5afd86,_0x2e7ba2){_0x2e7ba2=_0x2e7ba2||0x1f4;return function(_0x37fd31){logger[_0x89a5('0x26')](_0x37fd31[_0x89a5('0x3b')]);if(_0x37fd31[_0x89a5('0x3c')]){delete _0x37fd31['name'];}_0x5afd86['status'](_0x2e7ba2)[_0x89a5('0x3d')](_0x37fd31);};}exports['index']=function(_0x2b9765,_0x3b8c87){var _0x1a678d={},_0x51e383={},_0x217d15={'count':0x0,'rows':[]};var _0x5539c4=_['map'](db[_0x89a5('0x3e')]['rawAttributes'],function(_0x1b6679){return{'name':_0x1b6679[_0x89a5('0x3f')],'type':_0x1b6679[_0x89a5('0x40')]['key']};});_0x51e383['model']=_[_0x89a5('0x41')](_0x5539c4,_0x89a5('0x3c'));_0x51e383[_0x89a5('0x42')]=_['keys'](_0x2b9765[_0x89a5('0x42')]);_0x51e383['filters']=_[_0x89a5('0x43')](_0x51e383[_0x89a5('0x44')],_0x51e383['query']);_0x1a678d['attributes']=_[_0x89a5('0x43')](_0x51e383[_0x89a5('0x44')],qs[_0x89a5('0x45')](_0x2b9765[_0x89a5('0x42')][_0x89a5('0x45')]));_0x1a678d[_0x89a5('0x46')]=_0x1a678d[_0x89a5('0x46')][_0x89a5('0x47')]?_0x1a678d[_0x89a5('0x46')]:_0x51e383[_0x89a5('0x44')];if(!_0x2b9765['query'][_0x89a5('0x48')](_0x89a5('0x49'))){_0x1a678d[_0x89a5('0x31')]=qs[_0x89a5('0x31')](_0x2b9765[_0x89a5('0x42')]['limit']);_0x1a678d[_0x89a5('0x2f')]=qs[_0x89a5('0x2f')](_0x2b9765['query'][_0x89a5('0x2f')]);}_0x1a678d[_0x89a5('0x4a')]=qs[_0x89a5('0x4b')](_0x2b9765[_0x89a5('0x42')][_0x89a5('0x4b')]);_0x1a678d[_0x89a5('0x4c')]=qs[_0x89a5('0x4d')](_[_0x89a5('0x4e')](_0x2b9765[_0x89a5('0x42')],_0x51e383[_0x89a5('0x4d')]),_0x5539c4);if(_0x2b9765[_0x89a5('0x42')]['filter']){_0x1a678d[_0x89a5('0x4c')]=_['merge'](_0x1a678d[_0x89a5('0x4c')],{'$or':_['map'](_0x5539c4,function(_0x45a123){if(_0x45a123['type']!=='VIRTUAL'){var _0x21eed0={};_0x21eed0[_0x45a123[_0x89a5('0x3c')]]={'$like':'%'+_0x2b9765[_0x89a5('0x42')][_0x89a5('0x4f')]+'%'};return _0x21eed0;}})});}_0x1a678d=_['merge']({},_0x1a678d,_0x2b9765[_0x89a5('0x50')]);var _0x1f70ee={'where':_0x1a678d[_0x89a5('0x4c')]};return db[_0x89a5('0x3e')]['count'](_0x1f70ee)[_0x89a5('0x21')](function(_0x57a5be){_0x217d15[_0x89a5('0x32')]=_0x57a5be;if(_0x2b9765[_0x89a5('0x42')][_0x89a5('0x51')]){_0x1a678d[_0x89a5('0x52')]=[{'all':!![]}];}return db[_0x89a5('0x3e')][_0x89a5('0x53')](_0x1a678d);})[_0x89a5('0x21')](function(_0x48b955){_0x217d15[_0x89a5('0x54')]=_0x48b955;return _0x217d15;})[_0x89a5('0x21')](respondWithFilteredResult(_0x3b8c87,_0x1a678d))[_0x89a5('0x2b')](handleError(_0x3b8c87,null));};exports[_0x89a5('0x55')]=function(_0x20e24a,_0x1389db){var _0x7537d={'raw':!![],'where':{'id':_0x20e24a['params']['id']}},_0x238cd5={};_0x238cd5[_0x89a5('0x44')]=_[_0x89a5('0x56')](db[_0x89a5('0x3e')][_0x89a5('0x57')]);_0x238cd5[_0x89a5('0x42')]=_['keys'](_0x20e24a[_0x89a5('0x42')]);_0x238cd5[_0x89a5('0x4d')]=_[_0x89a5('0x43')](_0x238cd5[_0x89a5('0x44')],_0x238cd5[_0x89a5('0x42')]);_0x7537d['attributes']=_[_0x89a5('0x43')](_0x238cd5[_0x89a5('0x44')],qs[_0x89a5('0x45')](_0x20e24a[_0x89a5('0x42')][_0x89a5('0x45')]));_0x7537d[_0x89a5('0x46')]=_0x7537d[_0x89a5('0x46')][_0x89a5('0x47')]?_0x7537d[_0x89a5('0x46')]:_0x238cd5[_0x89a5('0x44')];if(_0x20e24a[_0x89a5('0x42')]['includeAll']){_0x7537d[_0x89a5('0x52')]=[{'all':!![]}];}_0x7537d=_[_0x89a5('0x58')]({},_0x7537d,_0x20e24a['options']);return db['ChatMessage'][_0x89a5('0x59')](_0x7537d)[_0x89a5('0x21')](handleEntityNotFound(_0x1389db,null))[_0x89a5('0x21')](respondWithResult(_0x1389db,null))['catch'](handleError(_0x1389db,null));};exports[_0x89a5('0x5a')]=function(_0x468813,_0x289465){return db[_0x89a5('0x3e')][_0x89a5('0x5a')](_0x468813[_0x89a5('0x5b')],{})[_0x89a5('0x21')](respondWithResult(_0x289465,0xc9))[_0x89a5('0x2b')](handleError(_0x289465,null));};exports[_0x89a5('0x39')]=function(_0x123576,_0x4e93ab){if(_0x123576[_0x89a5('0x5b')]['id']){delete _0x123576[_0x89a5('0x5b')]['id'];}return db[_0x89a5('0x3e')][_0x89a5('0x59')]({'where':{'id':_0x123576[_0x89a5('0x5c')]['id']}})[_0x89a5('0x21')](handleEntityNotFound(_0x4e93ab,null))['then'](saveUpdates(_0x123576[_0x89a5('0x5b')],null))[_0x89a5('0x21')](respondWithResult(_0x4e93ab,null))[_0x89a5('0x2b')](handleError(_0x4e93ab,null));};exports[_0x89a5('0x3a')]=function(_0x24a403,_0x58b9c7){return db[_0x89a5('0x3e')][_0x89a5('0x59')]({'where':{'id':_0x24a403[_0x89a5('0x5c')]['id']}})['then'](handleEntityNotFound(_0x58b9c7,null))[_0x89a5('0x21')](removeEntity(_0x58b9c7,null))['catch'](handleError(_0x58b9c7,null));};exports['describe']=function(_0x2c0b79,_0x50821d){return db[_0x89a5('0x3e')][_0x89a5('0x5d')]()['then'](respondWithResult(_0x50821d,null))[_0x89a5('0x2b')](handleError(_0x50821d,null));};var interaction_log=require(_0x89a5('0x14'))(_0x89a5('0x5e'));exports[_0x89a5('0x5f')]=function(_0x6b8106,_0x361eaa,_0x3ec721){var _0x4219a8={'agent':{},'channel':'chat'};if(_0x6b8106[_0x89a5('0x5b')]['id']){delete _0x6b8106['body']['id'];}_0x6b8106[_0x89a5('0x5b')]['read']=!![];_0x6b8106['body'][_0x89a5('0x60')]=moment()[_0x89a5('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x6b8106[_0x89a5('0x5b')][_0x89a5('0x62')]=_0x6b8106[_0x89a5('0x5b')][_0x89a5('0x62')]||_0x6b8106['user']['id'];_0x4219a8[_0x89a5('0x63')]['id']=_0x6b8106[_0x89a5('0x5b')][_0x89a5('0x62')];return db[_0x89a5('0x3e')]['find']({'where':{'id':_0x6b8106['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x361eaa,null))['then'](saveUpdates(_0x6b8106[_0x89a5('0x5b')],null))[_0x89a5('0x21')](function(_0x373d53){if(_0x373d53){_0x4219a8[_0x89a5('0x27')]=_0x373d53[_0x89a5('0x64')]({'plain':!![]});return db[_0x89a5('0x65')][_0x89a5('0x59')]({'where':{'id':_0x373d53[_0x89a5('0x66')]}});}return null;})[_0x89a5('0x21')](handleEntityNotFound(_0x361eaa,null))[_0x89a5('0x21')](function(_0x238d41){if(_0x238d41){return _0x238d41[_0x89a5('0x39')]({'UserId':_0x6b8106['body'][_0x89a5('0x62')],'read1stAt':_[_0x89a5('0x67')](_0x238d41[_0x89a5('0x68')])?moment()[_0x89a5('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x89a5('0x21')](function(_0x67c489){if(_0x67c489){_0x4219a8['interaction']=_0x67c489[_0x89a5('0x64')]({'plain':!![]});interaction_log[_0x89a5('0x22')](_0x89a5('0x69'),_0x6b8106[_0x89a5('0x6a')]['id'],_0x6b8106[_0x89a5('0x6a')]['name'],_0x6b8106[_0x89a5('0x6a')][_0x89a5('0x6b')],_0x4219a8[_0x89a5('0x6c')]['id'],_0x6b8106[_0x89a5('0x5b')]?JSON[_0x89a5('0x25')](_0x6b8106[_0x89a5('0x5b')]):_0x89a5('0x6d'));return respondWithRpcPromise(_0x89a5('0x6e'),_0x89a5('0x6f'),_0x4219a8);}return null;})['then'](function(_0x25068e){var _0x25fbad=_0x89a5('0x70')+_0x25068e['message'][_0x89a5('0x71')];return db[_0x89a5('0x72')][_0x89a5('0x42')](_0x25fbad,{'type':db['Sequelize'][_0x89a5('0x73')][_0x89a5('0x74')],'raw':!![]})[_0x89a5('0x21')](function(_0x1b1342){return _0x1b1342;});})['then'](function(_0x4a0733){if(_0x4a0733){_0x4219a8[_0x89a5('0x27')]['contact']=_0x4a0733[0x0];if(!_0x6b8106[_0x89a5('0x5b')][_0x89a5('0x62')])return;return db[_0x89a5('0x75')][_0x89a5('0x59')]({'where':{'id':_0x6b8106[_0x89a5('0x5b')][_0x89a5('0x62')],'role':_0x89a5('0x63')},'attributes':['id','name',_0x89a5('0x76'),_0x89a5('0x77'),_0x89a5('0x78')],'raw':!![]});}return null;})['then'](function(_0x3842ac){if(!_0x3842ac)return null;_0x4219a8[_0x89a5('0x27')][_0x89a5('0x63')]=_0x3842ac;return _0x4219a8;})[_0x89a5('0x21')](function(_0x6e4323){if(_0x6e4323){if(_0x6b8106['body'][_0x89a5('0x79')]){_0x4219a8[_0x89a5('0x27')]['interface']=util[_0x89a5('0x61')](_0x89a5('0x7a'),_0x6b8106[_0x89a5('0x6a')][_0x89a5('0x3c')]);_0x4219a8[_0x89a5('0x27')]['channel']=_0x4219a8[_0x89a5('0x7b')];_0x4219a8[_0x89a5('0x27')][_0x89a5('0x7c')]=_0x4219a8['channel'];_0x4219a8[_0x89a5('0x27')][_0x89a5('0x7d')]=_0x89a5('0x5f');return respondWithRpcPromise(_0x89a5('0x7e'),_0x89a5('0x7e'),{'event':_0x89a5('0x7f'),'message':_[_0x89a5('0x58')](_0x4219a8['message'],JSON[_0x89a5('0x80')](_0x4219a8[_0x89a5('0x6c')][_0x89a5('0x81')]))},client9002)[_0x89a5('0x21')](function(){return _0x4219a8;});}return _0x4219a8;}return null;})[_0x89a5('0x21')](respondWithResult(_0x361eaa,null))[_0x89a5('0x2b')](handleError(_0x361eaa,null));};var interaction_log=require(_0x89a5('0x14'))(_0x89a5('0x5e'));exports[_0x89a5('0x37')]=function(_0x23ed99,_0x411823,_0x1ba3f3){var _0xf1b7a7={'agent':{},'channel':_0x89a5('0x82')};if(_0x23ed99[_0x89a5('0x5b')]['id']){delete _0x23ed99[_0x89a5('0x5b')]['id'];}_0x23ed99[_0x89a5('0x5b')][_0x89a5('0x62')]=_0x23ed99[_0x89a5('0x5b')][_0x89a5('0x62')]||_0x23ed99['user']['id'];_0xf1b7a7[_0x89a5('0x63')]['id']=_0x23ed99['body'][_0x89a5('0x62')];return db[_0x89a5('0x3e')]['find']({'where':{'id':_0x23ed99[_0x89a5('0x5c')]['id'],'UserId':null}})[_0x89a5('0x21')](handleEntityNotFound(_0x411823,null))[_0x89a5('0x21')](function(_0x3742b2){if(_0x3742b2){_0xf1b7a7[_0x89a5('0x27')]=_0x3742b2[_0x89a5('0x64')]({'plain':!![]});return db[_0x89a5('0x65')]['find']({'where':{'id':_0x3742b2[_0x89a5('0x66')]}});}return null;})[_0x89a5('0x21')](handleEntityNotFound(_0x411823,null))[_0x89a5('0x21')](function(_0x4d4ea2){if(_0x4d4ea2){_0xf1b7a7[_0x89a5('0x6c')]=_0x4d4ea2['get']({'plain':!![]});interaction_log[_0x89a5('0x22')](_0x89a5('0x83'),_0x23ed99[_0x89a5('0x6a')]['id'],_0x23ed99[_0x89a5('0x6a')][_0x89a5('0x3c')],_0x23ed99[_0x89a5('0x6a')][_0x89a5('0x6b')],_0xf1b7a7[_0x89a5('0x6c')]['id'],_0x23ed99['body']?JSON[_0x89a5('0x25')](_0x23ed99['body']):_0x89a5('0x6d'));return respondWithRpcPromise(_0x89a5('0x84'),'rejectMessage',_0xf1b7a7);}return null;})[_0x89a5('0x21')](function(_0x5856c2){var _0x2bb084=_0x89a5('0x70')+_0x5856c2[_0x89a5('0x27')]['ContactId'];return db['sequelize'][_0x89a5('0x42')](_0x2bb084,{'type':db[_0x89a5('0x85')][_0x89a5('0x73')][_0x89a5('0x74')],'raw':!![]})['then'](function(_0x11ecb1){return _0x11ecb1;});})[_0x89a5('0x21')](function(_0x3f2da0){if(_0x3f2da0){_0xf1b7a7[_0x89a5('0x27')][_0x89a5('0x86')]=_0x3f2da0[0x0];if(!_0x23ed99[_0x89a5('0x5b')]['UserId'])return;return db[_0x89a5('0x75')]['find']({'where':{'id':_0x23ed99[_0x89a5('0x5b')][_0x89a5('0x62')],'role':'agent'},'attributes':['id','name','fullname',_0x89a5('0x77'),_0x89a5('0x78')],'raw':!![]});}return null;})[_0x89a5('0x21')](function(_0x8d0604){if(!_0x8d0604)return null;_0xf1b7a7[_0x89a5('0x27')][_0x89a5('0x63')]=_0x8d0604;return _0xf1b7a7;})['then'](function(_0x56036d){if(_0x56036d){_0x56036d['message'][_0x89a5('0x87')]=util[_0x89a5('0x61')]('SIP/%s',_0x23ed99[_0x89a5('0x6a')]['name']);_0x56036d['message'][_0x89a5('0x7b')]=_0xf1b7a7[_0x89a5('0x7b')];_0x56036d[_0x89a5('0x27')]['motionChannel']=_0xf1b7a7[_0x89a5('0x7b')];_0x56036d[_0x89a5('0x27')][_0x89a5('0x7d')]=_0x89a5('0x37');respondWithRpcPromise(_0x89a5('0x7e'),_0x89a5('0x7e'),{'event':_0x89a5('0x88'),'message':_['merge'](_0xf1b7a7[_0x89a5('0x27')],JSON[_0x89a5('0x80')](_0xf1b7a7['interaction'][_0x89a5('0x81')]))},client9002);return _0xf1b7a7;}return null;})[_0x89a5('0x21')](respondWithResult(_0x411823,null))[_0x89a5('0x2b')](handleError(_0x411823,null));};
\ No newline at end of file
+var _0x9a6c=['formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','internal','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','count','offset','Content-Range','apply','reject','destroy','end','stack','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','ChatMessage','includeAll','include','findAll','rows','params','length','options','find','create','body','update','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse'];(function(_0x474f93,_0x131bd2){var _0x4ad7d1=function(_0x29c203){while(--_0x29c203){_0x474f93['push'](_0x474f93['shift']());}};_0x4ad7d1(++_0x131bd2);}(_0x9a6c,0x8e));var _0xc9a6=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x9a6c[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0xc9a6('0x0'));var rimraf=require(_0xc9a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9a6('0x2'));var rp=require('request-promise');var moment=require(_0xc9a6('0x3'));var BPromise=require(_0xc9a6('0x4'));var Mustache=require(_0xc9a6('0x5'));var util=require(_0xc9a6('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc9a6('0x7'));var ejs=require(_0xc9a6('0x8'));var fs=require('fs');var fs_extra=require(_0xc9a6('0x9'));var _=require(_0xc9a6('0xa'));var squel=require(_0xc9a6('0xb'));var crypto=require(_0xc9a6('0xc'));var jsforce=require(_0xc9a6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc9a6('0x7'));var querystring=require(_0xc9a6('0xe'));var Papa=require(_0xc9a6('0xf'));var Redis=require(_0xc9a6('0x10'));var authService=require(_0xc9a6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc9a6('0x12'));var hardwareService=require(_0xc9a6('0x13'));var logger=require(_0xc9a6('0x14'))(_0xc9a6('0x15'));var utils=require(_0xc9a6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc9a6('0x17'));var db=require(_0xc9a6('0x18'))['db'];config[_0xc9a6('0x19')]=_[_0xc9a6('0x1a')](config[_0xc9a6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xc9a6('0x1b'))(new Redis(config[_0xc9a6('0x19')]));require('./chatMessage.socket')[_0xc9a6('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc9a6('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0xc9a6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x277f48,_0x41bfc8,_0x35a611,_0x3d8ca8){return new BPromise(function(_0x66eaf8,_0x2dc030){var _0x4c34a1=_0x3d8ca8||client;return _0x4c34a1[_0xc9a6('0x1f')](_0x277f48,_0x35a611)[_0xc9a6('0x20')](function(_0x5b3233){logger[_0xc9a6('0x21')](_0xc9a6('0x22'),_0x41bfc8,_0xc9a6('0x23'));logger['debug'](_0xc9a6('0x24'),_0x41bfc8,_0xc9a6('0x23'),JSON[_0xc9a6('0x25')](_0x5b3233));if(_0x5b3233[_0xc9a6('0x26')]){if(_0x5b3233['error'][_0xc9a6('0x27')]===0x1f4){logger['error'](_0xc9a6('0x22'),_0x41bfc8,_0x5b3233[_0xc9a6('0x26')]['message']);return _0x2dc030(_0x5b3233[_0xc9a6('0x26')][_0xc9a6('0x28')]);}logger[_0xc9a6('0x26')](_0xc9a6('0x22'),_0x41bfc8,_0x5b3233[_0xc9a6('0x26')][_0xc9a6('0x28')]);return _0x66eaf8(_0x5b3233[_0xc9a6('0x26')][_0xc9a6('0x28')]);}else{logger[_0xc9a6('0x21')](_0xc9a6('0x22'),_0x41bfc8,_0xc9a6('0x23'));_0x66eaf8(_0x5b3233[_0xc9a6('0x29')][_0xc9a6('0x28')]);}})[_0xc9a6('0x2a')](function(_0x4701b1){logger[_0xc9a6('0x26')]('ChatMessage,\x20%s,\x20%s',_0x41bfc8,_0x4701b1);_0x2dc030(_0x4701b1);});});}function respondWithStatusCode(_0xe6adf2,_0x40259d){_0x40259d=_0x40259d||0xcc;return function(_0xb88860){if(_0xb88860){return _0xe6adf2[_0xc9a6('0x2b')](_0x40259d);}return _0xe6adf2[_0xc9a6('0x2c')](_0x40259d)['end']();};}function respondWithResult(_0x54c1f3,_0x5e47e9){_0x5e47e9=_0x5e47e9||0xc8;return function(_0x1dcd9a){if(_0x1dcd9a){return _0x54c1f3[_0xc9a6('0x2c')](_0x5e47e9)[_0xc9a6('0x2d')](_0x1dcd9a);}};}function respondWithFilteredResult(_0x8c7820,_0x5320a0){return function(_0xdca2d){if(_0xdca2d){var _0x5f1ecf=typeof _0x5320a0['offset']===_0xc9a6('0x2e')&&typeof _0x5320a0['limit']==='undefined';var _0x3ab4f0=_0xdca2d[_0xc9a6('0x2f')];var _0x1bd5a1=_0x5f1ecf?0x0:_0x5320a0[_0xc9a6('0x30')];var _0x52a9b7=_0x5f1ecf?_0xdca2d['count']:_0x5320a0['offset']+_0x5320a0['limit'];var _0xc5cc2;if(_0x52a9b7>=_0x3ab4f0){_0x52a9b7=_0x3ab4f0;_0xc5cc2=0xc8;}else{_0xc5cc2=0xce;}_0x8c7820[_0xc9a6('0x2c')](_0xc5cc2);return _0x8c7820['set'](_0xc9a6('0x31'),_0x1bd5a1+'-'+_0x52a9b7+'/'+_0x3ab4f0)[_0xc9a6('0x2d')](_0xdca2d);}return null;};}function patchUpdates(_0x593a14){return function(_0x35e696){try{jsonpatch[_0xc9a6('0x32')](_0x35e696,_0x593a14,!![]);}catch(_0x1803c1){return BPromise[_0xc9a6('0x33')](_0x1803c1);}return _0x35e696['save']();};}function saveUpdates(_0x3917af,_0x14e9fe){return function(_0x5a23f7){if(_0x5a23f7){return _0x5a23f7['update'](_0x3917af)[_0xc9a6('0x20')](function(_0x1439d3){return _0x1439d3;});}return null;};}function removeEntity(_0x37f05a,_0x1e638a){return function(_0x32818d){if(_0x32818d){return _0x32818d[_0xc9a6('0x34')]()['then'](function(){_0x37f05a[_0xc9a6('0x2c')](0xcc)[_0xc9a6('0x35')]();});}};}function handleEntityNotFound(_0x3233de,_0x17744b){return function(_0x6806f3){if(!_0x6806f3){_0x3233de[_0xc9a6('0x2b')](0x194);}return _0x6806f3;};}function handleError(_0x28b128,_0x37fc3c){_0x37fc3c=_0x37fc3c||0x1f4;return function(_0x2da60d){logger['error'](_0x2da60d[_0xc9a6('0x36')]);if(_0x2da60d['name']){delete _0x2da60d['name'];}_0x28b128[_0xc9a6('0x2c')](_0x37fc3c)[_0xc9a6('0x37')](_0x2da60d);};}exports[_0xc9a6('0x38')]=function(_0x21ac8d,_0x3c41f7){var _0x381752={},_0x16472c={},_0x6aa71b={'count':0x0,'rows':[]};var _0x407689=_[_0xc9a6('0x39')](db['ChatMessage'][_0xc9a6('0x3a')],function(_0x4a835f){return{'name':_0x4a835f[_0xc9a6('0x3b')],'type':_0x4a835f[_0xc9a6('0x3c')]['key']};});_0x16472c[_0xc9a6('0x3d')]=_[_0xc9a6('0x39')](_0x407689,'name');_0x16472c[_0xc9a6('0x3e')]=_[_0xc9a6('0x3f')](_0x21ac8d[_0xc9a6('0x3e')]);_0x16472c[_0xc9a6('0x40')]=_[_0xc9a6('0x41')](_0x16472c[_0xc9a6('0x3d')],_0x16472c[_0xc9a6('0x3e')]);_0x381752[_0xc9a6('0x42')]=_[_0xc9a6('0x41')](_0x16472c[_0xc9a6('0x3d')],qs[_0xc9a6('0x43')](_0x21ac8d[_0xc9a6('0x3e')]['fields']));_0x381752['attributes']=_0x381752[_0xc9a6('0x42')]['length']?_0x381752['attributes']:_0x16472c[_0xc9a6('0x3d')];if(!_0x21ac8d[_0xc9a6('0x3e')][_0xc9a6('0x44')](_0xc9a6('0x45'))){_0x381752['limit']=qs[_0xc9a6('0x46')](_0x21ac8d[_0xc9a6('0x3e')][_0xc9a6('0x46')]);_0x381752[_0xc9a6('0x30')]=qs[_0xc9a6('0x30')](_0x21ac8d[_0xc9a6('0x3e')][_0xc9a6('0x30')]);}_0x381752[_0xc9a6('0x47')]=qs[_0xc9a6('0x48')](_0x21ac8d['query']['sort']);_0x381752['where']=qs['filters'](_[_0xc9a6('0x49')](_0x21ac8d['query'],_0x16472c[_0xc9a6('0x40')]),_0x407689);if(_0x21ac8d[_0xc9a6('0x3e')][_0xc9a6('0x4a')]){_0x381752[_0xc9a6('0x4b')]=_[_0xc9a6('0x4c')](_0x381752[_0xc9a6('0x4b')],{'$or':_[_0xc9a6('0x39')](_0x407689,function(_0x4cd3bb){if(_0x4cd3bb['type']!==_0xc9a6('0x4d')){var _0x3342ad={};_0x3342ad[_0x4cd3bb['name']]={'$like':'%'+_0x21ac8d['query'][_0xc9a6('0x4a')]+'%'};return _0x3342ad;}})});}_0x381752=_[_0xc9a6('0x4c')]({},_0x381752,_0x21ac8d['options']);var _0xc712fe={'where':_0x381752['where']};return db[_0xc9a6('0x4e')]['count'](_0xc712fe)[_0xc9a6('0x20')](function(_0x438593){_0x6aa71b[_0xc9a6('0x2f')]=_0x438593;if(_0x21ac8d['query'][_0xc9a6('0x4f')]){_0x381752[_0xc9a6('0x50')]=[{'all':!![]}];}return db[_0xc9a6('0x4e')][_0xc9a6('0x51')](_0x381752);})[_0xc9a6('0x20')](function(_0x558f24){_0x6aa71b[_0xc9a6('0x52')]=_0x558f24;return _0x6aa71b;})['then'](respondWithFilteredResult(_0x3c41f7,_0x381752))[_0xc9a6('0x2a')](handleError(_0x3c41f7,null));};exports['show']=function(_0xc894a2,_0x40db03){var _0x42ecf4={'raw':!![],'where':{'id':_0xc894a2[_0xc9a6('0x53')]['id']}},_0x3fbc53={};_0x3fbc53['model']=_[_0xc9a6('0x3f')](db['ChatMessage']['rawAttributes']);_0x3fbc53[_0xc9a6('0x3e')]=_[_0xc9a6('0x3f')](_0xc894a2[_0xc9a6('0x3e')]);_0x3fbc53[_0xc9a6('0x40')]=_[_0xc9a6('0x41')](_0x3fbc53['model'],_0x3fbc53['query']);_0x42ecf4[_0xc9a6('0x42')]=_[_0xc9a6('0x41')](_0x3fbc53[_0xc9a6('0x3d')],qs[_0xc9a6('0x43')](_0xc894a2[_0xc9a6('0x3e')][_0xc9a6('0x43')]));_0x42ecf4['attributes']=_0x42ecf4['attributes'][_0xc9a6('0x54')]?_0x42ecf4[_0xc9a6('0x42')]:_0x3fbc53[_0xc9a6('0x3d')];if(_0xc894a2[_0xc9a6('0x3e')][_0xc9a6('0x4f')]){_0x42ecf4[_0xc9a6('0x50')]=[{'all':!![]}];}_0x42ecf4=_['merge']({},_0x42ecf4,_0xc894a2[_0xc9a6('0x55')]);return db[_0xc9a6('0x4e')][_0xc9a6('0x56')](_0x42ecf4)[_0xc9a6('0x20')](handleEntityNotFound(_0x40db03,null))[_0xc9a6('0x20')](respondWithResult(_0x40db03,null))[_0xc9a6('0x2a')](handleError(_0x40db03,null));};exports[_0xc9a6('0x57')]=function(_0x2b452a,_0x4eb37e){return db[_0xc9a6('0x4e')][_0xc9a6('0x57')](_0x2b452a[_0xc9a6('0x58')],{})[_0xc9a6('0x20')](respondWithResult(_0x4eb37e,0xc9))[_0xc9a6('0x2a')](handleError(_0x4eb37e,null));};exports[_0xc9a6('0x59')]=function(_0x195b58,_0x1fc3f){if(_0x195b58['body']['id']){delete _0x195b58[_0xc9a6('0x58')]['id'];}return db[_0xc9a6('0x4e')][_0xc9a6('0x56')]({'where':{'id':_0x195b58[_0xc9a6('0x53')]['id']}})[_0xc9a6('0x20')](handleEntityNotFound(_0x1fc3f,null))[_0xc9a6('0x20')](saveUpdates(_0x195b58[_0xc9a6('0x58')],null))['then'](respondWithResult(_0x1fc3f,null))[_0xc9a6('0x2a')](handleError(_0x1fc3f,null));};exports[_0xc9a6('0x34')]=function(_0x1fa123,_0x3c58d7){return db[_0xc9a6('0x4e')][_0xc9a6('0x56')]({'where':{'id':_0x1fa123[_0xc9a6('0x53')]['id']}})[_0xc9a6('0x20')](handleEntityNotFound(_0x3c58d7,null))['then'](removeEntity(_0x3c58d7,null))[_0xc9a6('0x2a')](handleError(_0x3c58d7,null));};exports[_0xc9a6('0x5a')]=function(_0x955893,_0x5b0e8a){return db[_0xc9a6('0x4e')]['describe']()['then'](respondWithResult(_0x5b0e8a,null))[_0xc9a6('0x2a')](handleError(_0x5b0e8a,null));};var interaction_log=require(_0xc9a6('0x14'))(_0xc9a6('0x5b'));exports[_0xc9a6('0x5c')]=function(_0x1af5ce,_0x36eb5a,_0x464b12){var _0x1cc9d2={'agent':{},'channel':_0xc9a6('0x5d')};if(_0x1af5ce['body']['id']){delete _0x1af5ce[_0xc9a6('0x58')]['id'];}_0x1af5ce[_0xc9a6('0x58')][_0xc9a6('0x5e')]=!![];_0x1af5ce[_0xc9a6('0x58')][_0xc9a6('0x5f')]=moment()[_0xc9a6('0x60')](_0xc9a6('0x61'));_0x1af5ce[_0xc9a6('0x58')]['UserId']=_0x1af5ce[_0xc9a6('0x58')][_0xc9a6('0x62')]||_0x1af5ce[_0xc9a6('0x63')]['id'];_0x1cc9d2[_0xc9a6('0x64')]['id']=_0x1af5ce[_0xc9a6('0x58')][_0xc9a6('0x62')];return db[_0xc9a6('0x4e')]['find']({'where':{'id':_0x1af5ce[_0xc9a6('0x53')]['id'],'UserId':null}})[_0xc9a6('0x20')](handleEntityNotFound(_0x36eb5a,null))['then'](saveUpdates(_0x1af5ce[_0xc9a6('0x58')],null))[_0xc9a6('0x20')](function(_0x4a35c4){if(_0x4a35c4){_0x1cc9d2[_0xc9a6('0x28')]=_0x4a35c4[_0xc9a6('0x65')]({'plain':!![]});return db[_0xc9a6('0x66')][_0xc9a6('0x56')]({'where':{'id':_0x4a35c4[_0xc9a6('0x67')]}});}return null;})[_0xc9a6('0x20')](handleEntityNotFound(_0x36eb5a,null))['then'](function(_0x49e400){if(_0x49e400){return _0x49e400[_0xc9a6('0x59')]({'UserId':_0x1af5ce[_0xc9a6('0x58')][_0xc9a6('0x62')],'read1stAt':_['isNil'](_0x49e400[_0xc9a6('0x68')])?moment()['format'](_0xc9a6('0x61')):undefined});}return null;})['then'](function(_0x3e4724){if(_0x3e4724){_0x1cc9d2[_0xc9a6('0x69')]=_0x3e4724[_0xc9a6('0x65')]({'plain':!![]});interaction_log[_0xc9a6('0x21')](_0xc9a6('0x6a'),_0x1af5ce[_0xc9a6('0x63')]['id'],_0x1af5ce['user'][_0xc9a6('0x6b')],_0x1af5ce[_0xc9a6('0x63')][_0xc9a6('0x6c')],_0x1cc9d2[_0xc9a6('0x69')]['id'],_0x1af5ce[_0xc9a6('0x58')]?JSON[_0xc9a6('0x25')](_0x1af5ce[_0xc9a6('0x58')]):_0xc9a6('0x6d'));return respondWithRpcPromise('AcceptMessage',_0xc9a6('0x6e'),_0x1cc9d2);}return null;})[_0xc9a6('0x20')](function(_0x56acea){var _0x2db11b=_0xc9a6('0x6f')+_0x56acea[_0xc9a6('0x28')][_0xc9a6('0x70')];return db[_0xc9a6('0x71')][_0xc9a6('0x3e')](_0x2db11b,{'type':db[_0xc9a6('0x72')]['QueryTypes'][_0xc9a6('0x73')],'raw':!![]})['then'](function(_0x47a34a){return _0x47a34a;});})[_0xc9a6('0x20')](function(_0x45405c){if(_0x45405c){_0x1cc9d2[_0xc9a6('0x28')][_0xc9a6('0x74')]=_0x45405c[0x0];if(!_0x1af5ce[_0xc9a6('0x58')][_0xc9a6('0x62')])return;return db[_0xc9a6('0x75')]['find']({'where':{'id':_0x1af5ce[_0xc9a6('0x58')][_0xc9a6('0x62')],'role':'agent'},'attributes':['id',_0xc9a6('0x6b'),_0xc9a6('0x76'),_0xc9a6('0x77'),'internal'],'raw':!![]});}return null;})[_0xc9a6('0x20')](function(_0x1bc861){if(!_0x1bc861)return null;_0x1cc9d2['message']['agent']=_0x1bc861;return _0x1cc9d2;})[_0xc9a6('0x20')](function(_0x938d3f){if(_0x938d3f){if(_0x1af5ce[_0xc9a6('0x58')][_0xc9a6('0x78')]){_0x1cc9d2[_0xc9a6('0x28')][_0xc9a6('0x79')]=util[_0xc9a6('0x60')](_0xc9a6('0x7a'),_0x1af5ce[_0xc9a6('0x63')]['name']);_0x1cc9d2[_0xc9a6('0x28')][_0xc9a6('0x7b')]=_0x1cc9d2['channel'];_0x1cc9d2[_0xc9a6('0x28')][_0xc9a6('0x7c')]=_0x1cc9d2['channel'];_0x1cc9d2['message'][_0xc9a6('0x7d')]='accept';return respondWithRpcPromise(_0xc9a6('0x7e'),_0xc9a6('0x7e'),{'event':'acceptmessage','message':_[_0xc9a6('0x4c')](_0x1cc9d2[_0xc9a6('0x28')],JSON[_0xc9a6('0x7f')](_0x1cc9d2[_0xc9a6('0x69')][_0xc9a6('0x80')]))},client9002)[_0xc9a6('0x20')](function(){return _0x1cc9d2;});}return _0x1cc9d2;}return null;})[_0xc9a6('0x20')](respondWithResult(_0x36eb5a,null))[_0xc9a6('0x2a')](handleError(_0x36eb5a,null));};var interaction_log=require(_0xc9a6('0x14'))(_0xc9a6('0x5b'));exports[_0xc9a6('0x33')]=function(_0x42636f,_0x20ca5e,_0x5899d9){var _0x308717={'agent':{},'channel':'chat'};if(_0x42636f[_0xc9a6('0x58')]['id']){delete _0x42636f[_0xc9a6('0x58')]['id'];}_0x42636f[_0xc9a6('0x58')][_0xc9a6('0x62')]=_0x42636f['body'][_0xc9a6('0x62')]||_0x42636f[_0xc9a6('0x63')]['id'];_0x308717[_0xc9a6('0x64')]['id']=_0x42636f[_0xc9a6('0x58')]['UserId'];return db['ChatMessage'][_0xc9a6('0x56')]({'where':{'id':_0x42636f[_0xc9a6('0x53')]['id'],'UserId':null}})[_0xc9a6('0x20')](handleEntityNotFound(_0x20ca5e,null))[_0xc9a6('0x20')](function(_0x34a691){if(_0x34a691){_0x308717[_0xc9a6('0x28')]=_0x34a691[_0xc9a6('0x65')]({'plain':!![]});return db[_0xc9a6('0x66')][_0xc9a6('0x56')]({'where':{'id':_0x34a691['ChatInteractionId']}});}return null;})[_0xc9a6('0x20')](handleEntityNotFound(_0x20ca5e,null))[_0xc9a6('0x20')](function(_0x43cf4f){if(_0x43cf4f){_0x308717[_0xc9a6('0x69')]=_0x43cf4f['get']({'plain':!![]});interaction_log[_0xc9a6('0x21')](_0xc9a6('0x81'),_0x42636f[_0xc9a6('0x63')]['id'],_0x42636f[_0xc9a6('0x63')][_0xc9a6('0x6b')],_0x42636f['user'][_0xc9a6('0x6c')],_0x308717[_0xc9a6('0x69')]['id'],_0x42636f[_0xc9a6('0x58')]?JSON[_0xc9a6('0x25')](_0x42636f[_0xc9a6('0x58')]):_0xc9a6('0x6d'));return respondWithRpcPromise(_0xc9a6('0x82'),_0xc9a6('0x83'),_0x308717);}return null;})[_0xc9a6('0x20')](function(_0x4cff74){var _0x145da4=_0xc9a6('0x6f')+_0x4cff74[_0xc9a6('0x28')][_0xc9a6('0x70')];return db[_0xc9a6('0x71')][_0xc9a6('0x3e')](_0x145da4,{'type':db[_0xc9a6('0x72')][_0xc9a6('0x84')][_0xc9a6('0x73')],'raw':!![]})['then'](function(_0x34bd94){return _0x34bd94;});})[_0xc9a6('0x20')](function(_0xfbeb7f){if(_0xfbeb7f){_0x308717[_0xc9a6('0x28')][_0xc9a6('0x74')]=_0xfbeb7f[0x0];if(!_0x42636f['body'][_0xc9a6('0x62')])return;return db[_0xc9a6('0x75')]['find']({'where':{'id':_0x42636f['body']['UserId'],'role':_0xc9a6('0x64')},'attributes':['id','name','fullname','email',_0xc9a6('0x85')],'raw':!![]});}return null;})[_0xc9a6('0x20')](function(_0x2a9114){if(!_0x2a9114)return null;_0x308717['message'][_0xc9a6('0x64')]=_0x2a9114;return _0x308717;})[_0xc9a6('0x20')](function(_0x2484d3){if(_0x2484d3){_0x2484d3[_0xc9a6('0x28')][_0xc9a6('0x79')]=util[_0xc9a6('0x60')]('SIP/%s',_0x42636f['user'][_0xc9a6('0x6b')]);_0x2484d3['message'][_0xc9a6('0x7b')]=_0x308717[_0xc9a6('0x7b')];_0x2484d3[_0xc9a6('0x28')][_0xc9a6('0x7c')]=_0x308717[_0xc9a6('0x7b')];_0x2484d3[_0xc9a6('0x28')][_0xc9a6('0x7d')]=_0xc9a6('0x33');respondWithRpcPromise(_0xc9a6('0x7e'),_0xc9a6('0x7e'),{'event':_0xc9a6('0x86'),'message':_['merge'](_0x308717[_0xc9a6('0x28')],JSON[_0xc9a6('0x7f')](_0x308717[_0xc9a6('0x69')][_0xc9a6('0x80')]))},client9002);return _0x308717;}return null;})['then'](respondWithResult(_0x20ca5e,null))[_0xc9a6('0x2a')](handleError(_0x20ca5e,null));};
\ No newline at end of file
index afd8e0b..3050528 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85e6=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3e70d3,_0x1a784e){var _0x51c55b=function(_0x27c343){while(--_0x27c343){_0x3e70d3['push'](_0x3e70d3['shift']());}};_0x51c55b(++_0x1a784e);}(_0x85e6,0x183));var _0x685e=function(_0x1d6e0e,_0x515515){_0x1d6e0e=_0x1d6e0e-0x0;var _0x145aaa=_0x85e6[_0x1d6e0e];return _0x145aaa;};'use strict';var EventEmitter=require(_0x685e('0x0'));var ChatMessage=require(_0x685e('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x685e('0x2')](0x0);var events={'afterCreate':_0x685e('0x3'),'afterUpdate':_0x685e('0x4'),'afterDestroy':_0x685e('0x5')};function emitEvent(_0x1da5ab){return function(_0x27501d,_0x26bc5b,_0x111922){ChatMessageEvents[_0x685e('0x6')](_0x1da5ab+':'+_0x27501d['id'],_0x27501d);ChatMessageEvents['emit'](_0x1da5ab,_0x27501d);_0x111922(null);};}for(var e in events){if(events[_0x685e('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x685e('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0xd232=['remove','hasOwnProperty','exports','ChatMessage','setMaxListeners','save','update'];(function(_0x267a08,_0x548a6b){var _0x5f262d=function(_0x5f2701){while(--_0x5f2701){_0x267a08['push'](_0x267a08['shift']());}};_0x5f262d(++_0x548a6b);}(_0xd232,0x73));var _0x2d23=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd232[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x2d23('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2d23('0x1')](0x0);var events={'afterCreate':_0x2d23('0x2'),'afterUpdate':_0x2d23('0x3'),'afterDestroy':_0x2d23('0x4')};function emitEvent(_0x59d2b6){return function(_0x285be8,_0x294645,_0x3342f0){ChatMessageEvents['emit'](_0x59d2b6+':'+_0x285be8['id'],_0x285be8);ChatMessageEvents['emit'](_0x59d2b6,_0x285be8);_0x3342f0(null);};}for(var e in events){if(events[_0x2d23('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x2d23('0x6')]=ChatMessageEvents;
\ No newline at end of file
index bae9997..87196bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3faa=['findOne','ChatInteractionId','then','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','ChatInteraction'];(function(_0x3daae9,_0x1491bf){var _0x49f5d9=function(_0x5c764b){while(--_0x5c764b){_0x3daae9['push'](_0x3daae9['shift']());}};_0x49f5d9(++_0x1491bf);}(_0x3faa,0x19b));var _0xa3fa=function(_0x28652b,_0x48f35c){_0x28652b=_0x28652b-0x0;var _0x1b336d=_0x3faa[_0x28652b];return _0x1b336d;};'use strict';var _=require(_0xa3fa('0x0'));var util=require(_0xa3fa('0x1'));var logger=require(_0xa3fa('0x2'))(_0xa3fa('0x3'));var moment=require('moment');var BPromise=require(_0xa3fa('0x4'));var rp=require(_0xa3fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa3fa('0x6'));var config=require(_0xa3fa('0x7'));var attributes=require(_0xa3fa('0x8'));module['exports']=function(_0x1cff90,_0x212eb6){return _0x1cff90[_0xa3fa('0x9')]('ChatMessage',attributes,{'tableName':_0xa3fa('0xa'),'paranoid':![],'indexes':[{'name':_0xa3fa('0xb'),'fields':[_0xa3fa('0xc')],'type':_0xa3fa('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x256ab5,_0x4e1310,_0x2e5079){var _0x199670=_0x1cff90[_0xa3fa('0xe')];var _0x2fbd41=_0x256ab5['get']({'plain':!![]});if(_0x2fbd41[_0xa3fa('0xf')][_0xa3fa('0x10')]()==='in'||_0x2fbd41['direction'][_0xa3fa('0x10')]()===_0xa3fa('0x11')&&!_0x2fbd41[_0xa3fa('0x12')]&&!_[_0xa3fa('0x13')](_0x2fbd41['UserId'])){_0x199670[_0xa3fa('0x14')][_0xa3fa('0x15')]({'where':{'id':_0x2fbd41[_0xa3fa('0x16')]}})[_0xa3fa('0x17')](function(_0x2d1d51){if(_0x2d1d51){_0x2d1d51['update']({'lastMsgAt':_0x2fbd41[_0xa3fa('0x18')],'lastMsgDirection':_0x2fbd41[_0xa3fa('0xf')][_0xa3fa('0x10')]()});}})['catch'](function(_0x45870d){console['error'](_0x45870d);});}_0x2e5079();}},'charset':_0xa3fa('0x19'),'collate':_0xa3fa('0x1a')});};
\ No newline at end of file
+var _0x29cd=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','exports','define','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0x29cd,0x17b));var _0xd29c=function(_0x3d39b2,_0x4e25c5){_0x3d39b2=_0x3d39b2-0x0;var _0x112ed8=_0x29cd[_0x3d39b2];return _0x112ed8;};'use strict';var _=require(_0xd29c('0x0'));var util=require('util');var logger=require(_0xd29c('0x1'))(_0xd29c('0x2'));var moment=require(_0xd29c('0x3'));var BPromise=require(_0xd29c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd29c('0x5'));var rimraf=require(_0xd29c('0x6'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0xd29c('0x7')]=function(_0x40db62,_0xf48e7e){return _0x40db62[_0xd29c('0x8')]('ChatMessage',attributes,{'tableName':_0xd29c('0x9'),'paranoid':![],'indexes':[{'name':_0xd29c('0xa'),'fields':[_0xd29c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x52cbda,_0x376d36,_0xd644eb){var _0x417e81=_0x40db62[_0xd29c('0xc')];var _0x57bc0f=_0x52cbda[_0xd29c('0xd')]({'plain':!![]});if(_0x57bc0f[_0xd29c('0xe')][_0xd29c('0xf')]()==='in'||_0x57bc0f[_0xd29c('0xe')][_0xd29c('0xf')]()===_0xd29c('0x10')&&!_0x57bc0f[_0xd29c('0x11')]&&!_['isNil'](_0x57bc0f['UserId'])){_0x417e81[_0xd29c('0x12')][_0xd29c('0x13')]({'where':{'id':_0x57bc0f['ChatInteractionId']}})[_0xd29c('0x14')](function(_0x585be7){if(_0x585be7){_0x585be7[_0xd29c('0x15')]({'lastMsgAt':_0x57bc0f[_0xd29c('0x16')],'lastMsgDirection':_0x57bc0f[_0xd29c('0xe')]['toLowerCase']()});}})[_0xd29c('0x17')](function(_0x1946df){console[_0xd29c('0x18')](_0x1946df);});}_0xd644eb();}},'charset':_0xd29c('0x19'),'collate':_0xd29c('0x1a')});};
\ No newline at end of file
index d069b55..036f6f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21cd=['ChatMessage','create','options','CreateChatMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0x21cd,0x6a));var _0xd21c=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x21cd[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0xd21c('0x0'));var util=require(_0xd21c('0x1'));var moment=require(_0xd21c('0x2'));var BPromise=require(_0xd21c('0x3'));var rs=require(_0xd21c('0x4'));var fs=require('fs');var Redis=require(_0xd21c('0x5'));var db=require(_0xd21c('0x6'))['db'];var utils=require(_0xd21c('0x7'));var logger=require(_0xd21c('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd21c('0x9'));var client=jayson[_0xd21c('0xa')][_0xd21c('0xb')]({'port':0x232a});config[_0xd21c('0xc')]=_[_0xd21c('0xd')](config['redis'],{'host':_0xd21c('0xe'),'port':0x18eb});var socket=require(_0xd21c('0xf'))(new Redis(config[_0xd21c('0xc')]));require(_0xd21c('0x10'))[_0xd21c('0x11')](socket);function respondWithRpcPromise(_0x5298c4,_0x380c59,_0x4ad6d1){return new BPromise(function(_0x39dd4a,_0x2e36b0){return client[_0xd21c('0x12')](_0x5298c4,_0x4ad6d1)[_0xd21c('0x13')](function(_0x474042){logger[_0xd21c('0x14')](_0xd21c('0x15'),_0x380c59,'request\x20sent');logger[_0xd21c('0x16')](_0xd21c('0x17'),_0x380c59,_0xd21c('0x18'),JSON[_0xd21c('0x19')](_0x474042));if(_0x474042[_0xd21c('0x1a')]){if(_0x474042[_0xd21c('0x1a')][_0xd21c('0x1b')]===0x1f4){logger[_0xd21c('0x1a')](_0xd21c('0x15'),_0x380c59,_0x474042[_0xd21c('0x1a')][_0xd21c('0x1c')]);return _0x2e36b0(_0x474042[_0xd21c('0x1a')]['message']);}logger[_0xd21c('0x1a')](_0xd21c('0x15'),_0x380c59,_0x474042[_0xd21c('0x1a')][_0xd21c('0x1c')]);return _0x39dd4a(_0x474042[_0xd21c('0x1a')]['message']);}else{logger[_0xd21c('0x14')](_0xd21c('0x15'),_0x380c59,_0xd21c('0x18'));_0x39dd4a(_0x474042['result'][_0xd21c('0x1c')]);}})[_0xd21c('0x1d')](function(_0x580546){logger[_0xd21c('0x1a')](_0xd21c('0x15'),_0x380c59,_0x580546);_0x2e36b0(_0x580546);});});}exports['CreateChatMessage']=function(_0x4e352a){var _0x50b0b9=this;return new Promise(function(_0x258ef1,_0x21a175){return db[_0xd21c('0x1e')][_0xd21c('0x1f')](_0x4e352a['body'],{'raw':_0x4e352a[_0xd21c('0x20')]?_0x4e352a['options']['raw']===undefined?!![]:![]:!![]})[_0xd21c('0x13')](function(_0x75bd03){logger[_0xd21c('0x14')](_0xd21c('0x21'),_0x4e352a);logger[_0xd21c('0x16')](_0xd21c('0x21'),_0x4e352a,JSON[_0xd21c('0x19')](_0x75bd03));_0x258ef1(_0x75bd03);})[_0xd21c('0x1d')](function(_0x1009ae){logger[_0xd21c('0x1a')](_0xd21c('0x21'),_0x1009ae[_0xd21c('0x1c')],_0x4e352a);_0x21a175(_0x50b0b9['error'](0x1f4,_0x1009ae[_0xd21c('0x1c')]));});});};
\ No newline at end of file
+var _0x5709=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent'];(function(_0x4b8199,_0x570667){var _0x525a58=function(_0x3c9364){while(--_0x3c9364){_0x4b8199['push'](_0x4b8199['shift']());}};_0x525a58(++_0x570667);}(_0x5709,0x158));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9570('0x0'));var util=require(_0x9570('0x1'));var moment=require(_0x9570('0x2'));var BPromise=require('bluebird');var rs=require(_0x9570('0x3'));var fs=require('fs');var Redis=require(_0x9570('0x4'));var db=require(_0x9570('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9570('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9570('0x7'));var client=jayson[_0x9570('0x8')][_0x9570('0x9')]({'port':0x232a});config[_0x9570('0xa')]=_[_0x9570('0xb')](config[_0x9570('0xa')],{'host':_0x9570('0xc'),'port':0x18eb});var socket=require(_0x9570('0xd'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x9570('0xe')](socket);function respondWithRpcPromise(_0x420742,_0xc4f180,_0x3db514){return new BPromise(function(_0x36432b,_0x5bf7df){return client[_0x9570('0xf')](_0x420742,_0x3db514)[_0x9570('0x10')](function(_0xb43e1f){logger[_0x9570('0x11')]('ChatMessage,\x20%s,\x20%s',_0xc4f180,_0x9570('0x12'));logger['debug'](_0x9570('0x13'),_0xc4f180,'request\x20sent',JSON[_0x9570('0x14')](_0xb43e1f));if(_0xb43e1f[_0x9570('0x15')]){if(_0xb43e1f['error'][_0x9570('0x16')]===0x1f4){logger[_0x9570('0x15')](_0x9570('0x17'),_0xc4f180,_0xb43e1f[_0x9570('0x15')]['message']);return _0x5bf7df(_0xb43e1f[_0x9570('0x15')][_0x9570('0x18')]);}logger[_0x9570('0x15')](_0x9570('0x17'),_0xc4f180,_0xb43e1f['error'][_0x9570('0x18')]);return _0x36432b(_0xb43e1f['error']['message']);}else{logger[_0x9570('0x11')](_0x9570('0x17'),_0xc4f180,_0x9570('0x12'));_0x36432b(_0xb43e1f[_0x9570('0x19')][_0x9570('0x18')]);}})[_0x9570('0x1a')](function(_0x30b40d){logger[_0x9570('0x15')](_0x9570('0x17'),_0xc4f180,_0x30b40d);_0x5bf7df(_0x30b40d);});});}exports[_0x9570('0x1b')]=function(_0x5d85f7){var _0x4e1f69=this;return new Promise(function(_0x326801,_0x21807d){return db[_0x9570('0x1c')][_0x9570('0x1d')](_0x5d85f7['body'],{'raw':_0x5d85f7[_0x9570('0x1e')]?_0x5d85f7[_0x9570('0x1e')][_0x9570('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0xaac112){logger[_0x9570('0x11')](_0x9570('0x1b'),_0x5d85f7);logger[_0x9570('0x20')](_0x9570('0x1b'),_0x5d85f7,JSON['stringify'](_0xaac112));_0x326801(_0xaac112);})[_0x9570('0x1a')](function(_0x395081){logger[_0x9570('0x15')](_0x9570('0x1b'),_0x395081[_0x9570('0x18')],_0x5d85f7);_0x21807d(_0x4e1f69[_0x9570('0x15')](0x1f4,_0x395081[_0x9570('0x18')]));});});};
\ No newline at end of file
index d83d482..6f4c8b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a2a=['removeListener','register','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x25f940,_0x5c4e59){var _0x293d1c=function(_0x154ebd){while(--_0x154ebd){_0x25f940['push'](_0x25f940['shift']());}};_0x293d1c(++_0x5c4e59);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x5143b3,_0x4bd914){_0x5143b3=_0x5143b3-0x0;var _0x529f57=_0x5a2a[_0x5143b3];return _0x529f57;};'use strict';var ChatMessageEvents=require(_0xa5a2('0x0'));var events=[_0xa5a2('0x1'),_0xa5a2('0x2'),_0xa5a2('0x3')];function createListener(_0x5d3456,_0x525e94){return function(_0x48308f){_0x525e94[_0xa5a2('0x4')](_0x5d3456,_0x48308f);};}function removeListener(_0x2cf196,_0x479d0a){return function(){ChatMessageEvents[_0xa5a2('0x5')](_0x2cf196,_0x479d0a);};}exports[_0xa5a2('0x6')]=function(_0x2e97d3){for(var _0x55728b=0x0,_0x179722=events['length'];_0x55728b<_0x179722;_0x55728b++){var _0x38a5fe=events[_0x55728b];var _0x97f75c=createListener(_0xa5a2('0x7')+_0x38a5fe,_0x2e97d3);ChatMessageEvents['on'](_0x38a5fe,_0x97f75c);}};
\ No newline at end of file
+var _0xea31=['register','chatMessage:','./chatMessage.events','remove','update','emit','removeListener'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0xea31,0x6b));var _0x1ea3=function(_0x1c9b5d,_0x8c1535){_0x1c9b5d=_0x1c9b5d-0x0;var _0x31eebb=_0xea31[_0x1c9b5d];return _0x31eebb;};'use strict';var ChatMessageEvents=require(_0x1ea3('0x0'));var events=['save',_0x1ea3('0x1'),_0x1ea3('0x2')];function createListener(_0x3b1d99,_0x153625){return function(_0x2dc24e){_0x153625[_0x1ea3('0x3')](_0x3b1d99,_0x2dc24e);};}function removeListener(_0x1142f1,_0x555620){return function(){ChatMessageEvents[_0x1ea3('0x4')](_0x1142f1,_0x555620);};}exports[_0x1ea3('0x5')]=function(_0x6810da){for(var _0x27c695=0x0,_0x13e6fb=events['length'];_0x27c695<_0x13e6fb;_0x27c695++){var _0x1fa3a8=events[_0x27c695];var _0x1b578e=createListener(_0x1ea3('0x6')+_0x1fa3a8,_0x6810da);ChatMessageEvents['on'](_0x1fa3a8,_0x1b578e);}};
\ No newline at end of file
index ec61003..4a47a10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec29=['./chatMessage.controller','isAuthenticated','index','/describe','describe','show','tracked','chat','chatmessage:create','update','accept','put','/:id/reject','delete','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x678ed,_0x339833){var _0x2c709c=function(_0x167f12){while(--_0x167f12){_0x678ed['push'](_0x678ed['shift']());}};_0x2c709c(++_0x339833);}(_0xec29,0xc9));var _0x9ec2=function(_0x32636d,_0x9216d){_0x32636d=_0x32636d-0x0;var _0x389dbe=_0xec29[_0x32636d];return _0x389dbe;};'use strict';var multer=require(_0x9ec2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9ec2('0x1'));var express=require(_0x9ec2('0x2'));var router=express[_0x9ec2('0x3')]();var fs_extra=require(_0x9ec2('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9ec2('0x5'));var controller=require(_0x9ec2('0x6'));router['get']('/',auth[_0x9ec2('0x7')](),controller[_0x9ec2('0x8')]);router['get'](_0x9ec2('0x9'),auth[_0x9ec2('0x7')](),controller[_0x9ec2('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9ec2('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x9ec2('0xc')](_0x9ec2('0xd'),_0x9ec2('0xe')),controller['create']);router['put']('/:id',controller[_0x9ec2('0xf')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x9ec2('0x10')]);router[_0x9ec2('0x11')](_0x9ec2('0x12'),auth[_0x9ec2('0x7')](),controller['reject']);router[_0x9ec2('0x13')](_0x9ec2('0x14'),auth['isAuthenticated'](),controller[_0x9ec2('0x15')]);module[_0x9ec2('0x16')]=router;
\ No newline at end of file
+var _0x9b8a=['express','Router','fs-extra','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x9b8a,0xec));var _0xa9b8=function(_0x20acdb,_0x210c8e){_0x20acdb=_0x20acdb-0x0;var _0x383b0d=_0x9b8a[_0x20acdb];return _0x383b0d;};'use strict';var multer=require(_0xa9b8('0x0'));var util=require(_0xa9b8('0x1'));var path=require(_0xa9b8('0x2'));var timeout=require(_0xa9b8('0x3'));var express=require(_0xa9b8('0x4'));var router=express[_0xa9b8('0x5')]();var fs_extra=require(_0xa9b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa9b8('0x7'));var config=require('../../config/environment');var controller=require(_0xa9b8('0x8'));router[_0xa9b8('0x9')]('/',auth[_0xa9b8('0xa')](),controller[_0xa9b8('0xb')]);router[_0xa9b8('0x9')](_0xa9b8('0xc'),auth[_0xa9b8('0xa')](),controller[_0xa9b8('0xd')]);router[_0xa9b8('0x9')](_0xa9b8('0xe'),auth[_0xa9b8('0xa')](),controller[_0xa9b8('0xf')]);router[_0xa9b8('0x10')]('/',auth[_0xa9b8('0xa')](),interaction[_0xa9b8('0x11')](_0xa9b8('0x12'),_0xa9b8('0x13')),controller[_0xa9b8('0x14')]);router[_0xa9b8('0x15')](_0xa9b8('0xe'),controller[_0xa9b8('0x16')]);router['put'](_0xa9b8('0x17'),auth[_0xa9b8('0xa')](),controller[_0xa9b8('0x18')]);router['put'](_0xa9b8('0x19'),auth[_0xa9b8('0xa')](),controller[_0xa9b8('0x1a')]);router[_0xa9b8('0x1b')](_0xa9b8('0xe'),auth[_0xa9b8('0xa')](),controller[_0xa9b8('0x1c')]);module[_0xa9b8('0x1d')]=router;
\ No newline at end of file
index e937072..04ba265 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48b1=['sequelize','TEXT','medium'];(function(_0x245412,_0x4e32b5){var _0x14dd9f=function(_0x4ae8e9){while(--_0x4ae8e9){_0x245412['push'](_0x245412['shift']());}};_0x14dd9f(++_0x4e32b5);}(_0x48b1,0x7e));var _0x148b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x48b1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x148b('0x0'));module['exports']={'body':{'type':Sequelize[_0x148b('0x1')](_0x148b('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x1d88=['TEXT','sequelize','exports'];(function(_0x3dcc9d,_0x38ceb9){var _0x3b0d59=function(_0x46e250){while(--_0x46e250){_0x3dcc9d['push'](_0x3dcc9d['shift']());}};_0x3b0d59(++_0x38ceb9);}(_0x1d88,0x1d2));var _0x81d8=function(_0x5a2b7d,_0xcaa5b7){_0x5a2b7d=_0x5a2b7d-0x0;var _0x50a01d=_0x1d88[_0x5a2b7d];return _0x50a01d;};'use strict';var Sequelize=require(_0x81d8('0x0'));module[_0x81d8('0x1')]={'body':{'type':Sequelize[_0x81d8('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
index 2087a20..557e432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1bd740,_0x1f7481){var _0x237f07=function(_0x47546d){while(--_0x47546d){_0x1bd740['push'](_0x1bd740['shift']());}};_0x237f07(++_0x1f7481);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _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(_0xffaa02,_0x5a861f){var _0x2d1a7c=function(_0x46c451){while(--_0x46c451){_0xffaa02['push'](_0xffaa02['shift']());}};_0x2d1a7c(++_0x5a861f);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 8edbb2e..1e5970a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0692=['bluebird','request-promise','path','../../config/environment','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x376ea6,_0x411c66){var _0x312cae=function(_0xb6e39f){while(--_0xb6e39f){_0x376ea6['push'](_0x376ea6['shift']());}};_0x312cae(++_0x411c66);}(_0x0692,0x12f));var _0x2069=function(_0x8cefa0,_0x357112){_0x8cefa0=_0x8cefa0-0x0;var _0x5a0671=_0x0692[_0x8cefa0];return _0x5a0671;};'use strict';var _=require(_0x2069('0x0'));var util=require(_0x2069('0x1'));var logger=require(_0x2069('0x2'))(_0x2069('0x3'));var moment=require(_0x2069('0x4'));var BPromise=require(_0x2069('0x5'));var rp=require(_0x2069('0x6'));var fs=require('fs');var path=require(_0x2069('0x7'));var rimraf=require('rimraf');var config=require(_0x2069('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0x2069('0x9')]=function(_0x4fe768,_0x2589b2){return _0x4fe768['define'](_0x2069('0xa'),attributes,{'tableName':_0x2069('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2069('0xc'),'collate':_0x2069('0xd')});};
\ No newline at end of file
+var _0xa521=['utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','../../config/environment','exports','chat_offline_messages'];(function(_0x9e9f8a,_0xf229c8){var _0x36267b=function(_0x4a7f30){while(--_0x4a7f30){_0x9e9f8a['push'](_0x9e9f8a['shift']());}};_0x36267b(++_0xf229c8);}(_0xa521,0xa3));var _0x1a52=function(_0x11e596,_0x5eaa99){_0x11e596=_0x11e596-0x0;var _0x2b6056=_0xa521[_0x11e596];return _0x2b6056;};'use strict';var _=require(_0x1a52('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1a52('0x1'));var moment=require(_0x1a52('0x2'));var BPromise=require('bluebird');var rp=require(_0x1a52('0x3'));var fs=require('fs');var path=require(_0x1a52('0x4'));var rimraf=require('rimraf');var config=require(_0x1a52('0x5'));var attributes=require('./chatOfflineMessage.attributes');module[_0x1a52('0x6')]=function(_0x23ec94,_0x2dedfc){return _0x23ec94['define']('ChatOfflineMessage',attributes,{'tableName':_0x1a52('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1a52('0x8')});};
\ No newline at end of file
index d77523c..9be16bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06b0=['http','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x257579,_0x627180){var _0x1a329d=function(_0x27e1f8){while(--_0x27e1f8){_0x257579['push'](_0x257579['shift']());}};_0x1a329d(++_0x627180);}(_0x06b0,0x74));var _0x006b=function(_0x5ba46c,_0x3a4c10){_0x5ba46c=_0x5ba46c-0x0;var _0x3da30f=_0x06b0[_0x5ba46c];return _0x3da30f;};'use strict';var _=require(_0x006b('0x0'));var util=require('util');var moment=require(_0x006b('0x1'));var BPromise=require(_0x006b('0x2'));var rs=require(_0x006b('0x3'));var fs=require('fs');var Redis=require(_0x006b('0x4'));var db=require(_0x006b('0x5'))['db'];var utils=require(_0x006b('0x6'));var logger=require('../../config/logger')(_0x006b('0x7'));var config=require(_0x006b('0x8'));var jayson=require(_0x006b('0x9'));var client=jayson['client'][_0x006b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59ddeb,_0x481215,_0x28ab85){return new BPromise(function(_0x240052,_0x438ef0){return client['request'](_0x59ddeb,_0x28ab85)[_0x006b('0xb')](function(_0x47fb5f){logger[_0x006b('0xc')](_0x006b('0xd'),_0x481215,'request\x20sent');logger[_0x006b('0xe')](_0x006b('0xf'),_0x481215,_0x006b('0x10'),JSON[_0x006b('0x11')](_0x47fb5f));if(_0x47fb5f[_0x006b('0x12')]){if(_0x47fb5f[_0x006b('0x12')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x481215,_0x47fb5f[_0x006b('0x12')][_0x006b('0x13')]);return _0x438ef0(_0x47fb5f[_0x006b('0x12')]['message']);}logger[_0x006b('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x481215,_0x47fb5f['error'][_0x006b('0x13')]);return _0x240052(_0x47fb5f['error'][_0x006b('0x13')]);}else{logger['info'](_0x006b('0xd'),_0x481215,_0x006b('0x10'));_0x240052(_0x47fb5f['result'][_0x006b('0x13')]);}})[_0x006b('0x14')](function(_0x6cbe64){logger['error'](_0x006b('0xd'),_0x481215,_0x6cbe64);_0x438ef0(_0x6cbe64);});});}
\ No newline at end of file
+var _0x6ca2=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x6e52d9,_0x1f4681){var _0x390b64=function(_0x2a5b3e){while(--_0x2a5b3e){_0x6e52d9['push'](_0x6e52d9['shift']());}};_0x390b64(++_0x1f4681);}(_0x6ca2,0xc8));var _0x26ca=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6ca2[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x26ca('0x0'));var moment=require(_0x26ca('0x1'));var BPromise=require(_0x26ca('0x2'));var rs=require(_0x26ca('0x3'));var fs=require('fs');var Redis=require(_0x26ca('0x4'));var db=require(_0x26ca('0x5'))['db'];var utils=require(_0x26ca('0x6'));var logger=require(_0x26ca('0x7'))(_0x26ca('0x8'));var config=require(_0x26ca('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x26ca('0xa')][_0x26ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a9b95,_0x2b9a33,_0x2facf6){return new BPromise(function(_0x301073,_0x315858){return client[_0x26ca('0xc')](_0x5a9b95,_0x2facf6)[_0x26ca('0xd')](function(_0x1a2371){logger[_0x26ca('0xe')](_0x26ca('0xf'),_0x2b9a33,_0x26ca('0x10'));logger[_0x26ca('0x11')](_0x26ca('0x12'),_0x2b9a33,_0x26ca('0x10'),JSON['stringify'](_0x1a2371));if(_0x1a2371[_0x26ca('0x13')]){if(_0x1a2371['error'][_0x26ca('0x14')]===0x1f4){logger[_0x26ca('0x13')](_0x26ca('0xf'),_0x2b9a33,_0x1a2371[_0x26ca('0x13')][_0x26ca('0x15')]);return _0x315858(_0x1a2371['error']['message']);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x2b9a33,_0x1a2371['error']['message']);return _0x301073(_0x1a2371[_0x26ca('0x13')][_0x26ca('0x15')]);}else{logger[_0x26ca('0xe')](_0x26ca('0xf'),_0x2b9a33,_0x26ca('0x10'));_0x301073(_0x1a2371[_0x26ca('0x16')]['message']);}})[_0x26ca('0x17')](function(_0x478208){logger[_0x26ca('0x13')](_0x26ca('0xf'),_0x2b9a33,_0x478208);_0x315858(_0x478208);});});}
\ No newline at end of file
index e69ab4c..82f0c13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x959a=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','create'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x959a,0x90));var _0xa959=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x959a[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0xa959('0x0'));var util=require(_0xa959('0x1'));var path=require(_0xa959('0x2'));var timeout=require(_0xa959('0x3'));var express=require(_0xa959('0x4'));var router=express[_0xa959('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa959('0x6'));var interaction=require(_0xa959('0x7'));var config=require(_0xa959('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0xa959('0x9')]('/',auth[_0xa959('0xa')](),controller[_0xa959('0xb')]);router[_0xa959('0x9')](_0xa959('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xa959('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xa959('0xe')]('/',auth[_0xa959('0xa')](),controller[_0xa959('0xf')]);router[_0xa959('0x10')](_0xa959('0xd'),auth[_0xa959('0xa')](),controller[_0xa959('0x11')]);router['delete']('/:id',auth[_0xa959('0xa')](),controller[_0xa959('0x12')]);module[_0xa959('0x13')]=router;
\ No newline at end of file
+var _0xdf5e=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post'];(function(_0x2cecca,_0x4bbec5){var _0x22a2e0=function(_0x93283f){while(--_0x93283f){_0x2cecca['push'](_0x2cecca['shift']());}};_0x22a2e0(++_0x4bbec5);}(_0xdf5e,0x158));var _0xedf5=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0xdf5e[_0x1030ce];return _0x3367fd;};'use strict';var multer=require(_0xedf5('0x0'));var util=require(_0xedf5('0x1'));var path=require(_0xedf5('0x2'));var timeout=require(_0xedf5('0x3'));var express=require(_0xedf5('0x4'));var router=express[_0xedf5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xedf5('0x6'));var config=require(_0xedf5('0x7'));var controller=require(_0xedf5('0x8'));router['get']('/',auth[_0xedf5('0x9')](),controller[_0xedf5('0xa')]);router[_0xedf5('0xb')](_0xedf5('0xc'),auth[_0xedf5('0x9')](),controller['describe']);router[_0xedf5('0xb')](_0xedf5('0xd'),auth[_0xedf5('0x9')](),controller[_0xedf5('0xe')]);router[_0xedf5('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xedf5('0x10')](_0xedf5('0xd'),auth[_0xedf5('0x9')](),controller[_0xedf5('0x11')]);router[_0xedf5('0x12')](_0xedf5('0xd'),auth[_0xedf5('0x9')](),controller['destroy']);module[_0xedf5('0x13')]=router;
\ No newline at end of file
index e4b3ac2..85f7f61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf666=['timeout','INTEGER','sequelize','exports','STRING','ENUM','mouseOver'];(function(_0x2c3201,_0x1f76ff){var _0x564fc4=function(_0x424493){while(--_0x424493){_0x2c3201['push'](_0x2c3201['shift']());}};_0x564fc4(++_0x1f76ff);}(_0xf666,0x95));var _0x6f66=function(_0x1b7dfc,_0x50210c){_0x1b7dfc=_0x1b7dfc-0x0;var _0x134c30=_0xf666[_0x1b7dfc];return _0x134c30;};'use strict';var Sequelize=require(_0x6f66('0x0'));module[_0x6f66('0x1')]={'name':{'type':Sequelize[_0x6f66('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6f66('0x3')](_0x6f66('0x4'),_0x6f66('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x6f66('0x2')]},'timeout':{'type':Sequelize[_0x6f66('0x6')]}};
\ No newline at end of file
+var _0x7c20=['ENUM','timeout','mouseOver','sequelize','exports','STRING'];(function(_0xc5f918,_0xf3a271){var _0x111585=function(_0x564bae){while(--_0x564bae){_0xc5f918['push'](_0xc5f918['shift']());}};_0x111585(++_0xf3a271);}(_0x7c20,0x6f));var _0x07c2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7c20[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x07c2('0x0'));module[_0x07c2('0x1')]={'name':{'type':Sequelize[_0x07c2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x07c2('0x3')]('mouseOver',_0x07c2('0x4')),'defaultValue':_0x07c2('0x5')},'selector':{'type':Sequelize[_0x07c2('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index cedd9a6..7e7abcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf611=['create','body','ChatProactiveAction','catch','destroy','rimraf','zip-dir','fast-json-patch','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../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','update','then','error','name','send','show','params','model','rawAttributes','keys','query','filters','intersection','attributes','fields','include','merge','options','find'];(function(_0x1ee548,_0xf1e1ae){var _0xbba22d=function(_0x286eb6){while(--_0x286eb6){_0x1ee548['push'](_0x1ee548['shift']());}};_0xbba22d(++_0xf1e1ae);}(_0xf611,0x7b));var _0x1f61=function(_0x270dba,_0x1817d2){_0x270dba=_0x270dba-0x0;var _0x36b83b=_0xf611[_0x270dba];return _0x36b83b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f61('0x0'));var zipdir=require(_0x1f61('0x1'));var jsonpatch=require(_0x1f61('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1f61('0x3'));var util=require('util');var path=require(_0x1f61('0x4'));var sox=require(_0x1f61('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f61('0x6'));var _=require(_0x1f61('0x7'));var squel=require(_0x1f61('0x8'));var crypto=require(_0x1f61('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1f61('0xa'));var toCsv=require(_0x1f61('0xb'));var querystring=require(_0x1f61('0xc'));var Papa=require('papaparse');var Redis=require(_0x1f61('0xd'));var authService=require(_0x1f61('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f61('0xf'));var logger=require(_0x1f61('0x10'))(_0x1f61('0x11'));var utils=require(_0x1f61('0x12'));var config=require(_0x1f61('0x13'));var licenseUtil=require(_0x1f61('0x14'));var db=require(_0x1f61('0x15'))['db'];function respondWithStatusCode(_0x37cb71,_0x486473){_0x486473=_0x486473||0xcc;return function(_0x39d9bf){if(_0x39d9bf){return _0x37cb71[_0x1f61('0x16')](_0x486473);}return _0x37cb71[_0x1f61('0x17')](_0x486473)[_0x1f61('0x18')]();};}function respondWithResult(_0xd9b707,_0xe7ad5c){_0xe7ad5c=_0xe7ad5c||0xc8;return function(_0x206c0d){if(_0x206c0d){return _0xd9b707[_0x1f61('0x17')](_0xe7ad5c)[_0x1f61('0x19')](_0x206c0d);}};}function respondWithFilteredResult(_0x22bb50,_0x17fd3b){return function(_0x246530){if(_0x246530){var _0x45df7f=typeof _0x17fd3b[_0x1f61('0x1a')]===_0x1f61('0x1b')&&typeof _0x17fd3b[_0x1f61('0x1c')]===_0x1f61('0x1b');var _0xd655a0=_0x246530[_0x1f61('0x1d')];var _0x3f84d7=_0x45df7f?0x0:_0x17fd3b[_0x1f61('0x1a')];var _0x5954e4=_0x45df7f?_0x246530[_0x1f61('0x1d')]:_0x17fd3b[_0x1f61('0x1a')]+_0x17fd3b[_0x1f61('0x1c')];var _0x568be7;if(_0x5954e4>=_0xd655a0){_0x5954e4=_0xd655a0;_0x568be7=0xc8;}else{_0x568be7=0xce;}_0x22bb50[_0x1f61('0x17')](_0x568be7);return _0x22bb50[_0x1f61('0x1e')](_0x1f61('0x1f'),_0x3f84d7+'-'+_0x5954e4+'/'+_0xd655a0)[_0x1f61('0x19')](_0x246530);}return null;};}function patchUpdates(_0x994383){return function(_0x3df30f){try{jsonpatch[_0x1f61('0x20')](_0x3df30f,_0x994383,!![]);}catch(_0x33aa5e){return BPromise[_0x1f61('0x21')](_0x33aa5e);}return _0x3df30f[_0x1f61('0x22')]();};}function saveUpdates(_0x485c0d,_0x2768c){return function(_0x5de4c9){if(_0x5de4c9){return _0x5de4c9[_0x1f61('0x23')](_0x485c0d)['then'](function(_0x39ac75){return _0x39ac75;});}return null;};}function removeEntity(_0x134223,_0x4008c0){return function(_0x4ceb8d){if(_0x4ceb8d){return _0x4ceb8d['destroy']()[_0x1f61('0x24')](function(){_0x134223['status'](0xcc)[_0x1f61('0x18')]();});}};}function handleEntityNotFound(_0x19945e,_0x4eb8b6){return function(_0x20224d){if(!_0x20224d){_0x19945e['sendStatus'](0x194);}return _0x20224d;};}function handleError(_0x108524,_0x3cd0c9){_0x3cd0c9=_0x3cd0c9||0x1f4;return function(_0x6b7580){logger[_0x1f61('0x25')](_0x6b7580['stack']);if(_0x6b7580[_0x1f61('0x26')]){delete _0x6b7580[_0x1f61('0x26')];}_0x108524[_0x1f61('0x17')](_0x3cd0c9)[_0x1f61('0x27')](_0x6b7580);};}exports[_0x1f61('0x28')]=function(_0x43669e,_0x559d0c){var _0xa71e8b={'raw':!![],'where':{'id':_0x43669e[_0x1f61('0x29')]['id']}},_0x38f4fe={};_0x38f4fe[_0x1f61('0x2a')]=_['keys'](db['ChatProactiveAction'][_0x1f61('0x2b')]);_0x38f4fe['query']=_[_0x1f61('0x2c')](_0x43669e[_0x1f61('0x2d')]);_0x38f4fe[_0x1f61('0x2e')]=_[_0x1f61('0x2f')](_0x38f4fe[_0x1f61('0x2a')],_0x38f4fe[_0x1f61('0x2d')]);_0xa71e8b[_0x1f61('0x30')]=_[_0x1f61('0x2f')](_0x38f4fe['model'],qs[_0x1f61('0x31')](_0x43669e[_0x1f61('0x2d')]['fields']));_0xa71e8b[_0x1f61('0x30')]=_0xa71e8b[_0x1f61('0x30')]['length']?_0xa71e8b['attributes']:_0x38f4fe[_0x1f61('0x2a')];if(_0x43669e[_0x1f61('0x2d')]['includeAll']){_0xa71e8b[_0x1f61('0x32')]=[{'all':!![]}];}_0xa71e8b=_[_0x1f61('0x33')]({},_0xa71e8b,_0x43669e[_0x1f61('0x34')]);return db['ChatProactiveAction'][_0x1f61('0x35')](_0xa71e8b)[_0x1f61('0x24')](handleEntityNotFound(_0x559d0c,null))[_0x1f61('0x24')](respondWithResult(_0x559d0c,null))['catch'](handleError(_0x559d0c,null));};exports[_0x1f61('0x36')]=function(_0x58b20b,_0x12abe9){return db['ChatProactiveAction']['create'](_0x58b20b[_0x1f61('0x37')],{})[_0x1f61('0x24')](respondWithResult(_0x12abe9,0xc9))['catch'](handleError(_0x12abe9,null));};exports[_0x1f61('0x23')]=function(_0xa8129e,_0x4deed8){if(_0xa8129e[_0x1f61('0x37')]['id']){delete _0xa8129e[_0x1f61('0x37')]['id'];}return db[_0x1f61('0x38')][_0x1f61('0x35')]({'where':{'id':_0xa8129e['params']['id']}})[_0x1f61('0x24')](handleEntityNotFound(_0x4deed8,null))[_0x1f61('0x24')](saveUpdates(_0xa8129e[_0x1f61('0x37')],null))[_0x1f61('0x24')](respondWithResult(_0x4deed8,null))[_0x1f61('0x39')](handleError(_0x4deed8,null));};exports[_0x1f61('0x3a')]=function(_0x364432,_0x2f034b){return db[_0x1f61('0x38')][_0x1f61('0x35')]({'where':{'id':_0x364432[_0x1f61('0x29')]['id']}})[_0x1f61('0x24')](handleEntityNotFound(_0x2f034b,null))['then'](removeEntity(_0x2f034b,null))['catch'](handleError(_0x2f034b,null));};
\ No newline at end of file
+var _0x8e0f=['reject','update','then','end','sendStatus','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','includeAll','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x5722c1,_0x490ef2){var _0x2ef0aa=function(_0x3e2f5f){while(--_0x3e2f5f){_0x5722c1['push'](_0x5722c1['shift']());}};_0x2ef0aa(++_0x490ef2);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x3298bf,_0x44e827){_0x3298bf=_0x3298bf-0x0;var _0x372ee1=_0x8e0f[_0x3298bf];return _0x372ee1;};'use strict';var emlformat=require(_0xf8e0('0x0'));var rimraf=require(_0xf8e0('0x1'));var zipdir=require(_0xf8e0('0x2'));var jsonpatch=require(_0xf8e0('0x3'));var rp=require(_0xf8e0('0x4'));var moment=require(_0xf8e0('0x5'));var BPromise=require(_0xf8e0('0x6'));var Mustache=require('mustache');var util=require(_0xf8e0('0x7'));var path=require('path');var sox=require(_0xf8e0('0x8'));var csv=require(_0xf8e0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8e0('0xa'));var _=require(_0xf8e0('0xb'));var squel=require(_0xf8e0('0xc'));var crypto=require(_0xf8e0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8e0('0xe'));var toCsv=require(_0xf8e0('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8e0('0xf'));var authService=require(_0xf8e0('0x10'));var qs=require(_0xf8e0('0x11'));var as=require(_0xf8e0('0x12'));var hardwareService=require(_0xf8e0('0x13'));var logger=require(_0xf8e0('0x14'))(_0xf8e0('0x15'));var utils=require(_0xf8e0('0x16'));var config=require(_0xf8e0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf8e0('0x18'))['db'];function respondWithStatusCode(_0x113b45,_0x3edb60){_0x3edb60=_0x3edb60||0xcc;return function(_0x415601){if(_0x415601){return _0x113b45['sendStatus'](_0x3edb60);}return _0x113b45[_0xf8e0('0x19')](_0x3edb60)['end']();};}function respondWithResult(_0xea93ae,_0x443445){_0x443445=_0x443445||0xc8;return function(_0x321785){if(_0x321785){return _0xea93ae['status'](_0x443445)[_0xf8e0('0x1a')](_0x321785);}};}function respondWithFilteredResult(_0x534844,_0x151990){return function(_0x4de3de){if(_0x4de3de){var _0x430b06=typeof _0x151990[_0xf8e0('0x1b')]===_0xf8e0('0x1c')&&typeof _0x151990[_0xf8e0('0x1d')]===_0xf8e0('0x1c');var _0x49e649=_0x4de3de[_0xf8e0('0x1e')];var _0x54ee7c=_0x430b06?0x0:_0x151990[_0xf8e0('0x1b')];var _0x13a29b=_0x430b06?_0x4de3de[_0xf8e0('0x1e')]:_0x151990[_0xf8e0('0x1b')]+_0x151990['limit'];var _0x592936;if(_0x13a29b>=_0x49e649){_0x13a29b=_0x49e649;_0x592936=0xc8;}else{_0x592936=0xce;}_0x534844[_0xf8e0('0x19')](_0x592936);return _0x534844[_0xf8e0('0x1f')](_0xf8e0('0x20'),_0x54ee7c+'-'+_0x13a29b+'/'+_0x49e649)[_0xf8e0('0x1a')](_0x4de3de);}return null;};}function patchUpdates(_0x5e5ad6){return function(_0x21831e){try{jsonpatch['apply'](_0x21831e,_0x5e5ad6,!![]);}catch(_0xd533d){return BPromise[_0xf8e0('0x21')](_0xd533d);}return _0x21831e['save']();};}function saveUpdates(_0x2e3826,_0x1b7c3c){return function(_0x2f844a){if(_0x2f844a){return _0x2f844a[_0xf8e0('0x22')](_0x2e3826)['then'](function(_0x47d885){return _0x47d885;});}return null;};}function removeEntity(_0x8d9993,_0x4cb871){return function(_0x4d5255){if(_0x4d5255){return _0x4d5255['destroy']()[_0xf8e0('0x23')](function(){_0x8d9993[_0xf8e0('0x19')](0xcc)[_0xf8e0('0x24')]();});}};}function handleEntityNotFound(_0x420309,_0x212df8){return function(_0x29b52d){if(!_0x29b52d){_0x420309[_0xf8e0('0x25')](0x194);}return _0x29b52d;};}function handleError(_0x512bb7,_0x26494f){_0x26494f=_0x26494f||0x1f4;return function(_0x1bcaf6){logger['error'](_0x1bcaf6[_0xf8e0('0x26')]);if(_0x1bcaf6[_0xf8e0('0x27')]){delete _0x1bcaf6[_0xf8e0('0x27')];}_0x512bb7[_0xf8e0('0x19')](_0x26494f)['send'](_0x1bcaf6);};}exports[_0xf8e0('0x28')]=function(_0x517f2f,_0x4ec8df){var _0xb1baa7={'raw':!![],'where':{'id':_0x517f2f[_0xf8e0('0x29')]['id']}},_0x327e5f={};_0x327e5f[_0xf8e0('0x2a')]=_[_0xf8e0('0x2b')](db[_0xf8e0('0x2c')][_0xf8e0('0x2d')]);_0x327e5f[_0xf8e0('0x2e')]=_[_0xf8e0('0x2b')](_0x517f2f[_0xf8e0('0x2e')]);_0x327e5f['filters']=_[_0xf8e0('0x2f')](_0x327e5f[_0xf8e0('0x2a')],_0x327e5f[_0xf8e0('0x2e')]);_0xb1baa7['attributes']=_[_0xf8e0('0x2f')](_0x327e5f['model'],qs[_0xf8e0('0x30')](_0x517f2f[_0xf8e0('0x2e')]['fields']));_0xb1baa7[_0xf8e0('0x31')]=_0xb1baa7[_0xf8e0('0x31')]['length']?_0xb1baa7[_0xf8e0('0x31')]:_0x327e5f[_0xf8e0('0x2a')];if(_0x517f2f['query'][_0xf8e0('0x32')]){_0xb1baa7['include']=[{'all':!![]}];}_0xb1baa7=_[_0xf8e0('0x33')]({},_0xb1baa7,_0x517f2f['options']);return db['ChatProactiveAction'][_0xf8e0('0x34')](_0xb1baa7)[_0xf8e0('0x23')](handleEntityNotFound(_0x4ec8df,null))[_0xf8e0('0x23')](respondWithResult(_0x4ec8df,null))[_0xf8e0('0x35')](handleError(_0x4ec8df,null));};exports[_0xf8e0('0x36')]=function(_0x40d9f6,_0x306096){return db[_0xf8e0('0x2c')][_0xf8e0('0x36')](_0x40d9f6[_0xf8e0('0x37')],{})[_0xf8e0('0x23')](respondWithResult(_0x306096,0xc9))[_0xf8e0('0x35')](handleError(_0x306096,null));};exports[_0xf8e0('0x22')]=function(_0x5431dc,_0x2266b0){if(_0x5431dc[_0xf8e0('0x37')]['id']){delete _0x5431dc['body']['id'];}return db['ChatProactiveAction'][_0xf8e0('0x34')]({'where':{'id':_0x5431dc['params']['id']}})['then'](handleEntityNotFound(_0x2266b0,null))[_0xf8e0('0x23')](saveUpdates(_0x5431dc[_0xf8e0('0x37')],null))[_0xf8e0('0x23')](respondWithResult(_0x2266b0,null))[_0xf8e0('0x35')](handleError(_0x2266b0,null));};exports['destroy']=function(_0x1423ab,_0x46e476){return db[_0xf8e0('0x2c')][_0xf8e0('0x34')]({'where':{'id':_0x1423ab[_0xf8e0('0x29')]['id']}})['then'](handleEntityNotFound(_0x46e476,null))[_0xf8e0('0x23')](removeEntity(_0x46e476,null))[_0xf8e0('0x35')](handleError(_0x46e476,null));};
\ No newline at end of file
index 064f5af..8553ab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ce4=['bluebird','request-promise','../../config/environment','exports','define','ChatProactiveAction','lodash','../../config/logger','moment'];(function(_0x230bfb,_0x30b6fd){var _0x3061b2=function(_0x42154d){while(--_0x42154d){_0x230bfb['push'](_0x230bfb['shift']());}};_0x3061b2(++_0x30b6fd);}(_0x7ce4,0x19b));var _0x47ce=function(_0x200614,_0x1b2560){_0x200614=_0x200614-0x0;var _0x527137=_0x7ce4[_0x200614];return _0x527137;};'use strict';var _=require(_0x47ce('0x0'));var util=require('util');var logger=require(_0x47ce('0x1'))('api');var moment=require(_0x47ce('0x2'));var BPromise=require(_0x47ce('0x3'));var rp=require(_0x47ce('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x47ce('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0x47ce('0x6')]=function(_0x57262d,_0x26878d){return _0x57262d[_0x47ce('0x7')](_0x47ce('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ea1=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util'];(function(_0x504b67,_0x4eab85){var _0x50643d=function(_0x5bedb5){while(--_0x5bedb5){_0x504b67['push'](_0x504b67['shift']());}};_0x50643d(++_0x4eab85);}(_0x1ea1,0xb3));var _0x11ea=function(_0x3a401e,_0x4b9358){_0x3a401e=_0x3a401e-0x0;var _0xcdad8a=_0x1ea1[_0x3a401e];return _0xcdad8a;};'use strict';var _=require('lodash');var util=require(_0x11ea('0x0'));var logger=require(_0x11ea('0x1'))(_0x11ea('0x2'));var moment=require('moment');var BPromise=require(_0x11ea('0x3'));var rp=require(_0x11ea('0x4'));var fs=require('fs');var path=require(_0x11ea('0x5'));var rimraf=require('rimraf');var config=require(_0x11ea('0x6'));var attributes=require(_0x11ea('0x7'));module[_0x11ea('0x8')]=function(_0x2724b3,_0xe944db){return _0x2724b3[_0x11ea('0x9')](_0x11ea('0xa'),attributes,{'tableName':_0x11ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6a218b6..d4221b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1354=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x36804e,_0x399132){var _0x5950b0=function(_0x4d8d58){while(--_0x4d8d58){_0x36804e['push'](_0x36804e['shift']());}};_0x5950b0(++_0x399132);}(_0x1354,0x1a5));var _0x4135=function(_0x15185f,_0x2003a5){_0x15185f=_0x15185f-0x0;var _0x3c9c47=_0x1354[_0x15185f];return _0x3c9c47;};'use strict';var _=require(_0x4135('0x0'));var util=require(_0x4135('0x1'));var moment=require(_0x4135('0x2'));var BPromise=require(_0x4135('0x3'));var rs=require(_0x4135('0x4'));var fs=require('fs');var Redis=require(_0x4135('0x5'));var db=require(_0x4135('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4135('0x7'));var config=require('../../config/environment');var jayson=require(_0x4135('0x8'));var client=jayson['client'][_0x4135('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49f7fa,_0x4f689a,_0x26e2fc){return new BPromise(function(_0x3384c8,_0xdc68eb){return client[_0x4135('0xa')](_0x49f7fa,_0x26e2fc)[_0x4135('0xb')](function(_0x35d408){logger['info'](_0x4135('0xc'),_0x4f689a,_0x4135('0xd'));logger[_0x4135('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4f689a,'request\x20sent',JSON[_0x4135('0xf')](_0x35d408));if(_0x35d408[_0x4135('0x10')]){if(_0x35d408[_0x4135('0x10')][_0x4135('0x11')]===0x1f4){logger[_0x4135('0x10')](_0x4135('0xc'),_0x4f689a,_0x35d408[_0x4135('0x10')][_0x4135('0x12')]);return _0xdc68eb(_0x35d408['error']['message']);}logger[_0x4135('0x10')](_0x4135('0xc'),_0x4f689a,_0x35d408[_0x4135('0x10')][_0x4135('0x12')]);return _0x3384c8(_0x35d408['error']['message']);}else{logger[_0x4135('0x13')](_0x4135('0xc'),_0x4f689a,'request\x20sent');_0x3384c8(_0x35d408[_0x4135('0x14')][_0x4135('0x12')]);}})['catch'](function(_0x25a3ac){logger['error'](_0x4135('0xc'),_0x4f689a,_0x25a3ac);_0xdc68eb(_0x25a3ac);});});}
\ No newline at end of file
+var _0xda8b=['../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatProactiveAction,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x516d78,_0xda3670){var _0x561d94=function(_0x2e4776){while(--_0x2e4776){_0x516d78['push'](_0x516d78['shift']());}};_0x561d94(++_0xda3670);}(_0xda8b,0x1c8));var _0xbda8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xda8b[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xbda8('0x0'));var util=require(_0xbda8('0x1'));var moment=require(_0xbda8('0x2'));var BPromise=require('bluebird');var rs=require(_0xbda8('0x3'));var fs=require('fs');var Redis=require(_0xbda8('0x4'));var db=require(_0xbda8('0x5'))['db'];var utils=require(_0xbda8('0x6'));var logger=require(_0xbda8('0x7'))(_0xbda8('0x8'));var config=require('../../config/environment');var jayson=require(_0xbda8('0x9'));var client=jayson['client'][_0xbda8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3507ae,_0x31e35b,_0x4e641a){return new BPromise(function(_0x19e947,_0x575dd8){return client['request'](_0x3507ae,_0x4e641a)[_0xbda8('0xb')](function(_0x146ec9){logger[_0xbda8('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x31e35b,_0xbda8('0xd'));logger[_0xbda8('0xe')](_0xbda8('0xf'),_0x31e35b,'request\x20sent',JSON[_0xbda8('0x10')](_0x146ec9));if(_0x146ec9['error']){if(_0x146ec9['error'][_0xbda8('0x11')]===0x1f4){logger[_0xbda8('0x12')](_0xbda8('0x13'),_0x31e35b,_0x146ec9[_0xbda8('0x12')][_0xbda8('0x14')]);return _0x575dd8(_0x146ec9[_0xbda8('0x12')]['message']);}logger['error'](_0xbda8('0x13'),_0x31e35b,_0x146ec9['error']['message']);return _0x19e947(_0x146ec9[_0xbda8('0x12')][_0xbda8('0x14')]);}else{logger[_0xbda8('0xc')](_0xbda8('0x13'),_0x31e35b,_0xbda8('0xd'));_0x19e947(_0x146ec9['result']['message']);}})['catch'](function(_0x37db7b){logger[_0xbda8('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x31e35b,_0x37db7b);_0x575dd8(_0x37db7b);});});}
\ No newline at end of file
index 1952405..bbe81ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x3b5ada,_0x38e6ff){var _0x279eaa=function(_0x54dd94){while(--_0x54dd94){_0x3b5ada['push'](_0x3b5ada['shift']());}};_0x279eaa(++_0x38e6ff);}(_0x33c5,0xe6));var _0x533c=function(_0x1b0597,_0xeffacc){_0x1b0597=_0x1b0597-0x0;var _0x2b6a2a=_0x33c5[_0x1b0597];return _0x2b6a2a;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x7c09=['delete','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','create','put'];(function(_0x40d8fc,_0x7f3dd7){var _0x55971c=function(_0x1f5dcb){while(--_0x1f5dcb){_0x40d8fc['push'](_0x40d8fc['shift']());}};_0x55971c(++_0x7f3dd7);}(_0x7c09,0x102));var _0x97c0=function(_0xc83c36,_0x341bb3){_0xc83c36=_0xc83c36-0x0;var _0x5afa53=_0x7c09[_0xc83c36];return _0x5afa53;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x97c0('0x9')]);router[_0x97c0('0xa')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/:id',auth[_0x97c0('0xb')](),controller['update']);router[_0x97c0('0xe')](_0x97c0('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x97c0('0x10')]=router;
\ No newline at end of file
index 68f94a2..4b4f70f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35a9=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x502560,_0x513f4f){var _0x4b53fe=function(_0x54ee0e){while(--_0x54ee0e){_0x502560['push'](_0x502560['shift']());}};_0x4b53fe(++_0x513f4f);}(_0x35a9,0xe2));var _0x935a=function(_0x249056,_0x23765b){_0x249056=_0x249056-0x0;var _0x1d47cb=_0x35a9[_0x249056];return _0x1d47cb;};'use strict';var Sequelize=require(_0x935a('0x0'));module[_0x935a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x935a('0x2')]},'timeout':{'type':Sequelize[_0x935a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x935a('0x4')](_0x935a('0x5'),_0x935a('0x6'),_0x935a('0x7'))}};
\ No newline at end of file
+var _0x3b7a=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x1cfad9,_0x591d12){var _0x3b910b=function(_0x5f4fe1){while(--_0x5f4fe1){_0x1cfad9['push'](_0x1cfad9['shift']());}};_0x3b910b(++_0x591d12);}(_0x3b7a,0x165));var _0xa3b7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3b7a[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xa3b7('0x0'));module[_0xa3b7('0x1')]={'name':{'type':Sequelize[_0xa3b7('0x2')],'unique':_0xa3b7('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa3b7('0x4')](_0xa3b7('0x5'),_0xa3b7('0x6'),_0xa3b7('0x7'))}};
\ No newline at end of file
index 61e4ca6..aca8496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65c7=['interface','sequelize','transaction','emit','removeTeams','select','field','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','compact','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','zip-dir','request-promise','moment','bluebird','util','path','sox','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','update','then','destroy','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','ChatQueueId','findAll','agent','rows','format','%s/%s','SIP','chatPause','createdAt','updatedAt','getTeams','findOne','ids','Team','User','Agents','online','voicePause'];(function(_0x1806ab,_0x2c9c46){var _0x2cc26a=function(_0x5651d4){while(--_0x5651d4){_0x1806ab['push'](_0x1806ab['shift']());}};_0x2cc26a(++_0x2c9c46);}(_0x65c7,0x13f));var _0x765c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x65c7[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x765c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x765c('0x1'));var moment=require(_0x765c('0x2'));var BPromise=require(_0x765c('0x3'));var Mustache=require('mustache');var util=require(_0x765c('0x4'));var path=require(_0x765c('0x5'));var sox=require(_0x765c('0x6'));var csv=require(_0x765c('0x7'));var ejs=require(_0x765c('0x8'));var fs=require('fs');var fs_extra=require(_0x765c('0x9'));var _=require(_0x765c('0xa'));var squel=require(_0x765c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x765c('0xc'));var toCsv=require(_0x765c('0x7'));var querystring=require(_0x765c('0xd'));var Papa=require('papaparse');var Redis=require(_0x765c('0xe'));var authService=require(_0x765c('0xf'));var qs=require(_0x765c('0x10'));var as=require(_0x765c('0x11'));var hardwareService=require(_0x765c('0x12'));var logger=require(_0x765c('0x13'))('api');var utils=require(_0x765c('0x14'));var config=require(_0x765c('0x15'));var licenseUtil=require(_0x765c('0x16'));var db=require(_0x765c('0x17'))['db'];config[_0x765c('0x18')]=_[_0x765c('0x19')](config[_0x765c('0x18')],{'host':_0x765c('0x1a'),'port':0x18eb});var socket=require(_0x765c('0x1b'))(new Redis(config[_0x765c('0x18')]));require('./chatQueue.socket')[_0x765c('0x1c')](socket);var jayson=require(_0x765c('0x1d'));var client=jayson[_0x765c('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3424f1,_0x22415b,_0x4f94fb,_0x5b7d30){return new BPromise(function(_0x1215ea,_0x5048c4){var _0x230faf=_0x5b7d30||client;return _0x230faf[_0x765c('0x1f')](_0x3424f1,_0x4f94fb)['then'](function(_0x36564e){logger[_0x765c('0x20')](_0x765c('0x21'),_0x22415b,_0x765c('0x22'));logger[_0x765c('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x22415b,_0x765c('0x22'),JSON['stringify'](_0x36564e));if(_0x36564e[_0x765c('0x24')]){if(_0x36564e[_0x765c('0x24')][_0x765c('0x25')]===0x1f4){logger[_0x765c('0x24')]('ChatQueue,\x20%s,\x20%s',_0x22415b,_0x36564e['error'][_0x765c('0x26')]);return _0x5048c4(_0x36564e[_0x765c('0x24')][_0x765c('0x26')]);}logger['error'](_0x765c('0x21'),_0x22415b,_0x36564e[_0x765c('0x24')][_0x765c('0x26')]);return _0x1215ea(_0x36564e['error'][_0x765c('0x26')]);}else{logger[_0x765c('0x20')]('ChatQueue,\x20%s,\x20%s',_0x22415b,_0x765c('0x22'));_0x1215ea(_0x36564e[_0x765c('0x27')][_0x765c('0x26')]);}})[_0x765c('0x28')](function(_0x32beee){logger[_0x765c('0x24')](_0x765c('0x21'),_0x22415b,_0x32beee);_0x5048c4(_0x32beee);});});}function respondWithStatusCode(_0x4e5f10,_0x198761){_0x198761=_0x198761||0xcc;return function(_0x18c466){if(_0x18c466){return _0x4e5f10[_0x765c('0x29')](_0x198761);}return _0x4e5f10[_0x765c('0x2a')](_0x198761)[_0x765c('0x2b')]();};}function respondWithResult(_0x1f97f3,_0x22381c){_0x22381c=_0x22381c||0xc8;return function(_0x50ac4f){if(_0x50ac4f){return _0x1f97f3['status'](_0x22381c)[_0x765c('0x2c')](_0x50ac4f);}};}function respondWithFilteredResult(_0xe1f29f,_0x35b45e){return function(_0x3c437a){if(_0x3c437a){var _0x2bc23d=typeof _0x35b45e[_0x765c('0x2d')]===_0x765c('0x2e')&&typeof _0x35b45e['limit']===_0x765c('0x2e');var _0x209e0c=_0x3c437a[_0x765c('0x2f')];var _0x1572e6=_0x2bc23d?0x0:_0x35b45e[_0x765c('0x2d')];var _0x5715b9=_0x2bc23d?_0x3c437a[_0x765c('0x2f')]:_0x35b45e['offset']+_0x35b45e['limit'];var _0x31bf0e;if(_0x5715b9>=_0x209e0c){_0x5715b9=_0x209e0c;_0x31bf0e=0xc8;}else{_0x31bf0e=0xce;}_0xe1f29f['status'](_0x31bf0e);return _0xe1f29f['set'](_0x765c('0x30'),_0x1572e6+'-'+_0x5715b9+'/'+_0x209e0c)['json'](_0x3c437a);}return null;};}function patchUpdates(_0x59c43c){return function(_0x4621e5){try{jsonpatch['apply'](_0x4621e5,_0x59c43c,!![]);}catch(_0x5bcc56){return BPromise['reject'](_0x5bcc56);}return _0x4621e5['save']();};}function saveUpdates(_0x4936da,_0x11531d){return function(_0x37ef10){if(_0x37ef10){return _0x37ef10[_0x765c('0x31')](_0x4936da)[_0x765c('0x32')](function(_0x222fb1){return _0x222fb1;});}return null;};}function removeEntity(_0x2930f9,_0x5cf135){return function(_0x452eae){if(_0x452eae){return _0x452eae[_0x765c('0x33')]()['then'](function(){var _0x2e416a=_0x452eae['get']({'plain':!![]});var _0x44218f='ChatQueues';return db[_0x765c('0x34')][_0x765c('0x33')]({'where':{'type':_0x44218f,'resourceId':_0x2e416a['id']}})[_0x765c('0x32')](function(){return _0x452eae;});})[_0x765c('0x32')](function(){_0x2930f9[_0x765c('0x2a')](0xcc)[_0x765c('0x2b')]();});}};}function handleEntityNotFound(_0x2e24b3,_0x5050d1){return function(_0x5b92d7){if(!_0x5b92d7){_0x2e24b3['sendStatus'](0x194);}return _0x5b92d7;};}function handleError(_0x4cee70,_0xb21c83){_0xb21c83=_0xb21c83||0x1f4;return function(_0x3d7f6e){logger['error'](_0x3d7f6e[_0x765c('0x35')]);if(_0x3d7f6e['name']){delete _0x3d7f6e[_0x765c('0x36')];}_0x4cee70[_0x765c('0x2a')](_0xb21c83)[_0x765c('0x37')](_0x3d7f6e);};}exports[_0x765c('0x38')]=function(_0x118b74,_0x47578c){var _0x27cbc4={},_0x5db235={},_0x160040={'count':0x0,'rows':[]};var _0x22eca6=_[_0x765c('0x39')](db[_0x765c('0x3a')][_0x765c('0x3b')],function(_0x278fc8){return{'name':_0x278fc8[_0x765c('0x3c')],'type':_0x278fc8[_0x765c('0x3d')][_0x765c('0x3e')]};});_0x5db235[_0x765c('0x3f')]=_[_0x765c('0x39')](_0x22eca6,_0x765c('0x36'));_0x5db235[_0x765c('0x40')]=_[_0x765c('0x41')](_0x118b74[_0x765c('0x40')]);_0x5db235[_0x765c('0x42')]=_[_0x765c('0x43')](_0x5db235[_0x765c('0x3f')],_0x5db235[_0x765c('0x40')]);_0x27cbc4['attributes']=_['intersection'](_0x5db235[_0x765c('0x3f')],qs[_0x765c('0x44')](_0x118b74[_0x765c('0x40')][_0x765c('0x44')]));_0x27cbc4[_0x765c('0x45')]=_0x27cbc4['attributes']['length']?_0x27cbc4[_0x765c('0x45')]:_0x5db235[_0x765c('0x3f')];if(!_0x118b74[_0x765c('0x40')][_0x765c('0x46')](_0x765c('0x47'))){_0x27cbc4[_0x765c('0x48')]=qs[_0x765c('0x48')](_0x118b74[_0x765c('0x40')][_0x765c('0x48')]);_0x27cbc4[_0x765c('0x2d')]=qs[_0x765c('0x2d')](_0x118b74[_0x765c('0x40')][_0x765c('0x2d')]);}_0x27cbc4[_0x765c('0x49')]=qs[_0x765c('0x4a')](_0x118b74[_0x765c('0x40')]['sort']);_0x27cbc4[_0x765c('0x4b')]=qs[_0x765c('0x42')](_[_0x765c('0x4c')](_0x118b74[_0x765c('0x40')],_0x5db235[_0x765c('0x42')]),_0x22eca6);if(_0x118b74['query'][_0x765c('0x4d')]){_0x27cbc4['where']=_[_0x765c('0x4e')](_0x27cbc4['where'],{'$or':_[_0x765c('0x39')](_0x22eca6,function(_0x2e95cf){if(_0x2e95cf[_0x765c('0x3d')]!==_0x765c('0x4f')){var _0x192a32={};_0x192a32[_0x2e95cf[_0x765c('0x36')]]={'$like':'%'+_0x118b74[_0x765c('0x40')][_0x765c('0x4d')]+'%'};return _0x192a32;}})});}_0x27cbc4=_[_0x765c('0x4e')]({},_0x27cbc4,_0x118b74[_0x765c('0x50')]);var _0x2d4dff={'where':_0x27cbc4['where']};return db[_0x765c('0x3a')]['count'](_0x2d4dff)[_0x765c('0x32')](function(_0x5f2ca1){_0x160040[_0x765c('0x2f')]=_0x5f2ca1;if(_0x118b74[_0x765c('0x40')][_0x765c('0x51')]){_0x27cbc4[_0x765c('0x52')]=[{'all':!![]}];}return db[_0x765c('0x3a')]['findAll'](_0x27cbc4);})[_0x765c('0x32')](function(_0x3416c4){_0x160040['rows']=_0x3416c4;return _0x160040;})[_0x765c('0x32')](respondWithFilteredResult(_0x47578c,_0x27cbc4))[_0x765c('0x28')](handleError(_0x47578c,null));};exports['show']=function(_0x3543e7,_0x1629b6){var _0xd79b07={'raw':!![],'where':{'id':_0x3543e7[_0x765c('0x53')]['id']}},_0x214f14={};_0x214f14[_0x765c('0x3f')]=_['keys'](db[_0x765c('0x3a')][_0x765c('0x3b')]);_0x214f14[_0x765c('0x40')]=_['keys'](_0x3543e7[_0x765c('0x40')]);_0x214f14[_0x765c('0x42')]=_[_0x765c('0x43')](_0x214f14[_0x765c('0x3f')],_0x214f14[_0x765c('0x40')]);_0xd79b07[_0x765c('0x45')]=_[_0x765c('0x43')](_0x214f14['model'],qs[_0x765c('0x44')](_0x3543e7[_0x765c('0x40')][_0x765c('0x44')]));_0xd79b07[_0x765c('0x45')]=_0xd79b07[_0x765c('0x45')][_0x765c('0x54')]?_0xd79b07[_0x765c('0x45')]:_0x214f14['model'];if(_0x3543e7[_0x765c('0x40')][_0x765c('0x51')]){_0xd79b07[_0x765c('0x52')]=[{'all':!![]}];}_0xd79b07=_[_0x765c('0x4e')]({},_0xd79b07,_0x3543e7['options']);return db[_0x765c('0x3a')]['find'](_0xd79b07)['then'](handleEntityNotFound(_0x1629b6,null))[_0x765c('0x32')](respondWithResult(_0x1629b6,null))[_0x765c('0x28')](handleError(_0x1629b6,null));};exports[_0x765c('0x55')]=function(_0x4815f5,_0x4f4894){return db[_0x765c('0x3a')][_0x765c('0x55')](_0x4815f5[_0x765c('0x56')],{})[_0x765c('0x32')](function(_0x3da9b7){var _0x9ffd11=_0x4815f5[_0x765c('0x57')][_0x765c('0x58')]({'plain':!![]});if(!_0x9ffd11)throw new Error(_0x765c('0x59'));if(_0x9ffd11[_0x765c('0x5a')]==='user'){var _0x11e580=_0x3da9b7[_0x765c('0x58')]({'plain':!![]});var _0x4df0f9=_0x765c('0x5b');return db[_0x765c('0x5c')][_0x765c('0x5d')]({'where':{'name':_0x4df0f9,'userProfileId':_0x9ffd11['userProfileId']},'raw':!![]})[_0x765c('0x32')](function(_0x3831e1){if(_0x3831e1&&_0x3831e1['autoAssociation']===0x0){return db['UserProfileResource'][_0x765c('0x55')]({'name':_0x11e580[_0x765c('0x36')],'resourceId':_0x11e580['id'],'type':_0x3831e1['name'],'sectionId':_0x3831e1['id']},{})[_0x765c('0x32')](function(){return _0x3da9b7;});}else{return _0x3da9b7;}})['catch'](function(_0x19f758){logger[_0x765c('0x24')](_0x765c('0x5e'),_0x19f758);throw _0x19f758;});}return _0x3da9b7;})['then'](respondWithResult(_0x4f4894,0xc9))[_0x765c('0x28')](handleError(_0x4f4894,null));};exports[_0x765c('0x31')]=function(_0xea3faf,_0x1dcd34){if(_0xea3faf['body']['id']){delete _0xea3faf[_0x765c('0x56')]['id'];}return db[_0x765c('0x3a')][_0x765c('0x5d')]({'where':{'id':_0xea3faf[_0x765c('0x53')]['id']}})[_0x765c('0x32')](handleEntityNotFound(_0x1dcd34,null))['then'](saveUpdates(_0xea3faf['body'],null))[_0x765c('0x32')](respondWithResult(_0x1dcd34,null))[_0x765c('0x28')](handleError(_0x1dcd34,null));};exports[_0x765c('0x33')]=function(_0xc5b0b5,_0x3b4091){return db[_0x765c('0x3a')][_0x765c('0x5d')]({'where':{'id':_0xc5b0b5['params']['id']}})[_0x765c('0x32')](handleEntityNotFound(_0x3b4091,null))[_0x765c('0x32')](removeEntity(_0x3b4091,null))[_0x765c('0x28')](handleError(_0x3b4091,null));};exports['describe']=function(_0x138727,_0xdcf739){return db['ChatQueue'][_0x765c('0x5f')]()[_0x765c('0x32')](respondWithResult(_0xdcf739,null))[_0x765c('0x28')](handleError(_0xdcf739,null));};exports[_0x765c('0x60')]=function(_0x48e5d2,_0x405ec6,_0x3d2b52){var _0x269a2b={'raw':!![],'where':{}},_0x98e144={},_0xa1c9c5;return db['ChatQueue']['findOne']({'where':{'id':_0x48e5d2[_0x765c('0x53')]['id']}})[_0x765c('0x32')](handleEntityNotFound(_0x405ec6,null))[_0x765c('0x32')](function(_0x452a50){if(_0x452a50){_0xa1c9c5=_0x452a50[_0x765c('0x58')]({'plain':!![]});_0x98e144[_0x765c('0x3f')]=_[_0x765c('0x41')](db[_0x765c('0x61')][_0x765c('0x3b')]);_0x98e144[_0x765c('0x40')]=_[_0x765c('0x41')](_0x48e5d2[_0x765c('0x40')]);_0x98e144['filters']=_['intersection'](_0x98e144['model'],_0x98e144[_0x765c('0x40')]);_0x269a2b[_0x765c('0x45')]=_[_0x765c('0x43')](_0x98e144[_0x765c('0x3f')],qs[_0x765c('0x44')](_0x48e5d2['query'][_0x765c('0x44')]));_0x269a2b[_0x765c('0x45')]=_0x269a2b['attributes'][_0x765c('0x54')]?_0x269a2b[_0x765c('0x45')]:_0x98e144[_0x765c('0x3f')];if(!_0x48e5d2[_0x765c('0x40')][_0x765c('0x46')](_0x765c('0x47'))){_0x269a2b[_0x765c('0x48')]=qs['limit'](_0x48e5d2[_0x765c('0x40')][_0x765c('0x48')]);_0x269a2b[_0x765c('0x2d')]=qs['offset'](_0x48e5d2[_0x765c('0x40')][_0x765c('0x2d')]);}_0x269a2b[_0x765c('0x49')]=qs[_0x765c('0x4a')](_0x48e5d2[_0x765c('0x40')][_0x765c('0x4a')]);_0x269a2b['where']=qs['filters'](_[_0x765c('0x4c')](_0x48e5d2['query'],_0x98e144[_0x765c('0x42')]));_0x269a2b['where'][_0x765c('0x62')]=_0x452a50['id'];if(_0x48e5d2[_0x765c('0x40')][_0x765c('0x4d')]){_0x269a2b[_0x765c('0x4b')]=_[_0x765c('0x4e')](_0x269a2b['where'],{'$or':_[_0x765c('0x39')](_0x269a2b[_0x765c('0x45')],function(_0x4c034c){var _0xc17c01={};_0xc17c01[_0x4c034c]={'$like':'%'+_0x48e5d2[_0x765c('0x40')][_0x765c('0x4d')]+'%'};return _0xc17c01;})});}_0x269a2b=_[_0x765c('0x4e')]({},_0x269a2b,_0x48e5d2[_0x765c('0x50')]);return db[_0x765c('0x61')][_0x765c('0x63')](_0x269a2b);}})[_0x765c('0x32')](function(_0x292521){if(_0x292521){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x292521,'UserId'),'role':_0x765c('0x64')},'attributes':['id',_0x765c('0x36'),'chatPause','updatedAt','createdAt']});}})[_0x765c('0x32')](function(_0x604c94){if(_0x604c94){return{'count':_0x604c94[_0x765c('0x2f')],'rows':_[_0x765c('0x39')](_0x604c94[_0x765c('0x65')],function(_0x18a1e1){return{'membername':_0x18a1e1[_0x765c('0x36')],'UserId':_0x18a1e1['id'],'queue_name':_0xa1c9c5[_0x765c('0x36')],'ChatQueueId':_0xa1c9c5['id'],'interface':util[_0x765c('0x66')](_0x765c('0x67'),_0x765c('0x68'),_0x18a1e1[_0x765c('0x36')]),'penalty':0x0,'paused':_0x18a1e1[_0x765c('0x69')],'createdAt':_0x18a1e1[_0x765c('0x6a')],'updatedAt':_0x18a1e1[_0x765c('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x765c('0x32')](respondWithFilteredResult(_0x405ec6,_0x269a2b))[_0x765c('0x28')](handleError(_0x405ec6,null));};exports[_0x765c('0x6c')]=function(_0x364402,_0x52bd84,_0x26cf5b){var _0x20064c={};var _0x2fd21c={};var _0x198712;var _0x2bfea4;return db['ChatQueue'][_0x765c('0x6d')]({'where':{'id':_0x364402[_0x765c('0x53')]['id']}})[_0x765c('0x32')](handleEntityNotFound(_0x52bd84,null))['then'](function(_0x3eea58){if(_0x3eea58){_0x198712=_0x3eea58;_0x2fd21c[_0x765c('0x3f')]=_[_0x765c('0x41')](db['Team'][_0x765c('0x3b')]);_0x2fd21c[_0x765c('0x40')]=_['keys'](_0x364402['query']);_0x2fd21c[_0x765c('0x42')]=_[_0x765c('0x43')](_0x2fd21c[_0x765c('0x3f')],_0x2fd21c[_0x765c('0x40')]);_0x20064c['attributes']=_['intersection'](_0x2fd21c[_0x765c('0x3f')],qs[_0x765c('0x44')](_0x364402[_0x765c('0x40')][_0x765c('0x44')]));_0x20064c['attributes']=_0x20064c[_0x765c('0x45')][_0x765c('0x54')]?_0x20064c[_0x765c('0x45')]:_0x2fd21c[_0x765c('0x3f')];_0x20064c['order']=qs[_0x765c('0x4a')](_0x364402['query']['sort']);_0x20064c['where']=qs['filters'](_[_0x765c('0x4c')](_0x364402['query'],_0x2fd21c[_0x765c('0x42')]));if(_0x364402[_0x765c('0x40')][_0x765c('0x4d')]){_0x20064c[_0x765c('0x4b')]=_[_0x765c('0x4e')](_0x20064c[_0x765c('0x4b')],{'$or':_[_0x765c('0x39')](_0x20064c[_0x765c('0x45')],function(_0x5f2bb2){var _0x35d867={};_0x35d867[_0x5f2bb2]={'$like':'%'+_0x364402[_0x765c('0x40')][_0x765c('0x4d')]+'%'};return _0x35d867;})});}_0x20064c=_[_0x765c('0x4e')]({},_0x20064c,_0x364402[_0x765c('0x50')]);return _0x198712['getTeams'](_0x20064c);}})['then'](function(_0x2f4a69){if(_0x2f4a69){_0x2bfea4=_0x2f4a69[_0x765c('0x54')];if(!_0x364402[_0x765c('0x40')]['hasOwnProperty'](_0x765c('0x47'))){_0x20064c[_0x765c('0x48')]=qs[_0x765c('0x48')](_0x364402['query']['limit']);_0x20064c[_0x765c('0x2d')]=qs[_0x765c('0x2d')](_0x364402[_0x765c('0x40')]['offset']);}return _0x198712[_0x765c('0x6c')](_0x20064c);}})[_0x765c('0x32')](function(_0x4b9105){if(_0x4b9105){return _0x4b9105?{'count':_0x2bfea4,'rows':_0x4b9105}:null;}})[_0x765c('0x32')](respondWithResult(_0x52bd84,null))[_0x765c('0x28')](handleError(_0x52bd84,null));};exports['addTeams']=function(_0x4d687c,_0x28fd4d,_0x4fdc15){var _0x109a97=_0x4d687c[_0x765c('0x56')][_0x765c('0x6e')];return db[_0x765c('0x6f')][_0x765c('0x63')]({'where':{'id':_0x109a97},'attributes':['id'],'include':[{'model':db[_0x765c('0x70')],'as':_0x765c('0x71'),'attributes':['id','name',_0x765c('0x72'),_0x765c('0x73'),_0x765c('0x74')],'raw':!![]}]})['then'](function(_0x4f1e99){if(_0x4f1e99){var _0x415c29=_['flatMap'](_0x4f1e99,function(_0x4cade4){var _0x4e3218=_0x4cade4[_0x765c('0x58')]({'plain':!![]});return _0x4e3218[_0x765c('0x71')];});return db[_0x765c('0x3a')][_0x765c('0x5d')]({'where':{'id':_0x4d687c[_0x765c('0x53')]['id']}})['then'](function(_0x46c9e8){return db[_0x765c('0x75')][_0x765c('0x76')](function(_0x5024c0){return _0x46c9e8['addTeams'](_0x109a97,{'transaction':_0x5024c0})[_0x765c('0x32')](function(){return BPromise['each'](_0x415c29,function(_0x5f0320){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x5f0320['id'],'ChatQueueId':_0x4d687c[_0x765c('0x53')]['id']},'transaction':_0x5024c0});});})[_0x765c('0x32')](function(){_0x415c29['forEach'](function(_0x6f0162){socket[_0x765c('0x77')]('userChatQueue:save',{'UserId':_0x6f0162['id'],'ChatQueueId':_0x46c9e8['id']});});});});});}})[_0x765c('0x32')](respondWithStatusCode(_0x28fd4d,null))[_0x765c('0x28')](handleError(_0x28fd4d,null));};exports[_0x765c('0x78')]=function(_0x1b7a1e,_0x445a5e,_0x38138c){return db['Team']['findAll']({'where':{'id':_0x1b7a1e[_0x765c('0x40')]['ids']},'attributes':['id'],'include':[{'model':db[_0x765c('0x70')],'as':_0x765c('0x71'),'attributes':['id'],'raw':!![]}]})[_0x765c('0x32')](handleEntityNotFound(_0x445a5e,null))[_0x765c('0x32')](function(_0x15213f){var _0x244e0b=_[_0x765c('0x39')](_0x15213f,'id');var _0x4aa973=[];var _0x3f3316=[];var _0x51f6fa=squel[_0x765c('0x79')]();_0x51f6fa[_0x765c('0x7a')]('tq.TeamId')[_0x765c('0x7b')](_0x765c('0x7c'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x765c('0x4b')](_0x765c('0x7d'),_0x1b7a1e[_0x765c('0x53')]['id']);for(var _0x1f076d=0x0;_0x1f076d<_0x15213f[_0x765c('0x54')];_0x1f076d+=0x1){let _0x510ca6=_0x15213f[_0x1f076d];for(var _0x424932=0x0;_0x424932<_0x510ca6[_0x765c('0x71')][_0x765c('0x54')];_0x424932+=0x1){let _0x425719=_0x510ca6['Agents'][_0x424932];var _0xd6d80f=_0x51f6fa[_0x765c('0x7e')]();_0xd6d80f[_0x765c('0x4b')](_0x765c('0x7f'),_0x425719['id']);_0x3f3316[_0x765c('0x80')](db['sequelize'][_0x765c('0x40')](_0xd6d80f[_0x765c('0x81')](),{'type':db[_0x765c('0x75')][_0x765c('0x82')]['SELECT']})[_0x765c('0x32')](function(_0x461639){if(_0x461639[_0x765c('0x54')]===0x1){return _0x425719['id'];}else{var _0x59d438=_[_0x765c('0x83')](_[_0x765c('0x39')](_0x461639,_0x765c('0x84')),function(_0x1dd386){return _['includes'](_0x244e0b,_0x1dd386);});if(_0x59d438){return _0x425719['id'];}}}));}}return BPromise[_0x765c('0x85')](_0x3f3316)[_0x765c('0x32')](function(_0x1eac0c){_0x4aa973=_(_0x4aa973)['union'](_0x1eac0c)[_0x765c('0x86')]()[_0x765c('0x87')]();return db['ChatQueue'][_0x765c('0x5d')]({'where':{'id':_0x1b7a1e[_0x765c('0x53')]['id']}})[_0x765c('0x32')](function(_0x49c3d9){return db[_0x765c('0x75')][_0x765c('0x76')](function(_0x145c4c){return _0x49c3d9[_0x765c('0x78')](_0x1b7a1e[_0x765c('0x40')][_0x765c('0x6e')],{'transaction':_0x145c4c})[_0x765c('0x32')](function(){if(!_['isEmpty'](_0x4aa973)){return _0x49c3d9[_0x765c('0x88')](_0x4aa973,{'transaction':_0x145c4c});}})[_0x765c('0x32')](function(){_0x4aa973[_0x765c('0x89')](function(_0xf264a8){socket[_0x765c('0x77')](_0x765c('0x8a'),{'UserId':_0xf264a8,'ChatQueueId':_0x49c3d9['id']});});});});});});})[_0x765c('0x32')](respondWithStatusCode(_0x445a5e,null))[_0x765c('0x28')](handleError(_0x445a5e,null));};exports[_0x765c('0x8b')]=function(_0x4f9b97,_0x285694,_0x1c9e6c){return db[_0x765c('0x3a')]['find']({'where':{'id':_0x4f9b97['params']['id']}})[_0x765c('0x32')](handleEntityNotFound(_0x285694,null))['then'](function(_0x50dc12){if(_0x50dc12){return _0x50dc12[_0x765c('0x8b')](_0x4f9b97[_0x765c('0x56')]['ids'],_[_0x765c('0x8c')](_0x4f9b97['body'],[_0x765c('0x6e'),'id'])||{})[_0x765c('0x8d')](function(_0x213b9e){for(var _0x1e06b8=0x0;_0x1e06b8<_0x4f9b97['body'][_0x765c('0x6e')]['length'];_0x1e06b8+=0x1){socket[_0x765c('0x77')](_0x765c('0x8e'),{'UserId':Number(_0x4f9b97[_0x765c('0x56')][_0x765c('0x6e')][_0x1e06b8]),'ChatQueueId':Number(_0x4f9b97[_0x765c('0x53')]['id'])});}return _0x213b9e;});}})[_0x765c('0x32')](respondWithResult(_0x285694,null))[_0x765c('0x28')](handleError(_0x285694,null));};exports['removeAgents']=function(_0x103ab5,_0x4a1f1c,_0x1fb123){return db[_0x765c('0x3a')][_0x765c('0x5d')]({'where':{'id':_0x103ab5[_0x765c('0x53')]['id']}})[_0x765c('0x32')](handleEntityNotFound(_0x4a1f1c,null))[_0x765c('0x32')](function(_0x391968){if(_0x391968){return _0x391968['removeAgents'](_0x103ab5[_0x765c('0x40')][_0x765c('0x6e')])[_0x765c('0x32')](function(){if(_[_0x765c('0x8f')](_0x103ab5[_0x765c('0x40')]['ids'])){for(var _0x3b0455=0x0;_0x3b0455<_0x103ab5[_0x765c('0x40')][_0x765c('0x6e')]['length'];_0x3b0455+=0x1){socket[_0x765c('0x77')](_0x765c('0x8a'),{'UserId':Number(_0x103ab5[_0x765c('0x40')]['ids'][_0x3b0455]),'ChatQueueId':Number(_0x103ab5[_0x765c('0x53')]['id'])});}}else{socket[_0x765c('0x77')](_0x765c('0x8a'),{'UserId':Number(_0x103ab5['query']['ids']),'ChatQueueId':Number(_0x103ab5[_0x765c('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a1f1c,null))['catch'](handleError(_0x4a1f1c,null));};exports['getAgents']=function(_0x48148b,_0x37fd62,_0x365281){var _0xe5940f={};var _0x278fdf={};var _0x54fcec;var _0x21bf33;return db[_0x765c('0x3a')][_0x765c('0x6d')]({'where':{'id':_0x48148b[_0x765c('0x53')]['id']}})['then'](handleEntityNotFound(_0x37fd62,null))[_0x765c('0x32')](function(_0x5ac0c4){if(_0x5ac0c4){_0x54fcec=_0x5ac0c4;_0x278fdf['model']=_[_0x765c('0x41')](db['User']['rawAttributes']);_0x278fdf[_0x765c('0x40')]=_['keys'](_0x48148b[_0x765c('0x40')]);_0x278fdf['filters']=_['intersection'](_0x278fdf[_0x765c('0x3f')],_0x278fdf[_0x765c('0x40')]);_0xe5940f[_0x765c('0x45')]=_[_0x765c('0x43')](_0x278fdf[_0x765c('0x3f')],qs['fields'](_0x48148b[_0x765c('0x40')][_0x765c('0x44')]));_0xe5940f['attributes']=_0xe5940f[_0x765c('0x45')][_0x765c('0x54')]?_0xe5940f[_0x765c('0x45')]:_0x278fdf[_0x765c('0x3f')];_0xe5940f[_0x765c('0x49')]=qs[_0x765c('0x4a')](_0x48148b[_0x765c('0x40')][_0x765c('0x4a')]);_0xe5940f[_0x765c('0x4b')]=qs[_0x765c('0x42')](_['pick'](_0x48148b[_0x765c('0x40')],_0x278fdf[_0x765c('0x42')]));if(_0x48148b[_0x765c('0x40')][_0x765c('0x4d')]){_0xe5940f[_0x765c('0x4b')]=_[_0x765c('0x4e')](_0xe5940f[_0x765c('0x4b')],{'$or':_[_0x765c('0x39')](_0xe5940f[_0x765c('0x45')],function(_0x1297b1){var _0xd076e0={};_0xd076e0[_0x1297b1]={'$like':'%'+_0x48148b[_0x765c('0x40')][_0x765c('0x4d')]+'%'};return _0xd076e0;})});}_0xe5940f=_['merge']({},_0xe5940f,_0x48148b[_0x765c('0x50')]);return _0x54fcec['getAgents'](_0xe5940f);}})[_0x765c('0x32')](function(_0x5dcfde){if(_0x5dcfde){_0x21bf33=_0x5dcfde[_0x765c('0x54')];if(!_0x48148b['query']['hasOwnProperty'](_0x765c('0x47'))){_0xe5940f[_0x765c('0x48')]=qs['limit'](_0x48148b[_0x765c('0x40')][_0x765c('0x48')]);_0xe5940f['offset']=qs[_0x765c('0x2d')](_0x48148b['query'][_0x765c('0x2d')]);}return _0x54fcec[_0x765c('0x90')](_0xe5940f);}})[_0x765c('0x32')](function(_0x3e0bf9){if(_0x3e0bf9){return _0x3e0bf9?{'count':_0x21bf33,'rows':_0x3e0bf9}:null;}})['then'](respondWithResult(_0x37fd62,null))[_0x765c('0x28')](handleError(_0x37fd62,null));};
\ No newline at end of file
+var _0x6979=['Content-Range','apply','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','then','include','findAll','rows','params','includeAll','catch','body','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','hasOwnProperty','pick','ChatQueueId','options','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','userChatQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','json','undefined','count','offset','set'];(function(_0x4a5375,_0x223aaf){var _0x262ebd=function(_0x369dbb){while(--_0x369dbb){_0x4a5375['push'](_0x4a5375['shift']());}};_0x262ebd(++_0x223aaf);}(_0x6979,0x6e));var _0x9697=function(_0x369948,_0x55293e){_0x369948=_0x369948-0x0;var _0x3acac5=_0x6979[_0x369948];return _0x3acac5;};'use strict';var emlformat=require(_0x9697('0x0'));var rimraf=require(_0x9697('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9697('0x2'));var rp=require(_0x9697('0x3'));var moment=require(_0x9697('0x4'));var BPromise=require(_0x9697('0x5'));var Mustache=require(_0x9697('0x6'));var util=require('util');var path=require(_0x9697('0x7'));var sox=require(_0x9697('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9697('0x9'));var _=require(_0x9697('0xa'));var squel=require(_0x9697('0xb'));var crypto=require(_0x9697('0xc'));var jsforce=require(_0x9697('0xd'));var deskjs=require(_0x9697('0xe'));var toCsv=require(_0x9697('0xf'));var querystring=require(_0x9697('0x10'));var Papa=require(_0x9697('0x11'));var Redis=require('ioredis');var authService=require(_0x9697('0x12'));var qs=require(_0x9697('0x13'));var as=require(_0x9697('0x14'));var hardwareService=require(_0x9697('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x9697('0x16'));var config=require(_0x9697('0x17'));var licenseUtil=require(_0x9697('0x18'));var db=require(_0x9697('0x19'))['db'];config[_0x9697('0x1a')]=_[_0x9697('0x1b')](config[_0x9697('0x1a')],{'host':_0x9697('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9697('0x1d'))['register'](socket);var jayson=require(_0x9697('0x1e'));var client=jayson[_0x9697('0x1f')][_0x9697('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x20f25a,_0x515cab,_0x4e2043,_0x5a768f){return new BPromise(function(_0x502b75,_0x24fa58){var _0x4badb7=_0x5a768f||client;return _0x4badb7[_0x9697('0x21')](_0x20f25a,_0x4e2043)['then'](function(_0xb11b09){logger[_0x9697('0x22')](_0x9697('0x23'),_0x515cab,_0x9697('0x24'));logger[_0x9697('0x25')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x515cab,_0x9697('0x24'),JSON[_0x9697('0x26')](_0xb11b09));if(_0xb11b09[_0x9697('0x27')]){if(_0xb11b09[_0x9697('0x27')][_0x9697('0x28')]===0x1f4){logger[_0x9697('0x27')](_0x9697('0x23'),_0x515cab,_0xb11b09[_0x9697('0x27')][_0x9697('0x29')]);return _0x24fa58(_0xb11b09['error'][_0x9697('0x29')]);}logger['error'](_0x9697('0x23'),_0x515cab,_0xb11b09['error'][_0x9697('0x29')]);return _0x502b75(_0xb11b09['error'][_0x9697('0x29')]);}else{logger[_0x9697('0x22')](_0x9697('0x23'),_0x515cab,_0x9697('0x24'));_0x502b75(_0xb11b09[_0x9697('0x2a')][_0x9697('0x29')]);}})['catch'](function(_0x14fcab){logger[_0x9697('0x27')](_0x9697('0x23'),_0x515cab,_0x14fcab);_0x24fa58(_0x14fcab);});});}function respondWithStatusCode(_0x2b302c,_0x296b68){_0x296b68=_0x296b68||0xcc;return function(_0x1df2fc){if(_0x1df2fc){return _0x2b302c['sendStatus'](_0x296b68);}return _0x2b302c[_0x9697('0x2b')](_0x296b68)[_0x9697('0x2c')]();};}function respondWithResult(_0x2b5788,_0x4cb9b9){_0x4cb9b9=_0x4cb9b9||0xc8;return function(_0x2dafeb){if(_0x2dafeb){return _0x2b5788[_0x9697('0x2b')](_0x4cb9b9)[_0x9697('0x2d')](_0x2dafeb);}};}function respondWithFilteredResult(_0x536fb7,_0x5c7703){return function(_0x114c52){if(_0x114c52){var _0x1d9f20=typeof _0x5c7703['offset']===_0x9697('0x2e')&&typeof _0x5c7703['limit']===_0x9697('0x2e');var _0x157ad8=_0x114c52[_0x9697('0x2f')];var _0x19c6cb=_0x1d9f20?0x0:_0x5c7703[_0x9697('0x30')];var _0xbfa362=_0x1d9f20?_0x114c52[_0x9697('0x2f')]:_0x5c7703[_0x9697('0x30')]+_0x5c7703['limit'];var _0x49c9ac;if(_0xbfa362>=_0x157ad8){_0xbfa362=_0x157ad8;_0x49c9ac=0xc8;}else{_0x49c9ac=0xce;}_0x536fb7['status'](_0x49c9ac);return _0x536fb7[_0x9697('0x31')](_0x9697('0x32'),_0x19c6cb+'-'+_0xbfa362+'/'+_0x157ad8)[_0x9697('0x2d')](_0x114c52);}return null;};}function patchUpdates(_0x1c2d19){return function(_0x1b1c77){try{jsonpatch[_0x9697('0x33')](_0x1b1c77,_0x1c2d19,!![]);}catch(_0x350104){return BPromise['reject'](_0x350104);}return _0x1b1c77['save']();};}function saveUpdates(_0x424648,_0x52172b){return function(_0x292959){if(_0x292959){return _0x292959[_0x9697('0x34')](_0x424648)['then'](function(_0x122b23){return _0x122b23;});}return null;};}function removeEntity(_0x8924c6,_0x4a9383){return function(_0x1569ed){if(_0x1569ed){return _0x1569ed[_0x9697('0x35')]()['then'](function(){var _0xd8cd54=_0x1569ed[_0x9697('0x36')]({'plain':!![]});var _0x381ec7=_0x9697('0x37');return db[_0x9697('0x38')][_0x9697('0x35')]({'where':{'type':_0x381ec7,'resourceId':_0xd8cd54['id']}})['then'](function(){return _0x1569ed;});})['then'](function(){_0x8924c6[_0x9697('0x2b')](0xcc)[_0x9697('0x2c')]();});}};}function handleEntityNotFound(_0x4fddec,_0x480ba0){return function(_0x266666){if(!_0x266666){_0x4fddec[_0x9697('0x39')](0x194);}return _0x266666;};}function handleError(_0x25a24b,_0x106807){_0x106807=_0x106807||0x1f4;return function(_0x4188b3){logger['error'](_0x4188b3[_0x9697('0x3a')]);if(_0x4188b3[_0x9697('0x3b')]){delete _0x4188b3['name'];}_0x25a24b['status'](_0x106807)[_0x9697('0x3c')](_0x4188b3);};}exports[_0x9697('0x3d')]=function(_0x23eb03,_0x16e174){var _0x23f29c={},_0x4fcdf9={},_0x2d8e6f={'count':0x0,'rows':[]};var _0x46de52=_[_0x9697('0x3e')](db[_0x9697('0x3f')][_0x9697('0x40')],function(_0x97ab83){return{'name':_0x97ab83['fieldName'],'type':_0x97ab83[_0x9697('0x41')][_0x9697('0x42')]};});_0x4fcdf9['model']=_['map'](_0x46de52,'name');_0x4fcdf9[_0x9697('0x43')]=_[_0x9697('0x44')](_0x23eb03[_0x9697('0x43')]);_0x4fcdf9[_0x9697('0x45')]=_[_0x9697('0x46')](_0x4fcdf9[_0x9697('0x47')],_0x4fcdf9[_0x9697('0x43')]);_0x23f29c[_0x9697('0x48')]=_[_0x9697('0x46')](_0x4fcdf9[_0x9697('0x47')],qs[_0x9697('0x49')](_0x23eb03[_0x9697('0x43')]['fields']));_0x23f29c['attributes']=_0x23f29c[_0x9697('0x48')][_0x9697('0x4a')]?_0x23f29c[_0x9697('0x48')]:_0x4fcdf9['model'];if(!_0x23eb03[_0x9697('0x43')]['hasOwnProperty'](_0x9697('0x4b'))){_0x23f29c['limit']=qs['limit'](_0x23eb03[_0x9697('0x43')][_0x9697('0x4c')]);_0x23f29c[_0x9697('0x30')]=qs[_0x9697('0x30')](_0x23eb03[_0x9697('0x43')]['offset']);}_0x23f29c[_0x9697('0x4d')]=qs[_0x9697('0x4e')](_0x23eb03[_0x9697('0x43')][_0x9697('0x4e')]);_0x23f29c[_0x9697('0x4f')]=qs[_0x9697('0x45')](_['pick'](_0x23eb03[_0x9697('0x43')],_0x4fcdf9[_0x9697('0x45')]),_0x46de52);if(_0x23eb03[_0x9697('0x43')][_0x9697('0x50')]){_0x23f29c['where']=_[_0x9697('0x51')](_0x23f29c['where'],{'$or':_[_0x9697('0x3e')](_0x46de52,function(_0xc13c87){if(_0xc13c87['type']!==_0x9697('0x52')){var _0x46244c={};_0x46244c[_0xc13c87[_0x9697('0x3b')]]={'$like':'%'+_0x23eb03[_0x9697('0x43')]['filter']+'%'};return _0x46244c;}})});}_0x23f29c=_['merge']({},_0x23f29c,_0x23eb03['options']);var _0x1b7fe0={'where':_0x23f29c[_0x9697('0x4f')]};return db[_0x9697('0x3f')][_0x9697('0x2f')](_0x1b7fe0)[_0x9697('0x53')](function(_0x3608dc){_0x2d8e6f[_0x9697('0x2f')]=_0x3608dc;if(_0x23eb03[_0x9697('0x43')]['includeAll']){_0x23f29c[_0x9697('0x54')]=[{'all':!![]}];}return db[_0x9697('0x3f')][_0x9697('0x55')](_0x23f29c);})['then'](function(_0x40ec60){_0x2d8e6f[_0x9697('0x56')]=_0x40ec60;return _0x2d8e6f;})['then'](respondWithFilteredResult(_0x16e174,_0x23f29c))['catch'](handleError(_0x16e174,null));};exports['show']=function(_0x19a599,_0x89e681){var _0x5cc763={'raw':!![],'where':{'id':_0x19a599[_0x9697('0x57')]['id']}},_0x297079={};_0x297079['model']=_[_0x9697('0x44')](db[_0x9697('0x3f')][_0x9697('0x40')]);_0x297079[_0x9697('0x43')]=_[_0x9697('0x44')](_0x19a599[_0x9697('0x43')]);_0x297079[_0x9697('0x45')]=_[_0x9697('0x46')](_0x297079[_0x9697('0x47')],_0x297079['query']);_0x5cc763['attributes']=_[_0x9697('0x46')](_0x297079[_0x9697('0x47')],qs[_0x9697('0x49')](_0x19a599['query']['fields']));_0x5cc763[_0x9697('0x48')]=_0x5cc763[_0x9697('0x48')][_0x9697('0x4a')]?_0x5cc763['attributes']:_0x297079[_0x9697('0x47')];if(_0x19a599[_0x9697('0x43')][_0x9697('0x58')]){_0x5cc763['include']=[{'all':!![]}];}_0x5cc763=_[_0x9697('0x51')]({},_0x5cc763,_0x19a599['options']);return db[_0x9697('0x3f')]['find'](_0x5cc763)[_0x9697('0x53')](handleEntityNotFound(_0x89e681,null))[_0x9697('0x53')](respondWithResult(_0x89e681,null))[_0x9697('0x59')](handleError(_0x89e681,null));};exports['create']=function(_0x28b075,_0x5c92f9){return db[_0x9697('0x3f')]['create'](_0x28b075[_0x9697('0x5a')],{})['then'](function(_0x47df23){var _0x2d3a7c=_0x28b075[_0x9697('0x5b')][_0x9697('0x36')]({'plain':!![]});if(!_0x2d3a7c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d3a7c[_0x9697('0x5c')]==='user'){var _0x52b7eb=_0x47df23[_0x9697('0x36')]({'plain':!![]});var _0x2df310=_0x9697('0x37');return db[_0x9697('0x5d')]['find']({'where':{'name':_0x2df310,'userProfileId':_0x2d3a7c[_0x9697('0x5e')]},'raw':!![]})[_0x9697('0x53')](function(_0xebd71d){if(_0xebd71d&&_0xebd71d[_0x9697('0x5f')]===0x0){return db['UserProfileResource'][_0x9697('0x60')]({'name':_0x52b7eb[_0x9697('0x3b')],'resourceId':_0x52b7eb['id'],'type':_0xebd71d[_0x9697('0x3b')],'sectionId':_0xebd71d['id']},{})[_0x9697('0x53')](function(){return _0x47df23;});}else{return _0x47df23;}})['catch'](function(_0x50d113){logger['error'](_0x9697('0x61'),_0x50d113);throw _0x50d113;});}return _0x47df23;})[_0x9697('0x53')](respondWithResult(_0x5c92f9,0xc9))[_0x9697('0x59')](handleError(_0x5c92f9,null));};exports[_0x9697('0x34')]=function(_0x4d9a05,_0x5f4806){if(_0x4d9a05[_0x9697('0x5a')]['id']){delete _0x4d9a05['body']['id'];}return db['ChatQueue'][_0x9697('0x62')]({'where':{'id':_0x4d9a05[_0x9697('0x57')]['id']}})[_0x9697('0x53')](handleEntityNotFound(_0x5f4806,null))[_0x9697('0x53')](saveUpdates(_0x4d9a05[_0x9697('0x5a')],null))[_0x9697('0x53')](respondWithResult(_0x5f4806,null))['catch'](handleError(_0x5f4806,null));};exports['destroy']=function(_0x2a3fbe,_0x3d3434){return db[_0x9697('0x3f')][_0x9697('0x62')]({'where':{'id':_0x2a3fbe[_0x9697('0x57')]['id']}})[_0x9697('0x53')](handleEntityNotFound(_0x3d3434,null))[_0x9697('0x53')](removeEntity(_0x3d3434,null))['catch'](handleError(_0x3d3434,null));};exports[_0x9697('0x63')]=function(_0x19a6c2,_0x307efe){return db[_0x9697('0x3f')][_0x9697('0x63')]()[_0x9697('0x53')](respondWithResult(_0x307efe,null))['catch'](handleError(_0x307efe,null));};exports[_0x9697('0x64')]=function(_0x4d0f59,_0x453224,_0x59cfc7){var _0x5cce46={'raw':!![],'where':{}},_0x1f0dc8={},_0x50eafa;return db['ChatQueue'][_0x9697('0x65')]({'where':{'id':_0x4d0f59[_0x9697('0x57')]['id']}})[_0x9697('0x53')](handleEntityNotFound(_0x453224,null))[_0x9697('0x53')](function(_0x1d17fd){if(_0x1d17fd){_0x50eafa=_0x1d17fd[_0x9697('0x36')]({'plain':!![]});_0x1f0dc8['model']=_[_0x9697('0x44')](db['UserChatQueue'][_0x9697('0x40')]);_0x1f0dc8[_0x9697('0x43')]=_[_0x9697('0x44')](_0x4d0f59[_0x9697('0x43')]);_0x1f0dc8[_0x9697('0x45')]=_[_0x9697('0x46')](_0x1f0dc8['model'],_0x1f0dc8[_0x9697('0x43')]);_0x5cce46[_0x9697('0x48')]=_[_0x9697('0x46')](_0x1f0dc8[_0x9697('0x47')],qs['fields'](_0x4d0f59[_0x9697('0x43')][_0x9697('0x49')]));_0x5cce46[_0x9697('0x48')]=_0x5cce46[_0x9697('0x48')][_0x9697('0x4a')]?_0x5cce46[_0x9697('0x48')]:_0x1f0dc8[_0x9697('0x47')];if(!_0x4d0f59[_0x9697('0x43')][_0x9697('0x66')](_0x9697('0x4b'))){_0x5cce46[_0x9697('0x4c')]=qs['limit'](_0x4d0f59[_0x9697('0x43')][_0x9697('0x4c')]);_0x5cce46[_0x9697('0x30')]=qs[_0x9697('0x30')](_0x4d0f59['query']['offset']);}_0x5cce46[_0x9697('0x4d')]=qs[_0x9697('0x4e')](_0x4d0f59[_0x9697('0x43')][_0x9697('0x4e')]);_0x5cce46[_0x9697('0x4f')]=qs[_0x9697('0x45')](_[_0x9697('0x67')](_0x4d0f59['query'],_0x1f0dc8[_0x9697('0x45')]));_0x5cce46[_0x9697('0x4f')][_0x9697('0x68')]=_0x1d17fd['id'];if(_0x4d0f59['query'][_0x9697('0x50')]){_0x5cce46[_0x9697('0x4f')]=_['merge'](_0x5cce46[_0x9697('0x4f')],{'$or':_['map'](_0x5cce46[_0x9697('0x48')],function(_0xc9ab66){var _0x26c2c6={};_0x26c2c6[_0xc9ab66]={'$like':'%'+_0x4d0f59[_0x9697('0x43')][_0x9697('0x50')]+'%'};return _0x26c2c6;})});}_0x5cce46=_[_0x9697('0x51')]({},_0x5cce46,_0x4d0f59[_0x9697('0x69')]);return db[_0x9697('0x6a')][_0x9697('0x55')](_0x5cce46);}})['then'](function(_0x4af6e5){if(_0x4af6e5){return db[_0x9697('0x6b')][_0x9697('0x6c')]({'where':{'id':_[_0x9697('0x3e')](_0x4af6e5,_0x9697('0x6d')),'role':_0x9697('0x6e')},'attributes':['id',_0x9697('0x3b'),_0x9697('0x6f'),_0x9697('0x70'),_0x9697('0x71')]});}})['then'](function(_0x823be0){if(_0x823be0){return{'count':_0x823be0[_0x9697('0x2f')],'rows':_[_0x9697('0x3e')](_0x823be0['rows'],function(_0x45b2d7){return{'membername':_0x45b2d7[_0x9697('0x3b')],'UserId':_0x45b2d7['id'],'queue_name':_0x50eafa[_0x9697('0x3b')],'ChatQueueId':_0x50eafa['id'],'interface':util[_0x9697('0x72')](_0x9697('0x73'),_0x9697('0x74'),_0x45b2d7['name']),'penalty':0x0,'paused':_0x45b2d7['chatPause'],'createdAt':_0x45b2d7[_0x9697('0x71')],'updatedAt':_0x45b2d7[_0x9697('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9697('0x53')](respondWithFilteredResult(_0x453224,_0x5cce46))[_0x9697('0x59')](handleError(_0x453224,null));};exports['getTeams']=function(_0x28f6e2,_0x921250,_0x249555){var _0x333dd4={};var _0x3d9c04={};var _0x402731;var _0xd82986;return db[_0x9697('0x3f')][_0x9697('0x65')]({'where':{'id':_0x28f6e2[_0x9697('0x57')]['id']}})[_0x9697('0x53')](handleEntityNotFound(_0x921250,null))['then'](function(_0x103813){if(_0x103813){_0x402731=_0x103813;_0x3d9c04['model']=_[_0x9697('0x44')](db[_0x9697('0x75')]['rawAttributes']);_0x3d9c04[_0x9697('0x43')]=_[_0x9697('0x44')](_0x28f6e2[_0x9697('0x43')]);_0x3d9c04[_0x9697('0x45')]=_[_0x9697('0x46')](_0x3d9c04[_0x9697('0x47')],_0x3d9c04[_0x9697('0x43')]);_0x333dd4[_0x9697('0x48')]=_['intersection'](_0x3d9c04[_0x9697('0x47')],qs[_0x9697('0x49')](_0x28f6e2[_0x9697('0x43')]['fields']));_0x333dd4[_0x9697('0x48')]=_0x333dd4[_0x9697('0x48')][_0x9697('0x4a')]?_0x333dd4[_0x9697('0x48')]:_0x3d9c04[_0x9697('0x47')];_0x333dd4[_0x9697('0x4d')]=qs[_0x9697('0x4e')](_0x28f6e2[_0x9697('0x43')]['sort']);_0x333dd4[_0x9697('0x4f')]=qs[_0x9697('0x45')](_['pick'](_0x28f6e2[_0x9697('0x43')],_0x3d9c04[_0x9697('0x45')]));if(_0x28f6e2['query'][_0x9697('0x50')]){_0x333dd4[_0x9697('0x4f')]=_['merge'](_0x333dd4['where'],{'$or':_['map'](_0x333dd4['attributes'],function(_0x20e8eb){var _0x21a637={};_0x21a637[_0x20e8eb]={'$like':'%'+_0x28f6e2[_0x9697('0x43')][_0x9697('0x50')]+'%'};return _0x21a637;})});}_0x333dd4=_[_0x9697('0x51')]({},_0x333dd4,_0x28f6e2[_0x9697('0x69')]);return _0x402731[_0x9697('0x76')](_0x333dd4);}})['then'](function(_0x395b4c){if(_0x395b4c){_0xd82986=_0x395b4c[_0x9697('0x4a')];if(!_0x28f6e2[_0x9697('0x43')]['hasOwnProperty'](_0x9697('0x4b'))){_0x333dd4[_0x9697('0x4c')]=qs[_0x9697('0x4c')](_0x28f6e2[_0x9697('0x43')][_0x9697('0x4c')]);_0x333dd4[_0x9697('0x30')]=qs['offset'](_0x28f6e2[_0x9697('0x43')][_0x9697('0x30')]);}return _0x402731[_0x9697('0x76')](_0x333dd4);}})[_0x9697('0x53')](function(_0x422c4e){if(_0x422c4e){return _0x422c4e?{'count':_0xd82986,'rows':_0x422c4e}:null;}})[_0x9697('0x53')](respondWithResult(_0x921250,null))[_0x9697('0x59')](handleError(_0x921250,null));};exports[_0x9697('0x77')]=function(_0x392438,_0x3d170e,_0x14e925){var _0xe98236=_0x392438[_0x9697('0x5a')]['ids'];return db[_0x9697('0x75')]['findAll']({'where':{'id':_0xe98236},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9697('0x78'),'attributes':['id',_0x9697('0x3b'),_0x9697('0x79'),_0x9697('0x7a'),_0x9697('0x7b')],'raw':!![]}]})[_0x9697('0x53')](function(_0x571130){if(_0x571130){var _0x255b3e=_[_0x9697('0x7c')](_0x571130,function(_0x420201){var _0xbe423d=_0x420201[_0x9697('0x36')]({'plain':!![]});return _0xbe423d[_0x9697('0x78')];});return db[_0x9697('0x3f')]['find']({'where':{'id':_0x392438[_0x9697('0x57')]['id']}})['then'](function(_0x4d7c93){return db[_0x9697('0x7d')][_0x9697('0x7e')](function(_0x207d7e){return _0x4d7c93[_0x9697('0x77')](_0xe98236,{'transaction':_0x207d7e})[_0x9697('0x53')](function(){return BPromise[_0x9697('0x7f')](_0x255b3e,function(_0x3d4c6d){return db[_0x9697('0x6a')]['findOrCreate']({'where':{'UserId':_0x3d4c6d['id'],'ChatQueueId':_0x392438[_0x9697('0x57')]['id']},'transaction':_0x207d7e});});})['then'](function(){_0x255b3e[_0x9697('0x80')](function(_0x1171c0){socket['emit']('userChatQueue:save',{'UserId':_0x1171c0['id'],'ChatQueueId':_0x4d7c93['id']});});});});});}})[_0x9697('0x53')](respondWithStatusCode(_0x3d170e,null))[_0x9697('0x59')](handleError(_0x3d170e,null));};exports[_0x9697('0x81')]=function(_0x5832d1,_0x17a456,_0x207590){return db[_0x9697('0x75')][_0x9697('0x55')]({'where':{'id':_0x5832d1[_0x9697('0x43')][_0x9697('0x82')]},'attributes':['id'],'include':[{'model':db[_0x9697('0x6b')],'as':_0x9697('0x78'),'attributes':['id'],'raw':!![]}]})[_0x9697('0x53')](handleEntityNotFound(_0x17a456,null))[_0x9697('0x53')](function(_0x4ab317){var _0x336920=_[_0x9697('0x3e')](_0x4ab317,'id');var _0x12277c=[];var _0x35eff1=[];var _0x4485de=squel[_0x9697('0x83')]();_0x4485de[_0x9697('0x84')](_0x9697('0x85'))[_0x9697('0x86')](_0x9697('0x87'),'tq')[_0x9697('0x88')](_0x9697('0x89'),'ut',_0x9697('0x8a'))['where']('ChatQueueId\x20=\x20?',_0x5832d1[_0x9697('0x57')]['id']);for(var _0x51bf94=0x0;_0x51bf94<_0x4ab317[_0x9697('0x4a')];_0x51bf94+=0x1){let _0x63adf7=_0x4ab317[_0x51bf94];for(var _0x2560f3=0x0;_0x2560f3<_0x63adf7[_0x9697('0x78')]['length'];_0x2560f3+=0x1){let _0x1d9564=_0x63adf7[_0x9697('0x78')][_0x2560f3];var _0x5f51de=_0x4485de[_0x9697('0x8b')]();_0x5f51de['where'](_0x9697('0x8c'),_0x1d9564['id']);_0x35eff1['push'](db[_0x9697('0x7d')][_0x9697('0x43')](_0x5f51de[_0x9697('0x8d')](),{'type':db[_0x9697('0x7d')][_0x9697('0x8e')][_0x9697('0x8f')]})[_0x9697('0x53')](function(_0x2b07e0){if(_0x2b07e0[_0x9697('0x4a')]===0x1){return _0x1d9564['id'];}else{var _0x1be57c=_[_0x9697('0x90')](_[_0x9697('0x3e')](_0x2b07e0,_0x9697('0x91')),function(_0x14f1ba){return _[_0x9697('0x92')](_0x336920,_0x14f1ba);});if(_0x1be57c){return _0x1d9564['id'];}}}));}}return BPromise[_0x9697('0x93')](_0x35eff1)['then'](function(_0xcaa6a3){_0x12277c=_(_0x12277c)[_0x9697('0x94')](_0xcaa6a3)[_0x9697('0x95')]()[_0x9697('0x96')]();return db[_0x9697('0x3f')]['find']({'where':{'id':_0x5832d1[_0x9697('0x57')]['id']}})['then'](function(_0x2cde65){return db[_0x9697('0x7d')][_0x9697('0x7e')](function(_0x4cf4de){return _0x2cde65['removeTeams'](_0x5832d1[_0x9697('0x43')][_0x9697('0x82')],{'transaction':_0x4cf4de})[_0x9697('0x53')](function(){if(!_[_0x9697('0x97')](_0x12277c)){return _0x2cde65[_0x9697('0x98')](_0x12277c,{'transaction':_0x4cf4de});}})[_0x9697('0x53')](function(){_0x12277c[_0x9697('0x80')](function(_0x58f021){socket[_0x9697('0x99')](_0x9697('0x9a'),{'UserId':_0x58f021,'ChatQueueId':_0x2cde65['id']});});});});});});})['then'](respondWithStatusCode(_0x17a456,null))['catch'](handleError(_0x17a456,null));};exports[_0x9697('0x9b')]=function(_0x2d529a,_0x539f25,_0x50e3f9){return db[_0x9697('0x3f')][_0x9697('0x62')]({'where':{'id':_0x2d529a[_0x9697('0x57')]['id']}})['then'](handleEntityNotFound(_0x539f25,null))[_0x9697('0x53')](function(_0x241fd7){if(_0x241fd7){return _0x241fd7[_0x9697('0x9b')](_0x2d529a[_0x9697('0x5a')]['ids'],_[_0x9697('0x9c')](_0x2d529a[_0x9697('0x5a')],[_0x9697('0x82'),'id'])||{})['spread'](function(_0x271cb0){for(var _0x14a68d=0x0;_0x14a68d<_0x2d529a[_0x9697('0x5a')][_0x9697('0x82')]['length'];_0x14a68d+=0x1){socket[_0x9697('0x99')](_0x9697('0x9d'),{'UserId':Number(_0x2d529a[_0x9697('0x5a')][_0x9697('0x82')][_0x14a68d]),'ChatQueueId':Number(_0x2d529a[_0x9697('0x57')]['id'])});}return _0x271cb0;});}})['then'](respondWithResult(_0x539f25,null))[_0x9697('0x59')](handleError(_0x539f25,null));};exports['removeAgents']=function(_0x3b5791,_0x3f82f0,_0x50556a){return db[_0x9697('0x3f')][_0x9697('0x62')]({'where':{'id':_0x3b5791[_0x9697('0x57')]['id']}})[_0x9697('0x53')](handleEntityNotFound(_0x3f82f0,null))[_0x9697('0x53')](function(_0x26fbba){if(_0x26fbba){return _0x26fbba[_0x9697('0x98')](_0x3b5791[_0x9697('0x43')][_0x9697('0x82')])['then'](function(){if(_[_0x9697('0x9e')](_0x3b5791[_0x9697('0x43')][_0x9697('0x82')])){for(var _0x22268a=0x0;_0x22268a<_0x3b5791[_0x9697('0x43')][_0x9697('0x82')][_0x9697('0x4a')];_0x22268a+=0x1){socket['emit'](_0x9697('0x9a'),{'UserId':Number(_0x3b5791[_0x9697('0x43')][_0x9697('0x82')][_0x22268a]),'ChatQueueId':Number(_0x3b5791[_0x9697('0x57')]['id'])});}}else{socket[_0x9697('0x99')](_0x9697('0x9a'),{'UserId':Number(_0x3b5791[_0x9697('0x43')][_0x9697('0x82')]),'ChatQueueId':Number(_0x3b5791[_0x9697('0x57')]['id'])});}});}})[_0x9697('0x53')](respondWithStatusCode(_0x3f82f0,null))[_0x9697('0x59')](handleError(_0x3f82f0,null));};exports[_0x9697('0x9f')]=function(_0x425768,_0x3cf0ee,_0x58f064){var _0x1e3076={};var _0x44bd94={};var _0x1b4f5e;var _0x1e84fc;return db[_0x9697('0x3f')][_0x9697('0x65')]({'where':{'id':_0x425768[_0x9697('0x57')]['id']}})[_0x9697('0x53')](handleEntityNotFound(_0x3cf0ee,null))[_0x9697('0x53')](function(_0x507bda){if(_0x507bda){_0x1b4f5e=_0x507bda;_0x44bd94[_0x9697('0x47')]=_[_0x9697('0x44')](db['User'][_0x9697('0x40')]);_0x44bd94[_0x9697('0x43')]=_[_0x9697('0x44')](_0x425768['query']);_0x44bd94['filters']=_[_0x9697('0x46')](_0x44bd94['model'],_0x44bd94[_0x9697('0x43')]);_0x1e3076[_0x9697('0x48')]=_['intersection'](_0x44bd94['model'],qs[_0x9697('0x49')](_0x425768['query']['fields']));_0x1e3076[_0x9697('0x48')]=_0x1e3076[_0x9697('0x48')][_0x9697('0x4a')]?_0x1e3076[_0x9697('0x48')]:_0x44bd94[_0x9697('0x47')];_0x1e3076[_0x9697('0x4d')]=qs[_0x9697('0x4e')](_0x425768[_0x9697('0x43')][_0x9697('0x4e')]);_0x1e3076[_0x9697('0x4f')]=qs[_0x9697('0x45')](_[_0x9697('0x67')](_0x425768[_0x9697('0x43')],_0x44bd94['filters']));if(_0x425768[_0x9697('0x43')][_0x9697('0x50')]){_0x1e3076[_0x9697('0x4f')]=_['merge'](_0x1e3076[_0x9697('0x4f')],{'$or':_[_0x9697('0x3e')](_0x1e3076['attributes'],function(_0x49b435){var _0x15f7d0={};_0x15f7d0[_0x49b435]={'$like':'%'+_0x425768[_0x9697('0x43')][_0x9697('0x50')]+'%'};return _0x15f7d0;})});}_0x1e3076=_[_0x9697('0x51')]({},_0x1e3076,_0x425768[_0x9697('0x69')]);return _0x1b4f5e['getAgents'](_0x1e3076);}})[_0x9697('0x53')](function(_0x4b78a9){if(_0x4b78a9){_0x1e84fc=_0x4b78a9['length'];if(!_0x425768[_0x9697('0x43')][_0x9697('0x66')](_0x9697('0x4b'))){_0x1e3076['limit']=qs['limit'](_0x425768['query'][_0x9697('0x4c')]);_0x1e3076[_0x9697('0x30')]=qs['offset'](_0x425768[_0x9697('0x43')][_0x9697('0x30')]);}return _0x1b4f5e[_0x9697('0x9f')](_0x1e3076);}})[_0x9697('0x53')](function(_0x270e5d){if(_0x270e5d){return _0x270e5d?{'count':_0x1e84fc,'rows':_0x270e5d}:null;}})[_0x9697('0x53')](respondWithResult(_0x3cf0ee,null))[_0x9697('0x59')](handleError(_0x3cf0ee,null));};
\ No newline at end of file
index 0bda520..71d1231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e1a=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e1a,0xf3));var _0xa0e1=function(_0x4839ca,_0x74c502){_0x4839ca=_0x4839ca-0x0;var _0x5307c7=_0x0e1a[_0x4839ca];return _0x5307c7;};'use strict';var EventEmitter=require(_0xa0e1('0x0'));var ChatQueue=require(_0xa0e1('0x1'))['db'][_0xa0e1('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa0e1('0x3')](0x0);var events={'afterCreate':_0xa0e1('0x4'),'afterUpdate':_0xa0e1('0x5'),'afterDestroy':_0xa0e1('0x6')};function emitEvent(_0x4b5543){return function(_0x4de506,_0x45aec0,_0x1dbe0e){ChatQueueEvents[_0xa0e1('0x7')](_0x4b5543+':'+_0x4de506['id'],_0x4de506);ChatQueueEvents[_0xa0e1('0x7')](_0x4b5543,_0x4de506);_0x1dbe0e(null);};}for(var e in events){if(events[_0xa0e1('0x8')](e)){var event=events[e];ChatQueue[_0xa0e1('0x9')](e,emitEvent(event));}}module[_0xa0e1('0xa')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe2f2=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x28f52e,_0x5a8b9d){var _0x20ea27=function(_0x169d71){while(--_0x169d71){_0x28f52e['push'](_0x28f52e['shift']());}};_0x20ea27(++_0x5a8b9d);}(_0xe2f2,0x6c));var _0x2e2f=function(_0x50c5ce,_0x1d97bf){_0x50c5ce=_0x50c5ce-0x0;var _0x3c9772=_0xe2f2[_0x50c5ce];return _0x3c9772;};'use strict';var EventEmitter=require(_0x2e2f('0x0'));var ChatQueue=require(_0x2e2f('0x1'))['db'][_0x2e2f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2e2f('0x3')](0x0);var events={'afterCreate':_0x2e2f('0x4'),'afterUpdate':_0x2e2f('0x5'),'afterDestroy':_0x2e2f('0x6')};function emitEvent(_0x2e2b04){return function(_0x4c5888,_0x5ee3a1,_0x2e9087){ChatQueueEvents[_0x2e2f('0x7')](_0x2e2b04+':'+_0x4c5888['id'],_0x4c5888);ChatQueueEvents[_0x2e2f('0x7')](_0x2e2b04,_0x4c5888);_0x2e9087(null);};}for(var e in events){if(events[_0x2e2f('0x8')](e)){var event=events[e];ChatQueue[_0x2e2f('0x9')](e,emitEvent(event));}}module[_0x2e2f('0xa')]=ChatQueueEvents;
\ No newline at end of file
index 669be22..ef90363 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52cf=['define','chat_queues','lodash','util','api','moment','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x52cf,0xb6));var _0xf52c=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x52cf[_0x411add];return _0x238242;};'use strict';var _=require(_0xf52c('0x0'));var util=require(_0xf52c('0x1'));var logger=require('../../config/logger')(_0xf52c('0x2'));var moment=require(_0xf52c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf52c('0x4'));var config=require(_0xf52c('0x5'));var attributes=require(_0xf52c('0x6'));module[_0xf52c('0x7')]=function(_0x5e4077,_0x50d8c8){return _0x5e4077[_0xf52c('0x8')]('ChatQueue',attributes,{'tableName':_0xf52c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9106=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x9106,0x81));var _0x6910=function(_0xccd329,_0xc7b4d6){_0xccd329=_0xccd329-0x0;var _0x1f815b=_0x9106[_0xccd329];return _0x1f815b;};'use strict';var _=require(_0x6910('0x0'));var util=require(_0x6910('0x1'));var logger=require(_0x6910('0x2'))('api');var moment=require(_0x6910('0x3'));var BPromise=require(_0x6910('0x4'));var rp=require(_0x6910('0x5'));var fs=require('fs');var path=require(_0x6910('0x6'));var rimraf=require(_0x6910('0x7'));var config=require(_0x6910('0x8'));var attributes=require(_0x6910('0x9'));module[_0x6910('0xa')]=function(_0x243c67,_0x2fe638){return _0x243c67[_0x6910('0xb')](_0x6910('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4c2d625..d09e4e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2200=['raw','attributes','limit','include','map','model','debug','ShowChatQueue','ChatQueue','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','options'];(function(_0x2fa0c2,_0x3a43e8){var _0x320b0c=function(_0x2184dc){while(--_0x2184dc){_0x2fa0c2['push'](_0x2fa0c2['shift']());}};_0x320b0c(++_0x3a43e8);}(_0x2200,0x17b));var _0x0220=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x2200[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0x0220('0x0'));var util=require(_0x0220('0x1'));var moment=require('moment');var BPromise=require(_0x0220('0x2'));var rs=require(_0x0220('0x3'));var fs=require('fs');var Redis=require(_0x0220('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0220('0x5'));var logger=require(_0x0220('0x6'))(_0x0220('0x7'));var config=require(_0x0220('0x8'));var jayson=require(_0x0220('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x0220('0xa')]=_[_0x0220('0xb')](config['redis'],{'host':_0x0220('0xc'),'port':0x18eb});var socket=require(_0x0220('0xd'))(new Redis(config[_0x0220('0xa')]));require('./chatQueue.socket')[_0x0220('0xe')](socket);function respondWithRpcPromise(_0x54305a,_0xc9dcdf,_0x42545f){return new BPromise(function(_0x55f2b3,_0x7d357){return client[_0x0220('0xf')](_0x54305a,_0x42545f)[_0x0220('0x10')](function(_0x5c6fbe){logger[_0x0220('0x11')](_0x0220('0x12'),_0xc9dcdf,_0x0220('0x13'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0xc9dcdf,'request\x20sent',JSON[_0x0220('0x14')](_0x5c6fbe));if(_0x5c6fbe[_0x0220('0x15')]){if(_0x5c6fbe[_0x0220('0x15')][_0x0220('0x16')]===0x1f4){logger[_0x0220('0x15')]('ChatQueue,\x20%s,\x20%s',_0xc9dcdf,_0x5c6fbe[_0x0220('0x15')][_0x0220('0x17')]);return _0x7d357(_0x5c6fbe[_0x0220('0x15')][_0x0220('0x17')]);}logger[_0x0220('0x15')]('ChatQueue,\x20%s,\x20%s',_0xc9dcdf,_0x5c6fbe[_0x0220('0x15')]['message']);return _0x55f2b3(_0x5c6fbe[_0x0220('0x15')]['message']);}else{logger[_0x0220('0x11')](_0x0220('0x12'),_0xc9dcdf,_0x0220('0x13'));_0x55f2b3(_0x5c6fbe[_0x0220('0x18')][_0x0220('0x17')]);}})[_0x0220('0x19')](function(_0x258fb1){logger['error'](_0x0220('0x12'),_0xc9dcdf,_0x258fb1);_0x7d357(_0x258fb1);});});}exports[_0x0220('0x1a')]=function(_0x26d626){var _0x39722b=this;return new Promise(function(_0x324976,_0x58f82e){return db['ChatQueue']['findAll']({'raw':_0x26d626[_0x0220('0x1b')]?_0x26d626[_0x0220('0x1b')][_0x0220('0x1c')]===undefined?!![]:![]:!![],'where':_0x26d626['options']?_0x26d626['options']['where']||null:null,'attributes':_0x26d626[_0x0220('0x1b')]?_0x26d626[_0x0220('0x1b')][_0x0220('0x1d')]||null:null,'limit':_0x26d626[_0x0220('0x1b')]?_0x26d626['options'][_0x0220('0x1e')]||null:null,'include':_0x26d626[_0x0220('0x1b')]?_0x26d626[_0x0220('0x1b')][_0x0220('0x1f')]?_[_0x0220('0x20')](_0x26d626[_0x0220('0x1b')][_0x0220('0x1f')],function(_0x40ef1d){return{'model':db[_0x40ef1d[_0x0220('0x21')]],'as':_0x40ef1d['as'],'attributes':_0x40ef1d['attributes'],'include':_0x40ef1d[_0x0220('0x1f')]?_[_0x0220('0x20')](_0x40ef1d['include'],function(_0x45c394){return{'model':db[_0x45c394[_0x0220('0x21')]],'as':_0x45c394['as'],'attributes':_0x45c394['attributes'],'include':_0x45c394['include']?_[_0x0220('0x20')](_0x45c394[_0x0220('0x1f')],function(_0x2ef452){return{'model':db[_0x2ef452[_0x0220('0x21')]],'as':_0x2ef452['as'],'attributes':_0x2ef452[_0x0220('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x276a63){logger['info'](_0x0220('0x1a'),_0x26d626);logger[_0x0220('0x22')](_0x0220('0x1a'),_0x26d626,JSON[_0x0220('0x14')](_0x276a63));_0x324976(_0x276a63);})[_0x0220('0x19')](function(_0x22c61e){logger[_0x0220('0x15')]('GetChatQueue',_0x22c61e[_0x0220('0x17')],_0x26d626);_0x58f82e(_0x39722b[_0x0220('0x15')](0x1f4,_0x22c61e[_0x0220('0x17')]));});});};exports[_0x0220('0x23')]=function(_0x5f30d1){var _0x247c49=this;return new Promise(function(_0x2867bd,_0x52dfc0){return db[_0x0220('0x24')]['find']({'raw':_0x5f30d1[_0x0220('0x1b')]?_0x5f30d1[_0x0220('0x1b')][_0x0220('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f30d1[_0x0220('0x1b')]?_0x5f30d1[_0x0220('0x1b')]['where']||null:null,'attributes':_0x5f30d1[_0x0220('0x1b')]?_0x5f30d1[_0x0220('0x1b')]['attributes']||null:null,'include':_0x5f30d1[_0x0220('0x1b')]?_0x5f30d1['options'][_0x0220('0x1f')]?_['map'](_0x5f30d1[_0x0220('0x1b')][_0x0220('0x1f')],function(_0x2da816){return{'model':db[_0x2da816[_0x0220('0x21')]],'as':_0x2da816['as'],'attributes':_0x2da816[_0x0220('0x1d')],'include':_0x2da816[_0x0220('0x1f')]?_['map'](_0x2da816[_0x0220('0x1f')],function(_0xcd670){return{'model':db[_0xcd670[_0x0220('0x21')]],'as':_0xcd670['as'],'attributes':_0xcd670[_0x0220('0x1d')],'include':_0xcd670[_0x0220('0x1f')]?_[_0x0220('0x20')](_0xcd670[_0x0220('0x1f')],function(_0x11b4f0){return{'model':db[_0x11b4f0[_0x0220('0x21')]],'as':_0x11b4f0['as'],'attributes':_0x11b4f0[_0x0220('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0220('0x10')](function(_0x224f0d){logger[_0x0220('0x11')](_0x0220('0x23'),_0x5f30d1);logger[_0x0220('0x22')](_0x0220('0x23'),_0x5f30d1,JSON['stringify'](_0x224f0d));_0x2867bd(_0x224f0d);})[_0x0220('0x19')](function(_0x50a658){logger['error']('ShowChatQueue',_0x50a658['message'],_0x5f30d1);_0x52dfc0(_0x247c49['error'](0x1f4,_0x50a658[_0x0220('0x17')]));});});};
\ No newline at end of file
+var _0x38c9=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','options','raw','limit','include','map','model','attributes','GetChatQueue','find','where','ShowChatQueue','lodash'];(function(_0x2e14af,_0x4564e3){var _0x3040e1=function(_0x29b770){while(--_0x29b770){_0x2e14af['push'](_0x2e14af['shift']());}};_0x3040e1(++_0x4564e3);}(_0x38c9,0x199));var _0x938c=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0x38c9[_0x19d350];return _0x3bfc8d;};'use strict';var _=require(_0x938c('0x0'));var util=require(_0x938c('0x1'));var moment=require(_0x938c('0x2'));var BPromise=require('bluebird');var rs=require(_0x938c('0x3'));var fs=require('fs');var Redis=require(_0x938c('0x4'));var db=require(_0x938c('0x5'))['db'];var utils=require(_0x938c('0x6'));var logger=require('../../config/logger')(_0x938c('0x7'));var config=require(_0x938c('0x8'));var jayson=require(_0x938c('0x9'));var client=jayson[_0x938c('0xa')]['http']({'port':0x232a});config[_0x938c('0xb')]=_[_0x938c('0xc')](config[_0x938c('0xb')],{'host':_0x938c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x938c('0xe'))[_0x938c('0xf')](socket);function respondWithRpcPromise(_0xd1ab46,_0x16d3b6,_0xcc575f){return new BPromise(function(_0x36c44a,_0x2e71c5){return client[_0x938c('0x10')](_0xd1ab46,_0xcc575f)[_0x938c('0x11')](function(_0x425142){logger[_0x938c('0x12')](_0x938c('0x13'),_0x16d3b6,_0x938c('0x14'));logger[_0x938c('0x15')](_0x938c('0x16'),_0x16d3b6,'request\x20sent',JSON[_0x938c('0x17')](_0x425142));if(_0x425142['error']){if(_0x425142[_0x938c('0x18')][_0x938c('0x19')]===0x1f4){logger[_0x938c('0x18')]('ChatQueue,\x20%s,\x20%s',_0x16d3b6,_0x425142[_0x938c('0x18')][_0x938c('0x1a')]);return _0x2e71c5(_0x425142['error'][_0x938c('0x1a')]);}logger[_0x938c('0x18')](_0x938c('0x13'),_0x16d3b6,_0x425142[_0x938c('0x18')][_0x938c('0x1a')]);return _0x36c44a(_0x425142['error'][_0x938c('0x1a')]);}else{logger[_0x938c('0x12')]('ChatQueue,\x20%s,\x20%s',_0x16d3b6,_0x938c('0x14'));_0x36c44a(_0x425142[_0x938c('0x1b')]['message']);}})[_0x938c('0x1c')](function(_0x1b3ba1){logger['error']('ChatQueue,\x20%s,\x20%s',_0x16d3b6,_0x1b3ba1);_0x2e71c5(_0x1b3ba1);});});}exports['GetChatQueue']=function(_0x61ff20){var _0x31f28b=this;return new Promise(function(_0x4006e6,_0x42014e){return db[_0x938c('0x1d')]['findAll']({'raw':_0x61ff20['options']?_0x61ff20[_0x938c('0x1e')][_0x938c('0x1f')]===undefined?!![]:![]:!![],'where':_0x61ff20['options']?_0x61ff20[_0x938c('0x1e')]['where']||null:null,'attributes':_0x61ff20[_0x938c('0x1e')]?_0x61ff20['options']['attributes']||null:null,'limit':_0x61ff20[_0x938c('0x1e')]?_0x61ff20[_0x938c('0x1e')][_0x938c('0x20')]||null:null,'include':_0x61ff20[_0x938c('0x1e')]?_0x61ff20[_0x938c('0x1e')][_0x938c('0x21')]?_[_0x938c('0x22')](_0x61ff20[_0x938c('0x1e')][_0x938c('0x21')],function(_0x2204a9){return{'model':db[_0x2204a9[_0x938c('0x23')]],'as':_0x2204a9['as'],'attributes':_0x2204a9['attributes'],'include':_0x2204a9['include']?_[_0x938c('0x22')](_0x2204a9[_0x938c('0x21')],function(_0x1403eb){return{'model':db[_0x1403eb[_0x938c('0x23')]],'as':_0x1403eb['as'],'attributes':_0x1403eb[_0x938c('0x24')],'include':_0x1403eb['include']?_['map'](_0x1403eb[_0x938c('0x21')],function(_0x563f87){return{'model':db[_0x563f87['model']],'as':_0x563f87['as'],'attributes':_0x563f87[_0x938c('0x24')]};}):[]};}):[]};}):[]:[]})[_0x938c('0x11')](function(_0xc675fc){logger[_0x938c('0x12')]('GetChatQueue',_0x61ff20);logger[_0x938c('0x15')](_0x938c('0x25'),_0x61ff20,JSON['stringify'](_0xc675fc));_0x4006e6(_0xc675fc);})['catch'](function(_0x33ba15){logger['error'](_0x938c('0x25'),_0x33ba15[_0x938c('0x1a')],_0x61ff20);_0x42014e(_0x31f28b['error'](0x1f4,_0x33ba15[_0x938c('0x1a')]));});});};exports['ShowChatQueue']=function(_0x544226){var _0x48d93c=this;return new Promise(function(_0x522d5f,_0x4c8fa0){return db[_0x938c('0x1d')][_0x938c('0x26')]({'raw':_0x544226[_0x938c('0x1e')]?_0x544226[_0x938c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x544226['options']?_0x544226[_0x938c('0x1e')][_0x938c('0x27')]||null:null,'attributes':_0x544226[_0x938c('0x1e')]?_0x544226[_0x938c('0x1e')]['attributes']||null:null,'include':_0x544226[_0x938c('0x1e')]?_0x544226[_0x938c('0x1e')]['include']?_['map'](_0x544226[_0x938c('0x1e')][_0x938c('0x21')],function(_0x3e070d){return{'model':db[_0x3e070d[_0x938c('0x23')]],'as':_0x3e070d['as'],'attributes':_0x3e070d['attributes'],'include':_0x3e070d[_0x938c('0x21')]?_[_0x938c('0x22')](_0x3e070d[_0x938c('0x21')],function(_0x2fc70e){return{'model':db[_0x2fc70e[_0x938c('0x23')]],'as':_0x2fc70e['as'],'attributes':_0x2fc70e[_0x938c('0x24')],'include':_0x2fc70e['include']?_[_0x938c('0x22')](_0x2fc70e[_0x938c('0x21')],function(_0x5f0db3){return{'model':db[_0x5f0db3[_0x938c('0x23')]],'as':_0x5f0db3['as'],'attributes':_0x5f0db3['attributes']};}):[]};}):[]};}):[]:[]})[_0x938c('0x11')](function(_0x53a0c5){logger[_0x938c('0x12')](_0x938c('0x28'),_0x544226);logger[_0x938c('0x15')](_0x938c('0x28'),_0x544226,JSON['stringify'](_0x53a0c5));_0x522d5f(_0x53a0c5);})[_0x938c('0x1c')](function(_0x4e68fd){logger[_0x938c('0x18')](_0x938c('0x28'),_0x4e68fd[_0x938c('0x1a')],_0x544226);_0x4c8fa0(_0x48d93c[_0x938c('0x18')](0x1f4,_0x4e68fd['message']));});});};
\ No newline at end of file
index c02cf3b..2437eaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb8=['emit','removeListener','length','chatQueue:','remove'];(function(_0x3ba566,_0x5e009d){var _0x480317=function(_0x2fc8de){while(--_0x2fc8de){_0x3ba566['push'](_0x3ba566['shift']());}};_0x480317(++_0x5e009d);}(_0xadb8,0x1d0));var _0x8adb=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0xadb8[_0x55ef8b];return _0x359c84;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x8adb('0x0'),'update'];function createListener(_0x2b8a76,_0x2a0b30){return function(_0x24f912){_0x2a0b30[_0x8adb('0x1')](_0x2b8a76,_0x24f912);};}function removeListener(_0x44fdf7,_0x2baedb){return function(){ChatQueueEvents[_0x8adb('0x2')](_0x44fdf7,_0x2baedb);};}exports['register']=function(_0x15bc63){for(var _0x1a5f36=0x0,_0x9f435=events[_0x8adb('0x3')];_0x1a5f36<_0x9f435;_0x1a5f36++){var _0x271bed=events[_0x1a5f36];var _0x16b932=createListener(_0x8adb('0x4')+_0x271bed,_0x15bc63);ChatQueueEvents['on'](_0x271bed,_0x16b932);}};
\ No newline at end of file
+var _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0x2862eb,_0x398d09){var _0x1f3b64=function(_0xa33e92){while(--_0xa33e92){_0x2862eb['push'](_0x2862eb['shift']());}};_0x1f3b64(++_0x398d09);}(_0x032e,0x124));var _0xe032=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x032e[_0x5447fd];return _0x15b28a;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}};
\ No newline at end of file
index d16ac9f..fcd6426 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x172c08,_0x422e49){var _0x569a8a=function(_0x1d8005){while(--_0x1d8005){_0x172c08['push'](_0x172c08['shift']());}};_0x569a8a(++_0x422e49);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x5de818,_0x3ef74c){var _0x5a2bb6=function(_0x44a001){while(--_0x44a001){_0x5de818['push'](_0x5de818['shift']());}};_0x5a2bb6(++_0x3ef74c);}(_0x814b,0x1a2));var _0xb814=function(_0xfcfc24,_0x48ca53){_0xfcfc24=_0xfcfc24-0x0;var _0x58f773=_0x814b[_0xfcfc24];return _0x58f773;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
index 9e2b681..4caaaf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd45=['DATE','STRING','moment'];(function(_0x2f3c61,_0x439bd2){var _0x162655=function(_0x4650dd){while(--_0x4650dd){_0x2f3c61['push'](_0x2f3c61['shift']());}};_0x162655(++_0x439bd2);}(_0xcd45,0x140));var _0x5cd4=function(_0x573984,_0x346d04){_0x573984=_0x573984-0x0;var _0x3822de=_0xcd45[_0x573984];return _0x3822de;};'use strict';var moment=require(_0x5cd4('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x5cd4('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5cd4('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5cd4('0x2')]}};
\ No newline at end of file
+var _0x9384=['STRING','DATE','moment','sequelize','exports'];(function(_0x252d7c,_0x3f0235){var _0x11c75c=function(_0x1ed6f5){while(--_0x1ed6f5){_0x252d7c['push'](_0x252d7c['shift']());}};_0x11c75c(++_0x3f0235);}(_0x9384,0xc0));var _0x4938=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x9384[_0x17406a];return _0x1501ff;};'use strict';var moment=require(_0x4938('0x0'));var Sequelize=require(_0x4938('0x1'));module[_0x4938('0x2')]={'uniqueid':{'type':Sequelize[_0x4938('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4938('0x3')]},'joinAt':{'type':Sequelize[_0x4938('0x4')]},'leaveAt':{'type':Sequelize[_0x4938('0x4')]},'acceptAt':{'type':Sequelize[_0x4938('0x4')]},'exitAt':{'type':Sequelize[_0x4938('0x4')]},'reason':{'type':Sequelize[_0x4938('0x3')]}};
\ No newline at end of file
index 2b7de60..2a281d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e0c=['rows','catch','show','params','fields','find','create','update','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','sendStatus','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll'];(function(_0x3de415,_0x5e68eb){var _0x3957dd=function(_0x597973){while(--_0x597973){_0x3de415['push'](_0x3de415['shift']());}};_0x3957dd(++_0x5e68eb);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x120a47,_0xeb0bbf){_0x120a47=_0x120a47-0x0;var _0x30f714=_0x3e0c[_0x120a47];return _0x30f714;};'use strict';var emlformat=require(_0xc3e0('0x0'));var rimraf=require(_0xc3e0('0x1'));var zipdir=require(_0xc3e0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc3e0('0x3'));var moment=require(_0xc3e0('0x4'));var BPromise=require(_0xc3e0('0x5'));var Mustache=require(_0xc3e0('0x6'));var util=require(_0xc3e0('0x7'));var path=require('path');var sox=require(_0xc3e0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc3e0('0x9'));var crypto=require(_0xc3e0('0xa'));var jsforce=require(_0xc3e0('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc3e0('0xc'));var authService=require(_0xc3e0('0xd'));var qs=require(_0xc3e0('0xe'));var as=require(_0xc3e0('0xf'));var hardwareService=require(_0xc3e0('0x10'));var logger=require(_0xc3e0('0x11'))(_0xc3e0('0x12'));var utils=require('../../config/utils');var config=require(_0xc3e0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc3e0('0x14'))['db'];function respondWithStatusCode(_0x13e297,_0x485fc4){_0x485fc4=_0x485fc4||0xcc;return function(_0x112a9e){if(_0x112a9e){return _0x13e297['sendStatus'](_0x485fc4);}return _0x13e297[_0xc3e0('0x15')](_0x485fc4)[_0xc3e0('0x16')]();};}function respondWithResult(_0x1c5e25,_0x18c9f7){_0x18c9f7=_0x18c9f7||0xc8;return function(_0x31ea6d){if(_0x31ea6d){return _0x1c5e25[_0xc3e0('0x15')](_0x18c9f7)[_0xc3e0('0x17')](_0x31ea6d);}};}function respondWithFilteredResult(_0x507cda,_0x23f3b8){return function(_0x1c53b7){if(_0x1c53b7){var _0x5a1e1a=typeof _0x23f3b8[_0xc3e0('0x18')]===_0xc3e0('0x19')&&typeof _0x23f3b8[_0xc3e0('0x1a')]===_0xc3e0('0x19');var _0x1e125c=_0x1c53b7[_0xc3e0('0x1b')];var _0x2e98d5=_0x5a1e1a?0x0:_0x23f3b8[_0xc3e0('0x18')];var _0x3207c6=_0x5a1e1a?_0x1c53b7[_0xc3e0('0x1b')]:_0x23f3b8[_0xc3e0('0x18')]+_0x23f3b8[_0xc3e0('0x1a')];var _0x281b7a;if(_0x3207c6>=_0x1e125c){_0x3207c6=_0x1e125c;_0x281b7a=0xc8;}else{_0x281b7a=0xce;}_0x507cda['status'](_0x281b7a);return _0x507cda[_0xc3e0('0x1c')](_0xc3e0('0x1d'),_0x2e98d5+'-'+_0x3207c6+'/'+_0x1e125c)[_0xc3e0('0x17')](_0x1c53b7);}return null;};}function patchUpdates(_0x1c73d1){return function(_0x40c7df){try{jsonpatch['apply'](_0x40c7df,_0x1c73d1,!![]);}catch(_0x3f662b){return BPromise['reject'](_0x3f662b);}return _0x40c7df[_0xc3e0('0x1e')]();};}function saveUpdates(_0xcc3fe4,_0x1ff14b){return function(_0x572473){if(_0x572473){return _0x572473['update'](_0xcc3fe4)[_0xc3e0('0x1f')](function(_0x5d7154){return _0x5d7154;});}return null;};}function removeEntity(_0x277782,_0x514488){return function(_0x3c27ef){if(_0x3c27ef){return _0x3c27ef[_0xc3e0('0x20')]()['then'](function(){_0x277782[_0xc3e0('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x278e27,_0xce50f6){return function(_0xddd05d){if(!_0xddd05d){_0x278e27[_0xc3e0('0x21')](0x194);}return _0xddd05d;};}function handleError(_0x48d224,_0x159a67){_0x159a67=_0x159a67||0x1f4;return function(_0x3b4df3){logger['error'](_0x3b4df3[_0xc3e0('0x22')]);if(_0x3b4df3[_0xc3e0('0x23')]){delete _0x3b4df3[_0xc3e0('0x23')];}_0x48d224[_0xc3e0('0x15')](_0x159a67)['send'](_0x3b4df3);};}exports[_0xc3e0('0x24')]=function(_0x3bf873,_0x3d84fb){var _0x21fbd6={},_0x36e1ab={},_0x2fef11={'count':0x0,'rows':[]};var _0x4adb8e=_[_0xc3e0('0x25')](db[_0xc3e0('0x26')][_0xc3e0('0x27')],function(_0x3a51f0){return{'name':_0x3a51f0[_0xc3e0('0x28')],'type':_0x3a51f0[_0xc3e0('0x29')][_0xc3e0('0x2a')]};});_0x36e1ab[_0xc3e0('0x2b')]=_[_0xc3e0('0x25')](_0x4adb8e,_0xc3e0('0x23'));_0x36e1ab[_0xc3e0('0x2c')]=_[_0xc3e0('0x2d')](_0x3bf873[_0xc3e0('0x2c')]);_0x36e1ab[_0xc3e0('0x2e')]=_['intersection'](_0x36e1ab[_0xc3e0('0x2b')],_0x36e1ab[_0xc3e0('0x2c')]);_0x21fbd6[_0xc3e0('0x2f')]=_[_0xc3e0('0x30')](_0x36e1ab[_0xc3e0('0x2b')],qs['fields'](_0x3bf873[_0xc3e0('0x2c')]['fields']));_0x21fbd6[_0xc3e0('0x2f')]=_0x21fbd6[_0xc3e0('0x2f')][_0xc3e0('0x31')]?_0x21fbd6[_0xc3e0('0x2f')]:_0x36e1ab[_0xc3e0('0x2b')];if(!_0x3bf873['query'][_0xc3e0('0x32')](_0xc3e0('0x33'))){_0x21fbd6['limit']=qs['limit'](_0x3bf873[_0xc3e0('0x2c')]['limit']);_0x21fbd6[_0xc3e0('0x18')]=qs[_0xc3e0('0x18')](_0x3bf873[_0xc3e0('0x2c')][_0xc3e0('0x18')]);}_0x21fbd6[_0xc3e0('0x34')]=qs[_0xc3e0('0x35')](_0x3bf873[_0xc3e0('0x2c')][_0xc3e0('0x35')]);_0x21fbd6[_0xc3e0('0x36')]=qs['filters'](_[_0xc3e0('0x37')](_0x3bf873['query'],_0x36e1ab[_0xc3e0('0x2e')]),_0x4adb8e);if(_0x3bf873[_0xc3e0('0x2c')]['filter']){_0x21fbd6['where']=_['merge'](_0x21fbd6[_0xc3e0('0x36')],{'$or':_['map'](_0x4adb8e,function(_0x413172){if(_0x413172[_0xc3e0('0x29')]!=='VIRTUAL'){var _0x3dec8a={};_0x3dec8a[_0x413172['name']]={'$like':'%'+_0x3bf873['query'][_0xc3e0('0x38')]+'%'};return _0x3dec8a;}})});}_0x21fbd6=_[_0xc3e0('0x39')]({},_0x21fbd6,_0x3bf873['options']);var _0x35d62a={'where':_0x21fbd6['where']};return db['ChatQueueReport'][_0xc3e0('0x1b')](_0x35d62a)[_0xc3e0('0x1f')](function(_0x1eef7a){_0x2fef11['count']=_0x1eef7a;if(_0x3bf873[_0xc3e0('0x2c')][_0xc3e0('0x3a')]){_0x21fbd6[_0xc3e0('0x3b')]=[{'all':!![]}];}return db[_0xc3e0('0x26')][_0xc3e0('0x3c')](_0x21fbd6);})[_0xc3e0('0x1f')](function(_0xb0e953){_0x2fef11[_0xc3e0('0x3d')]=_0xb0e953;return _0x2fef11;})[_0xc3e0('0x1f')](respondWithFilteredResult(_0x3d84fb,_0x21fbd6))[_0xc3e0('0x3e')](handleError(_0x3d84fb,null));};exports[_0xc3e0('0x3f')]=function(_0x1183f5,_0x4a34cf){var _0x3d4ff8={'raw':!![],'where':{'id':_0x1183f5[_0xc3e0('0x40')]['id']}},_0x52e539={};_0x52e539[_0xc3e0('0x2b')]=_[_0xc3e0('0x2d')](db[_0xc3e0('0x26')][_0xc3e0('0x27')]);_0x52e539[_0xc3e0('0x2c')]=_[_0xc3e0('0x2d')](_0x1183f5[_0xc3e0('0x2c')]);_0x52e539[_0xc3e0('0x2e')]=_[_0xc3e0('0x30')](_0x52e539[_0xc3e0('0x2b')],_0x52e539['query']);_0x3d4ff8[_0xc3e0('0x2f')]=_[_0xc3e0('0x30')](_0x52e539[_0xc3e0('0x2b')],qs[_0xc3e0('0x41')](_0x1183f5[_0xc3e0('0x2c')]['fields']));_0x3d4ff8[_0xc3e0('0x2f')]=_0x3d4ff8[_0xc3e0('0x2f')]['length']?_0x3d4ff8['attributes']:_0x52e539[_0xc3e0('0x2b')];if(_0x1183f5[_0xc3e0('0x2c')][_0xc3e0('0x3a')]){_0x3d4ff8[_0xc3e0('0x3b')]=[{'all':!![]}];}_0x3d4ff8=_[_0xc3e0('0x39')]({},_0x3d4ff8,_0x1183f5['options']);return db[_0xc3e0('0x26')][_0xc3e0('0x42')](_0x3d4ff8)[_0xc3e0('0x1f')](handleEntityNotFound(_0x4a34cf,null))[_0xc3e0('0x1f')](respondWithResult(_0x4a34cf,null))[_0xc3e0('0x3e')](handleError(_0x4a34cf,null));};exports[_0xc3e0('0x43')]=function(_0x454309,_0x554887){return db[_0xc3e0('0x26')][_0xc3e0('0x43')](_0x454309['body'],{})[_0xc3e0('0x1f')](respondWithResult(_0x554887,0xc9))[_0xc3e0('0x3e')](handleError(_0x554887,null));};exports[_0xc3e0('0x44')]=function(_0x5e978e,_0x13e442){if(_0x5e978e[_0xc3e0('0x45')]['id']){delete _0x5e978e['body']['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5e978e[_0xc3e0('0x40')]['id']}})[_0xc3e0('0x1f')](handleEntityNotFound(_0x13e442,null))[_0xc3e0('0x1f')](saveUpdates(_0x5e978e[_0xc3e0('0x45')],null))[_0xc3e0('0x1f')](respondWithResult(_0x13e442,null))[_0xc3e0('0x3e')](handleError(_0x13e442,null));};exports[_0xc3e0('0x20')]=function(_0x2ffcfe,_0x582719){return db[_0xc3e0('0x26')]['find']({'where':{'id':_0x2ffcfe[_0xc3e0('0x40')]['id']}})[_0xc3e0('0x1f')](handleEntityNotFound(_0x582719,null))['then'](removeEntity(_0x582719,null))[_0xc3e0('0x3e')](handleError(_0x582719,null));};exports[_0xc3e0('0x46')]=function(_0x253c57,_0x4ceb7c){return db[_0xc3e0('0x26')][_0xc3e0('0x46')]()[_0xc3e0('0x1f')](respondWithResult(_0x4ceb7c,null))[_0xc3e0('0x3e')](handleError(_0x4ceb7c,null));};
\ No newline at end of file
+var _0x04cc=['limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','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','status','end','json','undefined'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x04cc,0x11a));var _0xc04c=function(_0x3130b5,_0x23faf7){_0x3130b5=_0x3130b5-0x0;var _0xa6d8a3=_0x04cc[_0x3130b5];return _0xa6d8a3;};'use strict';var emlformat=require(_0xc04c('0x0'));var rimraf=require(_0xc04c('0x1'));var zipdir=require(_0xc04c('0x2'));var jsonpatch=require(_0xc04c('0x3'));var rp=require('request-promise');var moment=require(_0xc04c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc04c('0x5'));var path=require(_0xc04c('0x6'));var sox=require(_0xc04c('0x7'));var csv=require(_0xc04c('0x8'));var ejs=require(_0xc04c('0x9'));var fs=require('fs');var fs_extra=require(_0xc04c('0xa'));var _=require(_0xc04c('0xb'));var squel=require('squel');var crypto=require(_0xc04c('0xc'));var jsforce=require(_0xc04c('0xd'));var deskjs=require(_0xc04c('0xe'));var toCsv=require(_0xc04c('0x8'));var querystring=require(_0xc04c('0xf'));var Papa=require(_0xc04c('0x10'));var Redis=require(_0xc04c('0x11'));var authService=require(_0xc04c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc04c('0x13'));var logger=require(_0xc04c('0x14'))(_0xc04c('0x15'));var utils=require(_0xc04c('0x16'));var config=require(_0xc04c('0x17'));var licenseUtil=require(_0xc04c('0x18'));var db=require(_0xc04c('0x19'))['db'];function respondWithStatusCode(_0x563a5f,_0x510e18){_0x510e18=_0x510e18||0xcc;return function(_0x11a9e4){if(_0x11a9e4){return _0x563a5f['sendStatus'](_0x510e18);}return _0x563a5f[_0xc04c('0x1a')](_0x510e18)[_0xc04c('0x1b')]();};}function respondWithResult(_0x27a3f8,_0x23e500){_0x23e500=_0x23e500||0xc8;return function(_0x4f318d){if(_0x4f318d){return _0x27a3f8[_0xc04c('0x1a')](_0x23e500)[_0xc04c('0x1c')](_0x4f318d);}};}function respondWithFilteredResult(_0x1df6d9,_0x247582){return function(_0x4c1154){if(_0x4c1154){var _0x4e1aea=typeof _0x247582['offset']===_0xc04c('0x1d')&&typeof _0x247582[_0xc04c('0x1e')]==='undefined';var _0x82afdd=_0x4c1154['count'];var _0x170f47=_0x4e1aea?0x0:_0x247582[_0xc04c('0x1f')];var _0x59d405=_0x4e1aea?_0x4c1154[_0xc04c('0x20')]:_0x247582[_0xc04c('0x1f')]+_0x247582[_0xc04c('0x1e')];var _0x1ad3e6;if(_0x59d405>=_0x82afdd){_0x59d405=_0x82afdd;_0x1ad3e6=0xc8;}else{_0x1ad3e6=0xce;}_0x1df6d9[_0xc04c('0x1a')](_0x1ad3e6);return _0x1df6d9[_0xc04c('0x21')](_0xc04c('0x22'),_0x170f47+'-'+_0x59d405+'/'+_0x82afdd)[_0xc04c('0x1c')](_0x4c1154);}return null;};}function patchUpdates(_0x9b1151){return function(_0x4050ae){try{jsonpatch[_0xc04c('0x23')](_0x4050ae,_0x9b1151,!![]);}catch(_0x5d7c0e){return BPromise[_0xc04c('0x24')](_0x5d7c0e);}return _0x4050ae[_0xc04c('0x25')]();};}function saveUpdates(_0x1a3927,_0x1fa984){return function(_0x2422af){if(_0x2422af){return _0x2422af[_0xc04c('0x26')](_0x1a3927)[_0xc04c('0x27')](function(_0x244e80){return _0x244e80;});}return null;};}function removeEntity(_0x204d03,_0x17bc59){return function(_0x47dddc){if(_0x47dddc){return _0x47dddc[_0xc04c('0x28')]()['then'](function(){_0x204d03[_0xc04c('0x1a')](0xcc)[_0xc04c('0x1b')]();});}};}function handleEntityNotFound(_0x446722,_0x40f467){return function(_0x3b2337){if(!_0x3b2337){_0x446722['sendStatus'](0x194);}return _0x3b2337;};}function handleError(_0x175049,_0x158f28){_0x158f28=_0x158f28||0x1f4;return function(_0xae56c9){logger[_0xc04c('0x29')](_0xae56c9[_0xc04c('0x2a')]);if(_0xae56c9['name']){delete _0xae56c9[_0xc04c('0x2b')];}_0x175049[_0xc04c('0x1a')](_0x158f28)[_0xc04c('0x2c')](_0xae56c9);};}exports['index']=function(_0x1c3f29,_0x5f0706){var _0x4082da={},_0x14ba62={},_0x1bc9ab={'count':0x0,'rows':[]};var _0x596b9b=_[_0xc04c('0x2d')](db['ChatQueueReport'][_0xc04c('0x2e')],function(_0xc356a2){return{'name':_0xc356a2[_0xc04c('0x2f')],'type':_0xc356a2[_0xc04c('0x30')][_0xc04c('0x31')]};});_0x14ba62['model']=_[_0xc04c('0x2d')](_0x596b9b,'name');_0x14ba62[_0xc04c('0x32')]=_['keys'](_0x1c3f29['query']);_0x14ba62['filters']=_[_0xc04c('0x33')](_0x14ba62[_0xc04c('0x34')],_0x14ba62['query']);_0x4082da['attributes']=_[_0xc04c('0x33')](_0x14ba62[_0xc04c('0x34')],qs[_0xc04c('0x35')](_0x1c3f29[_0xc04c('0x32')]['fields']));_0x4082da[_0xc04c('0x36')]=_0x4082da[_0xc04c('0x36')][_0xc04c('0x37')]?_0x4082da[_0xc04c('0x36')]:_0x14ba62[_0xc04c('0x34')];if(!_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x38')](_0xc04c('0x39'))){_0x4082da[_0xc04c('0x1e')]=qs['limit'](_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x1e')]);_0x4082da[_0xc04c('0x1f')]=qs[_0xc04c('0x1f')](_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x1f')]);}_0x4082da['order']=qs[_0xc04c('0x3a')](_0x1c3f29['query']['sort']);_0x4082da['where']=qs[_0xc04c('0x3b')](_[_0xc04c('0x3c')](_0x1c3f29[_0xc04c('0x32')],_0x14ba62[_0xc04c('0x3b')]),_0x596b9b);if(_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x3d')]){_0x4082da[_0xc04c('0x3e')]=_[_0xc04c('0x3f')](_0x4082da['where'],{'$or':_[_0xc04c('0x2d')](_0x596b9b,function(_0x2ecddd){if(_0x2ecddd['type']!==_0xc04c('0x40')){var _0x2ff7b4={};_0x2ff7b4[_0x2ecddd[_0xc04c('0x2b')]]={'$like':'%'+_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x3d')]+'%'};return _0x2ff7b4;}})});}_0x4082da=_[_0xc04c('0x3f')]({},_0x4082da,_0x1c3f29[_0xc04c('0x41')]);var _0xb4968={'where':_0x4082da['where']};return db[_0xc04c('0x42')]['count'](_0xb4968)[_0xc04c('0x27')](function(_0x1cd5df){_0x1bc9ab[_0xc04c('0x20')]=_0x1cd5df;if(_0x1c3f29[_0xc04c('0x32')][_0xc04c('0x43')]){_0x4082da[_0xc04c('0x44')]=[{'all':!![]}];}return db[_0xc04c('0x42')]['findAll'](_0x4082da);})[_0xc04c('0x27')](function(_0xf6d3ce){_0x1bc9ab[_0xc04c('0x45')]=_0xf6d3ce;return _0x1bc9ab;})[_0xc04c('0x27')](respondWithFilteredResult(_0x5f0706,_0x4082da))[_0xc04c('0x46')](handleError(_0x5f0706,null));};exports[_0xc04c('0x47')]=function(_0x29dd7d,_0x287bbb){var _0x3320be={'raw':!![],'where':{'id':_0x29dd7d[_0xc04c('0x48')]['id']}},_0x4ba324={};_0x4ba324[_0xc04c('0x34')]=_['keys'](db[_0xc04c('0x42')][_0xc04c('0x2e')]);_0x4ba324[_0xc04c('0x32')]=_[_0xc04c('0x49')](_0x29dd7d[_0xc04c('0x32')]);_0x4ba324[_0xc04c('0x3b')]=_[_0xc04c('0x33')](_0x4ba324['model'],_0x4ba324[_0xc04c('0x32')]);_0x3320be[_0xc04c('0x36')]=_['intersection'](_0x4ba324[_0xc04c('0x34')],qs[_0xc04c('0x35')](_0x29dd7d[_0xc04c('0x32')][_0xc04c('0x35')]));_0x3320be['attributes']=_0x3320be['attributes']['length']?_0x3320be['attributes']:_0x4ba324['model'];if(_0x29dd7d[_0xc04c('0x32')][_0xc04c('0x43')]){_0x3320be['include']=[{'all':!![]}];}_0x3320be=_[_0xc04c('0x3f')]({},_0x3320be,_0x29dd7d[_0xc04c('0x41')]);return db[_0xc04c('0x42')][_0xc04c('0x4a')](_0x3320be)[_0xc04c('0x27')](handleEntityNotFound(_0x287bbb,null))['then'](respondWithResult(_0x287bbb,null))['catch'](handleError(_0x287bbb,null));};exports[_0xc04c('0x4b')]=function(_0x196bf4,_0x360f04){return db[_0xc04c('0x42')][_0xc04c('0x4b')](_0x196bf4['body'],{})[_0xc04c('0x27')](respondWithResult(_0x360f04,0xc9))[_0xc04c('0x46')](handleError(_0x360f04,null));};exports[_0xc04c('0x26')]=function(_0x3a93bf,_0x1e2590){if(_0x3a93bf['body']['id']){delete _0x3a93bf[_0xc04c('0x4c')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x3a93bf[_0xc04c('0x48')]['id']}})['then'](handleEntityNotFound(_0x1e2590,null))[_0xc04c('0x27')](saveUpdates(_0x3a93bf['body'],null))[_0xc04c('0x27')](respondWithResult(_0x1e2590,null))[_0xc04c('0x46')](handleError(_0x1e2590,null));};exports['destroy']=function(_0x37f794,_0x4d6af4){return db[_0xc04c('0x42')][_0xc04c('0x4a')]({'where':{'id':_0x37f794[_0xc04c('0x48')]['id']}})[_0xc04c('0x27')](handleEntityNotFound(_0x4d6af4,null))[_0xc04c('0x27')](removeEntity(_0x4d6af4,null))[_0xc04c('0x46')](handleError(_0x4d6af4,null));};exports[_0xc04c('0x4d')]=function(_0x56c80a,_0x45688a){return db[_0xc04c('0x42')][_0xc04c('0x4d')]()[_0xc04c('0x27')](respondWithResult(_0x45688a,null))[_0xc04c('0x46')](handleError(_0x45688a,null));};
\ No newline at end of file
index 7259361..f0bce86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x9664b9,_0x51d10e){var _0x420c36=function(_0x131a18){while(--_0x131a18){_0x9664b9['push'](_0x9664b9['shift']());}};_0x420c36(++_0x51d10e);}(_0xb10b,0x12a));var _0xbb10=function(_0x35fb7c,_0x4ee512){_0x35fb7c=_0x35fb7c-0x0;var _0x3b319e=_0xb10b[_0x35fb7c];return _0x3b319e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x2a6754,_0x277259){var _0x17feda=function(_0x5745be){while(--_0x5745be){_0x2a6754['push'](_0x2a6754['shift']());}};_0x17feda(++_0x277259);}(_0xe706,0xa3));var _0x6e70=function(_0x109b6e,_0xbf489f){_0x109b6e=_0x109b6e-0x0;var _0x1e8595=_0xe706[_0x109b6e];return _0x1e8595;};'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 d609aa9..f6aecbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe003=['UpdateChatQueueReport','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','ChatQueueReport,\x20%s,\x20%s','message','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','update','body','where','limit'];(function(_0xe0c564,_0x2ff569){var _0x32e0f6=function(_0x3fd0fc){while(--_0x3fd0fc){_0xe0c564['push'](_0xe0c564['shift']());}};_0x32e0f6(++_0x2ff569);}(_0xe003,0x1c4));var _0x3e00=function(_0x5bab65,_0x5df348){_0x5bab65=_0x5bab65-0x0;var _0x49421c=_0xe003[_0x5bab65];return _0x49421c;};'use strict';var _=require(_0x3e00('0x0'));var util=require(_0x3e00('0x1'));var moment=require('moment');var BPromise=require(_0x3e00('0x2'));var rs=require(_0x3e00('0x3'));var fs=require('fs');var Redis=require(_0x3e00('0x4'));var db=require(_0x3e00('0x5'))['db'];var utils=require(_0x3e00('0x6'));var logger=require('../../config/logger')(_0x3e00('0x7'));var config=require(_0x3e00('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3e00('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x167aef,_0x489cbb,_0x4a874b){return new BPromise(function(_0x1e6a9b,_0x511eee){return client[_0x3e00('0xa')](_0x167aef,_0x4a874b)['then'](function(_0xcd93a3){logger[_0x3e00('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x489cbb,_0x3e00('0xc'));logger['debug'](_0x3e00('0xd'),_0x489cbb,_0x3e00('0xc'),JSON['stringify'](_0xcd93a3));if(_0xcd93a3[_0x3e00('0xe')]){if(_0xcd93a3[_0x3e00('0xe')][_0x3e00('0xf')]===0x1f4){logger[_0x3e00('0xe')](_0x3e00('0x10'),_0x489cbb,_0xcd93a3[_0x3e00('0xe')][_0x3e00('0x11')]);return _0x511eee(_0xcd93a3[_0x3e00('0xe')][_0x3e00('0x11')]);}logger[_0x3e00('0xe')](_0x3e00('0x10'),_0x489cbb,_0xcd93a3[_0x3e00('0xe')]['message']);return _0x1e6a9b(_0xcd93a3[_0x3e00('0xe')]['message']);}else{logger[_0x3e00('0xb')](_0x3e00('0x10'),_0x489cbb,_0x3e00('0xc'));_0x1e6a9b(_0xcd93a3['result'][_0x3e00('0x11')]);}})[_0x3e00('0x12')](function(_0x2b5dd7){logger[_0x3e00('0xe')](_0x3e00('0x10'),_0x489cbb,_0x2b5dd7);_0x511eee(_0x2b5dd7);});});}exports[_0x3e00('0x13')]=function(_0x20a8c3){var _0x47aa36=this;return new Promise(function(_0x3da7d2,_0x274d3b){return db[_0x3e00('0x14')][_0x3e00('0x15')](_0x20a8c3['body'],{'raw':_0x20a8c3[_0x3e00('0x16')]?_0x20a8c3[_0x3e00('0x16')][_0x3e00('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2a31b1){logger[_0x3e00('0xb')](_0x3e00('0x13'),_0x20a8c3);logger['debug'](_0x3e00('0x13'),_0x20a8c3,JSON['stringify'](_0x2a31b1));_0x3da7d2(_0x2a31b1);})[_0x3e00('0x12')](function(_0x1f809c){logger[_0x3e00('0xe')](_0x3e00('0x13'),_0x1f809c[_0x3e00('0x11')],_0x20a8c3);_0x274d3b(_0x47aa36['error'](0x1f4,_0x1f809c['message']));});});};exports['UpdateChatQueueReport']=function(_0x2e6375){var _0x50f2ba=this;return new Promise(function(_0x79ecb8,_0x56e7ea){return db[_0x3e00('0x14')][_0x3e00('0x18')](_0x2e6375[_0x3e00('0x19')],{'raw':_0x2e6375[_0x3e00('0x16')]?_0x2e6375[_0x3e00('0x16')][_0x3e00('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e6375['options']?_0x2e6375[_0x3e00('0x16')][_0x3e00('0x1a')]||null:null,'attributes':_0x2e6375['options']?_0x2e6375[_0x3e00('0x16')]['attributes']||null:null,'limit':_0x2e6375[_0x3e00('0x16')]?_0x2e6375['options'][_0x3e00('0x1b')]||null:null})['then'](function(_0x1cb8cf){logger[_0x3e00('0xb')](_0x3e00('0x1c'),_0x2e6375);logger[_0x3e00('0x1d')](_0x3e00('0x1c'),_0x2e6375,JSON['stringify'](_0x1cb8cf));_0x79ecb8(_0x1cb8cf);})[_0x3e00('0x12')](function(_0x51aa44){logger[_0x3e00('0xe')](_0x3e00('0x1c'),_0x51aa44['message'],_0x2e6375);_0x56e7ea(_0x50f2ba[_0x3e00('0xe')](0x1f4,_0x51aa44[_0x3e00('0x11')]));});});};
\ No newline at end of file
+var _0xe34f=['http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','error','message','result','ChatQueueReport','create','options','raw','debug','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','limit','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x55d0d4,_0x498a65){var _0x55faf8=function(_0xd08898){while(--_0xd08898){_0x55d0d4['push'](_0x55d0d4['shift']());}};_0x55faf8(++_0x498a65);}(_0xe34f,0xbc));var _0xfe34=function(_0x2b8f4c,_0x4393c9){_0x2b8f4c=_0x2b8f4c-0x0;var _0xe814ca=_0xe34f[_0x2b8f4c];return _0xe814ca;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfe34('0x0'));var fs=require('fs');var Redis=require(_0xfe34('0x1'));var db=require(_0xfe34('0x2'))['db'];var utils=require(_0xfe34('0x3'));var logger=require(_0xfe34('0x4'))(_0xfe34('0x5'));var config=require(_0xfe34('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfe34('0x7')][_0xfe34('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x195bcd,_0x3fe816,_0x25f17a){return new BPromise(function(_0x4fa1cd,_0x5cdc7e){return client[_0xfe34('0x9')](_0x195bcd,_0x25f17a)[_0xfe34('0xa')](function(_0x252ec7){logger[_0xfe34('0xb')](_0xfe34('0xc'),_0x3fe816,_0xfe34('0xd'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3fe816,'request\x20sent',JSON['stringify'](_0x252ec7));if(_0x252ec7[_0xfe34('0xe')]){if(_0x252ec7[_0xfe34('0xe')]['code']===0x1f4){logger[_0xfe34('0xe')](_0xfe34('0xc'),_0x3fe816,_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);return _0x5cdc7e(_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);}logger['error'](_0xfe34('0xc'),_0x3fe816,_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);return _0x4fa1cd(_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);}else{logger['info'](_0xfe34('0xc'),_0x3fe816,_0xfe34('0xd'));_0x4fa1cd(_0x252ec7[_0xfe34('0x10')][_0xfe34('0xf')]);}})['catch'](function(_0x53b469){logger['error'](_0xfe34('0xc'),_0x3fe816,_0x53b469);_0x5cdc7e(_0x53b469);});});}exports['CreateChatQueueReport']=function(_0x5c95f5){var _0x495b48=this;return new Promise(function(_0x3f7f60,_0x19f7e3){return db[_0xfe34('0x11')][_0xfe34('0x12')](_0x5c95f5['body'],{'raw':_0x5c95f5[_0xfe34('0x13')]?_0x5c95f5[_0xfe34('0x13')][_0xfe34('0x14')]===undefined?!![]:![]:!![]})[_0xfe34('0xa')](function(_0x17529f){logger[_0xfe34('0xb')]('CreateChatQueueReport',_0x5c95f5);logger[_0xfe34('0x15')](_0xfe34('0x16'),_0x5c95f5,JSON[_0xfe34('0x17')](_0x17529f));_0x3f7f60(_0x17529f);})['catch'](function(_0x18d4d1){logger[_0xfe34('0xe')](_0xfe34('0x16'),_0x18d4d1[_0xfe34('0xf')],_0x5c95f5);_0x19f7e3(_0x495b48[_0xfe34('0xe')](0x1f4,_0x18d4d1[_0xfe34('0xf')]));});});};exports[_0xfe34('0x18')]=function(_0x270d39){var _0x371498=this;return new Promise(function(_0x837b19,_0x4c0777){return db[_0xfe34('0x11')][_0xfe34('0x19')](_0x270d39['body'],{'raw':_0x270d39[_0xfe34('0x13')]?_0x270d39['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x270d39[_0xfe34('0x13')]?_0x270d39['options']['where']||null:null,'attributes':_0x270d39[_0xfe34('0x13')]?_0x270d39[_0xfe34('0x13')]['attributes']||null:null,'limit':_0x270d39[_0xfe34('0x13')]?_0x270d39[_0xfe34('0x13')][_0xfe34('0x1a')]||null:null})[_0xfe34('0xa')](function(_0x58eba7){logger[_0xfe34('0xb')]('UpdateChatQueueReport',_0x270d39);logger[_0xfe34('0x15')](_0xfe34('0x18'),_0x270d39,JSON[_0xfe34('0x17')](_0x58eba7));_0x837b19(_0x58eba7);})[_0xfe34('0x1b')](function(_0x550e44){logger[_0xfe34('0xe')](_0xfe34('0x18'),_0x550e44['message'],_0x270d39);_0x4c0777(_0x371498[_0xfe34('0xe')](0x1f4,_0x550e44[_0xfe34('0xf')]));});});};
\ No newline at end of file
index 5d700fc..264884b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6070=['put','delete','exports','multer','util','express','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create'];(function(_0x3e4d9a,_0x449a9f){var _0x4124d3=function(_0x3dd192){while(--_0x3dd192){_0x3e4d9a['push'](_0x3e4d9a['shift']());}};_0x4124d3(++_0x449a9f);}(_0x6070,0x146));var _0x0607=function(_0x57a3e9,_0x4dd098){_0x57a3e9=_0x57a3e9-0x0;var _0x269c46=_0x6070[_0x57a3e9];return _0x269c46;};'use strict';var multer=require(_0x0607('0x0'));var util=require(_0x0607('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0607('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0607('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0607('0x4'));var controller=require(_0x0607('0x5'));router[_0x0607('0x6')]('/',auth['isAuthenticated'](),controller[_0x0607('0x7')]);router[_0x0607('0x6')](_0x0607('0x8'),auth[_0x0607('0x9')](),controller[_0x0607('0xa')]);router[_0x0607('0x6')](_0x0607('0xb'),auth[_0x0607('0x9')](),controller['show']);router[_0x0607('0xc')]('/',auth['isAuthenticated'](),controller[_0x0607('0xd')]);router[_0x0607('0xe')](_0x0607('0xb'),auth[_0x0607('0x9')](),controller['update']);router[_0x0607('0xf')]('/:id',auth[_0x0607('0x9')](),controller['destroy']);module[_0x0607('0x10')]=router;
\ No newline at end of file
+var _0xdc15=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0xdc15,0x167));var _0x5dc1=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0xdc15[_0x215e65];return _0xa85842;};'use strict';var multer=require(_0x5dc1('0x0'));var util=require('util');var path=require(_0x5dc1('0x1'));var timeout=require(_0x5dc1('0x2'));var express=require(_0x5dc1('0x3'));var router=express[_0x5dc1('0x4')]();var fs_extra=require(_0x5dc1('0x5'));var auth=require(_0x5dc1('0x6'));var interaction=require(_0x5dc1('0x7'));var config=require(_0x5dc1('0x8'));var controller=require('./chatQueueReport.controller');router[_0x5dc1('0x9')]('/',auth[_0x5dc1('0xa')](),controller['index']);router['get']('/describe',auth[_0x5dc1('0xa')](),controller[_0x5dc1('0xb')]);router[_0x5dc1('0x9')](_0x5dc1('0xc'),auth[_0x5dc1('0xa')](),controller[_0x5dc1('0xd')]);router[_0x5dc1('0xe')]('/',auth[_0x5dc1('0xa')](),controller[_0x5dc1('0xf')]);router['put']('/:id',auth[_0x5dc1('0xa')](),controller[_0x5dc1('0x10')]);router[_0x5dc1('0x11')](_0x5dc1('0xc'),auth[_0x5dc1('0xa')](),controller[_0x5dc1('0x12')]);module[_0x5dc1('0x13')]=router;
\ No newline at end of file
index e9da731..1460e87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1cdcd0,_0xdb1df2){var _0x240702=function(_0x3189e2){while(--_0x3189e2){_0x1cdcd0['push'](_0x1cdcd0['shift']());}};_0x240702(++_0xdb1df2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5712f8,_0x17156b){var _0x14a364=function(_0x1da9de){while(--_0x1da9de){_0x5712f8['push'](_0x5712f8['shift']());}};_0x14a364(++_0x17156b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x451868,_0x36ba3e){_0x451868=_0x451868-0x0;var _0x2f89e1=_0xb43b[_0x451868];return _0x2f89e1;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
index 0686862..c237566 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc07=['length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','findAll','catch','params','keys','fields','include','options','find','create','body','destroy','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','intersection','model','attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xcc07,0x18e));var _0x7cc0=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xcc07[_0x4e93a9];return _0x43013c;};'use strict';var emlformat=require(_0x7cc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7cc0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7cc0('0x2'));var moment=require(_0x7cc0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7cc0('0x4'));var util=require(_0x7cc0('0x5'));var path=require(_0x7cc0('0x6'));var sox=require(_0x7cc0('0x7'));var csv=require(_0x7cc0('0x8'));var ejs=require(_0x7cc0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7cc0('0xa'));var squel=require(_0x7cc0('0xb'));var crypto=require(_0x7cc0('0xc'));var jsforce=require(_0x7cc0('0xd'));var deskjs=require(_0x7cc0('0xe'));var toCsv=require(_0x7cc0('0x8'));var querystring=require(_0x7cc0('0xf'));var Papa=require(_0x7cc0('0x10'));var Redis=require(_0x7cc0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7cc0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7cc0('0x13'));var logger=require(_0x7cc0('0x14'))('api');var utils=require(_0x7cc0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7cc0('0x16'));var db=require(_0x7cc0('0x17'))['db'];function respondWithStatusCode(_0x5410bd,_0x26356f){_0x26356f=_0x26356f||0xcc;return function(_0x1caa5e){if(_0x1caa5e){return _0x5410bd[_0x7cc0('0x18')](_0x26356f);}return _0x5410bd[_0x7cc0('0x19')](_0x26356f)[_0x7cc0('0x1a')]();};}function respondWithResult(_0x4c8ca6,_0xdde8ab){_0xdde8ab=_0xdde8ab||0xc8;return function(_0x516f46){if(_0x516f46){return _0x4c8ca6[_0x7cc0('0x19')](_0xdde8ab)['json'](_0x516f46);}};}function respondWithFilteredResult(_0x5402e2,_0x47c1d8){return function(_0x22c4ea){if(_0x22c4ea){var _0x3e44b4=typeof _0x47c1d8['offset']==='undefined'&&typeof _0x47c1d8['limit']===_0x7cc0('0x1b');var _0x2224d1=_0x22c4ea[_0x7cc0('0x1c')];var _0xaa72d8=_0x3e44b4?0x0:_0x47c1d8[_0x7cc0('0x1d')];var _0x58966a=_0x3e44b4?_0x22c4ea[_0x7cc0('0x1c')]:_0x47c1d8['offset']+_0x47c1d8[_0x7cc0('0x1e')];var _0x253c25;if(_0x58966a>=_0x2224d1){_0x58966a=_0x2224d1;_0x253c25=0xc8;}else{_0x253c25=0xce;}_0x5402e2[_0x7cc0('0x19')](_0x253c25);return _0x5402e2[_0x7cc0('0x1f')](_0x7cc0('0x20'),_0xaa72d8+'-'+_0x58966a+'/'+_0x2224d1)[_0x7cc0('0x21')](_0x22c4ea);}return null;};}function patchUpdates(_0x50e3ba){return function(_0x3c2efc){try{jsonpatch[_0x7cc0('0x22')](_0x3c2efc,_0x50e3ba,!![]);}catch(_0x5a35b9){return BPromise[_0x7cc0('0x23')](_0x5a35b9);}return _0x3c2efc[_0x7cc0('0x24')]();};}function saveUpdates(_0x2c414a,_0x1fbc7d){return function(_0x5a39fd){if(_0x5a39fd){return _0x5a39fd[_0x7cc0('0x25')](_0x2c414a)[_0x7cc0('0x26')](function(_0x5a0616){return _0x5a0616;});}return null;};}function removeEntity(_0x2fbd03,_0x208182){return function(_0xed9e5a){if(_0xed9e5a){return _0xed9e5a['destroy']()[_0x7cc0('0x26')](function(){_0x2fbd03[_0x7cc0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x343b3b,_0x11b0fc){return function(_0x76577){if(!_0x76577){_0x343b3b[_0x7cc0('0x18')](0x194);}return _0x76577;};}function handleError(_0xc7e600,_0xd9bcb9){_0xd9bcb9=_0xd9bcb9||0x1f4;return function(_0x3c8107){logger[_0x7cc0('0x27')](_0x3c8107['stack']);if(_0x3c8107[_0x7cc0('0x28')]){delete _0x3c8107[_0x7cc0('0x28')];}_0xc7e600['status'](_0xd9bcb9)['send'](_0x3c8107);};}exports[_0x7cc0('0x29')]=function(_0x1f1058,_0x28526c){var _0x3df836={},_0x7124e={},_0x5204b3={'count':0x0,'rows':[]};var _0x255981=_[_0x7cc0('0x2a')](db[_0x7cc0('0x2b')][_0x7cc0('0x2c')],function(_0x15f0fe){return{'name':_0x15f0fe[_0x7cc0('0x2d')],'type':_0x15f0fe[_0x7cc0('0x2e')][_0x7cc0('0x2f')]};});_0x7124e['model']=_[_0x7cc0('0x2a')](_0x255981,_0x7cc0('0x28'));_0x7124e[_0x7cc0('0x30')]=_['keys'](_0x1f1058[_0x7cc0('0x30')]);_0x7124e['filters']=_[_0x7cc0('0x31')](_0x7124e[_0x7cc0('0x32')],_0x7124e[_0x7cc0('0x30')]);_0x3df836[_0x7cc0('0x33')]=_[_0x7cc0('0x31')](_0x7124e[_0x7cc0('0x32')],qs['fields'](_0x1f1058[_0x7cc0('0x30')]['fields']));_0x3df836[_0x7cc0('0x33')]=_0x3df836[_0x7cc0('0x33')][_0x7cc0('0x34')]?_0x3df836[_0x7cc0('0x33')]:_0x7124e[_0x7cc0('0x32')];if(!_0x1f1058[_0x7cc0('0x30')][_0x7cc0('0x35')](_0x7cc0('0x36'))){_0x3df836[_0x7cc0('0x1e')]=qs[_0x7cc0('0x1e')](_0x1f1058[_0x7cc0('0x30')][_0x7cc0('0x1e')]);_0x3df836['offset']=qs[_0x7cc0('0x1d')](_0x1f1058[_0x7cc0('0x30')][_0x7cc0('0x1d')]);}_0x3df836[_0x7cc0('0x37')]=qs[_0x7cc0('0x38')](_0x1f1058[_0x7cc0('0x30')][_0x7cc0('0x38')]);_0x3df836['where']=qs[_0x7cc0('0x39')](_[_0x7cc0('0x3a')](_0x1f1058[_0x7cc0('0x30')],_0x7124e[_0x7cc0('0x39')]),_0x255981);if(_0x1f1058[_0x7cc0('0x30')][_0x7cc0('0x3b')]){_0x3df836[_0x7cc0('0x3c')]=_[_0x7cc0('0x3d')](_0x3df836[_0x7cc0('0x3c')],{'$or':_[_0x7cc0('0x2a')](_0x255981,function(_0x4a9225){if(_0x4a9225[_0x7cc0('0x2e')]!=='VIRTUAL'){var _0x648638={};_0x648638[_0x4a9225[_0x7cc0('0x28')]]={'$like':'%'+_0x1f1058[_0x7cc0('0x30')][_0x7cc0('0x3b')]+'%'};return _0x648638;}})});}_0x3df836=_['merge']({},_0x3df836,_0x1f1058['options']);var _0x650ed6={'where':_0x3df836[_0x7cc0('0x3c')]};return db[_0x7cc0('0x2b')][_0x7cc0('0x1c')](_0x650ed6)[_0x7cc0('0x26')](function(_0x129c20){_0x5204b3[_0x7cc0('0x1c')]=_0x129c20;if(_0x1f1058[_0x7cc0('0x30')][_0x7cc0('0x3e')]){_0x3df836['include']=[{'all':!![]}];}return db[_0x7cc0('0x2b')][_0x7cc0('0x3f')](_0x3df836);})[_0x7cc0('0x26')](function(_0x37802c){_0x5204b3['rows']=_0x37802c;return _0x5204b3;})[_0x7cc0('0x26')](respondWithFilteredResult(_0x28526c,_0x3df836))[_0x7cc0('0x40')](handleError(_0x28526c,null));};exports['show']=function(_0x34104f,_0x5a4ab9){var _0x3f0e8e={'raw':!![],'where':{'id':_0x34104f[_0x7cc0('0x41')]['id']}},_0xf9a99={};_0xf9a99[_0x7cc0('0x32')]=_[_0x7cc0('0x42')](db[_0x7cc0('0x2b')][_0x7cc0('0x2c')]);_0xf9a99[_0x7cc0('0x30')]=_[_0x7cc0('0x42')](_0x34104f[_0x7cc0('0x30')]);_0xf9a99[_0x7cc0('0x39')]=_[_0x7cc0('0x31')](_0xf9a99[_0x7cc0('0x32')],_0xf9a99[_0x7cc0('0x30')]);_0x3f0e8e['attributes']=_[_0x7cc0('0x31')](_0xf9a99['model'],qs['fields'](_0x34104f[_0x7cc0('0x30')][_0x7cc0('0x43')]));_0x3f0e8e['attributes']=_0x3f0e8e[_0x7cc0('0x33')][_0x7cc0('0x34')]?_0x3f0e8e[_0x7cc0('0x33')]:_0xf9a99[_0x7cc0('0x32')];if(_0x34104f[_0x7cc0('0x30')][_0x7cc0('0x3e')]){_0x3f0e8e[_0x7cc0('0x44')]=[{'all':!![]}];}_0x3f0e8e=_[_0x7cc0('0x3d')]({},_0x3f0e8e,_0x34104f[_0x7cc0('0x45')]);return db[_0x7cc0('0x2b')][_0x7cc0('0x46')](_0x3f0e8e)[_0x7cc0('0x26')](handleEntityNotFound(_0x5a4ab9,null))['then'](respondWithResult(_0x5a4ab9,null))['catch'](handleError(_0x5a4ab9,null));};exports[_0x7cc0('0x47')]=function(_0x4f8239,_0x194f69){return db[_0x7cc0('0x2b')][_0x7cc0('0x47')](_0x4f8239[_0x7cc0('0x48')],{})[_0x7cc0('0x26')](respondWithResult(_0x194f69,0xc9))[_0x7cc0('0x40')](handleError(_0x194f69,null));};exports[_0x7cc0('0x25')]=function(_0xc75353,_0x5b178f){if(_0xc75353[_0x7cc0('0x48')]['id']){delete _0xc75353[_0x7cc0('0x48')]['id'];}return db[_0x7cc0('0x2b')][_0x7cc0('0x46')]({'where':{'id':_0xc75353[_0x7cc0('0x41')]['id']}})[_0x7cc0('0x26')](handleEntityNotFound(_0x5b178f,null))['then'](saveUpdates(_0xc75353[_0x7cc0('0x48')],null))['then'](respondWithResult(_0x5b178f,null))[_0x7cc0('0x40')](handleError(_0x5b178f,null));};exports[_0x7cc0('0x49')]=function(_0x34aaca,_0x2cae17){return db[_0x7cc0('0x2b')][_0x7cc0('0x46')]({'where':{'id':_0x34aaca['params']['id']}})[_0x7cc0('0x26')](handleEntityNotFound(_0x2cae17,null))[_0x7cc0('0x26')](removeEntity(_0x2cae17,null))[_0x7cc0('0x40')](handleError(_0x2cae17,null));};exports[_0x7cc0('0x4a')]=function(_0x78dfb,_0x38a85d){return db[_0x7cc0('0x2b')][_0x7cc0('0x4a')]()[_0x7cc0('0x26')](respondWithResult(_0x38a85d,null))['catch'](handleError(_0x38a85d,null));};
\ No newline at end of file
+var _0xc8b8=['rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','ChatTransferReport','includeAll','include','findAll','catch','show','params','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map'];(function(_0x2e5401,_0x50ab36){var _0x3d1fd3=function(_0x39ee07){while(--_0x39ee07){_0x2e5401['push'](_0x2e5401['shift']());}};_0x3d1fd3(++_0x50ab36);}(_0xc8b8,0x1d9));var _0x8c8b=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0xc8b8[_0x230e39];return _0xa804e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8c8b('0x0'));var jsonpatch=require(_0x8c8b('0x1'));var rp=require(_0x8c8b('0x2'));var moment=require(_0x8c8b('0x3'));var BPromise=require(_0x8c8b('0x4'));var Mustache=require(_0x8c8b('0x5'));var util=require(_0x8c8b('0x6'));var path=require('path');var sox=require(_0x8c8b('0x7'));var csv=require('to-csv');var ejs=require(_0x8c8b('0x8'));var fs=require('fs');var fs_extra=require(_0x8c8b('0x9'));var _=require(_0x8c8b('0xa'));var squel=require(_0x8c8b('0xb'));var crypto=require(_0x8c8b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8c8b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8c8b('0xe'));var Redis=require(_0x8c8b('0xf'));var authService=require(_0x8c8b('0x10'));var qs=require(_0x8c8b('0x11'));var as=require(_0x8c8b('0x12'));var hardwareService=require(_0x8c8b('0x13'));var logger=require(_0x8c8b('0x14'))('api');var utils=require(_0x8c8b('0x15'));var config=require(_0x8c8b('0x16'));var licenseUtil=require(_0x8c8b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44dacf,_0x4587a8){_0x4587a8=_0x4587a8||0xcc;return function(_0x5b42c0){if(_0x5b42c0){return _0x44dacf[_0x8c8b('0x18')](_0x4587a8);}return _0x44dacf['status'](_0x4587a8)['end']();};}function respondWithResult(_0x5db18d,_0x262ead){_0x262ead=_0x262ead||0xc8;return function(_0x5c04cf){if(_0x5c04cf){return _0x5db18d[_0x8c8b('0x19')](_0x262ead)[_0x8c8b('0x1a')](_0x5c04cf);}};}function respondWithFilteredResult(_0x175664,_0x3ee50c){return function(_0x1afcce){if(_0x1afcce){var _0x20ce8c=typeof _0x3ee50c[_0x8c8b('0x1b')]===_0x8c8b('0x1c')&&typeof _0x3ee50c[_0x8c8b('0x1d')]===_0x8c8b('0x1c');var _0x1fe044=_0x1afcce[_0x8c8b('0x1e')];var _0x35a7e6=_0x20ce8c?0x0:_0x3ee50c[_0x8c8b('0x1b')];var _0x33676a=_0x20ce8c?_0x1afcce['count']:_0x3ee50c['offset']+_0x3ee50c[_0x8c8b('0x1d')];var _0x471fe9;if(_0x33676a>=_0x1fe044){_0x33676a=_0x1fe044;_0x471fe9=0xc8;}else{_0x471fe9=0xce;}_0x175664[_0x8c8b('0x19')](_0x471fe9);return _0x175664[_0x8c8b('0x1f')](_0x8c8b('0x20'),_0x35a7e6+'-'+_0x33676a+'/'+_0x1fe044)[_0x8c8b('0x1a')](_0x1afcce);}return null;};}function patchUpdates(_0x4dfc93){return function(_0x323db8){try{jsonpatch[_0x8c8b('0x21')](_0x323db8,_0x4dfc93,!![]);}catch(_0x14aaf0){return BPromise['reject'](_0x14aaf0);}return _0x323db8[_0x8c8b('0x22')]();};}function saveUpdates(_0x58ba8c,_0x245a49){return function(_0x458165){if(_0x458165){return _0x458165[_0x8c8b('0x23')](_0x58ba8c)[_0x8c8b('0x24')](function(_0x3b09d1){return _0x3b09d1;});}return null;};}function removeEntity(_0x568ec1,_0x238f10){return function(_0x2e97a5){if(_0x2e97a5){return _0x2e97a5[_0x8c8b('0x25')]()[_0x8c8b('0x24')](function(){_0x568ec1[_0x8c8b('0x19')](0xcc)[_0x8c8b('0x26')]();});}};}function handleEntityNotFound(_0x197a21,_0x2c8c31){return function(_0x5ce60c){if(!_0x5ce60c){_0x197a21[_0x8c8b('0x18')](0x194);}return _0x5ce60c;};}function handleError(_0x5ab625,_0x2c91b2){_0x2c91b2=_0x2c91b2||0x1f4;return function(_0x5d949f){logger[_0x8c8b('0x27')](_0x5d949f[_0x8c8b('0x28')]);if(_0x5d949f[_0x8c8b('0x29')]){delete _0x5d949f[_0x8c8b('0x29')];}_0x5ab625['status'](_0x2c91b2)[_0x8c8b('0x2a')](_0x5d949f);};}exports[_0x8c8b('0x2b')]=function(_0x10c87c,_0x240754){var _0x1cab9c={},_0x57a545={},_0x2249b8={'count':0x0,'rows':[]};var _0xc931ae=_[_0x8c8b('0x2c')](db['ChatTransferReport'][_0x8c8b('0x2d')],function(_0x47d5c5){return{'name':_0x47d5c5['fieldName'],'type':_0x47d5c5['type'][_0x8c8b('0x2e')]};});_0x57a545[_0x8c8b('0x2f')]=_[_0x8c8b('0x2c')](_0xc931ae,'name');_0x57a545[_0x8c8b('0x30')]=_[_0x8c8b('0x31')](_0x10c87c[_0x8c8b('0x30')]);_0x57a545[_0x8c8b('0x32')]=_[_0x8c8b('0x33')](_0x57a545[_0x8c8b('0x2f')],_0x57a545['query']);_0x1cab9c[_0x8c8b('0x34')]=_[_0x8c8b('0x33')](_0x57a545[_0x8c8b('0x2f')],qs[_0x8c8b('0x35')](_0x10c87c[_0x8c8b('0x30')][_0x8c8b('0x35')]));_0x1cab9c['attributes']=_0x1cab9c[_0x8c8b('0x34')][_0x8c8b('0x36')]?_0x1cab9c[_0x8c8b('0x34')]:_0x57a545[_0x8c8b('0x2f')];if(!_0x10c87c['query'][_0x8c8b('0x37')](_0x8c8b('0x38'))){_0x1cab9c[_0x8c8b('0x1d')]=qs['limit'](_0x10c87c['query'][_0x8c8b('0x1d')]);_0x1cab9c[_0x8c8b('0x1b')]=qs['offset'](_0x10c87c[_0x8c8b('0x30')][_0x8c8b('0x1b')]);}_0x1cab9c[_0x8c8b('0x39')]=qs['sort'](_0x10c87c['query'][_0x8c8b('0x3a')]);_0x1cab9c[_0x8c8b('0x3b')]=qs[_0x8c8b('0x32')](_['pick'](_0x10c87c['query'],_0x57a545[_0x8c8b('0x32')]),_0xc931ae);if(_0x10c87c[_0x8c8b('0x30')]['filter']){_0x1cab9c[_0x8c8b('0x3b')]=_['merge'](_0x1cab9c[_0x8c8b('0x3b')],{'$or':_['map'](_0xc931ae,function(_0x42e569){if(_0x42e569['type']!==_0x8c8b('0x3c')){var _0x96b4f8={};_0x96b4f8[_0x42e569[_0x8c8b('0x29')]]={'$like':'%'+_0x10c87c['query'][_0x8c8b('0x3d')]+'%'};return _0x96b4f8;}})});}_0x1cab9c=_['merge']({},_0x1cab9c,_0x10c87c['options']);var _0x1ce5e3={'where':_0x1cab9c['where']};return db[_0x8c8b('0x3e')][_0x8c8b('0x1e')](_0x1ce5e3)[_0x8c8b('0x24')](function(_0xda0668){_0x2249b8[_0x8c8b('0x1e')]=_0xda0668;if(_0x10c87c[_0x8c8b('0x30')][_0x8c8b('0x3f')]){_0x1cab9c[_0x8c8b('0x40')]=[{'all':!![]}];}return db[_0x8c8b('0x3e')][_0x8c8b('0x41')](_0x1cab9c);})[_0x8c8b('0x24')](function(_0x23398c){_0x2249b8['rows']=_0x23398c;return _0x2249b8;})[_0x8c8b('0x24')](respondWithFilteredResult(_0x240754,_0x1cab9c))[_0x8c8b('0x42')](handleError(_0x240754,null));};exports[_0x8c8b('0x43')]=function(_0xf44a4d,_0x48d901){var _0xf8c973={'raw':!![],'where':{'id':_0xf44a4d[_0x8c8b('0x44')]['id']}},_0x2c66ab={};_0x2c66ab[_0x8c8b('0x2f')]=_[_0x8c8b('0x31')](db[_0x8c8b('0x3e')]['rawAttributes']);_0x2c66ab[_0x8c8b('0x30')]=_[_0x8c8b('0x31')](_0xf44a4d[_0x8c8b('0x30')]);_0x2c66ab[_0x8c8b('0x32')]=_[_0x8c8b('0x33')](_0x2c66ab[_0x8c8b('0x2f')],_0x2c66ab[_0x8c8b('0x30')]);_0xf8c973[_0x8c8b('0x34')]=_['intersection'](_0x2c66ab[_0x8c8b('0x2f')],qs[_0x8c8b('0x35')](_0xf44a4d[_0x8c8b('0x30')][_0x8c8b('0x35')]));_0xf8c973['attributes']=_0xf8c973[_0x8c8b('0x34')][_0x8c8b('0x36')]?_0xf8c973['attributes']:_0x2c66ab[_0x8c8b('0x2f')];if(_0xf44a4d['query'][_0x8c8b('0x3f')]){_0xf8c973['include']=[{'all':!![]}];}_0xf8c973=_['merge']({},_0xf8c973,_0xf44a4d[_0x8c8b('0x45')]);return db['ChatTransferReport'][_0x8c8b('0x46')](_0xf8c973)[_0x8c8b('0x24')](handleEntityNotFound(_0x48d901,null))['then'](respondWithResult(_0x48d901,null))[_0x8c8b('0x42')](handleError(_0x48d901,null));};exports['create']=function(_0x59f3bb,_0x55c083){return db['ChatTransferReport'][_0x8c8b('0x47')](_0x59f3bb['body'],{})[_0x8c8b('0x24')](respondWithResult(_0x55c083,0xc9))['catch'](handleError(_0x55c083,null));};exports[_0x8c8b('0x23')]=function(_0x4349d7,_0x5364cb){if(_0x4349d7['body']['id']){delete _0x4349d7[_0x8c8b('0x48')]['id'];}return db[_0x8c8b('0x3e')][_0x8c8b('0x46')]({'where':{'id':_0x4349d7[_0x8c8b('0x44')]['id']}})['then'](handleEntityNotFound(_0x5364cb,null))[_0x8c8b('0x24')](saveUpdates(_0x4349d7['body'],null))['then'](respondWithResult(_0x5364cb,null))[_0x8c8b('0x42')](handleError(_0x5364cb,null));};exports[_0x8c8b('0x25')]=function(_0x5594a7,_0x4f7ea1){return db[_0x8c8b('0x3e')][_0x8c8b('0x46')]({'where':{'id':_0x5594a7[_0x8c8b('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f7ea1,null))[_0x8c8b('0x24')](removeEntity(_0x4f7ea1,null))[_0x8c8b('0x42')](handleError(_0x4f7ea1,null));};exports[_0x8c8b('0x49')]=function(_0x696fd7,_0x20113e){return db[_0x8c8b('0x3e')][_0x8c8b('0x49')]()['then'](respondWithResult(_0x20113e,null))[_0x8c8b('0x42')](handleError(_0x20113e,null));};
\ No newline at end of file
index 951380f..2666bf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3541=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','lodash','moment','bluebird','request-promise','path'];(function(_0x19601e,_0x56bd5f){var _0x101f34=function(_0x37f781){while(--_0x37f781){_0x19601e['push'](_0x19601e['shift']());}};_0x101f34(++_0x56bd5f);}(_0x3541,0x1df));var _0x1354=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3541[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x1354('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1354('0x1'));var BPromise=require(_0x1354('0x2'));var rp=require(_0x1354('0x3'));var fs=require('fs');var path=require(_0x1354('0x4'));var rimraf=require('rimraf');var config=require(_0x1354('0x5'));var attributes=require(_0x1354('0x6'));module[_0x1354('0x7')]=function(_0x44c8cb,_0x4076f3){return _0x44c8cb[_0x1354('0x8')](_0x1354('0x9'),attributes,{'tableName':_0x1354('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x67cd=['api','moment','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x67cd,0x1ba));var _0xd67c=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0x67cd[_0x1655bb];return _0x5e2020;};'use strict';var _=require(_0xd67c('0x0'));var util=require('util');var logger=require(_0xd67c('0x1'))(_0xd67c('0x2'));var moment=require(_0xd67c('0x3'));var BPromise=require(_0xd67c('0x4'));var rp=require(_0xd67c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd67c('0x6'));var attributes=require(_0xd67c('0x7'));module[_0xd67c('0x8')]=function(_0x444411,_0x45d0a8){return _0x444411['define'](_0xd67c('0x9'),attributes,{'tableName':_0xd67c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd67c('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 0ae9a5d..6c28bd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a7e=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','catch','lodash','util'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x6a7e,0xcf));var _0xe6a7=function(_0x1cae98,_0x31e958){_0x1cae98=_0x1cae98-0x0;var _0x512b9b=_0x6a7e[_0x1cae98];return _0x512b9b;};'use strict';var _=require(_0xe6a7('0x0'));var util=require(_0xe6a7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe6a7('0x2'));var fs=require('fs');var Redis=require(_0xe6a7('0x3'));var db=require(_0xe6a7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6a7('0x5'))(_0xe6a7('0x6'));var config=require(_0xe6a7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe6a7('0x8')][_0xe6a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ba4f3,_0x443453,_0x2c47e6){return new BPromise(function(_0x5f59c5,_0xa14ef){return client['request'](_0x5ba4f3,_0x2c47e6)[_0xe6a7('0xa')](function(_0x224cfa){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x443453,'request\x20sent');logger['debug'](_0xe6a7('0xb'),_0x443453,_0xe6a7('0xc'),JSON['stringify'](_0x224cfa));if(_0x224cfa[_0xe6a7('0xd')]){if(_0x224cfa[_0xe6a7('0xd')][_0xe6a7('0xe')]===0x1f4){logger[_0xe6a7('0xd')](_0xe6a7('0xf'),_0x443453,_0x224cfa[_0xe6a7('0xd')][_0xe6a7('0x10')]);return _0xa14ef(_0x224cfa[_0xe6a7('0xd')]['message']);}logger['error'](_0xe6a7('0xf'),_0x443453,_0x224cfa[_0xe6a7('0xd')][_0xe6a7('0x10')]);return _0x5f59c5(_0x224cfa[_0xe6a7('0xd')][_0xe6a7('0x10')]);}else{logger[_0xe6a7('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x443453,'request\x20sent');_0x5f59c5(_0x224cfa['result'][_0xe6a7('0x10')]);}})[_0xe6a7('0x12')](function(_0x4995f3){logger[_0xe6a7('0xd')](_0xe6a7('0xf'),_0x443453,_0x4995f3);_0xa14ef(_0x4995f3);});});}
\ No newline at end of file
+var _0xac0d=['../../config/environment','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc'];(function(_0x3300ee,_0xed60a9){var _0x714154=function(_0x1229c1){while(--_0x1229c1){_0x3300ee['push'](_0x3300ee['shift']());}};_0x714154(++_0xed60a9);}(_0xac0d,0x13a));var _0xdac0=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xac0d[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0xdac0('0x0'));var util=require(_0xdac0('0x1'));var moment=require('moment');var BPromise=require(_0xdac0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdac0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdac0('0x4'));var logger=require('../../config/logger')(_0xdac0('0x5'));var config=require(_0xdac0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdac0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27048d,_0x58acb9,_0x5e67eb){return new BPromise(function(_0xf30c0e,_0x579ae8){return client[_0xdac0('0x8')](_0x27048d,_0x5e67eb)[_0xdac0('0x9')](function(_0x392f29){logger[_0xdac0('0xa')](_0xdac0('0xb'),_0x58acb9,_0xdac0('0xc'));logger[_0xdac0('0xd')](_0xdac0('0xe'),_0x58acb9,_0xdac0('0xc'),JSON['stringify'](_0x392f29));if(_0x392f29[_0xdac0('0xf')]){if(_0x392f29[_0xdac0('0xf')][_0xdac0('0x10')]===0x1f4){logger[_0xdac0('0xf')](_0xdac0('0xb'),_0x58acb9,_0x392f29[_0xdac0('0xf')][_0xdac0('0x11')]);return _0x579ae8(_0x392f29[_0xdac0('0xf')][_0xdac0('0x11')]);}logger[_0xdac0('0xf')](_0xdac0('0xb'),_0x58acb9,_0x392f29[_0xdac0('0xf')]['message']);return _0xf30c0e(_0x392f29[_0xdac0('0xf')][_0xdac0('0x11')]);}else{logger[_0xdac0('0xa')](_0xdac0('0xb'),_0x58acb9,_0xdac0('0xc'));_0xf30c0e(_0x392f29[_0xdac0('0x12')][_0xdac0('0x11')]);}})[_0xdac0('0x13')](function(_0x10b378){logger[_0xdac0('0xf')](_0xdac0('0xb'),_0x58acb9,_0x10b378);_0x579ae8(_0x10b378);});});}
\ No newline at end of file
index def5976..f4c9581 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb135=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','put','update','delete','/:id','destroy','exports'];(function(_0x4c4abf,_0x3bc34c){var _0x14ba18=function(_0x9492a1){while(--_0x9492a1){_0x4c4abf['push'](_0x4c4abf['shift']());}};_0x14ba18(++_0x3bc34c);}(_0xb135,0x1b5));var _0x5b13=function(_0x4e4ad1,_0x8afa57){_0x4e4ad1=_0x4e4ad1-0x0;var _0x15298b=_0xb135[_0x4e4ad1];return _0x15298b;};'use strict';var multer=require(_0x5b13('0x0'));var util=require(_0x5b13('0x1'));var path=require(_0x5b13('0x2'));var timeout=require(_0x5b13('0x3'));var express=require(_0x5b13('0x4'));var router=express[_0x5b13('0x5')]();var fs_extra=require(_0x5b13('0x6'));var auth=require(_0x5b13('0x7'));var interaction=require(_0x5b13('0x8'));var config=require(_0x5b13('0x9'));var controller=require(_0x5b13('0xa'));router[_0x5b13('0xb')]('/',auth[_0x5b13('0xc')](),controller['index']);router[_0x5b13('0xb')](_0x5b13('0xd'),auth[_0x5b13('0xc')](),controller[_0x5b13('0xe')]);router[_0x5b13('0xb')]('/:id',auth[_0x5b13('0xc')](),controller[_0x5b13('0xf')]);router[_0x5b13('0x10')]('/',auth[_0x5b13('0xc')](),controller['create']);router[_0x5b13('0x11')]('/:id',auth[_0x5b13('0xc')](),controller[_0x5b13('0x12')]);router[_0x5b13('0x13')](_0x5b13('0x14'),auth['isAuthenticated'](),controller[_0x5b13('0x15')]);module[_0x5b13('0x16')]=router;
\ No newline at end of file
+var _0x1d5d=['connect-timeout','Router','fs-extra','../../components/auth/service','./chatTransferReport.controller','get','isAuthenticated','describe','/:id','post','put','update','destroy','exports','multer','util'];(function(_0x1845b5,_0x4c9e3f){var _0x573bd9=function(_0x3a0636){while(--_0x3a0636){_0x1845b5['push'](_0x1845b5['shift']());}};_0x573bd9(++_0x4c9e3f);}(_0x1d5d,0x7e));var _0xd1d5=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x1d5d[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0xd1d5('0x0'));var util=require(_0xd1d5('0x1'));var path=require('path');var timeout=require(_0xd1d5('0x2'));var express=require('express');var router=express[_0xd1d5('0x3')]();var fs_extra=require(_0xd1d5('0x4'));var auth=require(_0xd1d5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd1d5('0x6'));router[_0xd1d5('0x7')]('/',auth[_0xd1d5('0x8')](),controller['index']);router['get']('/describe',auth[_0xd1d5('0x8')](),controller[_0xd1d5('0x9')]);router[_0xd1d5('0x7')](_0xd1d5('0xa'),auth[_0xd1d5('0x8')](),controller['show']);router[_0xd1d5('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd1d5('0xc')](_0xd1d5('0xa'),auth['isAuthenticated'](),controller[_0xd1d5('0xd')]);router['delete'](_0xd1d5('0xa'),auth[_0xd1d5('0x8')](),controller[_0xd1d5('0xe')]);module[_0xd1d5('0xf')]=router;
\ No newline at end of file
index 7ced29d..c0ae066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e55=['parse','setDataValue','TEXT','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','Chat','Send','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Skip','Feedback','thumb','star','INTEGER','input','name','text','getDataValue','onlineForm'];(function(_0x20cf22,_0x9e9493){var _0x364dff=function(_0x578eb3){while(--_0x578eb3){_0x20cf22['push'](_0x20cf22['shift']());}};_0x364dff(++_0x9e9493);}(_0x8e55,0x18e));var _0x58e5=function(_0x3ee1fe,_0x59f2a1){_0x3ee1fe=_0x3ee1fe-0x0;var _0x1ae57a=_0x8e55[_0x3ee1fe];return _0x1ae57a;};'use strict';var Sequelize=require(_0x58e5('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x58e5('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x58e5('0x1')],'allowNull':![],'unique':_0x58e5('0x2')},'description':{'type':Sequelize[_0x58e5('0x1')]},'mapKey':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x58e5('0x3')},'key':{'type':Sequelize[_0x58e5('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x58e5('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x58e5('0x1')],'allowNull':![],'defaultValue':_0x58e5('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x58e5('0x1')],'allowNull':![],'defaultValue':_0x58e5('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x58e5('0x1')]},'animation':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x58e5('0x7')]('rounded',_0x58e5('0x8')),'defaultValue':_0x58e5('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0xa')},'offline_chat_button':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0xb')},'header_offline':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0xc')},'formSubmitSuccessMessage':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0xd')},'noteTitle':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0xe')},'placeholderMessage':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x58e5('0xf')},'conditionAgreement':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0x10')},'ratingType':{'type':Sequelize[_0x58e5('0x7')]('star',_0x58e5('0x11')),'defaultValue':_0x58e5('0x12')},'ratingStarsNumber':{'type':Sequelize[_0x58e5('0x13')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x58e5('0x14'),'variable':null,'config':{'placeholder':_0x58e5('0x15'),'type':_0x58e5('0x16'),'required':!![]},'props':{'title':_0x58e5('0x15'),'helpText':''}},{'type':_0x58e5('0x14'),'props':{'title':_0x58e5('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x58e5('0x3'),'type':_0x58e5('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x58e5('0x17')](_0x58e5('0x18'))?JSON[_0x58e5('0x19')](this[_0x58e5('0x17')](_0x58e5('0x18'))):{};},'set':function(_0x221ca2){return this[_0x58e5('0x1a')](_0x58e5('0x18'),JSON['stringify'](_0x221ca2));}},'offlineForm':{'type':Sequelize[_0x58e5('0x1b')],'defaultValue':function(){return JSON[_0x58e5('0x1c')]({'items':[{'type':'input','props':{'title':_0x58e5('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x58e5('0x3'),'type':_0x58e5('0x3')},'variable':null},{'type':_0x58e5('0x1d'),'config':{'placeholder':_0x58e5('0x1e')},'props':{'title':_0x58e5('0x1e'),'helpText':_0x58e5('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x58e5('0x17')](_0x58e5('0x20'))?JSON[_0x58e5('0x19')](this[_0x58e5('0x17')](_0x58e5('0x20'))):{};},'set':function(_0x1ef5bb){return this[_0x58e5('0x1a')]('offlineForm',JSON['stringify'](_0x1ef5bb));}},'token':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':function(){return rs[_0x58e5('0x21')]();}},'autoclose':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x58e5('0x1')]},'waitingTitle':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0x22')},'offlineMessageBody':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0x23')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x58e5('0xf')},'sendUnmanaged':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x58e5('0x1')]},'notificationTemplate':{'type':Sequelize[_0x58e5('0x1b')],'defaultValue':function(){return _0x58e5('0x24');}},'notificationSound':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0x58e5('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x58e5('0x26')},'verticalAlignment':{'type':Sequelize[_0x58e5('0x13')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':_0x58e5('0x27')},'defaultTitle':{'type':Sequelize[_0x58e5('0x1')]},'customerAvatar':{'type':Sequelize[_0x58e5('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x58e5('0x13')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x58e5('0x1')],'allowNull':![],'defaultValue':_0x58e5('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x58e5('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x58e5('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x58e5('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x58e5('0x13')],'comment':_0x58e5('0x2a')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x775983){if(!_0x775983)this[_0x58e5('0x1a')](_0x58e5('0x2b'),null);this['setDataValue'](_0x58e5('0x2c'),_0x775983);}},'vidaooEscalation':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x58e5('0x1')]},'vidaooTopic':{'type':Sequelize[_0x58e5('0x1')],'allowNull':![],'defaultValue':_0x58e5('0x2d')},'vidaooNote':{'type':Sequelize[_0x58e5('0x1')],'defaultValue':function(){return _0x58e5('0x2e');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x58e5('0x6')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x980b=['#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','TEXT','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','alternate'];(function(_0x2faeda,_0x17627e){var _0x127282=function(_0x582992){while(--_0x582992){_0x2faeda['push'](_0x2faeda['shift']());}};_0x127282(++_0x17627e);}(_0x980b,0xf0));var _0xb980=function(_0x20e3f4,_0x3ec8ca){_0x20e3f4=_0x20e3f4-0x0;var _0x57f724=_0x980b[_0x20e3f4];return _0x57f724;};'use strict';var Sequelize=require(_0xb980('0x0'));var rs=require(_0xb980('0x1'));module['exports']={'name':{'type':Sequelize[_0xb980('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xb980('0x2')]},'mapKey':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0xb980('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0x4')},'customerAlias':{'type':Sequelize[_0xb980('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb980('0x2')],'allowNull':![],'defaultValue':_0xb980('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb980('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb980('0x2')],'allowNull':![],'defaultValue':_0xb980('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb980('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xb980('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb980('0x9')](_0xb980('0xa'),_0xb980('0xb')),'defaultValue':_0xb980('0xa')},'header_online':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0xc')},'start_chat_button':{'type':Sequelize[_0xb980('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xb980('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xb980('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xb980('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xb980('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0xd')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb980('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb980('0xe')},'noteTitle':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb980('0x10')},'closingMessage':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0x11')},'closingMessageButton':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0x12')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb980('0x13')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0x14')},'ratingType':{'type':Sequelize[_0xb980('0x9')](_0xb980('0x15'),_0xb980('0x16')),'defaultValue':_0xb980('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xb980('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb980('0x17')],'defaultValue':function(){return JSON[_0xb980('0x18')]({'items':[{'type':_0xb980('0x19'),'variable':null,'config':{'placeholder':_0xb980('0x1a'),'type':_0xb980('0x1b'),'required':!![]},'props':{'title':_0xb980('0x1a'),'helpText':''}},{'type':_0xb980('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb980('0x1c')](_0xb980('0x1d'))?JSON[_0xb980('0x1e')](this[_0xb980('0x1c')](_0xb980('0x1d'))):{};},'set':function(_0x380ef8){return this[_0xb980('0x1f')]('onlineForm',JSON[_0xb980('0x18')](_0x380ef8));}},'offlineForm':{'type':Sequelize[_0xb980('0x17')],'defaultValue':function(){return JSON[_0xb980('0x18')]({'items':[{'type':_0xb980('0x19'),'props':{'title':_0xb980('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb980('0x3'),'type':'email'},'variable':null},{'type':_0xb980('0x20'),'config':{'placeholder':_0xb980('0x21')},'props':{'title':_0xb980('0x21'),'helpText':_0xb980('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xb980('0x1c')]('offlineForm')?JSON['parse'](this[_0xb980('0x1c')](_0xb980('0x23'))):{};},'set':function(_0x9b100f){return this[_0xb980('0x1f')](_0xb980('0x23'),JSON['stringify'](_0x9b100f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb980('0x24')]();}},'autoclose':{'type':Sequelize[_0xb980('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb980('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xb980('0x26')},'offlineMessageBody':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xb980('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb980('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0x13')},'sendUnmanaged':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0x12')},'enableCustomerAttachment':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb980('0x17')]},'showAgentAvatar':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb980('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb980('0x17')],'defaultValue':function(){return _0xb980('0x28');}},'notificationSound':{'type':Sequelize[_0xb980('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xb980('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb980('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xb980('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb980('0x2')],'defaultValue':_0xb980('0x29')},'defaultTitle':{'type':Sequelize[_0xb980('0x2')]},'customerAvatar':{'type':Sequelize[_0xb980('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb980('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xb980('0x2')],'allowNull':![],'defaultValue':_0xb980('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb980('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb980('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xb980('0x2b')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb980('0x7')],'comment':_0xb980('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x46f9d7){if(!_0x46f9d7)this[_0xb980('0x1f')]('mandatoryDispositionPauseId',null);this[_0xb980('0x1f')](_0xb980('0x2d'),_0x46f9d7);}},'vidaooEscalation':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb980('0x2')]},'vidaooTopic':{'type':Sequelize[_0xb980('0x2')],'allowNull':![],'defaultValue':_0xb980('0x2e')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb980('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb980('0x17')]}};
\ No newline at end of file
index c58d7a5..6b5886d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb440=['query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','ChatWebsiteId','Disposition','getDispositions','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','setUA','headers','user-agent','chat','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','account','applications','Applications','list','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','originalname','subjectOffline','email','MailAccount','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','omit','getInteractions','Owner','internal','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','true','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','x-real-ip','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatWebsite.socket','register','jayson/promise','client','http','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','ChatWebsites','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','key'];(function(_0x2c463e,_0x184238){var _0xac231d=function(_0x9ada5a){while(--_0x9ada5a){_0x2c463e['push'](_0x2c463e['shift']());}};_0xac231d(++_0x184238);}(_0xb440,0xe9));var _0x0b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb440[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0b44('0x0'));var rimraf=require(_0x0b44('0x1'));var zipdir=require(_0x0b44('0x2'));var jsonpatch=require(_0x0b44('0x3'));var rp=require(_0x0b44('0x4'));var moment=require('moment');var BPromise=require(_0x0b44('0x5'));var Mustache=require(_0x0b44('0x6'));var util=require(_0x0b44('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0b44('0x8'));var ejs=require(_0x0b44('0x9'));var fs=require('fs');var fs_extra=require(_0x0b44('0xa'));var _=require(_0x0b44('0xb'));var squel=require(_0x0b44('0xc'));var crypto=require(_0x0b44('0xd'));var jsforce=require(_0x0b44('0xe'));var deskjs=require(_0x0b44('0xf'));var toCsv=require(_0x0b44('0x8'));var querystring=require(_0x0b44('0x10'));var Papa=require(_0x0b44('0x11'));var Redis=require('ioredis');var authService=require(_0x0b44('0x12'));var qs=require(_0x0b44('0x13'));var as=require(_0x0b44('0x14'));var hardwareService=require(_0x0b44('0x15'));var logger=require(_0x0b44('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x0b44('0x17'));var licenseUtil=require(_0x0b44('0x18'));var db=require(_0x0b44('0x19'))['db'];config[_0x0b44('0x1a')]=_[_0x0b44('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b44('0x1a')]));require(_0x0b44('0x1c'))[_0x0b44('0x1d')](socket);var jayson=require(_0x0b44('0x1e'));var client=jayson[_0x0b44('0x1f')][_0x0b44('0x20')]({'port':0x232c});var client9002=jayson[_0x0b44('0x1f')][_0x0b44('0x20')]({'port':0x232a});var client9003=jayson[_0x0b44('0x1f')]['http']({'port':0x232b});var client9001=jayson[_0x0b44('0x1f')][_0x0b44('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x1b0090,_0x1d9f0f,_0x18aada,_0x1cfc01){return new BPromise(function(_0x30acf7,_0x2aa682){var _0x50c89d=_0x1cfc01||client;return _0x50c89d[_0x0b44('0x21')](_0x1b0090,_0x18aada)['then'](function(_0x588ffd){logger['info'](_0x0b44('0x22'),_0x1d9f0f,_0x0b44('0x23'));logger[_0x0b44('0x24')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1d9f0f,_0x0b44('0x23'),JSON[_0x0b44('0x25')](_0x588ffd));if(_0x588ffd[_0x0b44('0x26')]){if(_0x588ffd[_0x0b44('0x26')][_0x0b44('0x27')]===0x1f4){logger[_0x0b44('0x26')](_0x0b44('0x22'),_0x1d9f0f,_0x588ffd[_0x0b44('0x26')][_0x0b44('0x28')]);return _0x2aa682(_0x588ffd[_0x0b44('0x26')][_0x0b44('0x28')]);}logger[_0x0b44('0x26')](_0x0b44('0x22'),_0x1d9f0f,_0x588ffd[_0x0b44('0x26')]['message']);return _0x30acf7(_0x588ffd['error'][_0x0b44('0x28')]);}else{logger[_0x0b44('0x29')](_0x0b44('0x22'),_0x1d9f0f,_0x0b44('0x23'));_0x30acf7(_0x588ffd[_0x0b44('0x2a')][_0x0b44('0x28')]);}})[_0x0b44('0x2b')](function(_0x151c14){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1d9f0f,_0x151c14);_0x2aa682(_0x151c14);});});}function respondWithStatusCode(_0x1956e1,_0x1af1a5){_0x1af1a5=_0x1af1a5||0xcc;return function(_0x455811){if(_0x455811){return _0x1956e1['sendStatus'](_0x1af1a5);}return _0x1956e1[_0x0b44('0x2c')](_0x1af1a5)[_0x0b44('0x2d')]();};}function respondWithResult(_0x1efbe5,_0x34dfec){_0x34dfec=_0x34dfec||0xc8;return function(_0x422c84){if(_0x422c84){return _0x1efbe5[_0x0b44('0x2c')](_0x34dfec)[_0x0b44('0x2e')](_0x422c84);}};}function respondWithFilteredResult(_0x2b0455,_0x785fa6){return function(_0x551dbe){if(_0x551dbe){var _0xcae58b=typeof _0x785fa6[_0x0b44('0x2f')]===_0x0b44('0x30')&&typeof _0x785fa6[_0x0b44('0x31')]==='undefined';var _0x20ebf8=_0x551dbe[_0x0b44('0x32')];var _0x425890=_0xcae58b?0x0:_0x785fa6[_0x0b44('0x2f')];var _0x2a8b47=_0xcae58b?_0x551dbe[_0x0b44('0x32')]:_0x785fa6[_0x0b44('0x2f')]+_0x785fa6[_0x0b44('0x31')];var _0x5a32bf;if(_0x2a8b47>=_0x20ebf8){_0x2a8b47=_0x20ebf8;_0x5a32bf=0xc8;}else{_0x5a32bf=0xce;}_0x2b0455[_0x0b44('0x2c')](_0x5a32bf);return _0x2b0455[_0x0b44('0x33')](_0x0b44('0x34'),_0x425890+'-'+_0x2a8b47+'/'+_0x20ebf8)[_0x0b44('0x2e')](_0x551dbe);}return null;};}function patchUpdates(_0x24155b){return function(_0x28d04b){try{jsonpatch[_0x0b44('0x35')](_0x28d04b,_0x24155b,!![]);}catch(_0x2b61b5){return BPromise['reject'](_0x2b61b5);}return _0x28d04b['save']();};}function saveUpdates(_0x43986b,_0x3a3a60){return function(_0x16928f){if(_0x16928f){return _0x16928f[_0x0b44('0x36')](_0x43986b)[_0x0b44('0x37')](function(_0x469cf3){return _0x469cf3;});}return null;};}function removeEntity(_0x3f83ec,_0x21d1ac){return function(_0x5cbe3a){if(_0x5cbe3a){return _0x5cbe3a[_0x0b44('0x38')]()[_0x0b44('0x37')](function(){var _0x4f563a=_0x5cbe3a[_0x0b44('0x39')]({'plain':!![]});var _0x320fe5=_0x0b44('0x3a');return db['UserProfileResource'][_0x0b44('0x38')]({'where':{'type':_0x320fe5,'resourceId':_0x4f563a['id']}})[_0x0b44('0x37')](function(){return _0x5cbe3a;});})[_0x0b44('0x37')](function(){_0x3f83ec[_0x0b44('0x2c')](0xcc)[_0x0b44('0x2d')]();});}};}function handleEntityNotFound(_0x159b93,_0x529e22){return function(_0x1fb487){if(!_0x1fb487){_0x159b93['sendStatus'](0x194);}return _0x1fb487;};}function handleError(_0x159f8d,_0x2bb8a1){_0x2bb8a1=_0x2bb8a1||0x1f4;return function(_0x4a3b8d){logger[_0x0b44('0x26')](_0x4a3b8d['stack']);if(_0x4a3b8d[_0x0b44('0x3b')]){delete _0x4a3b8d[_0x0b44('0x3b')];}_0x159f8d[_0x0b44('0x2c')](_0x2bb8a1)[_0x0b44('0x3c')](_0x4a3b8d);};}exports[_0x0b44('0x3d')]=function(_0x3349fe,_0x489a4a){var _0x23e1ab={'include':[{'model':db[_0x0b44('0x3e')],'as':_0x0b44('0x3f')}]},_0x33bf12={},_0x330a41={'count':0x0,'rows':[]};var _0x145871=_[_0x0b44('0x40')](db[_0x0b44('0x41')][_0x0b44('0x42')],function(_0x3d7a1e){return{'name':_0x3d7a1e['fieldName'],'type':_0x3d7a1e['type'][_0x0b44('0x43')]};});_0x33bf12['model']=_[_0x0b44('0x40')](_0x145871,_0x0b44('0x3b'));_0x33bf12[_0x0b44('0x44')]=_['keys'](_0x3349fe[_0x0b44('0x44')]);_0x33bf12[_0x0b44('0x45')]=_[_0x0b44('0x46')](_0x33bf12[_0x0b44('0x47')],_0x33bf12[_0x0b44('0x44')]);_0x23e1ab[_0x0b44('0x48')]=_[_0x0b44('0x46')](_0x33bf12['model'],qs[_0x0b44('0x49')](_0x3349fe[_0x0b44('0x44')]['fields']));_0x23e1ab[_0x0b44('0x48')]=_0x23e1ab[_0x0b44('0x48')][_0x0b44('0x4a')]?_0x23e1ab['attributes']:_0x33bf12[_0x0b44('0x47')];if(!_0x3349fe[_0x0b44('0x44')][_0x0b44('0x4b')](_0x0b44('0x4c'))){_0x23e1ab[_0x0b44('0x31')]=qs[_0x0b44('0x31')](_0x3349fe[_0x0b44('0x44')][_0x0b44('0x31')]);_0x23e1ab[_0x0b44('0x2f')]=qs['offset'](_0x3349fe['query'][_0x0b44('0x2f')]);}_0x23e1ab['order']=qs[_0x0b44('0x4d')](_0x3349fe[_0x0b44('0x44')]['sort']);_0x23e1ab['where']=qs[_0x0b44('0x45')](_[_0x0b44('0x4e')](_0x3349fe[_0x0b44('0x44')],_0x33bf12[_0x0b44('0x45')]),_0x145871);if(_0x3349fe[_0x0b44('0x44')][_0x0b44('0x4f')]){_0x23e1ab['where']=_['merge'](_0x23e1ab[_0x0b44('0x50')],{'$or':_['map'](_0x145871,function(_0x1b664f){if(_0x1b664f['type']!==_0x0b44('0x51')){var _0x12e5ea={};_0x12e5ea[_0x1b664f['name']]={'$like':'%'+_0x3349fe[_0x0b44('0x44')][_0x0b44('0x4f')]+'%'};return _0x12e5ea;}})});}_0x23e1ab=_[_0x0b44('0x52')]({},_0x23e1ab,_0x3349fe[_0x0b44('0x53')]);var _0x2a272f={'where':_0x23e1ab[_0x0b44('0x50')]};return db[_0x0b44('0x41')][_0x0b44('0x32')](_0x2a272f)[_0x0b44('0x37')](function(_0x35f75f){_0x330a41[_0x0b44('0x32')]=_0x35f75f;if(_0x3349fe['query'][_0x0b44('0x54')]){_0x23e1ab[_0x0b44('0x55')]=[{'all':!![]}];}return db[_0x0b44('0x41')][_0x0b44('0x56')](_0x23e1ab);})[_0x0b44('0x37')](function(_0x36d47d){_0x330a41[_0x0b44('0x57')]=_0x36d47d;return _0x330a41;})[_0x0b44('0x37')](respondWithFilteredResult(_0x489a4a,_0x23e1ab))[_0x0b44('0x2b')](handleError(_0x489a4a,null));};exports['show']=function(_0x9f8f2b,_0x357138){var _0x37f7c3={'raw':![],'where':{'id':_0x9f8f2b[_0x0b44('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x0b44('0x3f')}]},_0xfd3686={};_0xfd3686[_0x0b44('0x47')]=_[_0x0b44('0x59')](db['ChatWebsite'][_0x0b44('0x42')]);_0xfd3686[_0x0b44('0x44')]=_['keys'](_0x9f8f2b['query']);_0xfd3686[_0x0b44('0x45')]=_[_0x0b44('0x46')](_0xfd3686[_0x0b44('0x47')],_0xfd3686[_0x0b44('0x44')]);_0x37f7c3['attributes']=_[_0x0b44('0x46')](_0xfd3686[_0x0b44('0x47')],qs[_0x0b44('0x49')](_0x9f8f2b['query'][_0x0b44('0x49')]));_0x37f7c3[_0x0b44('0x48')]=_0x37f7c3[_0x0b44('0x48')]['length']?_0x37f7c3['attributes']:_0xfd3686[_0x0b44('0x47')];if(_0x9f8f2b[_0x0b44('0x44')][_0x0b44('0x54')]){_0x37f7c3[_0x0b44('0x55')]=[{'all':!![]}];}_0x37f7c3=_[_0x0b44('0x52')]({},_0x37f7c3,_0x9f8f2b[_0x0b44('0x53')]);return db['ChatWebsite'][_0x0b44('0x5a')](_0x37f7c3)[_0x0b44('0x37')](handleEntityNotFound(_0x357138,null))[_0x0b44('0x37')](respondWithResult(_0x357138,null))[_0x0b44('0x2b')](handleError(_0x357138,null));};exports[_0x0b44('0x5b')]=function(_0x556bcb,_0x4f860e){return db[_0x0b44('0x41')][_0x0b44('0x5b')](_0x556bcb[_0x0b44('0x5c')],{})[_0x0b44('0x37')](function(_0x181972){var _0x5652d0=_0x556bcb[_0x0b44('0x5d')][_0x0b44('0x39')]({'plain':!![]});if(!_0x5652d0)throw new Error(_0x0b44('0x5e'));if(_0x5652d0['role']===_0x0b44('0x5d')){var _0x564fd3=_0x181972[_0x0b44('0x39')]({'plain':!![]});var _0x5d8bf5=_0x0b44('0x3a');return db['UserProfileSection'][_0x0b44('0x5a')]({'where':{'name':_0x5d8bf5,'userProfileId':_0x5652d0[_0x0b44('0x5f')]},'raw':!![]})[_0x0b44('0x37')](function(_0x1b770d){if(_0x1b770d&&_0x1b770d[_0x0b44('0x60')]===0x0){return db['UserProfileResource'][_0x0b44('0x5b')]({'name':_0x564fd3[_0x0b44('0x3b')],'resourceId':_0x564fd3['id'],'type':_0x1b770d[_0x0b44('0x3b')],'sectionId':_0x1b770d['id']},{})[_0x0b44('0x37')](function(){return _0x181972;});}else{return _0x181972;}})[_0x0b44('0x2b')](function(_0x3459d6){logger[_0x0b44('0x26')](_0x0b44('0x61'),_0x3459d6);throw _0x3459d6;});}return _0x181972;})[_0x0b44('0x37')](respondWithResult(_0x4f860e,0xc9))[_0x0b44('0x2b')](handleError(_0x4f860e,null));};exports[_0x0b44('0x36')]=function(_0x48e514,_0x1d775b){if(_0x48e514[_0x0b44('0x5c')]['id']){delete _0x48e514[_0x0b44('0x5c')]['id'];}return db[_0x0b44('0x41')][_0x0b44('0x5a')]({'where':{'id':_0x48e514[_0x0b44('0x58')]['id']},'include':[{'model':db[_0x0b44('0x3e')],'as':_0x0b44('0x3f')}]})['then'](handleEntityNotFound(_0x1d775b,null))[_0x0b44('0x37')](saveUpdates(_0x48e514[_0x0b44('0x5c')],null))[_0x0b44('0x37')](respondWithResult(_0x1d775b,null))[_0x0b44('0x2b')](handleError(_0x1d775b,null));};exports['destroy']=function(_0x33b3fe,_0x383d8a){return db['ChatWebsite'][_0x0b44('0x5a')]({'where':{'id':_0x33b3fe[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x383d8a,null))['then'](removeEntity(_0x383d8a,null))['catch'](handleError(_0x383d8a,null));};exports['describe']=function(_0x3d8091,_0x1e07f3){return db['ChatWebsite']['describe']()[_0x0b44('0x37')](respondWithResult(_0x1e07f3,null))['catch'](handleError(_0x1e07f3,null));};exports['addDisposition']=function(_0x17502a,_0x57a26a,_0x3fd174){if(_0x17502a[_0x0b44('0x5c')]['id']){delete _0x17502a[_0x0b44('0x5c')]['id'];}return db[_0x0b44('0x41')][_0x0b44('0x5a')]({'where':{'id':_0x17502a['params']['id']}})['then'](handleEntityNotFound(_0x57a26a,null))[_0x0b44('0x37')](function(_0x4074b7){if(_0x4074b7){_0x17502a[_0x0b44('0x5c')][_0x0b44('0x62')]=_0x4074b7['id'];return db[_0x0b44('0x63')]['create'](_0x17502a['body']);}})[_0x0b44('0x37')](respondWithResult(_0x57a26a,null))[_0x0b44('0x2b')](handleError(_0x57a26a,null));};exports[_0x0b44('0x64')]=function(_0x4e7223,_0x394971,_0x1d826c){var _0x51db21={'raw':![],'where':{}};var _0x4ee1b7={};var _0x26336e={'count':0x0,'rows':[]};return db[_0x0b44('0x41')]['findOne']({'where':{'id':_0x4e7223[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x394971,null))[_0x0b44('0x37')](function(_0xd09fea){if(_0xd09fea){_0x4ee1b7[_0x0b44('0x47')]=_[_0x0b44('0x59')](db[_0x0b44('0x63')]['rawAttributes']);_0x4ee1b7[_0x0b44('0x44')]=_[_0x0b44('0x59')](_0x4e7223[_0x0b44('0x44')]);_0x4ee1b7[_0x0b44('0x45')]=_[_0x0b44('0x46')](_0x4ee1b7['model'],_0x4ee1b7['query']);_0x51db21['attributes']=_['intersection'](_0x4ee1b7[_0x0b44('0x47')],qs[_0x0b44('0x49')](_0x4e7223[_0x0b44('0x44')][_0x0b44('0x49')]));_0x51db21[_0x0b44('0x48')]=_0x51db21[_0x0b44('0x48')][_0x0b44('0x4a')]?_0x51db21[_0x0b44('0x48')]:_0x4ee1b7[_0x0b44('0x47')];if(!_0x4e7223[_0x0b44('0x44')][_0x0b44('0x4b')](_0x0b44('0x4c'))){_0x51db21[_0x0b44('0x31')]=qs[_0x0b44('0x31')](_0x4e7223[_0x0b44('0x44')][_0x0b44('0x31')]);_0x51db21['offset']=qs[_0x0b44('0x2f')](_0x4e7223['query']['offset']);}_0x51db21[_0x0b44('0x65')]=qs[_0x0b44('0x4d')](_0x4e7223[_0x0b44('0x44')][_0x0b44('0x4d')]);_0x51db21[_0x0b44('0x50')]=qs[_0x0b44('0x45')](_[_0x0b44('0x4e')](_0x4e7223[_0x0b44('0x44')],_0x4ee1b7['filters']));_0x51db21[_0x0b44('0x50')]['ChatWebsiteId']=_0xd09fea['id'];if(_0x4e7223['query'][_0x0b44('0x4f')]){_0x51db21[_0x0b44('0x50')]=_[_0x0b44('0x52')](_0x51db21['where'],{'$or':_['map'](_0x51db21[_0x0b44('0x48')],function(_0x322312){var _0x2f21d5={};_0x2f21d5[_0x322312]={'$like':'%'+_0x4e7223[_0x0b44('0x44')][_0x0b44('0x4f')]+'%'};return _0x2f21d5;})});}_0x51db21=_[_0x0b44('0x52')]({},_0x51db21,_0x4e7223[_0x0b44('0x53')]);return db[_0x0b44('0x63')][_0x0b44('0x32')]({'where':_0x51db21['where']})[_0x0b44('0x37')](function(_0xd997bd){_0x26336e[_0x0b44('0x32')]=_0xd997bd;if(_0x4e7223[_0x0b44('0x44')][_0x0b44('0x54')]){_0x51db21['include']=[{'all':!![]}];}return db[_0x0b44('0x63')][_0x0b44('0x56')](_0x51db21);})[_0x0b44('0x37')](function(_0x570f58){_0x26336e[_0x0b44('0x57')]=_0x570f58;return _0x26336e;});}})[_0x0b44('0x37')](respondWithFilteredResult(_0x394971,_0x51db21))[_0x0b44('0x2b')](handleError(_0x394971,null));};exports['removeDispositions']=function(_0x30fc63,_0x2391e1,_0x17a666){return db[_0x0b44('0x41')]['find']({'where':{'id':_0x30fc63[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x2391e1,null))[_0x0b44('0x37')](function(_0x1d24d6){if(_0x1d24d6){return _0x1d24d6[_0x0b44('0x66')](_0x30fc63[_0x0b44('0x44')][_0x0b44('0x67')]);}})[_0x0b44('0x37')](respondWithStatusCode(_0x2391e1,null))[_0x0b44('0x2b')](handleError(_0x2391e1,null));};exports[_0x0b44('0x68')]=function(_0xf68c27,_0x46875e,_0x3ac2d7){if(_0xf68c27[_0x0b44('0x5c')]['id']){delete _0xf68c27[_0x0b44('0x5c')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0xf68c27['params']['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x46875e,null))[_0x0b44('0x37')](function(_0x236675){if(_0x236675){_0xf68c27[_0x0b44('0x5c')][_0x0b44('0x62')]=_0x236675['id'];return db[_0x0b44('0x69')][_0x0b44('0x5b')](_0xf68c27[_0x0b44('0x5c')]);}})[_0x0b44('0x37')](respondWithResult(_0x46875e,null))['catch'](handleError(_0x46875e,null));};exports[_0x0b44('0x6a')]=function(_0x1c09e4,_0x575aa2,_0x4909d3){var _0xdfbb6d={'raw':![],'where':{}};var _0x5d8900={};var _0x59203c={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0b44('0x6b')]({'where':{'id':_0x1c09e4[_0x0b44('0x58')]['id']}})['then'](handleEntityNotFound(_0x575aa2,null))['then'](function(_0x571fe8){if(_0x571fe8){_0x5d8900[_0x0b44('0x47')]=_['keys'](db[_0x0b44('0x69')][_0x0b44('0x42')]);_0x5d8900[_0x0b44('0x44')]=_[_0x0b44('0x59')](_0x1c09e4['query']);_0x5d8900[_0x0b44('0x45')]=_['intersection'](_0x5d8900[_0x0b44('0x47')],_0x5d8900[_0x0b44('0x44')]);_0xdfbb6d[_0x0b44('0x48')]=_['intersection'](_0x5d8900[_0x0b44('0x47')],qs[_0x0b44('0x49')](_0x1c09e4['query'][_0x0b44('0x49')]));_0xdfbb6d[_0x0b44('0x48')]=_0xdfbb6d[_0x0b44('0x48')]['length']?_0xdfbb6d[_0x0b44('0x48')]:_0x5d8900[_0x0b44('0x47')];if(!_0x1c09e4['query'][_0x0b44('0x4b')](_0x0b44('0x4c'))){_0xdfbb6d[_0x0b44('0x31')]=qs['limit'](_0x1c09e4[_0x0b44('0x44')]['limit']);_0xdfbb6d[_0x0b44('0x2f')]=qs[_0x0b44('0x2f')](_0x1c09e4[_0x0b44('0x44')][_0x0b44('0x2f')]);}_0xdfbb6d[_0x0b44('0x65')]=qs[_0x0b44('0x4d')](_0x1c09e4['query'][_0x0b44('0x4d')]);_0xdfbb6d[_0x0b44('0x50')]=qs[_0x0b44('0x45')](_[_0x0b44('0x4e')](_0x1c09e4[_0x0b44('0x44')],_0x5d8900[_0x0b44('0x45')]));_0xdfbb6d[_0x0b44('0x50')][_0x0b44('0x62')]=_0x571fe8['id'];if(_0x1c09e4[_0x0b44('0x44')][_0x0b44('0x4f')]){_0xdfbb6d[_0x0b44('0x50')]=_[_0x0b44('0x52')](_0xdfbb6d[_0x0b44('0x50')],{'$or':_['map'](_0xdfbb6d[_0x0b44('0x48')],function(_0xc84697){var _0x4c9768={};_0x4c9768[_0xc84697]={'$like':'%'+_0x1c09e4[_0x0b44('0x44')][_0x0b44('0x4f')]+'%'};return _0x4c9768;})});}_0xdfbb6d=_[_0x0b44('0x52')]({},_0xdfbb6d,_0x1c09e4[_0x0b44('0x53')]);return db[_0x0b44('0x69')][_0x0b44('0x32')]({'where':_0xdfbb6d[_0x0b44('0x50')]})[_0x0b44('0x37')](function(_0x3989e1){_0x59203c[_0x0b44('0x32')]=_0x3989e1;if(_0x1c09e4[_0x0b44('0x44')]['includeAll']){_0xdfbb6d[_0x0b44('0x55')]=[{'all':!![]}];}return db[_0x0b44('0x69')][_0x0b44('0x56')](_0xdfbb6d);})[_0x0b44('0x37')](function(_0x3ebffe){_0x59203c[_0x0b44('0x57')]=_0x3ebffe;return _0x59203c;});}})['then'](respondWithFilteredResult(_0x575aa2,_0xdfbb6d))[_0x0b44('0x2b')](handleError(_0x575aa2,null));};exports[_0x0b44('0x6c')]=function(_0x19612d,_0xc252f9,_0x5b2d5f){return db[_0x0b44('0x41')][_0x0b44('0x5a')]({'where':{'id':_0x19612d[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0xc252f9,null))[_0x0b44('0x37')](function(_0xd9f36a){if(_0xd9f36a){return _0xd9f36a['removeAnswers'](_0x19612d[_0x0b44('0x44')]['ids']);}})[_0x0b44('0x37')](respondWithStatusCode(_0xc252f9,null))[_0x0b44('0x2b')](handleError(_0xc252f9,null));};exports[_0x0b44('0x6d')]=function(_0x3c5e7d,_0x55177e,_0x3a0af7){_0x3c5e7d['body'][_0x0b44('0x6e')]=_0x3c5e7d[_0x0b44('0x6f')][_0x0b44('0x70')];return db[_0x0b44('0x41')][_0x0b44('0x5a')]({'where':{'id':_0x3c5e7d['params']['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x55177e,null))[_0x0b44('0x37')](saveUpdates(_0x3c5e7d['body'],null))['then'](respondWithResult(_0x55177e,null))[_0x0b44('0x2b')](handleError(_0x55177e,null));};exports[_0x0b44('0x71')]=function(_0x418012,_0x449cb8,_0x12aa02){_0x418012[_0x0b44('0x5c')]['agentAvatar']=_0x418012[_0x0b44('0x6f')][_0x0b44('0x70')];return db['ChatWebsite'][_0x0b44('0x5a')]({'where':{'id':_0x418012['params']['id']}})['then'](handleEntityNotFound(_0x449cb8,null))['then'](saveUpdates(_0x418012['body'],null))[_0x0b44('0x37')](respondWithResult(_0x449cb8,null))[_0x0b44('0x2b')](handleError(_0x449cb8,null));};exports[_0x0b44('0x72')]=function(_0x26f494,_0x385b9b,_0x318fa7){_0x26f494[_0x0b44('0x5c')][_0x0b44('0x73')]=_0x26f494['file'][_0x0b44('0x70')];return db[_0x0b44('0x41')]['find']({'where':{'id':_0x26f494['params']['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x385b9b,null))[_0x0b44('0x37')](saveUpdates(_0x26f494['body'],null))[_0x0b44('0x37')](respondWithResult(_0x385b9b,null))['catch'](handleError(_0x385b9b,null));};exports[_0x0b44('0x74')]=function(_0x4a2a38,_0x3d0f12,_0x97a27c){_0x4a2a38['body'][_0x0b44('0x75')]=_0x4a2a38['file']['filename'];return db['ChatWebsite'][_0x0b44('0x5a')]({'where':{'id':_0x4a2a38[_0x0b44('0x58')]['id']}})['then'](handleEntityNotFound(_0x3d0f12,null))['then'](saveUpdates(_0x4a2a38[_0x0b44('0x5c')],null))[_0x0b44('0x37')](respondWithResult(_0x3d0f12,null))[_0x0b44('0x2b')](handleError(_0x3d0f12,null));};exports[_0x0b44('0x76')]=function(_0x4108e8,_0x434e2f,_0x3ccff8){var _0x3f6b0a=path[_0x0b44('0x77')](config[_0x0b44('0x78')],_0x0b44('0x79'));var _0x39afc3={'where':{'id':_0x4108e8['params']['id']},'attributes':['id',_0x0b44('0x6e')],'raw':!![]};var _0x306663=![];return require('../../config/license/util')[_0x0b44('0x7a')]()[_0x0b44('0x37')](function(_0x1fafc8){if(_0x1fafc8){_0x306663=_0x1fafc8[_0x0b44('0x7b')];}})[_0x0b44('0x37')](function(){return db['ChatWebsite']['find'](_0x39afc3);})[_0x0b44('0x37')](handleEntityNotFound(_0x434e2f,null))[_0x0b44('0x37')](function(_0x3df8d9){if(_0x3df8d9){if(!_[_0x0b44('0x7c')](_0x3df8d9[_0x0b44('0x6e')])){if(fs[_0x0b44('0x7d')](path['join'](config['root'],_0x0b44('0x7e'),_0x3df8d9[_0x0b44('0x6e')]))&&_0x306663){_0x3f6b0a=path[_0x0b44('0x77')](config[_0x0b44('0x78')],_0x0b44('0x7e'),_0x3df8d9[_0x0b44('0x6e')]);}}return _0x434e2f[_0x0b44('0x7f')](_0x3f6b0a);}})[_0x0b44('0x2b')](handleError(_0x434e2f,null));};exports['getAvatar']=function(_0x34c1c5,_0xd8032b,_0x4a45ab){var _0x9e7fba=path['join'](config[_0x0b44('0x78')],_0x0b44('0x80'));var _0x43f402={'where':{'id':_0x34c1c5[_0x0b44('0x58')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x0b44('0x5a')](_0x43f402)['then'](handleEntityNotFound(_0xd8032b,null))[_0x0b44('0x37')](function(_0x2d3ebf){if(_0x2d3ebf){if(!_[_0x0b44('0x7c')](_0x2d3ebf[_0x0b44('0x81')])){if(fs[_0x0b44('0x7d')](path[_0x0b44('0x77')](config[_0x0b44('0x78')],'server/files/images/avatars/',_0x2d3ebf[_0x0b44('0x81')]))){_0x9e7fba=path['join'](config[_0x0b44('0x78')],_0x0b44('0x82'),_0x2d3ebf[_0x0b44('0x81')]);}}return _0xd8032b[_0x0b44('0x7f')](_0x9e7fba);}})[_0x0b44('0x2b')](handleError(_0xd8032b,null));};exports[_0x0b44('0x83')]=function(_0x3abcd0,_0x2fe58d,_0x58c6ff){var _0x869c19=path[_0x0b44('0x77')](config[_0x0b44('0x78')],_0x0b44('0x84'));var _0x143e50={'where':{'id':_0x3abcd0[_0x0b44('0x58')]['id']},'attributes':['id',_0x0b44('0x73'),'showCustomerAvatar'],'raw':!![]};return db[_0x0b44('0x41')][_0x0b44('0x5a')](_0x143e50)['then'](handleEntityNotFound(_0x2fe58d,null))['then'](function(_0x26eada){if(_0x26eada){if(!_[_0x0b44('0x7c')](_0x26eada['customerAvatar'])){if(fs[_0x0b44('0x7d')](path['join'](config['root'],_0x0b44('0x82'),_0x26eada[_0x0b44('0x73')]))&&_0x26eada[_0x0b44('0x85')]){_0x869c19=path[_0x0b44('0x77')](config[_0x0b44('0x78')],'server/files/images/avatars/',_0x26eada[_0x0b44('0x73')]);}}return _0x2fe58d['download'](_0x869c19);}})['catch'](handleError(_0x2fe58d,null));};exports[_0x0b44('0x86')]=function(_0x245373,_0x324e67,_0x1ff637){var _0x3b6c23=path[_0x0b44('0x77')](config[_0x0b44('0x78')],'server/files/images/avatars/system_avatar.png');var _0x3cb4b6={'where':{'id':_0x245373['params']['id']},'attributes':['id',_0x0b44('0x75')],'raw':!![]};return db[_0x0b44('0x41')][_0x0b44('0x5a')](_0x3cb4b6)[_0x0b44('0x37')](handleEntityNotFound(_0x324e67,null))[_0x0b44('0x37')](function(_0x3dc56b){if(_0x3dc56b){if(!_['isNil'](_0x3dc56b[_0x0b44('0x75')])){if(fs[_0x0b44('0x7d')](path[_0x0b44('0x77')](config[_0x0b44('0x78')],_0x0b44('0x82'),_0x3dc56b[_0x0b44('0x75')]))){_0x3b6c23=path['join'](config[_0x0b44('0x78')],_0x0b44('0x82'),_0x3dc56b[_0x0b44('0x75')]);}}return _0x324e67[_0x0b44('0x7f')](_0x3b6c23);}})[_0x0b44('0x2b')](handleError(_0x324e67,null));};exports['notify']=function(_0x1ff34c,_0x130968,_0x48cdc4){var _0x383b71=require('user-agent-parser');var _0x4d4d4e=new _0x383b71();var _0x2ce6ac=_0x4d4d4e[_0x0b44('0x87')](_0x1ff34c[_0x0b44('0x88')][_0x0b44('0x89')])['getResult']();var _0x1ae8f4={'body':_0x1ff34c[_0x0b44('0x5c')],'channel':_0x0b44('0x8a')};var _0x53ce28=[];var _0x215312=[];var _0x4df4c1={};var _0x32d3de=![];return db[_0x0b44('0x8b')][_0x0b44('0x8c')]()['then'](function(_0x3378cc){if(!_0x3378cc){throw new db[(_0x0b44('0x8d'))]['ValidationError'](_0x0b44('0x8e'));}_0x53ce28=_[_0x0b44('0x8f')](_['keys'](_0x3378cc),[_0x0b44('0x90'),_0x0b44('0x91')]);_0x215312=_[_0x0b44('0x8f')](_[_0x0b44('0x59')](_0x3378cc),[_0x0b44('0x90'),_0x0b44('0x91'),'CompanyId','ListId']);if(_0x1ff34c[_0x0b44('0x5c')]['id']){delete _0x1ff34c['body']['id'];}if(_[_0x0b44('0x7c')](_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0x92')])){throw new db[(_0x0b44('0x8d'))][(_0x0b44('0x93'))](_0x0b44('0x94'));}if(_[_0x0b44('0x7c')](_0x1ff34c['body'][_0x0b44('0x5c')])||_0x1ff34c[_0x0b44('0x5c')]['body']===''){throw new db[(_0x0b44('0x8d'))][(_0x0b44('0x93'))](_0x0b44('0x95'));}if(_[_0x0b44('0x7c')](_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0x96')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x215312);}if(!_[_0x0b44('0x97')](_0x215312,_0x1ff34c['body'][_0x0b44('0x96')])){throw new db[(_0x0b44('0x8d'))]['ValidationError'](_0x0b44('0x98')+_0x215312);}_0x4df4c1[_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0x96')]]=_0x1ff34c['body'][_0x0b44('0x92')];})[_0x0b44('0x37')](function(){return db[_0x0b44('0x41')][_0x0b44('0x5a')]({'where':{'id':_0x1ff34c['params']['id']},'include':[{'model':db[_0x0b44('0x99')],'as':_0x0b44('0x9a'),'include':[{'model':db[_0x0b44('0x8b')],'as':_0x0b44('0x9b'),'where':_0x4df4c1,'limit':0x1,'order':[[_0x0b44('0x91'),'DESC']]}]},{'model':db[_0x0b44('0x9c')],'as':'Applications'}]});})[_0x0b44('0x37')](handleEntityNotFound(_0x130968,null))[_0x0b44('0x37')](function(_0x20f666){if(_0x20f666&&_0x20f666['List']){_0x1ae8f4[_0x0b44('0x9d')]=_0x20f666;_0x1ae8f4[_0x0b44('0x9e')]=_0x20f666[_0x0b44('0x9f')];_0x1ae8f4[_0x0b44('0xa0')]=_0x20f666['List'];_0x1ae8f4[_0x0b44('0x9e')]=_[_0x0b44('0xa1')](_0x1ae8f4[_0x0b44('0x9e')],[_0x0b44('0xa2')],[_0x0b44('0xa3')]);if(_0x1ae8f4[_0x0b44('0x9d')][_0x0b44('0x9f')]){delete _0x1ae8f4['account'][_0x0b44('0x9f')];}if(_0x1ae8f4['account'][_0x0b44('0x9a')]&&_0x1ae8f4[_0x0b44('0x9d')][_0x0b44('0x9a')][_0x0b44('0x9b')][_0x0b44('0x4a')]){return _0x1ae8f4[_0x0b44('0x9d')]['List'][_0x0b44('0x9b')][0x0];}var _0x5b7064=_[_0x0b44('0x1b')](_0x1ff34c[_0x0b44('0x5c')],{'firstName':_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0x92')],'ListId':_0x20f666[_0x0b44('0xa4')]});_0x5b7064[_0x1ff34c[_0x0b44('0x5c')]['mapKey']]=_0x1ff34c[_0x0b44('0x5c')]['from'];return db[_0x0b44('0x8b')][_0x0b44('0x5b')](_0x5b7064,{'fields':_0x53ce28,'raw':!![]});}})[_0x0b44('0x37')](handleEntityNotFound(_0x130968,null))[_0x0b44('0x37')](function(_0x2c73b8){_0x1ae8f4[_0x0b44('0xa5')]=_0x2c73b8;var _0x1741ea=_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0xa6')];if(_0x1ff34c[_0x0b44('0x88')][_0x0b44('0xa7')]){_0x1741ea=_0x1ff34c[_0x0b44('0x88')][_0x0b44('0xa7')];}else if(_0x1ff34c[_0x0b44('0x88')]['x-forwarded-for']){_0x1741ea=_['first'](_0x1ff34c[_0x0b44('0x88')][_0x0b44('0xa8')]['split'](','));}if(_0x2c73b8){var _0xe0f5f1={'ContactId':_0x2c73b8['id'],'ChatWebsiteId':_0x1ff34c[_0x0b44('0x58')]['id'],'from':(_0x2c73b8[_0x0b44('0xa9')]||'')+'\x20'+(_0x2c73b8[_0x0b44('0xaa')]||''),'customerIp':_0x1741ea,'customerPort':_0x1ff34c[_0x0b44('0x88')][_0x0b44('0xab')]?_0x1ff34c[_0x0b44('0x88')][_0x0b44('0xab')]:null,'referer':_0x1ff34c['body'][_0x0b44('0xac')],'browserName':_0x2ce6ac[_0x0b44('0xad')][_0x0b44('0x3b')]&&_0x2ce6ac[_0x0b44('0xad')][_0x0b44('0xae')]?util[_0x0b44('0xaf')](_0x0b44('0xb0'),_0x2ce6ac[_0x0b44('0xad')]['name'],_0x2ce6ac[_0x0b44('0xad')][_0x0b44('0xae')]):_0x0b44('0xb1'),'browserVersion':_0x2ce6ac[_0x0b44('0xad')][_0x0b44('0xae')]||_0x0b44('0xb1'),'osName':util['format'](_0x0b44('0xb0'),_0x2ce6ac['os'][_0x0b44('0x3b')],_0x2ce6ac['os'][_0x0b44('0xae')]),'osVersion':_0x2ce6ac['os'][_0x0b44('0xae')],'deviceModel':_0x2ce6ac[_0x0b44('0xb2')]['model']&&_0x2ce6ac[_0x0b44('0xb2')][_0x0b44('0xb3')]?util['format'](_0x0b44('0xb4'),_0x2ce6ac[_0x0b44('0xb2')]['model'],_0x2ce6ac[_0x0b44('0xb2')][_0x0b44('0xb3')],_0x2ce6ac['device'][_0x0b44('0xb5')]):null,'deviceVendor':_0x2ce6ac[_0x0b44('0xb2')][_0x0b44('0xb3')],'deviceType':_0x2ce6ac[_0x0b44('0xb2')][_0x0b44('0xb5')],'formData':JSON[_0x0b44('0x25')](_0x1ff34c[_0x0b44('0x5c')])};var _0x47626e={'ChatWebsiteId':_0x1ff34c['params']['id'],'closed':![]};if(_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0xb6')]){_0x47626e[_0x0b44('0xb6')]=_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0xb6')];return db[_0x0b44('0xb7')][_0x0b44('0x5a')]({'where':_0x47626e})[_0x0b44('0x37')](function(_0x5a0135){if(_0x5a0135){return[_0x5a0135,![]];}_0xe0f5f1[_0x0b44('0xb6')]=_0x1ff34c['body']['threadId'];_0xe0f5f1[_0x0b44('0xb8')]=_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0xb8')];return db['ChatInteraction'][_0x0b44('0x5b')](_0xe0f5f1)[_0x0b44('0x37')](function(_0x2da8e3){return[_0x2da8e3,!![]];});});}_0x47626e[_0x0b44('0xb9')]=_0x2c73b8['id'];if(_0x1ff34c[_0x0b44('0x5c')]['interaction']&&_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0xba')]['id']){_0x47626e['id']=_0x1ff34c['body']['interaction']['id'];return db[_0x0b44('0xb7')]['find']({'where':_0x47626e})[_0x0b44('0x37')](function(_0x5cc595){if(_0x5cc595){return[_0x5cc595,![]];}return db[_0x0b44('0xb7')][_0x0b44('0x5b')](_0xe0f5f1)['then'](function(_0x16a665){return[_0x16a665,!![]];});});}return db[_0x0b44('0xb7')][_0x0b44('0x5b')](_0xe0f5f1)['then'](function(_0x385c0a){return[_0x385c0a,!![]];});}})[_0x0b44('0xbb')](function(_0x163c7d,_0x3becaa){if(_0x163c7d){_0x32d3de=_0x3becaa;if(!_0x3becaa){var _0x34e656={'from':(_0x1ae8f4[_0x0b44('0xa5')][_0x0b44('0xa9')]||'')+'\x20'+(_0x1ae8f4['contact'][_0x0b44('0xaa')]||'')};if(_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0xb6')]&&_0x1ff34c['body'][_0x0b44('0xbc')]&&_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0xb6')]!=_0x1ff34c[_0x0b44('0x5c')]['messageId']){_0x34e656[_0x0b44('0xb6')]=_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0xbc')];}return _0x163c7d['update'](_0x34e656);}else{return _0x163c7d;}}})['then'](function(_0x4e53cd){_0x1ae8f4[_0x0b44('0xba')]=_0x4e53cd['get']({'plain':!![]});_0x1ae8f4[_0x0b44('0xba')][_0x0b44('0xbd')]=_0x32d3de;if(_0x1ae8f4[_0x0b44('0xba')][_0x0b44('0xbd')]){if(_0x1ae8f4[_0x0b44('0x9d')][_0x0b44('0xbe')]){_0x1ae8f4[_0x0b44('0x9e')][_0x0b44('0xbf')]({'id':0x0,'priority':_0x1ae8f4['applications']['length']+0x1,'app':_0x0b44('0xc0'),'appdata':_0x0b44('0xc1'),'interval':_0x0b44('0xc2')});}}return db['ChatMessage'][_0x0b44('0x5b')]({'body':_0x1ff34c[_0x0b44('0x5c')]['body'],'ChatWebsiteId':_0x1ff34c['params']['id'],'ChatInteractionId':_0x4e53cd['id'],'direction':'in','ContactId':_0x1ae8f4[_0x0b44('0xa5')]['id'],'AttachmentId':_0x1ff34c[_0x0b44('0x5c')][_0x0b44('0xc3')]});})[_0x0b44('0x37')](function(_0x26ddd0){_0x1ae8f4[_0x0b44('0x28')]=_0x26ddd0;if(_0x1ae8f4[_0x0b44('0xba')]['UserId']){return db['User'][_0x0b44('0x5a')]({'attributes':['id',_0x0b44('0x3b')],'where':{'id':_0x1ae8f4['interaction'][_0x0b44('0xc4')]}})['then'](function(_0x3bbdb5){if(_0x3bbdb5){_0x1ae8f4[_0x0b44('0x9e')][_0x0b44('0xc5')]({'id':0x0,'priority':0x0,'app':_0x0b44('0xc6'),'appdata':_0x3bbdb5['name']+','+(_0x1ae8f4[_0x0b44('0x9d')][_0x0b44('0xc7')]||0xa),'interval':_0x0b44('0xc2')});_0x1ae8f4[_0x0b44('0xc8')]=!![];}return respondWithRpcPromise(_0x0b44('0xc9'),_0x0b44('0xca'),_0x1ae8f4);});}return respondWithRpcPromise('Start',_0x0b44('0xca'),_0x1ae8f4);})['then'](function(_0x3d0186){respondWithRpcPromise(_0x0b44('0xcb'),'EventManager',{'event':_0x0b44('0xcc'),'message':_0x3d0186},client9002);return _0x3d0186;})['then'](respondWithResult(_0x130968,null))[_0x0b44('0x2b')](handleError(_0x130968,null));};exports[_0x0b44('0xcd')]=function(_0x3801ca,_0x125721,_0x4e6a08){var _0x3412e1,_0x1f780f,_0x3eca32;var _0x1e753b=[];var _0x2254ec=[];var _0x13c761={};var _0x3423c2=_0x3801ca[_0x0b44('0xce')]||[];var _0x42bb70=[];var _0x1de83c;return db[_0x0b44('0x8b')]['describe']()[_0x0b44('0x37')](function(_0x3eb917){if(!_0x3eb917){throw new db['Sequelize'][(_0x0b44('0x93'))](_0x0b44('0x8e'));}_0x2254ec=_[_0x0b44('0x8f')](_['keys'](_0x3eb917),[_0x0b44('0x90'),'updatedAt']);_0x1e753b=_['difference'](_['keys'](_0x3eb917),[_0x0b44('0x90'),_0x0b44('0x91'),_0x0b44('0xcf'),_0x0b44('0xa4')]);if(_0x3801ca[_0x0b44('0x5c')]['id']){delete _0x3801ca['body']['id'];}if(_[_0x0b44('0x7c')](_0x3801ca[_0x0b44('0x5c')][_0x0b44('0x92')])){throw _0x125721[_0x0b44('0x2c')](0x1f4)['send'](new db['Sequelize'][(_0x0b44('0x93'))](_0x0b44('0x94')));}if(_[_0x0b44('0x7c')](_0x3801ca[_0x0b44('0x5c')][_0x0b44('0x5c')])||_0x3801ca[_0x0b44('0x5c')][_0x0b44('0x5c')]===''){throw _0x125721[_0x0b44('0x2c')](0x1f4)['send'](new db[(_0x0b44('0x8d'))][(_0x0b44('0x93'))](_0x0b44('0x95')));}if(_[_0x0b44('0x7c')](_0x3801ca['body']['mapKeyOffline'])){throw _0x125721[_0x0b44('0x2c')](0x1f4)['send'](new db['Sequelize'][(_0x0b44('0x93'))](_0x0b44('0xd0')+_0x1e753b));}if(!_[_0x0b44('0x97')](_0x1e753b,_0x3801ca[_0x0b44('0x5c')][_0x0b44('0xd1')])){throw _0x125721[_0x0b44('0x2c')](0x1f4)[_0x0b44('0x3c')](new db[(_0x0b44('0x8d'))]['ValidationError'](_0x0b44('0xd2')+_0x1e753b));}_0x13c761[_0x3801ca[_0x0b44('0x5c')][_0x0b44('0xd1')]]=_0x3801ca[_0x0b44('0x5c')][_0x0b44('0x92')];})[_0x0b44('0x37')](function(){return db[_0x0b44('0x41')][_0x0b44('0x5a')]({'where':{'id':_0x3801ca[_0x0b44('0x58')]['id']},'include':[{'model':db[_0x0b44('0x99')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x0b44('0x37')](handleEntityNotFound(_0x125721,null))[_0x0b44('0x37')](function(_0x31611e){if(_0x31611e&&_0x31611e[_0x0b44('0x9a')]){_0x1f780f=_0x31611e;var _0x151b18=_[_0x0b44('0x1b')](_0x3801ca[_0x0b44('0x5c')],{'firstName':_0x3801ca[_0x0b44('0x5c')][_0x0b44('0x92')],'phone':_0x3801ca[_0x0b44('0x5c')][_0x0b44('0x92')],'ListId':_0x31611e[_0x0b44('0xa4')]});_0x151b18[_0x3801ca['body'][_0x0b44('0xd1')]]=_0x3801ca[_0x0b44('0x5c')][_0x0b44('0x92')];return db[_0x0b44('0x8b')][_0x0b44('0xd3')]({'where':_0x13c761,'defaults':_0x151b18});}})[_0x0b44('0xbb')](function(_0x17f269){if(_0x17f269){_0x3eca32=_0x17f269;var _0x37b7e2=fs[_0x0b44('0xd4')](path[_0x0b44('0x77')](config[_0x0b44('0x78')],_0x0b44('0xd5')),'utf8');var _0x13e1a0=ejs[_0x0b44('0xd6')](_0x37b7e2,{'body':_[_0x0b44('0xd7')](_0x3801ca[_0x0b44('0x5c')][_0x0b44('0x5c')]),'bodyTitle':_0x1f780f['offlineMessageBody']});return db[_0x0b44('0xd8')]['create']({'body':_0x13e1a0,'ContactId':_0x17f269['id'],'ChatWebsiteId':_0x1f780f['id']});}})['then'](function(_0x4b7da7){_0x1de83c=_0x4b7da7;if(_0x3423c2[_0x0b44('0x4a')]){var _0x30cc8b=_0x3423c2[_0x0b44('0x40')](function(_0x2ab122){return{'name':_0x2ab122['originalname'],'basename':_0x2ab122[_0x0b44('0x70')],'type':_0x2ab122[_0x0b44('0xd9')],'ChatOfflineMessageId':_0x4b7da7['id']};});_0x42bb70=_0x30cc8b[_0x0b44('0x40')](_0x128dc0=>{var _0xf8c345={'filename':_0x128dc0[_0x0b44('0x3b')],'path':path['join'](config[_0x0b44('0x78')],_0x0b44('0xda'),_0x0b44('0xce'),_0x0b44('0xdb'),_0x0b44('0xdc'),_0x128dc0[_0x0b44('0xdd')])};return _0xf8c345;});if(!_0x1f780f[_0x0b44('0xde')]){return db[_0x0b44('0xdf')]['transaction'](function(_0x18c8be){return db[_0x0b44('0xe0')][_0x0b44('0xe1')](_0x30cc8b,{'transaction':_0x18c8be});});}}})[_0x0b44('0x37')](function(){if(_0x1de83c){_0x3412e1=_0x1de83c;return db['MailAccount'][_0x0b44('0x6b')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x0b44('0xe2'),'raw':!![]}]});}})['then'](function(_0x29a9be){if(_0x29a9be&&_0x29a9be['Smtp']&&_0x1f780f[_0x0b44('0xe3')]&&_0x1f780f[_0x0b44('0xe4')]){var _0x5aef9c={'tls':{'rejectUnauthorized':![]}};if(_0x29a9be[_0x0b44('0xe2')][_0x0b44('0xe5')]){_0x5aef9c[_0x0b44('0xe5')]=_0x29a9be[_0x0b44('0xe2')][_0x0b44('0xe5')];}else{_0x5aef9c[_0x0b44('0xe6')]=_0x29a9be['Smtp'][_0x0b44('0xe6')];_0x5aef9c[_0x0b44('0xe7')]=_0x29a9be[_0x0b44('0xe2')][_0x0b44('0xe7')];_0x5aef9c['secure']=_0x29a9be[_0x0b44('0xe2')][_0x0b44('0xe8')];}if(_0x29a9be[_0x0b44('0xe2')][_0x0b44('0xe9')]){_0x5aef9c[_0x0b44('0xea')]={'user':_0x29a9be[_0x0b44('0xe2')][_0x0b44('0x5d')],'pass':_0x29a9be['Smtp'][_0x0b44('0xeb')]};}return respondWithRpcPromise(_0x0b44('0xec'),_0x0b44('0xed'),{'account':_0x5aef9c,'message':{'from':util[_0x0b44('0xaf')](_0x0b44('0xee'),_0x29a9be['name'],_0x29a9be['email']||_0x29a9be[_0x0b44('0xe2')][_0x0b44('0x5d')]),'to':_0x1f780f[_0x0b44('0xe4')],'subject':_0x1f780f[_0x0b44('0xef')],'html':_0x3412e1[_0x0b44('0x5c')],'attachments':_0x42bb70}},client9003)[_0x0b44('0x37')](function(){return _0x3412e1;})[_0x0b44('0x2b')](function(_0x159306){console[_0x0b44('0x26')](_0x159306);});}})['then'](function(){if(_0x1f780f&&_0x1f780f[_0x0b44('0xde')]&&_0x1f780f['MailAccountId']){var _0x504133=[];if(_0x3423c2[_0x0b44('0x4a')]){_0x504133=_0x3423c2['map'](function(_0x1ddacd){return{'name':_0x1ddacd[_0x0b44('0xf0')],'basename':_0x1ddacd[_0x0b44('0x70')],'type':_0x1ddacd['mimetype'],'ChatOfflineMessageId':_0x1de83c['id']};});}var _0x5b559c;if(!_['isNil'](_0x1f780f[_0x0b44('0xf1')])){var _0x142d93=_['map'](_0x3801ca[_0x0b44('0x5c')],function(_0x1fab84){return _0x1fab84;});var _0x1dfc47=_['toPairsIn'](_0x142d93)[0x0];var _0x23caf6=_['mapValues'](_0x1dfc47,function(_0x84b700){return _0x84b700;});_0x5b559c=_0x23caf6[0x1][_0x1f780f[_0x0b44('0xf1')]];}var _0xc9a3d0={'from':_0x3eca32['email'],'firstName':_0x3eca32['firstName'],'lastName':_0x3eca32[_0x0b44('0xaa')],'mapKey':_0x0b44('0xf2'),'message':{'from':_0x3eca32[_0x0b44('0xf2')],'to':_0x1f780f[_0x0b44('0xf3')]['email'],'cc':'','subject':_[_0x0b44('0x7c')](_0x5b559c)?_0x1f780f[_0x0b44('0xef')]:_0x5b559c,'messageId':'','sentAt':new Date(),'attach':_0x504133[_0x0b44('0x4a')],'attachments':_0x504133,'originChannel':'Chat','ChatWebsiteId':_0x1f780f['id'],'ChatOfflineMessageId':_0x3412e1['id'],'originTo':_0x1f780f[_0x0b44('0xf3')]['email']},'body':_0x3412e1[_0x0b44('0x5c')]};var _0x1df82c={'account':{'id':_0x1f780f[_0x0b44('0xf4')]},'body':_0xc9a3d0,'log':_0x0b44('0xf5')};return respondWithRpcPromise(_0x0b44('0xf5'),_0x0b44('0xf6'),_0x1df82c,client9001)[_0x0b44('0x37')](function(){return _0x3412e1;})['catch'](function(_0x586ff4){console['error'](_0x586ff4);});}return;})[_0x0b44('0x37')](function(){if(_0x3412e1){return _0x3412e1;}})[_0x0b44('0x37')](respondWithResult(_0x125721,null))['catch'](function(_0x272d15){console[_0x0b44('0x26')](_0x0b44('0x2b'),_0x272d15);for(var _0x1871c1 of _0x3423c2){var _0x300a5a=path[_0x0b44('0x77')](config[_0x0b44('0x78')],_0x0b44('0xda'),'files',_0x0b44('0xdb'),_0x0b44('0xdc'),_0x1871c1[_0x0b44('0x70')]);fs_extra[_0x0b44('0xf7')](_0x300a5a)['catch'](function(_0x88dce6){console[_0x0b44('0x26')](_0x0b44('0xf8'),_0x300a5a,_0x88dce6);});}});};exports['addInteraction']=function(_0xd06e3b,_0x55f64a,_0x3101c7){return db['ChatInteraction'][_0x0b44('0x5a')]({'where':{'id':_0xd06e3b[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x55f64a,null))['then'](function(_0x531c3f){if(_0x531c3f){return _0x531c3f['addInteraction'](_0xd06e3b['body'][_0x0b44('0x67')],_[_0x0b44('0xf9')](_0xd06e3b[_0x0b44('0x5c')],[_0x0b44('0x67'),'id'])||{});}})['then'](respondWithResult(_0x55f64a,null))[_0x0b44('0x2b')](handleError(_0x55f64a,null));};exports[_0x0b44('0xfa')]=function(_0x135a18,_0x1ef451,_0x4f00c6){var _0x1c01df={'raw':![],'where':{}};var _0x35a3cc={};var _0x2e1d20={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0b44('0x6b')]({'where':{'id':_0x135a18[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x1ef451,null))[_0x0b44('0x37')](function(_0x1e6a28){if(_0x1e6a28){_0x35a3cc[_0x0b44('0x47')]=_['keys'](db['ChatInteraction'][_0x0b44('0x42')]);_0x35a3cc[_0x0b44('0x44')]=_[_0x0b44('0x59')](_0x135a18['query']);_0x35a3cc['filters']=_[_0x0b44('0x46')](_0x35a3cc[_0x0b44('0x47')],_0x35a3cc[_0x0b44('0x44')]);_0x1c01df[_0x0b44('0x48')]=_[_0x0b44('0x46')](_0x35a3cc[_0x0b44('0x47')],qs[_0x0b44('0x49')](_0x135a18['query'][_0x0b44('0x49')]));_0x1c01df['attributes']=_0x1c01df['attributes'][_0x0b44('0x4a')]?_0x1c01df['attributes']:_0x35a3cc[_0x0b44('0x47')];if(!_0x135a18[_0x0b44('0x44')][_0x0b44('0x4b')]('nolimit')){_0x1c01df[_0x0b44('0x31')]=qs[_0x0b44('0x31')](_0x135a18[_0x0b44('0x44')][_0x0b44('0x31')]);_0x1c01df['offset']=qs[_0x0b44('0x2f')](_0x135a18[_0x0b44('0x44')][_0x0b44('0x2f')]);}_0x1c01df[_0x0b44('0x65')]=qs[_0x0b44('0x4d')](_0x135a18['query']['sort']);_0x1c01df[_0x0b44('0x50')]=qs['filters'](_[_0x0b44('0x4e')](_0x135a18[_0x0b44('0x44')],_0x35a3cc['filters']));_0x1c01df[_0x0b44('0x50')]['ChatWebsiteId']=_0x1e6a28['id'];if(_0x135a18['query'][_0x0b44('0x4f')]){_0x1c01df['where']=_[_0x0b44('0x52')](_0x1c01df[_0x0b44('0x50')],{'$or':_[_0x0b44('0x40')](_0x1c01df[_0x0b44('0x48')],function(_0x1634bc){var _0x4f809f={};_0x4f809f[_0x1634bc]={'$like':'%'+_0x135a18['query'][_0x0b44('0x4f')]+'%'};return _0x4f809f;})});}_0x1c01df=_[_0x0b44('0x52')]({},_0x1c01df,_0x135a18[_0x0b44('0x53')]);return db[_0x0b44('0xb7')][_0x0b44('0x32')]({'where':_0x1c01df['where']})['then'](function(_0x38e039){_0x2e1d20[_0x0b44('0x32')]=_0x38e039;if(_0x135a18[_0x0b44('0x44')]['includeAll']){_0x1c01df[_0x0b44('0x55')]=[{'model':db[_0x0b44('0x8b')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x0b44('0xfb'),'attributes':[_0x0b44('0x3b'),'fullname',_0x0b44('0xfc')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0b44('0x3b'),_0x0b44('0xfd')],'where':_0x135a18[_0x0b44('0x44')]['tag']?{'id':_0x135a18['query'][_0x0b44('0xfe')]}:undefined,'required':_0x135a18[_0x0b44('0x44')][_0x0b44('0xfe')]?!![]:![]}];}return db['ChatInteraction'][_0x0b44('0x56')](_0x1c01df);})[_0x0b44('0x37')](function(_0x267b93){_0x2e1d20['rows']=_0x267b93;return _0x2e1d20;});}})[_0x0b44('0x37')](respondWithFilteredResult(_0x1ef451,_0x1c01df))['catch'](handleError(_0x1ef451,null));};function iftimePromise(_0x428e1b,_0x237dac){return respondWithRpcPromise(_0x0b44('0xff'),_0x0b44('0x100'),{'command':_0x237dac['timezone']?util[_0x0b44('0xaf')](_0x0b44('0x101'),_0x428e1b[_0x0b44('0x102')],_0x237dac[_0x0b44('0x103')]):util[_0x0b44('0xaf')](_0x0b44('0x104'),_0x428e1b[_0x0b44('0x102')])},client9002)[_0x0b44('0x37')](function(_0x21130a){var _0x4c2f5d=_0x21130a&&_0x21130a['indexOf'](_0x0b44('0x105'))>=0x0?!![]:![];logger[_0x0b44('0x29')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x237dac['id'],_0x428e1b['id'],_0x428e1b['interval'],_0x4c2f5d?'ONLINE':_0x0b44('0x106'),_0x237dac[_0x0b44('0x103')]?_0x237dac[_0x0b44('0x103')]:_0x0b44('0x107'));return _0x4c2f5d;})[_0x0b44('0x2b')](function(_0x1fc2a3){logger[_0x0b44('0x26')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x237dac['id'],_0x428e1b['id'],_0x428e1b['interval'],util[_0x0b44('0x108')](_0x1fc2a3,{'showHidden':![],'depth':null}),_0x237dac[_0x0b44('0x103')]?_0x237dac[_0x0b44('0x103')]:'No\x20timezone');return![];});}exports[_0x0b44('0x100')]=function(_0x356db7,_0x13aff7,_0xd7a324){var _0x19bc03=0x0;var _0xd423a0=0x0;var _0x314db0=![];var _0x1de26d;var _0x217e2e;return db[_0x0b44('0x41')][_0x0b44('0x5a')]({'where':{'id':_0x356db7[_0x0b44('0x58')]['id']},'include':[{'model':db[_0x0b44('0x109')],'as':_0x0b44('0x109'),'include':[{'model':db['Interval'],'as':_0x0b44('0x10a'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x0b44('0x37')](handleEntityNotFound(_0x13aff7,null))[_0x0b44('0x37')](function(_0x2f5220){if(_0x2f5220){_0x1de26d=_0x2f5220;return _0x2f5220['getProactiveActions']({'raw':!![]});}})[_0x0b44('0x37')](function(_0x3b0ded){if(_0x1de26d){if(_0x3b0ded){_0x217e2e=_0x3b0ded;}}return require(_0x0b44('0x18'))[_0x0b44('0x7a')]();})['then'](function(_0x18cfde){if(_0x18cfde){_0xd423a0=_0x18cfde[_0x0b44('0x10b')];_0x314db0=_0x18cfde[_0x0b44('0x7b')];}})[_0x0b44('0x37')](function(){return db[_0x0b44('0xb7')][_0x0b44('0x32')]({'where':{'closed':![]}});})['then'](function(_0x3121ae){_0x19bc03=_0x3121ae;if(_0xd423a0&&_0x3121ae>_0xd423a0){return db[_0x0b44('0x10c')][_0x0b44('0x6b')]({'where':{'id':0x1}})[_0x0b44('0x37')](function(_0x41bfef){if(_0x41bfef){_0x41bfef[_0x0b44('0x10d')](_0x0b44('0x10e'));}});}})[_0x0b44('0x37')](function(){if(_0x1de26d[_0x0b44('0x109')]&&_0x1de26d[_0x0b44('0x109')][_0x0b44('0x10a')]){var _0x39dd99=[];for(var _0x5ab560=0x0;_0x5ab560<_0x1de26d[_0x0b44('0x109')][_0x0b44('0x10a')][_0x0b44('0x4a')];_0x5ab560++){var _0x4aa4e6=_0x1de26d['Interval'][_0x0b44('0x10a')][_0x5ab560][_0x0b44('0x39')]({'plain':!![]});_0x39dd99[_0x0b44('0xbf')](iftimePromise(_0x4aa4e6,_0x1de26d));}return BPromise['all'](_0x39dd99)['then'](function(_0x38d62f){return _['some'](_0x38d62f);});}else{return!![];}})['then'](function(_0x1fc1e1){var _0x78b0e2=fs[_0x0b44('0xd4')](path['join'](config['root'],_0x0b44('0x10f')),_0x0b44('0x110'));var _0x24f050={'remote':_0x1de26d['remote'],'query':querystring[_0x0b44('0x25')](_['merge'](_0x1de26d[_0x0b44('0x39')]({'plain':!![]}),{'customerIp':_0x356db7[_0x0b44('0x88')][_0x0b44('0xa8')]||_0x356db7['headers'][_0x0b44('0x111')]||_0x356db7['connection']['remoteAddress']||_0x356db7['ip'],'referer':_0x356db7[_0x0b44('0x88')][_0x0b44('0xac')],'openedInteractions':_0x19bc03,'maxInteractions':_0xd423a0,'virtual':_0x314db0['virtual'],'online':_0x1fc1e1,'custom':_0x314db0}))[_0x0b44('0x112')](/'/g,'\x5c\x27')};_0x13aff7[_0x0b44('0x3c')](ejs[_0x0b44('0xd6')](Mustache[_0x0b44('0xd6')](_0x78b0e2,_0x24f050),{'proactiveActions':_0x217e2e,'alignment':_0x1de26d[_0x0b44('0x113')],'verticalAlignment':_0x1de26d[_0x0b44('0x114')],'div_color':_0x1de26d[_0x0b44('0xfd')],'text_color':_0x1de26d[_0x0b44('0x115')],'button_color':_0x1de26d[_0x0b44('0x116')],'background_color':_0x1de26d[_0x0b44('0x117')]}));})[_0x0b44('0x2b')](handleError(_0x13aff7,null));};exports[_0x0b44('0x118')]=function(_0x3bbc6e,_0x3788c8,_0x3e829f){return db[_0x0b44('0x41')]['findOne']({'where':{'id':_0x3bbc6e[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x3788c8,null))[_0x0b44('0x37')](function(_0x51da78){if(_0x51da78){return db['sequelize'][_0x0b44('0x119')](function(_0x579071){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x3bbc6e[_0x0b44('0x58')]['id']},'transaction':_0x579071})['then'](function(_0x1fbdb1){var _0x37a47d=_['map'](_0x3bbc6e[_0x0b44('0x5c')],function(_0x24b43d){_0x24b43d[_0x0b44('0x62')]=_0x3bbc6e[_0x0b44('0x58')]['id'];return _0x24b43d;});return db['ChatApplication']['bulkCreate'](_0x37a47d,{'transaction':_0x579071});});})[_0x0b44('0x37')](function(){return db[_0x0b44('0x9c')][_0x0b44('0x11a')]({'where':{'ChatWebsiteId':_0x3bbc6e[_0x0b44('0x58')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x3788c8,null))['catch'](handleError(_0x3788c8,null));};exports[_0x0b44('0x11b')]=function(_0x1668e8,_0x160020,_0xbb589d){var _0x37ed1a={};var _0xa71b49={};var _0x4bac03;var _0x308406;return db['ChatWebsite'][_0x0b44('0x6b')]({'where':{'id':_0x1668e8[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x160020,null))['then'](function(_0x4a98b4){if(_0x4a98b4){_0x4bac03=_0x4a98b4;_0xa71b49[_0x0b44('0x47')]=_[_0x0b44('0x59')](db[_0x0b44('0x9c')][_0x0b44('0x42')]);_0xa71b49['query']=_[_0x0b44('0x59')](_0x1668e8[_0x0b44('0x44')]);_0xa71b49['filters']=_[_0x0b44('0x46')](_0xa71b49['model'],_0xa71b49[_0x0b44('0x44')]);_0x37ed1a['attributes']=_[_0x0b44('0x46')](_0xa71b49[_0x0b44('0x47')],qs[_0x0b44('0x49')](_0x1668e8[_0x0b44('0x44')][_0x0b44('0x49')]));_0x37ed1a['attributes']=_0x37ed1a[_0x0b44('0x48')]['length']?_0x37ed1a[_0x0b44('0x48')]:_0xa71b49[_0x0b44('0x47')];_0x37ed1a['order']=qs[_0x0b44('0x4d')](_0x1668e8[_0x0b44('0x44')][_0x0b44('0x4d')]);_0x37ed1a[_0x0b44('0x50')]=qs[_0x0b44('0x45')](_['pick'](_0x1668e8[_0x0b44('0x44')],_0xa71b49[_0x0b44('0x45')]));if(_0x1668e8['query'][_0x0b44('0x4f')]){_0x37ed1a['where']=_[_0x0b44('0x52')](_0x37ed1a[_0x0b44('0x50')],{'$or':_[_0x0b44('0x40')](_0x37ed1a[_0x0b44('0x48')],function(_0xc7dfac){var _0xa6ee67={};_0xa6ee67[_0xc7dfac]={'$like':'%'+_0x1668e8[_0x0b44('0x44')][_0x0b44('0x4f')]+'%'};return _0xa6ee67;})});}_0x37ed1a=_[_0x0b44('0x52')]({},_0x37ed1a,_0x1668e8[_0x0b44('0x53')]);return _0x4bac03['getApplications'](_0x37ed1a);}})['then'](function(_0x369a0c){if(_0x369a0c){_0x308406=_0x369a0c[_0x0b44('0x4a')];if(!_0x1668e8['query'][_0x0b44('0x4b')](_0x0b44('0x4c'))){_0x37ed1a['limit']=qs[_0x0b44('0x31')](_0x1668e8[_0x0b44('0x44')]['limit']);_0x37ed1a[_0x0b44('0x2f')]=qs[_0x0b44('0x2f')](_0x1668e8['query']['offset']);}return _0x4bac03[_0x0b44('0x11b')](_0x37ed1a);}})[_0x0b44('0x37')](function(_0x4855f6){if(_0x4855f6){return _0x4855f6?{'count':_0x308406,'rows':_0x4855f6}:null;}})[_0x0b44('0x37')](respondWithResult(_0x160020,null))[_0x0b44('0x2b')](handleError(_0x160020,null));};exports['addProactiveActions']=function(_0x3be6e6,_0x5cf3db,_0x51b169){return db[_0x0b44('0x11c')][_0x0b44('0x5a')]({'where':{'id':_0x3be6e6[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x5cf3db,null))[_0x0b44('0x37')](function(_0x1a2e18){if(_0x1a2e18){return _0x1a2e18[_0x0b44('0x11d')](_0x3be6e6['body']['ids'],_[_0x0b44('0xf9')](_0x3be6e6[_0x0b44('0x5c')],[_0x0b44('0x67'),'id'])||{});}})[_0x0b44('0x37')](respondWithResult(_0x5cf3db,null))['catch'](handleError(_0x5cf3db,null));};exports['getProactiveActions']=function(_0x56af09,_0x42d9c6,_0x29a364){var _0x2ad4dc={};var _0x3be7d4={};var _0xca8ef1;var _0x5a3149;return db['ChatWebsite'][_0x0b44('0x6b')]({'where':{'id':_0x56af09[_0x0b44('0x58')]['id']}})['then'](handleEntityNotFound(_0x42d9c6,null))[_0x0b44('0x37')](function(_0x119264){if(_0x119264){_0xca8ef1=_0x119264;_0x3be7d4['model']=_['keys'](db['ChatProactiveAction'][_0x0b44('0x42')]);_0x3be7d4[_0x0b44('0x44')]=_[_0x0b44('0x59')](_0x56af09['query']);_0x3be7d4[_0x0b44('0x45')]=_['intersection'](_0x3be7d4[_0x0b44('0x47')],_0x3be7d4[_0x0b44('0x44')]);_0x2ad4dc[_0x0b44('0x48')]=_[_0x0b44('0x46')](_0x3be7d4[_0x0b44('0x47')],qs[_0x0b44('0x49')](_0x56af09[_0x0b44('0x44')]['fields']));_0x2ad4dc[_0x0b44('0x48')]=_0x2ad4dc[_0x0b44('0x48')][_0x0b44('0x4a')]?_0x2ad4dc[_0x0b44('0x48')]:_0x3be7d4[_0x0b44('0x47')];_0x2ad4dc[_0x0b44('0x65')]=qs[_0x0b44('0x4d')](_0x56af09[_0x0b44('0x44')]['sort']);_0x2ad4dc[_0x0b44('0x50')]=qs['filters'](_[_0x0b44('0x4e')](_0x56af09[_0x0b44('0x44')],_0x3be7d4[_0x0b44('0x45')]));if(_0x56af09[_0x0b44('0x44')][_0x0b44('0x4f')]){_0x2ad4dc['where']=_['merge'](_0x2ad4dc[_0x0b44('0x50')],{'$or':_['map'](_0x2ad4dc[_0x0b44('0x48')],function(_0x56b881){var _0x1db75f={};_0x1db75f[_0x56b881]={'$like':'%'+_0x56af09[_0x0b44('0x44')][_0x0b44('0x4f')]+'%'};return _0x1db75f;})});}_0x2ad4dc=_['merge']({},_0x2ad4dc,_0x56af09[_0x0b44('0x53')]);return _0xca8ef1['getProactiveActions'](_0x2ad4dc);}})[_0x0b44('0x37')](function(_0x4e4200){if(_0x4e4200){_0x5a3149=_0x4e4200[_0x0b44('0x4a')];if(!_0x56af09[_0x0b44('0x44')]['hasOwnProperty'](_0x0b44('0x4c'))){_0x2ad4dc[_0x0b44('0x31')]=qs['limit'](_0x56af09[_0x0b44('0x44')]['limit']);_0x2ad4dc[_0x0b44('0x2f')]=qs[_0x0b44('0x2f')](_0x56af09[_0x0b44('0x44')][_0x0b44('0x2f')]);}return _0xca8ef1['getProactiveActions'](_0x2ad4dc);}})['then'](function(_0x4229e3){if(_0x4229e3){return _0x4229e3?{'count':_0x5a3149,'rows':_0x4229e3}:null;}})[_0x0b44('0x37')](respondWithResult(_0x42d9c6,null))[_0x0b44('0x2b')](handleError(_0x42d9c6,null));};exports['getFields']=function(_0x21a037,_0xe7e386,_0x7d7807){var _0x399762=_0x21a037[_0x0b44('0x44')][_0x0b44('0x11e')]===_0x0b44('0x11f')?'offlineForm':_0x0b44('0x120');return db[_0x0b44('0x41')][_0x0b44('0x5a')]({'attributes':['id',_0x399762],'where':{'id':_0x21a037[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0xe7e386,null))['then'](function(_0x97cd52){if(_0x97cd52){var _0xad603a=_0x97cd52[_0x399762];var _0x57e184=_0xad603a&&_0xad603a[_0x0b44('0x121')]?_0xad603a[_0x0b44('0x121')]:[];_0xe7e386[_0x0b44('0x3c')]({'fromKey':_[_0x0b44('0x7c')](_0xad603a[_0x0b44('0x122')])?undefined:_0xad603a[_0x0b44('0x122')],'count':_0x57e184['length'],'rows':_0x57e184});}})[_0x0b44('0x2b')](handleError(_0xe7e386,null));};exports[_0x0b44('0x123')]=function(_0x5413f6,_0x3eef05,_0x59bc13){var _0x965c3c={'raw':![],'where':{}};var _0x3611dd={};var _0x4dda9a={'count':0x0,'rows':[]};return db[_0x0b44('0x41')][_0x0b44('0x6b')]({'where':{'id':_0x5413f6[_0x0b44('0x58')]['id']}})['then'](handleEntityNotFound(_0x3eef05,null))[_0x0b44('0x37')](function(_0x524bde){if(_0x524bde){_0x3611dd[_0x0b44('0x47')]=_[_0x0b44('0x59')](db[_0x0b44('0xd8')][_0x0b44('0x42')]);_0x3611dd['query']=_[_0x0b44('0x59')](_0x5413f6[_0x0b44('0x44')]);_0x3611dd['filters']=_[_0x0b44('0x46')](_0x3611dd[_0x0b44('0x47')],_0x3611dd[_0x0b44('0x44')]);_0x965c3c[_0x0b44('0x48')]=_[_0x0b44('0x46')](_0x3611dd[_0x0b44('0x47')],qs['fields'](_0x5413f6['query']['fields']));_0x965c3c[_0x0b44('0x48')]=_0x965c3c['attributes'][_0x0b44('0x4a')]?_0x965c3c['attributes']:_0x3611dd[_0x0b44('0x47')];if(!_0x5413f6[_0x0b44('0x44')][_0x0b44('0x4b')](_0x0b44('0x4c'))){_0x965c3c[_0x0b44('0x31')]=qs[_0x0b44('0x31')](_0x5413f6[_0x0b44('0x44')]['limit']);_0x965c3c[_0x0b44('0x2f')]=qs[_0x0b44('0x2f')](_0x5413f6['query'][_0x0b44('0x2f')]);}_0x965c3c['order']=qs[_0x0b44('0x4d')](_0x5413f6[_0x0b44('0x44')][_0x0b44('0x4d')]);_0x965c3c[_0x0b44('0x50')]=qs['filters'](_['pick'](_0x5413f6[_0x0b44('0x44')],_0x3611dd[_0x0b44('0x45')]));_0x965c3c[_0x0b44('0x50')][_0x0b44('0x62')]=_0x524bde['id'];if(_0x5413f6[_0x0b44('0x44')][_0x0b44('0x4f')]){_0x965c3c['where']=_['merge'](_0x965c3c['where'],{'$or':_['map'](_0x965c3c[_0x0b44('0x48')],function(_0xbf1c9){var _0x3dfe76={};_0x3dfe76[_0xbf1c9]={'$like':'%'+_0x5413f6[_0x0b44('0x44')][_0x0b44('0x4f')]+'%'};return _0x3dfe76;})});}_0x965c3c=_[_0x0b44('0x52')]({},_0x965c3c,_0x5413f6['options']);return db[_0x0b44('0xd8')][_0x0b44('0x32')]({'where':_0x965c3c['where']})['then'](function(_0x62c5fb){_0x4dda9a['count']=_0x62c5fb;if(_0x5413f6[_0x0b44('0x44')][_0x0b44('0x54')]){_0x965c3c[_0x0b44('0x55')]=[{'all':!![]}];}else{_0x965c3c[_0x0b44('0x55')]=[{'model':db[_0x0b44('0x8b')],'as':_0x0b44('0x124'),'required':![]},{'model':db['Attachment'],'as':_0x0b44('0x125'),'required':![]}];}return db[_0x0b44('0xd8')][_0x0b44('0x56')](_0x965c3c);})[_0x0b44('0x37')](function(_0x34039c){_0x4dda9a[_0x0b44('0x57')]=_0x34039c;return _0x4dda9a;});}})[_0x0b44('0x37')](respondWithFilteredResult(_0x3eef05,_0x965c3c))[_0x0b44('0x2b')](handleError(_0x3eef05,null));};exports['addAgents']=function(_0x390fa3,_0x40de38,_0x5d3727){return db[_0x0b44('0x41')][_0x0b44('0x5a')]({'where':{'id':_0x390fa3[_0x0b44('0x58')]['id']}})[_0x0b44('0x37')](handleEntityNotFound(_0x40de38,null))[_0x0b44('0x37')](function(_0x2e94a0){if(_0x2e94a0){return _0x2e94a0[_0x0b44('0x126')](_0x390fa3[_0x0b44('0x5c')]['ids'],_[_0x0b44('0xf9')](_0x390fa3[_0x0b44('0x5c')],[_0x0b44('0x67'),'id'])||{})[_0x0b44('0xbb')](function(_0x18abfe){for(var _0x37e88a=0x0;_0x37e88a<_0x390fa3[_0x0b44('0x5c')][_0x0b44('0x67')][_0x0b44('0x4a')];_0x37e88a+=0x1){socket[_0x0b44('0x127')](_0x0b44('0x128'),{'UserId':Number(_0x390fa3['body'][_0x0b44('0x67')][_0x37e88a]),'ChatWebsiteId':Number(_0x390fa3[_0x0b44('0x58')]['id'])});}return _0x18abfe;});}})[_0x0b44('0x37')](respondWithResult(_0x40de38,null))['catch'](handleError(_0x40de38,null));};exports['removeAgents']=function(_0x5f19ba,_0x296e82,_0x2426d9){return db['ChatWebsite']['find']({'where':{'id':_0x5f19ba[_0x0b44('0x58')]['id']}})['then'](handleEntityNotFound(_0x296e82,null))[_0x0b44('0x37')](function(_0x53b3ec){if(_0x53b3ec){return _0x53b3ec[_0x0b44('0x129')](_0x5f19ba[_0x0b44('0x44')][_0x0b44('0x67')])[_0x0b44('0x37')](function(){if(_[_0x0b44('0x12a')](_0x5f19ba[_0x0b44('0x44')][_0x0b44('0x67')])){for(var _0x1dfbe5=0x0;_0x1dfbe5<_0x5f19ba[_0x0b44('0x44')][_0x0b44('0x67')][_0x0b44('0x4a')];_0x1dfbe5+=0x1){socket[_0x0b44('0x127')](_0x0b44('0x12b'),{'UserId':Number(_0x5f19ba[_0x0b44('0x44')][_0x0b44('0x67')][_0x1dfbe5]),'ChatWebsiteId':Number(_0x5f19ba['params']['id'])});}}else{socket[_0x0b44('0x127')](_0x0b44('0x12b'),{'UserId':Number(_0x5f19ba[_0x0b44('0x44')][_0x0b44('0x67')]),'ChatWebsiteId':Number(_0x5f19ba[_0x0b44('0x58')]['id'])});}});}})[_0x0b44('0x37')](respondWithStatusCode(_0x296e82,null))[_0x0b44('0x2b')](handleError(_0x296e82,null));};exports[_0x0b44('0x12c')]=function(_0x52813e,_0x457e19,_0x42b60e){var _0x32d175={};var _0x494784={};var _0x23fa0b;var _0x403250;return db[_0x0b44('0x41')]['findOne']({'where':{'id':_0x52813e['params']['id']}})['then'](handleEntityNotFound(_0x457e19,null))[_0x0b44('0x37')](function(_0x12d9d6){if(_0x12d9d6){_0x23fa0b=_0x12d9d6;_0x494784['model']=_[_0x0b44('0x59')](db['User'][_0x0b44('0x42')]);_0x494784[_0x0b44('0x44')]=_[_0x0b44('0x59')](_0x52813e['query']);_0x494784['filters']=_[_0x0b44('0x46')](_0x494784[_0x0b44('0x47')],_0x494784[_0x0b44('0x44')]);_0x32d175['attributes']=_[_0x0b44('0x46')](_0x494784[_0x0b44('0x47')],qs['fields'](_0x52813e['query']['fields']));_0x32d175[_0x0b44('0x48')]=_0x32d175[_0x0b44('0x48')][_0x0b44('0x4a')]?_0x32d175['attributes']:_0x494784['model'];_0x32d175[_0x0b44('0x65')]=qs['sort'](_0x52813e[_0x0b44('0x44')][_0x0b44('0x4d')]);_0x32d175[_0x0b44('0x50')]=qs[_0x0b44('0x45')](_['pick'](_0x52813e[_0x0b44('0x44')],_0x494784[_0x0b44('0x45')]));if(_0x52813e[_0x0b44('0x44')][_0x0b44('0x4f')]){_0x32d175[_0x0b44('0x50')]=_[_0x0b44('0x52')](_0x32d175[_0x0b44('0x50')],{'$or':_[_0x0b44('0x40')](_0x32d175[_0x0b44('0x48')],function(_0x302406){var _0x1a9a38={};_0x1a9a38[_0x302406]={'$like':'%'+_0x52813e[_0x0b44('0x44')][_0x0b44('0x4f')]+'%'};return _0x1a9a38;})});}_0x32d175=_['merge']({},_0x32d175,_0x52813e[_0x0b44('0x53')]);return _0x23fa0b[_0x0b44('0x12c')](_0x32d175);}})[_0x0b44('0x37')](function(_0x44f6fb){if(_0x44f6fb){_0x403250=_0x44f6fb[_0x0b44('0x4a')];if(!_0x52813e[_0x0b44('0x44')]['hasOwnProperty']('nolimit')){_0x32d175[_0x0b44('0x31')]=qs[_0x0b44('0x31')](_0x52813e[_0x0b44('0x44')][_0x0b44('0x31')]);_0x32d175[_0x0b44('0x2f')]=qs['offset'](_0x52813e[_0x0b44('0x44')][_0x0b44('0x2f')]);}return _0x23fa0b[_0x0b44('0x12c')](_0x32d175);}})[_0x0b44('0x37')](function(_0x16db0e){if(_0x16db0e){return _0x16db0e?{'count':_0x403250,'rows':_0x16db0e}:null;}})[_0x0b44('0x37')](respondWithResult(_0x457e19,null))[_0x0b44('0x2b')](handleError(_0x457e19,null));};
\ No newline at end of file
+var _0xb023=['customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','account','applications','list','orderBy','asc','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','lastName','messageId','created','autoclose','close','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','Start','startRouting','EventManager','offline','files','CmContact','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','transaction','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','rows','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','push','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','sequelize','ChatApplication','priority','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','online','false','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','then','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','ChatWebsite,\x20%s,\x20%s','result','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','Pause','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','ChatWebsite','includeAll','findAll','show','find','create','body','user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','include','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar'];(function(_0x1a2377,_0x208221){var _0x4dab07=function(_0x26f5d2){while(--_0x26f5d2){_0x1a2377['push'](_0x1a2377['shift']());}};_0x4dab07(++_0x208221);}(_0xb023,0xc6));var _0x3b02=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xb023[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0x3b02('0x0'));var rimraf=require(_0x3b02('0x1'));var zipdir=require(_0x3b02('0x2'));var jsonpatch=require(_0x3b02('0x3'));var rp=require(_0x3b02('0x4'));var moment=require(_0x3b02('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3b02('0x6'));var util=require(_0x3b02('0x7'));var path=require(_0x3b02('0x8'));var sox=require(_0x3b02('0x9'));var csv=require(_0x3b02('0xa'));var ejs=require(_0x3b02('0xb'));var fs=require('fs');var fs_extra=require(_0x3b02('0xc'));var _=require('lodash');var squel=require(_0x3b02('0xd'));var crypto=require(_0x3b02('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3b02('0xa'));var querystring=require('querystring');var Papa=require(_0x3b02('0xf'));var Redis=require(_0x3b02('0x10'));var authService=require(_0x3b02('0x11'));var qs=require(_0x3b02('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b02('0x13'));var logger=require('../../config/logger')(_0x3b02('0x14'));var utils=require('../../config/utils');var config=require(_0x3b02('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b02('0x16'))['db'];config[_0x3b02('0x17')]=_[_0x3b02('0x18')](config[_0x3b02('0x17')],{'host':_0x3b02('0x19'),'port':0x18eb});var socket=require(_0x3b02('0x1a'))(new Redis(config[_0x3b02('0x17')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0x3b02('0x1b'));var client=jayson[_0x3b02('0x1c')][_0x3b02('0x1d')]({'port':0x232c});var client9002=jayson[_0x3b02('0x1c')][_0x3b02('0x1d')]({'port':0x232a});var client9003=jayson[_0x3b02('0x1c')][_0x3b02('0x1d')]({'port':0x232b});var client9001=jayson[_0x3b02('0x1c')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3b6ea8,_0x28a6cd,_0x5c8812,_0x5a795a){return new BPromise(function(_0x1e4b8b,_0x3bf233){var _0x4e919f=_0x5a795a||client;return _0x4e919f['request'](_0x3b6ea8,_0x5c8812)[_0x3b02('0x1e')](function(_0x37bb8b){logger[_0x3b02('0x1f')]('ChatWebsite,\x20%s,\x20%s',_0x28a6cd,_0x3b02('0x20'));logger['debug'](_0x3b02('0x21'),_0x28a6cd,_0x3b02('0x20'),JSON['stringify'](_0x37bb8b));if(_0x37bb8b['error']){if(_0x37bb8b[_0x3b02('0x22')][_0x3b02('0x23')]===0x1f4){logger[_0x3b02('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x28a6cd,_0x37bb8b[_0x3b02('0x22')]['message']);return _0x3bf233(_0x37bb8b['error'][_0x3b02('0x24')]);}logger['error'](_0x3b02('0x25'),_0x28a6cd,_0x37bb8b[_0x3b02('0x22')]['message']);return _0x1e4b8b(_0x37bb8b['error'][_0x3b02('0x24')]);}else{logger[_0x3b02('0x1f')](_0x3b02('0x25'),_0x28a6cd,'request\x20sent');_0x1e4b8b(_0x37bb8b[_0x3b02('0x26')][_0x3b02('0x24')]);}})['catch'](function(_0x1ca98c){logger[_0x3b02('0x22')](_0x3b02('0x25'),_0x28a6cd,_0x1ca98c);_0x3bf233(_0x1ca98c);});});}function respondWithStatusCode(_0x588c12,_0x6fefeb){_0x6fefeb=_0x6fefeb||0xcc;return function(_0x2dc6a5){if(_0x2dc6a5){return _0x588c12['sendStatus'](_0x6fefeb);}return _0x588c12[_0x3b02('0x27')](_0x6fefeb)[_0x3b02('0x28')]();};}function respondWithResult(_0x44ba36,_0x478afe){_0x478afe=_0x478afe||0xc8;return function(_0x4a8ab3){if(_0x4a8ab3){return _0x44ba36[_0x3b02('0x27')](_0x478afe)['json'](_0x4a8ab3);}};}function respondWithFilteredResult(_0x26adbd,_0x577147){return function(_0x2d4e5b){if(_0x2d4e5b){var _0x1e2d74=typeof _0x577147[_0x3b02('0x29')]===_0x3b02('0x2a')&&typeof _0x577147[_0x3b02('0x2b')]===_0x3b02('0x2a');var _0x563326=_0x2d4e5b[_0x3b02('0x2c')];var _0x2810e8=_0x1e2d74?0x0:_0x577147[_0x3b02('0x29')];var _0x1209cd=_0x1e2d74?_0x2d4e5b['count']:_0x577147['offset']+_0x577147[_0x3b02('0x2b')];var _0x16ddfc;if(_0x1209cd>=_0x563326){_0x1209cd=_0x563326;_0x16ddfc=0xc8;}else{_0x16ddfc=0xce;}_0x26adbd[_0x3b02('0x27')](_0x16ddfc);return _0x26adbd[_0x3b02('0x2d')](_0x3b02('0x2e'),_0x2810e8+'-'+_0x1209cd+'/'+_0x563326)[_0x3b02('0x2f')](_0x2d4e5b);}return null;};}function patchUpdates(_0x5ea983){return function(_0x16db39){try{jsonpatch['apply'](_0x16db39,_0x5ea983,!![]);}catch(_0x2ba26f){return BPromise[_0x3b02('0x30')](_0x2ba26f);}return _0x16db39[_0x3b02('0x31')]();};}function saveUpdates(_0x4a3980,_0x5772d8){return function(_0x1c9449){if(_0x1c9449){return _0x1c9449[_0x3b02('0x32')](_0x4a3980)[_0x3b02('0x1e')](function(_0x20abe5){return _0x20abe5;});}return null;};}function removeEntity(_0x483b8d,_0x37c4de){return function(_0x25a388){if(_0x25a388){return _0x25a388['destroy']()[_0x3b02('0x1e')](function(){var _0x8019ad=_0x25a388[_0x3b02('0x33')]({'plain':!![]});var _0xffc88d=_0x3b02('0x34');return db[_0x3b02('0x35')][_0x3b02('0x36')]({'where':{'type':_0xffc88d,'resourceId':_0x8019ad['id']}})[_0x3b02('0x1e')](function(){return _0x25a388;});})[_0x3b02('0x1e')](function(){_0x483b8d[_0x3b02('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54d1e7,_0x5ccdd7){return function(_0x5a67ce){if(!_0x5a67ce){_0x54d1e7[_0x3b02('0x37')](0x194);}return _0x5a67ce;};}function handleError(_0x183ae8,_0x144b81){_0x144b81=_0x144b81||0x1f4;return function(_0x578d2c){logger[_0x3b02('0x22')](_0x578d2c[_0x3b02('0x38')]);if(_0x578d2c[_0x3b02('0x39')]){delete _0x578d2c[_0x3b02('0x39')];}_0x183ae8[_0x3b02('0x27')](_0x144b81)[_0x3b02('0x3a')](_0x578d2c);};}exports['index']=function(_0x386090,_0x4adf38){var _0x53eb4b={'include':[{'model':db[_0x3b02('0x3b')],'as':'mandatoryDispositionPause'}]},_0x3381ef={},_0x34109c={'count':0x0,'rows':[]};var _0xe90557=_['map'](db['ChatWebsite'][_0x3b02('0x3c')],function(_0x52d27a){return{'name':_0x52d27a['fieldName'],'type':_0x52d27a[_0x3b02('0x3d')]['key']};});_0x3381ef[_0x3b02('0x3e')]=_[_0x3b02('0x3f')](_0xe90557,_0x3b02('0x39'));_0x3381ef[_0x3b02('0x40')]=_[_0x3b02('0x41')](_0x386090[_0x3b02('0x40')]);_0x3381ef[_0x3b02('0x42')]=_[_0x3b02('0x43')](_0x3381ef[_0x3b02('0x3e')],_0x3381ef[_0x3b02('0x40')]);_0x53eb4b[_0x3b02('0x44')]=_[_0x3b02('0x43')](_0x3381ef['model'],qs[_0x3b02('0x45')](_0x386090[_0x3b02('0x40')][_0x3b02('0x45')]));_0x53eb4b[_0x3b02('0x44')]=_0x53eb4b[_0x3b02('0x44')][_0x3b02('0x46')]?_0x53eb4b[_0x3b02('0x44')]:_0x3381ef[_0x3b02('0x3e')];if(!_0x386090[_0x3b02('0x40')][_0x3b02('0x47')](_0x3b02('0x48'))){_0x53eb4b['limit']=qs[_0x3b02('0x2b')](_0x386090[_0x3b02('0x40')][_0x3b02('0x2b')]);_0x53eb4b['offset']=qs[_0x3b02('0x29')](_0x386090[_0x3b02('0x40')][_0x3b02('0x29')]);}_0x53eb4b['order']=qs[_0x3b02('0x49')](_0x386090[_0x3b02('0x40')][_0x3b02('0x49')]);_0x53eb4b['where']=qs[_0x3b02('0x42')](_[_0x3b02('0x4a')](_0x386090['query'],_0x3381ef['filters']),_0xe90557);if(_0x386090[_0x3b02('0x40')]['filter']){_0x53eb4b[_0x3b02('0x4b')]=_[_0x3b02('0x4c')](_0x53eb4b['where'],{'$or':_[_0x3b02('0x3f')](_0xe90557,function(_0x2fbec3){if(_0x2fbec3['type']!==_0x3b02('0x4d')){var _0x246de1={};_0x246de1[_0x2fbec3[_0x3b02('0x39')]]={'$like':'%'+_0x386090[_0x3b02('0x40')][_0x3b02('0x4e')]+'%'};return _0x246de1;}})});}_0x53eb4b=_[_0x3b02('0x4c')]({},_0x53eb4b,_0x386090[_0x3b02('0x4f')]);var _0x40dce0={'where':_0x53eb4b[_0x3b02('0x4b')]};return db[_0x3b02('0x50')]['count'](_0x40dce0)[_0x3b02('0x1e')](function(_0x5b25f5){_0x34109c['count']=_0x5b25f5;if(_0x386090[_0x3b02('0x40')][_0x3b02('0x51')]){_0x53eb4b['include']=[{'all':!![]}];}return db[_0x3b02('0x50')][_0x3b02('0x52')](_0x53eb4b);})['then'](function(_0x35cbc3){_0x34109c['rows']=_0x35cbc3;return _0x34109c;})[_0x3b02('0x1e')](respondWithFilteredResult(_0x4adf38,_0x53eb4b))['catch'](handleError(_0x4adf38,null));};exports[_0x3b02('0x53')]=function(_0x1e2784,_0x3fdece){var _0x2976c3={'raw':![],'where':{'id':_0x1e2784['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5c10f7={};_0x5c10f7['model']=_[_0x3b02('0x41')](db[_0x3b02('0x50')][_0x3b02('0x3c')]);_0x5c10f7[_0x3b02('0x40')]=_[_0x3b02('0x41')](_0x1e2784[_0x3b02('0x40')]);_0x5c10f7[_0x3b02('0x42')]=_[_0x3b02('0x43')](_0x5c10f7[_0x3b02('0x3e')],_0x5c10f7[_0x3b02('0x40')]);_0x2976c3['attributes']=_['intersection'](_0x5c10f7['model'],qs[_0x3b02('0x45')](_0x1e2784['query'][_0x3b02('0x45')]));_0x2976c3[_0x3b02('0x44')]=_0x2976c3['attributes'][_0x3b02('0x46')]?_0x2976c3[_0x3b02('0x44')]:_0x5c10f7[_0x3b02('0x3e')];if(_0x1e2784[_0x3b02('0x40')][_0x3b02('0x51')]){_0x2976c3['include']=[{'all':!![]}];}_0x2976c3=_[_0x3b02('0x4c')]({},_0x2976c3,_0x1e2784[_0x3b02('0x4f')]);return db[_0x3b02('0x50')][_0x3b02('0x54')](_0x2976c3)[_0x3b02('0x1e')](handleEntityNotFound(_0x3fdece,null))[_0x3b02('0x1e')](respondWithResult(_0x3fdece,null))['catch'](handleError(_0x3fdece,null));};exports[_0x3b02('0x55')]=function(_0x162288,_0x1236d2){return db[_0x3b02('0x50')]['create'](_0x162288[_0x3b02('0x56')],{})[_0x3b02('0x1e')](function(_0x105cd9){var _0x3f9b7a=_0x162288[_0x3b02('0x57')][_0x3b02('0x33')]({'plain':!![]});if(!_0x3f9b7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f9b7a['role']==='user'){var _0x9dccad=_0x105cd9[_0x3b02('0x33')]({'plain':!![]});var _0x39a0db=_0x3b02('0x34');return db[_0x3b02('0x58')][_0x3b02('0x54')]({'where':{'name':_0x39a0db,'userProfileId':_0x3f9b7a[_0x3b02('0x59')]},'raw':!![]})[_0x3b02('0x1e')](function(_0x17c928){if(_0x17c928&&_0x17c928['autoAssociation']===0x0){return db[_0x3b02('0x35')]['create']({'name':_0x9dccad[_0x3b02('0x39')],'resourceId':_0x9dccad['id'],'type':_0x17c928['name'],'sectionId':_0x17c928['id']},{})['then'](function(){return _0x105cd9;});}else{return _0x105cd9;}})[_0x3b02('0x5a')](function(_0xbee360){logger[_0x3b02('0x22')](_0x3b02('0x5b'),_0xbee360);throw _0xbee360;});}return _0x105cd9;})[_0x3b02('0x1e')](respondWithResult(_0x1236d2,0xc9))['catch'](handleError(_0x1236d2,null));};exports[_0x3b02('0x32')]=function(_0x5133d1,_0x3001c3){if(_0x5133d1[_0x3b02('0x56')]['id']){delete _0x5133d1[_0x3b02('0x56')]['id'];}return db['ChatWebsite'][_0x3b02('0x54')]({'where':{'id':_0x5133d1[_0x3b02('0x5c')]['id']},'include':[{'model':db[_0x3b02('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x3b02('0x1e')](handleEntityNotFound(_0x3001c3,null))[_0x3b02('0x1e')](saveUpdates(_0x5133d1[_0x3b02('0x56')],null))[_0x3b02('0x1e')](respondWithResult(_0x3001c3,null))[_0x3b02('0x5a')](handleError(_0x3001c3,null));};exports[_0x3b02('0x36')]=function(_0x3996b9,_0x4e29d0){return db[_0x3b02('0x50')][_0x3b02('0x54')]({'where':{'id':_0x3996b9[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x4e29d0,null))[_0x3b02('0x1e')](removeEntity(_0x4e29d0,null))[_0x3b02('0x5a')](handleError(_0x4e29d0,null));};exports[_0x3b02('0x5d')]=function(_0x837b61,_0xee4a6){return db[_0x3b02('0x50')][_0x3b02('0x5d')]()['then'](respondWithResult(_0xee4a6,null))[_0x3b02('0x5a')](handleError(_0xee4a6,null));};exports[_0x3b02('0x5e')]=function(_0x3feb09,_0x52e9b7,_0x275707){if(_0x3feb09['body']['id']){delete _0x3feb09[_0x3b02('0x56')]['id'];}return db[_0x3b02('0x50')]['find']({'where':{'id':_0x3feb09['params']['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x52e9b7,null))[_0x3b02('0x1e')](function(_0x467b22){if(_0x467b22){_0x3feb09[_0x3b02('0x56')][_0x3b02('0x5f')]=_0x467b22['id'];return db[_0x3b02('0x60')]['create'](_0x3feb09['body']);}})['then'](respondWithResult(_0x52e9b7,null))[_0x3b02('0x5a')](handleError(_0x52e9b7,null));};exports['getDispositions']=function(_0x1b986a,_0x233bf8,_0x150e4d){var _0x5bccad={'raw':![],'where':{}};var _0x3ae62b={};var _0x43f3f6={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3b02('0x61')]({'where':{'id':_0x1b986a['params']['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x233bf8,null))[_0x3b02('0x1e')](function(_0xace968){if(_0xace968){_0x3ae62b[_0x3b02('0x3e')]=_[_0x3b02('0x41')](db[_0x3b02('0x60')][_0x3b02('0x3c')]);_0x3ae62b[_0x3b02('0x40')]=_[_0x3b02('0x41')](_0x1b986a[_0x3b02('0x40')]);_0x3ae62b[_0x3b02('0x42')]=_['intersection'](_0x3ae62b[_0x3b02('0x3e')],_0x3ae62b[_0x3b02('0x40')]);_0x5bccad[_0x3b02('0x44')]=_['intersection'](_0x3ae62b[_0x3b02('0x3e')],qs['fields'](_0x1b986a['query'][_0x3b02('0x45')]));_0x5bccad[_0x3b02('0x44')]=_0x5bccad[_0x3b02('0x44')][_0x3b02('0x46')]?_0x5bccad['attributes']:_0x3ae62b[_0x3b02('0x3e')];if(!_0x1b986a[_0x3b02('0x40')]['hasOwnProperty'](_0x3b02('0x48'))){_0x5bccad[_0x3b02('0x2b')]=qs[_0x3b02('0x2b')](_0x1b986a[_0x3b02('0x40')][_0x3b02('0x2b')]);_0x5bccad[_0x3b02('0x29')]=qs[_0x3b02('0x29')](_0x1b986a[_0x3b02('0x40')][_0x3b02('0x29')]);}_0x5bccad[_0x3b02('0x62')]=qs['sort'](_0x1b986a[_0x3b02('0x40')]['sort']);_0x5bccad['where']=qs[_0x3b02('0x42')](_[_0x3b02('0x4a')](_0x1b986a[_0x3b02('0x40')],_0x3ae62b[_0x3b02('0x42')]));_0x5bccad['where'][_0x3b02('0x5f')]=_0xace968['id'];if(_0x1b986a['query'][_0x3b02('0x4e')]){_0x5bccad['where']=_['merge'](_0x5bccad['where'],{'$or':_[_0x3b02('0x3f')](_0x5bccad['attributes'],function(_0x418cd7){var _0xbeee3e={};_0xbeee3e[_0x418cd7]={'$like':'%'+_0x1b986a[_0x3b02('0x40')]['filter']+'%'};return _0xbeee3e;})});}_0x5bccad=_[_0x3b02('0x4c')]({},_0x5bccad,_0x1b986a[_0x3b02('0x4f')]);return db[_0x3b02('0x60')][_0x3b02('0x2c')]({'where':_0x5bccad[_0x3b02('0x4b')]})[_0x3b02('0x1e')](function(_0x39ebad){_0x43f3f6[_0x3b02('0x2c')]=_0x39ebad;if(_0x1b986a[_0x3b02('0x40')]['includeAll']){_0x5bccad['include']=[{'all':!![]}];}return db[_0x3b02('0x60')][_0x3b02('0x52')](_0x5bccad);})[_0x3b02('0x1e')](function(_0x639a9a){_0x43f3f6['rows']=_0x639a9a;return _0x43f3f6;});}})[_0x3b02('0x1e')](respondWithFilteredResult(_0x233bf8,_0x5bccad))[_0x3b02('0x5a')](handleError(_0x233bf8,null));};exports[_0x3b02('0x63')]=function(_0x4e0d52,_0x3614f,_0x1c51a8){return db[_0x3b02('0x50')][_0x3b02('0x54')]({'where':{'id':_0x4e0d52[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x3614f,null))[_0x3b02('0x1e')](function(_0x48481d){if(_0x48481d){return _0x48481d['removeDispositions'](_0x4e0d52[_0x3b02('0x40')][_0x3b02('0x64')]);}})[_0x3b02('0x1e')](respondWithStatusCode(_0x3614f,null))[_0x3b02('0x5a')](handleError(_0x3614f,null));};exports[_0x3b02('0x65')]=function(_0x1a03ce,_0x438505,_0x269295){if(_0x1a03ce['body']['id']){delete _0x1a03ce[_0x3b02('0x56')]['id'];}return db[_0x3b02('0x50')][_0x3b02('0x54')]({'where':{'id':_0x1a03ce[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x438505,null))[_0x3b02('0x1e')](function(_0x34556b){if(_0x34556b){_0x1a03ce['body'][_0x3b02('0x5f')]=_0x34556b['id'];return db[_0x3b02('0x66')]['create'](_0x1a03ce[_0x3b02('0x56')]);}})['then'](respondWithResult(_0x438505,null))[_0x3b02('0x5a')](handleError(_0x438505,null));};exports[_0x3b02('0x67')]=function(_0x56f34c,_0x430df9,_0xe0a7c6){var _0x4419cb={'raw':![],'where':{}};var _0x191fab={};var _0x171820={'count':0x0,'rows':[]};return db[_0x3b02('0x50')][_0x3b02('0x61')]({'where':{'id':_0x56f34c[_0x3b02('0x5c')]['id']}})['then'](handleEntityNotFound(_0x430df9,null))[_0x3b02('0x1e')](function(_0x2a838f){if(_0x2a838f){_0x191fab['model']=_[_0x3b02('0x41')](db[_0x3b02('0x66')][_0x3b02('0x3c')]);_0x191fab[_0x3b02('0x40')]=_[_0x3b02('0x41')](_0x56f34c['query']);_0x191fab[_0x3b02('0x42')]=_[_0x3b02('0x43')](_0x191fab['model'],_0x191fab[_0x3b02('0x40')]);_0x4419cb[_0x3b02('0x44')]=_[_0x3b02('0x43')](_0x191fab[_0x3b02('0x3e')],qs['fields'](_0x56f34c[_0x3b02('0x40')][_0x3b02('0x45')]));_0x4419cb[_0x3b02('0x44')]=_0x4419cb[_0x3b02('0x44')][_0x3b02('0x46')]?_0x4419cb['attributes']:_0x191fab[_0x3b02('0x3e')];if(!_0x56f34c['query']['hasOwnProperty'](_0x3b02('0x48'))){_0x4419cb['limit']=qs[_0x3b02('0x2b')](_0x56f34c[_0x3b02('0x40')][_0x3b02('0x2b')]);_0x4419cb['offset']=qs['offset'](_0x56f34c['query'][_0x3b02('0x29')]);}_0x4419cb[_0x3b02('0x62')]=qs[_0x3b02('0x49')](_0x56f34c[_0x3b02('0x40')][_0x3b02('0x49')]);_0x4419cb['where']=qs[_0x3b02('0x42')](_[_0x3b02('0x4a')](_0x56f34c[_0x3b02('0x40')],_0x191fab[_0x3b02('0x42')]));_0x4419cb[_0x3b02('0x4b')][_0x3b02('0x5f')]=_0x2a838f['id'];if(_0x56f34c[_0x3b02('0x40')][_0x3b02('0x4e')]){_0x4419cb[_0x3b02('0x4b')]=_[_0x3b02('0x4c')](_0x4419cb[_0x3b02('0x4b')],{'$or':_['map'](_0x4419cb['attributes'],function(_0x37e2ee){var _0x1c370b={};_0x1c370b[_0x37e2ee]={'$like':'%'+_0x56f34c[_0x3b02('0x40')][_0x3b02('0x4e')]+'%'};return _0x1c370b;})});}_0x4419cb=_[_0x3b02('0x4c')]({},_0x4419cb,_0x56f34c[_0x3b02('0x4f')]);return db['CannedAnswer'][_0x3b02('0x2c')]({'where':_0x4419cb[_0x3b02('0x4b')]})['then'](function(_0x359679){_0x171820[_0x3b02('0x2c')]=_0x359679;if(_0x56f34c[_0x3b02('0x40')]['includeAll']){_0x4419cb[_0x3b02('0x68')]=[{'all':!![]}];}return db[_0x3b02('0x66')]['findAll'](_0x4419cb);})[_0x3b02('0x1e')](function(_0x20bef5){_0x171820['rows']=_0x20bef5;return _0x171820;});}})['then'](respondWithFilteredResult(_0x430df9,_0x4419cb))['catch'](handleError(_0x430df9,null));};exports['removeAnswers']=function(_0x4d3420,_0x24f7cd,_0xc5567f){return db[_0x3b02('0x50')][_0x3b02('0x54')]({'where':{'id':_0x4d3420[_0x3b02('0x5c')]['id']}})['then'](handleEntityNotFound(_0x24f7cd,null))['then'](function(_0x52d79c){if(_0x52d79c){return _0x52d79c['removeAnswers'](_0x4d3420['query'][_0x3b02('0x64')]);}})[_0x3b02('0x1e')](respondWithStatusCode(_0x24f7cd,null))['catch'](handleError(_0x24f7cd,null));};exports[_0x3b02('0x69')]=function(_0x58fd44,_0x21ebf5,_0x55956c){_0x58fd44['body'][_0x3b02('0x6a')]=_0x58fd44[_0x3b02('0x6b')][_0x3b02('0x6c')];return db['ChatWebsite'][_0x3b02('0x54')]({'where':{'id':_0x58fd44[_0x3b02('0x5c')]['id']}})['then'](handleEntityNotFound(_0x21ebf5,null))[_0x3b02('0x1e')](saveUpdates(_0x58fd44[_0x3b02('0x56')],null))[_0x3b02('0x1e')](respondWithResult(_0x21ebf5,null))[_0x3b02('0x5a')](handleError(_0x21ebf5,null));};exports[_0x3b02('0x6d')]=function(_0x209a34,_0x28fbb1,_0x461a9c){_0x209a34[_0x3b02('0x56')][_0x3b02('0x6e')]=_0x209a34['file'][_0x3b02('0x6c')];return db['ChatWebsite'][_0x3b02('0x54')]({'where':{'id':_0x209a34['params']['id']}})['then'](handleEntityNotFound(_0x28fbb1,null))[_0x3b02('0x1e')](saveUpdates(_0x209a34['body'],null))['then'](respondWithResult(_0x28fbb1,null))[_0x3b02('0x5a')](handleError(_0x28fbb1,null));};exports[_0x3b02('0x6f')]=function(_0x2df447,_0x1a0705,_0x3a108c){_0x2df447[_0x3b02('0x56')][_0x3b02('0x70')]=_0x2df447[_0x3b02('0x6b')][_0x3b02('0x6c')];return db[_0x3b02('0x50')][_0x3b02('0x54')]({'where':{'id':_0x2df447[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x1a0705,null))['then'](saveUpdates(_0x2df447[_0x3b02('0x56')],null))[_0x3b02('0x1e')](respondWithResult(_0x1a0705,null))[_0x3b02('0x5a')](handleError(_0x1a0705,null));};exports[_0x3b02('0x71')]=function(_0x1c17f7,_0x4439d8,_0x5c1ed5){_0x1c17f7['body'][_0x3b02('0x72')]=_0x1c17f7[_0x3b02('0x6b')]['filename'];return db[_0x3b02('0x50')][_0x3b02('0x54')]({'where':{'id':_0x1c17f7[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x4439d8,null))[_0x3b02('0x1e')](saveUpdates(_0x1c17f7[_0x3b02('0x56')],null))[_0x3b02('0x1e')](respondWithResult(_0x4439d8,null))['catch'](handleError(_0x4439d8,null));};exports[_0x3b02('0x73')]=function(_0x4fdd50,_0xec65dc,_0xe7f93c){var _0x5c9a4f=path[_0x3b02('0x74')](config['root'],_0x3b02('0x75'));var _0x31ccd7={'where':{'id':_0x4fdd50[_0x3b02('0x5c')]['id']},'attributes':['id',_0x3b02('0x6a')],'raw':!![]};var _0x40bc55=![];return require(_0x3b02('0x76'))[_0x3b02('0x77')]()[_0x3b02('0x1e')](function(_0x4d9833){if(_0x4d9833){_0x40bc55=_0x4d9833[_0x3b02('0x78')];}})[_0x3b02('0x1e')](function(){return db[_0x3b02('0x50')][_0x3b02('0x54')](_0x31ccd7);})[_0x3b02('0x1e')](handleEntityNotFound(_0xec65dc,null))[_0x3b02('0x1e')](function(_0x55873a){if(_0x55873a){if(!_[_0x3b02('0x79')](_0x55873a[_0x3b02('0x6a')])){if(fs[_0x3b02('0x7a')](path[_0x3b02('0x74')](config[_0x3b02('0x7b')],'server/files/images/logos/',_0x55873a[_0x3b02('0x6a')]))&&_0x40bc55){_0x5c9a4f=path[_0x3b02('0x74')](config[_0x3b02('0x7b')],_0x3b02('0x7c'),_0x55873a[_0x3b02('0x6a')]);}}return _0xec65dc[_0x3b02('0x7d')](_0x5c9a4f);}})[_0x3b02('0x5a')](handleError(_0xec65dc,null));};exports[_0x3b02('0x7e')]=function(_0x356fea,_0x230d1a,_0x1aa77e){var _0x51b4aa=path[_0x3b02('0x74')](config['root'],_0x3b02('0x7f'));var _0xfa55f2={'where':{'id':_0x356fea[_0x3b02('0x5c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0x3b02('0x54')](_0xfa55f2)[_0x3b02('0x1e')](handleEntityNotFound(_0x230d1a,null))['then'](function(_0x1b26f0){if(_0x1b26f0){if(!_[_0x3b02('0x79')](_0x1b26f0[_0x3b02('0x6e')])){if(fs[_0x3b02('0x7a')](path[_0x3b02('0x74')](config[_0x3b02('0x7b')],_0x3b02('0x80'),_0x1b26f0['agentAvatar']))){_0x51b4aa=path['join'](config[_0x3b02('0x7b')],_0x3b02('0x80'),_0x1b26f0[_0x3b02('0x6e')]);}}return _0x230d1a[_0x3b02('0x7d')](_0x51b4aa);}})[_0x3b02('0x5a')](handleError(_0x230d1a,null));};exports[_0x3b02('0x81')]=function(_0x4abea3,_0x70629,_0x6e0761){var _0x453561=path['join'](config[_0x3b02('0x7b')],'server/files/images/avatars/customer_avatar.png');var _0x4f2e78={'where':{'id':_0x4abea3[_0x3b02('0x5c')]['id']},'attributes':['id',_0x3b02('0x70'),_0x3b02('0x82')],'raw':!![]};return db[_0x3b02('0x50')]['find'](_0x4f2e78)[_0x3b02('0x1e')](handleEntityNotFound(_0x70629,null))[_0x3b02('0x1e')](function(_0x88bb91){if(_0x88bb91){if(!_[_0x3b02('0x79')](_0x88bb91['customerAvatar'])){if(fs[_0x3b02('0x7a')](path[_0x3b02('0x74')](config['root'],'server/files/images/avatars/',_0x88bb91[_0x3b02('0x70')]))&&_0x88bb91[_0x3b02('0x82')]){_0x453561=path[_0x3b02('0x74')](config[_0x3b02('0x7b')],_0x3b02('0x80'),_0x88bb91[_0x3b02('0x70')]);}}return _0x70629[_0x3b02('0x7d')](_0x453561);}})[_0x3b02('0x5a')](handleError(_0x70629,null));};exports['getSystemAvatar']=function(_0x418385,_0xbf1f2d,_0x365a0c){var _0x772400=path['join'](config['root'],_0x3b02('0x83'));var _0x463e2a={'where':{'id':_0x418385['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x3b02('0x50')][_0x3b02('0x54')](_0x463e2a)['then'](handleEntityNotFound(_0xbf1f2d,null))[_0x3b02('0x1e')](function(_0x495c58){if(_0x495c58){if(!_[_0x3b02('0x79')](_0x495c58[_0x3b02('0x72')])){if(fs[_0x3b02('0x7a')](path[_0x3b02('0x74')](config['root'],_0x3b02('0x80'),_0x495c58['systemAvatar']))){_0x772400=path[_0x3b02('0x74')](config['root'],'server/files/images/avatars/',_0x495c58[_0x3b02('0x72')]);}}return _0xbf1f2d[_0x3b02('0x7d')](_0x772400);}})['catch'](handleError(_0xbf1f2d,null));};exports[_0x3b02('0x84')]=function(_0xa1d588,_0xcbf400,_0x476e9f){var _0x4eeb6e=require(_0x3b02('0x85'));var _0x5d625b=new _0x4eeb6e();var _0x497cdb=_0x5d625b[_0x3b02('0x86')](_0xa1d588[_0x3b02('0x87')][_0x3b02('0x88')])[_0x3b02('0x89')]();var _0x4207b9={'body':_0xa1d588[_0x3b02('0x56')],'channel':_0x3b02('0x8a')};var _0x4e9081=[];var _0x32dd83=[];var _0x417683={};var _0x184e1b=![];return db['CmContact'][_0x3b02('0x5d')]()[_0x3b02('0x1e')](function(_0x1a95d5){if(!_0x1a95d5){throw new db['Sequelize'][(_0x3b02('0x8b'))](_0x3b02('0x8c'));}_0x4e9081=_[_0x3b02('0x8d')](_[_0x3b02('0x41')](_0x1a95d5),[_0x3b02('0x8e'),_0x3b02('0x8f')]);_0x32dd83=_[_0x3b02('0x8d')](_[_0x3b02('0x41')](_0x1a95d5),['createdAt',_0x3b02('0x8f'),_0x3b02('0x90'),_0x3b02('0x91')]);if(_0xa1d588['body']['id']){delete _0xa1d588[_0x3b02('0x56')]['id'];}if(_[_0x3b02('0x79')](_0xa1d588['body'][_0x3b02('0x92')])){throw new db['Sequelize'][(_0x3b02('0x8b'))](_0x3b02('0x93'));}if(_[_0x3b02('0x79')](_0xa1d588[_0x3b02('0x56')]['body'])||_0xa1d588['body'][_0x3b02('0x56')]===''){throw new db[(_0x3b02('0x94'))][(_0x3b02('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3b02('0x79')](_0xa1d588[_0x3b02('0x56')]['mapKey'])){throw new db['Sequelize'][(_0x3b02('0x8b'))](_0x3b02('0x95')+_0x32dd83);}if(!_[_0x3b02('0x96')](_0x32dd83,_0xa1d588[_0x3b02('0x56')][_0x3b02('0x97')])){throw new db[(_0x3b02('0x94'))][(_0x3b02('0x8b'))](_0x3b02('0x98')+_0x32dd83);}_0x417683[_0xa1d588[_0x3b02('0x56')][_0x3b02('0x97')]]=_0xa1d588[_0x3b02('0x56')][_0x3b02('0x92')];})[_0x3b02('0x1e')](function(){return db[_0x3b02('0x50')]['find']({'where':{'id':_0xa1d588[_0x3b02('0x5c')]['id']},'include':[{'model':db[_0x3b02('0x99')],'as':'List','include':[{'model':db['CmContact'],'as':_0x3b02('0x9a'),'where':_0x417683,'limit':0x1,'order':[[_0x3b02('0x8f'),_0x3b02('0x9b')]]}]},{'model':db['ChatApplication'],'as':_0x3b02('0x9c')}]});})[_0x3b02('0x1e')](handleEntityNotFound(_0xcbf400,null))[_0x3b02('0x1e')](function(_0x77385){if(_0x77385&&_0x77385[_0x3b02('0x9d')]){_0x4207b9[_0x3b02('0x9e')]=_0x77385;_0x4207b9[_0x3b02('0x9f')]=_0x77385[_0x3b02('0x9c')];_0x4207b9[_0x3b02('0xa0')]=_0x77385[_0x3b02('0x9d')];_0x4207b9[_0x3b02('0x9f')]=_[_0x3b02('0xa1')](_0x4207b9['applications'],['priority'],[_0x3b02('0xa2')]);if(_0x4207b9[_0x3b02('0x9e')][_0x3b02('0x9c')]){delete _0x4207b9['account'][_0x3b02('0x9c')];}if(_0x4207b9['account']['List']&&_0x4207b9[_0x3b02('0x9e')][_0x3b02('0x9d')][_0x3b02('0x9a')]['length']){return _0x4207b9[_0x3b02('0x9e')]['List'][_0x3b02('0x9a')][0x0];}var _0x1b499f=_[_0x3b02('0x18')](_0xa1d588[_0x3b02('0x56')],{'firstName':_0xa1d588['body'][_0x3b02('0x92')],'ListId':_0x77385[_0x3b02('0x91')]});_0x1b499f[_0xa1d588['body'][_0x3b02('0x97')]]=_0xa1d588[_0x3b02('0x56')]['from'];return db['CmContact'][_0x3b02('0x55')](_0x1b499f,{'fields':_0x4e9081,'raw':!![]});}})[_0x3b02('0x1e')](handleEntityNotFound(_0xcbf400,null))['then'](function(_0x2e9bfa){_0x4207b9['contact']=_0x2e9bfa;var _0x3e9cf6=_0xa1d588[_0x3b02('0x56')][_0x3b02('0xa3')];if(_0xa1d588[_0x3b02('0x87')][_0x3b02('0xa4')]){_0x3e9cf6=_0xa1d588['headers'][_0x3b02('0xa4')];}else if(_0xa1d588['headers'][_0x3b02('0xa5')]){_0x3e9cf6=_['first'](_0xa1d588['headers'][_0x3b02('0xa5')][_0x3b02('0xa6')](','));}if(_0x2e9bfa){var _0x4360a5={'ContactId':_0x2e9bfa['id'],'ChatWebsiteId':_0xa1d588[_0x3b02('0x5c')]['id'],'from':(_0x2e9bfa[_0x3b02('0xa7')]||'')+'\x20'+(_0x2e9bfa['lastName']||''),'customerIp':_0x3e9cf6,'customerPort':_0xa1d588[_0x3b02('0x87')]['x-real-port']?_0xa1d588[_0x3b02('0x87')][_0x3b02('0xa8')]:null,'referer':_0xa1d588['body'][_0x3b02('0xa9')],'browserName':_0x497cdb[_0x3b02('0xaa')][_0x3b02('0x39')]&&_0x497cdb[_0x3b02('0xaa')][_0x3b02('0xab')]?util[_0x3b02('0xac')]('%s\x20%s',_0x497cdb[_0x3b02('0xaa')][_0x3b02('0x39')],_0x497cdb['browser'][_0x3b02('0xab')]):'unknown','browserVersion':_0x497cdb[_0x3b02('0xaa')]['version']||_0x3b02('0xad'),'osName':util[_0x3b02('0xac')](_0x3b02('0xae'),_0x497cdb['os'][_0x3b02('0x39')],_0x497cdb['os']['version']),'osVersion':_0x497cdb['os'][_0x3b02('0xab')],'deviceModel':_0x497cdb['device']['model']&&_0x497cdb[_0x3b02('0xaf')][_0x3b02('0xb0')]?util[_0x3b02('0xac')](_0x3b02('0xb1'),_0x497cdb[_0x3b02('0xaf')][_0x3b02('0x3e')],_0x497cdb[_0x3b02('0xaf')][_0x3b02('0xb0')],_0x497cdb[_0x3b02('0xaf')][_0x3b02('0x3d')]):null,'deviceVendor':_0x497cdb[_0x3b02('0xaf')]['vendor'],'deviceType':_0x497cdb[_0x3b02('0xaf')][_0x3b02('0x3d')],'formData':JSON[_0x3b02('0xb2')](_0xa1d588[_0x3b02('0x56')])};var _0x47afb6={'ChatWebsiteId':_0xa1d588['params']['id'],'closed':![]};if(_0xa1d588[_0x3b02('0x56')][_0x3b02('0xb3')]){_0x47afb6[_0x3b02('0xb3')]=_0xa1d588[_0x3b02('0x56')][_0x3b02('0xb3')];return db[_0x3b02('0xb4')][_0x3b02('0x54')]({'where':_0x47afb6})[_0x3b02('0x1e')](function(_0xb5ae1d){if(_0xb5ae1d){return[_0xb5ae1d,![]];}_0x4360a5[_0x3b02('0xb3')]=_0xa1d588[_0x3b02('0x56')][_0x3b02('0xb3')];_0x4360a5[_0x3b02('0xb5')]=_0xa1d588[_0x3b02('0x56')]['externalUrl'];return db['ChatInteraction'][_0x3b02('0x55')](_0x4360a5)[_0x3b02('0x1e')](function(_0x19c019){return[_0x19c019,!![]];});});}_0x47afb6[_0x3b02('0xb6')]=_0x2e9bfa['id'];if(_0xa1d588[_0x3b02('0x56')]['interaction']&&_0xa1d588[_0x3b02('0x56')][_0x3b02('0xb7')]['id']){_0x47afb6['id']=_0xa1d588['body'][_0x3b02('0xb7')]['id'];return db['ChatInteraction'][_0x3b02('0x54')]({'where':_0x47afb6})['then'](function(_0x3d1225){if(_0x3d1225){return[_0x3d1225,![]];}return db[_0x3b02('0xb4')][_0x3b02('0x55')](_0x4360a5)[_0x3b02('0x1e')](function(_0x540326){return[_0x540326,!![]];});});}return db[_0x3b02('0xb4')]['create'](_0x4360a5)[_0x3b02('0x1e')](function(_0x228a3b){return[_0x228a3b,!![]];});}})[_0x3b02('0xb8')](function(_0x14f9ea,_0x40b0ff){if(_0x14f9ea){_0x184e1b=_0x40b0ff;if(!_0x40b0ff){var _0x3503fb={'from':(_0x4207b9['contact']['firstName']||'')+'\x20'+(_0x4207b9[_0x3b02('0xb9')][_0x3b02('0xba')]||'')};if(_0xa1d588[_0x3b02('0x56')][_0x3b02('0xb3')]&&_0xa1d588['body'][_0x3b02('0xbb')]&&_0xa1d588[_0x3b02('0x56')][_0x3b02('0xb3')]!=_0xa1d588['body'][_0x3b02('0xbb')]){_0x3503fb[_0x3b02('0xb3')]=_0xa1d588[_0x3b02('0x56')]['messageId'];}return _0x14f9ea[_0x3b02('0x32')](_0x3503fb);}else{return _0x14f9ea;}}})[_0x3b02('0x1e')](function(_0x2222e7){_0x4207b9[_0x3b02('0xb7')]=_0x2222e7[_0x3b02('0x33')]({'plain':!![]});_0x4207b9[_0x3b02('0xb7')][_0x3b02('0xbc')]=_0x184e1b;if(_0x4207b9[_0x3b02('0xb7')]['created']){if(_0x4207b9[_0x3b02('0x9e')][_0x3b02('0xbd')]){_0x4207b9[_0x3b02('0x9f')]['push']({'id':0x0,'priority':_0x4207b9[_0x3b02('0x9f')]['length']+0x1,'app':_0x3b02('0xbe'),'appdata':'unmanaged','interval':_0x3b02('0xbf')});}}return db[_0x3b02('0xc0')][_0x3b02('0x55')]({'body':_0xa1d588[_0x3b02('0x56')]['body'],'ChatWebsiteId':_0xa1d588[_0x3b02('0x5c')]['id'],'ChatInteractionId':_0x2222e7['id'],'direction':'in','ContactId':_0x4207b9[_0x3b02('0xb9')]['id'],'AttachmentId':_0xa1d588[_0x3b02('0x56')][_0x3b02('0xc1')]});})['then'](function(_0x46ee05){_0x4207b9[_0x3b02('0x24')]=_0x46ee05;if(_0x4207b9[_0x3b02('0xb7')][_0x3b02('0xc2')]){return db['User'][_0x3b02('0x54')]({'attributes':['id',_0x3b02('0x39')],'where':{'id':_0x4207b9[_0x3b02('0xb7')][_0x3b02('0xc2')]}})[_0x3b02('0x1e')](function(_0x470e42){if(_0x470e42){_0x4207b9[_0x3b02('0x9f')][_0x3b02('0xc3')]({'id':0x0,'priority':0x0,'app':_0x3b02('0xc4'),'appdata':_0x470e42['name']+','+(_0x4207b9['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x4207b9['forcedOwnership']=!![];}return respondWithRpcPromise(_0x3b02('0xc5'),'startRouting',_0x4207b9);});}return respondWithRpcPromise(_0x3b02('0xc5'),_0x3b02('0xc6'),_0x4207b9);})[_0x3b02('0x1e')](function(_0x16c95e){respondWithRpcPromise(_0x3b02('0xc7'),_0x3b02('0xc7'),{'event':'notify','message':_0x16c95e},client9002);return _0x16c95e;})[_0x3b02('0x1e')](respondWithResult(_0xcbf400,null))['catch'](handleError(_0xcbf400,null));};exports[_0x3b02('0xc8')]=function(_0x26084f,_0x46219e,_0x23d81){var _0x5dbd33,_0x4cf6e1,_0x1a7080;var _0x1d9897=[];var _0x7bde4d=[];var _0x32a5d0={};var _0xaf1712=_0x26084f[_0x3b02('0xc9')]||[];var _0x4c7b15=[];var _0x2b334a;return db[_0x3b02('0xca')][_0x3b02('0x5d')]()[_0x3b02('0x1e')](function(_0x10ad0c){if(!_0x10ad0c){throw new db[(_0x3b02('0x94'))][(_0x3b02('0x8b'))](_0x3b02('0x8c'));}_0x7bde4d=_[_0x3b02('0x8d')](_[_0x3b02('0x41')](_0x10ad0c),[_0x3b02('0x8e'),'updatedAt']);_0x1d9897=_[_0x3b02('0x8d')](_['keys'](_0x10ad0c),[_0x3b02('0x8e'),_0x3b02('0x8f'),_0x3b02('0x90'),'ListId']);if(_0x26084f[_0x3b02('0x56')]['id']){delete _0x26084f['body']['id'];}if(_['isNil'](_0x26084f[_0x3b02('0x56')][_0x3b02('0x92')])){throw _0x46219e[_0x3b02('0x27')](0x1f4)[_0x3b02('0x3a')](new db[(_0x3b02('0x94'))][(_0x3b02('0x8b'))](_0x3b02('0x93')));}if(_[_0x3b02('0x79')](_0x26084f[_0x3b02('0x56')]['body'])||_0x26084f[_0x3b02('0x56')]['body']===''){throw _0x46219e[_0x3b02('0x27')](0x1f4)[_0x3b02('0x3a')](new db['Sequelize'][(_0x3b02('0x8b'))](_0x3b02('0xcb')));}if(_[_0x3b02('0x79')](_0x26084f[_0x3b02('0x56')][_0x3b02('0xcc')])){throw _0x46219e['status'](0x1f4)[_0x3b02('0x3a')](new db[(_0x3b02('0x94'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1d9897));}if(!_[_0x3b02('0x96')](_0x1d9897,_0x26084f[_0x3b02('0x56')][_0x3b02('0xcc')])){throw _0x46219e['status'](0x1f4)[_0x3b02('0x3a')](new db[(_0x3b02('0x94'))][(_0x3b02('0x8b'))](_0x3b02('0xcd')+_0x1d9897));}_0x32a5d0[_0x26084f[_0x3b02('0x56')][_0x3b02('0xcc')]]=_0x26084f[_0x3b02('0x56')]['from'];})[_0x3b02('0x1e')](function(){return db[_0x3b02('0x50')]['find']({'where':{'id':_0x26084f[_0x3b02('0x5c')]['id']},'include':[{'model':db[_0x3b02('0x99')],'as':_0x3b02('0x9d')},{'model':db['MailAccount'],'as':_0x3b02('0xce')}]});})['then'](handleEntityNotFound(_0x46219e,null))['then'](function(_0x33cb0e){if(_0x33cb0e&&_0x33cb0e['List']){_0x4cf6e1=_0x33cb0e;var _0x553e7e=_['defaults'](_0x26084f[_0x3b02('0x56')],{'firstName':_0x26084f[_0x3b02('0x56')][_0x3b02('0x92')],'phone':_0x26084f['body'][_0x3b02('0x92')],'ListId':_0x33cb0e[_0x3b02('0x91')]});_0x553e7e[_0x26084f[_0x3b02('0x56')]['mapKeyOffline']]=_0x26084f['body']['from'];return db[_0x3b02('0xca')]['findOrCreate']({'where':_0x32a5d0,'defaults':_0x553e7e});}})[_0x3b02('0xb8')](function(_0x760b84){if(_0x760b84){_0x1a7080=_0x760b84;var _0x2c20da=fs['readFileSync'](path[_0x3b02('0x74')](config['root'],_0x3b02('0xcf')),_0x3b02('0xd0'));var _0x444828=ejs['render'](_0x2c20da,{'body':_[_0x3b02('0xd1')](_0x26084f['body'][_0x3b02('0x56')]),'bodyTitle':_0x4cf6e1[_0x3b02('0xd2')]});return db[_0x3b02('0xd3')]['create']({'body':_0x444828,'ContactId':_0x760b84['id'],'ChatWebsiteId':_0x4cf6e1['id']});}})[_0x3b02('0x1e')](function(_0x2a74b4){_0x2b334a=_0x2a74b4;if(_0xaf1712[_0x3b02('0x46')]){var _0x4c3bbe=_0xaf1712[_0x3b02('0x3f')](function(_0x49698f){return{'name':_0x49698f[_0x3b02('0xd4')],'basename':_0x49698f['filename'],'type':_0x49698f[_0x3b02('0xd5')],'ChatOfflineMessageId':_0x2a74b4['id']};});_0x4c7b15=_0x4c3bbe[_0x3b02('0x3f')](_0x251565=>{var _0x2aaef4={'filename':_0x251565[_0x3b02('0x39')],'path':path['join'](config[_0x3b02('0x7b')],_0x3b02('0xd6'),_0x3b02('0xc9'),_0x3b02('0xd7'),'offline-chat',_0x251565[_0x3b02('0xd8')])};return _0x2aaef4;});if(!_0x4cf6e1[_0x3b02('0xd9')]){return db['sequelize'][_0x3b02('0xda')](function(_0x2e2f76){return db['Attachment']['bulkCreate'](_0x4c3bbe,{'transaction':_0x2e2f76});});}}})['then'](function(){if(_0x2b334a){_0x5dbd33=_0x2b334a;return db[_0x3b02('0xce')][_0x3b02('0x61')]({'where':{'active':!![]},'include':[{'model':db[_0x3b02('0xdb')],'as':_0x3b02('0xdc'),'raw':!![]}]});}})[_0x3b02('0x1e')](function(_0x1e4d74){if(_0x1e4d74&&_0x1e4d74['Smtp']&&_0x4cf6e1[_0x3b02('0xdd')]&&_0x4cf6e1[_0x3b02('0xde')]){var _0x51b89f={'tls':{'rejectUnauthorized':![]}};if(_0x1e4d74['Smtp']['service']){_0x51b89f[_0x3b02('0xdf')]=_0x1e4d74['Smtp'][_0x3b02('0xdf')];}else{_0x51b89f['host']=_0x1e4d74[_0x3b02('0xdc')][_0x3b02('0xe0')];_0x51b89f['port']=_0x1e4d74[_0x3b02('0xdc')][_0x3b02('0xe1')];_0x51b89f[_0x3b02('0xe2')]=_0x1e4d74[_0x3b02('0xdc')]['secure'];}if(_0x1e4d74[_0x3b02('0xdc')][_0x3b02('0xe3')]){_0x51b89f[_0x3b02('0xe4')]={'user':_0x1e4d74['Smtp'][_0x3b02('0x57')],'pass':_0x1e4d74[_0x3b02('0xdc')][_0x3b02('0xe5')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x51b89f,'message':{'from':util[_0x3b02('0xac')](_0x3b02('0xe6'),_0x1e4d74[_0x3b02('0x39')],_0x1e4d74['email']||_0x1e4d74[_0x3b02('0xdc')][_0x3b02('0x57')]),'to':_0x4cf6e1[_0x3b02('0xde')],'subject':_0x4cf6e1[_0x3b02('0xe7')],'html':_0x5dbd33['body'],'attachments':_0x4c7b15}},client9003)[_0x3b02('0x1e')](function(){return _0x5dbd33;})[_0x3b02('0x5a')](function(_0x4cf400){console[_0x3b02('0x22')](_0x4cf400);});}})[_0x3b02('0x1e')](function(){if(_0x4cf6e1&&_0x4cf6e1['openNewInteraction']&&_0x4cf6e1[_0x3b02('0xe8')]){var _0xedfb7c=[];if(_0xaf1712[_0x3b02('0x46')]){_0xedfb7c=_0xaf1712[_0x3b02('0x3f')](function(_0x407b8b){return{'name':_0x407b8b[_0x3b02('0xd4')],'basename':_0x407b8b['filename'],'type':_0x407b8b['mimetype'],'ChatOfflineMessageId':_0x2b334a['id']};});}var _0x478673;if(!_['isNil'](_0x4cf6e1[_0x3b02('0xe9')])){var _0x1d911c=_[_0x3b02('0x3f')](_0x26084f[_0x3b02('0x56')],function(_0x4776d0){return _0x4776d0;});var _0x5a3d79=_[_0x3b02('0xea')](_0x1d911c)[0x0];var _0xa1dc0d=_[_0x3b02('0xeb')](_0x5a3d79,function(_0x55b4ec){return _0x55b4ec;});_0x478673=_0xa1dc0d[0x1][_0x4cf6e1[_0x3b02('0xe9')]];}var _0x228e58={'from':_0x1a7080['email'],'firstName':_0x1a7080[_0x3b02('0xa7')],'lastName':_0x1a7080[_0x3b02('0xba')],'mapKey':'email','message':{'from':_0x1a7080['email'],'to':_0x4cf6e1['MailAccount'][_0x3b02('0xec')],'cc':'','subject':_['isNil'](_0x478673)?_0x4cf6e1[_0x3b02('0xe7')]:_0x478673,'messageId':'','sentAt':new Date(),'attach':_0xedfb7c[_0x3b02('0x46')],'attachments':_0xedfb7c,'originChannel':_0x3b02('0xed'),'ChatWebsiteId':_0x4cf6e1['id'],'ChatOfflineMessageId':_0x5dbd33['id'],'originTo':_0x4cf6e1[_0x3b02('0xce')][_0x3b02('0xec')]},'body':_0x5dbd33[_0x3b02('0x56')]};var _0x4f3c07={'account':{'id':_0x4cf6e1[_0x3b02('0xe8')]},'body':_0x228e58,'log':_0x3b02('0xee')};return respondWithRpcPromise(_0x3b02('0xee'),_0x3b02('0xef'),_0x4f3c07,client9001)[_0x3b02('0x1e')](function(){return _0x5dbd33;})[_0x3b02('0x5a')](function(_0x20b0cf){console['error'](_0x20b0cf);});}return;})[_0x3b02('0x1e')](function(){if(_0x5dbd33){return _0x5dbd33;}})[_0x3b02('0x1e')](respondWithResult(_0x46219e,null))[_0x3b02('0x5a')](function(_0x394f12){console[_0x3b02('0x22')](_0x3b02('0x5a'),_0x394f12);for(var _0x4589bf of _0xaf1712){var _0x2f301c=path[_0x3b02('0x74')](config[_0x3b02('0x7b')],_0x3b02('0xd6'),'files',_0x3b02('0xd7'),_0x3b02('0xf0'),_0x4589bf['filename']);fs_extra['remove'](_0x2f301c)['catch'](function(_0x2d726b){console[_0x3b02('0x22')](_0x3b02('0xf1'),_0x2f301c,_0x2d726b);});}});};exports[_0x3b02('0xf2')]=function(_0x32bd7c,_0x1dfe4b,_0x55ce05){return db[_0x3b02('0xb4')][_0x3b02('0x54')]({'where':{'id':_0x32bd7c[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x1dfe4b,null))['then'](function(_0x4cd7d4){if(_0x4cd7d4){return _0x4cd7d4[_0x3b02('0xf2')](_0x32bd7c[_0x3b02('0x56')][_0x3b02('0x64')],_['omit'](_0x32bd7c['body'],[_0x3b02('0x64'),'id'])||{});}})[_0x3b02('0x1e')](respondWithResult(_0x1dfe4b,null))[_0x3b02('0x5a')](handleError(_0x1dfe4b,null));};exports[_0x3b02('0xf3')]=function(_0x3dbfaa,_0x3a2898,_0x370732){var _0x3a1f76={'raw':![],'where':{}};var _0x353d47={};var _0x506de4={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3dbfaa[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x3a2898,null))[_0x3b02('0x1e')](function(_0x177970){if(_0x177970){_0x353d47[_0x3b02('0x3e')]=_['keys'](db['ChatInteraction'][_0x3b02('0x3c')]);_0x353d47['query']=_['keys'](_0x3dbfaa[_0x3b02('0x40')]);_0x353d47[_0x3b02('0x42')]=_[_0x3b02('0x43')](_0x353d47[_0x3b02('0x3e')],_0x353d47[_0x3b02('0x40')]);_0x3a1f76['attributes']=_['intersection'](_0x353d47[_0x3b02('0x3e')],qs['fields'](_0x3dbfaa[_0x3b02('0x40')][_0x3b02('0x45')]));_0x3a1f76['attributes']=_0x3a1f76[_0x3b02('0x44')][_0x3b02('0x46')]?_0x3a1f76[_0x3b02('0x44')]:_0x353d47[_0x3b02('0x3e')];if(!_0x3dbfaa[_0x3b02('0x40')]['hasOwnProperty'](_0x3b02('0x48'))){_0x3a1f76['limit']=qs[_0x3b02('0x2b')](_0x3dbfaa[_0x3b02('0x40')][_0x3b02('0x2b')]);_0x3a1f76['offset']=qs['offset'](_0x3dbfaa[_0x3b02('0x40')][_0x3b02('0x29')]);}_0x3a1f76[_0x3b02('0x62')]=qs[_0x3b02('0x49')](_0x3dbfaa['query']['sort']);_0x3a1f76['where']=qs[_0x3b02('0x42')](_[_0x3b02('0x4a')](_0x3dbfaa['query'],_0x353d47[_0x3b02('0x42')]));_0x3a1f76[_0x3b02('0x4b')][_0x3b02('0x5f')]=_0x177970['id'];if(_0x3dbfaa[_0x3b02('0x40')]['filter']){_0x3a1f76[_0x3b02('0x4b')]=_[_0x3b02('0x4c')](_0x3a1f76[_0x3b02('0x4b')],{'$or':_[_0x3b02('0x3f')](_0x3a1f76[_0x3b02('0x44')],function(_0x150f1d){var _0x3616b8={};_0x3616b8[_0x150f1d]={'$like':'%'+_0x3dbfaa[_0x3b02('0x40')][_0x3b02('0x4e')]+'%'};return _0x3616b8;})});}_0x3a1f76=_[_0x3b02('0x4c')]({},_0x3a1f76,_0x3dbfaa[_0x3b02('0x4f')]);return db[_0x3b02('0xb4')][_0x3b02('0x2c')]({'where':_0x3a1f76[_0x3b02('0x4b')]})[_0x3b02('0x1e')](function(_0x1623c8){_0x506de4['count']=_0x1623c8;if(_0x3dbfaa[_0x3b02('0x40')]['includeAll']){_0x3a1f76[_0x3b02('0x68')]=[{'model':db[_0x3b02('0xca')],'as':_0x3b02('0xf4'),'required':![]},{'model':db[_0x3b02('0xf5')],'as':_0x3b02('0xf6'),'attributes':[_0x3b02('0x39'),_0x3b02('0xf7'),_0x3b02('0xf8')],'required':![]},{'model':db[_0x3b02('0xf9')],'as':_0x3b02('0xfa'),'attributes':['id',_0x3b02('0x39'),_0x3b02('0xfb')],'where':_0x3dbfaa['query'][_0x3b02('0xfc')]?{'id':_0x3dbfaa[_0x3b02('0x40')][_0x3b02('0xfc')]}:undefined,'required':_0x3dbfaa[_0x3b02('0x40')]['tag']?!![]:![]}];}return db[_0x3b02('0xb4')]['findAll'](_0x3a1f76);})[_0x3b02('0x1e')](function(_0x19a9cb){_0x506de4[_0x3b02('0xfd')]=_0x19a9cb;return _0x506de4;});}})[_0x3b02('0x1e')](respondWithFilteredResult(_0x3a2898,_0x3a1f76))[_0x3b02('0x5a')](handleError(_0x3a2898,null));};function iftimePromise(_0x460c6b,_0x3be97c){return respondWithRpcPromise(_0x3b02('0xfe'),_0x3b02('0xff'),{'command':_0x3be97c[_0x3b02('0x100')]?util[_0x3b02('0xac')](_0x3b02('0x101'),_0x460c6b[_0x3b02('0x102')],_0x3be97c['timezone']):util['format']('iftime\x20%s',_0x460c6b[_0x3b02('0x102')])},client9002)[_0x3b02('0x1e')](function(_0x4f06e1){var _0x5666d=_0x4f06e1&&_0x4f06e1[_0x3b02('0x103')](_0x3b02('0x104'))>=0x0?!![]:![];logger['info'](_0x3b02('0x105'),_0x3be97c['id'],_0x460c6b['id'],_0x460c6b[_0x3b02('0x102')],_0x5666d?'ONLINE':_0x3b02('0x106'),_0x3be97c[_0x3b02('0x100')]?_0x3be97c[_0x3b02('0x100')]:_0x3b02('0x107'));return _0x5666d;})[_0x3b02('0x5a')](function(_0x5346ec){logger[_0x3b02('0x22')](_0x3b02('0x105'),_0x3be97c['id'],_0x460c6b['id'],_0x460c6b[_0x3b02('0x102')],util[_0x3b02('0x108')](_0x5346ec,{'showHidden':![],'depth':null}),_0x3be97c[_0x3b02('0x100')]?_0x3be97c[_0x3b02('0x100')]:_0x3b02('0x107'));return![];});}exports[_0x3b02('0xff')]=function(_0x4c482a,_0x29bdc7,_0x364d4f){var _0x2a27e3=0x0;var _0x33054e=0x0;var _0x26748b=![];var _0x53e6d9;var _0x1b3c4d;return db[_0x3b02('0x50')][_0x3b02('0x54')]({'where':{'id':_0x4c482a[_0x3b02('0x5c')]['id']},'include':[{'model':db[_0x3b02('0x109')],'as':'Interval','include':[{'model':db[_0x3b02('0x109')],'as':_0x3b02('0x10a'),'attributes':['id',_0x3b02('0x102')],'raw':!![]}]}]})[_0x3b02('0x1e')](handleEntityNotFound(_0x29bdc7,null))['then'](function(_0x25ec01){if(_0x25ec01){_0x53e6d9=_0x25ec01;return _0x25ec01[_0x3b02('0x10b')]({'raw':!![]});}})[_0x3b02('0x1e')](function(_0x48180e){if(_0x53e6d9){if(_0x48180e){_0x1b3c4d=_0x48180e;}}return require(_0x3b02('0x76'))[_0x3b02('0x77')]();})[_0x3b02('0x1e')](function(_0x5d2d99){if(_0x5d2d99){_0x33054e=_0x5d2d99[_0x3b02('0x10c')];_0x26748b=_0x5d2d99[_0x3b02('0x78')];}})[_0x3b02('0x1e')](function(){return db['ChatInteraction'][_0x3b02('0x2c')]({'where':{'closed':![]}});})[_0x3b02('0x1e')](function(_0x30c765){_0x2a27e3=_0x30c765;if(_0x33054e&&_0x30c765>_0x33054e){return db[_0x3b02('0x10d')][_0x3b02('0x61')]({'where':{'id':0x1}})[_0x3b02('0x1e')](function(_0x2930de){if(_0x2930de){_0x2930de[_0x3b02('0x10e')]('chatLicenseExceeded');}});}})[_0x3b02('0x1e')](function(){if(_0x53e6d9[_0x3b02('0x109')]&&_0x53e6d9[_0x3b02('0x109')][_0x3b02('0x10a')]){var _0x33514a=[];for(var _0x4d1880=0x0;_0x4d1880<_0x53e6d9[_0x3b02('0x109')][_0x3b02('0x10a')]['length'];_0x4d1880++){var _0x420f1f=_0x53e6d9[_0x3b02('0x109')][_0x3b02('0x10a')][_0x4d1880][_0x3b02('0x33')]({'plain':!![]});_0x33514a[_0x3b02('0x10f')](iftimePromise(_0x420f1f,_0x53e6d9));}return BPromise[_0x3b02('0x110')](_0x33514a)[_0x3b02('0x1e')](function(_0x52cf91){return _[_0x3b02('0x111')](_0x52cf91);});}else{return!![];}})[_0x3b02('0x1e')](function(_0x3d3bb9){var _0x416df9=fs[_0x3b02('0x112')](path[_0x3b02('0x74')](config[_0x3b02('0x7b')],_0x3b02('0x113')),_0x3b02('0xd0'));var _0x37989b={'remote':_0x53e6d9[_0x3b02('0x114')],'query':querystring[_0x3b02('0xb2')](_[_0x3b02('0x4c')](_0x53e6d9['get']({'plain':!![]}),{'customerIp':_0x4c482a['headers'][_0x3b02('0xa5')]||_0x4c482a[_0x3b02('0x87')][_0x3b02('0x115')]||_0x4c482a[_0x3b02('0x116')][_0x3b02('0x117')]||_0x4c482a['ip'],'referer':_0x4c482a[_0x3b02('0x87')]['referer'],'openedInteractions':_0x2a27e3,'maxInteractions':_0x33054e,'virtual':_0x26748b[_0x3b02('0x10c')],'online':_0x3d3bb9,'custom':_0x26748b}))[_0x3b02('0x118')](/'/g,'\x5c\x27')};_0x29bdc7[_0x3b02('0x3a')](ejs['render'](Mustache[_0x3b02('0x119')](_0x416df9,_0x37989b),{'proactiveActions':_0x1b3c4d,'alignment':_0x53e6d9[_0x3b02('0x11a')],'verticalAlignment':_0x53e6d9[_0x3b02('0x11b')],'div_color':_0x53e6d9[_0x3b02('0xfb')],'text_color':_0x53e6d9[_0x3b02('0x11c')],'button_color':_0x53e6d9[_0x3b02('0x11d')],'background_color':_0x53e6d9[_0x3b02('0x11e')]}));})[_0x3b02('0x5a')](handleError(_0x29bdc7,null));};exports[_0x3b02('0x11f')]=function(_0x536f64,_0x116d99,_0x297b01){return db[_0x3b02('0x50')]['findOne']({'where':{'id':_0x536f64[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x116d99,null))['then'](function(_0x5717ae){if(_0x5717ae){return db[_0x3b02('0x120')]['transaction'](function(_0x459edf){return db[_0x3b02('0x121')][_0x3b02('0x36')]({'where':{'ChatWebsiteId':_0x536f64['params']['id']},'transaction':_0x459edf})[_0x3b02('0x1e')](function(_0x548f1d){var _0x493f47=_[_0x3b02('0x3f')](_0x536f64[_0x3b02('0x56')],function(_0x511f69){_0x511f69[_0x3b02('0x5f')]=_0x536f64['params']['id'];return _0x511f69;});return db[_0x3b02('0x121')]['bulkCreate'](_0x493f47,{'transaction':_0x459edf});});})[_0x3b02('0x1e')](function(){return db[_0x3b02('0x121')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x536f64['params']['id']},'order':_0x3b02('0x122')});});}})[_0x3b02('0x1e')](respondWithResult(_0x116d99,null))['catch'](handleError(_0x116d99,null));};exports[_0x3b02('0x123')]=function(_0xe6288e,_0x32935b,_0x178d56){var _0x1df0b1={};var _0x2fb6a8={};var _0x4d7c8;var _0x51207c;return db[_0x3b02('0x50')]['findOne']({'where':{'id':_0xe6288e['params']['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x32935b,null))[_0x3b02('0x1e')](function(_0x5ea1ea){if(_0x5ea1ea){_0x4d7c8=_0x5ea1ea;_0x2fb6a8[_0x3b02('0x3e')]=_['keys'](db[_0x3b02('0x121')][_0x3b02('0x3c')]);_0x2fb6a8['query']=_[_0x3b02('0x41')](_0xe6288e[_0x3b02('0x40')]);_0x2fb6a8[_0x3b02('0x42')]=_['intersection'](_0x2fb6a8[_0x3b02('0x3e')],_0x2fb6a8[_0x3b02('0x40')]);_0x1df0b1['attributes']=_[_0x3b02('0x43')](_0x2fb6a8[_0x3b02('0x3e')],qs['fields'](_0xe6288e[_0x3b02('0x40')][_0x3b02('0x45')]));_0x1df0b1[_0x3b02('0x44')]=_0x1df0b1['attributes'][_0x3b02('0x46')]?_0x1df0b1['attributes']:_0x2fb6a8[_0x3b02('0x3e')];_0x1df0b1[_0x3b02('0x62')]=qs[_0x3b02('0x49')](_0xe6288e[_0x3b02('0x40')][_0x3b02('0x49')]);_0x1df0b1[_0x3b02('0x4b')]=qs[_0x3b02('0x42')](_[_0x3b02('0x4a')](_0xe6288e['query'],_0x2fb6a8[_0x3b02('0x42')]));if(_0xe6288e['query'][_0x3b02('0x4e')]){_0x1df0b1[_0x3b02('0x4b')]=_[_0x3b02('0x4c')](_0x1df0b1[_0x3b02('0x4b')],{'$or':_[_0x3b02('0x3f')](_0x1df0b1['attributes'],function(_0x37c904){var _0x4bf859={};_0x4bf859[_0x37c904]={'$like':'%'+_0xe6288e[_0x3b02('0x40')][_0x3b02('0x4e')]+'%'};return _0x4bf859;})});}_0x1df0b1=_[_0x3b02('0x4c')]({},_0x1df0b1,_0xe6288e[_0x3b02('0x4f')]);return _0x4d7c8[_0x3b02('0x123')](_0x1df0b1);}})[_0x3b02('0x1e')](function(_0x5e1c04){if(_0x5e1c04){_0x51207c=_0x5e1c04[_0x3b02('0x46')];if(!_0xe6288e[_0x3b02('0x40')]['hasOwnProperty'](_0x3b02('0x48'))){_0x1df0b1[_0x3b02('0x2b')]=qs[_0x3b02('0x2b')](_0xe6288e[_0x3b02('0x40')][_0x3b02('0x2b')]);_0x1df0b1[_0x3b02('0x29')]=qs['offset'](_0xe6288e[_0x3b02('0x40')][_0x3b02('0x29')]);}return _0x4d7c8[_0x3b02('0x123')](_0x1df0b1);}})[_0x3b02('0x1e')](function(_0x172070){if(_0x172070){return _0x172070?{'count':_0x51207c,'rows':_0x172070}:null;}})[_0x3b02('0x1e')](respondWithResult(_0x32935b,null))[_0x3b02('0x5a')](handleError(_0x32935b,null));};exports['addProactiveActions']=function(_0x6c076b,_0x8548d3,_0xc2a9cb){return db[_0x3b02('0x124')][_0x3b02('0x54')]({'where':{'id':_0x6c076b['params']['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x8548d3,null))[_0x3b02('0x1e')](function(_0x281adb){if(_0x281adb){return _0x281adb[_0x3b02('0x125')](_0x6c076b[_0x3b02('0x56')]['ids'],_[_0x3b02('0x126')](_0x6c076b[_0x3b02('0x56')],[_0x3b02('0x64'),'id'])||{});}})['then'](respondWithResult(_0x8548d3,null))['catch'](handleError(_0x8548d3,null));};exports[_0x3b02('0x10b')]=function(_0x14b1d0,_0x410dc1,_0x339d84){var _0x3df2aa={};var _0x422681={};var _0x2f25c5;var _0x180711;return db[_0x3b02('0x50')]['findOne']({'where':{'id':_0x14b1d0[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x410dc1,null))['then'](function(_0x339408){if(_0x339408){_0x2f25c5=_0x339408;_0x422681['model']=_[_0x3b02('0x41')](db[_0x3b02('0x127')][_0x3b02('0x3c')]);_0x422681[_0x3b02('0x40')]=_['keys'](_0x14b1d0['query']);_0x422681[_0x3b02('0x42')]=_[_0x3b02('0x43')](_0x422681[_0x3b02('0x3e')],_0x422681[_0x3b02('0x40')]);_0x3df2aa[_0x3b02('0x44')]=_[_0x3b02('0x43')](_0x422681['model'],qs[_0x3b02('0x45')](_0x14b1d0[_0x3b02('0x40')]['fields']));_0x3df2aa['attributes']=_0x3df2aa['attributes']['length']?_0x3df2aa[_0x3b02('0x44')]:_0x422681[_0x3b02('0x3e')];_0x3df2aa['order']=qs[_0x3b02('0x49')](_0x14b1d0[_0x3b02('0x40')][_0x3b02('0x49')]);_0x3df2aa['where']=qs[_0x3b02('0x42')](_['pick'](_0x14b1d0[_0x3b02('0x40')],_0x422681[_0x3b02('0x42')]));if(_0x14b1d0[_0x3b02('0x40')]['filter']){_0x3df2aa['where']=_[_0x3b02('0x4c')](_0x3df2aa['where'],{'$or':_[_0x3b02('0x3f')](_0x3df2aa['attributes'],function(_0x561e19){var _0x3210e1={};_0x3210e1[_0x561e19]={'$like':'%'+_0x14b1d0[_0x3b02('0x40')][_0x3b02('0x4e')]+'%'};return _0x3210e1;})});}_0x3df2aa=_[_0x3b02('0x4c')]({},_0x3df2aa,_0x14b1d0[_0x3b02('0x4f')]);return _0x2f25c5[_0x3b02('0x10b')](_0x3df2aa);}})['then'](function(_0xfe3419){if(_0xfe3419){_0x180711=_0xfe3419[_0x3b02('0x46')];if(!_0x14b1d0[_0x3b02('0x40')][_0x3b02('0x47')](_0x3b02('0x48'))){_0x3df2aa[_0x3b02('0x2b')]=qs[_0x3b02('0x2b')](_0x14b1d0[_0x3b02('0x40')][_0x3b02('0x2b')]);_0x3df2aa[_0x3b02('0x29')]=qs[_0x3b02('0x29')](_0x14b1d0[_0x3b02('0x40')][_0x3b02('0x29')]);}return _0x2f25c5['getProactiveActions'](_0x3df2aa);}})['then'](function(_0x5c7a17){if(_0x5c7a17){return _0x5c7a17?{'count':_0x180711,'rows':_0x5c7a17}:null;}})[_0x3b02('0x1e')](respondWithResult(_0x410dc1,null))[_0x3b02('0x5a')](handleError(_0x410dc1,null));};exports['getFields']=function(_0x384910,_0x165852,_0x5f50cc){var _0x1be42c=_0x384910['query'][_0x3b02('0x128')]===_0x3b02('0x129')?'offlineForm':'onlineForm';return db[_0x3b02('0x50')][_0x3b02('0x54')]({'attributes':['id',_0x1be42c],'where':{'id':_0x384910[_0x3b02('0x5c')]['id']}})['then'](handleEntityNotFound(_0x165852,null))[_0x3b02('0x1e')](function(_0x35f48b){if(_0x35f48b){var _0x2ad911=_0x35f48b[_0x1be42c];var _0x50cf5b=_0x2ad911&&_0x2ad911[_0x3b02('0x12a')]?_0x2ad911[_0x3b02('0x12a')]:[];_0x165852['send']({'fromKey':_['isNil'](_0x2ad911[_0x3b02('0x12b')])?undefined:_0x2ad911['fromKey'],'count':_0x50cf5b[_0x3b02('0x46')],'rows':_0x50cf5b});}})[_0x3b02('0x5a')](handleError(_0x165852,null));};exports[_0x3b02('0x12c')]=function(_0x4fc48b,_0x3b0f8c,_0xb9c7c5){var _0x575e76={'raw':![],'where':{}};var _0x122281={};var _0x5ab164={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x4fc48b[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x3b0f8c,null))[_0x3b02('0x1e')](function(_0x21abd7){if(_0x21abd7){_0x122281['model']=_[_0x3b02('0x41')](db[_0x3b02('0xd3')][_0x3b02('0x3c')]);_0x122281[_0x3b02('0x40')]=_[_0x3b02('0x41')](_0x4fc48b[_0x3b02('0x40')]);_0x122281['filters']=_[_0x3b02('0x43')](_0x122281[_0x3b02('0x3e')],_0x122281[_0x3b02('0x40')]);_0x575e76[_0x3b02('0x44')]=_[_0x3b02('0x43')](_0x122281[_0x3b02('0x3e')],qs[_0x3b02('0x45')](_0x4fc48b[_0x3b02('0x40')][_0x3b02('0x45')]));_0x575e76[_0x3b02('0x44')]=_0x575e76[_0x3b02('0x44')]['length']?_0x575e76[_0x3b02('0x44')]:_0x122281[_0x3b02('0x3e')];if(!_0x4fc48b[_0x3b02('0x40')][_0x3b02('0x47')](_0x3b02('0x48'))){_0x575e76[_0x3b02('0x2b')]=qs[_0x3b02('0x2b')](_0x4fc48b[_0x3b02('0x40')][_0x3b02('0x2b')]);_0x575e76[_0x3b02('0x29')]=qs[_0x3b02('0x29')](_0x4fc48b[_0x3b02('0x40')][_0x3b02('0x29')]);}_0x575e76['order']=qs[_0x3b02('0x49')](_0x4fc48b['query'][_0x3b02('0x49')]);_0x575e76[_0x3b02('0x4b')]=qs[_0x3b02('0x42')](_[_0x3b02('0x4a')](_0x4fc48b[_0x3b02('0x40')],_0x122281['filters']));_0x575e76['where'][_0x3b02('0x5f')]=_0x21abd7['id'];if(_0x4fc48b[_0x3b02('0x40')]['filter']){_0x575e76[_0x3b02('0x4b')]=_[_0x3b02('0x4c')](_0x575e76['where'],{'$or':_[_0x3b02('0x3f')](_0x575e76[_0x3b02('0x44')],function(_0x268641){var _0x20a352={};_0x20a352[_0x268641]={'$like':'%'+_0x4fc48b['query']['filter']+'%'};return _0x20a352;})});}_0x575e76=_[_0x3b02('0x4c')]({},_0x575e76,_0x4fc48b[_0x3b02('0x4f')]);return db['ChatOfflineMessage'][_0x3b02('0x2c')]({'where':_0x575e76[_0x3b02('0x4b')]})[_0x3b02('0x1e')](function(_0x360df4){_0x5ab164['count']=_0x360df4;if(_0x4fc48b[_0x3b02('0x40')]['includeAll']){_0x575e76[_0x3b02('0x68')]=[{'all':!![]}];}else{_0x575e76['include']=[{'model':db['CmContact'],'as':_0x3b02('0xf4'),'required':![]},{'model':db[_0x3b02('0x12d')],'as':_0x3b02('0x12e'),'required':![]}];}return db[_0x3b02('0xd3')][_0x3b02('0x52')](_0x575e76);})[_0x3b02('0x1e')](function(_0x26f9f0){_0x5ab164['rows']=_0x26f9f0;return _0x5ab164;});}})['then'](respondWithFilteredResult(_0x3b0f8c,_0x575e76))[_0x3b02('0x5a')](handleError(_0x3b0f8c,null));};exports[_0x3b02('0x12f')]=function(_0x125afc,_0x4d20cc,_0x25ea5d){return db[_0x3b02('0x50')]['find']({'where':{'id':_0x125afc[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x4d20cc,null))[_0x3b02('0x1e')](function(_0x9809e){if(_0x9809e){return _0x9809e['addAgents'](_0x125afc[_0x3b02('0x56')][_0x3b02('0x64')],_[_0x3b02('0x126')](_0x125afc[_0x3b02('0x56')],[_0x3b02('0x64'),'id'])||{})['spread'](function(_0x479329){for(var _0x5ac1d4=0x0;_0x5ac1d4<_0x125afc[_0x3b02('0x56')]['ids'][_0x3b02('0x46')];_0x5ac1d4+=0x1){socket[_0x3b02('0x130')](_0x3b02('0x131'),{'UserId':Number(_0x125afc[_0x3b02('0x56')][_0x3b02('0x64')][_0x5ac1d4]),'ChatWebsiteId':Number(_0x125afc['params']['id'])});}return _0x479329;});}})[_0x3b02('0x1e')](respondWithResult(_0x4d20cc,null))[_0x3b02('0x5a')](handleError(_0x4d20cc,null));};exports[_0x3b02('0x132')]=function(_0x5f033f,_0x5792cb,_0x4336be){return db[_0x3b02('0x50')][_0x3b02('0x54')]({'where':{'id':_0x5f033f[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x5792cb,null))[_0x3b02('0x1e')](function(_0x2068f7){if(_0x2068f7){return _0x2068f7[_0x3b02('0x132')](_0x5f033f[_0x3b02('0x40')][_0x3b02('0x64')])['then'](function(){if(_[_0x3b02('0x133')](_0x5f033f[_0x3b02('0x40')]['ids'])){for(var _0x3a2543=0x0;_0x3a2543<_0x5f033f[_0x3b02('0x40')][_0x3b02('0x64')][_0x3b02('0x46')];_0x3a2543+=0x1){socket[_0x3b02('0x130')](_0x3b02('0x134'),{'UserId':Number(_0x5f033f[_0x3b02('0x40')][_0x3b02('0x64')][_0x3a2543]),'ChatWebsiteId':Number(_0x5f033f[_0x3b02('0x5c')]['id'])});}}else{socket['emit'](_0x3b02('0x134'),{'UserId':Number(_0x5f033f['query']['ids']),'ChatWebsiteId':Number(_0x5f033f[_0x3b02('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x5792cb,null))['catch'](handleError(_0x5792cb,null));};exports[_0x3b02('0x135')]=function(_0x31d623,_0x43df00,_0x4ce811){var _0x3c0cac={};var _0x311e6e={};var _0x112bb5;var _0x577c1a;return db['ChatWebsite'][_0x3b02('0x61')]({'where':{'id':_0x31d623[_0x3b02('0x5c')]['id']}})[_0x3b02('0x1e')](handleEntityNotFound(_0x43df00,null))['then'](function(_0xfa972d){if(_0xfa972d){_0x112bb5=_0xfa972d;_0x311e6e[_0x3b02('0x3e')]=_[_0x3b02('0x41')](db[_0x3b02('0xf5')]['rawAttributes']);_0x311e6e['query']=_[_0x3b02('0x41')](_0x31d623[_0x3b02('0x40')]);_0x311e6e[_0x3b02('0x42')]=_['intersection'](_0x311e6e[_0x3b02('0x3e')],_0x311e6e[_0x3b02('0x40')]);_0x3c0cac[_0x3b02('0x44')]=_[_0x3b02('0x43')](_0x311e6e[_0x3b02('0x3e')],qs[_0x3b02('0x45')](_0x31d623['query'][_0x3b02('0x45')]));_0x3c0cac[_0x3b02('0x44')]=_0x3c0cac[_0x3b02('0x44')][_0x3b02('0x46')]?_0x3c0cac[_0x3b02('0x44')]:_0x311e6e['model'];_0x3c0cac[_0x3b02('0x62')]=qs[_0x3b02('0x49')](_0x31d623[_0x3b02('0x40')][_0x3b02('0x49')]);_0x3c0cac[_0x3b02('0x4b')]=qs[_0x3b02('0x42')](_[_0x3b02('0x4a')](_0x31d623[_0x3b02('0x40')],_0x311e6e[_0x3b02('0x42')]));if(_0x31d623[_0x3b02('0x40')][_0x3b02('0x4e')]){_0x3c0cac[_0x3b02('0x4b')]=_['merge'](_0x3c0cac[_0x3b02('0x4b')],{'$or':_[_0x3b02('0x3f')](_0x3c0cac[_0x3b02('0x44')],function(_0xd22601){var _0x331439={};_0x331439[_0xd22601]={'$like':'%'+_0x31d623['query'][_0x3b02('0x4e')]+'%'};return _0x331439;})});}_0x3c0cac=_[_0x3b02('0x4c')]({},_0x3c0cac,_0x31d623[_0x3b02('0x4f')]);return _0x112bb5[_0x3b02('0x135')](_0x3c0cac);}})[_0x3b02('0x1e')](function(_0x1f4c12){if(_0x1f4c12){_0x577c1a=_0x1f4c12[_0x3b02('0x46')];if(!_0x31d623[_0x3b02('0x40')][_0x3b02('0x47')]('nolimit')){_0x3c0cac[_0x3b02('0x2b')]=qs['limit'](_0x31d623[_0x3b02('0x40')][_0x3b02('0x2b')]);_0x3c0cac['offset']=qs[_0x3b02('0x29')](_0x31d623[_0x3b02('0x40')][_0x3b02('0x29')]);}return _0x112bb5['getAgents'](_0x3c0cac);}})[_0x3b02('0x1e')](function(_0x1c7784){if(_0x1c7784){return _0x1c7784?{'count':_0x577c1a,'rows':_0x1c7784}:null;}})[_0x3b02('0x1e')](respondWithResult(_0x43df00,null))[_0x3b02('0x5a')](handleError(_0x43df00,null));};
\ No newline at end of file
index 86f5711..341e1b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x294b=['events','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2e2c61,_0x2056a5){var _0x545a0d=function(_0x151af0){while(--_0x151af0){_0x2e2c61['push'](_0x2e2c61['shift']());}};_0x545a0d(++_0x2056a5);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb294('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xb294('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb294('0x2')](0x0);var events={'afterCreate':_0xb294('0x3'),'afterUpdate':_0xb294('0x4'),'afterDestroy':_0xb294('0x5')};function emitEvent(_0x417648){return function(_0x58fe24,_0x5c0237,_0xba5c68){ChatWebsiteEvents[_0xb294('0x6')](_0x417648+':'+_0x58fe24['id'],_0x58fe24);ChatWebsiteEvents[_0xb294('0x6')](_0x417648,_0x58fe24);_0xba5c68(null);};}for(var e in events){if(events[_0xb294('0x7')](e)){var event=events[e];ChatWebsite[_0xb294('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x7579=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x471a8f,_0x1256ad){var _0x1121fa=function(_0x52cbca){while(--_0x52cbca){_0x471a8f['push'](_0x471a8f['shift']());}};_0x1121fa(++_0x1256ad);}(_0x7579,0x1e2));var _0x9757=function(_0x5dde68,_0x4b1b35){_0x5dde68=_0x5dde68-0x0;var _0x3ba8fc=_0x7579[_0x5dde68];return _0x3ba8fc;};'use strict';var EventEmitter=require(_0x9757('0x0'));var ChatWebsite=require(_0x9757('0x1'))['db'][_0x9757('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9757('0x3')](0x0);var events={'afterCreate':_0x9757('0x4'),'afterUpdate':_0x9757('0x5'),'afterDestroy':'remove'};function emitEvent(_0x399165){return function(_0x231ca6,_0xcffaa0,_0x213a7a){ChatWebsiteEvents['emit'](_0x399165+':'+_0x231ca6['id'],_0x231ca6);ChatWebsiteEvents[_0x9757('0x6')](_0x399165,_0x231ca6);_0x213a7a(null);};}for(var e in events){if(events[_0x9757('0x7')](e)){var event=events[e];ChatWebsite[_0x9757('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
index fff9bc4..1ccaf2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x101c=['./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xb59f0a,_0x359364){var _0x1f8b8a=function(_0x53e24b){while(--_0x53e24b){_0xb59f0a['push'](_0xb59f0a['shift']());}};_0x1f8b8a(++_0x359364);}(_0x101c,0xa0));var _0xc101=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x101c[_0x3b150c];return _0x5cd414;};'use strict';var _=require(_0xc101('0x0'));var util=require(_0xc101('0x1'));var logger=require(_0xc101('0x2'))(_0xc101('0x3'));var moment=require(_0xc101('0x4'));var BPromise=require(_0xc101('0x5'));var rp=require(_0xc101('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc101('0x7'));var config=require(_0xc101('0x8'));var attributes=require(_0xc101('0x9'));module['exports']=function(_0x118bb1,_0x455a16){return _0x118bb1[_0xc101('0xa')](_0xc101('0xb'),attributes,{'tableName':_0xc101('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd147=['ChatWebsite','lodash','util','api','moment','request-promise','rimraf','exports','define'];(function(_0x1ff44d,_0x5ca0cc){var _0x24e958=function(_0x32f161){while(--_0x32f161){_0x1ff44d['push'](_0x1ff44d['shift']());}};_0x24e958(++_0x5ca0cc);}(_0xd147,0x19f));var _0x7d14=function(_0x4af308,_0x523294){_0x4af308=_0x4af308-0x0;var _0x5c588c=_0xd147[_0x4af308];return _0x5c588c;};'use strict';var _=require(_0x7d14('0x0'));var util=require(_0x7d14('0x1'));var logger=require('../../config/logger')(_0x7d14('0x2'));var moment=require(_0x7d14('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d14('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d14('0x5'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x7d14('0x6')]=function(_0x4bb66b,_0x4b5b4c){return _0x4bb66b[_0x7d14('0x7')](_0x7d14('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 85636b0..8c4de8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeeb0=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis'];(function(_0x162565,_0x88c845){var _0x334d4d=function(_0x2bd3b5){while(--_0x2bd3b5){_0x162565['push'](_0x162565['shift']());}};_0x334d4d(++_0x88c845);}(_0xeeb0,0xcc));var _0x0eeb=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0xeeb0[_0x4cd690];return _0x4a74a9;};'use strict';var _=require(_0x0eeb('0x0'));var util=require(_0x0eeb('0x1'));var moment=require('moment');var BPromise=require(_0x0eeb('0x2'));var rs=require(_0x0eeb('0x3'));var fs=require('fs');var Redis=require(_0x0eeb('0x4'));var db=require(_0x0eeb('0x5'))['db'];var utils=require(_0x0eeb('0x6'));var logger=require(_0x0eeb('0x7'))(_0x0eeb('0x8'));var config=require(_0x0eeb('0x9'));var jayson=require(_0x0eeb('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x0eeb('0xb')]=_[_0x0eeb('0xc')](config[_0x0eeb('0xb')],{'host':_0x0eeb('0xd'),'port':0x18eb});var socket=require(_0x0eeb('0xe'))(new Redis(config[_0x0eeb('0xb')]));require(_0x0eeb('0xf'))['register'](socket);function respondWithRpcPromise(_0x15a066,_0x2ef131,_0x40d30a){return new BPromise(function(_0x262725,_0x346c4b){return client['request'](_0x15a066,_0x40d30a)[_0x0eeb('0x10')](function(_0x4a0263){logger[_0x0eeb('0x11')](_0x0eeb('0x12'),_0x2ef131,_0x0eeb('0x13'));logger[_0x0eeb('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2ef131,_0x0eeb('0x13'),JSON[_0x0eeb('0x15')](_0x4a0263));if(_0x4a0263[_0x0eeb('0x16')]){if(_0x4a0263['error'][_0x0eeb('0x17')]===0x1f4){logger[_0x0eeb('0x16')](_0x0eeb('0x12'),_0x2ef131,_0x4a0263[_0x0eeb('0x16')][_0x0eeb('0x18')]);return _0x346c4b(_0x4a0263[_0x0eeb('0x16')][_0x0eeb('0x18')]);}logger[_0x0eeb('0x16')](_0x0eeb('0x12'),_0x2ef131,_0x4a0263[_0x0eeb('0x16')]['message']);return _0x262725(_0x4a0263[_0x0eeb('0x16')][_0x0eeb('0x18')]);}else{logger[_0x0eeb('0x11')](_0x0eeb('0x12'),_0x2ef131,_0x0eeb('0x13'));_0x262725(_0x4a0263[_0x0eeb('0x19')]['message']);}})[_0x0eeb('0x1a')](function(_0x335434){logger[_0x0eeb('0x16')](_0x0eeb('0x12'),_0x2ef131,_0x335434);_0x346c4b(_0x335434);});});}
\ No newline at end of file
+var _0xd2ef=['result','lodash','util','moment','bluebird','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s'];(function(_0x2e085f,_0x10b57d){var _0x3ebb1b=function(_0x14b151){while(--_0x14b151){_0x2e085f['push'](_0x2e085f['shift']());}};_0x3ebb1b(++_0x10b57d);}(_0xd2ef,0x191));var _0xfd2e=function(_0x44cd07,_0x3f88cd){_0x44cd07=_0x44cd07-0x0;var _0x2eca8a=_0xd2ef[_0x44cd07];return _0x2eca8a;};'use strict';var _=require(_0xfd2e('0x0'));var util=require(_0xfd2e('0x1'));var moment=require(_0xfd2e('0x2'));var BPromise=require(_0xfd2e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd2e('0x4'));var config=require(_0xfd2e('0x5'));var jayson=require(_0xfd2e('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xfd2e('0x7')]=_[_0xfd2e('0x8')](config[_0xfd2e('0x7')],{'host':_0xfd2e('0x9'),'port':0x18eb});var socket=require(_0xfd2e('0xa'))(new Redis(config[_0xfd2e('0x7')]));require(_0xfd2e('0xb'))[_0xfd2e('0xc')](socket);function respondWithRpcPromise(_0x5a0dcc,_0x42bf14,_0xbbba3d){return new BPromise(function(_0x277b64,_0x4430f5){return client[_0xfd2e('0xd')](_0x5a0dcc,_0xbbba3d)[_0xfd2e('0xe')](function(_0x175884){logger[_0xfd2e('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x42bf14,_0xfd2e('0x10'));logger[_0xfd2e('0x11')](_0xfd2e('0x12'),_0x42bf14,_0xfd2e('0x10'),JSON[_0xfd2e('0x13')](_0x175884));if(_0x175884['error']){if(_0x175884[_0xfd2e('0x14')][_0xfd2e('0x15')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x42bf14,_0x175884[_0xfd2e('0x14')][_0xfd2e('0x16')]);return _0x4430f5(_0x175884[_0xfd2e('0x14')][_0xfd2e('0x16')]);}logger[_0xfd2e('0x14')](_0xfd2e('0x17'),_0x42bf14,_0x175884[_0xfd2e('0x14')][_0xfd2e('0x16')]);return _0x277b64(_0x175884[_0xfd2e('0x14')][_0xfd2e('0x16')]);}else{logger[_0xfd2e('0xf')](_0xfd2e('0x17'),_0x42bf14,_0xfd2e('0x10'));_0x277b64(_0x175884[_0xfd2e('0x18')][_0xfd2e('0x16')]);}})['catch'](function(_0x58eb63){logger['error'](_0xfd2e('0x17'),_0x42bf14,_0x58eb63);_0x4430f5(_0x58eb63);});});}
\ No newline at end of file
index 7416b3f..a237438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79ee=['emit','removeListener','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x79ee,0x165));var _0xe79e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x79ee[_0x199572];return _0x13cfa3;};'use strict';var ChatWebsiteEvents=require(_0xe79e('0x0'));var events=[_0xe79e('0x1'),_0xe79e('0x2'),'update'];function createListener(_0x404ae4,_0x446afc){return function(_0xd8b351){_0x446afc[_0xe79e('0x3')](_0x404ae4,_0xd8b351);};}function removeListener(_0x4df6ea,_0x4af946){return function(){ChatWebsiteEvents[_0xe79e('0x4')](_0x4df6ea,_0x4af946);};}exports['register']=function(_0x2d8324){for(var _0x17f627=0x0,_0x260365=events['length'];_0x17f627<_0x260365;_0x17f627++){var _0x32db86=events[_0x17f627];var _0x3181e8=createListener(_0xe79e('0x5')+_0x32db86,_0x2d8324);ChatWebsiteEvents['on'](_0x32db86,_0x3181e8);}};
\ No newline at end of file
+var _0x628a=['save','remove','update','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x5e20c4,_0x4e4cfa){var _0x3d5977=function(_0x2f5157){while(--_0x2f5157){_0x5e20c4['push'](_0x5e20c4['shift']());}};_0x3d5977(++_0x4e4cfa);}(_0x628a,0x1d4));var _0xa628=function(_0x4ff59a,_0x2078d9){_0x4ff59a=_0x4ff59a-0x0;var _0x3c4917=_0x628a[_0x4ff59a];return _0x3c4917;};'use strict';var ChatWebsiteEvents=require(_0xa628('0x0'));var events=[_0xa628('0x1'),_0xa628('0x2'),_0xa628('0x3')];function createListener(_0x29ae8c,_0x2fc7a2){return function(_0x441f18){_0x2fc7a2['emit'](_0x29ae8c,_0x441f18);};}function removeListener(_0x4da2f9,_0x30933d){return function(){ChatWebsiteEvents['removeListener'](_0x4da2f9,_0x30933d);};}exports[_0xa628('0x4')]=function(_0x4218b){for(var _0x14a99e=0x0,_0x1b1f6a=events[_0xa628('0x5')];_0x14a99e<_0x1b1f6a;_0x14a99e++){var _0x4fb810=events[_0x14a99e];var _0x800699=createListener(_0xa628('0x6')+_0x4fb810,_0x4218b);ChatWebsiteEvents['on'](_0x4fb810,_0x800699);}};
\ No newline at end of file
index 09d38bc..1aabd02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x119a=['/:id/logo','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','now','addCustomerAvatar','/:id/system_avatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','any','offline','addInteraction','/:id/proactive_actions','addAgents','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','fs-extra','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','diskStorage','join','root','format','originalname'];(function(_0x3a60bc,_0x4dcfb8){var _0x2064ff=function(_0x3dc062){while(--_0x3dc062){_0x3a60bc['push'](_0x3a60bc['shift']());}};_0x2064ff(++_0x4dcfb8);}(_0x119a,0xa8));var _0xa119=function(_0x5aeccb,_0x210845){_0x5aeccb=_0x5aeccb-0x0;var _0x3c5ffb=_0x119a[_0x5aeccb];return _0x3c5ffb;};'use strict';var multer=require(_0xa119('0x0'));var util=require('util');var path=require(_0xa119('0x1'));var timeout=require(_0xa119('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa119('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa119('0x4'));var controller=require(_0xa119('0x5'));router['get']('/',auth[_0xa119('0x6')](),controller[_0xa119('0x7')]);router[_0xa119('0x8')](_0xa119('0x9'),auth[_0xa119('0x6')](),controller[_0xa119('0xa')]);router[_0xa119('0x8')](_0xa119('0xb'),auth[_0xa119('0x6')](),controller[_0xa119('0xc')]);router['get'](_0xa119('0xd'),auth['isAuthenticated'](),controller[_0xa119('0xe')]);router[_0xa119('0x8')](_0xa119('0xf'),auth[_0xa119('0x6')](),controller[_0xa119('0x10')]);router[_0xa119('0x8')]('/:id/logo',controller['getLogo']);router[_0xa119('0x8')](_0xa119('0x11'),controller[_0xa119('0x12')]);router[_0xa119('0x8')](_0xa119('0x13'),controller[_0xa119('0x14')]);router[_0xa119('0x8')]('/:id/system_avatar',controller[_0xa119('0x15')]);router[_0xa119('0x8')](_0xa119('0x16'),auth[_0xa119('0x6')](),controller['getInteractions']);router[_0xa119('0x8')](_0xa119('0x17'),controller[_0xa119('0x18')]);router[_0xa119('0x8')](_0xa119('0x19'),auth['isAuthenticated'](),controller[_0xa119('0x1a')]);router[_0xa119('0x8')]('/:id/proactive_actions',auth[_0xa119('0x6')](),controller[_0xa119('0x1b')]);router[_0xa119('0x8')](_0xa119('0x1c'),controller['getFields']);router[_0xa119('0x8')](_0xa119('0x1d'),auth['isAuthenticated'](),controller[_0xa119('0x1e')]);router['get'](_0xa119('0x1f'),auth[_0xa119('0x6')](),controller[_0xa119('0x20')]);router['post']('/',auth[_0xa119('0x6')](),controller[_0xa119('0x21')]);router[_0xa119('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xa119('0x23')]);router[_0xa119('0x22')](_0xa119('0xf'),auth[_0xa119('0x6')](),controller[_0xa119('0x24')]);var upload=multer({'storage':multer[_0xa119('0x25')]({'destination':function(_0x2805c2,_0xd3e829,_0x3bda6e){_0x3bda6e(null,path[_0xa119('0x26')](config[_0xa119('0x27')],'server/files/images/logos/'));},'filename':function(_0x3bada0,_0x1376db,_0x44c3f8){_0x44c3f8(null,util[_0xa119('0x28')]('%s-%s',Date['now'](),_0x1376db[_0xa119('0x29')]));}})});router['post'](_0xa119('0x2a'),upload[_0xa119('0x2b')](_0xa119('0x2c')),controller[_0xa119('0x2d')]);var upload=multer({'storage':multer[_0xa119('0x25')]({'destination':function(_0x474ddd,_0x2b2203,_0x463ec4){_0x463ec4(null,path[_0xa119('0x26')](config[_0xa119('0x27')],_0xa119('0x2e')));},'filename':function(_0x91edc3,_0x2efbbd,_0x289c85){_0x289c85(null,util[_0xa119('0x28')](_0xa119('0x2f'),Date['now'](),_0x2efbbd['originalname']));}})});router[_0xa119('0x22')](_0xa119('0x11'),upload[_0xa119('0x2b')](_0xa119('0x2c')),controller[_0xa119('0x30')]);var upload=multer({'storage':multer[_0xa119('0x25')]({'destination':function(_0xb22a0d,_0xe639c0,_0x252efc){_0x252efc(null,path[_0xa119('0x26')](config[_0xa119('0x27')],_0xa119('0x2e')));},'filename':function(_0x4afd09,_0x5e7ed7,_0x3f1963){_0x3f1963(null,util[_0xa119('0x28')](_0xa119('0x2f'),Date[_0xa119('0x31')](),_0x5e7ed7[_0xa119('0x29')]));}})});router[_0xa119('0x22')](_0xa119('0x13'),upload[_0xa119('0x2b')]('file'),controller[_0xa119('0x32')]);var upload=multer({'storage':multer[_0xa119('0x25')]({'destination':function(_0xdd1c90,_0x4b79f5,_0x50d9c4){_0x50d9c4(null,path[_0xa119('0x26')](config['root'],_0xa119('0x2e')));},'filename':function(_0x3a58d8,_0x53f6ae,_0xcdf41f){_0xcdf41f(null,util[_0xa119('0x28')](_0xa119('0x2f'),Date[_0xa119('0x31')](),_0x53f6ae[_0xa119('0x29')]));}})});router['post'](_0xa119('0x33'),upload[_0xa119('0x2b')]('file'),controller['addSystemAvatar']);router[_0xa119('0x22')](_0xa119('0x34'),controller[_0xa119('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xa119('0x25')]({'destination':function(_0x1de5c5,_0xc158af,_0x534b42){const _0x57e9eb=path['join'](config[_0xa119('0x27')],'server/files',_0xa119('0x36'),_0xa119('0x37'));fs_extra[_0xa119('0x38')](_0x57e9eb,function(){_0x534b42(null,_0x57e9eb);});},'filename':function(_0x4e5d84,_0x5894e5,_0x3b6b9d){const _0x17274a=_0x5894e5[_0xa119('0x29')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5b9909=path['extname'](_0x17274a);const _0x27f782=Date['now']()+'-'+_0x17274a[_0xa119('0x39')](_0x5b9909,'')+_0x5b9909;_0x3b6b9d(null,_0x27f782);}})});router['post']('/:id/offline',offlineUploadMulter[_0xa119('0x3a')](),controller[_0xa119('0x3b')]);router[_0xa119('0x22')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xa119('0x3c')]);router[_0xa119('0x22')](_0xa119('0x19'),auth[_0xa119('0x6')](),controller['addApplications']);router[_0xa119('0x22')](_0xa119('0x3d'),auth[_0xa119('0x6')](),controller['addProactiveActions']);router[_0xa119('0x22')]('/:id/users',auth[_0xa119('0x6')](),controller[_0xa119('0x3e')]);router[_0xa119('0x3f')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xa119('0xb'),auth['isAuthenticated'](),controller[_0xa119('0x40')]);router[_0xa119('0x41')]('/:id/dispositions',auth[_0xa119('0x6')](),controller[_0xa119('0x42')]);router['delete'](_0xa119('0xf'),auth[_0xa119('0x6')](),controller[_0xa119('0x43')]);router[_0xa119('0x41')](_0xa119('0x1f'),auth['isAuthenticated'](),controller[_0xa119('0x44')]);module[_0xa119('0x45')]=router;
\ No newline at end of file
+var _0x10c2=['show','getDispositions','/:id/logo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','file','addLogo','server/files/images/avatars/','originalname','addAvatar','root','single','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','attachments','offline-chat','ensureDir','replace','extname','offline','/:id/proactive_actions','addProactiveActions','addAgents','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x2b2bfc,_0x19eca2){var _0x38a157=function(_0x34dd21){while(--_0x34dd21){_0x2b2bfc['push'](_0x2b2bfc['shift']());}};_0x38a157(++_0x19eca2);}(_0x10c2,0x1ce));var _0x210c=function(_0x2a1479,_0x1d65bc){_0x2a1479=_0x2a1479-0x0;var _0x2c28e1=_0x10c2[_0x2a1479];return _0x2c28e1;};'use strict';var multer=require(_0x210c('0x0'));var util=require(_0x210c('0x1'));var path=require('path');var timeout=require(_0x210c('0x2'));var express=require(_0x210c('0x3'));var router=express[_0x210c('0x4')]();var fs_extra=require(_0x210c('0x5'));var auth=require(_0x210c('0x6'));var interaction=require(_0x210c('0x7'));var config=require('../../config/environment');var controller=require(_0x210c('0x8'));router[_0x210c('0x9')]('/',auth[_0x210c('0xa')](),controller['index']);router[_0x210c('0x9')](_0x210c('0xb'),auth['isAuthenticated'](),controller[_0x210c('0xc')]);router[_0x210c('0x9')](_0x210c('0xd'),auth['isAuthenticated'](),controller[_0x210c('0xe')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x210c('0xf')]);router[_0x210c('0x9')]('/:id/canned_answers',auth[_0x210c('0xa')](),controller['getAnswers']);router[_0x210c('0x9')](_0x210c('0x10'),controller['getLogo']);router[_0x210c('0x9')](_0x210c('0x11'),controller['getAvatar']);router[_0x210c('0x9')](_0x210c('0x12'),controller[_0x210c('0x13')]);router[_0x210c('0x9')]('/:id/system_avatar',controller[_0x210c('0x14')]);router[_0x210c('0x9')](_0x210c('0x15'),auth[_0x210c('0xa')](),controller[_0x210c('0x16')]);router[_0x210c('0x9')](_0x210c('0x17'),controller['getSnippet']);router['get'](_0x210c('0x18'),auth[_0x210c('0xa')](),controller[_0x210c('0x19')]);router[_0x210c('0x9')]('/:id/proactive_actions',auth[_0x210c('0xa')](),controller['getProactiveActions']);router[_0x210c('0x9')](_0x210c('0x1a'),controller['getFields']);router[_0x210c('0x9')](_0x210c('0x1b'),auth[_0x210c('0xa')](),controller[_0x210c('0x1c')]);router['get'](_0x210c('0x1d'),auth[_0x210c('0xa')](),controller[_0x210c('0x1e')]);router[_0x210c('0x1f')]('/',auth['isAuthenticated'](),controller[_0x210c('0x20')]);router[_0x210c('0x1f')](_0x210c('0x21'),auth[_0x210c('0xa')](),controller[_0x210c('0x22')]);router[_0x210c('0x1f')](_0x210c('0x23'),auth[_0x210c('0xa')](),controller[_0x210c('0x24')]);var upload=multer({'storage':multer[_0x210c('0x25')]({'destination':function(_0x15c793,_0x1b7f84,_0x538aa5){_0x538aa5(null,path[_0x210c('0x26')](config['root'],_0x210c('0x27')));},'filename':function(_0x24ac14,_0x124d0a,_0x521f85){_0x521f85(null,util[_0x210c('0x28')](_0x210c('0x29'),Date[_0x210c('0x2a')](),_0x124d0a['originalname']));}})});router[_0x210c('0x1f')](_0x210c('0x10'),upload['single'](_0x210c('0x2b')),controller[_0x210c('0x2c')]);var upload=multer({'storage':multer[_0x210c('0x25')]({'destination':function(_0x17f734,_0x2d2ecf,_0x343d4d){_0x343d4d(null,path[_0x210c('0x26')](config['root'],_0x210c('0x2d')));},'filename':function(_0x56c829,_0x5a50eb,_0x15fb50){_0x15fb50(null,util[_0x210c('0x28')]('%s-%s',Date[_0x210c('0x2a')](),_0x5a50eb[_0x210c('0x2e')]));}})});router['post']('/:id/avatar',upload['single']('file'),controller[_0x210c('0x2f')]);var upload=multer({'storage':multer[_0x210c('0x25')]({'destination':function(_0x9cee0f,_0x5af423,_0x573b94){_0x573b94(null,path[_0x210c('0x26')](config[_0x210c('0x30')],_0x210c('0x2d')));},'filename':function(_0x2f89aa,_0xfdda8c,_0x27bd79){_0x27bd79(null,util[_0x210c('0x28')](_0x210c('0x29'),Date[_0x210c('0x2a')](),_0xfdda8c['originalname']));}})});router[_0x210c('0x1f')](_0x210c('0x12'),upload[_0x210c('0x31')](_0x210c('0x2b')),controller[_0x210c('0x32')]);var upload=multer({'storage':multer[_0x210c('0x25')]({'destination':function(_0x10db98,_0x178009,_0x1cbb0e){_0x1cbb0e(null,path[_0x210c('0x26')](config[_0x210c('0x30')],_0x210c('0x2d')));},'filename':function(_0x3016cc,_0x29b372,_0x3b3d7b){_0x3b3d7b(null,util[_0x210c('0x28')](_0x210c('0x29'),Date[_0x210c('0x2a')](),_0x29b372[_0x210c('0x2e')]));}})});router[_0x210c('0x1f')](_0x210c('0x33'),upload[_0x210c('0x31')]('file'),controller[_0x210c('0x34')]);router[_0x210c('0x1f')]('/:id/notify',controller[_0x210c('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x210c('0x25')]({'destination':function(_0x3f3a47,_0x1dab9e,_0x32c147){const _0x36329c=path[_0x210c('0x26')](config['root'],'server/files',_0x210c('0x36'),_0x210c('0x37'));fs_extra[_0x210c('0x38')](_0x36329c,function(){_0x32c147(null,_0x36329c);});},'filename':function(_0x2bce8b,_0x4ab937,_0x1fdba7){const _0x58e11c=_0x4ab937[_0x210c('0x2e')][_0x210c('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x20d10e=path[_0x210c('0x3a')](_0x58e11c);const _0x2be0fe=Date[_0x210c('0x2a')]()+'-'+_0x58e11c[_0x210c('0x39')](_0x20d10e,'')+_0x20d10e;_0x1fdba7(null,_0x2be0fe);}})});router[_0x210c('0x1f')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x210c('0x3b')]);router[_0x210c('0x1f')](_0x210c('0x15'),auth[_0x210c('0xa')](),controller['addInteraction']);router[_0x210c('0x1f')](_0x210c('0x18'),auth[_0x210c('0xa')](),controller['addApplications']);router[_0x210c('0x1f')](_0x210c('0x3c'),auth['isAuthenticated'](),controller[_0x210c('0x3d')]);router[_0x210c('0x1f')](_0x210c('0x1d'),auth['isAuthenticated'](),controller[_0x210c('0x3e')]);router['put'](_0x210c('0xd'),auth[_0x210c('0xa')](),controller['update']);router[_0x210c('0x3f')](_0x210c('0xd'),auth[_0x210c('0xa')](),controller[_0x210c('0x40')]);router[_0x210c('0x3f')](_0x210c('0x21'),auth[_0x210c('0xa')](),controller[_0x210c('0x41')]);router[_0x210c('0x3f')]('/:id/canned_answers',auth[_0x210c('0xa')](),controller[_0x210c('0x42')]);router['delete'](_0x210c('0x1d'),auth[_0x210c('0xa')](),controller[_0x210c('0x43')]);module['exports']=router;
\ No newline at end of file
index 3f140a0..90093df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd69e=['sequelize','exports','STRING','AmazonAWS','Google'];(function(_0x8a405d,_0x3f2f74){var _0x49f209=function(_0x549712){while(--_0x549712){_0x8a405d['push'](_0x8a405d['shift']());}};_0x49f209(++_0x3f2f74);}(_0xd69e,0xa0));var _0xed69=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd69e[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0xed69('0x0'));module[_0xed69('0x1')]={'name':{'type':Sequelize[_0xed69('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xed69('0x3'),_0xed69('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2706=['STRING','ENUM','AmazonAWS','exports'];(function(_0x217b78,_0x46d8fd){var _0x1aa3f0=function(_0x22b429){while(--_0x22b429){_0x217b78['push'](_0x217b78['shift']());}};_0x1aa3f0(++_0x46d8fd);}(_0x2706,0x107));var _0x6270=function(_0x379b38,_0x38f437){_0x379b38=_0x379b38-0x0;var _0x5c75a5=_0x2706[_0x379b38];return _0x5c75a5;};'use strict';var Sequelize=require('sequelize');module[_0x6270('0x0')]={'name':{'type':Sequelize[_0x6270('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6270('0x2')](_0x6270('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x6270('0x1')]},'data2':{'type':Sequelize[_0x6270('0x1')]}};
\ No newline at end of file
index ecb27b1..eb739e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x431e02,_0x4d9ba8){var _0x2e93e1=function(_0x49a1d7){while(--_0x49a1d7){_0x431e02['push'](_0x431e02['shift']());}};_0x2e93e1(++_0x4d9ba8);}(_0x7a54,0x106));var _0x47a5=function(_0x27792e,_0x45f2fc){_0x27792e=_0x27792e-0x0;var _0x3e04ba=_0x7a54[_0x27792e];return _0x3e04ba;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
+var _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(_0x305a2b,_0x551ec1){var _0x4ee6c0=function(_0x4ea7b4){while(--_0x4ea7b4){_0x305a2b['push'](_0x305a2b['shift']());}};_0x4ee6c0(++_0x551ec1);}(_0xdb28,0x106));var _0x8db2=function(_0x2a1d6c,_0x4704df){_0x2a1d6c=_0x2a1d6c-0x0;var _0x3288e9=_0xdb28[_0x2a1d6c];return _0x3288e9;};'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 0500a5f..90ed760 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d9e=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3d9e,0xd8));var _0xe3d9=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x3d9e[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xe3d9('0x0'));var util=require(_0xe3d9('0x1'));var logger=require(_0xe3d9('0x2'))('api');var moment=require(_0xe3d9('0x3'));var BPromise=require(_0xe3d9('0x4'));var rp=require(_0xe3d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe3d9('0x6'));var config=require(_0xe3d9('0x7'));var attributes=require(_0xe3d9('0x8'));module['exports']=function(_0x31b92e,_0xd867c9){return _0x31b92e[_0xe3d9('0x9')](_0xe3d9('0xa'),attributes,{'tableName':_0xe3d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb463=['moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb463,0x192));var _0x3b46=function(_0x490c77,_0x216948){_0x490c77=_0x490c77-0x0;var _0x358ff8=_0xb463[_0x490c77];return _0x358ff8;};'use strict';var _=require(_0x3b46('0x0'));var util=require(_0x3b46('0x1'));var logger=require(_0x3b46('0x2'))(_0x3b46('0x3'));var moment=require(_0x3b46('0x4'));var BPromise=require(_0x3b46('0x5'));var rp=require(_0x3b46('0x6'));var fs=require('fs');var path=require(_0x3b46('0x7'));var rimraf=require('rimraf');var config=require(_0x3b46('0x8'));var attributes=require(_0x3b46('0x9'));module[_0x3b46('0xa')]=function(_0x4e3f22,_0x1e7056){return _0x4e3f22[_0x3b46('0xb')](_0x3b46('0xc'),attributes,{'tableName':_0x3b46('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cab98c6..abdd39a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab54=['error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','request','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x12c076,_0x5bef17){var _0x2ddd18=function(_0x436336){while(--_0x436336){_0x12c076['push'](_0x12c076['shift']());}};_0x2ddd18(++_0x5bef17);}(_0xab54,0x115));var _0x4ab5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab54[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4ab5('0x0'));var moment=require(_0x4ab5('0x1'));var BPromise=require(_0x4ab5('0x2'));var rs=require(_0x4ab5('0x3'));var fs=require('fs');var Redis=require(_0x4ab5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4ab5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4ab5('0x6'));var client=jayson[_0x4ab5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c39fe,_0x5c8c61,_0x467942){return new BPromise(function(_0x600112,_0xd57886){return client[_0x4ab5('0x8')](_0x2c39fe,_0x467942)['then'](function(_0x58e6a7){logger['info'](_0x4ab5('0x9'),_0x5c8c61,_0x4ab5('0xa'));logger['debug'](_0x4ab5('0xb'),_0x5c8c61,_0x4ab5('0xa'),JSON['stringify'](_0x58e6a7));if(_0x58e6a7[_0x4ab5('0xc')]){if(_0x58e6a7[_0x4ab5('0xc')][_0x4ab5('0xd')]===0x1f4){logger[_0x4ab5('0xc')](_0x4ab5('0x9'),_0x5c8c61,_0x58e6a7[_0x4ab5('0xc')][_0x4ab5('0xe')]);return _0xd57886(_0x58e6a7[_0x4ab5('0xc')][_0x4ab5('0xe')]);}logger[_0x4ab5('0xc')](_0x4ab5('0x9'),_0x5c8c61,_0x58e6a7[_0x4ab5('0xc')][_0x4ab5('0xe')]);return _0x600112(_0x58e6a7[_0x4ab5('0xc')]['message']);}else{logger[_0x4ab5('0xf')]('CloudProvider,\x20%s,\x20%s',_0x5c8c61,_0x4ab5('0xa'));_0x600112(_0x58e6a7['result']['message']);}})[_0x4ab5('0x10')](function(_0x1b1ca5){logger[_0x4ab5('0xc')](_0x4ab5('0x9'),_0x5c8c61,_0x1b1ca5);_0xd57886(_0x1b1ca5);});});}
\ No newline at end of file
+var _0xb9e7=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x4c321c,_0x3e9da0){_0x4c321c=_0x4c321c-0x0;var _0x25accb=_0xb9e7[_0x4c321c];return _0x25accb;};'use strict';var _=require('lodash');var util=require(_0x7b9e('0x0'));var moment=require(_0x7b9e('0x1'));var BPromise=require(_0x7b9e('0x2'));var rs=require(_0x7b9e('0x3'));var fs=require('fs');var Redis=require(_0x7b9e('0x4'));var db=require(_0x7b9e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b9e('0x6'))(_0x7b9e('0x7'));var config=require('../../config/environment');var jayson=require(_0x7b9e('0x8'));var client=jayson['client'][_0x7b9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ea3,_0x14e025,_0x9b53ea){return new BPromise(function(_0x30d1d8,_0x5c358c){return client[_0x7b9e('0xa')](_0x3e7ea3,_0x9b53ea)[_0x7b9e('0xb')](function(_0xb35b20){logger['info'](_0x7b9e('0xc'),_0x14e025,'request\x20sent');logger[_0x7b9e('0xd')](_0x7b9e('0xe'),_0x14e025,'request\x20sent',JSON['stringify'](_0xb35b20));if(_0xb35b20[_0x7b9e('0xf')]){if(_0xb35b20['error'][_0x7b9e('0x10')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x14e025,_0xb35b20['error'][_0x7b9e('0x11')]);return _0x5c358c(_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);}logger[_0x7b9e('0xf')]('CloudProvider,\x20%s,\x20%s',_0x14e025,_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);return _0x30d1d8(_0xb35b20[_0x7b9e('0xf')][_0x7b9e('0x11')]);}else{logger[_0x7b9e('0x12')](_0x7b9e('0xc'),_0x14e025,_0x7b9e('0x13'));_0x30d1d8(_0xb35b20[_0x7b9e('0x14')][_0x7b9e('0x11')]);}})[_0x7b9e('0x15')](function(_0x49e88c){logger[_0x7b9e('0xf')]('CloudProvider,\x20%s,\x20%s',_0x14e025,_0x49e88c);_0x5c358c(_0x49e88c);});});}
\ No newline at end of file
index 8ef83d4..b303c78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8e0=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','put','update'];(function(_0x3a6fe3,_0x9182e9){var _0xb2a478=function(_0x210e6a){while(--_0x210e6a){_0x3a6fe3['push'](_0x3a6fe3['shift']());}};_0xb2a478(++_0x9182e9);}(_0xc8e0,0x190));var _0x0c8e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc8e0[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x0c8e('0x0'));var util=require(_0x0c8e('0x1'));var path=require(_0x0c8e('0x2'));var timeout=require(_0x0c8e('0x3'));var express=require(_0x0c8e('0x4'));var router=express[_0x0c8e('0x5')]();var fs_extra=require(_0x0c8e('0x6'));var auth=require(_0x0c8e('0x7'));var interaction=require(_0x0c8e('0x8'));var config=require(_0x0c8e('0x9'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0x0c8e('0xa')](),controller[_0x0c8e('0xb')]);router[_0x0c8e('0xc')](_0x0c8e('0xd'),auth[_0x0c8e('0xa')](),controller[_0x0c8e('0xe')]);router[_0x0c8e('0xf')]('/',auth[_0x0c8e('0xa')](),controller['create']);router[_0x0c8e('0x10')](_0x0c8e('0xd'),auth[_0x0c8e('0xa')](),controller[_0x0c8e('0x11')]);router['delete'](_0x0c8e('0xd'),auth[_0x0c8e('0xa')](),controller[_0x0c8e('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x9c6f=['post','create','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5560ef,_0xbdad93){var _0x313fee=function(_0x3f7b63){while(--_0x3f7b63){_0x5560ef['push'](_0x5560ef['shift']());}};_0x313fee(++_0xbdad93);}(_0x9c6f,0x1a8));var _0xf9c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c6f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf9c6('0x0'));var util=require(_0xf9c6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf9c6('0x2'));var router=express[_0xf9c6('0x3')]();var fs_extra=require(_0xf9c6('0x4'));var auth=require(_0xf9c6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf9c6('0x6'));var controller=require(_0xf9c6('0x7'));router[_0xf9c6('0x8')]('/',auth[_0xf9c6('0x9')](),controller[_0xf9c6('0xa')]);router[_0xf9c6('0x8')](_0xf9c6('0xb'),auth['isAuthenticated'](),controller[_0xf9c6('0xc')]);router[_0xf9c6('0xd')]('/',auth[_0xf9c6('0x9')](),controller[_0xf9c6('0xe')]);router[_0xf9c6('0xf')](_0xf9c6('0xb'),auth[_0xf9c6('0x9')](),controller[_0xf9c6('0x10')]);router[_0xf9c6('0x11')](_0xf9c6('0xb'),auth[_0xf9c6('0x9')](),controller[_0xf9c6('0x12')]);module['exports']=router;
\ No newline at end of file
index 2a8eafa..8769c66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbca=['sequelize','STRING','name'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0xdbca,0x150));var _0xadbc=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0xdbca[_0x296809];return _0x18c0d3;};'use strict';var Sequelize=require(_0xadbc('0x0'));module['exports']={'name':{'type':Sequelize[_0xadbc('0x1')],'unique':_0xadbc('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xadbc('0x1')]},'companyId':{'type':Sequelize[_0xadbc('0x1')]},'website':{'type':Sequelize[_0xadbc('0x1')]},'phone':{'type':Sequelize[_0xadbc('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xadbc('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xadbc('0x1')]},'city':{'type':Sequelize[_0xadbc('0x1')]},'country':{'type':Sequelize[_0xadbc('0x1')]},'email':{'type':Sequelize[_0xadbc('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xadbc('0x1')]},'sStreet':{'type':Sequelize[_0xadbc('0x1')]},'sPostalCode':{'type':Sequelize[_0xadbc('0x1')]},'sCity':{'type':Sequelize[_0xadbc('0x1')]},'sCountry':{'type':Sequelize[_0xadbc('0x1')]},'description':{'type':Sequelize[_0xadbc('0x1')]}};
\ No newline at end of file
+var _0x7548=['STRING','sequelize','exports'];(function(_0x6317d6,_0x424384){var _0x5add4d=function(_0x176118){while(--_0x176118){_0x6317d6['push'](_0x6317d6['shift']());}};_0x5add4d(++_0x424384);}(_0x7548,0x1f3));var _0x8754=function(_0xa9f07d,_0x494aff){_0xa9f07d=_0xa9f07d-0x0;var _0x5635d8=_0x7548[_0xa9f07d];return _0x5635d8;};'use strict';var Sequelize=require(_0x8754('0x0'));module[_0x8754('0x1')]={'name':{'type':Sequelize[_0x8754('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8754('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x8754('0x2')]},'phone':{'type':Sequelize[_0x8754('0x2')]},'fax':{'type':Sequelize[_0x8754('0x2')]},'type':{'type':Sequelize[_0x8754('0x2')]},'street':{'type':Sequelize[_0x8754('0x2')]},'postalCode':{'type':Sequelize[_0x8754('0x2')]},'city':{'type':Sequelize[_0x8754('0x2')]},'country':{'type':Sequelize[_0x8754('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8754('0x2')]},'sStreet':{'type':Sequelize[_0x8754('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x8754('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2082d13..7407e10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f6e=['desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','undefined','offset','limit','set','Content-Range','reject','save','update','then','get','UserProfileResource','end','error','stack','send','index','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','CmCompany','count','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','CmContact','addContacts','ids','findOne','map','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce'];(function(_0x9f6f64,_0x4cd6df){var _0x3b9f5c=function(_0xb4fab1){while(--_0xb4fab1){_0x9f6f64['push'](_0x9f6f64['shift']());}};_0x3b9f5c(++_0x4cd6df);}(_0x1f6e,0xa6));var _0xe1f6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1f6e[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe1f6('0x0'));var zipdir=require(_0xe1f6('0x1'));var jsonpatch=require(_0xe1f6('0x2'));var rp=require(_0xe1f6('0x3'));var moment=require(_0xe1f6('0x4'));var BPromise=require(_0xe1f6('0x5'));var Mustache=require(_0xe1f6('0x6'));var util=require(_0xe1f6('0x7'));var path=require(_0xe1f6('0x8'));var sox=require(_0xe1f6('0x9'));var csv=require('to-csv');var ejs=require(_0xe1f6('0xa'));var fs=require('fs');var fs_extra=require(_0xe1f6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe1f6('0xc'));var jsforce=require(_0xe1f6('0xd'));var deskjs=require(_0xe1f6('0xe'));var toCsv=require(_0xe1f6('0xf'));var querystring=require('querystring');var Papa=require(_0xe1f6('0x10'));var Redis=require(_0xe1f6('0x11'));var authService=require(_0xe1f6('0x12'));var qs=require(_0xe1f6('0x13'));var as=require(_0xe1f6('0x14'));var hardwareService=require(_0xe1f6('0x15'));var logger=require(_0xe1f6('0x16'))(_0xe1f6('0x17'));var utils=require('../../config/utils');var config=require(_0xe1f6('0x18'));var licenseUtil=require(_0xe1f6('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53af80,_0x47dc25){_0x47dc25=_0x47dc25||0xcc;return function(_0x3ff6b0){if(_0x3ff6b0){return _0x53af80['sendStatus'](_0x47dc25);}return _0x53af80[_0xe1f6('0x1a')](_0x47dc25)['end']();};}function respondWithResult(_0x27bf8a,_0x5dcb39){_0x5dcb39=_0x5dcb39||0xc8;return function(_0x1c9749){if(_0x1c9749){return _0x27bf8a[_0xe1f6('0x1a')](_0x5dcb39)[_0xe1f6('0x1b')](_0x1c9749);}};}function respondWithFilteredResult(_0x1820f2,_0x5a4bdf){return function(_0x48e35a){if(_0x48e35a){var _0x4a5b46=typeof _0x5a4bdf['offset']==='undefined'&&typeof _0x5a4bdf['limit']===_0xe1f6('0x1c');var _0x6688a4=_0x48e35a['count'];var _0x5b044c=_0x4a5b46?0x0:_0x5a4bdf[_0xe1f6('0x1d')];var _0xa3b193=_0x4a5b46?_0x48e35a['count']:_0x5a4bdf[_0xe1f6('0x1d')]+_0x5a4bdf[_0xe1f6('0x1e')];var _0x59ef8d;if(_0xa3b193>=_0x6688a4){_0xa3b193=_0x6688a4;_0x59ef8d=0xc8;}else{_0x59ef8d=0xce;}_0x1820f2[_0xe1f6('0x1a')](_0x59ef8d);return _0x1820f2[_0xe1f6('0x1f')](_0xe1f6('0x20'),_0x5b044c+'-'+_0xa3b193+'/'+_0x6688a4)['json'](_0x48e35a);}return null;};}function patchUpdates(_0x1c619e){return function(_0x18b30d){try{jsonpatch['apply'](_0x18b30d,_0x1c619e,!![]);}catch(_0x5a35d6){return BPromise[_0xe1f6('0x21')](_0x5a35d6);}return _0x18b30d[_0xe1f6('0x22')]();};}function saveUpdates(_0xb93c1a,_0x1a5754){return function(_0x3f8868){if(_0x3f8868){return _0x3f8868[_0xe1f6('0x23')](_0xb93c1a)[_0xe1f6('0x24')](function(_0x243ac6){return _0x243ac6;});}return null;};}function removeEntity(_0x4c5ff8,_0x4d9516){return function(_0x13aa9f){if(_0x13aa9f){return _0x13aa9f['destroy']()[_0xe1f6('0x24')](function(){var _0xc66f7f=_0x13aa9f[_0xe1f6('0x25')]({'plain':!![]});var _0x4d79eb='Companies';return db[_0xe1f6('0x26')]['destroy']({'where':{'type':_0x4d79eb,'resourceId':_0xc66f7f['id']}})[_0xe1f6('0x24')](function(){return _0x13aa9f;});})[_0xe1f6('0x24')](function(){_0x4c5ff8[_0xe1f6('0x1a')](0xcc)[_0xe1f6('0x27')]();});}};}function handleEntityNotFound(_0x47de05,_0x5e1374){return function(_0x167c3f){if(!_0x167c3f){_0x47de05['sendStatus'](0x194);}return _0x167c3f;};}function handleError(_0x1ca628,_0x57f5e9){_0x57f5e9=_0x57f5e9||0x1f4;return function(_0x57cf0a){logger[_0xe1f6('0x28')](_0x57cf0a[_0xe1f6('0x29')]);if(_0x57cf0a['name']){delete _0x57cf0a['name'];}_0x1ca628[_0xe1f6('0x1a')](_0x57f5e9)[_0xe1f6('0x2a')](_0x57cf0a);};}exports[_0xe1f6('0x2b')]=function(_0x3d335b,_0x7d3d65){var _0x48cc3e={},_0x1fe4d5={},_0x5afa3c={'count':0x0,'rows':[]};return db['CmCompany']['describe']()['then'](function(_0x4e70cd){_0x1fe4d5['model']=_[_0xe1f6('0x2c')](_0x4e70cd);_0x1fe4d5['query']=_[_0xe1f6('0x2c')](_0x3d335b[_0xe1f6('0x2d')]);_0x1fe4d5[_0xe1f6('0x2e')]=_[_0xe1f6('0x2f')](_0x1fe4d5[_0xe1f6('0x30')],_0x1fe4d5['query']);_0x48cc3e['attributes']=_[_0xe1f6('0x2f')](_0x1fe4d5['model'],qs[_0xe1f6('0x31')](_0x3d335b['query'][_0xe1f6('0x31')]));_0x48cc3e[_0xe1f6('0x32')]=_0x48cc3e[_0xe1f6('0x32')]['length']?_0x48cc3e[_0xe1f6('0x32')]:_0x1fe4d5[_0xe1f6('0x30')];if(!_0x3d335b[_0xe1f6('0x2d')][_0xe1f6('0x33')](_0xe1f6('0x34'))){_0x48cc3e['limit']=qs[_0xe1f6('0x1e')](_0x3d335b[_0xe1f6('0x2d')]['limit']);_0x48cc3e[_0xe1f6('0x1d')]=qs['offset'](_0x3d335b[_0xe1f6('0x2d')][_0xe1f6('0x1d')]);}_0x48cc3e[_0xe1f6('0x35')]=qs[_0xe1f6('0x36')](_0x3d335b[_0xe1f6('0x2d')][_0xe1f6('0x36')]);_0x48cc3e[_0xe1f6('0x37')]=qs['filters'](_[_0xe1f6('0x38')](_0x3d335b[_0xe1f6('0x2d')],_0x1fe4d5[_0xe1f6('0x2e')]),_0x4e70cd);if(_0x3d335b[_0xe1f6('0x2d')][_0xe1f6('0x39')]){_0x48cc3e['where']=_['merge'](_0x48cc3e['where'],{'$or':_['map'](_0x48cc3e[_0xe1f6('0x32')],function(_0x1ac000){var _0x478b0d={};_0x478b0d[_0x1ac000]={'$like':'%'+_0x3d335b[_0xe1f6('0x2d')][_0xe1f6('0x39')]+'%'};return _0x478b0d;})});}_0x48cc3e=_[_0xe1f6('0x3a')]({},_0x48cc3e,_0x3d335b[_0xe1f6('0x3b')]);var _0x499d85={'where':_0x48cc3e['where']};return db[_0xe1f6('0x3c')][_0xe1f6('0x3d')](_0x499d85)[_0xe1f6('0x24')](function(_0x29ad97){_0x5afa3c['count']=_0x29ad97;if(_0x3d335b[_0xe1f6('0x2d')][_0xe1f6('0x3e')]){_0x48cc3e['include']=[{'all':!![]}];}return db[_0xe1f6('0x3c')][_0xe1f6('0x3f')](_0x48cc3e);})[_0xe1f6('0x24')](function(_0x12fb8f){_0x5afa3c[_0xe1f6('0x40')]=_0x12fb8f;return _0x5afa3c;})[_0xe1f6('0x24')](respondWithFilteredResult(_0x7d3d65,_0x48cc3e))['catch'](handleError(_0x7d3d65,null));})[_0xe1f6('0x41')](handleError(_0x7d3d65,null));};exports[_0xe1f6('0x42')]=function(_0x2acd98,_0x147d2c){var _0xa09f38={'raw':![],'where':{'id':_0x2acd98[_0xe1f6('0x43')]['id']}},_0x529ee6={};_0x529ee6[_0xe1f6('0x30')]=_['keys'](db[_0xe1f6('0x3c')][_0xe1f6('0x44')]);_0x529ee6[_0xe1f6('0x2d')]=_['keys'](_0x2acd98[_0xe1f6('0x2d')]);_0x529ee6[_0xe1f6('0x2e')]=_[_0xe1f6('0x2f')](_0x529ee6[_0xe1f6('0x30')],_0x529ee6[_0xe1f6('0x2d')]);_0xa09f38[_0xe1f6('0x32')]=_[_0xe1f6('0x2f')](_0x529ee6[_0xe1f6('0x30')],qs[_0xe1f6('0x31')](_0x2acd98['query'][_0xe1f6('0x31')]));_0xa09f38[_0xe1f6('0x32')]=_0xa09f38[_0xe1f6('0x32')][_0xe1f6('0x45')]?_0xa09f38[_0xe1f6('0x32')]:_0x529ee6['model'];if(_0x2acd98[_0xe1f6('0x2d')][_0xe1f6('0x3e')]){_0xa09f38[_0xe1f6('0x46')]=[{'all':!![]}];}_0xa09f38=_[_0xe1f6('0x3a')]({},_0xa09f38,_0x2acd98[_0xe1f6('0x3b')]);return db[_0xe1f6('0x3c')][_0xe1f6('0x47')](_0xa09f38)[_0xe1f6('0x24')](handleEntityNotFound(_0x147d2c,null))[_0xe1f6('0x24')](respondWithResult(_0x147d2c,null))[_0xe1f6('0x41')](handleError(_0x147d2c,null));};exports[_0xe1f6('0x48')]=function(_0x59d7f1,_0x119e78){return db[_0xe1f6('0x3c')][_0xe1f6('0x48')](_0x59d7f1[_0xe1f6('0x49')],{})[_0xe1f6('0x24')](function(_0x288b0d){var _0x13a290=_0x59d7f1[_0xe1f6('0x4a')]['get']({'plain':!![]});if(!_0x13a290)throw new Error(_0xe1f6('0x4b'));if(_0x13a290[_0xe1f6('0x4c')]===_0xe1f6('0x4a')){var _0x19a565=_0x288b0d['get']({'plain':!![]});var _0x512221=_0xe1f6('0x4d');return db[_0xe1f6('0x4e')]['find']({'where':{'name':_0x512221,'userProfileId':_0x13a290[_0xe1f6('0x4f')]},'raw':!![]})['then'](function(_0x18d6f9){if(_0x18d6f9&&_0x18d6f9[_0xe1f6('0x50')]===0x0){return db[_0xe1f6('0x26')][_0xe1f6('0x48')]({'name':_0x19a565[_0xe1f6('0x51')],'resourceId':_0x19a565['id'],'type':_0x18d6f9[_0xe1f6('0x51')],'sectionId':_0x18d6f9['id']},{})[_0xe1f6('0x24')](function(){return _0x288b0d;});}else{return _0x288b0d;}})[_0xe1f6('0x41')](function(_0x5062a4){logger[_0xe1f6('0x28')](_0xe1f6('0x52'),_0x5062a4);throw _0x5062a4;});}return _0x288b0d;})[_0xe1f6('0x24')](respondWithResult(_0x119e78,0xc9))['catch'](handleError(_0x119e78,null));};exports[_0xe1f6('0x23')]=function(_0x1f6760,_0x139a93){if(_0x1f6760['body']['id']){delete _0x1f6760[_0xe1f6('0x49')]['id'];}return db[_0xe1f6('0x3c')][_0xe1f6('0x47')]({'where':{'id':_0x1f6760[_0xe1f6('0x43')]['id']}})[_0xe1f6('0x24')](handleEntityNotFound(_0x139a93,null))['then'](saveUpdates(_0x1f6760['body'],null))[_0xe1f6('0x24')](respondWithResult(_0x139a93,null))[_0xe1f6('0x41')](handleError(_0x139a93,null));};exports['destroy']=function(_0x45b2b1,_0x437e5f){return db['CmCompany'][_0xe1f6('0x47')]({'where':{'id':_0x45b2b1[_0xe1f6('0x43')]['id']}})[_0xe1f6('0x24')](handleEntityNotFound(_0x437e5f,null))[_0xe1f6('0x24')](removeEntity(_0x437e5f,null))[_0xe1f6('0x41')](handleError(_0x437e5f,null));};exports[_0xe1f6('0x53')]=function(_0x1e087c,_0x417e65){return db['CmCompany'][_0xe1f6('0x53')]()[_0xe1f6('0x24')](respondWithResult(_0x417e65,null))[_0xe1f6('0x41')](handleError(_0x417e65,null));};exports['addContacts']=function(_0x263926,_0x3eacf7,_0x2b15f3){return db[_0xe1f6('0x54')]['find']({'where':{'id':_0x263926['params']['id']}})[_0xe1f6('0x24')](handleEntityNotFound(_0x3eacf7,null))[_0xe1f6('0x24')](function(_0x4e874a){if(_0x4e874a){return _0x4e874a[_0xe1f6('0x55')](_0x263926['body'][_0xe1f6('0x56')],_['omit'](_0x263926['body'],[_0xe1f6('0x56'),'id'])||{});}})['then'](respondWithResult(_0x3eacf7,null))[_0xe1f6('0x41')](handleError(_0x3eacf7,null));};exports['getContacts']=function(_0xcc59c4,_0x58c784,_0xb9d49){var _0x32a9e2={};var _0x3e6c44={};var _0x504d16;var _0x444e16;return db[_0xe1f6('0x3c')][_0xe1f6('0x57')]({'where':{'id':_0xcc59c4[_0xe1f6('0x43')]['id']}})['then'](handleEntityNotFound(_0x58c784,null))['then'](function(_0x141950){if(_0x141950){_0x504d16=_0x141950;_0x3e6c44[_0xe1f6('0x30')]=_[_0xe1f6('0x2c')](db['CmContact'][_0xe1f6('0x44')]);_0x3e6c44[_0xe1f6('0x2d')]=_[_0xe1f6('0x2c')](_0xcc59c4[_0xe1f6('0x2d')]);_0x3e6c44[_0xe1f6('0x2e')]=_[_0xe1f6('0x2f')](_0x3e6c44[_0xe1f6('0x30')],_0x3e6c44['query']);_0x32a9e2['attributes']=_['intersection'](_0x3e6c44['model'],qs[_0xe1f6('0x31')](_0xcc59c4[_0xe1f6('0x2d')][_0xe1f6('0x31')]));_0x32a9e2[_0xe1f6('0x32')]=_0x32a9e2[_0xe1f6('0x32')][_0xe1f6('0x45')]?_0x32a9e2[_0xe1f6('0x32')]:_0x3e6c44[_0xe1f6('0x30')];_0x32a9e2[_0xe1f6('0x35')]=qs[_0xe1f6('0x36')](_0xcc59c4['query'][_0xe1f6('0x36')]);_0x32a9e2['where']=qs[_0xe1f6('0x2e')](_[_0xe1f6('0x38')](_0xcc59c4[_0xe1f6('0x2d')],_0x3e6c44[_0xe1f6('0x2e')]));if(_0xcc59c4['query'][_0xe1f6('0x39')]){_0x32a9e2[_0xe1f6('0x37')]=_['merge'](_0x32a9e2[_0xe1f6('0x37')],{'$or':_[_0xe1f6('0x58')](_0x32a9e2[_0xe1f6('0x32')],function(_0x114930){var _0x8c5caf={};_0x8c5caf[_0x114930]={'$like':'%'+_0xcc59c4[_0xe1f6('0x2d')]['filter']+'%'};return _0x8c5caf;})});}_0x32a9e2=_[_0xe1f6('0x3a')]({},_0x32a9e2,_0xcc59c4[_0xe1f6('0x3b')]);return _0x504d16['getContacts'](_0x32a9e2);}})['then'](function(_0x55f6c9){if(_0x55f6c9){_0x444e16=_0x55f6c9[_0xe1f6('0x45')];if(!_0xcc59c4[_0xe1f6('0x2d')][_0xe1f6('0x33')](_0xe1f6('0x34'))){_0x32a9e2[_0xe1f6('0x1e')]=qs[_0xe1f6('0x1e')](_0xcc59c4[_0xe1f6('0x2d')][_0xe1f6('0x1e')]);_0x32a9e2[_0xe1f6('0x1d')]=qs[_0xe1f6('0x1d')](_0xcc59c4[_0xe1f6('0x2d')][_0xe1f6('0x1d')]);}return _0x504d16[_0xe1f6('0x59')](_0x32a9e2);}})[_0xe1f6('0x24')](function(_0x3b4dea){if(_0x3b4dea){return _0x3b4dea?{'count':_0x444e16,'rows':_0x3b4dea}:null;}})[_0xe1f6('0x24')](respondWithResult(_0x58c784,null))[_0xe1f6('0x41')](handleError(_0x58c784,null));};
\ No newline at end of file
+var _0x2524=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','find','ids','pick','getContacts','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','get','Companies','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','include','rows','catch','show','params','rawAttributes','includeAll'];(function(_0x156515,_0x760da4){var _0x3e1e8b=function(_0x23970a){while(--_0x23970a){_0x156515['push'](_0x156515['shift']());}};_0x3e1e8b(++_0x760da4);}(_0x2524,0x64));var _0x4252=function(_0x53fc32,_0x4528d3){_0x53fc32=_0x53fc32-0x0;var _0x4e2c2a=_0x2524[_0x53fc32];return _0x4e2c2a;};'use strict';var emlformat=require(_0x4252('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4252('0x1'));var jsonpatch=require(_0x4252('0x2'));var rp=require(_0x4252('0x3'));var moment=require(_0x4252('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4252('0x5'));var util=require(_0x4252('0x6'));var path=require(_0x4252('0x7'));var sox=require(_0x4252('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4252('0x9'));var _=require(_0x4252('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4252('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4252('0xc'));var querystring=require(_0x4252('0xd'));var Papa=require(_0x4252('0xe'));var Redis=require('ioredis');var authService=require(_0x4252('0xf'));var qs=require(_0x4252('0x10'));var as=require(_0x4252('0x11'));var hardwareService=require(_0x4252('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x4252('0x13'));var config=require(_0x4252('0x14'));var licenseUtil=require(_0x4252('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x279a6f,_0x21a0d3){_0x21a0d3=_0x21a0d3||0xcc;return function(_0x195591){if(_0x195591){return _0x279a6f[_0x4252('0x16')](_0x21a0d3);}return _0x279a6f[_0x4252('0x17')](_0x21a0d3)[_0x4252('0x18')]();};}function respondWithResult(_0x211421,_0xb51296){_0xb51296=_0xb51296||0xc8;return function(_0x4e4786){if(_0x4e4786){return _0x211421['status'](_0xb51296)[_0x4252('0x19')](_0x4e4786);}};}function respondWithFilteredResult(_0xbff0f9,_0x313d05){return function(_0x1ff29a){if(_0x1ff29a){var _0x2c1ddf=typeof _0x313d05[_0x4252('0x1a')]===_0x4252('0x1b')&&typeof _0x313d05[_0x4252('0x1c')]===_0x4252('0x1b');var _0x378595=_0x1ff29a[_0x4252('0x1d')];var _0x2bff31=_0x2c1ddf?0x0:_0x313d05[_0x4252('0x1a')];var _0x7f62ad=_0x2c1ddf?_0x1ff29a[_0x4252('0x1d')]:_0x313d05[_0x4252('0x1a')]+_0x313d05[_0x4252('0x1c')];var _0x5b236b;if(_0x7f62ad>=_0x378595){_0x7f62ad=_0x378595;_0x5b236b=0xc8;}else{_0x5b236b=0xce;}_0xbff0f9[_0x4252('0x17')](_0x5b236b);return _0xbff0f9[_0x4252('0x1e')]('Content-Range',_0x2bff31+'-'+_0x7f62ad+'/'+_0x378595)[_0x4252('0x19')](_0x1ff29a);}return null;};}function patchUpdates(_0xbd1496){return function(_0x1eba95){try{jsonpatch['apply'](_0x1eba95,_0xbd1496,!![]);}catch(_0x208157){return BPromise['reject'](_0x208157);}return _0x1eba95[_0x4252('0x1f')]();};}function saveUpdates(_0x43d9a8,_0x301525){return function(_0x4660bb){if(_0x4660bb){return _0x4660bb['update'](_0x43d9a8)[_0x4252('0x20')](function(_0x3cc925){return _0x3cc925;});}return null;};}function removeEntity(_0x442c14,_0x5de0a7){return function(_0x30ffd6){if(_0x30ffd6){return _0x30ffd6[_0x4252('0x21')]()['then'](function(){var _0x4d05fb=_0x30ffd6[_0x4252('0x22')]({'plain':!![]});var _0x2337f7=_0x4252('0x23');return db['UserProfileResource'][_0x4252('0x21')]({'where':{'type':_0x2337f7,'resourceId':_0x4d05fb['id']}})[_0x4252('0x20')](function(){return _0x30ffd6;});})[_0x4252('0x20')](function(){_0x442c14[_0x4252('0x17')](0xcc)[_0x4252('0x18')]();});}};}function handleEntityNotFound(_0x508ff1,_0xf9fa8c){return function(_0x3f11c2){if(!_0x3f11c2){_0x508ff1[_0x4252('0x16')](0x194);}return _0x3f11c2;};}function handleError(_0x4406e0,_0x4bfa12){_0x4bfa12=_0x4bfa12||0x1f4;return function(_0x5b4908){logger['error'](_0x5b4908[_0x4252('0x24')]);if(_0x5b4908[_0x4252('0x25')]){delete _0x5b4908[_0x4252('0x25')];}_0x4406e0[_0x4252('0x17')](_0x4bfa12)[_0x4252('0x26')](_0x5b4908);};}exports[_0x4252('0x27')]=function(_0x36bce6,_0x17f6da){var _0xb33643={},_0x51a191={},_0x96dfcd={'count':0x0,'rows':[]};return db[_0x4252('0x28')][_0x4252('0x29')]()[_0x4252('0x20')](function(_0x41be9e){_0x51a191['model']=_[_0x4252('0x2a')](_0x41be9e);_0x51a191[_0x4252('0x2b')]=_[_0x4252('0x2a')](_0x36bce6[_0x4252('0x2b')]);_0x51a191[_0x4252('0x2c')]=_[_0x4252('0x2d')](_0x51a191['model'],_0x51a191[_0x4252('0x2b')]);_0xb33643['attributes']=_[_0x4252('0x2d')](_0x51a191[_0x4252('0x2e')],qs[_0x4252('0x2f')](_0x36bce6['query'][_0x4252('0x2f')]));_0xb33643['attributes']=_0xb33643[_0x4252('0x30')][_0x4252('0x31')]?_0xb33643[_0x4252('0x30')]:_0x51a191[_0x4252('0x2e')];if(!_0x36bce6[_0x4252('0x2b')][_0x4252('0x32')](_0x4252('0x33'))){_0xb33643['limit']=qs[_0x4252('0x1c')](_0x36bce6['query'][_0x4252('0x1c')]);_0xb33643['offset']=qs[_0x4252('0x1a')](_0x36bce6[_0x4252('0x2b')][_0x4252('0x1a')]);}_0xb33643[_0x4252('0x34')]=qs[_0x4252('0x35')](_0x36bce6[_0x4252('0x2b')][_0x4252('0x35')]);_0xb33643[_0x4252('0x36')]=qs['filters'](_['pick'](_0x36bce6['query'],_0x51a191[_0x4252('0x2c')]),_0x41be9e);if(_0x36bce6[_0x4252('0x2b')][_0x4252('0x37')]){_0xb33643[_0x4252('0x36')]=_[_0x4252('0x38')](_0xb33643['where'],{'$or':_[_0x4252('0x39')](_0xb33643[_0x4252('0x30')],function(_0xc0b565){var _0x6324a4={};_0x6324a4[_0xc0b565]={'$like':'%'+_0x36bce6[_0x4252('0x2b')]['filter']+'%'};return _0x6324a4;})});}_0xb33643=_[_0x4252('0x38')]({},_0xb33643,_0x36bce6[_0x4252('0x3a')]);var _0x2a2545={'where':_0xb33643[_0x4252('0x36')]};return db['CmCompany'][_0x4252('0x1d')](_0x2a2545)[_0x4252('0x20')](function(_0x4c6fb3){_0x96dfcd[_0x4252('0x1d')]=_0x4c6fb3;if(_0x36bce6[_0x4252('0x2b')]['includeAll']){_0xb33643[_0x4252('0x3b')]=[{'all':!![]}];}return db[_0x4252('0x28')]['findAll'](_0xb33643);})[_0x4252('0x20')](function(_0x1ad10c){_0x96dfcd[_0x4252('0x3c')]=_0x1ad10c;return _0x96dfcd;})[_0x4252('0x20')](respondWithFilteredResult(_0x17f6da,_0xb33643))[_0x4252('0x3d')](handleError(_0x17f6da,null));})[_0x4252('0x3d')](handleError(_0x17f6da,null));};exports[_0x4252('0x3e')]=function(_0x21e7a4,_0x1bc06e){var _0x12a59a={'raw':![],'where':{'id':_0x21e7a4[_0x4252('0x3f')]['id']}},_0x3288cf={};_0x3288cf[_0x4252('0x2e')]=_[_0x4252('0x2a')](db[_0x4252('0x28')][_0x4252('0x40')]);_0x3288cf['query']=_[_0x4252('0x2a')](_0x21e7a4['query']);_0x3288cf[_0x4252('0x2c')]=_[_0x4252('0x2d')](_0x3288cf[_0x4252('0x2e')],_0x3288cf[_0x4252('0x2b')]);_0x12a59a[_0x4252('0x30')]=_[_0x4252('0x2d')](_0x3288cf[_0x4252('0x2e')],qs[_0x4252('0x2f')](_0x21e7a4[_0x4252('0x2b')]['fields']));_0x12a59a[_0x4252('0x30')]=_0x12a59a[_0x4252('0x30')]['length']?_0x12a59a[_0x4252('0x30')]:_0x3288cf[_0x4252('0x2e')];if(_0x21e7a4[_0x4252('0x2b')][_0x4252('0x41')]){_0x12a59a[_0x4252('0x3b')]=[{'all':!![]}];}_0x12a59a=_[_0x4252('0x38')]({},_0x12a59a,_0x21e7a4['options']);return db['CmCompany']['find'](_0x12a59a)['then'](handleEntityNotFound(_0x1bc06e,null))[_0x4252('0x20')](respondWithResult(_0x1bc06e,null))[_0x4252('0x3d')](handleError(_0x1bc06e,null));};exports[_0x4252('0x42')]=function(_0x7f1a4b,_0x5030fc){return db[_0x4252('0x28')][_0x4252('0x42')](_0x7f1a4b[_0x4252('0x43')],{})[_0x4252('0x20')](function(_0x35eae6){var _0x570736=_0x7f1a4b[_0x4252('0x44')][_0x4252('0x22')]({'plain':!![]});if(!_0x570736)throw new Error(_0x4252('0x45'));if(_0x570736[_0x4252('0x46')]===_0x4252('0x44')){var _0x549519=_0x35eae6[_0x4252('0x22')]({'plain':!![]});var _0x4d8ef2=_0x4252('0x23');return db[_0x4252('0x47')]['find']({'where':{'name':_0x4d8ef2,'userProfileId':_0x570736[_0x4252('0x48')]},'raw':!![]})[_0x4252('0x20')](function(_0x2ce046){if(_0x2ce046&&_0x2ce046['autoAssociation']===0x0){return db[_0x4252('0x49')][_0x4252('0x42')]({'name':_0x549519[_0x4252('0x25')],'resourceId':_0x549519['id'],'type':_0x2ce046[_0x4252('0x25')],'sectionId':_0x2ce046['id']},{})[_0x4252('0x20')](function(){return _0x35eae6;});}else{return _0x35eae6;}})[_0x4252('0x3d')](function(_0x5bd98d){logger[_0x4252('0x4a')](_0x4252('0x4b'),_0x5bd98d);throw _0x5bd98d;});}return _0x35eae6;})[_0x4252('0x20')](respondWithResult(_0x5030fc,0xc9))[_0x4252('0x3d')](handleError(_0x5030fc,null));};exports[_0x4252('0x4c')]=function(_0xb1d63e,_0x4fa2cd){if(_0xb1d63e[_0x4252('0x43')]['id']){delete _0xb1d63e[_0x4252('0x43')]['id'];}return db['CmCompany']['find']({'where':{'id':_0xb1d63e[_0x4252('0x3f')]['id']}})[_0x4252('0x20')](handleEntityNotFound(_0x4fa2cd,null))['then'](saveUpdates(_0xb1d63e['body'],null))[_0x4252('0x20')](respondWithResult(_0x4fa2cd,null))[_0x4252('0x3d')](handleError(_0x4fa2cd,null));};exports[_0x4252('0x21')]=function(_0x3e60dc,_0x5c0c63){return db[_0x4252('0x28')]['find']({'where':{'id':_0x3e60dc[_0x4252('0x3f')]['id']}})[_0x4252('0x20')](handleEntityNotFound(_0x5c0c63,null))[_0x4252('0x20')](removeEntity(_0x5c0c63,null))[_0x4252('0x3d')](handleError(_0x5c0c63,null));};exports['describe']=function(_0x57ad10,_0x44feea){return db['CmCompany'][_0x4252('0x29')]()[_0x4252('0x20')](respondWithResult(_0x44feea,null))[_0x4252('0x3d')](handleError(_0x44feea,null));};exports[_0x4252('0x4d')]=function(_0x48a334,_0x3caf55,_0x57a9d0){return db[_0x4252('0x4e')][_0x4252('0x4f')]({'where':{'id':_0x48a334['params']['id']}})[_0x4252('0x20')](handleEntityNotFound(_0x3caf55,null))[_0x4252('0x20')](function(_0x164907){if(_0x164907){return _0x164907[_0x4252('0x4d')](_0x48a334[_0x4252('0x43')][_0x4252('0x50')],_['omit'](_0x48a334[_0x4252('0x43')],[_0x4252('0x50'),'id'])||{});}})[_0x4252('0x20')](respondWithResult(_0x3caf55,null))[_0x4252('0x3d')](handleError(_0x3caf55,null));};exports['getContacts']=function(_0x3c0c2f,_0x16c730,_0x4f32f1){var _0x1555cb={};var _0x49367e={};var _0x241b20;var _0x337647;return db[_0x4252('0x28')]['findOne']({'where':{'id':_0x3c0c2f['params']['id']}})['then'](handleEntityNotFound(_0x16c730,null))[_0x4252('0x20')](function(_0x24134d){if(_0x24134d){_0x241b20=_0x24134d;_0x49367e[_0x4252('0x2e')]=_[_0x4252('0x2a')](db[_0x4252('0x4e')][_0x4252('0x40')]);_0x49367e['query']=_[_0x4252('0x2a')](_0x3c0c2f[_0x4252('0x2b')]);_0x49367e['filters']=_[_0x4252('0x2d')](_0x49367e[_0x4252('0x2e')],_0x49367e[_0x4252('0x2b')]);_0x1555cb[_0x4252('0x30')]=_[_0x4252('0x2d')](_0x49367e[_0x4252('0x2e')],qs[_0x4252('0x2f')](_0x3c0c2f[_0x4252('0x2b')]['fields']));_0x1555cb[_0x4252('0x30')]=_0x1555cb[_0x4252('0x30')][_0x4252('0x31')]?_0x1555cb['attributes']:_0x49367e[_0x4252('0x2e')];_0x1555cb[_0x4252('0x34')]=qs[_0x4252('0x35')](_0x3c0c2f[_0x4252('0x2b')]['sort']);_0x1555cb[_0x4252('0x36')]=qs[_0x4252('0x2c')](_[_0x4252('0x51')](_0x3c0c2f[_0x4252('0x2b')],_0x49367e[_0x4252('0x2c')]));if(_0x3c0c2f['query']['filter']){_0x1555cb['where']=_[_0x4252('0x38')](_0x1555cb[_0x4252('0x36')],{'$or':_['map'](_0x1555cb[_0x4252('0x30')],function(_0x134742){var _0x1b67f9={};_0x1b67f9[_0x134742]={'$like':'%'+_0x3c0c2f[_0x4252('0x2b')][_0x4252('0x37')]+'%'};return _0x1b67f9;})});}_0x1555cb=_[_0x4252('0x38')]({},_0x1555cb,_0x3c0c2f['options']);return _0x241b20[_0x4252('0x52')](_0x1555cb);}})[_0x4252('0x20')](function(_0x498f01){if(_0x498f01){_0x337647=_0x498f01['length'];if(!_0x3c0c2f[_0x4252('0x2b')][_0x4252('0x32')](_0x4252('0x33'))){_0x1555cb[_0x4252('0x1c')]=qs[_0x4252('0x1c')](_0x3c0c2f[_0x4252('0x2b')][_0x4252('0x1c')]);_0x1555cb['offset']=qs[_0x4252('0x1a')](_0x3c0c2f[_0x4252('0x2b')][_0x4252('0x1a')]);}return _0x241b20[_0x4252('0x52')](_0x1555cb);}})[_0x4252('0x20')](function(_0x2fd708){if(_0x2fd708){return _0x2fd708?{'count':_0x337647,'rows':_0x2fd708}:null;}})[_0x4252('0x20')](respondWithResult(_0x16c730,null))[_0x4252('0x3d')](handleError(_0x16c730,null));};
\ No newline at end of file
index e085d60..f618cb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04e5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash'];(function(_0x377d56,_0x276179){var _0x4d8c86=function(_0x503a3c){while(--_0x503a3c){_0x377d56['push'](_0x377d56['shift']());}};_0x4d8c86(++_0x276179);}(_0x04e5,0xa4));var _0x504e=function(_0x4fdab1,_0x5665a0){_0x4fdab1=_0x4fdab1-0x0;var _0x282dd6=_0x04e5[_0x4fdab1];return _0x282dd6;};'use strict';var _=require(_0x504e('0x0'));var util=require(_0x504e('0x1'));var logger=require(_0x504e('0x2'))(_0x504e('0x3'));var moment=require(_0x504e('0x4'));var BPromise=require(_0x504e('0x5'));var rp=require(_0x504e('0x6'));var fs=require('fs');var path=require(_0x504e('0x7'));var rimraf=require(_0x504e('0x8'));var config=require(_0x504e('0x9'));var attributes=require(_0x504e('0xa'));module[_0x504e('0xb')]=function(_0x157235,_0x5bfc93){return _0x157235[_0x504e('0xc')](_0x504e('0xd'),attributes,{'tableName':_0x504e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4c6e=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','../../config/logger'];(function(_0x26530c,_0xf222a3){var _0x1425c0=function(_0x4ceb4b){while(--_0x4ceb4b){_0x26530c['push'](_0x26530c['shift']());}};_0x1425c0(++_0xf222a3);}(_0x4c6e,0xcd));var _0xe4c6=function(_0x293a0e,_0x11b3d5){_0x293a0e=_0x293a0e-0x0;var _0x34fbbb=_0x4c6e[_0x293a0e];return _0x34fbbb;};'use strict';var _=require(_0xe4c6('0x0'));var util=require('util');var logger=require(_0xe4c6('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe4c6('0x2'));var rp=require(_0xe4c6('0x3'));var fs=require('fs');var path=require(_0xe4c6('0x4'));var rimraf=require(_0xe4c6('0x5'));var config=require(_0xe4c6('0x6'));var attributes=require('./cmCompany.attributes');module[_0xe4c6('0x7')]=function(_0x8d6a02,_0x5d1cb8){return _0x8d6a02[_0xe4c6('0x8')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c22d1f3..c825b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4ea=['jayson/promise','client','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xa4ea,0x11d));var _0xaa4e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa4ea[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xaa4e('0x0'));var util=require('util');var moment=require(_0xaa4e('0x1'));var BPromise=require(_0xaa4e('0x2'));var rs=require(_0xaa4e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa4e('0x4'))['db'];var utils=require(_0xaa4e('0x5'));var logger=require(_0xaa4e('0x6'))(_0xaa4e('0x7'));var config=require(_0xaa4e('0x8'));var jayson=require(_0xaa4e('0x9'));var client=jayson[_0xaa4e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1866da,_0x261752,_0x51733c){return new BPromise(function(_0x40ee85,_0x1ce65c){return client['request'](_0x1866da,_0x51733c)['then'](function(_0x1252e8){logger[_0xaa4e('0xb')](_0xaa4e('0xc'),_0x261752,'request\x20sent');logger[_0xaa4e('0xd')](_0xaa4e('0xe'),_0x261752,_0xaa4e('0xf'),JSON[_0xaa4e('0x10')](_0x1252e8));if(_0x1252e8['error']){if(_0x1252e8['error'][_0xaa4e('0x11')]===0x1f4){logger['error'](_0xaa4e('0xc'),_0x261752,_0x1252e8[_0xaa4e('0x12')][_0xaa4e('0x13')]);return _0x1ce65c(_0x1252e8[_0xaa4e('0x12')][_0xaa4e('0x13')]);}logger['error'](_0xaa4e('0xc'),_0x261752,_0x1252e8[_0xaa4e('0x12')]['message']);return _0x40ee85(_0x1252e8[_0xaa4e('0x12')][_0xaa4e('0x13')]);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x261752,_0xaa4e('0xf'));_0x40ee85(_0x1252e8[_0xaa4e('0x14')][_0xaa4e('0x13')]);}})['catch'](function(_0x345141){logger['error'](_0xaa4e('0xc'),_0x261752,_0x345141);_0x1ce65c(_0x345141);});});}
\ No newline at end of file
+var _0x31e7=['info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x31e7,0x9d));var _0x731e=function(_0x4a9fdf,_0x18c716){_0x4a9fdf=_0x4a9fdf-0x0;var _0x2ed5df=_0x31e7[_0x4a9fdf];return _0x2ed5df;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x731e('0x0'));var rs=require(_0x731e('0x1'));var fs=require('fs');var Redis=require(_0x731e('0x2'));var db=require(_0x731e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x731e('0x4'));var config=require(_0x731e('0x5'));var jayson=require(_0x731e('0x6'));var client=jayson[_0x731e('0x7')][_0x731e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d6170,_0x23476d,_0x153b79){return new BPromise(function(_0x5abb4e,_0x4c77cb){return client[_0x731e('0x9')](_0x3d6170,_0x153b79)[_0x731e('0xa')](function(_0x2a7493){logger[_0x731e('0xb')]('CmCompany,\x20%s,\x20%s',_0x23476d,_0x731e('0xc'));logger[_0x731e('0xd')](_0x731e('0xe'),_0x23476d,'request\x20sent',JSON[_0x731e('0xf')](_0x2a7493));if(_0x2a7493['error']){if(_0x2a7493[_0x731e('0x10')][_0x731e('0x11')]===0x1f4){logger[_0x731e('0x10')](_0x731e('0x12'),_0x23476d,_0x2a7493['error'][_0x731e('0x13')]);return _0x4c77cb(_0x2a7493['error']['message']);}logger[_0x731e('0x10')](_0x731e('0x12'),_0x23476d,_0x2a7493[_0x731e('0x10')][_0x731e('0x13')]);return _0x5abb4e(_0x2a7493['error'][_0x731e('0x13')]);}else{logger[_0x731e('0xb')](_0x731e('0x12'),_0x23476d,'request\x20sent');_0x5abb4e(_0x2a7493['result'][_0x731e('0x13')]);}})[_0x731e('0x14')](function(_0x480177){logger['error'](_0x731e('0x12'),_0x23476d,_0x480177);_0x4c77cb(_0x480177);});});}
\ No newline at end of file
index 5ee25d5..66cdc5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9030=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/:id','show','/:id/contacts','post','create','addContacts','put','delete','multer','util','path','connect-timeout','Router'];(function(_0x4a7ef9,_0x22783f){var _0x33b1e=function(_0x1ba1bd){while(--_0x1ba1bd){_0x4a7ef9['push'](_0x4a7ef9['shift']());}};_0x33b1e(++_0x22783f);}(_0x9030,0x121));var _0x0903=function(_0x27b24d,_0x6bfe4b){_0x27b24d=_0x27b24d-0x0;var _0x40ef30=_0x9030[_0x27b24d];return _0x40ef30;};'use strict';var multer=require(_0x0903('0x0'));var util=require(_0x0903('0x1'));var path=require(_0x0903('0x2'));var timeout=require(_0x0903('0x3'));var express=require('express');var router=express[_0x0903('0x4')]();var fs_extra=require(_0x0903('0x5'));var auth=require(_0x0903('0x6'));var interaction=require(_0x0903('0x7'));var config=require(_0x0903('0x8'));var controller=require(_0x0903('0x9'));router[_0x0903('0xa')]('/',auth[_0x0903('0xb')](),controller[_0x0903('0xc')]);router[_0x0903('0xa')]('/describe',auth[_0x0903('0xb')](),controller['describe']);router[_0x0903('0xa')](_0x0903('0xd'),auth['isAuthenticated'](),controller[_0x0903('0xe')]);router[_0x0903('0xa')](_0x0903('0xf'),auth[_0x0903('0xb')](),controller['getContacts']);router[_0x0903('0x10')]('/',auth[_0x0903('0xb')](),controller[_0x0903('0x11')]);router['post'](_0x0903('0xf'),auth[_0x0903('0xb')](),controller[_0x0903('0x12')]);router[_0x0903('0x13')](_0x0903('0xd'),auth[_0x0903('0xb')](),controller['update']);router[_0x0903('0x14')](_0x0903('0xd'),auth[_0x0903('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc60e=['/:id/contacts','post','create','put','update','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','show'];(function(_0x58f6e7,_0x2f472a){var _0x436906=function(_0x4341eb){while(--_0x4341eb){_0x58f6e7['push'](_0x58f6e7['shift']());}};_0x436906(++_0x2f472a);}(_0xc60e,0xb2));var _0xec60=function(_0x3a1ed1,_0x246086){_0x3a1ed1=_0x3a1ed1-0x0;var _0x272b15=_0xc60e[_0x3a1ed1];return _0x272b15;};'use strict';var multer=require(_0xec60('0x0'));var util=require(_0xec60('0x1'));var path=require(_0xec60('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xec60('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xec60('0x4'));var interaction=require(_0xec60('0x5'));var config=require('../../config/environment');var controller=require(_0xec60('0x6'));router[_0xec60('0x7')]('/',auth[_0xec60('0x8')](),controller[_0xec60('0x9')]);router['get'](_0xec60('0xa'),auth[_0xec60('0x8')](),controller['describe']);router[_0xec60('0x7')]('/:id',auth[_0xec60('0x8')](),controller[_0xec60('0xb')]);router['get'](_0xec60('0xc'),auth[_0xec60('0x8')](),controller['getContacts']);router[_0xec60('0xd')]('/',auth['isAuthenticated'](),controller[_0xec60('0xe')]);router[_0xec60('0xd')](_0xec60('0xc'),auth[_0xec60('0x8')](),controller['addContacts']);router[_0xec60('0xf')]('/:id',auth[_0xec60('0x8')](),controller[_0xec60('0x10')]);router[_0xec60('0x11')]('/:id',auth[_0xec60('0x8')](),controller['destroy']);module[_0xec60('0x12')]=router;
\ No newline at end of file
index c594cfa..6415f62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f7=['DATE','lodash','sequelize','exports','STRING','INTEGER','UNSIGNED'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x57f7,0x182));var _0x757f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x57f7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x757f('0x0'));var Sequelize=require(_0x757f('0x1'));module[_0x757f('0x2')]={'firstName':{'type':Sequelize[_0x757f('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x757f('0x3')]},'street':{'type':Sequelize[_0x757f('0x3')]},'postalCode':{'type':Sequelize[_0x757f('0x3')]},'city':{'type':Sequelize[_0x757f('0x3')]},'country':{'type':Sequelize[_0x757f('0x3')]},'dateOfBirth':{'type':Sequelize[_0x757f('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x757f('0x3')]},'mobile':{'type':Sequelize[_0x757f('0x3')]},'fax':{'type':Sequelize[_0x757f('0x3')]},'email':{'type':Sequelize[_0x757f('0x3')]},'url':{'type':Sequelize[_0x757f('0x3')]},'facebook':{'type':Sequelize[_0x757f('0x3')]},'fb_data':{'type':Sequelize[_0x757f('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x757f('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x757f('0x3')]},'line':{'type':Sequelize[_0x757f('0x3')]},'wechat':{'type':Sequelize[_0x757f('0x3')]},'telegram':{'type':Sequelize[_0x757f('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x757f('0x4')](0x2)[_0x757f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x757f('0x6')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xbbd0=['sequelize','exports','STRING','TEXT','INTEGER','lodash'];(function(_0x28dba5,_0x2dbe4e){var _0x7d81f0=function(_0x16beab){while(--_0x16beab){_0x28dba5['push'](_0x28dba5['shift']());}};_0x7d81f0(++_0x2dbe4e);}(_0xbbd0,0x1af));var _0x0bbd=function(_0x4e0887,_0x2f1dc1){_0x4e0887=_0x4e0887-0x0;var _0x16d39d=_0xbbd0[_0x4e0887];return _0x16d39d;};'use strict';var _=require(_0x0bbd('0x0'));var Sequelize=require(_0x0bbd('0x1'));module[_0x0bbd('0x2')]={'firstName':{'type':Sequelize[_0x0bbd('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x0bbd('0x3')]},'street':{'type':Sequelize[_0x0bbd('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x0bbd('0x3')]},'country':{'type':Sequelize[_0x0bbd('0x3')]},'dateOfBirth':{'type':Sequelize[_0x0bbd('0x3')]},'description':{'type':Sequelize[_0x0bbd('0x4')]},'phone':{'type':Sequelize[_0x0bbd('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x0bbd('0x3')]},'email':{'type':Sequelize[_0x0bbd('0x3')]},'url':{'type':Sequelize[_0x0bbd('0x3')]},'facebook':{'type':Sequelize[_0x0bbd('0x3')]},'fb_data':{'type':Sequelize[_0x0bbd('0x3')]},'twitter':{'type':Sequelize[_0x0bbd('0x3')]},'skype':{'type':Sequelize[_0x0bbd('0x3')]},'teams':{'type':Sequelize[_0x0bbd('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x0bbd('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x0bbd('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index 4e95460..d999d7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c33=['t.id\x20IN\x20?','agent','some','user','getLists','c.ListId\x20IS\x20NULL','role','ListId','sequelize','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.CompanyId','TagIds','toString','Tags','catch','params','tags','CmCustomField','findAll','displayName','alias','merge','body','get','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','error','show','find','$and','omit','cf_%d','pickBy','format','table','setFields','toParam','values','getTags','rawAttributes','setTags','ids','getHoppers','nolimit','ContactId','options','includeAll','rows','CmHopperHistory','pick','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','CompanyId','upload','createReadStream','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','exit','pid','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','resolve','channel','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','subject','externalUrl','threadId','Interaction','all','flatten','sortBy','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','CmContact','describe','keys','length','startsWith','push','findOne','trimStart','cf_','fieldType','type','model','query','attributes','intersection','fields','hasOwnProperty','sort','where','filters','select','field','color','from','tools_tags','cm_contacts','cm_user_has_contacts','left_join','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','Tag','value','split','union','User','and','dateOfBirth','datetime','DATE','buildExpression','text','start','map','filter','isNil','Contact','forEach','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','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)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','c.id','order','DESC','isEmpty'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x7c33,0x1dd));var _0x37c3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7c33[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x37c3('0x0'));var rimraf=require(_0x37c3('0x1'));var zipdir=require(_0x37c3('0x2'));var jsonpatch=require(_0x37c3('0x3'));var rp=require(_0x37c3('0x4'));var moment=require(_0x37c3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x37c3('0x6'));var util=require(_0x37c3('0x7'));var path=require(_0x37c3('0x8'));var sox=require('sox');var csv=require(_0x37c3('0x9'));var ejs=require(_0x37c3('0xa'));var fs=require('fs');var fs_extra=require(_0x37c3('0xb'));var _=require(_0x37c3('0xc'));var squel=require(_0x37c3('0xd'));var crypto=require(_0x37c3('0xe'));var jsforce=require(_0x37c3('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x37c3('0x10'));var Papa=require(_0x37c3('0x11'));var Redis=require(_0x37c3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x37c3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x37c3('0x14'));var logger=require('../../config/logger')(_0x37c3('0x15'));var utils=require('../../config/utils');var config=require(_0x37c3('0x16'));var licenseUtil=require(_0x37c3('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x37c3('0x18')],{'host':_0x37c3('0x19'),'port':0x18eb});var socket=require(_0x37c3('0x1a'))(new Redis(config[_0x37c3('0x18')]));require(_0x37c3('0x1b'))[_0x37c3('0x1c')](socket);function respondWithStatusCode(_0x243841,_0xf87bb2){_0xf87bb2=_0xf87bb2||0xcc;return function(_0xe96f94){if(_0xe96f94){return _0x243841[_0x37c3('0x1d')](_0xf87bb2);}return _0x243841[_0x37c3('0x1e')](_0xf87bb2)[_0x37c3('0x1f')]();};}function respondWithResult(_0xea7ffd,_0x42133f){_0x42133f=_0x42133f||0xc8;return function(_0x29ea4a){if(_0x29ea4a){return _0xea7ffd['status'](_0x42133f)[_0x37c3('0x20')](_0x29ea4a);}};}function respondWithFilteredResult(_0x275306,_0x34d0d9){return function(_0x4d050b){if(_0x4d050b){var _0x49ca78=typeof _0x34d0d9[_0x37c3('0x21')]===_0x37c3('0x22')&&typeof _0x34d0d9[_0x37c3('0x23')]===_0x37c3('0x22');var _0xa1199b=_0x4d050b[_0x37c3('0x24')];var _0x1f7af1=_0x49ca78?0x0:_0x34d0d9[_0x37c3('0x21')];var _0x389423=_0x49ca78?_0x4d050b[_0x37c3('0x24')]:_0x34d0d9[_0x37c3('0x21')]+_0x34d0d9[_0x37c3('0x23')];var _0x2ade08;if(_0x389423>=_0xa1199b){_0x389423=_0xa1199b;_0x2ade08=0xc8;}else{_0x2ade08=0xce;}_0x275306[_0x37c3('0x1e')](_0x2ade08);return _0x275306[_0x37c3('0x25')]('Content-Range',_0x1f7af1+'-'+_0x389423+'/'+_0xa1199b)[_0x37c3('0x20')](_0x4d050b);}return null;};}function patchUpdates(_0x223493){return function(_0xb67604){try{jsonpatch[_0x37c3('0x26')](_0xb67604,_0x223493,!![]);}catch(_0x16efa5){return BPromise[_0x37c3('0x27')](_0x16efa5);}return _0xb67604[_0x37c3('0x28')]();};}function saveUpdates(_0x4baf26,_0x1064ad){return function(_0x1cbe8d){if(_0x1cbe8d){return _0x1cbe8d['update'](_0x4baf26)[_0x37c3('0x29')](function(_0x452e93){return _0x452e93;});}return null;};}function removeEntity(_0x451760,_0x20160e){return function(_0x2a5dd1){if(_0x2a5dd1){return _0x2a5dd1[_0x37c3('0x2a')]()[_0x37c3('0x29')](function(){_0x451760[_0x37c3('0x1e')](0xcc)[_0x37c3('0x1f')]();});}};}function handleEntityNotFound(_0x1291c6,_0x1233b4){return function(_0x18eeb5){if(!_0x18eeb5){_0x1291c6[_0x37c3('0x1d')](0x194);}return _0x18eeb5;};}function handleError(_0x69cee5,_0x34714f){_0x34714f=_0x34714f||0x1f4;return function(_0x4903d1){logger['error'](_0x4903d1[_0x37c3('0x2b')]);if(_0x4903d1[_0x37c3('0x2c')]){delete _0x4903d1[_0x37c3('0x2c')];}_0x69cee5[_0x37c3('0x1e')](_0x34714f)[_0x37c3('0x2d')](_0x4903d1);};}exports['index']=function(_0x5b842d,_0x21add4){var _0x5cd3c3={},_0x52937d={},_0x4d15e7={'count':0x0,'rows':[]};return db[_0x37c3('0x2e')][_0x37c3('0x2f')]()[_0x37c3('0x29')](function(_0x422222){var _0x48473a=[];for(var _0x51ade2=0x0;_0x51ade2<Object[_0x37c3('0x30')](_0x422222)[_0x37c3('0x31')];_0x51ade2++){var _0x3c58dd=Object[_0x37c3('0x30')](_0x422222)[_0x51ade2];if(_[_0x37c3('0x32')](_0x3c58dd,'cf_')){_0x48473a[_0x37c3('0x33')](db['CmCustomField'][_0x37c3('0x34')]({'where':{'id':_[_0x37c3('0x35')](_0x3c58dd,_0x37c3('0x36'))},'raw':!![]}));}}return BPromise['all'](_0x48473a)[_0x37c3('0x29')](function(_0x3cd60e){for(var _0x2e6123=0x0;_0x2e6123<_0x3cd60e[_0x37c3('0x31')];_0x2e6123++){if(_0x3cd60e[_0x2e6123]){var _0x573b7f=_0x37c3('0x36')+_0x3cd60e[_0x2e6123]['id'];var _0x5c58cd=_0x422222[_0x573b7f];_0x5c58cd[_0x37c3('0x37')]=_0x3cd60e[_0x2e6123][_0x37c3('0x38')];}}return _0x422222;});})[_0x37c3('0x29')](function(_0x5c4fcf){_0x52937d[_0x37c3('0x39')]=_['keys'](_0x5c4fcf);_0x52937d['query']=_[_0x37c3('0x30')](_0x5b842d[_0x37c3('0x3a')]);_0x52937d['filters']=_['intersection'](_0x52937d[_0x37c3('0x39')],_0x52937d['query']);_0x5cd3c3[_0x37c3('0x3b')]=_[_0x37c3('0x3c')](_0x52937d[_0x37c3('0x39')],qs[_0x37c3('0x3d')](_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x3d')]));_0x5cd3c3['attributes']=_0x5cd3c3[_0x37c3('0x3b')]['length']?_0x5cd3c3[_0x37c3('0x3b')]:_0x52937d[_0x37c3('0x39')];if(!_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x3e')]('nolimit')){_0x5cd3c3['limit']=qs[_0x37c3('0x23')](_0x5b842d[_0x37c3('0x3a')]['limit']);_0x5cd3c3[_0x37c3('0x21')]=qs[_0x37c3('0x21')](_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x21')]);}_0x5cd3c3['order']=qs['sort'](_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x3f')]);_0x5cd3c3[_0x37c3('0x40')]=qs['filters'](_['pick'](_0x5b842d[_0x37c3('0x3a')],_0x52937d[_0x37c3('0x41')]),_0x5c4fcf);var _0x5a8bcd=[];var _0x48aada=squel[_0x37c3('0x42')]()[_0x37c3('0x43')]('id')[_0x37c3('0x43')]('name')[_0x37c3('0x43')](_0x37c3('0x44'))[_0x37c3('0x45')](_0x37c3('0x46'));var _0xdd5978=squel[_0x37c3('0x42')]()[_0x37c3('0x45')](_0x37c3('0x47'),'c')['left_join'](_0x37c3('0x48'),'uc','uc.CmContactId\x20=\x20c.id')[_0x37c3('0x49')]('cm_contact_has_tags','ct',_0x37c3('0x4a'))['left_join']('tools_tags','t',_0x37c3('0x4b'))[_0x37c3('0x40')](_0x37c3('0x4c'));var _0x7d8916=squel[_0x37c3('0x4d')]();var _0x11d762=[];var _0x1250c5=squel[_0x37c3('0x4d')]();var _0x3c08fc;if(_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x4e')]){_0x3c08fc=as[_0x37c3('0x4f')](_0x5b842d['query'][_0x37c3('0x4e')]);var _0x1e2b47=_0x3c08fc[_0x37c3('0x50')];for(var _0x46ba95=0x0;_0x46ba95<_0x3c08fc[_0x37c3('0x51')][_0x37c3('0x31')];_0x46ba95++){var _0x3473ca=_0x3c08fc[_0x37c3('0x51')][_0x46ba95];var _0x24cad6='c';var _0x5f3b17=_(_0x5c4fcf)[_0x37c3('0x30')]()['find'](function(_0x551a44){return _0x551a44===_0x3473ca[_0x37c3('0x43')];});if(_0x5f3b17)_0x5f3b17=_0x5c4fcf[_0x3473ca['field']];if(!_0x5f3b17){if(_0x3473ca['field']===_0x37c3('0x52')){var _0x3bb49b=_0x3473ca[_0x37c3('0x53')][_0x37c3('0x54')](',')['map'](function(_0x1c830a){return Number(_0x1c830a);});_0x3bb49b['forEach'](function(_0x4a8dbd){_0x1250c5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4a8dbd+',%');});_0x11d762=_[_0x37c3('0x55')](_0x11d762,_0x3bb49b);}else if(_0x3473ca[_0x37c3('0x43')]===_0x37c3('0x56')){_0x7d8916[_0x37c3('0x57')]('uc.UserId\x20=\x20?',_0x3473ca[_0x37c3('0x53')]);}}else{if(_0x3473ca[_0x37c3('0x43')]===_0x37c3('0x58')||_0x5f3b17[_0x37c3('0x37')]===_0x37c3('0x59'))_0x3473ca['castTo']=_0x37c3('0x5a');var _0x39795d=as[_0x37c3('0x5b')](_0x24cad6,_0x5f3b17['type'],_0x3473ca);_0x7d8916[_0x1e2b47](_0x39795d[_0x37c3('0x5c')],_0x39795d[_0x37c3('0x53')][_0x37c3('0x5d')],_0x39795d[_0x37c3('0x53')][_0x37c3('0x1f')]);}}}else{var _0x3395b0=_(Object[_0x37c3('0x30')](_0x5b842d[_0x37c3('0x3a')]))[_0x37c3('0x5e')](function(_0x11bbf8){return _0x5c4fcf[_0x37c3('0x3e')](_0x11bbf8)?_0x11bbf8:undefined;})[_0x37c3('0x5f')](function(_0x515cf9){return!_[_0x37c3('0x60')](_0x515cf9);})[_0x37c3('0x53')]();if(_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x61')])_0x3395b0['push']('Contact');if(!_['isEmpty'](_0x3395b0)){_0x3395b0[_0x37c3('0x62')](function(_0x53ee6a){if(_0x53ee6a==='ListId'){_0xdd5978['where'](_0x37c3('0x63'),[][_0x37c3('0x64')](_0x5b842d[_0x37c3('0x3a')][_0x53ee6a]));}else if(_0x53ee6a===_0x37c3('0x61')){var _0x2a91ff='%'+_0x5b842d[_0x37c3('0x3a')][_0x53ee6a]+'%';_0xdd5978[_0x37c3('0x40')](_0x37c3('0x65'),_0x2a91ff);}else{_0xdd5978[_0x37c3('0x40')]('c.'+_0x53ee6a+_0x37c3('0x66'),_0x5b842d[_0x37c3('0x3a')][_0x53ee6a]);}});}if(_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x67')]){_0x11d762=_[_0x37c3('0x68')](_0x5b842d['query'][_0x37c3('0x67')])?_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x67')]:new Array(_0x5b842d[_0x37c3('0x3a')]['tag']);_0x11d762[_0x37c3('0x62')](function(_0x1ec80c){_0x1250c5['or'](_0x37c3('0x69'),'%,'+_0x1ec80c+',%');});}if(_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x5f')]){var _0xa08e88=_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x5f')][_0x37c3('0x6a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0xa08e88[_0x37c3('0x54')]('\x20')[_0x37c3('0x31')]>0x1){_0x7d8916['or'](_0x37c3('0x6b'),qs['getFullTextValue'](_0xa08e88),null);}else{if(qs[_0x37c3('0x6c')](_0xa08e88)){_0x7d8916['or'](_0x37c3('0x6d'),_0xa08e88+'%');_0x7d8916['or'](_0x37c3('0x6e'),_0xa08e88+'%');_0x7d8916['or']('c.mobile\x20LIKE\x20?',_0xa08e88+'%');_0x7d8916['or'](_0x37c3('0x6f'),_0xa08e88+'%');}else if(qs[_0x37c3('0x70')](_0xa08e88)){_0x7d8916['or'](_0x37c3('0x71'),_0xa08e88+'%');}else{_0x7d8916['or'](_0x37c3('0x72'),'%'+_0xa08e88+'%');_0x7d8916['or'](_0x37c3('0x73'),'%'+_0xa08e88+'%');_0x7d8916['or'](_0x37c3('0x71'),'%'+_0xa08e88+'%');}}}}_0xdd5978[_0x37c3('0x40')](_0x7d8916);_0xdd5978[_0x37c3('0x74')]('c.id');var _0x29ecc5={'type':db[_0x37c3('0x75')][_0x37c3('0x76')][_0x37c3('0x77')],'raw':!![]};var _0x5ca725=_0xdd5978[_0x37c3('0x78')]()[_0x37c3('0x43')](_0x37c3('0x79'));if(_0x5cd3c3[_0x37c3('0x7a')]){_0x5cd3c3[_0x37c3('0x7a')][_0x37c3('0x62')](function(_0x3da673){_0xdd5978['order']('c.'+_0x3da673[0x0],_0x3da673[0x1]===_0x37c3('0x7b')?![]:!![]);});}if(!_[_0x37c3('0x7c')](_0x11d762)){_0xdd5978['having'](_0x1250c5);_0x5ca725['where'](_0x37c3('0x7d'),_0x11d762);}BPromise['resolve']()[_0x37c3('0x29')](function(){if(!_0x3c08fc)return;if(_0x5b842d['user']['role']!==_0x37c3('0x7e'))return;if(!_[_0x37c3('0x7f')](_0x3c08fc[_0x37c3('0x51')],['field',_0x37c3('0x56')])){return _0x5b842d[_0x37c3('0x80')][_0x37c3('0x81')]({'attributes':['id'],'raw':!![]})[_0x37c3('0x29')](function(_0x362fff){if(_[_0x37c3('0x7c')](_0x362fff)){_0x5ca725['where']('c.ListId\x20IS\x20NULL');_0xdd5978[_0x37c3('0x40')](_0x37c3('0x82'));}else{_0x5ca725['where'](_0x37c3('0x63'),_[_0x37c3('0x5e')](_0x362fff,'id'));_0xdd5978[_0x37c3('0x40')](_0x37c3('0x63'),_[_0x37c3('0x5e')](_0x362fff,'id'));}});}})[_0x37c3('0x29')](function(){if(_0x5b842d['user'][_0x37c3('0x83')]===_0x37c3('0x7e')&&!_0x3c08fc&&!_0x5b842d['query'][_0x37c3('0x84')])return[];return db[_0x37c3('0x85')][_0x37c3('0x3a')](_0x5ca725['toString'](),_0x29ecc5);})['then'](function(_0x4e9e10){_0x4d15e7[_0x37c3('0x24')]=_0x4e9e10[_0x37c3('0x31')];if(_0x4d15e7[_0x37c3('0x24')]===0x0)return[];return db[_0x37c3('0x85')][_0x37c3('0x3a')](_0x48aada['toString'](),_0x29ecc5)['then'](function(_0x4dfbea){_0x5a8bcd=_['keyBy'](_0x4dfbea,'id');_0x29ecc5=_['merge'](_0x29ecc5,{'model':db[_0x37c3('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5b842d[_0x37c3('0x3a')][_0x37c3('0x3d')]){_0x5cd3c3[_0x37c3('0x3b')][_0x37c3('0x62')](function(_0x47a341){_0xdd5978['field']('c.'+_0x47a341);});}else{_0xdd5978['field'](_0x37c3('0x79'));_0xdd5978[_0x37c3('0x43')](_0x37c3('0x86'));_0xdd5978['field'](_0x37c3('0x87'));_0xdd5978[_0x37c3('0x43')](_0x37c3('0x88'));_0xdd5978[_0x37c3('0x43')](_0x37c3('0x89'));_0xdd5978[_0x37c3('0x43')](_0x37c3('0x8a'));_0xdd5978[_0x37c3('0x43')](_0x37c3('0x8b'));_0xdd5978[_0x37c3('0x43')](_0x37c3('0x8c'));_0xdd5978['field']('c.createdAt');_0xdd5978[_0x37c3('0x43')]('c.deletedAt');_0xdd5978['field'](_0x37c3('0x8d'));_0xdd5978[_0x37c3('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x37c3('0x8e'));}if(_0x5cd3c3[_0x37c3('0x23')])_0xdd5978[_0x37c3('0x23')](_0x5cd3c3[_0x37c3('0x23')]);if(_0x5cd3c3[_0x37c3('0x21')])_0xdd5978[_0x37c3('0x21')](_0x5cd3c3['offset']);return db['sequelize']['query'](_0xdd5978[_0x37c3('0x8f')](),_0x29ecc5);});})[_0x37c3('0x29')](function(_0x5c1b8b){_0x5c1b8b[_0x37c3('0x62')](function(_0x37b986){if(_0x37b986['TagIds']){_0x37b986[_0x37c3('0x90')]=[];_0x37b986[_0x37c3('0x8e')][_0x37c3('0x54')](',')[_0x37c3('0x62')](function(_0x52f6b2){_0x37b986[_0x37c3('0x90')][_0x37c3('0x33')](_0x5a8bcd[_0x52f6b2]);});}delete _0x37b986[_0x37c3('0x8e')];});_0x4d15e7['rows']=_0x5c1b8b;return _0x4d15e7;})['then'](respondWithFilteredResult(_0x21add4,_0x5cd3c3));})[_0x37c3('0x91')](handleError(_0x21add4,null));};exports[_0x37c3('0x2a')]=function(_0x1ea8d1,_0x55bd1f){return db[_0x37c3('0x2e')]['find']({'where':{'id':_0x1ea8d1[_0x37c3('0x92')]['id']}})[_0x37c3('0x29')](handleEntityNotFound(_0x55bd1f,null))[_0x37c3('0x29')](removeEntity(_0x55bd1f,null))[_0x37c3('0x91')](handleError(_0x55bd1f,null));};exports['describe']=function(_0x186e82,_0x1093e8){return db['CmContact'][_0x37c3('0x2f')]()['then'](function(_0x2ee75b){delete _0x2ee75b[_0x37c3('0x93')];for(var _0x25cfb6=0x0;_0x25cfb6<Object[_0x37c3('0x30')](_0x2ee75b)[_0x37c3('0x31')];_0x25cfb6++){var _0x1e9035=Object[_0x37c3('0x30')](_0x2ee75b)[_0x25cfb6];if(!_[_0x37c3('0x32')](_0x1e9035,_0x37c3('0x36'))){_0x2ee75b[_0x1e9035]['columnName']=_0x1e9035;_0x2ee75b[_0x1e9035]['displayName']=_0x1e9035;}}return _0x2ee75b;})[_0x37c3('0x29')](function(_0x1ed348){var _0x4c8193={'where':{'$or':[{'ListId':_0x186e82['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0x37c3('0x94')][_0x37c3('0x95')](_0x4c8193)[_0x37c3('0x29')](function(_0x4d8ad0){for(var _0x441f77=0x0;_0x441f77<_0x4d8ad0[_0x37c3('0x31')];_0x441f77++){var _0xeff4b2='cf_'+_0x4d8ad0[_0x441f77]['id'];_0x1ed348[_0xeff4b2]['columnName']=_0xeff4b2;_0x1ed348[_0xeff4b2][_0x37c3('0x96')]=_0x4d8ad0[_0x441f77][_0x37c3('0x97')];_0x1ed348[_0xeff4b2]['custom']={'type':_0x4d8ad0[_0x441f77]['type'],'values':_0x4d8ad0[_0x441f77]['values']};}Object[_0x37c3('0x30')](_0x1ed348)[_0x37c3('0x62')](function(_0x51d840){if(!_0x1ed348[_0x51d840][_0x37c3('0x3e')]('columnName')){delete _0x1ed348[_0x51d840];}});return _0x1ed348;});})['then'](respondWithResult(_0x1093e8,null))[_0x37c3('0x91')](handleError(_0x1093e8,null));};exports[_0x37c3('0x98')]=function(_0xf8111,_0x71ea46){var _0x281282;var _0x31a0d0;var _0x4c1b4d;if(_0xf8111[_0x37c3('0x99')]['id']){delete _0xf8111[_0x37c3('0x99')]['id'];}return db[_0x37c3('0x2e')]['findAll']({'where':{'id':[_0xf8111[_0x37c3('0x99')]['to'],_0xf8111[_0x37c3('0x99')][_0x37c3('0x45')]]}})[_0x37c3('0x29')](function(_0xc2896b){if(_0xc2896b){if(_0xc2896b[_0x37c3('0x31')]!==0x2){return null;}_0xc2896b[0x0]=_0xc2896b[0x0][_0x37c3('0x9a')]({'plain':!![]});_0xc2896b[0x1]=_0xc2896b[0x1][_0x37c3('0x9a')]({'plain':!![]});delete _0xc2896b[0x0]['id'];delete _0xc2896b[0x1]['id'];return _['mergeWith'](_0xc2896b[0x0],_0xc2896b[0x1],function(_0x37f0df,_0x3993b8){if(Array[_0x37c3('0x68')](_0x3993b8)&&!_0x3993b8[_0x37c3('0x31')]){return _0x37f0df;}else if(!_0x3993b8){return _0x37f0df;}});}})['then'](handleEntityNotFound(_0x71ea46,null))[_0x37c3('0x29')](function(_0x2db45d){if(_0x2db45d){if(_0x2db45d[_0x37c3('0x93')]&&_['isArray'](_0x2db45d[_0x37c3('0x93')])){_0x2db45d[_0x37c3('0x93')]=_0x2db45d[_0x37c3('0x93')][_0x37c3('0x9b')]();}logger[_0x37c3('0x9c')](_0x37c3('0x9d'),_0xf8111[_0x37c3('0x99')]['to'],_0xf8111[_0x37c3('0x99')][_0x37c3('0x45')]);return db[_0x37c3('0x9e')]['destroy']({'where':{'ContactId':[_0xf8111['body']['to'],_0xf8111['body'][_0x37c3('0x45')]]}})[_0x37c3('0x29')](function(_0x1292e0){logger['info'](_0x37c3('0x9f'),_0x1292e0);return db['CmHopperBlack']['destroy']({'where':{'ContactId':[_0xf8111[_0x37c3('0x99')]['to'],_0xf8111[_0x37c3('0x99')][_0x37c3('0x45')]]}})[_0x37c3('0x29')](function(_0x76a146){logger[_0x37c3('0x9c')](_0x37c3('0xa0'),_0x76a146);return db[_0x37c3('0x2e')][_0x37c3('0xa1')](_0x2db45d);});});}})[_0x37c3('0x29')](function(_0x230133){if(_0x230133){_0x281282=_0x230133;_0x31a0d0={'ContactId':_0x281282['id']};_0x4c1b4d={'where':{'ContactId':[_0xf8111['body']['to'],_0xf8111[_0x37c3('0x99')]['from']]}};return db[_0x37c3('0xa2')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xa4')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})['then'](function(){if(_0x281282){return db[_0x37c3('0xa5')]['update'](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xa6')]['update'](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db['MailMessage'][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xa6')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xa7')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xa8')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xa9')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})['then'](function(){if(_0x281282){return db[_0x37c3('0xaa')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xab')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xac')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xad')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xae')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db['CmHopperHistory'][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xaf')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xb0')]['update'](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xb1')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xb2')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db['MailQueueReport']['update'](_0x31a0d0,_0x4c1b4d);}})['then'](function(){if(_0x281282){return db[_0x37c3('0xb3')]['update'](_0x31a0d0,_0x4c1b4d);}})['then'](function(){if(_0x281282){return db['SmsQueueReport'][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})['then'](function(){if(_0x281282){return db[_0x37c3('0xb4')]['update'](_0x31a0d0,_0x4c1b4d);}})[_0x37c3('0x29')](function(){if(_0x281282){return db[_0x37c3('0xb5')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})['then'](function(){if(_0x281282){return db[_0x37c3('0xb6')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})['then'](function(){if(_0x281282){return db[_0x37c3('0xb7')][_0x37c3('0xa3')](_0x31a0d0,_0x4c1b4d);}})['then'](function(){if(_0x281282){return db[_0x37c3('0x2e')][_0x37c3('0x2a')]({'where':{'id':[_0xf8111[_0x37c3('0x99')]['to'],_0xf8111['body'][_0x37c3('0x45')]]}});}})[_0x37c3('0x29')](function(){if(_0x281282){return _0x281282;}})['then'](respondWithResult(_0x71ea46,null))[_0x37c3('0x91')](handleError(_0x71ea46,null));};exports[_0x37c3('0xa1')]=function(_0x2b4a71,_0x2a4c10){return db[_0x37c3('0x2e')][_0x37c3('0x2f')]()[_0x37c3('0x29')](function(_0x3cd74f){if(_0x2b4a71['body'][_0x37c3('0x93')]&&_[_0x37c3('0x68')](_0x2b4a71[_0x37c3('0x99')][_0x37c3('0x93')])){if(_0x2b4a71[_0x37c3('0x99')][_0x37c3('0x93')]['length']){_0x2b4a71[_0x37c3('0x99')]['tags']=_0x2b4a71['body']['tags']['join'](';')+';';}else{_0x2b4a71['body'][_0x37c3('0x93')]=null;}}else{_0x2b4a71['body'][_0x37c3('0x93')]=null;}return db['CmContact'][_0x37c3('0xa1')](_0x2b4a71['body'],{'fields':_['keys'](_0x3cd74f),'raw':!![]});})['then'](respondWithResult(_0x2a4c10,0xc9))['catch'](handleError(_0x2a4c10,null));};exports[_0x37c3('0xb8')]=function(_0xb6a2e5,_0x4325aa){var _0x3292c6=[];var _0x1b23da=0x0;var _0x1f27c4=0x0;var _0x4528a8=0x0;return db['CmContact'][_0x37c3('0x2f')]()[_0x37c3('0x29')](function(_0x3ea459){return BPromise[_0x37c3('0xb9')](_0xb6a2e5['body'],function(_0x4af09e){var _0x58ede0={'where':{'$or':[]},'defaults':_0x4af09e,'fields':_[_0x37c3('0x30')](_0x3ea459),'raw':!![]};if(_0x4af09e[_0x37c3('0xba')]){for(var _0x3bc902=0x0;_0x3bc902<_0x4af09e[_0x37c3('0xba')]['length'];_0x3bc902++){var _0x5347fc={};_0x5347fc[_0x4af09e['duplicates'][_0x3bc902]]=_0x4af09e[_0x4af09e[_0x37c3('0xba')][_0x3bc902]];_0x58ede0[_0x37c3('0x40')][_0x37c3('0xbb')]['push'](_0x5347fc);}_0x58ede0['where'][_0x37c3('0x84')]=_0x4af09e[_0x37c3('0x84')];}return db[_0x37c3('0x2e')][_0x37c3('0xbc')](_0x58ede0)[_0x37c3('0xbd')](function(_0x4618e7,_0x1e6592){if(_0x1e6592){_0x1b23da++;}else{_0x4528a8++;}})[_0x37c3('0x91')](function(_0xdac9af){console[_0x37c3('0xbe')](_0xdac9af);_0x1f27c4++;});});})[_0x37c3('0x29')](function(_0x306b0f){if(_0x306b0f){return{'success':_0x1b23da,'failure':_0x1f27c4,'duplicates':_0x4528a8};}})[_0x37c3('0x29')](respondWithResult(_0x4325aa,0xc9))[_0x37c3('0x91')](handleError(_0x4325aa,null));};exports[_0x37c3('0xbf')]=function(_0xfcabef,_0x379782,_0x4cdca0){var _0x3597f9;return db[_0x37c3('0x2e')][_0x37c3('0x2f')]()[_0x37c3('0x29')](function(_0x102061){return db[_0x37c3('0x2e')][_0x37c3('0xc0')]({'where':{'id':_0xfcabef['params']['id']},'include':[{'model':db[_0x37c3('0x52')],'as':_0x37c3('0x90'),'attributes':['id','name','color'],'required':_0xfcabef['query'][_0x37c3('0x67')]?!![]:![]}],'attributes':_[_0x37c3('0x30')](_0x102061)});})['then'](function(_0x2dc3dd){_0x3597f9=_0x2dc3dd[_0x37c3('0x9a')]({'plain':!![]});var _0x25db93={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x2dc3dd&&_0x2dc3dd[_0x37c3('0x84')]){if(_0x2dc3dd[_0x37c3('0x84')]){_0x25db93['where'][_0x37c3('0xc1')][_0x37c3('0x33')]({'ListId':{'$ne':_0x2dc3dd[_0x37c3('0x84')]}});}}return db['CmCustomField'][_0x37c3('0x95')](_0x25db93);})[_0x37c3('0x29')](function(_0x2b93fa){return _[_0x37c3('0xc2')](_0x3597f9,_[_0x37c3('0x5e')](_0x2b93fa,function(_0x57ddd4){return util['format'](_0x37c3('0xc3'),_0x57ddd4['id']);}));})[_0x37c3('0x29')](handleEntityNotFound(_0x379782,null))[_0x37c3('0x29')](respondWithResult(_0x379782,null))[_0x37c3('0x91')](handleError(_0x379782,null));};exports['update']=function(_0x54127e,_0x47ff49){var _0x10bb4a;if(_0x54127e[_0x37c3('0x99')]['id']){delete _0x54127e[_0x37c3('0x99')]['id'];}return db[_0x37c3('0x2e')][_0x37c3('0xc0')]({'where':{'id':_0x54127e[_0x37c3('0x92')]['id']}})[_0x37c3('0x29')](handleEntityNotFound(_0x47ff49,null))[_0x37c3('0x29')](saveUpdates(_0x54127e['body'],null))[_0x37c3('0x29')](function(_0x4b83c1){_0x10bb4a=_0x4b83c1;var _0x3f6ce9={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4b83c1&&_0x4b83c1[_0x37c3('0x84')]){if(_0x4b83c1[_0x37c3('0x84')]){_0x3f6ce9[_0x37c3('0x40')]['$and'][_0x37c3('0x33')]({'ListId':{'$ne':_0x4b83c1[_0x37c3('0x84')]}});}}return db[_0x37c3('0x94')][_0x37c3('0x95')](_0x3f6ce9);})[_0x37c3('0x29')](function(_0x5c27b4){if(_0x5c27b4){return _[_0x37c3('0xc2')](_[_0x37c3('0xc4')](_0x54127e[_0x37c3('0x99')],function(_0x382d20,_0x324b26){return _[_0x37c3('0x32')](_0x324b26,_0x37c3('0x36'));}),_['map'](_0x5c27b4,function(_0xce5c63){return util[_0x37c3('0xc5')](_0x37c3('0xc3'),_0xce5c63['id']);}));}})[_0x37c3('0x29')](function(_0x348508){if(_0x348508&&!_[_0x37c3('0x7c')](_0x348508)){var _0x136213=squel[_0x37c3('0xa3')]()[_0x37c3('0xc6')](_0x37c3('0x47'))[_0x37c3('0xc7')](_0x348508)[_0x37c3('0x40')]('id\x20=\x20?',_0x54127e[_0x37c3('0x92')]['id'])[_0x37c3('0xc8')]();return db[_0x37c3('0x85')][_0x37c3('0x3a')](_0x136213[_0x37c3('0x5c')],{'replacements':_0x136213[_0x37c3('0xc9')]});}})[_0x37c3('0x29')](function(){if(_0x54127e[_0x37c3('0x99')]['phone']&&_0x10bb4a){return db[_0x37c3('0x9e')][_0x37c3('0xa3')]({'phone':_0x54127e[_0x37c3('0x99')]['phone']},{'where':{'ContactId':_0x10bb4a['id']}});}})['then'](function(){return _0x10bb4a;})['then'](respondWithResult(_0x47ff49,null))['catch'](handleError(_0x47ff49,null));};exports[_0x37c3('0xca')]=function(_0x26404d,_0xa2cb62,_0x49c230){var _0x4019fe={};var _0x5d9377={};var _0x44686a;var _0x1d4238;return db[_0x37c3('0x2e')][_0x37c3('0x34')]({'where':{'id':_0x26404d[_0x37c3('0x92')]['id']}})[_0x37c3('0x29')](handleEntityNotFound(_0xa2cb62,null))[_0x37c3('0x29')](function(_0x8b3eb6){if(_0x8b3eb6){_0x44686a=_0x8b3eb6;_0x5d9377[_0x37c3('0x39')]=_['keys'](db[_0x37c3('0x52')][_0x37c3('0xcb')]);_0x5d9377['query']=_['keys'](_0x26404d[_0x37c3('0x3a')]);_0x5d9377[_0x37c3('0x41')]=_[_0x37c3('0x3c')](_0x5d9377[_0x37c3('0x39')],_0x5d9377[_0x37c3('0x3a')]);_0x4019fe[_0x37c3('0x3b')]=_['intersection'](_0x5d9377[_0x37c3('0x39')],qs[_0x37c3('0x3d')](_0x26404d[_0x37c3('0x3a')]['fields']));_0x4019fe[_0x37c3('0x3b')]=_0x4019fe[_0x37c3('0x3b')][_0x37c3('0x31')]?_0x4019fe[_0x37c3('0x3b')]:_0x5d9377['model'];_0x4019fe['order']=qs[_0x37c3('0x3f')](_0x26404d['query'][_0x37c3('0x3f')]);_0x4019fe[_0x37c3('0x40')]=qs['filters'](_['pick'](_0x26404d[_0x37c3('0x3a')],_0x5d9377['filters']));if(_0x26404d[_0x37c3('0x3a')]['filter']){_0x4019fe[_0x37c3('0x40')]=_[_0x37c3('0x98')](_0x4019fe[_0x37c3('0x40')],{'$or':_[_0x37c3('0x5e')](_0x4019fe[_0x37c3('0x3b')],function(_0x395365){var _0x45391e={};_0x45391e[_0x395365]={'$like':'%'+_0x26404d['query'][_0x37c3('0x5f')]+'%'};return _0x45391e;})});}_0x4019fe=_[_0x37c3('0x98')]({},_0x4019fe,_0x26404d['options']);return _0x44686a[_0x37c3('0xca')](_0x4019fe);}})[_0x37c3('0x29')](function(_0x29b10c){if(_0x29b10c){_0x1d4238=_0x29b10c['length'];if(!_0x26404d['query'][_0x37c3('0x3e')]('nolimit')){_0x4019fe[_0x37c3('0x23')]=qs['limit'](_0x26404d[_0x37c3('0x3a')]['limit']);_0x4019fe[_0x37c3('0x21')]=qs[_0x37c3('0x21')](_0x26404d[_0x37c3('0x3a')][_0x37c3('0x21')]);}return _0x44686a[_0x37c3('0xca')](_0x4019fe);}})[_0x37c3('0x29')](function(_0x5d2810){if(_0x5d2810){return _0x5d2810?{'count':_0x1d4238,'rows':_0x5d2810}:null;}})[_0x37c3('0x29')](respondWithResult(_0xa2cb62,null))['catch'](handleError(_0xa2cb62,null));};exports[_0x37c3('0xcc')]=function(_0x3920de,_0x25adc5,_0x3dad47){if(_0x3920de[_0x37c3('0x99')]['id']){delete _0x3920de[_0x37c3('0x99')]['id'];}return db[_0x37c3('0x2e')]['findOne']({'where':{'id':_0x3920de[_0x37c3('0x92')]['id']}})['then'](handleEntityNotFound(_0x25adc5,null))['then'](function(_0x2d7cde){if(_0x2d7cde){return _0x2d7cde[_0x37c3('0xcc')](_0x3920de[_0x37c3('0x99')][_0x37c3('0xcd')]||[]);}return null;})['then'](respondWithResult(_0x25adc5,null))[_0x37c3('0x91')](handleError(_0x25adc5,null));};exports[_0x37c3('0xce')]=function(_0x5812e3,_0x14d3a1,_0x3a5b27){var _0x285e22={'raw':![],'where':{}};var _0x3497f3={};var _0x42d43f={'count':0x0,'rows':[]};return db[_0x37c3('0x2e')][_0x37c3('0x34')]({'where':{'id':_0x5812e3[_0x37c3('0x92')]['id']}})['then'](handleEntityNotFound(_0x14d3a1,null))[_0x37c3('0x29')](function(_0x5339f3){if(_0x5339f3){_0x3497f3[_0x37c3('0x39')]=_[_0x37c3('0x30')](db[_0x37c3('0x9e')][_0x37c3('0xcb')]);_0x3497f3[_0x37c3('0x3a')]=_[_0x37c3('0x30')](_0x5812e3[_0x37c3('0x3a')]);_0x3497f3['filters']=_[_0x37c3('0x3c')](_0x3497f3[_0x37c3('0x39')],_0x3497f3[_0x37c3('0x3a')]);_0x285e22[_0x37c3('0x3b')]=_[_0x37c3('0x3c')](_0x3497f3[_0x37c3('0x39')],qs[_0x37c3('0x3d')](_0x5812e3['query'][_0x37c3('0x3d')]));_0x285e22[_0x37c3('0x3b')]=_0x285e22[_0x37c3('0x3b')][_0x37c3('0x31')]?_0x285e22[_0x37c3('0x3b')]:_0x3497f3[_0x37c3('0x39')];if(!_0x5812e3['query'][_0x37c3('0x3e')](_0x37c3('0xcf'))){_0x285e22[_0x37c3('0x23')]=qs[_0x37c3('0x23')](_0x5812e3[_0x37c3('0x3a')][_0x37c3('0x23')]);_0x285e22[_0x37c3('0x21')]=qs[_0x37c3('0x21')](_0x5812e3['query']['offset']);}_0x285e22[_0x37c3('0x7a')]=qs['sort'](_0x5812e3[_0x37c3('0x3a')][_0x37c3('0x3f')]);_0x285e22[_0x37c3('0x40')]=qs[_0x37c3('0x41')](_['pick'](_0x5812e3[_0x37c3('0x3a')],_0x3497f3[_0x37c3('0x41')]));_0x285e22[_0x37c3('0x40')][_0x37c3('0xd0')]=_0x5339f3['id'];if(_0x5812e3[_0x37c3('0x3a')]['filter']){_0x285e22[_0x37c3('0x40')]=_[_0x37c3('0x98')](_0x285e22[_0x37c3('0x40')],{'$or':_[_0x37c3('0x5e')](_0x285e22[_0x37c3('0x3b')],function(_0x9ea5fd){var _0x5bf3ce={};_0x5bf3ce[_0x9ea5fd]={'$like':'%'+_0x5812e3[_0x37c3('0x3a')]['filter']+'%'};return _0x5bf3ce;})});}_0x285e22=_[_0x37c3('0x98')]({},_0x285e22,_0x5812e3[_0x37c3('0xd1')]);return db[_0x37c3('0x9e')]['count']({'where':_0x285e22['where']})['then'](function(_0x943d6e){_0x42d43f[_0x37c3('0x24')]=_0x943d6e;if(_0x5812e3[_0x37c3('0x3a')][_0x37c3('0xd2')]){_0x285e22['include']=[{'all':!![]}];}return db[_0x37c3('0x9e')]['findAll'](_0x285e22);})[_0x37c3('0x29')](function(_0x456e4c){_0x42d43f[_0x37c3('0xd3')]=_0x456e4c;return _0x42d43f;});}})[_0x37c3('0x29')](respondWithFilteredResult(_0x14d3a1,_0x285e22))['catch'](handleError(_0x14d3a1,null));};exports['getHopperHistories']=function(_0x15bfce,_0x308256,_0x13174e){var _0x2b67bd={'raw':!![],'where':{}};var _0xd876b9={};var _0x2556b3={'count':0x0,'rows':[]};return db[_0x37c3('0x2e')]['findOne']({'where':{'id':_0x15bfce['params']['id']}})[_0x37c3('0x29')](handleEntityNotFound(_0x308256,null))[_0x37c3('0x29')](function(_0x3bf251){if(_0x3bf251){_0xd876b9['model']=_[_0x37c3('0x30')](db[_0x37c3('0xd4')][_0x37c3('0xcb')]);_0xd876b9[_0x37c3('0x3a')]=_[_0x37c3('0x30')](_0x15bfce['query']);_0xd876b9['filters']=_['intersection'](_0xd876b9['model'],_0xd876b9[_0x37c3('0x3a')]);_0x2b67bd[_0x37c3('0x3b')]=_['intersection'](_0xd876b9[_0x37c3('0x39')],qs[_0x37c3('0x3d')](_0x15bfce[_0x37c3('0x3a')][_0x37c3('0x3d')]));_0x2b67bd[_0x37c3('0x3b')]=_0x2b67bd['attributes'][_0x37c3('0x31')]?_0x2b67bd[_0x37c3('0x3b')]:_0xd876b9[_0x37c3('0x39')];if(!_0x15bfce[_0x37c3('0x3a')][_0x37c3('0x3e')](_0x37c3('0xcf'))){_0x2b67bd[_0x37c3('0x23')]=qs['limit'](_0x15bfce[_0x37c3('0x3a')][_0x37c3('0x23')]);_0x2b67bd[_0x37c3('0x21')]=qs[_0x37c3('0x21')](_0x15bfce[_0x37c3('0x3a')][_0x37c3('0x21')]);}_0x2b67bd[_0x37c3('0x7a')]=qs['sort'](_0x15bfce['query'][_0x37c3('0x3f')]);_0x2b67bd[_0x37c3('0x40')]=qs[_0x37c3('0x41')](_[_0x37c3('0xd5')](_0x15bfce['query'],_0xd876b9['filters']));_0x2b67bd[_0x37c3('0x40')]['ContactId']=_0x3bf251['id'];if(_0x15bfce[_0x37c3('0x3a')]['filter']){_0x2b67bd[_0x37c3('0x40')]=_[_0x37c3('0x98')](_0x2b67bd['where'],{'$or':_['map'](_0x2b67bd[_0x37c3('0x3b')],function(_0x5ee0ca){var _0x5367d0={};_0x5367d0[_0x5ee0ca]={'$like':'%'+_0x15bfce[_0x37c3('0x3a')][_0x37c3('0x5f')]+'%'};return _0x5367d0;})});}_0x2b67bd=_[_0x37c3('0x98')]({},_0x2b67bd,_0x15bfce[_0x37c3('0xd1')]);return db[_0x37c3('0xd4')][_0x37c3('0x24')]({'where':_0x2b67bd[_0x37c3('0x40')]})[_0x37c3('0x29')](function(_0x317733){_0x2556b3[_0x37c3('0x24')]=_0x317733;if(_0x15bfce[_0x37c3('0x3a')][_0x37c3('0xd2')]){_0x2b67bd[_0x37c3('0xd6')]=[{'all':!![]}];}return db[_0x37c3('0xd4')][_0x37c3('0x95')](_0x2b67bd);})[_0x37c3('0x29')](function(_0xacc43){_0x2556b3[_0x37c3('0xd3')]=_0xacc43;return _0x2556b3;});}})[_0x37c3('0x29')](respondWithFilteredResult(_0x308256,_0x2b67bd))[_0x37c3('0x91')](handleError(_0x308256,null));};exports[_0x37c3('0xd7')]=function(_0x10b9a8,_0x1510ce,_0x540879){var _0x105629={'raw':!![],'where':{}};var _0xddf898={};var _0x6f9caf={'count':0x0,'rows':[]};return db[_0x37c3('0x2e')][_0x37c3('0x34')]({'where':{'id':_0x10b9a8['params']['id']}})['then'](handleEntityNotFound(_0x1510ce,null))[_0x37c3('0x29')](function(_0x4c1644){if(_0x4c1644){_0xddf898[_0x37c3('0x39')]=_[_0x37c3('0x30')](db[_0x37c3('0xae')]['rawAttributes']);_0xddf898[_0x37c3('0x3a')]=_[_0x37c3('0x30')](_0x10b9a8[_0x37c3('0x3a')]);_0xddf898[_0x37c3('0x41')]=_['intersection'](_0xddf898[_0x37c3('0x39')],_0xddf898[_0x37c3('0x3a')]);_0x105629[_0x37c3('0x3b')]=_[_0x37c3('0x3c')](_0xddf898['model'],qs['fields'](_0x10b9a8[_0x37c3('0x3a')][_0x37c3('0x3d')]));_0x105629[_0x37c3('0x3b')]=_0x105629['attributes'][_0x37c3('0x31')]?_0x105629['attributes']:_0xddf898[_0x37c3('0x39')];if(!_0x10b9a8['query'][_0x37c3('0x3e')](_0x37c3('0xcf'))){_0x105629[_0x37c3('0x23')]=qs[_0x37c3('0x23')](_0x10b9a8[_0x37c3('0x3a')][_0x37c3('0x23')]);_0x105629[_0x37c3('0x21')]=qs[_0x37c3('0x21')](_0x10b9a8[_0x37c3('0x3a')][_0x37c3('0x21')]);}_0x105629[_0x37c3('0x7a')]=qs[_0x37c3('0x3f')](_0x10b9a8['query']['sort']);_0x105629['where']=qs[_0x37c3('0x41')](_[_0x37c3('0xd5')](_0x10b9a8[_0x37c3('0x3a')],_0xddf898['filters']));_0x105629[_0x37c3('0x40')]['ContactId']=_0x4c1644['id'];if(_0x10b9a8[_0x37c3('0x3a')][_0x37c3('0x5f')]){_0x105629['where']=_[_0x37c3('0x98')](_0x105629['where'],{'$or':_[_0x37c3('0x5e')](_0x105629[_0x37c3('0x3b')],function(_0x1f6771){var _0x56e245={};_0x56e245[_0x1f6771]={'$like':'%'+_0x10b9a8[_0x37c3('0x3a')][_0x37c3('0x5f')]+'%'};return _0x56e245;})});}_0x105629=_['merge']({},_0x105629,_0x10b9a8[_0x37c3('0xd1')]);return db[_0x37c3('0xae')][_0x37c3('0x24')]({'where':_0x105629['where']})['then'](function(_0x18865c){_0x6f9caf[_0x37c3('0x24')]=_0x18865c;if(_0x10b9a8[_0x37c3('0x3a')][_0x37c3('0xd2')]){_0x105629[_0x37c3('0xd6')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x37c3('0x95')](_0x105629);})['then'](function(_0x401f61){_0x6f9caf[_0x37c3('0xd3')]=_0x401f61;return _0x6f9caf;});}})[_0x37c3('0x29')](respondWithFilteredResult(_0x1510ce,_0x105629))[_0x37c3('0x91')](handleError(_0x1510ce,null));};exports[_0x37c3('0xd8')]=function(_0x2009dd,_0xbc9d26,_0x216332){var _0x50064f={'raw':!![],'where':{}};var _0x47068b={};var _0x1c0efa={'count':0x0,'rows':[]};return db[_0x37c3('0x2e')]['findOne']({'where':{'id':_0x2009dd[_0x37c3('0x92')]['id']}})[_0x37c3('0x29')](handleEntityNotFound(_0xbc9d26,null))[_0x37c3('0x29')](function(_0x4e4e08){if(_0x4e4e08){_0x47068b[_0x37c3('0x39')]=_[_0x37c3('0x30')](db[_0x37c3('0xb4')][_0x37c3('0xcb')]);_0x47068b['query']=_[_0x37c3('0x30')](_0x2009dd[_0x37c3('0x3a')]);_0x47068b[_0x37c3('0x41')]=_[_0x37c3('0x3c')](_0x47068b[_0x37c3('0x39')],_0x47068b['query']);_0x50064f[_0x37c3('0x3b')]=_['intersection'](_0x47068b['model'],qs[_0x37c3('0x3d')](_0x2009dd['query'][_0x37c3('0x3d')]));_0x50064f['attributes']=_0x50064f[_0x37c3('0x3b')]['length']?_0x50064f[_0x37c3('0x3b')]:_0x47068b[_0x37c3('0x39')];if(!_0x2009dd[_0x37c3('0x3a')]['hasOwnProperty'](_0x37c3('0xcf'))){_0x50064f[_0x37c3('0x23')]=qs['limit'](_0x2009dd[_0x37c3('0x3a')][_0x37c3('0x23')]);_0x50064f['offset']=qs[_0x37c3('0x21')](_0x2009dd[_0x37c3('0x3a')]['offset']);}_0x50064f[_0x37c3('0x7a')]=qs['sort'](_0x2009dd[_0x37c3('0x3a')]['sort']);_0x50064f[_0x37c3('0x40')]=qs['filters'](_[_0x37c3('0xd5')](_0x2009dd[_0x37c3('0x3a')],_0x47068b[_0x37c3('0x41')]));_0x50064f[_0x37c3('0x40')][_0x37c3('0xd0')]=_0x4e4e08['id'];if(_0x2009dd[_0x37c3('0x3a')][_0x37c3('0x5f')]){_0x50064f['where']=_[_0x37c3('0x98')](_0x50064f[_0x37c3('0x40')],{'$or':_[_0x37c3('0x5e')](_0x50064f[_0x37c3('0x3b')],function(_0x3728f4){var _0x380400={};_0x380400[_0x3728f4]={'$like':'%'+_0x2009dd[_0x37c3('0x3a')][_0x37c3('0x5f')]+'%'};return _0x380400;})});}_0x50064f=_['merge']({},_0x50064f,_0x2009dd[_0x37c3('0xd1')]);return db[_0x37c3('0xb4')][_0x37c3('0x24')]({'where':_0x50064f[_0x37c3('0x40')]})[_0x37c3('0x29')](function(_0xe64114){_0x1c0efa[_0x37c3('0x24')]=_0xe64114;if(_0x2009dd[_0x37c3('0x3a')]['includeAll']){_0x50064f[_0x37c3('0xd6')]=[{'all':!![]}];}return db[_0x37c3('0xb4')][_0x37c3('0x95')](_0x50064f);})[_0x37c3('0x29')](function(_0x20f98d){_0x1c0efa['rows']=_0x20f98d;return _0x1c0efa;});}})['then'](respondWithFilteredResult(_0xbc9d26,_0x50064f))['catch'](handleError(_0xbc9d26,null));};exports[_0x37c3('0xd9')]=function(_0x8daa3a,_0xbf650d,_0x499c2a){try{if(!_0x8daa3a[_0x37c3('0x99')][_0x37c3('0x84')]){throw new Error(_0x37c3('0xda'));}if(!_0x8daa3a['body'][_0x37c3('0xdb')]){throw new Error(_0x37c3('0xdc'));}if(!_0x8daa3a[_0x37c3('0x99')]['binding_values']){throw new Error(_0x37c3('0xdd'));}if(!_0x8daa3a[_0x37c3('0x99')][_0x37c3('0xde')]){throw new Error(_0x37c3('0xdf'));}var _0x11417c=_0x8daa3a[_0x37c3('0x99')]['binding_keys'][_0x37c3('0x54')](',');var _0x597fda=_0x8daa3a[_0x37c3('0x99')][_0x37c3('0xe0')]['split'](',');if(!_0x11417c['length']||!_0x597fda['length']||_0x11417c['length']!==_0x597fda['length']){throw new Error(_0x37c3('0xe1'));}_0x8daa3a[_0x37c3('0x99')][_0x37c3('0x3d')]=_[_0x37c3('0xe2')](_0x11417c,_0x597fda);if(!_0x8daa3a[_0x37c3('0x99')][_0x37c3('0x3d')]['phone']){throw new Error(_0x37c3('0xe3'));}if(!_0x8daa3a[_0x37c3('0x99')]['fields']['firstName']){throw new Error(_0x37c3('0xe4'));}var _0x12122f=path['join'](config[_0x37c3('0xe5')],_0x37c3('0xe6'),_0x8daa3a[_0x37c3('0xe7')][_0x37c3('0xe8')]);fs[_0x37c3('0xe9')](_0x12122f,parseInt(_0x37c3('0xea'),0x8));var _0x18e032=require(_0x37c3('0xeb'))[_0x37c3('0xec')](path[_0x37c3('0x9b')](__dirname,'../../components/import/cm/csv'),[_0x12122f,_0x8daa3a['body'][_0x37c3('0xdb')],_0x8daa3a[_0x37c3('0x99')][_0x37c3('0xe0')],_0x8daa3a[_0x37c3('0x99')][_0x37c3('0x84')],_0x8daa3a[_0x37c3('0x99')][_0x37c3('0xed')],_0x8daa3a[_0x37c3('0x99')][_0x37c3('0xba')],_0x8daa3a[_0x37c3('0x99')]['socket_timestamp']]);return _0xbf650d[_0x37c3('0x1e')](0xc8)[_0x37c3('0x20')]({'message':'File\x20uploaded\x20correctly!','pid':_0x18e032['pid']});}catch(_0x5c9db8){return _0xbf650d['status'](0x1f4)[_0x37c3('0x2d')](_0x5c9db8);}};exports[_0x37c3('0xee')]=function(_0x3ff0f5,_0x4fb5b7,_0x231ab0){var _0x426231=fs[_0x37c3('0xef')](_0x3ff0f5['file'][_0x37c3('0x8')]);Papa[_0x37c3('0xf0')](_0x426231,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x59cb9d){return _0x4fb5b7[_0x37c3('0x1e')](0xc8)[_0x37c3('0x20')]({'file':_0x3ff0f5['file'],'fields':_0x59cb9d[_0x37c3('0xf1')][_0x37c3('0x3d')]});}});};exports[_0x37c3('0xf2')]=function(_0x735ece,_0x468e09,_0x932a39){return db[_0x37c3('0x56')][_0x37c3('0x95')]({'raw':!![],'attributes':['id'],'where':{'role':_0x37c3('0x7e')}})[_0x37c3('0x29')](function(_0x52e002){var _0x4b703b=![];if(!_0x735ece['body'][_0x37c3('0x84')]){throw new Error('No\x20ListId\x20specified');}if(!_0x735ece[_0x37c3('0x99')][_0x37c3('0xf3')]['phone']){throw new Error(_0x37c3('0xe3'));}if(!_0x735ece['body'][_0x37c3('0xf3')]['firstName']){throw new Error(_0x37c3('0xe4'));}if(!_0x735ece[_0x37c3('0x99')][_0x37c3('0xde')]){throw new Error(_0x37c3('0xdf'));}var _0x4996e0=require(_0x37c3('0xeb'))[_0x37c3('0xec')](path[_0x37c3('0x9b')](__dirname,_0x37c3('0xf4')),[_0x735ece[_0x37c3('0x92')]['id'],JSON['stringify'](_0x735ece[_0x37c3('0x99')]),JSON[_0x37c3('0xf5')](_0x52e002)]);_0x4996e0['on'](_0x37c3('0xf6'),function(_0x348b83){_0x4b703b=!![];return _0x468e09[_0x37c3('0x1e')](0xc8)[_0x37c3('0x20')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x4996e0['pid']});});_0x4996e0['on'](_0x37c3('0xf7'),function(_0x360376){if(_0x360376&&!_0x4b703b){return _0x468e09['status'](0x1f4)[_0x37c3('0x20')]({'message':'error\x20child\x20process','pid':_0x4996e0[_0x37c3('0xf8')]});}});})[_0x37c3('0x91')](handleError(_0x468e09,null));};exports['getJourney']=function(_0x16165d,_0xf1fcca){var _0x33ac96=[_0x37c3('0xf9'),_0x37c3('0xfa'),_0x37c3('0xfb'),_0x37c3('0xfc'),'fax',_0x37c3('0xfd'),_0x37c3('0xfe')];var _0x4c51d2={'offset':0x0,'order':qs[_0x37c3('0x3f')](_0x37c3('0xff'))},_0x152861={'count':0x0,'rows':[]};Promise[_0x37c3('0x100')]()[_0x37c3('0x29')](function(){if(_0x16165d[_0x37c3('0x3a')][_0x37c3('0x101')]){if(!_['includes'](_0x33ac96,_0x16165d[_0x37c3('0x3a')][_0x37c3('0x101')][_0x37c3('0x102')]())){throw new Error(_0x37c3('0x103'));}_0x33ac96=[_0x16165d[_0x37c3('0x3a')][_0x37c3('0x101')][_0x37c3('0x102')]()];}if(_0x16165d[_0x37c3('0x3a')][_0x37c3('0x104')]){try{var _0x9dc3de=JSON[_0x37c3('0xf0')](_0x16165d['query']['range']);if(!moment(_0x9dc3de[_0x37c3('0x45')])['isValid']()){throw new Error(_0x37c3('0x105'));}if(!moment(_0x9dc3de['to'])[_0x37c3('0x106')]()){throw new Error(_0x37c3('0x107'));}}catch(_0x1ceab3){throw new Error(_0x37c3('0x108'));}}if(!_0x16165d[_0x37c3('0x3a')]['hasOwnProperty']('nolimit')){_0x4c51d2[_0x37c3('0x23')]=qs['limit'](_0x16165d[_0x37c3('0x3a')][_0x37c3('0x23')]||0xa);_0x4c51d2[_0x37c3('0x21')]=qs['offset'](_0x16165d[_0x37c3('0x3a')][_0x37c3('0x21')]);}var _0x20235f=_0x33ac96[_0x37c3('0x5e')](function(_0xb62916){if(_0xb62916===_0x37c3('0xfe')){var _0x214292={'attributes':['id',_0x37c3('0x109'),_0x37c3('0x38'),_0x37c3('0x10a'),_0x37c3('0x10b'),'callerid',_0x37c3('0x10c'),_0x37c3('0x10d'),_0x37c3('0x10e'),_0x37c3('0x10f'),_0x37c3('0x110'),_0x37c3('0x111'),_0x37c3('0x112'),'userThirdDisposition',_0x37c3('0x113')],'where':{'ContactId':_0x16165d[_0x37c3('0x92')]['id']},'include':[{'model':db[_0x37c3('0x56')],'as':_0x37c3('0x56'),'attributes':['id',_0x37c3('0x2c'),_0x37c3('0x114'),_0x37c3('0x97')]}],'order':[['createdAt','DESC']]};if(_0x16165d['query']['range']){_0x214292[_0x37c3('0x40')][_0x37c3('0x110')]={'$gte':_0x9dc3de[_0x37c3('0x45')],'$lte':_0x9dc3de['to']};}return db[_0x37c3('0xb0')][_0x37c3('0x115')](_0x214292)[_0x37c3('0x29')](function(_0x125316){_0x152861[_0x37c3('0x24')]+=_0x125316[_0x37c3('0x24')];return _['map'](_0x125316['rows'],function(_0x321ab3){var _0x5ea173=_0x321ab3[_0x37c3('0x9a')]({'plain':!![]});_0x5ea173[_0x37c3('0x101')]=_0xb62916;if(_0x5ea173[_0x37c3('0x56')]){_0x5ea173[_0x37c3('0x56')]={'id':_0x5ea173['User']['id'],'name':_0x5ea173[_0x37c3('0x56')]['name'],'fullname':_0x5ea173['User'][_0x37c3('0x114')],'alias':_0x5ea173[_0x37c3('0x56')][_0x37c3('0x97')]};}return _0x5ea173;});});}else{var _0x556873=_[_0x37c3('0x116')](_0xb62916)+(_0xb62916==='chat'?_0x37c3('0x117'):_0x37c3('0x118'));var _0x27ffc5={'attributes':['id','closed',_0x37c3('0x119'),_0x37c3('0x110'),'note',_0x37c3('0x11a'),_0x37c3('0x11b'),_0x37c3('0x11c'),_0x37c3('0x113'),_0x556873+'Id'],'where':{'ContactId':_0x16165d[_0x37c3('0x92')]['id']},'include':[{'model':db[_0x556873],'as':'Account','attributes':['id',_0x37c3('0x2c'),_0x37c3('0x11d')]},{'model':db[_0x37c3('0x56')],'as':_0x37c3('0x11e'),'attributes':['id',_0x37c3('0x2c'),'fullname']},{'model':db[_0x37c3('0x52')],'as':_0x37c3('0x90'),'attributes':['id',_0x37c3('0x2c'),'color'],'through':{'attributes':[]}}],'order':[[_0x37c3('0x110'),'DESC']]};if(_0x16165d['query'][_0x37c3('0x104')]){_0x27ffc5[_0x37c3('0x40')][_0x37c3('0x110')]={'$gte':_0x9dc3de[_0x37c3('0x45')],'$lte':_0x9dc3de['to']};}switch(_0xb62916){case _0x37c3('0xfa'):_0x27ffc5[_0x37c3('0x3b')][_0x37c3('0x33')](_0x37c3('0x11f'),'customerIp',_0x37c3('0x120'),_0x37c3('0x121'),_0x37c3('0x122'),_0x37c3('0x123'),_0x37c3('0x124'),'ratingValue','referer');break;case _0x37c3('0xf9'):_0x27ffc5['attributes'][_0x37c3('0x33')](_0x37c3('0x125'),'substatus');break;case _0x37c3('0xfc'):_0x27ffc5[_0x37c3('0x3b')]['push'](_0x37c3('0x126'),_0x37c3('0x127'));break;}return db[_[_0x37c3('0x116')](_0xb62916)+_0x37c3('0x128')][_0x37c3('0x115')](_0x27ffc5)[_0x37c3('0x29')](function(_0x5ac8a8){_0x152861[_0x37c3('0x24')]+=_0x5ac8a8[_0x37c3('0x24')];return _[_0x37c3('0x5e')](_0x5ac8a8[_0x37c3('0xd3')],function(_0x4f8652){var _0x46dceb=_0x4f8652[_0x37c3('0x9a')]({'plain':!![]});_0x46dceb[_0x37c3('0x101')]=_0xb62916;if(_0x46dceb[_0x37c3('0x11e')]){_0x46dceb[_0x37c3('0x11e')]={'id':_0x46dceb['Owner']['id'],'name':_0x46dceb[_0x37c3('0x11e')][_0x37c3('0x2c')],'fullname':_0x46dceb['Owner'][_0x37c3('0x114')]};}return _0x46dceb;});});}});return Promise[_0x37c3('0x129')](_0x20235f);})[_0x37c3('0x29')](function(_0x545613){return _(_0x545613)[_0x37c3('0x12a')]()[_0x37c3('0x12b')](_0x37c3('0x110'))['reverse']()[_0x37c3('0x53')]();})[_0x37c3('0x29')](function(_0x3ce070){_0x152861[_0x37c3('0xd3')]=_0x4c51d2[_0x37c3('0x23')]?_0x3ce070[_0x37c3('0x12c')](_0x4c51d2[_0x37c3('0x21')],_0x4c51d2[_0x37c3('0x21')]+_0x4c51d2[_0x37c3('0x23')]):_0x3ce070;return _0x152861;})['then'](respondWithFilteredResult(_0xf1fcca,_0x4c51d2))[_0x37c3('0x91')](handleError(_0xf1fcca,null));};
\ No newline at end of file
+var _0x28a8=['c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','order','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','sequelize','Tags','rows','catch','destroy','tags','displayName','findAll','columnName','alias','custom','values','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','params','Tag','$and','omit','format','startsWith','cf_%d','isEmpty','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','getHopperHistories','getHopperFinals','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','binding_values','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','server/files/tmp','filename','chmodSync','0777','child_process','CompanyId','socket_timestamp','pid','upload','createReadStream','file','parse','meta','binding','firstName','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','sms','openchannel','fax','whatsapp','-createdAt','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','callerid','starttime','duration','createdAt','userSecondDisposition','fullname','startCase','chat','Website','Account','closed','closedAt','note','disposition','thirdDisposition','UserId','Owner','browserName','customerIp','customerPort','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','Interaction','findAndCountAll','flatten','sortBy','reverse','slice','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','error','stack','name','send','index','CmContact','describe','keys','length','cf_','CmCustomField','findOne','trimStart','all','fieldType','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','datetime','castTo','buildExpression','text','start','filter','isNil','Contact','push','ListId','concat','where','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?'];(function(_0x2c78b1,_0x43967e){var _0xfd003=function(_0x2c3f53){while(--_0x2c3f53){_0x2c78b1['push'](_0x2c78b1['shift']());}};_0xfd003(++_0x43967e);}(_0x28a8,0xbf));var _0x828a=function(_0x545e86,_0x46a2ed){_0x545e86=_0x545e86-0x0;var _0xa98055=_0x28a8[_0x545e86];return _0xa98055;};'use strict';var emlformat=require(_0x828a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x828a('0x1'));var rp=require(_0x828a('0x2'));var moment=require(_0x828a('0x3'));var BPromise=require(_0x828a('0x4'));var Mustache=require(_0x828a('0x5'));var util=require(_0x828a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x828a('0x7'));var ejs=require(_0x828a('0x8'));var fs=require('fs');var fs_extra=require(_0x828a('0x9'));var _=require('lodash');var squel=require(_0x828a('0xa'));var crypto=require(_0x828a('0xb'));var jsforce=require(_0x828a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x828a('0x7'));var querystring=require(_0x828a('0xd'));var Papa=require(_0x828a('0xe'));var Redis=require(_0x828a('0xf'));var authService=require(_0x828a('0x10'));var qs=require(_0x828a('0x11'));var as=require(_0x828a('0x12'));var hardwareService=require(_0x828a('0x13'));var logger=require(_0x828a('0x14'))('api');var utils=require(_0x828a('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x828a('0x16'))['db'];config['redis']=_['defaults'](config[_0x828a('0x17')],{'host':_0x828a('0x18'),'port':0x18eb});var socket=require(_0x828a('0x19'))(new Redis(config[_0x828a('0x17')]));require('./cmContact.socket')[_0x828a('0x1a')](socket);function respondWithStatusCode(_0x2ac0ec,_0x4223ea){_0x4223ea=_0x4223ea||0xcc;return function(_0x348dbc){if(_0x348dbc){return _0x2ac0ec[_0x828a('0x1b')](_0x4223ea);}return _0x2ac0ec['status'](_0x4223ea)[_0x828a('0x1c')]();};}function respondWithResult(_0x42d5fc,_0x28d783){_0x28d783=_0x28d783||0xc8;return function(_0x8b0c65){if(_0x8b0c65){return _0x42d5fc[_0x828a('0x1d')](_0x28d783)[_0x828a('0x1e')](_0x8b0c65);}};}function respondWithFilteredResult(_0x55c38b,_0x245d90){return function(_0x235831){if(_0x235831){var _0x5812f2=typeof _0x245d90[_0x828a('0x1f')]===_0x828a('0x20')&&typeof _0x245d90['limit']===_0x828a('0x20');var _0x1e687e=_0x235831[_0x828a('0x21')];var _0x530f76=_0x5812f2?0x0:_0x245d90[_0x828a('0x1f')];var _0xcdb466=_0x5812f2?_0x235831[_0x828a('0x21')]:_0x245d90[_0x828a('0x1f')]+_0x245d90[_0x828a('0x22')];var _0x2dad05;if(_0xcdb466>=_0x1e687e){_0xcdb466=_0x1e687e;_0x2dad05=0xc8;}else{_0x2dad05=0xce;}_0x55c38b[_0x828a('0x1d')](_0x2dad05);return _0x55c38b[_0x828a('0x23')](_0x828a('0x24'),_0x530f76+'-'+_0xcdb466+'/'+_0x1e687e)[_0x828a('0x1e')](_0x235831);}return null;};}function patchUpdates(_0x88ab5c){return function(_0x10694b){try{jsonpatch['apply'](_0x10694b,_0x88ab5c,!![]);}catch(_0x2718c0){return BPromise['reject'](_0x2718c0);}return _0x10694b[_0x828a('0x25')]();};}function saveUpdates(_0x2de926,_0xf42d3d){return function(_0x367cab){if(_0x367cab){return _0x367cab[_0x828a('0x26')](_0x2de926)[_0x828a('0x27')](function(_0x442721){return _0x442721;});}return null;};}function removeEntity(_0x3fc95f,_0x3a4585){return function(_0x5c1a5c){if(_0x5c1a5c){return _0x5c1a5c['destroy']()[_0x828a('0x27')](function(){_0x3fc95f[_0x828a('0x1d')](0xcc)[_0x828a('0x1c')]();});}};}function handleEntityNotFound(_0x489ce9,_0x24867a){return function(_0x17de29){if(!_0x17de29){_0x489ce9[_0x828a('0x1b')](0x194);}return _0x17de29;};}function handleError(_0x262635,_0xb89143){_0xb89143=_0xb89143||0x1f4;return function(_0x293318){logger[_0x828a('0x28')](_0x293318[_0x828a('0x29')]);if(_0x293318[_0x828a('0x2a')]){delete _0x293318['name'];}_0x262635[_0x828a('0x1d')](_0xb89143)[_0x828a('0x2b')](_0x293318);};}exports[_0x828a('0x2c')]=function(_0x2cd4d1,_0x1c07f8){var _0x325da4={},_0x48ca06={},_0x1245be={'count':0x0,'rows':[]};return db[_0x828a('0x2d')][_0x828a('0x2e')]()[_0x828a('0x27')](function(_0x5cdf50){var _0x439e61=[];for(var _0x117c89=0x0;_0x117c89<Object[_0x828a('0x2f')](_0x5cdf50)[_0x828a('0x30')];_0x117c89++){var _0x196fbc=Object[_0x828a('0x2f')](_0x5cdf50)[_0x117c89];if(_['startsWith'](_0x196fbc,_0x828a('0x31'))){_0x439e61['push'](db[_0x828a('0x32')][_0x828a('0x33')]({'where':{'id':_[_0x828a('0x34')](_0x196fbc,_0x828a('0x31'))},'raw':!![]}));}}return BPromise[_0x828a('0x35')](_0x439e61)['then'](function(_0x5a445d){for(var _0x19ad61=0x0;_0x19ad61<_0x5a445d[_0x828a('0x30')];_0x19ad61++){if(_0x5a445d[_0x19ad61]){var _0x3863fe=_0x828a('0x31')+_0x5a445d[_0x19ad61]['id'];var _0x11e443=_0x5cdf50[_0x3863fe];_0x11e443[_0x828a('0x36')]=_0x5a445d[_0x19ad61][_0x828a('0x37')];}}return _0x5cdf50;});})[_0x828a('0x27')](function(_0x32103c){_0x48ca06['model']=_['keys'](_0x32103c);_0x48ca06['query']=_[_0x828a('0x2f')](_0x2cd4d1[_0x828a('0x38')]);_0x48ca06[_0x828a('0x39')]=_[_0x828a('0x3a')](_0x48ca06[_0x828a('0x3b')],_0x48ca06[_0x828a('0x38')]);_0x325da4[_0x828a('0x3c')]=_[_0x828a('0x3a')](_0x48ca06['model'],qs[_0x828a('0x3d')](_0x2cd4d1[_0x828a('0x38')][_0x828a('0x3d')]));_0x325da4[_0x828a('0x3c')]=_0x325da4[_0x828a('0x3c')]['length']?_0x325da4[_0x828a('0x3c')]:_0x48ca06['model'];if(!_0x2cd4d1[_0x828a('0x38')][_0x828a('0x3e')](_0x828a('0x3f'))){_0x325da4[_0x828a('0x22')]=qs[_0x828a('0x22')](_0x2cd4d1[_0x828a('0x38')][_0x828a('0x22')]);_0x325da4['offset']=qs[_0x828a('0x1f')](_0x2cd4d1[_0x828a('0x38')][_0x828a('0x1f')]);}_0x325da4['order']=qs[_0x828a('0x40')](_0x2cd4d1[_0x828a('0x38')][_0x828a('0x40')]);_0x325da4['where']=qs['filters'](_[_0x828a('0x41')](_0x2cd4d1[_0x828a('0x38')],_0x48ca06[_0x828a('0x39')]),_0x32103c);var _0x421430=[];var _0x2d7a59=squel[_0x828a('0x42')]()[_0x828a('0x43')]('id')[_0x828a('0x43')]('name')[_0x828a('0x43')](_0x828a('0x44'))[_0x828a('0x45')](_0x828a('0x46'));var _0x122aa7=squel['select']()['from'](_0x828a('0x47'),'c')[_0x828a('0x48')](_0x828a('0x49'),'uc',_0x828a('0x4a'))[_0x828a('0x48')](_0x828a('0x4b'),'ct',_0x828a('0x4c'))['left_join'](_0x828a('0x46'),'t',_0x828a('0x4d'))['where'](_0x828a('0x4e'));var _0x5defda=squel['expr']();var _0x44e918=[];var _0x3d636c=squel[_0x828a('0x4f')]();var _0x2dd9ea;if(_0x2cd4d1['query'][_0x828a('0x50')]){_0x2dd9ea=as[_0x828a('0x51')](_0x2cd4d1[_0x828a('0x38')][_0x828a('0x50')]);var _0x3871c1=_0x2dd9ea['sqlOperator'];for(var _0x420eb1=0x0;_0x420eb1<_0x2dd9ea[_0x828a('0x52')][_0x828a('0x30')];_0x420eb1++){var _0x1fb69e=_0x2dd9ea[_0x828a('0x52')][_0x420eb1];var _0x5a5acc='c';var _0x4c2c91=_(_0x32103c)[_0x828a('0x2f')]()[_0x828a('0x53')](function(_0x41c692){return _0x41c692===_0x1fb69e[_0x828a('0x43')];});if(_0x4c2c91)_0x4c2c91=_0x32103c[_0x1fb69e['field']];if(!_0x4c2c91){if(_0x1fb69e[_0x828a('0x43')]==='Tag'){var _0x20ffa6=_0x1fb69e['value'][_0x828a('0x54')](',')[_0x828a('0x55')](function(_0x4bd256){return Number(_0x4bd256);});_0x20ffa6[_0x828a('0x56')](function(_0x387584){_0x3d636c['or'](_0x828a('0x57'),'%,'+_0x387584+',%');});_0x44e918=_[_0x828a('0x58')](_0x44e918,_0x20ffa6);}else if(_0x1fb69e[_0x828a('0x43')]===_0x828a('0x59')){_0x5defda[_0x828a('0x5a')](_0x828a('0x5b'),_0x1fb69e[_0x828a('0x5c')]);}}else{if(_0x1fb69e[_0x828a('0x43')]==='dateOfBirth'||_0x4c2c91['fieldType']===_0x828a('0x5d'))_0x1fb69e[_0x828a('0x5e')]='DATE';var _0x52f102=as[_0x828a('0x5f')](_0x5a5acc,_0x4c2c91[_0x828a('0x37')],_0x1fb69e);_0x5defda[_0x3871c1](_0x52f102[_0x828a('0x60')],_0x52f102['value'][_0x828a('0x61')],_0x52f102['value'][_0x828a('0x1c')]);}}}else{var _0x476915=_(Object[_0x828a('0x2f')](_0x2cd4d1[_0x828a('0x38')]))[_0x828a('0x55')](function(_0x1d85e4){return _0x32103c[_0x828a('0x3e')](_0x1d85e4)?_0x1d85e4:undefined;})[_0x828a('0x62')](function(_0x2feaff){return!_[_0x828a('0x63')](_0x2feaff);})[_0x828a('0x5c')]();if(_0x2cd4d1[_0x828a('0x38')][_0x828a('0x64')])_0x476915[_0x828a('0x65')](_0x828a('0x64'));if(!_['isEmpty'](_0x476915)){_0x476915[_0x828a('0x56')](function(_0x1a7519){if(_0x1a7519===_0x828a('0x66')){_0x122aa7['where']('c.ListId\x20IN\x20?',[][_0x828a('0x67')](_0x2cd4d1['query'][_0x1a7519]));}else if(_0x1a7519===_0x828a('0x64')){var _0x694f20='%'+_0x2cd4d1[_0x828a('0x38')][_0x1a7519]+'%';_0x122aa7[_0x828a('0x68')](_0x828a('0x69'),_0x694f20);}else{_0x122aa7['where']('c.'+_0x1a7519+_0x828a('0x6a'),_0x2cd4d1[_0x828a('0x38')][_0x1a7519]);}});}if(_0x2cd4d1['query'][_0x828a('0x6b')]){_0x44e918=_[_0x828a('0x6c')](_0x2cd4d1[_0x828a('0x38')][_0x828a('0x6b')])?_0x2cd4d1[_0x828a('0x38')][_0x828a('0x6b')]:new Array(_0x2cd4d1[_0x828a('0x38')][_0x828a('0x6b')]);_0x44e918[_0x828a('0x56')](function(_0x4f36e2){_0x3d636c['or'](_0x828a('0x57'),'%,'+_0x4f36e2+',%');});}if(_0x2cd4d1['query'][_0x828a('0x62')]){var _0xb474f5=_0x2cd4d1[_0x828a('0x38')][_0x828a('0x62')][_0x828a('0x6d')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0xb474f5['split']('\x20')[_0x828a('0x30')]>0x1){_0x5defda['or'](_0x828a('0x6e'),qs[_0x828a('0x6f')](_0xb474f5),null);}else{if(qs[_0x828a('0x70')](_0xb474f5)){_0x5defda['or'](_0x828a('0x71'),_0xb474f5+'%');_0x5defda['or'](_0x828a('0x72'),_0xb474f5+'%');_0x5defda['or'](_0x828a('0x73'),_0xb474f5+'%');_0x5defda['or'](_0x828a('0x74'),_0xb474f5+'%');}else if(qs[_0x828a('0x75')](_0xb474f5)){_0x5defda['or'](_0x828a('0x76'),_0xb474f5+'%');}else{_0x5defda['or'](_0x828a('0x77'),'%'+_0xb474f5+'%');_0x5defda['or'](_0x828a('0x78'),'%'+_0xb474f5+'%');_0x5defda['or'](_0x828a('0x76'),'%'+_0xb474f5+'%');}}}}_0x122aa7[_0x828a('0x68')](_0x5defda);_0x122aa7[_0x828a('0x79')](_0x828a('0x7a'));var _0x18c526={'type':db[_0x828a('0x7b')][_0x828a('0x7c')]['SELECT'],'raw':!![]};var _0x191e8d=_0x122aa7[_0x828a('0x7d')]()[_0x828a('0x43')](_0x828a('0x7a'));if(_0x325da4[_0x828a('0x7e')]){_0x325da4[_0x828a('0x7e')]['forEach'](function(_0x5c11c4){_0x122aa7[_0x828a('0x7e')]('c.'+_0x5c11c4[0x0],_0x5c11c4[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x44e918)){_0x122aa7[_0x828a('0x7f')](_0x3d636c);_0x191e8d['where'](_0x828a('0x80'),_0x44e918);}BPromise[_0x828a('0x81')]()[_0x828a('0x27')](function(){if(!_0x2dd9ea)return;if(_0x2cd4d1[_0x828a('0x82')][_0x828a('0x83')]!==_0x828a('0x84'))return;if(!_[_0x828a('0x85')](_0x2dd9ea[_0x828a('0x52')],[_0x828a('0x43'),_0x828a('0x59')])){return _0x2cd4d1[_0x828a('0x82')][_0x828a('0x86')]({'attributes':['id'],'raw':!![]})[_0x828a('0x27')](function(_0x569009){if(_['isEmpty'](_0x569009)){_0x191e8d[_0x828a('0x68')](_0x828a('0x87'));_0x122aa7[_0x828a('0x68')](_0x828a('0x87'));}else{_0x191e8d[_0x828a('0x68')](_0x828a('0x88'),_[_0x828a('0x55')](_0x569009,'id'));_0x122aa7[_0x828a('0x68')](_0x828a('0x88'),_['map'](_0x569009,'id'));}});}})['then'](function(){if(_0x2cd4d1['user'][_0x828a('0x83')]===_0x828a('0x84')&&!_0x2dd9ea&&!_0x2cd4d1[_0x828a('0x38')][_0x828a('0x66')])return[];return db['sequelize'][_0x828a('0x38')](_0x191e8d[_0x828a('0x89')](),_0x18c526);})[_0x828a('0x27')](function(_0x2dbd83){_0x1245be[_0x828a('0x21')]=_0x2dbd83[_0x828a('0x30')];if(_0x1245be[_0x828a('0x21')]===0x0)return[];return db['sequelize'][_0x828a('0x38')](_0x2d7a59[_0x828a('0x89')](),_0x18c526)['then'](function(_0x44e0dc){_0x421430=_[_0x828a('0x8a')](_0x44e0dc,'id');_0x18c526=_[_0x828a('0x8b')](_0x18c526,{'model':db[_0x828a('0x2d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2cd4d1[_0x828a('0x38')][_0x828a('0x3d')]){_0x325da4[_0x828a('0x3c')]['forEach'](function(_0x5443e1){_0x122aa7[_0x828a('0x43')]('c.'+_0x5443e1);});}else{_0x122aa7[_0x828a('0x43')](_0x828a('0x7a'));_0x122aa7[_0x828a('0x43')](_0x828a('0x8c'));_0x122aa7['field'](_0x828a('0x8d'));_0x122aa7[_0x828a('0x43')](_0x828a('0x8e'));_0x122aa7['field']('c.mobile');_0x122aa7[_0x828a('0x43')](_0x828a('0x8f'));_0x122aa7[_0x828a('0x43')](_0x828a('0x90'));_0x122aa7[_0x828a('0x43')](_0x828a('0x91'));_0x122aa7[_0x828a('0x43')](_0x828a('0x92'));_0x122aa7[_0x828a('0x43')](_0x828a('0x93'));_0x122aa7[_0x828a('0x43')](_0x828a('0x94'));_0x122aa7[_0x828a('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x828a('0x95'));}if(_0x325da4['limit'])_0x122aa7['limit'](_0x325da4[_0x828a('0x22')]);if(_0x325da4['offset'])_0x122aa7[_0x828a('0x1f')](_0x325da4['offset']);return db[_0x828a('0x96')][_0x828a('0x38')](_0x122aa7['toString'](),_0x18c526);});})['then'](function(_0x33476b){_0x33476b[_0x828a('0x56')](function(_0x261a21){if(_0x261a21[_0x828a('0x95')]){_0x261a21[_0x828a('0x97')]=[];_0x261a21['TagIds'][_0x828a('0x54')](',')['forEach'](function(_0x37cb87){_0x261a21['Tags'][_0x828a('0x65')](_0x421430[_0x37cb87]);});}delete _0x261a21[_0x828a('0x95')];});_0x1245be[_0x828a('0x98')]=_0x33476b;return _0x1245be;})[_0x828a('0x27')](respondWithFilteredResult(_0x1c07f8,_0x325da4));})[_0x828a('0x99')](handleError(_0x1c07f8,null));};exports[_0x828a('0x9a')]=function(_0xce65c4,_0x8dd5c3){return db[_0x828a('0x2d')][_0x828a('0x53')]({'where':{'id':_0xce65c4['params']['id']}})['then'](handleEntityNotFound(_0x8dd5c3,null))[_0x828a('0x27')](removeEntity(_0x8dd5c3,null))[_0x828a('0x99')](handleError(_0x8dd5c3,null));};exports[_0x828a('0x2e')]=function(_0x22af96,_0x17670d){return db[_0x828a('0x2d')][_0x828a('0x2e')]()[_0x828a('0x27')](function(_0x3b93bf){delete _0x3b93bf[_0x828a('0x9b')];for(var _0x32914c=0x0;_0x32914c<Object[_0x828a('0x2f')](_0x3b93bf)[_0x828a('0x30')];_0x32914c++){var _0xae73d0=Object[_0x828a('0x2f')](_0x3b93bf)[_0x32914c];if(!_['startsWith'](_0xae73d0,'cf_')){_0x3b93bf[_0xae73d0]['columnName']=_0xae73d0;_0x3b93bf[_0xae73d0][_0x828a('0x9c')]=_0xae73d0;}}return _0x3b93bf;})[_0x828a('0x27')](function(_0x14b396){var _0x5d7942={'where':{'$or':[{'ListId':_0x22af96['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0x828a('0x32')][_0x828a('0x9d')](_0x5d7942)[_0x828a('0x27')](function(_0x13e3f3){for(var _0x270e71=0x0;_0x270e71<_0x13e3f3[_0x828a('0x30')];_0x270e71++){var _0x41537b=_0x828a('0x31')+_0x13e3f3[_0x270e71]['id'];_0x14b396[_0x41537b][_0x828a('0x9e')]=_0x41537b;_0x14b396[_0x41537b][_0x828a('0x9c')]=_0x13e3f3[_0x270e71][_0x828a('0x9f')];_0x14b396[_0x41537b][_0x828a('0xa0')]={'type':_0x13e3f3[_0x270e71]['type'],'values':_0x13e3f3[_0x270e71][_0x828a('0xa1')]};}Object['keys'](_0x14b396)[_0x828a('0x56')](function(_0x5b9dff){if(!_0x14b396[_0x5b9dff]['hasOwnProperty']('columnName')){delete _0x14b396[_0x5b9dff];}});return _0x14b396;});})[_0x828a('0x27')](respondWithResult(_0x17670d,null))['catch'](handleError(_0x17670d,null));};exports['merge']=function(_0x3bf47f,_0x542a2b){var _0x5dd816;var _0x3d75f3;var _0x2918a5;if(_0x3bf47f[_0x828a('0xa2')]['id']){delete _0x3bf47f['body']['id'];}return db[_0x828a('0x2d')][_0x828a('0x9d')]({'where':{'id':[_0x3bf47f[_0x828a('0xa2')]['to'],_0x3bf47f['body'][_0x828a('0x45')]]}})['then'](function(_0x22ea58){if(_0x22ea58){if(_0x22ea58['length']!==0x2){return null;}_0x22ea58[0x0]=_0x22ea58[0x0][_0x828a('0xa3')]({'plain':!![]});_0x22ea58[0x1]=_0x22ea58[0x1][_0x828a('0xa3')]({'plain':!![]});delete _0x22ea58[0x0]['id'];delete _0x22ea58[0x1]['id'];return _[_0x828a('0xa4')](_0x22ea58[0x0],_0x22ea58[0x1],function(_0x291ac4,_0x575a2d){if(Array['isArray'](_0x575a2d)&&!_0x575a2d['length']){return _0x291ac4;}else if(!_0x575a2d){return _0x291ac4;}});}})[_0x828a('0x27')](handleEntityNotFound(_0x542a2b,null))[_0x828a('0x27')](function(_0x56e4ea){if(_0x56e4ea){if(_0x56e4ea[_0x828a('0x9b')]&&_[_0x828a('0x6c')](_0x56e4ea['tags'])){_0x56e4ea[_0x828a('0x9b')]=_0x56e4ea[_0x828a('0x9b')][_0x828a('0xa5')]();}logger[_0x828a('0xa6')](_0x828a('0xa7'),_0x3bf47f[_0x828a('0xa2')]['to'],_0x3bf47f[_0x828a('0xa2')][_0x828a('0x45')]);return db[_0x828a('0xa8')]['destroy']({'where':{'ContactId':[_0x3bf47f[_0x828a('0xa2')]['to'],_0x3bf47f[_0x828a('0xa2')][_0x828a('0x45')]]}})[_0x828a('0x27')](function(_0x1497c4){logger['info'](_0x828a('0xa9'),_0x1497c4);return db[_0x828a('0xaa')][_0x828a('0x9a')]({'where':{'ContactId':[_0x3bf47f[_0x828a('0xa2')]['to'],_0x3bf47f[_0x828a('0xa2')][_0x828a('0x45')]]}})[_0x828a('0x27')](function(_0x1c8b84){logger[_0x828a('0xa6')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x1c8b84);return db['CmContact'][_0x828a('0xab')](_0x56e4ea);});});}})[_0x828a('0x27')](function(_0x43e45e){if(_0x43e45e){_0x5dd816=_0x43e45e;_0x3d75f3={'ContactId':_0x5dd816['id']};_0x2918a5={'where':{'ContactId':[_0x3bf47f[_0x828a('0xa2')]['to'],_0x3bf47f[_0x828a('0xa2')]['from']]}};return db[_0x828a('0xac')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xad')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xae')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db['MailInteraction']['update'](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xaf')]['update'](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xb0')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db['MailMessage'][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})['then'](function(){if(_0x5dd816){return db[_0x828a('0xb1')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db['SmsMessage'][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})['then'](function(){if(_0x5dd816){return db[_0x828a('0xb2')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db['FaxMessage'][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xb3')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xb4')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xb5')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})['then'](function(){if(_0x5dd816){return db[_0x828a('0xb6')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xb7')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xb8')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xb9')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xba')]['update'](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xbb')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xbc')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xbd')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})['then'](function(){if(_0x5dd816){return db[_0x828a('0xbe')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xbf')][_0x828a('0x26')](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db[_0x828a('0xc0')]['update'](_0x3d75f3,_0x2918a5);}})[_0x828a('0x27')](function(){if(_0x5dd816){return db['WhatsappQueueReport']['update'](_0x3d75f3,_0x2918a5);}})['then'](function(){if(_0x5dd816){return db[_0x828a('0x2d')][_0x828a('0x9a')]({'where':{'id':[_0x3bf47f[_0x828a('0xa2')]['to'],_0x3bf47f[_0x828a('0xa2')][_0x828a('0x45')]]}});}})['then'](function(){if(_0x5dd816){return _0x5dd816;}})[_0x828a('0x27')](respondWithResult(_0x542a2b,null))[_0x828a('0x99')](handleError(_0x542a2b,null));};exports[_0x828a('0xab')]=function(_0x4ec1f3,_0x5b1817){return db[_0x828a('0x2d')]['describe']()[_0x828a('0x27')](function(_0x1acf7e){if(_0x4ec1f3[_0x828a('0xa2')][_0x828a('0x9b')]&&_[_0x828a('0x6c')](_0x4ec1f3[_0x828a('0xa2')][_0x828a('0x9b')])){if(_0x4ec1f3[_0x828a('0xa2')][_0x828a('0x9b')]['length']){_0x4ec1f3['body']['tags']=_0x4ec1f3['body']['tags'][_0x828a('0xa5')](';')+';';}else{_0x4ec1f3[_0x828a('0xa2')][_0x828a('0x9b')]=null;}}else{_0x4ec1f3[_0x828a('0xa2')]['tags']=null;}return db[_0x828a('0x2d')][_0x828a('0xab')](_0x4ec1f3[_0x828a('0xa2')],{'fields':_[_0x828a('0x2f')](_0x1acf7e),'raw':!![]});})[_0x828a('0x27')](respondWithResult(_0x5b1817,0xc9))['catch'](handleError(_0x5b1817,null));};exports[_0x828a('0xc1')]=function(_0x42fa0d,_0x45ddba){var _0x57b936=[];var _0x371ea6=0x0;var _0x41cf37=0x0;var _0x37e328=0x0;return db['CmContact']['describe']()[_0x828a('0x27')](function(_0x8e3e72){return BPromise[_0x828a('0xc2')](_0x42fa0d[_0x828a('0xa2')],function(_0x2b2968){var _0x5ada15={'where':{'$or':[]},'defaults':_0x2b2968,'fields':_[_0x828a('0x2f')](_0x8e3e72),'raw':!![]};if(_0x2b2968['duplicates']){for(var _0x1ac322=0x0;_0x1ac322<_0x2b2968[_0x828a('0xc3')][_0x828a('0x30')];_0x1ac322++){var _0xcac74e={};_0xcac74e[_0x2b2968[_0x828a('0xc3')][_0x1ac322]]=_0x2b2968[_0x2b2968['duplicates'][_0x1ac322]];_0x5ada15[_0x828a('0x68')][_0x828a('0xc4')][_0x828a('0x65')](_0xcac74e);}_0x5ada15[_0x828a('0x68')][_0x828a('0x66')]=_0x2b2968[_0x828a('0x66')];}return db[_0x828a('0x2d')][_0x828a('0xc5')](_0x5ada15)[_0x828a('0xc6')](function(_0x14182c,_0x3a3705){if(_0x3a3705){_0x371ea6++;}else{_0x37e328++;}})[_0x828a('0x99')](function(_0x373c02){console['error'](_0x373c02);_0x41cf37++;});});})[_0x828a('0x27')](function(_0xb3b348){if(_0xb3b348){return{'success':_0x371ea6,'failure':_0x41cf37,'duplicates':_0x37e328};}})[_0x828a('0x27')](respondWithResult(_0x45ddba,0xc9))['catch'](handleError(_0x45ddba,null));};exports[_0x828a('0xc7')]=function(_0x1bfd36,_0x14e07d,_0x5002b0){var _0x23c9fe;return db['CmContact'][_0x828a('0x2e')]()[_0x828a('0x27')](function(_0x419098){return db[_0x828a('0x2d')][_0x828a('0x53')]({'where':{'id':_0x1bfd36[_0x828a('0xc8')]['id']},'include':[{'model':db[_0x828a('0xc9')],'as':_0x828a('0x97'),'attributes':['id',_0x828a('0x2a'),_0x828a('0x44')],'required':_0x1bfd36[_0x828a('0x38')][_0x828a('0x6b')]?!![]:![]}],'attributes':_[_0x828a('0x2f')](_0x419098)});})[_0x828a('0x27')](function(_0x26a7d8){_0x23c9fe=_0x26a7d8[_0x828a('0xa3')]({'plain':!![]});var _0x32687b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x26a7d8&&_0x26a7d8['ListId']){if(_0x26a7d8[_0x828a('0x66')]){_0x32687b[_0x828a('0x68')][_0x828a('0xca')][_0x828a('0x65')]({'ListId':{'$ne':_0x26a7d8[_0x828a('0x66')]}});}}return db[_0x828a('0x32')]['findAll'](_0x32687b);})[_0x828a('0x27')](function(_0x27cb69){return _[_0x828a('0xcb')](_0x23c9fe,_['map'](_0x27cb69,function(_0x4112d8){return util[_0x828a('0xcc')]('cf_%d',_0x4112d8['id']);}));})['then'](handleEntityNotFound(_0x14e07d,null))['then'](respondWithResult(_0x14e07d,null))[_0x828a('0x99')](handleError(_0x14e07d,null));};exports[_0x828a('0x26')]=function(_0x5ad529,_0x285d44){var _0x563d74;if(_0x5ad529[_0x828a('0xa2')]['id']){delete _0x5ad529[_0x828a('0xa2')]['id'];}return db['CmContact']['find']({'where':{'id':_0x5ad529[_0x828a('0xc8')]['id']}})[_0x828a('0x27')](handleEntityNotFound(_0x285d44,null))['then'](saveUpdates(_0x5ad529[_0x828a('0xa2')],null))[_0x828a('0x27')](function(_0x4e81f8){_0x563d74=_0x4e81f8;var _0x6fbbc1={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4e81f8&&_0x4e81f8[_0x828a('0x66')]){if(_0x4e81f8[_0x828a('0x66')]){_0x6fbbc1[_0x828a('0x68')][_0x828a('0xca')][_0x828a('0x65')]({'ListId':{'$ne':_0x4e81f8['ListId']}});}}return db['CmCustomField']['findAll'](_0x6fbbc1);})[_0x828a('0x27')](function(_0x10aa48){if(_0x10aa48){return _[_0x828a('0xcb')](_['pickBy'](_0x5ad529['body'],function(_0x45dac6,_0x59e559){return _[_0x828a('0xcd')](_0x59e559,_0x828a('0x31'));}),_[_0x828a('0x55')](_0x10aa48,function(_0x5580ef){return util['format'](_0x828a('0xce'),_0x5580ef['id']);}));}})[_0x828a('0x27')](function(_0x4bb034){if(_0x4bb034&&!_[_0x828a('0xcf')](_0x4bb034)){var _0x1432e9=squel[_0x828a('0x26')]()[_0x828a('0xd0')](_0x828a('0x47'))[_0x828a('0xd1')](_0x4bb034)[_0x828a('0x68')](_0x828a('0xd2'),_0x5ad529[_0x828a('0xc8')]['id'])[_0x828a('0xd3')]();return db[_0x828a('0x96')]['query'](_0x1432e9[_0x828a('0x60')],{'replacements':_0x1432e9[_0x828a('0xa1')]});}})[_0x828a('0x27')](function(){if(_0x5ad529[_0x828a('0xa2')]['phone']&&_0x563d74){return db[_0x828a('0xa8')][_0x828a('0x26')]({'phone':_0x5ad529[_0x828a('0xa2')][_0x828a('0xd4')]},{'where':{'ContactId':_0x563d74['id']}});}})['then'](function(){return _0x563d74;})[_0x828a('0x27')](respondWithResult(_0x285d44,null))[_0x828a('0x99')](handleError(_0x285d44,null));};exports[_0x828a('0xd5')]=function(_0x28daaa,_0x21fe8e,_0x519f5a){var _0x3c611e={};var _0x385ce9={};var _0x13bdff;var _0x1490db;return db[_0x828a('0x2d')][_0x828a('0x33')]({'where':{'id':_0x28daaa[_0x828a('0xc8')]['id']}})[_0x828a('0x27')](handleEntityNotFound(_0x21fe8e,null))[_0x828a('0x27')](function(_0x5f346e){if(_0x5f346e){_0x13bdff=_0x5f346e;_0x385ce9[_0x828a('0x3b')]=_[_0x828a('0x2f')](db[_0x828a('0xc9')][_0x828a('0xd6')]);_0x385ce9[_0x828a('0x38')]=_[_0x828a('0x2f')](_0x28daaa[_0x828a('0x38')]);_0x385ce9[_0x828a('0x39')]=_[_0x828a('0x3a')](_0x385ce9['model'],_0x385ce9[_0x828a('0x38')]);_0x3c611e['attributes']=_[_0x828a('0x3a')](_0x385ce9['model'],qs['fields'](_0x28daaa[_0x828a('0x38')][_0x828a('0x3d')]));_0x3c611e[_0x828a('0x3c')]=_0x3c611e[_0x828a('0x3c')]['length']?_0x3c611e[_0x828a('0x3c')]:_0x385ce9[_0x828a('0x3b')];_0x3c611e[_0x828a('0x7e')]=qs[_0x828a('0x40')](_0x28daaa[_0x828a('0x38')]['sort']);_0x3c611e['where']=qs[_0x828a('0x39')](_[_0x828a('0x41')](_0x28daaa[_0x828a('0x38')],_0x385ce9['filters']));if(_0x28daaa['query'][_0x828a('0x62')]){_0x3c611e['where']=_[_0x828a('0x8b')](_0x3c611e[_0x828a('0x68')],{'$or':_[_0x828a('0x55')](_0x3c611e[_0x828a('0x3c')],function(_0x437e73){var _0x86d5e2={};_0x86d5e2[_0x437e73]={'$like':'%'+_0x28daaa[_0x828a('0x38')][_0x828a('0x62')]+'%'};return _0x86d5e2;})});}_0x3c611e=_[_0x828a('0x8b')]({},_0x3c611e,_0x28daaa[_0x828a('0xd7')]);return _0x13bdff['getTags'](_0x3c611e);}})[_0x828a('0x27')](function(_0x296208){if(_0x296208){_0x1490db=_0x296208[_0x828a('0x30')];if(!_0x28daaa[_0x828a('0x38')][_0x828a('0x3e')](_0x828a('0x3f'))){_0x3c611e[_0x828a('0x22')]=qs[_0x828a('0x22')](_0x28daaa[_0x828a('0x38')]['limit']);_0x3c611e['offset']=qs[_0x828a('0x1f')](_0x28daaa[_0x828a('0x38')][_0x828a('0x1f')]);}return _0x13bdff[_0x828a('0xd5')](_0x3c611e);}})[_0x828a('0x27')](function(_0x4d6884){if(_0x4d6884){return _0x4d6884?{'count':_0x1490db,'rows':_0x4d6884}:null;}})['then'](respondWithResult(_0x21fe8e,null))['catch'](handleError(_0x21fe8e,null));};exports[_0x828a('0xd8')]=function(_0x1f36b1,_0x1b4269,_0x322d23){if(_0x1f36b1['body']['id']){delete _0x1f36b1[_0x828a('0xa2')]['id'];}return db['CmContact'][_0x828a('0x33')]({'where':{'id':_0x1f36b1['params']['id']}})['then'](handleEntityNotFound(_0x1b4269,null))[_0x828a('0x27')](function(_0xeff612){if(_0xeff612){return _0xeff612[_0x828a('0xd8')](_0x1f36b1['body'][_0x828a('0xd9')]||[]);}return null;})['then'](respondWithResult(_0x1b4269,null))[_0x828a('0x99')](handleError(_0x1b4269,null));};exports[_0x828a('0xda')]=function(_0x48b6ae,_0x192a31,_0x50f7c6){var _0x383d15={'raw':![],'where':{}};var _0x4db17f={};var _0x68be03={'count':0x0,'rows':[]};return db[_0x828a('0x2d')][_0x828a('0x33')]({'where':{'id':_0x48b6ae[_0x828a('0xc8')]['id']}})[_0x828a('0x27')](handleEntityNotFound(_0x192a31,null))[_0x828a('0x27')](function(_0x563efd){if(_0x563efd){_0x4db17f[_0x828a('0x3b')]=_[_0x828a('0x2f')](db['CmHopper'][_0x828a('0xd6')]);_0x4db17f[_0x828a('0x38')]=_[_0x828a('0x2f')](_0x48b6ae[_0x828a('0x38')]);_0x4db17f[_0x828a('0x39')]=_[_0x828a('0x3a')](_0x4db17f[_0x828a('0x3b')],_0x4db17f[_0x828a('0x38')]);_0x383d15[_0x828a('0x3c')]=_[_0x828a('0x3a')](_0x4db17f[_0x828a('0x3b')],qs[_0x828a('0x3d')](_0x48b6ae[_0x828a('0x38')][_0x828a('0x3d')]));_0x383d15[_0x828a('0x3c')]=_0x383d15[_0x828a('0x3c')][_0x828a('0x30')]?_0x383d15[_0x828a('0x3c')]:_0x4db17f[_0x828a('0x3b')];if(!_0x48b6ae['query'][_0x828a('0x3e')](_0x828a('0x3f'))){_0x383d15[_0x828a('0x22')]=qs[_0x828a('0x22')](_0x48b6ae[_0x828a('0x38')][_0x828a('0x22')]);_0x383d15['offset']=qs['offset'](_0x48b6ae[_0x828a('0x38')][_0x828a('0x1f')]);}_0x383d15[_0x828a('0x7e')]=qs[_0x828a('0x40')](_0x48b6ae['query'][_0x828a('0x40')]);_0x383d15[_0x828a('0x68')]=qs[_0x828a('0x39')](_[_0x828a('0x41')](_0x48b6ae[_0x828a('0x38')],_0x4db17f[_0x828a('0x39')]));_0x383d15['where'][_0x828a('0xdb')]=_0x563efd['id'];if(_0x48b6ae[_0x828a('0x38')][_0x828a('0x62')]){_0x383d15[_0x828a('0x68')]=_['merge'](_0x383d15['where'],{'$or':_[_0x828a('0x55')](_0x383d15['attributes'],function(_0x499cbb){var _0x8a53ea={};_0x8a53ea[_0x499cbb]={'$like':'%'+_0x48b6ae['query']['filter']+'%'};return _0x8a53ea;})});}_0x383d15=_[_0x828a('0x8b')]({},_0x383d15,_0x48b6ae[_0x828a('0xd7')]);return db[_0x828a('0xa8')]['count']({'where':_0x383d15[_0x828a('0x68')]})[_0x828a('0x27')](function(_0x165e67){_0x68be03['count']=_0x165e67;if(_0x48b6ae['query'][_0x828a('0xdc')]){_0x383d15['include']=[{'all':!![]}];}return db['CmHopper'][_0x828a('0x9d')](_0x383d15);})[_0x828a('0x27')](function(_0x281cee){_0x68be03[_0x828a('0x98')]=_0x281cee;return _0x68be03;});}})[_0x828a('0x27')](respondWithFilteredResult(_0x192a31,_0x383d15))[_0x828a('0x99')](handleError(_0x192a31,null));};exports[_0x828a('0xdd')]=function(_0x1c560e,_0x4f49bf,_0x4508a6){var _0x53b21e={'raw':!![],'where':{}};var _0x1ed127={};var _0x39fcba={'count':0x0,'rows':[]};return db[_0x828a('0x2d')][_0x828a('0x33')]({'where':{'id':_0x1c560e['params']['id']}})[_0x828a('0x27')](handleEntityNotFound(_0x4f49bf,null))[_0x828a('0x27')](function(_0x1c7677){if(_0x1c7677){_0x1ed127[_0x828a('0x3b')]=_[_0x828a('0x2f')](db[_0x828a('0xb6')][_0x828a('0xd6')]);_0x1ed127[_0x828a('0x38')]=_[_0x828a('0x2f')](_0x1c560e[_0x828a('0x38')]);_0x1ed127[_0x828a('0x39')]=_[_0x828a('0x3a')](_0x1ed127[_0x828a('0x3b')],_0x1ed127['query']);_0x53b21e[_0x828a('0x3c')]=_[_0x828a('0x3a')](_0x1ed127['model'],qs[_0x828a('0x3d')](_0x1c560e[_0x828a('0x38')]['fields']));_0x53b21e[_0x828a('0x3c')]=_0x53b21e[_0x828a('0x3c')][_0x828a('0x30')]?_0x53b21e['attributes']:_0x1ed127[_0x828a('0x3b')];if(!_0x1c560e[_0x828a('0x38')][_0x828a('0x3e')]('nolimit')){_0x53b21e[_0x828a('0x22')]=qs[_0x828a('0x22')](_0x1c560e[_0x828a('0x38')][_0x828a('0x22')]);_0x53b21e[_0x828a('0x1f')]=qs[_0x828a('0x1f')](_0x1c560e[_0x828a('0x38')][_0x828a('0x1f')]);}_0x53b21e[_0x828a('0x7e')]=qs[_0x828a('0x40')](_0x1c560e[_0x828a('0x38')][_0x828a('0x40')]);_0x53b21e['where']=qs['filters'](_[_0x828a('0x41')](_0x1c560e[_0x828a('0x38')],_0x1ed127[_0x828a('0x39')]));_0x53b21e[_0x828a('0x68')][_0x828a('0xdb')]=_0x1c7677['id'];if(_0x1c560e[_0x828a('0x38')][_0x828a('0x62')]){_0x53b21e['where']=_[_0x828a('0x8b')](_0x53b21e['where'],{'$or':_[_0x828a('0x55')](_0x53b21e[_0x828a('0x3c')],function(_0x4e9de8){var _0x416b65={};_0x416b65[_0x4e9de8]={'$like':'%'+_0x1c560e['query'][_0x828a('0x62')]+'%'};return _0x416b65;})});}_0x53b21e=_['merge']({},_0x53b21e,_0x1c560e['options']);return db[_0x828a('0xb6')]['count']({'where':_0x53b21e[_0x828a('0x68')]})[_0x828a('0x27')](function(_0x9db68d){_0x39fcba[_0x828a('0x21')]=_0x9db68d;if(_0x1c560e[_0x828a('0x38')][_0x828a('0xdc')]){_0x53b21e['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x828a('0x9d')](_0x53b21e);})[_0x828a('0x27')](function(_0x330dac){_0x39fcba['rows']=_0x330dac;return _0x39fcba;});}})['then'](respondWithFilteredResult(_0x4f49bf,_0x53b21e))['catch'](handleError(_0x4f49bf,null));};exports[_0x828a('0xde')]=function(_0xf24713,_0x5b6468,_0x37e542){var _0x3341fe={'raw':!![],'where':{}};var _0x5c0782={};var _0x160b7d={'count':0x0,'rows':[]};return db[_0x828a('0x2d')][_0x828a('0x33')]({'where':{'id':_0xf24713['params']['id']}})['then'](handleEntityNotFound(_0x5b6468,null))['then'](function(_0x2ec5be){if(_0x2ec5be){_0x5c0782[_0x828a('0x3b')]=_[_0x828a('0x2f')](db['CmHopperFinal'][_0x828a('0xd6')]);_0x5c0782[_0x828a('0x38')]=_['keys'](_0xf24713[_0x828a('0x38')]);_0x5c0782[_0x828a('0x39')]=_[_0x828a('0x3a')](_0x5c0782[_0x828a('0x3b')],_0x5c0782[_0x828a('0x38')]);_0x3341fe[_0x828a('0x3c')]=_['intersection'](_0x5c0782[_0x828a('0x3b')],qs[_0x828a('0x3d')](_0xf24713[_0x828a('0x38')][_0x828a('0x3d')]));_0x3341fe[_0x828a('0x3c')]=_0x3341fe[_0x828a('0x3c')][_0x828a('0x30')]?_0x3341fe['attributes']:_0x5c0782[_0x828a('0x3b')];if(!_0xf24713[_0x828a('0x38')]['hasOwnProperty'](_0x828a('0x3f'))){_0x3341fe['limit']=qs[_0x828a('0x22')](_0xf24713[_0x828a('0x38')][_0x828a('0x22')]);_0x3341fe[_0x828a('0x1f')]=qs['offset'](_0xf24713[_0x828a('0x38')]['offset']);}_0x3341fe[_0x828a('0x7e')]=qs[_0x828a('0x40')](_0xf24713[_0x828a('0x38')]['sort']);_0x3341fe[_0x828a('0x68')]=qs[_0x828a('0x39')](_['pick'](_0xf24713['query'],_0x5c0782[_0x828a('0x39')]));_0x3341fe[_0x828a('0x68')][_0x828a('0xdb')]=_0x2ec5be['id'];if(_0xf24713[_0x828a('0x38')][_0x828a('0x62')]){_0x3341fe[_0x828a('0x68')]=_[_0x828a('0x8b')](_0x3341fe['where'],{'$or':_['map'](_0x3341fe[_0x828a('0x3c')],function(_0x39b12a){var _0x5f3174={};_0x5f3174[_0x39b12a]={'$like':'%'+_0xf24713[_0x828a('0x38')][_0x828a('0x62')]+'%'};return _0x5f3174;})});}_0x3341fe=_['merge']({},_0x3341fe,_0xf24713[_0x828a('0xd7')]);return db[_0x828a('0xb5')][_0x828a('0x21')]({'where':_0x3341fe['where']})[_0x828a('0x27')](function(_0x763f33){_0x160b7d[_0x828a('0x21')]=_0x763f33;if(_0xf24713[_0x828a('0x38')][_0x828a('0xdc')]){_0x3341fe[_0x828a('0xdf')]=[{'all':!![]}];}return db[_0x828a('0xb5')]['findAll'](_0x3341fe);})[_0x828a('0x27')](function(_0x45e05e){_0x160b7d[_0x828a('0x98')]=_0x45e05e;return _0x160b7d;});}})[_0x828a('0x27')](respondWithFilteredResult(_0x5b6468,_0x3341fe))['catch'](handleError(_0x5b6468,null));};exports[_0x828a('0xe0')]=function(_0x19f96b,_0x56edfa,_0x453b6c){var _0x34e16b={'raw':!![],'where':{}};var _0x2ca5b0={};var _0xf4107b={'count':0x0,'rows':[]};return db[_0x828a('0x2d')][_0x828a('0x33')]({'where':{'id':_0x19f96b[_0x828a('0xc8')]['id']}})[_0x828a('0x27')](handleEntityNotFound(_0x56edfa,null))['then'](function(_0x1107a1){if(_0x1107a1){_0x2ca5b0[_0x828a('0x3b')]=_[_0x828a('0x2f')](db[_0x828a('0xbe')]['rawAttributes']);_0x2ca5b0[_0x828a('0x38')]=_[_0x828a('0x2f')](_0x19f96b[_0x828a('0x38')]);_0x2ca5b0['filters']=_['intersection'](_0x2ca5b0[_0x828a('0x3b')],_0x2ca5b0[_0x828a('0x38')]);_0x34e16b[_0x828a('0x3c')]=_[_0x828a('0x3a')](_0x2ca5b0['model'],qs[_0x828a('0x3d')](_0x19f96b['query'][_0x828a('0x3d')]));_0x34e16b[_0x828a('0x3c')]=_0x34e16b[_0x828a('0x3c')][_0x828a('0x30')]?_0x34e16b[_0x828a('0x3c')]:_0x2ca5b0[_0x828a('0x3b')];if(!_0x19f96b[_0x828a('0x38')][_0x828a('0x3e')]('nolimit')){_0x34e16b['limit']=qs[_0x828a('0x22')](_0x19f96b[_0x828a('0x38')][_0x828a('0x22')]);_0x34e16b[_0x828a('0x1f')]=qs[_0x828a('0x1f')](_0x19f96b['query'][_0x828a('0x1f')]);}_0x34e16b[_0x828a('0x7e')]=qs[_0x828a('0x40')](_0x19f96b['query']['sort']);_0x34e16b['where']=qs[_0x828a('0x39')](_[_0x828a('0x41')](_0x19f96b[_0x828a('0x38')],_0x2ca5b0['filters']));_0x34e16b[_0x828a('0x68')][_0x828a('0xdb')]=_0x1107a1['id'];if(_0x19f96b[_0x828a('0x38')]['filter']){_0x34e16b[_0x828a('0x68')]=_[_0x828a('0x8b')](_0x34e16b['where'],{'$or':_[_0x828a('0x55')](_0x34e16b[_0x828a('0x3c')],function(_0x195433){var _0x351b8c={};_0x351b8c[_0x195433]={'$like':'%'+_0x19f96b[_0x828a('0x38')][_0x828a('0x62')]+'%'};return _0x351b8c;})});}_0x34e16b=_[_0x828a('0x8b')]({},_0x34e16b,_0x19f96b['options']);return db['JscriptySessionReport'][_0x828a('0x21')]({'where':_0x34e16b[_0x828a('0x68')]})[_0x828a('0x27')](function(_0x4688e3){_0xf4107b[_0x828a('0x21')]=_0x4688e3;if(_0x19f96b[_0x828a('0x38')][_0x828a('0xdc')]){_0x34e16b[_0x828a('0xdf')]=[{'all':!![]}];}return db[_0x828a('0xbe')][_0x828a('0x9d')](_0x34e16b);})[_0x828a('0x27')](function(_0x514103){_0xf4107b[_0x828a('0x98')]=_0x514103;return _0xf4107b;});}})['then'](respondWithFilteredResult(_0x56edfa,_0x34e16b))[_0x828a('0x99')](handleError(_0x56edfa,null));};exports[_0x828a('0xe1')]=function(_0x4a95ba,_0x176c2f,_0x1f32d1){try{if(!_0x4a95ba[_0x828a('0xa2')][_0x828a('0x66')]){throw new Error(_0x828a('0xe2'));}if(!_0x4a95ba[_0x828a('0xa2')]['binding_keys']){throw new Error(_0x828a('0xe3'));}if(!_0x4a95ba[_0x828a('0xa2')]['binding_values']){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x4a95ba['body']['socket_timestamp']){throw new Error(_0x828a('0xe4'));}var _0x27825c=_0x4a95ba['body'][_0x828a('0xe5')][_0x828a('0x54')](',');var _0xdd3387=_0x4a95ba[_0x828a('0xa2')][_0x828a('0xe6')][_0x828a('0x54')](',');if(!_0x27825c[_0x828a('0x30')]||!_0xdd3387[_0x828a('0x30')]||_0x27825c[_0x828a('0x30')]!==_0xdd3387['length']){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x4a95ba[_0x828a('0xa2')][_0x828a('0x3d')]=_[_0x828a('0xe7')](_0x27825c,_0xdd3387);if(!_0x4a95ba[_0x828a('0xa2')][_0x828a('0x3d')][_0x828a('0xd4')]){throw new Error(_0x828a('0xe8'));}if(!_0x4a95ba[_0x828a('0xa2')][_0x828a('0x3d')]['firstName']){throw new Error(_0x828a('0xe9'));}var _0x5d87b8=path['join'](config['root'],_0x828a('0xea'),_0x4a95ba['file'][_0x828a('0xeb')]);fs[_0x828a('0xec')](_0x5d87b8,parseInt(_0x828a('0xed'),0x8));var _0x154a45=require(_0x828a('0xee'))['fork'](path[_0x828a('0xa5')](__dirname,'../../components/import/cm/csv'),[_0x5d87b8,_0x4a95ba[_0x828a('0xa2')]['binding_keys'],_0x4a95ba[_0x828a('0xa2')]['binding_values'],_0x4a95ba[_0x828a('0xa2')]['ListId'],_0x4a95ba[_0x828a('0xa2')][_0x828a('0xef')],_0x4a95ba[_0x828a('0xa2')]['duplicates'],_0x4a95ba[_0x828a('0xa2')][_0x828a('0xf0')]]);return _0x176c2f['status'](0xc8)[_0x828a('0x1e')]({'message':'File\x20uploaded\x20correctly!','pid':_0x154a45[_0x828a('0xf1')]});}catch(_0x189cf3){return _0x176c2f['status'](0x1f4)[_0x828a('0x2b')](_0x189cf3);}};exports[_0x828a('0xf2')]=function(_0x51a41f,_0x5cfe24,_0x34ad89){var _0x2d2569=fs[_0x828a('0xf3')](_0x51a41f[_0x828a('0xf4')]['path']);Papa[_0x828a('0xf5')](_0x2d2569,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x200c50){return _0x5cfe24[_0x828a('0x1d')](0xc8)[_0x828a('0x1e')]({'file':_0x51a41f[_0x828a('0xf4')],'fields':_0x200c50[_0x828a('0xf6')][_0x828a('0x3d')]});}});};exports['import']=function(_0x2b1be1,_0x5ce172,_0x354a0c){return db[_0x828a('0x59')][_0x828a('0x9d')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x828a('0x27')](function(_0x2a2050){var _0x2bbea9=![];if(!_0x2b1be1[_0x828a('0xa2')]['ListId']){throw new Error(_0x828a('0xe2'));}if(!_0x2b1be1[_0x828a('0xa2')][_0x828a('0xf7')][_0x828a('0xd4')]){throw new Error(_0x828a('0xe8'));}if(!_0x2b1be1['body'][_0x828a('0xf7')][_0x828a('0xf8')]){throw new Error(_0x828a('0xe9'));}if(!_0x2b1be1[_0x828a('0xa2')]['socket_timestamp']){throw new Error(_0x828a('0xe4'));}var _0x137937=require('child_process')[_0x828a('0xf9')](path[_0x828a('0xa5')](__dirname,_0x828a('0xfa')),[_0x2b1be1['params']['id'],JSON[_0x828a('0xfb')](_0x2b1be1[_0x828a('0xa2')]),JSON[_0x828a('0xfb')](_0x2a2050)]);_0x137937['on'](_0x828a('0xfc'),function(_0x1886da){_0x2bbea9=!![];return _0x5ce172[_0x828a('0x1d')](0xc8)[_0x828a('0x1e')]({'message':_0x828a('0xfd'),'pid':_0x137937[_0x828a('0xf1')]});});_0x137937['on'](_0x828a('0xfe'),function(_0x57fd94){if(_0x57fd94&&!_0x2bbea9){return _0x5ce172[_0x828a('0x1d')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x137937[_0x828a('0xf1')]});}});})['catch'](handleError(_0x5ce172,null));};exports['getJourney']=function(_0x16ca8c,_0x580eae){var _0x4224eb=['mail','chat',_0x828a('0xff'),_0x828a('0x100'),_0x828a('0x101'),_0x828a('0x102'),'voice'];var _0x2c1dec={'offset':0x0,'order':qs[_0x828a('0x40')](_0x828a('0x103'))},_0x5c21e0={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(_0x16ca8c[_0x828a('0x38')][_0x828a('0x104')]){if(!_[_0x828a('0x105')](_0x4224eb,_0x16ca8c[_0x828a('0x38')][_0x828a('0x104')][_0x828a('0x106')]())){throw new Error('Invalid\x20channel');}_0x4224eb=[_0x16ca8c[_0x828a('0x38')][_0x828a('0x104')][_0x828a('0x106')]()];}if(_0x16ca8c[_0x828a('0x38')][_0x828a('0x107')]){try{var _0x46deb7=JSON[_0x828a('0xf5')](_0x16ca8c[_0x828a('0x38')][_0x828a('0x107')]);if(!moment(_0x46deb7[_0x828a('0x45')])[_0x828a('0x108')]()){throw new Error(_0x828a('0x109'));}if(!moment(_0x46deb7['to'])[_0x828a('0x108')]()){throw new Error(_0x828a('0x10a'));}}catch(_0x450e45){throw new Error(_0x828a('0x10b'));}}if(!_0x16ca8c['query'][_0x828a('0x3e')](_0x828a('0x3f'))){_0x2c1dec[_0x828a('0x22')]=qs['limit'](_0x16ca8c['query'][_0x828a('0x22')]||0xa);_0x2c1dec[_0x828a('0x1f')]=qs['offset'](_0x16ca8c[_0x828a('0x38')]['offset']);}var _0x23aaa6=_0x4224eb['map'](function(_0x54a608){if(_0x54a608===_0x828a('0x10c')){var _0x371ae0={'attributes':['id',_0x828a('0x10d'),_0x828a('0x37'),_0x828a('0x10e'),_0x828a('0x10f'),_0x828a('0x110'),_0x828a('0x111'),'endtime',_0x828a('0x112'),'note',_0x828a('0x113'),'userDisposition',_0x828a('0x114'),'userThirdDisposition','UserId'],'where':{'ContactId':_0x16ca8c[_0x828a('0xc8')]['id']},'include':[{'model':db['User'],'as':_0x828a('0x59'),'attributes':['id','name','fullname',_0x828a('0x9f')]}],'order':[['createdAt','DESC']]};if(_0x16ca8c['query']['range']){_0x371ae0[_0x828a('0x68')]['createdAt']={'$gte':_0x46deb7[_0x828a('0x45')],'$lte':_0x46deb7['to']};}return db[_0x828a('0xb8')]['findAndCountAll'](_0x371ae0)['then'](function(_0x436ead){_0x5c21e0[_0x828a('0x21')]+=_0x436ead[_0x828a('0x21')];return _[_0x828a('0x55')](_0x436ead[_0x828a('0x98')],function(_0x15f113){var _0x5b30f0=_0x15f113['get']({'plain':!![]});_0x5b30f0['channel']=_0x54a608;if(_0x5b30f0[_0x828a('0x59')]){_0x5b30f0[_0x828a('0x59')]={'id':_0x5b30f0['User']['id'],'name':_0x5b30f0[_0x828a('0x59')]['name'],'fullname':_0x5b30f0['User'][_0x828a('0x115')],'alias':_0x5b30f0[_0x828a('0x59')][_0x828a('0x9f')]};}return _0x5b30f0;});});}else{var _0x15102c=_[_0x828a('0x116')](_0x54a608)+(_0x54a608===_0x828a('0x117')?_0x828a('0x118'):_0x828a('0x119'));var _0x5780df={'attributes':['id',_0x828a('0x11a'),_0x828a('0x11b'),_0x828a('0x113'),_0x828a('0x11c'),_0x828a('0x11d'),'secondDisposition',_0x828a('0x11e'),_0x828a('0x11f'),_0x15102c+'Id'],'where':{'ContactId':_0x16ca8c['params']['id']},'include':[{'model':db[_0x15102c],'as':_0x828a('0x119'),'attributes':['id',_0x828a('0x2a'),'key']},{'model':db[_0x828a('0x59')],'as':_0x828a('0x120'),'attributes':['id',_0x828a('0x2a'),_0x828a('0x115')]},{'model':db[_0x828a('0xc9')],'as':_0x828a('0x97'),'attributes':['id',_0x828a('0x2a'),'color'],'through':{'attributes':[]}}],'order':[[_0x828a('0x113'),'DESC']]};if(_0x16ca8c[_0x828a('0x38')][_0x828a('0x107')]){_0x5780df['where'][_0x828a('0x113')]={'$gte':_0x46deb7[_0x828a('0x45')],'$lte':_0x46deb7['to']};}switch(_0x54a608){case _0x828a('0x117'):_0x5780df[_0x828a('0x3c')][_0x828a('0x65')](_0x828a('0x121'),_0x828a('0x122'),_0x828a('0x123'),'deviceModel',_0x828a('0x124'),_0x828a('0x125'),_0x828a('0x126'),_0x828a('0x127'),_0x828a('0x128'));break;case'mail':_0x5780df[_0x828a('0x3c')][_0x828a('0x65')](_0x828a('0x129'),_0x828a('0x12a'));break;case'openchannel':_0x5780df[_0x828a('0x3c')][_0x828a('0x65')](_0x828a('0x12b'),'threadId');break;}return db[_[_0x828a('0x116')](_0x54a608)+_0x828a('0x12c')][_0x828a('0x12d')](_0x5780df)[_0x828a('0x27')](function(_0x24cc9e){_0x5c21e0[_0x828a('0x21')]+=_0x24cc9e['count'];return _[_0x828a('0x55')](_0x24cc9e[_0x828a('0x98')],function(_0xa9a0f2){var _0x2bcfe7=_0xa9a0f2[_0x828a('0xa3')]({'plain':!![]});_0x2bcfe7['channel']=_0x54a608;if(_0x2bcfe7[_0x828a('0x120')]){_0x2bcfe7[_0x828a('0x120')]={'id':_0x2bcfe7[_0x828a('0x120')]['id'],'name':_0x2bcfe7[_0x828a('0x120')][_0x828a('0x2a')],'fullname':_0x2bcfe7[_0x828a('0x120')][_0x828a('0x115')]};}return _0x2bcfe7;});});}});return Promise['all'](_0x23aaa6);})[_0x828a('0x27')](function(_0x2889ab){return _(_0x2889ab)[_0x828a('0x12e')]()[_0x828a('0x12f')]('createdAt')[_0x828a('0x130')]()['value']();})[_0x828a('0x27')](function(_0x523e15){_0x5c21e0[_0x828a('0x98')]=_0x2c1dec[_0x828a('0x22')]?_0x523e15[_0x828a('0x131')](_0x2c1dec[_0x828a('0x1f')],_0x2c1dec['offset']+_0x2c1dec[_0x828a('0x22')]):_0x523e15;return _0x5c21e0;})[_0x828a('0x27')](respondWithFilteredResult(_0x580eae,_0x2c1dec))['catch'](handleError(_0x580eae,null));};
\ No newline at end of file
index f3b5cb7..fde0223 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42fe=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','CmContact','setMaxListeners'];(function(_0x4c06cb,_0x33b67c){var _0x451620=function(_0x49a956){while(--_0x49a956){_0x4c06cb['push'](_0x4c06cb['shift']());}};_0x451620(++_0x33b67c);}(_0x42fe,0x15d));var _0xe42f=function(_0x481c41,_0x48ba3c){_0x481c41=_0x481c41-0x0;var _0xf91fd=_0x42fe[_0x481c41];return _0xf91fd;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xe42f('0x0'))['db'][_0xe42f('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xe42f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe42f('0x3'),'afterDestroy':_0xe42f('0x4')};function emitEvent(_0x2b5b72){return function(_0x1420bc,_0x3c877f,_0x533840){CmContactEvents[_0xe42f('0x5')](_0x2b5b72+':'+_0x1420bc['id'],_0x1420bc);CmContactEvents[_0xe42f('0x5')](_0x2b5b72,_0x1420bc);_0x533840(null);};}for(var e in events){if(events[_0xe42f('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xe42f('0x7')]=CmContactEvents;
\ No newline at end of file
+var _0xd7e0=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','setMaxListeners','save'];(function(_0x5e4a2d,_0x3d6b9d){var _0x2e9ed8=function(_0x40f369){while(--_0x40f369){_0x5e4a2d['push'](_0x5e4a2d['shift']());}};_0x2e9ed8(++_0x3d6b9d);}(_0xd7e0,0x87));var _0x0d7e=function(_0x58f641,_0x17987f){_0x58f641=_0x58f641-0x0;var _0x402896=_0xd7e0[_0x58f641];return _0x402896;};'use strict';var EventEmitter=require(_0x0d7e('0x0'));var CmContact=require(_0x0d7e('0x1'))['db'][_0x0d7e('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x0d7e('0x3')](0x0);var events={'afterCreate':_0x0d7e('0x4'),'afterUpdate':_0x0d7e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2dfd32){return function(_0x3ecf97,_0xce8e7f,_0x4d4a35){CmContactEvents[_0x0d7e('0x6')](_0x2dfd32+':'+_0x3ecf97['id'],_0x3ecf97);CmContactEvents[_0x0d7e('0x6')](_0x2dfd32,_0x3ecf97);_0x4d4a35(null);};}for(var e in events){if(events[_0x0d7e('0x7')](e)){var event=events[e];CmContact[_0x0d7e('0x8')](e,emitEvent(event));}}module[_0x0d7e('0x9')]=CmContactEvents;
\ No newline at end of file
index 8fa97dd..7dfeb71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa76=['fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','afterCreate','inspect','CmHopper','findOne','phone','cmContact,\x20afterCreate\x20','create','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','isNil','error','cmContact','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','length','cmContact,\x20%s,\x20%s','message','Campaign','CmList','onlyIfOpen','BlackLists','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','bluebird','path','rimraf','./cmContact.attributes','exports','define','CmContact','cm_contacts','fti_cm_contacts','lastName','mobile'];(function(_0x4a3630,_0xfdbcc3){var _0x41d084=function(_0x3a4de6){while(--_0x3a4de6){_0x4a3630['push'](_0x4a3630['shift']());}};_0x41d084(++_0xfdbcc3);}(_0xaa76,0xbb));var _0x6aa7=function(_0x278b14,_0x34d2c2){_0x278b14=_0x278b14-0x0;var _0xc9029=_0xaa76[_0x278b14];return _0xc9029;};'use strict';var _=require(_0x6aa7('0x0'));var util=require(_0x6aa7('0x1'));var logger=require(_0x6aa7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6aa7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6aa7('0x4'));var rimraf=require(_0x6aa7('0x5'));var config=require('../../config/environment');var attributes=require(_0x6aa7('0x6'));module[_0x6aa7('0x7')]=function(_0x1664bd,_0x9514de){return _0x1664bd[_0x6aa7('0x8')](_0x6aa7('0x9'),attributes,{'tableName':_0x6aa7('0xa'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0x6aa7('0xb'),'fields':['firstName',_0x6aa7('0xc'),'phone',_0x6aa7('0xd'),_0x6aa7('0xe'),_0x6aa7('0xf')],'type':_0x6aa7('0x10')}],'timestamps':!![],'charset':_0x6aa7('0x11'),'collate':_0x6aa7('0x12'),'hooks':{'afterCreate':function(_0x391333,_0x2cb2c5,_0x3dbccc){var _0x3fb0fc=_0x1664bd['models'];var _0x5a122d=_0x391333[_0x6aa7('0x13')]({'plain':!![]});function _0x5955a2(){return function(_0x45d2f8){logger['error']('cmContact',_0x6aa7('0x14'),util[_0x6aa7('0x15')](_0x45d2f8,{'showHidden':![],'depth':null}));};}var _0x7cf315=function(_0x232310){return new BPromise(function(_0x811189,_0x528bb2){_0x3fb0fc[_0x6aa7('0x16')][_0x6aa7('0x17')]({'where':{'phone':_0x5a122d[_0x6aa7('0x18')],'VoiceQueueId':_0x232310['id']}})['then'](function(_0x28735d){if(!_['isNil'](_0x28735d)){throw new Error(_0x6aa7('0x19')+_0x5a122d[_0x6aa7('0x18')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x232310['id']);}return _0x3fb0fc['CmHopper'][_0x6aa7('0x1a')]({'phone':_0x5a122d[_0x6aa7('0x18')],'ContactId':_0x5a122d['id'],'ListId':_0x5a122d[_0x6aa7('0x1b')],'priority':_0x5a122d[_0x6aa7('0x1c')]?_0x5a122d['priority']:0x2,'scheduledat':_0x5a122d[_0x6aa7('0x1d')]?_0x5a122d[_0x6aa7('0x1d')]:moment()[_0x6aa7('0x1e')](_0x6aa7('0x1f')),'callback':_0x5a122d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5a122d['callbackUniqueid']?_0x5a122d[_0x6aa7('0x20')]:undefined,'callbackat':_0x5a122d[_0x6aa7('0x20')]?moment()[_0x6aa7('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x232310['id']});})[_0x6aa7('0x21')](function(_0x2f4611){_0x528bb2(_0x2f4611);});});};var _0x4c7bf3=function(_0x19bccb){return new BPromise(function(_0x1868c2,_0x4d25a9){_0x3fb0fc[_0x6aa7('0x16')][_0x6aa7('0x17')]({'where':{'phone':_0x5a122d[_0x6aa7('0x18')],'VoiceQueueId':_0x19bccb['id']}})[_0x6aa7('0x22')](function(_0xef83b1){if(!_['isNil'](_0xef83b1)){throw new Error(_0x6aa7('0x19')+_0x5a122d[_0x6aa7('0x18')]+_0x6aa7('0x23')+_0x19bccb['id']);}return _0x3fb0fc['CmHopperFinal'][_0x6aa7('0x17')]({'where':{'calleridnum':_0x5a122d[_0x6aa7('0x18')],'VoiceQueueId':_0x19bccb['id']}});})[_0x6aa7('0x22')](function(_0x510743){if(!_[_0x6aa7('0x24')](_0x510743)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x5a122d[_0x6aa7('0x18')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x19bccb['id']);}return _0x3fb0fc[_0x6aa7('0x16')][_0x6aa7('0x1a')]({'phone':_0x5a122d[_0x6aa7('0x18')],'ContactId':_0x5a122d['id'],'ListId':_0x5a122d[_0x6aa7('0x1b')],'priority':_0x5a122d['priority']?_0x5a122d[_0x6aa7('0x1c')]:0x2,'scheduledat':_0x5a122d[_0x6aa7('0x1d')]?_0x5a122d[_0x6aa7('0x1d')]:moment()['format'](_0x6aa7('0x1f')),'callback':_0x5a122d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5a122d['callbackUniqueid']?_0x5a122d['callbackUniqueid']:undefined,'callbackat':_0x5a122d[_0x6aa7('0x20')]?moment()['format'](_0x6aa7('0x1f')):undefined,'VoiceQueueId':_0x19bccb['id']});})['catch'](function(_0x6a537d){_0x4d25a9(_0x6a537d);});});};function _0x230f95(){return function(_0x327614){logger[_0x6aa7('0x25')](_0x6aa7('0x26'),_0x6aa7('0x14'),util[_0x6aa7('0x15')](_0x327614,{'showHidden':![],'depth':null}));};}var _0x205f5f=function(_0xc449){return new BPromise(function(_0x343319,_0x22a68d){_0x3fb0fc[_0x6aa7('0x16')]['findOne']({'where':{'phone':_0x5a122d[_0x6aa7('0x18')],'CampaignId':_0xc449['id']}})[_0x6aa7('0x22')](function(_0x1f327f){if(!_['isNil'](_0x1f327f)){throw new Error(_0x6aa7('0x19')+_0x5a122d[_0x6aa7('0x18')]+_0x6aa7('0x27')+_0xc449['id']);}return _0x3fb0fc[_0x6aa7('0x16')][_0x6aa7('0x1a')]({'phone':_0x5a122d[_0x6aa7('0x18')],'ContactId':_0x5a122d['id'],'ListId':_0x5a122d[_0x6aa7('0x1b')],'priority':_0x5a122d[_0x6aa7('0x1c')]?_0x5a122d[_0x6aa7('0x1c')]:0x2,'scheduledat':_0x5a122d[_0x6aa7('0x1d')]?_0x5a122d[_0x6aa7('0x1d')]:moment()[_0x6aa7('0x1e')](_0x6aa7('0x1f')),'callback':_0x5a122d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5a122d[_0x6aa7('0x20')]?_0x5a122d[_0x6aa7('0x20')]:undefined,'callbackat':_0x5a122d[_0x6aa7('0x20')]?moment()[_0x6aa7('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0xc449['id']});})[_0x6aa7('0x21')](function(_0x1b56f7){_0x22a68d(_0x1b56f7);});});};var _0x41ec9a=function(_0x22ac3d){return new BPromise(function(_0x3548db,_0xb6d3a1){_0x3fb0fc[_0x6aa7('0x16')][_0x6aa7('0x17')]({'where':{'phone':_0x5a122d[_0x6aa7('0x18')],'CampaignId':_0x22ac3d['id']}})[_0x6aa7('0x22')](function(_0x15c2a9){if(!_[_0x6aa7('0x24')](_0x15c2a9)){throw new Error(_0x6aa7('0x19')+_0x5a122d[_0x6aa7('0x18')]+_0x6aa7('0x28')+_0x22ac3d['id']);}return _0x3fb0fc[_0x6aa7('0x29')][_0x6aa7('0x17')]({'where':{'calleridnum':_0x5a122d[_0x6aa7('0x18')],'CampaignId':_0x22ac3d['id']}});})['then'](function(_0x428d08){if(!_[_0x6aa7('0x24')](_0x428d08)){throw new Error(_0x6aa7('0x2a')+_0x5a122d[_0x6aa7('0x18')]+_0x6aa7('0x2b')+_0x22ac3d['id']);}return _0x3fb0fc[_0x6aa7('0x16')][_0x6aa7('0x1a')]({'phone':_0x5a122d[_0x6aa7('0x18')],'ContactId':_0x5a122d['id'],'ListId':_0x5a122d[_0x6aa7('0x1b')],'priority':_0x5a122d[_0x6aa7('0x1c')]?_0x5a122d[_0x6aa7('0x1c')]:0x2,'scheduledat':_0x5a122d[_0x6aa7('0x1d')]?_0x5a122d[_0x6aa7('0x1d')]:moment()[_0x6aa7('0x1e')](_0x6aa7('0x1f')),'callback':_0x5a122d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5a122d[_0x6aa7('0x20')]?_0x5a122d[_0x6aa7('0x20')]:undefined,'callbackat':_0x5a122d[_0x6aa7('0x20')]?moment()['format'](_0x6aa7('0x1f')):undefined,'CampaignId':_0x22ac3d['id']});})[_0x6aa7('0x21')](function(_0x4aac64){_0xb6d3a1(_0x4aac64);});});};if(_0x5a122d[_0x6aa7('0x1b')]){_0x3fb0fc[_0x6aa7('0x2c')][_0x6aa7('0x2d')]({'where':{'type':_0x6aa7('0x2e')},'attributes':['id',_0x6aa7('0x2f')],'include':[{'model':_0x3fb0fc['CmList'],'as':_0x6aa7('0x30'),'where':{'id':_0x5a122d[_0x6aa7('0x1b')]}}]})[_0x6aa7('0x22')](function(_0x170c2a){if(_0x170c2a){var _0xb3a76c=[];for(var _0x2ae71d=0x0,_0x5381f3;_0x2ae71d<_0x170c2a['length'];_0x2ae71d+=0x1){_0x5381f3=_0x170c2a[_0x2ae71d]['get']({'plain':!![]});switch(_0x5381f3['dialCheckDuplicateType']){case _0x6aa7('0x31'):_0x4c7bf3(_0x5381f3)['catch'](_0x5955a2());break;case'onlyIfOpen':_0x7cf315(_0x5381f3)[_0x6aa7('0x21')](_0x5955a2());break;default:_0x3fb0fc['CmHopper'][_0x6aa7('0x1a')]({'phone':_0x5a122d[_0x6aa7('0x18')],'ContactId':_0x5a122d['id'],'ListId':_0x5a122d[_0x6aa7('0x1b')],'scheduledat':_0x5a122d[_0x6aa7('0x1d')]?_0x5a122d['scheduledat']:moment()['format'](_0x6aa7('0x1f')),'priority':_0x5a122d['priority']?_0x5a122d[_0x6aa7('0x1c')]:0x2,'callback':_0x5a122d[_0x6aa7('0x20')]?!![]:![],'callbackuniqueid':_0x5a122d[_0x6aa7('0x20')]?_0x5a122d[_0x6aa7('0x20')]:undefined,'callbackat':_0x5a122d[_0x6aa7('0x20')]?moment()[_0x6aa7('0x1e')](_0x6aa7('0x1f')):undefined,'VoiceQueueId':_0x5381f3['id']})[_0x6aa7('0x21')](_0x5955a2());}}}})[_0x6aa7('0x22')](function(){return _0x3fb0fc['VoiceQueue'][_0x6aa7('0x2d')]({'where':{'type':_0x6aa7('0x2e')},'attributes':['id'],'include':[{'model':_0x3fb0fc['CmList'],'as':'BlackLists','where':{'id':_0x5a122d[_0x6aa7('0x1b')]}}]})[_0x6aa7('0x22')](function(_0x318c62){if(_0x318c62){var _0x160a6a=[];for(var _0x2d8c51=0x0,_0x533a30;_0x2d8c51<_0x318c62[_0x6aa7('0x32')];_0x2d8c51+=0x1){_0x533a30=_0x318c62[_0x2d8c51][_0x6aa7('0x13')]({'plain':!![]});_0x3fb0fc['CmHopperBlack'][_0x6aa7('0x1a')]({'phone':_0x5a122d[_0x6aa7('0x18')],'ContactId':_0x5a122d['id'],'ListId':_0x5a122d[_0x6aa7('0x1b')],'VoiceQueueId':_0x533a30['id']})[_0x6aa7('0x21')](function(_0x5e7248){logger[_0x6aa7('0x25')](_0x6aa7('0x33'),_0x6aa7('0x14'),_0x5e7248[_0x6aa7('0x34')]);});}}});})[_0x6aa7('0x22')](function(){return _0x3fb0fc[_0x6aa7('0x35')][_0x6aa7('0x2d')]({'attributes':['id',_0x6aa7('0x2f')],'include':[{'model':_0x3fb0fc[_0x6aa7('0x36')],'as':_0x6aa7('0x30'),'where':{'id':_0x5a122d[_0x6aa7('0x1b')]}}]})[_0x6aa7('0x22')](function(_0x45a202){if(_0x45a202){var _0x5a4035=[];for(var _0x12d204=0x0,_0x20b608;_0x12d204<_0x45a202['length'];_0x12d204+=0x1){_0x20b608=_0x45a202[_0x12d204]['get']({'plain':!![]});switch(_0x20b608[_0x6aa7('0x2f')]){case _0x6aa7('0x31'):_0x41ec9a(_0x20b608)[_0x6aa7('0x21')](_0x230f95());break;case _0x6aa7('0x37'):_0x205f5f(_0x20b608)[_0x6aa7('0x21')](_0x230f95());break;default:_0x3fb0fc['CmHopper'][_0x6aa7('0x1a')]({'phone':_0x5a122d['phone'],'ContactId':_0x5a122d['id'],'ListId':_0x5a122d[_0x6aa7('0x1b')],'scheduledat':_0x5a122d[_0x6aa7('0x1d')]?_0x5a122d[_0x6aa7('0x1d')]:moment()[_0x6aa7('0x1e')](_0x6aa7('0x1f')),'priority':_0x5a122d[_0x6aa7('0x1c')]?_0x5a122d[_0x6aa7('0x1c')]:0x2,'callback':_0x5a122d[_0x6aa7('0x20')]?!![]:![],'callbackuniqueid':_0x5a122d[_0x6aa7('0x20')]?_0x5a122d[_0x6aa7('0x20')]:undefined,'callbackat':_0x5a122d[_0x6aa7('0x20')]?moment()[_0x6aa7('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x20b608['id']})[_0x6aa7('0x21')](_0x230f95());}}}});})[_0x6aa7('0x22')](function(){return _0x3fb0fc[_0x6aa7('0x35')]['findAll']({'attributes':['id'],'include':[{'model':_0x3fb0fc[_0x6aa7('0x36')],'as':_0x6aa7('0x38'),'where':{'id':_0x5a122d['ListId']}}]})[_0x6aa7('0x22')](function(_0x23fb96){if(_0x23fb96){var _0x5d39bc=[];for(var _0x3bf03a=0x0,_0x502332;_0x3bf03a<_0x23fb96[_0x6aa7('0x32')];_0x3bf03a+=0x1){_0x502332=_0x23fb96[_0x3bf03a]['get']({'plain':!![]});_0x3fb0fc[_0x6aa7('0x39')]['create']({'phone':_0x5a122d[_0x6aa7('0x18')],'ContactId':_0x5a122d['id'],'ListId':_0x5a122d[_0x6aa7('0x1b')],'CampaignId':_0x502332['id']})[_0x6aa7('0x21')](function(_0x37dbbe){logger[_0x6aa7('0x25')](_0x6aa7('0x33'),'afterCreate',_0x37dbbe['message']);});}}});})[_0x6aa7('0x22')](function(){_0x3dbccc();})[_0x6aa7('0x21')](function(_0x52b357){logger[_0x6aa7('0x25')](_0x6aa7('0x33'),_0x6aa7('0x14'),_0x52b357[_0x6aa7('0x34')]);_0x3dbccc(_0x52b357);});}else{_0x3dbccc(new Error(_0x6aa7('0x3a')));}},'afterDestroy':function(_0x332448,_0x23480b,_0x2ba89e){var _0x389da9=_0x1664bd['models'];var _0x36341f=_0x332448[_0x6aa7('0x13')]({'plain':!![]});return _0x389da9[_0x6aa7('0x16')]['findAll']({'raw':!![],'where':{'ListId':_0x36341f['ListId'],'ContactId':_0x36341f['id']}})['then'](function(_0x27374c){if(!_[_0x6aa7('0x3b')](_0x27374c)){var _0x275d82=[];for(var _0x4bcafc=0x0;_0x4bcafc<_0x27374c[_0x6aa7('0x32')];_0x4bcafc+=0x1){var _0x162242=_0x389da9[_0x6aa7('0x16')][_0x6aa7('0x3c')]({'where':{'ListId':_0x27374c[_0x4bcafc]['ListId'],'ContactId':_0x27374c[_0x4bcafc][_0x6aa7('0x3d')],'VoiceQueueId':_0x27374c[_0x4bcafc][_0x6aa7('0x3e')],'CampaignId':_0x27374c[_0x4bcafc][_0x6aa7('0x3f')]}});_0x275d82[_0x6aa7('0x40')](_0x162242);}return BPromise['all'](_0x275d82);}})['then'](function(_0x25d034){logger[_0x6aa7('0x41')](_0x6aa7('0x42'),util[_0x6aa7('0x15')](_0x25d034,{'showHidden':![],'depth':null}));_0x2ba89e();})[_0x6aa7('0x21')](function(_0x3c2d05){logger['error']('[CmContact][afterDestroy][Error]',util[_0x6aa7('0x15')](_0x3c2d05,{'showHidden':![],'depth':null}));_0x2ba89e(_0x3c2d05);});}}});};
\ No newline at end of file
+var _0x4fad=['rimraf','../../config/environment','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','inspect','CmHopper','findOne','then','isNil','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','scheduledat','format','callbackUniqueid','YYYY-MM-DD\x20HH:mm:ss','catch','cmContact,\x20afterCreate\x20','\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','afterCreate','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','create','VoiceQueue','findAll','outbound','CmList','Lists','length','dialCheckDuplicateType','always','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','List\x20not\x20found','models','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x112fe3,_0x16b642){var _0x1ec903=function(_0x1539eb){while(--_0x1539eb){_0x112fe3['push'](_0x112fe3['shift']());}};_0x1ec903(++_0x16b642);}(_0x4fad,0xcb));var _0xd4fa=function(_0x4f24a3,_0x19b66d){_0x4f24a3=_0x4f24a3-0x0;var _0x41599c=_0x4fad[_0x4f24a3];return _0x41599c;};'use strict';var _=require(_0xd4fa('0x0'));var util=require(_0xd4fa('0x1'));var logger=require(_0xd4fa('0x2'))('api');var moment=require(_0xd4fa('0x3'));var BPromise=require(_0xd4fa('0x4'));var rp=require(_0xd4fa('0x5'));var fs=require('fs');var path=require(_0xd4fa('0x6'));var rimraf=require(_0xd4fa('0x7'));var config=require(_0xd4fa('0x8'));var attributes=require(_0xd4fa('0x9'));module[_0xd4fa('0xa')]=function(_0x597fbe,_0x2d4e07){return _0x597fbe['define'](_0xd4fa('0xb'),attributes,{'tableName':_0xd4fa('0xc'),'paranoid':!![],'indexes':[{'name':_0xd4fa('0xd'),'fields':[_0xd4fa('0xd')]},{'name':_0xd4fa('0xe'),'fields':['firstName',_0xd4fa('0xf'),_0xd4fa('0xd'),_0xd4fa('0x10'),'fax',_0xd4fa('0x11')],'type':_0xd4fa('0x12')}],'timestamps':!![],'charset':_0xd4fa('0x13'),'collate':_0xd4fa('0x14'),'hooks':{'afterCreate':function(_0x5e6a10,_0x109893,_0x376ef0){var _0x279c32=_0x597fbe['models'];var _0x2b04b3=_0x5e6a10[_0xd4fa('0x15')]({'plain':!![]});function _0x31c3ba(){return function(_0xadc145){logger[_0xd4fa('0x16')](_0xd4fa('0x17'),'afterCreate',util[_0xd4fa('0x18')](_0xadc145,{'showHidden':![],'depth':null}));};}var _0x187a02=function(_0x1a4bc4){return new BPromise(function(_0x2e267a,_0x42af5a){_0x279c32[_0xd4fa('0x19')][_0xd4fa('0x1a')]({'where':{'phone':_0x2b04b3['phone'],'VoiceQueueId':_0x1a4bc4['id']}})[_0xd4fa('0x1b')](function(_0x3a3b8c){if(!_[_0xd4fa('0x1c')](_0x3a3b8c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2b04b3['phone']+_0xd4fa('0x1d')+_0x1a4bc4['id']);}return _0x279c32['CmHopper']['create']({'phone':_0x2b04b3[_0xd4fa('0xd')],'ContactId':_0x2b04b3['id'],'ListId':_0x2b04b3[_0xd4fa('0x1e')],'priority':_0x2b04b3[_0xd4fa('0x1f')]?_0x2b04b3[_0xd4fa('0x1f')]:0x2,'scheduledat':_0x2b04b3['scheduledat']?_0x2b04b3[_0xd4fa('0x20')]:moment()[_0xd4fa('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2b04b3[_0xd4fa('0x22')]?!![]:![],'callbackuniqueid':_0x2b04b3['callbackUniqueid']?_0x2b04b3['callbackUniqueid']:undefined,'callbackat':_0x2b04b3[_0xd4fa('0x22')]?moment()[_0xd4fa('0x21')](_0xd4fa('0x23')):undefined,'VoiceQueueId':_0x1a4bc4['id']});})[_0xd4fa('0x24')](function(_0x586af0){_0x42af5a(_0x586af0);});});};var _0x13d59a=function(_0x248a77){return new BPromise(function(_0x4201eb,_0x141a2b){_0x279c32[_0xd4fa('0x19')]['findOne']({'where':{'phone':_0x2b04b3[_0xd4fa('0xd')],'VoiceQueueId':_0x248a77['id']}})[_0xd4fa('0x1b')](function(_0x4c5836){if(!_[_0xd4fa('0x1c')](_0x4c5836)){throw new Error(_0xd4fa('0x25')+_0x2b04b3[_0xd4fa('0xd')]+_0xd4fa('0x26')+_0x248a77['id']);}return _0x279c32[_0xd4fa('0x27')][_0xd4fa('0x1a')]({'where':{'calleridnum':_0x2b04b3[_0xd4fa('0xd')],'VoiceQueueId':_0x248a77['id']}});})[_0xd4fa('0x1b')](function(_0x4ee0b5){if(!_['isNil'](_0x4ee0b5)){throw new Error(_0xd4fa('0x28')+_0x2b04b3['phone']+_0xd4fa('0x29')+_0x248a77['id']);}return _0x279c32[_0xd4fa('0x19')]['create']({'phone':_0x2b04b3[_0xd4fa('0xd')],'ContactId':_0x2b04b3['id'],'ListId':_0x2b04b3[_0xd4fa('0x1e')],'priority':_0x2b04b3[_0xd4fa('0x1f')]?_0x2b04b3['priority']:0x2,'scheduledat':_0x2b04b3[_0xd4fa('0x20')]?_0x2b04b3[_0xd4fa('0x20')]:moment()['format'](_0xd4fa('0x23')),'callback':_0x2b04b3[_0xd4fa('0x22')]?!![]:![],'callbackuniqueid':_0x2b04b3['callbackUniqueid']?_0x2b04b3[_0xd4fa('0x22')]:undefined,'callbackat':_0x2b04b3[_0xd4fa('0x22')]?moment()[_0xd4fa('0x21')](_0xd4fa('0x23')):undefined,'VoiceQueueId':_0x248a77['id']});})[_0xd4fa('0x24')](function(_0x32bfb5){_0x141a2b(_0x32bfb5);});});};function _0x1ce1e3(){return function(_0x116c12){logger['error'](_0xd4fa('0x17'),_0xd4fa('0x2a'),util[_0xd4fa('0x18')](_0x116c12,{'showHidden':![],'depth':null}));};}var _0x3c982c=function(_0x5a5782){return new BPromise(function(_0x42f0e1,_0x26d4ae){_0x279c32[_0xd4fa('0x19')][_0xd4fa('0x1a')]({'where':{'phone':_0x2b04b3['phone'],'CampaignId':_0x5a5782['id']}})['then'](function(_0x59f899){if(!_['isNil'](_0x59f899)){throw new Error(_0xd4fa('0x25')+_0x2b04b3[_0xd4fa('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x5a5782['id']);}return _0x279c32['CmHopper']['create']({'phone':_0x2b04b3['phone'],'ContactId':_0x2b04b3['id'],'ListId':_0x2b04b3[_0xd4fa('0x1e')],'priority':_0x2b04b3[_0xd4fa('0x1f')]?_0x2b04b3['priority']:0x2,'scheduledat':_0x2b04b3[_0xd4fa('0x20')]?_0x2b04b3[_0xd4fa('0x20')]:moment()['format'](_0xd4fa('0x23')),'callback':_0x2b04b3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2b04b3[_0xd4fa('0x22')]?_0x2b04b3['callbackUniqueid']:undefined,'callbackat':_0x2b04b3[_0xd4fa('0x22')]?moment()[_0xd4fa('0x21')](_0xd4fa('0x23')):undefined,'CampaignId':_0x5a5782['id']});})[_0xd4fa('0x24')](function(_0x2bd9f0){_0x26d4ae(_0x2bd9f0);});});};var _0x54612c=function(_0x3f2fd4){return new BPromise(function(_0x43c5da,_0x3e0f5b){_0x279c32[_0xd4fa('0x19')][_0xd4fa('0x1a')]({'where':{'phone':_0x2b04b3[_0xd4fa('0xd')],'CampaignId':_0x3f2fd4['id']}})['then'](function(_0x30e083){if(!_[_0xd4fa('0x1c')](_0x30e083)){throw new Error(_0xd4fa('0x25')+_0x2b04b3[_0xd4fa('0xd')]+_0xd4fa('0x2b')+_0x3f2fd4['id']);}return _0x279c32['CmHopperFinal'][_0xd4fa('0x1a')]({'where':{'calleridnum':_0x2b04b3['phone'],'CampaignId':_0x3f2fd4['id']}});})[_0xd4fa('0x1b')](function(_0x32edea){if(!_['isNil'](_0x32edea)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x2b04b3['phone']+_0xd4fa('0x2c')+_0x3f2fd4['id']);}return _0x279c32[_0xd4fa('0x19')][_0xd4fa('0x2d')]({'phone':_0x2b04b3['phone'],'ContactId':_0x2b04b3['id'],'ListId':_0x2b04b3[_0xd4fa('0x1e')],'priority':_0x2b04b3[_0xd4fa('0x1f')]?_0x2b04b3[_0xd4fa('0x1f')]:0x2,'scheduledat':_0x2b04b3[_0xd4fa('0x20')]?_0x2b04b3['scheduledat']:moment()['format'](_0xd4fa('0x23')),'callback':_0x2b04b3[_0xd4fa('0x22')]?!![]:![],'callbackuniqueid':_0x2b04b3[_0xd4fa('0x22')]?_0x2b04b3[_0xd4fa('0x22')]:undefined,'callbackat':_0x2b04b3[_0xd4fa('0x22')]?moment()['format'](_0xd4fa('0x23')):undefined,'CampaignId':_0x3f2fd4['id']});})[_0xd4fa('0x24')](function(_0x1f1985){_0x3e0f5b(_0x1f1985);});});};if(_0x2b04b3[_0xd4fa('0x1e')]){_0x279c32[_0xd4fa('0x2e')][_0xd4fa('0x2f')]({'where':{'type':_0xd4fa('0x30')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0x279c32[_0xd4fa('0x31')],'as':_0xd4fa('0x32'),'where':{'id':_0x2b04b3[_0xd4fa('0x1e')]}}]})[_0xd4fa('0x1b')](function(_0x544721){if(_0x544721){var _0x3b208a=[];for(var _0x1d0470=0x0,_0x42bf7c;_0x1d0470<_0x544721[_0xd4fa('0x33')];_0x1d0470+=0x1){_0x42bf7c=_0x544721[_0x1d0470][_0xd4fa('0x15')]({'plain':!![]});switch(_0x42bf7c[_0xd4fa('0x34')]){case _0xd4fa('0x35'):_0x13d59a(_0x42bf7c)[_0xd4fa('0x24')](_0x31c3ba());break;case _0xd4fa('0x36'):_0x187a02(_0x42bf7c)[_0xd4fa('0x24')](_0x31c3ba());break;default:_0x279c32[_0xd4fa('0x19')][_0xd4fa('0x2d')]({'phone':_0x2b04b3[_0xd4fa('0xd')],'ContactId':_0x2b04b3['id'],'ListId':_0x2b04b3[_0xd4fa('0x1e')],'scheduledat':_0x2b04b3[_0xd4fa('0x20')]?_0x2b04b3['scheduledat']:moment()[_0xd4fa('0x21')](_0xd4fa('0x23')),'priority':_0x2b04b3[_0xd4fa('0x1f')]?_0x2b04b3['priority']:0x2,'callback':_0x2b04b3[_0xd4fa('0x22')]?!![]:![],'callbackuniqueid':_0x2b04b3[_0xd4fa('0x22')]?_0x2b04b3[_0xd4fa('0x22')]:undefined,'callbackat':_0x2b04b3['callbackUniqueid']?moment()['format'](_0xd4fa('0x23')):undefined,'VoiceQueueId':_0x42bf7c['id']})['catch'](_0x31c3ba());}}}})[_0xd4fa('0x1b')](function(){return _0x279c32['VoiceQueue'][_0xd4fa('0x2f')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x279c32[_0xd4fa('0x31')],'as':_0xd4fa('0x37'),'where':{'id':_0x2b04b3[_0xd4fa('0x1e')]}}]})[_0xd4fa('0x1b')](function(_0x89a3f){if(_0x89a3f){var _0x18f097=[];for(var _0x58f5c9=0x0,_0x5e4044;_0x58f5c9<_0x89a3f[_0xd4fa('0x33')];_0x58f5c9+=0x1){_0x5e4044=_0x89a3f[_0x58f5c9][_0xd4fa('0x15')]({'plain':!![]});_0x279c32[_0xd4fa('0x38')][_0xd4fa('0x2d')]({'phone':_0x2b04b3[_0xd4fa('0xd')],'ContactId':_0x2b04b3['id'],'ListId':_0x2b04b3[_0xd4fa('0x1e')],'VoiceQueueId':_0x5e4044['id']})[_0xd4fa('0x24')](function(_0x21b6a4){logger['error'](_0xd4fa('0x39'),_0xd4fa('0x2a'),_0x21b6a4[_0xd4fa('0x3a')]);});}}});})[_0xd4fa('0x1b')](function(){return _0x279c32[_0xd4fa('0x3b')][_0xd4fa('0x2f')]({'attributes':['id',_0xd4fa('0x34')],'include':[{'model':_0x279c32[_0xd4fa('0x31')],'as':_0xd4fa('0x32'),'where':{'id':_0x2b04b3[_0xd4fa('0x1e')]}}]})['then'](function(_0x51d10d){if(_0x51d10d){var _0x329505=[];for(var _0x209230=0x0,_0x49d734;_0x209230<_0x51d10d[_0xd4fa('0x33')];_0x209230+=0x1){_0x49d734=_0x51d10d[_0x209230][_0xd4fa('0x15')]({'plain':!![]});switch(_0x49d734[_0xd4fa('0x34')]){case'always':_0x54612c(_0x49d734)['catch'](_0x1ce1e3());break;case _0xd4fa('0x36'):_0x3c982c(_0x49d734)[_0xd4fa('0x24')](_0x1ce1e3());break;default:_0x279c32[_0xd4fa('0x19')][_0xd4fa('0x2d')]({'phone':_0x2b04b3[_0xd4fa('0xd')],'ContactId':_0x2b04b3['id'],'ListId':_0x2b04b3[_0xd4fa('0x1e')],'scheduledat':_0x2b04b3[_0xd4fa('0x20')]?_0x2b04b3['scheduledat']:moment()[_0xd4fa('0x21')](_0xd4fa('0x23')),'priority':_0x2b04b3[_0xd4fa('0x1f')]?_0x2b04b3[_0xd4fa('0x1f')]:0x2,'callback':_0x2b04b3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2b04b3[_0xd4fa('0x22')]?_0x2b04b3[_0xd4fa('0x22')]:undefined,'callbackat':_0x2b04b3[_0xd4fa('0x22')]?moment()[_0xd4fa('0x21')](_0xd4fa('0x23')):undefined,'CampaignId':_0x49d734['id']})[_0xd4fa('0x24')](_0x1ce1e3());}}}});})[_0xd4fa('0x1b')](function(){return _0x279c32[_0xd4fa('0x3b')]['findAll']({'attributes':['id'],'include':[{'model':_0x279c32['CmList'],'as':_0xd4fa('0x37'),'where':{'id':_0x2b04b3[_0xd4fa('0x1e')]}}]})[_0xd4fa('0x1b')](function(_0x3f4f97){if(_0x3f4f97){var _0x101113=[];for(var _0x3b3e43=0x0,_0x3785aa;_0x3b3e43<_0x3f4f97[_0xd4fa('0x33')];_0x3b3e43+=0x1){_0x3785aa=_0x3f4f97[_0x3b3e43][_0xd4fa('0x15')]({'plain':!![]});_0x279c32[_0xd4fa('0x38')][_0xd4fa('0x2d')]({'phone':_0x2b04b3[_0xd4fa('0xd')],'ContactId':_0x2b04b3['id'],'ListId':_0x2b04b3[_0xd4fa('0x1e')],'CampaignId':_0x3785aa['id']})['catch'](function(_0x490c94){logger[_0xd4fa('0x16')]('cmContact,\x20%s,\x20%s',_0xd4fa('0x2a'),_0x490c94['message']);});}}});})[_0xd4fa('0x1b')](function(){_0x376ef0();})[_0xd4fa('0x24')](function(_0x3d2c20){logger['error'](_0xd4fa('0x39'),_0xd4fa('0x2a'),_0x3d2c20[_0xd4fa('0x3a')]);_0x376ef0(_0x3d2c20);});}else{_0x376ef0(new Error(_0xd4fa('0x3c')));}},'afterDestroy':function(_0x5ef9c5,_0x53e120,_0x5a4771){var _0x1abf7d=_0x597fbe[_0xd4fa('0x3d')];var _0x4454c7=_0x5ef9c5[_0xd4fa('0x15')]({'plain':!![]});return _0x1abf7d[_0xd4fa('0x19')][_0xd4fa('0x2f')]({'raw':!![],'where':{'ListId':_0x4454c7[_0xd4fa('0x1e')],'ContactId':_0x4454c7['id']}})['then'](function(_0x38153c){if(!_[_0xd4fa('0x3e')](_0x38153c)){var _0x4e0982=[];for(var _0x31e1fd=0x0;_0x31e1fd<_0x38153c['length'];_0x31e1fd+=0x1){var _0xf7b7dd=_0x1abf7d['CmHopper'][_0xd4fa('0x3f')]({'where':{'ListId':_0x38153c[_0x31e1fd][_0xd4fa('0x1e')],'ContactId':_0x38153c[_0x31e1fd][_0xd4fa('0x40')],'VoiceQueueId':_0x38153c[_0x31e1fd][_0xd4fa('0x41')],'CampaignId':_0x38153c[_0x31e1fd][_0xd4fa('0x42')]}});_0x4e0982['push'](_0xf7b7dd);}return BPromise[_0xd4fa('0x43')](_0x4e0982);}})[_0xd4fa('0x1b')](function(_0xb2c0c9){logger[_0xd4fa('0x44')]('[CmContact][afterDestroy][Succesfull]',util[_0xd4fa('0x18')](_0xb2c0c9,{'showHidden':![],'depth':null}));_0x5a4771();})[_0xd4fa('0x24')](function(_0x356f83){logger[_0xd4fa('0x16')](_0xd4fa('0x45'),util[_0xd4fa('0x18')](_0x356f83,{'showHidden':![],'depth':null}));_0x5a4771(_0x356f83);});}}});};
\ No newline at end of file
index b805190..e105663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0909=['model','include','GetCmContact','debug','CreateCmContact','CmContact','create','body','keys','length','startsWith','cf_','set','id\x20=\x20?','toString','query','util','moment','bluebird','randomstring','ioredis','squel','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./cmContact.socket','register','then','info','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmContact,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','limit','map'];(function(_0x33c42e,_0x395795){var _0x575e39=function(_0x197baf){while(--_0x197baf){_0x33c42e['push'](_0x33c42e['shift']());}};_0x575e39(++_0x395795);}(_0x0909,0x1db));var _0x9090=function(_0x46adc3,_0x3c7a7c){_0x46adc3=_0x46adc3-0x0;var _0x71f8d2=_0x0909[_0x46adc3];return _0x71f8d2;};'use strict';var _=require('lodash');var util=require(_0x9090('0x0'));var moment=require(_0x9090('0x1'));var BPromise=require(_0x9090('0x2'));var rs=require(_0x9090('0x3'));var fs=require('fs');var Redis=require(_0x9090('0x4'));var squel=require(_0x9090('0x5'));var db=require(_0x9090('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9090('0x7'))(_0x9090('0x8'));var config=require(_0x9090('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9090('0xa')][_0x9090('0xb')]({'port':0x232a});config[_0x9090('0xc')]=_[_0x9090('0xd')](config[_0x9090('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9090('0xe'))(new Redis(config[_0x9090('0xc')]));require(_0x9090('0xf'))[_0x9090('0x10')](socket);function respondWithRpcPromise(_0x1864ef,_0x241e01,_0x44462f){return new BPromise(function(_0x147741,_0x4122db){return client['request'](_0x1864ef,_0x44462f)[_0x9090('0x11')](function(_0x35f178){logger[_0x9090('0x12')]('CmContact,\x20%s,\x20%s',_0x241e01,'request\x20sent');logger['debug'](_0x9090('0x13'),_0x241e01,_0x9090('0x14'),JSON[_0x9090('0x15')](_0x35f178));if(_0x35f178[_0x9090('0x16')]){if(_0x35f178[_0x9090('0x16')][_0x9090('0x17')]===0x1f4){logger[_0x9090('0x16')](_0x9090('0x18'),_0x241e01,_0x35f178['error'][_0x9090('0x19')]);return _0x4122db(_0x35f178[_0x9090('0x16')][_0x9090('0x19')]);}logger[_0x9090('0x16')]('CmContact,\x20%s,\x20%s',_0x241e01,_0x35f178['error'][_0x9090('0x19')]);return _0x147741(_0x35f178['error'][_0x9090('0x19')]);}else{logger['info'](_0x9090('0x18'),_0x241e01,_0x9090('0x14'));_0x147741(_0x35f178[_0x9090('0x1a')][_0x9090('0x19')]);}})[_0x9090('0x1b')](function(_0x9c1a79){logger[_0x9090('0x16')](_0x9090('0x18'),_0x241e01,_0x9c1a79);_0x4122db(_0x9c1a79);});});}exports['GetCmContact']=function(_0x37eb39){var _0x3bbb11=this;return new Promise(function(_0x13bde2,_0x401c8e){return db['CmContact'][_0x9090('0x1c')]({'raw':_0x37eb39['options']?_0x37eb39[_0x9090('0x1d')][_0x9090('0x1e')]===undefined?!![]:![]:!![],'where':_0x37eb39[_0x9090('0x1d')]?_0x37eb39[_0x9090('0x1d')][_0x9090('0x1f')]||null:null,'attributes':_0x37eb39[_0x9090('0x1d')]?_0x37eb39[_0x9090('0x1d')][_0x9090('0x20')]||null:null,'limit':_0x37eb39[_0x9090('0x1d')]?_0x37eb39[_0x9090('0x1d')][_0x9090('0x21')]||null:null,'include':_0x37eb39[_0x9090('0x1d')]?_0x37eb39[_0x9090('0x1d')]['include']?_[_0x9090('0x22')](_0x37eb39[_0x9090('0x1d')]['include'],function(_0x4bbab4){return{'model':db[_0x4bbab4[_0x9090('0x23')]],'as':_0x4bbab4['as'],'attributes':_0x4bbab4['attributes'],'include':_0x4bbab4[_0x9090('0x24')]?_[_0x9090('0x22')](_0x4bbab4[_0x9090('0x24')],function(_0x5a584a){return{'model':db[_0x5a584a[_0x9090('0x23')]],'as':_0x5a584a['as'],'attributes':_0x5a584a['attributes'],'include':_0x5a584a[_0x9090('0x24')]?_[_0x9090('0x22')](_0x5a584a[_0x9090('0x24')],function(_0x817aac){return{'model':db[_0x817aac[_0x9090('0x23')]],'as':_0x817aac['as'],'attributes':_0x817aac[_0x9090('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9090('0x11')](function(_0x2d3059){logger[_0x9090('0x12')](_0x9090('0x25'),_0x37eb39);logger[_0x9090('0x26')](_0x9090('0x25'),_0x37eb39,JSON[_0x9090('0x15')](_0x2d3059));_0x13bde2(_0x2d3059);})['catch'](function(_0x26fc65){logger[_0x9090('0x16')](_0x9090('0x25'),_0x26fc65[_0x9090('0x19')],_0x37eb39);_0x401c8e(_0x3bbb11[_0x9090('0x16')](0x1f4,_0x26fc65[_0x9090('0x19')]));});});};exports[_0x9090('0x27')]=function(_0x188d06){var _0x2a2f75=this;return new Promise(function(_0x27e5fe,_0x21ba66){return db[_0x9090('0x28')][_0x9090('0x29')](_0x188d06[_0x9090('0x2a')],{'raw':_0x188d06[_0x9090('0x1d')]?_0x188d06[_0x9090('0x1d')][_0x9090('0x1e')]===undefined?!![]:![]:!![]})[_0x9090('0x11')](function(_0x248b37){var _0x283074;for(var _0x70a92=0x0;_0x70a92<Object[_0x9090('0x2b')](_0x188d06[_0x9090('0x2a')])[_0x9090('0x2c')];_0x70a92++){var _0x19b5f3=Object[_0x9090('0x2b')](_0x188d06[_0x9090('0x2a')])[_0x70a92];if(_0x19b5f3[_0x9090('0x2d')](_0x9090('0x2e'))){_0x283074=squel['update']()['table']('cm_contacts')[_0x9090('0x2f')](_0x19b5f3,_0x188d06[_0x9090('0x2a')][_0x19b5f3])['where'](_0x9090('0x30'),_0x248b37['id'])[_0x9090('0x31')]();break;}}if(!_0x283074)return _0x248b37;return db['sequelize'][_0x9090('0x32')](_0x283074)[_0x9090('0x11')](function(){return _0x248b37;});})[_0x9090('0x11')](function(_0x44d745){logger[_0x9090('0x12')](_0x9090('0x27'),_0x188d06);logger[_0x9090('0x26')](_0x9090('0x27'),_0x188d06,JSON[_0x9090('0x15')](_0x44d745));_0x27e5fe(_0x44d745);})['catch'](function(_0x2d7158){logger[_0x9090('0x16')](_0x9090('0x27'),_0x2d7158['message'],_0x188d06);_0x21ba66(_0x2a2f75[_0x9090('0x16')](0x1f4,_0x2d7158[_0x9090('0x19')]));});});};
\ No newline at end of file
+var _0x4315=['set','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','randomstring','ioredis','squel','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./cmContact.socket','register','request','then','info','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContact,\x20%s,\x20%s','message','result','catch','GetCmContact','CmContact','findAll','raw','options','where','attributes','limit','include','map','model','CreateCmContact','create','body','keys','startsWith','update','cm_contacts'];(function(_0x1e879c,_0xcc30bd){var _0x1eceb5=function(_0x328555){while(--_0x328555){_0x1e879c['push'](_0x1e879c['shift']());}};_0x1eceb5(++_0xcc30bd);}(_0x4315,0xaa));var _0x5431=function(_0x50f298,_0x15ec50){_0x50f298=_0x50f298-0x0;var _0xa1ab2=_0x4315[_0x50f298];return _0xa1ab2;};'use strict';var _=require(_0x5431('0x0'));var util=require(_0x5431('0x1'));var moment=require(_0x5431('0x2'));var BPromise=require(_0x5431('0x3'));var rs=require(_0x5431('0x4'));var fs=require('fs');var Redis=require(_0x5431('0x5'));var squel=require(_0x5431('0x6'));var db=require(_0x5431('0x7'))['db'];var utils=require(_0x5431('0x8'));var logger=require(_0x5431('0x9'))(_0x5431('0xa'));var config=require(_0x5431('0xb'));var jayson=require(_0x5431('0xc'));var client=jayson[_0x5431('0xd')]['http']({'port':0x232a});config['redis']=_[_0x5431('0xe')](config[_0x5431('0xf')],{'host':_0x5431('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5431('0xf')]));require(_0x5431('0x11'))[_0x5431('0x12')](socket);function respondWithRpcPromise(_0xf8eea1,_0x452c74,_0xcb969a){return new BPromise(function(_0x51f5d0,_0x253a33){return client[_0x5431('0x13')](_0xf8eea1,_0xcb969a)[_0x5431('0x14')](function(_0x536889){logger[_0x5431('0x15')]('CmContact,\x20%s,\x20%s',_0x452c74,_0x5431('0x16'));logger[_0x5431('0x17')](_0x5431('0x18'),_0x452c74,_0x5431('0x16'),JSON[_0x5431('0x19')](_0x536889));if(_0x536889[_0x5431('0x1a')]){if(_0x536889[_0x5431('0x1a')][_0x5431('0x1b')]===0x1f4){logger['error'](_0x5431('0x1c'),_0x452c74,_0x536889[_0x5431('0x1a')][_0x5431('0x1d')]);return _0x253a33(_0x536889['error']['message']);}logger[_0x5431('0x1a')]('CmContact,\x20%s,\x20%s',_0x452c74,_0x536889[_0x5431('0x1a')][_0x5431('0x1d')]);return _0x51f5d0(_0x536889[_0x5431('0x1a')]['message']);}else{logger[_0x5431('0x15')]('CmContact,\x20%s,\x20%s',_0x452c74,_0x5431('0x16'));_0x51f5d0(_0x536889[_0x5431('0x1e')][_0x5431('0x1d')]);}})[_0x5431('0x1f')](function(_0x4bef9b){logger[_0x5431('0x1a')](_0x5431('0x1c'),_0x452c74,_0x4bef9b);_0x253a33(_0x4bef9b);});});}exports[_0x5431('0x20')]=function(_0x54dac5){var _0x2bf122=this;return new Promise(function(_0x5d7d91,_0x545ba0){return db[_0x5431('0x21')][_0x5431('0x22')]({'raw':_0x54dac5['options']?_0x54dac5['options'][_0x5431('0x23')]===undefined?!![]:![]:!![],'where':_0x54dac5['options']?_0x54dac5[_0x5431('0x24')][_0x5431('0x25')]||null:null,'attributes':_0x54dac5[_0x5431('0x24')]?_0x54dac5[_0x5431('0x24')][_0x5431('0x26')]||null:null,'limit':_0x54dac5[_0x5431('0x24')]?_0x54dac5['options'][_0x5431('0x27')]||null:null,'include':_0x54dac5[_0x5431('0x24')]?_0x54dac5[_0x5431('0x24')][_0x5431('0x28')]?_[_0x5431('0x29')](_0x54dac5['options'][_0x5431('0x28')],function(_0x2f0b6a){return{'model':db[_0x2f0b6a[_0x5431('0x2a')]],'as':_0x2f0b6a['as'],'attributes':_0x2f0b6a[_0x5431('0x26')],'include':_0x2f0b6a[_0x5431('0x28')]?_[_0x5431('0x29')](_0x2f0b6a[_0x5431('0x28')],function(_0x52e68f){return{'model':db[_0x52e68f[_0x5431('0x2a')]],'as':_0x52e68f['as'],'attributes':_0x52e68f['attributes'],'include':_0x52e68f[_0x5431('0x28')]?_[_0x5431('0x29')](_0x52e68f['include'],function(_0x4d32ef){return{'model':db[_0x4d32ef[_0x5431('0x2a')]],'as':_0x4d32ef['as'],'attributes':_0x4d32ef[_0x5431('0x26')]};}):[]};}):[]};}):[]:[]})[_0x5431('0x14')](function(_0x5e48c9){logger['info']('GetCmContact',_0x54dac5);logger[_0x5431('0x17')](_0x5431('0x20'),_0x54dac5,JSON[_0x5431('0x19')](_0x5e48c9));_0x5d7d91(_0x5e48c9);})['catch'](function(_0x5d3222){logger[_0x5431('0x1a')]('GetCmContact',_0x5d3222[_0x5431('0x1d')],_0x54dac5);_0x545ba0(_0x2bf122['error'](0x1f4,_0x5d3222['message']));});});};exports[_0x5431('0x2b')]=function(_0x5aa6be){var _0x29c681=this;return new Promise(function(_0x5c47a9,_0x51c7fe){return db[_0x5431('0x21')][_0x5431('0x2c')](_0x5aa6be[_0x5431('0x2d')],{'raw':_0x5aa6be['options']?_0x5aa6be[_0x5431('0x24')]['raw']===undefined?!![]:![]:!![]})[_0x5431('0x14')](function(_0x58e8e3){var _0xf9dd76;for(var _0x78a933=0x0;_0x78a933<Object[_0x5431('0x2e')](_0x5aa6be['body'])['length'];_0x78a933++){var _0x11f9cb=Object[_0x5431('0x2e')](_0x5aa6be[_0x5431('0x2d')])[_0x78a933];if(_0x11f9cb[_0x5431('0x2f')]('cf_')){_0xf9dd76=squel[_0x5431('0x30')]()['table'](_0x5431('0x31'))[_0x5431('0x32')](_0x11f9cb,_0x5aa6be[_0x5431('0x2d')][_0x11f9cb])[_0x5431('0x25')](_0x5431('0x33'),_0x58e8e3['id'])[_0x5431('0x34')]();break;}}if(!_0xf9dd76)return _0x58e8e3;return db[_0x5431('0x35')][_0x5431('0x36')](_0xf9dd76)[_0x5431('0x14')](function(){return _0x58e8e3;});})['then'](function(_0x409b27){logger[_0x5431('0x15')](_0x5431('0x2b'),_0x5aa6be);logger[_0x5431('0x17')]('CreateCmContact',_0x5aa6be,JSON[_0x5431('0x19')](_0x409b27));_0x5c47a9(_0x409b27);})[_0x5431('0x1f')](function(_0x5ccf15){logger[_0x5431('0x1a')](_0x5431('0x2b'),_0x5ccf15[_0x5431('0x1d')],_0x5aa6be);_0x51c7fe(_0x29c681['error'](0x1f4,_0x5ccf15[_0x5431('0x1d')]));});});};
\ No newline at end of file
index 36cbc6b..59bd516 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(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 a41be7c..dff8e3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1580=['getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','/:id/journey','getJourney','post','/merge','merge','create','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','extname','now','/csv','file','uploadCsv','diskStorage','basename','/upload','single','upload','import','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','describe','/:id','/:id/tags','getTags','/:id/hoppers'];(function(_0x58ab89,_0xf01b2d){var _0xb93c04=function(_0x29e1b2){while(--_0x29e1b2){_0x58ab89['push'](_0x58ab89['shift']());}};_0xb93c04(++_0xf01b2d);}(_0x1580,0x148));var _0x0158=function(_0x367de5,_0x4c47e2){_0x367de5=_0x367de5-0x0;var _0x3d6ab9=_0x1580[_0x367de5];return _0x3d6ab9;};'use strict';var multer=require('multer');var util=require(_0x0158('0x0'));var path=require(_0x0158('0x1'));var timeout=require(_0x0158('0x2'));var express=require(_0x0158('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0158('0x4'));var config=require(_0x0158('0x5'));var controller=require(_0x0158('0x6'));router[_0x0158('0x7')]('/',auth[_0x0158('0x8')](),controller[_0x0158('0x9')]);router['get']('/describe',auth[_0x0158('0x8')](),controller[_0x0158('0xa')]);router[_0x0158('0x7')](_0x0158('0xb'),auth[_0x0158('0x8')](),controller['show']);router[_0x0158('0x7')](_0x0158('0xc'),auth[_0x0158('0x8')](),controller[_0x0158('0xd')]);router[_0x0158('0x7')](_0x0158('0xe'),auth[_0x0158('0x8')](),controller[_0x0158('0xf')]);router[_0x0158('0x7')](_0x0158('0x10'),auth[_0x0158('0x8')](),controller[_0x0158('0x11')]);router[_0x0158('0x7')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x0158('0x12')]);router[_0x0158('0x7')](_0x0158('0x13'),auth[_0x0158('0x8')](),controller['getJscriptySessions']);router[_0x0158('0x7')](_0x0158('0x14'),auth['isAuthenticated'](),controller[_0x0158('0x15')]);router[_0x0158('0x16')](_0x0158('0x17'),auth[_0x0158('0x8')](),controller[_0x0158('0x18')]);router[_0x0158('0x16')]('/',auth['isAuthenticated'](),controller[_0x0158('0x19')]);router[_0x0158('0x16')]('/create_many',auth['isAuthenticated'](),controller['bulkCreate']);router['post']('/:id/tags',auth[_0x0158('0x8')](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x23a747,_0x2c1b33,_0x28d329){_0x28d329(null,path[_0x0158('0x1a')](config[_0x0158('0x1b')],_0x0158('0x1c')));},'filename':function(_0x46690d,_0x49397f,_0x1bf25f){_0x49397f[_0x0158('0x1d')]=_0x49397f['originalname'][_0x0158('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1bf25f(null,util[_0x0158('0x1f')](_0x0158('0x20'),path['basename'](_0x49397f[_0x0158('0x1d')],path[_0x0158('0x21')](_0x49397f[_0x0158('0x1d')])),Date[_0x0158('0x22')](),path['extname'](_0x49397f[_0x0158('0x1d')])));}})});router[_0x0158('0x16')](_0x0158('0x23'),upload['single'](_0x0158('0x24')),controller[_0x0158('0x25')]);var upload=multer({'storage':multer[_0x0158('0x26')]({'destination':function(_0x2d61b3,_0x4665dc,_0x137a3f){_0x137a3f(null,path['join'](config[_0x0158('0x1b')],_0x0158('0x1c')));},'filename':function(_0x334406,_0x5d93ad,_0x4159fa){_0x5d93ad['originalname']=_0x5d93ad[_0x0158('0x1d')][_0x0158('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4159fa(null,util[_0x0158('0x1f')](_0x0158('0x20'),path[_0x0158('0x27')](_0x5d93ad['originalname'],path[_0x0158('0x21')](_0x5d93ad['originalname'])),Date[_0x0158('0x22')](),path[_0x0158('0x21')](_0x5d93ad['originalname'])));}})});router['post'](_0x0158('0x28'),upload[_0x0158('0x29')]('file'),controller[_0x0158('0x2a')]);router[_0x0158('0x16')]('/upload/:id',auth['isAuthenticated'](),controller[_0x0158('0x2b')]);router[_0x0158('0x2c')]('/:id',auth[_0x0158('0x8')](),controller[_0x0158('0x2d')]);router[_0x0158('0x2e')](_0x0158('0xb'),auth[_0x0158('0x8')](),controller[_0x0158('0x2f')]);module[_0x0158('0x30')]=router;
\ No newline at end of file
+var _0x4927=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','create','bulkCreate','diskStorage','join','server/files/tmp','replace','format','%s-%s%s','basename','originalname','now','extname','/csv','uploadCsv','/upload','upload','import','put'];(function(_0x5562c3,_0x445e27){var _0x41a0f5=function(_0x3bade2){while(--_0x3bade2){_0x5562c3['push'](_0x5562c3['shift']());}};_0x41a0f5(++_0x445e27);}(_0x4927,0x9a));var _0x7492=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4927[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x7492('0x0'));var path=require(_0x7492('0x1'));var timeout=require('connect-timeout');var express=require(_0x7492('0x2'));var router=express[_0x7492('0x3')]();var fs_extra=require(_0x7492('0x4'));var auth=require(_0x7492('0x5'));var interaction=require(_0x7492('0x6'));var config=require(_0x7492('0x7'));var controller=require('./cmContact.controller');router[_0x7492('0x8')]('/',auth[_0x7492('0x9')](),controller[_0x7492('0xa')]);router['get'](_0x7492('0xb'),auth[_0x7492('0x9')](),controller[_0x7492('0xc')]);router['get'](_0x7492('0xd'),auth[_0x7492('0x9')](),controller['show']);router[_0x7492('0x8')](_0x7492('0xe'),auth['isAuthenticated'](),controller[_0x7492('0xf')]);router['get'](_0x7492('0x10'),auth[_0x7492('0x9')](),controller[_0x7492('0x11')]);router[_0x7492('0x8')](_0x7492('0x12'),auth[_0x7492('0x9')](),controller[_0x7492('0x13')]);router[_0x7492('0x8')](_0x7492('0x14'),auth[_0x7492('0x9')](),controller[_0x7492('0x15')]);router[_0x7492('0x8')](_0x7492('0x16'),auth[_0x7492('0x9')](),controller[_0x7492('0x17')]);router[_0x7492('0x8')](_0x7492('0x18'),auth['isAuthenticated'](),controller[_0x7492('0x19')]);router[_0x7492('0x1a')](_0x7492('0x1b'),auth[_0x7492('0x9')](),controller['merge']);router['post']('/',auth[_0x7492('0x9')](),controller[_0x7492('0x1c')]);router[_0x7492('0x1a')]('/create_many',auth[_0x7492('0x9')](),controller[_0x7492('0x1d')]);router['post']('/:id/tags',auth[_0x7492('0x9')](),controller['setTags']);var upload=multer({'storage':multer[_0x7492('0x1e')]({'destination':function(_0x6ea383,_0x40be4e,_0x4e0287){_0x4e0287(null,path[_0x7492('0x1f')](config['root'],_0x7492('0x20')));},'filename':function(_0x5bff4d,_0x29aded,_0x15d248){_0x29aded['originalname']=_0x29aded['originalname'][_0x7492('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x15d248(null,util[_0x7492('0x22')](_0x7492('0x23'),path[_0x7492('0x24')](_0x29aded[_0x7492('0x25')],path['extname'](_0x29aded[_0x7492('0x25')])),Date[_0x7492('0x26')](),path[_0x7492('0x27')](_0x29aded[_0x7492('0x25')])));}})});router['post'](_0x7492('0x28'),upload['single']('file'),controller[_0x7492('0x29')]);var upload=multer({'storage':multer[_0x7492('0x1e')]({'destination':function(_0x5e14ac,_0x339744,_0x44d829){_0x44d829(null,path['join'](config['root'],_0x7492('0x20')));},'filename':function(_0x3b2165,_0x11c66d,_0x4b9284){_0x11c66d[_0x7492('0x25')]=_0x11c66d['originalname'][_0x7492('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4b9284(null,util[_0x7492('0x22')](_0x7492('0x23'),path['basename'](_0x11c66d[_0x7492('0x25')],path[_0x7492('0x27')](_0x11c66d['originalname'])),Date[_0x7492('0x26')](),path['extname'](_0x11c66d[_0x7492('0x25')])));}})});router[_0x7492('0x1a')](_0x7492('0x2a'),upload['single']('file'),controller[_0x7492('0x2b')]);router[_0x7492('0x1a')]('/upload/:id',auth[_0x7492('0x9')](),controller[_0x7492('0x2c')]);router[_0x7492('0x2d')](_0x7492('0xd'),auth[_0x7492('0x9')](),controller[_0x7492('0x2e')]);router[_0x7492('0x2f')]('/:id',auth['isAuthenticated'](),controller[_0x7492('0x30')]);module[_0x7492('0x31')]=router;
\ No newline at end of file
index b1680ea..37cbbbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4f8=['parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','select'];(function(_0xd8a2ff,_0x4b524d){var _0xb4c577=function(_0x258881){while(--_0x258881){_0xd8a2ff['push'](_0xd8a2ff['shift']());}};_0xb4c577(++_0x4b524d);}(_0xb4f8,0x14a));var _0x8b4f=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0xb4f8[_0x37a79c];return _0x561d89;};'use strict';var Sequelize=require(_0x8b4f('0x0'));var _=require('lodash');module[_0x8b4f('0x1')]={'name':{'type':Sequelize[_0x8b4f('0x2')],'get':function(_0x2cd50a){return this[_0x8b4f('0x3')](_0x8b4f('0x4'));}},'alias':{'type':Sequelize[_0x8b4f('0x5')],'allowNull':![],'set':function(_0x190cb3){this[_0x8b4f('0x6')]('alias',_0x190cb3?_0x190cb3:this[_0x8b4f('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x8b4f('0x7')](_0x8b4f('0x8')),'get':function(){if(this['getDataValue']('type')===_0x8b4f('0x9')){return JSON[_0x8b4f('0xa')](this[_0x8b4f('0x3')]('values'));}else{return this['getDataValue'](_0x8b4f('0xb'));}},'set':function(_0x6934c0){if(Array[_0x8b4f('0xc')](_0x6934c0)){this[_0x8b4f('0x6')](_0x8b4f('0xb'),JSON[_0x8b4f('0xd')](_0x6934c0));}else{this[_0x8b4f('0x6')](_0x8b4f('0xb'),_0x6934c0);}}},'required':{'type':Sequelize[_0x8b4f('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x8b4f('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x8b4f('0xf')](_0x8b4f('0x10'))}};
\ No newline at end of file
+var _0x3a69=['setDataValue','getDataValue','long','type','select','parse','values','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','alias'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0x3a69,0x18b));var _0x93a6=function(_0x4bd578,_0x248e79){_0x4bd578=_0x4bd578-0x0;var _0xa33749=_0x3a69[_0x4bd578];return _0xa33749;};'use strict';var Sequelize=require(_0x93a6('0x0'));var _=require(_0x93a6('0x1'));module[_0x93a6('0x2')]={'name':{'type':Sequelize[_0x93a6('0x3')],'get':function(_0x606e4c){return this['getDataValue'](_0x93a6('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x381861){this[_0x93a6('0x5')]('alias',_0x381861?_0x381861:this[_0x93a6('0x6')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x93a6('0x7')),'get':function(){if(this[_0x93a6('0x6')](_0x93a6('0x8'))===_0x93a6('0x9')){return JSON[_0x93a6('0xa')](this['getDataValue']('values'));}else{return this[_0x93a6('0x6')]('values');}},'set':function(_0xa245ad){if(Array['isArray'](_0xa245ad)){this[_0x93a6('0x5')](_0x93a6('0xb'),JSON[_0x93a6('0xc')](_0xa245ad));}else{this['setDataValue'](_0x93a6('0xb'),_0xa245ad);}}},'required':{'type':Sequelize[_0x93a6('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x93a6('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x93a6('0xe')](_0x93a6('0xf'))}};
\ No newline at end of file
index 6d5dc82..2bfbf54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc58e=['BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../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','save','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','differenceBy','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','merge','options','CmCustomField','includeAll','include','rows','catch','show','rawAttributes','intersection','find','update','body','params','create','Sequelize','TEXT','text','number','switch'];(function(_0x13eddd,_0x2bb439){var _0x3125b5=function(_0x5c2188){while(--_0x5c2188){_0x13eddd['push'](_0x13eddd['shift']());}};_0x3125b5(++_0x2bb439);}(_0xc58e,0x15f));var _0xec58=function(_0x58991b,_0x28fa0f){_0x58991b=_0x58991b-0x0;var _0x15b59d=_0xc58e[_0x58991b];return _0x15b59d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec58('0x0'));var zipdir=require(_0xec58('0x1'));var jsonpatch=require(_0xec58('0x2'));var rp=require(_0xec58('0x3'));var moment=require(_0xec58('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec58('0x5'));var util=require(_0xec58('0x6'));var path=require('path');var sox=require(_0xec58('0x7'));var csv=require(_0xec58('0x8'));var ejs=require(_0xec58('0x9'));var fs=require('fs');var fs_extra=require(_0xec58('0xa'));var _=require('lodash');var squel=require(_0xec58('0xb'));var crypto=require(_0xec58('0xc'));var jsforce=require(_0xec58('0xd'));var deskjs=require(_0xec58('0xe'));var toCsv=require(_0xec58('0x8'));var querystring=require(_0xec58('0xf'));var Papa=require(_0xec58('0x10'));var Redis=require('ioredis');var authService=require(_0xec58('0x11'));var qs=require(_0xec58('0x12'));var as=require(_0xec58('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec58('0x14'))(_0xec58('0x15'));var utils=require(_0xec58('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xec58('0x17'))['db'];function respondWithStatusCode(_0x2d5078,_0x45159c){_0x45159c=_0x45159c||0xcc;return function(_0x35a93e){if(_0x35a93e){return _0x2d5078[_0xec58('0x18')](_0x45159c);}return _0x2d5078[_0xec58('0x19')](_0x45159c)['end']();};}function respondWithResult(_0x2213b7,_0xbf444b){_0xbf444b=_0xbf444b||0xc8;return function(_0x7cde34){if(_0x7cde34){return _0x2213b7[_0xec58('0x19')](_0xbf444b)[_0xec58('0x1a')](_0x7cde34);}};}function respondWithFilteredResult(_0x478dc9,_0x14ccf2){return function(_0x163505){if(_0x163505){var _0x2c07a6=typeof _0x14ccf2[_0xec58('0x1b')]===_0xec58('0x1c')&&typeof _0x14ccf2[_0xec58('0x1d')]==='undefined';var _0x1632be=_0x163505['count'];var _0x191305=_0x2c07a6?0x0:_0x14ccf2[_0xec58('0x1b')];var _0x405d91=_0x2c07a6?_0x163505[_0xec58('0x1e')]:_0x14ccf2['offset']+_0x14ccf2[_0xec58('0x1d')];var _0x4f03d9;if(_0x405d91>=_0x1632be){_0x405d91=_0x1632be;_0x4f03d9=0xc8;}else{_0x4f03d9=0xce;}_0x478dc9[_0xec58('0x19')](_0x4f03d9);return _0x478dc9[_0xec58('0x1f')](_0xec58('0x20'),_0x191305+'-'+_0x405d91+'/'+_0x1632be)[_0xec58('0x1a')](_0x163505);}return null;};}function patchUpdates(_0x4632b5){return function(_0x511759){try{jsonpatch[_0xec58('0x21')](_0x511759,_0x4632b5,!![]);}catch(_0x443807){return BPromise['reject'](_0x443807);}return _0x511759[_0xec58('0x22')]();};}function saveUpdates(_0xa76d90,_0x3f3c8e){return function(_0x1df2e8){if(_0x1df2e8){return _0x1df2e8['update'](_0xa76d90)[_0xec58('0x23')](function(_0x38f5b5){return _0x38f5b5;});}return null;};}function removeEntity(_0x24a0ea,_0x5c0194){return function(_0x5279df){if(_0x5279df){return _0x5279df[_0xec58('0x24')]()[_0xec58('0x23')](function(){_0x24a0ea[_0xec58('0x19')](0xcc)[_0xec58('0x25')]();});}};}function handleEntityNotFound(_0x2484e2,_0x22f5cf){return function(_0x16b57b){if(!_0x16b57b){_0x2484e2[_0xec58('0x18')](0x194);}return _0x16b57b;};}function handleError(_0x1b16e6,_0x3d80b9){_0x3d80b9=_0x3d80b9||0x1f4;return function(_0x3010d6){logger[_0xec58('0x26')](_0x3010d6[_0xec58('0x27')]);if(_0x3010d6[_0xec58('0x28')]){delete _0x3010d6[_0xec58('0x28')];}_0x1b16e6[_0xec58('0x19')](_0x3d80b9)[_0xec58('0x29')](_0x3010d6);};}exports[_0xec58('0x2a')]=function(_0xda4522,_0x4c7633){var _0x1ddb22={},_0x5d6948={},_0x58e3bc={'count':0x0,'rows':[]};var _0x5459eb=_[_0xec58('0x2b')](db['CmCustomField']['rawAttributes'],function(_0x29e50e){return{'name':_0x29e50e[_0xec58('0x2c')],'type':_0x29e50e[_0xec58('0x2d')][_0xec58('0x2e')]};});_0x5d6948[_0xec58('0x2f')]=_[_0xec58('0x30')](_['map'](_0x5459eb,_0xec58('0x28')),['name']);_0x5d6948['query']=_['keys'](_0xda4522[_0xec58('0x31')]);_0x5d6948['filters']=_['intersection'](_0x5d6948[_0xec58('0x2f')],_0x5d6948['query']);_0x1ddb22[_0xec58('0x32')]=_['intersection'](_0x5d6948[_0xec58('0x2f')],qs['fields'](_0xda4522[_0xec58('0x31')][_0xec58('0x33')]));_0x1ddb22['attributes']=_0x1ddb22['attributes'][_0xec58('0x34')]?_0x1ddb22[_0xec58('0x32')]:_0x5d6948['model'];if(!_0xda4522[_0xec58('0x31')][_0xec58('0x35')](_0xec58('0x36'))){_0x1ddb22['limit']=qs['limit'](_0xda4522['query'][_0xec58('0x1d')]);_0x1ddb22['offset']=qs[_0xec58('0x1b')](_0xda4522[_0xec58('0x31')]['offset']);}_0x1ddb22[_0xec58('0x37')]=qs['sort'](_0xda4522['query']['sort']);_0x1ddb22[_0xec58('0x38')]=qs['filters'](_[_0xec58('0x39')](_0xda4522[_0xec58('0x31')],_0x5d6948[_0xec58('0x3a')]),_0x5459eb);if(_0xda4522[_0xec58('0x31')]['filter']){_0x1ddb22[_0xec58('0x38')]=_[_0xec58('0x3b')](_0x1ddb22[_0xec58('0x38')],{'$or':_[_0xec58('0x2b')](_0x5459eb,function(_0x1d4804){if(_0x1d4804[_0xec58('0x2d')]!=='VIRTUAL'){var _0x118c7f={};_0x118c7f[_0x1d4804['name']]={'$like':'%'+_0xda4522[_0xec58('0x31')]['filter']+'%'};return _0x118c7f;}})});}_0x1ddb22=_[_0xec58('0x3b')]({},_0x1ddb22,_0xda4522[_0xec58('0x3c')]);var _0x35fad4={'where':_0x1ddb22[_0xec58('0x38')]};return db[_0xec58('0x3d')]['count'](_0x35fad4)[_0xec58('0x23')](function(_0x3f3463){_0x58e3bc['count']=_0x3f3463;if(_0xda4522[_0xec58('0x31')][_0xec58('0x3e')]){_0x1ddb22[_0xec58('0x3f')]=[{'all':!![]}];}return db[_0xec58('0x3d')]['findAll'](_0x1ddb22);})[_0xec58('0x23')](function(_0x230da0){_0x58e3bc[_0xec58('0x40')]=_0x230da0;return _0x58e3bc;})[_0xec58('0x23')](respondWithFilteredResult(_0x4c7633,_0x1ddb22))[_0xec58('0x41')](handleError(_0x4c7633,null));};exports[_0xec58('0x42')]=function(_0x58371d,_0x83fa5a){var _0x4a2bdf={'raw':!![],'where':{'id':_0x58371d['params']['id']}},_0x55277e={};_0x55277e[_0xec58('0x2f')]=_['keys'](db[_0xec58('0x3d')][_0xec58('0x43')]);_0x55277e[_0xec58('0x31')]=_['keys'](_0x58371d[_0xec58('0x31')]);_0x55277e[_0xec58('0x3a')]=_[_0xec58('0x44')](_0x55277e[_0xec58('0x2f')],_0x55277e['query']);_0x4a2bdf[_0xec58('0x32')]=_[_0xec58('0x44')](_0x55277e['model'],qs['fields'](_0x58371d[_0xec58('0x31')][_0xec58('0x33')]));_0x4a2bdf[_0xec58('0x32')]=_0x4a2bdf['attributes'][_0xec58('0x34')]?_0x4a2bdf['attributes']:_0x55277e['model'];if(_0x58371d[_0xec58('0x31')][_0xec58('0x3e')]){_0x4a2bdf[_0xec58('0x3f')]=[{'all':!![]}];}_0x4a2bdf=_[_0xec58('0x3b')]({},_0x4a2bdf,_0x58371d['options']);return db['CmCustomField'][_0xec58('0x45')](_0x4a2bdf)['then'](handleEntityNotFound(_0x83fa5a,null))[_0xec58('0x23')](respondWithResult(_0x83fa5a,null))[_0xec58('0x41')](handleError(_0x83fa5a,null));};exports[_0xec58('0x46')]=function(_0xdc4e5,_0x430b3c){if(_0xdc4e5['body']['id']){delete _0xdc4e5[_0xec58('0x47')]['id'];}return db[_0xec58('0x3d')][_0xec58('0x45')]({'where':{'id':_0xdc4e5[_0xec58('0x48')]['id']}})['then'](handleEntityNotFound(_0x430b3c,null))[_0xec58('0x23')](saveUpdates(_0xdc4e5[_0xec58('0x47')],null))[_0xec58('0x23')](respondWithResult(_0x430b3c,null))[_0xec58('0x41')](handleError(_0x430b3c,null));};exports[_0xec58('0x24')]=function(_0x1919f5,_0x39781d){return db[_0xec58('0x3d')][_0xec58('0x45')]({'where':{'id':_0x1919f5[_0xec58('0x48')]['id']}})[_0xec58('0x23')](handleEntityNotFound(_0x39781d,null))[_0xec58('0x23')](removeEntity(_0x39781d,null))[_0xec58('0x41')](handleError(_0x39781d,null));};exports[_0xec58('0x49')]=function(_0x100310,_0x2a0335){var _0x2fe367;return db['sequelize']['transaction'](function(_0x384e87){return db[_0xec58('0x3d')][_0xec58('0x49')](_0x100310[_0xec58('0x47')],{'transaction':_0x384e87})[_0xec58('0x23')](function(_0x2bb596){_0x2fe367=_0x2bb596;var _0x1db3d3={'type':db[_0xec58('0x4a')][_0xec58('0x4b')],'transaction':_0x384e87};switch(_0x100310['body']['type']){case _0xec58('0x4c'):_0x1db3d3[_0xec58('0x2d')]=db[_0xec58('0x4a')][_0xec58('0x4b')];break;case _0xec58('0x4d'):_0x1db3d3[_0xec58('0x2d')]=db[_0xec58('0x4a')]['INTEGER'];break;case _0xec58('0x4e'):_0x1db3d3[_0xec58('0x2d')]=db[_0xec58('0x4a')][_0xec58('0x4f')];_0x1db3d3[_0xec58('0x50')]=![];break;default:}return db[_0xec58('0x51')]['queryInterface'][_0xec58('0x52')](_0xec58('0x53'),util[_0xec58('0x54')](_0xec58('0x55'),_0x2fe367['id']),_0x1db3d3);})[_0xec58('0x23')](function(){return _0x2fe367;});})[_0xec58('0x23')](respondWithResult(_0x2a0335,0xc9))[_0xec58('0x41')](handleError(_0x2a0335,null));};
\ No newline at end of file
+var _0x47f8=['map','query','keys','filters','attributes','fields','length','nolimit','limit','sort','where','VIRTUAL','filter','merge','options','includeAll','include','catch','show','intersection','body','find','params','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','undefined','count','offset','status','set','json','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','CmCustomField','rawAttributes','fieldName','type','key','model'];(function(_0xf56954,_0x2ca7e8){var _0x2e377d=function(_0x578176){while(--_0x578176){_0xf56954['push'](_0xf56954['shift']());}};_0x2e377d(++_0x2ca7e8);}(_0x47f8,0x121));var _0x847f=function(_0x1aa997,_0x48a62c){_0x1aa997=_0x1aa997-0x0;var _0x11ec60=_0x47f8[_0x1aa997];return _0x11ec60;};'use strict';var emlformat=require(_0x847f('0x0'));var rimraf=require(_0x847f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x847f('0x2'));var moment=require(_0x847f('0x3'));var BPromise=require(_0x847f('0x4'));var Mustache=require(_0x847f('0x5'));var util=require(_0x847f('0x6'));var path=require(_0x847f('0x7'));var sox=require(_0x847f('0x8'));var csv=require(_0x847f('0x9'));var ejs=require(_0x847f('0xa'));var fs=require('fs');var fs_extra=require(_0x847f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x847f('0xc'));var jsforce=require(_0x847f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x847f('0x9'));var querystring=require(_0x847f('0xe'));var Papa=require('papaparse');var Redis=require(_0x847f('0xf'));var authService=require(_0x847f('0x10'));var qs=require(_0x847f('0x11'));var as=require(_0x847f('0x12'));var hardwareService=require(_0x847f('0x13'));var logger=require(_0x847f('0x14'))(_0x847f('0x15'));var utils=require(_0x847f('0x16'));var config=require(_0x847f('0x17'));var licenseUtil=require(_0x847f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3579bd,_0x3717be){_0x3717be=_0x3717be||0xcc;return function(_0x1d0adf){if(_0x1d0adf){return _0x3579bd['sendStatus'](_0x3717be);}return _0x3579bd['status'](_0x3717be)['end']();};}function respondWithResult(_0x44fdbd,_0x3eea3c){_0x3eea3c=_0x3eea3c||0xc8;return function(_0x21a90a){if(_0x21a90a){return _0x44fdbd['status'](_0x3eea3c)['json'](_0x21a90a);}};}function respondWithFilteredResult(_0x3c380a,_0xf37d7){return function(_0x2efb8d){if(_0x2efb8d){var _0x211316=typeof _0xf37d7['offset']===_0x847f('0x19')&&typeof _0xf37d7['limit']===_0x847f('0x19');var _0x2b5c2b=_0x2efb8d[_0x847f('0x1a')];var _0x1008ab=_0x211316?0x0:_0xf37d7['offset'];var _0x4f25f9=_0x211316?_0x2efb8d[_0x847f('0x1a')]:_0xf37d7[_0x847f('0x1b')]+_0xf37d7['limit'];var _0x147482;if(_0x4f25f9>=_0x2b5c2b){_0x4f25f9=_0x2b5c2b;_0x147482=0xc8;}else{_0x147482=0xce;}_0x3c380a[_0x847f('0x1c')](_0x147482);return _0x3c380a[_0x847f('0x1d')]('Content-Range',_0x1008ab+'-'+_0x4f25f9+'/'+_0x2b5c2b)[_0x847f('0x1e')](_0x2efb8d);}return null;};}function patchUpdates(_0x37e25f){return function(_0x15467b){try{jsonpatch[_0x847f('0x1f')](_0x15467b,_0x37e25f,!![]);}catch(_0x856467){return BPromise[_0x847f('0x20')](_0x856467);}return _0x15467b[_0x847f('0x21')]();};}function saveUpdates(_0x5dfefb,_0x2e3528){return function(_0x50976d){if(_0x50976d){return _0x50976d['update'](_0x5dfefb)[_0x847f('0x22')](function(_0x41f253){return _0x41f253;});}return null;};}function removeEntity(_0x63ba2c,_0x5eeb11){return function(_0x39ee7d){if(_0x39ee7d){return _0x39ee7d[_0x847f('0x23')]()[_0x847f('0x22')](function(){_0x63ba2c[_0x847f('0x1c')](0xcc)[_0x847f('0x24')]();});}};}function handleEntityNotFound(_0x4e8895,_0x541525){return function(_0x4954f6){if(!_0x4954f6){_0x4e8895[_0x847f('0x25')](0x194);}return _0x4954f6;};}function handleError(_0x3e7bb6,_0x5cc9d3){_0x5cc9d3=_0x5cc9d3||0x1f4;return function(_0x5adc8d){logger[_0x847f('0x26')](_0x5adc8d[_0x847f('0x27')]);if(_0x5adc8d[_0x847f('0x28')]){delete _0x5adc8d[_0x847f('0x28')];}_0x3e7bb6[_0x847f('0x1c')](_0x5cc9d3)['send'](_0x5adc8d);};}exports['index']=function(_0x72ddfa,_0x1ba2f7){var _0x47d5dd={},_0x489a6f={},_0x4ef109={'count':0x0,'rows':[]};var _0x27bc77=_['map'](db[_0x847f('0x29')][_0x847f('0x2a')],function(_0x4c0c3d){return{'name':_0x4c0c3d[_0x847f('0x2b')],'type':_0x4c0c3d[_0x847f('0x2c')][_0x847f('0x2d')]};});_0x489a6f[_0x847f('0x2e')]=_['differenceBy'](_[_0x847f('0x2f')](_0x27bc77,_0x847f('0x28')),[_0x847f('0x28')]);_0x489a6f[_0x847f('0x30')]=_[_0x847f('0x31')](_0x72ddfa['query']);_0x489a6f[_0x847f('0x32')]=_['intersection'](_0x489a6f['model'],_0x489a6f[_0x847f('0x30')]);_0x47d5dd[_0x847f('0x33')]=_['intersection'](_0x489a6f['model'],qs['fields'](_0x72ddfa[_0x847f('0x30')][_0x847f('0x34')]));_0x47d5dd[_0x847f('0x33')]=_0x47d5dd[_0x847f('0x33')][_0x847f('0x35')]?_0x47d5dd[_0x847f('0x33')]:_0x489a6f[_0x847f('0x2e')];if(!_0x72ddfa['query']['hasOwnProperty'](_0x847f('0x36'))){_0x47d5dd[_0x847f('0x37')]=qs['limit'](_0x72ddfa[_0x847f('0x30')][_0x847f('0x37')]);_0x47d5dd[_0x847f('0x1b')]=qs[_0x847f('0x1b')](_0x72ddfa[_0x847f('0x30')][_0x847f('0x1b')]);}_0x47d5dd['order']=qs[_0x847f('0x38')](_0x72ddfa[_0x847f('0x30')][_0x847f('0x38')]);_0x47d5dd['where']=qs[_0x847f('0x32')](_['pick'](_0x72ddfa[_0x847f('0x30')],_0x489a6f[_0x847f('0x32')]),_0x27bc77);if(_0x72ddfa['query']['filter']){_0x47d5dd[_0x847f('0x39')]=_['merge'](_0x47d5dd[_0x847f('0x39')],{'$or':_[_0x847f('0x2f')](_0x27bc77,function(_0x427528){if(_0x427528[_0x847f('0x2c')]!==_0x847f('0x3a')){var _0x2687f1={};_0x2687f1[_0x427528['name']]={'$like':'%'+_0x72ddfa['query'][_0x847f('0x3b')]+'%'};return _0x2687f1;}})});}_0x47d5dd=_[_0x847f('0x3c')]({},_0x47d5dd,_0x72ddfa[_0x847f('0x3d')]);var _0x1a9f3f={'where':_0x47d5dd[_0x847f('0x39')]};return db[_0x847f('0x29')]['count'](_0x1a9f3f)[_0x847f('0x22')](function(_0x38fb75){_0x4ef109['count']=_0x38fb75;if(_0x72ddfa[_0x847f('0x30')][_0x847f('0x3e')]){_0x47d5dd[_0x847f('0x3f')]=[{'all':!![]}];}return db[_0x847f('0x29')]['findAll'](_0x47d5dd);})[_0x847f('0x22')](function(_0x25bd2d){_0x4ef109['rows']=_0x25bd2d;return _0x4ef109;})['then'](respondWithFilteredResult(_0x1ba2f7,_0x47d5dd))[_0x847f('0x40')](handleError(_0x1ba2f7,null));};exports[_0x847f('0x41')]=function(_0x38a3a9,_0x14bacc){var _0x34d40f={'raw':!![],'where':{'id':_0x38a3a9['params']['id']}},_0x511f60={};_0x511f60[_0x847f('0x2e')]=_[_0x847f('0x31')](db[_0x847f('0x29')][_0x847f('0x2a')]);_0x511f60[_0x847f('0x30')]=_[_0x847f('0x31')](_0x38a3a9[_0x847f('0x30')]);_0x511f60['filters']=_[_0x847f('0x42')](_0x511f60[_0x847f('0x2e')],_0x511f60[_0x847f('0x30')]);_0x34d40f[_0x847f('0x33')]=_[_0x847f('0x42')](_0x511f60[_0x847f('0x2e')],qs['fields'](_0x38a3a9[_0x847f('0x30')][_0x847f('0x34')]));_0x34d40f[_0x847f('0x33')]=_0x34d40f['attributes'][_0x847f('0x35')]?_0x34d40f['attributes']:_0x511f60[_0x847f('0x2e')];if(_0x38a3a9[_0x847f('0x30')][_0x847f('0x3e')]){_0x34d40f['include']=[{'all':!![]}];}_0x34d40f=_[_0x847f('0x3c')]({},_0x34d40f,_0x38a3a9[_0x847f('0x3d')]);return db[_0x847f('0x29')]['find'](_0x34d40f)['then'](handleEntityNotFound(_0x14bacc,null))[_0x847f('0x22')](respondWithResult(_0x14bacc,null))['catch'](handleError(_0x14bacc,null));};exports['update']=function(_0x20af9f,_0x222ec8){if(_0x20af9f[_0x847f('0x43')]['id']){delete _0x20af9f[_0x847f('0x43')]['id'];}return db['CmCustomField'][_0x847f('0x44')]({'where':{'id':_0x20af9f[_0x847f('0x45')]['id']}})[_0x847f('0x22')](handleEntityNotFound(_0x222ec8,null))[_0x847f('0x22')](saveUpdates(_0x20af9f[_0x847f('0x43')],null))[_0x847f('0x22')](respondWithResult(_0x222ec8,null))['catch'](handleError(_0x222ec8,null));};exports[_0x847f('0x23')]=function(_0x3cea35,_0xc1a590){return db['CmCustomField'][_0x847f('0x44')]({'where':{'id':_0x3cea35[_0x847f('0x45')]['id']}})['then'](handleEntityNotFound(_0xc1a590,null))[_0x847f('0x22')](removeEntity(_0xc1a590,null))['catch'](handleError(_0xc1a590,null));};exports[_0x847f('0x46')]=function(_0x1f093e,_0x1d12cd){var _0x180274;return db[_0x847f('0x47')][_0x847f('0x48')](function(_0x1115d7){return db[_0x847f('0x29')][_0x847f('0x46')](_0x1f093e['body'],{'transaction':_0x1115d7})[_0x847f('0x22')](function(_0x3b0b2f){_0x180274=_0x3b0b2f;var _0x54aa57={'type':db[_0x847f('0x49')][_0x847f('0x4a')],'transaction':_0x1115d7};switch(_0x1f093e[_0x847f('0x43')][_0x847f('0x2c')]){case'text':_0x54aa57['type']=db[_0x847f('0x49')][_0x847f('0x4a')];break;case _0x847f('0x4b'):_0x54aa57[_0x847f('0x2c')]=db['Sequelize'][_0x847f('0x4c')];break;case _0x847f('0x4d'):_0x54aa57[_0x847f('0x2c')]=db['Sequelize'][_0x847f('0x4e')];_0x54aa57['defaultValue']=![];break;default:}return db[_0x847f('0x47')][_0x847f('0x4f')][_0x847f('0x50')](_0x847f('0x51'),util[_0x847f('0x52')](_0x847f('0x53'),_0x180274['id']),_0x54aa57);})[_0x847f('0x22')](function(){return _0x180274;});})[_0x847f('0x22')](respondWithResult(_0x1d12cd,0xc9))[_0x847f('0x40')](handleError(_0x1d12cd,null));};
\ No newline at end of file
index dfd3b06..c2fcfaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1411=['cm_custom_fields','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField'];(function(_0x2a36ef,_0x368ced){var _0x2ea874=function(_0x1cb55a){while(--_0x1cb55a){_0x2a36ef['push'](_0x2a36ef['shift']());}};_0x2ea874(++_0x368ced);}(_0x1411,0x16d));var _0x1141=function(_0x39868e,_0x4b6da9){_0x39868e=_0x39868e-0x0;var _0x4eadec=_0x1411[_0x39868e];return _0x4eadec;};'use strict';var _=require(_0x1141('0x0'));var util=require('util');var logger=require(_0x1141('0x1'))(_0x1141('0x2'));var moment=require('moment');var BPromise=require(_0x1141('0x3'));var rp=require(_0x1141('0x4'));var fs=require('fs');var path=require(_0x1141('0x5'));var rimraf=require(_0x1141('0x6'));var config=require(_0x1141('0x7'));var attributes=require(_0x1141('0x8'));module[_0x1141('0x9')]=function(_0x229f5c,_0x3aa56a){return _0x229f5c[_0x1141('0xa')](_0x1141('0xb'),attributes,{'tableName':_0x1141('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x93c3=['cm_custom_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','CmCustomField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93c3,0x14b));var _0x393c=function(_0x575313,_0x5f3a65){_0x575313=_0x575313-0x0;var _0x3eb20e=_0x93c3[_0x575313];return _0x3eb20e;};'use strict';var _=require('lodash');var util=require(_0x393c('0x0'));var logger=require(_0x393c('0x1'))(_0x393c('0x2'));var moment=require(_0x393c('0x3'));var BPromise=require(_0x393c('0x4'));var rp=require(_0x393c('0x5'));var fs=require('fs');var path=require(_0x393c('0x6'));var rimraf=require(_0x393c('0x7'));var config=require('../../config/environment');var attributes=require(_0x393c('0x8'));module['exports']=function(_0x13d27d,_0x2472e7){return _0x13d27d['define'](_0x393c('0x9'),attributes,{'tableName':_0x393c('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 27a085b..d607a02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ec3=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x3342c1,_0x3f7f65){var _0x3bf362=function(_0x360caf){while(--_0x360caf){_0x3342c1['push'](_0x3342c1['shift']());}};_0x3bf362(++_0x3f7f65);}(_0x5ec3,0x172));var _0x35ec=function(_0xaf94f1,_0x5d2f3d){_0xaf94f1=_0xaf94f1-0x0;var _0x3ff79d=_0x5ec3[_0xaf94f1];return _0x3ff79d;};'use strict';var _=require(_0x35ec('0x0'));var util=require(_0x35ec('0x1'));var moment=require(_0x35ec('0x2'));var BPromise=require(_0x35ec('0x3'));var rs=require(_0x35ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35ec('0x5'))['db'];var utils=require(_0x35ec('0x6'));var logger=require(_0x35ec('0x7'))(_0x35ec('0x8'));var config=require('../../config/environment');var jayson=require(_0x35ec('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf95da,_0x366e73,_0x10593f){return new BPromise(function(_0x2a2afb,_0x2c7ed8){return client[_0x35ec('0xa')](_0xf95da,_0x10593f)[_0x35ec('0xb')](function(_0x1301ea){logger[_0x35ec('0xc')](_0x35ec('0xd'),_0x366e73,_0x35ec('0xe'));logger[_0x35ec('0xf')](_0x35ec('0x10'),_0x366e73,_0x35ec('0xe'),JSON[_0x35ec('0x11')](_0x1301ea));if(_0x1301ea[_0x35ec('0x12')]){if(_0x1301ea[_0x35ec('0x12')][_0x35ec('0x13')]===0x1f4){logger[_0x35ec('0x12')](_0x35ec('0xd'),_0x366e73,_0x1301ea[_0x35ec('0x12')][_0x35ec('0x14')]);return _0x2c7ed8(_0x1301ea[_0x35ec('0x12')][_0x35ec('0x14')]);}logger[_0x35ec('0x12')](_0x35ec('0xd'),_0x366e73,_0x1301ea[_0x35ec('0x12')][_0x35ec('0x14')]);return _0x2a2afb(_0x1301ea[_0x35ec('0x12')][_0x35ec('0x14')]);}else{logger['info'](_0x35ec('0xd'),_0x366e73,_0x35ec('0xe'));_0x2a2afb(_0x1301ea['result']['message']);}})[_0x35ec('0x15')](function(_0x412bfe){logger['error'](_0x35ec('0xd'),_0x366e73,_0x412bfe);_0x2c7ed8(_0x412bfe);});});}
\ No newline at end of file
+var _0x48ce=['code','message','CmCustomField,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x29a36b,_0x42e3a0){var _0x1dcf18=function(_0x4fc392){while(--_0x4fc392){_0x29a36b['push'](_0x29a36b['shift']());}};_0x1dcf18(++_0x42e3a0);}(_0x48ce,0x116));var _0xe48c=function(_0x22a71a,_0x27b73a){_0x22a71a=_0x22a71a-0x0;var _0x2041b4=_0x48ce[_0x22a71a];return _0x2041b4;};'use strict';var _=require(_0xe48c('0x0'));var util=require('util');var moment=require(_0xe48c('0x1'));var BPromise=require(_0xe48c('0x2'));var rs=require(_0xe48c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe48c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe48c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe48c('0x6'));var client=jayson[_0xe48c('0x7')][_0xe48c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa87d41,_0x4a3e8a,_0x38d3bb){return new BPromise(function(_0x4d3474,_0x259e0b){return client[_0xe48c('0x9')](_0xa87d41,_0x38d3bb)['then'](function(_0xa8058c){logger[_0xe48c('0xa')]('CmCustomField,\x20%s,\x20%s',_0x4a3e8a,_0xe48c('0xb'));logger[_0xe48c('0xc')](_0xe48c('0xd'),_0x4a3e8a,_0xe48c('0xb'),JSON[_0xe48c('0xe')](_0xa8058c));if(_0xa8058c[_0xe48c('0xf')]){if(_0xa8058c[_0xe48c('0xf')][_0xe48c('0x10')]===0x1f4){logger[_0xe48c('0xf')]('CmCustomField,\x20%s,\x20%s',_0x4a3e8a,_0xa8058c['error'][_0xe48c('0x11')]);return _0x259e0b(_0xa8058c[_0xe48c('0xf')][_0xe48c('0x11')]);}logger['error'](_0xe48c('0x12'),_0x4a3e8a,_0xa8058c[_0xe48c('0xf')][_0xe48c('0x11')]);return _0x4d3474(_0xa8058c[_0xe48c('0xf')]['message']);}else{logger[_0xe48c('0xa')](_0xe48c('0x12'),_0x4a3e8a,_0xe48c('0xb'));_0x4d3474(_0xa8058c[_0xe48c('0x13')][_0xe48c('0x11')]);}})[_0xe48c('0x14')](function(_0x5317b3){logger[_0xe48c('0xf')](_0xe48c('0x12'),_0x4a3e8a,_0x5317b3);_0x259e0b(_0x5317b3);});});}
\ No newline at end of file
index a9e9262..0742f21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa992=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xa992,0x18c));var _0x2a99=function(_0x2f5ba9,_0x32e278){_0x2f5ba9=_0x2f5ba9-0x0;var _0x2387c4=_0xa992[_0x2f5ba9];return _0x2387c4;};'use strict';var multer=require(_0x2a99('0x0'));var util=require(_0x2a99('0x1'));var path=require(_0x2a99('0x2'));var timeout=require(_0x2a99('0x3'));var express=require('express');var router=express[_0x2a99('0x4')]();var fs_extra=require(_0x2a99('0x5'));var auth=require(_0x2a99('0x6'));var interaction=require(_0x2a99('0x7'));var config=require(_0x2a99('0x8'));var controller=require(_0x2a99('0x9'));router[_0x2a99('0xa')]('/',auth[_0x2a99('0xb')](),controller[_0x2a99('0xc')]);router[_0x2a99('0xa')]('/:id',auth[_0x2a99('0xb')](),controller[_0x2a99('0xd')]);router[_0x2a99('0xe')]('/',auth[_0x2a99('0xb')](),controller[_0x2a99('0xf')]);router[_0x2a99('0x10')](_0x2a99('0x11'),auth[_0x2a99('0xb')](),controller[_0x2a99('0x12')]);router[_0x2a99('0x13')](_0x2a99('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a99('0x14')]=router;
\ No newline at end of file
+var _0x536e=['get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller'];(function(_0x1e8e69,_0x508379){var _0x291b1a=function(_0x16861c){while(--_0x16861c){_0x1e8e69['push'](_0x1e8e69['shift']());}};_0x291b1a(++_0x508379);}(_0x536e,0x155));var _0xe536=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0x536e[_0x1261c2];return _0x3aabd2;};'use strict';var multer=require(_0xe536('0x0'));var util=require(_0xe536('0x1'));var path=require(_0xe536('0x2'));var timeout=require(_0xe536('0x3'));var express=require(_0xe536('0x4'));var router=express[_0xe536('0x5')]();var fs_extra=require(_0xe536('0x6'));var auth=require(_0xe536('0x7'));var interaction=require(_0xe536('0x8'));var config=require(_0xe536('0x9'));var controller=require(_0xe536('0xa'));router[_0xe536('0xb')]('/',auth[_0xe536('0xc')](),controller[_0xe536('0xd')]);router['get']('/:id',auth[_0xe536('0xc')](),controller[_0xe536('0xe')]);router['post']('/',auth[_0xe536('0xc')](),controller[_0xe536('0xf')]);router[_0xe536('0x10')](_0xe536('0x11'),auth[_0xe536('0xc')](),controller[_0xe536('0x12')]);router[_0xe536('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe536('0x14')]);module[_0xe536('0x15')]=router;
\ No newline at end of file
index ee9dd1c..0054780 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x898d=['moment','sequelize','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue'];(function(_0xa65eac,_0x472796){var _0x160321=function(_0x25191b){while(--_0x25191b){_0xa65eac['push'](_0xa65eac['shift']());}};_0x160321(++_0x472796);}(_0x898d,0x1ea));var _0xd898=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0x898d[_0x1a1b6e];return _0x571e2c;};'use strict';var moment=require(_0xd898('0x0'));var Sequelize=require(_0xd898('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xd898('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xd898('0x3')],'defaultValue':moment()[_0xd898('0x4')](_0xd898('0x5'))},'countbusyretry':{'type':Sequelize[_0xd898('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd898('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xd898('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd898('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xd898('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xd898('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xd898('0x6')],'unique':_0xd898('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xd898('0x9')},'UserId':{'type':Sequelize[_0xd898('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xd898('0x6')],'unique':_0xd898('0x9')},'CampaignId':{'type':Sequelize[_0xd898('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd898('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd898('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd898('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd898('0x6')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7ff8=['sequelize','exports','STRING','BOOLEAN','format','INTEGER','DATE','UNSIGNED','contactListQueue'];(function(_0x306ae7,_0x187a48){var _0x3b8368=function(_0x2838fb){while(--_0x2838fb){_0x306ae7['push'](_0x306ae7['shift']());}};_0x3b8368(++_0x187a48);}(_0x7ff8,0x117));var _0x87ff=function(_0x142ec2,_0x5bb03d){_0x142ec2=_0x142ec2-0x0;var _0x45ef4e=_0x7ff8[_0x142ec2];return _0x45ef4e;};'use strict';var moment=require('moment');var Sequelize=require(_0x87ff('0x0'));module[_0x87ff('0x1')]={'phone':{'type':Sequelize[_0x87ff('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x87ff('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x87ff('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x87ff('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x87ff('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x87ff('0x6')]},'priority':{'type':Sequelize[_0x87ff('0x5')](0x2)[_0x87ff('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x87ff('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x87ff('0x5')],'unique':_0x87ff('0x8')},'ListId':{'type':Sequelize[_0x87ff('0x5')],'unique':_0x87ff('0x8')},'UserId':{'type':Sequelize[_0x87ff('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x87ff('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x87ff('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x87ff('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index cb468a7..3536b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77cd=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','CmHopper','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contained','$any','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','find','catch','create','body','describe','VoiceQueueId','CampaignId','Campaign','createdAt','updatedAt','state','statedesc','campaign','membername','user','deletedat','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','YYYY-MM-DD\x20HH:mm:ss','direction','isEmpty','hopperIds','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','format','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x594faa,_0x5d7cca){var _0x25e194=function(_0x49c956){while(--_0x49c956){_0x594faa['push'](_0x594faa['shift']());}};_0x25e194(++_0x5d7cca);}(_0x77cd,0x19e));var _0xd77c=function(_0x84b1fa,_0x255c8a){_0x84b1fa=_0x84b1fa-0x0;var _0x41f994=_0x77cd[_0x84b1fa];return _0x41f994;};'use strict';var emlformat=require(_0xd77c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd77c('0x1'));var jsonpatch=require(_0xd77c('0x2'));var rp=require('request-promise');var moment=require(_0xd77c('0x3'));var BPromise=require(_0xd77c('0x4'));var Mustache=require('mustache');var util=require(_0xd77c('0x5'));var path=require(_0xd77c('0x6'));var sox=require(_0xd77c('0x7'));var csv=require(_0xd77c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd77c('0x9'));var squel=require('squel');var crypto=require(_0xd77c('0xa'));var jsforce=require(_0xd77c('0xb'));var deskjs=require(_0xd77c('0xc'));var toCsv=require(_0xd77c('0x8'));var querystring=require('querystring');var Papa=require(_0xd77c('0xd'));var Redis=require(_0xd77c('0xe'));var authService=require(_0xd77c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd77c('0x10'));var hardwareService=require(_0xd77c('0x11'));var logger=require(_0xd77c('0x12'))(_0xd77c('0x13'));var utils=require(_0xd77c('0x14'));var config=require(_0xd77c('0x15'));var licenseUtil=require(_0xd77c('0x16'));var db=require(_0xd77c('0x17'))['db'];function respondWithStatusCode(_0x1257e4,_0x48a152){_0x48a152=_0x48a152||0xcc;return function(_0x26db58){if(_0x26db58){return _0x1257e4[_0xd77c('0x18')](_0x48a152);}return _0x1257e4[_0xd77c('0x19')](_0x48a152)[_0xd77c('0x1a')]();};}function respondWithResult(_0xf9249b,_0x26fea2){_0x26fea2=_0x26fea2||0xc8;return function(_0x2a188b){if(_0x2a188b){return _0xf9249b[_0xd77c('0x19')](_0x26fea2)[_0xd77c('0x1b')](_0x2a188b);}};}function respondWithFilteredResult(_0x2467b4,_0x37f481){return function(_0x40a614){if(_0x40a614){var _0x26c469=typeof _0x37f481['offset']==='undefined'&&typeof _0x37f481[_0xd77c('0x1c')]===_0xd77c('0x1d');var _0x556a2d=_0x40a614[_0xd77c('0x1e')];var _0x143220=_0x26c469?0x0:_0x37f481[_0xd77c('0x1f')];var _0x3616aa=_0x26c469?_0x40a614['count']:_0x37f481[_0xd77c('0x1f')]+_0x37f481['limit'];var _0x2a4cf6;if(_0x3616aa>=_0x556a2d){_0x3616aa=_0x556a2d;_0x2a4cf6=0xc8;}else{_0x2a4cf6=0xce;}_0x2467b4[_0xd77c('0x19')](_0x2a4cf6);return _0x2467b4['set'](_0xd77c('0x20'),_0x143220+'-'+_0x3616aa+'/'+_0x556a2d)['json'](_0x40a614);}return null;};}function patchUpdates(_0x4d3a49){return function(_0x3a3b9b){try{jsonpatch[_0xd77c('0x21')](_0x3a3b9b,_0x4d3a49,!![]);}catch(_0x36b549){return BPromise[_0xd77c('0x22')](_0x36b549);}return _0x3a3b9b[_0xd77c('0x23')]();};}function saveUpdates(_0x313205,_0x1f37ca){return function(_0x15514e){if(_0x15514e){return _0x15514e[_0xd77c('0x24')](_0x313205)[_0xd77c('0x25')](function(_0x20afc1){return _0x20afc1;});}return null;};}function removeEntity(_0x47576f,_0x2b49db){return function(_0xbf8a60){if(_0xbf8a60){return _0xbf8a60[_0xd77c('0x26')]()['then'](function(){_0x47576f[_0xd77c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe814fa,_0x2a2b7e){return function(_0x370410){if(!_0x370410){_0xe814fa[_0xd77c('0x18')](0x194);}return _0x370410;};}function handleError(_0x49169a,_0x6abb3f){_0x6abb3f=_0x6abb3f||0x1f4;return function(_0xa77378){logger[_0xd77c('0x27')](_0xa77378[_0xd77c('0x28')]);if(_0xa77378['name']){delete _0xa77378[_0xd77c('0x29')];}_0x49169a['status'](_0x6abb3f)[_0xd77c('0x2a')](_0xa77378);};}exports['index']=function(_0x4a037b,_0x377464){var _0x2fc73b={},_0x5a7a5c={},_0x1b3c63={'count':0x0,'rows':[]};var _0x1b332a=_['map'](db[_0xd77c('0x2b')][_0xd77c('0x2c')],function(_0x5384b7){return{'name':_0x5384b7[_0xd77c('0x2d')],'type':_0x5384b7[_0xd77c('0x2e')][_0xd77c('0x2f')]};});_0x5a7a5c[_0xd77c('0x30')]=_[_0xd77c('0x31')](_0x1b332a,_0xd77c('0x29'));_0x5a7a5c[_0xd77c('0x32')]=_[_0xd77c('0x33')](_0x4a037b[_0xd77c('0x32')]);_0x5a7a5c['filters']=_[_0xd77c('0x34')](_0x5a7a5c[_0xd77c('0x30')],_0x5a7a5c[_0xd77c('0x32')]);_0x5a7a5c[_0xd77c('0x35')]=_['concat'](_0x5a7a5c[_0xd77c('0x35')],[_0xd77c('0x36'),_0xd77c('0x37'),_0xd77c('0x38'),_0xd77c('0x39'),_0xd77c('0x3a'),_0xd77c('0x3b'),_0xd77c('0x3c'),_0xd77c('0x3d'),_0xd77c('0x3e'),'$between',_0xd77c('0x3f'),_0xd77c('0x40'),_0xd77c('0x41'),_0xd77c('0x42'),'$notLike',_0xd77c('0x43'),_0xd77c('0x44'),_0xd77c('0x42'),_0xd77c('0x45'),'$contains',_0xd77c('0x46'),_0xd77c('0x47')]);_0x2fc73b['attributes']=_[_0xd77c('0x34')](_0x5a7a5c[_0xd77c('0x30')],qs[_0xd77c('0x48')](_0x4a037b['query'][_0xd77c('0x48')]));_0x2fc73b[_0xd77c('0x49')]=_0x2fc73b['attributes'][_0xd77c('0x4a')]?_0x2fc73b['attributes']:_0x5a7a5c['model'];if(!_0x4a037b['query'][_0xd77c('0x4b')]('nolimit')){_0x2fc73b[_0xd77c('0x1c')]=qs[_0xd77c('0x1c')](_0x4a037b[_0xd77c('0x32')][_0xd77c('0x1c')]);_0x2fc73b[_0xd77c('0x1f')]=qs[_0xd77c('0x1f')](_0x4a037b[_0xd77c('0x32')][_0xd77c('0x1f')]);}_0x2fc73b[_0xd77c('0x4c')]=qs['sort'](_0x4a037b[_0xd77c('0x32')][_0xd77c('0x4d')]);_0x2fc73b['where']=qs[_0xd77c('0x35')](_[_0xd77c('0x4e')](_0x4a037b['query'],_0x5a7a5c[_0xd77c('0x35')]),_0x1b332a);if(_0x4a037b[_0xd77c('0x32')][_0xd77c('0x4f')]){_0x2fc73b[_0xd77c('0x50')]=_[_0xd77c('0x51')](_0x2fc73b[_0xd77c('0x50')],{'$or':_['map'](_0x1b332a,function(_0x3f9687){if(_0x3f9687[_0xd77c('0x2e')]!==_0xd77c('0x52')){var _0x3c2341={};_0x3c2341[_0x3f9687[_0xd77c('0x29')]]={'$like':'%'+_0x4a037b[_0xd77c('0x32')][_0xd77c('0x4f')]+'%'};return _0x3c2341;}})});}_0x2fc73b=_[_0xd77c('0x51')]({},_0x2fc73b,_0x4a037b[_0xd77c('0x53')]);var _0x5da698={'where':_0x2fc73b[_0xd77c('0x50')]};return db[_0xd77c('0x2b')][_0xd77c('0x1e')](_0x5da698)[_0xd77c('0x25')](function(_0x29061f){_0x1b3c63[_0xd77c('0x1e')]=_0x29061f;if(_0x4a037b['query'][_0xd77c('0x54')]){_0x2fc73b[_0xd77c('0x55')]=[{'all':!![]}];}return db[_0xd77c('0x2b')]['findAll'](_0x2fc73b);})[_0xd77c('0x25')](function(_0x567314){_0x1b3c63[_0xd77c('0x56')]=_0x567314;return _0x1b3c63;})[_0xd77c('0x25')](respondWithFilteredResult(_0x377464,_0x2fc73b))['catch'](handleError(_0x377464,null));};exports['show']=function(_0x5a3db3,_0x1210c2){var _0x3987ba={'raw':!![],'where':{'id':_0x5a3db3['params']['id']}},_0x47e742={};_0x47e742[_0xd77c('0x30')]=_[_0xd77c('0x33')](db[_0xd77c('0x2b')][_0xd77c('0x2c')]);_0x47e742[_0xd77c('0x32')]=_['keys'](_0x5a3db3[_0xd77c('0x32')]);_0x47e742[_0xd77c('0x35')]=_[_0xd77c('0x34')](_0x47e742['model'],_0x47e742[_0xd77c('0x32')]);_0x3987ba[_0xd77c('0x49')]=_['intersection'](_0x47e742[_0xd77c('0x30')],qs['fields'](_0x5a3db3[_0xd77c('0x32')][_0xd77c('0x48')]));_0x3987ba[_0xd77c('0x49')]=_0x3987ba[_0xd77c('0x49')]['length']?_0x3987ba['attributes']:_0x47e742[_0xd77c('0x30')];if(_0x5a3db3[_0xd77c('0x32')][_0xd77c('0x54')]){_0x3987ba['include']=[{'all':!![]}];}_0x3987ba=_[_0xd77c('0x51')]({},_0x3987ba,_0x5a3db3[_0xd77c('0x53')]);return db[_0xd77c('0x2b')][_0xd77c('0x57')](_0x3987ba)[_0xd77c('0x25')](handleEntityNotFound(_0x1210c2,null))[_0xd77c('0x25')](respondWithResult(_0x1210c2,null))[_0xd77c('0x58')](handleError(_0x1210c2,null));};exports[_0xd77c('0x59')]=function(_0x532d84,_0x30c03a){return db[_0xd77c('0x2b')]['create'](_0x532d84[_0xd77c('0x5a')],{})[_0xd77c('0x25')](respondWithResult(_0x30c03a,0xc9))[_0xd77c('0x58')](handleError(_0x30c03a,null));};exports[_0xd77c('0x24')]=function(_0x4afa4d,_0x197340){if(_0x4afa4d['body']['id']){delete _0x4afa4d[_0xd77c('0x5a')]['id'];}return db[_0xd77c('0x2b')][_0xd77c('0x57')]({'where':{'id':_0x4afa4d['params']['id']}})[_0xd77c('0x25')](handleEntityNotFound(_0x197340,null))['then'](saveUpdates(_0x4afa4d['body'],null))[_0xd77c('0x25')](respondWithResult(_0x197340,null))[_0xd77c('0x58')](handleError(_0x197340,null));};exports[_0xd77c('0x5b')]=function(_0x528958,_0x362732){return db[_0xd77c('0x2b')][_0xd77c('0x5b')]()['then'](respondWithResult(_0x362732,null))[_0xd77c('0x58')](handleError(_0x362732,null));};exports[_0xd77c('0x26')]=function(_0x3da81d,_0x1657df){var _0x222da7;return db[_0xd77c('0x2b')][_0xd77c('0x57')]({'where':{'id':_0x3da81d['params']['id']}})[_0xd77c('0x25')](handleEntityNotFound(_0x1657df,null))['then'](function(_0x3ba325){if(_0x3ba325){return _0x3ba325['destroy']()[_0xd77c('0x25')](function(_0x54b7b7){return _0x54b7b7;});}})[_0xd77c('0x25')](function(_0x46d4bb){_0x222da7=_0x46d4bb;if(_0x46d4bb){if(_0x46d4bb[_0xd77c('0x5c')]||_0x46d4bb[_0xd77c('0x5d')]){return db[_0x46d4bb['VoiceQueueId']?'VoiceQueue':_0xd77c('0x5e')][_0xd77c('0x57')]({'where':{'id':_0x46d4bb['VoiceQueueId']?_0x46d4bb['VoiceQueueId']:_0x46d4bb[_0xd77c('0x5d')]},'attributes':['id',_0xd77c('0x29')],'raw':!![]});}}})[_0xd77c('0x25')](function(_0x44d3ad){var _0x8277db={};if(_0x44d3ad){_[_0xd77c('0x51')](_0x8277db,_['omit'](_0x222da7['dataValues'],[_0xd77c('0x5f'),_0xd77c('0x60'),'id']));_0x8277db[_0xd77c('0x61')]=0x15;_0x8277db[_0xd77c('0x62')]='deleted';_0x8277db[_0xd77c('0x63')]=_0x44d3ad['name'];_0x8277db[_0xd77c('0x64')]=_0x3da81d[_0xd77c('0x65')]['name'];_0x8277db['UserId']=_0x3da81d['user']['id'];_0x8277db['deleted']=!![];_0x8277db[_0xd77c('0x66')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x8277db['calleridnum']=_0x222da7[_0xd77c('0x67')];_0x8277db[_0xd77c('0x68')]=_0x222da7['VoiceQueueId']?_0xd77c('0x69'):_0xd77c('0x6a');return db[_0xd77c('0x6b')][_0xd77c('0x57')]({'where':{'id':_0x8277db[_0xd77c('0x6c')]},'attributes':[_0xd77c('0x6d'),'lastName']})[_0xd77c('0x25')](function(_0x37cafb){if(!_[_0xd77c('0x6e')](_0x1657df)&&!_[_0xd77c('0x6e')](_0x37cafb['firstName'])){_0x8277db[_0xd77c('0x6f')]=_0x37cafb[_0xd77c('0x6d')];if(!_['isNil'](_0x37cafb[_0xd77c('0x70')])){_0x8277db['calleridname']+='\x20'+_0x37cafb[_0xd77c('0x70')];}}})[_0xd77c('0x71')](function(){return db['CmHopperFinal'][_0xd77c('0x59')](_0x8277db);});}})[_0xd77c('0x25')](function(){return _0x1657df[_0xd77c('0x19')](0xcc)['end']();})[_0xd77c('0x58')](handleError(_0x1657df,null));};exports[_0xd77c('0x72')]=function(_0xb0ba86,_0x190bfc,_0x39d83f){var _0x3dc755=[];return db[_0xd77c('0x6b')][_0xd77c('0x5b')]()['then'](function(_0x4f682b){_0x3dc755=_[_0xd77c('0x33')](_0x4f682b);return _0xb0ba86[_0xd77c('0x65')][_0xd77c('0x73')]({'where':{'type':_0xd77c('0x74'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xd77c('0x75')],'raw':!![]});})[_0xd77c('0x25')](function(_0x455431){if(_0x455431&&_0x455431[_0xd77c('0x4a')]){return db[_0xd77c('0x76')]['transaction'](function(_0x1e8a0f){var _0x133566={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xd77c('0x77'))},'VoiceQueueId':{'$in':_['map'](_0x455431,'id')},'$or':[{'UserId':null},{'UserId':_0xb0ba86[_0xd77c('0x65')]['id']}]};var _0x497cb5=[];if(_0xb0ba86[_0xd77c('0x5a')][_0xd77c('0x78')]&&_0xb0ba86[_0xd77c('0x5a')][_0xd77c('0x78')]==='prev'){if(!_[_0xd77c('0x79')](_0xb0ba86[_0xd77c('0x5a')][_0xd77c('0x7a')])){_0x133566['id']={'$in':_0xb0ba86[_0xd77c('0x5a')][_0xd77c('0x7a')]};}_0x497cb5=[['priority',_0xd77c('0x7b')],[_0xd77c('0x7c'),_0x455431[0x0][_0xd77c('0x75')]===_0xd77c('0x7b')?_0xd77c('0x7d'):_0xd77c('0x7b')],db['sequelize']['literal'](_0xd77c('0x7e')),['id',_0xd77c('0x7d')]];}else{if(!_[_0xd77c('0x79')](_0xb0ba86['body'][_0xd77c('0x7a')])){_0x133566['id']={'$notIn':_0xb0ba86[_0xd77c('0x5a')][_0xd77c('0x7a')]};}_0x497cb5=[['priority',_0xd77c('0x7d')],[_0xd77c('0x7c'),_0x455431[0x0][_0xd77c('0x75')]],db[_0xd77c('0x76')]['literal'](_0xd77c('0x7f')),['id',_0xd77c('0x7b')]];}return db[_0xd77c('0x2b')][_0xd77c('0x80')]({'attributes':['id',_0xd77c('0x81')],'where':_0x133566,'order':_0x497cb5,'transaction':_0x1e8a0f,'lock':_0x1e8a0f[_0xd77c('0x82')]['UPDATE'],'include':[{'model':db[_0xd77c('0x6b')],'as':_0xd77c('0x83'),'attributes':_0x3dc755,'include':[{'model':db[_0xd77c('0x84')],'as':_0xd77c('0x85'),'attributes':['id',_0xd77c('0x29')]}]},{'model':db[_0xd77c('0x86')],'as':_0xd77c('0x87'),'attributes':['id',_0xd77c('0x29')]},{'model':db[_0xd77c('0x88')],'as':_0xd77c('0x89'),'attributes':['id',_0xd77c('0x29'),_0xd77c('0x8a')]}]})[_0xd77c('0x25')](function(_0x4ae9bd){if(_0x4ae9bd){return _0x4ae9bd[_0xd77c('0x24')]({'UserId':_0xb0ba86[_0xd77c('0x65')]['id']},{'transaction':_0x1e8a0f});}});});}})[_0xd77c('0x25')](handleEntityNotFound(_0x190bfc,null))[_0xd77c('0x25')](respondWithResult(_0x190bfc,null))['catch'](handleError(_0x190bfc,null));};exports[_0xd77c('0x8b')]=function(_0x34d5b4,_0x519e47,_0x5bc798){return _0x34d5b4[_0xd77c('0x65')][_0xd77c('0x73')]({'where':{'type':_0xd77c('0x74'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xd77c('0x25')](function(_0x1fd276){if(_0x1fd276&&_0x1fd276[_0xd77c('0x4a')]){return db[_0xd77c('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd77c('0x8c')](_0xd77c('0x77'))},'VoiceQueueId':{'$in':_['map'](_0x1fd276,'id')},'$or':[{'UserId':null},{'UserId':_0x34d5b4['user']['id']}]}});}return 0x0;})[_0xd77c('0x25')](function(_0x23c99){if(!_[_0xd77c('0x6e')](_0x23c99)&&_[_0xd77c('0x8d')](_0x23c99)){return _0x519e47[_0xd77c('0x19')](0xc8)[_0xd77c('0x1b')]({'contacts':_0x23c99});}else{logger['error'](_0xd77c('0x8e'),_0xd77c('0x8b'),0x194,_0xd77c('0x8f'));_0x519e47[_0xd77c('0x18')](0x194);}})[_0xd77c('0x58')](handleError(_0x519e47,null));};
\ No newline at end of file
+var _0x3fdb=['create','body','describe','VoiceQueueId','CampaignId','dataValues','createdAt','state','deleted','campaign','membername','user','UserId','deletedat','format','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','calleridname','isNil','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','Contact','Company','List','getOpenContacts','isNumber','error','entity\x20not\x20found','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','map','CmHopper','rawAttributes','type','key','model','query','keys','filters','intersection','concat','$or','$gte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$overlap','$contains','$any','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','find'];(function(_0x37e7a4,_0xb7a496){var _0x269b2a=function(_0x19ee3f){while(--_0x19ee3f){_0x37e7a4['push'](_0x37e7a4['shift']());}};_0x269b2a(++_0xb7a496);}(_0x3fdb,0x135));var _0xb3fd=function(_0x1dc7a8,_0x4cc139){_0x1dc7a8=_0x1dc7a8-0x0;var _0x462378=_0x3fdb[_0x1dc7a8];return _0x462378;};'use strict';var emlformat=require(_0xb3fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3fd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb3fd('0x2'));var moment=require(_0xb3fd('0x3'));var BPromise=require(_0xb3fd('0x4'));var Mustache=require(_0xb3fd('0x5'));var util=require('util');var path=require(_0xb3fd('0x6'));var sox=require(_0xb3fd('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb3fd('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb3fd('0x9'));var deskjs=require(_0xb3fd('0xa'));var toCsv=require(_0xb3fd('0xb'));var querystring=require(_0xb3fd('0xc'));var Papa=require(_0xb3fd('0xd'));var Redis=require(_0xb3fd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb3fd('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb3fd('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb3fd('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c3d7a,_0x404ac0){_0x404ac0=_0x404ac0||0xcc;return function(_0x1128d3){if(_0x1128d3){return _0x4c3d7a['sendStatus'](_0x404ac0);}return _0x4c3d7a[_0xb3fd('0x12')](_0x404ac0)[_0xb3fd('0x13')]();};}function respondWithResult(_0x49902a,_0x328876){_0x328876=_0x328876||0xc8;return function(_0x10be69){if(_0x10be69){return _0x49902a['status'](_0x328876)[_0xb3fd('0x14')](_0x10be69);}};}function respondWithFilteredResult(_0x13f26c,_0x5ecf31){return function(_0x53f61d){if(_0x53f61d){var _0x4c324c=typeof _0x5ecf31[_0xb3fd('0x15')]==='undefined'&&typeof _0x5ecf31['limit']===_0xb3fd('0x16');var _0x12ef09=_0x53f61d[_0xb3fd('0x17')];var _0x2473e1=_0x4c324c?0x0:_0x5ecf31[_0xb3fd('0x15')];var _0x4dfa31=_0x4c324c?_0x53f61d[_0xb3fd('0x17')]:_0x5ecf31[_0xb3fd('0x15')]+_0x5ecf31[_0xb3fd('0x18')];var _0x119a3b;if(_0x4dfa31>=_0x12ef09){_0x4dfa31=_0x12ef09;_0x119a3b=0xc8;}else{_0x119a3b=0xce;}_0x13f26c['status'](_0x119a3b);return _0x13f26c[_0xb3fd('0x19')](_0xb3fd('0x1a'),_0x2473e1+'-'+_0x4dfa31+'/'+_0x12ef09)[_0xb3fd('0x14')](_0x53f61d);}return null;};}function patchUpdates(_0x5d60d8){return function(_0x1014ca){try{jsonpatch['apply'](_0x1014ca,_0x5d60d8,!![]);}catch(_0x53b970){return BPromise[_0xb3fd('0x1b')](_0x53b970);}return _0x1014ca[_0xb3fd('0x1c')]();};}function saveUpdates(_0x1fb2de,_0x56420f){return function(_0x34b3c4){if(_0x34b3c4){return _0x34b3c4[_0xb3fd('0x1d')](_0x1fb2de)['then'](function(_0x4cbcf9){return _0x4cbcf9;});}return null;};}function removeEntity(_0x2c11ee,_0x22e59c){return function(_0x3a05dd){if(_0x3a05dd){return _0x3a05dd[_0xb3fd('0x1e')]()[_0xb3fd('0x1f')](function(){_0x2c11ee[_0xb3fd('0x12')](0xcc)[_0xb3fd('0x13')]();});}};}function handleEntityNotFound(_0x2aad96,_0x53d42c){return function(_0x10931e){if(!_0x10931e){_0x2aad96[_0xb3fd('0x20')](0x194);}return _0x10931e;};}function handleError(_0x5c8f8e,_0x31dd0d){_0x31dd0d=_0x31dd0d||0x1f4;return function(_0x585a6e){logger['error'](_0x585a6e[_0xb3fd('0x21')]);if(_0x585a6e[_0xb3fd('0x22')]){delete _0x585a6e[_0xb3fd('0x22')];}_0x5c8f8e[_0xb3fd('0x12')](_0x31dd0d)[_0xb3fd('0x23')](_0x585a6e);};}exports['index']=function(_0x27a0d8,_0x2cc5c2){var _0xe15b34={},_0x581d09={},_0xbcc2e1={'count':0x0,'rows':[]};var _0x48641a=_[_0xb3fd('0x24')](db[_0xb3fd('0x25')][_0xb3fd('0x26')],function(_0x158635){return{'name':_0x158635['fieldName'],'type':_0x158635[_0xb3fd('0x27')][_0xb3fd('0x28')]};});_0x581d09[_0xb3fd('0x29')]=_[_0xb3fd('0x24')](_0x48641a,_0xb3fd('0x22'));_0x581d09[_0xb3fd('0x2a')]=_[_0xb3fd('0x2b')](_0x27a0d8[_0xb3fd('0x2a')]);_0x581d09[_0xb3fd('0x2c')]=_[_0xb3fd('0x2d')](_0x581d09[_0xb3fd('0x29')],_0x581d09['query']);_0x581d09['filters']=_[_0xb3fd('0x2e')](_0x581d09['filters'],['$and',_0xb3fd('0x2f'),'$gt',_0xb3fd('0x30'),'$lt','$lte',_0xb3fd('0x31'),_0xb3fd('0x32'),_0xb3fd('0x33'),_0xb3fd('0x34'),_0xb3fd('0x35'),_0xb3fd('0x36'),_0xb3fd('0x37'),'$like',_0xb3fd('0x38'),'$iLike','$notILike','$like',_0xb3fd('0x39'),_0xb3fd('0x3a'),'$contained',_0xb3fd('0x3b')]);_0xe15b34[_0xb3fd('0x3c')]=_[_0xb3fd('0x2d')](_0x581d09[_0xb3fd('0x29')],qs[_0xb3fd('0x3d')](_0x27a0d8[_0xb3fd('0x2a')][_0xb3fd('0x3d')]));_0xe15b34[_0xb3fd('0x3c')]=_0xe15b34[_0xb3fd('0x3c')][_0xb3fd('0x3e')]?_0xe15b34[_0xb3fd('0x3c')]:_0x581d09[_0xb3fd('0x29')];if(!_0x27a0d8['query']['hasOwnProperty'](_0xb3fd('0x3f'))){_0xe15b34[_0xb3fd('0x18')]=qs['limit'](_0x27a0d8['query'][_0xb3fd('0x18')]);_0xe15b34[_0xb3fd('0x15')]=qs[_0xb3fd('0x15')](_0x27a0d8['query']['offset']);}_0xe15b34[_0xb3fd('0x40')]=qs['sort'](_0x27a0d8[_0xb3fd('0x2a')][_0xb3fd('0x41')]);_0xe15b34[_0xb3fd('0x42')]=qs[_0xb3fd('0x2c')](_[_0xb3fd('0x43')](_0x27a0d8[_0xb3fd('0x2a')],_0x581d09[_0xb3fd('0x2c')]),_0x48641a);if(_0x27a0d8[_0xb3fd('0x2a')]['filter']){_0xe15b34[_0xb3fd('0x42')]=_[_0xb3fd('0x44')](_0xe15b34[_0xb3fd('0x42')],{'$or':_[_0xb3fd('0x24')](_0x48641a,function(_0x34427c){if(_0x34427c[_0xb3fd('0x27')]!==_0xb3fd('0x45')){var _0x46e4e4={};_0x46e4e4[_0x34427c['name']]={'$like':'%'+_0x27a0d8[_0xb3fd('0x2a')][_0xb3fd('0x46')]+'%'};return _0x46e4e4;}})});}_0xe15b34=_['merge']({},_0xe15b34,_0x27a0d8[_0xb3fd('0x47')]);var _0x165a46={'where':_0xe15b34['where']};return db[_0xb3fd('0x25')]['count'](_0x165a46)['then'](function(_0x405c85){_0xbcc2e1['count']=_0x405c85;if(_0x27a0d8[_0xb3fd('0x2a')]['includeAll']){_0xe15b34[_0xb3fd('0x48')]=[{'all':!![]}];}return db[_0xb3fd('0x25')][_0xb3fd('0x49')](_0xe15b34);})[_0xb3fd('0x1f')](function(_0xdb15b5){_0xbcc2e1[_0xb3fd('0x4a')]=_0xdb15b5;return _0xbcc2e1;})[_0xb3fd('0x1f')](respondWithFilteredResult(_0x2cc5c2,_0xe15b34))[_0xb3fd('0x4b')](handleError(_0x2cc5c2,null));};exports['show']=function(_0xc78648,_0x4dca03){var _0x486de4={'raw':!![],'where':{'id':_0xc78648[_0xb3fd('0x4c')]['id']}},_0x4a58a6={};_0x4a58a6[_0xb3fd('0x29')]=_[_0xb3fd('0x2b')](db[_0xb3fd('0x25')]['rawAttributes']);_0x4a58a6[_0xb3fd('0x2a')]=_['keys'](_0xc78648[_0xb3fd('0x2a')]);_0x4a58a6[_0xb3fd('0x2c')]=_[_0xb3fd('0x2d')](_0x4a58a6['model'],_0x4a58a6[_0xb3fd('0x2a')]);_0x486de4['attributes']=_['intersection'](_0x4a58a6[_0xb3fd('0x29')],qs[_0xb3fd('0x3d')](_0xc78648[_0xb3fd('0x2a')][_0xb3fd('0x3d')]));_0x486de4['attributes']=_0x486de4[_0xb3fd('0x3c')][_0xb3fd('0x3e')]?_0x486de4['attributes']:_0x4a58a6[_0xb3fd('0x29')];if(_0xc78648[_0xb3fd('0x2a')]['includeAll']){_0x486de4[_0xb3fd('0x48')]=[{'all':!![]}];}_0x486de4=_['merge']({},_0x486de4,_0xc78648[_0xb3fd('0x47')]);return db['CmHopper'][_0xb3fd('0x4d')](_0x486de4)[_0xb3fd('0x1f')](handleEntityNotFound(_0x4dca03,null))[_0xb3fd('0x1f')](respondWithResult(_0x4dca03,null))[_0xb3fd('0x4b')](handleError(_0x4dca03,null));};exports[_0xb3fd('0x4e')]=function(_0x4650db,_0x4d7169){return db['CmHopper'][_0xb3fd('0x4e')](_0x4650db[_0xb3fd('0x4f')],{})[_0xb3fd('0x1f')](respondWithResult(_0x4d7169,0xc9))[_0xb3fd('0x4b')](handleError(_0x4d7169,null));};exports['update']=function(_0x299dcf,_0x440b4c){if(_0x299dcf['body']['id']){delete _0x299dcf['body']['id'];}return db[_0xb3fd('0x25')]['find']({'where':{'id':_0x299dcf['params']['id']}})[_0xb3fd('0x1f')](handleEntityNotFound(_0x440b4c,null))[_0xb3fd('0x1f')](saveUpdates(_0x299dcf[_0xb3fd('0x4f')],null))[_0xb3fd('0x1f')](respondWithResult(_0x440b4c,null))[_0xb3fd('0x4b')](handleError(_0x440b4c,null));};exports[_0xb3fd('0x50')]=function(_0x17c9b6,_0x596960){return db['CmHopper'][_0xb3fd('0x50')]()[_0xb3fd('0x1f')](respondWithResult(_0x596960,null))[_0xb3fd('0x4b')](handleError(_0x596960,null));};exports[_0xb3fd('0x1e')]=function(_0x372173,_0xeabb10){var _0x1871d0;return db['CmHopper']['find']({'where':{'id':_0x372173[_0xb3fd('0x4c')]['id']}})[_0xb3fd('0x1f')](handleEntityNotFound(_0xeabb10,null))[_0xb3fd('0x1f')](function(_0x224af8){if(_0x224af8){return _0x224af8[_0xb3fd('0x1e')]()['then'](function(_0x3690b8){return _0x3690b8;});}})[_0xb3fd('0x1f')](function(_0x435984){_0x1871d0=_0x435984;if(_0x435984){if(_0x435984[_0xb3fd('0x51')]||_0x435984['CampaignId']){return db[_0x435984['VoiceQueueId']?'VoiceQueue':'Campaign'][_0xb3fd('0x4d')]({'where':{'id':_0x435984[_0xb3fd('0x51')]?_0x435984[_0xb3fd('0x51')]:_0x435984[_0xb3fd('0x52')]},'attributes':['id','name'],'raw':!![]});}}})[_0xb3fd('0x1f')](function(_0x1a6035){var _0x1c061c={};if(_0x1a6035){_[_0xb3fd('0x44')](_0x1c061c,_['omit'](_0x1871d0[_0xb3fd('0x53')],[_0xb3fd('0x54'),'updatedAt','id']));_0x1c061c[_0xb3fd('0x55')]=0x15;_0x1c061c['statedesc']=_0xb3fd('0x56');_0x1c061c[_0xb3fd('0x57')]=_0x1a6035['name'];_0x1c061c[_0xb3fd('0x58')]=_0x372173[_0xb3fd('0x59')]['name'];_0x1c061c[_0xb3fd('0x5a')]=_0x372173['user']['id'];_0x1c061c[_0xb3fd('0x56')]=!![];_0x1c061c[_0xb3fd('0x5b')]=moment()[_0xb3fd('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c061c['calleridnum']=_0x1871d0[_0xb3fd('0x5d')];_0x1c061c[_0xb3fd('0x5e')]=_0x1871d0['VoiceQueueId']?_0xb3fd('0x5f'):_0xb3fd('0x60');return db[_0xb3fd('0x61')][_0xb3fd('0x4d')]({'where':{'id':_0x1c061c['ContactId']},'attributes':[_0xb3fd('0x62'),_0xb3fd('0x63')]})[_0xb3fd('0x1f')](function(_0x60767e){if(!_['isNil'](_0xeabb10)&&!_['isNil'](_0x60767e[_0xb3fd('0x62')])){_0x1c061c[_0xb3fd('0x64')]=_0x60767e[_0xb3fd('0x62')];if(!_[_0xb3fd('0x65')](_0x60767e[_0xb3fd('0x63')])){_0x1c061c[_0xb3fd('0x64')]+='\x20'+_0x60767e[_0xb3fd('0x63')];}}})['finally'](function(){return db['CmHopperFinal'][_0xb3fd('0x4e')](_0x1c061c);});}})[_0xb3fd('0x1f')](function(){return _0xeabb10[_0xb3fd('0x12')](0xcc)[_0xb3fd('0x13')]();})[_0xb3fd('0x4b')](handleError(_0xeabb10,null));};exports['getPreview']=function(_0x22ff67,_0x1b3787,_0xc9e869){var _0x58e372=[];return db['CmContact']['describe']()[_0xb3fd('0x1f')](function(_0x4d02bf){_0x58e372=_[_0xb3fd('0x2b')](_0x4d02bf);return _0x22ff67['user'][_0xb3fd('0x66')]({'where':{'type':_0xb3fd('0x67'),'dialActive':!![],'dialMethod':_0xb3fd('0x68')},'attributes':['id',_0xb3fd('0x69')],'raw':!![]});})[_0xb3fd('0x1f')](function(_0x3e52bd){if(_0x3e52bd&&_0x3e52bd['length']){return db[_0xb3fd('0x6a')][_0xb3fd('0x6b')](function(_0x3714b7){var _0x1af876={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb3fd('0x5c')](_0xb3fd('0x6c'))},'VoiceQueueId':{'$in':_['map'](_0x3e52bd,'id')},'$or':[{'UserId':null},{'UserId':_0x22ff67['user']['id']}]};var _0x53a86a=[];if(_0x22ff67['body'][_0xb3fd('0x6d')]&&_0x22ff67[_0xb3fd('0x4f')][_0xb3fd('0x6d')]===_0xb3fd('0x6e')){if(!_[_0xb3fd('0x6f')](_0x22ff67[_0xb3fd('0x4f')][_0xb3fd('0x70')])){_0x1af876['id']={'$in':_0x22ff67[_0xb3fd('0x4f')][_0xb3fd('0x70')]};}_0x53a86a=[[_0xb3fd('0x71'),_0xb3fd('0x72')],[_0xb3fd('0x73'),_0x3e52bd[0x0][_0xb3fd('0x69')]===_0xb3fd('0x72')?_0xb3fd('0x74'):_0xb3fd('0x72')],db['sequelize'][_0xb3fd('0x75')](_0xb3fd('0x76')),['id','DESC']];}else{if(!_['isEmpty'](_0x22ff67[_0xb3fd('0x4f')][_0xb3fd('0x70')])){_0x1af876['id']={'$notIn':_0x22ff67[_0xb3fd('0x4f')][_0xb3fd('0x70')]};}_0x53a86a=[['priority',_0xb3fd('0x74')],[_0xb3fd('0x73'),_0x3e52bd[0x0][_0xb3fd('0x69')]],db[_0xb3fd('0x6a')][_0xb3fd('0x75')](_0xb3fd('0x77')),['id',_0xb3fd('0x72')]];}return db[_0xb3fd('0x25')]['findOne']({'attributes':['id',_0xb3fd('0x78')],'where':_0x1af876,'order':_0x53a86a,'transaction':_0x3714b7,'lock':_0x3714b7[_0xb3fd('0x79')]['UPDATE'],'include':[{'model':db[_0xb3fd('0x61')],'as':_0xb3fd('0x7a'),'attributes':_0x58e372,'include':[{'model':db['CmCompany'],'as':_0xb3fd('0x7b'),'attributes':['id',_0xb3fd('0x22')]}]},{'model':db['CmList'],'as':_0xb3fd('0x7c'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name','dialActive']}]})[_0xb3fd('0x1f')](function(_0x4dd07f){if(_0x4dd07f){return _0x4dd07f[_0xb3fd('0x1d')]({'UserId':_0x22ff67[_0xb3fd('0x59')]['id']},{'transaction':_0x3714b7});}});});}})[_0xb3fd('0x1f')](handleEntityNotFound(_0x1b3787,null))[_0xb3fd('0x1f')](respondWithResult(_0x1b3787,null))[_0xb3fd('0x4b')](handleError(_0x1b3787,null));};exports[_0xb3fd('0x7d')]=function(_0x497027,_0x765444,_0x4b4b37){return _0x497027['user'][_0xb3fd('0x66')]({'where':{'type':_0xb3fd('0x67'),'dialActive':!![],'dialMethod':_0xb3fd('0x68')},'attributes':['id'],'raw':!![]})['then'](function(_0x5d9a60){if(_0x5d9a60&&_0x5d9a60[_0xb3fd('0x3e')]){return db[_0xb3fd('0x25')][_0xb3fd('0x17')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb3fd('0x5c')](_0xb3fd('0x6c'))},'VoiceQueueId':{'$in':_[_0xb3fd('0x24')](_0x5d9a60,'id')},'$or':[{'UserId':null},{'UserId':_0x497027[_0xb3fd('0x59')]['id']}]}});}return 0x0;})[_0xb3fd('0x1f')](function(_0x28a247){if(!_['isNil'](_0x28a247)&&_[_0xb3fd('0x7e')](_0x28a247)){return _0x765444[_0xb3fd('0x12')](0xc8)['json']({'contacts':_0x28a247});}else{logger[_0xb3fd('0x7f')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0xb3fd('0x80'));_0x765444[_0xb3fd('0x20')](0x194);}})[_0xb3fd('0x4b')](handleError(_0x765444,null));};
\ No newline at end of file
index 4c887ef..b0a19d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1e7701,_0x13fd0f){var _0x3ab707=function(_0x3c5242){while(--_0x3c5242){_0x1e7701['push'](_0x1e7701['shift']());}};_0x3ab707(++_0x13fd0f);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x19c73e,_0x39d6c9){_0x19c73e=_0x19c73e-0x0;var _0x509e39=_0xbd51[_0x19c73e];return _0x509e39;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('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(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'paranoid':![],'indexes':[{'name':_0x1bd5('0xa'),'fields':[_0x1bd5('0xa')]},{'name':'phone','fields':[_0x1bd5('0xb')]},{'name':'priority','fields':[_0x1bd5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdbf5=['define','CmHopper','cm_hopper','scheduledat','phone','priority','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x28b765,_0x120202){var _0x163624=function(_0x4d7ca1){while(--_0x4d7ca1){_0x28b765['push'](_0x28b765['shift']());}};_0x163624(++_0x120202);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x33d0dc,_0x4040ea){_0x33d0dc=_0x33d0dc-0x0;var _0x403ba3=_0xdbf5[_0x33d0dc];return _0x403ba3;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5dbf('0x1'));var BPromise=require(_0x5dbf('0x2'));var rp=require(_0x5dbf('0x3'));var fs=require('fs');var path=require(_0x5dbf('0x4'));var rimraf=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var attributes=require(_0x5dbf('0x7'));module[_0x5dbf('0x8')]=function(_0x3f8628,_0x3f8222){return _0x3f8628[_0x5dbf('0x9')](_0x5dbf('0xa'),attributes,{'tableName':_0x5dbf('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5dbf('0xc')]},{'name':'phone','fields':[_0x5dbf('0xd')]},{'name':_0x5dbf('0xe'),'fields':[_0x5dbf('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 64dbaf0..6a1bf3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdea4=['jayson/promise','http','request','info','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmHopper,\x20%s,\x20%s','result','catch','GetCmHopper','CmHopper','findAll','options','raw','attributes','include','map','model','then','debug','find','where','ShowCmHopper','create','CreateCmHopper','UpdateCmHopper','update','body','limit','DestroyCmHopper','CmContact','describe','LOCK','UPDATE','name','voicePause','length','UserId','push','includes','GetContactDialer','sequelize','transaction','MoveContactManagedDialer','COUNT','literal','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','all','GetContactRecallMe','GetCmHopperPreview','Contact','keys','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4db4b9,_0x4a0ded){var _0x194751=function(_0x1c9650){while(--_0x1c9650){_0x4db4b9['push'](_0x4db4b9['shift']());}};_0x194751(++_0x4a0ded);}(_0xdea4,0x195));var _0x4dea=function(_0x1cf11a,_0x6a6309){_0x1cf11a=_0x1cf11a-0x0;var _0x586114=_0xdea4[_0x1cf11a];return _0x586114;};'use strict';var _=require(_0x4dea('0x0'));var util=require(_0x4dea('0x1'));var moment=require(_0x4dea('0x2'));var BPromise=require('bluebird');var rs=require(_0x4dea('0x3'));var fs=require('fs');var Redis=require(_0x4dea('0x4'));var db=require(_0x4dea('0x5'))['db'];var utils=require(_0x4dea('0x6'));var logger=require(_0x4dea('0x7'))(_0x4dea('0x8'));var config=require('../../config/environment');var jayson=require(_0x4dea('0x9'));var client=jayson['client'][_0x4dea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x573bf0,_0x39b333,_0x488d27){return new BPromise(function(_0x5ee75a,_0xf77421){return client[_0x4dea('0xb')](_0x573bf0,_0x488d27)['then'](function(_0x6301af){logger[_0x4dea('0xc')]('CmHopper,\x20%s,\x20%s',_0x39b333,'request\x20sent');logger['debug'](_0x4dea('0xd'),_0x39b333,_0x4dea('0xe'),JSON[_0x4dea('0xf')](_0x6301af));if(_0x6301af['error']){if(_0x6301af[_0x4dea('0x10')][_0x4dea('0x11')]===0x1f4){logger[_0x4dea('0x10')]('CmHopper,\x20%s,\x20%s',_0x39b333,_0x6301af[_0x4dea('0x10')]['message']);return _0xf77421(_0x6301af[_0x4dea('0x10')][_0x4dea('0x12')]);}logger[_0x4dea('0x10')](_0x4dea('0x13'),_0x39b333,_0x6301af[_0x4dea('0x10')]['message']);return _0x5ee75a(_0x6301af['error'][_0x4dea('0x12')]);}else{logger[_0x4dea('0xc')]('CmHopper,\x20%s,\x20%s',_0x39b333,_0x4dea('0xe'));_0x5ee75a(_0x6301af[_0x4dea('0x14')]['message']);}})[_0x4dea('0x15')](function(_0x35dca6){logger[_0x4dea('0x10')](_0x4dea('0x13'),_0x39b333,_0x35dca6);_0xf77421(_0x35dca6);});});}exports[_0x4dea('0x16')]=function(_0x8b6ec6){var _0x35be4f=this;return new Promise(function(_0x223405,_0x580625){return db[_0x4dea('0x17')][_0x4dea('0x18')]({'raw':_0x8b6ec6[_0x4dea('0x19')]?_0x8b6ec6[_0x4dea('0x19')][_0x4dea('0x1a')]===undefined?!![]:![]:!![],'where':_0x8b6ec6['options']?_0x8b6ec6['options']['where']||null:null,'attributes':_0x8b6ec6[_0x4dea('0x19')]?_0x8b6ec6[_0x4dea('0x19')][_0x4dea('0x1b')]||null:null,'limit':_0x8b6ec6[_0x4dea('0x19')]?_0x8b6ec6['options']['limit']||null:null,'include':_0x8b6ec6['options']?_0x8b6ec6[_0x4dea('0x19')][_0x4dea('0x1c')]?_[_0x4dea('0x1d')](_0x8b6ec6[_0x4dea('0x19')][_0x4dea('0x1c')],function(_0x216e38){return{'model':db[_0x216e38[_0x4dea('0x1e')]],'as':_0x216e38['as'],'attributes':_0x216e38[_0x4dea('0x1b')],'include':_0x216e38[_0x4dea('0x1c')]?_[_0x4dea('0x1d')](_0x216e38['include'],function(_0x43730f){return{'model':db[_0x43730f[_0x4dea('0x1e')]],'as':_0x43730f['as'],'attributes':_0x43730f[_0x4dea('0x1b')],'include':_0x43730f['include']?_['map'](_0x43730f[_0x4dea('0x1c')],function(_0x366d2b){return{'model':db[_0x366d2b[_0x4dea('0x1e')]],'as':_0x366d2b['as'],'attributes':_0x366d2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x4dea('0x1f')](function(_0xaf0315){logger[_0x4dea('0xc')]('GetCmHopper',_0x8b6ec6);logger[_0x4dea('0x20')](_0x4dea('0x16'),_0x8b6ec6,JSON[_0x4dea('0xf')](_0xaf0315));_0x223405(_0xaf0315);})[_0x4dea('0x15')](function(_0x5842a3){logger[_0x4dea('0x10')](_0x4dea('0x16'),_0x5842a3[_0x4dea('0x12')],_0x8b6ec6);_0x580625(_0x35be4f['error'](0x1f4,_0x5842a3[_0x4dea('0x12')]));});});};exports['ShowCmHopper']=function(_0x4278bb){var _0x2aaddd=this;return new Promise(function(_0x19c6a2,_0x4af831){return db[_0x4dea('0x17')][_0x4dea('0x21')]({'raw':_0x4278bb[_0x4dea('0x19')]?_0x4278bb[_0x4dea('0x19')][_0x4dea('0x1a')]===undefined?!![]:![]:!![],'where':_0x4278bb[_0x4dea('0x19')]?_0x4278bb[_0x4dea('0x19')][_0x4dea('0x22')]||null:null,'attributes':_0x4278bb[_0x4dea('0x19')]?_0x4278bb['options'][_0x4dea('0x1b')]||null:null,'include':_0x4278bb[_0x4dea('0x19')]?_0x4278bb[_0x4dea('0x19')][_0x4dea('0x1c')]?_[_0x4dea('0x1d')](_0x4278bb[_0x4dea('0x19')][_0x4dea('0x1c')],function(_0x3e806a){return{'model':db[_0x3e806a[_0x4dea('0x1e')]],'as':_0x3e806a['as'],'attributes':_0x3e806a[_0x4dea('0x1b')],'include':_0x3e806a['include']?_[_0x4dea('0x1d')](_0x3e806a['include'],function(_0x39431f){return{'model':db[_0x39431f[_0x4dea('0x1e')]],'as':_0x39431f['as'],'attributes':_0x39431f[_0x4dea('0x1b')],'include':_0x39431f[_0x4dea('0x1c')]?_[_0x4dea('0x1d')](_0x39431f['include'],function(_0x4afd4d){return{'model':db[_0x4afd4d[_0x4dea('0x1e')]],'as':_0x4afd4d['as'],'attributes':_0x4afd4d['attributes']};}):[]};}):[]};}):[]:[]})[_0x4dea('0x1f')](function(_0x176f95){logger['info']('ShowCmHopper',_0x4278bb);logger[_0x4dea('0x20')](_0x4dea('0x23'),_0x4278bb,JSON[_0x4dea('0xf')](_0x176f95));_0x19c6a2(_0x176f95);})[_0x4dea('0x15')](function(_0x5230b3){logger['error'](_0x4dea('0x23'),_0x5230b3[_0x4dea('0x12')],_0x4278bb);_0x4af831(_0x2aaddd['error'](0x1f4,_0x5230b3[_0x4dea('0x12')]));});});};exports['CreateCmHopper']=function(_0x18b9cf){var _0x57d039=this;return new Promise(function(_0xac940f,_0x15976c){return db['CmHopper'][_0x4dea('0x24')](_0x18b9cf['body'],{'raw':_0x18b9cf[_0x4dea('0x19')]?_0x18b9cf[_0x4dea('0x19')][_0x4dea('0x1a')]===undefined?!![]:![]:!![]})[_0x4dea('0x1f')](function(_0x578ead){logger['info']('CreateCmHopper',_0x18b9cf);logger[_0x4dea('0x20')]('CreateCmHopper',_0x18b9cf,JSON[_0x4dea('0xf')](_0x578ead));_0xac940f(_0x578ead);})[_0x4dea('0x15')](function(_0x33feac){logger[_0x4dea('0x10')](_0x4dea('0x25'),_0x33feac['message'],_0x18b9cf);_0x15976c(_0x57d039[_0x4dea('0x10')](0x1f4,_0x33feac[_0x4dea('0x12')]));});});};exports[_0x4dea('0x26')]=function(_0x547290){var _0x53c8aa=this;return new Promise(function(_0x4837ad,_0x4e8a73){return db[_0x4dea('0x17')][_0x4dea('0x27')](_0x547290[_0x4dea('0x28')],{'raw':_0x547290[_0x4dea('0x19')]?_0x547290['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x547290[_0x4dea('0x19')]?_0x547290['options']['where']||null:null,'attributes':_0x547290[_0x4dea('0x19')]?_0x547290['options'][_0x4dea('0x1b')]||null:null,'limit':_0x547290[_0x4dea('0x19')]?_0x547290[_0x4dea('0x19')][_0x4dea('0x29')]||null:null})[_0x4dea('0x1f')](function(_0x567513){logger['info'](_0x4dea('0x26'),_0x547290);logger[_0x4dea('0x20')](_0x4dea('0x26'),_0x547290,JSON[_0x4dea('0xf')](_0x567513));_0x4837ad(_0x567513);})[_0x4dea('0x15')](function(_0x58c75f){logger[_0x4dea('0x10')](_0x4dea('0x26'),_0x58c75f[_0x4dea('0x12')],_0x547290);_0x4e8a73(_0x53c8aa[_0x4dea('0x10')](0x1f4,_0x58c75f['message']));});});};exports[_0x4dea('0x2a')]=function(_0x1844f3){var _0x43eef8=this;return new Promise(function(_0x5388c8,_0x227c37){return db['CmHopper']['destroy']({'where':_0x1844f3[_0x4dea('0x19')]?_0x1844f3[_0x4dea('0x19')][_0x4dea('0x22')]||null:null})['then'](function(_0x3af33b){logger[_0x4dea('0xc')](_0x4dea('0x2a'),_0x1844f3);logger[_0x4dea('0x20')](_0x4dea('0x2a'),_0x1844f3,JSON['stringify'](_0x3af33b));_0x5388c8(_0x3af33b);})[_0x4dea('0x15')](function(_0x6f001e){logger[_0x4dea('0x10')](_0x4dea('0x2a'),_0x6f001e[_0x4dea('0x12')],_0x1844f3);_0x227c37(_0x43eef8[_0x4dea('0x10')](0x1f4,_0x6f001e[_0x4dea('0x12')]));});});};exports['GetContactDialer']=function(_0x1358c9){var _0x232c66=this;return new Promise(function(_0x1fd792,_0x5f42f8){return db[_0x4dea('0x2b')][_0x4dea('0x2c')]()[_0x4dea('0x1f')](function(_0x41c2a6){return db['sequelize']['transaction'](function(_0x37c75e){return db[_0x4dea('0x17')][_0x4dea('0x18')]({'where':_0x1358c9[_0x4dea('0x19')]?_0x1358c9['options']['where']||null:null,'attributes':_0x1358c9['options']?_0x1358c9[_0x4dea('0x19')][_0x4dea('0x1b')]||null:null,'limit':_0x1358c9[_0x4dea('0x19')]?_0x1358c9[_0x4dea('0x19')][_0x4dea('0x29')]||null:null,'order':_0x1358c9[_0x4dea('0x19')]?_0x1358c9['options']['order']||null:null,'transaction':_0x37c75e,'lock':_0x37c75e[_0x4dea('0x2d')][_0x4dea('0x2e')],'include':[{'model':db[_0x4dea('0x2b')],'as':'Contact','attributes':_['keys'](_0x41c2a6)},{'model':db['User'],'as':'Agent','attributes':['id',_0x4dea('0x2f'),_0x4dea('0x30')]}]})[_0x4dea('0x1f')](function(_0x2bee43){var _0x3daf21=[];var _0x47c64c=[];for(var _0x4e7e5b=0x0;_0x4e7e5b<_0x2bee43[_0x4dea('0x31')];_0x4e7e5b+=0x1){var _0x25e283=_0x2bee43[_0x4e7e5b][_0x4dea('0x32')];if(_0x25e283===null){_0x3daf21[_0x4dea('0x33')](_0x2bee43[_0x4e7e5b][_0x4dea('0x27')](_0x1358c9[_0x4dea('0x28')],{'transaction':_0x37c75e}));}else if(!_0x47c64c[_0x4dea('0x34')](_0x25e283)){_0x47c64c['push'](_0x25e283);_0x3daf21[_0x4dea('0x33')](_0x2bee43[_0x4e7e5b][_0x4dea('0x27')](_0x1358c9[_0x4dea('0x28')],{'transaction':_0x37c75e}));}}return BPromise['all'](_0x3daf21);});})['then'](function(_0x3aeb37){logger[_0x4dea('0xc')](_0x4dea('0x35'),_0x1358c9);logger[_0x4dea('0x20')](_0x4dea('0x35'),_0x1358c9,JSON[_0x4dea('0xf')](_0x3aeb37));_0x1fd792(_0x3aeb37);})['catch'](function(_0x591e5d){logger[_0x4dea('0x10')]('GetContactDialer',_0x591e5d[_0x4dea('0x12')],_0x1358c9);_0x5f42f8(_0x232c66[_0x4dea('0x10')](0x1f4,_0x591e5d['message']));});});});};exports['MoveContactManagedDialer']=function(_0x4b5888){var _0x54dcac=this;return new Promise(function(_0x2d3ddc,_0x44407b){return db[_0x4dea('0x36')][_0x4dea('0x37')](function(_0x5560fc){return db['CmHopperFinal']['create'](_0x4b5888['body'],{'raw':_0x4b5888['options']?_0x4b5888[_0x4dea('0x19')][_0x4dea('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x5560fc})[_0x4dea('0x1f')](function(){return db[_0x4dea('0x17')]['destroy']({'where':_0x4b5888[_0x4dea('0x19')]?_0x4b5888[_0x4dea('0x19')][_0x4dea('0x22')]||null:null,'transaction':_0x5560fc});});})[_0x4dea('0x1f')](function(_0x59e3b3){logger[_0x4dea('0xc')](_0x4dea('0x38'),_0x4b5888);logger[_0x4dea('0x20')](_0x4dea('0x38'),_0x4b5888,JSON[_0x4dea('0xf')](_0x59e3b3));_0x2d3ddc(_0x59e3b3);})[_0x4dea('0x15')](function(_0x5e24d5){logger['error']('MoveContactManagedDialer',_0x5e24d5['message'],_0x4b5888);_0x44407b(_0x54dcac[_0x4dea('0x10')](0x1f4,_0x5e24d5[_0x4dea('0x12')]));});});};exports['CountReScheduled']=function(_0x28168b){var _0x459567=this;return new Promise(function(_0x148998,_0x4bb1e4){return db['CmHopper'][_0x4dea('0x18')]({'raw':_0x28168b['options']?_0x28168b['options'][_0x4dea('0x1a')]===undefined?!![]:![]:!![],'where':_0x28168b[_0x4dea('0x19')]?_0x28168b[_0x4dea('0x19')]['where']||null:null,'attributes':[[db[_0x4dea('0x36')]['fn'](_0x4dea('0x39'),db['sequelize']['fn']('IF',db[_0x4dea('0x36')][_0x4dea('0x3a')]('`scheduledat`\x20>=\x20'+util['format'](_0x4dea('0x3b'),moment()[_0x4dea('0x3c')](_0x4dea('0x3d')))+'\x20,\x201,\x20null'))),_0x4dea('0x3e')]]})[_0x4dea('0x1f')](function(_0x157907){logger[_0x4dea('0xc')](_0x4dea('0x3f'),_0x28168b);logger[_0x4dea('0x20')](_0x4dea('0x3f'),_0x28168b,JSON[_0x4dea('0xf')](_0x157907));_0x148998(_0x157907);})[_0x4dea('0x15')](function(_0x230d6f){logger[_0x4dea('0x10')]('CountReScheduled',_0x230d6f[_0x4dea('0x12')],_0x28168b);_0x4bb1e4(_0x459567[_0x4dea('0x10')](0x1f4,_0x230d6f[_0x4dea('0x12')]));});});};exports['GetContactRecallMe']=function(_0x5ee286){var _0x4e86dc=this;return new Promise(function(_0x4d73d0,_0x38d28a){return db[_0x4dea('0x2b')][_0x4dea('0x2c')]()[_0x4dea('0x1f')](function(_0x2246de){return db[_0x4dea('0x36')][_0x4dea('0x37')](function(_0xc50c89){return db[_0x4dea('0x17')]['findAll']({'where':_0x5ee286['options']?_0x5ee286[_0x4dea('0x19')][_0x4dea('0x22')]||null:null,'attributes':_0x5ee286[_0x4dea('0x19')]?_0x5ee286[_0x4dea('0x19')][_0x4dea('0x1b')]||null:null,'limit':0x1,'order':_0x5ee286[_0x4dea('0x19')]?_0x5ee286[_0x4dea('0x19')]['order']||null:null,'group':db[_0x4dea('0x17')][_0x4dea('0x32')],'transaction':_0xc50c89,'lock':_0xc50c89[_0x4dea('0x2d')]['UPDATE'],'include':_0x5ee286[_0x4dea('0x19')]?_0x5ee286[_0x4dea('0x19')][_0x4dea('0x1c')]?_[_0x4dea('0x1d')](_0x5ee286[_0x4dea('0x19')]['include'],function(_0x5f3162){return{'model':db[_0x5f3162[_0x4dea('0x1e')]],'as':_0x5f3162['as'],'attributes':_0x5f3162[_0x4dea('0x1b')],'include':_0x5f3162[_0x4dea('0x1c')]?_[_0x4dea('0x1d')](_0x5f3162[_0x4dea('0x1c')],function(_0x2b4934){return{'model':db[_0x2b4934[_0x4dea('0x1e')]],'as':_0x2b4934['as'],'attributes':_0x2b4934[_0x4dea('0x1b')],'include':_0x2b4934[_0x4dea('0x1c')]?_[_0x4dea('0x1d')](_0x2b4934[_0x4dea('0x1c')],function(_0x5114e3){return{'model':db[_0x5114e3[_0x4dea('0x1e')]],'as':_0x5114e3['as'],'attributes':_0x5114e3[_0x4dea('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4dea('0x1f')](function(_0x1ece06){var _0x3c53fc=[];for(var _0xa788de=0x0;_0xa788de<_0x1ece06[_0x4dea('0x31')];_0xa788de+=0x1){_0x3c53fc[_0x4dea('0x33')](_0x1ece06[_0xa788de][_0x4dea('0x27')](_0x5ee286['body'],{'transaction':_0xc50c89}));}return BPromise[_0x4dea('0x40')](_0x3c53fc);});})[_0x4dea('0x1f')](function(_0x501131){logger[_0x4dea('0xc')]('GetContactRecallMe',_0x5ee286);logger[_0x4dea('0x20')](_0x4dea('0x41'),_0x5ee286,JSON['stringify'](_0x501131));_0x4d73d0(_0x501131);})[_0x4dea('0x15')](function(_0x4d7a16){logger['error'](_0x4dea('0x41'),_0x4d7a16[_0x4dea('0x12')],_0x5ee286);_0x38d28a(_0x4e86dc[_0x4dea('0x10')](0x1f4,_0x4d7a16[_0x4dea('0x12')]));});});});};exports[_0x4dea('0x42')]=function(_0x5d800a){var _0x4a4d31=this;return new Promise(function(_0x493547,_0x5a8f6d){db[_0x4dea('0x2b')]['describe']()[_0x4dea('0x1f')](function(_0x4a1263){return db[_0x4dea('0x17')][_0x4dea('0x18')]({'raw':_0x5d800a[_0x4dea('0x19')]?_0x5d800a[_0x4dea('0x19')][_0x4dea('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d800a[_0x4dea('0x19')]?_0x5d800a[_0x4dea('0x19')][_0x4dea('0x22')]||null:null,'attributes':_0x5d800a[_0x4dea('0x19')]?_0x5d800a[_0x4dea('0x19')][_0x4dea('0x1b')]||null:null,'limit':_0x5d800a[_0x4dea('0x19')]?_0x5d800a['options'][_0x4dea('0x29')]||null:null,'include':_0x5d800a[_0x4dea('0x19')]?_0x5d800a[_0x4dea('0x19')][_0x4dea('0x1c')]?_[_0x4dea('0x1d')](_0x5d800a[_0x4dea('0x19')][_0x4dea('0x1c')],function(_0x473f3b){return{'model':db[_0x473f3b[_0x4dea('0x1e')]],'as':_0x473f3b['as'],'attributes':_0x473f3b['as']===_0x4dea('0x43')?_[_0x4dea('0x44')](_0x4a1263):_0x473f3b['attributes'],'include':_0x473f3b[_0x4dea('0x1c')]?_[_0x4dea('0x1d')](_0x473f3b[_0x4dea('0x1c')],function(_0xe2afbe){return{'model':db[_0xe2afbe[_0x4dea('0x1e')]],'as':_0xe2afbe['as'],'attributes':_0xe2afbe[_0x4dea('0x1b')],'include':_0xe2afbe[_0x4dea('0x1c')]?_[_0x4dea('0x1d')](_0xe2afbe['include'],function(_0x412e94){return{'model':db[_0x412e94['model']],'as':_0x412e94['as'],'attributes':_0x412e94[_0x4dea('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4dea('0x1f')](function(_0x7c4480){logger['info'](_0x4dea('0x16'),_0x5d800a);logger[_0x4dea('0x20')]('GetCmHopper',_0x5d800a,JSON[_0x4dea('0xf')](_0x7c4480));_0x493547(_0x7c4480);})[_0x4dea('0x15')](function(_0x43ee58){logger['error']('GetCmHopper',_0x43ee58['message'],_0x5d800a);_0x5a8f6d(_0x4a4d31[_0x4dea('0x10')](0x1f4,_0x43ee58[_0x4dea('0x12')]));});});});};
\ No newline at end of file
+var _0xbbb6=['`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UPDATE','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','ShowCmHopper','find','body','CreateCmHopper','debug','UpdateCmHopper','update','limit','DestroyCmHopper','destroy','CmContact','describe','sequelize','LOCK','Contact','keys','User','Agent','name','voicePause','length','push','includes','all','GetContactDialer','transaction','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','literal'];(function(_0x2ed176,_0x1d3e64){var _0x10f61a=function(_0x5339a5){while(--_0x5339a5){_0x2ed176['push'](_0x2ed176['shift']());}};_0x10f61a(++_0x1d3e64);}(_0xbbb6,0x93));var _0x6bbb=function(_0x174d5f,_0x51d876){_0x174d5f=_0x174d5f-0x0;var _0x803d05=_0xbbb6[_0x174d5f];return _0x803d05;};'use strict';var _=require('lodash');var util=require(_0x6bbb('0x0'));var moment=require(_0x6bbb('0x1'));var BPromise=require(_0x6bbb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6bbb('0x3'));var db=require(_0x6bbb('0x4'))['db'];var utils=require(_0x6bbb('0x5'));var logger=require('../../config/logger')(_0x6bbb('0x6'));var config=require('../../config/environment');var jayson=require(_0x6bbb('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbf4a17,_0x3ffb74,_0x5a3355){return new BPromise(function(_0x2c152b,_0x12f33a){return client[_0x6bbb('0x8')](_0xbf4a17,_0x5a3355)['then'](function(_0x32632a){logger[_0x6bbb('0x9')](_0x6bbb('0xa'),_0x3ffb74,_0x6bbb('0xb'));logger['debug'](_0x6bbb('0xc'),_0x3ffb74,_0x6bbb('0xb'),JSON[_0x6bbb('0xd')](_0x32632a));if(_0x32632a[_0x6bbb('0xe')]){if(_0x32632a['error'][_0x6bbb('0xf')]===0x1f4){logger[_0x6bbb('0xe')](_0x6bbb('0xa'),_0x3ffb74,_0x32632a[_0x6bbb('0xe')][_0x6bbb('0x10')]);return _0x12f33a(_0x32632a[_0x6bbb('0xe')][_0x6bbb('0x10')]);}logger[_0x6bbb('0xe')](_0x6bbb('0xa'),_0x3ffb74,_0x32632a[_0x6bbb('0xe')][_0x6bbb('0x10')]);return _0x2c152b(_0x32632a[_0x6bbb('0xe')][_0x6bbb('0x10')]);}else{logger[_0x6bbb('0x9')](_0x6bbb('0xa'),_0x3ffb74,_0x6bbb('0xb'));_0x2c152b(_0x32632a[_0x6bbb('0x11')][_0x6bbb('0x10')]);}})[_0x6bbb('0x12')](function(_0x8ce211){logger[_0x6bbb('0xe')](_0x6bbb('0xa'),_0x3ffb74,_0x8ce211);_0x12f33a(_0x8ce211);});});}exports[_0x6bbb('0x13')]=function(_0x5a4b62){var _0x3ea330=this;return new Promise(function(_0x126a86,_0x16433c){return db[_0x6bbb('0x14')][_0x6bbb('0x15')]({'raw':_0x5a4b62['options']?_0x5a4b62[_0x6bbb('0x16')][_0x6bbb('0x17')]===undefined?!![]:![]:!![],'where':_0x5a4b62[_0x6bbb('0x16')]?_0x5a4b62[_0x6bbb('0x16')][_0x6bbb('0x18')]||null:null,'attributes':_0x5a4b62['options']?_0x5a4b62[_0x6bbb('0x16')][_0x6bbb('0x19')]||null:null,'limit':_0x5a4b62['options']?_0x5a4b62[_0x6bbb('0x16')]['limit']||null:null,'include':_0x5a4b62[_0x6bbb('0x16')]?_0x5a4b62[_0x6bbb('0x16')][_0x6bbb('0x1a')]?_[_0x6bbb('0x1b')](_0x5a4b62[_0x6bbb('0x16')]['include'],function(_0x3fd327){return{'model':db[_0x3fd327[_0x6bbb('0x1c')]],'as':_0x3fd327['as'],'attributes':_0x3fd327[_0x6bbb('0x19')],'include':_0x3fd327[_0x6bbb('0x1a')]?_['map'](_0x3fd327[_0x6bbb('0x1a')],function(_0x25de84){return{'model':db[_0x25de84[_0x6bbb('0x1c')]],'as':_0x25de84['as'],'attributes':_0x25de84[_0x6bbb('0x19')],'include':_0x25de84['include']?_[_0x6bbb('0x1b')](_0x25de84[_0x6bbb('0x1a')],function(_0x3619d2){return{'model':db[_0x3619d2[_0x6bbb('0x1c')]],'as':_0x3619d2['as'],'attributes':_0x3619d2[_0x6bbb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6bbb('0x1d')](function(_0x583236){logger[_0x6bbb('0x9')](_0x6bbb('0x13'),_0x5a4b62);logger['debug'](_0x6bbb('0x13'),_0x5a4b62,JSON[_0x6bbb('0xd')](_0x583236));_0x126a86(_0x583236);})[_0x6bbb('0x12')](function(_0x1322c7){logger['error'](_0x6bbb('0x13'),_0x1322c7[_0x6bbb('0x10')],_0x5a4b62);_0x16433c(_0x3ea330[_0x6bbb('0xe')](0x1f4,_0x1322c7[_0x6bbb('0x10')]));});});};exports[_0x6bbb('0x1e')]=function(_0x48ceb0){var _0x3d969f=this;return new Promise(function(_0x579b9e,_0x19c40c){return db[_0x6bbb('0x14')][_0x6bbb('0x1f')]({'raw':_0x48ceb0[_0x6bbb('0x16')]?_0x48ceb0[_0x6bbb('0x16')][_0x6bbb('0x17')]===undefined?!![]:![]:!![],'where':_0x48ceb0[_0x6bbb('0x16')]?_0x48ceb0[_0x6bbb('0x16')]['where']||null:null,'attributes':_0x48ceb0[_0x6bbb('0x16')]?_0x48ceb0[_0x6bbb('0x16')][_0x6bbb('0x19')]||null:null,'include':_0x48ceb0[_0x6bbb('0x16')]?_0x48ceb0[_0x6bbb('0x16')]['include']?_[_0x6bbb('0x1b')](_0x48ceb0['options']['include'],function(_0xab68da){return{'model':db[_0xab68da['model']],'as':_0xab68da['as'],'attributes':_0xab68da['attributes'],'include':_0xab68da[_0x6bbb('0x1a')]?_[_0x6bbb('0x1b')](_0xab68da[_0x6bbb('0x1a')],function(_0x3bb274){return{'model':db[_0x3bb274[_0x6bbb('0x1c')]],'as':_0x3bb274['as'],'attributes':_0x3bb274['attributes'],'include':_0x3bb274[_0x6bbb('0x1a')]?_[_0x6bbb('0x1b')](_0x3bb274[_0x6bbb('0x1a')],function(_0x1f696b){return{'model':db[_0x1f696b[_0x6bbb('0x1c')]],'as':_0x1f696b['as'],'attributes':_0x1f696b[_0x6bbb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6bbb('0x1d')](function(_0x2b1d24){logger[_0x6bbb('0x9')](_0x6bbb('0x1e'),_0x48ceb0);logger['debug'](_0x6bbb('0x1e'),_0x48ceb0,JSON[_0x6bbb('0xd')](_0x2b1d24));_0x579b9e(_0x2b1d24);})[_0x6bbb('0x12')](function(_0x47f737){logger['error'](_0x6bbb('0x1e'),_0x47f737[_0x6bbb('0x10')],_0x48ceb0);_0x19c40c(_0x3d969f['error'](0x1f4,_0x47f737['message']));});});};exports['CreateCmHopper']=function(_0x19ecc6){var _0x4df69d=this;return new Promise(function(_0x1a10b0,_0x5d322e){return db[_0x6bbb('0x14')]['create'](_0x19ecc6[_0x6bbb('0x20')],{'raw':_0x19ecc6[_0x6bbb('0x16')]?_0x19ecc6[_0x6bbb('0x16')][_0x6bbb('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2121e0){logger[_0x6bbb('0x9')](_0x6bbb('0x21'),_0x19ecc6);logger[_0x6bbb('0x22')]('CreateCmHopper',_0x19ecc6,JSON[_0x6bbb('0xd')](_0x2121e0));_0x1a10b0(_0x2121e0);})[_0x6bbb('0x12')](function(_0x5a6fc7){logger['error'](_0x6bbb('0x21'),_0x5a6fc7['message'],_0x19ecc6);_0x5d322e(_0x4df69d['error'](0x1f4,_0x5a6fc7[_0x6bbb('0x10')]));});});};exports[_0x6bbb('0x23')]=function(_0x34407e){var _0x2e9d27=this;return new Promise(function(_0x5c0ce9,_0x246daf){return db['CmHopper'][_0x6bbb('0x24')](_0x34407e[_0x6bbb('0x20')],{'raw':_0x34407e[_0x6bbb('0x16')]?_0x34407e[_0x6bbb('0x16')][_0x6bbb('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34407e['options']?_0x34407e[_0x6bbb('0x16')]['where']||null:null,'attributes':_0x34407e[_0x6bbb('0x16')]?_0x34407e[_0x6bbb('0x16')]['attributes']||null:null,'limit':_0x34407e[_0x6bbb('0x16')]?_0x34407e['options'][_0x6bbb('0x25')]||null:null})[_0x6bbb('0x1d')](function(_0x5d66e3){logger[_0x6bbb('0x9')](_0x6bbb('0x23'),_0x34407e);logger[_0x6bbb('0x22')]('UpdateCmHopper',_0x34407e,JSON[_0x6bbb('0xd')](_0x5d66e3));_0x5c0ce9(_0x5d66e3);})[_0x6bbb('0x12')](function(_0x2e7aa5){logger['error']('UpdateCmHopper',_0x2e7aa5[_0x6bbb('0x10')],_0x34407e);_0x246daf(_0x2e9d27[_0x6bbb('0xe')](0x1f4,_0x2e7aa5['message']));});});};exports[_0x6bbb('0x26')]=function(_0x54c4df){var _0x7d443f=this;return new Promise(function(_0x373f79,_0x3b674d){return db[_0x6bbb('0x14')][_0x6bbb('0x27')]({'where':_0x54c4df[_0x6bbb('0x16')]?_0x54c4df[_0x6bbb('0x16')][_0x6bbb('0x18')]||null:null})[_0x6bbb('0x1d')](function(_0x229570){logger[_0x6bbb('0x9')](_0x6bbb('0x26'),_0x54c4df);logger[_0x6bbb('0x22')](_0x6bbb('0x26'),_0x54c4df,JSON['stringify'](_0x229570));_0x373f79(_0x229570);})[_0x6bbb('0x12')](function(_0x1bdde2){logger[_0x6bbb('0xe')](_0x6bbb('0x26'),_0x1bdde2['message'],_0x54c4df);_0x3b674d(_0x7d443f[_0x6bbb('0xe')](0x1f4,_0x1bdde2[_0x6bbb('0x10')]));});});};exports['GetContactDialer']=function(_0x26bcd3){var _0x141482=this;return new Promise(function(_0x506312,_0x30f43c){return db[_0x6bbb('0x28')][_0x6bbb('0x29')]()['then'](function(_0x10c776){return db[_0x6bbb('0x2a')]['transaction'](function(_0x571a4c){return db['CmHopper'][_0x6bbb('0x15')]({'where':_0x26bcd3[_0x6bbb('0x16')]?_0x26bcd3[_0x6bbb('0x16')][_0x6bbb('0x18')]||null:null,'attributes':_0x26bcd3[_0x6bbb('0x16')]?_0x26bcd3[_0x6bbb('0x16')][_0x6bbb('0x19')]||null:null,'limit':_0x26bcd3['options']?_0x26bcd3[_0x6bbb('0x16')]['limit']||null:null,'order':_0x26bcd3[_0x6bbb('0x16')]?_0x26bcd3[_0x6bbb('0x16')]['order']||null:null,'transaction':_0x571a4c,'lock':_0x571a4c[_0x6bbb('0x2b')]['UPDATE'],'include':[{'model':db[_0x6bbb('0x28')],'as':_0x6bbb('0x2c'),'attributes':_[_0x6bbb('0x2d')](_0x10c776)},{'model':db[_0x6bbb('0x2e')],'as':_0x6bbb('0x2f'),'attributes':['id',_0x6bbb('0x30'),_0x6bbb('0x31')]}]})['then'](function(_0x53549f){var _0x537f63=[];var _0x2b9caf=[];for(var _0x2ee145=0x0;_0x2ee145<_0x53549f[_0x6bbb('0x32')];_0x2ee145+=0x1){var _0x1ac90a=_0x53549f[_0x2ee145]['UserId'];if(_0x1ac90a===null){_0x537f63[_0x6bbb('0x33')](_0x53549f[_0x2ee145]['update'](_0x26bcd3[_0x6bbb('0x20')],{'transaction':_0x571a4c}));}else if(!_0x2b9caf[_0x6bbb('0x34')](_0x1ac90a)){_0x2b9caf[_0x6bbb('0x33')](_0x1ac90a);_0x537f63[_0x6bbb('0x33')](_0x53549f[_0x2ee145][_0x6bbb('0x24')](_0x26bcd3['body'],{'transaction':_0x571a4c}));}}return BPromise[_0x6bbb('0x35')](_0x537f63);});})['then'](function(_0x5554b4){logger[_0x6bbb('0x9')]('GetContactDialer',_0x26bcd3);logger[_0x6bbb('0x22')](_0x6bbb('0x36'),_0x26bcd3,JSON[_0x6bbb('0xd')](_0x5554b4));_0x506312(_0x5554b4);})[_0x6bbb('0x12')](function(_0xae793d){logger['error']('GetContactDialer',_0xae793d[_0x6bbb('0x10')],_0x26bcd3);_0x30f43c(_0x141482['error'](0x1f4,_0xae793d[_0x6bbb('0x10')]));});});});};exports['MoveContactManagedDialer']=function(_0x35b62){var _0x20e22d=this;return new Promise(function(_0x4772a1,_0xd9f52a){return db[_0x6bbb('0x2a')][_0x6bbb('0x37')](function(_0x49d88e){return db[_0x6bbb('0x38')]['create'](_0x35b62['body'],{'raw':_0x35b62['options']?_0x35b62[_0x6bbb('0x16')][_0x6bbb('0x17')]===undefined?!![]:![]:!![],'transaction':_0x49d88e})[_0x6bbb('0x1d')](function(){return db[_0x6bbb('0x14')]['destroy']({'where':_0x35b62[_0x6bbb('0x16')]?_0x35b62['options'][_0x6bbb('0x18')]||null:null,'transaction':_0x49d88e});});})[_0x6bbb('0x1d')](function(_0x2e0fd9){logger[_0x6bbb('0x9')]('MoveContactManagedDialer',_0x35b62);logger[_0x6bbb('0x22')]('MoveContactManagedDialer',_0x35b62,JSON[_0x6bbb('0xd')](_0x2e0fd9));_0x4772a1(_0x2e0fd9);})[_0x6bbb('0x12')](function(_0x2aad29){logger[_0x6bbb('0xe')](_0x6bbb('0x39'),_0x2aad29['message'],_0x35b62);_0xd9f52a(_0x20e22d[_0x6bbb('0xe')](0x1f4,_0x2aad29[_0x6bbb('0x10')]));});});};exports[_0x6bbb('0x3a')]=function(_0x31f70f){var _0x44e1c6=this;return new Promise(function(_0x4d29a5,_0x403d99){return db['CmHopper'][_0x6bbb('0x15')]({'raw':_0x31f70f[_0x6bbb('0x16')]?_0x31f70f[_0x6bbb('0x16')][_0x6bbb('0x17')]===undefined?!![]:![]:!![],'where':_0x31f70f['options']?_0x31f70f[_0x6bbb('0x16')][_0x6bbb('0x18')]||null:null,'attributes':[[db[_0x6bbb('0x2a')]['fn']('COUNT',db[_0x6bbb('0x2a')]['fn']('IF',db['sequelize'][_0x6bbb('0x3b')](_0x6bbb('0x3c')+util[_0x6bbb('0x3d')](_0x6bbb('0x3e'),moment()[_0x6bbb('0x3d')](_0x6bbb('0x3f')))+_0x6bbb('0x40')))),_0x6bbb('0x41')]]})[_0x6bbb('0x1d')](function(_0x428406){logger['info'](_0x6bbb('0x3a'),_0x31f70f);logger['debug'](_0x6bbb('0x3a'),_0x31f70f,JSON['stringify'](_0x428406));_0x4d29a5(_0x428406);})[_0x6bbb('0x12')](function(_0x52d91c){logger[_0x6bbb('0xe')](_0x6bbb('0x3a'),_0x52d91c[_0x6bbb('0x10')],_0x31f70f);_0x403d99(_0x44e1c6['error'](0x1f4,_0x52d91c['message']));});});};exports[_0x6bbb('0x42')]=function(_0x37e86d){var _0x559d88=this;return new Promise(function(_0x326c58,_0x31fda4){return db[_0x6bbb('0x28')]['describe']()[_0x6bbb('0x1d')](function(_0xd8f294){return db[_0x6bbb('0x2a')][_0x6bbb('0x37')](function(_0x5518ee){return db['CmHopper']['findAll']({'where':_0x37e86d[_0x6bbb('0x16')]?_0x37e86d[_0x6bbb('0x16')][_0x6bbb('0x18')]||null:null,'attributes':_0x37e86d[_0x6bbb('0x16')]?_0x37e86d['options'][_0x6bbb('0x19')]||null:null,'limit':0x1,'order':_0x37e86d['options']?_0x37e86d[_0x6bbb('0x16')][_0x6bbb('0x43')]||null:null,'group':db[_0x6bbb('0x14')]['UserId'],'transaction':_0x5518ee,'lock':_0x5518ee[_0x6bbb('0x2b')][_0x6bbb('0x44')],'include':_0x37e86d[_0x6bbb('0x16')]?_0x37e86d[_0x6bbb('0x16')][_0x6bbb('0x1a')]?_[_0x6bbb('0x1b')](_0x37e86d[_0x6bbb('0x16')][_0x6bbb('0x1a')],function(_0x42f2f1){return{'model':db[_0x42f2f1[_0x6bbb('0x1c')]],'as':_0x42f2f1['as'],'attributes':_0x42f2f1[_0x6bbb('0x19')],'include':_0x42f2f1[_0x6bbb('0x1a')]?_['map'](_0x42f2f1[_0x6bbb('0x1a')],function(_0x5420a5){return{'model':db[_0x5420a5[_0x6bbb('0x1c')]],'as':_0x5420a5['as'],'attributes':_0x5420a5[_0x6bbb('0x19')],'include':_0x5420a5[_0x6bbb('0x1a')]?_[_0x6bbb('0x1b')](_0x5420a5[_0x6bbb('0x1a')],function(_0x6e22a0){return{'model':db[_0x6e22a0[_0x6bbb('0x1c')]],'as':_0x6e22a0['as'],'attributes':_0x6e22a0[_0x6bbb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x6bbb('0x1d')](function(_0x124bce){var _0x4a2095=[];for(var _0x988c72=0x0;_0x988c72<_0x124bce[_0x6bbb('0x32')];_0x988c72+=0x1){_0x4a2095[_0x6bbb('0x33')](_0x124bce[_0x988c72][_0x6bbb('0x24')](_0x37e86d[_0x6bbb('0x20')],{'transaction':_0x5518ee}));}return BPromise[_0x6bbb('0x35')](_0x4a2095);});})['then'](function(_0x4efda6){logger[_0x6bbb('0x9')]('GetContactRecallMe',_0x37e86d);logger[_0x6bbb('0x22')]('GetContactRecallMe',_0x37e86d,JSON[_0x6bbb('0xd')](_0x4efda6));_0x326c58(_0x4efda6);})[_0x6bbb('0x12')](function(_0x37c57a){logger[_0x6bbb('0xe')](_0x6bbb('0x42'),_0x37c57a['message'],_0x37e86d);_0x31fda4(_0x559d88['error'](0x1f4,_0x37c57a[_0x6bbb('0x10')]));});});});};exports['GetCmHopperPreview']=function(_0x51c60d){var _0x46c0d1=this;return new Promise(function(_0x13ab7e,_0x296370){db[_0x6bbb('0x28')]['describe']()[_0x6bbb('0x1d')](function(_0x31bbd2){return db['CmHopper']['findAll']({'raw':_0x51c60d[_0x6bbb('0x16')]?_0x51c60d[_0x6bbb('0x16')][_0x6bbb('0x17')]===undefined?!![]:![]:!![],'where':_0x51c60d[_0x6bbb('0x16')]?_0x51c60d[_0x6bbb('0x16')][_0x6bbb('0x18')]||null:null,'attributes':_0x51c60d[_0x6bbb('0x16')]?_0x51c60d[_0x6bbb('0x16')][_0x6bbb('0x19')]||null:null,'limit':_0x51c60d[_0x6bbb('0x16')]?_0x51c60d[_0x6bbb('0x16')][_0x6bbb('0x25')]||null:null,'include':_0x51c60d['options']?_0x51c60d['options'][_0x6bbb('0x1a')]?_['map'](_0x51c60d[_0x6bbb('0x16')]['include'],function(_0x10c2c0){return{'model':db[_0x10c2c0[_0x6bbb('0x1c')]],'as':_0x10c2c0['as'],'attributes':_0x10c2c0['as']==='Contact'?_['keys'](_0x31bbd2):_0x10c2c0[_0x6bbb('0x19')],'include':_0x10c2c0[_0x6bbb('0x1a')]?_[_0x6bbb('0x1b')](_0x10c2c0['include'],function(_0x2990c7){return{'model':db[_0x2990c7[_0x6bbb('0x1c')]],'as':_0x2990c7['as'],'attributes':_0x2990c7[_0x6bbb('0x19')],'include':_0x2990c7[_0x6bbb('0x1a')]?_['map'](_0x2990c7['include'],function(_0x4f20df){return{'model':db[_0x4f20df[_0x6bbb('0x1c')]],'as':_0x4f20df['as'],'attributes':_0x4f20df['attributes']};}):[]};}):[]};}):[]:[]})[_0x6bbb('0x1d')](function(_0x2b15e9){logger[_0x6bbb('0x9')]('GetCmHopper',_0x51c60d);logger['debug'](_0x6bbb('0x13'),_0x51c60d,JSON['stringify'](_0x2b15e9));_0x13ab7e(_0x2b15e9);})[_0x6bbb('0x12')](function(_0x2b1011){logger[_0x6bbb('0xe')]('GetCmHopper',_0x2b1011['message'],_0x51c60d);_0x296370(_0x46c0d1[_0x6bbb('0xe')](0x1f4,_0x2b1011['message']));});});});};
\ No newline at end of file
index a375e99..4ac6a7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1811=['post','create','/preview','getPreview','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','show'];(function(_0x11816e,_0xb41f09){var _0x4f40c7=function(_0x225660){while(--_0x225660){_0x11816e['push'](_0x11816e['shift']());}};_0x4f40c7(++_0xb41f09);}(_0x1811,0x121));var _0x1181=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x1811[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x1181('0x0'));var util=require(_0x1181('0x1'));var path=require(_0x1181('0x2'));var timeout=require(_0x1181('0x3'));var express=require(_0x1181('0x4'));var router=express[_0x1181('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1181('0x6'));var interaction=require(_0x1181('0x7'));var config=require(_0x1181('0x8'));var controller=require(_0x1181('0x9'));router[_0x1181('0xa')]('/',auth[_0x1181('0xb')](),controller[_0x1181('0xc')]);router[_0x1181('0xa')](_0x1181('0xd'),auth[_0x1181('0xb')](),controller[_0x1181('0xe')]);router['get'](_0x1181('0xf'),auth[_0x1181('0xb')](),controller[_0x1181('0x10')]);router[_0x1181('0xa')](_0x1181('0x11'),auth['isAuthenticated'](),controller[_0x1181('0x12')]);router[_0x1181('0x13')]('/',auth[_0x1181('0xb')](),controller[_0x1181('0x14')]);router[_0x1181('0x13')](_0x1181('0x15'),auth['isAuthenticated'](),controller[_0x1181('0x16')]);router[_0x1181('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x1181('0x18')]);router[_0x1181('0x19')](_0x1181('0x11'),auth['isAuthenticated'](),controller[_0x1181('0x1a')]);module[_0x1181('0x1b')]=router;
\ No newline at end of file
+var _0x857a=['post','create','getPreview','put','/:id','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','describe','getOpenContacts','show'];(function(_0xe4f6d,_0x472f54){var _0x5d975b=function(_0x1a7d24){while(--_0x1a7d24){_0xe4f6d['push'](_0xe4f6d['shift']());}};_0x5d975b(++_0x472f54);}(_0x857a,0x1aa));var _0xa857=function(_0x3becd6,_0x9aef7e){_0x3becd6=_0x3becd6-0x0;var _0x2a45b3=_0x857a[_0x3becd6];return _0x2a45b3;};'use strict';var multer=require('multer');var util=require(_0xa857('0x0'));var path=require(_0xa857('0x1'));var timeout=require(_0xa857('0x2'));var express=require('express');var router=express[_0xa857('0x3')]();var fs_extra=require(_0xa857('0x4'));var auth=require(_0xa857('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa857('0x6'));var controller=require(_0xa857('0x7'));router[_0xa857('0x8')]('/',auth[_0xa857('0x9')](),controller[_0xa857('0xa')]);router[_0xa857('0x8')]('/describe',auth[_0xa857('0x9')](),controller[_0xa857('0xb')]);router['get']('/opencontacts',auth['isAuthenticated'](),controller[_0xa857('0xc')]);router[_0xa857('0x8')]('/:id',auth[_0xa857('0x9')](),controller[_0xa857('0xd')]);router[_0xa857('0xe')]('/',auth['isAuthenticated'](),controller[_0xa857('0xf')]);router['post']('/preview',auth[_0xa857('0x9')](),controller[_0xa857('0x10')]);router[_0xa857('0x11')](_0xa857('0x12'),auth[_0xa857('0x9')](),controller['update']);router[_0xa857('0x13')](_0xa857('0x12'),auth['isAuthenticated'](),controller[_0xa857('0x14')]);module[_0xa857('0x15')]=router;
\ No newline at end of file
index 0946fdd..43a5eb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5057=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x3e0146,_0x545c20){var _0x514a59=function(_0x4de2cd){while(--_0x4de2cd){_0x3e0146['push'](_0x3e0146['shift']());}};_0x514a59(++_0x545c20);}(_0x5057,0x151));var _0x7505=function(_0x2d8be2,_0x209c88){_0x2d8be2=_0x2d8be2-0x0;var _0x387d12=_0x5057[_0x2d8be2];return _0x387d12;};'use strict';var moment=require(_0x7505('0x0'));var Sequelize=require(_0x7505('0x1'));module[_0x7505('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7505('0x3')],'unique':_0x7505('0x4')},'ListId':{'type':Sequelize[_0x7505('0x3')],'unique':_0x7505('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x7505('0x4')}};
\ No newline at end of file
+var _0x37cc=['sequelize','exports','STRING','INTEGER','contactListQueue','moment'];(function(_0x5b4d43,_0x47f4a8){var _0x674697=function(_0x121b11){while(--_0x121b11){_0x5b4d43['push'](_0x5b4d43['shift']());}};_0x674697(++_0x47f4a8);}(_0x37cc,0x185));var _0xc37c=function(_0x5ca10f,_0x239ec9){_0x5ca10f=_0x5ca10f-0x0;var _0x5ca553=_0x37cc[_0x5ca10f];return _0x5ca553;};'use strict';var moment=require(_0xc37c('0x0'));var Sequelize=require(_0xc37c('0x1'));module[_0xc37c('0x2')]={'phone':{'type':Sequelize[_0xc37c('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc37c('0x4')],'unique':_0xc37c('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xc37c('0x4')],'unique':_0xc37c('0x5')}};
\ No newline at end of file
index 2224d71..9ea708b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbe1=['fields','hasOwnProperty','nolimit','order','where','pick','merge','filter','findAll','catch','params','includeAll','include','options','body','find','destroy','describe','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','type','model','keys','filters','query','attributes','intersection'];(function(_0x2f0057,_0x448b27){var _0x17f2c3=function(_0x12efc3){while(--_0x12efc3){_0x2f0057['push'](_0x2f0057['shift']());}};_0x17f2c3(++_0x448b27);}(_0xbbe1,0x11a));var _0x1bbe=function(_0xf3ae5e,_0x385757){_0xf3ae5e=_0xf3ae5e-0x0;var _0x353c92=_0xbbe1[_0xf3ae5e];return _0x353c92;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1bbe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bbe('0x1'));var rp=require(_0x1bbe('0x2'));var moment=require('moment');var BPromise=require(_0x1bbe('0x3'));var Mustache=require('mustache');var util=require(_0x1bbe('0x4'));var path=require(_0x1bbe('0x5'));var sox=require('sox');var csv=require(_0x1bbe('0x6'));var ejs=require(_0x1bbe('0x7'));var fs=require('fs');var fs_extra=require(_0x1bbe('0x8'));var _=require('lodash');var squel=require(_0x1bbe('0x9'));var crypto=require(_0x1bbe('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1bbe('0xb'));var toCsv=require(_0x1bbe('0x6'));var querystring=require(_0x1bbe('0xc'));var Papa=require(_0x1bbe('0xd'));var Redis=require(_0x1bbe('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1bbe('0xf'))(_0x1bbe('0x10'));var utils=require(_0x1bbe('0x11'));var config=require(_0x1bbe('0x12'));var licenseUtil=require(_0x1bbe('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19d38a,_0x136b33){_0x136b33=_0x136b33||0xcc;return function(_0x30e8b5){if(_0x30e8b5){return _0x19d38a[_0x1bbe('0x14')](_0x136b33);}return _0x19d38a['status'](_0x136b33)[_0x1bbe('0x15')]();};}function respondWithResult(_0x5102a7,_0x410df2){_0x410df2=_0x410df2||0xc8;return function(_0x1f3f76){if(_0x1f3f76){return _0x5102a7[_0x1bbe('0x16')](_0x410df2)['json'](_0x1f3f76);}};}function respondWithFilteredResult(_0x5e483c,_0x306359){return function(_0x273bd4){if(_0x273bd4){var _0x5a06ca=typeof _0x306359[_0x1bbe('0x17')]==='undefined'&&typeof _0x306359[_0x1bbe('0x18')]==='undefined';var _0x52374d=_0x273bd4[_0x1bbe('0x19')];var _0x119d6d=_0x5a06ca?0x0:_0x306359[_0x1bbe('0x17')];var _0x2072eb=_0x5a06ca?_0x273bd4[_0x1bbe('0x19')]:_0x306359[_0x1bbe('0x17')]+_0x306359[_0x1bbe('0x18')];var _0x58b871;if(_0x2072eb>=_0x52374d){_0x2072eb=_0x52374d;_0x58b871=0xc8;}else{_0x58b871=0xce;}_0x5e483c[_0x1bbe('0x16')](_0x58b871);return _0x5e483c['set'](_0x1bbe('0x1a'),_0x119d6d+'-'+_0x2072eb+'/'+_0x52374d)[_0x1bbe('0x1b')](_0x273bd4);}return null;};}function patchUpdates(_0x8cdd3b){return function(_0x4a7b35){try{jsonpatch[_0x1bbe('0x1c')](_0x4a7b35,_0x8cdd3b,!![]);}catch(_0x3b4ee0){return BPromise[_0x1bbe('0x1d')](_0x3b4ee0);}return _0x4a7b35[_0x1bbe('0x1e')]();};}function saveUpdates(_0x4a4ded,_0x1274bd){return function(_0x3febd4){if(_0x3febd4){return _0x3febd4[_0x1bbe('0x1f')](_0x4a4ded)[_0x1bbe('0x20')](function(_0x293769){return _0x293769;});}return null;};}function removeEntity(_0x11bc01,_0x42bd0e){return function(_0x1735a8){if(_0x1735a8){return _0x1735a8['destroy']()[_0x1bbe('0x20')](function(){_0x11bc01[_0x1bbe('0x16')](0xcc)[_0x1bbe('0x15')]();});}};}function handleEntityNotFound(_0x401b3d,_0x545233){return function(_0x2b18d3){if(!_0x2b18d3){_0x401b3d[_0x1bbe('0x14')](0x194);}return _0x2b18d3;};}function handleError(_0x34a078,_0x4c0f6d){_0x4c0f6d=_0x4c0f6d||0x1f4;return function(_0x1440f6){logger[_0x1bbe('0x21')](_0x1440f6[_0x1bbe('0x22')]);if(_0x1440f6[_0x1bbe('0x23')]){delete _0x1440f6[_0x1bbe('0x23')];}_0x34a078['status'](_0x4c0f6d)[_0x1bbe('0x24')](_0x1440f6);};}exports[_0x1bbe('0x25')]=function(_0x27634b,_0x49bb2f){var _0x39fde1={},_0x5915e3={},_0x3077b2={'count':0x0,'rows':[]};var _0x11b75f=_[_0x1bbe('0x26')](db[_0x1bbe('0x27')][_0x1bbe('0x28')],function(_0x593d89){return{'name':_0x593d89['fieldName'],'type':_0x593d89[_0x1bbe('0x29')]['key']};});_0x5915e3[_0x1bbe('0x2a')]=_[_0x1bbe('0x26')](_0x11b75f,_0x1bbe('0x23'));_0x5915e3['query']=_[_0x1bbe('0x2b')](_0x27634b['query']);_0x5915e3[_0x1bbe('0x2c')]=_['intersection'](_0x5915e3[_0x1bbe('0x2a')],_0x5915e3[_0x1bbe('0x2d')]);_0x39fde1[_0x1bbe('0x2e')]=_[_0x1bbe('0x2f')](_0x5915e3[_0x1bbe('0x2a')],qs['fields'](_0x27634b[_0x1bbe('0x2d')][_0x1bbe('0x30')]));_0x39fde1[_0x1bbe('0x2e')]=_0x39fde1[_0x1bbe('0x2e')]['length']?_0x39fde1[_0x1bbe('0x2e')]:_0x5915e3['model'];if(!_0x27634b[_0x1bbe('0x2d')][_0x1bbe('0x31')](_0x1bbe('0x32'))){_0x39fde1[_0x1bbe('0x18')]=qs['limit'](_0x27634b[_0x1bbe('0x2d')][_0x1bbe('0x18')]);_0x39fde1['offset']=qs[_0x1bbe('0x17')](_0x27634b[_0x1bbe('0x2d')][_0x1bbe('0x17')]);}_0x39fde1[_0x1bbe('0x33')]=qs['sort'](_0x27634b[_0x1bbe('0x2d')]['sort']);_0x39fde1[_0x1bbe('0x34')]=qs[_0x1bbe('0x2c')](_[_0x1bbe('0x35')](_0x27634b[_0x1bbe('0x2d')],_0x5915e3[_0x1bbe('0x2c')]),_0x11b75f);if(_0x27634b['query']['filter']){_0x39fde1['where']=_[_0x1bbe('0x36')](_0x39fde1['where'],{'$or':_[_0x1bbe('0x26')](_0x11b75f,function(_0x39b0ca){if(_0x39b0ca['type']!=='VIRTUAL'){var _0x1a14e0={};_0x1a14e0[_0x39b0ca['name']]={'$like':'%'+_0x27634b[_0x1bbe('0x2d')][_0x1bbe('0x37')]+'%'};return _0x1a14e0;}})});}_0x39fde1=_['merge']({},_0x39fde1,_0x27634b['options']);var _0x36c327={'where':_0x39fde1[_0x1bbe('0x34')]};return db[_0x1bbe('0x27')]['count'](_0x36c327)[_0x1bbe('0x20')](function(_0x8ab3d3){_0x3077b2[_0x1bbe('0x19')]=_0x8ab3d3;if(_0x27634b['query']['includeAll']){_0x39fde1['include']=[{'all':!![]}];}return db[_0x1bbe('0x27')][_0x1bbe('0x38')](_0x39fde1);})[_0x1bbe('0x20')](function(_0xdd455d){_0x3077b2['rows']=_0xdd455d;return _0x3077b2;})[_0x1bbe('0x20')](respondWithFilteredResult(_0x49bb2f,_0x39fde1))[_0x1bbe('0x39')](handleError(_0x49bb2f,null));};exports['show']=function(_0x293cf6,_0x2a6108){var _0x1b0da3={'raw':!![],'where':{'id':_0x293cf6[_0x1bbe('0x3a')]['id']}},_0x5d068a={};_0x5d068a[_0x1bbe('0x2a')]=_[_0x1bbe('0x2b')](db[_0x1bbe('0x27')]['rawAttributes']);_0x5d068a[_0x1bbe('0x2d')]=_[_0x1bbe('0x2b')](_0x293cf6[_0x1bbe('0x2d')]);_0x5d068a[_0x1bbe('0x2c')]=_[_0x1bbe('0x2f')](_0x5d068a['model'],_0x5d068a[_0x1bbe('0x2d')]);_0x1b0da3[_0x1bbe('0x2e')]=_[_0x1bbe('0x2f')](_0x5d068a[_0x1bbe('0x2a')],qs['fields'](_0x293cf6[_0x1bbe('0x2d')][_0x1bbe('0x30')]));_0x1b0da3['attributes']=_0x1b0da3[_0x1bbe('0x2e')]['length']?_0x1b0da3['attributes']:_0x5d068a[_0x1bbe('0x2a')];if(_0x293cf6[_0x1bbe('0x2d')][_0x1bbe('0x3b')]){_0x1b0da3[_0x1bbe('0x3c')]=[{'all':!![]}];}_0x1b0da3=_[_0x1bbe('0x36')]({},_0x1b0da3,_0x293cf6[_0x1bbe('0x3d')]);return db['CmHopperBlack']['find'](_0x1b0da3)[_0x1bbe('0x20')](handleEntityNotFound(_0x2a6108,null))[_0x1bbe('0x20')](respondWithResult(_0x2a6108,null))[_0x1bbe('0x39')](handleError(_0x2a6108,null));};exports[_0x1bbe('0x1f')]=function(_0x124cc6,_0x2ed6de){if(_0x124cc6[_0x1bbe('0x3e')]['id']){delete _0x124cc6[_0x1bbe('0x3e')]['id'];}return db[_0x1bbe('0x27')][_0x1bbe('0x3f')]({'where':{'id':_0x124cc6['params']['id']}})['then'](handleEntityNotFound(_0x2ed6de,null))['then'](saveUpdates(_0x124cc6['body'],null))['then'](respondWithResult(_0x2ed6de,null))[_0x1bbe('0x39')](handleError(_0x2ed6de,null));};exports[_0x1bbe('0x40')]=function(_0x2d17ee,_0x888584){return db[_0x1bbe('0x27')][_0x1bbe('0x3f')]({'where':{'id':_0x2d17ee[_0x1bbe('0x3a')]['id']}})['then'](handleEntityNotFound(_0x888584,null))[_0x1bbe('0x20')](removeEntity(_0x888584,null))['catch'](handleError(_0x888584,null));};exports[_0x1bbe('0x41')]=function(_0x4d853f,_0x44536e){return db['CmHopperBlack'][_0x1bbe('0x41')]()[_0x1bbe('0x20')](respondWithResult(_0x44536e,null))[_0x1bbe('0x39')](handleError(_0x44536e,null));};
\ No newline at end of file
+var _0x75ff=['sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','then','destroy','error','stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order'];(function(_0x1aa875,_0x506c4a){var _0x46d9b8=function(_0x766d35){while(--_0x766d35){_0x1aa875['push'](_0x1aa875['shift']());}};_0x46d9b8(++_0x506c4a);}(_0x75ff,0x131));var _0xf75f=function(_0x508167,_0x2a24ec){_0x508167=_0x508167-0x0;var _0x5e7a78=_0x75ff[_0x508167];return _0x5e7a78;};'use strict';var emlformat=require(_0xf75f('0x0'));var rimraf=require(_0xf75f('0x1'));var zipdir=require(_0xf75f('0x2'));var jsonpatch=require(_0xf75f('0x3'));var rp=require(_0xf75f('0x4'));var moment=require('moment');var BPromise=require(_0xf75f('0x5'));var Mustache=require(_0xf75f('0x6'));var util=require(_0xf75f('0x7'));var path=require('path');var sox=require(_0xf75f('0x8'));var csv=require(_0xf75f('0x9'));var ejs=require(_0xf75f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf75f('0xb'));var crypto=require('crypto');var jsforce=require(_0xf75f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf75f('0x9'));var querystring=require(_0xf75f('0xd'));var Papa=require(_0xf75f('0xe'));var Redis=require(_0xf75f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf75f('0x10'));var as=require(_0xf75f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf75f('0x12'));var utils=require(_0xf75f('0x13'));var config=require(_0xf75f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf75f('0x15'))['db'];function respondWithStatusCode(_0x173e95,_0x347426){_0x347426=_0x347426||0xcc;return function(_0x1c1a68){if(_0x1c1a68){return _0x173e95['sendStatus'](_0x347426);}return _0x173e95[_0xf75f('0x16')](_0x347426)[_0xf75f('0x17')]();};}function respondWithResult(_0x4890c9,_0x5b85d0){_0x5b85d0=_0x5b85d0||0xc8;return function(_0x5010fd){if(_0x5010fd){return _0x4890c9[_0xf75f('0x16')](_0x5b85d0)[_0xf75f('0x18')](_0x5010fd);}};}function respondWithFilteredResult(_0x3ceca3,_0x9d2141){return function(_0x44ea2b){if(_0x44ea2b){var _0x3cde60=typeof _0x9d2141['offset']==='undefined'&&typeof _0x9d2141[_0xf75f('0x19')]===_0xf75f('0x1a');var _0x3de07f=_0x44ea2b[_0xf75f('0x1b')];var _0xee7ae9=_0x3cde60?0x0:_0x9d2141[_0xf75f('0x1c')];var _0xe9a0b1=_0x3cde60?_0x44ea2b[_0xf75f('0x1b')]:_0x9d2141[_0xf75f('0x1c')]+_0x9d2141[_0xf75f('0x19')];var _0x4730cd;if(_0xe9a0b1>=_0x3de07f){_0xe9a0b1=_0x3de07f;_0x4730cd=0xc8;}else{_0x4730cd=0xce;}_0x3ceca3[_0xf75f('0x16')](_0x4730cd);return _0x3ceca3[_0xf75f('0x1d')]('Content-Range',_0xee7ae9+'-'+_0xe9a0b1+'/'+_0x3de07f)[_0xf75f('0x18')](_0x44ea2b);}return null;};}function patchUpdates(_0x2e8c2e){return function(_0x30d441){try{jsonpatch[_0xf75f('0x1e')](_0x30d441,_0x2e8c2e,!![]);}catch(_0x2f414e){return BPromise[_0xf75f('0x1f')](_0x2f414e);}return _0x30d441[_0xf75f('0x20')]();};}function saveUpdates(_0x53c13f,_0x406d84){return function(_0x55334e){if(_0x55334e){return _0x55334e['update'](_0x53c13f)[_0xf75f('0x21')](function(_0x19ce75){return _0x19ce75;});}return null;};}function removeEntity(_0x4cdd2a,_0x32734e){return function(_0x5425cf){if(_0x5425cf){return _0x5425cf[_0xf75f('0x22')]()['then'](function(){_0x4cdd2a[_0xf75f('0x16')](0xcc)[_0xf75f('0x17')]();});}};}function handleEntityNotFound(_0x64ce8c,_0x2dfeab){return function(_0xeebf18){if(!_0xeebf18){_0x64ce8c['sendStatus'](0x194);}return _0xeebf18;};}function handleError(_0x513bef,_0x320ddf){_0x320ddf=_0x320ddf||0x1f4;return function(_0x1209d5){logger[_0xf75f('0x23')](_0x1209d5[_0xf75f('0x24')]);if(_0x1209d5[_0xf75f('0x25')]){delete _0x1209d5[_0xf75f('0x25')];}_0x513bef['status'](_0x320ddf)['send'](_0x1209d5);};}exports[_0xf75f('0x26')]=function(_0xd314b1,_0x20ad0d){var _0x45bb9f={},_0x16d8e8={},_0x17d9e6={'count':0x0,'rows':[]};var _0x1ee394=_[_0xf75f('0x27')](db[_0xf75f('0x28')][_0xf75f('0x29')],function(_0x351eed){return{'name':_0x351eed[_0xf75f('0x2a')],'type':_0x351eed[_0xf75f('0x2b')][_0xf75f('0x2c')]};});_0x16d8e8['model']=_[_0xf75f('0x27')](_0x1ee394,'name');_0x16d8e8[_0xf75f('0x2d')]=_[_0xf75f('0x2e')](_0xd314b1[_0xf75f('0x2d')]);_0x16d8e8[_0xf75f('0x2f')]=_[_0xf75f('0x30')](_0x16d8e8[_0xf75f('0x31')],_0x16d8e8[_0xf75f('0x2d')]);_0x45bb9f[_0xf75f('0x32')]=_[_0xf75f('0x30')](_0x16d8e8[_0xf75f('0x31')],qs[_0xf75f('0x33')](_0xd314b1['query']['fields']));_0x45bb9f[_0xf75f('0x32')]=_0x45bb9f['attributes'][_0xf75f('0x34')]?_0x45bb9f[_0xf75f('0x32')]:_0x16d8e8[_0xf75f('0x31')];if(!_0xd314b1[_0xf75f('0x2d')]['hasOwnProperty'](_0xf75f('0x35'))){_0x45bb9f['limit']=qs[_0xf75f('0x19')](_0xd314b1[_0xf75f('0x2d')]['limit']);_0x45bb9f[_0xf75f('0x1c')]=qs[_0xf75f('0x1c')](_0xd314b1['query']['offset']);}_0x45bb9f[_0xf75f('0x36')]=qs[_0xf75f('0x37')](_0xd314b1[_0xf75f('0x2d')]['sort']);_0x45bb9f[_0xf75f('0x38')]=qs[_0xf75f('0x2f')](_[_0xf75f('0x39')](_0xd314b1[_0xf75f('0x2d')],_0x16d8e8['filters']),_0x1ee394);if(_0xd314b1[_0xf75f('0x2d')][_0xf75f('0x3a')]){_0x45bb9f[_0xf75f('0x38')]=_[_0xf75f('0x3b')](_0x45bb9f[_0xf75f('0x38')],{'$or':_['map'](_0x1ee394,function(_0x53d10e){if(_0x53d10e[_0xf75f('0x2b')]!==_0xf75f('0x3c')){var _0x2f0fd3={};_0x2f0fd3[_0x53d10e[_0xf75f('0x25')]]={'$like':'%'+_0xd314b1[_0xf75f('0x2d')]['filter']+'%'};return _0x2f0fd3;}})});}_0x45bb9f=_[_0xf75f('0x3b')]({},_0x45bb9f,_0xd314b1[_0xf75f('0x3d')]);var _0x240ee2={'where':_0x45bb9f[_0xf75f('0x38')]};return db[_0xf75f('0x28')][_0xf75f('0x1b')](_0x240ee2)[_0xf75f('0x21')](function(_0x48371c){_0x17d9e6[_0xf75f('0x1b')]=_0x48371c;if(_0xd314b1['query']['includeAll']){_0x45bb9f[_0xf75f('0x3e')]=[{'all':!![]}];}return db[_0xf75f('0x28')]['findAll'](_0x45bb9f);})[_0xf75f('0x21')](function(_0x15bb69){_0x17d9e6[_0xf75f('0x3f')]=_0x15bb69;return _0x17d9e6;})[_0xf75f('0x21')](respondWithFilteredResult(_0x20ad0d,_0x45bb9f))[_0xf75f('0x40')](handleError(_0x20ad0d,null));};exports[_0xf75f('0x41')]=function(_0x2425cf,_0x270634){var _0x5a5e8d={'raw':!![],'where':{'id':_0x2425cf[_0xf75f('0x42')]['id']}},_0xcd93dd={};_0xcd93dd['model']=_[_0xf75f('0x2e')](db['CmHopperBlack']['rawAttributes']);_0xcd93dd[_0xf75f('0x2d')]=_['keys'](_0x2425cf[_0xf75f('0x2d')]);_0xcd93dd['filters']=_[_0xf75f('0x30')](_0xcd93dd['model'],_0xcd93dd[_0xf75f('0x2d')]);_0x5a5e8d[_0xf75f('0x32')]=_[_0xf75f('0x30')](_0xcd93dd[_0xf75f('0x31')],qs[_0xf75f('0x33')](_0x2425cf['query'][_0xf75f('0x33')]));_0x5a5e8d[_0xf75f('0x32')]=_0x5a5e8d['attributes']['length']?_0x5a5e8d[_0xf75f('0x32')]:_0xcd93dd[_0xf75f('0x31')];if(_0x2425cf['query'][_0xf75f('0x43')]){_0x5a5e8d[_0xf75f('0x3e')]=[{'all':!![]}];}_0x5a5e8d=_[_0xf75f('0x3b')]({},_0x5a5e8d,_0x2425cf[_0xf75f('0x3d')]);return db[_0xf75f('0x28')][_0xf75f('0x44')](_0x5a5e8d)[_0xf75f('0x21')](handleEntityNotFound(_0x270634,null))['then'](respondWithResult(_0x270634,null))[_0xf75f('0x40')](handleError(_0x270634,null));};exports[_0xf75f('0x45')]=function(_0x17961c,_0x23b474){if(_0x17961c[_0xf75f('0x46')]['id']){delete _0x17961c[_0xf75f('0x46')]['id'];}return db[_0xf75f('0x28')][_0xf75f('0x44')]({'where':{'id':_0x17961c['params']['id']}})[_0xf75f('0x21')](handleEntityNotFound(_0x23b474,null))[_0xf75f('0x21')](saveUpdates(_0x17961c[_0xf75f('0x46')],null))[_0xf75f('0x21')](respondWithResult(_0x23b474,null))[_0xf75f('0x40')](handleError(_0x23b474,null));};exports[_0xf75f('0x22')]=function(_0x40207b,_0x553c12){return db['CmHopperBlack']['find']({'where':{'id':_0x40207b['params']['id']}})['then'](handleEntityNotFound(_0x553c12,null))[_0xf75f('0x21')](removeEntity(_0x553c12,null))[_0xf75f('0x40')](handleError(_0x553c12,null));};exports[_0xf75f('0x47')]=function(_0x3c9878,_0x27043a){return db[_0xf75f('0x28')]['describe']()[_0xf75f('0x21')](respondWithResult(_0x27043a,null))[_0xf75f('0x40')](handleError(_0x27043a,null));};
\ No newline at end of file
index b610310..aa84b05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc1a=['moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api'];(function(_0x145716,_0x371455){var _0x47a245=function(_0x5eec8a){while(--_0x5eec8a){_0x145716['push'](_0x145716['shift']());}};_0x47a245(++_0x371455);}(_0xcc1a,0x1d8));var _0xacc1=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xcc1a[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0xacc1('0x0'));var util=require(_0xacc1('0x1'));var logger=require(_0xacc1('0x2'))(_0xacc1('0x3'));var moment=require(_0xacc1('0x4'));var BPromise=require(_0xacc1('0x5'));var rp=require(_0xacc1('0x6'));var fs=require('fs');var path=require(_0xacc1('0x7'));var rimraf=require(_0xacc1('0x8'));var config=require('../../config/environment');var attributes=require(_0xacc1('0x9'));module[_0xacc1('0xa')]=function(_0x1cd1ef,_0xfac06a){return _0x1cd1ef[_0xacc1('0xb')](_0xacc1('0xc'),attributes,{'tableName':_0xacc1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x96b4=['api','bluebird','request-promise','rimraf','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0xe693e4,_0x4efa11){var _0x2d1653=function(_0x1958b3){while(--_0x1958b3){_0xe693e4['push'](_0xe693e4['shift']());}};_0x2d1653(++_0x4efa11);}(_0x96b4,0x19f));var _0x496b=function(_0x5d6214,_0xf2c51f){_0x5d6214=_0x5d6214-0x0;var _0x402b4b=_0x96b4[_0x5d6214];return _0x402b4b;};'use strict';var _=require(_0x496b('0x0'));var util=require(_0x496b('0x1'));var logger=require(_0x496b('0x2'))(_0x496b('0x3'));var moment=require('moment');var BPromise=require(_0x496b('0x4'));var rp=require(_0x496b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x496b('0x6'));var config=require('../../config/environment');var attributes=require(_0x496b('0x7'));module['exports']=function(_0x42d081,_0x58baee){return _0x42d081[_0x496b('0x8')](_0x496b('0x9'),attributes,{'tableName':_0x496b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2906de9..32084aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb09=['include','map','model','stringify','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','destroy','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit'];(function(_0x51c0e4,_0x752d6e){var _0xa87fae=function(_0x35a6ea){while(--_0x35a6ea){_0x51c0e4['push'](_0x51c0e4['shift']());}};_0xa87fae(++_0x752d6e);}(_0xdb09,0x169));var _0x9db0=function(_0x1d0b74,_0x2b9295){_0x1d0b74=_0x1d0b74-0x0;var _0x1c18e7=_0xdb09[_0x1d0b74];return _0x1c18e7;};'use strict';var _=require(_0x9db0('0x0'));var util=require(_0x9db0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9db0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9db0('0x3'))['db'];var utils=require(_0x9db0('0x4'));var logger=require(_0x9db0('0x5'))(_0x9db0('0x6'));var config=require(_0x9db0('0x7'));var jayson=require(_0x9db0('0x8'));var client=jayson[_0x9db0('0x9')][_0x9db0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49302e,_0xbde44,_0x13aec8){return new BPromise(function(_0x14d207,_0x477a2e){return client[_0x9db0('0xb')](_0x49302e,_0x13aec8)[_0x9db0('0xc')](function(_0x41776e){logger[_0x9db0('0xd')](_0x9db0('0xe'),_0xbde44,'request\x20sent');logger[_0x9db0('0xf')](_0x9db0('0x10'),_0xbde44,'request\x20sent',JSON['stringify'](_0x41776e));if(_0x41776e[_0x9db0('0x11')]){if(_0x41776e[_0x9db0('0x11')]['code']===0x1f4){logger['error'](_0x9db0('0xe'),_0xbde44,_0x41776e[_0x9db0('0x11')]['message']);return _0x477a2e(_0x41776e[_0x9db0('0x11')]['message']);}logger[_0x9db0('0x11')](_0x9db0('0xe'),_0xbde44,_0x41776e['error'][_0x9db0('0x12')]);return _0x14d207(_0x41776e[_0x9db0('0x11')]['message']);}else{logger[_0x9db0('0xd')](_0x9db0('0xe'),_0xbde44,_0x9db0('0x13'));_0x14d207(_0x41776e[_0x9db0('0x14')][_0x9db0('0x12')]);}})[_0x9db0('0x15')](function(_0x2977f9){logger[_0x9db0('0x11')](_0x9db0('0xe'),_0xbde44,_0x2977f9);_0x477a2e(_0x2977f9);});});}exports[_0x9db0('0x16')]=function(_0x1bd9b2){var _0x4b58a4=this;return new Promise(function(_0xdbf9f2,_0xd23af1){return db[_0x9db0('0x17')][_0x9db0('0x18')]({'raw':_0x1bd9b2['options']?_0x1bd9b2[_0x9db0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1bd9b2[_0x9db0('0x19')]?_0x1bd9b2['options'][_0x9db0('0x1a')]||null:null,'attributes':_0x1bd9b2[_0x9db0('0x19')]?_0x1bd9b2[_0x9db0('0x19')][_0x9db0('0x1b')]||null:null,'limit':_0x1bd9b2[_0x9db0('0x19')]?_0x1bd9b2[_0x9db0('0x19')][_0x9db0('0x1c')]||null:null,'include':_0x1bd9b2['options']?_0x1bd9b2[_0x9db0('0x19')][_0x9db0('0x1d')]?_[_0x9db0('0x1e')](_0x1bd9b2[_0x9db0('0x19')][_0x9db0('0x1d')],function(_0x16298f){return{'model':db[_0x16298f[_0x9db0('0x1f')]],'as':_0x16298f['as'],'attributes':_0x16298f[_0x9db0('0x1b')],'include':_0x16298f[_0x9db0('0x1d')]?_['map'](_0x16298f[_0x9db0('0x1d')],function(_0x5443ee){return{'model':db[_0x5443ee[_0x9db0('0x1f')]],'as':_0x5443ee['as'],'attributes':_0x5443ee['attributes'],'include':_0x5443ee['include']?_[_0x9db0('0x1e')](_0x5443ee[_0x9db0('0x1d')],function(_0x12875c){return{'model':db[_0x12875c['model']],'as':_0x12875c['as'],'attributes':_0x12875c[_0x9db0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9db0('0xc')](function(_0x2191e6){logger['info']('GetCmHopperBlack',_0x1bd9b2);logger['debug'](_0x9db0('0x16'),_0x1bd9b2,JSON[_0x9db0('0x20')](_0x2191e6));_0xdbf9f2(_0x2191e6);})[_0x9db0('0x15')](function(_0x55bf92){logger[_0x9db0('0x11')](_0x9db0('0x16'),_0x55bf92[_0x9db0('0x12')],_0x1bd9b2);_0xd23af1(_0x4b58a4[_0x9db0('0x11')](0x1f4,_0x55bf92['message']));});});};exports[_0x9db0('0x21')]=function(_0x5abda1){var _0x31c741=this;return new Promise(function(_0x5ebdb1,_0x469fa2){return db['CmHopperBlack'][_0x9db0('0x22')](_0x5abda1[_0x9db0('0x23')],{'raw':_0x5abda1['options']?_0x5abda1['options'][_0x9db0('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5abda1[_0x9db0('0x19')]?_0x5abda1['options'][_0x9db0('0x1a')]||null:null,'attributes':_0x5abda1[_0x9db0('0x19')]?_0x5abda1[_0x9db0('0x19')][_0x9db0('0x1b')]||null:null,'limit':_0x5abda1[_0x9db0('0x19')]?_0x5abda1[_0x9db0('0x19')]['limit']||null:null})[_0x9db0('0xc')](function(_0x4a0dfb){logger[_0x9db0('0xd')](_0x9db0('0x21'),_0x5abda1);logger[_0x9db0('0xf')](_0x9db0('0x21'),_0x5abda1,JSON[_0x9db0('0x20')](_0x4a0dfb));_0x5ebdb1(_0x4a0dfb);})['catch'](function(_0x1297b3){logger[_0x9db0('0x11')](_0x9db0('0x21'),_0x1297b3[_0x9db0('0x12')],_0x5abda1);_0x469fa2(_0x31c741[_0x9db0('0x11')](0x1f4,_0x1297b3['message']));});});};exports[_0x9db0('0x25')]=function(_0x5432d9){var _0x2ffdb2=this;return new Promise(function(_0x43a8a6,_0x532b18){return db['CmHopperBlack'][_0x9db0('0x26')]({'where':_0x5432d9[_0x9db0('0x19')]?_0x5432d9['options']['where']||null:null})['then'](function(_0x2e6f32){logger[_0x9db0('0xd')](_0x9db0('0x25'),_0x5432d9);logger[_0x9db0('0xf')](_0x9db0('0x25'),_0x5432d9,JSON[_0x9db0('0x20')](_0x2e6f32));_0x43a8a6(_0x2e6f32);})[_0x9db0('0x15')](function(_0x4f3263){logger[_0x9db0('0x11')](_0x9db0('0x25'),_0x4f3263[_0x9db0('0x12')],_0x5432d9);_0x532b18(_0x2ffdb2[_0x9db0('0x11')](0x1f4,_0x4f3263['message']));});});};
\ No newline at end of file
+var _0xcb12=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','debug','stringify','error','code','message','info','result','GetCmHopperBlack','findAll','options','raw','limit','map','include','model','attributes','catch','UpdateCmHopperBlack','CmHopperBlack','body','where','DestroyCmHopperBlack','destroy','lodash','util','moment'];(function(_0x46ac13,_0x38c214){var _0x2ffe09=function(_0x42b3a6){while(--_0x42b3a6){_0x46ac13['push'](_0x46ac13['shift']());}};_0x2ffe09(++_0x38c214);}(_0xcb12,0xed));var _0x2cb1=function(_0x2dc83e,_0x577c31){_0x2dc83e=_0x2dc83e-0x0;var _0x3a3343=_0xcb12[_0x2dc83e];return _0x3a3343;};'use strict';var _=require(_0x2cb1('0x0'));var util=require(_0x2cb1('0x1'));var moment=require(_0x2cb1('0x2'));var BPromise=require(_0x2cb1('0x3'));var rs=require(_0x2cb1('0x4'));var fs=require('fs');var Redis=require(_0x2cb1('0x5'));var db=require(_0x2cb1('0x6'))['db'];var utils=require(_0x2cb1('0x7'));var logger=require(_0x2cb1('0x8'))(_0x2cb1('0x9'));var config=require(_0x2cb1('0xa'));var jayson=require(_0x2cb1('0xb'));var client=jayson[_0x2cb1('0xc')][_0x2cb1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4661b0,_0x4adddb,_0x446ef3){return new BPromise(function(_0x3677b1,_0x1b185b){return client[_0x2cb1('0xe')](_0x4661b0,_0x446ef3)[_0x2cb1('0xf')](function(_0x2431f5){logger['info'](_0x2cb1('0x10'),_0x4adddb,'request\x20sent');logger[_0x2cb1('0x11')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4adddb,'request\x20sent',JSON[_0x2cb1('0x12')](_0x2431f5));if(_0x2431f5[_0x2cb1('0x13')]){if(_0x2431f5['error'][_0x2cb1('0x14')]===0x1f4){logger['error'](_0x2cb1('0x10'),_0x4adddb,_0x2431f5['error'][_0x2cb1('0x15')]);return _0x1b185b(_0x2431f5[_0x2cb1('0x13')]['message']);}logger[_0x2cb1('0x13')](_0x2cb1('0x10'),_0x4adddb,_0x2431f5[_0x2cb1('0x13')][_0x2cb1('0x15')]);return _0x3677b1(_0x2431f5['error']['message']);}else{logger[_0x2cb1('0x16')](_0x2cb1('0x10'),_0x4adddb,'request\x20sent');_0x3677b1(_0x2431f5[_0x2cb1('0x17')][_0x2cb1('0x15')]);}})['catch'](function(_0x29260e){logger[_0x2cb1('0x13')](_0x2cb1('0x10'),_0x4adddb,_0x29260e);_0x1b185b(_0x29260e);});});}exports[_0x2cb1('0x18')]=function(_0x155257){var _0x361ab1=this;return new Promise(function(_0xf13e6a,_0xabce1f){return db['CmHopperBlack'][_0x2cb1('0x19')]({'raw':_0x155257[_0x2cb1('0x1a')]?_0x155257[_0x2cb1('0x1a')][_0x2cb1('0x1b')]===undefined?!![]:![]:!![],'where':_0x155257[_0x2cb1('0x1a')]?_0x155257[_0x2cb1('0x1a')]['where']||null:null,'attributes':_0x155257['options']?_0x155257['options']['attributes']||null:null,'limit':_0x155257['options']?_0x155257['options'][_0x2cb1('0x1c')]||null:null,'include':_0x155257[_0x2cb1('0x1a')]?_0x155257[_0x2cb1('0x1a')]['include']?_[_0x2cb1('0x1d')](_0x155257['options'][_0x2cb1('0x1e')],function(_0x193ff4){return{'model':db[_0x193ff4[_0x2cb1('0x1f')]],'as':_0x193ff4['as'],'attributes':_0x193ff4['attributes'],'include':_0x193ff4['include']?_[_0x2cb1('0x1d')](_0x193ff4[_0x2cb1('0x1e')],function(_0x24f45d){return{'model':db[_0x24f45d[_0x2cb1('0x1f')]],'as':_0x24f45d['as'],'attributes':_0x24f45d['attributes'],'include':_0x24f45d[_0x2cb1('0x1e')]?_[_0x2cb1('0x1d')](_0x24f45d['include'],function(_0x17e15b){return{'model':db[_0x17e15b['model']],'as':_0x17e15b['as'],'attributes':_0x17e15b[_0x2cb1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2cb1('0xf')](function(_0x216acb){logger[_0x2cb1('0x16')]('GetCmHopperBlack',_0x155257);logger[_0x2cb1('0x11')](_0x2cb1('0x18'),_0x155257,JSON[_0x2cb1('0x12')](_0x216acb));_0xf13e6a(_0x216acb);})[_0x2cb1('0x21')](function(_0x2150aa){logger['error'](_0x2cb1('0x18'),_0x2150aa[_0x2cb1('0x15')],_0x155257);_0xabce1f(_0x361ab1['error'](0x1f4,_0x2150aa['message']));});});};exports[_0x2cb1('0x22')]=function(_0x53f230){var _0x2afcdc=this;return new Promise(function(_0x32a3f3,_0x421c52){return db[_0x2cb1('0x23')]['update'](_0x53f230[_0x2cb1('0x24')],{'raw':_0x53f230['options']?_0x53f230[_0x2cb1('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53f230[_0x2cb1('0x1a')]?_0x53f230[_0x2cb1('0x1a')][_0x2cb1('0x25')]||null:null,'attributes':_0x53f230[_0x2cb1('0x1a')]?_0x53f230[_0x2cb1('0x1a')][_0x2cb1('0x20')]||null:null,'limit':_0x53f230['options']?_0x53f230['options'][_0x2cb1('0x1c')]||null:null})[_0x2cb1('0xf')](function(_0x27e299){logger['info']('UpdateCmHopperBlack',_0x53f230);logger['debug'](_0x2cb1('0x22'),_0x53f230,JSON[_0x2cb1('0x12')](_0x27e299));_0x32a3f3(_0x27e299);})[_0x2cb1('0x21')](function(_0x22be26){logger[_0x2cb1('0x13')]('UpdateCmHopperBlack',_0x22be26[_0x2cb1('0x15')],_0x53f230);_0x421c52(_0x2afcdc[_0x2cb1('0x13')](0x1f4,_0x22be26['message']));});});};exports[_0x2cb1('0x26')]=function(_0x54e52e){var _0x14b8a2=this;return new Promise(function(_0x13a2e6,_0x128353){return db[_0x2cb1('0x23')][_0x2cb1('0x27')]({'where':_0x54e52e[_0x2cb1('0x1a')]?_0x54e52e[_0x2cb1('0x1a')][_0x2cb1('0x25')]||null:null})['then'](function(_0x26e8d9){logger[_0x2cb1('0x16')](_0x2cb1('0x26'),_0x54e52e);logger[_0x2cb1('0x11')](_0x2cb1('0x26'),_0x54e52e,JSON[_0x2cb1('0x12')](_0x26e8d9));_0x13a2e6(_0x26e8d9);})[_0x2cb1('0x21')](function(_0x2abcf5){logger['error'](_0x2cb1('0x26'),_0x2abcf5['message'],_0x54e52e);_0x128353(_0x14b8a2[_0x2cb1('0x13')](0x1f4,_0x2abcf5['message']));});});};
\ No newline at end of file
index 7b9c12c..e83a8a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['/describe','describe','/:id','put','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./cmHopperBlack.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0xc')](_0xee2f('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xee2f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x90b1=['index','get','/describe','isAuthenticated','describe','/:id','show','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x49536c,_0x5e6a3e){var _0x38852f=function(_0x1295b6){while(--_0x1295b6){_0x49536c['push'](_0x49536c['shift']());}};_0x38852f(++_0x5e6a3e);}(_0x90b1,0x1bb));var _0x190b=function(_0x59db0f,_0x466ec8){_0x59db0f=_0x59db0f-0x0;var _0x2d3a0c=_0x90b1[_0x59db0f];return _0x2d3a0c;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var fs_extra=require(_0x190b('0x4'));var auth=require(_0x190b('0x5'));var interaction=require(_0x190b('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x190b('0x7')]);router[_0x190b('0x8')](_0x190b('0x9'),auth[_0x190b('0xa')](),controller[_0x190b('0xb')]);router[_0x190b('0x8')](_0x190b('0xc'),auth['isAuthenticated'](),controller[_0x190b('0xd')]);router[_0x190b('0xe')](_0x190b('0xc'),auth[_0x190b('0xa')](),controller[_0x190b('0xf')]);router[_0x190b('0x10')](_0x190b('0xc'),auth[_0x190b('0xa')](),controller['destroy']);module[_0x190b('0x11')]=router;
\ No newline at end of file
index 3112197..b67a6fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa535=['dispositionat','BOOLEAN','moment','exports','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','diff','seconds'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa535,0x116));var _0x5a53=function(_0x2103ae,_0x569b6c){_0x2103ae=_0x2103ae-0x0;var _0x2f6bc9=_0xa535[_0x2103ae];return _0x2f6bc9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5a53('0x0'));module[_0x5a53('0x1')]={'state':{'type':Sequelize[_0x5a53('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x5a53('0x3')]},'countbusyretry':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x5a53('0x4')]},'originatecalleridname':{'type':Sequelize[_0x5a53('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5a53('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5a53('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5a53('0x3')]},'ringtime':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5a53('0x4')]},'campaign':{'type':Sequelize[_0x5a53('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5a53('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5a53('0x4')]},'secondDisposition':{'type':Sequelize[_0x5a53('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5a53('0x4')]},'dispositionat':{'type':Sequelize[_0x5a53('0x3')],'set':function(_0x4a8978){var _0x10dfcc=this[_0x5a53('0x5')](_0x5a53('0x6'));if(_0x10dfcc&&_0x4a8978){this[_0x5a53('0x7')]('followuptime',moment(_0x4a8978)[_0x5a53('0x8')](moment(_0x10dfcc),_0x5a53('0x9')));}return this[_0x5a53('0x7')](_0x5a53('0xa'),_0x4a8978);}},'amd':{'type':Sequelize[_0x5a53('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5a53('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5a53('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5a53('0x3')]},'callback':{'type':Sequelize[_0x5a53('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5a53('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5a53('0x3')]},'deleted':{'type':Sequelize[_0x5a53('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5a53('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5a53('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5a53('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xfd31=['exports','INTEGER','STRING','DATE','endtime','setDataValue','diff','seconds','dispositionat','BOOLEAN','sequelize','moment'];(function(_0x16ecad,_0x205047){var _0x313ff7=function(_0x58b16a){while(--_0x58b16a){_0x16ecad['push'](_0x16ecad['shift']());}};_0x313ff7(++_0x205047);}(_0xfd31,0x1a2));var _0x1fd3=function(_0x2c5ebb,_0x296daa){_0x2c5ebb=_0x2c5ebb-0x0;var _0xc2f991=_0xfd31[_0x2c5ebb];return _0xc2f991;};'use strict';var Sequelize=require(_0x1fd3('0x0'));var moment=require(_0x1fd3('0x1'));module[_0x1fd3('0x2')]={'state':{'type':Sequelize[_0x1fd3('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x1fd3('0x4')]},'scheduledat':{'type':Sequelize[_0x1fd3('0x5')]},'countbusyretry':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1fd3('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x1fd3('0x4')]},'originatecalleridname':{'type':Sequelize[_0x1fd3('0x4')]},'calleridnum':{'type':Sequelize[_0x1fd3('0x4')]},'calleridname':{'type':Sequelize[_0x1fd3('0x4')]},'starttime':{'type':Sequelize[_0x1fd3('0x5')]},'responsetime':{'type':Sequelize[_0x1fd3('0x5')]},'answertime':{'type':Sequelize[_0x1fd3('0x5')]},'droptime':{'type':Sequelize[_0x1fd3('0x5')]},'endtime':{'type':Sequelize[_0x1fd3('0x5')]},'ringtime':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x1fd3('0x4')]},'campaigntype':{'type':Sequelize[_0x1fd3('0x4')]},'membername':{'type':Sequelize[_0x1fd3('0x4')]},'reason':{'type':Sequelize[_0x1fd3('0x4')]},'disposition':{'type':Sequelize[_0x1fd3('0x4')]},'secondDisposition':{'type':Sequelize[_0x1fd3('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1fd3('0x4')]},'dispositionat':{'type':Sequelize[_0x1fd3('0x5')],'set':function(_0x2612ba){var _0x2fe71c=this['getDataValue'](_0x1fd3('0x6'));if(_0x2fe71c&&_0x2612ba){this[_0x1fd3('0x7')]('followuptime',moment(_0x2612ba)[_0x1fd3('0x8')](moment(_0x2fe71c),_0x1fd3('0x9')));}return this[_0x1fd3('0x7')](_0x1fd3('0xa'),_0x2612ba);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x1fd3('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x1fd3('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x1fd3('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1fd3('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x1fd3('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1fd3('0x5')]},'recallme':{'type':Sequelize[_0x1fd3('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1fd3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index ec8b9fe..9ec067d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacf4=['reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','select','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','NOW()','CampaignId\x20=\x20?','checkContactHopper','CmHopper','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'];(function(_0x29c5a5,_0x46c826){var _0x4ef2a6=function(_0x89a001){while(--_0x89a001){_0x29c5a5['push'](_0x29c5a5['shift']());}};_0x4ef2a6(++_0x46c826);}(_0xacf4,0xe7));var _0x4acf=function(_0x48224d,_0x236fa6){_0x48224d=_0x48224d-0x0;var _0x10d1b3=_0xacf4[_0x48224d];return _0x10d1b3;};'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['CmHopperFinal'][_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['CmHopperFinal']['describe']()[_0x4acf('0x21')](respondWithResult(_0x2d946c,null))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x33bc52,_0x287406){if(_0x33bc52[_0x4acf('0x47')][_0x4acf('0x48')]){delete _0x33bc52[_0x4acf('0x47')][_0x4acf('0x48')];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'uniqueid':_0x33bc52[_0x4acf('0x41')]['id']}})['then'](handleEntityNotFound(_0x287406,null))[_0x4acf('0x21')](saveUpdates(_0x33bc52[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x287406,null))[_0x4acf('0x3f')](handleError(_0x287406,null));};exports[_0x4acf('0x49')]=function(_0x3cf54a,_0x2785b9,_0x2d0561){return db[_0x4acf('0x29')][_0x4acf('0x3d')]({'raw':![],'where':{'VoiceQueueId':_0x3cf54a[_0x4acf('0x41')]['id']},'attributes':[[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x200,\x201,\x20null'))),_0x4acf('0x4d')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x4e')))),_0x4acf('0x4f')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x50')))),'busyContacts'],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x51')))),_0x4acf('0x52')],[db['sequelize']['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x4acf('0x53')],[db['sequelize']['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x54')))),_0x4acf('0x55')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x2022,\x201,\x20null'))),_0x4acf('0x56')],[db[_0x4acf('0x4a')]['fn']('COUNT',db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal'](_0x4acf('0x57')))),_0x4acf('0x58')]]})[_0x4acf('0x21')](handleEntityNotFound(_0x2785b9,null))['then'](respondWithResult(_0x2785b9,null))[_0x4acf('0x3f')](handleError(_0x2785b9,null));};exports[_0x4acf('0x59')]=function(_0xb5bd81,_0x452ee6,_0x54b093){return db[_0x4acf('0x29')][_0x4acf('0x3d')]({'raw':![],'where':{'CampaignId':_0xb5bd81[_0x4acf('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x5a')))),_0x4acf('0x4d')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x4e')))),_0x4acf('0x4f')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x50')))),_0x4acf('0x5b')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x4acf('0x52')],[db['sequelize']['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4acf('0x5c')))),_0x4acf('0x53')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db['sequelize'][_0x4acf('0x4c')](_0x4acf('0x5d')))),_0x4acf('0x56')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db['sequelize'][_0x4acf('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x4acf('0x58')]]})[_0x4acf('0x21')](handleEntityNotFound(_0x452ee6,null))[_0x4acf('0x21')](respondWithResult(_0x452ee6,null))[_0x4acf('0x3f')](handleError(_0x452ee6,null));};exports[_0x4acf('0x5e')]=function(_0x173655,_0x1f2dbc,_0xc0d942){return db[_0x4acf('0x5f')][_0x4acf('0x45')]({'where':{'id':_0x173655[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x1f2dbc,null))['then'](function(_0x11f356){var _0xacca91;if(_0x11f356){_0xacca91=squel[_0x4acf('0x60')]()[_0x4acf('0x61')](_0x4acf('0x62'))[_0x4acf('0x63')]([_0x4acf('0x64'),_0x4acf('0x65'),_0x4acf('0x66'),_0x4acf('0x67'),'VoiceQueueId',_0x4acf('0x68'),_0x4acf('0x69')],squel['select']()[_0x4acf('0x6a')](_0x4acf('0x6b'),'phone')[_0x4acf('0x6a')]('NOW()','scheduledAt')[_0x4acf('0x6a')]('ANY_VALUE(ContactId)',_0x4acf('0x66'))[_0x4acf('0x6a')](_0x4acf('0x6c'),_0x4acf('0x67'))['field'](_0x4acf('0x6d'),_0x4acf('0x6e'))['field']('NOW()','createdAt')[_0x4acf('0x6a')]('NOW()',_0x4acf('0x69'))[_0x4acf('0x6f')](_0x4acf('0x70'))['where'](_0x4acf('0x71'),_0x173655[_0x4acf('0x41')]['id']['toString']())[_0x4acf('0x35')](_0x4acf('0x72'),_0x173655['body'][_0x4acf('0x73')][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x75'))[_0x4acf('0x35')](_0x4acf('0x76'),squel['select']()[_0x4acf('0x6a')]('phone')[_0x4acf('0x6f')](_0x4acf('0x62'))['where']('VoiceQueueId\x20=\x20?',_0x173655['params']['id'][_0x4acf('0x74')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x4acf('0x6a')]('calleridnum')[_0x4acf('0x6f')](_0x4acf('0x70'))[_0x4acf('0x35')](_0x4acf('0x71'),_0x173655[_0x4acf('0x41')]['id']['toString']())['where'](_0x4acf('0x77')))[_0x4acf('0x78')](_0x4acf('0x66')))[_0x4acf('0x74')]();return db[_0x4acf('0x4a')]['query'](_0xacca91);}return[];})[_0x4acf('0x21')](respondWithResult(_0x1f2dbc,null))[_0x4acf('0x3f')](handleError(_0x1f2dbc,null));};exports[_0x4acf('0x79')]=function(_0x453c6d,_0x1a82e7,_0x3d02c7){return db[_0x4acf('0x7a')]['find']({'where':{'id':_0x453c6d[_0x4acf('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a82e7,null))[_0x4acf('0x21')](function(_0x1bbe6d){var _0x2a36e2;if(_0x1bbe6d){_0x2a36e2=squel[_0x4acf('0x60')]()[_0x4acf('0x61')]('cm_hopper')[_0x4acf('0x63')](['phone',_0x4acf('0x65'),_0x4acf('0x66'),'ListId',_0x4acf('0x7b'),_0x4acf('0x68'),_0x4acf('0x69')],squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')]('ANY_VALUE(calleridnum)',_0x4acf('0x64'))['field']('NOW()',_0x4acf('0x65'))[_0x4acf('0x6a')](_0x4acf('0x7d'),_0x4acf('0x66'))['field']('ANY_VALUE(ListId)',_0x4acf('0x67'))[_0x4acf('0x6a')](_0x4acf('0x7e'),_0x4acf('0x7b'))[_0x4acf('0x6a')](_0x4acf('0x7f'),_0x4acf('0x68'))[_0x4acf('0x6a')]('NOW()','updatedAt')[_0x4acf('0x6f')](_0x4acf('0x70'))[_0x4acf('0x35')](_0x4acf('0x80'),_0x453c6d[_0x4acf('0x41')]['id'][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x72'),_0x453c6d[_0x4acf('0x47')]['state'][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x75'))[_0x4acf('0x35')](_0x4acf('0x76'),squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')](_0x4acf('0x64'))[_0x4acf('0x6f')](_0x4acf('0x62'))[_0x4acf('0x35')](_0x4acf('0x80'),_0x453c6d[_0x4acf('0x41')]['id']['toString']()))[_0x4acf('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')]('calleridnum')[_0x4acf('0x6f')](_0x4acf('0x70'))['where']('CampaignId\x20=\x20?',_0x453c6d[_0x4acf('0x41')]['id'][_0x4acf('0x74')]())['where']('state\x20=\x204'))[_0x4acf('0x78')](_0x4acf('0x66')))[_0x4acf('0x74')]();return db[_0x4acf('0x4a')]['query'](_0x2a36e2);}return[];})[_0x4acf('0x21')](respondWithResult(_0x1a82e7,null))[_0x4acf('0x3f')](handleError(_0x1a82e7,null));};exports[_0x4acf('0x81')]=function(_0x34e1ea,_0x43e9bf,_0x367ad4){return db[_0x4acf('0x82')]['findOne']({'where':{'VoiceQueueId':_0x34e1ea[_0x4acf('0x47')][_0x4acf('0x6e')],'CampaignId':_0x34e1ea[_0x4acf('0x47')]['CampaignId'],'ContactId':_0x34e1ea[_0x4acf('0x47')][_0x4acf('0x66')]}})[_0x4acf('0x21')](handleEntityNotFound(_0x43e9bf,null))[_0x4acf('0x21')](function(_0x37ffab){if(_0x37ffab){return _0x37ffab;}return null;})[_0x4acf('0x21')](respondWithResult(_0x43e9bf,null))[_0x4acf('0x3f')](handleError(_0x43e9bf,null));};
\ No newline at end of file
+var _0x90b1=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ListId','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','CmHopperFinal','includeAll','rows','include','find','catch','update','body'];(function(_0x1c2ea4,_0x16ac04){var _0x575866=function(_0x47272b){while(--_0x47272b){_0x1c2ea4['push'](_0x1c2ea4['shift']());}};_0x575866(++_0x16ac04);}(_0x90b1,0x1bb));var _0x190b=function(_0x56b215,_0x3adc22){_0x56b215=_0x56b215-0x0;var _0x23219c=_0x90b1[_0x56b215];return _0x23219c;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['CmHopperFinal'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['describe']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['describe']()[_0x190b('0x22')](respondWithResult(_0xadc789,null))[_0x190b('0x42')](handleError(_0xadc789,null));};exports[_0x190b('0x43')]=function(_0x505e52,_0x4cb561){if(_0x505e52[_0x190b('0x44')][_0x190b('0x45')]){delete _0x505e52[_0x190b('0x44')][_0x190b('0x45')];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'uniqueid':_0x505e52['params']['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x4cb561,null))[_0x190b('0x22')](saveUpdates(_0x505e52[_0x190b('0x44')],null))['then'](respondWithResult(_0x4cb561,null))[_0x190b('0x42')](handleError(_0x4cb561,null));};exports[_0x190b('0x46')]=function(_0x215ab6,_0x503700,_0xbc6757){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x215ab6[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db['sequelize']['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),_0x190b('0x50')],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0x503700,null))[_0x190b('0x22')](respondWithResult(_0x503700,null))['catch'](handleError(_0x503700,null));};exports[_0x190b('0x58')]=function(_0x270b59,_0xffe7cb,_0x405e04){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'CampaignId':_0x270b59[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x59')))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),'busyContacts'],[db[_0x190b('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x190b('0x5a')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x5b')))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0xffe7cb,null))['then'](respondWithResult(_0xffe7cb,null))[_0x190b('0x42')](handleError(_0xffe7cb,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2495c9,_0x348beb,_0x360d39){return db[_0x190b('0x5c')]['find']({'where':{'id':_0x2495c9[_0x190b('0x48')]['id']}})['then'](handleEntityNotFound(_0x348beb,null))[_0x190b('0x22')](function(_0x5073d2){var _0x49b60c;if(_0x5073d2){_0x49b60c=squel[_0x190b('0x5d')]()['into'](_0x190b('0x5e'))[_0x190b('0x5f')]([_0x190b('0x60'),_0x190b('0x61'),_0x190b('0x62'),'ListId',_0x190b('0x63'),_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),'phone')[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))['field'](_0x190b('0x69'),_0x190b('0x62'))[_0x190b('0x66')](_0x190b('0x6a'),'ListId')[_0x190b('0x66')](_0x190b('0x6b'),_0x190b('0x63'))['field'](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')]('NOW()',_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']())[_0x190b('0x3a')](_0x190b('0x6f'),_0x2495c9['body'][_0x190b('0x70')][_0x190b('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x190b('0x3a')](_0x190b('0x72'),squel['select']()['field'](_0x190b('0x60'))[_0x190b('0x6c')](_0x190b('0x5e'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']()))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9[_0x190b('0x48')]['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')]['query'](_0x49b60c);}return[];})['then'](respondWithResult(_0x348beb,null))[_0x190b('0x42')](handleError(_0x348beb,null));};exports[_0x190b('0x76')]=function(_0x4b988d,_0x40ac95,_0x18c5f4){return db[_0x190b('0x77')]['find']({'where':{'id':_0x4b988d[_0x190b('0x48')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x40ac95,null))['then'](function(_0x23298e){var _0x2ba27b;if(_0x23298e){_0x2ba27b=squel['insert']()[_0x190b('0x78')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x190b('0x62'),_0x190b('0x79'),'CampaignId',_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),_0x190b('0x60'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))[_0x190b('0x66')](_0x190b('0x69'),_0x190b('0x62'))['field'](_0x190b('0x6a'),'ListId')['field'](_0x190b('0x7a'),_0x190b('0x7b'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x6f'),_0x4b988d[_0x190b('0x44')][_0x190b('0x70')][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x7d'))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x60'))['from'](_0x190b('0x5e'))[_0x190b('0x3a')]('CampaignId\x20=\x20?',_0x4b988d['params']['id'][_0x190b('0x71')]()))[_0x190b('0x3a')](_0x190b('0x72'),squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')][_0x190b('0x2d')](_0x2ba27b);}return[];})[_0x190b('0x22')](respondWithResult(_0x40ac95,null))[_0x190b('0x42')](handleError(_0x40ac95,null));};exports['checkContactHopper']=function(_0x476c86,_0x298824,_0x5e7c76){return db[_0x190b('0x7e')][_0x190b('0x7f')]({'where':{'VoiceQueueId':_0x476c86[_0x190b('0x44')][_0x190b('0x63')],'CampaignId':_0x476c86[_0x190b('0x44')][_0x190b('0x7b')],'ContactId':_0x476c86[_0x190b('0x44')][_0x190b('0x62')]}})['then'](handleEntityNotFound(_0x298824,null))[_0x190b('0x22')](function(_0x1b3168){if(_0x1b3168){return _0x1b3168;}return null;})[_0x190b('0x22')](respondWithResult(_0x298824,null))[_0x190b('0x42')](handleError(_0x298824,null));};
\ No newline at end of file
index a1ece5e..f5c4cf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d23=['define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x6142a1,_0x305889){var _0xc9f086=function(_0x5ea79b){while(--_0x5ea79b){_0x6142a1['push'](_0x6142a1['shift']());}};_0xc9f086(++_0x305889);}(_0x0d23,0x171));var _0x30d2=function(_0x47639e,_0x1cd066){_0x47639e=_0x47639e-0x0;var _0x5731d0=_0x0d23[_0x47639e];return _0x5731d0;};'use strict';var _=require(_0x30d2('0x0'));var util=require('util');var logger=require(_0x30d2('0x1'))('api');var moment=require(_0x30d2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x30d2('0x3'));var rimraf=require(_0x30d2('0x4'));var config=require(_0x30d2('0x5'));var attributes=require(_0x30d2('0x6'));module[_0x30d2('0x7')]=function(_0x4e2753,_0x444fc3){return _0x4e2753[_0x30d2('0x8')](_0x30d2('0x9'),attributes,{'tableName':_0x30d2('0xa'),'paranoid':![],'indexes':[{'name':_0x30d2('0xb'),'fields':[_0x30d2('0xb')]},{'name':_0x30d2('0xc'),'fields':[_0x30d2('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d7d=['cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x3f78a3,_0x1a451e){var _0x85f6c8=function(_0x33a5d0){while(--_0x33a5d0){_0x3f78a3['push'](_0x3f78a3['shift']());}};_0x85f6c8(++_0x1a451e);}(_0x3d7d,0xf3));var _0xd3d7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3d7d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd3d7('0x0'));var util=require('util');var logger=require(_0xd3d7('0x1'))(_0xd3d7('0x2'));var moment=require(_0xd3d7('0x3'));var BPromise=require(_0xd3d7('0x4'));var rp=require(_0xd3d7('0x5'));var fs=require('fs');var path=require(_0xd3d7('0x6'));var rimraf=require(_0xd3d7('0x7'));var config=require(_0xd3d7('0x8'));var attributes=require(_0xd3d7('0x9'));module[_0xd3d7('0xa')]=function(_0x5706ce,_0x2877a7){return _0x5706ce[_0xd3d7('0xb')](_0xd3d7('0xc'),attributes,{'tableName':_0xd3d7('0xd'),'paranoid':![],'indexes':[{'name':_0xd3d7('0xe'),'fields':[_0xd3d7('0xe')]},{'name':_0xd3d7('0xf'),'fields':[_0xd3d7('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 6a56051..de28fbe 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(_0x337ed5,_0x3fbdd2){var _0xe6e1b6=function(_0x24bcdd){while(--_0x24bcdd){_0x337ed5['push'](_0x337ed5['shift']());}};_0xe6e1b6(++_0x3fbdd2);}(_0xb10b,0x12a));var _0xbb10=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0xb10b[_0x467cb0];return _0x2153f7;};'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(_0x2fa4b7,_0x48c74a){var _0x528e37=function(_0x4396db){while(--_0x4396db){_0x2fa4b7['push'](_0x2fa4b7['shift']());}};_0x528e37(++_0x48c74a);}(_0x7a54,0x106));var _0x47a5=function(_0x4d51a7,_0x1155ee){_0x4d51a7=_0x4d51a7-0x0;var _0x12ad09=_0x7a54[_0x4d51a7];return _0x12ad09;};'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 36669fa..ee803cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7df7=['countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','/:id','multer','util','express','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7df7,0x1b9));var _0x77df=function(_0x37b62b,_0x1f9e1b){_0x37b62b=_0x37b62b-0x0;var _0x3b0842=_0x7df7[_0x37b62b];return _0x3b0842;};'use strict';var multer=require(_0x77df('0x0'));var util=require(_0x77df('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x77df('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x77df('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x77df('0x4'));var controller=require(_0x77df('0x5'));router[_0x77df('0x6')]('/',auth[_0x77df('0x7')](),controller[_0x77df('0x8')]);router[_0x77df('0x6')](_0x77df('0x9'),auth[_0x77df('0x7')](),controller[_0x77df('0xa')]);router['get']('/:id',auth[_0x77df('0x7')](),controller[_0x77df('0xb')]);router[_0x77df('0x6')](_0x77df('0xc'),auth[_0x77df('0x7')](),controller[_0x77df('0xd')]);router['get'](_0x77df('0xe'),auth[_0x77df('0x7')](),controller[_0x77df('0xf')]);router['post'](_0x77df('0x10'),auth[_0x77df('0x7')](),controller[_0x77df('0x11')]);router[_0x77df('0x12')](_0x77df('0x13'),auth[_0x77df('0x7')](),controller[_0x77df('0x14')]);router['post'](_0x77df('0x15'),auth[_0x77df('0x7')](),controller['checkContactHopper']);router[_0x77df('0x16')](_0x77df('0x17'),auth['isAuthenticated'](),controller['update']);module['exports']=router;
\ No newline at end of file
+var _0xb6ff=['/describe','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','update','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','index','get'];(function(_0x1fcbef,_0x281b5f){var _0x130de9=function(_0xffe981){while(--_0xffe981){_0x1fcbef['push'](_0x1fcbef['shift']());}};_0x130de9(++_0x281b5f);}(_0xb6ff,0x185));var _0xfb6f=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0xb6ff[_0x1dd532];return _0x3732aa;};'use strict';var multer=require(_0xfb6f('0x0'));var util=require(_0xfb6f('0x1'));var path=require(_0xfb6f('0x2'));var timeout=require(_0xfb6f('0x3'));var express=require('express');var router=express[_0xfb6f('0x4')]();var fs_extra=require(_0xfb6f('0x5'));var auth=require(_0xfb6f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfb6f('0x7'));var controller=require(_0xfb6f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfb6f('0x9')]);router[_0xfb6f('0xa')](_0xfb6f('0xb'),auth[_0xfb6f('0xc')](),controller['describe']);router[_0xfb6f('0xa')](_0xfb6f('0xd'),auth['isAuthenticated'](),controller[_0xfb6f('0xe')]);router[_0xfb6f('0xa')](_0xfb6f('0xf'),auth['isAuthenticated'](),controller[_0xfb6f('0x10')]);router['get'](_0xfb6f('0x11'),auth['isAuthenticated'](),controller[_0xfb6f('0x12')]);router[_0xfb6f('0x13')](_0xfb6f('0x14'),auth[_0xfb6f('0xc')](),controller[_0xfb6f('0x15')]);router[_0xfb6f('0x13')](_0xfb6f('0x16'),auth[_0xfb6f('0xc')](),controller[_0xfb6f('0x17')]);router[_0xfb6f('0x13')]('/checkContactHopper',auth[_0xfb6f('0xc')](),controller['checkContactHopper']);router['put'](_0xfb6f('0xd'),auth['isAuthenticated'](),controller[_0xfb6f('0x18')]);module['exports']=router;
\ No newline at end of file
index eefb267..1b7412f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51cf=['exports','STRING','INTEGER','DATE','BOOLEAN','sequelize'];(function(_0x4a63d9,_0x2e32e1){var _0xca3ba0=function(_0x30e487){while(--_0x30e487){_0x4a63d9['push'](_0x4a63d9['shift']());}};_0xca3ba0(++_0x2e32e1);}(_0x51cf,0x1a3));var _0xf51c=function(_0xb866,_0x6ac93c){_0xb866=_0xb866-0x0;var _0x5ecaf3=_0x51cf[_0xb866];return _0x5ecaf3;};'use strict';var Sequelize=require(_0xf51c('0x0'));module[_0xf51c('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xf51c('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xf51c('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf51c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf51c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf51c('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xf51c('0x2')]},'originatecalleridname':{'type':Sequelize[_0xf51c('0x2')]},'calleridnum':{'type':Sequelize[_0xf51c('0x2')]},'calleridname':{'type':Sequelize[_0xf51c('0x2')]},'starttime':{'type':Sequelize[_0xf51c('0x4')]},'responsetime':{'type':Sequelize[_0xf51c('0x4')]},'answertime':{'type':Sequelize[_0xf51c('0x4')]},'droptime':{'type':Sequelize[_0xf51c('0x4')]},'endtime':{'type':Sequelize[_0xf51c('0x4')]},'ringtime':{'type':Sequelize[_0xf51c('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf51c('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf51c('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf51c('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xf51c('0x2')]},'membername':{'type':Sequelize[_0xf51c('0x2')]},'reason':{'type':Sequelize[_0xf51c('0x2')]},'amd':{'type':Sequelize[_0xf51c('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf51c('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xf51c('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf51c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf51c('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xf51c('0x4')]},'edited':{'type':Sequelize[_0xf51c('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xf51c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf51c('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf51c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf8a6=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x30eb36,_0x4f7dab){var _0x1b33d1=function(_0x4ab0ff){while(--_0x4ab0ff){_0x30eb36['push'](_0x30eb36['shift']());}};_0x1b33d1(++_0x4f7dab);}(_0xf8a6,0x16b));var _0x6f8a=function(_0x59da07,_0x2529e5){_0x59da07=_0x59da07-0x0;var _0x101a3d=_0xf8a6[_0x59da07];return _0x101a3d;};'use strict';var Sequelize=require(_0x6f8a('0x0'));module[_0x6f8a('0x1')]={'state':{'type':Sequelize[_0x6f8a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6f8a('0x3')]},'scheduledat':{'type':Sequelize[_0x6f8a('0x4')]},'countbusyretry':{'type':Sequelize[_0x6f8a('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6f8a('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6f8a('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6f8a('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x6f8a('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6f8a('0x3')]},'calleridname':{'type':Sequelize[_0x6f8a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6f8a('0x4')]},'answertime':{'type':Sequelize[_0x6f8a('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6f8a('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6f8a('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x6f8a('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6f8a('0x3')]},'reason':{'type':Sequelize[_0x6f8a('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x6f8a('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6f8a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6f8a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6f8a('0x4')]},'recallme':{'type':Sequelize[_0x6f8a('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x6f8a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6f8a('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6f8a('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6f8a('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6f8a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index b4c774e..ab6d773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27d4=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','destroy','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','catch','show','params','find','create','body','describe','uniqueid','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x27d4,0x1ec));var _0x427d=function(_0x5a64bd,_0x370774){_0x5a64bd=_0x5a64bd-0x0;var _0x1e06a2=_0x27d4[_0x5a64bd];return _0x1e06a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x427d('0x0'));var zipdir=require(_0x427d('0x1'));var jsonpatch=require(_0x427d('0x2'));var rp=require(_0x427d('0x3'));var moment=require(_0x427d('0x4'));var BPromise=require(_0x427d('0x5'));var Mustache=require(_0x427d('0x6'));var util=require(_0x427d('0x7'));var path=require('path');var sox=require(_0x427d('0x8'));var csv=require(_0x427d('0x9'));var ejs=require(_0x427d('0xa'));var fs=require('fs');var fs_extra=require(_0x427d('0xb'));var _=require('lodash');var squel=require(_0x427d('0xc'));var crypto=require(_0x427d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x427d('0xe'));var toCsv=require(_0x427d('0x9'));var querystring=require(_0x427d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x427d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x427d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x427d('0x12'))(_0x427d('0x13'));var utils=require(_0x427d('0x14'));var config=require(_0x427d('0x15'));var licenseUtil=require(_0x427d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x370f01,_0x3f3409){_0x3f3409=_0x3f3409||0xcc;return function(_0x11ac21){if(_0x11ac21){return _0x370f01[_0x427d('0x17')](_0x3f3409);}return _0x370f01[_0x427d('0x18')](_0x3f3409)[_0x427d('0x19')]();};}function respondWithResult(_0x54c588,_0x336bf7){_0x336bf7=_0x336bf7||0xc8;return function(_0x1dc274){if(_0x1dc274){return _0x54c588[_0x427d('0x18')](_0x336bf7)['json'](_0x1dc274);}};}function respondWithFilteredResult(_0x4f3a34,_0x594b7e){return function(_0xa89434){if(_0xa89434){var _0xdddebd=typeof _0x594b7e[_0x427d('0x1a')]===_0x427d('0x1b')&&typeof _0x594b7e[_0x427d('0x1c')]==='undefined';var _0x281f6d=_0xa89434['count'];var _0x419f9b=_0xdddebd?0x0:_0x594b7e[_0x427d('0x1a')];var _0x2187fe=_0xdddebd?_0xa89434[_0x427d('0x1d')]:_0x594b7e['offset']+_0x594b7e[_0x427d('0x1c')];var _0x25407a;if(_0x2187fe>=_0x281f6d){_0x2187fe=_0x281f6d;_0x25407a=0xc8;}else{_0x25407a=0xce;}_0x4f3a34[_0x427d('0x18')](_0x25407a);return _0x4f3a34[_0x427d('0x1e')](_0x427d('0x1f'),_0x419f9b+'-'+_0x2187fe+'/'+_0x281f6d)[_0x427d('0x20')](_0xa89434);}return null;};}function patchUpdates(_0x2d6494){return function(_0x78f2a){try{jsonpatch['apply'](_0x78f2a,_0x2d6494,!![]);}catch(_0x39adb3){return BPromise[_0x427d('0x21')](_0x39adb3);}return _0x78f2a['save']();};}function saveUpdates(_0x431a09,_0x19406a){return function(_0x4d6b8f){if(_0x4d6b8f){return _0x4d6b8f[_0x427d('0x22')](_0x431a09)['then'](function(_0x238ceb){return _0x238ceb;});}return null;};}function removeEntity(_0x526a4e,_0x29a96e){return function(_0x24aa45){if(_0x24aa45){return _0x24aa45[_0x427d('0x23')]()['then'](function(){_0x526a4e[_0x427d('0x18')](0xcc)[_0x427d('0x19')]();});}};}function handleEntityNotFound(_0x5e760b,_0x232a4a){return function(_0x237069){if(!_0x237069){_0x5e760b[_0x427d('0x17')](0x194);}return _0x237069;};}function handleError(_0x53979c,_0x194247){_0x194247=_0x194247||0x1f4;return function(_0xb69343){logger['error'](_0xb69343['stack']);if(_0xb69343[_0x427d('0x24')]){delete _0xb69343[_0x427d('0x24')];}_0x53979c['status'](_0x194247)[_0x427d('0x25')](_0xb69343);};}exports['index']=function(_0x4e308e,_0x1d7e10){var _0x16e96e={},_0x112128={},_0x36b9c7={'count':0x0,'rows':[]};var _0x594d80=_[_0x427d('0x26')](db[_0x427d('0x27')][_0x427d('0x28')],function(_0x3ff0e8){return{'name':_0x3ff0e8[_0x427d('0x29')],'type':_0x3ff0e8[_0x427d('0x2a')][_0x427d('0x2b')]};});_0x112128['model']=_[_0x427d('0x26')](_0x594d80,_0x427d('0x24'));_0x112128[_0x427d('0x2c')]=_[_0x427d('0x2d')](_0x4e308e[_0x427d('0x2c')]);_0x112128[_0x427d('0x2e')]=_[_0x427d('0x2f')](_0x112128[_0x427d('0x30')],_0x112128['query']);_0x16e96e[_0x427d('0x31')]=_[_0x427d('0x2f')](_0x112128[_0x427d('0x30')],qs[_0x427d('0x32')](_0x4e308e['query'][_0x427d('0x32')]));_0x16e96e['attributes']=_0x16e96e['attributes'][_0x427d('0x33')]?_0x16e96e['attributes']:_0x112128[_0x427d('0x30')];if(!_0x4e308e[_0x427d('0x2c')][_0x427d('0x34')]('nolimit')){_0x16e96e[_0x427d('0x1c')]=qs[_0x427d('0x1c')](_0x4e308e[_0x427d('0x2c')][_0x427d('0x1c')]);_0x16e96e['offset']=qs[_0x427d('0x1a')](_0x4e308e[_0x427d('0x2c')][_0x427d('0x1a')]);}_0x16e96e[_0x427d('0x35')]=qs[_0x427d('0x36')](_0x4e308e[_0x427d('0x2c')]['sort']);_0x16e96e[_0x427d('0x37')]=qs['filters'](_[_0x427d('0x38')](_0x4e308e['query'],_0x112128[_0x427d('0x2e')]),_0x594d80);if(_0x4e308e[_0x427d('0x2c')][_0x427d('0x39')]){_0x16e96e[_0x427d('0x37')]=_[_0x427d('0x3a')](_0x16e96e[_0x427d('0x37')],{'$or':_['map'](_0x594d80,function(_0x560a6b){if(_0x560a6b['type']!==_0x427d('0x3b')){var _0x48c2e5={};_0x48c2e5[_0x560a6b['name']]={'$like':'%'+_0x4e308e['query']['filter']+'%'};return _0x48c2e5;}})});}_0x16e96e=_['merge']({},_0x16e96e,_0x4e308e[_0x427d('0x3c')]);var _0x52bbc0={'where':_0x16e96e['where']};return db['CmHopperHistory']['count'](_0x52bbc0)[_0x427d('0x3d')](function(_0x18bd59){_0x36b9c7[_0x427d('0x1d')]=_0x18bd59;if(_0x4e308e[_0x427d('0x2c')]['includeAll']){_0x16e96e[_0x427d('0x3e')]=[{'all':!![]}];}return db[_0x427d('0x27')]['findAll'](_0x16e96e);})[_0x427d('0x3d')](function(_0x4fb832){_0x36b9c7['rows']=_0x4fb832;return _0x36b9c7;})[_0x427d('0x3d')](respondWithFilteredResult(_0x1d7e10,_0x16e96e))[_0x427d('0x3f')](handleError(_0x1d7e10,null));};exports[_0x427d('0x40')]=function(_0x28320e,_0x352c4d){var _0x9ce13b={'raw':!![],'where':{'id':_0x28320e[_0x427d('0x41')]['id']}},_0x4c748d={};_0x4c748d['model']=_['keys'](db[_0x427d('0x27')][_0x427d('0x28')]);_0x4c748d['query']=_[_0x427d('0x2d')](_0x28320e[_0x427d('0x2c')]);_0x4c748d[_0x427d('0x2e')]=_[_0x427d('0x2f')](_0x4c748d[_0x427d('0x30')],_0x4c748d['query']);_0x9ce13b[_0x427d('0x31')]=_['intersection'](_0x4c748d[_0x427d('0x30')],qs['fields'](_0x28320e[_0x427d('0x2c')][_0x427d('0x32')]));_0x9ce13b[_0x427d('0x31')]=_0x9ce13b[_0x427d('0x31')][_0x427d('0x33')]?_0x9ce13b[_0x427d('0x31')]:_0x4c748d[_0x427d('0x30')];if(_0x28320e['query']['includeAll']){_0x9ce13b[_0x427d('0x3e')]=[{'all':!![]}];}_0x9ce13b=_['merge']({},_0x9ce13b,_0x28320e[_0x427d('0x3c')]);return db[_0x427d('0x27')][_0x427d('0x42')](_0x9ce13b)[_0x427d('0x3d')](handleEntityNotFound(_0x352c4d,null))['then'](respondWithResult(_0x352c4d,null))[_0x427d('0x3f')](handleError(_0x352c4d,null));};exports[_0x427d('0x43')]=function(_0x35892f,_0x2702e4){return db['CmHopperHistory']['create'](_0x35892f[_0x427d('0x44')],{})[_0x427d('0x3d')](respondWithResult(_0x2702e4,0xc9))[_0x427d('0x3f')](handleError(_0x2702e4,null));};exports['describe']=function(_0x570533,_0x459d88){return db[_0x427d('0x27')][_0x427d('0x45')]()[_0x427d('0x3d')](respondWithResult(_0x459d88,null))[_0x427d('0x3f')](handleError(_0x459d88,null));};exports['update']=function(_0x592323,_0x374676){if(_0x592323[_0x427d('0x44')][_0x427d('0x46')]){delete _0x592323[_0x427d('0x44')]['uniqueid'];}return db['CmHopperHistory'][_0x427d('0x42')]({'where':{'uniqueid':_0x592323['params']['id']}})[_0x427d('0x3d')](handleEntityNotFound(_0x374676,null))[_0x427d('0x3d')](saveUpdates(_0x592323[_0x427d('0x44')],null))[_0x427d('0x3d')](respondWithResult(_0x374676,null))[_0x427d('0x3f')](handleError(_0x374676,null));};
\ No newline at end of file
+var _0x19d6=['index','map','CmHopperHistory','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','length','includeAll','include','find','create','body','describe','uniqueid','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../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','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send'];(function(_0x455ee2,_0x507212){var _0xee4271=function(_0x365d93){while(--_0x365d93){_0x455ee2['push'](_0x455ee2['shift']());}};_0xee4271(++_0x507212);}(_0x19d6,0x1f2));var _0x619d=function(_0x27bd84,_0x34fe2f){_0x27bd84=_0x27bd84-0x0;var _0x2fad3b=_0x19d6[_0x27bd84];return _0x2fad3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x619d('0x0'));var zipdir=require(_0x619d('0x1'));var jsonpatch=require(_0x619d('0x2'));var rp=require(_0x619d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x619d('0x4'));var util=require(_0x619d('0x5'));var path=require(_0x619d('0x6'));var sox=require(_0x619d('0x7'));var csv=require('to-csv');var ejs=require(_0x619d('0x8'));var fs=require('fs');var fs_extra=require(_0x619d('0x9'));var _=require(_0x619d('0xa'));var squel=require(_0x619d('0xb'));var crypto=require(_0x619d('0xc'));var jsforce=require(_0x619d('0xd'));var deskjs=require(_0x619d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x619d('0xf'));var Papa=require(_0x619d('0x10'));var Redis=require('ioredis');var authService=require(_0x619d('0x11'));var qs=require(_0x619d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x619d('0x13'));var logger=require(_0x619d('0x14'))('api');var utils=require(_0x619d('0x15'));var config=require(_0x619d('0x16'));var licenseUtil=require(_0x619d('0x17'));var db=require(_0x619d('0x18'))['db'];function respondWithStatusCode(_0x3743a7,_0x112776){_0x112776=_0x112776||0xcc;return function(_0x228a81){if(_0x228a81){return _0x3743a7['sendStatus'](_0x112776);}return _0x3743a7[_0x619d('0x19')](_0x112776)['end']();};}function respondWithResult(_0x4759c5,_0x2b8762){_0x2b8762=_0x2b8762||0xc8;return function(_0x1a6565){if(_0x1a6565){return _0x4759c5[_0x619d('0x19')](_0x2b8762)[_0x619d('0x1a')](_0x1a6565);}};}function respondWithFilteredResult(_0x416c32,_0x1f1e3f){return function(_0x44ce1f){if(_0x44ce1f){var _0x503cc6=typeof _0x1f1e3f[_0x619d('0x1b')]===_0x619d('0x1c')&&typeof _0x1f1e3f[_0x619d('0x1d')]===_0x619d('0x1c');var _0x428dbf=_0x44ce1f[_0x619d('0x1e')];var _0x252ca4=_0x503cc6?0x0:_0x1f1e3f[_0x619d('0x1b')];var _0x51006a=_0x503cc6?_0x44ce1f[_0x619d('0x1e')]:_0x1f1e3f['offset']+_0x1f1e3f[_0x619d('0x1d')];var _0x36f554;if(_0x51006a>=_0x428dbf){_0x51006a=_0x428dbf;_0x36f554=0xc8;}else{_0x36f554=0xce;}_0x416c32[_0x619d('0x19')](_0x36f554);return _0x416c32['set'](_0x619d('0x1f'),_0x252ca4+'-'+_0x51006a+'/'+_0x428dbf)[_0x619d('0x1a')](_0x44ce1f);}return null;};}function patchUpdates(_0x2bb3d5){return function(_0x296a96){try{jsonpatch[_0x619d('0x20')](_0x296a96,_0x2bb3d5,!![]);}catch(_0x603ef7){return BPromise[_0x619d('0x21')](_0x603ef7);}return _0x296a96['save']();};}function saveUpdates(_0x261461,_0x53e411){return function(_0x527577){if(_0x527577){return _0x527577[_0x619d('0x22')](_0x261461)[_0x619d('0x23')](function(_0x7d5545){return _0x7d5545;});}return null;};}function removeEntity(_0x5a928a,_0x4f5aea){return function(_0x4d5a2d){if(_0x4d5a2d){return _0x4d5a2d[_0x619d('0x24')]()['then'](function(){_0x5a928a[_0x619d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x400796,_0x1eddd1){return function(_0x141900){if(!_0x141900){_0x400796[_0x619d('0x25')](0x194);}return _0x141900;};}function handleError(_0x3b5b6d,_0x3ec647){_0x3ec647=_0x3ec647||0x1f4;return function(_0x87ac00){logger[_0x619d('0x26')](_0x87ac00['stack']);if(_0x87ac00['name']){delete _0x87ac00[_0x619d('0x27')];}_0x3b5b6d[_0x619d('0x19')](_0x3ec647)[_0x619d('0x28')](_0x87ac00);};}exports[_0x619d('0x29')]=function(_0x539d4e,_0x2c0e63){var _0x124c94={},_0x582503={},_0x1233c0={'count':0x0,'rows':[]};var _0x364033=_[_0x619d('0x2a')](db[_0x619d('0x2b')][_0x619d('0x2c')],function(_0x20bc49){return{'name':_0x20bc49[_0x619d('0x2d')],'type':_0x20bc49[_0x619d('0x2e')][_0x619d('0x2f')]};});_0x582503['model']=_[_0x619d('0x2a')](_0x364033,_0x619d('0x27'));_0x582503[_0x619d('0x30')]=_[_0x619d('0x31')](_0x539d4e[_0x619d('0x30')]);_0x582503[_0x619d('0x32')]=_[_0x619d('0x33')](_0x582503[_0x619d('0x34')],_0x582503[_0x619d('0x30')]);_0x124c94[_0x619d('0x35')]=_[_0x619d('0x33')](_0x582503[_0x619d('0x34')],qs[_0x619d('0x36')](_0x539d4e[_0x619d('0x30')][_0x619d('0x36')]));_0x124c94[_0x619d('0x35')]=_0x124c94[_0x619d('0x35')]['length']?_0x124c94[_0x619d('0x35')]:_0x582503['model'];if(!_0x539d4e['query'][_0x619d('0x37')](_0x619d('0x38'))){_0x124c94[_0x619d('0x1d')]=qs[_0x619d('0x1d')](_0x539d4e[_0x619d('0x30')]['limit']);_0x124c94[_0x619d('0x1b')]=qs[_0x619d('0x1b')](_0x539d4e[_0x619d('0x30')][_0x619d('0x1b')]);}_0x124c94[_0x619d('0x39')]=qs[_0x619d('0x3a')](_0x539d4e[_0x619d('0x30')]['sort']);_0x124c94[_0x619d('0x3b')]=qs[_0x619d('0x32')](_[_0x619d('0x3c')](_0x539d4e[_0x619d('0x30')],_0x582503[_0x619d('0x32')]),_0x364033);if(_0x539d4e[_0x619d('0x30')][_0x619d('0x3d')]){_0x124c94['where']=_[_0x619d('0x3e')](_0x124c94['where'],{'$or':_[_0x619d('0x2a')](_0x364033,function(_0x3fd8c9){if(_0x3fd8c9[_0x619d('0x2e')]!==_0x619d('0x3f')){var _0x2110ce={};_0x2110ce[_0x3fd8c9[_0x619d('0x27')]]={'$like':'%'+_0x539d4e[_0x619d('0x30')][_0x619d('0x3d')]+'%'};return _0x2110ce;}})});}_0x124c94=_[_0x619d('0x3e')]({},_0x124c94,_0x539d4e[_0x619d('0x40')]);var _0x89dd6f={'where':_0x124c94['where']};return db['CmHopperHistory'][_0x619d('0x1e')](_0x89dd6f)[_0x619d('0x23')](function(_0x12dc2e){_0x1233c0[_0x619d('0x1e')]=_0x12dc2e;if(_0x539d4e[_0x619d('0x30')]['includeAll']){_0x124c94['include']=[{'all':!![]}];}return db[_0x619d('0x2b')][_0x619d('0x41')](_0x124c94);})['then'](function(_0x346bbf){_0x1233c0['rows']=_0x346bbf;return _0x1233c0;})['then'](respondWithFilteredResult(_0x2c0e63,_0x124c94))[_0x619d('0x42')](handleError(_0x2c0e63,null));};exports[_0x619d('0x43')]=function(_0xcaf269,_0x254287){var _0x59c265={'raw':!![],'where':{'id':_0xcaf269[_0x619d('0x44')]['id']}},_0x5119ec={};_0x5119ec[_0x619d('0x34')]=_[_0x619d('0x31')](db[_0x619d('0x2b')][_0x619d('0x2c')]);_0x5119ec['query']=_[_0x619d('0x31')](_0xcaf269[_0x619d('0x30')]);_0x5119ec['filters']=_[_0x619d('0x33')](_0x5119ec[_0x619d('0x34')],_0x5119ec[_0x619d('0x30')]);_0x59c265[_0x619d('0x35')]=_['intersection'](_0x5119ec[_0x619d('0x34')],qs[_0x619d('0x36')](_0xcaf269[_0x619d('0x30')]['fields']));_0x59c265[_0x619d('0x35')]=_0x59c265[_0x619d('0x35')][_0x619d('0x45')]?_0x59c265['attributes']:_0x5119ec[_0x619d('0x34')];if(_0xcaf269[_0x619d('0x30')][_0x619d('0x46')]){_0x59c265[_0x619d('0x47')]=[{'all':!![]}];}_0x59c265=_['merge']({},_0x59c265,_0xcaf269['options']);return db[_0x619d('0x2b')][_0x619d('0x48')](_0x59c265)['then'](handleEntityNotFound(_0x254287,null))[_0x619d('0x23')](respondWithResult(_0x254287,null))[_0x619d('0x42')](handleError(_0x254287,null));};exports[_0x619d('0x49')]=function(_0x5c43f3,_0x1b4f61){return db[_0x619d('0x2b')]['create'](_0x5c43f3[_0x619d('0x4a')],{})[_0x619d('0x23')](respondWithResult(_0x1b4f61,0xc9))[_0x619d('0x42')](handleError(_0x1b4f61,null));};exports[_0x619d('0x4b')]=function(_0x10dda7,_0x134e2b){return db['CmHopperHistory'][_0x619d('0x4b')]()['then'](respondWithResult(_0x134e2b,null))[_0x619d('0x42')](handleError(_0x134e2b,null));};exports[_0x619d('0x22')]=function(_0x468a9b,_0x3850b4){if(_0x468a9b[_0x619d('0x4a')]['uniqueid']){delete _0x468a9b[_0x619d('0x4a')][_0x619d('0x4c')];}return db[_0x619d('0x2b')][_0x619d('0x48')]({'where':{'uniqueid':_0x468a9b['params']['id']}})[_0x619d('0x23')](handleEntityNotFound(_0x3850b4,null))[_0x619d('0x23')](saveUpdates(_0x468a9b['body'],null))[_0x619d('0x23')](respondWithResult(_0x3850b4,null))[_0x619d('0x42')](handleError(_0x3850b4,null));};
\ No newline at end of file
index 3d9bf87..ed35014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x374202,_0x4d6227){var _0xbc3162=function(_0x2760fa){while(--_0x2760fa){_0x374202['push'](_0x374202['shift']());}};_0xbc3162(++_0x4d6227);}(_0x5204,0xdf));var _0x4520=function(_0x58381c,_0x3b9374){_0x58381c=_0x58381c-0x0;var _0x1a7440=_0x5204[_0x58381c];return _0x1a7440;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var logger=require('../../config/logger')(_0x4520('0x2'));var moment=require(_0x4520('0x3'));var BPromise=require(_0x4520('0x4'));var rp=require(_0x4520('0x5'));var fs=require('fs');var path=require(_0x4520('0x6'));var rimraf=require('rimraf');var config=require(_0x4520('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x4520('0x8')]=function(_0x209381,_0xe0a256){return _0x209381[_0x4520('0x9')](_0x4520('0xa'),attributes,{'tableName':_0x4520('0xb'),'paranoid':![],'indexes':[{'name':_0x4520('0xc'),'fields':['endtime']},{'name':_0x4520('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6144=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x39a692,_0x79666d){var _0x20c3ae=function(_0x2a2ca7){while(--_0x2a2ca7){_0x39a692['push'](_0x39a692['shift']());}};_0x20c3ae(++_0x79666d);}(_0x6144,0x99));var _0x4614=function(_0x21f51c,_0x335cdc){_0x21f51c=_0x21f51c-0x0;var _0x5c7c9d=_0x6144[_0x21f51c];return _0x5c7c9d;};'use strict';var _=require(_0x4614('0x0'));var util=require(_0x4614('0x1'));var logger=require(_0x4614('0x2'))(_0x4614('0x3'));var moment=require('moment');var BPromise=require(_0x4614('0x4'));var rp=require(_0x4614('0x5'));var fs=require('fs');var path=require(_0x4614('0x6'));var rimraf=require(_0x4614('0x7'));var config=require('../../config/environment');var attributes=require(_0x4614('0x8'));module[_0x4614('0x9')]=function(_0x40832b,_0x935177){return _0x40832b[_0x4614('0xa')]('CmHopperHistory',attributes,{'tableName':_0x4614('0xb'),'paranoid':![],'indexes':[{'name':_0x4614('0xc'),'fields':[_0x4614('0xc')]},{'name':_0x4614('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 798d077..3ddbf47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8149=['predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','stringify','AvgHandleTime','findAll','where','COUNT','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null'];(function(_0x552f19,_0x453342){var _0x4983ac=function(_0x5dea27){while(--_0x5dea27){_0x552f19['push'](_0x552f19['shift']());}};_0x4983ac(++_0x453342);}(_0x8149,0xe6));var _0x9814=function(_0x1b9564,_0x21b6ea){_0x1b9564=_0x1b9564-0x0;var _0x51611e=_0x8149[_0x1b9564];return _0x51611e;};'use strict';var _=require(_0x9814('0x0'));var util=require(_0x9814('0x1'));var moment=require('moment');var BPromise=require(_0x9814('0x2'));var rs=require(_0x9814('0x3'));var fs=require('fs');var Redis=require(_0x9814('0x4'));var db=require(_0x9814('0x5'))['db'];var utils=require(_0x9814('0x6'));var logger=require(_0x9814('0x7'))(_0x9814('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9814('0x9')][_0x9814('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f9417,_0x2bc514,_0x300acc){return new BPromise(function(_0x74c0fd,_0x519425){return client['request'](_0x3f9417,_0x300acc)[_0x9814('0xb')](function(_0x5e841d){logger[_0x9814('0xc')](_0x9814('0xd'),_0x2bc514,'request\x20sent');logger[_0x9814('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x2bc514,_0x9814('0xf'),JSON['stringify'](_0x5e841d));if(_0x5e841d[_0x9814('0x10')]){if(_0x5e841d[_0x9814('0x10')]['code']===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x2bc514,_0x5e841d[_0x9814('0x10')][_0x9814('0x11')]);return _0x519425(_0x5e841d[_0x9814('0x10')][_0x9814('0x11')]);}logger[_0x9814('0x10')](_0x9814('0xd'),_0x2bc514,_0x5e841d['error']['message']);return _0x74c0fd(_0x5e841d[_0x9814('0x10')][_0x9814('0x11')]);}else{logger['info'](_0x9814('0xd'),_0x2bc514,_0x9814('0xf'));_0x74c0fd(_0x5e841d['result'][_0x9814('0x11')]);}})[_0x9814('0x12')](function(_0x3354ea){logger[_0x9814('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x2bc514,_0x3354ea);_0x519425(_0x3354ea);});});}exports[_0x9814('0x13')]=function(_0x1f12c7){var _0x5dcb6e=this;return new Promise(function(_0x304665,_0x38441d){return db[_0x9814('0x14')]['create'](_0x1f12c7[_0x9814('0x15')],{'raw':_0x1f12c7[_0x9814('0x16')]?_0x1f12c7[_0x9814('0x16')][_0x9814('0x17')]===undefined?!![]:![]:!![]})[_0x9814('0xb')](function(_0x53da8e){logger[_0x9814('0xc')](_0x9814('0x13'),_0x1f12c7);logger[_0x9814('0xe')]('CreateCmHopperHistory',_0x1f12c7,JSON[_0x9814('0x18')](_0x53da8e));_0x304665(_0x53da8e);})[_0x9814('0x12')](function(_0x13a418){logger['error'](_0x9814('0x13'),_0x13a418[_0x9814('0x11')],_0x1f12c7);_0x38441d(_0x5dcb6e[_0x9814('0x10')](0x1f4,_0x13a418['message']));});});};exports[_0x9814('0x19')]=function(_0x2d33d0){var _0x3f6937=this;return new Promise(function(_0x1318e0,_0x4fdcc2){return db['CmHopperHistory'][_0x9814('0x1a')]({'raw':_0x2d33d0['options']?_0x2d33d0[_0x9814('0x16')][_0x9814('0x17')]===undefined?!![]:![]:!![],'where':_0x2d33d0['options']?_0x2d33d0[_0x9814('0x16')][_0x9814('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')][_0x9814('0x1e')]('id')),'predictiveIntervalTotalCalls'],[db[_0x9814('0x1d')]['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x20')))),_0x9814('0x21')],[db[_0x9814('0x1d')]['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x22')))),_0x9814('0x23')],[db[_0x9814('0x1d')]['fn']('COUNT',db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x9814('0x1d')]['fn']('AVG',db[_0x9814('0x1d')]['fn']('IF',db['sequelize'][_0x9814('0x1f')](_0x9814('0x25')))),_0x9814('0x26')],[db[_0x9814('0x1d')]['fn']('AVG',db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')]['literal'](_0x9814('0x27')))),'predictiveIntervalAvgTalktime']]})[_0x9814('0xb')](function(_0x159877){logger[_0x9814('0xc')]('AvgHandleTime',_0x2d33d0);logger[_0x9814('0xe')]('AvgHandleTime',_0x2d33d0,JSON[_0x9814('0x18')](_0x159877));_0x1318e0(_0x159877);})[_0x9814('0x12')](function(_0x5e402c){logger[_0x9814('0x10')](_0x9814('0x19'),_0x5e402c[_0x9814('0x11')],_0x2d33d0);_0x4fdcc2(_0x3f6937['error'](0x1f4,_0x5e402c[_0x9814('0x11')]));});});};exports[_0x9814('0x28')]=function(_0x338045){var _0x4892ff=this;return new Promise(function(_0x336ad6,_0x4fecf1){return db['CmHopperHistory'][_0x9814('0x1a')]({'raw':_0x338045[_0x9814('0x16')]?_0x338045[_0x9814('0x16')][_0x9814('0x17')]===undefined?!![]:![]:!![],'where':_0x338045['options']?_0x338045[_0x9814('0x16')][_0x9814('0x1b')]||null:null,'attributes':[[_0x9814('0x29'),_0x9814('0x2a')],[db[_0x9814('0x1d')]['fn']('COUNT',db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x2b')))),_0x9814('0x2c')],[db[_0x9814('0x1d')]['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')]('`state`\x20=\x203,\x201,\x20null'))),_0x9814('0x2d')],[db[_0x9814('0x1d')]['fn']('COUNT',db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x20')))),_0x9814('0x2e')],[db[_0x9814('0x1d')]['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')]['literal'](_0x9814('0x2f')))),_0x9814('0x30')],[db[_0x9814('0x1d')]['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db['sequelize'][_0x9814('0x1f')](_0x9814('0x31')))),'outboundCongestionCallsDay'],[db['sequelize']['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x32')))),_0x9814('0x33')],[db[_0x9814('0x1d')]['fn']('COUNT',db[_0x9814('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x9814('0x34')))),_0x9814('0x35')],[db['sequelize']['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db['sequelize']['literal'](_0x9814('0x36')))),_0x9814('0x37')],[db['sequelize']['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x38')))),_0x9814('0x39')],[db[_0x9814('0x1d')]['fn']('COUNT',db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x3a')))),_0x9814('0x3b')],[db['sequelize']['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x3c')))),_0x9814('0x3d')],[db['sequelize']['fn'](_0x9814('0x1c'),db['sequelize']['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x3e')))),_0x9814('0x3b')],[db[_0x9814('0x1d')]['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db[_0x9814('0x1d')][_0x9814('0x1f')](_0x9814('0x3f')))),'outboundReCallsDay']],'group':['campaign']})[_0x9814('0xb')](function(_0x2b984d){logger[_0x9814('0xc')](_0x9814('0x28'),_0x338045);logger[_0x9814('0xe')](_0x9814('0x28'),_0x338045,JSON['stringify'](_0x2b984d));_0x336ad6(_0x2b984d);})[_0x9814('0x12')](function(_0x3ee751){logger[_0x9814('0x10')](_0x9814('0x28'),_0x3ee751[_0x9814('0x11')],_0x338045);_0x4fecf1(_0x4892ff[_0x9814('0x10')](0x1f4,_0x3ee751['message']));});});};exports[_0x9814('0x40')]=function(_0x1fa443){var _0x9d8947=this;return new Promise(function(_0x1e7f04,_0x3aa991){return db['CmHopperHistory'][_0x9814('0x1a')]({'raw':_0x1fa443['options']?_0x1fa443[_0x9814('0x16')][_0x9814('0x17')]===undefined?!![]:![]:!![],'where':_0x1fa443[_0x9814('0x16')]?_0x1fa443[_0x9814('0x16')][_0x9814('0x1b')]||null:null,'attributes':[[_0x9814('0x29'),_0x9814('0x2a')],[db[_0x9814('0x1d')]['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')][_0x9814('0x1e')]('id')),_0x9814('0x41')],[db[_0x9814('0x1d')]['fn'](_0x9814('0x1c'),db[_0x9814('0x1d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x9814('0x42')]],'group':[_0x9814('0x29')]})['then'](function(_0xaafe3){logger['info'](_0x9814('0x40'),_0x1fa443);logger[_0x9814('0xe')](_0x9814('0x40'),_0x1fa443,JSON[_0x9814('0x18')](_0xaafe3));_0x1e7f04(_0xaafe3);})[_0x9814('0x12')](function(_0x30add7){logger[_0x9814('0x10')]('GetCampaignHopperHistory',_0x30add7[_0x9814('0x11')],_0x1fa443);_0x3aa991(_0x9d8947[_0x9814('0x10')](0x1f4,_0x30add7[_0x9814('0x11')]));});});};
\ No newline at end of file
+var _0xd0be=['catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`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','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x4474c2,_0x59cf02){var _0x435fbb=function(_0x3c86eb){while(--_0x3c86eb){_0x4474c2['push'](_0x4474c2['shift']());}};_0x435fbb(++_0x59cf02);}(_0xd0be,0x1a0));var _0xed0b=function(_0x75e866,_0x30b4de){_0x75e866=_0x75e866-0x0;var _0x5e4b64=_0xd0be[_0x75e866];return _0x5e4b64;};'use strict';var _=require(_0xed0b('0x0'));var util=require(_0xed0b('0x1'));var moment=require(_0xed0b('0x2'));var BPromise=require(_0xed0b('0x3'));var rs=require(_0xed0b('0x4'));var fs=require('fs');var Redis=require(_0xed0b('0x5'));var db=require(_0xed0b('0x6'))['db'];var utils=require(_0xed0b('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xed0b('0x8'));var client=jayson[_0xed0b('0x9')][_0xed0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x234dcd,_0x20c99d,_0x3b8c09){return new BPromise(function(_0xa4213d,_0x1848f4){return client['request'](_0x234dcd,_0x3b8c09)[_0xed0b('0xb')](function(_0x529957){logger[_0xed0b('0xc')](_0xed0b('0xd'),_0x20c99d,_0xed0b('0xe'));logger[_0xed0b('0xf')](_0xed0b('0x10'),_0x20c99d,_0xed0b('0xe'),JSON[_0xed0b('0x11')](_0x529957));if(_0x529957['error']){if(_0x529957['error'][_0xed0b('0x12')]===0x1f4){logger[_0xed0b('0x13')]('CmHopperHistory,\x20%s,\x20%s',_0x20c99d,_0x529957['error'][_0xed0b('0x14')]);return _0x1848f4(_0x529957[_0xed0b('0x13')][_0xed0b('0x14')]);}logger[_0xed0b('0x13')](_0xed0b('0xd'),_0x20c99d,_0x529957['error']['message']);return _0xa4213d(_0x529957[_0xed0b('0x13')][_0xed0b('0x14')]);}else{logger['info'](_0xed0b('0xd'),_0x20c99d,_0xed0b('0xe'));_0xa4213d(_0x529957[_0xed0b('0x15')][_0xed0b('0x14')]);}})[_0xed0b('0x16')](function(_0x5aa35b){logger['error'](_0xed0b('0xd'),_0x20c99d,_0x5aa35b);_0x1848f4(_0x5aa35b);});});}exports[_0xed0b('0x17')]=function(_0x444f9b){var _0x3e22d3=this;return new Promise(function(_0x3b9307,_0x12600a){return db[_0xed0b('0x18')]['create'](_0x444f9b[_0xed0b('0x19')],{'raw':_0x444f9b[_0xed0b('0x1a')]?_0x444f9b[_0xed0b('0x1a')][_0xed0b('0x1b')]===undefined?!![]:![]:!![]})[_0xed0b('0xb')](function(_0x50ff2b){logger[_0xed0b('0xc')](_0xed0b('0x17'),_0x444f9b);logger[_0xed0b('0xf')]('CreateCmHopperHistory',_0x444f9b,JSON[_0xed0b('0x11')](_0x50ff2b));_0x3b9307(_0x50ff2b);})[_0xed0b('0x16')](function(_0xbcc55e){logger['error']('CreateCmHopperHistory',_0xbcc55e[_0xed0b('0x14')],_0x444f9b);_0x12600a(_0x3e22d3[_0xed0b('0x13')](0x1f4,_0xbcc55e[_0xed0b('0x14')]));});});};exports[_0xed0b('0x1c')]=function(_0x29a136){var _0x37eb14=this;return new Promise(function(_0x3d182d,_0x466862){return db[_0xed0b('0x18')][_0xed0b('0x1d')]({'raw':_0x29a136[_0xed0b('0x1a')]?_0x29a136[_0xed0b('0x1a')][_0xed0b('0x1b')]===undefined?!![]:![]:!![],'where':_0x29a136['options']?_0x29a136['options'][_0xed0b('0x1e')]||null:null,'attributes':[[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x20'),db[_0xed0b('0x1f')]['col']('id')),_0xed0b('0x21')],[db[_0xed0b('0x1f')]['fn']('COUNT',db[_0xed0b('0x1f')]['fn']('IF',db['sequelize'][_0xed0b('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xed0b('0x23')],[db['sequelize']['fn']('COUNT',db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')](_0xed0b('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0xed0b('0x22')](_0xed0b('0x25')))),_0xed0b('0x26')],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x27'),db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')](_0xed0b('0x28')))),'predictiveIntervalAvgHoldtime'],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x27'),db[_0xed0b('0x1f')]['fn']('IF',db['sequelize'][_0xed0b('0x22')](_0xed0b('0x29')))),_0xed0b('0x2a')]]})[_0xed0b('0xb')](function(_0x504c10){logger[_0xed0b('0xc')]('AvgHandleTime',_0x29a136);logger[_0xed0b('0xf')](_0xed0b('0x1c'),_0x29a136,JSON[_0xed0b('0x11')](_0x504c10));_0x3d182d(_0x504c10);})[_0xed0b('0x16')](function(_0x172181){logger['error'](_0xed0b('0x1c'),_0x172181['message'],_0x29a136);_0x466862(_0x37eb14[_0xed0b('0x13')](0x1f4,_0x172181[_0xed0b('0x14')]));});});};exports[_0xed0b('0x2b')]=function(_0x2e812f){var _0x1b7cda=this;return new Promise(function(_0x3ef6b3,_0x3f8dd6){return db['CmHopperHistory'][_0xed0b('0x1d')]({'raw':_0x2e812f[_0xed0b('0x1a')]?_0x2e812f[_0xed0b('0x1a')][_0xed0b('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e812f[_0xed0b('0x1a')]?_0x2e812f[_0xed0b('0x1a')][_0xed0b('0x1e')]||null:null,'attributes':[[_0xed0b('0x2c'),'name'],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x20'),db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')](_0xed0b('0x2d')))),_0xed0b('0x2e')],[db['sequelize']['fn'](_0xed0b('0x20'),db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')]['literal'](_0xed0b('0x2f')))),_0xed0b('0x30')],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x20'),db[_0xed0b('0x1f')]['fn']('IF',db['sequelize'][_0xed0b('0x22')](_0xed0b('0x31')))),_0xed0b('0x32')],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x20'),db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')](_0xed0b('0x33')))),_0xed0b('0x34')],[db['sequelize']['fn']('COUNT',db[_0xed0b('0x1f')]['fn']('IF',db['sequelize'][_0xed0b('0x22')](_0xed0b('0x35')))),_0xed0b('0x36')],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x20'),db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')](_0xed0b('0x37')))),'outboundDropCallsDayTimeout'],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x20'),db['sequelize']['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')](_0xed0b('0x38')))),_0xed0b('0x39')],[db['sequelize']['fn'](_0xed0b('0x20'),db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')](_0xed0b('0x3a')))),_0xed0b('0x3b')],[db['sequelize']['fn'](_0xed0b('0x20'),db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')]('`state`\x20=\x2013,\x201,\x20null'))),_0xed0b('0x3c')],[db['sequelize']['fn'](_0xed0b('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xed0b('0x3d')))),_0xed0b('0x3e')],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x20'),db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')](_0xed0b('0x3f')))),_0xed0b('0x40')],[db['sequelize']['fn']('COUNT',db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')](_0xed0b('0x41')))),_0xed0b('0x42')],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x20'),db['sequelize']['fn']('IF',db[_0xed0b('0x1f')]['literal'](_0xed0b('0x43')))),_0xed0b('0x40')],[db[_0xed0b('0x1f')]['fn'](_0xed0b('0x20'),db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xed0b('0x44')]],'group':[_0xed0b('0x2c')]})['then'](function(_0x1bfa21){logger[_0xed0b('0xc')](_0xed0b('0x2b'),_0x2e812f);logger[_0xed0b('0xf')]('GetVoiceQueueHopperHistory',_0x2e812f,JSON[_0xed0b('0x11')](_0x1bfa21));_0x3ef6b3(_0x1bfa21);})['catch'](function(_0x337000){logger[_0xed0b('0x13')]('GetVoiceQueueHopperHistory',_0x337000['message'],_0x2e812f);_0x3f8dd6(_0x1b7cda[_0xed0b('0x13')](0x1f4,_0x337000[_0xed0b('0x14')]));});});};exports[_0xed0b('0x45')]=function(_0x499b42){var _0x43159c=this;return new Promise(function(_0x5b7206,_0x2b0a15){return db['CmHopperHistory'][_0xed0b('0x1d')]({'raw':_0x499b42[_0xed0b('0x1a')]?_0x499b42['options'][_0xed0b('0x1b')]===undefined?!![]:![]:!![],'where':_0x499b42[_0xed0b('0x1a')]?_0x499b42[_0xed0b('0x1a')][_0xed0b('0x1e')]||null:null,'attributes':[[_0xed0b('0x2c'),'name'],[db[_0xed0b('0x1f')]['fn']('COUNT',db[_0xed0b('0x1f')][_0xed0b('0x46')]('id')),_0xed0b('0x47')],[db[_0xed0b('0x1f')]['fn']('COUNT',db[_0xed0b('0x1f')]['fn']('IF',db[_0xed0b('0x1f')][_0xed0b('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xed0b('0x48')]],'group':['campaign']})[_0xed0b('0xb')](function(_0x204c03){logger['info']('GetCampaignHopperHistory',_0x499b42);logger[_0xed0b('0xf')](_0xed0b('0x45'),_0x499b42,JSON[_0xed0b('0x11')](_0x204c03));_0x5b7206(_0x204c03);})[_0xed0b('0x16')](function(_0x2f3157){logger['error'](_0xed0b('0x45'),_0x2f3157[_0xed0b('0x14')],_0x499b42);_0x2b0a15(_0x43159c[_0xed0b('0x13')](0x1f4,_0x2f3157[_0xed0b('0x14')]));});});};
\ No newline at end of file
index 6342624..418d1d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cc9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','show','post','put','/:id','update','multer','util','path','express','Router','fs-extra'];(function(_0x44c97e,_0x4feeea){var _0x6f9096=function(_0x3d5e81){while(--_0x3d5e81){_0x44c97e['push'](_0x44c97e['shift']());}};_0x6f9096(++_0x4feeea);}(_0x8cc9,0x7f));var _0x98cc=function(_0x54f336,_0x171826){_0x54f336=_0x54f336-0x0;var _0x3fea0c=_0x8cc9[_0x54f336];return _0x3fea0c;};'use strict';var multer=require(_0x98cc('0x0'));var util=require(_0x98cc('0x1'));var path=require(_0x98cc('0x2'));var timeout=require('connect-timeout');var express=require(_0x98cc('0x3'));var router=express[_0x98cc('0x4')]();var fs_extra=require(_0x98cc('0x5'));var auth=require(_0x98cc('0x6'));var interaction=require(_0x98cc('0x7'));var config=require(_0x98cc('0x8'));var controller=require(_0x98cc('0x9'));router[_0x98cc('0xa')]('/',auth[_0x98cc('0xb')](),controller[_0x98cc('0xc')]);router[_0x98cc('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x98cc('0xd')]);router[_0x98cc('0xa')]('/:id',auth[_0x98cc('0xb')](),controller[_0x98cc('0xe')]);router[_0x98cc('0xf')]('/',auth[_0x98cc('0xb')](),controller['create']);router[_0x98cc('0x10')](_0x98cc('0x11'),auth[_0x98cc('0xb')](),controller[_0x98cc('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x60e0=['/describe','isAuthenticated','describe','get','/:id','show','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','index'];(function(_0x502773,_0x1e344a){var _0x3d5559=function(_0x44f0c5){while(--_0x44f0c5){_0x502773['push'](_0x502773['shift']());}};_0x3d5559(++_0x1e344a);}(_0x60e0,0x87));var _0x060e=function(_0x162a33,_0x3b5352){_0x162a33=_0x162a33-0x0;var _0x524095=_0x60e0[_0x162a33];return _0x524095;};'use strict';var multer=require(_0x060e('0x0'));var util=require(_0x060e('0x1'));var path=require(_0x060e('0x2'));var timeout=require(_0x060e('0x3'));var express=require(_0x060e('0x4'));var router=express[_0x060e('0x5')]();var fs_extra=require(_0x060e('0x6'));var auth=require(_0x060e('0x7'));var interaction=require(_0x060e('0x8'));var config=require(_0x060e('0x9'));var controller=require(_0x060e('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x060e('0xb')]);router['get'](_0x060e('0xc'),auth[_0x060e('0xd')](),controller[_0x060e('0xe')]);router[_0x060e('0xf')](_0x060e('0x10'),auth[_0x060e('0xd')](),controller[_0x060e('0x11')]);router['post']('/',auth[_0x060e('0xd')](),controller[_0x060e('0x12')]);router[_0x060e('0x13')](_0x060e('0x10'),auth['isAuthenticated'](),controller[_0x060e('0x14')]);module['exports']=router;
\ No newline at end of file
index 77ec4a8..2f4bf1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4849=['name','STRING','sequelize','exports'];(function(_0x3cb30b,_0x504b3e){var _0x2ca717=function(_0x32a3d9){while(--_0x32a3d9){_0x3cb30b['push'](_0x3cb30b['shift']());}};_0x2ca717(++_0x504b3e);}(_0x4849,0x86));var _0x9484=function(_0x140316,_0x31a0d7){_0x140316=_0x140316-0x0;var _0x1c9f75=_0x4849[_0x140316];return _0x1c9f75;};'use strict';var Sequelize=require(_0x9484('0x0'));module[_0x9484('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9484('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9484('0x3')]},'dialPrefix':{'type':Sequelize[_0x9484('0x3')]}};
\ No newline at end of file
+var _0xa4fb=['sequelize','exports','STRING','name'];(function(_0x3b8e84,_0x47f29e){var _0x53e47b=function(_0x304223){while(--_0x304223){_0x3b8e84['push'](_0x3b8e84['shift']());}};_0x53e47b(++_0x47f29e);}(_0xa4fb,0x150));var _0xba4f=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0xa4fb[_0x5f0501];return _0x3c2c45;};'use strict';var Sequelize=require(_0xba4f('0x0'));module[_0xba4f('0x1')]={'name':{'type':Sequelize[_0xba4f('0x2')],'unique':_0xba4f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2e72e1e..ad85779 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0721=['Disposition','filter','include','findAll','removeDispositions','ids','CmContact','tags','isArray','join','push','omit','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','cf_%d','raw','concat','format','now','writeFileSync','Content-disposition','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','findOne','sequelize','Sequelize','TEXT','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','zip-dir','request-promise','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','type','VIRTUAL','includeAll','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Lists','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0721,0xbe));var _0x1072=function(_0x5b9a30,_0x2b3667){_0x5b9a30=_0x5b9a30-0x0;var _0x35f722=_0x0721[_0x5b9a30];return _0x35f722;};'use strict';var emlformat=require(_0x1072('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1072('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1072('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1072('0x3'));var util=require(_0x1072('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x1072('0x5'));var ejs=require(_0x1072('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1072('0x7'));var squel=require(_0x1072('0x8'));var crypto=require(_0x1072('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1072('0xa'));var toCsv=require(_0x1072('0x5'));var querystring=require(_0x1072('0xb'));var Papa=require(_0x1072('0xc'));var Redis=require(_0x1072('0xd'));var authService=require(_0x1072('0xe'));var qs=require(_0x1072('0xf'));var as=require(_0x1072('0x10'));var hardwareService=require(_0x1072('0x11'));var logger=require('../../config/logger')(_0x1072('0x12'));var utils=require(_0x1072('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1072('0x14'));var db=require(_0x1072('0x15'))['db'];config[_0x1072('0x16')]=_[_0x1072('0x17')](config[_0x1072('0x16')],{'host':_0x1072('0x18'),'port':0x18eb});var socket=require(_0x1072('0x19'))(new Redis(config['redis']));require(_0x1072('0x1a'))[_0x1072('0x1b')](socket);function respondWithStatusCode(_0x7a3f14,_0x4e6353){_0x4e6353=_0x4e6353||0xcc;return function(_0x271734){if(_0x271734){return _0x7a3f14['sendStatus'](_0x4e6353);}return _0x7a3f14[_0x1072('0x1c')](_0x4e6353)['end']();};}function respondWithResult(_0x181844,_0x1fb598){_0x1fb598=_0x1fb598||0xc8;return function(_0x30cacb){if(_0x30cacb){return _0x181844['status'](_0x1fb598)[_0x1072('0x1d')](_0x30cacb);}};}function respondWithFilteredResult(_0x3c58e8,_0x4fff15){return function(_0x19e2d0){if(_0x19e2d0){var _0x49574f=typeof _0x4fff15[_0x1072('0x1e')]==='undefined'&&typeof _0x4fff15['limit']===_0x1072('0x1f');var _0x335930=_0x19e2d0['count'];var _0x5141dc=_0x49574f?0x0:_0x4fff15['offset'];var _0x282d5d=_0x49574f?_0x19e2d0[_0x1072('0x20')]:_0x4fff15['offset']+_0x4fff15['limit'];var _0x363961;if(_0x282d5d>=_0x335930){_0x282d5d=_0x335930;_0x363961=0xc8;}else{_0x363961=0xce;}_0x3c58e8[_0x1072('0x1c')](_0x363961);return _0x3c58e8[_0x1072('0x21')](_0x1072('0x22'),_0x5141dc+'-'+_0x282d5d+'/'+_0x335930)[_0x1072('0x1d')](_0x19e2d0);}return null;};}function patchUpdates(_0x46c641){return function(_0x2833e7){try{jsonpatch[_0x1072('0x23')](_0x2833e7,_0x46c641,!![]);}catch(_0x464373){return BPromise[_0x1072('0x24')](_0x464373);}return _0x2833e7[_0x1072('0x25')]();};}function saveUpdates(_0x425602,_0x43f746){return function(_0x285094){if(_0x285094){return _0x285094[_0x1072('0x26')](_0x425602)[_0x1072('0x27')](function(_0x2f3984){return _0x2f3984;});}return null;};}function removeEntity(_0x45c9e1,_0x43b84a){return function(_0x5a9dad){if(_0x5a9dad){return _0x5a9dad['destroy']()[_0x1072('0x27')](function(){var _0x300d72=_0x5a9dad['get']({'plain':!![]});var _0x3273d0='Lists';return db[_0x1072('0x28')][_0x1072('0x29')]({'where':{'type':_0x3273d0,'resourceId':_0x300d72['id']}})['then'](function(){return _0x5a9dad;});})[_0x1072('0x27')](function(){_0x45c9e1[_0x1072('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x208b8f,_0x4109f4){return function(_0xfaa6a4){if(!_0xfaa6a4){_0x208b8f[_0x1072('0x2a')](0x194);}return _0xfaa6a4;};}function handleError(_0x5c273f,_0x53c11e){_0x53c11e=_0x53c11e||0x1f4;return function(_0x3889ed){logger[_0x1072('0x2b')](_0x3889ed[_0x1072('0x2c')]);if(_0x3889ed[_0x1072('0x2d')]){delete _0x3889ed['name'];}_0x5c273f['status'](_0x53c11e)[_0x1072('0x2e')](_0x3889ed);};}exports[_0x1072('0x2f')]=function(_0x567b67,_0x14ebf3){var _0x44ab13={},_0x362c34={},_0x10b07a={'count':0x0,'rows':[]};var _0x539931=_[_0x1072('0x30')](db[_0x1072('0x31')][_0x1072('0x32')],function(_0x490d64){return{'name':_0x490d64[_0x1072('0x33')],'type':_0x490d64['type'][_0x1072('0x34')]};});_0x362c34[_0x1072('0x35')]=_[_0x1072('0x30')](_0x539931,_0x1072('0x2d'));_0x362c34[_0x1072('0x36')]=_[_0x1072('0x37')](_0x567b67[_0x1072('0x36')]);_0x362c34[_0x1072('0x38')]=_['intersection'](_0x362c34[_0x1072('0x35')],_0x362c34[_0x1072('0x36')]);_0x44ab13[_0x1072('0x39')]=_[_0x1072('0x3a')](_0x362c34[_0x1072('0x35')],qs[_0x1072('0x3b')](_0x567b67[_0x1072('0x36')][_0x1072('0x3b')]));_0x44ab13[_0x1072('0x39')]=_0x44ab13['attributes'][_0x1072('0x3c')]?_0x44ab13[_0x1072('0x39')]:_0x362c34['model'];if(!_0x567b67[_0x1072('0x36')][_0x1072('0x3d')](_0x1072('0x3e'))){_0x44ab13[_0x1072('0x3f')]=qs[_0x1072('0x3f')](_0x567b67[_0x1072('0x36')][_0x1072('0x3f')]);_0x44ab13['offset']=qs['offset'](_0x567b67[_0x1072('0x36')]['offset']);}_0x44ab13[_0x1072('0x40')]=qs[_0x1072('0x41')](_0x567b67['query'][_0x1072('0x41')]);_0x44ab13['where']=qs[_0x1072('0x38')](_[_0x1072('0x42')](_0x567b67[_0x1072('0x36')],_0x362c34[_0x1072('0x38')]),_0x539931);if(_0x567b67[_0x1072('0x36')]['filter']){_0x44ab13[_0x1072('0x43')]=_[_0x1072('0x44')](_0x44ab13['where'],{'$or':_[_0x1072('0x30')](_0x539931,function(_0x744ec4){if(_0x744ec4[_0x1072('0x45')]!==_0x1072('0x46')){var _0x1c6ecb={};_0x1c6ecb[_0x744ec4['name']]={'$like':'%'+_0x567b67[_0x1072('0x36')]['filter']+'%'};return _0x1c6ecb;}})});}_0x44ab13=_[_0x1072('0x44')]({},_0x44ab13,_0x567b67['options']);var _0x15fe5a={'where':_0x44ab13[_0x1072('0x43')]};return db['CmList'][_0x1072('0x20')](_0x15fe5a)[_0x1072('0x27')](function(_0x45cf31){_0x10b07a[_0x1072('0x20')]=_0x45cf31;if(_0x567b67[_0x1072('0x36')][_0x1072('0x47')]){_0x44ab13['include']=[{'all':!![]}];}return db[_0x1072('0x31')]['findAll'](_0x44ab13);})[_0x1072('0x27')](function(_0x5c926c){_0x10b07a[_0x1072('0x48')]=_0x5c926c;return _0x10b07a;})[_0x1072('0x27')](respondWithFilteredResult(_0x14ebf3,_0x44ab13))[_0x1072('0x49')](handleError(_0x14ebf3,null));};exports[_0x1072('0x4a')]=function(_0x323c14,_0x465c5b){var _0x15c6d9={'raw':![],'where':{'id':_0x323c14[_0x1072('0x4b')]['id']}},_0x3e339a={};_0x3e339a[_0x1072('0x35')]=_[_0x1072('0x37')](db['CmList']['rawAttributes']);_0x3e339a['query']=_[_0x1072('0x37')](_0x323c14[_0x1072('0x36')]);_0x3e339a[_0x1072('0x38')]=_[_0x1072('0x3a')](_0x3e339a[_0x1072('0x35')],_0x3e339a[_0x1072('0x36')]);_0x15c6d9['attributes']=_[_0x1072('0x3a')](_0x3e339a[_0x1072('0x35')],qs[_0x1072('0x3b')](_0x323c14[_0x1072('0x36')][_0x1072('0x3b')]));_0x15c6d9[_0x1072('0x39')]=_0x15c6d9[_0x1072('0x39')][_0x1072('0x3c')]?_0x15c6d9['attributes']:_0x3e339a['model'];if(_0x323c14[_0x1072('0x36')][_0x1072('0x47')]){_0x15c6d9['include']=[{'all':!![]}];}_0x15c6d9=_[_0x1072('0x44')]({},_0x15c6d9,_0x323c14[_0x1072('0x4c')]);return db[_0x1072('0x31')][_0x1072('0x4d')](_0x15c6d9)[_0x1072('0x27')](handleEntityNotFound(_0x465c5b,null))['then'](respondWithResult(_0x465c5b,null))[_0x1072('0x49')](handleError(_0x465c5b,null));};exports[_0x1072('0x4e')]=function(_0x3793fb,_0x4c719d){return db[_0x1072('0x31')][_0x1072('0x4e')](_0x3793fb[_0x1072('0x4f')],{})[_0x1072('0x27')](function(_0x23cdb4){var _0x3fc289=_0x3793fb[_0x1072('0x50')][_0x1072('0x51')]({'plain':!![]});if(!_0x3fc289)throw new Error(_0x1072('0x52'));if(_0x3fc289['role']==='user'){var _0x338d4b=_0x23cdb4[_0x1072('0x51')]({'plain':!![]});var _0x130aee=_0x1072('0x53');return db['UserProfileSection'][_0x1072('0x4d')]({'where':{'name':_0x130aee,'userProfileId':_0x3fc289[_0x1072('0x54')]},'raw':!![]})['then'](function(_0x54c1e4){if(_0x54c1e4&&_0x54c1e4[_0x1072('0x55')]===0x0){return db['UserProfileResource'][_0x1072('0x4e')]({'name':_0x338d4b[_0x1072('0x2d')],'resourceId':_0x338d4b['id'],'type':_0x54c1e4[_0x1072('0x2d')],'sectionId':_0x54c1e4['id']},{})['then'](function(){return _0x23cdb4;});}else{return _0x23cdb4;}})[_0x1072('0x49')](function(_0x12b4ee){logger[_0x1072('0x2b')](_0x1072('0x56'),_0x12b4ee);throw _0x12b4ee;});}return _0x23cdb4;})[_0x1072('0x27')](respondWithResult(_0x4c719d,0xc9))[_0x1072('0x49')](handleError(_0x4c719d,null));};exports['update']=function(_0x2c5777,_0x464b8f){if(_0x2c5777[_0x1072('0x4f')]['id']){delete _0x2c5777['body']['id'];}return db['CmList'][_0x1072('0x4d')]({'where':{'id':_0x2c5777['params']['id']}})['then'](handleEntityNotFound(_0x464b8f,null))['then'](saveUpdates(_0x2c5777[_0x1072('0x4f')],null))[_0x1072('0x27')](respondWithResult(_0x464b8f,null))[_0x1072('0x49')](handleError(_0x464b8f,null));};exports[_0x1072('0x29')]=function(_0x14666f,_0x37735f){return db['CmList']['find']({'where':{'id':_0x14666f['params']['id']}})['then'](handleEntityNotFound(_0x37735f,null))[_0x1072('0x27')](removeEntity(_0x37735f,null))[_0x1072('0x49')](handleError(_0x37735f,null));};exports[_0x1072('0x57')]=function(_0xc5a42,_0x3f2b8e){return db[_0x1072('0x31')][_0x1072('0x57')]()['then'](respondWithResult(_0x3f2b8e,null))[_0x1072('0x49')](handleError(_0x3f2b8e,null));};exports[_0x1072('0x58')]=function(_0x332741,_0x1b1487,_0x360376){if(_0x332741[_0x1072('0x4f')]['id']){delete _0x332741[_0x1072('0x4f')]['id'];}return db[_0x1072('0x31')][_0x1072('0x4d')]({'where':{'id':_0x332741[_0x1072('0x4b')]['id']}})[_0x1072('0x27')](handleEntityNotFound(_0x1b1487,null))[_0x1072('0x27')](function(_0xc6fbe8){if(_0xc6fbe8){_0x332741['body'][_0x1072('0x59')]=_0xc6fbe8['id'];return db[_0x1072('0x5a')][_0x1072('0x4e')](_0x332741[_0x1072('0x4f')]);}})['then'](respondWithResult(_0x1b1487,null))['catch'](handleError(_0x1b1487,null));};exports['getDispositions']=function(_0x34ddf0,_0x5af8ee,_0x47a62e){var _0x4ad588={'raw':![],'where':{}};var _0x1b9943={};var _0x20b9b6={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x34ddf0[_0x1072('0x4b')]['id']}})[_0x1072('0x27')](handleEntityNotFound(_0x5af8ee,null))[_0x1072('0x27')](function(_0x5d6728){if(_0x5d6728){_0x1b9943[_0x1072('0x35')]=_['keys'](db[_0x1072('0x5a')][_0x1072('0x32')]);_0x1b9943[_0x1072('0x36')]=_[_0x1072('0x37')](_0x34ddf0[_0x1072('0x36')]);_0x1b9943[_0x1072('0x38')]=_[_0x1072('0x3a')](_0x1b9943[_0x1072('0x35')],_0x1b9943[_0x1072('0x36')]);_0x4ad588[_0x1072('0x39')]=_[_0x1072('0x3a')](_0x1b9943[_0x1072('0x35')],qs[_0x1072('0x3b')](_0x34ddf0[_0x1072('0x36')]['fields']));_0x4ad588[_0x1072('0x39')]=_0x4ad588['attributes']['length']?_0x4ad588[_0x1072('0x39')]:_0x1b9943[_0x1072('0x35')];if(!_0x34ddf0[_0x1072('0x36')]['hasOwnProperty'](_0x1072('0x3e'))){_0x4ad588[_0x1072('0x3f')]=qs[_0x1072('0x3f')](_0x34ddf0[_0x1072('0x36')]['limit']);_0x4ad588[_0x1072('0x1e')]=qs[_0x1072('0x1e')](_0x34ddf0[_0x1072('0x36')]['offset']);}_0x4ad588[_0x1072('0x40')]=qs[_0x1072('0x41')](_0x34ddf0['query'][_0x1072('0x41')]);_0x4ad588[_0x1072('0x43')]=qs[_0x1072('0x38')](_[_0x1072('0x42')](_0x34ddf0[_0x1072('0x36')],_0x1b9943['filters']));_0x4ad588[_0x1072('0x43')]['ListId']=_0x5d6728['id'];if(_0x34ddf0[_0x1072('0x36')][_0x1072('0x5b')]){_0x4ad588[_0x1072('0x43')]=_['merge'](_0x4ad588[_0x1072('0x43')],{'$or':_[_0x1072('0x30')](_0x4ad588[_0x1072('0x39')],function(_0x1b1501){var _0x2aecec={};_0x2aecec[_0x1b1501]={'$like':'%'+_0x34ddf0[_0x1072('0x36')]['filter']+'%'};return _0x2aecec;})});}_0x4ad588=_[_0x1072('0x44')]({},_0x4ad588,_0x34ddf0[_0x1072('0x4c')]);return db[_0x1072('0x5a')][_0x1072('0x20')]({'where':_0x4ad588['where']})[_0x1072('0x27')](function(_0x340ac5){_0x20b9b6[_0x1072('0x20')]=_0x340ac5;if(_0x34ddf0[_0x1072('0x36')]['includeAll']){_0x4ad588[_0x1072('0x5c')]=[{'all':!![]}];}return db['Disposition'][_0x1072('0x5d')](_0x4ad588);})[_0x1072('0x27')](function(_0x3f3eb1){_0x20b9b6[_0x1072('0x48')]=_0x3f3eb1;return _0x20b9b6;});}})[_0x1072('0x27')](respondWithFilteredResult(_0x5af8ee,_0x4ad588))[_0x1072('0x49')](handleError(_0x5af8ee,null));};exports[_0x1072('0x5e')]=function(_0x463c19,_0x1b8c86,_0x4162ef){return db[_0x1072('0x31')][_0x1072('0x4d')]({'where':{'id':_0x463c19['params']['id']}})[_0x1072('0x27')](handleEntityNotFound(_0x1b8c86,null))[_0x1072('0x27')](function(_0x291095){if(_0x291095){return _0x291095['removeDispositions'](_0x463c19['query'][_0x1072('0x5f')]);}})[_0x1072('0x27')](respondWithStatusCode(_0x1b8c86,null))[_0x1072('0x49')](handleError(_0x1b8c86,null));};exports['addContacts']=function(_0x35aefe,_0x165935,_0x144eb9){return db[_0x1072('0x31')]['find']({'where':{'id':_0x35aefe['params']['id']}})[_0x1072('0x27')](handleEntityNotFound(_0x165935,null))['then'](function(_0x4ecbef){if(_0x4ecbef){var _0x358b7f=[];var _0x1e210e={'success':[],'errors':[]};return db[_0x1072('0x60')][_0x1072('0x57')]()[_0x1072('0x27')](function(_0x3df6e8){if(_0x35aefe[_0x1072('0x4f')][_0x1072('0x61')]&&_[_0x1072('0x62')](_0x35aefe['body'][_0x1072('0x61')])){if(_0x35aefe[_0x1072('0x4f')][_0x1072('0x61')][_0x1072('0x3c')]){_0x35aefe['body'][_0x1072('0x61')]=_0x35aefe[_0x1072('0x4f')][_0x1072('0x61')][_0x1072('0x63')](';')+';';}else{_0x35aefe[_0x1072('0x4f')][_0x1072('0x61')]=null;}}else{_0x35aefe[_0x1072('0x4f')]['tags']=null;}if(_0x35aefe[_0x1072('0x4f')]&&_['isArray'](_0x35aefe[_0x1072('0x4f')])){for(var _0x24d89f=0x0;_0x24d89f<_0x35aefe[_0x1072('0x4f')]['length'];_0x24d89f+=0x1){_0x35aefe[_0x1072('0x4f')][_0x24d89f]['ListId']=_0x35aefe[_0x1072('0x4b')]['id'];_0x358b7f[_0x1072('0x64')](_0x35aefe[_0x1072('0x4f')][_0x24d89f]);}return BPromise['each'](_0x358b7f,function(_0x37a53b){return db['CmContact'][_0x1072('0x4e')](_[_0x1072('0x65')](_0x37a53b,[_0x1072('0x5f'),'id'])||{},{'fields':_['keys'](_0x3df6e8),'raw':!![]})['then'](function(_0x55bd23){_0x1e210e[_0x1072('0x66')][_0x1072('0x64')](_0x55bd23[_0x1072('0x67')]);})[_0x1072('0x49')](function(_0x4b44df){_0x1e210e['errors'][_0x1072('0x64')]({'data':_0x37a53b,'error':_0x4b44df[_0x1072('0x68')]});});})[_0x1072('0x27')](function(_0x1d3fe8){return _0x1e210e;})[_0x1072('0x49')](function(_0x3c5916){return _0x3c5916;});}else{_0x165935[_0x1072('0x1c')](0x190)[_0x1072('0x1d')]({'message':_0x1072('0x69')});}});}})['then'](respondWithResult(_0x165935,null))['catch'](handleError(_0x165935,null));};exports[_0x1072('0x6a')]=function(_0xf76c8a,_0x59c6c8,_0x561f20){var _0x11fa58;return db['CmList'][_0x1072('0x4d')]({'where':{'id':_0xf76c8a['params']['id']},'include':[{'model':db[_0x1072('0x6b')],'as':_0x1072('0x6c')}]})[_0x1072('0x27')](handleEntityNotFound(_0x59c6c8,null))[_0x1072('0x27')](function(_0x44f402){if(_0x44f402){_0x11fa58=_0x44f402;return db['CmContact'][_0x1072('0x32')];}})[_0x1072('0x27')](function(_0x2823c9){if(_0x2823c9){var _0x2b0ab2={};var _0x369dd0={};_0x369dd0[_0x1072('0x35')]=_['concat'](_[_0x1072('0x37')](_0x2823c9),_[_0x1072('0x30')](_0x11fa58['CustomFields'],function(_0x9f9b9a){return util['format'](_0x1072('0x6d'),_0x9f9b9a['id']);}));_0x369dd0[_0x1072('0x36')]=_['keys'](_0xf76c8a[_0x1072('0x36')]);_0x369dd0[_0x1072('0x38')]=_[_0x1072('0x3a')](_0x369dd0[_0x1072('0x35')],_0x369dd0[_0x1072('0x36')]);_0x2b0ab2[_0x1072('0x39')]=_['intersection'](_0x369dd0['model'],qs[_0x1072('0x3b')](_0xf76c8a[_0x1072('0x36')][_0x1072('0x3b')]));_0x2b0ab2[_0x1072('0x39')]=_0x2b0ab2[_0x1072('0x39')][_0x1072('0x3c')]?_0x2b0ab2[_0x1072('0x39')]:_0x369dd0[_0x1072('0x35')];if(!_0xf76c8a[_0x1072('0x36')][_0x1072('0x3d')](_0x1072('0x3e'))){_0x2b0ab2[_0x1072('0x3f')]=qs[_0x1072('0x3f')](_0xf76c8a[_0x1072('0x36')][_0x1072('0x3f')]);_0x2b0ab2[_0x1072('0x1e')]=qs[_0x1072('0x1e')](_0xf76c8a[_0x1072('0x36')][_0x1072('0x1e')]);}_0x2b0ab2[_0x1072('0x40')]=qs[_0x1072('0x41')](_0xf76c8a['query']['sort']);_0x2b0ab2[_0x1072('0x43')]=qs[_0x1072('0x38')](_[_0x1072('0x42')](_0xf76c8a[_0x1072('0x36')],_0x369dd0[_0x1072('0x38')]));_0x2b0ab2[_0x1072('0x6e')]=!![];if(_0xf76c8a['query'][_0x1072('0x5b')]){_0x2b0ab2['where']=_[_0x1072('0x44')](_0x2b0ab2[_0x1072('0x43')],{'$or':_['map'](_0x2b0ab2['attributes'],function(_0x3f1cd1){var _0x2c6553={};_0x2c6553[_0x3f1cd1]={'$like':'%'+_0xf76c8a[_0x1072('0x36')]['filter']+'%'};return _0x2c6553;})});}_0x2b0ab2=_[_0x1072('0x44')]({},_0x2b0ab2,_0xf76c8a[_0x1072('0x4c')]);return _0x11fa58[_0x1072('0x6a')](_0x2b0ab2);}})[_0x1072('0x27')](respondWithResult(_0x59c6c8,null))[_0x1072('0x49')](handleError(_0x59c6c8,null));};exports['getContactsCsv']=function(_0x2c78c8,_0x5b92e7,_0x4c737b){var _0x5f2372;return db['CmList'][_0x1072('0x4d')]({'where':{'id':_0x2c78c8[_0x1072('0x4b')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x1072('0x6c')}]})[_0x1072('0x27')](handleEntityNotFound(_0x5b92e7,null))['then'](function(_0x11d747){if(_0x11d747){_0x5f2372=_0x11d747;return db['CmContact'][_0x1072('0x32')];}})[_0x1072('0x27')](function(_0x1416b7){if(_0x1416b7){var _0x540b59={};var _0x15b945={};_0x15b945[_0x1072('0x35')]=_[_0x1072('0x6f')](_['keys'](_0x1416b7),_[_0x1072('0x30')](_0x5f2372[_0x1072('0x6c')],function(_0x4fda22){return util[_0x1072('0x70')](_0x1072('0x6d'),_0x4fda22['id']);}));_0x15b945[_0x1072('0x36')]=_[_0x1072('0x37')](_0x2c78c8['query']);_0x15b945[_0x1072('0x38')]=_[_0x1072('0x3a')](_0x15b945[_0x1072('0x35')],_0x15b945['query']);_0x540b59[_0x1072('0x39')]=_[_0x1072('0x3a')](_0x15b945['model'],qs['fields'](_0x2c78c8[_0x1072('0x36')]['fields']));_0x540b59['attributes']=_0x540b59[_0x1072('0x39')][_0x1072('0x3c')]?_0x540b59[_0x1072('0x39')]:_0x15b945[_0x1072('0x35')];if(!_0x2c78c8[_0x1072('0x36')][_0x1072('0x3d')](_0x1072('0x3e'))){_0x540b59[_0x1072('0x3f')]=qs[_0x1072('0x3f')](_0x2c78c8[_0x1072('0x36')][_0x1072('0x3f')]);_0x540b59['offset']=qs[_0x1072('0x1e')](_0x2c78c8[_0x1072('0x36')][_0x1072('0x1e')]);}_0x540b59['order']=qs[_0x1072('0x41')](_0x2c78c8[_0x1072('0x36')][_0x1072('0x41')]);_0x540b59[_0x1072('0x43')]=qs[_0x1072('0x38')](_[_0x1072('0x42')](_0x2c78c8[_0x1072('0x36')],_0x15b945[_0x1072('0x38')]));_0x540b59[_0x1072('0x6e')]=!![];if(_0x2c78c8[_0x1072('0x36')]['filter']){_0x540b59[_0x1072('0x43')]=_[_0x1072('0x44')](_0x540b59['where'],{'$or':_[_0x1072('0x30')](_0x540b59['attributes'],function(_0x56e13e){var _0x3d6452={};_0x3d6452[_0x56e13e]={'$like':'%'+_0x2c78c8['query']['filter']+'%'};return _0x3d6452;})});}_0x540b59=_[_0x1072('0x44')]({},_0x540b59,_0x2c78c8[_0x1072('0x4c')]);return _0x5f2372['getContacts'](_0x540b59);}})[_0x1072('0x27')](function(_0x228844){if(!_['isEmpty'](_0x228844)){var _0x1154cc=toCsv(_0x228844);var _0x137560=Date[_0x1072('0x71')]();fs[_0x1072('0x72')](util[_0x1072('0x70')]('/tmp/list_%d_%s.csv',_0x5f2372['id'],_0x137560),_0x1154cc);_0x5b92e7['setHeader'](_0x1072('0x73'),'attachment;\x20filename='+util['format']('list_%d_%s.csv',_0x5f2372['id'],_0x137560));_0x5b92e7['setHeader'](_0x1072('0x74'),_0x1072('0x75'));return _0x5b92e7[_0x1072('0x76')](util[_0x1072('0x70')](_0x1072('0x77'),_0x5f2372['id'],_0x137560));}else{return _0x5b92e7[_0x1072('0x2a')](0xcc);}})[_0x1072('0x49')](handleError(_0x5b92e7,null));};exports[_0x1072('0x78')]=function(_0xd1bd19,_0x3492fa,_0x2876e0){var _0x6f0721;delete _0xd1bd19[_0x1072('0x4f')]['id'];return db[_0x1072('0x31')][_0x1072('0x79')]({'where':{'id':_0xd1bd19['params']['id']}})[_0x1072('0x27')](handleEntityNotFound(_0x3492fa,null))[_0x1072('0x27')](function(_0x15f350){if(_0x15f350){return db[_0x1072('0x7a')]['transaction'](function(_0x3c7d0b){return db[_0x1072('0x6b')]['create'](_0xd1bd19['body'],{'transaction':_0x3c7d0b})['then'](function(_0x37ad66){_0x6f0721=_0x37ad66;return _0x15f350['addCustomFields'](_0x37ad66,{'transaction':_0x3c7d0b});})[_0x1072('0x27')](function(){var _0x361b82={'type':db[_0x1072('0x7b')]['TEXT'],'transaction':_0x3c7d0b};switch(_0xd1bd19[_0x1072('0x4f')][_0x1072('0x45')]){case'text':_0x361b82['type']=db['Sequelize'][_0x1072('0x7c')];break;case _0x1072('0x7d'):_0x361b82[_0x1072('0x45')]=db[_0x1072('0x7b')]['INTEGER'];break;case _0x1072('0x7e'):_0x361b82['type']=db[_0x1072('0x7b')][_0x1072('0x7f')];_0x361b82[_0x1072('0x80')]=![];break;default:}return db[_0x1072('0x7a')][_0x1072('0x81')][_0x1072('0x82')]('cm_contacts',util[_0x1072('0x70')](_0x1072('0x83'),_0x6f0721['id']),_0x361b82);})[_0x1072('0x27')](function(){return _0x6f0721;});});}})[_0x1072('0x27')](respondWithResult(_0x3492fa,null))[_0x1072('0x49')](handleError(_0x3492fa,null));};exports[_0x1072('0x84')]=function(_0x54b936,_0x1994cd,_0x47fe78){var _0x4b1038={};var _0xd41264={};var _0x282b90;var _0x15ef1a;return db[_0x1072('0x31')][_0x1072('0x79')]({'where':{'id':_0x54b936[_0x1072('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1994cd,null))[_0x1072('0x27')](function(_0x1b477c){if(_0x1b477c){_0x282b90=_0x1b477c;_0xd41264['model']=_['keys'](db[_0x1072('0x6b')][_0x1072('0x32')]);_0xd41264[_0x1072('0x36')]=_['keys'](_0x54b936[_0x1072('0x36')]);_0xd41264['filters']=_[_0x1072('0x3a')](_0xd41264['model'],_0xd41264[_0x1072('0x36')]);_0x4b1038[_0x1072('0x39')]=_[_0x1072('0x3a')](_0xd41264[_0x1072('0x35')],qs['fields'](_0x54b936[_0x1072('0x36')]['fields']));_0x4b1038[_0x1072('0x39')]=_0x4b1038[_0x1072('0x39')]['length']?_0x4b1038[_0x1072('0x39')]:_0xd41264['model'];_0x4b1038[_0x1072('0x40')]=qs['sort'](_0x54b936['query'][_0x1072('0x41')]);_0x4b1038[_0x1072('0x43')]=qs[_0x1072('0x38')](_[_0x1072('0x42')](_0x54b936[_0x1072('0x36')],_0xd41264[_0x1072('0x38')]));_0x4b1038[_0x1072('0x43')]=_[_0x1072('0x44')](_0x4b1038['where'],{'$or':[{'ListId':_0x1b477c['id']},{'ListId':null}]});if(_0x54b936['query'][_0x1072('0x5b')]){_0x4b1038['where']=_[_0x1072('0x44')](_0x4b1038[_0x1072('0x43')],{'$or':_[_0x1072('0x30')](_0x4b1038['attributes'],function(_0xbdfa6f){var _0x1b0675={};_0x1b0675[_0xbdfa6f]={'$like':'%'+_0x54b936['query']['filter']+'%'};return _0x1b0675;})});}_0x4b1038=_['merge']({},_0x4b1038,_0x54b936[_0x1072('0x4c')]);return db['CmCustomField']['findAndCountAll'](_0x4b1038);}})[_0x1072('0x27')](respondWithResult(_0x1994cd,null))[_0x1072('0x49')](handleError(_0x1994cd,null));};exports['addAgents']=function(_0xdcb865,_0x3bf2bb,_0x54e63b){return db[_0x1072('0x31')][_0x1072('0x4d')]({'where':{'id':_0xdcb865[_0x1072('0x4b')]['id']}})[_0x1072('0x27')](handleEntityNotFound(_0x3bf2bb,null))[_0x1072('0x27')](function(_0x1e288e){if(_0x1e288e){return _0x1e288e[_0x1072('0x85')](_0xdcb865['body'][_0x1072('0x5f')],_['omit'](_0xdcb865[_0x1072('0x4f')],[_0x1072('0x5f'),'id'])||{})[_0x1072('0x86')](function(_0x2cebf8){for(var _0x50de51=0x0;_0x50de51<_0xdcb865[_0x1072('0x4f')][_0x1072('0x5f')]['length'];_0x50de51+=0x1){socket[_0x1072('0x87')](_0x1072('0x88'),{'UserId':Number(_0xdcb865[_0x1072('0x4f')][_0x1072('0x5f')][_0x50de51]),'CmListId':Number(_0xdcb865['params']['id'])});}return _0x2cebf8;});}})['then'](respondWithResult(_0x3bf2bb,null))[_0x1072('0x49')](handleError(_0x3bf2bb,null));};exports[_0x1072('0x89')]=function(_0x144723,_0x49df96,_0x41cf7f){return db[_0x1072('0x31')][_0x1072('0x4d')]({'where':{'id':_0x144723[_0x1072('0x4b')]['id']}})[_0x1072('0x27')](handleEntityNotFound(_0x49df96,null))[_0x1072('0x27')](function(_0x520009){if(_0x520009){return _0x520009[_0x1072('0x89')](_0x144723['query'][_0x1072('0x5f')])[_0x1072('0x27')](function(){if(_[_0x1072('0x62')](_0x144723[_0x1072('0x36')]['ids'])){for(var _0x5a568f=0x0;_0x5a568f<_0x144723[_0x1072('0x36')][_0x1072('0x5f')][_0x1072('0x3c')];_0x5a568f+=0x1){socket[_0x1072('0x87')](_0x1072('0x8a'),{'UserId':Number(_0x144723[_0x1072('0x36')][_0x1072('0x5f')][_0x5a568f]),'CmListId':Number(_0x144723[_0x1072('0x4b')]['id'])});}}else{socket[_0x1072('0x87')](_0x1072('0x8a'),{'UserId':Number(_0x144723[_0x1072('0x36')][_0x1072('0x5f')]),'CmListId':Number(_0x144723[_0x1072('0x4b')]['id'])});}});}})[_0x1072('0x27')](respondWithStatusCode(_0x49df96,null))['catch'](handleError(_0x49df96,null));};exports['getAgents']=function(_0x6f8bea,_0x9bacd8,_0x1b1d37){var _0xeec389={};var _0x4fdc6f={};var _0x21a2ce;var _0x690c5c;return db['CmList'][_0x1072('0x79')]({'where':{'id':_0x6f8bea[_0x1072('0x4b')]['id']}})[_0x1072('0x27')](handleEntityNotFound(_0x9bacd8,null))[_0x1072('0x27')](function(_0x30b8fc){if(_0x30b8fc){_0x21a2ce=_0x30b8fc;_0x4fdc6f[_0x1072('0x35')]=_['keys'](db['User'][_0x1072('0x32')]);_0x4fdc6f[_0x1072('0x36')]=_[_0x1072('0x37')](_0x6f8bea[_0x1072('0x36')]);_0x4fdc6f[_0x1072('0x38')]=_[_0x1072('0x3a')](_0x4fdc6f[_0x1072('0x35')],_0x4fdc6f['query']);_0xeec389[_0x1072('0x39')]=_[_0x1072('0x3a')](_0x4fdc6f[_0x1072('0x35')],qs[_0x1072('0x3b')](_0x6f8bea[_0x1072('0x36')]['fields']));_0xeec389[_0x1072('0x39')]=_0xeec389[_0x1072('0x39')]['length']?_0xeec389['attributes']:_0x4fdc6f[_0x1072('0x35')];_0xeec389[_0x1072('0x40')]=qs[_0x1072('0x41')](_0x6f8bea[_0x1072('0x36')][_0x1072('0x41')]);_0xeec389[_0x1072('0x43')]=qs[_0x1072('0x38')](_[_0x1072('0x42')](_0x6f8bea[_0x1072('0x36')],_0x4fdc6f[_0x1072('0x38')]));if(_0x6f8bea[_0x1072('0x36')]['filter']){_0xeec389[_0x1072('0x43')]=_[_0x1072('0x44')](_0xeec389['where'],{'$or':_['map'](_0xeec389['attributes'],function(_0xa60056){var _0x186847={};_0x186847[_0xa60056]={'$like':'%'+_0x6f8bea[_0x1072('0x36')][_0x1072('0x5b')]+'%'};return _0x186847;})});}_0xeec389=_['merge']({},_0xeec389,_0x6f8bea[_0x1072('0x4c')]);return _0x21a2ce[_0x1072('0x8b')](_0xeec389);}})[_0x1072('0x27')](function(_0x492d30){if(_0x492d30){_0x690c5c=_0x492d30[_0x1072('0x3c')];if(!_0x6f8bea['query']['hasOwnProperty'](_0x1072('0x3e'))){_0xeec389['limit']=qs['limit'](_0x6f8bea[_0x1072('0x36')]['limit']);_0xeec389['offset']=qs[_0x1072('0x1e')](_0x6f8bea['query'][_0x1072('0x1e')]);}return _0x21a2ce['getAgents'](_0xeec389);}})[_0x1072('0x27')](function(_0x23e19e){if(_0x23e19e){return _0x23e19e?{'count':_0x690c5c,'rows':_0x23e19e}:null;}})['then'](respondWithResult(_0x9bacd8,null))[_0x1072('0x49')](handleError(_0x9bacd8,null));};
\ No newline at end of file
+var _0x8036=['push','each','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','raw','getContactsCsv','cf_%d','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','TEXT','number','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','order','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./cmList.socket','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','sendStatus','error','name','send','index','map','CmList','key','filters','model','attributes','intersection','fields','query','length','hasOwnProperty','sort','pick','filter','where','type','merge','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','nolimit','rows','removeDispositions','ids','CmContact','isArray','tags','join'];(function(_0x581b7f,_0x4f3e47){var _0x197d36=function(_0x20c3fb){while(--_0x20c3fb){_0x581b7f['push'](_0x581b7f['shift']());}};_0x197d36(++_0x4f3e47);}(_0x8036,0xc2));var _0x6803=function(_0x25d525,_0x927d4f){_0x25d525=_0x25d525-0x0;var _0xd94729=_0x8036[_0x25d525];return _0xd94729;};'use strict';var emlformat=require(_0x6803('0x0'));var rimraf=require(_0x6803('0x1'));var zipdir=require(_0x6803('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6803('0x3'));var BPromise=require(_0x6803('0x4'));var Mustache=require(_0x6803('0x5'));var util=require('util');var path=require(_0x6803('0x6'));var sox=require(_0x6803('0x7'));var csv=require(_0x6803('0x8'));var ejs=require(_0x6803('0x9'));var fs=require('fs');var fs_extra=require(_0x6803('0xa'));var _=require(_0x6803('0xb'));var squel=require(_0x6803('0xc'));var crypto=require('crypto');var jsforce=require(_0x6803('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6803('0xe'));var Papa=require(_0x6803('0xf'));var Redis=require(_0x6803('0x10'));var authService=require(_0x6803('0x11'));var qs=require(_0x6803('0x12'));var as=require(_0x6803('0x13'));var hardwareService=require(_0x6803('0x14'));var logger=require(_0x6803('0x15'))(_0x6803('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6803('0x17'));var db=require(_0x6803('0x18'))['db'];config[_0x6803('0x19')]=_[_0x6803('0x1a')](config[_0x6803('0x19')],{'host':_0x6803('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6803('0x19')]));require(_0x6803('0x1c'))['register'](socket);function respondWithStatusCode(_0x54c570,_0x1674cb){_0x1674cb=_0x1674cb||0xcc;return function(_0x56b053){if(_0x56b053){return _0x54c570['sendStatus'](_0x1674cb);}return _0x54c570[_0x6803('0x1d')](_0x1674cb)[_0x6803('0x1e')]();};}function respondWithResult(_0x516ccc,_0x994d0f){_0x994d0f=_0x994d0f||0xc8;return function(_0x25e502){if(_0x25e502){return _0x516ccc[_0x6803('0x1d')](_0x994d0f)[_0x6803('0x1f')](_0x25e502);}};}function respondWithFilteredResult(_0x49b9d5,_0xe08449){return function(_0x1be295){if(_0x1be295){var _0x223e61=typeof _0xe08449[_0x6803('0x20')]===_0x6803('0x21')&&typeof _0xe08449[_0x6803('0x22')]===_0x6803('0x21');var _0x20590f=_0x1be295[_0x6803('0x23')];var _0xfdb042=_0x223e61?0x0:_0xe08449[_0x6803('0x20')];var _0x136b1d=_0x223e61?_0x1be295[_0x6803('0x23')]:_0xe08449[_0x6803('0x20')]+_0xe08449[_0x6803('0x22')];var _0x5ac3d7;if(_0x136b1d>=_0x20590f){_0x136b1d=_0x20590f;_0x5ac3d7=0xc8;}else{_0x5ac3d7=0xce;}_0x49b9d5['status'](_0x5ac3d7);return _0x49b9d5['set']('Content-Range',_0xfdb042+'-'+_0x136b1d+'/'+_0x20590f)[_0x6803('0x1f')](_0x1be295);}return null;};}function patchUpdates(_0x45d71a){return function(_0x44f99b){try{jsonpatch[_0x6803('0x24')](_0x44f99b,_0x45d71a,!![]);}catch(_0x4c22fd){return BPromise[_0x6803('0x25')](_0x4c22fd);}return _0x44f99b[_0x6803('0x26')]();};}function saveUpdates(_0x1bda3b,_0x20bf3b){return function(_0x263f1c){if(_0x263f1c){return _0x263f1c[_0x6803('0x27')](_0x1bda3b)[_0x6803('0x28')](function(_0x496eca){return _0x496eca;});}return null;};}function removeEntity(_0x15bb14,_0x3c98b8){return function(_0x452516){if(_0x452516){return _0x452516[_0x6803('0x29')]()[_0x6803('0x28')](function(){var _0x1bd21d=_0x452516[_0x6803('0x2a')]({'plain':!![]});var _0x19ee64=_0x6803('0x2b');return db[_0x6803('0x2c')][_0x6803('0x29')]({'where':{'type':_0x19ee64,'resourceId':_0x1bd21d['id']}})['then'](function(){return _0x452516;});})['then'](function(){_0x15bb14['status'](0xcc)[_0x6803('0x1e')]();});}};}function handleEntityNotFound(_0x29c8b8,_0x4af259){return function(_0x2b4856){if(!_0x2b4856){_0x29c8b8[_0x6803('0x2d')](0x194);}return _0x2b4856;};}function handleError(_0x90de4,_0x11e726){_0x11e726=_0x11e726||0x1f4;return function(_0xecfab3){logger[_0x6803('0x2e')](_0xecfab3['stack']);if(_0xecfab3[_0x6803('0x2f')]){delete _0xecfab3['name'];}_0x90de4[_0x6803('0x1d')](_0x11e726)[_0x6803('0x30')](_0xecfab3);};}exports[_0x6803('0x31')]=function(_0x152562,_0x37b2dd){var _0x4a895c={},_0x5e6f95={},_0x2defa0={'count':0x0,'rows':[]};var _0x412831=_[_0x6803('0x32')](db[_0x6803('0x33')]['rawAttributes'],function(_0x297dc7){return{'name':_0x297dc7['fieldName'],'type':_0x297dc7['type'][_0x6803('0x34')]};});_0x5e6f95['model']=_[_0x6803('0x32')](_0x412831,_0x6803('0x2f'));_0x5e6f95['query']=_['keys'](_0x152562['query']);_0x5e6f95[_0x6803('0x35')]=_['intersection'](_0x5e6f95[_0x6803('0x36')],_0x5e6f95['query']);_0x4a895c[_0x6803('0x37')]=_[_0x6803('0x38')](_0x5e6f95[_0x6803('0x36')],qs[_0x6803('0x39')](_0x152562[_0x6803('0x3a')]['fields']));_0x4a895c['attributes']=_0x4a895c[_0x6803('0x37')][_0x6803('0x3b')]?_0x4a895c[_0x6803('0x37')]:_0x5e6f95[_0x6803('0x36')];if(!_0x152562['query'][_0x6803('0x3c')]('nolimit')){_0x4a895c[_0x6803('0x22')]=qs[_0x6803('0x22')](_0x152562[_0x6803('0x3a')]['limit']);_0x4a895c[_0x6803('0x20')]=qs[_0x6803('0x20')](_0x152562[_0x6803('0x3a')][_0x6803('0x20')]);}_0x4a895c['order']=qs[_0x6803('0x3d')](_0x152562[_0x6803('0x3a')][_0x6803('0x3d')]);_0x4a895c['where']=qs[_0x6803('0x35')](_[_0x6803('0x3e')](_0x152562[_0x6803('0x3a')],_0x5e6f95[_0x6803('0x35')]),_0x412831);if(_0x152562[_0x6803('0x3a')][_0x6803('0x3f')]){_0x4a895c[_0x6803('0x40')]=_['merge'](_0x4a895c[_0x6803('0x40')],{'$or':_[_0x6803('0x32')](_0x412831,function(_0x5ea5be){if(_0x5ea5be[_0x6803('0x41')]!=='VIRTUAL'){var _0x2f0c9c={};_0x2f0c9c[_0x5ea5be[_0x6803('0x2f')]]={'$like':'%'+_0x152562['query']['filter']+'%'};return _0x2f0c9c;}})});}_0x4a895c=_[_0x6803('0x42')]({},_0x4a895c,_0x152562[_0x6803('0x43')]);var _0x2d6424={'where':_0x4a895c[_0x6803('0x40')]};return db[_0x6803('0x33')][_0x6803('0x23')](_0x2d6424)['then'](function(_0x23b132){_0x2defa0['count']=_0x23b132;if(_0x152562[_0x6803('0x3a')][_0x6803('0x44')]){_0x4a895c[_0x6803('0x45')]=[{'all':!![]}];}return db['CmList'][_0x6803('0x46')](_0x4a895c);})['then'](function(_0x11cfe0){_0x2defa0['rows']=_0x11cfe0;return _0x2defa0;})[_0x6803('0x28')](respondWithFilteredResult(_0x37b2dd,_0x4a895c))[_0x6803('0x47')](handleError(_0x37b2dd,null));};exports[_0x6803('0x48')]=function(_0x2a1261,_0x3fab3e){var _0x14644b={'raw':![],'where':{'id':_0x2a1261[_0x6803('0x49')]['id']}},_0x4120f2={};_0x4120f2['model']=_[_0x6803('0x4a')](db['CmList'][_0x6803('0x4b')]);_0x4120f2[_0x6803('0x3a')]=_['keys'](_0x2a1261[_0x6803('0x3a')]);_0x4120f2[_0x6803('0x35')]=_[_0x6803('0x38')](_0x4120f2[_0x6803('0x36')],_0x4120f2[_0x6803('0x3a')]);_0x14644b[_0x6803('0x37')]=_['intersection'](_0x4120f2[_0x6803('0x36')],qs[_0x6803('0x39')](_0x2a1261['query']['fields']));_0x14644b[_0x6803('0x37')]=_0x14644b[_0x6803('0x37')][_0x6803('0x3b')]?_0x14644b['attributes']:_0x4120f2[_0x6803('0x36')];if(_0x2a1261[_0x6803('0x3a')][_0x6803('0x44')]){_0x14644b[_0x6803('0x45')]=[{'all':!![]}];}_0x14644b=_[_0x6803('0x42')]({},_0x14644b,_0x2a1261[_0x6803('0x43')]);return db[_0x6803('0x33')][_0x6803('0x4c')](_0x14644b)[_0x6803('0x28')](handleEntityNotFound(_0x3fab3e,null))['then'](respondWithResult(_0x3fab3e,null))[_0x6803('0x47')](handleError(_0x3fab3e,null));};exports['create']=function(_0x59c931,_0x181bc4){return db['CmList']['create'](_0x59c931[_0x6803('0x4d')],{})['then'](function(_0x33ab95){var _0x3b7782=_0x59c931[_0x6803('0x4e')][_0x6803('0x2a')]({'plain':!![]});if(!_0x3b7782)throw new Error(_0x6803('0x4f'));if(_0x3b7782[_0x6803('0x50')]===_0x6803('0x4e')){var _0x7ec1dc=_0x33ab95[_0x6803('0x2a')]({'plain':!![]});var _0x180c04=_0x6803('0x2b');return db[_0x6803('0x51')][_0x6803('0x4c')]({'where':{'name':_0x180c04,'userProfileId':_0x3b7782[_0x6803('0x52')]},'raw':!![]})['then'](function(_0x2e317b){if(_0x2e317b&&_0x2e317b[_0x6803('0x53')]===0x0){return db[_0x6803('0x2c')][_0x6803('0x54')]({'name':_0x7ec1dc[_0x6803('0x2f')],'resourceId':_0x7ec1dc['id'],'type':_0x2e317b['name'],'sectionId':_0x2e317b['id']},{})['then'](function(){return _0x33ab95;});}else{return _0x33ab95;}})['catch'](function(_0x18ea6f){logger['error'](_0x6803('0x55'),_0x18ea6f);throw _0x18ea6f;});}return _0x33ab95;})[_0x6803('0x28')](respondWithResult(_0x181bc4,0xc9))['catch'](handleError(_0x181bc4,null));};exports[_0x6803('0x27')]=function(_0x2f86cb,_0x19cb62){if(_0x2f86cb[_0x6803('0x4d')]['id']){delete _0x2f86cb[_0x6803('0x4d')]['id'];}return db[_0x6803('0x33')][_0x6803('0x4c')]({'where':{'id':_0x2f86cb[_0x6803('0x49')]['id']}})['then'](handleEntityNotFound(_0x19cb62,null))['then'](saveUpdates(_0x2f86cb[_0x6803('0x4d')],null))[_0x6803('0x28')](respondWithResult(_0x19cb62,null))[_0x6803('0x47')](handleError(_0x19cb62,null));};exports['destroy']=function(_0x132c7a,_0x54912d){return db[_0x6803('0x33')][_0x6803('0x4c')]({'where':{'id':_0x132c7a[_0x6803('0x49')]['id']}})['then'](handleEntityNotFound(_0x54912d,null))['then'](removeEntity(_0x54912d,null))[_0x6803('0x47')](handleError(_0x54912d,null));};exports[_0x6803('0x56')]=function(_0x26bf4f,_0x4b5805){return db[_0x6803('0x33')]['describe']()[_0x6803('0x28')](respondWithResult(_0x4b5805,null))[_0x6803('0x47')](handleError(_0x4b5805,null));};exports[_0x6803('0x57')]=function(_0x163ade,_0x4df575,_0x4434b2){if(_0x163ade[_0x6803('0x4d')]['id']){delete _0x163ade[_0x6803('0x4d')]['id'];}return db[_0x6803('0x33')][_0x6803('0x4c')]({'where':{'id':_0x163ade[_0x6803('0x49')]['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x4df575,null))[_0x6803('0x28')](function(_0x4c34db){if(_0x4c34db){_0x163ade[_0x6803('0x4d')][_0x6803('0x58')]=_0x4c34db['id'];return db[_0x6803('0x59')][_0x6803('0x54')](_0x163ade[_0x6803('0x4d')]);}})[_0x6803('0x28')](respondWithResult(_0x4df575,null))[_0x6803('0x47')](handleError(_0x4df575,null));};exports[_0x6803('0x5a')]=function(_0x34793d,_0x53732b,_0x2f3d0e){var _0x5bcc9b={'raw':![],'where':{}};var _0x21853a={};var _0xff1e7b={'count':0x0,'rows':[]};return db['CmList'][_0x6803('0x5b')]({'where':{'id':_0x34793d['params']['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x53732b,null))[_0x6803('0x28')](function(_0x661490){if(_0x661490){_0x21853a[_0x6803('0x36')]=_[_0x6803('0x4a')](db[_0x6803('0x59')][_0x6803('0x4b')]);_0x21853a['query']=_[_0x6803('0x4a')](_0x34793d[_0x6803('0x3a')]);_0x21853a[_0x6803('0x35')]=_[_0x6803('0x38')](_0x21853a[_0x6803('0x36')],_0x21853a['query']);_0x5bcc9b['attributes']=_['intersection'](_0x21853a[_0x6803('0x36')],qs['fields'](_0x34793d[_0x6803('0x3a')][_0x6803('0x39')]));_0x5bcc9b[_0x6803('0x37')]=_0x5bcc9b[_0x6803('0x37')][_0x6803('0x3b')]?_0x5bcc9b[_0x6803('0x37')]:_0x21853a[_0x6803('0x36')];if(!_0x34793d[_0x6803('0x3a')][_0x6803('0x3c')](_0x6803('0x5c'))){_0x5bcc9b[_0x6803('0x22')]=qs[_0x6803('0x22')](_0x34793d[_0x6803('0x3a')][_0x6803('0x22')]);_0x5bcc9b[_0x6803('0x20')]=qs[_0x6803('0x20')](_0x34793d[_0x6803('0x3a')][_0x6803('0x20')]);}_0x5bcc9b['order']=qs[_0x6803('0x3d')](_0x34793d[_0x6803('0x3a')][_0x6803('0x3d')]);_0x5bcc9b[_0x6803('0x40')]=qs[_0x6803('0x35')](_[_0x6803('0x3e')](_0x34793d[_0x6803('0x3a')],_0x21853a[_0x6803('0x35')]));_0x5bcc9b[_0x6803('0x40')][_0x6803('0x58')]=_0x661490['id'];if(_0x34793d[_0x6803('0x3a')][_0x6803('0x3f')]){_0x5bcc9b[_0x6803('0x40')]=_[_0x6803('0x42')](_0x5bcc9b[_0x6803('0x40')],{'$or':_['map'](_0x5bcc9b[_0x6803('0x37')],function(_0x3f9bb7){var _0x4e716a={};_0x4e716a[_0x3f9bb7]={'$like':'%'+_0x34793d[_0x6803('0x3a')]['filter']+'%'};return _0x4e716a;})});}_0x5bcc9b=_[_0x6803('0x42')]({},_0x5bcc9b,_0x34793d[_0x6803('0x43')]);return db[_0x6803('0x59')]['count']({'where':_0x5bcc9b['where']})[_0x6803('0x28')](function(_0x5e1ce1){_0xff1e7b['count']=_0x5e1ce1;if(_0x34793d[_0x6803('0x3a')][_0x6803('0x44')]){_0x5bcc9b[_0x6803('0x45')]=[{'all':!![]}];}return db[_0x6803('0x59')][_0x6803('0x46')](_0x5bcc9b);})['then'](function(_0x49b5e8){_0xff1e7b[_0x6803('0x5d')]=_0x49b5e8;return _0xff1e7b;});}})['then'](respondWithFilteredResult(_0x53732b,_0x5bcc9b))[_0x6803('0x47')](handleError(_0x53732b,null));};exports[_0x6803('0x5e')]=function(_0x112204,_0x23ca38,_0x2c76e4){return db[_0x6803('0x33')][_0x6803('0x4c')]({'where':{'id':_0x112204['params']['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x23ca38,null))[_0x6803('0x28')](function(_0x3dd235){if(_0x3dd235){return _0x3dd235[_0x6803('0x5e')](_0x112204[_0x6803('0x3a')][_0x6803('0x5f')]);}})[_0x6803('0x28')](respondWithStatusCode(_0x23ca38,null))['catch'](handleError(_0x23ca38,null));};exports['addContacts']=function(_0x2d78df,_0x422cc4,_0x1d6762){return db[_0x6803('0x33')][_0x6803('0x4c')]({'where':{'id':_0x2d78df[_0x6803('0x49')]['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x422cc4,null))[_0x6803('0x28')](function(_0x451a0b){if(_0x451a0b){var _0x24b03c=[];var _0x3153b9={'success':[],'errors':[]};return db[_0x6803('0x60')][_0x6803('0x56')]()[_0x6803('0x28')](function(_0x25d6f6){if(_0x2d78df['body']['tags']&&_[_0x6803('0x61')](_0x2d78df[_0x6803('0x4d')]['tags'])){if(_0x2d78df[_0x6803('0x4d')][_0x6803('0x62')][_0x6803('0x3b')]){_0x2d78df[_0x6803('0x4d')][_0x6803('0x62')]=_0x2d78df['body'][_0x6803('0x62')][_0x6803('0x63')](';')+';';}else{_0x2d78df[_0x6803('0x4d')]['tags']=null;}}else{_0x2d78df[_0x6803('0x4d')][_0x6803('0x62')]=null;}if(_0x2d78df[_0x6803('0x4d')]&&_[_0x6803('0x61')](_0x2d78df['body'])){for(var _0x303d8e=0x0;_0x303d8e<_0x2d78df['body'][_0x6803('0x3b')];_0x303d8e+=0x1){_0x2d78df[_0x6803('0x4d')][_0x303d8e][_0x6803('0x58')]=_0x2d78df['params']['id'];_0x24b03c[_0x6803('0x64')](_0x2d78df['body'][_0x303d8e]);}return BPromise[_0x6803('0x65')](_0x24b03c,function(_0x3edd95){return db[_0x6803('0x60')][_0x6803('0x54')](_['omit'](_0x3edd95,[_0x6803('0x5f'),'id'])||{},{'fields':_['keys'](_0x25d6f6),'raw':!![]})['then'](function(_0x1d3f4e){_0x3153b9['success'][_0x6803('0x64')](_0x1d3f4e[_0x6803('0x66')]);})[_0x6803('0x47')](function(_0x2001de){_0x3153b9[_0x6803('0x67')]['push']({'data':_0x3edd95,'error':_0x2001de[_0x6803('0x68')]});});})[_0x6803('0x28')](function(_0x1213de){return _0x3153b9;})[_0x6803('0x47')](function(_0x14ecc8){return _0x14ecc8;});}else{_0x422cc4[_0x6803('0x1d')](0x190)['json']({'message':_0x6803('0x69')});}});}})['then'](respondWithResult(_0x422cc4,null))['catch'](handleError(_0x422cc4,null));};exports[_0x6803('0x6a')]=function(_0x2688a1,_0xa6e732,_0x39b2ac){var _0x18340e;return db[_0x6803('0x33')][_0x6803('0x4c')]({'where':{'id':_0x2688a1[_0x6803('0x49')]['id']},'include':[{'model':db[_0x6803('0x6b')],'as':_0x6803('0x6c')}]})['then'](handleEntityNotFound(_0xa6e732,null))['then'](function(_0x172998){if(_0x172998){_0x18340e=_0x172998;return db['CmContact'][_0x6803('0x4b')];}})[_0x6803('0x28')](function(_0x2eabe4){if(_0x2eabe4){var _0x3298d2={};var _0x173fcc={};_0x173fcc[_0x6803('0x36')]=_[_0x6803('0x6d')](_[_0x6803('0x4a')](_0x2eabe4),_[_0x6803('0x32')](_0x18340e['CustomFields'],function(_0x140ebf){return util[_0x6803('0x6e')]('cf_%d',_0x140ebf['id']);}));_0x173fcc[_0x6803('0x3a')]=_[_0x6803('0x4a')](_0x2688a1['query']);_0x173fcc['filters']=_[_0x6803('0x38')](_0x173fcc['model'],_0x173fcc['query']);_0x3298d2['attributes']=_[_0x6803('0x38')](_0x173fcc[_0x6803('0x36')],qs[_0x6803('0x39')](_0x2688a1[_0x6803('0x3a')]['fields']));_0x3298d2['attributes']=_0x3298d2['attributes'][_0x6803('0x3b')]?_0x3298d2[_0x6803('0x37')]:_0x173fcc['model'];if(!_0x2688a1[_0x6803('0x3a')][_0x6803('0x3c')](_0x6803('0x5c'))){_0x3298d2['limit']=qs[_0x6803('0x22')](_0x2688a1['query'][_0x6803('0x22')]);_0x3298d2[_0x6803('0x20')]=qs[_0x6803('0x20')](_0x2688a1[_0x6803('0x3a')][_0x6803('0x20')]);}_0x3298d2['order']=qs[_0x6803('0x3d')](_0x2688a1['query'][_0x6803('0x3d')]);_0x3298d2['where']=qs[_0x6803('0x35')](_[_0x6803('0x3e')](_0x2688a1[_0x6803('0x3a')],_0x173fcc[_0x6803('0x35')]));_0x3298d2[_0x6803('0x6f')]=!![];if(_0x2688a1[_0x6803('0x3a')][_0x6803('0x3f')]){_0x3298d2[_0x6803('0x40')]=_['merge'](_0x3298d2[_0x6803('0x40')],{'$or':_[_0x6803('0x32')](_0x3298d2[_0x6803('0x37')],function(_0x552d89){var _0x1b6551={};_0x1b6551[_0x552d89]={'$like':'%'+_0x2688a1['query'][_0x6803('0x3f')]+'%'};return _0x1b6551;})});}_0x3298d2=_[_0x6803('0x42')]({},_0x3298d2,_0x2688a1['options']);return _0x18340e['getContacts'](_0x3298d2);}})[_0x6803('0x28')](respondWithResult(_0xa6e732,null))[_0x6803('0x47')](handleError(_0xa6e732,null));};exports[_0x6803('0x70')]=function(_0x369d31,_0x120adb,_0x4ec063){var _0x9872f2;return db[_0x6803('0x33')][_0x6803('0x4c')]({'where':{'id':_0x369d31[_0x6803('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x6803('0x28')](handleEntityNotFound(_0x120adb,null))['then'](function(_0x5cd2ae){if(_0x5cd2ae){_0x9872f2=_0x5cd2ae;return db[_0x6803('0x60')][_0x6803('0x4b')];}})[_0x6803('0x28')](function(_0x111136){if(_0x111136){var _0x29fe5c={};var _0x96a5d1={};_0x96a5d1[_0x6803('0x36')]=_['concat'](_[_0x6803('0x4a')](_0x111136),_['map'](_0x9872f2[_0x6803('0x6c')],function(_0x375546){return util[_0x6803('0x6e')](_0x6803('0x71'),_0x375546['id']);}));_0x96a5d1[_0x6803('0x3a')]=_[_0x6803('0x4a')](_0x369d31[_0x6803('0x3a')]);_0x96a5d1['filters']=_[_0x6803('0x38')](_0x96a5d1['model'],_0x96a5d1[_0x6803('0x3a')]);_0x29fe5c[_0x6803('0x37')]=_[_0x6803('0x38')](_0x96a5d1[_0x6803('0x36')],qs[_0x6803('0x39')](_0x369d31[_0x6803('0x3a')]['fields']));_0x29fe5c[_0x6803('0x37')]=_0x29fe5c['attributes'][_0x6803('0x3b')]?_0x29fe5c[_0x6803('0x37')]:_0x96a5d1[_0x6803('0x36')];if(!_0x369d31[_0x6803('0x3a')][_0x6803('0x3c')](_0x6803('0x5c'))){_0x29fe5c['limit']=qs['limit'](_0x369d31['query'][_0x6803('0x22')]);_0x29fe5c[_0x6803('0x20')]=qs[_0x6803('0x20')](_0x369d31['query'][_0x6803('0x20')]);}_0x29fe5c['order']=qs[_0x6803('0x3d')](_0x369d31['query'][_0x6803('0x3d')]);_0x29fe5c[_0x6803('0x40')]=qs['filters'](_[_0x6803('0x3e')](_0x369d31[_0x6803('0x3a')],_0x96a5d1[_0x6803('0x35')]));_0x29fe5c[_0x6803('0x6f')]=!![];if(_0x369d31[_0x6803('0x3a')][_0x6803('0x3f')]){_0x29fe5c[_0x6803('0x40')]=_[_0x6803('0x42')](_0x29fe5c[_0x6803('0x40')],{'$or':_[_0x6803('0x32')](_0x29fe5c[_0x6803('0x37')],function(_0x425a3e){var _0x589334={};_0x589334[_0x425a3e]={'$like':'%'+_0x369d31[_0x6803('0x3a')][_0x6803('0x3f')]+'%'};return _0x589334;})});}_0x29fe5c=_[_0x6803('0x42')]({},_0x29fe5c,_0x369d31[_0x6803('0x43')]);return _0x9872f2[_0x6803('0x6a')](_0x29fe5c);}})['then'](function(_0xcc8d17){if(!_[_0x6803('0x72')](_0xcc8d17)){var _0x329574=toCsv(_0xcc8d17);var _0x291078=Date[_0x6803('0x73')]();fs['writeFileSync'](util['format'](_0x6803('0x74'),_0x9872f2['id'],_0x291078),_0x329574);_0x120adb[_0x6803('0x75')]('Content-disposition','attachment;\x20filename='+util[_0x6803('0x6e')](_0x6803('0x76'),_0x9872f2['id'],_0x291078));_0x120adb['setHeader'](_0x6803('0x77'),_0x6803('0x78'));return _0x120adb[_0x6803('0x79')](util['format'](_0x6803('0x74'),_0x9872f2['id'],_0x291078));}else{return _0x120adb['sendStatus'](0xcc);}})[_0x6803('0x47')](handleError(_0x120adb,null));};exports[_0x6803('0x7a')]=function(_0x3ad4d5,_0x49217b,_0x2be1c3){var _0x200c1b;delete _0x3ad4d5[_0x6803('0x4d')]['id'];return db[_0x6803('0x33')][_0x6803('0x5b')]({'where':{'id':_0x3ad4d5['params']['id']}})['then'](handleEntityNotFound(_0x49217b,null))['then'](function(_0x584431){if(_0x584431){return db['sequelize'][_0x6803('0x7b')](function(_0x86a4a0){return db[_0x6803('0x6b')][_0x6803('0x54')](_0x3ad4d5[_0x6803('0x4d')],{'transaction':_0x86a4a0})[_0x6803('0x28')](function(_0x36af1f){_0x200c1b=_0x36af1f;return _0x584431[_0x6803('0x7c')](_0x36af1f,{'transaction':_0x86a4a0});})[_0x6803('0x28')](function(){var _0x4a6e09={'type':db['Sequelize']['TEXT'],'transaction':_0x86a4a0};switch(_0x3ad4d5[_0x6803('0x4d')][_0x6803('0x41')]){case'text':_0x4a6e09[_0x6803('0x41')]=db['Sequelize'][_0x6803('0x7d')];break;case _0x6803('0x7e'):_0x4a6e09[_0x6803('0x41')]=db[_0x6803('0x7f')][_0x6803('0x80')];break;case _0x6803('0x81'):_0x4a6e09['type']=db['Sequelize'][_0x6803('0x82')];_0x4a6e09[_0x6803('0x83')]=![];break;default:}return db['sequelize'][_0x6803('0x84')]['addColumn'](_0x6803('0x85'),util[_0x6803('0x6e')](_0x6803('0x86'),_0x200c1b['id']),_0x4a6e09);})[_0x6803('0x28')](function(){return _0x200c1b;});});}})[_0x6803('0x28')](respondWithResult(_0x49217b,null))['catch'](handleError(_0x49217b,null));};exports[_0x6803('0x87')]=function(_0x4eb910,_0x396861,_0x1c27cd){var _0x1e80d3={};var _0x1c1af3={};var _0x1e7cac;var _0x2038d9;return db['CmList'][_0x6803('0x5b')]({'where':{'id':_0x4eb910[_0x6803('0x49')]['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x396861,null))[_0x6803('0x28')](function(_0x42d11d){if(_0x42d11d){_0x1e7cac=_0x42d11d;_0x1c1af3['model']=_[_0x6803('0x4a')](db[_0x6803('0x6b')][_0x6803('0x4b')]);_0x1c1af3[_0x6803('0x3a')]=_[_0x6803('0x4a')](_0x4eb910[_0x6803('0x3a')]);_0x1c1af3['filters']=_[_0x6803('0x38')](_0x1c1af3[_0x6803('0x36')],_0x1c1af3[_0x6803('0x3a')]);_0x1e80d3[_0x6803('0x37')]=_[_0x6803('0x38')](_0x1c1af3['model'],qs[_0x6803('0x39')](_0x4eb910[_0x6803('0x3a')][_0x6803('0x39')]));_0x1e80d3[_0x6803('0x37')]=_0x1e80d3[_0x6803('0x37')][_0x6803('0x3b')]?_0x1e80d3[_0x6803('0x37')]:_0x1c1af3[_0x6803('0x36')];_0x1e80d3[_0x6803('0x88')]=qs[_0x6803('0x3d')](_0x4eb910[_0x6803('0x3a')][_0x6803('0x3d')]);_0x1e80d3['where']=qs[_0x6803('0x35')](_[_0x6803('0x3e')](_0x4eb910['query'],_0x1c1af3[_0x6803('0x35')]));_0x1e80d3[_0x6803('0x40')]=_[_0x6803('0x42')](_0x1e80d3[_0x6803('0x40')],{'$or':[{'ListId':_0x42d11d['id']},{'ListId':null}]});if(_0x4eb910[_0x6803('0x3a')][_0x6803('0x3f')]){_0x1e80d3[_0x6803('0x40')]=_[_0x6803('0x42')](_0x1e80d3[_0x6803('0x40')],{'$or':_[_0x6803('0x32')](_0x1e80d3['attributes'],function(_0x457740){var _0x3e7e22={};_0x3e7e22[_0x457740]={'$like':'%'+_0x4eb910['query']['filter']+'%'};return _0x3e7e22;})});}_0x1e80d3=_[_0x6803('0x42')]({},_0x1e80d3,_0x4eb910[_0x6803('0x43')]);return db['CmCustomField'][_0x6803('0x89')](_0x1e80d3);}})[_0x6803('0x28')](respondWithResult(_0x396861,null))[_0x6803('0x47')](handleError(_0x396861,null));};exports[_0x6803('0x8a')]=function(_0xfe2195,_0x421dcf,_0x5e4ee8){return db['CmList'][_0x6803('0x4c')]({'where':{'id':_0xfe2195[_0x6803('0x49')]['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x421dcf,null))[_0x6803('0x28')](function(_0xe9e843){if(_0xe9e843){return _0xe9e843['addAgents'](_0xfe2195[_0x6803('0x4d')][_0x6803('0x5f')],_[_0x6803('0x8b')](_0xfe2195[_0x6803('0x4d')],[_0x6803('0x5f'),'id'])||{})[_0x6803('0x8c')](function(_0x3c4c97){for(var _0x4e77d9=0x0;_0x4e77d9<_0xfe2195[_0x6803('0x4d')]['ids'][_0x6803('0x3b')];_0x4e77d9+=0x1){socket[_0x6803('0x8d')](_0x6803('0x8e'),{'UserId':Number(_0xfe2195[_0x6803('0x4d')][_0x6803('0x5f')][_0x4e77d9]),'CmListId':Number(_0xfe2195['params']['id'])});}return _0x3c4c97;});}})[_0x6803('0x28')](respondWithResult(_0x421dcf,null))[_0x6803('0x47')](handleError(_0x421dcf,null));};exports[_0x6803('0x8f')]=function(_0x530457,_0x5d7b1c,_0x5199ed){return db[_0x6803('0x33')][_0x6803('0x4c')]({'where':{'id':_0x530457['params']['id']}})[_0x6803('0x28')](handleEntityNotFound(_0x5d7b1c,null))['then'](function(_0x161ffc){if(_0x161ffc){return _0x161ffc[_0x6803('0x8f')](_0x530457[_0x6803('0x3a')][_0x6803('0x5f')])[_0x6803('0x28')](function(){if(_[_0x6803('0x61')](_0x530457[_0x6803('0x3a')]['ids'])){for(var _0xae01d=0x0;_0xae01d<_0x530457[_0x6803('0x3a')][_0x6803('0x5f')][_0x6803('0x3b')];_0xae01d+=0x1){socket[_0x6803('0x8d')](_0x6803('0x90'),{'UserId':Number(_0x530457[_0x6803('0x3a')][_0x6803('0x5f')][_0xae01d]),'CmListId':Number(_0x530457[_0x6803('0x49')]['id'])});}}else{socket[_0x6803('0x8d')](_0x6803('0x90'),{'UserId':Number(_0x530457['query'][_0x6803('0x5f')]),'CmListId':Number(_0x530457['params']['id'])});}});}})[_0x6803('0x28')](respondWithStatusCode(_0x5d7b1c,null))[_0x6803('0x47')](handleError(_0x5d7b1c,null));};exports[_0x6803('0x91')]=function(_0x30c3b6,_0x3d02d1,_0x5862b1){var _0x5a114a={};var _0x3e6017={};var _0x5785c6;var _0x260f7d;return db['CmList'][_0x6803('0x5b')]({'where':{'id':_0x30c3b6[_0x6803('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d02d1,null))['then'](function(_0x2c04b0){if(_0x2c04b0){_0x5785c6=_0x2c04b0;_0x3e6017[_0x6803('0x36')]=_['keys'](db[_0x6803('0x92')]['rawAttributes']);_0x3e6017[_0x6803('0x3a')]=_[_0x6803('0x4a')](_0x30c3b6['query']);_0x3e6017[_0x6803('0x35')]=_['intersection'](_0x3e6017[_0x6803('0x36')],_0x3e6017[_0x6803('0x3a')]);_0x5a114a[_0x6803('0x37')]=_[_0x6803('0x38')](_0x3e6017['model'],qs[_0x6803('0x39')](_0x30c3b6[_0x6803('0x3a')]['fields']));_0x5a114a[_0x6803('0x37')]=_0x5a114a[_0x6803('0x37')][_0x6803('0x3b')]?_0x5a114a['attributes']:_0x3e6017[_0x6803('0x36')];_0x5a114a[_0x6803('0x88')]=qs[_0x6803('0x3d')](_0x30c3b6[_0x6803('0x3a')][_0x6803('0x3d')]);_0x5a114a[_0x6803('0x40')]=qs[_0x6803('0x35')](_['pick'](_0x30c3b6[_0x6803('0x3a')],_0x3e6017[_0x6803('0x35')]));if(_0x30c3b6['query'][_0x6803('0x3f')]){_0x5a114a[_0x6803('0x40')]=_['merge'](_0x5a114a[_0x6803('0x40')],{'$or':_['map'](_0x5a114a[_0x6803('0x37')],function(_0xeb05c3){var _0x4c48d1={};_0x4c48d1[_0xeb05c3]={'$like':'%'+_0x30c3b6['query']['filter']+'%'};return _0x4c48d1;})});}_0x5a114a=_[_0x6803('0x42')]({},_0x5a114a,_0x30c3b6['options']);return _0x5785c6[_0x6803('0x91')](_0x5a114a);}})['then'](function(_0x30fff5){if(_0x30fff5){_0x260f7d=_0x30fff5[_0x6803('0x3b')];if(!_0x30c3b6[_0x6803('0x3a')]['hasOwnProperty'](_0x6803('0x5c'))){_0x5a114a[_0x6803('0x22')]=qs[_0x6803('0x22')](_0x30c3b6['query'][_0x6803('0x22')]);_0x5a114a[_0x6803('0x20')]=qs[_0x6803('0x20')](_0x30c3b6[_0x6803('0x3a')]['offset']);}return _0x5785c6[_0x6803('0x91')](_0x5a114a);}})[_0x6803('0x28')](function(_0x28a9dd){if(_0x28a9dd){return _0x28a9dd?{'count':_0x260f7d,'rows':_0x28a9dd}:null;}})[_0x6803('0x28')](respondWithResult(_0x3d02d1,null))[_0x6803('0x47')](handleError(_0x3d02d1,null));};
\ No newline at end of file
index b7e0580..8e18157 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x12d6c2,_0x409bc8){var _0x1c9825=function(_0x569f66){while(--_0x569f66){_0x12d6c2['push'](_0x12d6c2['shift']());}};_0x1c9825(++_0x409bc8);}(_0x814b,0x1a2));var _0xb814=function(_0x2abaae,_0x29fd8b){_0x2abaae=_0x2abaae-0x0;var _0x5b5745=_0x814b[_0x2abaae];return _0x5b5745;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents;
\ No newline at end of file
+var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x4e8718,_0x51a62f){var _0x1234e9=function(_0x4de43c){while(--_0x4de43c){_0x4e8718['push'](_0x4e8718['shift']());}};_0x1234e9(++_0x51a62f);}(_0x814b,0x1a2));var _0xb814=function(_0x5c0a22,_0x3e0eb3){_0x5c0a22=_0x5c0a22-0x0;var _0x292d8e=_0x814b[_0x5c0a22];return _0x292d8e;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents;
\ No newline at end of file
index 7d5ba47..490a26a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['request-promise','path','./cmList.attributes','define','CmList','cm_lists','../../config/logger','api','moment','bluebird'];(function(_0x4e2341,_0x89427f){var _0x4c47d6=function(_0x218c51){while(--_0x218c51){_0x4e2341['push'](_0x4e2341['shift']());}};_0x4c47d6(++_0x89427f);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9bde=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','api','bluebird'];(function(_0x46440d,_0x24a073){var _0xc26809=function(_0x3e2ebd){while(--_0x3e2ebd){_0x46440d['push'](_0x46440d['shift']());}};_0xc26809(++_0x24a073);}(_0x9bde,0xe1));var _0xe9bd=function(_0x242ed7,_0x486bba){_0x242ed7=_0x242ed7-0x0;var _0x2acc4d=_0x9bde[_0x242ed7];return _0x2acc4d;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ab3a622..cdd8a89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedbc=['localhost','socket.io-emitter','./cmList.socket','register','request','info','debug','request\x20sent','stringify','error','code','CmList,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x516969,_0x2d2196){var _0x4cbd45=function(_0x1cd143){while(--_0x1cd143){_0x516969['push'](_0x516969['shift']());}};_0x4cbd45(++_0x2d2196);}(_0xedbc,0x142));var _0xcedb=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xedbc[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xcedb('0x0'));var util=require('util');var moment=require(_0xcedb('0x1'));var BPromise=require('bluebird');var rs=require(_0xcedb('0x2'));var fs=require('fs');var Redis=require(_0xcedb('0x3'));var db=require(_0xcedb('0x4'))['db'];var utils=require(_0xcedb('0x5'));var logger=require(_0xcedb('0x6'))(_0xcedb('0x7'));var config=require(_0xcedb('0x8'));var jayson=require(_0xcedb('0x9'));var client=jayson[_0xcedb('0xa')][_0xcedb('0xb')]({'port':0x232a});config[_0xcedb('0xc')]=_[_0xcedb('0xd')](config[_0xcedb('0xc')],{'host':_0xcedb('0xe'),'port':0x18eb});var socket=require(_0xcedb('0xf'))(new Redis(config[_0xcedb('0xc')]));require(_0xcedb('0x10'))[_0xcedb('0x11')](socket);function respondWithRpcPromise(_0x2ad08a,_0x2429f3,_0x5ce766){return new BPromise(function(_0x462b4f,_0x94148c){return client[_0xcedb('0x12')](_0x2ad08a,_0x5ce766)['then'](function(_0x26e2cc){logger[_0xcedb('0x13')]('CmList,\x20%s,\x20%s',_0x2429f3,'request\x20sent');logger[_0xcedb('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x2429f3,_0xcedb('0x15'),JSON[_0xcedb('0x16')](_0x26e2cc));if(_0x26e2cc['error']){if(_0x26e2cc[_0xcedb('0x17')][_0xcedb('0x18')]===0x1f4){logger[_0xcedb('0x17')](_0xcedb('0x19'),_0x2429f3,_0x26e2cc[_0xcedb('0x17')]['message']);return _0x94148c(_0x26e2cc['error'][_0xcedb('0x1a')]);}logger['error'](_0xcedb('0x19'),_0x2429f3,_0x26e2cc[_0xcedb('0x17')][_0xcedb('0x1a')]);return _0x462b4f(_0x26e2cc[_0xcedb('0x17')]['message']);}else{logger['info'](_0xcedb('0x19'),_0x2429f3,_0xcedb('0x15'));_0x462b4f(_0x26e2cc[_0xcedb('0x1b')][_0xcedb('0x1a')]);}})['catch'](function(_0x36ecd4){logger['error'](_0xcedb('0x19'),_0x2429f3,_0x36ecd4);_0x94148c(_0x36ecd4);});});}
\ No newline at end of file
+var _0x5b68=['defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x103af9,_0x354748){var _0x3fb8ac=function(_0x5d10ad){while(--_0x5d10ad){_0x103af9['push'](_0x103af9['shift']());}};_0x3fb8ac(++_0x354748);}(_0x5b68,0x148));var _0x85b6=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x5b68[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0x85b6('0x0'));var util=require('util');var moment=require(_0x85b6('0x1'));var BPromise=require(_0x85b6('0x2'));var rs=require(_0x85b6('0x3'));var fs=require('fs');var Redis=require(_0x85b6('0x4'));var db=require(_0x85b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85b6('0x6'));var config=require(_0x85b6('0x7'));var jayson=require(_0x85b6('0x8'));var client=jayson['client'][_0x85b6('0x9')]({'port':0x232a});config['redis']=_[_0x85b6('0xa')](config[_0x85b6('0xb')],{'host':_0x85b6('0xc'),'port':0x18eb});var socket=require(_0x85b6('0xd'))(new Redis(config['redis']));require(_0x85b6('0xe'))[_0x85b6('0xf')](socket);function respondWithRpcPromise(_0x151d00,_0x50e842,_0xeff73a){return new BPromise(function(_0x81632b,_0x2a364b){return client[_0x85b6('0x10')](_0x151d00,_0xeff73a)[_0x85b6('0x11')](function(_0x3aed23){logger[_0x85b6('0x12')](_0x85b6('0x13'),_0x50e842,_0x85b6('0x14'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x50e842,'request\x20sent',JSON['stringify'](_0x3aed23));if(_0x3aed23[_0x85b6('0x15')]){if(_0x3aed23[_0x85b6('0x15')][_0x85b6('0x16')]===0x1f4){logger[_0x85b6('0x15')](_0x85b6('0x13'),_0x50e842,_0x3aed23[_0x85b6('0x15')][_0x85b6('0x17')]);return _0x2a364b(_0x3aed23[_0x85b6('0x15')][_0x85b6('0x17')]);}logger[_0x85b6('0x15')](_0x85b6('0x13'),_0x50e842,_0x3aed23[_0x85b6('0x15')][_0x85b6('0x17')]);return _0x81632b(_0x3aed23[_0x85b6('0x15')][_0x85b6('0x17')]);}else{logger['info'](_0x85b6('0x13'),_0x50e842,_0x85b6('0x14'));_0x81632b(_0x3aed23[_0x85b6('0x18')][_0x85b6('0x17')]);}})[_0x85b6('0x19')](function(_0x35204b){logger['error'](_0x85b6('0x13'),_0x50e842,_0x35204b);_0x2a364b(_0x35204b);});});}
\ No newline at end of file
index 3c27da4..ff1ef94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d76=['length','cmList:','./cmList.events','save','remove','emit'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x6d76,0xa4));var _0x66d7=function(_0x242bd8,_0x113689){_0x242bd8=_0x242bd8-0x0;var _0xbdb875=_0x6d76[_0x242bd8];return _0xbdb875;};'use strict';var CmListEvents=require(_0x66d7('0x0'));var events=[_0x66d7('0x1'),_0x66d7('0x2'),'update'];function createListener(_0x2cbd30,_0x55b03c){return function(_0x402afa){_0x55b03c[_0x66d7('0x3')](_0x2cbd30,_0x402afa);};}function removeListener(_0x48ccd8,_0x5df586){return function(){CmListEvents['removeListener'](_0x48ccd8,_0x5df586);};}exports['register']=function(_0x112ac7){for(var _0x327540=0x0,_0xed0795=events[_0x66d7('0x4')];_0x327540<_0xed0795;_0x327540++){var _0x13141a=events[_0x327540];var _0xb45729=createListener(_0x66d7('0x5')+_0x13141a,_0x112ac7);CmListEvents['on'](_0x13141a,_0xb45729);}};
\ No newline at end of file
+var _0x6a7c=['cmList:','./cmList.events','remove','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a7c,0x1e7));var _0xc6a7=function(_0x3473c8,_0xec63ce){_0x3473c8=_0x3473c8-0x0;var _0x3eee24=_0x6a7c[_0x3473c8];return _0x3eee24;};'use strict';var CmListEvents=require(_0xc6a7('0x0'));var events=['save',_0xc6a7('0x1'),_0xc6a7('0x2')];function createListener(_0x5b362b,_0x579028){return function(_0x141dd0){_0x579028['emit'](_0x5b362b,_0x141dd0);};}function removeListener(_0x23cdb3,_0x5e3325){return function(){CmListEvents[_0xc6a7('0x3')](_0x23cdb3,_0x5e3325);};}exports[_0xc6a7('0x4')]=function(_0x4f0ada){for(var _0x2a110f=0x0,_0x536d02=events['length'];_0x2a110f<_0x536d02;_0x2a110f++){var _0xd53ef=events[_0x2a110f];var _0x245155=createListener(_0xc6a7('0x5')+_0xd53ef,_0x4f0ada);CmListEvents['on'](_0xd53ef,_0x245155);}};
\ No newline at end of file
index df27bd0..f8146ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00d1=['get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index'];(function(_0x4e145c,_0x3065ce){var _0x30d881=function(_0x3f2140){while(--_0x3f2140){_0x4e145c['push'](_0x4e145c['shift']());}};_0x30d881(++_0x3065ce);}(_0x00d1,0xb6));var _0x100d=function(_0x28678d,_0x54324f){_0x28678d=_0x28678d-0x0;var _0x1643e9=_0x00d1[_0x28678d];return _0x1643e9;};'use strict';var multer=require(_0x100d('0x0'));var util=require(_0x100d('0x1'));var path=require(_0x100d('0x2'));var timeout=require(_0x100d('0x3'));var express=require(_0x100d('0x4'));var router=express[_0x100d('0x5')]();var fs_extra=require(_0x100d('0x6'));var auth=require(_0x100d('0x7'));var interaction=require(_0x100d('0x8'));var config=require(_0x100d('0x9'));var controller=require(_0x100d('0xa'));router['get']('/',auth[_0x100d('0xb')](),controller[_0x100d('0xc')]);router[_0x100d('0xd')](_0x100d('0xe'),auth[_0x100d('0xb')](),controller[_0x100d('0xf')]);router[_0x100d('0xd')](_0x100d('0x10'),auth[_0x100d('0xb')](),controller[_0x100d('0x11')]);router[_0x100d('0xd')](_0x100d('0x12'),auth[_0x100d('0xb')](),controller[_0x100d('0x13')]);router[_0x100d('0xd')](_0x100d('0x14'),auth[_0x100d('0xb')](),controller['getContacts']);router[_0x100d('0xd')](_0x100d('0x15'),auth[_0x100d('0xb')](),controller[_0x100d('0x16')]);router[_0x100d('0xd')](_0x100d('0x17'),auth['isAuthenticated'](),controller[_0x100d('0x18')]);router[_0x100d('0xd')](_0x100d('0x19'),auth[_0x100d('0xb')](),controller[_0x100d('0x1a')]);router[_0x100d('0x1b')]('/',auth['isAuthenticated'](),controller['create']);router[_0x100d('0x1b')](_0x100d('0x12'),auth[_0x100d('0xb')](),controller[_0x100d('0x1c')]);router['post'](_0x100d('0x14'),auth[_0x100d('0xb')](),controller[_0x100d('0x1d')]);router[_0x100d('0x1b')](_0x100d('0x17'),auth['isAuthenticated'](),controller[_0x100d('0x1e')]);router[_0x100d('0x1b')](_0x100d('0x19'),auth[_0x100d('0xb')](),controller[_0x100d('0x1f')]);router[_0x100d('0x20')](_0x100d('0x10'),auth['isAuthenticated'](),controller[_0x100d('0x21')]);router[_0x100d('0x22')](_0x100d('0x10'),auth['isAuthenticated'](),controller[_0x100d('0x23')]);router[_0x100d('0x22')](_0x100d('0x12'),auth[_0x100d('0xb')](),controller[_0x100d('0x24')]);router[_0x100d('0x22')](_0x100d('0x19'),auth[_0x100d('0xb')](),controller[_0x100d('0x25')]);module[_0x100d('0x26')]=router;
\ No newline at end of file
+var _0xc3bc=['getCustomFields','/:id/users','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','destroy','delete','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getContacts','/:id/contacts/csv','/:id/fields'];(function(_0x2f1908,_0x5d837d){var _0x357795=function(_0x5bf606){while(--_0x5bf606){_0x2f1908['push'](_0x2f1908['shift']());}};_0x357795(++_0x5d837d);}(_0xc3bc,0x10b));var _0xcc3b=function(_0x4eabdf,_0x5ed32e){_0x4eabdf=_0x4eabdf-0x0;var _0x34c6e5=_0xc3bc[_0x4eabdf];return _0x34c6e5;};'use strict';var multer=require(_0xcc3b('0x0'));var util=require('util');var path=require(_0xcc3b('0x1'));var timeout=require(_0xcc3b('0x2'));var express=require(_0xcc3b('0x3'));var router=express[_0xcc3b('0x4')]();var fs_extra=require(_0xcc3b('0x5'));var auth=require(_0xcc3b('0x6'));var interaction=require(_0xcc3b('0x7'));var config=require(_0xcc3b('0x8'));var controller=require(_0xcc3b('0x9'));router['get']('/',auth[_0xcc3b('0xa')](),controller[_0xcc3b('0xb')]);router[_0xcc3b('0xc')](_0xcc3b('0xd'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0xe')]);router[_0xcc3b('0xc')](_0xcc3b('0xf'),auth['isAuthenticated'](),controller[_0xcc3b('0x10')]);router['get'](_0xcc3b('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xcc3b('0xc')]('/:id/contacts',auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x12')]);router['get'](_0xcc3b('0x13'),auth[_0xcc3b('0xa')](),controller['getContactsCsv']);router[_0xcc3b('0xc')](_0xcc3b('0x14'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x15')]);router[_0xcc3b('0xc')](_0xcc3b('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xcc3b('0x17')]('/',auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x18')]);router[_0xcc3b('0x17')](_0xcc3b('0x11'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x19')]);router[_0xcc3b('0x17')]('/:id/contacts',auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x1a')]);router[_0xcc3b('0x17')](_0xcc3b('0x14'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x1b')]);router[_0xcc3b('0x17')](_0xcc3b('0x16'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x1c')]);router[_0xcc3b('0x1d')](_0xcc3b('0xf'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x1e')]);router['delete'](_0xcc3b('0xf'),auth['isAuthenticated'](),controller[_0xcc3b('0x1f')]);router[_0xcc3b('0x20')](_0xcc3b('0x11'),auth[_0xcc3b('0xa')](),controller[_0xcc3b('0x21')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xcc3b('0x22')]);module[_0xcc3b('0x23')]=router;
\ No newline at end of file
index aeb04ca..be063c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2335=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x27c7b2,_0x3c8adc){var _0x33829e=function(_0x1e4b4f){while(--_0x1e4b4f){_0x27c7b2['push'](_0x27c7b2['shift']());}};_0x33829e(++_0x3c8adc);}(_0x2335,0xad));var _0x5233=function(_0x18f567,_0x2d0e1b){_0x18f567=_0x18f567-0x0;var _0x52bb12=_0x2335[_0x18f567];return _0x52bb12;};'use strict';var Sequelize=require(_0x5233('0x0'));module[_0x5233('0x1')]={'name':{'type':Sequelize[_0x5233('0x2')],'get':function(_0x72460b){return this[_0x5233('0x3')](_0x5233('0x4'));}},'field':{'type':Sequelize[_0x5233('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x0a4c=['STRING','sequelize','VIRTUAL','field'];(function(_0x2b5b25,_0x339573){var _0x4e8090=function(_0x559310){while(--_0x559310){_0x2b5b25['push'](_0x2b5b25['shift']());}};_0x4e8090(++_0x339573);}(_0x0a4c,0x1d1));var _0xc0a4=function(_0x241442,_0x4e7eec){_0x241442=_0x241442-0x0;var _0x746cb7=_0x0a4c[_0x241442];return _0x746cb7;};'use strict';var Sequelize=require(_0xc0a4('0x0'));module['exports']={'name':{'type':Sequelize[_0xc0a4('0x1')],'get':function(_0x459ac8){return this['getDataValue'](_0xc0a4('0x2'));}},'field':{'type':Sequelize[_0xc0a4('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xc0a4('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xc0a4('0x3')],'allowNull':![]}};
\ No newline at end of file
index eb35381..f2e0138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x223fa3,_0xd9a57){var _0xc2739e=function(_0x1db9d9){while(--_0x1db9d9){_0x223fa3['push'](_0x223fa3['shift']());}};_0xc2739e(++_0xd9a57);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x58da02,_0x263184){var _0x1f301f=function(_0x4a0fea){while(--_0x4a0fea){_0x58da02['push'](_0x58da02['shift']());}};_0x1f301f(++_0x263184);}(_0x7a54,0x106));var _0x47a5=function(_0xba71db,_0x193905){_0xba71db=_0xba71db-0x0;var _0xdca997=_0x7a54[_0xba71db];return _0xdca997;};'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 5d69115..8fd08f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa70d=['Condition','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes','exports','define'];(function(_0x14bb22,_0x385030){var _0x51f073=function(_0x23433b){while(--_0x23433b){_0x14bb22['push'](_0x14bb22['shift']());}};_0x51f073(++_0x385030);}(_0xa70d,0xe5));var _0xda70=function(_0x142c0e,_0x26c7da){_0x142c0e=_0x142c0e-0x0;var _0x383bb9=_0xa70d[_0x142c0e];return _0x383bb9;};'use strict';var _=require('lodash');var util=require(_0xda70('0x0'));var logger=require(_0xda70('0x1'))(_0xda70('0x2'));var moment=require(_0xda70('0x3'));var BPromise=require(_0xda70('0x4'));var rp=require(_0xda70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda70('0x6'));var config=require(_0xda70('0x7'));var attributes=require(_0xda70('0x8'));module[_0xda70('0x9')]=function(_0x5b34b5,_0x41135c){return _0x5b34b5[_0xda70('0xa')](_0xda70('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbabc=['request-promise','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','api','moment','bluebird'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xbabc,0x19f));var _0xcbab=function(_0x14d98a,_0x3708cc){_0x14d98a=_0x14d98a-0x0;var _0x2c0642=_0xbabc[_0x14d98a];return _0x2c0642;};'use strict';var _=require(_0xcbab('0x0'));var util=require(_0xcbab('0x1'));var logger=require('../../config/logger')(_0xcbab('0x2'));var moment=require(_0xcbab('0x3'));var BPromise=require(_0xcbab('0x4'));var rp=require(_0xcbab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcbab('0x6'));var attributes=require(_0xcbab('0x7'));module[_0xcbab('0x8')]=function(_0x8331f,_0x45b503){return _0x8331f[_0xcbab('0x9')](_0xcbab('0xa'),attributes,{'tableName':_0xcbab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6e38a6a..c41dd0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73c5=['message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c2600,_0x2d0683){var _0x4435bf=function(_0x9fb384){while(--_0x9fb384){_0x2c2600['push'](_0x2c2600['shift']());}};_0x4435bf(++_0x2d0683);}(_0x73c5,0xb7));var _0x573c=function(_0x5ca2c5,_0x3f0b02){_0x5ca2c5=_0x5ca2c5-0x0;var _0x35f741=_0x73c5[_0x5ca2c5];return _0x35f741;};'use strict';var _=require('lodash');var util=require(_0x573c('0x0'));var moment=require(_0x573c('0x1'));var BPromise=require(_0x573c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x573c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x573c('0x4'));var logger=require(_0x573c('0x5'))(_0x573c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x573c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x111a0c,_0x1968f8,_0x3c79ed){return new BPromise(function(_0x4132aa,_0x52920f){return client[_0x573c('0x8')](_0x111a0c,_0x3c79ed)[_0x573c('0x9')](function(_0xf21570){logger['info'](_0x573c('0xa'),_0x1968f8,_0x573c('0xb'));logger['debug'](_0x573c('0xc'),_0x1968f8,'request\x20sent',JSON[_0x573c('0xd')](_0xf21570));if(_0xf21570[_0x573c('0xe')]){if(_0xf21570[_0x573c('0xe')]['code']===0x1f4){logger[_0x573c('0xe')](_0x573c('0xa'),_0x1968f8,_0xf21570[_0x573c('0xe')][_0x573c('0xf')]);return _0x52920f(_0xf21570[_0x573c('0xe')][_0x573c('0xf')]);}logger['error'](_0x573c('0xa'),_0x1968f8,_0xf21570[_0x573c('0xe')][_0x573c('0xf')]);return _0x4132aa(_0xf21570[_0x573c('0xe')][_0x573c('0xf')]);}else{logger['info'](_0x573c('0xa'),_0x1968f8,_0x573c('0xb'));_0x4132aa(_0xf21570[_0x573c('0x10')][_0x573c('0xf')]);}})[_0x573c('0x11')](function(_0x52299f){logger[_0x573c('0xe')](_0x573c('0xa'),_0x1968f8,_0x52299f);_0x52920f(_0x52299f);});});}
\ No newline at end of file
+var _0xd205=['../../config/logger','../../config/environment','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis'];(function(_0x39ddd4,_0x38ce35){var _0x3d642a=function(_0xa05ced){while(--_0xa05ced){_0x39ddd4['push'](_0x39ddd4['shift']());}};_0x3d642a(++_0x38ce35);}(_0xd205,0x152));var _0x5d20=function(_0x3a4eef,_0x356940){_0x3a4eef=_0x3a4eef-0x0;var _0x52de15=_0xd205[_0x3a4eef];return _0x52de15;};'use strict';var _=require(_0x5d20('0x0'));var util=require(_0x5d20('0x1'));var moment=require(_0x5d20('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d20('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d20('0x4'))('rpc');var config=require(_0x5d20('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5d20('0x6')][_0x5d20('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x178e06,_0x176fe9,_0x2997cb){return new BPromise(function(_0x555047,_0x2b2b12){return client['request'](_0x178e06,_0x2997cb)[_0x5d20('0x8')](function(_0x5ebe9e){logger[_0x5d20('0x9')](_0x5d20('0xa'),_0x176fe9,_0x5d20('0xb'));logger[_0x5d20('0xc')](_0x5d20('0xd'),_0x176fe9,_0x5d20('0xb'),JSON['stringify'](_0x5ebe9e));if(_0x5ebe9e[_0x5d20('0xe')]){if(_0x5ebe9e[_0x5d20('0xe')][_0x5d20('0xf')]===0x1f4){logger['error'](_0x5d20('0xa'),_0x176fe9,_0x5ebe9e[_0x5d20('0xe')][_0x5d20('0x10')]);return _0x2b2b12(_0x5ebe9e[_0x5d20('0xe')][_0x5d20('0x10')]);}logger[_0x5d20('0xe')](_0x5d20('0xa'),_0x176fe9,_0x5ebe9e['error'][_0x5d20('0x10')]);return _0x555047(_0x5ebe9e[_0x5d20('0xe')]['message']);}else{logger['info'](_0x5d20('0xa'),_0x176fe9,_0x5d20('0xb'));_0x555047(_0x5ebe9e[_0x5d20('0x11')][_0x5d20('0x10')]);}})[_0x5d20('0x12')](function(_0x1c97b5){logger['error']('Condition,\x20%s,\x20%s',_0x176fe9,_0x1c97b5);_0x2b2b12(_0x1c97b5);});});}
\ No newline at end of file
index f2bd737..3b3371e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9fb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x35b74c,_0x4a1301){var _0x41df7d=function(_0x229be3){while(--_0x229be3){_0x35b74c['push'](_0x35b74c['shift']());}};_0x41df7d(++_0x4a1301);}(_0xe9fb,0xa3));var _0xbe9f=function(_0x16391d,_0x3a3dba){_0x16391d=_0x16391d-0x0;var _0xb8b0db=_0xe9fb[_0x16391d];return _0xb8b0db;};'use strict';var multer=require(_0xbe9f('0x0'));var util=require(_0xbe9f('0x1'));var path=require(_0xbe9f('0x2'));var timeout=require(_0xbe9f('0x3'));var express=require(_0xbe9f('0x4'));var router=express[_0xbe9f('0x5')]();var fs_extra=require(_0xbe9f('0x6'));var auth=require(_0xbe9f('0x7'));var interaction=require(_0xbe9f('0x8'));var config=require(_0xbe9f('0x9'));var controller=require(_0xbe9f('0xa'));router[_0xbe9f('0xb')](_0xbe9f('0xc'),auth[_0xbe9f('0xd')](),controller[_0xbe9f('0xe')]);router[_0xbe9f('0xf')](_0xbe9f('0xc'),auth[_0xbe9f('0xd')](),controller['destroy']);module[_0xbe9f('0x10')]=router;
\ No newline at end of file
+var _0xc9b1=['isAuthenticated','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id'];(function(_0x5ba82a,_0x4377c9){var _0x5e384f=function(_0x193914){while(--_0x193914){_0x5ba82a['push'](_0x5ba82a['shift']());}};_0x5e384f(++_0x4377c9);}(_0xc9b1,0xb8));var _0x1c9b=function(_0x1fe8c3,_0x2cfe40){_0x1fe8c3=_0x1fe8c3-0x0;var _0x2ae2fc=_0xc9b1[_0x1fe8c3];return _0x2ae2fc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1c9b('0x0'));var timeout=require(_0x1c9b('0x1'));var express=require(_0x1c9b('0x2'));var router=express[_0x1c9b('0x3')]();var fs_extra=require(_0x1c9b('0x4'));var auth=require(_0x1c9b('0x5'));var interaction=require(_0x1c9b('0x6'));var config=require(_0x1c9b('0x7'));var controller=require(_0x1c9b('0x8'));router[_0x1c9b('0x9')](_0x1c9b('0xa'),auth[_0x1c9b('0xb')](),controller['update']);router[_0x1c9b('0xc')](_0x1c9b('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index e28335b..ebdef94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['STRING','name'];(function(_0x35f4ae,_0xf6ddab){var _0x4b2233=function(_0x23b1ea){while(--_0x23b1ea){_0x35f4ae['push'](_0x35f4ae['shift']());}};_0x4b2233(++_0xf6ddab);}(_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 _0xbaf0=['name','exports','STRING'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}};
\ No newline at end of file
index b1340b7..3bf2e23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25ca=['localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','index','map','Dashboard','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','updatedAt','createdAt','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','DashboardId','DashboardItem','getItems','findOne','order','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis'];(function(_0x53d4f0,_0x159a7d){var _0x5e50b4=function(_0x3d5a9a){while(--_0x3d5a9a){_0x53d4f0['push'](_0x53d4f0['shift']());}};_0x5e50b4(++_0x159a7d);}(_0x25ca,0x14d));var _0xa25c=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x25ca[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require(_0xa25c('0x0'));var rimraf=require(_0xa25c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa25c('0x2'));var rp=require(_0xa25c('0x3'));var moment=require(_0xa25c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa25c('0x5'));var csv=require(_0xa25c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa25c('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa25c('0x8'));var toCsv=require(_0xa25c('0x6'));var querystring=require(_0xa25c('0x9'));var Papa=require('papaparse');var Redis=require(_0xa25c('0xa'));var authService=require('../../components/auth/service');var qs=require(_0xa25c('0xb'));var as=require(_0xa25c('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa25c('0xd'))(_0xa25c('0xe'));var utils=require(_0xa25c('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xa25c('0x10'));var db=require('../../mysqldb')['db'];config[_0xa25c('0x11')]=_['defaults'](config['redis'],{'host':_0xa25c('0x12'),'port':0x18eb});var socket=require(_0xa25c('0x13'))(new Redis(config[_0xa25c('0x11')]));require(_0xa25c('0x14'))[_0xa25c('0x15')](socket);function respondWithStatusCode(_0x925301,_0x11fabd){_0x11fabd=_0x11fabd||0xcc;return function(_0x3317e0){if(_0x3317e0){return _0x925301['sendStatus'](_0x11fabd);}return _0x925301[_0xa25c('0x16')](_0x11fabd)[_0xa25c('0x17')]();};}function respondWithResult(_0xac9307,_0x245b8e){_0x245b8e=_0x245b8e||0xc8;return function(_0x3521c9){if(_0x3521c9){return _0xac9307[_0xa25c('0x16')](_0x245b8e)[_0xa25c('0x18')](_0x3521c9);}};}function respondWithFilteredResult(_0x24ea81,_0x53aae0){return function(_0x45fa18){if(_0x45fa18){var _0x4f679a=typeof _0x53aae0[_0xa25c('0x19')]==='undefined'&&typeof _0x53aae0['limit']===_0xa25c('0x1a');var _0x1a45b9=_0x45fa18[_0xa25c('0x1b')];var _0x3581eb=_0x4f679a?0x0:_0x53aae0[_0xa25c('0x19')];var _0x2d3c8e=_0x4f679a?_0x45fa18['count']:_0x53aae0[_0xa25c('0x19')]+_0x53aae0[_0xa25c('0x1c')];var _0x237d8b;if(_0x2d3c8e>=_0x1a45b9){_0x2d3c8e=_0x1a45b9;_0x237d8b=0xc8;}else{_0x237d8b=0xce;}_0x24ea81[_0xa25c('0x16')](_0x237d8b);return _0x24ea81[_0xa25c('0x1d')](_0xa25c('0x1e'),_0x3581eb+'-'+_0x2d3c8e+'/'+_0x1a45b9)['json'](_0x45fa18);}return null;};}function patchUpdates(_0x2ec5e7){return function(_0x3cb145){try{jsonpatch[_0xa25c('0x1f')](_0x3cb145,_0x2ec5e7,!![]);}catch(_0x41e786){return BPromise[_0xa25c('0x20')](_0x41e786);}return _0x3cb145['save']();};}function saveUpdates(_0x30b1d4,_0x44f95c){return function(_0x385ce0){if(_0x385ce0){return _0x385ce0[_0xa25c('0x21')](_0x30b1d4)['then'](function(_0x5e1e82){return _0x5e1e82;});}return null;};}function removeEntity(_0x423263,_0xb7d5bb){return function(_0x1bb30e){if(_0x1bb30e){return _0x1bb30e[_0xa25c('0x22')]()[_0xa25c('0x23')](function(){var _0x5aaf1d=_0x1bb30e['get']({'plain':!![]});var _0x5990d5=_0xa25c('0x24');return db[_0xa25c('0x25')][_0xa25c('0x22')]({'where':{'type':_0x5990d5,'resourceId':_0x5aaf1d['id']}})['then'](function(){return _0x1bb30e;});})['then'](function(){_0x423263[_0xa25c('0x16')](0xcc)[_0xa25c('0x17')]();});}};}function handleEntityNotFound(_0x1fec7e,_0xac3e3){return function(_0x31de56){if(!_0x31de56){_0x1fec7e[_0xa25c('0x26')](0x194);}return _0x31de56;};}function handleError(_0x256300,_0x107b3f){_0x107b3f=_0x107b3f||0x1f4;return function(_0x99c5fc){logger[_0xa25c('0x27')](_0x99c5fc[_0xa25c('0x28')]);if(_0x99c5fc['name']){delete _0x99c5fc[_0xa25c('0x29')];}_0x256300[_0xa25c('0x16')](_0x107b3f)['send'](_0x99c5fc);};}exports[_0xa25c('0x2a')]=function(_0x4bb306,_0x3530ec){var _0x37102b={},_0x358dd2={},_0x2727a7={'count':0x0,'rows':[]};var _0x1a2649=_[_0xa25c('0x2b')](db[_0xa25c('0x2c')]['rawAttributes'],function(_0x41525f){return{'name':_0x41525f[_0xa25c('0x2d')],'type':_0x41525f[_0xa25c('0x2e')][_0xa25c('0x2f')]};});_0x358dd2['model']=_[_0xa25c('0x2b')](_0x1a2649,_0xa25c('0x29'));_0x358dd2[_0xa25c('0x30')]=_[_0xa25c('0x31')](_0x4bb306[_0xa25c('0x30')]);_0x358dd2[_0xa25c('0x32')]=_[_0xa25c('0x33')](_0x358dd2[_0xa25c('0x34')],_0x358dd2[_0xa25c('0x30')]);_0x37102b[_0xa25c('0x35')]=_[_0xa25c('0x33')](_0x358dd2[_0xa25c('0x34')],qs[_0xa25c('0x36')](_0x4bb306['query'][_0xa25c('0x36')]));_0x37102b['attributes']=_0x37102b['attributes'][_0xa25c('0x37')]?_0x37102b[_0xa25c('0x35')]:_0x358dd2[_0xa25c('0x34')];if(!_0x4bb306['query'][_0xa25c('0x38')](_0xa25c('0x39'))){_0x37102b[_0xa25c('0x1c')]=qs[_0xa25c('0x1c')](_0x4bb306['query'][_0xa25c('0x1c')]);_0x37102b['offset']=qs[_0xa25c('0x19')](_0x4bb306[_0xa25c('0x30')]['offset']);}_0x37102b['order']=qs[_0xa25c('0x3a')](_0x4bb306['query'][_0xa25c('0x3a')]);_0x37102b['where']=qs[_0xa25c('0x32')](_[_0xa25c('0x3b')](_0x4bb306[_0xa25c('0x30')],_0x358dd2[_0xa25c('0x32')]),_0x1a2649);if(_0x4bb306['query'][_0xa25c('0x3c')]){_0x37102b[_0xa25c('0x3d')]=_[_0xa25c('0x3e')](_0x37102b[_0xa25c('0x3d')],{'$or':_[_0xa25c('0x2b')](_0x1a2649,function(_0x1cd2b0){if(_0x1cd2b0['type']!==_0xa25c('0x3f')){var _0x3e8139={};_0x3e8139[_0x1cd2b0[_0xa25c('0x29')]]={'$like':'%'+_0x4bb306[_0xa25c('0x30')]['filter']+'%'};return _0x3e8139;}})});}_0x37102b=_['merge']({},_0x37102b,_0x4bb306['options']);var _0x3f010b={'where':_0x37102b['where']};return db[_0xa25c('0x2c')][_0xa25c('0x1b')](_0x3f010b)[_0xa25c('0x23')](function(_0x131384){_0x2727a7[_0xa25c('0x1b')]=_0x131384;if(_0x4bb306[_0xa25c('0x30')][_0xa25c('0x40')]){_0x37102b[_0xa25c('0x41')]=[{'all':!![]}];}return db['Dashboard'][_0xa25c('0x42')](_0x37102b);})[_0xa25c('0x23')](function(_0x230427){_0x2727a7[_0xa25c('0x43')]=_0x230427;return _0x2727a7;})[_0xa25c('0x23')](respondWithFilteredResult(_0x3530ec,_0x37102b))[_0xa25c('0x44')](handleError(_0x3530ec,null));};exports[_0xa25c('0x45')]=function(_0x3b5393,_0x1cb96d){var _0x34f694={'raw':![],'where':{'id':_0x3b5393[_0xa25c('0x46')]['id']}},_0x36fd3d={};_0x36fd3d[_0xa25c('0x34')]=_['keys'](db[_0xa25c('0x2c')]['rawAttributes']);_0x36fd3d[_0xa25c('0x30')]=_[_0xa25c('0x31')](_0x3b5393['query']);_0x36fd3d[_0xa25c('0x32')]=_['intersection'](_0x36fd3d['model'],_0x36fd3d[_0xa25c('0x30')]);_0x34f694['attributes']=_['intersection'](_0x36fd3d['model'],qs['fields'](_0x3b5393[_0xa25c('0x30')][_0xa25c('0x36')]));_0x34f694[_0xa25c('0x35')]=_0x34f694[_0xa25c('0x35')][_0xa25c('0x37')]?_0x34f694[_0xa25c('0x35')]:_0x36fd3d['model'];if(_0x3b5393[_0xa25c('0x30')][_0xa25c('0x40')]){_0x34f694[_0xa25c('0x41')]=[{'all':!![]}];}_0x34f694=_[_0xa25c('0x3e')]({},_0x34f694,_0x3b5393[_0xa25c('0x47')]);return db[_0xa25c('0x2c')][_0xa25c('0x48')](_0x34f694)[_0xa25c('0x23')](handleEntityNotFound(_0x1cb96d,null))[_0xa25c('0x23')](respondWithResult(_0x1cb96d,null))[_0xa25c('0x44')](handleError(_0x1cb96d,null));};exports[_0xa25c('0x49')]=function(_0x122fbf,_0x5458ee){return db[_0xa25c('0x2c')][_0xa25c('0x49')](_0x122fbf[_0xa25c('0x4a')],{})[_0xa25c('0x23')](function(_0x43f865){var _0x418007=_0x122fbf[_0xa25c('0x4b')]['get']({'plain':!![]});if(!_0x418007)throw new Error(_0xa25c('0x4c'));if(_0x418007[_0xa25c('0x4d')]===_0xa25c('0x4b')){var _0x5ea3a4=_0x43f865[_0xa25c('0x4e')]({'plain':!![]});var _0x567260=_0xa25c('0x24');return db[_0xa25c('0x4f')][_0xa25c('0x48')]({'where':{'name':_0x567260,'userProfileId':_0x418007[_0xa25c('0x50')]},'raw':!![]})[_0xa25c('0x23')](function(_0x2505e7){if(_0x2505e7&&_0x2505e7[_0xa25c('0x51')]===0x0){return db['UserProfileResource'][_0xa25c('0x49')]({'name':_0x5ea3a4[_0xa25c('0x29')],'resourceId':_0x5ea3a4['id'],'type':_0x2505e7[_0xa25c('0x29')],'sectionId':_0x2505e7['id']},{})[_0xa25c('0x23')](function(){return _0x43f865;});}else{return _0x43f865;}})[_0xa25c('0x44')](function(_0x4ba7f5){logger['error'](_0xa25c('0x52'),_0x4ba7f5);throw _0x4ba7f5;});}return _0x43f865;})['then'](respondWithResult(_0x5458ee,0xc9))[_0xa25c('0x44')](handleError(_0x5458ee,null));};exports[_0xa25c('0x53')]=function(_0x38d317,_0x5b23b7){var _0x27a3ae={'where':{'id':_0x38d317[_0xa25c('0x46')]['id']}},_0x2a7b7a={};_0x2a7b7a['model']=_[_0xa25c('0x31')](db[_0xa25c('0x2c')][_0xa25c('0x54')]);_0x27a3ae[_0xa25c('0x35')]=_[_0xa25c('0x33')](_0x2a7b7a[_0xa25c('0x34')],qs[_0xa25c('0x36')](_0x38d317['query']['fields']));_0x27a3ae['attributes']=_0x27a3ae['attributes'][_0xa25c('0x37')]?_0x27a3ae[_0xa25c('0x35')]:_0x2a7b7a['model'];if(_0x38d317[_0xa25c('0x30')][_0xa25c('0x40')]){_0x27a3ae[_0xa25c('0x41')]=[{'all':!![]}];}_0x27a3ae=_[_0xa25c('0x3e')]({},_0x27a3ae,_0x38d317[_0xa25c('0x47')]);return db[_0xa25c('0x2c')]['find'](_0x27a3ae)['then'](handleEntityNotFound(_0x5b23b7,null))[_0xa25c('0x23')](function(_0x4d63ee){if(_0x4d63ee){var _0x31b337=_0x4d63ee[_0xa25c('0x4e')]({'plain':!![]});_0x31b337=qs[_0xa25c('0x55')](_0x31b337,['id','createdAt',_0xa25c('0x56')]);_0x38d317[_0xa25c('0x4a')]=_[_0xa25c('0x55')](_0x38d317[_0xa25c('0x4a')],['id',_0xa25c('0x57'),_0xa25c('0x56')]);return db[_0xa25c('0x2c')]['create'](_[_0xa25c('0x3e')](_0x31b337,_0x38d317[_0xa25c('0x4a')]),{'include':_0x38d317[_0xa25c('0x30')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x50d3d6){var _0x52d3fe=_0x38d317[_0xa25c('0x4b')][_0xa25c('0x4e')]({'plain':!![]});if(!_0x52d3fe)throw new Error(_0xa25c('0x4c'));if(_0x52d3fe[_0xa25c('0x4d')]===_0xa25c('0x4b')){var _0x170fec=_0x50d3d6[_0xa25c('0x4e')]({'plain':!![]});var _0xff5c5a=_0xa25c('0x24');return db[_0xa25c('0x4f')][_0xa25c('0x48')]({'where':{'name':_0xff5c5a,'userProfileId':_0x52d3fe[_0xa25c('0x50')]},'raw':!![]})[_0xa25c('0x23')](function(_0x59f6bf){if(_0x59f6bf&&_0x59f6bf[_0xa25c('0x51')]===0x0){return db[_0xa25c('0x25')][_0xa25c('0x49')]({'name':_0x170fec[_0xa25c('0x29')],'resourceId':_0x170fec['id'],'type':_0x59f6bf['name'],'sectionId':_0x59f6bf['id']},{})['then'](function(){return _0x50d3d6;});}else{return _0x50d3d6;}})[_0xa25c('0x44')](function(_0x4d5a11){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d5a11);throw _0x4d5a11;});}return _0x50d3d6;});}})[_0xa25c('0x23')](respondWithResult(_0x5b23b7,0xc9))['catch'](handleError(_0x5b23b7,null));};exports[_0xa25c('0x21')]=function(_0x1f18f2,_0x250520){if(_0x1f18f2['body']['id']){delete _0x1f18f2[_0xa25c('0x4a')]['id'];}return db[_0xa25c('0x2c')][_0xa25c('0x48')]({'where':{'id':_0x1f18f2[_0xa25c('0x46')]['id']}})[_0xa25c('0x23')](handleEntityNotFound(_0x250520,null))['then'](saveUpdates(_0x1f18f2[_0xa25c('0x4a')],null))['then'](respondWithResult(_0x250520,null))[_0xa25c('0x44')](handleError(_0x250520,null));};exports[_0xa25c('0x22')]=function(_0xc237e4,_0x16d304){return db[_0xa25c('0x2c')][_0xa25c('0x48')]({'where':{'id':_0xc237e4['params']['id']}})[_0xa25c('0x23')](handleEntityNotFound(_0x16d304,null))[_0xa25c('0x23')](removeEntity(_0x16d304,null))[_0xa25c('0x44')](handleError(_0x16d304,null));};function widgetAttributes(_0x3a1ee5){try{switch(_0x3a1ee5[_0xa25c('0x2e')]){case _0xa25c('0x58'):return[{'name':_0xa25c('0x59'),'value':_0x3a1ee5[_0xa25c('0x59')]||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5[_0xa25c('0x5a')][0x0]?_0x3a1ee5[_0xa25c('0x5a')][0x0][_0xa25c('0x5b')]:undefined)||_0xa25c('0x5c')}];case _0xa25c('0x5d'):return[{'name':_0xa25c('0x5e'),'value':_0x3a1ee5[_0xa25c('0x5e')]||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5[_0xa25c('0x5a')][0x0]?_0x3a1ee5[_0xa25c('0x5a')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0xa25c('0x5f'),'value':_0x3a1ee5['attrHourFormat']||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5[_0xa25c('0x5a')][0x0]?_0x3a1ee5[_0xa25c('0x5a')][0x0][_0xa25c('0x5b')]:undefined)||_0xa25c('0x60')},{'name':_0xa25c('0x61'),'value':_0x3a1ee5['attrTimezone']||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5[_0xa25c('0x5a')][0x1]?_0x3a1ee5['attrs'][0x1][_0xa25c('0x5b')]:undefined)||_0xa25c('0x62')},{'name':_0xa25c('0x63'),'value':_0x3a1ee5[_0xa25c('0x63')]||(_0x3a1ee5['attrs']&&_0x3a1ee5[_0xa25c('0x5a')][0x2]?_0x3a1ee5[_0xa25c('0x5a')][0x2][_0xa25c('0x5b')]:undefined)||0xc}];case'counter':return[{'name':_0xa25c('0x64'),'value':_0x3a1ee5[_0xa25c('0x64')]||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5['attrs'][0x0]?_0x3a1ee5[_0xa25c('0x5a')][0x0][_0xa25c('0x5b')]:undefined)||_0xa25c('0x65')},{'name':_0xa25c('0x66'),'value':_0x3a1ee5['attrVoiceQueues']||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5['attrs'][0x1]?_0x3a1ee5[_0xa25c('0x5a')][0x1][_0xa25c('0x5b')]:undefined)||[]},{'name':'attrFontSize','value':_0x3a1ee5[_0xa25c('0x63')]||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5[_0xa25c('0x5a')][0x2]?_0x3a1ee5['attrs'][0x2][_0xa25c('0x5b')]:undefined)||0x14}];case _0xa25c('0x67'):case _0xa25c('0x68'):return[{'name':_0xa25c('0x69'),'value':_0x3a1ee5[_0xa25c('0x69')]||(_0x3a1ee5['attrs']&&_0x3a1ee5['attrs'][0x0]?_0x3a1ee5[_0xa25c('0x5a')][0x0][_0xa25c('0x5b')]:undefined)||'total'},{'name':_0xa25c('0x6a'),'value':_0x3a1ee5[_0xa25c('0x6a')]||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5[_0xa25c('0x5a')][0x1]?_0x3a1ee5['attrs'][0x1][_0xa25c('0x5b')]:undefined)||null},{'name':'attrSerie3','value':_0x3a1ee5[_0xa25c('0x6b')]||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5[_0xa25c('0x5a')][0x2]?_0x3a1ee5[_0xa25c('0x5a')][0x2]['value']:undefined)||null},{'name':_0xa25c('0x66'),'value':_0x3a1ee5['attrVoiceQueues']||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5[_0xa25c('0x5a')][0x3]?_0x3a1ee5[_0xa25c('0x5a')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x3a1ee5[_0xa25c('0x6c')]||(_0x3a1ee5['attrs']&&_0x3a1ee5[_0xa25c('0x5a')][0x0]?_0x3a1ee5[_0xa25c('0x5a')][0x0][_0xa25c('0x2e')]:undefined)||null,'value':_0x3a1ee5[_0xa25c('0x6d')]||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5[_0xa25c('0x5a')][0x0]?_0x3a1ee5['attrs'][0x0]['value']:undefined)||null},{'name':_0xa25c('0x6e'),'value':_0x3a1ee5[_0xa25c('0x6e')]||(_0x3a1ee5[_0xa25c('0x5a')]&&_0x3a1ee5['attrs'][0x1]?_0x3a1ee5['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x2f4d32){logger[_0xa25c('0x27')](_0xa25c('0x6f'),JSON['stringify'](_0x2f4d32));return[];}}exports['addItem']=function(_0x9a71ec,_0x1f0863,_0x558983){if(_0x9a71ec[_0xa25c('0x4a')]['id']){delete _0x9a71ec['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x9a71ec[_0xa25c('0x46')]['id']}})[_0xa25c('0x23')](handleEntityNotFound(_0x1f0863,null))[_0xa25c('0x23')](function(_0x43000f){if(_0x43000f){_0x9a71ec[_0xa25c('0x4a')][_0xa25c('0x70')]=_0x43000f['id'];_0x9a71ec[_0xa25c('0x4a')][_0xa25c('0x5a')]=widgetAttributes(_0x9a71ec[_0xa25c('0x4a')]);return db[_0xa25c('0x71')][_0xa25c('0x49')](_0x9a71ec['body']);}})[_0xa25c('0x23')](respondWithResult(_0x1f0863,null))[_0xa25c('0x44')](handleError(_0x1f0863,null));};exports[_0xa25c('0x72')]=function(_0x2dbce9,_0x4f6018,_0x367c67){var _0x28347e={};var _0x4301af={};var _0x20f444;var _0x2b2267;return db[_0xa25c('0x2c')][_0xa25c('0x73')]({'where':{'id':_0x2dbce9[_0xa25c('0x46')]['id']}})[_0xa25c('0x23')](handleEntityNotFound(_0x4f6018,null))[_0xa25c('0x23')](function(_0x2a0df7){if(_0x2a0df7){_0x20f444=_0x2a0df7;_0x4301af['model']=_['keys'](db['DashboardItem']['rawAttributes']);_0x4301af[_0xa25c('0x30')]=_[_0xa25c('0x31')](_0x2dbce9[_0xa25c('0x30')]);_0x4301af[_0xa25c('0x32')]=_[_0xa25c('0x33')](_0x4301af['model'],_0x4301af[_0xa25c('0x30')]);_0x28347e['attributes']=_['intersection'](_0x4301af[_0xa25c('0x34')],qs[_0xa25c('0x36')](_0x2dbce9['query'][_0xa25c('0x36')]));_0x28347e['attributes']=_0x28347e[_0xa25c('0x35')]['length']?_0x28347e[_0xa25c('0x35')]:_0x4301af[_0xa25c('0x34')];_0x28347e[_0xa25c('0x74')]=qs[_0xa25c('0x3a')](_0x2dbce9['query'][_0xa25c('0x3a')]);_0x28347e['where']=qs[_0xa25c('0x32')](_[_0xa25c('0x3b')](_0x2dbce9[_0xa25c('0x30')],_0x4301af[_0xa25c('0x32')]));if(_0x2dbce9['query']['filter']){_0x28347e[_0xa25c('0x3d')]=_[_0xa25c('0x3e')](_0x28347e[_0xa25c('0x3d')],{'$or':_[_0xa25c('0x2b')](_0x28347e['attributes'],function(_0x2b4324){var _0x8119a6={};_0x8119a6[_0x2b4324]={'$like':'%'+_0x2dbce9[_0xa25c('0x30')][_0xa25c('0x3c')]+'%'};return _0x8119a6;})});}_0x28347e=_[_0xa25c('0x3e')]({},_0x28347e,_0x2dbce9[_0xa25c('0x47')]);return _0x20f444[_0xa25c('0x72')](_0x28347e);}})[_0xa25c('0x23')](function(_0x4815fe){if(_0x4815fe){_0x2b2267=_0x4815fe[_0xa25c('0x37')];if(!_0x2dbce9['query']['hasOwnProperty'](_0xa25c('0x39'))){_0x28347e['limit']=qs[_0xa25c('0x1c')](_0x2dbce9[_0xa25c('0x30')][_0xa25c('0x1c')]);_0x28347e['offset']=qs[_0xa25c('0x19')](_0x2dbce9[_0xa25c('0x30')][_0xa25c('0x19')]);}return _0x20f444[_0xa25c('0x72')](_0x28347e);}})['then'](function(_0x300f1f){if(_0x300f1f){return _0x300f1f?{'count':_0x2b2267,'rows':_0x300f1f}:null;}})[_0xa25c('0x23')](respondWithResult(_0x4f6018,null))[_0xa25c('0x44')](handleError(_0x4f6018,null));};
\ No newline at end of file
+var _0x9c91=['merge','options','Dashboard','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','model','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','updatedAt','omit','role','UserProfileSection','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','widgetAttributes:\x20%s','addItem','DashboardId','getItems','sort','nolimit','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','filter','VIRTUAL'];(function(_0x349ecc,_0x235327){var _0x2c4f15=function(_0x454525){while(--_0x454525){_0x349ecc['push'](_0x349ecc['shift']());}};_0x2c4f15(++_0x235327);}(_0x9c91,0x1a7));var _0x19c9=function(_0x46d928,_0x5bef6d){_0x46d928=_0x46d928-0x0;var _0x2f6d1f=_0x9c91[_0x46d928];return _0x2f6d1f;};'use strict';var emlformat=require(_0x19c9('0x0'));var rimraf=require(_0x19c9('0x1'));var zipdir=require(_0x19c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19c9('0x3'));var moment=require('moment');var BPromise=require(_0x19c9('0x4'));var Mustache=require(_0x19c9('0x5'));var util=require('util');var path=require(_0x19c9('0x6'));var sox=require(_0x19c9('0x7'));var csv=require(_0x19c9('0x8'));var ejs=require(_0x19c9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x19c9('0xa'));var squel=require(_0x19c9('0xb'));var crypto=require(_0x19c9('0xc'));var jsforce=require(_0x19c9('0xd'));var deskjs=require(_0x19c9('0xe'));var toCsv=require(_0x19c9('0x8'));var querystring=require(_0x19c9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x19c9('0x10'));var qs=require(_0x19c9('0x11'));var as=require(_0x19c9('0x12'));var hardwareService=require(_0x19c9('0x13'));var logger=require(_0x19c9('0x14'))(_0x19c9('0x15'));var utils=require('../../config/utils');var config=require(_0x19c9('0x16'));var licenseUtil=require(_0x19c9('0x17'));var db=require(_0x19c9('0x18'))['db'];config[_0x19c9('0x19')]=_[_0x19c9('0x1a')](config[_0x19c9('0x19')],{'host':_0x19c9('0x1b'),'port':0x18eb});var socket=require(_0x19c9('0x1c'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x1bb37e,_0x39f56d){_0x39f56d=_0x39f56d||0xcc;return function(_0x24fec1){if(_0x24fec1){return _0x1bb37e['sendStatus'](_0x39f56d);}return _0x1bb37e['status'](_0x39f56d)[_0x19c9('0x1d')]();};}function respondWithResult(_0x2f1650,_0x1c46b0){_0x1c46b0=_0x1c46b0||0xc8;return function(_0x26f398){if(_0x26f398){return _0x2f1650[_0x19c9('0x1e')](_0x1c46b0)[_0x19c9('0x1f')](_0x26f398);}};}function respondWithFilteredResult(_0x3ec083,_0x53660c){return function(_0x269ce9){if(_0x269ce9){var _0x1481d9=typeof _0x53660c[_0x19c9('0x20')]===_0x19c9('0x21')&&typeof _0x53660c['limit']===_0x19c9('0x21');var _0x49954f=_0x269ce9[_0x19c9('0x22')];var _0x35f6d8=_0x1481d9?0x0:_0x53660c[_0x19c9('0x20')];var _0x376b12=_0x1481d9?_0x269ce9[_0x19c9('0x22')]:_0x53660c[_0x19c9('0x20')]+_0x53660c[_0x19c9('0x23')];var _0x10ff8c;if(_0x376b12>=_0x49954f){_0x376b12=_0x49954f;_0x10ff8c=0xc8;}else{_0x10ff8c=0xce;}_0x3ec083[_0x19c9('0x1e')](_0x10ff8c);return _0x3ec083[_0x19c9('0x24')](_0x19c9('0x25'),_0x35f6d8+'-'+_0x376b12+'/'+_0x49954f)[_0x19c9('0x1f')](_0x269ce9);}return null;};}function patchUpdates(_0x50b62d){return function(_0x1ffb2e){try{jsonpatch['apply'](_0x1ffb2e,_0x50b62d,!![]);}catch(_0x286fc6){return BPromise[_0x19c9('0x26')](_0x286fc6);}return _0x1ffb2e[_0x19c9('0x27')]();};}function saveUpdates(_0x38b07c,_0x2b9913){return function(_0x13b2b9){if(_0x13b2b9){return _0x13b2b9[_0x19c9('0x28')](_0x38b07c)[_0x19c9('0x29')](function(_0x164bd7){return _0x164bd7;});}return null;};}function removeEntity(_0x7af83b,_0x40aa28){return function(_0x4b5a09){if(_0x4b5a09){return _0x4b5a09[_0x19c9('0x2a')]()[_0x19c9('0x29')](function(){var _0x3e03fa=_0x4b5a09[_0x19c9('0x2b')]({'plain':!![]});var _0x5ea184='CustomDashboards';return db[_0x19c9('0x2c')][_0x19c9('0x2a')]({'where':{'type':_0x5ea184,'resourceId':_0x3e03fa['id']}})[_0x19c9('0x29')](function(){return _0x4b5a09;});})[_0x19c9('0x29')](function(){_0x7af83b[_0x19c9('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c2b94,_0x387518){return function(_0x5e9b76){if(!_0x5e9b76){_0x1c2b94[_0x19c9('0x2d')](0x194);}return _0x5e9b76;};}function handleError(_0xf816f,_0x267fb7){_0x267fb7=_0x267fb7||0x1f4;return function(_0x410b29){logger[_0x19c9('0x2e')](_0x410b29[_0x19c9('0x2f')]);if(_0x410b29[_0x19c9('0x30')]){delete _0x410b29[_0x19c9('0x30')];}_0xf816f[_0x19c9('0x1e')](_0x267fb7)[_0x19c9('0x31')](_0x410b29);};}exports[_0x19c9('0x32')]=function(_0xf24466,_0x11dce0){var _0x33da7d={},_0x4e1836={},_0x2f0dcf={'count':0x0,'rows':[]};var _0x4142c4=_[_0x19c9('0x33')](db['Dashboard']['rawAttributes'],function(_0x26d072){return{'name':_0x26d072[_0x19c9('0x34')],'type':_0x26d072[_0x19c9('0x35')][_0x19c9('0x36')]};});_0x4e1836['model']=_[_0x19c9('0x33')](_0x4142c4,_0x19c9('0x30'));_0x4e1836[_0x19c9('0x37')]=_['keys'](_0xf24466[_0x19c9('0x37')]);_0x4e1836[_0x19c9('0x38')]=_[_0x19c9('0x39')](_0x4e1836['model'],_0x4e1836['query']);_0x33da7d[_0x19c9('0x3a')]=_[_0x19c9('0x39')](_0x4e1836['model'],qs[_0x19c9('0x3b')](_0xf24466[_0x19c9('0x37')][_0x19c9('0x3b')]));_0x33da7d[_0x19c9('0x3a')]=_0x33da7d['attributes'][_0x19c9('0x3c')]?_0x33da7d['attributes']:_0x4e1836['model'];if(!_0xf24466[_0x19c9('0x37')][_0x19c9('0x3d')]('nolimit')){_0x33da7d[_0x19c9('0x23')]=qs[_0x19c9('0x23')](_0xf24466[_0x19c9('0x37')][_0x19c9('0x23')]);_0x33da7d[_0x19c9('0x20')]=qs[_0x19c9('0x20')](_0xf24466[_0x19c9('0x37')]['offset']);}_0x33da7d['order']=qs['sort'](_0xf24466[_0x19c9('0x37')]['sort']);_0x33da7d[_0x19c9('0x3e')]=qs[_0x19c9('0x38')](_['pick'](_0xf24466['query'],_0x4e1836[_0x19c9('0x38')]),_0x4142c4);if(_0xf24466['query'][_0x19c9('0x3f')]){_0x33da7d[_0x19c9('0x3e')]=_['merge'](_0x33da7d['where'],{'$or':_[_0x19c9('0x33')](_0x4142c4,function(_0xfd394){if(_0xfd394[_0x19c9('0x35')]!==_0x19c9('0x40')){var _0x560744={};_0x560744[_0xfd394[_0x19c9('0x30')]]={'$like':'%'+_0xf24466[_0x19c9('0x37')][_0x19c9('0x3f')]+'%'};return _0x560744;}})});}_0x33da7d=_[_0x19c9('0x41')]({},_0x33da7d,_0xf24466[_0x19c9('0x42')]);var _0x2cb303={'where':_0x33da7d[_0x19c9('0x3e')]};return db[_0x19c9('0x43')][_0x19c9('0x22')](_0x2cb303)['then'](function(_0x46d7f9){_0x2f0dcf[_0x19c9('0x22')]=_0x46d7f9;if(_0xf24466['query'][_0x19c9('0x44')]){_0x33da7d[_0x19c9('0x45')]=[{'all':!![]}];}return db[_0x19c9('0x43')][_0x19c9('0x46')](_0x33da7d);})[_0x19c9('0x29')](function(_0x2a2f34){_0x2f0dcf[_0x19c9('0x47')]=_0x2a2f34;return _0x2f0dcf;})['then'](respondWithFilteredResult(_0x11dce0,_0x33da7d))[_0x19c9('0x48')](handleError(_0x11dce0,null));};exports[_0x19c9('0x49')]=function(_0x3cfcf0,_0x47370f){var _0x150a15={'raw':![],'where':{'id':_0x3cfcf0['params']['id']}},_0x469272={};_0x469272['model']=_['keys'](db[_0x19c9('0x43')][_0x19c9('0x4a')]);_0x469272['query']=_[_0x19c9('0x4b')](_0x3cfcf0['query']);_0x469272[_0x19c9('0x38')]=_[_0x19c9('0x39')](_0x469272['model'],_0x469272['query']);_0x150a15['attributes']=_[_0x19c9('0x39')](_0x469272[_0x19c9('0x4c')],qs[_0x19c9('0x3b')](_0x3cfcf0[_0x19c9('0x37')]['fields']));_0x150a15[_0x19c9('0x3a')]=_0x150a15[_0x19c9('0x3a')][_0x19c9('0x3c')]?_0x150a15[_0x19c9('0x3a')]:_0x469272[_0x19c9('0x4c')];if(_0x3cfcf0['query'][_0x19c9('0x44')]){_0x150a15[_0x19c9('0x45')]=[{'all':!![]}];}_0x150a15=_[_0x19c9('0x41')]({},_0x150a15,_0x3cfcf0['options']);return db[_0x19c9('0x43')]['find'](_0x150a15)['then'](handleEntityNotFound(_0x47370f,null))[_0x19c9('0x29')](respondWithResult(_0x47370f,null))['catch'](handleError(_0x47370f,null));};exports[_0x19c9('0x4d')]=function(_0x5aa1b8,_0x460d52){return db[_0x19c9('0x43')]['create'](_0x5aa1b8[_0x19c9('0x4e')],{})[_0x19c9('0x29')](function(_0x8b2c9c){var _0x5d29c6=_0x5aa1b8[_0x19c9('0x4f')][_0x19c9('0x2b')]({'plain':!![]});if(!_0x5d29c6)throw new Error(_0x19c9('0x50'));if(_0x5d29c6['role']==='user'){var _0x325ee0=_0x8b2c9c[_0x19c9('0x2b')]({'plain':!![]});var _0x48bd03=_0x19c9('0x51');return db['UserProfileSection'][_0x19c9('0x52')]({'where':{'name':_0x48bd03,'userProfileId':_0x5d29c6[_0x19c9('0x53')]},'raw':!![]})[_0x19c9('0x29')](function(_0x12cc98){if(_0x12cc98&&_0x12cc98[_0x19c9('0x54')]===0x0){return db[_0x19c9('0x2c')][_0x19c9('0x4d')]({'name':_0x325ee0[_0x19c9('0x30')],'resourceId':_0x325ee0['id'],'type':_0x12cc98['name'],'sectionId':_0x12cc98['id']},{})[_0x19c9('0x29')](function(){return _0x8b2c9c;});}else{return _0x8b2c9c;}})[_0x19c9('0x48')](function(_0x4e2740){logger[_0x19c9('0x2e')](_0x19c9('0x55'),_0x4e2740);throw _0x4e2740;});}return _0x8b2c9c;})['then'](respondWithResult(_0x460d52,0xc9))['catch'](handleError(_0x460d52,null));};exports[_0x19c9('0x56')]=function(_0xb80ceb,_0x152c51){var _0x4b4c1a={'where':{'id':_0xb80ceb[_0x19c9('0x57')]['id']}},_0x8de59b={};_0x8de59b[_0x19c9('0x4c')]=_[_0x19c9('0x4b')](db[_0x19c9('0x43')][_0x19c9('0x4a')]);_0x4b4c1a['attributes']=_[_0x19c9('0x39')](_0x8de59b[_0x19c9('0x4c')],qs['fields'](_0xb80ceb[_0x19c9('0x37')][_0x19c9('0x3b')]));_0x4b4c1a[_0x19c9('0x3a')]=_0x4b4c1a['attributes'][_0x19c9('0x3c')]?_0x4b4c1a[_0x19c9('0x3a')]:_0x8de59b[_0x19c9('0x4c')];if(_0xb80ceb[_0x19c9('0x37')]['includeAll']){_0x4b4c1a[_0x19c9('0x45')]=[{'all':!![]}];}_0x4b4c1a=_[_0x19c9('0x41')]({},_0x4b4c1a,_0xb80ceb[_0x19c9('0x42')]);return db[_0x19c9('0x43')][_0x19c9('0x52')](_0x4b4c1a)['then'](handleEntityNotFound(_0x152c51,null))[_0x19c9('0x29')](function(_0x294cea){if(_0x294cea){var _0xf5bc50=_0x294cea['get']({'plain':!![]});_0xf5bc50=qs['omit'](_0xf5bc50,['id','createdAt',_0x19c9('0x58')]);_0xb80ceb[_0x19c9('0x4e')]=_[_0x19c9('0x59')](_0xb80ceb[_0x19c9('0x4e')],['id','createdAt',_0x19c9('0x58')]);return db[_0x19c9('0x43')]['create'](_[_0x19c9('0x41')](_0xf5bc50,_0xb80ceb['body']),{'include':_0xb80ceb['query'][_0x19c9('0x44')]?[{'all':!![]}]:undefined})[_0x19c9('0x29')](function(_0x300de1){var _0xa81e78=_0xb80ceb['user']['get']({'plain':!![]});if(!_0xa81e78)throw new Error(_0x19c9('0x50'));if(_0xa81e78[_0x19c9('0x5a')]===_0x19c9('0x4f')){var _0x2c257f=_0x300de1['get']({'plain':!![]});var _0x59d094=_0x19c9('0x51');return db[_0x19c9('0x5b')][_0x19c9('0x52')]({'where':{'name':_0x59d094,'userProfileId':_0xa81e78[_0x19c9('0x53')]},'raw':!![]})[_0x19c9('0x29')](function(_0x3624d0){if(_0x3624d0&&_0x3624d0['autoAssociation']===0x0){return db[_0x19c9('0x2c')]['create']({'name':_0x2c257f[_0x19c9('0x30')],'resourceId':_0x2c257f['id'],'type':_0x3624d0[_0x19c9('0x30')],'sectionId':_0x3624d0['id']},{})[_0x19c9('0x29')](function(){return _0x300de1;});}else{return _0x300de1;}})['catch'](function(_0x57d3a2){logger['error'](_0x19c9('0x55'),_0x57d3a2);throw _0x57d3a2;});}return _0x300de1;});}})['then'](respondWithResult(_0x152c51,0xc9))[_0x19c9('0x48')](handleError(_0x152c51,null));};exports[_0x19c9('0x28')]=function(_0x1af743,_0x3f0e56){if(_0x1af743[_0x19c9('0x4e')]['id']){delete _0x1af743[_0x19c9('0x4e')]['id'];}return db[_0x19c9('0x43')][_0x19c9('0x52')]({'where':{'id':_0x1af743[_0x19c9('0x57')]['id']}})[_0x19c9('0x29')](handleEntityNotFound(_0x3f0e56,null))[_0x19c9('0x29')](saveUpdates(_0x1af743['body'],null))[_0x19c9('0x29')](respondWithResult(_0x3f0e56,null))[_0x19c9('0x48')](handleError(_0x3f0e56,null));};exports[_0x19c9('0x2a')]=function(_0x4a0aae,_0x26d0b1){return db['Dashboard'][_0x19c9('0x52')]({'where':{'id':_0x4a0aae[_0x19c9('0x57')]['id']}})['then'](handleEntityNotFound(_0x26d0b1,null))[_0x19c9('0x29')](removeEntity(_0x26d0b1,null))[_0x19c9('0x48')](handleError(_0x26d0b1,null));};function widgetAttributes(_0x6f5163){try{switch(_0x6f5163[_0x19c9('0x35')]){case _0x19c9('0x5c'):return[{'name':_0x19c9('0x5d'),'value':_0x6f5163[_0x19c9('0x5d')]||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x0]?_0x6f5163['attrs'][0x0][_0x19c9('0x5f')]:undefined)||_0x19c9('0x60')}];case _0x19c9('0x61'):return[{'name':_0x19c9('0x62'),'value':_0x6f5163['attrPath']||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x0]?_0x6f5163['attrs'][0x0]['value']:undefined)||''}];case _0x19c9('0x63'):return[{'name':_0x19c9('0x64'),'value':_0x6f5163[_0x19c9('0x64')]||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163['attrs'][0x0]?_0x6f5163[_0x19c9('0x5e')][0x0][_0x19c9('0x5f')]:undefined)||_0x19c9('0x65')},{'name':'attrTimezone','value':_0x6f5163[_0x19c9('0x66')]||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x1]?_0x6f5163['attrs'][0x1]['value']:undefined)||_0x19c9('0x67')},{'name':_0x19c9('0x68'),'value':_0x6f5163[_0x19c9('0x68')]||(_0x6f5163['attrs']&&_0x6f5163['attrs'][0x2]?_0x6f5163[_0x19c9('0x5e')][0x2][_0x19c9('0x5f')]:undefined)||0xc}];case _0x19c9('0x69'):return[{'name':_0x19c9('0x6a'),'value':_0x6f5163[_0x19c9('0x6a')]||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163['attrs'][0x0]?_0x6f5163[_0x19c9('0x5e')][0x0]['value']:undefined)||_0x19c9('0x6b')},{'name':_0x19c9('0x6c'),'value':_0x6f5163['attrVoiceQueues']||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x1]?_0x6f5163[_0x19c9('0x5e')][0x1][_0x19c9('0x5f')]:undefined)||[]},{'name':_0x19c9('0x68'),'value':_0x6f5163[_0x19c9('0x68')]||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x2]?_0x6f5163[_0x19c9('0x5e')][0x2][_0x19c9('0x5f')]:undefined)||0x14}];case _0x19c9('0x6d'):case _0x19c9('0x6e'):return[{'name':'attrSerie1','value':_0x6f5163[_0x19c9('0x6f')]||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x0]?_0x6f5163['attrs'][0x0]['value']:undefined)||_0x19c9('0x6b')},{'name':_0x19c9('0x70'),'value':_0x6f5163['attrSerie2']||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x1]?_0x6f5163['attrs'][0x1][_0x19c9('0x5f')]:undefined)||null},{'name':'attrSerie3','value':_0x6f5163[_0x19c9('0x71')]||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x2]?_0x6f5163[_0x19c9('0x5e')][0x2][_0x19c9('0x5f')]:undefined)||null},{'name':_0x19c9('0x6c'),'value':_0x6f5163[_0x19c9('0x6c')]||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x3]?_0x6f5163[_0x19c9('0x5e')][0x3]['value']:undefined)||[]}];case _0x19c9('0x72'):return[{'name':_0x19c9('0x73'),'type':_0x6f5163['reportType']||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x0]?_0x6f5163[_0x19c9('0x5e')][0x0][_0x19c9('0x35')]:undefined)||null,'value':_0x6f5163[_0x19c9('0x73')]||(_0x6f5163[_0x19c9('0x5e')]&&_0x6f5163[_0x19c9('0x5e')][0x0]?_0x6f5163[_0x19c9('0x5e')][0x0][_0x19c9('0x5f')]:undefined)||null},{'name':'attrRefresh','value':_0x6f5163['attrRefresh']||(_0x6f5163['attrs']&&_0x6f5163[_0x19c9('0x5e')][0x1]?_0x6f5163[_0x19c9('0x5e')][0x1][_0x19c9('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x2b9f69){logger[_0x19c9('0x2e')](_0x19c9('0x74'),JSON['stringify'](_0x2b9f69));return[];}}exports[_0x19c9('0x75')]=function(_0x4e335e,_0x5c676e,_0x53cc76){if(_0x4e335e['body']['id']){delete _0x4e335e['body']['id'];}return db['Dashboard'][_0x19c9('0x52')]({'where':{'id':_0x4e335e[_0x19c9('0x57')]['id']}})['then'](handleEntityNotFound(_0x5c676e,null))[_0x19c9('0x29')](function(_0xe6842a){if(_0xe6842a){_0x4e335e[_0x19c9('0x4e')][_0x19c9('0x76')]=_0xe6842a['id'];_0x4e335e['body'][_0x19c9('0x5e')]=widgetAttributes(_0x4e335e['body']);return db['DashboardItem'][_0x19c9('0x4d')](_0x4e335e[_0x19c9('0x4e')]);}})[_0x19c9('0x29')](respondWithResult(_0x5c676e,null))[_0x19c9('0x48')](handleError(_0x5c676e,null));};exports[_0x19c9('0x77')]=function(_0x1de094,_0x3ca20b,_0x5bd30){var _0x19ee1c={};var _0x1bc0aa={};var _0x2c2861;var _0x3a7497;return db[_0x19c9('0x43')]['findOne']({'where':{'id':_0x1de094[_0x19c9('0x57')]['id']}})['then'](handleEntityNotFound(_0x3ca20b,null))[_0x19c9('0x29')](function(_0x5d4a55){if(_0x5d4a55){_0x2c2861=_0x5d4a55;_0x1bc0aa[_0x19c9('0x4c')]=_[_0x19c9('0x4b')](db['DashboardItem'][_0x19c9('0x4a')]);_0x1bc0aa[_0x19c9('0x37')]=_[_0x19c9('0x4b')](_0x1de094[_0x19c9('0x37')]);_0x1bc0aa['filters']=_[_0x19c9('0x39')](_0x1bc0aa['model'],_0x1bc0aa['query']);_0x19ee1c[_0x19c9('0x3a')]=_['intersection'](_0x1bc0aa[_0x19c9('0x4c')],qs['fields'](_0x1de094['query'][_0x19c9('0x3b')]));_0x19ee1c['attributes']=_0x19ee1c[_0x19c9('0x3a')]['length']?_0x19ee1c[_0x19c9('0x3a')]:_0x1bc0aa['model'];_0x19ee1c['order']=qs[_0x19c9('0x78')](_0x1de094[_0x19c9('0x37')][_0x19c9('0x78')]);_0x19ee1c[_0x19c9('0x3e')]=qs[_0x19c9('0x38')](_['pick'](_0x1de094[_0x19c9('0x37')],_0x1bc0aa[_0x19c9('0x38')]));if(_0x1de094['query'][_0x19c9('0x3f')]){_0x19ee1c['where']=_[_0x19c9('0x41')](_0x19ee1c['where'],{'$or':_['map'](_0x19ee1c[_0x19c9('0x3a')],function(_0x5bac89){var _0x2bb2ce={};_0x2bb2ce[_0x5bac89]={'$like':'%'+_0x1de094[_0x19c9('0x37')][_0x19c9('0x3f')]+'%'};return _0x2bb2ce;})});}_0x19ee1c=_[_0x19c9('0x41')]({},_0x19ee1c,_0x1de094[_0x19c9('0x42')]);return _0x2c2861['getItems'](_0x19ee1c);}})['then'](function(_0x3d09e4){if(_0x3d09e4){_0x3a7497=_0x3d09e4[_0x19c9('0x3c')];if(!_0x1de094['query'][_0x19c9('0x3d')](_0x19c9('0x79'))){_0x19ee1c['limit']=qs[_0x19c9('0x23')](_0x1de094[_0x19c9('0x37')][_0x19c9('0x23')]);_0x19ee1c[_0x19c9('0x20')]=qs[_0x19c9('0x20')](_0x1de094[_0x19c9('0x37')][_0x19c9('0x20')]);}return _0x2c2861[_0x19c9('0x77')](_0x19ee1c);}})[_0x19c9('0x29')](function(_0x2c7b5f){if(_0x2c7b5f){return _0x2c7b5f?{'count':_0x3a7497,'rows':_0x2c7b5f}:null;}})[_0x19c9('0x29')](respondWithResult(_0x3ca20b,null))['catch'](handleError(_0x3ca20b,null));};
\ No newline at end of file
index d1c1558..9c3f64a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eed=['emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard','setMaxListeners','save','remove'];(function(_0x227e65,_0x1ef1c1){var _0x42d69e=function(_0x1679a2){while(--_0x1679a2){_0x227e65['push'](_0x227e65['shift']());}};_0x42d69e(++_0x1ef1c1);}(_0x6eed,0xff));var _0xd6ee=function(_0x135753,_0xfeb57b){_0x135753=_0x135753-0x0;var _0x38376a=_0x6eed[_0x135753];return _0x38376a;};'use strict';var EventEmitter=require(_0xd6ee('0x0'));var Dashboard=require(_0xd6ee('0x1'))['db'][_0xd6ee('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd6ee('0x3')](0x0);var events={'afterCreate':_0xd6ee('0x4'),'afterUpdate':'update','afterDestroy':_0xd6ee('0x5')};function emitEvent(_0x315fdb){return function(_0x588715,_0x53cce9,_0x1d3312){DashboardEvents[_0xd6ee('0x6')](_0x315fdb+':'+_0x588715['id'],_0x588715);DashboardEvents[_0xd6ee('0x6')](_0x315fdb,_0x588715);_0x1d3312(null);};}for(var e in events){if(events[_0xd6ee('0x7')](e)){var event=events[e];Dashboard[_0xd6ee('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
+var _0xd7a3=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4b2251,_0x2007f6){var _0x5da1e6=function(_0x3d0d8c){while(--_0x3d0d8c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5da1e6(++_0x2007f6);}(_0xd7a3,0xf4));var _0x3d7a=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xd7a3[_0x279d37];return _0x530173;};'use strict';var EventEmitter=require(_0x3d7a('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3d7a('0x1')](0x0);var events={'afterCreate':_0x3d7a('0x2'),'afterUpdate':_0x3d7a('0x3'),'afterDestroy':_0x3d7a('0x4')};function emitEvent(_0x625de0){return function(_0x5ed7ba,_0x387b7d,_0x29395f){DashboardEvents['emit'](_0x625de0+':'+_0x5ed7ba['id'],_0x5ed7ba);DashboardEvents[_0x3d7a('0x5')](_0x625de0,_0x5ed7ba);_0x29395f(null);};}for(var e in events){if(events[_0x3d7a('0x6')](e)){var event=events[e];Dashboard[_0x3d7a('0x7')](e,emitEvent(event));}}module[_0x3d7a('0x8')]=DashboardEvents;
\ No newline at end of file
index 5b8ad00..08c5489 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05e2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard'];(function(_0x126009,_0x2f7313){var _0x28aa38=function(_0x573b21){while(--_0x573b21){_0x126009['push'](_0x126009['shift']());}};_0x28aa38(++_0x2f7313);}(_0x05e2,0xe0));var _0x205e=function(_0x6ec16,_0x2e8212){_0x6ec16=_0x6ec16-0x0;var _0x2b62ac=_0x05e2[_0x6ec16];return _0x2b62ac;};'use strict';var _=require(_0x205e('0x0'));var util=require(_0x205e('0x1'));var logger=require(_0x205e('0x2'))(_0x205e('0x3'));var moment=require(_0x205e('0x4'));var BPromise=require(_0x205e('0x5'));var rp=require(_0x205e('0x6'));var fs=require('fs');var path=require(_0x205e('0x7'));var rimraf=require(_0x205e('0x8'));var config=require(_0x205e('0x9'));var attributes=require(_0x205e('0xa'));module[_0x205e('0xb')]=function(_0x43a126,_0xb271df){return _0x43a126[_0x205e('0xc')](_0x205e('0xd'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5106=['moment','bluebird','rimraf','../../config/environment','./dashboard.attributes','exports','lodash','../../config/logger'];(function(_0x14be24,_0x25843d){var _0x234ed5=function(_0x436c88){while(--_0x436c88){_0x14be24['push'](_0x14be24['shift']());}};_0x234ed5(++_0x25843d);}(_0x5106,0x116));var _0x6510=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5106[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6510('0x0'));var util=require('util');var logger=require(_0x6510('0x1'))('api');var moment=require(_0x6510('0x2'));var BPromise=require(_0x6510('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6510('0x4'));var config=require(_0x6510('0x5'));var attributes=require(_0x6510('0x6'));module[_0x6510('0x7')]=function(_0x28cb6e,_0x2f5cb3){return _0x28cb6e['define']('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd6732a..23cb8d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b5c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','then','info','Dashboard,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x97435b,_0x3972c7){var _0x30feb9=function(_0x43d373){while(--_0x43d373){_0x97435b['push'](_0x97435b['shift']());}};_0x30feb9(++_0x3972c7);}(_0x1b5c,0x8e));var _0xc1b5=function(_0x3a94e1,_0x22e4fd){_0x3a94e1=_0x3a94e1-0x0;var _0x6a09d5=_0x1b5c[_0x3a94e1];return _0x6a09d5;};'use strict';var _=require(_0xc1b5('0x0'));var util=require(_0xc1b5('0x1'));var moment=require(_0xc1b5('0x2'));var BPromise=require(_0xc1b5('0x3'));var rs=require(_0xc1b5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc1b5('0x5'))['db'];var utils=require(_0xc1b5('0x6'));var logger=require(_0xc1b5('0x7'))('rpc');var config=require(_0xc1b5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc1b5('0x9')]['http']({'port':0x232a});config[_0xc1b5('0xa')]=_[_0xc1b5('0xb')](config[_0xc1b5('0xa')],{'host':_0xc1b5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc1b5('0xa')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x44b1d8,_0x537937,_0x2f3898){return new BPromise(function(_0x314523,_0x1ec029){return client['request'](_0x44b1d8,_0x2f3898)[_0xc1b5('0xd')](function(_0x59744c){logger[_0xc1b5('0xe')](_0xc1b5('0xf'),_0x537937,'request\x20sent');logger[_0xc1b5('0x10')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x537937,_0xc1b5('0x11'),JSON[_0xc1b5('0x12')](_0x59744c));if(_0x59744c['error']){if(_0x59744c[_0xc1b5('0x13')][_0xc1b5('0x14')]===0x1f4){logger['error'](_0xc1b5('0xf'),_0x537937,_0x59744c[_0xc1b5('0x13')][_0xc1b5('0x15')]);return _0x1ec029(_0x59744c[_0xc1b5('0x13')][_0xc1b5('0x15')]);}logger[_0xc1b5('0x13')](_0xc1b5('0xf'),_0x537937,_0x59744c['error']['message']);return _0x314523(_0x59744c[_0xc1b5('0x13')][_0xc1b5('0x15')]);}else{logger[_0xc1b5('0xe')](_0xc1b5('0xf'),_0x537937,_0xc1b5('0x11'));_0x314523(_0x59744c[_0xc1b5('0x16')][_0xc1b5('0x15')]);}})[_0xc1b5('0x17')](function(_0x102090){logger[_0xc1b5('0x13')]('Dashboard,\x20%s,\x20%s',_0x537937,_0x102090);_0x1ec029(_0x102090);});});}
\ No newline at end of file
+var _0x41d7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3b2126,_0x3b137f){var _0x2492b4=function(_0x3a1f0c){while(--_0x3a1f0c){_0x3b2126['push'](_0x3b2126['shift']());}};_0x2492b4(++_0x3b137f);}(_0x41d7,0x1c4));var _0x741d=function(_0x2050ac,_0x3293c9){_0x2050ac=_0x2050ac-0x0;var _0x331736=_0x41d7[_0x2050ac];return _0x331736;};'use strict';var _=require(_0x741d('0x0'));var util=require(_0x741d('0x1'));var moment=require('moment');var BPromise=require(_0x741d('0x2'));var rs=require(_0x741d('0x3'));var fs=require('fs');var Redis=require(_0x741d('0x4'));var db=require(_0x741d('0x5'))['db'];var utils=require(_0x741d('0x6'));var logger=require(_0x741d('0x7'))(_0x741d('0x8'));var config=require(_0x741d('0x9'));var jayson=require(_0x741d('0xa'));var client=jayson[_0x741d('0xb')][_0x741d('0xc')]({'port':0x232a});config[_0x741d('0xd')]=_[_0x741d('0xe')](config[_0x741d('0xd')],{'host':_0x741d('0xf'),'port':0x18eb});var socket=require(_0x741d('0x10'))(new Redis(config['redis']));require('./dashboard.socket')[_0x741d('0x11')](socket);function respondWithRpcPromise(_0x412d23,_0x457012,_0x51dd03){return new BPromise(function(_0x1c1414,_0x183e92){return client[_0x741d('0x12')](_0x412d23,_0x51dd03)['then'](function(_0x171110){logger['info'](_0x741d('0x13'),_0x457012,'request\x20sent');logger[_0x741d('0x14')](_0x741d('0x15'),_0x457012,_0x741d('0x16'),JSON[_0x741d('0x17')](_0x171110));if(_0x171110[_0x741d('0x18')]){if(_0x171110['error']['code']===0x1f4){logger[_0x741d('0x18')]('Dashboard,\x20%s,\x20%s',_0x457012,_0x171110[_0x741d('0x18')][_0x741d('0x19')]);return _0x183e92(_0x171110[_0x741d('0x18')][_0x741d('0x19')]);}logger[_0x741d('0x18')](_0x741d('0x13'),_0x457012,_0x171110[_0x741d('0x18')][_0x741d('0x19')]);return _0x1c1414(_0x171110[_0x741d('0x18')][_0x741d('0x19')]);}else{logger['info'](_0x741d('0x13'),_0x457012,_0x741d('0x16'));_0x1c1414(_0x171110[_0x741d('0x1a')]['message']);}})['catch'](function(_0x580f29){logger[_0x741d('0x18')](_0x741d('0x13'),_0x457012,_0x580f29);_0x183e92(_0x580f29);});});}
\ No newline at end of file
index a7769b1..cead9b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f52=['register','dashboard:','save','remove'];(function(_0x392852,_0x134f34){var _0x48ba0c=function(_0x244837){while(--_0x244837){_0x392852['push'](_0x392852['shift']());}};_0x48ba0c(++_0x134f34);}(_0x5f52,0x10a));var _0x25f5=function(_0x210718,_0x247b55){_0x210718=_0x210718-0x0;var _0x541bfc=_0x5f52[_0x210718];return _0x541bfc;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x25f5('0x0'),_0x25f5('0x1'),'update'];function createListener(_0x4dec8a,_0x4f915d){return function(_0x378508){_0x4f915d['emit'](_0x4dec8a,_0x378508);};}function removeListener(_0x56bf4d,_0x4da76d){return function(){DashboardEvents['removeListener'](_0x56bf4d,_0x4da76d);};}exports[_0x25f5('0x2')]=function(_0x462e71){for(var _0x3ae3c7=0x0,_0x322f5f=events['length'];_0x3ae3c7<_0x322f5f;_0x3ae3c7++){var _0x3760c2=events[_0x3ae3c7];var _0x5436f8=createListener(_0x25f5('0x3')+_0x3760c2,_0x462e71);DashboardEvents['on'](_0x3760c2,_0x5436f8);}};
\ No newline at end of file
+var _0x5385=['remove','update','emit','register','length','dashboard:','./dashboard.events','save'];(function(_0x3aaa55,_0x1d6d2b){var _0x36d54d=function(_0x126cc2){while(--_0x126cc2){_0x3aaa55['push'](_0x3aaa55['shift']());}};_0x36d54d(++_0x1d6d2b);}(_0x5385,0x1c6));var _0x5538=function(_0x4f68f5,_0x598d57){_0x4f68f5=_0x4f68f5-0x0;var _0x57e4a9=_0x5385[_0x4f68f5];return _0x57e4a9;};'use strict';var DashboardEvents=require(_0x5538('0x0'));var events=[_0x5538('0x1'),_0x5538('0x2'),_0x5538('0x3')];function createListener(_0x567f70,_0x50fbee){return function(_0x36206f){_0x50fbee[_0x5538('0x4')](_0x567f70,_0x36206f);};}function removeListener(_0x2e7821,_0x4ded08){return function(){DashboardEvents['removeListener'](_0x2e7821,_0x4ded08);};}exports[_0x5538('0x5')]=function(_0x2a6f34){for(var _0x7a3e80=0x0,_0x1490a4=events[_0x5538('0x6')];_0x7a3e80<_0x1490a4;_0x7a3e80++){var _0x205e59=events[_0x7a3e80];var _0x3661ca=createListener(_0x5538('0x7')+_0x205e59,_0x2a6f34);DashboardEvents['on'](_0x205e59,_0x3661ca);}};
\ No newline at end of file
index 36857ea..888854c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4d0=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','/:id/clone','clone','/:id/items','addItem'];(function(_0x5b0574,_0xb3a0ac){var _0x10d384=function(_0x50f3b5){while(--_0x50f3b5){_0x5b0574['push'](_0x5b0574['shift']());}};_0x10d384(++_0xb3a0ac);}(_0xa4d0,0xff));var _0x0a4d=function(_0x2cadc0,_0x21d93d){_0x2cadc0=_0x2cadc0-0x0;var _0x3e44ab=_0xa4d0[_0x2cadc0];return _0x3e44ab;};'use strict';var multer=require(_0x0a4d('0x0'));var util=require(_0x0a4d('0x1'));var path=require(_0x0a4d('0x2'));var timeout=require(_0x0a4d('0x3'));var express=require('express');var router=express[_0x0a4d('0x4')]();var fs_extra=require(_0x0a4d('0x5'));var auth=require(_0x0a4d('0x6'));var interaction=require(_0x0a4d('0x7'));var config=require(_0x0a4d('0x8'));var controller=require('./dashboard.controller');router[_0x0a4d('0x9')]('/',auth[_0x0a4d('0xa')](),controller[_0x0a4d('0xb')]);router[_0x0a4d('0x9')](_0x0a4d('0xc'),auth[_0x0a4d('0xa')](),controller[_0x0a4d('0xd')]);router[_0x0a4d('0x9')]('/:id/items',auth['isAuthenticated'](),controller['getItems']);router[_0x0a4d('0xe')]('/',auth['isAuthenticated'](),controller[_0x0a4d('0xf')]);router[_0x0a4d('0xe')](_0x0a4d('0x10'),auth[_0x0a4d('0xa')](),controller[_0x0a4d('0x11')]);router[_0x0a4d('0xe')](_0x0a4d('0x12'),auth[_0x0a4d('0xa')](),controller[_0x0a4d('0x13')]);router[_0x0a4d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x0a4d('0x15')]);router[_0x0a4d('0x16')]('/:id',auth[_0x0a4d('0xa')](),controller[_0x0a4d('0x17')]);module[_0x0a4d('0x18')]=router;
\ No newline at end of file
+var _0x6dc2=['show','/:id/items','post','create','/:id/clone','clone','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6dc2,0xfc));var _0x26dc=function(_0x321b4d,_0x345f23){_0x321b4d=_0x321b4d-0x0;var _0x14f268=_0x6dc2[_0x321b4d];return _0x14f268;};'use strict';var multer=require('multer');var util=require(_0x26dc('0x0'));var path=require(_0x26dc('0x1'));var timeout=require(_0x26dc('0x2'));var express=require(_0x26dc('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x26dc('0x4'));var interaction=require(_0x26dc('0x5'));var config=require(_0x26dc('0x6'));var controller=require(_0x26dc('0x7'));router[_0x26dc('0x8')]('/',auth['isAuthenticated'](),controller[_0x26dc('0x9')]);router['get'](_0x26dc('0xa'),auth[_0x26dc('0xb')](),controller[_0x26dc('0xc')]);router['get'](_0x26dc('0xd'),auth[_0x26dc('0xb')](),controller['getItems']);router[_0x26dc('0xe')]('/',auth['isAuthenticated'](),controller[_0x26dc('0xf')]);router[_0x26dc('0xe')](_0x26dc('0x10'),auth['isAuthenticated'](),controller[_0x26dc('0x11')]);router[_0x26dc('0xe')]('/:id/items',auth[_0x26dc('0xb')](),controller['addItem']);router['put'](_0x26dc('0xa'),auth[_0x26dc('0xb')](),controller[_0x26dc('0x12')]);router[_0x26dc('0x13')](_0x26dc('0xa'),auth['isAuthenticated'](),controller[_0x26dc('0x14')]);module[_0x26dc('0x15')]=router;
\ No newline at end of file
index 3c9fbff..f39e16c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xabce,0x103));var _0xeabc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xabce[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require(_0xeabc('0x0'));var squel=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));module[_0xeabc('0x3')]={'title':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xeabc('0x5')),'get':function(){try{return JSON[_0xeabc('0x6')](this[_0xeabc('0x7')]('attrs'));}catch(_0x54e4a8){return[];}},'set':function(_0x1b07a8){try{this['setDataValue'](_0xeabc('0x8'),JSON['stringify'](_0x1b07a8));}catch(_0x3bdc29){this[_0xeabc('0x9')](_0xeabc('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xeabc('0xa')]},'col':{'type':Sequelize[_0xeabc('0xa')]},'background':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xeabc('0x4')]},'titleFontSize':{'type':Sequelize[_0xeabc('0xa')],'defaultValue':0xc}};
\ No newline at end of file
+var _0xafc4=['TEXT','long','setDataValue','attrs','stringify','INTEGER','sequelize','lodash','STRING'];(function(_0x503006,_0x49d5c8){var _0x520629=function(_0x3bcac3){while(--_0x3bcac3){_0x503006['push'](_0x503006['shift']());}};_0x520629(++_0x49d5c8);}(_0xafc4,0x69));var _0x4afc=function(_0x344bb0,_0x5b6bb8){_0x344bb0=_0x344bb0-0x0;var _0x173287=_0xafc4[_0x344bb0];return _0x173287;};'use strict';var Sequelize=require(_0x4afc('0x0'));var squel=require('squel');var _=require(_0x4afc('0x1'));module['exports']={'title':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4afc('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x4afc('0x3')](_0x4afc('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue']('attrs'));}catch(_0x36cb50){return[];}},'set':function(_0x471d45){try{this[_0x4afc('0x5')](_0x4afc('0x6'),JSON[_0x4afc('0x7')](_0x471d45));}catch(_0xaf053d){this['setDataValue'](_0x4afc('0x6'),JSON[_0x4afc('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x4afc('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4afc('0x8')]},'col':{'type':Sequelize[_0x4afc('0x8')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x4afc('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4afc('0x2')]},'titleFontSize':{'type':Sequelize[_0x4afc('0x8')],'defaultValue':0xc}};
\ No newline at end of file
index b4b71d8..f40b517 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1458=['../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','status','end','json','undefined','limit','count','set','apply','reject','destroy','then','sendStatus','error','name','show','model','keys','query','filters','intersection','fields','attributes','length','includeAll','merge','options','catch','DashboardItem','params','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','attrVoiceQueues','attrFontSize','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','stringify','body','update','find','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x19ff82,_0x4b3ca6){var _0x4979ee=function(_0x3b3d34){while(--_0x3b3d34){_0x19ff82['push'](_0x19ff82['shift']());}};_0x4979ee(++_0x4b3ca6);}(_0x1458,0x98));var _0x8145=function(_0x34a4b1,_0x1b5324){_0x34a4b1=_0x34a4b1-0x0;var _0x1dd64c=_0x1458[_0x34a4b1];return _0x1dd64c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8145('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8145('0x1'));var moment=require(_0x8145('0x2'));var BPromise=require(_0x8145('0x3'));var Mustache=require('mustache');var util=require(_0x8145('0x4'));var path=require(_0x8145('0x5'));var sox=require('sox');var csv=require(_0x8145('0x6'));var ejs=require(_0x8145('0x7'));var fs=require('fs');var fs_extra=require(_0x8145('0x8'));var _=require(_0x8145('0x9'));var squel=require(_0x8145('0xa'));var crypto=require(_0x8145('0xb'));var jsforce=require(_0x8145('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8145('0xd'));var Papa=require('papaparse');var Redis=require(_0x8145('0xe'));var authService=require(_0x8145('0xf'));var qs=require(_0x8145('0x10'));var as=require(_0x8145('0x11'));var hardwareService=require(_0x8145('0x12'));var logger=require(_0x8145('0x13'))(_0x8145('0x14'));var utils=require(_0x8145('0x15'));var config=require(_0x8145('0x16'));var licenseUtil=require(_0x8145('0x17'));var db=require(_0x8145('0x18'))['db'];config[_0x8145('0x19')]=_[_0x8145('0x1a')](config[_0x8145('0x19')],{'host':_0x8145('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8145('0x19')]));require(_0x8145('0x1c'))[_0x8145('0x1d')](socket);function respondWithStatusCode(_0x2a2f49,_0x1b0f8b){_0x1b0f8b=_0x1b0f8b||0xcc;return function(_0x59f70f){if(_0x59f70f){return _0x2a2f49['sendStatus'](_0x1b0f8b);}return _0x2a2f49[_0x8145('0x1e')](_0x1b0f8b)[_0x8145('0x1f')]();};}function respondWithResult(_0x48a9a6,_0xaee3c9){_0xaee3c9=_0xaee3c9||0xc8;return function(_0x51e50f){if(_0x51e50f){return _0x48a9a6['status'](_0xaee3c9)[_0x8145('0x20')](_0x51e50f);}};}function respondWithFilteredResult(_0x5a0e3b,_0x1a956f){return function(_0xb28ca6){if(_0xb28ca6){var _0x4e24d1=typeof _0x1a956f['offset']===_0x8145('0x21')&&typeof _0x1a956f[_0x8145('0x22')]===_0x8145('0x21');var _0x344905=_0xb28ca6[_0x8145('0x23')];var _0x2dc28f=_0x4e24d1?0x0:_0x1a956f['offset'];var _0x3e18fa=_0x4e24d1?_0xb28ca6[_0x8145('0x23')]:_0x1a956f['offset']+_0x1a956f[_0x8145('0x22')];var _0x3806cd;if(_0x3e18fa>=_0x344905){_0x3e18fa=_0x344905;_0x3806cd=0xc8;}else{_0x3806cd=0xce;}_0x5a0e3b[_0x8145('0x1e')](_0x3806cd);return _0x5a0e3b[_0x8145('0x24')]('Content-Range',_0x2dc28f+'-'+_0x3e18fa+'/'+_0x344905)[_0x8145('0x20')](_0xb28ca6);}return null;};}function patchUpdates(_0x3ca361){return function(_0x362554){try{jsonpatch[_0x8145('0x25')](_0x362554,_0x3ca361,!![]);}catch(_0x3f8a53){return BPromise[_0x8145('0x26')](_0x3f8a53);}return _0x362554['save']();};}function saveUpdates(_0x1d65ad,_0x4696fb){return function(_0x29bb26){if(_0x29bb26){return _0x29bb26['update'](_0x1d65ad)['then'](function(_0x7ded6d){return _0x7ded6d;});}return null;};}function removeEntity(_0x11e692,_0x20de96){return function(_0x3c9c3c){if(_0x3c9c3c){return _0x3c9c3c[_0x8145('0x27')]()[_0x8145('0x28')](function(){_0x11e692[_0x8145('0x1e')](0xcc)[_0x8145('0x1f')]();});}};}function handleEntityNotFound(_0xff0807,_0x189504){return function(_0x33656b){if(!_0x33656b){_0xff0807[_0x8145('0x29')](0x194);}return _0x33656b;};}function handleError(_0x5e645b,_0x15d66f){_0x15d66f=_0x15d66f||0x1f4;return function(_0x440873){logger[_0x8145('0x2a')](_0x440873['stack']);if(_0x440873[_0x8145('0x2b')]){delete _0x440873['name'];}_0x5e645b['status'](_0x15d66f)['send'](_0x440873);};}exports[_0x8145('0x2c')]=function(_0x25def9,_0x5bd481){var _0x1e707a={'raw':![],'where':{'id':_0x25def9['params']['id']}},_0x494f64={};_0x494f64[_0x8145('0x2d')]=_[_0x8145('0x2e')](db['DashboardItem']['rawAttributes']);_0x494f64[_0x8145('0x2f')]=_[_0x8145('0x2e')](_0x25def9[_0x8145('0x2f')]);_0x494f64[_0x8145('0x30')]=_[_0x8145('0x31')](_0x494f64[_0x8145('0x2d')],_0x494f64[_0x8145('0x2f')]);_0x1e707a['attributes']=_[_0x8145('0x31')](_0x494f64['model'],qs[_0x8145('0x32')](_0x25def9[_0x8145('0x2f')][_0x8145('0x32')]));_0x1e707a[_0x8145('0x33')]=_0x1e707a[_0x8145('0x33')][_0x8145('0x34')]?_0x1e707a[_0x8145('0x33')]:_0x494f64[_0x8145('0x2d')];if(_0x25def9[_0x8145('0x2f')][_0x8145('0x35')]){_0x1e707a['include']=[{'all':!![]}];}_0x1e707a=_[_0x8145('0x36')]({},_0x1e707a,_0x25def9[_0x8145('0x37')]);return db['DashboardItem']['find'](_0x1e707a)['then'](handleEntityNotFound(_0x5bd481,null))['then'](respondWithResult(_0x5bd481,null))[_0x8145('0x38')](handleError(_0x5bd481,null));};exports[_0x8145('0x27')]=function(_0x19daa2,_0x15ae61){return db[_0x8145('0x39')]['find']({'where':{'id':_0x19daa2[_0x8145('0x3a')]['id']}})['then'](handleEntityNotFound(_0x15ae61,null))['then'](removeEntity(_0x15ae61,null))[_0x8145('0x38')](handleError(_0x15ae61,null));};function widgetAttributes(_0x5aa58e){try{switch(_0x5aa58e['type']){case'iframe':return[{'name':_0x8145('0x3b'),'value':_0x5aa58e[_0x8145('0x3b')]||(_0x5aa58e[_0x8145('0x3c')]&&_0x5aa58e[_0x8145('0x3c')][0x0]?_0x5aa58e[_0x8145('0x3c')][0x0]['value']:undefined)||_0x8145('0x3d')}];case _0x8145('0x3e'):return[{'name':_0x8145('0x3f'),'value':_0x5aa58e[_0x8145('0x3f')]||(_0x5aa58e[_0x8145('0x3c')]&&_0x5aa58e[_0x8145('0x3c')][0x0]?_0x5aa58e['attrs'][0x0][_0x8145('0x40')]:undefined)||''}];case _0x8145('0x41'):return[{'name':_0x8145('0x42'),'value':_0x5aa58e[_0x8145('0x42')]||(_0x5aa58e['attrs']&&_0x5aa58e[_0x8145('0x3c')][0x0]?_0x5aa58e[_0x8145('0x3c')][0x0][_0x8145('0x40')]:undefined)||_0x8145('0x43')},{'name':_0x8145('0x44'),'value':_0x5aa58e[_0x8145('0x44')]||(_0x5aa58e[_0x8145('0x3c')]&&_0x5aa58e[_0x8145('0x3c')][0x1]?_0x5aa58e[_0x8145('0x3c')][0x1][_0x8145('0x40')]:undefined)||_0x8145('0x45')},{'name':'attrFontSize','value':_0x5aa58e['attrFontSize']||(_0x5aa58e[_0x8145('0x3c')]&&_0x5aa58e[_0x8145('0x3c')][0x2]?_0x5aa58e[_0x8145('0x3c')][0x2][_0x8145('0x40')]:undefined)||0xc}];case _0x8145('0x46'):return[{'name':'attrMetric','value':_0x5aa58e[_0x8145('0x47')]||(_0x5aa58e[_0x8145('0x3c')]&&_0x5aa58e[_0x8145('0x3c')][0x0]?_0x5aa58e[_0x8145('0x3c')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x5aa58e[_0x8145('0x48')]||(_0x5aa58e[_0x8145('0x3c')]&&_0x5aa58e['attrs'][0x1]?_0x5aa58e['attrs'][0x1][_0x8145('0x40')]:undefined)||[]},{'name':_0x8145('0x49'),'value':_0x5aa58e[_0x8145('0x49')]||(_0x5aa58e[_0x8145('0x3c')]&&_0x5aa58e['attrs'][0x2]?_0x5aa58e[_0x8145('0x3c')][0x2][_0x8145('0x40')]:undefined)||0x14}];case _0x8145('0x4a'):case'pie-chart':return[{'name':_0x8145('0x4b'),'value':_0x5aa58e[_0x8145('0x4b')]||(_0x5aa58e['attrs']&&_0x5aa58e[_0x8145('0x3c')][0x0]?_0x5aa58e[_0x8145('0x3c')][0x0][_0x8145('0x40')]:undefined)||_0x8145('0x4c')},{'name':_0x8145('0x4d'),'value':_0x5aa58e[_0x8145('0x4d')]||(_0x5aa58e['attrs']&&_0x5aa58e['attrs'][0x1]?_0x5aa58e[_0x8145('0x3c')][0x1][_0x8145('0x40')]:undefined)||null},{'name':_0x8145('0x4e'),'value':_0x5aa58e['attrSerie3']||(_0x5aa58e[_0x8145('0x3c')]&&_0x5aa58e[_0x8145('0x3c')][0x2]?_0x5aa58e[_0x8145('0x3c')][0x2][_0x8145('0x40')]:undefined)||null},{'name':_0x8145('0x48'),'value':_0x5aa58e[_0x8145('0x48')]||(_0x5aa58e['attrs']&&_0x5aa58e[_0x8145('0x3c')][0x3]?_0x5aa58e[_0x8145('0x3c')][0x3][_0x8145('0x40')]:undefined)||[]}];case _0x8145('0x4f'):return[{'name':'attrReport','type':_0x5aa58e[_0x8145('0x50')]||(_0x5aa58e['attrs']&&_0x5aa58e[_0x8145('0x3c')][0x0]?_0x5aa58e[_0x8145('0x3c')][0x0]['type']:undefined)||null,'value':_0x5aa58e[_0x8145('0x51')]||(_0x5aa58e[_0x8145('0x3c')]&&_0x5aa58e[_0x8145('0x3c')][0x0]?_0x5aa58e[_0x8145('0x3c')][0x0][_0x8145('0x40')]:undefined)||null},{'name':_0x8145('0x52'),'value':_0x5aa58e[_0x8145('0x52')]||(_0x5aa58e[_0x8145('0x3c')]&&_0x5aa58e[_0x8145('0x3c')][0x1]?_0x5aa58e[_0x8145('0x3c')][0x1][_0x8145('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x55a742){logger[_0x8145('0x2a')]('widgetAttributes:\x20%s',JSON[_0x8145('0x53')](_0x55a742));return[];}}exports['create']=function(_0xed59d0,_0x218fc0){if(_0xed59d0[_0x8145('0x54')]){_0xed59d0['body'][_0x8145('0x3c')]=widgetAttributes(_0xed59d0[_0x8145('0x54')]);}return db[_0x8145('0x39')]['create'](_0xed59d0['body'],{})[_0x8145('0x28')](respondWithResult(_0x218fc0,0xc9))[_0x8145('0x38')](handleError(_0x218fc0,null));};exports[_0x8145('0x55')]=function(_0x1d032b,_0x39a3ce){if(_0x1d032b[_0x8145('0x54')]['id']){delete _0x1d032b[_0x8145('0x54')]['id'];}_0x1d032b['body'][_0x8145('0x3c')]=widgetAttributes(_0x1d032b[_0x8145('0x54')]);return db[_0x8145('0x39')][_0x8145('0x56')]({'where':{'id':_0x1d032b[_0x8145('0x3a')]['id']}})['then'](handleEntityNotFound(_0x39a3ce,null))[_0x8145('0x28')](saveUpdates(_0x1d032b[_0x8145('0x54')],null))['then'](respondWithResult(_0x39a3ce,null))['catch'](handleError(_0x39a3ce,null));};
\ No newline at end of file
+var _0xdb5b=['fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status','end','json','limit','offset','set','Content-Range','apply','destroy','then','name','send','params','model','keys','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','DashboardItem','find','catch','type','attrs','value','https://','custom','attrPath','clock','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs'];(function(_0x4a53cb,_0x181e55){var _0x5638cc=function(_0x35e9d6){while(--_0x35e9d6){_0x4a53cb['push'](_0x4a53cb['shift']());}};_0x5638cc(++_0x181e55);}(_0xdb5b,0x95));var _0xbdb5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xdb5b[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdb5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbdb5('0x1'));var rp=require(_0xbdb5('0x2'));var moment=require(_0xbdb5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbdb5('0x4'));var util=require('util');var path=require(_0xbdb5('0x5'));var sox=require(_0xbdb5('0x6'));var csv=require(_0xbdb5('0x7'));var ejs=require(_0xbdb5('0x8'));var fs=require('fs');var fs_extra=require(_0xbdb5('0x9'));var _=require('lodash');var squel=require(_0xbdb5('0xa'));var crypto=require('crypto');var jsforce=require(_0xbdb5('0xb'));var deskjs=require(_0xbdb5('0xc'));var toCsv=require(_0xbdb5('0x7'));var querystring=require(_0xbdb5('0xd'));var Papa=require(_0xbdb5('0xe'));var Redis=require('ioredis');var authService=require(_0xbdb5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbdb5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbdb5('0x11'))(_0xbdb5('0x12'));var utils=require('../../config/utils');var config=require(_0xbdb5('0x13'));var licenseUtil=require(_0xbdb5('0x14'));var db=require(_0xbdb5('0x15'))['db'];config[_0xbdb5('0x16')]=_['defaults'](config[_0xbdb5('0x16')],{'host':_0xbdb5('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0xaf3791,_0x327a7f){_0x327a7f=_0x327a7f||0xcc;return function(_0x1f802d){if(_0x1f802d){return _0xaf3791[_0xbdb5('0x18')](_0x327a7f);}return _0xaf3791[_0xbdb5('0x19')](_0x327a7f)[_0xbdb5('0x1a')]();};}function respondWithResult(_0x250f47,_0x47f054){_0x47f054=_0x47f054||0xc8;return function(_0xb1ffb3){if(_0xb1ffb3){return _0x250f47[_0xbdb5('0x19')](_0x47f054)[_0xbdb5('0x1b')](_0xb1ffb3);}};}function respondWithFilteredResult(_0x436ac9,_0x845067){return function(_0x128382){if(_0x128382){var _0x33abcf=typeof _0x845067['offset']==='undefined'&&typeof _0x845067[_0xbdb5('0x1c')]==='undefined';var _0x36a4db=_0x128382['count'];var _0x2be70f=_0x33abcf?0x0:_0x845067[_0xbdb5('0x1d')];var _0x50c814=_0x33abcf?_0x128382['count']:_0x845067[_0xbdb5('0x1d')]+_0x845067[_0xbdb5('0x1c')];var _0x468b88;if(_0x50c814>=_0x36a4db){_0x50c814=_0x36a4db;_0x468b88=0xc8;}else{_0x468b88=0xce;}_0x436ac9['status'](_0x468b88);return _0x436ac9[_0xbdb5('0x1e')](_0xbdb5('0x1f'),_0x2be70f+'-'+_0x50c814+'/'+_0x36a4db)['json'](_0x128382);}return null;};}function patchUpdates(_0x22ceac){return function(_0x5cfa54){try{jsonpatch[_0xbdb5('0x20')](_0x5cfa54,_0x22ceac,!![]);}catch(_0x52e63f){return BPromise['reject'](_0x52e63f);}return _0x5cfa54['save']();};}function saveUpdates(_0x38ac41,_0xf6540a){return function(_0x3685ab){if(_0x3685ab){return _0x3685ab['update'](_0x38ac41)['then'](function(_0x4cd021){return _0x4cd021;});}return null;};}function removeEntity(_0x5eb2eb,_0x31f9ce){return function(_0x329e9d){if(_0x329e9d){return _0x329e9d[_0xbdb5('0x21')]()[_0xbdb5('0x22')](function(){_0x5eb2eb[_0xbdb5('0x19')](0xcc)[_0xbdb5('0x1a')]();});}};}function handleEntityNotFound(_0x473268,_0x55b551){return function(_0x360465){if(!_0x360465){_0x473268[_0xbdb5('0x18')](0x194);}return _0x360465;};}function handleError(_0x196bc9,_0x4af683){_0x4af683=_0x4af683||0x1f4;return function(_0x56ae23){logger['error'](_0x56ae23['stack']);if(_0x56ae23['name']){delete _0x56ae23[_0xbdb5('0x23')];}_0x196bc9[_0xbdb5('0x19')](_0x4af683)[_0xbdb5('0x24')](_0x56ae23);};}exports['show']=function(_0x6d0580,_0x2be9d2){var _0x165756={'raw':![],'where':{'id':_0x6d0580[_0xbdb5('0x25')]['id']}},_0x16c76c={};_0x16c76c[_0xbdb5('0x26')]=_[_0xbdb5('0x27')](db['DashboardItem']['rawAttributes']);_0x16c76c[_0xbdb5('0x28')]=_[_0xbdb5('0x27')](_0x6d0580[_0xbdb5('0x28')]);_0x16c76c[_0xbdb5('0x29')]=_['intersection'](_0x16c76c[_0xbdb5('0x26')],_0x16c76c[_0xbdb5('0x28')]);_0x165756[_0xbdb5('0x2a')]=_[_0xbdb5('0x2b')](_0x16c76c[_0xbdb5('0x26')],qs[_0xbdb5('0x2c')](_0x6d0580[_0xbdb5('0x28')]['fields']));_0x165756['attributes']=_0x165756['attributes'][_0xbdb5('0x2d')]?_0x165756[_0xbdb5('0x2a')]:_0x16c76c['model'];if(_0x6d0580[_0xbdb5('0x28')][_0xbdb5('0x2e')]){_0x165756[_0xbdb5('0x2f')]=[{'all':!![]}];}_0x165756=_[_0xbdb5('0x30')]({},_0x165756,_0x6d0580[_0xbdb5('0x31')]);return db[_0xbdb5('0x32')][_0xbdb5('0x33')](_0x165756)[_0xbdb5('0x22')](handleEntityNotFound(_0x2be9d2,null))[_0xbdb5('0x22')](respondWithResult(_0x2be9d2,null))[_0xbdb5('0x34')](handleError(_0x2be9d2,null));};exports[_0xbdb5('0x21')]=function(_0x2c2c15,_0x5cc10f){return db[_0xbdb5('0x32')][_0xbdb5('0x33')]({'where':{'id':_0x2c2c15[_0xbdb5('0x25')]['id']}})[_0xbdb5('0x22')](handleEntityNotFound(_0x5cc10f,null))['then'](removeEntity(_0x5cc10f,null))[_0xbdb5('0x34')](handleError(_0x5cc10f,null));};function widgetAttributes(_0x5194da){try{switch(_0x5194da[_0xbdb5('0x35')]){case'iframe':return[{'name':'attrUrl','value':_0x5194da['attrUrl']||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da[_0xbdb5('0x36')][0x0]?_0x5194da[_0xbdb5('0x36')][0x0][_0xbdb5('0x37')]:undefined)||_0xbdb5('0x38')}];case _0xbdb5('0x39'):return[{'name':_0xbdb5('0x3a'),'value':_0x5194da['attrPath']||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da[_0xbdb5('0x36')][0x0]?_0x5194da['attrs'][0x0][_0xbdb5('0x37')]:undefined)||''}];case _0xbdb5('0x3b'):return[{'name':'attrHourFormat','value':_0x5194da['attrHourFormat']||(_0x5194da['attrs']&&_0x5194da['attrs'][0x0]?_0x5194da[_0xbdb5('0x36')][0x0][_0xbdb5('0x37')]:undefined)||_0xbdb5('0x3c')},{'name':'attrTimezone','value':_0x5194da[_0xbdb5('0x3d')]||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da[_0xbdb5('0x36')][0x1]?_0x5194da['attrs'][0x1][_0xbdb5('0x37')]:undefined)||'0.00'},{'name':_0xbdb5('0x3e'),'value':_0x5194da['attrFontSize']||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da['attrs'][0x2]?_0x5194da['attrs'][0x2][_0xbdb5('0x37')]:undefined)||0xc}];case'counter':return[{'name':_0xbdb5('0x3f'),'value':_0x5194da[_0xbdb5('0x3f')]||(_0x5194da['attrs']&&_0x5194da[_0xbdb5('0x36')][0x0]?_0x5194da[_0xbdb5('0x36')][0x0][_0xbdb5('0x37')]:undefined)||_0xbdb5('0x40')},{'name':'attrVoiceQueues','value':_0x5194da['attrVoiceQueues']||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da['attrs'][0x1]?_0x5194da[_0xbdb5('0x36')][0x1][_0xbdb5('0x37')]:undefined)||[]},{'name':'attrFontSize','value':_0x5194da[_0xbdb5('0x3e')]||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da[_0xbdb5('0x36')][0x2]?_0x5194da[_0xbdb5('0x36')][0x2][_0xbdb5('0x37')]:undefined)||0x14}];case _0xbdb5('0x41'):case _0xbdb5('0x42'):return[{'name':_0xbdb5('0x43'),'value':_0x5194da[_0xbdb5('0x43')]||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da[_0xbdb5('0x36')][0x0]?_0x5194da[_0xbdb5('0x36')][0x0][_0xbdb5('0x37')]:undefined)||_0xbdb5('0x40')},{'name':_0xbdb5('0x44'),'value':_0x5194da['attrSerie2']||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da['attrs'][0x1]?_0x5194da[_0xbdb5('0x36')][0x1][_0xbdb5('0x37')]:undefined)||null},{'name':'attrSerie3','value':_0x5194da[_0xbdb5('0x45')]||(_0x5194da['attrs']&&_0x5194da[_0xbdb5('0x36')][0x2]?_0x5194da[_0xbdb5('0x36')][0x2][_0xbdb5('0x37')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x5194da[_0xbdb5('0x46')]||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da['attrs'][0x3]?_0x5194da['attrs'][0x3][_0xbdb5('0x37')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x5194da[_0xbdb5('0x47')]||(_0x5194da['attrs']&&_0x5194da[_0xbdb5('0x36')][0x0]?_0x5194da[_0xbdb5('0x36')][0x0][_0xbdb5('0x35')]:undefined)||null,'value':_0x5194da[_0xbdb5('0x48')]||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da[_0xbdb5('0x36')][0x0]?_0x5194da[_0xbdb5('0x36')][0x0][_0xbdb5('0x37')]:undefined)||null},{'name':_0xbdb5('0x49'),'value':_0x5194da[_0xbdb5('0x49')]||(_0x5194da[_0xbdb5('0x36')]&&_0x5194da[_0xbdb5('0x36')][0x1]?_0x5194da['attrs'][0x1][_0xbdb5('0x37')]:undefined)||0x0}];default:return[];}}catch(_0x1fb49e){logger['error'](_0xbdb5('0x4a'),JSON[_0xbdb5('0x4b')](_0x1fb49e));return[];}}exports[_0xbdb5('0x4c')]=function(_0x61359c,_0x586ebd){if(_0x61359c[_0xbdb5('0x4d')]){_0x61359c[_0xbdb5('0x4d')][_0xbdb5('0x36')]=widgetAttributes(_0x61359c[_0xbdb5('0x4d')]);}return db[_0xbdb5('0x32')]['create'](_0x61359c[_0xbdb5('0x4d')],{})['then'](respondWithResult(_0x586ebd,0xc9))[_0xbdb5('0x34')](handleError(_0x586ebd,null));};exports[_0xbdb5('0x4e')]=function(_0x41ea1b,_0x5bd7d1){if(_0x41ea1b[_0xbdb5('0x4d')]['id']){delete _0x41ea1b[_0xbdb5('0x4d')]['id'];}_0x41ea1b[_0xbdb5('0x4d')][_0xbdb5('0x36')]=widgetAttributes(_0x41ea1b[_0xbdb5('0x4d')]);return db[_0xbdb5('0x32')][_0xbdb5('0x33')]({'where':{'id':_0x41ea1b[_0xbdb5('0x25')]['id']}})[_0xbdb5('0x22')](handleEntityNotFound(_0x5bd7d1,null))['then'](saveUpdates(_0x41ea1b['body'],null))[_0xbdb5('0x22')](respondWithResult(_0x5bd7d1,null))['catch'](handleError(_0x5bd7d1,null));};
\ No newline at end of file
index f70c166..71542a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf11=['hook','../../mysqldb','setMaxListeners','emit'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0xbf11,0x14d));var _0x1bf1=function(_0x193bef,_0x229b65){_0x193bef=_0x193bef-0x0;var _0x4c725e=_0xbf11[_0x193bef];return _0x4c725e;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x1bf1('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1bf1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x383e0f){return function(_0x3923f1,_0x3681e4,_0x5abec7){DashboardItemEvents[_0x1bf1('0x2')](_0x383e0f+':'+_0x3923f1['id'],_0x3923f1);DashboardItemEvents[_0x1bf1('0x2')](_0x383e0f,_0x3923f1);_0x5abec7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x1bf1('0x3')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0xfaf6=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','DashboardItem'];(function(_0x1daace,_0x17a09c){var _0x583427=function(_0x443443){while(--_0x443443){_0x1daace['push'](_0x1daace['shift']());}};_0x583427(++_0x17a09c);}(_0xfaf6,0xcd));var _0x6faf=function(_0x5ad129,_0x36bd98){_0x5ad129=_0x5ad129-0x0;var _0x366514=_0xfaf6[_0x5ad129];return _0x366514;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x6faf('0x0'))['db'][_0x6faf('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x6faf('0x2')](0x0);var events={'afterCreate':_0x6faf('0x3'),'afterUpdate':_0x6faf('0x4'),'afterDestroy':_0x6faf('0x5')};function emitEvent(_0x48a72e){return function(_0x49745b,_0x1d8c3e,_0x111a35){DashboardItemEvents[_0x6faf('0x6')](_0x48a72e+':'+_0x49745b['id'],_0x49745b);DashboardItemEvents[_0x6faf('0x6')](_0x48a72e,_0x49745b);_0x111a35(null);};}for(var e in events){if(events[_0x6faf('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x6faf('0x8')]=DashboardItemEvents;
\ No newline at end of file
index 725937e..bd45454 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b1d=['request-promise','path','rimraf','../../config/environment','exports','define','DashboardItem','util','../../config/logger','api','moment','bluebird'];(function(_0x388ecd,_0x48ee38){var _0x3e150c=function(_0x4c9a6b){while(--_0x4c9a6b){_0x388ecd['push'](_0x388ecd['shift']());}};_0x3e150c(++_0x48ee38);}(_0x1b1d,0x97));var _0xd1b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b1d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd1b1('0x0'));var logger=require(_0xd1b1('0x1'))(_0xd1b1('0x2'));var moment=require(_0xd1b1('0x3'));var BPromise=require(_0xd1b1('0x4'));var rp=require(_0xd1b1('0x5'));var fs=require('fs');var path=require(_0xd1b1('0x6'));var rimraf=require(_0xd1b1('0x7'));var config=require(_0xd1b1('0x8'));var attributes=require('./dashboardItem.attributes');module[_0xd1b1('0x9')]=function(_0x384a8a,_0x20e22c){return _0x384a8a[_0xd1b1('0xa')](_0xd1b1('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x36b6=['../../config/environment','./dashboardItem.attributes','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x249e8b,_0x26570e){var _0x53172a=function(_0x5d8820){while(--_0x5d8820){_0x249e8b['push'](_0x249e8b['shift']());}};_0x53172a(++_0x26570e);}(_0x36b6,0x1bf));var _0x636b=function(_0x3ca784,_0xb748ed){_0x3ca784=_0x3ca784-0x0;var _0x325b4f=_0x36b6[_0x3ca784];return _0x325b4f;};'use strict';var _=require(_0x636b('0x0'));var util=require(_0x636b('0x1'));var logger=require(_0x636b('0x2'))('api');var moment=require(_0x636b('0x3'));var BPromise=require(_0x636b('0x4'));var rp=require(_0x636b('0x5'));var fs=require('fs');var path=require(_0x636b('0x6'));var rimraf=require(_0x636b('0x7'));var config=require(_0x636b('0x8'));var attributes=require(_0x636b('0x9'));module['exports']=function(_0x5b1543,_0x127745){return _0x5b1543[_0x636b('0xa')](_0x636b('0xb'),attributes,{'tableName':_0x636b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d2bf775..7e28116 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x552e=['code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x552e,0x1c6));var _0xe552=function(_0x359c0b,_0x2e1aa4){_0x359c0b=_0x359c0b-0x0;var _0x1e56b9=_0x552e[_0x359c0b];return _0x1e56b9;};'use strict';var _=require(_0xe552('0x0'));var util=require(_0xe552('0x1'));var moment=require('moment');var BPromise=require(_0xe552('0x2'));var rs=require(_0xe552('0x3'));var fs=require('fs');var Redis=require(_0xe552('0x4'));var db=require(_0xe552('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe552('0x6'));var config=require(_0xe552('0x7'));var jayson=require(_0xe552('0x8'));var client=jayson[_0xe552('0x9')][_0xe552('0xa')]({'port':0x232a});config[_0xe552('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe552('0xc'))(new Redis(config[_0xe552('0xb')]));require('./dashboardItem.socket')[_0xe552('0xd')](socket);function respondWithRpcPromise(_0x3552e9,_0x4ad716,_0x3bdd4d){return new BPromise(function(_0x5275c3,_0x575186){return client[_0xe552('0xe')](_0x3552e9,_0x3bdd4d)[_0xe552('0xf')](function(_0x57a6ca){logger['info'](_0xe552('0x10'),_0x4ad716,_0xe552('0x11'));logger[_0xe552('0x12')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x4ad716,_0xe552('0x11'),JSON[_0xe552('0x13')](_0x57a6ca));if(_0x57a6ca[_0xe552('0x14')]){if(_0x57a6ca[_0xe552('0x14')][_0xe552('0x15')]===0x1f4){logger[_0xe552('0x14')]('DashboardItem,\x20%s,\x20%s',_0x4ad716,_0x57a6ca[_0xe552('0x14')][_0xe552('0x16')]);return _0x575186(_0x57a6ca[_0xe552('0x14')][_0xe552('0x16')]);}logger[_0xe552('0x14')]('DashboardItem,\x20%s,\x20%s',_0x4ad716,_0x57a6ca[_0xe552('0x14')][_0xe552('0x16')]);return _0x5275c3(_0x57a6ca[_0xe552('0x14')][_0xe552('0x16')]);}else{logger[_0xe552('0x17')](_0xe552('0x10'),_0x4ad716,_0xe552('0x11'));_0x5275c3(_0x57a6ca[_0xe552('0x18')][_0xe552('0x16')]);}})['catch'](function(_0x32e548){logger['error'](_0xe552('0x10'),_0x4ad716,_0x32e548);_0x575186(_0x32e548);});});}
\ No newline at end of file
+var _0x586c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3d34f0,_0x4a5dc0){var _0x135ecd=function(_0x9a81d5){while(--_0x9a81d5){_0x3d34f0['push'](_0x3d34f0['shift']());}};_0x135ecd(++_0x4a5dc0);}(_0x586c,0xf8));var _0xc586=function(_0x2468b5,_0x506b9e){_0x2468b5=_0x2468b5-0x0;var _0x1056e4=_0x586c[_0x2468b5];return _0x1056e4;};'use strict';var _=require(_0xc586('0x0'));var util=require('util');var moment=require(_0xc586('0x1'));var BPromise=require(_0xc586('0x2'));var rs=require(_0xc586('0x3'));var fs=require('fs');var Redis=require(_0xc586('0x4'));var db=require(_0xc586('0x5'))['db'];var utils=require(_0xc586('0x6'));var logger=require(_0xc586('0x7'))(_0xc586('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc586('0x9')][_0xc586('0xa')]({'port':0x232a});config[_0xc586('0xb')]=_[_0xc586('0xc')](config['redis'],{'host':_0xc586('0xd'),'port':0x18eb});var socket=require(_0xc586('0xe'))(new Redis(config['redis']));require(_0xc586('0xf'))[_0xc586('0x10')](socket);function respondWithRpcPromise(_0x417152,_0x13fe76,_0x40eb04){return new BPromise(function(_0x2f5ac6,_0x4f3eae){return client[_0xc586('0x11')](_0x417152,_0x40eb04)[_0xc586('0x12')](function(_0x15062f){logger[_0xc586('0x13')](_0xc586('0x14'),_0x13fe76,'request\x20sent');logger['debug'](_0xc586('0x15'),_0x13fe76,'request\x20sent',JSON[_0xc586('0x16')](_0x15062f));if(_0x15062f['error']){if(_0x15062f['error'][_0xc586('0x17')]===0x1f4){logger[_0xc586('0x18')](_0xc586('0x14'),_0x13fe76,_0x15062f['error'][_0xc586('0x19')]);return _0x4f3eae(_0x15062f['error']['message']);}logger[_0xc586('0x18')]('DashboardItem,\x20%s,\x20%s',_0x13fe76,_0x15062f[_0xc586('0x18')][_0xc586('0x19')]);return _0x2f5ac6(_0x15062f[_0xc586('0x18')][_0xc586('0x19')]);}else{logger['info'](_0xc586('0x14'),_0x13fe76,'request\x20sent');_0x2f5ac6(_0x15062f[_0xc586('0x1a')][_0xc586('0x19')]);}})[_0xc586('0x1b')](function(_0x564b6a){logger[_0xc586('0x18')](_0xc586('0x14'),_0x13fe76,_0x564b6a);_0x4f3eae(_0x564b6a);});});}
\ No newline at end of file
index 7075439..8e8c115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0e9=['removeListener','register','length','dashboardItem:','./dashboardItem.events','save','update','emit'];(function(_0x837761,_0x217266){var _0x1d5ede=function(_0x13deae){while(--_0x13deae){_0x837761['push'](_0x837761['shift']());}};_0x1d5ede(++_0x217266);}(_0xd0e9,0x1cc));var _0x9d0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0e9[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardItemEvents=require(_0x9d0e('0x0'));var events=[_0x9d0e('0x1'),'remove',_0x9d0e('0x2')];function createListener(_0x20b631,_0x70b607){return function(_0x1ececb){_0x70b607[_0x9d0e('0x3')](_0x20b631,_0x1ececb);};}function removeListener(_0x58b2d7,_0x3c66ba){return function(){DashboardItemEvents[_0x9d0e('0x4')](_0x58b2d7,_0x3c66ba);};}exports[_0x9d0e('0x5')]=function(_0x11be61){for(var _0x40752e=0x0,_0x74d1d6=events[_0x9d0e('0x6')];_0x40752e<_0x74d1d6;_0x40752e++){var _0x3cf44b=events[_0x40752e];var _0x37dc51=createListener(_0x9d0e('0x7')+_0x3cf44b,_0x11be61);DashboardItemEvents['on'](_0x3cf44b,_0x37dc51);}};
\ No newline at end of file
+var _0x070d=['length','dashboardItem:','./dashboardItem.events','save','update','emit','register'];(function(_0x128daf,_0x25701d){var _0x51cd7e=function(_0x166e48){while(--_0x166e48){_0x128daf['push'](_0x128daf['shift']());}};_0x51cd7e(++_0x25701d);}(_0x070d,0x14b));var _0xd070=function(_0x292a0b,_0x3b2a29){_0x292a0b=_0x292a0b-0x0;var _0x2f3ccc=_0x070d[_0x292a0b];return _0x2f3ccc;};'use strict';var DashboardItemEvents=require(_0xd070('0x0'));var events=[_0xd070('0x1'),'remove',_0xd070('0x2')];function createListener(_0x4ae427,_0x12e497){return function(_0x2959b4){_0x12e497[_0xd070('0x3')](_0x4ae427,_0x2959b4);};}function removeListener(_0x2a5737,_0xe711a9){return function(){DashboardItemEvents['removeListener'](_0x2a5737,_0xe711a9);};}exports[_0xd070('0x4')]=function(_0x3f69bc){for(var _0x1d0793=0x0,_0x1ca895=events[_0xd070('0x5')];_0x1d0793<_0x1ca895;_0x1d0793++){var _0x24e5b1=events[_0x1d0793];var _0x6c03da=createListener(_0xd070('0x6')+_0x24e5b1,_0x3f69bc);DashboardItemEvents['on'](_0x24e5b1,_0x6c03da);}};
\ No newline at end of file
index 25b6672..3f0de70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bd0=['post','create','delete','/:id','destroy','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','isAuthenticated','show'];(function(_0x16ac69,_0x1ae811){var _0x1c98f5=function(_0x18a188){while(--_0x18a188){_0x16ac69['push'](_0x16ac69['shift']());}};_0x1c98f5(++_0x1ae811);}(_0x7bd0,0x130));var _0x07bd=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x7bd0[_0x3a2a3c];return _0x50ac9a;};'use strict';var multer=require('multer');var util=require(_0x07bd('0x0'));var path=require('path');var timeout=require(_0x07bd('0x1'));var express=require('express');var router=express[_0x07bd('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x07bd('0x3'));var config=require(_0x07bd('0x4'));var controller=require(_0x07bd('0x5'));router['get']('/:id',auth[_0x07bd('0x6')](),controller[_0x07bd('0x7')]);router[_0x07bd('0x8')]('/',auth[_0x07bd('0x6')](),controller[_0x07bd('0x9')]);router['put']('/:id',auth[_0x07bd('0x6')](),controller['update']);router[_0x07bd('0xa')](_0x07bd('0xb'),auth[_0x07bd('0x6')](),controller[_0x07bd('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0x5f41=['../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','show','post','update','delete','isAuthenticated','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x19d7e1,_0x4329dd){var _0x3e475a=function(_0xf28abb){while(--_0xf28abb){_0x19d7e1['push'](_0x19d7e1['shift']());}};_0x3e475a(++_0x4329dd);}(_0x5f41,0x16b));var _0x15f4=function(_0x2cc239,_0x38e312){_0x2cc239=_0x2cc239-0x0;var _0x1a47af=_0x5f41[_0x2cc239];return _0x1a47af;};'use strict';var multer=require(_0x15f4('0x0'));var util=require(_0x15f4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x15f4('0x2'));var router=express[_0x15f4('0x3')]();var fs_extra=require(_0x15f4('0x4'));var auth=require(_0x15f4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x15f4('0x6'));var controller=require(_0x15f4('0x7'));router['get'](_0x15f4('0x8'),auth['isAuthenticated'](),controller[_0x15f4('0x9')]);router[_0x15f4('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x15f4('0x8'),auth['isAuthenticated'](),controller[_0x15f4('0xb')]);router[_0x15f4('0xc')](_0x15f4('0x8'),auth[_0x15f4('0xd')](),controller[_0x15f4('0xe')]);module[_0x15f4('0xf')]=router;
\ No newline at end of file
index 1cce8ee..87bb5d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cbe=['third','STRING','ENUM'];(function(_0x5919a1,_0x226ff9){var _0x5a341=function(_0x16ff29){while(--_0x16ff29){_0x5919a1['push'](_0x5919a1['shift']());}};_0x5a341(++_0x226ff9);}(_0x7cbe,0x10f));var _0xe7cb=function(_0x342299,_0x307e1c){_0x342299=_0x342299-0x0;var _0xf1dfd2=_0x7cbe[_0x342299];return _0xf1dfd2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7cb('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0xe7cb('0x1')]('first','second',_0xe7cb('0x2')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xe7cb('0x0')]}};
\ No newline at end of file
+var _0x4263=['first','second','third','sequelize','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4263,0x87));var _0x3426=function(_0x526fb1,_0x1d0359){_0x526fb1=_0x526fb1-0x0;var _0x33582f=_0x4263[_0x526fb1];return _0x33582f;};'use strict';var Sequelize=require(_0x3426('0x0'));module[_0x3426('0x1')]={'name':{'type':Sequelize[_0x3426('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x3426('0x3'),_0x3426('0x4'),_0x3426('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x3426('0x2')]}};
\ No newline at end of file
index 77e1917..dca60d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffde=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','then','destroy','Dispositions','UserProfileResource','error','name','map','Disposition','rawAttributes','fieldName','type','key','keys','filters','intersection','query','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2f7154,_0x1c2c71){var _0x12a260=function(_0x2718d8){while(--_0x2718d8){_0x2f7154['push'](_0x2f7154['shift']());}};_0x12a260(++_0x1c2c71);}(_0xffde,0x9f));var _0xeffd=function(_0x3707ee,_0x37f1d8){_0x3707ee=_0x3707ee-0x0;var _0x5a80ba=_0xffde[_0x3707ee];return _0x5a80ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeffd('0x0'));var zipdir=require(_0xeffd('0x1'));var jsonpatch=require(_0xeffd('0x2'));var rp=require(_0xeffd('0x3'));var moment=require(_0xeffd('0x4'));var BPromise=require(_0xeffd('0x5'));var Mustache=require(_0xeffd('0x6'));var util=require(_0xeffd('0x7'));var path=require('path');var sox=require(_0xeffd('0x8'));var csv=require(_0xeffd('0x9'));var ejs=require(_0xeffd('0xa'));var fs=require('fs');var fs_extra=require(_0xeffd('0xb'));var _=require(_0xeffd('0xc'));var squel=require(_0xeffd('0xd'));var crypto=require('crypto');var jsforce=require(_0xeffd('0xe'));var deskjs=require(_0xeffd('0xf'));var toCsv=require(_0xeffd('0x9'));var querystring=require(_0xeffd('0x10'));var Papa=require(_0xeffd('0x11'));var Redis=require(_0xeffd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xeffd('0x13'));var as=require(_0xeffd('0x14'));var hardwareService=require(_0xeffd('0x15'));var logger=require(_0xeffd('0x16'))(_0xeffd('0x17'));var utils=require(_0xeffd('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xeffd('0x19'));var db=require(_0xeffd('0x1a'))['db'];function respondWithStatusCode(_0x13f59a,_0x4945d4){_0x4945d4=_0x4945d4||0xcc;return function(_0x4c0a87){if(_0x4c0a87){return _0x13f59a[_0xeffd('0x1b')](_0x4945d4);}return _0x13f59a['status'](_0x4945d4)[_0xeffd('0x1c')]();};}function respondWithResult(_0x2b53aa,_0x1651a1){_0x1651a1=_0x1651a1||0xc8;return function(_0x346de3){if(_0x346de3){return _0x2b53aa[_0xeffd('0x1d')](_0x1651a1)[_0xeffd('0x1e')](_0x346de3);}};}function respondWithFilteredResult(_0x2f45ba,_0x41f77d){return function(_0x40d2c1){if(_0x40d2c1){var _0x3943b8=typeof _0x41f77d[_0xeffd('0x1f')]==='undefined'&&typeof _0x41f77d[_0xeffd('0x20')]===_0xeffd('0x21');var _0x4bbbe0=_0x40d2c1[_0xeffd('0x22')];var _0x1fd60f=_0x3943b8?0x0:_0x41f77d[_0xeffd('0x1f')];var _0x4625b5=_0x3943b8?_0x40d2c1[_0xeffd('0x22')]:_0x41f77d[_0xeffd('0x1f')]+_0x41f77d[_0xeffd('0x20')];var _0x10e3f7;if(_0x4625b5>=_0x4bbbe0){_0x4625b5=_0x4bbbe0;_0x10e3f7=0xc8;}else{_0x10e3f7=0xce;}_0x2f45ba[_0xeffd('0x1d')](_0x10e3f7);return _0x2f45ba[_0xeffd('0x23')](_0xeffd('0x24'),_0x1fd60f+'-'+_0x4625b5+'/'+_0x4bbbe0)[_0xeffd('0x1e')](_0x40d2c1);}return null;};}function patchUpdates(_0x67efa4){return function(_0x58dc3e){try{jsonpatch[_0xeffd('0x25')](_0x58dc3e,_0x67efa4,!![]);}catch(_0x1f000e){return BPromise['reject'](_0x1f000e);}return _0x58dc3e['save']();};}function saveUpdates(_0x5bbea2,_0x489b0b){return function(_0x47a701){if(_0x47a701){return _0x47a701['update'](_0x5bbea2)[_0xeffd('0x26')](function(_0x4631dd){return _0x4631dd;});}return null;};}function removeEntity(_0x2d053b,_0x2028a1){return function(_0x3b921f){if(_0x3b921f){return _0x3b921f[_0xeffd('0x27')]()[_0xeffd('0x26')](function(){var _0x3774ce=_0x3b921f['get']({'plain':!![]});var _0x3f38a1=_0xeffd('0x28');return db[_0xeffd('0x29')][_0xeffd('0x27')]({'where':{'type':_0x3f38a1,'resourceId':_0x3774ce['id']}})['then'](function(){return _0x3b921f;});})[_0xeffd('0x26')](function(){_0x2d053b[_0xeffd('0x1d')](0xcc)[_0xeffd('0x1c')]();});}};}function handleEntityNotFound(_0x5b8108,_0x543a87){return function(_0x1fe580){if(!_0x1fe580){_0x5b8108[_0xeffd('0x1b')](0x194);}return _0x1fe580;};}function handleError(_0x391aff,_0x3f6b92){_0x3f6b92=_0x3f6b92||0x1f4;return function(_0x5b7084){logger[_0xeffd('0x2a')](_0x5b7084['stack']);if(_0x5b7084[_0xeffd('0x2b')]){delete _0x5b7084['name'];}_0x391aff[_0xeffd('0x1d')](_0x3f6b92)['send'](_0x5b7084);};}exports['index']=function(_0x4831b9,_0x100dc1){var _0x2f2e0f={},_0x3845ac={},_0x30a768={'count':0x0,'rows':[]};var _0x430602=_[_0xeffd('0x2c')](db[_0xeffd('0x2d')][_0xeffd('0x2e')],function(_0x403123){return{'name':_0x403123[_0xeffd('0x2f')],'type':_0x403123[_0xeffd('0x30')][_0xeffd('0x31')]};});_0x3845ac['model']=_[_0xeffd('0x2c')](_0x430602,'name');_0x3845ac['query']=_[_0xeffd('0x32')](_0x4831b9['query']);_0x3845ac[_0xeffd('0x33')]=_[_0xeffd('0x34')](_0x3845ac['model'],_0x3845ac[_0xeffd('0x35')]);_0x2f2e0f[_0xeffd('0x36')]=_[_0xeffd('0x34')](_0x3845ac[_0xeffd('0x37')],qs[_0xeffd('0x38')](_0x4831b9[_0xeffd('0x35')][_0xeffd('0x38')]));_0x2f2e0f[_0xeffd('0x36')]=_0x2f2e0f['attributes']['length']?_0x2f2e0f[_0xeffd('0x36')]:_0x3845ac['model'];if(!_0x4831b9[_0xeffd('0x35')][_0xeffd('0x39')](_0xeffd('0x3a'))){_0x2f2e0f[_0xeffd('0x20')]=qs[_0xeffd('0x20')](_0x4831b9[_0xeffd('0x35')][_0xeffd('0x20')]);_0x2f2e0f[_0xeffd('0x1f')]=qs[_0xeffd('0x1f')](_0x4831b9['query'][_0xeffd('0x1f')]);}_0x2f2e0f[_0xeffd('0x3b')]=qs['sort'](_0x4831b9['query'][_0xeffd('0x3c')]);_0x2f2e0f[_0xeffd('0x3d')]=qs['filters'](_['pick'](_0x4831b9[_0xeffd('0x35')],_0x3845ac[_0xeffd('0x33')]),_0x430602);if(_0x4831b9['query'][_0xeffd('0x3e')]){_0x2f2e0f[_0xeffd('0x3d')]=_['merge'](_0x2f2e0f['where'],{'$or':_[_0xeffd('0x2c')](_0x430602,function(_0xb6f8eb){if(_0xb6f8eb[_0xeffd('0x30')]!==_0xeffd('0x3f')){var _0xc674a7={};_0xc674a7[_0xb6f8eb[_0xeffd('0x2b')]]={'$like':'%'+_0x4831b9[_0xeffd('0x35')][_0xeffd('0x3e')]+'%'};return _0xc674a7;}})});}_0x2f2e0f=_[_0xeffd('0x40')]({},_0x2f2e0f,_0x4831b9['options']);var _0x57d7a3={'where':_0x2f2e0f[_0xeffd('0x3d')]};return db[_0xeffd('0x2d')][_0xeffd('0x22')](_0x57d7a3)[_0xeffd('0x26')](function(_0x3c6dba){_0x30a768[_0xeffd('0x22')]=_0x3c6dba;if(_0x4831b9[_0xeffd('0x35')][_0xeffd('0x41')]){_0x2f2e0f[_0xeffd('0x42')]=[{'all':!![]}];}return db[_0xeffd('0x2d')][_0xeffd('0x43')](_0x2f2e0f);})[_0xeffd('0x26')](function(_0x15ea62){_0x30a768[_0xeffd('0x44')]=_0x15ea62;return _0x30a768;})[_0xeffd('0x26')](respondWithFilteredResult(_0x100dc1,_0x2f2e0f))[_0xeffd('0x45')](handleError(_0x100dc1,null));};exports[_0xeffd('0x46')]=function(_0x2c16b8,_0x411bfc){var _0x4c419a={'raw':!![],'where':{'id':_0x2c16b8['params']['id']}},_0x40d712={};_0x40d712[_0xeffd('0x37')]=_[_0xeffd('0x32')](db[_0xeffd('0x2d')][_0xeffd('0x2e')]);_0x40d712[_0xeffd('0x35')]=_[_0xeffd('0x32')](_0x2c16b8[_0xeffd('0x35')]);_0x40d712[_0xeffd('0x33')]=_['intersection'](_0x40d712[_0xeffd('0x37')],_0x40d712[_0xeffd('0x35')]);_0x4c419a[_0xeffd('0x36')]=_[_0xeffd('0x34')](_0x40d712[_0xeffd('0x37')],qs[_0xeffd('0x38')](_0x2c16b8[_0xeffd('0x35')][_0xeffd('0x38')]));_0x4c419a[_0xeffd('0x36')]=_0x4c419a['attributes'][_0xeffd('0x47')]?_0x4c419a[_0xeffd('0x36')]:_0x40d712[_0xeffd('0x37')];if(_0x2c16b8['query']['includeAll']){_0x4c419a['include']=[{'all':!![]}];}_0x4c419a=_['merge']({},_0x4c419a,_0x2c16b8['options']);return db[_0xeffd('0x2d')][_0xeffd('0x48')](_0x4c419a)['then'](handleEntityNotFound(_0x411bfc,null))['then'](respondWithResult(_0x411bfc,null))[_0xeffd('0x45')](handleError(_0x411bfc,null));};exports['create']=function(_0x57dd3f,_0x185d6b){return db[_0xeffd('0x2d')][_0xeffd('0x49')](_0x57dd3f['body'],{})['then'](function(_0x3822ff){var _0x5d3f73=_0x57dd3f['user']['get']({'plain':!![]});if(!_0x5d3f73)throw new Error(_0xeffd('0x4a'));if(_0x5d3f73[_0xeffd('0x4b')]===_0xeffd('0x4c')){var _0x377d29=_0x3822ff[_0xeffd('0x4d')]({'plain':!![]});var _0x30dc22=_0xeffd('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x30dc22,'userProfileId':_0x5d3f73[_0xeffd('0x4e')]},'raw':!![]})[_0xeffd('0x26')](function(_0x44b01d){if(_0x44b01d&&_0x44b01d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x377d29[_0xeffd('0x2b')],'resourceId':_0x377d29['id'],'type':_0x44b01d[_0xeffd('0x2b')],'sectionId':_0x44b01d['id']},{})[_0xeffd('0x26')](function(){return _0x3822ff;});}else{return _0x3822ff;}})[_0xeffd('0x45')](function(_0x55bb9e){logger[_0xeffd('0x2a')](_0xeffd('0x4f'),_0x55bb9e);throw _0x55bb9e;});}return _0x3822ff;})['then'](respondWithResult(_0x185d6b,0xc9))[_0xeffd('0x45')](handleError(_0x185d6b,null));};exports['update']=function(_0x5bb85b,_0x4d8750){if(_0x5bb85b[_0xeffd('0x50')]['id']){delete _0x5bb85b[_0xeffd('0x50')]['id'];}return db[_0xeffd('0x2d')][_0xeffd('0x48')]({'where':{'id':_0x5bb85b[_0xeffd('0x51')]['id']}})[_0xeffd('0x26')](handleEntityNotFound(_0x4d8750,null))[_0xeffd('0x26')](saveUpdates(_0x5bb85b[_0xeffd('0x50')],null))[_0xeffd('0x26')](respondWithResult(_0x4d8750,null))[_0xeffd('0x45')](handleError(_0x4d8750,null));};exports[_0xeffd('0x27')]=function(_0x120ec5,_0xd4bb31){return db['Disposition'][_0xeffd('0x48')]({'where':{'id':_0x120ec5[_0xeffd('0x51')]['id']}})[_0xeffd('0x26')](handleEntityNotFound(_0xd4bb31,null))[_0xeffd('0x26')](removeEntity(_0xd4bb31,null))[_0xeffd('0x45')](handleError(_0xd4bb31,null));};
\ No newline at end of file
+var _0x4af9=['reject','update','then','destroy','get','Dispositions','UserProfileResource','error','name','send','index','map','Disposition','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x42c0aa,_0x5590c0){var _0x512976=function(_0x35098d){while(--_0x35098d){_0x42c0aa['push'](_0x42c0aa['shift']());}};_0x512976(++_0x5590c0);}(_0x4af9,0x12c));var _0x94af=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4af9[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x94af('0x0'));var rimraf=require(_0x94af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x94af('0x2'));var moment=require(_0x94af('0x3'));var BPromise=require(_0x94af('0x4'));var Mustache=require(_0x94af('0x5'));var util=require(_0x94af('0x6'));var path=require(_0x94af('0x7'));var sox=require(_0x94af('0x8'));var csv=require('to-csv');var ejs=require(_0x94af('0x9'));var fs=require('fs');var fs_extra=require(_0x94af('0xa'));var _=require(_0x94af('0xb'));var squel=require(_0x94af('0xc'));var crypto=require('crypto');var jsforce=require(_0x94af('0xd'));var deskjs=require(_0x94af('0xe'));var toCsv=require(_0x94af('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x94af('0x10'));var authService=require(_0x94af('0x11'));var qs=require(_0x94af('0x12'));var as=require(_0x94af('0x13'));var hardwareService=require(_0x94af('0x14'));var logger=require(_0x94af('0x15'))('api');var utils=require(_0x94af('0x16'));var config=require(_0x94af('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x94af('0x18'))['db'];function respondWithStatusCode(_0x36fb24,_0x1621a9){_0x1621a9=_0x1621a9||0xcc;return function(_0x38108a){if(_0x38108a){return _0x36fb24[_0x94af('0x19')](_0x1621a9);}return _0x36fb24['status'](_0x1621a9)[_0x94af('0x1a')]();};}function respondWithResult(_0x4dd013,_0x598dff){_0x598dff=_0x598dff||0xc8;return function(_0x4d080c){if(_0x4d080c){return _0x4dd013[_0x94af('0x1b')](_0x598dff)[_0x94af('0x1c')](_0x4d080c);}};}function respondWithFilteredResult(_0x2313a1,_0x356a17){return function(_0x49eb9f){if(_0x49eb9f){var _0x275c63=typeof _0x356a17[_0x94af('0x1d')]==='undefined'&&typeof _0x356a17[_0x94af('0x1e')]===_0x94af('0x1f');var _0x11ee85=_0x49eb9f[_0x94af('0x20')];var _0x414bc9=_0x275c63?0x0:_0x356a17[_0x94af('0x1d')];var _0x19369b=_0x275c63?_0x49eb9f[_0x94af('0x20')]:_0x356a17[_0x94af('0x1d')]+_0x356a17[_0x94af('0x1e')];var _0x4a9d75;if(_0x19369b>=_0x11ee85){_0x19369b=_0x11ee85;_0x4a9d75=0xc8;}else{_0x4a9d75=0xce;}_0x2313a1['status'](_0x4a9d75);return _0x2313a1[_0x94af('0x21')](_0x94af('0x22'),_0x414bc9+'-'+_0x19369b+'/'+_0x11ee85)[_0x94af('0x1c')](_0x49eb9f);}return null;};}function patchUpdates(_0x17bfcc){return function(_0x472960){try{jsonpatch[_0x94af('0x23')](_0x472960,_0x17bfcc,!![]);}catch(_0x4adbea){return BPromise[_0x94af('0x24')](_0x4adbea);}return _0x472960['save']();};}function saveUpdates(_0x3b7cb9,_0x587ddb){return function(_0xa0cf1a){if(_0xa0cf1a){return _0xa0cf1a[_0x94af('0x25')](_0x3b7cb9)[_0x94af('0x26')](function(_0x521828){return _0x521828;});}return null;};}function removeEntity(_0x3f22f3,_0x2434fe){return function(_0x906599){if(_0x906599){return _0x906599[_0x94af('0x27')]()['then'](function(){var _0x1eb440=_0x906599[_0x94af('0x28')]({'plain':!![]});var _0x24e8a0=_0x94af('0x29');return db[_0x94af('0x2a')][_0x94af('0x27')]({'where':{'type':_0x24e8a0,'resourceId':_0x1eb440['id']}})[_0x94af('0x26')](function(){return _0x906599;});})[_0x94af('0x26')](function(){_0x3f22f3[_0x94af('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ac64d,_0x55d34a){return function(_0x12f76c){if(!_0x12f76c){_0x1ac64d[_0x94af('0x19')](0x194);}return _0x12f76c;};}function handleError(_0x459d4b,_0x4898ac){_0x4898ac=_0x4898ac||0x1f4;return function(_0x16d7cf){logger[_0x94af('0x2b')](_0x16d7cf['stack']);if(_0x16d7cf[_0x94af('0x2c')]){delete _0x16d7cf[_0x94af('0x2c')];}_0x459d4b[_0x94af('0x1b')](_0x4898ac)[_0x94af('0x2d')](_0x16d7cf);};}exports[_0x94af('0x2e')]=function(_0x37ad3f,_0x54a14a){var _0x3ac99c={},_0x538a0b={},_0x4fb558={'count':0x0,'rows':[]};var _0x32f0f9=_[_0x94af('0x2f')](db[_0x94af('0x30')][_0x94af('0x31')],function(_0x1ce03f){return{'name':_0x1ce03f['fieldName'],'type':_0x1ce03f[_0x94af('0x32')][_0x94af('0x33')]};});_0x538a0b['model']=_[_0x94af('0x2f')](_0x32f0f9,_0x94af('0x2c'));_0x538a0b[_0x94af('0x34')]=_[_0x94af('0x35')](_0x37ad3f[_0x94af('0x34')]);_0x538a0b[_0x94af('0x36')]=_[_0x94af('0x37')](_0x538a0b['model'],_0x538a0b[_0x94af('0x34')]);_0x3ac99c[_0x94af('0x38')]=_[_0x94af('0x37')](_0x538a0b[_0x94af('0x39')],qs[_0x94af('0x3a')](_0x37ad3f[_0x94af('0x34')][_0x94af('0x3a')]));_0x3ac99c[_0x94af('0x38')]=_0x3ac99c[_0x94af('0x38')]['length']?_0x3ac99c[_0x94af('0x38')]:_0x538a0b[_0x94af('0x39')];if(!_0x37ad3f[_0x94af('0x34')][_0x94af('0x3b')](_0x94af('0x3c'))){_0x3ac99c['limit']=qs[_0x94af('0x1e')](_0x37ad3f[_0x94af('0x34')][_0x94af('0x1e')]);_0x3ac99c[_0x94af('0x1d')]=qs['offset'](_0x37ad3f[_0x94af('0x34')]['offset']);}_0x3ac99c['order']=qs['sort'](_0x37ad3f[_0x94af('0x34')][_0x94af('0x3d')]);_0x3ac99c['where']=qs[_0x94af('0x36')](_['pick'](_0x37ad3f[_0x94af('0x34')],_0x538a0b['filters']),_0x32f0f9);if(_0x37ad3f[_0x94af('0x34')][_0x94af('0x3e')]){_0x3ac99c[_0x94af('0x3f')]=_[_0x94af('0x40')](_0x3ac99c[_0x94af('0x3f')],{'$or':_[_0x94af('0x2f')](_0x32f0f9,function(_0x429d4c){if(_0x429d4c[_0x94af('0x32')]!==_0x94af('0x41')){var _0x42625b={};_0x42625b[_0x429d4c[_0x94af('0x2c')]]={'$like':'%'+_0x37ad3f['query'][_0x94af('0x3e')]+'%'};return _0x42625b;}})});}_0x3ac99c=_[_0x94af('0x40')]({},_0x3ac99c,_0x37ad3f['options']);var _0x1f9295={'where':_0x3ac99c['where']};return db[_0x94af('0x30')][_0x94af('0x20')](_0x1f9295)[_0x94af('0x26')](function(_0x4cf8b9){_0x4fb558[_0x94af('0x20')]=_0x4cf8b9;if(_0x37ad3f['query'][_0x94af('0x42')]){_0x3ac99c[_0x94af('0x43')]=[{'all':!![]}];}return db['Disposition'][_0x94af('0x44')](_0x3ac99c);})[_0x94af('0x26')](function(_0x10d45b){_0x4fb558[_0x94af('0x45')]=_0x10d45b;return _0x4fb558;})[_0x94af('0x26')](respondWithFilteredResult(_0x54a14a,_0x3ac99c))[_0x94af('0x46')](handleError(_0x54a14a,null));};exports[_0x94af('0x47')]=function(_0x35cdaa,_0x5c416d){var _0x24148c={'raw':!![],'where':{'id':_0x35cdaa[_0x94af('0x48')]['id']}},_0x49c50d={};_0x49c50d[_0x94af('0x39')]=_[_0x94af('0x35')](db[_0x94af('0x30')][_0x94af('0x31')]);_0x49c50d[_0x94af('0x34')]=_['keys'](_0x35cdaa[_0x94af('0x34')]);_0x49c50d[_0x94af('0x36')]=_[_0x94af('0x37')](_0x49c50d[_0x94af('0x39')],_0x49c50d['query']);_0x24148c[_0x94af('0x38')]=_[_0x94af('0x37')](_0x49c50d[_0x94af('0x39')],qs[_0x94af('0x3a')](_0x35cdaa[_0x94af('0x34')][_0x94af('0x3a')]));_0x24148c['attributes']=_0x24148c['attributes'][_0x94af('0x49')]?_0x24148c[_0x94af('0x38')]:_0x49c50d[_0x94af('0x39')];if(_0x35cdaa[_0x94af('0x34')][_0x94af('0x42')]){_0x24148c[_0x94af('0x43')]=[{'all':!![]}];}_0x24148c=_['merge']({},_0x24148c,_0x35cdaa[_0x94af('0x4a')]);return db[_0x94af('0x30')][_0x94af('0x4b')](_0x24148c)[_0x94af('0x26')](handleEntityNotFound(_0x5c416d,null))[_0x94af('0x26')](respondWithResult(_0x5c416d,null))[_0x94af('0x46')](handleError(_0x5c416d,null));};exports[_0x94af('0x4c')]=function(_0x5ed5b6,_0x321cf6){return db['Disposition'][_0x94af('0x4c')](_0x5ed5b6[_0x94af('0x4d')],{})[_0x94af('0x26')](function(_0x1a976a){var _0x11d373=_0x5ed5b6[_0x94af('0x4e')][_0x94af('0x28')]({'plain':!![]});if(!_0x11d373)throw new Error(_0x94af('0x4f'));if(_0x11d373[_0x94af('0x50')]===_0x94af('0x4e')){var _0x3c0945=_0x1a976a[_0x94af('0x28')]({'plain':!![]});var _0x3bb8ce='Dispositions';return db[_0x94af('0x51')][_0x94af('0x4b')]({'where':{'name':_0x3bb8ce,'userProfileId':_0x11d373[_0x94af('0x52')]},'raw':!![]})[_0x94af('0x26')](function(_0x3a1740){if(_0x3a1740&&_0x3a1740[_0x94af('0x53')]===0x0){return db[_0x94af('0x2a')]['create']({'name':_0x3c0945[_0x94af('0x2c')],'resourceId':_0x3c0945['id'],'type':_0x3a1740[_0x94af('0x2c')],'sectionId':_0x3a1740['id']},{})[_0x94af('0x26')](function(){return _0x1a976a;});}else{return _0x1a976a;}})[_0x94af('0x46')](function(_0x4e4494){logger[_0x94af('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e4494);throw _0x4e4494;});}return _0x1a976a;})[_0x94af('0x26')](respondWithResult(_0x321cf6,0xc9))[_0x94af('0x46')](handleError(_0x321cf6,null));};exports['update']=function(_0xa6bb2e,_0x5073d8){if(_0xa6bb2e['body']['id']){delete _0xa6bb2e['body']['id'];}return db[_0x94af('0x30')][_0x94af('0x4b')]({'where':{'id':_0xa6bb2e[_0x94af('0x48')]['id']}})[_0x94af('0x26')](handleEntityNotFound(_0x5073d8,null))['then'](saveUpdates(_0xa6bb2e[_0x94af('0x4d')],null))[_0x94af('0x26')](respondWithResult(_0x5073d8,null))[_0x94af('0x46')](handleError(_0x5073d8,null));};exports[_0x94af('0x27')]=function(_0x2a5bee,_0x5965b){return db[_0x94af('0x30')][_0x94af('0x4b')]({'where':{'id':_0x2a5bee[_0x94af('0x48')]['id']}})[_0x94af('0x26')](handleEntityNotFound(_0x5965b,null))[_0x94af('0x26')](removeEntity(_0x5965b,null))[_0x94af('0x46')](handleError(_0x5965b,null));};
\ No newline at end of file
index d56cc4b..1dd0e93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd87b=['name_sms','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_mail'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd87b,0x1af));var _0xbd87=function(_0x4f8906,_0x43873f){_0x4f8906=_0x4f8906-0x0;var _0x234773=_0xd87b[_0x4f8906];return _0x234773;};'use strict';var _=require(_0xbd87('0x0'));var util=require(_0xbd87('0x1'));var logger=require(_0xbd87('0x2'))(_0xbd87('0x3'));var moment=require(_0xbd87('0x4'));var BPromise=require(_0xbd87('0x5'));var rp=require(_0xbd87('0x6'));var fs=require('fs');var path=require(_0xbd87('0x7'));var rimraf=require(_0xbd87('0x8'));var config=require(_0xbd87('0x9'));var attributes=require(_0xbd87('0xa'));module[_0xbd87('0xb')]=function(_0x5eb2c0,_0xbb67a){return _0x5eb2c0['define'](_0xbd87('0xc'),attributes,{'tableName':_0xbd87('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xbd87('0xe'),'fields':[_0xbd87('0xf'),_0xbd87('0x10')]},{'unique':!![],'name':_0xbd87('0x11'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0xbd87('0x12'),'fields':['name','MailAccountId']},{'unique':!![],'name':_0xbd87('0x13'),'fields':[_0xbd87('0xf'),'SmsAccountId']},{'unique':!![],'name':_0xbd87('0x14'),'fields':[_0xbd87('0xf'),_0xbd87('0x15')]},{'unique':!![],'name':_0xbd87('0x16'),'fields':[_0xbd87('0xf'),'OpenchannelAccountId']},{'unique':!![],'name':_0xbd87('0x17'),'fields':[_0xbd87('0xf'),_0xbd87('0x18')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdaf8=['ListId','name_chat','ChatWebsiteId','name_mail','name','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdaf8,0x1bc));var _0x8daf=function(_0x1c22d4,_0x2781cf){_0x1c22d4=_0x1c22d4-0x0;var _0x51ef64=_0xdaf8[_0x1c22d4];return _0x51ef64;};'use strict';var _=require(_0x8daf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8daf('0x1'));var moment=require(_0x8daf('0x2'));var BPromise=require('bluebird');var rp=require(_0x8daf('0x3'));var fs=require('fs');var path=require(_0x8daf('0x4'));var rimraf=require(_0x8daf('0x5'));var config=require(_0x8daf('0x6'));var attributes=require(_0x8daf('0x7'));module[_0x8daf('0x8')]=function(_0x3a965c,_0x2570fd){return _0x3a965c[_0x8daf('0x9')](_0x8daf('0xa'),attributes,{'tableName':_0x8daf('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x8daf('0xc')]},{'unique':!![],'name':_0x8daf('0xd'),'fields':['name',_0x8daf('0xe')]},{'unique':!![],'name':_0x8daf('0xf'),'fields':[_0x8daf('0x10'),_0x8daf('0x11')]},{'unique':!![],'name':_0x8daf('0x12'),'fields':[_0x8daf('0x10'),'SmsAccountId']},{'unique':!![],'name':_0x8daf('0x13'),'fields':[_0x8daf('0x10'),_0x8daf('0x14')]},{'unique':!![],'name':_0x8daf('0x15'),'fields':['name',_0x8daf('0x16')]},{'unique':!![],'name':_0x8daf('0x17'),'fields':[_0x8daf('0x10'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
index 6db8e76..90d2675 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(_0x4cd2ef,_0x4cbed3){var _0x5b75ff=function(_0x12f347){while(--_0x12f347){_0x4cd2ef['push'](_0x4cd2ef['shift']());}};_0x5b75ff(++_0x4cbed3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','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(_0x42deec,_0xade192){var _0x4b848b=function(_0x544fb5){while(--_0x544fb5){_0x42deec['push'](_0x42deec['shift']());}};_0x4b848b(++_0xade192);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 635c758..737224f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17f7=['create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','post','isAuthenticated'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x17f7,0x1bf));var _0x717f=function(_0x31abe4,_0x4ae7b6){_0x31abe4=_0x31abe4-0x0;var _0x530301=_0x17f7[_0x31abe4];return _0x530301;};'use strict';var multer=require(_0x717f('0x0'));var util=require(_0x717f('0x1'));var path=require(_0x717f('0x2'));var timeout=require('connect-timeout');var express=require(_0x717f('0x3'));var router=express[_0x717f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x717f('0x5'));var interaction=require(_0x717f('0x6'));var config=require(_0x717f('0x7'));var controller=require('./disposition.controller');router[_0x717f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x717f('0x8')](_0x717f('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x717f('0xa')]('/',auth[_0x717f('0xb')](),controller[_0x717f('0xc')]);router[_0x717f('0xd')](_0x717f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x717f('0xe')](_0x717f('0x9'),auth[_0x717f('0xb')](),controller[_0x717f('0xf')]);module[_0x717f('0x10')]=router;
\ No newline at end of file
+var _0xa2e7=['connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x43e97d,_0x56a06b){var _0x424cd9=function(_0x4f574b){while(--_0x4f574b){_0x43e97d['push'](_0x43e97d['shift']());}};_0x424cd9(++_0x56a06b);}(_0xa2e7,0x95));var _0x7a2e=function(_0x517ad3,_0x3015d5){_0x517ad3=_0x517ad3-0x0;var _0x3c69d6=_0xa2e7[_0x517ad3];return _0x3c69d6;};'use strict';var multer=require(_0x7a2e('0x0'));var util=require(_0x7a2e('0x1'));var path=require(_0x7a2e('0x2'));var timeout=require(_0x7a2e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7a2e('0x4'));var auth=require(_0x7a2e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7a2e('0x6'));var controller=require(_0x7a2e('0x7'));router[_0x7a2e('0x8')]('/',auth[_0x7a2e('0x9')](),controller[_0x7a2e('0xa')]);router['get'](_0x7a2e('0xb'),auth[_0x7a2e('0x9')](),controller[_0x7a2e('0xc')]);router[_0x7a2e('0xd')]('/',auth[_0x7a2e('0x9')](),controller['create']);router[_0x7a2e('0xe')](_0x7a2e('0xb'),auth[_0x7a2e('0x9')](),controller[_0x7a2e('0xf')]);router[_0x7a2e('0x10')](_0x7a2e('0xb'),auth['isAuthenticated'](),controller[_0x7a2e('0x11')]);module[_0x7a2e('0x12')]=router;
\ No newline at end of file
index d12e317..f22efee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bec=['12000','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','14400','7200','9600'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x6bec,0x115));var _0xc6be=function(_0x3d4a6f,_0x43539a){_0x3d4a6f=_0x3d4a6f-0x0;var _0x4502d1=_0x6bec[_0x3d4a6f];return _0x4502d1;};'use strict';var Sequelize=require(_0xc6be('0x0'));module[_0xc6be('0x1')]={'name':{'type':Sequelize[_0xc6be('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc6be('0x2')]},'ecm':{'type':Sequelize[_0xc6be('0x3')]('yes','no'),'defaultValue':_0xc6be('0x4')},'headerinfo':{'type':Sequelize[_0xc6be('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xc6be('0x2')],'unique':_0xc6be('0x5')},'minrate':{'type':Sequelize[_0xc6be('0x3')](_0xc6be('0x6'),_0xc6be('0x7'),'7200','9600','12000',_0xc6be('0x8')),'defaultValue':_0xc6be('0x7')},'maxrate':{'type':Sequelize[_0xc6be('0x3')](_0xc6be('0x6'),'4800',_0xc6be('0x9'),_0xc6be('0xa'),_0xc6be('0xb'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xc6be('0xc')},'gateway':{'type':Sequelize[_0xc6be('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc6be('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc6be('0x3')]('SIP',_0xc6be('0xe'),_0xc6be('0xf'),_0xc6be('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xc6be('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc6be('0x11')],'defaultValue':function(){return _0xc6be('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc6be('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc6be('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc6be('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc6be('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc6be('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc6be('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc6be('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xc6be('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xc6be('0x13')],'defaultValue':![],'comment':_0xc6be('0x15'),'set':function(_0x2ae9e3){if(!_0x2ae9e3)this[_0xc6be('0x16')](_0xc6be('0x17'),null);this[_0xc6be('0x16')]('mandatoryDisposition',_0x2ae9e3);}}};
\ No newline at end of file
+var _0x6312=['localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','yes'];(function(_0x507a03,_0x51cc08){var _0x3627da=function(_0x223255){while(--_0x223255){_0x507a03['push'](_0x507a03['shift']());}};_0x3627da(++_0x51cc08);}(_0x6312,0x1dd));var _0x2631=function(_0x35180d,_0x324cdf){_0x35180d=_0x35180d-0x0;var _0x13467f=_0x6312[_0x35180d];return _0x13467f;};'use strict';var Sequelize=require('sequelize');module[_0x2631('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2631('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x2631('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x2631('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x2631('0x1')],'unique':_0x2631('0x3')},'minrate':{'type':Sequelize[_0x2631('0x4')](_0x2631('0x5'),_0x2631('0x6'),_0x2631('0x7'),_0x2631('0x8'),_0x2631('0x9'),_0x2631('0xa')),'defaultValue':_0x2631('0x6')},'maxrate':{'type':Sequelize[_0x2631('0x4')](_0x2631('0x5'),'4800','7200','9600',_0x2631('0x9'),_0x2631('0xa')),'defaultValue':_0x2631('0xa')},'modem':{'type':Sequelize[_0x2631('0x1')],'defaultValue':_0x2631('0xb')},'gateway':{'type':Sequelize[_0x2631('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2631('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2631('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2631('0x4')]('SIP','IAX',_0x2631('0xd'),_0x2631('0xe')),'defaultValue':_0x2631('0xf')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2631('0x10')],'defaultValue':function(){return _0x2631('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2631('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2631('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2631('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2631('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2631('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2631('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x2631('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x2631('0x12')],'defaultValue':![],'comment':_0x2631('0x14'),'set':function(_0x58868b){if(!_0x58868b)this[_0x2631('0x15')](_0x2631('0x16'),null);this['setDataValue'](_0x2631('0x17'),_0x58868b);}}};
\ No newline at end of file
index b77f94b..f004296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45af=['Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','key','model','map','keys','query','attributes','fields','hasOwnProperty','nolimit','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','include','rows','show','params','intersection','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','order','removeDispositions','CannedAnswer','getAnswers','includeAll','findAll','removeAnswers','FaxInteraction','addInteraction','ids','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','ecm','gateway','faxdetect','minrate','modem','t38timeout','FAXOPT(','Set','Wait','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','Send\x20Fax\x20failed','filename','user','Messages','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index'];(function(_0x4e936b,_0x193d71){var _0xda6dd6=function(_0x465be7){while(--_0x465be7){_0x4e936b['push'](_0x4e936b['shift']());}};_0xda6dd6(++_0x193d71);}(_0x45af,0x141));var _0xf45a=function(_0x289660,_0x1d7524){_0x289660=_0x289660-0x0;var _0x4466f2=_0x45af[_0x289660];return _0x4466f2;};'use strict';var emlformat=require(_0xf45a('0x0'));var rimraf=require(_0xf45a('0x1'));var zipdir=require(_0xf45a('0x2'));var jsonpatch=require(_0xf45a('0x3'));var rp=require(_0xf45a('0x4'));var moment=require(_0xf45a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf45a('0x6'));var util=require(_0xf45a('0x7'));var path=require(_0xf45a('0x8'));var sox=require(_0xf45a('0x9'));var csv=require(_0xf45a('0xa'));var ejs=require(_0xf45a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf45a('0xc'));var jsforce=require(_0xf45a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf45a('0xa'));var querystring=require(_0xf45a('0xe'));var Papa=require(_0xf45a('0xf'));var Redis=require(_0xf45a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf45a('0x11'));var hardwareService=require(_0xf45a('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf45a('0x13'));var db=require(_0xf45a('0x14'))['db'];config[_0xf45a('0x15')]=_[_0xf45a('0x16')](config[_0xf45a('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xf45a('0x17'))(new Redis(config['redis']));require(_0xf45a('0x18'))[_0xf45a('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf45a('0x1a')][_0xf45a('0x1b')]({'port':0x232c});var client9002=jayson[_0xf45a('0x1a')][_0xf45a('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b1bf7,_0x43d5ef,_0x464d2b,_0x3c862e){return new BPromise(function(_0x13ad3e,_0x267e12){var _0x158334=_0x3c862e||client;return _0x158334[_0xf45a('0x1c')](_0x2b1bf7,_0x464d2b)[_0xf45a('0x1d')](function(_0x9abfe){logger[_0xf45a('0x1e')](_0xf45a('0x1f'),_0x43d5ef,_0xf45a('0x20'));logger['debug'](_0xf45a('0x21'),_0x43d5ef,_0xf45a('0x20'),JSON['stringify'](_0x9abfe));if(_0x9abfe['error']){if(_0x9abfe[_0xf45a('0x22')][_0xf45a('0x23')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x43d5ef,_0x9abfe['error'][_0xf45a('0x24')]);return _0x267e12(_0x9abfe['error']['message']);}logger[_0xf45a('0x22')](_0xf45a('0x1f'),_0x43d5ef,_0x9abfe[_0xf45a('0x22')][_0xf45a('0x24')]);return _0x13ad3e(_0x9abfe[_0xf45a('0x22')][_0xf45a('0x24')]);}else{logger[_0xf45a('0x1e')](_0xf45a('0x1f'),_0x43d5ef,_0xf45a('0x20'));_0x13ad3e(_0x9abfe[_0xf45a('0x25')][_0xf45a('0x24')]);}})[_0xf45a('0x26')](function(_0x33b2b0){logger['error'](_0xf45a('0x1f'),_0x43d5ef,_0x33b2b0);_0x267e12(_0x33b2b0);});});}function respondWithStatusCode(_0x6902f2,_0x5cd9c8){_0x5cd9c8=_0x5cd9c8||0xcc;return function(_0x2eb25b){if(_0x2eb25b){return _0x6902f2[_0xf45a('0x27')](_0x5cd9c8);}return _0x6902f2[_0xf45a('0x28')](_0x5cd9c8)[_0xf45a('0x29')]();};}function respondWithResult(_0x23bd1a,_0x4e7c56){_0x4e7c56=_0x4e7c56||0xc8;return function(_0x1c3f3c){if(_0x1c3f3c){return _0x23bd1a[_0xf45a('0x28')](_0x4e7c56)[_0xf45a('0x2a')](_0x1c3f3c);}};}function respondWithFilteredResult(_0x452791,_0xb548b){return function(_0x57ac48){if(_0x57ac48){var _0x54912f=typeof _0xb548b[_0xf45a('0x2b')]===_0xf45a('0x2c')&&typeof _0xb548b[_0xf45a('0x2d')]===_0xf45a('0x2c');var _0x2b9f3f=_0x57ac48[_0xf45a('0x2e')];var _0x37264e=_0x54912f?0x0:_0xb548b[_0xf45a('0x2b')];var _0xcc967a=_0x54912f?_0x57ac48['count']:_0xb548b['offset']+_0xb548b[_0xf45a('0x2d')];var _0x3e98a7;if(_0xcc967a>=_0x2b9f3f){_0xcc967a=_0x2b9f3f;_0x3e98a7=0xc8;}else{_0x3e98a7=0xce;}_0x452791[_0xf45a('0x28')](_0x3e98a7);return _0x452791['set'](_0xf45a('0x2f'),_0x37264e+'-'+_0xcc967a+'/'+_0x2b9f3f)['json'](_0x57ac48);}return null;};}function patchUpdates(_0x3ad179){return function(_0x3b90d9){try{jsonpatch[_0xf45a('0x30')](_0x3b90d9,_0x3ad179,!![]);}catch(_0x23e910){return BPromise[_0xf45a('0x31')](_0x23e910);}return _0x3b90d9[_0xf45a('0x32')]();};}function saveUpdates(_0x638468,_0x2b3740){return function(_0x809346){if(_0x809346){return _0x809346['update'](_0x638468)['then'](function(_0x32122e){return _0x32122e;});}return null;};}function removeEntity(_0x5ab2ba,_0x199a1d){return function(_0xe7b453){if(_0xe7b453){return _0xe7b453[_0xf45a('0x33')]()[_0xf45a('0x1d')](function(){var _0x457962=_0xe7b453[_0xf45a('0x34')]({'plain':!![]});var _0x7fe7d5=_0xf45a('0x35');return db[_0xf45a('0x36')]['destroy']({'where':{'type':_0x7fe7d5,'resourceId':_0x457962['id']}})['then'](function(){return _0xe7b453;});})[_0xf45a('0x1d')](function(){_0x5ab2ba[_0xf45a('0x28')](0xcc)[_0xf45a('0x29')]();});}};}function handleEntityNotFound(_0x2d4c99,_0x16166d){return function(_0x21b90b){if(!_0x21b90b){_0x2d4c99[_0xf45a('0x27')](0x194);}return _0x21b90b;};}function handleError(_0x79e863,_0xcbd867){_0xcbd867=_0xcbd867||0x1f4;return function(_0xcf9089){logger[_0xf45a('0x22')](_0xcf9089[_0xf45a('0x37')]);if(_0xcf9089[_0xf45a('0x38')]){delete _0xcf9089[_0xf45a('0x38')];}_0x79e863[_0xf45a('0x28')](_0xcbd867)[_0xf45a('0x39')](_0xcf9089);};}exports[_0xf45a('0x3a')]=function(_0x17e33,_0x19df0c){var _0x23fcb0={'include':[{'model':db[_0xf45a('0x3b')],'as':_0xf45a('0x3c')}]},_0x33e6e1={},_0x1da569={'count':0x0,'rows':[]};var _0x3a928f=_['map'](db[_0xf45a('0x3d')][_0xf45a('0x3e')],function(_0x58d9a7){return{'name':_0x58d9a7[_0xf45a('0x3f')],'type':_0x58d9a7['type'][_0xf45a('0x40')]};});_0x33e6e1[_0xf45a('0x41')]=_[_0xf45a('0x42')](_0x3a928f,_0xf45a('0x38'));_0x33e6e1['query']=_[_0xf45a('0x43')](_0x17e33[_0xf45a('0x44')]);_0x33e6e1['filters']=_['intersection'](_0x33e6e1[_0xf45a('0x41')],_0x33e6e1[_0xf45a('0x44')]);_0x23fcb0[_0xf45a('0x45')]=_['intersection'](_0x33e6e1['model'],qs[_0xf45a('0x46')](_0x17e33[_0xf45a('0x44')]['fields']));_0x23fcb0[_0xf45a('0x45')]=_0x23fcb0['attributes']['length']?_0x23fcb0[_0xf45a('0x45')]:_0x33e6e1[_0xf45a('0x41')];if(!_0x17e33[_0xf45a('0x44')][_0xf45a('0x47')](_0xf45a('0x48'))){_0x23fcb0[_0xf45a('0x2d')]=qs[_0xf45a('0x2d')](_0x17e33[_0xf45a('0x44')][_0xf45a('0x2d')]);_0x23fcb0['offset']=qs['offset'](_0x17e33[_0xf45a('0x44')][_0xf45a('0x2b')]);}_0x23fcb0['order']=qs[_0xf45a('0x49')](_0x17e33[_0xf45a('0x44')][_0xf45a('0x49')]);_0x23fcb0['where']=qs['filters'](_[_0xf45a('0x4a')](_0x17e33[_0xf45a('0x44')],_0x33e6e1[_0xf45a('0x4b')]),_0x3a928f);if(_0x17e33[_0xf45a('0x44')]['filter']){_0x23fcb0[_0xf45a('0x4c')]=_['merge'](_0x23fcb0[_0xf45a('0x4c')],{'$or':_[_0xf45a('0x42')](_0x3a928f,function(_0x123fd6){if(_0x123fd6[_0xf45a('0x4d')]!==_0xf45a('0x4e')){var _0x577351={};_0x577351[_0x123fd6[_0xf45a('0x38')]]={'$like':'%'+_0x17e33['query'][_0xf45a('0x4f')]+'%'};return _0x577351;}})});}_0x23fcb0=_[_0xf45a('0x50')]({},_0x23fcb0,_0x17e33[_0xf45a('0x51')]);var _0x1de672={'where':_0x23fcb0['where']};return db[_0xf45a('0x3d')][_0xf45a('0x2e')](_0x1de672)[_0xf45a('0x1d')](function(_0x3e32da){_0x1da569[_0xf45a('0x2e')]=_0x3e32da;if(_0x17e33['query']['includeAll']){_0x23fcb0[_0xf45a('0x52')]=[{'all':!![]}];}return db[_0xf45a('0x3d')]['findAll'](_0x23fcb0);})[_0xf45a('0x1d')](function(_0x2d75b8){_0x1da569[_0xf45a('0x53')]=_0x2d75b8;return _0x1da569;})[_0xf45a('0x1d')](respondWithFilteredResult(_0x19df0c,_0x23fcb0))[_0xf45a('0x26')](handleError(_0x19df0c,null));};exports[_0xf45a('0x54')]=function(_0xb400db,_0x2be98e){var _0x4e05db={'raw':![],'where':{'id':_0xb400db[_0xf45a('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xf45a('0x3c')}]},_0x4250c6={};_0x4250c6[_0xf45a('0x41')]=_[_0xf45a('0x43')](db[_0xf45a('0x3d')][_0xf45a('0x3e')]);_0x4250c6['query']=_[_0xf45a('0x43')](_0xb400db['query']);_0x4250c6[_0xf45a('0x4b')]=_['intersection'](_0x4250c6[_0xf45a('0x41')],_0x4250c6[_0xf45a('0x44')]);_0x4e05db['attributes']=_[_0xf45a('0x56')](_0x4250c6[_0xf45a('0x41')],qs['fields'](_0xb400db[_0xf45a('0x44')][_0xf45a('0x46')]));_0x4e05db[_0xf45a('0x45')]=_0x4e05db[_0xf45a('0x45')][_0xf45a('0x57')]?_0x4e05db[_0xf45a('0x45')]:_0x4250c6[_0xf45a('0x41')];if(_0xb400db[_0xf45a('0x44')]['includeAll']){_0x4e05db['include']=[{'all':!![]}];}_0x4e05db=_['merge']({},_0x4e05db,_0xb400db['options']);return db[_0xf45a('0x3d')][_0xf45a('0x58')](_0x4e05db)[_0xf45a('0x1d')](handleEntityNotFound(_0x2be98e,null))[_0xf45a('0x1d')](respondWithResult(_0x2be98e,null))[_0xf45a('0x26')](handleError(_0x2be98e,null));};exports[_0xf45a('0x59')]=function(_0x4b76f9,_0x3f86f1){return db['FaxAccount']['create'](_0x4b76f9[_0xf45a('0x5a')],{})[_0xf45a('0x1d')](function(_0xbe9767){var _0x2b6cdf=_0x4b76f9['user'][_0xf45a('0x34')]({'plain':!![]});if(!_0x2b6cdf)throw new Error(_0xf45a('0x5b'));if(_0x2b6cdf[_0xf45a('0x5c')]==='user'){var _0x4e0ceb=_0xbe9767[_0xf45a('0x34')]({'plain':!![]});var _0x19f90f='FaxAccounts';return db[_0xf45a('0x5d')]['find']({'where':{'name':_0x19f90f,'userProfileId':_0x2b6cdf[_0xf45a('0x5e')]},'raw':!![]})[_0xf45a('0x1d')](function(_0x28a025){if(_0x28a025&&_0x28a025['autoAssociation']===0x0){return db[_0xf45a('0x36')]['create']({'name':_0x4e0ceb[_0xf45a('0x38')],'resourceId':_0x4e0ceb['id'],'type':_0x28a025[_0xf45a('0x38')],'sectionId':_0x28a025['id']},{})[_0xf45a('0x1d')](function(){return _0xbe9767;});}else{return _0xbe9767;}})[_0xf45a('0x26')](function(_0x5d1a5d){logger[_0xf45a('0x22')](_0xf45a('0x5f'),_0x5d1a5d);throw _0x5d1a5d;});}return _0xbe9767;})[_0xf45a('0x1d')](respondWithResult(_0x3f86f1,0xc9))[_0xf45a('0x26')](handleError(_0x3f86f1,null));};exports[_0xf45a('0x60')]=function(_0x1d0e08,_0x2f26d8){if(_0x1d0e08['body']['id']){delete _0x1d0e08[_0xf45a('0x5a')]['id'];}return db[_0xf45a('0x3d')]['find']({'where':{'id':_0x1d0e08[_0xf45a('0x55')]['id']},'include':[{'model':db[_0xf45a('0x3b')],'as':'mandatoryDispositionPause'}]})[_0xf45a('0x1d')](handleEntityNotFound(_0x2f26d8,null))[_0xf45a('0x1d')](saveUpdates(_0x1d0e08[_0xf45a('0x5a')],null))[_0xf45a('0x1d')](respondWithResult(_0x2f26d8,null))['catch'](handleError(_0x2f26d8,null));};exports[_0xf45a('0x33')]=function(_0x525c99,_0x5b6515){return db[_0xf45a('0x3d')][_0xf45a('0x58')]({'where':{'id':_0x525c99[_0xf45a('0x55')]['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x5b6515,null))[_0xf45a('0x1d')](removeEntity(_0x5b6515,null))[_0xf45a('0x26')](handleError(_0x5b6515,null));};exports['describe']=function(_0x3ecbcd,_0x4716b1){return db['FaxAccount'][_0xf45a('0x61')]()['then'](respondWithResult(_0x4716b1,null))[_0xf45a('0x26')](handleError(_0x4716b1,null));};exports[_0xf45a('0x62')]=function(_0x2a432a,_0x16666d,_0x26e6fe){if(_0x2a432a[_0xf45a('0x5a')]['id']){delete _0x2a432a[_0xf45a('0x5a')]['id'];}return db[_0xf45a('0x3d')][_0xf45a('0x58')]({'where':{'id':_0x2a432a['params']['id']}})['then'](handleEntityNotFound(_0x16666d,null))[_0xf45a('0x1d')](function(_0x442670){if(_0x442670){_0x2a432a[_0xf45a('0x5a')][_0xf45a('0x63')]=_0x442670['id'];return db[_0xf45a('0x64')][_0xf45a('0x59')](_0x2a432a['body']);}})[_0xf45a('0x1d')](respondWithResult(_0x16666d,null))[_0xf45a('0x26')](handleError(_0x16666d,null));};exports[_0xf45a('0x65')]=function(_0x1105fd,_0x551724,_0x3a3f6f){var _0x403208={'raw':![],'where':{}};var _0x107c86={};var _0x5bb34a={'count':0x0,'rows':[]};return db[_0xf45a('0x3d')][_0xf45a('0x66')]({'where':{'id':_0x1105fd[_0xf45a('0x55')]['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x551724,null))[_0xf45a('0x1d')](function(_0x156aba){if(_0x156aba){_0x107c86[_0xf45a('0x41')]=_[_0xf45a('0x43')](db['Disposition'][_0xf45a('0x3e')]);_0x107c86[_0xf45a('0x44')]=_[_0xf45a('0x43')](_0x1105fd['query']);_0x107c86[_0xf45a('0x4b')]=_['intersection'](_0x107c86['model'],_0x107c86[_0xf45a('0x44')]);_0x403208['attributes']=_['intersection'](_0x107c86[_0xf45a('0x41')],qs[_0xf45a('0x46')](_0x1105fd[_0xf45a('0x44')]['fields']));_0x403208[_0xf45a('0x45')]=_0x403208['attributes'][_0xf45a('0x57')]?_0x403208[_0xf45a('0x45')]:_0x107c86['model'];if(!_0x1105fd['query'][_0xf45a('0x47')](_0xf45a('0x48'))){_0x403208[_0xf45a('0x2d')]=qs[_0xf45a('0x2d')](_0x1105fd[_0xf45a('0x44')][_0xf45a('0x2d')]);_0x403208[_0xf45a('0x2b')]=qs[_0xf45a('0x2b')](_0x1105fd[_0xf45a('0x44')]['offset']);}_0x403208[_0xf45a('0x67')]=qs[_0xf45a('0x49')](_0x1105fd[_0xf45a('0x44')][_0xf45a('0x49')]);_0x403208['where']=qs[_0xf45a('0x4b')](_[_0xf45a('0x4a')](_0x1105fd[_0xf45a('0x44')],_0x107c86['filters']));_0x403208[_0xf45a('0x4c')][_0xf45a('0x63')]=_0x156aba['id'];if(_0x1105fd['query']['filter']){_0x403208[_0xf45a('0x4c')]=_[_0xf45a('0x50')](_0x403208['where'],{'$or':_[_0xf45a('0x42')](_0x403208[_0xf45a('0x45')],function(_0x17e486){var _0x512d86={};_0x512d86[_0x17e486]={'$like':'%'+_0x1105fd[_0xf45a('0x44')][_0xf45a('0x4f')]+'%'};return _0x512d86;})});}_0x403208=_[_0xf45a('0x50')]({},_0x403208,_0x1105fd[_0xf45a('0x51')]);return db[_0xf45a('0x64')][_0xf45a('0x2e')]({'where':_0x403208['where']})[_0xf45a('0x1d')](function(_0x98bbd5){_0x5bb34a[_0xf45a('0x2e')]=_0x98bbd5;if(_0x1105fd[_0xf45a('0x44')]['includeAll']){_0x403208[_0xf45a('0x52')]=[{'all':!![]}];}return db[_0xf45a('0x64')]['findAll'](_0x403208);})[_0xf45a('0x1d')](function(_0x33dd39){_0x5bb34a[_0xf45a('0x53')]=_0x33dd39;return _0x5bb34a;});}})[_0xf45a('0x1d')](respondWithFilteredResult(_0x551724,_0x403208))[_0xf45a('0x26')](handleError(_0x551724,null));};exports[_0xf45a('0x68')]=function(_0x542850,_0x52ce80,_0x2aee72){return db[_0xf45a('0x3d')][_0xf45a('0x58')]({'where':{'id':_0x542850['params']['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x52ce80,null))[_0xf45a('0x1d')](function(_0x9a0458){if(_0x9a0458){return _0x9a0458['removeDispositions'](_0x542850[_0xf45a('0x44')]['ids']);}})['then'](respondWithStatusCode(_0x52ce80,null))['catch'](handleError(_0x52ce80,null));};exports['addAnswer']=function(_0xa6f7e1,_0x429a63,_0x5e9b12){if(_0xa6f7e1[_0xf45a('0x5a')]['id']){delete _0xa6f7e1[_0xf45a('0x5a')]['id'];}return db[_0xf45a('0x3d')][_0xf45a('0x58')]({'where':{'id':_0xa6f7e1[_0xf45a('0x55')]['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x429a63,null))['then'](function(_0x5cfe87){if(_0x5cfe87){_0xa6f7e1[_0xf45a('0x5a')]['FaxAccountId']=_0x5cfe87['id'];return db[_0xf45a('0x69')][_0xf45a('0x59')](_0xa6f7e1[_0xf45a('0x5a')]);}})[_0xf45a('0x1d')](respondWithResult(_0x429a63,null))['catch'](handleError(_0x429a63,null));};exports[_0xf45a('0x6a')]=function(_0x3abeac,_0x2d9d74,_0xa359cf){var _0x109dc4={'raw':![],'where':{}};var _0x529344={};var _0x771347={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf45a('0x66')]({'where':{'id':_0x3abeac['params']['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x2d9d74,null))[_0xf45a('0x1d')](function(_0x2dc654){if(_0x2dc654){_0x529344[_0xf45a('0x41')]=_[_0xf45a('0x43')](db[_0xf45a('0x69')]['rawAttributes']);_0x529344[_0xf45a('0x44')]=_['keys'](_0x3abeac[_0xf45a('0x44')]);_0x529344['filters']=_[_0xf45a('0x56')](_0x529344[_0xf45a('0x41')],_0x529344[_0xf45a('0x44')]);_0x109dc4[_0xf45a('0x45')]=_['intersection'](_0x529344[_0xf45a('0x41')],qs[_0xf45a('0x46')](_0x3abeac[_0xf45a('0x44')][_0xf45a('0x46')]));_0x109dc4['attributes']=_0x109dc4['attributes'][_0xf45a('0x57')]?_0x109dc4['attributes']:_0x529344[_0xf45a('0x41')];if(!_0x3abeac[_0xf45a('0x44')][_0xf45a('0x47')]('nolimit')){_0x109dc4[_0xf45a('0x2d')]=qs['limit'](_0x3abeac['query'][_0xf45a('0x2d')]);_0x109dc4['offset']=qs[_0xf45a('0x2b')](_0x3abeac[_0xf45a('0x44')][_0xf45a('0x2b')]);}_0x109dc4['order']=qs[_0xf45a('0x49')](_0x3abeac['query']['sort']);_0x109dc4['where']=qs[_0xf45a('0x4b')](_[_0xf45a('0x4a')](_0x3abeac[_0xf45a('0x44')],_0x529344[_0xf45a('0x4b')]));_0x109dc4['where']['FaxAccountId']=_0x2dc654['id'];if(_0x3abeac[_0xf45a('0x44')][_0xf45a('0x4f')]){_0x109dc4['where']=_['merge'](_0x109dc4[_0xf45a('0x4c')],{'$or':_['map'](_0x109dc4[_0xf45a('0x45')],function(_0x1070e4){var _0x4205a6={};_0x4205a6[_0x1070e4]={'$like':'%'+_0x3abeac[_0xf45a('0x44')][_0xf45a('0x4f')]+'%'};return _0x4205a6;})});}_0x109dc4=_[_0xf45a('0x50')]({},_0x109dc4,_0x3abeac[_0xf45a('0x51')]);return db['CannedAnswer'][_0xf45a('0x2e')]({'where':_0x109dc4[_0xf45a('0x4c')]})[_0xf45a('0x1d')](function(_0x53445a){_0x771347[_0xf45a('0x2e')]=_0x53445a;if(_0x3abeac[_0xf45a('0x44')][_0xf45a('0x6b')]){_0x109dc4[_0xf45a('0x52')]=[{'all':!![]}];}return db[_0xf45a('0x69')][_0xf45a('0x6c')](_0x109dc4);})[_0xf45a('0x1d')](function(_0x4f3c57){_0x771347[_0xf45a('0x53')]=_0x4f3c57;return _0x771347;});}})[_0xf45a('0x1d')](respondWithFilteredResult(_0x2d9d74,_0x109dc4))[_0xf45a('0x26')](handleError(_0x2d9d74,null));};exports[_0xf45a('0x6d')]=function(_0xe9ee87,_0x5edbc5,_0x12d276){return db[_0xf45a('0x3d')]['find']({'where':{'id':_0xe9ee87['params']['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x5edbc5,null))['then'](function(_0x585946){if(_0x585946){return _0x585946[_0xf45a('0x6d')](_0xe9ee87[_0xf45a('0x44')]['ids']);}})[_0xf45a('0x1d')](respondWithStatusCode(_0x5edbc5,null))[_0xf45a('0x26')](handleError(_0x5edbc5,null));};exports['addInteraction']=function(_0x43f055,_0x33f29e,_0x18db2b){return db[_0xf45a('0x6e')]['find']({'where':{'id':_0x43f055[_0xf45a('0x55')]['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x33f29e,null))[_0xf45a('0x1d')](function(_0x3af8a1){if(_0x3af8a1){return _0x3af8a1[_0xf45a('0x6f')](_0x43f055[_0xf45a('0x5a')][_0xf45a('0x70')],_[_0xf45a('0x71')](_0x43f055[_0xf45a('0x5a')],['ids','id'])||{});}})[_0xf45a('0x1d')](respondWithResult(_0x33f29e,null))[_0xf45a('0x26')](handleError(_0x33f29e,null));};exports[_0xf45a('0x72')]=function(_0x3eabd1,_0x21e10e,_0x39a321){var _0x20792d={'raw':![],'where':{}};var _0x20d7a9={};var _0x131d44={'count':0x0,'rows':[]};return db[_0xf45a('0x3d')][_0xf45a('0x66')]({'where':{'id':_0x3eabd1[_0xf45a('0x55')]['id']}})['then'](handleEntityNotFound(_0x21e10e,null))[_0xf45a('0x1d')](function(_0x5af6a2){if(_0x5af6a2){_0x20d7a9['model']=_[_0xf45a('0x43')](db[_0xf45a('0x6e')][_0xf45a('0x3e')]);_0x20d7a9[_0xf45a('0x44')]=_['keys'](_0x3eabd1['query']);_0x20d7a9[_0xf45a('0x4b')]=_[_0xf45a('0x56')](_0x20d7a9[_0xf45a('0x41')],_0x20d7a9[_0xf45a('0x44')]);_0x20792d['attributes']=_['intersection'](_0x20d7a9[_0xf45a('0x41')],qs['fields'](_0x3eabd1[_0xf45a('0x44')][_0xf45a('0x46')]));_0x20792d[_0xf45a('0x45')]=_0x20792d[_0xf45a('0x45')][_0xf45a('0x57')]?_0x20792d[_0xf45a('0x45')]:_0x20d7a9[_0xf45a('0x41')];if(!_0x3eabd1[_0xf45a('0x44')][_0xf45a('0x47')]('nolimit')){_0x20792d['limit']=qs[_0xf45a('0x2d')](_0x3eabd1['query'][_0xf45a('0x2d')]);_0x20792d['offset']=qs['offset'](_0x3eabd1[_0xf45a('0x44')][_0xf45a('0x2b')]);}_0x20792d['order']=qs[_0xf45a('0x49')](_0x3eabd1[_0xf45a('0x44')][_0xf45a('0x49')]);_0x20792d[_0xf45a('0x4c')]=qs['filters'](_[_0xf45a('0x4a')](_0x3eabd1[_0xf45a('0x44')],_0x20d7a9[_0xf45a('0x4b')]));_0x20792d[_0xf45a('0x4c')][_0xf45a('0x63')]=_0x5af6a2['id'];if(_0x3eabd1[_0xf45a('0x44')][_0xf45a('0x4f')]){_0x20792d[_0xf45a('0x4c')]=_[_0xf45a('0x50')](_0x20792d[_0xf45a('0x4c')],{'$or':_[_0xf45a('0x42')](_0x20792d['attributes'],function(_0x148c4c){var _0x30b275={};_0x30b275[_0x148c4c]={'$like':'%'+_0x3eabd1['query'][_0xf45a('0x4f')]+'%'};return _0x30b275;})});}_0x20792d=_['merge']({},_0x20792d,_0x3eabd1[_0xf45a('0x51')]);return db[_0xf45a('0x6e')][_0xf45a('0x2e')]({'where':_0x20792d[_0xf45a('0x4c')]})[_0xf45a('0x1d')](function(_0x5f41d9){_0x131d44[_0xf45a('0x2e')]=_0x5f41d9;if(_0x3eabd1[_0xf45a('0x44')][_0xf45a('0x6b')]){_0x20792d[_0xf45a('0x52')]=[{'model':db[_0xf45a('0x73')],'as':_0xf45a('0x74'),'required':![]},{'model':db[_0xf45a('0x75')],'as':_0xf45a('0x76'),'attributes':[_0xf45a('0x38'),_0xf45a('0x77'),_0xf45a('0x78')],'required':![]},{'model':db[_0xf45a('0x79')],'as':'Tags','attributes':['id','name',_0xf45a('0x7a')],'where':_0x3eabd1[_0xf45a('0x44')][_0xf45a('0x7b')]?{'id':_0x3eabd1[_0xf45a('0x44')]['tag']}:undefined,'required':_0x3eabd1[_0xf45a('0x44')]['tag']?!![]:![]}];}return db[_0xf45a('0x6e')][_0xf45a('0x6c')](_0x20792d);})[_0xf45a('0x1d')](function(_0x452590){_0x131d44[_0xf45a('0x53')]=_0x452590;return _0x131d44;});}})[_0xf45a('0x1d')](respondWithFilteredResult(_0x21e10e,_0x20792d))[_0xf45a('0x26')](handleError(_0x21e10e,null));};exports[_0xf45a('0x7c')]=function(_0x1c3d4e,_0x30fecf,_0x40f593){return db[_0xf45a('0x3d')][_0xf45a('0x66')]({'where':{'id':_0x1c3d4e[_0xf45a('0x55')]['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x30fecf,null))[_0xf45a('0x1d')](function(_0x4a2a1c){if(_0x4a2a1c){return db[_0xf45a('0x7d')][_0xf45a('0x7e')](function(_0x49f8b9){return db[_0xf45a('0x7f')][_0xf45a('0x33')]({'where':{'FaxAccountId':_0x1c3d4e['params']['id']},'transaction':_0x49f8b9})[_0xf45a('0x1d')](function(_0x436276){var _0x251b1c=_[_0xf45a('0x42')](_0x1c3d4e[_0xf45a('0x5a')],function(_0x56948d){_0x56948d[_0xf45a('0x63')]=_0x1c3d4e['params']['id'];return _0x56948d;});return db[_0xf45a('0x7f')][_0xf45a('0x80')](_0x251b1c,{'transaction':_0x49f8b9});});})['then'](function(){return db[_0xf45a('0x7f')][_0xf45a('0x81')]({'where':{'FaxAccountId':_0x1c3d4e[_0xf45a('0x55')]['id']},'order':_0xf45a('0x82')});});}})[_0xf45a('0x1d')](respondWithResult(_0x30fecf,null))[_0xf45a('0x26')](handleError(_0x30fecf,null));};exports['getApplications']=function(_0x5b8536,_0x4b8122,_0x2c3a21){var _0x33f463={};var _0x26240e={};var _0x175afe;var _0xc27263;return db[_0xf45a('0x3d')][_0xf45a('0x66')]({'where':{'id':_0x5b8536[_0xf45a('0x55')]['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x4b8122,null))[_0xf45a('0x1d')](function(_0x430c0f){if(_0x430c0f){_0x175afe=_0x430c0f;_0x26240e[_0xf45a('0x41')]=_['keys'](db[_0xf45a('0x7f')]['rawAttributes']);_0x26240e[_0xf45a('0x44')]=_[_0xf45a('0x43')](_0x5b8536[_0xf45a('0x44')]);_0x26240e[_0xf45a('0x4b')]=_['intersection'](_0x26240e[_0xf45a('0x41')],_0x26240e[_0xf45a('0x44')]);_0x33f463['attributes']=_[_0xf45a('0x56')](_0x26240e[_0xf45a('0x41')],qs[_0xf45a('0x46')](_0x5b8536[_0xf45a('0x44')][_0xf45a('0x46')]));_0x33f463[_0xf45a('0x45')]=_0x33f463['attributes'][_0xf45a('0x57')]?_0x33f463[_0xf45a('0x45')]:_0x26240e[_0xf45a('0x41')];_0x33f463['order']=qs[_0xf45a('0x49')](_0x5b8536[_0xf45a('0x44')]['sort']);_0x33f463['where']=qs[_0xf45a('0x4b')](_[_0xf45a('0x4a')](_0x5b8536[_0xf45a('0x44')],_0x26240e['filters']));if(_0x5b8536[_0xf45a('0x44')][_0xf45a('0x4f')]){_0x33f463[_0xf45a('0x4c')]=_['merge'](_0x33f463[_0xf45a('0x4c')],{'$or':_[_0xf45a('0x42')](_0x33f463['attributes'],function(_0x981c36){var _0x5888df={};_0x5888df[_0x981c36]={'$like':'%'+_0x5b8536['query'][_0xf45a('0x4f')]+'%'};return _0x5888df;})});}_0x33f463=_[_0xf45a('0x50')]({},_0x33f463,_0x5b8536['options']);return _0x175afe['getApplications'](_0x33f463);}})[_0xf45a('0x1d')](function(_0x4c4e2e){if(_0x4c4e2e){_0xc27263=_0x4c4e2e[_0xf45a('0x57')];if(!_0x5b8536[_0xf45a('0x44')]['hasOwnProperty'](_0xf45a('0x48'))){_0x33f463[_0xf45a('0x2d')]=qs['limit'](_0x5b8536[_0xf45a('0x44')][_0xf45a('0x2d')]);_0x33f463['offset']=qs[_0xf45a('0x2b')](_0x5b8536[_0xf45a('0x44')][_0xf45a('0x2b')]);}return _0x175afe['getApplications'](_0x33f463);}})[_0xf45a('0x1d')](function(_0xee424c){if(_0xee424c){return _0xee424c?{'count':_0xc27263,'rows':_0xee424c}:null;}})[_0xf45a('0x1d')](respondWithResult(_0x4b8122,null))[_0xf45a('0x26')](handleError(_0x4b8122,null));};function Extension(_0x5f5802,_0x59ef0c,_0xcaf6b1,_0x151616){this[_0xf45a('0x83')]=_0xf45a('0x84');this['exten']=_0x5f5802[_0xf45a('0x85')];this[_0xf45a('0x86')]=_0x151616;this[_0xf45a('0x4d')]=_0xf45a('0x87');this[_0xf45a('0x88')]=_0xf45a('0x89');this[_0xf45a('0x63')]=_0x5f5802['id'];this['priority']=_0x59ef0c;this[_0xf45a('0x8a')]=_0xcaf6b1;}function createExtensionsReciveFax(_0x308e85){var _0x515376=0x1;var _0x22223b=[];_0x22223b[_0xf45a('0x8b')](new Extension(_0x308e85,_0x515376,'','Answer'));_0x515376+=0x1;_0x22223b[_0xf45a('0x8b')](new Extension(_0x308e85,_0x515376,_0xf45a('0x8c'),'Set'));_0x515376+=0x1;for(var _0xca3478 in _0x308e85){if(_0x308e85[_0xf45a('0x47')](_0xca3478)&&(_0xca3478===_0xf45a('0x8d')||_0xca3478===_0xf45a('0x85')||_0xca3478===_0xf45a('0x8e')||_0xca3478===_0xf45a('0x8f')||_0xca3478==='headerinfo'||_0xca3478==='maxrate'||_0xca3478===_0xf45a('0x90')||_0xca3478===_0xf45a('0x91')||_0xca3478===_0xf45a('0x92'))){_0x22223b['push'](new Extension(_0x308e85,_0x515376,_0xf45a('0x93')+_0xca3478+')='+_0x308e85[_0xca3478],_0xf45a('0x94')));_0x515376+=0x1;}}_0x22223b[_0xf45a('0x8b')](new Extension(_0x308e85,_0x515376,'6',_0xf45a('0x95')));_0x515376+=0x1;_0x22223b[_0xf45a('0x8b')](new Extension(_0x308e85,_0x515376,'/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'));_0x515376=0x0;return _0x22223b;}exports[_0xf45a('0x96')]=function(_0x10a962,_0x5050f5,_0x35f5a6){var _0x378ad5;return db[_0xf45a('0x7d')][_0xf45a('0x7e')](function(_0x1cb1bb){return db[_0xf45a('0x3d')][_0xf45a('0x59')](_0x10a962[_0xf45a('0x5a')],{'transaction':_0x1cb1bb})['then'](function(_0xabfa27){_0x378ad5=_0xabfa27[_0xf45a('0x34')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x378ad5),{'transaction':_0x1cb1bb});});})[_0xf45a('0x1d')](function(){return _0x378ad5;})[_0xf45a('0x1d')](respondWithResult(_0x5050f5,null))[_0xf45a('0x26')](handleError(_0x5050f5,null));};exports['updateAccountApplications']=function(_0x5127ee,_0x8f995e,_0x1c21b7){var _0x196731;return db[_0xf45a('0x7d')][_0xf45a('0x7e')](function(_0x29cb6b){return db['FaxAccount'][_0xf45a('0x60')](_0x5127ee[_0xf45a('0x5a')],{'where':{'id':_0x5127ee['body']['id']},'transaction':_0x29cb6b})[_0xf45a('0x1d')](function(_0x439b1f){return db['VoiceExtension'][_0xf45a('0x33')]({'where':{'FaxAccountId':_0x5127ee[_0xf45a('0x5a')]['id']},'transaction':_0x29cb6b})[_0xf45a('0x1d')](function(_0x101399){return db[_0xf45a('0x97')][_0xf45a('0x80')](createExtensionsReciveFax(_[_0xf45a('0x71')](_0x5127ee['body'],[_0xf45a('0x98'),_0xf45a('0x40'),_0xf45a('0x99'),_0xf45a('0x9a'),'TrunkId',_0xf45a('0x9b')])),{'transaction':_0x29cb6b});});});})[_0xf45a('0x1d')](function(){return db['FaxAccount'][_0xf45a('0x9c')](_0x5127ee[_0xf45a('0x5a')]['id']);})[_0xf45a('0x1d')](respondWithResult(_0x8f995e,null))[_0xf45a('0x26')](handleError(_0x8f995e,null));};exports[_0xf45a('0x9d')]=function(_0x20369b,_0x56e687,_0x349284){var _0x5c259c={'raw':!![],'where':{}};var _0x5e5f14={};var _0x4da487={'count':0x0,'rows':[]};return db[_0xf45a('0x3d')][_0xf45a('0x66')]({'where':{'id':_0x20369b[_0xf45a('0x55')]['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x56e687,null))['then'](function(_0x3e8a8f){if(_0x3e8a8f){_0x5e5f14[_0xf45a('0x41')]=_[_0xf45a('0x43')](db[_0xf45a('0x9e')][_0xf45a('0x3e')]);_0x5e5f14[_0xf45a('0x44')]=_[_0xf45a('0x43')](_0x20369b[_0xf45a('0x44')]);_0x5e5f14[_0xf45a('0x4b')]=_['intersection'](_0x5e5f14[_0xf45a('0x41')],_0x5e5f14['query']);_0x5c259c[_0xf45a('0x45')]=_['intersection'](_0x5e5f14[_0xf45a('0x41')],qs['fields'](_0x20369b[_0xf45a('0x44')]['fields']));_0x5c259c['attributes']=_0x5c259c['attributes'][_0xf45a('0x57')]?_0x5c259c[_0xf45a('0x45')]:_0x5e5f14[_0xf45a('0x41')];if(!_0x20369b[_0xf45a('0x44')][_0xf45a('0x47')]('nolimit')){_0x5c259c[_0xf45a('0x2d')]=qs[_0xf45a('0x2d')](_0x20369b[_0xf45a('0x44')]['limit']);_0x5c259c[_0xf45a('0x2b')]=qs['offset'](_0x20369b[_0xf45a('0x44')]['offset']);}_0x5c259c[_0xf45a('0x67')]=qs[_0xf45a('0x49')](_0x20369b['query']['sort']);_0x5c259c[_0xf45a('0x4c')]=qs[_0xf45a('0x4b')](_[_0xf45a('0x4a')](_0x20369b[_0xf45a('0x44')],_0x5e5f14[_0xf45a('0x4b')]));_0x5c259c[_0xf45a('0x4c')][_0xf45a('0x63')]=_0x3e8a8f['id'];if(_0x20369b[_0xf45a('0x44')][_0xf45a('0x4f')]){_0x5c259c[_0xf45a('0x4c')]=_[_0xf45a('0x50')](_0x5c259c[_0xf45a('0x4c')],{'$or':_[_0xf45a('0x42')](_0x5c259c['attributes'],function(_0x2680fa){var _0x120e26={};_0x120e26[_0x2680fa]={'$like':'%'+_0x20369b[_0xf45a('0x44')][_0xf45a('0x4f')]+'%'};return _0x120e26;})});}if(_0x20369b[_0xf45a('0x44')][_0xf45a('0x9f')]){var _0x3d129c=_0x20369b['query']['$gte'][_0xf45a('0xa0')](',');var _0x3f9f9a={};_0x3f9f9a[_0x3d129c[0x0]]={'$gte':moment(_0x3d129c[0x1])['format'](_0xf45a('0xa1'))};_0x5c259c[_0xf45a('0x4c')]=_['merge'](_0x5c259c[_0xf45a('0x4c')],_0x3f9f9a);}_0x5c259c=_['merge']({},_0x5c259c,_0x20369b['options']);return db[_0xf45a('0x9e')][_0xf45a('0x2e')]({'where':_0x5c259c[_0xf45a('0x4c')]})[_0xf45a('0x1d')](function(_0xc49659){_0x4da487[_0xf45a('0x2e')]=_0xc49659;if(_0x20369b['query'][_0xf45a('0x6b')]){_0x5c259c[_0xf45a('0x52')]=[{'all':!![]}];}return db[_0xf45a('0x9e')][_0xf45a('0x6c')](_0x5c259c);})[_0xf45a('0x1d')](function(_0xa693bc){_0x4da487['rows']=_0xa693bc;return _0x4da487;});}})['then'](respondWithFilteredResult(_0x56e687,_0x5c259c))['catch'](handleError(_0x56e687,null));};exports[_0xf45a('0x39')]=function(_0x2c4cfe,_0x570583,_0xcdc248){var _0x43d3db,_0x34bb4c={},_0x417118;if(_0x2c4cfe['body']['to']){_0x417118=_0x2c4cfe[_0xf45a('0x5a')]['to'][0x0];}return db[_0xf45a('0x3d')][_0xf45a('0x58')]({'where':{'id':_0x2c4cfe['params']['id']},'include':[{'model':db[_0xf45a('0xa2')],'as':_0xf45a('0xa3'),'include':[{'model':db[_0xf45a('0x73')],'as':_0xf45a('0xa4'),'where':{'fax':_0x417118},'limit':0x1,'order':[['updatedAt',_0xf45a('0xa5')]]}]}]})[_0xf45a('0x1d')](handleEntityNotFound(_0x570583,null))[_0xf45a('0x1d')](function(_0x5bc5eb){_0x43d3db=_0x5bc5eb;if(_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xa6')]&&_0x2c4cfe['body'][_0xf45a('0xa6')][_0xf45a('0x57')]){for(var _0xc4f56=0x0;_0xc4f56<_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xa6')][_0xf45a('0x57')];_0xc4f56+=0x1){_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xa6')][_0xc4f56]={'filename':_0x2c4cfe[_0xf45a('0x5a')]['attachments'][_0xc4f56][_0xf45a('0x38')],'id':_0x2c4cfe['body'][_0xf45a('0xa6')][_0xc4f56]['id'],'path':path[_0xf45a('0xa7')](config[_0xf45a('0xa8')],_0xf45a('0xa9'),_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xa6')][_0xc4f56]['basename'])};}}return respondWithRpcPromise(_0xf45a('0xaa'),_0xf45a('0xaa'),{'FaxAccountId':_['isNil'](_0x2c4cfe[_0xf45a('0x55')]['id'])?undefined:_0x2c4cfe[_0xf45a('0x55')]['id'],'path':_['isNil'](_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xa6')][0x0][_0xf45a('0x8')])?undefined:_0x2c4cfe[_0xf45a('0x5a')]['attachments'][0x0][_0xf45a('0x8')],'fax':_[_0xf45a('0xab')](_0x2c4cfe['body']['to'][0x0])?undefined:_0x2c4cfe[_0xf45a('0x5a')]['to'][0x0]},client9002);})[_0xf45a('0x1d')](function(){if(_0x43d3db){if(_['isNil'](_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xac')])){_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xac')]=util['format'](_0xf45a('0xad'),_0x43d3db[_0xf45a('0x38')],_0x43d3db['fax']);}if(_0x43d3db['List']){if(_0x43d3db[_0xf45a('0xa3')]['Contacts'][_0xf45a('0x57')]){return _0x43d3db[_0xf45a('0xa3')][_0xf45a('0xa4')][0x0];}else{return db['CmContact'][_0xf45a('0x59')](_[_0xf45a('0x16')](_0x2c4cfe[_0xf45a('0x5a')],{'firstName':_0x2c4cfe[_0xf45a('0x5a')]['to'][0x0],'phone':_0x2c4cfe[_0xf45a('0x5a')]['to'][0x0],'fax':_0x2c4cfe[_0xf45a('0x5a')]['to'][0x0],'ListId':_0x43d3db[_0xf45a('0x9b')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xf45a('0xae'));}})[_0xf45a('0x1d')](function(_0x579915){if(_0x579915){return db['FaxInteraction']['find']({'where':{'ContactId':_0x579915['id'],'closed':![],'FaxAccountId':_0x43d3db['id']}})[_0xf45a('0x1d')](function(_0x46e446){if(_0x46e446){return[_0x46e446,![]];}return db[_0xf45a('0x6e')]['create']({'UserId':_0x2c4cfe['user']['id'],'ContactId':_0x579915['id'],'FaxAccountId':_0x43d3db['id'],'fax':_0x2c4cfe[_0xf45a('0x5a')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x2c4cfe[_0xf45a('0x5a')],{'read':![],'body':_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xa6')][0x0][_0xf45a('0xaf')],'FaxAccountId':_0x43d3db['id'],'UserId':_0x2c4cfe[_0xf45a('0xb0')]['id'],'ContactId':_0x579915['id'],'AttachmentId':_0x2c4cfe['body'][_0xf45a('0xa6')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xf45a('0xb1')}]})[_0xf45a('0x1d')](function(_0x411129){return[_0x411129,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf45a('0xb2')](function(_0x438d38,_0xad918c){if(_0xad918c){return _0x438d38;}return db[_0xf45a('0x9e')]['create']({'direction':_0xf45a('0xb3'),'read':![],'body':_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xa6')][0x0][_0xf45a('0xaf')],'FaxAccountId':_0x43d3db['id'],'FaxInteractionId':_0x438d38['id'],'UserId':_0x2c4cfe[_0xf45a('0xb0')]['id'],'ContactId':_0x438d38[_0xf45a('0xb4')],'AttachmentId':_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xa6')][0x0]['id']})[_0xf45a('0x1d')](function(_0x2bbe58){_0x438d38[_0xf45a('0xb5')][_0xf45a('0xb1')]=[];_0x438d38[_0xf45a('0xb5')][_0xf45a('0xb1')]['push'](_0x2bbe58[_0xf45a('0xb5')]);return _0x438d38;});})[_0xf45a('0x1d')](function(_0x22dfe4){respondWithRpcPromise(_0xf45a('0xb6'),_0xf45a('0xb6'),{'FaxAccountId':_['isNil'](_0x2c4cfe[_0xf45a('0x55')]['id'])?undefined:_0x2c4cfe[_0xf45a('0x55')]['id'],'path':_[_0xf45a('0xab')](_0x2c4cfe['body'][_0xf45a('0xa6')][0x0][_0xf45a('0x8')])?undefined:_0x2c4cfe[_0xf45a('0x5a')][_0xf45a('0xa6')][0x0]['path'],'fax':_[_0xf45a('0xab')](_0x2c4cfe[_0xf45a('0x5a')]['to'][0x0])?undefined:_0x2c4cfe[_0xf45a('0x5a')]['to'][0x0],'AttachmentId':_0x2c4cfe[_0xf45a('0x5a')]['attachments'][0x0]['id']},client9002)[_0xf45a('0x1d')](function(_0x39cc3b){logger[_0xf45a('0x1e')](_0xf45a('0xb7'),_0x39cc3b);})['catch'](function(_0x800706){logger['info']('SendFaxRpc,\x20%s',_0x800706);});return _0x22dfe4;})['then'](respondWithResult(_0x570583,null))[_0xf45a('0x26')](handleError(_0x570583,null));};exports[_0xf45a('0xb8')]=function(_0x39e839,_0x15de84,_0x241e2f){return db[_0xf45a('0x3d')][_0xf45a('0x58')]({'where':{'id':_0x39e839[_0xf45a('0x55')]['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x15de84,null))[_0xf45a('0x1d')](function(_0x2d6174){if(_0x2d6174){return _0x2d6174['addAgents'](_0x39e839['body'][_0xf45a('0x70')],_[_0xf45a('0x71')](_0x39e839[_0xf45a('0x5a')],[_0xf45a('0x70'),'id'])||{})['spread'](function(_0x14acd7){for(var _0x2e21ce=0x0;_0x2e21ce<_0x39e839[_0xf45a('0x5a')][_0xf45a('0x70')][_0xf45a('0x57')];_0x2e21ce+=0x1){socket[_0xf45a('0xb9')](_0xf45a('0xba'),{'UserId':Number(_0x39e839[_0xf45a('0x5a')]['ids'][_0x2e21ce]),'FaxAccountId':Number(_0x39e839[_0xf45a('0x55')]['id'])});}return _0x14acd7;});}})['then'](respondWithResult(_0x15de84,null))[_0xf45a('0x26')](handleError(_0x15de84,null));};exports[_0xf45a('0xbb')]=function(_0x1b39a9,_0x2b74e1,_0x48f81b){return db[_0xf45a('0x3d')][_0xf45a('0x58')]({'where':{'id':_0x1b39a9['params']['id']}})['then'](handleEntityNotFound(_0x2b74e1,null))[_0xf45a('0x1d')](function(_0x37bd8b){if(_0x37bd8b){return _0x37bd8b['removeAgents'](_0x1b39a9['query'][_0xf45a('0x70')])[_0xf45a('0x1d')](function(){if(_['isArray'](_0x1b39a9['query'][_0xf45a('0x70')])){for(var _0x40d106=0x0;_0x40d106<_0x1b39a9[_0xf45a('0x44')][_0xf45a('0x70')]['length'];_0x40d106+=0x1){socket[_0xf45a('0xb9')](_0xf45a('0xbc'),{'UserId':Number(_0x1b39a9['query'][_0xf45a('0x70')][_0x40d106]),'FaxAccountId':Number(_0x1b39a9[_0xf45a('0x55')]['id'])});}}else{socket[_0xf45a('0xb9')](_0xf45a('0xbc'),{'UserId':Number(_0x1b39a9[_0xf45a('0x44')]['ids']),'FaxAccountId':Number(_0x1b39a9[_0xf45a('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x2b74e1,null))[_0xf45a('0x26')](handleError(_0x2b74e1,null));};exports['getAgents']=function(_0x52ecf5,_0x2992d3,_0x400fb3){var _0x1108ad={};var _0x305511={};var _0x3381e3;var _0x12eaa0;return db[_0xf45a('0x3d')][_0xf45a('0x66')]({'where':{'id':_0x52ecf5[_0xf45a('0x55')]['id']}})[_0xf45a('0x1d')](handleEntityNotFound(_0x2992d3,null))[_0xf45a('0x1d')](function(_0x33f874){if(_0x33f874){_0x3381e3=_0x33f874;_0x305511[_0xf45a('0x41')]=_[_0xf45a('0x43')](db[_0xf45a('0x75')][_0xf45a('0x3e')]);_0x305511['query']=_[_0xf45a('0x43')](_0x52ecf5[_0xf45a('0x44')]);_0x305511[_0xf45a('0x4b')]=_[_0xf45a('0x56')](_0x305511[_0xf45a('0x41')],_0x305511['query']);_0x1108ad[_0xf45a('0x45')]=_[_0xf45a('0x56')](_0x305511[_0xf45a('0x41')],qs['fields'](_0x52ecf5['query'][_0xf45a('0x46')]));_0x1108ad[_0xf45a('0x45')]=_0x1108ad[_0xf45a('0x45')][_0xf45a('0x57')]?_0x1108ad[_0xf45a('0x45')]:_0x305511[_0xf45a('0x41')];_0x1108ad[_0xf45a('0x67')]=qs[_0xf45a('0x49')](_0x52ecf5[_0xf45a('0x44')]['sort']);_0x1108ad[_0xf45a('0x4c')]=qs[_0xf45a('0x4b')](_[_0xf45a('0x4a')](_0x52ecf5[_0xf45a('0x44')],_0x305511[_0xf45a('0x4b')]));if(_0x52ecf5['query']['filter']){_0x1108ad[_0xf45a('0x4c')]=_[_0xf45a('0x50')](_0x1108ad['where'],{'$or':_[_0xf45a('0x42')](_0x1108ad[_0xf45a('0x45')],function(_0x2e4cba){var _0x5606d7={};_0x5606d7[_0x2e4cba]={'$like':'%'+_0x52ecf5['query'][_0xf45a('0x4f')]+'%'};return _0x5606d7;})});}_0x1108ad=_[_0xf45a('0x50')]({},_0x1108ad,_0x52ecf5[_0xf45a('0x51')]);return _0x3381e3[_0xf45a('0xbd')](_0x1108ad);}})['then'](function(_0x160bb3){if(_0x160bb3){_0x12eaa0=_0x160bb3[_0xf45a('0x57')];if(!_0x52ecf5[_0xf45a('0x44')]['hasOwnProperty'](_0xf45a('0x48'))){_0x1108ad[_0xf45a('0x2d')]=qs[_0xf45a('0x2d')](_0x52ecf5['query'][_0xf45a('0x2d')]);_0x1108ad[_0xf45a('0x2b')]=qs[_0xf45a('0x2b')](_0x52ecf5['query'][_0xf45a('0x2b')]);}return _0x3381e3[_0xf45a('0xbd')](_0x1108ad);}})[_0xf45a('0x1d')](function(_0x29acde){if(_0x29acde){return _0x29acde?{'count':_0x12eaa0,'rows':_0x29acde}:null;}})[_0xf45a('0x1d')](respondWithResult(_0x2992d3,null))[_0xf45a('0x26')](handleError(_0x2992d3,null));};
\ No newline at end of file
+var _0x7821=['find','create','body','user','role','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Pause','describe','addDisposition','getDispositions','findOne','Disposition','sort','pick','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','appdata','push','Answer','CDR(type)=inbound-fax','Set','faxdetect','headerinfo','maxrate','minrate','modem','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','VoiceExtension','updateAccountApplications','tech','TrunkId','ListId','getMessages','$gte','split','format','FaxMessage','CmList','List','CmContact','DESC','attachments','root','server/files/attachments','basename','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','FaxAccount','includeAll','include','findAll','rows','catch'];(function(_0x50e306,_0x5d225d){var _0x9fd9c2=function(_0x345a95){while(--_0x345a95){_0x50e306['push'](_0x50e306['shift']());}};_0x9fd9c2(++_0x5d225d);}(_0x7821,0x126));var _0x1782=function(_0x12c4cd,_0xdebe29){_0x12c4cd=_0x12c4cd-0x0;var _0x18a029=_0x7821[_0x12c4cd];return _0x18a029;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1782('0x0'));var jsonpatch=require(_0x1782('0x1'));var rp=require(_0x1782('0x2'));var moment=require(_0x1782('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1782('0x4'));var util=require('util');var path=require(_0x1782('0x5'));var sox=require(_0x1782('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1782('0x7'));var _=require(_0x1782('0x8'));var squel=require(_0x1782('0x9'));var crypto=require('crypto');var jsforce=require(_0x1782('0xa'));var deskjs=require(_0x1782('0xb'));var toCsv=require(_0x1782('0xc'));var querystring=require(_0x1782('0xd'));var Papa=require('papaparse');var Redis=require(_0x1782('0xe'));var authService=require(_0x1782('0xf'));var qs=require(_0x1782('0x10'));var as=require(_0x1782('0x11'));var hardwareService=require(_0x1782('0x12'));var logger=require(_0x1782('0x13'))(_0x1782('0x14'));var utils=require('../../config/utils');var config=require(_0x1782('0x15'));var licenseUtil=require(_0x1782('0x16'));var db=require(_0x1782('0x17'))['db'];config[_0x1782('0x18')]=_[_0x1782('0x19')](config[_0x1782('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1782('0x1a'))(new Redis(config[_0x1782('0x18')]));require(_0x1782('0x1b'))['register'](socket);var jayson=require(_0x1782('0x1c'));var client=jayson[_0x1782('0x1d')][_0x1782('0x1e')]({'port':0x232c});var client9002=jayson[_0x1782('0x1d')][_0x1782('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1aa8f2,_0x589731,_0x3b49a2,_0xbcb920){return new BPromise(function(_0x4f7168,_0x489496){var _0xedb78f=_0xbcb920||client;return _0xedb78f[_0x1782('0x1f')](_0x1aa8f2,_0x3b49a2)[_0x1782('0x20')](function(_0x22071f){logger[_0x1782('0x21')](_0x1782('0x22'),_0x589731,_0x1782('0x23'));logger[_0x1782('0x24')](_0x1782('0x25'),_0x589731,_0x1782('0x23'),JSON[_0x1782('0x26')](_0x22071f));if(_0x22071f['error']){if(_0x22071f[_0x1782('0x27')]['code']===0x1f4){logger[_0x1782('0x27')](_0x1782('0x22'),_0x589731,_0x22071f['error'][_0x1782('0x28')]);return _0x489496(_0x22071f[_0x1782('0x27')][_0x1782('0x28')]);}logger[_0x1782('0x27')](_0x1782('0x22'),_0x589731,_0x22071f[_0x1782('0x27')][_0x1782('0x28')]);return _0x4f7168(_0x22071f[_0x1782('0x27')][_0x1782('0x28')]);}else{logger[_0x1782('0x21')](_0x1782('0x22'),_0x589731,'request\x20sent');_0x4f7168(_0x22071f['result']['message']);}})['catch'](function(_0x297ec5){logger[_0x1782('0x27')](_0x1782('0x22'),_0x589731,_0x297ec5);_0x489496(_0x297ec5);});});}function respondWithStatusCode(_0x37e909,_0xad286e){_0xad286e=_0xad286e||0xcc;return function(_0x108c5e){if(_0x108c5e){return _0x37e909[_0x1782('0x29')](_0xad286e);}return _0x37e909[_0x1782('0x2a')](_0xad286e)[_0x1782('0x2b')]();};}function respondWithResult(_0x249098,_0x52b1f3){_0x52b1f3=_0x52b1f3||0xc8;return function(_0x5ad2de){if(_0x5ad2de){return _0x249098[_0x1782('0x2a')](_0x52b1f3)[_0x1782('0x2c')](_0x5ad2de);}};}function respondWithFilteredResult(_0x430912,_0x292429){return function(_0x1f31ad){if(_0x1f31ad){var _0x227832=typeof _0x292429[_0x1782('0x2d')]==='undefined'&&typeof _0x292429[_0x1782('0x2e')]===_0x1782('0x2f');var _0x387df2=_0x1f31ad['count'];var _0x3bcc4a=_0x227832?0x0:_0x292429[_0x1782('0x2d')];var _0x16ea3f=_0x227832?_0x1f31ad[_0x1782('0x30')]:_0x292429['offset']+_0x292429['limit'];var _0x17c8a6;if(_0x16ea3f>=_0x387df2){_0x16ea3f=_0x387df2;_0x17c8a6=0xc8;}else{_0x17c8a6=0xce;}_0x430912['status'](_0x17c8a6);return _0x430912['set'](_0x1782('0x31'),_0x3bcc4a+'-'+_0x16ea3f+'/'+_0x387df2)[_0x1782('0x2c')](_0x1f31ad);}return null;};}function patchUpdates(_0x8b6d8e){return function(_0x112d45){try{jsonpatch[_0x1782('0x32')](_0x112d45,_0x8b6d8e,!![]);}catch(_0x4f1bc2){return BPromise[_0x1782('0x33')](_0x4f1bc2);}return _0x112d45[_0x1782('0x34')]();};}function saveUpdates(_0x442fc8,_0x58d069){return function(_0x350415){if(_0x350415){return _0x350415[_0x1782('0x35')](_0x442fc8)[_0x1782('0x20')](function(_0x4f28f7){return _0x4f28f7;});}return null;};}function removeEntity(_0x3c4c91,_0x4dcf2b){return function(_0x447623){if(_0x447623){return _0x447623[_0x1782('0x36')]()['then'](function(){var _0x3d767e=_0x447623[_0x1782('0x37')]({'plain':!![]});var _0x12cf0e='FaxAccounts';return db[_0x1782('0x38')]['destroy']({'where':{'type':_0x12cf0e,'resourceId':_0x3d767e['id']}})[_0x1782('0x20')](function(){return _0x447623;});})['then'](function(){_0x3c4c91['status'](0xcc)[_0x1782('0x2b')]();});}};}function handleEntityNotFound(_0x1e4c1f,_0x196a24){return function(_0x35fb6e){if(!_0x35fb6e){_0x1e4c1f['sendStatus'](0x194);}return _0x35fb6e;};}function handleError(_0x28dcc2,_0x1d50fd){_0x1d50fd=_0x1d50fd||0x1f4;return function(_0x1115ac){logger[_0x1782('0x27')](_0x1115ac[_0x1782('0x39')]);if(_0x1115ac[_0x1782('0x3a')]){delete _0x1115ac[_0x1782('0x3a')];}_0x28dcc2[_0x1782('0x2a')](_0x1d50fd)[_0x1782('0x3b')](_0x1115ac);};}exports['index']=function(_0x593079,_0x2d0422){var _0x1c438e={'include':[{'model':db['Pause'],'as':_0x1782('0x3c')}]},_0x10e139={},_0x4d8983={'count':0x0,'rows':[]};var _0x130c6d=_[_0x1782('0x3d')](db['FaxAccount'][_0x1782('0x3e')],function(_0x27a576){return{'name':_0x27a576[_0x1782('0x3f')],'type':_0x27a576[_0x1782('0x40')][_0x1782('0x41')]};});_0x10e139[_0x1782('0x42')]=_['map'](_0x130c6d,_0x1782('0x3a'));_0x10e139['query']=_[_0x1782('0x43')](_0x593079['query']);_0x10e139[_0x1782('0x44')]=_[_0x1782('0x45')](_0x10e139[_0x1782('0x42')],_0x10e139[_0x1782('0x46')]);_0x1c438e[_0x1782('0x47')]=_['intersection'](_0x10e139[_0x1782('0x42')],qs[_0x1782('0x48')](_0x593079[_0x1782('0x46')]['fields']));_0x1c438e[_0x1782('0x47')]=_0x1c438e[_0x1782('0x47')][_0x1782('0x49')]?_0x1c438e[_0x1782('0x47')]:_0x10e139[_0x1782('0x42')];if(!_0x593079[_0x1782('0x46')][_0x1782('0x4a')](_0x1782('0x4b'))){_0x1c438e['limit']=qs['limit'](_0x593079['query'][_0x1782('0x2e')]);_0x1c438e[_0x1782('0x2d')]=qs[_0x1782('0x2d')](_0x593079[_0x1782('0x46')][_0x1782('0x2d')]);}_0x1c438e[_0x1782('0x4c')]=qs['sort'](_0x593079[_0x1782('0x46')]['sort']);_0x1c438e[_0x1782('0x4d')]=qs['filters'](_['pick'](_0x593079['query'],_0x10e139[_0x1782('0x44')]),_0x130c6d);if(_0x593079[_0x1782('0x46')][_0x1782('0x4e')]){_0x1c438e['where']=_[_0x1782('0x4f')](_0x1c438e[_0x1782('0x4d')],{'$or':_[_0x1782('0x3d')](_0x130c6d,function(_0x143d99){if(_0x143d99[_0x1782('0x40')]!==_0x1782('0x50')){var _0x903584={};_0x903584[_0x143d99[_0x1782('0x3a')]]={'$like':'%'+_0x593079[_0x1782('0x46')][_0x1782('0x4e')]+'%'};return _0x903584;}})});}_0x1c438e=_[_0x1782('0x4f')]({},_0x1c438e,_0x593079[_0x1782('0x51')]);var _0x187640={'where':_0x1c438e[_0x1782('0x4d')]};return db[_0x1782('0x52')]['count'](_0x187640)[_0x1782('0x20')](function(_0x482050){_0x4d8983[_0x1782('0x30')]=_0x482050;if(_0x593079[_0x1782('0x46')][_0x1782('0x53')]){_0x1c438e[_0x1782('0x54')]=[{'all':!![]}];}return db['FaxAccount'][_0x1782('0x55')](_0x1c438e);})[_0x1782('0x20')](function(_0x374316){_0x4d8983[_0x1782('0x56')]=_0x374316;return _0x4d8983;})[_0x1782('0x20')](respondWithFilteredResult(_0x2d0422,_0x1c438e))[_0x1782('0x57')](handleError(_0x2d0422,null));};exports['show']=function(_0x1460c3,_0x4db3ad){var _0x4f9ef7={'raw':![],'where':{'id':_0x1460c3['params']['id']},'include':[{'model':db['Pause'],'as':_0x1782('0x3c')}]},_0x4bf48e={};_0x4bf48e['model']=_[_0x1782('0x43')](db['FaxAccount']['rawAttributes']);_0x4bf48e[_0x1782('0x46')]=_[_0x1782('0x43')](_0x1460c3['query']);_0x4bf48e['filters']=_[_0x1782('0x45')](_0x4bf48e['model'],_0x4bf48e['query']);_0x4f9ef7[_0x1782('0x47')]=_[_0x1782('0x45')](_0x4bf48e[_0x1782('0x42')],qs['fields'](_0x1460c3['query']['fields']));_0x4f9ef7[_0x1782('0x47')]=_0x4f9ef7[_0x1782('0x47')]['length']?_0x4f9ef7[_0x1782('0x47')]:_0x4bf48e[_0x1782('0x42')];if(_0x1460c3[_0x1782('0x46')][_0x1782('0x53')]){_0x4f9ef7['include']=[{'all':!![]}];}_0x4f9ef7=_['merge']({},_0x4f9ef7,_0x1460c3['options']);return db[_0x1782('0x52')][_0x1782('0x58')](_0x4f9ef7)['then'](handleEntityNotFound(_0x4db3ad,null))['then'](respondWithResult(_0x4db3ad,null))['catch'](handleError(_0x4db3ad,null));};exports[_0x1782('0x59')]=function(_0x472b5b,_0x153b01){return db[_0x1782('0x52')][_0x1782('0x59')](_0x472b5b[_0x1782('0x5a')],{})[_0x1782('0x20')](function(_0x313825){var _0x38a546=_0x472b5b[_0x1782('0x5b')]['get']({'plain':!![]});if(!_0x38a546)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38a546[_0x1782('0x5c')]===_0x1782('0x5b')){var _0x3a70fc=_0x313825[_0x1782('0x37')]({'plain':!![]});var _0x1a3d42=_0x1782('0x5d');return db[_0x1782('0x5e')][_0x1782('0x58')]({'where':{'name':_0x1a3d42,'userProfileId':_0x38a546[_0x1782('0x5f')]},'raw':!![]})['then'](function(_0x206a99){if(_0x206a99&&_0x206a99[_0x1782('0x60')]===0x0){return db[_0x1782('0x38')]['create']({'name':_0x3a70fc[_0x1782('0x3a')],'resourceId':_0x3a70fc['id'],'type':_0x206a99[_0x1782('0x3a')],'sectionId':_0x206a99['id']},{})[_0x1782('0x20')](function(){return _0x313825;});}else{return _0x313825;}})[_0x1782('0x57')](function(_0x5c18dc){logger[_0x1782('0x27')](_0x1782('0x61'),_0x5c18dc);throw _0x5c18dc;});}return _0x313825;})['then'](respondWithResult(_0x153b01,0xc9))[_0x1782('0x57')](handleError(_0x153b01,null));};exports['update']=function(_0x21c3d1,_0x5194c8){if(_0x21c3d1['body']['id']){delete _0x21c3d1[_0x1782('0x5a')]['id'];}return db[_0x1782('0x52')][_0x1782('0x58')]({'where':{'id':_0x21c3d1[_0x1782('0x62')]['id']},'include':[{'model':db[_0x1782('0x63')],'as':_0x1782('0x3c')}]})['then'](handleEntityNotFound(_0x5194c8,null))[_0x1782('0x20')](saveUpdates(_0x21c3d1[_0x1782('0x5a')],null))[_0x1782('0x20')](respondWithResult(_0x5194c8,null))[_0x1782('0x57')](handleError(_0x5194c8,null));};exports['destroy']=function(_0x101f00,_0x3ad595){return db[_0x1782('0x52')][_0x1782('0x58')]({'where':{'id':_0x101f00[_0x1782('0x62')]['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x3ad595,null))['then'](removeEntity(_0x3ad595,null))[_0x1782('0x57')](handleError(_0x3ad595,null));};exports[_0x1782('0x64')]=function(_0x2970c0,_0x542b97){return db[_0x1782('0x52')][_0x1782('0x64')]()[_0x1782('0x20')](respondWithResult(_0x542b97,null))[_0x1782('0x57')](handleError(_0x542b97,null));};exports[_0x1782('0x65')]=function(_0xaa3c27,_0x25c2ee,_0x2610dd){if(_0xaa3c27['body']['id']){delete _0xaa3c27[_0x1782('0x5a')]['id'];}return db['FaxAccount'][_0x1782('0x58')]({'where':{'id':_0xaa3c27[_0x1782('0x62')]['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x25c2ee,null))[_0x1782('0x20')](function(_0x4ff251){if(_0x4ff251){_0xaa3c27[_0x1782('0x5a')]['FaxAccountId']=_0x4ff251['id'];return db['Disposition']['create'](_0xaa3c27[_0x1782('0x5a')]);}})[_0x1782('0x20')](respondWithResult(_0x25c2ee,null))[_0x1782('0x57')](handleError(_0x25c2ee,null));};exports[_0x1782('0x66')]=function(_0x55a15b,_0x56ba91,_0x3635ce){var _0x4d59a3={'raw':![],'where':{}};var _0x3d2bd9={};var _0xc8e611={'count':0x0,'rows':[]};return db[_0x1782('0x52')][_0x1782('0x67')]({'where':{'id':_0x55a15b[_0x1782('0x62')]['id']}})['then'](handleEntityNotFound(_0x56ba91,null))[_0x1782('0x20')](function(_0x65b1bd){if(_0x65b1bd){_0x3d2bd9[_0x1782('0x42')]=_['keys'](db[_0x1782('0x68')][_0x1782('0x3e')]);_0x3d2bd9[_0x1782('0x46')]=_[_0x1782('0x43')](_0x55a15b['query']);_0x3d2bd9[_0x1782('0x44')]=_['intersection'](_0x3d2bd9[_0x1782('0x42')],_0x3d2bd9[_0x1782('0x46')]);_0x4d59a3[_0x1782('0x47')]=_[_0x1782('0x45')](_0x3d2bd9[_0x1782('0x42')],qs[_0x1782('0x48')](_0x55a15b[_0x1782('0x46')][_0x1782('0x48')]));_0x4d59a3[_0x1782('0x47')]=_0x4d59a3['attributes'][_0x1782('0x49')]?_0x4d59a3[_0x1782('0x47')]:_0x3d2bd9[_0x1782('0x42')];if(!_0x55a15b[_0x1782('0x46')]['hasOwnProperty']('nolimit')){_0x4d59a3[_0x1782('0x2e')]=qs[_0x1782('0x2e')](_0x55a15b['query'][_0x1782('0x2e')]);_0x4d59a3[_0x1782('0x2d')]=qs['offset'](_0x55a15b[_0x1782('0x46')][_0x1782('0x2d')]);}_0x4d59a3[_0x1782('0x4c')]=qs[_0x1782('0x69')](_0x55a15b[_0x1782('0x46')][_0x1782('0x69')]);_0x4d59a3[_0x1782('0x4d')]=qs[_0x1782('0x44')](_[_0x1782('0x6a')](_0x55a15b['query'],_0x3d2bd9[_0x1782('0x44')]));_0x4d59a3[_0x1782('0x4d')][_0x1782('0x6b')]=_0x65b1bd['id'];if(_0x55a15b[_0x1782('0x46')][_0x1782('0x4e')]){_0x4d59a3[_0x1782('0x4d')]=_['merge'](_0x4d59a3[_0x1782('0x4d')],{'$or':_[_0x1782('0x3d')](_0x4d59a3[_0x1782('0x47')],function(_0x1c2fd3){var _0x1ab5be={};_0x1ab5be[_0x1c2fd3]={'$like':'%'+_0x55a15b[_0x1782('0x46')]['filter']+'%'};return _0x1ab5be;})});}_0x4d59a3=_[_0x1782('0x4f')]({},_0x4d59a3,_0x55a15b[_0x1782('0x51')]);return db['Disposition']['count']({'where':_0x4d59a3[_0x1782('0x4d')]})[_0x1782('0x20')](function(_0x273858){_0xc8e611['count']=_0x273858;if(_0x55a15b['query'][_0x1782('0x53')]){_0x4d59a3['include']=[{'all':!![]}];}return db[_0x1782('0x68')][_0x1782('0x55')](_0x4d59a3);})[_0x1782('0x20')](function(_0x17d4cc){_0xc8e611[_0x1782('0x56')]=_0x17d4cc;return _0xc8e611;});}})[_0x1782('0x20')](respondWithFilteredResult(_0x56ba91,_0x4d59a3))[_0x1782('0x57')](handleError(_0x56ba91,null));};exports[_0x1782('0x6c')]=function(_0x5de6c9,_0x56d83f,_0xcfc816){return db['FaxAccount'][_0x1782('0x58')]({'where':{'id':_0x5de6c9['params']['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x56d83f,null))[_0x1782('0x20')](function(_0x4f95b0){if(_0x4f95b0){return _0x4f95b0[_0x1782('0x6c')](_0x5de6c9[_0x1782('0x46')][_0x1782('0x6d')]);}})[_0x1782('0x20')](respondWithStatusCode(_0x56d83f,null))[_0x1782('0x57')](handleError(_0x56d83f,null));};exports[_0x1782('0x6e')]=function(_0x1843cc,_0x439a31,_0x39591a){if(_0x1843cc[_0x1782('0x5a')]['id']){delete _0x1843cc[_0x1782('0x5a')]['id'];}return db[_0x1782('0x52')][_0x1782('0x58')]({'where':{'id':_0x1843cc['params']['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x439a31,null))[_0x1782('0x20')](function(_0x4e8748){if(_0x4e8748){_0x1843cc[_0x1782('0x5a')][_0x1782('0x6b')]=_0x4e8748['id'];return db[_0x1782('0x6f')]['create'](_0x1843cc[_0x1782('0x5a')]);}})[_0x1782('0x20')](respondWithResult(_0x439a31,null))[_0x1782('0x57')](handleError(_0x439a31,null));};exports[_0x1782('0x70')]=function(_0x4d5540,_0x318518,_0x460242){var _0x19aa7d={'raw':![],'where':{}};var _0x15462a={};var _0x45f273={'count':0x0,'rows':[]};return db[_0x1782('0x52')][_0x1782('0x67')]({'where':{'id':_0x4d5540['params']['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x318518,null))[_0x1782('0x20')](function(_0x3387d3){if(_0x3387d3){_0x15462a[_0x1782('0x42')]=_['keys'](db[_0x1782('0x6f')]['rawAttributes']);_0x15462a[_0x1782('0x46')]=_['keys'](_0x4d5540[_0x1782('0x46')]);_0x15462a[_0x1782('0x44')]=_[_0x1782('0x45')](_0x15462a[_0x1782('0x42')],_0x15462a['query']);_0x19aa7d['attributes']=_[_0x1782('0x45')](_0x15462a[_0x1782('0x42')],qs[_0x1782('0x48')](_0x4d5540['query'][_0x1782('0x48')]));_0x19aa7d['attributes']=_0x19aa7d['attributes'][_0x1782('0x49')]?_0x19aa7d[_0x1782('0x47')]:_0x15462a['model'];if(!_0x4d5540[_0x1782('0x46')][_0x1782('0x4a')](_0x1782('0x4b'))){_0x19aa7d[_0x1782('0x2e')]=qs[_0x1782('0x2e')](_0x4d5540['query'][_0x1782('0x2e')]);_0x19aa7d[_0x1782('0x2d')]=qs[_0x1782('0x2d')](_0x4d5540[_0x1782('0x46')][_0x1782('0x2d')]);}_0x19aa7d[_0x1782('0x4c')]=qs['sort'](_0x4d5540[_0x1782('0x46')]['sort']);_0x19aa7d[_0x1782('0x4d')]=qs[_0x1782('0x44')](_[_0x1782('0x6a')](_0x4d5540[_0x1782('0x46')],_0x15462a[_0x1782('0x44')]));_0x19aa7d['where']['FaxAccountId']=_0x3387d3['id'];if(_0x4d5540[_0x1782('0x46')]['filter']){_0x19aa7d[_0x1782('0x4d')]=_[_0x1782('0x4f')](_0x19aa7d['where'],{'$or':_[_0x1782('0x3d')](_0x19aa7d['attributes'],function(_0x3e2305){var _0xadc4ee={};_0xadc4ee[_0x3e2305]={'$like':'%'+_0x4d5540['query'][_0x1782('0x4e')]+'%'};return _0xadc4ee;})});}_0x19aa7d=_['merge']({},_0x19aa7d,_0x4d5540['options']);return db[_0x1782('0x6f')][_0x1782('0x30')]({'where':_0x19aa7d[_0x1782('0x4d')]})[_0x1782('0x20')](function(_0x594b46){_0x45f273[_0x1782('0x30')]=_0x594b46;if(_0x4d5540['query']['includeAll']){_0x19aa7d[_0x1782('0x54')]=[{'all':!![]}];}return db[_0x1782('0x6f')][_0x1782('0x55')](_0x19aa7d);})[_0x1782('0x20')](function(_0x50ab5a){_0x45f273[_0x1782('0x56')]=_0x50ab5a;return _0x45f273;});}})[_0x1782('0x20')](respondWithFilteredResult(_0x318518,_0x19aa7d))[_0x1782('0x57')](handleError(_0x318518,null));};exports[_0x1782('0x71')]=function(_0x228c65,_0x1aabe3,_0x116fd0){return db[_0x1782('0x52')][_0x1782('0x58')]({'where':{'id':_0x228c65['params']['id']}})['then'](handleEntityNotFound(_0x1aabe3,null))['then'](function(_0x2af046){if(_0x2af046){return _0x2af046[_0x1782('0x71')](_0x228c65['query'][_0x1782('0x6d')]);}})[_0x1782('0x20')](respondWithStatusCode(_0x1aabe3,null))[_0x1782('0x57')](handleError(_0x1aabe3,null));};exports['addInteraction']=function(_0x424830,_0xe5b73f,_0x21c809){return db[_0x1782('0x72')]['find']({'where':{'id':_0x424830[_0x1782('0x62')]['id']}})['then'](handleEntityNotFound(_0xe5b73f,null))[_0x1782('0x20')](function(_0x34ef12){if(_0x34ef12){return _0x34ef12[_0x1782('0x73')](_0x424830[_0x1782('0x5a')][_0x1782('0x6d')],_[_0x1782('0x74')](_0x424830[_0x1782('0x5a')],[_0x1782('0x6d'),'id'])||{});}})[_0x1782('0x20')](respondWithResult(_0xe5b73f,null))[_0x1782('0x57')](handleError(_0xe5b73f,null));};exports[_0x1782('0x75')]=function(_0x28e22a,_0x525f88,_0x517678){var _0xa5630a={'raw':![],'where':{}};var _0x2a4850={};var _0x21d869={'count':0x0,'rows':[]};return db[_0x1782('0x52')][_0x1782('0x67')]({'where':{'id':_0x28e22a[_0x1782('0x62')]['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x525f88,null))[_0x1782('0x20')](function(_0x3253ad){if(_0x3253ad){_0x2a4850['model']=_[_0x1782('0x43')](db[_0x1782('0x72')][_0x1782('0x3e')]);_0x2a4850[_0x1782('0x46')]=_[_0x1782('0x43')](_0x28e22a[_0x1782('0x46')]);_0x2a4850[_0x1782('0x44')]=_[_0x1782('0x45')](_0x2a4850[_0x1782('0x42')],_0x2a4850[_0x1782('0x46')]);_0xa5630a[_0x1782('0x47')]=_[_0x1782('0x45')](_0x2a4850['model'],qs[_0x1782('0x48')](_0x28e22a['query'][_0x1782('0x48')]));_0xa5630a[_0x1782('0x47')]=_0xa5630a[_0x1782('0x47')][_0x1782('0x49')]?_0xa5630a[_0x1782('0x47')]:_0x2a4850[_0x1782('0x42')];if(!_0x28e22a[_0x1782('0x46')][_0x1782('0x4a')]('nolimit')){_0xa5630a['limit']=qs[_0x1782('0x2e')](_0x28e22a[_0x1782('0x46')][_0x1782('0x2e')]);_0xa5630a[_0x1782('0x2d')]=qs[_0x1782('0x2d')](_0x28e22a['query'][_0x1782('0x2d')]);}_0xa5630a[_0x1782('0x4c')]=qs['sort'](_0x28e22a[_0x1782('0x46')]['sort']);_0xa5630a[_0x1782('0x4d')]=qs[_0x1782('0x44')](_[_0x1782('0x6a')](_0x28e22a[_0x1782('0x46')],_0x2a4850['filters']));_0xa5630a[_0x1782('0x4d')][_0x1782('0x6b')]=_0x3253ad['id'];if(_0x28e22a[_0x1782('0x46')][_0x1782('0x4e')]){_0xa5630a[_0x1782('0x4d')]=_[_0x1782('0x4f')](_0xa5630a[_0x1782('0x4d')],{'$or':_[_0x1782('0x3d')](_0xa5630a[_0x1782('0x47')],function(_0x33fa98){var _0x5625a3={};_0x5625a3[_0x33fa98]={'$like':'%'+_0x28e22a[_0x1782('0x46')][_0x1782('0x4e')]+'%'};return _0x5625a3;})});}_0xa5630a=_[_0x1782('0x4f')]({},_0xa5630a,_0x28e22a[_0x1782('0x51')]);return db['FaxInteraction'][_0x1782('0x30')]({'where':_0xa5630a['where']})[_0x1782('0x20')](function(_0x318d71){_0x21d869[_0x1782('0x30')]=_0x318d71;if(_0x28e22a[_0x1782('0x46')][_0x1782('0x53')]){_0xa5630a[_0x1782('0x54')]=[{'model':db['CmContact'],'as':_0x1782('0x76'),'required':![]},{'model':db[_0x1782('0x77')],'as':'Owner','attributes':[_0x1782('0x3a'),_0x1782('0x78'),_0x1782('0x79')],'required':![]},{'model':db[_0x1782('0x7a')],'as':_0x1782('0x7b'),'attributes':['id',_0x1782('0x3a'),_0x1782('0x7c')],'where':_0x28e22a[_0x1782('0x46')][_0x1782('0x7d')]?{'id':_0x28e22a[_0x1782('0x46')][_0x1782('0x7d')]}:undefined,'required':_0x28e22a['query']['tag']?!![]:![]}];}return db[_0x1782('0x72')][_0x1782('0x55')](_0xa5630a);})[_0x1782('0x20')](function(_0x5e319b){_0x21d869['rows']=_0x5e319b;return _0x21d869;});}})[_0x1782('0x20')](respondWithFilteredResult(_0x525f88,_0xa5630a))[_0x1782('0x57')](handleError(_0x525f88,null));};exports[_0x1782('0x7e')]=function(_0x5a1d3a,_0x1d8c01,_0xce6556){return db[_0x1782('0x52')]['findOne']({'where':{'id':_0x5a1d3a[_0x1782('0x62')]['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x1d8c01,null))[_0x1782('0x20')](function(_0x21e830){if(_0x21e830){return db[_0x1782('0x7f')][_0x1782('0x80')](function(_0x28e195){return db[_0x1782('0x81')][_0x1782('0x36')]({'where':{'FaxAccountId':_0x5a1d3a[_0x1782('0x62')]['id']},'transaction':_0x28e195})[_0x1782('0x20')](function(_0x230626){var _0x1575f4=_[_0x1782('0x3d')](_0x5a1d3a['body'],function(_0x5ec21d){_0x5ec21d[_0x1782('0x6b')]=_0x5a1d3a[_0x1782('0x62')]['id'];return _0x5ec21d;});return db[_0x1782('0x81')][_0x1782('0x82')](_0x1575f4,{'transaction':_0x28e195});});})[_0x1782('0x20')](function(){return db[_0x1782('0x81')][_0x1782('0x83')]({'where':{'FaxAccountId':_0x5a1d3a[_0x1782('0x62')]['id']},'order':_0x1782('0x84')});});}})[_0x1782('0x20')](respondWithResult(_0x1d8c01,null))[_0x1782('0x57')](handleError(_0x1d8c01,null));};exports[_0x1782('0x85')]=function(_0x43907c,_0x1e4aca,_0x1ba6fc){var _0x69e91a={};var _0x46ef88={};var _0x7bff9f;var _0x4393c3;return db['FaxAccount']['findOne']({'where':{'id':_0x43907c[_0x1782('0x62')]['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x1e4aca,null))[_0x1782('0x20')](function(_0x17242d){if(_0x17242d){_0x7bff9f=_0x17242d;_0x46ef88['model']=_[_0x1782('0x43')](db[_0x1782('0x81')][_0x1782('0x3e')]);_0x46ef88[_0x1782('0x46')]=_[_0x1782('0x43')](_0x43907c[_0x1782('0x46')]);_0x46ef88['filters']=_[_0x1782('0x45')](_0x46ef88[_0x1782('0x42')],_0x46ef88[_0x1782('0x46')]);_0x69e91a[_0x1782('0x47')]=_[_0x1782('0x45')](_0x46ef88[_0x1782('0x42')],qs[_0x1782('0x48')](_0x43907c['query'][_0x1782('0x48')]));_0x69e91a['attributes']=_0x69e91a[_0x1782('0x47')][_0x1782('0x49')]?_0x69e91a[_0x1782('0x47')]:_0x46ef88[_0x1782('0x42')];_0x69e91a[_0x1782('0x4c')]=qs[_0x1782('0x69')](_0x43907c[_0x1782('0x46')][_0x1782('0x69')]);_0x69e91a[_0x1782('0x4d')]=qs[_0x1782('0x44')](_[_0x1782('0x6a')](_0x43907c[_0x1782('0x46')],_0x46ef88['filters']));if(_0x43907c['query'][_0x1782('0x4e')]){_0x69e91a[_0x1782('0x4d')]=_[_0x1782('0x4f')](_0x69e91a['where'],{'$or':_[_0x1782('0x3d')](_0x69e91a[_0x1782('0x47')],function(_0x3bdcc4){var _0x29b532={};_0x29b532[_0x3bdcc4]={'$like':'%'+_0x43907c[_0x1782('0x46')][_0x1782('0x4e')]+'%'};return _0x29b532;})});}_0x69e91a=_['merge']({},_0x69e91a,_0x43907c['options']);return _0x7bff9f[_0x1782('0x85')](_0x69e91a);}})[_0x1782('0x20')](function(_0x3bea65){if(_0x3bea65){_0x4393c3=_0x3bea65['length'];if(!_0x43907c['query'][_0x1782('0x4a')](_0x1782('0x4b'))){_0x69e91a[_0x1782('0x2e')]=qs[_0x1782('0x2e')](_0x43907c['query']['limit']);_0x69e91a[_0x1782('0x2d')]=qs[_0x1782('0x2d')](_0x43907c[_0x1782('0x46')][_0x1782('0x2d')]);}return _0x7bff9f[_0x1782('0x85')](_0x69e91a);}})[_0x1782('0x20')](function(_0x24f815){if(_0x24f815){return _0x24f815?{'count':_0x4393c3,'rows':_0x24f815}:null;}})[_0x1782('0x20')](respondWithResult(_0x1e4aca,null))['catch'](handleError(_0x1e4aca,null));};function Extension(_0x5f0eaf,_0x510b1f,_0x5150be,_0x3b4802){this[_0x1782('0x86')]=_0x1782('0x87');this[_0x1782('0x88')]=_0x5f0eaf[_0x1782('0x89')];this[_0x1782('0x8a')]=_0x3b4802;this['type']=_0x1782('0x8b');this['description']='Fax\x20Extension';this[_0x1782('0x6b')]=_0x5f0eaf['id'];this[_0x1782('0x84')]=_0x510b1f;this[_0x1782('0x8c')]=_0x5150be;}function createExtensionsReciveFax(_0x2f22e1){var _0x5eabc9=0x1;var _0x3fa540=[];_0x3fa540[_0x1782('0x8d')](new Extension(_0x2f22e1,_0x5eabc9,'',_0x1782('0x8e')));_0x5eabc9+=0x1;_0x3fa540['push'](new Extension(_0x2f22e1,_0x5eabc9,_0x1782('0x8f'),_0x1782('0x90')));_0x5eabc9+=0x1;for(var _0x22868b in _0x2f22e1){if(_0x2f22e1['hasOwnProperty'](_0x22868b)&&(_0x22868b==='ecm'||_0x22868b===_0x1782('0x89')||_0x22868b==='gateway'||_0x22868b===_0x1782('0x91')||_0x22868b===_0x1782('0x92')||_0x22868b===_0x1782('0x93')||_0x22868b===_0x1782('0x94')||_0x22868b===_0x1782('0x95')||_0x22868b==='t38timeout')){_0x3fa540['push'](new Extension(_0x2f22e1,_0x5eabc9,'FAXOPT('+_0x22868b+')='+_0x2f22e1[_0x22868b],_0x1782('0x90')));_0x5eabc9+=0x1;}}_0x3fa540['push'](new Extension(_0x2f22e1,_0x5eabc9,'6',_0x1782('0x96')));_0x5eabc9+=0x1;_0x3fa540[_0x1782('0x8d')](new Extension(_0x2f22e1,_0x5eabc9,_0x1782('0x97'),_0x1782('0x98')));_0x5eabc9=0x0;return _0x3fa540;}exports['addAccountApplications']=function(_0x388412,_0x1dc6b8,_0x2fe5f0){var _0x1aeeb7;return db[_0x1782('0x7f')]['transaction'](function(_0x12b881){return db[_0x1782('0x52')][_0x1782('0x59')](_0x388412[_0x1782('0x5a')],{'transaction':_0x12b881})[_0x1782('0x20')](function(_0x1d18b3){_0x1aeeb7=_0x1d18b3[_0x1782('0x37')]({'plain':!![]});return db[_0x1782('0x99')][_0x1782('0x82')](createExtensionsReciveFax(_0x1aeeb7),{'transaction':_0x12b881});});})[_0x1782('0x20')](function(){return _0x1aeeb7;})['then'](respondWithResult(_0x1dc6b8,null))[_0x1782('0x57')](handleError(_0x1dc6b8,null));};exports[_0x1782('0x9a')]=function(_0x9f24a4,_0x57c27c,_0x5695f3){var _0x26640e;return db[_0x1782('0x7f')][_0x1782('0x80')](function(_0x36a0dd){return db['FaxAccount'][_0x1782('0x35')](_0x9f24a4[_0x1782('0x5a')],{'where':{'id':_0x9f24a4[_0x1782('0x5a')]['id']},'transaction':_0x36a0dd})[_0x1782('0x20')](function(_0x343a31){return db[_0x1782('0x99')][_0x1782('0x36')]({'where':{'FaxAccountId':_0x9f24a4[_0x1782('0x5a')]['id']},'transaction':_0x36a0dd})[_0x1782('0x20')](function(_0x44b2ca){return db[_0x1782('0x99')][_0x1782('0x82')](createExtensionsReciveFax(_[_0x1782('0x74')](_0x9f24a4[_0x1782('0x5a')],[_0x1782('0x9b'),_0x1782('0x41'),'createdAt','updatedAt',_0x1782('0x9c'),_0x1782('0x9d')])),{'transaction':_0x36a0dd});});});})['then'](function(){return db[_0x1782('0x52')]['findById'](_0x9f24a4['body']['id']);})[_0x1782('0x20')](respondWithResult(_0x57c27c,null))['catch'](handleError(_0x57c27c,null));};exports[_0x1782('0x9e')]=function(_0x4bc1b0,_0x4edb42,_0x19212d){var _0x4c78b6={'raw':!![],'where':{}};var _0x52fb29={};var _0xb6b997={'count':0x0,'rows':[]};return db[_0x1782('0x52')][_0x1782('0x67')]({'where':{'id':_0x4bc1b0[_0x1782('0x62')]['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x4edb42,null))[_0x1782('0x20')](function(_0xe63d4d){if(_0xe63d4d){_0x52fb29[_0x1782('0x42')]=_[_0x1782('0x43')](db['FaxMessage'][_0x1782('0x3e')]);_0x52fb29['query']=_[_0x1782('0x43')](_0x4bc1b0[_0x1782('0x46')]);_0x52fb29['filters']=_[_0x1782('0x45')](_0x52fb29[_0x1782('0x42')],_0x52fb29['query']);_0x4c78b6[_0x1782('0x47')]=_[_0x1782('0x45')](_0x52fb29[_0x1782('0x42')],qs[_0x1782('0x48')](_0x4bc1b0[_0x1782('0x46')][_0x1782('0x48')]));_0x4c78b6[_0x1782('0x47')]=_0x4c78b6[_0x1782('0x47')][_0x1782('0x49')]?_0x4c78b6[_0x1782('0x47')]:_0x52fb29[_0x1782('0x42')];if(!_0x4bc1b0['query'][_0x1782('0x4a')](_0x1782('0x4b'))){_0x4c78b6['limit']=qs[_0x1782('0x2e')](_0x4bc1b0[_0x1782('0x46')][_0x1782('0x2e')]);_0x4c78b6[_0x1782('0x2d')]=qs[_0x1782('0x2d')](_0x4bc1b0[_0x1782('0x46')][_0x1782('0x2d')]);}_0x4c78b6[_0x1782('0x4c')]=qs[_0x1782('0x69')](_0x4bc1b0[_0x1782('0x46')]['sort']);_0x4c78b6[_0x1782('0x4d')]=qs[_0x1782('0x44')](_[_0x1782('0x6a')](_0x4bc1b0[_0x1782('0x46')],_0x52fb29[_0x1782('0x44')]));_0x4c78b6[_0x1782('0x4d')][_0x1782('0x6b')]=_0xe63d4d['id'];if(_0x4bc1b0[_0x1782('0x46')][_0x1782('0x4e')]){_0x4c78b6[_0x1782('0x4d')]=_[_0x1782('0x4f')](_0x4c78b6[_0x1782('0x4d')],{'$or':_[_0x1782('0x3d')](_0x4c78b6[_0x1782('0x47')],function(_0x154672){var _0x2eb0c4={};_0x2eb0c4[_0x154672]={'$like':'%'+_0x4bc1b0[_0x1782('0x46')][_0x1782('0x4e')]+'%'};return _0x2eb0c4;})});}if(_0x4bc1b0[_0x1782('0x46')][_0x1782('0x9f')]){var _0x187e6e=_0x4bc1b0['query'][_0x1782('0x9f')][_0x1782('0xa0')](',');var _0x3ab7e9={};_0x3ab7e9[_0x187e6e[0x0]]={'$gte':moment(_0x187e6e[0x1])[_0x1782('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4c78b6[_0x1782('0x4d')]=_[_0x1782('0x4f')](_0x4c78b6['where'],_0x3ab7e9);}_0x4c78b6=_[_0x1782('0x4f')]({},_0x4c78b6,_0x4bc1b0[_0x1782('0x51')]);return db[_0x1782('0xa2')]['count']({'where':_0x4c78b6[_0x1782('0x4d')]})[_0x1782('0x20')](function(_0x1260f9){_0xb6b997['count']=_0x1260f9;if(_0x4bc1b0[_0x1782('0x46')][_0x1782('0x53')]){_0x4c78b6[_0x1782('0x54')]=[{'all':!![]}];}return db[_0x1782('0xa2')][_0x1782('0x55')](_0x4c78b6);})['then'](function(_0x11092b){_0xb6b997[_0x1782('0x56')]=_0x11092b;return _0xb6b997;});}})['then'](respondWithFilteredResult(_0x4edb42,_0x4c78b6))['catch'](handleError(_0x4edb42,null));};exports[_0x1782('0x3b')]=function(_0x32cbaf,_0x200b91,_0x4aafd1){var _0x3383a1,_0x25d9e4={},_0x502953;if(_0x32cbaf[_0x1782('0x5a')]['to']){_0x502953=_0x32cbaf[_0x1782('0x5a')]['to'][0x0];}return db[_0x1782('0x52')][_0x1782('0x58')]({'where':{'id':_0x32cbaf[_0x1782('0x62')]['id']},'include':[{'model':db[_0x1782('0xa3')],'as':_0x1782('0xa4'),'include':[{'model':db[_0x1782('0xa5')],'as':'Contacts','where':{'fax':_0x502953},'limit':0x1,'order':[['updatedAt',_0x1782('0xa6')]]}]}]})[_0x1782('0x20')](handleEntityNotFound(_0x200b91,null))[_0x1782('0x20')](function(_0x2be4bf){_0x3383a1=_0x2be4bf;if(_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')]&&_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')][_0x1782('0x49')]){for(var _0x46fe1f=0x0;_0x46fe1f<_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')][_0x1782('0x49')];_0x46fe1f+=0x1){_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')][_0x46fe1f]={'filename':_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')][_0x46fe1f]['name'],'id':_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')][_0x46fe1f]['id'],'path':path['join'](config[_0x1782('0xa8')],_0x1782('0xa9'),_0x32cbaf[_0x1782('0x5a')]['attachments'][_0x46fe1f][_0x1782('0xaa')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0x1782('0xab')](_0x32cbaf[_0x1782('0x62')]['id'])?undefined:_0x32cbaf[_0x1782('0x62')]['id'],'path':_[_0x1782('0xab')](_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')][0x0]['path'])?undefined:_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')][0x0][_0x1782('0x5')],'fax':_[_0x1782('0xab')](_0x32cbaf[_0x1782('0x5a')]['to'][0x0])?undefined:_0x32cbaf['body']['to'][0x0]},client9002);})[_0x1782('0x20')](function(){if(_0x3383a1){if(_['isNil'](_0x32cbaf[_0x1782('0x5a')][_0x1782('0xac')])){_0x32cbaf[_0x1782('0x5a')][_0x1782('0xac')]=util['format'](_0x1782('0xad'),_0x3383a1[_0x1782('0x3a')],_0x3383a1[_0x1782('0xae')]);}if(_0x3383a1[_0x1782('0xa4')]){if(_0x3383a1[_0x1782('0xa4')][_0x1782('0xaf')]['length']){return _0x3383a1[_0x1782('0xa4')][_0x1782('0xaf')][0x0];}else{return db[_0x1782('0xa5')]['create'](_[_0x1782('0x19')](_0x32cbaf[_0x1782('0x5a')],{'firstName':_0x32cbaf[_0x1782('0x5a')]['to'][0x0],'phone':_0x32cbaf['body']['to'][0x0],'fax':_0x32cbaf[_0x1782('0x5a')]['to'][0x0],'ListId':_0x3383a1['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x1782('0xb0'));}})['then'](function(_0x1d0ee7){if(_0x1d0ee7){return db[_0x1782('0x72')][_0x1782('0x58')]({'where':{'ContactId':_0x1d0ee7['id'],'closed':![],'FaxAccountId':_0x3383a1['id']}})[_0x1782('0x20')](function(_0x638a6e){if(_0x638a6e){return[_0x638a6e,![]];}return db[_0x1782('0x72')]['create']({'UserId':_0x32cbaf[_0x1782('0x5b')]['id'],'ContactId':_0x1d0ee7['id'],'FaxAccountId':_0x3383a1['id'],'fax':_0x32cbaf[_0x1782('0x5a')]['to'][0x0],'firstMsgDirection':_0x1782('0xb1'),'Messages':[_['merge'](_0x32cbaf[_0x1782('0x5a')],{'read':![],'body':_0x32cbaf['body']['attachments'][0x0][_0x1782('0xb2')],'FaxAccountId':_0x3383a1['id'],'UserId':_0x32cbaf[_0x1782('0x5b')]['id'],'ContactId':_0x1d0ee7['id'],'AttachmentId':_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x1782('0xb3')}]})[_0x1782('0x20')](function(_0x272e67){return[_0x272e67,!![]];});});}else{throw new Error(_0x1782('0xb4'));}})['spread'](function(_0x496c76,_0x1f02a7){if(_0x1f02a7){return _0x496c76;}return db[_0x1782('0xa2')][_0x1782('0x59')]({'direction':_0x1782('0xb1'),'read':![],'body':_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')][0x0][_0x1782('0xb2')],'FaxAccountId':_0x3383a1['id'],'FaxInteractionId':_0x496c76['id'],'UserId':_0x32cbaf[_0x1782('0x5b')]['id'],'ContactId':_0x496c76['ContactId'],'AttachmentId':_0x32cbaf['body'][_0x1782('0xa7')][0x0]['id']})['then'](function(_0x1a01e7){_0x496c76[_0x1782('0xb5')][_0x1782('0xb3')]=[];_0x496c76[_0x1782('0xb5')]['Messages'][_0x1782('0x8d')](_0x1a01e7[_0x1782('0xb5')]);return _0x496c76;});})[_0x1782('0x20')](function(_0xe6fa1d){respondWithRpcPromise(_0x1782('0xb6'),_0x1782('0xb6'),{'FaxAccountId':_[_0x1782('0xab')](_0x32cbaf[_0x1782('0x62')]['id'])?undefined:_0x32cbaf['params']['id'],'path':_[_0x1782('0xab')](_0x32cbaf[_0x1782('0x5a')][_0x1782('0xa7')][0x0][_0x1782('0x5')])?undefined:_0x32cbaf['body'][_0x1782('0xa7')][0x0]['path'],'fax':_['isNil'](_0x32cbaf['body']['to'][0x0])?undefined:_0x32cbaf[_0x1782('0x5a')]['to'][0x0],'AttachmentId':_0x32cbaf['body'][_0x1782('0xa7')][0x0]['id']},client9002)[_0x1782('0x20')](function(_0x13a58b){logger[_0x1782('0x21')](_0x1782('0xb7'),_0x13a58b);})[_0x1782('0x57')](function(_0x3492be){logger[_0x1782('0x21')](_0x1782('0xb7'),_0x3492be);});return _0xe6fa1d;})[_0x1782('0x20')](respondWithResult(_0x200b91,null))[_0x1782('0x57')](handleError(_0x200b91,null));};exports[_0x1782('0xb8')]=function(_0x1498cb,_0x112225,_0xd93b39){return db[_0x1782('0x52')]['find']({'where':{'id':_0x1498cb[_0x1782('0x62')]['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x112225,null))['then'](function(_0x528d06){if(_0x528d06){return _0x528d06['addAgents'](_0x1498cb[_0x1782('0x5a')][_0x1782('0x6d')],_[_0x1782('0x74')](_0x1498cb[_0x1782('0x5a')],[_0x1782('0x6d'),'id'])||{})[_0x1782('0xb9')](function(_0x4d308a){for(var _0xda2899=0x0;_0xda2899<_0x1498cb[_0x1782('0x5a')][_0x1782('0x6d')][_0x1782('0x49')];_0xda2899+=0x1){socket[_0x1782('0xba')]('userFaxAccount:save',{'UserId':Number(_0x1498cb[_0x1782('0x5a')][_0x1782('0x6d')][_0xda2899]),'FaxAccountId':Number(_0x1498cb['params']['id'])});}return _0x4d308a;});}})[_0x1782('0x20')](respondWithResult(_0x112225,null))['catch'](handleError(_0x112225,null));};exports[_0x1782('0xbb')]=function(_0x412a8d,_0x243353,_0x4d0a8f){return db[_0x1782('0x52')][_0x1782('0x58')]({'where':{'id':_0x412a8d[_0x1782('0x62')]['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x243353,null))[_0x1782('0x20')](function(_0x5185f7){if(_0x5185f7){return _0x5185f7['removeAgents'](_0x412a8d[_0x1782('0x46')]['ids'])[_0x1782('0x20')](function(){if(_[_0x1782('0xbc')](_0x412a8d[_0x1782('0x46')]['ids'])){for(var _0x28fbc7=0x0;_0x28fbc7<_0x412a8d[_0x1782('0x46')][_0x1782('0x6d')][_0x1782('0x49')];_0x28fbc7+=0x1){socket['emit'](_0x1782('0xbd'),{'UserId':Number(_0x412a8d[_0x1782('0x46')][_0x1782('0x6d')][_0x28fbc7]),'FaxAccountId':Number(_0x412a8d['params']['id'])});}}else{socket[_0x1782('0xba')]('userFaxAccount:remove',{'UserId':Number(_0x412a8d[_0x1782('0x46')]['ids']),'FaxAccountId':Number(_0x412a8d[_0x1782('0x62')]['id'])});}});}})[_0x1782('0x20')](respondWithStatusCode(_0x243353,null))[_0x1782('0x57')](handleError(_0x243353,null));};exports[_0x1782('0xbe')]=function(_0x465a54,_0x312786,_0x48743f){var _0xbfe011={};var _0x41b35d={};var _0x17daae;var _0x21161d;return db[_0x1782('0x52')][_0x1782('0x67')]({'where':{'id':_0x465a54['params']['id']}})[_0x1782('0x20')](handleEntityNotFound(_0x312786,null))['then'](function(_0x90e4d4){if(_0x90e4d4){_0x17daae=_0x90e4d4;_0x41b35d[_0x1782('0x42')]=_[_0x1782('0x43')](db[_0x1782('0x77')]['rawAttributes']);_0x41b35d[_0x1782('0x46')]=_['keys'](_0x465a54['query']);_0x41b35d[_0x1782('0x44')]=_[_0x1782('0x45')](_0x41b35d[_0x1782('0x42')],_0x41b35d[_0x1782('0x46')]);_0xbfe011[_0x1782('0x47')]=_['intersection'](_0x41b35d[_0x1782('0x42')],qs['fields'](_0x465a54[_0x1782('0x46')][_0x1782('0x48')]));_0xbfe011['attributes']=_0xbfe011[_0x1782('0x47')]['length']?_0xbfe011[_0x1782('0x47')]:_0x41b35d['model'];_0xbfe011[_0x1782('0x4c')]=qs[_0x1782('0x69')](_0x465a54[_0x1782('0x46')][_0x1782('0x69')]);_0xbfe011[_0x1782('0x4d')]=qs[_0x1782('0x44')](_['pick'](_0x465a54[_0x1782('0x46')],_0x41b35d['filters']));if(_0x465a54[_0x1782('0x46')][_0x1782('0x4e')]){_0xbfe011[_0x1782('0x4d')]=_[_0x1782('0x4f')](_0xbfe011[_0x1782('0x4d')],{'$or':_[_0x1782('0x3d')](_0xbfe011['attributes'],function(_0x43b178){var _0x3ba6f9={};_0x3ba6f9[_0x43b178]={'$like':'%'+_0x465a54[_0x1782('0x46')][_0x1782('0x4e')]+'%'};return _0x3ba6f9;})});}_0xbfe011=_[_0x1782('0x4f')]({},_0xbfe011,_0x465a54[_0x1782('0x51')]);return _0x17daae['getAgents'](_0xbfe011);}})[_0x1782('0x20')](function(_0x4e1c93){if(_0x4e1c93){_0x21161d=_0x4e1c93[_0x1782('0x49')];if(!_0x465a54[_0x1782('0x46')]['hasOwnProperty'](_0x1782('0x4b'))){_0xbfe011[_0x1782('0x2e')]=qs[_0x1782('0x2e')](_0x465a54[_0x1782('0x46')][_0x1782('0x2e')]);_0xbfe011[_0x1782('0x2d')]=qs['offset'](_0x465a54[_0x1782('0x46')][_0x1782('0x2d')]);}return _0x17daae[_0x1782('0xbe')](_0xbfe011);}})[_0x1782('0x20')](function(_0xa82134){if(_0xa82134){return _0xa82134?{'count':_0x21161d,'rows':_0xa82134}:null;}})[_0x1782('0x20')](respondWithResult(_0x312786,null))[_0x1782('0x57')](handleError(_0x312786,null));};
\ No newline at end of file
index 29d33a7..b9e530d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26cc=['emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x26cc,0x1ed));var _0xc26c=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x26cc[_0x23b655];return _0x364b32;};'use strict';var EventEmitter=require(_0xc26c('0x0'));var FaxAccount=require(_0xc26c('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x384c4e){return function(_0x51d796,_0x14a533,_0x5ef1a9){FaxAccountEvents[_0xc26c('0x2')](_0x384c4e+':'+_0x51d796['id'],_0x51d796);FaxAccountEvents[_0xc26c('0x2')](_0x384c4e,_0x51d796);_0x5ef1a9(null);};}for(var e in events){if(events[_0xc26c('0x3')](e)){var event=events[e];FaxAccount[_0xc26c('0x4')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0xac96=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0xac96,0x149));var _0x6ac9=function(_0x584985,_0x31a01f){_0x584985=_0x584985-0x0;var _0x123c16=_0xac96[_0x584985];return _0x123c16;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x6ac9('0x0'))['db'][_0x6ac9('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6ac9('0x2')](0x0);var events={'afterCreate':_0x6ac9('0x3'),'afterUpdate':_0x6ac9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1e0671){return function(_0x5f1a24,_0x4b328f,_0x439dc6){FaxAccountEvents[_0x6ac9('0x5')](_0x1e0671+':'+_0x5f1a24['id'],_0x5f1a24);FaxAccountEvents[_0x6ac9('0x5')](_0x1e0671,_0x5f1a24);_0x439dc6(null);};}for(var e in events){if(events[_0x6ac9('0x6')](e)){var event=events[e];FaxAccount[_0x6ac9('0x7')](e,emitEvent(event));}}module[_0x6ac9('0x8')]=FaxAccountEvents;
\ No newline at end of file
index 53056df..8c0b45d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bf7=['request-promise','path','./faxAccount.attributes','define','util','../../config/logger','api','moment','bluebird'];(function(_0x4950fd,_0x5e8da3){var _0x193bf3=function(_0x373c86){while(--_0x373c86){_0x4950fd['push'](_0x4950fd['shift']());}};_0x193bf3(++_0x5e8da3);}(_0x6bf7,0x187));var _0x76bf=function(_0x3fcc8d,_0x1f0e71){_0x3fcc8d=_0x3fcc8d-0x0;var _0x238edb=_0x6bf7[_0x3fcc8d];return _0x238edb;};'use strict';var _=require('lodash');var util=require(_0x76bf('0x0'));var logger=require(_0x76bf('0x1'))(_0x76bf('0x2'));var moment=require(_0x76bf('0x3'));var BPromise=require(_0x76bf('0x4'));var rp=require(_0x76bf('0x5'));var fs=require('fs');var path=require(_0x76bf('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x76bf('0x7'));module['exports']=function(_0x39e91a,_0x58a7b0){return _0x39e91a[_0x76bf('0x8')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x65f5=['../../config/logger','api','bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','lodash'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x65f5,0x149));var _0x565f=function(_0x3a06e3,_0x5407ed){_0x3a06e3=_0x3a06e3-0x0;var _0x1c3a89=_0x65f5[_0x3a06e3];return _0x1c3a89;};'use strict';var _=require(_0x565f('0x0'));var util=require('util');var logger=require(_0x565f('0x1'))(_0x565f('0x2'));var moment=require('moment');var BPromise=require(_0x565f('0x3'));var rp=require(_0x565f('0x4'));var fs=require('fs');var path=require(_0x565f('0x5'));var rimraf=require(_0x565f('0x6'));var config=require('../../config/environment');var attributes=require(_0x565f('0x7'));module[_0x565f('0x8')]=function(_0x37f9da,_0x3b4400){return _0x37f9da[_0x565f('0x9')](_0x565f('0xa'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d41a3e9..1976aa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13dd=['FaxInteraction','spread','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetFaxAccount','FaxAccount','raw','options','where','attributes','limit','include','map','model','debug','stringify','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','updatedAt','difference','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','get','applications','Applications','list','length','contact'];(function(_0xa38587,_0x224f63){var _0x452b17=function(_0x2ca444){while(--_0x2ca444){_0xa38587['push'](_0xa38587['shift']());}};_0x452b17(++_0x224f63);}(_0x13dd,0x1c9));var _0xd13d=function(_0x104435,_0x557a97){_0x104435=_0x104435-0x0;var _0x142c76=_0x13dd[_0x104435];return _0x142c76;};'use strict';var _=require(_0xd13d('0x0'));var util=require(_0xd13d('0x1'));var moment=require('moment');var BPromise=require(_0xd13d('0x2'));var rs=require(_0xd13d('0x3'));var fs=require('fs');var Redis=require(_0xd13d('0x4'));var db=require(_0xd13d('0x5'))['db'];var utils=require(_0xd13d('0x6'));var logger=require(_0xd13d('0x7'))(_0xd13d('0x8'));var config=require(_0xd13d('0x9'));var jayson=require(_0xd13d('0xa'));var client=jayson['client']['http']({'port':0x232c});config[_0xd13d('0xb')]=_[_0xd13d('0xc')](config['redis'],{'host':_0xd13d('0xd'),'port':0x18eb});var socket=require(_0xd13d('0xe'))(new Redis(config[_0xd13d('0xb')]));require(_0xd13d('0xf'))[_0xd13d('0x10')](socket);function respondWithRpcPromise(_0x56b928,_0x540c43,_0x46fb74){return new BPromise(function(_0xfd732f,_0x5751c4){return client[_0xd13d('0x11')](_0x56b928,_0x46fb74)[_0xd13d('0x12')](function(_0x5bdc52){logger[_0xd13d('0x13')](_0xd13d('0x14'),_0x540c43,_0xd13d('0x15'));logger['debug'](_0xd13d('0x16'),_0x540c43,_0xd13d('0x15'),JSON['stringify'](_0x5bdc52));if(_0x5bdc52[_0xd13d('0x17')]){if(_0x5bdc52['error']['code']===0x1f4){logger[_0xd13d('0x17')]('FaxAccount,\x20%s,\x20%s',_0x540c43,_0x5bdc52[_0xd13d('0x17')][_0xd13d('0x18')]);return _0x5751c4(_0x5bdc52[_0xd13d('0x17')][_0xd13d('0x18')]);}logger[_0xd13d('0x17')]('FaxAccount,\x20%s,\x20%s',_0x540c43,_0x5bdc52[_0xd13d('0x17')][_0xd13d('0x18')]);return _0xfd732f(_0x5bdc52[_0xd13d('0x17')]['message']);}else{logger[_0xd13d('0x13')]('FaxAccount,\x20%s,\x20%s',_0x540c43,'request\x20sent');_0xfd732f(_0x5bdc52['result'][_0xd13d('0x18')]);}})[_0xd13d('0x19')](function(_0x289bf0){logger[_0xd13d('0x17')](_0xd13d('0x14'),_0x540c43,_0x289bf0);_0x5751c4(_0x289bf0);});});}exports[_0xd13d('0x1a')]=function(_0x46c903){var _0x5b9b91=this;return new Promise(function(_0x13009f,_0x250768){return db[_0xd13d('0x1b')]['findAll']({'raw':_0x46c903['options']?_0x46c903['options'][_0xd13d('0x1c')]===undefined?!![]:![]:!![],'where':_0x46c903['options']?_0x46c903[_0xd13d('0x1d')][_0xd13d('0x1e')]||null:null,'attributes':_0x46c903[_0xd13d('0x1d')]?_0x46c903[_0xd13d('0x1d')][_0xd13d('0x1f')]||null:null,'limit':_0x46c903[_0xd13d('0x1d')]?_0x46c903[_0xd13d('0x1d')][_0xd13d('0x20')]||null:null,'include':_0x46c903['options']?_0x46c903[_0xd13d('0x1d')][_0xd13d('0x21')]?_[_0xd13d('0x22')](_0x46c903[_0xd13d('0x1d')][_0xd13d('0x21')],function(_0x3f1183){return{'model':db[_0x3f1183[_0xd13d('0x23')]],'as':_0x3f1183['as'],'attributes':_0x3f1183[_0xd13d('0x1f')],'include':_0x3f1183[_0xd13d('0x21')]?_[_0xd13d('0x22')](_0x3f1183[_0xd13d('0x21')],function(_0x2cbfbc){return{'model':db[_0x2cbfbc[_0xd13d('0x23')]],'as':_0x2cbfbc['as'],'attributes':_0x2cbfbc[_0xd13d('0x1f')],'include':_0x2cbfbc[_0xd13d('0x21')]?_[_0xd13d('0x22')](_0x2cbfbc['include'],function(_0x352a59){return{'model':db[_0x352a59['model']],'as':_0x352a59['as'],'attributes':_0x352a59['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x404b2c){logger[_0xd13d('0x13')](_0xd13d('0x1a'),_0x46c903);logger[_0xd13d('0x24')]('GetFaxAccount',_0x46c903,JSON[_0xd13d('0x25')](_0x404b2c));_0x13009f(_0x404b2c);})[_0xd13d('0x19')](function(_0x339648){logger['error'](_0xd13d('0x1a'),_0x339648[_0xd13d('0x18')],_0x46c903);_0x250768(_0x5b9b91[_0xd13d('0x17')](0x1f4,_0x339648[_0xd13d('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x52cc34,_0x249a38,_0x16da52){var _0x173766=this;return new Promise(function(_0x408bf8,_0x2f8357){var _0x153e05={'body':_0x52cc34[_0xd13d('0x26')],'channel':_0xd13d('0x27')};var _0x279965=[];var _0x4ed361=[];var _0x2fc081={};return db[_0xd13d('0x28')][_0xd13d('0x29')]()[_0xd13d('0x12')](function(_0xd4d1b7){if(!_0xd4d1b7){throw new db[(_0xd13d('0x2a'))][(_0xd13d('0x2b'))](_0xd13d('0x2c'));}_0x279965=_['difference'](_[_0xd13d('0x2d')](_0xd4d1b7),['createdAt',_0xd13d('0x2e')]);_0x4ed361=_[_0xd13d('0x2f')](_['keys'](_0xd4d1b7),[_0xd13d('0x30'),_0xd13d('0x2e'),_0xd13d('0x31'),_0xd13d('0x32')]);if(_0x52cc34['body']['id']){delete _0x52cc34[_0xd13d('0x26')]['id'];}if(_[_0xd13d('0x33')](_0x52cc34['body'][_0xd13d('0x34')])){throw new db[(_0xd13d('0x2a'))][(_0xd13d('0x2b'))](_0xd13d('0x35'));}if(_[_0xd13d('0x33')](_0x52cc34[_0xd13d('0x26')][_0xd13d('0x26')])||_0x52cc34[_0xd13d('0x26')][_0xd13d('0x26')]===''){throw new db[(_0xd13d('0x2a'))][(_0xd13d('0x2b'))](_0xd13d('0x36'));}if(_['isNil'](_0x52cc34[_0xd13d('0x26')]['mapKey'])){throw new db[(_0xd13d('0x2a'))][(_0xd13d('0x2b'))](_0xd13d('0x37')+_0x4ed361);}if(!_[_0xd13d('0x38')](_0x4ed361,_0x52cc34[_0xd13d('0x26')][_0xd13d('0x39')])){throw new db[(_0xd13d('0x2a'))][(_0xd13d('0x2b'))](_0xd13d('0x3a')+_0x4ed361);}_0x2fc081[_0x52cc34[_0xd13d('0x26')][_0xd13d('0x39')]]=_0x52cc34['body'][_0xd13d('0x34')];})[_0xd13d('0x12')](function(){return db['FaxAccount'][_0xd13d('0x3b')]({'where':{'id':_0x52cc34[_0xd13d('0x3c')]['id']},'include':[{'model':db[_0xd13d('0x3d')],'as':_0xd13d('0x3e'),'include':[{'model':db[_0xd13d('0x28')],'as':_0xd13d('0x3f'),'where':_0x2fc081,'limit':0x1,'order':[['updatedAt',_0xd13d('0x40')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xd13d('0x12')](function(_0x97f6a1){if(_0x97f6a1&&_0x97f6a1['List']){var _0x5aa031=_0x97f6a1[_0xd13d('0x41')]({'plain':!![]});_0x153e05[_0xd13d('0x3c')]=_0x5aa031;_0x153e05[_0xd13d('0x42')]=_0x5aa031[_0xd13d('0x43')];_0x153e05[_0xd13d('0x44')]=_0x5aa031[_0xd13d('0x3e')];_0x153e05[_0xd13d('0x42')]=_['orderBy'](_0x153e05[_0xd13d('0x42')],['priority'],['asc']);if(_0x153e05[_0xd13d('0x3c')][_0xd13d('0x43')]){delete _0x153e05[_0xd13d('0x3c')][_0xd13d('0x43')];}if(_0x153e05['account']['List']&&_0x153e05[_0xd13d('0x3c')][_0xd13d('0x3e')][_0xd13d('0x3f')][_0xd13d('0x45')]){return _0x153e05[_0xd13d('0x3c')]['List'][_0xd13d('0x3f')][0x0];}var _0x599242=_[_0xd13d('0xc')](_0x52cc34['body'],{'firstName':_0x52cc34['body']['from'],'ListId':_0x5aa031[_0xd13d('0x32')]});_0x599242[_0x52cc34[_0xd13d('0x26')][_0xd13d('0x39')]]=_0x52cc34[_0xd13d('0x26')]['from'];return db['CmContact']['create'](_0x599242,{'fields':_0x279965,'raw':!![]});}})[_0xd13d('0x12')](function(_0x25877f){_0x153e05[_0xd13d('0x46')]=_0x25877f;if(_0x25877f){var _0x2bd240={'ContactId':_0x25877f['id'],'FaxAccountId':_0x52cc34['account']['id'],'fax':_0x25877f[_0xd13d('0x27')]};return db[_0xd13d('0x47')][_0xd13d('0x3b')]({'where':{'ContactId':_0x25877f['id'],'closed':![],'FaxAccountId':_0x52cc34[_0xd13d('0x3c')]['id']}})[_0xd13d('0x12')](function(_0x394a75){if(_0x394a75){return[_0x394a75,![]];}return db[_0xd13d('0x47')]['create'](_0x2bd240)[_0xd13d('0x12')](function(_0x5942db){return[_0x5942db,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xd13d('0x48')](function(_0x560973,_0x1505c2){var _0x4bfad4=_0x560973[_0xd13d('0x41')]({'plain':!![]});if(_0x1505c2){if(_0x153e05[_0xd13d('0x3c')]['autoclose']){_0x153e05['applications']['push']({'id':0x0,'priority':_0x153e05['applications'][_0xd13d('0x45')]+0x1,'app':'close','appdata':_0xd13d('0x49'),'interval':_0xd13d('0x4a')});}_0x4bfad4[_0xd13d('0x4b')]=!![];}else{_0x4bfad4[_0xd13d('0x4b')]=![];}_0x153e05[_0xd13d('0x4c')]=_0x4bfad4;return db[_0xd13d('0x4d')]['create']({'body':_0x52cc34[_0xd13d('0x26')][_0xd13d('0x26')],'FaxAccountId':_0x52cc34[_0xd13d('0x3c')]['id'],'FaxInteractionId':_0x560973['id'],'direction':'in','ContactId':_0x560973[_0xd13d('0x4e')],'AttachmentId':_0x52cc34[_0xd13d('0x26')][_0xd13d('0x4f')]});})[_0xd13d('0x12')](function(_0xe1c9a4){_0x153e05[_0xd13d('0x18')]=_0xe1c9a4;if(_0x153e05['interaction'][_0xd13d('0x50')]){return db[_0xd13d('0x51')]['find']({'attributes':['id',_0xd13d('0x52')],'where':{'id':_0x153e05[_0xd13d('0x4c')][_0xd13d('0x50')]}})[_0xd13d('0x12')](function(_0x57477a){if(_0x57477a){_0x153e05[_0xd13d('0x42')][_0xd13d('0x53')]({'id':0x0,'priority':0x0,'app':_0xd13d('0x54'),'appdata':_0x57477a[_0xd13d('0x52')]+','+(_0x153e05['account'][_0xd13d('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd13d('0x56'),_0xd13d('0x57'),_0x153e05);});}return respondWithRpcPromise(_0xd13d('0x56'),'startRouting',_0x153e05);})[_0xd13d('0x12')](function(_0x26abab){_0x408bf8(_0x26abab);})[_0xd13d('0x19')](function(_0x598d47){_0x2f8357(_0x173766[_0xd13d('0x17')](0x1f4,_0x598d47[_0xd13d('0x18')]));});});};
\ No newline at end of file
+var _0x6fd4=['no\x20available\x20attributes','keys','updatedAt','difference','createdAt','CompanyId','ListId','body','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','find','account','List','Contacts','FaxApplication','get','Applications','list','applications','orderBy','priority','defaults','create','FaxInteraction','spread','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','UserId','unshift','agent','name','Start','startRouting','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','FaxAccount','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','fax','CmContact','then','ValidationError'];(function(_0x425d86,_0x56b6fa){var _0x12450e=function(_0x3dc399){while(--_0x3dc399){_0x425d86['push'](_0x425d86['shift']());}};_0x12450e(++_0x56b6fa);}(_0x6fd4,0x139));var _0x46fd=function(_0x30b396,_0x34fb61){_0x30b396=_0x30b396-0x0;var _0x23fcee=_0x6fd4[_0x30b396];return _0x23fcee;};'use strict';var _=require('lodash');var util=require(_0x46fd('0x0'));var moment=require(_0x46fd('0x1'));var BPromise=require(_0x46fd('0x2'));var rs=require(_0x46fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46fd('0x4'))['db'];var utils=require(_0x46fd('0x5'));var logger=require('../../config/logger')(_0x46fd('0x6'));var config=require(_0x46fd('0x7'));var jayson=require(_0x46fd('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0x46fd('0x9')]=_['defaults'](config[_0x46fd('0x9')],{'host':_0x46fd('0xa'),'port':0x18eb});var socket=require(_0x46fd('0xb'))(new Redis(config[_0x46fd('0x9')]));require(_0x46fd('0xc'))[_0x46fd('0xd')](socket);function respondWithRpcPromise(_0x2534eb,_0x2f05b2,_0x35816a){return new BPromise(function(_0x1eb186,_0x162ae6){return client[_0x46fd('0xe')](_0x2534eb,_0x35816a)['then'](function(_0x2a6491){logger[_0x46fd('0xf')]('FaxAccount,\x20%s,\x20%s',_0x2f05b2,_0x46fd('0x10'));logger['debug'](_0x46fd('0x11'),_0x2f05b2,'request\x20sent',JSON[_0x46fd('0x12')](_0x2a6491));if(_0x2a6491[_0x46fd('0x13')]){if(_0x2a6491[_0x46fd('0x13')][_0x46fd('0x14')]===0x1f4){logger[_0x46fd('0x13')](_0x46fd('0x15'),_0x2f05b2,_0x2a6491[_0x46fd('0x13')][_0x46fd('0x16')]);return _0x162ae6(_0x2a6491[_0x46fd('0x13')][_0x46fd('0x16')]);}logger[_0x46fd('0x13')]('FaxAccount,\x20%s,\x20%s',_0x2f05b2,_0x2a6491[_0x46fd('0x13')]['message']);return _0x1eb186(_0x2a6491[_0x46fd('0x13')][_0x46fd('0x16')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x2f05b2,_0x46fd('0x10'));_0x1eb186(_0x2a6491[_0x46fd('0x17')][_0x46fd('0x16')]);}})[_0x46fd('0x18')](function(_0x2d0d99){logger[_0x46fd('0x13')]('FaxAccount,\x20%s,\x20%s',_0x2f05b2,_0x2d0d99);_0x162ae6(_0x2d0d99);});});}exports['GetFaxAccount']=function(_0x378b1d){var _0x1d0937=this;return new Promise(function(_0x18b470,_0x3249b8){return db[_0x46fd('0x19')]['findAll']({'raw':_0x378b1d[_0x46fd('0x1a')]?_0x378b1d[_0x46fd('0x1a')][_0x46fd('0x1b')]===undefined?!![]:![]:!![],'where':_0x378b1d[_0x46fd('0x1a')]?_0x378b1d[_0x46fd('0x1a')][_0x46fd('0x1c')]||null:null,'attributes':_0x378b1d[_0x46fd('0x1a')]?_0x378b1d[_0x46fd('0x1a')][_0x46fd('0x1d')]||null:null,'limit':_0x378b1d[_0x46fd('0x1a')]?_0x378b1d[_0x46fd('0x1a')][_0x46fd('0x1e')]||null:null,'include':_0x378b1d[_0x46fd('0x1a')]?_0x378b1d[_0x46fd('0x1a')][_0x46fd('0x1f')]?_[_0x46fd('0x20')](_0x378b1d[_0x46fd('0x1a')][_0x46fd('0x1f')],function(_0x12ddc8){return{'model':db[_0x12ddc8[_0x46fd('0x21')]],'as':_0x12ddc8['as'],'attributes':_0x12ddc8[_0x46fd('0x1d')],'include':_0x12ddc8[_0x46fd('0x1f')]?_[_0x46fd('0x20')](_0x12ddc8[_0x46fd('0x1f')],function(_0x56a388){return{'model':db[_0x56a388[_0x46fd('0x21')]],'as':_0x56a388['as'],'attributes':_0x56a388[_0x46fd('0x1d')],'include':_0x56a388[_0x46fd('0x1f')]?_[_0x46fd('0x20')](_0x56a388[_0x46fd('0x1f')],function(_0x4efab3){return{'model':db[_0x4efab3[_0x46fd('0x21')]],'as':_0x4efab3['as'],'attributes':_0x4efab3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4df5ea){logger[_0x46fd('0xf')]('GetFaxAccount',_0x378b1d);logger['debug'](_0x46fd('0x22'),_0x378b1d,JSON[_0x46fd('0x12')](_0x4df5ea));_0x18b470(_0x4df5ea);})['catch'](function(_0x2e8fa3){logger[_0x46fd('0x13')]('GetFaxAccount',_0x2e8fa3[_0x46fd('0x16')],_0x378b1d);_0x3249b8(_0x1d0937['error'](0x1f4,_0x2e8fa3[_0x46fd('0x16')]));});});};exports['NotifyFaxAccount']=function(_0x53e51b,_0x39f3ce,_0x5d80c9){var _0x56601e=this;return new Promise(function(_0x557b74,_0x15be02){var _0x4d0d8c={'body':_0x53e51b['body'],'channel':_0x46fd('0x23')};var _0x132aa1=[];var _0x797dff=[];var _0x24f69={};return db[_0x46fd('0x24')]['describe']()[_0x46fd('0x25')](function(_0x5d4b53){if(!_0x5d4b53){throw new db['Sequelize'][(_0x46fd('0x26'))](_0x46fd('0x27'));}_0x132aa1=_['difference'](_[_0x46fd('0x28')](_0x5d4b53),['createdAt',_0x46fd('0x29')]);_0x797dff=_[_0x46fd('0x2a')](_[_0x46fd('0x28')](_0x5d4b53),[_0x46fd('0x2b'),_0x46fd('0x29'),_0x46fd('0x2c'),_0x46fd('0x2d')]);if(_0x53e51b[_0x46fd('0x2e')]['id']){delete _0x53e51b[_0x46fd('0x2e')]['id'];}if(_[_0x46fd('0x2f')](_0x53e51b[_0x46fd('0x2e')][_0x46fd('0x30')])){throw new db[(_0x46fd('0x31'))]['ValidationError'](_0x46fd('0x32'));}if(_[_0x46fd('0x2f')](_0x53e51b[_0x46fd('0x2e')][_0x46fd('0x2e')])||_0x53e51b[_0x46fd('0x2e')]['body']===''){throw new db[(_0x46fd('0x31'))][(_0x46fd('0x26'))](_0x46fd('0x33'));}if(_[_0x46fd('0x2f')](_0x53e51b[_0x46fd('0x2e')][_0x46fd('0x34')])){throw new db[(_0x46fd('0x31'))][(_0x46fd('0x26'))](_0x46fd('0x35')+_0x797dff);}if(!_['includes'](_0x797dff,_0x53e51b['body']['mapKey'])){throw new db[(_0x46fd('0x31'))][(_0x46fd('0x26'))](_0x46fd('0x36')+_0x797dff);}_0x24f69[_0x53e51b['body']['mapKey']]=_0x53e51b[_0x46fd('0x2e')][_0x46fd('0x30')];})[_0x46fd('0x25')](function(){return db['FaxAccount'][_0x46fd('0x37')]({'where':{'id':_0x53e51b[_0x46fd('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0x46fd('0x39'),'include':[{'model':db['CmContact'],'as':_0x46fd('0x3a'),'where':_0x24f69,'limit':0x1,'order':[[_0x46fd('0x29'),'DESC']]}]},{'model':db[_0x46fd('0x3b')],'as':'Applications'}]});})['then'](function(_0x224824){if(_0x224824&&_0x224824[_0x46fd('0x39')]){var _0x3041ae=_0x224824[_0x46fd('0x3c')]({'plain':!![]});_0x4d0d8c[_0x46fd('0x38')]=_0x3041ae;_0x4d0d8c['applications']=_0x3041ae[_0x46fd('0x3d')];_0x4d0d8c[_0x46fd('0x3e')]=_0x3041ae[_0x46fd('0x39')];_0x4d0d8c[_0x46fd('0x3f')]=_[_0x46fd('0x40')](_0x4d0d8c[_0x46fd('0x3f')],[_0x46fd('0x41')],['asc']);if(_0x4d0d8c[_0x46fd('0x38')][_0x46fd('0x3d')]){delete _0x4d0d8c[_0x46fd('0x38')]['Applications'];}if(_0x4d0d8c['account']['List']&&_0x4d0d8c[_0x46fd('0x38')]['List']['Contacts']['length']){return _0x4d0d8c[_0x46fd('0x38')][_0x46fd('0x39')]['Contacts'][0x0];}var _0x418031=_[_0x46fd('0x42')](_0x53e51b[_0x46fd('0x2e')],{'firstName':_0x53e51b[_0x46fd('0x2e')][_0x46fd('0x30')],'ListId':_0x3041ae[_0x46fd('0x2d')]});_0x418031[_0x53e51b['body'][_0x46fd('0x34')]]=_0x53e51b[_0x46fd('0x2e')][_0x46fd('0x30')];return db[_0x46fd('0x24')][_0x46fd('0x43')](_0x418031,{'fields':_0x132aa1,'raw':!![]});}})[_0x46fd('0x25')](function(_0x4e0278){_0x4d0d8c['contact']=_0x4e0278;if(_0x4e0278){var _0x209193={'ContactId':_0x4e0278['id'],'FaxAccountId':_0x53e51b[_0x46fd('0x38')]['id'],'fax':_0x4e0278[_0x46fd('0x23')]};return db[_0x46fd('0x44')]['find']({'where':{'ContactId':_0x4e0278['id'],'closed':![],'FaxAccountId':_0x53e51b['account']['id']}})[_0x46fd('0x25')](function(_0x313c2d){if(_0x313c2d){return[_0x313c2d,![]];}return db[_0x46fd('0x44')]['create'](_0x209193)[_0x46fd('0x25')](function(_0xd0752d){return[_0xd0752d,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x46fd('0x45')](function(_0x4a6996,_0x5c15fc){var _0x414db9=_0x4a6996[_0x46fd('0x3c')]({'plain':!![]});if(_0x5c15fc){if(_0x4d0d8c[_0x46fd('0x38')][_0x46fd('0x46')]){_0x4d0d8c[_0x46fd('0x3f')][_0x46fd('0x47')]({'id':0x0,'priority':_0x4d0d8c[_0x46fd('0x3f')][_0x46fd('0x48')]+0x1,'app':_0x46fd('0x49'),'appdata':_0x46fd('0x4a'),'interval':_0x46fd('0x4b')});}_0x414db9[_0x46fd('0x4c')]=!![];}else{_0x414db9[_0x46fd('0x4c')]=![];}_0x4d0d8c[_0x46fd('0x4d')]=_0x414db9;return db[_0x46fd('0x4e')]['create']({'body':_0x53e51b['body'][_0x46fd('0x2e')],'FaxAccountId':_0x53e51b[_0x46fd('0x38')]['id'],'FaxInteractionId':_0x4a6996['id'],'direction':'in','ContactId':_0x4a6996[_0x46fd('0x4f')],'AttachmentId':_0x53e51b[_0x46fd('0x2e')][_0x46fd('0x50')]});})['then'](function(_0x3b61d1){_0x4d0d8c[_0x46fd('0x16')]=_0x3b61d1;if(_0x4d0d8c[_0x46fd('0x4d')]['UserId']){return db[_0x46fd('0x51')][_0x46fd('0x37')]({'attributes':['id','name'],'where':{'id':_0x4d0d8c[_0x46fd('0x4d')][_0x46fd('0x52')]}})['then'](function(_0x424562){if(_0x424562){_0x4d0d8c[_0x46fd('0x3f')][_0x46fd('0x53')]({'id':0x0,'priority':0x0,'app':_0x46fd('0x54'),'appdata':_0x424562[_0x46fd('0x55')]+','+(_0x4d0d8c['account']['waitForTheAssignedAgent']||0xa),'interval':_0x46fd('0x4b')});}return respondWithRpcPromise(_0x46fd('0x56'),_0x46fd('0x57'),_0x4d0d8c);});}return respondWithRpcPromise(_0x46fd('0x56'),'startRouting',_0x4d0d8c);})[_0x46fd('0x25')](function(_0x879494){_0x557b74(_0x879494);})['catch'](function(_0x82b4cf){_0x15be02(_0x56601e[_0x46fd('0x13')](0x1f4,_0x82b4cf['message']));});});};
\ No newline at end of file
index 71a7a0b..699a1cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41e3=['./faxAccount.events','remove','register','length','faxAccount:'];(function(_0x54d3d7,_0x51c17f){var _0x116ec2=function(_0x3893e7){while(--_0x3893e7){_0x54d3d7['push'](_0x54d3d7['shift']());}};_0x116ec2(++_0x51c17f);}(_0x41e3,0x6e));var _0x341e=function(_0x123239,_0x23d35a){_0x123239=_0x123239-0x0;var _0x5a6042=_0x41e3[_0x123239];return _0x5a6042;};'use strict';var FaxAccountEvents=require(_0x341e('0x0'));var events=['save',_0x341e('0x1'),'update'];function createListener(_0x21c6af,_0x10617d){return function(_0x34127c){_0x10617d['emit'](_0x21c6af,_0x34127c);};}function removeListener(_0x1d6079,_0x444dc7){return function(){FaxAccountEvents['removeListener'](_0x1d6079,_0x444dc7);};}exports[_0x341e('0x2')]=function(_0x209e1c){for(var _0x5a69f8=0x0,_0x1cd422=events[_0x341e('0x3')];_0x5a69f8<_0x1cd422;_0x5a69f8++){var _0x249c10=events[_0x5a69f8];var _0x48c926=createListener(_0x341e('0x4')+_0x249c10,_0x209e1c);FaxAccountEvents['on'](_0x249c10,_0x48c926);}};
\ No newline at end of file
+var _0x1c2f=['removeListener','register','length','faxAccount:','save','remove'];(function(_0x4ed571,_0x52e75e){var _0x3844bc=function(_0x322139){while(--_0x322139){_0x4ed571['push'](_0x4ed571['shift']());}};_0x3844bc(++_0x52e75e);}(_0x1c2f,0x1c0));var _0xf1c2=function(_0x355ad3,_0x36d054){_0x355ad3=_0x355ad3-0x0;var _0x9b9c8=_0x1c2f[_0x355ad3];return _0x9b9c8;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xf1c2('0x0'),_0xf1c2('0x1'),'update'];function createListener(_0x5dc7de,_0xaa0d0f){return function(_0x19b801){_0xaa0d0f['emit'](_0x5dc7de,_0x19b801);};}function removeListener(_0x3924a6,_0x24ff22){return function(){FaxAccountEvents[_0xf1c2('0x2')](_0x3924a6,_0x24ff22);};}exports[_0xf1c2('0x3')]=function(_0x1201f7){for(var _0x56135b=0x0,_0x4a6ca7=events[_0xf1c2('0x4')];_0x56135b<_0x4a6ca7;_0x56135b++){var _0x4a35bb=events[_0x56135b];var _0xca6716=createListener(_0xf1c2('0x5')+_0x4a35bb,_0x1201f7);FaxAccountEvents['on'](_0x4a35bb,_0xca6716);}};
\ No newline at end of file
index aa2655a..97a0eed 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(_0x517e05,_0x322ae3){var _0x1e37a7=function(_0x25cd2c){while(--_0x25cd2c){_0x517e05['push'](_0x517e05['shift']());}};_0x1e37a7(++_0x322ae3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x5ad070,_0x712c85){var _0x352b9a=function(_0x7fc0c2){while(--_0x7fc0c2){_0x5ad070['push'](_0x5ad070['shift']());}};_0x352b9a(++_0x712c85);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 7317d16..9a7b796 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x331d=['STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x548b00,_0x39cd33){var _0x53ca05=function(_0x40ad96){while(--_0x40ad96){_0x548b00['push'](_0x548b00['shift']());}};_0x53ca05(++_0x39cd33);}(_0x331d,0x1e2));var _0xd331=function(_0x101537,_0x28f186){_0x101537=_0x101537-0x0;var _0x2901c6=_0x331d[_0x101537];return _0x2901c6;};'use strict';var Sequelize=require(_0xd331('0x0'));module[_0xd331('0x1')]={'priority':{'type':Sequelize[_0xd331('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd331('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd331('0x3')]},'interval':{'type':Sequelize[_0xd331('0x3')],'defaultValue':_0xd331('0x4')}};
\ No newline at end of file
+var _0x4cb4=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4cb4,0x194));var _0x44cb=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0x4cb4[_0x5805d7];return _0x170fe4;};'use strict';var Sequelize=require(_0x44cb('0x0'));module[_0x44cb('0x1')]={'priority':{'type':Sequelize[_0x44cb('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x44cb('0x3')},'appdata':{'type':Sequelize[_0x44cb('0x4')]()},'description':{'type':Sequelize[_0x44cb('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x44cb('0x6')}};
\ No newline at end of file
index 82180b1..994bf5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ea8=['bluebird','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','stack','name','send','map','FaxApplication','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','rows','params','rawAttributes','create','body','catch','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x1ba656,_0x22c6d0){var _0x4738ba=function(_0x8e3c40){while(--_0x8e3c40){_0x1ba656['push'](_0x1ba656['shift']());}};_0x4738ba(++_0x22c6d0);}(_0x9ea8,0x14a));var _0x89ea=function(_0x35dc0c,_0x25f22a){_0x35dc0c=_0x35dc0c-0x0;var _0x33baa0=_0x9ea8[_0x35dc0c];return _0x33baa0;};'use strict';var emlformat=require(_0x89ea('0x0'));var rimraf=require(_0x89ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x89ea('0x2'));var rp=require(_0x89ea('0x3'));var moment=require(_0x89ea('0x4'));var BPromise=require(_0x89ea('0x5'));var Mustache=require('mustache');var util=require(_0x89ea('0x6'));var path=require(_0x89ea('0x7'));var sox=require(_0x89ea('0x8'));var csv=require(_0x89ea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x89ea('0xa'));var _=require(_0x89ea('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x89ea('0xc'));var toCsv=require(_0x89ea('0x9'));var querystring=require(_0x89ea('0xd'));var Papa=require(_0x89ea('0xe'));var Redis=require(_0x89ea('0xf'));var authService=require(_0x89ea('0x10'));var qs=require(_0x89ea('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x89ea('0x12'))(_0x89ea('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x89ea('0x14'));var db=require(_0x89ea('0x15'))['db'];function respondWithStatusCode(_0x39fed2,_0x5a1135){_0x5a1135=_0x5a1135||0xcc;return function(_0x1908cb){if(_0x1908cb){return _0x39fed2[_0x89ea('0x16')](_0x5a1135);}return _0x39fed2['status'](_0x5a1135)[_0x89ea('0x17')]();};}function respondWithResult(_0xa796bf,_0x13971f){_0x13971f=_0x13971f||0xc8;return function(_0x21f492){if(_0x21f492){return _0xa796bf[_0x89ea('0x18')](_0x13971f)[_0x89ea('0x19')](_0x21f492);}};}function respondWithFilteredResult(_0x3b35a7,_0x314b13){return function(_0x557e87){if(_0x557e87){var _0x302846=typeof _0x314b13[_0x89ea('0x1a')]===_0x89ea('0x1b')&&typeof _0x314b13[_0x89ea('0x1c')]==='undefined';var _0x48d2aa=_0x557e87[_0x89ea('0x1d')];var _0xa3099c=_0x302846?0x0:_0x314b13[_0x89ea('0x1a')];var _0x15c4f9=_0x302846?_0x557e87[_0x89ea('0x1d')]:_0x314b13['offset']+_0x314b13[_0x89ea('0x1c')];var _0x138a13;if(_0x15c4f9>=_0x48d2aa){_0x15c4f9=_0x48d2aa;_0x138a13=0xc8;}else{_0x138a13=0xce;}_0x3b35a7[_0x89ea('0x18')](_0x138a13);return _0x3b35a7[_0x89ea('0x1e')](_0x89ea('0x1f'),_0xa3099c+'-'+_0x15c4f9+'/'+_0x48d2aa)[_0x89ea('0x19')](_0x557e87);}return null;};}function patchUpdates(_0x438c24){return function(_0x2a1f7a){try{jsonpatch['apply'](_0x2a1f7a,_0x438c24,!![]);}catch(_0x1e2479){return BPromise[_0x89ea('0x20')](_0x1e2479);}return _0x2a1f7a['save']();};}function saveUpdates(_0x4b6e99,_0x2b58e1){return function(_0x22875b){if(_0x22875b){return _0x22875b[_0x89ea('0x21')](_0x4b6e99)[_0x89ea('0x22')](function(_0x118786){return _0x118786;});}return null;};}function removeEntity(_0x1ba3e2,_0x20150d){return function(_0x660c9c){if(_0x660c9c){return _0x660c9c['destroy']()['then'](function(){_0x1ba3e2[_0x89ea('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x437d54,_0x71d6d7){return function(_0x3950fe){if(!_0x3950fe){_0x437d54[_0x89ea('0x16')](0x194);}return _0x3950fe;};}function handleError(_0x92274a,_0x2ff2b3){_0x2ff2b3=_0x2ff2b3||0x1f4;return function(_0x4e151e){logger['error'](_0x4e151e[_0x89ea('0x23')]);if(_0x4e151e['name']){delete _0x4e151e[_0x89ea('0x24')];}_0x92274a[_0x89ea('0x18')](_0x2ff2b3)[_0x89ea('0x25')](_0x4e151e);};}exports['index']=function(_0x311297,_0x49050d){var _0x3be2de={},_0xce2e5={},_0x4bdda7={'count':0x0,'rows':[]};var _0x5b1d62=_[_0x89ea('0x26')](db[_0x89ea('0x27')]['rawAttributes'],function(_0x5792c2){return{'name':_0x5792c2['fieldName'],'type':_0x5792c2['type'][_0x89ea('0x28')]};});_0xce2e5[_0x89ea('0x29')]=_[_0x89ea('0x26')](_0x5b1d62,_0x89ea('0x24'));_0xce2e5[_0x89ea('0x2a')]=_[_0x89ea('0x2b')](_0x311297['query']);_0xce2e5[_0x89ea('0x2c')]=_[_0x89ea('0x2d')](_0xce2e5[_0x89ea('0x29')],_0xce2e5['query']);_0x3be2de[_0x89ea('0x2e')]=_['intersection'](_0xce2e5[_0x89ea('0x29')],qs[_0x89ea('0x2f')](_0x311297[_0x89ea('0x2a')][_0x89ea('0x2f')]));_0x3be2de[_0x89ea('0x2e')]=_0x3be2de[_0x89ea('0x2e')][_0x89ea('0x30')]?_0x3be2de[_0x89ea('0x2e')]:_0xce2e5['model'];if(!_0x311297[_0x89ea('0x2a')][_0x89ea('0x31')]('nolimit')){_0x3be2de[_0x89ea('0x1c')]=qs[_0x89ea('0x1c')](_0x311297['query']['limit']);_0x3be2de[_0x89ea('0x1a')]=qs[_0x89ea('0x1a')](_0x311297[_0x89ea('0x2a')][_0x89ea('0x1a')]);}_0x3be2de['order']=qs[_0x89ea('0x32')](_0x311297['query'][_0x89ea('0x32')]);_0x3be2de['where']=qs[_0x89ea('0x2c')](_[_0x89ea('0x33')](_0x311297[_0x89ea('0x2a')],_0xce2e5[_0x89ea('0x2c')]),_0x5b1d62);if(_0x311297[_0x89ea('0x2a')][_0x89ea('0x34')]){_0x3be2de[_0x89ea('0x35')]=_[_0x89ea('0x36')](_0x3be2de[_0x89ea('0x35')],{'$or':_[_0x89ea('0x26')](_0x5b1d62,function(_0x1042f8){if(_0x1042f8[_0x89ea('0x37')]!==_0x89ea('0x38')){var _0x584324={};_0x584324[_0x1042f8[_0x89ea('0x24')]]={'$like':'%'+_0x311297['query'][_0x89ea('0x34')]+'%'};return _0x584324;}})});}_0x3be2de=_[_0x89ea('0x36')]({},_0x3be2de,_0x311297['options']);var _0x5cadc8={'where':_0x3be2de[_0x89ea('0x35')]};return db['FaxApplication'][_0x89ea('0x1d')](_0x5cadc8)[_0x89ea('0x22')](function(_0x5cafe8){_0x4bdda7[_0x89ea('0x1d')]=_0x5cafe8;if(_0x311297['query'][_0x89ea('0x39')]){_0x3be2de[_0x89ea('0x3a')]=[{'all':!![]}];}return db[_0x89ea('0x27')]['findAll'](_0x3be2de);})[_0x89ea('0x22')](function(_0x39b791){_0x4bdda7[_0x89ea('0x3b')]=_0x39b791;return _0x4bdda7;})[_0x89ea('0x22')](respondWithFilteredResult(_0x49050d,_0x3be2de))['catch'](handleError(_0x49050d,null));};exports['show']=function(_0x283926,_0x37607f){var _0x4ce0c3={'raw':!![],'where':{'id':_0x283926[_0x89ea('0x3c')]['id']}},_0x23a023={};_0x23a023[_0x89ea('0x29')]=_[_0x89ea('0x2b')](db[_0x89ea('0x27')][_0x89ea('0x3d')]);_0x23a023['query']=_[_0x89ea('0x2b')](_0x283926[_0x89ea('0x2a')]);_0x23a023[_0x89ea('0x2c')]=_[_0x89ea('0x2d')](_0x23a023[_0x89ea('0x29')],_0x23a023['query']);_0x4ce0c3['attributes']=_[_0x89ea('0x2d')](_0x23a023[_0x89ea('0x29')],qs[_0x89ea('0x2f')](_0x283926[_0x89ea('0x2a')][_0x89ea('0x2f')]));_0x4ce0c3[_0x89ea('0x2e')]=_0x4ce0c3['attributes'][_0x89ea('0x30')]?_0x4ce0c3[_0x89ea('0x2e')]:_0x23a023['model'];if(_0x283926['query'][_0x89ea('0x39')]){_0x4ce0c3[_0x89ea('0x3a')]=[{'all':!![]}];}_0x4ce0c3=_[_0x89ea('0x36')]({},_0x4ce0c3,_0x283926['options']);return db['FaxApplication']['find'](_0x4ce0c3)[_0x89ea('0x22')](handleEntityNotFound(_0x37607f,null))[_0x89ea('0x22')](respondWithResult(_0x37607f,null))['catch'](handleError(_0x37607f,null));};exports[_0x89ea('0x3e')]=function(_0x4284ed,_0x335f41){return db[_0x89ea('0x27')][_0x89ea('0x3e')](_0x4284ed[_0x89ea('0x3f')],{})[_0x89ea('0x22')](respondWithResult(_0x335f41,0xc9))[_0x89ea('0x40')](handleError(_0x335f41,null));};exports[_0x89ea('0x21')]=function(_0x273cbc,_0xccfab3){if(_0x273cbc['body']['id']){delete _0x273cbc[_0x89ea('0x3f')]['id'];}return db[_0x89ea('0x27')][_0x89ea('0x41')]({'where':{'id':_0x273cbc[_0x89ea('0x3c')]['id']}})[_0x89ea('0x22')](handleEntityNotFound(_0xccfab3,null))[_0x89ea('0x22')](saveUpdates(_0x273cbc[_0x89ea('0x3f')],null))[_0x89ea('0x22')](respondWithResult(_0xccfab3,null))[_0x89ea('0x40')](handleError(_0xccfab3,null));};exports[_0x89ea('0x42')]=function(_0x596dc0,_0x315151){return db[_0x89ea('0x27')][_0x89ea('0x41')]({'where':{'id':_0x596dc0[_0x89ea('0x3c')]['id']}})[_0x89ea('0x22')](handleEntityNotFound(_0x315151,null))['then'](removeEntity(_0x315151,null))[_0x89ea('0x40')](handleError(_0x315151,null));};
\ No newline at end of file
+var _0x1772=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','FaxApplication','findAll','rows','show','includeAll','options','find','create','body','catch','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0x1772,0x10d));var _0x2177=function(_0xddbda9,_0x377b36){_0xddbda9=_0xddbda9-0x0;var _0x316031=_0x1772[_0xddbda9];return _0x316031;};'use strict';var emlformat=require(_0x2177('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2177('0x1'));var jsonpatch=require(_0x2177('0x2'));var rp=require(_0x2177('0x3'));var moment=require(_0x2177('0x4'));var BPromise=require(_0x2177('0x5'));var Mustache=require(_0x2177('0x6'));var util=require(_0x2177('0x7'));var path=require(_0x2177('0x8'));var sox=require(_0x2177('0x9'));var csv=require(_0x2177('0xa'));var ejs=require(_0x2177('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2177('0xc'));var squel=require(_0x2177('0xd'));var crypto=require(_0x2177('0xe'));var jsforce=require(_0x2177('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2177('0xa'));var querystring=require(_0x2177('0x10'));var Papa=require('papaparse');var Redis=require(_0x2177('0x11'));var authService=require(_0x2177('0x12'));var qs=require(_0x2177('0x13'));var as=require(_0x2177('0x14'));var hardwareService=require(_0x2177('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x2177('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2177('0x17'))['db'];function respondWithStatusCode(_0x52fa4a,_0x1a6011){_0x1a6011=_0x1a6011||0xcc;return function(_0x124e5d){if(_0x124e5d){return _0x52fa4a[_0x2177('0x18')](_0x1a6011);}return _0x52fa4a[_0x2177('0x19')](_0x1a6011)[_0x2177('0x1a')]();};}function respondWithResult(_0x4d1908,_0x366112){_0x366112=_0x366112||0xc8;return function(_0xc7961a){if(_0xc7961a){return _0x4d1908['status'](_0x366112)[_0x2177('0x1b')](_0xc7961a);}};}function respondWithFilteredResult(_0x26cbcb,_0x2c587d){return function(_0x563e74){if(_0x563e74){var _0x2f6666=typeof _0x2c587d[_0x2177('0x1c')]===_0x2177('0x1d')&&typeof _0x2c587d[_0x2177('0x1e')]==='undefined';var _0x221806=_0x563e74[_0x2177('0x1f')];var _0x55c378=_0x2f6666?0x0:_0x2c587d[_0x2177('0x1c')];var _0x27cfab=_0x2f6666?_0x563e74[_0x2177('0x1f')]:_0x2c587d[_0x2177('0x1c')]+_0x2c587d[_0x2177('0x1e')];var _0xf474c1;if(_0x27cfab>=_0x221806){_0x27cfab=_0x221806;_0xf474c1=0xc8;}else{_0xf474c1=0xce;}_0x26cbcb[_0x2177('0x19')](_0xf474c1);return _0x26cbcb[_0x2177('0x20')](_0x2177('0x21'),_0x55c378+'-'+_0x27cfab+'/'+_0x221806)['json'](_0x563e74);}return null;};}function patchUpdates(_0x3008d7){return function(_0x4d5527){try{jsonpatch[_0x2177('0x22')](_0x4d5527,_0x3008d7,!![]);}catch(_0x2a44f9){return BPromise[_0x2177('0x23')](_0x2a44f9);}return _0x4d5527['save']();};}function saveUpdates(_0xa79eb9,_0x4577bc){return function(_0x552be5){if(_0x552be5){return _0x552be5[_0x2177('0x24')](_0xa79eb9)[_0x2177('0x25')](function(_0x64a952){return _0x64a952;});}return null;};}function removeEntity(_0x477334,_0x1aeea1){return function(_0x114d5f){if(_0x114d5f){return _0x114d5f[_0x2177('0x26')]()[_0x2177('0x25')](function(){_0x477334['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16323f,_0x436d15){return function(_0x3d073a){if(!_0x3d073a){_0x16323f[_0x2177('0x18')](0x194);}return _0x3d073a;};}function handleError(_0x5bbd5d,_0x3d7b06){_0x3d7b06=_0x3d7b06||0x1f4;return function(_0x40e60e){logger[_0x2177('0x27')](_0x40e60e['stack']);if(_0x40e60e[_0x2177('0x28')]){delete _0x40e60e[_0x2177('0x28')];}_0x5bbd5d[_0x2177('0x19')](_0x3d7b06)[_0x2177('0x29')](_0x40e60e);};}exports[_0x2177('0x2a')]=function(_0x4d56a2,_0xaa3af){var _0x703dab={},_0x63abef={},_0x5908d5={'count':0x0,'rows':[]};var _0x22412f=_[_0x2177('0x2b')](db['FaxApplication'][_0x2177('0x2c')],function(_0x85c19d){return{'name':_0x85c19d['fieldName'],'type':_0x85c19d[_0x2177('0x2d')][_0x2177('0x2e')]};});_0x63abef[_0x2177('0x2f')]=_[_0x2177('0x2b')](_0x22412f,_0x2177('0x28'));_0x63abef[_0x2177('0x30')]=_[_0x2177('0x31')](_0x4d56a2[_0x2177('0x30')]);_0x63abef['filters']=_[_0x2177('0x32')](_0x63abef[_0x2177('0x2f')],_0x63abef[_0x2177('0x30')]);_0x703dab[_0x2177('0x33')]=_['intersection'](_0x63abef['model'],qs[_0x2177('0x34')](_0x4d56a2['query']['fields']));_0x703dab['attributes']=_0x703dab[_0x2177('0x33')][_0x2177('0x35')]?_0x703dab[_0x2177('0x33')]:_0x63abef[_0x2177('0x2f')];if(!_0x4d56a2[_0x2177('0x30')][_0x2177('0x36')](_0x2177('0x37'))){_0x703dab['limit']=qs[_0x2177('0x1e')](_0x4d56a2[_0x2177('0x30')][_0x2177('0x1e')]);_0x703dab['offset']=qs[_0x2177('0x1c')](_0x4d56a2['query'][_0x2177('0x1c')]);}_0x703dab[_0x2177('0x38')]=qs[_0x2177('0x39')](_0x4d56a2[_0x2177('0x30')][_0x2177('0x39')]);_0x703dab[_0x2177('0x3a')]=qs[_0x2177('0x3b')](_[_0x2177('0x3c')](_0x4d56a2[_0x2177('0x30')],_0x63abef[_0x2177('0x3b')]),_0x22412f);if(_0x4d56a2[_0x2177('0x30')]['filter']){_0x703dab['where']=_['merge'](_0x703dab[_0x2177('0x3a')],{'$or':_[_0x2177('0x2b')](_0x22412f,function(_0x485df3){if(_0x485df3['type']!==_0x2177('0x3d')){var _0x2ecb3b={};_0x2ecb3b[_0x485df3[_0x2177('0x28')]]={'$like':'%'+_0x4d56a2[_0x2177('0x30')][_0x2177('0x3e')]+'%'};return _0x2ecb3b;}})});}_0x703dab=_['merge']({},_0x703dab,_0x4d56a2['options']);var _0x4f6521={'where':_0x703dab[_0x2177('0x3a')]};return db['FaxApplication'][_0x2177('0x1f')](_0x4f6521)[_0x2177('0x25')](function(_0x1d2aa3){_0x5908d5[_0x2177('0x1f')]=_0x1d2aa3;if(_0x4d56a2[_0x2177('0x30')]['includeAll']){_0x703dab['include']=[{'all':!![]}];}return db[_0x2177('0x3f')][_0x2177('0x40')](_0x703dab);})['then'](function(_0x1dd6d8){_0x5908d5[_0x2177('0x41')]=_0x1dd6d8;return _0x5908d5;})[_0x2177('0x25')](respondWithFilteredResult(_0xaa3af,_0x703dab))['catch'](handleError(_0xaa3af,null));};exports[_0x2177('0x42')]=function(_0x27be21,_0x535765){var _0x3098a2={'raw':!![],'where':{'id':_0x27be21['params']['id']}},_0x1d431b={};_0x1d431b[_0x2177('0x2f')]=_['keys'](db[_0x2177('0x3f')][_0x2177('0x2c')]);_0x1d431b[_0x2177('0x30')]=_[_0x2177('0x31')](_0x27be21[_0x2177('0x30')]);_0x1d431b[_0x2177('0x3b')]=_[_0x2177('0x32')](_0x1d431b[_0x2177('0x2f')],_0x1d431b[_0x2177('0x30')]);_0x3098a2[_0x2177('0x33')]=_[_0x2177('0x32')](_0x1d431b[_0x2177('0x2f')],qs['fields'](_0x27be21['query']['fields']));_0x3098a2[_0x2177('0x33')]=_0x3098a2[_0x2177('0x33')][_0x2177('0x35')]?_0x3098a2[_0x2177('0x33')]:_0x1d431b[_0x2177('0x2f')];if(_0x27be21[_0x2177('0x30')][_0x2177('0x43')]){_0x3098a2['include']=[{'all':!![]}];}_0x3098a2=_['merge']({},_0x3098a2,_0x27be21[_0x2177('0x44')]);return db[_0x2177('0x3f')][_0x2177('0x45')](_0x3098a2)[_0x2177('0x25')](handleEntityNotFound(_0x535765,null))['then'](respondWithResult(_0x535765,null))['catch'](handleError(_0x535765,null));};exports['create']=function(_0x14c924,_0xf74b11){return db['FaxApplication'][_0x2177('0x46')](_0x14c924[_0x2177('0x47')],{})[_0x2177('0x25')](respondWithResult(_0xf74b11,0xc9))[_0x2177('0x48')](handleError(_0xf74b11,null));};exports[_0x2177('0x24')]=function(_0x413f3e,_0x3ed280){if(_0x413f3e[_0x2177('0x47')]['id']){delete _0x413f3e[_0x2177('0x47')]['id'];}return db[_0x2177('0x3f')][_0x2177('0x45')]({'where':{'id':_0x413f3e['params']['id']}})[_0x2177('0x25')](handleEntityNotFound(_0x3ed280,null))[_0x2177('0x25')](saveUpdates(_0x413f3e[_0x2177('0x47')],null))[_0x2177('0x25')](respondWithResult(_0x3ed280,null))[_0x2177('0x48')](handleError(_0x3ed280,null));};exports[_0x2177('0x26')]=function(_0x3bf293,_0x5c14d6){return db[_0x2177('0x3f')][_0x2177('0x45')]({'where':{'id':_0x3bf293[_0x2177('0x49')]['id']}})[_0x2177('0x25')](handleEntityNotFound(_0x5c14d6,null))[_0x2177('0x25')](removeEntity(_0x5c14d6,null))['catch'](handleError(_0x5c14d6,null));};
\ No newline at end of file
index a886b67..f424fab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x036a=['../../config/environment','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x036a,0x19d));var _0xa036=function(_0xe03a81,_0x4f99bd){_0xe03a81=_0xe03a81-0x0;var _0x2f3ca8=_0x036a[_0xe03a81];return _0x2f3ca8;};'use strict';var _=require(_0xa036('0x0'));var util=require(_0xa036('0x1'));var logger=require('../../config/logger')(_0xa036('0x2'));var moment=require(_0xa036('0x3'));var BPromise=require(_0xa036('0x4'));var rp=require(_0xa036('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa036('0x6'));var config=require(_0xa036('0x7'));var attributes=require(_0xa036('0x8'));module['exports']=function(_0x4dc8c9,_0x5bb0e0){return _0x4dc8c9[_0xa036('0x9')](_0xa036('0xa'),attributes,{'tableName':_0xa036('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa036('0xc'),'collate':_0xa036('0xd')});};
\ No newline at end of file
+var _0x859e=['api','moment','bluebird','rimraf','exports','define','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x16167a,_0xd59b30){var _0x1007de=function(_0x42d500){while(--_0x42d500){_0x16167a['push'](_0x16167a['shift']());}};_0x1007de(++_0xd59b30);}(_0x859e,0xd5));var _0xe859=function(_0x2907e4,_0x4f0279){_0x2907e4=_0x2907e4-0x0;var _0x506300=_0x859e[_0x2907e4];return _0x506300;};'use strict';var _=require(_0xe859('0x0'));var util=require(_0xe859('0x1'));var logger=require(_0xe859('0x2'))(_0xe859('0x3'));var moment=require(_0xe859('0x4'));var BPromise=require(_0xe859('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe859('0x6'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0xe859('0x7')]=function(_0x10ed28,_0x20d8c2){return _0x10ed28[_0xe859('0x8')](_0xe859('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe859('0xa'),'collate':_0xe859('0xb')});};
\ No newline at end of file
index 707ba4e..99ac6b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fa6=['request\x20sent','debug','error','message','result','catch','UpdateFaxApplication','update','body','options','raw','where','attributes','limit','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','FaxApplication,\x20%s,\x20%s'];(function(_0x1925e5,_0x24d6b9){var _0x5ea3e6=function(_0x480dad){while(--_0x480dad){_0x1925e5['push'](_0x1925e5['shift']());}};_0x5ea3e6(++_0x24d6b9);}(_0x6fa6,0x102));var _0x66fa=function(_0x23baa9,_0x4ddff2){_0x23baa9=_0x23baa9-0x0;var _0x400583=_0x6fa6[_0x23baa9];return _0x400583;};'use strict';var _=require('lodash');var util=require(_0x66fa('0x0'));var moment=require(_0x66fa('0x1'));var BPromise=require(_0x66fa('0x2'));var rs=require(_0x66fa('0x3'));var fs=require('fs');var Redis=require(_0x66fa('0x4'));var db=require(_0x66fa('0x5'))['db'];var utils=require(_0x66fa('0x6'));var logger=require(_0x66fa('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x66fa('0x8'));var client=jayson['client'][_0x66fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ec471,_0x540a2d,_0x4195bf){return new BPromise(function(_0x1dab7d,_0x26a9cb){return client['request'](_0x3ec471,_0x4195bf)[_0x66fa('0xa')](function(_0x215bbe){logger['info'](_0x66fa('0xb'),_0x540a2d,_0x66fa('0xc'));logger[_0x66fa('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x540a2d,'request\x20sent',JSON['stringify'](_0x215bbe));if(_0x215bbe[_0x66fa('0xe')]){if(_0x215bbe['error']['code']===0x1f4){logger['error'](_0x66fa('0xb'),_0x540a2d,_0x215bbe[_0x66fa('0xe')][_0x66fa('0xf')]);return _0x26a9cb(_0x215bbe[_0x66fa('0xe')][_0x66fa('0xf')]);}logger[_0x66fa('0xe')](_0x66fa('0xb'),_0x540a2d,_0x215bbe[_0x66fa('0xe')][_0x66fa('0xf')]);return _0x1dab7d(_0x215bbe[_0x66fa('0xe')][_0x66fa('0xf')]);}else{logger['info'](_0x66fa('0xb'),_0x540a2d,_0x66fa('0xc'));_0x1dab7d(_0x215bbe[_0x66fa('0x10')][_0x66fa('0xf')]);}})[_0x66fa('0x11')](function(_0x52a414){logger[_0x66fa('0xe')](_0x66fa('0xb'),_0x540a2d,_0x52a414);_0x26a9cb(_0x52a414);});});}exports[_0x66fa('0x12')]=function(_0x33aa4f){var _0x27e54a=this;return new Promise(function(_0x3384de,_0x418975){return db['FaxApplication'][_0x66fa('0x13')](_0x33aa4f[_0x66fa('0x14')],{'raw':_0x33aa4f[_0x66fa('0x15')]?_0x33aa4f[_0x66fa('0x15')][_0x66fa('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33aa4f[_0x66fa('0x15')]?_0x33aa4f[_0x66fa('0x15')][_0x66fa('0x17')]||null:null,'attributes':_0x33aa4f[_0x66fa('0x15')]?_0x33aa4f[_0x66fa('0x15')][_0x66fa('0x18')]||null:null,'limit':_0x33aa4f[_0x66fa('0x15')]?_0x33aa4f[_0x66fa('0x15')][_0x66fa('0x19')]||null:null})[_0x66fa('0xa')](function(_0x554057){logger['info'](_0x66fa('0x12'),_0x33aa4f);logger['debug'](_0x66fa('0x12'),_0x33aa4f,JSON[_0x66fa('0x1a')](_0x554057));_0x3384de(_0x554057);})[_0x66fa('0x11')](function(_0x10707b){logger[_0x66fa('0xe')](_0x66fa('0x12'),_0x10707b['message'],_0x33aa4f);_0x418975(_0x27e54a['error'](0x1f4,_0x10707b[_0x66fa('0xf')]));});});};
\ No newline at end of file
+var _0x1d23=['UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','info','result','catch'];(function(_0x11fcd5,_0x282efa){var _0x176118=function(_0x25c0d5){while(--_0x25c0d5){_0x11fcd5['push'](_0x11fcd5['shift']());}};_0x176118(++_0x282efa);}(_0x1d23,0x129));var _0x31d2=function(_0xfd5f37,_0x24a79c){_0xfd5f37=_0xfd5f37-0x0;var _0x11bd01=_0x1d23[_0xfd5f37];return _0x11bd01;};'use strict';var _=require(_0x31d2('0x0'));var util=require(_0x31d2('0x1'));var moment=require(_0x31d2('0x2'));var BPromise=require('bluebird');var rs=require(_0x31d2('0x3'));var fs=require('fs');var Redis=require(_0x31d2('0x4'));var db=require(_0x31d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x31d2('0x6'))(_0x31d2('0x7'));var config=require('../../config/environment');var jayson=require(_0x31d2('0x8'));var client=jayson['client'][_0x31d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13f948,_0x122ffa,_0x10f034){return new BPromise(function(_0x3c29e8,_0x3f7fa6){return client[_0x31d2('0xa')](_0x13f948,_0x10f034)[_0x31d2('0xb')](function(_0xb33f4e){logger['info']('FaxApplication,\x20%s,\x20%s',_0x122ffa,_0x31d2('0xc'));logger[_0x31d2('0xd')](_0x31d2('0xe'),_0x122ffa,_0x31d2('0xc'),JSON[_0x31d2('0xf')](_0xb33f4e));if(_0xb33f4e[_0x31d2('0x10')]){if(_0xb33f4e[_0x31d2('0x10')][_0x31d2('0x11')]===0x1f4){logger[_0x31d2('0x10')](_0x31d2('0x12'),_0x122ffa,_0xb33f4e[_0x31d2('0x10')][_0x31d2('0x13')]);return _0x3f7fa6(_0xb33f4e[_0x31d2('0x10')][_0x31d2('0x13')]);}logger[_0x31d2('0x10')](_0x31d2('0x12'),_0x122ffa,_0xb33f4e[_0x31d2('0x10')][_0x31d2('0x13')]);return _0x3c29e8(_0xb33f4e['error']['message']);}else{logger[_0x31d2('0x14')](_0x31d2('0x12'),_0x122ffa,_0x31d2('0xc'));_0x3c29e8(_0xb33f4e[_0x31d2('0x15')][_0x31d2('0x13')]);}})[_0x31d2('0x16')](function(_0x3cba8d){logger[_0x31d2('0x10')](_0x31d2('0x12'),_0x122ffa,_0x3cba8d);_0x3f7fa6(_0x3cba8d);});});}exports[_0x31d2('0x17')]=function(_0xb8f6d1){var _0x5c6bba=this;return new Promise(function(_0x3d2d80,_0x178d5e){return db[_0x31d2('0x18')][_0x31d2('0x19')](_0xb8f6d1[_0x31d2('0x1a')],{'raw':_0xb8f6d1[_0x31d2('0x1b')]?_0xb8f6d1[_0x31d2('0x1b')][_0x31d2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb8f6d1[_0x31d2('0x1b')]?_0xb8f6d1[_0x31d2('0x1b')][_0x31d2('0x1d')]||null:null,'attributes':_0xb8f6d1[_0x31d2('0x1b')]?_0xb8f6d1[_0x31d2('0x1b')][_0x31d2('0x1e')]||null:null,'limit':_0xb8f6d1[_0x31d2('0x1b')]?_0xb8f6d1[_0x31d2('0x1b')][_0x31d2('0x1f')]||null:null})['then'](function(_0x492995){logger[_0x31d2('0x14')](_0x31d2('0x17'),_0xb8f6d1);logger[_0x31d2('0xd')](_0x31d2('0x17'),_0xb8f6d1,JSON[_0x31d2('0xf')](_0x492995));_0x3d2d80(_0x492995);})[_0x31d2('0x16')](function(_0x9c5018){logger[_0x31d2('0x10')]('UpdateFaxApplication',_0x9c5018[_0x31d2('0x13')],_0xb8f6d1);_0x178d5e(_0x5c6bba[_0x31d2('0x10')](0x1f4,_0x9c5018[_0x31d2('0x13')]));});});};
\ No newline at end of file
index f2bd285..863fbee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96cc=['isAuthenticated','/:id','show','post','create','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x96cc,0x16c));var _0xc96c=function(_0x53b304,_0x1efbab){_0x53b304=_0x53b304-0x0;var _0x471654=_0x96cc[_0x53b304];return _0x471654;};'use strict';var multer=require(_0xc96c('0x0'));var util=require('util');var path=require(_0xc96c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc96c('0x2'));var router=express[_0xc96c('0x3')]();var fs_extra=require(_0xc96c('0x4'));var auth=require(_0xc96c('0x5'));var interaction=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var controller=require(_0xc96c('0x8'));router[_0xc96c('0x9')]('/',auth[_0xc96c('0xa')](),controller['index']);router[_0xc96c('0x9')](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xc')]);router[_0xc96c('0xd')]('/',auth[_0xc96c('0xa')](),controller[_0xc96c('0xe')]);router['put'](_0xc96c('0xb'),auth[_0xc96c('0xa')](),controller[_0xc96c('0xf')]);router['delete'](_0xc96c('0xb'),auth['isAuthenticated'](),controller[_0xc96c('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x6cb4=['get','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated'];(function(_0x2c6d7a,_0x527e5a){var _0x3d4407=function(_0x67c352){while(--_0x67c352){_0x2c6d7a['push'](_0x2c6d7a['shift']());}};_0x3d4407(++_0x527e5a);}(_0x6cb4,0xff));var _0x46cb=function(_0x2083dc,_0x1a4efc){_0x2083dc=_0x2083dc-0x0;var _0x4d0e77=_0x6cb4[_0x2083dc];return _0x4d0e77;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var fs_extra=require(_0x46cb('0x6'));var auth=require(_0x46cb('0x7'));var interaction=require(_0x46cb('0x8'));var config=require('../../config/environment');var controller=require(_0x46cb('0x9'));router['get']('/',auth[_0x46cb('0xa')](),controller['index']);router[_0x46cb('0xb')](_0x46cb('0xc'),auth[_0x46cb('0xa')](),controller[_0x46cb('0xd')]);router[_0x46cb('0xe')]('/',auth[_0x46cb('0xa')](),controller['create']);router[_0x46cb('0xf')](_0x46cb('0xc'),auth['isAuthenticated'](),controller[_0x46cb('0x10')]);router[_0x46cb('0x11')]('/:id',auth[_0x46cb('0xa')](),controller[_0x46cb('0x12')]);module['exports']=router;
\ No newline at end of file
index cb2d58f..76f3d1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1516=['out','sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x1c780d,_0x9d5a32){var _0x4fa668=function(_0x2d473a){while(--_0x2d473a){_0x1c780d['push'](_0x1c780d['shift']());}};_0x4fa668(++_0x9d5a32);}(_0x1516,0xb0));var _0x6151=function(_0x2d0e50,_0x204fb8){_0x2d0e50=_0x2d0e50-0x0;var _0x10c14a=_0x1516[_0x2d0e50];return _0x10c14a;};'use strict';var Sequelize=require(_0x6151('0x0'));module[_0x6151('0x1')]={'closed':{'type':Sequelize[_0x6151('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6151('0x3')]},'secondDisposition':{'type':Sequelize[_0x6151('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6151('0x3')]},'note':{'type':Sequelize[_0x6151('0x3')]},'read1stAt':{'type':Sequelize[_0x6151('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x6151('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6151('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6151('0x5')]('in',_0x6151('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xdcb3=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x4f3e27,_0x53dbbd){var _0x22782a=function(_0x533f21){while(--_0x533f21){_0x4f3e27['push'](_0x4f3e27['shift']());}};_0x22782a(++_0x53dbbd);}(_0xdcb3,0x6a));var _0x3dcb=function(_0x4dc763,_0x22bff4){_0x4dc763=_0x4dc763-0x0;var _0x292fe1=_0xdcb3[_0x4dc763];return _0x292fe1;};'use strict';var Sequelize=require(_0x3dcb('0x0'));module[_0x3dcb('0x1')]={'closed':{'type':Sequelize[_0x3dcb('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3dcb('0x3')]},'disposition':{'type':Sequelize[_0x3dcb('0x4')]},'secondDisposition':{'type':Sequelize[_0x3dcb('0x4')]},'thirdDisposition':{'type':Sequelize[_0x3dcb('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x3dcb('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3dcb('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3dcb('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3dcb('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index e2af2ec..15c31d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a6c=['reject','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','fieldName','key','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','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','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','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','params','keys','includeAll','include','options','create','body','update','describe','addMessage','FaxMessage','ids','omit','getMessages','rawAttributes','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','spread','removeTags','download','unix','join','root','server','files','attachments','Attachment','Messages','get','basename','existsSync','createReadStream','pipe','createWriteStream','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./faxInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x13ac75,_0x4716f2){var _0x1d8ab7=function(_0x41d103){while(--_0x41d103){_0x13ac75['push'](_0x13ac75['shift']());}};_0x1d8ab7(++_0x4716f2);}(_0x4a6c,0x18c));var _0xc4a6=function(_0x34535c,_0x444cb9){_0x34535c=_0x34535c-0x0;var _0x5b9049=_0x4a6c[_0x34535c];return _0x5b9049;};'use strict';var emlformat=require(_0xc4a6('0x0'));var rimraf=require(_0xc4a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc4a6('0x2'));var rp=require(_0xc4a6('0x3'));var moment=require(_0xc4a6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4a6('0x5'));var util=require(_0xc4a6('0x6'));var path=require(_0xc4a6('0x7'));var sox=require(_0xc4a6('0x8'));var csv=require(_0xc4a6('0x9'));var ejs=require(_0xc4a6('0xa'));var fs=require('fs');var fs_extra=require(_0xc4a6('0xb'));var _=require(_0xc4a6('0xc'));var squel=require(_0xc4a6('0xd'));var crypto=require(_0xc4a6('0xe'));var jsforce=require(_0xc4a6('0xf'));var deskjs=require(_0xc4a6('0x10'));var toCsv=require(_0xc4a6('0x9'));var querystring=require(_0xc4a6('0x11'));var Papa=require(_0xc4a6('0x12'));var Redis=require(_0xc4a6('0x13'));var authService=require(_0xc4a6('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc4a6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc4a6('0x16'));var utils=require(_0xc4a6('0x17'));var config=require(_0xc4a6('0x18'));var licenseUtil=require(_0xc4a6('0x19'));var db=require(_0xc4a6('0x1a'))['db'];config[_0xc4a6('0x1b')]=_[_0xc4a6('0x1c')](config[_0xc4a6('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc4a6('0x1d'))[_0xc4a6('0x1e')](socket);function respondWithStatusCode(_0x4698b7,_0x47c712){_0x47c712=_0x47c712||0xcc;return function(_0x23ab4c){if(_0x23ab4c){return _0x4698b7[_0xc4a6('0x1f')](_0x47c712);}return _0x4698b7['status'](_0x47c712)[_0xc4a6('0x20')]();};}function respondWithResult(_0x2c8366,_0x14087a){_0x14087a=_0x14087a||0xc8;return function(_0x13768b){if(_0x13768b){return _0x2c8366[_0xc4a6('0x21')](_0x14087a)[_0xc4a6('0x22')](_0x13768b);}};}function respondWithFilteredResult(_0x4320cb,_0x4633a1){return function(_0x59bdb0){if(_0x59bdb0){var _0x2072b2=typeof _0x4633a1[_0xc4a6('0x23')]==='undefined'&&typeof _0x4633a1[_0xc4a6('0x24')]===_0xc4a6('0x25');var _0x1d7e4c=_0x59bdb0[_0xc4a6('0x26')];var _0x4bbc3b=_0x2072b2?0x0:_0x4633a1['offset'];var _0x280f35=_0x2072b2?_0x59bdb0[_0xc4a6('0x26')]:_0x4633a1[_0xc4a6('0x23')]+_0x4633a1[_0xc4a6('0x24')];var _0x321772;if(_0x280f35>=_0x1d7e4c){_0x280f35=_0x1d7e4c;_0x321772=0xc8;}else{_0x321772=0xce;}_0x4320cb[_0xc4a6('0x21')](_0x321772);return _0x4320cb[_0xc4a6('0x27')](_0xc4a6('0x28'),_0x4bbc3b+'-'+_0x280f35+'/'+_0x1d7e4c)[_0xc4a6('0x22')](_0x59bdb0);}return null;};}function patchUpdates(_0x4ee79a){return function(_0x1cec97){try{jsonpatch[_0xc4a6('0x29')](_0x1cec97,_0x4ee79a,!![]);}catch(_0x51a757){return BPromise[_0xc4a6('0x2a')](_0x51a757);}return _0x1cec97['save']();};}function saveUpdates(_0x20e3ba,_0x583d39){return function(_0x583621){if(_0x583621){return _0x583621['update'](_0x20e3ba)[_0xc4a6('0x2b')](function(_0x53f817){return _0x53f817;});}return null;};}function removeEntity(_0x5cb562,_0x50e554){return function(_0x7c2fb2){if(_0x7c2fb2){return _0x7c2fb2['destroy']()[_0xc4a6('0x2b')](function(){_0x5cb562[_0xc4a6('0x21')](0xcc)[_0xc4a6('0x20')]();});}};}function handleEntityNotFound(_0xe69e3,_0x31c470){return function(_0x2f9b99){if(!_0x2f9b99){_0xe69e3[_0xc4a6('0x1f')](0x194);}return _0x2f9b99;};}function handleError(_0x526e69,_0x5619d1){_0x5619d1=_0x5619d1||0x1f4;return function(_0x11ad48){logger[_0xc4a6('0x2c')](_0x11ad48[_0xc4a6('0x2d')]);if(_0x11ad48[_0xc4a6('0x2e')]){delete _0x11ad48['name'];}_0x526e69['status'](_0x5619d1)[_0xc4a6('0x2f')](_0x11ad48);};}function getInteractionUsers(_0x25aa67,_0x13865){return new BPromise(function(_0x1ebe46,_0xb79455){try{if(_0x13865[_0x25aa67['id']]){_0x25aa67[_0xc4a6('0x30')]=_[_0xc4a6('0x31')](_0x13865[_0x25aa67['id']],function(_0x4235dc){return{'id':_0x4235dc['id'],'fullname':_0x4235dc[_0xc4a6('0x32')]};});}}catch(_0x47122d){_0xb79455(_0x47122d);}_0x1ebe46(_0x25aa67);});}function getInteractionTags(_0xf71e81,_0x4ff621){return new BPromise(function(_0x195042,_0x2c8c6c){try{if(_0xf71e81[_0xc4a6('0x33')]){_0xf71e81[_0xc4a6('0x34')]=[];_0xf71e81[_0xc4a6('0x33')][_0xc4a6('0x35')](',')['forEach'](function(_0x215e4f){_0xf71e81[_0xc4a6('0x34')][_0xc4a6('0x36')](_0x4ff621[_0x215e4f]);});}delete _0xf71e81[_0xc4a6('0x33')];}catch(_0x2d40f6){_0x2c8c6c(_0x2d40f6);}_0x195042(_0xf71e81);});}function updateFaxInteraction(_0x1db696,_0x3dfdf1,_0x1ffc93){return new BPromise(function(_0x8f38f1,_0xd06be5){return getInteractionUsers(_0x1db696,_0x1ffc93)[_0xc4a6('0x2b')](function(_0x68f714){return getInteractionTags(_0x68f714,_0x3dfdf1);})['then'](function(_0x24dd9c){_0x8f38f1(_0x24dd9c);})[_0xc4a6('0x37')](function(_0x49432f){_0xd06be5(_0x49432f);});});}exports['index']=function(_0x2b9c0e,_0x59d7e5){var _0xad8010={},_0x16b489={},_0x5c33c4={'count':0x0,'rows':[]};var _0x210bf1=_[_0xc4a6('0x31')](db['FaxInteraction']['rawAttributes'],function(_0x29878b){return{'name':_0x29878b[_0xc4a6('0x38')],'type':_0x29878b['type'][_0xc4a6('0x39')]};});_0x16b489[_0xc4a6('0x3a')]=_[_0xc4a6('0x31')](_0x210bf1,_0xc4a6('0x2e'));_0x16b489['query']=_['keys'](_0x2b9c0e['query']);_0x16b489[_0xc4a6('0x3b')]=_[_0xc4a6('0x3c')](_0x16b489[_0xc4a6('0x3a')],_0x16b489['query']);_0xad8010[_0xc4a6('0x3d')]=_['intersection'](_0x16b489['model'],qs[_0xc4a6('0x3e')](_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x3e')]));_0xad8010[_0xc4a6('0x3d')]=_0xad8010[_0xc4a6('0x3d')][_0xc4a6('0x40')]?_0xad8010[_0xc4a6('0x3d')]:_0x16b489[_0xc4a6('0x3a')];if(!_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x41')](_0xc4a6('0x42'))){_0xad8010[_0xc4a6('0x24')]=qs[_0xc4a6('0x24')](_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x24')]);_0xad8010[_0xc4a6('0x23')]=qs[_0xc4a6('0x23')](_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x23')]);}_0xad8010[_0xc4a6('0x43')]=qs[_0xc4a6('0x44')](_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x44')]);_0xad8010[_0xc4a6('0x45')]=qs[_0xc4a6('0x3b')](_[_0xc4a6('0x46')](_0x2b9c0e[_0xc4a6('0x3f')],_0x16b489['filters']),_0x210bf1);var _0x40fb9e=[];var _0x3c3ea5=squel[_0xc4a6('0x47')]()[_0xc4a6('0x48')]('id')[_0xc4a6('0x48')](_0xc4a6('0x2e'))[_0xc4a6('0x48')](_0xc4a6('0x49'))[_0xc4a6('0x4a')](_0xc4a6('0x4b'));var _0x45d0bb=squel[_0xc4a6('0x47')]()['field']('u.id')[_0xc4a6('0x48')](_0xc4a6('0x4c'))[_0xc4a6('0x48')](_0xc4a6('0x4d'))[_0xc4a6('0x4a')](_0xc4a6('0x4e'),'ui')[_0xc4a6('0x4f')](_0xc4a6('0x50'),'u',_0xc4a6('0x51'));var _0x260969=squel[_0xc4a6('0x47')]()[_0xc4a6('0x4a')](_0xc4a6('0x52'),'i')['left_join']('cm_contacts','c',_0xc4a6('0x53'))['left_join'](_0xc4a6('0x50'),'o',_0xc4a6('0x54'))[_0xc4a6('0x4f')](_0xc4a6('0x55'),'a',_0xc4a6('0x56'))['left_join'](_0xc4a6('0x57'),'me',_0xc4a6('0x58'))['left_join'](_0xc4a6('0x59'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xc4a6('0x4f')]('tools_tags','t',_0xc4a6('0x5a'));var _0x4da07e=squel['expr']();var _0x56f801=[];var _0x40444a=squel[_0xc4a6('0x5b')]();var _0x3f7a7f;if(_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x5c')]){_0x3f7a7f=as[_0xc4a6('0x5d')](_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x5c')]);var _0x473a4c=_0x3f7a7f[_0xc4a6('0x5e')];for(var _0x42ca05=0x0;_0x42ca05<_0x3f7a7f[_0xc4a6('0x5f')][_0xc4a6('0x40')];_0x42ca05++){var _0x4f004d=_0x3f7a7f[_0xc4a6('0x5f')][_0x42ca05];var _0x7edcab='i';var _0x1ff7bd=_[_0xc4a6('0x60')](_0x210bf1,[_0xc4a6('0x2e'),_0x4f004d[_0xc4a6('0x48')]]);if(!_0x1ff7bd){switch(_0x4f004d[_0xc4a6('0x48')]){case _0xc4a6('0x61'):if(_0x4f004d[_0xc4a6('0x62')]==0x1){_0x260969[_0xc4a6('0x63')]('`'+_0x4f004d[_0xc4a6('0x48')]+_0xc4a6('0x64'));}else{_0x260969[_0xc4a6('0x63')]('`'+_0x4f004d[_0xc4a6('0x48')]+_0xc4a6('0x65'));}break;case'Contact':if(_0x4f004d['operator']==='$substring'){if(_0x4f004d[_0xc4a6('0x62')][_0xc4a6('0x35')]('\x20')[_0xc4a6('0x40')]>0x1){_0x4da07e[_0x473a4c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc4a6('0x66')](_0x4f004d[_0xc4a6('0x62')]),null);}else{var _0x2516c5='%'+_0x4f004d[_0xc4a6('0x62')]+'%';_0x4da07e[_0x473a4c](_0xc4a6('0x67'),_0x2516c5,_0x2516c5,_0x2516c5);}}else{_0x1ff7bd=_[_0xc4a6('0x60')](_0x210bf1,[_0xc4a6('0x2e'),_0xc4a6('0x68')]);_0x4f004d[_0xc4a6('0x48')]=_0xc4a6('0x68');_0x2dab90=as[_0xc4a6('0x69')](_0x7edcab,_0x1ff7bd['type'],_0x4f004d);_0x4da07e[_0x473a4c](_0x2dab90[_0xc4a6('0x6a')],_0x2dab90['value'][_0xc4a6('0x6b')],_0x2dab90['value']['end']);}break;case _0xc4a6('0x6c'):var _0x1f2e5d=_0x4f004d[_0xc4a6('0x62')][_0xc4a6('0x35')](',')[_0xc4a6('0x31')](function(_0x355544){return Number(_0x355544);});_0x1f2e5d[_0xc4a6('0x6d')](function(_0x311ade){_0x40444a['or'](_0xc4a6('0x6e'),'%,'+_0x311ade+',%');});_0x56f801=_[_0xc4a6('0x6f')](_0x56f801,_0x1f2e5d);break;case _0xc4a6('0x70'):if(_0x4f004d[_0xc4a6('0x71')]===_0xc4a6('0x72')){_0x4da07e[_0x473a4c](_0xc4a6('0x73'),'%'+_0x4f004d['value']+'%',null);}else{_0x1ff7bd=_[_0xc4a6('0x60')](_0x210bf1,[_0xc4a6('0x2e'),_0xc4a6('0x74')]);_0x4f004d[_0xc4a6('0x48')]=_0xc4a6('0x74');_0x2dab90=as['buildExpression'](_0x7edcab,_0x1ff7bd[_0xc4a6('0x75')],_0x4f004d);_0x4da07e[_0x473a4c](_0x2dab90[_0xc4a6('0x6a')],_0x2dab90['value']['start'],_0x2dab90['value'][_0xc4a6('0x20')]);}break;case'body':_0x2dab90=as[_0xc4a6('0x69')]('me',null,_0x4f004d);_0x4da07e[_0x473a4c](_0x2dab90[_0xc4a6('0x6a')],_0x2dab90['value'][_0xc4a6('0x6b')],_0x2dab90[_0xc4a6('0x62')][_0xc4a6('0x20')]);break;}}else{var _0x2dab90=as[_0xc4a6('0x69')](_0x7edcab,_0x1ff7bd['type'],_0x4f004d);_0x4da07e[_0x473a4c](_0x2dab90[_0xc4a6('0x6a')],_0x2dab90[_0xc4a6('0x62')]['start'],_0x2dab90['value'][_0xc4a6('0x20')]);}}}else{var _0x1b828d=_(_0x2b9c0e['query'])['keys']()[_0xc4a6('0x31')](function(_0x4e729f){return _[_0xc4a6('0x76')](_0x210bf1,[_0xc4a6('0x2e'),_0x4e729f])?_0x4e729f:undefined;})[_0xc4a6('0x77')]()[_0xc4a6('0x62')]();if(!_['isEmpty'](_0x1b828d)){_0x1b828d['forEach'](function(_0x54208f){if(_0x54208f===_0xc4a6('0x78')){_0x260969['where'](_0xc4a6('0x79'),[]['concat'](_0x2b9c0e['query'][_0x54208f]));}else if(_0x54208f===_0xc4a6('0x7a')){var _0x51ef86=JSON[_0xc4a6('0x7b')](_0x2b9c0e[_0xc4a6('0x3f')][_0x54208f])['$gte'];var _0x35d982=JSON[_0xc4a6('0x7b')](_0x2b9c0e[_0xc4a6('0x3f')][_0x54208f])[_0xc4a6('0x7c')];_0x260969[_0xc4a6('0x45')](_0xc4a6('0x7d'),_0x51ef86,_0x35d982);}else{if(_0x2b9c0e['query'][_0x54208f]===_0xc4a6('0x7e')){_0x260969[_0xc4a6('0x45')]('i.'+_0x54208f+_0xc4a6('0x7f'));}else{_0x260969['where']('i.'+_0x54208f+'\x20=\x20?',_0x2b9c0e[_0xc4a6('0x3f')][_0x54208f]);}}});}if(_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x80')]){if(_0x2b9c0e['query'][_0xc4a6('0x80')]==0x1){_0x260969[_0xc4a6('0x63')](_0xc4a6('0x81'));}else{_0x260969['having']('`unreadMessages`\x20>\x200');}}if(_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x82')]){_0x56f801=_[_0xc4a6('0x83')](_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x82')])?_0x2b9c0e['query'][_0xc4a6('0x82')]:new Array(_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x82')]);_0x56f801[_0xc4a6('0x6d')](function(_0x29454a){_0x40444a['or'](_0xc4a6('0x6e'),'%,'+_0x29454a+',%');});}if(_0x2b9c0e[_0xc4a6('0x3f')]['filter']){var _0x397b99=_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x84')][_0xc4a6('0x85')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xc4a6('0x86')](_0x397b99)){_0x4da07e['or'](_0xc4a6('0x87'),_0x397b99+'%')['or'](_0xc4a6('0x88'),_0x397b99+'%');}_0x4da07e['or'](_0xc4a6('0x89'),_0x397b99+'%');}}_0x260969[_0xc4a6('0x45')](_0x4da07e);_0x260969[_0xc4a6('0x8a')](_0xc4a6('0x8b'));var _0x32808e={'type':db['Sequelize'][_0xc4a6('0x8c')][_0xc4a6('0x8d')],'raw':!![]};var _0xb54566=_0x260969['clone']();_0xb54566[_0xc4a6('0x48')](_0xc4a6('0x8b'));_0xb54566[_0xc4a6('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0xad8010['order']){_0xad8010[_0xc4a6('0x43')][_0xc4a6('0x6d')](function(_0x4be680){var _0x20da50=_0x4be680[0x0]===_0xc4a6('0x8e')?_0x4be680[0x0]:'i.'+_0x4be680[0x0];_0x260969[_0xc4a6('0x43')](_0x20da50,_0x4be680[0x1]===_0xc4a6('0x8f')?![]:!![]);});}if(!_[_0xc4a6('0x90')](_0x56f801)){_0x260969[_0xc4a6('0x63')](_0x40444a);_0xb54566[_0xc4a6('0x45')](_0xc4a6('0x91'),_0x56f801);}BPromise[_0xc4a6('0x92')]()[_0xc4a6('0x2b')](function(){if(!_0x3f7a7f){if(_0x2b9c0e[_0xc4a6('0x3f')]['FaxAccountId'])return;_0xb54566[_0xc4a6('0x45')](_0xc4a6('0x93'));_0x260969[_0xc4a6('0x45')](_0xc4a6('0x93'));return;}if(_0x2b9c0e['user'][_0xc4a6('0x94')]!==_0xc4a6('0x95'))return;return _0x2b9c0e[_0xc4a6('0x96')][_0xc4a6('0x97')]({'attributes':['id'],'raw':!![]})[_0xc4a6('0x2b')](function(_0x5a1426){if(_[_0xc4a6('0x90')](_0x5a1426)){_0xb54566[_0xc4a6('0x45')](_0xc4a6('0x98'));_0x260969[_0xc4a6('0x45')](_0xc4a6('0x98'));}else{_0xb54566[_0xc4a6('0x45')](_0xc4a6('0x79'),_[_0xc4a6('0x31')](_0x5a1426,'id'));_0x260969[_0xc4a6('0x45')](_0xc4a6('0x79'),_[_0xc4a6('0x31')](_0x5a1426,'id'));}});})[_0xc4a6('0x2b')](function(){if(_0x2b9c0e['user']['role']===_0xc4a6('0x95')&&!_0x3f7a7f&&!_0x2b9c0e[_0xc4a6('0x3f')]['FaxAccountId'])return[];return db[_0xc4a6('0x99')][_0xc4a6('0x3f')](_0xb54566['toString'](),_0x32808e);})['then'](function(_0x494d84){_0x5c33c4[_0xc4a6('0x26')]=_0x494d84[_0xc4a6('0x40')];if(_0x5c33c4[_0xc4a6('0x26')]===0x0)return[];return db[_0xc4a6('0x99')][_0xc4a6('0x3f')](_0x3c3ea5[_0xc4a6('0x9a')](),_0x32808e)[_0xc4a6('0x2b')](function(_0x528d54){_0x40fb9e=_[_0xc4a6('0x9b')](_0x528d54,'id');_0x32808e=_[_0xc4a6('0x9c')](_0x32808e,{'model':db[_0xc4a6('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b9c0e[_0xc4a6('0x3f')][_0xc4a6('0x3e')]){_0xad8010[_0xc4a6('0x3d')]['forEach'](function(_0x29f8db){_0x260969[_0xc4a6('0x48')]('i.'+_0x29f8db);});}else{_0x260969['field'](_0xc4a6('0x9e'),'unreadMessages');_0x260969[_0xc4a6('0x48')](_0xc4a6('0x9f'),_0xc4a6('0xa0'));_0x260969[_0xc4a6('0x48')]('a.mandatoryDisposition',_0xc4a6('0xa1'));_0x260969[_0xc4a6('0x48')](_0xc4a6('0xa2'),'contactName');_0x260969[_0xc4a6('0x48')](_0xc4a6('0xa3'));_0x260969[_0xc4a6('0x48')](_0xc4a6('0xa4'),'Contact.firstName');_0x260969[_0xc4a6('0x48')](_0xc4a6('0xa5'),_0xc4a6('0xa6'));_0x260969['field']('c.email',_0xc4a6('0xa7'));_0x260969['field'](_0xc4a6('0xa8'),_0xc4a6('0xa9'));_0x260969[_0xc4a6('0x48')]('c.mobile',_0xc4a6('0xaa'));_0x260969[_0xc4a6('0x48')](_0xc4a6('0xab'),'Contact.fax');_0x260969[_0xc4a6('0x48')](_0xc4a6('0xac'),'Owner.fullname');_0x260969[_0xc4a6('0x48')](_0xc4a6('0xad'),_0xc4a6('0xae'));_0x260969[_0xc4a6('0x48')](_0xc4a6('0xaf'),_0xc4a6('0x33'));}if(_0xad8010[_0xc4a6('0x24')])_0x260969[_0xc4a6('0x24')](_0xad8010[_0xc4a6('0x24')]);if(_0xad8010[_0xc4a6('0x23')])_0x260969[_0xc4a6('0x23')](_0xad8010[_0xc4a6('0x23')]);return db['sequelize'][_0xc4a6('0x3f')](_0x260969['toString'](),_0x32808e);})[_0xc4a6('0x2b')](function(_0x55d4b4){if(_0x55d4b4[_0xc4a6('0x40')]>0x0)_0x45d0bb[_0xc4a6('0x45')](_0xc4a6('0xb0'),_[_0xc4a6('0x31')](_0x55d4b4,'id'));return db['sequelize'][_0xc4a6('0x3f')](_0x45d0bb[_0xc4a6('0x9a')](),_0x32808e)['then'](function(_0x590b43){var _0x2e0eb6=_['groupBy'](_0x590b43,_0xc4a6('0xb1'));var _0x177b41=[];_0x55d4b4['forEach'](function(_0x2100f8){_0x177b41[_0xc4a6('0x36')](updateFaxInteraction(_0x2100f8,_0x40fb9e,_0x2e0eb6));});return BPromise[_0xc4a6('0xb2')](_0x177b41);});});})[_0xc4a6('0x2b')](function(_0x3dfab6){_0x5c33c4['rows']=_0x3dfab6;return _0x5c33c4;})[_0xc4a6('0x2b')](respondWithFilteredResult(_0x59d7e5,_0xad8010))[_0xc4a6('0x37')](handleError(_0x59d7e5,null));};exports['show']=function(_0x1f7e05,_0x403ee2){var _0x47cce5={'raw':![],'where':{'id':_0x1f7e05[_0xc4a6('0xb3')]['id']}},_0x1ef6d3={};_0x1ef6d3[_0xc4a6('0x3a')]=_[_0xc4a6('0xb4')](db[_0xc4a6('0x9d')]['rawAttributes']);_0x1ef6d3[_0xc4a6('0x3f')]=_['keys'](_0x1f7e05[_0xc4a6('0x3f')]);_0x1ef6d3['filters']=_[_0xc4a6('0x3c')](_0x1ef6d3[_0xc4a6('0x3a')],_0x1ef6d3[_0xc4a6('0x3f')]);_0x47cce5[_0xc4a6('0x3d')]=_[_0xc4a6('0x3c')](_0x1ef6d3[_0xc4a6('0x3a')],qs[_0xc4a6('0x3e')](_0x1f7e05[_0xc4a6('0x3f')][_0xc4a6('0x3e')]));_0x47cce5[_0xc4a6('0x3d')]=_0x47cce5[_0xc4a6('0x3d')][_0xc4a6('0x40')]?_0x47cce5[_0xc4a6('0x3d')]:_0x1ef6d3[_0xc4a6('0x3a')];if(_0x1f7e05[_0xc4a6('0x3f')][_0xc4a6('0xb5')]){_0x47cce5[_0xc4a6('0xb6')]=[{'all':!![]}];}_0x47cce5=_[_0xc4a6('0x9c')]({},_0x47cce5,_0x1f7e05[_0xc4a6('0xb7')]);return db['FaxInteraction'][_0xc4a6('0x60')](_0x47cce5)['then'](handleEntityNotFound(_0x403ee2,null))[_0xc4a6('0x2b')](respondWithResult(_0x403ee2,null))[_0xc4a6('0x37')](handleError(_0x403ee2,null));};exports[_0xc4a6('0xb8')]=function(_0xa6aa0,_0xe7901a){return db['FaxInteraction'][_0xc4a6('0xb8')](_0xa6aa0[_0xc4a6('0xb9')],{})[_0xc4a6('0x2b')](respondWithResult(_0xe7901a,0xc9))[_0xc4a6('0x37')](handleError(_0xe7901a,null));};exports[_0xc4a6('0xba')]=function(_0x13be3e,_0xbadfb6){if(_0x13be3e[_0xc4a6('0xb9')]['id']){delete _0x13be3e[_0xc4a6('0xb9')]['id'];}return db[_0xc4a6('0x9d')][_0xc4a6('0x60')]({'where':{'id':_0x13be3e['params']['id']}})[_0xc4a6('0x2b')](handleEntityNotFound(_0xbadfb6,null))[_0xc4a6('0x2b')](saveUpdates(_0x13be3e[_0xc4a6('0xb9')],null))[_0xc4a6('0x2b')](respondWithResult(_0xbadfb6,null))[_0xc4a6('0x37')](handleError(_0xbadfb6,null));};exports['destroy']=function(_0x478a8d,_0x2f8662){return db[_0xc4a6('0x9d')]['find']({'where':{'id':_0x478a8d[_0xc4a6('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2f8662,null))[_0xc4a6('0x2b')](removeEntity(_0x2f8662,null))['catch'](handleError(_0x2f8662,null));};exports[_0xc4a6('0xbb')]=function(_0x567bc0,_0xcd18b6){return db[_0xc4a6('0x9d')][_0xc4a6('0xbb')]()['then'](respondWithResult(_0xcd18b6,null))['catch'](handleError(_0xcd18b6,null));};exports[_0xc4a6('0xbc')]=function(_0x276186,_0x104612,_0x5b7fc6){return db[_0xc4a6('0xbd')][_0xc4a6('0x60')]({'where':{'id':_0x276186[_0xc4a6('0xb3')]['id']}})[_0xc4a6('0x2b')](handleEntityNotFound(_0x104612,null))[_0xc4a6('0x2b')](function(_0xac7a37){if(_0xac7a37){return _0xac7a37[_0xc4a6('0xbc')](_0x276186[_0xc4a6('0xb9')][_0xc4a6('0xbe')],_[_0xc4a6('0xbf')](_0x276186[_0xc4a6('0xb9')],[_0xc4a6('0xbe'),'id'])||{});}})[_0xc4a6('0x2b')](respondWithResult(_0x104612,null))[_0xc4a6('0x37')](handleError(_0x104612,null));};exports[_0xc4a6('0xc0')]=function(_0x3405ab,_0x5888ac,_0x5db8e8){var _0x11056f={'raw':![],'where':{}};var _0x1059cb={};var _0x390762={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x3405ab[_0xc4a6('0xb3')]['id']}})[_0xc4a6('0x2b')](handleEntityNotFound(_0x5888ac,null))[_0xc4a6('0x2b')](function(_0x2504e7){if(_0x2504e7){_0x1059cb[_0xc4a6('0x3a')]=_['keys'](db[_0xc4a6('0xbd')][_0xc4a6('0xc1')]);_0x1059cb['query']=_['keys'](_0x3405ab[_0xc4a6('0x3f')]);_0x1059cb[_0xc4a6('0x3b')]=_['intersection'](_0x1059cb['model'],_0x1059cb[_0xc4a6('0x3f')]);_0x11056f[_0xc4a6('0x3d')]=_['intersection'](_0x1059cb[_0xc4a6('0x3a')],qs[_0xc4a6('0x3e')](_0x3405ab[_0xc4a6('0x3f')][_0xc4a6('0x3e')]));_0x11056f['attributes']=_0x11056f[_0xc4a6('0x3d')][_0xc4a6('0x40')]?_0x11056f[_0xc4a6('0x3d')]:_0x1059cb[_0xc4a6('0x3a')];if(!_0x3405ab['query'][_0xc4a6('0x41')](_0xc4a6('0x42'))){_0x11056f[_0xc4a6('0x24')]=qs[_0xc4a6('0x24')](_0x3405ab[_0xc4a6('0x3f')][_0xc4a6('0x24')]);_0x11056f['offset']=qs['offset'](_0x3405ab['query'][_0xc4a6('0x23')]);}_0x11056f['order']=qs[_0xc4a6('0x44')](_0x3405ab[_0xc4a6('0x3f')][_0xc4a6('0x44')]);_0x11056f['where']=qs[_0xc4a6('0x3b')](_[_0xc4a6('0x46')](_0x3405ab[_0xc4a6('0x3f')],_0x1059cb['filters']));_0x11056f[_0xc4a6('0x45')]['FaxInteractionId']=_0x2504e7['id'];if(_0x3405ab['query']['filter']){_0x11056f[_0xc4a6('0x45')]=_[_0xc4a6('0x9c')](_0x11056f[_0xc4a6('0x45')],{'$or':_[_0xc4a6('0x31')](_0x11056f['attributes'],function(_0xabf16c){var _0xf5616a={};_0xf5616a[_0xabf16c]={'$like':'%'+_0x3405ab[_0xc4a6('0x3f')][_0xc4a6('0x84')]+'%'};return _0xf5616a;})});}if(_0x3405ab[_0xc4a6('0x3f')][_0xc4a6('0xc2')]){var _0x1b36a5=_0x3405ab[_0xc4a6('0x3f')][_0xc4a6('0xc2')][_0xc4a6('0x35')](',');var _0x3b5f6d={};_0x3b5f6d[_0x1b36a5[0x0]]={'$gte':moment(_0x1b36a5[0x1])[_0xc4a6('0xc3')](_0xc4a6('0xc4'))};_0x11056f['where']=_[_0xc4a6('0x9c')](_0x11056f[_0xc4a6('0x45')],_0x3b5f6d);}_0x11056f=_[_0xc4a6('0x9c')]({},_0x11056f,_0x3405ab[_0xc4a6('0xb7')]);return db['FaxMessage']['count']({'where':_0x11056f['where']})[_0xc4a6('0x2b')](function(_0xe122a5){_0x390762['count']=_0xe122a5;if(_0x3405ab['query'][_0xc4a6('0xb5')]){_0x11056f['include']=[{'all':!![]}];}return db['FaxMessage'][_0xc4a6('0xc5')](_0x11056f);})[_0xc4a6('0x2b')](function(_0x203ceb){_0x390762[_0xc4a6('0xc6')]=_0x203ceb;return _0x390762;});}})[_0xc4a6('0x2b')](respondWithFilteredResult(_0x5888ac,_0x11056f))['catch'](handleError(_0x5888ac,null));};exports[_0xc4a6('0xc7')]=function(_0x5e06bb,_0x5b644d,_0x55a050){return db['FaxInteraction'][_0xc4a6('0x60')]({'where':{'id':_0x5e06bb['params']['id']}})[_0xc4a6('0x2b')](handleEntityNotFound(_0x5b644d,null))[_0xc4a6('0x2b')](function(_0x36227f){if(_0x36227f){return _0x36227f['setTags'](_0x5e06bb['body'][_0xc4a6('0xbe')],_[_0xc4a6('0xbf')](_0x5e06bb[_0xc4a6('0xb9')],['ids','id'])||{})[_0xc4a6('0xc8')](function(){return db['Tag'][_0xc4a6('0xc5')]({'attributes':['id',_0xc4a6('0x2e'),_0xc4a6('0x49')],'where':{'id':_0x5e06bb[_0xc4a6('0xb9')]['ids']}});})[_0xc4a6('0x2b')](function(_0x17d346){socket['emit']('faxInteractionTags:save',{'id':Number(_0x5e06bb[_0xc4a6('0xb3')]['id']),'tags':_0x17d346||[]});return{'id':Number(_0x5e06bb[_0xc4a6('0xb3')]['id']),'tags':_0x17d346||[]};});}})[_0xc4a6('0x2b')](respondWithResult(_0x5b644d,null))[_0xc4a6('0x37')](handleError(_0x5b644d,null));};exports[_0xc4a6('0xc9')]=function(_0x4f76e4,_0x3d1f09,_0x25b1c5){return db[_0xc4a6('0x9d')]['find']({'where':{'id':_0x4f76e4['params']['id']}})[_0xc4a6('0x2b')](handleEntityNotFound(_0x3d1f09,null))[_0xc4a6('0x2b')](function(_0x3fa3da){if(_0x3fa3da){return _0x3fa3da[_0xc4a6('0xc9')](_0x4f76e4[_0xc4a6('0x3f')][_0xc4a6('0xbe')]);}})['then'](respondWithStatusCode(_0x3d1f09,null))[_0xc4a6('0x37')](handleError(_0x3d1f09,null));};exports[_0xc4a6('0xca')]=function(_0x349b92,_0x271cdd){var _0x2af34b=moment()[_0xc4a6('0xcb')]()['toString']();var _0x2e181b=path[_0xc4a6('0xcc')](config[_0xc4a6('0xcd')],_0xc4a6('0xce'),_0xc4a6('0xcf'),'tmp');var _0x56dfcb=path[_0xc4a6('0xcc')](config[_0xc4a6('0xcd')],_0xc4a6('0xce'),_0xc4a6('0xcf'),_0xc4a6('0xd0'));var _0x317ce2=path['join'](_0x2e181b,_0x2af34b);var _0x33d6c8=util[_0xc4a6('0xc3')]('transcript-%d-%s.zip',_0x349b92[_0xc4a6('0xb3')]['id'],_0x2af34b);var _0x543114=path[_0xc4a6('0xcc')](_0x2e181b,_0x33d6c8);var _0x425a7a=[];_0x425a7a[_0xc4a6('0x36')]({'model':db[_0xc4a6('0xd1')],'as':_0xc4a6('0xd1'),'raw':!![]});var _0x226fc9=[{'model':db[_0xc4a6('0xbd')],'as':_0xc4a6('0xd2'),'attributes':['id','body','createdAt'],'include':_0x425a7a}];return db[_0xc4a6('0x9d')][_0xc4a6('0x60')]({'where':{'id':_0x349b92[_0xc4a6('0xb3')]['id']},'include':_0x226fc9})[_0xc4a6('0x2b')](handleEntityNotFound(_0x271cdd,null))[_0xc4a6('0x2b')](function(_0x43577b){if(_0x43577b&&_0x43577b[_0xc4a6('0xd2')]){var _0x1f790b=_0x43577b[_0xc4a6('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x317ce2);for(var _0x6b973a=0x0;_0x6b973a<_0x1f790b[_0xc4a6('0xd2')]['length'];_0x6b973a++){var _0x23eb5c=_0x1f790b['Messages'][_0x6b973a]['Attachment'];if(_0x23eb5c){var _0x1cf6bc=path[_0xc4a6('0xcc')](_0x56dfcb,_0x23eb5c[_0xc4a6('0xd4')]);if(fs[_0xc4a6('0xd5')](_0x1cf6bc)){fs[_0xc4a6('0xd6')](_0x1cf6bc)[_0xc4a6('0xd7')](fs[_0xc4a6('0xd8')](path['join'](_0x317ce2,_0x23eb5c[_0xc4a6('0xd4')])));}}}return BPromise[_0xc4a6('0x92')]()[_0xc4a6('0x2b')](function(){return new BPromise(function(_0x37ea5b,_0x4bfb04){zipdir(_0x317ce2,{'saveTo':_0x543114},function(_0x217526,_0x44e921){if(_0x217526)return _0x4bfb04(_0x217526);return _0x37ea5b(_0x44e921);});})['then'](function(){return new BPromise(function(_0x4d24de,_0x2b02f9){rimraf(_0x317ce2,function(_0x3610da){if(_0x3610da)_0x2b02f9(_0x3610da);return _0x4d24de();});});})[_0xc4a6('0x2b')](function(){return _0x271cdd['download'](_0x543114,_0x33d6c8,function(_0x3f8297){if(_0x3f8297){console['log'](_0xc4a6('0xd9'),_0x3f8297);}else{fs[_0xc4a6('0xda')](_0x543114);}});});});}else{return _0x271cdd[_0xc4a6('0x1f')](0xc8);}})[_0xc4a6('0x37')](handleError(_0x271cdd,null));};
\ No newline at end of file
+var _0xb6ee=['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','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','i.id','Sequelize','QueryTypes','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Owner.fullname','o.internal','Owner.internal','ui.FaxInteractionId\x20IN\x20?','all','rows','rawAttributes','intersection','includeAll','include','create','describe','addMessage','params','ids','omit','getMessages','findOne','FaxMessage','pick','FaxInteractionId','$gte','format','options','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','end','error','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','catch','index','map','FaxInteraction','fieldName','type','model','query','keys','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','select','field','from','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','length','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?'];(function(_0x406c07,_0x188e1b){var _0x38722c=function(_0x2ab052){while(--_0x2ab052){_0x406c07['push'](_0x406c07['shift']());}};_0x38722c(++_0x188e1b);}(_0xb6ee,0x71));var _0xeb6e=function(_0x90960,_0x1092a0){_0x90960=_0x90960-0x0;var _0x530a3f=_0xb6ee[_0x90960];return _0x530a3f;};'use strict';var emlformat=require(_0xeb6e('0x0'));var rimraf=require(_0xeb6e('0x1'));var zipdir=require(_0xeb6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb6e('0x3'));var moment=require(_0xeb6e('0x4'));var BPromise=require(_0xeb6e('0x5'));var Mustache=require(_0xeb6e('0x6'));var util=require('util');var path=require(_0xeb6e('0x7'));var sox=require('sox');var csv=require(_0xeb6e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb6e('0x9'));var _=require(_0xeb6e('0xa'));var squel=require('squel');var crypto=require(_0xeb6e('0xb'));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(_0xeb6e('0xc'));var authService=require(_0xeb6e('0xd'));var qs=require(_0xeb6e('0xe'));var as=require(_0xeb6e('0xf'));var hardwareService=require(_0xeb6e('0x10'));var logger=require(_0xeb6e('0x11'))(_0xeb6e('0x12'));var utils=require('../../config/utils');var config=require(_0xeb6e('0x13'));var licenseUtil=require(_0xeb6e('0x14'));var db=require(_0xeb6e('0x15'))['db'];config[_0xeb6e('0x16')]=_['defaults'](config[_0xeb6e('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb6e('0x16')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x594f26,_0x317e66){_0x317e66=_0x317e66||0xcc;return function(_0xb436f8){if(_0xb436f8){return _0x594f26[_0xeb6e('0x17')](_0x317e66);}return _0x594f26[_0xeb6e('0x18')](_0x317e66)['end']();};}function respondWithResult(_0x47fe32,_0x4ea2a7){_0x4ea2a7=_0x4ea2a7||0xc8;return function(_0x4fa0d1){if(_0x4fa0d1){return _0x47fe32[_0xeb6e('0x18')](_0x4ea2a7)[_0xeb6e('0x19')](_0x4fa0d1);}};}function respondWithFilteredResult(_0x59a7dc,_0x5b0fff){return function(_0x20062f){if(_0x20062f){var _0x41afce=typeof _0x5b0fff[_0xeb6e('0x1a')]===_0xeb6e('0x1b')&&typeof _0x5b0fff[_0xeb6e('0x1c')]===_0xeb6e('0x1b');var _0x44eddf=_0x20062f[_0xeb6e('0x1d')];var _0x48695d=_0x41afce?0x0:_0x5b0fff['offset'];var _0x3d2933=_0x41afce?_0x20062f[_0xeb6e('0x1d')]:_0x5b0fff[_0xeb6e('0x1a')]+_0x5b0fff['limit'];var _0x2d09f1;if(_0x3d2933>=_0x44eddf){_0x3d2933=_0x44eddf;_0x2d09f1=0xc8;}else{_0x2d09f1=0xce;}_0x59a7dc[_0xeb6e('0x18')](_0x2d09f1);return _0x59a7dc[_0xeb6e('0x1e')]('Content-Range',_0x48695d+'-'+_0x3d2933+'/'+_0x44eddf)[_0xeb6e('0x19')](_0x20062f);}return null;};}function patchUpdates(_0x2e4ac6){return function(_0x33a484){try{jsonpatch[_0xeb6e('0x1f')](_0x33a484,_0x2e4ac6,!![]);}catch(_0x1613bb){return BPromise['reject'](_0x1613bb);}return _0x33a484[_0xeb6e('0x20')]();};}function saveUpdates(_0x5514ee,_0x3322db){return function(_0x55f90b){if(_0x55f90b){return _0x55f90b[_0xeb6e('0x21')](_0x5514ee)[_0xeb6e('0x22')](function(_0xafad0f){return _0xafad0f;});}return null;};}function removeEntity(_0x116c3c,_0x8ea1a3){return function(_0x62fa49){if(_0x62fa49){return _0x62fa49[_0xeb6e('0x23')]()[_0xeb6e('0x22')](function(){_0x116c3c[_0xeb6e('0x18')](0xcc)[_0xeb6e('0x24')]();});}};}function handleEntityNotFound(_0x542877,_0x45b529){return function(_0x11a258){if(!_0x11a258){_0x542877[_0xeb6e('0x17')](0x194);}return _0x11a258;};}function handleError(_0x3c2830,_0x29c95c){_0x29c95c=_0x29c95c||0x1f4;return function(_0x5a0024){logger[_0xeb6e('0x25')](_0x5a0024[_0xeb6e('0x26')]);if(_0x5a0024[_0xeb6e('0x27')]){delete _0x5a0024[_0xeb6e('0x27')];}_0x3c2830[_0xeb6e('0x18')](_0x29c95c)[_0xeb6e('0x28')](_0x5a0024);};}function getInteractionUsers(_0x11ed31,_0x58223f){return new BPromise(function(_0x29a379,_0x50ebb0){try{if(_0x58223f[_0x11ed31['id']]){_0x11ed31[_0xeb6e('0x29')]=_['map'](_0x58223f[_0x11ed31['id']],function(_0xcd5f7){return{'id':_0xcd5f7['id'],'fullname':_0xcd5f7[_0xeb6e('0x2a')]};});}}catch(_0x4574c4){_0x50ebb0(_0x4574c4);}_0x29a379(_0x11ed31);});}function getInteractionTags(_0x2387c3,_0x5f0bf7){return new BPromise(function(_0x1880f4,_0x38b046){try{if(_0x2387c3[_0xeb6e('0x2b')]){_0x2387c3[_0xeb6e('0x2c')]=[];_0x2387c3[_0xeb6e('0x2b')][_0xeb6e('0x2d')](',')[_0xeb6e('0x2e')](function(_0x5e127c){_0x2387c3[_0xeb6e('0x2c')][_0xeb6e('0x2f')](_0x5f0bf7[_0x5e127c]);});}delete _0x2387c3['TagIds'];}catch(_0x2dac02){_0x38b046(_0x2dac02);}_0x1880f4(_0x2387c3);});}function updateFaxInteraction(_0xfb2aa6,_0x227367,_0x4348d0){return new BPromise(function(_0xb3b95,_0x21ee58){return getInteractionUsers(_0xfb2aa6,_0x4348d0)[_0xeb6e('0x22')](function(_0x19fe07){return getInteractionTags(_0x19fe07,_0x227367);})[_0xeb6e('0x22')](function(_0x3dfbf1){_0xb3b95(_0x3dfbf1);})[_0xeb6e('0x30')](function(_0x557094){_0x21ee58(_0x557094);});});}exports[_0xeb6e('0x31')]=function(_0x4a3b2b,_0x5017f7){var _0x5962f3={},_0x484e67={},_0xf22d1={'count':0x0,'rows':[]};var _0x21999b=_[_0xeb6e('0x32')](db[_0xeb6e('0x33')]['rawAttributes'],function(_0x5d510c){return{'name':_0x5d510c[_0xeb6e('0x34')],'type':_0x5d510c[_0xeb6e('0x35')]['key']};});_0x484e67[_0xeb6e('0x36')]=_[_0xeb6e('0x32')](_0x21999b,_0xeb6e('0x27'));_0x484e67[_0xeb6e('0x37')]=_[_0xeb6e('0x38')](_0x4a3b2b[_0xeb6e('0x37')]);_0x484e67['filters']=_['intersection'](_0x484e67[_0xeb6e('0x36')],_0x484e67['query']);_0x5962f3['attributes']=_['intersection'](_0x484e67[_0xeb6e('0x36')],qs['fields'](_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x39')]));_0x5962f3[_0xeb6e('0x3a')]=_0x5962f3['attributes']['length']?_0x5962f3['attributes']:_0x484e67[_0xeb6e('0x36')];if(!_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x3b')](_0xeb6e('0x3c'))){_0x5962f3[_0xeb6e('0x1c')]=qs[_0xeb6e('0x1c')](_0x4a3b2b['query']['limit']);_0x5962f3[_0xeb6e('0x1a')]=qs[_0xeb6e('0x1a')](_0x4a3b2b[_0xeb6e('0x37')]['offset']);}_0x5962f3[_0xeb6e('0x3d')]=qs['sort'](_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x3e')]);_0x5962f3[_0xeb6e('0x3f')]=qs[_0xeb6e('0x40')](_['pick'](_0x4a3b2b[_0xeb6e('0x37')],_0x484e67[_0xeb6e('0x40')]),_0x21999b);var _0x24f9af=[];var _0x4baa3a=squel[_0xeb6e('0x41')]()[_0xeb6e('0x42')]('id')['field']('name')[_0xeb6e('0x42')]('color')[_0xeb6e('0x43')]('tools_tags');var _0x4bb747=squel[_0xeb6e('0x41')]()['field'](_0xeb6e('0x44'))[_0xeb6e('0x42')]('u.fullname')['field'](_0xeb6e('0x45'))['from'](_0xeb6e('0x46'),'ui')[_0xeb6e('0x47')]('users','u',_0xeb6e('0x48'));var _0x991275=squel['select']()[_0xeb6e('0x43')](_0xeb6e('0x49'),'i')[_0xeb6e('0x47')](_0xeb6e('0x4a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xeb6e('0x47')](_0xeb6e('0x4b'),'o',_0xeb6e('0x4c'))[_0xeb6e('0x47')](_0xeb6e('0x4d'),'a',_0xeb6e('0x4e'))['left_join'](_0xeb6e('0x4f'),'me',_0xeb6e('0x50'))['left_join'](_0xeb6e('0x51'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xeb6e('0x47')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x4399f7=squel[_0xeb6e('0x52')]();var _0x36af72=[];var _0x2191a4=squel[_0xeb6e('0x52')]();var _0x29d782;if(_0x4a3b2b['query'][_0xeb6e('0x53')]){_0x29d782=as[_0xeb6e('0x54')](_0x4a3b2b['query'][_0xeb6e('0x53')]);var _0xd5bd13=_0x29d782[_0xeb6e('0x55')];for(var _0x52fe3a=0x0;_0x52fe3a<_0x29d782[_0xeb6e('0x56')]['length'];_0x52fe3a++){var _0x4277b3=_0x29d782['conditions'][_0x52fe3a];var _0x87faf6='i';var _0x2e0401=_[_0xeb6e('0x57')](_0x21999b,[_0xeb6e('0x27'),_0x4277b3[_0xeb6e('0x42')]]);if(!_0x2e0401){switch(_0x4277b3['field']){case _0xeb6e('0x58'):if(_0x4277b3['value']==0x1){_0x991275[_0xeb6e('0x59')]('`'+_0x4277b3[_0xeb6e('0x42')]+_0xeb6e('0x5a'));}else{_0x991275[_0xeb6e('0x59')]('`'+_0x4277b3['field']+_0xeb6e('0x5b'));}break;case _0xeb6e('0x5c'):if(_0x4277b3[_0xeb6e('0x5d')]===_0xeb6e('0x5e')){if(_0x4277b3[_0xeb6e('0x5f')][_0xeb6e('0x2d')]('\x20')[_0xeb6e('0x60')]>0x1){_0x4399f7[_0xd5bd13](_0xeb6e('0x61'),qs['getFullTextValue'](_0x4277b3[_0xeb6e('0x5f')]),null);}else{var _0x111aec='%'+_0x4277b3[_0xeb6e('0x5f')]+'%';_0x4399f7[_0xd5bd13](_0xeb6e('0x62'),_0x111aec,_0x111aec,_0x111aec);}}else{_0x2e0401=_[_0xeb6e('0x57')](_0x21999b,['name','ContactId']);_0x4277b3[_0xeb6e('0x42')]=_0xeb6e('0x63');_0x1275d8=as[_0xeb6e('0x64')](_0x87faf6,_0x2e0401[_0xeb6e('0x35')],_0x4277b3);_0x4399f7[_0xd5bd13](_0x1275d8[_0xeb6e('0x65')],_0x1275d8[_0xeb6e('0x5f')][_0xeb6e('0x66')],_0x1275d8[_0xeb6e('0x5f')][_0xeb6e('0x24')]);}break;case _0xeb6e('0x67'):var _0x29b0ad=_0x4277b3[_0xeb6e('0x5f')][_0xeb6e('0x2d')](',')[_0xeb6e('0x32')](function(_0x29e4d5){return Number(_0x29e4d5);});_0x29b0ad['forEach'](function(_0x509da6){_0x2191a4['or'](_0xeb6e('0x68'),'%,'+_0x509da6+',%');});_0x36af72=_['union'](_0x36af72,_0x29b0ad);break;case _0xeb6e('0x69'):if(_0x4277b3[_0xeb6e('0x5d')]===_0xeb6e('0x5e')){_0x4399f7[_0xd5bd13](_0xeb6e('0x6a'),'%'+_0x4277b3[_0xeb6e('0x5f')]+'%',null);}else{_0x2e0401=_[_0xeb6e('0x57')](_0x21999b,[_0xeb6e('0x27'),_0xeb6e('0x6b')]);_0x4277b3[_0xeb6e('0x42')]=_0xeb6e('0x6b');_0x1275d8=as[_0xeb6e('0x64')](_0x87faf6,_0x2e0401[_0xeb6e('0x35')],_0x4277b3);_0x4399f7[_0xd5bd13](_0x1275d8[_0xeb6e('0x65')],_0x1275d8[_0xeb6e('0x5f')][_0xeb6e('0x66')],_0x1275d8[_0xeb6e('0x5f')][_0xeb6e('0x24')]);}break;case _0xeb6e('0x6c'):_0x1275d8=as[_0xeb6e('0x64')]('me',null,_0x4277b3);_0x4399f7[_0xd5bd13](_0x1275d8[_0xeb6e('0x65')],_0x1275d8[_0xeb6e('0x5f')][_0xeb6e('0x66')],_0x1275d8[_0xeb6e('0x5f')][_0xeb6e('0x24')]);break;}}else{var _0x1275d8=as['buildExpression'](_0x87faf6,_0x2e0401[_0xeb6e('0x35')],_0x4277b3);_0x4399f7[_0xd5bd13](_0x1275d8[_0xeb6e('0x65')],_0x1275d8[_0xeb6e('0x5f')][_0xeb6e('0x66')],_0x1275d8[_0xeb6e('0x5f')]['end']);}}}else{var _0x358382=_(_0x4a3b2b['query'])[_0xeb6e('0x38')]()['map'](function(_0x800dfd){return _[_0xeb6e('0x6d')](_0x21999b,['name',_0x800dfd])?_0x800dfd:undefined;})[_0xeb6e('0x6e')]()[_0xeb6e('0x5f')]();if(!_[_0xeb6e('0x6f')](_0x358382)){_0x358382['forEach'](function(_0x595323){if(_0x595323===_0xeb6e('0x70')){_0x991275['where'](_0xeb6e('0x71'),[][_0xeb6e('0x72')](_0x4a3b2b[_0xeb6e('0x37')][_0x595323]));}else if(_0x595323===_0xeb6e('0x73')){var _0x59d600=JSON['parse'](_0x4a3b2b['query'][_0x595323])['$gte'];var _0x200b91=JSON[_0xeb6e('0x74')](_0x4a3b2b[_0xeb6e('0x37')][_0x595323])[_0xeb6e('0x75')];_0x991275[_0xeb6e('0x3f')](_0xeb6e('0x76'),_0x59d600,_0x200b91);}else{if(_0x4a3b2b[_0xeb6e('0x37')][_0x595323]==='null'){_0x991275[_0xeb6e('0x3f')]('i.'+_0x595323+_0xeb6e('0x77'));}else{_0x991275[_0xeb6e('0x3f')]('i.'+_0x595323+_0xeb6e('0x78'),_0x4a3b2b[_0xeb6e('0x37')][_0x595323]);}}});}if(_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x79')]){if(_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x79')]==0x1){_0x991275[_0xeb6e('0x59')](_0xeb6e('0x7a'));}else{_0x991275[_0xeb6e('0x59')](_0xeb6e('0x7b'));}}if(_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x7c')]){_0x36af72=_['isArray'](_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x7c')])?_0x4a3b2b['query'][_0xeb6e('0x7c')]:new Array(_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x7c')]);_0x36af72['forEach'](function(_0x3aff4c){_0x2191a4['or'](_0xeb6e('0x68'),'%,'+_0x3aff4c+',%');});}if(_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x7d')]){var _0x5ef027=_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x7d')][_0xeb6e('0x7e')]('\x5c','\x5c\x5c')[_0xeb6e('0x7e')](/'/g,'\x27\x27');if(qs[_0xeb6e('0x7f')](_0x5ef027)){_0x4399f7['or'](_0xeb6e('0x80'),_0x5ef027+'%')['or'](_0xeb6e('0x81'),_0x5ef027+'%');}_0x4399f7['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5ef027+'%');}}_0x991275['where'](_0x4399f7);_0x991275['group'](_0xeb6e('0x82'));var _0x5a23e1={'type':db[_0xeb6e('0x83')][_0xeb6e('0x84')]['SELECT'],'raw':!![]};var _0x55b891=_0x991275['clone']();_0x55b891[_0xeb6e('0x42')](_0xeb6e('0x82'));_0x55b891[_0xeb6e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5962f3['order']){_0x5962f3[_0xeb6e('0x3d')][_0xeb6e('0x2e')](function(_0x5a7d0d){var _0x37951e=_0x5a7d0d[0x0]===_0xeb6e('0x85')?_0x5a7d0d[0x0]:'i.'+_0x5a7d0d[0x0];_0x991275['order'](_0x37951e,_0x5a7d0d[0x1]===_0xeb6e('0x86')?![]:!![]);});}if(!_['isEmpty'](_0x36af72)){_0x991275[_0xeb6e('0x59')](_0x2191a4);_0x55b891['where'](_0xeb6e('0x87'),_0x36af72);}BPromise[_0xeb6e('0x88')]()['then'](function(){if(!_0x29d782){if(_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x70')])return;_0x55b891['where'](_0xeb6e('0x89'));_0x991275['where'](_0xeb6e('0x89'));return;}if(_0x4a3b2b[_0xeb6e('0x8a')]['role']!==_0xeb6e('0x8b'))return;return _0x4a3b2b['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xeb6e('0x22')](function(_0x4479bd){if(_[_0xeb6e('0x6f')](_0x4479bd)){_0x55b891[_0xeb6e('0x3f')](_0xeb6e('0x8c'));_0x991275[_0xeb6e('0x3f')](_0xeb6e('0x8c'));}else{_0x55b891[_0xeb6e('0x3f')](_0xeb6e('0x71'),_[_0xeb6e('0x32')](_0x4479bd,'id'));_0x991275[_0xeb6e('0x3f')](_0xeb6e('0x71'),_[_0xeb6e('0x32')](_0x4479bd,'id'));}});})['then'](function(){if(_0x4a3b2b[_0xeb6e('0x8a')][_0xeb6e('0x8d')]===_0xeb6e('0x8b')&&!_0x29d782&&!_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x70')])return[];return db[_0xeb6e('0x8e')][_0xeb6e('0x37')](_0x55b891[_0xeb6e('0x8f')](),_0x5a23e1);})[_0xeb6e('0x22')](function(_0x138420){_0xf22d1[_0xeb6e('0x1d')]=_0x138420[_0xeb6e('0x60')];if(_0xf22d1[_0xeb6e('0x1d')]===0x0)return[];return db[_0xeb6e('0x8e')][_0xeb6e('0x37')](_0x4baa3a[_0xeb6e('0x8f')](),_0x5a23e1)['then'](function(_0x71a0f0){_0x24f9af=_[_0xeb6e('0x90')](_0x71a0f0,'id');_0x5a23e1=_[_0xeb6e('0x91')](_0x5a23e1,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a3b2b[_0xeb6e('0x37')][_0xeb6e('0x39')]){_0x5962f3[_0xeb6e('0x3a')]['forEach'](function(_0x4f8168){_0x991275[_0xeb6e('0x42')]('i.'+_0x4f8168);});}else{_0x991275[_0xeb6e('0x42')](_0xeb6e('0x92'),_0xeb6e('0x58'));_0x991275[_0xeb6e('0x42')](_0xeb6e('0x93'),_0xeb6e('0x94'));_0x991275['field']('a.mandatoryDisposition',_0xeb6e('0x95'));_0x991275['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xeb6e('0x85'));_0x991275[_0xeb6e('0x42')](_0xeb6e('0x96'));_0x991275['field'](_0xeb6e('0x97'),_0xeb6e('0x98'));_0x991275[_0xeb6e('0x42')](_0xeb6e('0x99'),_0xeb6e('0x9a'));_0x991275['field'](_0xeb6e('0x9b'),_0xeb6e('0x9c'));_0x991275[_0xeb6e('0x42')]('c.phone',_0xeb6e('0x9d'));_0x991275[_0xeb6e('0x42')](_0xeb6e('0x9e'),_0xeb6e('0x9f'));_0x991275[_0xeb6e('0x42')]('c.fax','Contact.fax');_0x991275[_0xeb6e('0x42')]('o.fullname',_0xeb6e('0xa0'));_0x991275[_0xeb6e('0x42')](_0xeb6e('0xa1'),_0xeb6e('0xa2'));_0x991275[_0xeb6e('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xeb6e('0x2b'));}if(_0x5962f3[_0xeb6e('0x1c')])_0x991275[_0xeb6e('0x1c')](_0x5962f3[_0xeb6e('0x1c')]);if(_0x5962f3['offset'])_0x991275[_0xeb6e('0x1a')](_0x5962f3[_0xeb6e('0x1a')]);return db[_0xeb6e('0x8e')][_0xeb6e('0x37')](_0x991275[_0xeb6e('0x8f')](),_0x5a23e1);})[_0xeb6e('0x22')](function(_0x14dc71){if(_0x14dc71['length']>0x0)_0x4bb747[_0xeb6e('0x3f')](_0xeb6e('0xa3'),_[_0xeb6e('0x32')](_0x14dc71,'id'));return db[_0xeb6e('0x8e')][_0xeb6e('0x37')](_0x4bb747[_0xeb6e('0x8f')](),_0x5a23e1)[_0xeb6e('0x22')](function(_0x323c55){var _0x1e2c2b=_['groupBy'](_0x323c55,'FaxInteractionId');var _0x5cc05a=[];_0x14dc71[_0xeb6e('0x2e')](function(_0x446db0){_0x5cc05a[_0xeb6e('0x2f')](updateFaxInteraction(_0x446db0,_0x24f9af,_0x1e2c2b));});return BPromise[_0xeb6e('0xa4')](_0x5cc05a);});});})[_0xeb6e('0x22')](function(_0x281427){_0xf22d1[_0xeb6e('0xa5')]=_0x281427;return _0xf22d1;})[_0xeb6e('0x22')](respondWithFilteredResult(_0x5017f7,_0x5962f3))[_0xeb6e('0x30')](handleError(_0x5017f7,null));};exports['show']=function(_0x2865cd,_0x4e839f){var _0x5ddcec={'raw':![],'where':{'id':_0x2865cd['params']['id']}},_0x393684={};_0x393684[_0xeb6e('0x36')]=_[_0xeb6e('0x38')](db['FaxInteraction'][_0xeb6e('0xa6')]);_0x393684[_0xeb6e('0x37')]=_[_0xeb6e('0x38')](_0x2865cd[_0xeb6e('0x37')]);_0x393684[_0xeb6e('0x40')]=_[_0xeb6e('0xa7')](_0x393684[_0xeb6e('0x36')],_0x393684[_0xeb6e('0x37')]);_0x5ddcec[_0xeb6e('0x3a')]=_[_0xeb6e('0xa7')](_0x393684['model'],qs[_0xeb6e('0x39')](_0x2865cd[_0xeb6e('0x37')][_0xeb6e('0x39')]));_0x5ddcec[_0xeb6e('0x3a')]=_0x5ddcec[_0xeb6e('0x3a')]['length']?_0x5ddcec['attributes']:_0x393684['model'];if(_0x2865cd[_0xeb6e('0x37')][_0xeb6e('0xa8')]){_0x5ddcec[_0xeb6e('0xa9')]=[{'all':!![]}];}_0x5ddcec=_[_0xeb6e('0x91')]({},_0x5ddcec,_0x2865cd['options']);return db[_0xeb6e('0x33')][_0xeb6e('0x57')](_0x5ddcec)[_0xeb6e('0x22')](handleEntityNotFound(_0x4e839f,null))['then'](respondWithResult(_0x4e839f,null))['catch'](handleError(_0x4e839f,null));};exports[_0xeb6e('0xaa')]=function(_0x48bb30,_0x39522a){return db[_0xeb6e('0x33')][_0xeb6e('0xaa')](_0x48bb30[_0xeb6e('0x6c')],{})[_0xeb6e('0x22')](respondWithResult(_0x39522a,0xc9))[_0xeb6e('0x30')](handleError(_0x39522a,null));};exports[_0xeb6e('0x21')]=function(_0x471138,_0x403535){if(_0x471138[_0xeb6e('0x6c')]['id']){delete _0x471138['body']['id'];}return db[_0xeb6e('0x33')]['find']({'where':{'id':_0x471138['params']['id']}})['then'](handleEntityNotFound(_0x403535,null))[_0xeb6e('0x22')](saveUpdates(_0x471138[_0xeb6e('0x6c')],null))[_0xeb6e('0x22')](respondWithResult(_0x403535,null))['catch'](handleError(_0x403535,null));};exports['destroy']=function(_0x364755,_0x1c4e4e){return db[_0xeb6e('0x33')][_0xeb6e('0x57')]({'where':{'id':_0x364755['params']['id']}})[_0xeb6e('0x22')](handleEntityNotFound(_0x1c4e4e,null))['then'](removeEntity(_0x1c4e4e,null))[_0xeb6e('0x30')](handleError(_0x1c4e4e,null));};exports[_0xeb6e('0xab')]=function(_0x56067c,_0x5c61cd){return db['FaxInteraction'][_0xeb6e('0xab')]()['then'](respondWithResult(_0x5c61cd,null))['catch'](handleError(_0x5c61cd,null));};exports[_0xeb6e('0xac')]=function(_0x191e9f,_0x2852a5,_0x40c333){return db['FaxMessage'][_0xeb6e('0x57')]({'where':{'id':_0x191e9f[_0xeb6e('0xad')]['id']}})[_0xeb6e('0x22')](handleEntityNotFound(_0x2852a5,null))[_0xeb6e('0x22')](function(_0x4b497d){if(_0x4b497d){return _0x4b497d[_0xeb6e('0xac')](_0x191e9f['body'][_0xeb6e('0xae')],_[_0xeb6e('0xaf')](_0x191e9f[_0xeb6e('0x6c')],['ids','id'])||{});}})[_0xeb6e('0x22')](respondWithResult(_0x2852a5,null))[_0xeb6e('0x30')](handleError(_0x2852a5,null));};exports[_0xeb6e('0xb0')]=function(_0x2ed84,_0xb7dd58,_0x5d861a){var _0x4c7251={'raw':![],'where':{}};var _0x27c906={};var _0x4d2220={'count':0x0,'rows':[]};return db[_0xeb6e('0x33')][_0xeb6e('0xb1')]({'where':{'id':_0x2ed84[_0xeb6e('0xad')]['id']}})[_0xeb6e('0x22')](handleEntityNotFound(_0xb7dd58,null))[_0xeb6e('0x22')](function(_0x557ee7){if(_0x557ee7){_0x27c906[_0xeb6e('0x36')]=_[_0xeb6e('0x38')](db[_0xeb6e('0xb2')]['rawAttributes']);_0x27c906['query']=_[_0xeb6e('0x38')](_0x2ed84['query']);_0x27c906[_0xeb6e('0x40')]=_[_0xeb6e('0xa7')](_0x27c906[_0xeb6e('0x36')],_0x27c906[_0xeb6e('0x37')]);_0x4c7251[_0xeb6e('0x3a')]=_[_0xeb6e('0xa7')](_0x27c906['model'],qs[_0xeb6e('0x39')](_0x2ed84[_0xeb6e('0x37')]['fields']));_0x4c7251[_0xeb6e('0x3a')]=_0x4c7251[_0xeb6e('0x3a')]['length']?_0x4c7251['attributes']:_0x27c906[_0xeb6e('0x36')];if(!_0x2ed84['query'][_0xeb6e('0x3b')](_0xeb6e('0x3c'))){_0x4c7251[_0xeb6e('0x1c')]=qs[_0xeb6e('0x1c')](_0x2ed84[_0xeb6e('0x37')][_0xeb6e('0x1c')]);_0x4c7251[_0xeb6e('0x1a')]=qs[_0xeb6e('0x1a')](_0x2ed84['query'][_0xeb6e('0x1a')]);}_0x4c7251[_0xeb6e('0x3d')]=qs['sort'](_0x2ed84['query']['sort']);_0x4c7251[_0xeb6e('0x3f')]=qs[_0xeb6e('0x40')](_[_0xeb6e('0xb3')](_0x2ed84['query'],_0x27c906[_0xeb6e('0x40')]));_0x4c7251[_0xeb6e('0x3f')][_0xeb6e('0xb4')]=_0x557ee7['id'];if(_0x2ed84['query'][_0xeb6e('0x7d')]){_0x4c7251[_0xeb6e('0x3f')]=_[_0xeb6e('0x91')](_0x4c7251[_0xeb6e('0x3f')],{'$or':_[_0xeb6e('0x32')](_0x4c7251[_0xeb6e('0x3a')],function(_0x162ed2){var _0x4357b8={};_0x4357b8[_0x162ed2]={'$like':'%'+_0x2ed84[_0xeb6e('0x37')]['filter']+'%'};return _0x4357b8;})});}if(_0x2ed84[_0xeb6e('0x37')][_0xeb6e('0xb5')]){var _0x4e3f02=_0x2ed84['query'][_0xeb6e('0xb5')][_0xeb6e('0x2d')](',');var _0x3fc114={};_0x3fc114[_0x4e3f02[0x0]]={'$gte':moment(_0x4e3f02[0x1])[_0xeb6e('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4c7251[_0xeb6e('0x3f')]=_['merge'](_0x4c7251['where'],_0x3fc114);}_0x4c7251=_[_0xeb6e('0x91')]({},_0x4c7251,_0x2ed84[_0xeb6e('0xb7')]);return db[_0xeb6e('0xb2')][_0xeb6e('0x1d')]({'where':_0x4c7251[_0xeb6e('0x3f')]})[_0xeb6e('0x22')](function(_0x397705){_0x4d2220[_0xeb6e('0x1d')]=_0x397705;if(_0x2ed84[_0xeb6e('0x37')]['includeAll']){_0x4c7251[_0xeb6e('0xa9')]=[{'all':!![]}];}return db[_0xeb6e('0xb2')][_0xeb6e('0xb8')](_0x4c7251);})[_0xeb6e('0x22')](function(_0x3ac5e9){_0x4d2220[_0xeb6e('0xa5')]=_0x3ac5e9;return _0x4d2220;});}})[_0xeb6e('0x22')](respondWithFilteredResult(_0xb7dd58,_0x4c7251))[_0xeb6e('0x30')](handleError(_0xb7dd58,null));};exports[_0xeb6e('0xb9')]=function(_0x252e8f,_0x2f5801,_0x3c8b39){return db[_0xeb6e('0x33')][_0xeb6e('0x57')]({'where':{'id':_0x252e8f['params']['id']}})[_0xeb6e('0x22')](handleEntityNotFound(_0x2f5801,null))[_0xeb6e('0x22')](function(_0x1d8f4f){if(_0x1d8f4f){return _0x1d8f4f[_0xeb6e('0xba')](_0x252e8f['body'][_0xeb6e('0xae')],_['omit'](_0x252e8f[_0xeb6e('0x6c')],[_0xeb6e('0xae'),'id'])||{})[_0xeb6e('0xbb')](function(){return db['Tag'][_0xeb6e('0xb8')]({'attributes':['id','name',_0xeb6e('0xbc')],'where':{'id':_0x252e8f[_0xeb6e('0x6c')][_0xeb6e('0xae')]}});})['then'](function(_0x47e74b){socket[_0xeb6e('0xbd')](_0xeb6e('0xbe'),{'id':Number(_0x252e8f[_0xeb6e('0xad')]['id']),'tags':_0x47e74b||[]});return{'id':Number(_0x252e8f[_0xeb6e('0xad')]['id']),'tags':_0x47e74b||[]};});}})['then'](respondWithResult(_0x2f5801,null))[_0xeb6e('0x30')](handleError(_0x2f5801,null));};exports[_0xeb6e('0xbf')]=function(_0x3a4bfe,_0x43dd13,_0x33fdc0){return db[_0xeb6e('0x33')][_0xeb6e('0x57')]({'where':{'id':_0x3a4bfe[_0xeb6e('0xad')]['id']}})[_0xeb6e('0x22')](handleEntityNotFound(_0x43dd13,null))[_0xeb6e('0x22')](function(_0x301a7b){if(_0x301a7b){return _0x301a7b[_0xeb6e('0xbf')](_0x3a4bfe[_0xeb6e('0x37')][_0xeb6e('0xae')]);}})[_0xeb6e('0x22')](respondWithStatusCode(_0x43dd13,null))[_0xeb6e('0x30')](handleError(_0x43dd13,null));};exports[_0xeb6e('0xc0')]=function(_0x4d5acd,_0x1315de){var _0x5a650a=moment()[_0xeb6e('0xc1')]()[_0xeb6e('0x8f')]();var _0x5f1ef2=path[_0xeb6e('0xc2')](config[_0xeb6e('0xc3')],'server',_0xeb6e('0xc4'),_0xeb6e('0xc5'));var _0x57342d=path[_0xeb6e('0xc2')](config[_0xeb6e('0xc3')],_0xeb6e('0xc6'),'files',_0xeb6e('0xc7'));var _0x45b8e3=path[_0xeb6e('0xc2')](_0x5f1ef2,_0x5a650a);var _0x1217ac=util[_0xeb6e('0xb6')](_0xeb6e('0xc8'),_0x4d5acd[_0xeb6e('0xad')]['id'],_0x5a650a);var _0x8dad6e=path[_0xeb6e('0xc2')](_0x5f1ef2,_0x1217ac);var _0x442f74=[];_0x442f74['push']({'model':db[_0xeb6e('0xc9')],'as':_0xeb6e('0xc9'),'raw':!![]});var _0x513bd0=[{'model':db[_0xeb6e('0xb2')],'as':_0xeb6e('0xca'),'attributes':['id',_0xeb6e('0x6c'),'createdAt'],'include':_0x442f74}];return db[_0xeb6e('0x33')][_0xeb6e('0x57')]({'where':{'id':_0x4d5acd['params']['id']},'include':_0x513bd0})[_0xeb6e('0x22')](handleEntityNotFound(_0x1315de,null))['then'](function(_0xa38440){if(_0xa38440&&_0xa38440[_0xeb6e('0xca')]){var _0x706d39=_0xa38440[_0xeb6e('0xcb')]({'plain':!![]});fs[_0xeb6e('0xcc')](_0x45b8e3);for(var _0x4c1642=0x0;_0x4c1642<_0x706d39[_0xeb6e('0xca')][_0xeb6e('0x60')];_0x4c1642++){var _0x5f30e1=_0x706d39[_0xeb6e('0xca')][_0x4c1642]['Attachment'];if(_0x5f30e1){var _0x32cc67=path[_0xeb6e('0xc2')](_0x57342d,_0x5f30e1[_0xeb6e('0xcd')]);if(fs[_0xeb6e('0xce')](_0x32cc67)){fs['createReadStream'](_0x32cc67)[_0xeb6e('0xcf')](fs[_0xeb6e('0xd0')](path[_0xeb6e('0xc2')](_0x45b8e3,_0x5f30e1[_0xeb6e('0xcd')])));}}}return BPromise[_0xeb6e('0x88')]()[_0xeb6e('0x22')](function(){return new BPromise(function(_0x55cd15,_0x36f0f2){zipdir(_0x45b8e3,{'saveTo':_0x8dad6e},function(_0xc97d0e,_0xcc4289){if(_0xc97d0e)return _0x36f0f2(_0xc97d0e);return _0x55cd15(_0xcc4289);});})[_0xeb6e('0x22')](function(){return new BPromise(function(_0x31300c,_0x59a2e9){rimraf(_0x45b8e3,function(_0x4b6aba){if(_0x4b6aba)_0x59a2e9(_0x4b6aba);return _0x31300c();});});})[_0xeb6e('0x22')](function(){return _0x1315de['download'](_0x8dad6e,_0x1217ac,function(_0x4b1542){if(_0x4b1542){console[_0xeb6e('0xd1')](_0xeb6e('0xd2'),_0x4b1542);}else{fs[_0xeb6e('0xd3')](_0x8dad6e);}});});});}else{return _0x1315de[_0xeb6e('0x17')](0xc8);}})[_0xeb6e('0x30')](handleError(_0x1315de,null));};
\ No newline at end of file
index eadc21a..a7a7e04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ec4=['length','emit','hook','exports','events','../../mysqldb','setMaxListeners','update','remove','getUsers','setDataValue','Users','findAll','then','unreadMessages'];(function(_0x2a0c21,_0x51ad5e){var _0x28f2ff=function(_0x47739f){while(--_0x47739f){_0x2a0c21['push'](_0x2a0c21['shift']());}};_0x28f2ff(++_0x51ad5e);}(_0x4ec4,0xe5));var _0x44ec=function(_0x3e096b,_0x355ed4){_0x3e096b=_0x3e096b-0x0;var _0x371781=_0x4ec4[_0x3e096b];return _0x371781;};'use strict';var EventEmitter=require(_0x44ec('0x0'));var FaxInteraction=require(_0x44ec('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x44ec('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x44ec('0x3'),'afterDestroy':_0x44ec('0x4')};function emitEvent(_0x3fdb70){return function(_0x52347f,_0x2ca94a,_0x2bdc7b){_0x52347f[_0x44ec('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e4cf8){_0x52347f[_0x44ec('0x6')](_0x44ec('0x7'),_0x3e4cf8['map'](function(_0x5bd2df){return{'id':_0x5bd2df['id']};}));return FaxMessage[_0x44ec('0x8')]({'where':{'FaxInteractionId':_0x52347f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x44ec('0x9')](function(_0x307b53){_0x52347f[_0x44ec('0x6')](_0x44ec('0xa'),_0x307b53[_0x44ec('0xb')]);FaxInteractionEvents[_0x44ec('0xc')](_0x3fdb70+':'+_0x52347f['id'],_0x52347f);FaxInteractionEvents[_0x44ec('0xc')](_0x3fdb70,_0x52347f);_0x2bdc7b(null);})['catch'](_0x2bdc7b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x44ec('0xd')](e,emitEvent(event));}}module[_0x44ec('0xe')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x5d95=['FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','catch','hasOwnProperty','hook','events','FaxInteraction','../../mysqldb'];(function(_0x306646,_0xdc2e1b){var _0x40bd8d=function(_0x397d05){while(--_0x397d05){_0x306646['push'](_0x306646['shift']());}};_0x40bd8d(++_0xdc2e1b);}(_0x5d95,0x11a));var _0x55d9=function(_0x41f67a,_0x388159){_0x41f67a=_0x41f67a-0x0;var _0x396df8=_0x5d95[_0x41f67a];return _0x396df8;};'use strict';var EventEmitter=require(_0x55d9('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x55d9('0x1')];var FaxMessage=require(_0x55d9('0x2'))['db'][_0x55d9('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x55d9('0x4')](0x0);var events={'afterCreate':_0x55d9('0x5'),'afterUpdate':_0x55d9('0x6'),'afterDestroy':_0x55d9('0x7')};function emitEvent(_0x32bde6){return function(_0x22360c,_0x48c27e,_0x532d4f){_0x22360c[_0x55d9('0x8')]({'attributes':['id'],'raw':!![]})[_0x55d9('0x9')](function(_0x24dde1){_0x22360c[_0x55d9('0xa')](_0x55d9('0xb'),_0x24dde1[_0x55d9('0xc')](function(_0x2e62ea){return{'id':_0x2e62ea['id']};}));return FaxMessage[_0x55d9('0xd')]({'where':{'FaxInteractionId':_0x22360c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x55d9('0x9')](function(_0x1cf0f3){_0x22360c[_0x55d9('0xa')](_0x55d9('0xe'),_0x1cf0f3[_0x55d9('0xf')]);FaxInteractionEvents['emit'](_0x32bde6+':'+_0x22360c['id'],_0x22360c);FaxInteractionEvents['emit'](_0x32bde6,_0x22360c);_0x532d4f(null);})[_0x55d9('0x10')](_0x532d4f(null));};}for(var e in events){if(events[_0x55d9('0x11')](e)){var event=events[e];FaxInteraction[_0x55d9('0x12')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
index 330b5ea..28badeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d94=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x8d94,0x6f));var _0x48d9=function(_0x170a4f,_0x3fb5c7){_0x170a4f=_0x170a4f-0x0;var _0x1e2dca=_0x8d94[_0x170a4f];return _0x1e2dca;};'use strict';var _=require(_0x48d9('0x0'));var util=require(_0x48d9('0x1'));var logger=require('../../config/logger')(_0x48d9('0x2'));var moment=require('moment');var BPromise=require(_0x48d9('0x3'));var rp=require(_0x48d9('0x4'));var fs=require('fs');var path=require(_0x48d9('0x5'));var rimraf=require(_0x48d9('0x6'));var config=require(_0x48d9('0x7'));var attributes=require(_0x48d9('0x8'));module['exports']=function(_0x33ba83,_0x1475f7){return _0x33ba83[_0x48d9('0x9')](_0x48d9('0xa'),attributes,{'tableName':_0x48d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x592fc0,_0x3a697d,_0x9add5b){if(_0x592fc0[_0x48d9('0xc')]('closed')){_0x592fc0[_0x48d9('0xd')]=moment()[_0x48d9('0xe')](_0x48d9('0xf'));}_0x9add5b(null,_0x592fc0);}}});};
\ No newline at end of file
+var _0x4f31=['fax_interactions','closed','closedAt','format','lodash','util','api','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x4f31,0x13f));var _0x14f3=function(_0x813383,_0x1814ac){_0x813383=_0x813383-0x0;var _0x59d3c0=_0x4f31[_0x813383];return _0x59d3c0;};'use strict';var _=require(_0x14f3('0x0'));var util=require(_0x14f3('0x1'));var logger=require('../../config/logger')(_0x14f3('0x2'));var moment=require('moment');var BPromise=require(_0x14f3('0x3'));var rp=require(_0x14f3('0x4'));var fs=require('fs');var path=require(_0x14f3('0x5'));var rimraf=require(_0x14f3('0x6'));var config=require('../../config/environment');var attributes=require(_0x14f3('0x7'));module[_0x14f3('0x8')]=function(_0x59509f,_0x4ad398){return _0x59509f[_0x14f3('0x9')](_0x14f3('0xa'),attributes,{'tableName':_0x14f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x314584,_0x541973,_0x4b8e4a){if(_0x314584['changed'](_0x14f3('0xc'))){_0x314584[_0x14f3('0xd')]=moment()[_0x14f3('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4b8e4a(null,_0x314584);}}});};
\ No newline at end of file
index 22c20f2..5e85e33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8167=['spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','limit','then','find','body','ids','omit'];(function(_0xca06e,_0x25a203){var _0x32bb7e=function(_0x9362f6){while(--_0x9362f6){_0xca06e['push'](_0xca06e['shift']());}};_0x32bb7e(++_0x25a203);}(_0x8167,0xf2));var _0x7816=function(_0x35ad88,_0x4a6898){_0x35ad88=_0x35ad88-0x0;var _0xb60d18=_0x8167[_0x35ad88];return _0xb60d18;};'use strict';var _=require(_0x7816('0x0'));var util=require(_0x7816('0x1'));var moment=require(_0x7816('0x2'));var BPromise=require(_0x7816('0x3'));var rs=require(_0x7816('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7816('0x5'))['db'];var utils=require(_0x7816('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7816('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7816('0x8')]({'port':0x232a});config[_0x7816('0x9')]=_[_0x7816('0xa')](config[_0x7816('0x9')],{'host':_0x7816('0xb'),'port':0x18eb});var socket=require(_0x7816('0xc'))(new Redis(config['redis']));require(_0x7816('0xd'))[_0x7816('0xe')](socket);function respondWithRpcPromise(_0x11b9a2,_0x31705e,_0x3a3cb4){return new BPromise(function(_0x1fbef3,_0x2f0512){return client[_0x7816('0xf')](_0x11b9a2,_0x3a3cb4)['then'](function(_0xcfe6e0){logger['info'](_0x7816('0x10'),_0x31705e,_0x7816('0x11'));logger[_0x7816('0x12')](_0x7816('0x13'),_0x31705e,_0x7816('0x11'),JSON[_0x7816('0x14')](_0xcfe6e0));if(_0xcfe6e0['error']){if(_0xcfe6e0[_0x7816('0x15')]['code']===0x1f4){logger[_0x7816('0x15')](_0x7816('0x10'),_0x31705e,_0xcfe6e0[_0x7816('0x15')][_0x7816('0x16')]);return _0x2f0512(_0xcfe6e0[_0x7816('0x15')][_0x7816('0x16')]);}logger[_0x7816('0x15')](_0x7816('0x10'),_0x31705e,_0xcfe6e0[_0x7816('0x15')][_0x7816('0x16')]);return _0x1fbef3(_0xcfe6e0[_0x7816('0x15')][_0x7816('0x16')]);}else{logger[_0x7816('0x17')](_0x7816('0x10'),_0x31705e,_0x7816('0x11'));_0x1fbef3(_0xcfe6e0[_0x7816('0x18')][_0x7816('0x16')]);}})[_0x7816('0x19')](function(_0x162f30){logger[_0x7816('0x15')](_0x7816('0x10'),_0x31705e,_0x162f30);_0x2f0512(_0x162f30);});});}exports[_0x7816('0x1a')]=function(_0x32dc09){var _0x2d6e84=this;return new Promise(function(_0x27a123,_0x9e5ee5){return db[_0x7816('0x1b')][_0x7816('0x1c')](_0x32dc09['body'],{'raw':_0x32dc09[_0x7816('0x1d')]?_0x32dc09['options'][_0x7816('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32dc09[_0x7816('0x1d')]?_0x32dc09[_0x7816('0x1d')][_0x7816('0x1f')]||null:null,'attributes':_0x32dc09[_0x7816('0x1d')]?_0x32dc09[_0x7816('0x1d')]['attributes']||null:null,'limit':_0x32dc09[_0x7816('0x1d')]?_0x32dc09[_0x7816('0x1d')][_0x7816('0x20')]||null:null})[_0x7816('0x21')](function(_0x1ad961){logger[_0x7816('0x17')](_0x7816('0x1a'),_0x32dc09);logger[_0x7816('0x12')](_0x7816('0x1a'),_0x32dc09,JSON[_0x7816('0x14')](_0x1ad961));_0x27a123(_0x1ad961);})[_0x7816('0x19')](function(_0x526bc1){logger[_0x7816('0x15')](_0x7816('0x1a'),_0x526bc1['message'],_0x32dc09);_0x9e5ee5(_0x2d6e84[_0x7816('0x15')](0x1f4,_0x526bc1[_0x7816('0x16')]));});});};exports['AddTagsToFaxInteraction']=function(_0x4d7da9){return new Promise(function(_0x48ef15,_0x4be584){return db[_0x7816('0x1b')][_0x7816('0x22')]({'where':_0x4d7da9[_0x7816('0x1d')]?_0x4d7da9[_0x7816('0x1d')][_0x7816('0x1f')]||null:null})['then'](function(_0x2ce30c){if(_0x2ce30c){return _0x2ce30c['addTags'](_0x4d7da9[_0x7816('0x23')][_0x7816('0x24')],_[_0x7816('0x25')](_0x4d7da9[_0x7816('0x23')],[_0x7816('0x24'),'id'])||{});}})[_0x7816('0x26')](function(_0x4f579d){logger['info'](_0x7816('0x27'),_0x4d7da9);logger[_0x7816('0x12')](_0x7816('0x27'),_0x4d7da9,JSON[_0x7816('0x14')](_0x4f579d));_0x48ef15(_0x4f579d);})[_0x7816('0x19')](function(_0x1b8477){logger['error'](_0x7816('0x27'),_0x1b8477[_0x7816('0x16')],_0x4d7da9);_0x4be584(_this['error'](0x1f4,_0x1b8477[_0x7816('0x16')]));});});};
\ No newline at end of file
+var _0x95c8=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','register','then','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxInteraction,\x20%s,\x20%s','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','info','AddTagsToFaxInteraction','find','ids','omit','spread','catch','lodash','util'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x95c8,0x116));var _0x895c=function(_0x1631c8,_0x40a83d){_0x1631c8=_0x1631c8-0x0;var _0x298ccb=_0x95c8[_0x1631c8];return _0x298ccb;};'use strict';var _=require(_0x895c('0x0'));var util=require(_0x895c('0x1'));var moment=require('moment');var BPromise=require(_0x895c('0x2'));var rs=require(_0x895c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x895c('0x4'))['db'];var utils=require(_0x895c('0x5'));var logger=require(_0x895c('0x6'))(_0x895c('0x7'));var config=require('../../config/environment');var jayson=require(_0x895c('0x8'));var client=jayson[_0x895c('0x9')][_0x895c('0xa')]({'port':0x232a});config['redis']=_[_0x895c('0xb')](config[_0x895c('0xc')],{'host':_0x895c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x895c('0xc')]));require('./faxInteraction.socket')[_0x895c('0xe')](socket);function respondWithRpcPromise(_0x16b03d,_0x35b51b,_0x47c92f){return new BPromise(function(_0x51c797,_0x2fd2bc){return client['request'](_0x16b03d,_0x47c92f)[_0x895c('0xf')](function(_0x2fa7ae){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x35b51b,'request\x20sent');logger[_0x895c('0x10')](_0x895c('0x11'),_0x35b51b,_0x895c('0x12'),JSON[_0x895c('0x13')](_0x2fa7ae));if(_0x2fa7ae['error']){if(_0x2fa7ae[_0x895c('0x14')][_0x895c('0x15')]===0x1f4){logger[_0x895c('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x35b51b,_0x2fa7ae[_0x895c('0x14')][_0x895c('0x16')]);return _0x2fd2bc(_0x2fa7ae['error'][_0x895c('0x16')]);}logger['error'](_0x895c('0x17'),_0x35b51b,_0x2fa7ae['error'][_0x895c('0x16')]);return _0x51c797(_0x2fa7ae['error']['message']);}else{logger['info'](_0x895c('0x17'),_0x35b51b,_0x895c('0x12'));_0x51c797(_0x2fa7ae['result'][_0x895c('0x16')]);}})['catch'](function(_0xde738f){logger[_0x895c('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x35b51b,_0xde738f);_0x2fd2bc(_0xde738f);});});}exports[_0x895c('0x18')]=function(_0xf4cf69){var _0x21b75a=this;return new Promise(function(_0x31f7cf,_0x9d2d2f){return db[_0x895c('0x19')][_0x895c('0x1a')](_0xf4cf69[_0x895c('0x1b')],{'raw':_0xf4cf69[_0x895c('0x1c')]?_0xf4cf69[_0x895c('0x1c')][_0x895c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf4cf69[_0x895c('0x1c')]?_0xf4cf69['options'][_0x895c('0x1e')]||null:null,'attributes':_0xf4cf69['options']?_0xf4cf69['options'][_0x895c('0x1f')]||null:null,'limit':_0xf4cf69[_0x895c('0x1c')]?_0xf4cf69['options'][_0x895c('0x20')]||null:null})[_0x895c('0xf')](function(_0x46ca9a){logger[_0x895c('0x21')]('UpdateFaxInteraction',_0xf4cf69);logger['debug'](_0x895c('0x18'),_0xf4cf69,JSON[_0x895c('0x13')](_0x46ca9a));_0x31f7cf(_0x46ca9a);})['catch'](function(_0x14865e){logger['error'](_0x895c('0x18'),_0x14865e[_0x895c('0x16')],_0xf4cf69);_0x9d2d2f(_0x21b75a[_0x895c('0x14')](0x1f4,_0x14865e[_0x895c('0x16')]));});});};exports[_0x895c('0x22')]=function(_0x634b67){return new Promise(function(_0x31280c,_0x403946){return db[_0x895c('0x19')][_0x895c('0x23')]({'where':_0x634b67[_0x895c('0x1c')]?_0x634b67[_0x895c('0x1c')][_0x895c('0x1e')]||null:null})[_0x895c('0xf')](function(_0x43b4ee){if(_0x43b4ee){return _0x43b4ee['addTags'](_0x634b67['body'][_0x895c('0x24')],_[_0x895c('0x25')](_0x634b67[_0x895c('0x1b')],[_0x895c('0x24'),'id'])||{});}})[_0x895c('0x26')](function(_0x28da25){logger['info']('AddTags',_0x634b67);logger[_0x895c('0x10')]('AddTags',_0x634b67,JSON[_0x895c('0x13')](_0x28da25));_0x31280c(_0x28da25);})[_0x895c('0x27')](function(_0x157ead){logger['error']('AddTags',_0x157ead[_0x895c('0x16')],_0x634b67);_0x403946(_this['error'](0x1f4,_0x157ead[_0x895c('0x16')]));});});};
\ No newline at end of file
index 2e558ea..40e208a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0234=['emit','removeListener','length','./faxInteraction.events','save','remove','update'];(function(_0x4fe328,_0x5e456d){var _0x11a53b=function(_0x42f8cb){while(--_0x42f8cb){_0x4fe328['push'](_0x4fe328['shift']());}};_0x11a53b(++_0x5e456d);}(_0x0234,0xe3));var _0x4023=function(_0xc3745e,_0x5bb692){_0xc3745e=_0xc3745e-0x0;var _0x1c1b31=_0x0234[_0xc3745e];return _0x1c1b31;};'use strict';var FaxInteractionEvents=require(_0x4023('0x0'));var events=[_0x4023('0x1'),_0x4023('0x2'),_0x4023('0x3')];function createListener(_0xe85541,_0x2d9180){return function(_0x42bf42){_0x2d9180[_0x4023('0x4')](_0xe85541,_0x42bf42);};}function removeListener(_0x27e1ee,_0x89e755){return function(){FaxInteractionEvents[_0x4023('0x5')](_0x27e1ee,_0x89e755);};}exports['register']=function(_0x1489c7){for(var _0x3c18f8=0x0,_0x251828=events[_0x4023('0x6')];_0x3c18f8<_0x251828;_0x3c18f8++){var _0x19395a=events[_0x3c18f8];var _0x4c3208=createListener('faxInteraction:'+_0x19395a,_0x1489c7);FaxInteractionEvents['on'](_0x19395a,_0x4c3208);}};
\ No newline at end of file
+var _0xf2f2=['emit','removeListener','register','length','./faxInteraction.events','save','remove'];(function(_0x4d064d,_0x2cef50){var _0x4d520e=function(_0x217815){while(--_0x217815){_0x4d064d['push'](_0x4d064d['shift']());}};_0x4d520e(++_0x2cef50);}(_0xf2f2,0xac));var _0x2f2f=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0xf2f2[_0x58175c];return _0x55b88f;};'use strict';var FaxInteractionEvents=require(_0x2f2f('0x0'));var events=[_0x2f2f('0x1'),_0x2f2f('0x2'),'update'];function createListener(_0x5b506b,_0xb195a7){return function(_0xed8d30){_0xb195a7[_0x2f2f('0x3')](_0x5b506b,_0xed8d30);};}function removeListener(_0xb75a99,_0x5b2c18){return function(){FaxInteractionEvents[_0x2f2f('0x4')](_0xb75a99,_0x5b2c18);};}exports[_0x2f2f('0x5')]=function(_0x1bdd9d){for(var _0x40dafd=0x0,_0x4de781=events[_0x2f2f('0x6')];_0x40dafd<_0x4de781;_0x40dafd++){var _0x1e7083=events[_0x40dafd];var _0x2b4d7e=createListener('faxInteraction:'+_0x1e7083,_0x1bdd9d);FaxInteractionEvents['on'](_0x1e7083,_0x2b4d7e);}};
\ No newline at end of file
index c37d170..d95b68b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0e1=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','post','create','/:id/tags','tracked','fax','addTags','put','delete','faxinteraction:destroy','destroy','removeTags','exports','util'];(function(_0x43a3d0,_0x173b5c){var _0x16cd76=function(_0x49fc59){while(--_0x49fc59){_0x43a3d0['push'](_0x43a3d0['shift']());}};_0x16cd76(++_0x173b5c);}(_0xb0e1,0xfb));var _0x1b0e=function(_0x542a84,_0x21c9e8){_0x542a84=_0x542a84-0x0;var _0x1ad4a9=_0xb0e1[_0x542a84];return _0x1ad4a9;};'use strict';var multer=require('multer');var util=require(_0x1b0e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1b0e('0x1'));var router=express[_0x1b0e('0x2')]();var fs_extra=require(_0x1b0e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1b0e('0x4'));var config=require(_0x1b0e('0x5'));var controller=require(_0x1b0e('0x6'));router[_0x1b0e('0x7')]('/',auth[_0x1b0e('0x8')](),controller[_0x1b0e('0x9')]);router[_0x1b0e('0x7')](_0x1b0e('0xa'),auth['isAuthenticated'](),controller[_0x1b0e('0xb')]);router['get'](_0x1b0e('0xc'),auth['isAuthenticated'](),controller[_0x1b0e('0xd')]);router['get'](_0x1b0e('0xe'),auth[_0x1b0e('0x8')](),controller[_0x1b0e('0xf')]);router[_0x1b0e('0x7')]('/:id/download',auth[_0x1b0e('0x8')](),controller['download']);router[_0x1b0e('0x10')]('/',auth['isAuthenticated'](),controller[_0x1b0e('0x11')]);router['post'](_0x1b0e('0xe'),auth[_0x1b0e('0x8')](),controller['addMessage']);router[_0x1b0e('0x10')](_0x1b0e('0x12'),auth[_0x1b0e('0x8')](),interaction[_0x1b0e('0x13')](_0x1b0e('0x14'),'faxinteraction:addtags'),controller[_0x1b0e('0x15')]);router[_0x1b0e('0x16')](_0x1b0e('0xc'),auth[_0x1b0e('0x8')](),interaction[_0x1b0e('0x13')](_0x1b0e('0x14'),'faxinteraction:update'),controller['update']);router[_0x1b0e('0x17')](_0x1b0e('0xc'),auth[_0x1b0e('0x8')](),interaction[_0x1b0e('0x13')](_0x1b0e('0x14'),_0x1b0e('0x18')),controller[_0x1b0e('0x19')]);router[_0x1b0e('0x17')]('/:id/tags',auth[_0x1b0e('0x8')](),controller[_0x1b0e('0x1a')]);module[_0x1b0e('0x1b')]=router;
\ No newline at end of file
+var _0xc125=['path','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','/describe','describe','/:id','show','get','/:id/messages','post','create','addMessage','tracked','fax','addTags','faxinteraction:update','update','delete','destroy','/:id/tags','removeTags','exports'];(function(_0x4f4814,_0x44959d){var _0x179592=function(_0x33f18c){while(--_0x33f18c){_0x4f4814['push'](_0x4f4814['shift']());}};_0x179592(++_0x44959d);}(_0xc125,0x6c));var _0x5c12=function(_0x5b4292,_0x133815){_0x5b4292=_0x5b4292-0x0;var _0x3fe677=_0xc125[_0x5b4292];return _0x3fe677;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c12('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5c12('0x1')]();var fs_extra=require(_0x5c12('0x2'));var auth=require(_0x5c12('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5c12('0x4'));var controller=require(_0x5c12('0x5'));router['get']('/',auth[_0x5c12('0x6')](),controller[_0x5c12('0x7')]);router['get'](_0x5c12('0x8'),auth[_0x5c12('0x6')](),controller[_0x5c12('0x9')]);router['get'](_0x5c12('0xa'),auth['isAuthenticated'](),controller[_0x5c12('0xb')]);router[_0x5c12('0xc')](_0x5c12('0xd'),auth[_0x5c12('0x6')](),controller['getMessages']);router[_0x5c12('0xc')]('/:id/download',auth[_0x5c12('0x6')](),controller['download']);router[_0x5c12('0xe')]('/',auth[_0x5c12('0x6')](),controller[_0x5c12('0xf')]);router[_0x5c12('0xe')](_0x5c12('0xd'),auth[_0x5c12('0x6')](),controller[_0x5c12('0x10')]);router[_0x5c12('0xe')]('/:id/tags',auth[_0x5c12('0x6')](),interaction[_0x5c12('0x11')](_0x5c12('0x12'),'faxinteraction:addtags'),controller[_0x5c12('0x13')]);router['put'](_0x5c12('0xa'),auth['isAuthenticated'](),interaction[_0x5c12('0x11')](_0x5c12('0x12'),_0x5c12('0x14')),controller[_0x5c12('0x15')]);router[_0x5c12('0x16')]('/:id',auth[_0x5c12('0x6')](),interaction[_0x5c12('0x11')](_0x5c12('0x12'),'faxinteraction:destroy'),controller[_0x5c12('0x17')]);router[_0x5c12('0x16')](_0x5c12('0x18'),auth['isAuthenticated'](),controller[_0x5c12('0x19')]);module[_0x5c12('0x1a')]=router;
\ No newline at end of file
index 053cb89..4a601a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e9f=['BOOLEAN','out','sequelize','exports'];(function(_0x19e70f,_0x1bd9fa){var _0x56a5a1=function(_0xa35433){while(--_0xa35433){_0x19e70f['push'](_0x19e70f['shift']());}};_0x56a5a1(++_0x1bd9fa);}(_0x0e9f,0x116));var _0xf0e9=function(_0xcf1bfd,_0xb0aa6f){_0xcf1bfd=_0xcf1bfd-0x0;var _0xf76be4=_0x0e9f[_0xcf1bfd];return _0xf76be4;};'use strict';var Sequelize=require(_0xf0e9('0x0'));module[_0xf0e9('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf0e9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xf0e9('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x1af3=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x265e81,_0x514eff){var _0x55b6b7=function(_0x2e3207){while(--_0x2e3207){_0x265e81['push'](_0x265e81['shift']());}};_0x55b6b7(++_0x514eff);}(_0x1af3,0x1ca));var _0x31af=function(_0x40015a,_0x415db5){_0x40015a=_0x40015a-0x0;var _0x42f8a4=_0x1af3[_0x40015a];return _0x42f8a4;};'use strict';var Sequelize=require(_0x31af('0x0'));module[_0x31af('0x1')]={'body':{'type':Sequelize[_0x31af('0x2')](_0x31af('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x31af('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x31af('0x5')]('in',_0x31af('0x6')),'defaultValue':_0x31af('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x31af('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x31af('0x7')]}};
\ No newline at end of file
index 733f9e9..7764754 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dbe=['params','keys','includeAll','include','find','update','body','describe','../../config/logger','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','contact','User','email','internal','interface','SIP/%s','channel','event','EventManager','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','fullname','motionChannel','create','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','attachments','Attachment','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','save','stack','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','rows','show'];(function(_0xd62244,_0x5b9257){var _0x1c8fbd=function(_0x4ee328){while(--_0x4ee328){_0xd62244['push'](_0xd62244['shift']());}};_0x1c8fbd(++_0x5b9257);}(_0x9dbe,0x1f0));var _0xe9db=function(_0x2785ac,_0x473f24){_0x2785ac=_0x2785ac-0x0;var _0x39fee7=_0x9dbe[_0x2785ac];return _0x39fee7;};'use strict';var emlformat=require(_0xe9db('0x0'));var rimraf=require(_0xe9db('0x1'));var zipdir=require(_0xe9db('0x2'));var jsonpatch=require(_0xe9db('0x3'));var rp=require(_0xe9db('0x4'));var moment=require(_0xe9db('0x5'));var BPromise=require(_0xe9db('0x6'));var Mustache=require(_0xe9db('0x7'));var util=require(_0xe9db('0x8'));var path=require('path');var sox=require(_0xe9db('0x9'));var csv=require(_0xe9db('0xa'));var ejs=require(_0xe9db('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9db('0xc'));var squel=require('squel');var crypto=require(_0xe9db('0xd'));var jsforce=require(_0xe9db('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe9db('0xa'));var querystring=require(_0xe9db('0xf'));var Papa=require(_0xe9db('0x10'));var Redis=require(_0xe9db('0x11'));var authService=require(_0xe9db('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe9db('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe9db('0x14'));var utils=require(_0xe9db('0x15'));var config=require(_0xe9db('0x16'));var licenseUtil=require(_0xe9db('0x17'));var db=require('../../mysqldb')['db'];config[_0xe9db('0x18')]=_[_0xe9db('0x19')](config[_0xe9db('0x18')],{'host':_0xe9db('0x1a'),'port':0x18eb});var socket=require(_0xe9db('0x1b'))(new Redis(config[_0xe9db('0x18')]));require(_0xe9db('0x1c'))['register'](socket);var jayson=require(_0xe9db('0x1d'));var client=jayson[_0xe9db('0x1e')][_0xe9db('0x1f')]({'port':0x232c});var client9002=jayson[_0xe9db('0x1e')][_0xe9db('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2e48db,_0x6f8aaa,_0x4ca9cf,_0x295234){return new BPromise(function(_0x170742,_0x2fbccc){var _0x29fcc6=_0x295234||client;return _0x29fcc6['request'](_0x2e48db,_0x4ca9cf)[_0xe9db('0x20')](function(_0x10817e){logger['info'](_0xe9db('0x21'),_0x6f8aaa,_0xe9db('0x22'));logger[_0xe9db('0x23')](_0xe9db('0x24'),_0x6f8aaa,_0xe9db('0x22'),JSON[_0xe9db('0x25')](_0x10817e));if(_0x10817e['error']){if(_0x10817e[_0xe9db('0x26')][_0xe9db('0x27')]===0x1f4){logger['error'](_0xe9db('0x21'),_0x6f8aaa,_0x10817e[_0xe9db('0x26')]['message']);return _0x2fbccc(_0x10817e[_0xe9db('0x26')][_0xe9db('0x28')]);}logger['error'](_0xe9db('0x21'),_0x6f8aaa,_0x10817e[_0xe9db('0x26')][_0xe9db('0x28')]);return _0x170742(_0x10817e[_0xe9db('0x26')][_0xe9db('0x28')]);}else{logger[_0xe9db('0x29')](_0xe9db('0x21'),_0x6f8aaa,_0xe9db('0x22'));_0x170742(_0x10817e[_0xe9db('0x2a')][_0xe9db('0x28')]);}})[_0xe9db('0x2b')](function(_0x4abdc1){logger[_0xe9db('0x26')](_0xe9db('0x21'),_0x6f8aaa,_0x4abdc1);_0x2fbccc(_0x4abdc1);});});}function respondWithStatusCode(_0x38a04e,_0x528bc5){_0x528bc5=_0x528bc5||0xcc;return function(_0x140c11){if(_0x140c11){return _0x38a04e[_0xe9db('0x2c')](_0x528bc5);}return _0x38a04e[_0xe9db('0x2d')](_0x528bc5)[_0xe9db('0x2e')]();};}function respondWithResult(_0x178ea2,_0x2e346a){_0x2e346a=_0x2e346a||0xc8;return function(_0x598675){if(_0x598675){return _0x178ea2[_0xe9db('0x2d')](_0x2e346a)[_0xe9db('0x2f')](_0x598675);}};}function respondWithFilteredResult(_0x230c0b,_0x4259b5){return function(_0x2185e5){if(_0x2185e5){var _0x2631ab=typeof _0x4259b5['offset']===_0xe9db('0x30')&&typeof _0x4259b5[_0xe9db('0x31')]===_0xe9db('0x30');var _0x45cfa0=_0x2185e5['count'];var _0x5614c8=_0x2631ab?0x0:_0x4259b5['offset'];var _0x322286=_0x2631ab?_0x2185e5['count']:_0x4259b5[_0xe9db('0x32')]+_0x4259b5[_0xe9db('0x31')];var _0x1802e7;if(_0x322286>=_0x45cfa0){_0x322286=_0x45cfa0;_0x1802e7=0xc8;}else{_0x1802e7=0xce;}_0x230c0b[_0xe9db('0x2d')](_0x1802e7);return _0x230c0b[_0xe9db('0x33')](_0xe9db('0x34'),_0x5614c8+'-'+_0x322286+'/'+_0x45cfa0)['json'](_0x2185e5);}return null;};}function patchUpdates(_0x2be863){return function(_0x103b02){try{jsonpatch[_0xe9db('0x35')](_0x103b02,_0x2be863,!![]);}catch(_0x2cd306){return BPromise['reject'](_0x2cd306);}return _0x103b02[_0xe9db('0x36')]();};}function saveUpdates(_0x3b4267,_0xe8a3e5){return function(_0x2da2a9){if(_0x2da2a9){return _0x2da2a9['update'](_0x3b4267)[_0xe9db('0x20')](function(_0x4c0b2a){return _0x4c0b2a;});}return null;};}function removeEntity(_0x2a273c,_0x27c9d0){return function(_0x2175a8){if(_0x2175a8){return _0x2175a8['destroy']()['then'](function(){_0x2a273c[_0xe9db('0x2d')](0xcc)[_0xe9db('0x2e')]();});}};}function handleEntityNotFound(_0x2df147,_0x205b2a){return function(_0x4faff7){if(!_0x4faff7){_0x2df147['sendStatus'](0x194);}return _0x4faff7;};}function handleError(_0x3df6ff,_0x2b6f5c){_0x2b6f5c=_0x2b6f5c||0x1f4;return function(_0x171ce3){logger['error'](_0x171ce3[_0xe9db('0x37')]);if(_0x171ce3[_0xe9db('0x38')]){delete _0x171ce3[_0xe9db('0x38')];}_0x3df6ff[_0xe9db('0x2d')](_0x2b6f5c)[_0xe9db('0x39')](_0x171ce3);};}exports[_0xe9db('0x3a')]=function(_0x4ccf54,_0x43373c){var _0xcc40f6={},_0x583367={},_0x349366={'count':0x0,'rows':[]};var _0x45efb8=_['map'](db[_0xe9db('0x3b')][_0xe9db('0x3c')],function(_0x5c429c){return{'name':_0x5c429c[_0xe9db('0x3d')],'type':_0x5c429c[_0xe9db('0x3e')][_0xe9db('0x3f')]};});_0x583367[_0xe9db('0x40')]=_[_0xe9db('0x41')](_0x45efb8,'name');_0x583367['query']=_['keys'](_0x4ccf54[_0xe9db('0x42')]);_0x583367[_0xe9db('0x43')]=_[_0xe9db('0x44')](_0x583367['model'],_0x583367['query']);_0xcc40f6['attributes']=_['intersection'](_0x583367['model'],qs[_0xe9db('0x45')](_0x4ccf54[_0xe9db('0x42')][_0xe9db('0x45')]));_0xcc40f6[_0xe9db('0x46')]=_0xcc40f6[_0xe9db('0x46')][_0xe9db('0x47')]?_0xcc40f6[_0xe9db('0x46')]:_0x583367[_0xe9db('0x40')];if(!_0x4ccf54[_0xe9db('0x42')]['hasOwnProperty'](_0xe9db('0x48'))){_0xcc40f6[_0xe9db('0x31')]=qs[_0xe9db('0x31')](_0x4ccf54['query'][_0xe9db('0x31')]);_0xcc40f6[_0xe9db('0x32')]=qs[_0xe9db('0x32')](_0x4ccf54[_0xe9db('0x42')]['offset']);}_0xcc40f6[_0xe9db('0x49')]=qs[_0xe9db('0x4a')](_0x4ccf54['query']['sort']);_0xcc40f6[_0xe9db('0x4b')]=qs['filters'](_[_0xe9db('0x4c')](_0x4ccf54['query'],_0x583367['filters']),_0x45efb8);if(_0x4ccf54[_0xe9db('0x42')][_0xe9db('0x4d')]){_0xcc40f6[_0xe9db('0x4b')]=_[_0xe9db('0x4e')](_0xcc40f6[_0xe9db('0x4b')],{'$or':_['map'](_0x45efb8,function(_0x4031e2){if(_0x4031e2['type']!==_0xe9db('0x4f')){var _0x42e289={};_0x42e289[_0x4031e2[_0xe9db('0x38')]]={'$like':'%'+_0x4ccf54[_0xe9db('0x42')]['filter']+'%'};return _0x42e289;}})});}_0xcc40f6=_['merge']({},_0xcc40f6,_0x4ccf54[_0xe9db('0x50')]);var _0x4aaae2={'where':_0xcc40f6[_0xe9db('0x4b')]};return db['FaxMessage'][_0xe9db('0x51')](_0x4aaae2)[_0xe9db('0x20')](function(_0x23ed62){_0x349366[_0xe9db('0x51')]=_0x23ed62;if(_0x4ccf54['query']['includeAll']){_0xcc40f6['include']=[{'all':!![]}];}return db[_0xe9db('0x3b')]['findAll'](_0xcc40f6);})['then'](function(_0x13546c){_0x349366[_0xe9db('0x52')]=_0x13546c;return _0x349366;})[_0xe9db('0x20')](respondWithFilteredResult(_0x43373c,_0xcc40f6))[_0xe9db('0x2b')](handleError(_0x43373c,null));};exports[_0xe9db('0x53')]=function(_0x326a65,_0x163c59){var _0x24c945={'raw':!![],'where':{'id':_0x326a65[_0xe9db('0x54')]['id']}},_0x75002a={};_0x75002a[_0xe9db('0x40')]=_[_0xe9db('0x55')](db[_0xe9db('0x3b')][_0xe9db('0x3c')]);_0x75002a[_0xe9db('0x42')]=_[_0xe9db('0x55')](_0x326a65['query']);_0x75002a[_0xe9db('0x43')]=_[_0xe9db('0x44')](_0x75002a[_0xe9db('0x40')],_0x75002a[_0xe9db('0x42')]);_0x24c945['attributes']=_[_0xe9db('0x44')](_0x75002a[_0xe9db('0x40')],qs[_0xe9db('0x45')](_0x326a65[_0xe9db('0x42')]['fields']));_0x24c945['attributes']=_0x24c945['attributes'][_0xe9db('0x47')]?_0x24c945['attributes']:_0x75002a[_0xe9db('0x40')];if(_0x326a65['query'][_0xe9db('0x56')]){_0x24c945[_0xe9db('0x57')]=[{'all':!![]}];}_0x24c945=_[_0xe9db('0x4e')]({},_0x24c945,_0x326a65[_0xe9db('0x50')]);return db[_0xe9db('0x3b')][_0xe9db('0x58')](_0x24c945)['then'](handleEntityNotFound(_0x163c59,null))[_0xe9db('0x20')](respondWithResult(_0x163c59,null))[_0xe9db('0x2b')](handleError(_0x163c59,null));};exports[_0xe9db('0x59')]=function(_0x3288aa,_0x3b2e56){if(_0x3288aa[_0xe9db('0x5a')]['id']){delete _0x3288aa[_0xe9db('0x5a')]['id'];}return db[_0xe9db('0x3b')][_0xe9db('0x58')]({'where':{'id':_0x3288aa[_0xe9db('0x54')]['id']}})[_0xe9db('0x20')](handleEntityNotFound(_0x3b2e56,null))['then'](saveUpdates(_0x3288aa[_0xe9db('0x5a')],null))['then'](respondWithResult(_0x3b2e56,null))[_0xe9db('0x2b')](handleError(_0x3b2e56,null));};exports['destroy']=function(_0x64e31e,_0x52a3eb){return db[_0xe9db('0x3b')][_0xe9db('0x58')]({'where':{'id':_0x64e31e[_0xe9db('0x54')]['id']}})[_0xe9db('0x20')](handleEntityNotFound(_0x52a3eb,null))[_0xe9db('0x20')](removeEntity(_0x52a3eb,null))['catch'](handleError(_0x52a3eb,null));};exports[_0xe9db('0x5b')]=function(_0x507d25,_0x9e17ac){return db[_0xe9db('0x3b')]['describe']()[_0xe9db('0x20')](respondWithResult(_0x9e17ac,null))[_0xe9db('0x2b')](handleError(_0x9e17ac,null));};var interaction_log=require(_0xe9db('0x5c'))(_0xe9db('0x5d'));exports[_0xe9db('0x5e')]=function(_0x461fd1,_0x2277ac,_0x19e4f8){var _0x3ac667={'agent':{},'channel':_0xe9db('0x5f')};if(_0x461fd1[_0xe9db('0x5a')]['id']){delete _0x461fd1[_0xe9db('0x5a')]['id'];}_0x461fd1[_0xe9db('0x5a')]['read']=!![];_0x461fd1[_0xe9db('0x5a')][_0xe9db('0x60')]=moment()[_0xe9db('0x61')](_0xe9db('0x62'));_0x461fd1[_0xe9db('0x5a')]['UserId']=_0x461fd1[_0xe9db('0x5a')][_0xe9db('0x63')]||_0x461fd1['user']['id'];_0x3ac667[_0xe9db('0x64')]['id']=_0x461fd1[_0xe9db('0x5a')][_0xe9db('0x63')];return db[_0xe9db('0x3b')]['find']({'where':{'id':_0x461fd1['params']['id'],'UserId':null}})[_0xe9db('0x20')](handleEntityNotFound(_0x2277ac,null))[_0xe9db('0x20')](saveUpdates(_0x461fd1[_0xe9db('0x5a')],null))[_0xe9db('0x20')](function(_0x12e189){if(_0x12e189){_0x3ac667[_0xe9db('0x28')]=_0x12e189[_0xe9db('0x65')]({'plain':!![]});return db[_0xe9db('0x66')][_0xe9db('0x58')]({'where':{'id':_0x12e189[_0xe9db('0x67')]}});}return null;})[_0xe9db('0x20')](handleEntityNotFound(_0x2277ac,null))[_0xe9db('0x20')](function(_0x4f50c8){if(_0x4f50c8){return _0x4f50c8['update']({'UserId':_0x461fd1[_0xe9db('0x5a')][_0xe9db('0x63')],'read1stAt':_[_0xe9db('0x68')](_0x4f50c8[_0xe9db('0x69')])?moment()[_0xe9db('0x61')](_0xe9db('0x62')):undefined});}return null;})[_0xe9db('0x20')](function(_0x3225f2){if(_0x3225f2){_0x3ac667[_0xe9db('0x6a')]=_0x3225f2[_0xe9db('0x65')]({'plain':!![]});interaction_log[_0xe9db('0x29')](_0xe9db('0x6b'),_0x461fd1[_0xe9db('0x6c')]['id'],_0x461fd1['user'][_0xe9db('0x38')],_0x461fd1[_0xe9db('0x6c')][_0xe9db('0x6d')],_0x3ac667['interaction']['id'],_0x461fd1[_0xe9db('0x5a')]?JSON[_0xe9db('0x25')](_0x461fd1[_0xe9db('0x5a')]):_0xe9db('0x6e'));return respondWithRpcPromise(_0xe9db('0x6f'),_0xe9db('0x70'),_0x3ac667);}return null;})['then'](function(_0x398185){var _0x137808='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x398185[_0xe9db('0x28')][_0xe9db('0x71')];return db['sequelize']['query'](_0x137808,{'type':db['Sequelize'][_0xe9db('0x72')][_0xe9db('0x73')],'raw':!![]})[_0xe9db('0x20')](function(_0x17fa36){return _0x17fa36;});})[_0xe9db('0x20')](function(_0x4ebdc7){if(_0x4ebdc7){_0x3ac667['message'][_0xe9db('0x74')]=_0x4ebdc7[0x0];if(!_0x461fd1[_0xe9db('0x5a')]['UserId'])return;return db[_0xe9db('0x75')]['find']({'where':{'id':_0x461fd1[_0xe9db('0x5a')][_0xe9db('0x63')],'role':'agent'},'attributes':['id',_0xe9db('0x38'),'fullname',_0xe9db('0x76'),_0xe9db('0x77')],'raw':!![]});}return null;})[_0xe9db('0x20')](function(_0x3c7d3f){if(!_0x3c7d3f)return null;_0x3ac667[_0xe9db('0x28')][_0xe9db('0x64')]=_0x3c7d3f;return _0x3ac667;})[_0xe9db('0x20')](function(_0x13f8ad){if(_0x13f8ad){if(_0x461fd1['body']['manual']){_0x3ac667[_0xe9db('0x28')][_0xe9db('0x78')]=util[_0xe9db('0x61')](_0xe9db('0x79'),_0x461fd1[_0xe9db('0x6c')][_0xe9db('0x38')]);_0x3ac667['message']['channel']=_0x3ac667['channel'];_0x3ac667[_0xe9db('0x28')]['motionChannel']=_0x3ac667[_0xe9db('0x7a')];_0x3ac667[_0xe9db('0x28')][_0xe9db('0x7b')]=_0xe9db('0x5e');return respondWithRpcPromise(_0xe9db('0x7c'),_0xe9db('0x7c'),{'event':'acceptmessage','message':_0x3ac667[_0xe9db('0x28')]},client9002)[_0xe9db('0x20')](function(){return _0x3ac667;});}return _0x3ac667;}return null;})[_0xe9db('0x20')](respondWithResult(_0x2277ac,null))[_0xe9db('0x2b')](handleError(_0x2277ac,null));};var interaction_log=require(_0xe9db('0x5c'))('fax-interactions');exports[_0xe9db('0x7d')]=function(_0x325f76,_0x25842f,_0x2d2380){var _0x25e2a3={'agent':{},'channel':_0xe9db('0x5f')};if(_0x325f76[_0xe9db('0x5a')]['id']){delete _0x325f76[_0xe9db('0x5a')]['id'];}_0x325f76[_0xe9db('0x5a')][_0xe9db('0x63')]=_0x325f76[_0xe9db('0x5a')][_0xe9db('0x63')]||_0x325f76[_0xe9db('0x6c')]['id'];_0x25e2a3[_0xe9db('0x64')]['id']=_0x325f76['body']['UserId'];return db[_0xe9db('0x3b')]['find']({'where':{'id':_0x325f76[_0xe9db('0x54')]['id'],'UserId':null}})[_0xe9db('0x20')](handleEntityNotFound(_0x25842f,null))['then'](function(_0x341b25){if(_0x341b25){_0x25e2a3['message']=_0x341b25[_0xe9db('0x65')]({'plain':!![]});return db[_0xe9db('0x66')][_0xe9db('0x58')]({'where':{'id':_0x341b25['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x25842f,null))[_0xe9db('0x20')](function(_0x451768){if(_0x451768){_0x25e2a3[_0xe9db('0x6a')]=_0x451768[_0xe9db('0x65')]({'plain':!![]});interaction_log['info'](_0xe9db('0x7e'),_0x325f76[_0xe9db('0x6c')]['id'],_0x325f76[_0xe9db('0x6c')]['name'],_0x325f76[_0xe9db('0x6c')]['role'],_0x25e2a3['interaction']['id'],_0x325f76[_0xe9db('0x5a')]?JSON[_0xe9db('0x25')](_0x325f76[_0xe9db('0x5a')]):_0xe9db('0x6e'));return respondWithRpcPromise(_0xe9db('0x7f'),_0xe9db('0x80'),_0x25e2a3);}return null;})['then'](function(_0x5b848f){var _0x1cba99='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b848f['message']['ContactId'];return db[_0xe9db('0x81')]['query'](_0x1cba99,{'type':db[_0xe9db('0x82')][_0xe9db('0x72')]['SELECT'],'raw':!![]})[_0xe9db('0x20')](function(_0x3812ae){return _0x3812ae;});})['then'](function(_0x546ccd){if(_0x546ccd){_0x25e2a3[_0xe9db('0x28')][_0xe9db('0x74')]=_0x546ccd[0x0];if(!_0x325f76['body'][_0xe9db('0x63')])return;return db[_0xe9db('0x75')][_0xe9db('0x58')]({'where':{'id':_0x325f76[_0xe9db('0x5a')][_0xe9db('0x63')],'role':_0xe9db('0x64')},'attributes':['id',_0xe9db('0x38'),_0xe9db('0x83'),_0xe9db('0x76'),_0xe9db('0x77')],'raw':!![]});}return null;})[_0xe9db('0x20')](function(_0x232cbb){if(!_0x232cbb)return null;_0x25e2a3[_0xe9db('0x28')][_0xe9db('0x64')]=_0x232cbb;return _0x25e2a3;})['then'](function(_0x53953e){if(_0x53953e){_0x53953e[_0xe9db('0x28')][_0xe9db('0x78')]=util['format'](_0xe9db('0x79'),_0x325f76[_0xe9db('0x6c')][_0xe9db('0x38')]);_0x53953e[_0xe9db('0x28')]['channel']=_0x25e2a3[_0xe9db('0x7a')];_0x53953e['message'][_0xe9db('0x84')]=_0x25e2a3[_0xe9db('0x7a')];_0x53953e[_0xe9db('0x28')][_0xe9db('0x7b')]=_0xe9db('0x7d');respondWithRpcPromise('EventManager',_0xe9db('0x7c'),{'event':'rejectmessage','message':_0x53953e[_0xe9db('0x28')]},client9002);return _0x25e2a3;}return null;})[_0xe9db('0x20')](respondWithResult(_0x25842f,null))[_0xe9db('0x2b')](handleError(_0x25842f,null));};exports[_0xe9db('0x85')]=function(_0x36b644,_0x595cb0){var _0x410081;return db['FaxMessage']['create'](_0x36b644[_0xe9db('0x5a')],{})[_0xe9db('0x20')](function(_0x173a95){_0x410081=_0x173a95;return db['CmContact'][_0xe9db('0x86')]({'where':{'id':_0x410081[_0xe9db('0x71')]}});})[_0xe9db('0x20')](function(_0x2910f8){if(_[_0xe9db('0x68')](_0x2910f8)){return;}else{_0x410081[_0xe9db('0x5f')]=_0x2910f8[_0xe9db('0x5f')];return db['Attachment']['findOne']({'where':{'id':_0x410081[_0xe9db('0x87')]}});}})[_0xe9db('0x20')](function(_0x14575e){return respondWithRpcPromise(_0xe9db('0x88'),_0xe9db('0x88'),{'FaxAccountId':_[_0xe9db('0x68')](_0x36b644[_0xe9db('0x5a')])?undefined:_0x36b644[_0xe9db('0x5a')][_0xe9db('0x89')],'path':_[_0xe9db('0x68')](_0x14575e)?undefined:util[_0xe9db('0x61')](_0xe9db('0x8a'),_0x14575e[_0xe9db('0x8b')]),'fax':_[_0xe9db('0x68')](_0x410081[_0xe9db('0x5f')])?undefined:_0x410081[_0xe9db('0x5f')],'AttachmentId':_0x410081[_0xe9db('0x87')]},client9002);})[_0xe9db('0x20')](respondWithResult(_0x595cb0,0xc9))['catch'](handleError(_0x595cb0,null));};exports[_0xe9db('0x8c')]=function(_0x2dd2ac,_0x109b18){var _0x29b7b9=path[_0xe9db('0x8d')](config['root'],_0xe9db('0x8e'),'files',_0xe9db('0x8f'));return db[_0xe9db('0x3b')][_0xe9db('0x58')]({'where':{'id':_0x2dd2ac['params']['id']},'include':[{'model':db['Attachment'],'as':_0xe9db('0x90')}]})['then'](handleEntityNotFound(_0x109b18,null))[_0xe9db('0x20')](function(_0x43b0f0){if(_0x43b0f0){return _0x109b18[_0xe9db('0x8c')](path[_0xe9db('0x8d')](_0x29b7b9,_0x43b0f0['Attachment']['basename']));}})[_0xe9db('0x2b')](handleError(_0x109b18,null));};
\ No newline at end of file
+var _0x00b5=['motionChannel','event','EventManager','acceptmessage','FaxInteraction','null','RejectMessage','sequelize','interface','SIP/%s','rejectmessage','create','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','Attachment','basename','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','query','length','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','show','options','find','update','body','params','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','isNil','interaction','info','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','channel'];(function(_0x28f9f4,_0xe99b1f){var _0x59a726=function(_0x35ef5a){while(--_0x35ef5a){_0x28f9f4['push'](_0x28f9f4['shift']());}};_0x59a726(++_0xe99b1f);}(_0x00b5,0x1c5));var _0x500b=function(_0xe44b1,_0x242100){_0xe44b1=_0xe44b1-0x0;var _0x368147=_0x00b5[_0xe44b1];return _0x368147;};'use strict';var emlformat=require(_0x500b('0x0'));var rimraf=require(_0x500b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x500b('0x2'));var moment=require(_0x500b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x500b('0x4'));var util=require(_0x500b('0x5'));var path=require('path');var sox=require(_0x500b('0x6'));var csv=require(_0x500b('0x7'));var ejs=require(_0x500b('0x8'));var fs=require('fs');var fs_extra=require(_0x500b('0x9'));var _=require(_0x500b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x500b('0xb'));var deskjs=require(_0x500b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x500b('0xd'));var Papa=require('papaparse');var Redis=require(_0x500b('0xe'));var authService=require(_0x500b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x500b('0x10'));var hardwareService=require(_0x500b('0x11'));var logger=require(_0x500b('0x12'))(_0x500b('0x13'));var utils=require('../../config/utils');var config=require(_0x500b('0x14'));var licenseUtil=require(_0x500b('0x15'));var db=require(_0x500b('0x16'))['db'];config[_0x500b('0x17')]=_[_0x500b('0x18')](config['redis'],{'host':_0x500b('0x19'),'port':0x18eb});var socket=require(_0x500b('0x1a'))(new Redis(config[_0x500b('0x17')]));require(_0x500b('0x1b'))['register'](socket);var jayson=require(_0x500b('0x1c'));var client=jayson[_0x500b('0x1d')][_0x500b('0x1e')]({'port':0x232c});var client9002=jayson[_0x500b('0x1d')][_0x500b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x369393,_0x5876f0,_0x4553f6,_0x1aeaa1){return new BPromise(function(_0x4aaa77,_0x5923e8){var _0x17fc51=_0x1aeaa1||client;return _0x17fc51[_0x500b('0x1f')](_0x369393,_0x4553f6)[_0x500b('0x20')](function(_0x3b851f){logger['info'](_0x500b('0x21'),_0x5876f0,_0x500b('0x22'));logger[_0x500b('0x23')](_0x500b('0x24'),_0x5876f0,_0x500b('0x22'),JSON[_0x500b('0x25')](_0x3b851f));if(_0x3b851f[_0x500b('0x26')]){if(_0x3b851f[_0x500b('0x26')]['code']===0x1f4){logger['error'](_0x500b('0x21'),_0x5876f0,_0x3b851f[_0x500b('0x26')][_0x500b('0x27')]);return _0x5923e8(_0x3b851f[_0x500b('0x26')][_0x500b('0x27')]);}logger[_0x500b('0x26')](_0x500b('0x21'),_0x5876f0,_0x3b851f[_0x500b('0x26')][_0x500b('0x27')]);return _0x4aaa77(_0x3b851f[_0x500b('0x26')]['message']);}else{logger['info'](_0x500b('0x21'),_0x5876f0,'request\x20sent');_0x4aaa77(_0x3b851f[_0x500b('0x28')][_0x500b('0x27')]);}})[_0x500b('0x29')](function(_0x154288){logger[_0x500b('0x26')]('FaxMessage,\x20%s,\x20%s',_0x5876f0,_0x154288);_0x5923e8(_0x154288);});});}function respondWithStatusCode(_0x5d3104,_0x178dc6){_0x178dc6=_0x178dc6||0xcc;return function(_0x233e86){if(_0x233e86){return _0x5d3104[_0x500b('0x2a')](_0x178dc6);}return _0x5d3104[_0x500b('0x2b')](_0x178dc6)[_0x500b('0x2c')]();};}function respondWithResult(_0x5a775b,_0x2f2fe0){_0x2f2fe0=_0x2f2fe0||0xc8;return function(_0x999008){if(_0x999008){return _0x5a775b['status'](_0x2f2fe0)[_0x500b('0x2d')](_0x999008);}};}function respondWithFilteredResult(_0x260c2a,_0x1b177b){return function(_0x402ad4){if(_0x402ad4){var _0x15e781=typeof _0x1b177b[_0x500b('0x2e')]===_0x500b('0x2f')&&typeof _0x1b177b['limit']===_0x500b('0x2f');var _0x2a3fcd=_0x402ad4[_0x500b('0x30')];var _0x143ef4=_0x15e781?0x0:_0x1b177b[_0x500b('0x2e')];var _0x5396c3=_0x15e781?_0x402ad4[_0x500b('0x30')]:_0x1b177b[_0x500b('0x2e')]+_0x1b177b[_0x500b('0x31')];var _0x56b476;if(_0x5396c3>=_0x2a3fcd){_0x5396c3=_0x2a3fcd;_0x56b476=0xc8;}else{_0x56b476=0xce;}_0x260c2a[_0x500b('0x2b')](_0x56b476);return _0x260c2a[_0x500b('0x32')](_0x500b('0x33'),_0x143ef4+'-'+_0x5396c3+'/'+_0x2a3fcd)['json'](_0x402ad4);}return null;};}function patchUpdates(_0x4739b8){return function(_0x2eff57){try{jsonpatch[_0x500b('0x34')](_0x2eff57,_0x4739b8,!![]);}catch(_0x462910){return BPromise[_0x500b('0x35')](_0x462910);}return _0x2eff57[_0x500b('0x36')]();};}function saveUpdates(_0x1a27cc,_0x296205){return function(_0x284001){if(_0x284001){return _0x284001['update'](_0x1a27cc)[_0x500b('0x20')](function(_0x494163){return _0x494163;});}return null;};}function removeEntity(_0x33eeb5,_0x167f6d){return function(_0xac20ea){if(_0xac20ea){return _0xac20ea['destroy']()[_0x500b('0x20')](function(){_0x33eeb5['status'](0xcc)[_0x500b('0x2c')]();});}};}function handleEntityNotFound(_0x1ca3ea,_0x178fa7){return function(_0x58a874){if(!_0x58a874){_0x1ca3ea[_0x500b('0x2a')](0x194);}return _0x58a874;};}function handleError(_0x30ab19,_0x3f2f2e){_0x3f2f2e=_0x3f2f2e||0x1f4;return function(_0x34e8e6){logger[_0x500b('0x26')](_0x34e8e6[_0x500b('0x37')]);if(_0x34e8e6[_0x500b('0x38')]){delete _0x34e8e6[_0x500b('0x38')];}_0x30ab19[_0x500b('0x2b')](_0x3f2f2e)[_0x500b('0x39')](_0x34e8e6);};}exports[_0x500b('0x3a')]=function(_0x107a04,_0x1a4910){var _0x47c168={},_0x3d5943={},_0x10f379={'count':0x0,'rows':[]};var _0x25fe74=_[_0x500b('0x3b')](db[_0x500b('0x3c')][_0x500b('0x3d')],function(_0x37c013){return{'name':_0x37c013[_0x500b('0x3e')],'type':_0x37c013[_0x500b('0x3f')]['key']};});_0x3d5943[_0x500b('0x40')]=_[_0x500b('0x3b')](_0x25fe74,_0x500b('0x38'));_0x3d5943['query']=_[_0x500b('0x41')](_0x107a04['query']);_0x3d5943[_0x500b('0x42')]=_[_0x500b('0x43')](_0x3d5943[_0x500b('0x40')],_0x3d5943['query']);_0x47c168[_0x500b('0x44')]=_[_0x500b('0x43')](_0x3d5943[_0x500b('0x40')],qs[_0x500b('0x45')](_0x107a04[_0x500b('0x46')]['fields']));_0x47c168[_0x500b('0x44')]=_0x47c168[_0x500b('0x44')][_0x500b('0x47')]?_0x47c168[_0x500b('0x44')]:_0x3d5943['model'];if(!_0x107a04['query']['hasOwnProperty'](_0x500b('0x48'))){_0x47c168[_0x500b('0x31')]=qs[_0x500b('0x31')](_0x107a04[_0x500b('0x46')]['limit']);_0x47c168[_0x500b('0x2e')]=qs[_0x500b('0x2e')](_0x107a04['query'][_0x500b('0x2e')]);}_0x47c168[_0x500b('0x49')]=qs['sort'](_0x107a04[_0x500b('0x46')][_0x500b('0x4a')]);_0x47c168['where']=qs['filters'](_[_0x500b('0x4b')](_0x107a04[_0x500b('0x46')],_0x3d5943[_0x500b('0x42')]),_0x25fe74);if(_0x107a04[_0x500b('0x46')][_0x500b('0x4c')]){_0x47c168[_0x500b('0x4d')]=_[_0x500b('0x4e')](_0x47c168[_0x500b('0x4d')],{'$or':_[_0x500b('0x3b')](_0x25fe74,function(_0x385a26){if(_0x385a26[_0x500b('0x3f')]!=='VIRTUAL'){var _0x331c01={};_0x331c01[_0x385a26[_0x500b('0x38')]]={'$like':'%'+_0x107a04[_0x500b('0x46')]['filter']+'%'};return _0x331c01;}})});}_0x47c168=_['merge']({},_0x47c168,_0x107a04['options']);var _0x23705a={'where':_0x47c168[_0x500b('0x4d')]};return db[_0x500b('0x3c')][_0x500b('0x30')](_0x23705a)[_0x500b('0x20')](function(_0x1014a2){_0x10f379[_0x500b('0x30')]=_0x1014a2;if(_0x107a04[_0x500b('0x46')][_0x500b('0x4f')]){_0x47c168[_0x500b('0x50')]=[{'all':!![]}];}return db[_0x500b('0x3c')][_0x500b('0x51')](_0x47c168);})[_0x500b('0x20')](function(_0xe3b3eb){_0x10f379[_0x500b('0x52')]=_0xe3b3eb;return _0x10f379;})['then'](respondWithFilteredResult(_0x1a4910,_0x47c168))[_0x500b('0x29')](handleError(_0x1a4910,null));};exports[_0x500b('0x53')]=function(_0x5a518c,_0x5e3c9c){var _0x1c2e8e={'raw':!![],'where':{'id':_0x5a518c['params']['id']}},_0x13f4e3={};_0x13f4e3[_0x500b('0x40')]=_[_0x500b('0x41')](db['FaxMessage'][_0x500b('0x3d')]);_0x13f4e3[_0x500b('0x46')]=_[_0x500b('0x41')](_0x5a518c[_0x500b('0x46')]);_0x13f4e3['filters']=_[_0x500b('0x43')](_0x13f4e3['model'],_0x13f4e3[_0x500b('0x46')]);_0x1c2e8e['attributes']=_[_0x500b('0x43')](_0x13f4e3[_0x500b('0x40')],qs[_0x500b('0x45')](_0x5a518c[_0x500b('0x46')][_0x500b('0x45')]));_0x1c2e8e[_0x500b('0x44')]=_0x1c2e8e[_0x500b('0x44')][_0x500b('0x47')]?_0x1c2e8e[_0x500b('0x44')]:_0x13f4e3['model'];if(_0x5a518c[_0x500b('0x46')]['includeAll']){_0x1c2e8e['include']=[{'all':!![]}];}_0x1c2e8e=_['merge']({},_0x1c2e8e,_0x5a518c[_0x500b('0x54')]);return db[_0x500b('0x3c')][_0x500b('0x55')](_0x1c2e8e)[_0x500b('0x20')](handleEntityNotFound(_0x5e3c9c,null))[_0x500b('0x20')](respondWithResult(_0x5e3c9c,null))[_0x500b('0x29')](handleError(_0x5e3c9c,null));};exports[_0x500b('0x56')]=function(_0x376361,_0x300992){if(_0x376361[_0x500b('0x57')]['id']){delete _0x376361[_0x500b('0x57')]['id'];}return db['FaxMessage'][_0x500b('0x55')]({'where':{'id':_0x376361[_0x500b('0x58')]['id']}})[_0x500b('0x20')](handleEntityNotFound(_0x300992,null))[_0x500b('0x20')](saveUpdates(_0x376361['body'],null))[_0x500b('0x20')](respondWithResult(_0x300992,null))[_0x500b('0x29')](handleError(_0x300992,null));};exports['destroy']=function(_0x247052,_0x54d4d2){return db[_0x500b('0x3c')][_0x500b('0x55')]({'where':{'id':_0x247052[_0x500b('0x58')]['id']}})[_0x500b('0x20')](handleEntityNotFound(_0x54d4d2,null))[_0x500b('0x20')](removeEntity(_0x54d4d2,null))[_0x500b('0x29')](handleError(_0x54d4d2,null));};exports[_0x500b('0x59')]=function(_0x1389f9,_0x4d2c79){return db[_0x500b('0x3c')][_0x500b('0x59')]()['then'](respondWithResult(_0x4d2c79,null))['catch'](handleError(_0x4d2c79,null));};var interaction_log=require(_0x500b('0x12'))(_0x500b('0x5a'));exports[_0x500b('0x5b')]=function(_0x511730,_0x3c39cf,_0x10cefd){var _0x5194c0={'agent':{},'channel':_0x500b('0x5c')};if(_0x511730[_0x500b('0x57')]['id']){delete _0x511730['body']['id'];}_0x511730[_0x500b('0x57')][_0x500b('0x5d')]=!![];_0x511730[_0x500b('0x57')][_0x500b('0x5e')]=moment()[_0x500b('0x5f')](_0x500b('0x60'));_0x511730[_0x500b('0x57')][_0x500b('0x61')]=_0x511730[_0x500b('0x57')]['UserId']||_0x511730[_0x500b('0x62')]['id'];_0x5194c0[_0x500b('0x63')]['id']=_0x511730[_0x500b('0x57')][_0x500b('0x61')];return db[_0x500b('0x3c')]['find']({'where':{'id':_0x511730['params']['id'],'UserId':null}})[_0x500b('0x20')](handleEntityNotFound(_0x3c39cf,null))[_0x500b('0x20')](saveUpdates(_0x511730[_0x500b('0x57')],null))[_0x500b('0x20')](function(_0x1be1eb){if(_0x1be1eb){_0x5194c0[_0x500b('0x27')]=_0x1be1eb[_0x500b('0x64')]({'plain':!![]});return db['FaxInteraction'][_0x500b('0x55')]({'where':{'id':_0x1be1eb[_0x500b('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x3c39cf,null))[_0x500b('0x20')](function(_0x5c2ccb){if(_0x5c2ccb){return _0x5c2ccb[_0x500b('0x56')]({'UserId':_0x511730['body'][_0x500b('0x61')],'read1stAt':_[_0x500b('0x66')](_0x5c2ccb['read1stAt'])?moment()[_0x500b('0x5f')](_0x500b('0x60')):undefined});}return null;})[_0x500b('0x20')](function(_0x31c659){if(_0x31c659){_0x5194c0[_0x500b('0x67')]=_0x31c659[_0x500b('0x64')]({'plain':!![]});interaction_log[_0x500b('0x68')](_0x500b('0x69'),_0x511730['user']['id'],_0x511730['user'][_0x500b('0x38')],_0x511730[_0x500b('0x62')][_0x500b('0x6a')],_0x5194c0[_0x500b('0x67')]['id'],_0x511730[_0x500b('0x57')]?JSON[_0x500b('0x25')](_0x511730[_0x500b('0x57')]):'null');return respondWithRpcPromise(_0x500b('0x6b'),_0x500b('0x6c'),_0x5194c0);}return null;})[_0x500b('0x20')](function(_0x47b642){var _0x4e1378=_0x500b('0x6d')+_0x47b642['message'][_0x500b('0x6e')];return db['sequelize'][_0x500b('0x46')](_0x4e1378,{'type':db[_0x500b('0x6f')][_0x500b('0x70')][_0x500b('0x71')],'raw':!![]})[_0x500b('0x20')](function(_0x231f65){return _0x231f65;});})[_0x500b('0x20')](function(_0x3bc2bf){if(_0x3bc2bf){_0x5194c0['message'][_0x500b('0x72')]=_0x3bc2bf[0x0];if(!_0x511730[_0x500b('0x57')][_0x500b('0x61')])return;return db[_0x500b('0x73')]['find']({'where':{'id':_0x511730[_0x500b('0x57')][_0x500b('0x61')],'role':_0x500b('0x63')},'attributes':['id','name',_0x500b('0x74'),'email',_0x500b('0x75')],'raw':!![]});}return null;})[_0x500b('0x20')](function(_0x242d12){if(!_0x242d12)return null;_0x5194c0['message'][_0x500b('0x63')]=_0x242d12;return _0x5194c0;})['then'](function(_0x2fc9e2){if(_0x2fc9e2){if(_0x511730['body']['manual']){_0x5194c0['message']['interface']=util[_0x500b('0x5f')]('SIP/%s',_0x511730[_0x500b('0x62')][_0x500b('0x38')]);_0x5194c0[_0x500b('0x27')][_0x500b('0x76')]=_0x5194c0[_0x500b('0x76')];_0x5194c0['message'][_0x500b('0x77')]=_0x5194c0[_0x500b('0x76')];_0x5194c0['message'][_0x500b('0x78')]=_0x500b('0x5b');return respondWithRpcPromise(_0x500b('0x79'),_0x500b('0x79'),{'event':_0x500b('0x7a'),'message':_0x5194c0[_0x500b('0x27')]},client9002)[_0x500b('0x20')](function(){return _0x5194c0;});}return _0x5194c0;}return null;})['then'](respondWithResult(_0x3c39cf,null))['catch'](handleError(_0x3c39cf,null));};var interaction_log=require(_0x500b('0x12'))(_0x500b('0x5a'));exports[_0x500b('0x35')]=function(_0x716650,_0x3ed543,_0x730344){var _0x50e8fd={'agent':{},'channel':_0x500b('0x5c')};if(_0x716650[_0x500b('0x57')]['id']){delete _0x716650['body']['id'];}_0x716650[_0x500b('0x57')][_0x500b('0x61')]=_0x716650[_0x500b('0x57')][_0x500b('0x61')]||_0x716650['user']['id'];_0x50e8fd[_0x500b('0x63')]['id']=_0x716650[_0x500b('0x57')]['UserId'];return db[_0x500b('0x3c')][_0x500b('0x55')]({'where':{'id':_0x716650[_0x500b('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3ed543,null))[_0x500b('0x20')](function(_0x46a753){if(_0x46a753){_0x50e8fd['message']=_0x46a753[_0x500b('0x64')]({'plain':!![]});return db[_0x500b('0x7b')][_0x500b('0x55')]({'where':{'id':_0x46a753['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3ed543,null))[_0x500b('0x20')](function(_0x2dea19){if(_0x2dea19){_0x50e8fd[_0x500b('0x67')]=_0x2dea19['get']({'plain':!![]});interaction_log[_0x500b('0x68')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x716650[_0x500b('0x62')]['id'],_0x716650[_0x500b('0x62')][_0x500b('0x38')],_0x716650[_0x500b('0x62')][_0x500b('0x6a')],_0x50e8fd[_0x500b('0x67')]['id'],_0x716650['body']?JSON[_0x500b('0x25')](_0x716650[_0x500b('0x57')]):_0x500b('0x7c'));return respondWithRpcPromise(_0x500b('0x7d'),'rejectMessage',_0x50e8fd);}return null;})[_0x500b('0x20')](function(_0x40184b){var _0x405e7d=_0x500b('0x6d')+_0x40184b['message'][_0x500b('0x6e')];return db[_0x500b('0x7e')]['query'](_0x405e7d,{'type':db['Sequelize'][_0x500b('0x70')][_0x500b('0x71')],'raw':!![]})[_0x500b('0x20')](function(_0x1bb036){return _0x1bb036;});})['then'](function(_0x340221){if(_0x340221){_0x50e8fd[_0x500b('0x27')][_0x500b('0x72')]=_0x340221[0x0];if(!_0x716650[_0x500b('0x57')][_0x500b('0x61')])return;return db[_0x500b('0x73')][_0x500b('0x55')]({'where':{'id':_0x716650[_0x500b('0x57')][_0x500b('0x61')],'role':_0x500b('0x63')},'attributes':['id',_0x500b('0x38'),_0x500b('0x74'),'email',_0x500b('0x75')],'raw':!![]});}return null;})[_0x500b('0x20')](function(_0x56a337){if(!_0x56a337)return null;_0x50e8fd[_0x500b('0x27')][_0x500b('0x63')]=_0x56a337;return _0x50e8fd;})[_0x500b('0x20')](function(_0x5b2d31){if(_0x5b2d31){_0x5b2d31[_0x500b('0x27')][_0x500b('0x7f')]=util[_0x500b('0x5f')](_0x500b('0x80'),_0x716650[_0x500b('0x62')]['name']);_0x5b2d31[_0x500b('0x27')][_0x500b('0x76')]=_0x50e8fd['channel'];_0x5b2d31[_0x500b('0x27')][_0x500b('0x77')]=_0x50e8fd['channel'];_0x5b2d31[_0x500b('0x27')]['event']=_0x500b('0x35');respondWithRpcPromise(_0x500b('0x79'),_0x500b('0x79'),{'event':_0x500b('0x81'),'message':_0x5b2d31[_0x500b('0x27')]},client9002);return _0x50e8fd;}return null;})[_0x500b('0x20')](respondWithResult(_0x3ed543,null))[_0x500b('0x29')](handleError(_0x3ed543,null));};exports[_0x500b('0x82')]=function(_0x7f265e,_0xb1f3f5){var _0x264f15;return db[_0x500b('0x3c')]['create'](_0x7f265e['body'],{})['then'](function(_0xaac135){_0x264f15=_0xaac135;return db['CmContact'][_0x500b('0x83')]({'where':{'id':_0x264f15[_0x500b('0x6e')]}});})[_0x500b('0x20')](function(_0x18de5e){if(_['isNil'](_0x18de5e)){return;}else{_0x264f15[_0x500b('0x5c')]=_0x18de5e[_0x500b('0x5c')];return db['Attachment'][_0x500b('0x83')]({'where':{'id':_0x264f15[_0x500b('0x84')]}});}})[_0x500b('0x20')](function(_0x1d14cc){return respondWithRpcPromise(_0x500b('0x85'),_0x500b('0x85'),{'FaxAccountId':_[_0x500b('0x66')](_0x7f265e[_0x500b('0x57')])?undefined:_0x7f265e[_0x500b('0x57')][_0x500b('0x86')],'path':_[_0x500b('0x66')](_0x1d14cc)?undefined:util[_0x500b('0x5f')](_0x500b('0x87'),_0x1d14cc['basename']),'fax':_['isNil'](_0x264f15[_0x500b('0x5c')])?undefined:_0x264f15[_0x500b('0x5c')],'AttachmentId':_0x264f15[_0x500b('0x84')]},client9002);})['then'](respondWithResult(_0xb1f3f5,0xc9))[_0x500b('0x29')](handleError(_0xb1f3f5,null));};exports[_0x500b('0x88')]=function(_0x38d232,_0x58e50a){var _0x28d9b8=path[_0x500b('0x89')](config[_0x500b('0x8a')],_0x500b('0x8b'),_0x500b('0x8c'),'attachments');return db[_0x500b('0x3c')][_0x500b('0x55')]({'where':{'id':_0x38d232['params']['id']},'include':[{'model':db['Attachment'],'as':_0x500b('0x8d')}]})['then'](handleEntityNotFound(_0x58e50a,null))[_0x500b('0x20')](function(_0x8fe8cf){if(_0x8fe8cf){return _0x58e50a[_0x500b('0x88')](path[_0x500b('0x89')](_0x28d9b8,_0x8fe8cf['Attachment'][_0x500b('0x8e')]));}})['catch'](handleError(_0x58e50a,null));};
\ No newline at end of file
index 6369a09..403f38c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['exports','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x56711a,_0x4796a7){var _0xe20eea=function(_0x2b4ca3){while(--_0x2b4ca3){_0x56711a['push'](_0x56711a['shift']());}};_0xe20eea(++_0x4796a7);}(_0x1967,0x173));var _0x7196=function(_0x2883c7,_0xc1ca9b){_0x2883c7=_0x2883c7-0x0;var _0x297878=_0x1967[_0x2883c7];return _0x297878;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7196('0x0'))['db'][_0x7196('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7196('0x2')](0x0);var events={'afterCreate':_0x7196('0x3'),'afterUpdate':_0x7196('0x4'),'afterDestroy':_0x7196('0x5')};function emitEvent(_0x302f34){return function(_0x1aaddd,_0x458ae8,_0x3ae43f){FaxMessageEvents['emit'](_0x302f34+':'+_0x1aaddd['id'],_0x1aaddd);FaxMessageEvents[_0x7196('0x6')](_0x302f34,_0x1aaddd);_0x3ae43f(null);};}for(var e in events){if(events[_0x7196('0x7')](e)){var event=events[e];FaxMessage[_0x7196('0x8')](e,emitEvent(event));}}module[_0x7196('0x9')]=FaxMessageEvents;
\ No newline at end of file
+var _0x9e6d=['save','remove','emit','exports','events','FaxMessage','setMaxListeners'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0x58b7fa,_0x4e9a81){_0x58b7fa=_0x58b7fa-0x0;var _0x21230b=_0x9e6d[_0x58b7fa];return _0x21230b;};'use strict';var EventEmitter=require(_0xd9e6('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xd9e6('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xd9e6('0x2')](0x0);var events={'afterCreate':_0xd9e6('0x3'),'afterUpdate':'update','afterDestroy':_0xd9e6('0x4')};function emitEvent(_0x1d5756){return function(_0x2f1c0,_0x3b2951,_0x5e363d){FaxMessageEvents[_0xd9e6('0x5')](_0x1d5756+':'+_0x2f1c0['id'],_0x2f1c0);FaxMessageEvents[_0xd9e6('0x5')](_0x1d5756,_0x2f1c0);_0x5e363d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xd9e6('0x6')]=FaxMessageEvents;
\ No newline at end of file
index fbdf7e6..04b4473 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a7b=['fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','FaxMessage'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9a7b,0x87));var _0xb9a7=function(_0x1e1355,_0x589069){_0x1e1355=_0x1e1355-0x0;var _0x3fdd67=_0x9a7b[_0x1e1355];return _0x3fdd67;};'use strict';var _=require('lodash');var util=require(_0xb9a7('0x0'));var logger=require(_0xb9a7('0x1'))('api');var moment=require(_0xb9a7('0x2'));var BPromise=require(_0xb9a7('0x3'));var rp=require(_0xb9a7('0x4'));var fs=require('fs');var path=require(_0xb9a7('0x5'));var rimraf=require('rimraf');var config=require(_0xb9a7('0x6'));var attributes=require('./faxMessage.attributes');module[_0xb9a7('0x7')]=function(_0x2645b7,_0x1e730f){return _0x2645b7[_0xb9a7('0x8')](_0xb9a7('0x9'),attributes,{'tableName':_0xb9a7('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xb9a7('0xb')],'type':_0xb9a7('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d011d,_0x2a829d,_0x15cd63){var _0x3867a2=_0x2645b7[_0xb9a7('0xd')];var _0x491d4f=_0x4d011d[_0xb9a7('0xe')]({'plain':!![]});if(_0x491d4f['direction'][_0xb9a7('0xf')]()==='in'||_0x491d4f[_0xb9a7('0x10')]['toLowerCase']()===_0xb9a7('0x11')&&!_0x491d4f[_0xb9a7('0x12')]&&!_[_0xb9a7('0x13')](_0x491d4f[_0xb9a7('0x14')])){_0x3867a2[_0xb9a7('0x15')][_0xb9a7('0x16')]({'where':{'id':_0x491d4f[_0xb9a7('0x17')]}})['then'](function(_0x53254f){if(_0x53254f){_0x53254f[_0xb9a7('0x18')]({'lastMsgAt':_0x491d4f['createdAt'],'lastMsgDirection':_0x491d4f[_0xb9a7('0x10')][_0xb9a7('0xf')]()});}})[_0xb9a7('0x19')](function(_0x4dd827){console[_0xb9a7('0x1a')](_0x4dd827);});}_0x15cd63();}},'charset':_0xb9a7('0x1b'),'collate':_0xb9a7('0x1c')});};
\ No newline at end of file
+var _0x128e=['out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','FaxMessage','body','FULLTEXT','models','direction','toLowerCase'];(function(_0x20306c,_0x480e5a){var _0x478f44=function(_0x10fbc1){while(--_0x10fbc1){_0x20306c['push'](_0x20306c['shift']());}};_0x478f44(++_0x480e5a);}(_0x128e,0x10f));var _0xe128=function(_0x344b9f,_0x7912a7){_0x344b9f=_0x344b9f-0x0;var _0x594dfb=_0x128e[_0x344b9f];return _0x594dfb;};'use strict';var _=require('lodash');var util=require(_0xe128('0x0'));var logger=require('../../config/logger')(_0xe128('0x1'));var moment=require(_0xe128('0x2'));var BPromise=require('bluebird');var rp=require(_0xe128('0x3'));var fs=require('fs');var path=require(_0xe128('0x4'));var rimraf=require(_0xe128('0x5'));var config=require(_0xe128('0x6'));var attributes=require('./faxMessage.attributes');module[_0xe128('0x7')]=function(_0x3069b6,_0x5f4c28){return _0x3069b6[_0xe128('0x8')](_0xe128('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xe128('0xa')],'type':_0xe128('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c3a19,_0x3a3d0c,_0x105d7c){var _0xe36818=_0x3069b6[_0xe128('0xc')];var _0x3226b9=_0x3c3a19['get']({'plain':!![]});if(_0x3226b9[_0xe128('0xd')]['toLowerCase']()==='in'||_0x3226b9[_0xe128('0xd')][_0xe128('0xe')]()===_0xe128('0xf')&&!_0x3226b9[_0xe128('0x10')]&&!_[_0xe128('0x11')](_0x3226b9['UserId'])){_0xe36818[_0xe128('0x12')][_0xe128('0x13')]({'where':{'id':_0x3226b9[_0xe128('0x14')]}})[_0xe128('0x15')](function(_0x3d0d52){if(_0x3d0d52){_0x3d0d52[_0xe128('0x16')]({'lastMsgAt':_0x3226b9[_0xe128('0x17')],'lastMsgDirection':_0x3226b9[_0xe128('0xd')][_0xe128('0xe')]()});}})[_0xe128('0x18')](function(_0x5b8c61){console['error'](_0x5b8c61);});}_0x105d7c();}},'charset':_0xe128('0x19'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index e2fc6b6..2e2dea3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['CreateFaxMessage','FaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','attributes','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','defaults','localhost','./faxMessage.socket','register','request','then','info','request\x20sent','debug','error','message','FaxMessage,\x20%s,\x20%s','result'];(function(_0x95cb9f,_0x316fe0){var _0x33a725=function(_0x3111ac){while(--_0x3111ac){_0x95cb9f['push'](_0x95cb9f['shift']());}};_0x33a725(++_0x316fe0);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x4b84[_0x3e961c];return _0x474f9c;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});config['redis']=_[_0x44b8('0x7')](config['redis'],{'host':_0x44b8('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x44b8('0x9'))[_0x44b8('0xa')](socket);function respondWithRpcPromise(_0x30ebc3,_0x48a371,_0xc650ec){return new BPromise(function(_0x2cc74b,_0x4315f6){return client[_0x44b8('0xb')](_0x30ebc3,_0xc650ec)[_0x44b8('0xc')](function(_0x37e471){logger[_0x44b8('0xd')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'));logger[_0x44b8('0xf')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'),JSON['stringify'](_0x37e471));if(_0x37e471[_0x44b8('0x10')]){if(_0x37e471[_0x44b8('0x10')]['code']===0x1f4){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error'][_0x44b8('0x11')]);return _0x4315f6(_0x37e471[_0x44b8('0x10')][_0x44b8('0x11')]);}logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error']['message']);return _0x2cc74b(_0x37e471[_0x44b8('0x10')]['message']);}else{logger[_0x44b8('0xd')](_0x44b8('0x12'),_0x48a371,'request\x20sent');_0x2cc74b(_0x37e471[_0x44b8('0x13')][_0x44b8('0x11')]);}})['catch'](function(_0x89bc30){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x89bc30);_0x4315f6(_0x89bc30);});});}exports[_0x44b8('0x14')]=function(_0x8b4301){var _0xebfe79=this;return new Promise(function(_0x235bdc,_0x102ef9){return db[_0x44b8('0x15')][_0x44b8('0x16')](_0x8b4301[_0x44b8('0x17')],{'raw':_0x8b4301[_0x44b8('0x18')]?_0x8b4301[_0x44b8('0x18')][_0x44b8('0x19')]===undefined?!![]:![]:!![]})[_0x44b8('0xc')](function(_0x48327e){logger[_0x44b8('0xd')](_0x44b8('0x14'),_0x8b4301);logger[_0x44b8('0xf')](_0x44b8('0x14'),_0x8b4301,JSON[_0x44b8('0x1a')](_0x48327e));_0x235bdc(_0x48327e);})['catch'](function(_0x402497){logger['error'](_0x44b8('0x14'),_0x402497[_0x44b8('0x11')],_0x8b4301);_0x102ef9(_0xebfe79[_0x44b8('0x10')](0x1f4,_0x402497[_0x44b8('0x11')]));});});};exports[_0x44b8('0x1b')]=function(_0x59acbc){var _0x474f01=this;return new Promise(function(_0x502acf,_0x41d673){return db[_0x44b8('0x15')]['update'](_0x59acbc[_0x44b8('0x17')],{'raw':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['where']||null:null,'attributes':_0x59acbc[_0x44b8('0x18')]?_0x59acbc['options'][_0x44b8('0x1c')]||null:null,'limit':_0x59acbc['options']?_0x59acbc['options']['limit']||null:null})[_0x44b8('0xc')](function(_0x29b18d){logger[_0x44b8('0xd')](_0x44b8('0x1b'),_0x59acbc);logger[_0x44b8('0xf')](_0x44b8('0x1b'),_0x59acbc,JSON[_0x44b8('0x1a')](_0x29b18d));_0x502acf(_0x29b18d);})[_0x44b8('0x1d')](function(_0xd1d320){logger[_0x44b8('0x10')](_0x44b8('0x1b'),_0xd1d320[_0x44b8('0x11')],_0x59acbc);_0x41d673(_0x474f01[_0x44b8('0x10')](0x1f4,_0xd1d320['message']));});});};
\ No newline at end of file
+var _0xbd50=['request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxMessage','options','raw','then','UpdateFaxMessage','FaxMessage','update','body','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','./faxMessage.socket','register'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xbd50,0x196));var _0x0bd5=function(_0x5e28c2,_0x1e48ab){_0x5e28c2=_0x5e28c2-0x0;var _0x1a8cc6=_0xbd50[_0x5e28c2];return _0x1a8cc6;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});config[_0x0bd5('0xa')]=_[_0x0bd5('0xb')](config[_0x0bd5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bd5('0xa')]));require(_0x0bd5('0xc'))[_0x0bd5('0xd')](socket);function respondWithRpcPromise(_0x5f5a0c,_0xa98f54,_0x2fa7d1){return new BPromise(function(_0x519bc6,_0x210f45){return client[_0x0bd5('0xe')](_0x5f5a0c,_0x2fa7d1)['then'](function(_0x1ce7dd){logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,'request\x20sent');logger[_0x0bd5('0x11')](_0x0bd5('0x12'),_0xa98f54,_0x0bd5('0x13'),JSON[_0x0bd5('0x14')](_0x1ce7dd));if(_0x1ce7dd[_0x0bd5('0x15')]){if(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x16')]===0x1f4){logger[_0x0bd5('0x15')]('FaxMessage,\x20%s,\x20%s',_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);return _0x210f45(_0x1ce7dd['error'][_0x0bd5('0x17')]);}logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x1ce7dd[_0x0bd5('0x15')]['message']);return _0x519bc6(_0x1ce7dd[_0x0bd5('0x15')][_0x0bd5('0x17')]);}else{logger[_0x0bd5('0xf')](_0x0bd5('0x10'),_0xa98f54,_0x0bd5('0x13'));_0x519bc6(_0x1ce7dd[_0x0bd5('0x18')][_0x0bd5('0x17')]);}})[_0x0bd5('0x19')](function(_0x29fa4c){logger[_0x0bd5('0x15')](_0x0bd5('0x10'),_0xa98f54,_0x29fa4c);_0x210f45(_0x29fa4c);});});}exports[_0x0bd5('0x1a')]=function(_0x4008bd){var _0x2dc1e5=this;return new Promise(function(_0x527c37,_0x5ba943){return db['FaxMessage']['create'](_0x4008bd['body'],{'raw':_0x4008bd[_0x0bd5('0x1b')]?_0x4008bd[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![]})[_0x0bd5('0x1d')](function(_0x6ee1a8){logger['info'](_0x0bd5('0x1a'),_0x4008bd);logger[_0x0bd5('0x11')](_0x0bd5('0x1a'),_0x4008bd,JSON['stringify'](_0x6ee1a8));_0x527c37(_0x6ee1a8);})[_0x0bd5('0x19')](function(_0x4a8787){logger['error'](_0x0bd5('0x1a'),_0x4a8787[_0x0bd5('0x17')],_0x4008bd);_0x5ba943(_0x2dc1e5[_0x0bd5('0x15')](0x1f4,_0x4a8787['message']));});});};exports[_0x0bd5('0x1e')]=function(_0x5eab3e){var _0x456e87=this;return new Promise(function(_0x3ffb08,_0x18cec3){return db[_0x0bd5('0x1f')][_0x0bd5('0x20')](_0x5eab3e[_0x0bd5('0x21')],{'raw':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')][_0x0bd5('0x22')]||null:null,'attributes':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['attributes']||null:null,'limit':_0x5eab3e[_0x0bd5('0x1b')]?_0x5eab3e[_0x0bd5('0x1b')]['limit']||null:null})[_0x0bd5('0x1d')](function(_0x8eccc9){logger['info'](_0x0bd5('0x1e'),_0x5eab3e);logger[_0x0bd5('0x11')](_0x0bd5('0x1e'),_0x5eab3e,JSON[_0x0bd5('0x14')](_0x8eccc9));_0x3ffb08(_0x8eccc9);})['catch'](function(_0x440e69){logger[_0x0bd5('0x15')](_0x0bd5('0x1e'),_0x440e69[_0x0bd5('0x17')],_0x5eab3e);_0x18cec3(_0x456e87[_0x0bd5('0x15')](0x1f4,_0x440e69[_0x0bd5('0x17')]));});});};
\ No newline at end of file
index 3384e42..af9ba5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9de6=['faxMessage:','./faxMessage.events','save','remove','removeListener','register','length'];(function(_0x161ac1,_0x1e3e77){var _0x25093b=function(_0x230d73){while(--_0x230d73){_0x161ac1['push'](_0x161ac1['shift']());}};_0x25093b(++_0x1e3e77);}(_0x9de6,0xda));var _0x69de=function(_0x1a65aa,_0x548728){_0x1a65aa=_0x1a65aa-0x0;var _0x38b434=_0x9de6[_0x1a65aa];return _0x38b434;};'use strict';var FaxMessageEvents=require(_0x69de('0x0'));var events=[_0x69de('0x1'),_0x69de('0x2'),'update'];function createListener(_0x5edb1a,_0xb6a6d0){return function(_0x4c0338){_0xb6a6d0['emit'](_0x5edb1a,_0x4c0338);};}function removeListener(_0x5d04d0,_0x3d5e61){return function(){FaxMessageEvents[_0x69de('0x3')](_0x5d04d0,_0x3d5e61);};}exports[_0x69de('0x4')]=function(_0x3370ce){for(var _0x55720e=0x0,_0x2788af=events[_0x69de('0x5')];_0x55720e<_0x2788af;_0x55720e++){var _0x3e9c1a=events[_0x55720e];var _0x4bbbe4=createListener(_0x69de('0x6')+_0x3e9c1a,_0x3370ce);FaxMessageEvents['on'](_0x3e9c1a,_0x4bbbe4);}};
\ No newline at end of file
+var _0x147b=['length','./faxMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x1a7622,_0x2f0d3f){var _0x9eb3d3=function(_0x53c4f1){while(--_0x53c4f1){_0x1a7622['push'](_0x1a7622['shift']());}};_0x9eb3d3(++_0x2f0d3f);}(_0x147b,0x159));var _0xb147=function(_0x2740d9,_0xfcea46){_0x2740d9=_0x2740d9-0x0;var _0x1c5f67=_0x147b[_0x2740d9];return _0x1c5f67;};'use strict';var FaxMessageEvents=require(_0xb147('0x0'));var events=[_0xb147('0x1'),_0xb147('0x2'),_0xb147('0x3')];function createListener(_0x43c552,_0x378c0c){return function(_0xe594d0){_0x378c0c[_0xb147('0x4')](_0x43c552,_0xe594d0);};}function removeListener(_0x1f5e14,_0x43fc08){return function(){FaxMessageEvents[_0xb147('0x5')](_0x1f5e14,_0x43fc08);};}exports[_0xb147('0x6')]=function(_0x3cc67e){for(var _0x519e54=0x0,_0x399db4=events[_0xb147('0x7')];_0x519e54<_0x399db4;_0x519e54++){var _0x2c7a2b=events[_0x519e54];var _0x344920=createListener('faxMessage:'+_0x2c7a2b,_0x3cc67e);FaxMessageEvents['on'](_0x2c7a2b,_0x344920);}};
\ No newline at end of file
index fd9d856..98343c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x222f=['/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','/:id/download','post','tracked','fax','create','put','update','/:id/accept'];(function(_0xd8a959,_0x169203){var _0x536e01=function(_0x16fb33){while(--_0x16fb33){_0xd8a959['push'](_0xd8a959['shift']());}};_0x536e01(++_0x169203);}(_0x222f,0x1a4));var _0xf222=function(_0x1fdce6,_0x4412d9){_0x1fdce6=_0x1fdce6-0x0;var _0x36b546=_0x222f[_0x1fdce6];return _0x36b546;};'use strict';var multer=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var path=require(_0xf222('0x2'));var timeout=require(_0xf222('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf222('0x4'));var auth=require(_0xf222('0x5'));var interaction=require(_0xf222('0x6'));var config=require(_0xf222('0x7'));var controller=require('./faxMessage.controller');router[_0xf222('0x8')]('/',auth['isAuthenticated'](),controller[_0xf222('0x9')]);router[_0xf222('0x8')]('/describe',auth[_0xf222('0xa')](),controller[_0xf222('0xb')]);router['get'](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0xd')]);router[_0xf222('0x8')](_0xf222('0xe'),auth[_0xf222('0xa')](),controller['download']);router[_0xf222('0xf')]('/',auth[_0xf222('0xa')](),interaction[_0xf222('0x10')](_0xf222('0x11'),'faxmessage:create'),controller[_0xf222('0x12')]);router[_0xf222('0x13')](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0x14')]);router[_0xf222('0x13')](_0xf222('0x15'),auth[_0xf222('0xa')](),controller['accept']);router['put'](_0xf222('0x16'),auth[_0xf222('0xa')](),controller['reject']);router[_0xf222('0x17')](_0xf222('0xc'),auth[_0xf222('0xa')](),controller[_0xf222('0x18')]);module[_0xf222('0x19')]=router;
\ No newline at end of file
+var _0xf290=['/:id','show','/:id/download','download','post','fax','create','put','update','accept','/:id/reject','reject','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x1da5dd,_0x5ee653){var _0xb48f8a=function(_0x5a908b){while(--_0x5a908b){_0x1da5dd['push'](_0x1da5dd['shift']());}};_0xb48f8a(++_0x5ee653);}(_0xf290,0xde));var _0x0f29=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xf290[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require(_0x0f29('0x0'));var path=require('path');var timeout=require(_0x0f29('0x1'));var express=require('express');var router=express[_0x0f29('0x2')]();var fs_extra=require(_0x0f29('0x3'));var auth=require(_0x0f29('0x4'));var interaction=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var controller=require('./faxMessage.controller');router[_0x0f29('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f29('0x8')]);router[_0x0f29('0x7')](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xb')]);router[_0x0f29('0x7')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xd')]);router[_0x0f29('0x7')](_0x0f29('0xe'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xf')]);router[_0x0f29('0x10')]('/',auth[_0x0f29('0xa')](),interaction['tracked'](_0x0f29('0x11'),'faxmessage:create'),controller[_0x0f29('0x12')]);router[_0x0f29('0x13')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x14')]);router[_0x0f29('0x13')]('/:id/accept',auth[_0x0f29('0xa')](),controller[_0x0f29('0x15')]);router[_0x0f29('0x13')](_0x0f29('0x16'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x17')]);router[_0x0f29('0x18')](_0x0f29('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0f29('0x19')]=router;
\ No newline at end of file
index c159b72..5ee452d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5835=['roundrobin','sequelize','name','STRING','rrmemory'];(function(_0x1b76e6,_0x598520){var _0x333b53=function(_0x106e6a){while(--_0x106e6a){_0x1b76e6['push'](_0x1b76e6['shift']());}};_0x333b53(++_0x598520);}(_0x5835,0x123));var _0x5583=function(_0x349632,_0x55bd98){_0x349632=_0x349632-0x0;var _0x30c7b2=_0x5835[_0x349632];return _0x30c7b2;};'use strict';var Sequelize=require(_0x5583('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5583('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5583('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5583('0x3'),'beepall',_0x5583('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf526=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x15ad07,_0x39b691){var _0x313a4b=function(_0x33e9c8){while(--_0x33e9c8){_0x15ad07['push'](_0x15ad07['shift']());}};_0x313a4b(++_0x39b691);}(_0xf526,0x18a));var _0x6f52=function(_0x28b12f,_0x3133a1){_0x28b12f=_0x28b12f-0x0;var _0x12c94b=_0xf526[_0x28b12f];return _0x12c94b;};'use strict';var Sequelize=require(_0x6f52('0x0'));module[_0x6f52('0x1')]={'name':{'type':Sequelize[_0x6f52('0x2')],'unique':_0x6f52('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6f52('0x2')]},'timeout':{'type':Sequelize[_0x6f52('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6f52('0x5')](_0x6f52('0x6'),_0x6f52('0x7'),_0x6f52('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index a6ad719..9dbeecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x104d=['FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','VIRTUAL','filter','where','includeAll','show','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','options','findAll','User','UserId','faxPause','createdAt','rows','format','updatedAt','getTeams','addTeams','ids','Team','Agents','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','every','TeamId','all','union','userFaxQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','destroy','then','get','FaxQueues','error','stack','name','send','map'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x104d,0x1ee));var _0xd104=function(_0xf35bd4,_0x51ff64){_0xf35bd4=_0xf35bd4-0x0;var _0x47912b=_0x104d[_0xf35bd4];return _0x47912b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd104('0x0'));var rp=require('request-promise');var moment=require(_0xd104('0x1'));var BPromise=require(_0xd104('0x2'));var Mustache=require(_0xd104('0x3'));var util=require(_0xd104('0x4'));var path=require(_0xd104('0x5'));var sox=require(_0xd104('0x6'));var csv=require(_0xd104('0x7'));var ejs=require(_0xd104('0x8'));var fs=require('fs');var fs_extra=require(_0xd104('0x9'));var _=require(_0xd104('0xa'));var squel=require(_0xd104('0xb'));var crypto=require(_0xd104('0xc'));var jsforce=require(_0xd104('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd104('0x7'));var querystring=require(_0xd104('0xe'));var Papa=require('papaparse');var Redis=require(_0xd104('0xf'));var authService=require(_0xd104('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd104('0x11'));var hardwareService=require(_0xd104('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xd104('0x13'));var config=require(_0xd104('0x14'));var licenseUtil=require(_0xd104('0x15'));var db=require(_0xd104('0x16'))['db'];config[_0xd104('0x17')]=_[_0xd104('0x18')](config[_0xd104('0x17')],{'host':_0xd104('0x19'),'port':0x18eb});var socket=require(_0xd104('0x1a'))(new Redis(config[_0xd104('0x17')]));require(_0xd104('0x1b'))[_0xd104('0x1c')](socket);function respondWithStatusCode(_0x299991,_0x44315f){_0x44315f=_0x44315f||0xcc;return function(_0x237288){if(_0x237288){return _0x299991[_0xd104('0x1d')](_0x44315f);}return _0x299991[_0xd104('0x1e')](_0x44315f)[_0xd104('0x1f')]();};}function respondWithResult(_0x4164b3,_0x5a1baf){_0x5a1baf=_0x5a1baf||0xc8;return function(_0x3d65c3){if(_0x3d65c3){return _0x4164b3[_0xd104('0x1e')](_0x5a1baf)['json'](_0x3d65c3);}};}function respondWithFilteredResult(_0x5587d9,_0x4d9e16){return function(_0x390415){if(_0x390415){var _0x38b804=typeof _0x4d9e16[_0xd104('0x20')]===_0xd104('0x21')&&typeof _0x4d9e16['limit']===_0xd104('0x21');var _0x30328d=_0x390415[_0xd104('0x22')];var _0x3f9b57=_0x38b804?0x0:_0x4d9e16[_0xd104('0x20')];var _0x3cbee4=_0x38b804?_0x390415[_0xd104('0x22')]:_0x4d9e16[_0xd104('0x20')]+_0x4d9e16[_0xd104('0x23')];var _0x114dd0;if(_0x3cbee4>=_0x30328d){_0x3cbee4=_0x30328d;_0x114dd0=0xc8;}else{_0x114dd0=0xce;}_0x5587d9['status'](_0x114dd0);return _0x5587d9[_0xd104('0x24')]('Content-Range',_0x3f9b57+'-'+_0x3cbee4+'/'+_0x30328d)[_0xd104('0x25')](_0x390415);}return null;};}function patchUpdates(_0x2e169d){return function(_0x41b10d){try{jsonpatch[_0xd104('0x26')](_0x41b10d,_0x2e169d,!![]);}catch(_0x1d822b){return BPromise[_0xd104('0x27')](_0x1d822b);}return _0x41b10d[_0xd104('0x28')]();};}function saveUpdates(_0x16200d,_0x34d917){return function(_0x356d25){if(_0x356d25){return _0x356d25['update'](_0x16200d)['then'](function(_0x28d4ad){return _0x28d4ad;});}return null;};}function removeEntity(_0x552458,_0x11b52d){return function(_0x250060){if(_0x250060){return _0x250060[_0xd104('0x29')]()[_0xd104('0x2a')](function(){var _0x10e062=_0x250060[_0xd104('0x2b')]({'plain':!![]});var _0x192298=_0xd104('0x2c');return db['UserProfileResource'][_0xd104('0x29')]({'where':{'type':_0x192298,'resourceId':_0x10e062['id']}})['then'](function(){return _0x250060;});})[_0xd104('0x2a')](function(){_0x552458['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20f577,_0xef6df4){return function(_0x4b761b){if(!_0x4b761b){_0x20f577[_0xd104('0x1d')](0x194);}return _0x4b761b;};}function handleError(_0x58413d,_0x80ec43){_0x80ec43=_0x80ec43||0x1f4;return function(_0xa7b80c){logger[_0xd104('0x2d')](_0xa7b80c[_0xd104('0x2e')]);if(_0xa7b80c[_0xd104('0x2f')]){delete _0xa7b80c[_0xd104('0x2f')];}_0x58413d[_0xd104('0x1e')](_0x80ec43)[_0xd104('0x30')](_0xa7b80c);};}exports['index']=function(_0xacec4d,_0x7a8a0f){var _0x49208b={},_0xb0ea54={},_0x5bcfb0={'count':0x0,'rows':[]};var _0x3c2fba=_[_0xd104('0x31')](db[_0xd104('0x32')][_0xd104('0x33')],function(_0x2c3c5e){return{'name':_0x2c3c5e[_0xd104('0x34')],'type':_0x2c3c5e[_0xd104('0x35')][_0xd104('0x36')]};});_0xb0ea54[_0xd104('0x37')]=_[_0xd104('0x31')](_0x3c2fba,'name');_0xb0ea54[_0xd104('0x38')]=_[_0xd104('0x39')](_0xacec4d[_0xd104('0x38')]);_0xb0ea54['filters']=_[_0xd104('0x3a')](_0xb0ea54['model'],_0xb0ea54[_0xd104('0x38')]);_0x49208b[_0xd104('0x3b')]=_[_0xd104('0x3a')](_0xb0ea54[_0xd104('0x37')],qs[_0xd104('0x3c')](_0xacec4d[_0xd104('0x38')][_0xd104('0x3c')]));_0x49208b[_0xd104('0x3b')]=_0x49208b[_0xd104('0x3b')][_0xd104('0x3d')]?_0x49208b[_0xd104('0x3b')]:_0xb0ea54[_0xd104('0x37')];if(!_0xacec4d['query'][_0xd104('0x3e')](_0xd104('0x3f'))){_0x49208b[_0xd104('0x23')]=qs[_0xd104('0x23')](_0xacec4d['query']['limit']);_0x49208b[_0xd104('0x20')]=qs['offset'](_0xacec4d[_0xd104('0x38')]['offset']);}_0x49208b[_0xd104('0x40')]=qs['sort'](_0xacec4d[_0xd104('0x38')][_0xd104('0x41')]);_0x49208b['where']=qs[_0xd104('0x42')](_[_0xd104('0x43')](_0xacec4d[_0xd104('0x38')],_0xb0ea54[_0xd104('0x42')]),_0x3c2fba);if(_0xacec4d[_0xd104('0x38')]['filter']){_0x49208b['where']=_[_0xd104('0x44')](_0x49208b['where'],{'$or':_[_0xd104('0x31')](_0x3c2fba,function(_0x38b11c){if(_0x38b11c[_0xd104('0x35')]!==_0xd104('0x45')){var _0x21242d={};_0x21242d[_0x38b11c[_0xd104('0x2f')]]={'$like':'%'+_0xacec4d[_0xd104('0x38')][_0xd104('0x46')]+'%'};return _0x21242d;}})});}_0x49208b=_['merge']({},_0x49208b,_0xacec4d['options']);var _0x8ff7c7={'where':_0x49208b[_0xd104('0x47')]};return db[_0xd104('0x32')][_0xd104('0x22')](_0x8ff7c7)[_0xd104('0x2a')](function(_0x1b3091){_0x5bcfb0[_0xd104('0x22')]=_0x1b3091;if(_0xacec4d[_0xd104('0x38')][_0xd104('0x48')]){_0x49208b['include']=[{'all':!![]}];}return db[_0xd104('0x32')]['findAll'](_0x49208b);})[_0xd104('0x2a')](function(_0x18e167){_0x5bcfb0['rows']=_0x18e167;return _0x5bcfb0;})[_0xd104('0x2a')](respondWithFilteredResult(_0x7a8a0f,_0x49208b))['catch'](handleError(_0x7a8a0f,null));};exports[_0xd104('0x49')]=function(_0x12f1d5,_0x1e4fb9){var _0x25128b={'raw':!![],'where':{'id':_0x12f1d5['params']['id']}},_0x26811b={};_0x26811b[_0xd104('0x37')]=_[_0xd104('0x39')](db[_0xd104('0x32')]['rawAttributes']);_0x26811b['query']=_[_0xd104('0x39')](_0x12f1d5[_0xd104('0x38')]);_0x26811b['filters']=_[_0xd104('0x3a')](_0x26811b[_0xd104('0x37')],_0x26811b[_0xd104('0x38')]);_0x25128b['attributes']=_[_0xd104('0x3a')](_0x26811b[_0xd104('0x37')],qs['fields'](_0x12f1d5['query'][_0xd104('0x3c')]));_0x25128b[_0xd104('0x3b')]=_0x25128b['attributes'][_0xd104('0x3d')]?_0x25128b['attributes']:_0x26811b[_0xd104('0x37')];if(_0x12f1d5['query']['includeAll']){_0x25128b[_0xd104('0x4a')]=[{'all':!![]}];}_0x25128b=_[_0xd104('0x44')]({},_0x25128b,_0x12f1d5['options']);return db[_0xd104('0x32')][_0xd104('0x4b')](_0x25128b)[_0xd104('0x2a')](handleEntityNotFound(_0x1e4fb9,null))[_0xd104('0x2a')](respondWithResult(_0x1e4fb9,null))[_0xd104('0x4c')](handleError(_0x1e4fb9,null));};exports[_0xd104('0x4d')]=function(_0x5855b5,_0xe28e8a){return db[_0xd104('0x32')][_0xd104('0x4d')](_0x5855b5[_0xd104('0x4e')],{})[_0xd104('0x2a')](function(_0x564c5b){var _0x19b3b7=_0x5855b5[_0xd104('0x4f')]['get']({'plain':!![]});if(!_0x19b3b7)throw new Error(_0xd104('0x50'));if(_0x19b3b7[_0xd104('0x51')]===_0xd104('0x4f')){var _0xe1bd76=_0x564c5b[_0xd104('0x2b')]({'plain':!![]});var _0x216cb2='FaxQueues';return db[_0xd104('0x52')][_0xd104('0x4b')]({'where':{'name':_0x216cb2,'userProfileId':_0x19b3b7['userProfileId']},'raw':!![]})['then'](function(_0x767d3f){if(_0x767d3f&&_0x767d3f[_0xd104('0x53')]===0x0){return db[_0xd104('0x54')][_0xd104('0x4d')]({'name':_0xe1bd76[_0xd104('0x2f')],'resourceId':_0xe1bd76['id'],'type':_0x767d3f[_0xd104('0x2f')],'sectionId':_0x767d3f['id']},{})[_0xd104('0x2a')](function(){return _0x564c5b;});}else{return _0x564c5b;}})[_0xd104('0x4c')](function(_0x4dc858){logger[_0xd104('0x2d')](_0xd104('0x55'),_0x4dc858);throw _0x4dc858;});}return _0x564c5b;})['then'](respondWithResult(_0xe28e8a,0xc9))[_0xd104('0x4c')](handleError(_0xe28e8a,null));};exports['update']=function(_0x386be0,_0x28c218){if(_0x386be0[_0xd104('0x4e')]['id']){delete _0x386be0['body']['id'];}return db['FaxQueue']['find']({'where':{'id':_0x386be0['params']['id']}})['then'](handleEntityNotFound(_0x28c218,null))[_0xd104('0x2a')](saveUpdates(_0x386be0['body'],null))[_0xd104('0x2a')](respondWithResult(_0x28c218,null))[_0xd104('0x4c')](handleError(_0x28c218,null));};exports[_0xd104('0x29')]=function(_0x3661b5,_0xdefc62){return db['FaxQueue'][_0xd104('0x4b')]({'where':{'id':_0x3661b5[_0xd104('0x56')]['id']}})[_0xd104('0x2a')](handleEntityNotFound(_0xdefc62,null))[_0xd104('0x2a')](removeEntity(_0xdefc62,null))[_0xd104('0x4c')](handleError(_0xdefc62,null));};exports[_0xd104('0x57')]=function(_0x124d91,_0x6edbb4){return db[_0xd104('0x32')][_0xd104('0x57')]()['then'](respondWithResult(_0x6edbb4,null))[_0xd104('0x4c')](handleError(_0x6edbb4,null));};exports[_0xd104('0x58')]=function(_0x201577,_0x72f8a5,_0x392c6f){var _0x3e85f7={'raw':!![],'where':{}},_0x45fdf2={},_0x184358;return db[_0xd104('0x32')][_0xd104('0x59')]({'where':{'id':_0x201577[_0xd104('0x56')]['id']}})[_0xd104('0x2a')](handleEntityNotFound(_0x72f8a5,null))[_0xd104('0x2a')](function(_0x1865f6){if(_0x1865f6){_0x184358=_0x1865f6[_0xd104('0x2b')]({'plain':!![]});_0x45fdf2['model']=_[_0xd104('0x39')](db[_0xd104('0x5a')][_0xd104('0x33')]);_0x45fdf2['query']=_[_0xd104('0x39')](_0x201577[_0xd104('0x38')]);_0x45fdf2[_0xd104('0x42')]=_[_0xd104('0x3a')](_0x45fdf2[_0xd104('0x37')],_0x45fdf2[_0xd104('0x38')]);_0x3e85f7[_0xd104('0x3b')]=_[_0xd104('0x3a')](_0x45fdf2[_0xd104('0x37')],qs['fields'](_0x201577[_0xd104('0x38')][_0xd104('0x3c')]));_0x3e85f7['attributes']=_0x3e85f7[_0xd104('0x3b')][_0xd104('0x3d')]?_0x3e85f7['attributes']:_0x45fdf2[_0xd104('0x37')];if(!_0x201577['query'][_0xd104('0x3e')](_0xd104('0x3f'))){_0x3e85f7[_0xd104('0x23')]=qs[_0xd104('0x23')](_0x201577[_0xd104('0x38')][_0xd104('0x23')]);_0x3e85f7[_0xd104('0x20')]=qs['offset'](_0x201577['query'][_0xd104('0x20')]);}_0x3e85f7[_0xd104('0x40')]=qs[_0xd104('0x41')](_0x201577['query'][_0xd104('0x41')]);_0x3e85f7[_0xd104('0x47')]=qs[_0xd104('0x42')](_[_0xd104('0x43')](_0x201577[_0xd104('0x38')],_0x45fdf2[_0xd104('0x42')]));_0x3e85f7[_0xd104('0x47')]['FaxQueueId']=_0x1865f6['id'];if(_0x201577['query']['filter']){_0x3e85f7['where']=_[_0xd104('0x44')](_0x3e85f7['where'],{'$or':_[_0xd104('0x31')](_0x3e85f7['attributes'],function(_0x4779d0){var _0x1081a4={};_0x1081a4[_0x4779d0]={'$like':'%'+_0x201577[_0xd104('0x38')][_0xd104('0x46')]+'%'};return _0x1081a4;})});}_0x3e85f7=_[_0xd104('0x44')]({},_0x3e85f7,_0x201577[_0xd104('0x5b')]);return db[_0xd104('0x5a')][_0xd104('0x5c')](_0x3e85f7);}})['then'](function(_0x1e4ab4){if(_0x1e4ab4){return db[_0xd104('0x5d')]['findAndCountAll']({'where':{'id':_[_0xd104('0x31')](_0x1e4ab4,_0xd104('0x5e')),'role':'agent'},'attributes':['id','name',_0xd104('0x5f'),'updatedAt',_0xd104('0x60')]});}})['then'](function(_0x4d644c){if(_0x4d644c){return{'count':_0x4d644c[_0xd104('0x22')],'rows':_[_0xd104('0x31')](_0x4d644c[_0xd104('0x61')],function(_0x9767c6){return{'membername':_0x9767c6[_0xd104('0x2f')],'UserId':_0x9767c6['id'],'queue_name':_0x184358[_0xd104('0x2f')],'FaxQueueId':_0x184358['id'],'interface':util[_0xd104('0x62')]('%s/%s','SIP',_0x9767c6[_0xd104('0x2f')]),'penalty':0x0,'paused':_0x9767c6[_0xd104('0x5f')],'createdAt':_0x9767c6[_0xd104('0x60')],'updatedAt':_0x9767c6[_0xd104('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd104('0x2a')](respondWithFilteredResult(_0x72f8a5,_0x3e85f7))[_0xd104('0x4c')](handleError(_0x72f8a5,null));};exports[_0xd104('0x64')]=function(_0x4bb43d,_0x1dc36b,_0xce5892){var _0x48873d={};var _0x38abf9={};var _0x2af637;var _0x4811e7;return db[_0xd104('0x32')][_0xd104('0x59')]({'where':{'id':_0x4bb43d[_0xd104('0x56')]['id']}})['then'](handleEntityNotFound(_0x1dc36b,null))['then'](function(_0x1e8587){if(_0x1e8587){_0x2af637=_0x1e8587;_0x38abf9[_0xd104('0x37')]=_[_0xd104('0x39')](db['Team'][_0xd104('0x33')]);_0x38abf9[_0xd104('0x38')]=_[_0xd104('0x39')](_0x4bb43d['query']);_0x38abf9[_0xd104('0x42')]=_[_0xd104('0x3a')](_0x38abf9[_0xd104('0x37')],_0x38abf9[_0xd104('0x38')]);_0x48873d[_0xd104('0x3b')]=_[_0xd104('0x3a')](_0x38abf9[_0xd104('0x37')],qs[_0xd104('0x3c')](_0x4bb43d[_0xd104('0x38')][_0xd104('0x3c')]));_0x48873d[_0xd104('0x3b')]=_0x48873d['attributes']['length']?_0x48873d[_0xd104('0x3b')]:_0x38abf9[_0xd104('0x37')];_0x48873d['order']=qs[_0xd104('0x41')](_0x4bb43d['query'][_0xd104('0x41')]);_0x48873d[_0xd104('0x47')]=qs[_0xd104('0x42')](_[_0xd104('0x43')](_0x4bb43d[_0xd104('0x38')],_0x38abf9[_0xd104('0x42')]));if(_0x4bb43d[_0xd104('0x38')][_0xd104('0x46')]){_0x48873d[_0xd104('0x47')]=_[_0xd104('0x44')](_0x48873d[_0xd104('0x47')],{'$or':_[_0xd104('0x31')](_0x48873d[_0xd104('0x3b')],function(_0x5a26e5){var _0x57e04e={};_0x57e04e[_0x5a26e5]={'$like':'%'+_0x4bb43d['query']['filter']+'%'};return _0x57e04e;})});}_0x48873d=_[_0xd104('0x44')]({},_0x48873d,_0x4bb43d[_0xd104('0x5b')]);return _0x2af637['getTeams'](_0x48873d);}})[_0xd104('0x2a')](function(_0x241a31){if(_0x241a31){_0x4811e7=_0x241a31[_0xd104('0x3d')];if(!_0x4bb43d[_0xd104('0x38')][_0xd104('0x3e')](_0xd104('0x3f'))){_0x48873d['limit']=qs[_0xd104('0x23')](_0x4bb43d[_0xd104('0x38')]['limit']);_0x48873d['offset']=qs[_0xd104('0x20')](_0x4bb43d[_0xd104('0x38')][_0xd104('0x20')]);}return _0x2af637['getTeams'](_0x48873d);}})[_0xd104('0x2a')](function(_0x476ecb){if(_0x476ecb){return _0x476ecb?{'count':_0x4811e7,'rows':_0x476ecb}:null;}})[_0xd104('0x2a')](respondWithResult(_0x1dc36b,null))[_0xd104('0x4c')](handleError(_0x1dc36b,null));};exports[_0xd104('0x65')]=function(_0x2f1e1a,_0x363410,_0x163687){var _0x590721=_0x2f1e1a[_0xd104('0x4e')][_0xd104('0x66')];return db[_0xd104('0x67')][_0xd104('0x5c')]({'where':{'id':_0x590721},'attributes':['id'],'include':[{'model':db[_0xd104('0x5d')],'as':_0xd104('0x68'),'attributes':['id',_0xd104('0x2f'),'online','voicePause',_0xd104('0x69')],'raw':!![]}]})['then'](function(_0x130976){if(_0x130976){var _0x104b6f=_[_0xd104('0x6a')](_0x130976,function(_0x572d2f){var _0x525968=_0x572d2f[_0xd104('0x2b')]({'plain':!![]});return _0x525968[_0xd104('0x68')];});return db['FaxQueue'][_0xd104('0x4b')]({'where':{'id':_0x2f1e1a[_0xd104('0x56')]['id']}})[_0xd104('0x2a')](function(_0x4e27de){return db['sequelize'][_0xd104('0x6b')](function(_0x47ac12){return _0x4e27de[_0xd104('0x65')](_0x590721,{'transaction':_0x47ac12})['then'](function(){return BPromise[_0xd104('0x6c')](_0x104b6f,function(_0x545f3d){return db[_0xd104('0x5a')][_0xd104('0x6d')]({'where':{'UserId':_0x545f3d['id'],'FaxQueueId':_0x2f1e1a[_0xd104('0x56')]['id']},'transaction':_0x47ac12});});})[_0xd104('0x2a')](function(){_0x104b6f[_0xd104('0x6e')](function(_0x5f0a48){socket[_0xd104('0x6f')](_0xd104('0x70'),{'UserId':_0x5f0a48['id'],'FaxQueueId':_0x4e27de['id']});});});});});}})[_0xd104('0x2a')](respondWithStatusCode(_0x363410,null))[_0xd104('0x4c')](handleError(_0x363410,null));};exports[_0xd104('0x71')]=function(_0x296a04,_0xfbfd23,_0x36a4a8){return db[_0xd104('0x67')][_0xd104('0x5c')]({'where':{'id':_0x296a04[_0xd104('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd104('0x5d')],'as':_0xd104('0x68'),'attributes':['id'],'raw':!![]}]})[_0xd104('0x2a')](handleEntityNotFound(_0xfbfd23,null))[_0xd104('0x2a')](function(_0x2132c8){var _0x307271=_[_0xd104('0x31')](_0x2132c8,'id');var _0xa39de4=[];var _0x81f97a=[];var _0xad6631=squel[_0xd104('0x72')]();_0xad6631[_0xd104('0x73')](_0xd104('0x74'))[_0xd104('0x75')]('team_has_fax_queues','tq')[_0xd104('0x76')](_0xd104('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd104('0x47')](_0xd104('0x78'),_0x296a04[_0xd104('0x56')]['id']);for(var _0x35a90e=0x0;_0x35a90e<_0x2132c8['length'];_0x35a90e+=0x1){let _0x3a01e7=_0x2132c8[_0x35a90e];for(var _0x5362d7=0x0;_0x5362d7<_0x3a01e7[_0xd104('0x68')][_0xd104('0x3d')];_0x5362d7+=0x1){let _0x7a32a3=_0x3a01e7[_0xd104('0x68')][_0x5362d7];var _0x2b9942=_0xad6631[_0xd104('0x79')]();_0x2b9942[_0xd104('0x47')](_0xd104('0x7a'),_0x7a32a3['id']);_0x81f97a[_0xd104('0x7b')](db[_0xd104('0x7c')]['query'](_0x2b9942[_0xd104('0x7d')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0xd104('0x2a')](function(_0x3c2a9b){if(_0x3c2a9b[_0xd104('0x3d')]===0x1){return _0x7a32a3['id'];}else{var _0x551847=_[_0xd104('0x7e')](_[_0xd104('0x31')](_0x3c2a9b,_0xd104('0x7f')),function(_0x6e5e38){return _['includes'](_0x307271,_0x6e5e38);});if(_0x551847){return _0x7a32a3['id'];}}}));}}return BPromise[_0xd104('0x80')](_0x81f97a)['then'](function(_0x516539){_0xa39de4=_(_0xa39de4)[_0xd104('0x81')](_0x516539)['compact']()['value']();return db[_0xd104('0x32')][_0xd104('0x4b')]({'where':{'id':_0x296a04['params']['id']}})[_0xd104('0x2a')](function(_0x4e301b){return db['sequelize'][_0xd104('0x6b')](function(_0x3fe696){return _0x4e301b['removeTeams'](_0x296a04[_0xd104('0x38')][_0xd104('0x66')],{'transaction':_0x3fe696})['then'](function(){if(!_['isEmpty'](_0xa39de4)){return _0x4e301b['removeAgents'](_0xa39de4,{'transaction':_0x3fe696});}})[_0xd104('0x2a')](function(){_0xa39de4[_0xd104('0x6e')](function(_0x382a3a){socket['emit'](_0xd104('0x82'),{'UserId':_0x382a3a,'FaxQueueId':_0x4e301b['id']});});});});});});})['then'](respondWithStatusCode(_0xfbfd23,null))[_0xd104('0x4c')](handleError(_0xfbfd23,null));};exports[_0xd104('0x83')]=function(_0x32f36c,_0xc4928f,_0x3048bc){return db['FaxQueue'][_0xd104('0x4b')]({'where':{'id':_0x32f36c[_0xd104('0x56')]['id']}})[_0xd104('0x2a')](handleEntityNotFound(_0xc4928f,null))[_0xd104('0x2a')](function(_0x44490b){if(_0x44490b){return _0x44490b[_0xd104('0x83')](_0x32f36c[_0xd104('0x4e')][_0xd104('0x66')],_[_0xd104('0x84')](_0x32f36c[_0xd104('0x4e')],[_0xd104('0x66'),'id'])||{})['spread'](function(_0x16b246){for(var _0x36bc41=0x0;_0x36bc41<_0x32f36c['body'][_0xd104('0x66')][_0xd104('0x3d')];_0x36bc41+=0x1){socket[_0xd104('0x6f')](_0xd104('0x70'),{'UserId':Number(_0x32f36c[_0xd104('0x4e')][_0xd104('0x66')][_0x36bc41]),'FaxQueueId':Number(_0x32f36c['params']['id'])});}return _0x16b246;});}})[_0xd104('0x2a')](respondWithResult(_0xc4928f,null))[_0xd104('0x4c')](handleError(_0xc4928f,null));};exports[_0xd104('0x85')]=function(_0x29ef48,_0x80e420,_0x301b44){return db['FaxQueue']['find']({'where':{'id':_0x29ef48['params']['id']}})['then'](handleEntityNotFound(_0x80e420,null))[_0xd104('0x2a')](function(_0x554593){if(_0x554593){return _0x554593[_0xd104('0x85')](_0x29ef48['query'][_0xd104('0x66')])[_0xd104('0x2a')](function(){if(_[_0xd104('0x86')](_0x29ef48[_0xd104('0x38')][_0xd104('0x66')])){for(var _0x38f865=0x0;_0x38f865<_0x29ef48[_0xd104('0x38')]['ids'][_0xd104('0x3d')];_0x38f865+=0x1){socket[_0xd104('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x29ef48[_0xd104('0x38')][_0xd104('0x66')][_0x38f865]),'FaxQueueId':Number(_0x29ef48[_0xd104('0x56')]['id'])});}}else{socket[_0xd104('0x6f')](_0xd104('0x82'),{'UserId':Number(_0x29ef48[_0xd104('0x38')][_0xd104('0x66')]),'FaxQueueId':Number(_0x29ef48[_0xd104('0x56')]['id'])});}});}})[_0xd104('0x2a')](respondWithStatusCode(_0x80e420,null))['catch'](handleError(_0x80e420,null));};exports[_0xd104('0x87')]=function(_0x59e17d,_0x559a18,_0x6e8aa9){var _0x11959d={};var _0x51ca34={};var _0x389ea4;var _0x4fc781;return db['FaxQueue']['findOne']({'where':{'id':_0x59e17d[_0xd104('0x56')]['id']}})['then'](handleEntityNotFound(_0x559a18,null))[_0xd104('0x2a')](function(_0x34b37a){if(_0x34b37a){_0x389ea4=_0x34b37a;_0x51ca34[_0xd104('0x37')]=_[_0xd104('0x39')](db[_0xd104('0x5d')]['rawAttributes']);_0x51ca34[_0xd104('0x38')]=_[_0xd104('0x39')](_0x59e17d['query']);_0x51ca34['filters']=_[_0xd104('0x3a')](_0x51ca34[_0xd104('0x37')],_0x51ca34[_0xd104('0x38')]);_0x11959d[_0xd104('0x3b')]=_[_0xd104('0x3a')](_0x51ca34[_0xd104('0x37')],qs[_0xd104('0x3c')](_0x59e17d[_0xd104('0x38')]['fields']));_0x11959d[_0xd104('0x3b')]=_0x11959d[_0xd104('0x3b')]['length']?_0x11959d[_0xd104('0x3b')]:_0x51ca34[_0xd104('0x37')];_0x11959d[_0xd104('0x40')]=qs['sort'](_0x59e17d[_0xd104('0x38')][_0xd104('0x41')]);_0x11959d['where']=qs[_0xd104('0x42')](_[_0xd104('0x43')](_0x59e17d[_0xd104('0x38')],_0x51ca34[_0xd104('0x42')]));if(_0x59e17d[_0xd104('0x38')][_0xd104('0x46')]){_0x11959d[_0xd104('0x47')]=_[_0xd104('0x44')](_0x11959d[_0xd104('0x47')],{'$or':_[_0xd104('0x31')](_0x11959d[_0xd104('0x3b')],function(_0x35d836){var _0x2e23ac={};_0x2e23ac[_0x35d836]={'$like':'%'+_0x59e17d['query'][_0xd104('0x46')]+'%'};return _0x2e23ac;})});}_0x11959d=_[_0xd104('0x44')]({},_0x11959d,_0x59e17d[_0xd104('0x5b')]);return _0x389ea4[_0xd104('0x87')](_0x11959d);}})[_0xd104('0x2a')](function(_0x20bf9e){if(_0x20bf9e){_0x4fc781=_0x20bf9e[_0xd104('0x3d')];if(!_0x59e17d[_0xd104('0x38')][_0xd104('0x3e')](_0xd104('0x3f'))){_0x11959d[_0xd104('0x23')]=qs['limit'](_0x59e17d[_0xd104('0x38')][_0xd104('0x23')]);_0x11959d[_0xd104('0x20')]=qs[_0xd104('0x20')](_0x59e17d['query'][_0xd104('0x20')]);}return _0x389ea4[_0xd104('0x87')](_0x11959d);}})[_0xd104('0x2a')](function(_0x37249e){if(_0x37249e){return _0x37249e?{'count':_0x4fc781,'rows':_0x37249e}:null;}})[_0xd104('0x2a')](respondWithResult(_0x559a18,null))[_0xd104('0x4c')](handleError(_0x559a18,null));};
\ No newline at end of file
+var _0x7b81=['../../config/license/util','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','FaxQueues','UserProfileResource','end','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','order','sort','FaxQueueId','User','UserId','agent','faxPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','emit','userFaxQueue:save','select','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','value','removeTeams','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x7b81,0x101));var _0x17b8=function(_0x599dc1,_0x362b25){_0x599dc1=_0x599dc1-0x0;var _0x10eabc=_0x7b81[_0x599dc1];return _0x10eabc;};'use strict';var emlformat=require(_0x17b8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x17b8('0x1'));var rp=require(_0x17b8('0x2'));var moment=require(_0x17b8('0x3'));var BPromise=require(_0x17b8('0x4'));var Mustache=require(_0x17b8('0x5'));var util=require(_0x17b8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x17b8('0x7'));var ejs=require(_0x17b8('0x8'));var fs=require('fs');var fs_extra=require(_0x17b8('0x9'));var _=require(_0x17b8('0xa'));var squel=require(_0x17b8('0xb'));var crypto=require(_0x17b8('0xc'));var jsforce=require(_0x17b8('0xd'));var deskjs=require(_0x17b8('0xe'));var toCsv=require(_0x17b8('0x7'));var querystring=require(_0x17b8('0xf'));var Papa=require(_0x17b8('0x10'));var Redis=require(_0x17b8('0x11'));var authService=require(_0x17b8('0x12'));var qs=require(_0x17b8('0x13'));var as=require(_0x17b8('0x14'));var hardwareService=require(_0x17b8('0x15'));var logger=require(_0x17b8('0x16'))(_0x17b8('0x17'));var utils=require('../../config/utils');var config=require(_0x17b8('0x18'));var licenseUtil=require(_0x17b8('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x17b8('0x1a')],{'host':_0x17b8('0x1b'),'port':0x18eb});var socket=require(_0x17b8('0x1c'))(new Redis(config[_0x17b8('0x1a')]));require(_0x17b8('0x1d'))[_0x17b8('0x1e')](socket);function respondWithStatusCode(_0x54048f,_0x3feac8){_0x3feac8=_0x3feac8||0xcc;return function(_0x293d69){if(_0x293d69){return _0x54048f[_0x17b8('0x1f')](_0x3feac8);}return _0x54048f['status'](_0x3feac8)['end']();};}function respondWithResult(_0x2f16b5,_0x309df5){_0x309df5=_0x309df5||0xc8;return function(_0xe54076){if(_0xe54076){return _0x2f16b5[_0x17b8('0x20')](_0x309df5)[_0x17b8('0x21')](_0xe54076);}};}function respondWithFilteredResult(_0x5f0475,_0x21b7d8){return function(_0x136e36){if(_0x136e36){var _0x813df0=typeof _0x21b7d8['offset']===_0x17b8('0x22')&&typeof _0x21b7d8[_0x17b8('0x23')]===_0x17b8('0x22');var _0x2a66ca=_0x136e36[_0x17b8('0x24')];var _0x5c0773=_0x813df0?0x0:_0x21b7d8['offset'];var _0x914ebc=_0x813df0?_0x136e36[_0x17b8('0x24')]:_0x21b7d8[_0x17b8('0x25')]+_0x21b7d8[_0x17b8('0x23')];var _0x1799a3;if(_0x914ebc>=_0x2a66ca){_0x914ebc=_0x2a66ca;_0x1799a3=0xc8;}else{_0x1799a3=0xce;}_0x5f0475[_0x17b8('0x20')](_0x1799a3);return _0x5f0475[_0x17b8('0x26')](_0x17b8('0x27'),_0x5c0773+'-'+_0x914ebc+'/'+_0x2a66ca)[_0x17b8('0x21')](_0x136e36);}return null;};}function patchUpdates(_0x43c074){return function(_0x561701){try{jsonpatch[_0x17b8('0x28')](_0x561701,_0x43c074,!![]);}catch(_0x1f2b20){return BPromise[_0x17b8('0x29')](_0x1f2b20);}return _0x561701['save']();};}function saveUpdates(_0xb80136,_0x19f353){return function(_0x3293de){if(_0x3293de){return _0x3293de['update'](_0xb80136)[_0x17b8('0x2a')](function(_0x3ba6ff){return _0x3ba6ff;});}return null;};}function removeEntity(_0x384087,_0x17f694){return function(_0x10fb4d){if(_0x10fb4d){return _0x10fb4d[_0x17b8('0x2b')]()['then'](function(){var _0x1d8b57=_0x10fb4d['get']({'plain':!![]});var _0x1c3343=_0x17b8('0x2c');return db[_0x17b8('0x2d')]['destroy']({'where':{'type':_0x1c3343,'resourceId':_0x1d8b57['id']}})['then'](function(){return _0x10fb4d;});})[_0x17b8('0x2a')](function(){_0x384087[_0x17b8('0x20')](0xcc)[_0x17b8('0x2e')]();});}};}function handleEntityNotFound(_0x3cf49a,_0x1b4dba){return function(_0x44c69e){if(!_0x44c69e){_0x3cf49a[_0x17b8('0x1f')](0x194);}return _0x44c69e;};}function handleError(_0x29c9d7,_0x3c0dd6){_0x3c0dd6=_0x3c0dd6||0x1f4;return function(_0x319159){logger[_0x17b8('0x2f')](_0x319159['stack']);if(_0x319159[_0x17b8('0x30')]){delete _0x319159['name'];}_0x29c9d7[_0x17b8('0x20')](_0x3c0dd6)[_0x17b8('0x31')](_0x319159);};}exports[_0x17b8('0x32')]=function(_0x573b85,_0x287635){var _0x1679c9={},_0x3f253c={},_0x36801a={'count':0x0,'rows':[]};var _0x542813=_[_0x17b8('0x33')](db[_0x17b8('0x34')][_0x17b8('0x35')],function(_0x3ed083){return{'name':_0x3ed083[_0x17b8('0x36')],'type':_0x3ed083[_0x17b8('0x37')]['key']};});_0x3f253c[_0x17b8('0x38')]=_[_0x17b8('0x33')](_0x542813,_0x17b8('0x30'));_0x3f253c[_0x17b8('0x39')]=_['keys'](_0x573b85[_0x17b8('0x39')]);_0x3f253c[_0x17b8('0x3a')]=_[_0x17b8('0x3b')](_0x3f253c[_0x17b8('0x38')],_0x3f253c['query']);_0x1679c9[_0x17b8('0x3c')]=_[_0x17b8('0x3b')](_0x3f253c[_0x17b8('0x38')],qs[_0x17b8('0x3d')](_0x573b85[_0x17b8('0x39')][_0x17b8('0x3d')]));_0x1679c9[_0x17b8('0x3c')]=_0x1679c9['attributes'][_0x17b8('0x3e')]?_0x1679c9[_0x17b8('0x3c')]:_0x3f253c['model'];if(!_0x573b85[_0x17b8('0x39')][_0x17b8('0x3f')](_0x17b8('0x40'))){_0x1679c9[_0x17b8('0x23')]=qs[_0x17b8('0x23')](_0x573b85[_0x17b8('0x39')]['limit']);_0x1679c9[_0x17b8('0x25')]=qs['offset'](_0x573b85[_0x17b8('0x39')][_0x17b8('0x25')]);}_0x1679c9['order']=qs['sort'](_0x573b85['query']['sort']);_0x1679c9[_0x17b8('0x41')]=qs[_0x17b8('0x3a')](_[_0x17b8('0x42')](_0x573b85[_0x17b8('0x39')],_0x3f253c[_0x17b8('0x3a')]),_0x542813);if(_0x573b85['query'][_0x17b8('0x43')]){_0x1679c9[_0x17b8('0x41')]=_['merge'](_0x1679c9['where'],{'$or':_[_0x17b8('0x33')](_0x542813,function(_0x1b82df){if(_0x1b82df[_0x17b8('0x37')]!=='VIRTUAL'){var _0x270fb4={};_0x270fb4[_0x1b82df[_0x17b8('0x30')]]={'$like':'%'+_0x573b85[_0x17b8('0x39')][_0x17b8('0x43')]+'%'};return _0x270fb4;}})});}_0x1679c9=_[_0x17b8('0x44')]({},_0x1679c9,_0x573b85[_0x17b8('0x45')]);var _0x2643b4={'where':_0x1679c9[_0x17b8('0x41')]};return db[_0x17b8('0x34')][_0x17b8('0x24')](_0x2643b4)[_0x17b8('0x2a')](function(_0x3c2b47){_0x36801a[_0x17b8('0x24')]=_0x3c2b47;if(_0x573b85['query'][_0x17b8('0x46')]){_0x1679c9[_0x17b8('0x47')]=[{'all':!![]}];}return db['FaxQueue'][_0x17b8('0x48')](_0x1679c9);})[_0x17b8('0x2a')](function(_0x4e6b24){_0x36801a['rows']=_0x4e6b24;return _0x36801a;})['then'](respondWithFilteredResult(_0x287635,_0x1679c9))[_0x17b8('0x49')](handleError(_0x287635,null));};exports['show']=function(_0x997f8a,_0xeefe09){var _0x5432b2={'raw':!![],'where':{'id':_0x997f8a[_0x17b8('0x4a')]['id']}},_0x4894db={};_0x4894db[_0x17b8('0x38')]=_['keys'](db[_0x17b8('0x34')][_0x17b8('0x35')]);_0x4894db[_0x17b8('0x39')]=_[_0x17b8('0x4b')](_0x997f8a['query']);_0x4894db[_0x17b8('0x3a')]=_[_0x17b8('0x3b')](_0x4894db[_0x17b8('0x38')],_0x4894db[_0x17b8('0x39')]);_0x5432b2[_0x17b8('0x3c')]=_[_0x17b8('0x3b')](_0x4894db['model'],qs[_0x17b8('0x3d')](_0x997f8a['query'][_0x17b8('0x3d')]));_0x5432b2[_0x17b8('0x3c')]=_0x5432b2[_0x17b8('0x3c')][_0x17b8('0x3e')]?_0x5432b2[_0x17b8('0x3c')]:_0x4894db[_0x17b8('0x38')];if(_0x997f8a[_0x17b8('0x39')][_0x17b8('0x46')]){_0x5432b2[_0x17b8('0x47')]=[{'all':!![]}];}_0x5432b2=_[_0x17b8('0x44')]({},_0x5432b2,_0x997f8a['options']);return db[_0x17b8('0x34')][_0x17b8('0x4c')](_0x5432b2)[_0x17b8('0x2a')](handleEntityNotFound(_0xeefe09,null))[_0x17b8('0x2a')](respondWithResult(_0xeefe09,null))[_0x17b8('0x49')](handleError(_0xeefe09,null));};exports[_0x17b8('0x4d')]=function(_0x30f9ab,_0x1ee663){return db[_0x17b8('0x34')][_0x17b8('0x4d')](_0x30f9ab[_0x17b8('0x4e')],{})[_0x17b8('0x2a')](function(_0x59d490){var _0xcd43b0=_0x30f9ab['user'][_0x17b8('0x4f')]({'plain':!![]});if(!_0xcd43b0)throw new Error(_0x17b8('0x50'));if(_0xcd43b0[_0x17b8('0x51')]===_0x17b8('0x52')){var _0x3a639e=_0x59d490[_0x17b8('0x4f')]({'plain':!![]});var _0xb3754f=_0x17b8('0x2c');return db[_0x17b8('0x53')]['find']({'where':{'name':_0xb3754f,'userProfileId':_0xcd43b0['userProfileId']},'raw':!![]})[_0x17b8('0x2a')](function(_0x23115e){if(_0x23115e&&_0x23115e['autoAssociation']===0x0){return db[_0x17b8('0x2d')]['create']({'name':_0x3a639e[_0x17b8('0x30')],'resourceId':_0x3a639e['id'],'type':_0x23115e[_0x17b8('0x30')],'sectionId':_0x23115e['id']},{})[_0x17b8('0x2a')](function(){return _0x59d490;});}else{return _0x59d490;}})[_0x17b8('0x49')](function(_0x228eae){logger[_0x17b8('0x2f')](_0x17b8('0x54'),_0x228eae);throw _0x228eae;});}return _0x59d490;})['then'](respondWithResult(_0x1ee663,0xc9))[_0x17b8('0x49')](handleError(_0x1ee663,null));};exports['update']=function(_0x1982c3,_0x42d572){if(_0x1982c3[_0x17b8('0x4e')]['id']){delete _0x1982c3['body']['id'];}return db[_0x17b8('0x34')]['find']({'where':{'id':_0x1982c3[_0x17b8('0x4a')]['id']}})[_0x17b8('0x2a')](handleEntityNotFound(_0x42d572,null))[_0x17b8('0x2a')](saveUpdates(_0x1982c3[_0x17b8('0x4e')],null))[_0x17b8('0x2a')](respondWithResult(_0x42d572,null))[_0x17b8('0x49')](handleError(_0x42d572,null));};exports[_0x17b8('0x2b')]=function(_0x61549,_0x28f4f7){return db[_0x17b8('0x34')]['find']({'where':{'id':_0x61549[_0x17b8('0x4a')]['id']}})[_0x17b8('0x2a')](handleEntityNotFound(_0x28f4f7,null))[_0x17b8('0x2a')](removeEntity(_0x28f4f7,null))[_0x17b8('0x49')](handleError(_0x28f4f7,null));};exports[_0x17b8('0x55')]=function(_0x4051d9,_0x394dd7){return db['FaxQueue'][_0x17b8('0x55')]()[_0x17b8('0x2a')](respondWithResult(_0x394dd7,null))[_0x17b8('0x49')](handleError(_0x394dd7,null));};exports[_0x17b8('0x56')]=function(_0x3e1e74,_0x1f05d9,_0x32aca4){var _0x3be41b={'raw':!![],'where':{}},_0x485360={},_0x47360a;return db[_0x17b8('0x34')][_0x17b8('0x57')]({'where':{'id':_0x3e1e74[_0x17b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f05d9,null))['then'](function(_0x376a1c){if(_0x376a1c){_0x47360a=_0x376a1c['get']({'plain':!![]});_0x485360['model']=_['keys'](db[_0x17b8('0x58')][_0x17b8('0x35')]);_0x485360['query']=_[_0x17b8('0x4b')](_0x3e1e74[_0x17b8('0x39')]);_0x485360[_0x17b8('0x3a')]=_[_0x17b8('0x3b')](_0x485360[_0x17b8('0x38')],_0x485360[_0x17b8('0x39')]);_0x3be41b[_0x17b8('0x3c')]=_['intersection'](_0x485360[_0x17b8('0x38')],qs[_0x17b8('0x3d')](_0x3e1e74[_0x17b8('0x39')]['fields']));_0x3be41b[_0x17b8('0x3c')]=_0x3be41b[_0x17b8('0x3c')][_0x17b8('0x3e')]?_0x3be41b[_0x17b8('0x3c')]:_0x485360['model'];if(!_0x3e1e74[_0x17b8('0x39')]['hasOwnProperty']('nolimit')){_0x3be41b[_0x17b8('0x23')]=qs[_0x17b8('0x23')](_0x3e1e74[_0x17b8('0x39')][_0x17b8('0x23')]);_0x3be41b['offset']=qs[_0x17b8('0x25')](_0x3e1e74[_0x17b8('0x39')][_0x17b8('0x25')]);}_0x3be41b[_0x17b8('0x59')]=qs[_0x17b8('0x5a')](_0x3e1e74[_0x17b8('0x39')][_0x17b8('0x5a')]);_0x3be41b['where']=qs[_0x17b8('0x3a')](_[_0x17b8('0x42')](_0x3e1e74[_0x17b8('0x39')],_0x485360[_0x17b8('0x3a')]));_0x3be41b[_0x17b8('0x41')][_0x17b8('0x5b')]=_0x376a1c['id'];if(_0x3e1e74[_0x17b8('0x39')][_0x17b8('0x43')]){_0x3be41b[_0x17b8('0x41')]=_['merge'](_0x3be41b[_0x17b8('0x41')],{'$or':_[_0x17b8('0x33')](_0x3be41b[_0x17b8('0x3c')],function(_0x5df4c2){var _0x108499={};_0x108499[_0x5df4c2]={'$like':'%'+_0x3e1e74[_0x17b8('0x39')][_0x17b8('0x43')]+'%'};return _0x108499;})});}_0x3be41b=_['merge']({},_0x3be41b,_0x3e1e74[_0x17b8('0x45')]);return db[_0x17b8('0x58')]['findAll'](_0x3be41b);}})['then'](function(_0x4ec887){if(_0x4ec887){return db[_0x17b8('0x5c')]['findAndCountAll']({'where':{'id':_[_0x17b8('0x33')](_0x4ec887,_0x17b8('0x5d')),'role':_0x17b8('0x5e')},'attributes':['id',_0x17b8('0x30'),_0x17b8('0x5f'),_0x17b8('0x60'),'createdAt']});}})['then'](function(_0x1ff70d){if(_0x1ff70d){return{'count':_0x1ff70d[_0x17b8('0x24')],'rows':_['map'](_0x1ff70d[_0x17b8('0x61')],function(_0x5da7a1){return{'membername':_0x5da7a1[_0x17b8('0x30')],'UserId':_0x5da7a1['id'],'queue_name':_0x47360a[_0x17b8('0x30')],'FaxQueueId':_0x47360a['id'],'interface':util[_0x17b8('0x62')](_0x17b8('0x63'),_0x17b8('0x64'),_0x5da7a1[_0x17b8('0x30')]),'penalty':0x0,'paused':_0x5da7a1[_0x17b8('0x5f')],'createdAt':_0x5da7a1[_0x17b8('0x65')],'updatedAt':_0x5da7a1[_0x17b8('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x17b8('0x2a')](respondWithFilteredResult(_0x1f05d9,_0x3be41b))['catch'](handleError(_0x1f05d9,null));};exports[_0x17b8('0x66')]=function(_0x5b8b46,_0x381a90,_0x5a15e1){var _0xd0e3d7={};var _0x1ae72a={};var _0x36b39d;var _0x5b0ede;return db[_0x17b8('0x34')]['findOne']({'where':{'id':_0x5b8b46[_0x17b8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x381a90,null))[_0x17b8('0x2a')](function(_0x22b0c5){if(_0x22b0c5){_0x36b39d=_0x22b0c5;_0x1ae72a[_0x17b8('0x38')]=_[_0x17b8('0x4b')](db[_0x17b8('0x67')][_0x17b8('0x35')]);_0x1ae72a[_0x17b8('0x39')]=_[_0x17b8('0x4b')](_0x5b8b46[_0x17b8('0x39')]);_0x1ae72a[_0x17b8('0x3a')]=_['intersection'](_0x1ae72a['model'],_0x1ae72a['query']);_0xd0e3d7['attributes']=_[_0x17b8('0x3b')](_0x1ae72a[_0x17b8('0x38')],qs[_0x17b8('0x3d')](_0x5b8b46[_0x17b8('0x39')]['fields']));_0xd0e3d7[_0x17b8('0x3c')]=_0xd0e3d7[_0x17b8('0x3c')][_0x17b8('0x3e')]?_0xd0e3d7[_0x17b8('0x3c')]:_0x1ae72a[_0x17b8('0x38')];_0xd0e3d7[_0x17b8('0x59')]=qs[_0x17b8('0x5a')](_0x5b8b46['query'][_0x17b8('0x5a')]);_0xd0e3d7[_0x17b8('0x41')]=qs['filters'](_['pick'](_0x5b8b46[_0x17b8('0x39')],_0x1ae72a[_0x17b8('0x3a')]));if(_0x5b8b46[_0x17b8('0x39')]['filter']){_0xd0e3d7[_0x17b8('0x41')]=_[_0x17b8('0x44')](_0xd0e3d7[_0x17b8('0x41')],{'$or':_['map'](_0xd0e3d7['attributes'],function(_0x2924fa){var _0x1ede03={};_0x1ede03[_0x2924fa]={'$like':'%'+_0x5b8b46[_0x17b8('0x39')][_0x17b8('0x43')]+'%'};return _0x1ede03;})});}_0xd0e3d7=_[_0x17b8('0x44')]({},_0xd0e3d7,_0x5b8b46[_0x17b8('0x45')]);return _0x36b39d[_0x17b8('0x66')](_0xd0e3d7);}})[_0x17b8('0x2a')](function(_0x160bd4){if(_0x160bd4){_0x5b0ede=_0x160bd4[_0x17b8('0x3e')];if(!_0x5b8b46[_0x17b8('0x39')][_0x17b8('0x3f')]('nolimit')){_0xd0e3d7['limit']=qs[_0x17b8('0x23')](_0x5b8b46[_0x17b8('0x39')][_0x17b8('0x23')]);_0xd0e3d7[_0x17b8('0x25')]=qs['offset'](_0x5b8b46[_0x17b8('0x39')]['offset']);}return _0x36b39d[_0x17b8('0x66')](_0xd0e3d7);}})[_0x17b8('0x2a')](function(_0x3c6249){if(_0x3c6249){return _0x3c6249?{'count':_0x5b0ede,'rows':_0x3c6249}:null;}})[_0x17b8('0x2a')](respondWithResult(_0x381a90,null))[_0x17b8('0x49')](handleError(_0x381a90,null));};exports[_0x17b8('0x68')]=function(_0x3d65b2,_0x5ec08a,_0x38ff95){var _0x3be451=_0x3d65b2[_0x17b8('0x4e')][_0x17b8('0x69')];return db[_0x17b8('0x67')][_0x17b8('0x48')]({'where':{'id':_0x3be451},'attributes':['id'],'include':[{'model':db[_0x17b8('0x5c')],'as':_0x17b8('0x6a'),'attributes':['id','name',_0x17b8('0x6b'),_0x17b8('0x6c'),_0x17b8('0x6d')],'raw':!![]}]})[_0x17b8('0x2a')](function(_0x12858f){if(_0x12858f){var _0x4923cb=_[_0x17b8('0x6e')](_0x12858f,function(_0x148317){var _0x368899=_0x148317[_0x17b8('0x4f')]({'plain':!![]});return _0x368899[_0x17b8('0x6a')];});return db[_0x17b8('0x34')][_0x17b8('0x4c')]({'where':{'id':_0x3d65b2[_0x17b8('0x4a')]['id']}})[_0x17b8('0x2a')](function(_0x2c1c07){return db[_0x17b8('0x6f')][_0x17b8('0x70')](function(_0x57441c){return _0x2c1c07[_0x17b8('0x68')](_0x3be451,{'transaction':_0x57441c})[_0x17b8('0x2a')](function(){return BPromise['each'](_0x4923cb,function(_0xd47db1){return db[_0x17b8('0x58')][_0x17b8('0x71')]({'where':{'UserId':_0xd47db1['id'],'FaxQueueId':_0x3d65b2[_0x17b8('0x4a')]['id']},'transaction':_0x57441c});});})[_0x17b8('0x2a')](function(){_0x4923cb['forEach'](function(_0x20ee85){socket[_0x17b8('0x72')](_0x17b8('0x73'),{'UserId':_0x20ee85['id'],'FaxQueueId':_0x2c1c07['id']});});});});});}})['then'](respondWithStatusCode(_0x5ec08a,null))[_0x17b8('0x49')](handleError(_0x5ec08a,null));};exports['removeTeams']=function(_0x25d017,_0x148d9d,_0x55f4fd){return db['Team']['findAll']({'where':{'id':_0x25d017[_0x17b8('0x39')][_0x17b8('0x69')]},'attributes':['id'],'include':[{'model':db[_0x17b8('0x5c')],'as':_0x17b8('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x17b8('0x2a')](handleEntityNotFound(_0x148d9d,null))['then'](function(_0x21eb90){var _0x235ae1=_[_0x17b8('0x33')](_0x21eb90,'id');var _0x1946a1=[];var _0x459e10=[];var _0x45d97a=squel[_0x17b8('0x74')]();_0x45d97a['field'](_0x17b8('0x75'))['from'](_0x17b8('0x76'),'tq')[_0x17b8('0x77')](_0x17b8('0x78'),'ut',_0x17b8('0x79'))[_0x17b8('0x41')](_0x17b8('0x7a'),_0x25d017[_0x17b8('0x4a')]['id']);for(var _0x2f8769=0x0;_0x2f8769<_0x21eb90[_0x17b8('0x3e')];_0x2f8769+=0x1){let _0x1cd4ac=_0x21eb90[_0x2f8769];for(var _0xb74fa2=0x0;_0xb74fa2<_0x1cd4ac[_0x17b8('0x6a')][_0x17b8('0x3e')];_0xb74fa2+=0x1){let _0x211853=_0x1cd4ac[_0x17b8('0x6a')][_0xb74fa2];var _0x3abb29=_0x45d97a[_0x17b8('0x7b')]();_0x3abb29['where'](_0x17b8('0x7c'),_0x211853['id']);_0x459e10['push'](db[_0x17b8('0x6f')][_0x17b8('0x39')](_0x3abb29['toString'](),{'type':db['sequelize'][_0x17b8('0x7d')]['SELECT']})[_0x17b8('0x2a')](function(_0x192168){if(_0x192168[_0x17b8('0x3e')]===0x1){return _0x211853['id'];}else{var _0x4812dc=_[_0x17b8('0x7e')](_[_0x17b8('0x33')](_0x192168,_0x17b8('0x7f')),function(_0x4748a9){return _['includes'](_0x235ae1,_0x4748a9);});if(_0x4812dc){return _0x211853['id'];}}}));}}return BPromise[_0x17b8('0x80')](_0x459e10)[_0x17b8('0x2a')](function(_0x170534){_0x1946a1=_(_0x1946a1)[_0x17b8('0x81')](_0x170534)['compact']()[_0x17b8('0x82')]();return db[_0x17b8('0x34')][_0x17b8('0x4c')]({'where':{'id':_0x25d017['params']['id']}})['then'](function(_0x1026b1){return db[_0x17b8('0x6f')][_0x17b8('0x70')](function(_0x58a871){return _0x1026b1[_0x17b8('0x83')](_0x25d017[_0x17b8('0x39')][_0x17b8('0x69')],{'transaction':_0x58a871})['then'](function(){if(!_[_0x17b8('0x84')](_0x1946a1)){return _0x1026b1['removeAgents'](_0x1946a1,{'transaction':_0x58a871});}})[_0x17b8('0x2a')](function(){_0x1946a1[_0x17b8('0x85')](function(_0x357166){socket[_0x17b8('0x72')](_0x17b8('0x86'),{'UserId':_0x357166,'FaxQueueId':_0x1026b1['id']});});});});});});})[_0x17b8('0x2a')](respondWithStatusCode(_0x148d9d,null))[_0x17b8('0x49')](handleError(_0x148d9d,null));};exports['addAgents']=function(_0x242695,_0xf7ff05,_0x177ca0){return db[_0x17b8('0x34')][_0x17b8('0x4c')]({'where':{'id':_0x242695['params']['id']}})[_0x17b8('0x2a')](handleEntityNotFound(_0xf7ff05,null))[_0x17b8('0x2a')](function(_0xd5fb67){if(_0xd5fb67){return _0xd5fb67[_0x17b8('0x87')](_0x242695[_0x17b8('0x4e')][_0x17b8('0x69')],_[_0x17b8('0x88')](_0x242695[_0x17b8('0x4e')],[_0x17b8('0x69'),'id'])||{})[_0x17b8('0x89')](function(_0xcd3709){for(var _0xfe5c0f=0x0;_0xfe5c0f<_0x242695[_0x17b8('0x4e')][_0x17b8('0x69')][_0x17b8('0x3e')];_0xfe5c0f+=0x1){socket[_0x17b8('0x72')](_0x17b8('0x73'),{'UserId':Number(_0x242695['body'][_0x17b8('0x69')][_0xfe5c0f]),'FaxQueueId':Number(_0x242695[_0x17b8('0x4a')]['id'])});}return _0xcd3709;});}})[_0x17b8('0x2a')](respondWithResult(_0xf7ff05,null))[_0x17b8('0x49')](handleError(_0xf7ff05,null));};exports['removeAgents']=function(_0x571104,_0x1b74b4,_0x37e2fd){return db[_0x17b8('0x34')][_0x17b8('0x4c')]({'where':{'id':_0x571104['params']['id']}})[_0x17b8('0x2a')](handleEntityNotFound(_0x1b74b4,null))[_0x17b8('0x2a')](function(_0x326bb5){if(_0x326bb5){return _0x326bb5[_0x17b8('0x8a')](_0x571104[_0x17b8('0x39')][_0x17b8('0x69')])[_0x17b8('0x2a')](function(){if(_[_0x17b8('0x8b')](_0x571104[_0x17b8('0x39')][_0x17b8('0x69')])){for(var _0x5709ad=0x0;_0x5709ad<_0x571104[_0x17b8('0x39')][_0x17b8('0x69')][_0x17b8('0x3e')];_0x5709ad+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x571104[_0x17b8('0x39')][_0x17b8('0x69')][_0x5709ad]),'FaxQueueId':Number(_0x571104[_0x17b8('0x4a')]['id'])});}}else{socket[_0x17b8('0x72')](_0x17b8('0x86'),{'UserId':Number(_0x571104[_0x17b8('0x39')]['ids']),'FaxQueueId':Number(_0x571104['params']['id'])});}});}})[_0x17b8('0x2a')](respondWithStatusCode(_0x1b74b4,null))['catch'](handleError(_0x1b74b4,null));};exports['getAgents']=function(_0x2c528d,_0x3c9b5d,_0x114a0a){var _0xb86a54={};var _0x415fff={};var _0x2a1f9b;var _0x455f99;return db['FaxQueue'][_0x17b8('0x57')]({'where':{'id':_0x2c528d['params']['id']}})['then'](handleEntityNotFound(_0x3c9b5d,null))[_0x17b8('0x2a')](function(_0x252d42){if(_0x252d42){_0x2a1f9b=_0x252d42;_0x415fff[_0x17b8('0x38')]=_[_0x17b8('0x4b')](db[_0x17b8('0x5c')][_0x17b8('0x35')]);_0x415fff[_0x17b8('0x39')]=_[_0x17b8('0x4b')](_0x2c528d[_0x17b8('0x39')]);_0x415fff[_0x17b8('0x3a')]=_[_0x17b8('0x3b')](_0x415fff[_0x17b8('0x38')],_0x415fff['query']);_0xb86a54['attributes']=_[_0x17b8('0x3b')](_0x415fff[_0x17b8('0x38')],qs[_0x17b8('0x3d')](_0x2c528d[_0x17b8('0x39')][_0x17b8('0x3d')]));_0xb86a54[_0x17b8('0x3c')]=_0xb86a54[_0x17b8('0x3c')][_0x17b8('0x3e')]?_0xb86a54[_0x17b8('0x3c')]:_0x415fff[_0x17b8('0x38')];_0xb86a54[_0x17b8('0x59')]=qs['sort'](_0x2c528d[_0x17b8('0x39')]['sort']);_0xb86a54['where']=qs[_0x17b8('0x3a')](_['pick'](_0x2c528d[_0x17b8('0x39')],_0x415fff['filters']));if(_0x2c528d[_0x17b8('0x39')]['filter']){_0xb86a54['where']=_['merge'](_0xb86a54[_0x17b8('0x41')],{'$or':_[_0x17b8('0x33')](_0xb86a54[_0x17b8('0x3c')],function(_0x5e8476){var _0x2b01e5={};_0x2b01e5[_0x5e8476]={'$like':'%'+_0x2c528d[_0x17b8('0x39')][_0x17b8('0x43')]+'%'};return _0x2b01e5;})});}_0xb86a54=_[_0x17b8('0x44')]({},_0xb86a54,_0x2c528d[_0x17b8('0x45')]);return _0x2a1f9b[_0x17b8('0x8c')](_0xb86a54);}})[_0x17b8('0x2a')](function(_0xee9d22){if(_0xee9d22){_0x455f99=_0xee9d22[_0x17b8('0x3e')];if(!_0x2c528d['query'][_0x17b8('0x3f')](_0x17b8('0x40'))){_0xb86a54[_0x17b8('0x23')]=qs[_0x17b8('0x23')](_0x2c528d[_0x17b8('0x39')][_0x17b8('0x23')]);_0xb86a54[_0x17b8('0x25')]=qs[_0x17b8('0x25')](_0x2c528d[_0x17b8('0x39')][_0x17b8('0x25')]);}return _0x2a1f9b[_0x17b8('0x8c')](_0xb86a54);}})[_0x17b8('0x2a')](function(_0x56073e){if(_0x56073e){return _0x56073e?{'count':_0x455f99,'rows':_0x56073e}:null;}})[_0x17b8('0x2a')](respondWithResult(_0x3c9b5d,null))[_0x17b8('0x49')](handleError(_0x3c9b5d,null));};
\ No newline at end of file
index 713cb4c..6d88310 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d3=['hook','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0xe2dffe,_0x45b5ac){var _0x18d11b=function(_0x421c44){while(--_0x421c44){_0xe2dffe['push'](_0xe2dffe['shift']());}};_0x18d11b(++_0x45b5ac);}(_0xd3d3,0x17b));var _0x3d3d=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xd3d3[_0xc8a931];return _0x28bd27;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x3d3d('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3d3d('0x1')](0x0);var events={'afterCreate':_0x3d3d('0x2'),'afterUpdate':_0x3d3d('0x3'),'afterDestroy':_0x3d3d('0x4')};function emitEvent(_0x1f6624){return function(_0x32ece6,_0x5bc068,_0x25a106){FaxQueueEvents['emit'](_0x1f6624+':'+_0x32ece6['id'],_0x32ece6);FaxQueueEvents['emit'](_0x1f6624,_0x32ece6);_0x25a106(null);};}for(var e in events){if(events[_0x3d3d('0x5')](e)){var event=events[e];FaxQueue[_0x3d3d('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
+var _0x3162=['exports','events','../../mysqldb','remove','emit'];(function(_0x4c3dba,_0x5c71db){var _0x1e30b3=function(_0x39eca1){while(--_0x39eca1){_0x4c3dba['push'](_0x4c3dba['shift']());}};_0x1e30b3(++_0x5c71db);}(_0x3162,0x1eb));var _0x2316=function(_0xea9e1c,_0x577088){_0xea9e1c=_0xea9e1c-0x0;var _0x3bdb61=_0x3162[_0xea9e1c];return _0x3bdb61;};'use strict';var EventEmitter=require(_0x2316('0x0'));var FaxQueue=require(_0x2316('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2316('0x2')};function emitEvent(_0x335b30){return function(_0x5dbc72,_0x1dbfb2,_0x5f4bc5){FaxQueueEvents[_0x2316('0x3')](_0x335b30+':'+_0x5dbc72['id'],_0x5dbc72);FaxQueueEvents[_0x2316('0x3')](_0x335b30,_0x5dbc72);_0x5f4bc5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x2316('0x4')]=FaxQueueEvents;
\ No newline at end of file
index 544b187..7045336 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd74e=['FaxQueue','fax_queues','moment','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x48b2a4,_0x259086){var _0x29885f=function(_0x4b35da){while(--_0x4b35da){_0x48b2a4['push'](_0x48b2a4['shift']());}};_0x29885f(++_0x259086);}(_0xd74e,0x7a));var _0xed74=function(_0x52c37f,_0x3a9436){_0x52c37f=_0x52c37f-0x0;var _0x1a76db=_0xd74e[_0x52c37f];return _0x1a76db;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xed74('0x0'));var BPromise=require(_0xed74('0x1'));var rp=require(_0xed74('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed74('0x3'));var config=require(_0xed74('0x4'));var attributes=require(_0xed74('0x5'));module[_0xed74('0x6')]=function(_0x326a43,_0x26035e){return _0x326a43[_0xed74('0x7')](_0xed74('0x8'),attributes,{'tableName':_0xed74('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf506=['../../config/environment','./faxQueue.attributes','exports','define','fax_queues','util','../../config/logger','api','bluebird','path'];(function(_0x586030,_0x404ef4){var _0x1cdb3b=function(_0x1af3b8){while(--_0x1af3b8){_0x586030['push'](_0x586030['shift']());}};_0x1cdb3b(++_0x404ef4);}(_0xf506,0x9b));var _0x6f50=function(_0x2afe47,_0x31958f){_0x2afe47=_0x2afe47-0x0;var _0x51b65e=_0xf506[_0x2afe47];return _0x51b65e;};'use strict';var _=require('lodash');var util=require(_0x6f50('0x0'));var logger=require(_0x6f50('0x1'))(_0x6f50('0x2'));var moment=require('moment');var BPromise=require(_0x6f50('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f50('0x4'));var rimraf=require('rimraf');var config=require(_0x6f50('0x5'));var attributes=require(_0x6f50('0x6'));module[_0x6f50('0x7')]=function(_0x4c79c1,_0x2bfff8){return _0x4c79c1[_0x6f50('0x8')]('FaxQueue',attributes,{'tableName':_0x6f50('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bcb2fc7..048d490 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09c2=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','GetFaxQueue','catch','find','ShowFaxQueue','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3639ee,_0x4b29b6){var _0x307852=function(_0x44394b){while(--_0x44394b){_0x3639ee['push'](_0x3639ee['shift']());}};_0x307852(++_0x4b29b6);}(_0x09c2,0xf4));var _0x209c=function(_0x1e54a7,_0x4e7ea3){_0x1e54a7=_0x1e54a7-0x0;var _0x41d78e=_0x09c2[_0x1e54a7];return _0x41d78e;};'use strict';var _=require(_0x209c('0x0'));var util=require(_0x209c('0x1'));var moment=require('moment');var BPromise=require(_0x209c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x209c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x209c('0x4'));var logger=require(_0x209c('0x5'))(_0x209c('0x6'));var config=require(_0x209c('0x7'));var jayson=require(_0x209c('0x8'));var client=jayson[_0x209c('0x9')][_0x209c('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x209c('0xb')],{'host':_0x209c('0xc'),'port':0x18eb});var socket=require(_0x209c('0xd'))(new Redis(config['redis']));require(_0x209c('0xe'))[_0x209c('0xf')](socket);function respondWithRpcPromise(_0x48e1d4,_0x3e8e65,_0x2f1a49){return new BPromise(function(_0x13c7fe,_0xb09e9d){return client[_0x209c('0x10')](_0x48e1d4,_0x2f1a49)['then'](function(_0x370f4e){logger[_0x209c('0x11')](_0x209c('0x12'),_0x3e8e65,_0x209c('0x13'));logger[_0x209c('0x14')](_0x209c('0x15'),_0x3e8e65,'request\x20sent',JSON[_0x209c('0x16')](_0x370f4e));if(_0x370f4e[_0x209c('0x17')]){if(_0x370f4e[_0x209c('0x17')][_0x209c('0x18')]===0x1f4){logger['error'](_0x209c('0x12'),_0x3e8e65,_0x370f4e[_0x209c('0x17')]['message']);return _0xb09e9d(_0x370f4e['error'][_0x209c('0x19')]);}logger[_0x209c('0x17')](_0x209c('0x12'),_0x3e8e65,_0x370f4e[_0x209c('0x17')][_0x209c('0x19')]);return _0x13c7fe(_0x370f4e[_0x209c('0x17')][_0x209c('0x19')]);}else{logger[_0x209c('0x11')](_0x209c('0x12'),_0x3e8e65,_0x209c('0x13'));_0x13c7fe(_0x370f4e[_0x209c('0x1a')][_0x209c('0x19')]);}})['catch'](function(_0xab5f2f){logger['error'](_0x209c('0x12'),_0x3e8e65,_0xab5f2f);_0xb09e9d(_0xab5f2f);});});}exports['GetFaxQueue']=function(_0x28cdde){var _0x2eeedc=this;return new Promise(function(_0x4cd779,_0x12fe15){return db[_0x209c('0x1b')][_0x209c('0x1c')]({'raw':_0x28cdde[_0x209c('0x1d')]?_0x28cdde[_0x209c('0x1d')][_0x209c('0x1e')]===undefined?!![]:![]:!![],'where':_0x28cdde[_0x209c('0x1d')]?_0x28cdde[_0x209c('0x1d')][_0x209c('0x1f')]||null:null,'attributes':_0x28cdde[_0x209c('0x1d')]?_0x28cdde[_0x209c('0x1d')][_0x209c('0x20')]||null:null,'limit':_0x28cdde[_0x209c('0x1d')]?_0x28cdde[_0x209c('0x1d')][_0x209c('0x21')]||null:null,'include':_0x28cdde[_0x209c('0x1d')]?_0x28cdde[_0x209c('0x1d')]['include']?_[_0x209c('0x22')](_0x28cdde[_0x209c('0x1d')][_0x209c('0x23')],function(_0x506d19){return{'model':db[_0x506d19[_0x209c('0x24')]],'as':_0x506d19['as'],'attributes':_0x506d19['attributes'],'include':_0x506d19[_0x209c('0x23')]?_['map'](_0x506d19[_0x209c('0x23')],function(_0xac9ceb){return{'model':db[_0xac9ceb[_0x209c('0x24')]],'as':_0xac9ceb['as'],'attributes':_0xac9ceb[_0x209c('0x20')],'include':_0xac9ceb[_0x209c('0x23')]?_[_0x209c('0x22')](_0xac9ceb[_0x209c('0x23')],function(_0x3ff999){return{'model':db[_0x3ff999['model']],'as':_0x3ff999['as'],'attributes':_0x3ff999['attributes']};}):[]};}):[]};}):[]:[]})[_0x209c('0x25')](function(_0x1f8fe6){logger['info'](_0x209c('0x26'),_0x28cdde);logger[_0x209c('0x14')](_0x209c('0x26'),_0x28cdde,JSON[_0x209c('0x16')](_0x1f8fe6));_0x4cd779(_0x1f8fe6);})[_0x209c('0x27')](function(_0x100e31){logger[_0x209c('0x17')](_0x209c('0x26'),_0x100e31[_0x209c('0x19')],_0x28cdde);_0x12fe15(_0x2eeedc[_0x209c('0x17')](0x1f4,_0x100e31['message']));});});};exports['ShowFaxQueue']=function(_0x1fbdaf){var _0x3b0062=this;return new Promise(function(_0x40c50a,_0x14c0f4){return db['FaxQueue'][_0x209c('0x28')]({'raw':_0x1fbdaf[_0x209c('0x1d')]?_0x1fbdaf[_0x209c('0x1d')][_0x209c('0x1e')]===undefined?!![]:![]:!![],'where':_0x1fbdaf['options']?_0x1fbdaf[_0x209c('0x1d')][_0x209c('0x1f')]||null:null,'attributes':_0x1fbdaf[_0x209c('0x1d')]?_0x1fbdaf[_0x209c('0x1d')][_0x209c('0x20')]||null:null,'include':_0x1fbdaf[_0x209c('0x1d')]?_0x1fbdaf['options'][_0x209c('0x23')]?_['map'](_0x1fbdaf[_0x209c('0x1d')][_0x209c('0x23')],function(_0x322fb9){return{'model':db[_0x322fb9[_0x209c('0x24')]],'as':_0x322fb9['as'],'attributes':_0x322fb9[_0x209c('0x20')],'include':_0x322fb9[_0x209c('0x23')]?_[_0x209c('0x22')](_0x322fb9['include'],function(_0x21a09d){return{'model':db[_0x21a09d['model']],'as':_0x21a09d['as'],'attributes':_0x21a09d['attributes'],'include':_0x21a09d[_0x209c('0x23')]?_['map'](_0x21a09d[_0x209c('0x23')],function(_0x568845){return{'model':db[_0x568845['model']],'as':_0x568845['as'],'attributes':_0x568845[_0x209c('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb08236){logger['info'](_0x209c('0x29'),_0x1fbdaf);logger['debug'](_0x209c('0x29'),_0x1fbdaf,JSON[_0x209c('0x16')](_0xb08236));_0x40c50a(_0xb08236);})[_0x209c('0x27')](function(_0x64e982){logger[_0x209c('0x17')]('ShowFaxQueue',_0x64e982[_0x209c('0x19')],_0x1fbdaf);_0x14c0f4(_0x3b0062[_0x209c('0x17')](0x1f4,_0x64e982[_0x209c('0x19')]));});});};
\ No newline at end of file
+var _0x1b30=['GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowFaxQueue','find','info','stringify','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x316c42,_0x3391f0){var _0x2b38f7=function(_0x38d2cf){while(--_0x38d2cf){_0x316c42['push'](_0x316c42['shift']());}};_0x2b38f7(++_0x3391f0);}(_0x1b30,0xf9));var _0x01b3=function(_0x5d0b8c,_0x156b8b){_0x5d0b8c=_0x5d0b8c-0x0;var _0x3e30a6=_0x1b30[_0x5d0b8c];return _0x3e30a6;};'use strict';var _=require('lodash');var util=require(_0x01b3('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x01b3('0x1'));var fs=require('fs');var Redis=require(_0x01b3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x01b3('0x3'));var logger=require(_0x01b3('0x4'))(_0x01b3('0x5'));var config=require(_0x01b3('0x6'));var jayson=require(_0x01b3('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x01b3('0x8')](config[_0x01b3('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x01b3('0xa'))(new Redis(config[_0x01b3('0x9')]));require(_0x01b3('0xb'))[_0x01b3('0xc')](socket);function respondWithRpcPromise(_0x37bd7c,_0x4dffd8,_0x388cbf){return new BPromise(function(_0x168e3c,_0x5e32e4){return client[_0x01b3('0xd')](_0x37bd7c,_0x388cbf)[_0x01b3('0xe')](function(_0x534fb9){logger['info'](_0x01b3('0xf'),_0x4dffd8,'request\x20sent');logger[_0x01b3('0x10')](_0x01b3('0x11'),_0x4dffd8,_0x01b3('0x12'),JSON['stringify'](_0x534fb9));if(_0x534fb9[_0x01b3('0x13')]){if(_0x534fb9[_0x01b3('0x13')][_0x01b3('0x14')]===0x1f4){logger[_0x01b3('0x13')](_0x01b3('0xf'),_0x4dffd8,_0x534fb9[_0x01b3('0x13')][_0x01b3('0x15')]);return _0x5e32e4(_0x534fb9['error'][_0x01b3('0x15')]);}logger[_0x01b3('0x13')]('FaxQueue,\x20%s,\x20%s',_0x4dffd8,_0x534fb9[_0x01b3('0x13')][_0x01b3('0x15')]);return _0x168e3c(_0x534fb9['error']['message']);}else{logger['info'](_0x01b3('0xf'),_0x4dffd8,_0x01b3('0x12'));_0x168e3c(_0x534fb9[_0x01b3('0x16')][_0x01b3('0x15')]);}})[_0x01b3('0x17')](function(_0x5d831e){logger['error'](_0x01b3('0xf'),_0x4dffd8,_0x5d831e);_0x5e32e4(_0x5d831e);});});}exports[_0x01b3('0x18')]=function(_0x44a9f9){var _0x2821f2=this;return new Promise(function(_0x27df32,_0x5b1ff8){return db[_0x01b3('0x19')][_0x01b3('0x1a')]({'raw':_0x44a9f9[_0x01b3('0x1b')]?_0x44a9f9[_0x01b3('0x1b')][_0x01b3('0x1c')]===undefined?!![]:![]:!![],'where':_0x44a9f9[_0x01b3('0x1b')]?_0x44a9f9[_0x01b3('0x1b')][_0x01b3('0x1d')]||null:null,'attributes':_0x44a9f9['options']?_0x44a9f9[_0x01b3('0x1b')][_0x01b3('0x1e')]||null:null,'limit':_0x44a9f9['options']?_0x44a9f9['options'][_0x01b3('0x1f')]||null:null,'include':_0x44a9f9[_0x01b3('0x1b')]?_0x44a9f9[_0x01b3('0x1b')][_0x01b3('0x20')]?_[_0x01b3('0x21')](_0x44a9f9[_0x01b3('0x1b')]['include'],function(_0x146d7b){return{'model':db[_0x146d7b['model']],'as':_0x146d7b['as'],'attributes':_0x146d7b[_0x01b3('0x1e')],'include':_0x146d7b[_0x01b3('0x20')]?_[_0x01b3('0x21')](_0x146d7b[_0x01b3('0x20')],function(_0x41a636){return{'model':db[_0x41a636[_0x01b3('0x22')]],'as':_0x41a636['as'],'attributes':_0x41a636[_0x01b3('0x1e')],'include':_0x41a636[_0x01b3('0x20')]?_['map'](_0x41a636['include'],function(_0x2e9fbe){return{'model':db[_0x2e9fbe[_0x01b3('0x22')]],'as':_0x2e9fbe['as'],'attributes':_0x2e9fbe[_0x01b3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x301145){logger['info'](_0x01b3('0x18'),_0x44a9f9);logger[_0x01b3('0x10')](_0x01b3('0x18'),_0x44a9f9,JSON['stringify'](_0x301145));_0x27df32(_0x301145);})[_0x01b3('0x17')](function(_0xfe53a){logger[_0x01b3('0x13')](_0x01b3('0x18'),_0xfe53a[_0x01b3('0x15')],_0x44a9f9);_0x5b1ff8(_0x2821f2[_0x01b3('0x13')](0x1f4,_0xfe53a[_0x01b3('0x15')]));});});};exports[_0x01b3('0x23')]=function(_0x198207){var _0xe39413=this;return new Promise(function(_0x3ddc85,_0x242bd2){return db[_0x01b3('0x19')][_0x01b3('0x24')]({'raw':_0x198207[_0x01b3('0x1b')]?_0x198207[_0x01b3('0x1b')][_0x01b3('0x1c')]===undefined?!![]:![]:!![],'where':_0x198207[_0x01b3('0x1b')]?_0x198207[_0x01b3('0x1b')][_0x01b3('0x1d')]||null:null,'attributes':_0x198207[_0x01b3('0x1b')]?_0x198207['options'][_0x01b3('0x1e')]||null:null,'include':_0x198207[_0x01b3('0x1b')]?_0x198207[_0x01b3('0x1b')][_0x01b3('0x20')]?_[_0x01b3('0x21')](_0x198207[_0x01b3('0x1b')][_0x01b3('0x20')],function(_0x3e02fb){return{'model':db[_0x3e02fb['model']],'as':_0x3e02fb['as'],'attributes':_0x3e02fb[_0x01b3('0x1e')],'include':_0x3e02fb[_0x01b3('0x20')]?_[_0x01b3('0x21')](_0x3e02fb[_0x01b3('0x20')],function(_0x4f0383){return{'model':db[_0x4f0383['model']],'as':_0x4f0383['as'],'attributes':_0x4f0383[_0x01b3('0x1e')],'include':_0x4f0383['include']?_[_0x01b3('0x21')](_0x4f0383[_0x01b3('0x20')],function(_0x514683){return{'model':db[_0x514683['model']],'as':_0x514683['as'],'attributes':_0x514683[_0x01b3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x01b3('0xe')](function(_0x515bdf){logger[_0x01b3('0x25')]('ShowFaxQueue',_0x198207);logger[_0x01b3('0x10')](_0x01b3('0x23'),_0x198207,JSON[_0x01b3('0x26')](_0x515bdf));_0x3ddc85(_0x515bdf);})[_0x01b3('0x17')](function(_0x5b6b5b){logger['error'](_0x01b3('0x23'),_0x5b6b5b['message'],_0x198207);_0x242bd2(_0xe39413['error'](0x1f4,_0x5b6b5b[_0x01b3('0x15')]));});});};
\ No newline at end of file
index 777613a..8462d25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3e4=['save','remove','emit','removeListener','length','faxQueue:','./faxQueue.events'];(function(_0x586121,_0x2db124){var _0x17c28a=function(_0xf84644){while(--_0xf84644){_0x586121['push'](_0x586121['shift']());}};_0x17c28a(++_0x2db124);}(_0xe3e4,0xc3));var _0x4e3e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe3e4[_0x14add3];return _0x4a174f;};'use strict';var FaxQueueEvents=require(_0x4e3e('0x0'));var events=[_0x4e3e('0x1'),_0x4e3e('0x2'),'update'];function createListener(_0xaf4ad0,_0x1c6aaf){return function(_0x28e820){_0x1c6aaf[_0x4e3e('0x3')](_0xaf4ad0,_0x28e820);};}function removeListener(_0x1a9d32,_0x556719){return function(){FaxQueueEvents[_0x4e3e('0x4')](_0x1a9d32,_0x556719);};}exports['register']=function(_0x1ecf60){for(var _0x30dba7=0x0,_0x2f5942=events[_0x4e3e('0x5')];_0x30dba7<_0x2f5942;_0x30dba7++){var _0x33c6dd=events[_0x30dba7];var _0x2727c7=createListener(_0x4e3e('0x6')+_0x33c6dd,_0x1ecf60);FaxQueueEvents['on'](_0x33c6dd,_0x2727c7);}};
\ No newline at end of file
+var _0x6a7c=['faxQueue:','./faxQueue.events','remove','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a7c,0x1e7));var _0xc6a7=function(_0x5bf956,_0x33de99){_0x5bf956=_0x5bf956-0x0;var _0xc0325=_0x6a7c[_0x5bf956];return _0xc0325;};'use strict';var FaxQueueEvents=require(_0xc6a7('0x0'));var events=['save',_0xc6a7('0x1'),_0xc6a7('0x2')];function createListener(_0x5b362b,_0x579028){return function(_0x141dd0){_0x579028['emit'](_0x5b362b,_0x141dd0);};}function removeListener(_0x23cdb3,_0x5e3325){return function(){FaxQueueEvents[_0xc6a7('0x3')](_0x23cdb3,_0x5e3325);};}exports[_0xc6a7('0x4')]=function(_0x4f0ada){for(var _0x2a110f=0x0,_0x536d02=events['length'];_0x2a110f<_0x536d02;_0x2a110f++){var _0xd53ef=events[_0x2a110f];var _0x245155=createListener(_0xc6a7('0x5')+_0xd53ef,_0x4f0ada);FaxQueueEvents['on'](_0xd53ef,_0x245155);}};
\ No newline at end of file
index 7f09c73..8921cd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express'];(function(_0x1dcfa9,_0x436d21){var _0x3acd03=function(_0x432f75){while(--_0x432f75){_0x1dcfa9['push'](_0x1dcfa9['shift']());}};_0x3acd03(++_0x436d21);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xd8a6b7,_0x419151){_0xd8a6b7=_0xd8a6b7-0x0;var _0x26b276=_0xc6ac[_0xd8a6b7];return _0x26b276;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0xb')](_0xcc6a('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xcc6a('0x17')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x18')]);router['post']('/:id/teams',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x19')]);router[_0xcc6a('0x17')](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1a')]);router[_0xcc6a('0x1b')](_0xcc6a('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1c')]);router[_0xcc6a('0x1d')](_0xcc6a('0x14'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1e')]);router[_0xcc6a('0x1d')](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0x3914=['../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','isAuthenticated','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x163c27,_0x47177d){var _0x4cbc00=function(_0x3ca5c0){while(--_0x3ca5c0){_0x163c27['push'](_0x163c27['shift']());}};_0x4cbc00(++_0x47177d);}(_0x3914,0xeb));var _0x4391=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0x3914[_0x7a112];return _0x136dc5;};'use strict';var multer=require(_0x4391('0x0'));var util=require(_0x4391('0x1'));var path=require('path');var timeout=require(_0x4391('0x2'));var express=require(_0x4391('0x3'));var router=express['Router']();var fs_extra=require(_0x4391('0x4'));var auth=require(_0x4391('0x5'));var interaction=require(_0x4391('0x6'));var config=require('../../config/environment');var controller=require(_0x4391('0x7'));router[_0x4391('0x8')]('/',auth['isAuthenticated'](),controller[_0x4391('0x9')]);router['get'](_0x4391('0xa'),auth['isAuthenticated'](),controller[_0x4391('0xb')]);router[_0x4391('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4391('0xc')]);router[_0x4391('0x8')](_0x4391('0xd'),auth['isAuthenticated'](),controller[_0x4391('0xe')]);router[_0x4391('0x8')](_0x4391('0xf'),auth[_0x4391('0x10')](),controller['getTeams']);router[_0x4391('0x8')](_0x4391('0x11'),auth[_0x4391('0x10')](),controller[_0x4391('0x12')]);router[_0x4391('0x13')]('/',auth[_0x4391('0x10')](),controller[_0x4391('0x14')]);router[_0x4391('0x13')]('/:id/teams',auth[_0x4391('0x10')](),controller[_0x4391('0x15')]);router[_0x4391('0x13')](_0x4391('0x11'),auth['isAuthenticated'](),controller[_0x4391('0x16')]);router['put'](_0x4391('0x17'),auth[_0x4391('0x10')](),controller[_0x4391('0x18')]);router[_0x4391('0x19')](_0x4391('0x17'),auth[_0x4391('0x10')](),controller[_0x4391('0x1a')]);router[_0x4391('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4391('0x1b')]);router['delete'](_0x4391('0x11'),auth[_0x4391('0x10')](),controller[_0x4391('0x1c')]);module[_0x4391('0x1d')]=router;
\ No newline at end of file
index b370b85..eeccb80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc22d=['STRING','sequelize','exports','DATE'];(function(_0x54dc5c,_0x5476a9){var _0x2d3a67=function(_0xef77e7){while(--_0xef77e7){_0x54dc5c['push'](_0x54dc5c['shift']());}};_0x2d3a67(++_0x5476a9);}(_0xc22d,0x151));var _0xdc22=function(_0xae54d9,_0x5b7975){_0xae54d9=_0xae54d9-0x0;var _0xb6f187=_0xc22d[_0xae54d9];return _0xb6f187;};'use strict';var moment=require('moment');var Sequelize=require(_0xdc22('0x0'));module[_0xdc22('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xdc22('0x2')]},'leaveAt':{'type':Sequelize[_0xdc22('0x2')]},'acceptAt':{'type':Sequelize[_0xdc22('0x2')]},'exitAt':{'type':Sequelize[_0xdc22('0x2')]},'reason':{'type':Sequelize[_0xdc22('0x3')]}};
\ No newline at end of file
+var _0xe557=['moment','sequelize','exports','STRING','DATE'];(function(_0x3208f1,_0x5d8a51){var _0xa1d70f=function(_0x4b6bc2){while(--_0x4b6bc2){_0x3208f1['push'](_0x3208f1['shift']());}};_0xa1d70f(++_0x5d8a51);}(_0xe557,0x154));var _0x7e55=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe557[_0x5b644e];return _0x49c6bf;};'use strict';var moment=require(_0x7e55('0x0'));var Sequelize=require(_0x7e55('0x1'));module[_0x7e55('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x7e55('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7e55('0x4')]},'exitAt':{'type':Sequelize[_0x7e55('0x4')]},'reason':{'type':Sequelize[_0x7e55('0x3')]}};
\ No newline at end of file
index 86f5081..0c75701 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde9d=['../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','apply','reject','save','update','then','end','error','name','send','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','show','keys','options','create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x17ce52,_0x174d05){var _0x468524=function(_0x5c44b5){while(--_0x5c44b5){_0x17ce52['push'](_0x17ce52['shift']());}};_0x468524(++_0x174d05);}(_0xde9d,0x156));var _0xdde9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xde9d[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xdde9('0x0'));var rimraf=require(_0xdde9('0x1'));var zipdir=require(_0xdde9('0x2'));var jsonpatch=require(_0xdde9('0x3'));var rp=require(_0xdde9('0x4'));var moment=require('moment');var BPromise=require(_0xdde9('0x5'));var Mustache=require(_0xdde9('0x6'));var util=require(_0xdde9('0x7'));var path=require('path');var sox=require(_0xdde9('0x8'));var csv=require(_0xdde9('0x9'));var ejs=require(_0xdde9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdde9('0xb'));var squel=require(_0xdde9('0xc'));var crypto=require(_0xdde9('0xd'));var jsforce=require(_0xdde9('0xe'));var deskjs=require(_0xdde9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdde9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdde9('0x11'));var qs=require(_0xdde9('0x12'));var as=require(_0xdde9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdde9('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xdde9('0x15'));var licenseUtil=require(_0xdde9('0x16'));var db=require(_0xdde9('0x17'))['db'];function respondWithStatusCode(_0x582988,_0x528e7a){_0x528e7a=_0x528e7a||0xcc;return function(_0x29102e){if(_0x29102e){return _0x582988[_0xdde9('0x18')](_0x528e7a);}return _0x582988['status'](_0x528e7a)['end']();};}function respondWithResult(_0x2bab76,_0x1a1f1a){_0x1a1f1a=_0x1a1f1a||0xc8;return function(_0x49fc90){if(_0x49fc90){return _0x2bab76[_0xdde9('0x19')](_0x1a1f1a)[_0xdde9('0x1a')](_0x49fc90);}};}function respondWithFilteredResult(_0x456f27,_0x5f380b){return function(_0x2709e9){if(_0x2709e9){var _0x4cf6da=typeof _0x5f380b['offset']===_0xdde9('0x1b')&&typeof _0x5f380b['limit']==='undefined';var _0x4b690f=_0x2709e9[_0xdde9('0x1c')];var _0x2e0ed9=_0x4cf6da?0x0:_0x5f380b[_0xdde9('0x1d')];var _0x2e4b89=_0x4cf6da?_0x2709e9[_0xdde9('0x1c')]:_0x5f380b[_0xdde9('0x1d')]+_0x5f380b[_0xdde9('0x1e')];var _0x145075;if(_0x2e4b89>=_0x4b690f){_0x2e4b89=_0x4b690f;_0x145075=0xc8;}else{_0x145075=0xce;}_0x456f27[_0xdde9('0x19')](_0x145075);return _0x456f27['set']('Content-Range',_0x2e0ed9+'-'+_0x2e4b89+'/'+_0x4b690f)[_0xdde9('0x1a')](_0x2709e9);}return null;};}function patchUpdates(_0x26204d){return function(_0x2d5a1d){try{jsonpatch[_0xdde9('0x1f')](_0x2d5a1d,_0x26204d,!![]);}catch(_0x25f71e){return BPromise[_0xdde9('0x20')](_0x25f71e);}return _0x2d5a1d[_0xdde9('0x21')]();};}function saveUpdates(_0x5615c8,_0x2a156d){return function(_0xf48a7){if(_0xf48a7){return _0xf48a7[_0xdde9('0x22')](_0x5615c8)['then'](function(_0x4eac0a){return _0x4eac0a;});}return null;};}function removeEntity(_0x1ac564,_0x22a8af){return function(_0x115534){if(_0x115534){return _0x115534['destroy']()[_0xdde9('0x23')](function(){_0x1ac564[_0xdde9('0x19')](0xcc)[_0xdde9('0x24')]();});}};}function handleEntityNotFound(_0xfe0286,_0x5069dc){return function(_0x5e5ffd){if(!_0x5e5ffd){_0xfe0286['sendStatus'](0x194);}return _0x5e5ffd;};}function handleError(_0x206395,_0x4b8f24){_0x4b8f24=_0x4b8f24||0x1f4;return function(_0x2c10c1){logger[_0xdde9('0x25')](_0x2c10c1['stack']);if(_0x2c10c1['name']){delete _0x2c10c1[_0xdde9('0x26')];}_0x206395[_0xdde9('0x19')](_0x4b8f24)[_0xdde9('0x27')](_0x2c10c1);};}exports['index']=function(_0x4461db,_0x43a382){var _0xabd89d={},_0x42f3bd={},_0x306575={'count':0x0,'rows':[]};var _0x2e2fb4=_[_0xdde9('0x28')](db[_0xdde9('0x29')][_0xdde9('0x2a')],function(_0x574e57){return{'name':_0x574e57[_0xdde9('0x2b')],'type':_0x574e57['type'][_0xdde9('0x2c')]};});_0x42f3bd[_0xdde9('0x2d')]=_[_0xdde9('0x28')](_0x2e2fb4,'name');_0x42f3bd['query']=_['keys'](_0x4461db[_0xdde9('0x2e')]);_0x42f3bd[_0xdde9('0x2f')]=_[_0xdde9('0x30')](_0x42f3bd[_0xdde9('0x2d')],_0x42f3bd[_0xdde9('0x2e')]);_0xabd89d[_0xdde9('0x31')]=_[_0xdde9('0x30')](_0x42f3bd[_0xdde9('0x2d')],qs['fields'](_0x4461db[_0xdde9('0x2e')][_0xdde9('0x32')]));_0xabd89d[_0xdde9('0x31')]=_0xabd89d[_0xdde9('0x31')][_0xdde9('0x33')]?_0xabd89d[_0xdde9('0x31')]:_0x42f3bd[_0xdde9('0x2d')];if(!_0x4461db[_0xdde9('0x2e')]['hasOwnProperty'](_0xdde9('0x34'))){_0xabd89d[_0xdde9('0x1e')]=qs[_0xdde9('0x1e')](_0x4461db[_0xdde9('0x2e')][_0xdde9('0x1e')]);_0xabd89d[_0xdde9('0x1d')]=qs['offset'](_0x4461db[_0xdde9('0x2e')][_0xdde9('0x1d')]);}_0xabd89d[_0xdde9('0x35')]=qs[_0xdde9('0x36')](_0x4461db[_0xdde9('0x2e')][_0xdde9('0x36')]);_0xabd89d['where']=qs['filters'](_[_0xdde9('0x37')](_0x4461db[_0xdde9('0x2e')],_0x42f3bd[_0xdde9('0x2f')]),_0x2e2fb4);if(_0x4461db[_0xdde9('0x2e')][_0xdde9('0x38')]){_0xabd89d[_0xdde9('0x39')]=_[_0xdde9('0x3a')](_0xabd89d['where'],{'$or':_[_0xdde9('0x28')](_0x2e2fb4,function(_0x501119){if(_0x501119['type']!==_0xdde9('0x3b')){var _0x5a3f7d={};_0x5a3f7d[_0x501119[_0xdde9('0x26')]]={'$like':'%'+_0x4461db['query']['filter']+'%'};return _0x5a3f7d;}})});}_0xabd89d=_[_0xdde9('0x3a')]({},_0xabd89d,_0x4461db['options']);var _0x1bc20a={'where':_0xabd89d['where']};return db[_0xdde9('0x29')]['count'](_0x1bc20a)[_0xdde9('0x23')](function(_0x5860b7){_0x306575[_0xdde9('0x1c')]=_0x5860b7;if(_0x4461db['query'][_0xdde9('0x3c')]){_0xabd89d[_0xdde9('0x3d')]=[{'all':!![]}];}return db[_0xdde9('0x29')]['findAll'](_0xabd89d);})[_0xdde9('0x23')](function(_0x1314c3){_0x306575[_0xdde9('0x3e')]=_0x1314c3;return _0x306575;})[_0xdde9('0x23')](respondWithFilteredResult(_0x43a382,_0xabd89d))[_0xdde9('0x3f')](handleError(_0x43a382,null));};exports[_0xdde9('0x40')]=function(_0x2e644c,_0x2c5632){var _0x215a4e={'raw':!![],'where':{'id':_0x2e644c['params']['id']}},_0x2e210f={};_0x2e210f[_0xdde9('0x2d')]=_[_0xdde9('0x41')](db[_0xdde9('0x29')][_0xdde9('0x2a')]);_0x2e210f['query']=_[_0xdde9('0x41')](_0x2e644c['query']);_0x2e210f[_0xdde9('0x2f')]=_['intersection'](_0x2e210f[_0xdde9('0x2d')],_0x2e210f['query']);_0x215a4e['attributes']=_[_0xdde9('0x30')](_0x2e210f[_0xdde9('0x2d')],qs[_0xdde9('0x32')](_0x2e644c[_0xdde9('0x2e')][_0xdde9('0x32')]));_0x215a4e[_0xdde9('0x31')]=_0x215a4e['attributes'][_0xdde9('0x33')]?_0x215a4e[_0xdde9('0x31')]:_0x2e210f['model'];if(_0x2e644c['query'][_0xdde9('0x3c')]){_0x215a4e[_0xdde9('0x3d')]=[{'all':!![]}];}_0x215a4e=_[_0xdde9('0x3a')]({},_0x215a4e,_0x2e644c[_0xdde9('0x42')]);return db[_0xdde9('0x29')]['find'](_0x215a4e)[_0xdde9('0x23')](handleEntityNotFound(_0x2c5632,null))[_0xdde9('0x23')](respondWithResult(_0x2c5632,null))['catch'](handleError(_0x2c5632,null));};exports[_0xdde9('0x43')]=function(_0x4d8003,_0xa7e225){return db['FaxQueueReport'][_0xdde9('0x43')](_0x4d8003['body'],{})[_0xdde9('0x23')](respondWithResult(_0xa7e225,0xc9))['catch'](handleError(_0xa7e225,null));};exports[_0xdde9('0x22')]=function(_0x328a4a,_0xd1f4cf){if(_0x328a4a[_0xdde9('0x44')]['id']){delete _0x328a4a[_0xdde9('0x44')]['id'];}return db[_0xdde9('0x29')][_0xdde9('0x45')]({'where':{'id':_0x328a4a[_0xdde9('0x46')]['id']}})['then'](handleEntityNotFound(_0xd1f4cf,null))['then'](saveUpdates(_0x328a4a[_0xdde9('0x44')],null))[_0xdde9('0x23')](respondWithResult(_0xd1f4cf,null))['catch'](handleError(_0xd1f4cf,null));};exports[_0xdde9('0x47')]=function(_0x47dfd8,_0x33a798){return db[_0xdde9('0x29')][_0xdde9('0x45')]({'where':{'id':_0x47dfd8[_0xdde9('0x46')]['id']}})[_0xdde9('0x23')](handleEntityNotFound(_0x33a798,null))[_0xdde9('0x23')](removeEntity(_0x33a798,null))[_0xdde9('0x3f')](handleError(_0x33a798,null));};exports[_0xdde9('0x48')]=function(_0x2e18dd,_0x96b9e0){return db[_0xdde9('0x29')]['describe']()[_0xdde9('0x23')](respondWithResult(_0x96b9e0,null))[_0xdde9('0x3f')](handleError(_0x96b9e0,null));};
\ No newline at end of file
+var _0x01d3=['path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','index','FaxQueueReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','type','VIRTUAL','include','rows','catch','show','params','includeAll','options','create','body','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x21e828,_0xda5f11){var _0x42a665=function(_0x153134){while(--_0x153134){_0x21e828['push'](_0x21e828['shift']());}};_0x42a665(++_0xda5f11);}(_0x01d3,0xdb));var _0x301d=function(_0x56e1c9,_0x5ea15e){_0x56e1c9=_0x56e1c9-0x0;var _0x1c00a1=_0x01d3[_0x56e1c9];return _0x1c00a1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x301d('0x0'));var jsonpatch=require(_0x301d('0x1'));var rp=require(_0x301d('0x2'));var moment=require('moment');var BPromise=require(_0x301d('0x3'));var Mustache=require(_0x301d('0x4'));var util=require(_0x301d('0x5'));var path=require(_0x301d('0x6'));var sox=require(_0x301d('0x7'));var csv=require('to-csv');var ejs=require(_0x301d('0x8'));var fs=require('fs');var fs_extra=require(_0x301d('0x9'));var _=require(_0x301d('0xa'));var squel=require(_0x301d('0xb'));var crypto=require(_0x301d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x301d('0xd'));var toCsv=require(_0x301d('0xe'));var querystring=require(_0x301d('0xf'));var Papa=require(_0x301d('0x10'));var Redis=require(_0x301d('0x11'));var authService=require(_0x301d('0x12'));var qs=require(_0x301d('0x13'));var as=require(_0x301d('0x14'));var hardwareService=require(_0x301d('0x15'));var logger=require('../../config/logger')(_0x301d('0x16'));var utils=require(_0x301d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x301d('0x18'));var db=require(_0x301d('0x19'))['db'];function respondWithStatusCode(_0x2eb3af,_0x53bfe2){_0x53bfe2=_0x53bfe2||0xcc;return function(_0x496f0c){if(_0x496f0c){return _0x2eb3af[_0x301d('0x1a')](_0x53bfe2);}return _0x2eb3af[_0x301d('0x1b')](_0x53bfe2)[_0x301d('0x1c')]();};}function respondWithResult(_0x377c7f,_0x11bacf){_0x11bacf=_0x11bacf||0xc8;return function(_0x5bdd8a){if(_0x5bdd8a){return _0x377c7f[_0x301d('0x1b')](_0x11bacf)['json'](_0x5bdd8a);}};}function respondWithFilteredResult(_0x1d4fb4,_0xc35239){return function(_0x4fd833){if(_0x4fd833){var _0x10d277=typeof _0xc35239[_0x301d('0x1d')]===_0x301d('0x1e')&&typeof _0xc35239[_0x301d('0x1f')]===_0x301d('0x1e');var _0x1c409b=_0x4fd833[_0x301d('0x20')];var _0x2c7afb=_0x10d277?0x0:_0xc35239[_0x301d('0x1d')];var _0x3a2ad2=_0x10d277?_0x4fd833[_0x301d('0x20')]:_0xc35239[_0x301d('0x1d')]+_0xc35239[_0x301d('0x1f')];var _0x3d75e5;if(_0x3a2ad2>=_0x1c409b){_0x3a2ad2=_0x1c409b;_0x3d75e5=0xc8;}else{_0x3d75e5=0xce;}_0x1d4fb4[_0x301d('0x1b')](_0x3d75e5);return _0x1d4fb4['set']('Content-Range',_0x2c7afb+'-'+_0x3a2ad2+'/'+_0x1c409b)['json'](_0x4fd833);}return null;};}function patchUpdates(_0x31c94e){return function(_0x17ee2a){try{jsonpatch[_0x301d('0x21')](_0x17ee2a,_0x31c94e,!![]);}catch(_0x4d8006){return BPromise[_0x301d('0x22')](_0x4d8006);}return _0x17ee2a[_0x301d('0x23')]();};}function saveUpdates(_0x5b6631,_0x485f96){return function(_0x292c89){if(_0x292c89){return _0x292c89[_0x301d('0x24')](_0x5b6631)[_0x301d('0x25')](function(_0x3fa47d){return _0x3fa47d;});}return null;};}function removeEntity(_0x549e57,_0x1119da){return function(_0x2491b8){if(_0x2491b8){return _0x2491b8[_0x301d('0x26')]()[_0x301d('0x25')](function(){_0x549e57[_0x301d('0x1b')](0xcc)[_0x301d('0x1c')]();});}};}function handleEntityNotFound(_0x4fae3d,_0x470b7a){return function(_0xb315b6){if(!_0xb315b6){_0x4fae3d[_0x301d('0x1a')](0x194);}return _0xb315b6;};}function handleError(_0x2f7092,_0x31ce2c){_0x31ce2c=_0x31ce2c||0x1f4;return function(_0x23c934){logger[_0x301d('0x27')](_0x23c934[_0x301d('0x28')]);if(_0x23c934['name']){delete _0x23c934[_0x301d('0x29')];}_0x2f7092['status'](_0x31ce2c)['send'](_0x23c934);};}exports[_0x301d('0x2a')]=function(_0x52eb42,_0x326722){var _0x119143={},_0x362c68={},_0x46127a={'count':0x0,'rows':[]};var _0xb6a139=_['map'](db[_0x301d('0x2b')][_0x301d('0x2c')],function(_0x2385ef){return{'name':_0x2385ef[_0x301d('0x2d')],'type':_0x2385ef['type']['key']};});_0x362c68['model']=_['map'](_0xb6a139,_0x301d('0x29'));_0x362c68[_0x301d('0x2e')]=_[_0x301d('0x2f')](_0x52eb42[_0x301d('0x2e')]);_0x362c68[_0x301d('0x30')]=_[_0x301d('0x31')](_0x362c68[_0x301d('0x32')],_0x362c68[_0x301d('0x2e')]);_0x119143[_0x301d('0x33')]=_[_0x301d('0x31')](_0x362c68['model'],qs[_0x301d('0x34')](_0x52eb42[_0x301d('0x2e')][_0x301d('0x34')]));_0x119143[_0x301d('0x33')]=_0x119143[_0x301d('0x33')][_0x301d('0x35')]?_0x119143[_0x301d('0x33')]:_0x362c68[_0x301d('0x32')];if(!_0x52eb42[_0x301d('0x2e')][_0x301d('0x36')]('nolimit')){_0x119143['limit']=qs[_0x301d('0x1f')](_0x52eb42[_0x301d('0x2e')][_0x301d('0x1f')]);_0x119143[_0x301d('0x1d')]=qs[_0x301d('0x1d')](_0x52eb42['query'][_0x301d('0x1d')]);}_0x119143[_0x301d('0x37')]=qs[_0x301d('0x38')](_0x52eb42['query'][_0x301d('0x38')]);_0x119143['where']=qs[_0x301d('0x30')](_[_0x301d('0x39')](_0x52eb42[_0x301d('0x2e')],_0x362c68[_0x301d('0x30')]),_0xb6a139);if(_0x52eb42[_0x301d('0x2e')][_0x301d('0x3a')]){_0x119143[_0x301d('0x3b')]=_[_0x301d('0x3c')](_0x119143['where'],{'$or':_[_0x301d('0x3d')](_0xb6a139,function(_0x2a1459){if(_0x2a1459[_0x301d('0x3e')]!==_0x301d('0x3f')){var _0xc4e7ff={};_0xc4e7ff[_0x2a1459['name']]={'$like':'%'+_0x52eb42['query']['filter']+'%'};return _0xc4e7ff;}})});}_0x119143=_[_0x301d('0x3c')]({},_0x119143,_0x52eb42['options']);var _0x35047e={'where':_0x119143[_0x301d('0x3b')]};return db[_0x301d('0x2b')][_0x301d('0x20')](_0x35047e)[_0x301d('0x25')](function(_0x5ee9cc){_0x46127a[_0x301d('0x20')]=_0x5ee9cc;if(_0x52eb42['query']['includeAll']){_0x119143[_0x301d('0x40')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x119143);})[_0x301d('0x25')](function(_0x168211){_0x46127a[_0x301d('0x41')]=_0x168211;return _0x46127a;})[_0x301d('0x25')](respondWithFilteredResult(_0x326722,_0x119143))[_0x301d('0x42')](handleError(_0x326722,null));};exports[_0x301d('0x43')]=function(_0x499ca8,_0x16a7ca){var _0x29ef1d={'raw':!![],'where':{'id':_0x499ca8[_0x301d('0x44')]['id']}},_0x3dd5f5={};_0x3dd5f5[_0x301d('0x32')]=_[_0x301d('0x2f')](db[_0x301d('0x2b')]['rawAttributes']);_0x3dd5f5[_0x301d('0x2e')]=_['keys'](_0x499ca8['query']);_0x3dd5f5[_0x301d('0x30')]=_[_0x301d('0x31')](_0x3dd5f5['model'],_0x3dd5f5[_0x301d('0x2e')]);_0x29ef1d[_0x301d('0x33')]=_['intersection'](_0x3dd5f5['model'],qs[_0x301d('0x34')](_0x499ca8[_0x301d('0x2e')][_0x301d('0x34')]));_0x29ef1d['attributes']=_0x29ef1d['attributes'][_0x301d('0x35')]?_0x29ef1d[_0x301d('0x33')]:_0x3dd5f5[_0x301d('0x32')];if(_0x499ca8[_0x301d('0x2e')][_0x301d('0x45')]){_0x29ef1d['include']=[{'all':!![]}];}_0x29ef1d=_[_0x301d('0x3c')]({},_0x29ef1d,_0x499ca8[_0x301d('0x46')]);return db[_0x301d('0x2b')]['find'](_0x29ef1d)[_0x301d('0x25')](handleEntityNotFound(_0x16a7ca,null))[_0x301d('0x25')](respondWithResult(_0x16a7ca,null))[_0x301d('0x42')](handleError(_0x16a7ca,null));};exports[_0x301d('0x47')]=function(_0x54cce3,_0x2c1fc8){return db['FaxQueueReport'][_0x301d('0x47')](_0x54cce3['body'],{})[_0x301d('0x25')](respondWithResult(_0x2c1fc8,0xc9))[_0x301d('0x42')](handleError(_0x2c1fc8,null));};exports[_0x301d('0x24')]=function(_0x155912,_0x2ed897){if(_0x155912[_0x301d('0x48')]['id']){delete _0x155912[_0x301d('0x48')]['id'];}return db[_0x301d('0x2b')][_0x301d('0x49')]({'where':{'id':_0x155912['params']['id']}})[_0x301d('0x25')](handleEntityNotFound(_0x2ed897,null))[_0x301d('0x25')](saveUpdates(_0x155912[_0x301d('0x48')],null))[_0x301d('0x25')](respondWithResult(_0x2ed897,null))['catch'](handleError(_0x2ed897,null));};exports[_0x301d('0x26')]=function(_0x5c1d19,_0x59d4f4){return db['FaxQueueReport'][_0x301d('0x49')]({'where':{'id':_0x5c1d19['params']['id']}})['then'](handleEntityNotFound(_0x59d4f4,null))[_0x301d('0x25')](removeEntity(_0x59d4f4,null))[_0x301d('0x42')](handleError(_0x59d4f4,null));};exports[_0x301d('0x4a')]=function(_0x29cb7b,_0x243cb2){return db[_0x301d('0x2b')][_0x301d('0x4a')]()[_0x301d('0x25')](respondWithResult(_0x243cb2,null))[_0x301d('0x42')](handleError(_0x243cb2,null));};
\ No newline at end of file
index 3a3fef7..cb6e3ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x3d741e,_0x33bd61){var _0x2a5d01=function(_0x2f619e){while(--_0x2f619e){_0x3d741e['push'](_0x3d741e['shift']());}};_0x2a5d01(++_0x33bd61);}(_0x5fab,0x177));var _0xb5fa=function(_0x58eed6,_0x49a046){_0x58eed6=_0x58eed6-0x0;var _0x381fa7=_0x5fab[_0x58eed6];return _0x381fa7;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x4ef5a9,_0x42ce40){var _0x5e03f8=function(_0x21be6f){while(--_0x21be6f){_0x4ef5a9['push'](_0x4ef5a9['shift']());}};_0x5e03f8(++_0x42ce40);}(_0x7a54,0x106));var _0x47a5=function(_0x2b268e,_0x105939){_0x2b268e=_0x2b268e-0x0;var _0x1119f5=_0x7a54[_0x2b268e];return _0x1119f5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index f8d2bde..d4ff157 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4d5=['debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','FaxQueueReport','update','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4997df,_0x2d97ba){var _0x596dd6=function(_0x58260a){while(--_0x58260a){_0x4997df['push'](_0x4997df['shift']());}};_0x596dd6(++_0x2d97ba);}(_0xa4d5,0x1b1));var _0x5a4d=function(_0x52ad5f,_0x16d1a3){_0x52ad5f=_0x52ad5f-0x0;var _0xb217a2=_0xa4d5[_0x52ad5f];return _0xb217a2;};'use strict';var _=require(_0x5a4d('0x0'));var util=require('util');var moment=require(_0x5a4d('0x1'));var BPromise=require(_0x5a4d('0x2'));var rs=require(_0x5a4d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a4d('0x4'))['db'];var utils=require(_0x5a4d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5a4d('0x6'));var jayson=require(_0x5a4d('0x7'));var client=jayson[_0x5a4d('0x8')][_0x5a4d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46f507,_0x4afe78,_0x47f43a){return new BPromise(function(_0x26ebbf,_0x37ac5c){return client[_0x5a4d('0xa')](_0x46f507,_0x47f43a)[_0x5a4d('0xb')](function(_0x2528fc){logger[_0x5a4d('0xc')](_0x5a4d('0xd'),_0x4afe78,_0x5a4d('0xe'));logger[_0x5a4d('0xf')](_0x5a4d('0x10'),_0x4afe78,_0x5a4d('0xe'),JSON[_0x5a4d('0x11')](_0x2528fc));if(_0x2528fc[_0x5a4d('0x12')]){if(_0x2528fc['error']['code']===0x1f4){logger['error'](_0x5a4d('0xd'),_0x4afe78,_0x2528fc[_0x5a4d('0x12')]['message']);return _0x37ac5c(_0x2528fc[_0x5a4d('0x12')][_0x5a4d('0x13')]);}logger[_0x5a4d('0x12')](_0x5a4d('0xd'),_0x4afe78,_0x2528fc[_0x5a4d('0x12')]['message']);return _0x26ebbf(_0x2528fc['error'][_0x5a4d('0x13')]);}else{logger[_0x5a4d('0xc')](_0x5a4d('0xd'),_0x4afe78,_0x5a4d('0xe'));_0x26ebbf(_0x2528fc[_0x5a4d('0x14')][_0x5a4d('0x13')]);}})[_0x5a4d('0x15')](function(_0x5e4748){logger[_0x5a4d('0x12')](_0x5a4d('0xd'),_0x4afe78,_0x5e4748);_0x37ac5c(_0x5e4748);});});}exports[_0x5a4d('0x16')]=function(_0x5cda31){var _0x17eeb9=this;return new Promise(function(_0x5e231f,_0x20c7d7){return db['FaxQueueReport'][_0x5a4d('0x17')](_0x5cda31[_0x5a4d('0x18')],{'raw':_0x5cda31[_0x5a4d('0x19')]?_0x5cda31[_0x5a4d('0x19')][_0x5a4d('0x1a')]===undefined?!![]:![]:!![]})[_0x5a4d('0xb')](function(_0x1120f9){logger[_0x5a4d('0xc')](_0x5a4d('0x16'),_0x5cda31);logger[_0x5a4d('0xf')](_0x5a4d('0x16'),_0x5cda31,JSON[_0x5a4d('0x11')](_0x1120f9));_0x5e231f(_0x1120f9);})[_0x5a4d('0x15')](function(_0x5e624d){logger[_0x5a4d('0x12')]('CreateFaxQueueReport',_0x5e624d[_0x5a4d('0x13')],_0x5cda31);_0x20c7d7(_0x17eeb9[_0x5a4d('0x12')](0x1f4,_0x5e624d[_0x5a4d('0x13')]));});});};exports[_0x5a4d('0x1b')]=function(_0x3fb195){var _0xaca6eb=this;return new Promise(function(_0x36dc4c,_0x9fb3a){return db[_0x5a4d('0x1c')][_0x5a4d('0x1d')](_0x3fb195['body'],{'raw':_0x3fb195[_0x5a4d('0x19')]?_0x3fb195[_0x5a4d('0x19')][_0x5a4d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fb195[_0x5a4d('0x19')]?_0x3fb195[_0x5a4d('0x19')]['where']||null:null,'attributes':_0x3fb195['options']?_0x3fb195[_0x5a4d('0x19')][_0x5a4d('0x1e')]||null:null,'limit':_0x3fb195[_0x5a4d('0x19')]?_0x3fb195[_0x5a4d('0x19')][_0x5a4d('0x1f')]||null:null})['then'](function(_0x32dca2){logger[_0x5a4d('0xc')](_0x5a4d('0x1b'),_0x3fb195);logger['debug']('UpdateFaxQueueReport',_0x3fb195,JSON[_0x5a4d('0x11')](_0x32dca2));_0x36dc4c(_0x32dca2);})[_0x5a4d('0x15')](function(_0x56876d){logger[_0x5a4d('0x12')](_0x5a4d('0x1b'),_0x56876d[_0x5a4d('0x13')],_0x3fb195);_0x9fb3a(_0xaca6eb[_0x5a4d('0x12')](0x1f4,_0x56876d['message']));});});};
\ No newline at end of file
+var _0x2a82=['info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','create','body','options','raw','CreateFaxQueueReport','FaxQueueReport','update','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x16f77c,_0x5256b1){var _0x78986e=function(_0x10430){while(--_0x10430){_0x16f77c['push'](_0x16f77c['shift']());}};_0x78986e(++_0x5256b1);}(_0x2a82,0x125));var _0x22a8=function(_0x2fc0a1,_0x512b6a){_0x2fc0a1=_0x2fc0a1-0x0;var _0x59026d=_0x2a82[_0x2fc0a1];return _0x59026d;};'use strict';var _=require(_0x22a8('0x0'));var util=require(_0x22a8('0x1'));var moment=require(_0x22a8('0x2'));var BPromise=require(_0x22a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x22a8('0x4'));var logger=require(_0x22a8('0x5'))(_0x22a8('0x6'));var config=require(_0x22a8('0x7'));var jayson=require(_0x22a8('0x8'));var client=jayson[_0x22a8('0x9')][_0x22a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x442cfb,_0x183e66,_0x13ebfb){return new BPromise(function(_0xd3fc27,_0x25c6a6){return client[_0x22a8('0xb')](_0x442cfb,_0x13ebfb)[_0x22a8('0xc')](function(_0x4a9215){logger[_0x22a8('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x183e66,_0x22a8('0xe'));logger[_0x22a8('0xf')](_0x22a8('0x10'),_0x183e66,'request\x20sent',JSON[_0x22a8('0x11')](_0x4a9215));if(_0x4a9215[_0x22a8('0x12')]){if(_0x4a9215[_0x22a8('0x12')][_0x22a8('0x13')]===0x1f4){logger[_0x22a8('0x12')](_0x22a8('0x14'),_0x183e66,_0x4a9215[_0x22a8('0x12')][_0x22a8('0x15')]);return _0x25c6a6(_0x4a9215[_0x22a8('0x12')][_0x22a8('0x15')]);}logger[_0x22a8('0x12')](_0x22a8('0x14'),_0x183e66,_0x4a9215['error']['message']);return _0xd3fc27(_0x4a9215[_0x22a8('0x12')][_0x22a8('0x15')]);}else{logger[_0x22a8('0xd')](_0x22a8('0x14'),_0x183e66,_0x22a8('0xe'));_0xd3fc27(_0x4a9215[_0x22a8('0x16')][_0x22a8('0x15')]);}})[_0x22a8('0x17')](function(_0x930589){logger[_0x22a8('0x12')](_0x22a8('0x14'),_0x183e66,_0x930589);_0x25c6a6(_0x930589);});});}exports['CreateFaxQueueReport']=function(_0x243d93){var _0x55d5a6=this;return new Promise(function(_0x3f1fc8,_0x2503a4){return db['FaxQueueReport'][_0x22a8('0x18')](_0x243d93[_0x22a8('0x19')],{'raw':_0x243d93[_0x22a8('0x1a')]?_0x243d93[_0x22a8('0x1a')][_0x22a8('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x57d461){logger[_0x22a8('0xd')](_0x22a8('0x1c'),_0x243d93);logger[_0x22a8('0xf')](_0x22a8('0x1c'),_0x243d93,JSON[_0x22a8('0x11')](_0x57d461));_0x3f1fc8(_0x57d461);})[_0x22a8('0x17')](function(_0x91a5a6){logger[_0x22a8('0x12')]('CreateFaxQueueReport',_0x91a5a6[_0x22a8('0x15')],_0x243d93);_0x2503a4(_0x55d5a6[_0x22a8('0x12')](0x1f4,_0x91a5a6[_0x22a8('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0x418020){var _0x42d60f=this;return new Promise(function(_0x4ad1f2,_0x3acfe5){return db[_0x22a8('0x1d')][_0x22a8('0x1e')](_0x418020['body'],{'raw':_0x418020[_0x22a8('0x1a')]?_0x418020['options'][_0x22a8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x418020[_0x22a8('0x1a')]?_0x418020[_0x22a8('0x1a')]['where']||null:null,'attributes':_0x418020[_0x22a8('0x1a')]?_0x418020[_0x22a8('0x1a')][_0x22a8('0x1f')]||null:null,'limit':_0x418020[_0x22a8('0x1a')]?_0x418020[_0x22a8('0x1a')][_0x22a8('0x20')]||null:null})[_0x22a8('0xc')](function(_0x41e54a){logger['info'](_0x22a8('0x21'),_0x418020);logger[_0x22a8('0xf')](_0x22a8('0x21'),_0x418020,JSON[_0x22a8('0x11')](_0x41e54a));_0x4ad1f2(_0x41e54a);})['catch'](function(_0x8cc0d8){logger[_0x22a8('0x12')](_0x22a8('0x21'),_0x8cc0d8['message'],_0x418020);_0x3acfe5(_0x42d60f[_0x22a8('0x12')](0x1f4,_0x8cc0d8[_0x22a8('0x15')]));});});};
\ No newline at end of file
index 920e785..c32a0b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc481=['express','Router','fs-extra','./faxQueueReport.controller','isAuthenticated','get','/describe','/:id','show','create','put','update','delete','exports','util','path','connect-timeout'];(function(_0xc81ca7,_0xb90d5){var _0x366401=function(_0x181f0a){while(--_0x181f0a){_0xc81ca7['push'](_0xc81ca7['shift']());}};_0x366401(++_0xb90d5);}(_0xc481,0x11e));var _0x1c48=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0xc481[_0x2e0ffa];return _0x24d627;};'use strict';var multer=require('multer');var util=require(_0x1c48('0x0'));var path=require(_0x1c48('0x1'));var timeout=require(_0x1c48('0x2'));var express=require(_0x1c48('0x3'));var router=express[_0x1c48('0x4')]();var fs_extra=require(_0x1c48('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1c48('0x6'));router['get']('/',auth[_0x1c48('0x7')](),controller['index']);router[_0x1c48('0x8')](_0x1c48('0x9'),auth[_0x1c48('0x7')](),controller['describe']);router[_0x1c48('0x8')](_0x1c48('0xa'),auth[_0x1c48('0x7')](),controller[_0x1c48('0xb')]);router['post']('/',auth[_0x1c48('0x7')](),controller[_0x1c48('0xc')]);router[_0x1c48('0xd')](_0x1c48('0xa'),auth[_0x1c48('0x7')](),controller[_0x1c48('0xe')]);router[_0x1c48('0xf')]('/:id',auth[_0x1c48('0x7')](),controller['destroy']);module[_0x1c48('0x10')]=router;
\ No newline at end of file
+var _0x0c00=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x161a5b,_0x376fae){var _0x187e95=function(_0x1185fd){while(--_0x1185fd){_0x161a5b['push'](_0x161a5b['shift']());}};_0x187e95(++_0x376fae);}(_0x0c00,0x1cb));var _0x00c0=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x0c00[_0x1f9f37];return _0x21c080;};'use strict';var multer=require(_0x00c0('0x0'));var util=require(_0x00c0('0x1'));var path=require('path');var timeout=require(_0x00c0('0x2'));var express=require(_0x00c0('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x00c0('0x4'));var interaction=require(_0x00c0('0x5'));var config=require(_0x00c0('0x6'));var controller=require(_0x00c0('0x7'));router[_0x00c0('0x8')]('/',auth[_0x00c0('0x9')](),controller[_0x00c0('0xa')]);router[_0x00c0('0x8')](_0x00c0('0xb'),auth[_0x00c0('0x9')](),controller[_0x00c0('0xc')]);router[_0x00c0('0x8')](_0x00c0('0xd'),auth['isAuthenticated'](),controller[_0x00c0('0xe')]);router[_0x00c0('0xf')]('/',auth['isAuthenticated'](),controller[_0x00c0('0x10')]);router[_0x00c0('0x11')](_0x00c0('0xd'),auth[_0x00c0('0x9')](),controller[_0x00c0('0x12')]);router[_0x00c0('0x13')]('/:id',auth[_0x00c0('0x9')](),controller[_0x00c0('0x14')]);module['exports']=router;
\ No newline at end of file
index c137382..f2e5a6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0x9bde,0xe1));var _0xe9bd=function(_0x43b425,_0x16f269){_0x43b425=_0x43b425-0x0;var _0x1fbfcb=_0x9bde[_0x43b425];return _0x1fbfcb;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x5d0bcd,_0xb04bf2){var _0xd0b62d=function(_0x18d7ed){while(--_0x18d7ed){_0x5d0bcd['push'](_0x5d0bcd['shift']());}};_0xd0b62d(++_0xb04bf2);}(_0xe706,0xa3));var _0x6e70=function(_0x4ddc0e,_0x349cab){_0x4ddc0e=_0x4ddc0e-0x0;var _0x17a6a4=_0xe706[_0x4ddc0e];return _0x17a6a4;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
index 800ad4c..74fc56a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a1d=['to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','end','error','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x39ec39,_0x129996){var _0x2eaa85=function(_0x4deaae){while(--_0x4deaae){_0x39ec39['push'](_0x39ec39['shift']());}};_0x2eaa85(++_0x129996);}(_0x0a1d,0x12e));var _0xd0a1=function(_0x57a2eb,_0x499e89){_0x57a2eb=_0x57a2eb-0x0;var _0x45d20d=_0x0a1d[_0x57a2eb];return _0x45d20d;};'use strict';var emlformat=require(_0xd0a1('0x0'));var rimraf=require(_0xd0a1('0x1'));var zipdir=require(_0xd0a1('0x2'));var jsonpatch=require(_0xd0a1('0x3'));var rp=require(_0xd0a1('0x4'));var moment=require(_0xd0a1('0x5'));var BPromise=require(_0xd0a1('0x6'));var Mustache=require('mustache');var util=require(_0xd0a1('0x7'));var path=require(_0xd0a1('0x8'));var sox=require(_0xd0a1('0x9'));var csv=require(_0xd0a1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd0a1('0xb'));var _=require(_0xd0a1('0xc'));var squel=require(_0xd0a1('0xd'));var crypto=require(_0xd0a1('0xe'));var jsforce=require(_0xd0a1('0xf'));var deskjs=require(_0xd0a1('0x10'));var toCsv=require(_0xd0a1('0xa'));var querystring=require(_0xd0a1('0x11'));var Papa=require(_0xd0a1('0x12'));var Redis=require(_0xd0a1('0x13'));var authService=require(_0xd0a1('0x14'));var qs=require(_0xd0a1('0x15'));var as=require(_0xd0a1('0x16'));var hardwareService=require(_0xd0a1('0x17'));var logger=require(_0xd0a1('0x18'))('api');var utils=require(_0xd0a1('0x19'));var config=require(_0xd0a1('0x1a'));var licenseUtil=require(_0xd0a1('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e148f,_0x4432ce){_0x4432ce=_0x4432ce||0xcc;return function(_0x526775){if(_0x526775){return _0x3e148f[_0xd0a1('0x1c')](_0x4432ce);}return _0x3e148f[_0xd0a1('0x1d')](_0x4432ce)['end']();};}function respondWithResult(_0x176162,_0x5d58de){_0x5d58de=_0x5d58de||0xc8;return function(_0x1da369){if(_0x1da369){return _0x176162['status'](_0x5d58de)[_0xd0a1('0x1e')](_0x1da369);}};}function respondWithFilteredResult(_0x184bd3,_0x5bbe44){return function(_0x1184ad){if(_0x1184ad){var _0x55cbbd=typeof _0x5bbe44[_0xd0a1('0x1f')]===_0xd0a1('0x20')&&typeof _0x5bbe44[_0xd0a1('0x21')]===_0xd0a1('0x20');var _0x1ede55=_0x1184ad['count'];var _0x520bb8=_0x55cbbd?0x0:_0x5bbe44[_0xd0a1('0x1f')];var _0x3083c8=_0x55cbbd?_0x1184ad[_0xd0a1('0x22')]:_0x5bbe44[_0xd0a1('0x1f')]+_0x5bbe44['limit'];var _0x316766;if(_0x3083c8>=_0x1ede55){_0x3083c8=_0x1ede55;_0x316766=0xc8;}else{_0x316766=0xce;}_0x184bd3[_0xd0a1('0x1d')](_0x316766);return _0x184bd3['set'](_0xd0a1('0x23'),_0x520bb8+'-'+_0x3083c8+'/'+_0x1ede55)['json'](_0x1184ad);}return null;};}function patchUpdates(_0x3b448a){return function(_0xc45ac9){try{jsonpatch[_0xd0a1('0x24')](_0xc45ac9,_0x3b448a,!![]);}catch(_0x534f9c){return BPromise['reject'](_0x534f9c);}return _0xc45ac9[_0xd0a1('0x25')]();};}function saveUpdates(_0xfd690b,_0x46bab3){return function(_0x409e41){if(_0x409e41){return _0x409e41[_0xd0a1('0x26')](_0xfd690b)['then'](function(_0x167608){return _0x167608;});}return null;};}function removeEntity(_0xb2542e,_0x324243){return function(_0x2248b4){if(_0x2248b4){return _0x2248b4[_0xd0a1('0x27')]()[_0xd0a1('0x28')](function(){_0xb2542e[_0xd0a1('0x1d')](0xcc)[_0xd0a1('0x29')]();});}};}function handleEntityNotFound(_0x251245,_0x34e5cd){return function(_0x444c71){if(!_0x444c71){_0x251245['sendStatus'](0x194);}return _0x444c71;};}function handleError(_0x34d18f,_0x4b2b84){_0x4b2b84=_0x4b2b84||0x1f4;return function(_0x59cb3a){logger[_0xd0a1('0x2a')](_0x59cb3a[_0xd0a1('0x2b')]);if(_0x59cb3a['name']){delete _0x59cb3a[_0xd0a1('0x2c')];}_0x34d18f[_0xd0a1('0x1d')](_0x4b2b84)[_0xd0a1('0x2d')](_0x59cb3a);};}exports[_0xd0a1('0x2e')]=function(_0xc6e639,_0x543903){var _0x529ce3={},_0x30c45c={},_0x53fa26={'count':0x0,'rows':[]};var _0xa1487a=_['map'](db[_0xd0a1('0x2f')][_0xd0a1('0x30')],function(_0x39bd04){return{'name':_0x39bd04[_0xd0a1('0x31')],'type':_0x39bd04[_0xd0a1('0x32')][_0xd0a1('0x33')]};});_0x30c45c[_0xd0a1('0x34')]=_[_0xd0a1('0x35')](_0xa1487a,_0xd0a1('0x2c'));_0x30c45c[_0xd0a1('0x36')]=_['keys'](_0xc6e639['query']);_0x30c45c[_0xd0a1('0x37')]=_[_0xd0a1('0x38')](_0x30c45c[_0xd0a1('0x34')],_0x30c45c[_0xd0a1('0x36')]);_0x529ce3['attributes']=_['intersection'](_0x30c45c['model'],qs[_0xd0a1('0x39')](_0xc6e639[_0xd0a1('0x36')][_0xd0a1('0x39')]));_0x529ce3[_0xd0a1('0x3a')]=_0x529ce3[_0xd0a1('0x3a')][_0xd0a1('0x3b')]?_0x529ce3[_0xd0a1('0x3a')]:_0x30c45c[_0xd0a1('0x34')];if(!_0xc6e639[_0xd0a1('0x36')]['hasOwnProperty'](_0xd0a1('0x3c'))){_0x529ce3[_0xd0a1('0x21')]=qs[_0xd0a1('0x21')](_0xc6e639[_0xd0a1('0x36')][_0xd0a1('0x21')]);_0x529ce3[_0xd0a1('0x1f')]=qs[_0xd0a1('0x1f')](_0xc6e639['query']['offset']);}_0x529ce3['order']=qs[_0xd0a1('0x3d')](_0xc6e639[_0xd0a1('0x36')]['sort']);_0x529ce3[_0xd0a1('0x3e')]=qs[_0xd0a1('0x37')](_[_0xd0a1('0x3f')](_0xc6e639['query'],_0x30c45c['filters']),_0xa1487a);if(_0xc6e639[_0xd0a1('0x36')][_0xd0a1('0x40')]){_0x529ce3[_0xd0a1('0x3e')]=_[_0xd0a1('0x41')](_0x529ce3[_0xd0a1('0x3e')],{'$or':_[_0xd0a1('0x35')](_0xa1487a,function(_0x8937a5){if(_0x8937a5['type']!==_0xd0a1('0x42')){var _0x189aa8={};_0x189aa8[_0x8937a5[_0xd0a1('0x2c')]]={'$like':'%'+_0xc6e639[_0xd0a1('0x36')][_0xd0a1('0x40')]+'%'};return _0x189aa8;}})});}_0x529ce3=_[_0xd0a1('0x41')]({},_0x529ce3,_0xc6e639[_0xd0a1('0x43')]);var _0x52261a={'where':_0x529ce3[_0xd0a1('0x3e')]};return db[_0xd0a1('0x2f')][_0xd0a1('0x22')](_0x52261a)['then'](function(_0x3f3850){_0x53fa26[_0xd0a1('0x22')]=_0x3f3850;if(_0xc6e639[_0xd0a1('0x36')][_0xd0a1('0x44')]){_0x529ce3[_0xd0a1('0x45')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x529ce3);})['then'](function(_0x4bc413){_0x53fa26[_0xd0a1('0x46')]=_0x4bc413;return _0x53fa26;})[_0xd0a1('0x28')](respondWithFilteredResult(_0x543903,_0x529ce3))[_0xd0a1('0x47')](handleError(_0x543903,null));};exports[_0xd0a1('0x48')]=function(_0x1fe226,_0x57a2ce){var _0xd15cd0={'raw':!![],'where':{'id':_0x1fe226[_0xd0a1('0x49')]['id']}},_0x3b89be={};_0x3b89be[_0xd0a1('0x34')]=_['keys'](db[_0xd0a1('0x2f')][_0xd0a1('0x30')]);_0x3b89be[_0xd0a1('0x36')]=_[_0xd0a1('0x4a')](_0x1fe226[_0xd0a1('0x36')]);_0x3b89be[_0xd0a1('0x37')]=_['intersection'](_0x3b89be[_0xd0a1('0x34')],_0x3b89be[_0xd0a1('0x36')]);_0xd15cd0[_0xd0a1('0x3a')]=_[_0xd0a1('0x38')](_0x3b89be[_0xd0a1('0x34')],qs['fields'](_0x1fe226[_0xd0a1('0x36')][_0xd0a1('0x39')]));_0xd15cd0['attributes']=_0xd15cd0[_0xd0a1('0x3a')]['length']?_0xd15cd0[_0xd0a1('0x3a')]:_0x3b89be[_0xd0a1('0x34')];if(_0x1fe226[_0xd0a1('0x36')]['includeAll']){_0xd15cd0[_0xd0a1('0x45')]=[{'all':!![]}];}_0xd15cd0=_[_0xd0a1('0x41')]({},_0xd15cd0,_0x1fe226[_0xd0a1('0x43')]);return db[_0xd0a1('0x2f')][_0xd0a1('0x4b')](_0xd15cd0)[_0xd0a1('0x28')](handleEntityNotFound(_0x57a2ce,null))[_0xd0a1('0x28')](respondWithResult(_0x57a2ce,null))[_0xd0a1('0x47')](handleError(_0x57a2ce,null));};exports[_0xd0a1('0x4c')]=function(_0xd1fd37,_0x28d3fa){return db[_0xd0a1('0x2f')][_0xd0a1('0x4c')](_0xd1fd37[_0xd0a1('0x4d')],{})[_0xd0a1('0x28')](respondWithResult(_0x28d3fa,0xc9))[_0xd0a1('0x47')](handleError(_0x28d3fa,null));};exports[_0xd0a1('0x26')]=function(_0x21499c,_0x1dff74){if(_0x21499c['body']['id']){delete _0x21499c[_0xd0a1('0x4d')]['id'];}return db[_0xd0a1('0x2f')][_0xd0a1('0x4b')]({'where':{'id':_0x21499c[_0xd0a1('0x49')]['id']}})['then'](handleEntityNotFound(_0x1dff74,null))[_0xd0a1('0x28')](saveUpdates(_0x21499c[_0xd0a1('0x4d')],null))[_0xd0a1('0x28')](respondWithResult(_0x1dff74,null))['catch'](handleError(_0x1dff74,null));};exports[_0xd0a1('0x27')]=function(_0x55a752,_0x212714){return db['FaxTransferReport']['find']({'where':{'id':_0x55a752[_0xd0a1('0x49')]['id']}})[_0xd0a1('0x28')](handleEntityNotFound(_0x212714,null))[_0xd0a1('0x28')](removeEntity(_0x212714,null))['catch'](handleError(_0x212714,null));};exports['describe']=function(_0x178f45,_0x3037c5){return db[_0xd0a1('0x2f')]['describe']()[_0xd0a1('0x28')](respondWithResult(_0x3037c5,null))[_0xd0a1('0x47')](handleError(_0x3037c5,null));};
\ No newline at end of file
+var _0x6f71=['include','find','create','body','update','describe','eml-format','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','save','then','destroy','error','stack','name','index','FaxTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','findAll','rows','catch','params'];(function(_0x136475,_0x33f4d4){var _0x1f2d5e=function(_0x317287){while(--_0x317287){_0x136475['push'](_0x136475['shift']());}};_0x1f2d5e(++_0x33f4d4);}(_0x6f71,0x15a));var _0x16f7=function(_0x306bcf,_0x5e71e8){_0x306bcf=_0x306bcf-0x0;var _0x342c9c=_0x6f71[_0x306bcf];return _0x342c9c;};'use strict';var emlformat=require(_0x16f7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x16f7('0x1'));var moment=require(_0x16f7('0x2'));var BPromise=require(_0x16f7('0x3'));var Mustache=require(_0x16f7('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x16f7('0x5'));var ejs=require(_0x16f7('0x6'));var fs=require('fs');var fs_extra=require(_0x16f7('0x7'));var _=require(_0x16f7('0x8'));var squel=require(_0x16f7('0x9'));var crypto=require('crypto');var jsforce=require(_0x16f7('0xa'));var deskjs=require(_0x16f7('0xb'));var toCsv=require(_0x16f7('0x5'));var querystring=require(_0x16f7('0xc'));var Papa=require('papaparse');var Redis=require(_0x16f7('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x16f7('0xe'));var hardwareService=require(_0x16f7('0xf'));var logger=require('../../config/logger')(_0x16f7('0x10'));var utils=require(_0x16f7('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x16f7('0x12'));var db=require(_0x16f7('0x13'))['db'];function respondWithStatusCode(_0xa3424f,_0xdf84c1){_0xdf84c1=_0xdf84c1||0xcc;return function(_0x3ce858){if(_0x3ce858){return _0xa3424f[_0x16f7('0x14')](_0xdf84c1);}return _0xa3424f[_0x16f7('0x15')](_0xdf84c1)[_0x16f7('0x16')]();};}function respondWithResult(_0x275e23,_0x1ec904){_0x1ec904=_0x1ec904||0xc8;return function(_0x3240dc){if(_0x3240dc){return _0x275e23[_0x16f7('0x15')](_0x1ec904)[_0x16f7('0x17')](_0x3240dc);}};}function respondWithFilteredResult(_0x575b49,_0x1dcc44){return function(_0xfc2e9d){if(_0xfc2e9d){var _0x1c7266=typeof _0x1dcc44[_0x16f7('0x18')]==='undefined'&&typeof _0x1dcc44[_0x16f7('0x19')]===_0x16f7('0x1a');var _0x447f6f=_0xfc2e9d[_0x16f7('0x1b')];var _0x57fea0=_0x1c7266?0x0:_0x1dcc44['offset'];var _0x345047=_0x1c7266?_0xfc2e9d['count']:_0x1dcc44[_0x16f7('0x18')]+_0x1dcc44[_0x16f7('0x19')];var _0x2166d3;if(_0x345047>=_0x447f6f){_0x345047=_0x447f6f;_0x2166d3=0xc8;}else{_0x2166d3=0xce;}_0x575b49[_0x16f7('0x15')](_0x2166d3);return _0x575b49[_0x16f7('0x1c')]('Content-Range',_0x57fea0+'-'+_0x345047+'/'+_0x447f6f)[_0x16f7('0x17')](_0xfc2e9d);}return null;};}function patchUpdates(_0x23dc32){return function(_0x57fad2){try{jsonpatch['apply'](_0x57fad2,_0x23dc32,!![]);}catch(_0x536fe7){return BPromise['reject'](_0x536fe7);}return _0x57fad2[_0x16f7('0x1d')]();};}function saveUpdates(_0xd14ce2,_0x170a50){return function(_0x286647){if(_0x286647){return _0x286647['update'](_0xd14ce2)[_0x16f7('0x1e')](function(_0x462119){return _0x462119;});}return null;};}function removeEntity(_0x42def5,_0x20a111){return function(_0x108503){if(_0x108503){return _0x108503[_0x16f7('0x1f')]()['then'](function(){_0x42def5[_0x16f7('0x15')](0xcc)[_0x16f7('0x16')]();});}};}function handleEntityNotFound(_0x4d660e,_0x2232e2){return function(_0x2e1445){if(!_0x2e1445){_0x4d660e[_0x16f7('0x14')](0x194);}return _0x2e1445;};}function handleError(_0x412cbc,_0x5129f9){_0x5129f9=_0x5129f9||0x1f4;return function(_0x2a4080){logger[_0x16f7('0x20')](_0x2a4080[_0x16f7('0x21')]);if(_0x2a4080[_0x16f7('0x22')]){delete _0x2a4080[_0x16f7('0x22')];}_0x412cbc[_0x16f7('0x15')](_0x5129f9)['send'](_0x2a4080);};}exports[_0x16f7('0x23')]=function(_0x4c9994,_0x503146){var _0x3ceb64={},_0x130197={},_0x5c53ff={'count':0x0,'rows':[]};var _0x23f8be=_['map'](db[_0x16f7('0x24')][_0x16f7('0x25')],function(_0x54faea){return{'name':_0x54faea[_0x16f7('0x26')],'type':_0x54faea[_0x16f7('0x27')][_0x16f7('0x28')]};});_0x130197['model']=_[_0x16f7('0x29')](_0x23f8be,'name');_0x130197[_0x16f7('0x2a')]=_[_0x16f7('0x2b')](_0x4c9994[_0x16f7('0x2a')]);_0x130197[_0x16f7('0x2c')]=_[_0x16f7('0x2d')](_0x130197[_0x16f7('0x2e')],_0x130197[_0x16f7('0x2a')]);_0x3ceb64['attributes']=_[_0x16f7('0x2d')](_0x130197[_0x16f7('0x2e')],qs[_0x16f7('0x2f')](_0x4c9994['query'][_0x16f7('0x2f')]));_0x3ceb64['attributes']=_0x3ceb64[_0x16f7('0x30')][_0x16f7('0x31')]?_0x3ceb64[_0x16f7('0x30')]:_0x130197[_0x16f7('0x2e')];if(!_0x4c9994['query'][_0x16f7('0x32')](_0x16f7('0x33'))){_0x3ceb64[_0x16f7('0x19')]=qs[_0x16f7('0x19')](_0x4c9994[_0x16f7('0x2a')][_0x16f7('0x19')]);_0x3ceb64['offset']=qs[_0x16f7('0x18')](_0x4c9994[_0x16f7('0x2a')][_0x16f7('0x18')]);}_0x3ceb64[_0x16f7('0x34')]=qs[_0x16f7('0x35')](_0x4c9994[_0x16f7('0x2a')][_0x16f7('0x35')]);_0x3ceb64[_0x16f7('0x36')]=qs[_0x16f7('0x2c')](_['pick'](_0x4c9994[_0x16f7('0x2a')],_0x130197[_0x16f7('0x2c')]),_0x23f8be);if(_0x4c9994[_0x16f7('0x2a')]['filter']){_0x3ceb64['where']=_[_0x16f7('0x37')](_0x3ceb64[_0x16f7('0x36')],{'$or':_[_0x16f7('0x29')](_0x23f8be,function(_0x18b19b){if(_0x18b19b['type']!==_0x16f7('0x38')){var _0x4337c2={};_0x4337c2[_0x18b19b[_0x16f7('0x22')]]={'$like':'%'+_0x4c9994['query']['filter']+'%'};return _0x4337c2;}})});}_0x3ceb64=_[_0x16f7('0x37')]({},_0x3ceb64,_0x4c9994['options']);var _0x5988aa={'where':_0x3ceb64['where']};return db[_0x16f7('0x24')][_0x16f7('0x1b')](_0x5988aa)[_0x16f7('0x1e')](function(_0x59a474){_0x5c53ff[_0x16f7('0x1b')]=_0x59a474;if(_0x4c9994[_0x16f7('0x2a')][_0x16f7('0x39')]){_0x3ceb64['include']=[{'all':!![]}];}return db[_0x16f7('0x24')][_0x16f7('0x3a')](_0x3ceb64);})['then'](function(_0x15c59a){_0x5c53ff[_0x16f7('0x3b')]=_0x15c59a;return _0x5c53ff;})[_0x16f7('0x1e')](respondWithFilteredResult(_0x503146,_0x3ceb64))[_0x16f7('0x3c')](handleError(_0x503146,null));};exports['show']=function(_0x599292,_0x1896e6){var _0x482b9e={'raw':!![],'where':{'id':_0x599292[_0x16f7('0x3d')]['id']}},_0x53892e={};_0x53892e[_0x16f7('0x2e')]=_[_0x16f7('0x2b')](db[_0x16f7('0x24')][_0x16f7('0x25')]);_0x53892e[_0x16f7('0x2a')]=_['keys'](_0x599292[_0x16f7('0x2a')]);_0x53892e[_0x16f7('0x2c')]=_[_0x16f7('0x2d')](_0x53892e[_0x16f7('0x2e')],_0x53892e[_0x16f7('0x2a')]);_0x482b9e[_0x16f7('0x30')]=_[_0x16f7('0x2d')](_0x53892e[_0x16f7('0x2e')],qs['fields'](_0x599292[_0x16f7('0x2a')]['fields']));_0x482b9e['attributes']=_0x482b9e[_0x16f7('0x30')][_0x16f7('0x31')]?_0x482b9e[_0x16f7('0x30')]:_0x53892e['model'];if(_0x599292[_0x16f7('0x2a')][_0x16f7('0x39')]){_0x482b9e[_0x16f7('0x3e')]=[{'all':!![]}];}_0x482b9e=_['merge']({},_0x482b9e,_0x599292['options']);return db[_0x16f7('0x24')][_0x16f7('0x3f')](_0x482b9e)['then'](handleEntityNotFound(_0x1896e6,null))['then'](respondWithResult(_0x1896e6,null))[_0x16f7('0x3c')](handleError(_0x1896e6,null));};exports[_0x16f7('0x40')]=function(_0x3ce036,_0x3b7f70){return db[_0x16f7('0x24')][_0x16f7('0x40')](_0x3ce036[_0x16f7('0x41')],{})[_0x16f7('0x1e')](respondWithResult(_0x3b7f70,0xc9))[_0x16f7('0x3c')](handleError(_0x3b7f70,null));};exports[_0x16f7('0x42')]=function(_0x2438e3,_0x171be3){if(_0x2438e3['body']['id']){delete _0x2438e3[_0x16f7('0x41')]['id'];}return db[_0x16f7('0x24')]['find']({'where':{'id':_0x2438e3[_0x16f7('0x3d')]['id']}})[_0x16f7('0x1e')](handleEntityNotFound(_0x171be3,null))[_0x16f7('0x1e')](saveUpdates(_0x2438e3['body'],null))[_0x16f7('0x1e')](respondWithResult(_0x171be3,null))[_0x16f7('0x3c')](handleError(_0x171be3,null));};exports['destroy']=function(_0x335bf9,_0x5600f4){return db[_0x16f7('0x24')]['find']({'where':{'id':_0x335bf9[_0x16f7('0x3d')]['id']}})[_0x16f7('0x1e')](handleEntityNotFound(_0x5600f4,null))[_0x16f7('0x1e')](removeEntity(_0x5600f4,null))[_0x16f7('0x3c')](handleError(_0x5600f4,null));};exports[_0x16f7('0x43')]=function(_0x57eb0a,_0x512a63){return db[_0x16f7('0x24')][_0x16f7('0x43')]()[_0x16f7('0x1e')](respondWithResult(_0x512a63,null))[_0x16f7('0x3c')](handleError(_0x512a63,null));};
\ No newline at end of file
index 79bc1e6..3ceceef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x969e=['api','moment','bluebird','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x4ecafc,_0x1bce03){var _0x48ffcb=function(_0x1529a6){while(--_0x1529a6){_0x4ecafc['push'](_0x4ecafc['shift']());}};_0x48ffcb(++_0x1bce03);}(_0x969e,0x136));var _0xe969=function(_0x1d2c59,_0x11984d){_0x1d2c59=_0x1d2c59-0x0;var _0x434555=_0x969e[_0x1d2c59];return _0x434555;};'use strict';var _=require(_0xe969('0x0'));var util=require(_0xe969('0x1'));var logger=require('../../config/logger')(_0xe969('0x2'));var moment=require(_0xe969('0x3'));var BPromise=require(_0xe969('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe969('0x5'));var attributes=require(_0xe969('0x6'));module[_0xe969('0x7')]=function(_0x18d730,_0x5d564d){return _0x18d730[_0xe969('0x8')](_0xe969('0x9'),attributes,{'tableName':_0xe969('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe969('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6fa=['api','request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb6fa[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xab6f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xab6f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xab6f('0x2'));var fs=require('fs');var path=require(_0xab6f('0x3'));var rimraf=require('rimraf');var config=require(_0xab6f('0x4'));var attributes=require(_0xab6f('0x5'));module[_0xab6f('0x6')]=function(_0x2d9d01,_0x156df7){return _0x2d9d01[_0xab6f('0x7')](_0xab6f('0x8'),attributes,{'tableName':_0xab6f('0x9'),'paranoid':![],'indexes':[{'name':_0xab6f('0xa'),'fields':[_0xab6f('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 4fdb792..9423871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d74=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4f4a0e,_0x3e689c){var _0x371dba=function(_0x2accfe){while(--_0x2accfe){_0x4f4a0e['push'](_0x4f4a0e['shift']());}};_0x371dba(++_0x3e689c);}(_0x6d74,0x133));var _0x46d7=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x6d74[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require('lodash');var util=require(_0x46d7('0x0'));var moment=require(_0x46d7('0x1'));var BPromise=require(_0x46d7('0x2'));var rs=require(_0x46d7('0x3'));var fs=require('fs');var Redis=require(_0x46d7('0x4'));var db=require(_0x46d7('0x5'))['db'];var utils=require(_0x46d7('0x6'));var logger=require('../../config/logger')(_0x46d7('0x7'));var config=require(_0x46d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46d7('0x9')][_0x46d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x337068,_0xba9ad6,_0x47229f){return new BPromise(function(_0x49e908,_0x596c14){return client[_0x46d7('0xb')](_0x337068,_0x47229f)[_0x46d7('0xc')](function(_0x5bfbaa){logger[_0x46d7('0xd')](_0x46d7('0xe'),_0xba9ad6,_0x46d7('0xf'));logger[_0x46d7('0x10')](_0x46d7('0x11'),_0xba9ad6,_0x46d7('0xf'),JSON[_0x46d7('0x12')](_0x5bfbaa));if(_0x5bfbaa[_0x46d7('0x13')]){if(_0x5bfbaa[_0x46d7('0x13')][_0x46d7('0x14')]===0x1f4){logger[_0x46d7('0x13')](_0x46d7('0xe'),_0xba9ad6,_0x5bfbaa[_0x46d7('0x13')][_0x46d7('0x15')]);return _0x596c14(_0x5bfbaa[_0x46d7('0x13')]['message']);}logger['error'](_0x46d7('0xe'),_0xba9ad6,_0x5bfbaa[_0x46d7('0x13')][_0x46d7('0x15')]);return _0x49e908(_0x5bfbaa[_0x46d7('0x13')][_0x46d7('0x15')]);}else{logger[_0x46d7('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0xba9ad6,_0x46d7('0xf'));_0x49e908(_0x5bfbaa[_0x46d7('0x16')][_0x46d7('0x15')]);}})[_0x46d7('0x17')](function(_0x2a34cc){logger['error'](_0x46d7('0xe'),_0xba9ad6,_0x2a34cc);_0x596c14(_0x2a34cc);});});}
\ No newline at end of file
+var _0x2513=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','result'];(function(_0x1d9d12,_0x2c7d98){var _0x4f680e=function(_0x4e1bbb){while(--_0x4e1bbb){_0x1d9d12['push'](_0x1d9d12['shift']());}};_0x4f680e(++_0x2c7d98);}(_0x2513,0x115));var _0x3251=function(_0x32450c,_0x5c7ce6){_0x32450c=_0x32450c-0x0;var _0xfa4502=_0x2513[_0x32450c];return _0xfa4502;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3251('0x0'));var BPromise=require(_0x3251('0x1'));var rs=require(_0x3251('0x2'));var fs=require('fs');var Redis=require(_0x3251('0x3'));var db=require(_0x3251('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3251('0x5'))(_0x3251('0x6'));var config=require(_0x3251('0x7'));var jayson=require(_0x3251('0x8'));var client=jayson[_0x3251('0x9')][_0x3251('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a885b,_0x464428,_0x23e131){return new BPromise(function(_0xb91faf,_0x5e2aeb){return client['request'](_0x3a885b,_0x23e131)[_0x3251('0xb')](function(_0x4343d6){logger[_0x3251('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x464428,'request\x20sent');logger[_0x3251('0xd')](_0x3251('0xe'),_0x464428,_0x3251('0xf'),JSON[_0x3251('0x10')](_0x4343d6));if(_0x4343d6[_0x3251('0x11')]){if(_0x4343d6[_0x3251('0x11')][_0x3251('0x12')]===0x1f4){logger[_0x3251('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x464428,_0x4343d6[_0x3251('0x11')][_0x3251('0x13')]);return _0x5e2aeb(_0x4343d6['error'][_0x3251('0x13')]);}logger[_0x3251('0x11')](_0x3251('0x14'),_0x464428,_0x4343d6[_0x3251('0x11')][_0x3251('0x13')]);return _0xb91faf(_0x4343d6[_0x3251('0x11')][_0x3251('0x13')]);}else{logger[_0x3251('0xc')](_0x3251('0x14'),_0x464428,_0x3251('0xf'));_0xb91faf(_0x4343d6[_0x3251('0x15')][_0x3251('0x13')]);}})[_0x3251('0x16')](function(_0x29f143){logger[_0x3251('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x464428,_0x29f143);_0x5e2aeb(_0x29f143);});});}
\ No newline at end of file
index 0098e93..a533930 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f2d=['post','create','put','/:id','destroy','multer','util','connect-timeout','express','Router','fs-extra','get','isAuthenticated','/describe','describe','show'];(function(_0x3f69e3,_0x191d58){var _0x1388f0=function(_0x50b7da){while(--_0x50b7da){_0x3f69e3['push'](_0x3f69e3['shift']());}};_0x1388f0(++_0x191d58);}(_0x4f2d,0x135));var _0xd4f2=function(_0x373d3c,_0x1efb60){_0x373d3c=_0x373d3c-0x0;var _0x800f14=_0x4f2d[_0x373d3c];return _0x800f14;};'use strict';var multer=require(_0xd4f2('0x0'));var util=require(_0xd4f2('0x1'));var path=require('path');var timeout=require(_0xd4f2('0x2'));var express=require(_0xd4f2('0x3'));var router=express[_0xd4f2('0x4')]();var fs_extra=require(_0xd4f2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0xd4f2('0x6')]('/',auth[_0xd4f2('0x7')](),controller['index']);router['get'](_0xd4f2('0x8'),auth[_0xd4f2('0x7')](),controller[_0xd4f2('0x9')]);router['get']('/:id',auth[_0xd4f2('0x7')](),controller[_0xd4f2('0xa')]);router[_0xd4f2('0xb')]('/',auth[_0xd4f2('0x7')](),controller[_0xd4f2('0xc')]);router[_0xd4f2('0xd')]('/:id',auth[_0xd4f2('0x7')](),controller['update']);router['delete'](_0xd4f2('0xe'),auth[_0xd4f2('0x7')](),controller[_0xd4f2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x1597=['index','/describe','/:id','create','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1597,0x135));var _0x7159=function(_0x3c6f79,_0x3ed502){_0x3c6f79=_0x3c6f79-0x0;var _0x311855=_0x1597[_0x3c6f79];return _0x311855;};'use strict';var multer=require(_0x7159('0x0'));var util=require(_0x7159('0x1'));var path=require(_0x7159('0x2'));var timeout=require('connect-timeout');var express=require(_0x7159('0x3'));var router=express[_0x7159('0x4')]();var fs_extra=require(_0x7159('0x5'));var auth=require(_0x7159('0x6'));var interaction=require(_0x7159('0x7'));var config=require('../../config/environment');var controller=require(_0x7159('0x8'));router[_0x7159('0x9')]('/',auth[_0x7159('0xa')](),controller[_0x7159('0xb')]);router['get'](_0x7159('0xc'),auth[_0x7159('0xa')](),controller['describe']);router['get'](_0x7159('0xd'),auth[_0x7159('0xa')](),controller['show']);router['post']('/',auth[_0x7159('0xa')](),controller[_0x7159('0xe')]);router['put'](_0x7159('0xd'),auth[_0x7159('0xa')](),controller['update']);router[_0x7159('0xf')](_0x7159('0xd'),auth[_0x7159('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 542c003..e8aed21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87d2=['addConfiguration','update','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x87d2,0x144));var _0x287d=function(_0x30f732,_0x1c81a7){_0x30f732=_0x30f732-0x0;var _0x51a7ee=_0x87d2[_0x30f732];return _0x51a7ee;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x287d('0x0'));var express=require(_0x287d('0x1'));var router=express[_0x287d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x287d('0x3'));var interaction=require(_0x287d('0x4'));var config=require('../../config/environment');var controller=require(_0x287d('0x5'));router[_0x287d('0x6')]('/',auth[_0x287d('0x7')](),controller[_0x287d('0x8')]);router[_0x287d('0x6')](_0x287d('0x9'),auth[_0x287d('0x7')](),controller[_0x287d('0xa')]);router[_0x287d('0x6')](_0x287d('0xb'),auth[_0x287d('0x7')](),controller[_0x287d('0xc')]);router[_0x287d('0x6')](_0x287d('0xd'),auth[_0x287d('0x7')](),controller[_0x287d('0xe')]);router[_0x287d('0xf')]('/',auth[_0x287d('0x7')](),controller['create']);router['post'](_0x287d('0xb'),auth[_0x287d('0x7')](),controller[_0x287d('0x10')]);router['put']('/:id',auth[_0x287d('0x7')](),controller[_0x287d('0x11')]);router['delete'](_0x287d('0x9'),auth[_0x287d('0x7')](),controller[_0x287d('0x12')]);module[_0x287d('0x13')]=router;
\ No newline at end of file
+var _0xde82=['express','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','delete','/:id','multer','util','path','connect-timeout'];(function(_0x45735b,_0x15bf2f){var _0x1c7553=function(_0x2e9713){while(--_0x2e9713){_0x45735b['push'](_0x45735b['shift']());}};_0x1c7553(++_0x15bf2f);}(_0xde82,0x176));var _0x2de8=function(_0x453a12,_0x5cb2ca){_0x453a12=_0x453a12-0x0;var _0x79b4e2=_0xde82[_0x453a12];return _0x79b4e2;};'use strict';var multer=require(_0x2de8('0x0'));var util=require(_0x2de8('0x1'));var path=require(_0x2de8('0x2'));var timeout=require(_0x2de8('0x3'));var express=require(_0x2de8('0x4'));var router=express['Router']();var fs_extra=require(_0x2de8('0x5'));var auth=require(_0x2de8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2de8('0x7'));var controller=require(_0x2de8('0x8'));router[_0x2de8('0x9')]('/',auth[_0x2de8('0xa')](),controller[_0x2de8('0xb')]);router['get']('/:id',auth[_0x2de8('0xa')](),controller[_0x2de8('0xc')]);router['get'](_0x2de8('0xd'),auth['isAuthenticated'](),controller[_0x2de8('0xe')]);router[_0x2de8('0x9')](_0x2de8('0xf'),auth[_0x2de8('0xa')](),controller[_0x2de8('0x10')]);router[_0x2de8('0x11')]('/',auth[_0x2de8('0xa')](),controller[_0x2de8('0x12')]);router['post'](_0x2de8('0xd'),auth[_0x2de8('0xa')](),controller['addConfiguration']);router['put']('/:id',auth[_0x2de8('0xa')](),controller['update']);router[_0x2de8('0x13')](_0x2de8('0x14'),auth[_0x2de8('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4539652..2822483 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32de=['integrationTab','newTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x1c5578,_0xbbb777){var _0x22dbf4=function(_0x5a0be8){while(--_0x5a0be8){_0x1c5578['push'](_0x1c5578['shift']());}};_0x22dbf4(++_0xbbb777);}(_0x32de,0x11a));var _0xe32d=function(_0x1cee55,_0xe75188){_0x1cee55=_0x1cee55-0x0;var _0x4f640a=_0x32de[_0x1cee55];return _0x4f640a;};'use strict';var Sequelize=require(_0xe32d('0x0'));module[_0xe32d('0x1')]={'name':{'type':Sequelize[_0xe32d('0x2')]},'description':{'type':Sequelize[_0xe32d('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe32d('0x2')]},'authType':{'type':Sequelize[_0xe32d('0x3')](_0xe32d('0x4')),'defaultValue':_0xe32d('0x4')},'password':{'type':Sequelize[_0xe32d('0x2')]},'consumerKey':{'type':Sequelize[_0xe32d('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe32d('0x2')]},'tokenSecret':{'type':Sequelize[_0xe32d('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe32d('0x5'),_0xe32d('0x6')),'defaultValue':_0xe32d('0x5')}};
\ No newline at end of file
+var _0x33f3=['exports','STRING','basic','integrationTab','newTab'];(function(_0x2c5614,_0x418e40){var _0x218f0c=function(_0x3ef91e){while(--_0x3ef91e){_0x2c5614['push'](_0x2c5614['shift']());}};_0x218f0c(++_0x418e40);}(_0x33f3,0x87));var _0x333f=function(_0x153340,_0x3527bf){_0x153340=_0x153340-0x0;var _0x1f968d=_0x33f3[_0x153340];return _0x1f968d;};'use strict';var Sequelize=require('sequelize');module[_0x333f('0x0')]={'name':{'type':Sequelize[_0x333f('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x333f('0x1')]},'remoteUri':{'type':Sequelize[_0x333f('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x333f('0x2')),'defaultValue':_0x333f('0x2')},'password':{'type':Sequelize[_0x333f('0x1')]},'consumerKey':{'type':Sequelize[_0x333f('0x1')]},'consumerSecret':{'type':Sequelize[_0x333f('0x1')]},'token':{'type':Sequelize[_0x333f('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x333f('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x333f('0x3'),_0x333f('0x4')),'defaultValue':_0x333f('0x3')}};
\ No newline at end of file
index db18b3d..07f28c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd345=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','merge','where','VIRTUAL','filter','options','DeskAccount','then','includeAll','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','username','password','consumerKey','consumerSecret','tokenSecret','remoteUri','substring','lastIndexOf','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','Basic\x20%s','base64','concat','_embedded','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir'];(function(_0x5120a3,_0x593fe6){var _0x5c125e=function(_0x426d2a){while(--_0x426d2a){_0x5120a3['push'](_0x5120a3['shift']());}};_0x5c125e(++_0x593fe6);}(_0xd345,0x162));var _0x5d34=function(_0x2f59f1,_0x220adc){_0x2f59f1=_0x2f59f1-0x0;var _0x4afd1c=_0xd345[_0x2f59f1];return _0x4afd1c;};'use strict';var emlformat=require(_0x5d34('0x0'));var rimraf=require(_0x5d34('0x1'));var zipdir=require(_0x5d34('0x2'));var jsonpatch=require(_0x5d34('0x3'));var rp=require(_0x5d34('0x4'));var moment=require(_0x5d34('0x5'));var BPromise=require(_0x5d34('0x6'));var Mustache=require(_0x5d34('0x7'));var util=require(_0x5d34('0x8'));var path=require(_0x5d34('0x9'));var sox=require(_0x5d34('0xa'));var csv=require('to-csv');var ejs=require(_0x5d34('0xb'));var fs=require('fs');var fs_extra=require(_0x5d34('0xc'));var _=require(_0x5d34('0xd'));var squel=require(_0x5d34('0xe'));var crypto=require(_0x5d34('0xf'));var jsforce=require(_0x5d34('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5d34('0x11'));var Papa=require(_0x5d34('0x12'));var Redis=require('ioredis');var authService=require(_0x5d34('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5d34('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d34('0x15'))(_0x5d34('0x16'));var utils=require('../../config/utils');var config=require(_0x5d34('0x17'));var licenseUtil=require(_0x5d34('0x18'));var db=require(_0x5d34('0x19'))['db'];var integrations=require(_0x5d34('0x1a'));function respondWithStatusCode(_0x4f4b54,_0x1cd9c5){_0x1cd9c5=_0x1cd9c5||0xcc;return function(_0x5e0393){if(_0x5e0393){return _0x4f4b54[_0x5d34('0x1b')](_0x1cd9c5);}return _0x4f4b54[_0x5d34('0x1c')](_0x1cd9c5)['end']();};}function respondWithResult(_0xcbe4c8,_0x944c3f){_0x944c3f=_0x944c3f||0xc8;return function(_0x52a3df){if(_0x52a3df){return _0xcbe4c8['status'](_0x944c3f)[_0x5d34('0x1d')](_0x52a3df);}};}function respondWithFilteredResult(_0x36244d,_0x3bafce){return function(_0x1eefbd){if(_0x1eefbd){var _0x33d822=typeof _0x3bafce[_0x5d34('0x1e')]===_0x5d34('0x1f')&&typeof _0x3bafce[_0x5d34('0x20')]===_0x5d34('0x1f');var _0x51ca6c=_0x1eefbd[_0x5d34('0x21')];var _0x32dd67=_0x33d822?0x0:_0x3bafce[_0x5d34('0x1e')];var _0x336691=_0x33d822?_0x1eefbd[_0x5d34('0x21')]:_0x3bafce[_0x5d34('0x1e')]+_0x3bafce[_0x5d34('0x20')];var _0x229057;if(_0x336691>=_0x51ca6c){_0x336691=_0x51ca6c;_0x229057=0xc8;}else{_0x229057=0xce;}_0x36244d['status'](_0x229057);return _0x36244d[_0x5d34('0x22')]('Content-Range',_0x32dd67+'-'+_0x336691+'/'+_0x51ca6c)[_0x5d34('0x1d')](_0x1eefbd);}return null;};}function patchUpdates(_0x15ddde){return function(_0x37dd80){try{jsonpatch[_0x5d34('0x23')](_0x37dd80,_0x15ddde,!![]);}catch(_0x18d504){return BPromise[_0x5d34('0x24')](_0x18d504);}return _0x37dd80[_0x5d34('0x25')]();};}function saveUpdates(_0x20683b,_0x2258f9){return function(_0x21244b){if(_0x21244b){return _0x21244b[_0x5d34('0x26')](_0x20683b)['then'](function(_0x8455de){return _0x8455de;});}return null;};}function removeEntity(_0x472550,_0x45a6e3){return function(_0x14acc3){if(_0x14acc3){return _0x14acc3[_0x5d34('0x27')]()['then'](function(){_0x472550[_0x5d34('0x1c')](0xcc)[_0x5d34('0x28')]();});}};}function handleEntityNotFound(_0x5e8b5d,_0xd24eaa){return function(_0x4fe767){if(!_0x4fe767){_0x5e8b5d[_0x5d34('0x1b')](0x194);}return _0x4fe767;};}function handleError(_0x164b3f,_0x48767a){_0x48767a=_0x48767a||0x1f4;return function(_0x267838){logger[_0x5d34('0x29')](_0x267838['stack']);if(_0x267838[_0x5d34('0x2a')]){delete _0x267838[_0x5d34('0x2a')];}_0x164b3f[_0x5d34('0x1c')](_0x48767a)[_0x5d34('0x2b')](_0x267838);};}exports[_0x5d34('0x2c')]=function(_0x5d73bc,_0x6e117c){var _0x3757bc={},_0xd65014={},_0x19e97b={'count':0x0,'rows':[]};var _0xd7cf0f=_[_0x5d34('0x2d')](db['DeskAccount'][_0x5d34('0x2e')],function(_0x579091){return{'name':_0x579091[_0x5d34('0x2f')],'type':_0x579091[_0x5d34('0x30')][_0x5d34('0x31')]};});_0xd65014[_0x5d34('0x32')]=_[_0x5d34('0x2d')](_0xd7cf0f,_0x5d34('0x2a'));_0xd65014['query']=_[_0x5d34('0x33')](_0x5d73bc[_0x5d34('0x34')]);_0xd65014[_0x5d34('0x35')]=_[_0x5d34('0x36')](_0xd65014['model'],_0xd65014[_0x5d34('0x34')]);_0x3757bc[_0x5d34('0x37')]=_['intersection'](_0xd65014[_0x5d34('0x32')],qs[_0x5d34('0x38')](_0x5d73bc[_0x5d34('0x34')][_0x5d34('0x38')]));_0x3757bc[_0x5d34('0x37')]=_0x3757bc[_0x5d34('0x37')][_0x5d34('0x39')]?_0x3757bc[_0x5d34('0x37')]:_0xd65014[_0x5d34('0x32')];if(!_0x5d73bc['query']['hasOwnProperty'](_0x5d34('0x3a'))){_0x3757bc[_0x5d34('0x20')]=qs[_0x5d34('0x20')](_0x5d73bc[_0x5d34('0x34')][_0x5d34('0x20')]);_0x3757bc[_0x5d34('0x1e')]=qs['offset'](_0x5d73bc['query'][_0x5d34('0x1e')]);}_0x3757bc[_0x5d34('0x3b')]=qs[_0x5d34('0x3c')](_0x5d73bc[_0x5d34('0x34')]['sort']);_0x3757bc['where']=qs['filters'](_['pick'](_0x5d73bc[_0x5d34('0x34')],_0xd65014['filters']),_0xd7cf0f);if(_0x5d73bc[_0x5d34('0x34')]['filter']){_0x3757bc['where']=_[_0x5d34('0x3d')](_0x3757bc[_0x5d34('0x3e')],{'$or':_[_0x5d34('0x2d')](_0xd7cf0f,function(_0x2d34cc){if(_0x2d34cc[_0x5d34('0x30')]!==_0x5d34('0x3f')){var _0x1cb53a={};_0x1cb53a[_0x2d34cc[_0x5d34('0x2a')]]={'$like':'%'+_0x5d73bc['query'][_0x5d34('0x40')]+'%'};return _0x1cb53a;}})});}_0x3757bc=_[_0x5d34('0x3d')]({},_0x3757bc,_0x5d73bc[_0x5d34('0x41')]);var _0x524dde={'where':_0x3757bc['where']};return db[_0x5d34('0x42')]['count'](_0x524dde)[_0x5d34('0x43')](function(_0x30a8bd){_0x19e97b[_0x5d34('0x21')]=_0x30a8bd;if(_0x5d73bc[_0x5d34('0x34')][_0x5d34('0x44')]){_0x3757bc[_0x5d34('0x45')]=[{'all':!![]}];}return db['DeskAccount'][_0x5d34('0x46')](_0x3757bc);})['then'](function(_0x140976){_0x19e97b[_0x5d34('0x47')]=_0x140976;return _0x19e97b;})[_0x5d34('0x43')](respondWithFilteredResult(_0x6e117c,_0x3757bc))[_0x5d34('0x48')](handleError(_0x6e117c,null));};exports[_0x5d34('0x49')]=function(_0x4e0010,_0x4207b9){var _0x12d418={'raw':![],'where':{'id':_0x4e0010['params']['id']}},_0x5d5af8={};_0x5d5af8[_0x5d34('0x32')]=_[_0x5d34('0x33')](db[_0x5d34('0x42')][_0x5d34('0x2e')]);_0x5d5af8[_0x5d34('0x34')]=_[_0x5d34('0x33')](_0x4e0010[_0x5d34('0x34')]);_0x5d5af8['filters']=_[_0x5d34('0x36')](_0x5d5af8[_0x5d34('0x32')],_0x5d5af8['query']);_0x12d418['attributes']=_[_0x5d34('0x36')](_0x5d5af8[_0x5d34('0x32')],qs[_0x5d34('0x38')](_0x4e0010[_0x5d34('0x34')][_0x5d34('0x38')]));_0x12d418[_0x5d34('0x37')]=_0x12d418[_0x5d34('0x37')]['length']?_0x12d418[_0x5d34('0x37')]:_0x5d5af8[_0x5d34('0x32')];if(_0x4e0010[_0x5d34('0x34')]['includeAll']){_0x12d418[_0x5d34('0x45')]=[{'all':!![]}];}_0x12d418=_['merge']({},_0x12d418,_0x4e0010[_0x5d34('0x41')]);return db[_0x5d34('0x42')][_0x5d34('0x4a')](_0x12d418)['then'](handleEntityNotFound(_0x4207b9,null))[_0x5d34('0x43')](respondWithResult(_0x4207b9,null))[_0x5d34('0x48')](handleError(_0x4207b9,null));};exports[_0x5d34('0x4b')]=function(_0x20aaa8,_0x2be288){return db[_0x5d34('0x42')][_0x5d34('0x4b')](_0x20aaa8['body'],{})[_0x5d34('0x43')](respondWithResult(_0x2be288,0xc9))[_0x5d34('0x48')](handleError(_0x2be288,null));};exports['update']=function(_0xa1e8a8,_0x30a8c0){if(_0xa1e8a8[_0x5d34('0x4c')]['id']){delete _0xa1e8a8[_0x5d34('0x4c')]['id'];}return db[_0x5d34('0x42')][_0x5d34('0x4a')]({'where':{'id':_0xa1e8a8['params']['id']}})[_0x5d34('0x43')](handleEntityNotFound(_0x30a8c0,null))[_0x5d34('0x43')](saveUpdates(_0xa1e8a8[_0x5d34('0x4c')],null))[_0x5d34('0x43')](respondWithResult(_0x30a8c0,null))[_0x5d34('0x48')](handleError(_0x30a8c0,null));};exports['destroy']=function(_0x1885ea,_0x455f23){return db[_0x5d34('0x42')][_0x5d34('0x4a')]({'where':{'id':_0x1885ea[_0x5d34('0x4d')]['id']}})[_0x5d34('0x43')](handleEntityNotFound(_0x455f23,null))[_0x5d34('0x43')](removeEntity(_0x455f23,null))['catch'](handleError(_0x455f23,null));};exports[_0x5d34('0x4e')]=function(_0x18361f,_0x49df91,_0x311368){var _0x4ab5e6={};var _0x2cb208={};var _0x19bafa;var _0x2c540b;return db[_0x5d34('0x42')][_0x5d34('0x4f')]({'where':{'id':_0x18361f[_0x5d34('0x4d')]['id']}})[_0x5d34('0x43')](handleEntityNotFound(_0x49df91,null))[_0x5d34('0x43')](function(_0x5a3b4d){if(_0x5a3b4d){_0x19bafa=_0x5a3b4d;_0x2cb208[_0x5d34('0x32')]=_[_0x5d34('0x33')](db[_0x5d34('0x50')]['rawAttributes']);_0x2cb208[_0x5d34('0x34')]=_[_0x5d34('0x33')](_0x18361f['query']);_0x2cb208['filters']=_[_0x5d34('0x36')](_0x2cb208['model'],_0x2cb208['query']);_0x4ab5e6[_0x5d34('0x37')]=_[_0x5d34('0x36')](_0x2cb208[_0x5d34('0x32')],qs['fields'](_0x18361f[_0x5d34('0x34')][_0x5d34('0x38')]));_0x4ab5e6[_0x5d34('0x37')]=_0x4ab5e6[_0x5d34('0x37')]['length']?_0x4ab5e6['attributes']:_0x2cb208['model'];_0x4ab5e6[_0x5d34('0x3b')]=qs[_0x5d34('0x3c')](_0x18361f['query'][_0x5d34('0x3c')]);_0x4ab5e6[_0x5d34('0x3e')]=qs[_0x5d34('0x35')](_['pick'](_0x18361f[_0x5d34('0x34')],_0x2cb208[_0x5d34('0x35')]));if(_0x18361f[_0x5d34('0x34')]['filter']){_0x4ab5e6[_0x5d34('0x3e')]=_[_0x5d34('0x3d')](_0x4ab5e6['where'],{'$or':_['map'](_0x4ab5e6[_0x5d34('0x37')],function(_0x4022bd){var _0x2b8fcc={};_0x2b8fcc[_0x4022bd]={'$like':'%'+_0x18361f[_0x5d34('0x34')][_0x5d34('0x40')]+'%'};return _0x2b8fcc;})});}_0x4ab5e6=_[_0x5d34('0x3d')]({},_0x4ab5e6,_0x18361f[_0x5d34('0x41')]);return _0x19bafa[_0x5d34('0x4e')](_0x4ab5e6);}})[_0x5d34('0x43')](function(_0x15edcf){if(_0x15edcf){_0x2c540b=_0x15edcf[_0x5d34('0x39')];if(!_0x18361f[_0x5d34('0x34')][_0x5d34('0x51')](_0x5d34('0x3a'))){_0x4ab5e6[_0x5d34('0x20')]=qs[_0x5d34('0x20')](_0x18361f['query'][_0x5d34('0x20')]);_0x4ab5e6[_0x5d34('0x1e')]=qs[_0x5d34('0x1e')](_0x18361f[_0x5d34('0x34')]['offset']);}return _0x19bafa[_0x5d34('0x4e')](_0x4ab5e6);}})['then'](function(_0x543b3e){if(_0x543b3e){return _0x543b3e?{'count':_0x2c540b,'rows':_0x543b3e}:null;}})[_0x5d34('0x43')](respondWithResult(_0x49df91,null))[_0x5d34('0x48')](handleError(_0x49df91,null));};exports[_0x5d34('0x52')]=function(_0x5afb2a,_0x1d5002,_0x2f60d6){if(_0x5afb2a[_0x5d34('0x4c')]['id']){delete _0x5afb2a[_0x5d34('0x4c')]['id'];}return db[_0x5d34('0x42')][_0x5d34('0x4f')]({'where':{'id':_0x5afb2a[_0x5d34('0x4d')]['id']}})[_0x5d34('0x43')](handleEntityNotFound(_0x1d5002,null))[_0x5d34('0x43')](function(_0x169670){if(_0x169670){_0x5afb2a[_0x5d34('0x4c')][_0x5d34('0x53')]=_0x169670['id'];_0x5afb2a[_0x5d34('0x4c')][_0x5d34('0x54')]=integrations[_0x5d34('0x55')](_0x5afb2a[_0x5d34('0x4c')][_0x5d34('0x56')],_0x5afb2a['body'][_0x5d34('0x30')]);_0x5afb2a['body'][_0x5d34('0x57')]=integrations[_0x5d34('0x58')](_0x5afb2a[_0x5d34('0x4c')][_0x5d34('0x56')],_0x5afb2a['body'][_0x5d34('0x30')]);return db['DeskConfiguration'][_0x5d34('0x4b')](_0x5afb2a[_0x5d34('0x4c')],{'include':[{'model':db[_0x5d34('0x59')],'as':_0x5d34('0x54')},{'model':db[_0x5d34('0x59')],'as':_0x5d34('0x57')}]});}return null;})[_0x5d34('0x43')](respondWithResult(_0x1d5002,null))[_0x5d34('0x48')](handleError(_0x1d5002,null));};exports[_0x5d34('0x5a')]=function(_0x580e61,_0x1380ca,_0x315c38){var _0x3ab097=[{'name':_0x5d34('0x5b'),'label':_0x5d34('0x5b'),'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 _0x1a9a0f='';return db[_0x5d34('0x42')]['findOne']({'where':{'id':_0x580e61['params']['id']},'attributes':['id','remoteUri','authType',_0x5d34('0x5c'),_0x5d34('0x5d'),_0x5d34('0x5e'),_0x5d34('0x5f'),'token',_0x5d34('0x60')]})['then'](handleEntityNotFound(_0x1380ca,null))['then'](function(_0x215acf){if(_0x215acf){_0x1a9a0f=_0x215acf[_0x5d34('0x61')];var _0x2d66c5=_0x1a9a0f['slice'](-0x1);if(_0x2d66c5==='/'){_0x1a9a0f=_0x1a9a0f[_0x5d34('0x62')](0x0,_0x1a9a0f[_0x5d34('0x63')](_0x2d66c5));}var _0x5ebfff={'method':'GET','uri':util[_0x5d34('0x64')](_0x5d34('0x65'),_0x1a9a0f),'headers':{'Content-Type':_0x5d34('0x66'),'Accept':'application/json'},'json':!![]};if(_0x215acf[_0x5d34('0x67')]===_0x5d34('0x68')){_0x5ebfff[_0x5d34('0x69')][_0x5d34('0x6a')]=util[_0x5d34('0x64')](_0x5d34('0x6b'),new Buffer(util['format']('%s:%s',_0x215acf[_0x5d34('0x5c')],_0x215acf[_0x5d34('0x5d')]))['toString'](_0x5d34('0x6c')));}return rp(_0x5ebfff)[_0x5d34('0x43')](function(_0xe29532){return _0x3ab097[_0x5d34('0x6d')](_[_0x5d34('0x2d')](_0xe29532[_0x5d34('0x6e')][_0x5d34('0x6f')],function(_0x1c2699){return{'id':_0x1c2699[_0x5d34('0x2a')],'name':_0x1c2699['name'],'type':_0x1c2699['type'],'active':_0x1c2699[_0x5d34('0x70')],'label':_0x1c2699[_0x5d34('0x71')],'custom':!![]};}));});}})[_0x5d34('0x43')](function(_0x3f87c6){return{'count':_0x3f87c6['length'],'rows':_0x3f87c6};})[_0x5d34('0x43')](respondWithResult(_0x1380ca,null))[_0x5d34('0x48')](function(_0x451b19){var _0x4c5f65=_0x580e61['query'][_0x5d34('0x72')]?0x1f4:_0x451b19['statusCode']||0x1f4;logger[_0x5d34('0x29')](_0x5d34('0x73'),'getFields',_0x4c5f65,JSON[_0x5d34('0x74')](_0x451b19));delete _0x451b19[_0x5d34('0x2a')];if(_0x4c5f65===0x191){_0x4c5f65=0x190;}_0x1380ca['status'](_0x4c5f65)[_0x5d34('0x2b')](_0x580e61[_0x5d34('0x34')][_0x5d34('0x72')]?{'message':_0x5d34('0x75'),'statusCode':_0x451b19[_0x5d34('0x76')]}:_0x451b19);});};
\ No newline at end of file
+var _0xfa24=['Basic\x20%s','format','%s:%s','username','toString','base64','concat','_embedded','entries','active','label','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','type','key','model','map','query','keys','filters','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','include','DeskAccount','findAll','rows','catch','show','rawAttributes','intersection','create','body','find','params','getConfigurations','findOne','DeskConfiguration','pick','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','Authorization'];(function(_0x43716,_0xd5d063){var _0x133714=function(_0x539f6a){while(--_0x539f6a){_0x43716['push'](_0x43716['shift']());}};_0x133714(++_0xd5d063);}(_0xfa24,0x1df));var _0x4fa2=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0xfa24[_0x3c504b];return _0x2e5354;};'use strict';var emlformat=require(_0x4fa2('0x0'));var rimraf=require(_0x4fa2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4fa2('0x2'));var rp=require(_0x4fa2('0x3'));var moment=require(_0x4fa2('0x4'));var BPromise=require(_0x4fa2('0x5'));var Mustache=require(_0x4fa2('0x6'));var util=require(_0x4fa2('0x7'));var path=require(_0x4fa2('0x8'));var sox=require(_0x4fa2('0x9'));var csv=require(_0x4fa2('0xa'));var ejs=require(_0x4fa2('0xb'));var fs=require('fs');var fs_extra=require(_0x4fa2('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4fa2('0xd'));var jsforce=require(_0x4fa2('0xe'));var deskjs=require(_0x4fa2('0xf'));var toCsv=require(_0x4fa2('0xa'));var querystring=require(_0x4fa2('0x10'));var Papa=require('papaparse');var Redis=require(_0x4fa2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4fa2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fa2('0x13'));var logger=require(_0x4fa2('0x14'))(_0x4fa2('0x15'));var utils=require(_0x4fa2('0x16'));var config=require(_0x4fa2('0x17'));var licenseUtil=require(_0x4fa2('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x366c9e,_0x56fdeb){_0x56fdeb=_0x56fdeb||0xcc;return function(_0xb60c41){if(_0xb60c41){return _0x366c9e[_0x4fa2('0x19')](_0x56fdeb);}return _0x366c9e[_0x4fa2('0x1a')](_0x56fdeb)[_0x4fa2('0x1b')]();};}function respondWithResult(_0x88f347,_0x579277){_0x579277=_0x579277||0xc8;return function(_0x3805fb){if(_0x3805fb){return _0x88f347[_0x4fa2('0x1a')](_0x579277)[_0x4fa2('0x1c')](_0x3805fb);}};}function respondWithFilteredResult(_0x5d2a03,_0x3cec9b){return function(_0x237b33){if(_0x237b33){var _0x35bd9f=typeof _0x3cec9b[_0x4fa2('0x1d')]===_0x4fa2('0x1e')&&typeof _0x3cec9b[_0x4fa2('0x1f')]==='undefined';var _0x34bca1=_0x237b33[_0x4fa2('0x20')];var _0x3080f6=_0x35bd9f?0x0:_0x3cec9b[_0x4fa2('0x1d')];var _0x161dec=_0x35bd9f?_0x237b33[_0x4fa2('0x20')]:_0x3cec9b[_0x4fa2('0x1d')]+_0x3cec9b[_0x4fa2('0x1f')];var _0x5ee65f;if(_0x161dec>=_0x34bca1){_0x161dec=_0x34bca1;_0x5ee65f=0xc8;}else{_0x5ee65f=0xce;}_0x5d2a03[_0x4fa2('0x1a')](_0x5ee65f);return _0x5d2a03[_0x4fa2('0x21')](_0x4fa2('0x22'),_0x3080f6+'-'+_0x161dec+'/'+_0x34bca1)['json'](_0x237b33);}return null;};}function patchUpdates(_0x38eb25){return function(_0xf0e460){try{jsonpatch[_0x4fa2('0x23')](_0xf0e460,_0x38eb25,!![]);}catch(_0x1d06ef){return BPromise[_0x4fa2('0x24')](_0x1d06ef);}return _0xf0e460[_0x4fa2('0x25')]();};}function saveUpdates(_0x43eeca,_0x43086e){return function(_0x429365){if(_0x429365){return _0x429365[_0x4fa2('0x26')](_0x43eeca)[_0x4fa2('0x27')](function(_0x29fc07){return _0x29fc07;});}return null;};}function removeEntity(_0x242599,_0x1b7d31){return function(_0x10cf05){if(_0x10cf05){return _0x10cf05[_0x4fa2('0x28')]()[_0x4fa2('0x27')](function(){_0x242599[_0x4fa2('0x1a')](0xcc)[_0x4fa2('0x1b')]();});}};}function handleEntityNotFound(_0x498c87,_0x1fa9dc){return function(_0x11b69b){if(!_0x11b69b){_0x498c87[_0x4fa2('0x19')](0x194);}return _0x11b69b;};}function handleError(_0x3fd1fe,_0x471e83){_0x471e83=_0x471e83||0x1f4;return function(_0x163a45){logger[_0x4fa2('0x29')](_0x163a45['stack']);if(_0x163a45[_0x4fa2('0x2a')]){delete _0x163a45[_0x4fa2('0x2a')];}_0x3fd1fe[_0x4fa2('0x1a')](_0x471e83)[_0x4fa2('0x2b')](_0x163a45);};}exports[_0x4fa2('0x2c')]=function(_0x577921,_0xa15096){var _0x39243e={},_0x495d41={},_0x47ae4d={'count':0x0,'rows':[]};var _0x574e28=_['map'](db['DeskAccount']['rawAttributes'],function(_0x537ee0){return{'name':_0x537ee0['fieldName'],'type':_0x537ee0[_0x4fa2('0x2d')][_0x4fa2('0x2e')]};});_0x495d41[_0x4fa2('0x2f')]=_[_0x4fa2('0x30')](_0x574e28,_0x4fa2('0x2a'));_0x495d41[_0x4fa2('0x31')]=_[_0x4fa2('0x32')](_0x577921[_0x4fa2('0x31')]);_0x495d41[_0x4fa2('0x33')]=_['intersection'](_0x495d41[_0x4fa2('0x2f')],_0x495d41['query']);_0x39243e['attributes']=_['intersection'](_0x495d41[_0x4fa2('0x2f')],qs[_0x4fa2('0x34')](_0x577921[_0x4fa2('0x31')][_0x4fa2('0x34')]));_0x39243e['attributes']=_0x39243e[_0x4fa2('0x35')][_0x4fa2('0x36')]?_0x39243e[_0x4fa2('0x35')]:_0x495d41[_0x4fa2('0x2f')];if(!_0x577921[_0x4fa2('0x31')]['hasOwnProperty'](_0x4fa2('0x37'))){_0x39243e[_0x4fa2('0x1f')]=qs['limit'](_0x577921[_0x4fa2('0x31')][_0x4fa2('0x1f')]);_0x39243e[_0x4fa2('0x1d')]=qs[_0x4fa2('0x1d')](_0x577921[_0x4fa2('0x31')][_0x4fa2('0x1d')]);}_0x39243e[_0x4fa2('0x38')]=qs[_0x4fa2('0x39')](_0x577921[_0x4fa2('0x31')][_0x4fa2('0x39')]);_0x39243e[_0x4fa2('0x3a')]=qs[_0x4fa2('0x33')](_['pick'](_0x577921[_0x4fa2('0x31')],_0x495d41['filters']),_0x574e28);if(_0x577921[_0x4fa2('0x31')][_0x4fa2('0x3b')]){_0x39243e[_0x4fa2('0x3a')]=_[_0x4fa2('0x3c')](_0x39243e[_0x4fa2('0x3a')],{'$or':_['map'](_0x574e28,function(_0x13849f){if(_0x13849f['type']!=='VIRTUAL'){var _0x185c88={};_0x185c88[_0x13849f[_0x4fa2('0x2a')]]={'$like':'%'+_0x577921['query'][_0x4fa2('0x3b')]+'%'};return _0x185c88;}})});}_0x39243e=_[_0x4fa2('0x3c')]({},_0x39243e,_0x577921[_0x4fa2('0x3d')]);var _0x5890fc={'where':_0x39243e[_0x4fa2('0x3a')]};return db['DeskAccount'][_0x4fa2('0x20')](_0x5890fc)['then'](function(_0x2d844d){_0x47ae4d['count']=_0x2d844d;if(_0x577921[_0x4fa2('0x31')][_0x4fa2('0x3e')]){_0x39243e[_0x4fa2('0x3f')]=[{'all':!![]}];}return db[_0x4fa2('0x40')][_0x4fa2('0x41')](_0x39243e);})[_0x4fa2('0x27')](function(_0x141bfd){_0x47ae4d[_0x4fa2('0x42')]=_0x141bfd;return _0x47ae4d;})[_0x4fa2('0x27')](respondWithFilteredResult(_0xa15096,_0x39243e))[_0x4fa2('0x43')](handleError(_0xa15096,null));};exports[_0x4fa2('0x44')]=function(_0x4e85d7,_0x3e7955){var _0x2d4573={'raw':![],'where':{'id':_0x4e85d7['params']['id']}},_0x4b7e97={};_0x4b7e97[_0x4fa2('0x2f')]=_[_0x4fa2('0x32')](db[_0x4fa2('0x40')][_0x4fa2('0x45')]);_0x4b7e97['query']=_['keys'](_0x4e85d7[_0x4fa2('0x31')]);_0x4b7e97['filters']=_[_0x4fa2('0x46')](_0x4b7e97[_0x4fa2('0x2f')],_0x4b7e97['query']);_0x2d4573[_0x4fa2('0x35')]=_[_0x4fa2('0x46')](_0x4b7e97[_0x4fa2('0x2f')],qs['fields'](_0x4e85d7[_0x4fa2('0x31')]['fields']));_0x2d4573[_0x4fa2('0x35')]=_0x2d4573[_0x4fa2('0x35')]['length']?_0x2d4573[_0x4fa2('0x35')]:_0x4b7e97[_0x4fa2('0x2f')];if(_0x4e85d7[_0x4fa2('0x31')][_0x4fa2('0x3e')]){_0x2d4573[_0x4fa2('0x3f')]=[{'all':!![]}];}_0x2d4573=_[_0x4fa2('0x3c')]({},_0x2d4573,_0x4e85d7['options']);return db[_0x4fa2('0x40')]['find'](_0x2d4573)[_0x4fa2('0x27')](handleEntityNotFound(_0x3e7955,null))['then'](respondWithResult(_0x3e7955,null))['catch'](handleError(_0x3e7955,null));};exports['create']=function(_0x500e93,_0x24092f){return db[_0x4fa2('0x40')][_0x4fa2('0x47')](_0x500e93[_0x4fa2('0x48')],{})[_0x4fa2('0x27')](respondWithResult(_0x24092f,0xc9))[_0x4fa2('0x43')](handleError(_0x24092f,null));};exports[_0x4fa2('0x26')]=function(_0xeb0262,_0x5d335c){if(_0xeb0262['body']['id']){delete _0xeb0262[_0x4fa2('0x48')]['id'];}return db[_0x4fa2('0x40')][_0x4fa2('0x49')]({'where':{'id':_0xeb0262['params']['id']}})[_0x4fa2('0x27')](handleEntityNotFound(_0x5d335c,null))[_0x4fa2('0x27')](saveUpdates(_0xeb0262[_0x4fa2('0x48')],null))['then'](respondWithResult(_0x5d335c,null))[_0x4fa2('0x43')](handleError(_0x5d335c,null));};exports['destroy']=function(_0x36ef89,_0x51557d){return db[_0x4fa2('0x40')][_0x4fa2('0x49')]({'where':{'id':_0x36ef89[_0x4fa2('0x4a')]['id']}})[_0x4fa2('0x27')](handleEntityNotFound(_0x51557d,null))[_0x4fa2('0x27')](removeEntity(_0x51557d,null))[_0x4fa2('0x43')](handleError(_0x51557d,null));};exports[_0x4fa2('0x4b')]=function(_0x3dd56c,_0x5f55c1,_0x5266fc){var _0x1a6232={};var _0x298d7f={};var _0x10b230;var _0x56e05c;return db[_0x4fa2('0x40')][_0x4fa2('0x4c')]({'where':{'id':_0x3dd56c[_0x4fa2('0x4a')]['id']}})[_0x4fa2('0x27')](handleEntityNotFound(_0x5f55c1,null))[_0x4fa2('0x27')](function(_0x414d31){if(_0x414d31){_0x10b230=_0x414d31;_0x298d7f[_0x4fa2('0x2f')]=_['keys'](db[_0x4fa2('0x4d')][_0x4fa2('0x45')]);_0x298d7f['query']=_[_0x4fa2('0x32')](_0x3dd56c[_0x4fa2('0x31')]);_0x298d7f[_0x4fa2('0x33')]=_[_0x4fa2('0x46')](_0x298d7f['model'],_0x298d7f['query']);_0x1a6232[_0x4fa2('0x35')]=_[_0x4fa2('0x46')](_0x298d7f['model'],qs[_0x4fa2('0x34')](_0x3dd56c['query'][_0x4fa2('0x34')]));_0x1a6232[_0x4fa2('0x35')]=_0x1a6232['attributes'][_0x4fa2('0x36')]?_0x1a6232[_0x4fa2('0x35')]:_0x298d7f[_0x4fa2('0x2f')];_0x1a6232[_0x4fa2('0x38')]=qs['sort'](_0x3dd56c[_0x4fa2('0x31')][_0x4fa2('0x39')]);_0x1a6232[_0x4fa2('0x3a')]=qs[_0x4fa2('0x33')](_[_0x4fa2('0x4e')](_0x3dd56c['query'],_0x298d7f[_0x4fa2('0x33')]));if(_0x3dd56c['query']['filter']){_0x1a6232[_0x4fa2('0x3a')]=_[_0x4fa2('0x3c')](_0x1a6232['where'],{'$or':_[_0x4fa2('0x30')](_0x1a6232[_0x4fa2('0x35')],function(_0x314871){var _0x55e066={};_0x55e066[_0x314871]={'$like':'%'+_0x3dd56c['query'][_0x4fa2('0x3b')]+'%'};return _0x55e066;})});}_0x1a6232=_[_0x4fa2('0x3c')]({},_0x1a6232,_0x3dd56c['options']);return _0x10b230[_0x4fa2('0x4b')](_0x1a6232);}})[_0x4fa2('0x27')](function(_0x3c4974){if(_0x3c4974){_0x56e05c=_0x3c4974[_0x4fa2('0x36')];if(!_0x3dd56c[_0x4fa2('0x31')][_0x4fa2('0x4f')](_0x4fa2('0x37'))){_0x1a6232['limit']=qs[_0x4fa2('0x1f')](_0x3dd56c['query'][_0x4fa2('0x1f')]);_0x1a6232[_0x4fa2('0x1d')]=qs[_0x4fa2('0x1d')](_0x3dd56c[_0x4fa2('0x31')]['offset']);}return _0x10b230[_0x4fa2('0x4b')](_0x1a6232);}})[_0x4fa2('0x27')](function(_0x5e7877){if(_0x5e7877){return _0x5e7877?{'count':_0x56e05c,'rows':_0x5e7877}:null;}})[_0x4fa2('0x27')](respondWithResult(_0x5f55c1,null))[_0x4fa2('0x43')](handleError(_0x5f55c1,null));};exports['addConfiguration']=function(_0x2ad491,_0x360299,_0x5d3b04){if(_0x2ad491[_0x4fa2('0x48')]['id']){delete _0x2ad491['body']['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x2ad491[_0x4fa2('0x4a')]['id']}})[_0x4fa2('0x27')](handleEntityNotFound(_0x360299,null))['then'](function(_0x37a667){if(_0x37a667){_0x2ad491[_0x4fa2('0x48')][_0x4fa2('0x50')]=_0x37a667['id'];_0x2ad491[_0x4fa2('0x48')]['Subjects']=integrations[_0x4fa2('0x51')](_0x2ad491[_0x4fa2('0x48')][_0x4fa2('0x52')],_0x2ad491[_0x4fa2('0x48')][_0x4fa2('0x2d')]);_0x2ad491[_0x4fa2('0x48')][_0x4fa2('0x53')]=integrations[_0x4fa2('0x54')](_0x2ad491[_0x4fa2('0x48')][_0x4fa2('0x52')],_0x2ad491[_0x4fa2('0x48')][_0x4fa2('0x2d')]);return db[_0x4fa2('0x4d')][_0x4fa2('0x47')](_0x2ad491[_0x4fa2('0x48')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x4fa2('0x55')],'as':_0x4fa2('0x53')}]});}return null;})[_0x4fa2('0x27')](respondWithResult(_0x360299,null))[_0x4fa2('0x43')](handleError(_0x360299,null));};exports[_0x4fa2('0x56')]=function(_0x27a2f8,_0x296cf8,_0x2fddce){var _0xe9a20=[{'name':_0x4fa2('0x57'),'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 _0x46d739='';return db[_0x4fa2('0x40')][_0x4fa2('0x4c')]({'where':{'id':_0x27a2f8[_0x4fa2('0x4a')]['id']},'attributes':['id',_0x4fa2('0x58'),_0x4fa2('0x59'),'username',_0x4fa2('0x5a'),_0x4fa2('0x5b'),_0x4fa2('0x5c'),_0x4fa2('0x5d'),'tokenSecret']})[_0x4fa2('0x27')](handleEntityNotFound(_0x296cf8,null))[_0x4fa2('0x27')](function(_0x1dbd74){if(_0x1dbd74){_0x46d739=_0x1dbd74[_0x4fa2('0x58')];var _0x4197a0=_0x46d739['slice'](-0x1);if(_0x4197a0==='/'){_0x46d739=_0x46d739[_0x4fa2('0x5e')](0x0,_0x46d739[_0x4fa2('0x5f')](_0x4197a0));}var _0x3453a6={'method':_0x4fa2('0x60'),'uri':util['format'](_0x4fa2('0x61'),_0x46d739),'headers':{'Content-Type':'application/json','Accept':_0x4fa2('0x62')},'json':!![]};if(_0x1dbd74[_0x4fa2('0x59')]===_0x4fa2('0x63')){_0x3453a6['headers'][_0x4fa2('0x64')]=util['format'](_0x4fa2('0x65'),new Buffer(util[_0x4fa2('0x66')](_0x4fa2('0x67'),_0x1dbd74[_0x4fa2('0x68')],_0x1dbd74[_0x4fa2('0x5a')]))[_0x4fa2('0x69')](_0x4fa2('0x6a')));}return rp(_0x3453a6)[_0x4fa2('0x27')](function(_0x23412d){return _0xe9a20[_0x4fa2('0x6b')](_[_0x4fa2('0x30')](_0x23412d[_0x4fa2('0x6c')][_0x4fa2('0x6d')],function(_0x260fed){return{'id':_0x260fed[_0x4fa2('0x2a')],'name':_0x260fed[_0x4fa2('0x2a')],'type':_0x260fed['type'],'active':_0x260fed[_0x4fa2('0x6e')],'label':_0x260fed[_0x4fa2('0x6f')],'custom':!![]};}));});}})[_0x4fa2('0x27')](function(_0x20012e){return{'count':_0x20012e[_0x4fa2('0x36')],'rows':_0x20012e};})[_0x4fa2('0x27')](respondWithResult(_0x296cf8,null))[_0x4fa2('0x43')](function(_0x2dae5f){var _0x533315=_0x27a2f8[_0x4fa2('0x31')][_0x4fa2('0x70')]?0x1f4:_0x2dae5f[_0x4fa2('0x71')]||0x1f4;logger[_0x4fa2('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x4fa2('0x56'),_0x533315,JSON[_0x4fa2('0x72')](_0x2dae5f));delete _0x2dae5f['name'];if(_0x533315===0x191){_0x533315=0x190;}_0x296cf8[_0x4fa2('0x1a')](_0x533315)[_0x4fa2('0x2b')](_0x27a2f8[_0x4fa2('0x31')]['test']?{'message':_0x4fa2('0x73'),'statusCode':_0x2dae5f[_0x4fa2('0x71')]}:_0x2dae5f);});};
\ No newline at end of file
index f5b51eb..fccd4f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c8a=['../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','util','../../config/logger','moment','bluebird','path','../../config/environment','./intDeskAccount.attributes'];(function(_0x360ad1,_0x1d7c99){var _0x5c8c2d=function(_0xbe7616){while(--_0xbe7616){_0x360ad1['push'](_0x360ad1['shift']());}};_0x5c8c2d(++_0x1d7c99);}(_0x2c8a,0x9e));var _0xa2c8=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x2c8a[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require(_0xa2c8('0x0'));var logger=require(_0xa2c8('0x1'))('api');var moment=require(_0xa2c8('0x2'));var BPromise=require(_0xa2c8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2c8('0x4'));var rimraf=require('rimraf');var config=require(_0xa2c8('0x5'));var attributes=require(_0xa2c8('0x6'));var integrations=require(_0xa2c8('0x7'));module[_0xa2c8('0x8')]=function(_0x2ec6ba,_0x4352f8){return _0x2ec6ba['define'](_0xa2c8('0x9'),attributes,{'tableName':_0xa2c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae6a=['moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','../../config/logger'];(function(_0x5a0ec9,_0x2474cc){var _0x20dc2e=function(_0x433e5){while(--_0x433e5){_0x5a0ec9['push'](_0x5a0ec9['shift']());}};_0x20dc2e(++_0x2474cc);}(_0xae6a,0x15f));var _0xaae6=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xae6a[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaae6('0x0'))('api');var moment=require(_0xaae6('0x1'));var BPromise=require(_0xaae6('0x2'));var rp=require(_0xaae6('0x3'));var fs=require('fs');var path=require(_0xaae6('0x4'));var rimraf=require(_0xaae6('0x5'));var config=require('../../config/environment');var attributes=require(_0xaae6('0x6'));var integrations=require(_0xaae6('0x7'));module['exports']=function(_0x25ad36,_0x15d894){return _0x25ad36[_0xaae6('0x8')](_0xaae6('0x9'),attributes,{'tableName':_0xaae6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c1c2b46..1e976e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58d0=['raw','where','attributes','include','model','map','then','find','ShowDeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options'];(function(_0x38a3c6,_0x217350){var _0x2228e9=function(_0x12f7af){while(--_0x12f7af){_0x38a3c6['push'](_0x38a3c6['shift']());}};_0x2228e9(++_0x217350);}(_0x58d0,0x121));var _0x058d=function(_0x1b9629,_0x5554b4){_0x1b9629=_0x1b9629-0x0;var _0x4ade3a=_0x58d0[_0x1b9629];return _0x4ade3a;};'use strict';var _=require(_0x058d('0x0'));var util=require(_0x058d('0x1'));var moment=require(_0x058d('0x2'));var BPromise=require(_0x058d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x058d('0x4'));var db=require(_0x058d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x058d('0x6'));var config=require(_0x058d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x058d('0x8')][_0x058d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb9e1,_0x4d8595,_0x4bd4f3){return new BPromise(function(_0x5e4d15,_0x511619){return client[_0x058d('0xa')](_0x2cb9e1,_0x4bd4f3)['then'](function(_0x9ca516){logger[_0x058d('0xb')](_0x058d('0xc'),_0x4d8595,_0x058d('0xd'));logger[_0x058d('0xe')](_0x058d('0xf'),_0x4d8595,_0x058d('0xd'),JSON[_0x058d('0x10')](_0x9ca516));if(_0x9ca516['error']){if(_0x9ca516[_0x058d('0x11')][_0x058d('0x12')]===0x1f4){logger[_0x058d('0x11')]('DeskAccount,\x20%s,\x20%s',_0x4d8595,_0x9ca516[_0x058d('0x11')]['message']);return _0x511619(_0x9ca516['error'][_0x058d('0x13')]);}logger[_0x058d('0x11')]('DeskAccount,\x20%s,\x20%s',_0x4d8595,_0x9ca516[_0x058d('0x11')][_0x058d('0x13')]);return _0x5e4d15(_0x9ca516[_0x058d('0x11')][_0x058d('0x13')]);}else{logger[_0x058d('0xb')](_0x058d('0xc'),_0x4d8595,'request\x20sent');_0x5e4d15(_0x9ca516[_0x058d('0x14')][_0x058d('0x13')]);}})[_0x058d('0x15')](function(_0x54baa6){logger[_0x058d('0x11')](_0x058d('0xc'),_0x4d8595,_0x54baa6);_0x511619(_0x54baa6);});});}exports[_0x058d('0x16')]=function(_0x2c123b){var _0x43cfcf=this;return new Promise(function(_0x468e17,_0x3c4a76){return db[_0x058d('0x17')][_0x058d('0x18')]({'raw':_0x2c123b[_0x058d('0x19')]?_0x2c123b[_0x058d('0x19')][_0x058d('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c123b[_0x058d('0x19')]?_0x2c123b['options'][_0x058d('0x1b')]||null:null,'attributes':_0x2c123b[_0x058d('0x19')]?_0x2c123b['options'][_0x058d('0x1c')]||null:null,'limit':_0x2c123b[_0x058d('0x19')]?_0x2c123b[_0x058d('0x19')]['limit']||null:null,'include':_0x2c123b[_0x058d('0x19')]?_0x2c123b[_0x058d('0x19')][_0x058d('0x1d')]?_['map'](_0x2c123b[_0x058d('0x19')][_0x058d('0x1d')],function(_0x4e52e3){return{'model':db[_0x4e52e3[_0x058d('0x1e')]],'as':_0x4e52e3['as'],'attributes':_0x4e52e3[_0x058d('0x1c')],'include':_0x4e52e3[_0x058d('0x1d')]?_[_0x058d('0x1f')](_0x4e52e3[_0x058d('0x1d')],function(_0x261e3d){return{'model':db[_0x261e3d[_0x058d('0x1e')]],'as':_0x261e3d['as'],'attributes':_0x261e3d[_0x058d('0x1c')],'include':_0x261e3d[_0x058d('0x1d')]?_['map'](_0x261e3d[_0x058d('0x1d')],function(_0xd98eb1){return{'model':db[_0xd98eb1[_0x058d('0x1e')]],'as':_0xd98eb1['as'],'attributes':_0xd98eb1[_0x058d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x058d('0x20')](function(_0x421dee){logger[_0x058d('0xb')](_0x058d('0x16'),_0x2c123b);logger['debug'](_0x058d('0x16'),_0x2c123b,JSON['stringify'](_0x421dee));_0x468e17(_0x421dee);})[_0x058d('0x15')](function(_0x4b1307){logger[_0x058d('0x11')](_0x058d('0x16'),_0x4b1307[_0x058d('0x13')],_0x2c123b);_0x3c4a76(_0x43cfcf[_0x058d('0x11')](0x1f4,_0x4b1307[_0x058d('0x13')]));});});};exports['ShowDeskAccount']=function(_0x437b8b){var _0x3055fe=this;return new Promise(function(_0x148e9b,_0x2fad2d){return db[_0x058d('0x17')][_0x058d('0x21')]({'raw':_0x437b8b[_0x058d('0x19')]?_0x437b8b['options'][_0x058d('0x1a')]===undefined?!![]:![]:!![],'where':_0x437b8b[_0x058d('0x19')]?_0x437b8b[_0x058d('0x19')][_0x058d('0x1b')]||null:null,'attributes':_0x437b8b[_0x058d('0x19')]?_0x437b8b[_0x058d('0x19')]['attributes']||null:null,'include':_0x437b8b[_0x058d('0x19')]?_0x437b8b['options']['include']?_[_0x058d('0x1f')](_0x437b8b['options']['include'],function(_0x52b11b){return{'model':db[_0x52b11b[_0x058d('0x1e')]],'as':_0x52b11b['as'],'attributes':_0x52b11b[_0x058d('0x1c')],'include':_0x52b11b[_0x058d('0x1d')]?_[_0x058d('0x1f')](_0x52b11b['include'],function(_0x432e0e){return{'model':db[_0x432e0e[_0x058d('0x1e')]],'as':_0x432e0e['as'],'attributes':_0x432e0e['attributes'],'include':_0x432e0e[_0x058d('0x1d')]?_[_0x058d('0x1f')](_0x432e0e[_0x058d('0x1d')],function(_0x541ede){return{'model':db[_0x541ede['model']],'as':_0x541ede['as'],'attributes':_0x541ede[_0x058d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d78c2){logger[_0x058d('0xb')](_0x058d('0x22'),_0x437b8b);logger[_0x058d('0xe')](_0x058d('0x22'),_0x437b8b,JSON[_0x058d('0x10')](_0x2d78c2));_0x148e9b(_0x2d78c2);})['catch'](function(_0x14a21c){logger['error']('ShowDeskAccount',_0x14a21c[_0x058d('0x13')],_0x437b8b);_0x2fad2d(_0x3055fe[_0x058d('0x11')](0x1f4,_0x14a21c[_0x058d('0x13')]));});});};
\ No newline at end of file
+var _0xed07=['stringify','error','code','message','catch','DeskAccount','findAll','options','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','raw','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xed07,0xff));var _0x7ed0=function(_0x316352,_0x60cec8){_0x316352=_0x316352-0x0;var _0x4b6cb5=_0xed07[_0x316352];return _0x4b6cb5;};'use strict';var _=require(_0x7ed0('0x0'));var util=require(_0x7ed0('0x1'));var moment=require(_0x7ed0('0x2'));var BPromise=require(_0x7ed0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ed0('0x4'));var db=require(_0x7ed0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7ed0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7ed0('0x7'));var client=jayson[_0x7ed0('0x8')][_0x7ed0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbbe9ad,_0x147bcc,_0x2481da){return new BPromise(function(_0x4e30ce,_0x4cd435){return client[_0x7ed0('0xa')](_0xbbe9ad,_0x2481da)[_0x7ed0('0xb')](function(_0xdc1ea2){logger[_0x7ed0('0xc')](_0x7ed0('0xd'),_0x147bcc,_0x7ed0('0xe'));logger[_0x7ed0('0xf')](_0x7ed0('0x10'),_0x147bcc,_0x7ed0('0xe'),JSON[_0x7ed0('0x11')](_0xdc1ea2));if(_0xdc1ea2[_0x7ed0('0x12')]){if(_0xdc1ea2[_0x7ed0('0x12')][_0x7ed0('0x13')]===0x1f4){logger[_0x7ed0('0x12')]('DeskAccount,\x20%s,\x20%s',_0x147bcc,_0xdc1ea2[_0x7ed0('0x12')][_0x7ed0('0x14')]);return _0x4cd435(_0xdc1ea2['error'][_0x7ed0('0x14')]);}logger[_0x7ed0('0x12')](_0x7ed0('0xd'),_0x147bcc,_0xdc1ea2[_0x7ed0('0x12')][_0x7ed0('0x14')]);return _0x4e30ce(_0xdc1ea2[_0x7ed0('0x12')]['message']);}else{logger['info'](_0x7ed0('0xd'),_0x147bcc,_0x7ed0('0xe'));_0x4e30ce(_0xdc1ea2['result'][_0x7ed0('0x14')]);}})[_0x7ed0('0x15')](function(_0x5ea402){logger[_0x7ed0('0x12')]('DeskAccount,\x20%s,\x20%s',_0x147bcc,_0x5ea402);_0x4cd435(_0x5ea402);});});}exports['GetDeskAccount']=function(_0x39d136){var _0x4ec4e8=this;return new Promise(function(_0x2e18b1,_0x51ace7){return db[_0x7ed0('0x16')][_0x7ed0('0x17')]({'raw':_0x39d136[_0x7ed0('0x18')]?_0x39d136[_0x7ed0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x39d136[_0x7ed0('0x18')]?_0x39d136[_0x7ed0('0x18')]['where']||null:null,'attributes':_0x39d136[_0x7ed0('0x18')]?_0x39d136[_0x7ed0('0x18')][_0x7ed0('0x19')]||null:null,'limit':_0x39d136[_0x7ed0('0x18')]?_0x39d136[_0x7ed0('0x18')][_0x7ed0('0x1a')]||null:null,'include':_0x39d136[_0x7ed0('0x18')]?_0x39d136['options'][_0x7ed0('0x1b')]?_[_0x7ed0('0x1c')](_0x39d136[_0x7ed0('0x18')]['include'],function(_0x184425){return{'model':db[_0x184425[_0x7ed0('0x1d')]],'as':_0x184425['as'],'attributes':_0x184425[_0x7ed0('0x19')],'include':_0x184425[_0x7ed0('0x1b')]?_[_0x7ed0('0x1c')](_0x184425['include'],function(_0xd572f){return{'model':db[_0xd572f['model']],'as':_0xd572f['as'],'attributes':_0xd572f['attributes'],'include':_0xd572f[_0x7ed0('0x1b')]?_['map'](_0xd572f[_0x7ed0('0x1b')],function(_0x24aee5){return{'model':db[_0x24aee5[_0x7ed0('0x1d')]],'as':_0x24aee5['as'],'attributes':_0x24aee5['attributes']};}):[]};}):[]};}):[]:[]})[_0x7ed0('0xb')](function(_0x3b1698){logger[_0x7ed0('0xc')](_0x7ed0('0x1e'),_0x39d136);logger[_0x7ed0('0xf')](_0x7ed0('0x1e'),_0x39d136,JSON[_0x7ed0('0x11')](_0x3b1698));_0x2e18b1(_0x3b1698);})[_0x7ed0('0x15')](function(_0x9fbeec){logger[_0x7ed0('0x12')](_0x7ed0('0x1e'),_0x9fbeec[_0x7ed0('0x14')],_0x39d136);_0x51ace7(_0x4ec4e8[_0x7ed0('0x12')](0x1f4,_0x9fbeec['message']));});});};exports[_0x7ed0('0x1f')]=function(_0x2a265b){var _0xaf8b24=this;return new Promise(function(_0x4fe694,_0x4344b6){return db[_0x7ed0('0x16')]['find']({'raw':_0x2a265b[_0x7ed0('0x18')]?_0x2a265b[_0x7ed0('0x18')][_0x7ed0('0x20')]===undefined?!![]:![]:!![],'where':_0x2a265b['options']?_0x2a265b[_0x7ed0('0x18')][_0x7ed0('0x21')]||null:null,'attributes':_0x2a265b[_0x7ed0('0x18')]?_0x2a265b[_0x7ed0('0x18')][_0x7ed0('0x19')]||null:null,'include':_0x2a265b[_0x7ed0('0x18')]?_0x2a265b['options'][_0x7ed0('0x1b')]?_[_0x7ed0('0x1c')](_0x2a265b[_0x7ed0('0x18')][_0x7ed0('0x1b')],function(_0xf79394){return{'model':db[_0xf79394['model']],'as':_0xf79394['as'],'attributes':_0xf79394[_0x7ed0('0x19')],'include':_0xf79394[_0x7ed0('0x1b')]?_[_0x7ed0('0x1c')](_0xf79394['include'],function(_0x1c4614){return{'model':db[_0x1c4614[_0x7ed0('0x1d')]],'as':_0x1c4614['as'],'attributes':_0x1c4614[_0x7ed0('0x19')],'include':_0x1c4614[_0x7ed0('0x1b')]?_[_0x7ed0('0x1c')](_0x1c4614[_0x7ed0('0x1b')],function(_0x451ff7){return{'model':db[_0x451ff7[_0x7ed0('0x1d')]],'as':_0x451ff7['as'],'attributes':_0x451ff7[_0x7ed0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7ed0('0xb')](function(_0x3d5201){logger[_0x7ed0('0xc')](_0x7ed0('0x1f'),_0x2a265b);logger[_0x7ed0('0xf')](_0x7ed0('0x1f'),_0x2a265b,JSON[_0x7ed0('0x11')](_0x3d5201));_0x4fe694(_0x3d5201);})[_0x7ed0('0x15')](function(_0xe4034b){logger['error'](_0x7ed0('0x1f'),_0xe4034b[_0x7ed0('0x14')],_0x2a265b);_0x4344b6(_0xaf8b24[_0x7ed0('0x12')](0x1f4,_0xe4034b[_0x7ed0('0x14')]));});});};
\ No newline at end of file
index d79bb33..05ba85a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5e2229,_0x4c6d57){var _0x562816=function(_0x3ba971){while(--_0x3ba971){_0x5e2229['push'](_0x5e2229['shift']());}};_0x562816(++_0x4c6d57);}(_0x34e8,0x12c));var _0x834e=function(_0x249c50,_0x11b3ff){_0x249c50=_0x249c50-0x0;var _0x53126d=_0x34e8[_0x249c50];return _0x53126d;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router;
\ No newline at end of file
+var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x432a9a,_0x5d951c){var _0x5dc88c=function(_0x2f5ee8){while(--_0x2f5ee8){_0x432a9a['push'](_0x432a9a['shift']());}};_0x5dc88c(++_0x5d951c);}(_0x3e74,0x175));var _0x43e7=function(_0x2db836,_0x4066b9){_0x2db836=_0x2db836-0x0;var _0x2fe03e=_0x3e74[_0x2db836];return _0x2fe03e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router;
\ No newline at end of file
index fd0508f..5bedb8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2683=['sequelize','exports','STRING'];(function(_0x402f52,_0x267417){var _0x27609e=function(_0x18f09a){while(--_0x18f09a){_0x402f52['push'](_0x402f52['shift']());}};_0x27609e(++_0x267417);}(_0x2683,0x1d4));var _0x3268=function(_0x47e3ef,_0x551b2c){_0x47e3ef=_0x47e3ef-0x0;var _0x502417=_0x2683[_0x47e3ef];return _0x502417;};'use strict';var Sequelize=require(_0x3268('0x0'));module[_0x3268('0x1')]={'name':{'type':Sequelize[_0x3268('0x2')]},'description':{'type':Sequelize[_0x3268('0x2')]}};
\ No newline at end of file
+var _0x7780=['STRING','exports'];(function(_0xd93b26,_0x12bbf2){var _0x25f668=function(_0x133ff7){while(--_0x133ff7){_0xd93b26['push'](_0xd93b26['shift']());}};_0x25f668(++_0x12bbf2);}(_0x7780,0xeb));var _0x0778=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x7780[_0x3b76f7];return _0x43984e;};'use strict';var Sequelize=require('sequelize');module[_0x0778('0x0')]={'name':{'type':Sequelize[_0x0778('0x1')]},'description':{'type':Sequelize[_0x0778('0x1')]}};
\ No newline at end of file
index f206a76..8c56a7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68f3=['DeskField','sort','getSubjects','getDescriptions','hasOwnProperty','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','update','then','destroy','error','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','DeskConfiguration','findAll','rows','catch','find','create','body','params','getFields','findOne'];(function(_0x1876f3,_0xc0f5dd){var _0x9a86fd=function(_0x4f5fec){while(--_0x4f5fec){_0x1876f3['push'](_0x1876f3['shift']());}};_0x9a86fd(++_0xc0f5dd);}(_0x68f3,0x1ef));var _0x368f=function(_0x46c389,_0x38ebde){_0x46c389=_0x46c389-0x0;var _0x4de215=_0x68f3[_0x46c389];return _0x4de215;};'use strict';var emlformat=require(_0x368f('0x0'));var rimraf=require(_0x368f('0x1'));var zipdir=require(_0x368f('0x2'));var jsonpatch=require(_0x368f('0x3'));var rp=require('request-promise');var moment=require(_0x368f('0x4'));var BPromise=require(_0x368f('0x5'));var Mustache=require(_0x368f('0x6'));var util=require('util');var path=require(_0x368f('0x7'));var sox=require(_0x368f('0x8'));var csv=require(_0x368f('0x9'));var ejs=require(_0x368f('0xa'));var fs=require('fs');var fs_extra=require(_0x368f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x368f('0xc'));var jsforce=require(_0x368f('0xd'));var deskjs=require(_0x368f('0xe'));var toCsv=require(_0x368f('0x9'));var querystring=require(_0x368f('0xf'));var Papa=require('papaparse');var Redis=require(_0x368f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x368f('0x11'));var as=require(_0x368f('0x12'));var hardwareService=require(_0x368f('0x13'));var logger=require('../../config/logger')(_0x368f('0x14'));var utils=require(_0x368f('0x15'));var config=require(_0x368f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16a048,_0x121bda){_0x121bda=_0x121bda||0xcc;return function(_0x4cbc96){if(_0x4cbc96){return _0x16a048[_0x368f('0x17')](_0x121bda);}return _0x16a048[_0x368f('0x18')](_0x121bda)[_0x368f('0x19')]();};}function respondWithResult(_0x37175f,_0x4deefc){_0x4deefc=_0x4deefc||0xc8;return function(_0x534788){if(_0x534788){return _0x37175f[_0x368f('0x18')](_0x4deefc)[_0x368f('0x1a')](_0x534788);}};}function respondWithFilteredResult(_0x58f745,_0x3d402b){return function(_0x34c640){if(_0x34c640){var _0x6f93e8=typeof _0x3d402b[_0x368f('0x1b')]==='undefined'&&typeof _0x3d402b[_0x368f('0x1c')]==='undefined';var _0x265812=_0x34c640['count'];var _0x7d243a=_0x6f93e8?0x0:_0x3d402b['offset'];var _0x5e7aa6=_0x6f93e8?_0x34c640[_0x368f('0x1d')]:_0x3d402b[_0x368f('0x1b')]+_0x3d402b['limit'];var _0xc77fca;if(_0x5e7aa6>=_0x265812){_0x5e7aa6=_0x265812;_0xc77fca=0xc8;}else{_0xc77fca=0xce;}_0x58f745['status'](_0xc77fca);return _0x58f745[_0x368f('0x1e')](_0x368f('0x1f'),_0x7d243a+'-'+_0x5e7aa6+'/'+_0x265812)[_0x368f('0x1a')](_0x34c640);}return null;};}function patchUpdates(_0x131187){return function(_0x534d74){try{jsonpatch['apply'](_0x534d74,_0x131187,!![]);}catch(_0x27c562){return BPromise[_0x368f('0x20')](_0x27c562);}return _0x534d74['save']();};}function saveUpdates(_0x1e12aa,_0x114bec){return function(_0xb95c6b){if(_0xb95c6b){return _0xb95c6b[_0x368f('0x21')](_0x1e12aa)[_0x368f('0x22')](function(_0x311f41){return _0x311f41;});}return null;};}function removeEntity(_0x1fe69e,_0x34078c){return function(_0x1555b7){if(_0x1555b7){return _0x1555b7[_0x368f('0x23')]()['then'](function(){_0x1fe69e[_0x368f('0x18')](0xcc)[_0x368f('0x19')]();});}};}function handleEntityNotFound(_0x42abb2,_0x1cd79a){return function(_0xe38e80){if(!_0xe38e80){_0x42abb2[_0x368f('0x17')](0x194);}return _0xe38e80;};}function handleError(_0x5e0ae7,_0x10762d){_0x10762d=_0x10762d||0x1f4;return function(_0x1fe1ce){logger[_0x368f('0x24')](_0x1fe1ce['stack']);if(_0x1fe1ce[_0x368f('0x25')]){delete _0x1fe1ce[_0x368f('0x25')];}_0x5e0ae7[_0x368f('0x18')](_0x10762d)[_0x368f('0x26')](_0x1fe1ce);};}exports['index']=function(_0x380ea8,_0x4e0619){var _0x6c39f9={},_0x5c7913={},_0x59a388={'count':0x0,'rows':[]};var _0x371316=_[_0x368f('0x27')](db['DeskConfiguration'][_0x368f('0x28')],function(_0x18de69){return{'name':_0x18de69[_0x368f('0x29')],'type':_0x18de69['type'][_0x368f('0x2a')]};});_0x5c7913[_0x368f('0x2b')]=_[_0x368f('0x27')](_0x371316,_0x368f('0x25'));_0x5c7913[_0x368f('0x2c')]=_[_0x368f('0x2d')](_0x380ea8[_0x368f('0x2c')]);_0x5c7913['filters']=_[_0x368f('0x2e')](_0x5c7913[_0x368f('0x2b')],_0x5c7913[_0x368f('0x2c')]);_0x6c39f9[_0x368f('0x2f')]=_['intersection'](_0x5c7913[_0x368f('0x2b')],qs[_0x368f('0x30')](_0x380ea8[_0x368f('0x2c')][_0x368f('0x30')]));_0x6c39f9['attributes']=_0x6c39f9['attributes'][_0x368f('0x31')]?_0x6c39f9[_0x368f('0x2f')]:_0x5c7913[_0x368f('0x2b')];if(!_0x380ea8[_0x368f('0x2c')]['hasOwnProperty'](_0x368f('0x32'))){_0x6c39f9[_0x368f('0x1c')]=qs[_0x368f('0x1c')](_0x380ea8[_0x368f('0x2c')][_0x368f('0x1c')]);_0x6c39f9[_0x368f('0x1b')]=qs[_0x368f('0x1b')](_0x380ea8[_0x368f('0x2c')]['offset']);}_0x6c39f9[_0x368f('0x33')]=qs['sort'](_0x380ea8[_0x368f('0x2c')]['sort']);_0x6c39f9[_0x368f('0x34')]=qs[_0x368f('0x35')](_[_0x368f('0x36')](_0x380ea8[_0x368f('0x2c')],_0x5c7913[_0x368f('0x35')]),_0x371316);if(_0x380ea8[_0x368f('0x2c')]['filter']){_0x6c39f9[_0x368f('0x34')]=_[_0x368f('0x37')](_0x6c39f9[_0x368f('0x34')],{'$or':_[_0x368f('0x27')](_0x371316,function(_0x5ada5d){if(_0x5ada5d[_0x368f('0x38')]!==_0x368f('0x39')){var _0x477568={};_0x477568[_0x5ada5d[_0x368f('0x25')]]={'$like':'%'+_0x380ea8[_0x368f('0x2c')][_0x368f('0x3a')]+'%'};return _0x477568;}})});}_0x6c39f9=_[_0x368f('0x37')]({},_0x6c39f9,_0x380ea8[_0x368f('0x3b')]);var _0x39a1f5={'where':_0x6c39f9['where']};return db['DeskConfiguration'][_0x368f('0x1d')](_0x39a1f5)['then'](function(_0x25e1fb){_0x59a388[_0x368f('0x1d')]=_0x25e1fb;if(_0x380ea8[_0x368f('0x2c')][_0x368f('0x3c')]){_0x6c39f9[_0x368f('0x3d')]=[{'all':!![]}];}return db[_0x368f('0x3e')][_0x368f('0x3f')](_0x6c39f9);})[_0x368f('0x22')](function(_0xf8a42c){_0x59a388[_0x368f('0x40')]=_0xf8a42c;return _0x59a388;})['then'](respondWithFilteredResult(_0x4e0619,_0x6c39f9))[_0x368f('0x41')](handleError(_0x4e0619,null));};exports['show']=function(_0x3e49fc,_0x56179f){var _0x49ff4b={'raw':![],'where':{'id':_0x3e49fc['params']['id']}},_0x7f5841={};_0x7f5841[_0x368f('0x2b')]=_['keys'](db['DeskConfiguration']['rawAttributes']);_0x7f5841[_0x368f('0x2c')]=_[_0x368f('0x2d')](_0x3e49fc[_0x368f('0x2c')]);_0x7f5841['filters']=_[_0x368f('0x2e')](_0x7f5841[_0x368f('0x2b')],_0x7f5841[_0x368f('0x2c')]);_0x49ff4b['attributes']=_['intersection'](_0x7f5841['model'],qs[_0x368f('0x30')](_0x3e49fc[_0x368f('0x2c')][_0x368f('0x30')]));_0x49ff4b[_0x368f('0x2f')]=_0x49ff4b[_0x368f('0x2f')][_0x368f('0x31')]?_0x49ff4b[_0x368f('0x2f')]:_0x7f5841[_0x368f('0x2b')];if(_0x3e49fc[_0x368f('0x2c')][_0x368f('0x3c')]){_0x49ff4b[_0x368f('0x3d')]=[{'all':!![]}];}_0x49ff4b=_[_0x368f('0x37')]({},_0x49ff4b,_0x3e49fc[_0x368f('0x3b')]);return db['DeskConfiguration'][_0x368f('0x42')](_0x49ff4b)['then'](handleEntityNotFound(_0x56179f,null))['then'](respondWithResult(_0x56179f,null))[_0x368f('0x41')](handleError(_0x56179f,null));};exports['create']=function(_0x2b8462,_0x113920){return db['DeskConfiguration'][_0x368f('0x43')](_0x2b8462[_0x368f('0x44')],{})['then'](respondWithResult(_0x113920,0xc9))[_0x368f('0x41')](handleError(_0x113920,null));};exports['update']=function(_0x482f33,_0x1b7b4f){if(_0x482f33[_0x368f('0x44')]['id']){delete _0x482f33[_0x368f('0x44')]['id'];}return db[_0x368f('0x3e')][_0x368f('0x42')]({'where':{'id':_0x482f33[_0x368f('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b7b4f,null))[_0x368f('0x22')](saveUpdates(_0x482f33['body'],null))[_0x368f('0x22')](respondWithResult(_0x1b7b4f,null))[_0x368f('0x41')](handleError(_0x1b7b4f,null));};exports[_0x368f('0x23')]=function(_0xbb9fea,_0x578447){return db[_0x368f('0x3e')][_0x368f('0x42')]({'where':{'id':_0xbb9fea[_0x368f('0x45')]['id']}})['then'](handleEntityNotFound(_0x578447,null))[_0x368f('0x22')](removeEntity(_0x578447,null))['catch'](handleError(_0x578447,null));};exports[_0x368f('0x46')]=function(_0x48a669,_0x233681,_0x54d0a1){var _0x18f84d={};var _0x202ab3={};var _0x1b796d;var _0x412448;return db[_0x368f('0x3e')][_0x368f('0x47')]({'where':{'id':_0x48a669[_0x368f('0x45')]['id']}})['then'](handleEntityNotFound(_0x233681,null))[_0x368f('0x22')](function(_0x71bdad){if(_0x71bdad){_0x1b796d=_0x71bdad;_0x202ab3[_0x368f('0x2b')]=_[_0x368f('0x2d')](db[_0x368f('0x48')][_0x368f('0x28')]);_0x202ab3['query']=_[_0x368f('0x2d')](_0x48a669[_0x368f('0x2c')]);_0x202ab3[_0x368f('0x35')]=_['intersection'](_0x202ab3['model'],_0x202ab3[_0x368f('0x2c')]);_0x18f84d['attributes']=_[_0x368f('0x2e')](_0x202ab3['model'],qs[_0x368f('0x30')](_0x48a669[_0x368f('0x2c')][_0x368f('0x30')]));_0x18f84d[_0x368f('0x2f')]=_0x18f84d[_0x368f('0x2f')][_0x368f('0x31')]?_0x18f84d[_0x368f('0x2f')]:_0x202ab3[_0x368f('0x2b')];_0x18f84d[_0x368f('0x33')]=qs[_0x368f('0x49')](_0x48a669[_0x368f('0x2c')][_0x368f('0x49')]);_0x18f84d[_0x368f('0x34')]=qs['filters'](_[_0x368f('0x36')](_0x48a669[_0x368f('0x2c')],_0x202ab3['filters']));if(_0x48a669[_0x368f('0x2c')]['filter']){_0x18f84d[_0x368f('0x34')]=_['merge'](_0x18f84d[_0x368f('0x34')],{'$or':_[_0x368f('0x27')](_0x18f84d[_0x368f('0x2f')],function(_0x2a7039){var _0x3b72f9={};_0x3b72f9[_0x2a7039]={'$like':'%'+_0x48a669['query'][_0x368f('0x3a')]+'%'};return _0x3b72f9;})});}_0x18f84d=_[_0x368f('0x37')]({},_0x18f84d,_0x48a669[_0x368f('0x3b')]);return _0x1b796d[_0x368f('0x46')](_0x18f84d);}})[_0x368f('0x22')](function(_0x2a8e4b){if(_0x2a8e4b){_0x412448=_0x2a8e4b[_0x368f('0x31')];if(!_0x48a669['query']['hasOwnProperty'](_0x368f('0x32'))){_0x18f84d['limit']=qs[_0x368f('0x1c')](_0x48a669[_0x368f('0x2c')][_0x368f('0x1c')]);_0x18f84d[_0x368f('0x1b')]=qs[_0x368f('0x1b')](_0x48a669[_0x368f('0x2c')][_0x368f('0x1b')]);}return _0x1b796d['getFields'](_0x18f84d);}})[_0x368f('0x22')](function(_0x145510){if(_0x145510){return _0x145510?{'count':_0x412448,'rows':_0x145510}:null;}})[_0x368f('0x22')](respondWithResult(_0x233681,null))[_0x368f('0x41')](handleError(_0x233681,null));};exports[_0x368f('0x4a')]=function(_0x37b7df,_0xeed964,_0x534972){var _0x4c23ed={};var _0x100f5b={};var _0x4dd29a;var _0x36b5c2;return db[_0x368f('0x3e')][_0x368f('0x47')]({'where':{'id':_0x37b7df[_0x368f('0x45')]['id']}})[_0x368f('0x22')](handleEntityNotFound(_0xeed964,null))[_0x368f('0x22')](function(_0xf7a90f){if(_0xf7a90f){_0x4dd29a=_0xf7a90f;_0x100f5b[_0x368f('0x2b')]=_[_0x368f('0x2d')](db[_0x368f('0x48')][_0x368f('0x28')]);_0x100f5b[_0x368f('0x2c')]=_[_0x368f('0x2d')](_0x37b7df[_0x368f('0x2c')]);_0x100f5b['filters']=_[_0x368f('0x2e')](_0x100f5b[_0x368f('0x2b')],_0x100f5b[_0x368f('0x2c')]);_0x4c23ed['attributes']=_[_0x368f('0x2e')](_0x100f5b['model'],qs[_0x368f('0x30')](_0x37b7df['query']['fields']));_0x4c23ed[_0x368f('0x2f')]=_0x4c23ed['attributes'][_0x368f('0x31')]?_0x4c23ed['attributes']:_0x100f5b[_0x368f('0x2b')];_0x4c23ed['order']=qs[_0x368f('0x49')](_0x37b7df[_0x368f('0x2c')][_0x368f('0x49')]);_0x4c23ed[_0x368f('0x34')]=qs[_0x368f('0x35')](_[_0x368f('0x36')](_0x37b7df[_0x368f('0x2c')],_0x100f5b[_0x368f('0x35')]));if(_0x37b7df[_0x368f('0x2c')][_0x368f('0x3a')]){_0x4c23ed['where']=_[_0x368f('0x37')](_0x4c23ed[_0x368f('0x34')],{'$or':_[_0x368f('0x27')](_0x4c23ed[_0x368f('0x2f')],function(_0x3bddb3){var _0x54d215={};_0x54d215[_0x3bddb3]={'$like':'%'+_0x37b7df[_0x368f('0x2c')]['filter']+'%'};return _0x54d215;})});}_0x4c23ed=_[_0x368f('0x37')]({},_0x4c23ed,_0x37b7df['options']);return _0x4dd29a['getSubjects'](_0x4c23ed);}})[_0x368f('0x22')](function(_0x504478){if(_0x504478){_0x36b5c2=_0x504478[_0x368f('0x31')];if(!_0x37b7df['query']['hasOwnProperty']('nolimit')){_0x4c23ed[_0x368f('0x1c')]=qs['limit'](_0x37b7df[_0x368f('0x2c')][_0x368f('0x1c')]);_0x4c23ed[_0x368f('0x1b')]=qs[_0x368f('0x1b')](_0x37b7df['query'][_0x368f('0x1b')]);}return _0x4dd29a[_0x368f('0x4a')](_0x4c23ed);}})['then'](function(_0x28d62e){if(_0x28d62e){return _0x28d62e?{'count':_0x36b5c2,'rows':_0x28d62e}:null;}})[_0x368f('0x22')](respondWithResult(_0xeed964,null))['catch'](handleError(_0xeed964,null));};exports[_0x368f('0x4b')]=function(_0x3a4f3b,_0x340068,_0x400f75){var _0x4143fa={};var _0x46aa43={};var _0x439975;var _0x885b3e;return db[_0x368f('0x3e')][_0x368f('0x47')]({'where':{'id':_0x3a4f3b[_0x368f('0x45')]['id']}})[_0x368f('0x22')](handleEntityNotFound(_0x340068,null))[_0x368f('0x22')](function(_0x3f3eb5){if(_0x3f3eb5){_0x439975=_0x3f3eb5;_0x46aa43[_0x368f('0x2b')]=_['keys'](db['DeskField']['rawAttributes']);_0x46aa43[_0x368f('0x2c')]=_['keys'](_0x3a4f3b[_0x368f('0x2c')]);_0x46aa43['filters']=_[_0x368f('0x2e')](_0x46aa43[_0x368f('0x2b')],_0x46aa43['query']);_0x4143fa[_0x368f('0x2f')]=_['intersection'](_0x46aa43['model'],qs['fields'](_0x3a4f3b[_0x368f('0x2c')]['fields']));_0x4143fa[_0x368f('0x2f')]=_0x4143fa[_0x368f('0x2f')]['length']?_0x4143fa[_0x368f('0x2f')]:_0x46aa43['model'];_0x4143fa[_0x368f('0x33')]=qs[_0x368f('0x49')](_0x3a4f3b[_0x368f('0x2c')]['sort']);_0x4143fa[_0x368f('0x34')]=qs[_0x368f('0x35')](_[_0x368f('0x36')](_0x3a4f3b[_0x368f('0x2c')],_0x46aa43[_0x368f('0x35')]));if(_0x3a4f3b[_0x368f('0x2c')]['filter']){_0x4143fa[_0x368f('0x34')]=_[_0x368f('0x37')](_0x4143fa[_0x368f('0x34')],{'$or':_[_0x368f('0x27')](_0x4143fa[_0x368f('0x2f')],function(_0x88cd25){var _0x1f15da={};_0x1f15da[_0x88cd25]={'$like':'%'+_0x3a4f3b['query'][_0x368f('0x3a')]+'%'};return _0x1f15da;})});}_0x4143fa=_[_0x368f('0x37')]({},_0x4143fa,_0x3a4f3b['options']);return _0x439975['getDescriptions'](_0x4143fa);}})['then'](function(_0x165757){if(_0x165757){_0x885b3e=_0x165757[_0x368f('0x31')];if(!_0x3a4f3b[_0x368f('0x2c')][_0x368f('0x4c')](_0x368f('0x32'))){_0x4143fa['limit']=qs[_0x368f('0x1c')](_0x3a4f3b[_0x368f('0x2c')][_0x368f('0x1c')]);_0x4143fa[_0x368f('0x1b')]=qs[_0x368f('0x1b')](_0x3a4f3b[_0x368f('0x2c')][_0x368f('0x1b')]);}return _0x439975['getDescriptions'](_0x4143fa);}})[_0x368f('0x22')](function(_0x5cd581){if(_0x5cd581){return _0x5cd581?{'count':_0x885b3e,'rows':_0x5cd581}:null;}})[_0x368f('0x22')](respondWithResult(_0x340068,null))[_0x368f('0x41')](handleError(_0x340068,null));};exports['getTags']=function(_0x563db5,_0x54aaf5,_0x265aa2){var _0x20d84b={};var _0x5751a9={};var _0x488268;var _0x50cd04;return db[_0x368f('0x3e')][_0x368f('0x47')]({'where':{'id':_0x563db5[_0x368f('0x45')]['id']}})[_0x368f('0x22')](handleEntityNotFound(_0x54aaf5,null))[_0x368f('0x22')](function(_0x5a3440){if(_0x5a3440){_0x488268=_0x5a3440;_0x5751a9[_0x368f('0x2b')]=_[_0x368f('0x2d')](db[_0x368f('0x4d')]['rawAttributes']);_0x5751a9[_0x368f('0x2c')]=_[_0x368f('0x2d')](_0x563db5[_0x368f('0x2c')]);_0x5751a9[_0x368f('0x35')]=_[_0x368f('0x2e')](_0x5751a9[_0x368f('0x2b')],_0x5751a9['query']);_0x20d84b[_0x368f('0x2f')]=_[_0x368f('0x2e')](_0x5751a9[_0x368f('0x2b')],qs[_0x368f('0x30')](_0x563db5['query'][_0x368f('0x30')]));_0x20d84b[_0x368f('0x2f')]=_0x20d84b[_0x368f('0x2f')]['length']?_0x20d84b['attributes']:_0x5751a9[_0x368f('0x2b')];_0x20d84b['order']=qs['sort'](_0x563db5[_0x368f('0x2c')]['sort']);_0x20d84b[_0x368f('0x34')]=qs[_0x368f('0x35')](_['pick'](_0x563db5[_0x368f('0x2c')],_0x5751a9['filters']));if(_0x563db5[_0x368f('0x2c')][_0x368f('0x3a')]){_0x20d84b[_0x368f('0x34')]=_['merge'](_0x20d84b[_0x368f('0x34')],{'$or':_['map'](_0x20d84b[_0x368f('0x2f')],function(_0x25b970){var _0x51c675={};_0x51c675[_0x25b970]={'$like':'%'+_0x563db5[_0x368f('0x2c')][_0x368f('0x3a')]+'%'};return _0x51c675;})});}_0x20d84b=_[_0x368f('0x37')]({},_0x20d84b,_0x563db5[_0x368f('0x3b')]);return _0x488268['getTags'](_0x20d84b);}})['then'](function(_0x235afb){if(_0x235afb){_0x50cd04=_0x235afb[_0x368f('0x31')];if(!_0x563db5[_0x368f('0x2c')][_0x368f('0x4c')](_0x368f('0x32'))){_0x20d84b['limit']=qs[_0x368f('0x1c')](_0x563db5[_0x368f('0x2c')][_0x368f('0x1c')]);_0x20d84b['offset']=qs[_0x368f('0x1b')](_0x563db5[_0x368f('0x2c')][_0x368f('0x1b')]);}return _0x488268[_0x368f('0x4e')](_0x20d84b);}})[_0x368f('0x22')](function(_0x1a0a1a){if(_0x1a0a1a){return _0x1a0a1a?{'count':_0x50cd04,'rows':_0x1a0a1a}:null;}})['then'](respondWithResult(_0x54aaf5,null))[_0x368f('0x41')](handleError(_0x54aaf5,null));};exports[_0x368f('0x4f')]=function(_0x400775,_0x45e5af,_0x5798ba){if(_0x400775[_0x368f('0x44')]['id']){delete _0x400775['body']['id'];}return db['DeskConfiguration'][_0x368f('0x47')]({'where':{'id':_0x400775['params']['id']}})[_0x368f('0x22')](handleEntityNotFound(_0x45e5af,null))['then'](function(_0xc3e484){if(_0xc3e484){return _0xc3e484['setTags'](_0x400775[_0x368f('0x44')][_0x368f('0x50')]||[]);}return null;})[_0x368f('0x22')](respondWithResult(_0x45e5af,null))[_0x368f('0x41')](handleError(_0x45e5af,null));};
\ No newline at end of file
+var _0xaa9e=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','order','sort','pick','filter','where','merge','VIRTUAL','options','DeskConfiguration','includeAll','catch','show','params','keys','length','include','create','body','find','getFields','findOne','DeskField','hasOwnProperty','getSubjects','getDescriptions','nolimit','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse'];(function(_0x24b6e8,_0x217380){var _0x26555e=function(_0x1f799f){while(--_0x1f799f){_0x24b6e8['push'](_0x24b6e8['shift']());}};_0x26555e(++_0x217380);}(_0xaa9e,0xe9));var _0xeaa9=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0xaa9e[_0x420d8d];return _0x4865d7;};'use strict';var emlformat=require(_0xeaa9('0x0'));var rimraf=require(_0xeaa9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeaa9('0x2'));var rp=require('request-promise');var moment=require(_0xeaa9('0x3'));var BPromise=require(_0xeaa9('0x4'));var Mustache=require(_0xeaa9('0x5'));var util=require(_0xeaa9('0x6'));var path=require(_0xeaa9('0x7'));var sox=require(_0xeaa9('0x8'));var csv=require('to-csv');var ejs=require(_0xeaa9('0x9'));var fs=require('fs');var fs_extra=require(_0xeaa9('0xa'));var _=require('lodash');var squel=require(_0xeaa9('0xb'));var crypto=require(_0xeaa9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeaa9('0xd'));var querystring=require(_0xeaa9('0xe'));var Papa=require(_0xeaa9('0xf'));var Redis=require(_0xeaa9('0x10'));var authService=require(_0xeaa9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeaa9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeaa9('0x13'))(_0xeaa9('0x14'));var utils=require('../../config/utils');var config=require(_0xeaa9('0x15'));var licenseUtil=require(_0xeaa9('0x16'));var db=require(_0xeaa9('0x17'))['db'];function respondWithStatusCode(_0x3082c3,_0x3198d5){_0x3198d5=_0x3198d5||0xcc;return function(_0x33b287){if(_0x33b287){return _0x3082c3[_0xeaa9('0x18')](_0x3198d5);}return _0x3082c3['status'](_0x3198d5)[_0xeaa9('0x19')]();};}function respondWithResult(_0x5638b1,_0x38e618){_0x38e618=_0x38e618||0xc8;return function(_0x2cdc3a){if(_0x2cdc3a){return _0x5638b1[_0xeaa9('0x1a')](_0x38e618)['json'](_0x2cdc3a);}};}function respondWithFilteredResult(_0x3c2c92,_0x90508){return function(_0x15888c){if(_0x15888c){var _0x4bc8f7=typeof _0x90508[_0xeaa9('0x1b')]===_0xeaa9('0x1c')&&typeof _0x90508[_0xeaa9('0x1d')]===_0xeaa9('0x1c');var _0x253f9d=_0x15888c[_0xeaa9('0x1e')];var _0x1d8ac0=_0x4bc8f7?0x0:_0x90508['offset'];var _0x501a45=_0x4bc8f7?_0x15888c[_0xeaa9('0x1e')]:_0x90508['offset']+_0x90508['limit'];var _0x3976b8;if(_0x501a45>=_0x253f9d){_0x501a45=_0x253f9d;_0x3976b8=0xc8;}else{_0x3976b8=0xce;}_0x3c2c92['status'](_0x3976b8);return _0x3c2c92[_0xeaa9('0x1f')](_0xeaa9('0x20'),_0x1d8ac0+'-'+_0x501a45+'/'+_0x253f9d)[_0xeaa9('0x21')](_0x15888c);}return null;};}function patchUpdates(_0x1f2701){return function(_0x23ad74){try{jsonpatch['apply'](_0x23ad74,_0x1f2701,!![]);}catch(_0x183ad7){return BPromise[_0xeaa9('0x22')](_0x183ad7);}return _0x23ad74['save']();};}function saveUpdates(_0x34727e,_0x3ae26b){return function(_0x259842){if(_0x259842){return _0x259842[_0xeaa9('0x23')](_0x34727e)[_0xeaa9('0x24')](function(_0x5c8b45){return _0x5c8b45;});}return null;};}function removeEntity(_0x5eb022,_0x3f22b1){return function(_0x492a50){if(_0x492a50){return _0x492a50[_0xeaa9('0x25')]()[_0xeaa9('0x24')](function(){_0x5eb022[_0xeaa9('0x1a')](0xcc)[_0xeaa9('0x19')]();});}};}function handleEntityNotFound(_0xb6a4b4,_0x13fcc7){return function(_0x258690){if(!_0x258690){_0xb6a4b4[_0xeaa9('0x18')](0x194);}return _0x258690;};}function handleError(_0x44f7ea,_0x1784f9){_0x1784f9=_0x1784f9||0x1f4;return function(_0x17ae7e){logger[_0xeaa9('0x26')](_0x17ae7e[_0xeaa9('0x27')]);if(_0x17ae7e[_0xeaa9('0x28')]){delete _0x17ae7e[_0xeaa9('0x28')];}_0x44f7ea[_0xeaa9('0x1a')](_0x1784f9)[_0xeaa9('0x29')](_0x17ae7e);};}exports[_0xeaa9('0x2a')]=function(_0x1f2b81,_0x3b48d2){var _0x55a7bb={},_0x23241f={},_0x3f6023={'count':0x0,'rows':[]};var _0x16b986=_[_0xeaa9('0x2b')](db['DeskConfiguration'][_0xeaa9('0x2c')],function(_0x487bd5){return{'name':_0x487bd5['fieldName'],'type':_0x487bd5[_0xeaa9('0x2d')][_0xeaa9('0x2e')]};});_0x23241f[_0xeaa9('0x2f')]=_[_0xeaa9('0x2b')](_0x16b986,_0xeaa9('0x28'));_0x23241f[_0xeaa9('0x30')]=_['keys'](_0x1f2b81[_0xeaa9('0x30')]);_0x23241f[_0xeaa9('0x31')]=_[_0xeaa9('0x32')](_0x23241f[_0xeaa9('0x2f')],_0x23241f[_0xeaa9('0x30')]);_0x55a7bb['attributes']=_[_0xeaa9('0x32')](_0x23241f[_0xeaa9('0x2f')],qs['fields'](_0x1f2b81['query'][_0xeaa9('0x33')]));_0x55a7bb[_0xeaa9('0x34')]=_0x55a7bb[_0xeaa9('0x34')]['length']?_0x55a7bb[_0xeaa9('0x34')]:_0x23241f[_0xeaa9('0x2f')];if(!_0x1f2b81[_0xeaa9('0x30')]['hasOwnProperty']('nolimit')){_0x55a7bb[_0xeaa9('0x1d')]=qs['limit'](_0x1f2b81['query'][_0xeaa9('0x1d')]);_0x55a7bb['offset']=qs[_0xeaa9('0x1b')](_0x1f2b81[_0xeaa9('0x30')][_0xeaa9('0x1b')]);}_0x55a7bb[_0xeaa9('0x35')]=qs[_0xeaa9('0x36')](_0x1f2b81[_0xeaa9('0x30')][_0xeaa9('0x36')]);_0x55a7bb['where']=qs[_0xeaa9('0x31')](_[_0xeaa9('0x37')](_0x1f2b81[_0xeaa9('0x30')],_0x23241f[_0xeaa9('0x31')]),_0x16b986);if(_0x1f2b81[_0xeaa9('0x30')][_0xeaa9('0x38')]){_0x55a7bb[_0xeaa9('0x39')]=_[_0xeaa9('0x3a')](_0x55a7bb['where'],{'$or':_[_0xeaa9('0x2b')](_0x16b986,function(_0x57731b){if(_0x57731b['type']!==_0xeaa9('0x3b')){var _0x4a2270={};_0x4a2270[_0x57731b[_0xeaa9('0x28')]]={'$like':'%'+_0x1f2b81['query'][_0xeaa9('0x38')]+'%'};return _0x4a2270;}})});}_0x55a7bb=_[_0xeaa9('0x3a')]({},_0x55a7bb,_0x1f2b81[_0xeaa9('0x3c')]);var _0x2fa642={'where':_0x55a7bb[_0xeaa9('0x39')]};return db[_0xeaa9('0x3d')][_0xeaa9('0x1e')](_0x2fa642)[_0xeaa9('0x24')](function(_0x3c1022){_0x3f6023['count']=_0x3c1022;if(_0x1f2b81[_0xeaa9('0x30')][_0xeaa9('0x3e')]){_0x55a7bb['include']=[{'all':!![]}];}return db[_0xeaa9('0x3d')]['findAll'](_0x55a7bb);})[_0xeaa9('0x24')](function(_0x1094c2){_0x3f6023['rows']=_0x1094c2;return _0x3f6023;})[_0xeaa9('0x24')](respondWithFilteredResult(_0x3b48d2,_0x55a7bb))[_0xeaa9('0x3f')](handleError(_0x3b48d2,null));};exports[_0xeaa9('0x40')]=function(_0x506c9f,_0x452e75){var _0x38dd0d={'raw':![],'where':{'id':_0x506c9f[_0xeaa9('0x41')]['id']}},_0x526a17={};_0x526a17['model']=_['keys'](db[_0xeaa9('0x3d')][_0xeaa9('0x2c')]);_0x526a17['query']=_[_0xeaa9('0x42')](_0x506c9f[_0xeaa9('0x30')]);_0x526a17['filters']=_[_0xeaa9('0x32')](_0x526a17[_0xeaa9('0x2f')],_0x526a17[_0xeaa9('0x30')]);_0x38dd0d[_0xeaa9('0x34')]=_[_0xeaa9('0x32')](_0x526a17[_0xeaa9('0x2f')],qs[_0xeaa9('0x33')](_0x506c9f[_0xeaa9('0x30')]['fields']));_0x38dd0d['attributes']=_0x38dd0d[_0xeaa9('0x34')][_0xeaa9('0x43')]?_0x38dd0d[_0xeaa9('0x34')]:_0x526a17[_0xeaa9('0x2f')];if(_0x506c9f[_0xeaa9('0x30')]['includeAll']){_0x38dd0d[_0xeaa9('0x44')]=[{'all':!![]}];}_0x38dd0d=_[_0xeaa9('0x3a')]({},_0x38dd0d,_0x506c9f[_0xeaa9('0x3c')]);return db['DeskConfiguration']['find'](_0x38dd0d)[_0xeaa9('0x24')](handleEntityNotFound(_0x452e75,null))[_0xeaa9('0x24')](respondWithResult(_0x452e75,null))['catch'](handleError(_0x452e75,null));};exports[_0xeaa9('0x45')]=function(_0x1da14f,_0xd5833e){return db[_0xeaa9('0x3d')][_0xeaa9('0x45')](_0x1da14f[_0xeaa9('0x46')],{})[_0xeaa9('0x24')](respondWithResult(_0xd5833e,0xc9))['catch'](handleError(_0xd5833e,null));};exports[_0xeaa9('0x23')]=function(_0x398072,_0x168c1d){if(_0x398072[_0xeaa9('0x46')]['id']){delete _0x398072[_0xeaa9('0x46')]['id'];}return db[_0xeaa9('0x3d')]['find']({'where':{'id':_0x398072[_0xeaa9('0x41')]['id']}})[_0xeaa9('0x24')](handleEntityNotFound(_0x168c1d,null))[_0xeaa9('0x24')](saveUpdates(_0x398072[_0xeaa9('0x46')],null))[_0xeaa9('0x24')](respondWithResult(_0x168c1d,null))['catch'](handleError(_0x168c1d,null));};exports[_0xeaa9('0x25')]=function(_0x4d5718,_0x2888bd){return db[_0xeaa9('0x3d')][_0xeaa9('0x47')]({'where':{'id':_0x4d5718[_0xeaa9('0x41')]['id']}})[_0xeaa9('0x24')](handleEntityNotFound(_0x2888bd,null))[_0xeaa9('0x24')](removeEntity(_0x2888bd,null))[_0xeaa9('0x3f')](handleError(_0x2888bd,null));};exports[_0xeaa9('0x48')]=function(_0x152a2e,_0x91d433,_0x2f65fb){var _0x1400d1={};var _0x299c5e={};var _0x260556;var _0x418ebc;return db[_0xeaa9('0x3d')][_0xeaa9('0x49')]({'where':{'id':_0x152a2e[_0xeaa9('0x41')]['id']}})[_0xeaa9('0x24')](handleEntityNotFound(_0x91d433,null))[_0xeaa9('0x24')](function(_0x5419cf){if(_0x5419cf){_0x260556=_0x5419cf;_0x299c5e[_0xeaa9('0x2f')]=_[_0xeaa9('0x42')](db[_0xeaa9('0x4a')]['rawAttributes']);_0x299c5e['query']=_[_0xeaa9('0x42')](_0x152a2e[_0xeaa9('0x30')]);_0x299c5e[_0xeaa9('0x31')]=_[_0xeaa9('0x32')](_0x299c5e['model'],_0x299c5e[_0xeaa9('0x30')]);_0x1400d1[_0xeaa9('0x34')]=_[_0xeaa9('0x32')](_0x299c5e[_0xeaa9('0x2f')],qs[_0xeaa9('0x33')](_0x152a2e[_0xeaa9('0x30')][_0xeaa9('0x33')]));_0x1400d1['attributes']=_0x1400d1[_0xeaa9('0x34')][_0xeaa9('0x43')]?_0x1400d1[_0xeaa9('0x34')]:_0x299c5e[_0xeaa9('0x2f')];_0x1400d1[_0xeaa9('0x35')]=qs[_0xeaa9('0x36')](_0x152a2e[_0xeaa9('0x30')][_0xeaa9('0x36')]);_0x1400d1[_0xeaa9('0x39')]=qs[_0xeaa9('0x31')](_[_0xeaa9('0x37')](_0x152a2e[_0xeaa9('0x30')],_0x299c5e[_0xeaa9('0x31')]));if(_0x152a2e[_0xeaa9('0x30')][_0xeaa9('0x38')]){_0x1400d1['where']=_[_0xeaa9('0x3a')](_0x1400d1['where'],{'$or':_[_0xeaa9('0x2b')](_0x1400d1[_0xeaa9('0x34')],function(_0x5f5cbd){var _0xf05a01={};_0xf05a01[_0x5f5cbd]={'$like':'%'+_0x152a2e['query'][_0xeaa9('0x38')]+'%'};return _0xf05a01;})});}_0x1400d1=_[_0xeaa9('0x3a')]({},_0x1400d1,_0x152a2e['options']);return _0x260556['getFields'](_0x1400d1);}})[_0xeaa9('0x24')](function(_0x55a045){if(_0x55a045){_0x418ebc=_0x55a045[_0xeaa9('0x43')];if(!_0x152a2e[_0xeaa9('0x30')][_0xeaa9('0x4b')]('nolimit')){_0x1400d1[_0xeaa9('0x1d')]=qs[_0xeaa9('0x1d')](_0x152a2e[_0xeaa9('0x30')][_0xeaa9('0x1d')]);_0x1400d1[_0xeaa9('0x1b')]=qs[_0xeaa9('0x1b')](_0x152a2e[_0xeaa9('0x30')][_0xeaa9('0x1b')]);}return _0x260556[_0xeaa9('0x48')](_0x1400d1);}})[_0xeaa9('0x24')](function(_0x31971a){if(_0x31971a){return _0x31971a?{'count':_0x418ebc,'rows':_0x31971a}:null;}})[_0xeaa9('0x24')](respondWithResult(_0x91d433,null))[_0xeaa9('0x3f')](handleError(_0x91d433,null));};exports[_0xeaa9('0x4c')]=function(_0x2eb959,_0x418429,_0xd0a2be){var _0x3871d4={};var _0x27da08={};var _0x5c29d4;var _0x1afcee;return db['DeskConfiguration'][_0xeaa9('0x49')]({'where':{'id':_0x2eb959[_0xeaa9('0x41')]['id']}})[_0xeaa9('0x24')](handleEntityNotFound(_0x418429,null))[_0xeaa9('0x24')](function(_0x4e9902){if(_0x4e9902){_0x5c29d4=_0x4e9902;_0x27da08[_0xeaa9('0x2f')]=_[_0xeaa9('0x42')](db[_0xeaa9('0x4a')][_0xeaa9('0x2c')]);_0x27da08[_0xeaa9('0x30')]=_[_0xeaa9('0x42')](_0x2eb959[_0xeaa9('0x30')]);_0x27da08[_0xeaa9('0x31')]=_[_0xeaa9('0x32')](_0x27da08[_0xeaa9('0x2f')],_0x27da08[_0xeaa9('0x30')]);_0x3871d4[_0xeaa9('0x34')]=_['intersection'](_0x27da08['model'],qs[_0xeaa9('0x33')](_0x2eb959[_0xeaa9('0x30')][_0xeaa9('0x33')]));_0x3871d4[_0xeaa9('0x34')]=_0x3871d4[_0xeaa9('0x34')][_0xeaa9('0x43')]?_0x3871d4[_0xeaa9('0x34')]:_0x27da08[_0xeaa9('0x2f')];_0x3871d4[_0xeaa9('0x35')]=qs[_0xeaa9('0x36')](_0x2eb959[_0xeaa9('0x30')][_0xeaa9('0x36')]);_0x3871d4[_0xeaa9('0x39')]=qs[_0xeaa9('0x31')](_[_0xeaa9('0x37')](_0x2eb959[_0xeaa9('0x30')],_0x27da08[_0xeaa9('0x31')]));if(_0x2eb959['query'][_0xeaa9('0x38')]){_0x3871d4[_0xeaa9('0x39')]=_['merge'](_0x3871d4['where'],{'$or':_[_0xeaa9('0x2b')](_0x3871d4[_0xeaa9('0x34')],function(_0x532469){var _0xd62630={};_0xd62630[_0x532469]={'$like':'%'+_0x2eb959[_0xeaa9('0x30')][_0xeaa9('0x38')]+'%'};return _0xd62630;})});}_0x3871d4=_['merge']({},_0x3871d4,_0x2eb959['options']);return _0x5c29d4[_0xeaa9('0x4c')](_0x3871d4);}})[_0xeaa9('0x24')](function(_0x6f3a0e){if(_0x6f3a0e){_0x1afcee=_0x6f3a0e[_0xeaa9('0x43')];if(!_0x2eb959[_0xeaa9('0x30')]['hasOwnProperty']('nolimit')){_0x3871d4['limit']=qs[_0xeaa9('0x1d')](_0x2eb959[_0xeaa9('0x30')][_0xeaa9('0x1d')]);_0x3871d4[_0xeaa9('0x1b')]=qs[_0xeaa9('0x1b')](_0x2eb959['query']['offset']);}return _0x5c29d4[_0xeaa9('0x4c')](_0x3871d4);}})[_0xeaa9('0x24')](function(_0x943152){if(_0x943152){return _0x943152?{'count':_0x1afcee,'rows':_0x943152}:null;}})[_0xeaa9('0x24')](respondWithResult(_0x418429,null))[_0xeaa9('0x3f')](handleError(_0x418429,null));};exports[_0xeaa9('0x4d')]=function(_0x5a720e,_0x5a97be,_0x48eef){var _0x8f02b2={};var _0x4b9389={};var _0x622995;var _0x260df6;return db[_0xeaa9('0x3d')][_0xeaa9('0x49')]({'where':{'id':_0x5a720e[_0xeaa9('0x41')]['id']}})[_0xeaa9('0x24')](handleEntityNotFound(_0x5a97be,null))['then'](function(_0x3a09d2){if(_0x3a09d2){_0x622995=_0x3a09d2;_0x4b9389[_0xeaa9('0x2f')]=_['keys'](db[_0xeaa9('0x4a')][_0xeaa9('0x2c')]);_0x4b9389['query']=_[_0xeaa9('0x42')](_0x5a720e[_0xeaa9('0x30')]);_0x4b9389[_0xeaa9('0x31')]=_[_0xeaa9('0x32')](_0x4b9389[_0xeaa9('0x2f')],_0x4b9389[_0xeaa9('0x30')]);_0x8f02b2[_0xeaa9('0x34')]=_[_0xeaa9('0x32')](_0x4b9389[_0xeaa9('0x2f')],qs[_0xeaa9('0x33')](_0x5a720e[_0xeaa9('0x30')]['fields']));_0x8f02b2[_0xeaa9('0x34')]=_0x8f02b2[_0xeaa9('0x34')][_0xeaa9('0x43')]?_0x8f02b2[_0xeaa9('0x34')]:_0x4b9389[_0xeaa9('0x2f')];_0x8f02b2[_0xeaa9('0x35')]=qs['sort'](_0x5a720e[_0xeaa9('0x30')][_0xeaa9('0x36')]);_0x8f02b2['where']=qs[_0xeaa9('0x31')](_[_0xeaa9('0x37')](_0x5a720e[_0xeaa9('0x30')],_0x4b9389['filters']));if(_0x5a720e[_0xeaa9('0x30')]['filter']){_0x8f02b2[_0xeaa9('0x39')]=_[_0xeaa9('0x3a')](_0x8f02b2['where'],{'$or':_['map'](_0x8f02b2[_0xeaa9('0x34')],function(_0x2f20a8){var _0x3b8cfa={};_0x3b8cfa[_0x2f20a8]={'$like':'%'+_0x5a720e[_0xeaa9('0x30')][_0xeaa9('0x38')]+'%'};return _0x3b8cfa;})});}_0x8f02b2=_['merge']({},_0x8f02b2,_0x5a720e[_0xeaa9('0x3c')]);return _0x622995[_0xeaa9('0x4d')](_0x8f02b2);}})['then'](function(_0x5e9ed8){if(_0x5e9ed8){_0x260df6=_0x5e9ed8[_0xeaa9('0x43')];if(!_0x5a720e[_0xeaa9('0x30')][_0xeaa9('0x4b')](_0xeaa9('0x4e'))){_0x8f02b2[_0xeaa9('0x1d')]=qs[_0xeaa9('0x1d')](_0x5a720e[_0xeaa9('0x30')]['limit']);_0x8f02b2['offset']=qs[_0xeaa9('0x1b')](_0x5a720e[_0xeaa9('0x30')][_0xeaa9('0x1b')]);}return _0x622995[_0xeaa9('0x4d')](_0x8f02b2);}})['then'](function(_0x70a017){if(_0x70a017){return _0x70a017?{'count':_0x260df6,'rows':_0x70a017}:null;}})[_0xeaa9('0x24')](respondWithResult(_0x5a97be,null))[_0xeaa9('0x3f')](handleError(_0x5a97be,null));};exports[_0xeaa9('0x4f')]=function(_0x5081dd,_0x4dfbf7,_0x56c4a1){var _0x1c0cdb={};var _0x1717e9={};var _0x35aa3a;var _0x48ae7a;return db[_0xeaa9('0x3d')][_0xeaa9('0x49')]({'where':{'id':_0x5081dd[_0xeaa9('0x41')]['id']}})['then'](handleEntityNotFound(_0x4dfbf7,null))[_0xeaa9('0x24')](function(_0x59b660){if(_0x59b660){_0x35aa3a=_0x59b660;_0x1717e9['model']=_[_0xeaa9('0x42')](db[_0xeaa9('0x50')][_0xeaa9('0x2c')]);_0x1717e9[_0xeaa9('0x30')]=_[_0xeaa9('0x42')](_0x5081dd[_0xeaa9('0x30')]);_0x1717e9[_0xeaa9('0x31')]=_['intersection'](_0x1717e9[_0xeaa9('0x2f')],_0x1717e9[_0xeaa9('0x30')]);_0x1c0cdb[_0xeaa9('0x34')]=_[_0xeaa9('0x32')](_0x1717e9['model'],qs[_0xeaa9('0x33')](_0x5081dd[_0xeaa9('0x30')][_0xeaa9('0x33')]));_0x1c0cdb['attributes']=_0x1c0cdb[_0xeaa9('0x34')][_0xeaa9('0x43')]?_0x1c0cdb['attributes']:_0x1717e9[_0xeaa9('0x2f')];_0x1c0cdb[_0xeaa9('0x35')]=qs[_0xeaa9('0x36')](_0x5081dd[_0xeaa9('0x30')][_0xeaa9('0x36')]);_0x1c0cdb[_0xeaa9('0x39')]=qs[_0xeaa9('0x31')](_[_0xeaa9('0x37')](_0x5081dd[_0xeaa9('0x30')],_0x1717e9['filters']));if(_0x5081dd[_0xeaa9('0x30')]['filter']){_0x1c0cdb[_0xeaa9('0x39')]=_['merge'](_0x1c0cdb['where'],{'$or':_[_0xeaa9('0x2b')](_0x1c0cdb['attributes'],function(_0x56b2eb){var _0x10248c={};_0x10248c[_0x56b2eb]={'$like':'%'+_0x5081dd[_0xeaa9('0x30')][_0xeaa9('0x38')]+'%'};return _0x10248c;})});}_0x1c0cdb=_[_0xeaa9('0x3a')]({},_0x1c0cdb,_0x5081dd[_0xeaa9('0x3c')]);return _0x35aa3a[_0xeaa9('0x4f')](_0x1c0cdb);}})[_0xeaa9('0x24')](function(_0x749fad){if(_0x749fad){_0x48ae7a=_0x749fad['length'];if(!_0x5081dd['query'][_0xeaa9('0x4b')](_0xeaa9('0x4e'))){_0x1c0cdb['limit']=qs[_0xeaa9('0x1d')](_0x5081dd[_0xeaa9('0x30')][_0xeaa9('0x1d')]);_0x1c0cdb['offset']=qs[_0xeaa9('0x1b')](_0x5081dd['query'][_0xeaa9('0x1b')]);}return _0x35aa3a[_0xeaa9('0x4f')](_0x1c0cdb);}})['then'](function(_0x5ac0dd){if(_0x5ac0dd){return _0x5ac0dd?{'count':_0x48ae7a,'rows':_0x5ac0dd}:null;}})[_0xeaa9('0x24')](respondWithResult(_0x4dfbf7,null))[_0xeaa9('0x3f')](handleError(_0x4dfbf7,null));};exports['setTags']=function(_0x36287f,_0x59ffb6,_0xd94c2c){if(_0x36287f[_0xeaa9('0x46')]['id']){delete _0x36287f[_0xeaa9('0x46')]['id'];}return db[_0xeaa9('0x3d')][_0xeaa9('0x49')]({'where':{'id':_0x36287f['params']['id']}})[_0xeaa9('0x24')](handleEntityNotFound(_0x59ffb6,null))[_0xeaa9('0x24')](function(_0x130c90){if(_0x130c90){return _0x130c90[_0xeaa9('0x51')](_0x36287f[_0xeaa9('0x46')][_0xeaa9('0x52')]||[]);}return null;})['then'](respondWithResult(_0x59ffb6,null))[_0xeaa9('0x3f')](handleError(_0x59ffb6,null));};
\ No newline at end of file
index 2d1c021..6e8a8fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac2b=['../../config/logger','api','moment','bluebird','request-promise','path','./intDeskConfiguration.attributes','define','util'];(function(_0x37fdd6,_0x59a74f){var _0x65b931=function(_0x52736f){while(--_0x52736f){_0x37fdd6['push'](_0x37fdd6['shift']());}};_0x65b931(++_0x59a74f);}(_0xac2b,0x182));var _0xbac2=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xac2b[_0x41cfd4];return _0x190f48;};'use strict';var _=require('lodash');var util=require(_0xbac2('0x0'));var logger=require(_0xbac2('0x1'))(_0xbac2('0x2'));var moment=require(_0xbac2('0x3'));var BPromise=require(_0xbac2('0x4'));var rp=require(_0xbac2('0x5'));var fs=require('fs');var path=require(_0xbac2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbac2('0x7'));module['exports']=function(_0x5bcc7d,_0x3403c4){return _0x5bcc7d[_0xbac2('0x8')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a41=['api','moment','bluebird','request-promise','rimraf','./intDeskConfiguration.attributes','exports','DeskConfiguration','util'];(function(_0x2af1a8,_0x2151ab){var _0x488f5b=function(_0x21ef73){while(--_0x21ef73){_0x2af1a8['push'](_0x2af1a8['shift']());}};_0x488f5b(++_0x2151ab);}(_0x3a41,0x8f));var _0x13a4=function(_0x441c12,_0x491e5a){_0x441c12=_0x441c12-0x0;var _0x312edf=_0x3a41[_0x441c12];return _0x312edf;};'use strict';var _=require('lodash');var util=require(_0x13a4('0x0'));var logger=require('../../config/logger')(_0x13a4('0x1'));var moment=require(_0x13a4('0x2'));var BPromise=require(_0x13a4('0x3'));var rp=require(_0x13a4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x13a4('0x5'));var config=require('../../config/environment');var attributes=require(_0x13a4('0x6'));module[_0x13a4('0x7')]=function(_0x4c872d,_0x5948db){return _0x4c872d['define'](_0x13a4('0x8'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cb81bd6..8b63b31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8af6=['DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info'];(function(_0x31e0b7,_0x33a005){var _0x58dabc=function(_0x122a22){while(--_0x122a22){_0x31e0b7['push'](_0x31e0b7['shift']());}};_0x58dabc(++_0x33a005);}(_0x8af6,0x76));var _0x68af=function(_0x54f3af,_0xddff4f){_0x54f3af=_0x54f3af-0x0;var _0x58f346=_0x8af6[_0x54f3af];return _0x58f346;};'use strict';var _=require(_0x68af('0x0'));var util=require(_0x68af('0x1'));var moment=require(_0x68af('0x2'));var BPromise=require(_0x68af('0x3'));var rs=require(_0x68af('0x4'));var fs=require('fs');var Redis=require(_0x68af('0x5'));var db=require(_0x68af('0x6'))['db'];var utils=require(_0x68af('0x7'));var logger=require(_0x68af('0x8'))(_0x68af('0x9'));var config=require('../../config/environment');var jayson=require(_0x68af('0xa'));var client=jayson['client'][_0x68af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2be0c1,_0x89146f,_0x1e77b0){return new BPromise(function(_0x3c6018,_0x20d61c){return client[_0x68af('0xc')](_0x2be0c1,_0x1e77b0)['then'](function(_0x56bc37){logger[_0x68af('0xd')](_0x68af('0xe'),_0x89146f,'request\x20sent');logger[_0x68af('0xf')](_0x68af('0x10'),_0x89146f,_0x68af('0x11'),JSON[_0x68af('0x12')](_0x56bc37));if(_0x56bc37[_0x68af('0x13')]){if(_0x56bc37[_0x68af('0x13')]['code']===0x1f4){logger['error'](_0x68af('0xe'),_0x89146f,_0x56bc37['error']['message']);return _0x20d61c(_0x56bc37[_0x68af('0x13')][_0x68af('0x14')]);}logger[_0x68af('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x89146f,_0x56bc37[_0x68af('0x13')]['message']);return _0x3c6018(_0x56bc37[_0x68af('0x13')][_0x68af('0x14')]);}else{logger[_0x68af('0xd')](_0x68af('0xe'),_0x89146f,_0x68af('0x11'));_0x3c6018(_0x56bc37['result'][_0x68af('0x14')]);}})[_0x68af('0x15')](function(_0x326b12){logger[_0x68af('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x89146f,_0x326b12);_0x20d61c(_0x326b12);});});}
\ No newline at end of file
+var _0xa848=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x7fa7ce,_0xa46426){var _0x142e7e=function(_0x46084c){while(--_0x46084c){_0x7fa7ce['push'](_0x7fa7ce['shift']());}};_0x142e7e(++_0xa46426);}(_0xa848,0x99));var _0x8a84=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa848[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x8a84('0x0'));var util=require(_0x8a84('0x1'));var moment=require(_0x8a84('0x2'));var BPromise=require('bluebird');var rs=require(_0x8a84('0x3'));var fs=require('fs');var Redis=require(_0x8a84('0x4'));var db=require(_0x8a84('0x5'))['db'];var utils=require(_0x8a84('0x6'));var logger=require(_0x8a84('0x7'))(_0x8a84('0x8'));var config=require(_0x8a84('0x9'));var jayson=require(_0x8a84('0xa'));var client=jayson[_0x8a84('0xb')][_0x8a84('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d463b,_0x1b958b,_0x764e89){return new BPromise(function(_0xd33118,_0x5a76f4){return client[_0x8a84('0xd')](_0x1d463b,_0x764e89)[_0x8a84('0xe')](function(_0x2294c8){logger['info'](_0x8a84('0xf'),_0x1b958b,_0x8a84('0x10'));logger[_0x8a84('0x11')](_0x8a84('0x12'),_0x1b958b,_0x8a84('0x10'),JSON[_0x8a84('0x13')](_0x2294c8));if(_0x2294c8[_0x8a84('0x14')]){if(_0x2294c8[_0x8a84('0x14')][_0x8a84('0x15')]===0x1f4){logger[_0x8a84('0x14')](_0x8a84('0xf'),_0x1b958b,_0x2294c8[_0x8a84('0x14')]['message']);return _0x5a76f4(_0x2294c8[_0x8a84('0x14')][_0x8a84('0x16')]);}logger[_0x8a84('0x14')]('DeskConfiguration,\x20%s,\x20%s',_0x1b958b,_0x2294c8[_0x8a84('0x14')][_0x8a84('0x16')]);return _0xd33118(_0x2294c8[_0x8a84('0x14')]['message']);}else{logger[_0x8a84('0x17')](_0x8a84('0xf'),_0x1b958b,'request\x20sent');_0xd33118(_0x2294c8[_0x8a84('0x18')][_0x8a84('0x16')]);}})[_0x8a84('0x19')](function(_0x209516){logger['error'](_0x8a84('0xf'),_0x1b958b,_0x209516);_0x5a76f4(_0x209516);});});}
\ No newline at end of file
index f8f1f40..83ea538 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed48=['util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','/:id','isAuthenticated','show','create','update','delete','destroy','exports'];(function(_0x1644d1,_0x246613){var _0x5ee6dc=function(_0xe8a6e2){while(--_0xe8a6e2){_0x1644d1['push'](_0x1644d1['shift']());}};_0x5ee6dc(++_0x246613);}(_0xed48,0x90));var _0x8ed4=function(_0x1f97e8,_0x445a4a){_0x1f97e8=_0x1f97e8-0x0;var _0x1ed77c=_0xed48[_0x1f97e8];return _0x1ed77c;};'use strict';var multer=require('multer');var util=require(_0x8ed4('0x0'));var path=require('path');var timeout=require(_0x8ed4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8ed4('0x2'));var auth=require(_0x8ed4('0x3'));var interaction=require(_0x8ed4('0x4'));var config=require(_0x8ed4('0x5'));var controller=require(_0x8ed4('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8ed4('0x7')](_0x8ed4('0x8'),auth[_0x8ed4('0x9')](),controller[_0x8ed4('0xa')]);router['post']('/',auth[_0x8ed4('0x9')](),controller[_0x8ed4('0xb')]);router['put'](_0x8ed4('0x8'),auth[_0x8ed4('0x9')](),controller[_0x8ed4('0xc')]);router[_0x8ed4('0xd')](_0x8ed4('0x8'),auth[_0x8ed4('0x9')](),controller[_0x8ed4('0xe')]);module[_0x8ed4('0xf')]=router;
\ No newline at end of file
+var _0xc542=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intDeskField.controller','isAuthenticated','get','/:id','show'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0xc542,0xd1));var _0x2c54=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xc542[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x2c54('0x0'));var util=require(_0x2c54('0x1'));var path=require(_0x2c54('0x2'));var timeout=require(_0x2c54('0x3'));var express=require(_0x2c54('0x4'));var router=express[_0x2c54('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c54('0x6'));var controller=require(_0x2c54('0x7'));router['get']('/',auth[_0x2c54('0x8')](),controller['index']);router[_0x2c54('0x9')](_0x2c54('0xa'),auth[_0x2c54('0x8')](),controller[_0x2c54('0xb')]);router['post']('/',auth[_0x2c54('0x8')](),controller[_0x2c54('0xc')]);router[_0x2c54('0xd')](_0x2c54('0xa'),auth['isAuthenticated'](),controller[_0x2c54('0xe')]);router['delete'](_0x2c54('0xa'),auth['isAuthenticated'](),controller[_0x2c54('0xf')]);module[_0x2c54('0x10')]=router;
\ No newline at end of file
index e6d0255..a4e975a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fa8=['keyValue','picklist','STRING','ENUM','string','variable','customVariable'];(function(_0x21cd1d,_0x3ec220){var _0x512046=function(_0x108bb7){while(--_0x108bb7){_0x21cd1d['push'](_0x21cd1d['shift']());}};_0x512046(++_0x3ec220);}(_0x2fa8,0x122));var _0x82fa=function(_0x5b902b,_0x5d5582){_0x5b902b=_0x5b902b-0x0;var _0x4dc52a=_0x2fa8[_0x5b902b];return _0x4dc52a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x82fa('0x0')](_0x82fa('0x1'),_0x82fa('0x2'),_0x82fa('0x3'),_0x82fa('0x4'),_0x82fa('0x5')),'defaultValue':_0x82fa('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x82fa('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x82fa('0x1'),_0x82fa('0x2'),_0x82fa('0x3'))},'keyContent':{'type':Sequelize[_0x82fa('0x6')]},'idField':{'type':Sequelize[_0x82fa('0x6')]},'nameField':{'type':Sequelize[_0x82fa('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x82fa('0x6')]}};
\ No newline at end of file
+var _0x08a4=['exports','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x488017,_0x3cd562){var _0x5645c1=function(_0x445436){while(--_0x445436){_0x488017['push'](_0x488017['shift']());}};_0x5645c1(++_0x3cd562);}(_0x08a4,0x87));var _0x408a=function(_0x2697c8,_0x3eb75f){_0x2697c8=_0x2697c8-0x0;var _0x3716f4=_0x08a4[_0x2697c8];return _0x3716f4;};'use strict';var Sequelize=require(_0x408a('0x0'));module[_0x408a('0x1')]={'type':{'type':Sequelize['ENUM'](_0x408a('0x2'),_0x408a('0x3'),_0x408a('0x4'),'keyValue',_0x408a('0x5')),'defaultValue':_0x408a('0x2')},'content':{'type':Sequelize[_0x408a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x408a('0x2'),_0x408a('0x3'),_0x408a('0x4'))},'keyContent':{'type':Sequelize[_0x408a('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x408a('0x6')]},'customField':{'type':Sequelize[_0x408a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 03c12c3..3a7aae6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49c1=['save','update','then','destroy','sendStatus','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','includeAll','include','rows','catch','params','keys','find','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x2e676b,_0x4e2210){var _0x1edfe8=function(_0x33d640){while(--_0x33d640){_0x2e676b['push'](_0x2e676b['shift']());}};_0x1edfe8(++_0x4e2210);}(_0x49c1,0xef));var _0x149c=function(_0x4d1431,_0x438aad){_0x4d1431=_0x4d1431-0x0;var _0x2f5ff1=_0x49c1[_0x4d1431];return _0x2f5ff1;};'use strict';var emlformat=require(_0x149c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x149c('0x1'));var jsonpatch=require(_0x149c('0x2'));var rp=require(_0x149c('0x3'));var moment=require('moment');var BPromise=require(_0x149c('0x4'));var Mustache=require(_0x149c('0x5'));var util=require('util');var path=require(_0x149c('0x6'));var sox=require(_0x149c('0x7'));var csv=require('to-csv');var ejs=require(_0x149c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x149c('0x9'));var squel=require(_0x149c('0xa'));var crypto=require('crypto');var jsforce=require(_0x149c('0xb'));var deskjs=require(_0x149c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x149c('0xd'));var Papa=require(_0x149c('0xe'));var Redis=require('ioredis');var authService=require(_0x149c('0xf'));var qs=require(_0x149c('0x10'));var as=require(_0x149c('0x11'));var hardwareService=require(_0x149c('0x12'));var logger=require('../../config/logger')(_0x149c('0x13'));var utils=require(_0x149c('0x14'));var config=require(_0x149c('0x15'));var licenseUtil=require(_0x149c('0x16'));var db=require(_0x149c('0x17'))['db'];function respondWithStatusCode(_0x19e0b1,_0x1a0c32){_0x1a0c32=_0x1a0c32||0xcc;return function(_0x2310b8){if(_0x2310b8){return _0x19e0b1['sendStatus'](_0x1a0c32);}return _0x19e0b1[_0x149c('0x18')](_0x1a0c32)[_0x149c('0x19')]();};}function respondWithResult(_0x4aee29,_0x3b247e){_0x3b247e=_0x3b247e||0xc8;return function(_0x4e6cbc){if(_0x4e6cbc){return _0x4aee29[_0x149c('0x18')](_0x3b247e)[_0x149c('0x1a')](_0x4e6cbc);}};}function respondWithFilteredResult(_0x177800,_0x471e93){return function(_0x3d851a){if(_0x3d851a){var _0x30f8c1=typeof _0x471e93[_0x149c('0x1b')]===_0x149c('0x1c')&&typeof _0x471e93[_0x149c('0x1d')]==='undefined';var _0x449ac4=_0x3d851a[_0x149c('0x1e')];var _0x352f68=_0x30f8c1?0x0:_0x471e93[_0x149c('0x1b')];var _0x35f64f=_0x30f8c1?_0x3d851a[_0x149c('0x1e')]:_0x471e93[_0x149c('0x1b')]+_0x471e93[_0x149c('0x1d')];var _0x5910bd;if(_0x35f64f>=_0x449ac4){_0x35f64f=_0x449ac4;_0x5910bd=0xc8;}else{_0x5910bd=0xce;}_0x177800[_0x149c('0x18')](_0x5910bd);return _0x177800['set']('Content-Range',_0x352f68+'-'+_0x35f64f+'/'+_0x449ac4)['json'](_0x3d851a);}return null;};}function patchUpdates(_0x4c9b41){return function(_0x14194d){try{jsonpatch[_0x149c('0x1f')](_0x14194d,_0x4c9b41,!![]);}catch(_0xc1e2d6){return BPromise[_0x149c('0x20')](_0xc1e2d6);}return _0x14194d[_0x149c('0x21')]();};}function saveUpdates(_0x184924,_0x4e663e){return function(_0x398203){if(_0x398203){return _0x398203[_0x149c('0x22')](_0x184924)[_0x149c('0x23')](function(_0x178cf6){return _0x178cf6;});}return null;};}function removeEntity(_0x2cdd54,_0xb60e06){return function(_0x238363){if(_0x238363){return _0x238363[_0x149c('0x24')]()['then'](function(){_0x2cdd54[_0x149c('0x18')](0xcc)[_0x149c('0x19')]();});}};}function handleEntityNotFound(_0x4bb447,_0x29b216){return function(_0xac3cec){if(!_0xac3cec){_0x4bb447[_0x149c('0x25')](0x194);}return _0xac3cec;};}function handleError(_0x2b27f4,_0x5a16cb){_0x5a16cb=_0x5a16cb||0x1f4;return function(_0x36e070){logger[_0x149c('0x26')](_0x36e070[_0x149c('0x27')]);if(_0x36e070[_0x149c('0x28')]){delete _0x36e070[_0x149c('0x28')];}_0x2b27f4[_0x149c('0x18')](_0x5a16cb)[_0x149c('0x29')](_0x36e070);};}exports['index']=function(_0x55c85f,_0x5ea478){var _0x1203f2={},_0x2da1de={},_0x5a268b={'count':0x0,'rows':[]};var _0x7eddc0=_[_0x149c('0x2a')](db[_0x149c('0x2b')][_0x149c('0x2c')],function(_0x561445){return{'name':_0x561445[_0x149c('0x2d')],'type':_0x561445[_0x149c('0x2e')][_0x149c('0x2f')]};});_0x2da1de[_0x149c('0x30')]=_[_0x149c('0x2a')](_0x7eddc0,'name');_0x2da1de[_0x149c('0x31')]=_['keys'](_0x55c85f[_0x149c('0x31')]);_0x2da1de[_0x149c('0x32')]=_[_0x149c('0x33')](_0x2da1de[_0x149c('0x30')],_0x2da1de[_0x149c('0x31')]);_0x1203f2[_0x149c('0x34')]=_[_0x149c('0x33')](_0x2da1de['model'],qs[_0x149c('0x35')](_0x55c85f['query'][_0x149c('0x35')]));_0x1203f2['attributes']=_0x1203f2[_0x149c('0x34')]['length']?_0x1203f2[_0x149c('0x34')]:_0x2da1de[_0x149c('0x30')];if(!_0x55c85f['query']['hasOwnProperty'](_0x149c('0x36'))){_0x1203f2[_0x149c('0x1d')]=qs['limit'](_0x55c85f['query'][_0x149c('0x1d')]);_0x1203f2[_0x149c('0x1b')]=qs[_0x149c('0x1b')](_0x55c85f[_0x149c('0x31')][_0x149c('0x1b')]);}_0x1203f2[_0x149c('0x37')]=qs['sort'](_0x55c85f[_0x149c('0x31')][_0x149c('0x38')]);_0x1203f2[_0x149c('0x39')]=qs[_0x149c('0x32')](_['pick'](_0x55c85f[_0x149c('0x31')],_0x2da1de[_0x149c('0x32')]),_0x7eddc0);if(_0x55c85f[_0x149c('0x31')][_0x149c('0x3a')]){_0x1203f2['where']=_['merge'](_0x1203f2[_0x149c('0x39')],{'$or':_[_0x149c('0x2a')](_0x7eddc0,function(_0x48e4ca){if(_0x48e4ca[_0x149c('0x2e')]!=='VIRTUAL'){var _0xe18636={};_0xe18636[_0x48e4ca[_0x149c('0x28')]]={'$like':'%'+_0x55c85f[_0x149c('0x31')][_0x149c('0x3a')]+'%'};return _0xe18636;}})});}_0x1203f2=_[_0x149c('0x3b')]({},_0x1203f2,_0x55c85f['options']);var _0x36b9ce={'where':_0x1203f2[_0x149c('0x39')]};return db['DeskField']['count'](_0x36b9ce)[_0x149c('0x23')](function(_0xeecd72){_0x5a268b['count']=_0xeecd72;if(_0x55c85f[_0x149c('0x31')][_0x149c('0x3c')]){_0x1203f2[_0x149c('0x3d')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x1203f2);})[_0x149c('0x23')](function(_0x14f790){_0x5a268b[_0x149c('0x3e')]=_0x14f790;return _0x5a268b;})['then'](respondWithFilteredResult(_0x5ea478,_0x1203f2))[_0x149c('0x3f')](handleError(_0x5ea478,null));};exports['show']=function(_0x47d8fd,_0x3fc899){var _0x26418d={'raw':!![],'where':{'id':_0x47d8fd[_0x149c('0x40')]['id']}},_0x154a3c={};_0x154a3c[_0x149c('0x30')]=_[_0x149c('0x41')](db['DeskField'][_0x149c('0x2c')]);_0x154a3c[_0x149c('0x31')]=_[_0x149c('0x41')](_0x47d8fd[_0x149c('0x31')]);_0x154a3c[_0x149c('0x32')]=_[_0x149c('0x33')](_0x154a3c[_0x149c('0x30')],_0x154a3c[_0x149c('0x31')]);_0x26418d[_0x149c('0x34')]=_[_0x149c('0x33')](_0x154a3c['model'],qs[_0x149c('0x35')](_0x47d8fd[_0x149c('0x31')][_0x149c('0x35')]));_0x26418d[_0x149c('0x34')]=_0x26418d[_0x149c('0x34')]['length']?_0x26418d['attributes']:_0x154a3c[_0x149c('0x30')];if(_0x47d8fd['query'][_0x149c('0x3c')]){_0x26418d[_0x149c('0x3d')]=[{'all':!![]}];}_0x26418d=_['merge']({},_0x26418d,_0x47d8fd['options']);return db[_0x149c('0x2b')][_0x149c('0x42')](_0x26418d)[_0x149c('0x23')](handleEntityNotFound(_0x3fc899,null))[_0x149c('0x23')](respondWithResult(_0x3fc899,null))['catch'](handleError(_0x3fc899,null));};exports['create']=function(_0x24983b,_0x25584b){return db['DeskField']['create'](_0x24983b['body'],{})[_0x149c('0x23')](respondWithResult(_0x25584b,0xc9))[_0x149c('0x3f')](handleError(_0x25584b,null));};exports[_0x149c('0x22')]=function(_0x1cbc98,_0x54a99b){if(_0x1cbc98[_0x149c('0x43')]['id']){delete _0x1cbc98[_0x149c('0x43')]['id'];}return db[_0x149c('0x2b')]['find']({'where':{'id':_0x1cbc98[_0x149c('0x40')]['id']}})[_0x149c('0x23')](handleEntityNotFound(_0x54a99b,null))['then'](saveUpdates(_0x1cbc98['body'],null))['then'](respondWithResult(_0x54a99b,null))['catch'](handleError(_0x54a99b,null));};exports[_0x149c('0x24')]=function(_0x437ae0,_0x16cae8){return db['DeskField'][_0x149c('0x42')]({'where':{'id':_0x437ae0['params']['id']}})[_0x149c('0x23')](handleEntityNotFound(_0x16cae8,null))['then'](removeEntity(_0x16cae8,null))[_0x149c('0x3f')](handleError(_0x16cae8,null));};
\ No newline at end of file
+var _0x13b2=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','DeskField','rawAttributes','type','key','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x24320b,_0x2019e3){var _0x3be7e0=function(_0x59d75c){while(--_0x59d75c){_0x24320b['push'](_0x24320b['shift']());}};_0x3be7e0(++_0x2019e3);}(_0x13b2,0x19c));var _0x213b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x13b2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x213b('0x0'));var rimraf=require(_0x213b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x213b('0x2'));var rp=require(_0x213b('0x3'));var moment=require(_0x213b('0x4'));var BPromise=require(_0x213b('0x5'));var Mustache=require('mustache');var util=require(_0x213b('0x6'));var path=require(_0x213b('0x7'));var sox=require('sox');var csv=require(_0x213b('0x8'));var ejs=require(_0x213b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x213b('0xa'));var jsforce=require(_0x213b('0xb'));var deskjs=require(_0x213b('0xc'));var toCsv=require(_0x213b('0x8'));var querystring=require(_0x213b('0xd'));var Papa=require(_0x213b('0xe'));var Redis=require('ioredis');var authService=require(_0x213b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x213b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x213b('0x11'))(_0x213b('0x12'));var utils=require(_0x213b('0x13'));var config=require(_0x213b('0x14'));var licenseUtil=require(_0x213b('0x15'));var db=require(_0x213b('0x16'))['db'];function respondWithStatusCode(_0x58d2e8,_0x5f3932){_0x5f3932=_0x5f3932||0xcc;return function(_0x3b6ce6){if(_0x3b6ce6){return _0x58d2e8[_0x213b('0x17')](_0x5f3932);}return _0x58d2e8[_0x213b('0x18')](_0x5f3932)[_0x213b('0x19')]();};}function respondWithResult(_0x15677f,_0x323996){_0x323996=_0x323996||0xc8;return function(_0x220323){if(_0x220323){return _0x15677f[_0x213b('0x18')](_0x323996)[_0x213b('0x1a')](_0x220323);}};}function respondWithFilteredResult(_0x3aa9af,_0x21424c){return function(_0x19286b){if(_0x19286b){var _0xf42fba=typeof _0x21424c[_0x213b('0x1b')]==='undefined'&&typeof _0x21424c[_0x213b('0x1c')]==='undefined';var _0x158b82=_0x19286b[_0x213b('0x1d')];var _0x2ca21f=_0xf42fba?0x0:_0x21424c[_0x213b('0x1b')];var _0x15c246=_0xf42fba?_0x19286b[_0x213b('0x1d')]:_0x21424c['offset']+_0x21424c['limit'];var _0x424df5;if(_0x15c246>=_0x158b82){_0x15c246=_0x158b82;_0x424df5=0xc8;}else{_0x424df5=0xce;}_0x3aa9af['status'](_0x424df5);return _0x3aa9af['set'](_0x213b('0x1e'),_0x2ca21f+'-'+_0x15c246+'/'+_0x158b82)[_0x213b('0x1a')](_0x19286b);}return null;};}function patchUpdates(_0x3e025d){return function(_0x15b13f){try{jsonpatch[_0x213b('0x1f')](_0x15b13f,_0x3e025d,!![]);}catch(_0x398f55){return BPromise[_0x213b('0x20')](_0x398f55);}return _0x15b13f['save']();};}function saveUpdates(_0x39a9d9,_0x523946){return function(_0xbc1f25){if(_0xbc1f25){return _0xbc1f25[_0x213b('0x21')](_0x39a9d9)[_0x213b('0x22')](function(_0x1952ff){return _0x1952ff;});}return null;};}function removeEntity(_0x4f0dcf,_0x1df33b){return function(_0x21d3ca){if(_0x21d3ca){return _0x21d3ca['destroy']()['then'](function(){_0x4f0dcf[_0x213b('0x18')](0xcc)[_0x213b('0x19')]();});}};}function handleEntityNotFound(_0xb3c85,_0x23f1b8){return function(_0x35de63){if(!_0x35de63){_0xb3c85['sendStatus'](0x194);}return _0x35de63;};}function handleError(_0x439d12,_0x597ef9){_0x597ef9=_0x597ef9||0x1f4;return function(_0x1eb0cf){logger[_0x213b('0x23')](_0x1eb0cf[_0x213b('0x24')]);if(_0x1eb0cf[_0x213b('0x25')]){delete _0x1eb0cf[_0x213b('0x25')];}_0x439d12['status'](_0x597ef9)[_0x213b('0x26')](_0x1eb0cf);};}exports[_0x213b('0x27')]=function(_0x5f0947,_0x494f54){var _0x38ca49={},_0x496032={},_0x33c5b2={'count':0x0,'rows':[]};var _0x40dc4f=_['map'](db[_0x213b('0x28')][_0x213b('0x29')],function(_0x57e330){return{'name':_0x57e330['fieldName'],'type':_0x57e330[_0x213b('0x2a')][_0x213b('0x2b')]};});_0x496032[_0x213b('0x2c')]=_['map'](_0x40dc4f,_0x213b('0x25'));_0x496032['query']=_[_0x213b('0x2d')](_0x5f0947['query']);_0x496032[_0x213b('0x2e')]=_[_0x213b('0x2f')](_0x496032[_0x213b('0x2c')],_0x496032['query']);_0x38ca49[_0x213b('0x30')]=_[_0x213b('0x2f')](_0x496032[_0x213b('0x2c')],qs['fields'](_0x5f0947[_0x213b('0x31')][_0x213b('0x32')]));_0x38ca49[_0x213b('0x30')]=_0x38ca49[_0x213b('0x30')][_0x213b('0x33')]?_0x38ca49['attributes']:_0x496032[_0x213b('0x2c')];if(!_0x5f0947[_0x213b('0x31')][_0x213b('0x34')](_0x213b('0x35'))){_0x38ca49[_0x213b('0x1c')]=qs[_0x213b('0x1c')](_0x5f0947[_0x213b('0x31')]['limit']);_0x38ca49[_0x213b('0x1b')]=qs[_0x213b('0x1b')](_0x5f0947['query'][_0x213b('0x1b')]);}_0x38ca49[_0x213b('0x36')]=qs[_0x213b('0x37')](_0x5f0947[_0x213b('0x31')]['sort']);_0x38ca49[_0x213b('0x38')]=qs[_0x213b('0x2e')](_[_0x213b('0x39')](_0x5f0947[_0x213b('0x31')],_0x496032[_0x213b('0x2e')]),_0x40dc4f);if(_0x5f0947[_0x213b('0x31')][_0x213b('0x3a')]){_0x38ca49[_0x213b('0x38')]=_[_0x213b('0x3b')](_0x38ca49['where'],{'$or':_['map'](_0x40dc4f,function(_0x618c37){if(_0x618c37[_0x213b('0x2a')]!==_0x213b('0x3c')){var _0x2cd61d={};_0x2cd61d[_0x618c37[_0x213b('0x25')]]={'$like':'%'+_0x5f0947['query'][_0x213b('0x3a')]+'%'};return _0x2cd61d;}})});}_0x38ca49=_[_0x213b('0x3b')]({},_0x38ca49,_0x5f0947[_0x213b('0x3d')]);var _0x512daa={'where':_0x38ca49[_0x213b('0x38')]};return db['DeskField'][_0x213b('0x1d')](_0x512daa)[_0x213b('0x22')](function(_0xd7b141){_0x33c5b2[_0x213b('0x1d')]=_0xd7b141;if(_0x5f0947['query'][_0x213b('0x3e')]){_0x38ca49[_0x213b('0x3f')]=[{'all':!![]}];}return db['DeskField'][_0x213b('0x40')](_0x38ca49);})[_0x213b('0x22')](function(_0x527713){_0x33c5b2[_0x213b('0x41')]=_0x527713;return _0x33c5b2;})[_0x213b('0x22')](respondWithFilteredResult(_0x494f54,_0x38ca49))[_0x213b('0x42')](handleError(_0x494f54,null));};exports['show']=function(_0x438e36,_0xfd4574){var _0x411a29={'raw':!![],'where':{'id':_0x438e36[_0x213b('0x43')]['id']}},_0x4101db={};_0x4101db[_0x213b('0x2c')]=_[_0x213b('0x2d')](db[_0x213b('0x28')]['rawAttributes']);_0x4101db['query']=_[_0x213b('0x2d')](_0x438e36[_0x213b('0x31')]);_0x4101db[_0x213b('0x2e')]=_[_0x213b('0x2f')](_0x4101db[_0x213b('0x2c')],_0x4101db['query']);_0x411a29['attributes']=_[_0x213b('0x2f')](_0x4101db[_0x213b('0x2c')],qs[_0x213b('0x32')](_0x438e36[_0x213b('0x31')][_0x213b('0x32')]));_0x411a29['attributes']=_0x411a29[_0x213b('0x30')][_0x213b('0x33')]?_0x411a29[_0x213b('0x30')]:_0x4101db[_0x213b('0x2c')];if(_0x438e36[_0x213b('0x31')][_0x213b('0x3e')]){_0x411a29['include']=[{'all':!![]}];}_0x411a29=_[_0x213b('0x3b')]({},_0x411a29,_0x438e36[_0x213b('0x3d')]);return db['DeskField'][_0x213b('0x44')](_0x411a29)[_0x213b('0x22')](handleEntityNotFound(_0xfd4574,null))[_0x213b('0x22')](respondWithResult(_0xfd4574,null))[_0x213b('0x42')](handleError(_0xfd4574,null));};exports[_0x213b('0x45')]=function(_0x154322,_0x5be4bd){return db[_0x213b('0x28')][_0x213b('0x45')](_0x154322[_0x213b('0x46')],{})[_0x213b('0x22')](respondWithResult(_0x5be4bd,0xc9))[_0x213b('0x42')](handleError(_0x5be4bd,null));};exports['update']=function(_0x3309a0,_0x327ce0){if(_0x3309a0[_0x213b('0x46')]['id']){delete _0x3309a0[_0x213b('0x46')]['id'];}return db['DeskField'][_0x213b('0x44')]({'where':{'id':_0x3309a0[_0x213b('0x43')]['id']}})[_0x213b('0x22')](handleEntityNotFound(_0x327ce0,null))['then'](saveUpdates(_0x3309a0[_0x213b('0x46')],null))[_0x213b('0x22')](respondWithResult(_0x327ce0,null))[_0x213b('0x42')](handleError(_0x327ce0,null));};exports[_0x213b('0x47')]=function(_0x2c59aa,_0x19e26a){return db[_0x213b('0x28')][_0x213b('0x44')]({'where':{'id':_0x2c59aa['params']['id']}})[_0x213b('0x22')](handleEntityNotFound(_0x19e26a,null))['then'](removeEntity(_0x19e26a,null))[_0x213b('0x42')](handleError(_0x19e26a,null));};
\ No newline at end of file
index 73a15d3..21485d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c5e=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x539b43,_0x5ce0e6){var _0x2a1d25=function(_0x52f654){while(--_0x52f654){_0x539b43['push'](_0x539b43['shift']());}};_0x2a1d25(++_0x5ce0e6);}(_0x7c5e,0x168));var _0xe7c5=function(_0x18212,_0x7cf980){_0x18212=_0x18212-0x0;var _0x595fce=_0x7c5e[_0x18212];return _0x595fce;};'use strict';var _=require(_0xe7c5('0x0'));var util=require('util');var logger=require(_0xe7c5('0x1'))(_0xe7c5('0x2'));var moment=require('moment');var BPromise=require(_0xe7c5('0x3'));var rp=require(_0xe7c5('0x4'));var fs=require('fs');var path=require(_0xe7c5('0x5'));var rimraf=require(_0xe7c5('0x6'));var config=require(_0xe7c5('0x7'));var attributes=require(_0xe7c5('0x8'));module['exports']=function(_0x532a49,_0x1fc13d){return _0x532a49[_0xe7c5('0x9')](_0xe7c5('0xa'),attributes,{'tableName':_0xe7c5('0xb'),'paranoid':![],'indexes':[{'name':_0xe7c5('0xc'),'fields':[_0xe7c5('0xd'),_0xe7c5('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0368=['exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x2fcf4c,_0x317964){var _0x2c3c7c=function(_0x5016d7){while(--_0x5016d7){_0x2fcf4c['push'](_0x2fcf4c['shift']());}};_0x2c3c7c(++_0x317964);}(_0x0368,0x85));var _0x8036=function(_0x407461,_0x1cf61c){_0x407461=_0x407461-0x0;var _0x2b3ffa=_0x0368[_0x407461];return _0x2b3ffa;};'use strict';var _=require(_0x8036('0x0'));var util=require(_0x8036('0x1'));var logger=require(_0x8036('0x2'))('api');var moment=require(_0x8036('0x3'));var BPromise=require('bluebird');var rp=require(_0x8036('0x4'));var fs=require('fs');var path=require(_0x8036('0x5'));var rimraf=require(_0x8036('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x8036('0x7')]=function(_0x1b6ef8,_0x7031f1){return _0x1b6ef8[_0x8036('0x8')](_0x8036('0x9'),attributes,{'tableName':_0x8036('0xa'),'paranoid':![],'indexes':[{'name':_0x8036('0xb'),'fields':[_0x8036('0xc'),_0x8036('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 0998b00..2fb6730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3512=['stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x22e166,_0xcfd4e){var _0x136ccc=function(_0x510294){while(--_0x510294){_0x22e166['push'](_0x22e166['shift']());}};_0x136ccc(++_0xcfd4e);}(_0x3512,0x17b));var _0x2351=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3512[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x2351('0x0'));var util=require(_0x2351('0x1'));var moment=require('moment');var BPromise=require(_0x2351('0x2'));var rs=require(_0x2351('0x3'));var fs=require('fs');var Redis=require(_0x2351('0x4'));var db=require(_0x2351('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2351('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2351('0x7'));var client=jayson[_0x2351('0x8')][_0x2351('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21c9c1,_0x12a60a,_0x287b08){return new BPromise(function(_0x65117b,_0x5e39ac){return client[_0x2351('0xa')](_0x21c9c1,_0x287b08)[_0x2351('0xb')](function(_0xd61575){logger[_0x2351('0xc')](_0x2351('0xd'),_0x12a60a,_0x2351('0xe'));logger[_0x2351('0xf')](_0x2351('0x10'),_0x12a60a,'request\x20sent',JSON[_0x2351('0x11')](_0xd61575));if(_0xd61575[_0x2351('0x12')]){if(_0xd61575[_0x2351('0x12')][_0x2351('0x13')]===0x1f4){logger[_0x2351('0x12')](_0x2351('0xd'),_0x12a60a,_0xd61575['error'][_0x2351('0x14')]);return _0x5e39ac(_0xd61575['error'][_0x2351('0x14')]);}logger['error'](_0x2351('0xd'),_0x12a60a,_0xd61575[_0x2351('0x12')][_0x2351('0x14')]);return _0x65117b(_0xd61575[_0x2351('0x12')]['message']);}else{logger['info'](_0x2351('0xd'),_0x12a60a,_0x2351('0xe'));_0x65117b(_0xd61575['result'][_0x2351('0x14')]);}})[_0x2351('0x15')](function(_0x1efc22){logger[_0x2351('0x12')](_0x2351('0xd'),_0x12a60a,_0x1efc22);_0x5e39ac(_0x1efc22);});});}
\ No newline at end of file
+var _0x9df3=['error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3fc465,_0x74a894){var _0x254c5f=function(_0x466833){while(--_0x466833){_0x3fc465['push'](_0x3fc465['shift']());}};_0x254c5f(++_0x74a894);}(_0x9df3,0xb6));var _0x39df=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x9df3[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x39df('0x0'));var util=require(_0x39df('0x1'));var moment=require('moment');var BPromise=require(_0x39df('0x2'));var rs=require(_0x39df('0x3'));var fs=require('fs');var Redis=require(_0x39df('0x4'));var db=require(_0x39df('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x39df('0x6'));var config=require(_0x39df('0x7'));var jayson=require(_0x39df('0x8'));var client=jayson[_0x39df('0x9')][_0x39df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x541357,_0x5b1551,_0x1c3912){return new BPromise(function(_0x5b4360,_0xa9c34e){return client['request'](_0x541357,_0x1c3912)['then'](function(_0x8dfca4){logger[_0x39df('0xb')]('DeskField,\x20%s,\x20%s',_0x5b1551,_0x39df('0xc'));logger[_0x39df('0xd')](_0x39df('0xe'),_0x5b1551,'request\x20sent',JSON[_0x39df('0xf')](_0x8dfca4));if(_0x8dfca4[_0x39df('0x10')]){if(_0x8dfca4['error'][_0x39df('0x11')]===0x1f4){logger['error'](_0x39df('0x12'),_0x5b1551,_0x8dfca4[_0x39df('0x10')][_0x39df('0x13')]);return _0xa9c34e(_0x8dfca4['error'][_0x39df('0x13')]);}logger[_0x39df('0x10')]('DeskField,\x20%s,\x20%s',_0x5b1551,_0x8dfca4[_0x39df('0x10')][_0x39df('0x13')]);return _0x5b4360(_0x8dfca4[_0x39df('0x10')]['message']);}else{logger[_0x39df('0xb')]('DeskField,\x20%s,\x20%s',_0x5b1551,'request\x20sent');_0x5b4360(_0x8dfca4[_0x39df('0x14')]['message']);}})[_0x39df('0x15')](function(_0x38effa){logger[_0x39df('0x10')](_0x39df('0x12'),_0x5b1551,_0x38effa);_0xa9c34e(_0x38effa);});});}
\ No newline at end of file
index c43315c..db21734 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3453=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x3a717c,_0x19f349){var _0x4d47e6=function(_0x3c538a){while(--_0x3c538a){_0x3a717c['push'](_0x3a717c['shift']());}};_0x4d47e6(++_0x19f349);}(_0x3453,0x18a));var _0x3345=function(_0x145db1,_0x1724d5){_0x145db1=_0x145db1-0x0;var _0x5eff0a=_0x3453[_0x145db1];return _0x5eff0a;};'use strict';var multer=require(_0x3345('0x0'));var util=require(_0x3345('0x1'));var path=require(_0x3345('0x2'));var timeout=require(_0x3345('0x3'));var express=require(_0x3345('0x4'));var router=express[_0x3345('0x5')]();var fs_extra=require(_0x3345('0x6'));var auth=require(_0x3345('0x7'));var interaction=require(_0x3345('0x8'));var config=require(_0x3345('0x9'));var controller=require(_0x3345('0xa'));router[_0x3345('0xb')]('/',auth['isAuthenticated'](),controller[_0x3345('0xc')]);router[_0x3345('0xb')](_0x3345('0xd'),auth[_0x3345('0xe')](),controller[_0x3345('0xf')]);router[_0x3345('0xb')](_0x3345('0x10'),auth[_0x3345('0xe')](),controller['getConfigurations']);router[_0x3345('0xb')](_0x3345('0x11'),auth[_0x3345('0xe')](),controller[_0x3345('0x12')]);router[_0x3345('0x13')]('/',auth[_0x3345('0xe')](),controller[_0x3345('0x14')]);router[_0x3345('0x13')](_0x3345('0x10'),auth['isAuthenticated'](),controller[_0x3345('0x15')]);router[_0x3345('0x16')](_0x3345('0xd'),auth[_0x3345('0xe')](),controller[_0x3345('0x17')]);router[_0x3345('0x18')](_0x3345('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x582a=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','multer'];(function(_0x2fa440,_0x540088){var _0x4031e1=function(_0x2e96c5){while(--_0x2e96c5){_0x2fa440['push'](_0x2fa440['shift']());}};_0x4031e1(++_0x540088);}(_0x582a,0xdb));var _0xa582=function(_0x29b1a7,_0x1ed6b6){_0x29b1a7=_0x29b1a7-0x0;var _0x4a69af=_0x582a[_0x29b1a7];return _0x4a69af;};'use strict';var multer=require(_0xa582('0x0'));var util=require(_0xa582('0x1'));var path=require(_0xa582('0x2'));var timeout=require(_0xa582('0x3'));var express=require(_0xa582('0x4'));var router=express[_0xa582('0x5')]();var fs_extra=require(_0xa582('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa582('0x7'));var controller=require(_0xa582('0x8'));router[_0xa582('0x9')]('/',auth[_0xa582('0xa')](),controller['index']);router[_0xa582('0x9')](_0xa582('0xb'),auth['isAuthenticated'](),controller[_0xa582('0xc')]);router[_0xa582('0x9')](_0xa582('0xd'),auth[_0xa582('0xa')](),controller[_0xa582('0xe')]);router['get']('/:id/fields',auth[_0xa582('0xa')](),controller[_0xa582('0xf')]);router[_0xa582('0x10')]('/',auth['isAuthenticated'](),controller[_0xa582('0x11')]);router['post'](_0xa582('0xd'),auth['isAuthenticated'](),controller[_0xa582('0x12')]);router[_0xa582('0x13')](_0xa582('0xb'),auth[_0xa582('0xa')](),controller[_0xa582('0x14')]);router[_0xa582('0x15')](_0xa582('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index dd438e8..eed46b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8d1=['exports','STRING','sequelize'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc8d1,0xfe));var _0x1c8d=function(_0x35e300,_0x5a661b){_0x35e300=_0x35e300-0x0;var _0x34ffa7=_0xc8d1[_0x35e300];return _0x34ffa7;};'use strict';var Sequelize=require(_0x1c8d('0x0'));module[_0x1c8d('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1c8d('0x2')]},'password':{'type':Sequelize[_0x1c8d('0x2')]},'remoteUri':{'type':Sequelize[_0x1c8d('0x2')]},'tenantId':{'type':Sequelize[_0x1c8d('0x2')]},'clientId':{'type':Sequelize[_0x1c8d('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1c8d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1c8d('0x2')]}};
\ No newline at end of file
+var _0x7d51=['exports','STRING'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x7d51,0xb0));var _0x17d5=function(_0x5ed88f,_0x4583b4){_0x5ed88f=_0x5ed88f-0x0;var _0x51c0af=_0x7d51[_0x5ed88f];return _0x51c0af;};'use strict';var Sequelize=require('sequelize');module[_0x17d5('0x0')]={'name':{'type':Sequelize[_0x17d5('0x1')]},'username':{'type':Sequelize[_0x17d5('0x1')]},'password':{'type':Sequelize[_0x17d5('0x1')]},'remoteUri':{'type':Sequelize[_0x17d5('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x17d5('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 740432b..9401514 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde6c=['responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','findOne','clientId','clientSecret','remoteUri','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','username','password','access_token','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','substring','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','concat','test','statusCode','stack','Wrong\x20credentials','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','catch','body','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','incident','Incident','title','customerid','subject','phonenumber','directioncode','phonecall_activity_parties','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','resolveby','resolvebykpiidname'];(function(_0x316c42,_0x3391f0){var _0x2b38f7=function(_0x38d2cf){while(--_0x38d2cf){_0x316c42['push'](_0x316c42['shift']());}};_0x2b38f7(++_0x3391f0);}(_0xde6c,0x119));var _0xcde6=function(_0x59de2a,_0x264f62){_0x59de2a=_0x59de2a-0x0;var _0x1d18d2=_0xde6c[_0x59de2a];return _0x1d18d2;};'use strict';var emlformat=require(_0xcde6('0x0'));var rimraf=require(_0xcde6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcde6('0x2'));var rp=require(_0xcde6('0x3'));var moment=require(_0xcde6('0x4'));var BPromise=require(_0xcde6('0x5'));var Mustache=require('mustache');var util=require(_0xcde6('0x6'));var path=require(_0xcde6('0x7'));var sox=require(_0xcde6('0x8'));var csv=require('to-csv');var ejs=require(_0xcde6('0x9'));var fs=require('fs');var fs_extra=require(_0xcde6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcde6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcde6('0xc'));var toCsv=require(_0xcde6('0xd'));var querystring=require(_0xcde6('0xe'));var Papa=require(_0xcde6('0xf'));var Redis=require('ioredis');var authService=require(_0xcde6('0x10'));var qs=require(_0xcde6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcde6('0x12'));var logger=require(_0xcde6('0x13'))(_0xcde6('0x14'));var utils=require(_0xcde6('0x15'));var config=require(_0xcde6('0x16'));var licenseUtil=require(_0xcde6('0x17'));var db=require(_0xcde6('0x18'))['db'];var integrations=require(_0xcde6('0x19'));function respondWithStatusCode(_0x2a4adf,_0x40cf72){_0x40cf72=_0x40cf72||0xcc;return function(_0x548e08){if(_0x548e08){return _0x2a4adf[_0xcde6('0x1a')](_0x40cf72);}return _0x2a4adf[_0xcde6('0x1b')](_0x40cf72)[_0xcde6('0x1c')]();};}function respondWithResult(_0x33dbdb,_0x38a32d){_0x38a32d=_0x38a32d||0xc8;return function(_0x35ce40){if(_0x35ce40){return _0x33dbdb[_0xcde6('0x1b')](_0x38a32d)[_0xcde6('0x1d')](_0x35ce40);}};}function respondWithFilteredResult(_0x3c5bac,_0x1c0540){return function(_0x5f005c){if(_0x5f005c){var _0x1b8a49=typeof _0x1c0540[_0xcde6('0x1e')]===_0xcde6('0x1f')&&typeof _0x1c0540['limit']==='undefined';var _0x5e2b35=_0x5f005c[_0xcde6('0x20')];var _0x49744b=_0x1b8a49?0x0:_0x1c0540[_0xcde6('0x1e')];var _0x96732a=_0x1b8a49?_0x5f005c['count']:_0x1c0540[_0xcde6('0x1e')]+_0x1c0540['limit'];var _0x40e3a6;if(_0x96732a>=_0x5e2b35){_0x96732a=_0x5e2b35;_0x40e3a6=0xc8;}else{_0x40e3a6=0xce;}_0x3c5bac[_0xcde6('0x1b')](_0x40e3a6);return _0x3c5bac[_0xcde6('0x21')](_0xcde6('0x22'),_0x49744b+'-'+_0x96732a+'/'+_0x5e2b35)[_0xcde6('0x1d')](_0x5f005c);}return null;};}function patchUpdates(_0x21d5c2){return function(_0x3189bc){try{jsonpatch[_0xcde6('0x23')](_0x3189bc,_0x21d5c2,!![]);}catch(_0x55e4fd){return BPromise[_0xcde6('0x24')](_0x55e4fd);}return _0x3189bc[_0xcde6('0x25')]();};}function saveUpdates(_0x10bfdf,_0x49175a){return function(_0x3c565f){if(_0x3c565f){return _0x3c565f[_0xcde6('0x26')](_0x10bfdf)['then'](function(_0x1ae27e){return _0x1ae27e;});}return null;};}function removeEntity(_0x43f2a0,_0x13403f){return function(_0x3be6ac){if(_0x3be6ac){return _0x3be6ac[_0xcde6('0x27')]()[_0xcde6('0x28')](function(){_0x43f2a0[_0xcde6('0x1b')](0xcc)[_0xcde6('0x1c')]();});}};}function handleEntityNotFound(_0x543435,_0x177c37){return function(_0x5e54dd){if(!_0x5e54dd){_0x543435[_0xcde6('0x1a')](0x194);}return _0x5e54dd;};}function handleError(_0x3a732e,_0x17b713){_0x17b713=_0x17b713||0x1f4;return function(_0x5eec14){logger['error'](_0x5eec14['stack']);if(_0x5eec14[_0xcde6('0x29')]){delete _0x5eec14[_0xcde6('0x29')];}_0x3a732e[_0xcde6('0x1b')](_0x17b713)[_0xcde6('0x2a')](_0x5eec14);};}exports[_0xcde6('0x2b')]=function(_0x21ce36,_0x5cbd16){var _0x48cd06={},_0x193d18={},_0x469d5e={'count':0x0,'rows':[]};var _0x52ebf4=_[_0xcde6('0x2c')](db[_0xcde6('0x2d')][_0xcde6('0x2e')],function(_0x3ab6c1){return{'name':_0x3ab6c1[_0xcde6('0x2f')],'type':_0x3ab6c1[_0xcde6('0x30')][_0xcde6('0x31')]};});_0x193d18[_0xcde6('0x32')]=_[_0xcde6('0x2c')](_0x52ebf4,_0xcde6('0x29'));_0x193d18[_0xcde6('0x33')]=_[_0xcde6('0x34')](_0x21ce36[_0xcde6('0x33')]);_0x193d18[_0xcde6('0x35')]=_['intersection'](_0x193d18['model'],_0x193d18[_0xcde6('0x33')]);_0x48cd06[_0xcde6('0x36')]=_[_0xcde6('0x37')](_0x193d18[_0xcde6('0x32')],qs[_0xcde6('0x38')](_0x21ce36[_0xcde6('0x33')][_0xcde6('0x38')]));_0x48cd06['attributes']=_0x48cd06[_0xcde6('0x36')][_0xcde6('0x39')]?_0x48cd06[_0xcde6('0x36')]:_0x193d18[_0xcde6('0x32')];if(!_0x21ce36['query'][_0xcde6('0x3a')](_0xcde6('0x3b'))){_0x48cd06['limit']=qs[_0xcde6('0x3c')](_0x21ce36[_0xcde6('0x33')][_0xcde6('0x3c')]);_0x48cd06[_0xcde6('0x1e')]=qs[_0xcde6('0x1e')](_0x21ce36[_0xcde6('0x33')][_0xcde6('0x1e')]);}_0x48cd06[_0xcde6('0x3d')]=qs[_0xcde6('0x3e')](_0x21ce36['query'][_0xcde6('0x3e')]);_0x48cd06['where']=qs[_0xcde6('0x35')](_[_0xcde6('0x3f')](_0x21ce36[_0xcde6('0x33')],_0x193d18['filters']),_0x52ebf4);if(_0x21ce36['query'][_0xcde6('0x40')]){_0x48cd06[_0xcde6('0x41')]=_[_0xcde6('0x42')](_0x48cd06[_0xcde6('0x41')],{'$or':_[_0xcde6('0x2c')](_0x52ebf4,function(_0x232c66){if(_0x232c66[_0xcde6('0x30')]!==_0xcde6('0x43')){var _0x493b7c={};_0x493b7c[_0x232c66[_0xcde6('0x29')]]={'$like':'%'+_0x21ce36[_0xcde6('0x33')][_0xcde6('0x40')]+'%'};return _0x493b7c;}})});}_0x48cd06=_[_0xcde6('0x42')]({},_0x48cd06,_0x21ce36[_0xcde6('0x44')]);var _0x3ce196={'where':_0x48cd06['where']};return db[_0xcde6('0x2d')][_0xcde6('0x20')](_0x3ce196)['then'](function(_0x589489){_0x469d5e[_0xcde6('0x20')]=_0x589489;if(_0x21ce36['query'][_0xcde6('0x45')]){_0x48cd06[_0xcde6('0x46')]=[{'all':!![]}];}return db[_0xcde6('0x2d')][_0xcde6('0x47')](_0x48cd06);})['then'](function(_0x5100fa){_0x469d5e[_0xcde6('0x48')]=_0x5100fa;return _0x469d5e;})[_0xcde6('0x28')](respondWithFilteredResult(_0x5cbd16,_0x48cd06))['catch'](handleError(_0x5cbd16,null));};exports[_0xcde6('0x49')]=function(_0x6d77db,_0x390063){var _0x1b259d={'raw':![],'where':{'id':_0x6d77db[_0xcde6('0x4a')]['id']}},_0x31d319={};_0x31d319[_0xcde6('0x32')]=_['keys'](db['Dynamics365Account'][_0xcde6('0x2e')]);_0x31d319[_0xcde6('0x33')]=_['keys'](_0x6d77db['query']);_0x31d319[_0xcde6('0x35')]=_[_0xcde6('0x37')](_0x31d319[_0xcde6('0x32')],_0x31d319[_0xcde6('0x33')]);_0x1b259d[_0xcde6('0x36')]=_['intersection'](_0x31d319[_0xcde6('0x32')],qs[_0xcde6('0x38')](_0x6d77db[_0xcde6('0x33')]['fields']));_0x1b259d[_0xcde6('0x36')]=_0x1b259d[_0xcde6('0x36')]['length']?_0x1b259d[_0xcde6('0x36')]:_0x31d319[_0xcde6('0x32')];if(_0x6d77db[_0xcde6('0x33')][_0xcde6('0x45')]){_0x1b259d['include']=[{'all':!![]}];}_0x1b259d=_[_0xcde6('0x42')]({},_0x1b259d,_0x6d77db['options']);return db[_0xcde6('0x2d')][_0xcde6('0x4b')](_0x1b259d)[_0xcde6('0x28')](handleEntityNotFound(_0x390063,null))[_0xcde6('0x28')](respondWithResult(_0x390063,null))['catch'](handleError(_0x390063,null));};exports[_0xcde6('0x4c')]=function(_0x5138a5,_0xca9db9){return db[_0xcde6('0x2d')][_0xcde6('0x4c')](_0x5138a5['body'],{})['then'](respondWithResult(_0xca9db9,0xc9))[_0xcde6('0x4d')](handleError(_0xca9db9,null));};exports['update']=function(_0x5c52d2,_0xf7dfc9){if(_0x5c52d2[_0xcde6('0x4e')]['id']){delete _0x5c52d2['body']['id'];}return db[_0xcde6('0x2d')][_0xcde6('0x4b')]({'where':{'id':_0x5c52d2[_0xcde6('0x4a')]['id']}})[_0xcde6('0x28')](handleEntityNotFound(_0xf7dfc9,null))[_0xcde6('0x28')](saveUpdates(_0x5c52d2[_0xcde6('0x4e')],null))[_0xcde6('0x28')](respondWithResult(_0xf7dfc9,null))[_0xcde6('0x4d')](handleError(_0xf7dfc9,null));};exports[_0xcde6('0x27')]=function(_0x3617f0,_0x385fbd){return db[_0xcde6('0x2d')][_0xcde6('0x4b')]({'where':{'id':_0x3617f0[_0xcde6('0x4a')]['id']}})[_0xcde6('0x28')](handleEntityNotFound(_0x385fbd,null))['then'](removeEntity(_0x385fbd,null))['catch'](handleError(_0x385fbd,null));};exports[_0xcde6('0x4f')]=function(_0x29b117,_0xfc07be,_0x3a8e58){var _0x488ba7={};var _0x17f214={};var _0x42f596;var _0x3fd005;return db[_0xcde6('0x2d')]['findOne']({'where':{'id':_0x29b117[_0xcde6('0x4a')]['id']}})[_0xcde6('0x28')](handleEntityNotFound(_0xfc07be,null))[_0xcde6('0x28')](function(_0xf2a6b2){if(_0xf2a6b2){_0x42f596=_0xf2a6b2;_0x17f214['model']=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x17f214[_0xcde6('0x33')]=_[_0xcde6('0x34')](_0x29b117[_0xcde6('0x33')]);_0x17f214['filters']=_['intersection'](_0x17f214['model'],_0x17f214[_0xcde6('0x33')]);_0x488ba7['attributes']=_[_0xcde6('0x37')](_0x17f214[_0xcde6('0x32')],qs[_0xcde6('0x38')](_0x29b117[_0xcde6('0x33')][_0xcde6('0x38')]));_0x488ba7['attributes']=_0x488ba7[_0xcde6('0x36')]['length']?_0x488ba7[_0xcde6('0x36')]:_0x17f214['model'];_0x488ba7['order']=qs['sort'](_0x29b117[_0xcde6('0x33')][_0xcde6('0x3e')]);_0x488ba7[_0xcde6('0x41')]=qs[_0xcde6('0x35')](_['pick'](_0x29b117['query'],_0x17f214[_0xcde6('0x35')]));if(_0x29b117[_0xcde6('0x33')][_0xcde6('0x40')]){_0x488ba7[_0xcde6('0x41')]=_['merge'](_0x488ba7[_0xcde6('0x41')],{'$or':_[_0xcde6('0x2c')](_0x488ba7[_0xcde6('0x36')],function(_0x5c61a6){var _0x33c27c={};_0x33c27c[_0x5c61a6]={'$like':'%'+_0x29b117[_0xcde6('0x33')][_0xcde6('0x40')]+'%'};return _0x33c27c;})});}_0x488ba7=_[_0xcde6('0x42')]({},_0x488ba7,_0x29b117[_0xcde6('0x44')]);return _0x42f596[_0xcde6('0x4f')](_0x488ba7);}})[_0xcde6('0x28')](function(_0x3e97bf){if(_0x3e97bf){_0x3fd005=_0x3e97bf[_0xcde6('0x39')];if(!_0x29b117[_0xcde6('0x33')][_0xcde6('0x3a')](_0xcde6('0x3b'))){_0x488ba7['limit']=qs[_0xcde6('0x3c')](_0x29b117['query']['limit']);_0x488ba7[_0xcde6('0x1e')]=qs[_0xcde6('0x1e')](_0x29b117['query'][_0xcde6('0x1e')]);}return _0x42f596[_0xcde6('0x4f')](_0x488ba7);}})[_0xcde6('0x28')](function(_0x1d3215){if(_0x1d3215){return _0x1d3215?{'count':_0x3fd005,'rows':_0x1d3215}:null;}})['then'](respondWithResult(_0xfc07be,null))[_0xcde6('0x4d')](handleError(_0xfc07be,null));};exports[_0xcde6('0x50')]=function(_0x38153a,_0x1fa57e,_0x120079){if(_0x38153a[_0xcde6('0x4e')]['id']){delete _0x38153a[_0xcde6('0x4e')]['id'];}return db[_0xcde6('0x2d')]['findOne']({'where':{'id':_0x38153a['params']['id']}})[_0xcde6('0x28')](handleEntityNotFound(_0x1fa57e,null))[_0xcde6('0x28')](function(_0x1de225){if(_0x1de225){_0x38153a['body'][_0xcde6('0x51')]=_0x1de225['id'];_0x38153a[_0xcde6('0x4e')][_0xcde6('0x52')]=integrations[_0xcde6('0x53')](_0x38153a[_0xcde6('0x4e')][_0xcde6('0x54')],_0x38153a[_0xcde6('0x4e')][_0xcde6('0x30')]);_0x38153a[_0xcde6('0x4e')][_0xcde6('0x55')]=integrations[_0xcde6('0x56')](_0x38153a[_0xcde6('0x4e')][_0xcde6('0x54')],_0x38153a['body'][_0xcde6('0x30')]);return db[_0xcde6('0x57')][_0xcde6('0x4c')](_0x38153a[_0xcde6('0x4e')],{'include':[{'model':db[_0xcde6('0x58')],'as':_0xcde6('0x52')},{'model':db[_0xcde6('0x58')],'as':'Descriptions'}]});}return null;})[_0xcde6('0x28')](respondWithResult(_0x1fa57e,null))['catch'](handleError(_0x1fa57e,null));};exports[_0xcde6('0x59')]=function(_0x755c5b,_0x589bc8,_0x265813){var _0x3f6a57=_0x755c5b[_0xcde6('0x33')][_0xcde6('0x5a')];var _0x152696=_0x3f6a57===_0xcde6('0x5b')?_0xcde6('0x5c'):'PhoneCall';var _0x45c89b='';var _0x24890f='';var _0x2b31e7='';var _0x413512='';var _0x402269='';var _0x445415='';var _0x530f12='';var _0x4314cf='';var _0x4d6d2d=[_0xcde6('0x5d'),'description',_0xcde6('0x5e'),'ownerid','caseorigincode',_0xcde6('0x5f'),_0xcde6('0x60'),'regardingobjectid',_0xcde6('0x61'),_0xcde6('0x62')];var _0x62f90d=['accountidname','accountidyominame','actualserviceunits',_0xcde6('0x63'),_0xcde6('0x64'),_0xcde6('0x65'),'contractdetailidname',_0xcde6('0x66'),_0xcde6('0x67'),_0xcde6('0x68'),_0xcde6('0x69'),_0xcde6('0x6a'),_0xcde6('0x6b'),_0xcde6('0x6c'),_0xcde6('0x6d'),'customeridname',_0xcde6('0x6e'),_0xcde6('0x6f'),_0xcde6('0x70'),_0xcde6('0x71'),_0xcde6('0x72'),_0xcde6('0x73'),'escalatedon','exchangerate',_0xcde6('0x74'),_0xcde6('0x75'),'importsequencenumber',_0xcde6('0x76'),_0xcde6('0x77'),'lastonholdtime',_0xcde6('0x78'),_0xcde6('0x79'),_0xcde6('0x7a'),_0xcde6('0x7b'),_0xcde6('0x7c'),'modifiedon',_0xcde6('0x7d'),_0xcde6('0x7e'),_0xcde6('0x7f'),_0xcde6('0x80'),_0xcde6('0x81'),'onholdtime',_0xcde6('0x82'),_0xcde6('0x83'),_0xcde6('0x84'),_0xcde6('0x85'),_0xcde6('0x86'),_0xcde6('0x87'),_0xcde6('0x88'),'prioritycodename','productidname','productserialnumber',_0xcde6('0x89'),_0xcde6('0x8a'),_0xcde6('0x8b'),_0xcde6('0x8c'),_0xcde6('0x8d'),_0xcde6('0x8e'),'slainvokedidname',_0xcde6('0x8f'),_0xcde6('0x90'),_0xcde6('0x91'),'statuscode',_0xcde6('0x92'),_0xcde6('0x93'),_0xcde6('0x94'),_0xcde6('0x95'),'traversedpath','utcconversiontimezonecode',_0xcde6('0x96')];var _0xe8067e=_0x4d6d2d['concat'](_0x62f90d);return db[_0xcde6('0x2d')][_0xcde6('0x97')]({'where':{'id':_0x755c5b['params']['id']},'attributes':['id','username','password','remoteUri','tenantId',_0xcde6('0x98'),_0xcde6('0x99')]})[_0xcde6('0x28')](handleEntityNotFound(_0x589bc8,null))[_0xcde6('0x28')](function(_0xc17153){if(_0xc17153){_0x4314cf=_0xc17153[_0xcde6('0x9a')];var _0x1aa556=_0x4314cf[_0xcde6('0x9b')](-0x1);if(_0x1aa556==='/'){_0x4314cf=_0x4314cf['substring'](0x0,_0x4314cf[_0xcde6('0x9c')](_0x1aa556));}_0x530f12=util[_0xcde6('0x9d')](_0xcde6('0x9e'),_0x4314cf);var _0x22348a={'method':_0xcde6('0x9f'),'uri':_0xcde6('0xa0')+_0xc17153[_0xcde6('0xa1')]+_0xcde6('0xa2'),'form':{'client_id':_0xc17153[_0xcde6('0x98')],'resource':_0x4314cf,'username':_0xc17153[_0xcde6('0xa3')],'password':_0xc17153['password'],'grant_type':_0xcde6('0xa4'),'client_secret':_0xc17153['clientSecret']},'json':!![]};return rp(_0x22348a);}})[_0xcde6('0x28')](function(_0x48b385){_0x445415=_0x48b385[_0xcde6('0xa5')];var _0x56e96f={'method':'GET','uri':encodeURI(_0x530f12+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x152696+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x445415,'If-None-Match':null,'OData-Version':_0xcde6('0xa6')},'json':!![]};return rp(_0x56e96f);})['then'](function(_0x3ec074){var _0x163f7f=_0x3ec074[_0xcde6('0xa7')][0x0];var _0xddfb31=_0x163f7f[_0xcde6('0xa8')];var _0x217637={'method':_0xcde6('0xa9'),'uri':_0x530f12+_0xcde6('0xaa')+_0xddfb31+_0xcde6('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x445415,'If-None-Match':null,'OData-Version':_0xcde6('0xa6')},'json':!![]};return rp(_0x217637);})[_0xcde6('0x28')](function(_0x2c4359){_0x45c89b=_0x2c4359;_0x24890f=_0x45c89b[_0xcde6('0xac')];_0x24890f=_[_0xcde6('0xad')](_0x24890f,function(_0x20e55a){return!_0xe8067e[_0xcde6('0xae')](_0x20e55a['LogicalName']);});var _0x44cfed=[];var _0x2cb9c7=[];_0x24890f[_0xcde6('0xaf')](function(_0x284e4e){if(_0x284e4e[_0xcde6('0xb0')]){var _0xb4f250=_0x284e4e[_0xcde6('0xb0')][_0xcde6('0xb1')](_0x284e4e[_0xcde6('0xb0')]['lastIndexOf']('.')+0x1);if(_0xb4f250==='PicklistAttributeMetadata'){_0x44cfed[_0xcde6('0xb2')](getSelectList(_0x530f12,_0x3f6a57,_0x2cb9c7,_0x45c89b[_0xcde6('0xa8')],_0x284e4e[_0xcde6('0xa8')],_0x445415));}}});return Promise[_0xcde6('0xb3')](_0x44cfed);})['then'](function(_0xb1a56c){_0x2b31e7=_0xb1a56c[0x0];var _0x2cc0e4=[];var _0x935139=[];_0x24890f[_0xcde6('0xaf')](function(_0x43ba8d){if(!_[_0xcde6('0xb4')](_0x43ba8d[_0xcde6('0xb0')])){var _0x40385a=_0x43ba8d[_0xcde6('0xb0')][_0xcde6('0xb1')](_0x43ba8d[_0xcde6('0xb0')]['lastIndexOf']('.')+0x1);if(_0x40385a===_0xcde6('0xb5')){_0x2cc0e4['push'](getBooleanList(_0x530f12,_0x3f6a57,_0x935139,_0x45c89b[_0xcde6('0xa8')],_0x43ba8d[_0xcde6('0xa8')],_0x445415));}}});return Promise['all'](_0x2cc0e4);})['then'](function(_0x1867ac){_0x413512=_0x1867ac[0x0];var _0x2cb1e4=[];var _0x4b9e04=[];_0x24890f[_0xcde6('0xaf')](function(_0x30a25e){if(_0x30a25e[_0xcde6('0xb0')]){var _0x4bf438=_0x30a25e[_0xcde6('0xb0')][_0xcde6('0xb1')](_0x30a25e['@odata.type'][_0xcde6('0x9c')]('.')+0x1);if(_0x4bf438===_0xcde6('0xb6')||_0x4bf438===_0xcde6('0xb7')||_0x4bf438===_0xcde6('0xb8')||_0x4bf438==='IntegerAttributeMetadata'||_0x4bf438==='MemoAttributeMetadata'||_0x4bf438===_0xcde6('0xb9')||_0x4bf438===_0xcde6('0xba')||_0x4bf438==='EntityNameAttributeMetadata'||_0x4bf438===_0xcde6('0xbb')||_0x4bf438==='DecimalAttributeMetadata'){_0x2cb1e4['push'](getInputList(_0x530f12,_0x3f6a57,_0x4bf438,_0x4b9e04,_0x45c89b[_0xcde6('0xa8')],_0x30a25e[_0xcde6('0xa8')],_0x445415));}}});return Promise[_0xcde6('0xb3')](_0x2cb1e4);})[_0xcde6('0x28')](function(_0x1c7d33){_0x402269=_0x1c7d33[0x0];var _0x113d63=_0x2b31e7[_0xcde6('0xbc')](_0x413512)[_0xcde6('0xbc')](_0x402269);var _0x28401d={'count':_0x113d63[_0xcde6('0x39')],'rows':_0x113d63};return _0x28401d;})['then'](respondWithResult(_0x589bc8,null))[_0xcde6('0x4d')](function(_0x2995d4){var _0x1bfb0e=_0x755c5b[_0xcde6('0x33')][_0xcde6('0xbd')]?0x1f4:_0x2995d4[_0xcde6('0xbe')]||0x1f4;logger['error'](_0x2995d4[_0xcde6('0xbf')]);delete _0x2995d4['name'];if(_0x1bfb0e===0x191){_0x1bfb0e=0x190;}_0x589bc8[_0xcde6('0x1b')](_0x1bfb0e)[_0xcde6('0x2a')](_0x755c5b['query'][_0xcde6('0xbd')]?{'message':_0xcde6('0xc0'),'statusCode':_0x2995d4[_0xcde6('0xbe')]}:_0x2995d4);});};function getSelectList(_0x3850e7,_0x3ebf3b,_0x30e833,_0x1622ee,_0x195d00,_0x1c8bf5){var _0xd0711={'method':_0xcde6('0xa9'),'uri':_0x3850e7+'EntityDefinitions('+_0x1622ee+')/Attributes('+_0x195d00+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xcde6('0xc1'),'headers':{'Authorization':_0xcde6('0xc2')+_0x1c8bf5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xd0711)[_0xcde6('0x28')](function(_0x3f5fc9){var _0x113863=[];var _0x3baec1=_0x3f5fc9[_0xcde6('0xc3')][_0xcde6('0xc4')];_0x3baec1[_0xcde6('0xaf')](function(_0x2776b2){_0x113863[_0xcde6('0xb2')]({'name':_0x2776b2[_0xcde6('0xc5')][_0xcde6('0xc6')][_0xcde6('0xc5')],'value':String(_0x2776b2[_0xcde6('0xc7')])});});var _0x5a73b5={'id':_0x3ebf3b+'_'+_0x3f5fc9[_0xcde6('0xc8')],'name':_0x3f5fc9[_0xcde6('0xc9')][_0xcde6('0xc6')][_0xcde6('0xc5')],'custom':![],'options':_0x113863};_0x30e833['push'](_0x5a73b5);return _0x30e833;});}function getBooleanList(_0x4974e4,_0x272eb8,_0x387e90,_0x35756f,_0x4cfd01,_0x50f995){var _0x90d2b9={'method':'GET','uri':_0x4974e4+_0xcde6('0xaa')+_0x35756f+_0xcde6('0xca')+_0x4cfd01+_0xcde6('0xcb'),'headers':{'Authorization':'Bearer\x20'+_0x50f995,'If-None-Match':null,'OData-Version':_0xcde6('0xa6')},'json':!![]};return rp(_0x90d2b9)[_0xcde6('0x28')](function(_0x4b66ef){var _0x17608d=[];_0x17608d[_0xcde6('0xb2')]({'name':_0x4b66ef[_0xcde6('0xc3')][_0xcde6('0xcc')][_0xcde6('0xc5')][_0xcde6('0xc6')][_0xcde6('0xc5')],'value':_0xcde6('0xcd')},{'name':_0x4b66ef['OptionSet'][_0xcde6('0xce')]['Label'][_0xcde6('0xc6')]['Label'],'value':_0xcde6('0xcf')});var _0xda0216={'id':_0x272eb8+'_'+_0x4b66ef[_0xcde6('0xc8')],'name':_0x4b66ef[_0xcde6('0xc9')][_0xcde6('0xc6')][_0xcde6('0xc5')],'custom':![],'options':_0x17608d};_0x387e90[_0xcde6('0xb2')](_0xda0216);return _0x387e90;});}function getInputList(_0x41c06e,_0x364525,_0xae3385,_0x58cada,_0x5b0475,_0x3f7748,_0x327885){var _0x5c0c2f={'method':_0xcde6('0xa9'),'uri':_0x41c06e+_0xcde6('0xaa')+_0x5b0475+_0xcde6('0xca')+_0x3f7748+_0xcde6('0xd0')+_0xae3385+_0xcde6('0xd1'),'headers':{'Authorization':_0xcde6('0xc2')+_0x327885,'If-None-Match':null,'OData-Version':_0xcde6('0xa6')},'json':!![]};return rp(_0x5c0c2f)[_0xcde6('0x28')](function(_0x527f54){var _0x23b3ec={'id':_0x364525+'_'+_0x527f54[_0xcde6('0xc8')],'name':_0x527f54[_0xcde6('0xc9')][_0xcde6('0xc6')]?_0x527f54[_0xcde6('0xc9')][_0xcde6('0xc6')][_0xcde6('0xc5')]:_0x527f54[_0xcde6('0xc8')],'custom':![],'options':[]};_0x58cada[_0xcde6('0xb2')](_0x23b3ec);return _0x58cada;});}
\ No newline at end of file
+var _0xb4e6=['request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','end','sendStatus','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','length','includeAll','create','body','update','find','getConfigurations','Dynamics365Configuration','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','concat','username','password','remoteUri','tenantId','clientId','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','clientSecret','access_token','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','error','Wrong\x20credentials','statusCode','GET',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','UserLocalizedLabel','Label','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3fc24a,_0x536366){var _0x7ae99=function(_0x1ac199){while(--_0x1ac199){_0x3fc24a['push'](_0x3fc24a['shift']());}};_0x7ae99(++_0x536366);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xb4e6[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require(_0x6b4e('0x0'));var rimraf=require(_0x6b4e('0x1'));var zipdir=require(_0x6b4e('0x2'));var jsonpatch=require(_0x6b4e('0x3'));var rp=require(_0x6b4e('0x4'));var moment=require(_0x6b4e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b4e('0x6'));var util=require('util');var path=require(_0x6b4e('0x7'));var sox=require(_0x6b4e('0x8'));var csv=require(_0x6b4e('0x9'));var ejs=require(_0x6b4e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b4e('0xb'));var squel=require(_0x6b4e('0xc'));var crypto=require(_0x6b4e('0xd'));var jsforce=require(_0x6b4e('0xe'));var deskjs=require(_0x6b4e('0xf'));var toCsv=require(_0x6b4e('0x9'));var querystring=require(_0x6b4e('0x10'));var Papa=require(_0x6b4e('0x11'));var Redis=require(_0x6b4e('0x12'));var authService=require(_0x6b4e('0x13'));var qs=require(_0x6b4e('0x14'));var as=require(_0x6b4e('0x15'));var hardwareService=require(_0x6b4e('0x16'));var logger=require(_0x6b4e('0x17'))(_0x6b4e('0x18'));var utils=require(_0x6b4e('0x19'));var config=require(_0x6b4e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x6b4e('0x1b'));function respondWithStatusCode(_0x8659c,_0x2e0d65){_0x2e0d65=_0x2e0d65||0xcc;return function(_0xbff270){if(_0xbff270){return _0x8659c['sendStatus'](_0x2e0d65);}return _0x8659c['status'](_0x2e0d65)['end']();};}function respondWithResult(_0x54fd25,_0xd161a8){_0xd161a8=_0xd161a8||0xc8;return function(_0x2f68cf){if(_0x2f68cf){return _0x54fd25[_0x6b4e('0x1c')](_0xd161a8)[_0x6b4e('0x1d')](_0x2f68cf);}};}function respondWithFilteredResult(_0x2c26bd,_0x31fd30){return function(_0x5a48fb){if(_0x5a48fb){var _0x2da550=typeof _0x31fd30['offset']===_0x6b4e('0x1e')&&typeof _0x31fd30[_0x6b4e('0x1f')]===_0x6b4e('0x1e');var _0x4385f9=_0x5a48fb[_0x6b4e('0x20')];var _0x1cb884=_0x2da550?0x0:_0x31fd30[_0x6b4e('0x21')];var _0xaaef12=_0x2da550?_0x5a48fb[_0x6b4e('0x20')]:_0x31fd30[_0x6b4e('0x21')]+_0x31fd30['limit'];var _0x5269d3;if(_0xaaef12>=_0x4385f9){_0xaaef12=_0x4385f9;_0x5269d3=0xc8;}else{_0x5269d3=0xce;}_0x2c26bd[_0x6b4e('0x1c')](_0x5269d3);return _0x2c26bd[_0x6b4e('0x22')](_0x6b4e('0x23'),_0x1cb884+'-'+_0xaaef12+'/'+_0x4385f9)[_0x6b4e('0x1d')](_0x5a48fb);}return null;};}function patchUpdates(_0x48f1d8){return function(_0x27fa5b){try{jsonpatch[_0x6b4e('0x24')](_0x27fa5b,_0x48f1d8,!![]);}catch(_0x5ccedb){return BPromise[_0x6b4e('0x25')](_0x5ccedb);}return _0x27fa5b[_0x6b4e('0x26')]();};}function saveUpdates(_0x5be173,_0x2bebca){return function(_0x5d19dc){if(_0x5d19dc){return _0x5d19dc['update'](_0x5be173)[_0x6b4e('0x27')](function(_0xd29945){return _0xd29945;});}return null;};}function removeEntity(_0x346e1b,_0x1c1df9){return function(_0x5998a4){if(_0x5998a4){return _0x5998a4['destroy']()[_0x6b4e('0x27')](function(){_0x346e1b[_0x6b4e('0x1c')](0xcc)[_0x6b4e('0x28')]();});}};}function handleEntityNotFound(_0x51cfaa,_0x4d19b1){return function(_0x1b5959){if(!_0x1b5959){_0x51cfaa[_0x6b4e('0x29')](0x194);}return _0x1b5959;};}function handleError(_0x250759,_0x596fcb){_0x596fcb=_0x596fcb||0x1f4;return function(_0x58d278){logger['error'](_0x58d278[_0x6b4e('0x2a')]);if(_0x58d278[_0x6b4e('0x2b')]){delete _0x58d278[_0x6b4e('0x2b')];}_0x250759['status'](_0x596fcb)[_0x6b4e('0x2c')](_0x58d278);};}exports[_0x6b4e('0x2d')]=function(_0x105eb1,_0x4eebc1){var _0x5b34d4={},_0x374214={},_0x152d5b={'count':0x0,'rows':[]};var _0x47a9fd=_[_0x6b4e('0x2e')](db[_0x6b4e('0x2f')][_0x6b4e('0x30')],function(_0x29b971){return{'name':_0x29b971[_0x6b4e('0x31')],'type':_0x29b971[_0x6b4e('0x32')]['key']};});_0x374214[_0x6b4e('0x33')]=_[_0x6b4e('0x2e')](_0x47a9fd,_0x6b4e('0x2b'));_0x374214['query']=_['keys'](_0x105eb1[_0x6b4e('0x34')]);_0x374214[_0x6b4e('0x35')]=_[_0x6b4e('0x36')](_0x374214[_0x6b4e('0x33')],_0x374214[_0x6b4e('0x34')]);_0x5b34d4['attributes']=_[_0x6b4e('0x36')](_0x374214[_0x6b4e('0x33')],qs[_0x6b4e('0x37')](_0x105eb1[_0x6b4e('0x34')][_0x6b4e('0x37')]));_0x5b34d4[_0x6b4e('0x38')]=_0x5b34d4[_0x6b4e('0x38')]['length']?_0x5b34d4[_0x6b4e('0x38')]:_0x374214['model'];if(!_0x105eb1[_0x6b4e('0x34')][_0x6b4e('0x39')](_0x6b4e('0x3a'))){_0x5b34d4[_0x6b4e('0x1f')]=qs[_0x6b4e('0x1f')](_0x105eb1[_0x6b4e('0x34')]['limit']);_0x5b34d4[_0x6b4e('0x21')]=qs[_0x6b4e('0x21')](_0x105eb1[_0x6b4e('0x34')]['offset']);}_0x5b34d4['order']=qs[_0x6b4e('0x3b')](_0x105eb1[_0x6b4e('0x34')][_0x6b4e('0x3b')]);_0x5b34d4[_0x6b4e('0x3c')]=qs['filters'](_[_0x6b4e('0x3d')](_0x105eb1[_0x6b4e('0x34')],_0x374214[_0x6b4e('0x35')]),_0x47a9fd);if(_0x105eb1['query'][_0x6b4e('0x3e')]){_0x5b34d4[_0x6b4e('0x3c')]=_[_0x6b4e('0x3f')](_0x5b34d4[_0x6b4e('0x3c')],{'$or':_[_0x6b4e('0x2e')](_0x47a9fd,function(_0x1cb9c6){if(_0x1cb9c6[_0x6b4e('0x32')]!==_0x6b4e('0x40')){var _0x42e89a={};_0x42e89a[_0x1cb9c6[_0x6b4e('0x2b')]]={'$like':'%'+_0x105eb1['query'][_0x6b4e('0x3e')]+'%'};return _0x42e89a;}})});}_0x5b34d4=_['merge']({},_0x5b34d4,_0x105eb1[_0x6b4e('0x41')]);var _0x4541e1={'where':_0x5b34d4[_0x6b4e('0x3c')]};return db[_0x6b4e('0x2f')][_0x6b4e('0x20')](_0x4541e1)['then'](function(_0x14b850){_0x152d5b[_0x6b4e('0x20')]=_0x14b850;if(_0x105eb1[_0x6b4e('0x34')]['includeAll']){_0x5b34d4[_0x6b4e('0x42')]=[{'all':!![]}];}return db[_0x6b4e('0x2f')][_0x6b4e('0x43')](_0x5b34d4);})[_0x6b4e('0x27')](function(_0x1f77b0){_0x152d5b[_0x6b4e('0x44')]=_0x1f77b0;return _0x152d5b;})[_0x6b4e('0x27')](respondWithFilteredResult(_0x4eebc1,_0x5b34d4))[_0x6b4e('0x45')](handleError(_0x4eebc1,null));};exports[_0x6b4e('0x46')]=function(_0x4d3f72,_0x3f1c08){var _0xc58dff={'raw':![],'where':{'id':_0x4d3f72[_0x6b4e('0x47')]['id']}},_0x2e833e={};_0x2e833e['model']=_[_0x6b4e('0x48')](db[_0x6b4e('0x2f')][_0x6b4e('0x30')]);_0x2e833e[_0x6b4e('0x34')]=_[_0x6b4e('0x48')](_0x4d3f72[_0x6b4e('0x34')]);_0x2e833e[_0x6b4e('0x35')]=_[_0x6b4e('0x36')](_0x2e833e['model'],_0x2e833e[_0x6b4e('0x34')]);_0xc58dff[_0x6b4e('0x38')]=_[_0x6b4e('0x36')](_0x2e833e[_0x6b4e('0x33')],qs['fields'](_0x4d3f72['query'][_0x6b4e('0x37')]));_0xc58dff[_0x6b4e('0x38')]=_0xc58dff[_0x6b4e('0x38')][_0x6b4e('0x49')]?_0xc58dff[_0x6b4e('0x38')]:_0x2e833e[_0x6b4e('0x33')];if(_0x4d3f72['query'][_0x6b4e('0x4a')]){_0xc58dff[_0x6b4e('0x42')]=[{'all':!![]}];}_0xc58dff=_[_0x6b4e('0x3f')]({},_0xc58dff,_0x4d3f72[_0x6b4e('0x41')]);return db[_0x6b4e('0x2f')]['find'](_0xc58dff)[_0x6b4e('0x27')](handleEntityNotFound(_0x3f1c08,null))[_0x6b4e('0x27')](respondWithResult(_0x3f1c08,null))[_0x6b4e('0x45')](handleError(_0x3f1c08,null));};exports[_0x6b4e('0x4b')]=function(_0x5caff6,_0x3f82b1){return db['Dynamics365Account']['create'](_0x5caff6[_0x6b4e('0x4c')],{})[_0x6b4e('0x27')](respondWithResult(_0x3f82b1,0xc9))['catch'](handleError(_0x3f82b1,null));};exports[_0x6b4e('0x4d')]=function(_0x30b8b2,_0x50f831){if(_0x30b8b2[_0x6b4e('0x4c')]['id']){delete _0x30b8b2[_0x6b4e('0x4c')]['id'];}return db[_0x6b4e('0x2f')][_0x6b4e('0x4e')]({'where':{'id':_0x30b8b2[_0x6b4e('0x47')]['id']}})[_0x6b4e('0x27')](handleEntityNotFound(_0x50f831,null))['then'](saveUpdates(_0x30b8b2[_0x6b4e('0x4c')],null))['then'](respondWithResult(_0x50f831,null))['catch'](handleError(_0x50f831,null));};exports['destroy']=function(_0x483bd6,_0x54612a){return db[_0x6b4e('0x2f')][_0x6b4e('0x4e')]({'where':{'id':_0x483bd6[_0x6b4e('0x47')]['id']}})[_0x6b4e('0x27')](handleEntityNotFound(_0x54612a,null))['then'](removeEntity(_0x54612a,null))['catch'](handleError(_0x54612a,null));};exports[_0x6b4e('0x4f')]=function(_0x3a5df8,_0x4ec390,_0x19e323){var _0xddeafc={};var _0x2cefc5={};var _0x2737ed;var _0x58923c;return db[_0x6b4e('0x2f')]['findOne']({'where':{'id':_0x3a5df8[_0x6b4e('0x47')]['id']}})[_0x6b4e('0x27')](handleEntityNotFound(_0x4ec390,null))['then'](function(_0x473f77){if(_0x473f77){_0x2737ed=_0x473f77;_0x2cefc5[_0x6b4e('0x33')]=_['keys'](db[_0x6b4e('0x50')]['rawAttributes']);_0x2cefc5['query']=_[_0x6b4e('0x48')](_0x3a5df8[_0x6b4e('0x34')]);_0x2cefc5[_0x6b4e('0x35')]=_['intersection'](_0x2cefc5[_0x6b4e('0x33')],_0x2cefc5['query']);_0xddeafc['attributes']=_['intersection'](_0x2cefc5[_0x6b4e('0x33')],qs[_0x6b4e('0x37')](_0x3a5df8['query'][_0x6b4e('0x37')]));_0xddeafc['attributes']=_0xddeafc[_0x6b4e('0x38')][_0x6b4e('0x49')]?_0xddeafc['attributes']:_0x2cefc5[_0x6b4e('0x33')];_0xddeafc[_0x6b4e('0x51')]=qs[_0x6b4e('0x3b')](_0x3a5df8[_0x6b4e('0x34')][_0x6b4e('0x3b')]);_0xddeafc[_0x6b4e('0x3c')]=qs['filters'](_['pick'](_0x3a5df8[_0x6b4e('0x34')],_0x2cefc5[_0x6b4e('0x35')]));if(_0x3a5df8[_0x6b4e('0x34')][_0x6b4e('0x3e')]){_0xddeafc[_0x6b4e('0x3c')]=_['merge'](_0xddeafc[_0x6b4e('0x3c')],{'$or':_[_0x6b4e('0x2e')](_0xddeafc[_0x6b4e('0x38')],function(_0x4f78c1){var _0x25bd1a={};_0x25bd1a[_0x4f78c1]={'$like':'%'+_0x3a5df8[_0x6b4e('0x34')]['filter']+'%'};return _0x25bd1a;})});}_0xddeafc=_[_0x6b4e('0x3f')]({},_0xddeafc,_0x3a5df8[_0x6b4e('0x41')]);return _0x2737ed[_0x6b4e('0x4f')](_0xddeafc);}})[_0x6b4e('0x27')](function(_0x4e5ca9){if(_0x4e5ca9){_0x58923c=_0x4e5ca9['length'];if(!_0x3a5df8[_0x6b4e('0x34')][_0x6b4e('0x39')](_0x6b4e('0x3a'))){_0xddeafc[_0x6b4e('0x1f')]=qs[_0x6b4e('0x1f')](_0x3a5df8[_0x6b4e('0x34')][_0x6b4e('0x1f')]);_0xddeafc[_0x6b4e('0x21')]=qs[_0x6b4e('0x21')](_0x3a5df8['query']['offset']);}return _0x2737ed[_0x6b4e('0x4f')](_0xddeafc);}})[_0x6b4e('0x27')](function(_0x5c2f95){if(_0x5c2f95){return _0x5c2f95?{'count':_0x58923c,'rows':_0x5c2f95}:null;}})[_0x6b4e('0x27')](respondWithResult(_0x4ec390,null))[_0x6b4e('0x45')](handleError(_0x4ec390,null));};exports[_0x6b4e('0x52')]=function(_0x591101,_0x54dcb8,_0x81b442){if(_0x591101['body']['id']){delete _0x591101[_0x6b4e('0x4c')]['id'];}return db[_0x6b4e('0x2f')][_0x6b4e('0x53')]({'where':{'id':_0x591101[_0x6b4e('0x47')]['id']}})[_0x6b4e('0x27')](handleEntityNotFound(_0x54dcb8,null))[_0x6b4e('0x27')](function(_0x1a5646){if(_0x1a5646){_0x591101[_0x6b4e('0x4c')][_0x6b4e('0x54')]=_0x1a5646['id'];_0x591101['body'][_0x6b4e('0x55')]=integrations[_0x6b4e('0x56')](_0x591101[_0x6b4e('0x4c')]['channel'],_0x591101[_0x6b4e('0x4c')][_0x6b4e('0x32')]);_0x591101[_0x6b4e('0x4c')][_0x6b4e('0x57')]=integrations[_0x6b4e('0x58')](_0x591101[_0x6b4e('0x4c')][_0x6b4e('0x59')],_0x591101[_0x6b4e('0x4c')]['type']);return db['Dynamics365Configuration'][_0x6b4e('0x4b')](_0x591101[_0x6b4e('0x4c')],{'include':[{'model':db[_0x6b4e('0x5a')],'as':'Subjects'},{'model':db[_0x6b4e('0x5a')],'as':_0x6b4e('0x57')}]});}return null;})[_0x6b4e('0x27')](respondWithResult(_0x54dcb8,null))[_0x6b4e('0x45')](handleError(_0x54dcb8,null));};exports[_0x6b4e('0x5b')]=function(_0x4a69e7,_0x39a4e9,_0x8a57e7){var _0x8fbe2f=_0x4a69e7[_0x6b4e('0x34')][_0x6b4e('0x5c')];var _0x1114c1=_0x8fbe2f===_0x6b4e('0x5d')?_0x6b4e('0x5e'):_0x6b4e('0x5f');var _0x1b5e78='';var _0xd8207d='';var _0x585f22='';var _0x3c5ea5='';var _0x51e24f='';var _0x3e22a6='';var _0x1732c6='';var _0x460cdc='';var _0xb24785=[_0x6b4e('0x60'),'description','customerid',_0x6b4e('0x61'),_0x6b4e('0x62'),'subject',_0x6b4e('0x63'),_0x6b4e('0x64'),_0x6b4e('0x65'),_0x6b4e('0x66')];var _0x1b5bdc=[_0x6b4e('0x67'),_0x6b4e('0x68'),_0x6b4e('0x69'),_0x6b4e('0x6a'),_0x6b4e('0x6b'),_0x6b4e('0x6c'),_0x6b4e('0x6d'),'contractidname',_0x6b4e('0x6e'),_0x6b4e('0x6f'),_0x6b4e('0x70'),_0x6b4e('0x71'),_0x6b4e('0x72'),_0x6b4e('0x73'),_0x6b4e('0x74'),_0x6b4e('0x75'),'customeridtype',_0x6b4e('0x76'),_0x6b4e('0x77'),_0x6b4e('0x78'),_0x6b4e('0x79'),_0x6b4e('0x7a'),_0x6b4e('0x7b'),_0x6b4e('0x7c'),'firstresponsebykpiidname',_0x6b4e('0x7d'),_0x6b4e('0x7e'),_0x6b4e('0x7f'),_0x6b4e('0x80'),'lastonholdtime',_0x6b4e('0x81'),_0x6b4e('0x82'),'modifiedbyexternalpartyyominame',_0x6b4e('0x83'),_0x6b4e('0x84'),_0x6b4e('0x85'),_0x6b4e('0x86'),_0x6b4e('0x87'),_0x6b4e('0x88'),_0x6b4e('0x89'),_0x6b4e('0x8a'),'onholdtime','overriddencreatedon','owneridname',_0x6b4e('0x8b'),_0x6b4e('0x8c'),_0x6b4e('0x8d'),_0x6b4e('0x8e'),_0x6b4e('0x8f'),'prioritycodename',_0x6b4e('0x90'),_0x6b4e('0x91'),_0x6b4e('0x92'),'resolvebykpiidname','responseby','responsiblecontactidname',_0x6b4e('0x93'),_0x6b4e('0x94'),_0x6b4e('0x95'),_0x6b4e('0x96'),_0x6b4e('0x97'),_0x6b4e('0x98'),_0x6b4e('0x99'),_0x6b4e('0x9a'),_0x6b4e('0x9b'),_0x6b4e('0x9c'),_0x6b4e('0x9d'),'traversedpath','utcconversiontimezonecode',_0x6b4e('0x9e')];var _0x5ba632=_0xb24785[_0x6b4e('0x9f')](_0x1b5bdc);return db[_0x6b4e('0x2f')]['findOne']({'where':{'id':_0x4a69e7[_0x6b4e('0x47')]['id']},'attributes':['id',_0x6b4e('0xa0'),_0x6b4e('0xa1'),_0x6b4e('0xa2'),_0x6b4e('0xa3'),_0x6b4e('0xa4'),'clientSecret']})['then'](handleEntityNotFound(_0x39a4e9,null))['then'](function(_0x11a44a){if(_0x11a44a){_0x460cdc=_0x11a44a[_0x6b4e('0xa2')];var _0x3e2a73=_0x460cdc[_0x6b4e('0xa5')](-0x1);if(_0x3e2a73==='/'){_0x460cdc=_0x460cdc[_0x6b4e('0xa6')](0x0,_0x460cdc[_0x6b4e('0xa7')](_0x3e2a73));}_0x1732c6=util[_0x6b4e('0xa8')](_0x6b4e('0xa9'),_0x460cdc);var _0x14b5e0={'method':'POST','uri':_0x6b4e('0xaa')+_0x11a44a[_0x6b4e('0xa3')]+_0x6b4e('0xab'),'form':{'client_id':_0x11a44a['clientId'],'resource':_0x460cdc,'username':_0x11a44a[_0x6b4e('0xa0')],'password':_0x11a44a[_0x6b4e('0xa1')],'grant_type':_0x6b4e('0xa1'),'client_secret':_0x11a44a[_0x6b4e('0xac')]},'json':!![]};return rp(_0x14b5e0);}})[_0x6b4e('0x27')](function(_0x4db109){_0x3e22a6=_0x4db109[_0x6b4e('0xad')];var _0x4c6c73={'method':'GET','uri':encodeURI(_0x1732c6+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x1114c1+'\x27'),'headers':{'Authorization':_0x6b4e('0xae')+_0x3e22a6,'If-None-Match':null,'OData-Version':_0x6b4e('0xaf')},'json':!![]};return rp(_0x4c6c73);})[_0x6b4e('0x27')](function(_0x4c38d5){var _0x2f958b=_0x4c38d5[_0x6b4e('0xb0')][0x0];var _0x2afa26=_0x2f958b[_0x6b4e('0xb1')];var _0x4fd841={'method':'GET','uri':_0x1732c6+_0x6b4e('0xb2')+_0x2afa26+_0x6b4e('0xb3'),'headers':{'Authorization':_0x6b4e('0xae')+_0x3e22a6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4fd841);})[_0x6b4e('0x27')](function(_0x537e1f){_0x1b5e78=_0x537e1f;_0xd8207d=_0x1b5e78[_0x6b4e('0xb4')];_0xd8207d=_[_0x6b4e('0xb5')](_0xd8207d,function(_0x1599ad){return!_0x5ba632[_0x6b4e('0xb6')](_0x1599ad[_0x6b4e('0xb7')]);});var _0x1cea6e=[];var _0x2a5fcc=[];_0xd8207d[_0x6b4e('0xb8')](function(_0x379301){if(_0x379301[_0x6b4e('0xb9')]){var _0x1742ad=_0x379301[_0x6b4e('0xb9')]['substring'](_0x379301[_0x6b4e('0xb9')][_0x6b4e('0xa7')]('.')+0x1);if(_0x1742ad===_0x6b4e('0xba')){_0x1cea6e[_0x6b4e('0xbb')](getSelectList(_0x1732c6,_0x8fbe2f,_0x2a5fcc,_0x1b5e78[_0x6b4e('0xb1')],_0x379301[_0x6b4e('0xb1')],_0x3e22a6));}}});return Promise[_0x6b4e('0xbc')](_0x1cea6e);})[_0x6b4e('0x27')](function(_0x4a18b5){_0x585f22=_0x4a18b5[0x0];var _0x559cb5=[];var _0x3b8bbd=[];_0xd8207d[_0x6b4e('0xb8')](function(_0x7aaa6c){if(!_[_0x6b4e('0xbd')](_0x7aaa6c['@odata.type'])){var _0x316cf1=_0x7aaa6c[_0x6b4e('0xb9')]['substring'](_0x7aaa6c['@odata.type']['lastIndexOf']('.')+0x1);if(_0x316cf1==='BooleanAttributeMetadata'){_0x559cb5['push'](getBooleanList(_0x1732c6,_0x8fbe2f,_0x3b8bbd,_0x1b5e78[_0x6b4e('0xb1')],_0x7aaa6c[_0x6b4e('0xb1')],_0x3e22a6));}}});return Promise[_0x6b4e('0xbc')](_0x559cb5);})[_0x6b4e('0x27')](function(_0x7b1017){_0x3c5ea5=_0x7b1017[0x0];var _0x16d2f7=[];var _0x37c632=[];_0xd8207d['forEach'](function(_0x5e860c){if(_0x5e860c[_0x6b4e('0xb9')]){var _0x3356c6=_0x5e860c['@odata.type'][_0x6b4e('0xa6')](_0x5e860c[_0x6b4e('0xb9')][_0x6b4e('0xa7')]('.')+0x1);if(_0x3356c6===_0x6b4e('0xbe')||_0x3356c6===_0x6b4e('0xbf')||_0x3356c6===_0x6b4e('0xc0')||_0x3356c6===_0x6b4e('0xc1')||_0x3356c6===_0x6b4e('0xc2')||_0x3356c6===_0x6b4e('0xc3')||_0x3356c6===_0x6b4e('0xc4')||_0x3356c6===_0x6b4e('0xc5')||_0x3356c6===_0x6b4e('0xc6')||_0x3356c6===_0x6b4e('0xc7')){_0x16d2f7['push'](getInputList(_0x1732c6,_0x8fbe2f,_0x3356c6,_0x37c632,_0x1b5e78[_0x6b4e('0xb1')],_0x5e860c[_0x6b4e('0xb1')],_0x3e22a6));}}});return Promise[_0x6b4e('0xbc')](_0x16d2f7);})[_0x6b4e('0x27')](function(_0x3d142b){_0x51e24f=_0x3d142b[0x0];var _0x588457=_0x585f22[_0x6b4e('0x9f')](_0x3c5ea5)[_0x6b4e('0x9f')](_0x51e24f);var _0x8ae666={'count':_0x588457[_0x6b4e('0x49')],'rows':_0x588457};return _0x8ae666;})[_0x6b4e('0x27')](respondWithResult(_0x39a4e9,null))[_0x6b4e('0x45')](function(_0x310113){var _0x454c44=_0x4a69e7[_0x6b4e('0x34')][_0x6b4e('0xc8')]?0x1f4:_0x310113['statusCode']||0x1f4;logger[_0x6b4e('0xc9')](_0x310113[_0x6b4e('0x2a')]);delete _0x310113[_0x6b4e('0x2b')];if(_0x454c44===0x191){_0x454c44=0x190;}_0x39a4e9[_0x6b4e('0x1c')](_0x454c44)[_0x6b4e('0x2c')](_0x4a69e7['query'][_0x6b4e('0xc8')]?{'message':_0x6b4e('0xca'),'statusCode':_0x310113[_0x6b4e('0xcb')]}:_0x310113);});};function getSelectList(_0x1aa62a,_0x384042,_0x254976,_0x2e3b2f,_0x1a0d79,_0x578d00){var _0x4f5aae={'method':_0x6b4e('0xcc'),'uri':_0x1aa62a+_0x6b4e('0xb2')+_0x2e3b2f+_0x6b4e('0xcd')+_0x1a0d79+_0x6b4e('0xce')+_0x6b4e('0xcf'),'headers':{'Authorization':_0x6b4e('0xae')+_0x578d00,'If-None-Match':null,'OData-Version':_0x6b4e('0xaf')},'json':!![]};return rp(_0x4f5aae)['then'](function(_0x1005e3){var _0x548b7e=[];var _0x204fc3=_0x1005e3['OptionSet'][_0x6b4e('0xd0')];_0x204fc3['forEach'](function(_0x4cb182){_0x548b7e[_0x6b4e('0xbb')]({'name':_0x4cb182['Label'][_0x6b4e('0xd1')][_0x6b4e('0xd2')],'value':String(_0x4cb182[_0x6b4e('0xd3')])});});var _0x35c351={'id':_0x384042+'_'+_0x1005e3['LogicalName'],'name':_0x1005e3['DisplayName'][_0x6b4e('0xd1')][_0x6b4e('0xd2')],'custom':![],'options':_0x548b7e};_0x254976[_0x6b4e('0xbb')](_0x35c351);return _0x254976;});}function getBooleanList(_0x1d99f8,_0x546ca8,_0x158f6e,_0x38f83d,_0x9fddd8,_0x1649dd){var _0x8a705a={'method':'GET','uri':_0x1d99f8+_0x6b4e('0xb2')+_0x38f83d+_0x6b4e('0xcd')+_0x9fddd8+_0x6b4e('0xd4'),'headers':{'Authorization':_0x6b4e('0xae')+_0x1649dd,'If-None-Match':null,'OData-Version':_0x6b4e('0xaf')},'json':!![]};return rp(_0x8a705a)['then'](function(_0xe64a29){var _0x5310d5=[];_0x5310d5[_0x6b4e('0xbb')]({'name':_0xe64a29[_0x6b4e('0xd5')]['TrueOption'][_0x6b4e('0xd2')]['UserLocalizedLabel']['Label'],'value':_0x6b4e('0xd6')},{'name':_0xe64a29[_0x6b4e('0xd5')][_0x6b4e('0xd7')][_0x6b4e('0xd2')]['UserLocalizedLabel'][_0x6b4e('0xd2')],'value':_0x6b4e('0xd8')});var _0x514c27={'id':_0x546ca8+'_'+_0xe64a29[_0x6b4e('0xb7')],'name':_0xe64a29[_0x6b4e('0xd9')][_0x6b4e('0xd1')][_0x6b4e('0xd2')],'custom':![],'options':_0x5310d5};_0x158f6e[_0x6b4e('0xbb')](_0x514c27);return _0x158f6e;});}function getInputList(_0x3b1cfb,_0x30821d,_0x1c2552,_0x1e1629,_0x1b80fe,_0x4db4f0,_0x48d7e7){var _0x136f27={'method':_0x6b4e('0xcc'),'uri':_0x3b1cfb+_0x6b4e('0xb2')+_0x1b80fe+_0x6b4e('0xcd')+_0x4db4f0+_0x6b4e('0xda')+_0x1c2552+_0x6b4e('0xdb'),'headers':{'Authorization':_0x6b4e('0xae')+_0x48d7e7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x136f27)[_0x6b4e('0x27')](function(_0x5374a6){var _0xcce87d={'id':_0x30821d+'_'+_0x5374a6['LogicalName'],'name':_0x5374a6[_0x6b4e('0xd9')][_0x6b4e('0xd1')]?_0x5374a6[_0x6b4e('0xd9')]['UserLocalizedLabel'][_0x6b4e('0xd2')]:_0x5374a6['LogicalName'],'custom':![],'options':[]};_0x1e1629[_0x6b4e('0xbb')](_0xcce87d);return _0x1e1629;});}
\ No newline at end of file
index d6146bc..a2d99e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x2355e5,_0x5a347b){var _0x3c6238=function(_0x3ef55d){while(--_0x3ef55d){_0x2355e5['push'](_0x2355e5['shift']());}};_0x3c6238(++_0x5a347b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xb7e7[_0x5c9307];return _0x373e29;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1ee942,_0x2aa6cd){var _0x202e9d=function(_0x445da4){while(--_0x445da4){_0x1ee942['push'](_0x1ee942['shift']());}};_0x202e9d(++_0x2aa6cd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c1ab61..1ee235a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc3a=['client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','ShowDynamics365Account','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x5ad228,_0x432b1a){var _0x59228a=function(_0x270108){while(--_0x270108){_0x5ad228['push'](_0x5ad228['shift']());}};_0x59228a(++_0x432b1a);}(_0xbc3a,0xb4));var _0xabc3=function(_0x3fdac0,_0xfea589){_0x3fdac0=_0x3fdac0-0x0;var _0x4ca69b=_0xbc3a[_0x3fdac0];return _0x4ca69b;};'use strict';var _=require(_0xabc3('0x0'));var util=require(_0xabc3('0x1'));var moment=require(_0xabc3('0x2'));var BPromise=require(_0xabc3('0x3'));var rs=require(_0xabc3('0x4'));var fs=require('fs');var Redis=require(_0xabc3('0x5'));var db=require(_0xabc3('0x6'))['db'];var utils=require(_0xabc3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xabc3('0x8'));var jayson=require(_0xabc3('0x9'));var client=jayson[_0xabc3('0xa')][_0xabc3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a0fb8,_0x5e35d2,_0x3107d2){return new BPromise(function(_0x45169b,_0x409135){return client[_0xabc3('0xc')](_0x5a0fb8,_0x3107d2)[_0xabc3('0xd')](function(_0x1d1cdb){logger[_0xabc3('0xe')](_0xabc3('0xf'),_0x5e35d2,_0xabc3('0x10'));logger[_0xabc3('0x11')](_0xabc3('0x12'),_0x5e35d2,'request\x20sent',JSON[_0xabc3('0x13')](_0x1d1cdb));if(_0x1d1cdb['error']){if(_0x1d1cdb[_0xabc3('0x14')][_0xabc3('0x15')]===0x1f4){logger[_0xabc3('0x14')](_0xabc3('0xf'),_0x5e35d2,_0x1d1cdb[_0xabc3('0x14')][_0xabc3('0x16')]);return _0x409135(_0x1d1cdb[_0xabc3('0x14')][_0xabc3('0x16')]);}logger[_0xabc3('0x14')](_0xabc3('0xf'),_0x5e35d2,_0x1d1cdb[_0xabc3('0x14')]['message']);return _0x45169b(_0x1d1cdb[_0xabc3('0x14')][_0xabc3('0x16')]);}else{logger[_0xabc3('0xe')](_0xabc3('0xf'),_0x5e35d2,_0xabc3('0x10'));_0x45169b(_0x1d1cdb[_0xabc3('0x17')][_0xabc3('0x16')]);}})[_0xabc3('0x18')](function(_0x3ca2d1){logger[_0xabc3('0x14')](_0xabc3('0xf'),_0x5e35d2,_0x3ca2d1);_0x409135(_0x3ca2d1);});});}exports[_0xabc3('0x19')]=function(_0x498cc6){var _0x51ace4=this;return new Promise(function(_0x3ec4a4,_0x301e3b){return db[_0xabc3('0x1a')][_0xabc3('0x1b')]({'raw':_0x498cc6[_0xabc3('0x1c')]?_0x498cc6[_0xabc3('0x1c')][_0xabc3('0x1d')]===undefined?!![]:![]:!![],'where':_0x498cc6[_0xabc3('0x1c')]?_0x498cc6[_0xabc3('0x1c')]['where']||null:null,'attributes':_0x498cc6[_0xabc3('0x1c')]?_0x498cc6[_0xabc3('0x1c')][_0xabc3('0x1e')]||null:null,'limit':_0x498cc6['options']?_0x498cc6[_0xabc3('0x1c')][_0xabc3('0x1f')]||null:null,'include':_0x498cc6['options']?_0x498cc6[_0xabc3('0x1c')][_0xabc3('0x20')]?_[_0xabc3('0x21')](_0x498cc6[_0xabc3('0x1c')][_0xabc3('0x20')],function(_0x190232){return{'model':db[_0x190232[_0xabc3('0x22')]],'as':_0x190232['as'],'attributes':_0x190232[_0xabc3('0x1e')],'include':_0x190232[_0xabc3('0x20')]?_[_0xabc3('0x21')](_0x190232['include'],function(_0x42c6db){return{'model':db[_0x42c6db[_0xabc3('0x22')]],'as':_0x42c6db['as'],'attributes':_0x42c6db['attributes'],'include':_0x42c6db[_0xabc3('0x20')]?_[_0xabc3('0x21')](_0x42c6db[_0xabc3('0x20')],function(_0x415c5b){return{'model':db[_0x415c5b['model']],'as':_0x415c5b['as'],'attributes':_0x415c5b[_0xabc3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xabc3('0xd')](function(_0x24d0d3){logger[_0xabc3('0xe')]('GetDynamics365Account',_0x498cc6);logger[_0xabc3('0x11')]('GetDynamics365Account',_0x498cc6,JSON[_0xabc3('0x13')](_0x24d0d3));_0x3ec4a4(_0x24d0d3);})[_0xabc3('0x18')](function(_0x545247){logger[_0xabc3('0x14')](_0xabc3('0x19'),_0x545247['message'],_0x498cc6);_0x301e3b(_0x51ace4[_0xabc3('0x14')](0x1f4,_0x545247[_0xabc3('0x16')]));});});};exports[_0xabc3('0x23')]=function(_0x2e194a){var _0x2608e3=this;return new Promise(function(_0x6be895,_0x54a9d2){return db[_0xabc3('0x1a')][_0xabc3('0x24')]({'raw':_0x2e194a[_0xabc3('0x1c')]?_0x2e194a[_0xabc3('0x1c')][_0xabc3('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e194a['options']?_0x2e194a[_0xabc3('0x1c')][_0xabc3('0x25')]||null:null,'attributes':_0x2e194a[_0xabc3('0x1c')]?_0x2e194a[_0xabc3('0x1c')][_0xabc3('0x1e')]||null:null,'include':_0x2e194a[_0xabc3('0x1c')]?_0x2e194a[_0xabc3('0x1c')][_0xabc3('0x20')]?_['map'](_0x2e194a[_0xabc3('0x1c')][_0xabc3('0x20')],function(_0x4f14be){return{'model':db[_0x4f14be[_0xabc3('0x22')]],'as':_0x4f14be['as'],'attributes':_0x4f14be[_0xabc3('0x1e')],'include':_0x4f14be[_0xabc3('0x20')]?_[_0xabc3('0x21')](_0x4f14be[_0xabc3('0x20')],function(_0x1c972d){return{'model':db[_0x1c972d['model']],'as':_0x1c972d['as'],'attributes':_0x1c972d['attributes'],'include':_0x1c972d[_0xabc3('0x20')]?_['map'](_0x1c972d['include'],function(_0x3ee050){return{'model':db[_0x3ee050['model']],'as':_0x3ee050['as'],'attributes':_0x3ee050[_0xabc3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xabc3('0xd')](function(_0x2ff149){logger[_0xabc3('0xe')](_0xabc3('0x23'),_0x2e194a);logger[_0xabc3('0x11')](_0xabc3('0x23'),_0x2e194a,JSON['stringify'](_0x2ff149));_0x6be895(_0x2ff149);})[_0xabc3('0x18')](function(_0x473a3a){logger[_0xabc3('0x14')]('ShowDynamics365Account',_0x473a3a['message'],_0x2e194a);_0x54a9d2(_0x2608e3[_0xabc3('0x14')](0x1f4,_0x473a3a['message']));});});};
\ No newline at end of file
+var _0x4bba=['request\x20sent','error','code','message','result','GetDynamics365Account','Dynamics365Account','options','raw','attributes','include','map','model','debug','stringify','catch','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4bba,0x131));var _0xa4bb=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x4bba[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xa4bb('0x0'));var util=require(_0xa4bb('0x1'));var moment=require(_0xa4bb('0x2'));var BPromise=require(_0xa4bb('0x3'));var rs=require(_0xa4bb('0x4'));var fs=require('fs');var Redis=require(_0xa4bb('0x5'));var db=require(_0xa4bb('0x6'))['db'];var utils=require(_0xa4bb('0x7'));var logger=require('../../config/logger')(_0xa4bb('0x8'));var config=require(_0xa4bb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa4bb('0xa')][_0xa4bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2644f6,_0x34a002,_0x515bce){return new BPromise(function(_0x841e0c,_0x4a1a39){return client['request'](_0x2644f6,_0x515bce)[_0xa4bb('0xc')](function(_0x1e0ac3){logger[_0xa4bb('0xd')](_0xa4bb('0xe'),_0x34a002,_0xa4bb('0xf'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x34a002,'request\x20sent',JSON['stringify'](_0x1e0ac3));if(_0x1e0ac3['error']){if(_0x1e0ac3[_0xa4bb('0x10')][_0xa4bb('0x11')]===0x1f4){logger['error'](_0xa4bb('0xe'),_0x34a002,_0x1e0ac3[_0xa4bb('0x10')]['message']);return _0x4a1a39(_0x1e0ac3[_0xa4bb('0x10')]['message']);}logger['error'](_0xa4bb('0xe'),_0x34a002,_0x1e0ac3['error'][_0xa4bb('0x12')]);return _0x841e0c(_0x1e0ac3[_0xa4bb('0x10')][_0xa4bb('0x12')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x34a002,_0xa4bb('0xf'));_0x841e0c(_0x1e0ac3[_0xa4bb('0x13')][_0xa4bb('0x12')]);}})['catch'](function(_0x6a18d5){logger[_0xa4bb('0x10')](_0xa4bb('0xe'),_0x34a002,_0x6a18d5);_0x4a1a39(_0x6a18d5);});});}exports[_0xa4bb('0x14')]=function(_0x33eb24){var _0x3e1e07=this;return new Promise(function(_0x294353,_0x1e07d4){return db[_0xa4bb('0x15')]['findAll']({'raw':_0x33eb24[_0xa4bb('0x16')]?_0x33eb24[_0xa4bb('0x16')][_0xa4bb('0x17')]===undefined?!![]:![]:!![],'where':_0x33eb24[_0xa4bb('0x16')]?_0x33eb24[_0xa4bb('0x16')]['where']||null:null,'attributes':_0x33eb24[_0xa4bb('0x16')]?_0x33eb24[_0xa4bb('0x16')][_0xa4bb('0x18')]||null:null,'limit':_0x33eb24[_0xa4bb('0x16')]?_0x33eb24['options']['limit']||null:null,'include':_0x33eb24['options']?_0x33eb24[_0xa4bb('0x16')][_0xa4bb('0x19')]?_[_0xa4bb('0x1a')](_0x33eb24[_0xa4bb('0x16')]['include'],function(_0x21d890){return{'model':db[_0x21d890[_0xa4bb('0x1b')]],'as':_0x21d890['as'],'attributes':_0x21d890[_0xa4bb('0x18')],'include':_0x21d890['include']?_['map'](_0x21d890['include'],function(_0x179bed){return{'model':db[_0x179bed['model']],'as':_0x179bed['as'],'attributes':_0x179bed[_0xa4bb('0x18')],'include':_0x179bed[_0xa4bb('0x19')]?_[_0xa4bb('0x1a')](_0x179bed['include'],function(_0x4f82f8){return{'model':db[_0x4f82f8['model']],'as':_0x4f82f8['as'],'attributes':_0x4f82f8['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4bb('0xc')](function(_0x44875a){logger[_0xa4bb('0xd')](_0xa4bb('0x14'),_0x33eb24);logger[_0xa4bb('0x1c')](_0xa4bb('0x14'),_0x33eb24,JSON[_0xa4bb('0x1d')](_0x44875a));_0x294353(_0x44875a);})[_0xa4bb('0x1e')](function(_0x50095e){logger[_0xa4bb('0x10')](_0xa4bb('0x14'),_0x50095e[_0xa4bb('0x12')],_0x33eb24);_0x1e07d4(_0x3e1e07[_0xa4bb('0x10')](0x1f4,_0x50095e[_0xa4bb('0x12')]));});});};exports[_0xa4bb('0x1f')]=function(_0x3a3c5d){var _0x37ab27=this;return new Promise(function(_0x4b4335,_0x3aaff2){return db[_0xa4bb('0x15')]['find']({'raw':_0x3a3c5d[_0xa4bb('0x16')]?_0x3a3c5d[_0xa4bb('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3a3c5d[_0xa4bb('0x16')]?_0x3a3c5d['options']['where']||null:null,'attributes':_0x3a3c5d[_0xa4bb('0x16')]?_0x3a3c5d['options'][_0xa4bb('0x18')]||null:null,'include':_0x3a3c5d[_0xa4bb('0x16')]?_0x3a3c5d['options'][_0xa4bb('0x19')]?_[_0xa4bb('0x1a')](_0x3a3c5d[_0xa4bb('0x16')][_0xa4bb('0x19')],function(_0x4ef1ff){return{'model':db[_0x4ef1ff[_0xa4bb('0x1b')]],'as':_0x4ef1ff['as'],'attributes':_0x4ef1ff[_0xa4bb('0x18')],'include':_0x4ef1ff['include']?_[_0xa4bb('0x1a')](_0x4ef1ff[_0xa4bb('0x19')],function(_0xba489){return{'model':db[_0xba489[_0xa4bb('0x1b')]],'as':_0xba489['as'],'attributes':_0xba489[_0xa4bb('0x18')],'include':_0xba489['include']?_[_0xa4bb('0x1a')](_0xba489[_0xa4bb('0x19')],function(_0x4da089){return{'model':db[_0x4da089[_0xa4bb('0x1b')]],'as':_0x4da089['as'],'attributes':_0x4da089[_0xa4bb('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa4bb('0xc')](function(_0x3e6a48){logger[_0xa4bb('0xd')](_0xa4bb('0x1f'),_0x3a3c5d);logger[_0xa4bb('0x1c')](_0xa4bb('0x1f'),_0x3a3c5d,JSON[_0xa4bb('0x1d')](_0x3e6a48));_0x4b4335(_0x3e6a48);})[_0xa4bb('0x1e')](function(_0x29f71c){logger[_0xa4bb('0x10')]('ShowDynamics365Account',_0x29f71c['message'],_0x3a3c5d);_0x3aaff2(_0x37ab27[_0xa4bb('0x10')](0x1f4,_0x29f71c[_0xa4bb('0x12')]));});});};
\ No newline at end of file
index 4c46b3e..1c7b397 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeae7=['./intDynamics365Configuration.controller','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x110230,_0x9327b4){var _0xef860f=function(_0x146037){while(--_0x146037){_0x110230['push'](_0x110230['shift']());}};_0xef860f(++_0x9327b4);}(_0xeae7,0x1a1));var _0x7eae=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0xeae7[_0x15cbce];return _0x257f29;};'use strict';var multer=require('multer');var util=require(_0x7eae('0x0'));var path=require(_0x7eae('0x1'));var timeout=require(_0x7eae('0x2'));var express=require('express');var router=express[_0x7eae('0x3')]();var fs_extra=require(_0x7eae('0x4'));var auth=require(_0x7eae('0x5'));var interaction=require(_0x7eae('0x6'));var config=require(_0x7eae('0x7'));var controller=require(_0x7eae('0x8'));router[_0x7eae('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7eae('0x9')](_0x7eae('0xa'),auth['isAuthenticated'](),controller[_0x7eae('0xb')]);router['get'](_0x7eae('0xc'),auth[_0x7eae('0xd')](),controller[_0x7eae('0xe')]);router[_0x7eae('0x9')](_0x7eae('0xf'),auth[_0x7eae('0xd')](),controller[_0x7eae('0x10')]);router[_0x7eae('0x9')](_0x7eae('0x11'),auth[_0x7eae('0xd')](),controller[_0x7eae('0x12')]);router[_0x7eae('0x13')]('/',auth[_0x7eae('0xd')](),controller['create']);router[_0x7eae('0x14')](_0x7eae('0xa'),auth[_0x7eae('0xd')](),controller[_0x7eae('0x15')]);router[_0x7eae('0x16')](_0x7eae('0xa'),auth['isAuthenticated'](),controller[_0x7eae('0x17')]);module[_0x7eae('0x18')]=router;
\ No newline at end of file
+var _0x0c6b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x42ad31,_0x3a2a6e){var _0x2bf38c=function(_0x3179d6){while(--_0x3179d6){_0x42ad31['push'](_0x42ad31['shift']());}};_0x2bf38c(++_0x3a2a6e);}(_0x0c6b,0x1bc));var _0xb0c6=function(_0x1b3e68,_0x10767a){_0x1b3e68=_0x1b3e68-0x0;var _0x5ac195=_0x0c6b[_0x1b3e68];return _0x5ac195;};'use strict';var multer=require(_0xb0c6('0x0'));var util=require('util');var path=require(_0xb0c6('0x1'));var timeout=require(_0xb0c6('0x2'));var express=require(_0xb0c6('0x3'));var router=express[_0xb0c6('0x4')]();var fs_extra=require(_0xb0c6('0x5'));var auth=require(_0xb0c6('0x6'));var interaction=require(_0xb0c6('0x7'));var config=require(_0xb0c6('0x8'));var controller=require(_0xb0c6('0x9'));router[_0xb0c6('0xa')]('/',auth[_0xb0c6('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb0c6('0xc')]);router[_0xb0c6('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xb0c6('0xd')]);router[_0xb0c6('0xa')](_0xb0c6('0xe'),auth[_0xb0c6('0xb')](),controller[_0xb0c6('0xf')]);router[_0xb0c6('0xa')](_0xb0c6('0x10'),auth[_0xb0c6('0xb')](),controller['getDescriptions']);router[_0xb0c6('0x11')]('/',auth['isAuthenticated'](),controller[_0xb0c6('0x12')]);router[_0xb0c6('0x13')](_0xb0c6('0x14'),auth['isAuthenticated'](),controller[_0xb0c6('0x15')]);router[_0xb0c6('0x16')](_0xb0c6('0x14'),auth[_0xb0c6('0xb')](),controller[_0xb0c6('0x17')]);module[_0xb0c6('0x18')]=router;
\ No newline at end of file
index 24141d5..08fe6c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e01=['phonecall','sequelize','STRING','incident'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x0e01,0x18d));var _0x10e0=function(_0x2910e2,_0x388d98){_0x2910e2=_0x2910e2-0x0;var _0x52665b=_0x0e01[_0x2910e2];return _0x52665b;};'use strict';var Sequelize=require(_0x10e0('0x0'));module['exports']={'name':{'type':Sequelize[_0x10e0('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x10e0('0x2'),_0x10e0('0x3')),'defaultValue':_0x10e0('0x2')}};
\ No newline at end of file
+var _0x1287=['incident','phonecall','exports','STRING','ENUM'];(function(_0x5c3fd1,_0x29c515){var _0x3cd8ce=function(_0x2727d0){while(--_0x2727d0){_0x5c3fd1['push'](_0x5c3fd1['shift']());}};_0x3cd8ce(++_0x29c515);}(_0x1287,0x188));var _0x7128=function(_0x5ec840,_0x175254){_0x5ec840=_0x5ec840-0x0;var _0x9f6e66=_0x1287[_0x5ec840];return _0x9f6e66;};'use strict';var Sequelize=require('sequelize');module[_0x7128('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7128('0x1')]},'ticketType':{'type':Sequelize[_0x7128('0x2')](_0x7128('0x3'),_0x7128('0x4')),'defaultValue':_0x7128('0x3')}};
\ No newline at end of file
index 7085859..e6e9c0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63e6=['destroy','findOne','Dynamics365Field','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','sendStatus','error','name','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','Dynamics365Configuration','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find'];(function(_0x2679ce,_0x93ce38){var _0x1d01e0=function(_0x28efc2){while(--_0x28efc2){_0x2679ce['push'](_0x2679ce['shift']());}};_0x1d01e0(++_0x93ce38);}(_0x63e6,0x14b));var _0x663e=function(_0x292efd,_0x3d4fca){_0x292efd=_0x292efd-0x0;var _0x5c92ac=_0x63e6[_0x292efd];return _0x5c92ac;};'use strict';var emlformat=require(_0x663e('0x0'));var rimraf=require(_0x663e('0x1'));var zipdir=require(_0x663e('0x2'));var jsonpatch=require(_0x663e('0x3'));var rp=require(_0x663e('0x4'));var moment=require('moment');var BPromise=require(_0x663e('0x5'));var Mustache=require(_0x663e('0x6'));var util=require(_0x663e('0x7'));var path=require(_0x663e('0x8'));var sox=require(_0x663e('0x9'));var csv=require(_0x663e('0xa'));var ejs=require(_0x663e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x663e('0xc'));var squel=require(_0x663e('0xd'));var crypto=require(_0x663e('0xe'));var jsforce=require(_0x663e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x663e('0xa'));var querystring=require(_0x663e('0x10'));var Papa=require('papaparse');var Redis=require(_0x663e('0x11'));var authService=require(_0x663e('0x12'));var qs=require(_0x663e('0x13'));var as=require(_0x663e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x663e('0x15'));var utils=require(_0x663e('0x16'));var config=require(_0x663e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x663e('0x18'))['db'];function respondWithStatusCode(_0x4de1b7,_0xa2f7d6){_0xa2f7d6=_0xa2f7d6||0xcc;return function(_0x59c3b1){if(_0x59c3b1){return _0x4de1b7['sendStatus'](_0xa2f7d6);}return _0x4de1b7[_0x663e('0x19')](_0xa2f7d6)[_0x663e('0x1a')]();};}function respondWithResult(_0x559344,_0x560159){_0x560159=_0x560159||0xc8;return function(_0x119712){if(_0x119712){return _0x559344['status'](_0x560159)[_0x663e('0x1b')](_0x119712);}};}function respondWithFilteredResult(_0x2eb4a7,_0x17a861){return function(_0x10d657){if(_0x10d657){var _0x50510=typeof _0x17a861[_0x663e('0x1c')]===_0x663e('0x1d')&&typeof _0x17a861['limit']===_0x663e('0x1d');var _0x1eb78d=_0x10d657[_0x663e('0x1e')];var _0x44eb8e=_0x50510?0x0:_0x17a861[_0x663e('0x1c')];var _0x49eef9=_0x50510?_0x10d657[_0x663e('0x1e')]:_0x17a861[_0x663e('0x1c')]+_0x17a861['limit'];var _0x430170;if(_0x49eef9>=_0x1eb78d){_0x49eef9=_0x1eb78d;_0x430170=0xc8;}else{_0x430170=0xce;}_0x2eb4a7['status'](_0x430170);return _0x2eb4a7[_0x663e('0x1f')](_0x663e('0x20'),_0x44eb8e+'-'+_0x49eef9+'/'+_0x1eb78d)[_0x663e('0x1b')](_0x10d657);}return null;};}function patchUpdates(_0xc68ea0){return function(_0x1fb688){try{jsonpatch['apply'](_0x1fb688,_0xc68ea0,!![]);}catch(_0x42a392){return BPromise[_0x663e('0x21')](_0x42a392);}return _0x1fb688[_0x663e('0x22')]();};}function saveUpdates(_0x2a9ca0,_0x1953e9){return function(_0x44add3){if(_0x44add3){return _0x44add3[_0x663e('0x23')](_0x2a9ca0)[_0x663e('0x24')](function(_0x4d3342){return _0x4d3342;});}return null;};}function removeEntity(_0x4f634f,_0x494deb){return function(_0x40893d){if(_0x40893d){return _0x40893d['destroy']()[_0x663e('0x24')](function(){_0x4f634f[_0x663e('0x19')](0xcc)[_0x663e('0x1a')]();});}};}function handleEntityNotFound(_0x4723bc,_0x38478){return function(_0x1ffe1d){if(!_0x1ffe1d){_0x4723bc[_0x663e('0x25')](0x194);}return _0x1ffe1d;};}function handleError(_0x396092,_0x2e5d95){_0x2e5d95=_0x2e5d95||0x1f4;return function(_0x2b224d){logger[_0x663e('0x26')](_0x2b224d['stack']);if(_0x2b224d[_0x663e('0x27')]){delete _0x2b224d['name'];}_0x396092[_0x663e('0x19')](_0x2e5d95)['send'](_0x2b224d);};}exports['index']=function(_0x69b11,_0x147832){var _0x5ed076={},_0x2f330c={},_0x46a163={'count':0x0,'rows':[]};var _0x2d8aad=_[_0x663e('0x28')](db['Dynamics365Configuration']['rawAttributes'],function(_0x37d2ae){return{'name':_0x37d2ae[_0x663e('0x29')],'type':_0x37d2ae[_0x663e('0x2a')][_0x663e('0x2b')]};});_0x2f330c[_0x663e('0x2c')]=_['map'](_0x2d8aad,'name');_0x2f330c[_0x663e('0x2d')]=_[_0x663e('0x2e')](_0x69b11[_0x663e('0x2d')]);_0x2f330c[_0x663e('0x2f')]=_[_0x663e('0x30')](_0x2f330c[_0x663e('0x2c')],_0x2f330c[_0x663e('0x2d')]);_0x5ed076[_0x663e('0x31')]=_[_0x663e('0x30')](_0x2f330c[_0x663e('0x2c')],qs[_0x663e('0x32')](_0x69b11['query'][_0x663e('0x32')]));_0x5ed076[_0x663e('0x31')]=_0x5ed076[_0x663e('0x31')][_0x663e('0x33')]?_0x5ed076[_0x663e('0x31')]:_0x2f330c[_0x663e('0x2c')];if(!_0x69b11[_0x663e('0x2d')]['hasOwnProperty'](_0x663e('0x34'))){_0x5ed076[_0x663e('0x35')]=qs['limit'](_0x69b11[_0x663e('0x2d')][_0x663e('0x35')]);_0x5ed076['offset']=qs[_0x663e('0x1c')](_0x69b11[_0x663e('0x2d')]['offset']);}_0x5ed076[_0x663e('0x36')]=qs[_0x663e('0x37')](_0x69b11[_0x663e('0x2d')][_0x663e('0x37')]);_0x5ed076[_0x663e('0x38')]=qs[_0x663e('0x2f')](_[_0x663e('0x39')](_0x69b11[_0x663e('0x2d')],_0x2f330c[_0x663e('0x2f')]),_0x2d8aad);if(_0x69b11[_0x663e('0x2d')]['filter']){_0x5ed076['where']=_[_0x663e('0x3a')](_0x5ed076[_0x663e('0x38')],{'$or':_[_0x663e('0x28')](_0x2d8aad,function(_0x40b0f9){if(_0x40b0f9[_0x663e('0x2a')]!==_0x663e('0x3b')){var _0x42b012={};_0x42b012[_0x40b0f9[_0x663e('0x27')]]={'$like':'%'+_0x69b11[_0x663e('0x2d')][_0x663e('0x3c')]+'%'};return _0x42b012;}})});}_0x5ed076=_[_0x663e('0x3a')]({},_0x5ed076,_0x69b11[_0x663e('0x3d')]);var _0x33f143={'where':_0x5ed076[_0x663e('0x38')]};return db[_0x663e('0x3e')][_0x663e('0x1e')](_0x33f143)[_0x663e('0x24')](function(_0x37f704){_0x46a163[_0x663e('0x1e')]=_0x37f704;if(_0x69b11[_0x663e('0x2d')]['includeAll']){_0x5ed076[_0x663e('0x3f')]=[{'all':!![]}];}return db[_0x663e('0x3e')][_0x663e('0x40')](_0x5ed076);})[_0x663e('0x24')](function(_0x1c1767){_0x46a163[_0x663e('0x41')]=_0x1c1767;return _0x46a163;})['then'](respondWithFilteredResult(_0x147832,_0x5ed076))[_0x663e('0x42')](handleError(_0x147832,null));};exports[_0x663e('0x43')]=function(_0x5ecdeb,_0x213a65){var _0x4990d1={'raw':![],'where':{'id':_0x5ecdeb[_0x663e('0x44')]['id']}},_0x47db8c={};_0x47db8c[_0x663e('0x2c')]=_[_0x663e('0x2e')](db[_0x663e('0x3e')][_0x663e('0x45')]);_0x47db8c[_0x663e('0x2d')]=_[_0x663e('0x2e')](_0x5ecdeb[_0x663e('0x2d')]);_0x47db8c[_0x663e('0x2f')]=_['intersection'](_0x47db8c['model'],_0x47db8c[_0x663e('0x2d')]);_0x4990d1[_0x663e('0x31')]=_[_0x663e('0x30')](_0x47db8c['model'],qs[_0x663e('0x32')](_0x5ecdeb[_0x663e('0x2d')][_0x663e('0x32')]));_0x4990d1[_0x663e('0x31')]=_0x4990d1[_0x663e('0x31')][_0x663e('0x33')]?_0x4990d1['attributes']:_0x47db8c[_0x663e('0x2c')];if(_0x5ecdeb[_0x663e('0x2d')][_0x663e('0x46')]){_0x4990d1[_0x663e('0x3f')]=[{'all':!![]}];}_0x4990d1=_[_0x663e('0x3a')]({},_0x4990d1,_0x5ecdeb['options']);return db[_0x663e('0x3e')]['find'](_0x4990d1)['then'](handleEntityNotFound(_0x213a65,null))[_0x663e('0x24')](respondWithResult(_0x213a65,null))[_0x663e('0x42')](handleError(_0x213a65,null));};exports[_0x663e('0x47')]=function(_0x1c53da,_0x442f8d){return db['Dynamics365Configuration'][_0x663e('0x47')](_0x1c53da[_0x663e('0x48')],{})['then'](respondWithResult(_0x442f8d,0xc9))['catch'](handleError(_0x442f8d,null));};exports[_0x663e('0x23')]=function(_0x3fc381,_0x2260e3){if(_0x3fc381[_0x663e('0x48')]['id']){delete _0x3fc381[_0x663e('0x48')]['id'];}return db[_0x663e('0x3e')][_0x663e('0x49')]({'where':{'id':_0x3fc381[_0x663e('0x44')]['id']}})[_0x663e('0x24')](handleEntityNotFound(_0x2260e3,null))[_0x663e('0x24')](saveUpdates(_0x3fc381[_0x663e('0x48')],null))[_0x663e('0x24')](respondWithResult(_0x2260e3,null))[_0x663e('0x42')](handleError(_0x2260e3,null));};exports[_0x663e('0x4a')]=function(_0x3d1170,_0x2f63d8){return db[_0x663e('0x3e')][_0x663e('0x49')]({'where':{'id':_0x3d1170[_0x663e('0x44')]['id']}})[_0x663e('0x24')](handleEntityNotFound(_0x2f63d8,null))[_0x663e('0x24')](removeEntity(_0x2f63d8,null))[_0x663e('0x42')](handleError(_0x2f63d8,null));};exports['getFields']=function(_0x2380df,_0x555094,_0x4db3f9){var _0x1ad707={};var _0x1ea400={};var _0x473187;var _0x20e1d1;return db[_0x663e('0x3e')][_0x663e('0x4b')]({'where':{'id':_0x2380df[_0x663e('0x44')]['id']}})[_0x663e('0x24')](handleEntityNotFound(_0x555094,null))[_0x663e('0x24')](function(_0x2783fd){if(_0x2783fd){_0x473187=_0x2783fd;_0x1ea400[_0x663e('0x2c')]=_[_0x663e('0x2e')](db[_0x663e('0x4c')]['rawAttributes']);_0x1ea400['query']=_[_0x663e('0x2e')](_0x2380df[_0x663e('0x2d')]);_0x1ea400[_0x663e('0x2f')]=_['intersection'](_0x1ea400['model'],_0x1ea400[_0x663e('0x2d')]);_0x1ad707[_0x663e('0x31')]=_['intersection'](_0x1ea400['model'],qs[_0x663e('0x32')](_0x2380df[_0x663e('0x2d')][_0x663e('0x32')]));_0x1ad707[_0x663e('0x31')]=_0x1ad707[_0x663e('0x31')][_0x663e('0x33')]?_0x1ad707[_0x663e('0x31')]:_0x1ea400[_0x663e('0x2c')];_0x1ad707['order']=qs[_0x663e('0x37')](_0x2380df['query'][_0x663e('0x37')]);_0x1ad707[_0x663e('0x38')]=qs['filters'](_['pick'](_0x2380df['query'],_0x1ea400[_0x663e('0x2f')]));if(_0x2380df['query'][_0x663e('0x3c')]){_0x1ad707[_0x663e('0x38')]=_[_0x663e('0x3a')](_0x1ad707[_0x663e('0x38')],{'$or':_[_0x663e('0x28')](_0x1ad707[_0x663e('0x31')],function(_0x3789ee){var _0x399bb9={};_0x399bb9[_0x3789ee]={'$like':'%'+_0x2380df['query']['filter']+'%'};return _0x399bb9;})});}_0x1ad707=_[_0x663e('0x3a')]({},_0x1ad707,_0x2380df['options']);return _0x473187[_0x663e('0x4d')](_0x1ad707);}})[_0x663e('0x24')](function(_0x355950){if(_0x355950){_0x20e1d1=_0x355950['length'];if(!_0x2380df[_0x663e('0x2d')][_0x663e('0x4e')](_0x663e('0x34'))){_0x1ad707[_0x663e('0x35')]=qs['limit'](_0x2380df[_0x663e('0x2d')][_0x663e('0x35')]);_0x1ad707[_0x663e('0x1c')]=qs['offset'](_0x2380df[_0x663e('0x2d')]['offset']);}return _0x473187[_0x663e('0x4d')](_0x1ad707);}})[_0x663e('0x24')](function(_0x456937){if(_0x456937){return _0x456937?{'count':_0x20e1d1,'rows':_0x456937}:null;}})[_0x663e('0x24')](respondWithResult(_0x555094,null))[_0x663e('0x42')](handleError(_0x555094,null));};exports[_0x663e('0x4f')]=function(_0x3aae30,_0x9d824,_0x319532){var _0x5f1f69={};var _0x3de54d={};var _0x4e9e8e;var _0x1a8cd8;return db[_0x663e('0x3e')][_0x663e('0x4b')]({'where':{'id':_0x3aae30[_0x663e('0x44')]['id']}})[_0x663e('0x24')](handleEntityNotFound(_0x9d824,null))[_0x663e('0x24')](function(_0x4f1144){if(_0x4f1144){_0x4e9e8e=_0x4f1144;_0x3de54d['model']=_[_0x663e('0x2e')](db[_0x663e('0x4c')][_0x663e('0x45')]);_0x3de54d['query']=_[_0x663e('0x2e')](_0x3aae30[_0x663e('0x2d')]);_0x3de54d[_0x663e('0x2f')]=_['intersection'](_0x3de54d['model'],_0x3de54d[_0x663e('0x2d')]);_0x5f1f69[_0x663e('0x31')]=_['intersection'](_0x3de54d['model'],qs[_0x663e('0x32')](_0x3aae30[_0x663e('0x2d')][_0x663e('0x32')]));_0x5f1f69['attributes']=_0x5f1f69[_0x663e('0x31')]['length']?_0x5f1f69[_0x663e('0x31')]:_0x3de54d[_0x663e('0x2c')];_0x5f1f69['order']=qs[_0x663e('0x37')](_0x3aae30['query']['sort']);_0x5f1f69[_0x663e('0x38')]=qs[_0x663e('0x2f')](_[_0x663e('0x39')](_0x3aae30[_0x663e('0x2d')],_0x3de54d[_0x663e('0x2f')]));if(_0x3aae30['query'][_0x663e('0x3c')]){_0x5f1f69[_0x663e('0x38')]=_[_0x663e('0x3a')](_0x5f1f69[_0x663e('0x38')],{'$or':_[_0x663e('0x28')](_0x5f1f69[_0x663e('0x31')],function(_0x37105a){var _0xf98138={};_0xf98138[_0x37105a]={'$like':'%'+_0x3aae30[_0x663e('0x2d')][_0x663e('0x3c')]+'%'};return _0xf98138;})});}_0x5f1f69=_['merge']({},_0x5f1f69,_0x3aae30[_0x663e('0x3d')]);return _0x4e9e8e['getSubjects'](_0x5f1f69);}})[_0x663e('0x24')](function(_0x6ed380){if(_0x6ed380){_0x1a8cd8=_0x6ed380[_0x663e('0x33')];if(!_0x3aae30[_0x663e('0x2d')][_0x663e('0x4e')](_0x663e('0x34'))){_0x5f1f69['limit']=qs[_0x663e('0x35')](_0x3aae30[_0x663e('0x2d')][_0x663e('0x35')]);_0x5f1f69[_0x663e('0x1c')]=qs[_0x663e('0x1c')](_0x3aae30[_0x663e('0x2d')]['offset']);}return _0x4e9e8e[_0x663e('0x4f')](_0x5f1f69);}})[_0x663e('0x24')](function(_0x7fd24c){if(_0x7fd24c){return _0x7fd24c?{'count':_0x1a8cd8,'rows':_0x7fd24c}:null;}})[_0x663e('0x24')](respondWithResult(_0x9d824,null))[_0x663e('0x42')](handleError(_0x9d824,null));};exports[_0x663e('0x50')]=function(_0x27eb27,_0x42c67f,_0x5cb825){var _0xc111fe={};var _0x2d0ba7={};var _0x49553e;var _0x19404f;return db['Dynamics365Configuration'][_0x663e('0x4b')]({'where':{'id':_0x27eb27[_0x663e('0x44')]['id']}})[_0x663e('0x24')](handleEntityNotFound(_0x42c67f,null))[_0x663e('0x24')](function(_0x2ed49b){if(_0x2ed49b){_0x49553e=_0x2ed49b;_0x2d0ba7[_0x663e('0x2c')]=_['keys'](db[_0x663e('0x4c')]['rawAttributes']);_0x2d0ba7['query']=_[_0x663e('0x2e')](_0x27eb27[_0x663e('0x2d')]);_0x2d0ba7[_0x663e('0x2f')]=_[_0x663e('0x30')](_0x2d0ba7[_0x663e('0x2c')],_0x2d0ba7['query']);_0xc111fe[_0x663e('0x31')]=_[_0x663e('0x30')](_0x2d0ba7[_0x663e('0x2c')],qs['fields'](_0x27eb27[_0x663e('0x2d')][_0x663e('0x32')]));_0xc111fe[_0x663e('0x31')]=_0xc111fe[_0x663e('0x31')][_0x663e('0x33')]?_0xc111fe['attributes']:_0x2d0ba7[_0x663e('0x2c')];_0xc111fe[_0x663e('0x36')]=qs[_0x663e('0x37')](_0x27eb27[_0x663e('0x2d')][_0x663e('0x37')]);_0xc111fe[_0x663e('0x38')]=qs[_0x663e('0x2f')](_[_0x663e('0x39')](_0x27eb27[_0x663e('0x2d')],_0x2d0ba7[_0x663e('0x2f')]));if(_0x27eb27[_0x663e('0x2d')][_0x663e('0x3c')]){_0xc111fe[_0x663e('0x38')]=_['merge'](_0xc111fe[_0x663e('0x38')],{'$or':_['map'](_0xc111fe[_0x663e('0x31')],function(_0x3db5b1){var _0x2ec762={};_0x2ec762[_0x3db5b1]={'$like':'%'+_0x27eb27[_0x663e('0x2d')][_0x663e('0x3c')]+'%'};return _0x2ec762;})});}_0xc111fe=_[_0x663e('0x3a')]({},_0xc111fe,_0x27eb27[_0x663e('0x3d')]);return _0x49553e[_0x663e('0x50')](_0xc111fe);}})['then'](function(_0x49cce5){if(_0x49cce5){_0x19404f=_0x49cce5[_0x663e('0x33')];if(!_0x27eb27[_0x663e('0x2d')][_0x663e('0x4e')](_0x663e('0x34'))){_0xc111fe[_0x663e('0x35')]=qs['limit'](_0x27eb27[_0x663e('0x2d')][_0x663e('0x35')]);_0xc111fe[_0x663e('0x1c')]=qs['offset'](_0x27eb27[_0x663e('0x2d')][_0x663e('0x1c')]);}return _0x49553e['getDescriptions'](_0xc111fe);}})[_0x663e('0x24')](function(_0x577c70){if(_0x577c70){return _0x577c70?{'count':_0x19404f,'rows':_0x577c70}:null;}})[_0x663e('0x24')](respondWithResult(_0x42c67f,null))['catch'](handleError(_0x42c67f,null));};
\ No newline at end of file
+var _0xb107=['fast-json-patch','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Configuration','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','zip-dir'];(function(_0x1ae163,_0x2e50a5){var _0x277afe=function(_0x5a31ca){while(--_0x5a31ca){_0x1ae163['push'](_0x1ae163['shift']());}};_0x277afe(++_0x2e50a5);}(_0xb107,0x184));var _0x7b10=function(_0x265fdc,_0x21ac9a){_0x265fdc=_0x265fdc-0x0;var _0xfd16ad=_0xb107[_0x265fdc];return _0xfd16ad;};'use strict';var emlformat=require(_0x7b10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b10('0x1'));var jsonpatch=require(_0x7b10('0x2'));var rp=require('request-promise');var moment=require(_0x7b10('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7b10('0x4'));var path=require(_0x7b10('0x5'));var sox=require('sox');var csv=require(_0x7b10('0x6'));var ejs=require(_0x7b10('0x7'));var fs=require('fs');var fs_extra=require(_0x7b10('0x8'));var _=require(_0x7b10('0x9'));var squel=require(_0x7b10('0xa'));var crypto=require(_0x7b10('0xb'));var jsforce=require(_0x7b10('0xc'));var deskjs=require(_0x7b10('0xd'));var toCsv=require(_0x7b10('0x6'));var querystring=require('querystring');var Papa=require(_0x7b10('0xe'));var Redis=require('ioredis');var authService=require(_0x7b10('0xf'));var qs=require(_0x7b10('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b10('0x11'));var logger=require('../../config/logger')(_0x7b10('0x12'));var utils=require(_0x7b10('0x13'));var config=require(_0x7b10('0x14'));var licenseUtil=require(_0x7b10('0x15'));var db=require(_0x7b10('0x16'))['db'];function respondWithStatusCode(_0x4b1a41,_0x1f3425){_0x1f3425=_0x1f3425||0xcc;return function(_0x2a49e9){if(_0x2a49e9){return _0x4b1a41[_0x7b10('0x17')](_0x1f3425);}return _0x4b1a41['status'](_0x1f3425)[_0x7b10('0x18')]();};}function respondWithResult(_0x12a525,_0x13c7e9){_0x13c7e9=_0x13c7e9||0xc8;return function(_0x461210){if(_0x461210){return _0x12a525['status'](_0x13c7e9)[_0x7b10('0x19')](_0x461210);}};}function respondWithFilteredResult(_0xcd49e1,_0x2443be){return function(_0x34093a){if(_0x34093a){var _0x12255d=typeof _0x2443be[_0x7b10('0x1a')]===_0x7b10('0x1b')&&typeof _0x2443be[_0x7b10('0x1c')]==='undefined';var _0x1e242c=_0x34093a['count'];var _0x184d63=_0x12255d?0x0:_0x2443be[_0x7b10('0x1a')];var _0xe2076f=_0x12255d?_0x34093a[_0x7b10('0x1d')]:_0x2443be['offset']+_0x2443be['limit'];var _0x1df882;if(_0xe2076f>=_0x1e242c){_0xe2076f=_0x1e242c;_0x1df882=0xc8;}else{_0x1df882=0xce;}_0xcd49e1[_0x7b10('0x1e')](_0x1df882);return _0xcd49e1['set']('Content-Range',_0x184d63+'-'+_0xe2076f+'/'+_0x1e242c)[_0x7b10('0x19')](_0x34093a);}return null;};}function patchUpdates(_0xb5c62){return function(_0x253e4b){try{jsonpatch[_0x7b10('0x1f')](_0x253e4b,_0xb5c62,!![]);}catch(_0x3e7ed1){return BPromise[_0x7b10('0x20')](_0x3e7ed1);}return _0x253e4b[_0x7b10('0x21')]();};}function saveUpdates(_0x51ff77,_0x49f055){return function(_0x39ca3b){if(_0x39ca3b){return _0x39ca3b[_0x7b10('0x22')](_0x51ff77)[_0x7b10('0x23')](function(_0x4db44b){return _0x4db44b;});}return null;};}function removeEntity(_0x49820b,_0x21a1b1){return function(_0x43996e){if(_0x43996e){return _0x43996e[_0x7b10('0x24')]()[_0x7b10('0x23')](function(){_0x49820b['status'](0xcc)[_0x7b10('0x18')]();});}};}function handleEntityNotFound(_0x3bdb54,_0x2a7447){return function(_0x1bef04){if(!_0x1bef04){_0x3bdb54[_0x7b10('0x17')](0x194);}return _0x1bef04;};}function handleError(_0x53eae5,_0x108743){_0x108743=_0x108743||0x1f4;return function(_0x149585){logger[_0x7b10('0x25')](_0x149585['stack']);if(_0x149585[_0x7b10('0x26')]){delete _0x149585[_0x7b10('0x26')];}_0x53eae5[_0x7b10('0x1e')](_0x108743)[_0x7b10('0x27')](_0x149585);};}exports[_0x7b10('0x28')]=function(_0x29a461,_0x4c5566){var _0x2edccc={},_0x20f932={},_0x9fff67={'count':0x0,'rows':[]};var _0x1b89d0=_[_0x7b10('0x29')](db[_0x7b10('0x2a')]['rawAttributes'],function(_0x47a852){return{'name':_0x47a852[_0x7b10('0x2b')],'type':_0x47a852[_0x7b10('0x2c')][_0x7b10('0x2d')]};});_0x20f932['model']=_[_0x7b10('0x29')](_0x1b89d0,_0x7b10('0x26'));_0x20f932[_0x7b10('0x2e')]=_[_0x7b10('0x2f')](_0x29a461[_0x7b10('0x2e')]);_0x20f932[_0x7b10('0x30')]=_[_0x7b10('0x31')](_0x20f932[_0x7b10('0x32')],_0x20f932['query']);_0x2edccc['attributes']=_[_0x7b10('0x31')](_0x20f932[_0x7b10('0x32')],qs['fields'](_0x29a461[_0x7b10('0x2e')][_0x7b10('0x33')]));_0x2edccc[_0x7b10('0x34')]=_0x2edccc['attributes'][_0x7b10('0x35')]?_0x2edccc['attributes']:_0x20f932[_0x7b10('0x32')];if(!_0x29a461[_0x7b10('0x2e')][_0x7b10('0x36')](_0x7b10('0x37'))){_0x2edccc['limit']=qs[_0x7b10('0x1c')](_0x29a461[_0x7b10('0x2e')]['limit']);_0x2edccc[_0x7b10('0x1a')]=qs['offset'](_0x29a461[_0x7b10('0x2e')][_0x7b10('0x1a')]);}_0x2edccc[_0x7b10('0x38')]=qs[_0x7b10('0x39')](_0x29a461[_0x7b10('0x2e')][_0x7b10('0x39')]);_0x2edccc['where']=qs[_0x7b10('0x30')](_[_0x7b10('0x3a')](_0x29a461[_0x7b10('0x2e')],_0x20f932['filters']),_0x1b89d0);if(_0x29a461[_0x7b10('0x2e')][_0x7b10('0x3b')]){_0x2edccc[_0x7b10('0x3c')]=_[_0x7b10('0x3d')](_0x2edccc[_0x7b10('0x3c')],{'$or':_[_0x7b10('0x29')](_0x1b89d0,function(_0x2a1d9a){if(_0x2a1d9a[_0x7b10('0x2c')]!==_0x7b10('0x3e')){var _0x36a70d={};_0x36a70d[_0x2a1d9a[_0x7b10('0x26')]]={'$like':'%'+_0x29a461['query'][_0x7b10('0x3b')]+'%'};return _0x36a70d;}})});}_0x2edccc=_[_0x7b10('0x3d')]({},_0x2edccc,_0x29a461[_0x7b10('0x3f')]);var _0x375f7e={'where':_0x2edccc[_0x7b10('0x3c')]};return db[_0x7b10('0x2a')][_0x7b10('0x1d')](_0x375f7e)[_0x7b10('0x23')](function(_0x354543){_0x9fff67[_0x7b10('0x1d')]=_0x354543;if(_0x29a461[_0x7b10('0x2e')][_0x7b10('0x40')]){_0x2edccc[_0x7b10('0x41')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x7b10('0x42')](_0x2edccc);})[_0x7b10('0x23')](function(_0x3f021b){_0x9fff67[_0x7b10('0x43')]=_0x3f021b;return _0x9fff67;})[_0x7b10('0x23')](respondWithFilteredResult(_0x4c5566,_0x2edccc))[_0x7b10('0x44')](handleError(_0x4c5566,null));};exports['show']=function(_0x50a410,_0x231478){var _0x5d1056={'raw':![],'where':{'id':_0x50a410[_0x7b10('0x45')]['id']}},_0x271641={};_0x271641[_0x7b10('0x32')]=_[_0x7b10('0x2f')](db[_0x7b10('0x2a')][_0x7b10('0x46')]);_0x271641[_0x7b10('0x2e')]=_['keys'](_0x50a410['query']);_0x271641[_0x7b10('0x30')]=_[_0x7b10('0x31')](_0x271641[_0x7b10('0x32')],_0x271641[_0x7b10('0x2e')]);_0x5d1056['attributes']=_[_0x7b10('0x31')](_0x271641[_0x7b10('0x32')],qs[_0x7b10('0x33')](_0x50a410['query'][_0x7b10('0x33')]));_0x5d1056['attributes']=_0x5d1056['attributes'][_0x7b10('0x35')]?_0x5d1056[_0x7b10('0x34')]:_0x271641[_0x7b10('0x32')];if(_0x50a410['query'][_0x7b10('0x40')]){_0x5d1056[_0x7b10('0x41')]=[{'all':!![]}];}_0x5d1056=_[_0x7b10('0x3d')]({},_0x5d1056,_0x50a410[_0x7b10('0x3f')]);return db[_0x7b10('0x2a')]['find'](_0x5d1056)['then'](handleEntityNotFound(_0x231478,null))['then'](respondWithResult(_0x231478,null))[_0x7b10('0x44')](handleError(_0x231478,null));};exports[_0x7b10('0x47')]=function(_0x3eef8b,_0x2f9c50){return db[_0x7b10('0x2a')][_0x7b10('0x47')](_0x3eef8b['body'],{})[_0x7b10('0x23')](respondWithResult(_0x2f9c50,0xc9))[_0x7b10('0x44')](handleError(_0x2f9c50,null));};exports[_0x7b10('0x22')]=function(_0x668e26,_0x2d3cea){if(_0x668e26[_0x7b10('0x48')]['id']){delete _0x668e26[_0x7b10('0x48')]['id'];}return db[_0x7b10('0x2a')]['find']({'where':{'id':_0x668e26[_0x7b10('0x45')]['id']}})[_0x7b10('0x23')](handleEntityNotFound(_0x2d3cea,null))['then'](saveUpdates(_0x668e26[_0x7b10('0x48')],null))[_0x7b10('0x23')](respondWithResult(_0x2d3cea,null))['catch'](handleError(_0x2d3cea,null));};exports['destroy']=function(_0x1a1b15,_0x54fea6){return db[_0x7b10('0x2a')]['find']({'where':{'id':_0x1a1b15[_0x7b10('0x45')]['id']}})[_0x7b10('0x23')](handleEntityNotFound(_0x54fea6,null))['then'](removeEntity(_0x54fea6,null))['catch'](handleError(_0x54fea6,null));};exports[_0x7b10('0x49')]=function(_0x4e31b7,_0x17908f,_0x2b94a9){var _0xf38360={};var _0x4fbceb={};var _0x2dd866;var _0x4b2c1c;return db['Dynamics365Configuration'][_0x7b10('0x4a')]({'where':{'id':_0x4e31b7['params']['id']}})[_0x7b10('0x23')](handleEntityNotFound(_0x17908f,null))[_0x7b10('0x23')](function(_0x1e1c5d){if(_0x1e1c5d){_0x2dd866=_0x1e1c5d;_0x4fbceb[_0x7b10('0x32')]=_['keys'](db['Dynamics365Field'][_0x7b10('0x46')]);_0x4fbceb[_0x7b10('0x2e')]=_['keys'](_0x4e31b7[_0x7b10('0x2e')]);_0x4fbceb[_0x7b10('0x30')]=_[_0x7b10('0x31')](_0x4fbceb[_0x7b10('0x32')],_0x4fbceb[_0x7b10('0x2e')]);_0xf38360[_0x7b10('0x34')]=_['intersection'](_0x4fbceb[_0x7b10('0x32')],qs['fields'](_0x4e31b7['query'][_0x7b10('0x33')]));_0xf38360['attributes']=_0xf38360[_0x7b10('0x34')][_0x7b10('0x35')]?_0xf38360['attributes']:_0x4fbceb['model'];_0xf38360[_0x7b10('0x38')]=qs['sort'](_0x4e31b7[_0x7b10('0x2e')]['sort']);_0xf38360['where']=qs[_0x7b10('0x30')](_[_0x7b10('0x3a')](_0x4e31b7['query'],_0x4fbceb[_0x7b10('0x30')]));if(_0x4e31b7['query'][_0x7b10('0x3b')]){_0xf38360[_0x7b10('0x3c')]=_[_0x7b10('0x3d')](_0xf38360[_0x7b10('0x3c')],{'$or':_[_0x7b10('0x29')](_0xf38360[_0x7b10('0x34')],function(_0x50f9ff){var _0x5a6f6f={};_0x5a6f6f[_0x50f9ff]={'$like':'%'+_0x4e31b7['query'][_0x7b10('0x3b')]+'%'};return _0x5a6f6f;})});}_0xf38360=_[_0x7b10('0x3d')]({},_0xf38360,_0x4e31b7[_0x7b10('0x3f')]);return _0x2dd866[_0x7b10('0x49')](_0xf38360);}})[_0x7b10('0x23')](function(_0xdfe59){if(_0xdfe59){_0x4b2c1c=_0xdfe59[_0x7b10('0x35')];if(!_0x4e31b7[_0x7b10('0x2e')]['hasOwnProperty'](_0x7b10('0x37'))){_0xf38360[_0x7b10('0x1c')]=qs[_0x7b10('0x1c')](_0x4e31b7['query']['limit']);_0xf38360['offset']=qs[_0x7b10('0x1a')](_0x4e31b7['query'][_0x7b10('0x1a')]);}return _0x2dd866[_0x7b10('0x49')](_0xf38360);}})[_0x7b10('0x23')](function(_0x4f9261){if(_0x4f9261){return _0x4f9261?{'count':_0x4b2c1c,'rows':_0x4f9261}:null;}})['then'](respondWithResult(_0x17908f,null))[_0x7b10('0x44')](handleError(_0x17908f,null));};exports['getSubjects']=function(_0x13bfb2,_0x4ae7d1,_0x171e07){var _0x8ada99={};var _0x512644={};var _0x552c1e;var _0x4f33bc;return db[_0x7b10('0x2a')][_0x7b10('0x4a')]({'where':{'id':_0x13bfb2[_0x7b10('0x45')]['id']}})[_0x7b10('0x23')](handleEntityNotFound(_0x4ae7d1,null))['then'](function(_0x46bdf2){if(_0x46bdf2){_0x552c1e=_0x46bdf2;_0x512644[_0x7b10('0x32')]=_[_0x7b10('0x2f')](db[_0x7b10('0x4b')][_0x7b10('0x46')]);_0x512644[_0x7b10('0x2e')]=_['keys'](_0x13bfb2[_0x7b10('0x2e')]);_0x512644[_0x7b10('0x30')]=_[_0x7b10('0x31')](_0x512644['model'],_0x512644[_0x7b10('0x2e')]);_0x8ada99[_0x7b10('0x34')]=_[_0x7b10('0x31')](_0x512644[_0x7b10('0x32')],qs[_0x7b10('0x33')](_0x13bfb2['query'][_0x7b10('0x33')]));_0x8ada99[_0x7b10('0x34')]=_0x8ada99[_0x7b10('0x34')][_0x7b10('0x35')]?_0x8ada99[_0x7b10('0x34')]:_0x512644['model'];_0x8ada99['order']=qs['sort'](_0x13bfb2[_0x7b10('0x2e')]['sort']);_0x8ada99[_0x7b10('0x3c')]=qs[_0x7b10('0x30')](_[_0x7b10('0x3a')](_0x13bfb2[_0x7b10('0x2e')],_0x512644[_0x7b10('0x30')]));if(_0x13bfb2[_0x7b10('0x2e')][_0x7b10('0x3b')]){_0x8ada99[_0x7b10('0x3c')]=_[_0x7b10('0x3d')](_0x8ada99[_0x7b10('0x3c')],{'$or':_[_0x7b10('0x29')](_0x8ada99[_0x7b10('0x34')],function(_0x22c5c9){var _0x15d7fb={};_0x15d7fb[_0x22c5c9]={'$like':'%'+_0x13bfb2[_0x7b10('0x2e')][_0x7b10('0x3b')]+'%'};return _0x15d7fb;})});}_0x8ada99=_['merge']({},_0x8ada99,_0x13bfb2[_0x7b10('0x3f')]);return _0x552c1e['getSubjects'](_0x8ada99);}})[_0x7b10('0x23')](function(_0xdeed65){if(_0xdeed65){_0x4f33bc=_0xdeed65['length'];if(!_0x13bfb2[_0x7b10('0x2e')][_0x7b10('0x36')]('nolimit')){_0x8ada99[_0x7b10('0x1c')]=qs[_0x7b10('0x1c')](_0x13bfb2[_0x7b10('0x2e')]['limit']);_0x8ada99[_0x7b10('0x1a')]=qs[_0x7b10('0x1a')](_0x13bfb2[_0x7b10('0x2e')][_0x7b10('0x1a')]);}return _0x552c1e[_0x7b10('0x4c')](_0x8ada99);}})[_0x7b10('0x23')](function(_0x3a8537){if(_0x3a8537){return _0x3a8537?{'count':_0x4f33bc,'rows':_0x3a8537}:null;}})[_0x7b10('0x23')](respondWithResult(_0x4ae7d1,null))[_0x7b10('0x44')](handleError(_0x4ae7d1,null));};exports[_0x7b10('0x4d')]=function(_0x40693a,_0x3f16ce,_0x429c14){var _0x460ece={};var _0x40814b={};var _0x92b64b;var _0x18ab4c;return db[_0x7b10('0x2a')]['findOne']({'where':{'id':_0x40693a[_0x7b10('0x45')]['id']}})[_0x7b10('0x23')](handleEntityNotFound(_0x3f16ce,null))[_0x7b10('0x23')](function(_0x18bb78){if(_0x18bb78){_0x92b64b=_0x18bb78;_0x40814b['model']=_[_0x7b10('0x2f')](db[_0x7b10('0x4b')][_0x7b10('0x46')]);_0x40814b[_0x7b10('0x2e')]=_[_0x7b10('0x2f')](_0x40693a[_0x7b10('0x2e')]);_0x40814b[_0x7b10('0x30')]=_['intersection'](_0x40814b[_0x7b10('0x32')],_0x40814b[_0x7b10('0x2e')]);_0x460ece[_0x7b10('0x34')]=_['intersection'](_0x40814b[_0x7b10('0x32')],qs['fields'](_0x40693a[_0x7b10('0x2e')][_0x7b10('0x33')]));_0x460ece['attributes']=_0x460ece['attributes'][_0x7b10('0x35')]?_0x460ece[_0x7b10('0x34')]:_0x40814b['model'];_0x460ece[_0x7b10('0x38')]=qs[_0x7b10('0x39')](_0x40693a[_0x7b10('0x2e')][_0x7b10('0x39')]);_0x460ece['where']=qs[_0x7b10('0x30')](_[_0x7b10('0x3a')](_0x40693a[_0x7b10('0x2e')],_0x40814b[_0x7b10('0x30')]));if(_0x40693a[_0x7b10('0x2e')][_0x7b10('0x3b')]){_0x460ece['where']=_[_0x7b10('0x3d')](_0x460ece[_0x7b10('0x3c')],{'$or':_[_0x7b10('0x29')](_0x460ece[_0x7b10('0x34')],function(_0x50f221){var _0x37a4e9={};_0x37a4e9[_0x50f221]={'$like':'%'+_0x40693a[_0x7b10('0x2e')][_0x7b10('0x3b')]+'%'};return _0x37a4e9;})});}_0x460ece=_[_0x7b10('0x3d')]({},_0x460ece,_0x40693a['options']);return _0x92b64b[_0x7b10('0x4d')](_0x460ece);}})['then'](function(_0x2a1667){if(_0x2a1667){_0x18ab4c=_0x2a1667['length'];if(!_0x40693a[_0x7b10('0x2e')][_0x7b10('0x36')](_0x7b10('0x37'))){_0x460ece['limit']=qs[_0x7b10('0x1c')](_0x40693a['query']['limit']);_0x460ece[_0x7b10('0x1a')]=qs['offset'](_0x40693a['query'][_0x7b10('0x1a')]);}return _0x92b64b[_0x7b10('0x4d')](_0x460ece);}})[_0x7b10('0x23')](function(_0x13a9ef){if(_0x13a9ef){return _0x13a9ef?{'count':_0x18ab4c,'rows':_0x13a9ef}:null;}})[_0x7b10('0x23')](respondWithResult(_0x3f16ce,null))[_0x7b10('0x44')](handleError(_0x3f16ce,null));};
\ No newline at end of file
index ef59334..cfc9a8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84ab=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger','api','moment'];(function(_0x10c9c1,_0x1cf126){var _0x17c9ff=function(_0x300d84){while(--_0x300d84){_0x10c9c1['push'](_0x10c9c1['shift']());}};_0x17c9ff(++_0x1cf126);}(_0x84ab,0x12f));var _0xb84a=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0x84ab[_0x8dc04d];return _0x2f5f28;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbec5=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird'];(function(_0x2f93c9,_0x35322a){var _0x321edc=function(_0x2cdca4){while(--_0x2cdca4){_0x2f93c9['push'](_0x2f93c9['shift']());}};_0x321edc(++_0x35322a);}(_0xbec5,0xe5));var _0x5bec=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0xbec5[_0x308374];return _0x1f71e0;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6554d71..a330ce8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51b7=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Configuration,\x20%s,\x20%s','lodash'];(function(_0x160e63,_0x260b98){var _0x3c8cf2=function(_0x438c6f){while(--_0x438c6f){_0x160e63['push'](_0x160e63['shift']());}};_0x3c8cf2(++_0x260b98);}(_0x51b7,0x1e5));var _0x751b=function(_0x25ac42,_0x434eff){_0x25ac42=_0x25ac42-0x0;var _0x39dfe9=_0x51b7[_0x25ac42];return _0x39dfe9;};'use strict';var _=require(_0x751b('0x0'));var util=require(_0x751b('0x1'));var moment=require(_0x751b('0x2'));var BPromise=require(_0x751b('0x3'));var rs=require(_0x751b('0x4'));var fs=require('fs');var Redis=require(_0x751b('0x5'));var db=require(_0x751b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x751b('0x7'))(_0x751b('0x8'));var config=require(_0x751b('0x9'));var jayson=require(_0x751b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1043e4,_0x3cc255,_0x56528a){return new BPromise(function(_0x584810,_0x533dc7){return client['request'](_0x1043e4,_0x56528a)['then'](function(_0x470849){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x3cc255,_0x751b('0xb'));logger[_0x751b('0xc')](_0x751b('0xd'),_0x3cc255,_0x751b('0xb'),JSON[_0x751b('0xe')](_0x470849));if(_0x470849[_0x751b('0xf')]){if(_0x470849[_0x751b('0xf')]['code']===0x1f4){logger[_0x751b('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3cc255,_0x470849[_0x751b('0xf')][_0x751b('0x10')]);return _0x533dc7(_0x470849[_0x751b('0xf')][_0x751b('0x10')]);}logger[_0x751b('0xf')](_0x751b('0x11'),_0x3cc255,_0x470849[_0x751b('0xf')]['message']);return _0x584810(_0x470849[_0x751b('0xf')]['message']);}else{logger['info'](_0x751b('0x11'),_0x3cc255,_0x751b('0xb'));_0x584810(_0x470849['result'][_0x751b('0x10')]);}})['catch'](function(_0x255269){logger[_0x751b('0xf')](_0x751b('0x11'),_0x3cc255,_0x255269);_0x533dc7(_0x255269);});});}
\ No newline at end of file
+var _0x0204=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\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','debug'];(function(_0x450873,_0x5575df){var _0x462fc9=function(_0x156422){while(--_0x156422){_0x450873['push'](_0x450873['shift']());}};_0x462fc9(++_0x5575df);}(_0x0204,0x128));var _0x4020=function(_0x37474c,_0x318fb8){_0x37474c=_0x37474c-0x0;var _0x3190c8=_0x0204[_0x37474c];return _0x3190c8;};'use strict';var _=require('lodash');var util=require(_0x4020('0x0'));var moment=require(_0x4020('0x1'));var BPromise=require(_0x4020('0x2'));var rs=require(_0x4020('0x3'));var fs=require('fs');var Redis=require(_0x4020('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4020('0x5'));var logger=require(_0x4020('0x6'))(_0x4020('0x7'));var config=require('../../config/environment');var jayson=require(_0x4020('0x8'));var client=jayson[_0x4020('0x9')][_0x4020('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b798b,_0x3328f3,_0x17f80f){return new BPromise(function(_0x1eba8a,_0x3b707e){return client[_0x4020('0xb')](_0x4b798b,_0x17f80f)[_0x4020('0xc')](function(_0x3c3460){logger[_0x4020('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3328f3,_0x4020('0xe'));logger[_0x4020('0xf')](_0x4020('0x10'),_0x3328f3,_0x4020('0xe'),JSON[_0x4020('0x11')](_0x3c3460));if(_0x3c3460[_0x4020('0x12')]){if(_0x3c3460[_0x4020('0x12')][_0x4020('0x13')]===0x1f4){logger[_0x4020('0x12')](_0x4020('0x14'),_0x3328f3,_0x3c3460[_0x4020('0x12')][_0x4020('0x15')]);return _0x3b707e(_0x3c3460['error'][_0x4020('0x15')]);}logger['error'](_0x4020('0x14'),_0x3328f3,_0x3c3460[_0x4020('0x12')][_0x4020('0x15')]);return _0x1eba8a(_0x3c3460[_0x4020('0x12')][_0x4020('0x15')]);}else{logger[_0x4020('0xd')](_0x4020('0x14'),_0x3328f3,_0x4020('0xe'));_0x1eba8a(_0x3c3460[_0x4020('0x16')]['message']);}})[_0x4020('0x17')](function(_0x19dd90){logger['error'](_0x4020('0x14'),_0x3328f3,_0x19dd90);_0x3b707e(_0x19dd90);});});}
\ No newline at end of file
index f1ace43..5ee0594 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa925=['destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','post','create','put'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa925,0x1e2));var _0x5a92=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xa925[_0x174ef5];return _0x1cc379;};'use strict';var multer=require(_0x5a92('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5a92('0x1'));var express=require(_0x5a92('0x2'));var router=express[_0x5a92('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5a92('0x4'));var config=require(_0x5a92('0x5'));var controller=require(_0x5a92('0x6'));router[_0x5a92('0x7')]('/',auth['isAuthenticated'](),controller[_0x5a92('0x8')]);router[_0x5a92('0x7')](_0x5a92('0x9'),auth[_0x5a92('0xa')](),controller['show']);router[_0x5a92('0xb')]('/',auth[_0x5a92('0xa')](),controller[_0x5a92('0xc')]);router[_0x5a92('0xd')](_0x5a92('0x9'),auth[_0x5a92('0xa')](),controller['update']);router['delete'](_0x5a92('0x9'),auth[_0x5a92('0xa')](),controller[_0x5a92('0xe')]);module[_0x5a92('0xf')]=router;
\ No newline at end of file
+var _0x9334=['put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','create'];(function(_0x3d39ce,_0x4b9a3b){var _0x39273c=function(_0x2894a1){while(--_0x2894a1){_0x3d39ce['push'](_0x3d39ce['shift']());}};_0x39273c(++_0x4b9a3b);}(_0x9334,0x15a));var _0x4933=function(_0x1c9c60,_0x3970d7){_0x1c9c60=_0x1c9c60-0x0;var _0x55e421=_0x9334[_0x1c9c60];return _0x55e421;};'use strict';var multer=require(_0x4933('0x0'));var util=require('util');var path=require(_0x4933('0x1'));var timeout=require(_0x4933('0x2'));var express=require('express');var router=express[_0x4933('0x3')]();var fs_extra=require(_0x4933('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4933('0x5'));var config=require(_0x4933('0x6'));var controller=require(_0x4933('0x7'));router['get']('/',auth[_0x4933('0x8')](),controller[_0x4933('0x9')]);router[_0x4933('0xa')](_0x4933('0xb'),auth['isAuthenticated'](),controller[_0x4933('0xc')]);router['post']('/',auth[_0x4933('0x8')](),controller[_0x4933('0xd')]);router[_0x4933('0xe')](_0x4933('0xb'),auth['isAuthenticated'](),controller[_0x4933('0xf')]);router[_0x4933('0x10')](_0x4933('0xb'),auth[_0x4933('0x8')](),controller[_0x4933('0x11')]);module['exports']=router;
\ No newline at end of file
index 1a546ad..9b7eae5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd70f=['STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string','variable','keyValue'];(function(_0x1a2d8f,_0x195dc5){var _0x340e0c=function(_0x5efe78){while(--_0x5efe78){_0x1a2d8f['push'](_0x1a2d8f['shift']());}};_0x340e0c(++_0x195dc5);}(_0xd70f,0xb8));var _0xfd70=function(_0x3be83f,_0x439106){_0x3be83f=_0x3be83f-0x0;var _0xb67fd0=_0xd70f[_0x3be83f];return _0xb67fd0;};'use strict';var Sequelize=require(_0xfd70('0x0'));module[_0xfd70('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfd70('0x2'),_0xfd70('0x3'),'customVariable',_0xfd70('0x4'),'picklist'),'defaultValue':_0xfd70('0x2')},'content':{'type':Sequelize[_0xfd70('0x5')]},'key':{'type':Sequelize[_0xfd70('0x5')]},'keyType':{'type':Sequelize[_0xfd70('0x6')]('string',_0xfd70('0x3'),_0xfd70('0x7'))},'keyContent':{'type':Sequelize[_0xfd70('0x5')]},'idField':{'type':Sequelize[_0xfd70('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xfd70('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfd70('0x5')]}};
\ No newline at end of file
+var _0x59c3=['customVariable','keyValue','string','STRING','sequelize','exports','ENUM','variable'];(function(_0x5c9897,_0x3c84f7){var _0x1d87f1=function(_0x29f6ec){while(--_0x29f6ec){_0x5c9897['push'](_0x5c9897['shift']());}};_0x1d87f1(++_0x3c84f7);}(_0x59c3,0x8c));var _0x359c=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x59c3[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0x359c('0x0'));module[_0x359c('0x1')]={'type':{'type':Sequelize[_0x359c('0x2')]('string',_0x359c('0x3'),_0x359c('0x4'),_0x359c('0x5'),'picklist'),'defaultValue':_0x359c('0x6')},'content':{'type':Sequelize[_0x359c('0x7')]},'key':{'type':Sequelize[_0x359c('0x7')]},'keyType':{'type':Sequelize[_0x359c('0x2')](_0x359c('0x6'),_0x359c('0x3'),_0x359c('0x4'))},'keyContent':{'type':Sequelize[_0x359c('0x7')]},'idField':{'type':Sequelize[_0x359c('0x7')]},'nameField':{'type':Sequelize[_0x359c('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x359c('0x7')]}};
\ No newline at end of file
index c841ec1..9c77dd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48a7=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','length','model','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Dynamics365Field','findAll','rows','show','find','catch','create','body','update','params','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5df75c,_0x4b4106){var _0x2e3762=function(_0x2d32cd){while(--_0x2d32cd){_0x5df75c['push'](_0x5df75c['shift']());}};_0x2e3762(++_0x4b4106);}(_0x48a7,0x115));var _0x748a=function(_0x9e60c0,_0x3e864b){_0x9e60c0=_0x9e60c0-0x0;var _0x156a65=_0x48a7[_0x9e60c0];return _0x156a65;};'use strict';var emlformat=require(_0x748a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x748a('0x1'));var jsonpatch=require(_0x748a('0x2'));var rp=require('request-promise');var moment=require(_0x748a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x748a('0x4'));var util=require(_0x748a('0x5'));var path=require(_0x748a('0x6'));var sox=require(_0x748a('0x7'));var csv=require(_0x748a('0x8'));var ejs=require(_0x748a('0x9'));var fs=require('fs');var fs_extra=require(_0x748a('0xa'));var _=require(_0x748a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x748a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x748a('0x8'));var querystring=require(_0x748a('0xd'));var Papa=require(_0x748a('0xe'));var Redis=require(_0x748a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x748a('0x10'));var as=require(_0x748a('0x11'));var hardwareService=require(_0x748a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x748a('0x13'));var config=require(_0x748a('0x14'));var licenseUtil=require(_0x748a('0x15'));var db=require(_0x748a('0x16'))['db'];function respondWithStatusCode(_0x2c1d42,_0x4effad){_0x4effad=_0x4effad||0xcc;return function(_0x1fcb44){if(_0x1fcb44){return _0x2c1d42[_0x748a('0x17')](_0x4effad);}return _0x2c1d42['status'](_0x4effad)[_0x748a('0x18')]();};}function respondWithResult(_0x2ed07c,_0x1166a0){_0x1166a0=_0x1166a0||0xc8;return function(_0x52f3be){if(_0x52f3be){return _0x2ed07c['status'](_0x1166a0)[_0x748a('0x19')](_0x52f3be);}};}function respondWithFilteredResult(_0x19ba67,_0x2e45d1){return function(_0x22f80c){if(_0x22f80c){var _0x406d4f=typeof _0x2e45d1[_0x748a('0x1a')]===_0x748a('0x1b')&&typeof _0x2e45d1[_0x748a('0x1c')]===_0x748a('0x1b');var _0x26877b=_0x22f80c[_0x748a('0x1d')];var _0x18a228=_0x406d4f?0x0:_0x2e45d1[_0x748a('0x1a')];var _0x2280cf=_0x406d4f?_0x22f80c['count']:_0x2e45d1[_0x748a('0x1a')]+_0x2e45d1['limit'];var _0x4e9330;if(_0x2280cf>=_0x26877b){_0x2280cf=_0x26877b;_0x4e9330=0xc8;}else{_0x4e9330=0xce;}_0x19ba67[_0x748a('0x1e')](_0x4e9330);return _0x19ba67[_0x748a('0x1f')](_0x748a('0x20'),_0x18a228+'-'+_0x2280cf+'/'+_0x26877b)[_0x748a('0x19')](_0x22f80c);}return null;};}function patchUpdates(_0x360732){return function(_0xacda43){try{jsonpatch['apply'](_0xacda43,_0x360732,!![]);}catch(_0xb4f7a8){return BPromise[_0x748a('0x21')](_0xb4f7a8);}return _0xacda43[_0x748a('0x22')]();};}function saveUpdates(_0x3239c8,_0x56658c){return function(_0x1f0fbe){if(_0x1f0fbe){return _0x1f0fbe['update'](_0x3239c8)[_0x748a('0x23')](function(_0x10c266){return _0x10c266;});}return null;};}function removeEntity(_0x2ddcc1,_0x53176e){return function(_0x866767){if(_0x866767){return _0x866767[_0x748a('0x24')]()[_0x748a('0x23')](function(){_0x2ddcc1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x319e9b,_0x4ba8fd){return function(_0x53b8f4){if(!_0x53b8f4){_0x319e9b['sendStatus'](0x194);}return _0x53b8f4;};}function handleError(_0x35520c,_0x1dd421){_0x1dd421=_0x1dd421||0x1f4;return function(_0x2438f0){logger[_0x748a('0x25')](_0x2438f0['stack']);if(_0x2438f0[_0x748a('0x26')]){delete _0x2438f0[_0x748a('0x26')];}_0x35520c['status'](_0x1dd421)[_0x748a('0x27')](_0x2438f0);};}exports[_0x748a('0x28')]=function(_0x39656f,_0x1d8f40){var _0x2071b5={},_0x1e4df2={},_0x1125d5={'count':0x0,'rows':[]};var _0x18a7a3=_[_0x748a('0x29')](db['Dynamics365Field'][_0x748a('0x2a')],function(_0x22f362){return{'name':_0x22f362[_0x748a('0x2b')],'type':_0x22f362['type'][_0x748a('0x2c')]};});_0x1e4df2['model']=_[_0x748a('0x29')](_0x18a7a3,'name');_0x1e4df2[_0x748a('0x2d')]=_[_0x748a('0x2e')](_0x39656f[_0x748a('0x2d')]);_0x1e4df2['filters']=_[_0x748a('0x2f')](_0x1e4df2['model'],_0x1e4df2[_0x748a('0x2d')]);_0x2071b5[_0x748a('0x30')]=_['intersection'](_0x1e4df2['model'],qs[_0x748a('0x31')](_0x39656f[_0x748a('0x2d')]['fields']));_0x2071b5[_0x748a('0x30')]=_0x2071b5['attributes'][_0x748a('0x32')]?_0x2071b5[_0x748a('0x30')]:_0x1e4df2[_0x748a('0x33')];if(!_0x39656f[_0x748a('0x2d')]['hasOwnProperty'](_0x748a('0x34'))){_0x2071b5['limit']=qs[_0x748a('0x1c')](_0x39656f[_0x748a('0x2d')][_0x748a('0x1c')]);_0x2071b5[_0x748a('0x1a')]=qs[_0x748a('0x1a')](_0x39656f[_0x748a('0x2d')][_0x748a('0x1a')]);}_0x2071b5['order']=qs[_0x748a('0x35')](_0x39656f[_0x748a('0x2d')]['sort']);_0x2071b5[_0x748a('0x36')]=qs[_0x748a('0x37')](_[_0x748a('0x38')](_0x39656f[_0x748a('0x2d')],_0x1e4df2[_0x748a('0x37')]),_0x18a7a3);if(_0x39656f[_0x748a('0x2d')][_0x748a('0x39')]){_0x2071b5[_0x748a('0x36')]=_[_0x748a('0x3a')](_0x2071b5[_0x748a('0x36')],{'$or':_[_0x748a('0x29')](_0x18a7a3,function(_0x12a903){if(_0x12a903[_0x748a('0x3b')]!==_0x748a('0x3c')){var _0x3a19c3={};_0x3a19c3[_0x12a903[_0x748a('0x26')]]={'$like':'%'+_0x39656f[_0x748a('0x2d')][_0x748a('0x39')]+'%'};return _0x3a19c3;}})});}_0x2071b5=_[_0x748a('0x3a')]({},_0x2071b5,_0x39656f[_0x748a('0x3d')]);var _0x42a609={'where':_0x2071b5[_0x748a('0x36')]};return db['Dynamics365Field'][_0x748a('0x1d')](_0x42a609)[_0x748a('0x23')](function(_0x4cf4ac){_0x1125d5['count']=_0x4cf4ac;if(_0x39656f[_0x748a('0x2d')][_0x748a('0x3e')]){_0x2071b5[_0x748a('0x3f')]=[{'all':!![]}];}return db[_0x748a('0x40')][_0x748a('0x41')](_0x2071b5);})[_0x748a('0x23')](function(_0x220e16){_0x1125d5[_0x748a('0x42')]=_0x220e16;return _0x1125d5;})[_0x748a('0x23')](respondWithFilteredResult(_0x1d8f40,_0x2071b5))['catch'](handleError(_0x1d8f40,null));};exports[_0x748a('0x43')]=function(_0x5c31c1,_0x29a83f){var _0x238897={'raw':!![],'where':{'id':_0x5c31c1['params']['id']}},_0x37ece4={};_0x37ece4[_0x748a('0x33')]=_[_0x748a('0x2e')](db[_0x748a('0x40')]['rawAttributes']);_0x37ece4['query']=_[_0x748a('0x2e')](_0x5c31c1[_0x748a('0x2d')]);_0x37ece4[_0x748a('0x37')]=_['intersection'](_0x37ece4[_0x748a('0x33')],_0x37ece4['query']);_0x238897[_0x748a('0x30')]=_['intersection'](_0x37ece4[_0x748a('0x33')],qs[_0x748a('0x31')](_0x5c31c1['query'][_0x748a('0x31')]));_0x238897[_0x748a('0x30')]=_0x238897[_0x748a('0x30')][_0x748a('0x32')]?_0x238897[_0x748a('0x30')]:_0x37ece4['model'];if(_0x5c31c1[_0x748a('0x2d')][_0x748a('0x3e')]){_0x238897[_0x748a('0x3f')]=[{'all':!![]}];}_0x238897=_['merge']({},_0x238897,_0x5c31c1[_0x748a('0x3d')]);return db[_0x748a('0x40')][_0x748a('0x44')](_0x238897)['then'](handleEntityNotFound(_0x29a83f,null))[_0x748a('0x23')](respondWithResult(_0x29a83f,null))[_0x748a('0x45')](handleError(_0x29a83f,null));};exports[_0x748a('0x46')]=function(_0x530ada,_0x3bbaf6){return db[_0x748a('0x40')][_0x748a('0x46')](_0x530ada[_0x748a('0x47')],{})[_0x748a('0x23')](respondWithResult(_0x3bbaf6,0xc9))[_0x748a('0x45')](handleError(_0x3bbaf6,null));};exports[_0x748a('0x48')]=function(_0x5e3162,_0x5d499b){if(_0x5e3162[_0x748a('0x47')]['id']){delete _0x5e3162[_0x748a('0x47')]['id'];}return db['Dynamics365Field'][_0x748a('0x44')]({'where':{'id':_0x5e3162[_0x748a('0x49')]['id']}})[_0x748a('0x23')](handleEntityNotFound(_0x5d499b,null))['then'](saveUpdates(_0x5e3162['body'],null))[_0x748a('0x23')](respondWithResult(_0x5d499b,null))[_0x748a('0x45')](handleError(_0x5d499b,null));};exports[_0x748a('0x24')]=function(_0x376379,_0xdbdbce){return db[_0x748a('0x40')][_0x748a('0x44')]({'where':{'id':_0x376379['params']['id']}})[_0x748a('0x23')](handleEntityNotFound(_0xdbdbce,null))[_0x748a('0x23')](removeEntity(_0xdbdbce,null))['catch'](handleError(_0xdbdbce,null));};
\ No newline at end of file
+var _0xfe56=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Dynamics365Field','rawAttributes','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','keys','length','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2ea80c,_0xaf95a5){var _0x340bfc=function(_0x1a32ed){while(--_0x1a32ed){_0x2ea80c['push'](_0x2ea80c['shift']());}};_0x340bfc(++_0xaf95a5);}(_0xfe56,0x15c));var _0x6fe5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfe56[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x6fe5('0x0'));var rimraf=require(_0x6fe5('0x1'));var zipdir=require(_0x6fe5('0x2'));var jsonpatch=require(_0x6fe5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6fe5('0x4'));var path=require(_0x6fe5('0x5'));var sox=require(_0x6fe5('0x6'));var csv=require(_0x6fe5('0x7'));var ejs=require(_0x6fe5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6fe5('0x9'));var squel=require('squel');var crypto=require(_0x6fe5('0xa'));var jsforce=require(_0x6fe5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6fe5('0x7'));var querystring=require('querystring');var Papa=require(_0x6fe5('0xc'));var Redis=require(_0x6fe5('0xd'));var authService=require(_0x6fe5('0xe'));var qs=require(_0x6fe5('0xf'));var as=require(_0x6fe5('0x10'));var hardwareService=require(_0x6fe5('0x11'));var logger=require(_0x6fe5('0x12'))(_0x6fe5('0x13'));var utils=require(_0x6fe5('0x14'));var config=require(_0x6fe5('0x15'));var licenseUtil=require(_0x6fe5('0x16'));var db=require(_0x6fe5('0x17'))['db'];function respondWithStatusCode(_0x19121e,_0x107a7f){_0x107a7f=_0x107a7f||0xcc;return function(_0x2ac8ea){if(_0x2ac8ea){return _0x19121e[_0x6fe5('0x18')](_0x107a7f);}return _0x19121e[_0x6fe5('0x19')](_0x107a7f)[_0x6fe5('0x1a')]();};}function respondWithResult(_0x18e3c6,_0xb25487){_0xb25487=_0xb25487||0xc8;return function(_0x36dcad){if(_0x36dcad){return _0x18e3c6[_0x6fe5('0x19')](_0xb25487)[_0x6fe5('0x1b')](_0x36dcad);}};}function respondWithFilteredResult(_0x1194e0,_0x2c8327){return function(_0x2ec2c8){if(_0x2ec2c8){var _0x1074ad=typeof _0x2c8327[_0x6fe5('0x1c')]===_0x6fe5('0x1d')&&typeof _0x2c8327['limit']===_0x6fe5('0x1d');var _0x5df7af=_0x2ec2c8[_0x6fe5('0x1e')];var _0x4cedc9=_0x1074ad?0x0:_0x2c8327['offset'];var _0x23e4be=_0x1074ad?_0x2ec2c8['count']:_0x2c8327[_0x6fe5('0x1c')]+_0x2c8327[_0x6fe5('0x1f')];var _0x12a8aa;if(_0x23e4be>=_0x5df7af){_0x23e4be=_0x5df7af;_0x12a8aa=0xc8;}else{_0x12a8aa=0xce;}_0x1194e0[_0x6fe5('0x19')](_0x12a8aa);return _0x1194e0[_0x6fe5('0x20')](_0x6fe5('0x21'),_0x4cedc9+'-'+_0x23e4be+'/'+_0x5df7af)[_0x6fe5('0x1b')](_0x2ec2c8);}return null;};}function patchUpdates(_0x1932d3){return function(_0x353084){try{jsonpatch[_0x6fe5('0x22')](_0x353084,_0x1932d3,!![]);}catch(_0x5c2a79){return BPromise[_0x6fe5('0x23')](_0x5c2a79);}return _0x353084[_0x6fe5('0x24')]();};}function saveUpdates(_0x31e0dd,_0x300761){return function(_0x2755f8){if(_0x2755f8){return _0x2755f8[_0x6fe5('0x25')](_0x31e0dd)[_0x6fe5('0x26')](function(_0x1623d8){return _0x1623d8;});}return null;};}function removeEntity(_0x4a802a,_0x3c4db0){return function(_0x3bfbd6){if(_0x3bfbd6){return _0x3bfbd6[_0x6fe5('0x27')]()['then'](function(){_0x4a802a['status'](0xcc)[_0x6fe5('0x1a')]();});}};}function handleEntityNotFound(_0x31cec1,_0x38fd48){return function(_0x3bc86f){if(!_0x3bc86f){_0x31cec1['sendStatus'](0x194);}return _0x3bc86f;};}function handleError(_0x37f4fb,_0x5e7365){_0x5e7365=_0x5e7365||0x1f4;return function(_0x25ea68){logger[_0x6fe5('0x28')](_0x25ea68[_0x6fe5('0x29')]);if(_0x25ea68[_0x6fe5('0x2a')]){delete _0x25ea68[_0x6fe5('0x2a')];}_0x37f4fb['status'](_0x5e7365)['send'](_0x25ea68);};}exports[_0x6fe5('0x2b')]=function(_0x1a813b,_0x23d908){var _0x198c05={},_0x1d2dfe={},_0xd220ed={'count':0x0,'rows':[]};var _0x51529e=_['map'](db[_0x6fe5('0x2c')][_0x6fe5('0x2d')],function(_0x584d56){return{'name':_0x584d56['fieldName'],'type':_0x584d56[_0x6fe5('0x2e')][_0x6fe5('0x2f')]};});_0x1d2dfe[_0x6fe5('0x30')]=_[_0x6fe5('0x31')](_0x51529e,_0x6fe5('0x2a'));_0x1d2dfe[_0x6fe5('0x32')]=_['keys'](_0x1a813b[_0x6fe5('0x32')]);_0x1d2dfe['filters']=_[_0x6fe5('0x33')](_0x1d2dfe[_0x6fe5('0x30')],_0x1d2dfe[_0x6fe5('0x32')]);_0x198c05[_0x6fe5('0x34')]=_['intersection'](_0x1d2dfe[_0x6fe5('0x30')],qs[_0x6fe5('0x35')](_0x1a813b[_0x6fe5('0x32')][_0x6fe5('0x35')]));_0x198c05[_0x6fe5('0x34')]=_0x198c05[_0x6fe5('0x34')]['length']?_0x198c05[_0x6fe5('0x34')]:_0x1d2dfe[_0x6fe5('0x30')];if(!_0x1a813b[_0x6fe5('0x32')][_0x6fe5('0x36')](_0x6fe5('0x37'))){_0x198c05['limit']=qs[_0x6fe5('0x1f')](_0x1a813b[_0x6fe5('0x32')][_0x6fe5('0x1f')]);_0x198c05['offset']=qs['offset'](_0x1a813b[_0x6fe5('0x32')][_0x6fe5('0x1c')]);}_0x198c05[_0x6fe5('0x38')]=qs[_0x6fe5('0x39')](_0x1a813b['query'][_0x6fe5('0x39')]);_0x198c05[_0x6fe5('0x3a')]=qs[_0x6fe5('0x3b')](_['pick'](_0x1a813b[_0x6fe5('0x32')],_0x1d2dfe[_0x6fe5('0x3b')]),_0x51529e);if(_0x1a813b[_0x6fe5('0x32')][_0x6fe5('0x3c')]){_0x198c05[_0x6fe5('0x3a')]=_[_0x6fe5('0x3d')](_0x198c05[_0x6fe5('0x3a')],{'$or':_[_0x6fe5('0x31')](_0x51529e,function(_0x22795d){if(_0x22795d[_0x6fe5('0x2e')]!==_0x6fe5('0x3e')){var _0x55b953={};_0x55b953[_0x22795d['name']]={'$like':'%'+_0x1a813b[_0x6fe5('0x32')][_0x6fe5('0x3c')]+'%'};return _0x55b953;}})});}_0x198c05=_[_0x6fe5('0x3d')]({},_0x198c05,_0x1a813b[_0x6fe5('0x3f')]);var _0xec9255={'where':_0x198c05[_0x6fe5('0x3a')]};return db[_0x6fe5('0x2c')][_0x6fe5('0x1e')](_0xec9255)[_0x6fe5('0x26')](function(_0x245f4e){_0xd220ed[_0x6fe5('0x1e')]=_0x245f4e;if(_0x1a813b[_0x6fe5('0x32')][_0x6fe5('0x40')]){_0x198c05[_0x6fe5('0x41')]=[{'all':!![]}];}return db[_0x6fe5('0x2c')]['findAll'](_0x198c05);})['then'](function(_0x299b60){_0xd220ed[_0x6fe5('0x42')]=_0x299b60;return _0xd220ed;})['then'](respondWithFilteredResult(_0x23d908,_0x198c05))[_0x6fe5('0x43')](handleError(_0x23d908,null));};exports['show']=function(_0x2894bc,_0x4306eb){var _0x2a597d={'raw':!![],'where':{'id':_0x2894bc['params']['id']}},_0x27dcc7={};_0x27dcc7[_0x6fe5('0x30')]=_[_0x6fe5('0x44')](db[_0x6fe5('0x2c')][_0x6fe5('0x2d')]);_0x27dcc7[_0x6fe5('0x32')]=_[_0x6fe5('0x44')](_0x2894bc[_0x6fe5('0x32')]);_0x27dcc7['filters']=_[_0x6fe5('0x33')](_0x27dcc7['model'],_0x27dcc7[_0x6fe5('0x32')]);_0x2a597d[_0x6fe5('0x34')]=_[_0x6fe5('0x33')](_0x27dcc7[_0x6fe5('0x30')],qs[_0x6fe5('0x35')](_0x2894bc[_0x6fe5('0x32')][_0x6fe5('0x35')]));_0x2a597d[_0x6fe5('0x34')]=_0x2a597d[_0x6fe5('0x34')][_0x6fe5('0x45')]?_0x2a597d[_0x6fe5('0x34')]:_0x27dcc7[_0x6fe5('0x30')];if(_0x2894bc[_0x6fe5('0x32')][_0x6fe5('0x40')]){_0x2a597d[_0x6fe5('0x41')]=[{'all':!![]}];}_0x2a597d=_[_0x6fe5('0x3d')]({},_0x2a597d,_0x2894bc[_0x6fe5('0x3f')]);return db[_0x6fe5('0x2c')]['find'](_0x2a597d)[_0x6fe5('0x26')](handleEntityNotFound(_0x4306eb,null))[_0x6fe5('0x26')](respondWithResult(_0x4306eb,null))[_0x6fe5('0x43')](handleError(_0x4306eb,null));};exports['create']=function(_0x5b9013,_0x4f325c){return db['Dynamics365Field'][_0x6fe5('0x46')](_0x5b9013[_0x6fe5('0x47')],{})[_0x6fe5('0x26')](respondWithResult(_0x4f325c,0xc9))['catch'](handleError(_0x4f325c,null));};exports['update']=function(_0x2e19b0,_0x5e849e){if(_0x2e19b0[_0x6fe5('0x47')]['id']){delete _0x2e19b0[_0x6fe5('0x47')]['id'];}return db[_0x6fe5('0x2c')]['find']({'where':{'id':_0x2e19b0['params']['id']}})[_0x6fe5('0x26')](handleEntityNotFound(_0x5e849e,null))[_0x6fe5('0x26')](saveUpdates(_0x2e19b0['body'],null))[_0x6fe5('0x26')](respondWithResult(_0x5e849e,null))['catch'](handleError(_0x5e849e,null));};exports[_0x6fe5('0x27')]=function(_0x387fa3,_0x484cb2){return db[_0x6fe5('0x2c')][_0x6fe5('0x48')]({'where':{'id':_0x387fa3[_0x6fe5('0x49')]['id']}})['then'](handleEntityNotFound(_0x484cb2,null))['then'](removeEntity(_0x484cb2,null))[_0x6fe5('0x43')](handleError(_0x484cb2,null));};
\ No newline at end of file
index 3cc054e..9415277 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c21=['./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x8c21,0x111));var _0x18c2=function(_0xa54031,_0x21531e){_0xa54031=_0xa54031-0x0;var _0x3c201f=_0x8c21[_0xa54031];return _0x3c201f;};'use strict';var _=require('lodash');var util=require(_0x18c2('0x0'));var logger=require('../../config/logger')(_0x18c2('0x1'));var moment=require('moment');var BPromise=require(_0x18c2('0x2'));var rp=require(_0x18c2('0x3'));var fs=require('fs');var path=require(_0x18c2('0x4'));var rimraf=require(_0x18c2('0x5'));var config=require(_0x18c2('0x6'));var attributes=require(_0x18c2('0x7'));module[_0x18c2('0x8')]=function(_0x5d3e51,_0x5f3ac5){return _0x5d3e51[_0x18c2('0x9')](_0x18c2('0xa'),attributes,{'tableName':_0x18c2('0xb'),'paranoid':![],'indexes':[{'name':_0x18c2('0xc'),'fields':['idField',_0x18c2('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7002=['dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0x487a0b,_0x33c302){var _0x4cb1ba=function(_0x2a3615){while(--_0x2a3615){_0x487a0b['push'](_0x487a0b['shift']());}};_0x4cb1ba(++_0x33c302);}(_0x7002,0x10d));var _0x2700=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0x7002[_0x4ac60a];return _0x4b22e8;};'use strict';var _=require(_0x2700('0x0'));var util=require(_0x2700('0x1'));var logger=require('../../config/logger')(_0x2700('0x2'));var moment=require(_0x2700('0x3'));var BPromise=require('bluebird');var rp=require(_0x2700('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2700('0x5'));var config=require(_0x2700('0x6'));var attributes=require(_0x2700('0x7'));module[_0x2700('0x8')]=function(_0x5e9ee3,_0x3d3e08){return _0x5e9ee3[_0x2700('0x9')](_0x2700('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x2700('0xb'),'fields':[_0x2700('0xc'),_0x2700('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 25aa8f2..47b27c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf22f=['Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x19cf99,_0x3edd8c){var _0x370445=function(_0x9e4aa4){while(--_0x9e4aa4){_0x19cf99['push'](_0x19cf99['shift']());}};_0x370445(++_0x3edd8c);}(_0xf22f,0x1e7));var _0xff22=function(_0x16dcdb,_0x2ac8ba){_0x16dcdb=_0x16dcdb-0x0;var _0x2939dc=_0xf22f[_0x16dcdb];return _0x2939dc;};'use strict';var _=require(_0xff22('0x0'));var util=require(_0xff22('0x1'));var moment=require(_0xff22('0x2'));var BPromise=require(_0xff22('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff22('0x4'));var db=require(_0xff22('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xff22('0x6'))(_0xff22('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff22('0x8')][_0xff22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2522,_0x9da458,_0x2f21ad){return new BPromise(function(_0x29491c,_0x47bfb8){return client[_0xff22('0xa')](_0x3d2522,_0x2f21ad)[_0xff22('0xb')](function(_0x30d35d){logger[_0xff22('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x9da458,_0xff22('0xd'));logger[_0xff22('0xe')](_0xff22('0xf'),_0x9da458,_0xff22('0xd'),JSON[_0xff22('0x10')](_0x30d35d));if(_0x30d35d['error']){if(_0x30d35d['error'][_0xff22('0x11')]===0x1f4){logger[_0xff22('0x12')](_0xff22('0x13'),_0x9da458,_0x30d35d[_0xff22('0x12')][_0xff22('0x14')]);return _0x47bfb8(_0x30d35d[_0xff22('0x12')]['message']);}logger[_0xff22('0x12')](_0xff22('0x13'),_0x9da458,_0x30d35d[_0xff22('0x12')]['message']);return _0x29491c(_0x30d35d[_0xff22('0x12')][_0xff22('0x14')]);}else{logger[_0xff22('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x9da458,_0xff22('0xd'));_0x29491c(_0x30d35d[_0xff22('0x15')][_0xff22('0x14')]);}})[_0xff22('0x16')](function(_0x1e2146){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x9da458,_0x1e2146);_0x47bfb8(_0x1e2146);});});}
\ No newline at end of file
+var _0x8b0b=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','request\x20sent','debug','error','code','Dynamics365Field,\x20%s,\x20%s','message','result'];(function(_0x42db3e,_0x4e0e33){var _0x1c86e2=function(_0xf701de){while(--_0xf701de){_0x42db3e['push'](_0x42db3e['shift']());}};_0x1c86e2(++_0x4e0e33);}(_0x8b0b,0x19f));var _0xb8b0=function(_0x386b03,_0x5d0000){_0x386b03=_0x386b03-0x0;var _0xd3d524=_0x8b0b[_0x386b03];return _0xd3d524;};'use strict';var _=require(_0xb8b0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb8b0('0x1'));var rs=require(_0xb8b0('0x2'));var fs=require('fs');var Redis=require(_0xb8b0('0x3'));var db=require(_0xb8b0('0x4'))['db'];var utils=require(_0xb8b0('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb8b0('0x6'));var client=jayson['client'][_0xb8b0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5aebfd,_0x177ec8,_0x3556b5){return new BPromise(function(_0xec8065,_0x553132){return client[_0xb8b0('0x8')](_0x5aebfd,_0x3556b5)[_0xb8b0('0x9')](function(_0x3673e0){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x177ec8,_0xb8b0('0xa'));logger[_0xb8b0('0xb')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x177ec8,'request\x20sent',JSON['stringify'](_0x3673e0));if(_0x3673e0['error']){if(_0x3673e0[_0xb8b0('0xc')][_0xb8b0('0xd')]===0x1f4){logger['error'](_0xb8b0('0xe'),_0x177ec8,_0x3673e0['error'][_0xb8b0('0xf')]);return _0x553132(_0x3673e0[_0xb8b0('0xc')][_0xb8b0('0xf')]);}logger[_0xb8b0('0xc')](_0xb8b0('0xe'),_0x177ec8,_0x3673e0[_0xb8b0('0xc')][_0xb8b0('0xf')]);return _0xec8065(_0x3673e0['error'][_0xb8b0('0xf')]);}else{logger['info'](_0xb8b0('0xe'),_0x177ec8,_0xb8b0('0xa'));_0xec8065(_0x3673e0[_0xb8b0('0x10')]['message']);}})[_0xb8b0('0x11')](function(_0x3570f5){logger[_0xb8b0('0xc')](_0xb8b0('0xe'),_0x177ec8,_0x3570f5);_0x553132(_0x3570f5);});});}
\ No newline at end of file
index bd5c992..d131195 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5cd=['delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update'];(function(_0x142bc9,_0x229789){var _0x47d30b=function(_0x56ed25){while(--_0x56ed25){_0x142bc9['push'](_0x142bc9['shift']());}};_0x47d30b(++_0x229789);}(_0xf5cd,0x18f));var _0xdf5c=function(_0x476304,_0x332383){_0x476304=_0x476304-0x0;var _0x4ad72a=_0xf5cd[_0x476304];return _0x4ad72a;};'use strict';var multer=require('multer');var util=require(_0xdf5c('0x0'));var path=require(_0xdf5c('0x1'));var timeout=require(_0xdf5c('0x2'));var express=require(_0xdf5c('0x3'));var router=express['Router']();var fs_extra=require(_0xdf5c('0x4'));var auth=require(_0xdf5c('0x5'));var interaction=require(_0xdf5c('0x6'));var config=require(_0xdf5c('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0xdf5c('0x8')]('/',auth[_0xdf5c('0x9')](),controller['index']);router[_0xdf5c('0x8')](_0xdf5c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xdf5c('0x8')](_0xdf5c('0xb'),auth[_0xdf5c('0x9')](),controller[_0xdf5c('0xc')]);router['get'](_0xdf5c('0xd'),auth[_0xdf5c('0x9')](),controller[_0xdf5c('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xdf5c('0xf')](_0xdf5c('0xb'),auth[_0xdf5c('0x9')](),controller[_0xdf5c('0x10')]);router[_0xdf5c('0x11')](_0xdf5c('0xa'),auth[_0xdf5c('0x9')](),controller[_0xdf5c('0x12')]);router[_0xdf5c('0x13')](_0xdf5c('0xa'),auth[_0xdf5c('0x9')](),controller[_0xdf5c('0x14')]);module[_0xdf5c('0x15')]=router;
\ No newline at end of file
+var _0x6f32=['get','isAuthenticated','index','/:id/configurations','/:id/fields','getFields','create','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x6f32,0x1dc));var _0x26f3=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x6f32[_0x39c734];return _0xb2a2f9;};'use strict';var multer=require(_0x26f3('0x0'));var util=require('util');var path=require(_0x26f3('0x1'));var timeout=require(_0x26f3('0x2'));var express=require('express');var router=express[_0x26f3('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x26f3('0x4'));var config=require(_0x26f3('0x5'));var controller=require(_0x26f3('0x6'));router[_0x26f3('0x7')]('/',auth[_0x26f3('0x8')](),controller[_0x26f3('0x9')]);router[_0x26f3('0x7')]('/:id',auth[_0x26f3('0x8')](),controller['show']);router['get'](_0x26f3('0xa'),auth[_0x26f3('0x8')](),controller['getConfigurations']);router[_0x26f3('0x7')](_0x26f3('0xb'),auth[_0x26f3('0x8')](),controller[_0x26f3('0xc')]);router['post']('/',auth[_0x26f3('0x8')](),controller[_0x26f3('0xd')]);router[_0x26f3('0xe')](_0x26f3('0xa'),auth[_0x26f3('0x8')](),controller['addConfiguration']);router[_0x26f3('0xf')](_0x26f3('0x10'),auth[_0x26f3('0x8')](),controller[_0x26f3('0x11')]);router[_0x26f3('0x12')](_0x26f3('0x10'),auth['isAuthenticated'](),controller[_0x26f3('0x13')]);module[_0x26f3('0x14')]=router;
\ No newline at end of file
index 2c300a4..366ab01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfef3=['sequelize','STRING','username','remoteUri'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xfef3,0x118));var _0x3fef=function(_0x2fdbda,_0x2e4f89){_0x2fdbda=_0x2fdbda-0x0;var _0x24896b=_0xfef3[_0x2fdbda];return _0x24896b;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xef0f=['sequelize','STRING','remoteUri'];(function(_0x1557bc,_0x155b39){var _0x563ed2=function(_0x3064b6){while(--_0x3064b6){_0x1557bc['push'](_0x1557bc['shift']());}};_0x563ed2(++_0x155b39);}(_0xef0f,0x168));var _0xfef0=function(_0x3bdcdd,_0x4fc294){_0x3bdcdd=_0x3bdcdd-0x0;var _0x83cce5=_0xef0f[_0x3bdcdd];return _0x83cce5;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfef0('0x1')]},'remoteUri':{'type':Sequelize[_0xfef0('0x1')],'unique':_0xfef0('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 56bcc36..aee435e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8696=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy','error','stack','name','send','map','FreshdeskAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','rawAttributes','keys','length','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','substring','GET','format','api/v2/ticket_fields','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x8696,0x143));var _0x6869=function(_0x554576,_0x36ec1f){_0x554576=_0x554576-0x0;var _0x3c69ff=_0x8696[_0x554576];return _0x3c69ff;};'use strict';var emlformat=require(_0x6869('0x0'));var rimraf=require(_0x6869('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6869('0x2'));var rp=require('request-promise');var moment=require(_0x6869('0x3'));var BPromise=require(_0x6869('0x4'));var Mustache=require(_0x6869('0x5'));var util=require('util');var path=require(_0x6869('0x6'));var sox=require('sox');var csv=require(_0x6869('0x7'));var ejs=require(_0x6869('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6869('0x9'));var crypto=require(_0x6869('0xa'));var jsforce=require(_0x6869('0xb'));var deskjs=require(_0x6869('0xc'));var toCsv=require(_0x6869('0x7'));var querystring=require(_0x6869('0xd'));var Papa=require(_0x6869('0xe'));var Redis=require('ioredis');var authService=require(_0x6869('0xf'));var qs=require(_0x6869('0x10'));var as=require(_0x6869('0x11'));var hardwareService=require(_0x6869('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6869('0x13'));var licenseUtil=require(_0x6869('0x14'));var db=require(_0x6869('0x15'))['db'];var integrations=require(_0x6869('0x16'));function respondWithStatusCode(_0x42958f,_0x5936ef){_0x5936ef=_0x5936ef||0xcc;return function(_0x1553e1){if(_0x1553e1){return _0x42958f[_0x6869('0x17')](_0x5936ef);}return _0x42958f['status'](_0x5936ef)[_0x6869('0x18')]();};}function respondWithResult(_0x3d5c59,_0x1fda61){_0x1fda61=_0x1fda61||0xc8;return function(_0x4b00f7){if(_0x4b00f7){return _0x3d5c59[_0x6869('0x19')](_0x1fda61)['json'](_0x4b00f7);}};}function respondWithFilteredResult(_0x16f86f,_0x4e5705){return function(_0x143f04){if(_0x143f04){var _0x2df0fc=typeof _0x4e5705[_0x6869('0x1a')]===_0x6869('0x1b')&&typeof _0x4e5705['limit']===_0x6869('0x1b');var _0x353f6d=_0x143f04[_0x6869('0x1c')];var _0x4e2905=_0x2df0fc?0x0:_0x4e5705[_0x6869('0x1a')];var _0xdb1f89=_0x2df0fc?_0x143f04['count']:_0x4e5705['offset']+_0x4e5705[_0x6869('0x1d')];var _0x56b4f6;if(_0xdb1f89>=_0x353f6d){_0xdb1f89=_0x353f6d;_0x56b4f6=0xc8;}else{_0x56b4f6=0xce;}_0x16f86f[_0x6869('0x19')](_0x56b4f6);return _0x16f86f[_0x6869('0x1e')]('Content-Range',_0x4e2905+'-'+_0xdb1f89+'/'+_0x353f6d)[_0x6869('0x1f')](_0x143f04);}return null;};}function patchUpdates(_0x18b29e){return function(_0x4a487e){try{jsonpatch[_0x6869('0x20')](_0x4a487e,_0x18b29e,!![]);}catch(_0x23a989){return BPromise[_0x6869('0x21')](_0x23a989);}return _0x4a487e[_0x6869('0x22')]();};}function saveUpdates(_0xb775a7,_0x22c5cf){return function(_0x52efb9){if(_0x52efb9){return _0x52efb9['update'](_0xb775a7)[_0x6869('0x23')](function(_0x1dc71e){return _0x1dc71e;});}return null;};}function removeEntity(_0x35f962,_0x4e37ff){return function(_0x49bbce){if(_0x49bbce){return _0x49bbce[_0x6869('0x24')]()[_0x6869('0x23')](function(){_0x35f962['status'](0xcc)[_0x6869('0x18')]();});}};}function handleEntityNotFound(_0x2daf47,_0x1c82c6){return function(_0x5cd27e){if(!_0x5cd27e){_0x2daf47['sendStatus'](0x194);}return _0x5cd27e;};}function handleError(_0x2da99d,_0xceb447){_0xceb447=_0xceb447||0x1f4;return function(_0x4e5f3b){logger[_0x6869('0x25')](_0x4e5f3b[_0x6869('0x26')]);if(_0x4e5f3b[_0x6869('0x27')]){delete _0x4e5f3b[_0x6869('0x27')];}_0x2da99d[_0x6869('0x19')](_0xceb447)[_0x6869('0x28')](_0x4e5f3b);};}exports['index']=function(_0x4825ca,_0x39bb7e){var _0x1bfba2={},_0x138da8={},_0x21240f={'count':0x0,'rows':[]};var _0x253ade=_[_0x6869('0x29')](db[_0x6869('0x2a')]['rawAttributes'],function(_0x389166){return{'name':_0x389166[_0x6869('0x2b')],'type':_0x389166[_0x6869('0x2c')][_0x6869('0x2d')]};});_0x138da8[_0x6869('0x2e')]=_[_0x6869('0x29')](_0x253ade,_0x6869('0x27'));_0x138da8['query']=_['keys'](_0x4825ca[_0x6869('0x2f')]);_0x138da8[_0x6869('0x30')]=_[_0x6869('0x31')](_0x138da8[_0x6869('0x2e')],_0x138da8['query']);_0x1bfba2[_0x6869('0x32')]=_[_0x6869('0x31')](_0x138da8[_0x6869('0x2e')],qs[_0x6869('0x33')](_0x4825ca[_0x6869('0x2f')][_0x6869('0x33')]));_0x1bfba2[_0x6869('0x32')]=_0x1bfba2[_0x6869('0x32')]['length']?_0x1bfba2[_0x6869('0x32')]:_0x138da8[_0x6869('0x2e')];if(!_0x4825ca[_0x6869('0x2f')][_0x6869('0x34')](_0x6869('0x35'))){_0x1bfba2['limit']=qs['limit'](_0x4825ca[_0x6869('0x2f')][_0x6869('0x1d')]);_0x1bfba2['offset']=qs[_0x6869('0x1a')](_0x4825ca['query'][_0x6869('0x1a')]);}_0x1bfba2[_0x6869('0x36')]=qs[_0x6869('0x37')](_0x4825ca['query']['sort']);_0x1bfba2[_0x6869('0x38')]=qs[_0x6869('0x30')](_[_0x6869('0x39')](_0x4825ca['query'],_0x138da8['filters']),_0x253ade);if(_0x4825ca[_0x6869('0x2f')][_0x6869('0x3a')]){_0x1bfba2[_0x6869('0x38')]=_[_0x6869('0x3b')](_0x1bfba2[_0x6869('0x38')],{'$or':_[_0x6869('0x29')](_0x253ade,function(_0x2bbb55){if(_0x2bbb55[_0x6869('0x2c')]!==_0x6869('0x3c')){var _0x1c1407={};_0x1c1407[_0x2bbb55[_0x6869('0x27')]]={'$like':'%'+_0x4825ca[_0x6869('0x2f')][_0x6869('0x3a')]+'%'};return _0x1c1407;}})});}_0x1bfba2=_[_0x6869('0x3b')]({},_0x1bfba2,_0x4825ca[_0x6869('0x3d')]);var _0x23470f={'where':_0x1bfba2[_0x6869('0x38')]};return db[_0x6869('0x2a')]['count'](_0x23470f)[_0x6869('0x23')](function(_0x4021dd){_0x21240f[_0x6869('0x1c')]=_0x4021dd;if(_0x4825ca[_0x6869('0x2f')][_0x6869('0x3e')]){_0x1bfba2[_0x6869('0x3f')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x6869('0x40')](_0x1bfba2);})[_0x6869('0x23')](function(_0x41a708){_0x21240f['rows']=_0x41a708;return _0x21240f;})['then'](respondWithFilteredResult(_0x39bb7e,_0x1bfba2))[_0x6869('0x41')](handleError(_0x39bb7e,null));};exports['show']=function(_0x419ef2,_0x18faae){var _0x462a4f={'raw':![],'where':{'id':_0x419ef2['params']['id']}},_0x2df26c={};_0x2df26c[_0x6869('0x2e')]=_['keys'](db[_0x6869('0x2a')][_0x6869('0x42')]);_0x2df26c[_0x6869('0x2f')]=_[_0x6869('0x43')](_0x419ef2[_0x6869('0x2f')]);_0x2df26c[_0x6869('0x30')]=_[_0x6869('0x31')](_0x2df26c[_0x6869('0x2e')],_0x2df26c[_0x6869('0x2f')]);_0x462a4f[_0x6869('0x32')]=_['intersection'](_0x2df26c[_0x6869('0x2e')],qs[_0x6869('0x33')](_0x419ef2['query']['fields']));_0x462a4f[_0x6869('0x32')]=_0x462a4f[_0x6869('0x32')][_0x6869('0x44')]?_0x462a4f[_0x6869('0x32')]:_0x2df26c[_0x6869('0x2e')];if(_0x419ef2['query'][_0x6869('0x3e')]){_0x462a4f[_0x6869('0x3f')]=[{'all':!![]}];}_0x462a4f=_[_0x6869('0x3b')]({},_0x462a4f,_0x419ef2['options']);return db[_0x6869('0x2a')][_0x6869('0x45')](_0x462a4f)[_0x6869('0x23')](handleEntityNotFound(_0x18faae,null))[_0x6869('0x23')](respondWithResult(_0x18faae,null))[_0x6869('0x41')](handleError(_0x18faae,null));};exports[_0x6869('0x46')]=function(_0x153633,_0x2f36d7){return db[_0x6869('0x2a')][_0x6869('0x46')](_0x153633[_0x6869('0x47')],{})[_0x6869('0x23')](respondWithResult(_0x2f36d7,0xc9))[_0x6869('0x41')](handleError(_0x2f36d7,null));};exports['update']=function(_0x1b8109,_0x419711){if(_0x1b8109[_0x6869('0x47')]['id']){delete _0x1b8109['body']['id'];}return db[_0x6869('0x2a')][_0x6869('0x45')]({'where':{'id':_0x1b8109['params']['id']}})['then'](handleEntityNotFound(_0x419711,null))[_0x6869('0x23')](saveUpdates(_0x1b8109[_0x6869('0x47')],null))['then'](respondWithResult(_0x419711,null))[_0x6869('0x41')](handleError(_0x419711,null));};exports[_0x6869('0x24')]=function(_0x5d3ba4,_0x1e7b44){return db[_0x6869('0x2a')][_0x6869('0x45')]({'where':{'id':_0x5d3ba4[_0x6869('0x48')]['id']}})[_0x6869('0x23')](handleEntityNotFound(_0x1e7b44,null))[_0x6869('0x23')](removeEntity(_0x1e7b44,null))[_0x6869('0x41')](handleError(_0x1e7b44,null));};exports[_0x6869('0x49')]=function(_0x2d5c08,_0x37802c,_0x1e3595){var _0xff24={};var _0x100242={};var _0x11c780;var _0x57aee8;return db[_0x6869('0x2a')][_0x6869('0x4a')]({'where':{'id':_0x2d5c08['params']['id']}})['then'](handleEntityNotFound(_0x37802c,null))[_0x6869('0x23')](function(_0x8f4072){if(_0x8f4072){_0x11c780=_0x8f4072;_0x100242[_0x6869('0x2e')]=_['keys'](db[_0x6869('0x4b')]['rawAttributes']);_0x100242[_0x6869('0x2f')]=_['keys'](_0x2d5c08[_0x6869('0x2f')]);_0x100242[_0x6869('0x30')]=_['intersection'](_0x100242[_0x6869('0x2e')],_0x100242['query']);_0xff24['attributes']=_[_0x6869('0x31')](_0x100242[_0x6869('0x2e')],qs[_0x6869('0x33')](_0x2d5c08[_0x6869('0x2f')]['fields']));_0xff24[_0x6869('0x32')]=_0xff24[_0x6869('0x32')][_0x6869('0x44')]?_0xff24['attributes']:_0x100242[_0x6869('0x2e')];_0xff24[_0x6869('0x36')]=qs[_0x6869('0x37')](_0x2d5c08['query'][_0x6869('0x37')]);_0xff24[_0x6869('0x38')]=qs[_0x6869('0x30')](_[_0x6869('0x39')](_0x2d5c08['query'],_0x100242[_0x6869('0x30')]));if(_0x2d5c08[_0x6869('0x2f')][_0x6869('0x3a')]){_0xff24[_0x6869('0x38')]=_[_0x6869('0x3b')](_0xff24[_0x6869('0x38')],{'$or':_[_0x6869('0x29')](_0xff24[_0x6869('0x32')],function(_0x1ca72c){var _0x2c658b={};_0x2c658b[_0x1ca72c]={'$like':'%'+_0x2d5c08[_0x6869('0x2f')][_0x6869('0x3a')]+'%'};return _0x2c658b;})});}_0xff24=_[_0x6869('0x3b')]({},_0xff24,_0x2d5c08[_0x6869('0x3d')]);return _0x11c780[_0x6869('0x49')](_0xff24);}})[_0x6869('0x23')](function(_0x39c259){if(_0x39c259){_0x57aee8=_0x39c259[_0x6869('0x44')];if(!_0x2d5c08[_0x6869('0x2f')][_0x6869('0x34')](_0x6869('0x35'))){_0xff24[_0x6869('0x1d')]=qs['limit'](_0x2d5c08[_0x6869('0x2f')]['limit']);_0xff24[_0x6869('0x1a')]=qs[_0x6869('0x1a')](_0x2d5c08[_0x6869('0x2f')][_0x6869('0x1a')]);}return _0x11c780[_0x6869('0x49')](_0xff24);}})[_0x6869('0x23')](function(_0x127007){if(_0x127007){return _0x127007?{'count':_0x57aee8,'rows':_0x127007}:null;}})[_0x6869('0x23')](respondWithResult(_0x37802c,null))[_0x6869('0x41')](handleError(_0x37802c,null));};exports[_0x6869('0x4c')]=function(_0x920e01,_0x503d01,_0x3ac2ab){if(_0x920e01[_0x6869('0x47')]['id']){delete _0x920e01[_0x6869('0x47')]['id'];}return db[_0x6869('0x2a')][_0x6869('0x4a')]({'where':{'id':_0x920e01['params']['id']}})[_0x6869('0x23')](handleEntityNotFound(_0x503d01,null))[_0x6869('0x23')](function(_0x3afc72){if(_0x3afc72){_0x920e01[_0x6869('0x47')][_0x6869('0x4d')]=_0x3afc72['id'];_0x920e01['body']['Subjects']=integrations[_0x6869('0x4e')](_0x920e01[_0x6869('0x47')][_0x6869('0x4f')],_0x920e01[_0x6869('0x47')][_0x6869('0x2c')]);_0x920e01[_0x6869('0x47')][_0x6869('0x50')]=integrations[_0x6869('0x51')](_0x920e01[_0x6869('0x47')][_0x6869('0x4f')],_0x920e01[_0x6869('0x47')]['type']);return db[_0x6869('0x4b')]['create'](_0x920e01['body'],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db[_0x6869('0x52')],'as':_0x6869('0x50')}]});}return null;})[_0x6869('0x23')](respondWithResult(_0x503d01,null))[_0x6869('0x41')](handleError(_0x503d01,null));};exports[_0x6869('0x53')]=function(_0x3ce1cf,_0x29282b,_0xb3a48c){var _0x319e48='';return db[_0x6869('0x2a')]['findOne']({'where':{'id':_0x3ce1cf[_0x6869('0x48')]['id']},'attributes':['id',_0x6869('0x54'),_0x6869('0x55')]})[_0x6869('0x23')](handleEntityNotFound(_0x29282b,null))[_0x6869('0x23')](function(_0x5d6c53){if(_0x5d6c53){_0x319e48=_0x5d6c53[_0x6869('0x54')];var _0xdba807=_0x319e48['slice'](-0x1);if(_0xdba807==='/'){_0x319e48=_0x319e48[_0x6869('0x56')](0x0,_0x319e48['lastIndexOf'](_0xdba807));}return rp({'method':_0x6869('0x57'),'uri':util[_0x6869('0x58')]('%s/%s',_0x319e48,_0x6869('0x59')),'headers':{'Authorization':util[_0x6869('0x58')]('Basic\x20%s',new Buffer(util['format'](_0x6869('0x5a'),_0x5d6c53[_0x6869('0x55')]))[_0x6869('0x5b')](_0x6869('0x5c')))},'json':!![]});}})[_0x6869('0x23')](function(_0x3a330c){if(_0x3a330c){var _0x5ad223=[_0x6869('0x5d'),_0x6869('0x5e'),_0x6869('0x5f'),_0x6869('0x60'),_0x6869('0x19'),_0x6869('0x61'),_0x6869('0x62'),_0x6869('0x63'),_0x6869('0x64'),_0x6869('0x62'),_0x6869('0x65')];_['remove'](_0x3a330c,function(_0x40e913){return _0x5ad223[_0x6869('0x66')](_0x40e913[_0x6869('0x27')])||!_0x40e913[_0x6869('0x67')]&&_0x40e913[_0x6869('0x2c')]!==_0x6869('0x68')&&_0x40e913['type']!==_0x6869('0x69');});return{'count':_0x3a330c[_0x6869('0x44')],'rows':_[_0x6869('0x29')](_0x3a330c,function(_0x291f32){return{'id':_0x291f32[_0x6869('0x27')],'name':_0x291f32[_0x6869('0x6a')],'custom':!_0x291f32[_0x6869('0x67')],'options':_0x291f32[_0x6869('0x6b')]?_[_0x6869('0x29')](_0x291f32[_0x6869('0x6b')],function(_0x1d66d7){return{'name':_[_0x6869('0x6c')](_0x1d66d7),'value':_0x1d66d7};}):[]};})};}})['then'](respondWithResult(_0x29282b,null))[_0x6869('0x41')](function(_0x38e6e9){var _0x28c4cc=_0x3ce1cf['query']['test']?0x1f4:_0x38e6e9[_0x6869('0x6d')]||0x1f4;logger[_0x6869('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x6869('0x53'),_0x28c4cc,JSON[_0x6869('0x6e')](_0x38e6e9));delete _0x38e6e9[_0x6869('0x27')];if(_0x28c4cc===0x191){_0x28c4cc=0x190;}_0x29282b[_0x6869('0x19')](_0x28c4cc)[_0x6869('0x28')](_0x3ce1cf['query'][_0x6869('0x6f')]?{'message':_0x6869('0x70'),'statusCode':_0x38e6e9[_0x6869('0x6d')]}:_0x38e6e9);});};
\ No newline at end of file
+var _0xa446=['offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshdeskAccount','rawAttributes','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','params','options','catch','create','find','body','getConfigurations','FreshdeskConfiguration','order','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','toString','base64','subject','agent','description','priority','group','ticket_type','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','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/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end'];(function(_0xf9e9fa,_0x2fb3fd){var _0x3bd521=function(_0x962a9a){while(--_0x962a9a){_0xf9e9fa['push'](_0xf9e9fa['shift']());}};_0x3bd521(++_0x2fb3fd);}(_0xa446,0xc6));var _0x6a44=function(_0x159934,_0x3fd0c0){_0x159934=_0x159934-0x0;var _0x4e97c7=_0xa446[_0x159934];return _0x4e97c7;};'use strict';var emlformat=require(_0x6a44('0x0'));var rimraf=require(_0x6a44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a44('0x2'));var rp=require('request-promise');var moment=require(_0x6a44('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a44('0x4'));var util=require('util');var path=require(_0x6a44('0x5'));var sox=require(_0x6a44('0x6'));var csv=require(_0x6a44('0x7'));var ejs=require(_0x6a44('0x8'));var fs=require('fs');var fs_extra=require(_0x6a44('0x9'));var _=require(_0x6a44('0xa'));var squel=require('squel');var crypto=require(_0x6a44('0xb'));var jsforce=require(_0x6a44('0xc'));var deskjs=require(_0x6a44('0xd'));var toCsv=require(_0x6a44('0x7'));var querystring=require(_0x6a44('0xe'));var Papa=require('papaparse');var Redis=require(_0x6a44('0xf'));var authService=require(_0x6a44('0x10'));var qs=require(_0x6a44('0x11'));var as=require(_0x6a44('0x12'));var hardwareService=require(_0x6a44('0x13'));var logger=require(_0x6a44('0x14'))(_0x6a44('0x15'));var utils=require('../../config/utils');var config=require(_0x6a44('0x16'));var licenseUtil=require(_0x6a44('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6a44('0x18'));function respondWithStatusCode(_0x1e0639,_0x21ce4a){_0x21ce4a=_0x21ce4a||0xcc;return function(_0x491c1c){if(_0x491c1c){return _0x1e0639[_0x6a44('0x19')](_0x21ce4a);}return _0x1e0639[_0x6a44('0x1a')](_0x21ce4a)[_0x6a44('0x1b')]();};}function respondWithResult(_0xb1d987,_0x156a27){_0x156a27=_0x156a27||0xc8;return function(_0x1481ed){if(_0x1481ed){return _0xb1d987['status'](_0x156a27)['json'](_0x1481ed);}};}function respondWithFilteredResult(_0x260be6,_0x973938){return function(_0x577275){if(_0x577275){var _0xa665c0=typeof _0x973938[_0x6a44('0x1c')]===_0x6a44('0x1d')&&typeof _0x973938[_0x6a44('0x1e')]===_0x6a44('0x1d');var _0x1e1de0=_0x577275[_0x6a44('0x1f')];var _0x6054d3=_0xa665c0?0x0:_0x973938[_0x6a44('0x1c')];var _0x25a47c=_0xa665c0?_0x577275[_0x6a44('0x1f')]:_0x973938[_0x6a44('0x1c')]+_0x973938[_0x6a44('0x1e')];var _0x108c4b;if(_0x25a47c>=_0x1e1de0){_0x25a47c=_0x1e1de0;_0x108c4b=0xc8;}else{_0x108c4b=0xce;}_0x260be6['status'](_0x108c4b);return _0x260be6['set']('Content-Range',_0x6054d3+'-'+_0x25a47c+'/'+_0x1e1de0)[_0x6a44('0x20')](_0x577275);}return null;};}function patchUpdates(_0x19410f){return function(_0x2ef3cf){try{jsonpatch[_0x6a44('0x21')](_0x2ef3cf,_0x19410f,!![]);}catch(_0x4bde4d){return BPromise[_0x6a44('0x22')](_0x4bde4d);}return _0x2ef3cf[_0x6a44('0x23')]();};}function saveUpdates(_0x528afe,_0xebf7d6){return function(_0x24c04a){if(_0x24c04a){return _0x24c04a[_0x6a44('0x24')](_0x528afe)[_0x6a44('0x25')](function(_0x21a25c){return _0x21a25c;});}return null;};}function removeEntity(_0x12e6fb,_0x178b35){return function(_0x1650fe){if(_0x1650fe){return _0x1650fe[_0x6a44('0x26')]()['then'](function(){_0x12e6fb[_0x6a44('0x1a')](0xcc)[_0x6a44('0x1b')]();});}};}function handleEntityNotFound(_0x466c54,_0x36b027){return function(_0x499e87){if(!_0x499e87){_0x466c54[_0x6a44('0x19')](0x194);}return _0x499e87;};}function handleError(_0x4ee88c,_0x3ad23e){_0x3ad23e=_0x3ad23e||0x1f4;return function(_0x596a12){logger[_0x6a44('0x27')](_0x596a12[_0x6a44('0x28')]);if(_0x596a12[_0x6a44('0x29')]){delete _0x596a12[_0x6a44('0x29')];}_0x4ee88c[_0x6a44('0x1a')](_0x3ad23e)[_0x6a44('0x2a')](_0x596a12);};}exports[_0x6a44('0x2b')]=function(_0x5b81ce,_0x4a5eab){var _0x265f9d={},_0x5abc23={},_0xaef746={'count':0x0,'rows':[]};var _0x5b46cd=_['map'](db[_0x6a44('0x2c')][_0x6a44('0x2d')],function(_0x3454a7){return{'name':_0x3454a7['fieldName'],'type':_0x3454a7[_0x6a44('0x2e')]['key']};});_0x5abc23[_0x6a44('0x2f')]=_[_0x6a44('0x30')](_0x5b46cd,'name');_0x5abc23['query']=_[_0x6a44('0x31')](_0x5b81ce[_0x6a44('0x32')]);_0x5abc23[_0x6a44('0x33')]=_['intersection'](_0x5abc23['model'],_0x5abc23[_0x6a44('0x32')]);_0x265f9d[_0x6a44('0x34')]=_[_0x6a44('0x35')](_0x5abc23['model'],qs[_0x6a44('0x36')](_0x5b81ce[_0x6a44('0x32')][_0x6a44('0x36')]));_0x265f9d[_0x6a44('0x34')]=_0x265f9d[_0x6a44('0x34')][_0x6a44('0x37')]?_0x265f9d[_0x6a44('0x34')]:_0x5abc23[_0x6a44('0x2f')];if(!_0x5b81ce[_0x6a44('0x32')][_0x6a44('0x38')](_0x6a44('0x39'))){_0x265f9d[_0x6a44('0x1e')]=qs['limit'](_0x5b81ce[_0x6a44('0x32')]['limit']);_0x265f9d['offset']=qs['offset'](_0x5b81ce['query'][_0x6a44('0x1c')]);}_0x265f9d['order']=qs[_0x6a44('0x3a')](_0x5b81ce['query'][_0x6a44('0x3a')]);_0x265f9d[_0x6a44('0x3b')]=qs['filters'](_['pick'](_0x5b81ce[_0x6a44('0x32')],_0x5abc23[_0x6a44('0x33')]),_0x5b46cd);if(_0x5b81ce[_0x6a44('0x32')][_0x6a44('0x3c')]){_0x265f9d['where']=_[_0x6a44('0x3d')](_0x265f9d[_0x6a44('0x3b')],{'$or':_[_0x6a44('0x30')](_0x5b46cd,function(_0x4738cb){if(_0x4738cb[_0x6a44('0x2e')]!==_0x6a44('0x3e')){var _0x56c05c={};_0x56c05c[_0x4738cb[_0x6a44('0x29')]]={'$like':'%'+_0x5b81ce[_0x6a44('0x32')]['filter']+'%'};return _0x56c05c;}})});}_0x265f9d=_[_0x6a44('0x3d')]({},_0x265f9d,_0x5b81ce['options']);var _0xcd852f={'where':_0x265f9d['where']};return db[_0x6a44('0x2c')][_0x6a44('0x1f')](_0xcd852f)[_0x6a44('0x25')](function(_0x7b1ca6){_0xaef746[_0x6a44('0x1f')]=_0x7b1ca6;if(_0x5b81ce['query'][_0x6a44('0x3f')]){_0x265f9d[_0x6a44('0x40')]=[{'all':!![]}];}return db[_0x6a44('0x2c')]['findAll'](_0x265f9d);})[_0x6a44('0x25')](function(_0x2cf9cb){_0xaef746['rows']=_0x2cf9cb;return _0xaef746;})['then'](respondWithFilteredResult(_0x4a5eab,_0x265f9d))['catch'](handleError(_0x4a5eab,null));};exports['show']=function(_0xea4abf,_0xcdb39){var _0x21ba45={'raw':![],'where':{'id':_0xea4abf[_0x6a44('0x41')]['id']}},_0x18315e={};_0x18315e['model']=_['keys'](db[_0x6a44('0x2c')][_0x6a44('0x2d')]);_0x18315e[_0x6a44('0x32')]=_['keys'](_0xea4abf[_0x6a44('0x32')]);_0x18315e[_0x6a44('0x33')]=_[_0x6a44('0x35')](_0x18315e['model'],_0x18315e[_0x6a44('0x32')]);_0x21ba45[_0x6a44('0x34')]=_[_0x6a44('0x35')](_0x18315e[_0x6a44('0x2f')],qs[_0x6a44('0x36')](_0xea4abf[_0x6a44('0x32')][_0x6a44('0x36')]));_0x21ba45[_0x6a44('0x34')]=_0x21ba45['attributes'][_0x6a44('0x37')]?_0x21ba45[_0x6a44('0x34')]:_0x18315e[_0x6a44('0x2f')];if(_0xea4abf[_0x6a44('0x32')][_0x6a44('0x3f')]){_0x21ba45[_0x6a44('0x40')]=[{'all':!![]}];}_0x21ba45=_[_0x6a44('0x3d')]({},_0x21ba45,_0xea4abf[_0x6a44('0x42')]);return db[_0x6a44('0x2c')]['find'](_0x21ba45)[_0x6a44('0x25')](handleEntityNotFound(_0xcdb39,null))[_0x6a44('0x25')](respondWithResult(_0xcdb39,null))[_0x6a44('0x43')](handleError(_0xcdb39,null));};exports[_0x6a44('0x44')]=function(_0x620eb6,_0x215b77){return db[_0x6a44('0x2c')][_0x6a44('0x44')](_0x620eb6['body'],{})[_0x6a44('0x25')](respondWithResult(_0x215b77,0xc9))[_0x6a44('0x43')](handleError(_0x215b77,null));};exports[_0x6a44('0x24')]=function(_0x4dce0f,_0x151681){if(_0x4dce0f['body']['id']){delete _0x4dce0f['body']['id'];}return db[_0x6a44('0x2c')][_0x6a44('0x45')]({'where':{'id':_0x4dce0f['params']['id']}})['then'](handleEntityNotFound(_0x151681,null))[_0x6a44('0x25')](saveUpdates(_0x4dce0f[_0x6a44('0x46')],null))['then'](respondWithResult(_0x151681,null))[_0x6a44('0x43')](handleError(_0x151681,null));};exports['destroy']=function(_0x18f09a,_0x434ded){return db[_0x6a44('0x2c')]['find']({'where':{'id':_0x18f09a['params']['id']}})['then'](handleEntityNotFound(_0x434ded,null))['then'](removeEntity(_0x434ded,null))[_0x6a44('0x43')](handleError(_0x434ded,null));};exports[_0x6a44('0x47')]=function(_0x428a08,_0x21b457,_0x213478){var _0x598d7a={};var _0x288224={};var _0x560ab2;var _0x28855c;return db[_0x6a44('0x2c')]['findOne']({'where':{'id':_0x428a08[_0x6a44('0x41')]['id']}})[_0x6a44('0x25')](handleEntityNotFound(_0x21b457,null))['then'](function(_0x39774a){if(_0x39774a){_0x560ab2=_0x39774a;_0x288224[_0x6a44('0x2f')]=_[_0x6a44('0x31')](db[_0x6a44('0x48')][_0x6a44('0x2d')]);_0x288224[_0x6a44('0x32')]=_[_0x6a44('0x31')](_0x428a08[_0x6a44('0x32')]);_0x288224[_0x6a44('0x33')]=_[_0x6a44('0x35')](_0x288224['model'],_0x288224[_0x6a44('0x32')]);_0x598d7a['attributes']=_[_0x6a44('0x35')](_0x288224[_0x6a44('0x2f')],qs[_0x6a44('0x36')](_0x428a08[_0x6a44('0x32')][_0x6a44('0x36')]));_0x598d7a['attributes']=_0x598d7a[_0x6a44('0x34')][_0x6a44('0x37')]?_0x598d7a[_0x6a44('0x34')]:_0x288224[_0x6a44('0x2f')];_0x598d7a[_0x6a44('0x49')]=qs[_0x6a44('0x3a')](_0x428a08[_0x6a44('0x32')][_0x6a44('0x3a')]);_0x598d7a[_0x6a44('0x3b')]=qs[_0x6a44('0x33')](_[_0x6a44('0x4a')](_0x428a08['query'],_0x288224[_0x6a44('0x33')]));if(_0x428a08[_0x6a44('0x32')][_0x6a44('0x3c')]){_0x598d7a[_0x6a44('0x3b')]=_[_0x6a44('0x3d')](_0x598d7a[_0x6a44('0x3b')],{'$or':_[_0x6a44('0x30')](_0x598d7a[_0x6a44('0x34')],function(_0x276625){var _0x4fabb8={};_0x4fabb8[_0x276625]={'$like':'%'+_0x428a08[_0x6a44('0x32')][_0x6a44('0x3c')]+'%'};return _0x4fabb8;})});}_0x598d7a=_[_0x6a44('0x3d')]({},_0x598d7a,_0x428a08[_0x6a44('0x42')]);return _0x560ab2['getConfigurations'](_0x598d7a);}})[_0x6a44('0x25')](function(_0x1c3350){if(_0x1c3350){_0x28855c=_0x1c3350[_0x6a44('0x37')];if(!_0x428a08['query'][_0x6a44('0x38')]('nolimit')){_0x598d7a['limit']=qs[_0x6a44('0x1e')](_0x428a08[_0x6a44('0x32')][_0x6a44('0x1e')]);_0x598d7a[_0x6a44('0x1c')]=qs[_0x6a44('0x1c')](_0x428a08['query'][_0x6a44('0x1c')]);}return _0x560ab2[_0x6a44('0x47')](_0x598d7a);}})['then'](function(_0x4abebd){if(_0x4abebd){return _0x4abebd?{'count':_0x28855c,'rows':_0x4abebd}:null;}})[_0x6a44('0x25')](respondWithResult(_0x21b457,null))[_0x6a44('0x43')](handleError(_0x21b457,null));};exports[_0x6a44('0x4b')]=function(_0x2aaea3,_0x5e02ed,_0x214529){if(_0x2aaea3[_0x6a44('0x46')]['id']){delete _0x2aaea3['body']['id'];}return db['FreshdeskAccount'][_0x6a44('0x4c')]({'where':{'id':_0x2aaea3[_0x6a44('0x41')]['id']}})[_0x6a44('0x25')](handleEntityNotFound(_0x5e02ed,null))['then'](function(_0x252ea4){if(_0x252ea4){_0x2aaea3[_0x6a44('0x46')][_0x6a44('0x4d')]=_0x252ea4['id'];_0x2aaea3[_0x6a44('0x46')][_0x6a44('0x4e')]=integrations[_0x6a44('0x4f')](_0x2aaea3['body'][_0x6a44('0x50')],_0x2aaea3[_0x6a44('0x46')]['type']);_0x2aaea3[_0x6a44('0x46')][_0x6a44('0x51')]=integrations[_0x6a44('0x52')](_0x2aaea3['body']['channel'],_0x2aaea3[_0x6a44('0x46')][_0x6a44('0x2e')]);return db['FreshdeskConfiguration'][_0x6a44('0x44')](_0x2aaea3['body'],{'include':[{'model':db[_0x6a44('0x53')],'as':_0x6a44('0x4e')},{'model':db[_0x6a44('0x53')],'as':_0x6a44('0x51')}]});}return null;})['then'](respondWithResult(_0x5e02ed,null))['catch'](handleError(_0x5e02ed,null));};exports[_0x6a44('0x54')]=function(_0x46dbe5,_0x46a77a,_0x229bc4){var _0x230932='';return db[_0x6a44('0x2c')][_0x6a44('0x4c')]({'where':{'id':_0x46dbe5[_0x6a44('0x41')]['id']},'attributes':['id',_0x6a44('0x55'),_0x6a44('0x56')]})[_0x6a44('0x25')](handleEntityNotFound(_0x46a77a,null))[_0x6a44('0x25')](function(_0x19de84){if(_0x19de84){_0x230932=_0x19de84[_0x6a44('0x55')];var _0x1490be=_0x230932[_0x6a44('0x57')](-0x1);if(_0x1490be==='/'){_0x230932=_0x230932[_0x6a44('0x58')](0x0,_0x230932[_0x6a44('0x59')](_0x1490be));}return rp({'method':_0x6a44('0x5a'),'uri':util[_0x6a44('0x5b')]('%s/%s',_0x230932,_0x6a44('0x5c')),'headers':{'Authorization':util[_0x6a44('0x5b')](_0x6a44('0x5d'),new Buffer(util[_0x6a44('0x5b')]('%s:X',_0x19de84[_0x6a44('0x56')]))[_0x6a44('0x5e')](_0x6a44('0x5f')))},'json':!![]});}})[_0x6a44('0x25')](function(_0x436833){if(_0x436833){var _0x3c1561=['requester',_0x6a44('0x60'),_0x6a44('0x61'),_0x6a44('0x62'),_0x6a44('0x1a'),_0x6a44('0x63'),_0x6a44('0x64'),'source',_0x6a44('0x65'),_0x6a44('0x64'),'company'];_[_0x6a44('0x66')](_0x436833,function(_0x463126){return _0x3c1561[_0x6a44('0x67')](_0x463126['name'])||!_0x463126[_0x6a44('0x68')]&&_0x463126['type']!==_0x6a44('0x69')&&_0x463126['type']!==_0x6a44('0x6a');});return{'count':_0x436833['length'],'rows':_[_0x6a44('0x30')](_0x436833,function(_0x457d9e){return{'id':_0x457d9e[_0x6a44('0x29')],'name':_0x457d9e['label'],'custom':!_0x457d9e['default'],'options':_0x457d9e[_0x6a44('0x6b')]?_[_0x6a44('0x30')](_0x457d9e[_0x6a44('0x6b')],function(_0x414c7){return{'name':_[_0x6a44('0x6c')](_0x414c7),'value':_0x414c7};}):[]};})};}})['then'](respondWithResult(_0x46a77a,null))[_0x6a44('0x43')](function(_0x40e621){var _0x26e3b2=_0x46dbe5[_0x6a44('0x32')][_0x6a44('0x6d')]?0x1f4:_0x40e621[_0x6a44('0x6e')]||0x1f4;logger[_0x6a44('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x6a44('0x54'),_0x26e3b2,JSON[_0x6a44('0x6f')](_0x40e621));delete _0x40e621[_0x6a44('0x29')];if(_0x26e3b2===0x191){_0x26e3b2=0x190;}_0x46a77a[_0x6a44('0x1a')](_0x26e3b2)[_0x6a44('0x2a')](_0x46dbe5[_0x6a44('0x32')][_0x6a44('0x6d')]?{'message':_0x6a44('0x70'),'statusCode':_0x40e621[_0x6a44('0x6e')]}:_0x40e621);});};
\ No newline at end of file
index 412254a..05ac6db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fae=['rimraf','../../config/environment','exports','define','int_freshdesk_accounts','lodash','moment','bluebird','request-promise','path'];(function(_0x44e600,_0x4f3e73){var _0x4d9d68=function(_0x344144){while(--_0x344144){_0x44e600['push'](_0x44e600['shift']());}};_0x4d9d68(++_0x4f3e73);}(_0x3fae,0x1c7));var _0xe3fa=function(_0x562cb9,_0x10be71){_0x562cb9=_0x562cb9-0x0;var _0x2231f5=_0x3fae[_0x562cb9];return _0x2231f5;};'use strict';var _=require(_0xe3fa('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe3fa('0x1'));var BPromise=require(_0xe3fa('0x2'));var rp=require(_0xe3fa('0x3'));var fs=require('fs');var path=require(_0xe3fa('0x4'));var rimraf=require(_0xe3fa('0x5'));var config=require(_0xe3fa('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xe3fa('0x7')]=function(_0x3b6cef,_0x14ad83){return _0x3b6cef[_0xe3fa('0x8')]('FreshdeskAccount',attributes,{'tableName':_0xe3fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb06=['moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','define','util','../../config/logger','api'];(function(_0x41d79d,_0x128b0f){var _0x4b4ace=function(_0x1f081a){while(--_0x1f081a){_0x41d79d['push'](_0x41d79d['shift']());}};_0x4b4ace(++_0x128b0f);}(_0xcb06,0x13c));var _0x6cb0=function(_0x1fe7e4,_0x5d39a4){_0x1fe7e4=_0x1fe7e4-0x0;var _0x4b3e54=_0xcb06[_0x1fe7e4];return _0x4b3e54;};'use strict';var _=require('lodash');var util=require(_0x6cb0('0x0'));var logger=require(_0x6cb0('0x1'))(_0x6cb0('0x2'));var moment=require(_0x6cb0('0x3'));var BPromise=require(_0x6cb0('0x4'));var rp=require(_0x6cb0('0x5'));var fs=require('fs');var path=require(_0x6cb0('0x6'));var rimraf=require('rimraf');var config=require(_0x6cb0('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x6cb0('0x8'));module[_0x6cb0('0x9')]=function(_0x183d5c,_0x2f4356){return _0x183d5c[_0x6cb0('0xa')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d0fc060..fcf2659 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cbb=['message','info','result','catch','findAll','options','where','limit','map','include','model','attributes','GetFreshdeskAccount','ShowFreshdeskAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x239193,_0x1585ef){var _0x4f51c3=function(_0x8eba2c){while(--_0x8eba2c){_0x239193['push'](_0x239193['shift']());}};_0x4f51c3(++_0x1585ef);}(_0x1cbb,0x105));var _0xb1cb=function(_0xc2ffd2,_0x35fd73){_0xc2ffd2=_0xc2ffd2-0x0;var _0x3c68e4=_0x1cbb[_0xc2ffd2];return _0x3c68e4;};'use strict';var _=require(_0xb1cb('0x0'));var util=require(_0xb1cb('0x1'));var moment=require(_0xb1cb('0x2'));var BPromise=require(_0xb1cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1cb('0x4'));var db=require(_0xb1cb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb1cb('0x6'));var config=require(_0xb1cb('0x7'));var jayson=require(_0xb1cb('0x8'));var client=jayson[_0xb1cb('0x9')][_0xb1cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41ec58,_0x4ab90d,_0x55c599){return new BPromise(function(_0x1105fd,_0x1043dc){return client['request'](_0x41ec58,_0x55c599)[_0xb1cb('0xb')](function(_0x39dc89){logger['info'](_0xb1cb('0xc'),_0x4ab90d,_0xb1cb('0xd'));logger[_0xb1cb('0xe')](_0xb1cb('0xf'),_0x4ab90d,_0xb1cb('0xd'),JSON[_0xb1cb('0x10')](_0x39dc89));if(_0x39dc89[_0xb1cb('0x11')]){if(_0x39dc89[_0xb1cb('0x11')][_0xb1cb('0x12')]===0x1f4){logger[_0xb1cb('0x11')](_0xb1cb('0xc'),_0x4ab90d,_0x39dc89['error'][_0xb1cb('0x13')]);return _0x1043dc(_0x39dc89[_0xb1cb('0x11')]['message']);}logger[_0xb1cb('0x11')](_0xb1cb('0xc'),_0x4ab90d,_0x39dc89['error'][_0xb1cb('0x13')]);return _0x1105fd(_0x39dc89['error']['message']);}else{logger[_0xb1cb('0x14')](_0xb1cb('0xc'),_0x4ab90d,_0xb1cb('0xd'));_0x1105fd(_0x39dc89[_0xb1cb('0x15')][_0xb1cb('0x13')]);}})[_0xb1cb('0x16')](function(_0x4662d8){logger[_0xb1cb('0x11')](_0xb1cb('0xc'),_0x4ab90d,_0x4662d8);_0x1043dc(_0x4662d8);});});}exports['GetFreshdeskAccount']=function(_0xa84e8c){var _0x3c3d20=this;return new Promise(function(_0xc286f2,_0x1ede87){return db['FreshdeskAccount'][_0xb1cb('0x17')]({'raw':_0xa84e8c['options']?_0xa84e8c[_0xb1cb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xa84e8c[_0xb1cb('0x18')]?_0xa84e8c[_0xb1cb('0x18')][_0xb1cb('0x19')]||null:null,'attributes':_0xa84e8c[_0xb1cb('0x18')]?_0xa84e8c['options']['attributes']||null:null,'limit':_0xa84e8c[_0xb1cb('0x18')]?_0xa84e8c[_0xb1cb('0x18')][_0xb1cb('0x1a')]||null:null,'include':_0xa84e8c[_0xb1cb('0x18')]?_0xa84e8c['options']['include']?_[_0xb1cb('0x1b')](_0xa84e8c['options'][_0xb1cb('0x1c')],function(_0x47d6f2){return{'model':db[_0x47d6f2[_0xb1cb('0x1d')]],'as':_0x47d6f2['as'],'attributes':_0x47d6f2[_0xb1cb('0x1e')],'include':_0x47d6f2[_0xb1cb('0x1c')]?_['map'](_0x47d6f2[_0xb1cb('0x1c')],function(_0x410031){return{'model':db[_0x410031[_0xb1cb('0x1d')]],'as':_0x410031['as'],'attributes':_0x410031[_0xb1cb('0x1e')],'include':_0x410031[_0xb1cb('0x1c')]?_['map'](_0x410031[_0xb1cb('0x1c')],function(_0x3ecd97){return{'model':db[_0x3ecd97[_0xb1cb('0x1d')]],'as':_0x3ecd97['as'],'attributes':_0x3ecd97[_0xb1cb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb1cb('0xb')](function(_0x1eda7d){logger[_0xb1cb('0x14')](_0xb1cb('0x1f'),_0xa84e8c);logger[_0xb1cb('0xe')](_0xb1cb('0x1f'),_0xa84e8c,JSON['stringify'](_0x1eda7d));_0xc286f2(_0x1eda7d);})['catch'](function(_0x3073ca){logger[_0xb1cb('0x11')](_0xb1cb('0x1f'),_0x3073ca['message'],_0xa84e8c);_0x1ede87(_0x3c3d20[_0xb1cb('0x11')](0x1f4,_0x3073ca['message']));});});};exports[_0xb1cb('0x20')]=function(_0x273c32){var _0x5877d1=this;return new Promise(function(_0x3a0136,_0x53513f){return db['FreshdeskAccount'][_0xb1cb('0x21')]({'raw':_0x273c32[_0xb1cb('0x18')]?_0x273c32['options'][_0xb1cb('0x22')]===undefined?!![]:![]:!![],'where':_0x273c32['options']?_0x273c32['options']['where']||null:null,'attributes':_0x273c32[_0xb1cb('0x18')]?_0x273c32['options'][_0xb1cb('0x1e')]||null:null,'include':_0x273c32[_0xb1cb('0x18')]?_0x273c32[_0xb1cb('0x18')][_0xb1cb('0x1c')]?_[_0xb1cb('0x1b')](_0x273c32[_0xb1cb('0x18')][_0xb1cb('0x1c')],function(_0x3c8172){return{'model':db[_0x3c8172[_0xb1cb('0x1d')]],'as':_0x3c8172['as'],'attributes':_0x3c8172[_0xb1cb('0x1e')],'include':_0x3c8172[_0xb1cb('0x1c')]?_[_0xb1cb('0x1b')](_0x3c8172[_0xb1cb('0x1c')],function(_0x46df6d){return{'model':db[_0x46df6d[_0xb1cb('0x1d')]],'as':_0x46df6d['as'],'attributes':_0x46df6d[_0xb1cb('0x1e')],'include':_0x46df6d['include']?_[_0xb1cb('0x1b')](_0x46df6d[_0xb1cb('0x1c')],function(_0x2d3a92){return{'model':db[_0x2d3a92[_0xb1cb('0x1d')]],'as':_0x2d3a92['as'],'attributes':_0x2d3a92['attributes']};}):[]};}):[]};}):[]:[]})[_0xb1cb('0xb')](function(_0x716e9b){logger[_0xb1cb('0x14')](_0xb1cb('0x20'),_0x273c32);logger[_0xb1cb('0xe')](_0xb1cb('0x20'),_0x273c32,JSON[_0xb1cb('0x10')](_0x716e9b));_0x3a0136(_0x716e9b);})[_0xb1cb('0x16')](function(_0x54ac45){logger[_0xb1cb('0x11')]('ShowFreshdeskAccount',_0x54ac45['message'],_0x273c32);_0x53513f(_0x5877d1[_0xb1cb('0x11')](0x1f4,_0x54ac45[_0xb1cb('0x13')]));});});};
\ No newline at end of file
+var _0xecee=['jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','../../config/utils','rpc'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xecee,0x1a7));var _0xeece=function(_0x9ea627,_0x3644e5){_0x9ea627=_0x9ea627-0x0;var _0xcd17e0=_0xecee[_0x9ea627];return _0xcd17e0;};'use strict';var _=require(_0xeece('0x0'));var util=require(_0xeece('0x1'));var moment=require(_0xeece('0x2'));var BPromise=require(_0xeece('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeece('0x4'));var logger=require('../../config/logger')(_0xeece('0x5'));var config=require('../../config/environment');var jayson=require(_0xeece('0x6'));var client=jayson[_0xeece('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xedb9c9,_0x16ae8f,_0x5757d3){return new BPromise(function(_0x283692,_0x2da5ea){return client[_0xeece('0x8')](_0xedb9c9,_0x5757d3)[_0xeece('0x9')](function(_0x399a90){logger[_0xeece('0xa')](_0xeece('0xb'),_0x16ae8f,'request\x20sent');logger['debug'](_0xeece('0xc'),_0x16ae8f,_0xeece('0xd'),JSON[_0xeece('0xe')](_0x399a90));if(_0x399a90['error']){if(_0x399a90[_0xeece('0xf')][_0xeece('0x10')]===0x1f4){logger[_0xeece('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x16ae8f,_0x399a90[_0xeece('0xf')]['message']);return _0x2da5ea(_0x399a90[_0xeece('0xf')][_0xeece('0x11')]);}logger[_0xeece('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x16ae8f,_0x399a90[_0xeece('0xf')][_0xeece('0x11')]);return _0x283692(_0x399a90[_0xeece('0xf')][_0xeece('0x11')]);}else{logger[_0xeece('0xa')]('FreshdeskAccount,\x20%s,\x20%s',_0x16ae8f,_0xeece('0xd'));_0x283692(_0x399a90['result']['message']);}})[_0xeece('0x12')](function(_0x3e1fe5){logger[_0xeece('0xf')](_0xeece('0xb'),_0x16ae8f,_0x3e1fe5);_0x2da5ea(_0x3e1fe5);});});}exports[_0xeece('0x13')]=function(_0x5b2d25){var _0x2865e8=this;return new Promise(function(_0x2a4f0e,_0x2b7610){return db[_0xeece('0x14')][_0xeece('0x15')]({'raw':_0x5b2d25[_0xeece('0x16')]?_0x5b2d25['options'][_0xeece('0x17')]===undefined?!![]:![]:!![],'where':_0x5b2d25[_0xeece('0x16')]?_0x5b2d25[_0xeece('0x16')][_0xeece('0x18')]||null:null,'attributes':_0x5b2d25[_0xeece('0x16')]?_0x5b2d25[_0xeece('0x16')][_0xeece('0x19')]||null:null,'limit':_0x5b2d25[_0xeece('0x16')]?_0x5b2d25['options'][_0xeece('0x1a')]||null:null,'include':_0x5b2d25[_0xeece('0x16')]?_0x5b2d25[_0xeece('0x16')][_0xeece('0x1b')]?_[_0xeece('0x1c')](_0x5b2d25[_0xeece('0x16')][_0xeece('0x1b')],function(_0x37bc8b){return{'model':db[_0x37bc8b[_0xeece('0x1d')]],'as':_0x37bc8b['as'],'attributes':_0x37bc8b[_0xeece('0x19')],'include':_0x37bc8b[_0xeece('0x1b')]?_[_0xeece('0x1c')](_0x37bc8b[_0xeece('0x1b')],function(_0x205ef2){return{'model':db[_0x205ef2[_0xeece('0x1d')]],'as':_0x205ef2['as'],'attributes':_0x205ef2['attributes'],'include':_0x205ef2[_0xeece('0x1b')]?_[_0xeece('0x1c')](_0x205ef2['include'],function(_0x434d38){return{'model':db[_0x434d38[_0xeece('0x1d')]],'as':_0x434d38['as'],'attributes':_0x434d38['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f2dc2){logger[_0xeece('0xa')](_0xeece('0x13'),_0x5b2d25);logger[_0xeece('0x1e')](_0xeece('0x13'),_0x5b2d25,JSON[_0xeece('0xe')](_0x1f2dc2));_0x2a4f0e(_0x1f2dc2);})[_0xeece('0x12')](function(_0x5a611c){logger[_0xeece('0xf')](_0xeece('0x13'),_0x5a611c[_0xeece('0x11')],_0x5b2d25);_0x2b7610(_0x2865e8[_0xeece('0xf')](0x1f4,_0x5a611c[_0xeece('0x11')]));});});};exports[_0xeece('0x1f')]=function(_0x5d78a1){var _0x365336=this;return new Promise(function(_0x22a5d2,_0x17bde2){return db[_0xeece('0x14')][_0xeece('0x20')]({'raw':_0x5d78a1[_0xeece('0x16')]?_0x5d78a1[_0xeece('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5d78a1[_0xeece('0x16')]?_0x5d78a1[_0xeece('0x16')][_0xeece('0x18')]||null:null,'attributes':_0x5d78a1['options']?_0x5d78a1[_0xeece('0x16')][_0xeece('0x19')]||null:null,'include':_0x5d78a1[_0xeece('0x16')]?_0x5d78a1[_0xeece('0x16')][_0xeece('0x1b')]?_[_0xeece('0x1c')](_0x5d78a1[_0xeece('0x16')]['include'],function(_0x4b7f0e){return{'model':db[_0x4b7f0e[_0xeece('0x1d')]],'as':_0x4b7f0e['as'],'attributes':_0x4b7f0e[_0xeece('0x19')],'include':_0x4b7f0e['include']?_[_0xeece('0x1c')](_0x4b7f0e[_0xeece('0x1b')],function(_0x420e6b){return{'model':db[_0x420e6b[_0xeece('0x1d')]],'as':_0x420e6b['as'],'attributes':_0x420e6b[_0xeece('0x19')],'include':_0x420e6b[_0xeece('0x1b')]?_[_0xeece('0x1c')](_0x420e6b[_0xeece('0x1b')],function(_0x4eb13f){return{'model':db[_0x4eb13f['model']],'as':_0x4eb13f['as'],'attributes':_0x4eb13f[_0xeece('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x372c91){logger['info'](_0xeece('0x1f'),_0x5d78a1);logger['debug'](_0xeece('0x1f'),_0x5d78a1,JSON['stringify'](_0x372c91));_0x22a5d2(_0x372c91);})[_0xeece('0x12')](function(_0x53bf2c){logger[_0xeece('0xf')](_0xeece('0x1f'),_0x53bf2c[_0xeece('0x11')],_0x5d78a1);_0x17bde2(_0x365336['error'](0x1f4,_0x53bf2c[_0xeece('0x11')]));});});};
\ No newline at end of file
index ee79ce6..285b2c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4aa5=['index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','create','post','/:id/tags','put','update','delete','exports','path','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x5c2fef,_0x2e853c){var _0x1933e2=function(_0x1be7ea){while(--_0x1be7ea){_0x5c2fef['push'](_0x5c2fef['shift']());}};_0x1933e2(++_0x2e853c);}(_0x4aa5,0x6e));var _0x54aa=function(_0x5c39a6,_0x3ab8a0){_0x5c39a6=_0x5c39a6-0x0;var _0x566c6c=_0x4aa5[_0x5c39a6];return _0x566c6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x54aa('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x54aa('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x54aa('0x2'));var config=require(_0x54aa('0x3'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x54aa('0x4')]('/',auth['isAuthenticated'](),controller[_0x54aa('0x5')]);router[_0x54aa('0x4')](_0x54aa('0x6'),auth[_0x54aa('0x7')](),controller[_0x54aa('0x8')]);router['get'](_0x54aa('0x9'),auth[_0x54aa('0x7')](),controller[_0x54aa('0xa')]);router[_0x54aa('0x4')](_0x54aa('0xb'),auth['isAuthenticated'](),controller[_0x54aa('0xc')]);router[_0x54aa('0x4')](_0x54aa('0xd'),auth[_0x54aa('0x7')](),controller[_0x54aa('0xe')]);router[_0x54aa('0x4')]('/:id/tags',auth['isAuthenticated'](),controller[_0x54aa('0xf')]);router['post']('/',auth[_0x54aa('0x7')](),controller[_0x54aa('0x10')]);router[_0x54aa('0x11')](_0x54aa('0x12'),auth[_0x54aa('0x7')](),controller['setTags']);router[_0x54aa('0x13')]('/:id',auth[_0x54aa('0x7')](),controller[_0x54aa('0x14')]);router[_0x54aa('0x15')](_0x54aa('0x6'),auth[_0x54aa('0x7')](),controller['destroy']);module[_0x54aa('0x16')]=router;
\ No newline at end of file
+var _0x9dd4=['create','setTags','update','delete','destroy','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getDescriptions','/:id/tags','getTags','post'];(function(_0x249c2f,_0x21a43f){var _0xc72907=function(_0xa497d8){while(--_0xa497d8){_0x249c2f['push'](_0x249c2f['shift']());}};_0xc72907(++_0x21a43f);}(_0x9dd4,0x19d));var _0x49dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dd4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x49dd('0x0'));var path=require(_0x49dd('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x49dd('0x2')]();var fs_extra=require(_0x49dd('0x3'));var auth=require(_0x49dd('0x4'));var interaction=require(_0x49dd('0x5'));var config=require(_0x49dd('0x6'));var controller=require(_0x49dd('0x7'));router[_0x49dd('0x8')]('/',auth[_0x49dd('0x9')](),controller[_0x49dd('0xa')]);router['get'](_0x49dd('0xb'),auth[_0x49dd('0x9')](),controller[_0x49dd('0xc')]);router[_0x49dd('0x8')](_0x49dd('0xd'),auth[_0x49dd('0x9')](),controller['getFields']);router[_0x49dd('0x8')](_0x49dd('0xe'),auth[_0x49dd('0x9')](),controller['getSubjects']);router[_0x49dd('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x49dd('0xf')]);router[_0x49dd('0x8')](_0x49dd('0x10'),auth[_0x49dd('0x9')](),controller[_0x49dd('0x11')]);router[_0x49dd('0x12')]('/',auth[_0x49dd('0x9')](),controller[_0x49dd('0x13')]);router[_0x49dd('0x12')](_0x49dd('0x10'),auth[_0x49dd('0x9')](),controller[_0x49dd('0x14')]);router['put']('/:id',auth[_0x49dd('0x9')](),controller[_0x49dd('0x15')]);router[_0x49dd('0x16')](_0x49dd('0xb'),auth[_0x49dd('0x9')](),controller[_0x49dd('0x17')]);module['exports']=router;
\ No newline at end of file
index eb22bf7..5045978 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x817b=['STRING','sequelize'];(function(_0x23cab5,_0xce75f2){var _0x51df11=function(_0x5645f1){while(--_0x5645f1){_0x23cab5['push'](_0x23cab5['shift']());}};_0x51df11(++_0xce75f2);}(_0x817b,0x153));var _0xb817=function(_0x15b435,_0x3f55fe){_0x15b435=_0x15b435-0x0;var _0xbcce3d=_0x817b[_0x15b435];return _0xbcce3d;};'use strict';var Sequelize=require(_0xb817('0x0'));module['exports']={'name':{'type':Sequelize[_0xb817('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc0e6=['STRING','sequelize','exports'];(function(_0xa12e48,_0x5d61a9){var _0x3b4c5c=function(_0x9cf2e){while(--_0x9cf2e){_0xa12e48['push'](_0xa12e48['shift']());}};_0x3b4c5c(++_0x5d61a9);}(_0xc0e6,0x178));var _0x6c0e=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xc0e6[_0x29d94e];return _0x106237;};'use strict';var Sequelize=require(_0x6c0e('0x0'));module[_0x6c0e('0x1')]={'name':{'type':Sequelize[_0x6c0e('0x2')]},'description':{'type':Sequelize[_0x6c0e('0x2')]}};
\ No newline at end of file
index 718663e..b4adeb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e6=['zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','options','FreshdeskConfiguration','includeAll','findAll','params','include','merge','find','catch','create','body','findOne','FreshdeskField','pick','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf'];(function(_0x1c6dec,_0x4be466){var _0x5f1379=function(_0x34a381){while(--_0x34a381){_0x1c6dec['push'](_0x1c6dec['shift']());}};_0x5f1379(++_0x4be466);}(_0xf2e6,0xa1));var _0x6f2e=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xf2e6[_0x368fb9];return _0x4892fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f2e('0x0'));var zipdir=require(_0x6f2e('0x1'));var jsonpatch=require(_0x6f2e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6f2e('0x3'));var Mustache=require(_0x6f2e('0x4'));var util=require(_0x6f2e('0x5'));var path=require(_0x6f2e('0x6'));var sox=require(_0x6f2e('0x7'));var csv=require(_0x6f2e('0x8'));var ejs=require(_0x6f2e('0x9'));var fs=require('fs');var fs_extra=require(_0x6f2e('0xa'));var _=require('lodash');var squel=require(_0x6f2e('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f2e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6f2e('0xd'));var Papa=require(_0x6f2e('0xe'));var Redis=require(_0x6f2e('0xf'));var authService=require(_0x6f2e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f2e('0x11'));var logger=require(_0x6f2e('0x12'))(_0x6f2e('0x13'));var utils=require('../../config/utils');var config=require(_0x6f2e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f2e('0x15'))['db'];function respondWithStatusCode(_0x358473,_0x1af825){_0x1af825=_0x1af825||0xcc;return function(_0x55b0d5){if(_0x55b0d5){return _0x358473[_0x6f2e('0x16')](_0x1af825);}return _0x358473[_0x6f2e('0x17')](_0x1af825)[_0x6f2e('0x18')]();};}function respondWithResult(_0x32857e,_0x410f6c){_0x410f6c=_0x410f6c||0xc8;return function(_0xaae4d1){if(_0xaae4d1){return _0x32857e[_0x6f2e('0x17')](_0x410f6c)[_0x6f2e('0x19')](_0xaae4d1);}};}function respondWithFilteredResult(_0x41738d,_0x53e932){return function(_0x9968a6){if(_0x9968a6){var _0x1f0e0f=typeof _0x53e932[_0x6f2e('0x1a')]===_0x6f2e('0x1b')&&typeof _0x53e932[_0x6f2e('0x1c')]==='undefined';var _0xe7374b=_0x9968a6[_0x6f2e('0x1d')];var _0x3d772f=_0x1f0e0f?0x0:_0x53e932[_0x6f2e('0x1a')];var _0x3564dc=_0x1f0e0f?_0x9968a6[_0x6f2e('0x1d')]:_0x53e932[_0x6f2e('0x1a')]+_0x53e932['limit'];var _0x309f04;if(_0x3564dc>=_0xe7374b){_0x3564dc=_0xe7374b;_0x309f04=0xc8;}else{_0x309f04=0xce;}_0x41738d[_0x6f2e('0x17')](_0x309f04);return _0x41738d[_0x6f2e('0x1e')](_0x6f2e('0x1f'),_0x3d772f+'-'+_0x3564dc+'/'+_0xe7374b)['json'](_0x9968a6);}return null;};}function patchUpdates(_0x3893b8){return function(_0x331bd4){try{jsonpatch[_0x6f2e('0x20')](_0x331bd4,_0x3893b8,!![]);}catch(_0x4575ae){return BPromise[_0x6f2e('0x21')](_0x4575ae);}return _0x331bd4[_0x6f2e('0x22')]();};}function saveUpdates(_0x178b74,_0x416436){return function(_0x3a7a00){if(_0x3a7a00){return _0x3a7a00[_0x6f2e('0x23')](_0x178b74)[_0x6f2e('0x24')](function(_0x4ae066){return _0x4ae066;});}return null;};}function removeEntity(_0x4a1317,_0x5ad612){return function(_0x439524){if(_0x439524){return _0x439524[_0x6f2e('0x25')]()[_0x6f2e('0x24')](function(){_0x4a1317[_0x6f2e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fa98f,_0x2232bb){return function(_0xa5a946){if(!_0xa5a946){_0x2fa98f[_0x6f2e('0x16')](0x194);}return _0xa5a946;};}function handleError(_0x599e14,_0x231f9c){_0x231f9c=_0x231f9c||0x1f4;return function(_0x1bfd11){logger[_0x6f2e('0x26')](_0x1bfd11[_0x6f2e('0x27')]);if(_0x1bfd11[_0x6f2e('0x28')]){delete _0x1bfd11[_0x6f2e('0x28')];}_0x599e14['status'](_0x231f9c)['send'](_0x1bfd11);};}exports['index']=function(_0x2f9ac0,_0x8f9c80){var _0x11f4ba={},_0x55dac3={},_0x36131a={'count':0x0,'rows':[]};var _0x2ef31f=_[_0x6f2e('0x29')](db['FreshdeskConfiguration'][_0x6f2e('0x2a')],function(_0x490c11){return{'name':_0x490c11[_0x6f2e('0x2b')],'type':_0x490c11['type'][_0x6f2e('0x2c')]};});_0x55dac3[_0x6f2e('0x2d')]=_[_0x6f2e('0x29')](_0x2ef31f,_0x6f2e('0x28'));_0x55dac3['query']=_[_0x6f2e('0x2e')](_0x2f9ac0[_0x6f2e('0x2f')]);_0x55dac3[_0x6f2e('0x30')]=_[_0x6f2e('0x31')](_0x55dac3['model'],_0x55dac3['query']);_0x11f4ba[_0x6f2e('0x32')]=_[_0x6f2e('0x31')](_0x55dac3[_0x6f2e('0x2d')],qs[_0x6f2e('0x33')](_0x2f9ac0[_0x6f2e('0x2f')][_0x6f2e('0x33')]));_0x11f4ba[_0x6f2e('0x32')]=_0x11f4ba[_0x6f2e('0x32')][_0x6f2e('0x34')]?_0x11f4ba[_0x6f2e('0x32')]:_0x55dac3[_0x6f2e('0x2d')];if(!_0x2f9ac0['query'][_0x6f2e('0x35')](_0x6f2e('0x36'))){_0x11f4ba[_0x6f2e('0x1c')]=qs['limit'](_0x2f9ac0[_0x6f2e('0x2f')][_0x6f2e('0x1c')]);_0x11f4ba['offset']=qs['offset'](_0x2f9ac0[_0x6f2e('0x2f')][_0x6f2e('0x1a')]);}_0x11f4ba[_0x6f2e('0x37')]=qs[_0x6f2e('0x38')](_0x2f9ac0[_0x6f2e('0x2f')][_0x6f2e('0x38')]);_0x11f4ba[_0x6f2e('0x39')]=qs[_0x6f2e('0x30')](_['pick'](_0x2f9ac0[_0x6f2e('0x2f')],_0x55dac3[_0x6f2e('0x30')]),_0x2ef31f);if(_0x2f9ac0[_0x6f2e('0x2f')][_0x6f2e('0x3a')]){_0x11f4ba[_0x6f2e('0x39')]=_['merge'](_0x11f4ba[_0x6f2e('0x39')],{'$or':_[_0x6f2e('0x29')](_0x2ef31f,function(_0x4677ec){if(_0x4677ec[_0x6f2e('0x3b')]!=='VIRTUAL'){var _0x589542={};_0x589542[_0x4677ec['name']]={'$like':'%'+_0x2f9ac0[_0x6f2e('0x2f')][_0x6f2e('0x3a')]+'%'};return _0x589542;}})});}_0x11f4ba=_['merge']({},_0x11f4ba,_0x2f9ac0[_0x6f2e('0x3c')]);var _0x5ec617={'where':_0x11f4ba['where']};return db[_0x6f2e('0x3d')][_0x6f2e('0x1d')](_0x5ec617)[_0x6f2e('0x24')](function(_0xb0dd6d){_0x36131a['count']=_0xb0dd6d;if(_0x2f9ac0[_0x6f2e('0x2f')][_0x6f2e('0x3e')]){_0x11f4ba['include']=[{'all':!![]}];}return db[_0x6f2e('0x3d')][_0x6f2e('0x3f')](_0x11f4ba);})[_0x6f2e('0x24')](function(_0x541647){_0x36131a['rows']=_0x541647;return _0x36131a;})['then'](respondWithFilteredResult(_0x8f9c80,_0x11f4ba))['catch'](handleError(_0x8f9c80,null));};exports['show']=function(_0x147863,_0xe2b425){var _0x2fe835={'raw':![],'where':{'id':_0x147863[_0x6f2e('0x40')]['id']}},_0x27a3a2={};_0x27a3a2[_0x6f2e('0x2d')]=_[_0x6f2e('0x2e')](db[_0x6f2e('0x3d')]['rawAttributes']);_0x27a3a2[_0x6f2e('0x2f')]=_[_0x6f2e('0x2e')](_0x147863['query']);_0x27a3a2[_0x6f2e('0x30')]=_[_0x6f2e('0x31')](_0x27a3a2[_0x6f2e('0x2d')],_0x27a3a2['query']);_0x2fe835[_0x6f2e('0x32')]=_[_0x6f2e('0x31')](_0x27a3a2['model'],qs[_0x6f2e('0x33')](_0x147863['query'][_0x6f2e('0x33')]));_0x2fe835[_0x6f2e('0x32')]=_0x2fe835[_0x6f2e('0x32')][_0x6f2e('0x34')]?_0x2fe835[_0x6f2e('0x32')]:_0x27a3a2[_0x6f2e('0x2d')];if(_0x147863[_0x6f2e('0x2f')][_0x6f2e('0x3e')]){_0x2fe835[_0x6f2e('0x41')]=[{'all':!![]}];}_0x2fe835=_[_0x6f2e('0x42')]({},_0x2fe835,_0x147863[_0x6f2e('0x3c')]);return db[_0x6f2e('0x3d')][_0x6f2e('0x43')](_0x2fe835)['then'](handleEntityNotFound(_0xe2b425,null))[_0x6f2e('0x24')](respondWithResult(_0xe2b425,null))[_0x6f2e('0x44')](handleError(_0xe2b425,null));};exports[_0x6f2e('0x45')]=function(_0x3c27dd,_0xd9db5){return db['FreshdeskConfiguration'][_0x6f2e('0x45')](_0x3c27dd[_0x6f2e('0x46')],{})[_0x6f2e('0x24')](respondWithResult(_0xd9db5,0xc9))[_0x6f2e('0x44')](handleError(_0xd9db5,null));};exports[_0x6f2e('0x23')]=function(_0x348d9c,_0x3a2e3e){if(_0x348d9c[_0x6f2e('0x46')]['id']){delete _0x348d9c[_0x6f2e('0x46')]['id'];}return db['FreshdeskConfiguration'][_0x6f2e('0x43')]({'where':{'id':_0x348d9c['params']['id']}})['then'](handleEntityNotFound(_0x3a2e3e,null))['then'](saveUpdates(_0x348d9c[_0x6f2e('0x46')],null))[_0x6f2e('0x24')](respondWithResult(_0x3a2e3e,null))[_0x6f2e('0x44')](handleError(_0x3a2e3e,null));};exports[_0x6f2e('0x25')]=function(_0x2561f3,_0x2ccaf5){return db['FreshdeskConfiguration'][_0x6f2e('0x43')]({'where':{'id':_0x2561f3[_0x6f2e('0x40')]['id']}})[_0x6f2e('0x24')](handleEntityNotFound(_0x2ccaf5,null))[_0x6f2e('0x24')](removeEntity(_0x2ccaf5,null))[_0x6f2e('0x44')](handleError(_0x2ccaf5,null));};exports['getFields']=function(_0x3a22b2,_0x591936,_0x4a2fe4){var _0x4145d7={};var _0x3e01e9={};var _0x10161b;var _0x492b26;return db['FreshdeskConfiguration'][_0x6f2e('0x47')]({'where':{'id':_0x3a22b2[_0x6f2e('0x40')]['id']}})['then'](handleEntityNotFound(_0x591936,null))[_0x6f2e('0x24')](function(_0x5946d2){if(_0x5946d2){_0x10161b=_0x5946d2;_0x3e01e9[_0x6f2e('0x2d')]=_[_0x6f2e('0x2e')](db[_0x6f2e('0x48')][_0x6f2e('0x2a')]);_0x3e01e9['query']=_[_0x6f2e('0x2e')](_0x3a22b2[_0x6f2e('0x2f')]);_0x3e01e9[_0x6f2e('0x30')]=_[_0x6f2e('0x31')](_0x3e01e9[_0x6f2e('0x2d')],_0x3e01e9[_0x6f2e('0x2f')]);_0x4145d7[_0x6f2e('0x32')]=_['intersection'](_0x3e01e9[_0x6f2e('0x2d')],qs[_0x6f2e('0x33')](_0x3a22b2['query'][_0x6f2e('0x33')]));_0x4145d7[_0x6f2e('0x32')]=_0x4145d7[_0x6f2e('0x32')]['length']?_0x4145d7[_0x6f2e('0x32')]:_0x3e01e9[_0x6f2e('0x2d')];_0x4145d7[_0x6f2e('0x37')]=qs[_0x6f2e('0x38')](_0x3a22b2['query'][_0x6f2e('0x38')]);_0x4145d7['where']=qs[_0x6f2e('0x30')](_[_0x6f2e('0x49')](_0x3a22b2[_0x6f2e('0x2f')],_0x3e01e9[_0x6f2e('0x30')]));if(_0x3a22b2[_0x6f2e('0x2f')][_0x6f2e('0x3a')]){_0x4145d7['where']=_[_0x6f2e('0x42')](_0x4145d7['where'],{'$or':_['map'](_0x4145d7[_0x6f2e('0x32')],function(_0x56bf0d){var _0x257264={};_0x257264[_0x56bf0d]={'$like':'%'+_0x3a22b2[_0x6f2e('0x2f')][_0x6f2e('0x3a')]+'%'};return _0x257264;})});}_0x4145d7=_['merge']({},_0x4145d7,_0x3a22b2[_0x6f2e('0x3c')]);return _0x10161b['getFields'](_0x4145d7);}})['then'](function(_0x5d60e7){if(_0x5d60e7){_0x492b26=_0x5d60e7[_0x6f2e('0x34')];if(!_0x3a22b2[_0x6f2e('0x2f')]['hasOwnProperty']('nolimit')){_0x4145d7[_0x6f2e('0x1c')]=qs['limit'](_0x3a22b2[_0x6f2e('0x2f')]['limit']);_0x4145d7[_0x6f2e('0x1a')]=qs[_0x6f2e('0x1a')](_0x3a22b2['query'][_0x6f2e('0x1a')]);}return _0x10161b[_0x6f2e('0x4a')](_0x4145d7);}})['then'](function(_0x2c4228){if(_0x2c4228){return _0x2c4228?{'count':_0x492b26,'rows':_0x2c4228}:null;}})[_0x6f2e('0x24')](respondWithResult(_0x591936,null))[_0x6f2e('0x44')](handleError(_0x591936,null));};exports['getSubjects']=function(_0xbc9c4f,_0x9ddd46,_0xd843b7){var _0x2cbdd4={};var _0xa5f71a={};var _0x1f31b1;var _0x2d2736;return db['FreshdeskConfiguration'][_0x6f2e('0x47')]({'where':{'id':_0xbc9c4f[_0x6f2e('0x40')]['id']}})[_0x6f2e('0x24')](handleEntityNotFound(_0x9ddd46,null))[_0x6f2e('0x24')](function(_0x1e136e){if(_0x1e136e){_0x1f31b1=_0x1e136e;_0xa5f71a[_0x6f2e('0x2d')]=_[_0x6f2e('0x2e')](db[_0x6f2e('0x48')]['rawAttributes']);_0xa5f71a[_0x6f2e('0x2f')]=_[_0x6f2e('0x2e')](_0xbc9c4f[_0x6f2e('0x2f')]);_0xa5f71a[_0x6f2e('0x30')]=_[_0x6f2e('0x31')](_0xa5f71a[_0x6f2e('0x2d')],_0xa5f71a[_0x6f2e('0x2f')]);_0x2cbdd4[_0x6f2e('0x32')]=_[_0x6f2e('0x31')](_0xa5f71a[_0x6f2e('0x2d')],qs['fields'](_0xbc9c4f[_0x6f2e('0x2f')][_0x6f2e('0x33')]));_0x2cbdd4[_0x6f2e('0x32')]=_0x2cbdd4[_0x6f2e('0x32')][_0x6f2e('0x34')]?_0x2cbdd4['attributes']:_0xa5f71a[_0x6f2e('0x2d')];_0x2cbdd4[_0x6f2e('0x37')]=qs[_0x6f2e('0x38')](_0xbc9c4f[_0x6f2e('0x2f')][_0x6f2e('0x38')]);_0x2cbdd4[_0x6f2e('0x39')]=qs[_0x6f2e('0x30')](_['pick'](_0xbc9c4f[_0x6f2e('0x2f')],_0xa5f71a['filters']));if(_0xbc9c4f['query'][_0x6f2e('0x3a')]){_0x2cbdd4[_0x6f2e('0x39')]=_['merge'](_0x2cbdd4[_0x6f2e('0x39')],{'$or':_[_0x6f2e('0x29')](_0x2cbdd4[_0x6f2e('0x32')],function(_0x4b72f2){var _0x1e04f0={};_0x1e04f0[_0x4b72f2]={'$like':'%'+_0xbc9c4f['query'][_0x6f2e('0x3a')]+'%'};return _0x1e04f0;})});}_0x2cbdd4=_[_0x6f2e('0x42')]({},_0x2cbdd4,_0xbc9c4f[_0x6f2e('0x3c')]);return _0x1f31b1[_0x6f2e('0x4b')](_0x2cbdd4);}})['then'](function(_0x2993ca){if(_0x2993ca){_0x2d2736=_0x2993ca[_0x6f2e('0x34')];if(!_0xbc9c4f[_0x6f2e('0x2f')]['hasOwnProperty'](_0x6f2e('0x36'))){_0x2cbdd4[_0x6f2e('0x1c')]=qs[_0x6f2e('0x1c')](_0xbc9c4f[_0x6f2e('0x2f')][_0x6f2e('0x1c')]);_0x2cbdd4[_0x6f2e('0x1a')]=qs['offset'](_0xbc9c4f[_0x6f2e('0x2f')][_0x6f2e('0x1a')]);}return _0x1f31b1[_0x6f2e('0x4b')](_0x2cbdd4);}})[_0x6f2e('0x24')](function(_0x3c4586){if(_0x3c4586){return _0x3c4586?{'count':_0x2d2736,'rows':_0x3c4586}:null;}})['then'](respondWithResult(_0x9ddd46,null))['catch'](handleError(_0x9ddd46,null));};exports['getDescriptions']=function(_0x3cdb1f,_0x416b1,_0x745378){var _0x423679={};var _0x166258={};var _0x17522c;var _0x522d8c;return db[_0x6f2e('0x3d')][_0x6f2e('0x47')]({'where':{'id':_0x3cdb1f[_0x6f2e('0x40')]['id']}})[_0x6f2e('0x24')](handleEntityNotFound(_0x416b1,null))['then'](function(_0x1a502c){if(_0x1a502c){_0x17522c=_0x1a502c;_0x166258[_0x6f2e('0x2d')]=_[_0x6f2e('0x2e')](db[_0x6f2e('0x48')][_0x6f2e('0x2a')]);_0x166258['query']=_['keys'](_0x3cdb1f[_0x6f2e('0x2f')]);_0x166258[_0x6f2e('0x30')]=_[_0x6f2e('0x31')](_0x166258[_0x6f2e('0x2d')],_0x166258['query']);_0x423679[_0x6f2e('0x32')]=_[_0x6f2e('0x31')](_0x166258[_0x6f2e('0x2d')],qs[_0x6f2e('0x33')](_0x3cdb1f[_0x6f2e('0x2f')]['fields']));_0x423679[_0x6f2e('0x32')]=_0x423679[_0x6f2e('0x32')]['length']?_0x423679[_0x6f2e('0x32')]:_0x166258[_0x6f2e('0x2d')];_0x423679['order']=qs[_0x6f2e('0x38')](_0x3cdb1f['query'][_0x6f2e('0x38')]);_0x423679[_0x6f2e('0x39')]=qs[_0x6f2e('0x30')](_[_0x6f2e('0x49')](_0x3cdb1f[_0x6f2e('0x2f')],_0x166258[_0x6f2e('0x30')]));if(_0x3cdb1f[_0x6f2e('0x2f')][_0x6f2e('0x3a')]){_0x423679[_0x6f2e('0x39')]=_['merge'](_0x423679[_0x6f2e('0x39')],{'$or':_['map'](_0x423679[_0x6f2e('0x32')],function(_0x44b12c){var _0xffd8fd={};_0xffd8fd[_0x44b12c]={'$like':'%'+_0x3cdb1f[_0x6f2e('0x2f')][_0x6f2e('0x3a')]+'%'};return _0xffd8fd;})});}_0x423679=_[_0x6f2e('0x42')]({},_0x423679,_0x3cdb1f[_0x6f2e('0x3c')]);return _0x17522c['getDescriptions'](_0x423679);}})['then'](function(_0x1a5518){if(_0x1a5518){_0x522d8c=_0x1a5518[_0x6f2e('0x34')];if(!_0x3cdb1f[_0x6f2e('0x2f')][_0x6f2e('0x35')]('nolimit')){_0x423679[_0x6f2e('0x1c')]=qs[_0x6f2e('0x1c')](_0x3cdb1f['query'][_0x6f2e('0x1c')]);_0x423679['offset']=qs['offset'](_0x3cdb1f['query'][_0x6f2e('0x1a')]);}return _0x17522c[_0x6f2e('0x4c')](_0x423679);}})[_0x6f2e('0x24')](function(_0x5e9564){if(_0x5e9564){return _0x5e9564?{'count':_0x522d8c,'rows':_0x5e9564}:null;}})[_0x6f2e('0x24')](respondWithResult(_0x416b1,null))[_0x6f2e('0x44')](handleError(_0x416b1,null));};exports['getTags']=function(_0x1e9f03,_0x12b49c,_0x2e4e83){var _0x3e5c5e={};var _0x316da4={};var _0x2ff28b;var _0x1123a8;return db[_0x6f2e('0x3d')][_0x6f2e('0x47')]({'where':{'id':_0x1e9f03[_0x6f2e('0x40')]['id']}})['then'](handleEntityNotFound(_0x12b49c,null))[_0x6f2e('0x24')](function(_0x106e6e){if(_0x106e6e){_0x2ff28b=_0x106e6e;_0x316da4[_0x6f2e('0x2d')]=_[_0x6f2e('0x2e')](db[_0x6f2e('0x4d')][_0x6f2e('0x2a')]);_0x316da4[_0x6f2e('0x2f')]=_[_0x6f2e('0x2e')](_0x1e9f03[_0x6f2e('0x2f')]);_0x316da4[_0x6f2e('0x30')]=_[_0x6f2e('0x31')](_0x316da4[_0x6f2e('0x2d')],_0x316da4['query']);_0x3e5c5e[_0x6f2e('0x32')]=_[_0x6f2e('0x31')](_0x316da4[_0x6f2e('0x2d')],qs[_0x6f2e('0x33')](_0x1e9f03[_0x6f2e('0x2f')][_0x6f2e('0x33')]));_0x3e5c5e[_0x6f2e('0x32')]=_0x3e5c5e[_0x6f2e('0x32')][_0x6f2e('0x34')]?_0x3e5c5e['attributes']:_0x316da4['model'];_0x3e5c5e[_0x6f2e('0x37')]=qs['sort'](_0x1e9f03['query']['sort']);_0x3e5c5e[_0x6f2e('0x39')]=qs[_0x6f2e('0x30')](_[_0x6f2e('0x49')](_0x1e9f03[_0x6f2e('0x2f')],_0x316da4['filters']));if(_0x1e9f03[_0x6f2e('0x2f')][_0x6f2e('0x3a')]){_0x3e5c5e[_0x6f2e('0x39')]=_[_0x6f2e('0x42')](_0x3e5c5e[_0x6f2e('0x39')],{'$or':_[_0x6f2e('0x29')](_0x3e5c5e['attributes'],function(_0x6c33bb){var _0x1cf28a={};_0x1cf28a[_0x6c33bb]={'$like':'%'+_0x1e9f03['query']['filter']+'%'};return _0x1cf28a;})});}_0x3e5c5e=_['merge']({},_0x3e5c5e,_0x1e9f03['options']);return _0x2ff28b[_0x6f2e('0x4e')](_0x3e5c5e);}})[_0x6f2e('0x24')](function(_0x4a4994){if(_0x4a4994){_0x1123a8=_0x4a4994[_0x6f2e('0x34')];if(!_0x1e9f03[_0x6f2e('0x2f')][_0x6f2e('0x35')](_0x6f2e('0x36'))){_0x3e5c5e[_0x6f2e('0x1c')]=qs[_0x6f2e('0x1c')](_0x1e9f03[_0x6f2e('0x2f')][_0x6f2e('0x1c')]);_0x3e5c5e['offset']=qs[_0x6f2e('0x1a')](_0x1e9f03[_0x6f2e('0x2f')][_0x6f2e('0x1a')]);}return _0x2ff28b[_0x6f2e('0x4e')](_0x3e5c5e);}})['then'](function(_0xcb6259){if(_0xcb6259){return _0xcb6259?{'count':_0x1123a8,'rows':_0xcb6259}:null;}})['then'](respondWithResult(_0x12b49c,null))[_0x6f2e('0x44')](handleError(_0x12b49c,null));};exports[_0x6f2e('0x4f')]=function(_0x415884,_0x2c8c6d,_0x12336e){if(_0x415884[_0x6f2e('0x46')]['id']){delete _0x415884[_0x6f2e('0x46')]['id'];}return db[_0x6f2e('0x3d')]['findOne']({'where':{'id':_0x415884[_0x6f2e('0x40')]['id']}})[_0x6f2e('0x24')](handleEntityNotFound(_0x2c8c6d,null))['then'](function(_0xb2084c){if(_0xb2084c){return _0xb2084c[_0x6f2e('0x4f')](_0x415884[_0x6f2e('0x46')][_0x6f2e('0x50')]||[]);}return null;})['then'](respondWithResult(_0x2c8c6d,null))[_0x6f2e('0x44')](handleError(_0x2c8c6d,null));};
\ No newline at end of file
+var _0x7566=['setTags','ids','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','FreshdeskField','findOne','getSubjects','getDescriptions','getTags'];(function(_0x132558,_0x521d93){var _0x34f138=function(_0x3e3541){while(--_0x3e3541){_0x132558['push'](_0x132558['shift']());}};_0x34f138(++_0x521d93);}(_0x7566,0x152));var _0x6756=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0x7566[_0x7a112];return _0x136dc5;};'use strict';var emlformat=require(_0x6756('0x0'));var rimraf=require(_0x6756('0x1'));var zipdir=require(_0x6756('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6756('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6756('0x4'));var util=require(_0x6756('0x5'));var path=require(_0x6756('0x6'));var sox=require(_0x6756('0x7'));var csv=require(_0x6756('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6756('0x9'));var _=require('lodash');var squel=require(_0x6756('0xa'));var crypto=require('crypto');var jsforce=require(_0x6756('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6756('0x8'));var querystring=require(_0x6756('0xc'));var Papa=require('papaparse');var Redis=require(_0x6756('0xd'));var authService=require(_0x6756('0xe'));var qs=require(_0x6756('0xf'));var as=require(_0x6756('0x10'));var hardwareService=require(_0x6756('0x11'));var logger=require(_0x6756('0x12'))(_0x6756('0x13'));var utils=require(_0x6756('0x14'));var config=require(_0x6756('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6756('0x16'))['db'];function respondWithStatusCode(_0x1f734e,_0x39d7a2){_0x39d7a2=_0x39d7a2||0xcc;return function(_0x62e612){if(_0x62e612){return _0x1f734e['sendStatus'](_0x39d7a2);}return _0x1f734e[_0x6756('0x17')](_0x39d7a2)[_0x6756('0x18')]();};}function respondWithResult(_0x497a5e,_0x16697c){_0x16697c=_0x16697c||0xc8;return function(_0xb91d93){if(_0xb91d93){return _0x497a5e['status'](_0x16697c)[_0x6756('0x19')](_0xb91d93);}};}function respondWithFilteredResult(_0x33ab4d,_0x56092e){return function(_0x2d9611){if(_0x2d9611){var _0x4ee306=typeof _0x56092e[_0x6756('0x1a')]==='undefined'&&typeof _0x56092e[_0x6756('0x1b')]===_0x6756('0x1c');var _0x31a540=_0x2d9611[_0x6756('0x1d')];var _0x2ccc17=_0x4ee306?0x0:_0x56092e[_0x6756('0x1a')];var _0x1c0dd7=_0x4ee306?_0x2d9611['count']:_0x56092e[_0x6756('0x1a')]+_0x56092e['limit'];var _0x1688b4;if(_0x1c0dd7>=_0x31a540){_0x1c0dd7=_0x31a540;_0x1688b4=0xc8;}else{_0x1688b4=0xce;}_0x33ab4d[_0x6756('0x17')](_0x1688b4);return _0x33ab4d['set'](_0x6756('0x1e'),_0x2ccc17+'-'+_0x1c0dd7+'/'+_0x31a540)[_0x6756('0x19')](_0x2d9611);}return null;};}function patchUpdates(_0x39a2e2){return function(_0x271748){try{jsonpatch[_0x6756('0x1f')](_0x271748,_0x39a2e2,!![]);}catch(_0x46c040){return BPromise[_0x6756('0x20')](_0x46c040);}return _0x271748[_0x6756('0x21')]();};}function saveUpdates(_0x484124,_0x8ee3fe){return function(_0x352ef4){if(_0x352ef4){return _0x352ef4[_0x6756('0x22')](_0x484124)[_0x6756('0x23')](function(_0x2daec3){return _0x2daec3;});}return null;};}function removeEntity(_0x2f90d5,_0x560719){return function(_0xef9c0c){if(_0xef9c0c){return _0xef9c0c[_0x6756('0x24')]()[_0x6756('0x23')](function(){_0x2f90d5['status'](0xcc)[_0x6756('0x18')]();});}};}function handleEntityNotFound(_0x3dad28,_0x2fcdb8){return function(_0x402486){if(!_0x402486){_0x3dad28[_0x6756('0x25')](0x194);}return _0x402486;};}function handleError(_0x4b91da,_0x265fb6){_0x265fb6=_0x265fb6||0x1f4;return function(_0x5b207d){logger[_0x6756('0x26')](_0x5b207d['stack']);if(_0x5b207d['name']){delete _0x5b207d['name'];}_0x4b91da[_0x6756('0x17')](_0x265fb6)[_0x6756('0x27')](_0x5b207d);};}exports[_0x6756('0x28')]=function(_0x408f57,_0x46cfc1){var _0x41e121={},_0x5b83d3={},_0x46cb7c={'count':0x0,'rows':[]};var _0x5e3f38=_[_0x6756('0x29')](db[_0x6756('0x2a')][_0x6756('0x2b')],function(_0x31dac9){return{'name':_0x31dac9[_0x6756('0x2c')],'type':_0x31dac9[_0x6756('0x2d')][_0x6756('0x2e')]};});_0x5b83d3[_0x6756('0x2f')]=_[_0x6756('0x29')](_0x5e3f38,_0x6756('0x30'));_0x5b83d3[_0x6756('0x31')]=_[_0x6756('0x32')](_0x408f57[_0x6756('0x31')]);_0x5b83d3[_0x6756('0x33')]=_[_0x6756('0x34')](_0x5b83d3[_0x6756('0x2f')],_0x5b83d3[_0x6756('0x31')]);_0x41e121[_0x6756('0x35')]=_['intersection'](_0x5b83d3[_0x6756('0x2f')],qs[_0x6756('0x36')](_0x408f57[_0x6756('0x31')]['fields']));_0x41e121['attributes']=_0x41e121[_0x6756('0x35')][_0x6756('0x37')]?_0x41e121['attributes']:_0x5b83d3[_0x6756('0x2f')];if(!_0x408f57[_0x6756('0x31')][_0x6756('0x38')](_0x6756('0x39'))){_0x41e121[_0x6756('0x1b')]=qs[_0x6756('0x1b')](_0x408f57[_0x6756('0x31')][_0x6756('0x1b')]);_0x41e121[_0x6756('0x1a')]=qs[_0x6756('0x1a')](_0x408f57[_0x6756('0x31')]['offset']);}_0x41e121[_0x6756('0x3a')]=qs['sort'](_0x408f57[_0x6756('0x31')][_0x6756('0x3b')]);_0x41e121[_0x6756('0x3c')]=qs[_0x6756('0x33')](_[_0x6756('0x3d')](_0x408f57[_0x6756('0x31')],_0x5b83d3[_0x6756('0x33')]),_0x5e3f38);if(_0x408f57[_0x6756('0x31')][_0x6756('0x3e')]){_0x41e121[_0x6756('0x3c')]=_[_0x6756('0x3f')](_0x41e121[_0x6756('0x3c')],{'$or':_[_0x6756('0x29')](_0x5e3f38,function(_0x133710){if(_0x133710[_0x6756('0x2d')]!==_0x6756('0x40')){var _0x5a1aae={};_0x5a1aae[_0x133710[_0x6756('0x30')]]={'$like':'%'+_0x408f57['query'][_0x6756('0x3e')]+'%'};return _0x5a1aae;}})});}_0x41e121=_[_0x6756('0x3f')]({},_0x41e121,_0x408f57['options']);var _0x2c9c25={'where':_0x41e121[_0x6756('0x3c')]};return db[_0x6756('0x2a')][_0x6756('0x1d')](_0x2c9c25)[_0x6756('0x23')](function(_0x4cf868){_0x46cb7c[_0x6756('0x1d')]=_0x4cf868;if(_0x408f57[_0x6756('0x31')][_0x6756('0x41')]){_0x41e121[_0x6756('0x42')]=[{'all':!![]}];}return db[_0x6756('0x2a')][_0x6756('0x43')](_0x41e121);})[_0x6756('0x23')](function(_0x13d1a9){_0x46cb7c[_0x6756('0x44')]=_0x13d1a9;return _0x46cb7c;})['then'](respondWithFilteredResult(_0x46cfc1,_0x41e121))[_0x6756('0x45')](handleError(_0x46cfc1,null));};exports[_0x6756('0x46')]=function(_0x1a154d,_0x372ae8){var _0x3b7376={'raw':![],'where':{'id':_0x1a154d[_0x6756('0x47')]['id']}},_0xb1b0b={};_0xb1b0b['model']=_[_0x6756('0x32')](db[_0x6756('0x2a')][_0x6756('0x2b')]);_0xb1b0b['query']=_[_0x6756('0x32')](_0x1a154d['query']);_0xb1b0b[_0x6756('0x33')]=_[_0x6756('0x34')](_0xb1b0b[_0x6756('0x2f')],_0xb1b0b[_0x6756('0x31')]);_0x3b7376[_0x6756('0x35')]=_['intersection'](_0xb1b0b[_0x6756('0x2f')],qs['fields'](_0x1a154d[_0x6756('0x31')]['fields']));_0x3b7376['attributes']=_0x3b7376[_0x6756('0x35')][_0x6756('0x37')]?_0x3b7376[_0x6756('0x35')]:_0xb1b0b[_0x6756('0x2f')];if(_0x1a154d['query']['includeAll']){_0x3b7376['include']=[{'all':!![]}];}_0x3b7376=_[_0x6756('0x3f')]({},_0x3b7376,_0x1a154d[_0x6756('0x48')]);return db[_0x6756('0x2a')][_0x6756('0x49')](_0x3b7376)[_0x6756('0x23')](handleEntityNotFound(_0x372ae8,null))[_0x6756('0x23')](respondWithResult(_0x372ae8,null))[_0x6756('0x45')](handleError(_0x372ae8,null));};exports[_0x6756('0x4a')]=function(_0x1be639,_0x4377ce){return db[_0x6756('0x2a')][_0x6756('0x4a')](_0x1be639[_0x6756('0x4b')],{})[_0x6756('0x23')](respondWithResult(_0x4377ce,0xc9))[_0x6756('0x45')](handleError(_0x4377ce,null));};exports['update']=function(_0x4eb7d7,_0x349e39){if(_0x4eb7d7[_0x6756('0x4b')]['id']){delete _0x4eb7d7[_0x6756('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0x6756('0x49')]({'where':{'id':_0x4eb7d7['params']['id']}})[_0x6756('0x23')](handleEntityNotFound(_0x349e39,null))['then'](saveUpdates(_0x4eb7d7['body'],null))['then'](respondWithResult(_0x349e39,null))['catch'](handleError(_0x349e39,null));};exports[_0x6756('0x24')]=function(_0x2cb2c9,_0x514bb3){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x2cb2c9['params']['id']}})[_0x6756('0x23')](handleEntityNotFound(_0x514bb3,null))[_0x6756('0x23')](removeEntity(_0x514bb3,null))[_0x6756('0x45')](handleError(_0x514bb3,null));};exports[_0x6756('0x4c')]=function(_0x555ec6,_0x1326a0,_0x5d1009){var _0x5a1059={};var _0x2dd36e={};var _0x2efa0c;var _0x4694fe;return db[_0x6756('0x2a')]['findOne']({'where':{'id':_0x555ec6[_0x6756('0x47')]['id']}})[_0x6756('0x23')](handleEntityNotFound(_0x1326a0,null))['then'](function(_0x3d7b4a){if(_0x3d7b4a){_0x2efa0c=_0x3d7b4a;_0x2dd36e[_0x6756('0x2f')]=_[_0x6756('0x32')](db[_0x6756('0x4d')][_0x6756('0x2b')]);_0x2dd36e['query']=_[_0x6756('0x32')](_0x555ec6[_0x6756('0x31')]);_0x2dd36e[_0x6756('0x33')]=_[_0x6756('0x34')](_0x2dd36e['model'],_0x2dd36e[_0x6756('0x31')]);_0x5a1059[_0x6756('0x35')]=_['intersection'](_0x2dd36e[_0x6756('0x2f')],qs['fields'](_0x555ec6['query'][_0x6756('0x36')]));_0x5a1059[_0x6756('0x35')]=_0x5a1059['attributes'][_0x6756('0x37')]?_0x5a1059['attributes']:_0x2dd36e[_0x6756('0x2f')];_0x5a1059['order']=qs[_0x6756('0x3b')](_0x555ec6[_0x6756('0x31')][_0x6756('0x3b')]);_0x5a1059['where']=qs['filters'](_[_0x6756('0x3d')](_0x555ec6[_0x6756('0x31')],_0x2dd36e['filters']));if(_0x555ec6[_0x6756('0x31')][_0x6756('0x3e')]){_0x5a1059[_0x6756('0x3c')]=_['merge'](_0x5a1059[_0x6756('0x3c')],{'$or':_[_0x6756('0x29')](_0x5a1059[_0x6756('0x35')],function(_0x402f9f){var _0x393e79={};_0x393e79[_0x402f9f]={'$like':'%'+_0x555ec6[_0x6756('0x31')][_0x6756('0x3e')]+'%'};return _0x393e79;})});}_0x5a1059=_[_0x6756('0x3f')]({},_0x5a1059,_0x555ec6[_0x6756('0x48')]);return _0x2efa0c[_0x6756('0x4c')](_0x5a1059);}})[_0x6756('0x23')](function(_0x53eede){if(_0x53eede){_0x4694fe=_0x53eede[_0x6756('0x37')];if(!_0x555ec6[_0x6756('0x31')][_0x6756('0x38')]('nolimit')){_0x5a1059['limit']=qs[_0x6756('0x1b')](_0x555ec6['query'][_0x6756('0x1b')]);_0x5a1059['offset']=qs[_0x6756('0x1a')](_0x555ec6[_0x6756('0x31')][_0x6756('0x1a')]);}return _0x2efa0c['getFields'](_0x5a1059);}})[_0x6756('0x23')](function(_0x5f4d9e){if(_0x5f4d9e){return _0x5f4d9e?{'count':_0x4694fe,'rows':_0x5f4d9e}:null;}})[_0x6756('0x23')](respondWithResult(_0x1326a0,null))[_0x6756('0x45')](handleError(_0x1326a0,null));};exports['getSubjects']=function(_0x18ec4b,_0x442cca,_0xf4994a){var _0x30b46a={};var _0x30907b={};var _0x1ade51;var _0x179e52;return db[_0x6756('0x2a')][_0x6756('0x4e')]({'where':{'id':_0x18ec4b[_0x6756('0x47')]['id']}})['then'](handleEntityNotFound(_0x442cca,null))[_0x6756('0x23')](function(_0xec383b){if(_0xec383b){_0x1ade51=_0xec383b;_0x30907b['model']=_[_0x6756('0x32')](db[_0x6756('0x4d')][_0x6756('0x2b')]);_0x30907b[_0x6756('0x31')]=_['keys'](_0x18ec4b['query']);_0x30907b[_0x6756('0x33')]=_[_0x6756('0x34')](_0x30907b['model'],_0x30907b[_0x6756('0x31')]);_0x30b46a['attributes']=_[_0x6756('0x34')](_0x30907b[_0x6756('0x2f')],qs['fields'](_0x18ec4b[_0x6756('0x31')][_0x6756('0x36')]));_0x30b46a[_0x6756('0x35')]=_0x30b46a[_0x6756('0x35')]['length']?_0x30b46a['attributes']:_0x30907b[_0x6756('0x2f')];_0x30b46a['order']=qs[_0x6756('0x3b')](_0x18ec4b['query'][_0x6756('0x3b')]);_0x30b46a[_0x6756('0x3c')]=qs[_0x6756('0x33')](_[_0x6756('0x3d')](_0x18ec4b['query'],_0x30907b[_0x6756('0x33')]));if(_0x18ec4b[_0x6756('0x31')]['filter']){_0x30b46a['where']=_[_0x6756('0x3f')](_0x30b46a[_0x6756('0x3c')],{'$or':_[_0x6756('0x29')](_0x30b46a['attributes'],function(_0x26f411){var _0x4c9116={};_0x4c9116[_0x26f411]={'$like':'%'+_0x18ec4b[_0x6756('0x31')]['filter']+'%'};return _0x4c9116;})});}_0x30b46a=_[_0x6756('0x3f')]({},_0x30b46a,_0x18ec4b[_0x6756('0x48')]);return _0x1ade51['getSubjects'](_0x30b46a);}})[_0x6756('0x23')](function(_0x4d4a66){if(_0x4d4a66){_0x179e52=_0x4d4a66['length'];if(!_0x18ec4b[_0x6756('0x31')][_0x6756('0x38')](_0x6756('0x39'))){_0x30b46a[_0x6756('0x1b')]=qs[_0x6756('0x1b')](_0x18ec4b[_0x6756('0x31')][_0x6756('0x1b')]);_0x30b46a['offset']=qs['offset'](_0x18ec4b[_0x6756('0x31')][_0x6756('0x1a')]);}return _0x1ade51[_0x6756('0x4f')](_0x30b46a);}})[_0x6756('0x23')](function(_0x2a42b4){if(_0x2a42b4){return _0x2a42b4?{'count':_0x179e52,'rows':_0x2a42b4}:null;}})['then'](respondWithResult(_0x442cca,null))[_0x6756('0x45')](handleError(_0x442cca,null));};exports[_0x6756('0x50')]=function(_0x10be33,_0x4eb0a9,_0x386efb){var _0x2fdd4b={};var _0x4053e2={};var _0x250c9b;var _0x1f6721;return db[_0x6756('0x2a')][_0x6756('0x4e')]({'where':{'id':_0x10be33['params']['id']}})[_0x6756('0x23')](handleEntityNotFound(_0x4eb0a9,null))[_0x6756('0x23')](function(_0x5cf830){if(_0x5cf830){_0x250c9b=_0x5cf830;_0x4053e2[_0x6756('0x2f')]=_[_0x6756('0x32')](db[_0x6756('0x4d')]['rawAttributes']);_0x4053e2[_0x6756('0x31')]=_[_0x6756('0x32')](_0x10be33[_0x6756('0x31')]);_0x4053e2[_0x6756('0x33')]=_[_0x6756('0x34')](_0x4053e2['model'],_0x4053e2[_0x6756('0x31')]);_0x2fdd4b['attributes']=_[_0x6756('0x34')](_0x4053e2['model'],qs['fields'](_0x10be33['query'][_0x6756('0x36')]));_0x2fdd4b[_0x6756('0x35')]=_0x2fdd4b[_0x6756('0x35')][_0x6756('0x37')]?_0x2fdd4b['attributes']:_0x4053e2[_0x6756('0x2f')];_0x2fdd4b[_0x6756('0x3a')]=qs['sort'](_0x10be33[_0x6756('0x31')]['sort']);_0x2fdd4b[_0x6756('0x3c')]=qs[_0x6756('0x33')](_[_0x6756('0x3d')](_0x10be33[_0x6756('0x31')],_0x4053e2[_0x6756('0x33')]));if(_0x10be33['query'][_0x6756('0x3e')]){_0x2fdd4b['where']=_[_0x6756('0x3f')](_0x2fdd4b['where'],{'$or':_[_0x6756('0x29')](_0x2fdd4b['attributes'],function(_0x19ffc0){var _0x434db3={};_0x434db3[_0x19ffc0]={'$like':'%'+_0x10be33[_0x6756('0x31')][_0x6756('0x3e')]+'%'};return _0x434db3;})});}_0x2fdd4b=_[_0x6756('0x3f')]({},_0x2fdd4b,_0x10be33['options']);return _0x250c9b[_0x6756('0x50')](_0x2fdd4b);}})[_0x6756('0x23')](function(_0x498876){if(_0x498876){_0x1f6721=_0x498876['length'];if(!_0x10be33['query'][_0x6756('0x38')](_0x6756('0x39'))){_0x2fdd4b[_0x6756('0x1b')]=qs[_0x6756('0x1b')](_0x10be33[_0x6756('0x31')][_0x6756('0x1b')]);_0x2fdd4b[_0x6756('0x1a')]=qs[_0x6756('0x1a')](_0x10be33[_0x6756('0x31')][_0x6756('0x1a')]);}return _0x250c9b[_0x6756('0x50')](_0x2fdd4b);}})[_0x6756('0x23')](function(_0x472f22){if(_0x472f22){return _0x472f22?{'count':_0x1f6721,'rows':_0x472f22}:null;}})[_0x6756('0x23')](respondWithResult(_0x4eb0a9,null))[_0x6756('0x45')](handleError(_0x4eb0a9,null));};exports['getTags']=function(_0x5c01a6,_0x9b812b,_0x458f91){var _0x55541c={};var _0x3c7b1a={};var _0x2a04df;var _0x45d993;return db[_0x6756('0x2a')][_0x6756('0x4e')]({'where':{'id':_0x5c01a6[_0x6756('0x47')]['id']}})['then'](handleEntityNotFound(_0x9b812b,null))[_0x6756('0x23')](function(_0x194a3a){if(_0x194a3a){_0x2a04df=_0x194a3a;_0x3c7b1a[_0x6756('0x2f')]=_[_0x6756('0x32')](db['Tag']['rawAttributes']);_0x3c7b1a[_0x6756('0x31')]=_[_0x6756('0x32')](_0x5c01a6['query']);_0x3c7b1a['filters']=_[_0x6756('0x34')](_0x3c7b1a[_0x6756('0x2f')],_0x3c7b1a[_0x6756('0x31')]);_0x55541c['attributes']=_[_0x6756('0x34')](_0x3c7b1a[_0x6756('0x2f')],qs['fields'](_0x5c01a6['query']['fields']));_0x55541c[_0x6756('0x35')]=_0x55541c['attributes'][_0x6756('0x37')]?_0x55541c[_0x6756('0x35')]:_0x3c7b1a[_0x6756('0x2f')];_0x55541c['order']=qs[_0x6756('0x3b')](_0x5c01a6[_0x6756('0x31')][_0x6756('0x3b')]);_0x55541c[_0x6756('0x3c')]=qs[_0x6756('0x33')](_[_0x6756('0x3d')](_0x5c01a6[_0x6756('0x31')],_0x3c7b1a[_0x6756('0x33')]));if(_0x5c01a6[_0x6756('0x31')]['filter']){_0x55541c[_0x6756('0x3c')]=_[_0x6756('0x3f')](_0x55541c[_0x6756('0x3c')],{'$or':_[_0x6756('0x29')](_0x55541c[_0x6756('0x35')],function(_0x3f6f47){var _0x116fb3={};_0x116fb3[_0x3f6f47]={'$like':'%'+_0x5c01a6['query']['filter']+'%'};return _0x116fb3;})});}_0x55541c=_[_0x6756('0x3f')]({},_0x55541c,_0x5c01a6[_0x6756('0x48')]);return _0x2a04df['getTags'](_0x55541c);}})[_0x6756('0x23')](function(_0x389baf){if(_0x389baf){_0x45d993=_0x389baf[_0x6756('0x37')];if(!_0x5c01a6['query'][_0x6756('0x38')](_0x6756('0x39'))){_0x55541c[_0x6756('0x1b')]=qs[_0x6756('0x1b')](_0x5c01a6[_0x6756('0x31')]['limit']);_0x55541c[_0x6756('0x1a')]=qs[_0x6756('0x1a')](_0x5c01a6[_0x6756('0x31')][_0x6756('0x1a')]);}return _0x2a04df[_0x6756('0x51')](_0x55541c);}})['then'](function(_0x3d522f){if(_0x3d522f){return _0x3d522f?{'count':_0x45d993,'rows':_0x3d522f}:null;}})[_0x6756('0x23')](respondWithResult(_0x9b812b,null))[_0x6756('0x45')](handleError(_0x9b812b,null));};exports[_0x6756('0x52')]=function(_0x12d43d,_0xd2af81,_0x2c883d){if(_0x12d43d[_0x6756('0x4b')]['id']){delete _0x12d43d[_0x6756('0x4b')]['id'];}return db[_0x6756('0x2a')][_0x6756('0x4e')]({'where':{'id':_0x12d43d['params']['id']}})[_0x6756('0x23')](handleEntityNotFound(_0xd2af81,null))[_0x6756('0x23')](function(_0x5e8224){if(_0x5e8224){return _0x5e8224[_0x6756('0x52')](_0x12d43d[_0x6756('0x4b')][_0x6756('0x53')]||[]);}return null;})[_0x6756('0x23')](respondWithResult(_0xd2af81,null))['catch'](handleError(_0xd2af81,null));};
\ No newline at end of file
index 2a86f50..ffb18e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9422=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0x9422,0x197));var _0x2942=function(_0x1432f1,_0x32b9d1){_0x1432f1=_0x1432f1-0x0;var _0x56a3ed=_0x9422[_0x1432f1];return _0x56a3ed;};'use strict';var _=require('lodash');var util=require(_0x2942('0x0'));var logger=require(_0x2942('0x1'))(_0x2942('0x2'));var moment=require(_0x2942('0x3'));var BPromise=require(_0x2942('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2942('0x5'));var config=require(_0x2942('0x6'));var attributes=require(_0x2942('0x7'));module[_0x2942('0x8')]=function(_0x3a485c,_0xd5c831){return _0x3a485c[_0x2942('0x9')](_0x2942('0xa'),attributes,{'tableName':_0x2942('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1da5=['int_freshdesk_configurations','lodash','util','moment','bluebird','request-promise','path','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x1da5,0x141));var _0x51da=function(_0xdc8d8e,_0x3b33a8){_0xdc8d8e=_0xdc8d8e-0x0;var _0xad29da=_0x1da5[_0xdc8d8e];return _0xad29da;};'use strict';var _=require(_0x51da('0x0'));var util=require(_0x51da('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x51da('0x2'));var BPromise=require(_0x51da('0x3'));var rp=require(_0x51da('0x4'));var fs=require('fs');var path=require(_0x51da('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x51da('0x6'));module[_0x51da('0x7')]=function(_0x2df759,_0xd99e60){return _0x2df759['define'](_0x51da('0x8'),attributes,{'tableName':_0x51da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 066e100..1ee7b35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32ef=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3ebadc,_0x19b343){var _0x3da6de=function(_0x49b1f5){while(--_0x49b1f5){_0x3ebadc['push'](_0x3ebadc['shift']());}};_0x3da6de(++_0x19b343);}(_0x32ef,0x129));var _0xf32e=function(_0x7e37f4,_0x137b5d){_0x7e37f4=_0x7e37f4-0x0;var _0x83fb05=_0x32ef[_0x7e37f4];return _0x83fb05;};'use strict';var _=require('lodash');var util=require(_0xf32e('0x0'));var moment=require(_0xf32e('0x1'));var BPromise=require(_0xf32e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf32e('0x3'));var db=require(_0xf32e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf32e('0x5'))(_0xf32e('0x6'));var config=require(_0xf32e('0x7'));var jayson=require(_0xf32e('0x8'));var client=jayson[_0xf32e('0x9')][_0xf32e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24ded6,_0x2fe8be,_0x33d8db){return new BPromise(function(_0x598223,_0x53e5fd){return client[_0xf32e('0xb')](_0x24ded6,_0x33d8db)[_0xf32e('0xc')](function(_0xbb2b54){logger[_0xf32e('0xd')](_0xf32e('0xe'),_0x2fe8be,_0xf32e('0xf'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2fe8be,_0xf32e('0xf'),JSON[_0xf32e('0x10')](_0xbb2b54));if(_0xbb2b54[_0xf32e('0x11')]){if(_0xbb2b54[_0xf32e('0x11')][_0xf32e('0x12')]===0x1f4){logger[_0xf32e('0x11')](_0xf32e('0xe'),_0x2fe8be,_0xbb2b54[_0xf32e('0x11')][_0xf32e('0x13')]);return _0x53e5fd(_0xbb2b54[_0xf32e('0x11')]['message']);}logger[_0xf32e('0x11')](_0xf32e('0xe'),_0x2fe8be,_0xbb2b54[_0xf32e('0x11')][_0xf32e('0x13')]);return _0x598223(_0xbb2b54[_0xf32e('0x11')]['message']);}else{logger[_0xf32e('0xd')](_0xf32e('0xe'),_0x2fe8be,_0xf32e('0xf'));_0x598223(_0xbb2b54[_0xf32e('0x14')][_0xf32e('0x13')]);}})[_0xf32e('0x15')](function(_0x4ef798){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2fe8be,_0x4ef798);_0x53e5fd(_0x4ef798);});});}
\ No newline at end of file
+var _0x9b2c=['info','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x47e7e0,_0x4a8e3c){var _0x567c58=function(_0x131cf2){while(--_0x131cf2){_0x47e7e0['push'](_0x47e7e0['shift']());}};_0x567c58(++_0x4a8e3c);}(_0x9b2c,0x12d));var _0xc9b2=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0x9b2c[_0x2212d1];return _0x15eec5;};'use strict';var _=require('lodash');var util=require(_0xc9b2('0x0'));var moment=require(_0xc9b2('0x1'));var BPromise=require(_0xc9b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9b2('0x3'));var db=require(_0xc9b2('0x4'))['db'];var utils=require(_0xc9b2('0x5'));var logger=require(_0xc9b2('0x6'))(_0xc9b2('0x7'));var config=require(_0xc9b2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc9b2('0x9')][_0xc9b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x372800,_0x2a525c,_0x4084b6){return new BPromise(function(_0x4769a8,_0x2fb509){return client[_0xc9b2('0xb')](_0x372800,_0x4084b6)[_0xc9b2('0xc')](function(_0x27f224){logger['info'](_0xc9b2('0xd'),_0x2a525c,_0xc9b2('0xe'));logger[_0xc9b2('0xf')](_0xc9b2('0x10'),_0x2a525c,_0xc9b2('0xe'),JSON[_0xc9b2('0x11')](_0x27f224));if(_0x27f224[_0xc9b2('0x12')]){if(_0x27f224[_0xc9b2('0x12')][_0xc9b2('0x13')]===0x1f4){logger[_0xc9b2('0x12')](_0xc9b2('0xd'),_0x2a525c,_0x27f224['error'][_0xc9b2('0x14')]);return _0x2fb509(_0x27f224[_0xc9b2('0x12')][_0xc9b2('0x14')]);}logger[_0xc9b2('0x12')](_0xc9b2('0xd'),_0x2a525c,_0x27f224[_0xc9b2('0x12')][_0xc9b2('0x14')]);return _0x4769a8(_0x27f224[_0xc9b2('0x12')][_0xc9b2('0x14')]);}else{logger[_0xc9b2('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2a525c,_0xc9b2('0xe'));_0x4769a8(_0x27f224[_0xc9b2('0x16')][_0xc9b2('0x14')]);}})['catch'](function(_0x258cca){logger['error'](_0xc9b2('0xd'),_0x2a525c,_0x258cca);_0x2fb509(_0x258cca);});});}
\ No newline at end of file
index 641bd68..518ba39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d23=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1d23,0xea));var _0x31d2=function(_0x43763f,_0x338f0b){_0x43763f=_0x43763f-0x0;var _0x1132c3=_0x1d23[_0x43763f];return _0x1132c3;};'use strict';var multer=require('multer');var util=require(_0x31d2('0x0'));var path=require(_0x31d2('0x1'));var timeout=require('connect-timeout');var express=require(_0x31d2('0x2'));var router=express[_0x31d2('0x3')]();var fs_extra=require(_0x31d2('0x4'));var auth=require(_0x31d2('0x5'));var interaction=require(_0x31d2('0x6'));var config=require(_0x31d2('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x31d2('0x8')]('/',auth[_0x31d2('0x9')](),controller[_0x31d2('0xa')]);router[_0x31d2('0x8')](_0x31d2('0xb'),auth[_0x31d2('0x9')](),controller[_0x31d2('0xc')]);router[_0x31d2('0xd')]('/',auth['isAuthenticated'](),controller[_0x31d2('0xe')]);router['put']('/:id',auth[_0x31d2('0x9')](),controller[_0x31d2('0xf')]);router[_0x31d2('0x10')](_0x31d2('0xb'),auth[_0x31d2('0x9')](),controller['destroy']);module[_0x31d2('0x11')]=router;
\ No newline at end of file
+var _0x420b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','post','create','update','delete','destroy','exports','multer','util'];(function(_0x1122fc,_0x157e1a){var _0x512160=function(_0x3c8780){while(--_0x3c8780){_0x1122fc['push'](_0x1122fc['shift']());}};_0x512160(++_0x157e1a);}(_0x420b,0x178));var _0xb420=function(_0x44e6be,_0x337dd4){_0x44e6be=_0x44e6be-0x0;var _0x49ce9a=_0x420b[_0x44e6be];return _0x49ce9a;};'use strict';var multer=require(_0xb420('0x0'));var util=require(_0xb420('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb420('0x2'));var router=express[_0xb420('0x3')]();var fs_extra=require(_0xb420('0x4'));var auth=require(_0xb420('0x5'));var interaction=require(_0xb420('0x6'));var config=require(_0xb420('0x7'));var controller=require(_0xb420('0x8'));router[_0xb420('0x9')]('/',auth[_0xb420('0xa')](),controller['index']);router[_0xb420('0x9')](_0xb420('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb420('0xc')]('/',auth[_0xb420('0xa')](),controller[_0xb420('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb420('0xe')]);router[_0xb420('0xf')](_0xb420('0xb'),auth[_0xb420('0xa')](),controller[_0xb420('0x10')]);module[_0xb420('0x11')]=router;
\ No newline at end of file
index 1eb08bb..79b0b5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6599=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0xb8e76e,_0x1c225f){var _0x42b7ee=function(_0x2c3599){while(--_0x2c3599){_0xb8e76e['push'](_0xb8e76e['shift']());}};_0x42b7ee(++_0x1c225f);}(_0x6599,0x18b));var _0x9659=function(_0x33d4a2,_0x2baaf4){_0x33d4a2=_0x33d4a2-0x0;var _0x2c793f=_0x6599[_0x33d4a2];return _0x2c793f;};'use strict';var Sequelize=require(_0x9659('0x0'));module[_0x9659('0x1')]={'type':{'type':Sequelize[_0x9659('0x2')](_0x9659('0x3'),_0x9659('0x4'),_0x9659('0x5'),_0x9659('0x6'),_0x9659('0x7')),'defaultValue':_0x9659('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9659('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x9659('0x3'),_0x9659('0x4'),_0x9659('0x5'))},'keyContent':{'type':Sequelize[_0x9659('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9659('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9659('0x8')]}};
\ No newline at end of file
+var _0x24d0=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x1521cf,_0xcbbd1e){var _0x47c8f7=function(_0x1044eb){while(--_0x1044eb){_0x1521cf['push'](_0x1521cf['shift']());}};_0x47c8f7(++_0xcbbd1e);}(_0x24d0,0x190));var _0x024d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x24d0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x024d('0x0'));module[_0x024d('0x1')]={'type':{'type':Sequelize[_0x024d('0x2')](_0x024d('0x3'),_0x024d('0x4'),_0x024d('0x5'),_0x024d('0x6'),_0x024d('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x024d('0x8')]},'key':{'type':Sequelize[_0x024d('0x8')]},'keyType':{'type':Sequelize[_0x024d('0x2')](_0x024d('0x3'),_0x024d('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x024d('0x8')]},'idField':{'type':Sequelize[_0x024d('0x8')]},'nameField':{'type':Sequelize[_0x024d('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x024d('0x8')]}};
\ No newline at end of file
index fbc232d..87b4ce5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x765e=['sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','update','then','destroy','error','stack','index','map','FreshdeskField','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','order'];(function(_0x120ed6,_0x44ee90){var _0x1e6dfc=function(_0x36a3ce){while(--_0x36a3ce){_0x120ed6['push'](_0x120ed6['shift']());}};_0x1e6dfc(++_0x44ee90);}(_0x765e,0x131));var _0xe765=function(_0x3be7b2,_0x47dc1f){_0x3be7b2=_0x3be7b2-0x0;var _0x15ea22=_0x765e[_0x3be7b2];return _0x15ea22;};'use strict';var emlformat=require(_0xe765('0x0'));var rimraf=require(_0xe765('0x1'));var zipdir=require(_0xe765('0x2'));var jsonpatch=require(_0xe765('0x3'));var rp=require(_0xe765('0x4'));var moment=require(_0xe765('0x5'));var BPromise=require(_0xe765('0x6'));var Mustache=require(_0xe765('0x7'));var util=require(_0xe765('0x8'));var path=require(_0xe765('0x9'));var sox=require(_0xe765('0xa'));var csv=require(_0xe765('0xb'));var ejs=require(_0xe765('0xc'));var fs=require('fs');var fs_extra=require(_0xe765('0xd'));var _=require(_0xe765('0xe'));var squel=require('squel');var crypto=require(_0xe765('0xf'));var jsforce=require(_0xe765('0x10'));var deskjs=require(_0xe765('0x11'));var toCsv=require(_0xe765('0xb'));var querystring=require(_0xe765('0x12'));var Papa=require(_0xe765('0x13'));var Redis=require(_0xe765('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe765('0x15'));var as=require(_0xe765('0x16'));var hardwareService=require(_0xe765('0x17'));var logger=require('../../config/logger')(_0xe765('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe765('0x19'))['db'];function respondWithStatusCode(_0x18177f,_0x9411a0){_0x9411a0=_0x9411a0||0xcc;return function(_0x27456b){if(_0x27456b){return _0x18177f[_0xe765('0x1a')](_0x9411a0);}return _0x18177f['status'](_0x9411a0)[_0xe765('0x1b')]();};}function respondWithResult(_0x3a26d8,_0x395312){_0x395312=_0x395312||0xc8;return function(_0x58dc37){if(_0x58dc37){return _0x3a26d8[_0xe765('0x1c')](_0x395312)['json'](_0x58dc37);}};}function respondWithFilteredResult(_0x50e2ab,_0x2f673b){return function(_0x1b1cfe){if(_0x1b1cfe){var _0x3c887b=typeof _0x2f673b['offset']===_0xe765('0x1d')&&typeof _0x2f673b[_0xe765('0x1e')]===_0xe765('0x1d');var _0x1db3ca=_0x1b1cfe[_0xe765('0x1f')];var _0xf93371=_0x3c887b?0x0:_0x2f673b[_0xe765('0x20')];var _0x2a95a9=_0x3c887b?_0x1b1cfe[_0xe765('0x1f')]:_0x2f673b['offset']+_0x2f673b[_0xe765('0x1e')];var _0x56905c;if(_0x2a95a9>=_0x1db3ca){_0x2a95a9=_0x1db3ca;_0x56905c=0xc8;}else{_0x56905c=0xce;}_0x50e2ab[_0xe765('0x1c')](_0x56905c);return _0x50e2ab[_0xe765('0x21')]('Content-Range',_0xf93371+'-'+_0x2a95a9+'/'+_0x1db3ca)[_0xe765('0x22')](_0x1b1cfe);}return null;};}function patchUpdates(_0x59118f){return function(_0x1c73c8){try{jsonpatch[_0xe765('0x23')](_0x1c73c8,_0x59118f,!![]);}catch(_0x1efb96){return BPromise['reject'](_0x1efb96);}return _0x1c73c8['save']();};}function saveUpdates(_0x4b789b,_0x1c6de4){return function(_0x2a4427){if(_0x2a4427){return _0x2a4427[_0xe765('0x24')](_0x4b789b)[_0xe765('0x25')](function(_0x54b59c){return _0x54b59c;});}return null;};}function removeEntity(_0x50cfcb,_0x18ba77){return function(_0x2e2a34){if(_0x2e2a34){return _0x2e2a34[_0xe765('0x26')]()[_0xe765('0x25')](function(){_0x50cfcb[_0xe765('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aacbc,_0x5464b4){return function(_0x2b1f66){if(!_0x2b1f66){_0x1aacbc[_0xe765('0x1a')](0x194);}return _0x2b1f66;};}function handleError(_0xd877f3,_0x357f4e){_0x357f4e=_0x357f4e||0x1f4;return function(_0x40492d){logger[_0xe765('0x27')](_0x40492d[_0xe765('0x28')]);if(_0x40492d['name']){delete _0x40492d['name'];}_0xd877f3[_0xe765('0x1c')](_0x357f4e)['send'](_0x40492d);};}exports[_0xe765('0x29')]=function(_0x3f7493,_0x2fcbc9){var _0x64ffd4={},_0x1a8c01={},_0x4fce2c={'count':0x0,'rows':[]};var _0x43349b=_[_0xe765('0x2a')](db[_0xe765('0x2b')]['rawAttributes'],function(_0x5947c1){return{'name':_0x5947c1[_0xe765('0x2c')],'type':_0x5947c1['type'][_0xe765('0x2d')]};});_0x1a8c01[_0xe765('0x2e')]=_[_0xe765('0x2a')](_0x43349b,_0xe765('0x2f'));_0x1a8c01[_0xe765('0x30')]=_['keys'](_0x3f7493['query']);_0x1a8c01[_0xe765('0x31')]=_[_0xe765('0x32')](_0x1a8c01[_0xe765('0x2e')],_0x1a8c01[_0xe765('0x30')]);_0x64ffd4[_0xe765('0x33')]=_['intersection'](_0x1a8c01['model'],qs[_0xe765('0x34')](_0x3f7493['query'][_0xe765('0x34')]));_0x64ffd4[_0xe765('0x33')]=_0x64ffd4[_0xe765('0x33')][_0xe765('0x35')]?_0x64ffd4[_0xe765('0x33')]:_0x1a8c01[_0xe765('0x2e')];if(!_0x3f7493[_0xe765('0x30')]['hasOwnProperty']('nolimit')){_0x64ffd4['limit']=qs[_0xe765('0x1e')](_0x3f7493[_0xe765('0x30')][_0xe765('0x1e')]);_0x64ffd4[_0xe765('0x20')]=qs['offset'](_0x3f7493[_0xe765('0x30')][_0xe765('0x20')]);}_0x64ffd4[_0xe765('0x36')]=qs[_0xe765('0x37')](_0x3f7493['query'][_0xe765('0x37')]);_0x64ffd4['where']=qs[_0xe765('0x31')](_[_0xe765('0x38')](_0x3f7493[_0xe765('0x30')],_0x1a8c01[_0xe765('0x31')]),_0x43349b);if(_0x3f7493[_0xe765('0x30')][_0xe765('0x39')]){_0x64ffd4[_0xe765('0x3a')]=_[_0xe765('0x3b')](_0x64ffd4[_0xe765('0x3a')],{'$or':_[_0xe765('0x2a')](_0x43349b,function(_0x5e21ae){if(_0x5e21ae[_0xe765('0x3c')]!==_0xe765('0x3d')){var _0x11b459={};_0x11b459[_0x5e21ae['name']]={'$like':'%'+_0x3f7493['query']['filter']+'%'};return _0x11b459;}})});}_0x64ffd4=_[_0xe765('0x3b')]({},_0x64ffd4,_0x3f7493['options']);var _0x1f0db1={'where':_0x64ffd4[_0xe765('0x3a')]};return db[_0xe765('0x2b')][_0xe765('0x1f')](_0x1f0db1)['then'](function(_0x363f59){_0x4fce2c[_0xe765('0x1f')]=_0x363f59;if(_0x3f7493[_0xe765('0x30')][_0xe765('0x3e')]){_0x64ffd4[_0xe765('0x3f')]=[{'all':!![]}];}return db[_0xe765('0x2b')][_0xe765('0x40')](_0x64ffd4);})[_0xe765('0x25')](function(_0xb92246){_0x4fce2c[_0xe765('0x41')]=_0xb92246;return _0x4fce2c;})['then'](respondWithFilteredResult(_0x2fcbc9,_0x64ffd4))[_0xe765('0x42')](handleError(_0x2fcbc9,null));};exports['show']=function(_0x1248ea,_0x1d2b24){var _0x4d2814={'raw':!![],'where':{'id':_0x1248ea['params']['id']}},_0x3977e5={};_0x3977e5['model']=_['keys'](db[_0xe765('0x2b')][_0xe765('0x43')]);_0x3977e5[_0xe765('0x30')]=_['keys'](_0x1248ea[_0xe765('0x30')]);_0x3977e5[_0xe765('0x31')]=_[_0xe765('0x32')](_0x3977e5[_0xe765('0x2e')],_0x3977e5[_0xe765('0x30')]);_0x4d2814[_0xe765('0x33')]=_[_0xe765('0x32')](_0x3977e5[_0xe765('0x2e')],qs[_0xe765('0x34')](_0x1248ea['query'][_0xe765('0x34')]));_0x4d2814['attributes']=_0x4d2814['attributes'][_0xe765('0x35')]?_0x4d2814['attributes']:_0x3977e5[_0xe765('0x2e')];if(_0x1248ea[_0xe765('0x30')][_0xe765('0x3e')]){_0x4d2814['include']=[{'all':!![]}];}_0x4d2814=_[_0xe765('0x3b')]({},_0x4d2814,_0x1248ea['options']);return db[_0xe765('0x2b')][_0xe765('0x44')](_0x4d2814)[_0xe765('0x25')](handleEntityNotFound(_0x1d2b24,null))['then'](respondWithResult(_0x1d2b24,null))[_0xe765('0x42')](handleError(_0x1d2b24,null));};exports[_0xe765('0x45')]=function(_0x115f16,_0x2d360e){return db['FreshdeskField']['create'](_0x115f16['body'],{})[_0xe765('0x25')](respondWithResult(_0x2d360e,0xc9))[_0xe765('0x42')](handleError(_0x2d360e,null));};exports[_0xe765('0x24')]=function(_0x58310d,_0x14834c){if(_0x58310d['body']['id']){delete _0x58310d[_0xe765('0x46')]['id'];}return db[_0xe765('0x2b')][_0xe765('0x44')]({'where':{'id':_0x58310d[_0xe765('0x47')]['id']}})[_0xe765('0x25')](handleEntityNotFound(_0x14834c,null))[_0xe765('0x25')](saveUpdates(_0x58310d['body'],null))[_0xe765('0x25')](respondWithResult(_0x14834c,null))[_0xe765('0x42')](handleError(_0x14834c,null));};exports[_0xe765('0x26')]=function(_0x1214a8,_0x14c3b5){return db[_0xe765('0x2b')]['find']({'where':{'id':_0x1214a8['params']['id']}})[_0xe765('0x25')](handleEntityNotFound(_0x14c3b5,null))[_0xe765('0x25')](removeEntity(_0x14c3b5,null))[_0xe765('0x42')](handleError(_0x14c3b5,null));};
\ No newline at end of file
+var _0x153f=['count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','keys','intersection','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0xff0751,_0x3689f4){var _0x1bdf97=function(_0x40b250){while(--_0x40b250){_0xff0751['push'](_0xff0751['shift']());}};_0x1bdf97(++_0x3689f4);}(_0x153f,0x15b));var _0xf153=function(_0x258ef1,_0x10b28a){_0x258ef1=_0x258ef1-0x0;var _0x216244=_0x153f[_0x258ef1];return _0x216244;};'use strict';var emlformat=require(_0xf153('0x0'));var rimraf=require(_0xf153('0x1'));var zipdir=require(_0xf153('0x2'));var jsonpatch=require(_0xf153('0x3'));var rp=require(_0xf153('0x4'));var moment=require(_0xf153('0x5'));var BPromise=require(_0xf153('0x6'));var Mustache=require('mustache');var util=require(_0xf153('0x7'));var path=require('path');var sox=require(_0xf153('0x8'));var csv=require(_0xf153('0x9'));var ejs=require(_0xf153('0xa'));var fs=require('fs');var fs_extra=require(_0xf153('0xb'));var _=require(_0xf153('0xc'));var squel=require('squel');var crypto=require(_0xf153('0xd'));var jsforce=require(_0xf153('0xe'));var deskjs=require(_0xf153('0xf'));var toCsv=require(_0xf153('0x9'));var querystring=require(_0xf153('0x10'));var Papa=require(_0xf153('0x11'));var Redis=require(_0xf153('0x12'));var authService=require(_0xf153('0x13'));var qs=require(_0xf153('0x14'));var as=require(_0xf153('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf153('0x16'))(_0xf153('0x17'));var utils=require(_0xf153('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf153('0x19'));var db=require(_0xf153('0x1a'))['db'];function respondWithStatusCode(_0x65756d,_0x1cc666){_0x1cc666=_0x1cc666||0xcc;return function(_0x256b7d){if(_0x256b7d){return _0x65756d[_0xf153('0x1b')](_0x1cc666);}return _0x65756d[_0xf153('0x1c')](_0x1cc666)[_0xf153('0x1d')]();};}function respondWithResult(_0x3e34fb,_0x4c5283){_0x4c5283=_0x4c5283||0xc8;return function(_0x18be7e){if(_0x18be7e){return _0x3e34fb[_0xf153('0x1c')](_0x4c5283)[_0xf153('0x1e')](_0x18be7e);}};}function respondWithFilteredResult(_0x406e6f,_0x3afea2){return function(_0x68f436){if(_0x68f436){var _0x273a90=typeof _0x3afea2[_0xf153('0x1f')]==='undefined'&&typeof _0x3afea2[_0xf153('0x20')]==='undefined';var _0x37093a=_0x68f436[_0xf153('0x21')];var _0x138dbe=_0x273a90?0x0:_0x3afea2[_0xf153('0x1f')];var _0x4e790d=_0x273a90?_0x68f436[_0xf153('0x21')]:_0x3afea2[_0xf153('0x1f')]+_0x3afea2[_0xf153('0x20')];var _0x14b83f;if(_0x4e790d>=_0x37093a){_0x4e790d=_0x37093a;_0x14b83f=0xc8;}else{_0x14b83f=0xce;}_0x406e6f[_0xf153('0x1c')](_0x14b83f);return _0x406e6f[_0xf153('0x22')](_0xf153('0x23'),_0x138dbe+'-'+_0x4e790d+'/'+_0x37093a)[_0xf153('0x1e')](_0x68f436);}return null;};}function patchUpdates(_0x3735a7){return function(_0x1dd340){try{jsonpatch[_0xf153('0x24')](_0x1dd340,_0x3735a7,!![]);}catch(_0x3665a2){return BPromise['reject'](_0x3665a2);}return _0x1dd340[_0xf153('0x25')]();};}function saveUpdates(_0x395f28,_0x3d3e41){return function(_0x32e759){if(_0x32e759){return _0x32e759[_0xf153('0x26')](_0x395f28)[_0xf153('0x27')](function(_0x465d88){return _0x465d88;});}return null;};}function removeEntity(_0x4376f7,_0xf67cde){return function(_0x38190c){if(_0x38190c){return _0x38190c[_0xf153('0x28')]()[_0xf153('0x27')](function(){_0x4376f7[_0xf153('0x1c')](0xcc)[_0xf153('0x1d')]();});}};}function handleEntityNotFound(_0xe490f8,_0x35f9da){return function(_0x141ef4){if(!_0x141ef4){_0xe490f8[_0xf153('0x1b')](0x194);}return _0x141ef4;};}function handleError(_0x23acc3,_0x17f7a4){_0x17f7a4=_0x17f7a4||0x1f4;return function(_0x48ebdc){logger[_0xf153('0x29')](_0x48ebdc[_0xf153('0x2a')]);if(_0x48ebdc['name']){delete _0x48ebdc[_0xf153('0x2b')];}_0x23acc3[_0xf153('0x1c')](_0x17f7a4)['send'](_0x48ebdc);};}exports[_0xf153('0x2c')]=function(_0x10295e,_0x261ac0){var _0x2b9a9c={},_0x339e96={},_0x258976={'count':0x0,'rows':[]};var _0x441436=_[_0xf153('0x2d')](db[_0xf153('0x2e')][_0xf153('0x2f')],function(_0x13b541){return{'name':_0x13b541[_0xf153('0x30')],'type':_0x13b541['type'][_0xf153('0x31')]};});_0x339e96[_0xf153('0x32')]=_[_0xf153('0x2d')](_0x441436,_0xf153('0x2b'));_0x339e96['query']=_['keys'](_0x10295e[_0xf153('0x33')]);_0x339e96['filters']=_['intersection'](_0x339e96[_0xf153('0x32')],_0x339e96['query']);_0x2b9a9c[_0xf153('0x34')]=_['intersection'](_0x339e96[_0xf153('0x32')],qs[_0xf153('0x35')](_0x10295e['query'][_0xf153('0x35')]));_0x2b9a9c[_0xf153('0x34')]=_0x2b9a9c[_0xf153('0x34')][_0xf153('0x36')]?_0x2b9a9c[_0xf153('0x34')]:_0x339e96[_0xf153('0x32')];if(!_0x10295e['query'][_0xf153('0x37')]('nolimit')){_0x2b9a9c[_0xf153('0x20')]=qs[_0xf153('0x20')](_0x10295e[_0xf153('0x33')][_0xf153('0x20')]);_0x2b9a9c[_0xf153('0x1f')]=qs[_0xf153('0x1f')](_0x10295e['query'][_0xf153('0x1f')]);}_0x2b9a9c[_0xf153('0x38')]=qs[_0xf153('0x39')](_0x10295e['query'][_0xf153('0x39')]);_0x2b9a9c[_0xf153('0x3a')]=qs[_0xf153('0x3b')](_[_0xf153('0x3c')](_0x10295e[_0xf153('0x33')],_0x339e96[_0xf153('0x3b')]),_0x441436);if(_0x10295e['query'][_0xf153('0x3d')]){_0x2b9a9c[_0xf153('0x3a')]=_['merge'](_0x2b9a9c[_0xf153('0x3a')],{'$or':_[_0xf153('0x2d')](_0x441436,function(_0x357666){if(_0x357666[_0xf153('0x3e')]!==_0xf153('0x3f')){var _0x42360a={};_0x42360a[_0x357666[_0xf153('0x2b')]]={'$like':'%'+_0x10295e['query'][_0xf153('0x3d')]+'%'};return _0x42360a;}})});}_0x2b9a9c=_[_0xf153('0x40')]({},_0x2b9a9c,_0x10295e[_0xf153('0x41')]);var _0x352e7c={'where':_0x2b9a9c[_0xf153('0x3a')]};return db[_0xf153('0x2e')]['count'](_0x352e7c)['then'](function(_0xa3922b){_0x258976['count']=_0xa3922b;if(_0x10295e[_0xf153('0x33')][_0xf153('0x42')]){_0x2b9a9c[_0xf153('0x43')]=[{'all':!![]}];}return db[_0xf153('0x2e')][_0xf153('0x44')](_0x2b9a9c);})[_0xf153('0x27')](function(_0x5599e5){_0x258976['rows']=_0x5599e5;return _0x258976;})[_0xf153('0x27')](respondWithFilteredResult(_0x261ac0,_0x2b9a9c))[_0xf153('0x45')](handleError(_0x261ac0,null));};exports['show']=function(_0x21529a,_0x1c77a6){var _0x1edf65={'raw':!![],'where':{'id':_0x21529a[_0xf153('0x46')]['id']}},_0x3a9cb2={};_0x3a9cb2[_0xf153('0x32')]=_[_0xf153('0x47')](db[_0xf153('0x2e')][_0xf153('0x2f')]);_0x3a9cb2[_0xf153('0x33')]=_[_0xf153('0x47')](_0x21529a[_0xf153('0x33')]);_0x3a9cb2['filters']=_[_0xf153('0x48')](_0x3a9cb2[_0xf153('0x32')],_0x3a9cb2[_0xf153('0x33')]);_0x1edf65['attributes']=_[_0xf153('0x48')](_0x3a9cb2[_0xf153('0x32')],qs['fields'](_0x21529a[_0xf153('0x33')]['fields']));_0x1edf65[_0xf153('0x34')]=_0x1edf65[_0xf153('0x34')][_0xf153('0x36')]?_0x1edf65['attributes']:_0x3a9cb2[_0xf153('0x32')];if(_0x21529a[_0xf153('0x33')][_0xf153('0x42')]){_0x1edf65[_0xf153('0x43')]=[{'all':!![]}];}_0x1edf65=_[_0xf153('0x40')]({},_0x1edf65,_0x21529a['options']);return db[_0xf153('0x2e')][_0xf153('0x49')](_0x1edf65)['then'](handleEntityNotFound(_0x1c77a6,null))[_0xf153('0x27')](respondWithResult(_0x1c77a6,null))[_0xf153('0x45')](handleError(_0x1c77a6,null));};exports[_0xf153('0x4a')]=function(_0x5599a6,_0x657403){return db[_0xf153('0x2e')][_0xf153('0x4a')](_0x5599a6[_0xf153('0x4b')],{})[_0xf153('0x27')](respondWithResult(_0x657403,0xc9))[_0xf153('0x45')](handleError(_0x657403,null));};exports[_0xf153('0x26')]=function(_0x33e48,_0x3b91ed){if(_0x33e48['body']['id']){delete _0x33e48[_0xf153('0x4b')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x33e48['params']['id']}})[_0xf153('0x27')](handleEntityNotFound(_0x3b91ed,null))[_0xf153('0x27')](saveUpdates(_0x33e48['body'],null))[_0xf153('0x27')](respondWithResult(_0x3b91ed,null))[_0xf153('0x45')](handleError(_0x3b91ed,null));};exports['destroy']=function(_0x3f1ecb,_0xe6e023){return db[_0xf153('0x2e')][_0xf153('0x49')]({'where':{'id':_0x3f1ecb[_0xf153('0x46')]['id']}})[_0xf153('0x27')](handleEntityNotFound(_0xe6e023,null))['then'](removeEntity(_0xe6e023,null))[_0xf153('0x45')](handleError(_0xe6e023,null));};
\ No newline at end of file
index 6cca909..bdd4498 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x190a=['moment','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x2e485b,_0x374372){var _0x12c9b3=function(_0x354d18){while(--_0x354d18){_0x2e485b['push'](_0x2e485b['shift']());}};_0x12c9b3(++_0x374372);}(_0x190a,0x1ea));var _0xa190=function(_0x52d6b4,_0x30453c){_0x52d6b4=_0x52d6b4-0x0;var _0xe09124=_0x190a[_0x52d6b4];return _0xe09124;};'use strict';var _=require(_0xa190('0x0'));var util=require(_0xa190('0x1'));var logger=require(_0xa190('0x2'))(_0xa190('0x3'));var moment=require(_0xa190('0x4'));var BPromise=require(_0xa190('0x5'));var rp=require(_0xa190('0x6'));var fs=require('fs');var path=require(_0xa190('0x7'));var rimraf=require(_0xa190('0x8'));var config=require('../../config/environment');var attributes=require(_0xa190('0x9'));module['exports']=function(_0x230098,_0x2207f2){return _0x230098['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xa190('0xa'),'fields':[_0xa190('0xb'),_0xa190('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3ab0=['../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x1e3d17,_0x4b1732){var _0x1304e8=function(_0x52fe56){while(--_0x52fe56){_0x1e3d17['push'](_0x1e3d17['shift']());}};_0x1304e8(++_0x4b1732);}(_0x3ab0,0xa9));var _0x03ab=function(_0x1294fb,_0x209be5){_0x1294fb=_0x1294fb-0x0;var _0x10a696=_0x3ab0[_0x1294fb];return _0x10a696;};'use strict';var _=require(_0x03ab('0x0'));var util=require(_0x03ab('0x1'));var logger=require(_0x03ab('0x2'))('api');var moment=require(_0x03ab('0x3'));var BPromise=require(_0x03ab('0x4'));var rp=require(_0x03ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03ab('0x6'));var config=require(_0x03ab('0x7'));var attributes=require(_0x03ab('0x8'));module[_0x03ab('0x9')]=function(_0x1f7f03,_0x180d08){return _0x1f7f03[_0x03ab('0xa')](_0x03ab('0xb'),attributes,{'tableName':_0x03ab('0xc'),'paranoid':![],'indexes':[{'name':_0x03ab('0xd'),'fields':[_0x03ab('0xe'),_0x03ab('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 3ddcda0..4fe7de4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x909e=['debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x234c3a,_0x2bba18){var _0x179b63=function(_0x3bdae9){while(--_0x3bdae9){_0x234c3a['push'](_0x234c3a['shift']());}};_0x179b63(++_0x2bba18);}(_0x909e,0x69));var _0xe909=function(_0x511185,_0x501091){_0x511185=_0x511185-0x0;var _0x4511a7=_0x909e[_0x511185];return _0x4511a7;};'use strict';var _=require('lodash');var util=require(_0xe909('0x0'));var moment=require(_0xe909('0x1'));var BPromise=require('bluebird');var rs=require(_0xe909('0x2'));var fs=require('fs');var Redis=require(_0xe909('0x3'));var db=require(_0xe909('0x4'))['db'];var utils=require(_0xe909('0x5'));var logger=require(_0xe909('0x6'))(_0xe909('0x7'));var config=require(_0xe909('0x8'));var jayson=require(_0xe909('0x9'));var client=jayson[_0xe909('0xa')][_0xe909('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x874a3b,_0xd1f8e3,_0x1958bf){return new BPromise(function(_0x141bba,_0x1a70e1){return client['request'](_0x874a3b,_0x1958bf)[_0xe909('0xc')](function(_0x5781e5){logger[_0xe909('0xd')]('FreshdeskField,\x20%s,\x20%s',_0xd1f8e3,_0xe909('0xe'));logger[_0xe909('0xf')](_0xe909('0x10'),_0xd1f8e3,_0xe909('0xe'),JSON[_0xe909('0x11')](_0x5781e5));if(_0x5781e5[_0xe909('0x12')]){if(_0x5781e5[_0xe909('0x12')][_0xe909('0x13')]===0x1f4){logger[_0xe909('0x12')]('FreshdeskField,\x20%s,\x20%s',_0xd1f8e3,_0x5781e5[_0xe909('0x12')][_0xe909('0x14')]);return _0x1a70e1(_0x5781e5['error'][_0xe909('0x14')]);}logger['error'](_0xe909('0x15'),_0xd1f8e3,_0x5781e5[_0xe909('0x12')][_0xe909('0x14')]);return _0x141bba(_0x5781e5[_0xe909('0x12')][_0xe909('0x14')]);}else{logger[_0xe909('0xd')](_0xe909('0x15'),_0xd1f8e3,'request\x20sent');_0x141bba(_0x5781e5[_0xe909('0x16')]['message']);}})[_0xe909('0x17')](function(_0x2831d6){logger['error']('FreshdeskField,\x20%s,\x20%s',_0xd1f8e3,_0x2831d6);_0x1a70e1(_0x2831d6);});});}
\ No newline at end of file
+var _0xb13b=['result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FreshdeskField,\x20%s,\x20%s','message'];(function(_0x33113c,_0xde5a){var _0x370927=function(_0x17b857){while(--_0x17b857){_0x33113c['push'](_0x33113c['shift']());}};_0x370927(++_0xde5a);}(_0xb13b,0xc7));var _0xbb13=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb13b[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xbb13('0x0'));var util=require('util');var moment=require(_0xbb13('0x1'));var BPromise=require(_0xbb13('0x2'));var rs=require(_0xbb13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbb13('0x4'));var logger=require(_0xbb13('0x5'))(_0xbb13('0x6'));var config=require(_0xbb13('0x7'));var jayson=require(_0xbb13('0x8'));var client=jayson[_0xbb13('0x9')][_0xbb13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e4b1b,_0x1ebb97,_0x8a06a1){return new BPromise(function(_0x48747d,_0x3c238a){return client[_0xbb13('0xb')](_0x4e4b1b,_0x8a06a1)[_0xbb13('0xc')](function(_0x47d7eb){logger[_0xbb13('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x1ebb97,'request\x20sent');logger[_0xbb13('0xe')](_0xbb13('0xf'),_0x1ebb97,_0xbb13('0x10'),JSON[_0xbb13('0x11')](_0x47d7eb));if(_0x47d7eb[_0xbb13('0x12')]){if(_0x47d7eb[_0xbb13('0x12')]['code']===0x1f4){logger['error'](_0xbb13('0x13'),_0x1ebb97,_0x47d7eb[_0xbb13('0x12')]['message']);return _0x3c238a(_0x47d7eb[_0xbb13('0x12')][_0xbb13('0x14')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x1ebb97,_0x47d7eb['error'][_0xbb13('0x14')]);return _0x48747d(_0x47d7eb['error']['message']);}else{logger['info'](_0xbb13('0x13'),_0x1ebb97,_0xbb13('0x10'));_0x48747d(_0x47d7eb[_0xbb13('0x15')][_0xbb13('0x14')]);}})['catch'](function(_0x258044){logger[_0xbb13('0x12')](_0xbb13('0x13'),_0x1ebb97,_0x258044);_0x3c238a(_0x258044);});});}
\ No newline at end of file
index 1b8f985..ffdb889 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c7c=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xe33eca,_0x332ee5){var _0x2184d6=function(_0x49d39a){while(--_0x49d39a){_0xe33eca['push'](_0xe33eca['shift']());}};_0x2184d6(++_0x332ee5);}(_0x1c7c,0x164));var _0xc1c7=function(_0x1688b7,_0x1500fe){_0x1688b7=_0x1688b7-0x0;var _0x3cace3=_0x1c7c[_0x1688b7];return _0x3cace3;};'use strict';var multer=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var path=require(_0xc1c7('0x2'));var timeout=require(_0xc1c7('0x3'));var express=require('express');var router=express[_0xc1c7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1c7('0x5'));var interaction=require(_0xc1c7('0x6'));var config=require(_0xc1c7('0x7'));var controller=require(_0xc1c7('0x8'));router[_0xc1c7('0x9')]('/',auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xb')]);router[_0xc1c7('0x9')](_0xc1c7('0xc'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xd')]);router[_0xc1c7('0x9')](_0xc1c7('0xe'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0xf')]);router[_0xc1c7('0x9')](_0xc1c7('0x10'),auth['isAuthenticated'](),controller[_0xc1c7('0x11')]);router[_0xc1c7('0x12')]('/',auth['isAuthenticated'](),controller[_0xc1c7('0x13')]);router[_0xc1c7('0x12')](_0xc1c7('0xe'),auth['isAuthenticated'](),controller[_0xc1c7('0x14')]);router[_0xc1c7('0x15')](_0xc1c7('0xc'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x16')]);router[_0xc1c7('0x17')](_0xc1c7('0xc'),auth[_0xc1c7('0xa')](),controller[_0xc1c7('0x18')]);module[_0xc1c7('0x19')]=router;
\ No newline at end of file
+var _0x3c81=['connect-timeout','express','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','multer','util'];(function(_0x5cf56d,_0x4bbb3c){var _0x4cde2a=function(_0x51694d){while(--_0x51694d){_0x5cf56d['push'](_0x5cf56d['shift']());}};_0x4cde2a(++_0x4bbb3c);}(_0x3c81,0x102));var _0x13c8=function(_0x5aab38,_0x34a0ab){_0x5aab38=_0x5aab38-0x0;var _0x46cc7b=_0x3c81[_0x5aab38];return _0x46cc7b;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0xf')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x11')]);router['put'](_0x13c8('0x9'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router[_0x13c8('0x13')]('/:id',auth[_0x13c8('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 27709dc..903234a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b17=['username','sequelize','STRING'];(function(_0x454302,_0x2e9c2e){var _0x31c178=function(_0x147965){while(--_0x147965){_0x454302['push'](_0x454302['shift']());}};_0x31c178(++_0x2e9c2e);}(_0x4b17,0x10f));var _0x74b1=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x4b17[_0x390a19];return _0x5d8230;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'name':{'type':Sequelize[_0x74b1('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x74b1('0x1')],'unique':_0x74b1('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x74b1('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x32b6=['remoteUri','sequelize','exports','STRING'];(function(_0x393500,_0x1037af){var _0x120d3b=function(_0x17234e){while(--_0x17234e){_0x393500['push'](_0x393500['shift']());}};_0x120d3b(++_0x1037af);}(_0x32b6,0x1d1));var _0x632b=function(_0x18e75f,_0x19f8c6){_0x18e75f=_0x18e75f-0x0;var _0xaf4c69=_0x32b6[_0x18e75f];return _0xaf4c69;};'use strict';var Sequelize=require(_0x632b('0x0'));module[_0x632b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x632b('0x2')]},'username':{'type':Sequelize[_0x632b('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x632b('0x2')],'unique':_0x632b('0x3')},'serverUrl':{'type':Sequelize[_0x632b('0x2')],'allowNull':![]}};
\ No newline at end of file
index 2e06f60..840e29a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a52=['key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','FreshsalesAccount','includeAll','include','rows','catch','show','create','body','find','params','getConfigurations','findOne','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','username','remoteUri','apiKey','slice','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','type'];(function(_0x5bffd7,_0x1ac4f4){var _0x48e5dd=function(_0xdc6b8a){while(--_0xdc6b8a){_0x5bffd7['push'](_0x5bffd7['shift']());}};_0x48e5dd(++_0x1ac4f4);}(_0x0a52,0xa1));var _0x20a5=function(_0x44ad71,_0x52b15b){_0x44ad71=_0x44ad71-0x0;var _0x98dcae=_0x0a52[_0x44ad71];return _0x98dcae;};'use strict';var emlformat=require(_0x20a5('0x0'));var rimraf=require(_0x20a5('0x1'));var zipdir=require(_0x20a5('0x2'));var jsonpatch=require(_0x20a5('0x3'));var rp=require(_0x20a5('0x4'));var moment=require(_0x20a5('0x5'));var BPromise=require(_0x20a5('0x6'));var Mustache=require('mustache');var util=require(_0x20a5('0x7'));var path=require(_0x20a5('0x8'));var sox=require(_0x20a5('0x9'));var csv=require(_0x20a5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20a5('0xb'));var _=require('lodash');var squel=require(_0x20a5('0xc'));var crypto=require(_0x20a5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x20a5('0xe'));var toCsv=require(_0x20a5('0xa'));var querystring=require(_0x20a5('0xf'));var Papa=require(_0x20a5('0x10'));var Redis=require('ioredis');var authService=require(_0x20a5('0x11'));var qs=require(_0x20a5('0x12'));var as=require(_0x20a5('0x13'));var hardwareService=require(_0x20a5('0x14'));var logger=require(_0x20a5('0x15'))(_0x20a5('0x16'));var utils=require(_0x20a5('0x17'));var config=require(_0x20a5('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x20a5('0x19'));function respondWithStatusCode(_0x24a91f,_0x4638af){_0x4638af=_0x4638af||0xcc;return function(_0x3661a8){if(_0x3661a8){return _0x24a91f[_0x20a5('0x1a')](_0x4638af);}return _0x24a91f[_0x20a5('0x1b')](_0x4638af)[_0x20a5('0x1c')]();};}function respondWithResult(_0x3e76a0,_0x148a4a){_0x148a4a=_0x148a4a||0xc8;return function(_0x2e4624){if(_0x2e4624){return _0x3e76a0[_0x20a5('0x1b')](_0x148a4a)[_0x20a5('0x1d')](_0x2e4624);}};}function respondWithFilteredResult(_0x16ee1b,_0x2b6b07){return function(_0xf1975a){if(_0xf1975a){var _0x21d520=typeof _0x2b6b07[_0x20a5('0x1e')]==='undefined'&&typeof _0x2b6b07[_0x20a5('0x1f')]==='undefined';var _0x56a794=_0xf1975a[_0x20a5('0x20')];var _0x502488=_0x21d520?0x0:_0x2b6b07[_0x20a5('0x1e')];var _0x233e11=_0x21d520?_0xf1975a[_0x20a5('0x20')]:_0x2b6b07[_0x20a5('0x1e')]+_0x2b6b07[_0x20a5('0x1f')];var _0x461c9c;if(_0x233e11>=_0x56a794){_0x233e11=_0x56a794;_0x461c9c=0xc8;}else{_0x461c9c=0xce;}_0x16ee1b['status'](_0x461c9c);return _0x16ee1b[_0x20a5('0x21')](_0x20a5('0x22'),_0x502488+'-'+_0x233e11+'/'+_0x56a794)[_0x20a5('0x1d')](_0xf1975a);}return null;};}function patchUpdates(_0x27df58){return function(_0x9717ed){try{jsonpatch['apply'](_0x9717ed,_0x27df58,!![]);}catch(_0xad4f20){return BPromise[_0x20a5('0x23')](_0xad4f20);}return _0x9717ed[_0x20a5('0x24')]();};}function saveUpdates(_0xd047fd,_0x3acb31){return function(_0xae1b2f){if(_0xae1b2f){return _0xae1b2f[_0x20a5('0x25')](_0xd047fd)['then'](function(_0x524aba){return _0x524aba;});}return null;};}function removeEntity(_0x3647ca,_0x5ec1de){return function(_0x26567b){if(_0x26567b){return _0x26567b[_0x20a5('0x26')]()[_0x20a5('0x27')](function(){_0x3647ca['status'](0xcc)[_0x20a5('0x1c')]();});}};}function handleEntityNotFound(_0x404c13,_0x455acc){return function(_0x50d3d1){if(!_0x50d3d1){_0x404c13['sendStatus'](0x194);}return _0x50d3d1;};}function handleError(_0x37e6c5,_0x439d73){_0x439d73=_0x439d73||0x1f4;return function(_0x49d77f){logger[_0x20a5('0x28')](_0x49d77f[_0x20a5('0x29')]);if(_0x49d77f[_0x20a5('0x2a')]){delete _0x49d77f[_0x20a5('0x2a')];}_0x37e6c5[_0x20a5('0x1b')](_0x439d73)[_0x20a5('0x2b')](_0x49d77f);};}exports[_0x20a5('0x2c')]=function(_0x318da3,_0x7c026e){var _0x3ef05f={},_0x35fd3c={},_0x2a6132={'count':0x0,'rows':[]};var _0x323371=_['map'](db['FreshsalesAccount'][_0x20a5('0x2d')],function(_0x407df8){return{'name':_0x407df8['fieldName'],'type':_0x407df8[_0x20a5('0x2e')][_0x20a5('0x2f')]};});_0x35fd3c['model']=_[_0x20a5('0x30')](_0x323371,_0x20a5('0x2a'));_0x35fd3c[_0x20a5('0x31')]=_[_0x20a5('0x32')](_0x318da3[_0x20a5('0x31')]);_0x35fd3c[_0x20a5('0x33')]=_['intersection'](_0x35fd3c[_0x20a5('0x34')],_0x35fd3c[_0x20a5('0x31')]);_0x3ef05f[_0x20a5('0x35')]=_[_0x20a5('0x36')](_0x35fd3c[_0x20a5('0x34')],qs[_0x20a5('0x37')](_0x318da3[_0x20a5('0x31')]['fields']));_0x3ef05f[_0x20a5('0x35')]=_0x3ef05f[_0x20a5('0x35')][_0x20a5('0x38')]?_0x3ef05f[_0x20a5('0x35')]:_0x35fd3c['model'];if(!_0x318da3[_0x20a5('0x31')][_0x20a5('0x39')](_0x20a5('0x3a'))){_0x3ef05f['limit']=qs['limit'](_0x318da3[_0x20a5('0x31')][_0x20a5('0x1f')]);_0x3ef05f[_0x20a5('0x1e')]=qs[_0x20a5('0x1e')](_0x318da3['query'][_0x20a5('0x1e')]);}_0x3ef05f[_0x20a5('0x3b')]=qs['sort'](_0x318da3[_0x20a5('0x31')]['sort']);_0x3ef05f[_0x20a5('0x3c')]=qs['filters'](_[_0x20a5('0x3d')](_0x318da3['query'],_0x35fd3c['filters']),_0x323371);if(_0x318da3[_0x20a5('0x31')][_0x20a5('0x3e')]){_0x3ef05f[_0x20a5('0x3c')]=_[_0x20a5('0x3f')](_0x3ef05f[_0x20a5('0x3c')],{'$or':_[_0x20a5('0x30')](_0x323371,function(_0x58125b){if(_0x58125b[_0x20a5('0x2e')]!==_0x20a5('0x40')){var _0x54203c={};_0x54203c[_0x58125b[_0x20a5('0x2a')]]={'$like':'%'+_0x318da3[_0x20a5('0x31')]['filter']+'%'};return _0x54203c;}})});}_0x3ef05f=_[_0x20a5('0x3f')]({},_0x3ef05f,_0x318da3[_0x20a5('0x41')]);var _0x152791={'where':_0x3ef05f['where']};return db[_0x20a5('0x42')][_0x20a5('0x20')](_0x152791)['then'](function(_0x1f48c8){_0x2a6132[_0x20a5('0x20')]=_0x1f48c8;if(_0x318da3['query'][_0x20a5('0x43')]){_0x3ef05f[_0x20a5('0x44')]=[{'all':!![]}];}return db[_0x20a5('0x42')]['findAll'](_0x3ef05f);})[_0x20a5('0x27')](function(_0x2a5ac3){_0x2a6132[_0x20a5('0x45')]=_0x2a5ac3;return _0x2a6132;})[_0x20a5('0x27')](respondWithFilteredResult(_0x7c026e,_0x3ef05f))[_0x20a5('0x46')](handleError(_0x7c026e,null));};exports[_0x20a5('0x47')]=function(_0x5ab9a4,_0x1c7423){var _0x3b7d06={'raw':![],'where':{'id':_0x5ab9a4['params']['id']}},_0x23a95c={};_0x23a95c[_0x20a5('0x34')]=_[_0x20a5('0x32')](db['FreshsalesAccount'][_0x20a5('0x2d')]);_0x23a95c[_0x20a5('0x31')]=_[_0x20a5('0x32')](_0x5ab9a4[_0x20a5('0x31')]);_0x23a95c[_0x20a5('0x33')]=_['intersection'](_0x23a95c[_0x20a5('0x34')],_0x23a95c['query']);_0x3b7d06[_0x20a5('0x35')]=_[_0x20a5('0x36')](_0x23a95c[_0x20a5('0x34')],qs[_0x20a5('0x37')](_0x5ab9a4['query']['fields']));_0x3b7d06[_0x20a5('0x35')]=_0x3b7d06[_0x20a5('0x35')][_0x20a5('0x38')]?_0x3b7d06[_0x20a5('0x35')]:_0x23a95c[_0x20a5('0x34')];if(_0x5ab9a4[_0x20a5('0x31')][_0x20a5('0x43')]){_0x3b7d06['include']=[{'all':!![]}];}_0x3b7d06=_[_0x20a5('0x3f')]({},_0x3b7d06,_0x5ab9a4[_0x20a5('0x41')]);return db['FreshsalesAccount']['find'](_0x3b7d06)[_0x20a5('0x27')](handleEntityNotFound(_0x1c7423,null))[_0x20a5('0x27')](respondWithResult(_0x1c7423,null))[_0x20a5('0x46')](handleError(_0x1c7423,null));};exports[_0x20a5('0x48')]=function(_0x43089a,_0x4edff7){return db['FreshsalesAccount']['create'](_0x43089a[_0x20a5('0x49')],{})[_0x20a5('0x27')](respondWithResult(_0x4edff7,0xc9))[_0x20a5('0x46')](handleError(_0x4edff7,null));};exports[_0x20a5('0x25')]=function(_0x5e078c,_0x24e67a){if(_0x5e078c[_0x20a5('0x49')]['id']){delete _0x5e078c['body']['id'];}return db['FreshsalesAccount'][_0x20a5('0x4a')]({'where':{'id':_0x5e078c[_0x20a5('0x4b')]['id']}})[_0x20a5('0x27')](handleEntityNotFound(_0x24e67a,null))['then'](saveUpdates(_0x5e078c['body'],null))[_0x20a5('0x27')](respondWithResult(_0x24e67a,null))[_0x20a5('0x46')](handleError(_0x24e67a,null));};exports[_0x20a5('0x26')]=function(_0x4cd21c,_0x33b07d){return db[_0x20a5('0x42')]['find']({'where':{'id':_0x4cd21c[_0x20a5('0x4b')]['id']}})[_0x20a5('0x27')](handleEntityNotFound(_0x33b07d,null))['then'](removeEntity(_0x33b07d,null))[_0x20a5('0x46')](handleError(_0x33b07d,null));};exports[_0x20a5('0x4c')]=function(_0x9adb78,_0x59ee5d,_0x464343){var _0xa5a380={};var _0xdc2bb6={};var _0x20be53;var _0x1e8da4;return db['FreshsalesAccount'][_0x20a5('0x4d')]({'where':{'id':_0x9adb78[_0x20a5('0x4b')]['id']}})[_0x20a5('0x27')](handleEntityNotFound(_0x59ee5d,null))['then'](function(_0x4e8743){if(_0x4e8743){_0x20be53=_0x4e8743;_0xdc2bb6[_0x20a5('0x34')]=_[_0x20a5('0x32')](db['FreshsalesConfiguration']['rawAttributes']);_0xdc2bb6[_0x20a5('0x31')]=_['keys'](_0x9adb78['query']);_0xdc2bb6[_0x20a5('0x33')]=_[_0x20a5('0x36')](_0xdc2bb6[_0x20a5('0x34')],_0xdc2bb6['query']);_0xa5a380[_0x20a5('0x35')]=_['intersection'](_0xdc2bb6['model'],qs[_0x20a5('0x37')](_0x9adb78[_0x20a5('0x31')][_0x20a5('0x37')]));_0xa5a380['attributes']=_0xa5a380[_0x20a5('0x35')]['length']?_0xa5a380[_0x20a5('0x35')]:_0xdc2bb6[_0x20a5('0x34')];_0xa5a380[_0x20a5('0x3b')]=qs[_0x20a5('0x4e')](_0x9adb78[_0x20a5('0x31')]['sort']);_0xa5a380[_0x20a5('0x3c')]=qs[_0x20a5('0x33')](_[_0x20a5('0x3d')](_0x9adb78['query'],_0xdc2bb6[_0x20a5('0x33')]));if(_0x9adb78[_0x20a5('0x31')][_0x20a5('0x3e')]){_0xa5a380[_0x20a5('0x3c')]=_[_0x20a5('0x3f')](_0xa5a380[_0x20a5('0x3c')],{'$or':_[_0x20a5('0x30')](_0xa5a380['attributes'],function(_0x14e3f2){var _0x542586={};_0x542586[_0x14e3f2]={'$like':'%'+_0x9adb78['query']['filter']+'%'};return _0x542586;})});}_0xa5a380=_[_0x20a5('0x3f')]({},_0xa5a380,_0x9adb78[_0x20a5('0x41')]);return _0x20be53[_0x20a5('0x4c')](_0xa5a380);}})[_0x20a5('0x27')](function(_0x38e80c){if(_0x38e80c){_0x1e8da4=_0x38e80c[_0x20a5('0x38')];if(!_0x9adb78[_0x20a5('0x31')]['hasOwnProperty'](_0x20a5('0x3a'))){_0xa5a380[_0x20a5('0x1f')]=qs[_0x20a5('0x1f')](_0x9adb78['query'][_0x20a5('0x1f')]);_0xa5a380['offset']=qs[_0x20a5('0x1e')](_0x9adb78['query'][_0x20a5('0x1e')]);}return _0x20be53[_0x20a5('0x4c')](_0xa5a380);}})[_0x20a5('0x27')](function(_0x35763d){if(_0x35763d){return _0x35763d?{'count':_0x1e8da4,'rows':_0x35763d}:null;}})['then'](respondWithResult(_0x59ee5d,null))[_0x20a5('0x46')](handleError(_0x59ee5d,null));};exports[_0x20a5('0x4f')]=function(_0x466c05,_0xc98076,_0x490b76){if(_0x466c05[_0x20a5('0x49')]['id']){delete _0x466c05[_0x20a5('0x49')]['id'];}return db['FreshsalesAccount'][_0x20a5('0x4d')]({'where':{'id':_0x466c05['params']['id']}})[_0x20a5('0x27')](handleEntityNotFound(_0xc98076,null))[_0x20a5('0x27')](function(_0x29af1e){if(_0x29af1e){_0x466c05['body'][_0x20a5('0x50')]=_0x29af1e['id'];_0x466c05[_0x20a5('0x49')][_0x20a5('0x51')]=integrations[_0x20a5('0x52')](_0x466c05['body'][_0x20a5('0x53')],_0x466c05[_0x20a5('0x49')][_0x20a5('0x2e')]);_0x466c05[_0x20a5('0x49')][_0x20a5('0x54')]=integrations[_0x20a5('0x55')](_0x466c05['body'][_0x20a5('0x53')],_0x466c05[_0x20a5('0x49')][_0x20a5('0x2e')]);return db[_0x20a5('0x56')][_0x20a5('0x48')](_0x466c05[_0x20a5('0x49')],{'include':[{'model':db['FreshsalesField'],'as':_0x20a5('0x51')},{'model':db['FreshsalesField'],'as':_0x20a5('0x54')}]});}return null;})[_0x20a5('0x27')](respondWithResult(_0xc98076,null))[_0x20a5('0x46')](handleError(_0xc98076,null));};exports['getFields']=function(_0x4a7d7f,_0x257dab,_0x5a6b5c){var _0xb7997='';var _0x1f7a3d='';return db['FreshsalesAccount'][_0x20a5('0x4d')]({'where':{'id':_0x4a7d7f[_0x20a5('0x4b')]['id']},'attributes':['id',_0x20a5('0x57'),_0x20a5('0x58'),_0x20a5('0x59')]})[_0x20a5('0x27')](handleEntityNotFound(_0x257dab,null))[_0x20a5('0x27')](function(_0x5cbcb6){if(_0x5cbcb6){_0x1f7a3d=_0x5cbcb6[_0x20a5('0x57')];_0xb7997=_0x5cbcb6[_0x20a5('0x58')];var _0x1380f6=_0x5cbcb6[_0x20a5('0x58')][_0x20a5('0x5a')](-0x1);if(_0x1380f6==='/'){_0xb7997=_0xb7997['substring'](0x0,_0xb7997[_0x20a5('0x5b')](_0x1380f6));}return rp({'method':'GET','uri':util[_0x20a5('0x5c')](_0x20a5('0x5d'),_0xb7997,_0x20a5('0x5e')),'headers':{'Authorization':_0x20a5('0x5f')+_0x5cbcb6[_0x20a5('0x59')]},'json':!![]});}})[_0x20a5('0x27')](function(_0x4fbadf){if(_0x4fbadf){var _0x56f102=_0x4fbadf[_0x20a5('0x60')];var _0xacc451=![];var _0x2bb103=null;for(_0x2bb103=0x0;_0x2bb103<_0x56f102[_0x20a5('0x38')];_0x2bb103++){if(_0x56f102[_0x2bb103][_0x20a5('0x61')]===_0x1f7a3d){_0xacc451=!![];}}if(_0xacc451){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x20a5('0x62')});}}})[_0x20a5('0x27')](respondWithResult(_0x257dab,null))['catch'](function(_0x48c1e5){var _0x2d175a=_0x4a7d7f[_0x20a5('0x31')][_0x20a5('0x63')]?0x1f4:_0x48c1e5[_0x20a5('0x64')]||0x1f4;logger[_0x20a5('0x28')](_0x20a5('0x65'),'getFields',_0x2d175a,JSON[_0x20a5('0x66')](_0x48c1e5));delete _0x48c1e5[_0x20a5('0x2a')];if(_0x2d175a===0x191){_0x2d175a=0x190;}_0x257dab[_0x20a5('0x1b')](_0x2d175a)['send'](_0x4a7d7f[_0x20a5('0x31')][_0x20a5('0x63')]?{'message':_0x20a5('0x67'),'statusCode':_0x48c1e5[_0x20a5('0x64')]}:_0x48c1e5);});};
\ No newline at end of file
+var _0x5ce2=['api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','then','include','rows','catch','length','includeAll','find','create','body','update','destroy','params','getConfigurations','findOne','FreshsalesConfiguration','order','pick','addConfiguration','AccountId','Descriptions','getDescriptions','channel','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0x5ce2,0x1e8));var _0x25ce=function(_0x25b528,_0x19be4a){_0x25b528=_0x25b528-0x0;var _0x412487=_0x5ce2[_0x25b528];return _0x412487;};'use strict';var emlformat=require(_0x25ce('0x0'));var rimraf=require(_0x25ce('0x1'));var zipdir=require(_0x25ce('0x2'));var jsonpatch=require(_0x25ce('0x3'));var rp=require(_0x25ce('0x4'));var moment=require('moment');var BPromise=require(_0x25ce('0x5'));var Mustache=require('mustache');var util=require(_0x25ce('0x6'));var path=require(_0x25ce('0x7'));var sox=require('sox');var csv=require(_0x25ce('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25ce('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25ce('0xa'));var deskjs=require(_0x25ce('0xb'));var toCsv=require(_0x25ce('0x8'));var querystring=require('querystring');var Papa=require(_0x25ce('0xc'));var Redis=require(_0x25ce('0xd'));var authService=require(_0x25ce('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x25ce('0xf'));var hardwareService=require(_0x25ce('0x10'));var logger=require('../../config/logger')(_0x25ce('0x11'));var utils=require(_0x25ce('0x12'));var config=require(_0x25ce('0x13'));var licenseUtil=require(_0x25ce('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x25ce('0x15'));function respondWithStatusCode(_0x442432,_0x548f5b){_0x548f5b=_0x548f5b||0xcc;return function(_0x2989ad){if(_0x2989ad){return _0x442432[_0x25ce('0x16')](_0x548f5b);}return _0x442432[_0x25ce('0x17')](_0x548f5b)[_0x25ce('0x18')]();};}function respondWithResult(_0x54bd46,_0x54a89f){_0x54a89f=_0x54a89f||0xc8;return function(_0x550d19){if(_0x550d19){return _0x54bd46[_0x25ce('0x17')](_0x54a89f)[_0x25ce('0x19')](_0x550d19);}};}function respondWithFilteredResult(_0x457427,_0x1f6668){return function(_0x4d36f8){if(_0x4d36f8){var _0x21d773=typeof _0x1f6668['offset']===_0x25ce('0x1a')&&typeof _0x1f6668[_0x25ce('0x1b')]===_0x25ce('0x1a');var _0x1f3058=_0x4d36f8[_0x25ce('0x1c')];var _0x4cd12b=_0x21d773?0x0:_0x1f6668[_0x25ce('0x1d')];var _0x134977=_0x21d773?_0x4d36f8[_0x25ce('0x1c')]:_0x1f6668[_0x25ce('0x1d')]+_0x1f6668[_0x25ce('0x1b')];var _0x2fdab4;if(_0x134977>=_0x1f3058){_0x134977=_0x1f3058;_0x2fdab4=0xc8;}else{_0x2fdab4=0xce;}_0x457427[_0x25ce('0x17')](_0x2fdab4);return _0x457427['set'](_0x25ce('0x1e'),_0x4cd12b+'-'+_0x134977+'/'+_0x1f3058)['json'](_0x4d36f8);}return null;};}function patchUpdates(_0x10b240){return function(_0x555e90){try{jsonpatch[_0x25ce('0x1f')](_0x555e90,_0x10b240,!![]);}catch(_0x3cea04){return BPromise[_0x25ce('0x20')](_0x3cea04);}return _0x555e90[_0x25ce('0x21')]();};}function saveUpdates(_0x5626f5,_0x4336e4){return function(_0x38ef17){if(_0x38ef17){return _0x38ef17['update'](_0x5626f5)['then'](function(_0x26f4f7){return _0x26f4f7;});}return null;};}function removeEntity(_0x27696f,_0x1536a2){return function(_0x7e05b9){if(_0x7e05b9){return _0x7e05b9['destroy']()['then'](function(){_0x27696f[_0x25ce('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8a8a,_0x5603b9){return function(_0x366388){if(!_0x366388){_0x3c8a8a['sendStatus'](0x194);}return _0x366388;};}function handleError(_0x24f777,_0x201796){_0x201796=_0x201796||0x1f4;return function(_0x4dc91a){logger[_0x25ce('0x22')](_0x4dc91a[_0x25ce('0x23')]);if(_0x4dc91a[_0x25ce('0x24')]){delete _0x4dc91a[_0x25ce('0x24')];}_0x24f777[_0x25ce('0x17')](_0x201796)[_0x25ce('0x25')](_0x4dc91a);};}exports[_0x25ce('0x26')]=function(_0x32d5b3,_0x970d9b){var _0x33640a={},_0x297338={},_0x136b75={'count':0x0,'rows':[]};var _0x55710f=_[_0x25ce('0x27')](db[_0x25ce('0x28')][_0x25ce('0x29')],function(_0x5b7d91){return{'name':_0x5b7d91[_0x25ce('0x2a')],'type':_0x5b7d91[_0x25ce('0x2b')][_0x25ce('0x2c')]};});_0x297338[_0x25ce('0x2d')]=_[_0x25ce('0x27')](_0x55710f,'name');_0x297338[_0x25ce('0x2e')]=_[_0x25ce('0x2f')](_0x32d5b3[_0x25ce('0x2e')]);_0x297338[_0x25ce('0x30')]=_[_0x25ce('0x31')](_0x297338[_0x25ce('0x2d')],_0x297338[_0x25ce('0x2e')]);_0x33640a[_0x25ce('0x32')]=_['intersection'](_0x297338[_0x25ce('0x2d')],qs[_0x25ce('0x33')](_0x32d5b3[_0x25ce('0x2e')][_0x25ce('0x33')]));_0x33640a['attributes']=_0x33640a[_0x25ce('0x32')]['length']?_0x33640a[_0x25ce('0x32')]:_0x297338[_0x25ce('0x2d')];if(!_0x32d5b3[_0x25ce('0x2e')][_0x25ce('0x34')](_0x25ce('0x35'))){_0x33640a['limit']=qs[_0x25ce('0x1b')](_0x32d5b3[_0x25ce('0x2e')][_0x25ce('0x1b')]);_0x33640a['offset']=qs[_0x25ce('0x1d')](_0x32d5b3['query'][_0x25ce('0x1d')]);}_0x33640a['order']=qs[_0x25ce('0x36')](_0x32d5b3[_0x25ce('0x2e')][_0x25ce('0x36')]);_0x33640a[_0x25ce('0x37')]=qs[_0x25ce('0x30')](_['pick'](_0x32d5b3[_0x25ce('0x2e')],_0x297338[_0x25ce('0x30')]),_0x55710f);if(_0x32d5b3['query'][_0x25ce('0x38')]){_0x33640a[_0x25ce('0x37')]=_[_0x25ce('0x39')](_0x33640a[_0x25ce('0x37')],{'$or':_[_0x25ce('0x27')](_0x55710f,function(_0x34689c){if(_0x34689c[_0x25ce('0x2b')]!=='VIRTUAL'){var _0x2a1da6={};_0x2a1da6[_0x34689c[_0x25ce('0x24')]]={'$like':'%'+_0x32d5b3['query']['filter']+'%'};return _0x2a1da6;}})});}_0x33640a=_[_0x25ce('0x39')]({},_0x33640a,_0x32d5b3[_0x25ce('0x3a')]);var _0x4dc2d0={'where':_0x33640a[_0x25ce('0x37')]};return db[_0x25ce('0x28')][_0x25ce('0x1c')](_0x4dc2d0)[_0x25ce('0x3b')](function(_0x309300){_0x136b75[_0x25ce('0x1c')]=_0x309300;if(_0x32d5b3[_0x25ce('0x2e')]['includeAll']){_0x33640a[_0x25ce('0x3c')]=[{'all':!![]}];}return db[_0x25ce('0x28')]['findAll'](_0x33640a);})[_0x25ce('0x3b')](function(_0x5dba59){_0x136b75[_0x25ce('0x3d')]=_0x5dba59;return _0x136b75;})[_0x25ce('0x3b')](respondWithFilteredResult(_0x970d9b,_0x33640a))[_0x25ce('0x3e')](handleError(_0x970d9b,null));};exports['show']=function(_0x59406d,_0x557afc){var _0x21d174={'raw':![],'where':{'id':_0x59406d['params']['id']}},_0x20d370={};_0x20d370['model']=_[_0x25ce('0x2f')](db[_0x25ce('0x28')]['rawAttributes']);_0x20d370['query']=_[_0x25ce('0x2f')](_0x59406d[_0x25ce('0x2e')]);_0x20d370[_0x25ce('0x30')]=_[_0x25ce('0x31')](_0x20d370[_0x25ce('0x2d')],_0x20d370[_0x25ce('0x2e')]);_0x21d174[_0x25ce('0x32')]=_['intersection'](_0x20d370['model'],qs[_0x25ce('0x33')](_0x59406d[_0x25ce('0x2e')][_0x25ce('0x33')]));_0x21d174['attributes']=_0x21d174[_0x25ce('0x32')][_0x25ce('0x3f')]?_0x21d174[_0x25ce('0x32')]:_0x20d370[_0x25ce('0x2d')];if(_0x59406d['query'][_0x25ce('0x40')]){_0x21d174[_0x25ce('0x3c')]=[{'all':!![]}];}_0x21d174=_[_0x25ce('0x39')]({},_0x21d174,_0x59406d[_0x25ce('0x3a')]);return db[_0x25ce('0x28')][_0x25ce('0x41')](_0x21d174)['then'](handleEntityNotFound(_0x557afc,null))['then'](respondWithResult(_0x557afc,null))[_0x25ce('0x3e')](handleError(_0x557afc,null));};exports[_0x25ce('0x42')]=function(_0x45de30,_0x587c2){return db[_0x25ce('0x28')][_0x25ce('0x42')](_0x45de30[_0x25ce('0x43')],{})['then'](respondWithResult(_0x587c2,0xc9))[_0x25ce('0x3e')](handleError(_0x587c2,null));};exports[_0x25ce('0x44')]=function(_0x23b9b0,_0x2099a1){if(_0x23b9b0[_0x25ce('0x43')]['id']){delete _0x23b9b0[_0x25ce('0x43')]['id'];}return db['FreshsalesAccount'][_0x25ce('0x41')]({'where':{'id':_0x23b9b0['params']['id']}})[_0x25ce('0x3b')](handleEntityNotFound(_0x2099a1,null))['then'](saveUpdates(_0x23b9b0[_0x25ce('0x43')],null))[_0x25ce('0x3b')](respondWithResult(_0x2099a1,null))[_0x25ce('0x3e')](handleError(_0x2099a1,null));};exports[_0x25ce('0x45')]=function(_0x1ad7a8,_0x169a1b){return db[_0x25ce('0x28')][_0x25ce('0x41')]({'where':{'id':_0x1ad7a8[_0x25ce('0x46')]['id']}})['then'](handleEntityNotFound(_0x169a1b,null))['then'](removeEntity(_0x169a1b,null))[_0x25ce('0x3e')](handleError(_0x169a1b,null));};exports[_0x25ce('0x47')]=function(_0x482015,_0x3ff727,_0x3c9005){var _0x135604={};var _0xec59cb={};var _0x40b323;var _0x486268;return db[_0x25ce('0x28')][_0x25ce('0x48')]({'where':{'id':_0x482015[_0x25ce('0x46')]['id']}})[_0x25ce('0x3b')](handleEntityNotFound(_0x3ff727,null))[_0x25ce('0x3b')](function(_0x581fb5){if(_0x581fb5){_0x40b323=_0x581fb5;_0xec59cb[_0x25ce('0x2d')]=_[_0x25ce('0x2f')](db[_0x25ce('0x49')]['rawAttributes']);_0xec59cb[_0x25ce('0x2e')]=_[_0x25ce('0x2f')](_0x482015[_0x25ce('0x2e')]);_0xec59cb['filters']=_[_0x25ce('0x31')](_0xec59cb[_0x25ce('0x2d')],_0xec59cb[_0x25ce('0x2e')]);_0x135604['attributes']=_[_0x25ce('0x31')](_0xec59cb[_0x25ce('0x2d')],qs[_0x25ce('0x33')](_0x482015[_0x25ce('0x2e')][_0x25ce('0x33')]));_0x135604[_0x25ce('0x32')]=_0x135604['attributes'][_0x25ce('0x3f')]?_0x135604[_0x25ce('0x32')]:_0xec59cb[_0x25ce('0x2d')];_0x135604[_0x25ce('0x4a')]=qs[_0x25ce('0x36')](_0x482015[_0x25ce('0x2e')][_0x25ce('0x36')]);_0x135604[_0x25ce('0x37')]=qs[_0x25ce('0x30')](_[_0x25ce('0x4b')](_0x482015[_0x25ce('0x2e')],_0xec59cb[_0x25ce('0x30')]));if(_0x482015[_0x25ce('0x2e')][_0x25ce('0x38')]){_0x135604['where']=_[_0x25ce('0x39')](_0x135604[_0x25ce('0x37')],{'$or':_[_0x25ce('0x27')](_0x135604[_0x25ce('0x32')],function(_0x120cab){var _0xe65d2a={};_0xe65d2a[_0x120cab]={'$like':'%'+_0x482015[_0x25ce('0x2e')]['filter']+'%'};return _0xe65d2a;})});}_0x135604=_[_0x25ce('0x39')]({},_0x135604,_0x482015[_0x25ce('0x3a')]);return _0x40b323[_0x25ce('0x47')](_0x135604);}})['then'](function(_0x5a276c){if(_0x5a276c){_0x486268=_0x5a276c[_0x25ce('0x3f')];if(!_0x482015[_0x25ce('0x2e')][_0x25ce('0x34')](_0x25ce('0x35'))){_0x135604[_0x25ce('0x1b')]=qs[_0x25ce('0x1b')](_0x482015[_0x25ce('0x2e')][_0x25ce('0x1b')]);_0x135604[_0x25ce('0x1d')]=qs[_0x25ce('0x1d')](_0x482015[_0x25ce('0x2e')][_0x25ce('0x1d')]);}return _0x40b323[_0x25ce('0x47')](_0x135604);}})[_0x25ce('0x3b')](function(_0x3999f0){if(_0x3999f0){return _0x3999f0?{'count':_0x486268,'rows':_0x3999f0}:null;}})['then'](respondWithResult(_0x3ff727,null))['catch'](handleError(_0x3ff727,null));};exports[_0x25ce('0x4c')]=function(_0x1bdb3c,_0x30a556,_0x33ec34){if(_0x1bdb3c[_0x25ce('0x43')]['id']){delete _0x1bdb3c[_0x25ce('0x43')]['id'];}return db[_0x25ce('0x28')][_0x25ce('0x48')]({'where':{'id':_0x1bdb3c['params']['id']}})[_0x25ce('0x3b')](handleEntityNotFound(_0x30a556,null))[_0x25ce('0x3b')](function(_0x5d4cfa){if(_0x5d4cfa){_0x1bdb3c[_0x25ce('0x43')][_0x25ce('0x4d')]=_0x5d4cfa['id'];_0x1bdb3c[_0x25ce('0x43')]['Subjects']=integrations['getSubjects'](_0x1bdb3c[_0x25ce('0x43')]['channel'],_0x1bdb3c['body'][_0x25ce('0x2b')]);_0x1bdb3c[_0x25ce('0x43')][_0x25ce('0x4e')]=integrations[_0x25ce('0x4f')](_0x1bdb3c[_0x25ce('0x43')][_0x25ce('0x50')],_0x1bdb3c[_0x25ce('0x43')][_0x25ce('0x2b')]);return db[_0x25ce('0x49')][_0x25ce('0x42')](_0x1bdb3c[_0x25ce('0x43')],{'include':[{'model':db[_0x25ce('0x51')],'as':_0x25ce('0x52')},{'model':db['FreshsalesField'],'as':_0x25ce('0x4e')}]});}return null;})[_0x25ce('0x3b')](respondWithResult(_0x30a556,null))['catch'](handleError(_0x30a556,null));};exports[_0x25ce('0x53')]=function(_0x3fc41e,_0x1e7548,_0x4d6b05){var _0x376be3='';var _0x17a51a='';return db[_0x25ce('0x28')][_0x25ce('0x48')]({'where':{'id':_0x3fc41e[_0x25ce('0x46')]['id']},'attributes':['id',_0x25ce('0x54'),_0x25ce('0x55'),_0x25ce('0x56')]})[_0x25ce('0x3b')](handleEntityNotFound(_0x1e7548,null))['then'](function(_0x29a705){if(_0x29a705){_0x17a51a=_0x29a705['username'];_0x376be3=_0x29a705['remoteUri'];var _0x5dbe87=_0x29a705[_0x25ce('0x55')][_0x25ce('0x57')](-0x1);if(_0x5dbe87==='/'){_0x376be3=_0x376be3[_0x25ce('0x58')](0x0,_0x376be3[_0x25ce('0x59')](_0x5dbe87));}return rp({'method':_0x25ce('0x5a'),'uri':util[_0x25ce('0x5b')](_0x25ce('0x5c'),_0x376be3,_0x25ce('0x5d')),'headers':{'Authorization':_0x25ce('0x5e')+_0x29a705['apiKey']},'json':!![]});}})[_0x25ce('0x3b')](function(_0x59bd86){if(_0x59bd86){var _0x3cae35=_0x59bd86[_0x25ce('0x5f')];var _0x45c32c=![];var _0x60ce3c=null;for(_0x60ce3c=0x0;_0x60ce3c<_0x3cae35[_0x25ce('0x3f')];_0x60ce3c++){if(_0x3cae35[_0x60ce3c][_0x25ce('0x60')]===_0x17a51a){_0x45c32c=!![];}}if(_0x45c32c){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x25ce('0x3b')](respondWithResult(_0x1e7548,null))[_0x25ce('0x3e')](function(_0x1137f5){var _0x3e97a7=_0x3fc41e[_0x25ce('0x2e')][_0x25ce('0x61')]?0x1f4:_0x1137f5[_0x25ce('0x62')]||0x1f4;logger[_0x25ce('0x22')](_0x25ce('0x63'),_0x25ce('0x53'),_0x3e97a7,JSON[_0x25ce('0x64')](_0x1137f5));delete _0x1137f5['name'];if(_0x3e97a7===0x191){_0x3e97a7=0x190;}_0x1e7548[_0x25ce('0x17')](_0x3e97a7)['send'](_0x3fc41e[_0x25ce('0x2e')][_0x25ce('0x61')]?{'message':'Wrong\x20credentials','statusCode':_0x1137f5[_0x25ce('0x62')]}:_0x1137f5);});};
\ No newline at end of file
index c79ca4d..5a88acb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c6=['define','util','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x81c6,0x1d5));var _0x681c=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0x81c6[_0x211bc3];return _0x34c9a2;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));var integrations=require(_0x681c('0x6'));module[_0x681c('0x7')]=function(_0x4ea522,_0x45331){return _0x4ea522[_0x681c('0x8')]('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d38=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define'];(function(_0x780a5c,_0x28d3d9){var _0x142b17=function(_0x1f0a11){while(--_0x1f0a11){_0x780a5c['push'](_0x780a5c['shift']());}};_0x142b17(++_0x28d3d9);}(_0x6d38,0x1ef));var _0x86d3=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x6d38[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var logger=require(_0x86d3('0x1'))(_0x86d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var attributes=require(_0x86d3('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x86d3('0x7')]=function(_0xfbbc15,_0x33d4aa){return _0xfbbc15[_0x86d3('0x8')]('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a47c98c..e3b0e82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','findAll','raw','options','where','attributes','limit','include','map','model','debug','ShowFreshsalesAccount','FreshsalesAccount','find','util','bluebird'];(function(_0x1ed8e1,_0x141b6b){var _0x551333=function(_0x29080d){while(--_0x29080d){_0x1ed8e1['push'](_0x1ed8e1['shift']());}};_0x551333(++_0x141b6b);}(_0xadb5,0xad));var _0x5adb=function(_0x2a7193,_0x24810c){_0x2a7193=_0x2a7193-0x0;var _0x107f6b=_0xadb5[_0x2a7193];return _0x107f6b;};'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']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['FreshsalesAccount'][_0x5adb('0x16')]({'raw':_0x529b65['options']?_0x529b65['options'][_0x5adb('0x17')]===undefined?!![]:![]:!![],'where':_0x529b65[_0x5adb('0x18')]?_0x529b65[_0x5adb('0x18')][_0x5adb('0x19')]||null:null,'attributes':_0x529b65[_0x5adb('0x18')]?_0x529b65['options'][_0x5adb('0x1a')]||null:null,'limit':_0x529b65['options']?_0x529b65['options'][_0x5adb('0x1b')]||null:null,'include':_0x529b65[_0x5adb('0x18')]?_0x529b65[_0x5adb('0x18')][_0x5adb('0x1c')]?_[_0x5adb('0x1d')](_0x529b65[_0x5adb('0x18')][_0x5adb('0x1c')],function(_0x4ca150){return{'model':db[_0x4ca150[_0x5adb('0x1e')]],'as':_0x4ca150['as'],'attributes':_0x4ca150[_0x5adb('0x1a')],'include':_0x4ca150[_0x5adb('0x1c')]?_[_0x5adb('0x1d')](_0x4ca150[_0x5adb('0x1c')],function(_0x49f203){return{'model':db[_0x49f203[_0x5adb('0x1e')]],'as':_0x49f203['as'],'attributes':_0x49f203[_0x5adb('0x1a')],'include':_0x49f203['include']?_[_0x5adb('0x1d')](_0x49f203[_0x5adb('0x1c')],function(_0x1a0acd){return{'model':db[_0x1a0acd['model']],'as':_0x1a0acd['as'],'attributes':_0x1a0acd[_0x5adb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5adb('0xb')](function(_0x3a4fca){logger[_0x5adb('0xc')](_0x5adb('0x15'),_0x529b65);logger[_0x5adb('0x1f')]('GetFreshsalesAccount',_0x529b65,JSON['stringify'](_0x3a4fca));_0x5de028(_0x3a4fca);})['catch'](function(_0x39bddd){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x39bddd[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x39bddd['message']));});});};exports[_0x5adb('0x20')]=function(_0x34b793){var _0x372da1=this;return new Promise(function(_0x3b1fed,_0x450169){return db[_0x5adb('0x21')][_0x5adb('0x22')]({'raw':_0x34b793[_0x5adb('0x18')]?_0x34b793[_0x5adb('0x18')][_0x5adb('0x17')]===undefined?!![]:![]:!![],'where':_0x34b793['options']?_0x34b793[_0x5adb('0x18')]['where']||null:null,'attributes':_0x34b793[_0x5adb('0x18')]?_0x34b793[_0x5adb('0x18')]['attributes']||null:null,'include':_0x34b793[_0x5adb('0x18')]?_0x34b793[_0x5adb('0x18')][_0x5adb('0x1c')]?_['map'](_0x34b793[_0x5adb('0x18')][_0x5adb('0x1c')],function(_0x4b5887){return{'model':db[_0x4b5887['model']],'as':_0x4b5887['as'],'attributes':_0x4b5887[_0x5adb('0x1a')],'include':_0x4b5887['include']?_[_0x5adb('0x1d')](_0x4b5887[_0x5adb('0x1c')],function(_0x3c2b07){return{'model':db[_0x3c2b07[_0x5adb('0x1e')]],'as':_0x3c2b07['as'],'attributes':_0x3c2b07[_0x5adb('0x1a')],'include':_0x3c2b07['include']?_[_0x5adb('0x1d')](_0x3c2b07[_0x5adb('0x1c')],function(_0x1c3a5c){return{'model':db[_0x1c3a5c['model']],'as':_0x1c3a5c['as'],'attributes':_0x1c3a5c['attributes']};}):[]};}):[]};}):[]:[]})[_0x5adb('0xb')](function(_0x5d1baa){logger['info'](_0x5adb('0x20'),_0x34b793);logger['debug'](_0x5adb('0x20'),_0x34b793,JSON['stringify'](_0x5d1baa));_0x3b1fed(_0x5d1baa);})[_0x5adb('0x14')](function(_0x4d052f){logger[_0x5adb('0x10')](_0x5adb('0x20'),_0x4d052f['message'],_0x34b793);_0x450169(_0x372da1[_0x5adb('0x10')](0x1f4,_0x4d052f['message']));});});};
\ No newline at end of file
+var _0x9536=['code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9536,0x179));var _0x6953=function(_0x42ca15,_0x193ccb){_0x42ca15=_0x42ca15-0x0;var _0x1c6ded=_0x9536[_0x42ca15];return _0x1c6ded;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb026,_0x385f2d,_0x3e1aff){return new BPromise(function(_0x1c8225,_0x58ac30){return client[_0x6953('0xb')](_0x2bb026,_0x3e1aff)[_0x6953('0xc')](function(_0x449acb){logger['info'](_0x6953('0xd'),_0x385f2d,_0x6953('0xe'));logger[_0x6953('0xf')](_0x6953('0x10'),_0x385f2d,_0x6953('0xe'),JSON[_0x6953('0x11')](_0x449acb));if(_0x449acb[_0x6953('0x12')]){if(_0x449acb[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger['error'](_0x6953('0xd'),_0x385f2d,_0x449acb['error'][_0x6953('0x14')]);return _0x58ac30(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}logger[_0x6953('0x12')](_0x6953('0xd'),_0x385f2d,_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);return _0x1c8225(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}else{logger[_0x6953('0x15')](_0x6953('0xd'),_0x385f2d,'request\x20sent');_0x1c8225(_0x449acb['result'][_0x6953('0x14')]);}})[_0x6953('0x16')](function(_0x16b79b){logger[_0x6953('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x385f2d,_0x16b79b);_0x58ac30(_0x16b79b);});});}exports[_0x6953('0x17')]=function(_0x2da771){var _0x4b43ae=this;return new Promise(function(_0x10858a,_0x3207dd){return db[_0x6953('0x18')][_0x6953('0x19')]({'raw':_0x2da771[_0x6953('0x1a')]?_0x2da771['options'][_0x6953('0x1b')]===undefined?!![]:![]:!![],'where':_0x2da771[_0x6953('0x1a')]?_0x2da771[_0x6953('0x1a')][_0x6953('0x1c')]||null:null,'attributes':_0x2da771[_0x6953('0x1a')]?_0x2da771['options'][_0x6953('0x1d')]||null:null,'limit':_0x2da771[_0x6953('0x1a')]?_0x2da771['options'][_0x6953('0x1e')]||null:null,'include':_0x2da771[_0x6953('0x1a')]?_0x2da771[_0x6953('0x1a')][_0x6953('0x1f')]?_['map'](_0x2da771[_0x6953('0x1a')][_0x6953('0x1f')],function(_0x2a7f6a){return{'model':db[_0x2a7f6a['model']],'as':_0x2a7f6a['as'],'attributes':_0x2a7f6a['attributes'],'include':_0x2a7f6a['include']?_[_0x6953('0x20')](_0x2a7f6a[_0x6953('0x1f')],function(_0x550be4){return{'model':db[_0x550be4[_0x6953('0x21')]],'as':_0x550be4['as'],'attributes':_0x550be4['attributes'],'include':_0x550be4[_0x6953('0x1f')]?_[_0x6953('0x20')](_0x550be4[_0x6953('0x1f')],function(_0x2cc01e){return{'model':db[_0x2cc01e[_0x6953('0x21')]],'as':_0x2cc01e['as'],'attributes':_0x2cc01e[_0x6953('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dd890){logger[_0x6953('0x15')]('GetFreshsalesAccount',_0x2da771);logger[_0x6953('0xf')]('GetFreshsalesAccount',_0x2da771,JSON[_0x6953('0x11')](_0x3dd890));_0x10858a(_0x3dd890);})[_0x6953('0x16')](function(_0x426c7c){logger['error'](_0x6953('0x17'),_0x426c7c[_0x6953('0x14')],_0x2da771);_0x3207dd(_0x4b43ae[_0x6953('0x12')](0x1f4,_0x426c7c['message']));});});};exports[_0x6953('0x22')]=function(_0x132a71){var _0x481c6a=this;return new Promise(function(_0x4d856d,_0xd80e42){return db[_0x6953('0x18')][_0x6953('0x23')]({'raw':_0x132a71[_0x6953('0x1a')]?_0x132a71[_0x6953('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x132a71[_0x6953('0x1a')]?_0x132a71['options'][_0x6953('0x1c')]||null:null,'attributes':_0x132a71[_0x6953('0x1a')]?_0x132a71['options']['attributes']||null:null,'include':_0x132a71[_0x6953('0x1a')]?_0x132a71[_0x6953('0x1a')][_0x6953('0x1f')]?_['map'](_0x132a71[_0x6953('0x1a')]['include'],function(_0x4e95f1){return{'model':db[_0x4e95f1['model']],'as':_0x4e95f1['as'],'attributes':_0x4e95f1['attributes'],'include':_0x4e95f1[_0x6953('0x1f')]?_[_0x6953('0x20')](_0x4e95f1[_0x6953('0x1f')],function(_0x11f316){return{'model':db[_0x11f316[_0x6953('0x21')]],'as':_0x11f316['as'],'attributes':_0x11f316[_0x6953('0x1d')],'include':_0x11f316['include']?_[_0x6953('0x20')](_0x11f316['include'],function(_0x199c67){return{'model':db[_0x199c67['model']],'as':_0x199c67['as'],'attributes':_0x199c67[_0x6953('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6953('0xc')](function(_0xd81149){logger[_0x6953('0x15')]('ShowFreshsalesAccount',_0x132a71);logger[_0x6953('0xf')](_0x6953('0x22'),_0x132a71,JSON[_0x6953('0x11')](_0xd81149));_0x4d856d(_0xd81149);})[_0x6953('0x16')](function(_0x40b6ea){logger[_0x6953('0x12')](_0x6953('0x22'),_0x40b6ea[_0x6953('0x14')],_0x132a71);_0xd80e42(_0x481c6a[_0x6953('0x12')](0x1f4,_0x40b6ea[_0x6953('0x14')]));});});};
\ No newline at end of file
index 6e4853a..f053cae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf845=['../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x23c40e,_0x14c64e){var _0x29127d=function(_0x19b0e7){while(--_0x19b0e7){_0x23c40e['push'](_0x23c40e['shift']());}};_0x29127d(++_0x14c64e);}(_0xf845,0x1e6));var _0x5f84=function(_0xa4c5da,_0x74388d){_0xa4c5da=_0xa4c5da-0x0;var _0x494744=_0xf845[_0xa4c5da];return _0x494744;};'use strict';var multer=require(_0x5f84('0x0'));var util=require('util');var path=require(_0x5f84('0x1'));var timeout=require(_0x5f84('0x2'));var express=require(_0x5f84('0x3'));var router=express[_0x5f84('0x4')]();var fs_extra=require(_0x5f84('0x5'));var auth=require(_0x5f84('0x6'));var interaction=require(_0x5f84('0x7'));var config=require(_0x5f84('0x8'));var controller=require(_0x5f84('0x9'));router['get']('/',auth[_0x5f84('0xa')](),controller[_0x5f84('0xb')]);router[_0x5f84('0xc')](_0x5f84('0xd'),auth[_0x5f84('0xa')](),controller[_0x5f84('0xe')]);router[_0x5f84('0xc')](_0x5f84('0xf'),auth['isAuthenticated'](),controller[_0x5f84('0x10')]);router['get'](_0x5f84('0x11'),auth[_0x5f84('0xa')](),controller[_0x5f84('0x12')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x5f84('0x13')]);router[_0x5f84('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5f84('0x15')](_0x5f84('0xd'),auth['isAuthenticated'](),controller[_0x5f84('0x16')]);router[_0x5f84('0x17')](_0x5f84('0xd'),auth['isAuthenticated'](),controller[_0x5f84('0x18')]);module[_0x5f84('0x19')]=router;
\ No newline at end of file
+var _0x28a1=['express','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x28a1,0x1e0));var _0x128a=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x28a1[_0x540dcb];return _0x49353c;};'use strict';var multer=require(_0x128a('0x0'));var util=require(_0x128a('0x1'));var path=require(_0x128a('0x2'));var timeout=require(_0x128a('0x3'));var express=require(_0x128a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x128a('0x5'));var config=require(_0x128a('0x6'));var controller=require(_0x128a('0x7'));router[_0x128a('0x8')]('/',auth[_0x128a('0x9')](),controller[_0x128a('0xa')]);router[_0x128a('0x8')](_0x128a('0xb'),auth[_0x128a('0x9')](),controller[_0x128a('0xc')]);router[_0x128a('0x8')](_0x128a('0xd'),auth[_0x128a('0x9')](),controller[_0x128a('0xe')]);router['get'](_0x128a('0xf'),auth['isAuthenticated'](),controller[_0x128a('0x10')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x128a('0x11')]('/',auth[_0x128a('0x9')](),controller['create']);router[_0x128a('0x12')](_0x128a('0xb'),auth[_0x128a('0x9')](),controller['update']);router[_0x128a('0x13')](_0x128a('0xb'),auth['isAuthenticated'](),controller[_0x128a('0x14')]);module[_0x128a('0x15')]=router;
\ No newline at end of file
index 03f9362..254dd54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6842=['sequelize','exports','STRING'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x6842,0xb7));var _0x2684=function(_0x45faf3,_0x2834de){_0x45faf3=_0x45faf3-0x0;var _0x19e856=_0x6842[_0x45faf3];return _0x19e856;};'use strict';var Sequelize=require(_0x2684('0x0'));module[_0x2684('0x1')]={'name':{'type':Sequelize[_0x2684('0x2')]},'description':{'type':Sequelize[_0x2684('0x2')]}};
\ No newline at end of file
+var _0x8409=['exports','sequelize'];(function(_0x494003,_0x29d924){var _0x30e280=function(_0x337b27){while(--_0x337b27){_0x494003['push'](_0x494003['shift']());}};_0x30e280(++_0x29d924);}(_0x8409,0x14b));var _0x9840=function(_0x40f5b7,_0xb3243e){_0x40f5b7=_0x40f5b7-0x0;var _0x3c884a=_0x8409[_0x40f5b7];return _0x3c884a;};'use strict';var Sequelize=require(_0x9840('0x0'));module[_0x9840('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5afe671..393c642 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9984=['limit','set','Content-Range','apply','reject','save','destroy','name','send','index','map','FreshsalesConfiguration','rawAttributes','type','key','keys','filters','intersection','attributes','model','query','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','params','create','body','update','find','getSubjects','findOne','pick','nolimit','getDescriptions','FreshsalesField','getFields','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x9984,0x11d));var _0x4998=function(_0xacb1ad,_0x539401){_0xacb1ad=_0xacb1ad-0x0;var _0x3d48bc=_0x9984[_0xacb1ad];return _0x3d48bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4998('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4998('0x1'));var rp=require('request-promise');var moment=require(_0x4998('0x2'));var BPromise=require(_0x4998('0x3'));var Mustache=require(_0x4998('0x4'));var util=require(_0x4998('0x5'));var path=require(_0x4998('0x6'));var sox=require('sox');var csv=require(_0x4998('0x7'));var ejs=require(_0x4998('0x8'));var fs=require('fs');var fs_extra=require(_0x4998('0x9'));var _=require(_0x4998('0xa'));var squel=require(_0x4998('0xb'));var crypto=require(_0x4998('0xc'));var jsforce=require(_0x4998('0xd'));var deskjs=require(_0x4998('0xe'));var toCsv=require(_0x4998('0x7'));var querystring=require('querystring');var Papa=require(_0x4998('0xf'));var Redis=require(_0x4998('0x10'));var authService=require(_0x4998('0x11'));var qs=require(_0x4998('0x12'));var as=require(_0x4998('0x13'));var hardwareService=require(_0x4998('0x14'));var logger=require('../../config/logger')(_0x4998('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4998('0x16'));var db=require(_0x4998('0x17'))['db'];function respondWithStatusCode(_0xc59a0e,_0x46e7b7){_0x46e7b7=_0x46e7b7||0xcc;return function(_0x1fb5f0){if(_0x1fb5f0){return _0xc59a0e[_0x4998('0x18')](_0x46e7b7);}return _0xc59a0e[_0x4998('0x19')](_0x46e7b7)[_0x4998('0x1a')]();};}function respondWithResult(_0x2e9893,_0x1c689a){_0x1c689a=_0x1c689a||0xc8;return function(_0x275562){if(_0x275562){return _0x2e9893[_0x4998('0x19')](_0x1c689a)[_0x4998('0x1b')](_0x275562);}};}function respondWithFilteredResult(_0x200814,_0x58f56e){return function(_0x578f49){if(_0x578f49){var _0x4d6a7b=typeof _0x58f56e[_0x4998('0x1c')]===_0x4998('0x1d')&&typeof _0x58f56e['limit']===_0x4998('0x1d');var _0x52bc72=_0x578f49[_0x4998('0x1e')];var _0x21d59b=_0x4d6a7b?0x0:_0x58f56e[_0x4998('0x1c')];var _0x2d9a62=_0x4d6a7b?_0x578f49[_0x4998('0x1e')]:_0x58f56e[_0x4998('0x1c')]+_0x58f56e[_0x4998('0x1f')];var _0x1e0f2f;if(_0x2d9a62>=_0x52bc72){_0x2d9a62=_0x52bc72;_0x1e0f2f=0xc8;}else{_0x1e0f2f=0xce;}_0x200814[_0x4998('0x19')](_0x1e0f2f);return _0x200814[_0x4998('0x20')](_0x4998('0x21'),_0x21d59b+'-'+_0x2d9a62+'/'+_0x52bc72)[_0x4998('0x1b')](_0x578f49);}return null;};}function patchUpdates(_0x1e79e0){return function(_0x9a1a04){try{jsonpatch[_0x4998('0x22')](_0x9a1a04,_0x1e79e0,!![]);}catch(_0x5543f6){return BPromise[_0x4998('0x23')](_0x5543f6);}return _0x9a1a04[_0x4998('0x24')]();};}function saveUpdates(_0x4a62c0,_0x558605){return function(_0x25e7e3){if(_0x25e7e3){return _0x25e7e3['update'](_0x4a62c0)['then'](function(_0x569f76){return _0x569f76;});}return null;};}function removeEntity(_0x52f8a4,_0x5c948f){return function(_0x2ee87f){if(_0x2ee87f){return _0x2ee87f[_0x4998('0x25')]()['then'](function(){_0x52f8a4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e9a53,_0x3bc91b){return function(_0x5c3ec4){if(!_0x5c3ec4){_0x3e9a53[_0x4998('0x18')](0x194);}return _0x5c3ec4;};}function handleError(_0x5424f3,_0x229148){_0x229148=_0x229148||0x1f4;return function(_0x5dc5e5){logger['error'](_0x5dc5e5['stack']);if(_0x5dc5e5[_0x4998('0x26')]){delete _0x5dc5e5[_0x4998('0x26')];}_0x5424f3[_0x4998('0x19')](_0x229148)[_0x4998('0x27')](_0x5dc5e5);};}exports[_0x4998('0x28')]=function(_0x1b7809,_0x50f39a){var _0x31714d={},_0x777d5b={},_0x3887d4={'count':0x0,'rows':[]};var _0x246d92=_[_0x4998('0x29')](db[_0x4998('0x2a')][_0x4998('0x2b')],function(_0x4d8537){return{'name':_0x4d8537['fieldName'],'type':_0x4d8537[_0x4998('0x2c')][_0x4998('0x2d')]};});_0x777d5b['model']=_[_0x4998('0x29')](_0x246d92,_0x4998('0x26'));_0x777d5b['query']=_[_0x4998('0x2e')](_0x1b7809['query']);_0x777d5b[_0x4998('0x2f')]=_[_0x4998('0x30')](_0x777d5b['model'],_0x777d5b['query']);_0x31714d[_0x4998('0x31')]=_[_0x4998('0x30')](_0x777d5b[_0x4998('0x32')],qs['fields'](_0x1b7809[_0x4998('0x33')][_0x4998('0x34')]));_0x31714d[_0x4998('0x31')]=_0x31714d[_0x4998('0x31')][_0x4998('0x35')]?_0x31714d['attributes']:_0x777d5b[_0x4998('0x32')];if(!_0x1b7809['query'][_0x4998('0x36')]('nolimit')){_0x31714d[_0x4998('0x1f')]=qs[_0x4998('0x1f')](_0x1b7809[_0x4998('0x33')][_0x4998('0x1f')]);_0x31714d[_0x4998('0x1c')]=qs[_0x4998('0x1c')](_0x1b7809[_0x4998('0x33')][_0x4998('0x1c')]);}_0x31714d[_0x4998('0x37')]=qs['sort'](_0x1b7809[_0x4998('0x33')][_0x4998('0x38')]);_0x31714d[_0x4998('0x39')]=qs[_0x4998('0x2f')](_['pick'](_0x1b7809['query'],_0x777d5b['filters']),_0x246d92);if(_0x1b7809['query'][_0x4998('0x3a')]){_0x31714d[_0x4998('0x39')]=_[_0x4998('0x3b')](_0x31714d['where'],{'$or':_['map'](_0x246d92,function(_0xd1fbc0){if(_0xd1fbc0['type']!==_0x4998('0x3c')){var _0x243909={};_0x243909[_0xd1fbc0[_0x4998('0x26')]]={'$like':'%'+_0x1b7809[_0x4998('0x33')]['filter']+'%'};return _0x243909;}})});}_0x31714d=_['merge']({},_0x31714d,_0x1b7809[_0x4998('0x3d')]);var _0xe0ef81={'where':_0x31714d[_0x4998('0x39')]};return db[_0x4998('0x2a')][_0x4998('0x1e')](_0xe0ef81)[_0x4998('0x3e')](function(_0x20875a){_0x3887d4[_0x4998('0x1e')]=_0x20875a;if(_0x1b7809[_0x4998('0x33')][_0x4998('0x3f')]){_0x31714d[_0x4998('0x40')]=[{'all':!![]}];}return db[_0x4998('0x2a')][_0x4998('0x41')](_0x31714d);})[_0x4998('0x3e')](function(_0x387924){_0x3887d4['rows']=_0x387924;return _0x3887d4;})[_0x4998('0x3e')](respondWithFilteredResult(_0x50f39a,_0x31714d))[_0x4998('0x42')](handleError(_0x50f39a,null));};exports['show']=function(_0x2a92d0,_0x332437){var _0x2e6ce3={'raw':![],'where':{'id':_0x2a92d0[_0x4998('0x43')]['id']}},_0x2acc88={};_0x2acc88[_0x4998('0x32')]=_[_0x4998('0x2e')](db['FreshsalesConfiguration'][_0x4998('0x2b')]);_0x2acc88[_0x4998('0x33')]=_[_0x4998('0x2e')](_0x2a92d0[_0x4998('0x33')]);_0x2acc88[_0x4998('0x2f')]=_[_0x4998('0x30')](_0x2acc88[_0x4998('0x32')],_0x2acc88[_0x4998('0x33')]);_0x2e6ce3[_0x4998('0x31')]=_[_0x4998('0x30')](_0x2acc88['model'],qs[_0x4998('0x34')](_0x2a92d0['query'][_0x4998('0x34')]));_0x2e6ce3[_0x4998('0x31')]=_0x2e6ce3[_0x4998('0x31')][_0x4998('0x35')]?_0x2e6ce3['attributes']:_0x2acc88[_0x4998('0x32')];if(_0x2a92d0[_0x4998('0x33')][_0x4998('0x3f')]){_0x2e6ce3[_0x4998('0x40')]=[{'all':!![]}];}_0x2e6ce3=_['merge']({},_0x2e6ce3,_0x2a92d0['options']);return db[_0x4998('0x2a')]['find'](_0x2e6ce3)[_0x4998('0x3e')](handleEntityNotFound(_0x332437,null))['then'](respondWithResult(_0x332437,null))[_0x4998('0x42')](handleError(_0x332437,null));};exports[_0x4998('0x44')]=function(_0x3d1c21,_0x3fa9b6){return db[_0x4998('0x2a')]['create'](_0x3d1c21[_0x4998('0x45')],{})[_0x4998('0x3e')](respondWithResult(_0x3fa9b6,0xc9))[_0x4998('0x42')](handleError(_0x3fa9b6,null));};exports[_0x4998('0x46')]=function(_0x51694d,_0x16e7e9){if(_0x51694d['body']['id']){delete _0x51694d[_0x4998('0x45')]['id'];}return db[_0x4998('0x2a')]['find']({'where':{'id':_0x51694d[_0x4998('0x43')]['id']}})['then'](handleEntityNotFound(_0x16e7e9,null))[_0x4998('0x3e')](saveUpdates(_0x51694d[_0x4998('0x45')],null))[_0x4998('0x3e')](respondWithResult(_0x16e7e9,null))[_0x4998('0x42')](handleError(_0x16e7e9,null));};exports['destroy']=function(_0x7d9ada,_0x4d9047){return db[_0x4998('0x2a')][_0x4998('0x47')]({'where':{'id':_0x7d9ada['params']['id']}})['then'](handleEntityNotFound(_0x4d9047,null))[_0x4998('0x3e')](removeEntity(_0x4d9047,null))[_0x4998('0x42')](handleError(_0x4d9047,null));};exports[_0x4998('0x48')]=function(_0x5b8367,_0x9df95a,_0x4a09c5){var _0x1a143e={};var _0x1f68fc={};var _0x1317e0;var _0x44f3e4;return db['FreshsalesConfiguration'][_0x4998('0x49')]({'where':{'id':_0x5b8367[_0x4998('0x43')]['id']}})[_0x4998('0x3e')](handleEntityNotFound(_0x9df95a,null))['then'](function(_0x47a809){if(_0x47a809){_0x1317e0=_0x47a809;_0x1f68fc[_0x4998('0x32')]=_[_0x4998('0x2e')](db['FreshsalesField'][_0x4998('0x2b')]);_0x1f68fc['query']=_[_0x4998('0x2e')](_0x5b8367[_0x4998('0x33')]);_0x1f68fc[_0x4998('0x2f')]=_[_0x4998('0x30')](_0x1f68fc[_0x4998('0x32')],_0x1f68fc['query']);_0x1a143e[_0x4998('0x31')]=_[_0x4998('0x30')](_0x1f68fc[_0x4998('0x32')],qs['fields'](_0x5b8367[_0x4998('0x33')][_0x4998('0x34')]));_0x1a143e[_0x4998('0x31')]=_0x1a143e['attributes'][_0x4998('0x35')]?_0x1a143e[_0x4998('0x31')]:_0x1f68fc[_0x4998('0x32')];_0x1a143e[_0x4998('0x37')]=qs['sort'](_0x5b8367[_0x4998('0x33')][_0x4998('0x38')]);_0x1a143e['where']=qs[_0x4998('0x2f')](_[_0x4998('0x4a')](_0x5b8367[_0x4998('0x33')],_0x1f68fc[_0x4998('0x2f')]));if(_0x5b8367[_0x4998('0x33')][_0x4998('0x3a')]){_0x1a143e[_0x4998('0x39')]=_[_0x4998('0x3b')](_0x1a143e[_0x4998('0x39')],{'$or':_['map'](_0x1a143e[_0x4998('0x31')],function(_0x44e939){var _0xcb87d1={};_0xcb87d1[_0x44e939]={'$like':'%'+_0x5b8367[_0x4998('0x33')][_0x4998('0x3a')]+'%'};return _0xcb87d1;})});}_0x1a143e=_[_0x4998('0x3b')]({},_0x1a143e,_0x5b8367[_0x4998('0x3d')]);return _0x1317e0[_0x4998('0x48')](_0x1a143e);}})[_0x4998('0x3e')](function(_0x55cc91){if(_0x55cc91){_0x44f3e4=_0x55cc91[_0x4998('0x35')];if(!_0x5b8367[_0x4998('0x33')][_0x4998('0x36')](_0x4998('0x4b'))){_0x1a143e[_0x4998('0x1f')]=qs[_0x4998('0x1f')](_0x5b8367[_0x4998('0x33')][_0x4998('0x1f')]);_0x1a143e[_0x4998('0x1c')]=qs[_0x4998('0x1c')](_0x5b8367[_0x4998('0x33')][_0x4998('0x1c')]);}return _0x1317e0[_0x4998('0x48')](_0x1a143e);}})['then'](function(_0x485115){if(_0x485115){return _0x485115?{'count':_0x44f3e4,'rows':_0x485115}:null;}})[_0x4998('0x3e')](respondWithResult(_0x9df95a,null))[_0x4998('0x42')](handleError(_0x9df95a,null));};exports[_0x4998('0x4c')]=function(_0x40a973,_0x430fb6,_0x8d4648){var _0x49f5b7={};var _0x1949e1={};var _0x44d82e;var _0x208afe;return db[_0x4998('0x2a')][_0x4998('0x49')]({'where':{'id':_0x40a973[_0x4998('0x43')]['id']}})['then'](handleEntityNotFound(_0x430fb6,null))[_0x4998('0x3e')](function(_0x11c433){if(_0x11c433){_0x44d82e=_0x11c433;_0x1949e1[_0x4998('0x32')]=_[_0x4998('0x2e')](db[_0x4998('0x4d')][_0x4998('0x2b')]);_0x1949e1[_0x4998('0x33')]=_[_0x4998('0x2e')](_0x40a973[_0x4998('0x33')]);_0x1949e1[_0x4998('0x2f')]=_[_0x4998('0x30')](_0x1949e1[_0x4998('0x32')],_0x1949e1[_0x4998('0x33')]);_0x49f5b7[_0x4998('0x31')]=_['intersection'](_0x1949e1['model'],qs['fields'](_0x40a973[_0x4998('0x33')][_0x4998('0x34')]));_0x49f5b7[_0x4998('0x31')]=_0x49f5b7[_0x4998('0x31')][_0x4998('0x35')]?_0x49f5b7[_0x4998('0x31')]:_0x1949e1[_0x4998('0x32')];_0x49f5b7['order']=qs[_0x4998('0x38')](_0x40a973[_0x4998('0x33')][_0x4998('0x38')]);_0x49f5b7[_0x4998('0x39')]=qs[_0x4998('0x2f')](_[_0x4998('0x4a')](_0x40a973[_0x4998('0x33')],_0x1949e1['filters']));if(_0x40a973[_0x4998('0x33')][_0x4998('0x3a')]){_0x49f5b7[_0x4998('0x39')]=_[_0x4998('0x3b')](_0x49f5b7[_0x4998('0x39')],{'$or':_[_0x4998('0x29')](_0x49f5b7[_0x4998('0x31')],function(_0x286ee0){var _0x2ea339={};_0x2ea339[_0x286ee0]={'$like':'%'+_0x40a973[_0x4998('0x33')]['filter']+'%'};return _0x2ea339;})});}_0x49f5b7=_['merge']({},_0x49f5b7,_0x40a973[_0x4998('0x3d')]);return _0x44d82e[_0x4998('0x4c')](_0x49f5b7);}})['then'](function(_0x27cc26){if(_0x27cc26){_0x208afe=_0x27cc26[_0x4998('0x35')];if(!_0x40a973[_0x4998('0x33')]['hasOwnProperty'](_0x4998('0x4b'))){_0x49f5b7[_0x4998('0x1f')]=qs[_0x4998('0x1f')](_0x40a973[_0x4998('0x33')][_0x4998('0x1f')]);_0x49f5b7[_0x4998('0x1c')]=qs[_0x4998('0x1c')](_0x40a973[_0x4998('0x33')]['offset']);}return _0x44d82e[_0x4998('0x4c')](_0x49f5b7);}})['then'](function(_0x5b72e9){if(_0x5b72e9){return _0x5b72e9?{'count':_0x208afe,'rows':_0x5b72e9}:null;}})['then'](respondWithResult(_0x430fb6,null))[_0x4998('0x42')](handleError(_0x430fb6,null));};exports[_0x4998('0x4e')]=function(_0x40ac9e,_0x5d5635,_0xa5bf6e){var _0xe991e1={};var _0x28d301={};var _0xc4bfea;var _0x4ee36d;return db[_0x4998('0x2a')]['findOne']({'where':{'id':_0x40ac9e[_0x4998('0x43')]['id']}})[_0x4998('0x3e')](handleEntityNotFound(_0x5d5635,null))['then'](function(_0x10f0c8){if(_0x10f0c8){_0xc4bfea=_0x10f0c8;_0x28d301[_0x4998('0x32')]=_[_0x4998('0x2e')](db[_0x4998('0x4d')][_0x4998('0x2b')]);_0x28d301['query']=_[_0x4998('0x2e')](_0x40ac9e['query']);_0x28d301[_0x4998('0x2f')]=_['intersection'](_0x28d301[_0x4998('0x32')],_0x28d301[_0x4998('0x33')]);_0xe991e1[_0x4998('0x31')]=_[_0x4998('0x30')](_0x28d301[_0x4998('0x32')],qs[_0x4998('0x34')](_0x40ac9e[_0x4998('0x33')]['fields']));_0xe991e1[_0x4998('0x31')]=_0xe991e1['attributes'][_0x4998('0x35')]?_0xe991e1[_0x4998('0x31')]:_0x28d301[_0x4998('0x32')];_0xe991e1[_0x4998('0x37')]=qs[_0x4998('0x38')](_0x40ac9e[_0x4998('0x33')][_0x4998('0x38')]);_0xe991e1[_0x4998('0x39')]=qs['filters'](_[_0x4998('0x4a')](_0x40ac9e['query'],_0x28d301[_0x4998('0x2f')]));if(_0x40ac9e[_0x4998('0x33')][_0x4998('0x3a')]){_0xe991e1[_0x4998('0x39')]=_[_0x4998('0x3b')](_0xe991e1['where'],{'$or':_[_0x4998('0x29')](_0xe991e1[_0x4998('0x31')],function(_0x4a3673){var _0x131403={};_0x131403[_0x4a3673]={'$like':'%'+_0x40ac9e[_0x4998('0x33')][_0x4998('0x3a')]+'%'};return _0x131403;})});}_0xe991e1=_[_0x4998('0x3b')]({},_0xe991e1,_0x40ac9e[_0x4998('0x3d')]);return _0xc4bfea[_0x4998('0x4e')](_0xe991e1);}})[_0x4998('0x3e')](function(_0x21003d){if(_0x21003d){_0x4ee36d=_0x21003d[_0x4998('0x35')];if(!_0x40ac9e[_0x4998('0x33')][_0x4998('0x36')]('nolimit')){_0xe991e1['limit']=qs[_0x4998('0x1f')](_0x40ac9e[_0x4998('0x33')][_0x4998('0x1f')]);_0xe991e1[_0x4998('0x1c')]=qs[_0x4998('0x1c')](_0x40ac9e[_0x4998('0x33')]['offset']);}return _0xc4bfea[_0x4998('0x4e')](_0xe991e1);}})['then'](function(_0x376a51){if(_0x376a51){return _0x376a51?{'count':_0x4ee36d,'rows':_0x376a51}:null;}})[_0x4998('0x3e')](respondWithResult(_0x5d5635,null))['catch'](handleError(_0x5d5635,null));};
\ No newline at end of file
+var _0xbd36=['name','send','map','FreshsalesConfiguration','fieldName','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','options','find','create','body','FreshsalesField','getSubjects','getDescriptions','findOne','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','end','error'];(function(_0x947124,_0x5eff93){var _0x34f251=function(_0x2536bb){while(--_0x2536bb){_0x947124['push'](_0x947124['shift']());}};_0x34f251(++_0x5eff93);}(_0xbd36,0x164));var _0x6bd3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbd36[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x6bd3('0x0'));var rimraf=require(_0x6bd3('0x1'));var zipdir=require(_0x6bd3('0x2'));var jsonpatch=require(_0x6bd3('0x3'));var rp=require(_0x6bd3('0x4'));var moment=require(_0x6bd3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6bd3('0x6'));var util=require(_0x6bd3('0x7'));var path=require(_0x6bd3('0x8'));var sox=require('sox');var csv=require(_0x6bd3('0x9'));var ejs=require(_0x6bd3('0xa'));var fs=require('fs');var fs_extra=require(_0x6bd3('0xb'));var _=require(_0x6bd3('0xc'));var squel=require('squel');var crypto=require(_0x6bd3('0xd'));var jsforce=require(_0x6bd3('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6bd3('0xf'));var Papa=require('papaparse');var Redis=require(_0x6bd3('0x10'));var authService=require(_0x6bd3('0x11'));var qs=require(_0x6bd3('0x12'));var as=require(_0x6bd3('0x13'));var hardwareService=require(_0x6bd3('0x14'));var logger=require(_0x6bd3('0x15'))(_0x6bd3('0x16'));var utils=require(_0x6bd3('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cb288,_0x3288ea){_0x3288ea=_0x3288ea||0xcc;return function(_0x10b100){if(_0x10b100){return _0x5cb288[_0x6bd3('0x18')](_0x3288ea);}return _0x5cb288[_0x6bd3('0x19')](_0x3288ea)['end']();};}function respondWithResult(_0x7c6cb7,_0x561a7f){_0x561a7f=_0x561a7f||0xc8;return function(_0x2a57b9){if(_0x2a57b9){return _0x7c6cb7[_0x6bd3('0x19')](_0x561a7f)['json'](_0x2a57b9);}};}function respondWithFilteredResult(_0x5e0e10,_0x3085dc){return function(_0x5d5ab6){if(_0x5d5ab6){var _0x175d87=typeof _0x3085dc['offset']===_0x6bd3('0x1a')&&typeof _0x3085dc[_0x6bd3('0x1b')]===_0x6bd3('0x1a');var _0x42c43d=_0x5d5ab6[_0x6bd3('0x1c')];var _0x2adfeb=_0x175d87?0x0:_0x3085dc['offset'];var _0x105a16=_0x175d87?_0x5d5ab6['count']:_0x3085dc[_0x6bd3('0x1d')]+_0x3085dc[_0x6bd3('0x1b')];var _0x5ed27c;if(_0x105a16>=_0x42c43d){_0x105a16=_0x42c43d;_0x5ed27c=0xc8;}else{_0x5ed27c=0xce;}_0x5e0e10[_0x6bd3('0x19')](_0x5ed27c);return _0x5e0e10[_0x6bd3('0x1e')](_0x6bd3('0x1f'),_0x2adfeb+'-'+_0x105a16+'/'+_0x42c43d)['json'](_0x5d5ab6);}return null;};}function patchUpdates(_0x1db973){return function(_0x5c0d06){try{jsonpatch[_0x6bd3('0x20')](_0x5c0d06,_0x1db973,!![]);}catch(_0x38a019){return BPromise['reject'](_0x38a019);}return _0x5c0d06[_0x6bd3('0x21')]();};}function saveUpdates(_0x5d2198,_0x46e4e4){return function(_0x147dd3){if(_0x147dd3){return _0x147dd3[_0x6bd3('0x22')](_0x5d2198)[_0x6bd3('0x23')](function(_0x41383d){return _0x41383d;});}return null;};}function removeEntity(_0x37aaed,_0x1e13f7){return function(_0x138871){if(_0x138871){return _0x138871[_0x6bd3('0x24')]()[_0x6bd3('0x23')](function(){_0x37aaed[_0x6bd3('0x19')](0xcc)[_0x6bd3('0x25')]();});}};}function handleEntityNotFound(_0x356c8f,_0x53487f){return function(_0x101185){if(!_0x101185){_0x356c8f[_0x6bd3('0x18')](0x194);}return _0x101185;};}function handleError(_0x334c45,_0x3348e8){_0x3348e8=_0x3348e8||0x1f4;return function(_0x4d22e7){logger[_0x6bd3('0x26')](_0x4d22e7['stack']);if(_0x4d22e7[_0x6bd3('0x27')]){delete _0x4d22e7[_0x6bd3('0x27')];}_0x334c45[_0x6bd3('0x19')](_0x3348e8)[_0x6bd3('0x28')](_0x4d22e7);};}exports['index']=function(_0x1acfa5,_0x29cd99){var _0x250e6a={},_0x3c93a={},_0xcf894d={'count':0x0,'rows':[]};var _0x49547c=_[_0x6bd3('0x29')](db[_0x6bd3('0x2a')]['rawAttributes'],function(_0x55fde9){return{'name':_0x55fde9[_0x6bd3('0x2b')],'type':_0x55fde9[_0x6bd3('0x2c')][_0x6bd3('0x2d')]};});_0x3c93a['model']=_[_0x6bd3('0x29')](_0x49547c,'name');_0x3c93a[_0x6bd3('0x2e')]=_['keys'](_0x1acfa5['query']);_0x3c93a['filters']=_[_0x6bd3('0x2f')](_0x3c93a[_0x6bd3('0x30')],_0x3c93a[_0x6bd3('0x2e')]);_0x250e6a['attributes']=_[_0x6bd3('0x2f')](_0x3c93a[_0x6bd3('0x30')],qs[_0x6bd3('0x31')](_0x1acfa5[_0x6bd3('0x2e')][_0x6bd3('0x31')]));_0x250e6a[_0x6bd3('0x32')]=_0x250e6a[_0x6bd3('0x32')][_0x6bd3('0x33')]?_0x250e6a['attributes']:_0x3c93a[_0x6bd3('0x30')];if(!_0x1acfa5[_0x6bd3('0x2e')][_0x6bd3('0x34')](_0x6bd3('0x35'))){_0x250e6a[_0x6bd3('0x1b')]=qs[_0x6bd3('0x1b')](_0x1acfa5[_0x6bd3('0x2e')][_0x6bd3('0x1b')]);_0x250e6a['offset']=qs['offset'](_0x1acfa5[_0x6bd3('0x2e')][_0x6bd3('0x1d')]);}_0x250e6a[_0x6bd3('0x36')]=qs[_0x6bd3('0x37')](_0x1acfa5['query'][_0x6bd3('0x37')]);_0x250e6a[_0x6bd3('0x38')]=qs[_0x6bd3('0x39')](_[_0x6bd3('0x3a')](_0x1acfa5[_0x6bd3('0x2e')],_0x3c93a['filters']),_0x49547c);if(_0x1acfa5[_0x6bd3('0x2e')]['filter']){_0x250e6a[_0x6bd3('0x38')]=_[_0x6bd3('0x3b')](_0x250e6a[_0x6bd3('0x38')],{'$or':_[_0x6bd3('0x29')](_0x49547c,function(_0x51b42e){if(_0x51b42e[_0x6bd3('0x2c')]!==_0x6bd3('0x3c')){var _0x2e860={};_0x2e860[_0x51b42e[_0x6bd3('0x27')]]={'$like':'%'+_0x1acfa5[_0x6bd3('0x2e')][_0x6bd3('0x3d')]+'%'};return _0x2e860;}})});}_0x250e6a=_[_0x6bd3('0x3b')]({},_0x250e6a,_0x1acfa5['options']);var _0x2d3a27={'where':_0x250e6a['where']};return db[_0x6bd3('0x2a')][_0x6bd3('0x1c')](_0x2d3a27)[_0x6bd3('0x23')](function(_0x363fca){_0xcf894d['count']=_0x363fca;if(_0x1acfa5[_0x6bd3('0x2e')]['includeAll']){_0x250e6a[_0x6bd3('0x3e')]=[{'all':!![]}];}return db[_0x6bd3('0x2a')][_0x6bd3('0x3f')](_0x250e6a);})['then'](function(_0x24c793){_0xcf894d[_0x6bd3('0x40')]=_0x24c793;return _0xcf894d;})[_0x6bd3('0x23')](respondWithFilteredResult(_0x29cd99,_0x250e6a))[_0x6bd3('0x41')](handleError(_0x29cd99,null));};exports['show']=function(_0x22bde0,_0x24dc48){var _0x2c1cea={'raw':![],'where':{'id':_0x22bde0[_0x6bd3('0x42')]['id']}},_0x17a6a3={};_0x17a6a3[_0x6bd3('0x30')]=_[_0x6bd3('0x43')](db[_0x6bd3('0x2a')][_0x6bd3('0x44')]);_0x17a6a3['query']=_['keys'](_0x22bde0[_0x6bd3('0x2e')]);_0x17a6a3['filters']=_[_0x6bd3('0x2f')](_0x17a6a3[_0x6bd3('0x30')],_0x17a6a3[_0x6bd3('0x2e')]);_0x2c1cea[_0x6bd3('0x32')]=_[_0x6bd3('0x2f')](_0x17a6a3[_0x6bd3('0x30')],qs[_0x6bd3('0x31')](_0x22bde0[_0x6bd3('0x2e')][_0x6bd3('0x31')]));_0x2c1cea['attributes']=_0x2c1cea[_0x6bd3('0x32')][_0x6bd3('0x33')]?_0x2c1cea[_0x6bd3('0x32')]:_0x17a6a3['model'];if(_0x22bde0['query'][_0x6bd3('0x45')]){_0x2c1cea[_0x6bd3('0x3e')]=[{'all':!![]}];}_0x2c1cea=_[_0x6bd3('0x3b')]({},_0x2c1cea,_0x22bde0[_0x6bd3('0x46')]);return db[_0x6bd3('0x2a')][_0x6bd3('0x47')](_0x2c1cea)[_0x6bd3('0x23')](handleEntityNotFound(_0x24dc48,null))[_0x6bd3('0x23')](respondWithResult(_0x24dc48,null))[_0x6bd3('0x41')](handleError(_0x24dc48,null));};exports[_0x6bd3('0x48')]=function(_0x5be675,_0x551d92){return db[_0x6bd3('0x2a')]['create'](_0x5be675[_0x6bd3('0x49')],{})[_0x6bd3('0x23')](respondWithResult(_0x551d92,0xc9))[_0x6bd3('0x41')](handleError(_0x551d92,null));};exports[_0x6bd3('0x22')]=function(_0x140e27,_0x4f3993){if(_0x140e27['body']['id']){delete _0x140e27['body']['id'];}return db[_0x6bd3('0x2a')][_0x6bd3('0x47')]({'where':{'id':_0x140e27[_0x6bd3('0x42')]['id']}})[_0x6bd3('0x23')](handleEntityNotFound(_0x4f3993,null))['then'](saveUpdates(_0x140e27[_0x6bd3('0x49')],null))['then'](respondWithResult(_0x4f3993,null))['catch'](handleError(_0x4f3993,null));};exports[_0x6bd3('0x24')]=function(_0x12d6dc,_0x484baa){return db['FreshsalesConfiguration'][_0x6bd3('0x47')]({'where':{'id':_0x12d6dc['params']['id']}})['then'](handleEntityNotFound(_0x484baa,null))[_0x6bd3('0x23')](removeEntity(_0x484baa,null))[_0x6bd3('0x41')](handleError(_0x484baa,null));};exports['getSubjects']=function(_0x5ce716,_0x475a24,_0x553b57){var _0x47e609={};var _0x5e0cb8={};var _0x5163d7;var _0x3da558;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x5ce716['params']['id']}})[_0x6bd3('0x23')](handleEntityNotFound(_0x475a24,null))[_0x6bd3('0x23')](function(_0x594866){if(_0x594866){_0x5163d7=_0x594866;_0x5e0cb8[_0x6bd3('0x30')]=_['keys'](db[_0x6bd3('0x4a')]['rawAttributes']);_0x5e0cb8[_0x6bd3('0x2e')]=_[_0x6bd3('0x43')](_0x5ce716[_0x6bd3('0x2e')]);_0x5e0cb8[_0x6bd3('0x39')]=_[_0x6bd3('0x2f')](_0x5e0cb8[_0x6bd3('0x30')],_0x5e0cb8[_0x6bd3('0x2e')]);_0x47e609[_0x6bd3('0x32')]=_[_0x6bd3('0x2f')](_0x5e0cb8[_0x6bd3('0x30')],qs[_0x6bd3('0x31')](_0x5ce716[_0x6bd3('0x2e')][_0x6bd3('0x31')]));_0x47e609[_0x6bd3('0x32')]=_0x47e609[_0x6bd3('0x32')][_0x6bd3('0x33')]?_0x47e609[_0x6bd3('0x32')]:_0x5e0cb8[_0x6bd3('0x30')];_0x47e609[_0x6bd3('0x36')]=qs[_0x6bd3('0x37')](_0x5ce716[_0x6bd3('0x2e')][_0x6bd3('0x37')]);_0x47e609[_0x6bd3('0x38')]=qs['filters'](_[_0x6bd3('0x3a')](_0x5ce716[_0x6bd3('0x2e')],_0x5e0cb8[_0x6bd3('0x39')]));if(_0x5ce716['query'][_0x6bd3('0x3d')]){_0x47e609['where']=_[_0x6bd3('0x3b')](_0x47e609['where'],{'$or':_[_0x6bd3('0x29')](_0x47e609[_0x6bd3('0x32')],function(_0x577f96){var _0x29cb6f={};_0x29cb6f[_0x577f96]={'$like':'%'+_0x5ce716[_0x6bd3('0x2e')]['filter']+'%'};return _0x29cb6f;})});}_0x47e609=_[_0x6bd3('0x3b')]({},_0x47e609,_0x5ce716[_0x6bd3('0x46')]);return _0x5163d7[_0x6bd3('0x4b')](_0x47e609);}})[_0x6bd3('0x23')](function(_0x2ba3c8){if(_0x2ba3c8){_0x3da558=_0x2ba3c8[_0x6bd3('0x33')];if(!_0x5ce716[_0x6bd3('0x2e')][_0x6bd3('0x34')](_0x6bd3('0x35'))){_0x47e609['limit']=qs['limit'](_0x5ce716['query'][_0x6bd3('0x1b')]);_0x47e609[_0x6bd3('0x1d')]=qs[_0x6bd3('0x1d')](_0x5ce716[_0x6bd3('0x2e')][_0x6bd3('0x1d')]);}return _0x5163d7[_0x6bd3('0x4b')](_0x47e609);}})['then'](function(_0x3c6b4f){if(_0x3c6b4f){return _0x3c6b4f?{'count':_0x3da558,'rows':_0x3c6b4f}:null;}})[_0x6bd3('0x23')](respondWithResult(_0x475a24,null))[_0x6bd3('0x41')](handleError(_0x475a24,null));};exports[_0x6bd3('0x4c')]=function(_0x31ce92,_0x132c49,_0x376e10){var _0x434e33={};var _0x4c5f1e={};var _0x5065e8;var _0x185674;return db[_0x6bd3('0x2a')][_0x6bd3('0x4d')]({'where':{'id':_0x31ce92[_0x6bd3('0x42')]['id']}})[_0x6bd3('0x23')](handleEntityNotFound(_0x132c49,null))[_0x6bd3('0x23')](function(_0x162d2f){if(_0x162d2f){_0x5065e8=_0x162d2f;_0x4c5f1e[_0x6bd3('0x30')]=_[_0x6bd3('0x43')](db[_0x6bd3('0x4a')][_0x6bd3('0x44')]);_0x4c5f1e[_0x6bd3('0x2e')]=_[_0x6bd3('0x43')](_0x31ce92[_0x6bd3('0x2e')]);_0x4c5f1e['filters']=_['intersection'](_0x4c5f1e[_0x6bd3('0x30')],_0x4c5f1e[_0x6bd3('0x2e')]);_0x434e33[_0x6bd3('0x32')]=_[_0x6bd3('0x2f')](_0x4c5f1e[_0x6bd3('0x30')],qs['fields'](_0x31ce92[_0x6bd3('0x2e')][_0x6bd3('0x31')]));_0x434e33[_0x6bd3('0x32')]=_0x434e33[_0x6bd3('0x32')]['length']?_0x434e33[_0x6bd3('0x32')]:_0x4c5f1e[_0x6bd3('0x30')];_0x434e33[_0x6bd3('0x36')]=qs[_0x6bd3('0x37')](_0x31ce92[_0x6bd3('0x2e')][_0x6bd3('0x37')]);_0x434e33[_0x6bd3('0x38')]=qs[_0x6bd3('0x39')](_[_0x6bd3('0x3a')](_0x31ce92['query'],_0x4c5f1e['filters']));if(_0x31ce92[_0x6bd3('0x2e')][_0x6bd3('0x3d')]){_0x434e33[_0x6bd3('0x38')]=_[_0x6bd3('0x3b')](_0x434e33[_0x6bd3('0x38')],{'$or':_[_0x6bd3('0x29')](_0x434e33[_0x6bd3('0x32')],function(_0xad94ad){var _0x27ee30={};_0x27ee30[_0xad94ad]={'$like':'%'+_0x31ce92[_0x6bd3('0x2e')]['filter']+'%'};return _0x27ee30;})});}_0x434e33=_[_0x6bd3('0x3b')]({},_0x434e33,_0x31ce92[_0x6bd3('0x46')]);return _0x5065e8[_0x6bd3('0x4c')](_0x434e33);}})[_0x6bd3('0x23')](function(_0x238b2e){if(_0x238b2e){_0x185674=_0x238b2e[_0x6bd3('0x33')];if(!_0x31ce92[_0x6bd3('0x2e')][_0x6bd3('0x34')](_0x6bd3('0x35'))){_0x434e33[_0x6bd3('0x1b')]=qs[_0x6bd3('0x1b')](_0x31ce92[_0x6bd3('0x2e')]['limit']);_0x434e33[_0x6bd3('0x1d')]=qs[_0x6bd3('0x1d')](_0x31ce92[_0x6bd3('0x2e')][_0x6bd3('0x1d')]);}return _0x5065e8['getDescriptions'](_0x434e33);}})[_0x6bd3('0x23')](function(_0x5807d8){if(_0x5807d8){return _0x5807d8?{'count':_0x185674,'rows':_0x5807d8}:null;}})[_0x6bd3('0x23')](respondWithResult(_0x132c49,null))[_0x6bd3('0x41')](handleError(_0x132c49,null));};exports[_0x6bd3('0x4e')]=function(_0x4dee05,_0x411096,_0x114448){var _0x67295e={};var _0x2bec6d={};var _0x47946b;var _0x45ea19;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x4dee05[_0x6bd3('0x42')]['id']}})[_0x6bd3('0x23')](handleEntityNotFound(_0x411096,null))[_0x6bd3('0x23')](function(_0x490ccf){if(_0x490ccf){_0x47946b=_0x490ccf;_0x2bec6d[_0x6bd3('0x30')]=_[_0x6bd3('0x43')](db[_0x6bd3('0x4a')][_0x6bd3('0x44')]);_0x2bec6d[_0x6bd3('0x2e')]=_['keys'](_0x4dee05[_0x6bd3('0x2e')]);_0x2bec6d['filters']=_[_0x6bd3('0x2f')](_0x2bec6d[_0x6bd3('0x30')],_0x2bec6d[_0x6bd3('0x2e')]);_0x67295e['attributes']=_[_0x6bd3('0x2f')](_0x2bec6d[_0x6bd3('0x30')],qs[_0x6bd3('0x31')](_0x4dee05[_0x6bd3('0x2e')][_0x6bd3('0x31')]));_0x67295e[_0x6bd3('0x32')]=_0x67295e['attributes'][_0x6bd3('0x33')]?_0x67295e[_0x6bd3('0x32')]:_0x2bec6d[_0x6bd3('0x30')];_0x67295e['order']=qs['sort'](_0x4dee05['query'][_0x6bd3('0x37')]);_0x67295e[_0x6bd3('0x38')]=qs[_0x6bd3('0x39')](_[_0x6bd3('0x3a')](_0x4dee05[_0x6bd3('0x2e')],_0x2bec6d[_0x6bd3('0x39')]));if(_0x4dee05[_0x6bd3('0x2e')]['filter']){_0x67295e[_0x6bd3('0x38')]=_['merge'](_0x67295e[_0x6bd3('0x38')],{'$or':_['map'](_0x67295e['attributes'],function(_0x226424){var _0xe725e0={};_0xe725e0[_0x226424]={'$like':'%'+_0x4dee05[_0x6bd3('0x2e')][_0x6bd3('0x3d')]+'%'};return _0xe725e0;})});}_0x67295e=_[_0x6bd3('0x3b')]({},_0x67295e,_0x4dee05['options']);return _0x47946b['getFields'](_0x67295e);}})[_0x6bd3('0x23')](function(_0x525022){if(_0x525022){_0x45ea19=_0x525022[_0x6bd3('0x33')];if(!_0x4dee05[_0x6bd3('0x2e')][_0x6bd3('0x34')](_0x6bd3('0x35'))){_0x67295e[_0x6bd3('0x1b')]=qs[_0x6bd3('0x1b')](_0x4dee05[_0x6bd3('0x2e')]['limit']);_0x67295e[_0x6bd3('0x1d')]=qs[_0x6bd3('0x1d')](_0x4dee05[_0x6bd3('0x2e')]['offset']);}return _0x47946b[_0x6bd3('0x4e')](_0x67295e);}})[_0x6bd3('0x23')](function(_0x215667){if(_0x215667){return _0x215667?{'count':_0x45ea19,'rows':_0x215667}:null;}})['then'](respondWithResult(_0x411096,null))[_0x6bd3('0x41')](handleError(_0x411096,null));};
\ No newline at end of file
index c60ded0..7d3f526 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd726=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd726,0x1df));var _0x6d72=function(_0x127535,_0x48c1c9){_0x127535=_0x127535-0x0;var _0x4c4da9=_0xd726[_0x127535];return _0x4c4da9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6d72('0x0'))(_0x6d72('0x1'));var moment=require(_0x6d72('0x2'));var BPromise=require(_0x6d72('0x3'));var rp=require(_0x6d72('0x4'));var fs=require('fs');var path=require(_0x6d72('0x5'));var rimraf=require(_0x6d72('0x6'));var config=require(_0x6d72('0x7'));var attributes=require(_0x6d72('0x8'));module['exports']=function(_0xaf2399,_0x457b1d){return _0xaf2399[_0x6d72('0x9')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4642a6,_0x451745){var _0x26b003=function(_0x218635){while(--_0x218635){_0x4642a6['push'](_0x4642a6['shift']());}};_0x26b003(++_0x451745);}(_0x757a,0x7e));var _0xa757=function(_0x511ca6,_0x3bbfbc){_0x511ca6=_0x511ca6-0x0;var _0x4b71f2=_0x757a[_0x511ca6];return _0x4b71f2;};'use strict';var _=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var logger=require(_0xa757('0x2'))(_0xa757('0x3'));var moment=require(_0xa757('0x4'));var BPromise=require(_0xa757('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa757('0x6'));var config=require(_0xa757('0x7'));var attributes=require(_0xa757('0x8'));module['exports']=function(_0x515d23,_0x2fccc5){return _0x515d23['define'](_0xa757('0x9'),attributes,{'tableName':_0xa757('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 55c264f..79ede1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','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','catch','lodash'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9fd9,0x16f));var _0x99fd=function(_0x5b0408,_0x3f40cd){_0x5b0408=_0x5b0408-0x0;var _0x19ba46=_0x9fd9[_0x5b0408];return _0x19ba46;};'use strict';var _=require(_0x99fd('0x0'));var util=require('util');var moment=require(_0x99fd('0x1'));var BPromise=require(_0x99fd('0x2'));var rs=require(_0x99fd('0x3'));var fs=require('fs');var Redis=require(_0x99fd('0x4'));var db=require(_0x99fd('0x5'))['db'];var utils=require(_0x99fd('0x6'));var logger=require(_0x99fd('0x7'))(_0x99fd('0x8'));var config=require('../../config/environment');var jayson=require(_0x99fd('0x9'));var client=jayson[_0x99fd('0xa')][_0x99fd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa10c2a,_0x2e9f05,_0x24ca6a){return new BPromise(function(_0x229fbb,_0x2e4dbb){return client[_0x99fd('0xc')](_0xa10c2a,_0x24ca6a)[_0x99fd('0xd')](function(_0x1ce25c){logger[_0x99fd('0xe')](_0x99fd('0xf'),_0x2e9f05,_0x99fd('0x10'));logger[_0x99fd('0x11')](_0x99fd('0x12'),_0x2e9f05,_0x99fd('0x10'),JSON['stringify'](_0x1ce25c));if(_0x1ce25c['error']){if(_0x1ce25c[_0x99fd('0x13')][_0x99fd('0x14')]===0x1f4){logger[_0x99fd('0x13')](_0x99fd('0xf'),_0x2e9f05,_0x1ce25c['error']['message']);return _0x2e4dbb(_0x1ce25c['error'][_0x99fd('0x15')]);}logger[_0x99fd('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2e9f05,_0x1ce25c[_0x99fd('0x13')][_0x99fd('0x15')]);return _0x229fbb(_0x1ce25c['error'][_0x99fd('0x15')]);}else{logger[_0x99fd('0xe')](_0x99fd('0xf'),_0x2e9f05,_0x99fd('0x10'));_0x229fbb(_0x1ce25c['result'][_0x99fd('0x15')]);}})[_0x99fd('0x16')](function(_0x1e1b50){logger[_0x99fd('0x13')](_0x99fd('0xf'),_0x2e9f05,_0x1e1b50);_0x2e4dbb(_0x1e1b50);});});}
\ No newline at end of file
+var _0x5ea4=['FreshsalesConfiguration,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x51fec4,_0xa952b0){var _0x31eac1=function(_0x1cbcb0){while(--_0x1cbcb0){_0x51fec4['push'](_0x51fec4['shift']());}};_0x31eac1(++_0xa952b0);}(_0x5ea4,0x10c));var _0x45ea=function(_0x1037dc,_0x2a1188){_0x1037dc=_0x1037dc-0x0;var _0xeacfa6=_0x5ea4[_0x1037dc];return _0xeacfa6;};'use strict';var _=require(_0x45ea('0x0'));var util=require(_0x45ea('0x1'));var moment=require(_0x45ea('0x2'));var BPromise=require(_0x45ea('0x3'));var rs=require(_0x45ea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45ea('0x5'))['db'];var utils=require(_0x45ea('0x6'));var logger=require(_0x45ea('0x7'))(_0x45ea('0x8'));var config=require(_0x45ea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x45ea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19e7ae,_0x54979b,_0x5db562){return new BPromise(function(_0x539819,_0x7d3b9a){return client[_0x45ea('0xb')](_0x19e7ae,_0x5db562)[_0x45ea('0xc')](function(_0x1749ac){logger[_0x45ea('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x54979b,'request\x20sent');logger[_0x45ea('0xe')](_0x45ea('0xf'),_0x54979b,'request\x20sent',JSON[_0x45ea('0x10')](_0x1749ac));if(_0x1749ac['error']){if(_0x1749ac['error']['code']===0x1f4){logger[_0x45ea('0x11')](_0x45ea('0x12'),_0x54979b,_0x1749ac[_0x45ea('0x11')][_0x45ea('0x13')]);return _0x7d3b9a(_0x1749ac[_0x45ea('0x11')][_0x45ea('0x13')]);}logger[_0x45ea('0x11')](_0x45ea('0x12'),_0x54979b,_0x1749ac[_0x45ea('0x11')][_0x45ea('0x13')]);return _0x539819(_0x1749ac[_0x45ea('0x11')]['message']);}else{logger[_0x45ea('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x54979b,_0x45ea('0x14'));_0x539819(_0x1749ac[_0x45ea('0x15')]['message']);}})['catch'](function(_0x2bd38d){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x54979b,_0x2bd38d);_0x7d3b9a(_0x2bd38d);});});}
\ No newline at end of file
index 22e6376..5b8e2e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38df=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x38df,0x144));var _0xf38d=function(_0xdb0d3,_0xa7146b){_0xdb0d3=_0xdb0d3-0x0;var _0x333824=_0x38df[_0xdb0d3];return _0x333824;};'use strict';var multer=require(_0xf38d('0x0'));var util=require(_0xf38d('0x1'));var path=require(_0xf38d('0x2'));var timeout=require(_0xf38d('0x3'));var express=require(_0xf38d('0x4'));var router=express[_0xf38d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf38d('0x6'));var config=require(_0xf38d('0x7'));var controller=require(_0xf38d('0x8'));router['get']('/',auth[_0xf38d('0x9')](),controller[_0xf38d('0xa')]);router[_0xf38d('0xb')](_0xf38d('0xc'),auth[_0xf38d('0x9')](),controller[_0xf38d('0xd')]);router[_0xf38d('0xe')]('/',auth[_0xf38d('0x9')](),controller[_0xf38d('0xf')]);router[_0xf38d('0x10')](_0xf38d('0xc'),auth[_0xf38d('0x9')](),controller[_0xf38d('0x11')]);router['delete'](_0xf38d('0xc'),auth[_0xf38d('0x9')](),controller[_0xf38d('0x12')]);module[_0xf38d('0x13')]=router;
\ No newline at end of file
+var _0x0cee=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x0cee,0x12f));var _0xe0ce=function(_0x345a17,_0x3b9d2a){_0x345a17=_0x345a17-0x0;var _0xd0f947=_0x0cee[_0x345a17];return _0xd0f947;};'use strict';var multer=require(_0xe0ce('0x0'));var util=require(_0xe0ce('0x1'));var path=require(_0xe0ce('0x2'));var timeout=require(_0xe0ce('0x3'));var express=require(_0xe0ce('0x4'));var router=express[_0xe0ce('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe0ce('0x6'));var config=require(_0xe0ce('0x7'));var controller=require(_0xe0ce('0x8'));router[_0xe0ce('0x9')]('/',auth[_0xe0ce('0xa')](),controller[_0xe0ce('0xb')]);router[_0xe0ce('0x9')](_0xe0ce('0xc'),auth['isAuthenticated'](),controller[_0xe0ce('0xd')]);router[_0xe0ce('0xe')]('/',auth['isAuthenticated'](),controller[_0xe0ce('0xf')]);router[_0xe0ce('0x10')](_0xe0ce('0xc'),auth[_0xe0ce('0xa')](),controller['update']);router['delete']('/:id',auth[_0xe0ce('0xa')](),controller[_0xe0ce('0x11')]);module[_0xe0ce('0x12')]=router;
\ No newline at end of file
index fa4b24c..d7e0c5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d49=['sequelize','exports','string','variable','customVariable','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x83420c,_0x50fd91){var _0x1057d7=function(_0x80befc){while(--_0x80befc){_0x83420c['push'](_0x83420c['shift']());}};_0x1057d7(++_0x50fd91);}(_0x1d49,0xbd));var _0x91d4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1d49[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x91d4('0x0'));module[_0x91d4('0x1')]={'type':{'type':Sequelize['ENUM'](_0x91d4('0x2'),_0x91d4('0x3'),_0x91d4('0x4'),_0x91d4('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x91d4('0x6')]},'key':{'type':Sequelize[_0x91d4('0x6')]},'keyType':{'type':Sequelize[_0x91d4('0x7')](_0x91d4('0x2'),_0x91d4('0x3'),_0x91d4('0x4'))},'keyContent':{'type':Sequelize[_0x91d4('0x6')]},'idField':{'type':Sequelize[_0x91d4('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x91d4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x91d4('0x6')]}};
\ No newline at end of file
+var _0xb091=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x1b19fe,_0x25a813){var _0x2115c7=function(_0x21d6ff){while(--_0x21d6ff){_0x1b19fe['push'](_0x1b19fe['shift']());}};_0x2115c7(++_0x25a813);}(_0xb091,0xb9));var _0x1b09=function(_0x530beb,_0x11ea0c){_0x530beb=_0x530beb-0x0;var _0x41e9a3=_0xb091[_0x530beb];return _0x41e9a3;};'use strict';var Sequelize=require('sequelize');module[_0x1b09('0x0')]={'type':{'type':Sequelize[_0x1b09('0x1')](_0x1b09('0x2'),_0x1b09('0x3'),_0x1b09('0x4'),_0x1b09('0x5'),_0x1b09('0x6')),'defaultValue':_0x1b09('0x2')},'content':{'type':Sequelize[_0x1b09('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1b09('0x1')](_0x1b09('0x2'),'variable',_0x1b09('0x4'))},'keyContent':{'type':Sequelize[_0x1b09('0x7')]},'idField':{'type':Sequelize[_0x1b09('0x7')]},'nameField':{'type':Sequelize[_0x1b09('0x7')]},'customField':{'type':Sequelize[_0x1b09('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1b09('0x7')]}};
\ No newline at end of file
index 7d2ab2f..1179f59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0249=['body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','includeAll','find','create'];(function(_0xd2a393,_0x51ca4e){var _0xe628c1=function(_0x13e0d1){while(--_0x13e0d1){_0xd2a393['push'](_0xd2a393['shift']());}};_0xe628c1(++_0x51ca4e);}(_0x0249,0x179));var _0x9024=function(_0x537eda,_0x1b3aed){_0x537eda=_0x537eda-0x0;var _0x4926a9=_0x0249[_0x537eda];return _0x4926a9;};'use strict';var emlformat=require(_0x9024('0x0'));var rimraf=require(_0x9024('0x1'));var zipdir=require(_0x9024('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9024('0x3'));var BPromise=require(_0x9024('0x4'));var Mustache=require(_0x9024('0x5'));var util=require(_0x9024('0x6'));var path=require(_0x9024('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9024('0x8'));var squel=require(_0x9024('0x9'));var crypto=require(_0x9024('0xa'));var jsforce=require(_0x9024('0xb'));var deskjs=require(_0x9024('0xc'));var toCsv=require(_0x9024('0xd'));var querystring=require(_0x9024('0xe'));var Papa=require(_0x9024('0xf'));var Redis=require(_0x9024('0x10'));var authService=require(_0x9024('0x11'));var qs=require(_0x9024('0x12'));var as=require(_0x9024('0x13'));var hardwareService=require(_0x9024('0x14'));var logger=require(_0x9024('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9024('0x16'));var licenseUtil=require(_0x9024('0x17'));var db=require(_0x9024('0x18'))['db'];function respondWithStatusCode(_0x5b0f08,_0x37cff0){_0x37cff0=_0x37cff0||0xcc;return function(_0x4783f4){if(_0x4783f4){return _0x5b0f08[_0x9024('0x19')](_0x37cff0);}return _0x5b0f08[_0x9024('0x1a')](_0x37cff0)[_0x9024('0x1b')]();};}function respondWithResult(_0x2e6d9f,_0x410317){_0x410317=_0x410317||0xc8;return function(_0x439e1c){if(_0x439e1c){return _0x2e6d9f[_0x9024('0x1a')](_0x410317)[_0x9024('0x1c')](_0x439e1c);}};}function respondWithFilteredResult(_0x458171,_0xd39385){return function(_0x1c7960){if(_0x1c7960){var _0x171691=typeof _0xd39385[_0x9024('0x1d')]==='undefined'&&typeof _0xd39385[_0x9024('0x1e')]==='undefined';var _0x2642f8=_0x1c7960[_0x9024('0x1f')];var _0xdd5ab3=_0x171691?0x0:_0xd39385[_0x9024('0x1d')];var _0x12d7b4=_0x171691?_0x1c7960[_0x9024('0x1f')]:_0xd39385[_0x9024('0x1d')]+_0xd39385[_0x9024('0x1e')];var _0x1e8398;if(_0x12d7b4>=_0x2642f8){_0x12d7b4=_0x2642f8;_0x1e8398=0xc8;}else{_0x1e8398=0xce;}_0x458171[_0x9024('0x1a')](_0x1e8398);return _0x458171[_0x9024('0x20')](_0x9024('0x21'),_0xdd5ab3+'-'+_0x12d7b4+'/'+_0x2642f8)[_0x9024('0x1c')](_0x1c7960);}return null;};}function patchUpdates(_0x2a537c){return function(_0x3b2499){try{jsonpatch[_0x9024('0x22')](_0x3b2499,_0x2a537c,!![]);}catch(_0x81aabd){return BPromise[_0x9024('0x23')](_0x81aabd);}return _0x3b2499[_0x9024('0x24')]();};}function saveUpdates(_0xa38d3,_0x4627f9){return function(_0x389bb8){if(_0x389bb8){return _0x389bb8[_0x9024('0x25')](_0xa38d3)[_0x9024('0x26')](function(_0x3684e7){return _0x3684e7;});}return null;};}function removeEntity(_0x523ba6,_0x57226d){return function(_0x567d6d){if(_0x567d6d){return _0x567d6d[_0x9024('0x27')]()[_0x9024('0x26')](function(){_0x523ba6[_0x9024('0x1a')](0xcc)[_0x9024('0x1b')]();});}};}function handleEntityNotFound(_0x42691d,_0x47ac01){return function(_0x1ec0b9){if(!_0x1ec0b9){_0x42691d[_0x9024('0x19')](0x194);}return _0x1ec0b9;};}function handleError(_0x5a8c74,_0x106efb){_0x106efb=_0x106efb||0x1f4;return function(_0x4c6c53){logger[_0x9024('0x28')](_0x4c6c53[_0x9024('0x29')]);if(_0x4c6c53[_0x9024('0x2a')]){delete _0x4c6c53[_0x9024('0x2a')];}_0x5a8c74[_0x9024('0x1a')](_0x106efb)[_0x9024('0x2b')](_0x4c6c53);};}exports['index']=function(_0x3edaa2,_0x4eaa21){var _0x5397fe={},_0x50abf0={},_0x3bc23d={'count':0x0,'rows':[]};var _0x2280a0=_[_0x9024('0x2c')](db[_0x9024('0x2d')][_0x9024('0x2e')],function(_0x10d7af){return{'name':_0x10d7af['fieldName'],'type':_0x10d7af[_0x9024('0x2f')][_0x9024('0x30')]};});_0x50abf0['model']=_[_0x9024('0x2c')](_0x2280a0,_0x9024('0x2a'));_0x50abf0[_0x9024('0x31')]=_[_0x9024('0x32')](_0x3edaa2[_0x9024('0x31')]);_0x50abf0[_0x9024('0x33')]=_[_0x9024('0x34')](_0x50abf0[_0x9024('0x35')],_0x50abf0[_0x9024('0x31')]);_0x5397fe[_0x9024('0x36')]=_[_0x9024('0x34')](_0x50abf0[_0x9024('0x35')],qs[_0x9024('0x37')](_0x3edaa2[_0x9024('0x31')]['fields']));_0x5397fe[_0x9024('0x36')]=_0x5397fe[_0x9024('0x36')][_0x9024('0x38')]?_0x5397fe[_0x9024('0x36')]:_0x50abf0[_0x9024('0x35')];if(!_0x3edaa2[_0x9024('0x31')][_0x9024('0x39')](_0x9024('0x3a'))){_0x5397fe[_0x9024('0x1e')]=qs[_0x9024('0x1e')](_0x3edaa2[_0x9024('0x31')][_0x9024('0x1e')]);_0x5397fe[_0x9024('0x1d')]=qs[_0x9024('0x1d')](_0x3edaa2['query']['offset']);}_0x5397fe[_0x9024('0x3b')]=qs[_0x9024('0x3c')](_0x3edaa2[_0x9024('0x31')][_0x9024('0x3c')]);_0x5397fe[_0x9024('0x3d')]=qs[_0x9024('0x33')](_[_0x9024('0x3e')](_0x3edaa2[_0x9024('0x31')],_0x50abf0[_0x9024('0x33')]),_0x2280a0);if(_0x3edaa2[_0x9024('0x31')][_0x9024('0x3f')]){_0x5397fe[_0x9024('0x3d')]=_[_0x9024('0x40')](_0x5397fe['where'],{'$or':_['map'](_0x2280a0,function(_0x157533){if(_0x157533[_0x9024('0x2f')]!==_0x9024('0x41')){var _0x50f18e={};_0x50f18e[_0x157533[_0x9024('0x2a')]]={'$like':'%'+_0x3edaa2[_0x9024('0x31')][_0x9024('0x3f')]+'%'};return _0x50f18e;}})});}_0x5397fe=_['merge']({},_0x5397fe,_0x3edaa2[_0x9024('0x42')]);var _0x5cd8bc={'where':_0x5397fe['where']};return db['FreshsalesField'][_0x9024('0x1f')](_0x5cd8bc)[_0x9024('0x26')](function(_0x36f424){_0x3bc23d[_0x9024('0x1f')]=_0x36f424;if(_0x3edaa2[_0x9024('0x31')]['includeAll']){_0x5397fe['include']=[{'all':!![]}];}return db[_0x9024('0x2d')][_0x9024('0x43')](_0x5397fe);})['then'](function(_0x51cacf){_0x3bc23d[_0x9024('0x44')]=_0x51cacf;return _0x3bc23d;})[_0x9024('0x26')](respondWithFilteredResult(_0x4eaa21,_0x5397fe))[_0x9024('0x45')](handleError(_0x4eaa21,null));};exports['show']=function(_0x17784a,_0x4a5ae3){var _0x501a52={'raw':!![],'where':{'id':_0x17784a['params']['id']}},_0x9e4806={};_0x9e4806['model']=_[_0x9024('0x32')](db[_0x9024('0x2d')][_0x9024('0x2e')]);_0x9e4806[_0x9024('0x31')]=_['keys'](_0x17784a[_0x9024('0x31')]);_0x9e4806[_0x9024('0x33')]=_[_0x9024('0x34')](_0x9e4806[_0x9024('0x35')],_0x9e4806[_0x9024('0x31')]);_0x501a52['attributes']=_[_0x9024('0x34')](_0x9e4806[_0x9024('0x35')],qs[_0x9024('0x37')](_0x17784a[_0x9024('0x31')]['fields']));_0x501a52[_0x9024('0x36')]=_0x501a52[_0x9024('0x36')][_0x9024('0x38')]?_0x501a52[_0x9024('0x36')]:_0x9e4806[_0x9024('0x35')];if(_0x17784a[_0x9024('0x31')][_0x9024('0x46')]){_0x501a52['include']=[{'all':!![]}];}_0x501a52=_['merge']({},_0x501a52,_0x17784a[_0x9024('0x42')]);return db[_0x9024('0x2d')][_0x9024('0x47')](_0x501a52)[_0x9024('0x26')](handleEntityNotFound(_0x4a5ae3,null))['then'](respondWithResult(_0x4a5ae3,null))[_0x9024('0x45')](handleError(_0x4a5ae3,null));};exports[_0x9024('0x48')]=function(_0x8e55db,_0x167b2c){return db['FreshsalesField'][_0x9024('0x48')](_0x8e55db[_0x9024('0x49')],{})[_0x9024('0x26')](respondWithResult(_0x167b2c,0xc9))[_0x9024('0x45')](handleError(_0x167b2c,null));};exports[_0x9024('0x25')]=function(_0x5e465c,_0x4366c8){if(_0x5e465c[_0x9024('0x49')]['id']){delete _0x5e465c[_0x9024('0x49')]['id'];}return db[_0x9024('0x2d')][_0x9024('0x47')]({'where':{'id':_0x5e465c[_0x9024('0x4a')]['id']}})[_0x9024('0x26')](handleEntityNotFound(_0x4366c8,null))['then'](saveUpdates(_0x5e465c[_0x9024('0x49')],null))[_0x9024('0x26')](respondWithResult(_0x4366c8,null))[_0x9024('0x45')](handleError(_0x4366c8,null));};exports[_0x9024('0x27')]=function(_0x393830,_0x81fb40){return db[_0x9024('0x2d')][_0x9024('0x47')]({'where':{'id':_0x393830[_0x9024('0x4a')]['id']}})[_0x9024('0x26')](handleEntityNotFound(_0x81fb40,null))['then'](removeEntity(_0x81fb40,null))[_0x9024('0x45')](handleError(_0x81fb40,null));};
\ No newline at end of file
+var _0xb69d=['end','error','stack','name','map','FreshsalesField','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','rawAttributes','include','catch','create','body','find','params','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0xc80bfc,_0x175b63){var _0x136fe0=function(_0x572013){while(--_0x572013){_0xc80bfc['push'](_0xc80bfc['shift']());}};_0x136fe0(++_0x175b63);}(_0xb69d,0x105));var _0xdb69=function(_0x258c02,_0x5a1001){_0x258c02=_0x258c02-0x0;var _0x143602=_0xb69d[_0x258c02];return _0x143602;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb69('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb69('0x1'));var rp=require(_0xdb69('0x2'));var moment=require(_0xdb69('0x3'));var BPromise=require(_0xdb69('0x4'));var Mustache=require('mustache');var util=require(_0xdb69('0x5'));var path=require('path');var sox=require(_0xdb69('0x6'));var csv=require('to-csv');var ejs=require(_0xdb69('0x7'));var fs=require('fs');var fs_extra=require(_0xdb69('0x8'));var _=require('lodash');var squel=require(_0xdb69('0x9'));var crypto=require(_0xdb69('0xa'));var jsforce=require(_0xdb69('0xb'));var deskjs=require(_0xdb69('0xc'));var toCsv=require(_0xdb69('0xd'));var querystring=require('querystring');var Papa=require(_0xdb69('0xe'));var Redis=require(_0xdb69('0xf'));var authService=require(_0xdb69('0x10'));var qs=require(_0xdb69('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb69('0x12'));var logger=require(_0xdb69('0x13'))(_0xdb69('0x14'));var utils=require('../../config/utils');var config=require(_0xdb69('0x15'));var licenseUtil=require(_0xdb69('0x16'));var db=require(_0xdb69('0x17'))['db'];function respondWithStatusCode(_0x38e141,_0x51bc6f){_0x51bc6f=_0x51bc6f||0xcc;return function(_0x426718){if(_0x426718){return _0x38e141[_0xdb69('0x18')](_0x51bc6f);}return _0x38e141[_0xdb69('0x19')](_0x51bc6f)['end']();};}function respondWithResult(_0x3e1957,_0x4fd60b){_0x4fd60b=_0x4fd60b||0xc8;return function(_0x5dab65){if(_0x5dab65){return _0x3e1957['status'](_0x4fd60b)[_0xdb69('0x1a')](_0x5dab65);}};}function respondWithFilteredResult(_0x1c321d,_0x3e571f){return function(_0x229193){if(_0x229193){var _0x474a62=typeof _0x3e571f[_0xdb69('0x1b')]==='undefined'&&typeof _0x3e571f[_0xdb69('0x1c')]===_0xdb69('0x1d');var _0xba76f8=_0x229193['count'];var _0x20fd1e=_0x474a62?0x0:_0x3e571f[_0xdb69('0x1b')];var _0x4300e7=_0x474a62?_0x229193[_0xdb69('0x1e')]:_0x3e571f[_0xdb69('0x1b')]+_0x3e571f['limit'];var _0xedc210;if(_0x4300e7>=_0xba76f8){_0x4300e7=_0xba76f8;_0xedc210=0xc8;}else{_0xedc210=0xce;}_0x1c321d['status'](_0xedc210);return _0x1c321d[_0xdb69('0x1f')](_0xdb69('0x20'),_0x20fd1e+'-'+_0x4300e7+'/'+_0xba76f8)['json'](_0x229193);}return null;};}function patchUpdates(_0x472342){return function(_0x2f4539){try{jsonpatch[_0xdb69('0x21')](_0x2f4539,_0x472342,!![]);}catch(_0x142ab0){return BPromise[_0xdb69('0x22')](_0x142ab0);}return _0x2f4539[_0xdb69('0x23')]();};}function saveUpdates(_0x53e2af,_0x58b676){return function(_0x25a51a){if(_0x25a51a){return _0x25a51a[_0xdb69('0x24')](_0x53e2af)[_0xdb69('0x25')](function(_0x4a9c3e){return _0x4a9c3e;});}return null;};}function removeEntity(_0x4107c5,_0x28ccb7){return function(_0x1e4a8b){if(_0x1e4a8b){return _0x1e4a8b[_0xdb69('0x26')]()[_0xdb69('0x25')](function(){_0x4107c5[_0xdb69('0x19')](0xcc)[_0xdb69('0x27')]();});}};}function handleEntityNotFound(_0x43f21c,_0x4df829){return function(_0x3a8ae9){if(!_0x3a8ae9){_0x43f21c[_0xdb69('0x18')](0x194);}return _0x3a8ae9;};}function handleError(_0x38d0cd,_0x3ebeee){_0x3ebeee=_0x3ebeee||0x1f4;return function(_0x173891){logger[_0xdb69('0x28')](_0x173891[_0xdb69('0x29')]);if(_0x173891[_0xdb69('0x2a')]){delete _0x173891[_0xdb69('0x2a')];}_0x38d0cd[_0xdb69('0x19')](_0x3ebeee)['send'](_0x173891);};}exports['index']=function(_0x1ce84f,_0x52eb35){var _0x540696={},_0x46a6f5={},_0x30ed99={'count':0x0,'rows':[]};var _0x1fab59=_[_0xdb69('0x2b')](db[_0xdb69('0x2c')]['rawAttributes'],function(_0x4e402f){return{'name':_0x4e402f['fieldName'],'type':_0x4e402f[_0xdb69('0x2d')][_0xdb69('0x2e')]};});_0x46a6f5[_0xdb69('0x2f')]=_[_0xdb69('0x2b')](_0x1fab59,_0xdb69('0x2a'));_0x46a6f5['query']=_[_0xdb69('0x30')](_0x1ce84f['query']);_0x46a6f5[_0xdb69('0x31')]=_[_0xdb69('0x32')](_0x46a6f5[_0xdb69('0x2f')],_0x46a6f5[_0xdb69('0x33')]);_0x540696[_0xdb69('0x34')]=_[_0xdb69('0x32')](_0x46a6f5[_0xdb69('0x2f')],qs['fields'](_0x1ce84f['query'][_0xdb69('0x35')]));_0x540696[_0xdb69('0x34')]=_0x540696[_0xdb69('0x34')][_0xdb69('0x36')]?_0x540696['attributes']:_0x46a6f5['model'];if(!_0x1ce84f[_0xdb69('0x33')]['hasOwnProperty'](_0xdb69('0x37'))){_0x540696['limit']=qs['limit'](_0x1ce84f['query'][_0xdb69('0x1c')]);_0x540696[_0xdb69('0x1b')]=qs['offset'](_0x1ce84f[_0xdb69('0x33')]['offset']);}_0x540696[_0xdb69('0x38')]=qs[_0xdb69('0x39')](_0x1ce84f[_0xdb69('0x33')][_0xdb69('0x39')]);_0x540696['where']=qs[_0xdb69('0x31')](_[_0xdb69('0x3a')](_0x1ce84f['query'],_0x46a6f5['filters']),_0x1fab59);if(_0x1ce84f['query']['filter']){_0x540696[_0xdb69('0x3b')]=_[_0xdb69('0x3c')](_0x540696[_0xdb69('0x3b')],{'$or':_[_0xdb69('0x2b')](_0x1fab59,function(_0x3d1a89){if(_0x3d1a89[_0xdb69('0x2d')]!==_0xdb69('0x3d')){var _0x5a589d={};_0x5a589d[_0x3d1a89['name']]={'$like':'%'+_0x1ce84f[_0xdb69('0x33')][_0xdb69('0x3e')]+'%'};return _0x5a589d;}})});}_0x540696=_[_0xdb69('0x3c')]({},_0x540696,_0x1ce84f[_0xdb69('0x3f')]);var _0x3c0569={'where':_0x540696['where']};return db['FreshsalesField'][_0xdb69('0x1e')](_0x3c0569)[_0xdb69('0x25')](function(_0x223155){_0x30ed99[_0xdb69('0x1e')]=_0x223155;if(_0x1ce84f[_0xdb69('0x33')][_0xdb69('0x40')]){_0x540696['include']=[{'all':!![]}];}return db[_0xdb69('0x2c')][_0xdb69('0x41')](_0x540696);})['then'](function(_0x4af056){_0x30ed99[_0xdb69('0x42')]=_0x4af056;return _0x30ed99;})[_0xdb69('0x25')](respondWithFilteredResult(_0x52eb35,_0x540696))['catch'](handleError(_0x52eb35,null));};exports[_0xdb69('0x43')]=function(_0xd1635e,_0x329e3c){var _0xfb24f5={'raw':!![],'where':{'id':_0xd1635e['params']['id']}},_0x38804c={};_0x38804c[_0xdb69('0x2f')]=_[_0xdb69('0x30')](db['FreshsalesField'][_0xdb69('0x44')]);_0x38804c[_0xdb69('0x33')]=_['keys'](_0xd1635e[_0xdb69('0x33')]);_0x38804c[_0xdb69('0x31')]=_['intersection'](_0x38804c['model'],_0x38804c['query']);_0xfb24f5[_0xdb69('0x34')]=_['intersection'](_0x38804c[_0xdb69('0x2f')],qs[_0xdb69('0x35')](_0xd1635e['query'][_0xdb69('0x35')]));_0xfb24f5[_0xdb69('0x34')]=_0xfb24f5[_0xdb69('0x34')][_0xdb69('0x36')]?_0xfb24f5['attributes']:_0x38804c[_0xdb69('0x2f')];if(_0xd1635e['query'][_0xdb69('0x40')]){_0xfb24f5[_0xdb69('0x45')]=[{'all':!![]}];}_0xfb24f5=_['merge']({},_0xfb24f5,_0xd1635e[_0xdb69('0x3f')]);return db['FreshsalesField']['find'](_0xfb24f5)[_0xdb69('0x25')](handleEntityNotFound(_0x329e3c,null))[_0xdb69('0x25')](respondWithResult(_0x329e3c,null))[_0xdb69('0x46')](handleError(_0x329e3c,null));};exports[_0xdb69('0x47')]=function(_0x2e1650,_0xd3668a){return db[_0xdb69('0x2c')][_0xdb69('0x47')](_0x2e1650['body'],{})[_0xdb69('0x25')](respondWithResult(_0xd3668a,0xc9))['catch'](handleError(_0xd3668a,null));};exports[_0xdb69('0x24')]=function(_0x2f19a3,_0xcf00b9){if(_0x2f19a3[_0xdb69('0x48')]['id']){delete _0x2f19a3[_0xdb69('0x48')]['id'];}return db[_0xdb69('0x2c')][_0xdb69('0x49')]({'where':{'id':_0x2f19a3[_0xdb69('0x4a')]['id']}})[_0xdb69('0x25')](handleEntityNotFound(_0xcf00b9,null))['then'](saveUpdates(_0x2f19a3[_0xdb69('0x48')],null))[_0xdb69('0x25')](respondWithResult(_0xcf00b9,null))['catch'](handleError(_0xcf00b9,null));};exports['destroy']=function(_0x4f0fd3,_0x1a9490){return db[_0xdb69('0x2c')][_0xdb69('0x49')]({'where':{'id':_0x4f0fd3[_0xdb69('0x4a')]['id']}})[_0xdb69('0x25')](handleEntityNotFound(_0x1a9490,null))[_0xdb69('0x25')](removeEntity(_0x1a9490,null))[_0xdb69('0x46')](handleError(_0x1a9490,null));};
\ No newline at end of file
index 3effc90..bd640cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6739=['bluebird','rimraf','./intFreshsalesField.attributes','define','FreshsalesField','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x17541e,_0x46df72){var _0x1c17eb=function(_0x5f1d1e){while(--_0x5f1d1e){_0x17541e['push'](_0x17541e['shift']());}};_0x1c17eb(++_0x46df72);}(_0x6739,0xd3));var _0x9673=function(_0x1cb1c3,_0x1ef1ff){_0x1cb1c3=_0x1cb1c3-0x0;var _0x57330c=_0x6739[_0x1cb1c3];return _0x57330c;};'use strict';var _=require(_0x9673('0x0'));var util=require(_0x9673('0x1'));var logger=require(_0x9673('0x2'))(_0x9673('0x3'));var moment=require(_0x9673('0x4'));var BPromise=require(_0x9673('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9673('0x6'));var config=require('../../config/environment');var attributes=require(_0x9673('0x7'));module['exports']=function(_0x57a9d5,_0x27f94b){return _0x57a9d5[_0x9673('0x8')](_0x9673('0x9'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x9673('0xa'),_0x9673('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd1f8=['path','../../config/environment','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','api','bluebird'];(function(_0x118bc3,_0x5ea08a){var _0x35d7f3=function(_0xfab654){while(--_0xfab654){_0x118bc3['push'](_0x118bc3['shift']());}};_0x35d7f3(++_0x5ea08a);}(_0xd1f8,0x18e));var _0x8d1f=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0xd1f8[_0x26a906];return _0x495575;};'use strict';var _=require(_0x8d1f('0x0'));var util=require(_0x8d1f('0x1'));var logger=require(_0x8d1f('0x2'))(_0x8d1f('0x3'));var moment=require('moment');var BPromise=require(_0x8d1f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d1f('0x5'));var rimraf=require('rimraf');var config=require(_0x8d1f('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0x8d1f('0x7')]=function(_0x26d2de,_0x5a17b0){return _0x26d2de[_0x8d1f('0x8')](_0x8d1f('0x9'),attributes,{'tableName':_0x8d1f('0xa'),'paranoid':![],'indexes':[{'name':_0x8d1f('0xb'),'fields':[_0x8d1f('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c6f07b5..95a13d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0xf494,0x1c6));var _0x4f49=function(_0x1bdd82,_0x402f16){_0x1bdd82=_0x1bdd82-0x0;var _0x41a201=_0xf494[_0x1bdd82];return _0x41a201;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
+var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x3bc27a,_0x22f578){_0x3bc27a=_0x3bc27a-0x0;var _0x1ce99f=_0x3f8a[_0x3bc27a];return _0x1ce99f;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('FreshsalesField,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});}
\ No newline at end of file
index b51dd11..8079bbe 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(_0x4b1dac,_0x2e0da2){var _0x18092a=function(_0x1a7dbb){while(--_0x1a7dbb){_0x4b1dac['push'](_0x4b1dac['shift']());}};_0x18092a(++_0x2e0da2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x2ab7ab,_0x55437b){var _0x451638=function(_0x3e46f5){while(--_0x3e46f5){_0x2ab7ab['push'](_0x2ab7ab['shift']());}};_0x451638(++_0x55437b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 05b71d6..2e16ed8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x659c=['newTab','sequelize','STRING','ENUM','integrationTab'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0x659c,0x1aa));var _0xc659=function(_0x4ce960,_0x4258e9){_0x4ce960=_0x4ce960-0x0;var _0x43a9d1=_0x659c[_0x4ce960];return _0x43a9d1;};'use strict';var Sequelize=require(_0xc659('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc659('0x1')]},'username':{'type':Sequelize[_0xc659('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xc659('0x1')]},'password':{'type':Sequelize[_0xc659('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xc659('0x1')]},'serverUrl':{'type':Sequelize[_0xc659('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc659('0x2')](_0xc659('0x3'),_0xc659('0x4')),'defaultValue':_0xc659('0x3')}};
\ No newline at end of file
+var _0xc82c=['exports','STRING','username','ENUM','integrationTab','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc82c,0x125));var _0xcc82=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xc82c[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0xcc82('0x0'));module[_0xcc82('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcc82('0x2')]},'username':{'type':Sequelize[_0xcc82('0x2')],'unique':_0xcc82('0x3')},'remoteUri':{'type':Sequelize[_0xcc82('0x2')]},'password':{'type':Sequelize[_0xcc82('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xcc82('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcc82('0x4')]('integrationTab','newTab'),'defaultValue':_0xcc82('0x5')}};
\ No newline at end of file
index a566d4c..a90fb87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaccd=['catch','show','params','keys','rawAttributes','find','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','SalesforceField','Subjects','remoteUri','clientId','clientSecret','password','securityToken','slice','lastIndexOf','Connection','login','username','concat','isNil','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','string','int','email','textarea','phone','includes','picklistValues','label','value','boolean','true','False','test','statusCode','error','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','end','name','send','index','map','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','SalesforceAccount','includeAll','include','rows'];(function(_0xb4b80e,_0x1f02e8){var _0x5e4846=function(_0x12db2){while(--_0x12db2){_0xb4b80e['push'](_0xb4b80e['shift']());}};_0x5e4846(++_0x1f02e8);}(_0xaccd,0x122));var _0xdacc=function(_0x21f011,_0x5d5abe){_0x21f011=_0x21f011-0x0;var _0x23726e=_0xaccd[_0x21f011];return _0x23726e;};'use strict';var emlformat=require(_0xdacc('0x0'));var rimraf=require(_0xdacc('0x1'));var zipdir=require(_0xdacc('0x2'));var jsonpatch=require(_0xdacc('0x3'));var rp=require(_0xdacc('0x4'));var moment=require(_0xdacc('0x5'));var BPromise=require(_0xdacc('0x6'));var Mustache=require('mustache');var util=require(_0xdacc('0x7'));var path=require(_0xdacc('0x8'));var sox=require(_0xdacc('0x9'));var csv=require('to-csv');var ejs=require(_0xdacc('0xa'));var fs=require('fs');var fs_extra=require(_0xdacc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdacc('0xc'));var jsforce=require(_0xdacc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdacc('0xe'));var querystring=require(_0xdacc('0xf'));var Papa=require('papaparse');var Redis=require(_0xdacc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdacc('0x11'));var as=require(_0xdacc('0x12'));var hardwareService=require(_0xdacc('0x13'));var logger=require(_0xdacc('0x14'))(_0xdacc('0x15'));var utils=require(_0xdacc('0x16'));var config=require(_0xdacc('0x17'));var licenseUtil=require(_0xdacc('0x18'));var db=require(_0xdacc('0x19'))['db'];var integrations=require(_0xdacc('0x1a'));function respondWithStatusCode(_0x435488,_0x50c05f){_0x50c05f=_0x50c05f||0xcc;return function(_0x2ca466){if(_0x2ca466){return _0x435488[_0xdacc('0x1b')](_0x50c05f);}return _0x435488[_0xdacc('0x1c')](_0x50c05f)['end']();};}function respondWithResult(_0x5a659e,_0x5c3cdd){_0x5c3cdd=_0x5c3cdd||0xc8;return function(_0x428a98){if(_0x428a98){return _0x5a659e[_0xdacc('0x1c')](_0x5c3cdd)[_0xdacc('0x1d')](_0x428a98);}};}function respondWithFilteredResult(_0x5c8926,_0x5a86a4){return function(_0xfdc6a4){if(_0xfdc6a4){var _0x1cb288=typeof _0x5a86a4['offset']===_0xdacc('0x1e')&&typeof _0x5a86a4[_0xdacc('0x1f')]===_0xdacc('0x1e');var _0x27d169=_0xfdc6a4[_0xdacc('0x20')];var _0x45a495=_0x1cb288?0x0:_0x5a86a4[_0xdacc('0x21')];var _0x5ea6ae=_0x1cb288?_0xfdc6a4[_0xdacc('0x20')]:_0x5a86a4[_0xdacc('0x21')]+_0x5a86a4['limit'];var _0x3bd6a6;if(_0x5ea6ae>=_0x27d169){_0x5ea6ae=_0x27d169;_0x3bd6a6=0xc8;}else{_0x3bd6a6=0xce;}_0x5c8926[_0xdacc('0x1c')](_0x3bd6a6);return _0x5c8926[_0xdacc('0x22')](_0xdacc('0x23'),_0x45a495+'-'+_0x5ea6ae+'/'+_0x27d169)[_0xdacc('0x1d')](_0xfdc6a4);}return null;};}function patchUpdates(_0xff9b07){return function(_0x317d9a){try{jsonpatch['apply'](_0x317d9a,_0xff9b07,!![]);}catch(_0x3b77b3){return BPromise['reject'](_0x3b77b3);}return _0x317d9a['save']();};}function saveUpdates(_0x3b1feb,_0x2f9405){return function(_0x50d853){if(_0x50d853){return _0x50d853[_0xdacc('0x24')](_0x3b1feb)[_0xdacc('0x25')](function(_0xb04b0c){return _0xb04b0c;});}return null;};}function removeEntity(_0x3a5763,_0x166ed3){return function(_0x1e42a1){if(_0x1e42a1){return _0x1e42a1[_0xdacc('0x26')]()['then'](function(){_0x3a5763[_0xdacc('0x1c')](0xcc)[_0xdacc('0x27')]();});}};}function handleEntityNotFound(_0x248226,_0x2bc9a4){return function(_0x44b22a){if(!_0x44b22a){_0x248226[_0xdacc('0x1b')](0x194);}return _0x44b22a;};}function handleError(_0x36fc1b,_0x21dc8d){_0x21dc8d=_0x21dc8d||0x1f4;return function(_0x584250){logger['error'](_0x584250['stack']);if(_0x584250['name']){delete _0x584250[_0xdacc('0x28')];}_0x36fc1b['status'](_0x21dc8d)[_0xdacc('0x29')](_0x584250);};}exports[_0xdacc('0x2a')]=function(_0x506b20,_0x1c8687){var _0x52758a={},_0x197656={},_0x369165={'count':0x0,'rows':[]};var _0x4ce9e6=_[_0xdacc('0x2b')](db['SalesforceAccount']['rawAttributes'],function(_0x394ceb){return{'name':_0x394ceb[_0xdacc('0x2c')],'type':_0x394ceb['type'][_0xdacc('0x2d')]};});_0x197656[_0xdacc('0x2e')]=_[_0xdacc('0x2b')](_0x4ce9e6,_0xdacc('0x28'));_0x197656['query']=_['keys'](_0x506b20[_0xdacc('0x2f')]);_0x197656['filters']=_[_0xdacc('0x30')](_0x197656[_0xdacc('0x2e')],_0x197656[_0xdacc('0x2f')]);_0x52758a['attributes']=_[_0xdacc('0x30')](_0x197656[_0xdacc('0x2e')],qs[_0xdacc('0x31')](_0x506b20[_0xdacc('0x2f')]['fields']));_0x52758a[_0xdacc('0x32')]=_0x52758a['attributes'][_0xdacc('0x33')]?_0x52758a['attributes']:_0x197656[_0xdacc('0x2e')];if(!_0x506b20[_0xdacc('0x2f')][_0xdacc('0x34')](_0xdacc('0x35'))){_0x52758a[_0xdacc('0x1f')]=qs['limit'](_0x506b20[_0xdacc('0x2f')]['limit']);_0x52758a[_0xdacc('0x21')]=qs[_0xdacc('0x21')](_0x506b20[_0xdacc('0x2f')][_0xdacc('0x21')]);}_0x52758a['order']=qs[_0xdacc('0x36')](_0x506b20['query'][_0xdacc('0x36')]);_0x52758a[_0xdacc('0x37')]=qs[_0xdacc('0x38')](_[_0xdacc('0x39')](_0x506b20[_0xdacc('0x2f')],_0x197656['filters']),_0x4ce9e6);if(_0x506b20[_0xdacc('0x2f')][_0xdacc('0x3a')]){_0x52758a[_0xdacc('0x37')]=_['merge'](_0x52758a[_0xdacc('0x37')],{'$or':_[_0xdacc('0x2b')](_0x4ce9e6,function(_0x54eca3){if(_0x54eca3[_0xdacc('0x3b')]!==_0xdacc('0x3c')){var _0x24994a={};_0x24994a[_0x54eca3['name']]={'$like':'%'+_0x506b20[_0xdacc('0x2f')][_0xdacc('0x3a')]+'%'};return _0x24994a;}})});}_0x52758a=_[_0xdacc('0x3d')]({},_0x52758a,_0x506b20[_0xdacc('0x3e')]);var _0x2fea33={'where':_0x52758a[_0xdacc('0x37')]};return db[_0xdacc('0x3f')]['count'](_0x2fea33)['then'](function(_0x3df9d1){_0x369165[_0xdacc('0x20')]=_0x3df9d1;if(_0x506b20[_0xdacc('0x2f')][_0xdacc('0x40')]){_0x52758a[_0xdacc('0x41')]=[{'all':!![]}];}return db[_0xdacc('0x3f')]['findAll'](_0x52758a);})[_0xdacc('0x25')](function(_0x1255c9){_0x369165[_0xdacc('0x42')]=_0x1255c9;return _0x369165;})['then'](respondWithFilteredResult(_0x1c8687,_0x52758a))[_0xdacc('0x43')](handleError(_0x1c8687,null));};exports[_0xdacc('0x44')]=function(_0x28a70c,_0x1195a8){var _0x593d28={'raw':![],'where':{'id':_0x28a70c[_0xdacc('0x45')]['id']}},_0x1a3dd7={};_0x1a3dd7[_0xdacc('0x2e')]=_[_0xdacc('0x46')](db[_0xdacc('0x3f')][_0xdacc('0x47')]);_0x1a3dd7[_0xdacc('0x2f')]=_[_0xdacc('0x46')](_0x28a70c[_0xdacc('0x2f')]);_0x1a3dd7[_0xdacc('0x38')]=_[_0xdacc('0x30')](_0x1a3dd7['model'],_0x1a3dd7[_0xdacc('0x2f')]);_0x593d28[_0xdacc('0x32')]=_['intersection'](_0x1a3dd7['model'],qs[_0xdacc('0x31')](_0x28a70c[_0xdacc('0x2f')][_0xdacc('0x31')]));_0x593d28[_0xdacc('0x32')]=_0x593d28['attributes']['length']?_0x593d28['attributes']:_0x1a3dd7[_0xdacc('0x2e')];if(_0x28a70c[_0xdacc('0x2f')][_0xdacc('0x40')]){_0x593d28[_0xdacc('0x41')]=[{'all':!![]}];}_0x593d28=_[_0xdacc('0x3d')]({},_0x593d28,_0x28a70c[_0xdacc('0x3e')]);return db[_0xdacc('0x3f')][_0xdacc('0x48')](_0x593d28)[_0xdacc('0x25')](handleEntityNotFound(_0x1195a8,null))[_0xdacc('0x25')](respondWithResult(_0x1195a8,null))[_0xdacc('0x43')](handleError(_0x1195a8,null));};exports['create']=function(_0x3543d5,_0x3d4f42){return db[_0xdacc('0x3f')]['create'](_0x3543d5[_0xdacc('0x49')],{})[_0xdacc('0x25')](respondWithResult(_0x3d4f42,0xc9))[_0xdacc('0x43')](handleError(_0x3d4f42,null));};exports[_0xdacc('0x24')]=function(_0x4633ef,_0x10b1f5){if(_0x4633ef['body']['id']){delete _0x4633ef[_0xdacc('0x49')]['id'];}return db[_0xdacc('0x3f')][_0xdacc('0x48')]({'where':{'id':_0x4633ef[_0xdacc('0x45')]['id']}})[_0xdacc('0x25')](handleEntityNotFound(_0x10b1f5,null))[_0xdacc('0x25')](saveUpdates(_0x4633ef[_0xdacc('0x49')],null))[_0xdacc('0x25')](respondWithResult(_0x10b1f5,null))['catch'](handleError(_0x10b1f5,null));};exports[_0xdacc('0x26')]=function(_0x4c0000,_0x3746ce){return db[_0xdacc('0x3f')][_0xdacc('0x48')]({'where':{'id':_0x4c0000[_0xdacc('0x45')]['id']}})['then'](handleEntityNotFound(_0x3746ce,null))[_0xdacc('0x25')](removeEntity(_0x3746ce,null))['catch'](handleError(_0x3746ce,null));};exports[_0xdacc('0x4a')]=function(_0x359db3,_0x5d7ca0,_0x3749a6){var _0x56fc17={};var _0x4305a9={};var _0xfbce97;var _0x333f24;return db['SalesforceAccount'][_0xdacc('0x4b')]({'where':{'id':_0x359db3[_0xdacc('0x45')]['id']}})[_0xdacc('0x25')](handleEntityNotFound(_0x5d7ca0,null))[_0xdacc('0x25')](function(_0x5c0818){if(_0x5c0818){_0xfbce97=_0x5c0818;_0x4305a9[_0xdacc('0x2e')]=_[_0xdacc('0x46')](db[_0xdacc('0x4c')]['rawAttributes']);_0x4305a9[_0xdacc('0x2f')]=_[_0xdacc('0x46')](_0x359db3[_0xdacc('0x2f')]);_0x4305a9[_0xdacc('0x38')]=_['intersection'](_0x4305a9[_0xdacc('0x2e')],_0x4305a9[_0xdacc('0x2f')]);_0x56fc17[_0xdacc('0x32')]=_['intersection'](_0x4305a9[_0xdacc('0x2e')],qs['fields'](_0x359db3[_0xdacc('0x2f')]['fields']));_0x56fc17[_0xdacc('0x32')]=_0x56fc17[_0xdacc('0x32')][_0xdacc('0x33')]?_0x56fc17['attributes']:_0x4305a9[_0xdacc('0x2e')];_0x56fc17['order']=qs['sort'](_0x359db3[_0xdacc('0x2f')][_0xdacc('0x36')]);_0x56fc17['where']=qs[_0xdacc('0x38')](_['pick'](_0x359db3[_0xdacc('0x2f')],_0x4305a9['filters']));if(_0x359db3['query'][_0xdacc('0x3a')]){_0x56fc17[_0xdacc('0x37')]=_[_0xdacc('0x3d')](_0x56fc17[_0xdacc('0x37')],{'$or':_[_0xdacc('0x2b')](_0x56fc17[_0xdacc('0x32')],function(_0x2ec390){var _0x5db084={};_0x5db084[_0x2ec390]={'$like':'%'+_0x359db3['query']['filter']+'%'};return _0x5db084;})});}_0x56fc17=_[_0xdacc('0x3d')]({},_0x56fc17,_0x359db3['options']);return _0xfbce97[_0xdacc('0x4a')](_0x56fc17);}})[_0xdacc('0x25')](function(_0x5570f3){if(_0x5570f3){_0x333f24=_0x5570f3[_0xdacc('0x33')];if(!_0x359db3[_0xdacc('0x2f')][_0xdacc('0x34')](_0xdacc('0x35'))){_0x56fc17[_0xdacc('0x1f')]=qs[_0xdacc('0x1f')](_0x359db3[_0xdacc('0x2f')][_0xdacc('0x1f')]);_0x56fc17[_0xdacc('0x21')]=qs[_0xdacc('0x21')](_0x359db3[_0xdacc('0x2f')]['offset']);}return _0xfbce97[_0xdacc('0x4a')](_0x56fc17);}})[_0xdacc('0x25')](function(_0x1d7806){if(_0x1d7806){return _0x1d7806?{'count':_0x333f24,'rows':_0x1d7806}:null;}})[_0xdacc('0x25')](respondWithResult(_0x5d7ca0,null))[_0xdacc('0x43')](handleError(_0x5d7ca0,null));};exports[_0xdacc('0x4d')]=function(_0xa55764,_0x180fee,_0x52f434){if(_0xa55764[_0xdacc('0x49')]['id']){delete _0xa55764['body']['id'];}return db[_0xdacc('0x3f')][_0xdacc('0x4b')]({'where':{'id':_0xa55764[_0xdacc('0x45')]['id']}})[_0xdacc('0x25')](handleEntityNotFound(_0x180fee,null))[_0xdacc('0x25')](function(_0x4de7cc){if(_0x4de7cc){_0xa55764[_0xdacc('0x49')][_0xdacc('0x4e')]=_0x4de7cc['id'];_0xa55764[_0xdacc('0x49')]['Subjects']=integrations[_0xdacc('0x4f')](_0xa55764['body'][_0xdacc('0x50')],_0xa55764['body']['type']);_0xa55764[_0xdacc('0x49')][_0xdacc('0x51')]=integrations['getDescriptions'](_0xa55764[_0xdacc('0x49')][_0xdacc('0x50')],_0xa55764[_0xdacc('0x49')]['type']);return db[_0xdacc('0x4c')]['create'](_0xa55764['body'],{'include':[{'model':db[_0xdacc('0x52')],'as':_0xdacc('0x53')},{'model':db[_0xdacc('0x52')],'as':_0xdacc('0x51')}]});}return null;})[_0xdacc('0x25')](respondWithResult(_0x180fee,null))['catch'](handleError(_0x180fee,null));};exports['getFields']=function(_0xcf26d5,_0x3e0dfc,_0x212461){var _0x376735;var _0x3aea02='';var _0x18ed95='Task';return db[_0xdacc('0x3f')][_0xdacc('0x4b')]({'where':{'id':_0xcf26d5[_0xdacc('0x45')]['id']},'attributes':['id',_0xdacc('0x54'),_0xdacc('0x55'),_0xdacc('0x56'),'username',_0xdacc('0x57'),_0xdacc('0x58')]})[_0xdacc('0x25')](handleEntityNotFound(_0x3e0dfc,null))[_0xdacc('0x25')](function(_0x2939f6){if(_0x2939f6){_0x3aea02=_0x2939f6[_0xdacc('0x54')];var _0x570227=_0x3aea02[_0xdacc('0x59')](-0x1);if(_0x570227==='/'){_0x3aea02=_0x3aea02['substring'](0x0,_0x3aea02[_0xdacc('0x5a')](_0x570227));}_0x376735=new jsforce[(_0xdacc('0x5b'))]({'oauth2':{'loginUrl':_0x3aea02,'clientId':_0x2939f6[_0xdacc('0x55')],'clientSecret':_0x2939f6[_0xdacc('0x56')]}});return _0x376735[_0xdacc('0x5c')](_0x2939f6[_0xdacc('0x5d')],_0x2939f6[_0xdacc('0x57')][_0xdacc('0x5e')](_0x2939f6[_0xdacc('0x58')]));}})[_0xdacc('0x25')](function(_0xb0c132){if(_0xb0c132){if(!_[_0xdacc('0x5f')](_0xcf26d5[_0xdacc('0x2f')][_0xdacc('0x60')])){_0x18ed95=_0xcf26d5[_0xdacc('0x2f')]['ticketType'];}return _0x376735[_0xdacc('0x61')](_0x18ed95)[_0xdacc('0x62')]();}})[_0xdacc('0x25')](function(_0x3e1cd6){var _0x376f6f=[_0xdacc('0x63'),'ActivityDate',_0xdacc('0x64'),_0xdacc('0x65'),_0xdacc('0x66'),'Description'];var _0x179c02=[_0xdacc('0x67'),_0xdacc('0x68'),'picklist','boolean',_0xdacc('0x69'),_0xdacc('0x6a'),_0xdacc('0x6b')];if(_0x3e1cd6){_['remove'](_0x3e1cd6['fields'],function(_0x4eff17){return _0x376f6f[_0xdacc('0x6c')](_0x4eff17[_0xdacc('0x28')])||!_0x179c02['includes'](_0x4eff17['type']);});return{'count':_0x3e1cd6[_0xdacc('0x31')][_0xdacc('0x33')],'rows':_[_0xdacc('0x2b')](_0x3e1cd6[_0xdacc('0x31')],function(_0x303ac8){return{'id':_0x303ac8[_0xdacc('0x28')],'name':_0x303ac8['label'],'custom':_0x303ac8['custom'],'options':_0x303ac8[_0xdacc('0x6d')][_0xdacc('0x33')]>0x0?_[_0xdacc('0x2b')](_0x303ac8[_0xdacc('0x6d')],function(_0x1c8921){return{'name':_0x1c8921[_0xdacc('0x6e')],'value':_0x1c8921[_0xdacc('0x6f')]};}):_0x303ac8[_0xdacc('0x3b')]==_0xdacc('0x70')?[{'name':'True','value':_0xdacc('0x71')},{'name':_0xdacc('0x72'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x3e0dfc,null))['catch'](function(_0x3c92de){var _0x539944=_0xcf26d5[_0xdacc('0x2f')][_0xdacc('0x73')]?0x1f4:_0x3c92de[_0xdacc('0x74')]||0x1f4;logger[_0xdacc('0x75')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x539944,JSON['stringify'](_0x3c92de));delete _0x3c92de[_0xdacc('0x28')];if(_0x539944===0x191){_0x539944=0x190;}_0x3e0dfc[_0xdacc('0x1c')](_0x539944)[_0xdacc('0x29')](_0xcf26d5[_0xdacc('0x2f')]['test']?{'message':_0xdacc('0x76'),'statusCode':_0x3c92de[_0xdacc('0x74')]}:_0x3c92de);});};
\ No newline at end of file
+var _0x8b91=['params','length','find','catch','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','password','slice','lastIndexOf','Connection','login','username','isNil','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Description','string','picklist','boolean','email','phone','remove','includes','label','picklistValues','value','True','true','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SalesforceAccount','includeAll','include','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b91,0x1ae));var _0x18b9=function(_0x5ae10c,_0x4fa4ef){_0x5ae10c=_0x5ae10c-0x0;var _0x50fd12=_0x8b91[_0x5ae10c];return _0x50fd12;};'use strict';var emlformat=require(_0x18b9('0x0'));var rimraf=require(_0x18b9('0x1'));var zipdir=require(_0x18b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x18b9('0x3'));var moment=require('moment');var BPromise=require(_0x18b9('0x4'));var Mustache=require(_0x18b9('0x5'));var util=require(_0x18b9('0x6'));var path=require(_0x18b9('0x7'));var sox=require(_0x18b9('0x8'));var csv=require('to-csv');var ejs=require(_0x18b9('0x9'));var fs=require('fs');var fs_extra=require(_0x18b9('0xa'));var _=require(_0x18b9('0xb'));var squel=require(_0x18b9('0xc'));var crypto=require(_0x18b9('0xd'));var jsforce=require(_0x18b9('0xe'));var deskjs=require(_0x18b9('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x18b9('0x10'));var Redis=require(_0x18b9('0x11'));var authService=require(_0x18b9('0x12'));var qs=require(_0x18b9('0x13'));var as=require(_0x18b9('0x14'));var hardwareService=require(_0x18b9('0x15'));var logger=require(_0x18b9('0x16'))(_0x18b9('0x17'));var utils=require(_0x18b9('0x18'));var config=require(_0x18b9('0x19'));var licenseUtil=require(_0x18b9('0x1a'));var db=require(_0x18b9('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x211137,_0x7284e1){_0x7284e1=_0x7284e1||0xcc;return function(_0xe57e0d){if(_0xe57e0d){return _0x211137['sendStatus'](_0x7284e1);}return _0x211137[_0x18b9('0x1c')](_0x7284e1)[_0x18b9('0x1d')]();};}function respondWithResult(_0xa668a6,_0x5ccb87){_0x5ccb87=_0x5ccb87||0xc8;return function(_0xfd4479){if(_0xfd4479){return _0xa668a6['status'](_0x5ccb87)['json'](_0xfd4479);}};}function respondWithFilteredResult(_0x2bf78b,_0x23f667){return function(_0x12a214){if(_0x12a214){var _0x1a85ce=typeof _0x23f667['offset']===_0x18b9('0x1e')&&typeof _0x23f667[_0x18b9('0x1f')]===_0x18b9('0x1e');var _0x5fb65d=_0x12a214[_0x18b9('0x20')];var _0x749bc=_0x1a85ce?0x0:_0x23f667[_0x18b9('0x21')];var _0x18b741=_0x1a85ce?_0x12a214[_0x18b9('0x20')]:_0x23f667[_0x18b9('0x21')]+_0x23f667[_0x18b9('0x1f')];var _0x208620;if(_0x18b741>=_0x5fb65d){_0x18b741=_0x5fb65d;_0x208620=0xc8;}else{_0x208620=0xce;}_0x2bf78b[_0x18b9('0x1c')](_0x208620);return _0x2bf78b[_0x18b9('0x22')]('Content-Range',_0x749bc+'-'+_0x18b741+'/'+_0x5fb65d)[_0x18b9('0x23')](_0x12a214);}return null;};}function patchUpdates(_0x19c4aa){return function(_0x860f50){try{jsonpatch[_0x18b9('0x24')](_0x860f50,_0x19c4aa,!![]);}catch(_0x403c8){return BPromise[_0x18b9('0x25')](_0x403c8);}return _0x860f50[_0x18b9('0x26')]();};}function saveUpdates(_0x4d278a,_0x3962b7){return function(_0x597d2c){if(_0x597d2c){return _0x597d2c[_0x18b9('0x27')](_0x4d278a)[_0x18b9('0x28')](function(_0x28824b){return _0x28824b;});}return null;};}function removeEntity(_0x14d01f,_0x40fd0f){return function(_0x400773){if(_0x400773){return _0x400773[_0x18b9('0x29')]()[_0x18b9('0x28')](function(){_0x14d01f[_0x18b9('0x1c')](0xcc)[_0x18b9('0x1d')]();});}};}function handleEntityNotFound(_0x3e3b25,_0xc95d0a){return function(_0x1d70aa){if(!_0x1d70aa){_0x3e3b25[_0x18b9('0x2a')](0x194);}return _0x1d70aa;};}function handleError(_0x2b5f54,_0x3c0265){_0x3c0265=_0x3c0265||0x1f4;return function(_0x449bdc){logger[_0x18b9('0x2b')](_0x449bdc[_0x18b9('0x2c')]);if(_0x449bdc[_0x18b9('0x2d')]){delete _0x449bdc[_0x18b9('0x2d')];}_0x2b5f54['status'](_0x3c0265)[_0x18b9('0x2e')](_0x449bdc);};}exports[_0x18b9('0x2f')]=function(_0x4aa28a,_0x12ae1e){var _0x51c7f3={},_0x363134={},_0x2c2ce6={'count':0x0,'rows':[]};var _0x54e834=_[_0x18b9('0x30')](db['SalesforceAccount'][_0x18b9('0x31')],function(_0x1e604d){return{'name':_0x1e604d[_0x18b9('0x32')],'type':_0x1e604d[_0x18b9('0x33')][_0x18b9('0x34')]};});_0x363134[_0x18b9('0x35')]=_[_0x18b9('0x30')](_0x54e834,_0x18b9('0x2d'));_0x363134['query']=_[_0x18b9('0x36')](_0x4aa28a[_0x18b9('0x37')]);_0x363134[_0x18b9('0x38')]=_[_0x18b9('0x39')](_0x363134[_0x18b9('0x35')],_0x363134[_0x18b9('0x37')]);_0x51c7f3[_0x18b9('0x3a')]=_[_0x18b9('0x39')](_0x363134[_0x18b9('0x35')],qs[_0x18b9('0x3b')](_0x4aa28a[_0x18b9('0x37')]['fields']));_0x51c7f3[_0x18b9('0x3a')]=_0x51c7f3[_0x18b9('0x3a')]['length']?_0x51c7f3[_0x18b9('0x3a')]:_0x363134[_0x18b9('0x35')];if(!_0x4aa28a['query'][_0x18b9('0x3c')](_0x18b9('0x3d'))){_0x51c7f3[_0x18b9('0x1f')]=qs[_0x18b9('0x1f')](_0x4aa28a[_0x18b9('0x37')][_0x18b9('0x1f')]);_0x51c7f3[_0x18b9('0x21')]=qs[_0x18b9('0x21')](_0x4aa28a['query'][_0x18b9('0x21')]);}_0x51c7f3[_0x18b9('0x3e')]=qs[_0x18b9('0x3f')](_0x4aa28a[_0x18b9('0x37')][_0x18b9('0x3f')]);_0x51c7f3[_0x18b9('0x40')]=qs['filters'](_['pick'](_0x4aa28a[_0x18b9('0x37')],_0x363134[_0x18b9('0x38')]),_0x54e834);if(_0x4aa28a['query'][_0x18b9('0x41')]){_0x51c7f3[_0x18b9('0x40')]=_[_0x18b9('0x42')](_0x51c7f3[_0x18b9('0x40')],{'$or':_['map'](_0x54e834,function(_0x38f6bb){if(_0x38f6bb['type']!==_0x18b9('0x43')){var _0x52886c={};_0x52886c[_0x38f6bb[_0x18b9('0x2d')]]={'$like':'%'+_0x4aa28a[_0x18b9('0x37')][_0x18b9('0x41')]+'%'};return _0x52886c;}})});}_0x51c7f3=_[_0x18b9('0x42')]({},_0x51c7f3,_0x4aa28a[_0x18b9('0x44')]);var _0x3e70df={'where':_0x51c7f3[_0x18b9('0x40')]};return db[_0x18b9('0x45')][_0x18b9('0x20')](_0x3e70df)['then'](function(_0x51748b){_0x2c2ce6[_0x18b9('0x20')]=_0x51748b;if(_0x4aa28a['query'][_0x18b9('0x46')]){_0x51c7f3[_0x18b9('0x47')]=[{'all':!![]}];}return db[_0x18b9('0x45')][_0x18b9('0x48')](_0x51c7f3);})[_0x18b9('0x28')](function(_0x2aa5a1){_0x2c2ce6[_0x18b9('0x49')]=_0x2aa5a1;return _0x2c2ce6;})['then'](respondWithFilteredResult(_0x12ae1e,_0x51c7f3))['catch'](handleError(_0x12ae1e,null));};exports['show']=function(_0x4348e0,_0x28e7fc){var _0x3fb740={'raw':![],'where':{'id':_0x4348e0[_0x18b9('0x4a')]['id']}},_0x565e03={};_0x565e03[_0x18b9('0x35')]=_[_0x18b9('0x36')](db['SalesforceAccount'][_0x18b9('0x31')]);_0x565e03[_0x18b9('0x37')]=_[_0x18b9('0x36')](_0x4348e0[_0x18b9('0x37')]);_0x565e03[_0x18b9('0x38')]=_[_0x18b9('0x39')](_0x565e03[_0x18b9('0x35')],_0x565e03[_0x18b9('0x37')]);_0x3fb740[_0x18b9('0x3a')]=_[_0x18b9('0x39')](_0x565e03[_0x18b9('0x35')],qs[_0x18b9('0x3b')](_0x4348e0[_0x18b9('0x37')][_0x18b9('0x3b')]));_0x3fb740[_0x18b9('0x3a')]=_0x3fb740['attributes'][_0x18b9('0x4b')]?_0x3fb740[_0x18b9('0x3a')]:_0x565e03[_0x18b9('0x35')];if(_0x4348e0[_0x18b9('0x37')][_0x18b9('0x46')]){_0x3fb740[_0x18b9('0x47')]=[{'all':!![]}];}_0x3fb740=_['merge']({},_0x3fb740,_0x4348e0[_0x18b9('0x44')]);return db[_0x18b9('0x45')][_0x18b9('0x4c')](_0x3fb740)['then'](handleEntityNotFound(_0x28e7fc,null))[_0x18b9('0x28')](respondWithResult(_0x28e7fc,null))[_0x18b9('0x4d')](handleError(_0x28e7fc,null));};exports[_0x18b9('0x4e')]=function(_0x294313,_0x429246){return db[_0x18b9('0x45')]['create'](_0x294313[_0x18b9('0x4f')],{})[_0x18b9('0x28')](respondWithResult(_0x429246,0xc9))['catch'](handleError(_0x429246,null));};exports[_0x18b9('0x27')]=function(_0x4be57c,_0x2e8f0e){if(_0x4be57c['body']['id']){delete _0x4be57c[_0x18b9('0x4f')]['id'];}return db[_0x18b9('0x45')][_0x18b9('0x4c')]({'where':{'id':_0x4be57c['params']['id']}})[_0x18b9('0x28')](handleEntityNotFound(_0x2e8f0e,null))[_0x18b9('0x28')](saveUpdates(_0x4be57c[_0x18b9('0x4f')],null))['then'](respondWithResult(_0x2e8f0e,null))['catch'](handleError(_0x2e8f0e,null));};exports[_0x18b9('0x29')]=function(_0x575692,_0x553c4a){return db[_0x18b9('0x45')][_0x18b9('0x4c')]({'where':{'id':_0x575692[_0x18b9('0x4a')]['id']}})[_0x18b9('0x28')](handleEntityNotFound(_0x553c4a,null))[_0x18b9('0x28')](removeEntity(_0x553c4a,null))[_0x18b9('0x4d')](handleError(_0x553c4a,null));};exports[_0x18b9('0x50')]=function(_0x58f554,_0x9fabd4,_0x41d993){var _0x5b13dc={};var _0x188c19={};var _0x4e8077;var _0x179691;return db[_0x18b9('0x45')][_0x18b9('0x51')]({'where':{'id':_0x58f554[_0x18b9('0x4a')]['id']}})[_0x18b9('0x28')](handleEntityNotFound(_0x9fabd4,null))[_0x18b9('0x28')](function(_0x273c5d){if(_0x273c5d){_0x4e8077=_0x273c5d;_0x188c19['model']=_[_0x18b9('0x36')](db[_0x18b9('0x52')][_0x18b9('0x31')]);_0x188c19['query']=_[_0x18b9('0x36')](_0x58f554[_0x18b9('0x37')]);_0x188c19[_0x18b9('0x38')]=_['intersection'](_0x188c19[_0x18b9('0x35')],_0x188c19[_0x18b9('0x37')]);_0x5b13dc[_0x18b9('0x3a')]=_[_0x18b9('0x39')](_0x188c19[_0x18b9('0x35')],qs[_0x18b9('0x3b')](_0x58f554[_0x18b9('0x37')][_0x18b9('0x3b')]));_0x5b13dc[_0x18b9('0x3a')]=_0x5b13dc[_0x18b9('0x3a')]['length']?_0x5b13dc[_0x18b9('0x3a')]:_0x188c19[_0x18b9('0x35')];_0x5b13dc[_0x18b9('0x3e')]=qs['sort'](_0x58f554[_0x18b9('0x37')]['sort']);_0x5b13dc['where']=qs[_0x18b9('0x38')](_['pick'](_0x58f554[_0x18b9('0x37')],_0x188c19[_0x18b9('0x38')]));if(_0x58f554['query']['filter']){_0x5b13dc['where']=_[_0x18b9('0x42')](_0x5b13dc[_0x18b9('0x40')],{'$or':_['map'](_0x5b13dc[_0x18b9('0x3a')],function(_0x3d1d57){var _0x15b84d={};_0x15b84d[_0x3d1d57]={'$like':'%'+_0x58f554[_0x18b9('0x37')][_0x18b9('0x41')]+'%'};return _0x15b84d;})});}_0x5b13dc=_['merge']({},_0x5b13dc,_0x58f554[_0x18b9('0x44')]);return _0x4e8077[_0x18b9('0x50')](_0x5b13dc);}})['then'](function(_0x567eac){if(_0x567eac){_0x179691=_0x567eac[_0x18b9('0x4b')];if(!_0x58f554[_0x18b9('0x37')][_0x18b9('0x3c')]('nolimit')){_0x5b13dc[_0x18b9('0x1f')]=qs[_0x18b9('0x1f')](_0x58f554[_0x18b9('0x37')][_0x18b9('0x1f')]);_0x5b13dc['offset']=qs['offset'](_0x58f554[_0x18b9('0x37')][_0x18b9('0x21')]);}return _0x4e8077[_0x18b9('0x50')](_0x5b13dc);}})[_0x18b9('0x28')](function(_0x2fbd4b){if(_0x2fbd4b){return _0x2fbd4b?{'count':_0x179691,'rows':_0x2fbd4b}:null;}})['then'](respondWithResult(_0x9fabd4,null))['catch'](handleError(_0x9fabd4,null));};exports[_0x18b9('0x53')]=function(_0x20f9a9,_0x2daafe,_0x4e7652){if(_0x20f9a9[_0x18b9('0x4f')]['id']){delete _0x20f9a9[_0x18b9('0x4f')]['id'];}return db[_0x18b9('0x45')][_0x18b9('0x51')]({'where':{'id':_0x20f9a9['params']['id']}})[_0x18b9('0x28')](handleEntityNotFound(_0x2daafe,null))['then'](function(_0x37e652){if(_0x37e652){_0x20f9a9[_0x18b9('0x4f')][_0x18b9('0x54')]=_0x37e652['id'];_0x20f9a9[_0x18b9('0x4f')][_0x18b9('0x55')]=integrations[_0x18b9('0x56')](_0x20f9a9[_0x18b9('0x4f')]['channel'],_0x20f9a9['body'][_0x18b9('0x33')]);_0x20f9a9['body'][_0x18b9('0x57')]=integrations[_0x18b9('0x58')](_0x20f9a9[_0x18b9('0x4f')][_0x18b9('0x59')],_0x20f9a9[_0x18b9('0x4f')][_0x18b9('0x33')]);return db[_0x18b9('0x52')][_0x18b9('0x4e')](_0x20f9a9[_0x18b9('0x4f')],{'include':[{'model':db[_0x18b9('0x5a')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0x18b9('0x57')}]});}return null;})[_0x18b9('0x28')](respondWithResult(_0x2daafe,null))[_0x18b9('0x4d')](handleError(_0x2daafe,null));};exports[_0x18b9('0x5b')]=function(_0x59c836,_0x2ec7d5,_0x16ecba){var _0x4be04e;var _0x4d26ae='';var _0xab4b03=_0x18b9('0x5c');return db['SalesforceAccount'][_0x18b9('0x51')]({'where':{'id':_0x59c836['params']['id']},'attributes':['id',_0x18b9('0x5d'),_0x18b9('0x5e'),_0x18b9('0x5f'),'username',_0x18b9('0x60'),'securityToken']})['then'](handleEntityNotFound(_0x2ec7d5,null))['then'](function(_0x2d2636){if(_0x2d2636){_0x4d26ae=_0x2d2636['remoteUri'];var _0x15295b=_0x4d26ae[_0x18b9('0x61')](-0x1);if(_0x15295b==='/'){_0x4d26ae=_0x4d26ae['substring'](0x0,_0x4d26ae[_0x18b9('0x62')](_0x15295b));}_0x4be04e=new jsforce[(_0x18b9('0x63'))]({'oauth2':{'loginUrl':_0x4d26ae,'clientId':_0x2d2636[_0x18b9('0x5e')],'clientSecret':_0x2d2636[_0x18b9('0x5f')]}});return _0x4be04e[_0x18b9('0x64')](_0x2d2636[_0x18b9('0x65')],_0x2d2636[_0x18b9('0x60')]['concat'](_0x2d2636['securityToken']));}})[_0x18b9('0x28')](function(_0x569d69){if(_0x569d69){if(!_[_0x18b9('0x66')](_0x59c836['query']['ticketType'])){_0xab4b03=_0x59c836[_0x18b9('0x37')][_0x18b9('0x67')];}return _0x4be04e[_0x18b9('0x68')](_0xab4b03)[_0x18b9('0x69')]();}})['then'](function(_0x5afa84){var _0x31ca4b=[_0x18b9('0x6a'),'ActivityDate',_0x18b9('0x6b'),_0x18b9('0x6c'),'Subject',_0x18b9('0x6d')];var _0x1c03be=[_0x18b9('0x6e'),'int',_0x18b9('0x6f'),_0x18b9('0x70'),_0x18b9('0x71'),'textarea',_0x18b9('0x72')];if(_0x5afa84){_[_0x18b9('0x73')](_0x5afa84[_0x18b9('0x3b')],function(_0x44dd04){return _0x31ca4b[_0x18b9('0x74')](_0x44dd04[_0x18b9('0x2d')])||!_0x1c03be[_0x18b9('0x74')](_0x44dd04['type']);});return{'count':_0x5afa84['fields'][_0x18b9('0x4b')],'rows':_[_0x18b9('0x30')](_0x5afa84['fields'],function(_0x506db4){return{'id':_0x506db4[_0x18b9('0x2d')],'name':_0x506db4[_0x18b9('0x75')],'custom':_0x506db4['custom'],'options':_0x506db4[_0x18b9('0x76')][_0x18b9('0x4b')]>0x0?_[_0x18b9('0x30')](_0x506db4[_0x18b9('0x76')],function(_0x1917fe){return{'name':_0x1917fe['label'],'value':_0x1917fe[_0x18b9('0x77')]};}):_0x506db4[_0x18b9('0x33')]=='boolean'?[{'name':_0x18b9('0x78'),'value':_0x18b9('0x79')},{'name':'False','value':'false'}]:[]};})};}})[_0x18b9('0x28')](respondWithResult(_0x2ec7d5,null))[_0x18b9('0x4d')](function(_0x33b2b3){var _0x2aca1a=_0x59c836[_0x18b9('0x37')][_0x18b9('0x7a')]?0x1f4:_0x33b2b3[_0x18b9('0x7b')]||0x1f4;logger[_0x18b9('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0x18b9('0x5b'),_0x2aca1a,JSON[_0x18b9('0x7c')](_0x33b2b3));delete _0x33b2b3[_0x18b9('0x2d')];if(_0x2aca1a===0x191){_0x2aca1a=0x190;}_0x2ec7d5[_0x18b9('0x1c')](_0x2aca1a)[_0x18b9('0x2e')](_0x59c836[_0x18b9('0x37')]['test']?{'message':_0x18b9('0x7d'),'statusCode':_0x33b2b3[_0x18b9('0x7b')]}:_0x33b2b3);});};
\ No newline at end of file
index 2852f58..e771509 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6654=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts','lodash','util','api','path','rimraf'];(function(_0xae5203,_0x4e8888){var _0x1626b0=function(_0xa524dd){while(--_0xa524dd){_0xae5203['push'](_0xae5203['shift']());}};_0x1626b0(++_0x4e8888);}(_0x6654,0x145));var _0x4665=function(_0x3c5488,_0x168a4e){_0x3c5488=_0x3c5488-0x0;var _0x21d02f=_0x6654[_0x3c5488];return _0x21d02f;};'use strict';var _=require(_0x4665('0x0'));var util=require(_0x4665('0x1'));var logger=require('../../config/logger')(_0x4665('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4665('0x3'));var rimraf=require(_0x4665('0x4'));var config=require(_0x4665('0x5'));var attributes=require(_0x4665('0x6'));var integrations=require(_0x4665('0x7'));module['exports']=function(_0x14815e,_0x25030e){return _0x14815e['define'](_0x4665('0x8'),attributes,{'tableName':_0x4665('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22fb=['rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','int_salesforce_accounts','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x515ef1,_0x476d57){var _0x2081a6=function(_0x310edf){while(--_0x310edf){_0x515ef1['push'](_0x515ef1['shift']());}};_0x2081a6(++_0x476d57);}(_0x22fb,0x192));var _0xb22f=function(_0x122dc3,_0x4cfc47){_0x122dc3=_0x122dc3-0x0;var _0x490103=_0x22fb[_0x122dc3];return _0x490103;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));var integrations=require(_0xb22f('0x7'));module[_0xb22f('0x8')]=function(_0xc3ffcc,_0x412a95){return _0xc3ffcc[_0xb22f('0x9')]('SalesforceAccount',attributes,{'tableName':_0xb22f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3735272..a417169 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x973c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','info','ShowSalesforceAccount','find','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x27edec,_0x57d152){var _0x421b0e=function(_0x342b84){while(--_0x342b84){_0x27edec['push'](_0x27edec['shift']());}};_0x421b0e(++_0x57d152);}(_0x973c,0x6a));var _0xc973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x973c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc973('0x0'));var util=require('util');var moment=require(_0xc973('0x1'));var BPromise=require(_0xc973('0x2'));var rs=require(_0xc973('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc973('0x4'))['db'];var utils=require(_0xc973('0x5'));var logger=require(_0xc973('0x6'))(_0xc973('0x7'));var config=require(_0xc973('0x8'));var jayson=require(_0xc973('0x9'));var client=jayson[_0xc973('0xa')][_0xc973('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bd7ac,_0xc89cda,_0x505202){return new BPromise(function(_0x4cda4c,_0x3f02d3){return client[_0xc973('0xc')](_0x4bd7ac,_0x505202)['then'](function(_0x455d0a){logger['info'](_0xc973('0xd'),_0xc89cda,_0xc973('0xe'));logger[_0xc973('0xf')](_0xc973('0x10'),_0xc89cda,_0xc973('0xe'),JSON[_0xc973('0x11')](_0x455d0a));if(_0x455d0a[_0xc973('0x12')]){if(_0x455d0a[_0xc973('0x12')]['code']===0x1f4){logger[_0xc973('0x12')](_0xc973('0xd'),_0xc89cda,_0x455d0a[_0xc973('0x12')][_0xc973('0x13')]);return _0x3f02d3(_0x455d0a['error'][_0xc973('0x13')]);}logger[_0xc973('0x12')](_0xc973('0xd'),_0xc89cda,_0x455d0a[_0xc973('0x12')]['message']);return _0x4cda4c(_0x455d0a['error'][_0xc973('0x13')]);}else{logger['info'](_0xc973('0xd'),_0xc89cda,'request\x20sent');_0x4cda4c(_0x455d0a[_0xc973('0x14')][_0xc973('0x13')]);}})[_0xc973('0x15')](function(_0xbf9b88){logger[_0xc973('0x12')](_0xc973('0xd'),_0xc89cda,_0xbf9b88);_0x3f02d3(_0xbf9b88);});});}exports[_0xc973('0x16')]=function(_0x4ffe0f){var _0x29662b=this;return new Promise(function(_0x4425e9,_0x8ceed7){return db[_0xc973('0x17')][_0xc973('0x18')]({'raw':_0x4ffe0f[_0xc973('0x19')]?_0x4ffe0f[_0xc973('0x19')][_0xc973('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ffe0f[_0xc973('0x19')]?_0x4ffe0f[_0xc973('0x19')][_0xc973('0x1b')]||null:null,'attributes':_0x4ffe0f[_0xc973('0x19')]?_0x4ffe0f[_0xc973('0x19')][_0xc973('0x1c')]||null:null,'limit':_0x4ffe0f[_0xc973('0x19')]?_0x4ffe0f[_0xc973('0x19')][_0xc973('0x1d')]||null:null,'include':_0x4ffe0f['options']?_0x4ffe0f[_0xc973('0x19')][_0xc973('0x1e')]?_[_0xc973('0x1f')](_0x4ffe0f[_0xc973('0x19')][_0xc973('0x1e')],function(_0x5e9b96){return{'model':db[_0x5e9b96[_0xc973('0x20')]],'as':_0x5e9b96['as'],'attributes':_0x5e9b96[_0xc973('0x1c')],'include':_0x5e9b96['include']?_[_0xc973('0x1f')](_0x5e9b96[_0xc973('0x1e')],function(_0x2afaa2){return{'model':db[_0x2afaa2['model']],'as':_0x2afaa2['as'],'attributes':_0x2afaa2['attributes'],'include':_0x2afaa2[_0xc973('0x1e')]?_[_0xc973('0x1f')](_0x2afaa2[_0xc973('0x1e')],function(_0x246bf2){return{'model':db[_0x246bf2[_0xc973('0x20')]],'as':_0x246bf2['as'],'attributes':_0x246bf2[_0xc973('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc973('0x21')](function(_0x561ca8){logger[_0xc973('0x22')]('GetSalesforceAccount',_0x4ffe0f);logger['debug'](_0xc973('0x16'),_0x4ffe0f,JSON[_0xc973('0x11')](_0x561ca8));_0x4425e9(_0x561ca8);})['catch'](function(_0x20ddc2){logger[_0xc973('0x12')](_0xc973('0x16'),_0x20ddc2['message'],_0x4ffe0f);_0x8ceed7(_0x29662b['error'](0x1f4,_0x20ddc2[_0xc973('0x13')]));});});};exports[_0xc973('0x23')]=function(_0x4f7213){var _0x150297=this;return new Promise(function(_0x1a6a1b,_0x4871b4){return db[_0xc973('0x17')][_0xc973('0x24')]({'raw':_0x4f7213[_0xc973('0x19')]?_0x4f7213[_0xc973('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4f7213[_0xc973('0x19')]?_0x4f7213['options'][_0xc973('0x1b')]||null:null,'attributes':_0x4f7213[_0xc973('0x19')]?_0x4f7213[_0xc973('0x19')][_0xc973('0x1c')]||null:null,'include':_0x4f7213[_0xc973('0x19')]?_0x4f7213[_0xc973('0x19')][_0xc973('0x1e')]?_[_0xc973('0x1f')](_0x4f7213['options'][_0xc973('0x1e')],function(_0x1bb29b){return{'model':db[_0x1bb29b[_0xc973('0x20')]],'as':_0x1bb29b['as'],'attributes':_0x1bb29b[_0xc973('0x1c')],'include':_0x1bb29b[_0xc973('0x1e')]?_[_0xc973('0x1f')](_0x1bb29b['include'],function(_0x8d4d6a){return{'model':db[_0x8d4d6a['model']],'as':_0x8d4d6a['as'],'attributes':_0x8d4d6a[_0xc973('0x1c')],'include':_0x8d4d6a[_0xc973('0x1e')]?_['map'](_0x8d4d6a[_0xc973('0x1e')],function(_0x31c07c){return{'model':db[_0x31c07c[_0xc973('0x20')]],'as':_0x31c07c['as'],'attributes':_0x31c07c[_0xc973('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc973('0x21')](function(_0x1e81d5){logger[_0xc973('0x22')]('ShowSalesforceAccount',_0x4f7213);logger[_0xc973('0xf')](_0xc973('0x23'),_0x4f7213,JSON[_0xc973('0x11')](_0x1e81d5));_0x1a6a1b(_0x1e81d5);})['catch'](function(_0x286c36){logger[_0xc973('0x12')](_0xc973('0x23'),_0x286c36[_0xc973('0x13')],_0x4f7213);_0x4871b4(_0x150297['error'](0x1f4,_0x286c36[_0xc973('0x13')]));});});};
\ No newline at end of file
+var _0x693d=['error','code','SalesforceAccount,\x20%s,\x20%s','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','map','model','attributes','debug','catch','ShowSalesforceAccount','find','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x693d,0x19f));var _0xd693=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x693d[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd693('0x0'));var BPromise=require(_0xd693('0x1'));var rs=require(_0xd693('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd693('0x3'))['db'];var utils=require(_0xd693('0x4'));var logger=require(_0xd693('0x5'))(_0xd693('0x6'));var config=require(_0xd693('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd693('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18ad02,_0x3e1d8e,_0x10db61){return new BPromise(function(_0x5e4a33,_0x485486){return client['request'](_0x18ad02,_0x10db61)[_0xd693('0x9')](function(_0x257e6c){logger[_0xd693('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x3e1d8e,_0xd693('0xb'));logger['debug'](_0xd693('0xc'),_0x3e1d8e,_0xd693('0xb'),JSON[_0xd693('0xd')](_0x257e6c));if(_0x257e6c[_0xd693('0xe')]){if(_0x257e6c['error'][_0xd693('0xf')]===0x1f4){logger[_0xd693('0xe')](_0xd693('0x10'),_0x3e1d8e,_0x257e6c['error'][_0xd693('0x11')]);return _0x485486(_0x257e6c[_0xd693('0xe')][_0xd693('0x11')]);}logger[_0xd693('0xe')](_0xd693('0x10'),_0x3e1d8e,_0x257e6c[_0xd693('0xe')][_0xd693('0x11')]);return _0x5e4a33(_0x257e6c[_0xd693('0xe')][_0xd693('0x11')]);}else{logger[_0xd693('0xa')](_0xd693('0x10'),_0x3e1d8e,_0xd693('0xb'));_0x5e4a33(_0x257e6c[_0xd693('0x12')][_0xd693('0x11')]);}})['catch'](function(_0x1f3dbf){logger[_0xd693('0xe')](_0xd693('0x10'),_0x3e1d8e,_0x1f3dbf);_0x485486(_0x1f3dbf);});});}exports[_0xd693('0x13')]=function(_0x8f5473){var _0x8eda44=this;return new Promise(function(_0x190b67,_0x54f5fa){return db[_0xd693('0x14')][_0xd693('0x15')]({'raw':_0x8f5473[_0xd693('0x16')]?_0x8f5473[_0xd693('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x8f5473[_0xd693('0x16')]?_0x8f5473[_0xd693('0x16')][_0xd693('0x17')]||null:null,'attributes':_0x8f5473[_0xd693('0x16')]?_0x8f5473[_0xd693('0x16')]['attributes']||null:null,'limit':_0x8f5473[_0xd693('0x16')]?_0x8f5473[_0xd693('0x16')][_0xd693('0x18')]||null:null,'include':_0x8f5473['options']?_0x8f5473[_0xd693('0x16')][_0xd693('0x19')]?_['map'](_0x8f5473[_0xd693('0x16')][_0xd693('0x19')],function(_0x528d53){return{'model':db[_0x528d53['model']],'as':_0x528d53['as'],'attributes':_0x528d53['attributes'],'include':_0x528d53['include']?_[_0xd693('0x1a')](_0x528d53[_0xd693('0x19')],function(_0x88b32c){return{'model':db[_0x88b32c[_0xd693('0x1b')]],'as':_0x88b32c['as'],'attributes':_0x88b32c['attributes'],'include':_0x88b32c[_0xd693('0x19')]?_[_0xd693('0x1a')](_0x88b32c[_0xd693('0x19')],function(_0x21dbc7){return{'model':db[_0x21dbc7[_0xd693('0x1b')]],'as':_0x21dbc7['as'],'attributes':_0x21dbc7[_0xd693('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd693('0x9')](function(_0x364662){logger['info'](_0xd693('0x13'),_0x8f5473);logger[_0xd693('0x1d')](_0xd693('0x13'),_0x8f5473,JSON[_0xd693('0xd')](_0x364662));_0x190b67(_0x364662);})[_0xd693('0x1e')](function(_0x56864a){logger[_0xd693('0xe')](_0xd693('0x13'),_0x56864a[_0xd693('0x11')],_0x8f5473);_0x54f5fa(_0x8eda44[_0xd693('0xe')](0x1f4,_0x56864a[_0xd693('0x11')]));});});};exports[_0xd693('0x1f')]=function(_0x1a47e8){var _0x5a9d34=this;return new Promise(function(_0x5dafc9,_0x2584cc){return db['SalesforceAccount'][_0xd693('0x20')]({'raw':_0x1a47e8[_0xd693('0x16')]?_0x1a47e8['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a47e8[_0xd693('0x16')]?_0x1a47e8[_0xd693('0x16')]['where']||null:null,'attributes':_0x1a47e8['options']?_0x1a47e8[_0xd693('0x16')][_0xd693('0x1c')]||null:null,'include':_0x1a47e8[_0xd693('0x16')]?_0x1a47e8[_0xd693('0x16')][_0xd693('0x19')]?_[_0xd693('0x1a')](_0x1a47e8['options']['include'],function(_0x3b5d71){return{'model':db[_0x3b5d71[_0xd693('0x1b')]],'as':_0x3b5d71['as'],'attributes':_0x3b5d71[_0xd693('0x1c')],'include':_0x3b5d71['include']?_['map'](_0x3b5d71['include'],function(_0x2d49dc){return{'model':db[_0x2d49dc[_0xd693('0x1b')]],'as':_0x2d49dc['as'],'attributes':_0x2d49dc[_0xd693('0x1c')],'include':_0x2d49dc[_0xd693('0x19')]?_[_0xd693('0x1a')](_0x2d49dc['include'],function(_0x4754e4){return{'model':db[_0x4754e4[_0xd693('0x1b')]],'as':_0x4754e4['as'],'attributes':_0x4754e4['attributes']};}):[]};}):[]};}):[]:[]})[_0xd693('0x9')](function(_0x2d8b2e){logger[_0xd693('0xa')](_0xd693('0x1f'),_0x1a47e8);logger[_0xd693('0x1d')](_0xd693('0x1f'),_0x1a47e8,JSON['stringify'](_0x2d8b2e));_0x5dafc9(_0x2d8b2e);})['catch'](function(_0x17a229){logger[_0xd693('0xe')](_0xd693('0x1f'),_0x17a229[_0xd693('0x11')],_0x1a47e8);_0x2584cc(_0x5a9d34[_0xd693('0xe')](0x1f4,_0x17a229[_0xd693('0x11')]));});});};
\ No newline at end of file
index 007785f..b3026e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x4bc139,_0x152fe5){var _0x4a3840=function(_0x269794){while(--_0x269794){_0x4bc139['push'](_0x4bc139['shift']());}};_0x4a3840(++_0x152fe5);}(_0xadb5,0xad));var _0x5adb=function(_0x57683a,_0x15ecc4){_0x57683a=_0x57683a-0x0;var _0x4db585=_0xadb5[_0x57683a];return _0x4db585;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router;
\ No newline at end of file
+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(_0x26829e,_0x3db3b0){_0x26829e=_0x26829e-0x0;var _0x284503=_0x2032[_0x26829e];return _0x284503;};'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
index b109e50..935dee3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a2d=['account_contact_lead','account','exports','STRING','ENUM','contact_lead','contact','lead'];(function(_0x1acfb9,_0x52bc80){var _0x1416e3=function(_0x1909d1){while(--_0x1909d1){_0x1acfb9['push'](_0x1acfb9['shift']());}};_0x1416e3(++_0x52bc80);}(_0x5a2d,0x142));var _0xd5a2=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x5a2d[_0x5b34c0];return _0x242bd3;};'use strict';var Sequelize=require('sequelize');module[_0xd5a2('0x0')]={'name':{'type':Sequelize[_0xd5a2('0x1')]},'description':{'type':Sequelize[_0xd5a2('0x1')]},'ticketType':{'type':Sequelize[_0xd5a2('0x2')]('Task','Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xd5a2('0x2')](_0xd5a2('0x3'),_0xd5a2('0x4'),_0xd5a2('0x5'),_0xd5a2('0x6'),_0xd5a2('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0xd5a2('0x4'),_0xd5a2('0x5'),_0xd5a2('0x7')),'defaultValue':_0xd5a2('0x5')},'leadId':{'type':Sequelize[_0xd5a2('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xd5a2('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xd5a2('0x1')]}};
\ No newline at end of file
+var _0x4a39=['lead','account','sequelize','STRING','ENUM','Task','Case','contact','account_contact_lead','contact_lead','nothing'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0x4a39,0x65));var _0x94a3=function(_0x3f347f,_0x4eceed){_0x3f347f=_0x3f347f-0x0;var _0x86e0fb=_0x4a39[_0x3f347f];return _0x86e0fb;};'use strict';var Sequelize=require(_0x94a3('0x0'));module['exports']={'name':{'type':Sequelize[_0x94a3('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x94a3('0x2')](_0x94a3('0x3'),_0x94a3('0x4')),'defaultValue':_0x94a3('0x3')},'moduleSearch':{'type':Sequelize[_0x94a3('0x2')]('contact_lead',_0x94a3('0x5'),'lead',_0x94a3('0x6'),'account'),'defaultValue':_0x94a3('0x7')},'moduleCreate':{'type':Sequelize[_0x94a3('0x2')](_0x94a3('0x8'),'contact',_0x94a3('0x9'),_0x94a3('0xa')),'defaultValue':_0x94a3('0x9')},'leadId':{'type':Sequelize[_0x94a3('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x94a3('0x1')]}};
\ No newline at end of file
index 40372fe..76adcd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4d6=['lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','stack','name','send','SalesforceConfiguration','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','filters','pick','where','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','body','getFields','findOne','length','sort','filter','SalesforceField','rawAttributes','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra'];(function(_0x27fdca,_0x35c161){var _0x578108=function(_0x2357fc){while(--_0x2357fc){_0x27fdca['push'](_0x27fdca['shift']());}};_0x578108(++_0x35c161);}(_0xe4d6,0xd7));var _0x6e4d=function(_0xc8a6ed,_0xd6cebb){_0xc8a6ed=_0xc8a6ed-0x0;var _0x3770ec=_0xe4d6[_0xc8a6ed];return _0x3770ec;};'use strict';var emlformat=require(_0x6e4d('0x0'));var rimraf=require(_0x6e4d('0x1'));var zipdir=require(_0x6e4d('0x2'));var jsonpatch=require(_0x6e4d('0x3'));var rp=require('request-promise');var moment=require(_0x6e4d('0x4'));var BPromise=require(_0x6e4d('0x5'));var Mustache=require(_0x6e4d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6e4d('0x7'));var csv=require('to-csv');var ejs=require(_0x6e4d('0x8'));var fs=require('fs');var fs_extra=require(_0x6e4d('0x9'));var _=require(_0x6e4d('0xa'));var squel=require(_0x6e4d('0xb'));var crypto=require(_0x6e4d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6e4d('0xd'));var querystring=require(_0x6e4d('0xe'));var Papa=require(_0x6e4d('0xf'));var Redis=require('ioredis');var authService=require(_0x6e4d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6e4d('0x11'));var hardwareService=require(_0x6e4d('0x12'));var logger=require(_0x6e4d('0x13'))(_0x6e4d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6e4d('0x15'));var db=require(_0x6e4d('0x16'))['db'];function respondWithStatusCode(_0x13cd57,_0x39ab6d){_0x39ab6d=_0x39ab6d||0xcc;return function(_0x584ba4){if(_0x584ba4){return _0x13cd57[_0x6e4d('0x17')](_0x39ab6d);}return _0x13cd57[_0x6e4d('0x18')](_0x39ab6d)[_0x6e4d('0x19')]();};}function respondWithResult(_0x7ade78,_0x545f9b){_0x545f9b=_0x545f9b||0xc8;return function(_0x1347ba){if(_0x1347ba){return _0x7ade78[_0x6e4d('0x18')](_0x545f9b)[_0x6e4d('0x1a')](_0x1347ba);}};}function respondWithFilteredResult(_0x5d1391,_0x5863d3){return function(_0xdca5f3){if(_0xdca5f3){var _0x51b9f1=typeof _0x5863d3[_0x6e4d('0x1b')]===_0x6e4d('0x1c')&&typeof _0x5863d3['limit']===_0x6e4d('0x1c');var _0x542ecd=_0xdca5f3[_0x6e4d('0x1d')];var _0x2ff1f4=_0x51b9f1?0x0:_0x5863d3[_0x6e4d('0x1b')];var _0x116ac3=_0x51b9f1?_0xdca5f3[_0x6e4d('0x1d')]:_0x5863d3['offset']+_0x5863d3[_0x6e4d('0x1e')];var _0x58e4fe;if(_0x116ac3>=_0x542ecd){_0x116ac3=_0x542ecd;_0x58e4fe=0xc8;}else{_0x58e4fe=0xce;}_0x5d1391[_0x6e4d('0x18')](_0x58e4fe);return _0x5d1391[_0x6e4d('0x1f')](_0x6e4d('0x20'),_0x2ff1f4+'-'+_0x116ac3+'/'+_0x542ecd)[_0x6e4d('0x1a')](_0xdca5f3);}return null;};}function patchUpdates(_0x5a8c39){return function(_0x33867f){try{jsonpatch[_0x6e4d('0x21')](_0x33867f,_0x5a8c39,!![]);}catch(_0x3477f6){return BPromise[_0x6e4d('0x22')](_0x3477f6);}return _0x33867f['save']();};}function saveUpdates(_0xe45d2a,_0x1be13b){return function(_0x2eb572){if(_0x2eb572){return _0x2eb572['update'](_0xe45d2a)[_0x6e4d('0x23')](function(_0x464321){return _0x464321;});}return null;};}function removeEntity(_0x2fbbae,_0x2873b3){return function(_0x4a7d4a){if(_0x4a7d4a){return _0x4a7d4a['destroy']()[_0x6e4d('0x23')](function(){_0x2fbbae['status'](0xcc)[_0x6e4d('0x19')]();});}};}function handleEntityNotFound(_0x2e2eed,_0x33a86d){return function(_0x5c1867){if(!_0x5c1867){_0x2e2eed[_0x6e4d('0x17')](0x194);}return _0x5c1867;};}function handleError(_0xd9bf5d,_0x4973af){_0x4973af=_0x4973af||0x1f4;return function(_0x47cd00){logger['error'](_0x47cd00[_0x6e4d('0x24')]);if(_0x47cd00[_0x6e4d('0x25')]){delete _0x47cd00[_0x6e4d('0x25')];}_0xd9bf5d[_0x6e4d('0x18')](_0x4973af)[_0x6e4d('0x26')](_0x47cd00);};}exports['index']=function(_0x300e35,_0x30a5d8){var _0x1c90de={},_0x15aeb7={},_0x119a30={'count':0x0,'rows':[]};var _0x5e271e=_['map'](db[_0x6e4d('0x27')]['rawAttributes'],function(_0x2df0b4){return{'name':_0x2df0b4[_0x6e4d('0x28')],'type':_0x2df0b4[_0x6e4d('0x29')][_0x6e4d('0x2a')]};});_0x15aeb7[_0x6e4d('0x2b')]=_[_0x6e4d('0x2c')](_0x5e271e,_0x6e4d('0x25'));_0x15aeb7[_0x6e4d('0x2d')]=_[_0x6e4d('0x2e')](_0x300e35[_0x6e4d('0x2d')]);_0x15aeb7['filters']=_['intersection'](_0x15aeb7['model'],_0x15aeb7[_0x6e4d('0x2d')]);_0x1c90de[_0x6e4d('0x2f')]=_[_0x6e4d('0x30')](_0x15aeb7[_0x6e4d('0x2b')],qs['fields'](_0x300e35[_0x6e4d('0x2d')][_0x6e4d('0x31')]));_0x1c90de[_0x6e4d('0x2f')]=_0x1c90de[_0x6e4d('0x2f')]['length']?_0x1c90de[_0x6e4d('0x2f')]:_0x15aeb7[_0x6e4d('0x2b')];if(!_0x300e35['query'][_0x6e4d('0x32')](_0x6e4d('0x33'))){_0x1c90de[_0x6e4d('0x1e')]=qs[_0x6e4d('0x1e')](_0x300e35[_0x6e4d('0x2d')][_0x6e4d('0x1e')]);_0x1c90de['offset']=qs['offset'](_0x300e35[_0x6e4d('0x2d')][_0x6e4d('0x1b')]);}_0x1c90de[_0x6e4d('0x34')]=qs['sort'](_0x300e35['query']['sort']);_0x1c90de['where']=qs[_0x6e4d('0x35')](_[_0x6e4d('0x36')](_0x300e35['query'],_0x15aeb7[_0x6e4d('0x35')]),_0x5e271e);if(_0x300e35[_0x6e4d('0x2d')]['filter']){_0x1c90de[_0x6e4d('0x37')]=_[_0x6e4d('0x38')](_0x1c90de[_0x6e4d('0x37')],{'$or':_[_0x6e4d('0x2c')](_0x5e271e,function(_0x29f47a){if(_0x29f47a[_0x6e4d('0x29')]!==_0x6e4d('0x39')){var _0x4ab14b={};_0x4ab14b[_0x29f47a[_0x6e4d('0x25')]]={'$like':'%'+_0x300e35['query']['filter']+'%'};return _0x4ab14b;}})});}_0x1c90de=_[_0x6e4d('0x38')]({},_0x1c90de,_0x300e35[_0x6e4d('0x3a')]);var _0x482144={'where':_0x1c90de[_0x6e4d('0x37')]};return db[_0x6e4d('0x27')]['count'](_0x482144)['then'](function(_0x8e9fb4){_0x119a30[_0x6e4d('0x1d')]=_0x8e9fb4;if(_0x300e35['query'][_0x6e4d('0x3b')]){_0x1c90de[_0x6e4d('0x3c')]=[{'all':!![]}];}return db[_0x6e4d('0x27')]['findAll'](_0x1c90de);})[_0x6e4d('0x23')](function(_0x55c4e1){_0x119a30['rows']=_0x55c4e1;return _0x119a30;})[_0x6e4d('0x23')](respondWithFilteredResult(_0x30a5d8,_0x1c90de))[_0x6e4d('0x3d')](handleError(_0x30a5d8,null));};exports['show']=function(_0x155468,_0x11c0d6){var _0x138223={'raw':![],'where':{'id':_0x155468[_0x6e4d('0x3e')]['id']}},_0x1c48c5={};_0x1c48c5[_0x6e4d('0x2b')]=_[_0x6e4d('0x2e')](db[_0x6e4d('0x27')]['rawAttributes']);_0x1c48c5[_0x6e4d('0x2d')]=_['keys'](_0x155468['query']);_0x1c48c5[_0x6e4d('0x35')]=_[_0x6e4d('0x30')](_0x1c48c5['model'],_0x1c48c5[_0x6e4d('0x2d')]);_0x138223[_0x6e4d('0x2f')]=_[_0x6e4d('0x30')](_0x1c48c5[_0x6e4d('0x2b')],qs['fields'](_0x155468[_0x6e4d('0x2d')][_0x6e4d('0x31')]));_0x138223[_0x6e4d('0x2f')]=_0x138223['attributes']['length']?_0x138223['attributes']:_0x1c48c5[_0x6e4d('0x2b')];if(_0x155468[_0x6e4d('0x2d')][_0x6e4d('0x3b')]){_0x138223[_0x6e4d('0x3c')]=[{'all':!![]}];}_0x138223=_[_0x6e4d('0x38')]({},_0x138223,_0x155468['options']);return db['SalesforceConfiguration'][_0x6e4d('0x3f')](_0x138223)['then'](handleEntityNotFound(_0x11c0d6,null))[_0x6e4d('0x23')](respondWithResult(_0x11c0d6,null))[_0x6e4d('0x3d')](handleError(_0x11c0d6,null));};exports['create']=function(_0x174c7f,_0x6d042f){return db[_0x6e4d('0x27')][_0x6e4d('0x40')](_0x174c7f[_0x6e4d('0x41')],{})['then'](respondWithResult(_0x6d042f,0xc9))['catch'](handleError(_0x6d042f,null));};exports['update']=function(_0x2c7c1f,_0x1684e6){if(_0x2c7c1f[_0x6e4d('0x41')]['id']){delete _0x2c7c1f['body']['id'];}return db[_0x6e4d('0x27')][_0x6e4d('0x3f')]({'where':{'id':_0x2c7c1f[_0x6e4d('0x3e')]['id']}})[_0x6e4d('0x23')](handleEntityNotFound(_0x1684e6,null))[_0x6e4d('0x23')](saveUpdates(_0x2c7c1f[_0x6e4d('0x41')],null))[_0x6e4d('0x23')](respondWithResult(_0x1684e6,null))[_0x6e4d('0x3d')](handleError(_0x1684e6,null));};exports['destroy']=function(_0xe92248,_0x28953c){return db[_0x6e4d('0x27')][_0x6e4d('0x3f')]({'where':{'id':_0xe92248[_0x6e4d('0x3e')]['id']}})[_0x6e4d('0x23')](handleEntityNotFound(_0x28953c,null))[_0x6e4d('0x23')](removeEntity(_0x28953c,null))[_0x6e4d('0x3d')](handleError(_0x28953c,null));};exports[_0x6e4d('0x42')]=function(_0x5f289f,_0x1dcbea,_0x30c45f){var _0x5d2247={};var _0x44f6fa={};var _0x1848f0;var _0x1a90dd;return db['SalesforceConfiguration'][_0x6e4d('0x43')]({'where':{'id':_0x5f289f[_0x6e4d('0x3e')]['id']}})[_0x6e4d('0x23')](handleEntityNotFound(_0x1dcbea,null))['then'](function(_0x38ca1c){if(_0x38ca1c){_0x1848f0=_0x38ca1c;_0x44f6fa['model']=_['keys'](db['SalesforceField']['rawAttributes']);_0x44f6fa[_0x6e4d('0x2d')]=_[_0x6e4d('0x2e')](_0x5f289f[_0x6e4d('0x2d')]);_0x44f6fa[_0x6e4d('0x35')]=_[_0x6e4d('0x30')](_0x44f6fa[_0x6e4d('0x2b')],_0x44f6fa[_0x6e4d('0x2d')]);_0x5d2247[_0x6e4d('0x2f')]=_['intersection'](_0x44f6fa[_0x6e4d('0x2b')],qs[_0x6e4d('0x31')](_0x5f289f['query'][_0x6e4d('0x31')]));_0x5d2247[_0x6e4d('0x2f')]=_0x5d2247[_0x6e4d('0x2f')][_0x6e4d('0x44')]?_0x5d2247['attributes']:_0x44f6fa['model'];_0x5d2247['order']=qs[_0x6e4d('0x45')](_0x5f289f[_0x6e4d('0x2d')][_0x6e4d('0x45')]);_0x5d2247[_0x6e4d('0x37')]=qs[_0x6e4d('0x35')](_[_0x6e4d('0x36')](_0x5f289f[_0x6e4d('0x2d')],_0x44f6fa[_0x6e4d('0x35')]));if(_0x5f289f[_0x6e4d('0x2d')]['filter']){_0x5d2247[_0x6e4d('0x37')]=_[_0x6e4d('0x38')](_0x5d2247['where'],{'$or':_['map'](_0x5d2247[_0x6e4d('0x2f')],function(_0x54e2b2){var _0x1767f2={};_0x1767f2[_0x54e2b2]={'$like':'%'+_0x5f289f[_0x6e4d('0x2d')][_0x6e4d('0x46')]+'%'};return _0x1767f2;})});}_0x5d2247=_['merge']({},_0x5d2247,_0x5f289f[_0x6e4d('0x3a')]);return _0x1848f0[_0x6e4d('0x42')](_0x5d2247);}})[_0x6e4d('0x23')](function(_0x23088e){if(_0x23088e){_0x1a90dd=_0x23088e['length'];if(!_0x5f289f[_0x6e4d('0x2d')][_0x6e4d('0x32')]('nolimit')){_0x5d2247[_0x6e4d('0x1e')]=qs[_0x6e4d('0x1e')](_0x5f289f[_0x6e4d('0x2d')][_0x6e4d('0x1e')]);_0x5d2247[_0x6e4d('0x1b')]=qs[_0x6e4d('0x1b')](_0x5f289f[_0x6e4d('0x2d')][_0x6e4d('0x1b')]);}return _0x1848f0[_0x6e4d('0x42')](_0x5d2247);}})['then'](function(_0x2da257){if(_0x2da257){return _0x2da257?{'count':_0x1a90dd,'rows':_0x2da257}:null;}})[_0x6e4d('0x23')](respondWithResult(_0x1dcbea,null))[_0x6e4d('0x3d')](handleError(_0x1dcbea,null));};exports['getSubjects']=function(_0x369c7f,_0x46598f,_0x10a9a3){var _0x5c48a3={};var _0x38501c={};var _0x48ba45;var _0x591cfc;return db[_0x6e4d('0x27')][_0x6e4d('0x43')]({'where':{'id':_0x369c7f[_0x6e4d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x46598f,null))[_0x6e4d('0x23')](function(_0x49bab4){if(_0x49bab4){_0x48ba45=_0x49bab4;_0x38501c[_0x6e4d('0x2b')]=_[_0x6e4d('0x2e')](db[_0x6e4d('0x47')][_0x6e4d('0x48')]);_0x38501c[_0x6e4d('0x2d')]=_[_0x6e4d('0x2e')](_0x369c7f[_0x6e4d('0x2d')]);_0x38501c[_0x6e4d('0x35')]=_[_0x6e4d('0x30')](_0x38501c['model'],_0x38501c[_0x6e4d('0x2d')]);_0x5c48a3[_0x6e4d('0x2f')]=_[_0x6e4d('0x30')](_0x38501c[_0x6e4d('0x2b')],qs['fields'](_0x369c7f[_0x6e4d('0x2d')][_0x6e4d('0x31')]));_0x5c48a3['attributes']=_0x5c48a3[_0x6e4d('0x2f')][_0x6e4d('0x44')]?_0x5c48a3['attributes']:_0x38501c[_0x6e4d('0x2b')];_0x5c48a3[_0x6e4d('0x34')]=qs[_0x6e4d('0x45')](_0x369c7f['query']['sort']);_0x5c48a3[_0x6e4d('0x37')]=qs[_0x6e4d('0x35')](_['pick'](_0x369c7f[_0x6e4d('0x2d')],_0x38501c[_0x6e4d('0x35')]));if(_0x369c7f[_0x6e4d('0x2d')][_0x6e4d('0x46')]){_0x5c48a3['where']=_['merge'](_0x5c48a3[_0x6e4d('0x37')],{'$or':_[_0x6e4d('0x2c')](_0x5c48a3['attributes'],function(_0x346263){var _0x1085f5={};_0x1085f5[_0x346263]={'$like':'%'+_0x369c7f[_0x6e4d('0x2d')][_0x6e4d('0x46')]+'%'};return _0x1085f5;})});}_0x5c48a3=_['merge']({},_0x5c48a3,_0x369c7f[_0x6e4d('0x3a')]);return _0x48ba45[_0x6e4d('0x49')](_0x5c48a3);}})[_0x6e4d('0x23')](function(_0x51f212){if(_0x51f212){_0x591cfc=_0x51f212[_0x6e4d('0x44')];if(!_0x369c7f[_0x6e4d('0x2d')]['hasOwnProperty']('nolimit')){_0x5c48a3[_0x6e4d('0x1e')]=qs[_0x6e4d('0x1e')](_0x369c7f[_0x6e4d('0x2d')][_0x6e4d('0x1e')]);_0x5c48a3[_0x6e4d('0x1b')]=qs[_0x6e4d('0x1b')](_0x369c7f[_0x6e4d('0x2d')][_0x6e4d('0x1b')]);}return _0x48ba45[_0x6e4d('0x49')](_0x5c48a3);}})[_0x6e4d('0x23')](function(_0x5b5272){if(_0x5b5272){return _0x5b5272?{'count':_0x591cfc,'rows':_0x5b5272}:null;}})[_0x6e4d('0x23')](respondWithResult(_0x46598f,null))[_0x6e4d('0x3d')](handleError(_0x46598f,null));};exports[_0x6e4d('0x4a')]=function(_0x179c45,_0x4c460e,_0x5a2c64){var _0x2fdee8={};var _0x5dafd1={};var _0x489031;var _0x59685c;return db[_0x6e4d('0x27')]['findOne']({'where':{'id':_0x179c45[_0x6e4d('0x3e')]['id']}})[_0x6e4d('0x23')](handleEntityNotFound(_0x4c460e,null))[_0x6e4d('0x23')](function(_0x108670){if(_0x108670){_0x489031=_0x108670;_0x5dafd1[_0x6e4d('0x2b')]=_[_0x6e4d('0x2e')](db[_0x6e4d('0x47')]['rawAttributes']);_0x5dafd1[_0x6e4d('0x2d')]=_[_0x6e4d('0x2e')](_0x179c45[_0x6e4d('0x2d')]);_0x5dafd1[_0x6e4d('0x35')]=_[_0x6e4d('0x30')](_0x5dafd1['model'],_0x5dafd1['query']);_0x2fdee8[_0x6e4d('0x2f')]=_[_0x6e4d('0x30')](_0x5dafd1['model'],qs[_0x6e4d('0x31')](_0x179c45[_0x6e4d('0x2d')][_0x6e4d('0x31')]));_0x2fdee8[_0x6e4d('0x2f')]=_0x2fdee8['attributes'][_0x6e4d('0x44')]?_0x2fdee8[_0x6e4d('0x2f')]:_0x5dafd1['model'];_0x2fdee8['order']=qs[_0x6e4d('0x45')](_0x179c45[_0x6e4d('0x2d')][_0x6e4d('0x45')]);_0x2fdee8[_0x6e4d('0x37')]=qs[_0x6e4d('0x35')](_['pick'](_0x179c45[_0x6e4d('0x2d')],_0x5dafd1['filters']));if(_0x179c45[_0x6e4d('0x2d')][_0x6e4d('0x46')]){_0x2fdee8[_0x6e4d('0x37')]=_['merge'](_0x2fdee8[_0x6e4d('0x37')],{'$or':_[_0x6e4d('0x2c')](_0x2fdee8['attributes'],function(_0x13d8fb){var _0x7517f3={};_0x7517f3[_0x13d8fb]={'$like':'%'+_0x179c45[_0x6e4d('0x2d')]['filter']+'%'};return _0x7517f3;})});}_0x2fdee8=_[_0x6e4d('0x38')]({},_0x2fdee8,_0x179c45[_0x6e4d('0x3a')]);return _0x489031[_0x6e4d('0x4a')](_0x2fdee8);}})['then'](function(_0x9f0c3a){if(_0x9f0c3a){_0x59685c=_0x9f0c3a[_0x6e4d('0x44')];if(!_0x179c45['query'][_0x6e4d('0x32')]('nolimit')){_0x2fdee8[_0x6e4d('0x1e')]=qs['limit'](_0x179c45['query'][_0x6e4d('0x1e')]);_0x2fdee8['offset']=qs[_0x6e4d('0x1b')](_0x179c45[_0x6e4d('0x2d')][_0x6e4d('0x1b')]);}return _0x489031['getDescriptions'](_0x2fdee8);}})[_0x6e4d('0x23')](function(_0x41132b){if(_0x41132b){return _0x41132b?{'count':_0x59685c,'rows':_0x41132b}:null;}})[_0x6e4d('0x23')](respondWithResult(_0x4c460e,null))[_0x6e4d('0x3d')](handleError(_0x4c460e,null));};
\ No newline at end of file
+var _0x131a=['bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','body','update','destroy','find','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4c782b,_0x325875){var _0x491e47=function(_0xb0ad18){while(--_0xb0ad18){_0x4c782b['push'](_0x4c782b['shift']());}};_0x491e47(++_0x325875);}(_0x131a,0x18b));var _0xa131=function(_0x1e3e6d,_0x14cbe7){_0x1e3e6d=_0x1e3e6d-0x0;var _0x588572=_0x131a[_0x1e3e6d];return _0x588572;};'use strict';var emlformat=require(_0xa131('0x0'));var rimraf=require(_0xa131('0x1'));var zipdir=require(_0xa131('0x2'));var jsonpatch=require(_0xa131('0x3'));var rp=require(_0xa131('0x4'));var moment=require('moment');var BPromise=require(_0xa131('0x5'));var Mustache=require('mustache');var util=require(_0xa131('0x6'));var path=require(_0xa131('0x7'));var sox=require('sox');var csv=require(_0xa131('0x8'));var ejs=require(_0xa131('0x9'));var fs=require('fs');var fs_extra=require(_0xa131('0xa'));var _=require(_0xa131('0xb'));var squel=require(_0xa131('0xc'));var crypto=require(_0xa131('0xd'));var jsforce=require(_0xa131('0xe'));var deskjs=require(_0xa131('0xf'));var toCsv=require(_0xa131('0x8'));var querystring=require('querystring');var Papa=require(_0xa131('0x10'));var Redis=require(_0xa131('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa131('0x12'));var as=require(_0xa131('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa131('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa131('0x15'));var db=require(_0xa131('0x16'))['db'];function respondWithStatusCode(_0x5e6b4c,_0x61b6c5){_0x61b6c5=_0x61b6c5||0xcc;return function(_0x10214b){if(_0x10214b){return _0x5e6b4c['sendStatus'](_0x61b6c5);}return _0x5e6b4c['status'](_0x61b6c5)[_0xa131('0x17')]();};}function respondWithResult(_0x202622,_0x2e29ad){_0x2e29ad=_0x2e29ad||0xc8;return function(_0x9f1cb){if(_0x9f1cb){return _0x202622[_0xa131('0x18')](_0x2e29ad)[_0xa131('0x19')](_0x9f1cb);}};}function respondWithFilteredResult(_0x3d3862,_0x3d73bc){return function(_0x30ae85){if(_0x30ae85){var _0x141ee7=typeof _0x3d73bc[_0xa131('0x1a')]===_0xa131('0x1b')&&typeof _0x3d73bc[_0xa131('0x1c')]===_0xa131('0x1b');var _0x3e390b=_0x30ae85[_0xa131('0x1d')];var _0x2e5787=_0x141ee7?0x0:_0x3d73bc['offset'];var _0x2216c0=_0x141ee7?_0x30ae85[_0xa131('0x1d')]:_0x3d73bc['offset']+_0x3d73bc['limit'];var _0x4908db;if(_0x2216c0>=_0x3e390b){_0x2216c0=_0x3e390b;_0x4908db=0xc8;}else{_0x4908db=0xce;}_0x3d3862['status'](_0x4908db);return _0x3d3862[_0xa131('0x1e')](_0xa131('0x1f'),_0x2e5787+'-'+_0x2216c0+'/'+_0x3e390b)[_0xa131('0x19')](_0x30ae85);}return null;};}function patchUpdates(_0xdeb8c2){return function(_0x51f68c){try{jsonpatch[_0xa131('0x20')](_0x51f68c,_0xdeb8c2,!![]);}catch(_0x32649c){return BPromise[_0xa131('0x21')](_0x32649c);}return _0x51f68c[_0xa131('0x22')]();};}function saveUpdates(_0x43a9bb,_0x12a9f2){return function(_0x4b2929){if(_0x4b2929){return _0x4b2929['update'](_0x43a9bb)[_0xa131('0x23')](function(_0x15805d){return _0x15805d;});}return null;};}function removeEntity(_0x47117f,_0x104a14){return function(_0x5b0c98){if(_0x5b0c98){return _0x5b0c98['destroy']()[_0xa131('0x23')](function(){_0x47117f[_0xa131('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6b1237,_0x27004f){return function(_0x45ef22){if(!_0x45ef22){_0x6b1237[_0xa131('0x24')](0x194);}return _0x45ef22;};}function handleError(_0x3c01d8,_0x2d501e){_0x2d501e=_0x2d501e||0x1f4;return function(_0x1068db){logger[_0xa131('0x25')](_0x1068db[_0xa131('0x26')]);if(_0x1068db[_0xa131('0x27')]){delete _0x1068db[_0xa131('0x27')];}_0x3c01d8[_0xa131('0x18')](_0x2d501e)[_0xa131('0x28')](_0x1068db);};}exports[_0xa131('0x29')]=function(_0x217ab9,_0x106293){var _0x287690={},_0x2b5c8e={},_0x567df9={'count':0x0,'rows':[]};var _0x36cb53=_['map'](db[_0xa131('0x2a')][_0xa131('0x2b')],function(_0x33a341){return{'name':_0x33a341[_0xa131('0x2c')],'type':_0x33a341[_0xa131('0x2d')][_0xa131('0x2e')]};});_0x2b5c8e[_0xa131('0x2f')]=_[_0xa131('0x30')](_0x36cb53,_0xa131('0x27'));_0x2b5c8e[_0xa131('0x31')]=_[_0xa131('0x32')](_0x217ab9[_0xa131('0x31')]);_0x2b5c8e[_0xa131('0x33')]=_[_0xa131('0x34')](_0x2b5c8e[_0xa131('0x2f')],_0x2b5c8e['query']);_0x287690[_0xa131('0x35')]=_[_0xa131('0x34')](_0x2b5c8e[_0xa131('0x2f')],qs[_0xa131('0x36')](_0x217ab9[_0xa131('0x31')][_0xa131('0x36')]));_0x287690[_0xa131('0x35')]=_0x287690['attributes'][_0xa131('0x37')]?_0x287690[_0xa131('0x35')]:_0x2b5c8e[_0xa131('0x2f')];if(!_0x217ab9[_0xa131('0x31')][_0xa131('0x38')](_0xa131('0x39'))){_0x287690[_0xa131('0x1c')]=qs['limit'](_0x217ab9[_0xa131('0x31')][_0xa131('0x1c')]);_0x287690[_0xa131('0x1a')]=qs['offset'](_0x217ab9['query'][_0xa131('0x1a')]);}_0x287690[_0xa131('0x3a')]=qs[_0xa131('0x3b')](_0x217ab9[_0xa131('0x31')]['sort']);_0x287690['where']=qs[_0xa131('0x33')](_[_0xa131('0x3c')](_0x217ab9[_0xa131('0x31')],_0x2b5c8e[_0xa131('0x33')]),_0x36cb53);if(_0x217ab9[_0xa131('0x31')][_0xa131('0x3d')]){_0x287690[_0xa131('0x3e')]=_[_0xa131('0x3f')](_0x287690[_0xa131('0x3e')],{'$or':_['map'](_0x36cb53,function(_0x151bf5){if(_0x151bf5['type']!==_0xa131('0x40')){var _0x2d7dd8={};_0x2d7dd8[_0x151bf5[_0xa131('0x27')]]={'$like':'%'+_0x217ab9[_0xa131('0x31')]['filter']+'%'};return _0x2d7dd8;}})});}_0x287690=_[_0xa131('0x3f')]({},_0x287690,_0x217ab9[_0xa131('0x41')]);var _0x2ae206={'where':_0x287690['where']};return db[_0xa131('0x2a')][_0xa131('0x1d')](_0x2ae206)[_0xa131('0x23')](function(_0x24e63f){_0x567df9[_0xa131('0x1d')]=_0x24e63f;if(_0x217ab9[_0xa131('0x31')][_0xa131('0x42')]){_0x287690[_0xa131('0x43')]=[{'all':!![]}];}return db[_0xa131('0x2a')][_0xa131('0x44')](_0x287690);})[_0xa131('0x23')](function(_0x4f229f){_0x567df9['rows']=_0x4f229f;return _0x567df9;})[_0xa131('0x23')](respondWithFilteredResult(_0x106293,_0x287690))['catch'](handleError(_0x106293,null));};exports[_0xa131('0x45')]=function(_0x23efe6,_0x1ebdf5){var _0x5cc4ef={'raw':![],'where':{'id':_0x23efe6[_0xa131('0x46')]['id']}},_0x31b63a={};_0x31b63a[_0xa131('0x2f')]=_['keys'](db['SalesforceConfiguration'][_0xa131('0x2b')]);_0x31b63a[_0xa131('0x31')]=_[_0xa131('0x32')](_0x23efe6[_0xa131('0x31')]);_0x31b63a[_0xa131('0x33')]=_['intersection'](_0x31b63a[_0xa131('0x2f')],_0x31b63a[_0xa131('0x31')]);_0x5cc4ef[_0xa131('0x35')]=_[_0xa131('0x34')](_0x31b63a['model'],qs[_0xa131('0x36')](_0x23efe6[_0xa131('0x31')]['fields']));_0x5cc4ef[_0xa131('0x35')]=_0x5cc4ef['attributes'][_0xa131('0x37')]?_0x5cc4ef[_0xa131('0x35')]:_0x31b63a[_0xa131('0x2f')];if(_0x23efe6[_0xa131('0x31')][_0xa131('0x42')]){_0x5cc4ef[_0xa131('0x43')]=[{'all':!![]}];}_0x5cc4ef=_['merge']({},_0x5cc4ef,_0x23efe6[_0xa131('0x41')]);return db[_0xa131('0x2a')]['find'](_0x5cc4ef)['then'](handleEntityNotFound(_0x1ebdf5,null))[_0xa131('0x23')](respondWithResult(_0x1ebdf5,null))[_0xa131('0x47')](handleError(_0x1ebdf5,null));};exports['create']=function(_0x439bcf,_0x5bbe52){return db[_0xa131('0x2a')]['create'](_0x439bcf[_0xa131('0x48')],{})[_0xa131('0x23')](respondWithResult(_0x5bbe52,0xc9))['catch'](handleError(_0x5bbe52,null));};exports[_0xa131('0x49')]=function(_0x4ba560,_0x9fd586){if(_0x4ba560['body']['id']){delete _0x4ba560[_0xa131('0x48')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x4ba560['params']['id']}})[_0xa131('0x23')](handleEntityNotFound(_0x9fd586,null))['then'](saveUpdates(_0x4ba560['body'],null))[_0xa131('0x23')](respondWithResult(_0x9fd586,null))[_0xa131('0x47')](handleError(_0x9fd586,null));};exports[_0xa131('0x4a')]=function(_0x437336,_0x403b20){return db[_0xa131('0x2a')][_0xa131('0x4b')]({'where':{'id':_0x437336[_0xa131('0x46')]['id']}})[_0xa131('0x23')](handleEntityNotFound(_0x403b20,null))[_0xa131('0x23')](removeEntity(_0x403b20,null))['catch'](handleError(_0x403b20,null));};exports[_0xa131('0x4c')]=function(_0x13453c,_0x2298c5,_0x5dcfd0){var _0x1b8480={};var _0x53f5d9={};var _0x5677f8;var _0x2bf855;return db[_0xa131('0x2a')]['findOne']({'where':{'id':_0x13453c[_0xa131('0x46')]['id']}})['then'](handleEntityNotFound(_0x2298c5,null))[_0xa131('0x23')](function(_0x5dd57c){if(_0x5dd57c){_0x5677f8=_0x5dd57c;_0x53f5d9[_0xa131('0x2f')]=_[_0xa131('0x32')](db['SalesforceField'][_0xa131('0x2b')]);_0x53f5d9[_0xa131('0x31')]=_[_0xa131('0x32')](_0x13453c['query']);_0x53f5d9[_0xa131('0x33')]=_[_0xa131('0x34')](_0x53f5d9[_0xa131('0x2f')],_0x53f5d9[_0xa131('0x31')]);_0x1b8480[_0xa131('0x35')]=_[_0xa131('0x34')](_0x53f5d9[_0xa131('0x2f')],qs[_0xa131('0x36')](_0x13453c[_0xa131('0x31')][_0xa131('0x36')]));_0x1b8480[_0xa131('0x35')]=_0x1b8480[_0xa131('0x35')][_0xa131('0x37')]?_0x1b8480['attributes']:_0x53f5d9[_0xa131('0x2f')];_0x1b8480[_0xa131('0x3a')]=qs[_0xa131('0x3b')](_0x13453c['query'][_0xa131('0x3b')]);_0x1b8480[_0xa131('0x3e')]=qs[_0xa131('0x33')](_['pick'](_0x13453c['query'],_0x53f5d9[_0xa131('0x33')]));if(_0x13453c[_0xa131('0x31')][_0xa131('0x3d')]){_0x1b8480['where']=_['merge'](_0x1b8480[_0xa131('0x3e')],{'$or':_[_0xa131('0x30')](_0x1b8480[_0xa131('0x35')],function(_0x21922d){var _0xea5b32={};_0xea5b32[_0x21922d]={'$like':'%'+_0x13453c['query'][_0xa131('0x3d')]+'%'};return _0xea5b32;})});}_0x1b8480=_['merge']({},_0x1b8480,_0x13453c[_0xa131('0x41')]);return _0x5677f8[_0xa131('0x4c')](_0x1b8480);}})[_0xa131('0x23')](function(_0x3cd2f5){if(_0x3cd2f5){_0x2bf855=_0x3cd2f5['length'];if(!_0x13453c['query'][_0xa131('0x38')]('nolimit')){_0x1b8480[_0xa131('0x1c')]=qs[_0xa131('0x1c')](_0x13453c['query']['limit']);_0x1b8480['offset']=qs[_0xa131('0x1a')](_0x13453c['query'][_0xa131('0x1a')]);}return _0x5677f8[_0xa131('0x4c')](_0x1b8480);}})[_0xa131('0x23')](function(_0x4c3cf9){if(_0x4c3cf9){return _0x4c3cf9?{'count':_0x2bf855,'rows':_0x4c3cf9}:null;}})['then'](respondWithResult(_0x2298c5,null))[_0xa131('0x47')](handleError(_0x2298c5,null));};exports[_0xa131('0x4d')]=function(_0x4bf420,_0xc18315,_0x5ee2ac){var _0x3e58e6={};var _0x259abd={};var _0x37f3e5;var _0x4fcf7c;return db[_0xa131('0x2a')][_0xa131('0x4e')]({'where':{'id':_0x4bf420[_0xa131('0x46')]['id']}})[_0xa131('0x23')](handleEntityNotFound(_0xc18315,null))['then'](function(_0x1c4aec){if(_0x1c4aec){_0x37f3e5=_0x1c4aec;_0x259abd['model']=_[_0xa131('0x32')](db['SalesforceField'][_0xa131('0x2b')]);_0x259abd['query']=_[_0xa131('0x32')](_0x4bf420[_0xa131('0x31')]);_0x259abd['filters']=_[_0xa131('0x34')](_0x259abd[_0xa131('0x2f')],_0x259abd['query']);_0x3e58e6[_0xa131('0x35')]=_[_0xa131('0x34')](_0x259abd[_0xa131('0x2f')],qs[_0xa131('0x36')](_0x4bf420[_0xa131('0x31')][_0xa131('0x36')]));_0x3e58e6[_0xa131('0x35')]=_0x3e58e6[_0xa131('0x35')][_0xa131('0x37')]?_0x3e58e6[_0xa131('0x35')]:_0x259abd[_0xa131('0x2f')];_0x3e58e6[_0xa131('0x3a')]=qs['sort'](_0x4bf420[_0xa131('0x31')][_0xa131('0x3b')]);_0x3e58e6[_0xa131('0x3e')]=qs[_0xa131('0x33')](_['pick'](_0x4bf420[_0xa131('0x31')],_0x259abd['filters']));if(_0x4bf420[_0xa131('0x31')][_0xa131('0x3d')]){_0x3e58e6[_0xa131('0x3e')]=_['merge'](_0x3e58e6[_0xa131('0x3e')],{'$or':_[_0xa131('0x30')](_0x3e58e6[_0xa131('0x35')],function(_0x283422){var _0x412acf={};_0x412acf[_0x283422]={'$like':'%'+_0x4bf420[_0xa131('0x31')]['filter']+'%'};return _0x412acf;})});}_0x3e58e6=_[_0xa131('0x3f')]({},_0x3e58e6,_0x4bf420[_0xa131('0x41')]);return _0x37f3e5[_0xa131('0x4d')](_0x3e58e6);}})[_0xa131('0x23')](function(_0x15e4f8){if(_0x15e4f8){_0x4fcf7c=_0x15e4f8['length'];if(!_0x4bf420['query'][_0xa131('0x38')](_0xa131('0x39'))){_0x3e58e6[_0xa131('0x1c')]=qs['limit'](_0x4bf420['query'][_0xa131('0x1c')]);_0x3e58e6['offset']=qs['offset'](_0x4bf420[_0xa131('0x31')]['offset']);}return _0x37f3e5['getSubjects'](_0x3e58e6);}})[_0xa131('0x23')](function(_0x1071a0){if(_0x1071a0){return _0x1071a0?{'count':_0x4fcf7c,'rows':_0x1071a0}:null;}})[_0xa131('0x23')](respondWithResult(_0xc18315,null))[_0xa131('0x47')](handleError(_0xc18315,null));};exports[_0xa131('0x4f')]=function(_0x52f7d0,_0x3493fb,_0x51ae9d){var _0x28e6ac={};var _0x13d26f={};var _0x4c6810;var _0x16d0da;return db['SalesforceConfiguration'][_0xa131('0x4e')]({'where':{'id':_0x52f7d0[_0xa131('0x46')]['id']}})[_0xa131('0x23')](handleEntityNotFound(_0x3493fb,null))[_0xa131('0x23')](function(_0x1b67d9){if(_0x1b67d9){_0x4c6810=_0x1b67d9;_0x13d26f[_0xa131('0x2f')]=_[_0xa131('0x32')](db['SalesforceField'][_0xa131('0x2b')]);_0x13d26f[_0xa131('0x31')]=_[_0xa131('0x32')](_0x52f7d0[_0xa131('0x31')]);_0x13d26f['filters']=_[_0xa131('0x34')](_0x13d26f[_0xa131('0x2f')],_0x13d26f[_0xa131('0x31')]);_0x28e6ac[_0xa131('0x35')]=_[_0xa131('0x34')](_0x13d26f[_0xa131('0x2f')],qs[_0xa131('0x36')](_0x52f7d0[_0xa131('0x31')][_0xa131('0x36')]));_0x28e6ac[_0xa131('0x35')]=_0x28e6ac[_0xa131('0x35')][_0xa131('0x37')]?_0x28e6ac[_0xa131('0x35')]:_0x13d26f[_0xa131('0x2f')];_0x28e6ac[_0xa131('0x3a')]=qs[_0xa131('0x3b')](_0x52f7d0[_0xa131('0x31')][_0xa131('0x3b')]);_0x28e6ac['where']=qs[_0xa131('0x33')](_[_0xa131('0x3c')](_0x52f7d0[_0xa131('0x31')],_0x13d26f[_0xa131('0x33')]));if(_0x52f7d0[_0xa131('0x31')][_0xa131('0x3d')]){_0x28e6ac[_0xa131('0x3e')]=_['merge'](_0x28e6ac['where'],{'$or':_['map'](_0x28e6ac[_0xa131('0x35')],function(_0x5db015){var _0x4489d1={};_0x4489d1[_0x5db015]={'$like':'%'+_0x52f7d0['query'][_0xa131('0x3d')]+'%'};return _0x4489d1;})});}_0x28e6ac=_[_0xa131('0x3f')]({},_0x28e6ac,_0x52f7d0[_0xa131('0x41')]);return _0x4c6810['getDescriptions'](_0x28e6ac);}})[_0xa131('0x23')](function(_0x436daa){if(_0x436daa){_0x16d0da=_0x436daa[_0xa131('0x37')];if(!_0x52f7d0[_0xa131('0x31')][_0xa131('0x38')](_0xa131('0x39'))){_0x28e6ac[_0xa131('0x1c')]=qs[_0xa131('0x1c')](_0x52f7d0[_0xa131('0x31')]['limit']);_0x28e6ac[_0xa131('0x1a')]=qs[_0xa131('0x1a')](_0x52f7d0[_0xa131('0x31')][_0xa131('0x1a')]);}return _0x4c6810[_0xa131('0x4f')](_0x28e6ac);}})['then'](function(_0x3b7624){if(_0x3b7624){return _0x3b7624?{'count':_0x16d0da,'rows':_0x3b7624}:null;}})[_0xa131('0x23')](respondWithResult(_0x3493fb,null))[_0xa131('0x47')](handleError(_0x3493fb,null));};
\ No newline at end of file
index 6a36ff1..2e5b58d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92d0=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x92d0,0x1a4));var _0x092d=function(_0xaf025d,_0x586d7a){_0xaf025d=_0xaf025d-0x0;var _0x1c77cb=_0x92d0[_0xaf025d];return _0x1c77cb;};'use strict';var _=require(_0x092d('0x0'));var util=require(_0x092d('0x1'));var logger=require(_0x092d('0x2'))(_0x092d('0x3'));var moment=require(_0x092d('0x4'));var BPromise=require(_0x092d('0x5'));var rp=require(_0x092d('0x6'));var fs=require('fs');var path=require(_0x092d('0x7'));var rimraf=require(_0x092d('0x8'));var config=require(_0x092d('0x9'));var attributes=require(_0x092d('0xa'));module['exports']=function(_0x2aa973,_0x1bf22){return _0x2aa973[_0x092d('0xb')](_0x092d('0xc'),attributes,{'tableName':_0x092d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x40b3=['SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x176847,_0x4d1636){var _0x222aca=function(_0x316851){while(--_0x316851){_0x176847['push'](_0x176847['shift']());}};_0x222aca(++_0x4d1636);}(_0x40b3,0x1bb));var _0x340b=function(_0xdad237,_0x361a1d){_0xdad237=_0xdad237-0x0;var _0x15c575=_0x40b3[_0xdad237];return _0x15c575;};'use strict';var _=require(_0x340b('0x0'));var util=require(_0x340b('0x1'));var logger=require(_0x340b('0x2'))(_0x340b('0x3'));var moment=require(_0x340b('0x4'));var BPromise=require('bluebird');var rp=require(_0x340b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x340b('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x376722,_0x54f2ef){return _0x376722['define'](_0x340b('0x7'),attributes,{'tableName':_0x340b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d8405fa..b8f566e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f18=['result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0x2f18,0xd1));var _0x82f1=function(_0x545d0e,_0x2ca81e){_0x545d0e=_0x545d0e-0x0;var _0x41d707=_0x2f18[_0x545d0e];return _0x41d707;};'use strict';var _=require(_0x82f1('0x0'));var util=require(_0x82f1('0x1'));var moment=require(_0x82f1('0x2'));var BPromise=require('bluebird');var rs=require(_0x82f1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f1('0x5'))(_0x82f1('0x6'));var config=require(_0x82f1('0x7'));var jayson=require(_0x82f1('0x8'));var client=jayson[_0x82f1('0x9')][_0x82f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37ebd8,_0x33bde6,_0x4d9041){return new BPromise(function(_0x4e2b48,_0x230f4d){return client['request'](_0x37ebd8,_0x4d9041)[_0x82f1('0xb')](function(_0x59cf41){logger[_0x82f1('0xc')](_0x82f1('0xd'),_0x33bde6,_0x82f1('0xe'));logger[_0x82f1('0xf')](_0x82f1('0x10'),_0x33bde6,_0x82f1('0xe'),JSON[_0x82f1('0x11')](_0x59cf41));if(_0x59cf41[_0x82f1('0x12')]){if(_0x59cf41['error'][_0x82f1('0x13')]===0x1f4){logger[_0x82f1('0x12')](_0x82f1('0xd'),_0x33bde6,_0x59cf41[_0x82f1('0x12')][_0x82f1('0x14')]);return _0x230f4d(_0x59cf41[_0x82f1('0x12')]['message']);}logger[_0x82f1('0x12')](_0x82f1('0xd'),_0x33bde6,_0x59cf41[_0x82f1('0x12')][_0x82f1('0x14')]);return _0x4e2b48(_0x59cf41[_0x82f1('0x12')][_0x82f1('0x14')]);}else{logger[_0x82f1('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x33bde6,_0x82f1('0xe'));_0x4e2b48(_0x59cf41[_0x82f1('0x15')][_0x82f1('0x14')]);}})[_0x82f1('0x16')](function(_0x507851){logger[_0x82f1('0x12')](_0x82f1('0xd'),_0x33bde6,_0x507851);_0x230f4d(_0x507851);});});}
\ No newline at end of file
+var _0xc483=['code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x40fe76,_0x2c31ff){var _0x4deb03=function(_0x484302){while(--_0x484302){_0x40fe76['push'](_0x40fe76['shift']());}};_0x4deb03(++_0x2c31ff);}(_0xc483,0xca));var _0x3c48=function(_0x3bbff2,_0x14d540){_0x3bbff2=_0x3bbff2-0x0;var _0x360d09=_0xc483[_0x3bbff2];return _0x360d09;};'use strict';var _=require(_0x3c48('0x0'));var util=require('util');var moment=require(_0x3c48('0x1'));var BPromise=require(_0x3c48('0x2'));var rs=require(_0x3c48('0x3'));var fs=require('fs');var Redis=require(_0x3c48('0x4'));var db=require(_0x3c48('0x5'))['db'];var utils=require(_0x3c48('0x6'));var logger=require(_0x3c48('0x7'))(_0x3c48('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c48('0x9')][_0x3c48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x549e81,_0x5f3507,_0x109608){return new BPromise(function(_0x324f67,_0x394605){return client['request'](_0x549e81,_0x109608)[_0x3c48('0xb')](function(_0x52ac45){logger['info'](_0x3c48('0xc'),_0x5f3507,_0x3c48('0xd'));logger[_0x3c48('0xe')](_0x3c48('0xf'),_0x5f3507,_0x3c48('0xd'),JSON[_0x3c48('0x10')](_0x52ac45));if(_0x52ac45['error']){if(_0x52ac45[_0x3c48('0x11')][_0x3c48('0x12')]===0x1f4){logger[_0x3c48('0x11')](_0x3c48('0xc'),_0x5f3507,_0x52ac45[_0x3c48('0x11')][_0x3c48('0x13')]);return _0x394605(_0x52ac45['error'][_0x3c48('0x13')]);}logger['error'](_0x3c48('0xc'),_0x5f3507,_0x52ac45['error'][_0x3c48('0x13')]);return _0x324f67(_0x52ac45['error']['message']);}else{logger[_0x3c48('0x14')](_0x3c48('0xc'),_0x5f3507,'request\x20sent');_0x324f67(_0x52ac45['result']['message']);}})[_0x3c48('0x15')](function(_0x1e561d){logger['error'](_0x3c48('0xc'),_0x5f3507,_0x1e561d);_0x394605(_0x1e561d);});});}
\ No newline at end of file
index 9abdb04..e8535e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bf2=['../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','post','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x1bf2,0x13d));var _0x21bf=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x1bf2[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x21bf('0x0'));var util=require(_0x21bf('0x1'));var path=require(_0x21bf('0x2'));var timeout=require('connect-timeout');var express=require(_0x21bf('0x3'));var router=express['Router']();var fs_extra=require(_0x21bf('0x4'));var auth=require(_0x21bf('0x5'));var interaction=require(_0x21bf('0x6'));var config=require(_0x21bf('0x7'));var controller=require(_0x21bf('0x8'));router['get']('/',auth[_0x21bf('0x9')](),controller[_0x21bf('0xa')]);router[_0x21bf('0xb')](_0x21bf('0xc'),auth[_0x21bf('0x9')](),controller['show']);router[_0x21bf('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x21bf('0xe')](_0x21bf('0xc'),auth[_0x21bf('0x9')](),controller[_0x21bf('0xf')]);router[_0x21bf('0x10')]('/:id',auth[_0x21bf('0x9')](),controller[_0x21bf('0x11')]);module[_0x21bf('0x12')]=router;
\ No newline at end of file
+var _0x6347=['/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x206510,_0x170973){var _0x87aba=function(_0x116e8e){while(--_0x116e8e){_0x206510['push'](_0x206510['shift']());}};_0x87aba(++_0x170973);}(_0x6347,0x1e7));var _0x7634=function(_0xf68976,_0x281911){_0xf68976=_0xf68976-0x0;var _0x27bd19=_0x6347[_0xf68976];return _0x27bd19;};'use strict';var multer=require(_0x7634('0x0'));var util=require(_0x7634('0x1'));var path=require(_0x7634('0x2'));var timeout=require(_0x7634('0x3'));var express=require(_0x7634('0x4'));var router=express[_0x7634('0x5')]();var fs_extra=require(_0x7634('0x6'));var auth=require(_0x7634('0x7'));var interaction=require(_0x7634('0x8'));var config=require(_0x7634('0x9'));var controller=require('./intSalesforceField.controller');router[_0x7634('0xa')]('/',auth[_0x7634('0xb')](),controller[_0x7634('0xc')]);router[_0x7634('0xa')](_0x7634('0xd'),auth['isAuthenticated'](),controller[_0x7634('0xe')]);router['post']('/',auth[_0x7634('0xb')](),controller[_0x7634('0xf')]);router['put'](_0x7634('0xd'),auth[_0x7634('0xb')](),controller[_0x7634('0x10')]);router[_0x7634('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7634('0x12')]);module[_0x7634('0x13')]=router;
\ No newline at end of file
index 909843e..14742b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x968f=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x1e177a,_0xadba47){var _0x4812de=function(_0x350e89){while(--_0x350e89){_0x1e177a['push'](_0x1e177a['shift']());}};_0x4812de(++_0xadba47);}(_0x968f,0xc9));var _0xf968=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x968f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf968('0x0'));module[_0xf968('0x1')]={'type':{'type':Sequelize[_0xf968('0x2')](_0xf968('0x3'),_0xf968('0x4'),_0xf968('0x5'),_0xf968('0x6'),_0xf968('0x7')),'defaultValue':_0xf968('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf968('0x8')]},'keyType':{'type':Sequelize[_0xf968('0x2')](_0xf968('0x3'),_0xf968('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xf968('0x8')]},'idField':{'type':Sequelize[_0xf968('0x8')]},'variableName':{'type':Sequelize[_0xf968('0x8')]}};
\ No newline at end of file
+var _0x6cd5=['variable','customVariable','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x26f2a6,_0x244d5f){var _0x11ee7a=function(_0x2acbaf){while(--_0x2acbaf){_0x26f2a6['push'](_0x26f2a6['shift']());}};_0x11ee7a(++_0x244d5f);}(_0x6cd5,0x144));var _0x56cd=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x6cd5[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x56cd('0x0'));module[_0x56cd('0x1')]={'type':{'type':Sequelize[_0x56cd('0x2')](_0x56cd('0x3'),_0x56cd('0x4'),_0x56cd('0x5'),'keyValue',_0x56cd('0x6')),'defaultValue':_0x56cd('0x3')},'content':{'type':Sequelize[_0x56cd('0x7')]},'key':{'type':Sequelize[_0x56cd('0x7')]},'keyType':{'type':Sequelize[_0x56cd('0x2')](_0x56cd('0x3'),_0x56cd('0x4'),_0x56cd('0x5'))},'keyContent':{'type':Sequelize[_0x56cd('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x56cd('0x7')]}};
\ No newline at end of file
index ac742d5..db77b72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf27a=['findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','map','SalesforceField','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','options','includeAll','include'];(function(_0x58235f,_0x5e3186){var _0x461ccc=function(_0x3c4409){while(--_0x3c4409){_0x58235f['push'](_0x58235f['shift']());}};_0x461ccc(++_0x5e3186);}(_0xf27a,0x18f));var _0xaf27=function(_0x3093b5,_0x442743){_0x3093b5=_0x3093b5-0x0;var _0x4b0cac=_0xf27a[_0x3093b5];return _0x4b0cac;};'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(_0xaf27('0x7'));var util=require(_0xaf27('0x8'));var path=require(_0xaf27('0x9'));var sox=require(_0xaf27('0xa'));var csv=require(_0xaf27('0xb'));var ejs=require(_0xaf27('0xc'));var fs=require('fs');var fs_extra=require(_0xaf27('0xd'));var _=require(_0xaf27('0xe'));var squel=require(_0xaf27('0xf'));var crypto=require(_0xaf27('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xaf27('0x11'));var toCsv=require('to-csv');var querystring=require(_0xaf27('0x12'));var Papa=require(_0xaf27('0x13'));var Redis=require(_0xaf27('0x14'));var authService=require(_0xaf27('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf27('0x16'))(_0xaf27('0x17'));var utils=require(_0xaf27('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xaf27('0x19'));var db=require(_0xaf27('0x1a'))['db'];function respondWithStatusCode(_0x430860,_0x54b0a0){_0x54b0a0=_0x54b0a0||0xcc;return function(_0x4d8b28){if(_0x4d8b28){return _0x430860[_0xaf27('0x1b')](_0x54b0a0);}return _0x430860[_0xaf27('0x1c')](_0x54b0a0)[_0xaf27('0x1d')]();};}function respondWithResult(_0x46764d,_0x4aa95f){_0x4aa95f=_0x4aa95f||0xc8;return function(_0x82fcd6){if(_0x82fcd6){return _0x46764d['status'](_0x4aa95f)[_0xaf27('0x1e')](_0x82fcd6);}};}function respondWithFilteredResult(_0x5a1347,_0x353573){return function(_0x4344e2){if(_0x4344e2){var _0x3c85ce=typeof _0x353573[_0xaf27('0x1f')]===_0xaf27('0x20')&&typeof _0x353573[_0xaf27('0x21')]===_0xaf27('0x20');var _0x4b841e=_0x4344e2[_0xaf27('0x22')];var _0x444711=_0x3c85ce?0x0:_0x353573[_0xaf27('0x1f')];var _0x5dc8d1=_0x3c85ce?_0x4344e2['count']:_0x353573[_0xaf27('0x1f')]+_0x353573[_0xaf27('0x21')];var _0x4bf2ca;if(_0x5dc8d1>=_0x4b841e){_0x5dc8d1=_0x4b841e;_0x4bf2ca=0xc8;}else{_0x4bf2ca=0xce;}_0x5a1347['status'](_0x4bf2ca);return _0x5a1347[_0xaf27('0x23')](_0xaf27('0x24'),_0x444711+'-'+_0x5dc8d1+'/'+_0x4b841e)['json'](_0x4344e2);}return null;};}function patchUpdates(_0x19827c){return function(_0x39000c){try{jsonpatch[_0xaf27('0x25')](_0x39000c,_0x19827c,!![]);}catch(_0x5dd650){return BPromise[_0xaf27('0x26')](_0x5dd650);}return _0x39000c['save']();};}function saveUpdates(_0x327e67,_0x582ae3){return function(_0x274e0e){if(_0x274e0e){return _0x274e0e[_0xaf27('0x27')](_0x327e67)['then'](function(_0xa3ea29){return _0xa3ea29;});}return null;};}function removeEntity(_0x304305,_0x1036f0){return function(_0x2050db){if(_0x2050db){return _0x2050db[_0xaf27('0x28')]()[_0xaf27('0x29')](function(){_0x304305[_0xaf27('0x1c')](0xcc)[_0xaf27('0x1d')]();});}};}function handleEntityNotFound(_0x2f0ff1,_0x3eb7d8){return function(_0x1883d3){if(!_0x1883d3){_0x2f0ff1[_0xaf27('0x1b')](0x194);}return _0x1883d3;};}function handleError(_0xeb786f,_0x1246c7){_0x1246c7=_0x1246c7||0x1f4;return function(_0x5c9539){logger[_0xaf27('0x2a')](_0x5c9539[_0xaf27('0x2b')]);if(_0x5c9539[_0xaf27('0x2c')]){delete _0x5c9539['name'];}_0xeb786f[_0xaf27('0x1c')](_0x1246c7)[_0xaf27('0x2d')](_0x5c9539);};}exports['index']=function(_0x27910f,_0x5bed3d){var _0x566696={},_0x33a35c={},_0x25f299={'count':0x0,'rows':[]};var _0x54721=_[_0xaf27('0x2e')](db[_0xaf27('0x2f')]['rawAttributes'],function(_0x370ce4){return{'name':_0x370ce4[_0xaf27('0x30')],'type':_0x370ce4['type'][_0xaf27('0x31')]};});_0x33a35c[_0xaf27('0x32')]=_['map'](_0x54721,'name');_0x33a35c[_0xaf27('0x33')]=_[_0xaf27('0x34')](_0x27910f['query']);_0x33a35c['filters']=_[_0xaf27('0x35')](_0x33a35c[_0xaf27('0x32')],_0x33a35c[_0xaf27('0x33')]);_0x566696[_0xaf27('0x36')]=_[_0xaf27('0x35')](_0x33a35c[_0xaf27('0x32')],qs[_0xaf27('0x37')](_0x27910f[_0xaf27('0x33')][_0xaf27('0x37')]));_0x566696[_0xaf27('0x36')]=_0x566696[_0xaf27('0x36')]['length']?_0x566696['attributes']:_0x33a35c['model'];if(!_0x27910f[_0xaf27('0x33')][_0xaf27('0x38')](_0xaf27('0x39'))){_0x566696[_0xaf27('0x21')]=qs[_0xaf27('0x21')](_0x27910f[_0xaf27('0x33')][_0xaf27('0x21')]);_0x566696[_0xaf27('0x1f')]=qs[_0xaf27('0x1f')](_0x27910f[_0xaf27('0x33')][_0xaf27('0x1f')]);}_0x566696[_0xaf27('0x3a')]=qs[_0xaf27('0x3b')](_0x27910f[_0xaf27('0x33')][_0xaf27('0x3b')]);_0x566696['where']=qs['filters'](_[_0xaf27('0x3c')](_0x27910f[_0xaf27('0x33')],_0x33a35c[_0xaf27('0x3d')]),_0x54721);if(_0x27910f['query'][_0xaf27('0x3e')]){_0x566696[_0xaf27('0x3f')]=_[_0xaf27('0x40')](_0x566696[_0xaf27('0x3f')],{'$or':_[_0xaf27('0x2e')](_0x54721,function(_0x40900b){if(_0x40900b[_0xaf27('0x41')]!=='VIRTUAL'){var _0x79daf7={};_0x79daf7[_0x40900b[_0xaf27('0x2c')]]={'$like':'%'+_0x27910f[_0xaf27('0x33')][_0xaf27('0x3e')]+'%'};return _0x79daf7;}})});}_0x566696=_[_0xaf27('0x40')]({},_0x566696,_0x27910f[_0xaf27('0x42')]);var _0xbc1e15={'where':_0x566696['where']};return db[_0xaf27('0x2f')][_0xaf27('0x22')](_0xbc1e15)[_0xaf27('0x29')](function(_0x359a86){_0x25f299['count']=_0x359a86;if(_0x27910f['query'][_0xaf27('0x43')]){_0x566696[_0xaf27('0x44')]=[{'all':!![]}];}return db['SalesforceField'][_0xaf27('0x45')](_0x566696);})[_0xaf27('0x29')](function(_0x223f33){_0x25f299[_0xaf27('0x46')]=_0x223f33;return _0x25f299;})[_0xaf27('0x29')](respondWithFilteredResult(_0x5bed3d,_0x566696))['catch'](handleError(_0x5bed3d,null));};exports[_0xaf27('0x47')]=function(_0x28dbad,_0x54238c){var _0xbe97a5={'raw':!![],'where':{'id':_0x28dbad[_0xaf27('0x48')]['id']}},_0x44a536={};_0x44a536[_0xaf27('0x32')]=_[_0xaf27('0x34')](db['SalesforceField'][_0xaf27('0x49')]);_0x44a536[_0xaf27('0x33')]=_[_0xaf27('0x34')](_0x28dbad[_0xaf27('0x33')]);_0x44a536[_0xaf27('0x3d')]=_[_0xaf27('0x35')](_0x44a536[_0xaf27('0x32')],_0x44a536['query']);_0xbe97a5[_0xaf27('0x36')]=_['intersection'](_0x44a536['model'],qs[_0xaf27('0x37')](_0x28dbad['query'][_0xaf27('0x37')]));_0xbe97a5[_0xaf27('0x36')]=_0xbe97a5[_0xaf27('0x36')]['length']?_0xbe97a5[_0xaf27('0x36')]:_0x44a536[_0xaf27('0x32')];if(_0x28dbad['query'][_0xaf27('0x43')]){_0xbe97a5[_0xaf27('0x44')]=[{'all':!![]}];}_0xbe97a5=_['merge']({},_0xbe97a5,_0x28dbad[_0xaf27('0x42')]);return db[_0xaf27('0x2f')][_0xaf27('0x4a')](_0xbe97a5)[_0xaf27('0x29')](handleEntityNotFound(_0x54238c,null))[_0xaf27('0x29')](respondWithResult(_0x54238c,null))[_0xaf27('0x4b')](handleError(_0x54238c,null));};exports[_0xaf27('0x4c')]=function(_0x3ed63f,_0x51bb17){return db[_0xaf27('0x2f')]['create'](_0x3ed63f[_0xaf27('0x4d')],{})['then'](respondWithResult(_0x51bb17,0xc9))['catch'](handleError(_0x51bb17,null));};exports[_0xaf27('0x27')]=function(_0x588365,_0x2c23d4){if(_0x588365[_0xaf27('0x4d')]['id']){delete _0x588365['body']['id'];}return db[_0xaf27('0x2f')][_0xaf27('0x4a')]({'where':{'id':_0x588365[_0xaf27('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c23d4,null))['then'](saveUpdates(_0x588365['body'],null))['then'](respondWithResult(_0x2c23d4,null))['catch'](handleError(_0x2c23d4,null));};exports[_0xaf27('0x28')]=function(_0x2f9068,_0x1e5109){return db[_0xaf27('0x2f')][_0xaf27('0x4a')]({'where':{'id':_0x2f9068[_0xaf27('0x48')]['id']}})[_0xaf27('0x29')](handleEntityNotFound(_0x1e5109,null))[_0xaf27('0x29')](removeEntity(_0x1e5109,null))[_0xaf27('0x4b')](handleError(_0x1e5109,null));};
\ No newline at end of file
+var _0xa775=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','reject','save','then','error','stack','name','index','map','SalesforceField','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa775,0xf6));var _0x5a77=function(_0x64539e,_0x1dc617){_0x64539e=_0x64539e-0x0;var _0x4f9db6=_0xa775[_0x64539e];return _0x4f9db6;};'use strict';var emlformat=require(_0x5a77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a77('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5a77('0x2'));var BPromise=require(_0x5a77('0x3'));var Mustache=require(_0x5a77('0x4'));var util=require(_0x5a77('0x5'));var path=require('path');var sox=require(_0x5a77('0x6'));var csv=require(_0x5a77('0x7'));var ejs=require(_0x5a77('0x8'));var fs=require('fs');var fs_extra=require(_0x5a77('0x9'));var _=require(_0x5a77('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a77('0x7'));var querystring=require(_0x5a77('0xb'));var Papa=require(_0x5a77('0xc'));var Redis=require(_0x5a77('0xd'));var authService=require(_0x5a77('0xe'));var qs=require(_0x5a77('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a77('0x10'));var logger=require(_0x5a77('0x11'))('api');var utils=require(_0x5a77('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5a77('0x13'));var db=require(_0x5a77('0x14'))['db'];function respondWithStatusCode(_0x1767cf,_0x1c6431){_0x1c6431=_0x1c6431||0xcc;return function(_0x39efe1){if(_0x39efe1){return _0x1767cf[_0x5a77('0x15')](_0x1c6431);}return _0x1767cf['status'](_0x1c6431)[_0x5a77('0x16')]();};}function respondWithResult(_0x426dca,_0x1bce83){_0x1bce83=_0x1bce83||0xc8;return function(_0x20c918){if(_0x20c918){return _0x426dca['status'](_0x1bce83)[_0x5a77('0x17')](_0x20c918);}};}function respondWithFilteredResult(_0x371a14,_0x4fcc0c){return function(_0x8eafae){if(_0x8eafae){var _0x263dfc=typeof _0x4fcc0c[_0x5a77('0x18')]==='undefined'&&typeof _0x4fcc0c[_0x5a77('0x19')]===_0x5a77('0x1a');var _0x1e5737=_0x8eafae[_0x5a77('0x1b')];var _0x5628e2=_0x263dfc?0x0:_0x4fcc0c[_0x5a77('0x18')];var _0x53c754=_0x263dfc?_0x8eafae[_0x5a77('0x1b')]:_0x4fcc0c[_0x5a77('0x18')]+_0x4fcc0c[_0x5a77('0x19')];var _0x1ee993;if(_0x53c754>=_0x1e5737){_0x53c754=_0x1e5737;_0x1ee993=0xc8;}else{_0x1ee993=0xce;}_0x371a14[_0x5a77('0x1c')](_0x1ee993);return _0x371a14['set']('Content-Range',_0x5628e2+'-'+_0x53c754+'/'+_0x1e5737)[_0x5a77('0x17')](_0x8eafae);}return null;};}function patchUpdates(_0x2271c3){return function(_0x1ff5ec){try{jsonpatch['apply'](_0x1ff5ec,_0x2271c3,!![]);}catch(_0x47b333){return BPromise[_0x5a77('0x1d')](_0x47b333);}return _0x1ff5ec[_0x5a77('0x1e')]();};}function saveUpdates(_0x22a9d5,_0x3a4c3b){return function(_0x204a96){if(_0x204a96){return _0x204a96['update'](_0x22a9d5)[_0x5a77('0x1f')](function(_0x3dc430){return _0x3dc430;});}return null;};}function removeEntity(_0x5db7a2,_0x2439d4){return function(_0x179589){if(_0x179589){return _0x179589['destroy']()[_0x5a77('0x1f')](function(){_0x5db7a2[_0x5a77('0x1c')](0xcc)[_0x5a77('0x16')]();});}};}function handleEntityNotFound(_0x49d0d9,_0x24e89d){return function(_0x3fc1c2){if(!_0x3fc1c2){_0x49d0d9[_0x5a77('0x15')](0x194);}return _0x3fc1c2;};}function handleError(_0x1aa032,_0x2b8a3e){_0x2b8a3e=_0x2b8a3e||0x1f4;return function(_0x2cdb03){logger[_0x5a77('0x20')](_0x2cdb03[_0x5a77('0x21')]);if(_0x2cdb03[_0x5a77('0x22')]){delete _0x2cdb03[_0x5a77('0x22')];}_0x1aa032[_0x5a77('0x1c')](_0x2b8a3e)['send'](_0x2cdb03);};}exports[_0x5a77('0x23')]=function(_0x45119e,_0x1dd0b5){var _0x54d317={},_0x48e547={},_0x5dadc7={'count':0x0,'rows':[]};var _0x4cbf4e=_[_0x5a77('0x24')](db[_0x5a77('0x25')]['rawAttributes'],function(_0xfbeef3){return{'name':_0xfbeef3['fieldName'],'type':_0xfbeef3[_0x5a77('0x26')][_0x5a77('0x27')]};});_0x48e547['model']=_['map'](_0x4cbf4e,_0x5a77('0x22'));_0x48e547[_0x5a77('0x28')]=_[_0x5a77('0x29')](_0x45119e[_0x5a77('0x28')]);_0x48e547[_0x5a77('0x2a')]=_[_0x5a77('0x2b')](_0x48e547[_0x5a77('0x2c')],_0x48e547[_0x5a77('0x28')]);_0x54d317['attributes']=_[_0x5a77('0x2b')](_0x48e547[_0x5a77('0x2c')],qs[_0x5a77('0x2d')](_0x45119e['query'][_0x5a77('0x2d')]));_0x54d317[_0x5a77('0x2e')]=_0x54d317['attributes'][_0x5a77('0x2f')]?_0x54d317[_0x5a77('0x2e')]:_0x48e547[_0x5a77('0x2c')];if(!_0x45119e['query'][_0x5a77('0x30')]('nolimit')){_0x54d317[_0x5a77('0x19')]=qs['limit'](_0x45119e[_0x5a77('0x28')][_0x5a77('0x19')]);_0x54d317[_0x5a77('0x18')]=qs[_0x5a77('0x18')](_0x45119e['query'][_0x5a77('0x18')]);}_0x54d317[_0x5a77('0x31')]=qs['sort'](_0x45119e['query']['sort']);_0x54d317['where']=qs[_0x5a77('0x2a')](_[_0x5a77('0x32')](_0x45119e['query'],_0x48e547[_0x5a77('0x2a')]),_0x4cbf4e);if(_0x45119e[_0x5a77('0x28')][_0x5a77('0x33')]){_0x54d317[_0x5a77('0x34')]=_[_0x5a77('0x35')](_0x54d317[_0x5a77('0x34')],{'$or':_[_0x5a77('0x24')](_0x4cbf4e,function(_0x887e8c){if(_0x887e8c[_0x5a77('0x26')]!==_0x5a77('0x36')){var _0x42d4eb={};_0x42d4eb[_0x887e8c[_0x5a77('0x22')]]={'$like':'%'+_0x45119e[_0x5a77('0x28')][_0x5a77('0x33')]+'%'};return _0x42d4eb;}})});}_0x54d317=_[_0x5a77('0x35')]({},_0x54d317,_0x45119e[_0x5a77('0x37')]);var _0x4d8ce9={'where':_0x54d317[_0x5a77('0x34')]};return db[_0x5a77('0x25')][_0x5a77('0x1b')](_0x4d8ce9)['then'](function(_0x1eb4d6){_0x5dadc7[_0x5a77('0x1b')]=_0x1eb4d6;if(_0x45119e[_0x5a77('0x28')][_0x5a77('0x38')]){_0x54d317[_0x5a77('0x39')]=[{'all':!![]}];}return db[_0x5a77('0x25')][_0x5a77('0x3a')](_0x54d317);})[_0x5a77('0x1f')](function(_0xf52b83){_0x5dadc7[_0x5a77('0x3b')]=_0xf52b83;return _0x5dadc7;})['then'](respondWithFilteredResult(_0x1dd0b5,_0x54d317))[_0x5a77('0x3c')](handleError(_0x1dd0b5,null));};exports['show']=function(_0x4269f0,_0x38c6e3){var _0xda875={'raw':!![],'where':{'id':_0x4269f0[_0x5a77('0x3d')]['id']}},_0x27a450={};_0x27a450[_0x5a77('0x2c')]=_['keys'](db['SalesforceField'][_0x5a77('0x3e')]);_0x27a450[_0x5a77('0x28')]=_['keys'](_0x4269f0['query']);_0x27a450[_0x5a77('0x2a')]=_[_0x5a77('0x2b')](_0x27a450[_0x5a77('0x2c')],_0x27a450[_0x5a77('0x28')]);_0xda875[_0x5a77('0x2e')]=_['intersection'](_0x27a450[_0x5a77('0x2c')],qs[_0x5a77('0x2d')](_0x4269f0[_0x5a77('0x28')][_0x5a77('0x2d')]));_0xda875['attributes']=_0xda875[_0x5a77('0x2e')][_0x5a77('0x2f')]?_0xda875[_0x5a77('0x2e')]:_0x27a450['model'];if(_0x4269f0['query'][_0x5a77('0x38')]){_0xda875['include']=[{'all':!![]}];}_0xda875=_[_0x5a77('0x35')]({},_0xda875,_0x4269f0[_0x5a77('0x37')]);return db[_0x5a77('0x25')][_0x5a77('0x3f')](_0xda875)[_0x5a77('0x1f')](handleEntityNotFound(_0x38c6e3,null))[_0x5a77('0x1f')](respondWithResult(_0x38c6e3,null))[_0x5a77('0x3c')](handleError(_0x38c6e3,null));};exports[_0x5a77('0x40')]=function(_0x35a252,_0x1a15d0){return db[_0x5a77('0x25')]['create'](_0x35a252[_0x5a77('0x41')],{})[_0x5a77('0x1f')](respondWithResult(_0x1a15d0,0xc9))[_0x5a77('0x3c')](handleError(_0x1a15d0,null));};exports['update']=function(_0x3ec766,_0x3db645){if(_0x3ec766[_0x5a77('0x41')]['id']){delete _0x3ec766['body']['id'];}return db[_0x5a77('0x25')]['find']({'where':{'id':_0x3ec766[_0x5a77('0x3d')]['id']}})[_0x5a77('0x1f')](handleEntityNotFound(_0x3db645,null))[_0x5a77('0x1f')](saveUpdates(_0x3ec766[_0x5a77('0x41')],null))[_0x5a77('0x1f')](respondWithResult(_0x3db645,null))[_0x5a77('0x3c')](handleError(_0x3db645,null));};exports['destroy']=function(_0x244c6e,_0x3f3efe){return db[_0x5a77('0x25')][_0x5a77('0x3f')]({'where':{'id':_0x244c6e[_0x5a77('0x3d')]['id']}})[_0x5a77('0x1f')](handleEntityNotFound(_0x3f3efe,null))[_0x5a77('0x1f')](removeEntity(_0x3f3efe,null))[_0x5a77('0x3c')](handleError(_0x3f3efe,null));};
\ No newline at end of file
index bb8d20f..351dbb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa97c=['path','../../config/environment','define','salesforce_unique_index','FieldId','util','api','moment','request-promise'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xa97c,0xd4));var _0xca97=function(_0x8eef2d,_0x542d7b){_0x8eef2d=_0x8eef2d-0x0;var _0x55c3a9=_0xa97c[_0x8eef2d];return _0x55c3a9;};'use strict';var _=require('lodash');var util=require(_0xca97('0x0'));var logger=require('../../config/logger')(_0xca97('0x1'));var moment=require(_0xca97('0x2'));var BPromise=require('bluebird');var rp=require(_0xca97('0x3'));var fs=require('fs');var path=require(_0xca97('0x4'));var rimraf=require('rimraf');var config=require(_0xca97('0x5'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x5356ee,_0x4c434f){return _0x5356ee[_0xca97('0x6')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xca97('0x7'),'fields':['idField',_0xca97('0x8')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5522=['api','moment','bluebird','request-promise','path','../../config/environment','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x2d4420,_0x253c3e){var _0x349b1b=function(_0x1ebc7e){while(--_0x1ebc7e){_0x2d4420['push'](_0x2d4420['shift']());}};_0x349b1b(++_0x253c3e);}(_0x5522,0x156));var _0x2552=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5522[_0x432682];return _0x463d05;};'use strict';var _=require(_0x2552('0x0'));var util=require(_0x2552('0x1'));var logger=require(_0x2552('0x2'))(_0x2552('0x3'));var moment=require(_0x2552('0x4'));var BPromise=require(_0x2552('0x5'));var rp=require(_0x2552('0x6'));var fs=require('fs');var path=require(_0x2552('0x7'));var rimraf=require('rimraf');var config=require(_0x2552('0x8'));var attributes=require('./intSalesforceField.attributes');module[_0x2552('0x9')]=function(_0x4cb8be,_0x243e3e){return _0x4cb8be['define'](_0x2552('0xa'),attributes,{'tableName':_0x2552('0xb'),'paranoid':![],'indexes':[{'name':_0x2552('0xc'),'fields':[_0x2552('0xd'),_0x2552('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e9c327b..490d4dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bde=['lodash','util','moment','../../config/utils','../../config/logger','../../config/environment','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x245e9c,_0x3830c0){var _0x28fa0d=function(_0x49c3a1){while(--_0x49c3a1){_0x245e9c['push'](_0x245e9c['shift']());}};_0x28fa0d(++_0x3830c0);}(_0x7bde,0x1dc));var _0xe7bd=function(_0x52f4d6,_0x2f4818){_0x52f4d6=_0x52f4d6-0x0;var _0xaa4059=_0x7bde[_0x52f4d6];return _0xaa4059;};'use strict';var _=require(_0xe7bd('0x0'));var util=require(_0xe7bd('0x1'));var moment=require(_0xe7bd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe7bd('0x3'));var logger=require(_0xe7bd('0x4'))('rpc');var config=require(_0xe7bd('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a6898,_0x3a4148,_0xd28dce){return new BPromise(function(_0x25a406,_0x3ae791){return client[_0xe7bd('0x6')](_0x1a6898,_0xd28dce)[_0xe7bd('0x7')](function(_0x443b16){logger['info'](_0xe7bd('0x8'),_0x3a4148,_0xe7bd('0x9'));logger[_0xe7bd('0xa')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3a4148,_0xe7bd('0x9'),JSON[_0xe7bd('0xb')](_0x443b16));if(_0x443b16[_0xe7bd('0xc')]){if(_0x443b16['error'][_0xe7bd('0xd')]===0x1f4){logger['error'](_0xe7bd('0x8'),_0x3a4148,_0x443b16['error'][_0xe7bd('0xe')]);return _0x3ae791(_0x443b16[_0xe7bd('0xc')][_0xe7bd('0xe')]);}logger[_0xe7bd('0xc')](_0xe7bd('0x8'),_0x3a4148,_0x443b16[_0xe7bd('0xc')]['message']);return _0x25a406(_0x443b16[_0xe7bd('0xc')][_0xe7bd('0xe')]);}else{logger[_0xe7bd('0xf')](_0xe7bd('0x8'),_0x3a4148,'request\x20sent');_0x25a406(_0x443b16[_0xe7bd('0x10')][_0xe7bd('0xe')]);}})['catch'](function(_0x12cd32){logger[_0xe7bd('0xc')](_0xe7bd('0x8'),_0x3a4148,_0x12cd32);_0x3ae791(_0x12cd32);});});}
\ No newline at end of file
+var _0x611f=['message','result','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0x611f,0x18e));var _0xf611=function(_0x174f72,_0x1862ce){_0x174f72=_0x174f72-0x0;var _0x5ba695=_0x611f[_0x174f72];return _0x5ba695;};'use strict';var _=require(_0xf611('0x0'));var util=require(_0xf611('0x1'));var moment=require('moment');var BPromise=require(_0xf611('0x2'));var rs=require(_0xf611('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf611('0x4'));var logger=require(_0xf611('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf611('0x6'));var client=jayson[_0xf611('0x7')][_0xf611('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4910a3,_0x1a0b6,_0x386e59){return new BPromise(function(_0x1dcd91,_0x342bfe){return client['request'](_0x4910a3,_0x386e59)[_0xf611('0x9')](function(_0x3ba81e){logger[_0xf611('0xa')](_0xf611('0xb'),_0x1a0b6,_0xf611('0xc'));logger['debug'](_0xf611('0xd'),_0x1a0b6,_0xf611('0xc'),JSON[_0xf611('0xe')](_0x3ba81e));if(_0x3ba81e[_0xf611('0xf')]){if(_0x3ba81e[_0xf611('0xf')]['code']===0x1f4){logger[_0xf611('0xf')](_0xf611('0xb'),_0x1a0b6,_0x3ba81e[_0xf611('0xf')][_0xf611('0x10')]);return _0x342bfe(_0x3ba81e['error'][_0xf611('0x10')]);}logger['error'](_0xf611('0xb'),_0x1a0b6,_0x3ba81e[_0xf611('0xf')][_0xf611('0x10')]);return _0x1dcd91(_0x3ba81e['error'][_0xf611('0x10')]);}else{logger[_0xf611('0xa')]('SalesforceField,\x20%s,\x20%s',_0x1a0b6,_0xf611('0xc'));_0x1dcd91(_0x3ba81e[_0xf611('0x11')][_0xf611('0x10')]);}})['catch'](function(_0x1d5d1b){logger['error'](_0xf611('0xb'),_0x1a0b6,_0x1d5d1b);_0x342bfe(_0x1d5d1b);});});}
\ No newline at end of file
index d612f6d..226d6f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1df5=['update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put'];(function(_0x43862e,_0x41dd79){var _0x36fad3=function(_0x25876b){while(--_0x25876b){_0x43862e['push'](_0x43862e['shift']());}};_0x36fad3(++_0x41dd79);}(_0x1df5,0xfd));var _0x51df=function(_0x267975,_0x15e349){_0x267975=_0x267975-0x0;var _0x5b9167=_0x1df5[_0x267975];return _0x5b9167;};'use strict';var multer=require(_0x51df('0x0'));var util=require(_0x51df('0x1'));var path=require(_0x51df('0x2'));var timeout=require(_0x51df('0x3'));var express=require(_0x51df('0x4'));var router=express['Router']();var fs_extra=require(_0x51df('0x5'));var auth=require(_0x51df('0x6'));var interaction=require(_0x51df('0x7'));var config=require(_0x51df('0x8'));var controller=require(_0x51df('0x9'));router[_0x51df('0xa')]('/',auth[_0x51df('0xb')](),controller[_0x51df('0xc')]);router['get'](_0x51df('0xd'),auth['isAuthenticated'](),controller[_0x51df('0xe')]);router[_0x51df('0xa')](_0x51df('0xf'),auth[_0x51df('0xb')](),controller[_0x51df('0x10')]);router[_0x51df('0xa')](_0x51df('0x11'),auth[_0x51df('0xb')](),controller['getFields']);router[_0x51df('0x12')]('/',auth[_0x51df('0xb')](),controller[_0x51df('0x13')]);router[_0x51df('0x12')](_0x51df('0xf'),auth[_0x51df('0xb')](),controller[_0x51df('0x14')]);router[_0x51df('0x15')](_0x51df('0xd'),auth[_0x51df('0xb')](),controller[_0x51df('0x16')]);router[_0x51df('0x17')](_0x51df('0xd'),auth[_0x51df('0xb')](),controller[_0x51df('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xeebe=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller'];(function(_0x24cf7f,_0xcda231){var _0x4c6742=function(_0x2469db){while(--_0x2469db){_0x24cf7f['push'](_0x24cf7f['shift']());}};_0x4c6742(++_0xcda231);}(_0xeebe,0xff));var _0xeeeb=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xeebe[_0x341e0f];return _0x59555a;};'use strict';var multer=require(_0xeeeb('0x0'));var util=require('util');var path=require(_0xeeeb('0x1'));var timeout=require('connect-timeout');var express=require(_0xeeeb('0x2'));var router=express[_0xeeeb('0x3')]();var fs_extra=require(_0xeeeb('0x4'));var auth=require(_0xeeeb('0x5'));var interaction=require(_0xeeeb('0x6'));var config=require(_0xeeeb('0x7'));var controller=require(_0xeeeb('0x8'));router[_0xeeeb('0x9')]('/',auth[_0xeeeb('0xa')](),controller[_0xeeeb('0xb')]);router[_0xeeeb('0x9')](_0xeeeb('0xc'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0xd')]);router[_0xeeeb('0x9')](_0xeeeb('0xe'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0xf')]);router['get']('/:id/fields',auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x10')]);router[_0xeeeb('0x11')]('/',auth['isAuthenticated'](),controller[_0xeeeb('0x12')]);router[_0xeeeb('0x11')](_0xeeeb('0xe'),auth['isAuthenticated'](),controller[_0xeeeb('0x13')]);router['put']('/:id',auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x14')]);router[_0xeeeb('0x15')](_0xeeeb('0xc'),auth[_0xeeeb('0xa')](),controller[_0xeeeb('0x16')]);module[_0xeeeb('0x17')]=router;
\ No newline at end of file
index 94c06b8..a213ee6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb0c=['remoteUri','sequelize','exports','STRING','username'];(function(_0xcba3dc,_0x59a1d1){var _0x532a4b=function(_0x3141d5){while(--_0x3141d5){_0xcba3dc['push'](_0xcba3dc['shift']());}};_0x532a4b(++_0x59a1d1);}(_0xeb0c,0x1a5));var _0xceb0=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0xeb0c[_0x52c4e9];return _0x252a03;};'use strict';var Sequelize=require(_0xceb0('0x0'));module[_0xceb0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xceb0('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xceb0('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xceb0('0x2')]},'remoteUri':{'type':Sequelize[_0xceb0('0x2')],'unique':_0xceb0('0x4')},'serverUrl':{'type':Sequelize[_0xceb0('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xf390=['STRING','username'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xf390,0x1ea));var _0x0f39=function(_0x1df7e1,_0x52c76d){_0x1df7e1=_0x1df7e1-0x0;var _0x22204e=_0xf390[_0x1df7e1];return _0x22204e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0f39('0x0')]},'description':{'type':Sequelize[_0x0f39('0x0')]},'username':{'type':Sequelize[_0x0f39('0x0')],'unique':_0x0f39('0x1')},'password':{'type':Sequelize[_0x0f39('0x0')]},'email':{'type':Sequelize[_0x0f39('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0f39('0x0')],'allowNull':![]}};
\ No newline at end of file
index 0c44ece..d66d9f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54c7=['label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','error','send','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','findOne','ServicenowConfiguration','nolimit','getConfigurations','addConfiguration','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','sys_created_on','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','business_service','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','closed_by','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','assigned_to','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','location','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','internalType'];(function(_0x27dea9,_0x138315){var _0x117988=function(_0x5ae79e){while(--_0x5ae79e){_0x27dea9['push'](_0x27dea9['shift']());}};_0x117988(++_0x138315);}(_0x54c7,0x182));var _0x754c=function(_0x567e17,_0x5835be){_0x567e17=_0x567e17-0x0;var _0x93dc4e=_0x54c7[_0x567e17];return _0x93dc4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x754c('0x0'));var zipdir=require(_0x754c('0x1'));var jsonpatch=require(_0x754c('0x2'));var rp=require(_0x754c('0x3'));var moment=require(_0x754c('0x4'));var BPromise=require(_0x754c('0x5'));var Mustache=require(_0x754c('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x754c('0x7'));var ejs=require(_0x754c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x754c('0x9'));var squel=require(_0x754c('0xa'));var crypto=require('crypto');var jsforce=require(_0x754c('0xb'));var deskjs=require(_0x754c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x754c('0xd'));var Papa=require('papaparse');var Redis=require(_0x754c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x754c('0xf'));var as=require(_0x754c('0x10'));var hardwareService=require(_0x754c('0x11'));var logger=require(_0x754c('0x12'))('api');var utils=require(_0x754c('0x13'));var config=require(_0x754c('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x754c('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2c51f0,_0x4f5f78){_0x4f5f78=_0x4f5f78||0xcc;return function(_0x412304){if(_0x412304){return _0x2c51f0['sendStatus'](_0x4f5f78);}return _0x2c51f0[_0x754c('0x16')](_0x4f5f78)['end']();};}function respondWithResult(_0x177d04,_0x563b6e){_0x563b6e=_0x563b6e||0xc8;return function(_0x1abb7c){if(_0x1abb7c){return _0x177d04[_0x754c('0x16')](_0x563b6e)[_0x754c('0x17')](_0x1abb7c);}};}function respondWithFilteredResult(_0x15e9ba,_0x492bf1){return function(_0x3fc27a){if(_0x3fc27a){var _0x1f3522=typeof _0x492bf1[_0x754c('0x18')]===_0x754c('0x19')&&typeof _0x492bf1['limit']===_0x754c('0x19');var _0x1afe2=_0x3fc27a[_0x754c('0x1a')];var _0x1dd3c0=_0x1f3522?0x0:_0x492bf1[_0x754c('0x18')];var _0xf1a5ca=_0x1f3522?_0x3fc27a[_0x754c('0x1a')]:_0x492bf1[_0x754c('0x18')]+_0x492bf1['limit'];var _0x512b15;if(_0xf1a5ca>=_0x1afe2){_0xf1a5ca=_0x1afe2;_0x512b15=0xc8;}else{_0x512b15=0xce;}_0x15e9ba[_0x754c('0x16')](_0x512b15);return _0x15e9ba['set'](_0x754c('0x1b'),_0x1dd3c0+'-'+_0xf1a5ca+'/'+_0x1afe2)[_0x754c('0x17')](_0x3fc27a);}return null;};}function patchUpdates(_0x172df5){return function(_0x5e524f){try{jsonpatch[_0x754c('0x1c')](_0x5e524f,_0x172df5,!![]);}catch(_0x37050d){return BPromise[_0x754c('0x1d')](_0x37050d);}return _0x5e524f[_0x754c('0x1e')]();};}function saveUpdates(_0xe2a7d7,_0x5853bb){return function(_0x22b07f){if(_0x22b07f){return _0x22b07f[_0x754c('0x1f')](_0xe2a7d7)[_0x754c('0x20')](function(_0x46b2f1){return _0x46b2f1;});}return null;};}function removeEntity(_0x234553,_0x2772d3){return function(_0xc6d821){if(_0xc6d821){return _0xc6d821[_0x754c('0x21')]()[_0x754c('0x20')](function(){_0x234553[_0x754c('0x16')](0xcc)[_0x754c('0x22')]();});}};}function handleEntityNotFound(_0x307959,_0x4757c0){return function(_0x3f4d25){if(!_0x3f4d25){_0x307959[_0x754c('0x23')](0x194);}return _0x3f4d25;};}function handleError(_0x5cf279,_0xe7588){_0xe7588=_0xe7588||0x1f4;return function(_0x4b36ed){logger['error'](_0x4b36ed[_0x754c('0x24')]);if(_0x4b36ed[_0x754c('0x25')]){delete _0x4b36ed[_0x754c('0x25')];}_0x5cf279[_0x754c('0x16')](_0xe7588)['send'](_0x4b36ed);};}exports[_0x754c('0x26')]=function(_0x3629ab,_0x15bb6a){var _0x4bdae5={},_0x4b62f4={},_0x37f84a={'count':0x0,'rows':[]};var _0x171b55=_[_0x754c('0x27')](db[_0x754c('0x28')][_0x754c('0x29')],function(_0x5b60dc){return{'name':_0x5b60dc[_0x754c('0x2a')],'type':_0x5b60dc[_0x754c('0x2b')][_0x754c('0x2c')]};});_0x4b62f4[_0x754c('0x2d')]=_[_0x754c('0x27')](_0x171b55,'name');_0x4b62f4[_0x754c('0x2e')]=_[_0x754c('0x2f')](_0x3629ab[_0x754c('0x2e')]);_0x4b62f4[_0x754c('0x30')]=_[_0x754c('0x31')](_0x4b62f4['model'],_0x4b62f4[_0x754c('0x2e')]);_0x4bdae5['attributes']=_[_0x754c('0x31')](_0x4b62f4[_0x754c('0x2d')],qs[_0x754c('0x32')](_0x3629ab['query'][_0x754c('0x32')]));_0x4bdae5[_0x754c('0x33')]=_0x4bdae5[_0x754c('0x33')]['length']?_0x4bdae5[_0x754c('0x33')]:_0x4b62f4['model'];if(!_0x3629ab[_0x754c('0x2e')][_0x754c('0x34')]('nolimit')){_0x4bdae5[_0x754c('0x35')]=qs['limit'](_0x3629ab[_0x754c('0x2e')][_0x754c('0x35')]);_0x4bdae5[_0x754c('0x18')]=qs[_0x754c('0x18')](_0x3629ab[_0x754c('0x2e')][_0x754c('0x18')]);}_0x4bdae5[_0x754c('0x36')]=qs[_0x754c('0x37')](_0x3629ab['query'][_0x754c('0x37')]);_0x4bdae5[_0x754c('0x38')]=qs[_0x754c('0x30')](_[_0x754c('0x39')](_0x3629ab['query'],_0x4b62f4[_0x754c('0x30')]),_0x171b55);if(_0x3629ab[_0x754c('0x2e')][_0x754c('0x3a')]){_0x4bdae5[_0x754c('0x38')]=_['merge'](_0x4bdae5[_0x754c('0x38')],{'$or':_['map'](_0x171b55,function(_0x49a901){if(_0x49a901[_0x754c('0x2b')]!=='VIRTUAL'){var _0x40f0f7={};_0x40f0f7[_0x49a901['name']]={'$like':'%'+_0x3629ab[_0x754c('0x2e')]['filter']+'%'};return _0x40f0f7;}})});}_0x4bdae5=_[_0x754c('0x3b')]({},_0x4bdae5,_0x3629ab[_0x754c('0x3c')]);var _0x31f717={'where':_0x4bdae5['where']};return db['ServicenowAccount'][_0x754c('0x1a')](_0x31f717)[_0x754c('0x20')](function(_0x5daa7b){_0x37f84a[_0x754c('0x1a')]=_0x5daa7b;if(_0x3629ab[_0x754c('0x2e')]['includeAll']){_0x4bdae5[_0x754c('0x3d')]=[{'all':!![]}];}return db[_0x754c('0x28')][_0x754c('0x3e')](_0x4bdae5);})['then'](function(_0x15f9d){_0x37f84a[_0x754c('0x3f')]=_0x15f9d;return _0x37f84a;})[_0x754c('0x20')](respondWithFilteredResult(_0x15bb6a,_0x4bdae5))[_0x754c('0x40')](handleError(_0x15bb6a,null));};exports[_0x754c('0x41')]=function(_0x27038c,_0x390007){var _0x46b18b={'raw':![],'where':{'id':_0x27038c[_0x754c('0x42')]['id']}},_0x4700f4={};_0x4700f4[_0x754c('0x2d')]=_[_0x754c('0x2f')](db['ServicenowAccount'][_0x754c('0x29')]);_0x4700f4['query']=_[_0x754c('0x2f')](_0x27038c['query']);_0x4700f4['filters']=_[_0x754c('0x31')](_0x4700f4[_0x754c('0x2d')],_0x4700f4[_0x754c('0x2e')]);_0x46b18b[_0x754c('0x33')]=_[_0x754c('0x31')](_0x4700f4[_0x754c('0x2d')],qs['fields'](_0x27038c[_0x754c('0x2e')][_0x754c('0x32')]));_0x46b18b[_0x754c('0x33')]=_0x46b18b[_0x754c('0x33')][_0x754c('0x43')]?_0x46b18b['attributes']:_0x4700f4[_0x754c('0x2d')];if(_0x27038c['query'][_0x754c('0x44')]){_0x46b18b[_0x754c('0x3d')]=[{'all':!![]}];}_0x46b18b=_['merge']({},_0x46b18b,_0x27038c[_0x754c('0x3c')]);return db[_0x754c('0x28')][_0x754c('0x45')](_0x46b18b)[_0x754c('0x20')](handleEntityNotFound(_0x390007,null))['then'](respondWithResult(_0x390007,null))['catch'](handleError(_0x390007,null));};exports[_0x754c('0x46')]=function(_0x56a212,_0x52c22a){return db[_0x754c('0x28')][_0x754c('0x46')](_0x56a212[_0x754c('0x47')],{})['then'](respondWithResult(_0x52c22a,0xc9))[_0x754c('0x40')](handleError(_0x52c22a,null));};exports[_0x754c('0x1f')]=function(_0x4c6524,_0x3f6c3c){if(_0x4c6524[_0x754c('0x47')]['id']){delete _0x4c6524[_0x754c('0x47')]['id'];}return db[_0x754c('0x28')][_0x754c('0x45')]({'where':{'id':_0x4c6524[_0x754c('0x42')]['id']}})[_0x754c('0x20')](handleEntityNotFound(_0x3f6c3c,null))['then'](saveUpdates(_0x4c6524[_0x754c('0x47')],null))[_0x754c('0x20')](respondWithResult(_0x3f6c3c,null))[_0x754c('0x40')](handleError(_0x3f6c3c,null));};exports['destroy']=function(_0x5eb2f1,_0x4b696f){return db['ServicenowAccount'][_0x754c('0x45')]({'where':{'id':_0x5eb2f1[_0x754c('0x42')]['id']}})['then'](handleEntityNotFound(_0x4b696f,null))[_0x754c('0x20')](removeEntity(_0x4b696f,null))['catch'](handleError(_0x4b696f,null));};exports['getConfigurations']=function(_0x352941,_0x28b368,_0x22550a){var _0x116642={};var _0x231383={};var _0x1e5f75;var _0x480f8f;return db[_0x754c('0x28')][_0x754c('0x48')]({'where':{'id':_0x352941[_0x754c('0x42')]['id']}})['then'](handleEntityNotFound(_0x28b368,null))[_0x754c('0x20')](function(_0x1a844d){if(_0x1a844d){_0x1e5f75=_0x1a844d;_0x231383[_0x754c('0x2d')]=_[_0x754c('0x2f')](db[_0x754c('0x49')][_0x754c('0x29')]);_0x231383[_0x754c('0x2e')]=_[_0x754c('0x2f')](_0x352941[_0x754c('0x2e')]);_0x231383[_0x754c('0x30')]=_[_0x754c('0x31')](_0x231383[_0x754c('0x2d')],_0x231383[_0x754c('0x2e')]);_0x116642[_0x754c('0x33')]=_[_0x754c('0x31')](_0x231383[_0x754c('0x2d')],qs[_0x754c('0x32')](_0x352941['query']['fields']));_0x116642['attributes']=_0x116642[_0x754c('0x33')][_0x754c('0x43')]?_0x116642[_0x754c('0x33')]:_0x231383[_0x754c('0x2d')];_0x116642['order']=qs[_0x754c('0x37')](_0x352941['query'][_0x754c('0x37')]);_0x116642['where']=qs['filters'](_[_0x754c('0x39')](_0x352941[_0x754c('0x2e')],_0x231383[_0x754c('0x30')]));if(_0x352941['query'][_0x754c('0x3a')]){_0x116642[_0x754c('0x38')]=_[_0x754c('0x3b')](_0x116642[_0x754c('0x38')],{'$or':_[_0x754c('0x27')](_0x116642[_0x754c('0x33')],function(_0x3b0087){var _0x52a9bc={};_0x52a9bc[_0x3b0087]={'$like':'%'+_0x352941[_0x754c('0x2e')][_0x754c('0x3a')]+'%'};return _0x52a9bc;})});}_0x116642=_[_0x754c('0x3b')]({},_0x116642,_0x352941['options']);return _0x1e5f75['getConfigurations'](_0x116642);}})[_0x754c('0x20')](function(_0xa696b8){if(_0xa696b8){_0x480f8f=_0xa696b8[_0x754c('0x43')];if(!_0x352941[_0x754c('0x2e')][_0x754c('0x34')](_0x754c('0x4a'))){_0x116642[_0x754c('0x35')]=qs[_0x754c('0x35')](_0x352941[_0x754c('0x2e')]['limit']);_0x116642[_0x754c('0x18')]=qs[_0x754c('0x18')](_0x352941[_0x754c('0x2e')][_0x754c('0x18')]);}return _0x1e5f75[_0x754c('0x4b')](_0x116642);}})[_0x754c('0x20')](function(_0xff573){if(_0xff573){return _0xff573?{'count':_0x480f8f,'rows':_0xff573}:null;}})[_0x754c('0x20')](respondWithResult(_0x28b368,null))[_0x754c('0x40')](handleError(_0x28b368,null));};exports[_0x754c('0x4c')]=function(_0xf37a2e,_0x2d09b6,_0x15b9d6){if(_0xf37a2e[_0x754c('0x47')]['id']){delete _0xf37a2e[_0x754c('0x47')]['id'];}return db[_0x754c('0x28')][_0x754c('0x48')]({'where':{'id':_0xf37a2e[_0x754c('0x42')]['id']}})[_0x754c('0x20')](handleEntityNotFound(_0x2d09b6,null))[_0x754c('0x20')](function(_0x5bf44e){if(_0x5bf44e){_0xf37a2e['body']['AccountId']=_0x5bf44e['id'];_0xf37a2e[_0x754c('0x47')]['Subjects']=integrations['getSubjects'](_0xf37a2e[_0x754c('0x47')][_0x754c('0x4d')],_0xf37a2e[_0x754c('0x47')][_0x754c('0x2b')]);_0xf37a2e[_0x754c('0x47')][_0x754c('0x4e')]=integrations['getDescriptions'](_0xf37a2e['body']['channel'],_0xf37a2e[_0x754c('0x47')][_0x754c('0x2b')]);return db[_0x754c('0x49')][_0x754c('0x46')](_0xf37a2e[_0x754c('0x47')],{'include':[{'model':db[_0x754c('0x4f')],'as':'Subjects'},{'model':db[_0x754c('0x4f')],'as':_0x754c('0x4e')}]});}return null;})['then'](respondWithResult(_0x2d09b6,null))[_0x754c('0x40')](handleError(_0x2d09b6,null));};exports[_0x754c('0x50')]=function(_0x2def4a,_0x376cbd,_0x2a94d1){var _0x2bd18f=[_0x754c('0x51'),_0x754c('0x52'),_0x754c('0x53'),_0x754c('0x54'),'close_code',_0x754c('0x55'),_0x754c('0x56'),'severity',_0x754c('0x57')];var _0x3d3bf4=[_0x754c('0x58'),_0x754c('0x51'),_0x754c('0x59'),_0x754c('0x5a'),_0x754c('0x5b'),_0x754c('0x5c'),_0x754c('0x5d'),_0x754c('0x52'),_0x754c('0x5e'),_0x754c('0x5f'),_0x754c('0x60'),_0x754c('0x61'),'opened_by','user_input',_0x754c('0x62'),'sys_domain','state',_0x754c('0x63'),_0x754c('0x53'),_0x754c('0x36'),_0x754c('0x64'),_0x754c('0x65'),_0x754c('0x66'),_0x754c('0x67'),'impact',_0x754c('0x68'),_0x754c('0x69'),_0x754c('0x6a'),'priority','sys_domain_path',_0x754c('0x6b'),'time_worked',_0x754c('0x6c'),_0x754c('0x6d'),_0x754c('0x6e'),_0x754c('0x6f'),_0x754c('0x70'),_0x754c('0x71'),_0x754c('0x72'),_0x754c('0x73'),_0x754c('0x74'),_0x754c('0x54'),_0x754c('0x75'),_0x754c('0x76'),_0x754c('0x77'),_0x754c('0x78'),_0x754c('0x79'),_0x754c('0x7a'),_0x754c('0x7b'),_0x754c('0x7c'),_0x754c('0x7d'),'description',_0x754c('0x7e'),_0x754c('0x55'),'sys_class_name','close_notes',_0x754c('0x7f'),_0x754c('0x80'),'parent_incident',_0x754c('0x81'),_0x754c('0x82'),_0x754c('0x83'),_0x754c('0x56'),_0x754c('0x84'),_0x754c('0x85'),'company',_0x754c('0x86'),'activity_due',_0x754c('0x87'),_0x754c('0x88'),_0x754c('0x89'),'sla_due',_0x754c('0x8a'),_0x754c('0x8b'),_0x754c('0x8c'),_0x754c('0x8d'),_0x754c('0x8e'),_0x754c('0x8f'),'escalation',_0x754c('0x90'),'correlation_id',_0x754c('0x91'),_0x754c('0x57')];var _0x5f3af0='';var _0xca5acc='';var _0x34ecfe=[];var _0x103abb='';var _0x16bb46='';var _0x32ff21=[];var _0x407fe7='';var _0x1d4420='';var _0x9f42a={};var _0x49a81b='';return db[_0x754c('0x28')][_0x754c('0x48')]({'where':{'id':_0x2def4a[_0x754c('0x42')]['id']},'attributes':['id','username',_0x754c('0x92'),_0x754c('0x93'),_0x754c('0x94'),_0x754c('0x95')]})[_0x754c('0x20')](handleEntityNotFound(_0x376cbd,null))[_0x754c('0x20')](function(_0x1fcd90){if(_0x1fcd90){_0x49a81b=_0x1fcd90[_0x754c('0x94')];var _0x7f54ac=_0x49a81b[_0x754c('0x96')](-0x1);if(_0x7f54ac==='/'){_0x49a81b=_0x49a81b[_0x754c('0x97')](0x0,_0x49a81b[_0x754c('0x98')](_0x7f54ac));}_0x1d4420=util[_0x754c('0x99')](_0x754c('0x9a'),_0x49a81b);_0x407fe7=util['format'](_0x754c('0x9b'),_0x49a81b);_0x9f42a={'user':_0x1fcd90['username'],'pass':_0x1fcd90[_0x754c('0x92')]};var _0x10ee66={'method':_0x754c('0x9c'),'uri':_0x1d4420+_0x754c('0x9d'),'auth':_0x9f42a,'json':!![]};return rp(_0x10ee66);}})['then'](function(_0x146b63){if(_0x146b63[_0x754c('0x9e')][_0x754c('0x43')]>0x0){_0x5f3af0=_0x146b63[_0x754c('0x9e')];}console[_0x754c('0x9f')]('incident\x20table\x20objects',_0x5f3af0);_0x32ff21=[];_0xca5acc=Object[_0x754c('0xa0')]([],_0x5f3af0);_[_0x754c('0xa1')](_0xca5acc,function(_0xe0828b){return!_0x2bd18f['includes'](_0xe0828b[_0x754c('0x25')]);});_0xca5acc['forEach'](function(_0x1ea61c){var _0x3c576f=createFieldObject(_0x407fe7,_0x9f42a,_0x1ea61c[_0x754c('0xa2')],_0x1ea61c[_0x754c('0x25')],_0x1ea61c[_0x754c('0xa3')],![]);_0x32ff21[_0x754c('0xa4')](_0x3c576f);});return Promise[_0x754c('0xa5')](_0x32ff21);})[_0x754c('0x20')](function(_0x163ffe){_0x34ecfe=_0x163ffe;_0x103abb=Object[_0x754c('0xa0')]([],_0x5f3af0);console['log'](_0x754c('0xa6'),_0x5f3af0);_[_0x754c('0xa1')](_0x103abb,function(_0x51a4a7){return _0x3d3bf4['includes'](_0x51a4a7[_0x754c('0x25')]);});console[_0x754c('0x9f')](_0x754c('0xa7'),_0x103abb);_0x32ff21=[];_0x103abb[_0x754c('0xa8')](function(_0x517a04){var _0x5067dc=createFieldObject(_0x407fe7,_0x9f42a,_0x517a04[_0x754c('0xa2')],_0x517a04['name'],_0x517a04['label'],!![]);_0x32ff21[_0x754c('0xa4')](_0x5067dc);});return Promise['all'](_0x32ff21);})['then'](function(_0x5baa84){_0x16bb46=_0x5baa84;var _0x5a9c22=_0x34ecfe[_0x754c('0xa9')](_0x16bb46);return{'count':_0x5a9c22[_0x754c('0x43')],'rows':_0x5a9c22};})[_0x754c('0x20')](respondWithResult(_0x376cbd,null))[_0x754c('0x40')](function(_0x38d9ef){console[_0x754c('0x9f')](_0x754c('0xaa')+_0x38d9ef);var _0x69bde7=_0x2def4a[_0x754c('0x2e')][_0x754c('0xab')]?0x1f4:_0x38d9ef[_0x754c('0xac')]||0x1f4;logger[_0x754c('0xad')](_0x38d9ef['stack']);delete _0x38d9ef[_0x754c('0x25')];if(_0x69bde7===0x191){_0x69bde7=0x190;}_0x376cbd[_0x754c('0x16')](_0x69bde7)[_0x754c('0xae')](_0x2def4a[_0x754c('0x2e')]['test']?{'message':_0x754c('0xaf'),'statusCode':_0x38d9ef['statusCode']}:_0x38d9ef);});};function createFieldObject(_0x3c9c22,_0x41fe4f,_0x115818,_0x4ea5fa,_0x49891d,_0x59109c){return new Promise(function(_0x328a4a,_0xc05aa5){var _0x92e8d3={'id':_0x4ea5fa,'name':_0x49891d,'custom':_0x59109c};if(_0x115818===_0x754c('0xb0')){_0x92e8d3['options']=[{'name':_0x754c('0xb1'),'value':_0x754c('0xb2')},{'name':_0x754c('0xb3'),'value':_0x754c('0xb4')}];_0x328a4a(_0x92e8d3);}else{var _0x145173={'method':_0x754c('0x9c'),'uri':_0x3c9c22+_0x754c('0xb5')+_0x4ea5fa,'auth':_0x41fe4f,'json':!![]};return rp(_0x145173)[_0x754c('0x20')](function(_0x447d9a){var _0x4bcbf4=[];if(_0x447d9a[_0x754c('0x9e')][_0x754c('0x43')]>0x0){_0x447d9a[_0x754c('0x9e')][_0x754c('0xa8')](function(_0x4b9f5a){if(_0x4b9f5a[_0x754c('0xb6')]==='false'){var _0x4dc3ea={'name':_0x4b9f5a[_0x754c('0xa3')],'value':_0x4b9f5a['value']};_0x4bcbf4['push'](_0x4dc3ea);}});}_0x92e8d3['options']=_0x4bcbf4;if(_0x92e8d3[_0x754c('0x3c')][_0x754c('0x43')]>0x0){_0x328a4a(_0x92e8d3);}else{if(_0x59109c==![]){_0x328a4a();}else{_0x328a4a(_0x92e8d3);}}});}});}
\ No newline at end of file
+var _0xdbc2=['result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','statusCode','test','Wrong\x20credentials','boolean','True','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','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','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ServicenowAccount','type','key','model','query','intersection','attributes','fields','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','params','keys','find','create','body','destroy','getConfigurations','findOne','length','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ServicenowConfiguration','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','hold_reason','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','additional_assignee_list','sys_class_name','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','username','email','remoteUri','serverUrl','substring','lastIndexOf','%s/api/now/table/','GET','incident?sysparm_display_value=all'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xdbc2,0xc4));var _0x2dbc=function(_0x32cfb7,_0x373041){_0x32cfb7=_0x32cfb7-0x0;var _0x94137a=_0xdbc2[_0x32cfb7];return _0x94137a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2dbc('0x0'));var zipdir=require(_0x2dbc('0x1'));var jsonpatch=require(_0x2dbc('0x2'));var rp=require(_0x2dbc('0x3'));var moment=require(_0x2dbc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2dbc('0x5'));var util=require(_0x2dbc('0x6'));var path=require(_0x2dbc('0x7'));var sox=require('sox');var csv=require(_0x2dbc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2dbc('0x9'));var _=require(_0x2dbc('0xa'));var squel=require('squel');var crypto=require(_0x2dbc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2dbc('0xc'));var toCsv=require(_0x2dbc('0x8'));var querystring=require(_0x2dbc('0xd'));var Papa=require(_0x2dbc('0xe'));var Redis=require('ioredis');var authService=require(_0x2dbc('0xf'));var qs=require(_0x2dbc('0x10'));var as=require(_0x2dbc('0x11'));var hardwareService=require(_0x2dbc('0x12'));var logger=require('../../config/logger')(_0x2dbc('0x13'));var utils=require(_0x2dbc('0x14'));var config=require(_0x2dbc('0x15'));var licenseUtil=require(_0x2dbc('0x16'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x480066,_0x3b3c1a){_0x3b3c1a=_0x3b3c1a||0xcc;return function(_0x52666e){if(_0x52666e){return _0x480066[_0x2dbc('0x17')](_0x3b3c1a);}return _0x480066[_0x2dbc('0x18')](_0x3b3c1a)[_0x2dbc('0x19')]();};}function respondWithResult(_0x45b9fc,_0x3387c5){_0x3387c5=_0x3387c5||0xc8;return function(_0x24ba1b){if(_0x24ba1b){return _0x45b9fc['status'](_0x3387c5)[_0x2dbc('0x1a')](_0x24ba1b);}};}function respondWithFilteredResult(_0x2faf36,_0x235245){return function(_0x2aa021){if(_0x2aa021){var _0x5dd1f1=typeof _0x235245[_0x2dbc('0x1b')]==='undefined'&&typeof _0x235245[_0x2dbc('0x1c')]==='undefined';var _0x4c67bc=_0x2aa021[_0x2dbc('0x1d')];var _0x4b2f84=_0x5dd1f1?0x0:_0x235245[_0x2dbc('0x1b')];var _0x31c482=_0x5dd1f1?_0x2aa021[_0x2dbc('0x1d')]:_0x235245[_0x2dbc('0x1b')]+_0x235245[_0x2dbc('0x1c')];var _0x587a2e;if(_0x31c482>=_0x4c67bc){_0x31c482=_0x4c67bc;_0x587a2e=0xc8;}else{_0x587a2e=0xce;}_0x2faf36[_0x2dbc('0x18')](_0x587a2e);return _0x2faf36['set'](_0x2dbc('0x1e'),_0x4b2f84+'-'+_0x31c482+'/'+_0x4c67bc)[_0x2dbc('0x1a')](_0x2aa021);}return null;};}function patchUpdates(_0x102c3a){return function(_0x2e8548){try{jsonpatch[_0x2dbc('0x1f')](_0x2e8548,_0x102c3a,!![]);}catch(_0x14a39b){return BPromise[_0x2dbc('0x20')](_0x14a39b);}return _0x2e8548['save']();};}function saveUpdates(_0x1d6da4,_0x88366a){return function(_0x38cf4e){if(_0x38cf4e){return _0x38cf4e[_0x2dbc('0x21')](_0x1d6da4)[_0x2dbc('0x22')](function(_0x129aad){return _0x129aad;});}return null;};}function removeEntity(_0x2dea3b,_0x88bdcc){return function(_0x4a7b32){if(_0x4a7b32){return _0x4a7b32['destroy']()[_0x2dbc('0x22')](function(){_0x2dea3b['status'](0xcc)[_0x2dbc('0x19')]();});}};}function handleEntityNotFound(_0x41c20b,_0x50803f){return function(_0x5cf141){if(!_0x5cf141){_0x41c20b[_0x2dbc('0x17')](0x194);}return _0x5cf141;};}function handleError(_0x316160,_0x2673f2){_0x2673f2=_0x2673f2||0x1f4;return function(_0x21c260){logger[_0x2dbc('0x23')](_0x21c260[_0x2dbc('0x24')]);if(_0x21c260[_0x2dbc('0x25')]){delete _0x21c260[_0x2dbc('0x25')];}_0x316160[_0x2dbc('0x18')](_0x2673f2)[_0x2dbc('0x26')](_0x21c260);};}exports[_0x2dbc('0x27')]=function(_0x2c033d,_0x558f67){var _0x4a4c12={},_0x4b09ab={},_0x2aa0bb={'count':0x0,'rows':[]};var _0x33411f=_[_0x2dbc('0x28')](db[_0x2dbc('0x29')]['rawAttributes'],function(_0x136e6a){return{'name':_0x136e6a['fieldName'],'type':_0x136e6a[_0x2dbc('0x2a')][_0x2dbc('0x2b')]};});_0x4b09ab[_0x2dbc('0x2c')]=_['map'](_0x33411f,'name');_0x4b09ab['query']=_['keys'](_0x2c033d[_0x2dbc('0x2d')]);_0x4b09ab['filters']=_[_0x2dbc('0x2e')](_0x4b09ab['model'],_0x4b09ab[_0x2dbc('0x2d')]);_0x4a4c12[_0x2dbc('0x2f')]=_[_0x2dbc('0x2e')](_0x4b09ab['model'],qs['fields'](_0x2c033d[_0x2dbc('0x2d')][_0x2dbc('0x30')]));_0x4a4c12['attributes']=_0x4a4c12['attributes']['length']?_0x4a4c12[_0x2dbc('0x2f')]:_0x4b09ab[_0x2dbc('0x2c')];if(!_0x2c033d['query']['hasOwnProperty']('nolimit')){_0x4a4c12[_0x2dbc('0x1c')]=qs[_0x2dbc('0x1c')](_0x2c033d['query'][_0x2dbc('0x1c')]);_0x4a4c12[_0x2dbc('0x1b')]=qs[_0x2dbc('0x1b')](_0x2c033d[_0x2dbc('0x2d')][_0x2dbc('0x1b')]);}_0x4a4c12[_0x2dbc('0x31')]=qs[_0x2dbc('0x32')](_0x2c033d['query']['sort']);_0x4a4c12['where']=qs[_0x2dbc('0x33')](_[_0x2dbc('0x34')](_0x2c033d[_0x2dbc('0x2d')],_0x4b09ab[_0x2dbc('0x33')]),_0x33411f);if(_0x2c033d[_0x2dbc('0x2d')][_0x2dbc('0x35')]){_0x4a4c12[_0x2dbc('0x36')]=_[_0x2dbc('0x37')](_0x4a4c12[_0x2dbc('0x36')],{'$or':_['map'](_0x33411f,function(_0x464199){if(_0x464199[_0x2dbc('0x2a')]!==_0x2dbc('0x38')){var _0x448710={};_0x448710[_0x464199['name']]={'$like':'%'+_0x2c033d[_0x2dbc('0x2d')][_0x2dbc('0x35')]+'%'};return _0x448710;}})});}_0x4a4c12=_[_0x2dbc('0x37')]({},_0x4a4c12,_0x2c033d[_0x2dbc('0x39')]);var _0x45bdd3={'where':_0x4a4c12[_0x2dbc('0x36')]};return db[_0x2dbc('0x29')][_0x2dbc('0x1d')](_0x45bdd3)[_0x2dbc('0x22')](function(_0x5db0ba){_0x2aa0bb[_0x2dbc('0x1d')]=_0x5db0ba;if(_0x2c033d[_0x2dbc('0x2d')]['includeAll']){_0x4a4c12[_0x2dbc('0x3a')]=[{'all':!![]}];}return db[_0x2dbc('0x29')]['findAll'](_0x4a4c12);})[_0x2dbc('0x22')](function(_0x1c26cf){_0x2aa0bb[_0x2dbc('0x3b')]=_0x1c26cf;return _0x2aa0bb;})['then'](respondWithFilteredResult(_0x558f67,_0x4a4c12))[_0x2dbc('0x3c')](handleError(_0x558f67,null));};exports['show']=function(_0x38a7c3,_0x3812a4){var _0x44878f={'raw':![],'where':{'id':_0x38a7c3[_0x2dbc('0x3d')]['id']}},_0xece2eb={};_0xece2eb['model']=_['keys'](db[_0x2dbc('0x29')]['rawAttributes']);_0xece2eb['query']=_[_0x2dbc('0x3e')](_0x38a7c3[_0x2dbc('0x2d')]);_0xece2eb[_0x2dbc('0x33')]=_[_0x2dbc('0x2e')](_0xece2eb[_0x2dbc('0x2c')],_0xece2eb['query']);_0x44878f[_0x2dbc('0x2f')]=_['intersection'](_0xece2eb[_0x2dbc('0x2c')],qs[_0x2dbc('0x30')](_0x38a7c3[_0x2dbc('0x2d')][_0x2dbc('0x30')]));_0x44878f[_0x2dbc('0x2f')]=_0x44878f[_0x2dbc('0x2f')]['length']?_0x44878f[_0x2dbc('0x2f')]:_0xece2eb[_0x2dbc('0x2c')];if(_0x38a7c3[_0x2dbc('0x2d')]['includeAll']){_0x44878f[_0x2dbc('0x3a')]=[{'all':!![]}];}_0x44878f=_[_0x2dbc('0x37')]({},_0x44878f,_0x38a7c3['options']);return db[_0x2dbc('0x29')][_0x2dbc('0x3f')](_0x44878f)[_0x2dbc('0x22')](handleEntityNotFound(_0x3812a4,null))[_0x2dbc('0x22')](respondWithResult(_0x3812a4,null))[_0x2dbc('0x3c')](handleError(_0x3812a4,null));};exports[_0x2dbc('0x40')]=function(_0x25a328,_0x3e0443){return db[_0x2dbc('0x29')][_0x2dbc('0x40')](_0x25a328[_0x2dbc('0x41')],{})[_0x2dbc('0x22')](respondWithResult(_0x3e0443,0xc9))[_0x2dbc('0x3c')](handleError(_0x3e0443,null));};exports[_0x2dbc('0x21')]=function(_0x24c9b2,_0x52f2fa){if(_0x24c9b2['body']['id']){delete _0x24c9b2[_0x2dbc('0x41')]['id'];}return db[_0x2dbc('0x29')][_0x2dbc('0x3f')]({'where':{'id':_0x24c9b2[_0x2dbc('0x3d')]['id']}})[_0x2dbc('0x22')](handleEntityNotFound(_0x52f2fa,null))['then'](saveUpdates(_0x24c9b2[_0x2dbc('0x41')],null))[_0x2dbc('0x22')](respondWithResult(_0x52f2fa,null))[_0x2dbc('0x3c')](handleError(_0x52f2fa,null));};exports[_0x2dbc('0x42')]=function(_0x4c3096,_0x1028eb){return db[_0x2dbc('0x29')][_0x2dbc('0x3f')]({'where':{'id':_0x4c3096['params']['id']}})[_0x2dbc('0x22')](handleEntityNotFound(_0x1028eb,null))['then'](removeEntity(_0x1028eb,null))[_0x2dbc('0x3c')](handleError(_0x1028eb,null));};exports[_0x2dbc('0x43')]=function(_0x2a4938,_0x14ee2b,_0x22767e){var _0x3e7d96={};var _0x4ec354={};var _0x185277;var _0x594786;return db[_0x2dbc('0x29')][_0x2dbc('0x44')]({'where':{'id':_0x2a4938[_0x2dbc('0x3d')]['id']}})[_0x2dbc('0x22')](handleEntityNotFound(_0x14ee2b,null))['then'](function(_0x2c26a5){if(_0x2c26a5){_0x185277=_0x2c26a5;_0x4ec354['model']=_[_0x2dbc('0x3e')](db['ServicenowConfiguration']['rawAttributes']);_0x4ec354[_0x2dbc('0x2d')]=_[_0x2dbc('0x3e')](_0x2a4938['query']);_0x4ec354[_0x2dbc('0x33')]=_[_0x2dbc('0x2e')](_0x4ec354['model'],_0x4ec354[_0x2dbc('0x2d')]);_0x3e7d96[_0x2dbc('0x2f')]=_['intersection'](_0x4ec354[_0x2dbc('0x2c')],qs[_0x2dbc('0x30')](_0x2a4938[_0x2dbc('0x2d')]['fields']));_0x3e7d96[_0x2dbc('0x2f')]=_0x3e7d96[_0x2dbc('0x2f')][_0x2dbc('0x45')]?_0x3e7d96[_0x2dbc('0x2f')]:_0x4ec354['model'];_0x3e7d96[_0x2dbc('0x31')]=qs['sort'](_0x2a4938[_0x2dbc('0x2d')][_0x2dbc('0x32')]);_0x3e7d96[_0x2dbc('0x36')]=qs['filters'](_[_0x2dbc('0x34')](_0x2a4938[_0x2dbc('0x2d')],_0x4ec354['filters']));if(_0x2a4938['query'][_0x2dbc('0x35')]){_0x3e7d96[_0x2dbc('0x36')]=_[_0x2dbc('0x37')](_0x3e7d96['where'],{'$or':_[_0x2dbc('0x28')](_0x3e7d96[_0x2dbc('0x2f')],function(_0x549bac){var _0x1de038={};_0x1de038[_0x549bac]={'$like':'%'+_0x2a4938[_0x2dbc('0x2d')][_0x2dbc('0x35')]+'%'};return _0x1de038;})});}_0x3e7d96=_['merge']({},_0x3e7d96,_0x2a4938[_0x2dbc('0x39')]);return _0x185277[_0x2dbc('0x43')](_0x3e7d96);}})[_0x2dbc('0x22')](function(_0x489157){if(_0x489157){_0x594786=_0x489157[_0x2dbc('0x45')];if(!_0x2a4938[_0x2dbc('0x2d')]['hasOwnProperty'](_0x2dbc('0x46'))){_0x3e7d96[_0x2dbc('0x1c')]=qs[_0x2dbc('0x1c')](_0x2a4938[_0x2dbc('0x2d')][_0x2dbc('0x1c')]);_0x3e7d96[_0x2dbc('0x1b')]=qs[_0x2dbc('0x1b')](_0x2a4938[_0x2dbc('0x2d')][_0x2dbc('0x1b')]);}return _0x185277[_0x2dbc('0x43')](_0x3e7d96);}})['then'](function(_0x4516a0){if(_0x4516a0){return _0x4516a0?{'count':_0x594786,'rows':_0x4516a0}:null;}})[_0x2dbc('0x22')](respondWithResult(_0x14ee2b,null))[_0x2dbc('0x3c')](handleError(_0x14ee2b,null));};exports[_0x2dbc('0x47')]=function(_0x1aff89,_0x64cf,_0x510136){if(_0x1aff89[_0x2dbc('0x41')]['id']){delete _0x1aff89[_0x2dbc('0x41')]['id'];}return db[_0x2dbc('0x29')][_0x2dbc('0x44')]({'where':{'id':_0x1aff89['params']['id']}})[_0x2dbc('0x22')](handleEntityNotFound(_0x64cf,null))[_0x2dbc('0x22')](function(_0x22d674){if(_0x22d674){_0x1aff89[_0x2dbc('0x41')][_0x2dbc('0x48')]=_0x22d674['id'];_0x1aff89[_0x2dbc('0x41')][_0x2dbc('0x49')]=integrations[_0x2dbc('0x4a')](_0x1aff89[_0x2dbc('0x41')]['channel'],_0x1aff89['body']['type']);_0x1aff89[_0x2dbc('0x41')][_0x2dbc('0x4b')]=integrations[_0x2dbc('0x4c')](_0x1aff89[_0x2dbc('0x41')][_0x2dbc('0x4d')],_0x1aff89[_0x2dbc('0x41')][_0x2dbc('0x2a')]);return db[_0x2dbc('0x4e')][_0x2dbc('0x40')](_0x1aff89['body'],{'include':[{'model':db[_0x2dbc('0x4f')],'as':_0x2dbc('0x49')},{'model':db[_0x2dbc('0x4f')],'as':_0x2dbc('0x4b')}]});}return null;})['then'](respondWithResult(_0x64cf,null))['catch'](handleError(_0x64cf,null));};exports[_0x2dbc('0x50')]=function(_0x404108,_0x5ca78f,_0x205402){var _0x5f5b64=[_0x2dbc('0x51'),'hold_reason',_0x2dbc('0x52'),_0x2dbc('0x53'),_0x2dbc('0x54'),_0x2dbc('0x55'),_0x2dbc('0x56'),_0x2dbc('0x57'),_0x2dbc('0x58')];var _0x2b56fc=[_0x2dbc('0x59'),_0x2dbc('0x51'),_0x2dbc('0x5a'),'watch_list',_0x2dbc('0x5b'),_0x2dbc('0x5c'),_0x2dbc('0x5d'),_0x2dbc('0x5e'),'approval_history',_0x2dbc('0x5f'),'resolved_by',_0x2dbc('0x60'),_0x2dbc('0x61'),_0x2dbc('0x62'),_0x2dbc('0x63'),_0x2dbc('0x64'),_0x2dbc('0x65'),'sys_created_by',_0x2dbc('0x52'),_0x2dbc('0x31'),_0x2dbc('0x66'),_0x2dbc('0x67'),'cmdb_ci',_0x2dbc('0x68'),_0x2dbc('0x69'),_0x2dbc('0x6a'),_0x2dbc('0x6b'),'business_service',_0x2dbc('0x6c'),_0x2dbc('0x6d'),_0x2dbc('0x6e'),_0x2dbc('0x6f'),_0x2dbc('0x70'),_0x2dbc('0x71'),_0x2dbc('0x72'),'group_list',_0x2dbc('0x73'),_0x2dbc('0x74'),_0x2dbc('0x75'),_0x2dbc('0x76'),_0x2dbc('0x77'),_0x2dbc('0x53'),_0x2dbc('0x78'),_0x2dbc('0x79'),_0x2dbc('0x54'),_0x2dbc('0x7a'),'delivery_task',_0x2dbc('0x7b'),_0x2dbc('0x7c'),'business_stc',_0x2dbc('0x7d'),'description','calendar_duration','notify',_0x2dbc('0x7e'),'close_notes','closed_by',_0x2dbc('0x7f'),_0x2dbc('0x80'),_0x2dbc('0x81'),_0x2dbc('0x82'),'reopened_by',_0x2dbc('0x56'),_0x2dbc('0x83'),_0x2dbc('0x84'),_0x2dbc('0x85'),_0x2dbc('0x86'),'activity_due','assigned_to',_0x2dbc('0x57'),'comments',_0x2dbc('0x87'),_0x2dbc('0x88'),_0x2dbc('0x89'),_0x2dbc('0x8a'),_0x2dbc('0x8b'),_0x2dbc('0x8c'),_0x2dbc('0x8d'),'escalation',_0x2dbc('0x8e'),'correlation_id','location',_0x2dbc('0x58')];var _0x416898='';var _0x234fb1='';var _0x21794f=[];var _0x1a4d4b='';var _0x415377='';var _0x40f0dd=[];var _0x36a896='';var _0x17c717='';var _0x23ea4e={};var _0x4a9053='';return db[_0x2dbc('0x29')][_0x2dbc('0x44')]({'where':{'id':_0x404108['params']['id']},'attributes':['id',_0x2dbc('0x8f'),'password',_0x2dbc('0x90'),_0x2dbc('0x91'),_0x2dbc('0x92')]})['then'](handleEntityNotFound(_0x5ca78f,null))[_0x2dbc('0x22')](function(_0x37df75){if(_0x37df75){_0x4a9053=_0x37df75[_0x2dbc('0x91')];var _0x33484f=_0x4a9053['slice'](-0x1);if(_0x33484f==='/'){_0x4a9053=_0x4a9053[_0x2dbc('0x93')](0x0,_0x4a9053[_0x2dbc('0x94')](_0x33484f));}_0x17c717=util['format']('%s/api/now/doc/table/schema/',_0x4a9053);_0x36a896=util['format'](_0x2dbc('0x95'),_0x4a9053);_0x23ea4e={'user':_0x37df75[_0x2dbc('0x8f')],'pass':_0x37df75['password']};var _0x448368={'method':_0x2dbc('0x96'),'uri':_0x17c717+_0x2dbc('0x97'),'auth':_0x23ea4e,'json':!![]};return rp(_0x448368);}})[_0x2dbc('0x22')](function(_0x5e519f){if(_0x5e519f[_0x2dbc('0x98')][_0x2dbc('0x45')]>0x0){_0x416898=_0x5e519f['result'];}console[_0x2dbc('0x99')](_0x2dbc('0x9a'),_0x416898);_0x40f0dd=[];_0x234fb1=Object['assign']([],_0x416898);_[_0x2dbc('0x9b')](_0x234fb1,function(_0x5e4a2b){return!_0x5f5b64[_0x2dbc('0x9c')](_0x5e4a2b[_0x2dbc('0x25')]);});_0x234fb1[_0x2dbc('0x9d')](function(_0x3dfdab){var _0x268d4f=createFieldObject(_0x36a896,_0x23ea4e,_0x3dfdab[_0x2dbc('0x9e')],_0x3dfdab['name'],_0x3dfdab[_0x2dbc('0x9f')],![]);_0x40f0dd[_0x2dbc('0xa0')](_0x268d4f);});return Promise[_0x2dbc('0xa1')](_0x40f0dd);})['then'](function(_0x2f7a22){_0x21794f=_0x2f7a22;_0x1a4d4b=Object[_0x2dbc('0xa2')]([],_0x416898);console[_0x2dbc('0x99')](_0x2dbc('0xa3'),_0x416898);_[_0x2dbc('0x9b')](_0x1a4d4b,function(_0xa0364f){return _0x2b56fc[_0x2dbc('0x9c')](_0xa0364f[_0x2dbc('0x25')]);});console[_0x2dbc('0x99')](_0x2dbc('0xa4'),_0x1a4d4b);_0x40f0dd=[];_0x1a4d4b[_0x2dbc('0x9d')](function(_0x57685d){var _0x5dbceb=createFieldObject(_0x36a896,_0x23ea4e,_0x57685d['internalType'],_0x57685d['name'],_0x57685d[_0x2dbc('0x9f')],!![]);_0x40f0dd[_0x2dbc('0xa0')](_0x5dbceb);});return Promise['all'](_0x40f0dd);})[_0x2dbc('0x22')](function(_0x3ad3c3){_0x415377=_0x3ad3c3;var _0x556ccc=_0x21794f['concat'](_0x415377);return{'count':_0x556ccc[_0x2dbc('0x45')],'rows':_0x556ccc};})[_0x2dbc('0x22')](respondWithResult(_0x5ca78f,null))[_0x2dbc('0x3c')](function(_0x19533a){console[_0x2dbc('0x99')]('ServiceNow\x20error:\x20'+_0x19533a);var _0x1f94e3=_0x404108[_0x2dbc('0x2d')]['test']?0x1f4:_0x19533a[_0x2dbc('0xa5')]||0x1f4;logger[_0x2dbc('0x23')](_0x19533a[_0x2dbc('0x24')]);delete _0x19533a[_0x2dbc('0x25')];if(_0x1f94e3===0x191){_0x1f94e3=0x190;}_0x5ca78f[_0x2dbc('0x18')](_0x1f94e3)[_0x2dbc('0x26')](_0x404108['query'][_0x2dbc('0xa6')]?{'message':_0x2dbc('0xa7'),'statusCode':_0x19533a[_0x2dbc('0xa5')]}:_0x19533a);});};function createFieldObject(_0x40cb88,_0x1e1ca3,_0x48fbe5,_0x204bf0,_0x2248ea,_0x139da4){return new Promise(function(_0x2a8c7f,_0xfba6a1){var _0x46b983={'id':_0x204bf0,'name':_0x2248ea,'custom':_0x139da4};if(_0x48fbe5===_0x2dbc('0xa8')){_0x46b983[_0x2dbc('0x39')]=[{'name':_0x2dbc('0xa9'),'value':'true'},{'name':'False','value':_0x2dbc('0xaa')}];_0x2a8c7f(_0x46b983);}else{var _0x8c6789={'method':'GET','uri':_0x40cb88+_0x2dbc('0xab')+_0x204bf0,'auth':_0x1e1ca3,'json':!![]};return rp(_0x8c6789)[_0x2dbc('0x22')](function(_0x16299f){var _0x1953d0=[];if(_0x16299f['result']['length']>0x0){_0x16299f[_0x2dbc('0x98')][_0x2dbc('0x9d')](function(_0x21aa6c){if(_0x21aa6c[_0x2dbc('0xac')]===_0x2dbc('0xaa')){var _0x12dd64={'name':_0x21aa6c[_0x2dbc('0x9f')],'value':_0x21aa6c[_0x2dbc('0xad')]};_0x1953d0[_0x2dbc('0xa0')](_0x12dd64);}});}_0x46b983[_0x2dbc('0x39')]=_0x1953d0;if(_0x46b983[_0x2dbc('0x39')][_0x2dbc('0x45')]>0x0){_0x2a8c7f(_0x46b983);}else{if(_0x139da4==![]){_0x2a8c7f();}else{_0x2a8c7f(_0x46b983);}}});}});}
\ No newline at end of file
index 640dc75..d272990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['bluebird','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));var integrations=require(_0xac4a('0x8'));module[_0xac4a('0x9')]=function(_0x96be2b,_0x15cd34){return _0x96be2b[_0xac4a('0xa')](_0xac4a('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','ServicenowAccount','int_servicenow_accounts'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x5fc3,0xa8));var _0x35fc=function(_0x258919,_0x1754e6){_0x258919=_0x258919-0x0;var _0xfbd68b=_0x5fc3[_0x258919];return _0xfbd68b;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));var integrations=require(_0x35fc('0x9'));module['exports']=function(_0x5754be,_0x19a0d1){return _0x5754be['define'](_0x35fc('0xa'),attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8343b9f..25b77e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7617=['options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','lodash','moment','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0x7617,0x66));var _0x7761=function(_0xf1af1f,_0x1fc7d0){_0xf1af1f=_0xf1af1f-0x0;var _0x289889=_0x7617[_0xf1af1f];return _0x289889;};'use strict';var _=require(_0x7761('0x0'));var util=require('util');var moment=require(_0x7761('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(_0x7761('0x2'));var logger=require(_0x7761('0x3'))(_0x7761('0x4'));var config=require(_0x7761('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7761('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3d9bb,_0x56acd2,_0x6794b4){return new BPromise(function(_0x997b16,_0x4b0609){return client[_0x7761('0x7')](_0xd3d9bb,_0x6794b4)[_0x7761('0x8')](function(_0x35af33){logger[_0x7761('0x9')](_0x7761('0xa'),_0x56acd2,_0x7761('0xb'));logger[_0x7761('0xc')](_0x7761('0xd'),_0x56acd2,_0x7761('0xb'),JSON[_0x7761('0xe')](_0x35af33));if(_0x35af33['error']){if(_0x35af33[_0x7761('0xf')]['code']===0x1f4){logger[_0x7761('0xf')](_0x7761('0xa'),_0x56acd2,_0x35af33[_0x7761('0xf')][_0x7761('0x10')]);return _0x4b0609(_0x35af33[_0x7761('0xf')][_0x7761('0x10')]);}logger[_0x7761('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x56acd2,_0x35af33[_0x7761('0xf')][_0x7761('0x10')]);return _0x997b16(_0x35af33[_0x7761('0xf')][_0x7761('0x10')]);}else{logger[_0x7761('0x9')]('ServicenowAccount,\x20%s,\x20%s',_0x56acd2,_0x7761('0xb'));_0x997b16(_0x35af33[_0x7761('0x11')]['message']);}})[_0x7761('0x12')](function(_0x5b553f){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x56acd2,_0x5b553f);_0x4b0609(_0x5b553f);});});}exports[_0x7761('0x13')]=function(_0x3f7193){var _0x512e29=this;return new Promise(function(_0x46ffdc,_0x3c8d52){return db[_0x7761('0x14')][_0x7761('0x15')]({'raw':_0x3f7193[_0x7761('0x16')]?_0x3f7193[_0x7761('0x16')][_0x7761('0x17')]===undefined?!![]:![]:!![],'where':_0x3f7193[_0x7761('0x16')]?_0x3f7193[_0x7761('0x16')][_0x7761('0x18')]||null:null,'attributes':_0x3f7193[_0x7761('0x16')]?_0x3f7193[_0x7761('0x16')][_0x7761('0x19')]||null:null,'limit':_0x3f7193[_0x7761('0x16')]?_0x3f7193[_0x7761('0x16')][_0x7761('0x1a')]||null:null,'include':_0x3f7193['options']?_0x3f7193[_0x7761('0x16')][_0x7761('0x1b')]?_[_0x7761('0x1c')](_0x3f7193[_0x7761('0x16')][_0x7761('0x1b')],function(_0x5d63f1){return{'model':db[_0x5d63f1[_0x7761('0x1d')]],'as':_0x5d63f1['as'],'attributes':_0x5d63f1['attributes'],'include':_0x5d63f1['include']?_[_0x7761('0x1c')](_0x5d63f1[_0x7761('0x1b')],function(_0x292478){return{'model':db[_0x292478[_0x7761('0x1d')]],'as':_0x292478['as'],'attributes':_0x292478[_0x7761('0x19')],'include':_0x292478[_0x7761('0x1b')]?_[_0x7761('0x1c')](_0x292478[_0x7761('0x1b')],function(_0x32d5a0){return{'model':db[_0x32d5a0[_0x7761('0x1d')]],'as':_0x32d5a0['as'],'attributes':_0x32d5a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x7761('0x8')](function(_0x118bfa){logger[_0x7761('0x9')]('GetServicenowAccount',_0x3f7193);logger[_0x7761('0xc')](_0x7761('0x13'),_0x3f7193,JSON[_0x7761('0xe')](_0x118bfa));_0x46ffdc(_0x118bfa);})[_0x7761('0x12')](function(_0x10f5d7){logger['error'](_0x7761('0x13'),_0x10f5d7[_0x7761('0x10')],_0x3f7193);_0x3c8d52(_0x512e29['error'](0x1f4,_0x10f5d7[_0x7761('0x10')]));});});};exports[_0x7761('0x1e')]=function(_0x1c00d8){var _0x179b9c=this;return new Promise(function(_0x355380,_0x208848){return db[_0x7761('0x14')]['find']({'raw':_0x1c00d8['options']?_0x1c00d8['options'][_0x7761('0x17')]===undefined?!![]:![]:!![],'where':_0x1c00d8[_0x7761('0x16')]?_0x1c00d8[_0x7761('0x16')][_0x7761('0x18')]||null:null,'attributes':_0x1c00d8[_0x7761('0x16')]?_0x1c00d8[_0x7761('0x16')][_0x7761('0x19')]||null:null,'include':_0x1c00d8[_0x7761('0x16')]?_0x1c00d8[_0x7761('0x16')][_0x7761('0x1b')]?_[_0x7761('0x1c')](_0x1c00d8[_0x7761('0x16')]['include'],function(_0x27d600){return{'model':db[_0x27d600[_0x7761('0x1d')]],'as':_0x27d600['as'],'attributes':_0x27d600['attributes'],'include':_0x27d600[_0x7761('0x1b')]?_['map'](_0x27d600[_0x7761('0x1b')],function(_0x2b2f32){return{'model':db[_0x2b2f32[_0x7761('0x1d')]],'as':_0x2b2f32['as'],'attributes':_0x2b2f32[_0x7761('0x19')],'include':_0x2b2f32['include']?_[_0x7761('0x1c')](_0x2b2f32[_0x7761('0x1b')],function(_0x2a6a5e){return{'model':db[_0x2a6a5e['model']],'as':_0x2a6a5e['as'],'attributes':_0x2a6a5e[_0x7761('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7761('0x8')](function(_0xd3c44d){logger[_0x7761('0x9')](_0x7761('0x1e'),_0x1c00d8);logger[_0x7761('0xc')]('ShowServicenowAccount',_0x1c00d8,JSON[_0x7761('0xe')](_0xd3c44d));_0x355380(_0xd3c44d);})['catch'](function(_0x44f96d){logger['error'](_0x7761('0x1e'),_0x44f96d[_0x7761('0x10')],_0x1c00d8);_0x208848(_0x179b9c[_0x7761('0xf')](0x1f4,_0x44f96d[_0x7761('0x10')]));});});};
\ No newline at end of file
+var _0xaaa0=['catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','stringify','ShowServicenowAccount','lodash','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0xaaa0,0x81));var _0x0aaa=function(_0x39ce8d,_0x1e31e6){_0x39ce8d=_0x39ce8d-0x0;var _0x18c856=_0xaaa0[_0x39ce8d];return _0x18c856;};'use strict';var _=require(_0x0aaa('0x0'));var util=require(_0x0aaa('0x1'));var moment=require(_0x0aaa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0aaa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0aaa('0x4'))(_0x0aaa('0x5'));var config=require('../../config/environment');var jayson=require(_0x0aaa('0x6'));var client=jayson[_0x0aaa('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e1184,_0x422ce8,_0xa07857){return new BPromise(function(_0x341c1e,_0x48f4b3){return client['request'](_0x2e1184,_0xa07857)[_0x0aaa('0x8')](function(_0x30cb14){logger[_0x0aaa('0x9')](_0x0aaa('0xa'),_0x422ce8,_0x0aaa('0xb'));logger[_0x0aaa('0xc')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x422ce8,_0x0aaa('0xb'),JSON['stringify'](_0x30cb14));if(_0x30cb14[_0x0aaa('0xd')]){if(_0x30cb14['error']['code']===0x1f4){logger[_0x0aaa('0xd')](_0x0aaa('0xa'),_0x422ce8,_0x30cb14[_0x0aaa('0xd')][_0x0aaa('0xe')]);return _0x48f4b3(_0x30cb14[_0x0aaa('0xd')][_0x0aaa('0xe')]);}logger['error'](_0x0aaa('0xa'),_0x422ce8,_0x30cb14['error'][_0x0aaa('0xe')]);return _0x341c1e(_0x30cb14[_0x0aaa('0xd')]['message']);}else{logger[_0x0aaa('0x9')](_0x0aaa('0xa'),_0x422ce8,_0x0aaa('0xb'));_0x341c1e(_0x30cb14[_0x0aaa('0xf')][_0x0aaa('0xe')]);}})[_0x0aaa('0x10')](function(_0x3d827e){logger[_0x0aaa('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x422ce8,_0x3d827e);_0x48f4b3(_0x3d827e);});});}exports[_0x0aaa('0x11')]=function(_0x3d6da9){var _0xacc182=this;return new Promise(function(_0x2d5d56,_0x5a77c4){return db[_0x0aaa('0x12')][_0x0aaa('0x13')]({'raw':_0x3d6da9[_0x0aaa('0x14')]?_0x3d6da9[_0x0aaa('0x14')][_0x0aaa('0x15')]===undefined?!![]:![]:!![],'where':_0x3d6da9[_0x0aaa('0x14')]?_0x3d6da9[_0x0aaa('0x14')][_0x0aaa('0x16')]||null:null,'attributes':_0x3d6da9[_0x0aaa('0x14')]?_0x3d6da9['options'][_0x0aaa('0x17')]||null:null,'limit':_0x3d6da9[_0x0aaa('0x14')]?_0x3d6da9[_0x0aaa('0x14')]['limit']||null:null,'include':_0x3d6da9[_0x0aaa('0x14')]?_0x3d6da9[_0x0aaa('0x14')][_0x0aaa('0x18')]?_[_0x0aaa('0x19')](_0x3d6da9[_0x0aaa('0x14')]['include'],function(_0x450faa){return{'model':db[_0x450faa['model']],'as':_0x450faa['as'],'attributes':_0x450faa[_0x0aaa('0x17')],'include':_0x450faa[_0x0aaa('0x18')]?_[_0x0aaa('0x19')](_0x450faa[_0x0aaa('0x18')],function(_0x350b60){return{'model':db[_0x350b60['model']],'as':_0x350b60['as'],'attributes':_0x350b60[_0x0aaa('0x17')],'include':_0x350b60[_0x0aaa('0x18')]?_['map'](_0x350b60[_0x0aaa('0x18')],function(_0x1111de){return{'model':db[_0x1111de[_0x0aaa('0x1a')]],'as':_0x1111de['as'],'attributes':_0x1111de[_0x0aaa('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35992c){logger[_0x0aaa('0x9')](_0x0aaa('0x11'),_0x3d6da9);logger[_0x0aaa('0xc')](_0x0aaa('0x11'),_0x3d6da9,JSON[_0x0aaa('0x1b')](_0x35992c));_0x2d5d56(_0x35992c);})['catch'](function(_0x5e4cf6){logger['error'](_0x0aaa('0x11'),_0x5e4cf6[_0x0aaa('0xe')],_0x3d6da9);_0x5a77c4(_0xacc182[_0x0aaa('0xd')](0x1f4,_0x5e4cf6[_0x0aaa('0xe')]));});});};exports[_0x0aaa('0x1c')]=function(_0x210d0f){var _0x55356d=this;return new Promise(function(_0x49bae6,_0x3534d2){return db[_0x0aaa('0x12')]['find']({'raw':_0x210d0f[_0x0aaa('0x14')]?_0x210d0f[_0x0aaa('0x14')][_0x0aaa('0x15')]===undefined?!![]:![]:!![],'where':_0x210d0f['options']?_0x210d0f[_0x0aaa('0x14')][_0x0aaa('0x16')]||null:null,'attributes':_0x210d0f[_0x0aaa('0x14')]?_0x210d0f[_0x0aaa('0x14')][_0x0aaa('0x17')]||null:null,'include':_0x210d0f['options']?_0x210d0f[_0x0aaa('0x14')][_0x0aaa('0x18')]?_[_0x0aaa('0x19')](_0x210d0f[_0x0aaa('0x14')][_0x0aaa('0x18')],function(_0x340268){return{'model':db[_0x340268[_0x0aaa('0x1a')]],'as':_0x340268['as'],'attributes':_0x340268['attributes'],'include':_0x340268[_0x0aaa('0x18')]?_[_0x0aaa('0x19')](_0x340268['include'],function(_0x47aa5c){return{'model':db[_0x47aa5c['model']],'as':_0x47aa5c['as'],'attributes':_0x47aa5c[_0x0aaa('0x17')],'include':_0x47aa5c[_0x0aaa('0x18')]?_[_0x0aaa('0x19')](_0x47aa5c[_0x0aaa('0x18')],function(_0x267fa1){return{'model':db[_0x267fa1[_0x0aaa('0x1a')]],'as':_0x267fa1['as'],'attributes':_0x267fa1[_0x0aaa('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0aaa('0x8')](function(_0x1f087c){logger[_0x0aaa('0x9')](_0x0aaa('0x1c'),_0x210d0f);logger['debug'](_0x0aaa('0x1c'),_0x210d0f,JSON['stringify'](_0x1f087c));_0x49bae6(_0x1f087c);})[_0x0aaa('0x10')](function(_0x11e66d){logger['error'](_0x0aaa('0x1c'),_0x11e66d[_0x0aaa('0xe')],_0x210d0f);_0x3534d2(_0x55356d[_0x0aaa('0xd')](0x1f4,_0x11e66d[_0x0aaa('0xe')]));});});};
\ No newline at end of file
index 152616e..08618b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda6a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','index','/:id','show','get','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','destroy','util','connect-timeout','express','fs-extra'];(function(_0x35ec0a,_0x217f46){var _0x2ea622=function(_0x394d83){while(--_0x394d83){_0x35ec0a['push'](_0x35ec0a['shift']());}};_0x2ea622(++_0x217f46);}(_0xda6a,0x1ca));var _0xada6=function(_0xa146d4,_0xbcd763){_0xa146d4=_0xa146d4-0x0;var _0x1bc92a=_0xda6a[_0xa146d4];return _0x1bc92a;};'use strict';var multer=require('multer');var util=require(_0xada6('0x0'));var path=require('path');var timeout=require(_0xada6('0x1'));var express=require(_0xada6('0x2'));var router=express['Router']();var fs_extra=require(_0xada6('0x3'));var auth=require(_0xada6('0x4'));var interaction=require(_0xada6('0x5'));var config=require(_0xada6('0x6'));var controller=require(_0xada6('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xada6('0x8')]);router['get'](_0xada6('0x9'),auth['isAuthenticated'](),controller[_0xada6('0xa')]);router[_0xada6('0xb')](_0xada6('0xc'),auth[_0xada6('0xd')](),controller[_0xada6('0xe')]);router['get'](_0xada6('0xf'),auth['isAuthenticated'](),controller[_0xada6('0x10')]);router[_0xada6('0xb')](_0xada6('0x11'),auth[_0xada6('0xd')](),controller[_0xada6('0x12')]);router[_0xada6('0x13')]('/',auth[_0xada6('0xd')](),controller['create']);router['put'](_0xada6('0x9'),auth[_0xada6('0xd')](),controller[_0xada6('0x14')]);router['delete']('/:id',auth[_0xada6('0xd')](),controller[_0xada6('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xe3e4=['../../config/environment','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x46df2b,_0x39df3f){var _0x29ebf1=function(_0x2bd89b){while(--_0x2bd89b){_0x46df2b['push'](_0x46df2b['shift']());}};_0x29ebf1(++_0x39df3f);}(_0xe3e4,0x186));var _0x4e3e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe3e4[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4e3e('0x0'));var timeout=require(_0x4e3e('0x1'));var express=require(_0x4e3e('0x2'));var router=express[_0x4e3e('0x3')]();var fs_extra=require(_0x4e3e('0x4'));var auth=require(_0x4e3e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4e3e('0x6'));var controller=require('./intServicenowConfiguration.controller');router[_0x4e3e('0x7')]('/',auth[_0x4e3e('0x8')](),controller[_0x4e3e('0x9')]);router[_0x4e3e('0x7')]('/:id',auth[_0x4e3e('0x8')](),controller['show']);router[_0x4e3e('0x7')](_0x4e3e('0xa'),auth[_0x4e3e('0x8')](),controller[_0x4e3e('0xb')]);router['get'](_0x4e3e('0xc'),auth[_0x4e3e('0x8')](),controller[_0x4e3e('0xd')]);router[_0x4e3e('0x7')](_0x4e3e('0xe'),auth['isAuthenticated'](),controller[_0x4e3e('0xf')]);router[_0x4e3e('0x10')]('/',auth[_0x4e3e('0x8')](),controller[_0x4e3e('0x11')]);router[_0x4e3e('0x12')](_0x4e3e('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x4e3e('0x14')](_0x4e3e('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x4e3e('0x15')]=router;
\ No newline at end of file
index db3d005..555140f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b1a=['STRING','sequelize'];(function(_0x34b1b8,_0x54c9bf){var _0x542dd8=function(_0xff3f89){while(--_0xff3f89){_0x34b1b8['push'](_0x34b1b8['shift']());}};_0x542dd8(++_0x54c9bf);}(_0x2b1a,0x6d));var _0xa2b1=function(_0x530ae2,_0x172dc9){_0x530ae2=_0x530ae2-0x0;var _0x15d1ae=_0x2b1a[_0x530ae2];return _0x15d1ae;};'use strict';var Sequelize=require(_0xa2b1('0x0'));module['exports']={'name':{'type':Sequelize[_0xa2b1('0x1')]},'description':{'type':Sequelize[_0xa2b1('0x1')]}};
\ No newline at end of file
+var _0x9fb5=['exports','STRING'];(function(_0x43be00,_0x5f35af){var _0x58e6e7=function(_0x49f542){while(--_0x49f542){_0x43be00['push'](_0x43be00['shift']());}};_0x58e6e7(++_0x5f35af);}(_0x9fb5,0x11c));var _0x59fb=function(_0x5b45a2,_0x5f3f5a){_0x5b45a2=_0x5b45a2-0x0;var _0x185edd=_0x9fb5[_0x5b45a2];return _0x185edd;};'use strict';var Sequelize=require('sequelize');module[_0x59fb('0x0')]={'name':{'type':Sequelize[_0x59fb('0x1')]},'description':{'type':Sequelize[_0x59fb('0x1')]}};
\ No newline at end of file
index a73334e..d0bd511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4784=['name','send','index','map','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','merge','options','ServicenowConfiguration','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','update','getFields','findOne','ServicenowField','filter','getSubjects','nolimit','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','stack'];(function(_0x5a8269,_0xfb2f54){var _0x539ed7=function(_0x31ce98){while(--_0x31ce98){_0x5a8269['push'](_0x5a8269['shift']());}};_0x539ed7(++_0xfb2f54);}(_0x4784,0x7b));var _0x4478=function(_0x19d1ba,_0x5cc112){_0x19d1ba=_0x19d1ba-0x0;var _0x17cd06=_0x4784[_0x19d1ba];return _0x17cd06;};'use strict';var emlformat=require(_0x4478('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4478('0x1'));var jsonpatch=require(_0x4478('0x2'));var rp=require(_0x4478('0x3'));var moment=require('moment');var BPromise=require(_0x4478('0x4'));var Mustache=require(_0x4478('0x5'));var util=require(_0x4478('0x6'));var path=require(_0x4478('0x7'));var sox=require(_0x4478('0x8'));var csv=require(_0x4478('0x9'));var ejs=require(_0x4478('0xa'));var fs=require('fs');var fs_extra=require(_0x4478('0xb'));var _=require(_0x4478('0xc'));var squel=require(_0x4478('0xd'));var crypto=require('crypto');var jsforce=require(_0x4478('0xe'));var deskjs=require(_0x4478('0xf'));var toCsv=require(_0x4478('0x9'));var querystring=require('querystring');var Papa=require(_0x4478('0x10'));var Redis=require(_0x4478('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4478('0x12'));var as=require(_0x4478('0x13'));var hardwareService=require(_0x4478('0x14'));var logger=require('../../config/logger')(_0x4478('0x15'));var utils=require(_0x4478('0x16'));var config=require(_0x4478('0x17'));var licenseUtil=require(_0x4478('0x18'));var db=require(_0x4478('0x19'))['db'];function respondWithStatusCode(_0x2c0c83,_0x25fa26){_0x25fa26=_0x25fa26||0xcc;return function(_0x3e8ca0){if(_0x3e8ca0){return _0x2c0c83[_0x4478('0x1a')](_0x25fa26);}return _0x2c0c83[_0x4478('0x1b')](_0x25fa26)[_0x4478('0x1c')]();};}function respondWithResult(_0x3f2e85,_0x106df6){_0x106df6=_0x106df6||0xc8;return function(_0x38941b){if(_0x38941b){return _0x3f2e85[_0x4478('0x1b')](_0x106df6)[_0x4478('0x1d')](_0x38941b);}};}function respondWithFilteredResult(_0x5361a3,_0x234284){return function(_0x699714){if(_0x699714){var _0x35eafa=typeof _0x234284[_0x4478('0x1e')]===_0x4478('0x1f')&&typeof _0x234284[_0x4478('0x20')]===_0x4478('0x1f');var _0x59c34c=_0x699714[_0x4478('0x21')];var _0x59ab69=_0x35eafa?0x0:_0x234284[_0x4478('0x1e')];var _0x2d1bdf=_0x35eafa?_0x699714['count']:_0x234284[_0x4478('0x1e')]+_0x234284['limit'];var _0x56cbc8;if(_0x2d1bdf>=_0x59c34c){_0x2d1bdf=_0x59c34c;_0x56cbc8=0xc8;}else{_0x56cbc8=0xce;}_0x5361a3['status'](_0x56cbc8);return _0x5361a3['set'](_0x4478('0x22'),_0x59ab69+'-'+_0x2d1bdf+'/'+_0x59c34c)[_0x4478('0x1d')](_0x699714);}return null;};}function patchUpdates(_0x2bc6a8){return function(_0x3e26cd){try{jsonpatch[_0x4478('0x23')](_0x3e26cd,_0x2bc6a8,!![]);}catch(_0x2b6935){return BPromise[_0x4478('0x24')](_0x2b6935);}return _0x3e26cd[_0x4478('0x25')]();};}function saveUpdates(_0xfda409,_0xf0df55){return function(_0x322c3b){if(_0x322c3b){return _0x322c3b['update'](_0xfda409)[_0x4478('0x26')](function(_0x3b0af6){return _0x3b0af6;});}return null;};}function removeEntity(_0x23bf97,_0x43bdb9){return function(_0x5300da){if(_0x5300da){return _0x5300da[_0x4478('0x27')]()[_0x4478('0x26')](function(){_0x23bf97[_0x4478('0x1b')](0xcc)[_0x4478('0x1c')]();});}};}function handleEntityNotFound(_0x323a50,_0xb4f06a){return function(_0x3a4923){if(!_0x3a4923){_0x323a50[_0x4478('0x1a')](0x194);}return _0x3a4923;};}function handleError(_0x229a96,_0x1ce430){_0x1ce430=_0x1ce430||0x1f4;return function(_0x2d8845){logger['error'](_0x2d8845[_0x4478('0x28')]);if(_0x2d8845[_0x4478('0x29')]){delete _0x2d8845[_0x4478('0x29')];}_0x229a96[_0x4478('0x1b')](_0x1ce430)[_0x4478('0x2a')](_0x2d8845);};}exports[_0x4478('0x2b')]=function(_0x5a0f97,_0x56253d){var _0x1ad332={},_0x159f2d={},_0x9ff993={'count':0x0,'rows':[]};var _0x555d5c=_[_0x4478('0x2c')](db['ServicenowConfiguration']['rawAttributes'],function(_0x1aba7b){return{'name':_0x1aba7b['fieldName'],'type':_0x1aba7b[_0x4478('0x2d')][_0x4478('0x2e')]};});_0x159f2d[_0x4478('0x2f')]=_[_0x4478('0x2c')](_0x555d5c,_0x4478('0x29'));_0x159f2d['query']=_[_0x4478('0x30')](_0x5a0f97[_0x4478('0x31')]);_0x159f2d['filters']=_['intersection'](_0x159f2d[_0x4478('0x2f')],_0x159f2d[_0x4478('0x31')]);_0x1ad332[_0x4478('0x32')]=_[_0x4478('0x33')](_0x159f2d[_0x4478('0x2f')],qs[_0x4478('0x34')](_0x5a0f97[_0x4478('0x31')][_0x4478('0x34')]));_0x1ad332[_0x4478('0x32')]=_0x1ad332[_0x4478('0x32')][_0x4478('0x35')]?_0x1ad332[_0x4478('0x32')]:_0x159f2d[_0x4478('0x2f')];if(!_0x5a0f97[_0x4478('0x31')][_0x4478('0x36')]('nolimit')){_0x1ad332[_0x4478('0x20')]=qs[_0x4478('0x20')](_0x5a0f97['query'][_0x4478('0x20')]);_0x1ad332['offset']=qs[_0x4478('0x1e')](_0x5a0f97[_0x4478('0x31')][_0x4478('0x1e')]);}_0x1ad332[_0x4478('0x37')]=qs[_0x4478('0x38')](_0x5a0f97['query'][_0x4478('0x38')]);_0x1ad332[_0x4478('0x39')]=qs[_0x4478('0x3a')](_[_0x4478('0x3b')](_0x5a0f97[_0x4478('0x31')],_0x159f2d[_0x4478('0x3a')]),_0x555d5c);if(_0x5a0f97[_0x4478('0x31')]['filter']){_0x1ad332[_0x4478('0x39')]=_['merge'](_0x1ad332[_0x4478('0x39')],{'$or':_['map'](_0x555d5c,function(_0x172997){if(_0x172997[_0x4478('0x2d')]!==_0x4478('0x3c')){var _0x116093={};_0x116093[_0x172997['name']]={'$like':'%'+_0x5a0f97[_0x4478('0x31')]['filter']+'%'};return _0x116093;}})});}_0x1ad332=_[_0x4478('0x3d')]({},_0x1ad332,_0x5a0f97[_0x4478('0x3e')]);var _0x2f0c35={'where':_0x1ad332[_0x4478('0x39')]};return db[_0x4478('0x3f')][_0x4478('0x21')](_0x2f0c35)['then'](function(_0x287fc3){_0x9ff993['count']=_0x287fc3;if(_0x5a0f97['query'][_0x4478('0x40')]){_0x1ad332[_0x4478('0x41')]=[{'all':!![]}];}return db[_0x4478('0x3f')][_0x4478('0x42')](_0x1ad332);})[_0x4478('0x26')](function(_0xa22fdb){_0x9ff993['rows']=_0xa22fdb;return _0x9ff993;})[_0x4478('0x26')](respondWithFilteredResult(_0x56253d,_0x1ad332))[_0x4478('0x43')](handleError(_0x56253d,null));};exports[_0x4478('0x44')]=function(_0x20c700,_0x443d2a){var _0x311b91={'raw':![],'where':{'id':_0x20c700[_0x4478('0x45')]['id']}},_0x3291c7={};_0x3291c7[_0x4478('0x2f')]=_[_0x4478('0x30')](db[_0x4478('0x3f')][_0x4478('0x46')]);_0x3291c7[_0x4478('0x31')]=_[_0x4478('0x30')](_0x20c700[_0x4478('0x31')]);_0x3291c7[_0x4478('0x3a')]=_[_0x4478('0x33')](_0x3291c7[_0x4478('0x2f')],_0x3291c7[_0x4478('0x31')]);_0x311b91[_0x4478('0x32')]=_[_0x4478('0x33')](_0x3291c7[_0x4478('0x2f')],qs['fields'](_0x20c700[_0x4478('0x31')]['fields']));_0x311b91[_0x4478('0x32')]=_0x311b91[_0x4478('0x32')][_0x4478('0x35')]?_0x311b91['attributes']:_0x3291c7[_0x4478('0x2f')];if(_0x20c700['query'][_0x4478('0x40')]){_0x311b91['include']=[{'all':!![]}];}_0x311b91=_[_0x4478('0x3d')]({},_0x311b91,_0x20c700[_0x4478('0x3e')]);return db[_0x4478('0x3f')][_0x4478('0x47')](_0x311b91)[_0x4478('0x26')](handleEntityNotFound(_0x443d2a,null))[_0x4478('0x26')](respondWithResult(_0x443d2a,null))['catch'](handleError(_0x443d2a,null));};exports[_0x4478('0x48')]=function(_0x4d319d,_0x3eec59){return db[_0x4478('0x3f')][_0x4478('0x48')](_0x4d319d[_0x4478('0x49')],{})[_0x4478('0x26')](respondWithResult(_0x3eec59,0xc9))[_0x4478('0x43')](handleError(_0x3eec59,null));};exports[_0x4478('0x4a')]=function(_0x5cb788,_0x41df4a){if(_0x5cb788[_0x4478('0x49')]['id']){delete _0x5cb788[_0x4478('0x49')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x5cb788[_0x4478('0x45')]['id']}})[_0x4478('0x26')](handleEntityNotFound(_0x41df4a,null))['then'](saveUpdates(_0x5cb788[_0x4478('0x49')],null))['then'](respondWithResult(_0x41df4a,null))[_0x4478('0x43')](handleError(_0x41df4a,null));};exports[_0x4478('0x27')]=function(_0x3333e9,_0x58d39c){return db[_0x4478('0x3f')]['find']({'where':{'id':_0x3333e9['params']['id']}})[_0x4478('0x26')](handleEntityNotFound(_0x58d39c,null))[_0x4478('0x26')](removeEntity(_0x58d39c,null))['catch'](handleError(_0x58d39c,null));};exports[_0x4478('0x4b')]=function(_0x531c9a,_0x12b036,_0x438acb){var _0x554af8={};var _0x3b547c={};var _0x27b2ce;var _0x1c7352;return db['ServicenowConfiguration'][_0x4478('0x4c')]({'where':{'id':_0x531c9a[_0x4478('0x45')]['id']}})[_0x4478('0x26')](handleEntityNotFound(_0x12b036,null))[_0x4478('0x26')](function(_0x2faaf4){if(_0x2faaf4){_0x27b2ce=_0x2faaf4;_0x3b547c[_0x4478('0x2f')]=_['keys'](db[_0x4478('0x4d')]['rawAttributes']);_0x3b547c['query']=_['keys'](_0x531c9a[_0x4478('0x31')]);_0x3b547c[_0x4478('0x3a')]=_[_0x4478('0x33')](_0x3b547c[_0x4478('0x2f')],_0x3b547c['query']);_0x554af8['attributes']=_[_0x4478('0x33')](_0x3b547c[_0x4478('0x2f')],qs[_0x4478('0x34')](_0x531c9a[_0x4478('0x31')][_0x4478('0x34')]));_0x554af8['attributes']=_0x554af8[_0x4478('0x32')]['length']?_0x554af8['attributes']:_0x3b547c[_0x4478('0x2f')];_0x554af8['order']=qs['sort'](_0x531c9a[_0x4478('0x31')][_0x4478('0x38')]);_0x554af8['where']=qs[_0x4478('0x3a')](_[_0x4478('0x3b')](_0x531c9a['query'],_0x3b547c[_0x4478('0x3a')]));if(_0x531c9a[_0x4478('0x31')]['filter']){_0x554af8[_0x4478('0x39')]=_[_0x4478('0x3d')](_0x554af8[_0x4478('0x39')],{'$or':_['map'](_0x554af8['attributes'],function(_0x364d8f){var _0x3341c2={};_0x3341c2[_0x364d8f]={'$like':'%'+_0x531c9a[_0x4478('0x31')][_0x4478('0x4e')]+'%'};return _0x3341c2;})});}_0x554af8=_[_0x4478('0x3d')]({},_0x554af8,_0x531c9a[_0x4478('0x3e')]);return _0x27b2ce[_0x4478('0x4b')](_0x554af8);}})[_0x4478('0x26')](function(_0x16aad7){if(_0x16aad7){_0x1c7352=_0x16aad7['length'];if(!_0x531c9a[_0x4478('0x31')][_0x4478('0x36')]('nolimit')){_0x554af8['limit']=qs[_0x4478('0x20')](_0x531c9a['query']['limit']);_0x554af8[_0x4478('0x1e')]=qs[_0x4478('0x1e')](_0x531c9a['query'][_0x4478('0x1e')]);}return _0x27b2ce['getFields'](_0x554af8);}})[_0x4478('0x26')](function(_0x1ffb07){if(_0x1ffb07){return _0x1ffb07?{'count':_0x1c7352,'rows':_0x1ffb07}:null;}})[_0x4478('0x26')](respondWithResult(_0x12b036,null))[_0x4478('0x43')](handleError(_0x12b036,null));};exports[_0x4478('0x4f')]=function(_0x102504,_0x432cab,_0x4dc2e5){var _0x1a039d={};var _0x371a0b={};var _0x1911e7;var _0x33ff40;return db[_0x4478('0x3f')][_0x4478('0x4c')]({'where':{'id':_0x102504['params']['id']}})[_0x4478('0x26')](handleEntityNotFound(_0x432cab,null))[_0x4478('0x26')](function(_0x324841){if(_0x324841){_0x1911e7=_0x324841;_0x371a0b[_0x4478('0x2f')]=_['keys'](db[_0x4478('0x4d')][_0x4478('0x46')]);_0x371a0b['query']=_[_0x4478('0x30')](_0x102504[_0x4478('0x31')]);_0x371a0b[_0x4478('0x3a')]=_[_0x4478('0x33')](_0x371a0b[_0x4478('0x2f')],_0x371a0b[_0x4478('0x31')]);_0x1a039d[_0x4478('0x32')]=_[_0x4478('0x33')](_0x371a0b[_0x4478('0x2f')],qs['fields'](_0x102504[_0x4478('0x31')][_0x4478('0x34')]));_0x1a039d[_0x4478('0x32')]=_0x1a039d[_0x4478('0x32')][_0x4478('0x35')]?_0x1a039d[_0x4478('0x32')]:_0x371a0b[_0x4478('0x2f')];_0x1a039d[_0x4478('0x37')]=qs[_0x4478('0x38')](_0x102504[_0x4478('0x31')]['sort']);_0x1a039d[_0x4478('0x39')]=qs[_0x4478('0x3a')](_[_0x4478('0x3b')](_0x102504[_0x4478('0x31')],_0x371a0b[_0x4478('0x3a')]));if(_0x102504[_0x4478('0x31')][_0x4478('0x4e')]){_0x1a039d[_0x4478('0x39')]=_['merge'](_0x1a039d[_0x4478('0x39')],{'$or':_[_0x4478('0x2c')](_0x1a039d[_0x4478('0x32')],function(_0xc9afbe){var _0x38806e={};_0x38806e[_0xc9afbe]={'$like':'%'+_0x102504['query'][_0x4478('0x4e')]+'%'};return _0x38806e;})});}_0x1a039d=_['merge']({},_0x1a039d,_0x102504['options']);return _0x1911e7['getSubjects'](_0x1a039d);}})[_0x4478('0x26')](function(_0x1f50b1){if(_0x1f50b1){_0x33ff40=_0x1f50b1[_0x4478('0x35')];if(!_0x102504[_0x4478('0x31')]['hasOwnProperty'](_0x4478('0x50'))){_0x1a039d['limit']=qs[_0x4478('0x20')](_0x102504[_0x4478('0x31')][_0x4478('0x20')]);_0x1a039d[_0x4478('0x1e')]=qs[_0x4478('0x1e')](_0x102504[_0x4478('0x31')]['offset']);}return _0x1911e7[_0x4478('0x4f')](_0x1a039d);}})[_0x4478('0x26')](function(_0x5a0bb8){if(_0x5a0bb8){return _0x5a0bb8?{'count':_0x33ff40,'rows':_0x5a0bb8}:null;}})[_0x4478('0x26')](respondWithResult(_0x432cab,null))[_0x4478('0x43')](handleError(_0x432cab,null));};exports[_0x4478('0x51')]=function(_0x15350c,_0x2ce0d2,_0x24663a){var _0xd39a4a={};var _0x6a2f2d={};var _0x5470a5;var _0x454961;return db[_0x4478('0x3f')][_0x4478('0x4c')]({'where':{'id':_0x15350c[_0x4478('0x45')]['id']}})[_0x4478('0x26')](handleEntityNotFound(_0x2ce0d2,null))['then'](function(_0x34e442){if(_0x34e442){_0x5470a5=_0x34e442;_0x6a2f2d[_0x4478('0x2f')]=_['keys'](db[_0x4478('0x4d')]['rawAttributes']);_0x6a2f2d[_0x4478('0x31')]=_[_0x4478('0x30')](_0x15350c[_0x4478('0x31')]);_0x6a2f2d[_0x4478('0x3a')]=_[_0x4478('0x33')](_0x6a2f2d[_0x4478('0x2f')],_0x6a2f2d[_0x4478('0x31')]);_0xd39a4a['attributes']=_[_0x4478('0x33')](_0x6a2f2d[_0x4478('0x2f')],qs[_0x4478('0x34')](_0x15350c[_0x4478('0x31')][_0x4478('0x34')]));_0xd39a4a[_0x4478('0x32')]=_0xd39a4a[_0x4478('0x32')][_0x4478('0x35')]?_0xd39a4a[_0x4478('0x32')]:_0x6a2f2d[_0x4478('0x2f')];_0xd39a4a[_0x4478('0x37')]=qs[_0x4478('0x38')](_0x15350c[_0x4478('0x31')]['sort']);_0xd39a4a['where']=qs['filters'](_[_0x4478('0x3b')](_0x15350c[_0x4478('0x31')],_0x6a2f2d[_0x4478('0x3a')]));if(_0x15350c['query'][_0x4478('0x4e')]){_0xd39a4a[_0x4478('0x39')]=_[_0x4478('0x3d')](_0xd39a4a[_0x4478('0x39')],{'$or':_[_0x4478('0x2c')](_0xd39a4a[_0x4478('0x32')],function(_0x5755e6){var _0x58e538={};_0x58e538[_0x5755e6]={'$like':'%'+_0x15350c[_0x4478('0x31')][_0x4478('0x4e')]+'%'};return _0x58e538;})});}_0xd39a4a=_[_0x4478('0x3d')]({},_0xd39a4a,_0x15350c[_0x4478('0x3e')]);return _0x5470a5['getDescriptions'](_0xd39a4a);}})[_0x4478('0x26')](function(_0x38f045){if(_0x38f045){_0x454961=_0x38f045[_0x4478('0x35')];if(!_0x15350c['query'][_0x4478('0x36')](_0x4478('0x50'))){_0xd39a4a[_0x4478('0x20')]=qs[_0x4478('0x20')](_0x15350c[_0x4478('0x31')][_0x4478('0x20')]);_0xd39a4a[_0x4478('0x1e')]=qs[_0x4478('0x1e')](_0x15350c[_0x4478('0x31')][_0x4478('0x1e')]);}return _0x5470a5[_0x4478('0x51')](_0xd39a4a);}})[_0x4478('0x26')](function(_0x193df2){if(_0x193df2){return _0x193df2?{'count':_0x454961,'rows':_0x193df2}:null;}})[_0x4478('0x26')](respondWithResult(_0x2ce0d2,null))[_0x4478('0x43')](handleError(_0x2ce0d2,null));};
\ No newline at end of file
+var _0xfb1c=['keys','query','filters','fields','length','attributes','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','intersection','find','catch','create','body','params','findOne','ServicenowField','order','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model'];(function(_0x55f568,_0x45ce60){var _0x2715f7=function(_0x5223db){while(--_0x5223db){_0x55f568['push'](_0x55f568['shift']());}};_0x2715f7(++_0x45ce60);}(_0xfb1c,0x153));var _0xcfb1=function(_0x2fc4ac,_0x9d882d){_0x2fc4ac=_0x2fc4ac-0x0;var _0x3b77af=_0xfb1c[_0x2fc4ac];return _0x3b77af;};'use strict';var emlformat=require(_0xcfb1('0x0'));var rimraf=require(_0xcfb1('0x1'));var zipdir=require(_0xcfb1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcfb1('0x3'));var moment=require(_0xcfb1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcfb1('0x5'));var util=require(_0xcfb1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcfb1('0x7'));var ejs=require(_0xcfb1('0x8'));var fs=require('fs');var fs_extra=require(_0xcfb1('0x9'));var _=require('lodash');var squel=require(_0xcfb1('0xa'));var crypto=require('crypto');var jsforce=require(_0xcfb1('0xb'));var deskjs=require(_0xcfb1('0xc'));var toCsv=require(_0xcfb1('0x7'));var querystring=require(_0xcfb1('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcfb1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcfb1('0xf'));var hardwareService=require(_0xcfb1('0x10'));var logger=require(_0xcfb1('0x11'))(_0xcfb1('0x12'));var utils=require(_0xcfb1('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcfb1('0x14'))['db'];function respondWithStatusCode(_0x40535c,_0x56685b){_0x56685b=_0x56685b||0xcc;return function(_0x490ece){if(_0x490ece){return _0x40535c[_0xcfb1('0x15')](_0x56685b);}return _0x40535c[_0xcfb1('0x16')](_0x56685b)[_0xcfb1('0x17')]();};}function respondWithResult(_0x2d3bad,_0x5cdb29){_0x5cdb29=_0x5cdb29||0xc8;return function(_0x56b6c9){if(_0x56b6c9){return _0x2d3bad[_0xcfb1('0x16')](_0x5cdb29)[_0xcfb1('0x18')](_0x56b6c9);}};}function respondWithFilteredResult(_0x3e1f53,_0x2fa43d){return function(_0x84c960){if(_0x84c960){var _0x246260=typeof _0x2fa43d[_0xcfb1('0x19')]===_0xcfb1('0x1a')&&typeof _0x2fa43d[_0xcfb1('0x1b')]===_0xcfb1('0x1a');var _0x567197=_0x84c960['count'];var _0x52f6bb=_0x246260?0x0:_0x2fa43d['offset'];var _0x4da796=_0x246260?_0x84c960[_0xcfb1('0x1c')]:_0x2fa43d[_0xcfb1('0x19')]+_0x2fa43d[_0xcfb1('0x1b')];var _0x459231;if(_0x4da796>=_0x567197){_0x4da796=_0x567197;_0x459231=0xc8;}else{_0x459231=0xce;}_0x3e1f53[_0xcfb1('0x16')](_0x459231);return _0x3e1f53[_0xcfb1('0x1d')](_0xcfb1('0x1e'),_0x52f6bb+'-'+_0x4da796+'/'+_0x567197)[_0xcfb1('0x18')](_0x84c960);}return null;};}function patchUpdates(_0x5d7aaf){return function(_0x29ce40){try{jsonpatch[_0xcfb1('0x1f')](_0x29ce40,_0x5d7aaf,!![]);}catch(_0x5f5d32){return BPromise['reject'](_0x5f5d32);}return _0x29ce40[_0xcfb1('0x20')]();};}function saveUpdates(_0x45a54e,_0x50a5e7){return function(_0x37ef9b){if(_0x37ef9b){return _0x37ef9b[_0xcfb1('0x21')](_0x45a54e)[_0xcfb1('0x22')](function(_0x3f83aa){return _0x3f83aa;});}return null;};}function removeEntity(_0x47beaa,_0xa70358){return function(_0x5e55c3){if(_0x5e55c3){return _0x5e55c3[_0xcfb1('0x23')]()[_0xcfb1('0x22')](function(){_0x47beaa['status'](0xcc)[_0xcfb1('0x17')]();});}};}function handleEntityNotFound(_0x4bbc25,_0x3879de){return function(_0x542411){if(!_0x542411){_0x4bbc25[_0xcfb1('0x15')](0x194);}return _0x542411;};}function handleError(_0x2f17a9,_0x5b7435){_0x5b7435=_0x5b7435||0x1f4;return function(_0x502898){logger[_0xcfb1('0x24')](_0x502898['stack']);if(_0x502898['name']){delete _0x502898[_0xcfb1('0x25')];}_0x2f17a9[_0xcfb1('0x16')](_0x5b7435)['send'](_0x502898);};}exports[_0xcfb1('0x26')]=function(_0x28dbac,_0x4103d0){var _0x3c9b37={},_0x393426={},_0x39f099={'count':0x0,'rows':[]};var _0x4693ab=_[_0xcfb1('0x27')](db[_0xcfb1('0x28')][_0xcfb1('0x29')],function(_0x51b3ab){return{'name':_0x51b3ab[_0xcfb1('0x2a')],'type':_0x51b3ab[_0xcfb1('0x2b')][_0xcfb1('0x2c')]};});_0x393426[_0xcfb1('0x2d')]=_[_0xcfb1('0x27')](_0x4693ab,_0xcfb1('0x25'));_0x393426['query']=_[_0xcfb1('0x2e')](_0x28dbac[_0xcfb1('0x2f')]);_0x393426[_0xcfb1('0x30')]=_['intersection'](_0x393426[_0xcfb1('0x2d')],_0x393426[_0xcfb1('0x2f')]);_0x3c9b37['attributes']=_['intersection'](_0x393426[_0xcfb1('0x2d')],qs['fields'](_0x28dbac[_0xcfb1('0x2f')][_0xcfb1('0x31')]));_0x3c9b37['attributes']=_0x3c9b37['attributes'][_0xcfb1('0x32')]?_0x3c9b37[_0xcfb1('0x33')]:_0x393426[_0xcfb1('0x2d')];if(!_0x28dbac[_0xcfb1('0x2f')]['hasOwnProperty'](_0xcfb1('0x34'))){_0x3c9b37[_0xcfb1('0x1b')]=qs[_0xcfb1('0x1b')](_0x28dbac[_0xcfb1('0x2f')][_0xcfb1('0x1b')]);_0x3c9b37[_0xcfb1('0x19')]=qs[_0xcfb1('0x19')](_0x28dbac['query']['offset']);}_0x3c9b37['order']=qs[_0xcfb1('0x35')](_0x28dbac[_0xcfb1('0x2f')]['sort']);_0x3c9b37['where']=qs['filters'](_[_0xcfb1('0x36')](_0x28dbac[_0xcfb1('0x2f')],_0x393426[_0xcfb1('0x30')]),_0x4693ab);if(_0x28dbac[_0xcfb1('0x2f')][_0xcfb1('0x37')]){_0x3c9b37[_0xcfb1('0x38')]=_[_0xcfb1('0x39')](_0x3c9b37[_0xcfb1('0x38')],{'$or':_[_0xcfb1('0x27')](_0x4693ab,function(_0x11545d){if(_0x11545d[_0xcfb1('0x2b')]!==_0xcfb1('0x3a')){var _0xcb74b1={};_0xcb74b1[_0x11545d[_0xcfb1('0x25')]]={'$like':'%'+_0x28dbac[_0xcfb1('0x2f')][_0xcfb1('0x37')]+'%'};return _0xcb74b1;}})});}_0x3c9b37=_[_0xcfb1('0x39')]({},_0x3c9b37,_0x28dbac[_0xcfb1('0x3b')]);var _0x304e65={'where':_0x3c9b37[_0xcfb1('0x38')]};return db[_0xcfb1('0x28')][_0xcfb1('0x1c')](_0x304e65)['then'](function(_0x1bb4ee){_0x39f099[_0xcfb1('0x1c')]=_0x1bb4ee;if(_0x28dbac[_0xcfb1('0x2f')][_0xcfb1('0x3c')]){_0x3c9b37[_0xcfb1('0x3d')]=[{'all':!![]}];}return db[_0xcfb1('0x28')][_0xcfb1('0x3e')](_0x3c9b37);})[_0xcfb1('0x22')](function(_0x170e93){_0x39f099['rows']=_0x170e93;return _0x39f099;})[_0xcfb1('0x22')](respondWithFilteredResult(_0x4103d0,_0x3c9b37))['catch'](handleError(_0x4103d0,null));};exports[_0xcfb1('0x3f')]=function(_0x11fc3e,_0x26c9fe){var _0xb73342={'raw':![],'where':{'id':_0x11fc3e['params']['id']}},_0x2ef847={};_0x2ef847[_0xcfb1('0x2d')]=_[_0xcfb1('0x2e')](db[_0xcfb1('0x28')][_0xcfb1('0x29')]);_0x2ef847['query']=_[_0xcfb1('0x2e')](_0x11fc3e[_0xcfb1('0x2f')]);_0x2ef847['filters']=_[_0xcfb1('0x40')](_0x2ef847[_0xcfb1('0x2d')],_0x2ef847['query']);_0xb73342[_0xcfb1('0x33')]=_[_0xcfb1('0x40')](_0x2ef847['model'],qs[_0xcfb1('0x31')](_0x11fc3e[_0xcfb1('0x2f')]['fields']));_0xb73342[_0xcfb1('0x33')]=_0xb73342[_0xcfb1('0x33')][_0xcfb1('0x32')]?_0xb73342[_0xcfb1('0x33')]:_0x2ef847['model'];if(_0x11fc3e[_0xcfb1('0x2f')]['includeAll']){_0xb73342['include']=[{'all':!![]}];}_0xb73342=_[_0xcfb1('0x39')]({},_0xb73342,_0x11fc3e[_0xcfb1('0x3b')]);return db[_0xcfb1('0x28')][_0xcfb1('0x41')](_0xb73342)[_0xcfb1('0x22')](handleEntityNotFound(_0x26c9fe,null))[_0xcfb1('0x22')](respondWithResult(_0x26c9fe,null))[_0xcfb1('0x42')](handleError(_0x26c9fe,null));};exports[_0xcfb1('0x43')]=function(_0x300891,_0x2f7445){return db[_0xcfb1('0x28')][_0xcfb1('0x43')](_0x300891[_0xcfb1('0x44')],{})[_0xcfb1('0x22')](respondWithResult(_0x2f7445,0xc9))[_0xcfb1('0x42')](handleError(_0x2f7445,null));};exports['update']=function(_0x407dde,_0x38cd92){if(_0x407dde[_0xcfb1('0x44')]['id']){delete _0x407dde[_0xcfb1('0x44')]['id'];}return db[_0xcfb1('0x28')][_0xcfb1('0x41')]({'where':{'id':_0x407dde['params']['id']}})[_0xcfb1('0x22')](handleEntityNotFound(_0x38cd92,null))['then'](saveUpdates(_0x407dde[_0xcfb1('0x44')],null))[_0xcfb1('0x22')](respondWithResult(_0x38cd92,null))[_0xcfb1('0x42')](handleError(_0x38cd92,null));};exports[_0xcfb1('0x23')]=function(_0x1d6615,_0xe17a86){return db[_0xcfb1('0x28')][_0xcfb1('0x41')]({'where':{'id':_0x1d6615[_0xcfb1('0x45')]['id']}})[_0xcfb1('0x22')](handleEntityNotFound(_0xe17a86,null))[_0xcfb1('0x22')](removeEntity(_0xe17a86,null))['catch'](handleError(_0xe17a86,null));};exports['getFields']=function(_0x52967e,_0x4fc6ba,_0x1b22c1){var _0x122597={};var _0x10a117={};var _0x174256;var _0x8de02e;return db['ServicenowConfiguration'][_0xcfb1('0x46')]({'where':{'id':_0x52967e[_0xcfb1('0x45')]['id']}})[_0xcfb1('0x22')](handleEntityNotFound(_0x4fc6ba,null))[_0xcfb1('0x22')](function(_0xfda788){if(_0xfda788){_0x174256=_0xfda788;_0x10a117[_0xcfb1('0x2d')]=_[_0xcfb1('0x2e')](db[_0xcfb1('0x47')][_0xcfb1('0x29')]);_0x10a117[_0xcfb1('0x2f')]=_['keys'](_0x52967e[_0xcfb1('0x2f')]);_0x10a117[_0xcfb1('0x30')]=_['intersection'](_0x10a117[_0xcfb1('0x2d')],_0x10a117['query']);_0x122597[_0xcfb1('0x33')]=_['intersection'](_0x10a117[_0xcfb1('0x2d')],qs[_0xcfb1('0x31')](_0x52967e['query'][_0xcfb1('0x31')]));_0x122597[_0xcfb1('0x33')]=_0x122597[_0xcfb1('0x33')][_0xcfb1('0x32')]?_0x122597[_0xcfb1('0x33')]:_0x10a117[_0xcfb1('0x2d')];_0x122597[_0xcfb1('0x48')]=qs['sort'](_0x52967e[_0xcfb1('0x2f')][_0xcfb1('0x35')]);_0x122597['where']=qs[_0xcfb1('0x30')](_[_0xcfb1('0x36')](_0x52967e['query'],_0x10a117[_0xcfb1('0x30')]));if(_0x52967e[_0xcfb1('0x2f')][_0xcfb1('0x37')]){_0x122597['where']=_['merge'](_0x122597[_0xcfb1('0x38')],{'$or':_[_0xcfb1('0x27')](_0x122597[_0xcfb1('0x33')],function(_0x5b087a){var _0xae404e={};_0xae404e[_0x5b087a]={'$like':'%'+_0x52967e[_0xcfb1('0x2f')]['filter']+'%'};return _0xae404e;})});}_0x122597=_['merge']({},_0x122597,_0x52967e[_0xcfb1('0x3b')]);return _0x174256[_0xcfb1('0x49')](_0x122597);}})[_0xcfb1('0x22')](function(_0x1bcc6f){if(_0x1bcc6f){_0x8de02e=_0x1bcc6f[_0xcfb1('0x32')];if(!_0x52967e[_0xcfb1('0x2f')][_0xcfb1('0x4a')]('nolimit')){_0x122597[_0xcfb1('0x1b')]=qs[_0xcfb1('0x1b')](_0x52967e[_0xcfb1('0x2f')][_0xcfb1('0x1b')]);_0x122597[_0xcfb1('0x19')]=qs['offset'](_0x52967e[_0xcfb1('0x2f')]['offset']);}return _0x174256[_0xcfb1('0x49')](_0x122597);}})[_0xcfb1('0x22')](function(_0x3a1452){if(_0x3a1452){return _0x3a1452?{'count':_0x8de02e,'rows':_0x3a1452}:null;}})['then'](respondWithResult(_0x4fc6ba,null))['catch'](handleError(_0x4fc6ba,null));};exports[_0xcfb1('0x4b')]=function(_0x25d664,_0x3842bc,_0x1d01c9){var _0x9634fe={};var _0x24dc07={};var _0x33a27e;var _0x4a93d3;return db[_0xcfb1('0x28')][_0xcfb1('0x46')]({'where':{'id':_0x25d664['params']['id']}})[_0xcfb1('0x22')](handleEntityNotFound(_0x3842bc,null))[_0xcfb1('0x22')](function(_0x2b2f8b){if(_0x2b2f8b){_0x33a27e=_0x2b2f8b;_0x24dc07[_0xcfb1('0x2d')]=_[_0xcfb1('0x2e')](db[_0xcfb1('0x47')][_0xcfb1('0x29')]);_0x24dc07['query']=_[_0xcfb1('0x2e')](_0x25d664['query']);_0x24dc07[_0xcfb1('0x30')]=_[_0xcfb1('0x40')](_0x24dc07[_0xcfb1('0x2d')],_0x24dc07[_0xcfb1('0x2f')]);_0x9634fe['attributes']=_[_0xcfb1('0x40')](_0x24dc07[_0xcfb1('0x2d')],qs[_0xcfb1('0x31')](_0x25d664['query'][_0xcfb1('0x31')]));_0x9634fe['attributes']=_0x9634fe[_0xcfb1('0x33')][_0xcfb1('0x32')]?_0x9634fe[_0xcfb1('0x33')]:_0x24dc07[_0xcfb1('0x2d')];_0x9634fe[_0xcfb1('0x48')]=qs['sort'](_0x25d664[_0xcfb1('0x2f')][_0xcfb1('0x35')]);_0x9634fe[_0xcfb1('0x38')]=qs['filters'](_[_0xcfb1('0x36')](_0x25d664[_0xcfb1('0x2f')],_0x24dc07[_0xcfb1('0x30')]));if(_0x25d664[_0xcfb1('0x2f')][_0xcfb1('0x37')]){_0x9634fe[_0xcfb1('0x38')]=_['merge'](_0x9634fe['where'],{'$or':_[_0xcfb1('0x27')](_0x9634fe[_0xcfb1('0x33')],function(_0x1b80ae){var _0x52a510={};_0x52a510[_0x1b80ae]={'$like':'%'+_0x25d664[_0xcfb1('0x2f')]['filter']+'%'};return _0x52a510;})});}_0x9634fe=_['merge']({},_0x9634fe,_0x25d664[_0xcfb1('0x3b')]);return _0x33a27e[_0xcfb1('0x4b')](_0x9634fe);}})[_0xcfb1('0x22')](function(_0x220136){if(_0x220136){_0x4a93d3=_0x220136[_0xcfb1('0x32')];if(!_0x25d664[_0xcfb1('0x2f')][_0xcfb1('0x4a')]('nolimit')){_0x9634fe[_0xcfb1('0x1b')]=qs[_0xcfb1('0x1b')](_0x25d664['query']['limit']);_0x9634fe['offset']=qs[_0xcfb1('0x19')](_0x25d664[_0xcfb1('0x2f')]['offset']);}return _0x33a27e[_0xcfb1('0x4b')](_0x9634fe);}})[_0xcfb1('0x22')](function(_0x4486d5){if(_0x4486d5){return _0x4486d5?{'count':_0x4a93d3,'rows':_0x4486d5}:null;}})[_0xcfb1('0x22')](respondWithResult(_0x3842bc,null))[_0xcfb1('0x42')](handleError(_0x3842bc,null));};exports[_0xcfb1('0x4c')]=function(_0x282b48,_0x58f1d0,_0x4c4ea1){var _0x330653={};var _0xd1013d={};var _0x4ac45d;var _0x105f7f;return db[_0xcfb1('0x28')]['findOne']({'where':{'id':_0x282b48[_0xcfb1('0x45')]['id']}})[_0xcfb1('0x22')](handleEntityNotFound(_0x58f1d0,null))[_0xcfb1('0x22')](function(_0x1c7dbf){if(_0x1c7dbf){_0x4ac45d=_0x1c7dbf;_0xd1013d[_0xcfb1('0x2d')]=_[_0xcfb1('0x2e')](db[_0xcfb1('0x47')][_0xcfb1('0x29')]);_0xd1013d[_0xcfb1('0x2f')]=_[_0xcfb1('0x2e')](_0x282b48[_0xcfb1('0x2f')]);_0xd1013d[_0xcfb1('0x30')]=_[_0xcfb1('0x40')](_0xd1013d['model'],_0xd1013d[_0xcfb1('0x2f')]);_0x330653[_0xcfb1('0x33')]=_['intersection'](_0xd1013d['model'],qs[_0xcfb1('0x31')](_0x282b48['query']['fields']));_0x330653['attributes']=_0x330653['attributes'][_0xcfb1('0x32')]?_0x330653[_0xcfb1('0x33')]:_0xd1013d[_0xcfb1('0x2d')];_0x330653['order']=qs[_0xcfb1('0x35')](_0x282b48[_0xcfb1('0x2f')][_0xcfb1('0x35')]);_0x330653[_0xcfb1('0x38')]=qs[_0xcfb1('0x30')](_[_0xcfb1('0x36')](_0x282b48[_0xcfb1('0x2f')],_0xd1013d[_0xcfb1('0x30')]));if(_0x282b48[_0xcfb1('0x2f')][_0xcfb1('0x37')]){_0x330653['where']=_['merge'](_0x330653['where'],{'$or':_[_0xcfb1('0x27')](_0x330653[_0xcfb1('0x33')],function(_0x4d2dd7){var _0x41003d={};_0x41003d[_0x4d2dd7]={'$like':'%'+_0x282b48[_0xcfb1('0x2f')][_0xcfb1('0x37')]+'%'};return _0x41003d;})});}_0x330653=_[_0xcfb1('0x39')]({},_0x330653,_0x282b48[_0xcfb1('0x3b')]);return _0x4ac45d['getDescriptions'](_0x330653);}})[_0xcfb1('0x22')](function(_0x34d578){if(_0x34d578){_0x105f7f=_0x34d578['length'];if(!_0x282b48['query']['hasOwnProperty']('nolimit')){_0x330653[_0xcfb1('0x1b')]=qs[_0xcfb1('0x1b')](_0x282b48['query'][_0xcfb1('0x1b')]);_0x330653[_0xcfb1('0x19')]=qs[_0xcfb1('0x19')](_0x282b48[_0xcfb1('0x2f')]['offset']);}return _0x4ac45d['getDescriptions'](_0x330653);}})['then'](function(_0x305815){if(_0x305815){return _0x305815?{'count':_0x105f7f,'rows':_0x305815}:null;}})[_0xcfb1('0x22')](respondWithResult(_0x58f1d0,null))[_0xcfb1('0x42')](handleError(_0x58f1d0,null));};
\ No newline at end of file
index 54ace33..4e6b306 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','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x119b3e,_0x588d50){var _0x1169ae=function(_0x377422){while(--_0x377422){_0x119b3e['push'](_0x119b3e['shift']());}};_0x1169ae(++_0x588d50);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x2eb12f,_0x2b8cab){_0x2eb12f=_0x2eb12f-0x0;var _0x3d4c28=_0xd4f4[_0x2eb12f];return _0x3d4c28;};'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 _0x35ff=['../../config/logger','moment','bluebird','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','util'];(function(_0x1608d8,_0x24bc49){var _0x290e67=function(_0x473681){while(--_0x473681){_0x1608d8['push'](_0x1608d8['shift']());}};_0x290e67(++_0x24bc49);}(_0x35ff,0xb3));var _0xf35f=function(_0x3016dc,_0x524668){_0x3016dc=_0x3016dc-0x0;var _0x42b331=_0x35ff[_0x3016dc];return _0x42b331;};'use strict';var _=require('lodash');var util=require(_0xf35f('0x0'));var logger=require(_0xf35f('0x1'))('api');var moment=require(_0xf35f('0x2'));var BPromise=require(_0xf35f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf35f('0x4'));var rimraf=require('rimraf');var config=require(_0xf35f('0x5'));var attributes=require(_0xf35f('0x6'));module[_0xf35f('0x7')]=function(_0x1f9847,_0x1821a6){return _0x1f9847[_0xf35f('0x8')]('ServicenowConfiguration',attributes,{'tableName':_0xf35f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7cee622..1218820 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f00=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x7048c9,_0x32cd20){var _0x5a20fa=function(_0x3c1cba){while(--_0x3c1cba){_0x7048c9['push'](_0x7048c9['shift']());}};_0x5a20fa(++_0x32cd20);}(_0x7f00,0x161));var _0x07f0=function(_0x1af8d3,_0x544d86){_0x1af8d3=_0x1af8d3-0x0;var _0x3a50c5=_0x7f00[_0x1af8d3];return _0x3a50c5;};'use strict';var _=require(_0x07f0('0x0'));var util=require(_0x07f0('0x1'));var moment=require(_0x07f0('0x2'));var BPromise=require(_0x07f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x07f0('0x4'))['db'];var utils=require(_0x07f0('0x5'));var logger=require(_0x07f0('0x6'))(_0x07f0('0x7'));var config=require(_0x07f0('0x8'));var jayson=require(_0x07f0('0x9'));var client=jayson['client'][_0x07f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbff75e,_0xaada98,_0x5bfcc4){return new BPromise(function(_0x495d73,_0x449ed0){return client[_0x07f0('0xb')](_0xbff75e,_0x5bfcc4)[_0x07f0('0xc')](function(_0x4a3b1d){logger[_0x07f0('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0xaada98,_0x07f0('0xe'));logger[_0x07f0('0xf')](_0x07f0('0x10'),_0xaada98,_0x07f0('0xe'),JSON[_0x07f0('0x11')](_0x4a3b1d));if(_0x4a3b1d[_0x07f0('0x12')]){if(_0x4a3b1d['error']['code']===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0xaada98,_0x4a3b1d[_0x07f0('0x12')][_0x07f0('0x13')]);return _0x449ed0(_0x4a3b1d[_0x07f0('0x12')][_0x07f0('0x13')]);}logger[_0x07f0('0x12')](_0x07f0('0x14'),_0xaada98,_0x4a3b1d['error'][_0x07f0('0x13')]);return _0x495d73(_0x4a3b1d['error'][_0x07f0('0x13')]);}else{logger[_0x07f0('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0xaada98,_0x07f0('0xe'));_0x495d73(_0x4a3b1d['result'][_0x07f0('0x13')]);}})[_0x07f0('0x15')](function(_0x2e5b8d){logger[_0x07f0('0x12')](_0x07f0('0x14'),_0xaada98,_0x2e5b8d);_0x449ed0(_0x2e5b8d);});});}
\ No newline at end of file
+var _0xa647=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0xa647,0x81));var _0x7a64=function(_0x3396aa,_0x4203a0){_0x3396aa=_0x3396aa-0x0;var _0x1b7883=_0xa647[_0x3396aa];return _0x1b7883;};'use strict';var _=require(_0x7a64('0x0'));var util=require(_0x7a64('0x1'));var moment=require(_0x7a64('0x2'));var BPromise=require(_0x7a64('0x3'));var rs=require(_0x7a64('0x4'));var fs=require('fs');var Redis=require(_0x7a64('0x5'));var db=require(_0x7a64('0x6'))['db'];var utils=require(_0x7a64('0x7'));var logger=require(_0x7a64('0x8'))(_0x7a64('0x9'));var config=require(_0x7a64('0xa'));var jayson=require(_0x7a64('0xb'));var client=jayson['client'][_0x7a64('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b5633,_0x597981,_0x438197){return new BPromise(function(_0x254879,_0x13ea76){return client[_0x7a64('0xd')](_0x1b5633,_0x438197)[_0x7a64('0xe')](function(_0xba70c4){logger[_0x7a64('0xf')](_0x7a64('0x10'),_0x597981,_0x7a64('0x11'));logger[_0x7a64('0x12')](_0x7a64('0x13'),_0x597981,_0x7a64('0x11'),JSON[_0x7a64('0x14')](_0xba70c4));if(_0xba70c4['error']){if(_0xba70c4[_0x7a64('0x15')][_0x7a64('0x16')]===0x1f4){logger['error'](_0x7a64('0x10'),_0x597981,_0xba70c4[_0x7a64('0x15')][_0x7a64('0x17')]);return _0x13ea76(_0xba70c4['error'][_0x7a64('0x17')]);}logger[_0x7a64('0x15')](_0x7a64('0x10'),_0x597981,_0xba70c4[_0x7a64('0x15')][_0x7a64('0x17')]);return _0x254879(_0xba70c4[_0x7a64('0x15')][_0x7a64('0x17')]);}else{logger['info'](_0x7a64('0x10'),_0x597981,_0x7a64('0x11'));_0x254879(_0xba70c4['result'][_0x7a64('0x17')]);}})[_0x7a64('0x18')](function(_0x2a55ee){logger['error'](_0x7a64('0x10'),_0x597981,_0x2a55ee);_0x13ea76(_0x2a55ee);});});}
\ No newline at end of file
index 32239fa..c39d9ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c12=['/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index'];(function(_0x5cdc79,_0x24beb1){var _0x22ddcf=function(_0x1f92bf){while(--_0x1f92bf){_0x5cdc79['push'](_0x5cdc79['shift']());}};_0x22ddcf(++_0x24beb1);}(_0x2c12,0x1db));var _0x22c1=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x2c12[_0x5bfa44];return _0x43815f;};'use strict';var multer=require(_0x22c1('0x0'));var util=require('util');var path=require(_0x22c1('0x1'));var timeout=require(_0x22c1('0x2'));var express=require('express');var router=express[_0x22c1('0x3')]();var fs_extra=require(_0x22c1('0x4'));var auth=require(_0x22c1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22c1('0x6'));var controller=require(_0x22c1('0x7'));router[_0x22c1('0x8')]('/',auth[_0x22c1('0x9')](),controller[_0x22c1('0xa')]);router['get'](_0x22c1('0xb'),auth[_0x22c1('0x9')](),controller[_0x22c1('0xc')]);router[_0x22c1('0xd')]('/',auth['isAuthenticated'](),controller[_0x22c1('0xe')]);router['put'](_0x22c1('0xb'),auth[_0x22c1('0x9')](),controller[_0x22c1('0xf')]);router[_0x22c1('0x10')](_0x22c1('0xb'),auth[_0x22c1('0x9')](),controller['destroy']);module[_0x22c1('0x11')]=router;
\ No newline at end of file
+var _0x476a=['post','put','/:id','update','delete','destroy','exports','multer','util','path','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x3d460e,_0x1ab521){var _0x222361=function(_0x3a0319){while(--_0x3a0319){_0x3d460e['push'](_0x3d460e['shift']());}};_0x222361(++_0x1ab521);}(_0x476a,0x187));var _0xa476=function(_0x3e2b4e,_0x5cba62){_0x3e2b4e=_0x3e2b4e-0x0;var _0xa545e9=_0x476a[_0x3e2b4e];return _0xa545e9;};'use strict';var multer=require(_0xa476('0x0'));var util=require(_0xa476('0x1'));var path=require(_0xa476('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa476('0x3'));var config=require(_0xa476('0x4'));var controller=require('./intServicenowField.controller');router[_0xa476('0x5')]('/',auth[_0xa476('0x6')](),controller[_0xa476('0x7')]);router[_0xa476('0x5')]('/:id',auth[_0xa476('0x6')](),controller[_0xa476('0x8')]);router[_0xa476('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa476('0xa')](_0xa476('0xb'),auth['isAuthenticated'](),controller[_0xa476('0xc')]);router[_0xa476('0xd')]('/:id',auth[_0xa476('0x6')](),controller[_0xa476('0xe')]);module[_0xa476('0xf')]=router;
\ No newline at end of file
index 28a4b3f..7ea4c4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6629=['exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0xc4ea75,_0x273753){var _0x52ea5e=function(_0x1ee872){while(--_0x1ee872){_0xc4ea75['push'](_0xc4ea75['shift']());}};_0x52ea5e(++_0x273753);}(_0x6629,0x149));var _0x9662=function(_0x5e9f9f,_0x5bafc0){_0x5e9f9f=_0x5e9f9f-0x0;var _0x2eec7b=_0x6629[_0x5e9f9f];return _0x2eec7b;};'use strict';var Sequelize=require(_0x9662('0x0'));module[_0x9662('0x1')]={'type':{'type':Sequelize[_0x9662('0x2')](_0x9662('0x3'),_0x9662('0x4'),'customVariable',_0x9662('0x5'),_0x9662('0x6')),'defaultValue':_0x9662('0x3')},'content':{'type':Sequelize[_0x9662('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9662('0x2')](_0x9662('0x3'),_0x9662('0x4'),_0x9662('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9662('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9662('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9662('0x7')]}};
\ No newline at end of file
+var _0x0a53=['string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN'];(function(_0x548723,_0x3cc1bc){var _0x2f522d=function(_0xe03e4e){while(--_0xe03e4e){_0x548723['push'](_0x548723['shift']());}};_0x2f522d(++_0x3cc1bc);}(_0x0a53,0x18f));var _0x30a5=function(_0x1ab35d,_0x3f401d){_0x1ab35d=_0x1ab35d-0x0;var _0x133d6d=_0x0a53[_0x1ab35d];return _0x133d6d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x30a5('0x0'),'variable',_0x30a5('0x1'),_0x30a5('0x2'),'picklist'),'defaultValue':_0x30a5('0x0')},'content':{'type':Sequelize[_0x30a5('0x3')]},'key':{'type':Sequelize[_0x30a5('0x3')]},'keyType':{'type':Sequelize[_0x30a5('0x4')](_0x30a5('0x0'),_0x30a5('0x5'),_0x30a5('0x1'))},'keyContent':{'type':Sequelize[_0x30a5('0x3')]},'idField':{'type':Sequelize[_0x30a5('0x3')]},'nameField':{'type':Sequelize[_0x30a5('0x3')]},'customField':{'type':Sequelize[_0x30a5('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x30a5('0x3')]}};
\ No newline at end of file
index 98d4829..35599a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42f1=['fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','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','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','error','stack','name','map','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowField','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','create','body','zip-dir'];(function(_0x1937b1,_0x4490b2){var _0x38c867=function(_0x5f0d4a){while(--_0x5f0d4a){_0x1937b1['push'](_0x1937b1['shift']());}};_0x38c867(++_0x4490b2);}(_0x42f1,0x8f));var _0x142f=function(_0x4eff2a,_0x345222){_0x4eff2a=_0x4eff2a-0x0;var _0x5cd527=_0x42f1[_0x4eff2a];return _0x5cd527;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x142f('0x0'));var jsonpatch=require(_0x142f('0x1'));var rp=require(_0x142f('0x2'));var moment=require(_0x142f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x142f('0x4'));var path=require(_0x142f('0x5'));var sox=require(_0x142f('0x6'));var csv=require(_0x142f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x142f('0x8'));var _=require(_0x142f('0x9'));var squel=require('squel');var crypto=require(_0x142f('0xa'));var jsforce=require(_0x142f('0xb'));var deskjs=require(_0x142f('0xc'));var toCsv=require(_0x142f('0x7'));var querystring=require(_0x142f('0xd'));var Papa=require(_0x142f('0xe'));var Redis=require(_0x142f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x142f('0x10'));var as=require(_0x142f('0x11'));var hardwareService=require(_0x142f('0x12'));var logger=require(_0x142f('0x13'))(_0x142f('0x14'));var utils=require(_0x142f('0x15'));var config=require(_0x142f('0x16'));var licenseUtil=require(_0x142f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x549444,_0x3cbe2c){_0x3cbe2c=_0x3cbe2c||0xcc;return function(_0x40bfb4){if(_0x40bfb4){return _0x549444[_0x142f('0x18')](_0x3cbe2c);}return _0x549444[_0x142f('0x19')](_0x3cbe2c)[_0x142f('0x1a')]();};}function respondWithResult(_0x577764,_0x3737ae){_0x3737ae=_0x3737ae||0xc8;return function(_0x275e77){if(_0x275e77){return _0x577764[_0x142f('0x19')](_0x3737ae)[_0x142f('0x1b')](_0x275e77);}};}function respondWithFilteredResult(_0x59429b,_0x3d7421){return function(_0x4ba5fd){if(_0x4ba5fd){var _0x42d0c6=typeof _0x3d7421[_0x142f('0x1c')]===_0x142f('0x1d')&&typeof _0x3d7421[_0x142f('0x1e')]===_0x142f('0x1d');var _0x2195fd=_0x4ba5fd[_0x142f('0x1f')];var _0x28ed4d=_0x42d0c6?0x0:_0x3d7421[_0x142f('0x1c')];var _0x529a79=_0x42d0c6?_0x4ba5fd['count']:_0x3d7421[_0x142f('0x1c')]+_0x3d7421['limit'];var _0x2e0081;if(_0x529a79>=_0x2195fd){_0x529a79=_0x2195fd;_0x2e0081=0xc8;}else{_0x2e0081=0xce;}_0x59429b['status'](_0x2e0081);return _0x59429b[_0x142f('0x20')]('Content-Range',_0x28ed4d+'-'+_0x529a79+'/'+_0x2195fd)['json'](_0x4ba5fd);}return null;};}function patchUpdates(_0x879e8b){return function(_0x40a308){try{jsonpatch[_0x142f('0x21')](_0x40a308,_0x879e8b,!![]);}catch(_0x2bff0d){return BPromise[_0x142f('0x22')](_0x2bff0d);}return _0x40a308['save']();};}function saveUpdates(_0x353eb5,_0x353eaa){return function(_0x47494e){if(_0x47494e){return _0x47494e['update'](_0x353eb5)[_0x142f('0x23')](function(_0x4bdffd){return _0x4bdffd;});}return null;};}function removeEntity(_0x4dd243,_0x16b88d){return function(_0x555635){if(_0x555635){return _0x555635['destroy']()[_0x142f('0x23')](function(){_0x4dd243[_0x142f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x364f6b,_0x44020a){return function(_0x3bdd9c){if(!_0x3bdd9c){_0x364f6b[_0x142f('0x18')](0x194);}return _0x3bdd9c;};}function handleError(_0x1a467d,_0x399d5e){_0x399d5e=_0x399d5e||0x1f4;return function(_0xf487e9){logger[_0x142f('0x24')](_0xf487e9[_0x142f('0x25')]);if(_0xf487e9[_0x142f('0x26')]){delete _0xf487e9['name'];}_0x1a467d[_0x142f('0x19')](_0x399d5e)['send'](_0xf487e9);};}exports['index']=function(_0x6a8f51,_0x54305d){var _0x124e8d={},_0x22927d={},_0x110c76={'count':0x0,'rows':[]};var _0x3cb6f0=_[_0x142f('0x27')](db['ServicenowField']['rawAttributes'],function(_0x6da57c){return{'name':_0x6da57c[_0x142f('0x28')],'type':_0x6da57c[_0x142f('0x29')][_0x142f('0x2a')]};});_0x22927d[_0x142f('0x2b')]=_[_0x142f('0x27')](_0x3cb6f0,_0x142f('0x26'));_0x22927d[_0x142f('0x2c')]=_['keys'](_0x6a8f51[_0x142f('0x2c')]);_0x22927d[_0x142f('0x2d')]=_['intersection'](_0x22927d[_0x142f('0x2b')],_0x22927d[_0x142f('0x2c')]);_0x124e8d[_0x142f('0x2e')]=_[_0x142f('0x2f')](_0x22927d[_0x142f('0x2b')],qs[_0x142f('0x30')](_0x6a8f51[_0x142f('0x2c')][_0x142f('0x30')]));_0x124e8d['attributes']=_0x124e8d[_0x142f('0x2e')][_0x142f('0x31')]?_0x124e8d['attributes']:_0x22927d[_0x142f('0x2b')];if(!_0x6a8f51['query'][_0x142f('0x32')](_0x142f('0x33'))){_0x124e8d[_0x142f('0x1e')]=qs[_0x142f('0x1e')](_0x6a8f51[_0x142f('0x2c')][_0x142f('0x1e')]);_0x124e8d[_0x142f('0x1c')]=qs[_0x142f('0x1c')](_0x6a8f51['query']['offset']);}_0x124e8d[_0x142f('0x34')]=qs[_0x142f('0x35')](_0x6a8f51['query'][_0x142f('0x35')]);_0x124e8d[_0x142f('0x36')]=qs[_0x142f('0x2d')](_[_0x142f('0x37')](_0x6a8f51[_0x142f('0x2c')],_0x22927d[_0x142f('0x2d')]),_0x3cb6f0);if(_0x6a8f51[_0x142f('0x2c')][_0x142f('0x38')]){_0x124e8d[_0x142f('0x36')]=_[_0x142f('0x39')](_0x124e8d[_0x142f('0x36')],{'$or':_['map'](_0x3cb6f0,function(_0x499c99){if(_0x499c99[_0x142f('0x29')]!==_0x142f('0x3a')){var _0xade026={};_0xade026[_0x499c99[_0x142f('0x26')]]={'$like':'%'+_0x6a8f51[_0x142f('0x2c')][_0x142f('0x38')]+'%'};return _0xade026;}})});}_0x124e8d=_[_0x142f('0x39')]({},_0x124e8d,_0x6a8f51[_0x142f('0x3b')]);var _0x3a5e4d={'where':_0x124e8d[_0x142f('0x36')]};return db[_0x142f('0x3c')][_0x142f('0x1f')](_0x3a5e4d)[_0x142f('0x23')](function(_0x488187){_0x110c76[_0x142f('0x1f')]=_0x488187;if(_0x6a8f51[_0x142f('0x2c')][_0x142f('0x3d')]){_0x124e8d[_0x142f('0x3e')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x124e8d);})[_0x142f('0x23')](function(_0x1855bb){_0x110c76[_0x142f('0x3f')]=_0x1855bb;return _0x110c76;})[_0x142f('0x23')](respondWithFilteredResult(_0x54305d,_0x124e8d))[_0x142f('0x40')](handleError(_0x54305d,null));};exports[_0x142f('0x41')]=function(_0x2991a3,_0x4ac9de){var _0x136f5a={'raw':!![],'where':{'id':_0x2991a3[_0x142f('0x42')]['id']}},_0x55fd23={};_0x55fd23[_0x142f('0x2b')]=_['keys'](db[_0x142f('0x3c')][_0x142f('0x43')]);_0x55fd23[_0x142f('0x2c')]=_[_0x142f('0x44')](_0x2991a3[_0x142f('0x2c')]);_0x55fd23[_0x142f('0x2d')]=_[_0x142f('0x2f')](_0x55fd23[_0x142f('0x2b')],_0x55fd23['query']);_0x136f5a['attributes']=_['intersection'](_0x55fd23[_0x142f('0x2b')],qs['fields'](_0x2991a3[_0x142f('0x2c')][_0x142f('0x30')]));_0x136f5a['attributes']=_0x136f5a['attributes'][_0x142f('0x31')]?_0x136f5a['attributes']:_0x55fd23[_0x142f('0x2b')];if(_0x2991a3[_0x142f('0x2c')]['includeAll']){_0x136f5a[_0x142f('0x3e')]=[{'all':!![]}];}_0x136f5a=_['merge']({},_0x136f5a,_0x2991a3['options']);return db[_0x142f('0x3c')][_0x142f('0x45')](_0x136f5a)[_0x142f('0x23')](handleEntityNotFound(_0x4ac9de,null))[_0x142f('0x23')](respondWithResult(_0x4ac9de,null))[_0x142f('0x40')](handleError(_0x4ac9de,null));};exports[_0x142f('0x46')]=function(_0x19ae2d,_0x138421){return db[_0x142f('0x3c')][_0x142f('0x46')](_0x19ae2d['body'],{})[_0x142f('0x23')](respondWithResult(_0x138421,0xc9))[_0x142f('0x40')](handleError(_0x138421,null));};exports['update']=function(_0x4a4410,_0x5ab287){if(_0x4a4410[_0x142f('0x47')]['id']){delete _0x4a4410[_0x142f('0x47')]['id'];}return db[_0x142f('0x3c')][_0x142f('0x45')]({'where':{'id':_0x4a4410[_0x142f('0x42')]['id']}})[_0x142f('0x23')](handleEntityNotFound(_0x5ab287,null))[_0x142f('0x23')](saveUpdates(_0x4a4410['body'],null))['then'](respondWithResult(_0x5ab287,null))[_0x142f('0x40')](handleError(_0x5ab287,null));};exports['destroy']=function(_0x45342d,_0x28bb99){return db[_0x142f('0x3c')][_0x142f('0x45')]({'where':{'id':_0x45342d['params']['id']}})[_0x142f('0x23')](handleEntityNotFound(_0x28bb99,null))['then'](removeEntity(_0x28bb99,null))[_0x142f('0x40')](handleError(_0x28bb99,null));};
\ No newline at end of file
+var _0x9e69=['error','name','send','index','ServicenowField','fieldName','type','key','model','map','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x7a55b3,_0x24462d){var _0x4105ac=function(_0x2182ba){while(--_0x2182ba){_0x7a55b3['push'](_0x7a55b3['shift']());}};_0x4105ac(++_0x24462d);}(_0x9e69,0x14a));var _0x99e6=function(_0x1fd991,_0x35ebcb){_0x1fd991=_0x1fd991-0x0;var _0x5ce80a=_0x9e69[_0x1fd991];return _0x5ce80a;};'use strict';var emlformat=require(_0x99e6('0x0'));var rimraf=require(_0x99e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99e6('0x2'));var rp=require(_0x99e6('0x3'));var moment=require(_0x99e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x99e6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x99e6('0x6'));var ejs=require(_0x99e6('0x7'));var fs=require('fs');var fs_extra=require(_0x99e6('0x8'));var _=require(_0x99e6('0x9'));var squel=require(_0x99e6('0xa'));var crypto=require(_0x99e6('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x99e6('0x6'));var querystring=require('querystring');var Papa=require(_0x99e6('0xc'));var Redis=require(_0x99e6('0xd'));var authService=require(_0x99e6('0xe'));var qs=require(_0x99e6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x99e6('0x10'));var logger=require(_0x99e6('0x11'))('api');var utils=require(_0x99e6('0x12'));var config=require(_0x99e6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x99e6('0x14'))['db'];function respondWithStatusCode(_0x5c344a,_0x166d64){_0x166d64=_0x166d64||0xcc;return function(_0x21ef55){if(_0x21ef55){return _0x5c344a['sendStatus'](_0x166d64);}return _0x5c344a['status'](_0x166d64)['end']();};}function respondWithResult(_0x53706d,_0x209ece){_0x209ece=_0x209ece||0xc8;return function(_0x2868ec){if(_0x2868ec){return _0x53706d[_0x99e6('0x15')](_0x209ece)[_0x99e6('0x16')](_0x2868ec);}};}function respondWithFilteredResult(_0x382622,_0x293188){return function(_0x4e9105){if(_0x4e9105){var _0x5b2f2c=typeof _0x293188[_0x99e6('0x17')]===_0x99e6('0x18')&&typeof _0x293188['limit']===_0x99e6('0x18');var _0x4f388d=_0x4e9105[_0x99e6('0x19')];var _0x40c15b=_0x5b2f2c?0x0:_0x293188['offset'];var _0x3769fa=_0x5b2f2c?_0x4e9105['count']:_0x293188[_0x99e6('0x17')]+_0x293188['limit'];var _0x22c974;if(_0x3769fa>=_0x4f388d){_0x3769fa=_0x4f388d;_0x22c974=0xc8;}else{_0x22c974=0xce;}_0x382622[_0x99e6('0x15')](_0x22c974);return _0x382622[_0x99e6('0x1a')](_0x99e6('0x1b'),_0x40c15b+'-'+_0x3769fa+'/'+_0x4f388d)['json'](_0x4e9105);}return null;};}function patchUpdates(_0x315bb7){return function(_0xa4d69a){try{jsonpatch[_0x99e6('0x1c')](_0xa4d69a,_0x315bb7,!![]);}catch(_0x20e76b){return BPromise[_0x99e6('0x1d')](_0x20e76b);}return _0xa4d69a[_0x99e6('0x1e')]();};}function saveUpdates(_0x5b6fd6,_0x452a5e){return function(_0x4b00eb){if(_0x4b00eb){return _0x4b00eb[_0x99e6('0x1f')](_0x5b6fd6)[_0x99e6('0x20')](function(_0x503666){return _0x503666;});}return null;};}function removeEntity(_0x11c473,_0x54fd24){return function(_0x20ef5e){if(_0x20ef5e){return _0x20ef5e[_0x99e6('0x21')]()[_0x99e6('0x20')](function(){_0x11c473[_0x99e6('0x15')](0xcc)[_0x99e6('0x22')]();});}};}function handleEntityNotFound(_0x48556b,_0x5eabfd){return function(_0x4146f7){if(!_0x4146f7){_0x48556b['sendStatus'](0x194);}return _0x4146f7;};}function handleError(_0x5c4c43,_0x56dea0){_0x56dea0=_0x56dea0||0x1f4;return function(_0x2e30d){logger[_0x99e6('0x23')](_0x2e30d['stack']);if(_0x2e30d[_0x99e6('0x24')]){delete _0x2e30d[_0x99e6('0x24')];}_0x5c4c43[_0x99e6('0x15')](_0x56dea0)[_0x99e6('0x25')](_0x2e30d);};}exports[_0x99e6('0x26')]=function(_0x767856,_0x2abdb9){var _0x27a413={},_0x519fbf={},_0x3136cf={'count':0x0,'rows':[]};var _0x58c6cf=_['map'](db[_0x99e6('0x27')]['rawAttributes'],function(_0x366e04){return{'name':_0x366e04[_0x99e6('0x28')],'type':_0x366e04[_0x99e6('0x29')][_0x99e6('0x2a')]};});_0x519fbf[_0x99e6('0x2b')]=_[_0x99e6('0x2c')](_0x58c6cf,'name');_0x519fbf[_0x99e6('0x2d')]=_['keys'](_0x767856[_0x99e6('0x2d')]);_0x519fbf['filters']=_['intersection'](_0x519fbf['model'],_0x519fbf['query']);_0x27a413['attributes']=_['intersection'](_0x519fbf[_0x99e6('0x2b')],qs[_0x99e6('0x2e')](_0x767856[_0x99e6('0x2d')][_0x99e6('0x2e')]));_0x27a413[_0x99e6('0x2f')]=_0x27a413['attributes'][_0x99e6('0x30')]?_0x27a413[_0x99e6('0x2f')]:_0x519fbf[_0x99e6('0x2b')];if(!_0x767856[_0x99e6('0x2d')][_0x99e6('0x31')](_0x99e6('0x32'))){_0x27a413[_0x99e6('0x33')]=qs['limit'](_0x767856[_0x99e6('0x2d')][_0x99e6('0x33')]);_0x27a413[_0x99e6('0x17')]=qs['offset'](_0x767856[_0x99e6('0x2d')][_0x99e6('0x17')]);}_0x27a413[_0x99e6('0x34')]=qs[_0x99e6('0x35')](_0x767856['query'][_0x99e6('0x35')]);_0x27a413[_0x99e6('0x36')]=qs[_0x99e6('0x37')](_[_0x99e6('0x38')](_0x767856[_0x99e6('0x2d')],_0x519fbf[_0x99e6('0x37')]),_0x58c6cf);if(_0x767856[_0x99e6('0x2d')]['filter']){_0x27a413[_0x99e6('0x36')]=_[_0x99e6('0x39')](_0x27a413[_0x99e6('0x36')],{'$or':_['map'](_0x58c6cf,function(_0x5945b3){if(_0x5945b3[_0x99e6('0x29')]!=='VIRTUAL'){var _0xe377e={};_0xe377e[_0x5945b3[_0x99e6('0x24')]]={'$like':'%'+_0x767856[_0x99e6('0x2d')][_0x99e6('0x3a')]+'%'};return _0xe377e;}})});}_0x27a413=_['merge']({},_0x27a413,_0x767856[_0x99e6('0x3b')]);var _0x2afcd2={'where':_0x27a413[_0x99e6('0x36')]};return db[_0x99e6('0x27')][_0x99e6('0x19')](_0x2afcd2)[_0x99e6('0x20')](function(_0x129e78){_0x3136cf['count']=_0x129e78;if(_0x767856[_0x99e6('0x2d')][_0x99e6('0x3c')]){_0x27a413[_0x99e6('0x3d')]=[{'all':!![]}];}return db['ServicenowField'][_0x99e6('0x3e')](_0x27a413);})[_0x99e6('0x20')](function(_0x5131e3){_0x3136cf[_0x99e6('0x3f')]=_0x5131e3;return _0x3136cf;})[_0x99e6('0x20')](respondWithFilteredResult(_0x2abdb9,_0x27a413))[_0x99e6('0x40')](handleError(_0x2abdb9,null));};exports[_0x99e6('0x41')]=function(_0xd86e1,_0x5bc48e){var _0x5272f0={'raw':!![],'where':{'id':_0xd86e1[_0x99e6('0x42')]['id']}},_0x3ce943={};_0x3ce943['model']=_[_0x99e6('0x43')](db[_0x99e6('0x27')][_0x99e6('0x44')]);_0x3ce943[_0x99e6('0x2d')]=_['keys'](_0xd86e1[_0x99e6('0x2d')]);_0x3ce943[_0x99e6('0x37')]=_[_0x99e6('0x45')](_0x3ce943[_0x99e6('0x2b')],_0x3ce943['query']);_0x5272f0[_0x99e6('0x2f')]=_[_0x99e6('0x45')](_0x3ce943['model'],qs['fields'](_0xd86e1['query'][_0x99e6('0x2e')]));_0x5272f0['attributes']=_0x5272f0[_0x99e6('0x2f')][_0x99e6('0x30')]?_0x5272f0[_0x99e6('0x2f')]:_0x3ce943[_0x99e6('0x2b')];if(_0xd86e1[_0x99e6('0x2d')]['includeAll']){_0x5272f0[_0x99e6('0x3d')]=[{'all':!![]}];}_0x5272f0=_[_0x99e6('0x39')]({},_0x5272f0,_0xd86e1[_0x99e6('0x3b')]);return db[_0x99e6('0x27')][_0x99e6('0x46')](_0x5272f0)[_0x99e6('0x20')](handleEntityNotFound(_0x5bc48e,null))['then'](respondWithResult(_0x5bc48e,null))[_0x99e6('0x40')](handleError(_0x5bc48e,null));};exports[_0x99e6('0x47')]=function(_0x27b975,_0x5c9121){return db[_0x99e6('0x27')]['create'](_0x27b975[_0x99e6('0x48')],{})[_0x99e6('0x20')](respondWithResult(_0x5c9121,0xc9))[_0x99e6('0x40')](handleError(_0x5c9121,null));};exports['update']=function(_0x4fdcb8,_0x29e760){if(_0x4fdcb8[_0x99e6('0x48')]['id']){delete _0x4fdcb8['body']['id'];}return db[_0x99e6('0x27')]['find']({'where':{'id':_0x4fdcb8[_0x99e6('0x42')]['id']}})['then'](handleEntityNotFound(_0x29e760,null))[_0x99e6('0x20')](saveUpdates(_0x4fdcb8[_0x99e6('0x48')],null))[_0x99e6('0x20')](respondWithResult(_0x29e760,null))[_0x99e6('0x40')](handleError(_0x29e760,null));};exports[_0x99e6('0x21')]=function(_0xba8886,_0x1484e2){return db[_0x99e6('0x27')][_0x99e6('0x46')]({'where':{'id':_0xba8886[_0x99e6('0x42')]['id']}})[_0x99e6('0x20')](handleEntityNotFound(_0x1484e2,null))[_0x99e6('0x20')](removeEntity(_0x1484e2,null))[_0x99e6('0x40')](handleError(_0x1484e2,null));};
\ No newline at end of file
index 8d91d92..38679f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa1b=['idField','FieldId','lodash','../../config/logger','api','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x5f57e3,_0x27e504){var _0x21e63e=function(_0x422217){while(--_0x422217){_0x5f57e3['push'](_0x5f57e3['shift']());}};_0x21e63e(++_0x27e504);}(_0xaa1b,0x1c9));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbaa1('0x0'));var util=require('util');var logger=require(_0xbaa1('0x1'))(_0xbaa1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbaa1('0x3'));var rimraf=require(_0xbaa1('0x4'));var config=require('../../config/environment');var attributes=require(_0xbaa1('0x5'));module[_0xbaa1('0x6')]=function(_0x26f38e,_0x5b66d1){return _0x26f38e[_0xbaa1('0x7')](_0xbaa1('0x8'),attributes,{'tableName':_0xbaa1('0x9'),'paranoid':![],'indexes':[{'name':_0xbaa1('0xa'),'fields':[_0xbaa1('0xb'),_0xbaa1('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc918=['request-promise','path','../../config/environment','lodash','util','api','bluebird'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0xc918,0xb9));var _0x8c91=function(_0x57723b,_0xf6318b){_0x57723b=_0x57723b-0x0;var _0x494640=_0xc918[_0x57723b];return _0x494640;};'use strict';var _=require(_0x8c91('0x0'));var util=require(_0x8c91('0x1'));var logger=require('../../config/logger')(_0x8c91('0x2'));var moment=require('moment');var BPromise=require(_0x8c91('0x3'));var rp=require(_0x8c91('0x4'));var fs=require('fs');var path=require(_0x8c91('0x5'));var rimraf=require('rimraf');var config=require(_0x8c91('0x6'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x144db9,_0x510b78){return _0x144db9['define']('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 89a2f55..438ee79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x57fd40,_0x9de24f){var _0x52bb76=function(_0x55f232){while(--_0x55f232){_0x57fd40['push'](_0x57fd40['shift']());}};_0x52bb76(++_0x9de24f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5e204d,_0xee9045){_0x5e204d=_0x5e204d-0x0;var _0x59a85f=_0x9ffd[_0x5e204d];return _0x59a85f;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}
\ No newline at end of file
+var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3f6bab,_0x32680a){var _0x2bdb14=function(_0x53cf15){while(--_0x53cf15){_0x3f6bab['push'](_0x3f6bab['shift']());}};_0x2bdb14(++_0x32680a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
index e2cf9a3..3c71f2e 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(_0x383c01,_0x3e1f74){var _0x1d2229=function(_0x18319c){while(--_0x18319c){_0x383c01['push'](_0x383c01['shift']());}};_0x1d2229(++_0x3e1f74);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0x2052fb,_0x36ace7){var _0x26e838=function(_0x1ea586){while(--_0x1ea586){_0x2052fb['push'](_0x2052fb['shift']());}};_0x26e838(++_0x36ace7);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 2b6d091..582781f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5e6c7a,_0x4fd306){var _0x23eb04=function(_0x275fb7){while(--_0x275fb7){_0x5e6c7a['push'](_0x5e6c7a['shift']());}};_0x23eb04(++_0x4fd306);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x5ed4f2,_0x58ef6f){var _0x1ee6d2=function(_0x46ce26){while(--_0x46ce26){_0x5ed4f2['push'](_0x5ed4f2['shift']());}};_0x1ee6d2(++_0x58ef6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 9839525..a813d9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038d=['../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','filters','merge','where','VIRTUAL','filter','includeAll','include','catch','show','params','SugarcrmAccount','length','create','body','getConfigurations','findOne','keys','order','pick','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls','values','includes','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x5757aa,_0x3d6cbd){var _0x3e48c9=function(_0x22c210){while(--_0x22c210){_0x5757aa['push'](_0x5757aa['shift']());}};_0x3e48c9(++_0x3d6cbd);}(_0x038d,0x152));var _0xd038=function(_0x2c2c4d,_0x3334dc){_0x2c2c4d=_0x2c2c4d-0x0;var _0x292e7a=_0x038d[_0x2c2c4d];return _0x292e7a;};'use strict';var emlformat=require(_0xd038('0x0'));var rimraf=require(_0xd038('0x1'));var zipdir=require(_0xd038('0x2'));var jsonpatch=require(_0xd038('0x3'));var rp=require(_0xd038('0x4'));var moment=require(_0xd038('0x5'));var BPromise=require(_0xd038('0x6'));var Mustache=require(_0xd038('0x7'));var util=require(_0xd038('0x8'));var path=require('path');var sox=require(_0xd038('0x9'));var csv=require(_0xd038('0xa'));var ejs=require(_0xd038('0xb'));var fs=require('fs');var fs_extra=require(_0xd038('0xc'));var _=require(_0xd038('0xd'));var squel=require(_0xd038('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd038('0xa'));var querystring=require('querystring');var Papa=require(_0xd038('0xf'));var Redis=require(_0xd038('0x10'));var authService=require(_0xd038('0x11'));var qs=require(_0xd038('0x12'));var as=require(_0xd038('0x13'));var hardwareService=require(_0xd038('0x14'));var logger=require(_0xd038('0x15'))(_0xd038('0x16'));var utils=require(_0xd038('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd038('0x18'));var db=require(_0xd038('0x19'))['db'];var integrations=require(_0xd038('0x1a'));function respondWithStatusCode(_0xfd6354,_0x40de1d){_0x40de1d=_0x40de1d||0xcc;return function(_0x2ff309){if(_0x2ff309){return _0xfd6354[_0xd038('0x1b')](_0x40de1d);}return _0xfd6354[_0xd038('0x1c')](_0x40de1d)[_0xd038('0x1d')]();};}function respondWithResult(_0x3d5a98,_0x12e724){_0x12e724=_0x12e724||0xc8;return function(_0x307111){if(_0x307111){return _0x3d5a98[_0xd038('0x1c')](_0x12e724)[_0xd038('0x1e')](_0x307111);}};}function respondWithFilteredResult(_0x41e53c,_0x833884){return function(_0x5e6ab6){if(_0x5e6ab6){var _0x3f4e3e=typeof _0x833884[_0xd038('0x1f')]===_0xd038('0x20')&&typeof _0x833884[_0xd038('0x21')]==='undefined';var _0x487a41=_0x5e6ab6[_0xd038('0x22')];var _0x1b6c31=_0x3f4e3e?0x0:_0x833884[_0xd038('0x1f')];var _0x2ea667=_0x3f4e3e?_0x5e6ab6[_0xd038('0x22')]:_0x833884['offset']+_0x833884[_0xd038('0x21')];var _0x5634ae;if(_0x2ea667>=_0x487a41){_0x2ea667=_0x487a41;_0x5634ae=0xc8;}else{_0x5634ae=0xce;}_0x41e53c[_0xd038('0x1c')](_0x5634ae);return _0x41e53c[_0xd038('0x23')](_0xd038('0x24'),_0x1b6c31+'-'+_0x2ea667+'/'+_0x487a41)[_0xd038('0x1e')](_0x5e6ab6);}return null;};}function patchUpdates(_0x52072e){return function(_0x469b2c){try{jsonpatch['apply'](_0x469b2c,_0x52072e,!![]);}catch(_0x4f53b){return BPromise[_0xd038('0x25')](_0x4f53b);}return _0x469b2c[_0xd038('0x26')]();};}function saveUpdates(_0x454ad9,_0x22eb75){return function(_0x4fafcd){if(_0x4fafcd){return _0x4fafcd[_0xd038('0x27')](_0x454ad9)[_0xd038('0x28')](function(_0x3add5a){return _0x3add5a;});}return null;};}function removeEntity(_0x32e33e,_0x2f514e){return function(_0x4436c2){if(_0x4436c2){return _0x4436c2[_0xd038('0x29')]()['then'](function(){_0x32e33e[_0xd038('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57a271,_0x55ebfc){return function(_0x47fc9a){if(!_0x47fc9a){_0x57a271[_0xd038('0x1b')](0x194);}return _0x47fc9a;};}function handleError(_0xaadf28,_0x2d1c05){_0x2d1c05=_0x2d1c05||0x1f4;return function(_0x2552bc){logger[_0xd038('0x2a')](_0x2552bc[_0xd038('0x2b')]);if(_0x2552bc[_0xd038('0x2c')]){delete _0x2552bc[_0xd038('0x2c')];}_0xaadf28[_0xd038('0x1c')](_0x2d1c05)[_0xd038('0x2d')](_0x2552bc);};}exports[_0xd038('0x2e')]=function(_0x374f0e,_0x110dea){var _0x4151d8={},_0x167f1f={},_0x17733e={'count':0x0,'rows':[]};var _0x450133=_[_0xd038('0x2f')](db['SugarcrmAccount'][_0xd038('0x30')],function(_0x4334b1){return{'name':_0x4334b1['fieldName'],'type':_0x4334b1[_0xd038('0x31')]['key']};});_0x167f1f['model']=_[_0xd038('0x2f')](_0x450133,'name');_0x167f1f[_0xd038('0x32')]=_['keys'](_0x374f0e[_0xd038('0x32')]);_0x167f1f['filters']=_[_0xd038('0x33')](_0x167f1f['model'],_0x167f1f[_0xd038('0x32')]);_0x4151d8[_0xd038('0x34')]=_[_0xd038('0x33')](_0x167f1f[_0xd038('0x35')],qs[_0xd038('0x36')](_0x374f0e[_0xd038('0x32')][_0xd038('0x36')]));_0x4151d8['attributes']=_0x4151d8[_0xd038('0x34')]['length']?_0x4151d8[_0xd038('0x34')]:_0x167f1f[_0xd038('0x35')];if(!_0x374f0e['query'][_0xd038('0x37')](_0xd038('0x38'))){_0x4151d8[_0xd038('0x21')]=qs[_0xd038('0x21')](_0x374f0e[_0xd038('0x32')][_0xd038('0x21')]);_0x4151d8[_0xd038('0x1f')]=qs[_0xd038('0x1f')](_0x374f0e['query'][_0xd038('0x1f')]);}_0x4151d8['order']=qs[_0xd038('0x39')](_0x374f0e['query'][_0xd038('0x39')]);_0x4151d8['where']=qs[_0xd038('0x3a')](_['pick'](_0x374f0e['query'],_0x167f1f[_0xd038('0x3a')]),_0x450133);if(_0x374f0e[_0xd038('0x32')]['filter']){_0x4151d8['where']=_[_0xd038('0x3b')](_0x4151d8[_0xd038('0x3c')],{'$or':_[_0xd038('0x2f')](_0x450133,function(_0x415049){if(_0x415049['type']!==_0xd038('0x3d')){var _0x39bace={};_0x39bace[_0x415049[_0xd038('0x2c')]]={'$like':'%'+_0x374f0e[_0xd038('0x32')][_0xd038('0x3e')]+'%'};return _0x39bace;}})});}_0x4151d8=_[_0xd038('0x3b')]({},_0x4151d8,_0x374f0e['options']);var _0x39b228={'where':_0x4151d8[_0xd038('0x3c')]};return db['SugarcrmAccount']['count'](_0x39b228)[_0xd038('0x28')](function(_0x2dc06c){_0x17733e[_0xd038('0x22')]=_0x2dc06c;if(_0x374f0e[_0xd038('0x32')][_0xd038('0x3f')]){_0x4151d8[_0xd038('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x4151d8);})[_0xd038('0x28')](function(_0x5cff27){_0x17733e['rows']=_0x5cff27;return _0x17733e;})[_0xd038('0x28')](respondWithFilteredResult(_0x110dea,_0x4151d8))[_0xd038('0x41')](handleError(_0x110dea,null));};exports[_0xd038('0x42')]=function(_0x4c67dc,_0x8fc47e){var _0x35934d={'raw':![],'where':{'id':_0x4c67dc[_0xd038('0x43')]['id']}},_0x2e263b={};_0x2e263b[_0xd038('0x35')]=_['keys'](db[_0xd038('0x44')][_0xd038('0x30')]);_0x2e263b[_0xd038('0x32')]=_['keys'](_0x4c67dc['query']);_0x2e263b['filters']=_[_0xd038('0x33')](_0x2e263b[_0xd038('0x35')],_0x2e263b[_0xd038('0x32')]);_0x35934d[_0xd038('0x34')]=_['intersection'](_0x2e263b['model'],qs[_0xd038('0x36')](_0x4c67dc[_0xd038('0x32')]['fields']));_0x35934d[_0xd038('0x34')]=_0x35934d[_0xd038('0x34')][_0xd038('0x45')]?_0x35934d[_0xd038('0x34')]:_0x2e263b[_0xd038('0x35')];if(_0x4c67dc['query'][_0xd038('0x3f')]){_0x35934d[_0xd038('0x40')]=[{'all':!![]}];}_0x35934d=_['merge']({},_0x35934d,_0x4c67dc['options']);return db[_0xd038('0x44')]['find'](_0x35934d)['then'](handleEntityNotFound(_0x8fc47e,null))[_0xd038('0x28')](respondWithResult(_0x8fc47e,null))['catch'](handleError(_0x8fc47e,null));};exports[_0xd038('0x46')]=function(_0x31974f,_0x180c78){return db[_0xd038('0x44')][_0xd038('0x46')](_0x31974f[_0xd038('0x47')],{})['then'](respondWithResult(_0x180c78,0xc9))[_0xd038('0x41')](handleError(_0x180c78,null));};exports[_0xd038('0x27')]=function(_0x1323bc,_0x25fe41){if(_0x1323bc['body']['id']){delete _0x1323bc[_0xd038('0x47')]['id'];}return db[_0xd038('0x44')]['find']({'where':{'id':_0x1323bc[_0xd038('0x43')]['id']}})[_0xd038('0x28')](handleEntityNotFound(_0x25fe41,null))[_0xd038('0x28')](saveUpdates(_0x1323bc[_0xd038('0x47')],null))[_0xd038('0x28')](respondWithResult(_0x25fe41,null))['catch'](handleError(_0x25fe41,null));};exports['destroy']=function(_0x1e4372,_0x33d151){return db[_0xd038('0x44')]['find']({'where':{'id':_0x1e4372[_0xd038('0x43')]['id']}})[_0xd038('0x28')](handleEntityNotFound(_0x33d151,null))[_0xd038('0x28')](removeEntity(_0x33d151,null))[_0xd038('0x41')](handleError(_0x33d151,null));};exports[_0xd038('0x48')]=function(_0x23ed7f,_0x118cc3,_0x2263b0){var _0x429dcc={};var _0x287cae={};var _0x110a40;var _0x39da46;return db[_0xd038('0x44')][_0xd038('0x49')]({'where':{'id':_0x23ed7f['params']['id']}})[_0xd038('0x28')](handleEntityNotFound(_0x118cc3,null))['then'](function(_0x157b1d){if(_0x157b1d){_0x110a40=_0x157b1d;_0x287cae[_0xd038('0x35')]=_[_0xd038('0x4a')](db['SugarcrmConfiguration'][_0xd038('0x30')]);_0x287cae[_0xd038('0x32')]=_[_0xd038('0x4a')](_0x23ed7f[_0xd038('0x32')]);_0x287cae[_0xd038('0x3a')]=_[_0xd038('0x33')](_0x287cae[_0xd038('0x35')],_0x287cae['query']);_0x429dcc[_0xd038('0x34')]=_[_0xd038('0x33')](_0x287cae[_0xd038('0x35')],qs[_0xd038('0x36')](_0x23ed7f[_0xd038('0x32')][_0xd038('0x36')]));_0x429dcc['attributes']=_0x429dcc[_0xd038('0x34')][_0xd038('0x45')]?_0x429dcc[_0xd038('0x34')]:_0x287cae['model'];_0x429dcc[_0xd038('0x4b')]=qs[_0xd038('0x39')](_0x23ed7f[_0xd038('0x32')]['sort']);_0x429dcc[_0xd038('0x3c')]=qs[_0xd038('0x3a')](_[_0xd038('0x4c')](_0x23ed7f['query'],_0x287cae[_0xd038('0x3a')]));if(_0x23ed7f[_0xd038('0x32')][_0xd038('0x3e')]){_0x429dcc[_0xd038('0x3c')]=_[_0xd038('0x3b')](_0x429dcc[_0xd038('0x3c')],{'$or':_[_0xd038('0x2f')](_0x429dcc[_0xd038('0x34')],function(_0x3d7f9d){var _0x11bd85={};_0x11bd85[_0x3d7f9d]={'$like':'%'+_0x23ed7f[_0xd038('0x32')][_0xd038('0x3e')]+'%'};return _0x11bd85;})});}_0x429dcc=_[_0xd038('0x3b')]({},_0x429dcc,_0x23ed7f[_0xd038('0x4d')]);return _0x110a40['getConfigurations'](_0x429dcc);}})[_0xd038('0x28')](function(_0x514633){if(_0x514633){_0x39da46=_0x514633['length'];if(!_0x23ed7f[_0xd038('0x32')]['hasOwnProperty'](_0xd038('0x38'))){_0x429dcc[_0xd038('0x21')]=qs['limit'](_0x23ed7f['query'][_0xd038('0x21')]);_0x429dcc[_0xd038('0x1f')]=qs[_0xd038('0x1f')](_0x23ed7f[_0xd038('0x32')][_0xd038('0x1f')]);}return _0x110a40[_0xd038('0x48')](_0x429dcc);}})['then'](function(_0x4861a2){if(_0x4861a2){return _0x4861a2?{'count':_0x39da46,'rows':_0x4861a2}:null;}})[_0xd038('0x28')](respondWithResult(_0x118cc3,null))['catch'](handleError(_0x118cc3,null));};exports[_0xd038('0x4e')]=function(_0x44c582,_0x2eb324,_0x3090a6){if(_0x44c582[_0xd038('0x47')]['id']){delete _0x44c582[_0xd038('0x47')]['id'];}return db[_0xd038('0x44')][_0xd038('0x49')]({'where':{'id':_0x44c582['params']['id']}})[_0xd038('0x28')](handleEntityNotFound(_0x2eb324,null))[_0xd038('0x28')](function(_0x41ce20){if(_0x41ce20){_0x44c582[_0xd038('0x47')][_0xd038('0x4f')]=_0x41ce20['id'];_0x44c582[_0xd038('0x47')][_0xd038('0x50')]=integrations[_0xd038('0x51')](_0x44c582[_0xd038('0x47')][_0xd038('0x52')],_0x44c582[_0xd038('0x47')][_0xd038('0x31')]);_0x44c582[_0xd038('0x47')][_0xd038('0x53')]=integrations[_0xd038('0x54')](_0x44c582[_0xd038('0x47')][_0xd038('0x52')],_0x44c582[_0xd038('0x47')][_0xd038('0x31')]);return db[_0xd038('0x55')][_0xd038('0x46')](_0x44c582[_0xd038('0x47')],{'include':[{'model':db[_0xd038('0x56')],'as':_0xd038('0x50')},{'model':db[_0xd038('0x56')],'as':_0xd038('0x53')}]});}return null;})[_0xd038('0x28')](respondWithResult(_0x2eb324,null))[_0xd038('0x41')](handleError(_0x2eb324,null));};exports[_0xd038('0x57')]=function(_0x15e329,_0x50c89d,_0x1ce0db){var _0x2978d9='';var _0x85dc31=['id',_0xd038('0x2c'),_0xd038('0x58'),'created_by',_0xd038('0x59'),_0xd038('0x5a'),_0xd038('0x5b'),_0xd038('0x5c'),'parent_id',_0xd038('0x5d'),_0xd038('0x5e'),_0xd038('0x5f')];return db[_0xd038('0x44')][_0xd038('0x49')]({'where':{'id':_0x15e329['params']['id']},'attributes':['id',_0xd038('0x60'),_0xd038('0x61'),_0xd038('0x62')]})[_0xd038('0x28')](handleEntityNotFound(_0x50c89d,null))[_0xd038('0x28')](function(_0x1f16f2){if(_0x1f16f2){_0x2978d9=_0x1f16f2[_0xd038('0x62')];var _0x442deb=_0x2978d9[_0xd038('0x63')](-0x1);if(_0x442deb==='/'){_0x2978d9=_0x2978d9[_0xd038('0x64')](0x0,_0x2978d9[_0xd038('0x65')](_0x442deb));}return rp({'method':_0xd038('0x66'),'uri':util[_0xd038('0x67')](_0xd038('0x68'),_0x2978d9,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xd038('0x69'),'input_type':_0xd038('0x6a'),'response_type':_0xd038('0x6a'),'rest_data':JSON[_0xd038('0x6b')]({'user_auth':{'user_name':_0x1f16f2[_0xd038('0x60')],'password':_0x1f16f2['password'],'encryption':_0xd038('0x6c')},'application':_0xd038('0x6d')})}});}})['then'](function(_0x592e1c){if(_0x592e1c&&_0x592e1c[_0xd038('0x2c')]!=='Invalid\x20Login'&&_0x592e1c[_0xd038('0x2c')]!==_0xd038('0x6e')){return rp({'method':'POST','uri':util[_0xd038('0x67')](_0xd038('0x68'),_0x2978d9,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xd038('0x6f'),'input_type':_0xd038('0x6a'),'response_type':_0xd038('0x6a'),'rest_data':JSON[_0xd038('0x6b')]({'session':_0x592e1c['id'],'module_name':_0xd038('0x70')})}})[_0xd038('0x28')](function(_0xbdde2a){if(_0xbdde2a){var _0x2f015a=_[_0xd038('0x71')](_0xbdde2a['module_fields']);_['remove'](_0x2f015a,function(_0x27091f){return _0x85dc31[_0xd038('0x72')](_0x27091f['name']);});return{'count':_0x2f015a['length'],'rows':_[_0xd038('0x2f')](_0x2f015a,function(_0x20dbbe){return{'id':_0x20dbbe[_0xd038('0x2c')],'name':_0x20dbbe[_0xd038('0x73')],'custom':_['endsWith'](_0x20dbbe[_0xd038('0x2c')],'_c')?!![]:![],'options':_0x20dbbe[_0xd038('0x4d')]?_[_0xd038('0x2f')](_[_0xd038('0x71')](_0x20dbbe['options']),function(_0x57383d){return{'name':_0x57383d[_0xd038('0x74')],'value':_0x57383d[_0xd038('0x2c')]};}):[]};})};}})[_0xd038('0x28')](respondWithResult(_0x50c89d,null))[_0xd038('0x41')](function(_0x263b2a){var _0x1e4f1d=_0x15e329[_0xd038('0x32')]['test']?0x1f4:_0x263b2a[_0xd038('0x75')]||0x1f4;logger[_0xd038('0x2a')](_0xd038('0x76'),_0xd038('0x57'),_0x1e4f1d,JSON[_0xd038('0x6b')](_0x263b2a));delete _0x263b2a[_0xd038('0x2c')];if(_0x1e4f1d===0x191){_0x1e4f1d=0x190;}_0x50c89d[_0xd038('0x1c')](_0x1e4f1d)[_0xd038('0x2d')](_0x15e329['query'][_0xd038('0x77')]?{'message':_0xd038('0x78'),'statusCode':_0x263b2a[_0xd038('0x75')]}:_0x263b2a);});}else{var _0x51ced5=0x1f4;_0x50c89d[_0xd038('0x1c')](_0x51ced5)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0xde4a=['includes','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../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','set','reject','save','update','then','destroy','status','error','stack','name','send','index','map','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','SugarcrmAccount','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','created_by','description','duration_hours','duration_minutes','parent_id','parent_name','direction','password','slice','substring','lastIndexOf','POST','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','%s%s','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove'];(function(_0x193905,_0x5a1269){var _0x56f7c1=function(_0x504eae){while(--_0x504eae){_0x193905['push'](_0x193905['shift']());}};_0x56f7c1(++_0x5a1269);}(_0xde4a,0x1e6));var _0xade4=function(_0x35f981,_0x38f5e6){_0x35f981=_0x35f981-0x0;var _0x2653a4=_0xde4a[_0x35f981];return _0x2653a4;};'use strict';var emlformat=require(_0xade4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xade4('0x1'));var rp=require(_0xade4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xade4('0x3'));var path=require(_0xade4('0x4'));var sox=require(_0xade4('0x5'));var csv=require(_0xade4('0x6'));var ejs=require(_0xade4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xade4('0x8'));var crypto=require(_0xade4('0x9'));var jsforce=require(_0xade4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xade4('0x6'));var querystring=require(_0xade4('0xb'));var Papa=require(_0xade4('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xade4('0xd'));var as=require(_0xade4('0xe'));var hardwareService=require(_0xade4('0xf'));var logger=require('../../config/logger')(_0xade4('0x10'));var utils=require(_0xade4('0x11'));var config=require(_0xade4('0x12'));var licenseUtil=require(_0xade4('0x13'));var db=require(_0xade4('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xaa9ea2,_0x438407){_0x438407=_0x438407||0xcc;return function(_0x561ce5){if(_0x561ce5){return _0xaa9ea2[_0xade4('0x15')](_0x438407);}return _0xaa9ea2['status'](_0x438407)[_0xade4('0x16')]();};}function respondWithResult(_0x3b425b,_0x193b3c){_0x193b3c=_0x193b3c||0xc8;return function(_0x50ca75){if(_0x50ca75){return _0x3b425b['status'](_0x193b3c)[_0xade4('0x17')](_0x50ca75);}};}function respondWithFilteredResult(_0xf2f9a2,_0x180144){return function(_0x5efcd6){if(_0x5efcd6){var _0x86149c=typeof _0x180144[_0xade4('0x18')]===_0xade4('0x19')&&typeof _0x180144[_0xade4('0x1a')]===_0xade4('0x19');var _0x1c1b70=_0x5efcd6['count'];var _0x24353c=_0x86149c?0x0:_0x180144[_0xade4('0x18')];var _0x191030=_0x86149c?_0x5efcd6[_0xade4('0x1b')]:_0x180144['offset']+_0x180144[_0xade4('0x1a')];var _0x589362;if(_0x191030>=_0x1c1b70){_0x191030=_0x1c1b70;_0x589362=0xc8;}else{_0x589362=0xce;}_0xf2f9a2['status'](_0x589362);return _0xf2f9a2[_0xade4('0x1c')]('Content-Range',_0x24353c+'-'+_0x191030+'/'+_0x1c1b70)['json'](_0x5efcd6);}return null;};}function patchUpdates(_0x3684c5){return function(_0x460a77){try{jsonpatch['apply'](_0x460a77,_0x3684c5,!![]);}catch(_0x2d61fd){return BPromise[_0xade4('0x1d')](_0x2d61fd);}return _0x460a77[_0xade4('0x1e')]();};}function saveUpdates(_0x2becdd,_0x4fbc3d){return function(_0x5008d2){if(_0x5008d2){return _0x5008d2[_0xade4('0x1f')](_0x2becdd)[_0xade4('0x20')](function(_0x1ad601){return _0x1ad601;});}return null;};}function removeEntity(_0x1cad4b,_0x51719d){return function(_0x4c0696){if(_0x4c0696){return _0x4c0696[_0xade4('0x21')]()[_0xade4('0x20')](function(){_0x1cad4b[_0xade4('0x22')](0xcc)[_0xade4('0x16')]();});}};}function handleEntityNotFound(_0x325fc5,_0x5e22a4){return function(_0x4b4c52){if(!_0x4b4c52){_0x325fc5[_0xade4('0x15')](0x194);}return _0x4b4c52;};}function handleError(_0x15038b,_0x2af3d8){_0x2af3d8=_0x2af3d8||0x1f4;return function(_0x502da5){logger[_0xade4('0x23')](_0x502da5[_0xade4('0x24')]);if(_0x502da5[_0xade4('0x25')]){delete _0x502da5[_0xade4('0x25')];}_0x15038b[_0xade4('0x22')](_0x2af3d8)[_0xade4('0x26')](_0x502da5);};}exports[_0xade4('0x27')]=function(_0x1643d4,_0x4d469b){var _0x5b86a4={},_0xc27989={},_0x275bfc={'count':0x0,'rows':[]};var _0x540f57=_[_0xade4('0x28')](db['SugarcrmAccount']['rawAttributes'],function(_0x210406){return{'name':_0x210406[_0xade4('0x29')],'type':_0x210406['type'][_0xade4('0x2a')]};});_0xc27989[_0xade4('0x2b')]=_[_0xade4('0x28')](_0x540f57,_0xade4('0x25'));_0xc27989[_0xade4('0x2c')]=_[_0xade4('0x2d')](_0x1643d4['query']);_0xc27989['filters']=_[_0xade4('0x2e')](_0xc27989[_0xade4('0x2b')],_0xc27989['query']);_0x5b86a4[_0xade4('0x2f')]=_[_0xade4('0x2e')](_0xc27989['model'],qs[_0xade4('0x30')](_0x1643d4[_0xade4('0x2c')][_0xade4('0x30')]));_0x5b86a4['attributes']=_0x5b86a4[_0xade4('0x2f')][_0xade4('0x31')]?_0x5b86a4[_0xade4('0x2f')]:_0xc27989[_0xade4('0x2b')];if(!_0x1643d4[_0xade4('0x2c')][_0xade4('0x32')](_0xade4('0x33'))){_0x5b86a4[_0xade4('0x1a')]=qs[_0xade4('0x1a')](_0x1643d4[_0xade4('0x2c')]['limit']);_0x5b86a4[_0xade4('0x18')]=qs['offset'](_0x1643d4[_0xade4('0x2c')][_0xade4('0x18')]);}_0x5b86a4[_0xade4('0x34')]=qs[_0xade4('0x35')](_0x1643d4[_0xade4('0x2c')]['sort']);_0x5b86a4[_0xade4('0x36')]=qs[_0xade4('0x37')](_[_0xade4('0x38')](_0x1643d4[_0xade4('0x2c')],_0xc27989[_0xade4('0x37')]),_0x540f57);if(_0x1643d4[_0xade4('0x2c')]['filter']){_0x5b86a4[_0xade4('0x36')]=_[_0xade4('0x39')](_0x5b86a4['where'],{'$or':_[_0xade4('0x28')](_0x540f57,function(_0x13e365){if(_0x13e365[_0xade4('0x3a')]!==_0xade4('0x3b')){var _0x39e04b={};_0x39e04b[_0x13e365[_0xade4('0x25')]]={'$like':'%'+_0x1643d4[_0xade4('0x2c')][_0xade4('0x3c')]+'%'};return _0x39e04b;}})});}_0x5b86a4=_[_0xade4('0x39')]({},_0x5b86a4,_0x1643d4[_0xade4('0x3d')]);var _0x43b54a={'where':_0x5b86a4[_0xade4('0x36')]};return db[_0xade4('0x3e')]['count'](_0x43b54a)[_0xade4('0x20')](function(_0x5e74a8){_0x275bfc[_0xade4('0x1b')]=_0x5e74a8;if(_0x1643d4['query'][_0xade4('0x3f')]){_0x5b86a4[_0xade4('0x40')]=[{'all':!![]}];}return db[_0xade4('0x3e')][_0xade4('0x41')](_0x5b86a4);})[_0xade4('0x20')](function(_0x77c8b1){_0x275bfc[_0xade4('0x42')]=_0x77c8b1;return _0x275bfc;})[_0xade4('0x20')](respondWithFilteredResult(_0x4d469b,_0x5b86a4))[_0xade4('0x43')](handleError(_0x4d469b,null));};exports[_0xade4('0x44')]=function(_0x195636,_0x5a4b11){var _0x24f09e={'raw':![],'where':{'id':_0x195636[_0xade4('0x45')]['id']}},_0x18acef={};_0x18acef['model']=_[_0xade4('0x2d')](db[_0xade4('0x3e')][_0xade4('0x46')]);_0x18acef['query']=_[_0xade4('0x2d')](_0x195636[_0xade4('0x2c')]);_0x18acef[_0xade4('0x37')]=_[_0xade4('0x2e')](_0x18acef[_0xade4('0x2b')],_0x18acef['query']);_0x24f09e[_0xade4('0x2f')]=_['intersection'](_0x18acef[_0xade4('0x2b')],qs[_0xade4('0x30')](_0x195636[_0xade4('0x2c')][_0xade4('0x30')]));_0x24f09e['attributes']=_0x24f09e[_0xade4('0x2f')]['length']?_0x24f09e['attributes']:_0x18acef['model'];if(_0x195636[_0xade4('0x2c')][_0xade4('0x3f')]){_0x24f09e[_0xade4('0x40')]=[{'all':!![]}];}_0x24f09e=_[_0xade4('0x39')]({},_0x24f09e,_0x195636[_0xade4('0x3d')]);return db[_0xade4('0x3e')][_0xade4('0x47')](_0x24f09e)[_0xade4('0x20')](handleEntityNotFound(_0x5a4b11,null))[_0xade4('0x20')](respondWithResult(_0x5a4b11,null))[_0xade4('0x43')](handleError(_0x5a4b11,null));};exports['create']=function(_0x1b6329,_0x382ac4){return db[_0xade4('0x3e')][_0xade4('0x48')](_0x1b6329['body'],{})[_0xade4('0x20')](respondWithResult(_0x382ac4,0xc9))[_0xade4('0x43')](handleError(_0x382ac4,null));};exports['update']=function(_0x5e901,_0x2ac746){if(_0x5e901[_0xade4('0x49')]['id']){delete _0x5e901['body']['id'];}return db[_0xade4('0x3e')][_0xade4('0x47')]({'where':{'id':_0x5e901[_0xade4('0x45')]['id']}})[_0xade4('0x20')](handleEntityNotFound(_0x2ac746,null))['then'](saveUpdates(_0x5e901[_0xade4('0x49')],null))[_0xade4('0x20')](respondWithResult(_0x2ac746,null))['catch'](handleError(_0x2ac746,null));};exports[_0xade4('0x21')]=function(_0xef5923,_0x17ce2c){return db[_0xade4('0x3e')][_0xade4('0x47')]({'where':{'id':_0xef5923[_0xade4('0x45')]['id']}})[_0xade4('0x20')](handleEntityNotFound(_0x17ce2c,null))[_0xade4('0x20')](removeEntity(_0x17ce2c,null))[_0xade4('0x43')](handleError(_0x17ce2c,null));};exports['getConfigurations']=function(_0x49e86d,_0x17577d,_0x23e0a5){var _0x2d3a7b={};var _0x2850d9={};var _0x58b472;var _0x32c04b;return db['SugarcrmAccount'][_0xade4('0x4a')]({'where':{'id':_0x49e86d[_0xade4('0x45')]['id']}})[_0xade4('0x20')](handleEntityNotFound(_0x17577d,null))[_0xade4('0x20')](function(_0x5ef02c){if(_0x5ef02c){_0x58b472=_0x5ef02c;_0x2850d9[_0xade4('0x2b')]=_['keys'](db[_0xade4('0x4b')]['rawAttributes']);_0x2850d9[_0xade4('0x2c')]=_[_0xade4('0x2d')](_0x49e86d[_0xade4('0x2c')]);_0x2850d9[_0xade4('0x37')]=_['intersection'](_0x2850d9[_0xade4('0x2b')],_0x2850d9[_0xade4('0x2c')]);_0x2d3a7b[_0xade4('0x2f')]=_[_0xade4('0x2e')](_0x2850d9['model'],qs[_0xade4('0x30')](_0x49e86d[_0xade4('0x2c')][_0xade4('0x30')]));_0x2d3a7b[_0xade4('0x2f')]=_0x2d3a7b[_0xade4('0x2f')][_0xade4('0x31')]?_0x2d3a7b[_0xade4('0x2f')]:_0x2850d9[_0xade4('0x2b')];_0x2d3a7b[_0xade4('0x34')]=qs['sort'](_0x49e86d[_0xade4('0x2c')][_0xade4('0x35')]);_0x2d3a7b[_0xade4('0x36')]=qs[_0xade4('0x37')](_[_0xade4('0x38')](_0x49e86d[_0xade4('0x2c')],_0x2850d9['filters']));if(_0x49e86d[_0xade4('0x2c')][_0xade4('0x3c')]){_0x2d3a7b['where']=_[_0xade4('0x39')](_0x2d3a7b[_0xade4('0x36')],{'$or':_['map'](_0x2d3a7b[_0xade4('0x2f')],function(_0x38670a){var _0xb20b47={};_0xb20b47[_0x38670a]={'$like':'%'+_0x49e86d[_0xade4('0x2c')]['filter']+'%'};return _0xb20b47;})});}_0x2d3a7b=_[_0xade4('0x39')]({},_0x2d3a7b,_0x49e86d[_0xade4('0x3d')]);return _0x58b472['getConfigurations'](_0x2d3a7b);}})['then'](function(_0xd9ca51){if(_0xd9ca51){_0x32c04b=_0xd9ca51[_0xade4('0x31')];if(!_0x49e86d[_0xade4('0x2c')][_0xade4('0x32')](_0xade4('0x33'))){_0x2d3a7b['limit']=qs[_0xade4('0x1a')](_0x49e86d[_0xade4('0x2c')]['limit']);_0x2d3a7b[_0xade4('0x18')]=qs['offset'](_0x49e86d[_0xade4('0x2c')][_0xade4('0x18')]);}return _0x58b472[_0xade4('0x4c')](_0x2d3a7b);}})[_0xade4('0x20')](function(_0x1d8429){if(_0x1d8429){return _0x1d8429?{'count':_0x32c04b,'rows':_0x1d8429}:null;}})[_0xade4('0x20')](respondWithResult(_0x17577d,null))[_0xade4('0x43')](handleError(_0x17577d,null));};exports[_0xade4('0x4d')]=function(_0x33a0fd,_0x534cbf,_0x28dd08){if(_0x33a0fd[_0xade4('0x49')]['id']){delete _0x33a0fd[_0xade4('0x49')]['id'];}return db[_0xade4('0x3e')][_0xade4('0x4a')]({'where':{'id':_0x33a0fd[_0xade4('0x45')]['id']}})[_0xade4('0x20')](handleEntityNotFound(_0x534cbf,null))['then'](function(_0x135c48){if(_0x135c48){_0x33a0fd[_0xade4('0x49')][_0xade4('0x4e')]=_0x135c48['id'];_0x33a0fd['body'][_0xade4('0x4f')]=integrations[_0xade4('0x50')](_0x33a0fd[_0xade4('0x49')]['channel'],_0x33a0fd[_0xade4('0x49')][_0xade4('0x3a')]);_0x33a0fd[_0xade4('0x49')][_0xade4('0x51')]=integrations[_0xade4('0x52')](_0x33a0fd[_0xade4('0x49')][_0xade4('0x53')],_0x33a0fd[_0xade4('0x49')][_0xade4('0x3a')]);return db[_0xade4('0x4b')][_0xade4('0x48')](_0x33a0fd['body'],{'include':[{'model':db[_0xade4('0x54')],'as':_0xade4('0x4f')},{'model':db[_0xade4('0x54')],'as':_0xade4('0x51')}]});}return null;})[_0xade4('0x20')](respondWithResult(_0x534cbf,null))['catch'](handleError(_0x534cbf,null));};exports[_0xade4('0x55')]=function(_0x21c020,_0x24b76c,_0x675931){var _0xb67620='';var _0x1c4235=['id','name','assigned_user_id',_0xade4('0x56'),_0xade4('0x57'),'date_start',_0xade4('0x58'),_0xade4('0x59'),_0xade4('0x5a'),'parent_type',_0xade4('0x5b'),_0xade4('0x5c')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x21c020[_0xade4('0x45')]['id']},'attributes':['id','username',_0xade4('0x5d'),'remoteUri']})[_0xade4('0x20')](handleEntityNotFound(_0x24b76c,null))['then'](function(_0x5af22b){if(_0x5af22b){_0xb67620=_0x5af22b['remoteUri'];var _0x2452e4=_0xb67620[_0xade4('0x5e')](-0x1);if(_0x2452e4==='/'){_0xb67620=_0xb67620[_0xade4('0x5f')](0x0,_0xb67620[_0xade4('0x60')](_0x2452e4));}return rp({'method':_0xade4('0x61'),'uri':util['format']('%s%s',_0xb67620,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xade4('0x62'),'input_type':_0xade4('0x63'),'response_type':_0xade4('0x63'),'rest_data':JSON[_0xade4('0x64')]({'user_auth':{'user_name':_0x5af22b[_0xade4('0x65')],'password':_0x5af22b[_0xade4('0x5d')],'encryption':_0xade4('0x66')},'application':_0xade4('0x67')})}});}})[_0xade4('0x20')](function(_0x34ef6e){if(_0x34ef6e&&_0x34ef6e[_0xade4('0x25')]!==_0xade4('0x68')&&_0x34ef6e[_0xade4('0x25')]!==_0xade4('0x69')){return rp({'method':_0xade4('0x61'),'uri':util[_0xade4('0x6a')](_0xade4('0x6b'),_0xb67620,_0xade4('0x6c')),'json':!![],'form':{'method':_0xade4('0x6d'),'input_type':'JSON','response_type':_0xade4('0x63'),'rest_data':JSON[_0xade4('0x64')]({'session':_0x34ef6e['id'],'module_name':_0xade4('0x6e')})}})[_0xade4('0x20')](function(_0x2fc21d){if(_0x2fc21d){var _0x1670c8=_[_0xade4('0x6f')](_0x2fc21d[_0xade4('0x70')]);_[_0xade4('0x71')](_0x1670c8,function(_0x27f409){return _0x1c4235[_0xade4('0x72')](_0x27f409['name']);});return{'count':_0x1670c8[_0xade4('0x31')],'rows':_[_0xade4('0x28')](_0x1670c8,function(_0x227b07){return{'id':_0x227b07[_0xade4('0x25')],'name':_0x227b07['label'],'custom':_['endsWith'](_0x227b07['name'],'_c')?!![]:![],'options':_0x227b07[_0xade4('0x3d')]?_['map'](_['values'](_0x227b07[_0xade4('0x3d')]),function(_0x54940a){return{'name':_0x54940a[_0xade4('0x73')],'value':_0x54940a[_0xade4('0x25')]};}):[]};})};}})[_0xade4('0x20')](respondWithResult(_0x24b76c,null))['catch'](function(_0x11db0f){var _0x26eb7d=_0x21c020[_0xade4('0x2c')][_0xade4('0x74')]?0x1f4:_0x11db0f[_0xade4('0x75')]||0x1f4;logger[_0xade4('0x23')](_0xade4('0x76'),'getFields',_0x26eb7d,JSON['stringify'](_0x11db0f));delete _0x11db0f[_0xade4('0x25')];if(_0x26eb7d===0x191){_0x26eb7d=0x190;}_0x24b76c[_0xade4('0x22')](_0x26eb7d)[_0xade4('0x26')](_0x21c020[_0xade4('0x2c')][_0xade4('0x74')]?{'message':_0xade4('0x77'),'statusCode':_0x11db0f[_0xade4('0x75')]}:_0x11db0f);});}else{var _0xb2db02=0x1f4;_0x24b76c['status'](_0xb2db02)[_0xade4('0x26')]({'message':_0xade4('0x77'),'statusCode':0x190});}});};
\ No newline at end of file
index d074124..334dbf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8b1=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSugarcrmAccount.attributes','exports'];(function(_0x3dee92,_0x55e1eb){var _0x44d36e=function(_0x34de1a){while(--_0x34de1a){_0x3dee92['push'](_0x3dee92['shift']());}};_0x44d36e(++_0x55e1eb);}(_0xa8b1,0x182));var _0x1a8b=function(_0x5917b0,_0x290974){_0x5917b0=_0x5917b0-0x0;var _0x1f89b6=_0xa8b1[_0x5917b0];return _0x1f89b6;};'use strict';var _=require(_0x1a8b('0x0'));var util=require(_0x1a8b('0x1'));var logger=require(_0x1a8b('0x2'))(_0x1a8b('0x3'));var moment=require(_0x1a8b('0x4'));var BPromise=require(_0x1a8b('0x5'));var rp=require(_0x1a8b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a8b('0x7'));var attributes=require(_0x1a8b('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x1a8b('0x9')]=function(_0x23d6ec,_0x4693b9){return _0x23d6ec['define'](_0x1a8b('0xa'),attributes,{'tableName':_0x1a8b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa521=['rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash','util','moment','bluebird','path'];(function(_0x5225e2,_0x3c64e){var _0x4d78a2=function(_0x34916d){while(--_0x34916d){_0x5225e2['push'](_0x5225e2['shift']());}};_0x4d78a2(++_0x3c64e);}(_0xa521,0xeb));var _0x1a52=function(_0x2b91ed,_0x247b40){_0x2b91ed=_0x2b91ed-0x0;var _0x2fd11a=_0xa521[_0x2b91ed];return _0x2fd11a;};'use strict';var _=require(_0x1a52('0x0'));var util=require(_0x1a52('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1a52('0x2'));var BPromise=require(_0x1a52('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a52('0x4'));var rimraf=require(_0x1a52('0x5'));var config=require(_0x1a52('0x6'));var attributes=require(_0x1a52('0x7'));var integrations=require(_0x1a52('0x8'));module[_0x1a52('0x9')]=function(_0xc33521,_0x27cf5a){return _0xc33521[_0x1a52('0xa')](_0x1a52('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ef3db47..85a537c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc531=['GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','map','include','model','then','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x5bfa17,_0x3743f4){var _0x42a571=function(_0x4065bd){while(--_0x4065bd){_0x5bfa17['push'](_0x5bfa17['shift']());}};_0x42a571(++_0x3743f4);}(_0xc531,0x1c7));var _0x1c53=function(_0x100c44,_0x243a9d){_0x100c44=_0x100c44-0x0;var _0x1d9603=_0xc531[_0x100c44];return _0x1d9603;};'use strict';var _=require(_0x1c53('0x0'));var util=require(_0x1c53('0x1'));var moment=require(_0x1c53('0x2'));var BPromise=require(_0x1c53('0x3'));var rs=require(_0x1c53('0x4'));var fs=require('fs');var Redis=require(_0x1c53('0x5'));var db=require(_0x1c53('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c53('0x7'));var config=require(_0x1c53('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1c53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a8aad,_0x415a19,_0x257ad0){return new BPromise(function(_0x29062f,_0x426826){return client[_0x1c53('0xa')](_0x1a8aad,_0x257ad0)['then'](function(_0x3b049a){logger[_0x1c53('0xb')](_0x1c53('0xc'),_0x415a19,_0x1c53('0xd'));logger[_0x1c53('0xe')](_0x1c53('0xf'),_0x415a19,_0x1c53('0xd'),JSON[_0x1c53('0x10')](_0x3b049a));if(_0x3b049a['error']){if(_0x3b049a[_0x1c53('0x11')]['code']===0x1f4){logger[_0x1c53('0x11')](_0x1c53('0xc'),_0x415a19,_0x3b049a[_0x1c53('0x11')]['message']);return _0x426826(_0x3b049a['error']['message']);}logger['error'](_0x1c53('0xc'),_0x415a19,_0x3b049a[_0x1c53('0x11')][_0x1c53('0x12')]);return _0x29062f(_0x3b049a['error']['message']);}else{logger['info'](_0x1c53('0xc'),_0x415a19,'request\x20sent');_0x29062f(_0x3b049a[_0x1c53('0x13')][_0x1c53('0x12')]);}})[_0x1c53('0x14')](function(_0x344fb9){logger[_0x1c53('0x11')](_0x1c53('0xc'),_0x415a19,_0x344fb9);_0x426826(_0x344fb9);});});}exports[_0x1c53('0x15')]=function(_0x565523){var _0xa58023=this;return new Promise(function(_0x505a1c,_0x4e052a){return db[_0x1c53('0x16')][_0x1c53('0x17')]({'raw':_0x565523['options']?_0x565523[_0x1c53('0x18')][_0x1c53('0x19')]===undefined?!![]:![]:!![],'where':_0x565523[_0x1c53('0x18')]?_0x565523[_0x1c53('0x18')][_0x1c53('0x1a')]||null:null,'attributes':_0x565523[_0x1c53('0x18')]?_0x565523[_0x1c53('0x18')][_0x1c53('0x1b')]||null:null,'limit':_0x565523[_0x1c53('0x18')]?_0x565523['options']['limit']||null:null,'include':_0x565523['options']?_0x565523['options']['include']?_[_0x1c53('0x1c')](_0x565523[_0x1c53('0x18')][_0x1c53('0x1d')],function(_0x27f392){return{'model':db[_0x27f392[_0x1c53('0x1e')]],'as':_0x27f392['as'],'attributes':_0x27f392[_0x1c53('0x1b')],'include':_0x27f392[_0x1c53('0x1d')]?_['map'](_0x27f392[_0x1c53('0x1d')],function(_0x3e7015){return{'model':db[_0x3e7015[_0x1c53('0x1e')]],'as':_0x3e7015['as'],'attributes':_0x3e7015['attributes'],'include':_0x3e7015[_0x1c53('0x1d')]?_['map'](_0x3e7015[_0x1c53('0x1d')],function(_0x367164){return{'model':db[_0x367164[_0x1c53('0x1e')]],'as':_0x367164['as'],'attributes':_0x367164[_0x1c53('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1c53('0x1f')](function(_0x1bf390){logger[_0x1c53('0xb')]('GetSugarcrmAccount',_0x565523);logger[_0x1c53('0xe')]('GetSugarcrmAccount',_0x565523,JSON[_0x1c53('0x10')](_0x1bf390));_0x505a1c(_0x1bf390);})[_0x1c53('0x14')](function(_0x2ab9e6){logger['error'](_0x1c53('0x15'),_0x2ab9e6['message'],_0x565523);_0x4e052a(_0xa58023[_0x1c53('0x11')](0x1f4,_0x2ab9e6['message']));});});};exports[_0x1c53('0x20')]=function(_0x3147ec){var _0x43e91f=this;return new Promise(function(_0x5826ef,_0x2f91be){return db[_0x1c53('0x16')][_0x1c53('0x21')]({'raw':_0x3147ec[_0x1c53('0x18')]?_0x3147ec['options'][_0x1c53('0x19')]===undefined?!![]:![]:!![],'where':_0x3147ec['options']?_0x3147ec[_0x1c53('0x18')][_0x1c53('0x1a')]||null:null,'attributes':_0x3147ec['options']?_0x3147ec[_0x1c53('0x18')][_0x1c53('0x1b')]||null:null,'include':_0x3147ec[_0x1c53('0x18')]?_0x3147ec[_0x1c53('0x18')][_0x1c53('0x1d')]?_[_0x1c53('0x1c')](_0x3147ec['options'][_0x1c53('0x1d')],function(_0x204838){return{'model':db[_0x204838[_0x1c53('0x1e')]],'as':_0x204838['as'],'attributes':_0x204838['attributes'],'include':_0x204838[_0x1c53('0x1d')]?_[_0x1c53('0x1c')](_0x204838[_0x1c53('0x1d')],function(_0x297409){return{'model':db[_0x297409[_0x1c53('0x1e')]],'as':_0x297409['as'],'attributes':_0x297409[_0x1c53('0x1b')],'include':_0x297409[_0x1c53('0x1d')]?_[_0x1c53('0x1c')](_0x297409[_0x1c53('0x1d')],function(_0x31721e){return{'model':db[_0x31721e[_0x1c53('0x1e')]],'as':_0x31721e['as'],'attributes':_0x31721e[_0x1c53('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1c53('0x1f')](function(_0xf77b20){logger[_0x1c53('0xb')](_0x1c53('0x20'),_0x3147ec);logger['debug']('ShowSugarcrmAccount',_0x3147ec,JSON[_0x1c53('0x10')](_0xf77b20));_0x5826ef(_0xf77b20);})[_0x1c53('0x14')](function(_0x44a422){logger[_0x1c53('0x11')](_0x1c53('0x20'),_0x44a422[_0x1c53('0x12')],_0x3147ec);_0x2f91be(_0x43e91f[_0x1c53('0x11')](0x1f4,_0x44a422['message']));});});};
\ No newline at end of file
+var _0xe88e=['raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','GetSugarcrmAccount','findAll','options','where','attributes','include','map','model','ShowSugarcrmAccount','SugarcrmAccount','find'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xe88e,0x1f0));var _0xee88=function(_0x4c2d60,_0x92e137){_0x4c2d60=_0x4c2d60-0x0;var _0x29664f=_0xe88e[_0x4c2d60];return _0x29664f;};'use strict';var _=require(_0xee88('0x0'));var util=require(_0xee88('0x1'));var moment=require('moment');var BPromise=require(_0xee88('0x2'));var rs=require(_0xee88('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee88('0x4'))['db'];var utils=require(_0xee88('0x5'));var logger=require(_0xee88('0x6'))(_0xee88('0x7'));var config=require(_0xee88('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xee88('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b4b96,_0x54884c,_0x13cc98){return new BPromise(function(_0x2add4c,_0x54f22b){return client[_0xee88('0xa')](_0x3b4b96,_0x13cc98)[_0xee88('0xb')](function(_0x4b5bc9){logger['info'](_0xee88('0xc'),_0x54884c,'request\x20sent');logger[_0xee88('0xd')](_0xee88('0xe'),_0x54884c,_0xee88('0xf'),JSON[_0xee88('0x10')](_0x4b5bc9));if(_0x4b5bc9[_0xee88('0x11')]){if(_0x4b5bc9['error']['code']===0x1f4){logger[_0xee88('0x11')](_0xee88('0xc'),_0x54884c,_0x4b5bc9[_0xee88('0x11')][_0xee88('0x12')]);return _0x54f22b(_0x4b5bc9[_0xee88('0x11')][_0xee88('0x12')]);}logger[_0xee88('0x11')](_0xee88('0xc'),_0x54884c,_0x4b5bc9[_0xee88('0x11')]['message']);return _0x2add4c(_0x4b5bc9[_0xee88('0x11')][_0xee88('0x12')]);}else{logger[_0xee88('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x54884c,_0xee88('0xf'));_0x2add4c(_0x4b5bc9['result'][_0xee88('0x12')]);}})[_0xee88('0x14')](function(_0x5a87e1){logger[_0xee88('0x11')](_0xee88('0xc'),_0x54884c,_0x5a87e1);_0x54f22b(_0x5a87e1);});});}exports[_0xee88('0x15')]=function(_0x4712af){var _0x4d26bb=this;return new Promise(function(_0x1ff128,_0x2ea8eb){return db['SugarcrmAccount'][_0xee88('0x16')]({'raw':_0x4712af[_0xee88('0x17')]?_0x4712af[_0xee88('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4712af[_0xee88('0x17')]?_0x4712af[_0xee88('0x17')][_0xee88('0x18')]||null:null,'attributes':_0x4712af[_0xee88('0x17')]?_0x4712af[_0xee88('0x17')][_0xee88('0x19')]||null:null,'limit':_0x4712af[_0xee88('0x17')]?_0x4712af['options']['limit']||null:null,'include':_0x4712af['options']?_0x4712af[_0xee88('0x17')][_0xee88('0x1a')]?_[_0xee88('0x1b')](_0x4712af[_0xee88('0x17')][_0xee88('0x1a')],function(_0x5b3fa0){return{'model':db[_0x5b3fa0[_0xee88('0x1c')]],'as':_0x5b3fa0['as'],'attributes':_0x5b3fa0['attributes'],'include':_0x5b3fa0['include']?_[_0xee88('0x1b')](_0x5b3fa0[_0xee88('0x1a')],function(_0x30b3d9){return{'model':db[_0x30b3d9['model']],'as':_0x30b3d9['as'],'attributes':_0x30b3d9[_0xee88('0x19')],'include':_0x30b3d9[_0xee88('0x1a')]?_[_0xee88('0x1b')](_0x30b3d9['include'],function(_0x40efb3){return{'model':db[_0x40efb3['model']],'as':_0x40efb3['as'],'attributes':_0x40efb3[_0xee88('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ff4fc){logger[_0xee88('0x13')](_0xee88('0x15'),_0x4712af);logger['debug'](_0xee88('0x15'),_0x4712af,JSON[_0xee88('0x10')](_0x1ff4fc));_0x1ff128(_0x1ff4fc);})[_0xee88('0x14')](function(_0x4e8a05){logger[_0xee88('0x11')]('GetSugarcrmAccount',_0x4e8a05[_0xee88('0x12')],_0x4712af);_0x2ea8eb(_0x4d26bb[_0xee88('0x11')](0x1f4,_0x4e8a05[_0xee88('0x12')]));});});};exports[_0xee88('0x1d')]=function(_0x258bc1){var _0x52805e=this;return new Promise(function(_0x4b12ce,_0x12f4b3){return db[_0xee88('0x1e')][_0xee88('0x1f')]({'raw':_0x258bc1[_0xee88('0x17')]?_0x258bc1[_0xee88('0x17')][_0xee88('0x20')]===undefined?!![]:![]:!![],'where':_0x258bc1['options']?_0x258bc1[_0xee88('0x17')][_0xee88('0x18')]||null:null,'attributes':_0x258bc1[_0xee88('0x17')]?_0x258bc1['options'][_0xee88('0x19')]||null:null,'include':_0x258bc1['options']?_0x258bc1['options']['include']?_[_0xee88('0x1b')](_0x258bc1[_0xee88('0x17')][_0xee88('0x1a')],function(_0x5f19ef){return{'model':db[_0x5f19ef[_0xee88('0x1c')]],'as':_0x5f19ef['as'],'attributes':_0x5f19ef[_0xee88('0x19')],'include':_0x5f19ef[_0xee88('0x1a')]?_[_0xee88('0x1b')](_0x5f19ef[_0xee88('0x1a')],function(_0x46c5cd){return{'model':db[_0x46c5cd[_0xee88('0x1c')]],'as':_0x46c5cd['as'],'attributes':_0x46c5cd['attributes'],'include':_0x46c5cd[_0xee88('0x1a')]?_[_0xee88('0x1b')](_0x46c5cd[_0xee88('0x1a')],function(_0x4028b2){return{'model':db[_0x4028b2['model']],'as':_0x4028b2['as'],'attributes':_0x4028b2['attributes']};}):[]};}):[]};}):[]:[]})[_0xee88('0xb')](function(_0x26e39b){logger[_0xee88('0x13')](_0xee88('0x1d'),_0x258bc1);logger[_0xee88('0xd')](_0xee88('0x1d'),_0x258bc1,JSON[_0xee88('0x10')](_0x26e39b));_0x4b12ce(_0x26e39b);})['catch'](function(_0x49027f){logger[_0xee88('0x11')](_0xee88('0x1d'),_0x49027f[_0xee88('0x12')],_0x258bc1);_0x12f4b3(_0x52805e['error'](0x1f4,_0x49027f[_0xee88('0x12')]));});});};
\ No newline at end of file
index 671a9d7..790eb3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6790=['isAuthenticated','getFields','/:id/descriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x45228a,_0x4acbf3){var _0x4fbf5e=function(_0x418a3e){while(--_0x418a3e){_0x45228a['push'](_0x45228a['shift']());}};_0x4fbf5e(++_0x4acbf3);}(_0x6790,0x15f));var _0x0679=function(_0x59aecc,_0x1cd7e6){_0x59aecc=_0x59aecc-0x0;var _0x17a857=_0x6790[_0x59aecc];return _0x17a857;};'use strict';var multer=require(_0x0679('0x0'));var util=require(_0x0679('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0679('0x2')]();var fs_extra=require(_0x0679('0x3'));var auth=require(_0x0679('0x4'));var interaction=require(_0x0679('0x5'));var config=require(_0x0679('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x0679('0x7')]('/',auth['isAuthenticated'](),controller[_0x0679('0x8')]);router[_0x0679('0x7')]('/:id',auth[_0x0679('0x9')](),controller['show']);router[_0x0679('0x7')]('/:id/fields',auth[_0x0679('0x9')](),controller[_0x0679('0xa')]);router['get']('/:id/subjects',auth[_0x0679('0x9')](),controller['getSubjects']);router['get'](_0x0679('0xb'),auth[_0x0679('0x9')](),controller['getDescriptions']);router[_0x0679('0xc')]('/',auth[_0x0679('0x9')](),controller[_0x0679('0xd')]);router[_0x0679('0xe')](_0x0679('0xf'),auth[_0x0679('0x9')](),controller[_0x0679('0x10')]);router[_0x0679('0x11')](_0x0679('0xf'),auth[_0x0679('0x9')](),controller[_0x0679('0x12')]);module[_0x0679('0x13')]=router;
\ No newline at end of file
+var _0xaabb=['post','put','update','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x2a855e,_0xdef565){var _0x5c076c=function(_0x1fba32){while(--_0x1fba32){_0x2a855e['push'](_0x2a855e['shift']());}};_0x5c076c(++_0xdef565);}(_0xaabb,0x9c));var _0xbaab=function(_0x46ba12,_0x47cf95){_0x46ba12=_0x46ba12-0x0;var _0x3c2297=_0xaabb[_0x46ba12];return _0x3c2297;};'use strict';var multer=require(_0xbaab('0x0'));var util=require('util');var path=require(_0xbaab('0x1'));var timeout=require(_0xbaab('0x2'));var express=require(_0xbaab('0x3'));var router=express[_0xbaab('0x4')]();var fs_extra=require(_0xbaab('0x5'));var auth=require(_0xbaab('0x6'));var interaction=require(_0xbaab('0x7'));var config=require(_0xbaab('0x8'));var controller=require(_0xbaab('0x9'));router['get']('/',auth[_0xbaab('0xa')](),controller[_0xbaab('0xb')]);router[_0xbaab('0xc')]('/:id',auth[_0xbaab('0xa')](),controller[_0xbaab('0xd')]);router[_0xbaab('0xc')](_0xbaab('0xe'),auth[_0xbaab('0xa')](),controller[_0xbaab('0xf')]);router[_0xbaab('0xc')](_0xbaab('0x10'),auth[_0xbaab('0xa')](),controller['getSubjects']);router['get'](_0xbaab('0x11'),auth[_0xbaab('0xa')](),controller[_0xbaab('0x12')]);router[_0xbaab('0x13')]('/',auth[_0xbaab('0xa')](),controller['create']);router[_0xbaab('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xbaab('0x15')]);router['delete'](_0xbaab('0x16'),auth[_0xbaab('0xa')](),controller[_0xbaab('0x17')]);module[_0xbaab('0x18')]=router;
\ No newline at end of file
index ae6fe44..9889dcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46fc=['exports','STRING'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x46fc,0x1be));var _0xc46f=function(_0x1e222c,_0x4d1635){_0x1e222c=_0x1e222c-0x0;var _0xe83ff6=_0x46fc[_0x1e222c];return _0xe83ff6;};'use strict';var Sequelize=require('sequelize');module[_0xc46f('0x0')]={'name':{'type':Sequelize[_0xc46f('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf9bf=['STRING','sequelize'];(function(_0x2fbce9,_0x206109){var _0x2b04c7=function(_0x1bee64){while(--_0x1bee64){_0x2fbce9['push'](_0x2fbce9['shift']());}};_0x2b04c7(++_0x206109);}(_0xf9bf,0xe1));var _0xff9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf9bf[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xff9b('0x0'));module['exports']={'name':{'type':Sequelize[_0xff9b('0x1')]},'description':{'type':Sequelize[_0xff9b('0x1')]}};
\ No newline at end of file
index 1ca0144..070a13c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf235=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','stack','name','send','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','findOne','nolimit','getFields','getSubjects','SugarcrmField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x49d337,_0x511183){var _0x283dcc=function(_0x3e4146){while(--_0x3e4146){_0x49d337['push'](_0x49d337['shift']());}};_0x283dcc(++_0x511183);}(_0xf235,0x90));var _0x5f23=function(_0x3633d0,_0x2b0ec8){_0x3633d0=_0x3633d0-0x0;var _0x480ad7=_0xf235[_0x3633d0];return _0x480ad7;};'use strict';var emlformat=require(_0x5f23('0x0'));var rimraf=require(_0x5f23('0x1'));var zipdir=require(_0x5f23('0x2'));var jsonpatch=require(_0x5f23('0x3'));var rp=require(_0x5f23('0x4'));var moment=require('moment');var BPromise=require(_0x5f23('0x5'));var Mustache=require(_0x5f23('0x6'));var util=require('util');var path=require(_0x5f23('0x7'));var sox=require(_0x5f23('0x8'));var csv=require('to-csv');var ejs=require(_0x5f23('0x9'));var fs=require('fs');var fs_extra=require(_0x5f23('0xa'));var _=require('lodash');var squel=require(_0x5f23('0xb'));var crypto=require(_0x5f23('0xc'));var jsforce=require(_0x5f23('0xd'));var deskjs=require(_0x5f23('0xe'));var toCsv=require(_0x5f23('0xf'));var querystring=require(_0x5f23('0x10'));var Papa=require(_0x5f23('0x11'));var Redis=require(_0x5f23('0x12'));var authService=require(_0x5f23('0x13'));var qs=require(_0x5f23('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f23('0x15'));var logger=require('../../config/logger')(_0x5f23('0x16'));var utils=require(_0x5f23('0x17'));var config=require(_0x5f23('0x18'));var licenseUtil=require(_0x5f23('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13a9b1,_0x394457){_0x394457=_0x394457||0xcc;return function(_0x51dba3){if(_0x51dba3){return _0x13a9b1[_0x5f23('0x1a')](_0x394457);}return _0x13a9b1[_0x5f23('0x1b')](_0x394457)[_0x5f23('0x1c')]();};}function respondWithResult(_0x5e3a92,_0x372909){_0x372909=_0x372909||0xc8;return function(_0x3a0697){if(_0x3a0697){return _0x5e3a92['status'](_0x372909)[_0x5f23('0x1d')](_0x3a0697);}};}function respondWithFilteredResult(_0x35565c,_0x42deaf){return function(_0x1a22e4){if(_0x1a22e4){var _0x2ede75=typeof _0x42deaf[_0x5f23('0x1e')]===_0x5f23('0x1f')&&typeof _0x42deaf['limit']==='undefined';var _0x3deda5=_0x1a22e4[_0x5f23('0x20')];var _0x2dd58f=_0x2ede75?0x0:_0x42deaf[_0x5f23('0x1e')];var _0x4eafbb=_0x2ede75?_0x1a22e4[_0x5f23('0x20')]:_0x42deaf[_0x5f23('0x1e')]+_0x42deaf[_0x5f23('0x21')];var _0x23588d;if(_0x4eafbb>=_0x3deda5){_0x4eafbb=_0x3deda5;_0x23588d=0xc8;}else{_0x23588d=0xce;}_0x35565c[_0x5f23('0x1b')](_0x23588d);return _0x35565c[_0x5f23('0x22')](_0x5f23('0x23'),_0x2dd58f+'-'+_0x4eafbb+'/'+_0x3deda5)[_0x5f23('0x1d')](_0x1a22e4);}return null;};}function patchUpdates(_0x2d43c1){return function(_0x27304f){try{jsonpatch[_0x5f23('0x24')](_0x27304f,_0x2d43c1,!![]);}catch(_0x1d3014){return BPromise['reject'](_0x1d3014);}return _0x27304f[_0x5f23('0x25')]();};}function saveUpdates(_0x25abfd,_0x399c69){return function(_0xe92fd4){if(_0xe92fd4){return _0xe92fd4['update'](_0x25abfd)[_0x5f23('0x26')](function(_0x85917e){return _0x85917e;});}return null;};}function removeEntity(_0x214cad,_0x2ce24c){return function(_0x2839d3){if(_0x2839d3){return _0x2839d3[_0x5f23('0x27')]()[_0x5f23('0x26')](function(){_0x214cad[_0x5f23('0x1b')](0xcc)[_0x5f23('0x1c')]();});}};}function handleEntityNotFound(_0x5220ca,_0x51bb92){return function(_0x167220){if(!_0x167220){_0x5220ca[_0x5f23('0x1a')](0x194);}return _0x167220;};}function handleError(_0x10e0c0,_0x575871){_0x575871=_0x575871||0x1f4;return function(_0x1246b3){logger['error'](_0x1246b3[_0x5f23('0x28')]);if(_0x1246b3[_0x5f23('0x29')]){delete _0x1246b3[_0x5f23('0x29')];}_0x10e0c0[_0x5f23('0x1b')](_0x575871)[_0x5f23('0x2a')](_0x1246b3);};}exports['index']=function(_0x3af6e1,_0x548eab){var _0x36eaa5={},_0x12761a={},_0x59d85f={'count':0x0,'rows':[]};var _0x1173aa=_[_0x5f23('0x2b')](db[_0x5f23('0x2c')][_0x5f23('0x2d')],function(_0x358b6f){return{'name':_0x358b6f['fieldName'],'type':_0x358b6f[_0x5f23('0x2e')][_0x5f23('0x2f')]};});_0x12761a[_0x5f23('0x30')]=_[_0x5f23('0x2b')](_0x1173aa,_0x5f23('0x29'));_0x12761a[_0x5f23('0x31')]=_['keys'](_0x3af6e1[_0x5f23('0x31')]);_0x12761a[_0x5f23('0x32')]=_[_0x5f23('0x33')](_0x12761a['model'],_0x12761a[_0x5f23('0x31')]);_0x36eaa5[_0x5f23('0x34')]=_[_0x5f23('0x33')](_0x12761a[_0x5f23('0x30')],qs[_0x5f23('0x35')](_0x3af6e1[_0x5f23('0x31')]['fields']));_0x36eaa5['attributes']=_0x36eaa5[_0x5f23('0x34')][_0x5f23('0x36')]?_0x36eaa5[_0x5f23('0x34')]:_0x12761a[_0x5f23('0x30')];if(!_0x3af6e1['query'][_0x5f23('0x37')]('nolimit')){_0x36eaa5[_0x5f23('0x21')]=qs[_0x5f23('0x21')](_0x3af6e1[_0x5f23('0x31')][_0x5f23('0x21')]);_0x36eaa5[_0x5f23('0x1e')]=qs[_0x5f23('0x1e')](_0x3af6e1['query'][_0x5f23('0x1e')]);}_0x36eaa5[_0x5f23('0x38')]=qs[_0x5f23('0x39')](_0x3af6e1['query']['sort']);_0x36eaa5[_0x5f23('0x3a')]=qs[_0x5f23('0x32')](_[_0x5f23('0x3b')](_0x3af6e1[_0x5f23('0x31')],_0x12761a['filters']),_0x1173aa);if(_0x3af6e1[_0x5f23('0x31')]['filter']){_0x36eaa5[_0x5f23('0x3a')]=_['merge'](_0x36eaa5[_0x5f23('0x3a')],{'$or':_[_0x5f23('0x2b')](_0x1173aa,function(_0x11348c){if(_0x11348c['type']!==_0x5f23('0x3c')){var _0x5a33ca={};_0x5a33ca[_0x11348c[_0x5f23('0x29')]]={'$like':'%'+_0x3af6e1[_0x5f23('0x31')][_0x5f23('0x3d')]+'%'};return _0x5a33ca;}})});}_0x36eaa5=_[_0x5f23('0x3e')]({},_0x36eaa5,_0x3af6e1[_0x5f23('0x3f')]);var _0x8cfe8b={'where':_0x36eaa5[_0x5f23('0x3a')]};return db[_0x5f23('0x2c')]['count'](_0x8cfe8b)[_0x5f23('0x26')](function(_0xec0b9){_0x59d85f[_0x5f23('0x20')]=_0xec0b9;if(_0x3af6e1['query'][_0x5f23('0x40')]){_0x36eaa5[_0x5f23('0x41')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x5f23('0x42')](_0x36eaa5);})['then'](function(_0x25c8d6){_0x59d85f[_0x5f23('0x43')]=_0x25c8d6;return _0x59d85f;})['then'](respondWithFilteredResult(_0x548eab,_0x36eaa5))[_0x5f23('0x44')](handleError(_0x548eab,null));};exports[_0x5f23('0x45')]=function(_0x3fa9c2,_0x4ca85a){var _0x22238a={'raw':![],'where':{'id':_0x3fa9c2[_0x5f23('0x46')]['id']}},_0x35445a={};_0x35445a['model']=_[_0x5f23('0x47')](db[_0x5f23('0x2c')]['rawAttributes']);_0x35445a[_0x5f23('0x31')]=_[_0x5f23('0x47')](_0x3fa9c2[_0x5f23('0x31')]);_0x35445a['filters']=_['intersection'](_0x35445a[_0x5f23('0x30')],_0x35445a[_0x5f23('0x31')]);_0x22238a['attributes']=_['intersection'](_0x35445a[_0x5f23('0x30')],qs['fields'](_0x3fa9c2[_0x5f23('0x31')][_0x5f23('0x35')]));_0x22238a[_0x5f23('0x34')]=_0x22238a[_0x5f23('0x34')][_0x5f23('0x36')]?_0x22238a[_0x5f23('0x34')]:_0x35445a[_0x5f23('0x30')];if(_0x3fa9c2[_0x5f23('0x31')][_0x5f23('0x40')]){_0x22238a[_0x5f23('0x41')]=[{'all':!![]}];}_0x22238a=_[_0x5f23('0x3e')]({},_0x22238a,_0x3fa9c2[_0x5f23('0x3f')]);return db[_0x5f23('0x2c')][_0x5f23('0x48')](_0x22238a)[_0x5f23('0x26')](handleEntityNotFound(_0x4ca85a,null))[_0x5f23('0x26')](respondWithResult(_0x4ca85a,null))[_0x5f23('0x44')](handleError(_0x4ca85a,null));};exports['create']=function(_0x116fe2,_0x1b3300){return db[_0x5f23('0x2c')][_0x5f23('0x49')](_0x116fe2[_0x5f23('0x4a')],{})[_0x5f23('0x26')](respondWithResult(_0x1b3300,0xc9))['catch'](handleError(_0x1b3300,null));};exports[_0x5f23('0x4b')]=function(_0x4ad5e0,_0xdf8029){if(_0x4ad5e0[_0x5f23('0x4a')]['id']){delete _0x4ad5e0[_0x5f23('0x4a')]['id'];}return db[_0x5f23('0x2c')][_0x5f23('0x48')]({'where':{'id':_0x4ad5e0[_0x5f23('0x46')]['id']}})[_0x5f23('0x26')](handleEntityNotFound(_0xdf8029,null))[_0x5f23('0x26')](saveUpdates(_0x4ad5e0[_0x5f23('0x4a')],null))[_0x5f23('0x26')](respondWithResult(_0xdf8029,null))[_0x5f23('0x44')](handleError(_0xdf8029,null));};exports['destroy']=function(_0x534585,_0x28e288){return db['SugarcrmConfiguration'][_0x5f23('0x48')]({'where':{'id':_0x534585['params']['id']}})[_0x5f23('0x26')](handleEntityNotFound(_0x28e288,null))[_0x5f23('0x26')](removeEntity(_0x28e288,null))[_0x5f23('0x44')](handleError(_0x28e288,null));};exports['getFields']=function(_0x501ccd,_0x223eb2,_0x2cb763){var _0x3547b8={};var _0x5bcf43={};var _0x12d59e;var _0x2b9dc6;return db[_0x5f23('0x2c')][_0x5f23('0x4c')]({'where':{'id':_0x501ccd['params']['id']}})[_0x5f23('0x26')](handleEntityNotFound(_0x223eb2,null))['then'](function(_0x47ebe8){if(_0x47ebe8){_0x12d59e=_0x47ebe8;_0x5bcf43[_0x5f23('0x30')]=_[_0x5f23('0x47')](db['SugarcrmField'][_0x5f23('0x2d')]);_0x5bcf43[_0x5f23('0x31')]=_[_0x5f23('0x47')](_0x501ccd['query']);_0x5bcf43['filters']=_['intersection'](_0x5bcf43[_0x5f23('0x30')],_0x5bcf43[_0x5f23('0x31')]);_0x3547b8['attributes']=_['intersection'](_0x5bcf43[_0x5f23('0x30')],qs[_0x5f23('0x35')](_0x501ccd[_0x5f23('0x31')][_0x5f23('0x35')]));_0x3547b8[_0x5f23('0x34')]=_0x3547b8['attributes'][_0x5f23('0x36')]?_0x3547b8[_0x5f23('0x34')]:_0x5bcf43[_0x5f23('0x30')];_0x3547b8['order']=qs[_0x5f23('0x39')](_0x501ccd['query'][_0x5f23('0x39')]);_0x3547b8['where']=qs[_0x5f23('0x32')](_[_0x5f23('0x3b')](_0x501ccd[_0x5f23('0x31')],_0x5bcf43['filters']));if(_0x501ccd[_0x5f23('0x31')]['filter']){_0x3547b8['where']=_['merge'](_0x3547b8[_0x5f23('0x3a')],{'$or':_[_0x5f23('0x2b')](_0x3547b8['attributes'],function(_0x38785d){var _0x117212={};_0x117212[_0x38785d]={'$like':'%'+_0x501ccd[_0x5f23('0x31')]['filter']+'%'};return _0x117212;})});}_0x3547b8=_[_0x5f23('0x3e')]({},_0x3547b8,_0x501ccd[_0x5f23('0x3f')]);return _0x12d59e['getFields'](_0x3547b8);}})[_0x5f23('0x26')](function(_0x16b582){if(_0x16b582){_0x2b9dc6=_0x16b582[_0x5f23('0x36')];if(!_0x501ccd[_0x5f23('0x31')]['hasOwnProperty'](_0x5f23('0x4d'))){_0x3547b8['limit']=qs[_0x5f23('0x21')](_0x501ccd[_0x5f23('0x31')][_0x5f23('0x21')]);_0x3547b8[_0x5f23('0x1e')]=qs[_0x5f23('0x1e')](_0x501ccd[_0x5f23('0x31')]['offset']);}return _0x12d59e[_0x5f23('0x4e')](_0x3547b8);}})['then'](function(_0x5ca681){if(_0x5ca681){return _0x5ca681?{'count':_0x2b9dc6,'rows':_0x5ca681}:null;}})[_0x5f23('0x26')](respondWithResult(_0x223eb2,null))[_0x5f23('0x44')](handleError(_0x223eb2,null));};exports[_0x5f23('0x4f')]=function(_0x48ce3b,_0x4433f3,_0x7eddc1){var _0x5d28eb={};var _0x27e6cf={};var _0x3706d4;var _0x4c20de;return db['SugarcrmConfiguration'][_0x5f23('0x4c')]({'where':{'id':_0x48ce3b[_0x5f23('0x46')]['id']}})['then'](handleEntityNotFound(_0x4433f3,null))[_0x5f23('0x26')](function(_0x33e557){if(_0x33e557){_0x3706d4=_0x33e557;_0x27e6cf['model']=_[_0x5f23('0x47')](db[_0x5f23('0x50')][_0x5f23('0x2d')]);_0x27e6cf[_0x5f23('0x31')]=_['keys'](_0x48ce3b[_0x5f23('0x31')]);_0x27e6cf[_0x5f23('0x32')]=_[_0x5f23('0x33')](_0x27e6cf['model'],_0x27e6cf[_0x5f23('0x31')]);_0x5d28eb[_0x5f23('0x34')]=_[_0x5f23('0x33')](_0x27e6cf[_0x5f23('0x30')],qs[_0x5f23('0x35')](_0x48ce3b[_0x5f23('0x31')][_0x5f23('0x35')]));_0x5d28eb[_0x5f23('0x34')]=_0x5d28eb[_0x5f23('0x34')]['length']?_0x5d28eb[_0x5f23('0x34')]:_0x27e6cf[_0x5f23('0x30')];_0x5d28eb[_0x5f23('0x38')]=qs[_0x5f23('0x39')](_0x48ce3b['query'][_0x5f23('0x39')]);_0x5d28eb['where']=qs['filters'](_[_0x5f23('0x3b')](_0x48ce3b['query'],_0x27e6cf[_0x5f23('0x32')]));if(_0x48ce3b[_0x5f23('0x31')][_0x5f23('0x3d')]){_0x5d28eb[_0x5f23('0x3a')]=_['merge'](_0x5d28eb[_0x5f23('0x3a')],{'$or':_['map'](_0x5d28eb[_0x5f23('0x34')],function(_0x40d061){var _0x558b8c={};_0x558b8c[_0x40d061]={'$like':'%'+_0x48ce3b['query'][_0x5f23('0x3d')]+'%'};return _0x558b8c;})});}_0x5d28eb=_[_0x5f23('0x3e')]({},_0x5d28eb,_0x48ce3b[_0x5f23('0x3f')]);return _0x3706d4[_0x5f23('0x4f')](_0x5d28eb);}})['then'](function(_0x201762){if(_0x201762){_0x4c20de=_0x201762[_0x5f23('0x36')];if(!_0x48ce3b[_0x5f23('0x31')]['hasOwnProperty']('nolimit')){_0x5d28eb[_0x5f23('0x21')]=qs['limit'](_0x48ce3b[_0x5f23('0x31')][_0x5f23('0x21')]);_0x5d28eb[_0x5f23('0x1e')]=qs[_0x5f23('0x1e')](_0x48ce3b[_0x5f23('0x31')][_0x5f23('0x1e')]);}return _0x3706d4[_0x5f23('0x4f')](_0x5d28eb);}})[_0x5f23('0x26')](function(_0x1b8dfd){if(_0x1b8dfd){return _0x1b8dfd?{'count':_0x4c20de,'rows':_0x1b8dfd}:null;}})[_0x5f23('0x26')](respondWithResult(_0x4433f3,null))[_0x5f23('0x44')](handleError(_0x4433f3,null));};exports[_0x5f23('0x51')]=function(_0x25242a,_0x10412f,_0x1383f1){var _0x3be59b={};var _0x339805={};var _0x2de8e7;var _0x3ae5bb;return db[_0x5f23('0x2c')][_0x5f23('0x4c')]({'where':{'id':_0x25242a['params']['id']}})['then'](handleEntityNotFound(_0x10412f,null))[_0x5f23('0x26')](function(_0x14f183){if(_0x14f183){_0x2de8e7=_0x14f183;_0x339805[_0x5f23('0x30')]=_[_0x5f23('0x47')](db[_0x5f23('0x50')][_0x5f23('0x2d')]);_0x339805['query']=_['keys'](_0x25242a[_0x5f23('0x31')]);_0x339805[_0x5f23('0x32')]=_[_0x5f23('0x33')](_0x339805['model'],_0x339805['query']);_0x3be59b[_0x5f23('0x34')]=_[_0x5f23('0x33')](_0x339805['model'],qs[_0x5f23('0x35')](_0x25242a[_0x5f23('0x31')][_0x5f23('0x35')]));_0x3be59b[_0x5f23('0x34')]=_0x3be59b[_0x5f23('0x34')][_0x5f23('0x36')]?_0x3be59b['attributes']:_0x339805[_0x5f23('0x30')];_0x3be59b[_0x5f23('0x38')]=qs[_0x5f23('0x39')](_0x25242a[_0x5f23('0x31')][_0x5f23('0x39')]);_0x3be59b[_0x5f23('0x3a')]=qs[_0x5f23('0x32')](_[_0x5f23('0x3b')](_0x25242a[_0x5f23('0x31')],_0x339805[_0x5f23('0x32')]));if(_0x25242a[_0x5f23('0x31')]['filter']){_0x3be59b[_0x5f23('0x3a')]=_['merge'](_0x3be59b['where'],{'$or':_[_0x5f23('0x2b')](_0x3be59b['attributes'],function(_0x3948a3){var _0x2c54b1={};_0x2c54b1[_0x3948a3]={'$like':'%'+_0x25242a[_0x5f23('0x31')][_0x5f23('0x3d')]+'%'};return _0x2c54b1;})});}_0x3be59b=_[_0x5f23('0x3e')]({},_0x3be59b,_0x25242a[_0x5f23('0x3f')]);return _0x2de8e7['getDescriptions'](_0x3be59b);}})[_0x5f23('0x26')](function(_0x4090ae){if(_0x4090ae){_0x3ae5bb=_0x4090ae[_0x5f23('0x36')];if(!_0x25242a[_0x5f23('0x31')][_0x5f23('0x37')](_0x5f23('0x4d'))){_0x3be59b['limit']=qs[_0x5f23('0x21')](_0x25242a['query'][_0x5f23('0x21')]);_0x3be59b[_0x5f23('0x1e')]=qs[_0x5f23('0x1e')](_0x25242a[_0x5f23('0x31')][_0x5f23('0x1e')]);}return _0x2de8e7[_0x5f23('0x51')](_0x3be59b);}})['then'](function(_0x540871){if(_0x540871){return _0x540871?{'count':_0x3ae5bb,'rows':_0x540871}:null;}})['then'](respondWithResult(_0x10412f,null))[_0x5f23('0x44')](handleError(_0x10412f,null));};
\ No newline at end of file
+var _0x7bfe=['catch','params','getFields','findOne','SugarcrmField','hasOwnProperty','nolimit','getSubjects','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','show','fields','length','find','create','body'];(function(_0x522fef,_0x2002b3){var _0x58ddd7=function(_0x4e4a96){while(--_0x4e4a96){_0x522fef['push'](_0x522fef['shift']());}};_0x58ddd7(++_0x2002b3);}(_0x7bfe,0xa6));var _0xe7bf=function(_0x4a96f7,_0x1a8e29){_0x4a96f7=_0x4a96f7-0x0;var _0x75051f=_0x7bfe[_0x4a96f7];return _0x75051f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7bf('0x0'));var jsonpatch=require(_0xe7bf('0x1'));var rp=require(_0xe7bf('0x2'));var moment=require(_0xe7bf('0x3'));var BPromise=require(_0xe7bf('0x4'));var Mustache=require(_0xe7bf('0x5'));var util=require('util');var path=require(_0xe7bf('0x6'));var sox=require(_0xe7bf('0x7'));var csv=require('to-csv');var ejs=require(_0xe7bf('0x8'));var fs=require('fs');var fs_extra=require(_0xe7bf('0x9'));var _=require(_0xe7bf('0xa'));var squel=require(_0xe7bf('0xb'));var crypto=require(_0xe7bf('0xc'));var jsforce=require(_0xe7bf('0xd'));var deskjs=require(_0xe7bf('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe7bf('0xf'));var Redis=require(_0xe7bf('0x10'));var authService=require(_0xe7bf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe7bf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7bf('0x13'))(_0xe7bf('0x14'));var utils=require(_0xe7bf('0x15'));var config=require(_0xe7bf('0x16'));var licenseUtil=require(_0xe7bf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b514e,_0x20a54d){_0x20a54d=_0x20a54d||0xcc;return function(_0x43fd13){if(_0x43fd13){return _0x2b514e[_0xe7bf('0x18')](_0x20a54d);}return _0x2b514e['status'](_0x20a54d)['end']();};}function respondWithResult(_0x121b44,_0x3e52ce){_0x3e52ce=_0x3e52ce||0xc8;return function(_0x41d83a){if(_0x41d83a){return _0x121b44[_0xe7bf('0x19')](_0x3e52ce)[_0xe7bf('0x1a')](_0x41d83a);}};}function respondWithFilteredResult(_0x48645f,_0x465335){return function(_0x34a27a){if(_0x34a27a){var _0x308116=typeof _0x465335[_0xe7bf('0x1b')]==='undefined'&&typeof _0x465335['limit']==='undefined';var _0x2b964e=_0x34a27a[_0xe7bf('0x1c')];var _0x4ba338=_0x308116?0x0:_0x465335['offset'];var _0x3ce91b=_0x308116?_0x34a27a[_0xe7bf('0x1c')]:_0x465335[_0xe7bf('0x1b')]+_0x465335['limit'];var _0x1965c2;if(_0x3ce91b>=_0x2b964e){_0x3ce91b=_0x2b964e;_0x1965c2=0xc8;}else{_0x1965c2=0xce;}_0x48645f['status'](_0x1965c2);return _0x48645f[_0xe7bf('0x1d')](_0xe7bf('0x1e'),_0x4ba338+'-'+_0x3ce91b+'/'+_0x2b964e)[_0xe7bf('0x1a')](_0x34a27a);}return null;};}function patchUpdates(_0x3fef2a){return function(_0x125895){try{jsonpatch['apply'](_0x125895,_0x3fef2a,!![]);}catch(_0x4da336){return BPromise[_0xe7bf('0x1f')](_0x4da336);}return _0x125895[_0xe7bf('0x20')]();};}function saveUpdates(_0xe471a5,_0x2cfa5a){return function(_0x9a079b){if(_0x9a079b){return _0x9a079b[_0xe7bf('0x21')](_0xe471a5)[_0xe7bf('0x22')](function(_0x53283e){return _0x53283e;});}return null;};}function removeEntity(_0x16d71a,_0x3d94b3){return function(_0x4961cd){if(_0x4961cd){return _0x4961cd[_0xe7bf('0x23')]()[_0xe7bf('0x22')](function(){_0x16d71a['status'](0xcc)[_0xe7bf('0x24')]();});}};}function handleEntityNotFound(_0x5e0719,_0xff35e1){return function(_0x58ac5e){if(!_0x58ac5e){_0x5e0719[_0xe7bf('0x18')](0x194);}return _0x58ac5e;};}function handleError(_0x355f7f,_0x516f9f){_0x516f9f=_0x516f9f||0x1f4;return function(_0x2d604b){logger[_0xe7bf('0x25')](_0x2d604b[_0xe7bf('0x26')]);if(_0x2d604b[_0xe7bf('0x27')]){delete _0x2d604b[_0xe7bf('0x27')];}_0x355f7f[_0xe7bf('0x19')](_0x516f9f)[_0xe7bf('0x28')](_0x2d604b);};}exports[_0xe7bf('0x29')]=function(_0x458235,_0x4a7263){var _0x3d0122={},_0x39ef74={},_0x1dd0e9={'count':0x0,'rows':[]};var _0x38308e=_['map'](db[_0xe7bf('0x2a')][_0xe7bf('0x2b')],function(_0x54371c){return{'name':_0x54371c[_0xe7bf('0x2c')],'type':_0x54371c[_0xe7bf('0x2d')][_0xe7bf('0x2e')]};});_0x39ef74[_0xe7bf('0x2f')]=_[_0xe7bf('0x30')](_0x38308e,_0xe7bf('0x27'));_0x39ef74[_0xe7bf('0x31')]=_[_0xe7bf('0x32')](_0x458235[_0xe7bf('0x31')]);_0x39ef74[_0xe7bf('0x33')]=_[_0xe7bf('0x34')](_0x39ef74['model'],_0x39ef74['query']);_0x3d0122[_0xe7bf('0x35')]=_[_0xe7bf('0x34')](_0x39ef74['model'],qs['fields'](_0x458235['query']['fields']));_0x3d0122[_0xe7bf('0x35')]=_0x3d0122[_0xe7bf('0x35')]['length']?_0x3d0122[_0xe7bf('0x35')]:_0x39ef74[_0xe7bf('0x2f')];if(!_0x458235[_0xe7bf('0x31')]['hasOwnProperty']('nolimit')){_0x3d0122[_0xe7bf('0x36')]=qs['limit'](_0x458235['query']['limit']);_0x3d0122[_0xe7bf('0x1b')]=qs['offset'](_0x458235[_0xe7bf('0x31')][_0xe7bf('0x1b')]);}_0x3d0122[_0xe7bf('0x37')]=qs[_0xe7bf('0x38')](_0x458235[_0xe7bf('0x31')]['sort']);_0x3d0122[_0xe7bf('0x39')]=qs[_0xe7bf('0x33')](_[_0xe7bf('0x3a')](_0x458235['query'],_0x39ef74[_0xe7bf('0x33')]),_0x38308e);if(_0x458235[_0xe7bf('0x31')]['filter']){_0x3d0122[_0xe7bf('0x39')]=_['merge'](_0x3d0122[_0xe7bf('0x39')],{'$or':_[_0xe7bf('0x30')](_0x38308e,function(_0x36b540){if(_0x36b540[_0xe7bf('0x2d')]!==_0xe7bf('0x3b')){var _0x5534a4={};_0x5534a4[_0x36b540[_0xe7bf('0x27')]]={'$like':'%'+_0x458235['query'][_0xe7bf('0x3c')]+'%'};return _0x5534a4;}})});}_0x3d0122=_[_0xe7bf('0x3d')]({},_0x3d0122,_0x458235[_0xe7bf('0x3e')]);var _0x3607d2={'where':_0x3d0122[_0xe7bf('0x39')]};return db[_0xe7bf('0x2a')][_0xe7bf('0x1c')](_0x3607d2)['then'](function(_0x44812b){_0x1dd0e9[_0xe7bf('0x1c')]=_0x44812b;if(_0x458235['query'][_0xe7bf('0x3f')]){_0x3d0122[_0xe7bf('0x40')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x3d0122);})['then'](function(_0x5bef9f){_0x1dd0e9['rows']=_0x5bef9f;return _0x1dd0e9;})[_0xe7bf('0x22')](respondWithFilteredResult(_0x4a7263,_0x3d0122))['catch'](handleError(_0x4a7263,null));};exports[_0xe7bf('0x41')]=function(_0x123c7e,_0x313859){var _0x2d53c5={'raw':![],'where':{'id':_0x123c7e['params']['id']}},_0x579a78={};_0x579a78[_0xe7bf('0x2f')]=_[_0xe7bf('0x32')](db['SugarcrmConfiguration'][_0xe7bf('0x2b')]);_0x579a78[_0xe7bf('0x31')]=_[_0xe7bf('0x32')](_0x123c7e[_0xe7bf('0x31')]);_0x579a78[_0xe7bf('0x33')]=_['intersection'](_0x579a78[_0xe7bf('0x2f')],_0x579a78['query']);_0x2d53c5['attributes']=_[_0xe7bf('0x34')](_0x579a78[_0xe7bf('0x2f')],qs[_0xe7bf('0x42')](_0x123c7e['query'][_0xe7bf('0x42')]));_0x2d53c5[_0xe7bf('0x35')]=_0x2d53c5[_0xe7bf('0x35')][_0xe7bf('0x43')]?_0x2d53c5[_0xe7bf('0x35')]:_0x579a78['model'];if(_0x123c7e[_0xe7bf('0x31')][_0xe7bf('0x3f')]){_0x2d53c5[_0xe7bf('0x40')]=[{'all':!![]}];}_0x2d53c5=_[_0xe7bf('0x3d')]({},_0x2d53c5,_0x123c7e[_0xe7bf('0x3e')]);return db[_0xe7bf('0x2a')][_0xe7bf('0x44')](_0x2d53c5)[_0xe7bf('0x22')](handleEntityNotFound(_0x313859,null))['then'](respondWithResult(_0x313859,null))['catch'](handleError(_0x313859,null));};exports[_0xe7bf('0x45')]=function(_0x227b03,_0x3060fa){return db[_0xe7bf('0x2a')]['create'](_0x227b03[_0xe7bf('0x46')],{})[_0xe7bf('0x22')](respondWithResult(_0x3060fa,0xc9))[_0xe7bf('0x47')](handleError(_0x3060fa,null));};exports[_0xe7bf('0x21')]=function(_0x184ab3,_0x524505){if(_0x184ab3[_0xe7bf('0x46')]['id']){delete _0x184ab3[_0xe7bf('0x46')]['id'];}return db['SugarcrmConfiguration'][_0xe7bf('0x44')]({'where':{'id':_0x184ab3[_0xe7bf('0x48')]['id']}})[_0xe7bf('0x22')](handleEntityNotFound(_0x524505,null))[_0xe7bf('0x22')](saveUpdates(_0x184ab3[_0xe7bf('0x46')],null))[_0xe7bf('0x22')](respondWithResult(_0x524505,null))[_0xe7bf('0x47')](handleError(_0x524505,null));};exports[_0xe7bf('0x23')]=function(_0x2459c9,_0xbc9233){return db['SugarcrmConfiguration'][_0xe7bf('0x44')]({'where':{'id':_0x2459c9[_0xe7bf('0x48')]['id']}})[_0xe7bf('0x22')](handleEntityNotFound(_0xbc9233,null))[_0xe7bf('0x22')](removeEntity(_0xbc9233,null))[_0xe7bf('0x47')](handleError(_0xbc9233,null));};exports[_0xe7bf('0x49')]=function(_0x4a6359,_0x219b40,_0x5bf94b){var _0x4289ba={};var _0x61aa98={};var _0x44b28e;var _0x146439;return db[_0xe7bf('0x2a')][_0xe7bf('0x4a')]({'where':{'id':_0x4a6359['params']['id']}})[_0xe7bf('0x22')](handleEntityNotFound(_0x219b40,null))[_0xe7bf('0x22')](function(_0x287141){if(_0x287141){_0x44b28e=_0x287141;_0x61aa98[_0xe7bf('0x2f')]=_[_0xe7bf('0x32')](db[_0xe7bf('0x4b')][_0xe7bf('0x2b')]);_0x61aa98[_0xe7bf('0x31')]=_[_0xe7bf('0x32')](_0x4a6359[_0xe7bf('0x31')]);_0x61aa98['filters']=_[_0xe7bf('0x34')](_0x61aa98[_0xe7bf('0x2f')],_0x61aa98[_0xe7bf('0x31')]);_0x4289ba[_0xe7bf('0x35')]=_[_0xe7bf('0x34')](_0x61aa98['model'],qs['fields'](_0x4a6359[_0xe7bf('0x31')][_0xe7bf('0x42')]));_0x4289ba[_0xe7bf('0x35')]=_0x4289ba[_0xe7bf('0x35')][_0xe7bf('0x43')]?_0x4289ba['attributes']:_0x61aa98[_0xe7bf('0x2f')];_0x4289ba[_0xe7bf('0x37')]=qs['sort'](_0x4a6359[_0xe7bf('0x31')]['sort']);_0x4289ba['where']=qs[_0xe7bf('0x33')](_[_0xe7bf('0x3a')](_0x4a6359['query'],_0x61aa98['filters']));if(_0x4a6359[_0xe7bf('0x31')][_0xe7bf('0x3c')]){_0x4289ba[_0xe7bf('0x39')]=_[_0xe7bf('0x3d')](_0x4289ba[_0xe7bf('0x39')],{'$or':_[_0xe7bf('0x30')](_0x4289ba[_0xe7bf('0x35')],function(_0x4d0916){var _0x18cea2={};_0x18cea2[_0x4d0916]={'$like':'%'+_0x4a6359[_0xe7bf('0x31')][_0xe7bf('0x3c')]+'%'};return _0x18cea2;})});}_0x4289ba=_['merge']({},_0x4289ba,_0x4a6359[_0xe7bf('0x3e')]);return _0x44b28e[_0xe7bf('0x49')](_0x4289ba);}})[_0xe7bf('0x22')](function(_0x1add3c){if(_0x1add3c){_0x146439=_0x1add3c[_0xe7bf('0x43')];if(!_0x4a6359[_0xe7bf('0x31')][_0xe7bf('0x4c')](_0xe7bf('0x4d'))){_0x4289ba[_0xe7bf('0x36')]=qs[_0xe7bf('0x36')](_0x4a6359[_0xe7bf('0x31')][_0xe7bf('0x36')]);_0x4289ba['offset']=qs[_0xe7bf('0x1b')](_0x4a6359['query'][_0xe7bf('0x1b')]);}return _0x44b28e[_0xe7bf('0x49')](_0x4289ba);}})[_0xe7bf('0x22')](function(_0x1d85ea){if(_0x1d85ea){return _0x1d85ea?{'count':_0x146439,'rows':_0x1d85ea}:null;}})[_0xe7bf('0x22')](respondWithResult(_0x219b40,null))[_0xe7bf('0x47')](handleError(_0x219b40,null));};exports[_0xe7bf('0x4e')]=function(_0x512f7e,_0x2cb5fa,_0x89e438){var _0x128521={};var _0x2b7bb9={};var _0x432583;var _0x36d3b8;return db[_0xe7bf('0x2a')][_0xe7bf('0x4a')]({'where':{'id':_0x512f7e[_0xe7bf('0x48')]['id']}})[_0xe7bf('0x22')](handleEntityNotFound(_0x2cb5fa,null))[_0xe7bf('0x22')](function(_0x1b1d3d){if(_0x1b1d3d){_0x432583=_0x1b1d3d;_0x2b7bb9['model']=_[_0xe7bf('0x32')](db[_0xe7bf('0x4b')][_0xe7bf('0x2b')]);_0x2b7bb9[_0xe7bf('0x31')]=_[_0xe7bf('0x32')](_0x512f7e[_0xe7bf('0x31')]);_0x2b7bb9[_0xe7bf('0x33')]=_[_0xe7bf('0x34')](_0x2b7bb9[_0xe7bf('0x2f')],_0x2b7bb9['query']);_0x128521['attributes']=_[_0xe7bf('0x34')](_0x2b7bb9['model'],qs[_0xe7bf('0x42')](_0x512f7e[_0xe7bf('0x31')]['fields']));_0x128521['attributes']=_0x128521[_0xe7bf('0x35')][_0xe7bf('0x43')]?_0x128521[_0xe7bf('0x35')]:_0x2b7bb9[_0xe7bf('0x2f')];_0x128521[_0xe7bf('0x37')]=qs['sort'](_0x512f7e['query'][_0xe7bf('0x38')]);_0x128521['where']=qs[_0xe7bf('0x33')](_[_0xe7bf('0x3a')](_0x512f7e[_0xe7bf('0x31')],_0x2b7bb9[_0xe7bf('0x33')]));if(_0x512f7e[_0xe7bf('0x31')][_0xe7bf('0x3c')]){_0x128521[_0xe7bf('0x39')]=_[_0xe7bf('0x3d')](_0x128521[_0xe7bf('0x39')],{'$or':_[_0xe7bf('0x30')](_0x128521[_0xe7bf('0x35')],function(_0x315f37){var _0x9c1015={};_0x9c1015[_0x315f37]={'$like':'%'+_0x512f7e[_0xe7bf('0x31')][_0xe7bf('0x3c')]+'%'};return _0x9c1015;})});}_0x128521=_['merge']({},_0x128521,_0x512f7e[_0xe7bf('0x3e')]);return _0x432583[_0xe7bf('0x4e')](_0x128521);}})[_0xe7bf('0x22')](function(_0xe9edf0){if(_0xe9edf0){_0x36d3b8=_0xe9edf0['length'];if(!_0x512f7e[_0xe7bf('0x31')][_0xe7bf('0x4c')](_0xe7bf('0x4d'))){_0x128521[_0xe7bf('0x36')]=qs[_0xe7bf('0x36')](_0x512f7e[_0xe7bf('0x31')][_0xe7bf('0x36')]);_0x128521[_0xe7bf('0x1b')]=qs[_0xe7bf('0x1b')](_0x512f7e['query']['offset']);}return _0x432583[_0xe7bf('0x4e')](_0x128521);}})[_0xe7bf('0x22')](function(_0x8f471d){if(_0x8f471d){return _0x8f471d?{'count':_0x36d3b8,'rows':_0x8f471d}:null;}})[_0xe7bf('0x22')](respondWithResult(_0x2cb5fa,null))[_0xe7bf('0x47')](handleError(_0x2cb5fa,null));};exports['getDescriptions']=function(_0x5433d9,_0x4b8aa6,_0x220035){var _0x535dd9={};var _0x2c6786={};var _0x114580;var _0x1a00b5;return db[_0xe7bf('0x2a')][_0xe7bf('0x4a')]({'where':{'id':_0x5433d9[_0xe7bf('0x48')]['id']}})[_0xe7bf('0x22')](handleEntityNotFound(_0x4b8aa6,null))[_0xe7bf('0x22')](function(_0x2a9a13){if(_0x2a9a13){_0x114580=_0x2a9a13;_0x2c6786[_0xe7bf('0x2f')]=_['keys'](db['SugarcrmField'][_0xe7bf('0x2b')]);_0x2c6786[_0xe7bf('0x31')]=_[_0xe7bf('0x32')](_0x5433d9[_0xe7bf('0x31')]);_0x2c6786[_0xe7bf('0x33')]=_[_0xe7bf('0x34')](_0x2c6786[_0xe7bf('0x2f')],_0x2c6786['query']);_0x535dd9[_0xe7bf('0x35')]=_[_0xe7bf('0x34')](_0x2c6786['model'],qs[_0xe7bf('0x42')](_0x5433d9[_0xe7bf('0x31')][_0xe7bf('0x42')]));_0x535dd9['attributes']=_0x535dd9['attributes'][_0xe7bf('0x43')]?_0x535dd9[_0xe7bf('0x35')]:_0x2c6786[_0xe7bf('0x2f')];_0x535dd9[_0xe7bf('0x37')]=qs[_0xe7bf('0x38')](_0x5433d9['query'][_0xe7bf('0x38')]);_0x535dd9[_0xe7bf('0x39')]=qs['filters'](_[_0xe7bf('0x3a')](_0x5433d9[_0xe7bf('0x31')],_0x2c6786[_0xe7bf('0x33')]));if(_0x5433d9['query'][_0xe7bf('0x3c')]){_0x535dd9[_0xe7bf('0x39')]=_['merge'](_0x535dd9[_0xe7bf('0x39')],{'$or':_[_0xe7bf('0x30')](_0x535dd9[_0xe7bf('0x35')],function(_0xce2af1){var _0x5d5c19={};_0x5d5c19[_0xce2af1]={'$like':'%'+_0x5433d9[_0xe7bf('0x31')][_0xe7bf('0x3c')]+'%'};return _0x5d5c19;})});}_0x535dd9=_[_0xe7bf('0x3d')]({},_0x535dd9,_0x5433d9[_0xe7bf('0x3e')]);return _0x114580['getDescriptions'](_0x535dd9);}})[_0xe7bf('0x22')](function(_0x1563f0){if(_0x1563f0){_0x1a00b5=_0x1563f0['length'];if(!_0x5433d9[_0xe7bf('0x31')]['hasOwnProperty'](_0xe7bf('0x4d'))){_0x535dd9[_0xe7bf('0x36')]=qs[_0xe7bf('0x36')](_0x5433d9[_0xe7bf('0x31')]['limit']);_0x535dd9[_0xe7bf('0x1b')]=qs[_0xe7bf('0x1b')](_0x5433d9[_0xe7bf('0x31')][_0xe7bf('0x1b')]);}return _0x114580['getDescriptions'](_0x535dd9);}})['then'](function(_0x45986a){if(_0x45986a){return _0x45986a?{'count':_0x1a00b5,'rows':_0x45986a}:null;}})['then'](respondWithResult(_0x4b8aa6,null))[_0xe7bf('0x47')](handleError(_0x4b8aa6,null));};
\ No newline at end of file
index 27124e7..bf75b90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x471d=['int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports'];(function(_0x2abdca,_0x4defea){var _0x196787=function(_0x32860b){while(--_0x32860b){_0x2abdca['push'](_0x2abdca['shift']());}};_0x196787(++_0x4defea);}(_0x471d,0xd2));var _0xd471=function(_0x5bdb14,_0x4f87c1){_0x5bdb14=_0x5bdb14-0x0;var _0x5b3d71=_0x471d[_0x5bdb14];return _0x5b3d71;};'use strict';var _=require('lodash');var util=require(_0xd471('0x0'));var logger=require(_0xd471('0x1'))(_0xd471('0x2'));var moment=require(_0xd471('0x3'));var BPromise=require(_0xd471('0x4'));var rp=require(_0xd471('0x5'));var fs=require('fs');var path=require(_0xd471('0x6'));var rimraf=require(_0xd471('0x7'));var config=require('../../config/environment');var attributes=require(_0xd471('0x8'));module[_0xd471('0x9')]=function(_0x5cf97a,_0xc77d37){return _0x5cf97a['define']('SugarcrmConfiguration',attributes,{'tableName':_0xd471('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1171=['request-promise','rimraf','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','moment','bluebird'];(function(_0x1c4802,_0x13c9ec){var _0x59b090=function(_0x299729){while(--_0x299729){_0x1c4802['push'](_0x1c4802['shift']());}};_0x59b090(++_0x13c9ec);}(_0x1171,0x1c8));var _0x1117=function(_0x1d3fdc,_0x2b5c54){_0x1d3fdc=_0x1d3fdc-0x0;var _0x128bb0=_0x1171[_0x1d3fdc];return _0x128bb0;};'use strict';var _=require('lodash');var util=require(_0x1117('0x0'));var logger=require(_0x1117('0x1'))('api');var moment=require(_0x1117('0x2'));var BPromise=require(_0x1117('0x3'));var rp=require(_0x1117('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1117('0x5'));var config=require('../../config/environment');var attributes=require(_0x1117('0x6'));module[_0x1117('0x7')]=function(_0x5252e6,_0x3e921a){return _0x5252e6['define'](_0x1117('0x8'),attributes,{'tableName':_0x1117('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6f75958..310e0dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaedd=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then'];(function(_0x1a66e4,_0x545635){var _0x1d57a8=function(_0x436a05){while(--_0x436a05){_0x1a66e4['push'](_0x1a66e4['shift']());}};_0x1d57a8(++_0x545635);}(_0xaedd,0x16b));var _0xdaed=function(_0x2945d2,_0x56f800){_0x2945d2=_0x2945d2-0x0;var _0x29ad2b=_0xaedd[_0x2945d2];return _0x29ad2b;};'use strict';var _=require(_0xdaed('0x0'));var util=require(_0xdaed('0x1'));var moment=require(_0xdaed('0x2'));var BPromise=require(_0xdaed('0x3'));var rs=require(_0xdaed('0x4'));var fs=require('fs');var Redis=require(_0xdaed('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdaed('0x6'));var logger=require('../../config/logger')(_0xdaed('0x7'));var config=require(_0xdaed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdaed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2546f9,_0x2bf425,_0x204b2f){return new BPromise(function(_0x4e4805,_0x496ab8){return client['request'](_0x2546f9,_0x204b2f)[_0xdaed('0xa')](function(_0x43625d){logger['info'](_0xdaed('0xb'),_0x2bf425,_0xdaed('0xc'));logger[_0xdaed('0xd')](_0xdaed('0xe'),_0x2bf425,_0xdaed('0xc'),JSON[_0xdaed('0xf')](_0x43625d));if(_0x43625d[_0xdaed('0x10')]){if(_0x43625d['error'][_0xdaed('0x11')]===0x1f4){logger[_0xdaed('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2bf425,_0x43625d['error']['message']);return _0x496ab8(_0x43625d['error'][_0xdaed('0x12')]);}logger[_0xdaed('0x10')](_0xdaed('0xb'),_0x2bf425,_0x43625d[_0xdaed('0x10')][_0xdaed('0x12')]);return _0x4e4805(_0x43625d[_0xdaed('0x10')]['message']);}else{logger[_0xdaed('0x13')](_0xdaed('0xb'),_0x2bf425,_0xdaed('0xc'));_0x4e4805(_0x43625d[_0xdaed('0x14')][_0xdaed('0x12')]);}})[_0xdaed('0x15')](function(_0x2604ad){logger[_0xdaed('0x10')](_0xdaed('0xb'),_0x2bf425,_0x2604ad);_0x496ab8(_0x2604ad);});});}
\ No newline at end of file
+var _0x284f=['SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x432b15,_0x1f3ced){var _0x35736d=function(_0x583dc0){while(--_0x583dc0){_0x432b15['push'](_0x432b15['shift']());}};_0x35736d(++_0x1f3ced);}(_0x284f,0xab));var _0xf284=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x284f[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0xf284('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf284('0x1'));var rs=require(_0xf284('0x2'));var fs=require('fs');var Redis=require(_0xf284('0x3'));var db=require(_0xf284('0x4'))['db'];var utils=require(_0xf284('0x5'));var logger=require(_0xf284('0x6'))('rpc');var config=require(_0xf284('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf284('0x8')][_0xf284('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d8cb3,_0x4dec8c,_0x17c3dc){return new BPromise(function(_0x37bfdd,_0x1a37b2){return client[_0xf284('0xa')](_0x4d8cb3,_0x17c3dc)[_0xf284('0xb')](function(_0x123bcc){logger[_0xf284('0xc')](_0xf284('0xd'),_0x4dec8c,'request\x20sent');logger[_0xf284('0xe')](_0xf284('0xf'),_0x4dec8c,_0xf284('0x10'),JSON[_0xf284('0x11')](_0x123bcc));if(_0x123bcc[_0xf284('0x12')]){if(_0x123bcc[_0xf284('0x12')][_0xf284('0x13')]===0x1f4){logger[_0xf284('0x12')](_0xf284('0xd'),_0x4dec8c,_0x123bcc[_0xf284('0x12')][_0xf284('0x14')]);return _0x1a37b2(_0x123bcc[_0xf284('0x12')]['message']);}logger[_0xf284('0x12')](_0xf284('0xd'),_0x4dec8c,_0x123bcc[_0xf284('0x12')]['message']);return _0x37bfdd(_0x123bcc[_0xf284('0x12')][_0xf284('0x14')]);}else{logger[_0xf284('0xc')](_0xf284('0xd'),_0x4dec8c,_0xf284('0x10'));_0x37bfdd(_0x123bcc[_0xf284('0x15')]['message']);}})[_0xf284('0x16')](function(_0x482519){logger[_0xf284('0x12')](_0xf284('0xd'),_0x4dec8c,_0x482519);_0x1a37b2(_0x482519);});});}
\ No newline at end of file
index 3186bea..8a3d0df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd500=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','isAuthenticated','/:id','show','post','put','update','delete','exports','multer','util'];(function(_0x33ce3f,_0xac05d0){var _0x24c728=function(_0x2338c1){while(--_0x2338c1){_0x33ce3f['push'](_0x33ce3f['shift']());}};_0x24c728(++_0xac05d0);}(_0xd500,0x86));var _0x0d50=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xd500[_0x26b8b5];return _0x2150a9;};'use strict';var multer=require(_0x0d50('0x0'));var util=require(_0x0d50('0x1'));var path=require(_0x0d50('0x2'));var timeout=require(_0x0d50('0x3'));var express=require(_0x0d50('0x4'));var router=express[_0x0d50('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0d50('0x6'));var interaction=require(_0x0d50('0x7'));var config=require('../../config/environment');var controller=require(_0x0d50('0x8'));router['get']('/',auth[_0x0d50('0x9')](),controller['index']);router['get'](_0x0d50('0xa'),auth[_0x0d50('0x9')](),controller[_0x0d50('0xb')]);router[_0x0d50('0xc')]('/',auth[_0x0d50('0x9')](),controller['create']);router[_0x0d50('0xd')](_0x0d50('0xa'),auth[_0x0d50('0x9')](),controller[_0x0d50('0xe')]);router[_0x0d50('0xf')](_0x0d50('0xa'),auth[_0x0d50('0x9')](),controller['destroy']);module[_0x0d50('0x10')]=router;
\ No newline at end of file
+var _0x69c8=['update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','post','create','put'];(function(_0x4d0369,_0x58a6ca){var _0x218b6e=function(_0x1fc826){while(--_0x1fc826){_0x4d0369['push'](_0x4d0369['shift']());}};_0x218b6e(++_0x58a6ca);}(_0x69c8,0x1df));var _0x869c=function(_0x2519d7,_0x13c5ef){_0x2519d7=_0x2519d7-0x0;var _0x579eda=_0x69c8[_0x2519d7];return _0x579eda;};'use strict';var multer=require('multer');var util=require(_0x869c('0x0'));var path=require('path');var timeout=require(_0x869c('0x1'));var express=require(_0x869c('0x2'));var router=express[_0x869c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x869c('0x4'));var interaction=require(_0x869c('0x5'));var config=require(_0x869c('0x6'));var controller=require(_0x869c('0x7'));router[_0x869c('0x8')]('/',auth[_0x869c('0x9')](),controller['index']);router[_0x869c('0x8')](_0x869c('0xa'),auth[_0x869c('0x9')](),controller['show']);router[_0x869c('0xb')]('/',auth[_0x869c('0x9')](),controller[_0x869c('0xc')]);router[_0x869c('0xd')](_0x869c('0xa'),auth['isAuthenticated'](),controller[_0x869c('0xe')]);router[_0x869c('0xf')](_0x869c('0xa'),auth[_0x869c('0x9')](),controller[_0x869c('0x10')]);module['exports']=router;
\ No newline at end of file
index 46337d2..a7a25f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5e9=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x16a39e,_0x461134){var _0x42eceb=function(_0x4ee3a0){while(--_0x4ee3a0){_0x16a39e['push'](_0x16a39e['shift']());}};_0x42eceb(++_0x461134);}(_0xb5e9,0x95));var _0x9b5e=function(_0x3b1106,_0x4bd523){_0x3b1106=_0x3b1106-0x0;var _0x1fbeef=_0xb5e9[_0x3b1106];return _0x1fbeef;};'use strict';var Sequelize=require(_0x9b5e('0x0'));module[_0x9b5e('0x1')]={'type':{'type':Sequelize[_0x9b5e('0x2')](_0x9b5e('0x3'),_0x9b5e('0x4'),_0x9b5e('0x5'),_0x9b5e('0x6'),'picklist'),'defaultValue':_0x9b5e('0x3')},'content':{'type':Sequelize[_0x9b5e('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9b5e('0x2')](_0x9b5e('0x3'),_0x9b5e('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5aa6=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x356460,_0x575a65){var _0x4e3d49=function(_0x9fae9d){while(--_0x9fae9d){_0x356460['push'](_0x356460['shift']());}};_0x4e3d49(++_0x575a65);}(_0x5aa6,0x100));var _0x65aa=function(_0x1a6807,_0x498e46){_0x1a6807=_0x1a6807-0x0;var _0x3119e8=_0x5aa6[_0x1a6807];return _0x3119e8;};'use strict';var Sequelize=require(_0x65aa('0x0'));module[_0x65aa('0x1')]={'type':{'type':Sequelize[_0x65aa('0x2')](_0x65aa('0x3'),_0x65aa('0x4'),_0x65aa('0x5'),_0x65aa('0x6'),'picklist'),'defaultValue':_0x65aa('0x3')},'content':{'type':Sequelize[_0x65aa('0x7')]},'key':{'type':Sequelize[_0x65aa('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x65aa('0x3'),_0x65aa('0x4'),_0x65aa('0x5'))},'keyContent':{'type':Sequelize[_0x65aa('0x7')]},'idField':{'type':Sequelize[_0x65aa('0x7')]},'nameField':{'type':Sequelize[_0x65aa('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x65aa('0x7')]}};
\ No newline at end of file
index d3b0ce0..21eefcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5050=['../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','keys','filters','intersection','attributes','query','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','SugarcrmField','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4fb16c,_0x2629b3){var _0x55b186=function(_0x5bf9c8){while(--_0x5bf9c8){_0x4fb16c['push'](_0x4fb16c['shift']());}};_0x55b186(++_0x2629b3);}(_0x5050,0x1ae));var _0x0505=function(_0x3b10f7,_0x268d68){_0x3b10f7=_0x3b10f7-0x0;var _0x3773ed=_0x5050[_0x3b10f7];return _0x3773ed;};'use strict';var emlformat=require(_0x0505('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0505('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0505('0x2'));var moment=require(_0x0505('0x3'));var BPromise=require(_0x0505('0x4'));var Mustache=require(_0x0505('0x5'));var util=require(_0x0505('0x6'));var path=require(_0x0505('0x7'));var sox=require(_0x0505('0x8'));var csv=require(_0x0505('0x9'));var ejs=require(_0x0505('0xa'));var fs=require('fs');var fs_extra=require(_0x0505('0xb'));var _=require(_0x0505('0xc'));var squel=require(_0x0505('0xd'));var crypto=require(_0x0505('0xe'));var jsforce=require(_0x0505('0xf'));var deskjs=require(_0x0505('0x10'));var toCsv=require(_0x0505('0x9'));var querystring=require(_0x0505('0x11'));var Papa=require(_0x0505('0x12'));var Redis=require('ioredis');var authService=require(_0x0505('0x13'));var qs=require(_0x0505('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0505('0x15'));var logger=require(_0x0505('0x16'))(_0x0505('0x17'));var utils=require(_0x0505('0x18'));var config=require(_0x0505('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0505('0x1a'))['db'];function respondWithStatusCode(_0x5004f3,_0x3a6c98){_0x3a6c98=_0x3a6c98||0xcc;return function(_0x1406fc){if(_0x1406fc){return _0x5004f3[_0x0505('0x1b')](_0x3a6c98);}return _0x5004f3['status'](_0x3a6c98)[_0x0505('0x1c')]();};}function respondWithResult(_0x359418,_0x19f5b9){_0x19f5b9=_0x19f5b9||0xc8;return function(_0x20c74b){if(_0x20c74b){return _0x359418[_0x0505('0x1d')](_0x19f5b9)[_0x0505('0x1e')](_0x20c74b);}};}function respondWithFilteredResult(_0x5399be,_0x5ac3a3){return function(_0x10de68){if(_0x10de68){var _0x19aaa3=typeof _0x5ac3a3['offset']===_0x0505('0x1f')&&typeof _0x5ac3a3[_0x0505('0x20')]===_0x0505('0x1f');var _0x94d3f2=_0x10de68[_0x0505('0x21')];var _0x38670b=_0x19aaa3?0x0:_0x5ac3a3[_0x0505('0x22')];var _0x57fba7=_0x19aaa3?_0x10de68[_0x0505('0x21')]:_0x5ac3a3[_0x0505('0x22')]+_0x5ac3a3['limit'];var _0x18ebf3;if(_0x57fba7>=_0x94d3f2){_0x57fba7=_0x94d3f2;_0x18ebf3=0xc8;}else{_0x18ebf3=0xce;}_0x5399be[_0x0505('0x1d')](_0x18ebf3);return _0x5399be['set'](_0x0505('0x23'),_0x38670b+'-'+_0x57fba7+'/'+_0x94d3f2)[_0x0505('0x1e')](_0x10de68);}return null;};}function patchUpdates(_0x46ac92){return function(_0x5e7a1d){try{jsonpatch['apply'](_0x5e7a1d,_0x46ac92,!![]);}catch(_0x4464f1){return BPromise[_0x0505('0x24')](_0x4464f1);}return _0x5e7a1d[_0x0505('0x25')]();};}function saveUpdates(_0x4cb67d,_0x3a67ec){return function(_0x335904){if(_0x335904){return _0x335904[_0x0505('0x26')](_0x4cb67d)[_0x0505('0x27')](function(_0x2fab4b){return _0x2fab4b;});}return null;};}function removeEntity(_0x126628,_0x516023){return function(_0x35e2ea){if(_0x35e2ea){return _0x35e2ea[_0x0505('0x28')]()[_0x0505('0x27')](function(){_0x126628[_0x0505('0x1d')](0xcc)[_0x0505('0x1c')]();});}};}function handleEntityNotFound(_0x89fc4c,_0x2579c7){return function(_0x3a2ec4){if(!_0x3a2ec4){_0x89fc4c[_0x0505('0x1b')](0x194);}return _0x3a2ec4;};}function handleError(_0xa68eb1,_0x4f8a37){_0x4f8a37=_0x4f8a37||0x1f4;return function(_0x41113c){logger[_0x0505('0x29')](_0x41113c[_0x0505('0x2a')]);if(_0x41113c[_0x0505('0x2b')]){delete _0x41113c['name'];}_0xa68eb1['status'](_0x4f8a37)[_0x0505('0x2c')](_0x41113c);};}exports[_0x0505('0x2d')]=function(_0x1e97b8,_0x62758){var _0x1069e4={},_0x510e3e={},_0x53e52f={'count':0x0,'rows':[]};var _0x32b31c=_[_0x0505('0x2e')](db['SugarcrmField']['rawAttributes'],function(_0x489df1){return{'name':_0x489df1[_0x0505('0x2f')],'type':_0x489df1[_0x0505('0x30')]['key']};});_0x510e3e[_0x0505('0x31')]=_[_0x0505('0x2e')](_0x32b31c,_0x0505('0x2b'));_0x510e3e['query']=_[_0x0505('0x32')](_0x1e97b8['query']);_0x510e3e[_0x0505('0x33')]=_[_0x0505('0x34')](_0x510e3e[_0x0505('0x31')],_0x510e3e['query']);_0x1069e4[_0x0505('0x35')]=_[_0x0505('0x34')](_0x510e3e['model'],qs['fields'](_0x1e97b8[_0x0505('0x36')][_0x0505('0x37')]));_0x1069e4['attributes']=_0x1069e4['attributes'][_0x0505('0x38')]?_0x1069e4[_0x0505('0x35')]:_0x510e3e[_0x0505('0x31')];if(!_0x1e97b8['query']['hasOwnProperty']('nolimit')){_0x1069e4['limit']=qs[_0x0505('0x20')](_0x1e97b8['query'][_0x0505('0x20')]);_0x1069e4[_0x0505('0x22')]=qs[_0x0505('0x22')](_0x1e97b8[_0x0505('0x36')]['offset']);}_0x1069e4[_0x0505('0x39')]=qs[_0x0505('0x3a')](_0x1e97b8[_0x0505('0x36')][_0x0505('0x3a')]);_0x1069e4[_0x0505('0x3b')]=qs['filters'](_[_0x0505('0x3c')](_0x1e97b8['query'],_0x510e3e[_0x0505('0x33')]),_0x32b31c);if(_0x1e97b8[_0x0505('0x36')][_0x0505('0x3d')]){_0x1069e4['where']=_['merge'](_0x1069e4['where'],{'$or':_['map'](_0x32b31c,function(_0x36cc33){if(_0x36cc33['type']!==_0x0505('0x3e')){var _0x1ba1ea={};_0x1ba1ea[_0x36cc33[_0x0505('0x2b')]]={'$like':'%'+_0x1e97b8['query'][_0x0505('0x3d')]+'%'};return _0x1ba1ea;}})});}_0x1069e4=_[_0x0505('0x3f')]({},_0x1069e4,_0x1e97b8[_0x0505('0x40')]);var _0x5f462c={'where':_0x1069e4[_0x0505('0x3b')]};return db[_0x0505('0x41')]['count'](_0x5f462c)[_0x0505('0x27')](function(_0x43ce03){_0x53e52f[_0x0505('0x21')]=_0x43ce03;if(_0x1e97b8['query'][_0x0505('0x42')]){_0x1069e4['include']=[{'all':!![]}];}return db['SugarcrmField'][_0x0505('0x43')](_0x1069e4);})[_0x0505('0x27')](function(_0x130eee){_0x53e52f[_0x0505('0x44')]=_0x130eee;return _0x53e52f;})[_0x0505('0x27')](respondWithFilteredResult(_0x62758,_0x1069e4))['catch'](handleError(_0x62758,null));};exports[_0x0505('0x45')]=function(_0x548d16,_0x54bc94){var _0x13c15f={'raw':!![],'where':{'id':_0x548d16[_0x0505('0x46')]['id']}},_0x4dcc72={};_0x4dcc72[_0x0505('0x31')]=_[_0x0505('0x32')](db['SugarcrmField']['rawAttributes']);_0x4dcc72['query']=_['keys'](_0x548d16['query']);_0x4dcc72[_0x0505('0x33')]=_[_0x0505('0x34')](_0x4dcc72[_0x0505('0x31')],_0x4dcc72['query']);_0x13c15f[_0x0505('0x35')]=_[_0x0505('0x34')](_0x4dcc72[_0x0505('0x31')],qs[_0x0505('0x37')](_0x548d16['query'][_0x0505('0x37')]));_0x13c15f[_0x0505('0x35')]=_0x13c15f[_0x0505('0x35')][_0x0505('0x38')]?_0x13c15f[_0x0505('0x35')]:_0x4dcc72[_0x0505('0x31')];if(_0x548d16[_0x0505('0x36')][_0x0505('0x42')]){_0x13c15f[_0x0505('0x47')]=[{'all':!![]}];}_0x13c15f=_['merge']({},_0x13c15f,_0x548d16['options']);return db[_0x0505('0x41')][_0x0505('0x48')](_0x13c15f)['then'](handleEntityNotFound(_0x54bc94,null))[_0x0505('0x27')](respondWithResult(_0x54bc94,null))[_0x0505('0x49')](handleError(_0x54bc94,null));};exports[_0x0505('0x4a')]=function(_0x4e264b,_0x417114){return db[_0x0505('0x41')][_0x0505('0x4a')](_0x4e264b[_0x0505('0x4b')],{})[_0x0505('0x27')](respondWithResult(_0x417114,0xc9))[_0x0505('0x49')](handleError(_0x417114,null));};exports[_0x0505('0x26')]=function(_0x3491f1,_0x2ae85f){if(_0x3491f1[_0x0505('0x4b')]['id']){delete _0x3491f1[_0x0505('0x4b')]['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x3491f1[_0x0505('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ae85f,null))['then'](saveUpdates(_0x3491f1['body'],null))[_0x0505('0x27')](respondWithResult(_0x2ae85f,null))['catch'](handleError(_0x2ae85f,null));};exports[_0x0505('0x28')]=function(_0x459ebf,_0x29186a){return db[_0x0505('0x41')][_0x0505('0x48')]({'where':{'id':_0x459ebf[_0x0505('0x46')]['id']}})['then'](handleEntityNotFound(_0x29186a,null))['then'](removeEntity(_0x29186a,null))[_0x0505('0x49')](handleError(_0x29186a,null));};
\ No newline at end of file
+var _0x17cd=['pick','filter','where','merge','options','includeAll','include','rows','catch','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x59e157,_0x2fba44){var _0x2bdecf=function(_0x32f403){while(--_0x32f403){_0x59e157['push'](_0x59e157['shift']());}};_0x2bdecf(++_0x2fba44);}(_0x17cd,0xdf));var _0xd17c=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x17cd[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require(_0xd17c('0x0'));var rimraf=require(_0xd17c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd17c('0x2'));var rp=require(_0xd17c('0x3'));var moment=require(_0xd17c('0x4'));var BPromise=require(_0xd17c('0x5'));var Mustache=require(_0xd17c('0x6'));var util=require(_0xd17c('0x7'));var path=require(_0xd17c('0x8'));var sox=require(_0xd17c('0x9'));var csv=require(_0xd17c('0xa'));var ejs=require(_0xd17c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd17c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd17c('0xd'));var deskjs=require(_0xd17c('0xe'));var toCsv=require(_0xd17c('0xa'));var querystring=require(_0xd17c('0xf'));var Papa=require(_0xd17c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd17c('0x11'));var utils=require(_0xd17c('0x12'));var config=require(_0xd17c('0x13'));var licenseUtil=require(_0xd17c('0x14'));var db=require(_0xd17c('0x15'))['db'];function respondWithStatusCode(_0x3ef11d,_0xe78799){_0xe78799=_0xe78799||0xcc;return function(_0xce93de){if(_0xce93de){return _0x3ef11d[_0xd17c('0x16')](_0xe78799);}return _0x3ef11d[_0xd17c('0x17')](_0xe78799)['end']();};}function respondWithResult(_0x1eba54,_0x3352d4){_0x3352d4=_0x3352d4||0xc8;return function(_0xe4ffb3){if(_0xe4ffb3){return _0x1eba54['status'](_0x3352d4)[_0xd17c('0x18')](_0xe4ffb3);}};}function respondWithFilteredResult(_0x21706f,_0x1da831){return function(_0x1a2953){if(_0x1a2953){var _0x44ffdc=typeof _0x1da831[_0xd17c('0x19')]===_0xd17c('0x1a')&&typeof _0x1da831[_0xd17c('0x1b')]===_0xd17c('0x1a');var _0x5dc845=_0x1a2953[_0xd17c('0x1c')];var _0x3f4728=_0x44ffdc?0x0:_0x1da831[_0xd17c('0x19')];var _0x2a7a20=_0x44ffdc?_0x1a2953['count']:_0x1da831[_0xd17c('0x19')]+_0x1da831[_0xd17c('0x1b')];var _0x5c5e81;if(_0x2a7a20>=_0x5dc845){_0x2a7a20=_0x5dc845;_0x5c5e81=0xc8;}else{_0x5c5e81=0xce;}_0x21706f[_0xd17c('0x17')](_0x5c5e81);return _0x21706f['set'](_0xd17c('0x1d'),_0x3f4728+'-'+_0x2a7a20+'/'+_0x5dc845)[_0xd17c('0x18')](_0x1a2953);}return null;};}function patchUpdates(_0x75c269){return function(_0x3b276c){try{jsonpatch[_0xd17c('0x1e')](_0x3b276c,_0x75c269,!![]);}catch(_0x103b60){return BPromise[_0xd17c('0x1f')](_0x103b60);}return _0x3b276c[_0xd17c('0x20')]();};}function saveUpdates(_0x3b71e3,_0x2426ac){return function(_0x23a1e1){if(_0x23a1e1){return _0x23a1e1[_0xd17c('0x21')](_0x3b71e3)[_0xd17c('0x22')](function(_0x374cf0){return _0x374cf0;});}return null;};}function removeEntity(_0x468a78,_0x1eb4fe){return function(_0x3230db){if(_0x3230db){return _0x3230db[_0xd17c('0x23')]()[_0xd17c('0x22')](function(){_0x468a78[_0xd17c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe22e3f,_0x5a3d83){return function(_0x5b051d){if(!_0x5b051d){_0xe22e3f[_0xd17c('0x16')](0x194);}return _0x5b051d;};}function handleError(_0x2ff34f,_0x3aab2a){_0x3aab2a=_0x3aab2a||0x1f4;return function(_0x164826){logger[_0xd17c('0x24')](_0x164826[_0xd17c('0x25')]);if(_0x164826[_0xd17c('0x26')]){delete _0x164826['name'];}_0x2ff34f[_0xd17c('0x17')](_0x3aab2a)['send'](_0x164826);};}exports[_0xd17c('0x27')]=function(_0x4192db,_0x2a24a8){var _0x522323={},_0x3054a3={},_0x39c2fe={'count':0x0,'rows':[]};var _0x3fe22=_[_0xd17c('0x28')](db[_0xd17c('0x29')][_0xd17c('0x2a')],function(_0x333492){return{'name':_0x333492[_0xd17c('0x2b')],'type':_0x333492[_0xd17c('0x2c')]['key']};});_0x3054a3['model']=_[_0xd17c('0x28')](_0x3fe22,_0xd17c('0x26'));_0x3054a3[_0xd17c('0x2d')]=_[_0xd17c('0x2e')](_0x4192db[_0xd17c('0x2d')]);_0x3054a3[_0xd17c('0x2f')]=_['intersection'](_0x3054a3[_0xd17c('0x30')],_0x3054a3['query']);_0x522323['attributes']=_[_0xd17c('0x31')](_0x3054a3['model'],qs['fields'](_0x4192db['query'][_0xd17c('0x32')]));_0x522323[_0xd17c('0x33')]=_0x522323[_0xd17c('0x33')][_0xd17c('0x34')]?_0x522323[_0xd17c('0x33')]:_0x3054a3[_0xd17c('0x30')];if(!_0x4192db['query'][_0xd17c('0x35')](_0xd17c('0x36'))){_0x522323[_0xd17c('0x1b')]=qs['limit'](_0x4192db[_0xd17c('0x2d')][_0xd17c('0x1b')]);_0x522323['offset']=qs['offset'](_0x4192db[_0xd17c('0x2d')][_0xd17c('0x19')]);}_0x522323[_0xd17c('0x37')]=qs[_0xd17c('0x38')](_0x4192db[_0xd17c('0x2d')][_0xd17c('0x38')]);_0x522323['where']=qs[_0xd17c('0x2f')](_[_0xd17c('0x39')](_0x4192db[_0xd17c('0x2d')],_0x3054a3[_0xd17c('0x2f')]),_0x3fe22);if(_0x4192db['query'][_0xd17c('0x3a')]){_0x522323[_0xd17c('0x3b')]=_['merge'](_0x522323['where'],{'$or':_[_0xd17c('0x28')](_0x3fe22,function(_0x459bac){if(_0x459bac['type']!=='VIRTUAL'){var _0xb7bed4={};_0xb7bed4[_0x459bac[_0xd17c('0x26')]]={'$like':'%'+_0x4192db['query'][_0xd17c('0x3a')]+'%'};return _0xb7bed4;}})});}_0x522323=_[_0xd17c('0x3c')]({},_0x522323,_0x4192db[_0xd17c('0x3d')]);var _0x45dd87={'where':_0x522323[_0xd17c('0x3b')]};return db['SugarcrmField'][_0xd17c('0x1c')](_0x45dd87)[_0xd17c('0x22')](function(_0x5ac8dc){_0x39c2fe['count']=_0x5ac8dc;if(_0x4192db['query'][_0xd17c('0x3e')]){_0x522323[_0xd17c('0x3f')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x522323);})['then'](function(_0x3f7c7d){_0x39c2fe[_0xd17c('0x40')]=_0x3f7c7d;return _0x39c2fe;})[_0xd17c('0x22')](respondWithFilteredResult(_0x2a24a8,_0x522323))[_0xd17c('0x41')](handleError(_0x2a24a8,null));};exports['show']=function(_0x86081f,_0x48e00b){var _0x3662de={'raw':!![],'where':{'id':_0x86081f['params']['id']}},_0x330657={};_0x330657[_0xd17c('0x30')]=_[_0xd17c('0x2e')](db['SugarcrmField'][_0xd17c('0x2a')]);_0x330657[_0xd17c('0x2d')]=_['keys'](_0x86081f['query']);_0x330657[_0xd17c('0x2f')]=_['intersection'](_0x330657['model'],_0x330657[_0xd17c('0x2d')]);_0x3662de[_0xd17c('0x33')]=_[_0xd17c('0x31')](_0x330657['model'],qs[_0xd17c('0x32')](_0x86081f[_0xd17c('0x2d')][_0xd17c('0x32')]));_0x3662de[_0xd17c('0x33')]=_0x3662de[_0xd17c('0x33')][_0xd17c('0x34')]?_0x3662de[_0xd17c('0x33')]:_0x330657['model'];if(_0x86081f[_0xd17c('0x2d')][_0xd17c('0x3e')]){_0x3662de[_0xd17c('0x3f')]=[{'all':!![]}];}_0x3662de=_[_0xd17c('0x3c')]({},_0x3662de,_0x86081f['options']);return db['SugarcrmField'][_0xd17c('0x42')](_0x3662de)[_0xd17c('0x22')](handleEntityNotFound(_0x48e00b,null))[_0xd17c('0x22')](respondWithResult(_0x48e00b,null))[_0xd17c('0x41')](handleError(_0x48e00b,null));};exports['create']=function(_0x5775b1,_0x59643d){return db[_0xd17c('0x29')][_0xd17c('0x43')](_0x5775b1[_0xd17c('0x44')],{})[_0xd17c('0x22')](respondWithResult(_0x59643d,0xc9))[_0xd17c('0x41')](handleError(_0x59643d,null));};exports[_0xd17c('0x21')]=function(_0x3cacde,_0x1198e3){if(_0x3cacde[_0xd17c('0x44')]['id']){delete _0x3cacde[_0xd17c('0x44')]['id'];}return db[_0xd17c('0x29')][_0xd17c('0x42')]({'where':{'id':_0x3cacde[_0xd17c('0x45')]['id']}})[_0xd17c('0x22')](handleEntityNotFound(_0x1198e3,null))[_0xd17c('0x22')](saveUpdates(_0x3cacde['body'],null))['then'](respondWithResult(_0x1198e3,null))[_0xd17c('0x41')](handleError(_0x1198e3,null));};exports['destroy']=function(_0x308ee2,_0x529298){return db[_0xd17c('0x29')][_0xd17c('0x42')]({'where':{'id':_0x308ee2[_0xd17c('0x45')]['id']}})[_0xd17c('0x22')](handleEntityNotFound(_0x529298,null))['then'](removeEntity(_0x529298,null))['catch'](handleError(_0x529298,null));};
\ No newline at end of file
index 1ed973e..2f29ff1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e40=['exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x4a8dfc,_0x33213a){var _0x12002f=function(_0x5f439d){while(--_0x5f439d){_0x4a8dfc['push'](_0x4a8dfc['shift']());}};_0x12002f(++_0x33213a);}(_0x9e40,0x13e));var _0x09e4=function(_0x5cbd14,_0x43c4da){_0x5cbd14=_0x5cbd14-0x0;var _0x27b980=_0x9e40[_0x5cbd14];return _0x27b980;};'use strict';var _=require(_0x09e4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x09e4('0x1'));var moment=require(_0x09e4('0x2'));var BPromise=require('bluebird');var rp=require(_0x09e4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09e4('0x4'));var config=require(_0x09e4('0x5'));var attributes=require('./intSugarcrmField.attributes');module[_0x09e4('0x6')]=function(_0x2b2c44,_0xfb4afb){return _0x2b2c44[_0x09e4('0x7')](_0x09e4('0x8'),attributes,{'tableName':_0x09e4('0x9'),'paranoid':![],'indexes':[{'name':_0x09e4('0xa'),'fields':['idField',_0x09e4('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1743=['FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0xe3500c,_0x381754){var _0x4985e8=function(_0x48be4f){while(--_0x48be4f){_0xe3500c['push'](_0xe3500c['shift']());}};_0x4985e8(++_0x381754);}(_0x1743,0x151));var _0x3174=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1743[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3174('0x0'));var util=require(_0x3174('0x1'));var logger=require(_0x3174('0x2'))(_0x3174('0x3'));var moment=require('moment');var BPromise=require(_0x3174('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3174('0x5'));var rimraf=require(_0x3174('0x6'));var config=require(_0x3174('0x7'));var attributes=require(_0x3174('0x8'));module[_0x3174('0x9')]=function(_0x5016fd,_0x3eaf44){return _0x5016fd[_0x3174('0xa')](_0x3174('0xb'),attributes,{'tableName':_0x3174('0xc'),'paranoid':![],'indexes':[{'name':_0x3174('0xd'),'fields':[_0x3174('0xe'),_0x3174('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 3f4c90f..2f61c33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ab8=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x5f1cf7,_0x47d9a9){var _0x2ab77b=function(_0x3b8a33){while(--_0x3b8a33){_0x5f1cf7['push'](_0x5f1cf7['shift']());}};_0x2ab77b(++_0x47d9a9);}(_0x9ab8,0x8a));var _0x89ab=function(_0x33a177,_0x356f58){_0x33a177=_0x33a177-0x0;var _0x923d3d=_0x9ab8[_0x33a177];return _0x923d3d;};'use strict';var _=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var moment=require(_0x89ab('0x2'));var BPromise=require(_0x89ab('0x3'));var rs=require(_0x89ab('0x4'));var fs=require('fs');var Redis=require(_0x89ab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x89ab('0x6'));var logger=require('../../config/logger')(_0x89ab('0x7'));var config=require(_0x89ab('0x8'));var jayson=require(_0x89ab('0x9'));var client=jayson[_0x89ab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa298c3,_0x4af437,_0x282c88){return new BPromise(function(_0xe3176b,_0x549f4e){return client[_0x89ab('0xb')](_0xa298c3,_0x282c88)[_0x89ab('0xc')](function(_0x67b191){logger[_0x89ab('0xd')](_0x89ab('0xe'),_0x4af437,_0x89ab('0xf'));logger[_0x89ab('0x10')](_0x89ab('0x11'),_0x4af437,_0x89ab('0xf'),JSON[_0x89ab('0x12')](_0x67b191));if(_0x67b191[_0x89ab('0x13')]){if(_0x67b191[_0x89ab('0x13')][_0x89ab('0x14')]===0x1f4){logger[_0x89ab('0x13')](_0x89ab('0xe'),_0x4af437,_0x67b191['error'][_0x89ab('0x15')]);return _0x549f4e(_0x67b191[_0x89ab('0x13')][_0x89ab('0x15')]);}logger[_0x89ab('0x13')](_0x89ab('0xe'),_0x4af437,_0x67b191['error'][_0x89ab('0x15')]);return _0xe3176b(_0x67b191['error'][_0x89ab('0x15')]);}else{logger[_0x89ab('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x4af437,_0x89ab('0xf'));_0xe3176b(_0x67b191['result'][_0x89ab('0x15')]);}})[_0x89ab('0x16')](function(_0x1d743d){logger[_0x89ab('0x13')](_0x89ab('0xe'),_0x4af437,_0x1d743d);_0x549f4e(_0x1d743d);});});}
\ No newline at end of file
+var _0x6d1d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmField,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x6d1d,0x1b1));var _0xd6d1=function(_0x5d5015,_0x5a9871){_0x5d5015=_0x5d5015-0x0;var _0x1b236c=_0x6d1d[_0x5d5015];return _0x1b236c;};'use strict';var _=require(_0xd6d1('0x0'));var util=require('util');var moment=require(_0xd6d1('0x1'));var BPromise=require(_0xd6d1('0x2'));var rs=require(_0xd6d1('0x3'));var fs=require('fs');var Redis=require(_0xd6d1('0x4'));var db=require(_0xd6d1('0x5'))['db'];var utils=require(_0xd6d1('0x6'));var logger=require(_0xd6d1('0x7'))(_0xd6d1('0x8'));var config=require(_0xd6d1('0x9'));var jayson=require(_0xd6d1('0xa'));var client=jayson[_0xd6d1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24c04d,_0x2ed944,_0x590492){return new BPromise(function(_0x32f2df,_0x11375f){return client['request'](_0x24c04d,_0x590492)['then'](function(_0x5c4a9f){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x2ed944,_0xd6d1('0xc'));logger[_0xd6d1('0xd')](_0xd6d1('0xe'),_0x2ed944,_0xd6d1('0xc'),JSON[_0xd6d1('0xf')](_0x5c4a9f));if(_0x5c4a9f[_0xd6d1('0x10')]){if(_0x5c4a9f[_0xd6d1('0x10')]['code']===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2ed944,_0x5c4a9f[_0xd6d1('0x10')][_0xd6d1('0x11')]);return _0x11375f(_0x5c4a9f[_0xd6d1('0x10')][_0xd6d1('0x11')]);}logger['error'](_0xd6d1('0x12'),_0x2ed944,_0x5c4a9f[_0xd6d1('0x10')][_0xd6d1('0x11')]);return _0x32f2df(_0x5c4a9f['error'][_0xd6d1('0x11')]);}else{logger[_0xd6d1('0x13')](_0xd6d1('0x12'),_0x2ed944,_0xd6d1('0xc'));_0x32f2df(_0x5c4a9f[_0xd6d1('0x14')][_0xd6d1('0x11')]);}})[_0xd6d1('0x15')](function(_0x2531b0){logger[_0xd6d1('0x10')](_0xd6d1('0x12'),_0x2ed944,_0x2531b0);_0x11375f(_0x2531b0);});});}
\ No newline at end of file
index f99e1aa..db970f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeee=['get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller'];(function(_0x579973,_0x2b5ec4){var _0x39da90=function(_0x9bcf9a){while(--_0x9bcf9a){_0x579973['push'](_0x579973['shift']());}};_0x39da90(++_0x2b5ec4);}(_0xdeee,0x10a));var _0xedee=function(_0x1d7ef9,_0x5299fe){_0x1d7ef9=_0x1d7ef9-0x0;var _0x491213=_0xdeee[_0x1d7ef9];return _0x491213;};'use strict';var multer=require('multer');var util=require(_0xedee('0x0'));var path=require(_0xedee('0x1'));var timeout=require(_0xedee('0x2'));var express=require(_0xedee('0x3'));var router=express[_0xedee('0x4')]();var fs_extra=require(_0xedee('0x5'));var auth=require(_0xedee('0x6'));var interaction=require(_0xedee('0x7'));var config=require(_0xedee('0x8'));var controller=require(_0xedee('0x9'));router[_0xedee('0xa')]('/',auth[_0xedee('0xb')](),controller[_0xedee('0xc')]);router[_0xedee('0xa')](_0xedee('0xd'),auth[_0xedee('0xb')](),controller[_0xedee('0xe')]);router['get'](_0xedee('0xf'),auth[_0xedee('0xb')](),controller['getConfigurations']);router[_0xedee('0xa')](_0xedee('0x10'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xedee('0xb')](),controller['create']);router[_0xedee('0x11')](_0xedee('0xf'),auth[_0xedee('0xb')](),controller['addConfiguration']);router[_0xedee('0x12')](_0xedee('0xd'),auth[_0xedee('0xb')](),controller[_0xedee('0x13')]);router[_0xedee('0x14')]('/:id',auth[_0xedee('0xb')](),controller[_0xedee('0x15')]);module[_0xedee('0x16')]=router;
\ No newline at end of file
+var _0x2a4b=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x2a4b,0xbb));var _0xb2a4=function(_0x2ecb69,_0x4b020e){_0x2ecb69=_0x2ecb69-0x0;var _0x12cb10=_0x2a4b[_0x2ecb69];return _0x12cb10;};'use strict';var multer=require('multer');var util=require(_0xb2a4('0x0'));var path=require('path');var timeout=require(_0xb2a4('0x1'));var express=require(_0xb2a4('0x2'));var router=express[_0xb2a4('0x3')]();var fs_extra=require(_0xb2a4('0x4'));var auth=require(_0xb2a4('0x5'));var interaction=require(_0xb2a4('0x6'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x8')]);router[_0xb2a4('0x9')](_0xb2a4('0xa'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0xb')]);router['get'](_0xb2a4('0xc'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0xd')]);router[_0xb2a4('0x9')](_0xb2a4('0xe'),auth[_0xb2a4('0x7')](),controller['getFields']);router[_0xb2a4('0xf')]('/',auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x10')]);router[_0xb2a4('0xf')](_0xb2a4('0xc'),auth['isAuthenticated'](),controller[_0xb2a4('0x11')]);router[_0xb2a4('0x12')](_0xb2a4('0xa'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x13')]);router[_0xb2a4('0x14')](_0xb2a4('0xa'),auth[_0xb2a4('0x7')](),controller[_0xb2a4('0x15')]);module[_0xb2a4('0x16')]=router;
\ No newline at end of file
index 7a0dbb4..53d1519 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d6d=['STRING','HelpDesk','sequelize','exports'];(function(_0x414b30,_0xd1a910){var _0xc6d666=function(_0x27645a){while(--_0x27645a){_0x414b30['push'](_0x414b30['shift']());}};_0xc6d666(++_0xd1a910);}(_0x2d6d,0xf2));var _0xd2d6=function(_0xea6018,_0x4cf082){_0xea6018=_0xea6018-0x0;var _0x57b54d=_0x2d6d[_0xea6018];return _0x57b54d;};'use strict';var Sequelize=require(_0xd2d6('0x0'));module[_0xd2d6('0x1')]={'name':{'type':Sequelize[_0xd2d6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd2d6('0x2')]},'username':{'type':Sequelize[_0xd2d6('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd2d6('0x2')],'allowNull':![],'defaultValue':_0xd2d6('0x3')},'remoteUri':{'type':Sequelize[_0xd2d6('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd2d6('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xd2d6('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x5cae=['STRING','HelpDesk','sequelize'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x5cae,0x1d9));var _0xe5ca=function(_0xae9024,_0x17f58e){_0xae9024=_0xae9024-0x0;var _0x23e7d3=_0x5cae[_0xae9024];return _0x23e7d3;};'use strict';var Sequelize=require(_0xe5ca('0x0'));module['exports']={'name':{'type':Sequelize[_0xe5ca('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe5ca('0x1')]},'username':{'type':Sequelize[_0xe5ca('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe5ca('0x1')],'allowNull':![],'defaultValue':_0xe5ca('0x2')},'remoteUri':{'type':Sequelize[_0xe5ca('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe5ca('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe5ca('0x1')],'allowNull':![]}};
\ No newline at end of file
index 167cb9e..59df50f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x420f=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','VtigerConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','username','remoteUri','moduleName','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','result','token','describe','sessionName','autogenerated','reference','owner','remove','editable','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x420f,0x1ce));var _0xf420=function(_0x331606,_0x28831b){_0x331606=_0x331606-0x0;var _0x136b7e=_0x420f[_0x331606];return _0x136b7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf420('0x0'));var jsonpatch=require(_0xf420('0x1'));var rp=require(_0xf420('0x2'));var moment=require(_0xf420('0x3'));var BPromise=require(_0xf420('0x4'));var Mustache=require(_0xf420('0x5'));var util=require(_0xf420('0x6'));var path=require(_0xf420('0x7'));var sox=require(_0xf420('0x8'));var csv=require('to-csv');var ejs=require(_0xf420('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf420('0xa'));var jsforce=require(_0xf420('0xb'));var deskjs=require(_0xf420('0xc'));var toCsv=require(_0xf420('0xd'));var querystring=require(_0xf420('0xe'));var Papa=require(_0xf420('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf420('0x10'));var as=require(_0xf420('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf420('0x12'))(_0xf420('0x13'));var utils=require(_0xf420('0x14'));var config=require(_0xf420('0x15'));var licenseUtil=require(_0xf420('0x16'));var db=require(_0xf420('0x17'))['db'];var integrations=require(_0xf420('0x18'));function respondWithStatusCode(_0x1e3215,_0x9b3e59){_0x9b3e59=_0x9b3e59||0xcc;return function(_0x1a284f){if(_0x1a284f){return _0x1e3215[_0xf420('0x19')](_0x9b3e59);}return _0x1e3215[_0xf420('0x1a')](_0x9b3e59)[_0xf420('0x1b')]();};}function respondWithResult(_0x4b898f,_0x180baa){_0x180baa=_0x180baa||0xc8;return function(_0x504933){if(_0x504933){return _0x4b898f['status'](_0x180baa)[_0xf420('0x1c')](_0x504933);}};}function respondWithFilteredResult(_0x267a62,_0x4c58a5){return function(_0xa792a9){if(_0xa792a9){var _0x5a2631=typeof _0x4c58a5[_0xf420('0x1d')]===_0xf420('0x1e')&&typeof _0x4c58a5[_0xf420('0x1f')]==='undefined';var _0x4b47ab=_0xa792a9[_0xf420('0x20')];var _0x248d45=_0x5a2631?0x0:_0x4c58a5[_0xf420('0x1d')];var _0x562947=_0x5a2631?_0xa792a9['count']:_0x4c58a5[_0xf420('0x1d')]+_0x4c58a5['limit'];var _0x6aed36;if(_0x562947>=_0x4b47ab){_0x562947=_0x4b47ab;_0x6aed36=0xc8;}else{_0x6aed36=0xce;}_0x267a62[_0xf420('0x1a')](_0x6aed36);return _0x267a62[_0xf420('0x21')](_0xf420('0x22'),_0x248d45+'-'+_0x562947+'/'+_0x4b47ab)[_0xf420('0x1c')](_0xa792a9);}return null;};}function patchUpdates(_0x7ba7a3){return function(_0x219788){try{jsonpatch[_0xf420('0x23')](_0x219788,_0x7ba7a3,!![]);}catch(_0x2edcc6){return BPromise[_0xf420('0x24')](_0x2edcc6);}return _0x219788[_0xf420('0x25')]();};}function saveUpdates(_0x50ffe0,_0x16432f){return function(_0x2b831e){if(_0x2b831e){return _0x2b831e[_0xf420('0x26')](_0x50ffe0)[_0xf420('0x27')](function(_0x1c082c){return _0x1c082c;});}return null;};}function removeEntity(_0x9f68e,_0x18c462){return function(_0x100c50){if(_0x100c50){return _0x100c50[_0xf420('0x28')]()['then'](function(){_0x9f68e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e722,_0x19981d){return function(_0x4dfc03){if(!_0x4dfc03){_0x28e722[_0xf420('0x19')](0x194);}return _0x4dfc03;};}function handleError(_0x22262b,_0x87febc){_0x87febc=_0x87febc||0x1f4;return function(_0x470e6c){logger[_0xf420('0x29')](_0x470e6c[_0xf420('0x2a')]);if(_0x470e6c['name']){delete _0x470e6c[_0xf420('0x2b')];}_0x22262b[_0xf420('0x1a')](_0x87febc)[_0xf420('0x2c')](_0x470e6c);};}exports[_0xf420('0x2d')]=function(_0x4d221b,_0x458c1b){var _0x4d33c6={},_0x8a992={},_0x41a71a={'count':0x0,'rows':[]};var _0x2a575c=_[_0xf420('0x2e')](db[_0xf420('0x2f')][_0xf420('0x30')],function(_0x1c3129){return{'name':_0x1c3129[_0xf420('0x31')],'type':_0x1c3129[_0xf420('0x32')][_0xf420('0x33')]};});_0x8a992['model']=_['map'](_0x2a575c,_0xf420('0x2b'));_0x8a992[_0xf420('0x34')]=_[_0xf420('0x35')](_0x4d221b[_0xf420('0x34')]);_0x8a992[_0xf420('0x36')]=_[_0xf420('0x37')](_0x8a992[_0xf420('0x38')],_0x8a992[_0xf420('0x34')]);_0x4d33c6[_0xf420('0x39')]=_['intersection'](_0x8a992[_0xf420('0x38')],qs[_0xf420('0x3a')](_0x4d221b[_0xf420('0x34')][_0xf420('0x3a')]));_0x4d33c6[_0xf420('0x39')]=_0x4d33c6[_0xf420('0x39')][_0xf420('0x3b')]?_0x4d33c6[_0xf420('0x39')]:_0x8a992['model'];if(!_0x4d221b[_0xf420('0x34')]['hasOwnProperty'](_0xf420('0x3c'))){_0x4d33c6[_0xf420('0x1f')]=qs['limit'](_0x4d221b['query']['limit']);_0x4d33c6[_0xf420('0x1d')]=qs[_0xf420('0x1d')](_0x4d221b['query']['offset']);}_0x4d33c6[_0xf420('0x3d')]=qs['sort'](_0x4d221b[_0xf420('0x34')][_0xf420('0x3e')]);_0x4d33c6[_0xf420('0x3f')]=qs['filters'](_[_0xf420('0x40')](_0x4d221b[_0xf420('0x34')],_0x8a992[_0xf420('0x36')]),_0x2a575c);if(_0x4d221b[_0xf420('0x34')][_0xf420('0x41')]){_0x4d33c6['where']=_[_0xf420('0x42')](_0x4d33c6[_0xf420('0x3f')],{'$or':_['map'](_0x2a575c,function(_0x279ac3){if(_0x279ac3['type']!==_0xf420('0x43')){var _0x3aaba8={};_0x3aaba8[_0x279ac3[_0xf420('0x2b')]]={'$like':'%'+_0x4d221b[_0xf420('0x34')][_0xf420('0x41')]+'%'};return _0x3aaba8;}})});}_0x4d33c6=_[_0xf420('0x42')]({},_0x4d33c6,_0x4d221b[_0xf420('0x44')]);var _0x2ef4c8={'where':_0x4d33c6[_0xf420('0x3f')]};return db[_0xf420('0x2f')]['count'](_0x2ef4c8)[_0xf420('0x27')](function(_0x287542){_0x41a71a[_0xf420('0x20')]=_0x287542;if(_0x4d221b[_0xf420('0x34')][_0xf420('0x45')]){_0x4d33c6[_0xf420('0x46')]=[{'all':!![]}];}return db['VtigerAccount'][_0xf420('0x47')](_0x4d33c6);})['then'](function(_0x175cee){_0x41a71a[_0xf420('0x48')]=_0x175cee;return _0x41a71a;})[_0xf420('0x27')](respondWithFilteredResult(_0x458c1b,_0x4d33c6))[_0xf420('0x49')](handleError(_0x458c1b,null));};exports[_0xf420('0x4a')]=function(_0x237a35,_0x23b229){var _0x479fa8={'raw':![],'where':{'id':_0x237a35[_0xf420('0x4b')]['id']}},_0x637a72={};_0x637a72['model']=_['keys'](db[_0xf420('0x2f')][_0xf420('0x30')]);_0x637a72[_0xf420('0x34')]=_[_0xf420('0x35')](_0x237a35['query']);_0x637a72['filters']=_[_0xf420('0x37')](_0x637a72[_0xf420('0x38')],_0x637a72[_0xf420('0x34')]);_0x479fa8[_0xf420('0x39')]=_[_0xf420('0x37')](_0x637a72[_0xf420('0x38')],qs[_0xf420('0x3a')](_0x237a35[_0xf420('0x34')][_0xf420('0x3a')]));_0x479fa8[_0xf420('0x39')]=_0x479fa8[_0xf420('0x39')][_0xf420('0x3b')]?_0x479fa8[_0xf420('0x39')]:_0x637a72[_0xf420('0x38')];if(_0x237a35[_0xf420('0x34')]['includeAll']){_0x479fa8[_0xf420('0x46')]=[{'all':!![]}];}_0x479fa8=_[_0xf420('0x42')]({},_0x479fa8,_0x237a35['options']);return db[_0xf420('0x2f')][_0xf420('0x4c')](_0x479fa8)['then'](handleEntityNotFound(_0x23b229,null))[_0xf420('0x27')](respondWithResult(_0x23b229,null))[_0xf420('0x49')](handleError(_0x23b229,null));};exports[_0xf420('0x4d')]=function(_0x491401,_0x3fb838){return db[_0xf420('0x2f')][_0xf420('0x4d')](_0x491401['body'],{})[_0xf420('0x27')](respondWithResult(_0x3fb838,0xc9))[_0xf420('0x49')](handleError(_0x3fb838,null));};exports[_0xf420('0x26')]=function(_0x9c9f5f,_0x13e340){if(_0x9c9f5f[_0xf420('0x4e')]['id']){delete _0x9c9f5f['body']['id'];}return db['VtigerAccount'][_0xf420('0x4c')]({'where':{'id':_0x9c9f5f['params']['id']}})['then'](handleEntityNotFound(_0x13e340,null))[_0xf420('0x27')](saveUpdates(_0x9c9f5f['body'],null))['then'](respondWithResult(_0x13e340,null))['catch'](handleError(_0x13e340,null));};exports[_0xf420('0x28')]=function(_0x109629,_0x26a3d8){return db['VtigerAccount'][_0xf420('0x4c')]({'where':{'id':_0x109629['params']['id']}})[_0xf420('0x27')](handleEntityNotFound(_0x26a3d8,null))[_0xf420('0x27')](removeEntity(_0x26a3d8,null))[_0xf420('0x49')](handleError(_0x26a3d8,null));};exports['getConfigurations']=function(_0x27a88f,_0x54cf8a,_0x103e5c){var _0x30fc5b={};var _0x3d3906={};var _0x195398;var _0x5b5f60;return db['VtigerAccount'][_0xf420('0x4f')]({'where':{'id':_0x27a88f[_0xf420('0x4b')]['id']}})[_0xf420('0x27')](handleEntityNotFound(_0x54cf8a,null))[_0xf420('0x27')](function(_0x1ec8f7){if(_0x1ec8f7){_0x195398=_0x1ec8f7;_0x3d3906['model']=_[_0xf420('0x35')](db[_0xf420('0x50')]['rawAttributes']);_0x3d3906[_0xf420('0x34')]=_['keys'](_0x27a88f['query']);_0x3d3906['filters']=_[_0xf420('0x37')](_0x3d3906[_0xf420('0x38')],_0x3d3906['query']);_0x30fc5b['attributes']=_['intersection'](_0x3d3906[_0xf420('0x38')],qs['fields'](_0x27a88f[_0xf420('0x34')][_0xf420('0x3a')]));_0x30fc5b['attributes']=_0x30fc5b['attributes'][_0xf420('0x3b')]?_0x30fc5b[_0xf420('0x39')]:_0x3d3906[_0xf420('0x38')];_0x30fc5b[_0xf420('0x3d')]=qs[_0xf420('0x3e')](_0x27a88f[_0xf420('0x34')][_0xf420('0x3e')]);_0x30fc5b[_0xf420('0x3f')]=qs[_0xf420('0x36')](_[_0xf420('0x40')](_0x27a88f[_0xf420('0x34')],_0x3d3906[_0xf420('0x36')]));if(_0x27a88f['query']['filter']){_0x30fc5b[_0xf420('0x3f')]=_[_0xf420('0x42')](_0x30fc5b[_0xf420('0x3f')],{'$or':_[_0xf420('0x2e')](_0x30fc5b[_0xf420('0x39')],function(_0x2594ca){var _0x26ac4d={};_0x26ac4d[_0x2594ca]={'$like':'%'+_0x27a88f['query']['filter']+'%'};return _0x26ac4d;})});}_0x30fc5b=_[_0xf420('0x42')]({},_0x30fc5b,_0x27a88f[_0xf420('0x44')]);return _0x195398[_0xf420('0x51')](_0x30fc5b);}})[_0xf420('0x27')](function(_0x20156b){if(_0x20156b){_0x5b5f60=_0x20156b[_0xf420('0x3b')];if(!_0x27a88f[_0xf420('0x34')][_0xf420('0x52')](_0xf420('0x3c'))){_0x30fc5b[_0xf420('0x1f')]=qs[_0xf420('0x1f')](_0x27a88f['query'][_0xf420('0x1f')]);_0x30fc5b[_0xf420('0x1d')]=qs[_0xf420('0x1d')](_0x27a88f['query'][_0xf420('0x1d')]);}return _0x195398[_0xf420('0x51')](_0x30fc5b);}})['then'](function(_0x333744){if(_0x333744){return _0x333744?{'count':_0x5b5f60,'rows':_0x333744}:null;}})['then'](respondWithResult(_0x54cf8a,null))[_0xf420('0x49')](handleError(_0x54cf8a,null));};exports[_0xf420('0x53')]=function(_0x89c97a,_0x1ec645,_0x4a0bc4){if(_0x89c97a['body']['id']){delete _0x89c97a['body']['id'];}return db[_0xf420('0x2f')][_0xf420('0x4f')]({'where':{'id':_0x89c97a['params']['id']}})[_0xf420('0x27')](handleEntityNotFound(_0x1ec645,null))[_0xf420('0x27')](function(_0x6e23ac){if(_0x6e23ac){_0x89c97a['body'][_0xf420('0x54')]=_0x6e23ac['id'];_0x89c97a[_0xf420('0x4e')][_0xf420('0x55')]=integrations[_0xf420('0x56')](_0x89c97a[_0xf420('0x4e')][_0xf420('0x57')],_0x89c97a[_0xf420('0x4e')][_0xf420('0x32')]);_0x89c97a[_0xf420('0x4e')][_0xf420('0x58')]=integrations[_0xf420('0x59')](_0x89c97a[_0xf420('0x4e')][_0xf420('0x57')],_0x89c97a['body']['type']);return db[_0xf420('0x50')]['create'](_0x89c97a[_0xf420('0x4e')],{'include':[{'model':db[_0xf420('0x5a')],'as':_0xf420('0x55')},{'model':db[_0xf420('0x5a')],'as':'Descriptions'}]});}return null;})[_0xf420('0x27')](respondWithResult(_0x1ec645,null))[_0xf420('0x49')](handleError(_0x1ec645,null));};var md5=require('md5');exports['getFields']=function(_0x5e8197,_0x47884c,_0x331f3a){var _0x36e0b8=null;var _0x255966=null;var _0x1c0f06=null;var _0x369e04=null;var _0x299d0e='';return db[_0xf420('0x2f')]['findOne']({'where':{'id':_0x5e8197['params']['id']},'attributes':['id',_0xf420('0x2b'),_0xf420('0x5b'),'description','moduleName',_0xf420('0x5c'),'serverUrl','accessKey']})[_0xf420('0x27')](handleEntityNotFound(_0x47884c,null))[_0xf420('0x27')](function(_0xaf8996){if(_0xaf8996){_0x36e0b8=_0xaf8996[_0xf420('0x5b')];_0x255966=_0xaf8996['accessKey'];_0x1c0f06=_0xaf8996[_0xf420('0x5d')];_0x299d0e=_0xaf8996[_0xf420('0x5c')];var _0xd3fe2c=_0x299d0e[_0xf420('0x5e')](-0x1);if(_0xd3fe2c==='/'){_0x299d0e=_0x299d0e[_0xf420('0x5f')](0x0,_0x299d0e[_0xf420('0x60')](_0xd3fe2c));}_0x369e04=util[_0xf420('0x61')](_0xf420('0x62'),_0x299d0e);var _0x868ed5={'method':_0xf420('0x63'),'uri':_0x369e04,'qs':{'operation':'getchallenge','username':_0xaf8996[_0xf420('0x5b')]},'json':!![]};return rp(_0x868ed5);}})['then'](function(_0x529a4e){if(_0x529a4e[_0xf420('0x64')]){var _0x148fd0={'method':'POST','uri':_0x369e04,'form':{'operation':'login','username':_0x36e0b8,'accessKey':md5(_0x529a4e[_0xf420('0x65')][_0xf420('0x66')]+_0x255966)},'json':!![]};return rp(_0x148fd0);}})['then'](function(_0x1a7107){if(_0x1a7107[_0xf420('0x64')]){var _0x15459e={'method':_0xf420('0x63'),'uri':_0x369e04,'qs':{'operation':_0xf420('0x67'),'username':_0x36e0b8,'sessionName':_0x1a7107[_0xf420('0x65')][_0xf420('0x68')],'elementType':_0x1c0f06},'json':!![]};return rp(_0x15459e);}})[_0xf420('0x27')](function(_0x21eb61){if(_0x21eb61[_0xf420('0x64')]){var _0x3c5ea0=[_0xf420('0x69'),_0xf420('0x6a'),_0xf420('0x6b')];_[_0xf420('0x6c')](_0x21eb61['result'][_0xf420('0x3a')],function(_0x6b9be){return _0x3c5ea0['includes'](_0x6b9be[_0xf420('0x32')][_0xf420('0x2b')]);});_[_0xf420('0x6c')](_0x21eb61[_0xf420('0x65')][_0xf420('0x3a')],function(_0x406753){return _0x406753[_0xf420('0x6d')]===_0xf420('0x6e');});return{'count':_0x21eb61['result'][_0xf420('0x3a')][_0xf420('0x3b')],'rows':_[_0xf420('0x2e')](_0x21eb61[_0xf420('0x65')][_0xf420('0x3a')],function(_0x546d19){return{'id':_0x546d19[_0xf420('0x2b')],'name':_0x546d19[_0xf420('0x6f')],'custom':_['startsWith'](_0x546d19[_0xf420('0x2b')],_0xf420('0x70'))?!![]:![],'options':_0x546d19['type'][_0xf420('0x2b')]===_0xf420('0x71')&&_0x546d19[_0xf420('0x32')][_0xf420('0x72')]['length']>0x0?_['map'](_0x546d19[_0xf420('0x32')][_0xf420('0x72')],function(_0x1adc0b){return{'name':_0x1adc0b['label'],'value':_0x1adc0b[_0xf420('0x73')]};}):[]};})};}})[_0xf420('0x27')](respondWithResult(_0x47884c,null))[_0xf420('0x49')](function(_0x14fe46){console[_0xf420('0x74')](_0xf420('0x75')+_0x14fe46);var _0x2aee90=_0x5e8197['query'][_0xf420('0x76')]?0x1f4:_0x14fe46[_0xf420('0x77')]||0x1f4;logger['error'](_0xf420('0x78'),_0xf420('0x79'),_0x2aee90,JSON[_0xf420('0x7a')](_0x14fe46));delete _0x14fe46[_0xf420('0x2b')];if(_0x2aee90===0x191){_0x2aee90=0x190;}_0x47884c[_0xf420('0x1a')](_0x2aee90)[_0xf420('0x2c')](_0x5e8197['query']['test']?{'message':_0xf420('0x7b'),'statusCode':_0x14fe46[_0xf420('0x77')]}:_0x14fe46);});};
\ No newline at end of file
+var _0xad7b=['startsWith','cf_','picklist','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','limit','count','json','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','VtigerAccount','includeAll','include','rows','show','params','intersection','find','catch','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','result','token','sessionName','autogenerated','includes','remove','editable','label'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0xad7b,0x166));var _0xbad7=function(_0x20679b,_0x3aaede){_0x20679b=_0x20679b-0x0;var _0x171118=_0xad7b[_0x20679b];return _0x171118;};'use strict';var emlformat=require(_0xbad7('0x0'));var rimraf=require(_0xbad7('0x1'));var zipdir=require(_0xbad7('0x2'));var jsonpatch=require(_0xbad7('0x3'));var rp=require(_0xbad7('0x4'));var moment=require('moment');var BPromise=require(_0xbad7('0x5'));var Mustache=require('mustache');var util=require(_0xbad7('0x6'));var path=require(_0xbad7('0x7'));var sox=require(_0xbad7('0x8'));var csv=require(_0xbad7('0x9'));var ejs=require(_0xbad7('0xa'));var fs=require('fs');var fs_extra=require(_0xbad7('0xb'));var _=require(_0xbad7('0xc'));var squel=require(_0xbad7('0xd'));var crypto=require(_0xbad7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbad7('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbad7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbad7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbad7('0x12'));var hardwareService=require(_0xbad7('0x13'));var logger=require(_0xbad7('0x14'))(_0xbad7('0x15'));var utils=require('../../config/utils');var config=require(_0xbad7('0x16'));var licenseUtil=require(_0xbad7('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x11d3ba,_0xcd8e13){_0xcd8e13=_0xcd8e13||0xcc;return function(_0xe419a3){if(_0xe419a3){return _0x11d3ba[_0xbad7('0x18')](_0xcd8e13);}return _0x11d3ba['status'](_0xcd8e13)[_0xbad7('0x19')]();};}function respondWithResult(_0x84445,_0x5f5ce4){_0x5f5ce4=_0x5f5ce4||0xc8;return function(_0x16fdc4){if(_0x16fdc4){return _0x84445[_0xbad7('0x1a')](_0x5f5ce4)['json'](_0x16fdc4);}};}function respondWithFilteredResult(_0x4737c0,_0x4a4ab0){return function(_0x5055f2){if(_0x5055f2){var _0x2e07d3=typeof _0x4a4ab0[_0xbad7('0x1b')]==='undefined'&&typeof _0x4a4ab0[_0xbad7('0x1c')]==='undefined';var _0xfd761f=_0x5055f2['count'];var _0x1f76e3=_0x2e07d3?0x0:_0x4a4ab0[_0xbad7('0x1b')];var _0x3a8747=_0x2e07d3?_0x5055f2[_0xbad7('0x1d')]:_0x4a4ab0[_0xbad7('0x1b')]+_0x4a4ab0[_0xbad7('0x1c')];var _0x427503;if(_0x3a8747>=_0xfd761f){_0x3a8747=_0xfd761f;_0x427503=0xc8;}else{_0x427503=0xce;}_0x4737c0['status'](_0x427503);return _0x4737c0['set']('Content-Range',_0x1f76e3+'-'+_0x3a8747+'/'+_0xfd761f)[_0xbad7('0x1e')](_0x5055f2);}return null;};}function patchUpdates(_0x3824e7){return function(_0x367461){try{jsonpatch[_0xbad7('0x1f')](_0x367461,_0x3824e7,!![]);}catch(_0x4eb046){return BPromise[_0xbad7('0x20')](_0x4eb046);}return _0x367461[_0xbad7('0x21')]();};}function saveUpdates(_0x2d4aa4,_0x11149b){return function(_0x19b3d1){if(_0x19b3d1){return _0x19b3d1[_0xbad7('0x22')](_0x2d4aa4)[_0xbad7('0x23')](function(_0x8dee50){return _0x8dee50;});}return null;};}function removeEntity(_0x4b06ba,_0x24a227){return function(_0x239c9a){if(_0x239c9a){return _0x239c9a['destroy']()[_0xbad7('0x23')](function(){_0x4b06ba[_0xbad7('0x1a')](0xcc)[_0xbad7('0x19')]();});}};}function handleEntityNotFound(_0x41645e,_0x5455aa){return function(_0x739cdc){if(!_0x739cdc){_0x41645e[_0xbad7('0x18')](0x194);}return _0x739cdc;};}function handleError(_0x520cf8,_0x189765){_0x189765=_0x189765||0x1f4;return function(_0x3d8e42){logger[_0xbad7('0x24')](_0x3d8e42[_0xbad7('0x25')]);if(_0x3d8e42[_0xbad7('0x26')]){delete _0x3d8e42[_0xbad7('0x26')];}_0x520cf8[_0xbad7('0x1a')](_0x189765)[_0xbad7('0x27')](_0x3d8e42);};}exports[_0xbad7('0x28')]=function(_0x4f36dc,_0x351aff){var _0x11eb21={},_0x2b6ac8={},_0x3adaea={'count':0x0,'rows':[]};var _0x3503f9=_[_0xbad7('0x29')](db['VtigerAccount'][_0xbad7('0x2a')],function(_0x5f1df1){return{'name':_0x5f1df1[_0xbad7('0x2b')],'type':_0x5f1df1[_0xbad7('0x2c')][_0xbad7('0x2d')]};});_0x2b6ac8[_0xbad7('0x2e')]=_[_0xbad7('0x29')](_0x3503f9,_0xbad7('0x26'));_0x2b6ac8['query']=_[_0xbad7('0x2f')](_0x4f36dc[_0xbad7('0x30')]);_0x2b6ac8[_0xbad7('0x31')]=_['intersection'](_0x2b6ac8[_0xbad7('0x2e')],_0x2b6ac8[_0xbad7('0x30')]);_0x11eb21[_0xbad7('0x32')]=_['intersection'](_0x2b6ac8[_0xbad7('0x2e')],qs['fields'](_0x4f36dc[_0xbad7('0x30')][_0xbad7('0x33')]));_0x11eb21['attributes']=_0x11eb21[_0xbad7('0x32')][_0xbad7('0x34')]?_0x11eb21['attributes']:_0x2b6ac8['model'];if(!_0x4f36dc[_0xbad7('0x30')][_0xbad7('0x35')](_0xbad7('0x36'))){_0x11eb21[_0xbad7('0x1c')]=qs[_0xbad7('0x1c')](_0x4f36dc['query']['limit']);_0x11eb21['offset']=qs[_0xbad7('0x1b')](_0x4f36dc[_0xbad7('0x30')][_0xbad7('0x1b')]);}_0x11eb21[_0xbad7('0x37')]=qs[_0xbad7('0x38')](_0x4f36dc[_0xbad7('0x30')]['sort']);_0x11eb21[_0xbad7('0x39')]=qs['filters'](_['pick'](_0x4f36dc[_0xbad7('0x30')],_0x2b6ac8['filters']),_0x3503f9);if(_0x4f36dc[_0xbad7('0x30')][_0xbad7('0x3a')]){_0x11eb21[_0xbad7('0x39')]=_[_0xbad7('0x3b')](_0x11eb21['where'],{'$or':_[_0xbad7('0x29')](_0x3503f9,function(_0x566176){if(_0x566176['type']!=='VIRTUAL'){var _0x291f35={};_0x291f35[_0x566176['name']]={'$like':'%'+_0x4f36dc[_0xbad7('0x30')][_0xbad7('0x3a')]+'%'};return _0x291f35;}})});}_0x11eb21=_[_0xbad7('0x3b')]({},_0x11eb21,_0x4f36dc[_0xbad7('0x3c')]);var _0x231e9f={'where':_0x11eb21[_0xbad7('0x39')]};return db[_0xbad7('0x3d')][_0xbad7('0x1d')](_0x231e9f)[_0xbad7('0x23')](function(_0xfd16fc){_0x3adaea[_0xbad7('0x1d')]=_0xfd16fc;if(_0x4f36dc[_0xbad7('0x30')][_0xbad7('0x3e')]){_0x11eb21[_0xbad7('0x3f')]=[{'all':!![]}];}return db[_0xbad7('0x3d')]['findAll'](_0x11eb21);})[_0xbad7('0x23')](function(_0x199238){_0x3adaea[_0xbad7('0x40')]=_0x199238;return _0x3adaea;})[_0xbad7('0x23')](respondWithFilteredResult(_0x351aff,_0x11eb21))['catch'](handleError(_0x351aff,null));};exports[_0xbad7('0x41')]=function(_0x22e0e3,_0x190b9b){var _0x2b4ccc={'raw':![],'where':{'id':_0x22e0e3[_0xbad7('0x42')]['id']}},_0x1f880f={};_0x1f880f['model']=_[_0xbad7('0x2f')](db['VtigerAccount']['rawAttributes']);_0x1f880f[_0xbad7('0x30')]=_[_0xbad7('0x2f')](_0x22e0e3[_0xbad7('0x30')]);_0x1f880f['filters']=_[_0xbad7('0x43')](_0x1f880f[_0xbad7('0x2e')],_0x1f880f[_0xbad7('0x30')]);_0x2b4ccc[_0xbad7('0x32')]=_[_0xbad7('0x43')](_0x1f880f[_0xbad7('0x2e')],qs[_0xbad7('0x33')](_0x22e0e3[_0xbad7('0x30')][_0xbad7('0x33')]));_0x2b4ccc[_0xbad7('0x32')]=_0x2b4ccc[_0xbad7('0x32')][_0xbad7('0x34')]?_0x2b4ccc[_0xbad7('0x32')]:_0x1f880f[_0xbad7('0x2e')];if(_0x22e0e3[_0xbad7('0x30')][_0xbad7('0x3e')]){_0x2b4ccc[_0xbad7('0x3f')]=[{'all':!![]}];}_0x2b4ccc=_['merge']({},_0x2b4ccc,_0x22e0e3[_0xbad7('0x3c')]);return db[_0xbad7('0x3d')][_0xbad7('0x44')](_0x2b4ccc)[_0xbad7('0x23')](handleEntityNotFound(_0x190b9b,null))[_0xbad7('0x23')](respondWithResult(_0x190b9b,null))[_0xbad7('0x45')](handleError(_0x190b9b,null));};exports[_0xbad7('0x46')]=function(_0x219bce,_0x3568ab){return db[_0xbad7('0x3d')][_0xbad7('0x46')](_0x219bce[_0xbad7('0x47')],{})[_0xbad7('0x23')](respondWithResult(_0x3568ab,0xc9))['catch'](handleError(_0x3568ab,null));};exports['update']=function(_0x17da81,_0x37de5c){if(_0x17da81[_0xbad7('0x47')]['id']){delete _0x17da81[_0xbad7('0x47')]['id'];}return db[_0xbad7('0x3d')][_0xbad7('0x44')]({'where':{'id':_0x17da81['params']['id']}})[_0xbad7('0x23')](handleEntityNotFound(_0x37de5c,null))['then'](saveUpdates(_0x17da81[_0xbad7('0x47')],null))[_0xbad7('0x23')](respondWithResult(_0x37de5c,null))[_0xbad7('0x45')](handleError(_0x37de5c,null));};exports['destroy']=function(_0x26a20e,_0x49a72a){return db[_0xbad7('0x3d')][_0xbad7('0x44')]({'where':{'id':_0x26a20e[_0xbad7('0x42')]['id']}})[_0xbad7('0x23')](handleEntityNotFound(_0x49a72a,null))[_0xbad7('0x23')](removeEntity(_0x49a72a,null))[_0xbad7('0x45')](handleError(_0x49a72a,null));};exports[_0xbad7('0x48')]=function(_0x3a92f9,_0xf3fe97,_0x2ae3a7){var _0x4c2d28={};var _0x206c37={};var _0x286113;var _0x589479;return db[_0xbad7('0x3d')][_0xbad7('0x49')]({'where':{'id':_0x3a92f9['params']['id']}})[_0xbad7('0x23')](handleEntityNotFound(_0xf3fe97,null))[_0xbad7('0x23')](function(_0x42a63a){if(_0x42a63a){_0x286113=_0x42a63a;_0x206c37[_0xbad7('0x2e')]=_[_0xbad7('0x2f')](db[_0xbad7('0x4a')]['rawAttributes']);_0x206c37[_0xbad7('0x30')]=_[_0xbad7('0x2f')](_0x3a92f9[_0xbad7('0x30')]);_0x206c37[_0xbad7('0x31')]=_['intersection'](_0x206c37[_0xbad7('0x2e')],_0x206c37[_0xbad7('0x30')]);_0x4c2d28[_0xbad7('0x32')]=_[_0xbad7('0x43')](_0x206c37[_0xbad7('0x2e')],qs[_0xbad7('0x33')](_0x3a92f9['query'][_0xbad7('0x33')]));_0x4c2d28[_0xbad7('0x32')]=_0x4c2d28['attributes']['length']?_0x4c2d28[_0xbad7('0x32')]:_0x206c37['model'];_0x4c2d28[_0xbad7('0x37')]=qs[_0xbad7('0x38')](_0x3a92f9[_0xbad7('0x30')][_0xbad7('0x38')]);_0x4c2d28[_0xbad7('0x39')]=qs[_0xbad7('0x31')](_['pick'](_0x3a92f9[_0xbad7('0x30')],_0x206c37[_0xbad7('0x31')]));if(_0x3a92f9[_0xbad7('0x30')]['filter']){_0x4c2d28['where']=_[_0xbad7('0x3b')](_0x4c2d28[_0xbad7('0x39')],{'$or':_[_0xbad7('0x29')](_0x4c2d28[_0xbad7('0x32')],function(_0xa402e7){var _0x48baf1={};_0x48baf1[_0xa402e7]={'$like':'%'+_0x3a92f9[_0xbad7('0x30')]['filter']+'%'};return _0x48baf1;})});}_0x4c2d28=_[_0xbad7('0x3b')]({},_0x4c2d28,_0x3a92f9[_0xbad7('0x3c')]);return _0x286113['getConfigurations'](_0x4c2d28);}})['then'](function(_0x54f2e7){if(_0x54f2e7){_0x589479=_0x54f2e7[_0xbad7('0x34')];if(!_0x3a92f9[_0xbad7('0x30')][_0xbad7('0x35')](_0xbad7('0x36'))){_0x4c2d28[_0xbad7('0x1c')]=qs['limit'](_0x3a92f9[_0xbad7('0x30')]['limit']);_0x4c2d28[_0xbad7('0x1b')]=qs[_0xbad7('0x1b')](_0x3a92f9[_0xbad7('0x30')][_0xbad7('0x1b')]);}return _0x286113[_0xbad7('0x48')](_0x4c2d28);}})[_0xbad7('0x23')](function(_0x43b852){if(_0x43b852){return _0x43b852?{'count':_0x589479,'rows':_0x43b852}:null;}})[_0xbad7('0x23')](respondWithResult(_0xf3fe97,null))[_0xbad7('0x45')](handleError(_0xf3fe97,null));};exports[_0xbad7('0x4b')]=function(_0x122f01,_0x3dce90,_0x221614){if(_0x122f01[_0xbad7('0x47')]['id']){delete _0x122f01[_0xbad7('0x47')]['id'];}return db[_0xbad7('0x3d')][_0xbad7('0x49')]({'where':{'id':_0x122f01[_0xbad7('0x42')]['id']}})[_0xbad7('0x23')](handleEntityNotFound(_0x3dce90,null))['then'](function(_0x184d59){if(_0x184d59){_0x122f01[_0xbad7('0x47')][_0xbad7('0x4c')]=_0x184d59['id'];_0x122f01[_0xbad7('0x47')][_0xbad7('0x4d')]=integrations[_0xbad7('0x4e')](_0x122f01[_0xbad7('0x47')][_0xbad7('0x4f')],_0x122f01[_0xbad7('0x47')][_0xbad7('0x2c')]);_0x122f01[_0xbad7('0x47')][_0xbad7('0x50')]=integrations[_0xbad7('0x51')](_0x122f01['body'][_0xbad7('0x4f')],_0x122f01[_0xbad7('0x47')]['type']);return db[_0xbad7('0x4a')][_0xbad7('0x46')](_0x122f01[_0xbad7('0x47')],{'include':[{'model':db[_0xbad7('0x52')],'as':'Subjects'},{'model':db[_0xbad7('0x52')],'as':'Descriptions'}]});}return null;})[_0xbad7('0x23')](respondWithResult(_0x3dce90,null))[_0xbad7('0x45')](handleError(_0x3dce90,null));};var md5=require(_0xbad7('0x53'));exports[_0xbad7('0x54')]=function(_0x462f2a,_0x12af39,_0x133c7c){var _0x34dea0=null;var _0x1397c4=null;var _0x2efb09=null;var _0x172b0c=null;var _0x3df572='';return db[_0xbad7('0x3d')][_0xbad7('0x49')]({'where':{'id':_0x462f2a['params']['id']},'attributes':['id','name',_0xbad7('0x55'),_0xbad7('0x56'),_0xbad7('0x57'),_0xbad7('0x58'),'serverUrl',_0xbad7('0x59')]})['then'](handleEntityNotFound(_0x12af39,null))['then'](function(_0x111ff8){if(_0x111ff8){_0x34dea0=_0x111ff8[_0xbad7('0x55')];_0x1397c4=_0x111ff8['accessKey'];_0x2efb09=_0x111ff8[_0xbad7('0x57')];_0x3df572=_0x111ff8[_0xbad7('0x58')];var _0x40e0fd=_0x3df572[_0xbad7('0x5a')](-0x1);if(_0x40e0fd==='/'){_0x3df572=_0x3df572[_0xbad7('0x5b')](0x0,_0x3df572[_0xbad7('0x5c')](_0x40e0fd));}_0x172b0c=util['format'](_0xbad7('0x5d'),_0x3df572);var _0x453c80={'method':_0xbad7('0x5e'),'uri':_0x172b0c,'qs':{'operation':_0xbad7('0x5f'),'username':_0x111ff8[_0xbad7('0x55')]},'json':!![]};return rp(_0x453c80);}})[_0xbad7('0x23')](function(_0x242a7e){if(_0x242a7e[_0xbad7('0x60')]){var _0x204498={'method':_0xbad7('0x61'),'uri':_0x172b0c,'form':{'operation':'login','username':_0x34dea0,'accessKey':md5(_0x242a7e[_0xbad7('0x62')][_0xbad7('0x63')]+_0x1397c4)},'json':!![]};return rp(_0x204498);}})['then'](function(_0x148670){if(_0x148670[_0xbad7('0x60')]){var _0x4beb47={'method':_0xbad7('0x5e'),'uri':_0x172b0c,'qs':{'operation':'describe','username':_0x34dea0,'sessionName':_0x148670[_0xbad7('0x62')][_0xbad7('0x64')],'elementType':_0x2efb09},'json':!![]};return rp(_0x4beb47);}})[_0xbad7('0x23')](function(_0x9a726c){if(_0x9a726c[_0xbad7('0x60')]){var _0xf34dbe=[_0xbad7('0x65'),'reference','owner'];_['remove'](_0x9a726c[_0xbad7('0x62')][_0xbad7('0x33')],function(_0x4a03fa){return _0xf34dbe[_0xbad7('0x66')](_0x4a03fa[_0xbad7('0x2c')][_0xbad7('0x26')]);});_[_0xbad7('0x67')](_0x9a726c[_0xbad7('0x62')][_0xbad7('0x33')],function(_0x59b67c){return _0x59b67c[_0xbad7('0x68')]==='false';});return{'count':_0x9a726c['result'][_0xbad7('0x33')][_0xbad7('0x34')],'rows':_['map'](_0x9a726c[_0xbad7('0x62')][_0xbad7('0x33')],function(_0x1def26){return{'id':_0x1def26[_0xbad7('0x26')],'name':_0x1def26[_0xbad7('0x69')],'custom':_[_0xbad7('0x6a')](_0x1def26[_0xbad7('0x26')],_0xbad7('0x6b'))?!![]:![],'options':_0x1def26[_0xbad7('0x2c')]['name']===_0xbad7('0x6c')&&_0x1def26[_0xbad7('0x2c')]['picklistValues'][_0xbad7('0x34')]>0x0?_[_0xbad7('0x29')](_0x1def26['type'][_0xbad7('0x6d')],function(_0x1a8b93){return{'name':_0x1a8b93['label'],'value':_0x1a8b93[_0xbad7('0x6e')]};}):[]};})};}})[_0xbad7('0x23')](respondWithResult(_0x12af39,null))[_0xbad7('0x45')](function(_0x44fb38){console[_0xbad7('0x6f')]('vTiger\x20error:\x20'+_0x44fb38);var _0x266095=_0x462f2a[_0xbad7('0x30')][_0xbad7('0x70')]?0x1f4:_0x44fb38[_0xbad7('0x71')]||0x1f4;logger['error'](_0xbad7('0x72'),_0xbad7('0x54'),_0x266095,JSON[_0xbad7('0x73')](_0x44fb38));delete _0x44fb38[_0xbad7('0x26')];if(_0x266095===0x191){_0x266095=0x190;}_0x12af39['status'](_0x266095)['send'](_0x462f2a[_0xbad7('0x30')][_0xbad7('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x44fb38[_0xbad7('0x71')]}:_0x44fb38);});};
\ No newline at end of file
index 8d57bf3..7793722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x002a=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0x002a,0x132));var _0xa002=function(_0x445b56,_0xb279a6){_0x445b56=_0x445b56-0x0;var _0x43c94e=_0x002a[_0x445b56];return _0x43c94e;};'use strict';var _=require(_0xa002('0x0'));var util=require(_0xa002('0x1'));var logger=require(_0xa002('0x2'))(_0xa002('0x3'));var moment=require('moment');var BPromise=require(_0xa002('0x4'));var rp=require(_0xa002('0x5'));var fs=require('fs');var path=require(_0xa002('0x6'));var rimraf=require(_0xa002('0x7'));var config=require(_0xa002('0x8'));var attributes=require(_0xa002('0x9'));var integrations=require(_0xa002('0xa'));module[_0xa002('0xb')]=function(_0x4327f3,_0x557fb2){return _0x4327f3[_0xa002('0xc')]('VtigerAccount',attributes,{'tableName':_0xa002('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1680=['request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','moment'];(function(_0x30259d,_0x4285d9){var _0x1c3ebb=function(_0x1b5ceb){while(--_0x1b5ceb){_0x30259d['push'](_0x30259d['shift']());}};_0x1c3ebb(++_0x4285d9);}(_0x1680,0xd9));var _0x0168=function(_0x56eb70,_0x2bd75c){_0x56eb70=_0x56eb70-0x0;var _0x47f1fe=_0x1680[_0x56eb70];return _0x47f1fe;};'use strict';var _=require('lodash');var util=require(_0x0168('0x0'));var logger=require(_0x0168('0x1'))(_0x0168('0x2'));var moment=require(_0x0168('0x3'));var BPromise=require('bluebird');var rp=require(_0x0168('0x4'));var fs=require('fs');var path=require(_0x0168('0x5'));var rimraf=require(_0x0168('0x6'));var config=require(_0x0168('0x7'));var attributes=require(_0x0168('0x8'));var integrations=require(_0x0168('0x9'));module[_0x0168('0xa')]=function(_0x4a2f04,_0x56c361){return _0x4a2f04['define'](_0x0168('0xb'),attributes,{'tableName':_0x0168('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e170e4e..9f82bfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7b4=['request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetVtigerAccount','find','ShowVtigerAccount','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x41f6f0,_0x37e45f){var _0x50db23=function(_0x1fc7c5){while(--_0x1fc7c5){_0x41f6f0['push'](_0x41f6f0['shift']());}};_0x50db23(++_0x37e45f);}(_0xf7b4,0x152));var _0x4f7b=function(_0x5ca867,_0x2374b5){_0x5ca867=_0x5ca867-0x0;var _0x2a17dd=_0xf7b4[_0x5ca867];return _0x2a17dd;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ad135,_0x173784,_0x351036){return new BPromise(function(_0x36ea9c,_0x3ef6e1){return client[_0x4f7b('0xa')](_0x3ad135,_0x351036)['then'](function(_0x433563){logger[_0x4f7b('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x173784,_0x4f7b('0xc'));logger[_0x4f7b('0xd')](_0x4f7b('0xe'),_0x173784,_0x4f7b('0xc'),JSON[_0x4f7b('0xf')](_0x433563));if(_0x433563['error']){if(_0x433563[_0x4f7b('0x10')]['code']===0x1f4){logger['error'](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x3ef6e1(_0x433563[_0x4f7b('0x10')]['message']);}logger[_0x4f7b('0x10')](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x36ea9c(_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);}else{logger[_0x4f7b('0xb')](_0x4f7b('0x11'),_0x173784,_0x4f7b('0xc'));_0x36ea9c(_0x433563[_0x4f7b('0x13')][_0x4f7b('0x12')]);}})[_0x4f7b('0x14')](function(_0x50a161){logger[_0x4f7b('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x173784,_0x50a161);_0x3ef6e1(_0x50a161);});});}exports['GetVtigerAccount']=function(_0x24e5cf){var _0x3813da=this;return new Promise(function(_0x519d90,_0x2b34c9){return db[_0x4f7b('0x15')][_0x4f7b('0x16')]({'raw':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf['options'][_0x4f7b('0x18')]===undefined?!![]:![]:!![],'where':_0x24e5cf['options']?_0x24e5cf[_0x4f7b('0x17')][_0x4f7b('0x19')]||null:null,'attributes':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf[_0x4f7b('0x17')][_0x4f7b('0x1a')]||null:null,'limit':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf[_0x4f7b('0x17')][_0x4f7b('0x1b')]||null:null,'include':_0x24e5cf[_0x4f7b('0x17')]?_0x24e5cf['options'][_0x4f7b('0x1c')]?_[_0x4f7b('0x1d')](_0x24e5cf[_0x4f7b('0x17')]['include'],function(_0x150f57){return{'model':db[_0x150f57[_0x4f7b('0x1e')]],'as':_0x150f57['as'],'attributes':_0x150f57['attributes'],'include':_0x150f57[_0x4f7b('0x1c')]?_['map'](_0x150f57[_0x4f7b('0x1c')],function(_0x2429be){return{'model':db[_0x2429be[_0x4f7b('0x1e')]],'as':_0x2429be['as'],'attributes':_0x2429be[_0x4f7b('0x1a')],'include':_0x2429be[_0x4f7b('0x1c')]?_[_0x4f7b('0x1d')](_0x2429be[_0x4f7b('0x1c')],function(_0x3ad769){return{'model':db[_0x3ad769['model']],'as':_0x3ad769['as'],'attributes':_0x3ad769[_0x4f7b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4f7b('0x1f')](function(_0x311675){logger['info'](_0x4f7b('0x20'),_0x24e5cf);logger[_0x4f7b('0xd')](_0x4f7b('0x20'),_0x24e5cf,JSON[_0x4f7b('0xf')](_0x311675));_0x519d90(_0x311675);})[_0x4f7b('0x14')](function(_0x4ebffa){logger[_0x4f7b('0x10')](_0x4f7b('0x20'),_0x4ebffa[_0x4f7b('0x12')],_0x24e5cf);_0x2b34c9(_0x3813da['error'](0x1f4,_0x4ebffa[_0x4f7b('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x4e4828){var _0x1a2346=this;return new Promise(function(_0x52a5b1,_0x1aad4b){return db[_0x4f7b('0x15')][_0x4f7b('0x21')]({'raw':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x18')]===undefined?!![]:![]:!![],'where':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x19')]||null:null,'attributes':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x1a')]||null:null,'include':_0x4e4828[_0x4f7b('0x17')]?_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x1c')]?_[_0x4f7b('0x1d')](_0x4e4828[_0x4f7b('0x17')][_0x4f7b('0x1c')],function(_0x35f1ed){return{'model':db[_0x35f1ed[_0x4f7b('0x1e')]],'as':_0x35f1ed['as'],'attributes':_0x35f1ed[_0x4f7b('0x1a')],'include':_0x35f1ed[_0x4f7b('0x1c')]?_['map'](_0x35f1ed[_0x4f7b('0x1c')],function(_0x5127a2){return{'model':db[_0x5127a2[_0x4f7b('0x1e')]],'as':_0x5127a2['as'],'attributes':_0x5127a2[_0x4f7b('0x1a')],'include':_0x5127a2['include']?_[_0x4f7b('0x1d')](_0x5127a2[_0x4f7b('0x1c')],function(_0x1347b6){return{'model':db[_0x1347b6['model']],'as':_0x1347b6['as'],'attributes':_0x1347b6[_0x4f7b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4f7b('0x1f')](function(_0x446f6e){logger[_0x4f7b('0xb')](_0x4f7b('0x22'),_0x4e4828);logger[_0x4f7b('0xd')](_0x4f7b('0x22'),_0x4e4828,JSON['stringify'](_0x446f6e));_0x52a5b1(_0x446f6e);})[_0x4f7b('0x14')](function(_0x486187){logger[_0x4f7b('0x10')](_0x4f7b('0x22'),_0x486187[_0x4f7b('0x12')],_0x4e4828);_0x1aad4b(_0x1a2346['error'](0x1f4,_0x486187[_0x4f7b('0x12')]));});});};
\ No newline at end of file
+var _0x878f=['ShowVtigerAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','then','stringify'];(function(_0x3334d9,_0x218f07){var _0x3c8037=function(_0x253974){while(--_0x253974){_0x3334d9['push'](_0x3334d9['shift']());}};_0x3c8037(++_0x218f07);}(_0x878f,0x173));var _0xf878=function(_0x1aa337,_0x30db41){_0x1aa337=_0x1aa337-0x0;var _0x5dea78=_0x878f[_0x1aa337];return _0x5dea78;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var moment=require(_0xf878('0x1'));var BPromise=require(_0xf878('0x2'));var rs=require(_0xf878('0x3'));var fs=require('fs');var Redis=require(_0xf878('0x4'));var db=require(_0xf878('0x5'))['db'];var utils=require(_0xf878('0x6'));var logger=require(_0xf878('0x7'))(_0xf878('0x8'));var config=require(_0xf878('0x9'));var jayson=require(_0xf878('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c5f5c,_0x62b420,_0x59e564){return new BPromise(function(_0x52851e,_0x530767){return client[_0xf878('0xb')](_0x3c5f5c,_0x59e564)['then'](function(_0x4a9d79){logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));logger['debug'](_0xf878('0xf'),_0x62b420,_0xf878('0xe'),JSON['stringify'](_0x4a9d79));if(_0x4a9d79[_0xf878('0x10')]){if(_0x4a9d79['error'][_0xf878('0x11')]===0x1f4){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x4a9d79['error'][_0xf878('0x12')]);return _0x530767(_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);}logger['error'](_0xf878('0xd'),_0x62b420,_0x4a9d79[_0xf878('0x10')][_0xf878('0x12')]);return _0x52851e(_0x4a9d79['error']['message']);}else{logger[_0xf878('0xc')](_0xf878('0xd'),_0x62b420,_0xf878('0xe'));_0x52851e(_0x4a9d79[_0xf878('0x13')][_0xf878('0x12')]);}})[_0xf878('0x14')](function(_0x415056){logger[_0xf878('0x10')](_0xf878('0xd'),_0x62b420,_0x415056);_0x530767(_0x415056);});});}exports[_0xf878('0x15')]=function(_0x3b2e1b){var _0x47a91a=this;return new Promise(function(_0x2b2b54,_0x34ae59){return db[_0xf878('0x16')][_0xf878('0x17')]({'raw':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x19')]===undefined?!![]:![]:!![],'where':_0x3b2e1b['options']?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1a')]||null:null,'attributes':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b['options'][_0xf878('0x1b')]||null:null,'limit':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1c')]||null:null,'include':_0x3b2e1b[_0xf878('0x18')]?_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1d')]?_[_0xf878('0x1e')](_0x3b2e1b[_0xf878('0x18')][_0xf878('0x1d')],function(_0x45e61f){return{'model':db[_0x45e61f['model']],'as':_0x45e61f['as'],'attributes':_0x45e61f[_0xf878('0x1b')],'include':_0x45e61f['include']?_[_0xf878('0x1e')](_0x45e61f[_0xf878('0x1d')],function(_0x35b3b4){return{'model':db[_0x35b3b4[_0xf878('0x1f')]],'as':_0x35b3b4['as'],'attributes':_0x35b3b4[_0xf878('0x1b')],'include':_0x35b3b4['include']?_['map'](_0x35b3b4['include'],function(_0x242926){return{'model':db[_0x242926[_0xf878('0x1f')]],'as':_0x242926['as'],'attributes':_0x242926[_0xf878('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfa3e11){logger[_0xf878('0xc')](_0xf878('0x15'),_0x3b2e1b);logger[_0xf878('0x20')](_0xf878('0x15'),_0x3b2e1b,JSON['stringify'](_0xfa3e11));_0x2b2b54(_0xfa3e11);})['catch'](function(_0x9a127d){logger[_0xf878('0x10')]('GetVtigerAccount',_0x9a127d[_0xf878('0x12')],_0x3b2e1b);_0x34ae59(_0x47a91a['error'](0x1f4,_0x9a127d[_0xf878('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x2c61c1){var _0x49e66a=this;return new Promise(function(_0x2630fb,_0x48b151){return db[_0xf878('0x16')][_0xf878('0x21')]({'raw':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1[_0xf878('0x18')][_0xf878('0x19')]===undefined?!![]:![]:!![],'where':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1['options'][_0xf878('0x1a')]||null:null,'attributes':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1[_0xf878('0x18')][_0xf878('0x1b')]||null:null,'include':_0x2c61c1[_0xf878('0x18')]?_0x2c61c1['options'][_0xf878('0x1d')]?_[_0xf878('0x1e')](_0x2c61c1['options'][_0xf878('0x1d')],function(_0xd1ad51){return{'model':db[_0xd1ad51[_0xf878('0x1f')]],'as':_0xd1ad51['as'],'attributes':_0xd1ad51[_0xf878('0x1b')],'include':_0xd1ad51[_0xf878('0x1d')]?_['map'](_0xd1ad51[_0xf878('0x1d')],function(_0x1b09de){return{'model':db[_0x1b09de[_0xf878('0x1f')]],'as':_0x1b09de['as'],'attributes':_0x1b09de[_0xf878('0x1b')],'include':_0x1b09de['include']?_[_0xf878('0x1e')](_0x1b09de['include'],function(_0x4ce1e7){return{'model':db[_0x4ce1e7[_0xf878('0x1f')]],'as':_0x4ce1e7['as'],'attributes':_0x4ce1e7[_0xf878('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf878('0x22')](function(_0x105416){logger[_0xf878('0xc')]('ShowVtigerAccount',_0x2c61c1);logger[_0xf878('0x20')]('ShowVtigerAccount',_0x2c61c1,JSON[_0xf878('0x23')](_0x105416));_0x2630fb(_0x105416);})[_0xf878('0x14')](function(_0x4d4aff){logger[_0xf878('0x10')](_0xf878('0x24'),_0x4d4aff['message'],_0x2c61c1);_0x48b151(_0x49e66a[_0xf878('0x10')](0x1f4,_0x4d4aff[_0xf878('0x12')]));});});};
\ No newline at end of file
index 69f248a..303c70d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55bf=['isAuthenticated','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','/:id','delete','exports','multer','path','fs-extra','../../components/interaction/service','../../config/environment','get','index'];(function(_0x4639d7,_0x4bec9d){var _0x29d4b6=function(_0x50a420){while(--_0x50a420){_0x4639d7['push'](_0x4639d7['shift']());}};_0x29d4b6(++_0x4bec9d);}(_0x55bf,0x13d));var _0xf55b=function(_0x3ecc0c,_0x27ccd9){_0x3ecc0c=_0x3ecc0c-0x0;var _0x5c4950=_0x55bf[_0x3ecc0c];return _0x5c4950;};'use strict';var multer=require(_0xf55b('0x0'));var util=require('util');var path=require(_0xf55b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xf55b('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xf55b('0x3'));var config=require(_0xf55b('0x4'));var controller=require('./intVtigerConfiguration.controller');router[_0xf55b('0x5')]('/',auth['isAuthenticated'](),controller[_0xf55b('0x6')]);router[_0xf55b('0x5')]('/:id',auth[_0xf55b('0x7')](),controller['show']);router['get'](_0xf55b('0x8'),auth[_0xf55b('0x7')](),controller[_0xf55b('0x9')]);router['get']('/:id/subjects',auth[_0xf55b('0x7')](),controller[_0xf55b('0xa')]);router[_0xf55b('0x5')]('/:id/descriptions',auth[_0xf55b('0x7')](),controller[_0xf55b('0xb')]);router[_0xf55b('0xc')]('/',auth[_0xf55b('0x7')](),controller[_0xf55b('0xd')]);router[_0xf55b('0xe')](_0xf55b('0xf'),auth[_0xf55b('0x7')](),controller['update']);router[_0xf55b('0x10')](_0xf55b('0xf'),auth[_0xf55b('0x7')](),controller['destroy']);module[_0xf55b('0x11')]=router;
\ No newline at end of file
+var _0x3399=['getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x3399,0x7c));var _0x9339=function(_0x3abf23,_0x5cc4e0){_0x3abf23=_0x3abf23-0x0;var _0x220f6f=_0x3399[_0x3abf23];return _0x220f6f;};'use strict';var multer=require('multer');var util=require(_0x9339('0x0'));var path=require('path');var timeout=require(_0x9339('0x1'));var express=require('express');var router=express[_0x9339('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9339('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9339('0x4'));var controller=require(_0x9339('0x5'));router[_0x9339('0x6')]('/',auth['isAuthenticated'](),controller[_0x9339('0x7')]);router['get'](_0x9339('0x8'),auth[_0x9339('0x9')](),controller[_0x9339('0xa')]);router[_0x9339('0x6')](_0x9339('0xb'),auth[_0x9339('0x9')](),controller[_0x9339('0xc')]);router[_0x9339('0x6')](_0x9339('0xd'),auth[_0x9339('0x9')](),controller[_0x9339('0xe')]);router[_0x9339('0x6')](_0x9339('0xf'),auth['isAuthenticated'](),controller[_0x9339('0x10')]);router[_0x9339('0x11')]('/',auth[_0x9339('0x9')](),controller[_0x9339('0x12')]);router[_0x9339('0x13')](_0x9339('0x8'),auth[_0x9339('0x9')](),controller[_0x9339('0x14')]);router['delete'](_0x9339('0x8'),auth[_0x9339('0x9')](),controller[_0x9339('0x15')]);module[_0x9339('0x16')]=router;
\ No newline at end of file
index 00f42a2..5f9dd80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x539c=['STRING','sequelize','exports'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x539c,0x1e1));var _0xc539=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x539c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc539('0x0'));module[_0xc539('0x1')]={'name':{'type':Sequelize[_0xc539('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x83ab=['STRING','sequelize','exports'];(function(_0xcc6dd8,_0x596717){var _0x58b5ab=function(_0x213832){while(--_0x213832){_0xcc6dd8['push'](_0xcc6dd8['shift']());}};_0x58b5ab(++_0x596717);}(_0x83ab,0x169));var _0xb83a=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0x83ab[_0x54a2e4];return _0x4742d0;};'use strict';var Sequelize=require(_0xb83a('0x0'));module[_0xb83a('0x1')]={'name':{'type':Sequelize[_0xb83a('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 132d2a7..98d8d73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0582=['filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','include','rows','catch','show','params','keys','VtigerConfiguration','rawAttributes','includeAll','find','create','body','update','destroy','getFields','VtigerField','options','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','then','error','stack','name','send','index','map','fieldName','key','model','query'];(function(_0x244a0b,_0x5b39a9){var _0x5f18c4=function(_0x3cc2ed){while(--_0x3cc2ed){_0x244a0b['push'](_0x244a0b['shift']());}};_0x5f18c4(++_0x5b39a9);}(_0x0582,0x150));var _0x2058=function(_0x2dc51e,_0x333c69){_0x2dc51e=_0x2dc51e-0x0;var _0x5dbf44=_0x0582[_0x2dc51e];return _0x5dbf44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2058('0x0'));var zipdir=require(_0x2058('0x1'));var jsonpatch=require(_0x2058('0x2'));var rp=require(_0x2058('0x3'));var moment=require(_0x2058('0x4'));var BPromise=require(_0x2058('0x5'));var Mustache=require(_0x2058('0x6'));var util=require(_0x2058('0x7'));var path=require(_0x2058('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2058('0x9'));var fs=require('fs');var fs_extra=require(_0x2058('0xa'));var _=require(_0x2058('0xb'));var squel=require(_0x2058('0xc'));var crypto=require(_0x2058('0xd'));var jsforce=require(_0x2058('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2058('0xf'));var authService=require(_0x2058('0x10'));var qs=require(_0x2058('0x11'));var as=require(_0x2058('0x12'));var hardwareService=require(_0x2058('0x13'));var logger=require(_0x2058('0x14'))(_0x2058('0x15'));var utils=require(_0x2058('0x16'));var config=require(_0x2058('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x191782,_0x4e4037){_0x4e4037=_0x4e4037||0xcc;return function(_0x16970e){if(_0x16970e){return _0x191782[_0x2058('0x18')](_0x4e4037);}return _0x191782[_0x2058('0x19')](_0x4e4037)[_0x2058('0x1a')]();};}function respondWithResult(_0xa2058c,_0x331500){_0x331500=_0x331500||0xc8;return function(_0x4beea5){if(_0x4beea5){return _0xa2058c['status'](_0x331500)[_0x2058('0x1b')](_0x4beea5);}};}function respondWithFilteredResult(_0xd3138a,_0x47b9ea){return function(_0x4044c4){if(_0x4044c4){var _0x2b4ce5=typeof _0x47b9ea['offset']==='undefined'&&typeof _0x47b9ea['limit']==='undefined';var _0xb8bbfc=_0x4044c4[_0x2058('0x1c')];var _0x133bb3=_0x2b4ce5?0x0:_0x47b9ea['offset'];var _0x45c5d6=_0x2b4ce5?_0x4044c4[_0x2058('0x1c')]:_0x47b9ea[_0x2058('0x1d')]+_0x47b9ea[_0x2058('0x1e')];var _0x1faed6;if(_0x45c5d6>=_0xb8bbfc){_0x45c5d6=_0xb8bbfc;_0x1faed6=0xc8;}else{_0x1faed6=0xce;}_0xd3138a[_0x2058('0x19')](_0x1faed6);return _0xd3138a['set']('Content-Range',_0x133bb3+'-'+_0x45c5d6+'/'+_0xb8bbfc)[_0x2058('0x1b')](_0x4044c4);}return null;};}function patchUpdates(_0x36ed5e){return function(_0x5988c7){try{jsonpatch[_0x2058('0x1f')](_0x5988c7,_0x36ed5e,!![]);}catch(_0x24b270){return BPromise[_0x2058('0x20')](_0x24b270);}return _0x5988c7['save']();};}function saveUpdates(_0x2e807c,_0x17d4af){return function(_0x55a370){if(_0x55a370){return _0x55a370['update'](_0x2e807c)[_0x2058('0x21')](function(_0xc77c3e){return _0xc77c3e;});}return null;};}function removeEntity(_0x5f14b5,_0x23ffff){return function(_0x590284){if(_0x590284){return _0x590284['destroy']()['then'](function(){_0x5f14b5[_0x2058('0x19')](0xcc)[_0x2058('0x1a')]();});}};}function handleEntityNotFound(_0x482110,_0x689289){return function(_0x564109){if(!_0x564109){_0x482110[_0x2058('0x18')](0x194);}return _0x564109;};}function handleError(_0x5513b9,_0x117449){_0x117449=_0x117449||0x1f4;return function(_0x52c65a){logger[_0x2058('0x22')](_0x52c65a[_0x2058('0x23')]);if(_0x52c65a[_0x2058('0x24')]){delete _0x52c65a[_0x2058('0x24')];}_0x5513b9[_0x2058('0x19')](_0x117449)[_0x2058('0x25')](_0x52c65a);};}exports[_0x2058('0x26')]=function(_0x574383,_0x52214b){var _0x20a835={},_0x157d13={},_0x2a780b={'count':0x0,'rows':[]};var _0x5aed94=_[_0x2058('0x27')](db['VtigerConfiguration']['rawAttributes'],function(_0x4399b3){return{'name':_0x4399b3[_0x2058('0x28')],'type':_0x4399b3['type'][_0x2058('0x29')]};});_0x157d13[_0x2058('0x2a')]=_[_0x2058('0x27')](_0x5aed94,'name');_0x157d13['query']=_['keys'](_0x574383[_0x2058('0x2b')]);_0x157d13[_0x2058('0x2c')]=_[_0x2058('0x2d')](_0x157d13[_0x2058('0x2a')],_0x157d13[_0x2058('0x2b')]);_0x20a835['attributes']=_[_0x2058('0x2d')](_0x157d13[_0x2058('0x2a')],qs[_0x2058('0x2e')](_0x574383[_0x2058('0x2b')][_0x2058('0x2e')]));_0x20a835[_0x2058('0x2f')]=_0x20a835[_0x2058('0x2f')][_0x2058('0x30')]?_0x20a835[_0x2058('0x2f')]:_0x157d13[_0x2058('0x2a')];if(!_0x574383[_0x2058('0x2b')]['hasOwnProperty'](_0x2058('0x31'))){_0x20a835['limit']=qs[_0x2058('0x1e')](_0x574383[_0x2058('0x2b')]['limit']);_0x20a835[_0x2058('0x1d')]=qs[_0x2058('0x1d')](_0x574383[_0x2058('0x2b')][_0x2058('0x1d')]);}_0x20a835[_0x2058('0x32')]=qs[_0x2058('0x33')](_0x574383[_0x2058('0x2b')][_0x2058('0x33')]);_0x20a835['where']=qs[_0x2058('0x2c')](_[_0x2058('0x34')](_0x574383[_0x2058('0x2b')],_0x157d13[_0x2058('0x2c')]),_0x5aed94);if(_0x574383[_0x2058('0x2b')][_0x2058('0x35')]){_0x20a835[_0x2058('0x36')]=_[_0x2058('0x37')](_0x20a835[_0x2058('0x36')],{'$or':_[_0x2058('0x27')](_0x5aed94,function(_0x385c5d){if(_0x385c5d['type']!=='VIRTUAL'){var _0x27a451={};_0x27a451[_0x385c5d[_0x2058('0x24')]]={'$like':'%'+_0x574383[_0x2058('0x2b')]['filter']+'%'};return _0x27a451;}})});}_0x20a835=_[_0x2058('0x37')]({},_0x20a835,_0x574383['options']);var _0x26e93f={'where':_0x20a835[_0x2058('0x36')]};return db['VtigerConfiguration'][_0x2058('0x1c')](_0x26e93f)[_0x2058('0x21')](function(_0x32ee03){_0x2a780b[_0x2058('0x1c')]=_0x32ee03;if(_0x574383[_0x2058('0x2b')]['includeAll']){_0x20a835[_0x2058('0x38')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x20a835);})[_0x2058('0x21')](function(_0x45b621){_0x2a780b[_0x2058('0x39')]=_0x45b621;return _0x2a780b;})['then'](respondWithFilteredResult(_0x52214b,_0x20a835))[_0x2058('0x3a')](handleError(_0x52214b,null));};exports[_0x2058('0x3b')]=function(_0x397a5b,_0x420eb5){var _0x2d11e6={'raw':![],'where':{'id':_0x397a5b[_0x2058('0x3c')]['id']}},_0xfcf0d2={};_0xfcf0d2[_0x2058('0x2a')]=_[_0x2058('0x3d')](db[_0x2058('0x3e')][_0x2058('0x3f')]);_0xfcf0d2['query']=_[_0x2058('0x3d')](_0x397a5b['query']);_0xfcf0d2[_0x2058('0x2c')]=_['intersection'](_0xfcf0d2['model'],_0xfcf0d2[_0x2058('0x2b')]);_0x2d11e6[_0x2058('0x2f')]=_[_0x2058('0x2d')](_0xfcf0d2[_0x2058('0x2a')],qs[_0x2058('0x2e')](_0x397a5b['query'][_0x2058('0x2e')]));_0x2d11e6['attributes']=_0x2d11e6[_0x2058('0x2f')]['length']?_0x2d11e6[_0x2058('0x2f')]:_0xfcf0d2['model'];if(_0x397a5b[_0x2058('0x2b')][_0x2058('0x40')]){_0x2d11e6[_0x2058('0x38')]=[{'all':!![]}];}_0x2d11e6=_[_0x2058('0x37')]({},_0x2d11e6,_0x397a5b['options']);return db[_0x2058('0x3e')][_0x2058('0x41')](_0x2d11e6)[_0x2058('0x21')](handleEntityNotFound(_0x420eb5,null))[_0x2058('0x21')](respondWithResult(_0x420eb5,null))[_0x2058('0x3a')](handleError(_0x420eb5,null));};exports[_0x2058('0x42')]=function(_0x1cb77b,_0x33a3d0){return db[_0x2058('0x3e')][_0x2058('0x42')](_0x1cb77b[_0x2058('0x43')],{})[_0x2058('0x21')](respondWithResult(_0x33a3d0,0xc9))['catch'](handleError(_0x33a3d0,null));};exports[_0x2058('0x44')]=function(_0x5193c4,_0xb120ae){if(_0x5193c4[_0x2058('0x43')]['id']){delete _0x5193c4[_0x2058('0x43')]['id'];}return db[_0x2058('0x3e')][_0x2058('0x41')]({'where':{'id':_0x5193c4[_0x2058('0x3c')]['id']}})['then'](handleEntityNotFound(_0xb120ae,null))[_0x2058('0x21')](saveUpdates(_0x5193c4[_0x2058('0x43')],null))[_0x2058('0x21')](respondWithResult(_0xb120ae,null))[_0x2058('0x3a')](handleError(_0xb120ae,null));};exports[_0x2058('0x45')]=function(_0x9d63ba,_0x146563){return db['VtigerConfiguration'][_0x2058('0x41')]({'where':{'id':_0x9d63ba[_0x2058('0x3c')]['id']}})[_0x2058('0x21')](handleEntityNotFound(_0x146563,null))[_0x2058('0x21')](removeEntity(_0x146563,null))[_0x2058('0x3a')](handleError(_0x146563,null));};exports[_0x2058('0x46')]=function(_0x5bfec2,_0x88ebe9,_0x1ad2f){var _0x413a17={};var _0x36e6e7={};var _0x26fda0;var _0x39c41a;return db[_0x2058('0x3e')]['findOne']({'where':{'id':_0x5bfec2[_0x2058('0x3c')]['id']}})[_0x2058('0x21')](handleEntityNotFound(_0x88ebe9,null))[_0x2058('0x21')](function(_0xd2fdd4){if(_0xd2fdd4){_0x26fda0=_0xd2fdd4;_0x36e6e7[_0x2058('0x2a')]=_[_0x2058('0x3d')](db[_0x2058('0x47')][_0x2058('0x3f')]);_0x36e6e7[_0x2058('0x2b')]=_['keys'](_0x5bfec2[_0x2058('0x2b')]);_0x36e6e7[_0x2058('0x2c')]=_['intersection'](_0x36e6e7[_0x2058('0x2a')],_0x36e6e7[_0x2058('0x2b')]);_0x413a17['attributes']=_[_0x2058('0x2d')](_0x36e6e7[_0x2058('0x2a')],qs[_0x2058('0x2e')](_0x5bfec2['query'][_0x2058('0x2e')]));_0x413a17[_0x2058('0x2f')]=_0x413a17[_0x2058('0x2f')][_0x2058('0x30')]?_0x413a17[_0x2058('0x2f')]:_0x36e6e7[_0x2058('0x2a')];_0x413a17['order']=qs[_0x2058('0x33')](_0x5bfec2[_0x2058('0x2b')][_0x2058('0x33')]);_0x413a17['where']=qs[_0x2058('0x2c')](_[_0x2058('0x34')](_0x5bfec2['query'],_0x36e6e7[_0x2058('0x2c')]));if(_0x5bfec2[_0x2058('0x2b')]['filter']){_0x413a17['where']=_[_0x2058('0x37')](_0x413a17['where'],{'$or':_[_0x2058('0x27')](_0x413a17[_0x2058('0x2f')],function(_0x6d1684){var _0x3b6589={};_0x3b6589[_0x6d1684]={'$like':'%'+_0x5bfec2[_0x2058('0x2b')]['filter']+'%'};return _0x3b6589;})});}_0x413a17=_[_0x2058('0x37')]({},_0x413a17,_0x5bfec2[_0x2058('0x48')]);return _0x26fda0['getFields'](_0x413a17);}})[_0x2058('0x21')](function(_0x2571fa){if(_0x2571fa){_0x39c41a=_0x2571fa[_0x2058('0x30')];if(!_0x5bfec2[_0x2058('0x2b')][_0x2058('0x49')](_0x2058('0x31'))){_0x413a17[_0x2058('0x1e')]=qs['limit'](_0x5bfec2[_0x2058('0x2b')][_0x2058('0x1e')]);_0x413a17[_0x2058('0x1d')]=qs['offset'](_0x5bfec2[_0x2058('0x2b')][_0x2058('0x1d')]);}return _0x26fda0[_0x2058('0x46')](_0x413a17);}})[_0x2058('0x21')](function(_0x1d66cf){if(_0x1d66cf){return _0x1d66cf?{'count':_0x39c41a,'rows':_0x1d66cf}:null;}})[_0x2058('0x21')](respondWithResult(_0x88ebe9,null))[_0x2058('0x3a')](handleError(_0x88ebe9,null));};exports[_0x2058('0x4a')]=function(_0x4ace42,_0x21c7e0,_0x2bae68){var _0x1dbe1a={};var _0x15637d={};var _0xfb949b;var _0x26a000;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x4ace42['params']['id']}})['then'](handleEntityNotFound(_0x21c7e0,null))[_0x2058('0x21')](function(_0x5623ae){if(_0x5623ae){_0xfb949b=_0x5623ae;_0x15637d[_0x2058('0x2a')]=_['keys'](db[_0x2058('0x47')]['rawAttributes']);_0x15637d[_0x2058('0x2b')]=_['keys'](_0x4ace42[_0x2058('0x2b')]);_0x15637d['filters']=_[_0x2058('0x2d')](_0x15637d[_0x2058('0x2a')],_0x15637d[_0x2058('0x2b')]);_0x1dbe1a[_0x2058('0x2f')]=_[_0x2058('0x2d')](_0x15637d['model'],qs[_0x2058('0x2e')](_0x4ace42[_0x2058('0x2b')][_0x2058('0x2e')]));_0x1dbe1a[_0x2058('0x2f')]=_0x1dbe1a['attributes'][_0x2058('0x30')]?_0x1dbe1a[_0x2058('0x2f')]:_0x15637d[_0x2058('0x2a')];_0x1dbe1a['order']=qs[_0x2058('0x33')](_0x4ace42['query'][_0x2058('0x33')]);_0x1dbe1a[_0x2058('0x36')]=qs[_0x2058('0x2c')](_[_0x2058('0x34')](_0x4ace42[_0x2058('0x2b')],_0x15637d[_0x2058('0x2c')]));if(_0x4ace42['query'][_0x2058('0x35')]){_0x1dbe1a[_0x2058('0x36')]=_['merge'](_0x1dbe1a[_0x2058('0x36')],{'$or':_[_0x2058('0x27')](_0x1dbe1a[_0x2058('0x2f')],function(_0x4a9b8d){var _0x3eefbc={};_0x3eefbc[_0x4a9b8d]={'$like':'%'+_0x4ace42[_0x2058('0x2b')][_0x2058('0x35')]+'%'};return _0x3eefbc;})});}_0x1dbe1a=_[_0x2058('0x37')]({},_0x1dbe1a,_0x4ace42[_0x2058('0x48')]);return _0xfb949b[_0x2058('0x4a')](_0x1dbe1a);}})[_0x2058('0x21')](function(_0x19b419){if(_0x19b419){_0x26a000=_0x19b419[_0x2058('0x30')];if(!_0x4ace42[_0x2058('0x2b')]['hasOwnProperty'](_0x2058('0x31'))){_0x1dbe1a[_0x2058('0x1e')]=qs['limit'](_0x4ace42[_0x2058('0x2b')]['limit']);_0x1dbe1a[_0x2058('0x1d')]=qs[_0x2058('0x1d')](_0x4ace42[_0x2058('0x2b')]['offset']);}return _0xfb949b[_0x2058('0x4a')](_0x1dbe1a);}})['then'](function(_0x510d1c){if(_0x510d1c){return _0x510d1c?{'count':_0x26a000,'rows':_0x510d1c}:null;}})[_0x2058('0x21')](respondWithResult(_0x21c7e0,null))[_0x2058('0x3a')](handleError(_0x21c7e0,null));};exports['getDescriptions']=function(_0x27d297,_0x36ef18,_0x245456){var _0x33620a={};var _0x499ec3={};var _0x4ce724;var _0xa18ddc;return db[_0x2058('0x3e')]['findOne']({'where':{'id':_0x27d297[_0x2058('0x3c')]['id']}})[_0x2058('0x21')](handleEntityNotFound(_0x36ef18,null))[_0x2058('0x21')](function(_0x146399){if(_0x146399){_0x4ce724=_0x146399;_0x499ec3[_0x2058('0x2a')]=_[_0x2058('0x3d')](db[_0x2058('0x47')][_0x2058('0x3f')]);_0x499ec3[_0x2058('0x2b')]=_[_0x2058('0x3d')](_0x27d297['query']);_0x499ec3['filters']=_['intersection'](_0x499ec3[_0x2058('0x2a')],_0x499ec3['query']);_0x33620a[_0x2058('0x2f')]=_['intersection'](_0x499ec3[_0x2058('0x2a')],qs['fields'](_0x27d297[_0x2058('0x2b')][_0x2058('0x2e')]));_0x33620a['attributes']=_0x33620a[_0x2058('0x2f')][_0x2058('0x30')]?_0x33620a[_0x2058('0x2f')]:_0x499ec3['model'];_0x33620a[_0x2058('0x32')]=qs[_0x2058('0x33')](_0x27d297[_0x2058('0x2b')]['sort']);_0x33620a[_0x2058('0x36')]=qs[_0x2058('0x2c')](_['pick'](_0x27d297[_0x2058('0x2b')],_0x499ec3[_0x2058('0x2c')]));if(_0x27d297[_0x2058('0x2b')][_0x2058('0x35')]){_0x33620a[_0x2058('0x36')]=_[_0x2058('0x37')](_0x33620a[_0x2058('0x36')],{'$or':_[_0x2058('0x27')](_0x33620a['attributes'],function(_0x5a6837){var _0x6113cb={};_0x6113cb[_0x5a6837]={'$like':'%'+_0x27d297[_0x2058('0x2b')]['filter']+'%'};return _0x6113cb;})});}_0x33620a=_[_0x2058('0x37')]({},_0x33620a,_0x27d297[_0x2058('0x48')]);return _0x4ce724['getDescriptions'](_0x33620a);}})['then'](function(_0x434571){if(_0x434571){_0xa18ddc=_0x434571[_0x2058('0x30')];if(!_0x27d297[_0x2058('0x2b')][_0x2058('0x49')]('nolimit')){_0x33620a['limit']=qs[_0x2058('0x1e')](_0x27d297[_0x2058('0x2b')][_0x2058('0x1e')]);_0x33620a[_0x2058('0x1d')]=qs[_0x2058('0x1d')](_0x27d297[_0x2058('0x2b')][_0x2058('0x1d')]);}return _0x4ce724[_0x2058('0x4b')](_0x33620a);}})[_0x2058('0x21')](function(_0x2f8aba){if(_0x2f8aba){return _0x2f8aba?{'count':_0xa18ddc,'rows':_0x2f8aba}:null;}})[_0x2058('0x21')](respondWithResult(_0x36ef18,null))[_0x2058('0x3a')](handleError(_0x36ef18,null));};
\ No newline at end of file
+var _0xb35a=['../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','end','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','findOne','VtigerField','hasOwnProperty','getSubjects','getDescriptions','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3e06cd,_0x288920){var _0x57be91=function(_0x5dd143){while(--_0x5dd143){_0x3e06cd['push'](_0x3e06cd['shift']());}};_0x57be91(++_0x288920);}(_0xb35a,0x1d7));var _0xab35=function(_0x1df6c0,_0x132faa){_0x1df6c0=_0x1df6c0-0x0;var _0x3c0ccb=_0xb35a[_0x1df6c0];return _0x3c0ccb;};'use strict';var emlformat=require(_0xab35('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xab35('0x1'));var rp=require('request-promise');var moment=require(_0xab35('0x2'));var BPromise=require(_0xab35('0x3'));var Mustache=require(_0xab35('0x4'));var util=require(_0xab35('0x5'));var path=require(_0xab35('0x6'));var sox=require(_0xab35('0x7'));var csv=require(_0xab35('0x8'));var ejs=require(_0xab35('0x9'));var fs=require('fs');var fs_extra=require(_0xab35('0xa'));var _=require(_0xab35('0xb'));var squel=require(_0xab35('0xc'));var crypto=require(_0xab35('0xd'));var jsforce=require(_0xab35('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab35('0xf'));var Papa=require(_0xab35('0x10'));var Redis=require(_0xab35('0x11'));var authService=require(_0xab35('0x12'));var qs=require(_0xab35('0x13'));var as=require(_0xab35('0x14'));var hardwareService=require(_0xab35('0x15'));var logger=require(_0xab35('0x16'))(_0xab35('0x17'));var utils=require(_0xab35('0x18'));var config=require(_0xab35('0x19'));var licenseUtil=require(_0xab35('0x1a'));var db=require(_0xab35('0x1b'))['db'];function respondWithStatusCode(_0x2997e,_0x1d994f){_0x1d994f=_0x1d994f||0xcc;return function(_0x1f74d2){if(_0x1f74d2){return _0x2997e[_0xab35('0x1c')](_0x1d994f);}return _0x2997e['status'](_0x1d994f)['end']();};}function respondWithResult(_0x5cebf7,_0x389621){_0x389621=_0x389621||0xc8;return function(_0x2990eb){if(_0x2990eb){return _0x5cebf7['status'](_0x389621)[_0xab35('0x1d')](_0x2990eb);}};}function respondWithFilteredResult(_0xacf1ea,_0x580e3b){return function(_0x23a40f){if(_0x23a40f){var _0x54de24=typeof _0x580e3b[_0xab35('0x1e')]===_0xab35('0x1f')&&typeof _0x580e3b[_0xab35('0x20')]===_0xab35('0x1f');var _0x186130=_0x23a40f[_0xab35('0x21')];var _0x4598f3=_0x54de24?0x0:_0x580e3b[_0xab35('0x1e')];var _0xdb51f6=_0x54de24?_0x23a40f[_0xab35('0x21')]:_0x580e3b[_0xab35('0x1e')]+_0x580e3b[_0xab35('0x20')];var _0x2f770e;if(_0xdb51f6>=_0x186130){_0xdb51f6=_0x186130;_0x2f770e=0xc8;}else{_0x2f770e=0xce;}_0xacf1ea[_0xab35('0x22')](_0x2f770e);return _0xacf1ea[_0xab35('0x23')](_0xab35('0x24'),_0x4598f3+'-'+_0xdb51f6+'/'+_0x186130)['json'](_0x23a40f);}return null;};}function patchUpdates(_0x2fb186){return function(_0x86a012){try{jsonpatch[_0xab35('0x25')](_0x86a012,_0x2fb186,!![]);}catch(_0x40d86e){return BPromise[_0xab35('0x26')](_0x40d86e);}return _0x86a012[_0xab35('0x27')]();};}function saveUpdates(_0x7a0b5b,_0x56b9b1){return function(_0x15d9cf){if(_0x15d9cf){return _0x15d9cf['update'](_0x7a0b5b)['then'](function(_0x5d3b13){return _0x5d3b13;});}return null;};}function removeEntity(_0x4b74d2,_0x46b47f){return function(_0x3663de){if(_0x3663de){return _0x3663de['destroy']()[_0xab35('0x28')](function(){_0x4b74d2[_0xab35('0x22')](0xcc)[_0xab35('0x29')]();});}};}function handleEntityNotFound(_0x443d4a,_0x19ccc6){return function(_0x272ebf){if(!_0x272ebf){_0x443d4a[_0xab35('0x1c')](0x194);}return _0x272ebf;};}function handleError(_0x4caf1e,_0x28ddc5){_0x28ddc5=_0x28ddc5||0x1f4;return function(_0x5305a4){logger['error'](_0x5305a4[_0xab35('0x2a')]);if(_0x5305a4[_0xab35('0x2b')]){delete _0x5305a4['name'];}_0x4caf1e[_0xab35('0x22')](_0x28ddc5)[_0xab35('0x2c')](_0x5305a4);};}exports[_0xab35('0x2d')]=function(_0x4c9e1c,_0x42dff7){var _0x48d0d1={},_0x1254f5={},_0x229b77={'count':0x0,'rows':[]};var _0xe3c060=_[_0xab35('0x2e')](db[_0xab35('0x2f')][_0xab35('0x30')],function(_0x4cda9b){return{'name':_0x4cda9b['fieldName'],'type':_0x4cda9b[_0xab35('0x31')][_0xab35('0x32')]};});_0x1254f5[_0xab35('0x33')]=_[_0xab35('0x2e')](_0xe3c060,_0xab35('0x2b'));_0x1254f5[_0xab35('0x34')]=_[_0xab35('0x35')](_0x4c9e1c[_0xab35('0x34')]);_0x1254f5[_0xab35('0x36')]=_['intersection'](_0x1254f5[_0xab35('0x33')],_0x1254f5[_0xab35('0x34')]);_0x48d0d1['attributes']=_[_0xab35('0x37')](_0x1254f5[_0xab35('0x33')],qs[_0xab35('0x38')](_0x4c9e1c[_0xab35('0x34')]['fields']));_0x48d0d1[_0xab35('0x39')]=_0x48d0d1[_0xab35('0x39')][_0xab35('0x3a')]?_0x48d0d1[_0xab35('0x39')]:_0x1254f5['model'];if(!_0x4c9e1c[_0xab35('0x34')]['hasOwnProperty'](_0xab35('0x3b'))){_0x48d0d1[_0xab35('0x20')]=qs[_0xab35('0x20')](_0x4c9e1c[_0xab35('0x34')][_0xab35('0x20')]);_0x48d0d1[_0xab35('0x1e')]=qs['offset'](_0x4c9e1c[_0xab35('0x34')][_0xab35('0x1e')]);}_0x48d0d1['order']=qs[_0xab35('0x3c')](_0x4c9e1c['query'][_0xab35('0x3c')]);_0x48d0d1[_0xab35('0x3d')]=qs['filters'](_[_0xab35('0x3e')](_0x4c9e1c[_0xab35('0x34')],_0x1254f5[_0xab35('0x36')]),_0xe3c060);if(_0x4c9e1c[_0xab35('0x34')][_0xab35('0x3f')]){_0x48d0d1[_0xab35('0x3d')]=_[_0xab35('0x40')](_0x48d0d1[_0xab35('0x3d')],{'$or':_[_0xab35('0x2e')](_0xe3c060,function(_0x15f9fd){if(_0x15f9fd[_0xab35('0x31')]!=='VIRTUAL'){var _0x5f452b={};_0x5f452b[_0x15f9fd[_0xab35('0x2b')]]={'$like':'%'+_0x4c9e1c['query'][_0xab35('0x3f')]+'%'};return _0x5f452b;}})});}_0x48d0d1=_[_0xab35('0x40')]({},_0x48d0d1,_0x4c9e1c[_0xab35('0x41')]);var _0x40c6ed={'where':_0x48d0d1[_0xab35('0x3d')]};return db['VtigerConfiguration'][_0xab35('0x21')](_0x40c6ed)[_0xab35('0x28')](function(_0x4adc69){_0x229b77[_0xab35('0x21')]=_0x4adc69;if(_0x4c9e1c['query'][_0xab35('0x42')]){_0x48d0d1[_0xab35('0x43')]=[{'all':!![]}];}return db[_0xab35('0x2f')][_0xab35('0x44')](_0x48d0d1);})[_0xab35('0x28')](function(_0x5ab81c){_0x229b77[_0xab35('0x45')]=_0x5ab81c;return _0x229b77;})[_0xab35('0x28')](respondWithFilteredResult(_0x42dff7,_0x48d0d1))[_0xab35('0x46')](handleError(_0x42dff7,null));};exports[_0xab35('0x47')]=function(_0x10ddd7,_0x3e6628){var _0x3afab3={'raw':![],'where':{'id':_0x10ddd7[_0xab35('0x48')]['id']}},_0x322a22={};_0x322a22[_0xab35('0x33')]=_['keys'](db[_0xab35('0x2f')][_0xab35('0x30')]);_0x322a22[_0xab35('0x34')]=_[_0xab35('0x35')](_0x10ddd7[_0xab35('0x34')]);_0x322a22['filters']=_[_0xab35('0x37')](_0x322a22[_0xab35('0x33')],_0x322a22[_0xab35('0x34')]);_0x3afab3['attributes']=_[_0xab35('0x37')](_0x322a22['model'],qs[_0xab35('0x38')](_0x10ddd7[_0xab35('0x34')][_0xab35('0x38')]));_0x3afab3['attributes']=_0x3afab3[_0xab35('0x39')][_0xab35('0x3a')]?_0x3afab3[_0xab35('0x39')]:_0x322a22[_0xab35('0x33')];if(_0x10ddd7[_0xab35('0x34')][_0xab35('0x42')]){_0x3afab3[_0xab35('0x43')]=[{'all':!![]}];}_0x3afab3=_[_0xab35('0x40')]({},_0x3afab3,_0x10ddd7[_0xab35('0x41')]);return db[_0xab35('0x2f')][_0xab35('0x49')](_0x3afab3)[_0xab35('0x28')](handleEntityNotFound(_0x3e6628,null))['then'](respondWithResult(_0x3e6628,null))[_0xab35('0x46')](handleError(_0x3e6628,null));};exports['create']=function(_0x37592e,_0x11cafe){return db[_0xab35('0x2f')][_0xab35('0x4a')](_0x37592e[_0xab35('0x4b')],{})[_0xab35('0x28')](respondWithResult(_0x11cafe,0xc9))[_0xab35('0x46')](handleError(_0x11cafe,null));};exports[_0xab35('0x4c')]=function(_0x68c5a0,_0x496dd7){if(_0x68c5a0[_0xab35('0x4b')]['id']){delete _0x68c5a0[_0xab35('0x4b')]['id'];}return db[_0xab35('0x2f')][_0xab35('0x49')]({'where':{'id':_0x68c5a0[_0xab35('0x48')]['id']}})[_0xab35('0x28')](handleEntityNotFound(_0x496dd7,null))[_0xab35('0x28')](saveUpdates(_0x68c5a0[_0xab35('0x4b')],null))[_0xab35('0x28')](respondWithResult(_0x496dd7,null))[_0xab35('0x46')](handleError(_0x496dd7,null));};exports[_0xab35('0x4d')]=function(_0x67ddc,_0x44dbe7){return db[_0xab35('0x2f')][_0xab35('0x49')]({'where':{'id':_0x67ddc[_0xab35('0x48')]['id']}})[_0xab35('0x28')](handleEntityNotFound(_0x44dbe7,null))[_0xab35('0x28')](removeEntity(_0x44dbe7,null))[_0xab35('0x46')](handleError(_0x44dbe7,null));};exports['getFields']=function(_0x3d2371,_0x5cfc59,_0x504717){var _0x574c0d={};var _0x4b76f4={};var _0x56f2cb;var _0x13a826;return db[_0xab35('0x2f')][_0xab35('0x4e')]({'where':{'id':_0x3d2371[_0xab35('0x48')]['id']}})[_0xab35('0x28')](handleEntityNotFound(_0x5cfc59,null))[_0xab35('0x28')](function(_0x53ec25){if(_0x53ec25){_0x56f2cb=_0x53ec25;_0x4b76f4[_0xab35('0x33')]=_[_0xab35('0x35')](db[_0xab35('0x4f')][_0xab35('0x30')]);_0x4b76f4[_0xab35('0x34')]=_[_0xab35('0x35')](_0x3d2371[_0xab35('0x34')]);_0x4b76f4[_0xab35('0x36')]=_['intersection'](_0x4b76f4[_0xab35('0x33')],_0x4b76f4[_0xab35('0x34')]);_0x574c0d[_0xab35('0x39')]=_['intersection'](_0x4b76f4[_0xab35('0x33')],qs[_0xab35('0x38')](_0x3d2371[_0xab35('0x34')]['fields']));_0x574c0d['attributes']=_0x574c0d[_0xab35('0x39')][_0xab35('0x3a')]?_0x574c0d[_0xab35('0x39')]:_0x4b76f4[_0xab35('0x33')];_0x574c0d['order']=qs[_0xab35('0x3c')](_0x3d2371[_0xab35('0x34')]['sort']);_0x574c0d['where']=qs[_0xab35('0x36')](_[_0xab35('0x3e')](_0x3d2371[_0xab35('0x34')],_0x4b76f4[_0xab35('0x36')]));if(_0x3d2371[_0xab35('0x34')][_0xab35('0x3f')]){_0x574c0d[_0xab35('0x3d')]=_[_0xab35('0x40')](_0x574c0d[_0xab35('0x3d')],{'$or':_['map'](_0x574c0d[_0xab35('0x39')],function(_0x46cf83){var _0xd8dd31={};_0xd8dd31[_0x46cf83]={'$like':'%'+_0x3d2371[_0xab35('0x34')][_0xab35('0x3f')]+'%'};return _0xd8dd31;})});}_0x574c0d=_[_0xab35('0x40')]({},_0x574c0d,_0x3d2371[_0xab35('0x41')]);return _0x56f2cb['getFields'](_0x574c0d);}})[_0xab35('0x28')](function(_0x588aea){if(_0x588aea){_0x13a826=_0x588aea[_0xab35('0x3a')];if(!_0x3d2371[_0xab35('0x34')][_0xab35('0x50')](_0xab35('0x3b'))){_0x574c0d['limit']=qs[_0xab35('0x20')](_0x3d2371[_0xab35('0x34')][_0xab35('0x20')]);_0x574c0d['offset']=qs[_0xab35('0x1e')](_0x3d2371[_0xab35('0x34')][_0xab35('0x1e')]);}return _0x56f2cb['getFields'](_0x574c0d);}})[_0xab35('0x28')](function(_0x250fef){if(_0x250fef){return _0x250fef?{'count':_0x13a826,'rows':_0x250fef}:null;}})[_0xab35('0x28')](respondWithResult(_0x5cfc59,null))['catch'](handleError(_0x5cfc59,null));};exports['getSubjects']=function(_0x4f162e,_0x2ebb8e,_0xcb10a9){var _0x3b19ac={};var _0x25a0bc={};var _0x27a256;var _0x1250cc;return db[_0xab35('0x2f')][_0xab35('0x4e')]({'where':{'id':_0x4f162e['params']['id']}})[_0xab35('0x28')](handleEntityNotFound(_0x2ebb8e,null))['then'](function(_0x3d1cd1){if(_0x3d1cd1){_0x27a256=_0x3d1cd1;_0x25a0bc[_0xab35('0x33')]=_[_0xab35('0x35')](db[_0xab35('0x4f')][_0xab35('0x30')]);_0x25a0bc[_0xab35('0x34')]=_['keys'](_0x4f162e[_0xab35('0x34')]);_0x25a0bc[_0xab35('0x36')]=_[_0xab35('0x37')](_0x25a0bc[_0xab35('0x33')],_0x25a0bc['query']);_0x3b19ac[_0xab35('0x39')]=_[_0xab35('0x37')](_0x25a0bc['model'],qs[_0xab35('0x38')](_0x4f162e[_0xab35('0x34')]['fields']));_0x3b19ac[_0xab35('0x39')]=_0x3b19ac[_0xab35('0x39')][_0xab35('0x3a')]?_0x3b19ac['attributes']:_0x25a0bc[_0xab35('0x33')];_0x3b19ac['order']=qs[_0xab35('0x3c')](_0x4f162e[_0xab35('0x34')]['sort']);_0x3b19ac[_0xab35('0x3d')]=qs[_0xab35('0x36')](_[_0xab35('0x3e')](_0x4f162e[_0xab35('0x34')],_0x25a0bc[_0xab35('0x36')]));if(_0x4f162e[_0xab35('0x34')][_0xab35('0x3f')]){_0x3b19ac['where']=_[_0xab35('0x40')](_0x3b19ac['where'],{'$or':_[_0xab35('0x2e')](_0x3b19ac[_0xab35('0x39')],function(_0x324232){var _0x18822e={};_0x18822e[_0x324232]={'$like':'%'+_0x4f162e[_0xab35('0x34')][_0xab35('0x3f')]+'%'};return _0x18822e;})});}_0x3b19ac=_['merge']({},_0x3b19ac,_0x4f162e[_0xab35('0x41')]);return _0x27a256[_0xab35('0x51')](_0x3b19ac);}})[_0xab35('0x28')](function(_0x14feb4){if(_0x14feb4){_0x1250cc=_0x14feb4[_0xab35('0x3a')];if(!_0x4f162e[_0xab35('0x34')][_0xab35('0x50')]('nolimit')){_0x3b19ac['limit']=qs['limit'](_0x4f162e[_0xab35('0x34')][_0xab35('0x20')]);_0x3b19ac[_0xab35('0x1e')]=qs[_0xab35('0x1e')](_0x4f162e[_0xab35('0x34')][_0xab35('0x1e')]);}return _0x27a256['getSubjects'](_0x3b19ac);}})[_0xab35('0x28')](function(_0x13c2ed){if(_0x13c2ed){return _0x13c2ed?{'count':_0x1250cc,'rows':_0x13c2ed}:null;}})[_0xab35('0x28')](respondWithResult(_0x2ebb8e,null))[_0xab35('0x46')](handleError(_0x2ebb8e,null));};exports[_0xab35('0x52')]=function(_0x596f70,_0x2c9953,_0x4e0f28){var _0x56167d={};var _0x3c56b0={};var _0x4db217;var _0x2cc4e0;return db[_0xab35('0x2f')][_0xab35('0x4e')]({'where':{'id':_0x596f70['params']['id']}})[_0xab35('0x28')](handleEntityNotFound(_0x2c9953,null))[_0xab35('0x28')](function(_0x57a615){if(_0x57a615){_0x4db217=_0x57a615;_0x3c56b0[_0xab35('0x33')]=_[_0xab35('0x35')](db[_0xab35('0x4f')][_0xab35('0x30')]);_0x3c56b0[_0xab35('0x34')]=_[_0xab35('0x35')](_0x596f70[_0xab35('0x34')]);_0x3c56b0[_0xab35('0x36')]=_[_0xab35('0x37')](_0x3c56b0[_0xab35('0x33')],_0x3c56b0['query']);_0x56167d[_0xab35('0x39')]=_[_0xab35('0x37')](_0x3c56b0[_0xab35('0x33')],qs['fields'](_0x596f70[_0xab35('0x34')][_0xab35('0x38')]));_0x56167d['attributes']=_0x56167d[_0xab35('0x39')][_0xab35('0x3a')]?_0x56167d[_0xab35('0x39')]:_0x3c56b0[_0xab35('0x33')];_0x56167d['order']=qs[_0xab35('0x3c')](_0x596f70[_0xab35('0x34')][_0xab35('0x3c')]);_0x56167d['where']=qs['filters'](_[_0xab35('0x3e')](_0x596f70[_0xab35('0x34')],_0x3c56b0['filters']));if(_0x596f70[_0xab35('0x34')][_0xab35('0x3f')]){_0x56167d[_0xab35('0x3d')]=_[_0xab35('0x40')](_0x56167d['where'],{'$or':_[_0xab35('0x2e')](_0x56167d[_0xab35('0x39')],function(_0x19885e){var _0x38979={};_0x38979[_0x19885e]={'$like':'%'+_0x596f70['query']['filter']+'%'};return _0x38979;})});}_0x56167d=_[_0xab35('0x40')]({},_0x56167d,_0x596f70[_0xab35('0x41')]);return _0x4db217[_0xab35('0x52')](_0x56167d);}})[_0xab35('0x28')](function(_0x216741){if(_0x216741){_0x2cc4e0=_0x216741[_0xab35('0x3a')];if(!_0x596f70['query'][_0xab35('0x50')](_0xab35('0x3b'))){_0x56167d[_0xab35('0x20')]=qs['limit'](_0x596f70[_0xab35('0x34')][_0xab35('0x20')]);_0x56167d[_0xab35('0x1e')]=qs['offset'](_0x596f70[_0xab35('0x34')][_0xab35('0x1e')]);}return _0x4db217[_0xab35('0x52')](_0x56167d);}})[_0xab35('0x28')](function(_0x278004){if(_0x278004){return _0x278004?{'count':_0x2cc4e0,'rows':_0x278004}:null;}})[_0xab35('0x28')](respondWithResult(_0x2c9953,null))[_0xab35('0x46')](handleError(_0x2c9953,null));};
\ No newline at end of file
index 08f8b83..7308d23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7011=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xf4b02a,_0x36e5ba){var _0x946906=function(_0x3dce4e){while(--_0x3dce4e){_0xf4b02a['push'](_0xf4b02a['shift']());}};_0x946906(++_0x36e5ba);}(_0x7011,0x1f3));var _0x1701=function(_0x52ed18,_0x722adb){_0x52ed18=_0x52ed18-0x0;var _0x5d0a9e=_0x7011[_0x52ed18];return _0x5d0a9e;};'use strict';var _=require(_0x1701('0x0'));var util=require(_0x1701('0x1'));var logger=require(_0x1701('0x2'))(_0x1701('0x3'));var moment=require(_0x1701('0x4'));var BPromise=require(_0x1701('0x5'));var rp=require(_0x1701('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1701('0x7'));var config=require(_0x1701('0x8'));var attributes=require(_0x1701('0x9'));module[_0x1701('0xa')]=function(_0x44fa0c,_0x3b44b1){return _0x44fa0c['define']('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8757=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','define','VtigerConfiguration','int_vtiger_configurations','lodash','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8757,0x1c6));var _0x7875=function(_0x43d07a,_0xcd75b7){_0x43d07a=_0x43d07a-0x0;var _0x1186d1=_0x8757[_0x43d07a];return _0x1186d1;};'use strict';var _=require(_0x7875('0x0'));var util=require(_0x7875('0x1'));var logger=require(_0x7875('0x2'))(_0x7875('0x3'));var moment=require('moment');var BPromise=require(_0x7875('0x4'));var rp=require(_0x7875('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7875('0x6'));var config=require(_0x7875('0x7'));var attributes=require(_0x7875('0x8'));module['exports']=function(_0x56536a,_0x1dd4fd){return _0x56536a[_0x7875('0x9')](_0x7875('0xa'),attributes,{'tableName':_0x7875('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c086a63..db750b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09bd=['client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2be73e,_0x1be44a){var _0x553f63=function(_0x48bcb7){while(--_0x48bcb7){_0x2be73e['push'](_0x2be73e['shift']());}};_0x553f63(++_0x1be44a);}(_0x09bd,0x11e));var _0xd09b=function(_0x568039,_0x570f8e){_0x568039=_0x568039-0x0;var _0x1595fc=_0x09bd[_0x568039];return _0x1595fc;};'use strict';var _=require(_0xd09b('0x0'));var util=require(_0xd09b('0x1'));var moment=require('moment');var BPromise=require(_0xd09b('0x2'));var rs=require(_0xd09b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd09b('0x4'));var logger=require(_0xd09b('0x5'))(_0xd09b('0x6'));var config=require(_0xd09b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd09b('0x8')][_0xd09b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c9a7d,_0x2d11c9,_0x5f0f2c){return new BPromise(function(_0x61501,_0x5260bf){return client[_0xd09b('0xa')](_0x4c9a7d,_0x5f0f2c)[_0xd09b('0xb')](function(_0x46c86e){logger[_0xd09b('0xc')](_0xd09b('0xd'),_0x2d11c9,'request\x20sent');logger[_0xd09b('0xe')](_0xd09b('0xf'),_0x2d11c9,'request\x20sent',JSON['stringify'](_0x46c86e));if(_0x46c86e['error']){if(_0x46c86e['error']['code']===0x1f4){logger['error'](_0xd09b('0xd'),_0x2d11c9,_0x46c86e[_0xd09b('0x10')]['message']);return _0x5260bf(_0x46c86e[_0xd09b('0x10')][_0xd09b('0x11')]);}logger[_0xd09b('0x10')](_0xd09b('0xd'),_0x2d11c9,_0x46c86e['error'][_0xd09b('0x11')]);return _0x61501(_0x46c86e[_0xd09b('0x10')]['message']);}else{logger[_0xd09b('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x2d11c9,_0xd09b('0x12'));_0x61501(_0x46c86e[_0xd09b('0x13')][_0xd09b('0x11')]);}})[_0xd09b('0x14')](function(_0x186b6b){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x2d11c9,_0x186b6b);_0x5260bf(_0x186b6b);});});}
\ No newline at end of file
+var _0xf40e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x4fa931,_0xfbd730){var _0x385a23=function(_0x1a2f28){while(--_0x1a2f28){_0x4fa931['push'](_0x4fa931['shift']());}};_0x385a23(++_0xfbd730);}(_0xf40e,0xf8));var _0xef40=function(_0x1f8435,_0xe54745){_0x1f8435=_0x1f8435-0x0;var _0x133378=_0xf40e[_0x1f8435];return _0x133378;};'use strict';var _=require(_0xef40('0x0'));var util=require(_0xef40('0x1'));var moment=require(_0xef40('0x2'));var BPromise=require(_0xef40('0x3'));var rs=require(_0xef40('0x4'));var fs=require('fs');var Redis=require(_0xef40('0x5'));var db=require(_0xef40('0x6'))['db'];var utils=require(_0xef40('0x7'));var logger=require(_0xef40('0x8'))(_0xef40('0x9'));var config=require('../../config/environment');var jayson=require(_0xef40('0xa'));var client=jayson[_0xef40('0xb')][_0xef40('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x996fd0,_0xf9c3f3,_0x3772e8){return new BPromise(function(_0x40d7e6,_0x5824a4){return client[_0xef40('0xd')](_0x996fd0,_0x3772e8)[_0xef40('0xe')](function(_0x4a30ba){logger[_0xef40('0xf')](_0xef40('0x10'),_0xf9c3f3,_0xef40('0x11'));logger[_0xef40('0x12')](_0xef40('0x13'),_0xf9c3f3,_0xef40('0x11'),JSON[_0xef40('0x14')](_0x4a30ba));if(_0x4a30ba[_0xef40('0x15')]){if(_0x4a30ba[_0xef40('0x15')]['code']===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0xf9c3f3,_0x4a30ba['error']['message']);return _0x5824a4(_0x4a30ba[_0xef40('0x15')][_0xef40('0x16')]);}logger[_0xef40('0x15')]('VtigerConfiguration,\x20%s,\x20%s',_0xf9c3f3,_0x4a30ba[_0xef40('0x15')][_0xef40('0x16')]);return _0x40d7e6(_0x4a30ba[_0xef40('0x15')]['message']);}else{logger[_0xef40('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0xf9c3f3,_0xef40('0x11'));_0x40d7e6(_0x4a30ba[_0xef40('0x17')][_0xef40('0x16')]);}})[_0xef40('0x18')](function(_0x5cd895){logger[_0xef40('0x15')](_0xef40('0x10'),_0xf9c3f3,_0x5cd895);_0x5824a4(_0x5cd895);});});}
\ No newline at end of file
index 5acf31e..bcc9ec3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20cc=['index','/:id','isAuthenticated','show','post','create','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x19d924,_0x305452){var _0x271032=function(_0x2d0adc){while(--_0x2d0adc){_0x19d924['push'](_0x19d924['shift']());}};_0x271032(++_0x305452);}(_0x20cc,0x68));var _0xc20c=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x20cc[_0x15bc81];return _0x59440e;};'use strict';var multer=require(_0xc20c('0x0'));var util=require('util');var path=require(_0xc20c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc20c('0x2'));var router=express[_0xc20c('0x3')]();var fs_extra=require(_0xc20c('0x4'));var auth=require(_0xc20c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc20c('0x6'));var controller=require('./intVtigerField.controller');router[_0xc20c('0x7')]('/',auth['isAuthenticated'](),controller[_0xc20c('0x8')]);router[_0xc20c('0x7')](_0xc20c('0x9'),auth[_0xc20c('0xa')](),controller[_0xc20c('0xb')]);router[_0xc20c('0xc')]('/',auth[_0xc20c('0xa')](),controller[_0xc20c('0xd')]);router['put'](_0xc20c('0x9'),auth[_0xc20c('0xa')](),controller['update']);router[_0xc20c('0xe')](_0xc20c('0x9'),auth[_0xc20c('0xa')](),controller['destroy']);module[_0xc20c('0xf')]=router;
\ No newline at end of file
+var _0xc2ca=['index','/:id','isAuthenticated','show','put','update','exports','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0xc2ca,0x10f));var _0xac2c=function(_0x50aea5,_0x5dd077){_0x50aea5=_0x50aea5-0x0;var _0x4657f1=_0xc2ca[_0x50aea5];return _0x4657f1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xac2c('0x0'));var express=require('express');var router=express[_0xac2c('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xac2c('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xac2c('0x3'));var controller=require('./intVtigerField.controller');router[_0xac2c('0x4')]('/',auth['isAuthenticated'](),controller[_0xac2c('0x5')]);router['get'](_0xac2c('0x6'),auth[_0xac2c('0x7')](),controller[_0xac2c('0x8')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xac2c('0x9')](_0xac2c('0x6'),auth['isAuthenticated'](),controller[_0xac2c('0xa')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xac2c('0xb')]=router;
\ No newline at end of file
index 286c9d6..dc1dc84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06f3=['exports','ENUM','customVariable','keyValue','picklist','STRING','variable','BOOLEAN'];(function(_0x137d1d,_0x35c663){var _0x485108=function(_0x108a2a){while(--_0x108a2a){_0x137d1d['push'](_0x137d1d['shift']());}};_0x485108(++_0x35c663);}(_0x06f3,0x100));var _0x306f=function(_0x443e9e,_0x3c1baf){_0x443e9e=_0x443e9e-0x0;var _0x5db340=_0x06f3[_0x443e9e];return _0x5db340;};'use strict';var Sequelize=require('sequelize');module[_0x306f('0x0')]={'type':{'type':Sequelize[_0x306f('0x1')]('string','variable',_0x306f('0x2'),_0x306f('0x3'),_0x306f('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x306f('0x5')]},'key':{'type':Sequelize[_0x306f('0x5')]},'keyType':{'type':Sequelize[_0x306f('0x1')]('string',_0x306f('0x6'),_0x306f('0x2'))},'keyContent':{'type':Sequelize[_0x306f('0x5')]},'idField':{'type':Sequelize[_0x306f('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x306f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x306f('0x5')]}};
\ No newline at end of file
+var _0xd266=['customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x11b36c,_0x4caf31){var _0x560cc2=function(_0x289eb9){while(--_0x289eb9){_0x11b36c['push'](_0x11b36c['shift']());}};_0x560cc2(++_0x4caf31);}(_0xd266,0xd4));var _0x6d26=function(_0xdea555,_0x5ce0bb){_0xdea555=_0xdea555-0x0;var _0x4bc666=_0xd266[_0xdea555];return _0x4bc666;};'use strict';var Sequelize=require(_0x6d26('0x0'));module[_0x6d26('0x1')]={'type':{'type':Sequelize[_0x6d26('0x2')](_0x6d26('0x3'),_0x6d26('0x4'),'customVariable',_0x6d26('0x5'),_0x6d26('0x6')),'defaultValue':_0x6d26('0x3')},'content':{'type':Sequelize[_0x6d26('0x7')]},'key':{'type':Sequelize[_0x6d26('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x6d26('0x4'),_0x6d26('0x8'))},'keyContent':{'type':Sequelize[_0x6d26('0x7')]},'idField':{'type':Sequelize[_0x6d26('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6d26('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d26('0x7')]}};
\ No newline at end of file
index d2eea31..eacf8cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c97=['VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','VtigerField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1c97,0x9f));var _0x71c9=function(_0x582a4e,_0x10b364){_0x582a4e=_0x582a4e-0x0;var _0x5cccb3=_0x1c97[_0x582a4e];return _0x5cccb3;};'use strict';var emlformat=require(_0x71c9('0x0'));var rimraf=require(_0x71c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x71c9('0x2'));var BPromise=require(_0x71c9('0x3'));var Mustache=require(_0x71c9('0x4'));var util=require(_0x71c9('0x5'));var path=require(_0x71c9('0x6'));var sox=require(_0x71c9('0x7'));var csv=require(_0x71c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71c9('0x9'));var _=require(_0x71c9('0xa'));var squel=require(_0x71c9('0xb'));var crypto=require(_0x71c9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x71c9('0xd'));var toCsv=require(_0x71c9('0x8'));var querystring=require(_0x71c9('0xe'));var Papa=require(_0x71c9('0xf'));var Redis=require(_0x71c9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x71c9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x71c9('0x12'));var logger=require(_0x71c9('0x13'))(_0x71c9('0x14'));var utils=require(_0x71c9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x71c9('0x16'));var db=require(_0x71c9('0x17'))['db'];function respondWithStatusCode(_0x21fc2e,_0x188b22){_0x188b22=_0x188b22||0xcc;return function(_0x577040){if(_0x577040){return _0x21fc2e['sendStatus'](_0x188b22);}return _0x21fc2e[_0x71c9('0x18')](_0x188b22)['end']();};}function respondWithResult(_0x2c9df8,_0x3b670d){_0x3b670d=_0x3b670d||0xc8;return function(_0x43d9a4){if(_0x43d9a4){return _0x2c9df8[_0x71c9('0x18')](_0x3b670d)[_0x71c9('0x19')](_0x43d9a4);}};}function respondWithFilteredResult(_0x41b9dd,_0x504d00){return function(_0x2d7141){if(_0x2d7141){var _0x5a60f8=typeof _0x504d00['offset']===_0x71c9('0x1a')&&typeof _0x504d00[_0x71c9('0x1b')]==='undefined';var _0x257bb4=_0x2d7141[_0x71c9('0x1c')];var _0x38b2b2=_0x5a60f8?0x0:_0x504d00['offset'];var _0x474835=_0x5a60f8?_0x2d7141[_0x71c9('0x1c')]:_0x504d00[_0x71c9('0x1d')]+_0x504d00[_0x71c9('0x1b')];var _0xd8f4da;if(_0x474835>=_0x257bb4){_0x474835=_0x257bb4;_0xd8f4da=0xc8;}else{_0xd8f4da=0xce;}_0x41b9dd['status'](_0xd8f4da);return _0x41b9dd[_0x71c9('0x1e')](_0x71c9('0x1f'),_0x38b2b2+'-'+_0x474835+'/'+_0x257bb4)[_0x71c9('0x19')](_0x2d7141);}return null;};}function patchUpdates(_0x35b62c){return function(_0xc94368){try{jsonpatch[_0x71c9('0x20')](_0xc94368,_0x35b62c,!![]);}catch(_0x2c64d7){return BPromise[_0x71c9('0x21')](_0x2c64d7);}return _0xc94368[_0x71c9('0x22')]();};}function saveUpdates(_0x186852,_0x4246d8){return function(_0x12160e){if(_0x12160e){return _0x12160e[_0x71c9('0x23')](_0x186852)[_0x71c9('0x24')](function(_0x4c624d){return _0x4c624d;});}return null;};}function removeEntity(_0x56a68e,_0x218fe7){return function(_0x1b89d5){if(_0x1b89d5){return _0x1b89d5[_0x71c9('0x25')]()[_0x71c9('0x24')](function(){_0x56a68e['status'](0xcc)[_0x71c9('0x26')]();});}};}function handleEntityNotFound(_0x208aa3,_0x3541b9){return function(_0x2066df){if(!_0x2066df){_0x208aa3[_0x71c9('0x27')](0x194);}return _0x2066df;};}function handleError(_0x5f2fda,_0x476e7c){_0x476e7c=_0x476e7c||0x1f4;return function(_0x59743d){logger[_0x71c9('0x28')](_0x59743d[_0x71c9('0x29')]);if(_0x59743d[_0x71c9('0x2a')]){delete _0x59743d[_0x71c9('0x2a')];}_0x5f2fda[_0x71c9('0x18')](_0x476e7c)['send'](_0x59743d);};}exports[_0x71c9('0x2b')]=function(_0x588618,_0x324597){var _0xdedcb9={},_0x2f50ea={},_0x294f30={'count':0x0,'rows':[]};var _0x2d7762=_[_0x71c9('0x2c')](db[_0x71c9('0x2d')][_0x71c9('0x2e')],function(_0x500fd9){return{'name':_0x500fd9['fieldName'],'type':_0x500fd9[_0x71c9('0x2f')][_0x71c9('0x30')]};});_0x2f50ea[_0x71c9('0x31')]=_['map'](_0x2d7762,'name');_0x2f50ea[_0x71c9('0x32')]=_[_0x71c9('0x33')](_0x588618[_0x71c9('0x32')]);_0x2f50ea[_0x71c9('0x34')]=_['intersection'](_0x2f50ea[_0x71c9('0x31')],_0x2f50ea[_0x71c9('0x32')]);_0xdedcb9['attributes']=_[_0x71c9('0x35')](_0x2f50ea[_0x71c9('0x31')],qs[_0x71c9('0x36')](_0x588618['query'][_0x71c9('0x36')]));_0xdedcb9[_0x71c9('0x37')]=_0xdedcb9['attributes'][_0x71c9('0x38')]?_0xdedcb9[_0x71c9('0x37')]:_0x2f50ea[_0x71c9('0x31')];if(!_0x588618['query'][_0x71c9('0x39')](_0x71c9('0x3a'))){_0xdedcb9[_0x71c9('0x1b')]=qs[_0x71c9('0x1b')](_0x588618['query']['limit']);_0xdedcb9[_0x71c9('0x1d')]=qs[_0x71c9('0x1d')](_0x588618[_0x71c9('0x32')][_0x71c9('0x1d')]);}_0xdedcb9[_0x71c9('0x3b')]=qs[_0x71c9('0x3c')](_0x588618[_0x71c9('0x32')][_0x71c9('0x3c')]);_0xdedcb9[_0x71c9('0x3d')]=qs[_0x71c9('0x34')](_['pick'](_0x588618['query'],_0x2f50ea['filters']),_0x2d7762);if(_0x588618[_0x71c9('0x32')][_0x71c9('0x3e')]){_0xdedcb9['where']=_['merge'](_0xdedcb9[_0x71c9('0x3d')],{'$or':_[_0x71c9('0x2c')](_0x2d7762,function(_0x52d548){if(_0x52d548[_0x71c9('0x2f')]!==_0x71c9('0x3f')){var _0x3e46cc={};_0x3e46cc[_0x52d548[_0x71c9('0x2a')]]={'$like':'%'+_0x588618[_0x71c9('0x32')][_0x71c9('0x3e')]+'%'};return _0x3e46cc;}})});}_0xdedcb9=_[_0x71c9('0x40')]({},_0xdedcb9,_0x588618[_0x71c9('0x41')]);var _0x9973c4={'where':_0xdedcb9[_0x71c9('0x3d')]};return db['VtigerField'][_0x71c9('0x1c')](_0x9973c4)[_0x71c9('0x24')](function(_0x5e6c46){_0x294f30['count']=_0x5e6c46;if(_0x588618[_0x71c9('0x32')][_0x71c9('0x42')]){_0xdedcb9[_0x71c9('0x43')]=[{'all':!![]}];}return db[_0x71c9('0x2d')][_0x71c9('0x44')](_0xdedcb9);})[_0x71c9('0x24')](function(_0x324f48){_0x294f30['rows']=_0x324f48;return _0x294f30;})[_0x71c9('0x24')](respondWithFilteredResult(_0x324597,_0xdedcb9))[_0x71c9('0x45')](handleError(_0x324597,null));};exports['show']=function(_0x54728f,_0x295a53){var _0x2125a2={'raw':!![],'where':{'id':_0x54728f[_0x71c9('0x46')]['id']}},_0x519244={};_0x519244[_0x71c9('0x31')]=_[_0x71c9('0x33')](db[_0x71c9('0x2d')][_0x71c9('0x2e')]);_0x519244[_0x71c9('0x32')]=_[_0x71c9('0x33')](_0x54728f['query']);_0x519244[_0x71c9('0x34')]=_['intersection'](_0x519244['model'],_0x519244['query']);_0x2125a2['attributes']=_[_0x71c9('0x35')](_0x519244[_0x71c9('0x31')],qs[_0x71c9('0x36')](_0x54728f[_0x71c9('0x32')][_0x71c9('0x36')]));_0x2125a2[_0x71c9('0x37')]=_0x2125a2['attributes'][_0x71c9('0x38')]?_0x2125a2['attributes']:_0x519244[_0x71c9('0x31')];if(_0x54728f[_0x71c9('0x32')][_0x71c9('0x42')]){_0x2125a2[_0x71c9('0x43')]=[{'all':!![]}];}_0x2125a2=_[_0x71c9('0x40')]({},_0x2125a2,_0x54728f[_0x71c9('0x41')]);return db[_0x71c9('0x2d')][_0x71c9('0x47')](_0x2125a2)['then'](handleEntityNotFound(_0x295a53,null))[_0x71c9('0x24')](respondWithResult(_0x295a53,null))[_0x71c9('0x45')](handleError(_0x295a53,null));};exports['create']=function(_0x5a2a67,_0x304758){return db[_0x71c9('0x2d')][_0x71c9('0x48')](_0x5a2a67[_0x71c9('0x49')],{})[_0x71c9('0x24')](respondWithResult(_0x304758,0xc9))[_0x71c9('0x45')](handleError(_0x304758,null));};exports['update']=function(_0x34250c,_0x522647){if(_0x34250c['body']['id']){delete _0x34250c[_0x71c9('0x49')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x34250c[_0x71c9('0x46')]['id']}})[_0x71c9('0x24')](handleEntityNotFound(_0x522647,null))['then'](saveUpdates(_0x34250c['body'],null))[_0x71c9('0x24')](respondWithResult(_0x522647,null))[_0x71c9('0x45')](handleError(_0x522647,null));};exports[_0x71c9('0x25')]=function(_0x415aa8,_0x5aee3f){return db[_0x71c9('0x2d')][_0x71c9('0x47')]({'where':{'id':_0x415aa8[_0x71c9('0x46')]['id']}})[_0x71c9('0x24')](handleEntityNotFound(_0x5aee3f,null))[_0x71c9('0x24')](removeEntity(_0x5aee3f,null))['catch'](handleError(_0x5aee3f,null));};
\ No newline at end of file
+var _0xd31d=['merge','type','options','includeAll','include','VtigerField','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','set','apply','save','update','then','destroy','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','sort','pick','filter','where'];(function(_0x203a37,_0x5533ba){var _0x37c974=function(_0x5f2362){while(--_0x5f2362){_0x203a37['push'](_0x203a37['shift']());}};_0x37c974(++_0x5533ba);}(_0xd31d,0x92));var _0xdd31=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xd31d[_0x1b828b];return _0x98da1a;};'use strict';var emlformat=require(_0xdd31('0x0'));var rimraf=require(_0xdd31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdd31('0x2'));var BPromise=require(_0xdd31('0x3'));var Mustache=require('mustache');var util=require(_0xdd31('0x4'));var path=require(_0xdd31('0x5'));var sox=require(_0xdd31('0x6'));var csv=require(_0xdd31('0x7'));var ejs=require(_0xdd31('0x8'));var fs=require('fs');var fs_extra=require(_0xdd31('0x9'));var _=require(_0xdd31('0xa'));var squel=require(_0xdd31('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdd31('0xc'));var toCsv=require(_0xdd31('0x7'));var querystring=require(_0xdd31('0xd'));var Papa=require('papaparse');var Redis=require(_0xdd31('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdd31('0xf'));var as=require(_0xdd31('0x10'));var hardwareService=require(_0xdd31('0x11'));var logger=require('../../config/logger')(_0xdd31('0x12'));var utils=require('../../config/utils');var config=require(_0xdd31('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd31('0x14'))['db'];function respondWithStatusCode(_0x47527e,_0x2cad0f){_0x2cad0f=_0x2cad0f||0xcc;return function(_0xa3ebc9){if(_0xa3ebc9){return _0x47527e['sendStatus'](_0x2cad0f);}return _0x47527e[_0xdd31('0x15')](_0x2cad0f)[_0xdd31('0x16')]();};}function respondWithResult(_0x3f96ac,_0x922b8e){_0x922b8e=_0x922b8e||0xc8;return function(_0x217a1e){if(_0x217a1e){return _0x3f96ac['status'](_0x922b8e)[_0xdd31('0x17')](_0x217a1e);}};}function respondWithFilteredResult(_0x29030a,_0x190cf9){return function(_0x4e89b2){if(_0x4e89b2){var _0x39cdcc=typeof _0x190cf9[_0xdd31('0x18')]==='undefined'&&typeof _0x190cf9[_0xdd31('0x19')]==='undefined';var _0x3e6964=_0x4e89b2[_0xdd31('0x1a')];var _0x1e292e=_0x39cdcc?0x0:_0x190cf9['offset'];var _0x2cbd68=_0x39cdcc?_0x4e89b2[_0xdd31('0x1a')]:_0x190cf9['offset']+_0x190cf9[_0xdd31('0x19')];var _0x18e31d;if(_0x2cbd68>=_0x3e6964){_0x2cbd68=_0x3e6964;_0x18e31d=0xc8;}else{_0x18e31d=0xce;}_0x29030a['status'](_0x18e31d);return _0x29030a[_0xdd31('0x1b')]('Content-Range',_0x1e292e+'-'+_0x2cbd68+'/'+_0x3e6964)[_0xdd31('0x17')](_0x4e89b2);}return null;};}function patchUpdates(_0x5abd8f){return function(_0x2f191e){try{jsonpatch[_0xdd31('0x1c')](_0x2f191e,_0x5abd8f,!![]);}catch(_0x3638d2){return BPromise['reject'](_0x3638d2);}return _0x2f191e[_0xdd31('0x1d')]();};}function saveUpdates(_0x2b5786,_0x14effb){return function(_0x575f45){if(_0x575f45){return _0x575f45[_0xdd31('0x1e')](_0x2b5786)[_0xdd31('0x1f')](function(_0x5cc405){return _0x5cc405;});}return null;};}function removeEntity(_0x39c70a,_0x35b549){return function(_0x39f238){if(_0x39f238){return _0x39f238[_0xdd31('0x20')]()[_0xdd31('0x1f')](function(){_0x39c70a[_0xdd31('0x15')](0xcc)[_0xdd31('0x16')]();});}};}function handleEntityNotFound(_0x2e75b1,_0x5389a3){return function(_0x64f99f){if(!_0x64f99f){_0x2e75b1['sendStatus'](0x194);}return _0x64f99f;};}function handleError(_0x5dd1de,_0x2f4955){_0x2f4955=_0x2f4955||0x1f4;return function(_0x4ba571){logger['error'](_0x4ba571['stack']);if(_0x4ba571[_0xdd31('0x21')]){delete _0x4ba571[_0xdd31('0x21')];}_0x5dd1de[_0xdd31('0x15')](_0x2f4955)[_0xdd31('0x22')](_0x4ba571);};}exports[_0xdd31('0x23')]=function(_0x228e9f,_0x3e6a5b){var _0xa8a295={},_0x7b0c67={},_0x423906={'count':0x0,'rows':[]};var _0x32cc21=_['map'](db['VtigerField'][_0xdd31('0x24')],function(_0x274263){return{'name':_0x274263[_0xdd31('0x25')],'type':_0x274263['type'][_0xdd31('0x26')]};});_0x7b0c67['model']=_[_0xdd31('0x27')](_0x32cc21,_0xdd31('0x21'));_0x7b0c67[_0xdd31('0x28')]=_[_0xdd31('0x29')](_0x228e9f[_0xdd31('0x28')]);_0x7b0c67[_0xdd31('0x2a')]=_[_0xdd31('0x2b')](_0x7b0c67[_0xdd31('0x2c')],_0x7b0c67[_0xdd31('0x28')]);_0xa8a295['attributes']=_['intersection'](_0x7b0c67['model'],qs[_0xdd31('0x2d')](_0x228e9f[_0xdd31('0x28')][_0xdd31('0x2d')]));_0xa8a295[_0xdd31('0x2e')]=_0xa8a295[_0xdd31('0x2e')]['length']?_0xa8a295[_0xdd31('0x2e')]:_0x7b0c67['model'];if(!_0x228e9f[_0xdd31('0x28')][_0xdd31('0x2f')]('nolimit')){_0xa8a295['limit']=qs[_0xdd31('0x19')](_0x228e9f[_0xdd31('0x28')][_0xdd31('0x19')]);_0xa8a295[_0xdd31('0x18')]=qs[_0xdd31('0x18')](_0x228e9f[_0xdd31('0x28')][_0xdd31('0x18')]);}_0xa8a295['order']=qs[_0xdd31('0x30')](_0x228e9f[_0xdd31('0x28')]['sort']);_0xa8a295['where']=qs[_0xdd31('0x2a')](_[_0xdd31('0x31')](_0x228e9f[_0xdd31('0x28')],_0x7b0c67['filters']),_0x32cc21);if(_0x228e9f[_0xdd31('0x28')][_0xdd31('0x32')]){_0xa8a295[_0xdd31('0x33')]=_[_0xdd31('0x34')](_0xa8a295[_0xdd31('0x33')],{'$or':_['map'](_0x32cc21,function(_0x2da21e){if(_0x2da21e[_0xdd31('0x35')]!=='VIRTUAL'){var _0x60d7d7={};_0x60d7d7[_0x2da21e[_0xdd31('0x21')]]={'$like':'%'+_0x228e9f[_0xdd31('0x28')][_0xdd31('0x32')]+'%'};return _0x60d7d7;}})});}_0xa8a295=_[_0xdd31('0x34')]({},_0xa8a295,_0x228e9f[_0xdd31('0x36')]);var _0x34fec0={'where':_0xa8a295[_0xdd31('0x33')]};return db['VtigerField'][_0xdd31('0x1a')](_0x34fec0)[_0xdd31('0x1f')](function(_0x87d336){_0x423906[_0xdd31('0x1a')]=_0x87d336;if(_0x228e9f[_0xdd31('0x28')][_0xdd31('0x37')]){_0xa8a295[_0xdd31('0x38')]=[{'all':!![]}];}return db[_0xdd31('0x39')][_0xdd31('0x3a')](_0xa8a295);})[_0xdd31('0x1f')](function(_0x35eb77){_0x423906[_0xdd31('0x3b')]=_0x35eb77;return _0x423906;})[_0xdd31('0x1f')](respondWithFilteredResult(_0x3e6a5b,_0xa8a295))[_0xdd31('0x3c')](handleError(_0x3e6a5b,null));};exports[_0xdd31('0x3d')]=function(_0x22ed7f,_0x62119a){var _0x188b10={'raw':!![],'where':{'id':_0x22ed7f[_0xdd31('0x3e')]['id']}},_0x36e0d7={};_0x36e0d7['model']=_[_0xdd31('0x29')](db[_0xdd31('0x39')][_0xdd31('0x24')]);_0x36e0d7[_0xdd31('0x28')]=_[_0xdd31('0x29')](_0x22ed7f[_0xdd31('0x28')]);_0x36e0d7[_0xdd31('0x2a')]=_[_0xdd31('0x2b')](_0x36e0d7[_0xdd31('0x2c')],_0x36e0d7[_0xdd31('0x28')]);_0x188b10[_0xdd31('0x2e')]=_[_0xdd31('0x2b')](_0x36e0d7[_0xdd31('0x2c')],qs['fields'](_0x22ed7f[_0xdd31('0x28')]['fields']));_0x188b10[_0xdd31('0x2e')]=_0x188b10[_0xdd31('0x2e')]['length']?_0x188b10['attributes']:_0x36e0d7['model'];if(_0x22ed7f['query'][_0xdd31('0x37')]){_0x188b10[_0xdd31('0x38')]=[{'all':!![]}];}_0x188b10=_[_0xdd31('0x34')]({},_0x188b10,_0x22ed7f[_0xdd31('0x36')]);return db[_0xdd31('0x39')][_0xdd31('0x3f')](_0x188b10)[_0xdd31('0x1f')](handleEntityNotFound(_0x62119a,null))[_0xdd31('0x1f')](respondWithResult(_0x62119a,null))[_0xdd31('0x3c')](handleError(_0x62119a,null));};exports[_0xdd31('0x40')]=function(_0x1b9ce4,_0x11011a){return db[_0xdd31('0x39')]['create'](_0x1b9ce4[_0xdd31('0x41')],{})[_0xdd31('0x1f')](respondWithResult(_0x11011a,0xc9))[_0xdd31('0x3c')](handleError(_0x11011a,null));};exports[_0xdd31('0x1e')]=function(_0x319038,_0x4a16e2){if(_0x319038[_0xdd31('0x41')]['id']){delete _0x319038[_0xdd31('0x41')]['id'];}return db[_0xdd31('0x39')]['find']({'where':{'id':_0x319038[_0xdd31('0x3e')]['id']}})[_0xdd31('0x1f')](handleEntityNotFound(_0x4a16e2,null))[_0xdd31('0x1f')](saveUpdates(_0x319038[_0xdd31('0x41')],null))[_0xdd31('0x1f')](respondWithResult(_0x4a16e2,null))['catch'](handleError(_0x4a16e2,null));};exports[_0xdd31('0x20')]=function(_0x104e4d,_0x562dd7){return db[_0xdd31('0x39')][_0xdd31('0x3f')]({'where':{'id':_0x104e4d[_0xdd31('0x3e')]['id']}})[_0xdd31('0x1f')](handleEntityNotFound(_0x562dd7,null))['then'](removeEntity(_0x562dd7,null))[_0xdd31('0x3c')](handleError(_0x562dd7,null));};
\ No newline at end of file
index 9087a9c..337c253 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8125=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intVtigerField.attributes','exports','VtigerField','idField','FieldId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8125,0x104));var _0x5812=function(_0x5cca1e,_0x37dfdd){_0x5cca1e=_0x5cca1e-0x0;var _0x420d00=_0x8125[_0x5cca1e];return _0x420d00;};'use strict';var _=require(_0x5812('0x0'));var util=require(_0x5812('0x1'));var logger=require(_0x5812('0x2'))(_0x5812('0x3'));var moment=require(_0x5812('0x4'));var BPromise=require('bluebird');var rp=require(_0x5812('0x5'));var fs=require('fs');var path=require(_0x5812('0x6'));var rimraf=require('rimraf');var config=require(_0x5812('0x7'));var attributes=require(_0x5812('0x8'));module[_0x5812('0x9')]=function(_0x1f8424,_0x342918){return _0x1f8424['define'](_0x5812('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x5812('0xb'),_0x5812('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5102=['FieldId','util','../../config/logger','api','moment','path','../../config/environment','define','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5102,0x1a3));var _0x2510=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5102[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0x2510('0x0'));var logger=require(_0x2510('0x1'))(_0x2510('0x2'));var moment=require(_0x2510('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2510('0x4'));var rimraf=require('rimraf');var config=require(_0x2510('0x5'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x58e974,_0x165f73){return _0x58e974[_0x2510('0x6')](_0x2510('0x7'),attributes,{'tableName':_0x2510('0x8'),'paranoid':![],'indexes':[{'name':_0x2510('0x9'),'fields':['idField',_0x2510('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index fd62637..44a8c7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d00=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment'];(function(_0x827f38,_0x460412){var _0x6effb4=function(_0x1b15b1){while(--_0x1b15b1){_0x827f38['push'](_0x827f38['shift']());}};_0x6effb4(++_0x460412);}(_0x0d00,0x189));var _0x00d0=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0x0d00[_0x2ac5f8];return _0x3b8229;};'use strict';var _=require(_0x00d0('0x0'));var util=require(_0x00d0('0x1'));var moment=require(_0x00d0('0x2'));var BPromise=require(_0x00d0('0x3'));var rs=require(_0x00d0('0x4'));var fs=require('fs');var Redis=require(_0x00d0('0x5'));var db=require(_0x00d0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x00d0('0x7'))(_0x00d0('0x8'));var config=require(_0x00d0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x00d0('0xa')][_0x00d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16d47d,_0x562f80,_0x174dbb){return new BPromise(function(_0x2d652d,_0x5a559d){return client[_0x00d0('0xc')](_0x16d47d,_0x174dbb)[_0x00d0('0xd')](function(_0xdb5cbe){logger[_0x00d0('0xe')](_0x00d0('0xf'),_0x562f80,_0x00d0('0x10'));logger[_0x00d0('0x11')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x562f80,'request\x20sent',JSON[_0x00d0('0x12')](_0xdb5cbe));if(_0xdb5cbe[_0x00d0('0x13')]){if(_0xdb5cbe[_0x00d0('0x13')]['code']===0x1f4){logger[_0x00d0('0x13')](_0x00d0('0xf'),_0x562f80,_0xdb5cbe[_0x00d0('0x13')][_0x00d0('0x14')]);return _0x5a559d(_0xdb5cbe['error'][_0x00d0('0x14')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x562f80,_0xdb5cbe[_0x00d0('0x13')][_0x00d0('0x14')]);return _0x2d652d(_0xdb5cbe[_0x00d0('0x13')][_0x00d0('0x14')]);}else{logger[_0x00d0('0xe')](_0x00d0('0xf'),_0x562f80,_0x00d0('0x10'));_0x2d652d(_0xdb5cbe['result'][_0x00d0('0x14')]);}})[_0x00d0('0x15')](function(_0x5b0117){logger['error']('VtigerField,\x20%s,\x20%s',_0x562f80,_0x5b0117);_0x5a559d(_0x5b0117);});});}
\ No newline at end of file
+var _0xbefb=['../../config/utils','../../config/logger','client','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','../../mysqldb'];(function(_0x538968,_0x328a09){var _0x2206f2=function(_0x79baf3){while(--_0x79baf3){_0x538968['push'](_0x538968['shift']());}};_0x2206f2(++_0x328a09);}(_0xbefb,0x1ed));var _0xbbef=function(_0x937e9b,_0x5d9f41){_0x937e9b=_0x937e9b-0x0;var _0x2704d0=_0xbefb[_0x937e9b];return _0x2704d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbbef('0x0'));var BPromise=require(_0xbbef('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbef('0x2'))['db'];var utils=require(_0xbbef('0x3'));var logger=require(_0xbbef('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbbef('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5725ed,_0x26b346,_0x162cd3){return new BPromise(function(_0x5e7804,_0x176e92){return client[_0xbbef('0x6')](_0x5725ed,_0x162cd3)['then'](function(_0x36641d){logger[_0xbbef('0x7')](_0xbbef('0x8'),_0x26b346,_0xbbef('0x9'));logger[_0xbbef('0xa')](_0xbbef('0xb'),_0x26b346,_0xbbef('0x9'),JSON['stringify'](_0x36641d));if(_0x36641d[_0xbbef('0xc')]){if(_0x36641d[_0xbbef('0xc')][_0xbbef('0xd')]===0x1f4){logger[_0xbbef('0xc')](_0xbbef('0x8'),_0x26b346,_0x36641d[_0xbbef('0xc')][_0xbbef('0xe')]);return _0x176e92(_0x36641d[_0xbbef('0xc')][_0xbbef('0xe')]);}logger[_0xbbef('0xc')](_0xbbef('0x8'),_0x26b346,_0x36641d[_0xbbef('0xc')][_0xbbef('0xe')]);return _0x5e7804(_0x36641d[_0xbbef('0xc')][_0xbbef('0xe')]);}else{logger[_0xbbef('0x7')](_0xbbef('0x8'),_0x26b346,'request\x20sent');_0x5e7804(_0x36641d['result'][_0xbbef('0xe')]);}})[_0xbbef('0xf')](function(_0x14b425){logger['error'](_0xbbef('0x8'),_0x26b346,_0x14b425);_0x176e92(_0x14b425);});});}
\ No newline at end of file
index 4694270..cb9499c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5188=['/:id','show','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','isAuthenticated','index','get'];(function(_0x586209,_0x208f76){var _0x15a964=function(_0x56ec77){while(--_0x56ec77){_0x586209['push'](_0x586209['shift']());}};_0x15a964(++_0x208f76);}(_0x5188,0xe6));var _0x8518=function(_0x1d2313,_0x504f0b){_0x1d2313=_0x1d2313-0x0;var _0x56fc17=_0x5188[_0x1d2313];return _0x56fc17;};'use strict';var multer=require(_0x8518('0x0'));var util=require(_0x8518('0x1'));var path=require('path');var timeout=require(_0x8518('0x2'));var express=require(_0x8518('0x3'));var router=express[_0x8518('0x4')]();var fs_extra=require(_0x8518('0x5'));var auth=require(_0x8518('0x6'));var interaction=require(_0x8518('0x7'));var config=require('../../config/environment');var controller=require(_0x8518('0x8'));router['get']('/',auth[_0x8518('0x9')](),controller[_0x8518('0xa')]);router[_0x8518('0xb')](_0x8518('0xc'),auth[_0x8518('0x9')](),controller[_0x8518('0xd')]);router[_0x8518('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8518('0xe')]);router[_0x8518('0xb')](_0x8518('0xf'),auth['isAuthenticated'](),controller[_0x8518('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8518('0x11')]);router[_0x8518('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8518('0x13')]);router['put'](_0x8518('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8518('0xc'),auth['isAuthenticated'](),controller[_0x8518('0x14')]);module[_0x8518('0x15')]=router;
\ No newline at end of file
+var _0x27af=['/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x27af,0x199));var _0xf27a=function(_0x59330,_0x57c26c){_0x59330=_0x59330-0x0;var _0x494e07=_0x27af[_0x59330];return _0x494e07;};'use strict';var multer=require(_0xf27a('0x0'));var util=require(_0xf27a('0x1'));var path=require(_0xf27a('0x2'));var timeout=require('connect-timeout');var express=require(_0xf27a('0x3'));var router=express[_0xf27a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf27a('0x5'));var config=require(_0xf27a('0x6'));var controller=require(_0xf27a('0x7'));router[_0xf27a('0x8')]('/',auth[_0xf27a('0x9')](),controller[_0xf27a('0xa')]);router[_0xf27a('0x8')](_0xf27a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf27a('0x8')](_0xf27a('0xc'),auth[_0xf27a('0x9')](),controller[_0xf27a('0xd')]);router['get']('/:id/fields',auth[_0xf27a('0x9')](),controller[_0xf27a('0xe')]);router[_0xf27a('0xf')]('/',auth[_0xf27a('0x9')](),controller[_0xf27a('0x10')]);router[_0xf27a('0xf')](_0xf27a('0xc'),auth[_0xf27a('0x9')](),controller[_0xf27a('0x11')]);router[_0xf27a('0x12')](_0xf27a('0xb'),auth[_0xf27a('0x9')](),controller['update']);router[_0xf27a('0x13')]('/:id',auth[_0xf27a('0x9')](),controller[_0xf27a('0x14')]);module['exports']=router;
\ No newline at end of file
index d014353..9039256 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd959=['password','token','integrationTab','newTab','sequelize','exports','STRING','username','ENUM'];(function(_0x404eff,_0x4ef653){var _0x46cc25=function(_0xac13af){while(--_0xac13af){_0x404eff['push'](_0x404eff['shift']());}};_0x46cc25(++_0x4ef653);}(_0xd959,0x94));var _0x9d95=function(_0x1a16e3,_0x125721){_0x1a16e3=_0x1a16e3-0x0;var _0x2be546=_0xd959[_0x1a16e3];return _0x2be546;};'use strict';var Sequelize=require(_0x9d95('0x0'));module[_0x9d95('0x1')]={'name':{'type':Sequelize[_0x9d95('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9d95('0x2')],'unique':_0x9d95('0x3')},'password':{'type':Sequelize[_0x9d95('0x2')]},'token':{'type':Sequelize[_0x9d95('0x2')]},'remoteUri':{'type':Sequelize[_0x9d95('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x9d95('0x4')](_0x9d95('0x5'),_0x9d95('0x6')),'defaultValue':_0x9d95('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x9d95('0x4')](_0x9d95('0x7'),_0x9d95('0x8')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0xb6a6=['newTab','integrationTab','sequelize','exports','STRING','username','ENUM','password','token'];(function(_0x1a694f,_0x274891){var _0x15f2ab=function(_0x5868f9){while(--_0x5868f9){_0x1a694f['push'](_0x1a694f['shift']());}};_0x15f2ab(++_0x274891);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x4f9106,_0x4e1b30){_0x4f9106=_0x4f9106-0x0;var _0x1055a3=_0xb6a6[_0x4f9106];return _0x1055a3;};'use strict';var Sequelize=require(_0x6b6a('0x0'));module[_0x6b6a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b6a('0x2')],'unique':_0x6b6a('0x3')},'password':{'type':Sequelize[_0x6b6a('0x2')]},'token':{'type':Sequelize[_0x6b6a('0x2')]},'remoteUri':{'type':Sequelize[_0x6b6a('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x6b6a('0x4')](_0x6b6a('0x5'),_0x6b6a('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x6b6a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6b6a('0x4')]('integrationTab',_0x6b6a('0x7')),'defaultValue':_0x6b6a('0x8')}};
\ No newline at end of file
index 12e35a0..074ecc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1775=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','body','destroy','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','GET','format','%s/%s','password','headers','%s:%s','base64','Basic\x20%s','%s/token:%s','ValidationError','subject','description','assignee','remove','ticket_fields','includes','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x547e52,_0x54a032){var _0x327896=function(_0x229251){while(--_0x229251){_0x547e52['push'](_0x547e52['shift']());}};_0x327896(++_0x54a032);}(_0x1775,0x1db));var _0x5177=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1775[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];var integrations=require(_0x5177('0x1c'));function respondWithStatusCode(_0x3c4ced,_0x111e99){_0x111e99=_0x111e99||0xcc;return function(_0x299eba){if(_0x299eba){return _0x3c4ced[_0x5177('0x1d')](_0x111e99);}return _0x3c4ced[_0x5177('0x1e')](_0x111e99)[_0x5177('0x1f')]();};}function respondWithResult(_0x1eb9dd,_0x41bef4){_0x41bef4=_0x41bef4||0xc8;return function(_0x2bf5bb){if(_0x2bf5bb){return _0x1eb9dd[_0x5177('0x1e')](_0x41bef4)[_0x5177('0x20')](_0x2bf5bb);}};}function respondWithFilteredResult(_0x1b32e6,_0x175ca6){return function(_0x2ab5e5){if(_0x2ab5e5){var _0x7dba6f=typeof _0x175ca6[_0x5177('0x21')]==='undefined'&&typeof _0x175ca6[_0x5177('0x22')]===_0x5177('0x23');var _0x3f5ab5=_0x2ab5e5[_0x5177('0x24')];var _0x5f5bd4=_0x7dba6f?0x0:_0x175ca6[_0x5177('0x21')];var _0x2ebf91=_0x7dba6f?_0x2ab5e5[_0x5177('0x24')]:_0x175ca6['offset']+_0x175ca6[_0x5177('0x22')];var _0x4cf600;if(_0x2ebf91>=_0x3f5ab5){_0x2ebf91=_0x3f5ab5;_0x4cf600=0xc8;}else{_0x4cf600=0xce;}_0x1b32e6[_0x5177('0x1e')](_0x4cf600);return _0x1b32e6[_0x5177('0x25')](_0x5177('0x26'),_0x5f5bd4+'-'+_0x2ebf91+'/'+_0x3f5ab5)[_0x5177('0x20')](_0x2ab5e5);}return null;};}function patchUpdates(_0x451e5c){return function(_0x3314f2){try{jsonpatch[_0x5177('0x27')](_0x3314f2,_0x451e5c,!![]);}catch(_0xfc1bd4){return BPromise[_0x5177('0x28')](_0xfc1bd4);}return _0x3314f2[_0x5177('0x29')]();};}function saveUpdates(_0x23dad2,_0x3b0c37){return function(_0x5d9a9c){if(_0x5d9a9c){return _0x5d9a9c[_0x5177('0x2a')](_0x23dad2)['then'](function(_0x30b60f){return _0x30b60f;});}return null;};}function removeEntity(_0x2c68d8,_0x3b39b5){return function(_0x2d51d0){if(_0x2d51d0){return _0x2d51d0['destroy']()[_0x5177('0x2b')](function(){_0x2c68d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a0c2,_0x15cb93){return function(_0x577bf7){if(!_0x577bf7){_0x19a0c2[_0x5177('0x1d')](0x194);}return _0x577bf7;};}function handleError(_0x4eba3a,_0x231d35){_0x231d35=_0x231d35||0x1f4;return function(_0x1cbd29){logger['error'](_0x1cbd29[_0x5177('0x2c')]);if(_0x1cbd29[_0x5177('0x2d')]){delete _0x1cbd29[_0x5177('0x2d')];}_0x4eba3a[_0x5177('0x1e')](_0x231d35)[_0x5177('0x2e')](_0x1cbd29);};}exports[_0x5177('0x2f')]=function(_0x5577bb,_0x498fcd){var _0x45cf20={},_0x1c660e={},_0x7dae59={'count':0x0,'rows':[]};var _0x174f7a=_[_0x5177('0x30')](db[_0x5177('0x31')][_0x5177('0x32')],function(_0x72dced){return{'name':_0x72dced['fieldName'],'type':_0x72dced[_0x5177('0x33')][_0x5177('0x34')]};});_0x1c660e['model']=_[_0x5177('0x30')](_0x174f7a,'name');_0x1c660e[_0x5177('0x35')]=_[_0x5177('0x36')](_0x5577bb[_0x5177('0x35')]);_0x1c660e['filters']=_['intersection'](_0x1c660e[_0x5177('0x37')],_0x1c660e[_0x5177('0x35')]);_0x45cf20[_0x5177('0x38')]=_[_0x5177('0x39')](_0x1c660e[_0x5177('0x37')],qs[_0x5177('0x3a')](_0x5577bb[_0x5177('0x35')][_0x5177('0x3a')]));_0x45cf20['attributes']=_0x45cf20[_0x5177('0x38')][_0x5177('0x3b')]?_0x45cf20['attributes']:_0x1c660e[_0x5177('0x37')];if(!_0x5577bb[_0x5177('0x35')][_0x5177('0x3c')](_0x5177('0x3d'))){_0x45cf20[_0x5177('0x22')]=qs[_0x5177('0x22')](_0x5577bb['query'][_0x5177('0x22')]);_0x45cf20[_0x5177('0x21')]=qs[_0x5177('0x21')](_0x5577bb[_0x5177('0x35')][_0x5177('0x21')]);}_0x45cf20[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0x5577bb['query'][_0x5177('0x3f')]);_0x45cf20[_0x5177('0x40')]=qs['filters'](_['pick'](_0x5577bb[_0x5177('0x35')],_0x1c660e[_0x5177('0x41')]),_0x174f7a);if(_0x5577bb[_0x5177('0x35')][_0x5177('0x42')]){_0x45cf20[_0x5177('0x40')]=_[_0x5177('0x43')](_0x45cf20[_0x5177('0x40')],{'$or':_[_0x5177('0x30')](_0x174f7a,function(_0xa2ed49){if(_0xa2ed49[_0x5177('0x33')]!==_0x5177('0x44')){var _0x1f15f8={};_0x1f15f8[_0xa2ed49[_0x5177('0x2d')]]={'$like':'%'+_0x5577bb['query'][_0x5177('0x42')]+'%'};return _0x1f15f8;}})});}_0x45cf20=_[_0x5177('0x43')]({},_0x45cf20,_0x5577bb['options']);var _0x7341c0={'where':_0x45cf20['where']};return db[_0x5177('0x31')][_0x5177('0x24')](_0x7341c0)[_0x5177('0x2b')](function(_0x5742aa){_0x7dae59['count']=_0x5742aa;if(_0x5577bb[_0x5177('0x35')][_0x5177('0x45')]){_0x45cf20[_0x5177('0x46')]=[{'all':!![]}];}return db[_0x5177('0x31')][_0x5177('0x47')](_0x45cf20);})[_0x5177('0x2b')](function(_0x41d874){_0x7dae59[_0x5177('0x48')]=_0x41d874;return _0x7dae59;})['then'](respondWithFilteredResult(_0x498fcd,_0x45cf20))[_0x5177('0x49')](handleError(_0x498fcd,null));};exports['show']=function(_0x5e3d30,_0x30e4f3){var _0x17dc98={'raw':![],'where':{'id':_0x5e3d30[_0x5177('0x4a')]['id']}},_0x5172f8={};_0x5172f8['model']=_['keys'](db[_0x5177('0x31')][_0x5177('0x32')]);_0x5172f8[_0x5177('0x35')]=_[_0x5177('0x36')](_0x5e3d30[_0x5177('0x35')]);_0x5172f8[_0x5177('0x41')]=_[_0x5177('0x39')](_0x5172f8['model'],_0x5172f8['query']);_0x17dc98[_0x5177('0x38')]=_['intersection'](_0x5172f8[_0x5177('0x37')],qs[_0x5177('0x3a')](_0x5e3d30[_0x5177('0x35')][_0x5177('0x3a')]));_0x17dc98['attributes']=_0x17dc98[_0x5177('0x38')][_0x5177('0x3b')]?_0x17dc98[_0x5177('0x38')]:_0x5172f8[_0x5177('0x37')];if(_0x5e3d30[_0x5177('0x35')][_0x5177('0x45')]){_0x17dc98[_0x5177('0x46')]=[{'all':!![]}];}_0x17dc98=_[_0x5177('0x43')]({},_0x17dc98,_0x5e3d30[_0x5177('0x4b')]);return db[_0x5177('0x31')][_0x5177('0x4c')](_0x17dc98)['then'](handleEntityNotFound(_0x30e4f3,null))[_0x5177('0x2b')](respondWithResult(_0x30e4f3,null))['catch'](handleError(_0x30e4f3,null));};exports['create']=function(_0x5bda8a,_0x2f9ff9){return db[_0x5177('0x31')]['create'](_0x5bda8a[_0x5177('0x4d')],{})[_0x5177('0x2b')](respondWithResult(_0x2f9ff9,0xc9))[_0x5177('0x49')](handleError(_0x2f9ff9,null));};exports['update']=function(_0x1d4ae4,_0x5981dc){if(_0x1d4ae4['body']['id']){delete _0x1d4ae4['body']['id'];}return db[_0x5177('0x31')][_0x5177('0x4c')]({'where':{'id':_0x1d4ae4[_0x5177('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5981dc,null))['then'](saveUpdates(_0x1d4ae4[_0x5177('0x4d')],null))['then'](respondWithResult(_0x5981dc,null))[_0x5177('0x49')](handleError(_0x5981dc,null));};exports[_0x5177('0x4e')]=function(_0x430e8e,_0x31a6e1){return db[_0x5177('0x31')][_0x5177('0x4c')]({'where':{'id':_0x430e8e[_0x5177('0x4a')]['id']}})[_0x5177('0x2b')](handleEntityNotFound(_0x31a6e1,null))[_0x5177('0x2b')](removeEntity(_0x31a6e1,null))[_0x5177('0x49')](handleError(_0x31a6e1,null));};exports[_0x5177('0x4f')]=function(_0xb08267,_0x422d6c,_0x4c2068){var _0x59376b={};var _0x29ff0f={};var _0x5d5016;var _0x649c6f;return db['ZendeskAccount'][_0x5177('0x50')]({'where':{'id':_0xb08267[_0x5177('0x4a')]['id']}})[_0x5177('0x2b')](handleEntityNotFound(_0x422d6c,null))['then'](function(_0x5be224){if(_0x5be224){_0x5d5016=_0x5be224;_0x29ff0f[_0x5177('0x37')]=_[_0x5177('0x36')](db[_0x5177('0x51')][_0x5177('0x32')]);_0x29ff0f['query']=_['keys'](_0xb08267[_0x5177('0x35')]);_0x29ff0f[_0x5177('0x41')]=_[_0x5177('0x39')](_0x29ff0f[_0x5177('0x37')],_0x29ff0f['query']);_0x59376b[_0x5177('0x38')]=_[_0x5177('0x39')](_0x29ff0f[_0x5177('0x37')],qs['fields'](_0xb08267[_0x5177('0x35')][_0x5177('0x3a')]));_0x59376b[_0x5177('0x38')]=_0x59376b['attributes'][_0x5177('0x3b')]?_0x59376b['attributes']:_0x29ff0f[_0x5177('0x37')];_0x59376b[_0x5177('0x3e')]=qs[_0x5177('0x3f')](_0xb08267['query'][_0x5177('0x3f')]);_0x59376b[_0x5177('0x40')]=qs[_0x5177('0x41')](_[_0x5177('0x52')](_0xb08267[_0x5177('0x35')],_0x29ff0f[_0x5177('0x41')]));if(_0xb08267[_0x5177('0x35')][_0x5177('0x42')]){_0x59376b['where']=_['merge'](_0x59376b['where'],{'$or':_[_0x5177('0x30')](_0x59376b[_0x5177('0x38')],function(_0x35aa22){var _0x75cc0e={};_0x75cc0e[_0x35aa22]={'$like':'%'+_0xb08267[_0x5177('0x35')][_0x5177('0x42')]+'%'};return _0x75cc0e;})});}_0x59376b=_['merge']({},_0x59376b,_0xb08267['options']);return _0x5d5016[_0x5177('0x4f')](_0x59376b);}})[_0x5177('0x2b')](function(_0x1f294e){if(_0x1f294e){_0x649c6f=_0x1f294e[_0x5177('0x3b')];if(!_0xb08267[_0x5177('0x35')][_0x5177('0x3c')](_0x5177('0x3d'))){_0x59376b[_0x5177('0x22')]=qs[_0x5177('0x22')](_0xb08267['query'][_0x5177('0x22')]);_0x59376b[_0x5177('0x21')]=qs['offset'](_0xb08267[_0x5177('0x35')][_0x5177('0x21')]);}return _0x5d5016['getConfigurations'](_0x59376b);}})[_0x5177('0x2b')](function(_0x2f3344){if(_0x2f3344){return _0x2f3344?{'count':_0x649c6f,'rows':_0x2f3344}:null;}})[_0x5177('0x2b')](respondWithResult(_0x422d6c,null))['catch'](handleError(_0x422d6c,null));};exports[_0x5177('0x53')]=function(_0x400e27,_0x5f5bd5,_0x52a6c2){if(_0x400e27[_0x5177('0x4d')]['id']){delete _0x400e27['body']['id'];}return db[_0x5177('0x31')]['findOne']({'where':{'id':_0x400e27[_0x5177('0x4a')]['id']}})[_0x5177('0x2b')](handleEntityNotFound(_0x5f5bd5,null))['then'](function(_0x2af938){if(_0x2af938){_0x400e27[_0x5177('0x4d')][_0x5177('0x54')]=_0x2af938['id'];_0x400e27[_0x5177('0x4d')][_0x5177('0x55')]=integrations[_0x5177('0x56')](_0x400e27[_0x5177('0x4d')]['channel'],_0x400e27[_0x5177('0x4d')]['type']);_0x400e27['body'][_0x5177('0x57')]=integrations[_0x5177('0x58')](_0x400e27['body'][_0x5177('0x59')],_0x400e27[_0x5177('0x4d')][_0x5177('0x33')]);return db[_0x5177('0x51')][_0x5177('0x5a')](_0x400e27[_0x5177('0x4d')],{'include':[{'model':db[_0x5177('0x5b')],'as':_0x5177('0x55')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x5177('0x2b')](respondWithResult(_0x5f5bd5,null))[_0x5177('0x49')](handleError(_0x5f5bd5,null));};exports[_0x5177('0x5c')]=function(_0x2d24b3,_0x3de0b5,_0x3dd58f){var _0x4fc289='';return db[_0x5177('0x31')][_0x5177('0x50')]({'where':{'id':_0x2d24b3[_0x5177('0x4a')]['id']},'attributes':['id',_0x5177('0x5d'),'password',_0x5177('0x5e'),_0x5177('0x5f'),_0x5177('0x60')]})[_0x5177('0x2b')](handleEntityNotFound(_0x3de0b5,null))[_0x5177('0x2b')](function(_0x5130e6){if(_0x5130e6){_0x4fc289=_0x5130e6[_0x5177('0x60')];var _0x4aa8d3=_0x4fc289[_0x5177('0x61')](-0x1);if(_0x4aa8d3==='/'){_0x4fc289=_0x4fc289[_0x5177('0x62')](0x0,_0x4fc289['lastIndexOf'](_0x4aa8d3));}var _0x67d605={'method':_0x5177('0x63'),'uri':util[_0x5177('0x64')](_0x5177('0x65'),_0x4fc289,'ticket_fields'),'json':!![]};switch(_0x5130e6[_0x5177('0x5f')]){case _0x5177('0x66'):_0x67d605[_0x5177('0x67')]={'Authorization':util[_0x5177('0x64')]('Basic\x20%s',new Buffer(util[_0x5177('0x64')](_0x5177('0x68'),_0x5130e6[_0x5177('0x5d')],_0x5130e6['password']))['toString'](_0x5177('0x69')))};break;case _0x5177('0x5e'):_0x67d605[_0x5177('0x67')]={'Authorization':util[_0x5177('0x64')](_0x5177('0x6a'),new Buffer(util[_0x5177('0x64')](_0x5177('0x6b'),_0x5130e6[_0x5177('0x5d')],_0x5130e6[_0x5177('0x5e')]))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x5177('0x6c'))]('Unknown\x20authentication\x20type');}return rp(_0x67d605);}})[_0x5177('0x2b')](function(_0x3255a2){if(_0x3255a2){var _0x56c1aa=[_0x5177('0x6d'),_0x5177('0x6e'),'group',_0x5177('0x6f')];_[_0x5177('0x70')](_0x3255a2[_0x5177('0x71')],function(_0x4fce32){return _0x56c1aa[_0x5177('0x72')](_0x4fce32['type']);});return{'count':_0x3255a2[_0x5177('0x71')][_0x5177('0x3b')],'rows':_['map'](_0x3255a2[_0x5177('0x71')],function(_0x3f3031){return{'id':_0x3f3031['id'],'name':_0x3f3031['position']>0x7?_0x3f3031['title']:_0x3f3031[_0x5177('0x33')],'custom':_0x3f3031['position']>0x7?!![]:![],'options':_0x3f3031[_0x5177('0x73')]?_0x3f3031[_0x5177('0x73')]:_0x3f3031['custom_field_options']?_0x3f3031[_0x5177('0x74')]:[]};})};}})[_0x5177('0x2b')](respondWithResult(_0x3de0b5,null))[_0x5177('0x49')](function(_0x20ceb9){var _0x43a584=_0x2d24b3[_0x5177('0x35')][_0x5177('0x75')]?0x1f4:_0x20ceb9[_0x5177('0x76')]||0x1f4;logger['error'](_0x5177('0x77'),'getFields',_0x43a584,JSON[_0x5177('0x78')](_0x20ceb9));delete _0x20ceb9[_0x5177('0x2d')];if(_0x43a584===0x191){_0x43a584=0x190;}_0x3de0b5[_0x5177('0x1e')](_0x43a584)[_0x5177('0x2e')](_0x2d24b3['query'][_0x5177('0x75')]?{'message':_0x5177('0x79'),'statusCode':_0x20ceb9['statusCode']}:_0x20ceb9);});};
\ No newline at end of file
+var _0x97c1=['crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ZendeskAccount','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','findOne','params','ZendeskConfiguration','getConfigurations','addConfiguration','getSubjects','channel','getDescriptions','ZendeskField','Subjects','Descriptions','getFields','authType','remoteUri','slice','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','username','password','base64','token','%s/token:%s','toString','Sequelize','subject','description','group','assignee','remove','position','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel'];(function(_0x2fc874,_0xa919c9){var _0x1b9277=function(_0x1cb44c){while(--_0x1cb44c){_0x2fc874['push'](_0x2fc874['shift']());}};_0x1b9277(++_0xa919c9);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x197c('0x0'));var rimraf=require(_0x197c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x197c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x197c('0x3'));var Mustache=require(_0x197c('0x4'));var util=require(_0x197c('0x5'));var path=require(_0x197c('0x6'));var sox=require(_0x197c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x197c('0x8'));var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var Redis=require(_0x197c('0xe'));var authService=require(_0x197c('0xf'));var qs=require(_0x197c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x197c('0x11'));var logger=require(_0x197c('0x12'))(_0x197c('0x13'));var utils=require(_0x197c('0x14'));var config=require(_0x197c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x197c('0x16'))['db'];var integrations=require(_0x197c('0x17'));function respondWithStatusCode(_0x27e46f,_0x1adcfa){_0x1adcfa=_0x1adcfa||0xcc;return function(_0x567658){if(_0x567658){return _0x27e46f[_0x197c('0x18')](_0x1adcfa);}return _0x27e46f[_0x197c('0x19')](_0x1adcfa)[_0x197c('0x1a')]();};}function respondWithResult(_0xf735ce,_0x188ff2){_0x188ff2=_0x188ff2||0xc8;return function(_0x109af2){if(_0x109af2){return _0xf735ce['status'](_0x188ff2)['json'](_0x109af2);}};}function respondWithFilteredResult(_0x422dfa,_0x2bc612){return function(_0x2083d4){if(_0x2083d4){var _0x24901f=typeof _0x2bc612[_0x197c('0x1b')]===_0x197c('0x1c')&&typeof _0x2bc612[_0x197c('0x1d')]===_0x197c('0x1c');var _0x47f43b=_0x2083d4[_0x197c('0x1e')];var _0x47aaa9=_0x24901f?0x0:_0x2bc612['offset'];var _0x1725d9=_0x24901f?_0x2083d4[_0x197c('0x1e')]:_0x2bc612[_0x197c('0x1b')]+_0x2bc612[_0x197c('0x1d')];var _0x4a4994;if(_0x1725d9>=_0x47f43b){_0x1725d9=_0x47f43b;_0x4a4994=0xc8;}else{_0x4a4994=0xce;}_0x422dfa[_0x197c('0x19')](_0x4a4994);return _0x422dfa[_0x197c('0x1f')](_0x197c('0x20'),_0x47aaa9+'-'+_0x1725d9+'/'+_0x47f43b)['json'](_0x2083d4);}return null;};}function patchUpdates(_0x1adb43){return function(_0x27b3df){try{jsonpatch[_0x197c('0x21')](_0x27b3df,_0x1adb43,!![]);}catch(_0xf3aeda){return BPromise[_0x197c('0x22')](_0xf3aeda);}return _0x27b3df[_0x197c('0x23')]();};}function saveUpdates(_0x362bbf,_0x2092a0){return function(_0x8963fd){if(_0x8963fd){return _0x8963fd[_0x197c('0x24')](_0x362bbf)[_0x197c('0x25')](function(_0x177bc9){return _0x177bc9;});}return null;};}function removeEntity(_0x174942,_0x2a1310){return function(_0x37b040){if(_0x37b040){return _0x37b040[_0x197c('0x26')]()['then'](function(){_0x174942[_0x197c('0x19')](0xcc)[_0x197c('0x1a')]();});}};}function handleEntityNotFound(_0x2b6319,_0x499051){return function(_0x2c2952){if(!_0x2c2952){_0x2b6319[_0x197c('0x18')](0x194);}return _0x2c2952;};}function handleError(_0x4c3337,_0x5e7bc9){_0x5e7bc9=_0x5e7bc9||0x1f4;return function(_0x12b37b){logger['error'](_0x12b37b[_0x197c('0x27')]);if(_0x12b37b[_0x197c('0x28')]){delete _0x12b37b[_0x197c('0x28')];}_0x4c3337[_0x197c('0x19')](_0x5e7bc9)[_0x197c('0x29')](_0x12b37b);};}exports[_0x197c('0x2a')]=function(_0x2b6154,_0x215df1){var _0x4422d1={},_0x5df39e={},_0x50dea3={'count':0x0,'rows':[]};var _0x574274=_['map'](db[_0x197c('0x2b')]['rawAttributes'],function(_0x252cde){return{'name':_0x252cde[_0x197c('0x2c')],'type':_0x252cde['type'][_0x197c('0x2d')]};});_0x5df39e['model']=_[_0x197c('0x2e')](_0x574274,_0x197c('0x28'));_0x5df39e[_0x197c('0x2f')]=_[_0x197c('0x30')](_0x2b6154[_0x197c('0x2f')]);_0x5df39e[_0x197c('0x31')]=_[_0x197c('0x32')](_0x5df39e[_0x197c('0x33')],_0x5df39e[_0x197c('0x2f')]);_0x4422d1['attributes']=_['intersection'](_0x5df39e[_0x197c('0x33')],qs[_0x197c('0x34')](_0x2b6154[_0x197c('0x2f')][_0x197c('0x34')]));_0x4422d1[_0x197c('0x35')]=_0x4422d1[_0x197c('0x35')][_0x197c('0x36')]?_0x4422d1['attributes']:_0x5df39e['model'];if(!_0x2b6154[_0x197c('0x2f')][_0x197c('0x37')]('nolimit')){_0x4422d1['limit']=qs[_0x197c('0x1d')](_0x2b6154[_0x197c('0x2f')][_0x197c('0x1d')]);_0x4422d1[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x2b6154[_0x197c('0x2f')][_0x197c('0x1b')]);}_0x4422d1[_0x197c('0x38')]=qs[_0x197c('0x39')](_0x2b6154['query'][_0x197c('0x39')]);_0x4422d1[_0x197c('0x3a')]=qs[_0x197c('0x31')](_[_0x197c('0x3b')](_0x2b6154[_0x197c('0x2f')],_0x5df39e[_0x197c('0x31')]),_0x574274);if(_0x2b6154['query'][_0x197c('0x3c')]){_0x4422d1[_0x197c('0x3a')]=_[_0x197c('0x3d')](_0x4422d1['where'],{'$or':_[_0x197c('0x2e')](_0x574274,function(_0x34dabc){if(_0x34dabc[_0x197c('0x3e')]!==_0x197c('0x3f')){var _0x2970b4={};_0x2970b4[_0x34dabc[_0x197c('0x28')]]={'$like':'%'+_0x2b6154[_0x197c('0x2f')][_0x197c('0x3c')]+'%'};return _0x2970b4;}})});}_0x4422d1=_[_0x197c('0x3d')]({},_0x4422d1,_0x2b6154[_0x197c('0x40')]);var _0x4a12fc={'where':_0x4422d1[_0x197c('0x3a')]};return db[_0x197c('0x2b')]['count'](_0x4a12fc)['then'](function(_0xa57083){_0x50dea3[_0x197c('0x1e')]=_0xa57083;if(_0x2b6154[_0x197c('0x2f')][_0x197c('0x41')]){_0x4422d1[_0x197c('0x42')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x197c('0x43')](_0x4422d1);})[_0x197c('0x25')](function(_0x7ed02b){_0x50dea3[_0x197c('0x44')]=_0x7ed02b;return _0x50dea3;})[_0x197c('0x25')](respondWithFilteredResult(_0x215df1,_0x4422d1))['catch'](handleError(_0x215df1,null));};exports[_0x197c('0x45')]=function(_0x37bb94,_0x6d7bda){var _0x197b27={'raw':![],'where':{'id':_0x37bb94['params']['id']}},_0x2f3c4b={};_0x2f3c4b[_0x197c('0x33')]=_[_0x197c('0x30')](db[_0x197c('0x2b')][_0x197c('0x46')]);_0x2f3c4b[_0x197c('0x2f')]=_[_0x197c('0x30')](_0x37bb94[_0x197c('0x2f')]);_0x2f3c4b[_0x197c('0x31')]=_[_0x197c('0x32')](_0x2f3c4b[_0x197c('0x33')],_0x2f3c4b[_0x197c('0x2f')]);_0x197b27['attributes']=_['intersection'](_0x2f3c4b['model'],qs['fields'](_0x37bb94[_0x197c('0x2f')][_0x197c('0x34')]));_0x197b27['attributes']=_0x197b27[_0x197c('0x35')][_0x197c('0x36')]?_0x197b27['attributes']:_0x2f3c4b[_0x197c('0x33')];if(_0x37bb94[_0x197c('0x2f')]['includeAll']){_0x197b27[_0x197c('0x42')]=[{'all':!![]}];}_0x197b27=_[_0x197c('0x3d')]({},_0x197b27,_0x37bb94['options']);return db[_0x197c('0x2b')][_0x197c('0x47')](_0x197b27)[_0x197c('0x25')](handleEntityNotFound(_0x6d7bda,null))['then'](respondWithResult(_0x6d7bda,null))[_0x197c('0x48')](handleError(_0x6d7bda,null));};exports[_0x197c('0x49')]=function(_0x220909,_0x1a92d2){return db['ZendeskAccount'][_0x197c('0x49')](_0x220909[_0x197c('0x4a')],{})[_0x197c('0x25')](respondWithResult(_0x1a92d2,0xc9))['catch'](handleError(_0x1a92d2,null));};exports['update']=function(_0x3a5089,_0x332c75){if(_0x3a5089[_0x197c('0x4a')]['id']){delete _0x3a5089[_0x197c('0x4a')]['id'];}return db[_0x197c('0x2b')][_0x197c('0x47')]({'where':{'id':_0x3a5089['params']['id']}})[_0x197c('0x25')](handleEntityNotFound(_0x332c75,null))['then'](saveUpdates(_0x3a5089[_0x197c('0x4a')],null))[_0x197c('0x25')](respondWithResult(_0x332c75,null))[_0x197c('0x48')](handleError(_0x332c75,null));};exports[_0x197c('0x26')]=function(_0x34a211,_0x2ab21f){return db[_0x197c('0x2b')][_0x197c('0x47')]({'where':{'id':_0x34a211['params']['id']}})[_0x197c('0x25')](handleEntityNotFound(_0x2ab21f,null))[_0x197c('0x25')](removeEntity(_0x2ab21f,null))[_0x197c('0x48')](handleError(_0x2ab21f,null));};exports['getConfigurations']=function(_0x114ef5,_0x495c1d,_0x204592){var _0x1d2a5f={};var _0x1ec51a={};var _0x22a106;var _0x1d7cdd;return db[_0x197c('0x2b')][_0x197c('0x4b')]({'where':{'id':_0x114ef5[_0x197c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x495c1d,null))[_0x197c('0x25')](function(_0x3a9261){if(_0x3a9261){_0x22a106=_0x3a9261;_0x1ec51a[_0x197c('0x33')]=_['keys'](db[_0x197c('0x4d')][_0x197c('0x46')]);_0x1ec51a[_0x197c('0x2f')]=_[_0x197c('0x30')](_0x114ef5[_0x197c('0x2f')]);_0x1ec51a['filters']=_['intersection'](_0x1ec51a[_0x197c('0x33')],_0x1ec51a[_0x197c('0x2f')]);_0x1d2a5f[_0x197c('0x35')]=_[_0x197c('0x32')](_0x1ec51a[_0x197c('0x33')],qs['fields'](_0x114ef5['query'][_0x197c('0x34')]));_0x1d2a5f[_0x197c('0x35')]=_0x1d2a5f['attributes'][_0x197c('0x36')]?_0x1d2a5f[_0x197c('0x35')]:_0x1ec51a[_0x197c('0x33')];_0x1d2a5f[_0x197c('0x38')]=qs[_0x197c('0x39')](_0x114ef5[_0x197c('0x2f')]['sort']);_0x1d2a5f[_0x197c('0x3a')]=qs[_0x197c('0x31')](_['pick'](_0x114ef5['query'],_0x1ec51a[_0x197c('0x31')]));if(_0x114ef5['query'][_0x197c('0x3c')]){_0x1d2a5f[_0x197c('0x3a')]=_[_0x197c('0x3d')](_0x1d2a5f['where'],{'$or':_[_0x197c('0x2e')](_0x1d2a5f[_0x197c('0x35')],function(_0x5585de){var _0x2dcbca={};_0x2dcbca[_0x5585de]={'$like':'%'+_0x114ef5[_0x197c('0x2f')][_0x197c('0x3c')]+'%'};return _0x2dcbca;})});}_0x1d2a5f=_['merge']({},_0x1d2a5f,_0x114ef5[_0x197c('0x40')]);return _0x22a106[_0x197c('0x4e')](_0x1d2a5f);}})['then'](function(_0x570d76){if(_0x570d76){_0x1d7cdd=_0x570d76[_0x197c('0x36')];if(!_0x114ef5[_0x197c('0x2f')][_0x197c('0x37')]('nolimit')){_0x1d2a5f[_0x197c('0x1d')]=qs[_0x197c('0x1d')](_0x114ef5[_0x197c('0x2f')]['limit']);_0x1d2a5f[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x114ef5[_0x197c('0x2f')][_0x197c('0x1b')]);}return _0x22a106[_0x197c('0x4e')](_0x1d2a5f);}})[_0x197c('0x25')](function(_0x8d1f3f){if(_0x8d1f3f){return _0x8d1f3f?{'count':_0x1d7cdd,'rows':_0x8d1f3f}:null;}})[_0x197c('0x25')](respondWithResult(_0x495c1d,null))[_0x197c('0x48')](handleError(_0x495c1d,null));};exports[_0x197c('0x4f')]=function(_0x5ef485,_0x1f7ad0,_0x572649){if(_0x5ef485['body']['id']){delete _0x5ef485['body']['id'];}return db['ZendeskAccount'][_0x197c('0x4b')]({'where':{'id':_0x5ef485[_0x197c('0x4c')]['id']}})[_0x197c('0x25')](handleEntityNotFound(_0x1f7ad0,null))[_0x197c('0x25')](function(_0x55b744){if(_0x55b744){_0x5ef485[_0x197c('0x4a')]['AccountId']=_0x55b744['id'];_0x5ef485[_0x197c('0x4a')]['Subjects']=integrations[_0x197c('0x50')](_0x5ef485['body'][_0x197c('0x51')],_0x5ef485[_0x197c('0x4a')][_0x197c('0x3e')]);_0x5ef485[_0x197c('0x4a')]['Descriptions']=integrations[_0x197c('0x52')](_0x5ef485[_0x197c('0x4a')][_0x197c('0x51')],_0x5ef485['body'][_0x197c('0x3e')]);return db[_0x197c('0x4d')][_0x197c('0x49')](_0x5ef485[_0x197c('0x4a')],{'include':[{'model':db[_0x197c('0x53')],'as':_0x197c('0x54')},{'model':db[_0x197c('0x53')],'as':_0x197c('0x55')}]});}return null;})[_0x197c('0x25')](respondWithResult(_0x1f7ad0,null))[_0x197c('0x48')](handleError(_0x1f7ad0,null));};exports[_0x197c('0x56')]=function(_0x25d3c1,_0x43c0b2,_0x395fce){var _0x2b1c78='';return db[_0x197c('0x2b')][_0x197c('0x4b')]({'where':{'id':_0x25d3c1[_0x197c('0x4c')]['id']},'attributes':['id','username','password','token',_0x197c('0x57'),'remoteUri']})[_0x197c('0x25')](handleEntityNotFound(_0x43c0b2,null))['then'](function(_0x5a601c){if(_0x5a601c){_0x2b1c78=_0x5a601c[_0x197c('0x58')];var _0x2c9746=_0x2b1c78[_0x197c('0x59')](-0x1);if(_0x2c9746==='/'){_0x2b1c78=_0x2b1c78['substring'](0x0,_0x2b1c78[_0x197c('0x5a')](_0x2c9746));}var _0x238092={'method':'GET','uri':util[_0x197c('0x5b')](_0x197c('0x5c'),_0x2b1c78,_0x197c('0x5d')),'json':!![]};switch(_0x5a601c[_0x197c('0x57')]){case'password':_0x238092[_0x197c('0x5e')]={'Authorization':util['format'](_0x197c('0x5f'),new Buffer(util['format'](_0x197c('0x60'),_0x5a601c[_0x197c('0x61')],_0x5a601c[_0x197c('0x62')]))['toString'](_0x197c('0x63')))};break;case _0x197c('0x64'):_0x238092[_0x197c('0x5e')]={'Authorization':util['format'](_0x197c('0x5f'),new Buffer(util[_0x197c('0x5b')](_0x197c('0x65'),_0x5a601c[_0x197c('0x61')],_0x5a601c[_0x197c('0x64')]))[_0x197c('0x66')]('base64'))};break;default:throw new db[(_0x197c('0x67'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x238092);}})[_0x197c('0x25')](function(_0x8c0d4a){if(_0x8c0d4a){var _0x58e708=[_0x197c('0x68'),_0x197c('0x69'),_0x197c('0x6a'),_0x197c('0x6b')];_[_0x197c('0x6c')](_0x8c0d4a['ticket_fields'],function(_0x5da64e){return _0x58e708['includes'](_0x5da64e['type']);});return{'count':_0x8c0d4a[_0x197c('0x5d')][_0x197c('0x36')],'rows':_['map'](_0x8c0d4a['ticket_fields'],function(_0x213e01){return{'id':_0x213e01['id'],'name':_0x213e01['position']>0x7?_0x213e01['title']:_0x213e01[_0x197c('0x3e')],'custom':_0x213e01[_0x197c('0x6d')]>0x7?!![]:![],'options':_0x213e01[_0x197c('0x6e')]?_0x213e01[_0x197c('0x6e')]:_0x213e01[_0x197c('0x6f')]?_0x213e01[_0x197c('0x6f')]:[]};})};}})['then'](respondWithResult(_0x43c0b2,null))[_0x197c('0x48')](function(_0x2321e1){var _0x43fc99=_0x25d3c1[_0x197c('0x2f')][_0x197c('0x70')]?0x1f4:_0x2321e1[_0x197c('0x71')]||0x1f4;logger[_0x197c('0x72')]('getFields,\x20%s,\x20%s,\x20%s',_0x197c('0x56'),_0x43fc99,JSON[_0x197c('0x73')](_0x2321e1));delete _0x2321e1[_0x197c('0x28')];if(_0x43fc99===0x191){_0x43fc99=0x190;}_0x43c0b2[_0x197c('0x19')](_0x43fc99)[_0x197c('0x29')](_0x25d3c1[_0x197c('0x2f')]['test']?{'message':_0x197c('0x74'),'statusCode':_0x2321e1[_0x197c('0x71')]}:_0x2321e1);});};
\ No newline at end of file
index 65b3bf6..0271bb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d25=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment','path','../../config/environment','./intZendeskAccount.attributes'];(function(_0x422714,_0x4a49c6){var _0x4b2c1d=function(_0x1c4451){while(--_0x1c4451){_0x422714['push'](_0x422714['shift']());}};_0x4b2c1d(++_0x4a49c6);}(_0x8d25,0x101));var _0x58d2=function(_0x12b2b1,_0x4a2abb){_0x12b2b1=_0x12b2b1-0x0;var _0x533836=_0x8d25[_0x12b2b1];return _0x533836;};'use strict';var _=require(_0x58d2('0x0'));var util=require(_0x58d2('0x1'));var logger=require(_0x58d2('0x2'))('api');var moment=require(_0x58d2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x58d2('0x4'));var rimraf=require('rimraf');var config=require(_0x58d2('0x5'));var attributes=require(_0x58d2('0x6'));var integrations=require(_0x58d2('0x7'));module[_0x58d2('0x8')]=function(_0x112438,_0x141d06){return _0x112438[_0x58d2('0x9')](_0x58d2('0xa'),attributes,{'tableName':_0x58d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc38=['exports','define','ZendeskAccount','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdc38,0x1d7));var _0x8dc3=function(_0x2f9fbd,_0x54588d){_0x2f9fbd=_0x2f9fbd-0x0;var _0x33f469=_0xdc38[_0x2f9fbd];return _0x33f469;};'use strict';var _=require(_0x8dc3('0x0'));var util=require(_0x8dc3('0x1'));var logger=require('../../config/logger')(_0x8dc3('0x2'));var moment=require(_0x8dc3('0x3'));var BPromise=require(_0x8dc3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dc3('0x5'));var rimraf=require(_0x8dc3('0x6'));var config=require(_0x8dc3('0x7'));var attributes=require(_0x8dc3('0x8'));var integrations=require(_0x8dc3('0x9'));module[_0x8dc3('0xa')]=function(_0x2e2806,_0x104e10){return _0x2e2806[_0x8dc3('0xb')](_0x8dc3('0xc'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index abf0ce2..e0c4aeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a14=['message','info','catch','ZendeskAccount','findAll','options','where','attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x203090,_0xf1a2c1){var _0x592380=function(_0x2ed02e){while(--_0x2ed02e){_0x203090['push'](_0x203090['shift']());}};_0x592380(++_0xf1a2c1);}(_0x2a14,0xc3));var _0x42a1=function(_0x43116f,_0x4aec28){_0x43116f=_0x43116f-0x0;var _0x2fea28=_0x2a14[_0x43116f];return _0x2fea28;};'use strict';var _=require(_0x42a1('0x0'));var util=require(_0x42a1('0x1'));var moment=require(_0x42a1('0x2'));var BPromise=require('bluebird');var rs=require(_0x42a1('0x3'));var fs=require('fs');var Redis=require(_0x42a1('0x4'));var db=require(_0x42a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x42a1('0x6'))(_0x42a1('0x7'));var config=require(_0x42a1('0x8'));var jayson=require(_0x42a1('0x9'));var client=jayson[_0x42a1('0xa')][_0x42a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33895c,_0xb30078,_0x12fc94){return new BPromise(function(_0x452bd3,_0x599936){return client[_0x42a1('0xc')](_0x33895c,_0x12fc94)[_0x42a1('0xd')](function(_0x5aa91c){logger['info'](_0x42a1('0xe'),_0xb30078,_0x42a1('0xf'));logger[_0x42a1('0x10')](_0x42a1('0x11'),_0xb30078,_0x42a1('0xf'),JSON[_0x42a1('0x12')](_0x5aa91c));if(_0x5aa91c[_0x42a1('0x13')]){if(_0x5aa91c[_0x42a1('0x13')][_0x42a1('0x14')]===0x1f4){logger[_0x42a1('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0xb30078,_0x5aa91c['error']['message']);return _0x599936(_0x5aa91c[_0x42a1('0x13')]['message']);}logger[_0x42a1('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0xb30078,_0x5aa91c[_0x42a1('0x13')][_0x42a1('0x15')]);return _0x452bd3(_0x5aa91c[_0x42a1('0x13')][_0x42a1('0x15')]);}else{logger[_0x42a1('0x16')](_0x42a1('0xe'),_0xb30078,_0x42a1('0xf'));_0x452bd3(_0x5aa91c['result'][_0x42a1('0x15')]);}})[_0x42a1('0x17')](function(_0x5d9c37){logger[_0x42a1('0x13')](_0x42a1('0xe'),_0xb30078,_0x5d9c37);_0x599936(_0x5d9c37);});});}exports['GetZendeskAccount']=function(_0x1a4835){var _0x2d6096=this;return new Promise(function(_0xfc607a,_0x2566e1){return db[_0x42a1('0x18')][_0x42a1('0x19')]({'raw':_0x1a4835['options']?_0x1a4835[_0x42a1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1a4835['options']?_0x1a4835[_0x42a1('0x1a')][_0x42a1('0x1b')]||null:null,'attributes':_0x1a4835[_0x42a1('0x1a')]?_0x1a4835[_0x42a1('0x1a')][_0x42a1('0x1c')]||null:null,'limit':_0x1a4835[_0x42a1('0x1a')]?_0x1a4835[_0x42a1('0x1a')][_0x42a1('0x1d')]||null:null,'include':_0x1a4835[_0x42a1('0x1a')]?_0x1a4835[_0x42a1('0x1a')][_0x42a1('0x1e')]?_[_0x42a1('0x1f')](_0x1a4835['options']['include'],function(_0x575e67){return{'model':db[_0x575e67[_0x42a1('0x20')]],'as':_0x575e67['as'],'attributes':_0x575e67[_0x42a1('0x1c')],'include':_0x575e67[_0x42a1('0x1e')]?_[_0x42a1('0x1f')](_0x575e67['include'],function(_0x38ee7a){return{'model':db[_0x38ee7a[_0x42a1('0x20')]],'as':_0x38ee7a['as'],'attributes':_0x38ee7a['attributes'],'include':_0x38ee7a['include']?_[_0x42a1('0x1f')](_0x38ee7a[_0x42a1('0x1e')],function(_0x5ba232){return{'model':db[_0x5ba232[_0x42a1('0x20')]],'as':_0x5ba232['as'],'attributes':_0x5ba232[_0x42a1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3394b5){logger[_0x42a1('0x16')](_0x42a1('0x21'),_0x1a4835);logger[_0x42a1('0x10')](_0x42a1('0x21'),_0x1a4835,JSON['stringify'](_0x3394b5));_0xfc607a(_0x3394b5);})[_0x42a1('0x17')](function(_0x268c54){logger[_0x42a1('0x13')](_0x42a1('0x21'),_0x268c54['message'],_0x1a4835);_0x2566e1(_0x2d6096[_0x42a1('0x13')](0x1f4,_0x268c54[_0x42a1('0x15')]));});});};exports[_0x42a1('0x22')]=function(_0x254026){var _0x2272ec=this;return new Promise(function(_0x650b30,_0x21812c){return db[_0x42a1('0x18')]['find']({'raw':_0x254026[_0x42a1('0x1a')]?_0x254026[_0x42a1('0x1a')][_0x42a1('0x23')]===undefined?!![]:![]:!![],'where':_0x254026[_0x42a1('0x1a')]?_0x254026[_0x42a1('0x1a')][_0x42a1('0x1b')]||null:null,'attributes':_0x254026[_0x42a1('0x1a')]?_0x254026[_0x42a1('0x1a')][_0x42a1('0x1c')]||null:null,'include':_0x254026[_0x42a1('0x1a')]?_0x254026['options']['include']?_[_0x42a1('0x1f')](_0x254026[_0x42a1('0x1a')]['include'],function(_0x2d269a){return{'model':db[_0x2d269a['model']],'as':_0x2d269a['as'],'attributes':_0x2d269a[_0x42a1('0x1c')],'include':_0x2d269a[_0x42a1('0x1e')]?_[_0x42a1('0x1f')](_0x2d269a[_0x42a1('0x1e')],function(_0xab08d7){return{'model':db[_0xab08d7['model']],'as':_0xab08d7['as'],'attributes':_0xab08d7[_0x42a1('0x1c')],'include':_0xab08d7[_0x42a1('0x1e')]?_[_0x42a1('0x1f')](_0xab08d7[_0x42a1('0x1e')],function(_0x290bf1){return{'model':db[_0x290bf1[_0x42a1('0x20')]],'as':_0x290bf1['as'],'attributes':_0x290bf1['attributes']};}):[]};}):[]};}):[]:[]})[_0x42a1('0xd')](function(_0x2d9c23){logger['info'](_0x42a1('0x22'),_0x254026);logger[_0x42a1('0x10')](_0x42a1('0x22'),_0x254026,JSON[_0x42a1('0x12')](_0x2d9c23));_0x650b30(_0x2d9c23);})[_0x42a1('0x17')](function(_0x32f1b7){logger[_0x42a1('0x13')](_0x42a1('0x22'),_0x32f1b7['message'],_0x254026);_0x21812c(_0x2272ec['error'](0x1f4,_0x32f1b7['message']));});});};
\ No newline at end of file
+var _0xa9e3=['options','where','attributes','limit','map','include','model','then','info','ShowZendeskAccount','find','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll'];(function(_0x29632e,_0x5ecba4){var _0x426e04=function(_0x4eb357){while(--_0x4eb357){_0x29632e['push'](_0x29632e['shift']());}};_0x426e04(++_0x5ecba4);}(_0xa9e3,0x124));var _0x3a9e=function(_0x564ee3,_0x150cb0){_0x564ee3=_0x564ee3-0x0;var _0x53151d=_0xa9e3[_0x564ee3];return _0x53151d;};'use strict';var _=require(_0x3a9e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3a9e('0x1'));var rs=require(_0x3a9e('0x2'));var fs=require('fs');var Redis=require(_0x3a9e('0x3'));var db=require(_0x3a9e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a9e('0x5'))(_0x3a9e('0x6'));var config=require(_0x3a9e('0x7'));var jayson=require(_0x3a9e('0x8'));var client=jayson['client'][_0x3a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ccdc5,_0xdc8ba0,_0xaaf153){return new BPromise(function(_0x174def,_0x5938fa){return client[_0x3a9e('0xa')](_0x4ccdc5,_0xaaf153)['then'](function(_0xec1e4c){logger['info'](_0x3a9e('0xb'),_0xdc8ba0,_0x3a9e('0xc'));logger[_0x3a9e('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0xdc8ba0,'request\x20sent',JSON[_0x3a9e('0xe')](_0xec1e4c));if(_0xec1e4c[_0x3a9e('0xf')]){if(_0xec1e4c[_0x3a9e('0xf')][_0x3a9e('0x10')]===0x1f4){logger['error'](_0x3a9e('0xb'),_0xdc8ba0,_0xec1e4c['error'][_0x3a9e('0x11')]);return _0x5938fa(_0xec1e4c[_0x3a9e('0xf')][_0x3a9e('0x11')]);}logger[_0x3a9e('0xf')](_0x3a9e('0xb'),_0xdc8ba0,_0xec1e4c[_0x3a9e('0xf')]['message']);return _0x174def(_0xec1e4c[_0x3a9e('0xf')][_0x3a9e('0x11')]);}else{logger['info'](_0x3a9e('0xb'),_0xdc8ba0,_0x3a9e('0xc'));_0x174def(_0xec1e4c[_0x3a9e('0x12')][_0x3a9e('0x11')]);}})[_0x3a9e('0x13')](function(_0x5cf3ce){logger[_0x3a9e('0xf')](_0x3a9e('0xb'),_0xdc8ba0,_0x5cf3ce);_0x5938fa(_0x5cf3ce);});});}exports[_0x3a9e('0x14')]=function(_0x3449d3){var _0x4fac1b=this;return new Promise(function(_0x567408,_0x4ecb69){return db[_0x3a9e('0x15')][_0x3a9e('0x16')]({'raw':_0x3449d3['options']?_0x3449d3[_0x3a9e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3449d3[_0x3a9e('0x17')]?_0x3449d3[_0x3a9e('0x17')][_0x3a9e('0x18')]||null:null,'attributes':_0x3449d3['options']?_0x3449d3[_0x3a9e('0x17')][_0x3a9e('0x19')]||null:null,'limit':_0x3449d3[_0x3a9e('0x17')]?_0x3449d3['options'][_0x3a9e('0x1a')]||null:null,'include':_0x3449d3['options']?_0x3449d3['options']['include']?_[_0x3a9e('0x1b')](_0x3449d3[_0x3a9e('0x17')][_0x3a9e('0x1c')],function(_0x40845d){return{'model':db[_0x40845d['model']],'as':_0x40845d['as'],'attributes':_0x40845d[_0x3a9e('0x19')],'include':_0x40845d[_0x3a9e('0x1c')]?_[_0x3a9e('0x1b')](_0x40845d[_0x3a9e('0x1c')],function(_0x5bcadf){return{'model':db[_0x5bcadf[_0x3a9e('0x1d')]],'as':_0x5bcadf['as'],'attributes':_0x5bcadf[_0x3a9e('0x19')],'include':_0x5bcadf[_0x3a9e('0x1c')]?_[_0x3a9e('0x1b')](_0x5bcadf[_0x3a9e('0x1c')],function(_0x5b5bf5){return{'model':db[_0x5b5bf5[_0x3a9e('0x1d')]],'as':_0x5b5bf5['as'],'attributes':_0x5b5bf5['attributes']};}):[]};}):[]};}):[]:[]})[_0x3a9e('0x1e')](function(_0x499fb1){logger[_0x3a9e('0x1f')](_0x3a9e('0x14'),_0x3449d3);logger['debug']('GetZendeskAccount',_0x3449d3,JSON[_0x3a9e('0xe')](_0x499fb1));_0x567408(_0x499fb1);})['catch'](function(_0x66a890){logger['error'](_0x3a9e('0x14'),_0x66a890[_0x3a9e('0x11')],_0x3449d3);_0x4ecb69(_0x4fac1b[_0x3a9e('0xf')](0x1f4,_0x66a890[_0x3a9e('0x11')]));});});};exports[_0x3a9e('0x20')]=function(_0x50ba51){var _0x2f2671=this;return new Promise(function(_0x3ad300,_0x761710){return db['ZendeskAccount'][_0x3a9e('0x21')]({'raw':_0x50ba51[_0x3a9e('0x17')]?_0x50ba51[_0x3a9e('0x17')][_0x3a9e('0x22')]===undefined?!![]:![]:!![],'where':_0x50ba51[_0x3a9e('0x17')]?_0x50ba51[_0x3a9e('0x17')]['where']||null:null,'attributes':_0x50ba51[_0x3a9e('0x17')]?_0x50ba51[_0x3a9e('0x17')]['attributes']||null:null,'include':_0x50ba51[_0x3a9e('0x17')]?_0x50ba51[_0x3a9e('0x17')][_0x3a9e('0x1c')]?_[_0x3a9e('0x1b')](_0x50ba51[_0x3a9e('0x17')][_0x3a9e('0x1c')],function(_0x1f81c7){return{'model':db[_0x1f81c7[_0x3a9e('0x1d')]],'as':_0x1f81c7['as'],'attributes':_0x1f81c7['attributes'],'include':_0x1f81c7[_0x3a9e('0x1c')]?_[_0x3a9e('0x1b')](_0x1f81c7['include'],function(_0x253d0f){return{'model':db[_0x253d0f[_0x3a9e('0x1d')]],'as':_0x253d0f['as'],'attributes':_0x253d0f[_0x3a9e('0x19')],'include':_0x253d0f[_0x3a9e('0x1c')]?_[_0x3a9e('0x1b')](_0x253d0f[_0x3a9e('0x1c')],function(_0x24fa95){return{'model':db[_0x24fa95['model']],'as':_0x24fa95['as'],'attributes':_0x24fa95[_0x3a9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3a9e('0x1e')](function(_0x1ba697){logger[_0x3a9e('0x1f')](_0x3a9e('0x20'),_0x50ba51);logger['debug']('ShowZendeskAccount',_0x50ba51,JSON[_0x3a9e('0xe')](_0x1ba697));_0x3ad300(_0x1ba697);})['catch'](function(_0x169215){logger[_0x3a9e('0xf')](_0x3a9e('0x20'),_0x169215[_0x3a9e('0x11')],_0x50ba51);_0x761710(_0x2f2671[_0x3a9e('0xf')](0x1f4,_0x169215[_0x3a9e('0x11')]));});});};
\ No newline at end of file
index 8ee73c4..99155fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller'];(function(_0xe51920,_0x4a1092){var _0x4e4c70=function(_0x71151){while(--_0x71151){_0xe51920['push'](_0xe51920['shift']());}};_0x4e4c70(++_0x4a1092);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0xcb91[_0x337748];return _0x3bb03f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0x7')]('/:id/descriptions',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0x7')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x1cb9('0x10')]);router[_0x1cb9('0x11')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['setTags']);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);router[_0x1cb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x16')]);module[_0x1cb9('0x17')]=router;
\ No newline at end of file
+var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x3a8389,_0x372de0){var _0x4d0ca3=function(_0x52c9b5){while(--_0x52c9b5){_0x3a8389['push'](_0x3a8389['shift']());}};_0x4d0ca3(++_0x372de0);}(_0xe706,0xa3));var _0x6e70=function(_0x2e8802,_0x59ad8c){_0x2e8802=_0x2e8802-0x0;var _0x4617aa=_0xe706[_0x2e8802];return _0x4617aa;};'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('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router;
\ No newline at end of file
index b283321..dde8222 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a1a=['STRING'];(function(_0x11882e,_0x2ee213){var _0x5666a6=function(_0x2a554a){while(--_0x2a554a){_0x11882e['push'](_0x11882e['shift']());}};_0x5666a6(++_0x2ee213);}(_0x0a1a,0x7d));var _0xa0a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0a1a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa0a1('0x0')]},'description':{'type':Sequelize[_0xa0a1('0x0')]}};
\ No newline at end of file
+var _0xca3f=['STRING','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xca3f,0x7f));var _0xfca3=function(_0x4b5787,_0x2c5aa2){_0x4b5787=_0x4b5787-0x0;var _0x827b80=_0xca3f[_0x4b5787];return _0x827b80;};'use strict';var Sequelize=require(_0xfca3('0x0'));module[_0xfca3('0x1')]={'name':{'type':Sequelize[_0xfca3('0x2')]},'description':{'type':Sequelize[_0xfca3('0x2')]}};
\ No newline at end of file
index fb776ba..8eddcbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cf6=['api','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','save','then','error','name','index','map','ZendeskConfiguration','rawAttributes','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','show','params','keys','intersection','find','create','body','catch','destroy','findOne','ZendeskField','getFields','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x32384e,_0x11e659){var _0x14885b=function(_0x17f34b){while(--_0x17f34b){_0x32384e['push'](_0x32384e['shift']());}};_0x14885b(++_0x11e659);}(_0x1cf6,0x11b));var _0x61cf=function(_0x5a6717,_0x3aa689){_0x5a6717=_0x5a6717-0x0;var _0x2b0643=_0x1cf6[_0x5a6717];return _0x2b0643;};'use strict';var emlformat=require(_0x61cf('0x0'));var rimraf=require(_0x61cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61cf('0x2'));var rp=require('request-promise');var moment=require(_0x61cf('0x3'));var BPromise=require(_0x61cf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x61cf('0x5'));var sox=require(_0x61cf('0x6'));var csv=require(_0x61cf('0x7'));var ejs=require(_0x61cf('0x8'));var fs=require('fs');var fs_extra=require(_0x61cf('0x9'));var _=require(_0x61cf('0xa'));var squel=require(_0x61cf('0xb'));var crypto=require(_0x61cf('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x61cf('0x7'));var querystring=require(_0x61cf('0xd'));var Papa=require(_0x61cf('0xe'));var Redis=require(_0x61cf('0xf'));var authService=require(_0x61cf('0x10'));var qs=require(_0x61cf('0x11'));var as=require(_0x61cf('0x12'));var hardwareService=require(_0x61cf('0x13'));var logger=require(_0x61cf('0x14'))(_0x61cf('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x61cf('0x16'))['db'];function respondWithStatusCode(_0x53535b,_0x5e8321){_0x5e8321=_0x5e8321||0xcc;return function(_0x1db932){if(_0x1db932){return _0x53535b[_0x61cf('0x17')](_0x5e8321);}return _0x53535b[_0x61cf('0x18')](_0x5e8321)[_0x61cf('0x19')]();};}function respondWithResult(_0x143b1a,_0x322a95){_0x322a95=_0x322a95||0xc8;return function(_0x5f6f23){if(_0x5f6f23){return _0x143b1a['status'](_0x322a95)[_0x61cf('0x1a')](_0x5f6f23);}};}function respondWithFilteredResult(_0x9cf2cd,_0x59d49b){return function(_0x2a0497){if(_0x2a0497){var _0x4016e7=typeof _0x59d49b[_0x61cf('0x1b')]===_0x61cf('0x1c')&&typeof _0x59d49b['limit']==='undefined';var _0x463e1d=_0x2a0497[_0x61cf('0x1d')];var _0x549e63=_0x4016e7?0x0:_0x59d49b[_0x61cf('0x1b')];var _0x545119=_0x4016e7?_0x2a0497[_0x61cf('0x1d')]:_0x59d49b[_0x61cf('0x1b')]+_0x59d49b['limit'];var _0x433e90;if(_0x545119>=_0x463e1d){_0x545119=_0x463e1d;_0x433e90=0xc8;}else{_0x433e90=0xce;}_0x9cf2cd[_0x61cf('0x18')](_0x433e90);return _0x9cf2cd[_0x61cf('0x1e')]('Content-Range',_0x549e63+'-'+_0x545119+'/'+_0x463e1d)['json'](_0x2a0497);}return null;};}function patchUpdates(_0x1e4daa){return function(_0x5b5afc){try{jsonpatch['apply'](_0x5b5afc,_0x1e4daa,!![]);}catch(_0x4996b2){return BPromise['reject'](_0x4996b2);}return _0x5b5afc[_0x61cf('0x1f')]();};}function saveUpdates(_0x2d0f63,_0x2ebb5e){return function(_0x54fa6d){if(_0x54fa6d){return _0x54fa6d['update'](_0x2d0f63)[_0x61cf('0x20')](function(_0x20761e){return _0x20761e;});}return null;};}function removeEntity(_0x85308a,_0xfbb05a){return function(_0x1b0234){if(_0x1b0234){return _0x1b0234['destroy']()[_0x61cf('0x20')](function(){_0x85308a[_0x61cf('0x18')](0xcc)[_0x61cf('0x19')]();});}};}function handleEntityNotFound(_0x594113,_0x1a0ac6){return function(_0x37666c){if(!_0x37666c){_0x594113['sendStatus'](0x194);}return _0x37666c;};}function handleError(_0x2f1e04,_0x3128a0){_0x3128a0=_0x3128a0||0x1f4;return function(_0x3c332b){logger[_0x61cf('0x21')](_0x3c332b['stack']);if(_0x3c332b[_0x61cf('0x22')]){delete _0x3c332b['name'];}_0x2f1e04[_0x61cf('0x18')](_0x3128a0)['send'](_0x3c332b);};}exports[_0x61cf('0x23')]=function(_0x4e8dee,_0x10832a){var _0x4e795d={},_0x49a984={},_0x5bacc0={'count':0x0,'rows':[]};var _0xc96c08=_[_0x61cf('0x24')](db[_0x61cf('0x25')][_0x61cf('0x26')],function(_0x131868){return{'name':_0x131868['fieldName'],'type':_0x131868[_0x61cf('0x27')][_0x61cf('0x28')]};});_0x49a984['model']=_[_0x61cf('0x24')](_0xc96c08,_0x61cf('0x22'));_0x49a984[_0x61cf('0x29')]=_['keys'](_0x4e8dee[_0x61cf('0x29')]);_0x49a984[_0x61cf('0x2a')]=_['intersection'](_0x49a984[_0x61cf('0x2b')],_0x49a984[_0x61cf('0x29')]);_0x4e795d[_0x61cf('0x2c')]=_['intersection'](_0x49a984[_0x61cf('0x2b')],qs[_0x61cf('0x2d')](_0x4e8dee[_0x61cf('0x29')]['fields']));_0x4e795d['attributes']=_0x4e795d[_0x61cf('0x2c')][_0x61cf('0x2e')]?_0x4e795d['attributes']:_0x49a984[_0x61cf('0x2b')];if(!_0x4e8dee['query'][_0x61cf('0x2f')]('nolimit')){_0x4e795d[_0x61cf('0x30')]=qs[_0x61cf('0x30')](_0x4e8dee[_0x61cf('0x29')][_0x61cf('0x30')]);_0x4e795d[_0x61cf('0x1b')]=qs[_0x61cf('0x1b')](_0x4e8dee[_0x61cf('0x29')][_0x61cf('0x1b')]);}_0x4e795d[_0x61cf('0x31')]=qs[_0x61cf('0x32')](_0x4e8dee['query'][_0x61cf('0x32')]);_0x4e795d['where']=qs[_0x61cf('0x2a')](_[_0x61cf('0x33')](_0x4e8dee['query'],_0x49a984[_0x61cf('0x2a')]),_0xc96c08);if(_0x4e8dee['query'][_0x61cf('0x34')]){_0x4e795d['where']=_[_0x61cf('0x35')](_0x4e795d[_0x61cf('0x36')],{'$or':_[_0x61cf('0x24')](_0xc96c08,function(_0x21ae85){if(_0x21ae85['type']!==_0x61cf('0x37')){var _0xc41c8d={};_0xc41c8d[_0x21ae85['name']]={'$like':'%'+_0x4e8dee[_0x61cf('0x29')][_0x61cf('0x34')]+'%'};return _0xc41c8d;}})});}_0x4e795d=_[_0x61cf('0x35')]({},_0x4e795d,_0x4e8dee[_0x61cf('0x38')]);var _0x18c590={'where':_0x4e795d[_0x61cf('0x36')]};return db[_0x61cf('0x25')][_0x61cf('0x1d')](_0x18c590)[_0x61cf('0x20')](function(_0x592632){_0x5bacc0[_0x61cf('0x1d')]=_0x592632;if(_0x4e8dee['query'][_0x61cf('0x39')]){_0x4e795d['include']=[{'all':!![]}];}return db[_0x61cf('0x25')]['findAll'](_0x4e795d);})[_0x61cf('0x20')](function(_0x3d7dd1){_0x5bacc0['rows']=_0x3d7dd1;return _0x5bacc0;})[_0x61cf('0x20')](respondWithFilteredResult(_0x10832a,_0x4e795d))['catch'](handleError(_0x10832a,null));};exports[_0x61cf('0x3a')]=function(_0x367103,_0x3d944f){var _0x1d1559={'raw':![],'where':{'id':_0x367103[_0x61cf('0x3b')]['id']}},_0x4fe360={};_0x4fe360[_0x61cf('0x2b')]=_[_0x61cf('0x3c')](db[_0x61cf('0x25')][_0x61cf('0x26')]);_0x4fe360['query']=_['keys'](_0x367103[_0x61cf('0x29')]);_0x4fe360[_0x61cf('0x2a')]=_[_0x61cf('0x3d')](_0x4fe360[_0x61cf('0x2b')],_0x4fe360[_0x61cf('0x29')]);_0x1d1559[_0x61cf('0x2c')]=_[_0x61cf('0x3d')](_0x4fe360[_0x61cf('0x2b')],qs['fields'](_0x367103['query'][_0x61cf('0x2d')]));_0x1d1559[_0x61cf('0x2c')]=_0x1d1559[_0x61cf('0x2c')][_0x61cf('0x2e')]?_0x1d1559['attributes']:_0x4fe360['model'];if(_0x367103[_0x61cf('0x29')][_0x61cf('0x39')]){_0x1d1559['include']=[{'all':!![]}];}_0x1d1559=_['merge']({},_0x1d1559,_0x367103[_0x61cf('0x38')]);return db['ZendeskConfiguration'][_0x61cf('0x3e')](_0x1d1559)[_0x61cf('0x20')](handleEntityNotFound(_0x3d944f,null))[_0x61cf('0x20')](respondWithResult(_0x3d944f,null))['catch'](handleError(_0x3d944f,null));};exports[_0x61cf('0x3f')]=function(_0x34c204,_0x4cd61c){return db[_0x61cf('0x25')][_0x61cf('0x3f')](_0x34c204[_0x61cf('0x40')],{})[_0x61cf('0x20')](respondWithResult(_0x4cd61c,0xc9))['catch'](handleError(_0x4cd61c,null));};exports['update']=function(_0x41dd65,_0x2cfacc){if(_0x41dd65['body']['id']){delete _0x41dd65[_0x61cf('0x40')]['id'];}return db[_0x61cf('0x25')][_0x61cf('0x3e')]({'where':{'id':_0x41dd65['params']['id']}})[_0x61cf('0x20')](handleEntityNotFound(_0x2cfacc,null))['then'](saveUpdates(_0x41dd65[_0x61cf('0x40')],null))[_0x61cf('0x20')](respondWithResult(_0x2cfacc,null))[_0x61cf('0x41')](handleError(_0x2cfacc,null));};exports[_0x61cf('0x42')]=function(_0x3c5b1f,_0x1031e0){return db[_0x61cf('0x25')][_0x61cf('0x3e')]({'where':{'id':_0x3c5b1f[_0x61cf('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1031e0,null))[_0x61cf('0x20')](removeEntity(_0x1031e0,null))[_0x61cf('0x41')](handleError(_0x1031e0,null));};exports['getFields']=function(_0x14aa36,_0x4e46ae,_0x4fa949){var _0x175c11={};var _0x5b8850={};var _0x380aea;var _0x5a1c22;return db[_0x61cf('0x25')][_0x61cf('0x43')]({'where':{'id':_0x14aa36['params']['id']}})[_0x61cf('0x20')](handleEntityNotFound(_0x4e46ae,null))[_0x61cf('0x20')](function(_0x205f70){if(_0x205f70){_0x380aea=_0x205f70;_0x5b8850[_0x61cf('0x2b')]=_[_0x61cf('0x3c')](db[_0x61cf('0x44')][_0x61cf('0x26')]);_0x5b8850['query']=_[_0x61cf('0x3c')](_0x14aa36[_0x61cf('0x29')]);_0x5b8850[_0x61cf('0x2a')]=_[_0x61cf('0x3d')](_0x5b8850[_0x61cf('0x2b')],_0x5b8850[_0x61cf('0x29')]);_0x175c11[_0x61cf('0x2c')]=_[_0x61cf('0x3d')](_0x5b8850[_0x61cf('0x2b')],qs[_0x61cf('0x2d')](_0x14aa36['query']['fields']));_0x175c11[_0x61cf('0x2c')]=_0x175c11['attributes'][_0x61cf('0x2e')]?_0x175c11['attributes']:_0x5b8850[_0x61cf('0x2b')];_0x175c11[_0x61cf('0x31')]=qs['sort'](_0x14aa36[_0x61cf('0x29')][_0x61cf('0x32')]);_0x175c11[_0x61cf('0x36')]=qs[_0x61cf('0x2a')](_[_0x61cf('0x33')](_0x14aa36['query'],_0x5b8850[_0x61cf('0x2a')]));if(_0x14aa36[_0x61cf('0x29')][_0x61cf('0x34')]){_0x175c11[_0x61cf('0x36')]=_[_0x61cf('0x35')](_0x175c11[_0x61cf('0x36')],{'$or':_[_0x61cf('0x24')](_0x175c11[_0x61cf('0x2c')],function(_0x346b1b){var _0x3ac914={};_0x3ac914[_0x346b1b]={'$like':'%'+_0x14aa36['query'][_0x61cf('0x34')]+'%'};return _0x3ac914;})});}_0x175c11=_[_0x61cf('0x35')]({},_0x175c11,_0x14aa36['options']);return _0x380aea[_0x61cf('0x45')](_0x175c11);}})['then'](function(_0x3648e8){if(_0x3648e8){_0x5a1c22=_0x3648e8['length'];if(!_0x14aa36[_0x61cf('0x29')][_0x61cf('0x2f')](_0x61cf('0x46'))){_0x175c11[_0x61cf('0x30')]=qs[_0x61cf('0x30')](_0x14aa36[_0x61cf('0x29')][_0x61cf('0x30')]);_0x175c11[_0x61cf('0x1b')]=qs['offset'](_0x14aa36[_0x61cf('0x29')][_0x61cf('0x1b')]);}return _0x380aea[_0x61cf('0x45')](_0x175c11);}})[_0x61cf('0x20')](function(_0x2de49c){if(_0x2de49c){return _0x2de49c?{'count':_0x5a1c22,'rows':_0x2de49c}:null;}})[_0x61cf('0x20')](respondWithResult(_0x4e46ae,null))[_0x61cf('0x41')](handleError(_0x4e46ae,null));};exports[_0x61cf('0x47')]=function(_0x252929,_0x436895,_0x5b0008){var _0x5e5f70={};var _0x257989={};var _0x5bb51a;var _0x3efa07;return db[_0x61cf('0x25')]['findOne']({'where':{'id':_0x252929[_0x61cf('0x3b')]['id']}})[_0x61cf('0x20')](handleEntityNotFound(_0x436895,null))['then'](function(_0x1e0fd1){if(_0x1e0fd1){_0x5bb51a=_0x1e0fd1;_0x257989['model']=_[_0x61cf('0x3c')](db[_0x61cf('0x44')][_0x61cf('0x26')]);_0x257989[_0x61cf('0x29')]=_['keys'](_0x252929[_0x61cf('0x29')]);_0x257989[_0x61cf('0x2a')]=_[_0x61cf('0x3d')](_0x257989[_0x61cf('0x2b')],_0x257989[_0x61cf('0x29')]);_0x5e5f70[_0x61cf('0x2c')]=_[_0x61cf('0x3d')](_0x257989[_0x61cf('0x2b')],qs['fields'](_0x252929[_0x61cf('0x29')][_0x61cf('0x2d')]));_0x5e5f70[_0x61cf('0x2c')]=_0x5e5f70['attributes'][_0x61cf('0x2e')]?_0x5e5f70[_0x61cf('0x2c')]:_0x257989[_0x61cf('0x2b')];_0x5e5f70[_0x61cf('0x31')]=qs[_0x61cf('0x32')](_0x252929[_0x61cf('0x29')][_0x61cf('0x32')]);_0x5e5f70[_0x61cf('0x36')]=qs[_0x61cf('0x2a')](_[_0x61cf('0x33')](_0x252929[_0x61cf('0x29')],_0x257989[_0x61cf('0x2a')]));if(_0x252929['query'][_0x61cf('0x34')]){_0x5e5f70[_0x61cf('0x36')]=_[_0x61cf('0x35')](_0x5e5f70['where'],{'$or':_[_0x61cf('0x24')](_0x5e5f70[_0x61cf('0x2c')],function(_0x359292){var _0x18d5d2={};_0x18d5d2[_0x359292]={'$like':'%'+_0x252929[_0x61cf('0x29')][_0x61cf('0x34')]+'%'};return _0x18d5d2;})});}_0x5e5f70=_[_0x61cf('0x35')]({},_0x5e5f70,_0x252929[_0x61cf('0x38')]);return _0x5bb51a[_0x61cf('0x47')](_0x5e5f70);}})[_0x61cf('0x20')](function(_0x388241){if(_0x388241){_0x3efa07=_0x388241['length'];if(!_0x252929[_0x61cf('0x29')][_0x61cf('0x2f')]('nolimit')){_0x5e5f70[_0x61cf('0x30')]=qs[_0x61cf('0x30')](_0x252929[_0x61cf('0x29')][_0x61cf('0x30')]);_0x5e5f70['offset']=qs[_0x61cf('0x1b')](_0x252929[_0x61cf('0x29')][_0x61cf('0x1b')]);}return _0x5bb51a[_0x61cf('0x47')](_0x5e5f70);}})[_0x61cf('0x20')](function(_0x849b19){if(_0x849b19){return _0x849b19?{'count':_0x3efa07,'rows':_0x849b19}:null;}})[_0x61cf('0x20')](respondWithResult(_0x436895,null))[_0x61cf('0x41')](handleError(_0x436895,null));};exports['getDescriptions']=function(_0x462c4c,_0x2a014e,_0x3750a6){var _0x299226={};var _0x5ec333={};var _0x81ac33;var _0xeca30f;return db['ZendeskConfiguration'][_0x61cf('0x43')]({'where':{'id':_0x462c4c['params']['id']}})['then'](handleEntityNotFound(_0x2a014e,null))[_0x61cf('0x20')](function(_0x550b8a){if(_0x550b8a){_0x81ac33=_0x550b8a;_0x5ec333[_0x61cf('0x2b')]=_[_0x61cf('0x3c')](db['ZendeskField'][_0x61cf('0x26')]);_0x5ec333[_0x61cf('0x29')]=_[_0x61cf('0x3c')](_0x462c4c[_0x61cf('0x29')]);_0x5ec333[_0x61cf('0x2a')]=_[_0x61cf('0x3d')](_0x5ec333[_0x61cf('0x2b')],_0x5ec333['query']);_0x299226[_0x61cf('0x2c')]=_[_0x61cf('0x3d')](_0x5ec333['model'],qs[_0x61cf('0x2d')](_0x462c4c['query']['fields']));_0x299226['attributes']=_0x299226[_0x61cf('0x2c')][_0x61cf('0x2e')]?_0x299226[_0x61cf('0x2c')]:_0x5ec333[_0x61cf('0x2b')];_0x299226[_0x61cf('0x31')]=qs[_0x61cf('0x32')](_0x462c4c[_0x61cf('0x29')][_0x61cf('0x32')]);_0x299226[_0x61cf('0x36')]=qs[_0x61cf('0x2a')](_[_0x61cf('0x33')](_0x462c4c[_0x61cf('0x29')],_0x5ec333['filters']));if(_0x462c4c[_0x61cf('0x29')]['filter']){_0x299226[_0x61cf('0x36')]=_[_0x61cf('0x35')](_0x299226[_0x61cf('0x36')],{'$or':_[_0x61cf('0x24')](_0x299226[_0x61cf('0x2c')],function(_0x2b2070){var _0x34cd09={};_0x34cd09[_0x2b2070]={'$like':'%'+_0x462c4c[_0x61cf('0x29')][_0x61cf('0x34')]+'%'};return _0x34cd09;})});}_0x299226=_[_0x61cf('0x35')]({},_0x299226,_0x462c4c[_0x61cf('0x38')]);return _0x81ac33['getDescriptions'](_0x299226);}})[_0x61cf('0x20')](function(_0x234749){if(_0x234749){_0xeca30f=_0x234749['length'];if(!_0x462c4c['query'][_0x61cf('0x2f')](_0x61cf('0x46'))){_0x299226['limit']=qs[_0x61cf('0x30')](_0x462c4c[_0x61cf('0x29')][_0x61cf('0x30')]);_0x299226['offset']=qs[_0x61cf('0x1b')](_0x462c4c[_0x61cf('0x29')][_0x61cf('0x1b')]);}return _0x81ac33[_0x61cf('0x48')](_0x299226);}})['then'](function(_0x39e906){if(_0x39e906){return _0x39e906?{'count':_0xeca30f,'rows':_0x39e906}:null;}})[_0x61cf('0x20')](respondWithResult(_0x2a014e,null))[_0x61cf('0x41')](handleError(_0x2a014e,null));};exports[_0x61cf('0x49')]=function(_0x43f307,_0x58d907,_0x53372a){var _0x455194={};var _0x4fd545={};var _0x4659a9;var _0x82f666;return db['ZendeskConfiguration'][_0x61cf('0x43')]({'where':{'id':_0x43f307['params']['id']}})[_0x61cf('0x20')](handleEntityNotFound(_0x58d907,null))[_0x61cf('0x20')](function(_0x4c0805){if(_0x4c0805){_0x4659a9=_0x4c0805;_0x4fd545[_0x61cf('0x2b')]=_[_0x61cf('0x3c')](db[_0x61cf('0x4a')][_0x61cf('0x26')]);_0x4fd545[_0x61cf('0x29')]=_[_0x61cf('0x3c')](_0x43f307[_0x61cf('0x29')]);_0x4fd545[_0x61cf('0x2a')]=_[_0x61cf('0x3d')](_0x4fd545['model'],_0x4fd545[_0x61cf('0x29')]);_0x455194['attributes']=_['intersection'](_0x4fd545[_0x61cf('0x2b')],qs[_0x61cf('0x2d')](_0x43f307['query'][_0x61cf('0x2d')]));_0x455194[_0x61cf('0x2c')]=_0x455194[_0x61cf('0x2c')]['length']?_0x455194['attributes']:_0x4fd545[_0x61cf('0x2b')];_0x455194[_0x61cf('0x31')]=qs[_0x61cf('0x32')](_0x43f307[_0x61cf('0x29')][_0x61cf('0x32')]);_0x455194[_0x61cf('0x36')]=qs[_0x61cf('0x2a')](_[_0x61cf('0x33')](_0x43f307[_0x61cf('0x29')],_0x4fd545['filters']));if(_0x43f307[_0x61cf('0x29')][_0x61cf('0x34')]){_0x455194[_0x61cf('0x36')]=_[_0x61cf('0x35')](_0x455194['where'],{'$or':_[_0x61cf('0x24')](_0x455194[_0x61cf('0x2c')],function(_0x16cf85){var _0x506105={};_0x506105[_0x16cf85]={'$like':'%'+_0x43f307[_0x61cf('0x29')][_0x61cf('0x34')]+'%'};return _0x506105;})});}_0x455194=_[_0x61cf('0x35')]({},_0x455194,_0x43f307['options']);return _0x4659a9[_0x61cf('0x49')](_0x455194);}})[_0x61cf('0x20')](function(_0x19b4ca){if(_0x19b4ca){_0x82f666=_0x19b4ca[_0x61cf('0x2e')];if(!_0x43f307[_0x61cf('0x29')]['hasOwnProperty']('nolimit')){_0x455194[_0x61cf('0x30')]=qs[_0x61cf('0x30')](_0x43f307['query'][_0x61cf('0x30')]);_0x455194[_0x61cf('0x1b')]=qs[_0x61cf('0x1b')](_0x43f307[_0x61cf('0x29')][_0x61cf('0x1b')]);}return _0x4659a9[_0x61cf('0x49')](_0x455194);}})[_0x61cf('0x20')](function(_0x849ef0){if(_0x849ef0){return _0x849ef0?{'count':_0x82f666,'rows':_0x849ef0}:null;}})[_0x61cf('0x20')](respondWithResult(_0x58d907,null))[_0x61cf('0x41')](handleError(_0x58d907,null));};exports[_0x61cf('0x4b')]=function(_0x277581,_0x4b03cc,_0x2066fe){if(_0x277581['body']['id']){delete _0x277581['body']['id'];}return db[_0x61cf('0x25')][_0x61cf('0x43')]({'where':{'id':_0x277581['params']['id']}})[_0x61cf('0x20')](handleEntityNotFound(_0x4b03cc,null))[_0x61cf('0x20')](function(_0x4243ad){if(_0x4243ad){return _0x4243ad[_0x61cf('0x4b')](_0x277581['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x4b03cc,null))['catch'](handleError(_0x4b03cc,null));};
\ No newline at end of file
+var _0x94ee=['destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','find','create','body','params','getFields','ZendeskField','order','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','reject','update','then'];(function(_0x3b07bc,_0xd8bf6c){var _0x4f858b=function(_0x802344){while(--_0x802344){_0x3b07bc['push'](_0x3b07bc['shift']());}};_0x4f858b(++_0xd8bf6c);}(_0x94ee,0x1ae));var _0xe94e=function(_0x45cd13,_0x361669){_0x45cd13=_0x45cd13-0x0;var _0x57bfe6=_0x94ee[_0x45cd13];return _0x57bfe6;};'use strict';var emlformat=require(_0xe94e('0x0'));var rimraf=require(_0xe94e('0x1'));var zipdir=require(_0xe94e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe94e('0x3'));var moment=require(_0xe94e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe94e('0x5'));var util=require(_0xe94e('0x6'));var path=require(_0xe94e('0x7'));var sox=require(_0xe94e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe94e('0x9'));var _=require(_0xe94e('0xa'));var squel=require(_0xe94e('0xb'));var crypto=require(_0xe94e('0xc'));var jsforce=require(_0xe94e('0xd'));var deskjs=require(_0xe94e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe94e('0xf'));var Papa=require(_0xe94e('0x10'));var Redis=require(_0xe94e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe94e('0x12'));var as=require(_0xe94e('0x13'));var hardwareService=require(_0xe94e('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xe94e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fc4bb,_0x3ad470){_0x3ad470=_0x3ad470||0xcc;return function(_0x534c06){if(_0x534c06){return _0x3fc4bb[_0xe94e('0x16')](_0x3ad470);}return _0x3fc4bb[_0xe94e('0x17')](_0x3ad470)['end']();};}function respondWithResult(_0x3ff14f,_0x254d34){_0x254d34=_0x254d34||0xc8;return function(_0x46515f){if(_0x46515f){return _0x3ff14f['status'](_0x254d34)[_0xe94e('0x18')](_0x46515f);}};}function respondWithFilteredResult(_0x25aa08,_0x1513e5){return function(_0x4ca32a){if(_0x4ca32a){var _0x159769=typeof _0x1513e5[_0xe94e('0x19')]===_0xe94e('0x1a')&&typeof _0x1513e5[_0xe94e('0x1b')]===_0xe94e('0x1a');var _0x4ff193=_0x4ca32a[_0xe94e('0x1c')];var _0x18b844=_0x159769?0x0:_0x1513e5[_0xe94e('0x19')];var _0x4d3a3e=_0x159769?_0x4ca32a[_0xe94e('0x1c')]:_0x1513e5[_0xe94e('0x19')]+_0x1513e5[_0xe94e('0x1b')];var _0x194367;if(_0x4d3a3e>=_0x4ff193){_0x4d3a3e=_0x4ff193;_0x194367=0xc8;}else{_0x194367=0xce;}_0x25aa08[_0xe94e('0x17')](_0x194367);return _0x25aa08['set']('Content-Range',_0x18b844+'-'+_0x4d3a3e+'/'+_0x4ff193)[_0xe94e('0x18')](_0x4ca32a);}return null;};}function patchUpdates(_0x2d4f7b){return function(_0x4e2976){try{jsonpatch['apply'](_0x4e2976,_0x2d4f7b,!![]);}catch(_0x577507){return BPromise[_0xe94e('0x1d')](_0x577507);}return _0x4e2976['save']();};}function saveUpdates(_0x5b3993,_0xdbe940){return function(_0x3efc73){if(_0x3efc73){return _0x3efc73[_0xe94e('0x1e')](_0x5b3993)[_0xe94e('0x1f')](function(_0x479887){return _0x479887;});}return null;};}function removeEntity(_0x5cd725,_0x17225b){return function(_0x427005){if(_0x427005){return _0x427005[_0xe94e('0x20')]()[_0xe94e('0x1f')](function(){_0x5cd725[_0xe94e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a7bf4,_0x2f0d04){return function(_0xaa2cfd){if(!_0xaa2cfd){_0x3a7bf4['sendStatus'](0x194);}return _0xaa2cfd;};}function handleError(_0x33a278,_0x31c941){_0x31c941=_0x31c941||0x1f4;return function(_0x20aaaa){logger[_0xe94e('0x21')](_0x20aaaa[_0xe94e('0x22')]);if(_0x20aaaa[_0xe94e('0x23')]){delete _0x20aaaa[_0xe94e('0x23')];}_0x33a278[_0xe94e('0x17')](_0x31c941)['send'](_0x20aaaa);};}exports[_0xe94e('0x24')]=function(_0x5c5a44,_0x46fac3){var _0x2d0e9b={},_0x52e214={},_0x51d71d={'count':0x0,'rows':[]};var _0x2e6b07=_[_0xe94e('0x25')](db['ZendeskConfiguration'][_0xe94e('0x26')],function(_0x537f4d){return{'name':_0x537f4d['fieldName'],'type':_0x537f4d[_0xe94e('0x27')][_0xe94e('0x28')]};});_0x52e214[_0xe94e('0x29')]=_[_0xe94e('0x25')](_0x2e6b07,_0xe94e('0x23'));_0x52e214[_0xe94e('0x2a')]=_[_0xe94e('0x2b')](_0x5c5a44[_0xe94e('0x2a')]);_0x52e214[_0xe94e('0x2c')]=_[_0xe94e('0x2d')](_0x52e214[_0xe94e('0x29')],_0x52e214[_0xe94e('0x2a')]);_0x2d0e9b[_0xe94e('0x2e')]=_[_0xe94e('0x2d')](_0x52e214[_0xe94e('0x29')],qs['fields'](_0x5c5a44['query'][_0xe94e('0x2f')]));_0x2d0e9b[_0xe94e('0x2e')]=_0x2d0e9b[_0xe94e('0x2e')][_0xe94e('0x30')]?_0x2d0e9b[_0xe94e('0x2e')]:_0x52e214[_0xe94e('0x29')];if(!_0x5c5a44[_0xe94e('0x2a')][_0xe94e('0x31')](_0xe94e('0x32'))){_0x2d0e9b[_0xe94e('0x1b')]=qs[_0xe94e('0x1b')](_0x5c5a44[_0xe94e('0x2a')][_0xe94e('0x1b')]);_0x2d0e9b['offset']=qs[_0xe94e('0x19')](_0x5c5a44['query']['offset']);}_0x2d0e9b['order']=qs[_0xe94e('0x33')](_0x5c5a44['query'][_0xe94e('0x33')]);_0x2d0e9b[_0xe94e('0x34')]=qs[_0xe94e('0x2c')](_[_0xe94e('0x35')](_0x5c5a44['query'],_0x52e214[_0xe94e('0x2c')]),_0x2e6b07);if(_0x5c5a44['query'][_0xe94e('0x36')]){_0x2d0e9b['where']=_[_0xe94e('0x37')](_0x2d0e9b[_0xe94e('0x34')],{'$or':_['map'](_0x2e6b07,function(_0x421cae){if(_0x421cae[_0xe94e('0x27')]!==_0xe94e('0x38')){var _0x218ca4={};_0x218ca4[_0x421cae[_0xe94e('0x23')]]={'$like':'%'+_0x5c5a44['query'][_0xe94e('0x36')]+'%'};return _0x218ca4;}})});}_0x2d0e9b=_['merge']({},_0x2d0e9b,_0x5c5a44[_0xe94e('0x39')]);var _0x215a24={'where':_0x2d0e9b['where']};return db[_0xe94e('0x3a')]['count'](_0x215a24)['then'](function(_0x3f4fea){_0x51d71d[_0xe94e('0x1c')]=_0x3f4fea;if(_0x5c5a44['query'][_0xe94e('0x3b')]){_0x2d0e9b[_0xe94e('0x3c')]=[{'all':!![]}];}return db[_0xe94e('0x3a')][_0xe94e('0x3d')](_0x2d0e9b);})[_0xe94e('0x1f')](function(_0x44fae3){_0x51d71d[_0xe94e('0x3e')]=_0x44fae3;return _0x51d71d;})[_0xe94e('0x1f')](respondWithFilteredResult(_0x46fac3,_0x2d0e9b))[_0xe94e('0x3f')](handleError(_0x46fac3,null));};exports['show']=function(_0x10c1ee,_0x4d0616){var _0x50de58={'raw':![],'where':{'id':_0x10c1ee['params']['id']}},_0x3e6627={};_0x3e6627[_0xe94e('0x29')]=_[_0xe94e('0x2b')](db[_0xe94e('0x3a')][_0xe94e('0x26')]);_0x3e6627[_0xe94e('0x2a')]=_[_0xe94e('0x2b')](_0x10c1ee[_0xe94e('0x2a')]);_0x3e6627['filters']=_[_0xe94e('0x2d')](_0x3e6627['model'],_0x3e6627[_0xe94e('0x2a')]);_0x50de58[_0xe94e('0x2e')]=_[_0xe94e('0x2d')](_0x3e6627[_0xe94e('0x29')],qs[_0xe94e('0x2f')](_0x10c1ee[_0xe94e('0x2a')][_0xe94e('0x2f')]));_0x50de58[_0xe94e('0x2e')]=_0x50de58[_0xe94e('0x2e')]['length']?_0x50de58[_0xe94e('0x2e')]:_0x3e6627[_0xe94e('0x29')];if(_0x10c1ee[_0xe94e('0x2a')]['includeAll']){_0x50de58[_0xe94e('0x3c')]=[{'all':!![]}];}_0x50de58=_[_0xe94e('0x37')]({},_0x50de58,_0x10c1ee['options']);return db[_0xe94e('0x3a')][_0xe94e('0x40')](_0x50de58)[_0xe94e('0x1f')](handleEntityNotFound(_0x4d0616,null))[_0xe94e('0x1f')](respondWithResult(_0x4d0616,null))[_0xe94e('0x3f')](handleError(_0x4d0616,null));};exports[_0xe94e('0x41')]=function(_0x2a74b4,_0x1ea031){return db[_0xe94e('0x3a')][_0xe94e('0x41')](_0x2a74b4[_0xe94e('0x42')],{})[_0xe94e('0x1f')](respondWithResult(_0x1ea031,0xc9))[_0xe94e('0x3f')](handleError(_0x1ea031,null));};exports[_0xe94e('0x1e')]=function(_0x4c7d45,_0x1c8272){if(_0x4c7d45[_0xe94e('0x42')]['id']){delete _0x4c7d45[_0xe94e('0x42')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x4c7d45[_0xe94e('0x43')]['id']}})[_0xe94e('0x1f')](handleEntityNotFound(_0x1c8272,null))['then'](saveUpdates(_0x4c7d45['body'],null))['then'](respondWithResult(_0x1c8272,null))[_0xe94e('0x3f')](handleError(_0x1c8272,null));};exports[_0xe94e('0x20')]=function(_0x5880f9,_0x4c77db){return db[_0xe94e('0x3a')][_0xe94e('0x40')]({'where':{'id':_0x5880f9['params']['id']}})[_0xe94e('0x1f')](handleEntityNotFound(_0x4c77db,null))['then'](removeEntity(_0x4c77db,null))['catch'](handleError(_0x4c77db,null));};exports[_0xe94e('0x44')]=function(_0x29c021,_0x38c824,_0x3542cb){var _0x171a72={};var _0x39c09e={};var _0x2ebd3a;var _0x5c1826;return db[_0xe94e('0x3a')]['findOne']({'where':{'id':_0x29c021['params']['id']}})['then'](handleEntityNotFound(_0x38c824,null))[_0xe94e('0x1f')](function(_0x24a4c3){if(_0x24a4c3){_0x2ebd3a=_0x24a4c3;_0x39c09e[_0xe94e('0x29')]=_[_0xe94e('0x2b')](db[_0xe94e('0x45')][_0xe94e('0x26')]);_0x39c09e[_0xe94e('0x2a')]=_[_0xe94e('0x2b')](_0x29c021[_0xe94e('0x2a')]);_0x39c09e['filters']=_[_0xe94e('0x2d')](_0x39c09e[_0xe94e('0x29')],_0x39c09e[_0xe94e('0x2a')]);_0x171a72[_0xe94e('0x2e')]=_[_0xe94e('0x2d')](_0x39c09e['model'],qs['fields'](_0x29c021[_0xe94e('0x2a')]['fields']));_0x171a72[_0xe94e('0x2e')]=_0x171a72['attributes'][_0xe94e('0x30')]?_0x171a72[_0xe94e('0x2e')]:_0x39c09e[_0xe94e('0x29')];_0x171a72[_0xe94e('0x46')]=qs[_0xe94e('0x33')](_0x29c021[_0xe94e('0x2a')][_0xe94e('0x33')]);_0x171a72[_0xe94e('0x34')]=qs[_0xe94e('0x2c')](_[_0xe94e('0x35')](_0x29c021[_0xe94e('0x2a')],_0x39c09e[_0xe94e('0x2c')]));if(_0x29c021['query'][_0xe94e('0x36')]){_0x171a72[_0xe94e('0x34')]=_[_0xe94e('0x37')](_0x171a72[_0xe94e('0x34')],{'$or':_[_0xe94e('0x25')](_0x171a72['attributes'],function(_0x24cfaa){var _0x2f1ee8={};_0x2f1ee8[_0x24cfaa]={'$like':'%'+_0x29c021[_0xe94e('0x2a')][_0xe94e('0x36')]+'%'};return _0x2f1ee8;})});}_0x171a72=_[_0xe94e('0x37')]({},_0x171a72,_0x29c021[_0xe94e('0x39')]);return _0x2ebd3a[_0xe94e('0x44')](_0x171a72);}})[_0xe94e('0x1f')](function(_0x5aeeb4){if(_0x5aeeb4){_0x5c1826=_0x5aeeb4[_0xe94e('0x30')];if(!_0x29c021[_0xe94e('0x2a')]['hasOwnProperty'](_0xe94e('0x32'))){_0x171a72[_0xe94e('0x1b')]=qs[_0xe94e('0x1b')](_0x29c021[_0xe94e('0x2a')]['limit']);_0x171a72['offset']=qs[_0xe94e('0x19')](_0x29c021[_0xe94e('0x2a')]['offset']);}return _0x2ebd3a[_0xe94e('0x44')](_0x171a72);}})['then'](function(_0x422a47){if(_0x422a47){return _0x422a47?{'count':_0x5c1826,'rows':_0x422a47}:null;}})['then'](respondWithResult(_0x38c824,null))['catch'](handleError(_0x38c824,null));};exports[_0xe94e('0x47')]=function(_0x17c555,_0x56a790,_0x58aef1){var _0x57d633={};var _0x31173a={};var _0x1e2699;var _0xe352cc;return db[_0xe94e('0x3a')][_0xe94e('0x48')]({'where':{'id':_0x17c555[_0xe94e('0x43')]['id']}})['then'](handleEntityNotFound(_0x56a790,null))[_0xe94e('0x1f')](function(_0x1f9b5d){if(_0x1f9b5d){_0x1e2699=_0x1f9b5d;_0x31173a[_0xe94e('0x29')]=_[_0xe94e('0x2b')](db[_0xe94e('0x45')][_0xe94e('0x26')]);_0x31173a['query']=_[_0xe94e('0x2b')](_0x17c555['query']);_0x31173a[_0xe94e('0x2c')]=_['intersection'](_0x31173a[_0xe94e('0x29')],_0x31173a[_0xe94e('0x2a')]);_0x57d633[_0xe94e('0x2e')]=_[_0xe94e('0x2d')](_0x31173a[_0xe94e('0x29')],qs['fields'](_0x17c555[_0xe94e('0x2a')][_0xe94e('0x2f')]));_0x57d633[_0xe94e('0x2e')]=_0x57d633[_0xe94e('0x2e')][_0xe94e('0x30')]?_0x57d633[_0xe94e('0x2e')]:_0x31173a[_0xe94e('0x29')];_0x57d633[_0xe94e('0x46')]=qs[_0xe94e('0x33')](_0x17c555[_0xe94e('0x2a')]['sort']);_0x57d633[_0xe94e('0x34')]=qs[_0xe94e('0x2c')](_[_0xe94e('0x35')](_0x17c555[_0xe94e('0x2a')],_0x31173a[_0xe94e('0x2c')]));if(_0x17c555['query'][_0xe94e('0x36')]){_0x57d633[_0xe94e('0x34')]=_['merge'](_0x57d633['where'],{'$or':_[_0xe94e('0x25')](_0x57d633['attributes'],function(_0x3347cc){var _0x21a894={};_0x21a894[_0x3347cc]={'$like':'%'+_0x17c555[_0xe94e('0x2a')]['filter']+'%'};return _0x21a894;})});}_0x57d633=_[_0xe94e('0x37')]({},_0x57d633,_0x17c555[_0xe94e('0x39')]);return _0x1e2699[_0xe94e('0x47')](_0x57d633);}})[_0xe94e('0x1f')](function(_0x59b0ae){if(_0x59b0ae){_0xe352cc=_0x59b0ae[_0xe94e('0x30')];if(!_0x17c555[_0xe94e('0x2a')][_0xe94e('0x31')]('nolimit')){_0x57d633[_0xe94e('0x1b')]=qs[_0xe94e('0x1b')](_0x17c555[_0xe94e('0x2a')][_0xe94e('0x1b')]);_0x57d633[_0xe94e('0x19')]=qs[_0xe94e('0x19')](_0x17c555[_0xe94e('0x2a')][_0xe94e('0x19')]);}return _0x1e2699[_0xe94e('0x47')](_0x57d633);}})[_0xe94e('0x1f')](function(_0x40d74d){if(_0x40d74d){return _0x40d74d?{'count':_0xe352cc,'rows':_0x40d74d}:null;}})[_0xe94e('0x1f')](respondWithResult(_0x56a790,null))[_0xe94e('0x3f')](handleError(_0x56a790,null));};exports[_0xe94e('0x49')]=function(_0x2a969d,_0x5501ca,_0xa5778a){var _0x28a7ee={};var _0x132363={};var _0x5549e0;var _0x805332;return db['ZendeskConfiguration'][_0xe94e('0x48')]({'where':{'id':_0x2a969d[_0xe94e('0x43')]['id']}})['then'](handleEntityNotFound(_0x5501ca,null))[_0xe94e('0x1f')](function(_0x4e546a){if(_0x4e546a){_0x5549e0=_0x4e546a;_0x132363[_0xe94e('0x29')]=_[_0xe94e('0x2b')](db[_0xe94e('0x45')][_0xe94e('0x26')]);_0x132363[_0xe94e('0x2a')]=_[_0xe94e('0x2b')](_0x2a969d[_0xe94e('0x2a')]);_0x132363[_0xe94e('0x2c')]=_[_0xe94e('0x2d')](_0x132363[_0xe94e('0x29')],_0x132363[_0xe94e('0x2a')]);_0x28a7ee[_0xe94e('0x2e')]=_[_0xe94e('0x2d')](_0x132363[_0xe94e('0x29')],qs[_0xe94e('0x2f')](_0x2a969d[_0xe94e('0x2a')][_0xe94e('0x2f')]));_0x28a7ee['attributes']=_0x28a7ee[_0xe94e('0x2e')][_0xe94e('0x30')]?_0x28a7ee[_0xe94e('0x2e')]:_0x132363[_0xe94e('0x29')];_0x28a7ee[_0xe94e('0x46')]=qs[_0xe94e('0x33')](_0x2a969d[_0xe94e('0x2a')][_0xe94e('0x33')]);_0x28a7ee[_0xe94e('0x34')]=qs[_0xe94e('0x2c')](_['pick'](_0x2a969d['query'],_0x132363[_0xe94e('0x2c')]));if(_0x2a969d[_0xe94e('0x2a')][_0xe94e('0x36')]){_0x28a7ee['where']=_['merge'](_0x28a7ee['where'],{'$or':_['map'](_0x28a7ee[_0xe94e('0x2e')],function(_0x39d427){var _0x598589={};_0x598589[_0x39d427]={'$like':'%'+_0x2a969d[_0xe94e('0x2a')][_0xe94e('0x36')]+'%'};return _0x598589;})});}_0x28a7ee=_[_0xe94e('0x37')]({},_0x28a7ee,_0x2a969d[_0xe94e('0x39')]);return _0x5549e0[_0xe94e('0x49')](_0x28a7ee);}})['then'](function(_0x33f70c){if(_0x33f70c){_0x805332=_0x33f70c[_0xe94e('0x30')];if(!_0x2a969d[_0xe94e('0x2a')][_0xe94e('0x31')]('nolimit')){_0x28a7ee[_0xe94e('0x1b')]=qs[_0xe94e('0x1b')](_0x2a969d[_0xe94e('0x2a')][_0xe94e('0x1b')]);_0x28a7ee[_0xe94e('0x19')]=qs[_0xe94e('0x19')](_0x2a969d['query'][_0xe94e('0x19')]);}return _0x5549e0[_0xe94e('0x49')](_0x28a7ee);}})[_0xe94e('0x1f')](function(_0x50bd9a){if(_0x50bd9a){return _0x50bd9a?{'count':_0x805332,'rows':_0x50bd9a}:null;}})['then'](respondWithResult(_0x5501ca,null))['catch'](handleError(_0x5501ca,null));};exports[_0xe94e('0x4a')]=function(_0x3614e4,_0x21a5d6,_0xc013cf){var _0x24c0fc={};var _0x1cfe22={};var _0x12eec9;var _0x17975d;return db[_0xe94e('0x3a')]['findOne']({'where':{'id':_0x3614e4['params']['id']}})['then'](handleEntityNotFound(_0x21a5d6,null))[_0xe94e('0x1f')](function(_0x5d7afa){if(_0x5d7afa){_0x12eec9=_0x5d7afa;_0x1cfe22[_0xe94e('0x29')]=_['keys'](db[_0xe94e('0x4b')][_0xe94e('0x26')]);_0x1cfe22[_0xe94e('0x2a')]=_[_0xe94e('0x2b')](_0x3614e4[_0xe94e('0x2a')]);_0x1cfe22[_0xe94e('0x2c')]=_[_0xe94e('0x2d')](_0x1cfe22[_0xe94e('0x29')],_0x1cfe22[_0xe94e('0x2a')]);_0x24c0fc['attributes']=_[_0xe94e('0x2d')](_0x1cfe22[_0xe94e('0x29')],qs[_0xe94e('0x2f')](_0x3614e4['query']['fields']));_0x24c0fc[_0xe94e('0x2e')]=_0x24c0fc[_0xe94e('0x2e')][_0xe94e('0x30')]?_0x24c0fc[_0xe94e('0x2e')]:_0x1cfe22[_0xe94e('0x29')];_0x24c0fc[_0xe94e('0x46')]=qs[_0xe94e('0x33')](_0x3614e4[_0xe94e('0x2a')][_0xe94e('0x33')]);_0x24c0fc[_0xe94e('0x34')]=qs[_0xe94e('0x2c')](_['pick'](_0x3614e4[_0xe94e('0x2a')],_0x1cfe22[_0xe94e('0x2c')]));if(_0x3614e4['query'][_0xe94e('0x36')]){_0x24c0fc[_0xe94e('0x34')]=_[_0xe94e('0x37')](_0x24c0fc[_0xe94e('0x34')],{'$or':_[_0xe94e('0x25')](_0x24c0fc[_0xe94e('0x2e')],function(_0x394186){var _0x53fbcf={};_0x53fbcf[_0x394186]={'$like':'%'+_0x3614e4[_0xe94e('0x2a')]['filter']+'%'};return _0x53fbcf;})});}_0x24c0fc=_[_0xe94e('0x37')]({},_0x24c0fc,_0x3614e4[_0xe94e('0x39')]);return _0x12eec9[_0xe94e('0x4a')](_0x24c0fc);}})[_0xe94e('0x1f')](function(_0xe74113){if(_0xe74113){_0x17975d=_0xe74113[_0xe94e('0x30')];if(!_0x3614e4[_0xe94e('0x2a')][_0xe94e('0x31')](_0xe94e('0x32'))){_0x24c0fc['limit']=qs['limit'](_0x3614e4[_0xe94e('0x2a')][_0xe94e('0x1b')]);_0x24c0fc[_0xe94e('0x19')]=qs['offset'](_0x3614e4['query']['offset']);}return _0x12eec9[_0xe94e('0x4a')](_0x24c0fc);}})[_0xe94e('0x1f')](function(_0x89c47e){if(_0x89c47e){return _0x89c47e?{'count':_0x17975d,'rows':_0x89c47e}:null;}})[_0xe94e('0x1f')](respondWithResult(_0x21a5d6,null))[_0xe94e('0x3f')](handleError(_0x21a5d6,null));};exports[_0xe94e('0x4c')]=function(_0x57b26f,_0x524910,_0x28cf47){if(_0x57b26f['body']['id']){delete _0x57b26f['body']['id'];}return db[_0xe94e('0x3a')][_0xe94e('0x48')]({'where':{'id':_0x57b26f[_0xe94e('0x43')]['id']}})[_0xe94e('0x1f')](handleEntityNotFound(_0x524910,null))[_0xe94e('0x1f')](function(_0x5f38be){if(_0x5f38be){return _0x5f38be[_0xe94e('0x4c')](_0x57b26f[_0xe94e('0x42')]['ids']||[]);}return null;})[_0xe94e('0x1f')](respondWithResult(_0x524910,null))['catch'](handleError(_0x524910,null));};
\ No newline at end of file
index 83706cb..8355107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb78e=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x9474c4,_0x156c09){var _0x2ce057=function(_0x221deb){while(--_0x221deb){_0x9474c4['push'](_0x9474c4['shift']());}};_0x2ce057(++_0x156c09);}(_0xb78e,0x1c9));var _0xeb78=function(_0x2ea54f,_0x55d6b5){_0x2ea54f=_0x2ea54f-0x0;var _0x24bd17=_0xb78e[_0x2ea54f];return _0x24bd17;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var logger=require('../../config/logger')(_0xeb78('0x2'));var moment=require(_0xeb78('0x3'));var BPromise=require(_0xeb78('0x4'));var rp=require(_0xeb78('0x5'));var fs=require('fs');var path=require(_0xeb78('0x6'));var rimraf=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var attributes=require(_0xeb78('0x9'));module['exports']=function(_0x3c35e7,_0x17a736){return _0x3c35e7[_0xeb78('0xa')](_0xeb78('0xb'),attributes,{'tableName':_0xeb78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd824=['rimraf','../../config/environment','ZendeskConfiguration','int_zendesk_configurations','lodash','util','moment','bluebird','request-promise','path'];(function(_0x2d3305,_0x48e042){var _0xa333d1=function(_0x1cd694){while(--_0x1cd694){_0x2d3305['push'](_0x2d3305['shift']());}};_0xa333d1(++_0x48e042);}(_0xd824,0xc2));var _0x4d82=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd824[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4d82('0x2'));var BPromise=require(_0x4d82('0x3'));var rp=require(_0x4d82('0x4'));var fs=require('fs');var path=require(_0x4d82('0x5'));var rimraf=require(_0x4d82('0x6'));var config=require(_0x4d82('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0xd00023,_0x583c7c){return _0xd00023['define'](_0x4d82('0x8'),attributes,{'tableName':_0x4d82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 20c3fe8..a78cf4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea6b=['stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x5bd65b,_0xf5d5d6){var _0x577476=function(_0x2bba99){while(--_0x2bba99){_0x5bd65b['push'](_0x5bd65b['shift']());}};_0x577476(++_0xf5d5d6);}(_0xea6b,0xc4));var _0xbea6=function(_0x513b8d,_0x1f7ae4){_0x513b8d=_0x513b8d-0x0;var _0x59bd48=_0xea6b[_0x513b8d];return _0x59bd48;};'use strict';var _=require(_0xbea6('0x0'));var util=require(_0xbea6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbea6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbea6('0x3'))['db'];var utils=require(_0xbea6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbea6('0x5'));var jayson=require(_0xbea6('0x6'));var client=jayson['client'][_0xbea6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38712b,_0x373304,_0x4637ef){return new BPromise(function(_0x117f38,_0xe8cef9){return client[_0xbea6('0x8')](_0x38712b,_0x4637ef)[_0xbea6('0x9')](function(_0x482307){logger[_0xbea6('0xa')](_0xbea6('0xb'),_0x373304,'request\x20sent');logger['debug'](_0xbea6('0xc'),_0x373304,'request\x20sent',JSON[_0xbea6('0xd')](_0x482307));if(_0x482307[_0xbea6('0xe')]){if(_0x482307[_0xbea6('0xe')][_0xbea6('0xf')]===0x1f4){logger[_0xbea6('0xe')](_0xbea6('0xb'),_0x373304,_0x482307[_0xbea6('0xe')][_0xbea6('0x10')]);return _0xe8cef9(_0x482307[_0xbea6('0xe')][_0xbea6('0x10')]);}logger[_0xbea6('0xe')](_0xbea6('0xb'),_0x373304,_0x482307['error']['message']);return _0x117f38(_0x482307['error'][_0xbea6('0x10')]);}else{logger['info'](_0xbea6('0xb'),_0x373304,'request\x20sent');_0x117f38(_0x482307[_0xbea6('0x11')]['message']);}})[_0xbea6('0x12')](function(_0x402877){logger[_0xbea6('0xe')](_0xbea6('0xb'),_0x373304,_0x402877);_0xe8cef9(_0x402877);});});}
\ No newline at end of file
+var _0x3431=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','ioredis','../../mysqldb'];(function(_0x21b17d,_0xbfce4d){var _0x17da76=function(_0x575163){while(--_0x575163){_0x21b17d['push'](_0x21b17d['shift']());}};_0x17da76(++_0xbfce4d);}(_0x3431,0x1c8));var _0x1343=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0x3431[_0x402731];return _0x111736;};'use strict';var _=require(_0x1343('0x0'));var util=require(_0x1343('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1343('0x2'));var db=require(_0x1343('0x3'))['db'];var utils=require(_0x1343('0x4'));var logger=require(_0x1343('0x5'))(_0x1343('0x6'));var config=require('../../config/environment');var jayson=require(_0x1343('0x7'));var client=jayson[_0x1343('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c48d0,_0x14ec31,_0x1fe915){return new BPromise(function(_0x3e7895,_0x5aef4){return client[_0x1343('0x9')](_0x4c48d0,_0x1fe915)['then'](function(_0x116c44){logger[_0x1343('0xa')](_0x1343('0xb'),_0x14ec31,_0x1343('0xc'));logger[_0x1343('0xd')](_0x1343('0xe'),_0x14ec31,_0x1343('0xc'),JSON[_0x1343('0xf')](_0x116c44));if(_0x116c44[_0x1343('0x10')]){if(_0x116c44['error'][_0x1343('0x11')]===0x1f4){logger[_0x1343('0x10')](_0x1343('0xb'),_0x14ec31,_0x116c44[_0x1343('0x10')][_0x1343('0x12')]);return _0x5aef4(_0x116c44[_0x1343('0x10')][_0x1343('0x12')]);}logger['error'](_0x1343('0xb'),_0x14ec31,_0x116c44[_0x1343('0x10')][_0x1343('0x12')]);return _0x3e7895(_0x116c44[_0x1343('0x10')][_0x1343('0x12')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x14ec31,_0x1343('0xc'));_0x3e7895(_0x116c44[_0x1343('0x13')][_0x1343('0x12')]);}})['catch'](function(_0x3c074c){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x14ec31,_0x3c074c);_0x5aef4(_0x3c074c);});});}
\ No newline at end of file
index e451481..23a429d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe71=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','multer','util','connect-timeout'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xbe71,0x153));var _0x1be7=function(_0x303116,_0x326824){_0x303116=_0x303116-0x0;var _0x10082c=_0xbe71[_0x303116];return _0x10082c;};'use strict';var multer=require(_0x1be7('0x0'));var util=require(_0x1be7('0x1'));var path=require('path');var timeout=require(_0x1be7('0x2'));var express=require(_0x1be7('0x3'));var router=express['Router']();var fs_extra=require(_0x1be7('0x4'));var auth=require(_0x1be7('0x5'));var interaction=require(_0x1be7('0x6'));var config=require('../../config/environment');var controller=require(_0x1be7('0x7'));router['get']('/',auth[_0x1be7('0x8')](),controller[_0x1be7('0x9')]);router[_0x1be7('0xa')](_0x1be7('0xb'),auth[_0x1be7('0x8')](),controller[_0x1be7('0xc')]);router[_0x1be7('0xd')]('/',auth['isAuthenticated'](),controller[_0x1be7('0xe')]);router['put'](_0x1be7('0xb'),auth[_0x1be7('0x8')](),controller[_0x1be7('0xf')]);router[_0x1be7('0x10')](_0x1be7('0xb'),auth[_0x1be7('0x8')](),controller[_0x1be7('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xa78c=['/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','index'];(function(_0x3bdd65,_0x3d187e){var _0x4c7ec6=function(_0x447e50){while(--_0x447e50){_0x3bdd65['push'](_0x3bdd65['shift']());}};_0x4c7ec6(++_0x3d187e);}(_0xa78c,0x1ee));var _0xca78=function(_0x3f1ded,_0x3a1b6e){_0x3f1ded=_0x3f1ded-0x0;var _0x5d673e=_0xa78c[_0x3f1ded];return _0x5d673e;};'use strict';var multer=require(_0xca78('0x0'));var util=require(_0xca78('0x1'));var path=require(_0xca78('0x2'));var timeout=require(_0xca78('0x3'));var express=require(_0xca78('0x4'));var router=express['Router']();var fs_extra=require(_0xca78('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xca78('0x6'));var config=require(_0xca78('0x7'));var controller=require('./intZendeskField.controller');router[_0xca78('0x8')]('/',auth['isAuthenticated'](),controller[_0xca78('0x9')]);router[_0xca78('0x8')](_0xca78('0xa'),auth[_0xca78('0xb')](),controller[_0xca78('0xc')]);router['post']('/',auth[_0xca78('0xb')](),controller[_0xca78('0xd')]);router[_0xca78('0xe')](_0xca78('0xa'),auth[_0xca78('0xb')](),controller[_0xca78('0xf')]);router['delete']('/:id',auth[_0xca78('0xb')](),controller[_0xca78('0x10')]);module[_0xca78('0x11')]=router;
\ No newline at end of file
index 8de083d..46558d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2302=['picklist','STRING','BOOLEAN','ENUM','string','variable','customVariable'];(function(_0x39e8a8,_0x264800){var _0x1f0e77=function(_0x554741){while(--_0x554741){_0x39e8a8['push'](_0x39e8a8['shift']());}};_0x1f0e77(++_0x264800);}(_0x2302,0x9d));var _0x2230=function(_0x12fcbd,_0x884804){_0x12fcbd=_0x12fcbd-0x0;var _0x28ec2a=_0x2302[_0x12fcbd];return _0x28ec2a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2230('0x0')](_0x2230('0x1'),_0x2230('0x2'),_0x2230('0x3'),'keyValue',_0x2230('0x4')),'defaultValue':_0x2230('0x1')},'content':{'type':Sequelize[_0x2230('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2230('0x0')]('string',_0x2230('0x2'),_0x2230('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2230('0x5')]},'nameField':{'type':Sequelize[_0x2230('0x5')]},'customField':{'type':Sequelize[_0x2230('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xee0b=['string','customVariable','BOOLEAN','sequelize','ENUM','variable','keyValue','picklist','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xee0b,0x8a));var _0xbee0=function(_0x56a201,_0xb89fb4){_0x56a201=_0x56a201-0x0;var _0xbaa432=_0xee0b[_0x56a201];return _0xbaa432;};'use strict';var Sequelize=require(_0xbee0('0x0'));module['exports']={'type':{'type':Sequelize[_0xbee0('0x1')]('string',_0xbee0('0x2'),'customVariable',_0xbee0('0x3'),_0xbee0('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbee0('0x5')]},'key':{'type':Sequelize[_0xbee0('0x5')]},'keyType':{'type':Sequelize[_0xbee0('0x1')](_0xbee0('0x6'),_0xbee0('0x2'),_0xbee0('0x7'))},'keyContent':{'type':Sequelize[_0xbee0('0x5')]},'idField':{'type':Sequelize[_0xbee0('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbee0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbee0('0x5')]}};
\ No newline at end of file
index ad945dd..b77fbf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0269=['params','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','update'];(function(_0x4e1d3c,_0x4f9988){var _0x5177b2=function(_0x26109f){while(--_0x26109f){_0x4e1d3c['push'](_0x4e1d3c['shift']());}};_0x5177b2(++_0x4f9988);}(_0x0269,0x135));var _0x9026=function(_0xde9557,_0x42aac9){_0xde9557=_0xde9557-0x0;var _0x55a41e=_0x0269[_0xde9557];return _0x55a41e;};'use strict';var emlformat=require(_0x9026('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9026('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9026('0x2'));var moment=require('moment');var BPromise=require(_0x9026('0x3'));var Mustache=require(_0x9026('0x4'));var util=require(_0x9026('0x5'));var path=require(_0x9026('0x6'));var sox=require('sox');var csv=require(_0x9026('0x7'));var ejs=require(_0x9026('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9026('0x9'));var crypto=require(_0x9026('0xa'));var jsforce=require(_0x9026('0xb'));var deskjs=require(_0x9026('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9026('0xd'));var Papa=require(_0x9026('0xe'));var Redis=require(_0x9026('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9026('0x10'));var as=require(_0x9026('0x11'));var hardwareService=require(_0x9026('0x12'));var logger=require('../../config/logger')(_0x9026('0x13'));var utils=require('../../config/utils');var config=require(_0x9026('0x14'));var licenseUtil=require(_0x9026('0x15'));var db=require(_0x9026('0x16'))['db'];function respondWithStatusCode(_0x2148f0,_0x40f526){_0x40f526=_0x40f526||0xcc;return function(_0x40b5dd){if(_0x40b5dd){return _0x2148f0[_0x9026('0x17')](_0x40f526);}return _0x2148f0['status'](_0x40f526)[_0x9026('0x18')]();};}function respondWithResult(_0x4ee699,_0x385afc){_0x385afc=_0x385afc||0xc8;return function(_0x2612cd){if(_0x2612cd){return _0x4ee699[_0x9026('0x19')](_0x385afc)[_0x9026('0x1a')](_0x2612cd);}};}function respondWithFilteredResult(_0x11c0d1,_0x421ee2){return function(_0x142465){if(_0x142465){var _0x1eb679=typeof _0x421ee2['offset']===_0x9026('0x1b')&&typeof _0x421ee2[_0x9026('0x1c')]==='undefined';var _0xc68011=_0x142465[_0x9026('0x1d')];var _0x15b3ab=_0x1eb679?0x0:_0x421ee2[_0x9026('0x1e')];var _0x1d1613=_0x1eb679?_0x142465[_0x9026('0x1d')]:_0x421ee2[_0x9026('0x1e')]+_0x421ee2[_0x9026('0x1c')];var _0x52edf1;if(_0x1d1613>=_0xc68011){_0x1d1613=_0xc68011;_0x52edf1=0xc8;}else{_0x52edf1=0xce;}_0x11c0d1[_0x9026('0x19')](_0x52edf1);return _0x11c0d1['set'](_0x9026('0x1f'),_0x15b3ab+'-'+_0x1d1613+'/'+_0xc68011)['json'](_0x142465);}return null;};}function patchUpdates(_0x2a9bf0){return function(_0x1b03af){try{jsonpatch[_0x9026('0x20')](_0x1b03af,_0x2a9bf0,!![]);}catch(_0x22a77c){return BPromise[_0x9026('0x21')](_0x22a77c);}return _0x1b03af[_0x9026('0x22')]();};}function saveUpdates(_0x71a263,_0x39f515){return function(_0x12e0b3){if(_0x12e0b3){return _0x12e0b3['update'](_0x71a263)['then'](function(_0x7b962){return _0x7b962;});}return null;};}function removeEntity(_0x134221,_0x2968fb){return function(_0x82a8e0){if(_0x82a8e0){return _0x82a8e0[_0x9026('0x23')]()[_0x9026('0x24')](function(){_0x134221[_0x9026('0x19')](0xcc)[_0x9026('0x18')]();});}};}function handleEntityNotFound(_0x775596,_0x4293df){return function(_0xde5c83){if(!_0xde5c83){_0x775596[_0x9026('0x17')](0x194);}return _0xde5c83;};}function handleError(_0x38fd9c,_0x2ace13){_0x2ace13=_0x2ace13||0x1f4;return function(_0x28dba4){logger[_0x9026('0x25')](_0x28dba4[_0x9026('0x26')]);if(_0x28dba4[_0x9026('0x27')]){delete _0x28dba4[_0x9026('0x27')];}_0x38fd9c['status'](_0x2ace13)[_0x9026('0x28')](_0x28dba4);};}exports[_0x9026('0x29')]=function(_0x30c988,_0x103ce7){var _0x17dc25={},_0x3cead8={},_0x23cf05={'count':0x0,'rows':[]};var _0xedb8bb=_[_0x9026('0x2a')](db[_0x9026('0x2b')][_0x9026('0x2c')],function(_0x5d2672){return{'name':_0x5d2672[_0x9026('0x2d')],'type':_0x5d2672[_0x9026('0x2e')][_0x9026('0x2f')]};});_0x3cead8[_0x9026('0x30')]=_[_0x9026('0x2a')](_0xedb8bb,_0x9026('0x27'));_0x3cead8[_0x9026('0x31')]=_['keys'](_0x30c988[_0x9026('0x31')]);_0x3cead8['filters']=_[_0x9026('0x32')](_0x3cead8[_0x9026('0x30')],_0x3cead8[_0x9026('0x31')]);_0x17dc25[_0x9026('0x33')]=_[_0x9026('0x32')](_0x3cead8[_0x9026('0x30')],qs['fields'](_0x30c988[_0x9026('0x31')][_0x9026('0x34')]));_0x17dc25[_0x9026('0x33')]=_0x17dc25[_0x9026('0x33')]['length']?_0x17dc25[_0x9026('0x33')]:_0x3cead8[_0x9026('0x30')];if(!_0x30c988['query'][_0x9026('0x35')](_0x9026('0x36'))){_0x17dc25[_0x9026('0x1c')]=qs[_0x9026('0x1c')](_0x30c988[_0x9026('0x31')][_0x9026('0x1c')]);_0x17dc25[_0x9026('0x1e')]=qs[_0x9026('0x1e')](_0x30c988['query'][_0x9026('0x1e')]);}_0x17dc25[_0x9026('0x37')]=qs['sort'](_0x30c988[_0x9026('0x31')][_0x9026('0x38')]);_0x17dc25[_0x9026('0x39')]=qs[_0x9026('0x3a')](_[_0x9026('0x3b')](_0x30c988[_0x9026('0x31')],_0x3cead8[_0x9026('0x3a')]),_0xedb8bb);if(_0x30c988[_0x9026('0x31')]['filter']){_0x17dc25[_0x9026('0x39')]=_[_0x9026('0x3c')](_0x17dc25[_0x9026('0x39')],{'$or':_[_0x9026('0x2a')](_0xedb8bb,function(_0x1fc5cc){if(_0x1fc5cc[_0x9026('0x2e')]!==_0x9026('0x3d')){var _0x4c950e={};_0x4c950e[_0x1fc5cc[_0x9026('0x27')]]={'$like':'%'+_0x30c988['query'][_0x9026('0x3e')]+'%'};return _0x4c950e;}})});}_0x17dc25=_[_0x9026('0x3c')]({},_0x17dc25,_0x30c988[_0x9026('0x3f')]);var _0x3e106a={'where':_0x17dc25['where']};return db['ZendeskField'][_0x9026('0x1d')](_0x3e106a)[_0x9026('0x24')](function(_0x51e719){_0x23cf05['count']=_0x51e719;if(_0x30c988['query'][_0x9026('0x40')]){_0x17dc25[_0x9026('0x41')]=[{'all':!![]}];}return db['ZendeskField'][_0x9026('0x42')](_0x17dc25);})[_0x9026('0x24')](function(_0x1a77bd){_0x23cf05[_0x9026('0x43')]=_0x1a77bd;return _0x23cf05;})[_0x9026('0x24')](respondWithFilteredResult(_0x103ce7,_0x17dc25))[_0x9026('0x44')](handleError(_0x103ce7,null));};exports[_0x9026('0x45')]=function(_0x2c24f4,_0x5e18cf){var _0x2d6801={'raw':!![],'where':{'id':_0x2c24f4['params']['id']}},_0x2ece36={};_0x2ece36['model']=_['keys'](db[_0x9026('0x2b')][_0x9026('0x2c')]);_0x2ece36[_0x9026('0x31')]=_[_0x9026('0x46')](_0x2c24f4[_0x9026('0x31')]);_0x2ece36['filters']=_[_0x9026('0x32')](_0x2ece36['model'],_0x2ece36[_0x9026('0x31')]);_0x2d6801[_0x9026('0x33')]=_[_0x9026('0x32')](_0x2ece36[_0x9026('0x30')],qs['fields'](_0x2c24f4['query'][_0x9026('0x34')]));_0x2d6801[_0x9026('0x33')]=_0x2d6801[_0x9026('0x33')][_0x9026('0x47')]?_0x2d6801[_0x9026('0x33')]:_0x2ece36[_0x9026('0x30')];if(_0x2c24f4['query'][_0x9026('0x40')]){_0x2d6801['include']=[{'all':!![]}];}_0x2d6801=_[_0x9026('0x3c')]({},_0x2d6801,_0x2c24f4[_0x9026('0x3f')]);return db['ZendeskField'][_0x9026('0x48')](_0x2d6801)['then'](handleEntityNotFound(_0x5e18cf,null))[_0x9026('0x24')](respondWithResult(_0x5e18cf,null))['catch'](handleError(_0x5e18cf,null));};exports[_0x9026('0x49')]=function(_0x48ceb1,_0x530244){return db[_0x9026('0x2b')][_0x9026('0x49')](_0x48ceb1[_0x9026('0x4a')],{})['then'](respondWithResult(_0x530244,0xc9))[_0x9026('0x44')](handleError(_0x530244,null));};exports[_0x9026('0x4b')]=function(_0x446cd0,_0x442e5a){if(_0x446cd0[_0x9026('0x4a')]['id']){delete _0x446cd0['body']['id'];}return db[_0x9026('0x2b')][_0x9026('0x48')]({'where':{'id':_0x446cd0[_0x9026('0x4c')]['id']}})[_0x9026('0x24')](handleEntityNotFound(_0x442e5a,null))[_0x9026('0x24')](saveUpdates(_0x446cd0[_0x9026('0x4a')],null))['then'](respondWithResult(_0x442e5a,null))[_0x9026('0x44')](handleError(_0x442e5a,null));};exports['destroy']=function(_0x2e3025,_0xf0a02e){return db['ZendeskField'][_0x9026('0x48')]({'where':{'id':_0x2e3025[_0x9026('0x4c')]['id']}})[_0x9026('0x24')](handleEntityNotFound(_0xf0a02e,null))[_0x9026('0x24')](removeEntity(_0xf0a02e,null))[_0x9026('0x44')](handleError(_0xf0a02e,null));};
\ No newline at end of file
+var _0x4198=['query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','ZendeskField','findAll','rows','catch','show','params','rawAttributes','includeAll','include','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','index','map','type','keys','intersection','model'];(function(_0x4cb5fe,_0x3b261b){var _0x183084=function(_0x4e4fea){while(--_0x4e4fea){_0x4cb5fe['push'](_0x4cb5fe['shift']());}};_0x183084(++_0x3b261b);}(_0x4198,0x69));var _0x8419=function(_0x4740bc,_0x558b1e){_0x4740bc=_0x4740bc-0x0;var _0x597283=_0x4198[_0x4740bc];return _0x597283;};'use strict';var emlformat=require(_0x8419('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8419('0x1'));var jsonpatch=require(_0x8419('0x2'));var rp=require(_0x8419('0x3'));var moment=require(_0x8419('0x4'));var BPromise=require(_0x8419('0x5'));var Mustache=require(_0x8419('0x6'));var util=require(_0x8419('0x7'));var path=require(_0x8419('0x8'));var sox=require(_0x8419('0x9'));var csv=require(_0x8419('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8419('0xb'));var _=require(_0x8419('0xc'));var squel=require(_0x8419('0xd'));var crypto=require(_0x8419('0xe'));var jsforce=require(_0x8419('0xf'));var deskjs=require(_0x8419('0x10'));var toCsv=require(_0x8419('0xa'));var querystring=require(_0x8419('0x11'));var Papa=require(_0x8419('0x12'));var Redis=require(_0x8419('0x13'));var authService=require(_0x8419('0x14'));var qs=require(_0x8419('0x15'));var as=require(_0x8419('0x16'));var hardwareService=require(_0x8419('0x17'));var logger=require(_0x8419('0x18'))('api');var utils=require(_0x8419('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8419('0x1a'));var db=require(_0x8419('0x1b'))['db'];function respondWithStatusCode(_0x14c1bd,_0x493f53){_0x493f53=_0x493f53||0xcc;return function(_0x54f5b3){if(_0x54f5b3){return _0x14c1bd[_0x8419('0x1c')](_0x493f53);}return _0x14c1bd[_0x8419('0x1d')](_0x493f53)['end']();};}function respondWithResult(_0x166586,_0x298d33){_0x298d33=_0x298d33||0xc8;return function(_0x2e4d33){if(_0x2e4d33){return _0x166586[_0x8419('0x1d')](_0x298d33)[_0x8419('0x1e')](_0x2e4d33);}};}function respondWithFilteredResult(_0x5983c1,_0x434bd4){return function(_0xab746e){if(_0xab746e){var _0x4f0ceb=typeof _0x434bd4[_0x8419('0x1f')]===_0x8419('0x20')&&typeof _0x434bd4[_0x8419('0x21')]===_0x8419('0x20');var _0x1c1fe4=_0xab746e[_0x8419('0x22')];var _0x3b8d51=_0x4f0ceb?0x0:_0x434bd4[_0x8419('0x1f')];var _0x44569a=_0x4f0ceb?_0xab746e['count']:_0x434bd4['offset']+_0x434bd4[_0x8419('0x21')];var _0x275a4c;if(_0x44569a>=_0x1c1fe4){_0x44569a=_0x1c1fe4;_0x275a4c=0xc8;}else{_0x275a4c=0xce;}_0x5983c1[_0x8419('0x1d')](_0x275a4c);return _0x5983c1[_0x8419('0x23')](_0x8419('0x24'),_0x3b8d51+'-'+_0x44569a+'/'+_0x1c1fe4)[_0x8419('0x1e')](_0xab746e);}return null;};}function patchUpdates(_0x43efb7){return function(_0x3e3beb){try{jsonpatch[_0x8419('0x25')](_0x3e3beb,_0x43efb7,!![]);}catch(_0x149537){return BPromise[_0x8419('0x26')](_0x149537);}return _0x3e3beb['save']();};}function saveUpdates(_0x24decb,_0x110f0e){return function(_0xb4fa12){if(_0xb4fa12){return _0xb4fa12[_0x8419('0x27')](_0x24decb)['then'](function(_0x38dfef){return _0x38dfef;});}return null;};}function removeEntity(_0x4cf022,_0x5d66d4){return function(_0x1cab7d){if(_0x1cab7d){return _0x1cab7d[_0x8419('0x28')]()[_0x8419('0x29')](function(){_0x4cf022[_0x8419('0x1d')](0xcc)[_0x8419('0x2a')]();});}};}function handleEntityNotFound(_0x496b2f,_0x1c4a4c){return function(_0x38d857){if(!_0x38d857){_0x496b2f[_0x8419('0x1c')](0x194);}return _0x38d857;};}function handleError(_0x17d8fe,_0x2b8157){_0x2b8157=_0x2b8157||0x1f4;return function(_0x1184d8){logger[_0x8419('0x2b')](_0x1184d8[_0x8419('0x2c')]);if(_0x1184d8[_0x8419('0x2d')]){delete _0x1184d8[_0x8419('0x2d')];}_0x17d8fe[_0x8419('0x1d')](_0x2b8157)[_0x8419('0x2e')](_0x1184d8);};}exports[_0x8419('0x2f')]=function(_0x4a5487,_0x4e78e4){var _0x2dbc2f={},_0x18c0b4={},_0x6aab04={'count':0x0,'rows':[]};var _0x12e1b9=_[_0x8419('0x30')](db['ZendeskField']['rawAttributes'],function(_0x3e18c5){return{'name':_0x3e18c5['fieldName'],'type':_0x3e18c5[_0x8419('0x31')]['key']};});_0x18c0b4['model']=_[_0x8419('0x30')](_0x12e1b9,_0x8419('0x2d'));_0x18c0b4['query']=_[_0x8419('0x32')](_0x4a5487['query']);_0x18c0b4['filters']=_[_0x8419('0x33')](_0x18c0b4[_0x8419('0x34')],_0x18c0b4[_0x8419('0x35')]);_0x2dbc2f['attributes']=_[_0x8419('0x33')](_0x18c0b4[_0x8419('0x34')],qs[_0x8419('0x36')](_0x4a5487[_0x8419('0x35')]['fields']));_0x2dbc2f[_0x8419('0x37')]=_0x2dbc2f[_0x8419('0x37')][_0x8419('0x38')]?_0x2dbc2f[_0x8419('0x37')]:_0x18c0b4[_0x8419('0x34')];if(!_0x4a5487[_0x8419('0x35')][_0x8419('0x39')](_0x8419('0x3a'))){_0x2dbc2f[_0x8419('0x21')]=qs[_0x8419('0x21')](_0x4a5487[_0x8419('0x35')][_0x8419('0x21')]);_0x2dbc2f['offset']=qs['offset'](_0x4a5487[_0x8419('0x35')]['offset']);}_0x2dbc2f['order']=qs[_0x8419('0x3b')](_0x4a5487[_0x8419('0x35')][_0x8419('0x3b')]);_0x2dbc2f[_0x8419('0x3c')]=qs[_0x8419('0x3d')](_[_0x8419('0x3e')](_0x4a5487[_0x8419('0x35')],_0x18c0b4[_0x8419('0x3d')]),_0x12e1b9);if(_0x4a5487[_0x8419('0x35')][_0x8419('0x3f')]){_0x2dbc2f[_0x8419('0x3c')]=_[_0x8419('0x40')](_0x2dbc2f[_0x8419('0x3c')],{'$or':_[_0x8419('0x30')](_0x12e1b9,function(_0x5d6d2c){if(_0x5d6d2c[_0x8419('0x31')]!==_0x8419('0x41')){var _0x5b1fba={};_0x5b1fba[_0x5d6d2c[_0x8419('0x2d')]]={'$like':'%'+_0x4a5487[_0x8419('0x35')]['filter']+'%'};return _0x5b1fba;}})});}_0x2dbc2f=_[_0x8419('0x40')]({},_0x2dbc2f,_0x4a5487['options']);var _0x1d0dd1={'where':_0x2dbc2f[_0x8419('0x3c')]};return db[_0x8419('0x42')][_0x8419('0x22')](_0x1d0dd1)[_0x8419('0x29')](function(_0x5ba4dd){_0x6aab04[_0x8419('0x22')]=_0x5ba4dd;if(_0x4a5487['query']['includeAll']){_0x2dbc2f['include']=[{'all':!![]}];}return db['ZendeskField'][_0x8419('0x43')](_0x2dbc2f);})[_0x8419('0x29')](function(_0x18f7ad){_0x6aab04[_0x8419('0x44')]=_0x18f7ad;return _0x6aab04;})[_0x8419('0x29')](respondWithFilteredResult(_0x4e78e4,_0x2dbc2f))[_0x8419('0x45')](handleError(_0x4e78e4,null));};exports[_0x8419('0x46')]=function(_0x55940c,_0x3fab83){var _0x216aad={'raw':!![],'where':{'id':_0x55940c[_0x8419('0x47')]['id']}},_0x1ca1b4={};_0x1ca1b4['model']=_[_0x8419('0x32')](db['ZendeskField'][_0x8419('0x48')]);_0x1ca1b4[_0x8419('0x35')]=_[_0x8419('0x32')](_0x55940c[_0x8419('0x35')]);_0x1ca1b4[_0x8419('0x3d')]=_[_0x8419('0x33')](_0x1ca1b4[_0x8419('0x34')],_0x1ca1b4[_0x8419('0x35')]);_0x216aad[_0x8419('0x37')]=_['intersection'](_0x1ca1b4['model'],qs['fields'](_0x55940c[_0x8419('0x35')][_0x8419('0x36')]));_0x216aad[_0x8419('0x37')]=_0x216aad[_0x8419('0x37')][_0x8419('0x38')]?_0x216aad[_0x8419('0x37')]:_0x1ca1b4[_0x8419('0x34')];if(_0x55940c[_0x8419('0x35')][_0x8419('0x49')]){_0x216aad[_0x8419('0x4a')]=[{'all':!![]}];}_0x216aad=_[_0x8419('0x40')]({},_0x216aad,_0x55940c[_0x8419('0x4b')]);return db[_0x8419('0x42')][_0x8419('0x4c')](_0x216aad)[_0x8419('0x29')](handleEntityNotFound(_0x3fab83,null))['then'](respondWithResult(_0x3fab83,null))[_0x8419('0x45')](handleError(_0x3fab83,null));};exports[_0x8419('0x4d')]=function(_0x356d81,_0x14e37a){return db[_0x8419('0x42')][_0x8419('0x4d')](_0x356d81['body'],{})[_0x8419('0x29')](respondWithResult(_0x14e37a,0xc9))[_0x8419('0x45')](handleError(_0x14e37a,null));};exports['update']=function(_0x181581,_0x17978c){if(_0x181581['body']['id']){delete _0x181581['body']['id'];}return db['ZendeskField'][_0x8419('0x4c')]({'where':{'id':_0x181581[_0x8419('0x47')]['id']}})['then'](handleEntityNotFound(_0x17978c,null))[_0x8419('0x29')](saveUpdates(_0x181581[_0x8419('0x4e')],null))['then'](respondWithResult(_0x17978c,null))[_0x8419('0x45')](handleError(_0x17978c,null));};exports[_0x8419('0x28')]=function(_0x22db14,_0x2bc681){return db[_0x8419('0x42')]['find']({'where':{'id':_0x22db14['params']['id']}})['then'](handleEntityNotFound(_0x2bc681,null))[_0x8419('0x29')](removeEntity(_0x2bc681,null))[_0x8419('0x45')](handleError(_0x2bc681,null));};
\ No newline at end of file
index 2b41def..27bca98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b81=['api','moment','request-promise','path','rimraf','../../config/environment','exports','int_zendesk_fields','zendesk_unique_index','idField','lodash'];(function(_0x3998cb,_0x414d0b){var _0x38f873=function(_0x48d438){while(--_0x48d438){_0x3998cb['push'](_0x3998cb['shift']());}};_0x38f873(++_0x414d0b);}(_0x3b81,0x1d8));var _0x13b8=function(_0x185678,_0x39c466){_0x185678=_0x185678-0x0;var _0x4e1c19=_0x3b81[_0x185678];return _0x4e1c19;};'use strict';var _=require(_0x13b8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x13b8('0x1'));var moment=require(_0x13b8('0x2'));var BPromise=require('bluebird');var rp=require(_0x13b8('0x3'));var fs=require('fs');var path=require(_0x13b8('0x4'));var rimraf=require(_0x13b8('0x5'));var config=require(_0x13b8('0x6'));var attributes=require('./intZendeskField.attributes');module[_0x13b8('0x7')]=function(_0x2218a8,_0x2284cd){return _0x2218a8['define']('ZendeskField',attributes,{'tableName':_0x13b8('0x8'),'paranoid':![],'indexes':[{'name':_0x13b8('0x9'),'fields':[_0x13b8('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x98cc=['bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','api'];(function(_0x1f3e17,_0x339c6a){var _0x3587ec=function(_0x1a55eb){while(--_0x1a55eb){_0x1f3e17['push'](_0x1f3e17['shift']());}};_0x3587ec(++_0x339c6a);}(_0x98cc,0x156));var _0xc98c=function(_0x161e88,_0x49ce5e){_0x161e88=_0x161e88-0x0;var _0x40ee62=_0x98cc[_0x161e88];return _0x40ee62;};'use strict';var _=require(_0xc98c('0x0'));var util=require(_0xc98c('0x1'));var logger=require('../../config/logger')(_0xc98c('0x2'));var moment=require('moment');var BPromise=require(_0xc98c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc98c('0x4'));var rimraf=require(_0xc98c('0x5'));var config=require(_0xc98c('0x6'));var attributes=require(_0xc98c('0x7'));module[_0xc98c('0x8')]=function(_0x3aba35,_0x50e45f){return _0x3aba35[_0xc98c('0x9')](_0xc98c('0xa'),attributes,{'tableName':_0xc98c('0xb'),'paranoid':![],'indexes':[{'name':_0xc98c('0xc'),'fields':[_0xc98c('0xd'),_0xc98c('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 4b77856..3ef696f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c2a=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x2bf31e,_0x3d5db7){var _0x528176=function(_0x4f8d63){while(--_0x4f8d63){_0x2bf31e['push'](_0x2bf31e['shift']());}};_0x528176(++_0x3d5db7);}(_0x0c2a,0xd0));var _0xa0c2=function(_0x1bf51b,_0xa573fa){_0x1bf51b=_0x1bf51b-0x0;var _0x1e6241=_0x0c2a[_0x1bf51b];return _0x1e6241;};'use strict';var _=require(_0xa0c2('0x0'));var util=require(_0xa0c2('0x1'));var moment=require(_0xa0c2('0x2'));var BPromise=require(_0xa0c2('0x3'));var rs=require(_0xa0c2('0x4'));var fs=require('fs');var Redis=require(_0xa0c2('0x5'));var db=require(_0xa0c2('0x6'))['db'];var utils=require(_0xa0c2('0x7'));var logger=require(_0xa0c2('0x8'))(_0xa0c2('0x9'));var config=require(_0xa0c2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa0c2('0xb')][_0xa0c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39b87e,_0x4a370d,_0x14b7f2){return new BPromise(function(_0x5a8b38,_0x10f530){return client['request'](_0x39b87e,_0x14b7f2)[_0xa0c2('0xd')](function(_0xc83145){logger[_0xa0c2('0xe')](_0xa0c2('0xf'),_0x4a370d,_0xa0c2('0x10'));logger[_0xa0c2('0x11')](_0xa0c2('0x12'),_0x4a370d,'request\x20sent',JSON[_0xa0c2('0x13')](_0xc83145));if(_0xc83145[_0xa0c2('0x14')]){if(_0xc83145[_0xa0c2('0x14')][_0xa0c2('0x15')]===0x1f4){logger[_0xa0c2('0x14')](_0xa0c2('0xf'),_0x4a370d,_0xc83145['error'][_0xa0c2('0x16')]);return _0x10f530(_0xc83145['error'][_0xa0c2('0x16')]);}logger[_0xa0c2('0x14')](_0xa0c2('0xf'),_0x4a370d,_0xc83145[_0xa0c2('0x14')]['message']);return _0x5a8b38(_0xc83145[_0xa0c2('0x14')][_0xa0c2('0x16')]);}else{logger['info'](_0xa0c2('0xf'),_0x4a370d,_0xa0c2('0x10'));_0x5a8b38(_0xc83145[_0xa0c2('0x17')][_0xa0c2('0x16')]);}})[_0xa0c2('0x18')](function(_0x32825a){logger['error'](_0xa0c2('0xf'),_0x4a370d,_0x32825a);_0x10f530(_0x32825a);});});}
\ No newline at end of file
+var _0x616a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','moment','bluebird'];(function(_0x645221,_0x46a986){var _0x2dc8bf=function(_0x56189a){while(--_0x56189a){_0x645221['push'](_0x645221['shift']());}};_0x2dc8bf(++_0x46a986);}(_0x616a,0x185));var _0xa616=function(_0x3b8f4b,_0x3a27c4){_0x3b8f4b=_0x3b8f4b-0x0;var _0x32a3dc=_0x616a[_0x3b8f4b];return _0x32a3dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa616('0x0'));var BPromise=require(_0xa616('0x1'));var rs=require(_0xa616('0x2'));var fs=require('fs');var Redis=require(_0xa616('0x3'));var db=require(_0xa616('0x4'))['db'];var utils=require(_0xa616('0x5'));var logger=require(_0xa616('0x6'))('rpc');var config=require(_0xa616('0x7'));var jayson=require(_0xa616('0x8'));var client=jayson[_0xa616('0x9')][_0xa616('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29e139,_0x269361,_0x1ff88d){return new BPromise(function(_0x3d42d8,_0x575b99){return client[_0xa616('0xb')](_0x29e139,_0x1ff88d)[_0xa616('0xc')](function(_0x407454){logger['info'](_0xa616('0xd'),_0x269361,'request\x20sent');logger[_0xa616('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x269361,_0xa616('0xf'),JSON[_0xa616('0x10')](_0x407454));if(_0x407454['error']){if(_0x407454[_0xa616('0x11')][_0xa616('0x12')]===0x1f4){logger[_0xa616('0x11')](_0xa616('0xd'),_0x269361,_0x407454[_0xa616('0x11')]['message']);return _0x575b99(_0x407454[_0xa616('0x11')][_0xa616('0x13')]);}logger['error'](_0xa616('0xd'),_0x269361,_0x407454[_0xa616('0x11')][_0xa616('0x13')]);return _0x3d42d8(_0x407454[_0xa616('0x11')][_0xa616('0x13')]);}else{logger[_0xa616('0x14')](_0xa616('0xd'),_0x269361,'request\x20sent');_0x3d42d8(_0x407454[_0xa616('0x15')][_0xa616('0x13')]);}})[_0xa616('0x16')](function(_0x1116dd){logger['error'](_0xa616('0xd'),_0x269361,_0x1116dd);_0x575b99(_0x1116dd);});});}
\ No newline at end of file
index b31063f..5fd93e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bbb=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0bbb,0x1c6));var _0xb0bb=function(_0x54db71,_0x43de96){_0x54db71=_0x54db71-0x0;var _0x1104e7=_0x0bbb[_0x54db71];return _0x1104e7;};'use strict';var multer=require(_0xb0bb('0x0'));var util=require(_0xb0bb('0x1'));var path=require(_0xb0bb('0x2'));var timeout=require(_0xb0bb('0x3'));var express=require(_0xb0bb('0x4'));var router=express[_0xb0bb('0x5')]();var fs_extra=require(_0xb0bb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb0bb('0x7'));var config=require(_0xb0bb('0x8'));var controller=require(_0xb0bb('0x9'));router[_0xb0bb('0xa')]('/',auth[_0xb0bb('0xb')](),controller[_0xb0bb('0xc')]);router[_0xb0bb('0xa')](_0xb0bb('0xd'),auth[_0xb0bb('0xb')](),controller[_0xb0bb('0xe')]);router[_0xb0bb('0xa')](_0xb0bb('0xf'),auth[_0xb0bb('0xb')](),controller[_0xb0bb('0x10')]);router['get'](_0xb0bb('0x11'),auth[_0xb0bb('0xb')](),controller[_0xb0bb('0x12')]);router[_0xb0bb('0x13')]('/',auth[_0xb0bb('0xb')](),controller[_0xb0bb('0x14')]);router['post'](_0xb0bb('0xf'),auth[_0xb0bb('0xb')](),controller[_0xb0bb('0x15')]);router[_0xb0bb('0x16')](_0xb0bb('0xd'),auth[_0xb0bb('0xb')](),controller[_0xb0bb('0x17')]);router[_0xb0bb('0x18')](_0xb0bb('0xd'),auth[_0xb0bb('0xb')](),controller['destroy']);module[_0xb0bb('0x19')]=router;
\ No newline at end of file
+var _0xcb2c=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x378161,_0x6177a5){var _0x4b07b1=function(_0x206265){while(--_0x206265){_0x378161['push'](_0x378161['shift']());}};_0x4b07b1(++_0x6177a5);}(_0xcb2c,0x1c9));var _0xccb2=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xcb2c[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require('multer');var util=require(_0xccb2('0x0'));var path=require('path');var timeout=require(_0xccb2('0x1'));var express=require(_0xccb2('0x2'));var router=express[_0xccb2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xccb2('0x4'));var interaction=require(_0xccb2('0x5'));var config=require(_0xccb2('0x6'));var controller=require('./intZohoAccount.controller');router[_0xccb2('0x7')]('/',auth[_0xccb2('0x8')](),controller[_0xccb2('0x9')]);router[_0xccb2('0x7')](_0xccb2('0xa'),auth[_0xccb2('0x8')](),controller[_0xccb2('0xb')]);router[_0xccb2('0x7')](_0xccb2('0xc'),auth[_0xccb2('0x8')](),controller[_0xccb2('0xd')]);router[_0xccb2('0x7')](_0xccb2('0xe'),auth['isAuthenticated'](),controller[_0xccb2('0xf')]);router[_0xccb2('0x10')]('/',auth[_0xccb2('0x8')](),controller['create']);router[_0xccb2('0x10')](_0xccb2('0xc'),auth[_0xccb2('0x8')](),controller[_0xccb2('0x11')]);router[_0xccb2('0x12')](_0xccb2('0xa'),auth['isAuthenticated'](),controller[_0xccb2('0x13')]);router[_0xccb2('0x14')](_0xccb2('0xa'),auth[_0xccb2('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 132430e..6c8c7ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['STRING','exports'];(function(_0x57edd2,_0x39189e){var _0x2e01e4=function(_0x490d37){while(--_0x490d37){_0x57edd2['push'](_0x57edd2['shift']());}};_0x2e01e4(++_0x39189e);}(_0xe5b3,0x133));var _0x3e5b=function(_0x257b75,_0x399298){_0x257b75=_0x257b75-0x0;var _0x4e7c51=_0xe5b3[_0x257b75];return _0x4e7c51;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'name':{'type':Sequelize[_0x3e5b('0x1')]},'description':{'type':Sequelize[_0x3e5b('0x1')]},'host':{'type':Sequelize[_0x3e5b('0x1')]},'zone':{'type':Sequelize[_0x3e5b('0x1')]},'clientId':{'type':Sequelize[_0x3e5b('0x1')]},'clientSecret':{'type':Sequelize[_0x3e5b('0x1')]},'serverUrl':{'type':Sequelize[_0x3e5b('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x3e5b('0x1')]},'refreshToken':{'type':Sequelize[_0x3e5b('0x1')]}};
\ No newline at end of file
+var _0xb43b=['exports','STRING','sequelize'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0xb43b,0x1b2));var _0xbb43=function(_0x410b69,_0x345c40){_0x410b69=_0x410b69-0x0;var _0x50ad01=_0xb43b[_0x410b69];return _0x50ad01;};'use strict';var Sequelize=require(_0xbb43('0x0'));module[_0xbb43('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbb43('0x2')]},'host':{'type':Sequelize[_0xbb43('0x2')]},'zone':{'type':Sequelize[_0xbb43('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xbb43('0x2')]},'serverUrl':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xbb43('0x2')]},'refreshToken':{'type':Sequelize[_0xbb43('0x2')]}};
\ No newline at end of file
index e1df962..ea62007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfae5=['com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','includes','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','findOne','ZohoConfiguration','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','zoho.eu'];(function(_0x23f2b7,_0xe7d5ff){var _0x26dd9b=function(_0x168750){while(--_0x168750){_0x23f2b7['push'](_0x23f2b7['shift']());}};_0x26dd9b(++_0xe7d5ff);}(_0xfae5,0x1a2));var _0x5fae=function(_0x5cf4a8,_0x11e959){_0x5cf4a8=_0x5cf4a8-0x0;var _0x2e64d5=_0xfae5[_0x5cf4a8];return _0x2e64d5;};'use strict';var emlformat=require(_0x5fae('0x0'));var rimraf=require(_0x5fae('0x1'));var zipdir=require(_0x5fae('0x2'));var jsonpatch=require(_0x5fae('0x3'));var rp=require(_0x5fae('0x4'));var moment=require(_0x5fae('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5fae('0x6'));var util=require(_0x5fae('0x7'));var path=require('path');var sox=require(_0x5fae('0x8'));var csv=require(_0x5fae('0x9'));var ejs=require(_0x5fae('0xa'));var fs=require('fs');var fs_extra=require(_0x5fae('0xb'));var _=require(_0x5fae('0xc'));var squel=require(_0x5fae('0xd'));var crypto=require(_0x5fae('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5fae('0xf'));var toCsv=require(_0x5fae('0x9'));var querystring=require('querystring');var Papa=require(_0x5fae('0x10'));var Redis=require('ioredis');var authService=require(_0x5fae('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5fae('0x12'));var hardwareService=require(_0x5fae('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5fae('0x14'));var licenseUtil=require(_0x5fae('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5fae('0x16'));function respondWithStatusCode(_0x2285a7,_0x2fb8da){_0x2fb8da=_0x2fb8da||0xcc;return function(_0x4920b0){if(_0x4920b0){return _0x2285a7[_0x5fae('0x17')](_0x2fb8da);}return _0x2285a7[_0x5fae('0x18')](_0x2fb8da)[_0x5fae('0x19')]();};}function respondWithResult(_0x56381d,_0x684421){_0x684421=_0x684421||0xc8;return function(_0x28dff8){if(_0x28dff8){return _0x56381d[_0x5fae('0x18')](_0x684421)[_0x5fae('0x1a')](_0x28dff8);}};}function respondWithFilteredResult(_0x48777e,_0x3a7608){return function(_0x49c607){if(_0x49c607){var _0x252b5f=typeof _0x3a7608[_0x5fae('0x1b')]===_0x5fae('0x1c')&&typeof _0x3a7608[_0x5fae('0x1d')]===_0x5fae('0x1c');var _0x486ad5=_0x49c607[_0x5fae('0x1e')];var _0x208839=_0x252b5f?0x0:_0x3a7608['offset'];var _0x30e96b=_0x252b5f?_0x49c607[_0x5fae('0x1e')]:_0x3a7608['offset']+_0x3a7608['limit'];var _0x280e28;if(_0x30e96b>=_0x486ad5){_0x30e96b=_0x486ad5;_0x280e28=0xc8;}else{_0x280e28=0xce;}_0x48777e[_0x5fae('0x18')](_0x280e28);return _0x48777e[_0x5fae('0x1f')](_0x5fae('0x20'),_0x208839+'-'+_0x30e96b+'/'+_0x486ad5)[_0x5fae('0x1a')](_0x49c607);}return null;};}function patchUpdates(_0x15aa6d){return function(_0x2d05c3){try{jsonpatch[_0x5fae('0x21')](_0x2d05c3,_0x15aa6d,!![]);}catch(_0x143c1f){return BPromise[_0x5fae('0x22')](_0x143c1f);}return _0x2d05c3['save']();};}function saveUpdates(_0x119a71,_0x38a215){return function(_0x16e595){if(_0x16e595){return _0x16e595['update'](_0x119a71)[_0x5fae('0x23')](function(_0xe04b28){return _0xe04b28;});}return null;};}function removeEntity(_0x49d28b,_0x4c5bb3){return function(_0x18944f){if(_0x18944f){return _0x18944f[_0x5fae('0x24')]()[_0x5fae('0x23')](function(){_0x49d28b[_0x5fae('0x18')](0xcc)[_0x5fae('0x19')]();});}};}function handleEntityNotFound(_0x4ad155,_0x47936c){return function(_0x287ca7){if(!_0x287ca7){_0x4ad155['sendStatus'](0x194);}return _0x287ca7;};}function handleError(_0x5b6697,_0x4a9123){_0x4a9123=_0x4a9123||0x1f4;return function(_0x46479b){logger['error'](_0x46479b[_0x5fae('0x25')]);if(_0x46479b[_0x5fae('0x26')]){delete _0x46479b[_0x5fae('0x26')];}_0x5b6697[_0x5fae('0x18')](_0x4a9123)[_0x5fae('0x27')](_0x46479b);};}exports[_0x5fae('0x28')]=function(_0x4021ba,_0x1f9c66){var _0x13064e={},_0x17f27b={},_0xa39f26={'count':0x0,'rows':[]};var _0x4d396e=_[_0x5fae('0x29')](db[_0x5fae('0x2a')][_0x5fae('0x2b')],function(_0x49ec0e){return{'name':_0x49ec0e[_0x5fae('0x2c')],'type':_0x49ec0e[_0x5fae('0x2d')][_0x5fae('0x2e')]};});_0x17f27b[_0x5fae('0x2f')]=_['map'](_0x4d396e,_0x5fae('0x26'));_0x17f27b[_0x5fae('0x30')]=_[_0x5fae('0x31')](_0x4021ba[_0x5fae('0x30')]);_0x17f27b[_0x5fae('0x32')]=_['intersection'](_0x17f27b[_0x5fae('0x2f')],_0x17f27b[_0x5fae('0x30')]);_0x13064e[_0x5fae('0x33')]=_[_0x5fae('0x34')](_0x17f27b[_0x5fae('0x2f')],qs[_0x5fae('0x35')](_0x4021ba[_0x5fae('0x30')][_0x5fae('0x35')]));_0x13064e[_0x5fae('0x33')]=_0x13064e['attributes'][_0x5fae('0x36')]?_0x13064e[_0x5fae('0x33')]:_0x17f27b[_0x5fae('0x2f')];if(!_0x4021ba[_0x5fae('0x30')][_0x5fae('0x37')](_0x5fae('0x38'))){_0x13064e['limit']=qs[_0x5fae('0x1d')](_0x4021ba[_0x5fae('0x30')]['limit']);_0x13064e[_0x5fae('0x1b')]=qs[_0x5fae('0x1b')](_0x4021ba[_0x5fae('0x30')][_0x5fae('0x1b')]);}_0x13064e['order']=qs[_0x5fae('0x39')](_0x4021ba['query']['sort']);_0x13064e[_0x5fae('0x3a')]=qs[_0x5fae('0x32')](_[_0x5fae('0x3b')](_0x4021ba['query'],_0x17f27b['filters']),_0x4d396e);if(_0x4021ba['query']['filter']){_0x13064e[_0x5fae('0x3a')]=_[_0x5fae('0x3c')](_0x13064e['where'],{'$or':_[_0x5fae('0x29')](_0x4d396e,function(_0xb1d42b){if(_0xb1d42b[_0x5fae('0x2d')]!==_0x5fae('0x3d')){var _0x5ca74b={};_0x5ca74b[_0xb1d42b['name']]={'$like':'%'+_0x4021ba[_0x5fae('0x30')][_0x5fae('0x3e')]+'%'};return _0x5ca74b;}})});}_0x13064e=_['merge']({},_0x13064e,_0x4021ba[_0x5fae('0x3f')]);var _0x2924aa={'where':_0x13064e['where']};return db['ZohoAccount']['count'](_0x2924aa)[_0x5fae('0x23')](function(_0x294b0c){_0xa39f26['count']=_0x294b0c;if(_0x4021ba[_0x5fae('0x30')]['includeAll']){_0x13064e[_0x5fae('0x40')]=[{'all':!![]}];}return db[_0x5fae('0x2a')][_0x5fae('0x41')](_0x13064e);})[_0x5fae('0x23')](function(_0x36166e){_0xa39f26[_0x5fae('0x42')]=_0x36166e;return _0xa39f26;})['then'](respondWithFilteredResult(_0x1f9c66,_0x13064e))[_0x5fae('0x43')](handleError(_0x1f9c66,null));};exports[_0x5fae('0x44')]=function(_0x12bf7b,_0xfb7236){var _0x5f4848={'raw':![],'where':{'id':_0x12bf7b[_0x5fae('0x45')]['id']}},_0x1d8a91={};_0x1d8a91['model']=_['keys'](db[_0x5fae('0x2a')][_0x5fae('0x2b')]);_0x1d8a91[_0x5fae('0x30')]=_[_0x5fae('0x31')](_0x12bf7b[_0x5fae('0x30')]);_0x1d8a91['filters']=_[_0x5fae('0x34')](_0x1d8a91[_0x5fae('0x2f')],_0x1d8a91[_0x5fae('0x30')]);_0x5f4848['attributes']=_[_0x5fae('0x34')](_0x1d8a91[_0x5fae('0x2f')],qs[_0x5fae('0x35')](_0x12bf7b[_0x5fae('0x30')][_0x5fae('0x35')]));_0x5f4848[_0x5fae('0x33')]=_0x5f4848['attributes']['length']?_0x5f4848[_0x5fae('0x33')]:_0x1d8a91[_0x5fae('0x2f')];if(_0x12bf7b['query'][_0x5fae('0x46')]){_0x5f4848[_0x5fae('0x40')]=[{'all':!![]}];}_0x5f4848=_[_0x5fae('0x3c')]({},_0x5f4848,_0x12bf7b[_0x5fae('0x3f')]);return db['ZohoAccount']['find'](_0x5f4848)[_0x5fae('0x23')](handleEntityNotFound(_0xfb7236,null))['then'](respondWithResult(_0xfb7236,null))[_0x5fae('0x43')](handleError(_0xfb7236,null));};exports[_0x5fae('0x47')]=function(_0x4e81fb,_0x14000f){return db[_0x5fae('0x2a')][_0x5fae('0x47')](_0x4e81fb[_0x5fae('0x48')],{})[_0x5fae('0x23')](respondWithResult(_0x14000f,0xc9))[_0x5fae('0x43')](handleError(_0x14000f,null));};exports['update']=function(_0xfb2d09,_0x265a24){if(_0xfb2d09[_0x5fae('0x48')]['id']){delete _0xfb2d09['body']['id'];}return db['ZohoAccount'][_0x5fae('0x49')]({'where':{'id':_0xfb2d09['params']['id']}})[_0x5fae('0x23')](handleEntityNotFound(_0x265a24,null))[_0x5fae('0x23')](saveUpdates(_0xfb2d09[_0x5fae('0x48')],null))[_0x5fae('0x23')](respondWithResult(_0x265a24,null))[_0x5fae('0x43')](handleError(_0x265a24,null));};exports[_0x5fae('0x24')]=function(_0x25e6a1,_0xb8bb8d){return db['ZohoAccount'][_0x5fae('0x49')]({'where':{'id':_0x25e6a1[_0x5fae('0x45')]['id']}})[_0x5fae('0x23')](handleEntityNotFound(_0xb8bb8d,null))[_0x5fae('0x23')](removeEntity(_0xb8bb8d,null))[_0x5fae('0x43')](handleError(_0xb8bb8d,null));};exports['getConfigurations']=function(_0x3e33ec,_0x5a8365,_0x5a704c){var _0x3dee08={};var _0x4bd02e={};var _0x537bbd;var _0x57808f;return db[_0x5fae('0x2a')][_0x5fae('0x4a')]({'where':{'id':_0x3e33ec[_0x5fae('0x45')]['id']}})['then'](handleEntityNotFound(_0x5a8365,null))[_0x5fae('0x23')](function(_0x563946){if(_0x563946){_0x537bbd=_0x563946;_0x4bd02e[_0x5fae('0x2f')]=_[_0x5fae('0x31')](db[_0x5fae('0x4b')]['rawAttributes']);_0x4bd02e[_0x5fae('0x30')]=_[_0x5fae('0x31')](_0x3e33ec[_0x5fae('0x30')]);_0x4bd02e[_0x5fae('0x32')]=_['intersection'](_0x4bd02e[_0x5fae('0x2f')],_0x4bd02e[_0x5fae('0x30')]);_0x3dee08[_0x5fae('0x33')]=_[_0x5fae('0x34')](_0x4bd02e[_0x5fae('0x2f')],qs[_0x5fae('0x35')](_0x3e33ec[_0x5fae('0x30')][_0x5fae('0x35')]));_0x3dee08[_0x5fae('0x33')]=_0x3dee08['attributes']['length']?_0x3dee08[_0x5fae('0x33')]:_0x4bd02e[_0x5fae('0x2f')];_0x3dee08[_0x5fae('0x4c')]=qs['sort'](_0x3e33ec[_0x5fae('0x30')][_0x5fae('0x39')]);_0x3dee08['where']=qs['filters'](_['pick'](_0x3e33ec[_0x5fae('0x30')],_0x4bd02e[_0x5fae('0x32')]));if(_0x3e33ec[_0x5fae('0x30')][_0x5fae('0x3e')]){_0x3dee08['where']=_[_0x5fae('0x3c')](_0x3dee08['where'],{'$or':_[_0x5fae('0x29')](_0x3dee08[_0x5fae('0x33')],function(_0x322e53){var _0x15b749={};_0x15b749[_0x322e53]={'$like':'%'+_0x3e33ec[_0x5fae('0x30')][_0x5fae('0x3e')]+'%'};return _0x15b749;})});}_0x3dee08=_['merge']({},_0x3dee08,_0x3e33ec[_0x5fae('0x3f')]);return _0x537bbd[_0x5fae('0x4d')](_0x3dee08);}})[_0x5fae('0x23')](function(_0x3c30d4){if(_0x3c30d4){_0x57808f=_0x3c30d4['length'];if(!_0x3e33ec[_0x5fae('0x30')][_0x5fae('0x37')](_0x5fae('0x38'))){_0x3dee08[_0x5fae('0x1d')]=qs[_0x5fae('0x1d')](_0x3e33ec[_0x5fae('0x30')][_0x5fae('0x1d')]);_0x3dee08[_0x5fae('0x1b')]=qs['offset'](_0x3e33ec[_0x5fae('0x30')][_0x5fae('0x1b')]);}return _0x537bbd[_0x5fae('0x4d')](_0x3dee08);}})['then'](function(_0x56ec13){if(_0x56ec13){return _0x56ec13?{'count':_0x57808f,'rows':_0x56ec13}:null;}})[_0x5fae('0x23')](respondWithResult(_0x5a8365,null))[_0x5fae('0x43')](handleError(_0x5a8365,null));};exports[_0x5fae('0x4e')]=function(_0x4fe13f,_0x36545a,_0xd30c7){if(_0x4fe13f[_0x5fae('0x48')]['id']){delete _0x4fe13f[_0x5fae('0x48')]['id'];}return db[_0x5fae('0x2a')][_0x5fae('0x4a')]({'where':{'id':_0x4fe13f[_0x5fae('0x45')]['id']}})[_0x5fae('0x23')](handleEntityNotFound(_0x36545a,null))[_0x5fae('0x23')](function(_0x430613){if(_0x430613){_0x4fe13f['body'][_0x5fae('0x4f')]=_0x430613['id'];_0x4fe13f['body'][_0x5fae('0x50')]=integrations[_0x5fae('0x51')](_0x4fe13f[_0x5fae('0x48')]['channel'],_0x4fe13f[_0x5fae('0x48')][_0x5fae('0x2d')]);_0x4fe13f[_0x5fae('0x48')][_0x5fae('0x52')]=integrations['getDescriptions'](_0x4fe13f['body'][_0x5fae('0x53')],_0x4fe13f[_0x5fae('0x48')]['type']);return db[_0x5fae('0x4b')][_0x5fae('0x47')](_0x4fe13f['body'],{'include':[{'model':db[_0x5fae('0x54')],'as':_0x5fae('0x50')},{'model':db['ZohoField'],'as':_0x5fae('0x52')}]});}return null;})['then'](respondWithResult(_0x36545a,null))[_0x5fae('0x43')](handleError(_0x36545a,null));};function getAccessToken(_0x3db857){return new Promise(function(_0x225fa6,_0x2ad09e){var _0x4cfb21;switch(_0x3db857[_0x5fae('0x55')]){case'US':_0x4cfb21=_0x5fae('0x56');break;case'AU':_0x4cfb21=_0x5fae('0x57');break;case'EU':_0x4cfb21=_0x5fae('0x58');break;case'IN':_0x4cfb21=_0x5fae('0x59');break;case'CN':_0x4cfb21=_0x5fae('0x5a');break;default:_0x4cfb21=_0x5fae('0x58');break;}var _0xd68916={'method':'POST','uri':_0x4cfb21+_0x5fae('0x5b'),'qs':{'refresh_token':_0x3db857[_0x5fae('0x5c')],'client_id':_0x3db857['clientId'],'client_secret':_0x3db857[_0x5fae('0x5d')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xd68916)['then'](function(_0x38488b){if(_0x38488b['access_token']){_0x225fa6(_0x38488b[_0x5fae('0x5e')]);}else{_0x2ad09e(_0x5fae('0x5f'));}})[_0x5fae('0x43')](function(_0x349b90){_0x2ad09e(_0x349b90);});});}exports[_0x5fae('0x60')]=function(_0x53bf5c,_0x37c505,_0x4902b4){var _0x122426,_0x248081,_0x5f5cf2,_0x13f998,_0x5eef1a;return db[_0x5fae('0x2a')][_0x5fae('0x4a')]({'where':{'id':_0x53bf5c[_0x5fae('0x45')]['id']},'attributes':['id',_0x5fae('0x61'),_0x5fae('0x55'),_0x5fae('0x62'),_0x5fae('0x5d'),_0x5fae('0x63'),_0x5fae('0x64'),_0x5fae('0x5c')]})[_0x5fae('0x23')](handleEntityNotFound(_0x37c505,null))[_0x5fae('0x23')](function(_0x5329fc){_0x5eef1a=_0x5329fc;_0x122426=_0x5eef1a[_0x5fae('0x61')];_0x248081=_0x122426===_0x5fae('0x65')?'eu':_0x5fae('0x66');_0x5f5cf2=_0x5eef1a[_0x5fae('0x63')];var _0x1707f4=_0x5f5cf2[_0x5fae('0x67')](-0x1);if(_0x1707f4==='/'||_0x1707f4==='\x5c'||_0x1707f4===':'){_0x5f5cf2=_0x5f5cf2[_0x5fae('0x68')](0x0,_0x5f5cf2['lastIndexOf'](_0x1707f4));}if(!_0x5eef1a[_0x5fae('0x5c')]){throw new Error(_0x5fae('0x69'));}return getAccessToken(_0x5eef1a);})[_0x5fae('0x23')](function(_0x2a29c2){if(_0x2a29c2){return rp({'method':'GET','uri':util[_0x5fae('0x6a')](_0x5fae('0x6b'),_0x248081),'qs':{'module':_0x5fae('0x6c')},'headers':{'Authorization':_0x5fae('0x6d')+_0x2a29c2},'json':!![]});}})[_0x5fae('0x23')](function(_0x72b2fe){if(_0x72b2fe){if(_0x72b2fe['response']&&_0x72b2fe[_0x5fae('0x6e')]['error']){throw new Error(_0x72b2fe[_0x5fae('0x6e')][_0x5fae('0x6f')][_0x5fae('0x70')]);}var _0x323fa6=[];var _0x28c0cf=[];var _0x3d93f6=['Owner',_0x5fae('0x71'),_0x5fae('0x72'),_0x5fae('0x73'),'Call_Duration',_0x5fae('0x74'),_0x5fae('0x75'),_0x5fae('0x76')];_0x28c0cf=_['remove'](_0x72b2fe[_0x5fae('0x35')],function(_0x39a7cc){return _0x3d93f6[_0x5fae('0x77')](_0x39a7cc['api_name']);});for(var _0x26e6cb=0x0;_0x26e6cb<_0x28c0cf[_0x5fae('0x36')];_0x26e6cb++){if(_0x28c0cf[_0x26e6cb][_0x5fae('0x78')]===![]){_0x323fa6[_0x5fae('0x79')]({'id':_0x28c0cf[_0x26e6cb]['id'],'name':_0x28c0cf[_0x26e6cb]['display_label'],'custom':_0x28c0cf[_0x26e6cb][_0x5fae('0x7a')],'options':_0x28c0cf[_0x26e6cb][_0x5fae('0x7b')]===_0x5fae('0x7c')&&_0x28c0cf[_0x26e6cb][_0x5fae('0x7d')]['length']>-0x1?_[_0x5fae('0x29')](_0x28c0cf[_0x26e6cb][_0x5fae('0x7d')],function(_0x2304d8){return{'name':_0x2304d8,'value':_0x2304d8};}):[]});}}return{'count':_0x323fa6[_0x5fae('0x36')],'rows':_0x323fa6};}else{return{'count':0x0,'rows':[]};}})[_0x5fae('0x23')](respondWithResult(_0x37c505,null))[_0x5fae('0x43')](function(_0x21fc83){var _0x84e8f0=_0x53bf5c[_0x5fae('0x30')][_0x5fae('0x7e')]?0x1f4:_0x21fc83['statusCode']||0x1f4;logger[_0x5fae('0x6f')]('getFields,\x20%s,\x20%s,\x20%s',_0x5fae('0x60'),_0x84e8f0,JSON[_0x5fae('0x7f')](_0x21fc83));delete _0x21fc83['name'];if(_0x84e8f0===0x191){_0x84e8f0=0x190;}_0x37c505[_0x5fae('0x18')](_0x84e8f0)['send'](_0x53bf5c[_0x5fae('0x30')]['test']?{'message':_0x5fae('0x80'),'statusCode':_0x21fc83[_0x5fae('0x81')]}:_0x21fc83);});};
\ No newline at end of file
+var _0xae1b=['serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','eml-format','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','error','name','send','index','ZohoAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','map','VIRTUAL','merge','options','findAll','rows','catch','params','rawAttributes','include','find','create','body','getConfigurations','ZohoConfiguration','pick','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId'];(function(_0x4c547a,_0x3df782){var _0x39be85=function(_0x35bc3d){while(--_0x35bc3d){_0x4c547a['push'](_0x4c547a['shift']());}};_0x39be85(++_0x3df782);}(_0xae1b,0x11d));var _0xbae1=function(_0x1d43b4,_0x3d9124){_0x1d43b4=_0x1d43b4-0x0;var _0x49cc8e=_0xae1b[_0x1d43b4];return _0x49cc8e;};'use strict';var emlformat=require(_0xbae1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbae1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbae1('0x2'));var moment=require(_0xbae1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbae1('0x4'));var sox=require(_0xbae1('0x5'));var csv=require(_0xbae1('0x6'));var ejs=require(_0xbae1('0x7'));var fs=require('fs');var fs_extra=require(_0xbae1('0x8'));var _=require(_0xbae1('0x9'));var squel=require(_0xbae1('0xa'));var crypto=require(_0xbae1('0xb'));var jsforce=require(_0xbae1('0xc'));var deskjs=require(_0xbae1('0xd'));var toCsv=require(_0xbae1('0x6'));var querystring=require(_0xbae1('0xe'));var Papa=require(_0xbae1('0xf'));var Redis=require('ioredis');var authService=require(_0xbae1('0x10'));var qs=require(_0xbae1('0x11'));var as=require(_0xbae1('0x12'));var hardwareService=require(_0xbae1('0x13'));var logger=require(_0xbae1('0x14'))('api');var utils=require(_0xbae1('0x15'));var config=require(_0xbae1('0x16'));var licenseUtil=require(_0xbae1('0x17'));var db=require(_0xbae1('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x210f75,_0x530570){_0x530570=_0x530570||0xcc;return function(_0x4c3f0f){if(_0x4c3f0f){return _0x210f75[_0xbae1('0x19')](_0x530570);}return _0x210f75['status'](_0x530570)[_0xbae1('0x1a')]();};}function respondWithResult(_0x4afab4,_0x17e990){_0x17e990=_0x17e990||0xc8;return function(_0x2a2198){if(_0x2a2198){return _0x4afab4[_0xbae1('0x1b')](_0x17e990)['json'](_0x2a2198);}};}function respondWithFilteredResult(_0x5bc9b9,_0x435206){return function(_0x5a76b7){if(_0x5a76b7){var _0x205fd8=typeof _0x435206[_0xbae1('0x1c')]===_0xbae1('0x1d')&&typeof _0x435206[_0xbae1('0x1e')]===_0xbae1('0x1d');var _0x5a57c9=_0x5a76b7[_0xbae1('0x1f')];var _0x1f9aba=_0x205fd8?0x0:_0x435206[_0xbae1('0x1c')];var _0x50f7ae=_0x205fd8?_0x5a76b7[_0xbae1('0x1f')]:_0x435206[_0xbae1('0x1c')]+_0x435206[_0xbae1('0x1e')];var _0x2e292f;if(_0x50f7ae>=_0x5a57c9){_0x50f7ae=_0x5a57c9;_0x2e292f=0xc8;}else{_0x2e292f=0xce;}_0x5bc9b9[_0xbae1('0x1b')](_0x2e292f);return _0x5bc9b9[_0xbae1('0x20')]('Content-Range',_0x1f9aba+'-'+_0x50f7ae+'/'+_0x5a57c9)[_0xbae1('0x21')](_0x5a76b7);}return null;};}function patchUpdates(_0x3be15e){return function(_0x24bf67){try{jsonpatch[_0xbae1('0x22')](_0x24bf67,_0x3be15e,!![]);}catch(_0x282355){return BPromise[_0xbae1('0x23')](_0x282355);}return _0x24bf67['save']();};}function saveUpdates(_0x557015,_0x54d0bf){return function(_0x3d9d12){if(_0x3d9d12){return _0x3d9d12[_0xbae1('0x24')](_0x557015)[_0xbae1('0x25')](function(_0x15ab5b){return _0x15ab5b;});}return null;};}function removeEntity(_0x27eb06,_0x15860a){return function(_0x3e9551){if(_0x3e9551){return _0x3e9551[_0xbae1('0x26')]()[_0xbae1('0x25')](function(){_0x27eb06[_0xbae1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x720717,_0x927a6b){return function(_0x1a55d1){if(!_0x1a55d1){_0x720717[_0xbae1('0x19')](0x194);}return _0x1a55d1;};}function handleError(_0x20fb99,_0x1a24d4){_0x1a24d4=_0x1a24d4||0x1f4;return function(_0x3f7a2f){logger[_0xbae1('0x27')](_0x3f7a2f['stack']);if(_0x3f7a2f[_0xbae1('0x28')]){delete _0x3f7a2f[_0xbae1('0x28')];}_0x20fb99['status'](_0x1a24d4)[_0xbae1('0x29')](_0x3f7a2f);};}exports[_0xbae1('0x2a')]=function(_0x1a0a7b,_0x559645){var _0x59ea57={},_0x1c16b3={},_0x130c1f={'count':0x0,'rows':[]};var _0x50ab84=_['map'](db[_0xbae1('0x2b')]['rawAttributes'],function(_0x5ca0d7){return{'name':_0x5ca0d7[_0xbae1('0x2c')],'type':_0x5ca0d7[_0xbae1('0x2d')][_0xbae1('0x2e')]};});_0x1c16b3[_0xbae1('0x2f')]=_['map'](_0x50ab84,'name');_0x1c16b3['query']=_[_0xbae1('0x30')](_0x1a0a7b[_0xbae1('0x31')]);_0x1c16b3[_0xbae1('0x32')]=_[_0xbae1('0x33')](_0x1c16b3[_0xbae1('0x2f')],_0x1c16b3[_0xbae1('0x31')]);_0x59ea57[_0xbae1('0x34')]=_['intersection'](_0x1c16b3[_0xbae1('0x2f')],qs[_0xbae1('0x35')](_0x1a0a7b[_0xbae1('0x31')]['fields']));_0x59ea57[_0xbae1('0x34')]=_0x59ea57[_0xbae1('0x34')][_0xbae1('0x36')]?_0x59ea57[_0xbae1('0x34')]:_0x1c16b3[_0xbae1('0x2f')];if(!_0x1a0a7b[_0xbae1('0x31')][_0xbae1('0x37')]('nolimit')){_0x59ea57[_0xbae1('0x1e')]=qs[_0xbae1('0x1e')](_0x1a0a7b['query'][_0xbae1('0x1e')]);_0x59ea57[_0xbae1('0x1c')]=qs['offset'](_0x1a0a7b['query']['offset']);}_0x59ea57[_0xbae1('0x38')]=qs['sort'](_0x1a0a7b[_0xbae1('0x31')][_0xbae1('0x39')]);_0x59ea57[_0xbae1('0x3a')]=qs[_0xbae1('0x32')](_['pick'](_0x1a0a7b[_0xbae1('0x31')],_0x1c16b3[_0xbae1('0x32')]),_0x50ab84);if(_0x1a0a7b[_0xbae1('0x31')][_0xbae1('0x3b')]){_0x59ea57[_0xbae1('0x3a')]=_['merge'](_0x59ea57[_0xbae1('0x3a')],{'$or':_[_0xbae1('0x3c')](_0x50ab84,function(_0x3c9923){if(_0x3c9923[_0xbae1('0x2d')]!==_0xbae1('0x3d')){var _0x1ac29f={};_0x1ac29f[_0x3c9923[_0xbae1('0x28')]]={'$like':'%'+_0x1a0a7b[_0xbae1('0x31')][_0xbae1('0x3b')]+'%'};return _0x1ac29f;}})});}_0x59ea57=_[_0xbae1('0x3e')]({},_0x59ea57,_0x1a0a7b[_0xbae1('0x3f')]);var _0x55e76c={'where':_0x59ea57['where']};return db[_0xbae1('0x2b')]['count'](_0x55e76c)[_0xbae1('0x25')](function(_0x2aba99){_0x130c1f[_0xbae1('0x1f')]=_0x2aba99;if(_0x1a0a7b['query']['includeAll']){_0x59ea57['include']=[{'all':!![]}];}return db[_0xbae1('0x2b')][_0xbae1('0x40')](_0x59ea57);})[_0xbae1('0x25')](function(_0x1a6c77){_0x130c1f[_0xbae1('0x41')]=_0x1a6c77;return _0x130c1f;})[_0xbae1('0x25')](respondWithFilteredResult(_0x559645,_0x59ea57))[_0xbae1('0x42')](handleError(_0x559645,null));};exports['show']=function(_0x3645d9,_0x3d7e2a){var _0x4f29ab={'raw':![],'where':{'id':_0x3645d9[_0xbae1('0x43')]['id']}},_0x1fccbd={};_0x1fccbd[_0xbae1('0x2f')]=_[_0xbae1('0x30')](db[_0xbae1('0x2b')][_0xbae1('0x44')]);_0x1fccbd[_0xbae1('0x31')]=_[_0xbae1('0x30')](_0x3645d9[_0xbae1('0x31')]);_0x1fccbd['filters']=_[_0xbae1('0x33')](_0x1fccbd[_0xbae1('0x2f')],_0x1fccbd[_0xbae1('0x31')]);_0x4f29ab[_0xbae1('0x34')]=_['intersection'](_0x1fccbd[_0xbae1('0x2f')],qs[_0xbae1('0x35')](_0x3645d9[_0xbae1('0x31')]['fields']));_0x4f29ab[_0xbae1('0x34')]=_0x4f29ab[_0xbae1('0x34')][_0xbae1('0x36')]?_0x4f29ab['attributes']:_0x1fccbd[_0xbae1('0x2f')];if(_0x3645d9['query']['includeAll']){_0x4f29ab[_0xbae1('0x45')]=[{'all':!![]}];}_0x4f29ab=_[_0xbae1('0x3e')]({},_0x4f29ab,_0x3645d9[_0xbae1('0x3f')]);return db[_0xbae1('0x2b')][_0xbae1('0x46')](_0x4f29ab)[_0xbae1('0x25')](handleEntityNotFound(_0x3d7e2a,null))[_0xbae1('0x25')](respondWithResult(_0x3d7e2a,null))[_0xbae1('0x42')](handleError(_0x3d7e2a,null));};exports[_0xbae1('0x47')]=function(_0x526c8c,_0x16951c){return db['ZohoAccount']['create'](_0x526c8c[_0xbae1('0x48')],{})[_0xbae1('0x25')](respondWithResult(_0x16951c,0xc9))[_0xbae1('0x42')](handleError(_0x16951c,null));};exports[_0xbae1('0x24')]=function(_0x460a9f,_0x1fe75d){if(_0x460a9f['body']['id']){delete _0x460a9f['body']['id'];}return db[_0xbae1('0x2b')][_0xbae1('0x46')]({'where':{'id':_0x460a9f[_0xbae1('0x43')]['id']}})[_0xbae1('0x25')](handleEntityNotFound(_0x1fe75d,null))[_0xbae1('0x25')](saveUpdates(_0x460a9f['body'],null))[_0xbae1('0x25')](respondWithResult(_0x1fe75d,null))['catch'](handleError(_0x1fe75d,null));};exports[_0xbae1('0x26')]=function(_0x260793,_0x535471){return db['ZohoAccount']['find']({'where':{'id':_0x260793[_0xbae1('0x43')]['id']}})[_0xbae1('0x25')](handleEntityNotFound(_0x535471,null))[_0xbae1('0x25')](removeEntity(_0x535471,null))['catch'](handleError(_0x535471,null));};exports[_0xbae1('0x49')]=function(_0x11bf2d,_0x32665f,_0x309c20){var _0x1b7a7d={};var _0x3b9b9b={};var _0x5bf0cf;var _0x53d4f3;return db['ZohoAccount']['findOne']({'where':{'id':_0x11bf2d[_0xbae1('0x43')]['id']}})['then'](handleEntityNotFound(_0x32665f,null))[_0xbae1('0x25')](function(_0x808caf){if(_0x808caf){_0x5bf0cf=_0x808caf;_0x3b9b9b[_0xbae1('0x2f')]=_['keys'](db[_0xbae1('0x4a')][_0xbae1('0x44')]);_0x3b9b9b[_0xbae1('0x31')]=_['keys'](_0x11bf2d[_0xbae1('0x31')]);_0x3b9b9b[_0xbae1('0x32')]=_[_0xbae1('0x33')](_0x3b9b9b[_0xbae1('0x2f')],_0x3b9b9b[_0xbae1('0x31')]);_0x1b7a7d[_0xbae1('0x34')]=_[_0xbae1('0x33')](_0x3b9b9b[_0xbae1('0x2f')],qs[_0xbae1('0x35')](_0x11bf2d[_0xbae1('0x31')][_0xbae1('0x35')]));_0x1b7a7d[_0xbae1('0x34')]=_0x1b7a7d['attributes'][_0xbae1('0x36')]?_0x1b7a7d['attributes']:_0x3b9b9b[_0xbae1('0x2f')];_0x1b7a7d['order']=qs[_0xbae1('0x39')](_0x11bf2d[_0xbae1('0x31')][_0xbae1('0x39')]);_0x1b7a7d['where']=qs[_0xbae1('0x32')](_[_0xbae1('0x4b')](_0x11bf2d[_0xbae1('0x31')],_0x3b9b9b[_0xbae1('0x32')]));if(_0x11bf2d[_0xbae1('0x31')][_0xbae1('0x3b')]){_0x1b7a7d[_0xbae1('0x3a')]=_[_0xbae1('0x3e')](_0x1b7a7d[_0xbae1('0x3a')],{'$or':_[_0xbae1('0x3c')](_0x1b7a7d[_0xbae1('0x34')],function(_0x1b21b0){var _0x5e719b={};_0x5e719b[_0x1b21b0]={'$like':'%'+_0x11bf2d[_0xbae1('0x31')]['filter']+'%'};return _0x5e719b;})});}_0x1b7a7d=_['merge']({},_0x1b7a7d,_0x11bf2d[_0xbae1('0x3f')]);return _0x5bf0cf[_0xbae1('0x49')](_0x1b7a7d);}})[_0xbae1('0x25')](function(_0x3526b2){if(_0x3526b2){_0x53d4f3=_0x3526b2['length'];if(!_0x11bf2d[_0xbae1('0x31')]['hasOwnProperty'](_0xbae1('0x4c'))){_0x1b7a7d[_0xbae1('0x1e')]=qs[_0xbae1('0x1e')](_0x11bf2d[_0xbae1('0x31')]['limit']);_0x1b7a7d[_0xbae1('0x1c')]=qs[_0xbae1('0x1c')](_0x11bf2d[_0xbae1('0x31')][_0xbae1('0x1c')]);}return _0x5bf0cf[_0xbae1('0x49')](_0x1b7a7d);}})[_0xbae1('0x25')](function(_0x3257d8){if(_0x3257d8){return _0x3257d8?{'count':_0x53d4f3,'rows':_0x3257d8}:null;}})[_0xbae1('0x25')](respondWithResult(_0x32665f,null))[_0xbae1('0x42')](handleError(_0x32665f,null));};exports[_0xbae1('0x4d')]=function(_0x26a207,_0x33149e,_0x4f4527){if(_0x26a207['body']['id']){delete _0x26a207[_0xbae1('0x48')]['id'];}return db[_0xbae1('0x2b')][_0xbae1('0x4e')]({'where':{'id':_0x26a207[_0xbae1('0x43')]['id']}})['then'](handleEntityNotFound(_0x33149e,null))[_0xbae1('0x25')](function(_0x38ada7){if(_0x38ada7){_0x26a207[_0xbae1('0x48')][_0xbae1('0x4f')]=_0x38ada7['id'];_0x26a207[_0xbae1('0x48')][_0xbae1('0x50')]=integrations[_0xbae1('0x51')](_0x26a207[_0xbae1('0x48')]['channel'],_0x26a207[_0xbae1('0x48')]['type']);_0x26a207[_0xbae1('0x48')][_0xbae1('0x52')]=integrations[_0xbae1('0x53')](_0x26a207[_0xbae1('0x48')]['channel'],_0x26a207[_0xbae1('0x48')]['type']);return db['ZohoConfiguration'][_0xbae1('0x47')](_0x26a207[_0xbae1('0x48')],{'include':[{'model':db['ZohoField'],'as':_0xbae1('0x50')},{'model':db['ZohoField'],'as':_0xbae1('0x52')}]});}return null;})[_0xbae1('0x25')](respondWithResult(_0x33149e,null))['catch'](handleError(_0x33149e,null));};function getAccessToken(_0x147350){return new Promise(function(_0x25cf62,_0x485284){var _0x1e3e56;switch(_0x147350['zone']){case'US':_0x1e3e56=_0xbae1('0x54');break;case'AU':_0x1e3e56='https://accounts.zoho.com.au';break;case'EU':_0x1e3e56=_0xbae1('0x55');break;case'IN':_0x1e3e56=_0xbae1('0x56');break;case'CN':_0x1e3e56='https://accounts.zoho.com.cn';break;default:_0x1e3e56='https://accounts.zoho.eu';break;}var _0x26bd78={'method':_0xbae1('0x57'),'uri':_0x1e3e56+_0xbae1('0x58'),'qs':{'refresh_token':_0x147350[_0xbae1('0x59')],'client_id':_0x147350['clientId'],'client_secret':_0x147350[_0xbae1('0x5a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x26bd78)[_0xbae1('0x25')](function(_0x5019af){if(_0x5019af[_0xbae1('0x5b')]){_0x25cf62(_0x5019af['access_token']);}else{_0x485284(_0xbae1('0x5c'));}})[_0xbae1('0x42')](function(_0x5253c2){_0x485284(_0x5253c2);});});}exports[_0xbae1('0x5d')]=function(_0x422670,_0x10b30a,_0x30c276){var _0x2cae1c,_0x249795,_0x2c7c21,_0x56f79f,_0xc2b8a;return db[_0xbae1('0x2b')][_0xbae1('0x4e')]({'where':{'id':_0x422670[_0xbae1('0x43')]['id']},'attributes':['id',_0xbae1('0x5e'),'zone',_0xbae1('0x5f'),_0xbae1('0x5a'),_0xbae1('0x60'),_0xbae1('0x61'),'refreshToken']})['then'](handleEntityNotFound(_0x10b30a,null))[_0xbae1('0x25')](function(_0x42cc88){_0xc2b8a=_0x42cc88;_0x2cae1c=_0xc2b8a[_0xbae1('0x5e')];_0x249795=_0x2cae1c===_0xbae1('0x62')?'eu':_0xbae1('0x63');_0x2c7c21=_0xc2b8a[_0xbae1('0x60')];var _0x8e2765=_0x2c7c21[_0xbae1('0x64')](-0x1);if(_0x8e2765==='/'||_0x8e2765==='\x5c'||_0x8e2765===':'){_0x2c7c21=_0x2c7c21[_0xbae1('0x65')](0x0,_0x2c7c21[_0xbae1('0x66')](_0x8e2765));}if(!_0xc2b8a[_0xbae1('0x59')]){throw new Error(_0xbae1('0x67'));}return getAccessToken(_0xc2b8a);})[_0xbae1('0x25')](function(_0x4032dd){if(_0x4032dd){return rp({'method':_0xbae1('0x68'),'uri':util[_0xbae1('0x69')](_0xbae1('0x6a'),_0x249795),'qs':{'module':_0xbae1('0x6b')},'headers':{'Authorization':_0xbae1('0x6c')+_0x4032dd},'json':!![]});}})[_0xbae1('0x25')](function(_0x431c41){if(_0x431c41){if(_0x431c41[_0xbae1('0x6d')]&&_0x431c41[_0xbae1('0x6d')][_0xbae1('0x27')]){throw new Error(_0x431c41[_0xbae1('0x6d')][_0xbae1('0x27')][_0xbae1('0x6e')]);}var _0x3e24d5=[];var _0x1283e0=[];var _0x9a1dd6=[_0xbae1('0x6f'),_0xbae1('0x70'),_0xbae1('0x71'),_0xbae1('0x72'),_0xbae1('0x73'),'Call_Result',_0xbae1('0x74'),_0xbae1('0x75')];_0x1283e0=_[_0xbae1('0x76')](_0x431c41[_0xbae1('0x35')],function(_0x5d83eb){return _0x9a1dd6['includes'](_0x5d83eb['api_name']);});for(var _0x5ce9da=0x0;_0x5ce9da<_0x1283e0[_0xbae1('0x36')];_0x5ce9da++){if(_0x1283e0[_0x5ce9da]['system_mandatory']===![]){_0x3e24d5[_0xbae1('0x77')]({'id':_0x1283e0[_0x5ce9da]['id'],'name':_0x1283e0[_0x5ce9da][_0xbae1('0x78')],'custom':_0x1283e0[_0x5ce9da][_0xbae1('0x79')],'options':_0x1283e0[_0x5ce9da][_0xbae1('0x7a')]===_0xbae1('0x7b')&&_0x1283e0[_0x5ce9da][_0xbae1('0x7c')][_0xbae1('0x36')]>-0x1?_[_0xbae1('0x3c')](_0x1283e0[_0x5ce9da][_0xbae1('0x7c')],function(_0x48fe92){return{'name':_0x48fe92,'value':_0x48fe92};}):[]});}}return{'count':_0x3e24d5[_0xbae1('0x36')],'rows':_0x3e24d5};}else{return{'count':0x0,'rows':[]};}})[_0xbae1('0x25')](respondWithResult(_0x10b30a,null))[_0xbae1('0x42')](function(_0x259ef4){var _0x562d6f=_0x422670[_0xbae1('0x31')][_0xbae1('0x7d')]?0x1f4:_0x259ef4[_0xbae1('0x7e')]||0x1f4;logger[_0xbae1('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xbae1('0x5d'),_0x562d6f,JSON['stringify'](_0x259ef4));delete _0x259ef4['name'];if(_0x562d6f===0x191){_0x562d6f=0x190;}_0x10b30a[_0xbae1('0x1b')](_0x562d6f)[_0xbae1('0x29')](_0x422670[_0xbae1('0x31')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x259ef4[_0xbae1('0x7e')]}:_0x259ef4);});};
\ No newline at end of file
index 692f13f..a0a8f14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6c8=['https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','refresh_token','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','host','https://accounts.zoho.eu','parse','info','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe6c8,0xc1));var _0x8e6c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe6c8[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x8e6c('0x0'));var logger=require(_0x8e6c('0x1'))(_0x8e6c('0x2'));var moment=require(_0x8e6c('0x3'));var BPromise=require('bluebird');var rp=require(_0x8e6c('0x4'));var fs=require('fs');var path=require(_0x8e6c('0x5'));var rimraf=require(_0x8e6c('0x6'));var config=require(_0x8e6c('0x7'));var attributes=require(_0x8e6c('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8e6c('0x9')]=function(_0x161c8b,_0x114a38){return _0x161c8b[_0x8e6c('0xa')]('ZohoAccount',attributes,{'tableName':_0x8e6c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xa74a7f,_0x40cbf5,_0x233aed){if(_0xa74a7f[_0x8e6c('0xc')](_0x8e6c('0xd'))||_0xa74a7f['changed'](_0x8e6c('0xe'))||_0xa74a7f[_0x8e6c('0xc')]('clientId')||_0xa74a7f[_0x8e6c('0xc')](_0x8e6c('0xf'))||_0xa74a7f[_0x8e6c('0xc')](_0x8e6c('0x10'))||_0xa74a7f[_0x8e6c('0xc')]('host')){var _0x1f5a8f,_0xec6e43;_0x1f5a8f=_0xa74a7f[_0x8e6c('0xe')];var _0x136973=_0x1f5a8f[_0x8e6c('0x11')](-0x1);if(_0x136973==='/'||_0x136973==='\x5c'||_0x136973===':'){_0x1f5a8f=_0x1f5a8f[_0x8e6c('0x12')](0x0,_0x1f5a8f[_0x8e6c('0x13')](_0x136973));}switch(_0xa74a7f[_0x8e6c('0xd')]){case'US':_0xec6e43=_0x8e6c('0x14');break;case'AU':_0xec6e43=_0x8e6c('0x15');break;case'IN':_0xec6e43=_0x8e6c('0x16');break;case'CN':_0xec6e43=_0x8e6c('0x17');break;default:_0xec6e43='https://accounts.zoho.eu';break;}var _0x236b06={'method':_0x8e6c('0x18'),'uri':_0xec6e43+_0x8e6c('0x19'),'form':{'grant_type':_0x8e6c('0x1a'),'client_id':_0xa74a7f[_0x8e6c('0x1b')],'client_secret':_0xa74a7f[_0x8e6c('0xf')],'redirect_uri':_0xa74a7f[_0x8e6c('0xe')],'code':_0xa74a7f[_0x8e6c('0x10')]},'headers':{'Content-Type':_0x8e6c('0x1c')}};return rp(_0x236b06)[_0x8e6c('0x1d')](function(_0xb3bcad){var _0x1b4326=JSON['parse'](_0xb3bcad);if(_0x1b4326[_0x8e6c('0x1e')]){_0xa74a7f[_0x8e6c('0x1f')]=_0x1b4326['refresh_token'];logger['info'](util['format'](_0x8e6c('0x20'),_0xa74a7f[_0x8e6c('0x21')],_0xa74a7f['id']));}else{logger['error'](util[_0x8e6c('0x22')](_0x8e6c('0x23'),_0xa74a7f['name'],_0xa74a7f['id']),util[_0x8e6c('0x24')](_0x1b4326,{'showHidden':![],'depth':null}));}return _0x233aed(null,_0x40cbf5);})[_0x8e6c('0x25')](function(_0x55c925){logger[_0x8e6c('0x26')](util[_0x8e6c('0x22')](_0x8e6c('0x23'),_0xa74a7f['name'],_0xa74a7f['id']),util[_0x8e6c('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x233aed(_0x55c925);});}else{return _0x233aed(null,_0x40cbf5);}},'beforeUpdate':function(_0x4544e7,_0x138745,_0x284226){if(_0x4544e7[_0x8e6c('0xc')](_0x8e6c('0xd'))||_0x4544e7['changed'](_0x8e6c('0xe'))||_0x4544e7[_0x8e6c('0xc')](_0x8e6c('0x1b'))||_0x4544e7[_0x8e6c('0xc')](_0x8e6c('0xf'))||_0x4544e7[_0x8e6c('0xc')]('code')||_0x4544e7[_0x8e6c('0xc')](_0x8e6c('0x27'))){var _0x136c03,_0x459a8d;_0x136c03=_0x4544e7['serverUrl'];var _0x3419d8=_0x136c03[_0x8e6c('0x11')](-0x1);if(_0x3419d8==='/'||_0x3419d8==='\x5c'||_0x3419d8===':'){_0x136c03=_0x136c03['substring'](0x0,_0x136c03['lastIndexOf'](_0x3419d8));}switch(_0x4544e7[_0x8e6c('0xd')]){case'US':_0x459a8d=_0x8e6c('0x14');break;case'AU':_0x459a8d=_0x8e6c('0x15');break;case'IN':_0x459a8d=_0x8e6c('0x16');break;case'CN':_0x459a8d=_0x8e6c('0x17');break;default:_0x459a8d=_0x8e6c('0x28');break;}var _0x37064d={'method':_0x8e6c('0x18'),'uri':_0x459a8d+_0x8e6c('0x19'),'form':{'grant_type':_0x8e6c('0x1a'),'client_id':_0x4544e7[_0x8e6c('0x1b')],'client_secret':_0x4544e7[_0x8e6c('0xf')],'redirect_uri':_0x4544e7['serverUrl'],'code':_0x4544e7[_0x8e6c('0x10')]},'headers':{'Content-Type':_0x8e6c('0x1c')}};return rp(_0x37064d)['then'](function(_0x51ccd0){var _0x286286=JSON[_0x8e6c('0x29')](_0x51ccd0);if(_0x286286[_0x8e6c('0x1e')]){_0x4544e7['refreshToken']=_0x286286[_0x8e6c('0x1e')];logger[_0x8e6c('0x2a')](util[_0x8e6c('0x22')](_0x8e6c('0x20'),_0x4544e7[_0x8e6c('0x21')],_0x4544e7['id']));}else{logger[_0x8e6c('0x26')](util['format'](_0x8e6c('0x23'),_0x4544e7['name'],_0x4544e7['id']),util[_0x8e6c('0x24')](_0x286286,{'showHidden':![],'depth':null}));}return _0x284226(null,_0x138745);})[_0x8e6c('0x25')](function(_0x1bd427){logger[_0x8e6c('0x26')](util[_0x8e6c('0x22')](_0x8e6c('0x23'),_0x4544e7[_0x8e6c('0x21')],_0x4544e7['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x284226(_0x1bd427);});}else{return _0x284226(null,_0x138745);}}}});};
\ No newline at end of file
+var _0x1746=['clientId','clientSecret','code','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.eu','refreshToken','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','serverUrl'];(function(_0x1f1400,_0x34f3f0){var _0x289177=function(_0x432c26){while(--_0x432c26){_0x1f1400['push'](_0x1f1400['shift']());}};_0x289177(++_0x34f3f0);}(_0x1746,0xc3));var _0x6174=function(_0x4635f9,_0x4b8bb9){_0x4635f9=_0x4635f9-0x0;var _0x4a2550=_0x1746[_0x4635f9];return _0x4a2550;};'use strict';var _=require(_0x6174('0x0'));var util=require(_0x6174('0x1'));var logger=require(_0x6174('0x2'))(_0x6174('0x3'));var moment=require(_0x6174('0x4'));var BPromise=require(_0x6174('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6174('0x6'));var rimraf=require(_0x6174('0x7'));var config=require(_0x6174('0x8'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x6174('0x9'));module[_0x6174('0xa')]=function(_0xfe647f,_0x4d9c2e){return _0xfe647f['define'](_0x6174('0xb'),attributes,{'tableName':_0x6174('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3e464b,_0x125d51,_0x540eb8){if(_0x3e464b[_0x6174('0xd')]('zone')||_0x3e464b[_0x6174('0xd')](_0x6174('0xe'))||_0x3e464b[_0x6174('0xd')](_0x6174('0xf'))||_0x3e464b[_0x6174('0xd')](_0x6174('0x10'))||_0x3e464b[_0x6174('0xd')](_0x6174('0x11'))||_0x3e464b[_0x6174('0xd')](_0x6174('0x12'))){var _0x5527a2,_0x39b0b7;_0x5527a2=_0x3e464b['serverUrl'];var _0x430859=_0x5527a2[_0x6174('0x13')](-0x1);if(_0x430859==='/'||_0x430859==='\x5c'||_0x430859===':'){_0x5527a2=_0x5527a2[_0x6174('0x14')](0x0,_0x5527a2[_0x6174('0x15')](_0x430859));}switch(_0x3e464b[_0x6174('0x16')]){case'US':_0x39b0b7=_0x6174('0x17');break;case'AU':_0x39b0b7=_0x6174('0x18');break;case'IN':_0x39b0b7='https://accounts.zoho.in';break;case'CN':_0x39b0b7=_0x6174('0x19');break;default:_0x39b0b7='https://accounts.zoho.eu';break;}var _0x305ccb={'method':_0x6174('0x1a'),'uri':_0x39b0b7+_0x6174('0x1b'),'form':{'grant_type':_0x6174('0x1c'),'client_id':_0x3e464b[_0x6174('0xf')],'client_secret':_0x3e464b[_0x6174('0x10')],'redirect_uri':_0x3e464b[_0x6174('0xe')],'code':_0x3e464b['code']},'headers':{'Content-Type':_0x6174('0x1d')}};return rp(_0x305ccb)[_0x6174('0x1e')](function(_0x5c8c4b){var _0x4e416f=JSON['parse'](_0x5c8c4b);if(_0x4e416f[_0x6174('0x1f')]){_0x3e464b['refreshToken']=_0x4e416f[_0x6174('0x1f')];logger[_0x6174('0x20')](util[_0x6174('0x21')](_0x6174('0x22'),_0x3e464b[_0x6174('0x23')],_0x3e464b['id']));}else{logger[_0x6174('0x24')](util[_0x6174('0x21')](_0x6174('0x25'),_0x3e464b[_0x6174('0x23')],_0x3e464b['id']),util[_0x6174('0x26')](_0x4e416f,{'showHidden':![],'depth':null}));}return _0x540eb8(null,_0x125d51);})[_0x6174('0x27')](function(_0x3de574){logger[_0x6174('0x24')](util['format'](_0x6174('0x25'),_0x3e464b[_0x6174('0x23')],_0x3e464b['id']),util[_0x6174('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x540eb8(_0x3de574);});}else{return _0x540eb8(null,_0x125d51);}},'beforeUpdate':function(_0x505612,_0x31179c,_0x20c134){if(_0x505612[_0x6174('0xd')](_0x6174('0x16'))||_0x505612[_0x6174('0xd')](_0x6174('0xe'))||_0x505612[_0x6174('0xd')](_0x6174('0xf'))||_0x505612[_0x6174('0xd')]('clientSecret')||_0x505612[_0x6174('0xd')](_0x6174('0x11'))||_0x505612[_0x6174('0xd')](_0x6174('0x12'))){var _0x278327,_0x192478;_0x278327=_0x505612[_0x6174('0xe')];var _0x5a00df=_0x278327[_0x6174('0x13')](-0x1);if(_0x5a00df==='/'||_0x5a00df==='\x5c'||_0x5a00df===':'){_0x278327=_0x278327[_0x6174('0x14')](0x0,_0x278327['lastIndexOf'](_0x5a00df));}switch(_0x505612[_0x6174('0x16')]){case'US':_0x192478=_0x6174('0x17');break;case'AU':_0x192478=_0x6174('0x18');break;case'IN':_0x192478='https://accounts.zoho.in';break;case'CN':_0x192478='https://accounts.zoho.com.cn';break;default:_0x192478=_0x6174('0x28');break;}var _0x265342={'method':_0x6174('0x1a'),'uri':_0x192478+_0x6174('0x1b'),'form':{'grant_type':'authorization_code','client_id':_0x505612[_0x6174('0xf')],'client_secret':_0x505612[_0x6174('0x10')],'redirect_uri':_0x505612['serverUrl'],'code':_0x505612[_0x6174('0x11')]},'headers':{'Content-Type':_0x6174('0x1d')}};return rp(_0x265342)['then'](function(_0x371409){var _0x43e877=JSON['parse'](_0x371409);if(_0x43e877[_0x6174('0x1f')]){_0x505612[_0x6174('0x29')]=_0x43e877[_0x6174('0x1f')];logger[_0x6174('0x20')](util['format'](_0x6174('0x22'),_0x505612[_0x6174('0x23')],_0x505612['id']));}else{logger[_0x6174('0x24')](util[_0x6174('0x21')](_0x6174('0x25'),_0x505612[_0x6174('0x23')],_0x505612['id']),util[_0x6174('0x26')](_0x43e877,{'showHidden':![],'depth':null}));}return _0x20c134(null,_0x31179c);})['catch'](function(_0x388ca5){logger['error'](util[_0x6174('0x21')](_0x6174('0x25'),_0x505612['name'],_0x505612['id']),util[_0x6174('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x20c134(_0x388ca5);});}else{return _0x20c134(null,_0x31179c);}}}});};
\ No newline at end of file
index fffc4a0..094f53c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbedb=['message','catch','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','then','GetZohoAccount','ShowZohoAccount','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbbed('0x0'));var util=require('util');var moment=require(_0xbbed('0x1'));var BPromise=require(_0xbbed('0x2'));var rs=require(_0xbbed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbbed('0x4'));var logger=require(_0xbbed('0x5'))(_0xbbed('0x6'));var config=require(_0xbbed('0x7'));var jayson=require(_0xbbed('0x8'));var client=jayson[_0xbbed('0x9')][_0xbbed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a3d9c,_0x44f7ff,_0x42f499){return new BPromise(function(_0x51d8c6,_0x12e6d0){return client['request'](_0x3a3d9c,_0x42f499)['then'](function(_0x3f5d87){logger[_0xbbed('0xb')](_0xbbed('0xc'),_0x44f7ff,'request\x20sent');logger['debug'](_0xbbed('0xd'),_0x44f7ff,_0xbbed('0xe'),JSON[_0xbbed('0xf')](_0x3f5d87));if(_0x3f5d87[_0xbbed('0x10')]){if(_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x11')]===0x1f4){logger['error'](_0xbbed('0xc'),_0x44f7ff,_0x3f5d87['error'][_0xbbed('0x12')]);return _0x12e6d0(_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x12')]);}logger[_0xbbed('0x10')](_0xbbed('0xc'),_0x44f7ff,_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x12')]);return _0x51d8c6(_0x3f5d87[_0xbbed('0x10')][_0xbbed('0x12')]);}else{logger[_0xbbed('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x44f7ff,_0xbbed('0xe'));_0x51d8c6(_0x3f5d87['result'][_0xbbed('0x12')]);}})[_0xbbed('0x13')](function(_0xf860ff){logger[_0xbbed('0x10')](_0xbbed('0xc'),_0x44f7ff,_0xf860ff);_0x12e6d0(_0xf860ff);});});}exports['GetZohoAccount']=function(_0x19e9ce){var _0x2e1789=this;return new Promise(function(_0x44fd74,_0xb8a474){return db[_0xbbed('0x14')][_0xbbed('0x15')]({'raw':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')][_0xbbed('0x17')]===undefined?!![]:![]:!![],'where':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')][_0xbbed('0x18')]||null:null,'attributes':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce['options'][_0xbbed('0x19')]||null:null,'limit':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')]['limit']||null:null,'include':_0x19e9ce[_0xbbed('0x16')]?_0x19e9ce[_0xbbed('0x16')][_0xbbed('0x1a')]?_[_0xbbed('0x1b')](_0x19e9ce['options'][_0xbbed('0x1a')],function(_0x479c81){return{'model':db[_0x479c81[_0xbbed('0x1c')]],'as':_0x479c81['as'],'attributes':_0x479c81[_0xbbed('0x19')],'include':_0x479c81['include']?_[_0xbbed('0x1b')](_0x479c81[_0xbbed('0x1a')],function(_0x11ebcf){return{'model':db[_0x11ebcf[_0xbbed('0x1c')]],'as':_0x11ebcf['as'],'attributes':_0x11ebcf[_0xbbed('0x19')],'include':_0x11ebcf[_0xbbed('0x1a')]?_['map'](_0x11ebcf[_0xbbed('0x1a')],function(_0x5dd187){return{'model':db[_0x5dd187[_0xbbed('0x1c')]],'as':_0x5dd187['as'],'attributes':_0x5dd187['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbed('0x1d')](function(_0x457b58){logger[_0xbbed('0xb')](_0xbbed('0x1e'),_0x19e9ce);logger['debug'](_0xbbed('0x1e'),_0x19e9ce,JSON[_0xbbed('0xf')](_0x457b58));_0x44fd74(_0x457b58);})[_0xbbed('0x13')](function(_0x446c21){logger['error'](_0xbbed('0x1e'),_0x446c21['message'],_0x19e9ce);_0xb8a474(_0x2e1789[_0xbbed('0x10')](0x1f4,_0x446c21[_0xbbed('0x12')]));});});};exports['ShowZohoAccount']=function(_0x35fb77){var _0xe9870c=this;return new Promise(function(_0x4d444f,_0x5de590){return db['ZohoAccount']['find']({'raw':_0x35fb77['options']?_0x35fb77[_0xbbed('0x16')][_0xbbed('0x17')]===undefined?!![]:![]:!![],'where':_0x35fb77['options']?_0x35fb77['options'][_0xbbed('0x18')]||null:null,'attributes':_0x35fb77[_0xbbed('0x16')]?_0x35fb77['options'][_0xbbed('0x19')]||null:null,'include':_0x35fb77['options']?_0x35fb77[_0xbbed('0x16')][_0xbbed('0x1a')]?_[_0xbbed('0x1b')](_0x35fb77['options'][_0xbbed('0x1a')],function(_0x1e598c){return{'model':db[_0x1e598c[_0xbbed('0x1c')]],'as':_0x1e598c['as'],'attributes':_0x1e598c[_0xbbed('0x19')],'include':_0x1e598c[_0xbbed('0x1a')]?_[_0xbbed('0x1b')](_0x1e598c['include'],function(_0x3324eb){return{'model':db[_0x3324eb['model']],'as':_0x3324eb['as'],'attributes':_0x3324eb['attributes'],'include':_0x3324eb[_0xbbed('0x1a')]?_['map'](_0x3324eb[_0xbbed('0x1a')],function(_0x46e494){return{'model':db[_0x46e494[_0xbbed('0x1c')]],'as':_0x46e494['as'],'attributes':_0x46e494[_0xbbed('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b25fd){logger[_0xbbed('0xb')]('ShowZohoAccount',_0x35fb77);logger['debug']('ShowZohoAccount',_0x35fb77,JSON[_0xbbed('0xf')](_0x1b25fd));_0x4d444f(_0x1b25fd);})[_0xbbed('0x13')](function(_0x2ab97c){logger[_0xbbed('0x10')](_0xbbed('0x1f'),_0x2ab97c[_0xbbed('0x12')],_0x35fb77);_0x5de590(_0xe9870c[_0xbbed('0x10')](0x1f4,_0x2ab97c['message']));});});};
\ No newline at end of file
+var _0x6efe=['then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','include','map','model','attributes','ShowZohoAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2ff7ae,_0x1a56a3){var _0x2847db=function(_0x8c699f){while(--_0x8c699f){_0x2ff7ae['push'](_0x2ff7ae['shift']());}};_0x2847db(++_0x1a56a3);}(_0x6efe,0xc6));var _0xe6ef=function(_0x1e076d,_0x70dcca){_0x1e076d=_0x1e076d-0x0;var _0x18b055=_0x6efe[_0x1e076d];return _0x18b055;};'use strict';var _=require(_0xe6ef('0x0'));var util=require(_0xe6ef('0x1'));var moment=require(_0xe6ef('0x2'));var BPromise=require(_0xe6ef('0x3'));var rs=require(_0xe6ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe6ef('0x5'));var logger=require(_0xe6ef('0x6'))(_0xe6ef('0x7'));var config=require(_0xe6ef('0x8'));var jayson=require(_0xe6ef('0x9'));var client=jayson['client'][_0xe6ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422e13,_0x599b6c,_0x4a4bb9){return new BPromise(function(_0x51a9eb,_0x3256ff){return client[_0xe6ef('0xb')](_0x422e13,_0x4a4bb9)[_0xe6ef('0xc')](function(_0x4fca2f){logger[_0xe6ef('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x599b6c,_0xe6ef('0xe'));logger[_0xe6ef('0xf')](_0xe6ef('0x10'),_0x599b6c,_0xe6ef('0xe'),JSON[_0xe6ef('0x11')](_0x4fca2f));if(_0x4fca2f[_0xe6ef('0x12')]){if(_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x13')]===0x1f4){logger['error'](_0xe6ef('0x14'),_0x599b6c,_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);return _0x3256ff(_0x4fca2f[_0xe6ef('0x12')]['message']);}logger[_0xe6ef('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x599b6c,_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);return _0x51a9eb(_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);}else{logger[_0xe6ef('0xd')](_0xe6ef('0x14'),_0x599b6c,_0xe6ef('0xe'));_0x51a9eb(_0x4fca2f[_0xe6ef('0x16')][_0xe6ef('0x15')]);}})[_0xe6ef('0x17')](function(_0x5c32cc){logger[_0xe6ef('0x12')](_0xe6ef('0x14'),_0x599b6c,_0x5c32cc);_0x3256ff(_0x5c32cc);});});}exports[_0xe6ef('0x18')]=function(_0x491c6f){var _0x507186=this;return new Promise(function(_0x3e11ce,_0x4e58d5){return db[_0xe6ef('0x19')]['findAll']({'raw':_0x491c6f[_0xe6ef('0x1a')]?_0x491c6f[_0xe6ef('0x1a')][_0xe6ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x491c6f[_0xe6ef('0x1a')]?_0x491c6f[_0xe6ef('0x1a')][_0xe6ef('0x1c')]||null:null,'attributes':_0x491c6f[_0xe6ef('0x1a')]?_0x491c6f[_0xe6ef('0x1a')]['attributes']||null:null,'limit':_0x491c6f[_0xe6ef('0x1a')]?_0x491c6f[_0xe6ef('0x1a')]['limit']||null:null,'include':_0x491c6f[_0xe6ef('0x1a')]?_0x491c6f[_0xe6ef('0x1a')][_0xe6ef('0x1d')]?_[_0xe6ef('0x1e')](_0x491c6f[_0xe6ef('0x1a')]['include'],function(_0xcc677f){return{'model':db[_0xcc677f[_0xe6ef('0x1f')]],'as':_0xcc677f['as'],'attributes':_0xcc677f[_0xe6ef('0x20')],'include':_0xcc677f['include']?_[_0xe6ef('0x1e')](_0xcc677f[_0xe6ef('0x1d')],function(_0x4dfd37){return{'model':db[_0x4dfd37[_0xe6ef('0x1f')]],'as':_0x4dfd37['as'],'attributes':_0x4dfd37[_0xe6ef('0x20')],'include':_0x4dfd37[_0xe6ef('0x1d')]?_['map'](_0x4dfd37[_0xe6ef('0x1d')],function(_0xd9ceb0){return{'model':db[_0xd9ceb0['model']],'as':_0xd9ceb0['as'],'attributes':_0xd9ceb0[_0xe6ef('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe6ef('0xc')](function(_0xce0b0){logger[_0xe6ef('0xd')](_0xe6ef('0x18'),_0x491c6f);logger['debug'](_0xe6ef('0x18'),_0x491c6f,JSON[_0xe6ef('0x11')](_0xce0b0));_0x3e11ce(_0xce0b0);})[_0xe6ef('0x17')](function(_0x2b840a){logger['error'](_0xe6ef('0x18'),_0x2b840a['message'],_0x491c6f);_0x4e58d5(_0x507186[_0xe6ef('0x12')](0x1f4,_0x2b840a[_0xe6ef('0x15')]));});});};exports[_0xe6ef('0x21')]=function(_0x2bb8ff){var _0xa1f514=this;return new Promise(function(_0x5860f8,_0x2ed679){return db[_0xe6ef('0x19')][_0xe6ef('0x22')]({'raw':_0x2bb8ff[_0xe6ef('0x1a')]?_0x2bb8ff[_0xe6ef('0x1a')][_0xe6ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x2bb8ff[_0xe6ef('0x1a')]?_0x2bb8ff['options']['where']||null:null,'attributes':_0x2bb8ff[_0xe6ef('0x1a')]?_0x2bb8ff[_0xe6ef('0x1a')][_0xe6ef('0x20')]||null:null,'include':_0x2bb8ff[_0xe6ef('0x1a')]?_0x2bb8ff[_0xe6ef('0x1a')][_0xe6ef('0x1d')]?_[_0xe6ef('0x1e')](_0x2bb8ff['options'][_0xe6ef('0x1d')],function(_0x28b7da){return{'model':db[_0x28b7da[_0xe6ef('0x1f')]],'as':_0x28b7da['as'],'attributes':_0x28b7da['attributes'],'include':_0x28b7da[_0xe6ef('0x1d')]?_[_0xe6ef('0x1e')](_0x28b7da['include'],function(_0x2b2828){return{'model':db[_0x2b2828[_0xe6ef('0x1f')]],'as':_0x2b2828['as'],'attributes':_0x2b2828[_0xe6ef('0x20')],'include':_0x2b2828[_0xe6ef('0x1d')]?_[_0xe6ef('0x1e')](_0x2b2828['include'],function(_0x10639c){return{'model':db[_0x10639c[_0xe6ef('0x1f')]],'as':_0x10639c['as'],'attributes':_0x10639c[_0xe6ef('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe6ef('0xc')](function(_0x306b50){logger[_0xe6ef('0xd')]('ShowZohoAccount',_0x2bb8ff);logger[_0xe6ef('0xf')](_0xe6ef('0x21'),_0x2bb8ff,JSON['stringify'](_0x306b50));_0x5860f8(_0x306b50);})[_0xe6ef('0x17')](function(_0x1f703c){logger['error'](_0xe6ef('0x21'),_0x1f703c[_0xe6ef('0x15')],_0x2bb8ff);_0x2ed679(_0xa1f514[_0xe6ef('0x12')](0x1f4,_0x1f703c[_0xe6ef('0x15')]));});});};
\ No newline at end of file
index 5f07a59..63f852c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e36=['getDescriptions','post','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x7e36,0x11a));var _0x67e3=function(_0x39ce5a,_0x260622){_0x39ce5a=_0x39ce5a-0x0;var _0x46cd9a=_0x7e36[_0x39ce5a];return _0x46cd9a;};'use strict';var multer=require(_0x67e3('0x0'));var util=require(_0x67e3('0x1'));var path=require(_0x67e3('0x2'));var timeout=require('connect-timeout');var express=require(_0x67e3('0x3'));var router=express[_0x67e3('0x4')]();var fs_extra=require(_0x67e3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x67e3('0x6'));var config=require('../../config/environment');var controller=require(_0x67e3('0x7'));router['get']('/',auth[_0x67e3('0x8')](),controller[_0x67e3('0x9')]);router[_0x67e3('0xa')](_0x67e3('0xb'),auth[_0x67e3('0x8')](),controller[_0x67e3('0xc')]);router[_0x67e3('0xa')](_0x67e3('0xd'),auth[_0x67e3('0x8')](),controller[_0x67e3('0xe')]);router['get']('/:id/subjects',auth[_0x67e3('0x8')](),controller[_0x67e3('0xf')]);router[_0x67e3('0xa')](_0x67e3('0x10'),auth[_0x67e3('0x8')](),controller[_0x67e3('0x11')]);router[_0x67e3('0x12')]('/',auth[_0x67e3('0x8')](),controller['create']);router[_0x67e3('0x13')](_0x67e3('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x67e3('0x14')](_0x67e3('0xb'),auth[_0x67e3('0x8')](),controller[_0x67e3('0x15')]);module[_0x67e3('0x16')]=router;
\ No newline at end of file
+var _0x254b=['fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','multer','util','path','express','Router'];(function(_0x437239,_0x223fb1){var _0x59223c=function(_0x1521c4){while(--_0x1521c4){_0x437239['push'](_0x437239['shift']());}};_0x59223c(++_0x223fb1);}(_0x254b,0xca));var _0xb254=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0x254b[_0x30bd4d];return _0x306915;};'use strict';var multer=require(_0xb254('0x0'));var util=require(_0xb254('0x1'));var path=require(_0xb254('0x2'));var timeout=require('connect-timeout');var express=require(_0xb254('0x3'));var router=express[_0xb254('0x4')]();var fs_extra=require(_0xb254('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb254('0x6'));var config=require('../../config/environment');var controller=require(_0xb254('0x7'));router[_0xb254('0x8')]('/',auth[_0xb254('0x9')](),controller[_0xb254('0xa')]);router['get'](_0xb254('0xb'),auth[_0xb254('0x9')](),controller[_0xb254('0xc')]);router[_0xb254('0x8')](_0xb254('0xd'),auth[_0xb254('0x9')](),controller['getFields']);router['get'](_0xb254('0xe'),auth[_0xb254('0x9')](),controller[_0xb254('0xf')]);router[_0xb254('0x8')]('/:id/descriptions',auth[_0xb254('0x9')](),controller[_0xb254('0x10')]);router[_0xb254('0x11')]('/',auth[_0xb254('0x9')](),controller[_0xb254('0x12')]);router[_0xb254('0x13')](_0xb254('0xb'),auth['isAuthenticated'](),controller[_0xb254('0x14')]);router[_0xb254('0x15')](_0xb254('0xb'),auth[_0xb254('0x9')](),controller[_0xb254('0x16')]);module['exports']=router;
\ No newline at end of file
index fdf4d61..74c4d5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1a4=['contact_lead','sequelize','STRING','ENUM','lead','contact','nothing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb1a4,0x12e));var _0x4b1a=function(_0x51d5fc,_0x12e21b){_0x51d5fc=_0x51d5fc-0x0;var _0x12676f=_0xb1a4[_0x51d5fc];return _0x12676f;};'use strict';var Sequelize=require(_0x4b1a('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b1a('0x1')]},'moduleCreate':{'type':Sequelize[_0x4b1a('0x2')](_0x4b1a('0x3'),_0x4b1a('0x4'),_0x4b1a('0x5')),'defaultValue':_0x4b1a('0x3')},'moduleSearch':{'type':Sequelize[_0x4b1a('0x2')](_0x4b1a('0x6'),'contact',_0x4b1a('0x3')),'defaultValue':_0x4b1a('0x6')},'description':{'type':Sequelize[_0x4b1a('0x1')]}};
\ No newline at end of file
+var _0xbdaf=['ENUM','lead','contact','nothing','contact_lead','sequelize','exports','STRING'];(function(_0xf39273,_0x15899a){var _0x27cc53=function(_0x317bab){while(--_0x317bab){_0xf39273['push'](_0xf39273['shift']());}};_0x27cc53(++_0x15899a);}(_0xbdaf,0xc5));var _0xfbda=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xbdaf[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0xfbda('0x0'));module[_0xfbda('0x1')]={'name':{'type':Sequelize[_0xfbda('0x2')]},'moduleCreate':{'type':Sequelize[_0xfbda('0x3')](_0xfbda('0x4'),_0xfbda('0x5'),_0xfbda('0x6')),'defaultValue':_0xfbda('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xfbda('0x5'),_0xfbda('0x4')),'defaultValue':_0xfbda('0x7')},'description':{'type':Sequelize[_0xfbda('0x2')]}};
\ No newline at end of file
index 38c2f79..1c83390 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c0b=['stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','intersection','options','find','create','body','getFields','findOne','ZohoField','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x1c557a,_0x3fe78e){var _0x1e33a4=function(_0xe87622){while(--_0xe87622){_0x1c557a['push'](_0x1c557a['shift']());}};_0x1e33a4(++_0x3fe78e);}(_0x6c0b,0x1c9));var _0xb6c0=function(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0x6c0b[_0x3c6b7d];return _0x1d3ed2;};'use strict';var emlformat=require(_0xb6c0('0x0'));var rimraf=require(_0xb6c0('0x1'));var zipdir=require(_0xb6c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6c0('0x3'));var moment=require(_0xb6c0('0x4'));var BPromise=require(_0xb6c0('0x5'));var Mustache=require(_0xb6c0('0x6'));var util=require(_0xb6c0('0x7'));var path=require(_0xb6c0('0x8'));var sox=require(_0xb6c0('0x9'));var csv=require(_0xb6c0('0xa'));var ejs=require(_0xb6c0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb6c0('0xc'));var crypto=require('crypto');var jsforce=require(_0xb6c0('0xd'));var deskjs=require(_0xb6c0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb6c0('0xf'));var Papa=require(_0xb6c0('0x10'));var Redis=require(_0xb6c0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb6c0('0x12'));var as=require(_0xb6c0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb6c0('0x14'));var utils=require('../../config/utils');var config=require(_0xb6c0('0x15'));var licenseUtil=require(_0xb6c0('0x16'));var db=require(_0xb6c0('0x17'))['db'];function respondWithStatusCode(_0x252419,_0x1f027e){_0x1f027e=_0x1f027e||0xcc;return function(_0x38f236){if(_0x38f236){return _0x252419[_0xb6c0('0x18')](_0x1f027e);}return _0x252419[_0xb6c0('0x19')](_0x1f027e)[_0xb6c0('0x1a')]();};}function respondWithResult(_0xd14a07,_0x46d074){_0x46d074=_0x46d074||0xc8;return function(_0x134e6d){if(_0x134e6d){return _0xd14a07[_0xb6c0('0x19')](_0x46d074)[_0xb6c0('0x1b')](_0x134e6d);}};}function respondWithFilteredResult(_0xd5520a,_0x2860d2){return function(_0x43c750){if(_0x43c750){var _0x5c8985=typeof _0x2860d2[_0xb6c0('0x1c')]===_0xb6c0('0x1d')&&typeof _0x2860d2[_0xb6c0('0x1e')]===_0xb6c0('0x1d');var _0x1c8708=_0x43c750['count'];var _0x33fa7f=_0x5c8985?0x0:_0x2860d2[_0xb6c0('0x1c')];var _0x30b809=_0x5c8985?_0x43c750[_0xb6c0('0x1f')]:_0x2860d2['offset']+_0x2860d2[_0xb6c0('0x1e')];var _0xec5894;if(_0x30b809>=_0x1c8708){_0x30b809=_0x1c8708;_0xec5894=0xc8;}else{_0xec5894=0xce;}_0xd5520a[_0xb6c0('0x19')](_0xec5894);return _0xd5520a[_0xb6c0('0x20')](_0xb6c0('0x21'),_0x33fa7f+'-'+_0x30b809+'/'+_0x1c8708)[_0xb6c0('0x1b')](_0x43c750);}return null;};}function patchUpdates(_0x3dee42){return function(_0x2060b8){try{jsonpatch[_0xb6c0('0x22')](_0x2060b8,_0x3dee42,!![]);}catch(_0x520237){return BPromise[_0xb6c0('0x23')](_0x520237);}return _0x2060b8[_0xb6c0('0x24')]();};}function saveUpdates(_0x11b08c,_0x342178){return function(_0x126f76){if(_0x126f76){return _0x126f76[_0xb6c0('0x25')](_0x11b08c)[_0xb6c0('0x26')](function(_0x316991){return _0x316991;});}return null;};}function removeEntity(_0x257a4d,_0xc01151){return function(_0x431df6){if(_0x431df6){return _0x431df6[_0xb6c0('0x27')]()['then'](function(){_0x257a4d[_0xb6c0('0x19')](0xcc)[_0xb6c0('0x1a')]();});}};}function handleEntityNotFound(_0x853202,_0x3f5369){return function(_0x2c1734){if(!_0x2c1734){_0x853202[_0xb6c0('0x18')](0x194);}return _0x2c1734;};}function handleError(_0x3a8953,_0x2cfcc2){_0x2cfcc2=_0x2cfcc2||0x1f4;return function(_0x4e9b62){logger[_0xb6c0('0x28')](_0x4e9b62[_0xb6c0('0x29')]);if(_0x4e9b62['name']){delete _0x4e9b62[_0xb6c0('0x2a')];}_0x3a8953[_0xb6c0('0x19')](_0x2cfcc2)[_0xb6c0('0x2b')](_0x4e9b62);};}exports['index']=function(_0x42e3c8,_0x232b2f){var _0x14838e={},_0x4c79e8={},_0x3ebc0d={'count':0x0,'rows':[]};var _0x5b6e79=_[_0xb6c0('0x2c')](db[_0xb6c0('0x2d')][_0xb6c0('0x2e')],function(_0x55aa5f){return{'name':_0x55aa5f[_0xb6c0('0x2f')],'type':_0x55aa5f[_0xb6c0('0x30')][_0xb6c0('0x31')]};});_0x4c79e8[_0xb6c0('0x32')]=_[_0xb6c0('0x2c')](_0x5b6e79,_0xb6c0('0x2a'));_0x4c79e8['query']=_['keys'](_0x42e3c8[_0xb6c0('0x33')]);_0x4c79e8[_0xb6c0('0x34')]=_['intersection'](_0x4c79e8[_0xb6c0('0x32')],_0x4c79e8['query']);_0x14838e['attributes']=_['intersection'](_0x4c79e8[_0xb6c0('0x32')],qs['fields'](_0x42e3c8[_0xb6c0('0x33')][_0xb6c0('0x35')]));_0x14838e[_0xb6c0('0x36')]=_0x14838e[_0xb6c0('0x36')][_0xb6c0('0x37')]?_0x14838e[_0xb6c0('0x36')]:_0x4c79e8[_0xb6c0('0x32')];if(!_0x42e3c8[_0xb6c0('0x33')]['hasOwnProperty']('nolimit')){_0x14838e['limit']=qs[_0xb6c0('0x1e')](_0x42e3c8[_0xb6c0('0x33')]['limit']);_0x14838e[_0xb6c0('0x1c')]=qs[_0xb6c0('0x1c')](_0x42e3c8[_0xb6c0('0x33')]['offset']);}_0x14838e[_0xb6c0('0x38')]=qs[_0xb6c0('0x39')](_0x42e3c8[_0xb6c0('0x33')][_0xb6c0('0x39')]);_0x14838e[_0xb6c0('0x3a')]=qs['filters'](_[_0xb6c0('0x3b')](_0x42e3c8['query'],_0x4c79e8[_0xb6c0('0x34')]),_0x5b6e79);if(_0x42e3c8[_0xb6c0('0x33')][_0xb6c0('0x3c')]){_0x14838e[_0xb6c0('0x3a')]=_[_0xb6c0('0x3d')](_0x14838e['where'],{'$or':_['map'](_0x5b6e79,function(_0x520d2e){if(_0x520d2e[_0xb6c0('0x30')]!==_0xb6c0('0x3e')){var _0x1a4b64={};_0x1a4b64[_0x520d2e[_0xb6c0('0x2a')]]={'$like':'%'+_0x42e3c8[_0xb6c0('0x33')][_0xb6c0('0x3c')]+'%'};return _0x1a4b64;}})});}_0x14838e=_[_0xb6c0('0x3d')]({},_0x14838e,_0x42e3c8['options']);var _0x3a3eaa={'where':_0x14838e[_0xb6c0('0x3a')]};return db[_0xb6c0('0x2d')][_0xb6c0('0x1f')](_0x3a3eaa)[_0xb6c0('0x26')](function(_0x590eee){_0x3ebc0d[_0xb6c0('0x1f')]=_0x590eee;if(_0x42e3c8[_0xb6c0('0x33')][_0xb6c0('0x3f')]){_0x14838e[_0xb6c0('0x40')]=[{'all':!![]}];}return db[_0xb6c0('0x2d')][_0xb6c0('0x41')](_0x14838e);})[_0xb6c0('0x26')](function(_0x11f2a2){_0x3ebc0d[_0xb6c0('0x42')]=_0x11f2a2;return _0x3ebc0d;})[_0xb6c0('0x26')](respondWithFilteredResult(_0x232b2f,_0x14838e))[_0xb6c0('0x43')](handleError(_0x232b2f,null));};exports[_0xb6c0('0x44')]=function(_0x4fb304,_0x34abfa){var _0x4cb9a4={'raw':![],'where':{'id':_0x4fb304[_0xb6c0('0x45')]['id']}},_0x11c799={};_0x11c799['model']=_['keys'](db[_0xb6c0('0x2d')][_0xb6c0('0x2e')]);_0x11c799[_0xb6c0('0x33')]=_[_0xb6c0('0x46')](_0x4fb304['query']);_0x11c799[_0xb6c0('0x34')]=_[_0xb6c0('0x47')](_0x11c799[_0xb6c0('0x32')],_0x11c799[_0xb6c0('0x33')]);_0x4cb9a4['attributes']=_['intersection'](_0x11c799[_0xb6c0('0x32')],qs[_0xb6c0('0x35')](_0x4fb304[_0xb6c0('0x33')]['fields']));_0x4cb9a4[_0xb6c0('0x36')]=_0x4cb9a4[_0xb6c0('0x36')][_0xb6c0('0x37')]?_0x4cb9a4[_0xb6c0('0x36')]:_0x11c799[_0xb6c0('0x32')];if(_0x4fb304[_0xb6c0('0x33')]['includeAll']){_0x4cb9a4[_0xb6c0('0x40')]=[{'all':!![]}];}_0x4cb9a4=_[_0xb6c0('0x3d')]({},_0x4cb9a4,_0x4fb304[_0xb6c0('0x48')]);return db['ZohoConfiguration'][_0xb6c0('0x49')](_0x4cb9a4)[_0xb6c0('0x26')](handleEntityNotFound(_0x34abfa,null))[_0xb6c0('0x26')](respondWithResult(_0x34abfa,null))[_0xb6c0('0x43')](handleError(_0x34abfa,null));};exports[_0xb6c0('0x4a')]=function(_0x950071,_0x4c3d56){return db[_0xb6c0('0x2d')]['create'](_0x950071[_0xb6c0('0x4b')],{})['then'](respondWithResult(_0x4c3d56,0xc9))[_0xb6c0('0x43')](handleError(_0x4c3d56,null));};exports[_0xb6c0('0x25')]=function(_0x48e967,_0x42f91e){if(_0x48e967[_0xb6c0('0x4b')]['id']){delete _0x48e967[_0xb6c0('0x4b')]['id'];}return db[_0xb6c0('0x2d')][_0xb6c0('0x49')]({'where':{'id':_0x48e967[_0xb6c0('0x45')]['id']}})[_0xb6c0('0x26')](handleEntityNotFound(_0x42f91e,null))[_0xb6c0('0x26')](saveUpdates(_0x48e967[_0xb6c0('0x4b')],null))[_0xb6c0('0x26')](respondWithResult(_0x42f91e,null))[_0xb6c0('0x43')](handleError(_0x42f91e,null));};exports[_0xb6c0('0x27')]=function(_0x4bddc8,_0x91c9d1){return db[_0xb6c0('0x2d')]['find']({'where':{'id':_0x4bddc8[_0xb6c0('0x45')]['id']}})[_0xb6c0('0x26')](handleEntityNotFound(_0x91c9d1,null))[_0xb6c0('0x26')](removeEntity(_0x91c9d1,null))[_0xb6c0('0x43')](handleError(_0x91c9d1,null));};exports[_0xb6c0('0x4c')]=function(_0x3b07d6,_0x2c0400,_0x2dd121){var _0x13826d={};var _0x305051={};var _0x20ce18;var _0x476e42;return db['ZohoConfiguration'][_0xb6c0('0x4d')]({'where':{'id':_0x3b07d6[_0xb6c0('0x45')]['id']}})[_0xb6c0('0x26')](handleEntityNotFound(_0x2c0400,null))['then'](function(_0x4fbbfe){if(_0x4fbbfe){_0x20ce18=_0x4fbbfe;_0x305051[_0xb6c0('0x32')]=_[_0xb6c0('0x46')](db[_0xb6c0('0x4e')][_0xb6c0('0x2e')]);_0x305051['query']=_[_0xb6c0('0x46')](_0x3b07d6[_0xb6c0('0x33')]);_0x305051[_0xb6c0('0x34')]=_[_0xb6c0('0x47')](_0x305051[_0xb6c0('0x32')],_0x305051[_0xb6c0('0x33')]);_0x13826d[_0xb6c0('0x36')]=_[_0xb6c0('0x47')](_0x305051[_0xb6c0('0x32')],qs[_0xb6c0('0x35')](_0x3b07d6[_0xb6c0('0x33')][_0xb6c0('0x35')]));_0x13826d['attributes']=_0x13826d[_0xb6c0('0x36')][_0xb6c0('0x37')]?_0x13826d[_0xb6c0('0x36')]:_0x305051['model'];_0x13826d[_0xb6c0('0x38')]=qs[_0xb6c0('0x39')](_0x3b07d6['query'][_0xb6c0('0x39')]);_0x13826d[_0xb6c0('0x3a')]=qs[_0xb6c0('0x34')](_[_0xb6c0('0x3b')](_0x3b07d6['query'],_0x305051['filters']));if(_0x3b07d6[_0xb6c0('0x33')]['filter']){_0x13826d[_0xb6c0('0x3a')]=_['merge'](_0x13826d[_0xb6c0('0x3a')],{'$or':_[_0xb6c0('0x2c')](_0x13826d[_0xb6c0('0x36')],function(_0x1ec065){var _0x36d204={};_0x36d204[_0x1ec065]={'$like':'%'+_0x3b07d6[_0xb6c0('0x33')][_0xb6c0('0x3c')]+'%'};return _0x36d204;})});}_0x13826d=_[_0xb6c0('0x3d')]({},_0x13826d,_0x3b07d6[_0xb6c0('0x48')]);return _0x20ce18['getFields'](_0x13826d);}})[_0xb6c0('0x26')](function(_0x49273b){if(_0x49273b){_0x476e42=_0x49273b[_0xb6c0('0x37')];if(!_0x3b07d6[_0xb6c0('0x33')][_0xb6c0('0x4f')](_0xb6c0('0x50'))){_0x13826d[_0xb6c0('0x1e')]=qs['limit'](_0x3b07d6[_0xb6c0('0x33')][_0xb6c0('0x1e')]);_0x13826d[_0xb6c0('0x1c')]=qs[_0xb6c0('0x1c')](_0x3b07d6[_0xb6c0('0x33')][_0xb6c0('0x1c')]);}return _0x20ce18['getFields'](_0x13826d);}})[_0xb6c0('0x26')](function(_0xe80989){if(_0xe80989){return _0xe80989?{'count':_0x476e42,'rows':_0xe80989}:null;}})[_0xb6c0('0x26')](respondWithResult(_0x2c0400,null))['catch'](handleError(_0x2c0400,null));};exports[_0xb6c0('0x51')]=function(_0x1a8ce9,_0x27e043,_0x4ef718){var _0xe55ad0={};var _0x299bbc={};var _0xc8053d;var _0x263c6e;return db[_0xb6c0('0x2d')][_0xb6c0('0x4d')]({'where':{'id':_0x1a8ce9[_0xb6c0('0x45')]['id']}})[_0xb6c0('0x26')](handleEntityNotFound(_0x27e043,null))['then'](function(_0x1bb7f2){if(_0x1bb7f2){_0xc8053d=_0x1bb7f2;_0x299bbc[_0xb6c0('0x32')]=_[_0xb6c0('0x46')](db[_0xb6c0('0x4e')]['rawAttributes']);_0x299bbc['query']=_[_0xb6c0('0x46')](_0x1a8ce9['query']);_0x299bbc['filters']=_[_0xb6c0('0x47')](_0x299bbc['model'],_0x299bbc['query']);_0xe55ad0[_0xb6c0('0x36')]=_[_0xb6c0('0x47')](_0x299bbc[_0xb6c0('0x32')],qs[_0xb6c0('0x35')](_0x1a8ce9['query'][_0xb6c0('0x35')]));_0xe55ad0[_0xb6c0('0x36')]=_0xe55ad0[_0xb6c0('0x36')][_0xb6c0('0x37')]?_0xe55ad0[_0xb6c0('0x36')]:_0x299bbc['model'];_0xe55ad0[_0xb6c0('0x38')]=qs[_0xb6c0('0x39')](_0x1a8ce9[_0xb6c0('0x33')][_0xb6c0('0x39')]);_0xe55ad0[_0xb6c0('0x3a')]=qs[_0xb6c0('0x34')](_[_0xb6c0('0x3b')](_0x1a8ce9[_0xb6c0('0x33')],_0x299bbc[_0xb6c0('0x34')]));if(_0x1a8ce9[_0xb6c0('0x33')][_0xb6c0('0x3c')]){_0xe55ad0[_0xb6c0('0x3a')]=_[_0xb6c0('0x3d')](_0xe55ad0[_0xb6c0('0x3a')],{'$or':_[_0xb6c0('0x2c')](_0xe55ad0['attributes'],function(_0x5c30d2){var _0x2b5235={};_0x2b5235[_0x5c30d2]={'$like':'%'+_0x1a8ce9[_0xb6c0('0x33')][_0xb6c0('0x3c')]+'%'};return _0x2b5235;})});}_0xe55ad0=_[_0xb6c0('0x3d')]({},_0xe55ad0,_0x1a8ce9[_0xb6c0('0x48')]);return _0xc8053d[_0xb6c0('0x51')](_0xe55ad0);}})[_0xb6c0('0x26')](function(_0x35dca2){if(_0x35dca2){_0x263c6e=_0x35dca2[_0xb6c0('0x37')];if(!_0x1a8ce9[_0xb6c0('0x33')][_0xb6c0('0x4f')](_0xb6c0('0x50'))){_0xe55ad0['limit']=qs[_0xb6c0('0x1e')](_0x1a8ce9['query'][_0xb6c0('0x1e')]);_0xe55ad0[_0xb6c0('0x1c')]=qs[_0xb6c0('0x1c')](_0x1a8ce9[_0xb6c0('0x33')][_0xb6c0('0x1c')]);}return _0xc8053d[_0xb6c0('0x51')](_0xe55ad0);}})['then'](function(_0xb5fefb){if(_0xb5fefb){return _0xb5fefb?{'count':_0x263c6e,'rows':_0xb5fefb}:null;}})[_0xb6c0('0x26')](respondWithResult(_0x27e043,null))['catch'](handleError(_0x27e043,null));};exports[_0xb6c0('0x52')]=function(_0x5284c7,_0x1a60e4,_0x296b92){var _0x44e559={};var _0x2b2fc4={};var _0x27a370;var _0x423e9a;return db[_0xb6c0('0x2d')]['findOne']({'where':{'id':_0x5284c7['params']['id']}})[_0xb6c0('0x26')](handleEntityNotFound(_0x1a60e4,null))[_0xb6c0('0x26')](function(_0x5e0183){if(_0x5e0183){_0x27a370=_0x5e0183;_0x2b2fc4['model']=_[_0xb6c0('0x46')](db[_0xb6c0('0x4e')][_0xb6c0('0x2e')]);_0x2b2fc4[_0xb6c0('0x33')]=_[_0xb6c0('0x46')](_0x5284c7[_0xb6c0('0x33')]);_0x2b2fc4[_0xb6c0('0x34')]=_[_0xb6c0('0x47')](_0x2b2fc4[_0xb6c0('0x32')],_0x2b2fc4[_0xb6c0('0x33')]);_0x44e559[_0xb6c0('0x36')]=_[_0xb6c0('0x47')](_0x2b2fc4['model'],qs[_0xb6c0('0x35')](_0x5284c7[_0xb6c0('0x33')][_0xb6c0('0x35')]));_0x44e559[_0xb6c0('0x36')]=_0x44e559[_0xb6c0('0x36')][_0xb6c0('0x37')]?_0x44e559[_0xb6c0('0x36')]:_0x2b2fc4['model'];_0x44e559[_0xb6c0('0x38')]=qs[_0xb6c0('0x39')](_0x5284c7[_0xb6c0('0x33')][_0xb6c0('0x39')]);_0x44e559['where']=qs['filters'](_[_0xb6c0('0x3b')](_0x5284c7[_0xb6c0('0x33')],_0x2b2fc4[_0xb6c0('0x34')]));if(_0x5284c7[_0xb6c0('0x33')][_0xb6c0('0x3c')]){_0x44e559[_0xb6c0('0x3a')]=_[_0xb6c0('0x3d')](_0x44e559[_0xb6c0('0x3a')],{'$or':_[_0xb6c0('0x2c')](_0x44e559[_0xb6c0('0x36')],function(_0x378df4){var _0xd190ad={};_0xd190ad[_0x378df4]={'$like':'%'+_0x5284c7[_0xb6c0('0x33')][_0xb6c0('0x3c')]+'%'};return _0xd190ad;})});}_0x44e559=_['merge']({},_0x44e559,_0x5284c7['options']);return _0x27a370['getDescriptions'](_0x44e559);}})[_0xb6c0('0x26')](function(_0x3e5887){if(_0x3e5887){_0x423e9a=_0x3e5887[_0xb6c0('0x37')];if(!_0x5284c7['query']['hasOwnProperty'](_0xb6c0('0x50'))){_0x44e559[_0xb6c0('0x1e')]=qs[_0xb6c0('0x1e')](_0x5284c7[_0xb6c0('0x33')][_0xb6c0('0x1e')]);_0x44e559[_0xb6c0('0x1c')]=qs[_0xb6c0('0x1c')](_0x5284c7['query'][_0xb6c0('0x1c')]);}return _0x27a370[_0xb6c0('0x52')](_0x44e559);}})[_0xb6c0('0x26')](function(_0x419189){if(_0x419189){return _0x419189?{'count':_0x423e9a,'rows':_0x419189}:null;}})[_0xb6c0('0x26')](respondWithResult(_0x1a60e4,null))[_0xb6c0('0x43')](handleError(_0x1a60e4,null));};
\ No newline at end of file
+var _0x611d=['ZohoConfiguration','include','findAll','rows','catch','params','length','includeAll','find','create','body','getFields','findOne','pick','options','nolimit','ZohoField','getSubjects','getDescriptions','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x121cf4,_0x18a6c8){var _0x51c27a=function(_0x3f1bcb){while(--_0x3f1bcb){_0x121cf4['push'](_0x121cf4['shift']());}};_0x51c27a(++_0x18a6c8);}(_0x611d,0x103));var _0xd611=function(_0x552245,_0x351a86){_0x552245=_0x552245-0x0;var _0x30e4d9=_0x611d[_0x552245];return _0x30e4d9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd611('0x0'));var rp=require(_0xd611('0x1'));var moment=require(_0xd611('0x2'));var BPromise=require(_0xd611('0x3'));var Mustache=require(_0xd611('0x4'));var util=require(_0xd611('0x5'));var path=require(_0xd611('0x6'));var sox=require(_0xd611('0x7'));var csv=require(_0xd611('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd611('0x9'));var _=require(_0xd611('0xa'));var squel=require(_0xd611('0xb'));var crypto=require('crypto');var jsforce=require(_0xd611('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd611('0x8'));var querystring=require(_0xd611('0xd'));var Papa=require(_0xd611('0xe'));var Redis=require('ioredis');var authService=require(_0xd611('0xf'));var qs=require(_0xd611('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd611('0x11'));var logger=require(_0xd611('0x12'))('api');var utils=require(_0xd611('0x13'));var config=require(_0xd611('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a3980,_0x305260){_0x305260=_0x305260||0xcc;return function(_0x5b10df){if(_0x5b10df){return _0x1a3980[_0xd611('0x15')](_0x305260);}return _0x1a3980['status'](_0x305260)[_0xd611('0x16')]();};}function respondWithResult(_0x3b758c,_0x50648b){_0x50648b=_0x50648b||0xc8;return function(_0x348b7b){if(_0x348b7b){return _0x3b758c[_0xd611('0x17')](_0x50648b)[_0xd611('0x18')](_0x348b7b);}};}function respondWithFilteredResult(_0x99d40d,_0x39d4e4){return function(_0x1aa9d2){if(_0x1aa9d2){var _0x20ab5b=typeof _0x39d4e4[_0xd611('0x19')]===_0xd611('0x1a')&&typeof _0x39d4e4[_0xd611('0x1b')]===_0xd611('0x1a');var _0x458c01=_0x1aa9d2[_0xd611('0x1c')];var _0x1bc7c1=_0x20ab5b?0x0:_0x39d4e4['offset'];var _0x43ce2b=_0x20ab5b?_0x1aa9d2[_0xd611('0x1c')]:_0x39d4e4['offset']+_0x39d4e4['limit'];var _0x4bf5a7;if(_0x43ce2b>=_0x458c01){_0x43ce2b=_0x458c01;_0x4bf5a7=0xc8;}else{_0x4bf5a7=0xce;}_0x99d40d[_0xd611('0x17')](_0x4bf5a7);return _0x99d40d[_0xd611('0x1d')](_0xd611('0x1e'),_0x1bc7c1+'-'+_0x43ce2b+'/'+_0x458c01)[_0xd611('0x18')](_0x1aa9d2);}return null;};}function patchUpdates(_0x4b1b57){return function(_0x135f28){try{jsonpatch[_0xd611('0x1f')](_0x135f28,_0x4b1b57,!![]);}catch(_0x2bc787){return BPromise[_0xd611('0x20')](_0x2bc787);}return _0x135f28[_0xd611('0x21')]();};}function saveUpdates(_0xbf5066,_0x1151b9){return function(_0x15a3ae){if(_0x15a3ae){return _0x15a3ae[_0xd611('0x22')](_0xbf5066)[_0xd611('0x23')](function(_0x114e70){return _0x114e70;});}return null;};}function removeEntity(_0x3c0a1f,_0x390ccf){return function(_0x52630d){if(_0x52630d){return _0x52630d[_0xd611('0x24')]()[_0xd611('0x23')](function(){_0x3c0a1f['status'](0xcc)[_0xd611('0x16')]();});}};}function handleEntityNotFound(_0x39b88f,_0x470ac1){return function(_0x1be90d){if(!_0x1be90d){_0x39b88f[_0xd611('0x15')](0x194);}return _0x1be90d;};}function handleError(_0x117a65,_0x31067f){_0x31067f=_0x31067f||0x1f4;return function(_0x2064d5){logger[_0xd611('0x25')](_0x2064d5[_0xd611('0x26')]);if(_0x2064d5[_0xd611('0x27')]){delete _0x2064d5['name'];}_0x117a65[_0xd611('0x17')](_0x31067f)[_0xd611('0x28')](_0x2064d5);};}exports[_0xd611('0x29')]=function(_0x2b290e,_0x22190f){var _0x4e782a={},_0x4b255e={},_0xcf44de={'count':0x0,'rows':[]};var _0x6a6ed=_[_0xd611('0x2a')](db['ZohoConfiguration'][_0xd611('0x2b')],function(_0x3fe318){return{'name':_0x3fe318[_0xd611('0x2c')],'type':_0x3fe318[_0xd611('0x2d')][_0xd611('0x2e')]};});_0x4b255e[_0xd611('0x2f')]=_[_0xd611('0x2a')](_0x6a6ed,_0xd611('0x27'));_0x4b255e[_0xd611('0x30')]=_[_0xd611('0x31')](_0x2b290e['query']);_0x4b255e[_0xd611('0x32')]=_[_0xd611('0x33')](_0x4b255e[_0xd611('0x2f')],_0x4b255e[_0xd611('0x30')]);_0x4e782a[_0xd611('0x34')]=_[_0xd611('0x33')](_0x4b255e[_0xd611('0x2f')],qs[_0xd611('0x35')](_0x2b290e[_0xd611('0x30')][_0xd611('0x35')]));_0x4e782a[_0xd611('0x34')]=_0x4e782a[_0xd611('0x34')]['length']?_0x4e782a['attributes']:_0x4b255e[_0xd611('0x2f')];if(!_0x2b290e[_0xd611('0x30')][_0xd611('0x36')]('nolimit')){_0x4e782a[_0xd611('0x1b')]=qs[_0xd611('0x1b')](_0x2b290e['query'][_0xd611('0x1b')]);_0x4e782a[_0xd611('0x19')]=qs['offset'](_0x2b290e['query'][_0xd611('0x19')]);}_0x4e782a[_0xd611('0x37')]=qs[_0xd611('0x38')](_0x2b290e[_0xd611('0x30')][_0xd611('0x38')]);_0x4e782a[_0xd611('0x39')]=qs[_0xd611('0x32')](_['pick'](_0x2b290e['query'],_0x4b255e[_0xd611('0x32')]),_0x6a6ed);if(_0x2b290e[_0xd611('0x30')][_0xd611('0x3a')]){_0x4e782a[_0xd611('0x39')]=_[_0xd611('0x3b')](_0x4e782a[_0xd611('0x39')],{'$or':_[_0xd611('0x2a')](_0x6a6ed,function(_0x212a1e){if(_0x212a1e[_0xd611('0x2d')]!==_0xd611('0x3c')){var _0xcdf54={};_0xcdf54[_0x212a1e['name']]={'$like':'%'+_0x2b290e['query']['filter']+'%'};return _0xcdf54;}})});}_0x4e782a=_[_0xd611('0x3b')]({},_0x4e782a,_0x2b290e['options']);var _0x250f35={'where':_0x4e782a['where']};return db[_0xd611('0x3d')][_0xd611('0x1c')](_0x250f35)['then'](function(_0x27592d){_0xcf44de[_0xd611('0x1c')]=_0x27592d;if(_0x2b290e[_0xd611('0x30')]['includeAll']){_0x4e782a[_0xd611('0x3e')]=[{'all':!![]}];}return db[_0xd611('0x3d')][_0xd611('0x3f')](_0x4e782a);})['then'](function(_0x5ce4f5){_0xcf44de[_0xd611('0x40')]=_0x5ce4f5;return _0xcf44de;})[_0xd611('0x23')](respondWithFilteredResult(_0x22190f,_0x4e782a))[_0xd611('0x41')](handleError(_0x22190f,null));};exports['show']=function(_0x5889d1,_0xef7326){var _0x478723={'raw':![],'where':{'id':_0x5889d1[_0xd611('0x42')]['id']}},_0xa084b1={};_0xa084b1[_0xd611('0x2f')]=_[_0xd611('0x31')](db[_0xd611('0x3d')][_0xd611('0x2b')]);_0xa084b1[_0xd611('0x30')]=_[_0xd611('0x31')](_0x5889d1[_0xd611('0x30')]);_0xa084b1[_0xd611('0x32')]=_[_0xd611('0x33')](_0xa084b1[_0xd611('0x2f')],_0xa084b1[_0xd611('0x30')]);_0x478723[_0xd611('0x34')]=_['intersection'](_0xa084b1[_0xd611('0x2f')],qs[_0xd611('0x35')](_0x5889d1[_0xd611('0x30')]['fields']));_0x478723[_0xd611('0x34')]=_0x478723[_0xd611('0x34')][_0xd611('0x43')]?_0x478723['attributes']:_0xa084b1[_0xd611('0x2f')];if(_0x5889d1[_0xd611('0x30')][_0xd611('0x44')]){_0x478723[_0xd611('0x3e')]=[{'all':!![]}];}_0x478723=_[_0xd611('0x3b')]({},_0x478723,_0x5889d1['options']);return db[_0xd611('0x3d')][_0xd611('0x45')](_0x478723)[_0xd611('0x23')](handleEntityNotFound(_0xef7326,null))[_0xd611('0x23')](respondWithResult(_0xef7326,null))[_0xd611('0x41')](handleError(_0xef7326,null));};exports[_0xd611('0x46')]=function(_0x1106e8,_0x99ecda){return db[_0xd611('0x3d')]['create'](_0x1106e8['body'],{})[_0xd611('0x23')](respondWithResult(_0x99ecda,0xc9))[_0xd611('0x41')](handleError(_0x99ecda,null));};exports[_0xd611('0x22')]=function(_0x12e98a,_0x3a0ac0){if(_0x12e98a[_0xd611('0x47')]['id']){delete _0x12e98a[_0xd611('0x47')]['id'];}return db[_0xd611('0x3d')][_0xd611('0x45')]({'where':{'id':_0x12e98a[_0xd611('0x42')]['id']}})[_0xd611('0x23')](handleEntityNotFound(_0x3a0ac0,null))[_0xd611('0x23')](saveUpdates(_0x12e98a['body'],null))[_0xd611('0x23')](respondWithResult(_0x3a0ac0,null))[_0xd611('0x41')](handleError(_0x3a0ac0,null));};exports[_0xd611('0x24')]=function(_0x73acf2,_0x21c025){return db[_0xd611('0x3d')][_0xd611('0x45')]({'where':{'id':_0x73acf2['params']['id']}})['then'](handleEntityNotFound(_0x21c025,null))[_0xd611('0x23')](removeEntity(_0x21c025,null))[_0xd611('0x41')](handleError(_0x21c025,null));};exports[_0xd611('0x48')]=function(_0x1f9fb1,_0x233dd7,_0x29f837){var _0x4d7ef0={};var _0x26d82a={};var _0x42d3cf;var _0x617fac;return db['ZohoConfiguration'][_0xd611('0x49')]({'where':{'id':_0x1f9fb1[_0xd611('0x42')]['id']}})['then'](handleEntityNotFound(_0x233dd7,null))[_0xd611('0x23')](function(_0x4eb407){if(_0x4eb407){_0x42d3cf=_0x4eb407;_0x26d82a[_0xd611('0x2f')]=_[_0xd611('0x31')](db['ZohoField'][_0xd611('0x2b')]);_0x26d82a['query']=_[_0xd611('0x31')](_0x1f9fb1['query']);_0x26d82a[_0xd611('0x32')]=_['intersection'](_0x26d82a['model'],_0x26d82a[_0xd611('0x30')]);_0x4d7ef0[_0xd611('0x34')]=_[_0xd611('0x33')](_0x26d82a[_0xd611('0x2f')],qs[_0xd611('0x35')](_0x1f9fb1['query'][_0xd611('0x35')]));_0x4d7ef0[_0xd611('0x34')]=_0x4d7ef0[_0xd611('0x34')][_0xd611('0x43')]?_0x4d7ef0[_0xd611('0x34')]:_0x26d82a[_0xd611('0x2f')];_0x4d7ef0['order']=qs[_0xd611('0x38')](_0x1f9fb1['query'][_0xd611('0x38')]);_0x4d7ef0[_0xd611('0x39')]=qs[_0xd611('0x32')](_[_0xd611('0x4a')](_0x1f9fb1[_0xd611('0x30')],_0x26d82a[_0xd611('0x32')]));if(_0x1f9fb1['query']['filter']){_0x4d7ef0[_0xd611('0x39')]=_[_0xd611('0x3b')](_0x4d7ef0[_0xd611('0x39')],{'$or':_[_0xd611('0x2a')](_0x4d7ef0[_0xd611('0x34')],function(_0x5ab757){var _0x1ab5dc={};_0x1ab5dc[_0x5ab757]={'$like':'%'+_0x1f9fb1[_0xd611('0x30')][_0xd611('0x3a')]+'%'};return _0x1ab5dc;})});}_0x4d7ef0=_[_0xd611('0x3b')]({},_0x4d7ef0,_0x1f9fb1[_0xd611('0x4b')]);return _0x42d3cf['getFields'](_0x4d7ef0);}})['then'](function(_0x539fc0){if(_0x539fc0){_0x617fac=_0x539fc0[_0xd611('0x43')];if(!_0x1f9fb1['query']['hasOwnProperty'](_0xd611('0x4c'))){_0x4d7ef0['limit']=qs['limit'](_0x1f9fb1[_0xd611('0x30')]['limit']);_0x4d7ef0[_0xd611('0x19')]=qs[_0xd611('0x19')](_0x1f9fb1[_0xd611('0x30')][_0xd611('0x19')]);}return _0x42d3cf[_0xd611('0x48')](_0x4d7ef0);}})[_0xd611('0x23')](function(_0x1c9e25){if(_0x1c9e25){return _0x1c9e25?{'count':_0x617fac,'rows':_0x1c9e25}:null;}})[_0xd611('0x23')](respondWithResult(_0x233dd7,null))['catch'](handleError(_0x233dd7,null));};exports['getSubjects']=function(_0x5c8716,_0x523abe,_0x3c5758){var _0x1f5c45={};var _0x27bf3d={};var _0x3bd720;var _0x314405;return db[_0xd611('0x3d')][_0xd611('0x49')]({'where':{'id':_0x5c8716[_0xd611('0x42')]['id']}})[_0xd611('0x23')](handleEntityNotFound(_0x523abe,null))[_0xd611('0x23')](function(_0x379584){if(_0x379584){_0x3bd720=_0x379584;_0x27bf3d['model']=_[_0xd611('0x31')](db[_0xd611('0x4d')][_0xd611('0x2b')]);_0x27bf3d[_0xd611('0x30')]=_[_0xd611('0x31')](_0x5c8716[_0xd611('0x30')]);_0x27bf3d['filters']=_[_0xd611('0x33')](_0x27bf3d[_0xd611('0x2f')],_0x27bf3d[_0xd611('0x30')]);_0x1f5c45[_0xd611('0x34')]=_[_0xd611('0x33')](_0x27bf3d['model'],qs[_0xd611('0x35')](_0x5c8716['query'][_0xd611('0x35')]));_0x1f5c45['attributes']=_0x1f5c45[_0xd611('0x34')][_0xd611('0x43')]?_0x1f5c45['attributes']:_0x27bf3d[_0xd611('0x2f')];_0x1f5c45[_0xd611('0x37')]=qs[_0xd611('0x38')](_0x5c8716['query'][_0xd611('0x38')]);_0x1f5c45[_0xd611('0x39')]=qs[_0xd611('0x32')](_[_0xd611('0x4a')](_0x5c8716[_0xd611('0x30')],_0x27bf3d[_0xd611('0x32')]));if(_0x5c8716[_0xd611('0x30')][_0xd611('0x3a')]){_0x1f5c45['where']=_[_0xd611('0x3b')](_0x1f5c45['where'],{'$or':_[_0xd611('0x2a')](_0x1f5c45[_0xd611('0x34')],function(_0x315293){var _0x42dcd8={};_0x42dcd8[_0x315293]={'$like':'%'+_0x5c8716[_0xd611('0x30')]['filter']+'%'};return _0x42dcd8;})});}_0x1f5c45=_['merge']({},_0x1f5c45,_0x5c8716[_0xd611('0x4b')]);return _0x3bd720[_0xd611('0x4e')](_0x1f5c45);}})[_0xd611('0x23')](function(_0x22abc0){if(_0x22abc0){_0x314405=_0x22abc0['length'];if(!_0x5c8716[_0xd611('0x30')][_0xd611('0x36')]('nolimit')){_0x1f5c45[_0xd611('0x1b')]=qs['limit'](_0x5c8716[_0xd611('0x30')]['limit']);_0x1f5c45[_0xd611('0x19')]=qs[_0xd611('0x19')](_0x5c8716['query'][_0xd611('0x19')]);}return _0x3bd720[_0xd611('0x4e')](_0x1f5c45);}})['then'](function(_0x34b745){if(_0x34b745){return _0x34b745?{'count':_0x314405,'rows':_0x34b745}:null;}})[_0xd611('0x23')](respondWithResult(_0x523abe,null))[_0xd611('0x41')](handleError(_0x523abe,null));};exports[_0xd611('0x4f')]=function(_0x2f30b8,_0x2e640b,_0x2b1601){var _0x317043={};var _0x2adce6={};var _0x1b5a0b;var _0x38307a;return db[_0xd611('0x3d')][_0xd611('0x49')]({'where':{'id':_0x2f30b8['params']['id']}})[_0xd611('0x23')](handleEntityNotFound(_0x2e640b,null))[_0xd611('0x23')](function(_0x561d5e){if(_0x561d5e){_0x1b5a0b=_0x561d5e;_0x2adce6[_0xd611('0x2f')]=_[_0xd611('0x31')](db[_0xd611('0x4d')][_0xd611('0x2b')]);_0x2adce6[_0xd611('0x30')]=_[_0xd611('0x31')](_0x2f30b8['query']);_0x2adce6[_0xd611('0x32')]=_[_0xd611('0x33')](_0x2adce6[_0xd611('0x2f')],_0x2adce6[_0xd611('0x30')]);_0x317043[_0xd611('0x34')]=_['intersection'](_0x2adce6[_0xd611('0x2f')],qs[_0xd611('0x35')](_0x2f30b8[_0xd611('0x30')][_0xd611('0x35')]));_0x317043[_0xd611('0x34')]=_0x317043[_0xd611('0x34')][_0xd611('0x43')]?_0x317043['attributes']:_0x2adce6[_0xd611('0x2f')];_0x317043[_0xd611('0x37')]=qs[_0xd611('0x38')](_0x2f30b8['query'][_0xd611('0x38')]);_0x317043[_0xd611('0x39')]=qs[_0xd611('0x32')](_[_0xd611('0x4a')](_0x2f30b8['query'],_0x2adce6[_0xd611('0x32')]));if(_0x2f30b8[_0xd611('0x30')][_0xd611('0x3a')]){_0x317043[_0xd611('0x39')]=_[_0xd611('0x3b')](_0x317043[_0xd611('0x39')],{'$or':_[_0xd611('0x2a')](_0x317043['attributes'],function(_0x10b4cf){var _0x56189b={};_0x56189b[_0x10b4cf]={'$like':'%'+_0x2f30b8[_0xd611('0x30')][_0xd611('0x3a')]+'%'};return _0x56189b;})});}_0x317043=_['merge']({},_0x317043,_0x2f30b8[_0xd611('0x4b')]);return _0x1b5a0b[_0xd611('0x4f')](_0x317043);}})[_0xd611('0x23')](function(_0x1d49c3){if(_0x1d49c3){_0x38307a=_0x1d49c3[_0xd611('0x43')];if(!_0x2f30b8[_0xd611('0x30')][_0xd611('0x36')](_0xd611('0x4c'))){_0x317043[_0xd611('0x1b')]=qs[_0xd611('0x1b')](_0x2f30b8['query'][_0xd611('0x1b')]);_0x317043['offset']=qs['offset'](_0x2f30b8[_0xd611('0x30')][_0xd611('0x19')]);}return _0x1b5a0b[_0xd611('0x4f')](_0x317043);}})['then'](function(_0x50d4c0){if(_0x50d4c0){return _0x50d4c0?{'count':_0x38307a,'rows':_0x50d4c0}:null;}})[_0xd611('0x23')](respondWithResult(_0x2e640b,null))[_0xd611('0x41')](handleError(_0x2e640b,null));};
\ No newline at end of file
index 8bb893d..0cb1b23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e69=['exports','define','ZohoConfiguration','lodash','../../config/logger','api','bluebird','path','rimraf','./intZohoConfiguration.attributes'];(function(_0x4f34d8,_0x40f022){var _0xc97536=function(_0xef9dfc){while(--_0xef9dfc){_0x4f34d8['push'](_0x4f34d8['shift']());}};_0xc97536(++_0x40f022);}(_0x6e69,0x189));var _0x96e6=function(_0x4fd33e,_0x589b5d){_0x4fd33e=_0x4fd33e-0x0;var _0x23681c=_0x6e69[_0x4fd33e];return _0x23681c;};'use strict';var _=require(_0x96e6('0x0'));var util=require('util');var logger=require(_0x96e6('0x1'))(_0x96e6('0x2'));var moment=require('moment');var BPromise=require(_0x96e6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96e6('0x4'));var rimraf=require(_0x96e6('0x5'));var config=require('../../config/environment');var attributes=require(_0x96e6('0x6'));module[_0x96e6('0x7')]=function(_0x3198fa,_0xa185c9){return _0x3198fa[_0x96e6('0x8')](_0x96e6('0x9'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd4b9=['exports','ZohoConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xd4b9,0x6e));var _0x9d4b=function(_0x1370c3,_0x27a64c){_0x1370c3=_0x1370c3-0x0;var _0x4c0b68=_0xd4b9[_0x1370c3];return _0x4c0b68;};'use strict';var _=require(_0x9d4b('0x0'));var util=require(_0x9d4b('0x1'));var logger=require(_0x9d4b('0x2'))(_0x9d4b('0x3'));var moment=require(_0x9d4b('0x4'));var BPromise=require(_0x9d4b('0x5'));var rp=require(_0x9d4b('0x6'));var fs=require('fs');var path=require(_0x9d4b('0x7'));var rimraf=require(_0x9d4b('0x8'));var config=require(_0x9d4b('0x9'));var attributes=require('./intZohoConfiguration.attributes');module[_0x9d4b('0xa')]=function(_0x53693a,_0x54b7bd){return _0x53693a['define'](_0x9d4b('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 48ffcad..49701d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa74f=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x323da6,_0x5e8ff3){var _0x16a22b=function(_0x5e0bda){while(--_0x5e0bda){_0x323da6['push'](_0x323da6['shift']());}};_0x16a22b(++_0x5e8ff3);}(_0xa74f,0x1e2));var _0xfa74=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xa74f[_0x15876a];return _0xbd900f;};'use strict';var _=require(_0xfa74('0x0'));var util=require(_0xfa74('0x1'));var moment=require('moment');var BPromise=require(_0xfa74('0x2'));var rs=require(_0xfa74('0x3'));var fs=require('fs');var Redis=require(_0xfa74('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa74('0x5'));var logger=require(_0xfa74('0x6'))('rpc');var config=require(_0xfa74('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfa74('0x8')][_0xfa74('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdaa65f,_0x4c37c0,_0x1bed8f){return new BPromise(function(_0x1595ed,_0xfc3a47){return client[_0xfa74('0xa')](_0xdaa65f,_0x1bed8f)[_0xfa74('0xb')](function(_0x78c8ae){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x4c37c0,_0xfa74('0xc'));logger[_0xfa74('0xd')](_0xfa74('0xe'),_0x4c37c0,_0xfa74('0xc'),JSON[_0xfa74('0xf')](_0x78c8ae));if(_0x78c8ae[_0xfa74('0x10')]){if(_0x78c8ae[_0xfa74('0x10')][_0xfa74('0x11')]===0x1f4){logger[_0xfa74('0x10')](_0xfa74('0x12'),_0x4c37c0,_0x78c8ae[_0xfa74('0x10')][_0xfa74('0x13')]);return _0xfc3a47(_0x78c8ae[_0xfa74('0x10')][_0xfa74('0x13')]);}logger[_0xfa74('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x4c37c0,_0x78c8ae[_0xfa74('0x10')][_0xfa74('0x13')]);return _0x1595ed(_0x78c8ae[_0xfa74('0x10')][_0xfa74('0x13')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x4c37c0,'request\x20sent');_0x1595ed(_0x78c8ae[_0xfa74('0x14')][_0xfa74('0x13')]);}})[_0xfa74('0x15')](function(_0x101f15){logger[_0xfa74('0x10')](_0xfa74('0x12'),_0x4c37c0,_0x101f15);_0xfc3a47(_0x101f15);});});}
\ No newline at end of file
+var _0x79e4=['info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x243ecd,_0x5d27ee){var _0x5e33df=function(_0x222ccb){while(--_0x222ccb){_0x243ecd['push'](_0x243ecd['shift']());}};_0x5e33df(++_0x5d27ee);}(_0x79e4,0x1ed));var _0x479e=function(_0x1dd6df,_0x5dd0bc){_0x1dd6df=_0x1dd6df-0x0;var _0x469f26=_0x79e4[_0x1dd6df];return _0x469f26;};'use strict';var _=require(_0x479e('0x0'));var util=require('util');var moment=require(_0x479e('0x1'));var BPromise=require(_0x479e('0x2'));var rs=require(_0x479e('0x3'));var fs=require('fs');var Redis=require(_0x479e('0x4'));var db=require(_0x479e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x479e('0x6'))('rpc');var config=require(_0x479e('0x7'));var jayson=require(_0x479e('0x8'));var client=jayson[_0x479e('0x9')][_0x479e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25526a,_0x230a4a,_0x3108ca){return new BPromise(function(_0x10c34d,_0x157be4){return client[_0x479e('0xb')](_0x25526a,_0x3108ca)[_0x479e('0xc')](function(_0xfa87d6){logger[_0x479e('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x230a4a,_0x479e('0xe'));logger[_0x479e('0xf')](_0x479e('0x10'),_0x230a4a,'request\x20sent',JSON[_0x479e('0x11')](_0xfa87d6));if(_0xfa87d6['error']){if(_0xfa87d6[_0x479e('0x12')][_0x479e('0x13')]===0x1f4){logger[_0x479e('0x12')](_0x479e('0x14'),_0x230a4a,_0xfa87d6[_0x479e('0x12')]['message']);return _0x157be4(_0xfa87d6[_0x479e('0x12')][_0x479e('0x15')]);}logger[_0x479e('0x12')](_0x479e('0x14'),_0x230a4a,_0xfa87d6[_0x479e('0x12')][_0x479e('0x15')]);return _0x10c34d(_0xfa87d6[_0x479e('0x12')][_0x479e('0x15')]);}else{logger[_0x479e('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x230a4a,_0x479e('0xe'));_0x10c34d(_0xfa87d6[_0x479e('0x16')][_0x479e('0x15')]);}})['catch'](function(_0x4e2f12){logger[_0x479e('0x12')](_0x479e('0x14'),_0x230a4a,_0x4e2f12);_0x157be4(_0x4e2f12);});});}
\ No newline at end of file
index b00fe87..8e100ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdac5=['/:id','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x31d7e8,_0x3d4f67){var _0x1eae7a=function(_0x2492c3){while(--_0x2492c3){_0x31d7e8['push'](_0x31d7e8['shift']());}};_0x1eae7a(++_0x3d4f67);}(_0xdac5,0x124));var _0x5dac=function(_0x257386,_0xee7454){_0x257386=_0x257386-0x0;var _0x700eff=_0xdac5[_0x257386];return _0x700eff;};'use strict';var multer=require(_0x5dac('0x0'));var util=require(_0x5dac('0x1'));var path=require(_0x5dac('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5dac('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5dac('0x4'));var config=require(_0x5dac('0x5'));var controller=require('./intZohoField.controller');router[_0x5dac('0x6')]('/',auth[_0x5dac('0x7')](),controller['index']);router[_0x5dac('0x6')](_0x5dac('0x8'),auth[_0x5dac('0x7')](),controller['show']);router['post']('/',auth[_0x5dac('0x7')](),controller[_0x5dac('0x9')]);router[_0x5dac('0xa')]('/:id',auth[_0x5dac('0x7')](),controller[_0x5dac('0xb')]);router[_0x5dac('0xc')]('/:id',auth[_0x5dac('0x7')](),controller[_0x5dac('0xd')]);module[_0x5dac('0xe')]=router;
\ No newline at end of file
+var _0xc648=['delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x3d33f6,_0x2b05ed){var _0x3080b2=function(_0x1487be){while(--_0x1487be){_0x3d33f6['push'](_0x3d33f6['shift']());}};_0x3080b2(++_0x2b05ed);}(_0xc648,0x1b8));var _0x8c64=function(_0x1a613d,_0x52736f){_0x1a613d=_0x1a613d-0x0;var _0x1a49d4=_0xc648[_0x1a613d];return _0x1a49d4;};'use strict';var multer=require(_0x8c64('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8c64('0x1'));var express=require('express');var router=express[_0x8c64('0x2')]();var fs_extra=require(_0x8c64('0x3'));var auth=require(_0x8c64('0x4'));var interaction=require(_0x8c64('0x5'));var config=require(_0x8c64('0x6'));var controller=require('./intZohoField.controller');router[_0x8c64('0x7')]('/',auth['isAuthenticated'](),controller[_0x8c64('0x8')]);router[_0x8c64('0x7')](_0x8c64('0x9'),auth[_0x8c64('0xa')](),controller[_0x8c64('0xb')]);router[_0x8c64('0xc')]('/',auth[_0x8c64('0xa')](),controller[_0x8c64('0xd')]);router[_0x8c64('0xe')](_0x8c64('0x9'),auth[_0x8c64('0xa')](),controller[_0x8c64('0xf')]);router[_0x8c64('0x10')](_0x8c64('0x9'),auth[_0x8c64('0xa')](),controller[_0x8c64('0x11')]);module[_0x8c64('0x12')]=router;
\ No newline at end of file
index dc162c8..349635c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef8a=['ENUM','string','variable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x1edf2a,_0x55c423){var _0x5698f0=function(_0x237e51){while(--_0x237e51){_0x1edf2a['push'](_0x1edf2a['shift']());}};_0x5698f0(++_0x55c423);}(_0xef8a,0xa0));var _0xaef8=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xef8a[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require(_0xaef8('0x0'));module['exports']={'type':{'type':Sequelize[_0xaef8('0x1')](_0xaef8('0x2'),_0xaef8('0x3'),'customVariable','keyValue',_0xaef8('0x4')),'defaultValue':_0xaef8('0x2')},'content':{'type':Sequelize[_0xaef8('0x5')]},'key':{'type':Sequelize[_0xaef8('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xaef8('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xaef8('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaef8('0x5')]},'customField':{'type':Sequelize[_0xaef8('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaef8('0x5')]}};
\ No newline at end of file
+var _0x559e=['exports','ENUM','string','variable','keyValue','picklist','STRING','sequelize'];(function(_0x2c50b7,_0x7604fb){var _0x46b5a9=function(_0x4a5ba3){while(--_0x4a5ba3){_0x2c50b7['push'](_0x2c50b7['shift']());}};_0x46b5a9(++_0x7604fb);}(_0x559e,0x67));var _0xe559=function(_0x217831,_0x4ab3ec){_0x217831=_0x217831-0x0;var _0x9fd488=_0x559e[_0x217831];return _0x9fd488;};'use strict';var Sequelize=require(_0xe559('0x0'));module[_0xe559('0x1')]={'type':{'type':Sequelize[_0xe559('0x2')](_0xe559('0x3'),_0xe559('0x4'),'customVariable',_0xe559('0x5'),_0xe559('0x6')),'defaultValue':_0xe559('0x3')},'content':{'type':Sequelize[_0xe559('0x7')]},'key':{'type':Sequelize[_0xe559('0x7')]},'keyType':{'type':Sequelize[_0xe559('0x2')](_0xe559('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe559('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe559('0x7')]}};
\ No newline at end of file
index d18de52..39871e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a9e=['index','map','fieldName','type','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','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','status','end','json','offset','undefined','count','limit','reject','save','then','destroy','sendStatus','error','name'];(function(_0xeb642d,_0x42f1fd){var _0x264c7d=function(_0x5e8965){while(--_0x5e8965){_0xeb642d['push'](_0xeb642d['shift']());}};_0x264c7d(++_0x42f1fd);}(_0x4a9e,0x18d));var _0xe4a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4a9e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe4a9('0x0'));var rimraf=require(_0xe4a9('0x1'));var zipdir=require(_0xe4a9('0x2'));var jsonpatch=require(_0xe4a9('0x3'));var rp=require(_0xe4a9('0x4'));var moment=require('moment');var BPromise=require(_0xe4a9('0x5'));var Mustache=require(_0xe4a9('0x6'));var util=require(_0xe4a9('0x7'));var path=require(_0xe4a9('0x8'));var sox=require(_0xe4a9('0x9'));var csv=require(_0xe4a9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4a9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe4a9('0xc'));var deskjs=require(_0xe4a9('0xd'));var toCsv=require(_0xe4a9('0xa'));var querystring=require(_0xe4a9('0xe'));var Papa=require(_0xe4a9('0xf'));var Redis=require(_0xe4a9('0x10'));var authService=require(_0xe4a9('0x11'));var qs=require(_0xe4a9('0x12'));var as=require(_0xe4a9('0x13'));var hardwareService=require(_0xe4a9('0x14'));var logger=require(_0xe4a9('0x15'))(_0xe4a9('0x16'));var utils=require(_0xe4a9('0x17'));var config=require(_0xe4a9('0x18'));var licenseUtil=require(_0xe4a9('0x19'));var db=require(_0xe4a9('0x1a'))['db'];function respondWithStatusCode(_0x507c7b,_0x5a0655){_0x5a0655=_0x5a0655||0xcc;return function(_0x4c8e34){if(_0x4c8e34){return _0x507c7b['sendStatus'](_0x5a0655);}return _0x507c7b[_0xe4a9('0x1b')](_0x5a0655)[_0xe4a9('0x1c')]();};}function respondWithResult(_0x48aa49,_0x84aadf){_0x84aadf=_0x84aadf||0xc8;return function(_0x1a8751){if(_0x1a8751){return _0x48aa49[_0xe4a9('0x1b')](_0x84aadf)[_0xe4a9('0x1d')](_0x1a8751);}};}function respondWithFilteredResult(_0x52ddb8,_0xcce91e){return function(_0x31f598){if(_0x31f598){var _0x46ae10=typeof _0xcce91e[_0xe4a9('0x1e')]===_0xe4a9('0x1f')&&typeof _0xcce91e['limit']==='undefined';var _0x52602e=_0x31f598[_0xe4a9('0x20')];var _0x42cd00=_0x46ae10?0x0:_0xcce91e['offset'];var _0x1b2cf8=_0x46ae10?_0x31f598[_0xe4a9('0x20')]:_0xcce91e[_0xe4a9('0x1e')]+_0xcce91e[_0xe4a9('0x21')];var _0x547f04;if(_0x1b2cf8>=_0x52602e){_0x1b2cf8=_0x52602e;_0x547f04=0xc8;}else{_0x547f04=0xce;}_0x52ddb8[_0xe4a9('0x1b')](_0x547f04);return _0x52ddb8['set']('Content-Range',_0x42cd00+'-'+_0x1b2cf8+'/'+_0x52602e)['json'](_0x31f598);}return null;};}function patchUpdates(_0x458562){return function(_0x19f2cb){try{jsonpatch['apply'](_0x19f2cb,_0x458562,!![]);}catch(_0x3230f9){return BPromise[_0xe4a9('0x22')](_0x3230f9);}return _0x19f2cb[_0xe4a9('0x23')]();};}function saveUpdates(_0x593836,_0x2b0e4a){return function(_0x40114a){if(_0x40114a){return _0x40114a['update'](_0x593836)[_0xe4a9('0x24')](function(_0xf6f85e){return _0xf6f85e;});}return null;};}function removeEntity(_0x5868fe,_0x5c55b7){return function(_0x160d44){if(_0x160d44){return _0x160d44[_0xe4a9('0x25')]()[_0xe4a9('0x24')](function(){_0x5868fe[_0xe4a9('0x1b')](0xcc)[_0xe4a9('0x1c')]();});}};}function handleEntityNotFound(_0x5c397f,_0x2f46e0){return function(_0x221e9b){if(!_0x221e9b){_0x5c397f[_0xe4a9('0x26')](0x194);}return _0x221e9b;};}function handleError(_0x3c3c6a,_0xa3abba){_0xa3abba=_0xa3abba||0x1f4;return function(_0x193ac8){logger[_0xe4a9('0x27')](_0x193ac8['stack']);if(_0x193ac8[_0xe4a9('0x28')]){delete _0x193ac8[_0xe4a9('0x28')];}_0x3c3c6a[_0xe4a9('0x1b')](_0xa3abba)['send'](_0x193ac8);};}exports[_0xe4a9('0x29')]=function(_0xc336d1,_0x41ac45){var _0x4ad3db={},_0x36669c={},_0x2b8168={'count':0x0,'rows':[]};var _0x599809=_[_0xe4a9('0x2a')](db['ZohoField']['rawAttributes'],function(_0x209006){return{'name':_0x209006[_0xe4a9('0x2b')],'type':_0x209006[_0xe4a9('0x2c')]['key']};});_0x36669c['model']=_['map'](_0x599809,_0xe4a9('0x28'));_0x36669c[_0xe4a9('0x2d')]=_['keys'](_0xc336d1[_0xe4a9('0x2d')]);_0x36669c[_0xe4a9('0x2e')]=_[_0xe4a9('0x2f')](_0x36669c[_0xe4a9('0x30')],_0x36669c[_0xe4a9('0x2d')]);_0x4ad3db['attributes']=_[_0xe4a9('0x2f')](_0x36669c[_0xe4a9('0x30')],qs[_0xe4a9('0x31')](_0xc336d1[_0xe4a9('0x2d')][_0xe4a9('0x31')]));_0x4ad3db[_0xe4a9('0x32')]=_0x4ad3db[_0xe4a9('0x32')][_0xe4a9('0x33')]?_0x4ad3db['attributes']:_0x36669c[_0xe4a9('0x30')];if(!_0xc336d1[_0xe4a9('0x2d')]['hasOwnProperty'](_0xe4a9('0x34'))){_0x4ad3db[_0xe4a9('0x21')]=qs[_0xe4a9('0x21')](_0xc336d1[_0xe4a9('0x2d')]['limit']);_0x4ad3db[_0xe4a9('0x1e')]=qs[_0xe4a9('0x1e')](_0xc336d1['query'][_0xe4a9('0x1e')]);}_0x4ad3db['order']=qs[_0xe4a9('0x35')](_0xc336d1[_0xe4a9('0x2d')][_0xe4a9('0x35')]);_0x4ad3db[_0xe4a9('0x36')]=qs[_0xe4a9('0x2e')](_[_0xe4a9('0x37')](_0xc336d1[_0xe4a9('0x2d')],_0x36669c[_0xe4a9('0x2e')]),_0x599809);if(_0xc336d1[_0xe4a9('0x2d')][_0xe4a9('0x38')]){_0x4ad3db[_0xe4a9('0x36')]=_['merge'](_0x4ad3db[_0xe4a9('0x36')],{'$or':_[_0xe4a9('0x2a')](_0x599809,function(_0x2f9a8f){if(_0x2f9a8f['type']!==_0xe4a9('0x39')){var _0x7bdf5d={};_0x7bdf5d[_0x2f9a8f[_0xe4a9('0x28')]]={'$like':'%'+_0xc336d1[_0xe4a9('0x2d')][_0xe4a9('0x38')]+'%'};return _0x7bdf5d;}})});}_0x4ad3db=_['merge']({},_0x4ad3db,_0xc336d1[_0xe4a9('0x3a')]);var _0x279ba2={'where':_0x4ad3db[_0xe4a9('0x36')]};return db[_0xe4a9('0x3b')]['count'](_0x279ba2)[_0xe4a9('0x24')](function(_0x364cfa){_0x2b8168[_0xe4a9('0x20')]=_0x364cfa;if(_0xc336d1[_0xe4a9('0x2d')][_0xe4a9('0x3c')]){_0x4ad3db[_0xe4a9('0x3d')]=[{'all':!![]}];}return db[_0xe4a9('0x3b')][_0xe4a9('0x3e')](_0x4ad3db);})[_0xe4a9('0x24')](function(_0x334304){_0x2b8168[_0xe4a9('0x3f')]=_0x334304;return _0x2b8168;})[_0xe4a9('0x24')](respondWithFilteredResult(_0x41ac45,_0x4ad3db))[_0xe4a9('0x40')](handleError(_0x41ac45,null));};exports[_0xe4a9('0x41')]=function(_0x3d2e20,_0x4e5a15){var _0x4bf350={'raw':!![],'where':{'id':_0x3d2e20[_0xe4a9('0x42')]['id']}},_0x5e4f1e={};_0x5e4f1e[_0xe4a9('0x30')]=_['keys'](db['ZohoField'][_0xe4a9('0x43')]);_0x5e4f1e[_0xe4a9('0x2d')]=_['keys'](_0x3d2e20[_0xe4a9('0x2d')]);_0x5e4f1e['filters']=_[_0xe4a9('0x2f')](_0x5e4f1e[_0xe4a9('0x30')],_0x5e4f1e[_0xe4a9('0x2d')]);_0x4bf350[_0xe4a9('0x32')]=_[_0xe4a9('0x2f')](_0x5e4f1e[_0xe4a9('0x30')],qs[_0xe4a9('0x31')](_0x3d2e20[_0xe4a9('0x2d')][_0xe4a9('0x31')]));_0x4bf350[_0xe4a9('0x32')]=_0x4bf350['attributes'][_0xe4a9('0x33')]?_0x4bf350[_0xe4a9('0x32')]:_0x5e4f1e['model'];if(_0x3d2e20[_0xe4a9('0x2d')][_0xe4a9('0x3c')]){_0x4bf350['include']=[{'all':!![]}];}_0x4bf350=_[_0xe4a9('0x44')]({},_0x4bf350,_0x3d2e20['options']);return db[_0xe4a9('0x3b')][_0xe4a9('0x45')](_0x4bf350)[_0xe4a9('0x24')](handleEntityNotFound(_0x4e5a15,null))[_0xe4a9('0x24')](respondWithResult(_0x4e5a15,null))[_0xe4a9('0x40')](handleError(_0x4e5a15,null));};exports[_0xe4a9('0x46')]=function(_0x5f0ea6,_0x5af08e){return db['ZohoField'][_0xe4a9('0x46')](_0x5f0ea6[_0xe4a9('0x47')],{})['then'](respondWithResult(_0x5af08e,0xc9))['catch'](handleError(_0x5af08e,null));};exports[_0xe4a9('0x48')]=function(_0x10c4ae,_0xca53e7){if(_0x10c4ae[_0xe4a9('0x47')]['id']){delete _0x10c4ae[_0xe4a9('0x47')]['id'];}return db[_0xe4a9('0x3b')]['find']({'where':{'id':_0x10c4ae['params']['id']}})['then'](handleEntityNotFound(_0xca53e7,null))['then'](saveUpdates(_0x10c4ae[_0xe4a9('0x47')],null))[_0xe4a9('0x24')](respondWithResult(_0xca53e7,null))[_0xe4a9('0x40')](handleError(_0xca53e7,null));};exports[_0xe4a9('0x25')]=function(_0x338441,_0x5235cd){return db[_0xe4a9('0x3b')][_0xe4a9('0x45')]({'where':{'id':_0x338441['params']['id']}})[_0xe4a9('0x24')](handleEntityNotFound(_0x5235cd,null))[_0xe4a9('0x24')](removeEntity(_0x5235cd,null))[_0xe4a9('0x40')](handleError(_0x5235cd,null));};
\ No newline at end of file
+var _0x59ac=['set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','options','includeAll','include','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x416a4e,_0xf1817c){var _0x5cfa5a=function(_0x1a6643){while(--_0x1a6643){_0x416a4e['push'](_0x416a4e['shift']());}};_0x5cfa5a(++_0xf1817c);}(_0x59ac,0x73));var _0xc59a=function(_0x556b3b,_0x2a712c){_0x556b3b=_0x556b3b-0x0;var _0x14b11c=_0x59ac[_0x556b3b];return _0x14b11c;};'use strict';var emlformat=require(_0xc59a('0x0'));var rimraf=require(_0xc59a('0x1'));var zipdir=require(_0xc59a('0x2'));var jsonpatch=require(_0xc59a('0x3'));var rp=require(_0xc59a('0x4'));var moment=require('moment');var BPromise=require(_0xc59a('0x5'));var Mustache=require(_0xc59a('0x6'));var util=require('util');var path=require(_0xc59a('0x7'));var sox=require(_0xc59a('0x8'));var csv=require(_0xc59a('0x9'));var ejs=require(_0xc59a('0xa'));var fs=require('fs');var fs_extra=require(_0xc59a('0xb'));var _=require('lodash');var squel=require(_0xc59a('0xc'));var crypto=require('crypto');var jsforce=require(_0xc59a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc59a('0x9'));var querystring=require('querystring');var Papa=require(_0xc59a('0xe'));var Redis=require('ioredis');var authService=require(_0xc59a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc59a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc59a('0x11'))(_0xc59a('0x12'));var utils=require(_0xc59a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc59a('0x14'));var db=require(_0xc59a('0x15'))['db'];function respondWithStatusCode(_0x29296b,_0x4b3b0e){_0x4b3b0e=_0x4b3b0e||0xcc;return function(_0x3bf38e){if(_0x3bf38e){return _0x29296b['sendStatus'](_0x4b3b0e);}return _0x29296b[_0xc59a('0x16')](_0x4b3b0e)[_0xc59a('0x17')]();};}function respondWithResult(_0x2013a0,_0x4bb2d2){_0x4bb2d2=_0x4bb2d2||0xc8;return function(_0x977fe1){if(_0x977fe1){return _0x2013a0[_0xc59a('0x16')](_0x4bb2d2)[_0xc59a('0x18')](_0x977fe1);}};}function respondWithFilteredResult(_0x15558f,_0x89986c){return function(_0x216886){if(_0x216886){var _0x1a8c66=typeof _0x89986c[_0xc59a('0x19')]===_0xc59a('0x1a')&&typeof _0x89986c[_0xc59a('0x1b')]===_0xc59a('0x1a');var _0xe264c6=_0x216886[_0xc59a('0x1c')];var _0x3686f6=_0x1a8c66?0x0:_0x89986c[_0xc59a('0x19')];var _0x17f477=_0x1a8c66?_0x216886[_0xc59a('0x1c')]:_0x89986c['offset']+_0x89986c[_0xc59a('0x1b')];var _0x8ba061;if(_0x17f477>=_0xe264c6){_0x17f477=_0xe264c6;_0x8ba061=0xc8;}else{_0x8ba061=0xce;}_0x15558f['status'](_0x8ba061);return _0x15558f[_0xc59a('0x1d')](_0xc59a('0x1e'),_0x3686f6+'-'+_0x17f477+'/'+_0xe264c6)['json'](_0x216886);}return null;};}function patchUpdates(_0x152def){return function(_0x4910b3){try{jsonpatch[_0xc59a('0x1f')](_0x4910b3,_0x152def,!![]);}catch(_0x47e28e){return BPromise[_0xc59a('0x20')](_0x47e28e);}return _0x4910b3['save']();};}function saveUpdates(_0x3be146,_0x33f550){return function(_0x3d1d20){if(_0x3d1d20){return _0x3d1d20[_0xc59a('0x21')](_0x3be146)[_0xc59a('0x22')](function(_0x2cf82b){return _0x2cf82b;});}return null;};}function removeEntity(_0x57cbb5,_0x213709){return function(_0x208a40){if(_0x208a40){return _0x208a40[_0xc59a('0x23')]()[_0xc59a('0x22')](function(){_0x57cbb5[_0xc59a('0x16')](0xcc)[_0xc59a('0x17')]();});}};}function handleEntityNotFound(_0x5ae91d,_0x4142b5){return function(_0xac4f47){if(!_0xac4f47){_0x5ae91d[_0xc59a('0x24')](0x194);}return _0xac4f47;};}function handleError(_0x12d018,_0x17cfbc){_0x17cfbc=_0x17cfbc||0x1f4;return function(_0xdea542){logger['error'](_0xdea542[_0xc59a('0x25')]);if(_0xdea542[_0xc59a('0x26')]){delete _0xdea542[_0xc59a('0x26')];}_0x12d018['status'](_0x17cfbc)[_0xc59a('0x27')](_0xdea542);};}exports[_0xc59a('0x28')]=function(_0x32e936,_0x3ba9c3){var _0x47f046={},_0x480144={},_0x5253d1={'count':0x0,'rows':[]};var _0x22521f=_['map'](db[_0xc59a('0x29')][_0xc59a('0x2a')],function(_0x5f3a4c){return{'name':_0x5f3a4c[_0xc59a('0x2b')],'type':_0x5f3a4c[_0xc59a('0x2c')][_0xc59a('0x2d')]};});_0x480144[_0xc59a('0x2e')]=_[_0xc59a('0x2f')](_0x22521f,_0xc59a('0x26'));_0x480144[_0xc59a('0x30')]=_[_0xc59a('0x31')](_0x32e936[_0xc59a('0x30')]);_0x480144['filters']=_[_0xc59a('0x32')](_0x480144[_0xc59a('0x2e')],_0x480144['query']);_0x47f046[_0xc59a('0x33')]=_[_0xc59a('0x32')](_0x480144[_0xc59a('0x2e')],qs['fields'](_0x32e936[_0xc59a('0x30')][_0xc59a('0x34')]));_0x47f046[_0xc59a('0x33')]=_0x47f046[_0xc59a('0x33')][_0xc59a('0x35')]?_0x47f046['attributes']:_0x480144['model'];if(!_0x32e936[_0xc59a('0x30')][_0xc59a('0x36')](_0xc59a('0x37'))){_0x47f046[_0xc59a('0x1b')]=qs[_0xc59a('0x1b')](_0x32e936[_0xc59a('0x30')]['limit']);_0x47f046['offset']=qs['offset'](_0x32e936['query']['offset']);}_0x47f046[_0xc59a('0x38')]=qs[_0xc59a('0x39')](_0x32e936[_0xc59a('0x30')][_0xc59a('0x39')]);_0x47f046['where']=qs['filters'](_[_0xc59a('0x3a')](_0x32e936[_0xc59a('0x30')],_0x480144[_0xc59a('0x3b')]),_0x22521f);if(_0x32e936[_0xc59a('0x30')][_0xc59a('0x3c')]){_0x47f046[_0xc59a('0x3d')]=_['merge'](_0x47f046[_0xc59a('0x3d')],{'$or':_[_0xc59a('0x2f')](_0x22521f,function(_0x4269a1){if(_0x4269a1['type']!=='VIRTUAL'){var _0x1f786d={};_0x1f786d[_0x4269a1[_0xc59a('0x26')]]={'$like':'%'+_0x32e936['query'][_0xc59a('0x3c')]+'%'};return _0x1f786d;}})});}_0x47f046=_[_0xc59a('0x3e')]({},_0x47f046,_0x32e936[_0xc59a('0x3f')]);var _0x393863={'where':_0x47f046[_0xc59a('0x3d')]};return db[_0xc59a('0x29')][_0xc59a('0x1c')](_0x393863)[_0xc59a('0x22')](function(_0x20a8ee){_0x5253d1['count']=_0x20a8ee;if(_0x32e936['query'][_0xc59a('0x40')]){_0x47f046[_0xc59a('0x41')]=[{'all':!![]}];}return db[_0xc59a('0x29')]['findAll'](_0x47f046);})[_0xc59a('0x22')](function(_0x56f718){_0x5253d1['rows']=_0x56f718;return _0x5253d1;})[_0xc59a('0x22')](respondWithFilteredResult(_0x3ba9c3,_0x47f046))[_0xc59a('0x42')](handleError(_0x3ba9c3,null));};exports[_0xc59a('0x43')]=function(_0x13ccbd,_0x4e7fbc){var _0x4fb98c={'raw':!![],'where':{'id':_0x13ccbd['params']['id']}},_0xcd38a5={};_0xcd38a5[_0xc59a('0x2e')]=_[_0xc59a('0x31')](db[_0xc59a('0x29')]['rawAttributes']);_0xcd38a5[_0xc59a('0x30')]=_[_0xc59a('0x31')](_0x13ccbd['query']);_0xcd38a5[_0xc59a('0x3b')]=_['intersection'](_0xcd38a5[_0xc59a('0x2e')],_0xcd38a5[_0xc59a('0x30')]);_0x4fb98c[_0xc59a('0x33')]=_[_0xc59a('0x32')](_0xcd38a5[_0xc59a('0x2e')],qs['fields'](_0x13ccbd[_0xc59a('0x30')]['fields']));_0x4fb98c[_0xc59a('0x33')]=_0x4fb98c['attributes'][_0xc59a('0x35')]?_0x4fb98c['attributes']:_0xcd38a5['model'];if(_0x13ccbd[_0xc59a('0x30')][_0xc59a('0x40')]){_0x4fb98c[_0xc59a('0x41')]=[{'all':!![]}];}_0x4fb98c=_[_0xc59a('0x3e')]({},_0x4fb98c,_0x13ccbd[_0xc59a('0x3f')]);return db['ZohoField'][_0xc59a('0x44')](_0x4fb98c)[_0xc59a('0x22')](handleEntityNotFound(_0x4e7fbc,null))[_0xc59a('0x22')](respondWithResult(_0x4e7fbc,null))[_0xc59a('0x42')](handleError(_0x4e7fbc,null));};exports['create']=function(_0x94533c,_0x449bb5){return db[_0xc59a('0x29')][_0xc59a('0x45')](_0x94533c[_0xc59a('0x46')],{})['then'](respondWithResult(_0x449bb5,0xc9))[_0xc59a('0x42')](handleError(_0x449bb5,null));};exports[_0xc59a('0x21')]=function(_0x424f8b,_0x40f53e){if(_0x424f8b[_0xc59a('0x46')]['id']){delete _0x424f8b[_0xc59a('0x46')]['id'];}return db[_0xc59a('0x29')][_0xc59a('0x44')]({'where':{'id':_0x424f8b['params']['id']}})[_0xc59a('0x22')](handleEntityNotFound(_0x40f53e,null))[_0xc59a('0x22')](saveUpdates(_0x424f8b[_0xc59a('0x46')],null))[_0xc59a('0x22')](respondWithResult(_0x40f53e,null))[_0xc59a('0x42')](handleError(_0x40f53e,null));};exports[_0xc59a('0x23')]=function(_0xa56dc2,_0x2d025f){return db[_0xc59a('0x29')]['find']({'where':{'id':_0xa56dc2[_0xc59a('0x47')]['id']}})[_0xc59a('0x22')](handleEntityNotFound(_0x2d025f,null))[_0xc59a('0x22')](removeEntity(_0x2d025f,null))[_0xc59a('0x42')](handleError(_0x2d025f,null));};
\ No newline at end of file
index f14ef97..065ecab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','util','../../config/logger'];(function(_0x428c26,_0x44da52){var _0xe8d887=function(_0x26574a){while(--_0x26574a){_0x428c26['push'](_0x428c26['shift']());}};_0xe8d887(++_0x44da52);}(_0x57ca,0x108));var _0xa57c=function(_0x2f00a0,_0x587304){_0x2f00a0=_0x2f00a0-0x0;var _0x3c4645=_0x57ca[_0x2f00a0];return _0x3c4645;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var logger=require(_0xa57c('0x1'))('api');var moment=require(_0xa57c('0x2'));var BPromise=require(_0xa57c('0x3'));var rp=require(_0xa57c('0x4'));var fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));module[_0xa57c('0x8')]=function(_0x113dcf,_0x19473f){return _0x113dcf[_0xa57c('0x9')](_0xa57c('0xa'),attributes,{'tableName':_0xa57c('0xb'),'paranoid':![],'indexes':[{'name':_0xa57c('0xc'),'fields':['idField',_0xa57c('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xba34=['FieldId','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xba34,0x119));var _0x4ba3=function(_0x84f916,_0xfb58c){_0x84f916=_0x84f916-0x0;var _0x40cfd3=_0xba34[_0x84f916];return _0x40cfd3;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('ZohoField',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xc'),_0x4ba3('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 9409761..c5b659c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f01=['debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent'];(function(_0x2c2e84,_0x5cdedd){var _0x561bb5=function(_0x4cf3d5){while(--_0x4cf3d5){_0x2c2e84['push'](_0x2c2e84['shift']());}};_0x561bb5(++_0x5cdedd);}(_0x8f01,0x1ab));var _0x18f0=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x8f01[_0x2cef86];return _0x46dfd6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x18f0('0x0'));var BPromise=require('bluebird');var rs=require(_0x18f0('0x1'));var fs=require('fs');var Redis=require(_0x18f0('0x2'));var db=require(_0x18f0('0x3'))['db'];var utils=require(_0x18f0('0x4'));var logger=require(_0x18f0('0x5'))(_0x18f0('0x6'));var config=require(_0x18f0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x18f0('0x8')][_0x18f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdedefe,_0x2a3e99,_0x3f14a8){return new BPromise(function(_0xe21633,_0x23cfd7){return client['request'](_0xdedefe,_0x3f14a8)[_0x18f0('0xa')](function(_0x453d86){logger[_0x18f0('0xb')]('ZohoField,\x20%s,\x20%s',_0x2a3e99,_0x18f0('0xc'));logger[_0x18f0('0xd')](_0x18f0('0xe'),_0x2a3e99,_0x18f0('0xc'),JSON[_0x18f0('0xf')](_0x453d86));if(_0x453d86[_0x18f0('0x10')]){if(_0x453d86[_0x18f0('0x10')][_0x18f0('0x11')]===0x1f4){logger['error'](_0x18f0('0x12'),_0x2a3e99,_0x453d86[_0x18f0('0x10')]['message']);return _0x23cfd7(_0x453d86[_0x18f0('0x10')]['message']);}logger[_0x18f0('0x10')](_0x18f0('0x12'),_0x2a3e99,_0x453d86[_0x18f0('0x10')]['message']);return _0xe21633(_0x453d86[_0x18f0('0x10')][_0x18f0('0x13')]);}else{logger['info'](_0x18f0('0x12'),_0x2a3e99,'request\x20sent');_0xe21633(_0x453d86[_0x18f0('0x14')][_0x18f0('0x13')]);}})[_0x18f0('0x15')](function(_0x4d97e6){logger[_0x18f0('0x10')](_0x18f0('0x12'),_0x2a3e99,_0x4d97e6);_0x23cfd7(_0x4d97e6);});});}
\ No newline at end of file
+var _0x13fa=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4ffdc1,_0x5d6fe1){var _0x2c5cce=function(_0x35e643){while(--_0x35e643){_0x4ffdc1['push'](_0x4ffdc1['shift']());}};_0x2c5cce(++_0x5d6fe1);}(_0x13fa,0xf2));var _0xa13f=function(_0x4f32de,_0x5bd4a){_0x4f32de=_0x4f32de-0x0;var _0x149821=_0x13fa[_0x4f32de];return _0x149821;};'use strict';var _=require(_0xa13f('0x0'));var util=require('util');var moment=require(_0xa13f('0x1'));var BPromise=require(_0xa13f('0x2'));var rs=require(_0xa13f('0x3'));var fs=require('fs');var Redis=require(_0xa13f('0x4'));var db=require(_0xa13f('0x5'))['db'];var utils=require(_0xa13f('0x6'));var logger=require(_0xa13f('0x7'))(_0xa13f('0x8'));var config=require(_0xa13f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa13f('0xa')][_0xa13f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5da21f,_0x53a921,_0x5e1892){return new BPromise(function(_0x3ef237,_0x3f306e){return client[_0xa13f('0xc')](_0x5da21f,_0x5e1892)[_0xa13f('0xd')](function(_0x1f1df8){logger[_0xa13f('0xe')](_0xa13f('0xf'),_0x53a921,_0xa13f('0x10'));logger[_0xa13f('0x11')](_0xa13f('0x12'),_0x53a921,'request\x20sent',JSON[_0xa13f('0x13')](_0x1f1df8));if(_0x1f1df8['error']){if(_0x1f1df8[_0xa13f('0x14')]['code']===0x1f4){logger[_0xa13f('0x14')]('ZohoField,\x20%s,\x20%s',_0x53a921,_0x1f1df8[_0xa13f('0x14')][_0xa13f('0x15')]);return _0x3f306e(_0x1f1df8[_0xa13f('0x14')]['message']);}logger[_0xa13f('0x14')](_0xa13f('0xf'),_0x53a921,_0x1f1df8[_0xa13f('0x14')]['message']);return _0x3ef237(_0x1f1df8[_0xa13f('0x14')][_0xa13f('0x15')]);}else{logger['info'](_0xa13f('0xf'),_0x53a921,_0xa13f('0x10'));_0x3ef237(_0x1f1df8[_0xa13f('0x16')]['message']);}})[_0xa13f('0x17')](function(_0x593c6a){logger[_0xa13f('0x14')](_0xa13f('0xf'),_0x53a921,_0x593c6a);_0x3f306e(_0x593c6a);});});}
\ No newline at end of file
index 3da265f..170dde0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x19c67c,_0x253239){var _0x4b304b=function(_0x526156){while(--_0x526156){_0x19c67c['push'](_0x19c67c['shift']());}};_0x4b304b(++_0x253239);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'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 6da297d..85ba95d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b31=['STRING','app.js','INTEGER','state','sequelize','exports'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x3b31,0x64));var _0x13b3=function(_0x17c9c2,_0x15a877){_0x17c9c2=_0x17c9c2-0x0;var _0x9f0823=_0x3b31[_0x17c9c2];return _0x9f0823;};'use strict';var Sequelize=require(_0x13b3('0x0'));module[_0x13b3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x13b3('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x13b3('0x3')},'filename':{'type':Sequelize[_0x13b3('0x2')]},'path':{'type':Sequelize[_0x13b3('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x13b3('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x13b3('0x2')]},'state':{'type':Sequelize[_0x13b3('0x2')],'unique':_0x13b3('0x5')},'description':{'type':Sequelize[_0x13b3('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x13b3('0x2')]},'link':{'type':Sequelize[_0x13b3('0x2')],'defaultValue':'#'}};
\ No newline at end of file
+var _0x2f92=['INTEGER','BOOLEAN','state','exports','STRING','app.js'];(function(_0x36f5ed,_0x498a9c){var _0x1faea6=function(_0x47695d){while(--_0x47695d){_0x36f5ed['push'](_0x36f5ed['shift']());}};_0x1faea6(++_0x498a9c);}(_0x2f92,0x1d1));var _0x22f9=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x2f92[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require('sequelize');module[_0x22f9('0x0')]={'name':{'type':Sequelize[_0x22f9('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x22f9('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x22f9('0x2')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x22f9('0x1')]},'type':{'type':Sequelize[_0x22f9('0x1')]},'size':{'type':Sequelize[_0x22f9('0x3')]},'active':{'type':Sequelize[_0x22f9('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x22f9('0x1')]},'logo':{'type':Sequelize[_0x22f9('0x1')]},'state':{'type':Sequelize[_0x22f9('0x1')],'unique':_0x22f9('0x5')},'description':{'type':Sequelize[_0x22f9('0x1')]},'title':{'type':Sequelize[_0x22f9('0x1')]},'remoteUri':{'type':Sequelize[_0x22f9('0x1')]},'link':{'type':Sequelize[_0x22f9('0x1')],'defaultValue':'#'}};
\ No newline at end of file
index 1143a22..857b2f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781d=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','Integration','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x526f3c,_0x1caf30){var _0x3f155a=function(_0x2819c4){while(--_0x2819c4){_0x526f3c['push'](_0x526f3c['shift']());}};_0x3f155a(++_0x1caf30);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['create']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['create'](_0x13a907[_0xd781('0x44')],{})[_0xd781('0x26')](respondWithResult(_0x16d16e,0xc9))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x336d30,_0x3828ad){if(_0x336d30[_0xd781('0x44')]['id']){delete _0x336d30['body']['id'];}return db[_0xd781('0x2c')][_0xd781('0x45')]({'where':{'id':_0x336d30[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x3828ad,null))[_0xd781('0x26')](saveUpdates(_0x336d30[_0xd781('0x44')],null))['then'](respondWithResult(_0x3828ad,null))[_0xd781('0x3f')](handleError(_0x3828ad,null));};exports[_0xd781('0x25')]=function(_0x41caac,_0x207546){return db[_0xd781('0x2c')]['find']({'where':{'id':_0x41caac[_0xd781('0x41')]['id']}})['then'](handleEntityNotFound(_0x207546,null))[_0xd781('0x26')](removeEntity(_0x207546,null))['catch'](handleError(_0x207546,null));};
\ No newline at end of file
+var _0x187d=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create'];(function(_0x1f2d5e,_0x3957e0){var _0x19207f=function(_0x1cde48){while(--_0x1cde48){_0x1f2d5e['push'](_0x1f2d5e['shift']());}};_0x19207f(++_0x3957e0);}(_0x187d,0x93));var _0xd187=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x187d[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));};
\ No newline at end of file
index a1b4a5f..27cb1ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18d9=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','Integration','lodash','util','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x18d9,0x1ad));var _0x918d=function(_0x1c1351,_0x391a39){_0x1c1351=_0x1c1351-0x0;var _0x1bc19f=_0x18d9[_0x1c1351];return _0x1bc19f;};'use strict';var _=require(_0x918d('0x0'));var util=require(_0x918d('0x1'));var logger=require(_0x918d('0x2'))(_0x918d('0x3'));var moment=require(_0x918d('0x4'));var BPromise=require(_0x918d('0x5'));var rp=require(_0x918d('0x6'));var fs=require('fs');var path=require(_0x918d('0x7'));var rimraf=require(_0x918d('0x8'));var config=require(_0x918d('0x9'));var attributes=require(_0x918d('0xa'));module['exports']=function(_0x1ceac6,_0x17ee49){return _0x1ceac6['define'](_0x918d('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xee51=['request-promise','path','../../config/environment','./integration.attributes','exports','Integration','integrations','lodash','util','api','moment'];(function(_0x71fd56,_0x364076){var _0x270c03=function(_0x15a096){while(--_0x15a096){_0x71fd56['push'](_0x71fd56['shift']());}};_0x270c03(++_0x364076);}(_0xee51,0x10f));var _0x1ee5=function(_0x10cde6,_0x5c823a){_0x10cde6=_0x10cde6-0x0;var _0x1fd24e=_0xee51[_0x10cde6];return _0x1fd24e;};'use strict';var _=require(_0x1ee5('0x0'));var util=require(_0x1ee5('0x1'));var logger=require('../../config/logger')(_0x1ee5('0x2'));var moment=require(_0x1ee5('0x3'));var BPromise=require('bluebird');var rp=require(_0x1ee5('0x4'));var fs=require('fs');var path=require(_0x1ee5('0x5'));var rimraf=require('rimraf');var config=require(_0x1ee5('0x6'));var attributes=require(_0x1ee5('0x7'));module[_0x1ee5('0x8')]=function(_0x354d00,_0xcbbad){return _0x354d00['define'](_0x1ee5('0x9'),attributes,{'tableName':_0x1ee5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d401c5e..f4fafd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1afb3a,_0x3311de){_0x1afb3a=_0x1afb3a-0x0;var _0x86811d=_0xc2c7[_0x1afb3a];return _0x86811d;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});}
\ No newline at end of file
+var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2e226e,_0x9c1c6c){_0x2e226e=_0x2e226e-0x0;var _0x5df2d8=_0xc2c7[_0x2e226e];return _0x5df2d8;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});}
\ No newline at end of file
index cdae1d0..99b9422 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x23cfb5,_0x27ca11){var _0xd7c971=function(_0x43cb6e){while(--_0x43cb6e){_0x23cfb5['push'](_0x23cfb5['shift']());}};_0xd7c971(++_0x27ca11);}(_0x1261,0x144));var _0x1126=function(_0x1f1fb4,_0x15a561){_0x1f1fb4=_0x1f1fb4-0x0;var _0x12fa15=_0x1261[_0x1f1fb4];return _0x12fa15;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x12')]);module[_0x1126('0x13')]=router;
\ No newline at end of file
+var _0x896e=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x896e,0x1e9));var _0xe896=function(_0x46497e,_0x267875){_0x46497e=_0x46497e-0x0;var _0x1b9b36=_0x896e[_0x46497e];return _0x1b9b36;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['post']('/',auth[_0xe896('0xe')](),controller['create']);router[_0xe896('0x12')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router;
\ No newline at end of file
index e08ab68..229bda2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cb7=['FAILED','sequelize','exports','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','RECEIVED'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x6cb7,0x169));var _0x76cb=function(_0x295580,_0x309da0){_0x295580=_0x295580-0x0;var _0x2b563e=_0x6cb7[_0x295580];return _0x2b563e;};'use strict';var Sequelize=require(_0x76cb('0x0'));module[_0x76cb('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x76cb('0x2')]},'exitStatus':{'type':Sequelize[_0x76cb('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x76cb('0x3')]},'contacts':{'type':Sequelize[_0x76cb('0x2')]},'uniqueid':{'type':Sequelize[_0x76cb('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76cb('0x2')]},'queue':{'type':Sequelize[_0x76cb('0x2')]},'interface':{'type':Sequelize[_0x76cb('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x76cb('0x3')]},'agentcomplete':{'type':Sequelize[_0x76cb('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x76cb('0x5')]},'talktime':{'type':Sequelize[_0x76cb('0x3')]},'agentacw':{'type':Sequelize[_0x76cb('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x76cb('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x76cb('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x76cb('0x5')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x76cb('0x5')]},'lastevent':{'type':Sequelize[_0x76cb('0x2')]},'channel':{'type':Sequelize[_0x76cb('0x2')]},'channelstate':{'type':Sequelize[_0x76cb('0x3')]},'channelstatedesc':{'type':Sequelize[_0x76cb('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x76cb('0x2')]},'language':{'type':Sequelize[_0x76cb('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76cb('0x2')]},'exten':{'type':Sequelize[_0x76cb('0x2')]},'priority':{'type':Sequelize[_0x76cb('0x2')]},'destchannel':{'type':Sequelize[_0x76cb('0x2')]},'destchannelstate':{'type':Sequelize[_0x76cb('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x76cb('0x2')]},'destcalleridnum':{'type':Sequelize[_0x76cb('0x2')]},'destcalleridname':{'type':Sequelize[_0x76cb('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x76cb('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x76cb('0x2')]},'destlanguage':{'type':Sequelize[_0x76cb('0x2')]},'destaccountcode':{'type':Sequelize[_0x76cb('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x76cb('0x2')]},'destuniqueid':{'type':Sequelize[_0x76cb('0x2')]},'messageId':{'type':Sequelize[_0x76cb('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x76cb('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x76cb('0x2')]},'cc':{'type':Sequelize[_0x76cb('0x2')]},'attachment':{'type':Sequelize[_0x76cb('0x6')]},'html':{'type':Sequelize[_0x76cb('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x76cb('0x7')]('SENT','SENDING',_0x76cb('0x8'),_0x76cb('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x19b0=['FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x4f6bbd,_0x8da2c6){var _0x5da1ec=function(_0x244795){while(--_0x244795){_0x4f6bbd['push'](_0x4f6bbd['shift']());}};_0x5da1ec(++_0x8da2c6);}(_0x19b0,0x140));var _0x019b=function(_0x5db5b3,_0x16fe50){_0x5db5b3=_0x5db5b3-0x0;var _0x3ce3f5=_0x19b0[_0x5db5b3];return _0x3ce3f5;};'use strict';var Sequelize=require('sequelize');module[_0x019b('0x0')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x019b('0x1')]},'exitStatus':{'type':Sequelize[_0x019b('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x019b('0x2')]},'contacts':{'type':Sequelize[_0x019b('0x1')]},'uniqueid':{'type':Sequelize[_0x019b('0x1')]},'calleridnum':{'type':Sequelize[_0x019b('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x019b('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x019b('0x3')]},'agentconnectAt':{'type':Sequelize[_0x019b('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x019b('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x019b('0x3')]},'talktime':{'type':Sequelize[_0x019b('0x2')]},'agentacw':{'type':Sequelize[_0x019b('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x019b('0x2')]},'reason':{'type':Sequelize[_0x019b('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x019b('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x019b('0x3')]},'agentdump':{'type':Sequelize[_0x019b('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x019b('0x3')]},'lastevent':{'type':Sequelize[_0x019b('0x1')]},'channel':{'type':Sequelize[_0x019b('0x1')]},'channelstate':{'type':Sequelize[_0x019b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x019b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x019b('0x1')]},'connectedlinename':{'type':Sequelize[_0x019b('0x1')]},'language':{'type':Sequelize[_0x019b('0x1')]},'accountcode':{'type':Sequelize[_0x019b('0x1')]},'context':{'type':Sequelize[_0x019b('0x1')]},'exten':{'type':Sequelize[_0x019b('0x1')]},'priority':{'type':Sequelize[_0x019b('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x019b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x019b('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x019b('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x019b('0x1')]},'destaccountcode':{'type':Sequelize[_0x019b('0x1')]},'destcontext':{'type':Sequelize[_0x019b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x019b('0x1')]},'destuniqueid':{'type':Sequelize[_0x019b('0x1')]},'messageId':{'type':Sequelize[_0x019b('0x1')]},'inReplyTo':{'type':Sequelize[_0x019b('0x1')]},'subject':{'type':Sequelize[_0x019b('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x019b('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x019b('0x5')]},'html':{'type':Sequelize[_0x019b('0x5')]},'text':{'type':Sequelize[_0x019b('0x5')]},'status':{'type':Sequelize[_0x019b('0x6')](_0x019b('0x7'),_0x019b('0x8'),_0x019b('0x9'),_0x019b('0xa'))},'url':{'type':Sequelize[_0x019b('0x1')]},'app':{'type':Sequelize[_0x019b('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x019b('0x2')]}};
\ No newline at end of file
index f728c11..0749cf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2384=['key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','options','count','include','findAll','rows','catch','show','params','merge','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','map','IntegrationReport','rawAttributes','fieldName','type'];(function(_0x58fb4b,_0x43f45f){var _0x5d21c9=function(_0x14624b){while(--_0x14624b){_0x58fb4b['push'](_0x58fb4b['shift']());}};_0x5d21c9(++_0x43f45f);}(_0x2384,0x158));var _0x4238=function(_0x31bb62,_0x4097a1){_0x31bb62=_0x31bb62-0x0;var _0x3a03fc=_0x2384[_0x31bb62];return _0x3a03fc;};'use strict';var emlformat=require(_0x4238('0x0'));var rimraf=require(_0x4238('0x1'));var zipdir=require(_0x4238('0x2'));var jsonpatch=require(_0x4238('0x3'));var rp=require(_0x4238('0x4'));var moment=require(_0x4238('0x5'));var BPromise=require(_0x4238('0x6'));var Mustache=require(_0x4238('0x7'));var util=require(_0x4238('0x8'));var path=require(_0x4238('0x9'));var sox=require(_0x4238('0xa'));var csv=require(_0x4238('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4238('0xc'));var _=require(_0x4238('0xd'));var squel=require(_0x4238('0xe'));var crypto=require(_0x4238('0xf'));var jsforce=require(_0x4238('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4238('0x11'));var Papa=require(_0x4238('0x12'));var Redis=require(_0x4238('0x13'));var authService=require(_0x4238('0x14'));var qs=require(_0x4238('0x15'));var as=require(_0x4238('0x16'));var hardwareService=require(_0x4238('0x17'));var logger=require(_0x4238('0x18'))(_0x4238('0x19'));var utils=require(_0x4238('0x1a'));var config=require(_0x4238('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x4238('0x1c'))['db'];function respondWithStatusCode(_0x206abe,_0x60c173){_0x60c173=_0x60c173||0xcc;return function(_0x1c0b55){if(_0x1c0b55){return _0x206abe[_0x4238('0x1d')](_0x60c173);}return _0x206abe[_0x4238('0x1e')](_0x60c173)[_0x4238('0x1f')]();};}function respondWithResult(_0x3fc0b7,_0x36f39e){_0x36f39e=_0x36f39e||0xc8;return function(_0x1bc3ec){if(_0x1bc3ec){return _0x3fc0b7[_0x4238('0x1e')](_0x36f39e)[_0x4238('0x20')](_0x1bc3ec);}};}function respondWithFilteredResult(_0x2cff8d,_0x21b945){return function(_0x27f265){if(_0x27f265){var _0x569c59=typeof _0x21b945[_0x4238('0x21')]===_0x4238('0x22')&&typeof _0x21b945[_0x4238('0x23')]==='undefined';var _0x68dc54=_0x27f265['count'];var _0x2f33c5=_0x569c59?0x0:_0x21b945[_0x4238('0x21')];var _0x5615eb=_0x569c59?_0x27f265['count']:_0x21b945[_0x4238('0x21')]+_0x21b945['limit'];var _0x4439d7;if(_0x5615eb>=_0x68dc54){_0x5615eb=_0x68dc54;_0x4439d7=0xc8;}else{_0x4439d7=0xce;}_0x2cff8d['status'](_0x4439d7);return _0x2cff8d[_0x4238('0x24')](_0x4238('0x25'),_0x2f33c5+'-'+_0x5615eb+'/'+_0x68dc54)[_0x4238('0x20')](_0x27f265);}return null;};}function patchUpdates(_0x5bf155){return function(_0x32c826){try{jsonpatch[_0x4238('0x26')](_0x32c826,_0x5bf155,!![]);}catch(_0x452dca){return BPromise['reject'](_0x452dca);}return _0x32c826[_0x4238('0x27')]();};}function saveUpdates(_0x1c6268,_0x516282){return function(_0x591de9){if(_0x591de9){return _0x591de9[_0x4238('0x28')](_0x1c6268)['then'](function(_0x4abfc6){return _0x4abfc6;});}return null;};}function removeEntity(_0x54ee68,_0x272924){return function(_0x1e9391){if(_0x1e9391){return _0x1e9391[_0x4238('0x29')]()[_0x4238('0x2a')](function(){_0x54ee68['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36d552,_0x519c03){return function(_0xeee50e){if(!_0xeee50e){_0x36d552[_0x4238('0x1d')](0x194);}return _0xeee50e;};}function handleError(_0xa62a4a,_0xb367ef){_0xb367ef=_0xb367ef||0x1f4;return function(_0x27077f){logger[_0x4238('0x2b')](_0x27077f[_0x4238('0x2c')]);if(_0x27077f[_0x4238('0x2d')]){delete _0x27077f[_0x4238('0x2d')];}_0xa62a4a['status'](_0xb367ef)['send'](_0x27077f);};}exports['index']=function(_0x5dc3f1,_0x5c3a87){var _0x351340={},_0xf92db5={},_0xdbaad2={'count':0x0,'rows':[]};var _0x559af0=_[_0x4238('0x2e')](db[_0x4238('0x2f')][_0x4238('0x30')],function(_0x427acc){return{'name':_0x427acc[_0x4238('0x31')],'type':_0x427acc[_0x4238('0x32')][_0x4238('0x33')]};});_0xf92db5[_0x4238('0x34')]=_[_0x4238('0x2e')](_0x559af0,_0x4238('0x2d'));_0xf92db5[_0x4238('0x35')]=_[_0x4238('0x36')](_0x5dc3f1[_0x4238('0x35')]);_0xf92db5['filters']=_[_0x4238('0x37')](_0xf92db5[_0x4238('0x34')],_0xf92db5['query']);_0x351340[_0x4238('0x38')]=_[_0x4238('0x37')](_0xf92db5['model'],qs[_0x4238('0x39')](_0x5dc3f1[_0x4238('0x35')][_0x4238('0x39')]));_0x351340[_0x4238('0x38')]=_0x351340['attributes'][_0x4238('0x3a')]?_0x351340[_0x4238('0x38')]:_0xf92db5[_0x4238('0x34')];if(!_0x5dc3f1[_0x4238('0x35')][_0x4238('0x3b')](_0x4238('0x3c'))){_0x351340[_0x4238('0x23')]=qs[_0x4238('0x23')](_0x5dc3f1[_0x4238('0x35')][_0x4238('0x23')]);_0x351340[_0x4238('0x21')]=qs[_0x4238('0x21')](_0x5dc3f1[_0x4238('0x35')][_0x4238('0x21')]);}_0x351340['order']=qs[_0x4238('0x3d')](_0x5dc3f1[_0x4238('0x35')][_0x4238('0x3d')]);_0x351340['where']=qs[_0x4238('0x3e')](_[_0x4238('0x3f')](_0x5dc3f1[_0x4238('0x35')],_0xf92db5[_0x4238('0x3e')]),_0x559af0);if(_0x5dc3f1['query'][_0x4238('0x40')]){_0x351340['where']=_['merge'](_0x351340[_0x4238('0x41')],{'$or':_[_0x4238('0x2e')](_0x559af0,function(_0x328445){if(_0x328445[_0x4238('0x32')]!==_0x4238('0x42')){var _0x281ada={};_0x281ada[_0x328445[_0x4238('0x2d')]]={'$like':'%'+_0x5dc3f1['query']['filter']+'%'};return _0x281ada;}})});}_0x351340=_['merge']({},_0x351340,_0x5dc3f1[_0x4238('0x43')]);var _0x318d37={'where':_0x351340[_0x4238('0x41')]};return db[_0x4238('0x2f')][_0x4238('0x44')](_0x318d37)['then'](function(_0x59e37f){_0xdbaad2[_0x4238('0x44')]=_0x59e37f;if(_0x5dc3f1[_0x4238('0x35')]['includeAll']){_0x351340[_0x4238('0x45')]=[{'all':!![]}];}return db[_0x4238('0x2f')][_0x4238('0x46')](_0x351340);})['then'](function(_0x3a694e){_0xdbaad2[_0x4238('0x47')]=_0x3a694e;return _0xdbaad2;})[_0x4238('0x2a')](respondWithFilteredResult(_0x5c3a87,_0x351340))[_0x4238('0x48')](handleError(_0x5c3a87,null));};exports[_0x4238('0x49')]=function(_0x57fd0b,_0xf2a38d){var _0x33c28e={'raw':![],'where':{'id':_0x57fd0b[_0x4238('0x4a')]['id']}},_0x4f0a4b={};_0x4f0a4b[_0x4238('0x34')]=_[_0x4238('0x36')](db[_0x4238('0x2f')][_0x4238('0x30')]);_0x4f0a4b[_0x4238('0x35')]=_['keys'](_0x57fd0b['query']);_0x4f0a4b[_0x4238('0x3e')]=_['intersection'](_0x4f0a4b[_0x4238('0x34')],_0x4f0a4b[_0x4238('0x35')]);_0x33c28e['attributes']=_['intersection'](_0x4f0a4b['model'],qs[_0x4238('0x39')](_0x57fd0b['query'][_0x4238('0x39')]));_0x33c28e[_0x4238('0x38')]=_0x33c28e[_0x4238('0x38')][_0x4238('0x3a')]?_0x33c28e[_0x4238('0x38')]:_0x4f0a4b[_0x4238('0x34')];if(_0x57fd0b[_0x4238('0x35')]['includeAll']){_0x33c28e['include']=[{'all':!![]}];}_0x33c28e=_[_0x4238('0x4b')]({},_0x33c28e,_0x57fd0b[_0x4238('0x43')]);return db[_0x4238('0x2f')]['find'](_0x33c28e)[_0x4238('0x2a')](handleEntityNotFound(_0xf2a38d,null))[_0x4238('0x2a')](respondWithResult(_0xf2a38d,null))[_0x4238('0x48')](handleError(_0xf2a38d,null));};exports['create']=function(_0x2f5bfd,_0x3e21db){return db['IntegrationReport']['create'](_0x2f5bfd[_0x4238('0x4c')],{})[_0x4238('0x2a')](respondWithResult(_0x3e21db,0xc9))['catch'](handleError(_0x3e21db,null));};exports[_0x4238('0x28')]=function(_0x358a5f,_0x5426a2){if(_0x358a5f[_0x4238('0x4c')]['id']){delete _0x358a5f['body']['id'];}return db['IntegrationReport'][_0x4238('0x4d')]({'where':{'id':_0x358a5f[_0x4238('0x4a')]['id']}})[_0x4238('0x2a')](handleEntityNotFound(_0x5426a2,null))[_0x4238('0x2a')](saveUpdates(_0x358a5f[_0x4238('0x4c')],null))['then'](respondWithResult(_0x5426a2,null))[_0x4238('0x48')](handleError(_0x5426a2,null));};exports[_0x4238('0x29')]=function(_0x1a2dba,_0x2c4848){return db[_0x4238('0x2f')][_0x4238('0x4d')]({'where':{'id':_0x1a2dba['params']['id']}})['then'](handleEntityNotFound(_0x2c4848,null))[_0x4238('0x2a')](removeEntity(_0x2c4848,null))[_0x4238('0x48')](handleError(_0x2c4848,null));};exports[_0x4238('0x4e')]=function(_0x68751c,_0x12717e){return db[_0x4238('0x2f')][_0x4238('0x4e')]()['then'](respondWithResult(_0x12717e,null))[_0x4238('0x48')](handleError(_0x12717e,null));};
\ No newline at end of file
+var _0x23b9=['find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','findAll','catch','length','include'];(function(_0x308a1d,_0x3d379d){var _0x5eb875=function(_0x464dbe){while(--_0x464dbe){_0x308a1d['push'](_0x308a1d['shift']());}};_0x5eb875(++_0x3d379d);}(_0x23b9,0xe6));var _0x923b=function(_0x48b5c0,_0x429d79){_0x48b5c0=_0x48b5c0-0x0;var _0x2a6e94=_0x23b9[_0x48b5c0];return _0x2a6e94;};'use strict';var emlformat=require(_0x923b('0x0'));var rimraf=require(_0x923b('0x1'));var zipdir=require(_0x923b('0x2'));var jsonpatch=require(_0x923b('0x3'));var rp=require(_0x923b('0x4'));var moment=require(_0x923b('0x5'));var BPromise=require(_0x923b('0x6'));var Mustache=require(_0x923b('0x7'));var util=require('util');var path=require(_0x923b('0x8'));var sox=require(_0x923b('0x9'));var csv=require(_0x923b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x923b('0xb'));var _=require(_0x923b('0xc'));var squel=require('squel');var crypto=require(_0x923b('0xd'));var jsforce=require(_0x923b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x923b('0xa'));var querystring=require(_0x923b('0xf'));var Papa=require(_0x923b('0x10'));var Redis=require(_0x923b('0x11'));var authService=require(_0x923b('0x12'));var qs=require(_0x923b('0x13'));var as=require(_0x923b('0x14'));var hardwareService=require(_0x923b('0x15'));var logger=require(_0x923b('0x16'))(_0x923b('0x17'));var utils=require(_0x923b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x923b('0x19'))['db'];function respondWithStatusCode(_0x409f24,_0x4c0b15){_0x4c0b15=_0x4c0b15||0xcc;return function(_0x3ffd28){if(_0x3ffd28){return _0x409f24[_0x923b('0x1a')](_0x4c0b15);}return _0x409f24[_0x923b('0x1b')](_0x4c0b15)[_0x923b('0x1c')]();};}function respondWithResult(_0x40a79f,_0x4f5406){_0x4f5406=_0x4f5406||0xc8;return function(_0x24a2a5){if(_0x24a2a5){return _0x40a79f[_0x923b('0x1b')](_0x4f5406)[_0x923b('0x1d')](_0x24a2a5);}};}function respondWithFilteredResult(_0x21ce0c,_0x1bcaee){return function(_0x488e7f){if(_0x488e7f){var _0x300b26=typeof _0x1bcaee[_0x923b('0x1e')]===_0x923b('0x1f')&&typeof _0x1bcaee[_0x923b('0x20')]===_0x923b('0x1f');var _0x26df03=_0x488e7f[_0x923b('0x21')];var _0x5cf9ab=_0x300b26?0x0:_0x1bcaee[_0x923b('0x1e')];var _0x251f37=_0x300b26?_0x488e7f[_0x923b('0x21')]:_0x1bcaee['offset']+_0x1bcaee[_0x923b('0x20')];var _0x161eb1;if(_0x251f37>=_0x26df03){_0x251f37=_0x26df03;_0x161eb1=0xc8;}else{_0x161eb1=0xce;}_0x21ce0c['status'](_0x161eb1);return _0x21ce0c[_0x923b('0x22')](_0x923b('0x23'),_0x5cf9ab+'-'+_0x251f37+'/'+_0x26df03)[_0x923b('0x1d')](_0x488e7f);}return null;};}function patchUpdates(_0x482647){return function(_0x115b8f){try{jsonpatch[_0x923b('0x24')](_0x115b8f,_0x482647,!![]);}catch(_0x5dbec8){return BPromise['reject'](_0x5dbec8);}return _0x115b8f[_0x923b('0x25')]();};}function saveUpdates(_0x13476a,_0x3a4bd4){return function(_0x40dcf0){if(_0x40dcf0){return _0x40dcf0[_0x923b('0x26')](_0x13476a)[_0x923b('0x27')](function(_0x8cd7c3){return _0x8cd7c3;});}return null;};}function removeEntity(_0xa856ba,_0x2e4435){return function(_0x105f10){if(_0x105f10){return _0x105f10[_0x923b('0x28')]()[_0x923b('0x27')](function(){_0xa856ba[_0x923b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1362ce,_0x4ad0e7){return function(_0x5282c7){if(!_0x5282c7){_0x1362ce[_0x923b('0x1a')](0x194);}return _0x5282c7;};}function handleError(_0x321678,_0x5f530d){_0x5f530d=_0x5f530d||0x1f4;return function(_0x26a681){logger['error'](_0x26a681[_0x923b('0x29')]);if(_0x26a681[_0x923b('0x2a')]){delete _0x26a681[_0x923b('0x2a')];}_0x321678['status'](_0x5f530d)[_0x923b('0x2b')](_0x26a681);};}exports[_0x923b('0x2c')]=function(_0x1846b2,_0x3eea82){var _0x1e38c6={},_0x30d9c3={},_0x16d643={'count':0x0,'rows':[]};var _0x329ae8=_[_0x923b('0x2d')](db[_0x923b('0x2e')][_0x923b('0x2f')],function(_0x3c67b3){return{'name':_0x3c67b3[_0x923b('0x30')],'type':_0x3c67b3[_0x923b('0x31')][_0x923b('0x32')]};});_0x30d9c3[_0x923b('0x33')]=_[_0x923b('0x2d')](_0x329ae8,_0x923b('0x2a'));_0x30d9c3[_0x923b('0x34')]=_[_0x923b('0x35')](_0x1846b2[_0x923b('0x34')]);_0x30d9c3[_0x923b('0x36')]=_['intersection'](_0x30d9c3[_0x923b('0x33')],_0x30d9c3[_0x923b('0x34')]);_0x1e38c6[_0x923b('0x37')]=_[_0x923b('0x38')](_0x30d9c3[_0x923b('0x33')],qs['fields'](_0x1846b2[_0x923b('0x34')][_0x923b('0x39')]));_0x1e38c6['attributes']=_0x1e38c6['attributes']['length']?_0x1e38c6[_0x923b('0x37')]:_0x30d9c3[_0x923b('0x33')];if(!_0x1846b2[_0x923b('0x34')]['hasOwnProperty'](_0x923b('0x3a'))){_0x1e38c6[_0x923b('0x20')]=qs['limit'](_0x1846b2[_0x923b('0x34')]['limit']);_0x1e38c6['offset']=qs['offset'](_0x1846b2[_0x923b('0x34')]['offset']);}_0x1e38c6[_0x923b('0x3b')]=qs[_0x923b('0x3c')](_0x1846b2[_0x923b('0x34')]['sort']);_0x1e38c6['where']=qs[_0x923b('0x36')](_['pick'](_0x1846b2['query'],_0x30d9c3[_0x923b('0x36')]),_0x329ae8);if(_0x1846b2[_0x923b('0x34')][_0x923b('0x3d')]){_0x1e38c6[_0x923b('0x3e')]=_[_0x923b('0x3f')](_0x1e38c6[_0x923b('0x3e')],{'$or':_[_0x923b('0x2d')](_0x329ae8,function(_0x468b38){if(_0x468b38[_0x923b('0x31')]!==_0x923b('0x40')){var _0x104792={};_0x104792[_0x468b38[_0x923b('0x2a')]]={'$like':'%'+_0x1846b2['query']['filter']+'%'};return _0x104792;}})});}_0x1e38c6=_[_0x923b('0x3f')]({},_0x1e38c6,_0x1846b2['options']);var _0x498802={'where':_0x1e38c6[_0x923b('0x3e')]};return db[_0x923b('0x2e')][_0x923b('0x21')](_0x498802)[_0x923b('0x27')](function(_0x10334b){_0x16d643[_0x923b('0x21')]=_0x10334b;if(_0x1846b2[_0x923b('0x34')][_0x923b('0x41')]){_0x1e38c6['include']=[{'all':!![]}];}return db[_0x923b('0x2e')][_0x923b('0x42')](_0x1e38c6);})[_0x923b('0x27')](function(_0x6dd835){_0x16d643['rows']=_0x6dd835;return _0x16d643;})[_0x923b('0x27')](respondWithFilteredResult(_0x3eea82,_0x1e38c6))[_0x923b('0x43')](handleError(_0x3eea82,null));};exports['show']=function(_0x5a2d9e,_0x1c69b0){var _0x5bba3b={'raw':![],'where':{'id':_0x5a2d9e['params']['id']}},_0x12bb6a={};_0x12bb6a[_0x923b('0x33')]=_['keys'](db[_0x923b('0x2e')]['rawAttributes']);_0x12bb6a['query']=_['keys'](_0x5a2d9e['query']);_0x12bb6a[_0x923b('0x36')]=_['intersection'](_0x12bb6a[_0x923b('0x33')],_0x12bb6a[_0x923b('0x34')]);_0x5bba3b[_0x923b('0x37')]=_[_0x923b('0x38')](_0x12bb6a[_0x923b('0x33')],qs['fields'](_0x5a2d9e['query']['fields']));_0x5bba3b[_0x923b('0x37')]=_0x5bba3b[_0x923b('0x37')][_0x923b('0x44')]?_0x5bba3b[_0x923b('0x37')]:_0x12bb6a[_0x923b('0x33')];if(_0x5a2d9e[_0x923b('0x34')][_0x923b('0x41')]){_0x5bba3b[_0x923b('0x45')]=[{'all':!![]}];}_0x5bba3b=_[_0x923b('0x3f')]({},_0x5bba3b,_0x5a2d9e['options']);return db[_0x923b('0x2e')][_0x923b('0x46')](_0x5bba3b)[_0x923b('0x27')](handleEntityNotFound(_0x1c69b0,null))[_0x923b('0x27')](respondWithResult(_0x1c69b0,null))[_0x923b('0x43')](handleError(_0x1c69b0,null));};exports[_0x923b('0x47')]=function(_0x5609eb,_0x5ba62b){return db[_0x923b('0x2e')][_0x923b('0x47')](_0x5609eb[_0x923b('0x48')],{})['then'](respondWithResult(_0x5ba62b,0xc9))[_0x923b('0x43')](handleError(_0x5ba62b,null));};exports['update']=function(_0x2ffe93,_0x30b617){if(_0x2ffe93[_0x923b('0x48')]['id']){delete _0x2ffe93[_0x923b('0x48')]['id'];}return db[_0x923b('0x2e')][_0x923b('0x46')]({'where':{'id':_0x2ffe93[_0x923b('0x49')]['id']}})[_0x923b('0x27')](handleEntityNotFound(_0x30b617,null))['then'](saveUpdates(_0x2ffe93['body'],null))[_0x923b('0x27')](respondWithResult(_0x30b617,null))[_0x923b('0x43')](handleError(_0x30b617,null));};exports['destroy']=function(_0x7bd3a0,_0x39ef40){return db[_0x923b('0x2e')][_0x923b('0x46')]({'where':{'id':_0x7bd3a0['params']['id']}})['then'](handleEntityNotFound(_0x39ef40,null))[_0x923b('0x27')](removeEntity(_0x39ef40,null))[_0x923b('0x43')](handleError(_0x39ef40,null));};exports[_0x923b('0x4a')]=function(_0x2f4c24,_0x3aa299){return db['IntegrationReport'][_0x923b('0x4a')]()[_0x923b('0x27')](respondWithResult(_0x3aa299,null))[_0x923b('0x43')](handleError(_0x3aa299,null));};
\ No newline at end of file
index b5659bb..a4c2c54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffcd=['exports','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x2ca2af,_0x333ab2){var _0x4b21af=function(_0xdcf9ff){while(--_0xdcf9ff){_0x2ca2af['push'](_0x2ca2af['shift']());}};_0x4b21af(++_0x333ab2);}(_0xffcd,0xfa));var _0xdffc=function(_0x417ce4,_0x2c1229){_0x417ce4=_0x417ce4-0x0;var _0xa0e8df=_0xffcd[_0x417ce4];return _0xa0e8df;};'use strict';var _=require(_0xdffc('0x0'));var util=require(_0xdffc('0x1'));var logger=require(_0xdffc('0x2'))(_0xdffc('0x3'));var moment=require(_0xdffc('0x4'));var BPromise=require(_0xdffc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdffc('0x6'));var rimraf=require(_0xdffc('0x7'));var config=require(_0xdffc('0x8'));var attributes=require(_0xdffc('0x9'));module[_0xdffc('0xa')]=function(_0x10919f,_0x183446){return _0x10919f['define'](_0xdffc('0xb'),attributes,{'tableName':_0xdffc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x779f=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','lodash','util'];(function(_0x4ae452,_0x4c9a3a){var _0x2310e7=function(_0x445d6e){while(--_0x445d6e){_0x4ae452['push'](_0x4ae452['shift']());}};_0x2310e7(++_0x4c9a3a);}(_0x779f,0x153));var _0xf779=function(_0x4afafd,_0x9bd5d0){_0x4afafd=_0x4afafd-0x0;var _0x13e891=_0x779f[_0x4afafd];return _0x13e891;};'use strict';var _=require(_0xf779('0x0'));var util=require(_0xf779('0x1'));var logger=require('../../config/logger')(_0xf779('0x2'));var moment=require(_0xf779('0x3'));var BPromise=require(_0xf779('0x4'));var rp=require(_0xf779('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf779('0x6'));var config=require(_0xf779('0x7'));var attributes=require(_0xf779('0x8'));module[_0xf779('0x9')]=function(_0x4d8710,_0x302dc8){return _0x4d8710['define'](_0xf779('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d025144..6a2f7ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2446dc,_0x4b4e9f){var _0xe2a997=function(_0x4cfaea){while(--_0x4cfaea){_0x2446dc['push'](_0x2446dc['shift']());}};_0xe2a997(++_0x4b4e9f);}(_0x5fab,0x177));var _0xb5fa=function(_0x47ab21,_0x3907b6){_0x47ab21=_0x47ab21-0x0;var _0x1104e3=_0x5fab[_0x47ab21];return _0x1104e3;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
+var _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0x687b,0x14a));var _0xb687=function(_0x4ce15c,_0x1bbcbd){_0x4ce15c=_0x4ce15c-0x0;var _0x5ee259=_0x687b[_0x4ce15c];return _0x5ee259;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});}
\ No newline at end of file
index 864114a..7c292ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ec2=['/:id/sub_intervals/create_many','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','isAuthenticated','show','post','create','/:id/sub_intervals','addInterval'];(function(_0x397214,_0x32a33a){var _0x243717=function(_0x358aae){while(--_0x358aae){_0x397214['push'](_0x397214['shift']());}};_0x243717(++_0x32a33a);}(_0x6ec2,0x78));var _0x26ec=function(_0x223b93,_0x1c327e){_0x223b93=_0x223b93-0x0;var _0x4df5da=_0x6ec2[_0x223b93];return _0x4df5da;};'use strict';var multer=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var path=require(_0x26ec('0x2'));var timeout=require(_0x26ec('0x3'));var express=require(_0x26ec('0x4'));var router=express[_0x26ec('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x26ec('0x6'));var interaction=require(_0x26ec('0x7'));var config=require(_0x26ec('0x8'));var controller=require(_0x26ec('0x9'));router[_0x26ec('0xa')]('/',auth['isAuthenticated'](),controller[_0x26ec('0xb')]);router['get']('/:id',auth[_0x26ec('0xc')](),controller[_0x26ec('0xd')]);router[_0x26ec('0xa')]('/:id/sub_intervals',auth[_0x26ec('0xc')](),controller['getIntervals']);router[_0x26ec('0xe')]('/',auth[_0x26ec('0xc')](),controller[_0x26ec('0xf')]);router[_0x26ec('0xe')](_0x26ec('0x10'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x11')]);router[_0x26ec('0xe')](_0x26ec('0x12'),auth[_0x26ec('0xc')](),controller['addIntervals']);router['put'](_0x26ec('0x13'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x14')]);router[_0x26ec('0x15')](_0x26ec('0x13'),auth[_0x26ec('0xc')](),controller[_0x26ec('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x5aa1=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','update','delete','exports','multer'];(function(_0x38fdaf,_0xd55e97){var _0x1403a5=function(_0x591ec7){while(--_0x591ec7){_0x38fdaf['push'](_0x38fdaf['shift']());}};_0x1403a5(++_0xd55e97);}(_0x5aa1,0x158));var _0x15aa=function(_0x4763b6,_0x3c9b8e){_0x4763b6=_0x4763b6-0x0;var _0x55a49c=_0x5aa1[_0x4763b6];return _0x55a49c;};'use strict';var multer=require(_0x15aa('0x0'));var util=require(_0x15aa('0x1'));var path=require(_0x15aa('0x2'));var timeout=require(_0x15aa('0x3'));var express=require(_0x15aa('0x4'));var router=express['Router']();var fs_extra=require(_0x15aa('0x5'));var auth=require(_0x15aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x15aa('0x7'));var controller=require(_0x15aa('0x8'));router[_0x15aa('0x9')]('/',auth[_0x15aa('0xa')](),controller['index']);router[_0x15aa('0x9')](_0x15aa('0xb'),auth['isAuthenticated'](),controller[_0x15aa('0xc')]);router[_0x15aa('0x9')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x15aa('0xd')]);router[_0x15aa('0xe')]('/',auth[_0x15aa('0xa')](),controller[_0x15aa('0xf')]);router['post'](_0x15aa('0x10'),auth[_0x15aa('0xa')](),controller[_0x15aa('0x11')]);router[_0x15aa('0xe')](_0x15aa('0x12'),auth['isAuthenticated'](),controller[_0x15aa('0x13')]);router['put']('/:id',auth[_0x15aa('0xa')](),controller[_0x15aa('0x14')]);router[_0x15aa('0x15')](_0x15aa('0xb'),auth[_0x15aa('0xa')](),controller['destroy']);module[_0x15aa('0x16')]=router;
\ No newline at end of file
index c22ecce..438a462 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5494=['STRING','sequelize'];(function(_0x183a9c,_0x90c654){var _0x1ccf70=function(_0x5d237c){while(--_0x5d237c){_0x183a9c['push'](_0x183a9c['shift']());}};_0x1ccf70(++_0x90c654);}(_0x5494,0xa3));var _0x4549=function(_0x14d770,_0x41b389){_0x14d770=_0x14d770-0x0;var _0x4283a5=_0x5494[_0x14d770];return _0x4283a5;};'use strict';var Sequelize=require(_0x4549('0x0'));module['exports']={'name':{'type':Sequelize[_0x4549('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0xd471=['exports','STRING'];(function(_0x5e18b1,_0x1cb953){var _0x5860cc=function(_0x170d16){while(--_0x170d16){_0x5e18b1['push'](_0x5e18b1['shift']());}};_0x5860cc(++_0x1cb953);}(_0xd471,0x68));var _0x1d47=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xd471[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require('sequelize');module[_0x1d47('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1d47('0x1')]},'interval':{'type':Sequelize[_0x1d47('0x1')],'allowNull':!![]}};
\ No newline at end of file
index 96a9d12..7c2ee15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x363f=['options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack','name','send','map','Interval','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x363f,0xd8));var _0xf363=function(_0x2f85c3,_0x21e7bb){_0x2f85c3=_0x2f85c3-0x0;var _0x1eb73f=_0x363f[_0x2f85c3];return _0x1eb73f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf363('0x0'));var zipdir=require(_0xf363('0x1'));var jsonpatch=require(_0xf363('0x2'));var rp=require(_0xf363('0x3'));var moment=require(_0xf363('0x4'));var BPromise=require(_0xf363('0x5'));var Mustache=require(_0xf363('0x6'));var util=require(_0xf363('0x7'));var path=require(_0xf363('0x8'));var sox=require(_0xf363('0x9'));var csv=require('to-csv');var ejs=require(_0xf363('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf363('0xb'));var squel=require('squel');var crypto=require(_0xf363('0xc'));var jsforce=require(_0xf363('0xd'));var deskjs=require(_0xf363('0xe'));var toCsv=require(_0xf363('0xf'));var querystring=require(_0xf363('0x10'));var Papa=require(_0xf363('0x11'));var Redis=require(_0xf363('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf363('0x13'));var as=require(_0xf363('0x14'));var hardwareService=require(_0xf363('0x15'));var logger=require(_0xf363('0x16'))('api');var utils=require(_0xf363('0x17'));var config=require(_0xf363('0x18'));var licenseUtil=require(_0xf363('0x19'));var db=require(_0xf363('0x1a'))['db'];var extensions=require(_0xf363('0x1b'));function respondWithStatusCode(_0x2093e6,_0x41a653){_0x41a653=_0x41a653||0xcc;return function(_0x9925db){if(_0x9925db){return _0x2093e6[_0xf363('0x1c')](_0x41a653);}return _0x2093e6['status'](_0x41a653)[_0xf363('0x1d')]();};}function respondWithResult(_0x50afcf,_0xc26c49){_0xc26c49=_0xc26c49||0xc8;return function(_0x334cca){if(_0x334cca){return _0x50afcf[_0xf363('0x1e')](_0xc26c49)[_0xf363('0x1f')](_0x334cca);}};}function respondWithFilteredResult(_0x4454f3,_0x1a840d){return function(_0xe0ffd7){if(_0xe0ffd7){var _0x3cde45=typeof _0x1a840d['offset']==='undefined'&&typeof _0x1a840d[_0xf363('0x20')]===_0xf363('0x21');var _0x204389=_0xe0ffd7[_0xf363('0x22')];var _0x36bbe5=_0x3cde45?0x0:_0x1a840d[_0xf363('0x23')];var _0x4de305=_0x3cde45?_0xe0ffd7['count']:_0x1a840d['offset']+_0x1a840d[_0xf363('0x20')];var _0x4b6684;if(_0x4de305>=_0x204389){_0x4de305=_0x204389;_0x4b6684=0xc8;}else{_0x4b6684=0xce;}_0x4454f3['status'](_0x4b6684);return _0x4454f3['set'](_0xf363('0x24'),_0x36bbe5+'-'+_0x4de305+'/'+_0x204389)[_0xf363('0x1f')](_0xe0ffd7);}return null;};}function patchUpdates(_0x83015e){return function(_0x408337){try{jsonpatch[_0xf363('0x25')](_0x408337,_0x83015e,!![]);}catch(_0x417a40){return BPromise[_0xf363('0x26')](_0x417a40);}return _0x408337[_0xf363('0x27')]();};}function saveUpdates(_0x3e5614,_0x242d44){return function(_0x4b55b3){if(_0x4b55b3){return _0x4b55b3[_0xf363('0x28')](_0x3e5614)[_0xf363('0x29')](function(_0x2968ce){return _0x2968ce;});}return null;};}function removeEntity(_0x4e9c73,_0x3d035a){return function(_0x5dd095){if(_0x5dd095){return _0x5dd095[_0xf363('0x2a')]()[_0xf363('0x29')](function(){var _0x35740c=_0x5dd095[_0xf363('0x2b')]({'plain':!![]});var _0x1ae31a=_0xf363('0x2c');return db[_0xf363('0x2d')]['destroy']({'where':{'type':_0x1ae31a,'resourceId':_0x35740c['id']}})[_0xf363('0x29')](function(){return _0x5dd095;});})['then'](function(){_0x4e9c73[_0xf363('0x1e')](0xcc)[_0xf363('0x1d')]();});}};}function handleEntityNotFound(_0x4acd90,_0xaad49e){return function(_0x2da73c){if(!_0x2da73c){_0x4acd90[_0xf363('0x1c')](0x194);}return _0x2da73c;};}function handleError(_0x4903d9,_0x3f274e){_0x3f274e=_0x3f274e||0x1f4;return function(_0x2b4466){logger['error'](_0x2b4466[_0xf363('0x2e')]);if(_0x2b4466['name']){delete _0x2b4466[_0xf363('0x2f')];}_0x4903d9[_0xf363('0x1e')](_0x3f274e)[_0xf363('0x30')](_0x2b4466);};}exports['index']=function(_0x50b8d4,_0x2bcc2e){var _0xb5738e={},_0x563df5={},_0x284de7={'count':0x0,'rows':[]};var _0x366ced=_[_0xf363('0x31')](db[_0xf363('0x32')]['rawAttributes'],function(_0x1da860){return{'name':_0x1da860['fieldName'],'type':_0x1da860['type'][_0xf363('0x33')]};});_0x563df5['model']=_[_0xf363('0x31')](_0x366ced,_0xf363('0x2f'));_0x563df5[_0xf363('0x34')]=_[_0xf363('0x35')](_0x50b8d4['query']);_0x563df5[_0xf363('0x36')]=_['intersection'](_0x563df5[_0xf363('0x37')],_0x563df5[_0xf363('0x34')]);_0xb5738e['attributes']=_[_0xf363('0x38')](_0x563df5[_0xf363('0x37')],qs[_0xf363('0x39')](_0x50b8d4[_0xf363('0x34')][_0xf363('0x39')]));_0xb5738e[_0xf363('0x3a')]=_0xb5738e[_0xf363('0x3a')][_0xf363('0x3b')]?_0xb5738e[_0xf363('0x3a')]:_0x563df5[_0xf363('0x37')];if(!_0x50b8d4['query']['hasOwnProperty'](_0xf363('0x3c'))){_0xb5738e[_0xf363('0x20')]=qs['limit'](_0x50b8d4[_0xf363('0x34')][_0xf363('0x20')]);_0xb5738e[_0xf363('0x23')]=qs[_0xf363('0x23')](_0x50b8d4[_0xf363('0x34')]['offset']);}_0xb5738e[_0xf363('0x3d')]=qs['sort'](_0x50b8d4[_0xf363('0x34')][_0xf363('0x3e')]);_0xb5738e['where']=qs[_0xf363('0x36')](_[_0xf363('0x3f')](_0x50b8d4['query'],_0x563df5['filters']),_0x366ced);if(_0x50b8d4[_0xf363('0x34')][_0xf363('0x40')]){_0xb5738e[_0xf363('0x41')]=_['merge'](_0xb5738e[_0xf363('0x41')],{'$or':_['map'](_0x366ced,function(_0x2bd1e0){if(_0x2bd1e0[_0xf363('0x42')]!==_0xf363('0x43')){var _0x5b4cb0={};_0x5b4cb0[_0x2bd1e0[_0xf363('0x2f')]]={'$like':'%'+_0x50b8d4[_0xf363('0x34')][_0xf363('0x40')]+'%'};return _0x5b4cb0;}})});}_0xb5738e=_[_0xf363('0x44')]({},_0xb5738e,_0x50b8d4[_0xf363('0x45')]);var _0x2e2df9={'where':_0xb5738e[_0xf363('0x41')]};return db[_0xf363('0x32')][_0xf363('0x22')](_0x2e2df9)[_0xf363('0x29')](function(_0x1d7ffd){_0x284de7[_0xf363('0x22')]=_0x1d7ffd;if(_0x50b8d4[_0xf363('0x34')]['includeAll']){_0xb5738e['include']=[{'all':!![]}];}return db[_0xf363('0x32')][_0xf363('0x46')](_0xb5738e);})['then'](function(_0x5b2b9f){_0x284de7[_0xf363('0x47')]=_0x5b2b9f;return _0x284de7;})['then'](respondWithFilteredResult(_0x2bcc2e,_0xb5738e))[_0xf363('0x48')](handleError(_0x2bcc2e,null));};exports[_0xf363('0x49')]=function(_0x84dc79,_0x17617b){var _0xdf4c8c={'raw':!![],'where':{'id':_0x84dc79[_0xf363('0x4a')]['id']}},_0x288ee3={};_0x288ee3['model']=_['keys'](db[_0xf363('0x32')][_0xf363('0x4b')]);_0x288ee3[_0xf363('0x34')]=_[_0xf363('0x35')](_0x84dc79[_0xf363('0x34')]);_0x288ee3[_0xf363('0x36')]=_[_0xf363('0x38')](_0x288ee3[_0xf363('0x37')],_0x288ee3[_0xf363('0x34')]);_0xdf4c8c[_0xf363('0x3a')]=_[_0xf363('0x38')](_0x288ee3['model'],qs[_0xf363('0x39')](_0x84dc79[_0xf363('0x34')][_0xf363('0x39')]));_0xdf4c8c[_0xf363('0x3a')]=_0xdf4c8c['attributes'][_0xf363('0x3b')]?_0xdf4c8c[_0xf363('0x3a')]:_0x288ee3[_0xf363('0x37')];if(_0x84dc79[_0xf363('0x34')][_0xf363('0x4c')]){_0xdf4c8c[_0xf363('0x4d')]=[{'all':!![]}];}_0xdf4c8c=_[_0xf363('0x44')]({},_0xdf4c8c,_0x84dc79['options']);return db[_0xf363('0x32')][_0xf363('0x4e')](_0xdf4c8c)[_0xf363('0x29')](handleEntityNotFound(_0x17617b,null))[_0xf363('0x29')](respondWithResult(_0x17617b,null))[_0xf363('0x48')](handleError(_0x17617b,null));};exports[_0xf363('0x4f')]=function(_0x3a5c7f,_0x5ce3ee){return db[_0xf363('0x32')][_0xf363('0x4f')](_0x3a5c7f[_0xf363('0x50')],{})[_0xf363('0x29')](function(_0x117d28){var _0x4faa53=_0x3a5c7f[_0xf363('0x51')]['get']({'plain':!![]});if(!_0x4faa53)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4faa53[_0xf363('0x52')]===_0xf363('0x51')){var _0x3aac62=_0x117d28[_0xf363('0x2b')]({'plain':!![]});var _0x246e62=_0xf363('0x2c');return db[_0xf363('0x53')][_0xf363('0x4e')]({'where':{'name':_0x246e62,'userProfileId':_0x4faa53[_0xf363('0x54')]},'raw':!![]})[_0xf363('0x29')](function(_0x50d583){if(_0x50d583&&_0x50d583[_0xf363('0x55')]===0x0){return db[_0xf363('0x2d')][_0xf363('0x4f')]({'name':_0x3aac62[_0xf363('0x2f')],'resourceId':_0x3aac62['id'],'type':_0x50d583[_0xf363('0x2f')],'sectionId':_0x50d583['id']},{})['then'](function(){return _0x117d28;});}else{return _0x117d28;}})[_0xf363('0x48')](function(_0x5da5f0){logger['error'](_0xf363('0x56'),_0x5da5f0);throw _0x5da5f0;});}return _0x117d28;})['then'](respondWithResult(_0x5ce3ee,0xc9))[_0xf363('0x48')](handleError(_0x5ce3ee,null));};exports[_0xf363('0x28')]=function(_0x530d43,_0x2feec0){if(_0x530d43[_0xf363('0x50')]['id']){delete _0x530d43[_0xf363('0x50')]['id'];}return db[_0xf363('0x32')][_0xf363('0x4e')]({'where':{'id':_0x530d43[_0xf363('0x4a')]['id']}})[_0xf363('0x29')](handleEntityNotFound(_0x2feec0,null))[_0xf363('0x29')](saveUpdates(_0x530d43[_0xf363('0x50')],null))['then'](respondWithResult(_0x2feec0,null))[_0xf363('0x48')](handleError(_0x2feec0,null));};exports['destroy']=function(_0x46ea07,_0x559e15){return db[_0xf363('0x32')][_0xf363('0x4e')]({'where':{'id':_0x46ea07[_0xf363('0x4a')]['id']}})['then'](handleEntityNotFound(_0x559e15,null))['then'](removeEntity(_0x559e15,null))[_0xf363('0x48')](handleError(_0x559e15,null));};exports['addInterval']=function(_0x51f77e,_0x247ac0,_0x4a2e35){if(_0x51f77e[_0xf363('0x50')]['id']){delete _0x51f77e[_0xf363('0x50')]['id'];}return db[_0xf363('0x32')]['find']({'where':{'id':_0x51f77e[_0xf363('0x4a')]['id']}})[_0xf363('0x29')](handleEntityNotFound(_0x247ac0,null))[_0xf363('0x29')](function(_0x37cd05){if(_0x37cd05){_0x51f77e[_0xf363('0x50')][_0xf363('0x57')]=_0x37cd05['id'];return db['Interval']['create'](_0x51f77e['body']);}})[_0xf363('0x29')](respondWithResult(_0x247ac0,null))[_0xf363('0x48')](handleError(_0x247ac0,null));};exports[_0xf363('0x58')]=function(_0x27f0cc,_0x27db42,_0x4961e0){var _0x481133={};var _0x1e4aed={};var _0x4c62a6;var _0x19b5c3;return db[_0xf363('0x32')][_0xf363('0x59')]({'where':{'id':_0x27f0cc['params']['id']}})[_0xf363('0x29')](handleEntityNotFound(_0x27db42,null))[_0xf363('0x29')](function(_0x227f3a){if(_0x227f3a){_0x4c62a6=_0x227f3a;_0x1e4aed[_0xf363('0x37')]=_[_0xf363('0x35')](db[_0xf363('0x32')][_0xf363('0x4b')]);_0x1e4aed[_0xf363('0x34')]=_[_0xf363('0x35')](_0x27f0cc['query']);_0x1e4aed[_0xf363('0x36')]=_[_0xf363('0x38')](_0x1e4aed['model'],_0x1e4aed[_0xf363('0x34')]);_0x481133[_0xf363('0x3a')]=_[_0xf363('0x38')](_0x1e4aed[_0xf363('0x37')],qs[_0xf363('0x39')](_0x27f0cc[_0xf363('0x34')][_0xf363('0x39')]));_0x481133[_0xf363('0x3a')]=_0x481133[_0xf363('0x3a')]['length']?_0x481133[_0xf363('0x3a')]:_0x1e4aed[_0xf363('0x37')];_0x481133['order']=qs[_0xf363('0x3e')](_0x27f0cc[_0xf363('0x34')][_0xf363('0x3e')]);_0x481133[_0xf363('0x41')]=qs['filters'](_[_0xf363('0x3f')](_0x27f0cc[_0xf363('0x34')],_0x1e4aed['filters']));if(_0x27f0cc[_0xf363('0x34')][_0xf363('0x40')]){_0x481133['where']=_['merge'](_0x481133['where'],{'$or':_[_0xf363('0x31')](_0x481133['attributes'],function(_0x1a8517){var _0x14853c={};_0x14853c[_0x1a8517]={'$like':'%'+_0x27f0cc[_0xf363('0x34')][_0xf363('0x40')]+'%'};return _0x14853c;})});}_0x481133=_[_0xf363('0x44')]({},_0x481133,_0x27f0cc[_0xf363('0x45')]);return _0x4c62a6[_0xf363('0x58')](_0x481133);}})[_0xf363('0x29')](function(_0x40ab78){if(_0x40ab78){_0x19b5c3=_0x40ab78[_0xf363('0x3b')];if(!_0x27f0cc[_0xf363('0x34')][_0xf363('0x5a')](_0xf363('0x3c'))){_0x481133[_0xf363('0x20')]=qs[_0xf363('0x20')](_0x27f0cc[_0xf363('0x34')][_0xf363('0x20')]);_0x481133[_0xf363('0x23')]=qs[_0xf363('0x23')](_0x27f0cc[_0xf363('0x34')][_0xf363('0x23')]);}return _0x4c62a6[_0xf363('0x58')](_0x481133);}})['then'](function(_0xb8300){if(_0xb8300){return _0xb8300?{'count':_0x19b5c3,'rows':_0xb8300}:null;}})[_0xf363('0x29')](respondWithResult(_0x27db42,null))['catch'](handleError(_0x27db42,null));};exports[_0xf363('0x5b')]=function(_0x1658d2,_0x162e8e,_0x476caa){return db[_0xf363('0x32')][_0xf363('0x59')]({'where':{'id':_0x1658d2[_0xf363('0x4a')]['id']}})['then'](handleEntityNotFound(_0x162e8e,null))[_0xf363('0x29')](function(_0x35dcd6){if(_0x35dcd6){return db[_0xf363('0x5c')][_0xf363('0x5d')](function(_0x4e5fd0){return db['Interval'][_0xf363('0x2a')]({'where':{'IntervalId':_0x1658d2['params']['id']},'transaction':_0x4e5fd0})[_0xf363('0x29')](function(_0x4b23e7){var _0x29ea9b=_[_0xf363('0x31')](_0x1658d2[_0xf363('0x50')],function(_0x5ebb48){delete _0x5ebb48['id'];_0x5ebb48[_0xf363('0x57')]=_0x1658d2['params']['id'];return _0x5ebb48;});return db[_0xf363('0x32')][_0xf363('0x5e')](_0x29ea9b,{'transaction':_0x4e5fd0});});})['then'](function(){return db[_0xf363('0x32')]['findAll']({'where':{'IntervalId':_0x1658d2[_0xf363('0x4a')]['id']}});});}})[_0xf363('0x29')](respondWithResult(_0x162e8e,null))[_0xf363('0x48')](handleError(_0x162e8e,null));};
\ No newline at end of file
+var _0xeb2b=['Interval','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','params','addInterval','findOne','getIntervals','nolimit','sequelize','transaction','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','map'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0xeb2b,0x1eb));var _0xbeb2=function(_0x21b734,_0x5409e6){_0x21b734=_0x21b734-0x0;var _0x3d1445=_0xeb2b[_0x21b734];return _0x3d1445;};'use strict';var emlformat=require(_0xbeb2('0x0'));var rimraf=require(_0xbeb2('0x1'));var zipdir=require(_0xbeb2('0x2'));var jsonpatch=require(_0xbeb2('0x3'));var rp=require(_0xbeb2('0x4'));var moment=require(_0xbeb2('0x5'));var BPromise=require(_0xbeb2('0x6'));var Mustache=require(_0xbeb2('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbeb2('0x8'));var ejs=require(_0xbeb2('0x9'));var fs=require('fs');var fs_extra=require(_0xbeb2('0xa'));var _=require(_0xbeb2('0xb'));var squel=require(_0xbeb2('0xc'));var crypto=require(_0xbeb2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbeb2('0xe'));var toCsv=require(_0xbeb2('0x8'));var querystring=require(_0xbeb2('0xf'));var Papa=require(_0xbeb2('0x10'));var Redis=require(_0xbeb2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbeb2('0x12'));var as=require(_0xbeb2('0x13'));var hardwareService=require(_0xbeb2('0x14'));var logger=require(_0xbeb2('0x15'))(_0xbeb2('0x16'));var utils=require('../../config/utils');var config=require(_0xbeb2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbeb2('0x18'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x1db4ee,_0x475324){_0x475324=_0x475324||0xcc;return function(_0x22c837){if(_0x22c837){return _0x1db4ee[_0xbeb2('0x19')](_0x475324);}return _0x1db4ee[_0xbeb2('0x1a')](_0x475324)[_0xbeb2('0x1b')]();};}function respondWithResult(_0x475dce,_0x10b558){_0x10b558=_0x10b558||0xc8;return function(_0x165a35){if(_0x165a35){return _0x475dce[_0xbeb2('0x1a')](_0x10b558)[_0xbeb2('0x1c')](_0x165a35);}};}function respondWithFilteredResult(_0x20233c,_0x4fef2b){return function(_0x4e383a){if(_0x4e383a){var _0x85245=typeof _0x4fef2b[_0xbeb2('0x1d')]==='undefined'&&typeof _0x4fef2b[_0xbeb2('0x1e')]===_0xbeb2('0x1f');var _0x16bed0=_0x4e383a[_0xbeb2('0x20')];var _0x9285ff=_0x85245?0x0:_0x4fef2b['offset'];var _0x46b302=_0x85245?_0x4e383a[_0xbeb2('0x20')]:_0x4fef2b[_0xbeb2('0x1d')]+_0x4fef2b['limit'];var _0x5402e8;if(_0x46b302>=_0x16bed0){_0x46b302=_0x16bed0;_0x5402e8=0xc8;}else{_0x5402e8=0xce;}_0x20233c[_0xbeb2('0x1a')](_0x5402e8);return _0x20233c[_0xbeb2('0x21')]('Content-Range',_0x9285ff+'-'+_0x46b302+'/'+_0x16bed0)[_0xbeb2('0x1c')](_0x4e383a);}return null;};}function patchUpdates(_0x1e00ab){return function(_0x515fac){try{jsonpatch[_0xbeb2('0x22')](_0x515fac,_0x1e00ab,!![]);}catch(_0x4b94db){return BPromise[_0xbeb2('0x23')](_0x4b94db);}return _0x515fac[_0xbeb2('0x24')]();};}function saveUpdates(_0x63fb79,_0x282a03){return function(_0x246ded){if(_0x246ded){return _0x246ded[_0xbeb2('0x25')](_0x63fb79)[_0xbeb2('0x26')](function(_0x450753){return _0x450753;});}return null;};}function removeEntity(_0x269d5c,_0x29d00d){return function(_0x48bc41){if(_0x48bc41){return _0x48bc41[_0xbeb2('0x27')]()[_0xbeb2('0x26')](function(){var _0x4f61ff=_0x48bc41[_0xbeb2('0x28')]({'plain':!![]});var _0x17f651=_0xbeb2('0x29');return db[_0xbeb2('0x2a')][_0xbeb2('0x27')]({'where':{'type':_0x17f651,'resourceId':_0x4f61ff['id']}})['then'](function(){return _0x48bc41;});})[_0xbeb2('0x26')](function(){_0x269d5c[_0xbeb2('0x1a')](0xcc)[_0xbeb2('0x1b')]();});}};}function handleEntityNotFound(_0x1318b4,_0x4d004c){return function(_0x2ba065){if(!_0x2ba065){_0x1318b4[_0xbeb2('0x19')](0x194);}return _0x2ba065;};}function handleError(_0xa16ef8,_0x151985){_0x151985=_0x151985||0x1f4;return function(_0x455eca){logger[_0xbeb2('0x2b')](_0x455eca[_0xbeb2('0x2c')]);if(_0x455eca['name']){delete _0x455eca[_0xbeb2('0x2d')];}_0xa16ef8[_0xbeb2('0x1a')](_0x151985)[_0xbeb2('0x2e')](_0x455eca);};}exports[_0xbeb2('0x2f')]=function(_0x298519,_0xe300b2){var _0x52f533={},_0x254482={},_0x1b7207={'count':0x0,'rows':[]};var _0x5158a0=_[_0xbeb2('0x30')](db[_0xbeb2('0x31')][_0xbeb2('0x32')],function(_0x1040ae){return{'name':_0x1040ae[_0xbeb2('0x33')],'type':_0x1040ae[_0xbeb2('0x34')]['key']};});_0x254482[_0xbeb2('0x35')]=_['map'](_0x5158a0,'name');_0x254482[_0xbeb2('0x36')]=_[_0xbeb2('0x37')](_0x298519['query']);_0x254482[_0xbeb2('0x38')]=_['intersection'](_0x254482[_0xbeb2('0x35')],_0x254482[_0xbeb2('0x36')]);_0x52f533[_0xbeb2('0x39')]=_['intersection'](_0x254482['model'],qs['fields'](_0x298519['query'][_0xbeb2('0x3a')]));_0x52f533[_0xbeb2('0x39')]=_0x52f533[_0xbeb2('0x39')][_0xbeb2('0x3b')]?_0x52f533['attributes']:_0x254482['model'];if(!_0x298519['query'][_0xbeb2('0x3c')]('nolimit')){_0x52f533[_0xbeb2('0x1e')]=qs['limit'](_0x298519[_0xbeb2('0x36')][_0xbeb2('0x1e')]);_0x52f533[_0xbeb2('0x1d')]=qs[_0xbeb2('0x1d')](_0x298519[_0xbeb2('0x36')]['offset']);}_0x52f533[_0xbeb2('0x3d')]=qs[_0xbeb2('0x3e')](_0x298519[_0xbeb2('0x36')]['sort']);_0x52f533[_0xbeb2('0x3f')]=qs['filters'](_[_0xbeb2('0x40')](_0x298519[_0xbeb2('0x36')],_0x254482['filters']),_0x5158a0);if(_0x298519[_0xbeb2('0x36')]['filter']){_0x52f533[_0xbeb2('0x3f')]=_[_0xbeb2('0x41')](_0x52f533['where'],{'$or':_[_0xbeb2('0x30')](_0x5158a0,function(_0x25aff1){if(_0x25aff1[_0xbeb2('0x34')]!==_0xbeb2('0x42')){var _0x48b8b4={};_0x48b8b4[_0x25aff1[_0xbeb2('0x2d')]]={'$like':'%'+_0x298519[_0xbeb2('0x36')][_0xbeb2('0x43')]+'%'};return _0x48b8b4;}})});}_0x52f533=_[_0xbeb2('0x41')]({},_0x52f533,_0x298519[_0xbeb2('0x44')]);var _0x5dc9dd={'where':_0x52f533[_0xbeb2('0x3f')]};return db[_0xbeb2('0x31')][_0xbeb2('0x20')](_0x5dc9dd)[_0xbeb2('0x26')](function(_0x45a514){_0x1b7207[_0xbeb2('0x20')]=_0x45a514;if(_0x298519['query'][_0xbeb2('0x45')]){_0x52f533[_0xbeb2('0x46')]=[{'all':!![]}];}return db[_0xbeb2('0x31')]['findAll'](_0x52f533);})['then'](function(_0x27f31c){_0x1b7207[_0xbeb2('0x47')]=_0x27f31c;return _0x1b7207;})[_0xbeb2('0x26')](respondWithFilteredResult(_0xe300b2,_0x52f533))[_0xbeb2('0x48')](handleError(_0xe300b2,null));};exports['show']=function(_0x4b08c5,_0x3a6cd8){var _0x3e3c75={'raw':!![],'where':{'id':_0x4b08c5['params']['id']}},_0x3a88c6={};_0x3a88c6[_0xbeb2('0x35')]=_['keys'](db[_0xbeb2('0x31')][_0xbeb2('0x32')]);_0x3a88c6[_0xbeb2('0x36')]=_[_0xbeb2('0x37')](_0x4b08c5['query']);_0x3a88c6[_0xbeb2('0x38')]=_[_0xbeb2('0x49')](_0x3a88c6['model'],_0x3a88c6[_0xbeb2('0x36')]);_0x3e3c75[_0xbeb2('0x39')]=_[_0xbeb2('0x49')](_0x3a88c6[_0xbeb2('0x35')],qs[_0xbeb2('0x3a')](_0x4b08c5['query'][_0xbeb2('0x3a')]));_0x3e3c75[_0xbeb2('0x39')]=_0x3e3c75[_0xbeb2('0x39')][_0xbeb2('0x3b')]?_0x3e3c75[_0xbeb2('0x39')]:_0x3a88c6[_0xbeb2('0x35')];if(_0x4b08c5['query'][_0xbeb2('0x45')]){_0x3e3c75['include']=[{'all':!![]}];}_0x3e3c75=_[_0xbeb2('0x41')]({},_0x3e3c75,_0x4b08c5[_0xbeb2('0x44')]);return db[_0xbeb2('0x31')][_0xbeb2('0x4a')](_0x3e3c75)[_0xbeb2('0x26')](handleEntityNotFound(_0x3a6cd8,null))[_0xbeb2('0x26')](respondWithResult(_0x3a6cd8,null))[_0xbeb2('0x48')](handleError(_0x3a6cd8,null));};exports[_0xbeb2('0x4b')]=function(_0x2b2774,_0x11215a){return db['Interval'][_0xbeb2('0x4b')](_0x2b2774[_0xbeb2('0x4c')],{})[_0xbeb2('0x26')](function(_0x4e6e33){var _0x4bd844=_0x2b2774[_0xbeb2('0x4d')]['get']({'plain':!![]});if(!_0x4bd844)throw new Error(_0xbeb2('0x4e'));if(_0x4bd844[_0xbeb2('0x4f')]===_0xbeb2('0x4d')){var _0x4a33d1=_0x4e6e33[_0xbeb2('0x28')]({'plain':!![]});var _0x3381f7=_0xbeb2('0x29');return db['UserProfileSection'][_0xbeb2('0x4a')]({'where':{'name':_0x3381f7,'userProfileId':_0x4bd844['userProfileId']},'raw':!![]})[_0xbeb2('0x26')](function(_0x374699){if(_0x374699&&_0x374699[_0xbeb2('0x50')]===0x0){return db[_0xbeb2('0x2a')][_0xbeb2('0x4b')]({'name':_0x4a33d1[_0xbeb2('0x2d')],'resourceId':_0x4a33d1['id'],'type':_0x374699[_0xbeb2('0x2d')],'sectionId':_0x374699['id']},{})['then'](function(){return _0x4e6e33;});}else{return _0x4e6e33;}})[_0xbeb2('0x48')](function(_0x1e2d67){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e2d67);throw _0x1e2d67;});}return _0x4e6e33;})[_0xbeb2('0x26')](respondWithResult(_0x11215a,0xc9))['catch'](handleError(_0x11215a,null));};exports['update']=function(_0x48b67a,_0x20b9f0){if(_0x48b67a[_0xbeb2('0x4c')]['id']){delete _0x48b67a[_0xbeb2('0x4c')]['id'];}return db[_0xbeb2('0x31')][_0xbeb2('0x4a')]({'where':{'id':_0x48b67a[_0xbeb2('0x51')]['id']}})[_0xbeb2('0x26')](handleEntityNotFound(_0x20b9f0,null))[_0xbeb2('0x26')](saveUpdates(_0x48b67a[_0xbeb2('0x4c')],null))['then'](respondWithResult(_0x20b9f0,null))[_0xbeb2('0x48')](handleError(_0x20b9f0,null));};exports[_0xbeb2('0x27')]=function(_0x3b8895,_0x2765c3){return db[_0xbeb2('0x31')][_0xbeb2('0x4a')]({'where':{'id':_0x3b8895[_0xbeb2('0x51')]['id']}})[_0xbeb2('0x26')](handleEntityNotFound(_0x2765c3,null))[_0xbeb2('0x26')](removeEntity(_0x2765c3,null))[_0xbeb2('0x48')](handleError(_0x2765c3,null));};exports[_0xbeb2('0x52')]=function(_0x192a7d,_0x424088,_0x1a2f07){if(_0x192a7d[_0xbeb2('0x4c')]['id']){delete _0x192a7d[_0xbeb2('0x4c')]['id'];}return db['Interval']['find']({'where':{'id':_0x192a7d[_0xbeb2('0x51')]['id']}})[_0xbeb2('0x26')](handleEntityNotFound(_0x424088,null))[_0xbeb2('0x26')](function(_0x2fb5af){if(_0x2fb5af){_0x192a7d[_0xbeb2('0x4c')]['IntervalId']=_0x2fb5af['id'];return db[_0xbeb2('0x31')][_0xbeb2('0x4b')](_0x192a7d[_0xbeb2('0x4c')]);}})[_0xbeb2('0x26')](respondWithResult(_0x424088,null))['catch'](handleError(_0x424088,null));};exports['getIntervals']=function(_0x2fdd72,_0x16a692,_0x35fe15){var _0xa4e50e={};var _0x36e8a3={};var _0x538a1b;var _0x44480e;return db[_0xbeb2('0x31')][_0xbeb2('0x53')]({'where':{'id':_0x2fdd72['params']['id']}})['then'](handleEntityNotFound(_0x16a692,null))[_0xbeb2('0x26')](function(_0x8dccd6){if(_0x8dccd6){_0x538a1b=_0x8dccd6;_0x36e8a3[_0xbeb2('0x35')]=_[_0xbeb2('0x37')](db[_0xbeb2('0x31')][_0xbeb2('0x32')]);_0x36e8a3[_0xbeb2('0x36')]=_[_0xbeb2('0x37')](_0x2fdd72[_0xbeb2('0x36')]);_0x36e8a3[_0xbeb2('0x38')]=_[_0xbeb2('0x49')](_0x36e8a3[_0xbeb2('0x35')],_0x36e8a3[_0xbeb2('0x36')]);_0xa4e50e[_0xbeb2('0x39')]=_['intersection'](_0x36e8a3['model'],qs['fields'](_0x2fdd72['query'][_0xbeb2('0x3a')]));_0xa4e50e[_0xbeb2('0x39')]=_0xa4e50e['attributes'][_0xbeb2('0x3b')]?_0xa4e50e[_0xbeb2('0x39')]:_0x36e8a3['model'];_0xa4e50e[_0xbeb2('0x3d')]=qs[_0xbeb2('0x3e')](_0x2fdd72[_0xbeb2('0x36')][_0xbeb2('0x3e')]);_0xa4e50e[_0xbeb2('0x3f')]=qs['filters'](_[_0xbeb2('0x40')](_0x2fdd72[_0xbeb2('0x36')],_0x36e8a3[_0xbeb2('0x38')]));if(_0x2fdd72[_0xbeb2('0x36')]['filter']){_0xa4e50e['where']=_[_0xbeb2('0x41')](_0xa4e50e[_0xbeb2('0x3f')],{'$or':_[_0xbeb2('0x30')](_0xa4e50e[_0xbeb2('0x39')],function(_0x19d110){var _0x14902d={};_0x14902d[_0x19d110]={'$like':'%'+_0x2fdd72['query'][_0xbeb2('0x43')]+'%'};return _0x14902d;})});}_0xa4e50e=_['merge']({},_0xa4e50e,_0x2fdd72[_0xbeb2('0x44')]);return _0x538a1b[_0xbeb2('0x54')](_0xa4e50e);}})[_0xbeb2('0x26')](function(_0x2b3fd2){if(_0x2b3fd2){_0x44480e=_0x2b3fd2[_0xbeb2('0x3b')];if(!_0x2fdd72[_0xbeb2('0x36')]['hasOwnProperty'](_0xbeb2('0x55'))){_0xa4e50e[_0xbeb2('0x1e')]=qs[_0xbeb2('0x1e')](_0x2fdd72[_0xbeb2('0x36')][_0xbeb2('0x1e')]);_0xa4e50e[_0xbeb2('0x1d')]=qs['offset'](_0x2fdd72[_0xbeb2('0x36')]['offset']);}return _0x538a1b['getIntervals'](_0xa4e50e);}})[_0xbeb2('0x26')](function(_0x5aac5c){if(_0x5aac5c){return _0x5aac5c?{'count':_0x44480e,'rows':_0x5aac5c}:null;}})[_0xbeb2('0x26')](respondWithResult(_0x16a692,null))[_0xbeb2('0x48')](handleError(_0x16a692,null));};exports['addIntervals']=function(_0x3dcc60,_0x53dc2f,_0xe7d07d){return db[_0xbeb2('0x31')][_0xbeb2('0x53')]({'where':{'id':_0x3dcc60['params']['id']}})[_0xbeb2('0x26')](handleEntityNotFound(_0x53dc2f,null))[_0xbeb2('0x26')](function(_0x5ec659){if(_0x5ec659){return db[_0xbeb2('0x56')][_0xbeb2('0x57')](function(_0x5b3d8d){return db[_0xbeb2('0x31')][_0xbeb2('0x27')]({'where':{'IntervalId':_0x3dcc60[_0xbeb2('0x51')]['id']},'transaction':_0x5b3d8d})[_0xbeb2('0x26')](function(_0x4b6c63){var _0x1e7cf1=_['map'](_0x3dcc60['body'],function(_0x1aab61){delete _0x1aab61['id'];_0x1aab61['IntervalId']=_0x3dcc60[_0xbeb2('0x51')]['id'];return _0x1aab61;});return db['Interval'][_0xbeb2('0x58')](_0x1e7cf1,{'transaction':_0x5b3d8d});});})[_0xbeb2('0x26')](function(){return db[_0xbeb2('0x31')][_0xbeb2('0x59')]({'where':{'IntervalId':_0x3dcc60[_0xbeb2('0x51')]['id']}});});}})[_0xbeb2('0x26')](respondWithResult(_0x53dc2f,null))[_0xbeb2('0x48')](handleError(_0x53dc2f,null));};
\ No newline at end of file
index 627e555..f648582 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x554e=['path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4d7d5c,_0x19014e){var _0x4ce5f1=function(_0x36bb22){while(--_0x36bb22){_0x4d7d5c['push'](_0x4d7d5c['shift']());}};_0x4ce5f1(++_0x19014e);}(_0x554e,0x9e));var _0xe554=function(_0x48051b,_0x339115){_0x48051b=_0x48051b-0x0;var _0x2a4f6e=_0x554e[_0x48051b];return _0x2a4f6e;};'use strict';var _=require(_0xe554('0x0'));var util=require(_0xe554('0x1'));var logger=require(_0xe554('0x2'))(_0xe554('0x3'));var moment=require(_0xe554('0x4'));var BPromise=require(_0xe554('0x5'));var rp=require(_0xe554('0x6'));var fs=require('fs');var path=require(_0xe554('0x7'));var rimraf=require(_0xe554('0x8'));var config=require('../../config/environment');var attributes=require(_0xe554('0x9'));var extensions=require(_0xe554('0xa'));module[_0xe554('0xb')]=function(_0x2bf0b5,_0x30f895){return _0x2bf0b5[_0xe554('0xc')](_0xe554('0xd'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ed60a,_0x888603){extensions['rewrite'](_0x2bf0b5,_0x5ed60a);},'afterBulkCreate':function(_0x3d35a3,_0x5950af,_0x43d504){_0x43d504();extensions[_0xe554('0xe')](_0x2bf0b5,_0x3d35a3[0x0]);},'afterUpdate':function(_0x4e71b3,_0x590ee2){extensions['rewrite'](_0x2bf0b5,_0x4e71b3);},'afterDestroy':function(_0x5717d5,_0x1d9ee3){extensions['rewrite'](_0x2bf0b5,_0x5717d5);}}});};
\ No newline at end of file
+var _0x4ccb=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x4ccb,0x196));var _0xb4cc=function(_0x363903,_0x159784){_0x363903=_0x363903-0x0;var _0xef5523=_0x4ccb[_0x363903];return _0xef5523;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var logger=require(_0xb4cc('0x2'))('api');var moment=require(_0xb4cc('0x3'));var BPromise=require(_0xb4cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4cc('0x5'));var rimraf=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0xb4cc('0x8'));module[_0xb4cc('0x9')]=function(_0x1e19dd,_0x5c0bdd){return _0x1e19dd[_0xb4cc('0xa')](_0xb4cc('0xb'),attributes,{'tableName':_0xb4cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5327a4,_0x7e4460){extensions[_0xb4cc('0xd')](_0x1e19dd,_0x5327a4);},'afterBulkCreate':function(_0xbf893,_0x11139d,_0x14014d){_0x14014d();extensions['rewrite'](_0x1e19dd,_0xbf893[0x0]);},'afterUpdate':function(_0x507d38,_0x19d43e){extensions['rewrite'](_0x1e19dd,_0x507d38);},'afterDestroy':function(_0x1e9480,_0x4a54a5){extensions[_0xb4cc('0xd')](_0x1e19dd,_0x1e9480);}}});};
\ No newline at end of file
index 5820a26..86cdf67 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(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 ec54b96..d8b4082 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x157fb6,_0x3effcb){var _0x5ec04b=function(_0x3ae3fc){while(--_0x3ae3fc){_0x157fb6['push'](_0x157fb6['shift']());}};_0x5ec04b(++_0x3effcb);}(_0xdb28,0x106));var _0x8db2=function(_0x45ba19,_0x2b4054){_0x45ba19=_0x45ba19-0x0;var _0x3e834e=_0xdb28[_0x45ba19];return _0x3e834e;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router;
\ No newline at end of file
+var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x254a9a,_0x325343){var _0x625562=function(_0x3e5e12){while(--_0x3e5e12){_0x254a9a['push'](_0x254a9a['shift']());}};_0x625562(++_0x325343);}(_0x5f2f,0x73));var _0xf5f2=function(_0x48b185,_0x4664a0){_0x48b185=_0x48b185-0x0;var _0x3c832a=_0x5f2f[_0x48b185];return _0x3c832a;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router;
\ No newline at end of file
index a403d69..2f57706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf58d=['bluebird','api','3eAmWpBVP0','summary','Report','\x20from\x20','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','remoteAddress','connection'];(function(_0x581409,_0x500c81){var _0xe32534=function(_0x5bf86e){while(--_0x5bf86e){_0x581409['push'](_0x581409['shift']());}};_0xe32534(++_0x500c81);}(_0xf58d,0x138));var _0xdf58=function(_0x50692b,_0x4cf5bc){_0x50692b=_0x50692b-0x0;var _0x57748b=_0xf58d[_0x50692b];return _0x57748b;};'use strict';var BPromise=require(_0xdf58('0x0'));var https=require('https');var logger=require('../../config/logger')(_0xdf58('0x1'));var USERNAME='support';var PASSWORD=_0xdf58('0x2');function openIssue(_0x5dab1b,_0x5c5492){var _0x387bfe={'fields':{'project':{'key':_0x5dab1b['key']||'MOTGUI'},'summary':(_0x5dab1b[_0xdf58('0x3')]||_0xdf58('0x4'))+_0xdf58('0x5')+_0x5dab1b['ip'],'description':_0x5dab1b['description']||JSON['stringify'](_0x5dab1b),'issuetype':{'name':_0x5dab1b['issuetype']||_0xdf58('0x6')}}};_0x387bfe[_0xdf58('0x7')][_0xdf58('0x8')]=_0x5dab1b[_0xdf58('0x9')];_0x387bfe[_0xdf58('0x7')][_0xdf58('0xa')]=_0x5dab1b['oldToken'];_0x387bfe[_0xdf58('0x7')][_0xdf58('0xb')]=_0x5dab1b['newToken'];_0x387bfe[_0xdf58('0x7')][_0xdf58('0xc')]=_0x5dab1b['name'];_0x387bfe['fields'][_0xdf58('0xd')]=_0x5dab1b[_0xdf58('0xe')];_0x387bfe[_0xdf58('0x7')][_0xdf58('0xf')]=_0x5dab1b['ip'];var _0x1ee60a={'host':_0xdf58('0x10'),'port':0x1bb,'path':_0xdf58('0x11'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xdf58('0x12'),'Authorization':_0xdf58('0x13')+new Buffer(USERNAME+':'+PASSWORD)[_0xdf58('0x14')](_0xdf58('0x15'))}};var _0x129fb9=JSON['stringify'](_0x387bfe);var _0x98ebbc=https[_0xdf58('0x16')](_0x1ee60a,function(_0x4f3ce1){_0x4f3ce1[_0xdf58('0x17')](_0xdf58('0x18'));var _0x1c7c73='';_0x4f3ce1['on'](_0xdf58('0x19'),function(_0x2c42eb){_0x1c7c73+=_0x2c42eb;});_0x4f3ce1['on'](_0xdf58('0x1a'),function(){if(_0x5c5492){return _0x5c5492['status'](_0x4f3ce1['statusCode'])[_0xdf58('0x1b')](JSON[_0xdf58('0x1c')](_0x1c7c73));}});});_0x98ebbc['on'](_0xdf58('0x1d'),function(_0x22565d){if(_0x5c5492){return _0x5c5492[_0xdf58('0x1e')](0x1f4)['json']({'errors':[{'message':_0xdf58('0x1f'),'type':_0xdf58('0x20')}]});}});_0x98ebbc[_0xdf58('0x21')](_0x129fb9);_0x98ebbc[_0xdf58('0x1a')]();}exports[_0xdf58('0x22')]=openIssue;exports['send']=function(_0x3c4829,_0x20b3ec){_0x3c4829[_0xdf58('0x23')]['ip']=_0x3c4829[_0xdf58('0x24')]['x-forwarded-for']||_0x3c4829['connection'][_0xdf58('0x25')]||_0x3c4829['socket']['remoteAddress']||_0x3c4829[_0xdf58('0x26')]['socket'][_0xdf58('0x25')];return openIssue(_0x3c4829[_0xdf58('0x23')],_0x20b3ec);};
\ No newline at end of file
+var _0x1009=['json','error','api.jira','write','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','../../config/logger','support','key','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode'];(function(_0x5046ee,_0xcabf97){var _0x29c1af=function(_0xf3eeb0){while(--_0xf3eeb0){_0x5046ee['push'](_0x5046ee['shift']());}};_0x29c1af(++_0xcabf97);}(_0x1009,0x1bc));var _0x9100=function(_0x515b83,_0x2effa2){_0x515b83=_0x515b83-0x0;var _0x11c287=_0x1009[_0x515b83];return _0x11c287;};'use strict';var BPromise=require(_0x9100('0x0'));var https=require('https');var logger=require(_0x9100('0x1'))('api');var USERNAME=_0x9100('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x105248,_0x1cb42a){var _0x18a55c={'fields':{'project':{'key':_0x105248[_0x9100('0x3')]||_0x9100('0x4')},'summary':(_0x105248['summary']||_0x9100('0x5'))+_0x9100('0x6')+_0x105248['ip'],'description':_0x105248[_0x9100('0x7')]||JSON[_0x9100('0x8')](_0x105248),'issuetype':{'name':_0x105248[_0x9100('0x9')]||_0x9100('0xa')}}};_0x18a55c[_0x9100('0xb')][_0x9100('0xc')]=_0x105248[_0x9100('0xd')];_0x18a55c[_0x9100('0xb')]['customfield_11501']=_0x105248[_0x9100('0xe')];_0x18a55c[_0x9100('0xb')][_0x9100('0xf')]=_0x105248[_0x9100('0x10')];_0x18a55c['fields'][_0x9100('0x11')]=_0x105248[_0x9100('0x12')];_0x18a55c[_0x9100('0xb')][_0x9100('0x13')]=_0x105248[_0x9100('0x14')];_0x18a55c[_0x9100('0xb')][_0x9100('0x15')]=_0x105248['ip'];var _0x562d50={'host':_0x9100('0x16'),'port':0x1bb,'path':_0x9100('0x17'),'method':_0x9100('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x9100('0x19'),'Authorization':_0x9100('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0x9100('0x1b')](_0x9100('0x1c'))}};var _0x52fe26=JSON[_0x9100('0x8')](_0x18a55c);var _0x22deaa=https[_0x9100('0x1d')](_0x562d50,function(_0x562160){_0x562160[_0x9100('0x1e')](_0x9100('0x1f'));var _0xb2ba89='';_0x562160['on'](_0x9100('0x20'),function(_0x29da07){_0xb2ba89+=_0x29da07;});_0x562160['on'](_0x9100('0x21'),function(){if(_0x1cb42a){return _0x1cb42a[_0x9100('0x22')](_0x562160[_0x9100('0x23')])[_0x9100('0x24')](JSON['parse'](_0xb2ba89));}});});_0x22deaa['on'](_0x9100('0x25'),function(_0x389289){if(_0x1cb42a){return _0x1cb42a[_0x9100('0x22')](0x1f4)[_0x9100('0x24')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x9100('0x26')}]});}});_0x22deaa[_0x9100('0x27')](_0x52fe26);_0x22deaa[_0x9100('0x21')]();}exports[_0x9100('0x28')]=openIssue;exports[_0x9100('0x29')]=function(_0x48d00d,_0x2847c9){_0x48d00d['body']['ip']=_0x48d00d[_0x9100('0x2a')][_0x9100('0x2b')]||_0x48d00d[_0x9100('0x2c')][_0x9100('0x2d')]||_0x48d00d[_0x9100('0x2e')][_0x9100('0x2d')]||_0x48d00d[_0x9100('0x2c')][_0x9100('0x2e')][_0x9100('0x2d')];return openIssue(_0x48d00d[_0x9100('0x2f')],_0x2847c9);};
\ No newline at end of file
index 284c4a3..b876501 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1339=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x53a3d9,_0x581974){var _0x3b80bb=function(_0x103f41){while(--_0x103f41){_0x53a3d9['push'](_0x53a3d9['shift']());}};_0x3b80bb(++_0x581974);}(_0x1339,0x1ed));var _0x9133=function(_0x46eb33,_0x4a10f8){_0x46eb33=_0x46eb33-0x0;var _0x21a9d5=_0x1339[_0x46eb33];return _0x21a9d5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0xf')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0x10')]);router['put'](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0x11')]);router[_0x9133('0x12')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['destroy']);module[_0x9133('0x13')]=router;
\ No newline at end of file
+var _0x0bb5=['describe','show','post','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated'];(function(_0x464011,_0x40e0d5){var _0x926aad=function(_0x3da421){while(--_0x3da421){_0x464011['push'](_0x464011['shift']());}};_0x926aad(++_0x40e0d5);}(_0x0bb5,0x148));var _0x50bb=function(_0x152319,_0x18a84c){_0x152319=_0x152319-0x0;var _0x43fbce=_0x0bb5[_0x152319];return _0x43fbce;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0xe')]('/',auth[_0x50bb('0xb')](),controller['create']);router[_0x50bb('0xf')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x12')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller['destroy']);module[_0x50bb('0x13')]=router;
\ No newline at end of file
index c46277d..e3b1b49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x445018,_0xa73f35){_0x445018=_0x445018-0x0;var _0xe54038=_0x7a54[_0x445018];return _0xe54038;};'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(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0x52a86b,_0x34e054){_0x52a86b=_0x52a86b-0x0;var _0x10d755=_0x7a54[_0x52a86b];return _0x10d755;};'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 dcfe2e4..31a8ed9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae24=['destroy','stack','name','send','index','map','JscriptyAnswerReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','findAll','catch','params','rawAttributes','fields','length','includeAll','include','find','create','body','describe','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then'];(function(_0x335d6c,_0x1c5ed7){var _0x3f3125=function(_0xfcc544){while(--_0xfcc544){_0x335d6c['push'](_0x335d6c['shift']());}};_0x3f3125(++_0x1c5ed7);}(_0xae24,0x182));var _0x4ae2=function(_0x4790eb,_0x2dc7f2){_0x4790eb=_0x4790eb-0x0;var _0x5f0198=_0xae24[_0x4790eb];return _0x5f0198;};'use strict';var emlformat=require(_0x4ae2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ae2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ae2('0x2'));var moment=require(_0x4ae2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ae2('0x4'));var path=require('path');var sox=require(_0x4ae2('0x5'));var csv=require(_0x4ae2('0x6'));var ejs=require(_0x4ae2('0x7'));var fs=require('fs');var fs_extra=require(_0x4ae2('0x8'));var _=require(_0x4ae2('0x9'));var squel=require(_0x4ae2('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ae2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ae2('0xc'));var Redis=require(_0x4ae2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4ae2('0xe'));var as=require(_0x4ae2('0xf'));var hardwareService=require(_0x4ae2('0x10'));var logger=require(_0x4ae2('0x11'))('api');var utils=require(_0x4ae2('0x12'));var config=require(_0x4ae2('0x13'));var licenseUtil=require(_0x4ae2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d2b4,_0x22ac1e){_0x22ac1e=_0x22ac1e||0xcc;return function(_0x30d6c4){if(_0x30d6c4){return _0x25d2b4[_0x4ae2('0x15')](_0x22ac1e);}return _0x25d2b4[_0x4ae2('0x16')](_0x22ac1e)[_0x4ae2('0x17')]();};}function respondWithResult(_0x145287,_0x3cabc9){_0x3cabc9=_0x3cabc9||0xc8;return function(_0xd527a0){if(_0xd527a0){return _0x145287['status'](_0x3cabc9)['json'](_0xd527a0);}};}function respondWithFilteredResult(_0x4d5cab,_0x2f3936){return function(_0xf834a1){if(_0xf834a1){var _0x5f447a=typeof _0x2f3936[_0x4ae2('0x18')]===_0x4ae2('0x19')&&typeof _0x2f3936[_0x4ae2('0x1a')]===_0x4ae2('0x19');var _0x428d24=_0xf834a1[_0x4ae2('0x1b')];var _0x3d4259=_0x5f447a?0x0:_0x2f3936[_0x4ae2('0x18')];var _0x41b672=_0x5f447a?_0xf834a1[_0x4ae2('0x1b')]:_0x2f3936['offset']+_0x2f3936['limit'];var _0x44a2d3;if(_0x41b672>=_0x428d24){_0x41b672=_0x428d24;_0x44a2d3=0xc8;}else{_0x44a2d3=0xce;}_0x4d5cab[_0x4ae2('0x16')](_0x44a2d3);return _0x4d5cab['set'](_0x4ae2('0x1c'),_0x3d4259+'-'+_0x41b672+'/'+_0x428d24)[_0x4ae2('0x1d')](_0xf834a1);}return null;};}function patchUpdates(_0xccb3b){return function(_0x2ad222){try{jsonpatch[_0x4ae2('0x1e')](_0x2ad222,_0xccb3b,!![]);}catch(_0x497218){return BPromise[_0x4ae2('0x1f')](_0x497218);}return _0x2ad222['save']();};}function saveUpdates(_0x522165,_0x2ceec4){return function(_0x151b70){if(_0x151b70){return _0x151b70[_0x4ae2('0x20')](_0x522165)[_0x4ae2('0x21')](function(_0xca16bf){return _0xca16bf;});}return null;};}function removeEntity(_0x526768,_0x1005e0){return function(_0x4a0ddb){if(_0x4a0ddb){return _0x4a0ddb[_0x4ae2('0x22')]()[_0x4ae2('0x21')](function(){_0x526768[_0x4ae2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43f112,_0x6f0cc6){return function(_0x2454b3){if(!_0x2454b3){_0x43f112[_0x4ae2('0x15')](0x194);}return _0x2454b3;};}function handleError(_0x1c2934,_0x255772){_0x255772=_0x255772||0x1f4;return function(_0x5b2e65){logger['error'](_0x5b2e65[_0x4ae2('0x23')]);if(_0x5b2e65[_0x4ae2('0x24')]){delete _0x5b2e65[_0x4ae2('0x24')];}_0x1c2934[_0x4ae2('0x16')](_0x255772)[_0x4ae2('0x25')](_0x5b2e65);};}exports[_0x4ae2('0x26')]=function(_0x57a377,_0x5ec1fd){var _0x3e2666={},_0x4e7741={},_0x554cff={'count':0x0,'rows':[]};var _0x5e9f03=_[_0x4ae2('0x27')](db[_0x4ae2('0x28')]['rawAttributes'],function(_0x883fd5){return{'name':_0x883fd5[_0x4ae2('0x29')],'type':_0x883fd5[_0x4ae2('0x2a')][_0x4ae2('0x2b')]};});_0x4e7741[_0x4ae2('0x2c')]=_[_0x4ae2('0x27')](_0x5e9f03,_0x4ae2('0x24'));_0x4e7741[_0x4ae2('0x2d')]=_[_0x4ae2('0x2e')](_0x57a377[_0x4ae2('0x2d')]);_0x4e7741[_0x4ae2('0x2f')]=_[_0x4ae2('0x30')](_0x4e7741[_0x4ae2('0x2c')],_0x4e7741[_0x4ae2('0x2d')]);_0x3e2666[_0x4ae2('0x31')]=_[_0x4ae2('0x30')](_0x4e7741[_0x4ae2('0x2c')],qs['fields'](_0x57a377[_0x4ae2('0x2d')]['fields']));_0x3e2666[_0x4ae2('0x31')]=_0x3e2666[_0x4ae2('0x31')]['length']?_0x3e2666[_0x4ae2('0x31')]:_0x4e7741[_0x4ae2('0x2c')];if(!_0x57a377[_0x4ae2('0x2d')][_0x4ae2('0x32')]('nolimit')){_0x3e2666[_0x4ae2('0x1a')]=qs[_0x4ae2('0x1a')](_0x57a377[_0x4ae2('0x2d')][_0x4ae2('0x1a')]);_0x3e2666[_0x4ae2('0x18')]=qs[_0x4ae2('0x18')](_0x57a377[_0x4ae2('0x2d')][_0x4ae2('0x18')]);}_0x3e2666[_0x4ae2('0x33')]=qs['sort'](_0x57a377[_0x4ae2('0x2d')]['sort']);_0x3e2666[_0x4ae2('0x34')]=qs[_0x4ae2('0x2f')](_[_0x4ae2('0x35')](_0x57a377[_0x4ae2('0x2d')],_0x4e7741[_0x4ae2('0x2f')]),_0x5e9f03);if(_0x57a377[_0x4ae2('0x2d')]['filter']){_0x3e2666[_0x4ae2('0x34')]=_[_0x4ae2('0x36')](_0x3e2666[_0x4ae2('0x34')],{'$or':_[_0x4ae2('0x27')](_0x5e9f03,function(_0x49baf9){if(_0x49baf9[_0x4ae2('0x2a')]!==_0x4ae2('0x37')){var _0x2f0d83={};_0x2f0d83[_0x49baf9[_0x4ae2('0x24')]]={'$like':'%'+_0x57a377[_0x4ae2('0x2d')][_0x4ae2('0x38')]+'%'};return _0x2f0d83;}})});}_0x3e2666=_[_0x4ae2('0x36')]({},_0x3e2666,_0x57a377[_0x4ae2('0x39')]);var _0x1d5888={'where':_0x3e2666[_0x4ae2('0x34')]};return db[_0x4ae2('0x28')]['count'](_0x1d5888)[_0x4ae2('0x21')](function(_0x3f0b3f){_0x554cff[_0x4ae2('0x1b')]=_0x3f0b3f;if(_0x57a377[_0x4ae2('0x2d')]['includeAll']){_0x3e2666['include']=[{'all':!![]}];}return db[_0x4ae2('0x28')][_0x4ae2('0x3a')](_0x3e2666);})[_0x4ae2('0x21')](function(_0x3cdf23){_0x554cff['rows']=_0x3cdf23;return _0x554cff;})[_0x4ae2('0x21')](respondWithFilteredResult(_0x5ec1fd,_0x3e2666))[_0x4ae2('0x3b')](handleError(_0x5ec1fd,null));};exports['show']=function(_0x230030,_0x2a85eb){var _0x11a5d9={'raw':!![],'where':{'id':_0x230030[_0x4ae2('0x3c')]['id']}},_0x5a9126={};_0x5a9126[_0x4ae2('0x2c')]=_[_0x4ae2('0x2e')](db[_0x4ae2('0x28')][_0x4ae2('0x3d')]);_0x5a9126[_0x4ae2('0x2d')]=_[_0x4ae2('0x2e')](_0x230030[_0x4ae2('0x2d')]);_0x5a9126['filters']=_[_0x4ae2('0x30')](_0x5a9126[_0x4ae2('0x2c')],_0x5a9126['query']);_0x11a5d9[_0x4ae2('0x31')]=_[_0x4ae2('0x30')](_0x5a9126['model'],qs[_0x4ae2('0x3e')](_0x230030[_0x4ae2('0x2d')]['fields']));_0x11a5d9[_0x4ae2('0x31')]=_0x11a5d9[_0x4ae2('0x31')][_0x4ae2('0x3f')]?_0x11a5d9['attributes']:_0x5a9126['model'];if(_0x230030[_0x4ae2('0x2d')][_0x4ae2('0x40')]){_0x11a5d9[_0x4ae2('0x41')]=[{'all':!![]}];}_0x11a5d9=_[_0x4ae2('0x36')]({},_0x11a5d9,_0x230030['options']);return db[_0x4ae2('0x28')][_0x4ae2('0x42')](_0x11a5d9)[_0x4ae2('0x21')](handleEntityNotFound(_0x2a85eb,null))['then'](respondWithResult(_0x2a85eb,null))[_0x4ae2('0x3b')](handleError(_0x2a85eb,null));};exports[_0x4ae2('0x43')]=function(_0x443548,_0x4e9b6e){return db[_0x4ae2('0x28')][_0x4ae2('0x43')](_0x443548[_0x4ae2('0x44')],{})[_0x4ae2('0x21')](respondWithResult(_0x4e9b6e,0xc9))[_0x4ae2('0x3b')](handleError(_0x4e9b6e,null));};exports[_0x4ae2('0x20')]=function(_0x7f288e,_0x2fe532){if(_0x7f288e[_0x4ae2('0x44')]['id']){delete _0x7f288e[_0x4ae2('0x44')]['id'];}return db['JscriptyAnswerReport'][_0x4ae2('0x42')]({'where':{'id':_0x7f288e[_0x4ae2('0x3c')]['id']}})[_0x4ae2('0x21')](handleEntityNotFound(_0x2fe532,null))[_0x4ae2('0x21')](saveUpdates(_0x7f288e[_0x4ae2('0x44')],null))[_0x4ae2('0x21')](respondWithResult(_0x2fe532,null))[_0x4ae2('0x3b')](handleError(_0x2fe532,null));};exports[_0x4ae2('0x22')]=function(_0x4ffe8d,_0xe58384){return db[_0x4ae2('0x28')]['find']({'where':{'id':_0x4ffe8d[_0x4ae2('0x3c')]['id']}})[_0x4ae2('0x21')](handleEntityNotFound(_0xe58384,null))['then'](removeEntity(_0xe58384,null))[_0x4ae2('0x3b')](handleError(_0xe58384,null));};exports['describe']=function(_0x426d29,_0x5e1c80){return db[_0x4ae2('0x28')][_0x4ae2('0x45')]()[_0x4ae2('0x21')](respondWithResult(_0x5e1c80,null))[_0x4ae2('0x3b')](handleError(_0x5e1c80,null));};
\ No newline at end of file
+var _0x425d=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x425d,0x1e0));var _0xd425=function(_0x498381,_0x122bfc){_0x498381=_0x498381-0x0;var _0x7e0ae8=_0x425d[_0x498381];return _0x7e0ae8;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={},_0x24da23={},_0x1cac61={'count':0x0,'rows':[]};var _0x482ba6=_[_0xd425('0x2f')](db[_0xd425('0x30')][_0xd425('0x31')],function(_0x3695dd){return{'name':_0x3695dd[_0xd425('0x32')],'type':_0x3695dd[_0xd425('0x33')][_0xd425('0x34')]};});_0x24da23[_0xd425('0x35')]=_[_0xd425('0x2f')](_0x482ba6,_0xd425('0x2c'));_0x24da23[_0xd425('0x36')]=_['keys'](_0x185d7e[_0xd425('0x36')]);_0x24da23[_0xd425('0x37')]=_[_0xd425('0x38')](_0x24da23[_0xd425('0x35')],_0x24da23[_0xd425('0x36')]);_0x37b63c['attributes']=_[_0xd425('0x38')](_0x24da23[_0xd425('0x35')],qs['fields'](_0x185d7e['query']['fields']));_0x37b63c[_0xd425('0x39')]=_0x37b63c[_0xd425('0x39')][_0xd425('0x3a')]?_0x37b63c[_0xd425('0x39')]:_0x24da23['model'];if(!_0x185d7e[_0xd425('0x36')][_0xd425('0x3b')](_0xd425('0x3c'))){_0x37b63c[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x185d7e[_0xd425('0x36')][_0xd425('0x23')]);_0x37b63c['offset']=qs[_0xd425('0x21')](_0x185d7e['query'][_0xd425('0x21')]);}_0x37b63c[_0xd425('0x3d')]=qs[_0xd425('0x3e')](_0x185d7e['query'][_0xd425('0x3e')]);_0x37b63c[_0xd425('0x3f')]=qs[_0xd425('0x37')](_[_0xd425('0x40')](_0x185d7e['query'],_0x24da23[_0xd425('0x37')]),_0x482ba6);if(_0x185d7e[_0xd425('0x36')]['filter']){_0x37b63c['where']=_['merge'](_0x37b63c[_0xd425('0x3f')],{'$or':_[_0xd425('0x2f')](_0x482ba6,function(_0x1f30c1){if(_0x1f30c1['type']!=='VIRTUAL'){var _0x58ebb1={};_0x58ebb1[_0x1f30c1[_0xd425('0x2c')]]={'$like':'%'+_0x185d7e[_0xd425('0x36')][_0xd425('0x41')]+'%'};return _0x58ebb1;}})});}_0x37b63c=_[_0xd425('0x42')]({},_0x37b63c,_0x185d7e[_0xd425('0x43')]);var _0x14f3be={'where':_0x37b63c[_0xd425('0x3f')]};return db['JscriptyAnswerReport'][_0xd425('0x24')](_0x14f3be)[_0xd425('0x2a')](function(_0x1d82ec){_0x1cac61['count']=_0x1d82ec;if(_0x185d7e[_0xd425('0x36')][_0xd425('0x44')]){_0x37b63c[_0xd425('0x45')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xd425('0x46')](_0x37b63c);})[_0xd425('0x2a')](function(_0x1c5ba6){_0x1cac61[_0xd425('0x47')]=_0x1c5ba6;return _0x1cac61;})['then'](respondWithFilteredResult(_0x2fd17a,_0x37b63c))[_0xd425('0x48')](handleError(_0x2fd17a,null));};exports[_0xd425('0x49')]=function(_0x2b1149,_0x41b25e){var _0x3f24fb={'raw':!![],'where':{'id':_0x2b1149[_0xd425('0x4a')]['id']}},_0x2f6bf7={};_0x2f6bf7['model']=_[_0xd425('0x4b')](db[_0xd425('0x30')]['rawAttributes']);_0x2f6bf7[_0xd425('0x36')]=_['keys'](_0x2b1149['query']);_0x2f6bf7[_0xd425('0x37')]=_['intersection'](_0x2f6bf7[_0xd425('0x35')],_0x2f6bf7['query']);_0x3f24fb[_0xd425('0x39')]=_[_0xd425('0x38')](_0x2f6bf7[_0xd425('0x35')],qs[_0xd425('0x4c')](_0x2b1149[_0xd425('0x36')]['fields']));_0x3f24fb[_0xd425('0x39')]=_0x3f24fb['attributes'][_0xd425('0x3a')]?_0x3f24fb['attributes']:_0x2f6bf7[_0xd425('0x35')];if(_0x2b1149[_0xd425('0x36')][_0xd425('0x44')]){_0x3f24fb[_0xd425('0x45')]=[{'all':!![]}];}_0x3f24fb=_[_0xd425('0x42')]({},_0x3f24fb,_0x2b1149['options']);return db[_0xd425('0x30')][_0xd425('0x4d')](_0x3f24fb)[_0xd425('0x2a')](handleEntityNotFound(_0x41b25e,null))[_0xd425('0x2a')](respondWithResult(_0x41b25e,null))[_0xd425('0x48')](handleError(_0x41b25e,null));};exports['create']=function(_0x440dc5,_0x177704){return db[_0xd425('0x30')][_0xd425('0x4e')](_0x440dc5[_0xd425('0x4f')],{})[_0xd425('0x2a')](respondWithResult(_0x177704,0xc9))['catch'](handleError(_0x177704,null));};exports[_0xd425('0x29')]=function(_0x128cb3,_0x5bfac6){if(_0x128cb3[_0xd425('0x4f')]['id']){delete _0x128cb3[_0xd425('0x4f')]['id'];}return db[_0xd425('0x30')][_0xd425('0x4d')]({'where':{'id':_0x128cb3['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5bfac6,null))[_0xd425('0x2a')](saveUpdates(_0x128cb3[_0xd425('0x4f')],null))[_0xd425('0x2a')](respondWithResult(_0x5bfac6,null))[_0xd425('0x48')](handleError(_0x5bfac6,null));};exports['destroy']=function(_0x4be6fa,_0x381bdb){return db['JscriptyAnswerReport'][_0xd425('0x4d')]({'where':{'id':_0x4be6fa[_0xd425('0x4a')]['id']}})['then'](handleEntityNotFound(_0x381bdb,null))[_0xd425('0x2a')](removeEntity(_0x381bdb,null))['catch'](handleError(_0x381bdb,null));};exports['describe']=function(_0x39f588,_0x111905){return db[_0xd425('0x30')][_0xd425('0x50')]()[_0xd425('0x2a')](respondWithResult(_0x111905,null))[_0xd425('0x48')](handleError(_0x111905,null));};
\ No newline at end of file
index 46c7e9c..39f3b9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14eb=['api','bluebird','path','../../config/environment','exports','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger'];(function(_0xfea50c,_0xa9eae1){var _0x15228c=function(_0x54e056){while(--_0x54e056){_0xfea50c['push'](_0xfea50c['shift']());}};_0x15228c(++_0xa9eae1);}(_0x14eb,0xbb));var _0xb14e=function(_0x397f96,_0x4a8c02){_0x397f96=_0x397f96-0x0;var _0x25c251=_0x14eb[_0x397f96];return _0x25c251;};'use strict';var _=require('lodash');var util=require(_0xb14e('0x0'));var logger=require(_0xb14e('0x1'))(_0xb14e('0x2'));var moment=require('moment');var BPromise=require(_0xb14e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb14e('0x4'));var rimraf=require('rimraf');var config=require(_0xb14e('0x5'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xb14e('0x6')]=function(_0x47d0fb,_0x540458){return _0x47d0fb['define'](_0xb14e('0x7'),attributes,{'tableName':_0xb14e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a5b=['exports','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x5cad27,_0x3a3ed4){var _0x1c176e=function(_0x3ca730){while(--_0x3ca730){_0x5cad27['push'](_0x5cad27['shift']());}};_0x1c176e(++_0x3a3ed4);}(_0x7a5b,0x158));var _0xb7a5=function(_0x76a667,_0x456b95){_0x76a667=_0x76a667-0x0;var _0xaac135=_0x7a5b[_0x76a667];return _0xaac135;};'use strict';var _=require(_0xb7a5('0x0'));var util=require('util');var logger=require(_0xb7a5('0x1'))(_0xb7a5('0x2'));var moment=require(_0xb7a5('0x3'));var BPromise=require(_0xb7a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb7a5('0x5'));var config=require(_0xb7a5('0x6'));var attributes=require(_0xb7a5('0x7'));module[_0xb7a5('0x8')]=function(_0x225871,_0x4415a9){return _0x225871['define'](_0xb7a5('0x9'),attributes,{'tableName':_0xb7a5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6afaa78..cf5f080 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4898=['code','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x4898,0xc6));var _0x8489=function(_0xc9fa4c,_0x4b6302){_0xc9fa4c=_0xc9fa4c-0x0;var _0x27f43b=_0x4898[_0xc9fa4c];return _0x27f43b;};'use strict';var _=require(_0x8489('0x0'));var util=require(_0x8489('0x1'));var moment=require(_0x8489('0x2'));var BPromise=require(_0x8489('0x3'));var rs=require(_0x8489('0x4'));var fs=require('fs');var Redis=require(_0x8489('0x5'));var db=require(_0x8489('0x6'))['db'];var utils=require(_0x8489('0x7'));var logger=require(_0x8489('0x8'))(_0x8489('0x9'));var config=require('../../config/environment');var jayson=require(_0x8489('0xa'));var client=jayson['client'][_0x8489('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x515a3b,_0xe65aa2,_0x574cf3){return new BPromise(function(_0xf8714f,_0x5b435b){return client['request'](_0x515a3b,_0x574cf3)[_0x8489('0xc')](function(_0x30909c){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0xe65aa2,_0x8489('0xd'));logger[_0x8489('0xe')](_0x8489('0xf'),_0xe65aa2,_0x8489('0xd'),JSON[_0x8489('0x10')](_0x30909c));if(_0x30909c[_0x8489('0x11')]){if(_0x30909c[_0x8489('0x11')][_0x8489('0x12')]===0x1f4){logger[_0x8489('0x11')](_0x8489('0x13'),_0xe65aa2,_0x30909c['error'][_0x8489('0x14')]);return _0x5b435b(_0x30909c[_0x8489('0x11')][_0x8489('0x14')]);}logger[_0x8489('0x11')](_0x8489('0x13'),_0xe65aa2,_0x30909c[_0x8489('0x11')][_0x8489('0x14')]);return _0xf8714f(_0x30909c[_0x8489('0x11')][_0x8489('0x14')]);}else{logger[_0x8489('0x15')](_0x8489('0x13'),_0xe65aa2,_0x8489('0xd'));_0xf8714f(_0x30909c[_0x8489('0x16')][_0x8489('0x14')]);}})[_0x8489('0x17')](function(_0x244989){logger[_0x8489('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xe65aa2,_0x244989);_0x5b435b(_0x244989);});});}
\ No newline at end of file
+var _0x184a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb'];(function(_0x1d03f1,_0x7f2edf){var _0x40c77e=function(_0x2f1025){while(--_0x2f1025){_0x1d03f1['push'](_0x1d03f1['shift']());}};_0x40c77e(++_0x7f2edf);}(_0x184a,0x16b));var _0xa184=function(_0x30c049,_0x5b2ca8){_0x30c049=_0x30c049-0x0;var _0x220203=_0x184a[_0x30c049];return _0x220203;};'use strict';var _=require(_0xa184('0x0'));var util=require('util');var moment=require(_0xa184('0x1'));var BPromise=require(_0xa184('0x2'));var rs=require(_0xa184('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa184('0x4'))['db'];var utils=require(_0xa184('0x5'));var logger=require(_0xa184('0x6'))(_0xa184('0x7'));var config=require(_0xa184('0x8'));var jayson=require(_0xa184('0x9'));var client=jayson[_0xa184('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42e6a9,_0x574b0b,_0x1cdb2a){return new BPromise(function(_0x4c2881,_0x5e24a1){return client[_0xa184('0xb')](_0x42e6a9,_0x1cdb2a)['then'](function(_0x425d27){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x574b0b,_0xa184('0xc'));logger[_0xa184('0xd')](_0xa184('0xe'),_0x574b0b,_0xa184('0xc'),JSON[_0xa184('0xf')](_0x425d27));if(_0x425d27[_0xa184('0x10')]){if(_0x425d27['error'][_0xa184('0x11')]===0x1f4){logger[_0xa184('0x10')](_0xa184('0x12'),_0x574b0b,_0x425d27[_0xa184('0x10')][_0xa184('0x13')]);return _0x5e24a1(_0x425d27['error'][_0xa184('0x13')]);}logger['error'](_0xa184('0x12'),_0x574b0b,_0x425d27['error'][_0xa184('0x13')]);return _0x4c2881(_0x425d27[_0xa184('0x10')]['message']);}else{logger[_0xa184('0x14')](_0xa184('0x12'),_0x574b0b,_0xa184('0xc'));_0x4c2881(_0x425d27[_0xa184('0x15')][_0xa184('0x13')]);}})[_0xa184('0x16')](function(_0x567a8e){logger[_0xa184('0x10')](_0xa184('0x12'),_0x574b0b,_0x567a8e);_0x5e24a1(_0x567a8e);});});}
\ No newline at end of file
index 73992d7..3d0a039 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x606c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','/:id','getSessions','/:id/answers','30s','getSummary','create','post','/:id/clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x606c,0x78));var _0xc606=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x606c[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0xc606('0x0'));var util=require(_0xc606('0x1'));var path=require(_0xc606('0x2'));var timeout=require(_0xc606('0x3'));var express=require(_0xc606('0x4'));var router=express[_0xc606('0x5')]();var fs_extra=require(_0xc606('0x6'));var auth=require(_0xc606('0x7'));var interaction=require(_0xc606('0x8'));var config=require('../../config/environment');var controller=require(_0xc606('0x9'));router[_0xc606('0xa')]('/',auth[_0xc606('0xb')](),controller['index']);router[_0xc606('0xa')](_0xc606('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xc606('0xa')]('/:id/sessions',auth[_0xc606('0xb')](),controller[_0xc606('0xd')]);router[_0xc606('0xa')](_0xc606('0xe'),auth[_0xc606('0xb')](),controller['getAnswers']);router[_0xc606('0xa')]('/:id/summary',auth[_0xc606('0xb')](),timeout(_0xc606('0xf')),controller[_0xc606('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc606('0x11')]);router[_0xc606('0x12')](_0xc606('0x13'),auth[_0xc606('0xb')](),controller['clone']);router[_0xc606('0x14')]('/:id',auth[_0xc606('0xb')](),controller[_0xc606('0x15')]);router[_0xc606('0x16')]('/:id',auth[_0xc606('0xb')](),controller[_0xc606('0x17')]);module[_0xc606('0x18')]=router;
\ No newline at end of file
+var _0x38b0=['post','/:id/clone','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x38b0,0xcb));var _0x038b=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x38b0[_0x207d2f];return _0x3c3498;};'use strict';var multer=require(_0x038b('0x0'));var util=require('util');var path=require(_0x038b('0x1'));var timeout=require(_0x038b('0x2'));var express=require('express');var router=express[_0x038b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x038b('0x4'));var config=require(_0x038b('0x5'));var controller=require('./jscriptyProject.controller');router[_0x038b('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x038b('0x6')](_0x038b('0x7'),auth[_0x038b('0x8')](),controller['show']);router[_0x038b('0x6')](_0x038b('0x9'),auth[_0x038b('0x8')](),controller[_0x038b('0xa')]);router[_0x038b('0x6')](_0x038b('0xb'),auth[_0x038b('0x8')](),controller[_0x038b('0xc')]);router[_0x038b('0x6')](_0x038b('0xd'),auth[_0x038b('0x8')](),timeout(_0x038b('0xe')),controller[_0x038b('0xf')]);router['post']('/',auth[_0x038b('0x8')](),controller[_0x038b('0x10')]);router[_0x038b('0x11')](_0x038b('0x12'),auth['isAuthenticated'](),controller['clone']);router['put']('/:id',auth[_0x038b('0x8')](),controller['update']);router[_0x038b('0x13')](_0x038b('0x7'),auth[_0x038b('0x8')](),controller[_0x038b('0x14')]);module[_0x038b('0x15')]=router;
\ No newline at end of file
index c462ae9..5539bb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7abe=['util','exports','STRING','name','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description','BOOLEAN'];(function(_0xce2ebf,_0x25fa94){var _0x12e790=function(_0x5b78c4){while(--_0x5b78c4){_0xce2ebf['push'](_0xce2ebf['shift']());}};_0x12e790(++_0x25fa94);}(_0x7abe,0x15e));var _0xe7ab=function(_0x4e9f20,_0x37ba77){_0x4e9f20=_0x4e9f20-0x0;var _0x57d043=_0x7abe[_0x4e9f20];return _0x57d043;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0xe7ab('0x0'));module[_0xe7ab('0x1')]={'name':{'type':Sequelize[_0xe7ab('0x2')],'unique':_0xe7ab('0x3')},'description':{'type':Sequelize[_0xe7ab('0x2')]},'formData':{'type':Sequelize[_0xe7ab('0x4')](_0xe7ab('0x5')),'set':function(_0x583dc5){if(_[_0xe7ab('0x6')](_0x583dc5)){this['setDataValue'](_0xe7ab('0x7'),JSON[_0xe7ab('0x8')](_0x583dc5));}else if(_[_0xe7ab('0x9')](_0x583dc5)){this[_0xe7ab('0xa')]('formData',_0x583dc5);}else{this[_0xe7ab('0xa')](_0xe7ab('0x7'),util['format'](_0xe7ab('0xb'),this['getDataValue'](_0xe7ab('0x3'))||'',this['getDataValue'](_0xe7ab('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xe7ab('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe7ab('0xd')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc8a8=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','isObjectLike','formData','stringify','isString','format'];(function(_0x4ca160,_0x14886c){var _0x303ae9=function(_0xa1d94c){while(--_0xa1d94c){_0x4ca160['push'](_0x4ca160['shift']());}};_0x303ae9(++_0x14886c);}(_0xc8a8,0xf3));var _0x8c8a=function(_0x459a0a,_0x25c46f){_0x459a0a=_0x459a0a-0x0;var _0x4ab46c=_0xc8a8[_0x459a0a];return _0x4ab46c;};'use strict';var Sequelize=require(_0x8c8a('0x0'));var _=require('lodash');var util=require(_0x8c8a('0x1'));module[_0x8c8a('0x2')]={'name':{'type':Sequelize[_0x8c8a('0x3')],'unique':_0x8c8a('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8c8a('0x5')](_0x8c8a('0x6')),'set':function(_0x765691){if(_[_0x8c8a('0x7')](_0x765691)){this['setDataValue'](_0x8c8a('0x8'),JSON[_0x8c8a('0x9')](_0x765691));}else if(_[_0x8c8a('0xa')](_0x765691)){this['setDataValue']('formData',_0x765691);}else{this['setDataValue'](_0x8c8a('0x8'),util[_0x8c8a('0xb')](_0x8c8a('0xc'),this[_0x8c8a('0xd')]('name')||'',this[_0x8c8a('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8c8a('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x8c8a('0xe')],'defaultValue':![]}};
\ No newline at end of file
index bccdea8..0c98977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1184=['role','user','UserProfileSection','userProfileId','autoAssociation','clone','params','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getSessions','findOne','JscriptySessionReport','nolimit','order','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','question','format','questionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','get','Projects','UserProfileResource','error','stack','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x41aa83,_0x102348){var _0x2863dc=function(_0x2d3194){while(--_0x2d3194){_0x41aa83['push'](_0x41aa83['shift']());}};_0x2863dc(++_0x102348);}(_0x1184,0xa0));var _0x4118=function(_0x3ce142,_0x5c6eb5){_0x3ce142=_0x3ce142-0x0;var _0xb31774=_0x1184[_0x3ce142];return _0xb31774;};'use strict';var emlformat=require(_0x4118('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4118('0x1'));var jsonpatch=require(_0x4118('0x2'));var rp=require('request-promise');var moment=require(_0x4118('0x3'));var BPromise=require(_0x4118('0x4'));var Mustache=require(_0x4118('0x5'));var util=require(_0x4118('0x6'));var path=require('path');var sox=require(_0x4118('0x7'));var csv=require(_0x4118('0x8'));var ejs=require(_0x4118('0x9'));var fs=require('fs');var fs_extra=require(_0x4118('0xa'));var _=require('lodash');var squel=require(_0x4118('0xb'));var crypto=require(_0x4118('0xc'));var jsforce=require(_0x4118('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4118('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4118('0xf'));var qs=require(_0x4118('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4118('0x11'));var utils=require('../../config/utils');var config=require(_0x4118('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24e172,_0x5439de){_0x5439de=_0x5439de||0xcc;return function(_0x52c3dd){if(_0x52c3dd){return _0x24e172[_0x4118('0x13')](_0x5439de);}return _0x24e172[_0x4118('0x14')](_0x5439de)[_0x4118('0x15')]();};}function respondWithResult(_0x5aeaac,_0x292086){_0x292086=_0x292086||0xc8;return function(_0xc9fee9){if(_0xc9fee9){return _0x5aeaac[_0x4118('0x14')](_0x292086)['json'](_0xc9fee9);}};}function respondWithFilteredResult(_0x30e9e4,_0x5c9b25){return function(_0x18d135){if(_0x18d135){var _0x45ec56=typeof _0x5c9b25[_0x4118('0x16')]==='undefined'&&typeof _0x5c9b25[_0x4118('0x17')]===_0x4118('0x18');var _0x33eb6d=_0x18d135[_0x4118('0x19')];var _0x1fb629=_0x45ec56?0x0:_0x5c9b25['offset'];var _0x2d48ec=_0x45ec56?_0x18d135[_0x4118('0x19')]:_0x5c9b25[_0x4118('0x16')]+_0x5c9b25[_0x4118('0x17')];var _0x1e1824;if(_0x2d48ec>=_0x33eb6d){_0x2d48ec=_0x33eb6d;_0x1e1824=0xc8;}else{_0x1e1824=0xce;}_0x30e9e4['status'](_0x1e1824);return _0x30e9e4[_0x4118('0x1a')](_0x4118('0x1b'),_0x1fb629+'-'+_0x2d48ec+'/'+_0x33eb6d)[_0x4118('0x1c')](_0x18d135);}return null;};}function patchUpdates(_0x545bc9){return function(_0x34c62f){try{jsonpatch[_0x4118('0x1d')](_0x34c62f,_0x545bc9,!![]);}catch(_0x3a0fe0){return BPromise[_0x4118('0x1e')](_0x3a0fe0);}return _0x34c62f[_0x4118('0x1f')]();};}function saveUpdates(_0x2e8dec,_0x5dc4a7){return function(_0x70906e){if(_0x70906e){return _0x70906e[_0x4118('0x20')](_0x2e8dec)[_0x4118('0x21')](function(_0x1ee843){return _0x1ee843;});}return null;};}function removeEntity(_0xa6c615,_0x4b49b0){return function(_0x4af9c5){if(_0x4af9c5){return _0x4af9c5['destroy']()['then'](function(){var _0x5eba49=_0x4af9c5[_0x4118('0x22')]({'plain':!![]});var _0x21aca4=_0x4118('0x23');return db[_0x4118('0x24')]['destroy']({'where':{'type':_0x21aca4,'resourceId':_0x5eba49['id']}})[_0x4118('0x21')](function(){return _0x4af9c5;});})['then'](function(){_0xa6c615[_0x4118('0x14')](0xcc)[_0x4118('0x15')]();});}};}function handleEntityNotFound(_0x8e261e,_0x2773b2){return function(_0x35d809){if(!_0x35d809){_0x8e261e[_0x4118('0x13')](0x194);}return _0x35d809;};}function handleError(_0x49a5dd,_0x138df2){_0x138df2=_0x138df2||0x1f4;return function(_0x170a67){logger[_0x4118('0x25')](_0x170a67[_0x4118('0x26')]);if(_0x170a67['name']){delete _0x170a67['name'];}_0x49a5dd[_0x4118('0x14')](_0x138df2)[_0x4118('0x27')](_0x170a67);};}exports[_0x4118('0x28')]=function(_0x359783,_0x132e76){var _0x5949c5={},_0x5f115e={},_0x2462d1={'count':0x0,'rows':[]};var _0x36f0c5=_[_0x4118('0x29')](db[_0x4118('0x2a')][_0x4118('0x2b')],function(_0x2638ff){return{'name':_0x2638ff[_0x4118('0x2c')],'type':_0x2638ff[_0x4118('0x2d')][_0x4118('0x2e')]};});_0x5f115e[_0x4118('0x2f')]=_[_0x4118('0x29')](_0x36f0c5,_0x4118('0x30'));_0x5f115e[_0x4118('0x31')]=_[_0x4118('0x32')](_0x359783[_0x4118('0x31')]);_0x5f115e[_0x4118('0x33')]=_[_0x4118('0x34')](_0x5f115e[_0x4118('0x2f')],_0x5f115e[_0x4118('0x31')]);_0x5949c5['attributes']=_[_0x4118('0x34')](_0x5f115e[_0x4118('0x2f')],qs[_0x4118('0x35')](_0x359783[_0x4118('0x31')][_0x4118('0x35')]));_0x5949c5[_0x4118('0x36')]=_0x5949c5['attributes'][_0x4118('0x37')]?_0x5949c5['attributes']:_0x5f115e['model'];if(!_0x359783[_0x4118('0x31')][_0x4118('0x38')]('nolimit')){_0x5949c5[_0x4118('0x17')]=qs[_0x4118('0x17')](_0x359783[_0x4118('0x31')]['limit']);_0x5949c5[_0x4118('0x16')]=qs[_0x4118('0x16')](_0x359783[_0x4118('0x31')]['offset']);}_0x5949c5['order']=qs[_0x4118('0x39')](_0x359783[_0x4118('0x31')][_0x4118('0x39')]);_0x5949c5[_0x4118('0x3a')]=qs[_0x4118('0x33')](_[_0x4118('0x3b')](_0x359783['query'],_0x5f115e[_0x4118('0x33')]),_0x36f0c5);if(_0x359783['query']['filter']){_0x5949c5[_0x4118('0x3a')]=_['merge'](_0x5949c5[_0x4118('0x3a')],{'$or':_[_0x4118('0x29')](_0x36f0c5,function(_0x2f151a){if(_0x2f151a['type']!==_0x4118('0x3c')){var _0x1ef488={};_0x1ef488[_0x2f151a[_0x4118('0x30')]]={'$like':'%'+_0x359783[_0x4118('0x31')][_0x4118('0x3d')]+'%'};return _0x1ef488;}})});}_0x5949c5=_[_0x4118('0x3e')]({},_0x5949c5,_0x359783[_0x4118('0x3f')]);var _0x30e355={'where':_0x5949c5['where']};return db[_0x4118('0x2a')][_0x4118('0x19')](_0x30e355)[_0x4118('0x21')](function(_0x12cac6){_0x2462d1[_0x4118('0x19')]=_0x12cac6;if(_0x359783[_0x4118('0x31')][_0x4118('0x40')]){_0x5949c5[_0x4118('0x41')]=[{'all':!![]}];}return db['JscriptyProject'][_0x4118('0x42')](_0x5949c5);})['then'](function(_0x38cac1){_0x2462d1[_0x4118('0x43')]=_0x38cac1;return _0x2462d1;})['then'](respondWithFilteredResult(_0x132e76,_0x5949c5))['catch'](handleError(_0x132e76,null));};exports[_0x4118('0x44')]=function(_0x8a16ec,_0x3c929f){var _0x2b24ac={'raw':![],'where':{'id':_0x8a16ec['params']['id']}},_0x5e72a1={};_0x5e72a1['model']=_['keys'](db[_0x4118('0x2a')]['rawAttributes']);_0x5e72a1[_0x4118('0x31')]=_[_0x4118('0x32')](_0x8a16ec[_0x4118('0x31')]);_0x5e72a1[_0x4118('0x33')]=_[_0x4118('0x34')](_0x5e72a1[_0x4118('0x2f')],_0x5e72a1['query']);_0x2b24ac[_0x4118('0x36')]=_[_0x4118('0x34')](_0x5e72a1[_0x4118('0x2f')],qs[_0x4118('0x35')](_0x8a16ec[_0x4118('0x31')][_0x4118('0x35')]));_0x2b24ac['attributes']=_0x2b24ac['attributes']['length']?_0x2b24ac[_0x4118('0x36')]:_0x5e72a1[_0x4118('0x2f')];if(_0x8a16ec['query'][_0x4118('0x40')]){_0x2b24ac[_0x4118('0x41')]=[{'all':!![]}];}_0x2b24ac=_[_0x4118('0x3e')]({},_0x2b24ac,_0x8a16ec[_0x4118('0x3f')]);return db['JscriptyProject'][_0x4118('0x45')](_0x2b24ac)[_0x4118('0x21')](handleEntityNotFound(_0x3c929f,null))[_0x4118('0x21')](respondWithResult(_0x3c929f,null))[_0x4118('0x46')](handleError(_0x3c929f,null));};exports[_0x4118('0x47')]=function(_0x291461,_0x4421d6){return db[_0x4118('0x2a')][_0x4118('0x47')](_0x291461[_0x4118('0x48')],{})[_0x4118('0x21')](function(_0x5e3f0d){var _0x5970e1=_0x291461['user'][_0x4118('0x22')]({'plain':!![]});if(!_0x5970e1)throw new Error(_0x4118('0x49'));if(_0x5970e1[_0x4118('0x4a')]===_0x4118('0x4b')){var _0x526478=_0x5e3f0d[_0x4118('0x22')]({'plain':!![]});var _0x448aa2=_0x4118('0x23');return db[_0x4118('0x4c')][_0x4118('0x45')]({'where':{'name':_0x448aa2,'userProfileId':_0x5970e1[_0x4118('0x4d')]},'raw':!![]})[_0x4118('0x21')](function(_0x147148){if(_0x147148&&_0x147148[_0x4118('0x4e')]===0x0){return db[_0x4118('0x24')][_0x4118('0x47')]({'name':_0x526478['name'],'resourceId':_0x526478['id'],'type':_0x147148[_0x4118('0x30')],'sectionId':_0x147148['id']},{})[_0x4118('0x21')](function(){return _0x5e3f0d;});}else{return _0x5e3f0d;}})['catch'](function(_0x1f8e3b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f8e3b);throw _0x1f8e3b;});}return _0x5e3f0d;})[_0x4118('0x21')](respondWithResult(_0x4421d6,0xc9))[_0x4118('0x46')](handleError(_0x4421d6,null));};exports[_0x4118('0x4f')]=function(_0x5e285d,_0x2e195c){var _0x5377a8={'where':{'id':_0x5e285d[_0x4118('0x50')]['id']}},_0x51dddd={};_0x51dddd['model']=_[_0x4118('0x32')](db[_0x4118('0x2a')][_0x4118('0x2b')]);_0x5377a8['attributes']=_[_0x4118('0x34')](_0x51dddd['model'],qs[_0x4118('0x35')](_0x5e285d['query'][_0x4118('0x35')]));_0x5377a8[_0x4118('0x36')]=_0x5377a8[_0x4118('0x36')][_0x4118('0x37')]?_0x5377a8[_0x4118('0x36')]:_0x51dddd[_0x4118('0x2f')];if(_0x5e285d[_0x4118('0x31')][_0x4118('0x40')]){_0x5377a8['include']=[{'all':!![]}];}_0x5377a8=_[_0x4118('0x3e')]({},_0x5377a8,_0x5e285d[_0x4118('0x3f')]);return db['JscriptyProject']['find'](_0x5377a8)[_0x4118('0x21')](handleEntityNotFound(_0x2e195c,null))['then'](function(_0x5bf1fe){if(_0x5bf1fe){var _0x5f34aa=_0x5bf1fe[_0x4118('0x22')]({'plain':!![]});_0x5f34aa=qs['omit'](_0x5f34aa,['id',_0x4118('0x51'),_0x4118('0x52')]);_0x5e285d[_0x4118('0x48')]=_['omit'](_0x5e285d[_0x4118('0x48')],['id','createdAt',_0x4118('0x52')]);return db['JscriptyProject'][_0x4118('0x47')](_['merge'](_0x5f34aa,_0x5e285d['body']),{'include':_0x5e285d[_0x4118('0x31')][_0x4118('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x506cd1){var _0x504fc1=_0x5e285d[_0x4118('0x4b')]['get']({'plain':!![]});if(!_0x504fc1)throw new Error(_0x4118('0x49'));if(_0x504fc1[_0x4118('0x4a')]===_0x4118('0x4b')){var _0x500833=_0x506cd1[_0x4118('0x22')]({'plain':!![]});var _0x3cac26=_0x4118('0x23');return db[_0x4118('0x4c')][_0x4118('0x45')]({'where':{'name':_0x3cac26,'userProfileId':_0x504fc1[_0x4118('0x4d')]},'raw':!![]})[_0x4118('0x21')](function(_0x27cf50){if(_0x27cf50&&_0x27cf50[_0x4118('0x4e')]===0x0){return db[_0x4118('0x24')][_0x4118('0x47')]({'name':_0x500833[_0x4118('0x30')],'resourceId':_0x500833['id'],'type':_0x27cf50[_0x4118('0x30')],'sectionId':_0x27cf50['id']},{})[_0x4118('0x21')](function(){return _0x506cd1;});}else{return _0x506cd1;}})['catch'](function(_0x20a937){logger['error'](_0x4118('0x53'),_0x20a937);throw _0x20a937;});}return _0x506cd1;});}})['then'](respondWithResult(_0x2e195c,0xc9))[_0x4118('0x46')](handleError(_0x2e195c,null));};exports[_0x4118('0x20')]=function(_0x5e92d1,_0x1a0a8c){if(_0x5e92d1['body']['id']){delete _0x5e92d1['body']['id'];}return db[_0x4118('0x2a')][_0x4118('0x45')]({'where':{'id':_0x5e92d1['params']['id']}})[_0x4118('0x21')](handleEntityNotFound(_0x1a0a8c,null))[_0x4118('0x21')](saveUpdates(_0x5e92d1[_0x4118('0x48')],null))[_0x4118('0x21')](respondWithResult(_0x1a0a8c,null))[_0x4118('0x46')](handleError(_0x1a0a8c,null));};exports[_0x4118('0x54')]=function(_0x2705a9,_0x4f699f){return db[_0x4118('0x2a')]['find']({'where':{'id':_0x2705a9[_0x4118('0x50')]['id']}})[_0x4118('0x21')](handleEntityNotFound(_0x4f699f,null))[_0x4118('0x21')](removeEntity(_0x4f699f,null))[_0x4118('0x46')](handleError(_0x4f699f,null));};exports[_0x4118('0x55')]=function(_0x13bcbc,_0x413724,_0x5a1846){var _0x552448={'raw':!![],'where':{}};var _0x42844f={};var _0x2e31ed={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4118('0x56')]({'where':{'id':_0x13bcbc[_0x4118('0x50')]['id']}})[_0x4118('0x21')](handleEntityNotFound(_0x413724,null))['then'](function(_0x54529e){if(_0x54529e){_0x42844f[_0x4118('0x2f')]=_[_0x4118('0x32')](db[_0x4118('0x57')][_0x4118('0x2b')]);_0x42844f[_0x4118('0x31')]=_[_0x4118('0x32')](_0x13bcbc[_0x4118('0x31')]);_0x42844f['filters']=_[_0x4118('0x34')](_0x42844f[_0x4118('0x2f')],_0x42844f[_0x4118('0x31')]);_0x552448[_0x4118('0x36')]=_[_0x4118('0x34')](_0x42844f['model'],qs[_0x4118('0x35')](_0x13bcbc[_0x4118('0x31')][_0x4118('0x35')]));_0x552448['attributes']=_0x552448[_0x4118('0x36')]['length']?_0x552448[_0x4118('0x36')]:_0x42844f[_0x4118('0x2f')];if(!_0x13bcbc[_0x4118('0x31')]['hasOwnProperty'](_0x4118('0x58'))){_0x552448['limit']=qs['limit'](_0x13bcbc[_0x4118('0x31')][_0x4118('0x17')]);_0x552448[_0x4118('0x16')]=qs[_0x4118('0x16')](_0x13bcbc[_0x4118('0x31')][_0x4118('0x16')]);}_0x552448[_0x4118('0x59')]=qs['sort'](_0x13bcbc[_0x4118('0x31')][_0x4118('0x39')]);_0x552448[_0x4118('0x3a')]=qs[_0x4118('0x33')](_[_0x4118('0x3b')](_0x13bcbc[_0x4118('0x31')],_0x42844f[_0x4118('0x33')]));_0x552448[_0x4118('0x3a')][_0x4118('0x5a')]=_0x54529e['id'];if(_0x13bcbc[_0x4118('0x31')]['filter']){_0x552448['where']=_[_0x4118('0x3e')](_0x552448[_0x4118('0x3a')],{'$or':_[_0x4118('0x29')](_0x552448[_0x4118('0x36')],function(_0x133e9d){var _0x14ab8e={};_0x14ab8e[_0x133e9d]={'$like':'%'+_0x13bcbc['query']['filter']+'%'};return _0x14ab8e;})});}_0x552448=_[_0x4118('0x3e')]({},_0x552448,_0x13bcbc[_0x4118('0x3f')]);return db[_0x4118('0x57')][_0x4118('0x19')]({'where':_0x552448[_0x4118('0x3a')]})[_0x4118('0x21')](function(_0x11be80){_0x2e31ed[_0x4118('0x19')]=_0x11be80;if(_0x13bcbc['query']['includeAll']){_0x552448['include']=[{'all':!![]}];}return db[_0x4118('0x57')][_0x4118('0x42')](_0x552448);})[_0x4118('0x21')](function(_0x4ff32f){_0x2e31ed[_0x4118('0x43')]=_0x4ff32f;return _0x2e31ed;});}})[_0x4118('0x21')](respondWithFilteredResult(_0x413724,_0x552448))['catch'](handleError(_0x413724,null));};exports[_0x4118('0x5b')]=function(_0x4da54b,_0xf26d53,_0x5b3d89){var _0x21ea00={'raw':!![],'where':{}};var _0x5a3b3b={};var _0x5400d3={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4118('0x56')]({'where':{'id':_0x4da54b[_0x4118('0x50')]['id']}})['then'](handleEntityNotFound(_0xf26d53,null))[_0x4118('0x21')](function(_0x3ed43c){if(_0x3ed43c){_0x5a3b3b[_0x4118('0x2f')]=_[_0x4118('0x32')](db[_0x4118('0x5c')][_0x4118('0x2b')]);_0x5a3b3b[_0x4118('0x31')]=_[_0x4118('0x32')](_0x4da54b[_0x4118('0x31')]);_0x5a3b3b[_0x4118('0x33')]=_[_0x4118('0x34')](_0x5a3b3b[_0x4118('0x2f')],_0x5a3b3b[_0x4118('0x31')]);_0x21ea00[_0x4118('0x36')]=_[_0x4118('0x34')](_0x5a3b3b[_0x4118('0x2f')],qs[_0x4118('0x35')](_0x4da54b['query']['fields']));_0x21ea00[_0x4118('0x36')]=_0x21ea00[_0x4118('0x36')][_0x4118('0x37')]?_0x21ea00[_0x4118('0x36')]:_0x5a3b3b[_0x4118('0x2f')];if(!_0x4da54b[_0x4118('0x31')][_0x4118('0x38')](_0x4118('0x58'))){_0x21ea00['limit']=qs['limit'](_0x4da54b[_0x4118('0x31')][_0x4118('0x17')]);_0x21ea00['offset']=qs[_0x4118('0x16')](_0x4da54b['query']['offset']);}_0x21ea00[_0x4118('0x59')]=qs['sort'](_0x4da54b[_0x4118('0x31')][_0x4118('0x39')]);_0x21ea00[_0x4118('0x3a')]=qs[_0x4118('0x33')](_[_0x4118('0x3b')](_0x4da54b[_0x4118('0x31')],_0x5a3b3b[_0x4118('0x33')]));_0x21ea00[_0x4118('0x3a')][_0x4118('0x5a')]=_0x3ed43c['id'];if(_0x4da54b[_0x4118('0x31')]['filter']){_0x21ea00['where']=_[_0x4118('0x3e')](_0x21ea00[_0x4118('0x3a')],{'$or':_['map'](_0x21ea00['attributes'],function(_0x58885e){var _0x317cad={};_0x317cad[_0x58885e]={'$like':'%'+_0x4da54b[_0x4118('0x31')][_0x4118('0x3d')]+'%'};return _0x317cad;})});}_0x21ea00=_[_0x4118('0x3e')]({},_0x21ea00,_0x4da54b[_0x4118('0x3f')]);return db['JscriptyAnswerReport'][_0x4118('0x19')]({'where':_0x21ea00['where']})['then'](function(_0x5d57aa){_0x5400d3[_0x4118('0x19')]=_0x5d57aa;if(_0x4da54b[_0x4118('0x31')]['includeAll']){_0x21ea00[_0x4118('0x41')]=[{'all':!![]}];}return db[_0x4118('0x5c')][_0x4118('0x42')](_0x21ea00);})[_0x4118('0x21')](function(_0x42c45d){_0x5400d3[_0x4118('0x43')]=_0x42c45d;return _0x5400d3;});}})[_0x4118('0x21')](respondWithFilteredResult(_0xf26d53,_0x21ea00))[_0x4118('0x46')](handleError(_0xf26d53,null));};function char(_0x4f8e5f){return _0x4118('0x5d')===typeof _0x4f8e5f?String['fromCharCode'][_0x4118('0x1d')](null,arguments):_0x4f8e5f;}function needsEncapsulation(_0x585e27){return!!_0x585e27&&(_0x585e27[_0x4118('0x5e')]()[_0x4118('0x5f')](char(0xd))>=0x0||_0x585e27[_0x4118('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x585e27[_0x4118('0x5e')]()[_0x4118('0x5f')](char(0x2c))>=0x0||_0x585e27['toString']()[_0x4118('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x4f7426){var _0x49af03=char(0x22),_0x11eb2d='\x5c'+char(0x22),_0x407c74=_0x4f7426[_0x4118('0x5e')]()[_0x4118('0x60')](new RegExp(_0x49af03,'g'),_0x11eb2d);return _0x49af03+_0x407c74+_0x49af03;}exports[_0x4118('0x61')]=function(_0xfdbd0f,_0x58c464,_0xc51d8e){var _0x3cb136,_0x495aa4;var _0x4ed269={'where':{'ProjectId':_0xfdbd0f[_0x4118('0x50')]['id']}};if(_0xfdbd0f[_0x4118('0x31')][_0x4118('0x62')]){_0x4ed269[_0x4118('0x3a')][_0x4118('0x63')]=JSON[_0x4118('0x64')](_0xfdbd0f['query']['startTime']);}return db['JscriptySessionReport'][_0x4118('0x42')](_0x4ed269)['then'](handleEntityNotFound(_0x58c464,null))['then'](function(_0x7e9eaf){if(_0x7e9eaf){_0x3cb136=_0x7e9eaf;return db[_0x4118('0x65')][_0x4118('0x42')]({'where':{'SessionId':{'$in':_['map'](_0x3cb136,'id')},'ProjectId':_0xfdbd0f[_0x4118('0x50')]['id']},'order':_0x4118('0x66')});}})[_0x4118('0x21')](handleEntityNotFound(_0x58c464,null))[_0x4118('0x21')](function(_0x510aef){if(_0x510aef){_0x495aa4=_0x510aef;var _0x2bb6e9={};for(var _0x912782=0x0,_0x53211c=_0x495aa4[_0x4118('0x37')];_0x912782<_0x53211c;_0x912782++){if(!_0x2bb6e9['hasOwnProperty'](_0x495aa4[_0x912782]['questionId'])){_0x2bb6e9[_0x495aa4[_0x912782]['questionId']]=needsEncapsulation(_0x495aa4[_0x912782][_0x4118('0x67')])?encapsulate(_0x495aa4[_0x912782][_0x4118('0x67')]):_0x495aa4[_0x912782][_0x4118('0x67')];}}var _0x3ba61f=[],_0x29134e={};for(var _0x316f0e=0x0,_0x69d772=_0x3cb136[_0x4118('0x37')];_0x316f0e<_0x69d772;_0x316f0e++){_0x29134e={'ProjectId':_0xfdbd0f[_0x4118('0x50')]['id'],'SessionId':_0x3cb136[_0x316f0e]['id'],'StartTime':moment(_0x3cb136[_0x316f0e]['starttime'])[_0x4118('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x2af1eb=0x0,_0x52e152=_0x495aa4[_0x4118('0x37')];_0x2af1eb<_0x52e152;_0x2af1eb++){if(_0x495aa4[_0x2af1eb]['SessionId']==_0x3cb136[_0x316f0e]['id']&&_0x2bb6e9[_0x4118('0x38')](_0x495aa4[_0x2af1eb][_0x4118('0x69')])){_0x29134e[_0x2bb6e9[_0x495aa4[_0x2af1eb][_0x4118('0x69')]]]=_0x495aa4[_0x2af1eb][_0x4118('0x6a')];}}for(var _0x22a2b6 in _0x2bb6e9){if(!_0x29134e[_0x4118('0x38')](_0x2bb6e9[_0x22a2b6])){_0x29134e[_0x2bb6e9[_0x22a2b6]]=null;}}_0x3ba61f[_0x4118('0x6b')](_0x29134e);}return _0x3ba61f;}})['then'](function(_0x5ef2b9){if(!_[_0x4118('0x6c')](_0x5ef2b9)){var _0x36379b=toCsv(_0x5ef2b9);var _0x59672a=Date[_0x4118('0x6d')]();fs[_0x4118('0x6e')](util['format'](_0x4118('0x6f'),_0xfdbd0f[_0x4118('0x50')]['id'],_0x59672a),_0x36379b);_0x58c464[_0x4118('0x70')](_0x4118('0x71'),_0x4118('0x72')+util[_0x4118('0x68')]('Jscripty_Project_%d_Summary_%s.csv',_0xfdbd0f[_0x4118('0x50')]['id'],_0x59672a));_0x58c464[_0x4118('0x70')](_0x4118('0x73'),_0x4118('0x74'));return _0x58c464['download'](util[_0x4118('0x68')](_0x4118('0x6f'),_0xfdbd0f[_0x4118('0x50')]['id'],_0x59672a));}else{return _0x58c464['sendStatus'](0xcc);}})[_0x4118('0x46')](handleError(_0x58c464,null));};
\ No newline at end of file
+var _0x0b0d=['createdAt','updatedAt','body','role','userProfileId','destroy','getSessions','findOne','order','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','hasOwnProperty','number','toString','indexOf','replace','startTime','starttime','parse','-createdAt','questionId','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','Projects','UserProfileResource','error','stack','name','index','map','JscriptyProject','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','clone','omit'];(function(_0x2f7cee,_0x82f371){var _0x515270=function(_0x56586a){while(--_0x56586a){_0x2f7cee['push'](_0x2f7cee['shift']());}};_0x515270(++_0x82f371);}(_0x0b0d,0x117));var _0xd0b0=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x0b0d[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require(_0xd0b0('0x0'));var rimraf=require(_0xd0b0('0x1'));var zipdir=require(_0xd0b0('0x2'));var jsonpatch=require(_0xd0b0('0x3'));var rp=require(_0xd0b0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd0b0('0x5'));var util=require(_0xd0b0('0x6'));var path=require(_0xd0b0('0x7'));var sox=require(_0xd0b0('0x8'));var csv=require(_0xd0b0('0x9'));var ejs=require(_0xd0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xd0b0('0xb'));var _=require('lodash');var squel=require(_0xd0b0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd0b0('0xd'));var toCsv=require(_0xd0b0('0x9'));var querystring=require('querystring');var Papa=require(_0xd0b0('0xe'));var Redis=require(_0xd0b0('0xf'));var authService=require(_0xd0b0('0x10'));var qs=require(_0xd0b0('0x11'));var as=require(_0xd0b0('0x12'));var hardwareService=require(_0xd0b0('0x13'));var logger=require(_0xd0b0('0x14'))(_0xd0b0('0x15'));var utils=require(_0xd0b0('0x16'));var config=require(_0xd0b0('0x17'));var licenseUtil=require(_0xd0b0('0x18'));var db=require(_0xd0b0('0x19'))['db'];function respondWithStatusCode(_0x19f3a0,_0x1ee8ad){_0x1ee8ad=_0x1ee8ad||0xcc;return function(_0x33c024){if(_0x33c024){return _0x19f3a0[_0xd0b0('0x1a')](_0x1ee8ad);}return _0x19f3a0[_0xd0b0('0x1b')](_0x1ee8ad)[_0xd0b0('0x1c')]();};}function respondWithResult(_0x36eba9,_0x559d39){_0x559d39=_0x559d39||0xc8;return function(_0x37ab85){if(_0x37ab85){return _0x36eba9[_0xd0b0('0x1b')](_0x559d39)[_0xd0b0('0x1d')](_0x37ab85);}};}function respondWithFilteredResult(_0x5e877c,_0x3f8737){return function(_0x59417c){if(_0x59417c){var _0x46179f=typeof _0x3f8737[_0xd0b0('0x1e')]===_0xd0b0('0x1f')&&typeof _0x3f8737[_0xd0b0('0x20')]===_0xd0b0('0x1f');var _0x4cc6d6=_0x59417c[_0xd0b0('0x21')];var _0x556302=_0x46179f?0x0:_0x3f8737[_0xd0b0('0x1e')];var _0x4af2fb=_0x46179f?_0x59417c[_0xd0b0('0x21')]:_0x3f8737[_0xd0b0('0x1e')]+_0x3f8737[_0xd0b0('0x20')];var _0x18d7f5;if(_0x4af2fb>=_0x4cc6d6){_0x4af2fb=_0x4cc6d6;_0x18d7f5=0xc8;}else{_0x18d7f5=0xce;}_0x5e877c['status'](_0x18d7f5);return _0x5e877c[_0xd0b0('0x22')](_0xd0b0('0x23'),_0x556302+'-'+_0x4af2fb+'/'+_0x4cc6d6)[_0xd0b0('0x1d')](_0x59417c);}return null;};}function patchUpdates(_0x16e0df){return function(_0x57e7e2){try{jsonpatch[_0xd0b0('0x24')](_0x57e7e2,_0x16e0df,!![]);}catch(_0xdc6f10){return BPromise['reject'](_0xdc6f10);}return _0x57e7e2[_0xd0b0('0x25')]();};}function saveUpdates(_0x1d81f6,_0x22d0f3){return function(_0x19e649){if(_0x19e649){return _0x19e649[_0xd0b0('0x26')](_0x1d81f6)[_0xd0b0('0x27')](function(_0x19ccd9){return _0x19ccd9;});}return null;};}function removeEntity(_0x162da6,_0x4f81c6){return function(_0x54fe4a){if(_0x54fe4a){return _0x54fe4a['destroy']()['then'](function(){var _0x21f50a=_0x54fe4a['get']({'plain':!![]});var _0x4e6cc9=_0xd0b0('0x28');return db[_0xd0b0('0x29')]['destroy']({'where':{'type':_0x4e6cc9,'resourceId':_0x21f50a['id']}})[_0xd0b0('0x27')](function(){return _0x54fe4a;});})[_0xd0b0('0x27')](function(){_0x162da6[_0xd0b0('0x1b')](0xcc)[_0xd0b0('0x1c')]();});}};}function handleEntityNotFound(_0x4f4ec2,_0x3b14ba){return function(_0x1a1b99){if(!_0x1a1b99){_0x4f4ec2[_0xd0b0('0x1a')](0x194);}return _0x1a1b99;};}function handleError(_0x571f5f,_0x29fa21){_0x29fa21=_0x29fa21||0x1f4;return function(_0x7cfd52){logger[_0xd0b0('0x2a')](_0x7cfd52[_0xd0b0('0x2b')]);if(_0x7cfd52[_0xd0b0('0x2c')]){delete _0x7cfd52[_0xd0b0('0x2c')];}_0x571f5f[_0xd0b0('0x1b')](_0x29fa21)['send'](_0x7cfd52);};}exports[_0xd0b0('0x2d')]=function(_0x28572f,_0x4ab4c3){var _0x1c6423={},_0x3f1290={},_0x53de17={'count':0x0,'rows':[]};var _0xcc78e1=_[_0xd0b0('0x2e')](db[_0xd0b0('0x2f')]['rawAttributes'],function(_0x2dcfd5){return{'name':_0x2dcfd5[_0xd0b0('0x30')],'type':_0x2dcfd5[_0xd0b0('0x31')][_0xd0b0('0x32')]};});_0x3f1290[_0xd0b0('0x33')]=_[_0xd0b0('0x2e')](_0xcc78e1,_0xd0b0('0x2c'));_0x3f1290[_0xd0b0('0x34')]=_['keys'](_0x28572f[_0xd0b0('0x34')]);_0x3f1290[_0xd0b0('0x35')]=_[_0xd0b0('0x36')](_0x3f1290[_0xd0b0('0x33')],_0x3f1290[_0xd0b0('0x34')]);_0x1c6423[_0xd0b0('0x37')]=_['intersection'](_0x3f1290[_0xd0b0('0x33')],qs[_0xd0b0('0x38')](_0x28572f[_0xd0b0('0x34')][_0xd0b0('0x38')]));_0x1c6423[_0xd0b0('0x37')]=_0x1c6423[_0xd0b0('0x37')][_0xd0b0('0x39')]?_0x1c6423[_0xd0b0('0x37')]:_0x3f1290[_0xd0b0('0x33')];if(!_0x28572f['query']['hasOwnProperty'](_0xd0b0('0x3a'))){_0x1c6423[_0xd0b0('0x20')]=qs['limit'](_0x28572f[_0xd0b0('0x34')][_0xd0b0('0x20')]);_0x1c6423[_0xd0b0('0x1e')]=qs[_0xd0b0('0x1e')](_0x28572f[_0xd0b0('0x34')][_0xd0b0('0x1e')]);}_0x1c6423['order']=qs[_0xd0b0('0x3b')](_0x28572f[_0xd0b0('0x34')][_0xd0b0('0x3b')]);_0x1c6423[_0xd0b0('0x3c')]=qs[_0xd0b0('0x35')](_[_0xd0b0('0x3d')](_0x28572f[_0xd0b0('0x34')],_0x3f1290[_0xd0b0('0x35')]),_0xcc78e1);if(_0x28572f[_0xd0b0('0x34')]['filter']){_0x1c6423[_0xd0b0('0x3c')]=_[_0xd0b0('0x3e')](_0x1c6423['where'],{'$or':_[_0xd0b0('0x2e')](_0xcc78e1,function(_0x2a939e){if(_0x2a939e[_0xd0b0('0x31')]!==_0xd0b0('0x3f')){var _0x3a501b={};_0x3a501b[_0x2a939e[_0xd0b0('0x2c')]]={'$like':'%'+_0x28572f[_0xd0b0('0x34')][_0xd0b0('0x40')]+'%'};return _0x3a501b;}})});}_0x1c6423=_[_0xd0b0('0x3e')]({},_0x1c6423,_0x28572f[_0xd0b0('0x41')]);var _0x12c44e={'where':_0x1c6423[_0xd0b0('0x3c')]};return db[_0xd0b0('0x2f')][_0xd0b0('0x21')](_0x12c44e)[_0xd0b0('0x27')](function(_0x313074){_0x53de17[_0xd0b0('0x21')]=_0x313074;if(_0x28572f[_0xd0b0('0x34')][_0xd0b0('0x42')]){_0x1c6423[_0xd0b0('0x43')]=[{'all':!![]}];}return db[_0xd0b0('0x2f')][_0xd0b0('0x44')](_0x1c6423);})[_0xd0b0('0x27')](function(_0x58ed55){_0x53de17[_0xd0b0('0x45')]=_0x58ed55;return _0x53de17;})['then'](respondWithFilteredResult(_0x4ab4c3,_0x1c6423))['catch'](handleError(_0x4ab4c3,null));};exports[_0xd0b0('0x46')]=function(_0x362d16,_0x4c5dd5){var _0x49b1e9={'raw':![],'where':{'id':_0x362d16[_0xd0b0('0x47')]['id']}},_0x1cb1dd={};_0x1cb1dd[_0xd0b0('0x33')]=_[_0xd0b0('0x48')](db[_0xd0b0('0x2f')][_0xd0b0('0x49')]);_0x1cb1dd[_0xd0b0('0x34')]=_[_0xd0b0('0x48')](_0x362d16[_0xd0b0('0x34')]);_0x1cb1dd[_0xd0b0('0x35')]=_['intersection'](_0x1cb1dd[_0xd0b0('0x33')],_0x1cb1dd[_0xd0b0('0x34')]);_0x49b1e9[_0xd0b0('0x37')]=_[_0xd0b0('0x36')](_0x1cb1dd[_0xd0b0('0x33')],qs[_0xd0b0('0x38')](_0x362d16[_0xd0b0('0x34')][_0xd0b0('0x38')]));_0x49b1e9[_0xd0b0('0x37')]=_0x49b1e9[_0xd0b0('0x37')][_0xd0b0('0x39')]?_0x49b1e9[_0xd0b0('0x37')]:_0x1cb1dd[_0xd0b0('0x33')];if(_0x362d16[_0xd0b0('0x34')][_0xd0b0('0x42')]){_0x49b1e9[_0xd0b0('0x43')]=[{'all':!![]}];}_0x49b1e9=_[_0xd0b0('0x3e')]({},_0x49b1e9,_0x362d16[_0xd0b0('0x41')]);return db[_0xd0b0('0x2f')][_0xd0b0('0x4a')](_0x49b1e9)[_0xd0b0('0x27')](handleEntityNotFound(_0x4c5dd5,null))[_0xd0b0('0x27')](respondWithResult(_0x4c5dd5,null))[_0xd0b0('0x4b')](handleError(_0x4c5dd5,null));};exports[_0xd0b0('0x4c')]=function(_0x4722ba,_0x5240bb){return db['JscriptyProject'][_0xd0b0('0x4c')](_0x4722ba['body'],{})[_0xd0b0('0x27')](function(_0x4fb525){var _0x480155=_0x4722ba[_0xd0b0('0x4d')][_0xd0b0('0x4e')]({'plain':!![]});if(!_0x480155)throw new Error(_0xd0b0('0x4f'));if(_0x480155['role']===_0xd0b0('0x4d')){var _0x1d831f=_0x4fb525[_0xd0b0('0x4e')]({'plain':!![]});var _0x42acd7=_0xd0b0('0x28');return db[_0xd0b0('0x50')][_0xd0b0('0x4a')]({'where':{'name':_0x42acd7,'userProfileId':_0x480155['userProfileId']},'raw':!![]})['then'](function(_0x2f9624){if(_0x2f9624&&_0x2f9624[_0xd0b0('0x51')]===0x0){return db['UserProfileResource'][_0xd0b0('0x4c')]({'name':_0x1d831f[_0xd0b0('0x2c')],'resourceId':_0x1d831f['id'],'type':_0x2f9624['name'],'sectionId':_0x2f9624['id']},{})[_0xd0b0('0x27')](function(){return _0x4fb525;});}else{return _0x4fb525;}})[_0xd0b0('0x4b')](function(_0x5466eb){logger[_0xd0b0('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5466eb);throw _0x5466eb;});}return _0x4fb525;})['then'](respondWithResult(_0x5240bb,0xc9))[_0xd0b0('0x4b')](handleError(_0x5240bb,null));};exports[_0xd0b0('0x52')]=function(_0x3eb28b,_0xf2e10d){var _0x252c2d={'where':{'id':_0x3eb28b['params']['id']}},_0x44a64f={};_0x44a64f[_0xd0b0('0x33')]=_[_0xd0b0('0x48')](db[_0xd0b0('0x2f')][_0xd0b0('0x49')]);_0x252c2d[_0xd0b0('0x37')]=_[_0xd0b0('0x36')](_0x44a64f[_0xd0b0('0x33')],qs['fields'](_0x3eb28b[_0xd0b0('0x34')][_0xd0b0('0x38')]));_0x252c2d[_0xd0b0('0x37')]=_0x252c2d[_0xd0b0('0x37')][_0xd0b0('0x39')]?_0x252c2d[_0xd0b0('0x37')]:_0x44a64f['model'];if(_0x3eb28b['query'][_0xd0b0('0x42')]){_0x252c2d[_0xd0b0('0x43')]=[{'all':!![]}];}_0x252c2d=_[_0xd0b0('0x3e')]({},_0x252c2d,_0x3eb28b[_0xd0b0('0x41')]);return db[_0xd0b0('0x2f')][_0xd0b0('0x4a')](_0x252c2d)[_0xd0b0('0x27')](handleEntityNotFound(_0xf2e10d,null))[_0xd0b0('0x27')](function(_0x16d7df){if(_0x16d7df){var _0x422531=_0x16d7df[_0xd0b0('0x4e')]({'plain':!![]});_0x422531=qs[_0xd0b0('0x53')](_0x422531,['id',_0xd0b0('0x54'),_0xd0b0('0x55')]);_0x3eb28b['body']=_[_0xd0b0('0x53')](_0x3eb28b['body'],['id','createdAt',_0xd0b0('0x55')]);return db['JscriptyProject']['create'](_['merge'](_0x422531,_0x3eb28b[_0xd0b0('0x56')]),{'include':_0x3eb28b[_0xd0b0('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0xd0b0('0x27')](function(_0x4ed508){var _0x258109=_0x3eb28b['user'][_0xd0b0('0x4e')]({'plain':!![]});if(!_0x258109)throw new Error(_0xd0b0('0x4f'));if(_0x258109[_0xd0b0('0x57')]===_0xd0b0('0x4d')){var _0x3a1bce=_0x4ed508[_0xd0b0('0x4e')]({'plain':!![]});var _0xe0052f=_0xd0b0('0x28');return db[_0xd0b0('0x50')][_0xd0b0('0x4a')]({'where':{'name':_0xe0052f,'userProfileId':_0x258109[_0xd0b0('0x58')]},'raw':!![]})[_0xd0b0('0x27')](function(_0x316d2c){if(_0x316d2c&&_0x316d2c['autoAssociation']===0x0){return db[_0xd0b0('0x29')][_0xd0b0('0x4c')]({'name':_0x3a1bce[_0xd0b0('0x2c')],'resourceId':_0x3a1bce['id'],'type':_0x316d2c['name'],'sectionId':_0x316d2c['id']},{})['then'](function(){return _0x4ed508;});}else{return _0x4ed508;}})['catch'](function(_0x36cf23){logger[_0xd0b0('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36cf23);throw _0x36cf23;});}return _0x4ed508;});}})[_0xd0b0('0x27')](respondWithResult(_0xf2e10d,0xc9))['catch'](handleError(_0xf2e10d,null));};exports['update']=function(_0x31886e,_0xc1ce48){if(_0x31886e['body']['id']){delete _0x31886e[_0xd0b0('0x56')]['id'];}return db[_0xd0b0('0x2f')][_0xd0b0('0x4a')]({'where':{'id':_0x31886e['params']['id']}})['then'](handleEntityNotFound(_0xc1ce48,null))[_0xd0b0('0x27')](saveUpdates(_0x31886e[_0xd0b0('0x56')],null))[_0xd0b0('0x27')](respondWithResult(_0xc1ce48,null))[_0xd0b0('0x4b')](handleError(_0xc1ce48,null));};exports[_0xd0b0('0x59')]=function(_0x3b4f25,_0x4f3c68){return db['JscriptyProject']['find']({'where':{'id':_0x3b4f25[_0xd0b0('0x47')]['id']}})[_0xd0b0('0x27')](handleEntityNotFound(_0x4f3c68,null))['then'](removeEntity(_0x4f3c68,null))['catch'](handleError(_0x4f3c68,null));};exports[_0xd0b0('0x5a')]=function(_0x5de017,_0x59b350,_0x280a7c){var _0x3daf36={'raw':!![],'where':{}};var _0x450778={};var _0x49896a={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xd0b0('0x5b')]({'where':{'id':_0x5de017[_0xd0b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x59b350,null))[_0xd0b0('0x27')](function(_0x187e01){if(_0x187e01){_0x450778[_0xd0b0('0x33')]=_[_0xd0b0('0x48')](db['JscriptySessionReport'][_0xd0b0('0x49')]);_0x450778[_0xd0b0('0x34')]=_[_0xd0b0('0x48')](_0x5de017[_0xd0b0('0x34')]);_0x450778[_0xd0b0('0x35')]=_[_0xd0b0('0x36')](_0x450778[_0xd0b0('0x33')],_0x450778['query']);_0x3daf36[_0xd0b0('0x37')]=_[_0xd0b0('0x36')](_0x450778[_0xd0b0('0x33')],qs[_0xd0b0('0x38')](_0x5de017[_0xd0b0('0x34')][_0xd0b0('0x38')]));_0x3daf36['attributes']=_0x3daf36['attributes'][_0xd0b0('0x39')]?_0x3daf36[_0xd0b0('0x37')]:_0x450778[_0xd0b0('0x33')];if(!_0x5de017[_0xd0b0('0x34')]['hasOwnProperty']('nolimit')){_0x3daf36[_0xd0b0('0x20')]=qs[_0xd0b0('0x20')](_0x5de017['query']['limit']);_0x3daf36[_0xd0b0('0x1e')]=qs[_0xd0b0('0x1e')](_0x5de017[_0xd0b0('0x34')][_0xd0b0('0x1e')]);}_0x3daf36[_0xd0b0('0x5c')]=qs[_0xd0b0('0x3b')](_0x5de017['query'][_0xd0b0('0x3b')]);_0x3daf36[_0xd0b0('0x3c')]=qs[_0xd0b0('0x35')](_[_0xd0b0('0x3d')](_0x5de017[_0xd0b0('0x34')],_0x450778[_0xd0b0('0x35')]));_0x3daf36[_0xd0b0('0x3c')][_0xd0b0('0x5d')]=_0x187e01['id'];if(_0x5de017[_0xd0b0('0x34')][_0xd0b0('0x40')]){_0x3daf36[_0xd0b0('0x3c')]=_['merge'](_0x3daf36['where'],{'$or':_[_0xd0b0('0x2e')](_0x3daf36[_0xd0b0('0x37')],function(_0x334420){var _0x4423fe={};_0x4423fe[_0x334420]={'$like':'%'+_0x5de017[_0xd0b0('0x34')]['filter']+'%'};return _0x4423fe;})});}_0x3daf36=_[_0xd0b0('0x3e')]({},_0x3daf36,_0x5de017[_0xd0b0('0x41')]);return db[_0xd0b0('0x5e')][_0xd0b0('0x21')]({'where':_0x3daf36[_0xd0b0('0x3c')]})[_0xd0b0('0x27')](function(_0x14a132){_0x49896a[_0xd0b0('0x21')]=_0x14a132;if(_0x5de017[_0xd0b0('0x34')][_0xd0b0('0x42')]){_0x3daf36[_0xd0b0('0x43')]=[{'all':!![]}];}return db[_0xd0b0('0x5e')][_0xd0b0('0x44')](_0x3daf36);})['then'](function(_0x51eb50){_0x49896a['rows']=_0x51eb50;return _0x49896a;});}})[_0xd0b0('0x27')](respondWithFilteredResult(_0x59b350,_0x3daf36))[_0xd0b0('0x4b')](handleError(_0x59b350,null));};exports[_0xd0b0('0x5f')]=function(_0x12c398,_0x441f63,_0x65d2c1){var _0x198f58={'raw':!![],'where':{}};var _0x53f948={};var _0x16bee2={'count':0x0,'rows':[]};return db[_0xd0b0('0x2f')]['findOne']({'where':{'id':_0x12c398[_0xd0b0('0x47')]['id']}})[_0xd0b0('0x27')](handleEntityNotFound(_0x441f63,null))['then'](function(_0x2a020e){if(_0x2a020e){_0x53f948['model']=_[_0xd0b0('0x48')](db[_0xd0b0('0x60')][_0xd0b0('0x49')]);_0x53f948[_0xd0b0('0x34')]=_[_0xd0b0('0x48')](_0x12c398[_0xd0b0('0x34')]);_0x53f948['filters']=_[_0xd0b0('0x36')](_0x53f948[_0xd0b0('0x33')],_0x53f948[_0xd0b0('0x34')]);_0x198f58[_0xd0b0('0x37')]=_['intersection'](_0x53f948[_0xd0b0('0x33')],qs['fields'](_0x12c398['query'][_0xd0b0('0x38')]));_0x198f58[_0xd0b0('0x37')]=_0x198f58[_0xd0b0('0x37')][_0xd0b0('0x39')]?_0x198f58['attributes']:_0x53f948['model'];if(!_0x12c398[_0xd0b0('0x34')][_0xd0b0('0x61')](_0xd0b0('0x3a'))){_0x198f58['limit']=qs[_0xd0b0('0x20')](_0x12c398[_0xd0b0('0x34')][_0xd0b0('0x20')]);_0x198f58[_0xd0b0('0x1e')]=qs[_0xd0b0('0x1e')](_0x12c398[_0xd0b0('0x34')]['offset']);}_0x198f58['order']=qs[_0xd0b0('0x3b')](_0x12c398['query']['sort']);_0x198f58[_0xd0b0('0x3c')]=qs[_0xd0b0('0x35')](_['pick'](_0x12c398[_0xd0b0('0x34')],_0x53f948['filters']));_0x198f58[_0xd0b0('0x3c')]['ProjectId']=_0x2a020e['id'];if(_0x12c398[_0xd0b0('0x34')][_0xd0b0('0x40')]){_0x198f58['where']=_[_0xd0b0('0x3e')](_0x198f58['where'],{'$or':_['map'](_0x198f58['attributes'],function(_0x20d24d){var _0x4e8d6e={};_0x4e8d6e[_0x20d24d]={'$like':'%'+_0x12c398['query'][_0xd0b0('0x40')]+'%'};return _0x4e8d6e;})});}_0x198f58=_[_0xd0b0('0x3e')]({},_0x198f58,_0x12c398[_0xd0b0('0x41')]);return db[_0xd0b0('0x60')][_0xd0b0('0x21')]({'where':_0x198f58['where']})[_0xd0b0('0x27')](function(_0x294520){_0x16bee2[_0xd0b0('0x21')]=_0x294520;if(_0x12c398[_0xd0b0('0x34')][_0xd0b0('0x42')]){_0x198f58[_0xd0b0('0x43')]=[{'all':!![]}];}return db[_0xd0b0('0x60')][_0xd0b0('0x44')](_0x198f58);})[_0xd0b0('0x27')](function(_0x54c698){_0x16bee2[_0xd0b0('0x45')]=_0x54c698;return _0x16bee2;});}})[_0xd0b0('0x27')](respondWithFilteredResult(_0x441f63,_0x198f58))['catch'](handleError(_0x441f63,null));};function char(_0x2147ad){return _0xd0b0('0x62')===typeof _0x2147ad?String['fromCharCode'][_0xd0b0('0x24')](null,arguments):_0x2147ad;}function needsEncapsulation(_0x42b577){return!!_0x42b577&&(_0x42b577[_0xd0b0('0x63')]()[_0xd0b0('0x64')](char(0xd))>=0x0||_0x42b577[_0xd0b0('0x63')]()[_0xd0b0('0x64')](char(0xa))>=0x0||_0x42b577[_0xd0b0('0x63')]()[_0xd0b0('0x64')](char(0x2c))>=0x0||_0x42b577[_0xd0b0('0x63')]()[_0xd0b0('0x64')](char(0x22))>=0x0);}function encapsulate(_0x3f7252){var _0xc8656c=char(0x22),_0x56f9c7='\x5c'+char(0x22),_0x353654=_0x3f7252[_0xd0b0('0x63')]()[_0xd0b0('0x65')](new RegExp(_0xc8656c,'g'),_0x56f9c7);return _0xc8656c+_0x353654+_0xc8656c;}exports['getSummary']=function(_0x531151,_0x3a5d43,_0x5ebf18){var _0xf894ad,_0x239251;var _0x163d59={'where':{'ProjectId':_0x531151['params']['id']}};if(_0x531151[_0xd0b0('0x34')][_0xd0b0('0x66')]){_0x163d59[_0xd0b0('0x3c')][_0xd0b0('0x67')]=JSON[_0xd0b0('0x68')](_0x531151['query'][_0xd0b0('0x66')]);}return db[_0xd0b0('0x5e')][_0xd0b0('0x44')](_0x163d59)[_0xd0b0('0x27')](handleEntityNotFound(_0x3a5d43,null))[_0xd0b0('0x27')](function(_0x41c233){if(_0x41c233){_0xf894ad=_0x41c233;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0xd0b0('0x2e')](_0xf894ad,'id')},'ProjectId':_0x531151[_0xd0b0('0x47')]['id']},'order':_0xd0b0('0x69')});}})[_0xd0b0('0x27')](handleEntityNotFound(_0x3a5d43,null))[_0xd0b0('0x27')](function(_0x397d24){if(_0x397d24){_0x239251=_0x397d24;var _0x4738c3={};for(var _0x566e49=0x0,_0x4d8ee0=_0x239251[_0xd0b0('0x39')];_0x566e49<_0x4d8ee0;_0x566e49++){if(!_0x4738c3['hasOwnProperty'](_0x239251[_0x566e49][_0xd0b0('0x6a')])){_0x4738c3[_0x239251[_0x566e49][_0xd0b0('0x6a')]]=needsEncapsulation(_0x239251[_0x566e49]['question'])?encapsulate(_0x239251[_0x566e49]['question']):_0x239251[_0x566e49]['question'];}}var _0x498f4c=[],_0x9b8cc4={};for(var _0x1d20d8=0x0,_0x36d084=_0xf894ad[_0xd0b0('0x39')];_0x1d20d8<_0x36d084;_0x1d20d8++){_0x9b8cc4={'ProjectId':_0x531151['params']['id'],'SessionId':_0xf894ad[_0x1d20d8]['id'],'StartTime':moment(_0xf894ad[_0x1d20d8][_0xd0b0('0x67')])[_0xd0b0('0x6b')](_0xd0b0('0x6c'))};for(var _0x2d91a9=0x0,_0x2262f2=_0x239251[_0xd0b0('0x39')];_0x2d91a9<_0x2262f2;_0x2d91a9++){if(_0x239251[_0x2d91a9][_0xd0b0('0x6d')]==_0xf894ad[_0x1d20d8]['id']&&_0x4738c3[_0xd0b0('0x61')](_0x239251[_0x2d91a9]['questionId'])){_0x9b8cc4[_0x4738c3[_0x239251[_0x2d91a9][_0xd0b0('0x6a')]]]=_0x239251[_0x2d91a9][_0xd0b0('0x6e')];}}for(var _0x393984 in _0x4738c3){if(!_0x9b8cc4[_0xd0b0('0x61')](_0x4738c3[_0x393984])){_0x9b8cc4[_0x4738c3[_0x393984]]=null;}}_0x498f4c[_0xd0b0('0x6f')](_0x9b8cc4);}return _0x498f4c;}})[_0xd0b0('0x27')](function(_0x341b53){if(!_[_0xd0b0('0x70')](_0x341b53)){var _0x75aabc=toCsv(_0x341b53);var _0xef32d3=Date[_0xd0b0('0x71')]();fs[_0xd0b0('0x72')](util[_0xd0b0('0x6b')](_0xd0b0('0x73'),_0x531151['params']['id'],_0xef32d3),_0x75aabc);_0x3a5d43[_0xd0b0('0x74')]('Content-disposition',_0xd0b0('0x75')+util['format'](_0xd0b0('0x76'),_0x531151[_0xd0b0('0x47')]['id'],_0xef32d3));_0x3a5d43[_0xd0b0('0x74')]('Content-type',_0xd0b0('0x77'));return _0x3a5d43[_0xd0b0('0x78')](util[_0xd0b0('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x531151['params']['id'],_0xef32d3));}else{return _0x3a5d43[_0xd0b0('0x1a')](0xcc);}})[_0xd0b0('0x4b')](handleError(_0x3a5d43,null));};
\ No newline at end of file
index 125797e..ad59934 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37a7=['util','bluebird','request-promise','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash'];(function(_0x3a401c,_0x7ed235){var _0x2d5f7d=function(_0x44abdf){while(--_0x44abdf){_0x3a401c['push'](_0x3a401c['shift']());}};_0x2d5f7d(++_0x7ed235);}(_0x37a7,0x6f));var _0x737a=function(_0x52862e,_0x27ab25){_0x52862e=_0x52862e-0x0;var _0x4ccc54=_0x37a7[_0x52862e];return _0x4ccc54;};'use strict';var _=require(_0x737a('0x0'));var util=require(_0x737a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x737a('0x2'));var rp=require(_0x737a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x737a('0x4'));module[_0x737a('0x5')]=function(_0x7f4eed,_0x11109c){return _0x7f4eed[_0x737a('0x6')]('JscriptyProject',attributes,{'tableName':_0x737a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe9e8=['rimraf','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xdc58f8,_0x2515f4){var _0x258f2f=function(_0x54e456){while(--_0x54e456){_0xdc58f8['push'](_0xdc58f8['shift']());}};_0x258f2f(++_0x2515f4);}(_0xe9e8,0x179));var _0x8e9e=function(_0x183cb6,_0x33db17){_0x183cb6=_0x183cb6-0x0;var _0x34fdb6=_0xe9e8[_0x183cb6];return _0x34fdb6;};'use strict';var _=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var logger=require(_0x8e9e('0x2'))(_0x8e9e('0x3'));var moment=require(_0x8e9e('0x4'));var BPromise=require(_0x8e9e('0x5'));var rp=require(_0x8e9e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e9e('0x7'));var config=require('../../config/environment');var attributes=require(_0x8e9e('0x8'));module[_0x8e9e('0x9')]=function(_0x3b5e8d,_0x5de00e){return _0x3b5e8d['define'](_0x8e9e('0xa'),attributes,{'tableName':_0x8e9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d65ae80..fe60182 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x370c11,_0x35e5f4){var _0x4479c5=function(_0x33f03c){while(--_0x33f03c){_0x370c11['push'](_0x370c11['shift']());}};_0x4479c5(++_0x35e5f4);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1b3030,_0x320066){_0x1b3030=_0x1b3030-0x0;var _0x806802=_0x9bde[_0x1b3030];return _0x806802;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});}
\ No newline at end of file
+var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s'];(function(_0x2f7084,_0x40a1d4){var _0x196055=function(_0x576c7a){while(--_0x576c7a){_0x2f7084['push'](_0x2f7084['shift']());}};_0x196055(++_0x40a1d4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcb91[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
index 282fe41..878f2a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3a1=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','isAuthenticated','describe','show','post','create','/:id'];(function(_0x32e707,_0xf27c1f){var _0x397424=function(_0x308472){while(--_0x308472){_0x32e707['push'](_0x32e707['shift']());}};_0x397424(++_0xf27c1f);}(_0xf3a1,0x1d1));var _0x1f3a=function(_0x5be55f,_0x55d384){_0x5be55f=_0x5be55f-0x0;var _0x9107ec=_0xf3a1[_0x5be55f];return _0x9107ec;};'use strict';var multer=require(_0x1f3a('0x0'));var util=require(_0x1f3a('0x1'));var path=require(_0x1f3a('0x2'));var timeout=require(_0x1f3a('0x3'));var express=require(_0x1f3a('0x4'));var router=express[_0x1f3a('0x5')]();var fs_extra=require(_0x1f3a('0x6'));var auth=require(_0x1f3a('0x7'));var interaction=require(_0x1f3a('0x8'));var config=require(_0x1f3a('0x9'));var controller=require(_0x1f3a('0xa'));router[_0x1f3a('0xb')]('/',auth['isAuthenticated'](),controller[_0x1f3a('0xc')]);router['get']('/describe',auth[_0x1f3a('0xd')](),controller[_0x1f3a('0xe')]);router['get']('/:id',auth[_0x1f3a('0xd')](),controller[_0x1f3a('0xf')]);router[_0x1f3a('0x10')]('/',auth[_0x1f3a('0xd')](),controller[_0x1f3a('0x11')]);router['put'](_0x1f3a('0x12'),auth['isAuthenticated'](),controller[_0x1f3a('0x13')]);router[_0x1f3a('0x14')](_0x1f3a('0x12'),auth[_0x1f3a('0xd')](),controller[_0x1f3a('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x2cf1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','Router'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0x2cf1,0xa4));var _0x12cf=function(_0x2e8250,_0x613822){_0x2e8250=_0x2e8250-0x0;var _0x26d14b=_0x2cf1[_0x2e8250];return _0x26d14b;};'use strict';var multer=require(_0x12cf('0x0'));var util=require(_0x12cf('0x1'));var path=require(_0x12cf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x12cf('0x3')]();var fs_extra=require(_0x12cf('0x4'));var auth=require(_0x12cf('0x5'));var interaction=require(_0x12cf('0x6'));var config=require(_0x12cf('0x7'));var controller=require(_0x12cf('0x8'));router[_0x12cf('0x9')]('/',auth[_0x12cf('0xa')](),controller[_0x12cf('0xb')]);router[_0x12cf('0x9')](_0x12cf('0xc'),auth[_0x12cf('0xa')](),controller[_0x12cf('0xd')]);router[_0x12cf('0x9')](_0x12cf('0xe'),auth[_0x12cf('0xa')](),controller[_0x12cf('0xf')]);router[_0x12cf('0x10')]('/',auth[_0x12cf('0xa')](),controller[_0x12cf('0x11')]);router['put'](_0x12cf('0xe'),auth['isAuthenticated'](),controller[_0x12cf('0x12')]);router['delete'](_0x12cf('0xe'),auth['isAuthenticated'](),controller[_0x12cf('0x13')]);module[_0x12cf('0x14')]=router;
\ No newline at end of file
index ac9624e..b405519 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7a54,0x106));var _0x47a5=function(_0x41579d,_0x426158){_0x41579d=_0x41579d-0x0;var _0x5bc0c2=_0x7a54[_0x41579d];return _0x5bc0c2;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x353f62,_0x21787b){_0x353f62=_0x353f62-0x0;var _0x1cddbf=_0x7a54[_0x353f62];return _0x1cddbf;};'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 5ef2565..c9b7c59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3332=['attributes','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','fields','merge','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','update','then','destroy','stack','name','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x15dab7,_0x13f614){var _0x1be42c=function(_0x483c75){while(--_0x483c75){_0x15dab7['push'](_0x15dab7['shift']());}};_0x1be42c(++_0x13f614);}(_0x3332,0xa7));var _0x2333=function(_0x53a356,_0x9da31a){_0x53a356=_0x53a356-0x0;var _0xc2b531=_0x3332[_0x53a356];return _0xc2b531;};'use strict';var emlformat=require(_0x2333('0x0'));var rimraf=require(_0x2333('0x1'));var zipdir=require(_0x2333('0x2'));var jsonpatch=require(_0x2333('0x3'));var rp=require(_0x2333('0x4'));var moment=require(_0x2333('0x5'));var BPromise=require(_0x2333('0x6'));var Mustache=require('mustache');var util=require(_0x2333('0x7'));var path=require(_0x2333('0x8'));var sox=require(_0x2333('0x9'));var csv=require(_0x2333('0xa'));var ejs=require(_0x2333('0xb'));var fs=require('fs');var fs_extra=require(_0x2333('0xc'));var _=require(_0x2333('0xd'));var squel=require(_0x2333('0xe'));var crypto=require(_0x2333('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2333('0x10'));var toCsv=require(_0x2333('0xa'));var querystring=require(_0x2333('0x11'));var Papa=require(_0x2333('0x12'));var Redis=require(_0x2333('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2333('0x14'));var as=require(_0x2333('0x15'));var hardwareService=require(_0x2333('0x16'));var logger=require('../../config/logger')(_0x2333('0x17'));var utils=require('../../config/utils');var config=require(_0x2333('0x18'));var licenseUtil=require(_0x2333('0x19'));var db=require(_0x2333('0x1a'))['db'];function respondWithStatusCode(_0x23e46a,_0x518020){_0x518020=_0x518020||0xcc;return function(_0x101a02){if(_0x101a02){return _0x23e46a[_0x2333('0x1b')](_0x518020);}return _0x23e46a[_0x2333('0x1c')](_0x518020)[_0x2333('0x1d')]();};}function respondWithResult(_0x320084,_0x887fac){_0x887fac=_0x887fac||0xc8;return function(_0x213dd4){if(_0x213dd4){return _0x320084[_0x2333('0x1c')](_0x887fac)[_0x2333('0x1e')](_0x213dd4);}};}function respondWithFilteredResult(_0x153106,_0x2f83dd){return function(_0x23d9c6){if(_0x23d9c6){var _0x514548=typeof _0x2f83dd[_0x2333('0x1f')]===_0x2333('0x20')&&typeof _0x2f83dd[_0x2333('0x21')]===_0x2333('0x20');var _0x3c289a=_0x23d9c6[_0x2333('0x22')];var _0x116b0f=_0x514548?0x0:_0x2f83dd[_0x2333('0x1f')];var _0x3679da=_0x514548?_0x23d9c6['count']:_0x2f83dd[_0x2333('0x1f')]+_0x2f83dd[_0x2333('0x21')];var _0x322c7a;if(_0x3679da>=_0x3c289a){_0x3679da=_0x3c289a;_0x322c7a=0xc8;}else{_0x322c7a=0xce;}_0x153106[_0x2333('0x1c')](_0x322c7a);return _0x153106['set']('Content-Range',_0x116b0f+'-'+_0x3679da+'/'+_0x3c289a)['json'](_0x23d9c6);}return null;};}function patchUpdates(_0x5d8081){return function(_0x278dc8){try{jsonpatch['apply'](_0x278dc8,_0x5d8081,!![]);}catch(_0x466e03){return BPromise[_0x2333('0x23')](_0x466e03);}return _0x278dc8['save']();};}function saveUpdates(_0x10e8ce,_0x53307f){return function(_0x5dba04){if(_0x5dba04){return _0x5dba04[_0x2333('0x24')](_0x10e8ce)[_0x2333('0x25')](function(_0x1f8961){return _0x1f8961;});}return null;};}function removeEntity(_0x2c18aa,_0x3b6352){return function(_0x2d5418){if(_0x2d5418){return _0x2d5418[_0x2333('0x26')]()[_0x2333('0x25')](function(){_0x2c18aa[_0x2333('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x354815,_0x58ca37){return function(_0x511e90){if(!_0x511e90){_0x354815['sendStatus'](0x194);}return _0x511e90;};}function handleError(_0xe64d96,_0x58ac78){_0x58ac78=_0x58ac78||0x1f4;return function(_0x51b431){logger['error'](_0x51b431[_0x2333('0x27')]);if(_0x51b431[_0x2333('0x28')]){delete _0x51b431[_0x2333('0x28')];}_0xe64d96[_0x2333('0x1c')](_0x58ac78)['send'](_0x51b431);};}exports[_0x2333('0x29')]=function(_0x19a1a0,_0x48c1a7){var _0x1898cb={},_0x115f2f={},_0x1f272={'count':0x0,'rows':[]};var _0x3814e2=_[_0x2333('0x2a')](db[_0x2333('0x2b')][_0x2333('0x2c')],function(_0x3811e8){return{'name':_0x3811e8['fieldName'],'type':_0x3811e8[_0x2333('0x2d')][_0x2333('0x2e')]};});_0x115f2f[_0x2333('0x2f')]=_[_0x2333('0x2a')](_0x3814e2,'name');_0x115f2f[_0x2333('0x30')]=_[_0x2333('0x31')](_0x19a1a0[_0x2333('0x30')]);_0x115f2f[_0x2333('0x32')]=_[_0x2333('0x33')](_0x115f2f[_0x2333('0x2f')],_0x115f2f[_0x2333('0x30')]);_0x1898cb['attributes']=_['intersection'](_0x115f2f[_0x2333('0x2f')],qs['fields'](_0x19a1a0[_0x2333('0x30')]['fields']));_0x1898cb['attributes']=_0x1898cb[_0x2333('0x34')][_0x2333('0x35')]?_0x1898cb[_0x2333('0x34')]:_0x115f2f[_0x2333('0x2f')];if(!_0x19a1a0[_0x2333('0x30')][_0x2333('0x36')](_0x2333('0x37'))){_0x1898cb[_0x2333('0x21')]=qs[_0x2333('0x21')](_0x19a1a0[_0x2333('0x30')][_0x2333('0x21')]);_0x1898cb[_0x2333('0x1f')]=qs[_0x2333('0x1f')](_0x19a1a0[_0x2333('0x30')][_0x2333('0x1f')]);}_0x1898cb['order']=qs[_0x2333('0x38')](_0x19a1a0[_0x2333('0x30')]['sort']);_0x1898cb['where']=qs[_0x2333('0x32')](_['pick'](_0x19a1a0[_0x2333('0x30')],_0x115f2f['filters']),_0x3814e2);if(_0x19a1a0[_0x2333('0x30')]['filter']){_0x1898cb[_0x2333('0x39')]=_['merge'](_0x1898cb[_0x2333('0x39')],{'$or':_['map'](_0x3814e2,function(_0x27664b){if(_0x27664b[_0x2333('0x2d')]!==_0x2333('0x3a')){var _0x3827d0={};_0x3827d0[_0x27664b[_0x2333('0x28')]]={'$like':'%'+_0x19a1a0[_0x2333('0x30')]['filter']+'%'};return _0x3827d0;}})});}_0x1898cb=_['merge']({},_0x1898cb,_0x19a1a0['options']);var _0x514755={'where':_0x1898cb[_0x2333('0x39')]};return db[_0x2333('0x2b')]['count'](_0x514755)[_0x2333('0x25')](function(_0x35ea13){_0x1f272[_0x2333('0x22')]=_0x35ea13;if(_0x19a1a0['query'][_0x2333('0x3b')]){_0x1898cb[_0x2333('0x3c')]=[{'all':!![]}];}return db[_0x2333('0x2b')][_0x2333('0x3d')](_0x1898cb);})[_0x2333('0x25')](function(_0x5e4ec5){_0x1f272[_0x2333('0x3e')]=_0x5e4ec5;return _0x1f272;})[_0x2333('0x25')](respondWithFilteredResult(_0x48c1a7,_0x1898cb))[_0x2333('0x3f')](handleError(_0x48c1a7,null));};exports[_0x2333('0x40')]=function(_0x5b1c0a,_0x3984c8){var _0x29108c={'raw':!![],'where':{'id':_0x5b1c0a['params']['id']}},_0x50b47d={};_0x50b47d[_0x2333('0x2f')]=_[_0x2333('0x31')](db['JscriptyQuestionReport']['rawAttributes']);_0x50b47d[_0x2333('0x30')]=_[_0x2333('0x31')](_0x5b1c0a[_0x2333('0x30')]);_0x50b47d[_0x2333('0x32')]=_[_0x2333('0x33')](_0x50b47d[_0x2333('0x2f')],_0x50b47d[_0x2333('0x30')]);_0x29108c[_0x2333('0x34')]=_['intersection'](_0x50b47d[_0x2333('0x2f')],qs[_0x2333('0x41')](_0x5b1c0a['query'][_0x2333('0x41')]));_0x29108c[_0x2333('0x34')]=_0x29108c['attributes'][_0x2333('0x35')]?_0x29108c[_0x2333('0x34')]:_0x50b47d[_0x2333('0x2f')];if(_0x5b1c0a['query'][_0x2333('0x3b')]){_0x29108c['include']=[{'all':!![]}];}_0x29108c=_[_0x2333('0x42')]({},_0x29108c,_0x5b1c0a[_0x2333('0x43')]);return db[_0x2333('0x2b')][_0x2333('0x44')](_0x29108c)[_0x2333('0x25')](handleEntityNotFound(_0x3984c8,null))[_0x2333('0x25')](respondWithResult(_0x3984c8,null))[_0x2333('0x3f')](handleError(_0x3984c8,null));};exports[_0x2333('0x45')]=function(_0x4f7aaa,_0x5584e2){return db['JscriptyQuestionReport']['create'](_0x4f7aaa[_0x2333('0x46')],{})[_0x2333('0x25')](respondWithResult(_0x5584e2,0xc9))[_0x2333('0x3f')](handleError(_0x5584e2,null));};exports[_0x2333('0x24')]=function(_0x428488,_0x1df315){if(_0x428488[_0x2333('0x46')]['id']){delete _0x428488[_0x2333('0x46')]['id'];}return db[_0x2333('0x2b')][_0x2333('0x44')]({'where':{'id':_0x428488['params']['id']}})['then'](handleEntityNotFound(_0x1df315,null))['then'](saveUpdates(_0x428488[_0x2333('0x46')],null))[_0x2333('0x25')](respondWithResult(_0x1df315,null))[_0x2333('0x3f')](handleError(_0x1df315,null));};exports[_0x2333('0x26')]=function(_0x5eb012,_0x470ef1){return db[_0x2333('0x2b')][_0x2333('0x44')]({'where':{'id':_0x5eb012[_0x2333('0x47')]['id']}})['then'](handleEntityNotFound(_0x470ef1,null))[_0x2333('0x25')](removeEntity(_0x470ef1,null))[_0x2333('0x3f')](handleError(_0x470ef1,null));};exports[_0x2333('0x48')]=function(_0x3bbe66,_0x2f2f5b){return db[_0x2333('0x2b')][_0x2333('0x48')]()[_0x2333('0x25')](respondWithResult(_0x2f2f5b,null))[_0x2333('0x3f')](handleError(_0x2f2f5b,null));};
\ No newline at end of file
+var _0x5930=['length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','include','create','body','find','params','describe','rimraf','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','set','Content-Range','apply','save','update','destroy','then','end','error','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0xa720e9,_0xf162db){var _0x902310=function(_0x538001){while(--_0x538001){_0xa720e9['push'](_0xa720e9['shift']());}};_0x902310(++_0xf162db);}(_0x5930,0x189));var _0x0593=function(_0x1ab9a6,_0x427b52){_0x1ab9a6=_0x1ab9a6-0x0;var _0x2a4e66=_0x5930[_0x1ab9a6];return _0x2a4e66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0593('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0593('0x1'));var Mustache=require(_0x0593('0x2'));var util=require(_0x0593('0x3'));var path=require(_0x0593('0x4'));var sox=require(_0x0593('0x5'));var csv=require(_0x0593('0x6'));var ejs=require(_0x0593('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0593('0x8'));var jsforce=require(_0x0593('0x9'));var deskjs=require(_0x0593('0xa'));var toCsv=require('to-csv');var querystring=require(_0x0593('0xb'));var Papa=require(_0x0593('0xc'));var Redis=require(_0x0593('0xd'));var authService=require(_0x0593('0xe'));var qs=require(_0x0593('0xf'));var as=require(_0x0593('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0593('0x11'))(_0x0593('0x12'));var utils=require(_0x0593('0x13'));var config=require(_0x0593('0x14'));var licenseUtil=require(_0x0593('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c9437,_0x4edd41){_0x4edd41=_0x4edd41||0xcc;return function(_0x3c73cd){if(_0x3c73cd){return _0x3c9437[_0x0593('0x16')](_0x4edd41);}return _0x3c9437[_0x0593('0x17')](_0x4edd41)['end']();};}function respondWithResult(_0x4424f8,_0x5d5189){_0x5d5189=_0x5d5189||0xc8;return function(_0x3f5308){if(_0x3f5308){return _0x4424f8[_0x0593('0x17')](_0x5d5189)[_0x0593('0x18')](_0x3f5308);}};}function respondWithFilteredResult(_0x47c1e5,_0x3e10b0){return function(_0x2110a1){if(_0x2110a1){var _0x3b536f=typeof _0x3e10b0['offset']===_0x0593('0x19')&&typeof _0x3e10b0['limit']===_0x0593('0x19');var _0x45d832=_0x2110a1['count'];var _0x965b46=_0x3b536f?0x0:_0x3e10b0['offset'];var _0x2f2ddb=_0x3b536f?_0x2110a1[_0x0593('0x1a')]:_0x3e10b0['offset']+_0x3e10b0['limit'];var _0x5edaba;if(_0x2f2ddb>=_0x45d832){_0x2f2ddb=_0x45d832;_0x5edaba=0xc8;}else{_0x5edaba=0xce;}_0x47c1e5[_0x0593('0x17')](_0x5edaba);return _0x47c1e5[_0x0593('0x1b')](_0x0593('0x1c'),_0x965b46+'-'+_0x2f2ddb+'/'+_0x45d832)[_0x0593('0x18')](_0x2110a1);}return null;};}function patchUpdates(_0x551516){return function(_0x6cc2c6){try{jsonpatch[_0x0593('0x1d')](_0x6cc2c6,_0x551516,!![]);}catch(_0x340cce){return BPromise['reject'](_0x340cce);}return _0x6cc2c6[_0x0593('0x1e')]();};}function saveUpdates(_0x50a729,_0x27222d){return function(_0x43e5c4){if(_0x43e5c4){return _0x43e5c4[_0x0593('0x1f')](_0x50a729)['then'](function(_0x182067){return _0x182067;});}return null;};}function removeEntity(_0x483cfe,_0x1cd4e0){return function(_0x5f1525){if(_0x5f1525){return _0x5f1525[_0x0593('0x20')]()[_0x0593('0x21')](function(){_0x483cfe[_0x0593('0x17')](0xcc)[_0x0593('0x22')]();});}};}function handleEntityNotFound(_0x38a5eb,_0x53690d){return function(_0x5e9e79){if(!_0x5e9e79){_0x38a5eb[_0x0593('0x16')](0x194);}return _0x5e9e79;};}function handleError(_0x343da9,_0x58934d){_0x58934d=_0x58934d||0x1f4;return function(_0x4545a1){logger[_0x0593('0x23')](_0x4545a1['stack']);if(_0x4545a1[_0x0593('0x24')]){delete _0x4545a1['name'];}_0x343da9[_0x0593('0x17')](_0x58934d)[_0x0593('0x25')](_0x4545a1);};}exports[_0x0593('0x26')]=function(_0x2383c0,_0x242382){var _0x34dc0e={},_0x1130f0={},_0x205df8={'count':0x0,'rows':[]};var _0xb25f74=_[_0x0593('0x27')](db[_0x0593('0x28')][_0x0593('0x29')],function(_0x52355d){return{'name':_0x52355d[_0x0593('0x2a')],'type':_0x52355d['type'][_0x0593('0x2b')]};});_0x1130f0[_0x0593('0x2c')]=_[_0x0593('0x27')](_0xb25f74,_0x0593('0x24'));_0x1130f0[_0x0593('0x2d')]=_[_0x0593('0x2e')](_0x2383c0['query']);_0x1130f0[_0x0593('0x2f')]=_[_0x0593('0x30')](_0x1130f0[_0x0593('0x2c')],_0x1130f0['query']);_0x34dc0e[_0x0593('0x31')]=_['intersection'](_0x1130f0[_0x0593('0x2c')],qs['fields'](_0x2383c0['query'][_0x0593('0x32')]));_0x34dc0e['attributes']=_0x34dc0e['attributes'][_0x0593('0x33')]?_0x34dc0e[_0x0593('0x31')]:_0x1130f0[_0x0593('0x2c')];if(!_0x2383c0[_0x0593('0x2d')][_0x0593('0x34')](_0x0593('0x35'))){_0x34dc0e[_0x0593('0x36')]=qs[_0x0593('0x36')](_0x2383c0[_0x0593('0x2d')][_0x0593('0x36')]);_0x34dc0e[_0x0593('0x37')]=qs[_0x0593('0x37')](_0x2383c0[_0x0593('0x2d')][_0x0593('0x37')]);}_0x34dc0e[_0x0593('0x38')]=qs[_0x0593('0x39')](_0x2383c0[_0x0593('0x2d')]['sort']);_0x34dc0e[_0x0593('0x3a')]=qs[_0x0593('0x2f')](_[_0x0593('0x3b')](_0x2383c0[_0x0593('0x2d')],_0x1130f0['filters']),_0xb25f74);if(_0x2383c0[_0x0593('0x2d')]['filter']){_0x34dc0e['where']=_[_0x0593('0x3c')](_0x34dc0e[_0x0593('0x3a')],{'$or':_[_0x0593('0x27')](_0xb25f74,function(_0x223224){if(_0x223224['type']!==_0x0593('0x3d')){var _0x374ac2={};_0x374ac2[_0x223224['name']]={'$like':'%'+_0x2383c0[_0x0593('0x2d')][_0x0593('0x3e')]+'%'};return _0x374ac2;}})});}_0x34dc0e=_[_0x0593('0x3c')]({},_0x34dc0e,_0x2383c0[_0x0593('0x3f')]);var _0x593e61={'where':_0x34dc0e[_0x0593('0x3a')]};return db[_0x0593('0x28')][_0x0593('0x1a')](_0x593e61)['then'](function(_0x17f08d){_0x205df8[_0x0593('0x1a')]=_0x17f08d;if(_0x2383c0[_0x0593('0x2d')][_0x0593('0x40')]){_0x34dc0e['include']=[{'all':!![]}];}return db[_0x0593('0x28')][_0x0593('0x41')](_0x34dc0e);})[_0x0593('0x21')](function(_0x5390ac){_0x205df8['rows']=_0x5390ac;return _0x205df8;})[_0x0593('0x21')](respondWithFilteredResult(_0x242382,_0x34dc0e))[_0x0593('0x42')](handleError(_0x242382,null));};exports[_0x0593('0x43')]=function(_0x402ea2,_0x3bdcd9){var _0x1abe6c={'raw':!![],'where':{'id':_0x402ea2['params']['id']}},_0x21d307={};_0x21d307[_0x0593('0x2c')]=_[_0x0593('0x2e')](db[_0x0593('0x28')][_0x0593('0x29')]);_0x21d307[_0x0593('0x2d')]=_['keys'](_0x402ea2[_0x0593('0x2d')]);_0x21d307[_0x0593('0x2f')]=_[_0x0593('0x30')](_0x21d307[_0x0593('0x2c')],_0x21d307[_0x0593('0x2d')]);_0x1abe6c[_0x0593('0x31')]=_['intersection'](_0x21d307['model'],qs[_0x0593('0x32')](_0x402ea2[_0x0593('0x2d')]['fields']));_0x1abe6c[_0x0593('0x31')]=_0x1abe6c[_0x0593('0x31')]['length']?_0x1abe6c['attributes']:_0x21d307[_0x0593('0x2c')];if(_0x402ea2[_0x0593('0x2d')][_0x0593('0x40')]){_0x1abe6c[_0x0593('0x44')]=[{'all':!![]}];}_0x1abe6c=_[_0x0593('0x3c')]({},_0x1abe6c,_0x402ea2[_0x0593('0x3f')]);return db[_0x0593('0x28')]['find'](_0x1abe6c)[_0x0593('0x21')](handleEntityNotFound(_0x3bdcd9,null))['then'](respondWithResult(_0x3bdcd9,null))[_0x0593('0x42')](handleError(_0x3bdcd9,null));};exports[_0x0593('0x45')]=function(_0x56c3fd,_0x45ac88){return db[_0x0593('0x28')][_0x0593('0x45')](_0x56c3fd[_0x0593('0x46')],{})[_0x0593('0x21')](respondWithResult(_0x45ac88,0xc9))[_0x0593('0x42')](handleError(_0x45ac88,null));};exports['update']=function(_0x4ee292,_0x51a88c){if(_0x4ee292[_0x0593('0x46')]['id']){delete _0x4ee292[_0x0593('0x46')]['id'];}return db[_0x0593('0x28')][_0x0593('0x47')]({'where':{'id':_0x4ee292[_0x0593('0x48')]['id']}})[_0x0593('0x21')](handleEntityNotFound(_0x51a88c,null))[_0x0593('0x21')](saveUpdates(_0x4ee292['body'],null))[_0x0593('0x21')](respondWithResult(_0x51a88c,null))[_0x0593('0x42')](handleError(_0x51a88c,null));};exports[_0x0593('0x20')]=function(_0x302b53,_0x386ff5){return db[_0x0593('0x28')]['find']({'where':{'id':_0x302b53[_0x0593('0x48')]['id']}})['then'](handleEntityNotFound(_0x386ff5,null))['then'](removeEntity(_0x386ff5,null))[_0x0593('0x42')](handleError(_0x386ff5,null));};exports[_0x0593('0x49')]=function(_0x338d2f,_0x4d3188){return db[_0x0593('0x28')][_0x0593('0x49')]()['then'](respondWithResult(_0x4d3188,null))[_0x0593('0x42')](handleError(_0x4d3188,null));};
\ No newline at end of file
index 7fab1e1..24611ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc91=['define','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x44eec3,_0x28fad5){var _0x4f1462=function(_0x359624){while(--_0x359624){_0x44eec3['push'](_0x44eec3['shift']());}};_0x4f1462(++_0x28fad5);}(_0xbc91,0xf1));var _0x1bc9=function(_0x461d1d,_0x50e2ad){_0x461d1d=_0x461d1d-0x0;var _0x1a5384=_0xbc91[_0x461d1d];return _0x1a5384;};'use strict';var _=require('lodash');var util=require(_0x1bc9('0x0'));var logger=require(_0x1bc9('0x1'))(_0x1bc9('0x2'));var moment=require('moment');var BPromise=require(_0x1bc9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bc9('0x4'));var rimraf=require(_0x1bc9('0x5'));var config=require(_0x1bc9('0x6'));var attributes=require(_0x1bc9('0x7'));module[_0x1bc9('0x8')]=function(_0x58dc66,_0x3252b0){return _0x58dc66[_0x1bc9('0x9')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe8db=['report_jscripty_questions','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0x13800a,_0x5670af){var _0x4522f2=function(_0xd3da44){while(--_0xd3da44){_0x13800a['push'](_0x13800a['shift']());}};_0x4522f2(++_0x5670af);}(_0xe8db,0x1a8));var _0xbe8d=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0xe8db[_0x18cac4];return _0x2227c6;};'use strict';var _=require('lodash');var util=require(_0xbe8d('0x0'));var logger=require(_0xbe8d('0x1'))(_0xbe8d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe8d('0x3'));var rimraf=require(_0xbe8d('0x4'));var config=require(_0xbe8d('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xbe8d('0x6')]=function(_0x1fc280,_0x222e95){return _0x1fc280[_0xbe8d('0x7')]('JscriptyQuestionReport',attributes,{'tableName':_0xbe8d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 53ad09c..4c42887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8fc=['JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2bbf4d,_0xe5c8bb){var _0x8dd663=function(_0x2809da){while(--_0x2809da){_0x2bbf4d['push'](_0x2bbf4d['shift']());}};_0x8dd663(++_0xe5c8bb);}(_0xd8fc,0x14b));var _0xcd8f=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0xd8fc[_0x589aee];return _0x2f5ed4;};'use strict';var _=require('lodash');var util=require(_0xcd8f('0x0'));var moment=require('moment');var BPromise=require(_0xcd8f('0x1'));var rs=require(_0xcd8f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd8f('0x3'))['db'];var utils=require(_0xcd8f('0x4'));var logger=require(_0xcd8f('0x5'))(_0xcd8f('0x6'));var config=require(_0xcd8f('0x7'));var jayson=require(_0xcd8f('0x8'));var client=jayson[_0xcd8f('0x9')][_0xcd8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fa9d6,_0xf65afe,_0x14568d){return new BPromise(function(_0x58c16a,_0x2fb0e3){return client[_0xcd8f('0xb')](_0x4fa9d6,_0x14568d)[_0xcd8f('0xc')](function(_0x3bf055){logger[_0xcd8f('0xd')](_0xcd8f('0xe'),_0xf65afe,_0xcd8f('0xf'));logger[_0xcd8f('0x10')](_0xcd8f('0x11'),_0xf65afe,_0xcd8f('0xf'),JSON['stringify'](_0x3bf055));if(_0x3bf055[_0xcd8f('0x12')]){if(_0x3bf055[_0xcd8f('0x12')][_0xcd8f('0x13')]===0x1f4){logger[_0xcd8f('0x12')](_0xcd8f('0xe'),_0xf65afe,_0x3bf055['error']['message']);return _0x2fb0e3(_0x3bf055[_0xcd8f('0x12')][_0xcd8f('0x14')]);}logger[_0xcd8f('0x12')](_0xcd8f('0xe'),_0xf65afe,_0x3bf055['error'][_0xcd8f('0x14')]);return _0x58c16a(_0x3bf055['error'][_0xcd8f('0x14')]);}else{logger[_0xcd8f('0xd')](_0xcd8f('0xe'),_0xf65afe,_0xcd8f('0xf'));_0x58c16a(_0x3bf055[_0xcd8f('0x15')]['message']);}})[_0xcd8f('0x16')](function(_0x11348d){logger['error'](_0xcd8f('0xe'),_0xf65afe,_0x11348d);_0x2fb0e3(_0x11348d);});});}
\ No newline at end of file
+var _0x4ae8=['debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x372ca0,_0x4bb630){var _0x3e4d7a=function(_0xe76f0d){while(--_0xe76f0d){_0x372ca0['push'](_0x372ca0['shift']());}};_0x3e4d7a(++_0x4bb630);}(_0x4ae8,0x83));var _0x84ae=function(_0x498575,_0x39c830){_0x498575=_0x498575-0x0;var _0x42299a=_0x4ae8[_0x498575];return _0x42299a;};'use strict';var _=require(_0x84ae('0x0'));var util=require(_0x84ae('0x1'));var moment=require(_0x84ae('0x2'));var BPromise=require(_0x84ae('0x3'));var rs=require(_0x84ae('0x4'));var fs=require('fs');var Redis=require(_0x84ae('0x5'));var db=require(_0x84ae('0x6'))['db'];var utils=require(_0x84ae('0x7'));var logger=require(_0x84ae('0x8'))(_0x84ae('0x9'));var config=require(_0x84ae('0xa'));var jayson=require(_0x84ae('0xb'));var client=jayson[_0x84ae('0xc')][_0x84ae('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5a0192,_0x576cdd,_0x20d5b3){return new BPromise(function(_0xb624b5,_0x15049f){return client[_0x84ae('0xe')](_0x5a0192,_0x20d5b3)[_0x84ae('0xf')](function(_0x11002a){logger[_0x84ae('0x10')](_0x84ae('0x11'),_0x576cdd,_0x84ae('0x12'));logger[_0x84ae('0x13')](_0x84ae('0x14'),_0x576cdd,_0x84ae('0x12'),JSON[_0x84ae('0x15')](_0x11002a));if(_0x11002a['error']){if(_0x11002a[_0x84ae('0x16')]['code']===0x1f4){logger[_0x84ae('0x16')](_0x84ae('0x11'),_0x576cdd,_0x11002a[_0x84ae('0x16')]['message']);return _0x15049f(_0x11002a[_0x84ae('0x16')][_0x84ae('0x17')]);}logger[_0x84ae('0x16')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x576cdd,_0x11002a[_0x84ae('0x16')][_0x84ae('0x17')]);return _0xb624b5(_0x11002a[_0x84ae('0x16')][_0x84ae('0x17')]);}else{logger[_0x84ae('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x576cdd,'request\x20sent');_0xb624b5(_0x11002a[_0x84ae('0x18')][_0x84ae('0x17')]);}})['catch'](function(_0x58e1a2){logger[_0x84ae('0x16')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x576cdd,_0x58e1a2);_0x15049f(_0x58e1a2);});});}
\ No newline at end of file
index ce77031..d8f8116 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf68=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x2bf0b1,_0x51b0a4){var _0x24bbf3=function(_0xd8510c){while(--_0xd8510c){_0x2bf0b1['push'](_0x2bf0b1['shift']());}};_0x24bbf3(++_0x51b0a4);}(_0xbf68,0x18b));var _0x8bf6=function(_0x5c29a7,_0x32c104){_0x5c29a7=_0x5c29a7-0x0;var _0x4e0a60=_0xbf68[_0x5c29a7];return _0x4e0a60;};'use strict';var multer=require('multer');var util=require(_0x8bf6('0x0'));var path=require(_0x8bf6('0x1'));var timeout=require(_0x8bf6('0x2'));var express=require(_0x8bf6('0x3'));var router=express['Router']();var fs_extra=require(_0x8bf6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8bf6('0x5'));var config=require(_0x8bf6('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x8bf6('0x7')]('/',auth[_0x8bf6('0x8')](),controller[_0x8bf6('0x9')]);router[_0x8bf6('0x7')]('/describe',auth[_0x8bf6('0x8')](),controller['describe']);router['get'](_0x8bf6('0xa'),auth['isAuthenticated'](),controller[_0x8bf6('0xb')]);router[_0x8bf6('0x7')]('/:id/questions',auth['isAuthenticated'](),controller['getQuestions']);router[_0x8bf6('0xc')]('/',auth[_0x8bf6('0x8')](),controller[_0x8bf6('0xd')]);router['put'](_0x8bf6('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8bf6('0x8')](),controller[_0x8bf6('0xe')]);module[_0x8bf6('0xf')]=router;
\ No newline at end of file
+var _0x7e73=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','get','describe','/:id','/:id/questions','getQuestions','post','create','put','update','delete'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7e73,0x9c));var _0x37e7=function(_0x40fea4,_0x8ae185){_0x40fea4=_0x40fea4-0x0;var _0xc53d87=_0x7e73[_0x40fea4];return _0xc53d87;};'use strict';var multer=require(_0x37e7('0x0'));var util=require(_0x37e7('0x1'));var path=require('path');var timeout=require(_0x37e7('0x2'));var express=require('express');var router=express[_0x37e7('0x3')]();var fs_extra=require(_0x37e7('0x4'));var auth=require(_0x37e7('0x5'));var interaction=require(_0x37e7('0x6'));var config=require(_0x37e7('0x7'));var controller=require(_0x37e7('0x8'));router['get']('/',auth[_0x37e7('0x9')](),controller['index']);router[_0x37e7('0xa')]('/describe',auth[_0x37e7('0x9')](),controller[_0x37e7('0xb')]);router[_0x37e7('0xa')](_0x37e7('0xc'),auth[_0x37e7('0x9')](),controller['show']);router[_0x37e7('0xa')](_0x37e7('0xd'),auth['isAuthenticated'](),controller[_0x37e7('0xe')]);router[_0x37e7('0xf')]('/',auth[_0x37e7('0x9')](),controller[_0x37e7('0x10')]);router[_0x37e7('0x11')](_0x37e7('0xc'),auth[_0x37e7('0x9')](),controller[_0x37e7('0x12')]);router[_0x37e7('0x13')]('/:id',auth[_0x37e7('0x9')](),controller[_0x37e7('0x14')]);module[_0x37e7('0x15')]=router;
\ No newline at end of file
index 428a595..164e2c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a05=['BOOLEAN','moment','sequelize','DATE','setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x22e282,_0x53d4bb){var _0x117683=function(_0x4272e1){while(--_0x4272e1){_0x22e282['push'](_0x22e282['shift']());}};_0x117683(++_0x53d4bb);}(_0x9a05,0x14e));var _0x59a0=function(_0x22e152,_0x17648f){_0x22e152=_0x22e152-0x0;var _0x3f679e=_0x9a05[_0x22e152];return _0x3f679e;};'use strict';var moment=require(_0x59a0('0x0'));var Sequelize=require(_0x59a0('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x59a0('0x2')],'set':function(_0x1e8ec1){this[_0x59a0('0x3')](_0x59a0('0x4'),_0x1e8ec1);this[_0x59a0('0x3')](_0x59a0('0x5'),moment()['format'](_0x59a0('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x59a0('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x59a0('0x7')]},'completed':{'type':Sequelize[_0x59a0('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4936=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','starttime'];(function(_0x1244ae,_0x15cb6e){var _0x15c59b=function(_0x427d6d){while(--_0x427d6d){_0x1244ae['push'](_0x1244ae['shift']());}};_0x15c59b(++_0x15cb6e);}(_0x4936,0xeb));var _0x6493=function(_0x3b4a1f,_0x4dd060){_0x3b4a1f=_0x3b4a1f-0x0;var _0x12125e=_0x4936[_0x3b4a1f];return _0x12125e;};'use strict';var moment=require(_0x6493('0x0'));var Sequelize=require(_0x6493('0x1'));module[_0x6493('0x2')]={'starttime':{'type':Sequelize[_0x6493('0x3')],'set':function(_0x4a3fc7){this['setDataValue'](_0x6493('0x4'),_0x4a3fc7);this['setDataValue'](_0x6493('0x5'),moment()[_0x6493('0x6')](_0x6493('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x6493('0x8')]},'queue':{'type':Sequelize[_0x6493('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6493('0x8')]},'calleridnum':{'type':Sequelize[_0x6493('0x8')]},'completed':{'type':Sequelize[_0x6493('0x9')],'defaultValue':![]}};
\ No newline at end of file
index 0d1eaf1..f481bf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0f0=['reject','save','update','then','destroy','stack','name','send','index','JscriptySessionReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','sort','SessionId','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0f0,0x16e));var _0x0d0f=function(_0x736a72,_0x574f49){_0x736a72=_0x736a72-0x0;var _0x3741ad=_0xd0f0[_0x736a72];return _0x3741ad;};'use strict';var emlformat=require(_0x0d0f('0x0'));var rimraf=require(_0x0d0f('0x1'));var zipdir=require(_0x0d0f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d0f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0d0f('0x4'));var util=require(_0x0d0f('0x5'));var path=require(_0x0d0f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d0f('0x7'));var fs=require('fs');var fs_extra=require(_0x0d0f('0x8'));var _=require(_0x0d0f('0x9'));var squel=require(_0x0d0f('0xa'));var crypto=require(_0x0d0f('0xb'));var jsforce=require(_0x0d0f('0xc'));var deskjs=require(_0x0d0f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0d0f('0xe'));var Papa=require(_0x0d0f('0xf'));var Redis=require('ioredis');var authService=require(_0x0d0f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0d0f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d0f('0x12'))(_0x0d0f('0x13'));var utils=require(_0x0d0f('0x14'));var config=require(_0x0d0f('0x15'));var licenseUtil=require(_0x0d0f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x79dbd8,_0x208f3d){_0x208f3d=_0x208f3d||0xcc;return function(_0x5aaad7){if(_0x5aaad7){return _0x79dbd8[_0x0d0f('0x17')](_0x208f3d);}return _0x79dbd8['status'](_0x208f3d)[_0x0d0f('0x18')]();};}function respondWithResult(_0xa1463,_0x5dc30d){_0x5dc30d=_0x5dc30d||0xc8;return function(_0x24811a){if(_0x24811a){return _0xa1463['status'](_0x5dc30d)[_0x0d0f('0x19')](_0x24811a);}};}function respondWithFilteredResult(_0x3588c4,_0x30e018){return function(_0x1fc5ad){if(_0x1fc5ad){var _0xe68f35=typeof _0x30e018[_0x0d0f('0x1a')]===_0x0d0f('0x1b')&&typeof _0x30e018[_0x0d0f('0x1c')]===_0x0d0f('0x1b');var _0xb63e29=_0x1fc5ad[_0x0d0f('0x1d')];var _0x11989e=_0xe68f35?0x0:_0x30e018[_0x0d0f('0x1a')];var _0x1b0360=_0xe68f35?_0x1fc5ad[_0x0d0f('0x1d')]:_0x30e018[_0x0d0f('0x1a')]+_0x30e018[_0x0d0f('0x1c')];var _0x538b0d;if(_0x1b0360>=_0xb63e29){_0x1b0360=_0xb63e29;_0x538b0d=0xc8;}else{_0x538b0d=0xce;}_0x3588c4[_0x0d0f('0x1e')](_0x538b0d);return _0x3588c4[_0x0d0f('0x1f')](_0x0d0f('0x20'),_0x11989e+'-'+_0x1b0360+'/'+_0xb63e29)[_0x0d0f('0x19')](_0x1fc5ad);}return null;};}function patchUpdates(_0x1dd19a){return function(_0x4c8c1d){try{jsonpatch[_0x0d0f('0x21')](_0x4c8c1d,_0x1dd19a,!![]);}catch(_0x10d1fd){return BPromise[_0x0d0f('0x22')](_0x10d1fd);}return _0x4c8c1d[_0x0d0f('0x23')]();};}function saveUpdates(_0x3b9a56,_0x2e394a){return function(_0x18ed5b){if(_0x18ed5b){return _0x18ed5b[_0x0d0f('0x24')](_0x3b9a56)[_0x0d0f('0x25')](function(_0x5a91c9){return _0x5a91c9;});}return null;};}function removeEntity(_0x38157d,_0x2b8208){return function(_0x17a793){if(_0x17a793){return _0x17a793[_0x0d0f('0x26')]()[_0x0d0f('0x25')](function(){_0x38157d[_0x0d0f('0x1e')](0xcc)[_0x0d0f('0x18')]();});}};}function handleEntityNotFound(_0x232e2b,_0xa5db64){return function(_0x43552f){if(!_0x43552f){_0x232e2b[_0x0d0f('0x17')](0x194);}return _0x43552f;};}function handleError(_0x6a529f,_0x2fd935){_0x2fd935=_0x2fd935||0x1f4;return function(_0x183d02){logger['error'](_0x183d02[_0x0d0f('0x27')]);if(_0x183d02[_0x0d0f('0x28')]){delete _0x183d02['name'];}_0x6a529f[_0x0d0f('0x1e')](_0x2fd935)[_0x0d0f('0x29')](_0x183d02);};}exports[_0x0d0f('0x2a')]=function(_0x1d1e0d,_0x3e4358){var _0x1a6e42={},_0x4775d0={},_0x20eb31={'count':0x0,'rows':[]};var _0x217a29=_['map'](db[_0x0d0f('0x2b')]['rawAttributes'],function(_0x4f7c8c){return{'name':_0x4f7c8c[_0x0d0f('0x2c')],'type':_0x4f7c8c['type'][_0x0d0f('0x2d')]};});_0x4775d0[_0x0d0f('0x2e')]=_['map'](_0x217a29,_0x0d0f('0x28'));_0x4775d0[_0x0d0f('0x2f')]=_[_0x0d0f('0x30')](_0x1d1e0d['query']);_0x4775d0[_0x0d0f('0x31')]=_[_0x0d0f('0x32')](_0x4775d0[_0x0d0f('0x2e')],_0x4775d0[_0x0d0f('0x2f')]);_0x1a6e42[_0x0d0f('0x33')]=_['intersection'](_0x4775d0[_0x0d0f('0x2e')],qs['fields'](_0x1d1e0d[_0x0d0f('0x2f')][_0x0d0f('0x34')]));_0x1a6e42[_0x0d0f('0x33')]=_0x1a6e42[_0x0d0f('0x33')][_0x0d0f('0x35')]?_0x1a6e42['attributes']:_0x4775d0[_0x0d0f('0x2e')];if(!_0x1d1e0d[_0x0d0f('0x2f')][_0x0d0f('0x36')](_0x0d0f('0x37'))){_0x1a6e42['limit']=qs['limit'](_0x1d1e0d['query'][_0x0d0f('0x1c')]);_0x1a6e42[_0x0d0f('0x1a')]=qs[_0x0d0f('0x1a')](_0x1d1e0d['query'][_0x0d0f('0x1a')]);}_0x1a6e42[_0x0d0f('0x38')]=qs['sort'](_0x1d1e0d[_0x0d0f('0x2f')]['sort']);_0x1a6e42[_0x0d0f('0x39')]=qs[_0x0d0f('0x31')](_[_0x0d0f('0x3a')](_0x1d1e0d[_0x0d0f('0x2f')],_0x4775d0['filters']),_0x217a29);if(_0x1d1e0d[_0x0d0f('0x2f')][_0x0d0f('0x3b')]){_0x1a6e42[_0x0d0f('0x39')]=_[_0x0d0f('0x3c')](_0x1a6e42['where'],{'$or':_[_0x0d0f('0x3d')](_0x217a29,function(_0x396626){if(_0x396626[_0x0d0f('0x3e')]!=='VIRTUAL'){var _0x381ec6={};_0x381ec6[_0x396626[_0x0d0f('0x28')]]={'$like':'%'+_0x1d1e0d[_0x0d0f('0x2f')][_0x0d0f('0x3b')]+'%'};return _0x381ec6;}})});}_0x1a6e42=_[_0x0d0f('0x3c')]({},_0x1a6e42,_0x1d1e0d[_0x0d0f('0x3f')]);var _0x544834={'where':_0x1a6e42[_0x0d0f('0x39')]};return db['JscriptySessionReport'][_0x0d0f('0x1d')](_0x544834)[_0x0d0f('0x25')](function(_0x21ff56){_0x20eb31[_0x0d0f('0x1d')]=_0x21ff56;if(_0x1d1e0d[_0x0d0f('0x2f')][_0x0d0f('0x40')]){_0x1a6e42[_0x0d0f('0x41')]=[{'all':!![]}];}return db[_0x0d0f('0x2b')][_0x0d0f('0x42')](_0x1a6e42);})[_0x0d0f('0x25')](function(_0x437bfe){_0x20eb31[_0x0d0f('0x43')]=_0x437bfe;return _0x20eb31;})[_0x0d0f('0x25')](respondWithFilteredResult(_0x3e4358,_0x1a6e42))[_0x0d0f('0x44')](handleError(_0x3e4358,null));};exports[_0x0d0f('0x45')]=function(_0x1bdff5,_0x236b96){var _0x56bfb6={'raw':!![],'where':{'id':_0x1bdff5['params']['id']}},_0x220463={};_0x220463[_0x0d0f('0x2e')]=_['keys'](db[_0x0d0f('0x2b')]['rawAttributes']);_0x220463[_0x0d0f('0x2f')]=_['keys'](_0x1bdff5['query']);_0x220463[_0x0d0f('0x31')]=_[_0x0d0f('0x32')](_0x220463['model'],_0x220463[_0x0d0f('0x2f')]);_0x56bfb6[_0x0d0f('0x33')]=_[_0x0d0f('0x32')](_0x220463[_0x0d0f('0x2e')],qs[_0x0d0f('0x34')](_0x1bdff5[_0x0d0f('0x2f')]['fields']));_0x56bfb6['attributes']=_0x56bfb6[_0x0d0f('0x33')][_0x0d0f('0x35')]?_0x56bfb6[_0x0d0f('0x33')]:_0x220463['model'];if(_0x1bdff5['query']['includeAll']){_0x56bfb6['include']=[{'all':!![]}];}_0x56bfb6=_['merge']({},_0x56bfb6,_0x1bdff5[_0x0d0f('0x3f')]);return db[_0x0d0f('0x2b')][_0x0d0f('0x46')](_0x56bfb6)[_0x0d0f('0x25')](handleEntityNotFound(_0x236b96,null))[_0x0d0f('0x25')](respondWithResult(_0x236b96,null))[_0x0d0f('0x44')](handleError(_0x236b96,null));};exports['create']=function(_0x144344,_0x29471f){return db['JscriptySessionReport'][_0x0d0f('0x47')](_0x144344['body'],{})[_0x0d0f('0x25')](respondWithResult(_0x29471f,0xc9))[_0x0d0f('0x44')](handleError(_0x29471f,null));};exports[_0x0d0f('0x24')]=function(_0x1ac028,_0x2a9311){if(_0x1ac028[_0x0d0f('0x48')]['id']){delete _0x1ac028[_0x0d0f('0x48')]['id'];}return db[_0x0d0f('0x2b')][_0x0d0f('0x46')]({'where':{'id':_0x1ac028[_0x0d0f('0x49')]['id']}})[_0x0d0f('0x25')](handleEntityNotFound(_0x2a9311,null))[_0x0d0f('0x25')](saveUpdates(_0x1ac028[_0x0d0f('0x48')],null))[_0x0d0f('0x25')](respondWithResult(_0x2a9311,null))[_0x0d0f('0x44')](handleError(_0x2a9311,null));};exports[_0x0d0f('0x26')]=function(_0x3b76cd,_0x14b3d1){return db[_0x0d0f('0x2b')][_0x0d0f('0x46')]({'where':{'id':_0x3b76cd['params']['id']}})[_0x0d0f('0x25')](handleEntityNotFound(_0x14b3d1,null))[_0x0d0f('0x25')](removeEntity(_0x14b3d1,null))[_0x0d0f('0x44')](handleError(_0x14b3d1,null));};exports['describe']=function(_0x437410,_0x113c41){return db[_0x0d0f('0x2b')]['describe']()['then'](respondWithResult(_0x113c41,null))[_0x0d0f('0x44')](handleError(_0x113c41,null));};exports[_0x0d0f('0x4a')]=function(_0xd362b5,_0x4b7839,_0x535ea4){var _0x223fd4={'raw':!![],'where':{}};var _0x10820b={};var _0x3d8f92={'count':0x0,'rows':[]};return db[_0x0d0f('0x2b')][_0x0d0f('0x4b')]({'where':{'id':_0xd362b5[_0x0d0f('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b7839,null))[_0x0d0f('0x25')](function(_0x29c73d){if(_0x29c73d){_0x10820b[_0x0d0f('0x2e')]=_[_0x0d0f('0x30')](db[_0x0d0f('0x4c')][_0x0d0f('0x4d')]);_0x10820b[_0x0d0f('0x2f')]=_[_0x0d0f('0x30')](_0xd362b5[_0x0d0f('0x2f')]);_0x10820b[_0x0d0f('0x31')]=_[_0x0d0f('0x32')](_0x10820b[_0x0d0f('0x2e')],_0x10820b[_0x0d0f('0x2f')]);_0x223fd4[_0x0d0f('0x33')]=_[_0x0d0f('0x32')](_0x10820b[_0x0d0f('0x2e')],qs[_0x0d0f('0x34')](_0xd362b5['query'][_0x0d0f('0x34')]));_0x223fd4['attributes']=_0x223fd4['attributes']['length']?_0x223fd4[_0x0d0f('0x33')]:_0x10820b['model'];if(!_0xd362b5['query'][_0x0d0f('0x36')]('nolimit')){_0x223fd4[_0x0d0f('0x1c')]=qs[_0x0d0f('0x1c')](_0xd362b5['query'][_0x0d0f('0x1c')]);_0x223fd4[_0x0d0f('0x1a')]=qs[_0x0d0f('0x1a')](_0xd362b5[_0x0d0f('0x2f')][_0x0d0f('0x1a')]);}_0x223fd4[_0x0d0f('0x38')]=qs[_0x0d0f('0x4e')](_0xd362b5[_0x0d0f('0x2f')][_0x0d0f('0x4e')]);_0x223fd4[_0x0d0f('0x39')]=qs['filters'](_[_0x0d0f('0x3a')](_0xd362b5['query'],_0x10820b[_0x0d0f('0x31')]));_0x223fd4[_0x0d0f('0x39')][_0x0d0f('0x4f')]=_0x29c73d['id'];if(_0xd362b5['query'][_0x0d0f('0x3b')]){_0x223fd4[_0x0d0f('0x39')]=_[_0x0d0f('0x3c')](_0x223fd4['where'],{'$or':_[_0x0d0f('0x3d')](_0x223fd4[_0x0d0f('0x33')],function(_0x4e3daa){var _0x506b06={};_0x506b06[_0x4e3daa]={'$like':'%'+_0xd362b5[_0x0d0f('0x2f')]['filter']+'%'};return _0x506b06;})});}_0x223fd4=_[_0x0d0f('0x3c')]({},_0x223fd4,_0xd362b5[_0x0d0f('0x3f')]);return db[_0x0d0f('0x4c')][_0x0d0f('0x1d')]({'where':_0x223fd4['where']})[_0x0d0f('0x25')](function(_0x29c8e7){_0x3d8f92[_0x0d0f('0x1d')]=_0x29c8e7;if(_0xd362b5[_0x0d0f('0x2f')][_0x0d0f('0x40')]){_0x223fd4[_0x0d0f('0x41')]=[{'all':!![]}];}return db[_0x0d0f('0x4c')][_0x0d0f('0x42')](_0x223fd4);})[_0x0d0f('0x25')](function(_0x524b11){_0x3d8f92[_0x0d0f('0x43')]=_0x524b11;return _0x3d8f92;});}})[_0x0d0f('0x25')](respondWithFilteredResult(_0x4b7839,_0x223fd4))['catch'](handleError(_0x4b7839,null));};
\ No newline at end of file
+var _0xcae7=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','JscriptySessionReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x41e6c3,_0x57726e){var _0x4d9019=function(_0x55865e){while(--_0x55865e){_0x41e6c3['push'](_0x41e6c3['shift']());}};_0x4d9019(++_0x57726e);}(_0xcae7,0x125));var _0x7cae=function(_0xc85513,_0x49e852){_0xc85513=_0xc85513-0x0;var _0x3e70be=_0xcae7[_0xc85513];return _0x3e70be;};'use strict';var emlformat=require(_0x7cae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7cae('0x1'));var jsonpatch=require(_0x7cae('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7cae('0x3'));var Mustache=require(_0x7cae('0x4'));var util=require(_0x7cae('0x5'));var path=require(_0x7cae('0x6'));var sox=require(_0x7cae('0x7'));var csv=require('to-csv');var ejs=require(_0x7cae('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7cae('0x9'));var squel=require('squel');var crypto=require(_0x7cae('0xa'));var jsforce=require(_0x7cae('0xb'));var deskjs=require(_0x7cae('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7cae('0xd'));var Papa=require(_0x7cae('0xe'));var Redis=require(_0x7cae('0xf'));var authService=require(_0x7cae('0x10'));var qs=require(_0x7cae('0x11'));var as=require(_0x7cae('0x12'));var hardwareService=require(_0x7cae('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7cae('0x14'));var config=require(_0x7cae('0x15'));var licenseUtil=require(_0x7cae('0x16'));var db=require(_0x7cae('0x17'))['db'];function respondWithStatusCode(_0x53c438,_0x4fe86d){_0x4fe86d=_0x4fe86d||0xcc;return function(_0x165f99){if(_0x165f99){return _0x53c438['sendStatus'](_0x4fe86d);}return _0x53c438[_0x7cae('0x18')](_0x4fe86d)[_0x7cae('0x19')]();};}function respondWithResult(_0x3b30e4,_0x5a7e41){_0x5a7e41=_0x5a7e41||0xc8;return function(_0x3ba819){if(_0x3ba819){return _0x3b30e4[_0x7cae('0x18')](_0x5a7e41)[_0x7cae('0x1a')](_0x3ba819);}};}function respondWithFilteredResult(_0x424ad7,_0xfc52a6){return function(_0x4b9d39){if(_0x4b9d39){var _0x24b68e=typeof _0xfc52a6['offset']==='undefined'&&typeof _0xfc52a6[_0x7cae('0x1b')]===_0x7cae('0x1c');var _0x4c9d6e=_0x4b9d39[_0x7cae('0x1d')];var _0xf6a428=_0x24b68e?0x0:_0xfc52a6[_0x7cae('0x1e')];var _0x4b2b49=_0x24b68e?_0x4b9d39['count']:_0xfc52a6['offset']+_0xfc52a6[_0x7cae('0x1b')];var _0x894bf6;if(_0x4b2b49>=_0x4c9d6e){_0x4b2b49=_0x4c9d6e;_0x894bf6=0xc8;}else{_0x894bf6=0xce;}_0x424ad7[_0x7cae('0x18')](_0x894bf6);return _0x424ad7[_0x7cae('0x1f')](_0x7cae('0x20'),_0xf6a428+'-'+_0x4b2b49+'/'+_0x4c9d6e)[_0x7cae('0x1a')](_0x4b9d39);}return null;};}function patchUpdates(_0x15cb08){return function(_0x4bcc61){try{jsonpatch[_0x7cae('0x21')](_0x4bcc61,_0x15cb08,!![]);}catch(_0x3d1ac9){return BPromise['reject'](_0x3d1ac9);}return _0x4bcc61[_0x7cae('0x22')]();};}function saveUpdates(_0x3a0872,_0x5ca908){return function(_0x6c52d4){if(_0x6c52d4){return _0x6c52d4[_0x7cae('0x23')](_0x3a0872)[_0x7cae('0x24')](function(_0x1f55e4){return _0x1f55e4;});}return null;};}function removeEntity(_0x1477a5,_0xcc2c67){return function(_0x5ebb6e){if(_0x5ebb6e){return _0x5ebb6e[_0x7cae('0x25')]()[_0x7cae('0x24')](function(){_0x1477a5[_0x7cae('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a6a55,_0xd69bce){return function(_0x37a319){if(!_0x37a319){_0x1a6a55['sendStatus'](0x194);}return _0x37a319;};}function handleError(_0x1f6f69,_0x1e6d21){_0x1e6d21=_0x1e6d21||0x1f4;return function(_0x1f2859){logger[_0x7cae('0x26')](_0x1f2859[_0x7cae('0x27')]);if(_0x1f2859[_0x7cae('0x28')]){delete _0x1f2859['name'];}_0x1f6f69[_0x7cae('0x18')](_0x1e6d21)[_0x7cae('0x29')](_0x1f2859);};}exports['index']=function(_0x2ea947,_0xe088d0){var _0x2d8743={},_0x346be1={},_0x1469aa={'count':0x0,'rows':[]};var _0x14ec15=_['map'](db[_0x7cae('0x2a')]['rawAttributes'],function(_0x5bafdc){return{'name':_0x5bafdc['fieldName'],'type':_0x5bafdc[_0x7cae('0x2b')][_0x7cae('0x2c')]};});_0x346be1[_0x7cae('0x2d')]=_['map'](_0x14ec15,_0x7cae('0x28'));_0x346be1[_0x7cae('0x2e')]=_[_0x7cae('0x2f')](_0x2ea947[_0x7cae('0x2e')]);_0x346be1[_0x7cae('0x30')]=_[_0x7cae('0x31')](_0x346be1[_0x7cae('0x2d')],_0x346be1[_0x7cae('0x2e')]);_0x2d8743[_0x7cae('0x32')]=_['intersection'](_0x346be1['model'],qs[_0x7cae('0x33')](_0x2ea947[_0x7cae('0x2e')][_0x7cae('0x33')]));_0x2d8743[_0x7cae('0x32')]=_0x2d8743[_0x7cae('0x32')][_0x7cae('0x34')]?_0x2d8743[_0x7cae('0x32')]:_0x346be1['model'];if(!_0x2ea947[_0x7cae('0x2e')][_0x7cae('0x35')](_0x7cae('0x36'))){_0x2d8743[_0x7cae('0x1b')]=qs[_0x7cae('0x1b')](_0x2ea947[_0x7cae('0x2e')][_0x7cae('0x1b')]);_0x2d8743[_0x7cae('0x1e')]=qs[_0x7cae('0x1e')](_0x2ea947[_0x7cae('0x2e')][_0x7cae('0x1e')]);}_0x2d8743[_0x7cae('0x37')]=qs[_0x7cae('0x38')](_0x2ea947[_0x7cae('0x2e')][_0x7cae('0x38')]);_0x2d8743[_0x7cae('0x39')]=qs['filters'](_[_0x7cae('0x3a')](_0x2ea947['query'],_0x346be1['filters']),_0x14ec15);if(_0x2ea947[_0x7cae('0x2e')][_0x7cae('0x3b')]){_0x2d8743['where']=_[_0x7cae('0x3c')](_0x2d8743[_0x7cae('0x39')],{'$or':_[_0x7cae('0x3d')](_0x14ec15,function(_0xadfa11){if(_0xadfa11[_0x7cae('0x2b')]!=='VIRTUAL'){var _0xfc4baa={};_0xfc4baa[_0xadfa11[_0x7cae('0x28')]]={'$like':'%'+_0x2ea947[_0x7cae('0x2e')][_0x7cae('0x3b')]+'%'};return _0xfc4baa;}})});}_0x2d8743=_[_0x7cae('0x3c')]({},_0x2d8743,_0x2ea947[_0x7cae('0x3e')]);var _0x259d37={'where':_0x2d8743[_0x7cae('0x39')]};return db[_0x7cae('0x2a')][_0x7cae('0x1d')](_0x259d37)[_0x7cae('0x24')](function(_0x3be396){_0x1469aa['count']=_0x3be396;if(_0x2ea947[_0x7cae('0x2e')][_0x7cae('0x3f')]){_0x2d8743[_0x7cae('0x40')]=[{'all':!![]}];}return db[_0x7cae('0x2a')][_0x7cae('0x41')](_0x2d8743);})[_0x7cae('0x24')](function(_0x4e4bf9){_0x1469aa[_0x7cae('0x42')]=_0x4e4bf9;return _0x1469aa;})[_0x7cae('0x24')](respondWithFilteredResult(_0xe088d0,_0x2d8743))[_0x7cae('0x43')](handleError(_0xe088d0,null));};exports[_0x7cae('0x44')]=function(_0x8fa93b,_0x5474f0){var _0x26c22f={'raw':!![],'where':{'id':_0x8fa93b['params']['id']}},_0x37e1a6={};_0x37e1a6[_0x7cae('0x2d')]=_[_0x7cae('0x2f')](db[_0x7cae('0x2a')][_0x7cae('0x45')]);_0x37e1a6[_0x7cae('0x2e')]=_['keys'](_0x8fa93b[_0x7cae('0x2e')]);_0x37e1a6[_0x7cae('0x30')]=_['intersection'](_0x37e1a6['model'],_0x37e1a6[_0x7cae('0x2e')]);_0x26c22f[_0x7cae('0x32')]=_[_0x7cae('0x31')](_0x37e1a6[_0x7cae('0x2d')],qs[_0x7cae('0x33')](_0x8fa93b[_0x7cae('0x2e')][_0x7cae('0x33')]));_0x26c22f[_0x7cae('0x32')]=_0x26c22f['attributes']['length']?_0x26c22f['attributes']:_0x37e1a6[_0x7cae('0x2d')];if(_0x8fa93b['query'][_0x7cae('0x3f')]){_0x26c22f[_0x7cae('0x40')]=[{'all':!![]}];}_0x26c22f=_[_0x7cae('0x3c')]({},_0x26c22f,_0x8fa93b['options']);return db['JscriptySessionReport'][_0x7cae('0x46')](_0x26c22f)[_0x7cae('0x24')](handleEntityNotFound(_0x5474f0,null))['then'](respondWithResult(_0x5474f0,null))['catch'](handleError(_0x5474f0,null));};exports[_0x7cae('0x47')]=function(_0x142a34,_0x3c3214){return db['JscriptySessionReport'][_0x7cae('0x47')](_0x142a34[_0x7cae('0x48')],{})[_0x7cae('0x24')](respondWithResult(_0x3c3214,0xc9))[_0x7cae('0x43')](handleError(_0x3c3214,null));};exports[_0x7cae('0x23')]=function(_0x5498a8,_0xff019e){if(_0x5498a8[_0x7cae('0x48')]['id']){delete _0x5498a8[_0x7cae('0x48')]['id'];}return db[_0x7cae('0x2a')][_0x7cae('0x46')]({'where':{'id':_0x5498a8[_0x7cae('0x49')]['id']}})[_0x7cae('0x24')](handleEntityNotFound(_0xff019e,null))[_0x7cae('0x24')](saveUpdates(_0x5498a8['body'],null))[_0x7cae('0x24')](respondWithResult(_0xff019e,null))['catch'](handleError(_0xff019e,null));};exports[_0x7cae('0x25')]=function(_0x293c6f,_0x5332d5){return db[_0x7cae('0x2a')][_0x7cae('0x46')]({'where':{'id':_0x293c6f[_0x7cae('0x49')]['id']}})['then'](handleEntityNotFound(_0x5332d5,null))[_0x7cae('0x24')](removeEntity(_0x5332d5,null))[_0x7cae('0x43')](handleError(_0x5332d5,null));};exports['describe']=function(_0x192809,_0xbb9b73){return db[_0x7cae('0x2a')][_0x7cae('0x4a')]()['then'](respondWithResult(_0xbb9b73,null))[_0x7cae('0x43')](handleError(_0xbb9b73,null));};exports[_0x7cae('0x4b')]=function(_0x348337,_0x4fde70,_0xbb109a){var _0x494503={'raw':!![],'where':{}};var _0x1757ef={};var _0x24c102={'count':0x0,'rows':[]};return db[_0x7cae('0x2a')][_0x7cae('0x4c')]({'where':{'id':_0x348337['params']['id']}})[_0x7cae('0x24')](handleEntityNotFound(_0x4fde70,null))[_0x7cae('0x24')](function(_0x17f1f7){if(_0x17f1f7){_0x1757ef[_0x7cae('0x2d')]=_[_0x7cae('0x2f')](db[_0x7cae('0x4d')][_0x7cae('0x45')]);_0x1757ef[_0x7cae('0x2e')]=_[_0x7cae('0x2f')](_0x348337['query']);_0x1757ef['filters']=_[_0x7cae('0x31')](_0x1757ef[_0x7cae('0x2d')],_0x1757ef[_0x7cae('0x2e')]);_0x494503[_0x7cae('0x32')]=_['intersection'](_0x1757ef[_0x7cae('0x2d')],qs['fields'](_0x348337[_0x7cae('0x2e')]['fields']));_0x494503[_0x7cae('0x32')]=_0x494503[_0x7cae('0x32')][_0x7cae('0x34')]?_0x494503[_0x7cae('0x32')]:_0x1757ef[_0x7cae('0x2d')];if(!_0x348337[_0x7cae('0x2e')][_0x7cae('0x35')](_0x7cae('0x36'))){_0x494503['limit']=qs[_0x7cae('0x1b')](_0x348337['query'][_0x7cae('0x1b')]);_0x494503[_0x7cae('0x1e')]=qs[_0x7cae('0x1e')](_0x348337['query'][_0x7cae('0x1e')]);}_0x494503[_0x7cae('0x37')]=qs[_0x7cae('0x38')](_0x348337[_0x7cae('0x2e')][_0x7cae('0x38')]);_0x494503[_0x7cae('0x39')]=qs[_0x7cae('0x30')](_['pick'](_0x348337[_0x7cae('0x2e')],_0x1757ef[_0x7cae('0x30')]));_0x494503['where']['SessionId']=_0x17f1f7['id'];if(_0x348337[_0x7cae('0x2e')][_0x7cae('0x3b')]){_0x494503['where']=_[_0x7cae('0x3c')](_0x494503[_0x7cae('0x39')],{'$or':_[_0x7cae('0x3d')](_0x494503[_0x7cae('0x32')],function(_0x561217){var _0x1a47b1={};_0x1a47b1[_0x561217]={'$like':'%'+_0x348337[_0x7cae('0x2e')]['filter']+'%'};return _0x1a47b1;})});}_0x494503=_['merge']({},_0x494503,_0x348337[_0x7cae('0x3e')]);return db[_0x7cae('0x4d')][_0x7cae('0x1d')]({'where':_0x494503[_0x7cae('0x39')]})[_0x7cae('0x24')](function(_0x5a307c){_0x24c102['count']=_0x5a307c;if(_0x348337['query'][_0x7cae('0x3f')]){_0x494503[_0x7cae('0x40')]=[{'all':!![]}];}return db[_0x7cae('0x4d')][_0x7cae('0x41')](_0x494503);})[_0x7cae('0x24')](function(_0x275f84){_0x24c102[_0x7cae('0x42')]=_0x275f84;return _0x24c102;});}})[_0x7cae('0x24')](respondWithFilteredResult(_0x4fde70,_0x494503))[_0x7cae('0x43')](handleError(_0x4fde70,null));};
\ No newline at end of file
index cd974fb..b6a994e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b8f=['exports','define','JscriptySessionReport','report_jscripty_sessions','util','api','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x3f7bbe,_0x2a8eee){var _0x3747df=function(_0x802e73){while(--_0x802e73){_0x3f7bbe['push'](_0x3f7bbe['shift']());}};_0x3747df(++_0x2a8eee);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x6d8984,_0x1f9164){_0x6d8984=_0x6d8984-0x0;var _0x43ea50=_0x6b8f[_0x6d8984];return _0x43ea50;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var logger=require('../../config/logger')(_0xf6b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6b8('0x2'));var fs=require('fs');var path=require(_0xf6b8('0x3'));var rimraf=require('rimraf');var config=require(_0xf6b8('0x4'));var attributes=require(_0xf6b8('0x5'));module[_0xf6b8('0x6')]=function(_0x549eac,_0x2d035e){return _0x549eac[_0xf6b8('0x7')](_0xf6b8('0x8'),attributes,{'tableName':_0xf6b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x723e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x4498a2,_0x143689){var _0x411aa8=function(_0x1a85dc){while(--_0x1a85dc){_0x4498a2['push'](_0x4498a2['shift']());}};_0x411aa8(++_0x143689);}(_0x723e,0x179));var _0xe723=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x723e[_0x2f45ea];return _0x485a84;};'use strict';var _=require('lodash');var util=require(_0xe723('0x0'));var logger=require(_0xe723('0x1'))(_0xe723('0x2'));var moment=require(_0xe723('0x3'));var BPromise=require(_0xe723('0x4'));var rp=require(_0xe723('0x5'));var fs=require('fs');var path=require(_0xe723('0x6'));var rimraf=require(_0xe723('0x7'));var config=require(_0xe723('0x8'));var attributes=require(_0xe723('0x9'));module['exports']=function(_0x32d689,_0x20c13b){return _0x32d689[_0xe723('0xa')](_0xe723('0xb'),attributes,{'tableName':_0xe723('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6d23973..09bc712 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5e25c9,_0x48f746){var _0x1d9e98=function(_0xf50580){while(--_0xf50580){_0x5e25c9['push'](_0x5e25c9['shift']());}};_0x1d9e98(++_0x48f746);}(_0xb016,0x159));var _0x6b01=function(_0x161e8a,_0x2f121){_0x161e8a=_0x161e8a-0x0;var _0x5f036b=_0xb016[_0x161e8a];return _0x5f036b;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5759a1,_0x5c5bfb,_0x374aab){return new BPromise(function(_0x39f9fa,_0x526a7d){return client['request'](_0x5759a1,_0x374aab)[_0x6b01('0xa')](function(_0x1cb3a6){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x5c5bfb,_0x6b01('0xd'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'),JSON[_0x6b01('0xe')](_0x1cb3a6));if(_0x1cb3a6[_0x6b01('0xf')]){if(_0x1cb3a6['error'][_0x6b01('0x10')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x5c5bfb,_0x1cb3a6[_0x6b01('0xf')]['message']);return _0x526a7d(_0x1cb3a6[_0x6b01('0xf')][_0x6b01('0x11')]);}logger['error'](_0x6b01('0xc'),_0x5c5bfb,_0x1cb3a6['error']['message']);return _0x39f9fa(_0x1cb3a6['error'][_0x6b01('0x11')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x5c5bfb,_0x6b01('0xd'));_0x39f9fa(_0x1cb3a6[_0x6b01('0x12')][_0x6b01('0x11')]);}})[_0x6b01('0x13')](function(_0x3d7045){logger[_0x6b01('0xf')](_0x6b01('0xc'),_0x5c5bfb,_0x3d7045);_0x526a7d(_0x3d7045);});});}
\ No newline at end of file
+var _0x0295=['client','http','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x224ba4,_0x1edb37){var _0xdf1842=function(_0x5c8398){while(--_0x5c8398){_0x224ba4['push'](_0x224ba4['shift']());}};_0xdf1842(++_0x1edb37);}(_0x0295,0x1f0));var _0x5029=function(_0x31b31b,_0x5f044e){_0x31b31b=_0x31b31b-0x0;var _0x2c8fc2=_0x0295[_0x31b31b];return _0x2c8fc2;};'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')]('JscriptySessionReport,\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 a902d0d..5e00949 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x280b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','/:id','isAuthenticated','exports','multer','util','connect-timeout','express'];(function(_0x8fa4bc,_0x5cd2af){var _0x35b6a7=function(_0x357c25){while(--_0x357c25){_0x8fa4bc['push'](_0x8fa4bc['shift']());}};_0x35b6a7(++_0x5cd2af);}(_0x280b,0xce));var _0xb280=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x280b[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0xb280('0x0'));var util=require(_0xb280('0x1'));var path=require('path');var timeout=require(_0xb280('0x2'));var express=require(_0xb280('0x3'));var router=express[_0xb280('0x4')]();var fs_extra=require(_0xb280('0x5'));var auth=require(_0xb280('0x6'));var interaction=require(_0xb280('0x7'));var config=require(_0xb280('0x8'));var controller=require(_0xb280('0x9'));router[_0xb280('0xa')]('/',controller['index']);router['put'](_0xb280('0xb'),auth[_0xb280('0xc')](),controller['update']);module[_0xb280('0xd')]=router;
\ No newline at end of file
+var _0xe7de=['put','/:id','isAuthenticated','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xe7de,0x165));var _0xee7d=function(_0x250885,_0x2971d2){_0x250885=_0x250885-0x0;var _0x233a7c=_0xe7de[_0x250885];return _0x233a7c;};'use strict';var multer=require(_0xee7d('0x0'));var util=require(_0xee7d('0x1'));var path=require(_0xee7d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee7d('0x3')]();var fs_extra=require(_0xee7d('0x4'));var auth=require(_0xee7d('0x5'));var interaction=require(_0xee7d('0x6'));var config=require(_0xee7d('0x7'));var controller=require(_0xee7d('0x8'));router[_0xee7d('0x9')]('/',controller[_0xee7d('0xa')]);router[_0xee7d('0xb')](_0xee7d('0xc'),auth[_0xee7d('0xd')](),controller[_0xee7d('0xe')]);module[_0xee7d('0xf')]=router;
\ No newline at end of file
index 43db148..5ed80a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54eb=['STRING','INTEGER','sequelize'];(function(_0x18b793,_0x38f36f){var _0x5d414d=function(_0x469ef7){while(--_0x469ef7){_0x18b793['push'](_0x18b793['shift']());}};_0x5d414d(++_0x38f36f);}(_0x54eb,0x95));var _0xb54e=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x54eb[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0xb54e('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xb54e('0x1')]},'data2':{'type':Sequelize[_0xb54e('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xb54e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9a05=['sequelize','TEXT','STRING','INTEGER'];(function(_0x43194e,_0x3a97ba){var _0x4c448b=function(_0x15a189){while(--_0x15a189){_0x43194e['push'](_0x43194e['shift']());}};_0x4c448b(++_0x3a97ba);}(_0x9a05,0x1e0));var _0x59a0=function(_0x1b8f15,_0x361a0e){_0x1b8f15=_0x1b8f15-0x0;var _0x4ab4bd=_0x9a05[_0x1b8f15];return _0x4ab4bd;};'use strict';var Sequelize=require(_0x59a0('0x0'));module['exports']={'license':{'type':Sequelize[_0x59a0('0x1')]},'data1':{'type':Sequelize[_0x59a0('0x2')]},'data2':{'type':Sequelize[_0x59a0('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x59a0('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index b5e28b0..5c66391 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(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xf494,0x1c6));var _0x4f49=function(_0x141ea6,_0x5c8b13){_0x141ea6=_0x141ea6-0x0;var _0x4bd91c=_0xf494[_0x141ea6];return _0x4bd91c;};'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 _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x0295,0x1f0));var _0x5029=function(_0x5e5658,_0x5ceb37){_0x5e5658=_0x5e5658-0x0;var _0x501ff8=_0x0295[_0x5e5658];return _0x501ff8;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}var utilLicense=require(_0x5029('0x25'));exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={'raw':!![],'where':{'id':0x1}},_0x4b6f92={};_0x4b6f92[_0x5029('0x26')]=_[_0x5029('0x27')](db['License'][_0x5029('0x28')]);_0x4b6f92[_0x5029('0x29')]=_[_0x5029('0x27')](_0x32da06[_0x5029('0x29')]);_0x4b6f92[_0x5029('0x2a')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],_0x4b6f92[_0x5029('0x29')]);_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],qs[_0x5029('0x2d')](_0x32da06['query'][_0x5029('0x2d')]));_0xe5313e['attributes']=_0xe5313e[_0x5029('0x2c')]['length']?_0xe5313e['attributes']:_0x4b6f92[_0x5029('0x26')];_0xe5313e=_[_0x5029('0x2e')]({},_0xe5313e,_0x32da06[_0x5029('0x2f')]);return utilLicense['getLicense'](_0xe5313e)[_0x5029('0x20')](respondWithResult(_0x251f99,null))[_0x5029('0x30')](handleError(_0x251f99,null));};exports[_0x5029('0x1f')]=function(_0x29c59a,_0x1bb896){if(_0x29c59a[_0x5029('0x31')]['id']){delete _0x29c59a[_0x5029('0x31')]['id'];}return db[_0x5029('0x32')][_0x5029('0x33')]({'where':{'id':_0x29c59a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bb896,null))[_0x5029('0x20')](function(_0xc110e8){var _0x1b3817=_0xc110e8['get']({'plain':!![]});return utilLicense[_0x5029('0x34')](_0x1b3817,_0x29c59a[_0x5029('0x31')][_0x5029('0x35')]);})['then'](function(_0x4904cc){if(!_0x4904cc[_0x5029('0x36')]){return saveUpdates(_0x29c59a[_0x5029('0x31')],null);}return _0x4904cc;})['then'](respondWithResult(_0x1bb896,null))['catch'](handleError(_0x1bb896,null));};
\ No newline at end of file
index 47b542b..7bc3003 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44ff=['../../config/environment','define','license','util','../../config/logger','api','rimraf'];(function(_0x4a5173,_0x171d6f){var _0x233f9f=function(_0x33496a){while(--_0x33496a){_0x4a5173['push'](_0x4a5173['shift']());}};_0x233f9f(++_0x171d6f);}(_0x44ff,0x1c3));var _0xf44f=function(_0x2d35b5,_0x520c90){_0x2d35b5=_0x2d35b5-0x0;var _0x333e77=_0x44ff[_0x2d35b5];return _0x333e77;};'use strict';var _=require('lodash');var util=require(_0xf44f('0x0'));var logger=require(_0xf44f('0x1'))(_0xf44f('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(_0xf44f('0x3'));var config=require(_0xf44f('0x4'));var attributes=require('./license.attributes');module['exports']=function(_0x1e3227,_0x2ba2a5){return _0x1e3227[_0xf44f('0x5')]('License',attributes,{'tableName':_0xf44f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x743e=['moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define','License','license','util'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0x743e,0x133));var _0xe743=function(_0x3c75cc,_0x524dda){_0x3c75cc=_0x3c75cc-0x0;var _0xa4df4c=_0x743e[_0x3c75cc];return _0xa4df4c;};'use strict';var _=require('lodash');var util=require(_0xe743('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe743('0x1'));var BPromise=require(_0xe743('0x2'));var rp=require(_0xe743('0x3'));var fs=require('fs');var path=require(_0xe743('0x4'));var rimraf=require('rimraf');var config=require(_0xe743('0x5'));var attributes=require(_0xe743('0x6'));module[_0xe743('0x7')]=function(_0x6b089c,_0x33dfa7){return _0x6b089c[_0xe743('0x8')](_0xe743('0x9'),attributes,{'tableName':_0xe743('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7294804..583d875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c71=['then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','error','code','message','License,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http'];(function(_0x4474c7,_0x10f92e){var _0x5030ea=function(_0x128a44){while(--_0x128a44){_0x4474c7['push'](_0x4474c7['shift']());}};_0x5030ea(++_0x10f92e);}(_0x8c71,0x105));var _0x18c7=function(_0x1640c1,_0x4d6e1c){_0x1640c1=_0x1640c1-0x0;var _0x436883=_0x8c71[_0x1640c1];return _0x436883;};'use strict';var _=require(_0x18c7('0x0'));var util=require(_0x18c7('0x1'));var moment=require(_0x18c7('0x2'));var BPromise=require(_0x18c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18c7('0x4'));var db=require(_0x18c7('0x5'))['db'];var utils=require(_0x18c7('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x18c7('0x7')][_0x18c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ed2ae,_0x224deb,_0x1363ab){return new BPromise(function(_0x4a4c5a,_0x450c28){return client['request'](_0x1ed2ae,_0x1363ab)[_0x18c7('0x9')](function(_0x77b13c){logger[_0x18c7('0xa')]('License,\x20%s,\x20%s',_0x224deb,_0x18c7('0xb'));logger['debug'](_0x18c7('0xc'),_0x224deb,'request\x20sent',JSON['stringify'](_0x77b13c));if(_0x77b13c['error']){if(_0x77b13c[_0x18c7('0xd')][_0x18c7('0xe')]===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x224deb,_0x77b13c[_0x18c7('0xd')][_0x18c7('0xf')]);return _0x450c28(_0x77b13c[_0x18c7('0xd')][_0x18c7('0xf')]);}logger['error'](_0x18c7('0x10'),_0x224deb,_0x77b13c[_0x18c7('0xd')][_0x18c7('0xf')]);return _0x4a4c5a(_0x77b13c[_0x18c7('0xd')][_0x18c7('0xf')]);}else{logger[_0x18c7('0xa')](_0x18c7('0x10'),_0x224deb,_0x18c7('0xb'));_0x4a4c5a(_0x77b13c['result']['message']);}})[_0x18c7('0x11')](function(_0x2e0872){logger[_0x18c7('0xd')](_0x18c7('0x10'),_0x224deb,_0x2e0872);_0x450c28(_0x2e0872);});});}
\ No newline at end of file
+var _0x2115=['request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','License,\x20%s,\x20%s'];(function(_0x4f896b,_0x4c1943){var _0x147657=function(_0x427f40){while(--_0x427f40){_0x4f896b['push'](_0x4f896b['shift']());}};_0x147657(++_0x4c1943);}(_0x2115,0x1ed));var _0x5211=function(_0x3ab928,_0x2b990b){_0x3ab928=_0x3ab928-0x0;var _0xf47692=_0x2115[_0x3ab928];return _0xf47692;};'use strict';var _=require(_0x5211('0x0'));var util=require('util');var moment=require(_0x5211('0x1'));var BPromise=require(_0x5211('0x2'));var rs=require(_0x5211('0x3'));var fs=require('fs');var Redis=require(_0x5211('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5211('0x5'));var logger=require(_0x5211('0x6'))('rpc');var config=require(_0x5211('0x7'));var jayson=require(_0x5211('0x8'));var client=jayson[_0x5211('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5af3ba,_0x2f3005,_0x3d11b0){return new BPromise(function(_0x4b6d01,_0x2de9fb){return client[_0x5211('0xa')](_0x5af3ba,_0x3d11b0)[_0x5211('0xb')](function(_0x4fe5f8){logger['info'](_0x5211('0xc'),_0x2f3005,_0x5211('0xd'));logger['debug'](_0x5211('0xe'),_0x2f3005,'request\x20sent',JSON[_0x5211('0xf')](_0x4fe5f8));if(_0x4fe5f8[_0x5211('0x10')]){if(_0x4fe5f8[_0x5211('0x10')][_0x5211('0x11')]===0x1f4){logger[_0x5211('0x10')](_0x5211('0xc'),_0x2f3005,_0x4fe5f8[_0x5211('0x10')][_0x5211('0x12')]);return _0x2de9fb(_0x4fe5f8[_0x5211('0x10')][_0x5211('0x12')]);}logger[_0x5211('0x10')]('License,\x20%s,\x20%s',_0x2f3005,_0x4fe5f8['error']['message']);return _0x4b6d01(_0x4fe5f8[_0x5211('0x10')][_0x5211('0x12')]);}else{logger[_0x5211('0x13')](_0x5211('0xc'),_0x2f3005,_0x5211('0xd'));_0x4b6d01(_0x4fe5f8[_0x5211('0x14')]['message']);}})[_0x5211('0x15')](function(_0x465ef0){logger[_0x5211('0x10')](_0x5211('0xc'),_0x2f3005,_0x465ef0);_0x2de9fb(_0x465ef0);});});}
\ No newline at end of file
index 4550d84..9b8c501 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa05=['getAnswers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x1caf65,_0x5c145b){var _0x43b179=function(_0x2ab8be){while(--_0x2ab8be){_0x1caf65['push'](_0x1caf65['shift']());}};_0x43b179(++_0x5c145b);}(_0xfa05,0xd6));var _0x5fa0=function(_0x53e80b,_0x362bf5){_0x53e80b=_0x53e80b-0x0;var _0x54c3ae=_0xfa05[_0x53e80b];return _0x54c3ae;};'use strict';var multer=require(_0x5fa0('0x0'));var util=require(_0x5fa0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5fa0('0x2'));var router=express[_0x5fa0('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5fa0('0x4'));var interaction=require(_0x5fa0('0x5'));var config=require('../../config/environment');var controller=require(_0x5fa0('0x6'));router[_0x5fa0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5fa0('0x7')](_0x5fa0('0x8'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0xa')]);router[_0x5fa0('0x7')](_0x5fa0('0xb'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0xc')]);router['get'](_0x5fa0('0xd'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0xe')]);router[_0x5fa0('0x7')](_0x5fa0('0xf'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x10')]);router[_0x5fa0('0x7')]('/:id/in_servers',auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x11')]);router[_0x5fa0('0x7')](_0x5fa0('0x12'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x13')]);router[_0x5fa0('0x7')]('/:id/interactions',auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x14')]);router[_0x5fa0('0x7')](_0x5fa0('0x15'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x16')]);router[_0x5fa0('0x7')](_0x5fa0('0x17'),auth['isAuthenticated'](),controller[_0x5fa0('0x18')]);router[_0x5fa0('0x7')]('/:id/verify',auth['isAuthenticated'](),controller['verifySmtp']);router[_0x5fa0('0x7')](_0x5fa0('0x19'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x1a')]);router[_0x5fa0('0x1b')](_0x5fa0('0xd'),auth['isAuthenticated'](),controller[_0x5fa0('0x1c')]);router[_0x5fa0('0x1b')](_0x5fa0('0xf'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5fa0('0x1e')]);router['post'](_0x5fa0('0x1f'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x20')]);router[_0x5fa0('0x1b')](_0x5fa0('0x12'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x21')]);router[_0x5fa0('0x1b')]('/:id/interactions',auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x22')]);router['post']('/:id/applications',auth[_0x5fa0('0x9')](),controller['addApplications']);router['post'](_0x5fa0('0x23'),auth[_0x5fa0('0x9')](),controller['send']);router[_0x5fa0('0x1b')]('/:id/users',auth['isAuthenticated'](),controller[_0x5fa0('0x24')]);router[_0x5fa0('0x25')](_0x5fa0('0xb'),auth[_0x5fa0('0x9')](),controller['update']);router[_0x5fa0('0x26')]('/:id/dispositions',auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x27')]);router[_0x5fa0('0x26')](_0x5fa0('0xf'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x28')]);router[_0x5fa0('0x26')](_0x5fa0('0x1f'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x29')]);router['delete'](_0x5fa0('0x12'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x2a')]);router[_0x5fa0('0x26')](_0x5fa0('0xb'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x2b')]);router[_0x5fa0('0x26')](_0x5fa0('0x19'),auth[_0x5fa0('0x9')](),controller[_0x5fa0('0x2c')]);module[_0x5fa0('0x2d')]=router;
\ No newline at end of file
+var _0xe1da=['/:id/dispositions','addDisposition','addAnswer','addSmtp','addInteraction','/:id/applications','addApplications','send','/:id','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post'];(function(_0xf0b8a7,_0x52441b){var _0x1faf2d=function(_0x2d8339){while(--_0x2d8339){_0xf0b8a7['push'](_0xf0b8a7['shift']());}};_0x1faf2d(++_0x52441b);}(_0xe1da,0x1af));var _0xae1d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe1da[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0xae1d('0x0'));var path=require(_0xae1d('0x1'));var timeout=require(_0xae1d('0x2'));var express=require(_0xae1d('0x3'));var router=express[_0xae1d('0x4')]();var fs_extra=require(_0xae1d('0x5'));var auth=require(_0xae1d('0x6'));var interaction=require(_0xae1d('0x7'));var config=require(_0xae1d('0x8'));var controller=require(_0xae1d('0x9'));router[_0xae1d('0xa')]('/',auth[_0xae1d('0xb')](),controller[_0xae1d('0xc')]);router[_0xae1d('0xa')]('/describe',auth[_0xae1d('0xb')](),controller[_0xae1d('0xd')]);router['get']('/:id',auth[_0xae1d('0xb')](),controller[_0xae1d('0xe')]);router[_0xae1d('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xae1d('0xf')]);router[_0xae1d('0xa')](_0xae1d('0x10'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x11')]);router[_0xae1d('0xa')](_0xae1d('0x12'),auth[_0xae1d('0xb')](),controller['getImap']);router[_0xae1d('0xa')](_0xae1d('0x13'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x14')]);router[_0xae1d('0xa')](_0xae1d('0x15'),auth[_0xae1d('0xb')](),controller['getInteractions']);router['get']('/:id/applications',auth[_0xae1d('0xb')](),controller['getApplications']);router['get'](_0xae1d('0x16'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x17')]);router[_0xae1d('0xa')](_0xae1d('0x18'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x19')]);router[_0xae1d('0xa')](_0xae1d('0x1a'),auth['isAuthenticated'](),controller[_0xae1d('0x1b')]);router[_0xae1d('0x1c')](_0xae1d('0x1d'),auth['isAuthenticated'](),controller[_0xae1d('0x1e')]);router[_0xae1d('0x1c')](_0xae1d('0x10'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x1f')]);router[_0xae1d('0x1c')]('/',auth[_0xae1d('0xb')](),controller['create']);router[_0xae1d('0x1c')](_0xae1d('0x12'),auth[_0xae1d('0xb')](),controller['addImap']);router[_0xae1d('0x1c')](_0xae1d('0x13'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x20')]);router[_0xae1d('0x1c')](_0xae1d('0x15'),auth['isAuthenticated'](),controller[_0xae1d('0x21')]);router[_0xae1d('0x1c')](_0xae1d('0x22'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x23')]);router[_0xae1d('0x1c')]('/:id/send',auth[_0xae1d('0xb')](),controller[_0xae1d('0x24')]);router[_0xae1d('0x1c')](_0xae1d('0x1a'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xae1d('0x25'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x26')]);router['delete'](_0xae1d('0x1d'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x27')]);router[_0xae1d('0x28')](_0xae1d('0x10'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x29')]);router[_0xae1d('0x28')](_0xae1d('0x12'),auth[_0xae1d('0xb')](),controller[_0xae1d('0x2a')]);router['delete'](_0xae1d('0x13'),auth['isAuthenticated'](),controller[_0xae1d('0x2b')]);router['delete'](_0xae1d('0x25'),auth['isAuthenticated'](),controller[_0xae1d('0x2c')]);router['delete']('/:id/users',auth[_0xae1d('0xb')](),controller[_0xae1d('0x2d')]);module['exports']=router;
\ No newline at end of file
index 16b23b0..3be0094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec46=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}'];(function(_0x49cde3,_0x44a2c1){var _0x3cbc31=function(_0x7d1b01){while(--_0x7d1b01){_0x49cde3['push'](_0x49cde3['shift']());}};_0x3cbc31(++_0x44a2c1);}(_0xec46,0x19c));var _0x6ec4=function(_0x4ff0b3,_0x34cc15){_0x4ff0b3=_0x4ff0b3-0x0;var _0x430487=_0xec46[_0x4ff0b3];return _0x430487;};'use strict';var Sequelize=require(_0x6ec4('0x0'));module[_0x6ec4('0x1')]={'description':{'type':Sequelize[_0x6ec4('0x2')]},'name':{'type':Sequelize[_0x6ec4('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x6ec4('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x6ec4('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x6ec4('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x6ec4('0x2')],'allowNull':![],'defaultValue':_0x6ec4('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x6ec4('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6ec4('0x7');}},'notificationSound':{'type':Sequelize[_0x6ec4('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6ec4('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6ec4('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6ec4('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6ec4('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6ec4('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6ec4('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6ec4('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x6ec4('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x6ec4('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4c6734){if(!_0x4c6734)this[_0x6ec4('0xa')](_0x6ec4('0xb'),null);this[_0x6ec4('0xa')]('mandatoryDisposition',_0x4c6734);}}};
\ No newline at end of file
+var _0xec39=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xec39,0x19f));var _0x9ec3=function(_0xef2109,_0x3d70a0){_0xef2109=_0xef2109-0x0;var _0x21c666=_0xec39[_0xef2109];return _0x21c666;};'use strict';var Sequelize=require(_0x9ec3('0x0'));module[_0x9ec3('0x1')]={'description':{'type':Sequelize[_0x9ec3('0x2')]},'name':{'type':Sequelize[_0x9ec3('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x9ec3('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9ec3('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9ec3('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x9ec3('0x4')]},'markAsUnread':{'type':Sequelize[_0x9ec3('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9ec3('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9ec3('0x4')],'defaultValue':function(){return _0x9ec3('0x5');}},'notificationSound':{'type':Sequelize[_0x9ec3('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9ec3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9ec3('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9ec3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9ec3('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9ec3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9ec3('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x9ec3('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9ec3('0x8'),'set':function(_0xaa1307){if(!_0xaa1307)this[_0x9ec3('0x9')](_0x9ec3('0xa'),null);this[_0x9ec3('0x9')](_0x9ec3('0xb'),_0xaa1307);}}};
\ No newline at end of file
index 5b56431..f1cfaf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb05=['SendMail','sendMail','List\x20not\x20found','defaults','ListId','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','desk.js','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','MailAccounts','UserProfileResource','name','send','index','Imap','MailServerOut','Smtp','mandatoryDispositionPause','rawAttributes','type','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','MailAccount','includeAll','include','findAll','rows','catch','show','params','MailServerIn','Pause','keys','options','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','key','email','isNil','active','description','cservice','cauthentication','user','pass','cpassword','host','port','service','cuser','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','format','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','authentication','auth','secure'];(function(_0x3124cf,_0x27d439){var _0x2db27e=function(_0x476d1a){while(--_0x476d1a){_0x3124cf['push'](_0x3124cf['shift']());}};_0x2db27e(++_0x27d439);}(_0xfb05,0xd9));var _0x5fb0=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfb05[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0x5fb0('0x0'));var rimraf=require(_0x5fb0('0x1'));var zipdir=require(_0x5fb0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5fb0('0x3'));var moment=require(_0x5fb0('0x4'));var BPromise=require(_0x5fb0('0x5'));var Mustache=require(_0x5fb0('0x6'));var util=require(_0x5fb0('0x7'));var path=require(_0x5fb0('0x8'));var sox=require(_0x5fb0('0x9'));var csv=require(_0x5fb0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5fb0('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5fb0('0xc'));var toCsv=require(_0x5fb0('0xa'));var querystring=require('querystring');var Papa=require(_0x5fb0('0xd'));var htmlToText=require(_0x5fb0('0xe'));var juice=require(_0x5fb0('0xf'));var Redis=require(_0x5fb0('0x10'));var authService=require(_0x5fb0('0x11'));var qs=require(_0x5fb0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5fb0('0x13'));var logger=require(_0x5fb0('0x14'))(_0x5fb0('0x15'));var utils=require(_0x5fb0('0x16'));var config=require(_0x5fb0('0x17'));var licenseUtil=require(_0x5fb0('0x18'));var db=require('../../mysqldb')['db'];config[_0x5fb0('0x19')]=_['defaults'](config['redis'],{'host':_0x5fb0('0x1a'),'port':0x18eb});var socket=require(_0x5fb0('0x1b'))(new Redis(config[_0x5fb0('0x19')]));require(_0x5fb0('0x1c'))['register'](socket);var jayson=require(_0x5fb0('0x1d'));var client=jayson[_0x5fb0('0x1e')][_0x5fb0('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x168cb9,_0x57c39d,_0x2d9af6,_0x154465){return new BPromise(function(_0x5d83d9,_0x5e063c){var _0x55688c=_0x154465||client;return _0x55688c[_0x5fb0('0x20')](_0x168cb9,_0x2d9af6)['then'](function(_0xeb235b){logger[_0x5fb0('0x21')](_0x5fb0('0x22'),_0x57c39d,_0x5fb0('0x23'));logger[_0x5fb0('0x24')](_0x5fb0('0x25'),_0x57c39d,_0x5fb0('0x23'),JSON['stringify'](_0xeb235b));if(_0xeb235b[_0x5fb0('0x26')]){if(_0xeb235b[_0x5fb0('0x26')][_0x5fb0('0x27')]===0x1f4){logger[_0x5fb0('0x26')](_0x5fb0('0x22'),_0x57c39d,_0xeb235b['error'][_0x5fb0('0x28')]);return _0x5e063c(_0xeb235b[_0x5fb0('0x26')][_0x5fb0('0x28')]);}logger[_0x5fb0('0x26')]('MailAccount,\x20%s,\x20%s',_0x57c39d,_0xeb235b[_0x5fb0('0x26')][_0x5fb0('0x28')]);return _0x5d83d9(_0xeb235b[_0x5fb0('0x26')]['message']);}else{logger[_0x5fb0('0x21')](_0x5fb0('0x22'),_0x57c39d,_0x5fb0('0x23'));_0x5d83d9(_0xeb235b[_0x5fb0('0x29')][_0x5fb0('0x28')]);}})['catch'](function(_0x40dfbf){logger[_0x5fb0('0x26')](_0x5fb0('0x22'),_0x57c39d,_0x40dfbf);_0x5e063c(_0x40dfbf);});});}function respondWithStatusCode(_0x524a4a,_0x3b8b7a){_0x3b8b7a=_0x3b8b7a||0xcc;return function(_0x4c3a39){if(_0x4c3a39){return _0x524a4a[_0x5fb0('0x2a')](_0x3b8b7a);}return _0x524a4a[_0x5fb0('0x2b')](_0x3b8b7a)[_0x5fb0('0x2c')]();};}function respondWithResult(_0xef3830,_0x21617f){_0x21617f=_0x21617f||0xc8;return function(_0x51db3b){if(_0x51db3b){return _0xef3830[_0x5fb0('0x2b')](_0x21617f)[_0x5fb0('0x2d')](_0x51db3b);}};}function respondWithFilteredResult(_0x1aa55c,_0xac2b8e){return function(_0x5437f0){if(_0x5437f0){var _0x4415b9=typeof _0xac2b8e[_0x5fb0('0x2e')]===_0x5fb0('0x2f')&&typeof _0xac2b8e[_0x5fb0('0x30')]===_0x5fb0('0x2f');var _0x14fc5a=_0x5437f0[_0x5fb0('0x31')];var _0xef8eb7=_0x4415b9?0x0:_0xac2b8e['offset'];var _0x41c0fd=_0x4415b9?_0x5437f0[_0x5fb0('0x31')]:_0xac2b8e[_0x5fb0('0x2e')]+_0xac2b8e['limit'];var _0xa76f6b;if(_0x41c0fd>=_0x14fc5a){_0x41c0fd=_0x14fc5a;_0xa76f6b=0xc8;}else{_0xa76f6b=0xce;}_0x1aa55c['status'](_0xa76f6b);return _0x1aa55c[_0x5fb0('0x32')](_0x5fb0('0x33'),_0xef8eb7+'-'+_0x41c0fd+'/'+_0x14fc5a)[_0x5fb0('0x2d')](_0x5437f0);}return null;};}function patchUpdates(_0x5a2ef7){return function(_0x190aa3){try{jsonpatch[_0x5fb0('0x34')](_0x190aa3,_0x5a2ef7,!![]);}catch(_0x17e921){return BPromise['reject'](_0x17e921);}return _0x190aa3[_0x5fb0('0x35')]();};}function saveUpdates(_0x1ecc53,_0x7a3f11){return function(_0x3aa6d0){if(_0x3aa6d0){return _0x3aa6d0[_0x5fb0('0x36')](_0x1ecc53)[_0x5fb0('0x37')](function(_0x2f655e){return _0x2f655e;});}return null;};}function removeEntity(_0x2a436b,_0xeb4ade){return function(_0xe0997a){if(_0xe0997a){return _0xe0997a[_0x5fb0('0x38')]()[_0x5fb0('0x37')](function(){var _0x38f47f=_0xe0997a[_0x5fb0('0x39')]({'plain':!![]});var _0x268336=_0x5fb0('0x3a');return db[_0x5fb0('0x3b')][_0x5fb0('0x38')]({'where':{'type':_0x268336,'resourceId':_0x38f47f['id']}})[_0x5fb0('0x37')](function(){return _0xe0997a;});})[_0x5fb0('0x37')](function(){_0x2a436b[_0x5fb0('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30bd73,_0x3c011a){return function(_0x52b4e4){if(!_0x52b4e4){_0x30bd73[_0x5fb0('0x2a')](0x194);}return _0x52b4e4;};}function handleError(_0x589f57,_0x39c53e){_0x39c53e=_0x39c53e||0x1f4;return function(_0x43c7b9){logger[_0x5fb0('0x26')](_0x43c7b9['stack']);if(_0x43c7b9[_0x5fb0('0x3c')]){delete _0x43c7b9['name'];}_0x589f57[_0x5fb0('0x2b')](_0x39c53e)[_0x5fb0('0x3d')](_0x43c7b9);};}exports[_0x5fb0('0x3e')]=function(_0x63efab,_0x563e95){var _0x5d10b0={'include':[{'model':db['MailServerIn'],'as':_0x5fb0('0x3f')},{'model':db[_0x5fb0('0x40')],'as':_0x5fb0('0x41')},{'model':db['Pause'],'as':_0x5fb0('0x42')}]},_0x1612a4={},_0x5d035b={'count':0x0,'rows':[]};var _0x2f18cd=_['map'](db['MailAccount'][_0x5fb0('0x43')],function(_0x44473f){return{'name':_0x44473f['fieldName'],'type':_0x44473f[_0x5fb0('0x44')]['key']};});_0x1612a4[_0x5fb0('0x45')]=_[_0x5fb0('0x46')](_0x2f18cd,_0x5fb0('0x3c'));_0x1612a4[_0x5fb0('0x47')]=_['keys'](_0x63efab[_0x5fb0('0x47')]);_0x1612a4[_0x5fb0('0x48')]=_['intersection'](_0x1612a4['model'],_0x1612a4[_0x5fb0('0x47')]);_0x5d10b0[_0x5fb0('0x49')]=_[_0x5fb0('0x4a')](_0x1612a4['model'],qs[_0x5fb0('0x4b')](_0x63efab[_0x5fb0('0x47')][_0x5fb0('0x4b')]));_0x5d10b0['attributes']=_0x5d10b0['attributes'][_0x5fb0('0x4c')]?_0x5d10b0[_0x5fb0('0x49')]:_0x1612a4[_0x5fb0('0x45')];if(!_0x63efab[_0x5fb0('0x47')][_0x5fb0('0x4d')](_0x5fb0('0x4e'))){_0x5d10b0['limit']=qs[_0x5fb0('0x30')](_0x63efab[_0x5fb0('0x47')][_0x5fb0('0x30')]);_0x5d10b0[_0x5fb0('0x2e')]=qs[_0x5fb0('0x2e')](_0x63efab[_0x5fb0('0x47')][_0x5fb0('0x2e')]);}_0x5d10b0[_0x5fb0('0x4f')]=qs[_0x5fb0('0x50')](_0x63efab[_0x5fb0('0x47')]['sort']);_0x5d10b0['where']=qs['filters'](_[_0x5fb0('0x51')](_0x63efab[_0x5fb0('0x47')],_0x1612a4[_0x5fb0('0x48')]),_0x2f18cd);if(_0x63efab[_0x5fb0('0x47')][_0x5fb0('0x52')]){_0x5d10b0[_0x5fb0('0x53')]=_[_0x5fb0('0x54')](_0x5d10b0[_0x5fb0('0x53')],{'$or':_[_0x5fb0('0x46')](_0x2f18cd,function(_0x4a0c60){if(_0x4a0c60[_0x5fb0('0x44')]!=='VIRTUAL'){var _0x14c450={};_0x14c450[_0x4a0c60['name']]={'$like':'%'+_0x63efab[_0x5fb0('0x47')]['filter']+'%'};return _0x14c450;}})});}_0x5d10b0=_[_0x5fb0('0x54')]({},_0x5d10b0,_0x63efab['options']);var _0x616dfa={'where':_0x5d10b0[_0x5fb0('0x53')]};return db[_0x5fb0('0x55')][_0x5fb0('0x31')](_0x616dfa)[_0x5fb0('0x37')](function(_0x570845){_0x5d035b[_0x5fb0('0x31')]=_0x570845;if(_0x63efab[_0x5fb0('0x47')][_0x5fb0('0x56')]){_0x5d10b0[_0x5fb0('0x57')]=[{'all':!![]}];}return db['MailAccount'][_0x5fb0('0x58')](_0x5d10b0);})[_0x5fb0('0x37')](function(_0x4e4188){_0x5d035b[_0x5fb0('0x59')]=_0x4e4188;return _0x5d035b;})[_0x5fb0('0x37')](respondWithFilteredResult(_0x563e95,_0x5d10b0))[_0x5fb0('0x5a')](handleError(_0x563e95,null));};exports[_0x5fb0('0x5b')]=function(_0x1983c7,_0x117eee){var _0x49c750={'raw':![],'where':{'id':_0x1983c7[_0x5fb0('0x5c')]['id']},'include':[{'model':db[_0x5fb0('0x5d')],'as':'Imap'},{'model':db[_0x5fb0('0x40')],'as':'Smtp'},{'model':db[_0x5fb0('0x5e')],'as':_0x5fb0('0x42')}]},_0x1bb3d1={};_0x1bb3d1[_0x5fb0('0x45')]=_[_0x5fb0('0x5f')](db[_0x5fb0('0x55')][_0x5fb0('0x43')]);_0x1bb3d1[_0x5fb0('0x47')]=_['keys'](_0x1983c7[_0x5fb0('0x47')]);_0x1bb3d1['filters']=_[_0x5fb0('0x4a')](_0x1bb3d1[_0x5fb0('0x45')],_0x1bb3d1[_0x5fb0('0x47')]);_0x49c750[_0x5fb0('0x49')]=_[_0x5fb0('0x4a')](_0x1bb3d1[_0x5fb0('0x45')],qs['fields'](_0x1983c7[_0x5fb0('0x47')][_0x5fb0('0x4b')]));_0x49c750[_0x5fb0('0x49')]=_0x49c750[_0x5fb0('0x49')][_0x5fb0('0x4c')]?_0x49c750[_0x5fb0('0x49')]:_0x1bb3d1[_0x5fb0('0x45')];if(_0x1983c7[_0x5fb0('0x47')]['includeAll']){_0x49c750['include']=[{'all':!![]}];}_0x49c750=_['merge']({},_0x49c750,_0x1983c7[_0x5fb0('0x60')]);return db[_0x5fb0('0x55')][_0x5fb0('0x61')](_0x49c750)[_0x5fb0('0x37')](handleEntityNotFound(_0x117eee,null))['then'](respondWithResult(_0x117eee,null))['catch'](handleError(_0x117eee,null));};exports['update']=function(_0x4af3e3,_0x9b7b63){if(_0x4af3e3[_0x5fb0('0x62')]['id']){delete _0x4af3e3[_0x5fb0('0x62')]['id'];}return db[_0x5fb0('0x55')][_0x5fb0('0x61')]({'where':{'id':_0x4af3e3[_0x5fb0('0x5c')]['id']},'include':[{'model':db[_0x5fb0('0x5d')],'as':_0x5fb0('0x3f')},{'model':db[_0x5fb0('0x40')],'as':_0x5fb0('0x41')},{'model':db['Pause'],'as':_0x5fb0('0x42')}]})[_0x5fb0('0x37')](handleEntityNotFound(_0x9b7b63,null))['then'](saveUpdates(_0x4af3e3[_0x5fb0('0x62')],null))[_0x5fb0('0x37')](function(_0x58452a){if(_0x58452a&&_0x4af3e3[_0x5fb0('0x62')][_0x5fb0('0x3f')]){return db[_0x5fb0('0x5d')][_0x5fb0('0x36')](_0x4af3e3[_0x5fb0('0x62')]['Imap'],{'where':{'MailAccountId':_0x58452a['id']}})[_0x5fb0('0x37')](function(){return _0x58452a;});}return _0x58452a;})[_0x5fb0('0x37')](function(_0x5e2968){if(_0x5e2968&&_0x4af3e3[_0x5fb0('0x62')]['Smtp']){return db[_0x5fb0('0x40')][_0x5fb0('0x36')](_0x4af3e3['body'][_0x5fb0('0x41')],{'where':{'MailAccountId':_0x5e2968['id']}})[_0x5fb0('0x37')](function(){return _0x5e2968;});}return _0x5e2968;})[_0x5fb0('0x37')](respondWithResult(_0x9b7b63,null))[_0x5fb0('0x5a')](handleError(_0x9b7b63,null));};exports['describe']=function(_0x555329,_0xb03af4){return db[_0x5fb0('0x55')][_0x5fb0('0x63')]()[_0x5fb0('0x37')](respondWithResult(_0xb03af4,null))[_0x5fb0('0x5a')](handleError(_0xb03af4,null));};exports[_0x5fb0('0x64')]=function(_0x30cb9e,_0x2db3e5,_0x37b869){if(_0x30cb9e[_0x5fb0('0x62')]['id']){delete _0x30cb9e[_0x5fb0('0x62')]['id'];}return db[_0x5fb0('0x55')][_0x5fb0('0x61')]({'where':{'id':_0x30cb9e[_0x5fb0('0x5c')]['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x2db3e5,null))[_0x5fb0('0x37')](function(_0x2351a3){if(_0x2351a3){_0x30cb9e[_0x5fb0('0x62')][_0x5fb0('0x65')]=_0x2351a3['id'];return db[_0x5fb0('0x66')][_0x5fb0('0x67')](_0x30cb9e['body']);}})[_0x5fb0('0x37')](respondWithResult(_0x2db3e5,null))['catch'](handleError(_0x2db3e5,null));};exports[_0x5fb0('0x68')]=function(_0xc133fd,_0x47c8b7,_0x4dd781){var _0x23d228={'raw':![],'where':{}};var _0x2e7981={};var _0x3f4f91={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0xc133fd[_0x5fb0('0x5c')]['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x47c8b7,null))[_0x5fb0('0x37')](function(_0x35c2ac){if(_0x35c2ac){_0x2e7981[_0x5fb0('0x45')]=_[_0x5fb0('0x5f')](db[_0x5fb0('0x66')][_0x5fb0('0x43')]);_0x2e7981['query']=_[_0x5fb0('0x5f')](_0xc133fd[_0x5fb0('0x47')]);_0x2e7981[_0x5fb0('0x48')]=_[_0x5fb0('0x4a')](_0x2e7981[_0x5fb0('0x45')],_0x2e7981['query']);_0x23d228[_0x5fb0('0x49')]=_[_0x5fb0('0x4a')](_0x2e7981[_0x5fb0('0x45')],qs[_0x5fb0('0x4b')](_0xc133fd['query'][_0x5fb0('0x4b')]));_0x23d228['attributes']=_0x23d228[_0x5fb0('0x49')][_0x5fb0('0x4c')]?_0x23d228[_0x5fb0('0x49')]:_0x2e7981[_0x5fb0('0x45')];if(!_0xc133fd[_0x5fb0('0x47')][_0x5fb0('0x4d')]('nolimit')){_0x23d228['limit']=qs[_0x5fb0('0x30')](_0xc133fd['query']['limit']);_0x23d228[_0x5fb0('0x2e')]=qs['offset'](_0xc133fd[_0x5fb0('0x47')][_0x5fb0('0x2e')]);}_0x23d228[_0x5fb0('0x4f')]=qs[_0x5fb0('0x50')](_0xc133fd[_0x5fb0('0x47')]['sort']);_0x23d228['where']=qs['filters'](_[_0x5fb0('0x51')](_0xc133fd['query'],_0x2e7981['filters']));_0x23d228[_0x5fb0('0x53')]['MailAccountId']=_0x35c2ac['id'];if(_0xc133fd[_0x5fb0('0x47')][_0x5fb0('0x52')]){_0x23d228['where']=_[_0x5fb0('0x54')](_0x23d228[_0x5fb0('0x53')],{'$or':_[_0x5fb0('0x46')](_0x23d228[_0x5fb0('0x49')],function(_0x152a4a){var _0x586b61={};_0x586b61[_0x152a4a]={'$like':'%'+_0xc133fd['query'][_0x5fb0('0x52')]+'%'};return _0x586b61;})});}_0x23d228=_[_0x5fb0('0x54')]({},_0x23d228,_0xc133fd[_0x5fb0('0x60')]);return db['Disposition'][_0x5fb0('0x31')]({'where':_0x23d228[_0x5fb0('0x53')]})[_0x5fb0('0x37')](function(_0x5cb0ec){_0x3f4f91['count']=_0x5cb0ec;if(_0xc133fd[_0x5fb0('0x47')][_0x5fb0('0x56')]){_0x23d228['include']=[{'all':!![]}];}return db['Disposition'][_0x5fb0('0x58')](_0x23d228);})[_0x5fb0('0x37')](function(_0xfb97a1){_0x3f4f91[_0x5fb0('0x59')]=_0xfb97a1;return _0x3f4f91;});}})['then'](respondWithFilteredResult(_0x47c8b7,_0x23d228))['catch'](handleError(_0x47c8b7,null));};exports[_0x5fb0('0x69')]=function(_0x1e8ca6,_0xe6b2b7,_0x1dddcf){return db['MailAccount'][_0x5fb0('0x61')]({'where':{'id':_0x1e8ca6[_0x5fb0('0x5c')]['id']}})['then'](handleEntityNotFound(_0xe6b2b7,null))[_0x5fb0('0x37')](function(_0x3f1389){if(_0x3f1389){return _0x3f1389[_0x5fb0('0x69')](_0x1e8ca6[_0x5fb0('0x47')][_0x5fb0('0x6a')]);}})[_0x5fb0('0x37')](respondWithStatusCode(_0xe6b2b7,null))[_0x5fb0('0x5a')](handleError(_0xe6b2b7,null));};exports[_0x5fb0('0x6b')]=function(_0x5e9b3c,_0x3a97a1,_0xece952){if(_0x5e9b3c[_0x5fb0('0x62')]['id']){delete _0x5e9b3c[_0x5fb0('0x62')]['id'];}return db['MailAccount'][_0x5fb0('0x61')]({'where':{'id':_0x5e9b3c[_0x5fb0('0x5c')]['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x3a97a1,null))[_0x5fb0('0x37')](function(_0x3f037d){if(_0x3f037d){_0x5e9b3c[_0x5fb0('0x62')][_0x5fb0('0x65')]=_0x3f037d['id'];return db['CannedAnswer']['create'](_0x5e9b3c[_0x5fb0('0x62')]);}})[_0x5fb0('0x37')](respondWithResult(_0x3a97a1,null))['catch'](handleError(_0x3a97a1,null));};exports['getAnswers']=function(_0x25bf86,_0x1bf8d3,_0x5b4cc0){var _0x3c93af={'raw':![],'where':{}};var _0x466c94={};var _0x490a99={'count':0x0,'rows':[]};return db[_0x5fb0('0x55')][_0x5fb0('0x6c')]({'where':{'id':_0x25bf86['params']['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x1bf8d3,null))[_0x5fb0('0x37')](function(_0x2a8987){if(_0x2a8987){_0x466c94['model']=_['keys'](db[_0x5fb0('0x6d')][_0x5fb0('0x43')]);_0x466c94['query']=_[_0x5fb0('0x5f')](_0x25bf86[_0x5fb0('0x47')]);_0x466c94['filters']=_[_0x5fb0('0x4a')](_0x466c94['model'],_0x466c94[_0x5fb0('0x47')]);_0x3c93af[_0x5fb0('0x49')]=_[_0x5fb0('0x4a')](_0x466c94[_0x5fb0('0x45')],qs[_0x5fb0('0x4b')](_0x25bf86[_0x5fb0('0x47')][_0x5fb0('0x4b')]));_0x3c93af[_0x5fb0('0x49')]=_0x3c93af[_0x5fb0('0x49')]['length']?_0x3c93af['attributes']:_0x466c94[_0x5fb0('0x45')];if(!_0x25bf86[_0x5fb0('0x47')]['hasOwnProperty']('nolimit')){_0x3c93af[_0x5fb0('0x30')]=qs['limit'](_0x25bf86[_0x5fb0('0x47')][_0x5fb0('0x30')]);_0x3c93af[_0x5fb0('0x2e')]=qs['offset'](_0x25bf86[_0x5fb0('0x47')][_0x5fb0('0x2e')]);}_0x3c93af[_0x5fb0('0x4f')]=qs['sort'](_0x25bf86[_0x5fb0('0x47')][_0x5fb0('0x50')]);_0x3c93af[_0x5fb0('0x53')]=qs['filters'](_[_0x5fb0('0x51')](_0x25bf86[_0x5fb0('0x47')],_0x466c94[_0x5fb0('0x48')]));_0x3c93af[_0x5fb0('0x53')][_0x5fb0('0x65')]=_0x2a8987['id'];if(_0x25bf86['query'][_0x5fb0('0x52')]){_0x3c93af[_0x5fb0('0x53')]=_[_0x5fb0('0x54')](_0x3c93af[_0x5fb0('0x53')],{'$or':_[_0x5fb0('0x46')](_0x3c93af['attributes'],function(_0x78c9a4){var _0x288273={};_0x288273[_0x78c9a4]={'$like':'%'+_0x25bf86[_0x5fb0('0x47')][_0x5fb0('0x52')]+'%'};return _0x288273;})});}_0x3c93af=_[_0x5fb0('0x54')]({},_0x3c93af,_0x25bf86[_0x5fb0('0x60')]);return db[_0x5fb0('0x6d')][_0x5fb0('0x31')]({'where':_0x3c93af['where']})[_0x5fb0('0x37')](function(_0x2fe57d){_0x490a99['count']=_0x2fe57d;if(_0x25bf86['query'][_0x5fb0('0x56')]){_0x3c93af[_0x5fb0('0x57')]=[{'all':!![]}];}return db[_0x5fb0('0x6d')]['findAll'](_0x3c93af);})[_0x5fb0('0x37')](function(_0x206714){_0x490a99[_0x5fb0('0x59')]=_0x206714;return _0x490a99;});}})[_0x5fb0('0x37')](respondWithFilteredResult(_0x1bf8d3,_0x3c93af))[_0x5fb0('0x5a')](handleError(_0x1bf8d3,null));};exports['removeAnswers']=function(_0x20f73f,_0x31f08e,_0x380206){return db[_0x5fb0('0x55')][_0x5fb0('0x61')]({'where':{'id':_0x20f73f[_0x5fb0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x31f08e,null))['then'](function(_0x144aba){if(_0x144aba){return _0x144aba[_0x5fb0('0x6e')](_0x20f73f['query'][_0x5fb0('0x6a')]);}})[_0x5fb0('0x37')](respondWithStatusCode(_0x31f08e,null))[_0x5fb0('0x5a')](handleError(_0x31f08e,null));};exports[_0x5fb0('0x67')]=function(_0x1674d6,_0xb12671){var _0x1b5a84={'name':_0x1674d6[_0x5fb0('0x62')][_0x5fb0('0x3c')],'key':_0x1674d6['body'][_0x5fb0('0x6f')],'email':_0x1674d6[_0x5fb0('0x62')][_0x5fb0('0x70')],'ListId':_0x1674d6['body']['ListId'],'active':!_[_0x5fb0('0x71')](_0x1674d6[_0x5fb0('0x62')]['active'])?_0x1674d6[_0x5fb0('0x62')][_0x5fb0('0x72')]:!![],'description':_0x1674d6[_0x5fb0('0x62')][_0x5fb0('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0x5fb0('0x71')](_0x1674d6[_0x5fb0('0x62')][_0x5fb0('0x74')])){if(_0x1674d6[_0x5fb0('0x62')][_0x5fb0('0x75')]){_0x1b5a84[_0x5fb0('0x3f')][_0x5fb0('0x76')]=_0x1b5a84[_0x5fb0('0x41')][_0x5fb0('0x76')]=_0x1674d6['body']['cuser'];_0x1b5a84[_0x5fb0('0x3f')]['password']=_0x1b5a84[_0x5fb0('0x41')][_0x5fb0('0x77')]=_0x1674d6['body'][_0x5fb0('0x78')];}else{_0x1b5a84[_0x5fb0('0x3f')]['authentication']=_0x1b5a84[_0x5fb0('0x41')]['authentication']=![];}_0x1b5a84[_0x5fb0('0x3f')][_0x5fb0('0x79')]=_0x1674d6['body'][_0x5fb0('0x3f')]['host'];_0x1b5a84[_0x5fb0('0x3f')][_0x5fb0('0x7a')]=_0x1674d6[_0x5fb0('0x62')][_0x5fb0('0x3f')][_0x5fb0('0x7a')];_0x1b5a84[_0x5fb0('0x41')][_0x5fb0('0x79')]=_0x1674d6['body']['Smtp']['host'];_0x1b5a84[_0x5fb0('0x41')][_0x5fb0('0x7a')]=_0x1674d6['body'][_0x5fb0('0x41')][_0x5fb0('0x7a')];}else{_0x1b5a84['Imap'][_0x5fb0('0x7b')]=_0x1b5a84[_0x5fb0('0x41')][_0x5fb0('0x7b')]=_0x1674d6[_0x5fb0('0x62')]['cservice'];_0x1b5a84[_0x5fb0('0x3f')][_0x5fb0('0x76')]=_0x1b5a84[_0x5fb0('0x41')][_0x5fb0('0x76')]=_0x1674d6[_0x5fb0('0x62')][_0x5fb0('0x7c')];_0x1b5a84[_0x5fb0('0x3f')][_0x5fb0('0x7d')]=_0x1b5a84[_0x5fb0('0x41')]['pass']=_0x1674d6[_0x5fb0('0x62')][_0x5fb0('0x78')];}return db[_0x5fb0('0x55')][_0x5fb0('0x67')](_0x1b5a84,{'include':[{'model':db[_0x5fb0('0x40')],'as':'Smtp'},{'model':db[_0x5fb0('0x5d')],'as':_0x5fb0('0x3f')}]})[_0x5fb0('0x37')](function(_0x189c64){var _0x1a9b87=_0x1674d6['user'][_0x5fb0('0x39')]({'plain':!![]});if(!_0x1a9b87)throw new Error(_0x5fb0('0x7e'));if(_0x1a9b87['role']===_0x5fb0('0x76')){var _0x112658=_0x189c64[_0x5fb0('0x39')]({'plain':!![]});return db[_0x5fb0('0x7f')][_0x5fb0('0x61')]({'where':{'name':_0x5fb0('0x3a'),'userProfileId':_0x1a9b87[_0x5fb0('0x80')]},'raw':!![]})[_0x5fb0('0x37')](function(_0x36d4c4){if(_0x36d4c4&&_0x36d4c4[_0x5fb0('0x81')]===0x0){return db['UserProfileResource'][_0x5fb0('0x67')]({'name':_0x112658[_0x5fb0('0x3c')],'resourceId':_0x112658['id'],'type':_0x36d4c4[_0x5fb0('0x3c')],'sectionId':_0x36d4c4['id']},{})[_0x5fb0('0x37')](function(){return _0x189c64;});}else{return _0x189c64;}})['catch'](function(_0x5825e2){logger['error'](_0x5fb0('0x82'),_0x5825e2);throw _0x5825e2;});}return _0x189c64;})[_0x5fb0('0x37')](respondWithResult(_0xb12671,0xc9))['catch'](handleError(_0xb12671,null));};exports['getImap']=function(_0x12b500,_0x53130c,_0x171daa){return db[_0x5fb0('0x55')][_0x5fb0('0x6c')]({'where':{'id':_0x12b500[_0x5fb0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x53130c,null))['then'](function(_0x318697){if(_0x318697){return _0x318697[_0x5fb0('0x83')]();}return null;})[_0x5fb0('0x37')](respondWithResult(_0x53130c,null))[_0x5fb0('0x5a')](handleError(_0x53130c,null));};exports[_0x5fb0('0x84')]=function(_0x4c1492,_0x24c02f,_0x1d50c1){if(_0x4c1492['body']['id']){delete _0x4c1492[_0x5fb0('0x62')]['id'];}return db[_0x5fb0('0x55')][_0x5fb0('0x61')]({'where':{'id':_0x4c1492[_0x5fb0('0x5c')]['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x24c02f,null))[_0x5fb0('0x37')](function(_0x568858){if(_0x568858){_0x4c1492[_0x5fb0('0x62')][_0x5fb0('0x65')]=_0x568858['id'];return db[_0x5fb0('0x5d')][_0x5fb0('0x67')](_0x4c1492['body']);}})[_0x5fb0('0x37')](respondWithResult(_0x24c02f,null))[_0x5fb0('0x5a')](handleError(_0x24c02f,null));};exports['removeImap']=function(_0x4b7f5d,_0x3a20b8,_0x442b74){return db[_0x5fb0('0x55')][_0x5fb0('0x6c')]({'where':{'id':_0x4b7f5d[_0x5fb0('0x5c')]['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x3a20b8,null))[_0x5fb0('0x37')](function(_0x46db6e){if(_0x46db6e){return _0x46db6e[_0x5fb0('0x85')](null);}return null;})[_0x5fb0('0x37')](respondWithStatusCode(_0x3a20b8,null))[_0x5fb0('0x5a')](handleError(_0x3a20b8,null));};exports[_0x5fb0('0x86')]=function(_0x9e5f8b,_0x4272f5,_0x17b11a){return db[_0x5fb0('0x55')][_0x5fb0('0x6c')]({'where':{'id':_0x9e5f8b[_0x5fb0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4272f5,null))[_0x5fb0('0x37')](function(_0xfbf4b5){if(_0xfbf4b5){return _0xfbf4b5[_0x5fb0('0x86')]();}return null;})[_0x5fb0('0x37')](respondWithResult(_0x4272f5,null))[_0x5fb0('0x5a')](handleError(_0x4272f5,null));};exports[_0x5fb0('0x87')]=function(_0x1dddfe,_0x55985a,_0x2e559b){if(_0x1dddfe['body']['id']){delete _0x1dddfe[_0x5fb0('0x62')]['id'];}return db[_0x5fb0('0x55')][_0x5fb0('0x61')]({'where':{'id':_0x1dddfe[_0x5fb0('0x5c')]['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x55985a,null))['then'](function(_0x5594e5){if(_0x5594e5){_0x1dddfe[_0x5fb0('0x62')]['MailAccountId']=_0x5594e5['id'];return db[_0x5fb0('0x40')]['create'](_0x1dddfe[_0x5fb0('0x62')]);}})[_0x5fb0('0x37')](respondWithResult(_0x55985a,null))['catch'](handleError(_0x55985a,null));};exports['removeSmtp']=function(_0x560504,_0x4ecd2e,_0x2fc71c){return db[_0x5fb0('0x55')][_0x5fb0('0x6c')]({'where':{'id':_0x560504[_0x5fb0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4ecd2e,null))['then'](function(_0x53e9e9){if(_0x53e9e9){return _0x53e9e9[_0x5fb0('0x88')](null);}return null;})[_0x5fb0('0x37')](respondWithStatusCode(_0x4ecd2e,null))['catch'](handleError(_0x4ecd2e,null));};exports[_0x5fb0('0x89')]=function(_0xa70b0e,_0x493eb4,_0x23ad6d){return db[_0x5fb0('0x8a')][_0x5fb0('0x61')]({'where':{'id':_0xa70b0e['params']['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x493eb4,null))[_0x5fb0('0x37')](function(_0x3f15e1){if(_0x3f15e1){return _0x3f15e1[_0x5fb0('0x89')](_0xa70b0e[_0x5fb0('0x62')][_0x5fb0('0x6a')],_[_0x5fb0('0x8b')](_0xa70b0e[_0x5fb0('0x62')],['ids','id'])||{});}})['then'](respondWithResult(_0x493eb4,null))['catch'](handleError(_0x493eb4,null));};exports[_0x5fb0('0x8c')]=function(_0x25d66f,_0x3c4cdf,_0xbd28d2){var _0x7166ee={'raw':![],'where':{}};var _0x1d092a={};var _0x1f1a3a={'count':0x0,'rows':[]};return db[_0x5fb0('0x55')][_0x5fb0('0x6c')]({'where':{'id':_0x25d66f['params']['id']}})['then'](handleEntityNotFound(_0x3c4cdf,null))['then'](function(_0x402d6a){if(_0x402d6a){_0x1d092a['model']=_[_0x5fb0('0x5f')](db['MailInteraction'][_0x5fb0('0x43')]);_0x1d092a['query']=_[_0x5fb0('0x5f')](_0x25d66f[_0x5fb0('0x47')]);_0x1d092a[_0x5fb0('0x48')]=_[_0x5fb0('0x4a')](_0x1d092a[_0x5fb0('0x45')],_0x1d092a[_0x5fb0('0x47')]);_0x7166ee['attributes']=_['intersection'](_0x1d092a[_0x5fb0('0x45')],qs[_0x5fb0('0x4b')](_0x25d66f[_0x5fb0('0x47')][_0x5fb0('0x4b')]));_0x7166ee['attributes']=_0x7166ee[_0x5fb0('0x49')]['length']?_0x7166ee['attributes']:_0x1d092a[_0x5fb0('0x45')];if(!_0x25d66f['query'][_0x5fb0('0x4d')](_0x5fb0('0x4e'))){_0x7166ee[_0x5fb0('0x30')]=qs[_0x5fb0('0x30')](_0x25d66f[_0x5fb0('0x47')][_0x5fb0('0x30')]);_0x7166ee[_0x5fb0('0x2e')]=qs['offset'](_0x25d66f[_0x5fb0('0x47')]['offset']);}_0x7166ee[_0x5fb0('0x4f')]=qs[_0x5fb0('0x50')](_0x25d66f[_0x5fb0('0x47')][_0x5fb0('0x50')]);_0x7166ee[_0x5fb0('0x53')]=qs['filters'](_[_0x5fb0('0x51')](_0x25d66f[_0x5fb0('0x47')],_0x1d092a[_0x5fb0('0x48')]));_0x7166ee[_0x5fb0('0x53')][_0x5fb0('0x65')]=_0x402d6a['id'];if(_0x25d66f['query']['filter']){_0x7166ee[_0x5fb0('0x53')]=_[_0x5fb0('0x54')](_0x7166ee[_0x5fb0('0x53')],{'$or':_[_0x5fb0('0x46')](_0x7166ee['attributes'],function(_0x25911b){var _0x487804={};_0x487804[_0x25911b]={'$like':'%'+_0x25d66f[_0x5fb0('0x47')][_0x5fb0('0x52')]+'%'};return _0x487804;})});}_0x7166ee=_[_0x5fb0('0x54')]({},_0x7166ee,_0x25d66f[_0x5fb0('0x60')]);return db[_0x5fb0('0x8a')]['count']({'where':_0x7166ee[_0x5fb0('0x53')]})['then'](function(_0x5d9f09){_0x1f1a3a[_0x5fb0('0x31')]=_0x5d9f09;if(_0x25d66f[_0x5fb0('0x47')]['includeAll']){_0x7166ee[_0x5fb0('0x57')]=[{'model':db[_0x5fb0('0x8d')],'as':_0x5fb0('0x8e'),'required':![]},{'model':db[_0x5fb0('0x8f')],'as':_0x5fb0('0x90'),'attributes':[_0x5fb0('0x3c'),_0x5fb0('0x91'),_0x5fb0('0x92')],'required':![]},{'model':db[_0x5fb0('0x93')],'as':'Tags','attributes':['id',_0x5fb0('0x3c'),_0x5fb0('0x94')],'where':_0x25d66f[_0x5fb0('0x47')][_0x5fb0('0x95')]?{'id':_0x25d66f[_0x5fb0('0x47')][_0x5fb0('0x95')]}:undefined,'required':_0x25d66f[_0x5fb0('0x47')][_0x5fb0('0x95')]?!![]:![]}];}return db[_0x5fb0('0x8a')][_0x5fb0('0x58')](_0x7166ee);})[_0x5fb0('0x37')](function(_0x26be2f){_0x1f1a3a[_0x5fb0('0x59')]=_0x26be2f;return _0x1f1a3a;});}})[_0x5fb0('0x37')](respondWithFilteredResult(_0x3c4cdf,_0x7166ee))[_0x5fb0('0x5a')](handleError(_0x3c4cdf,null));};exports[_0x5fb0('0x96')]=function(_0x1919d0,_0x35a777,_0x1d2277){return db[_0x5fb0('0x55')][_0x5fb0('0x6c')]({'where':{'id':_0x1919d0[_0x5fb0('0x5c')]['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x35a777,null))[_0x5fb0('0x37')](function(_0x27b893){if(_0x27b893){return db[_0x5fb0('0x97')]['transaction'](function(_0xc18c5b){return db[_0x5fb0('0x98')]['destroy']({'where':{'MailAccountId':_0x1919d0[_0x5fb0('0x5c')]['id']},'transaction':_0xc18c5b})[_0x5fb0('0x37')](function(_0x1266cf){var _0x140434=_[_0x5fb0('0x46')](_0x1919d0[_0x5fb0('0x62')],function(_0x22e203){_0x22e203[_0x5fb0('0x65')]=_0x1919d0['params']['id'];return _0x22e203;});return db[_0x5fb0('0x98')][_0x5fb0('0x99')](_0x140434,{'transaction':_0xc18c5b});});})[_0x5fb0('0x37')](function(){return db[_0x5fb0('0x98')]['findAndCountAll']({'where':{'MailAccountId':_0x1919d0[_0x5fb0('0x5c')]['id']},'order':_0x5fb0('0x9a')});});}})[_0x5fb0('0x37')](respondWithResult(_0x35a777,null))[_0x5fb0('0x5a')](handleError(_0x35a777,null));};exports[_0x5fb0('0x9b')]=function(_0x3c4a6a,_0x25646e,_0x4461ee){var _0x1594a8={};var _0x5bb1db={};var _0xf84e49;var _0x1e9b4b;return db['MailAccount']['findOne']({'where':{'id':_0x3c4a6a[_0x5fb0('0x5c')]['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x25646e,null))[_0x5fb0('0x37')](function(_0x13fe26){if(_0x13fe26){_0xf84e49=_0x13fe26;_0x5bb1db['model']=_[_0x5fb0('0x5f')](db['MailApplication']['rawAttributes']);_0x5bb1db[_0x5fb0('0x47')]=_[_0x5fb0('0x5f')](_0x3c4a6a[_0x5fb0('0x47')]);_0x5bb1db[_0x5fb0('0x48')]=_[_0x5fb0('0x4a')](_0x5bb1db['model'],_0x5bb1db[_0x5fb0('0x47')]);_0x1594a8['attributes']=_[_0x5fb0('0x4a')](_0x5bb1db[_0x5fb0('0x45')],qs[_0x5fb0('0x4b')](_0x3c4a6a[_0x5fb0('0x47')]['fields']));_0x1594a8[_0x5fb0('0x49')]=_0x1594a8[_0x5fb0('0x49')]['length']?_0x1594a8[_0x5fb0('0x49')]:_0x5bb1db[_0x5fb0('0x45')];_0x1594a8[_0x5fb0('0x4f')]=qs[_0x5fb0('0x50')](_0x3c4a6a['query']['sort']);_0x1594a8[_0x5fb0('0x53')]=qs[_0x5fb0('0x48')](_[_0x5fb0('0x51')](_0x3c4a6a[_0x5fb0('0x47')],_0x5bb1db[_0x5fb0('0x48')]));if(_0x3c4a6a[_0x5fb0('0x47')][_0x5fb0('0x52')]){_0x1594a8[_0x5fb0('0x53')]=_[_0x5fb0('0x54')](_0x1594a8['where'],{'$or':_[_0x5fb0('0x46')](_0x1594a8[_0x5fb0('0x49')],function(_0x49f284){var _0x1dfbde={};_0x1dfbde[_0x49f284]={'$like':'%'+_0x3c4a6a[_0x5fb0('0x47')]['filter']+'%'};return _0x1dfbde;})});}_0x1594a8=_['merge']({},_0x1594a8,_0x3c4a6a[_0x5fb0('0x60')]);return _0xf84e49[_0x5fb0('0x9b')](_0x1594a8);}})[_0x5fb0('0x37')](function(_0x2f95c3){if(_0x2f95c3){_0x1e9b4b=_0x2f95c3[_0x5fb0('0x4c')];if(!_0x3c4a6a['query'][_0x5fb0('0x4d')](_0x5fb0('0x4e'))){_0x1594a8[_0x5fb0('0x30')]=qs[_0x5fb0('0x30')](_0x3c4a6a[_0x5fb0('0x47')][_0x5fb0('0x30')]);_0x1594a8[_0x5fb0('0x2e')]=qs['offset'](_0x3c4a6a[_0x5fb0('0x47')][_0x5fb0('0x2e')]);}return _0xf84e49[_0x5fb0('0x9b')](_0x1594a8);}})[_0x5fb0('0x37')](function(_0x1a403c){if(_0x1a403c){return _0x1a403c?{'count':_0x1e9b4b,'rows':_0x1a403c}:null;}})[_0x5fb0('0x37')](respondWithResult(_0x25646e,null))[_0x5fb0('0x5a')](handleError(_0x25646e,null));};exports[_0x5fb0('0x9c')]=function(_0x42f59a,_0x4fcdff,_0x2b037c){var _0x227dd0={'raw':!![],'where':{}};var _0x5a701c={};var _0x2e691d={'count':0x0,'rows':[]};return db[_0x5fb0('0x55')][_0x5fb0('0x6c')]({'where':{'id':_0x42f59a['params']['id']}})['then'](handleEntityNotFound(_0x4fcdff,null))['then'](function(_0x4fe223){if(_0x4fe223){_0x5a701c[_0x5fb0('0x45')]=_[_0x5fb0('0x5f')](db[_0x5fb0('0x9d')][_0x5fb0('0x43')]);_0x5a701c[_0x5fb0('0x47')]=_['keys'](_0x42f59a[_0x5fb0('0x47')]);_0x5a701c[_0x5fb0('0x48')]=_[_0x5fb0('0x4a')](_0x5a701c[_0x5fb0('0x45')],_0x5a701c['query']);_0x227dd0[_0x5fb0('0x49')]=_['intersection'](_0x5a701c['model'],qs[_0x5fb0('0x4b')](_0x42f59a[_0x5fb0('0x47')][_0x5fb0('0x4b')]));_0x227dd0[_0x5fb0('0x49')]=_0x227dd0['attributes']['length']?_0x227dd0['attributes']:_0x5a701c[_0x5fb0('0x45')];if(!_0x42f59a[_0x5fb0('0x47')][_0x5fb0('0x4d')](_0x5fb0('0x4e'))){_0x227dd0['limit']=qs[_0x5fb0('0x30')](_0x42f59a['query'][_0x5fb0('0x30')]);_0x227dd0[_0x5fb0('0x2e')]=qs[_0x5fb0('0x2e')](_0x42f59a[_0x5fb0('0x47')][_0x5fb0('0x2e')]);}_0x227dd0['order']=qs[_0x5fb0('0x50')](_0x42f59a[_0x5fb0('0x47')][_0x5fb0('0x50')]);_0x227dd0[_0x5fb0('0x53')]=qs[_0x5fb0('0x48')](_[_0x5fb0('0x51')](_0x42f59a[_0x5fb0('0x47')],_0x5a701c[_0x5fb0('0x48')]));_0x227dd0[_0x5fb0('0x53')]['MailAccountId']=_0x4fe223['id'];if(_0x42f59a[_0x5fb0('0x47')][_0x5fb0('0x52')]){_0x227dd0['where']=_['merge'](_0x227dd0[_0x5fb0('0x53')],{'$or':_[_0x5fb0('0x46')](_0x227dd0[_0x5fb0('0x49')],function(_0x572795){var _0x5ada31={};_0x5ada31[_0x572795]={'$like':'%'+_0x42f59a[_0x5fb0('0x47')]['filter']+'%'};return _0x5ada31;})});}if(_0x42f59a['query'][_0x5fb0('0x9e')]){var _0x5b87c6=_0x42f59a[_0x5fb0('0x47')][_0x5fb0('0x9e')][_0x5fb0('0x9f')](',');var _0x1b9b3b={};_0x1b9b3b[_0x5b87c6[0x0]]={'$gte':moment(_0x5b87c6[0x1])[_0x5fb0('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x227dd0['where']=_[_0x5fb0('0x54')](_0x227dd0[_0x5fb0('0x53')],_0x1b9b3b);}_0x227dd0=_[_0x5fb0('0x54')]({},_0x227dd0,_0x42f59a[_0x5fb0('0x60')]);return db[_0x5fb0('0x9d')][_0x5fb0('0x31')]({'where':_0x227dd0[_0x5fb0('0x53')]})[_0x5fb0('0x37')](function(_0x40c6d3){_0x2e691d[_0x5fb0('0x31')]=_0x40c6d3;if(_0x42f59a[_0x5fb0('0x47')][_0x5fb0('0x56')]){_0x227dd0['include']=[{'all':!![]}];}return db[_0x5fb0('0x9d')][_0x5fb0('0x58')](_0x227dd0);})[_0x5fb0('0x37')](function(_0x2b126b){if(_0x42f59a[_0x5fb0('0x47')]['inlineCss']===_0x5fb0('0xa1')){for(var _0x330cc1=0x0;_0x330cc1<_0x2b126b['length'];_0x330cc1++){_0x2b126b[_0x330cc1][_0x5fb0('0x62')]=juice(_0x2b126b[_0x330cc1][_0x5fb0('0x62')]);}}_0x2e691d[_0x5fb0('0x59')]=_0x2b126b;return _0x2e691d;});}})[_0x5fb0('0x37')](respondWithFilteredResult(_0x4fcdff,_0x227dd0))[_0x5fb0('0x5a')](handleError(_0x4fcdff,null));};exports[_0x5fb0('0x3d')]=function(_0x5219a3,_0xa9062,_0x165af1){var _0xf5d08,_0x39d580={},_0x2070ca;if(_0x5219a3[_0x5fb0('0x62')]['to']){_0x2070ca=_0x5219a3[_0x5fb0('0x62')]['to'][_0x5fb0('0x9f')](',')[0x0];}return db['MailAccount'][_0x5fb0('0x61')]({'where':{'id':_0x5219a3['params']['id']},'include':[{'model':db[_0x5fb0('0xa2')],'as':_0x5fb0('0xa3'),'include':[{'model':db[_0x5fb0('0x8d')],'as':_0x5fb0('0xa4'),'where':{'email':_0x2070ca},'limit':0x1,'order':[[_0x5fb0('0xa5'),_0x5fb0('0xa6')]]}]},{'model':db['MailServerOut'],'as':_0x5fb0('0x41'),'raw':!![]}]})['then'](handleEntityNotFound(_0xa9062,null))[_0x5fb0('0x37')](function(_0x4e78e3){if(_0x4e78e3){_0xf5d08=_0x4e78e3;if(_0x4e78e3[_0x5fb0('0x41')]){if(_[_0x5fb0('0x71')](_0x5219a3[_0x5fb0('0x62')][_0x5fb0('0xa7')])){_0x5219a3[_0x5fb0('0x62')][_0x5fb0('0xa7')]=util[_0x5fb0('0xa0')](_0x5fb0('0xa8'),_0x4e78e3[_0x5fb0('0x3c')],_0x4e78e3[_0x5fb0('0x70')]||_0x4e78e3[_0x5fb0('0x41')][_0x5fb0('0x76')]);}if(_0x5219a3[_0x5fb0('0x62')][_0x5fb0('0xa9')]&&_0x5219a3[_0x5fb0('0x62')][_0x5fb0('0xa9')][_0x5fb0('0x4c')]){for(var _0x2fcec4=0x0;_0x2fcec4<_0x5219a3[_0x5fb0('0x62')][_0x5fb0('0xa9')][_0x5fb0('0x4c')];_0x2fcec4+=0x1){_0x5219a3[_0x5fb0('0x62')][_0x5fb0('0xa9')][_0x2fcec4]={'filename':_0x5219a3[_0x5fb0('0x62')][_0x5fb0('0xa9')][_0x2fcec4][_0x5fb0('0x3c')],'path':path[_0x5fb0('0xaa')](config['root'],_0x5fb0('0xab'),_0x5219a3[_0x5fb0('0x62')]['attachments'][_0x2fcec4]['basename'])};}}var _0x476d6d={'tls':{'rejectUnauthorized':![]}};if(_[_0x5fb0('0x71')](_0x4e78e3[_0x5fb0('0x41')][_0x5fb0('0x7b')])){if(_0x4e78e3[_0x5fb0('0x41')][_0x5fb0('0xac')]){_0x476d6d[_0x5fb0('0xad')]={'user':_0x4e78e3[_0x5fb0('0x41')][_0x5fb0('0x76')],'pass':_0x4e78e3[_0x5fb0('0x41')][_0x5fb0('0x77')]};}_0x476d6d[_0x5fb0('0x79')]=_0x4e78e3[_0x5fb0('0x41')][_0x5fb0('0x79')];_0x476d6d[_0x5fb0('0x7a')]=_0x4e78e3[_0x5fb0('0x41')]['port'];_0x476d6d['secure']=_0x4e78e3[_0x5fb0('0x41')][_0x5fb0('0xae')];}else{_0x476d6d[_0x5fb0('0x7b')]=_0x4e78e3['Smtp'][_0x5fb0('0x7b')];_0x476d6d[_0x5fb0('0xad')]={'user':_0x4e78e3[_0x5fb0('0x41')]['user'],'pass':_0x4e78e3[_0x5fb0('0x41')][_0x5fb0('0x77')]};}return respondWithRpcPromise(_0x5fb0('0xaf'),_0x5fb0('0xb0'),{'account':_0x476d6d,'message':_0x5219a3[_0x5fb0('0x62')]});}else{throw new Error(_0x5fb0('0xb1'));}}})[_0x5fb0('0x37')](function(_0x39104f){if(_0x39104f){_0x39d580=_0x39104f;if(_0xf5d08[_0x5fb0('0xa3')]){if(_0xf5d08[_0x5fb0('0xa3')][_0x5fb0('0xa4')][_0x5fb0('0x4c')]){return _0xf5d08[_0x5fb0('0xa3')][_0x5fb0('0xa4')][0x0];}else{return db[_0x5fb0('0x8d')][_0x5fb0('0x67')](_[_0x5fb0('0xb2')](_0x5219a3[_0x5fb0('0x62')],{'firstName':_0x5219a3[_0x5fb0('0x62')]['to'],'email':_0x5219a3['body']['to'],'phone':_0x5219a3[_0x5fb0('0x62')]['to'],'ListId':_0xf5d08[_0x5fb0('0xb3')]}));}}else{throw new Error(_0x5fb0('0xb1'));}}})['then'](function(_0x56b1b9){if(_0x56b1b9){var _0x3dd767={'UserId':_0x5219a3[_0x5fb0('0x76')]['id'],'ContactId':_0x56b1b9['id'],'MailAccountId':_0xf5d08['id'],'inReplyTo':_0x39d580[_0x5fb0('0xb4')],'to':_0x5219a3['body'][_0x5fb0('0xa7')],'cc':_0x5219a3['body']['cc'],'subject':_0x5219a3[_0x5fb0('0x62')][_0x5fb0('0xb5')],'attach':_0x5219a3[_0x5fb0('0x62')][_0x5fb0('0xb6')],'firstMsgDirection':_0x5fb0('0xb7'),'lastMsgAt':moment()[_0x5fb0('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x5fb0('0xb7'),'Messages':[_[_0x5fb0('0x54')](_0x5219a3['body'],{'messageId':_0x39d580[_0x5fb0('0xb4')],'sentAt':moment()[_0x5fb0('0xa0')](_0x5fb0('0xb8')),'read':!![],'MailAccountId':_0xf5d08['id'],'UserId':_0x5219a3[_0x5fb0('0x76')]['id'],'ContactId':_0x56b1b9['id']})]};if(_0x5219a3[_0x5fb0('0x62')][_0x5fb0('0xb9')]){_0x3dd767=_[_0x5fb0('0x54')](_0x3dd767,_0x5219a3['body'][_0x5fb0('0xb9')]);}return db[_0x5fb0('0x8a')][_0x5fb0('0x67')](_0x3dd767,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0x5fb0('0x37')](respondWithResult(_0xa9062,null))['catch'](handleError(_0xa9062,null));};exports[_0x5fb0('0xba')]=function(_0x5c9bfd,_0x126321,_0x46ea33){return db['MailAccount'][_0x5fb0('0x61')]({'where':{'id':_0x5c9bfd[_0x5fb0('0x5c')]['id']},'include':[{'model':db[_0x5fb0('0x40')],'as':'Smtp','raw':!![]}]})[_0x5fb0('0x37')](handleEntityNotFound(_0x126321,null))['then'](function(_0x5ccc65){if(_0x5ccc65&&_0x5ccc65[_0x5fb0('0x41')]){var _0x2c6977={'id':_0x5ccc65['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5ccc65[_0x5fb0('0x41')][_0x5fb0('0x7b')]){_0x2c6977['service']=_0x5ccc65['Smtp'][_0x5fb0('0x7b')];}else{_0x2c6977[_0x5fb0('0x79')]=_0x5ccc65['Smtp'][_0x5fb0('0x79')];_0x2c6977[_0x5fb0('0x7a')]=_0x5ccc65[_0x5fb0('0x41')]['port'];_0x2c6977['secure']=_0x5ccc65[_0x5fb0('0x41')][_0x5fb0('0xae')];}if(_0x5ccc65[_0x5fb0('0x41')][_0x5fb0('0xac')]){_0x2c6977[_0x5fb0('0xad')]={'user':_0x5ccc65[_0x5fb0('0x41')]['user'],'pass':_0x5ccc65['Smtp']['pass']};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x2c6977});}})[_0x5fb0('0x37')](respondWithResult(_0x126321,null))[_0x5fb0('0x5a')](handleError(_0x126321,null));};exports[_0x5fb0('0x38')]=function(_0x1b73dd,_0x5aa404){return db[_0x5fb0('0x55')]['find']({'where':{'id':_0x1b73dd[_0x5fb0('0x5c')]['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x5aa404,null))[_0x5fb0('0x37')](function(_0x21a71a){if(_0x21a71a&&_0x21a71a[_0x5fb0('0x7b')]){throw new db[(_0x5fb0('0xbb'))][(_0x5fb0('0xbc'))](_0x5fb0('0xbd'));}return _0x21a71a;})[_0x5fb0('0x37')](removeEntity(_0x5aa404,null))['catch'](handleError(_0x5aa404,null));};exports[_0x5fb0('0xbe')]=function(_0x5f2156,_0x2119f9,_0xf1d00d){return db['MailAccount'][_0x5fb0('0x61')]({'where':{'id':_0x5f2156[_0x5fb0('0x5c')]['id']}})[_0x5fb0('0x37')](handleEntityNotFound(_0x2119f9,null))[_0x5fb0('0x37')](function(_0x125b3b){if(_0x125b3b){return _0x125b3b['addAgents'](_0x5f2156[_0x5fb0('0x62')][_0x5fb0('0x6a')],_[_0x5fb0('0x8b')](_0x5f2156['body'],[_0x5fb0('0x6a'),'id'])||{})['spread'](function(_0x51f9ef){for(var _0x5a16ac=0x0;_0x5a16ac<_0x5f2156[_0x5fb0('0x62')][_0x5fb0('0x6a')][_0x5fb0('0x4c')];_0x5a16ac+=0x1){socket[_0x5fb0('0xbf')]('userMailAccount:save',{'UserId':Number(_0x5f2156[_0x5fb0('0x62')][_0x5fb0('0x6a')][_0x5a16ac]),'MailAccountId':Number(_0x5f2156[_0x5fb0('0x5c')]['id'])});}return _0x51f9ef;});}})['then'](respondWithResult(_0x2119f9,null))[_0x5fb0('0x5a')](handleError(_0x2119f9,null));};exports['removeAgents']=function(_0xab8461,_0xca4a82,_0x21253a){return db[_0x5fb0('0x55')][_0x5fb0('0x61')]({'where':{'id':_0xab8461[_0x5fb0('0x5c')]['id']}})['then'](handleEntityNotFound(_0xca4a82,null))[_0x5fb0('0x37')](function(_0x48215b){if(_0x48215b){return _0x48215b[_0x5fb0('0xc0')](_0xab8461['query'][_0x5fb0('0x6a')])[_0x5fb0('0x37')](function(){if(_[_0x5fb0('0xc1')](_0xab8461['query']['ids'])){for(var _0x2b1c12=0x0;_0x2b1c12<_0xab8461['query'][_0x5fb0('0x6a')]['length'];_0x2b1c12+=0x1){socket[_0x5fb0('0xbf')](_0x5fb0('0xc2'),{'UserId':Number(_0xab8461[_0x5fb0('0x47')][_0x5fb0('0x6a')][_0x2b1c12]),'MailAccountId':Number(_0xab8461[_0x5fb0('0x5c')]['id'])});}}else{socket[_0x5fb0('0xbf')](_0x5fb0('0xc2'),{'UserId':Number(_0xab8461[_0x5fb0('0x47')]['ids']),'MailAccountId':Number(_0xab8461['params']['id'])});}});}})[_0x5fb0('0x37')](respondWithStatusCode(_0xca4a82,null))[_0x5fb0('0x5a')](handleError(_0xca4a82,null));};exports[_0x5fb0('0xc3')]=function(_0x271f46,_0x3d7537,_0x445634){var _0x56e2de={};var _0x2a3c04={};var _0x1f7129;var _0x10593a;return db[_0x5fb0('0x55')][_0x5fb0('0x6c')]({'where':{'id':_0x271f46[_0x5fb0('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3d7537,null))[_0x5fb0('0x37')](function(_0x27144e){if(_0x27144e){_0x1f7129=_0x27144e;_0x2a3c04[_0x5fb0('0x45')]=_[_0x5fb0('0x5f')](db[_0x5fb0('0x8f')][_0x5fb0('0x43')]);_0x2a3c04[_0x5fb0('0x47')]=_[_0x5fb0('0x5f')](_0x271f46[_0x5fb0('0x47')]);_0x2a3c04['filters']=_[_0x5fb0('0x4a')](_0x2a3c04['model'],_0x2a3c04['query']);_0x56e2de[_0x5fb0('0x49')]=_[_0x5fb0('0x4a')](_0x2a3c04['model'],qs[_0x5fb0('0x4b')](_0x271f46[_0x5fb0('0x47')][_0x5fb0('0x4b')]));_0x56e2de['attributes']=_0x56e2de['attributes'][_0x5fb0('0x4c')]?_0x56e2de[_0x5fb0('0x49')]:_0x2a3c04['model'];_0x56e2de['order']=qs[_0x5fb0('0x50')](_0x271f46['query'][_0x5fb0('0x50')]);_0x56e2de[_0x5fb0('0x53')]=qs[_0x5fb0('0x48')](_[_0x5fb0('0x51')](_0x271f46[_0x5fb0('0x47')],_0x2a3c04['filters']));if(_0x271f46[_0x5fb0('0x47')][_0x5fb0('0x52')]){_0x56e2de[_0x5fb0('0x53')]=_['merge'](_0x56e2de[_0x5fb0('0x53')],{'$or':_[_0x5fb0('0x46')](_0x56e2de[_0x5fb0('0x49')],function(_0xf46e0a){var _0x24608f={};_0x24608f[_0xf46e0a]={'$like':'%'+_0x271f46['query'][_0x5fb0('0x52')]+'%'};return _0x24608f;})});}_0x56e2de=_[_0x5fb0('0x54')]({},_0x56e2de,_0x271f46[_0x5fb0('0x60')]);return _0x1f7129['getAgents'](_0x56e2de);}})[_0x5fb0('0x37')](function(_0x5842e2){if(_0x5842e2){_0x10593a=_0x5842e2[_0x5fb0('0x4c')];if(!_0x271f46[_0x5fb0('0x47')][_0x5fb0('0x4d')]('nolimit')){_0x56e2de[_0x5fb0('0x30')]=qs['limit'](_0x271f46[_0x5fb0('0x47')][_0x5fb0('0x30')]);_0x56e2de[_0x5fb0('0x2e')]=qs['offset'](_0x271f46['query'][_0x5fb0('0x2e')]);}return _0x1f7129[_0x5fb0('0xc3')](_0x56e2de);}})[_0x5fb0('0x37')](function(_0xffebf2){if(_0xffebf2){return _0xffebf2?{'count':_0x10593a,'rows':_0xffebf2}:null;}})[_0x5fb0('0x37')](respondWithResult(_0x3d7537,null))[_0x5fb0('0x5a')](handleError(_0x3d7537,null));};
\ No newline at end of file
+var _0x7fc9=['papaparse','html-to-text','juice','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','json','offset','undefined','limit','count','set','reject','update','destroy','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','body','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','create','removeAnswers','email','isNil','cservice','cauthentication','user','pass','cpassword','authentication','host','port','cuser','password','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','CmContact','Contact','Owner','Tag','Tags','tag','sequelize','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','List','Contacts','updatedAt','DESC','from','attachments','join','root','basename','service','auth','sendMail','List\x20not\x20found','ListId','attach','out','format','messageId','Interaction','Messages','secure','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring'];(function(_0x34d44e,_0x4a1a85){var _0x9c1091=function(_0x4e00cb){while(--_0x4e00cb){_0x34d44e['push'](_0x34d44e['shift']());}};_0x9c1091(++_0x4a1a85);}(_0x7fc9,0xb0));var _0x97fc=function(_0x5524a1,_0x37c171){_0x5524a1=_0x5524a1-0x0;var _0x4ea5e3=_0x7fc9[_0x5524a1];return _0x4ea5e3;};'use strict';var emlformat=require(_0x97fc('0x0'));var rimraf=require(_0x97fc('0x1'));var zipdir=require(_0x97fc('0x2'));var jsonpatch=require(_0x97fc('0x3'));var rp=require(_0x97fc('0x4'));var moment=require('moment');var BPromise=require(_0x97fc('0x5'));var Mustache=require(_0x97fc('0x6'));var util=require(_0x97fc('0x7'));var path=require(_0x97fc('0x8'));var sox=require(_0x97fc('0x9'));var csv=require(_0x97fc('0xa'));var ejs=require(_0x97fc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x97fc('0xc'));var crypto=require(_0x97fc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x97fc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x97fc('0xf'));var Papa=require(_0x97fc('0x10'));var htmlToText=require(_0x97fc('0x11'));var juice=require(_0x97fc('0x12'));var Redis=require('ioredis');var authService=require(_0x97fc('0x13'));var qs=require(_0x97fc('0x14'));var as=require(_0x97fc('0x15'));var hardwareService=require(_0x97fc('0x16'));var logger=require(_0x97fc('0x17'))(_0x97fc('0x18'));var utils=require(_0x97fc('0x19'));var config=require(_0x97fc('0x1a'));var licenseUtil=require(_0x97fc('0x1b'));var db=require(_0x97fc('0x1c'))['db'];config[_0x97fc('0x1d')]=_[_0x97fc('0x1e')](config[_0x97fc('0x1d')],{'host':_0x97fc('0x1f'),'port':0x18eb});var socket=require(_0x97fc('0x20'))(new Redis(config['redis']));require(_0x97fc('0x21'))[_0x97fc('0x22')](socket);var jayson=require(_0x97fc('0x23'));var client=jayson[_0x97fc('0x24')]['http']({'port':0x232b});function respondWithRpcPromise(_0x32e5b0,_0x18ee13,_0x554462,_0x5343b4){return new BPromise(function(_0x2967df,_0x882fa2){var _0x1c282c=_0x5343b4||client;return _0x1c282c['request'](_0x32e5b0,_0x554462)[_0x97fc('0x25')](function(_0x18deb6){logger[_0x97fc('0x26')](_0x97fc('0x27'),_0x18ee13,'request\x20sent');logger['debug'](_0x97fc('0x28'),_0x18ee13,_0x97fc('0x29'),JSON[_0x97fc('0x2a')](_0x18deb6));if(_0x18deb6[_0x97fc('0x2b')]){if(_0x18deb6['error']['code']===0x1f4){logger[_0x97fc('0x2b')](_0x97fc('0x27'),_0x18ee13,_0x18deb6['error']['message']);return _0x882fa2(_0x18deb6[_0x97fc('0x2b')][_0x97fc('0x2c')]);}logger[_0x97fc('0x2b')](_0x97fc('0x27'),_0x18ee13,_0x18deb6['error'][_0x97fc('0x2c')]);return _0x2967df(_0x18deb6[_0x97fc('0x2b')][_0x97fc('0x2c')]);}else{logger['info'](_0x97fc('0x27'),_0x18ee13,_0x97fc('0x29'));_0x2967df(_0x18deb6[_0x97fc('0x2d')][_0x97fc('0x2c')]);}})[_0x97fc('0x2e')](function(_0x135abc){logger['error'](_0x97fc('0x27'),_0x18ee13,_0x135abc);_0x882fa2(_0x135abc);});});}function respondWithStatusCode(_0x5e6eb6,_0x2557d9){_0x2557d9=_0x2557d9||0xcc;return function(_0x326ee9){if(_0x326ee9){return _0x5e6eb6['sendStatus'](_0x2557d9);}return _0x5e6eb6[_0x97fc('0x2f')](_0x2557d9)['end']();};}function respondWithResult(_0x52f112,_0x3b3573){_0x3b3573=_0x3b3573||0xc8;return function(_0x3ede0c){if(_0x3ede0c){return _0x52f112[_0x97fc('0x2f')](_0x3b3573)[_0x97fc('0x30')](_0x3ede0c);}};}function respondWithFilteredResult(_0x5ac933,_0x208a8d){return function(_0x5bb2a2){if(_0x5bb2a2){var _0x33c552=typeof _0x208a8d[_0x97fc('0x31')]===_0x97fc('0x32')&&typeof _0x208a8d[_0x97fc('0x33')]===_0x97fc('0x32');var _0x24ff6d=_0x5bb2a2[_0x97fc('0x34')];var _0x5de781=_0x33c552?0x0:_0x208a8d[_0x97fc('0x31')];var _0x5ed4c5=_0x33c552?_0x5bb2a2[_0x97fc('0x34')]:_0x208a8d['offset']+_0x208a8d['limit'];var _0x5f2ca2;if(_0x5ed4c5>=_0x24ff6d){_0x5ed4c5=_0x24ff6d;_0x5f2ca2=0xc8;}else{_0x5f2ca2=0xce;}_0x5ac933['status'](_0x5f2ca2);return _0x5ac933[_0x97fc('0x35')]('Content-Range',_0x5de781+'-'+_0x5ed4c5+'/'+_0x24ff6d)[_0x97fc('0x30')](_0x5bb2a2);}return null;};}function patchUpdates(_0x20dbae){return function(_0x306ab3){try{jsonpatch['apply'](_0x306ab3,_0x20dbae,!![]);}catch(_0x524312){return BPromise[_0x97fc('0x36')](_0x524312);}return _0x306ab3['save']();};}function saveUpdates(_0x5c009b,_0x22621c){return function(_0x4d127a){if(_0x4d127a){return _0x4d127a[_0x97fc('0x37')](_0x5c009b)[_0x97fc('0x25')](function(_0x16e969){return _0x16e969;});}return null;};}function removeEntity(_0x424845,_0x2d5bb6){return function(_0x185fa8){if(_0x185fa8){return _0x185fa8[_0x97fc('0x38')]()['then'](function(){var _0x93556=_0x185fa8['get']({'plain':!![]});var _0x192555=_0x97fc('0x39');return db[_0x97fc('0x3a')][_0x97fc('0x38')]({'where':{'type':_0x192555,'resourceId':_0x93556['id']}})[_0x97fc('0x25')](function(){return _0x185fa8;});})[_0x97fc('0x25')](function(){_0x424845[_0x97fc('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x171082,_0xa5ac98){return function(_0x2bfa17){if(!_0x2bfa17){_0x171082['sendStatus'](0x194);}return _0x2bfa17;};}function handleError(_0x2ae4af,_0x2da5f9){_0x2da5f9=_0x2da5f9||0x1f4;return function(_0x2bb242){logger[_0x97fc('0x2b')](_0x2bb242[_0x97fc('0x3b')]);if(_0x2bb242[_0x97fc('0x3c')]){delete _0x2bb242['name'];}_0x2ae4af[_0x97fc('0x2f')](_0x2da5f9)[_0x97fc('0x3d')](_0x2bb242);};}exports[_0x97fc('0x3e')]=function(_0x1157c4,_0x1adbd7){var _0x42329d={'include':[{'model':db[_0x97fc('0x3f')],'as':_0x97fc('0x40')},{'model':db[_0x97fc('0x41')],'as':_0x97fc('0x42')},{'model':db[_0x97fc('0x43')],'as':_0x97fc('0x44')}]},_0x13ecc8={},_0x1b3c87={'count':0x0,'rows':[]};var _0x5d1c6b=_[_0x97fc('0x45')](db[_0x97fc('0x46')]['rawAttributes'],function(_0x3ecdba){return{'name':_0x3ecdba[_0x97fc('0x47')],'type':_0x3ecdba[_0x97fc('0x48')][_0x97fc('0x49')]};});_0x13ecc8[_0x97fc('0x4a')]=_['map'](_0x5d1c6b,_0x97fc('0x3c'));_0x13ecc8['query']=_[_0x97fc('0x4b')](_0x1157c4[_0x97fc('0x4c')]);_0x13ecc8[_0x97fc('0x4d')]=_[_0x97fc('0x4e')](_0x13ecc8[_0x97fc('0x4a')],_0x13ecc8[_0x97fc('0x4c')]);_0x42329d['attributes']=_[_0x97fc('0x4e')](_0x13ecc8[_0x97fc('0x4a')],qs['fields'](_0x1157c4[_0x97fc('0x4c')][_0x97fc('0x4f')]));_0x42329d['attributes']=_0x42329d[_0x97fc('0x50')]['length']?_0x42329d[_0x97fc('0x50')]:_0x13ecc8[_0x97fc('0x4a')];if(!_0x1157c4[_0x97fc('0x4c')][_0x97fc('0x51')]('nolimit')){_0x42329d['limit']=qs[_0x97fc('0x33')](_0x1157c4[_0x97fc('0x4c')][_0x97fc('0x33')]);_0x42329d[_0x97fc('0x31')]=qs[_0x97fc('0x31')](_0x1157c4['query'][_0x97fc('0x31')]);}_0x42329d[_0x97fc('0x52')]=qs['sort'](_0x1157c4[_0x97fc('0x4c')][_0x97fc('0x53')]);_0x42329d[_0x97fc('0x54')]=qs[_0x97fc('0x4d')](_[_0x97fc('0x55')](_0x1157c4[_0x97fc('0x4c')],_0x13ecc8[_0x97fc('0x4d')]),_0x5d1c6b);if(_0x1157c4[_0x97fc('0x4c')][_0x97fc('0x56')]){_0x42329d[_0x97fc('0x54')]=_[_0x97fc('0x57')](_0x42329d['where'],{'$or':_[_0x97fc('0x45')](_0x5d1c6b,function(_0x2f8282){if(_0x2f8282[_0x97fc('0x48')]!==_0x97fc('0x58')){var _0xf03937={};_0xf03937[_0x2f8282[_0x97fc('0x3c')]]={'$like':'%'+_0x1157c4[_0x97fc('0x4c')][_0x97fc('0x56')]+'%'};return _0xf03937;}})});}_0x42329d=_[_0x97fc('0x57')]({},_0x42329d,_0x1157c4[_0x97fc('0x59')]);var _0x1727d2={'where':_0x42329d[_0x97fc('0x54')]};return db[_0x97fc('0x46')][_0x97fc('0x34')](_0x1727d2)[_0x97fc('0x25')](function(_0x1f6f67){_0x1b3c87[_0x97fc('0x34')]=_0x1f6f67;if(_0x1157c4[_0x97fc('0x4c')][_0x97fc('0x5a')]){_0x42329d[_0x97fc('0x5b')]=[{'all':!![]}];}return db[_0x97fc('0x46')][_0x97fc('0x5c')](_0x42329d);})[_0x97fc('0x25')](function(_0x258f1f){_0x1b3c87[_0x97fc('0x5d')]=_0x258f1f;return _0x1b3c87;})[_0x97fc('0x25')](respondWithFilteredResult(_0x1adbd7,_0x42329d))[_0x97fc('0x2e')](handleError(_0x1adbd7,null));};exports[_0x97fc('0x5e')]=function(_0x2635c6,_0x1f4f04){var _0x583ada={'raw':![],'where':{'id':_0x2635c6[_0x97fc('0x5f')]['id']},'include':[{'model':db[_0x97fc('0x3f')],'as':_0x97fc('0x40')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x97fc('0x43')],'as':_0x97fc('0x44')}]},_0x4a2fb4={};_0x4a2fb4[_0x97fc('0x4a')]=_[_0x97fc('0x4b')](db[_0x97fc('0x46')][_0x97fc('0x60')]);_0x4a2fb4[_0x97fc('0x4c')]=_[_0x97fc('0x4b')](_0x2635c6[_0x97fc('0x4c')]);_0x4a2fb4['filters']=_['intersection'](_0x4a2fb4[_0x97fc('0x4a')],_0x4a2fb4[_0x97fc('0x4c')]);_0x583ada['attributes']=_['intersection'](_0x4a2fb4[_0x97fc('0x4a')],qs[_0x97fc('0x4f')](_0x2635c6[_0x97fc('0x4c')][_0x97fc('0x4f')]));_0x583ada[_0x97fc('0x50')]=_0x583ada[_0x97fc('0x50')][_0x97fc('0x61')]?_0x583ada[_0x97fc('0x50')]:_0x4a2fb4[_0x97fc('0x4a')];if(_0x2635c6[_0x97fc('0x4c')][_0x97fc('0x5a')]){_0x583ada[_0x97fc('0x5b')]=[{'all':!![]}];}_0x583ada=_['merge']({},_0x583ada,_0x2635c6[_0x97fc('0x59')]);return db[_0x97fc('0x46')][_0x97fc('0x62')](_0x583ada)[_0x97fc('0x25')](handleEntityNotFound(_0x1f4f04,null))[_0x97fc('0x25')](respondWithResult(_0x1f4f04,null))[_0x97fc('0x2e')](handleError(_0x1f4f04,null));};exports[_0x97fc('0x37')]=function(_0x3bceaf,_0x255345){if(_0x3bceaf[_0x97fc('0x63')]['id']){delete _0x3bceaf[_0x97fc('0x63')]['id'];}return db[_0x97fc('0x46')][_0x97fc('0x62')]({'where':{'id':_0x3bceaf[_0x97fc('0x5f')]['id']},'include':[{'model':db[_0x97fc('0x3f')],'as':_0x97fc('0x40')},{'model':db['MailServerOut'],'as':_0x97fc('0x42')},{'model':db[_0x97fc('0x43')],'as':_0x97fc('0x44')}]})[_0x97fc('0x25')](handleEntityNotFound(_0x255345,null))[_0x97fc('0x25')](saveUpdates(_0x3bceaf['body'],null))[_0x97fc('0x25')](function(_0x1fcb8b){if(_0x1fcb8b&&_0x3bceaf[_0x97fc('0x63')][_0x97fc('0x40')]){return db[_0x97fc('0x3f')]['update'](_0x3bceaf[_0x97fc('0x63')][_0x97fc('0x40')],{'where':{'MailAccountId':_0x1fcb8b['id']}})[_0x97fc('0x25')](function(){return _0x1fcb8b;});}return _0x1fcb8b;})[_0x97fc('0x25')](function(_0x466230){if(_0x466230&&_0x3bceaf[_0x97fc('0x63')]['Smtp']){return db[_0x97fc('0x41')]['update'](_0x3bceaf[_0x97fc('0x63')]['Smtp'],{'where':{'MailAccountId':_0x466230['id']}})[_0x97fc('0x25')](function(){return _0x466230;});}return _0x466230;})[_0x97fc('0x25')](respondWithResult(_0x255345,null))[_0x97fc('0x2e')](handleError(_0x255345,null));};exports[_0x97fc('0x64')]=function(_0x189669,_0x59b3cb){return db[_0x97fc('0x46')][_0x97fc('0x64')]()[_0x97fc('0x25')](respondWithResult(_0x59b3cb,null))[_0x97fc('0x2e')](handleError(_0x59b3cb,null));};exports[_0x97fc('0x65')]=function(_0x2712e7,_0x627214,_0x291408){if(_0x2712e7[_0x97fc('0x63')]['id']){delete _0x2712e7[_0x97fc('0x63')]['id'];}return db[_0x97fc('0x46')][_0x97fc('0x62')]({'where':{'id':_0x2712e7[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x627214,null))[_0x97fc('0x25')](function(_0x4b49d6){if(_0x4b49d6){_0x2712e7[_0x97fc('0x63')][_0x97fc('0x66')]=_0x4b49d6['id'];return db[_0x97fc('0x67')]['create'](_0x2712e7['body']);}})[_0x97fc('0x25')](respondWithResult(_0x627214,null))[_0x97fc('0x2e')](handleError(_0x627214,null));};exports[_0x97fc('0x68')]=function(_0x3fdc2e,_0x50062c,_0x18707a){var _0x567479={'raw':![],'where':{}};var _0x850a93={};var _0x19c7a6={'count':0x0,'rows':[]};return db[_0x97fc('0x46')][_0x97fc('0x69')]({'where':{'id':_0x3fdc2e[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x50062c,null))['then'](function(_0xc15fd1){if(_0xc15fd1){_0x850a93[_0x97fc('0x4a')]=_['keys'](db[_0x97fc('0x67')]['rawAttributes']);_0x850a93[_0x97fc('0x4c')]=_['keys'](_0x3fdc2e[_0x97fc('0x4c')]);_0x850a93[_0x97fc('0x4d')]=_[_0x97fc('0x4e')](_0x850a93['model'],_0x850a93[_0x97fc('0x4c')]);_0x567479[_0x97fc('0x50')]=_['intersection'](_0x850a93['model'],qs[_0x97fc('0x4f')](_0x3fdc2e['query'][_0x97fc('0x4f')]));_0x567479[_0x97fc('0x50')]=_0x567479[_0x97fc('0x50')]['length']?_0x567479[_0x97fc('0x50')]:_0x850a93[_0x97fc('0x4a')];if(!_0x3fdc2e[_0x97fc('0x4c')][_0x97fc('0x51')](_0x97fc('0x6a'))){_0x567479[_0x97fc('0x33')]=qs[_0x97fc('0x33')](_0x3fdc2e[_0x97fc('0x4c')]['limit']);_0x567479[_0x97fc('0x31')]=qs['offset'](_0x3fdc2e[_0x97fc('0x4c')][_0x97fc('0x31')]);}_0x567479['order']=qs[_0x97fc('0x53')](_0x3fdc2e[_0x97fc('0x4c')][_0x97fc('0x53')]);_0x567479['where']=qs[_0x97fc('0x4d')](_['pick'](_0x3fdc2e[_0x97fc('0x4c')],_0x850a93[_0x97fc('0x4d')]));_0x567479['where']['MailAccountId']=_0xc15fd1['id'];if(_0x3fdc2e[_0x97fc('0x4c')][_0x97fc('0x56')]){_0x567479[_0x97fc('0x54')]=_[_0x97fc('0x57')](_0x567479[_0x97fc('0x54')],{'$or':_[_0x97fc('0x45')](_0x567479[_0x97fc('0x50')],function(_0x510b23){var _0x1493d8={};_0x1493d8[_0x510b23]={'$like':'%'+_0x3fdc2e['query'][_0x97fc('0x56')]+'%'};return _0x1493d8;})});}_0x567479=_[_0x97fc('0x57')]({},_0x567479,_0x3fdc2e[_0x97fc('0x59')]);return db[_0x97fc('0x67')][_0x97fc('0x34')]({'where':_0x567479[_0x97fc('0x54')]})[_0x97fc('0x25')](function(_0x3d732a){_0x19c7a6['count']=_0x3d732a;if(_0x3fdc2e[_0x97fc('0x4c')][_0x97fc('0x5a')]){_0x567479[_0x97fc('0x5b')]=[{'all':!![]}];}return db[_0x97fc('0x67')][_0x97fc('0x5c')](_0x567479);})[_0x97fc('0x25')](function(_0xa710da){_0x19c7a6[_0x97fc('0x5d')]=_0xa710da;return _0x19c7a6;});}})['then'](respondWithFilteredResult(_0x50062c,_0x567479))[_0x97fc('0x2e')](handleError(_0x50062c,null));};exports['removeDispositions']=function(_0x116a59,_0x2c5e26,_0x3ccdfb){return db[_0x97fc('0x46')][_0x97fc('0x62')]({'where':{'id':_0x116a59[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x2c5e26,null))[_0x97fc('0x25')](function(_0x3e2584){if(_0x3e2584){return _0x3e2584[_0x97fc('0x6b')](_0x116a59['query'][_0x97fc('0x6c')]);}})[_0x97fc('0x25')](respondWithStatusCode(_0x2c5e26,null))[_0x97fc('0x2e')](handleError(_0x2c5e26,null));};exports[_0x97fc('0x6d')]=function(_0x4c1555,_0x4b1918,_0xa1b617){if(_0x4c1555[_0x97fc('0x63')]['id']){delete _0x4c1555[_0x97fc('0x63')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x4c1555[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x4b1918,null))[_0x97fc('0x25')](function(_0x3ff92e){if(_0x3ff92e){_0x4c1555[_0x97fc('0x63')]['MailAccountId']=_0x3ff92e['id'];return db[_0x97fc('0x6e')][_0x97fc('0x6f')](_0x4c1555['body']);}})['then'](respondWithResult(_0x4b1918,null))['catch'](handleError(_0x4b1918,null));};exports['getAnswers']=function(_0x34fc5f,_0x49dc14,_0x3e8928){var _0x237988={'raw':![],'where':{}};var _0x143966={};var _0x540281={'count':0x0,'rows':[]};return db[_0x97fc('0x46')][_0x97fc('0x69')]({'where':{'id':_0x34fc5f['params']['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x49dc14,null))[_0x97fc('0x25')](function(_0x20fc60){if(_0x20fc60){_0x143966['model']=_[_0x97fc('0x4b')](db['CannedAnswer'][_0x97fc('0x60')]);_0x143966[_0x97fc('0x4c')]=_[_0x97fc('0x4b')](_0x34fc5f[_0x97fc('0x4c')]);_0x143966[_0x97fc('0x4d')]=_[_0x97fc('0x4e')](_0x143966[_0x97fc('0x4a')],_0x143966[_0x97fc('0x4c')]);_0x237988[_0x97fc('0x50')]=_[_0x97fc('0x4e')](_0x143966['model'],qs[_0x97fc('0x4f')](_0x34fc5f[_0x97fc('0x4c')]['fields']));_0x237988['attributes']=_0x237988[_0x97fc('0x50')][_0x97fc('0x61')]?_0x237988[_0x97fc('0x50')]:_0x143966['model'];if(!_0x34fc5f[_0x97fc('0x4c')][_0x97fc('0x51')]('nolimit')){_0x237988[_0x97fc('0x33')]=qs['limit'](_0x34fc5f[_0x97fc('0x4c')][_0x97fc('0x33')]);_0x237988['offset']=qs['offset'](_0x34fc5f[_0x97fc('0x4c')]['offset']);}_0x237988[_0x97fc('0x52')]=qs[_0x97fc('0x53')](_0x34fc5f[_0x97fc('0x4c')][_0x97fc('0x53')]);_0x237988['where']=qs[_0x97fc('0x4d')](_[_0x97fc('0x55')](_0x34fc5f[_0x97fc('0x4c')],_0x143966['filters']));_0x237988[_0x97fc('0x54')][_0x97fc('0x66')]=_0x20fc60['id'];if(_0x34fc5f[_0x97fc('0x4c')][_0x97fc('0x56')]){_0x237988[_0x97fc('0x54')]=_['merge'](_0x237988[_0x97fc('0x54')],{'$or':_[_0x97fc('0x45')](_0x237988['attributes'],function(_0x430b55){var _0xeab2a0={};_0xeab2a0[_0x430b55]={'$like':'%'+_0x34fc5f[_0x97fc('0x4c')]['filter']+'%'};return _0xeab2a0;})});}_0x237988=_[_0x97fc('0x57')]({},_0x237988,_0x34fc5f[_0x97fc('0x59')]);return db[_0x97fc('0x6e')]['count']({'where':_0x237988[_0x97fc('0x54')]})[_0x97fc('0x25')](function(_0x1444b4){_0x540281[_0x97fc('0x34')]=_0x1444b4;if(_0x34fc5f[_0x97fc('0x4c')][_0x97fc('0x5a')]){_0x237988[_0x97fc('0x5b')]=[{'all':!![]}];}return db[_0x97fc('0x6e')][_0x97fc('0x5c')](_0x237988);})[_0x97fc('0x25')](function(_0x36501c){_0x540281[_0x97fc('0x5d')]=_0x36501c;return _0x540281;});}})[_0x97fc('0x25')](respondWithFilteredResult(_0x49dc14,_0x237988))[_0x97fc('0x2e')](handleError(_0x49dc14,null));};exports['removeAnswers']=function(_0x49f2e8,_0x4f8513,_0x4941d3){return db['MailAccount'][_0x97fc('0x62')]({'where':{'id':_0x49f2e8['params']['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x4f8513,null))[_0x97fc('0x25')](function(_0x538feb){if(_0x538feb){return _0x538feb[_0x97fc('0x70')](_0x49f2e8[_0x97fc('0x4c')][_0x97fc('0x6c')]);}})['then'](respondWithStatusCode(_0x4f8513,null))[_0x97fc('0x2e')](handleError(_0x4f8513,null));};exports[_0x97fc('0x6f')]=function(_0x1873c2,_0x3f1043){var _0x145997={'name':_0x1873c2['body'][_0x97fc('0x3c')],'key':_0x1873c2[_0x97fc('0x63')][_0x97fc('0x49')],'email':_0x1873c2['body'][_0x97fc('0x71')],'ListId':_0x1873c2['body']['ListId'],'active':!_[_0x97fc('0x72')](_0x1873c2['body']['active'])?_0x1873c2[_0x97fc('0x63')]['active']:!![],'description':_0x1873c2[_0x97fc('0x63')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0x97fc('0x72')](_0x1873c2[_0x97fc('0x63')][_0x97fc('0x73')])){if(_0x1873c2['body'][_0x97fc('0x74')]){_0x145997[_0x97fc('0x40')][_0x97fc('0x75')]=_0x145997[_0x97fc('0x42')][_0x97fc('0x75')]=_0x1873c2[_0x97fc('0x63')]['cuser'];_0x145997[_0x97fc('0x40')]['password']=_0x145997[_0x97fc('0x42')][_0x97fc('0x76')]=_0x1873c2[_0x97fc('0x63')][_0x97fc('0x77')];}else{_0x145997[_0x97fc('0x40')][_0x97fc('0x78')]=_0x145997[_0x97fc('0x42')][_0x97fc('0x78')]=![];}_0x145997[_0x97fc('0x40')][_0x97fc('0x79')]=_0x1873c2[_0x97fc('0x63')][_0x97fc('0x40')][_0x97fc('0x79')];_0x145997[_0x97fc('0x40')][_0x97fc('0x7a')]=_0x1873c2[_0x97fc('0x63')][_0x97fc('0x40')][_0x97fc('0x7a')];_0x145997['Smtp'][_0x97fc('0x79')]=_0x1873c2[_0x97fc('0x63')][_0x97fc('0x42')][_0x97fc('0x79')];_0x145997[_0x97fc('0x42')][_0x97fc('0x7a')]=_0x1873c2[_0x97fc('0x63')][_0x97fc('0x42')][_0x97fc('0x7a')];}else{_0x145997[_0x97fc('0x40')]['service']=_0x145997[_0x97fc('0x42')]['service']=_0x1873c2[_0x97fc('0x63')]['cservice'];_0x145997[_0x97fc('0x40')]['user']=_0x145997[_0x97fc('0x42')][_0x97fc('0x75')]=_0x1873c2[_0x97fc('0x63')][_0x97fc('0x7b')];_0x145997[_0x97fc('0x40')][_0x97fc('0x7c')]=_0x145997[_0x97fc('0x42')]['pass']=_0x1873c2['body'][_0x97fc('0x77')];}return db[_0x97fc('0x46')]['create'](_0x145997,{'include':[{'model':db[_0x97fc('0x41')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x97fc('0x40')}]})[_0x97fc('0x25')](function(_0x2fa420){var _0x2ff9da=_0x1873c2['user'][_0x97fc('0x7d')]({'plain':!![]});if(!_0x2ff9da)throw new Error(_0x97fc('0x7e'));if(_0x2ff9da[_0x97fc('0x7f')]==='user'){var _0x5efa3b=_0x2fa420[_0x97fc('0x7d')]({'plain':!![]});return db[_0x97fc('0x80')][_0x97fc('0x62')]({'where':{'name':_0x97fc('0x39'),'userProfileId':_0x2ff9da[_0x97fc('0x81')]},'raw':!![]})[_0x97fc('0x25')](function(_0x639297){if(_0x639297&&_0x639297[_0x97fc('0x82')]===0x0){return db[_0x97fc('0x3a')][_0x97fc('0x6f')]({'name':_0x5efa3b[_0x97fc('0x3c')],'resourceId':_0x5efa3b['id'],'type':_0x639297['name'],'sectionId':_0x639297['id']},{})['then'](function(){return _0x2fa420;});}else{return _0x2fa420;}})[_0x97fc('0x2e')](function(_0x5deddc){logger[_0x97fc('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5deddc);throw _0x5deddc;});}return _0x2fa420;})['then'](respondWithResult(_0x3f1043,0xc9))[_0x97fc('0x2e')](handleError(_0x3f1043,null));};exports['getImap']=function(_0x29f2e8,_0x391c84,_0x1bbae3){return db[_0x97fc('0x46')][_0x97fc('0x69')]({'where':{'id':_0x29f2e8['params']['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x391c84,null))[_0x97fc('0x25')](function(_0x221214){if(_0x221214){return _0x221214[_0x97fc('0x83')]();}return null;})['then'](respondWithResult(_0x391c84,null))[_0x97fc('0x2e')](handleError(_0x391c84,null));};exports[_0x97fc('0x84')]=function(_0x968b3c,_0x1b32a8,_0x2cf525){if(_0x968b3c[_0x97fc('0x63')]['id']){delete _0x968b3c[_0x97fc('0x63')]['id'];}return db[_0x97fc('0x46')]['find']({'where':{'id':_0x968b3c[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x1b32a8,null))[_0x97fc('0x25')](function(_0x9905f){if(_0x9905f){_0x968b3c[_0x97fc('0x63')][_0x97fc('0x66')]=_0x9905f['id'];return db['MailServerIn']['create'](_0x968b3c['body']);}})[_0x97fc('0x25')](respondWithResult(_0x1b32a8,null))['catch'](handleError(_0x1b32a8,null));};exports[_0x97fc('0x85')]=function(_0x5b05ff,_0x2efca8,_0x2a2ef0){return db[_0x97fc('0x46')]['findOne']({'where':{'id':_0x5b05ff[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x2efca8,null))[_0x97fc('0x25')](function(_0x28e75f){if(_0x28e75f){return _0x28e75f['setImap'](null);}return null;})[_0x97fc('0x25')](respondWithStatusCode(_0x2efca8,null))['catch'](handleError(_0x2efca8,null));};exports[_0x97fc('0x86')]=function(_0x5538d8,_0x68cfe3,_0xf59a2b){return db['MailAccount']['findOne']({'where':{'id':_0x5538d8[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x68cfe3,null))[_0x97fc('0x25')](function(_0x7ebdb1){if(_0x7ebdb1){return _0x7ebdb1[_0x97fc('0x86')]();}return null;})[_0x97fc('0x25')](respondWithResult(_0x68cfe3,null))['catch'](handleError(_0x68cfe3,null));};exports[_0x97fc('0x87')]=function(_0x5a646a,_0x5db0e7,_0x169f58){if(_0x5a646a[_0x97fc('0x63')]['id']){delete _0x5a646a[_0x97fc('0x63')]['id'];}return db[_0x97fc('0x46')][_0x97fc('0x62')]({'where':{'id':_0x5a646a[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x5db0e7,null))[_0x97fc('0x25')](function(_0x1356d6){if(_0x1356d6){_0x5a646a[_0x97fc('0x63')]['MailAccountId']=_0x1356d6['id'];return db['MailServerOut'][_0x97fc('0x6f')](_0x5a646a[_0x97fc('0x63')]);}})[_0x97fc('0x25')](respondWithResult(_0x5db0e7,null))[_0x97fc('0x2e')](handleError(_0x5db0e7,null));};exports[_0x97fc('0x88')]=function(_0x4c6479,_0xcc1440,_0x2884f4){return db[_0x97fc('0x46')]['findOne']({'where':{'id':_0x4c6479['params']['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0xcc1440,null))['then'](function(_0x35956b){if(_0x35956b){return _0x35956b[_0x97fc('0x89')](null);}return null;})[_0x97fc('0x25')](respondWithStatusCode(_0xcc1440,null))['catch'](handleError(_0xcc1440,null));};exports['addInteraction']=function(_0x5651f0,_0x38e49e,_0x4d4e7b){return db[_0x97fc('0x8a')]['find']({'where':{'id':_0x5651f0[_0x97fc('0x5f')]['id']}})['then'](handleEntityNotFound(_0x38e49e,null))[_0x97fc('0x25')](function(_0x5f3db2){if(_0x5f3db2){return _0x5f3db2[_0x97fc('0x8b')](_0x5651f0[_0x97fc('0x63')][_0x97fc('0x6c')],_['omit'](_0x5651f0[_0x97fc('0x63')],[_0x97fc('0x6c'),'id'])||{});}})[_0x97fc('0x25')](respondWithResult(_0x38e49e,null))[_0x97fc('0x2e')](handleError(_0x38e49e,null));};exports['getInteractions']=function(_0x6ef629,_0x1b8dac,_0xc95d6b){var _0x516ac0={'raw':![],'where':{}};var _0x241af0={};var _0x3528db={'count':0x0,'rows':[]};return db[_0x97fc('0x46')]['findOne']({'where':{'id':_0x6ef629[_0x97fc('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1b8dac,null))['then'](function(_0x15ffb0){if(_0x15ffb0){_0x241af0[_0x97fc('0x4a')]=_[_0x97fc('0x4b')](db[_0x97fc('0x8a')]['rawAttributes']);_0x241af0[_0x97fc('0x4c')]=_[_0x97fc('0x4b')](_0x6ef629['query']);_0x241af0[_0x97fc('0x4d')]=_[_0x97fc('0x4e')](_0x241af0[_0x97fc('0x4a')],_0x241af0[_0x97fc('0x4c')]);_0x516ac0[_0x97fc('0x50')]=_[_0x97fc('0x4e')](_0x241af0['model'],qs[_0x97fc('0x4f')](_0x6ef629[_0x97fc('0x4c')]['fields']));_0x516ac0[_0x97fc('0x50')]=_0x516ac0[_0x97fc('0x50')][_0x97fc('0x61')]?_0x516ac0['attributes']:_0x241af0[_0x97fc('0x4a')];if(!_0x6ef629['query'][_0x97fc('0x51')](_0x97fc('0x6a'))){_0x516ac0[_0x97fc('0x33')]=qs['limit'](_0x6ef629[_0x97fc('0x4c')][_0x97fc('0x33')]);_0x516ac0['offset']=qs[_0x97fc('0x31')](_0x6ef629[_0x97fc('0x4c')]['offset']);}_0x516ac0['order']=qs[_0x97fc('0x53')](_0x6ef629[_0x97fc('0x4c')][_0x97fc('0x53')]);_0x516ac0[_0x97fc('0x54')]=qs[_0x97fc('0x4d')](_['pick'](_0x6ef629['query'],_0x241af0[_0x97fc('0x4d')]));_0x516ac0[_0x97fc('0x54')][_0x97fc('0x66')]=_0x15ffb0['id'];if(_0x6ef629[_0x97fc('0x4c')][_0x97fc('0x56')]){_0x516ac0['where']=_[_0x97fc('0x57')](_0x516ac0[_0x97fc('0x54')],{'$or':_[_0x97fc('0x45')](_0x516ac0['attributes'],function(_0x39e023){var _0x163860={};_0x163860[_0x39e023]={'$like':'%'+_0x6ef629[_0x97fc('0x4c')][_0x97fc('0x56')]+'%'};return _0x163860;})});}_0x516ac0=_['merge']({},_0x516ac0,_0x6ef629[_0x97fc('0x59')]);return db[_0x97fc('0x8a')][_0x97fc('0x34')]({'where':_0x516ac0[_0x97fc('0x54')]})[_0x97fc('0x25')](function(_0x4b37c6){_0x3528db[_0x97fc('0x34')]=_0x4b37c6;if(_0x6ef629['query'][_0x97fc('0x5a')]){_0x516ac0[_0x97fc('0x5b')]=[{'model':db[_0x97fc('0x8c')],'as':_0x97fc('0x8d'),'required':![]},{'model':db['User'],'as':_0x97fc('0x8e'),'attributes':[_0x97fc('0x3c'),'fullname','internal'],'required':![]},{'model':db[_0x97fc('0x8f')],'as':_0x97fc('0x90'),'attributes':['id',_0x97fc('0x3c'),'color'],'where':_0x6ef629['query'][_0x97fc('0x91')]?{'id':_0x6ef629[_0x97fc('0x4c')][_0x97fc('0x91')]}:undefined,'required':_0x6ef629[_0x97fc('0x4c')][_0x97fc('0x91')]?!![]:![]}];}return db[_0x97fc('0x8a')][_0x97fc('0x5c')](_0x516ac0);})[_0x97fc('0x25')](function(_0x34ba6e){_0x3528db[_0x97fc('0x5d')]=_0x34ba6e;return _0x3528db;});}})['then'](respondWithFilteredResult(_0x1b8dac,_0x516ac0))[_0x97fc('0x2e')](handleError(_0x1b8dac,null));};exports['addApplications']=function(_0x4b900b,_0x183d63,_0x495097){return db[_0x97fc('0x46')][_0x97fc('0x69')]({'where':{'id':_0x4b900b[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x183d63,null))[_0x97fc('0x25')](function(_0x5d0cff){if(_0x5d0cff){return db[_0x97fc('0x92')][_0x97fc('0x93')](function(_0x2d1760){return db[_0x97fc('0x94')][_0x97fc('0x38')]({'where':{'MailAccountId':_0x4b900b['params']['id']},'transaction':_0x2d1760})[_0x97fc('0x25')](function(_0x4f5be3){var _0xe6e56c=_[_0x97fc('0x45')](_0x4b900b['body'],function(_0x523ea8){_0x523ea8['MailAccountId']=_0x4b900b[_0x97fc('0x5f')]['id'];return _0x523ea8;});return db['MailApplication'][_0x97fc('0x95')](_0xe6e56c,{'transaction':_0x2d1760});});})['then'](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x4b900b[_0x97fc('0x5f')]['id']},'order':_0x97fc('0x96')});});}})[_0x97fc('0x25')](respondWithResult(_0x183d63,null))[_0x97fc('0x2e')](handleError(_0x183d63,null));};exports['getApplications']=function(_0x510487,_0x303e40,_0x55f2e7){var _0x272a34={};var _0x2ba232={};var _0x416289;var _0x1b2aa3;return db[_0x97fc('0x46')][_0x97fc('0x69')]({'where':{'id':_0x510487['params']['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x303e40,null))[_0x97fc('0x25')](function(_0x102d68){if(_0x102d68){_0x416289=_0x102d68;_0x2ba232[_0x97fc('0x4a')]=_['keys'](db['MailApplication']['rawAttributes']);_0x2ba232[_0x97fc('0x4c')]=_[_0x97fc('0x4b')](_0x510487[_0x97fc('0x4c')]);_0x2ba232['filters']=_[_0x97fc('0x4e')](_0x2ba232[_0x97fc('0x4a')],_0x2ba232['query']);_0x272a34[_0x97fc('0x50')]=_[_0x97fc('0x4e')](_0x2ba232['model'],qs['fields'](_0x510487[_0x97fc('0x4c')][_0x97fc('0x4f')]));_0x272a34[_0x97fc('0x50')]=_0x272a34[_0x97fc('0x50')][_0x97fc('0x61')]?_0x272a34[_0x97fc('0x50')]:_0x2ba232['model'];_0x272a34[_0x97fc('0x52')]=qs[_0x97fc('0x53')](_0x510487['query'][_0x97fc('0x53')]);_0x272a34[_0x97fc('0x54')]=qs[_0x97fc('0x4d')](_[_0x97fc('0x55')](_0x510487[_0x97fc('0x4c')],_0x2ba232[_0x97fc('0x4d')]));if(_0x510487[_0x97fc('0x4c')]['filter']){_0x272a34['where']=_[_0x97fc('0x57')](_0x272a34[_0x97fc('0x54')],{'$or':_[_0x97fc('0x45')](_0x272a34[_0x97fc('0x50')],function(_0x4368f5){var _0x29d292={};_0x29d292[_0x4368f5]={'$like':'%'+_0x510487[_0x97fc('0x4c')]['filter']+'%'};return _0x29d292;})});}_0x272a34=_[_0x97fc('0x57')]({},_0x272a34,_0x510487[_0x97fc('0x59')]);return _0x416289['getApplications'](_0x272a34);}})['then'](function(_0x3f0042){if(_0x3f0042){_0x1b2aa3=_0x3f0042['length'];if(!_0x510487[_0x97fc('0x4c')][_0x97fc('0x51')]('nolimit')){_0x272a34[_0x97fc('0x33')]=qs[_0x97fc('0x33')](_0x510487[_0x97fc('0x4c')][_0x97fc('0x33')]);_0x272a34[_0x97fc('0x31')]=qs['offset'](_0x510487[_0x97fc('0x4c')]['offset']);}return _0x416289[_0x97fc('0x97')](_0x272a34);}})[_0x97fc('0x25')](function(_0x5357ee){if(_0x5357ee){return _0x5357ee?{'count':_0x1b2aa3,'rows':_0x5357ee}:null;}})[_0x97fc('0x25')](respondWithResult(_0x303e40,null))[_0x97fc('0x2e')](handleError(_0x303e40,null));};exports[_0x97fc('0x98')]=function(_0x184dff,_0x584a5b,_0xca87ab){var _0x362974={'raw':!![],'where':{}};var _0x762151={};var _0x374a2e={'count':0x0,'rows':[]};return db[_0x97fc('0x46')][_0x97fc('0x69')]({'where':{'id':_0x184dff[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x584a5b,null))[_0x97fc('0x25')](function(_0x3b3215){if(_0x3b3215){_0x762151[_0x97fc('0x4a')]=_[_0x97fc('0x4b')](db['MailMessage'][_0x97fc('0x60')]);_0x762151[_0x97fc('0x4c')]=_[_0x97fc('0x4b')](_0x184dff[_0x97fc('0x4c')]);_0x762151[_0x97fc('0x4d')]=_[_0x97fc('0x4e')](_0x762151['model'],_0x762151[_0x97fc('0x4c')]);_0x362974[_0x97fc('0x50')]=_['intersection'](_0x762151[_0x97fc('0x4a')],qs[_0x97fc('0x4f')](_0x184dff[_0x97fc('0x4c')]['fields']));_0x362974['attributes']=_0x362974[_0x97fc('0x50')]['length']?_0x362974[_0x97fc('0x50')]:_0x762151[_0x97fc('0x4a')];if(!_0x184dff[_0x97fc('0x4c')][_0x97fc('0x51')](_0x97fc('0x6a'))){_0x362974[_0x97fc('0x33')]=qs[_0x97fc('0x33')](_0x184dff[_0x97fc('0x4c')][_0x97fc('0x33')]);_0x362974[_0x97fc('0x31')]=qs[_0x97fc('0x31')](_0x184dff[_0x97fc('0x4c')][_0x97fc('0x31')]);}_0x362974[_0x97fc('0x52')]=qs['sort'](_0x184dff[_0x97fc('0x4c')]['sort']);_0x362974[_0x97fc('0x54')]=qs['filters'](_[_0x97fc('0x55')](_0x184dff[_0x97fc('0x4c')],_0x762151['filters']));_0x362974[_0x97fc('0x54')][_0x97fc('0x66')]=_0x3b3215['id'];if(_0x184dff[_0x97fc('0x4c')][_0x97fc('0x56')]){_0x362974[_0x97fc('0x54')]=_[_0x97fc('0x57')](_0x362974[_0x97fc('0x54')],{'$or':_[_0x97fc('0x45')](_0x362974[_0x97fc('0x50')],function(_0x7890b8){var _0x316025={};_0x316025[_0x7890b8]={'$like':'%'+_0x184dff[_0x97fc('0x4c')][_0x97fc('0x56')]+'%'};return _0x316025;})});}if(_0x184dff[_0x97fc('0x4c')]['$gte']){var _0x1da083=_0x184dff[_0x97fc('0x4c')][_0x97fc('0x99')][_0x97fc('0x9a')](',');var _0x2d1896={};_0x2d1896[_0x1da083[0x0]]={'$gte':moment(_0x1da083[0x1])['format'](_0x97fc('0x9b'))};_0x362974['where']=_[_0x97fc('0x57')](_0x362974[_0x97fc('0x54')],_0x2d1896);}_0x362974=_[_0x97fc('0x57')]({},_0x362974,_0x184dff['options']);return db[_0x97fc('0x9c')][_0x97fc('0x34')]({'where':_0x362974[_0x97fc('0x54')]})[_0x97fc('0x25')](function(_0x4feecd){_0x374a2e['count']=_0x4feecd;if(_0x184dff[_0x97fc('0x4c')][_0x97fc('0x5a')]){_0x362974[_0x97fc('0x5b')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x362974);})[_0x97fc('0x25')](function(_0x15a886){if(_0x184dff['query'][_0x97fc('0x9d')]===_0x97fc('0x9e')){for(var _0x5f4304=0x0;_0x5f4304<_0x15a886[_0x97fc('0x61')];_0x5f4304++){_0x15a886[_0x5f4304][_0x97fc('0x63')]=juice(_0x15a886[_0x5f4304][_0x97fc('0x63')]);}}_0x374a2e[_0x97fc('0x5d')]=_0x15a886;return _0x374a2e;});}})[_0x97fc('0x25')](respondWithFilteredResult(_0x584a5b,_0x362974))['catch'](handleError(_0x584a5b,null));};exports['send']=function(_0x19ab53,_0x50fb22,_0xcd097a){var _0x183d97,_0x39ad82={},_0x38b598;if(_0x19ab53['body']['to']){_0x38b598=_0x19ab53[_0x97fc('0x63')]['to']['split'](',')[0x0];}return db[_0x97fc('0x46')][_0x97fc('0x62')]({'where':{'id':_0x19ab53[_0x97fc('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0x97fc('0x9f'),'include':[{'model':db['CmContact'],'as':_0x97fc('0xa0'),'where':{'email':_0x38b598},'limit':0x1,'order':[[_0x97fc('0xa1'),_0x97fc('0xa2')]]}]},{'model':db[_0x97fc('0x41')],'as':'Smtp','raw':!![]}]})[_0x97fc('0x25')](handleEntityNotFound(_0x50fb22,null))[_0x97fc('0x25')](function(_0x3d312c){if(_0x3d312c){_0x183d97=_0x3d312c;if(_0x3d312c['Smtp']){if(_[_0x97fc('0x72')](_0x19ab53[_0x97fc('0x63')][_0x97fc('0xa3')])){_0x19ab53[_0x97fc('0x63')]['from']=util['format']('%s\x20<%s>',_0x3d312c[_0x97fc('0x3c')],_0x3d312c['email']||_0x3d312c[_0x97fc('0x42')][_0x97fc('0x75')]);}if(_0x19ab53['body'][_0x97fc('0xa4')]&&_0x19ab53[_0x97fc('0x63')][_0x97fc('0xa4')]['length']){for(var _0x73b929=0x0;_0x73b929<_0x19ab53[_0x97fc('0x63')][_0x97fc('0xa4')]['length'];_0x73b929+=0x1){_0x19ab53[_0x97fc('0x63')]['attachments'][_0x73b929]={'filename':_0x19ab53[_0x97fc('0x63')][_0x97fc('0xa4')][_0x73b929][_0x97fc('0x3c')],'path':path[_0x97fc('0xa5')](config[_0x97fc('0xa6')],'server/files/attachments',_0x19ab53[_0x97fc('0x63')][_0x97fc('0xa4')][_0x73b929][_0x97fc('0xa7')])};}}var _0xa25617={'tls':{'rejectUnauthorized':![]}};if(_[_0x97fc('0x72')](_0x3d312c['Smtp'][_0x97fc('0xa8')])){if(_0x3d312c[_0x97fc('0x42')][_0x97fc('0x78')]){_0xa25617[_0x97fc('0xa9')]={'user':_0x3d312c['Smtp'][_0x97fc('0x75')],'pass':_0x3d312c[_0x97fc('0x42')][_0x97fc('0x76')]};}_0xa25617[_0x97fc('0x79')]=_0x3d312c[_0x97fc('0x42')][_0x97fc('0x79')];_0xa25617[_0x97fc('0x7a')]=_0x3d312c[_0x97fc('0x42')][_0x97fc('0x7a')];_0xa25617['secure']=_0x3d312c[_0x97fc('0x42')]['secure'];}else{_0xa25617[_0x97fc('0xa8')]=_0x3d312c[_0x97fc('0x42')]['service'];_0xa25617['auth']={'user':_0x3d312c[_0x97fc('0x42')][_0x97fc('0x75')],'pass':_0x3d312c[_0x97fc('0x42')][_0x97fc('0x76')]};}return respondWithRpcPromise('SendMail',_0x97fc('0xaa'),{'account':_0xa25617,'message':_0x19ab53[_0x97fc('0x63')]});}else{throw new Error(_0x97fc('0xab'));}}})[_0x97fc('0x25')](function(_0x12d05d){if(_0x12d05d){_0x39ad82=_0x12d05d;if(_0x183d97[_0x97fc('0x9f')]){if(_0x183d97[_0x97fc('0x9f')][_0x97fc('0xa0')][_0x97fc('0x61')]){return _0x183d97[_0x97fc('0x9f')][_0x97fc('0xa0')][0x0];}else{return db[_0x97fc('0x8c')][_0x97fc('0x6f')](_[_0x97fc('0x1e')](_0x19ab53[_0x97fc('0x63')],{'firstName':_0x19ab53[_0x97fc('0x63')]['to'],'email':_0x19ab53['body']['to'],'phone':_0x19ab53[_0x97fc('0x63')]['to'],'ListId':_0x183d97[_0x97fc('0xac')]}));}}else{throw new Error(_0x97fc('0xab'));}}})[_0x97fc('0x25')](function(_0x548050){if(_0x548050){var _0x5114e3={'UserId':_0x19ab53[_0x97fc('0x75')]['id'],'ContactId':_0x548050['id'],'MailAccountId':_0x183d97['id'],'inReplyTo':_0x39ad82['messageId'],'to':_0x19ab53[_0x97fc('0x63')]['from'],'cc':_0x19ab53[_0x97fc('0x63')]['cc'],'subject':_0x19ab53[_0x97fc('0x63')]['subject'],'attach':_0x19ab53['body'][_0x97fc('0xad')],'firstMsgDirection':_0x97fc('0xae'),'lastMsgAt':moment()[_0x97fc('0xaf')](_0x97fc('0x9b')),'lastMsgDirection':_0x97fc('0xae'),'Messages':[_['merge'](_0x19ab53[_0x97fc('0x63')],{'messageId':_0x39ad82[_0x97fc('0xb0')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x183d97['id'],'UserId':_0x19ab53[_0x97fc('0x75')]['id'],'ContactId':_0x548050['id']})]};if(_0x19ab53[_0x97fc('0x63')][_0x97fc('0xb1')]){_0x5114e3=_[_0x97fc('0x57')](_0x5114e3,_0x19ab53[_0x97fc('0x63')]['Interaction']);}return db[_0x97fc('0x8a')]['create'](_0x5114e3,{'include':[{'model':db['MailMessage'],'as':_0x97fc('0xb2')}]});}})[_0x97fc('0x25')](respondWithResult(_0x50fb22,null))[_0x97fc('0x2e')](handleError(_0x50fb22,null));};exports['verifySmtp']=function(_0x28ebf8,_0x43a6cb,_0x349439){return db[_0x97fc('0x46')][_0x97fc('0x62')]({'where':{'id':_0x28ebf8[_0x97fc('0x5f')]['id']},'include':[{'model':db[_0x97fc('0x41')],'as':_0x97fc('0x42'),'raw':!![]}]})[_0x97fc('0x25')](handleEntityNotFound(_0x43a6cb,null))[_0x97fc('0x25')](function(_0x45703d){if(_0x45703d&&_0x45703d[_0x97fc('0x42')]){var _0x5208b5={'id':_0x45703d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x45703d['Smtp'][_0x97fc('0xa8')]){_0x5208b5['service']=_0x45703d[_0x97fc('0x42')][_0x97fc('0xa8')];}else{_0x5208b5['host']=_0x45703d['Smtp'][_0x97fc('0x79')];_0x5208b5['port']=_0x45703d['Smtp'][_0x97fc('0x7a')];_0x5208b5[_0x97fc('0xb3')]=_0x45703d[_0x97fc('0x42')][_0x97fc('0xb3')];}if(_0x45703d[_0x97fc('0x42')][_0x97fc('0x78')]){_0x5208b5[_0x97fc('0xa9')]={'user':_0x45703d[_0x97fc('0x42')][_0x97fc('0x75')],'pass':_0x45703d[_0x97fc('0x42')][_0x97fc('0x76')]};}return respondWithRpcPromise('VerifySmtp',_0x97fc('0xb4'),{'account':_0x5208b5});}})[_0x97fc('0x25')](respondWithResult(_0x43a6cb,null))[_0x97fc('0x2e')](handleError(_0x43a6cb,null));};exports[_0x97fc('0x38')]=function(_0x3ca1f2,_0x3bd948){return db['MailAccount'][_0x97fc('0x62')]({'where':{'id':_0x3ca1f2[_0x97fc('0x5f')]['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x3bd948,null))['then'](function(_0x8289c5){if(_0x8289c5&&_0x8289c5[_0x97fc('0xa8')]){throw new db[(_0x97fc('0xb5'))][(_0x97fc('0xb6'))](_0x97fc('0xb7'));}return _0x8289c5;})['then'](removeEntity(_0x3bd948,null))[_0x97fc('0x2e')](handleError(_0x3bd948,null));};exports[_0x97fc('0xb8')]=function(_0x36aec7,_0x259890,_0x1e254a){return db[_0x97fc('0x46')][_0x97fc('0x62')]({'where':{'id':_0x36aec7['params']['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x259890,null))[_0x97fc('0x25')](function(_0x1dc5b2){if(_0x1dc5b2){return _0x1dc5b2[_0x97fc('0xb8')](_0x36aec7[_0x97fc('0x63')][_0x97fc('0x6c')],_[_0x97fc('0xb9')](_0x36aec7['body'],[_0x97fc('0x6c'),'id'])||{})[_0x97fc('0xba')](function(_0x4692d8){for(var _0x160341=0x0;_0x160341<_0x36aec7[_0x97fc('0x63')][_0x97fc('0x6c')][_0x97fc('0x61')];_0x160341+=0x1){socket[_0x97fc('0xbb')]('userMailAccount:save',{'UserId':Number(_0x36aec7[_0x97fc('0x63')][_0x97fc('0x6c')][_0x160341]),'MailAccountId':Number(_0x36aec7[_0x97fc('0x5f')]['id'])});}return _0x4692d8;});}})['then'](respondWithResult(_0x259890,null))['catch'](handleError(_0x259890,null));};exports[_0x97fc('0xbc')]=function(_0x580124,_0xe1846e,_0x1ddda4){return db['MailAccount'][_0x97fc('0x62')]({'where':{'id':_0x580124['params']['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0xe1846e,null))[_0x97fc('0x25')](function(_0x523001){if(_0x523001){return _0x523001[_0x97fc('0xbc')](_0x580124['query']['ids'])[_0x97fc('0x25')](function(){if(_[_0x97fc('0xbd')](_0x580124[_0x97fc('0x4c')]['ids'])){for(var _0x16fe7e=0x0;_0x16fe7e<_0x580124[_0x97fc('0x4c')][_0x97fc('0x6c')][_0x97fc('0x61')];_0x16fe7e+=0x1){socket[_0x97fc('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x580124[_0x97fc('0x4c')][_0x97fc('0x6c')][_0x16fe7e]),'MailAccountId':Number(_0x580124['params']['id'])});}}else{socket[_0x97fc('0xbb')](_0x97fc('0xbe'),{'UserId':Number(_0x580124[_0x97fc('0x4c')][_0x97fc('0x6c')]),'MailAccountId':Number(_0x580124[_0x97fc('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0xe1846e,null))['catch'](handleError(_0xe1846e,null));};exports[_0x97fc('0xbf')]=function(_0x513e7f,_0x5913e5,_0xd3a5cf){var _0x5f46d3={};var _0x5659e9={};var _0x48d876;var _0x1769db;return db[_0x97fc('0x46')][_0x97fc('0x69')]({'where':{'id':_0x513e7f['params']['id']}})[_0x97fc('0x25')](handleEntityNotFound(_0x5913e5,null))[_0x97fc('0x25')](function(_0x392d9a){if(_0x392d9a){_0x48d876=_0x392d9a;_0x5659e9[_0x97fc('0x4a')]=_['keys'](db['User'][_0x97fc('0x60')]);_0x5659e9[_0x97fc('0x4c')]=_['keys'](_0x513e7f[_0x97fc('0x4c')]);_0x5659e9[_0x97fc('0x4d')]=_[_0x97fc('0x4e')](_0x5659e9[_0x97fc('0x4a')],_0x5659e9[_0x97fc('0x4c')]);_0x5f46d3[_0x97fc('0x50')]=_[_0x97fc('0x4e')](_0x5659e9[_0x97fc('0x4a')],qs[_0x97fc('0x4f')](_0x513e7f['query']['fields']));_0x5f46d3[_0x97fc('0x50')]=_0x5f46d3[_0x97fc('0x50')]['length']?_0x5f46d3[_0x97fc('0x50')]:_0x5659e9['model'];_0x5f46d3['order']=qs[_0x97fc('0x53')](_0x513e7f[_0x97fc('0x4c')][_0x97fc('0x53')]);_0x5f46d3[_0x97fc('0x54')]=qs[_0x97fc('0x4d')](_['pick'](_0x513e7f[_0x97fc('0x4c')],_0x5659e9[_0x97fc('0x4d')]));if(_0x513e7f[_0x97fc('0x4c')][_0x97fc('0x56')]){_0x5f46d3[_0x97fc('0x54')]=_['merge'](_0x5f46d3[_0x97fc('0x54')],{'$or':_['map'](_0x5f46d3[_0x97fc('0x50')],function(_0x4c4156){var _0x577fc7={};_0x577fc7[_0x4c4156]={'$like':'%'+_0x513e7f[_0x97fc('0x4c')]['filter']+'%'};return _0x577fc7;})});}_0x5f46d3=_[_0x97fc('0x57')]({},_0x5f46d3,_0x513e7f['options']);return _0x48d876[_0x97fc('0xbf')](_0x5f46d3);}})['then'](function(_0x290462){if(_0x290462){_0x1769db=_0x290462['length'];if(!_0x513e7f[_0x97fc('0x4c')]['hasOwnProperty'](_0x97fc('0x6a'))){_0x5f46d3[_0x97fc('0x33')]=qs[_0x97fc('0x33')](_0x513e7f['query'][_0x97fc('0x33')]);_0x5f46d3[_0x97fc('0x31')]=qs[_0x97fc('0x31')](_0x513e7f['query'][_0x97fc('0x31')]);}return _0x48d876[_0x97fc('0xbf')](_0x5f46d3);}})[_0x97fc('0x25')](function(_0x1d363d){if(_0x1d363d){return _0x1d363d?{'count':_0x1769db,'rows':_0x1d363d}:null;}})[_0x97fc('0x25')](respondWithResult(_0x5913e5,null))[_0x97fc('0x2e')](handleError(_0x5913e5,null));};
\ No newline at end of file
index 211aaef..239722c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e50=['events','../../mysqldb','MailAccount','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2fa176,_0x25000d){var _0x20bb92=function(_0x5a215f){while(--_0x5a215f){_0x2fa176['push'](_0x2fa176['shift']());}};_0x20bb92(++_0x25000d);}(_0x0e50,0x168));var _0x00e5=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x0e50[_0x599f41];return _0x2e4d58;};'use strict';var EventEmitter=require(_0x00e5('0x0'));var MailAccount=require(_0x00e5('0x1'))['db'][_0x00e5('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x00e5('0x3'),'afterUpdate':_0x00e5('0x4'),'afterDestroy':_0x00e5('0x5')};function emitEvent(_0x12c933){return function(_0x3d2263,_0x4f38ad,_0x203d0e){MailAccountEvents['emit'](_0x12c933+':'+_0x3d2263['id'],_0x3d2263);MailAccountEvents[_0x00e5('0x6')](_0x12c933,_0x3d2263);_0x203d0e(null);};}for(var e in events){if(events[_0x00e5('0x7')](e)){var event=events[e];MailAccount[_0x00e5('0x8')](e,emitEvent(event));}}module[_0x00e5('0x9')]=MailAccountEvents;
\ No newline at end of file
+var _0xef56=['exports','setMaxListeners','update','remove','emit','hook'];(function(_0x2d4f6f,_0x4c2044){var _0x2d4083=function(_0x5b982a){while(--_0x5b982a){_0x2d4f6f['push'](_0x2d4f6f['shift']());}};_0x2d4083(++_0x4c2044);}(_0xef56,0x103));var _0x6ef5=function(_0x5db657,_0x2f40b3){_0x5db657=_0x5db657-0x0;var _0x2d6e70=_0xef56[_0x5db657];return _0x2d6e70;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6ef5('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ef5('0x1'),'afterDestroy':_0x6ef5('0x2')};function emitEvent(_0x379c5e){return function(_0x4d849c,_0x48ca2d,_0x1e6d88){MailAccountEvents[_0x6ef5('0x3')](_0x379c5e+':'+_0x4d849c['id'],_0x4d849c);MailAccountEvents[_0x6ef5('0x3')](_0x379c5e,_0x4d849c);_0x1e6d88(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x6ef5('0x4')](e,emitEvent(event));}}module[_0x6ef5('0x5')]=MailAccountEvents;
\ No newline at end of file
index 645dc7d..22a7d20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec13=['rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount','mail_accounts','util','../../config/logger','bluebird','request-promise'];(function(_0x5a1d58,_0x42ab8d){var _0x5911a9=function(_0x3769a4){while(--_0x3769a4){_0x5a1d58['push'](_0x5a1d58['shift']());}};_0x5911a9(++_0x42ab8d);}(_0xec13,0x128));var _0x3ec1=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xec13[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x3ec1('0x0'));var logger=require(_0x3ec1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3ec1('0x2'));var rp=require(_0x3ec1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ec1('0x4'));var config=require(_0x3ec1('0x5'));var attributes=require(_0x3ec1('0x6'));module['exports']=function(_0x42af12,_0x17826a){return _0x42af12[_0x3ec1('0x7')](_0x3ec1('0x8'),attributes,{'tableName':_0x3ec1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7cdd=['mail_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailAccount.attributes','define','MailAccount'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7cdd,0x112));var _0xd7cd=function(_0x22f04b,_0x1c39d3){_0x22f04b=_0x22f04b-0x0;var _0x2aafc3=_0x7cdd[_0x22f04b];return _0x2aafc3;};'use strict';var _=require(_0xd7cd('0x0'));var util=require(_0xd7cd('0x1'));var logger=require(_0xd7cd('0x2'))(_0xd7cd('0x3'));var moment=require(_0xd7cd('0x4'));var BPromise=require(_0xd7cd('0x5'));var rp=require(_0xd7cd('0x6'));var fs=require('fs');var path=require(_0xd7cd('0x7'));var rimraf=require(_0xd7cd('0x8'));var config=require('../../config/environment');var attributes=require(_0xd7cd('0x9'));module['exports']=function(_0x9a94da,_0xe590aa){return _0x9a94da[_0xd7cd('0xa')](_0xd7cd('0xb'),attributes,{'tableName':_0xd7cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 21d805a..0d50df6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee77=['MailInteraction','Contact\x20not\x20found','spread','update','interaction','created','attachments','originCc','bcc','originChannel','Email','ChatOfflineMessageId','User','UserId','unshift','name','waitForTheAssignedAgent','Start','startRouting','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetMailAccount','MailAccount','options','raw','where','limit','attributes','include','model','find','map','ShowMailAccount','body','mail','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','Applications','MailServerOut','Smtp','get','applications','list','orderBy','priority','asc','autoclose','push','length','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages'];(function(_0x31cc16,_0xb353f0){var _0x5cd851=function(_0x289966){while(--_0x289966){_0x31cc16['push'](_0x31cc16['shift']());}};_0x5cd851(++_0xb353f0);}(_0xee77,0x1b7));var _0x7ee7=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xee77[_0x2cfb58];return _0xd99951;};'use strict';var _=require('lodash');var util=require(_0x7ee7('0x0'));var moment=require('moment');var BPromise=require(_0x7ee7('0x1'));var rs=require(_0x7ee7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ee7('0x3'))['db'];var utils=require(_0x7ee7('0x4'));var logger=require(_0x7ee7('0x5'))(_0x7ee7('0x6'));var config=require(_0x7ee7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7ee7('0x8')][_0x7ee7('0x9')]({'port':0x232c});config['redis']=_[_0x7ee7('0xa')](config[_0x7ee7('0xb')],{'host':_0x7ee7('0xc'),'port':0x18eb});var socket=require(_0x7ee7('0xd'))(new Redis(config['redis']));require(_0x7ee7('0xe'))[_0x7ee7('0xf')](socket);function respondWithRpcPromise(_0x1240a3,_0x39b8f9,_0xd41afa){return new BPromise(function(_0x2ea707,_0x19d092){return client[_0x7ee7('0x10')](_0x1240a3,_0xd41afa)[_0x7ee7('0x11')](function(_0x5240fe){logger[_0x7ee7('0x12')](_0x7ee7('0x13'),_0x39b8f9,_0x7ee7('0x14'));logger[_0x7ee7('0x15')](_0x7ee7('0x16'),_0x39b8f9,_0x7ee7('0x14'),JSON[_0x7ee7('0x17')](_0x5240fe));if(_0x5240fe['error']){if(_0x5240fe['error'][_0x7ee7('0x18')]===0x1f4){logger[_0x7ee7('0x19')](_0x7ee7('0x13'),_0x39b8f9,_0x5240fe[_0x7ee7('0x19')][_0x7ee7('0x1a')]);return _0x19d092(_0x5240fe[_0x7ee7('0x19')]['message']);}logger[_0x7ee7('0x19')](_0x7ee7('0x13'),_0x39b8f9,_0x5240fe['error'][_0x7ee7('0x1a')]);return _0x2ea707(_0x5240fe[_0x7ee7('0x19')][_0x7ee7('0x1a')]);}else{logger[_0x7ee7('0x12')]('MailAccount,\x20%s,\x20%s',_0x39b8f9,_0x7ee7('0x14'));_0x2ea707(_0x5240fe[_0x7ee7('0x1b')][_0x7ee7('0x1a')]);}})[_0x7ee7('0x1c')](function(_0xb29d66){logger[_0x7ee7('0x19')](_0x7ee7('0x13'),_0x39b8f9,_0xb29d66);_0x19d092(_0xb29d66);});});}exports[_0x7ee7('0x1d')]=function(_0x13553c){var _0xe03428=this;return new Promise(function(_0x3daa77,_0x55b0e8){return db[_0x7ee7('0x1e')]['findAll']({'raw':_0x13553c['options']?_0x13553c[_0x7ee7('0x1f')][_0x7ee7('0x20')]===undefined?!![]:![]:!![],'where':_0x13553c[_0x7ee7('0x1f')]?_0x13553c[_0x7ee7('0x1f')][_0x7ee7('0x21')]||null:null,'attributes':_0x13553c['options']?_0x13553c['options']['attributes']||null:null,'limit':_0x13553c[_0x7ee7('0x1f')]?_0x13553c[_0x7ee7('0x1f')][_0x7ee7('0x22')]||null:null,'include':_0x13553c['options']?_0x13553c[_0x7ee7('0x1f')]['include']?_['map'](_0x13553c[_0x7ee7('0x1f')]['include'],function(_0x91cff0){return{'model':db[_0x91cff0['model']],'as':_0x91cff0['as'],'attributes':_0x91cff0[_0x7ee7('0x23')],'include':_0x91cff0[_0x7ee7('0x24')]?_['map'](_0x91cff0[_0x7ee7('0x24')],function(_0x2157bd){return{'model':db[_0x2157bd[_0x7ee7('0x25')]],'as':_0x2157bd['as'],'attributes':_0x2157bd['attributes'],'include':_0x2157bd[_0x7ee7('0x24')]?_['map'](_0x2157bd[_0x7ee7('0x24')],function(_0x541ee1){return{'model':db[_0x541ee1[_0x7ee7('0x25')]],'as':_0x541ee1['as'],'attributes':_0x541ee1[_0x7ee7('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7ee7('0x11')](function(_0x481cf8){logger[_0x7ee7('0x12')](_0x7ee7('0x1d'),_0x13553c);logger[_0x7ee7('0x15')](_0x7ee7('0x1d'),_0x13553c,JSON[_0x7ee7('0x17')](_0x481cf8));_0x3daa77(_0x481cf8);})[_0x7ee7('0x1c')](function(_0xf49855){logger[_0x7ee7('0x19')](_0x7ee7('0x1d'),_0xf49855[_0x7ee7('0x1a')],_0x13553c);_0x55b0e8(_0xe03428['error'](0x1f4,_0xf49855[_0x7ee7('0x1a')]));});});};exports['ShowMailAccount']=function(_0x3ff42b){var _0x4857c1=this;return new Promise(function(_0x312222,_0x2ca185){return db[_0x7ee7('0x1e')][_0x7ee7('0x26')]({'raw':_0x3ff42b[_0x7ee7('0x1f')]?_0x3ff42b[_0x7ee7('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x3ff42b['options']?_0x3ff42b[_0x7ee7('0x1f')][_0x7ee7('0x21')]||null:null,'attributes':_0x3ff42b[_0x7ee7('0x1f')]?_0x3ff42b['options'][_0x7ee7('0x23')]||null:null,'include':_0x3ff42b[_0x7ee7('0x1f')]?_0x3ff42b[_0x7ee7('0x1f')][_0x7ee7('0x24')]?_[_0x7ee7('0x27')](_0x3ff42b[_0x7ee7('0x1f')][_0x7ee7('0x24')],function(_0x511a37){return{'model':db[_0x511a37[_0x7ee7('0x25')]],'as':_0x511a37['as'],'attributes':_0x511a37[_0x7ee7('0x23')],'include':_0x511a37[_0x7ee7('0x24')]?_[_0x7ee7('0x27')](_0x511a37[_0x7ee7('0x24')],function(_0x1430cf){return{'model':db[_0x1430cf[_0x7ee7('0x25')]],'as':_0x1430cf['as'],'attributes':_0x1430cf['attributes'],'include':_0x1430cf[_0x7ee7('0x24')]?_[_0x7ee7('0x27')](_0x1430cf[_0x7ee7('0x24')],function(_0x40b1ea){return{'model':db[_0x40b1ea[_0x7ee7('0x25')]],'as':_0x40b1ea['as'],'attributes':_0x40b1ea[_0x7ee7('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7ee7('0x11')](function(_0x139d34){logger[_0x7ee7('0x12')](_0x7ee7('0x28'),_0x3ff42b);logger[_0x7ee7('0x15')](_0x7ee7('0x28'),_0x3ff42b,JSON[_0x7ee7('0x17')](_0x139d34));_0x312222(_0x139d34);})[_0x7ee7('0x1c')](function(_0x444934){logger['error']('ShowMailAccount',_0x444934[_0x7ee7('0x1a')],_0x3ff42b);_0x2ca185(_0x4857c1[_0x7ee7('0x19')](0x1f4,_0x444934[_0x7ee7('0x1a')]));});});};exports['NotifyMailAccount']=function(_0x581a18){var _0x32756c=this;return new Promise(function(_0x1ce174,_0x173c61){var _0x6bc585={'body':_0x581a18[_0x7ee7('0x29')],'channel':_0x7ee7('0x2a')};var _0x5f4c61=_['difference'](_[_0x7ee7('0x2b')](db[_0x7ee7('0x2c')][_0x7ee7('0x2d')]),[_0x7ee7('0x2e'),_0x7ee7('0x2f'),_0x7ee7('0x30'),_0x7ee7('0x31')]);var _0x795244=![];if(_0x581a18[_0x7ee7('0x29')]['id']){delete _0x581a18[_0x7ee7('0x29')]['id'];}if(_[_0x7ee7('0x32')](_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x33')])){return _0x173c61(_0x32756c[_0x7ee7('0x19')](0x1f4,_0x7ee7('0x34')));}if(_[_0x7ee7('0x32')](_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x29')])||_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x29')]===''){return _0x173c61(_0x32756c[_0x7ee7('0x19')](0x1f4,_0x7ee7('0x35')));}if(_[_0x7ee7('0x32')](_0x581a18[_0x7ee7('0x29')]['mapKey'])){return _0x173c61(_0x32756c[_0x7ee7('0x19')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5f4c61));}if(!_[_0x7ee7('0x36')](_0x5f4c61,_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x37')])){return _0x173c61(_0x32756c[_0x7ee7('0x19')](0x1f4,_0x7ee7('0x38')+_0x5f4c61));}var _0x56d95b={};_0x56d95b[_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x37')]]=_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x33')];return db[_0x7ee7('0x1e')][_0x7ee7('0x26')]({'where':{'id':_0x581a18[_0x7ee7('0x39')]['id']},'include':[{'model':db[_0x7ee7('0x3a')],'as':_0x7ee7('0x3b'),'include':[{'model':db[_0x7ee7('0x2c')],'as':_0x7ee7('0x3c'),'where':_0x56d95b,'limit':0x1,'order':[[_0x7ee7('0x2f'),_0x7ee7('0x3d')]]}]},{'model':db['MailApplication'],'as':_0x7ee7('0x3e')},{'model':db[_0x7ee7('0x3f')],'as':_0x7ee7('0x40')}]})[_0x7ee7('0x11')](function(_0x2ffc58){if(_0x2ffc58&&_0x2ffc58['List']){var _0x402a69=_0x2ffc58[_0x7ee7('0x41')]({'plain':!![]});_0x6bc585[_0x7ee7('0x39')]=_['omit'](_0x402a69,[_0x7ee7('0x3e'),_0x7ee7('0x3b')]);_0x6bc585[_0x7ee7('0x42')]=_0x402a69['Applications'];_0x6bc585[_0x7ee7('0x43')]=_0x402a69['List'];_0x6bc585[_0x7ee7('0x42')]=_[_0x7ee7('0x44')](_0x6bc585[_0x7ee7('0x42')],[_0x7ee7('0x45')],[_0x7ee7('0x46')]);if(_0x6bc585[_0x7ee7('0x39')]&&_0x6bc585[_0x7ee7('0x39')][_0x7ee7('0x47')]){_0x6bc585[_0x7ee7('0x42')][_0x7ee7('0x48')]({'id':0x0,'priority':_0x6bc585[_0x7ee7('0x42')][_0x7ee7('0x49')]+0x1,'app':'close','appdata':_0x7ee7('0x47'),'interval':_0x7ee7('0x4a')});}if(_0x6bc585['account']['Applications']){delete _0x6bc585[_0x7ee7('0x39')][_0x7ee7('0x3e')];}if(_0x6bc585[_0x7ee7('0x39')][_0x7ee7('0x3b')]){delete _0x6bc585[_0x7ee7('0x39')][_0x7ee7('0x3b')];}if(_0x402a69[_0x7ee7('0x3b')][_0x7ee7('0x3c')][_0x7ee7('0x49')]){return _0x402a69[_0x7ee7('0x3b')][_0x7ee7('0x3c')][0x0];}var _0x2bd1ee=_['defaults'](_0x581a18['body'],{'firstName':_0x581a18[_0x7ee7('0x29')]['from'],'ListId':_0x402a69[_0x7ee7('0x31')]});_0x2bd1ee[_0x581a18['body'][_0x7ee7('0x37')]]=_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x33')];return db[_0x7ee7('0x2c')][_0x7ee7('0x4b')](_0x2bd1ee);}else{throw new Error(_0x7ee7('0x4c'));}})['then'](function(_0x5a5ac3){_0x6bc585[_0x7ee7('0x4d')]=_0x5a5ac3;if(_0x5a5ac3){if(!_0x581a18['body'][_0x7ee7('0x1a')][_0x7ee7('0x4e')]){_0x581a18[_0x7ee7('0x29')]['message'][_0x7ee7('0x4e')]=rs[_0x7ee7('0x4f')]()+'\x20'+_0x581a18[_0x7ee7('0x29')]['message']['from'];}var _0x200ec9={'ContactId':_0x5a5ac3['id'],'MailAccountId':_0x581a18[_0x7ee7('0x39')]['id'],'inReplyTo':_0x581a18[_0x7ee7('0x29')]['message'][_0x7ee7('0x4e')],'to':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')][_0x7ee7('0x33')],'cc':_0x581a18[_0x7ee7('0x29')]['message']['cc'],'subject':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')][_0x7ee7('0x50')],'attach':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')][_0x7ee7('0x51')],'lastMsgAt':moment()[_0x7ee7('0x52')](_0x7ee7('0x53')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x7ee7('0x26')]({'where':{'closed':![],'MailAccountId':_0x581a18[_0x7ee7('0x39')]['id']},'include':[{'model':db[_0x7ee7('0x54')],'as':_0x7ee7('0x55'),'attributes':[_0x7ee7('0x4e')],'where':{'messageId':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')]['inReplyTo']}}]})[_0x7ee7('0x11')](function(_0x6ef40e){if(_0x6ef40e){return[_0x6ef40e,![]];}return db[_0x7ee7('0x56')][_0x7ee7('0x4b')](_0x200ec9)['then'](function(_0x4ba9fa){return[_0x4ba9fa,!![]];});});}else{throw new Error(_0x7ee7('0x57'));}})[_0x7ee7('0x58')](function(_0x34e584,_0x351e46){if(_0x34e584){_0x795244=_0x351e46;if(!_0x351e46){return _0x34e584[_0x7ee7('0x59')]({'inReplyTo':_0x581a18[_0x7ee7('0x29')]['message'][_0x7ee7('0x4e')],'to':_0x581a18['body']['message'][_0x7ee7('0x33')],'cc':_0x581a18['body']['message']['cc'],'subject':_0x581a18['body']['message'][_0x7ee7('0x50')],'attach':_0x34e584[_0x7ee7('0x51')]?_0x34e584[_0x7ee7('0x51')]:_0x581a18[_0x7ee7('0x29')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0x7ee7('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x7ee7('0x52')](_0x7ee7('0x53')),'lastMsgDirection':'in'});}else{return _0x34e584;}}})['then'](function(_0x13b9ef){_0x6bc585[_0x7ee7('0x5a')]=_0x13b9ef[_0x7ee7('0x41')]({'plain':!![]});_0x6bc585[_0x7ee7('0x5a')][_0x7ee7('0x5b')]=_0x795244;return db[_0x7ee7('0x54')][_0x7ee7('0x4b')]({'body':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x29')],'MailAccountId':_0x581a18[_0x7ee7('0x39')]['id'],'MailInteractionId':_0x13b9ef['id'],'direction':'in','ContactId':_0x6bc585[_0x7ee7('0x4d')]['id'],'messageId':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')][_0x7ee7('0x4e')],'from':_0x581a18['body'][_0x7ee7('0x1a')][_0x7ee7('0x33')],'to':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')]['to'],'cc':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')]['cc'],'subject':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')][_0x7ee7('0x50')],'attach':_0x581a18[_0x7ee7('0x29')]['message'][_0x7ee7('0x51')],'Attachments':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')][_0x7ee7('0x5c')],'originTo':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')]['originTo'],'originCc':_0x581a18['body'][_0x7ee7('0x1a')][_0x7ee7('0x5d')],'bcc':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')][_0x7ee7('0x5e')],'ChatWebsiteId':_0x581a18[_0x7ee7('0x29')][_0x7ee7('0x1a')]['ChatWebsiteId']||null,'originChannel':_0x581a18['body'][_0x7ee7('0x1a')][_0x7ee7('0x5f')]||_0x7ee7('0x60'),'ChatOfflineMessageId':_0x581a18['body'][_0x7ee7('0x1a')][_0x7ee7('0x61')]||null},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0x7ee7('0x11')](function(_0x46212a){_0x6bc585['message']=_0x46212a;if(_0x6bc585[_0x7ee7('0x5a')]['UserId']){return db[_0x7ee7('0x62')][_0x7ee7('0x26')]({'attributes':['id','name'],'where':{'id':_0x6bc585[_0x7ee7('0x5a')][_0x7ee7('0x63')]}})[_0x7ee7('0x11')](function(_0x10b339){if(_0x10b339){_0x6bc585['applications'][_0x7ee7('0x64')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x10b339[_0x7ee7('0x65')]+','+(_0x6bc585['account'][_0x7ee7('0x66')]||0xa),'interval':_0x7ee7('0x4a')});}return respondWithRpcPromise('Start','startRouting',_0x6bc585);});}return respondWithRpcPromise(_0x7ee7('0x67'),_0x7ee7('0x68'),_0x6bc585);})[_0x7ee7('0x11')](function(_0x38e45b){_0x1ce174(_0x38e45b);})['catch'](function(_0x100aef){_0x173c61(_0x32756c['error'](0x1f4,_0x100aef[_0x7ee7('0x1a')]));});});};
\ No newline at end of file
+var _0xceb1=['MailServerOut','Smtp','get','omit','list','applications','priority','asc','push','close','autoclose','*,*,*,*','List\x20not\x20found','contact','messageId','subject','MailInteraction','MailMessage','Messages','create','Contact\x20not\x20found','update','attach','interaction','created','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','unshift','agent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailAccount','findAll','options','raw','where','attributes','include','map','model','debug','MailAccount','ShowMailAccount','catch','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','Applications'];(function(_0x3ff4fb,_0x26c382){var _0x3274de=function(_0x9e9191){while(--_0x9e9191){_0x3ff4fb['push'](_0x3ff4fb['shift']());}};_0x3274de(++_0x26c382);}(_0xceb1,0x8e));var _0x1ceb=function(_0x390ac1,_0x2c3ac7){_0x390ac1=_0x390ac1-0x0;var _0x496c71=_0xceb1[_0x390ac1];return _0x496c71;};'use strict';var _=require(_0x1ceb('0x0'));var util=require(_0x1ceb('0x1'));var moment=require('moment');var BPromise=require(_0x1ceb('0x2'));var rs=require(_0x1ceb('0x3'));var fs=require('fs');var Redis=require(_0x1ceb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ceb('0x5'));var logger=require(_0x1ceb('0x6'))(_0x1ceb('0x7'));var config=require(_0x1ceb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1ceb('0x9')]({'port':0x232c});config[_0x1ceb('0xa')]=_[_0x1ceb('0xb')](config['redis'],{'host':_0x1ceb('0xc'),'port':0x18eb});var socket=require(_0x1ceb('0xd'))(new Redis(config[_0x1ceb('0xa')]));require(_0x1ceb('0xe'))[_0x1ceb('0xf')](socket);function respondWithRpcPromise(_0x29b516,_0x436aa8,_0x213d08){return new BPromise(function(_0x45d615,_0x4f52eb){return client['request'](_0x29b516,_0x213d08)[_0x1ceb('0x10')](function(_0x34fc2f){logger[_0x1ceb('0x11')](_0x1ceb('0x12'),_0x436aa8,_0x1ceb('0x13'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x436aa8,'request\x20sent',JSON[_0x1ceb('0x14')](_0x34fc2f));if(_0x34fc2f[_0x1ceb('0x15')]){if(_0x34fc2f[_0x1ceb('0x15')][_0x1ceb('0x16')]===0x1f4){logger[_0x1ceb('0x15')]('MailAccount,\x20%s,\x20%s',_0x436aa8,_0x34fc2f[_0x1ceb('0x15')][_0x1ceb('0x17')]);return _0x4f52eb(_0x34fc2f['error'][_0x1ceb('0x17')]);}logger[_0x1ceb('0x15')](_0x1ceb('0x12'),_0x436aa8,_0x34fc2f['error'][_0x1ceb('0x17')]);return _0x45d615(_0x34fc2f[_0x1ceb('0x15')][_0x1ceb('0x17')]);}else{logger[_0x1ceb('0x11')](_0x1ceb('0x12'),_0x436aa8,'request\x20sent');_0x45d615(_0x34fc2f[_0x1ceb('0x18')][_0x1ceb('0x17')]);}})['catch'](function(_0x5264f8){logger['error'](_0x1ceb('0x12'),_0x436aa8,_0x5264f8);_0x4f52eb(_0x5264f8);});});}exports[_0x1ceb('0x19')]=function(_0x3d4b48){var _0x5f5c16=this;return new Promise(function(_0xcb270,_0x1a07c6){return db['MailAccount'][_0x1ceb('0x1a')]({'raw':_0x3d4b48[_0x1ceb('0x1b')]?_0x3d4b48[_0x1ceb('0x1b')][_0x1ceb('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d4b48[_0x1ceb('0x1b')]?_0x3d4b48['options'][_0x1ceb('0x1d')]||null:null,'attributes':_0x3d4b48['options']?_0x3d4b48[_0x1ceb('0x1b')][_0x1ceb('0x1e')]||null:null,'limit':_0x3d4b48['options']?_0x3d4b48[_0x1ceb('0x1b')]['limit']||null:null,'include':_0x3d4b48[_0x1ceb('0x1b')]?_0x3d4b48['options'][_0x1ceb('0x1f')]?_[_0x1ceb('0x20')](_0x3d4b48['options'][_0x1ceb('0x1f')],function(_0x10a14f){return{'model':db[_0x10a14f[_0x1ceb('0x21')]],'as':_0x10a14f['as'],'attributes':_0x10a14f[_0x1ceb('0x1e')],'include':_0x10a14f[_0x1ceb('0x1f')]?_[_0x1ceb('0x20')](_0x10a14f['include'],function(_0x965f64){return{'model':db[_0x965f64[_0x1ceb('0x21')]],'as':_0x965f64['as'],'attributes':_0x965f64[_0x1ceb('0x1e')],'include':_0x965f64[_0x1ceb('0x1f')]?_[_0x1ceb('0x20')](_0x965f64['include'],function(_0x246936){return{'model':db[_0x246936[_0x1ceb('0x21')]],'as':_0x246936['as'],'attributes':_0x246936[_0x1ceb('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b0313){logger[_0x1ceb('0x11')]('GetMailAccount',_0x3d4b48);logger[_0x1ceb('0x22')](_0x1ceb('0x19'),_0x3d4b48,JSON[_0x1ceb('0x14')](_0x5b0313));_0xcb270(_0x5b0313);})['catch'](function(_0xee8c86){logger[_0x1ceb('0x15')](_0x1ceb('0x19'),_0xee8c86['message'],_0x3d4b48);_0x1a07c6(_0x5f5c16[_0x1ceb('0x15')](0x1f4,_0xee8c86['message']));});});};exports['ShowMailAccount']=function(_0x33ea7d){var _0x2aabee=this;return new Promise(function(_0x1045b9,_0x30d1dd){return db[_0x1ceb('0x23')]['find']({'raw':_0x33ea7d[_0x1ceb('0x1b')]?_0x33ea7d[_0x1ceb('0x1b')][_0x1ceb('0x1c')]===undefined?!![]:![]:!![],'where':_0x33ea7d[_0x1ceb('0x1b')]?_0x33ea7d[_0x1ceb('0x1b')][_0x1ceb('0x1d')]||null:null,'attributes':_0x33ea7d[_0x1ceb('0x1b')]?_0x33ea7d[_0x1ceb('0x1b')][_0x1ceb('0x1e')]||null:null,'include':_0x33ea7d['options']?_0x33ea7d[_0x1ceb('0x1b')][_0x1ceb('0x1f')]?_['map'](_0x33ea7d[_0x1ceb('0x1b')][_0x1ceb('0x1f')],function(_0x56aebc){return{'model':db[_0x56aebc[_0x1ceb('0x21')]],'as':_0x56aebc['as'],'attributes':_0x56aebc['attributes'],'include':_0x56aebc[_0x1ceb('0x1f')]?_['map'](_0x56aebc[_0x1ceb('0x1f')],function(_0x79cd77){return{'model':db[_0x79cd77[_0x1ceb('0x21')]],'as':_0x79cd77['as'],'attributes':_0x79cd77['attributes'],'include':_0x79cd77[_0x1ceb('0x1f')]?_[_0x1ceb('0x20')](_0x79cd77[_0x1ceb('0x1f')],function(_0x39d0e1){return{'model':db[_0x39d0e1[_0x1ceb('0x21')]],'as':_0x39d0e1['as'],'attributes':_0x39d0e1[_0x1ceb('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1ceb('0x10')](function(_0x5450d9){logger['info'](_0x1ceb('0x24'),_0x33ea7d);logger[_0x1ceb('0x22')]('ShowMailAccount',_0x33ea7d,JSON[_0x1ceb('0x14')](_0x5450d9));_0x1045b9(_0x5450d9);})[_0x1ceb('0x25')](function(_0x44c195){logger[_0x1ceb('0x15')]('ShowMailAccount',_0x44c195[_0x1ceb('0x17')],_0x33ea7d);_0x30d1dd(_0x2aabee[_0x1ceb('0x15')](0x1f4,_0x44c195[_0x1ceb('0x17')]));});});};exports[_0x1ceb('0x26')]=function(_0x530b00){var _0x2ec93b=this;return new Promise(function(_0x1dae0a,_0x4290bb){var _0x33b5bc={'body':_0x530b00[_0x1ceb('0x27')],'channel':_0x1ceb('0x28')};var _0x461ce9=_['difference'](_['keys'](db[_0x1ceb('0x29')][_0x1ceb('0x2a')]),[_0x1ceb('0x2b'),_0x1ceb('0x2c'),_0x1ceb('0x2d'),_0x1ceb('0x2e')]);var _0x145c3b=![];if(_0x530b00[_0x1ceb('0x27')]['id']){delete _0x530b00[_0x1ceb('0x27')]['id'];}if(_[_0x1ceb('0x2f')](_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x30')])){return _0x4290bb(_0x2ec93b[_0x1ceb('0x15')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x530b00['body']['body'])||_0x530b00[_0x1ceb('0x27')]['body']===''){return _0x4290bb(_0x2ec93b['error'](0x1f4,_0x1ceb('0x31')));}if(_['isNil'](_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x32')])){return _0x4290bb(_0x2ec93b[_0x1ceb('0x15')](0x1f4,_0x1ceb('0x33')+_0x461ce9));}if(!_['includes'](_0x461ce9,_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x32')])){return _0x4290bb(_0x2ec93b[_0x1ceb('0x15')](0x1f4,_0x1ceb('0x34')+_0x461ce9));}var _0x2a1960={};_0x2a1960[_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x32')]]=_0x530b00[_0x1ceb('0x27')]['from'];return db['MailAccount'][_0x1ceb('0x35')]({'where':{'id':_0x530b00[_0x1ceb('0x36')]['id']},'include':[{'model':db[_0x1ceb('0x37')],'as':_0x1ceb('0x38'),'include':[{'model':db[_0x1ceb('0x29')],'as':_0x1ceb('0x39'),'where':_0x2a1960,'limit':0x1,'order':[[_0x1ceb('0x2c'),_0x1ceb('0x3a')]]}]},{'model':db['MailApplication'],'as':_0x1ceb('0x3b')},{'model':db[_0x1ceb('0x3c')],'as':_0x1ceb('0x3d')}]})[_0x1ceb('0x10')](function(_0x360577){if(_0x360577&&_0x360577[_0x1ceb('0x38')]){var _0x114400=_0x360577[_0x1ceb('0x3e')]({'plain':!![]});_0x33b5bc[_0x1ceb('0x36')]=_[_0x1ceb('0x3f')](_0x114400,[_0x1ceb('0x3b'),_0x1ceb('0x38')]);_0x33b5bc['applications']=_0x114400[_0x1ceb('0x3b')];_0x33b5bc[_0x1ceb('0x40')]=_0x114400[_0x1ceb('0x38')];_0x33b5bc[_0x1ceb('0x41')]=_['orderBy'](_0x33b5bc[_0x1ceb('0x41')],[_0x1ceb('0x42')],[_0x1ceb('0x43')]);if(_0x33b5bc['account']&&_0x33b5bc[_0x1ceb('0x36')]['autoclose']){_0x33b5bc[_0x1ceb('0x41')][_0x1ceb('0x44')]({'id':0x0,'priority':_0x33b5bc[_0x1ceb('0x41')]['length']+0x1,'app':_0x1ceb('0x45'),'appdata':_0x1ceb('0x46'),'interval':_0x1ceb('0x47')});}if(_0x33b5bc[_0x1ceb('0x36')][_0x1ceb('0x3b')]){delete _0x33b5bc['account'][_0x1ceb('0x3b')];}if(_0x33b5bc[_0x1ceb('0x36')]['List']){delete _0x33b5bc[_0x1ceb('0x36')][_0x1ceb('0x38')];}if(_0x114400['List']['Contacts']['length']){return _0x114400[_0x1ceb('0x38')][_0x1ceb('0x39')][0x0];}var _0x5a04a9=_['defaults'](_0x530b00[_0x1ceb('0x27')],{'firstName':_0x530b00['body']['from'],'ListId':_0x114400['ListId']});_0x5a04a9[_0x530b00['body'][_0x1ceb('0x32')]]=_0x530b00['body']['from'];return db['CmContact']['create'](_0x5a04a9);}else{throw new Error(_0x1ceb('0x48'));}})['then'](function(_0x3b89b2){_0x33b5bc[_0x1ceb('0x49')]=_0x3b89b2;if(_0x3b89b2){if(!_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x4a')]){_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')]['messageId']=rs['generate']()+'\x20'+_0x530b00['body'][_0x1ceb('0x17')][_0x1ceb('0x30')];}var _0x11d2c7={'ContactId':_0x3b89b2['id'],'MailAccountId':_0x530b00[_0x1ceb('0x36')]['id'],'inReplyTo':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x4a')],'to':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')]['from'],'cc':_0x530b00[_0x1ceb('0x27')]['message']['cc'],'subject':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x4b')],'attach':_0x530b00[_0x1ceb('0x27')]['message']['attach'],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x1ceb('0x4c')][_0x1ceb('0x35')]({'where':{'closed':![],'MailAccountId':_0x530b00[_0x1ceb('0x36')]['id']},'include':[{'model':db[_0x1ceb('0x4d')],'as':_0x1ceb('0x4e'),'attributes':[_0x1ceb('0x4a')],'where':{'messageId':_0x530b00['body'][_0x1ceb('0x17')]['inReplyTo']}}]})[_0x1ceb('0x10')](function(_0x196513){if(_0x196513){return[_0x196513,![]];}return db[_0x1ceb('0x4c')][_0x1ceb('0x4f')](_0x11d2c7)[_0x1ceb('0x10')](function(_0x5038cc){return[_0x5038cc,!![]];});});}else{throw new Error(_0x1ceb('0x50'));}})['spread'](function(_0x55280c,_0x13fde5){if(_0x55280c){_0x145c3b=_0x13fde5;if(!_0x13fde5){return _0x55280c[_0x1ceb('0x51')]({'inReplyTo':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x4a')],'to':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x30')],'cc':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')]['cc'],'subject':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x4b')],'attach':_0x55280c[_0x1ceb('0x52')]?_0x55280c[_0x1ceb('0x52')]:_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')]['attach'],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x55280c;}}})[_0x1ceb('0x10')](function(_0x11256e){_0x33b5bc[_0x1ceb('0x53')]=_0x11256e[_0x1ceb('0x3e')]({'plain':!![]});_0x33b5bc['interaction'][_0x1ceb('0x54')]=_0x145c3b;return db[_0x1ceb('0x4d')][_0x1ceb('0x4f')]({'body':_0x530b00['body'][_0x1ceb('0x27')],'MailAccountId':_0x530b00[_0x1ceb('0x36')]['id'],'MailInteractionId':_0x11256e['id'],'direction':'in','ContactId':_0x33b5bc[_0x1ceb('0x49')]['id'],'messageId':_0x530b00['body']['message'][_0x1ceb('0x4a')],'from':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x30')],'to':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')]['to'],'cc':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')]['cc'],'subject':_0x530b00[_0x1ceb('0x27')]['message'][_0x1ceb('0x4b')],'attach':_0x530b00[_0x1ceb('0x27')]['message']['attach'],'Attachments':_0x530b00[_0x1ceb('0x27')]['message']['attachments'],'originTo':_0x530b00['body'][_0x1ceb('0x17')][_0x1ceb('0x55')],'originCc':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x56')],'bcc':_0x530b00['body']['message'][_0x1ceb('0x57')],'ChatWebsiteId':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x58')]||null,'originChannel':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x59')]||_0x1ceb('0x5a'),'ChatOfflineMessageId':_0x530b00[_0x1ceb('0x27')][_0x1ceb('0x17')][_0x1ceb('0x5b')]||null},{'include':[{'model':db[_0x1ceb('0x5c')],'as':_0x1ceb('0x5d')}]});})['then'](function(_0x462e35){_0x33b5bc[_0x1ceb('0x17')]=_0x462e35;if(_0x33b5bc[_0x1ceb('0x53')]['UserId']){return db[_0x1ceb('0x5e')][_0x1ceb('0x35')]({'attributes':['id',_0x1ceb('0x5f')],'where':{'id':_0x33b5bc[_0x1ceb('0x53')][_0x1ceb('0x60')]}})[_0x1ceb('0x10')](function(_0x405d4a){if(_0x405d4a){_0x33b5bc[_0x1ceb('0x41')][_0x1ceb('0x61')]({'id':0x0,'priority':0x0,'app':_0x1ceb('0x62'),'appdata':_0x405d4a['name']+','+(_0x33b5bc['account']['waitForTheAssignedAgent']||0xa),'interval':_0x1ceb('0x47')});}return respondWithRpcPromise(_0x1ceb('0x63'),_0x1ceb('0x64'),_0x33b5bc);});}return respondWithRpcPromise('Start',_0x1ceb('0x64'),_0x33b5bc);})[_0x1ceb('0x10')](function(_0x259a5e){_0x1dae0a(_0x259a5e);})[_0x1ceb('0x25')](function(_0x390fd9){_0x4290bb(_0x2ec93b[_0x1ceb('0x15')](0x1f4,_0x390fd9[_0x1ceb('0x17')]));});});};
\ No newline at end of file
index 787a63b..974dfa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbe3=['remove','update','emit','removeListener','register','mailAccount:','save'];(function(_0x55e92d,_0x2d4e7a){var _0x21e2e5=function(_0x4fde15){while(--_0x4fde15){_0x55e92d['push'](_0x55e92d['shift']());}};_0x21e2e5(++_0x2d4e7a);}(_0xbbe3,0x19c));var _0x3bbe=function(_0x14f509,_0x5daec4){_0x14f509=_0x14f509-0x0;var _0x47d141=_0xbbe3[_0x14f509];return _0x47d141;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x3bbe('0x0'),_0x3bbe('0x1'),_0x3bbe('0x2')];function createListener(_0x387ce1,_0x194363){return function(_0x2886df){_0x194363[_0x3bbe('0x3')](_0x387ce1,_0x2886df);};}function removeListener(_0x2fe70d,_0xa8b007){return function(){MailAccountEvents[_0x3bbe('0x4')](_0x2fe70d,_0xa8b007);};}exports[_0x3bbe('0x5')]=function(_0x363376){for(var _0x6fa358=0x0,_0x2aa2f1=events['length'];_0x6fa358<_0x2aa2f1;_0x6fa358++){var _0x4a2cf8=events[_0x6fa358];var _0x364d1f=createListener(_0x3bbe('0x6')+_0x4a2cf8,_0x363376);MailAccountEvents['on'](_0x4a2cf8,_0x364d1f);}};
\ No newline at end of file
+var _0xe814=['length','mailAccount:','save','remove','update'];(function(_0x3e93b7,_0x5aa856){var _0x269bb5=function(_0x598ea5){while(--_0x598ea5){_0x3e93b7['push'](_0x3e93b7['shift']());}};_0x269bb5(++_0x5aa856);}(_0xe814,0x1b5));var _0x4e81=function(_0x26a776,_0xb78d93){_0x26a776=_0x26a776-0x0;var _0x440e98=_0xe814[_0x26a776];return _0x440e98;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x4e81('0x0'),_0x4e81('0x1'),_0x4e81('0x2')];function createListener(_0x4ee98d,_0x1ef2aa){return function(_0x17d26d){_0x1ef2aa['emit'](_0x4ee98d,_0x17d26d);};}function removeListener(_0x3e4746,_0x555039){return function(){MailAccountEvents['removeListener'](_0x3e4746,_0x555039);};}exports['register']=function(_0x333052){for(var _0x21552f=0x0,_0xe0b3e3=events[_0x4e81('0x3')];_0x21552f<_0xe0b3e3;_0x21552f++){var _0xbc2309=events[_0x21552f];var _0x56d494=createListener(_0x4e81('0x4')+_0xbc2309,_0x333052);MailAccountEvents['on'](_0xbc2309,_0x56d494);}};
\ No newline at end of file
index 290f47a..15abace 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1ae=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','show','put','/:id','update'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xe1ae,0x144));var _0xee1a=function(_0x48da45,_0x259bea){_0x48da45=_0x48da45-0x0;var _0x5d5687=_0xe1ae[_0x48da45];return _0x5d5687;};'use strict';var multer=require(_0xee1a('0x0'));var util=require('util');var path=require(_0xee1a('0x1'));var timeout=require(_0xee1a('0x2'));var express=require(_0xee1a('0x3'));var router=express[_0xee1a('0x4')]();var fs_extra=require(_0xee1a('0x5'));var auth=require(_0xee1a('0x6'));var interaction=require(_0xee1a('0x7'));var config=require(_0xee1a('0x8'));var controller=require(_0xee1a('0x9'));router[_0xee1a('0xa')]('/:id',auth[_0xee1a('0xb')](),controller[_0xee1a('0xc')]);router[_0xee1a('0xd')](_0xee1a('0xe'),auth[_0xee1a('0xb')](),controller[_0xee1a('0xf')]);router['delete'](_0xee1a('0xe'),auth[_0xee1a('0xb')](),controller[_0xee1a('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x9ad8=['put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ad8,0xf3));var _0x89ad=function(_0x2c47c8,_0x36b835){_0x2c47c8=_0x2c47c8-0x0;var _0x8181c7=_0x9ad8[_0x2c47c8];return _0x8181c7;};'use strict';var multer=require(_0x89ad('0x0'));var util=require(_0x89ad('0x1'));var path=require(_0x89ad('0x2'));var timeout=require(_0x89ad('0x3'));var express=require(_0x89ad('0x4'));var router=express[_0x89ad('0x5')]();var fs_extra=require(_0x89ad('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x89ad('0x7'));var config=require(_0x89ad('0x8'));var controller=require('./mailApplication.controller');router[_0x89ad('0x9')](_0x89ad('0xa'),auth[_0x89ad('0xb')](),controller[_0x89ad('0xc')]);router[_0x89ad('0xd')](_0x89ad('0xa'),auth[_0x89ad('0xb')](),controller['update']);router[_0x89ad('0xe')](_0x89ad('0xa'),auth[_0x89ad('0xb')](),controller[_0x89ad('0xf')]);module['exports']=router;
\ No newline at end of file
index 3aa47cd..0b4f558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab47=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0xb3ac16,_0x429c90){var _0x5251a8=function(_0x4c9d5b){while(--_0x4c9d5b){_0xb3ac16['push'](_0xb3ac16['shift']());}};_0x5251a8(++_0x429c90);}(_0xab47,0x187));var _0x7ab4=function(_0x4c321c,_0x3e9da0){_0x4c321c=_0x4c321c-0x0;var _0x25accb=_0xab47[_0x4c321c];return _0x25accb;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x7ab4('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x7ab4('0x1')],'allowNull':![],'defaultValue':_0x7ab4('0x2')},'appdata':{'type':Sequelize[_0x7ab4('0x3')]()},'description':{'type':Sequelize[_0x7ab4('0x1')]},'interval':{'type':Sequelize[_0x7ab4('0x1')],'defaultValue':_0x7ab4('0x4')}};
\ No newline at end of file
+var _0x7948=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x5421d2,_0x45709b){var _0x233e11=function(_0x3ec917){while(--_0x3ec917){_0x5421d2['push'](_0x5421d2['shift']());}};_0x233e11(++_0x45709b);}(_0x7948,0xf2));var _0x8794=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x7948[_0x58dc25];return _0x21b0a7;};'use strict';var Sequelize=require(_0x8794('0x0'));module[_0x8794('0x1')]={'priority':{'type':Sequelize[_0x8794('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8794('0x3')],'allowNull':![],'defaultValue':_0x8794('0x4')},'appdata':{'type':Sequelize[_0x8794('0x5')]()},'description':{'type':Sequelize[_0x8794('0x3')]},'interval':{'type':Sequelize[_0x8794('0x3')],'defaultValue':_0x8794('0x6')}};
\ No newline at end of file
index 943709f..3ed88c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x41353c,_0xae685c){var _0x14a15b=function(_0x2ba60e){while(--_0x2ba60e){_0x41353c['push'](_0x41353c['shift']());}};_0x14a15b(++_0xae685c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0xcb91[_0x519756];return _0x37047e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));};
\ No newline at end of file
+var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x5a7188,_0x2ec5ad){var _0x805ef=function(_0x2dfeba){while(--_0x2dfeba){_0x5a7188['push'](_0x5a7188['shift']());}};_0x805ef(++_0x2ec5ad);}(_0xe706,0xa3));var _0x6e70=function(_0xea1570,_0x2f7856){_0xea1570=_0xea1570-0x0;var _0x579e74=_0xe706[_0xea1570];return _0x579e74;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));};
\ No newline at end of file
index ef788af..3a64876 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e5f=['../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e5f,0x68));var _0xf7e5=function(_0x3b4b1d,_0x15029e){_0x3b4b1d=_0x3b4b1d-0x0;var _0x488c36=_0x7e5f[_0x3b4b1d];return _0x488c36;};'use strict';var _=require(_0xf7e5('0x0'));var util=require(_0xf7e5('0x1'));var logger=require(_0xf7e5('0x2'))(_0xf7e5('0x3'));var moment=require(_0xf7e5('0x4'));var BPromise=require(_0xf7e5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf7e5('0x6'));var rimraf=require(_0xf7e5('0x7'));var config=require(_0xf7e5('0x8'));var attributes=require(_0xf7e5('0x9'));module['exports']=function(_0x37f865,_0x34b408){return _0x37f865[_0xf7e5('0xa')](_0xf7e5('0xb'),attributes,{'tableName':_0xf7e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf7e5('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xad35=['request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x5c842e,_0x68a349){var _0x6bc1d=function(_0x577bc6){while(--_0x577bc6){_0x5c842e['push'](_0x5c842e['shift']());}};_0x6bc1d(++_0x68a349);}(_0xad35,0xda));var _0x5ad3=function(_0x305ffc,_0x207b75){_0x305ffc=_0x305ffc-0x0;var _0x33b681=_0xad35[_0x305ffc];return _0x33b681;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5ad3('0x0'))(_0x5ad3('0x1'));var moment=require(_0x5ad3('0x2'));var BPromise=require('bluebird');var rp=require(_0x5ad3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5ad3('0x4'));var config=require(_0x5ad3('0x5'));var attributes=require(_0x5ad3('0x6'));module[_0x5ad3('0x7')]=function(_0x1fc14a,_0x9fc1e0){return _0x1fc14a[_0x5ad3('0x8')](_0x5ad3('0x9'),attributes,{'tableName':_0x5ad3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5ad3('0xb'),'collate':_0x5ad3('0xc')});};
\ No newline at end of file
index f2fa53e..44e406e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb991=['UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb991,0x69));var _0x1b99=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb991[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x1b99('0x0'));var util=require(_0x1b99('0x1'));var moment=require(_0x1b99('0x2'));var BPromise=require(_0x1b99('0x3'));var rs=require(_0x1b99('0x4'));var fs=require('fs');var Redis=require(_0x1b99('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b99('0x6'));var logger=require(_0x1b99('0x7'))(_0x1b99('0x8'));var config=require(_0x1b99('0x9'));var jayson=require(_0x1b99('0xa'));var client=jayson[_0x1b99('0xb')][_0x1b99('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2693a5,_0x5cd2d3,_0x592297){return new BPromise(function(_0x3bb0ee,_0x1694e7){return client['request'](_0x2693a5,_0x592297)['then'](function(_0x415ae1){logger[_0x1b99('0xd')](_0x1b99('0xe'),_0x5cd2d3,_0x1b99('0xf'));logger['debug'](_0x1b99('0x10'),_0x5cd2d3,_0x1b99('0xf'),JSON[_0x1b99('0x11')](_0x415ae1));if(_0x415ae1[_0x1b99('0x12')]){if(_0x415ae1['error'][_0x1b99('0x13')]===0x1f4){logger['error'](_0x1b99('0xe'),_0x5cd2d3,_0x415ae1[_0x1b99('0x12')][_0x1b99('0x14')]);return _0x1694e7(_0x415ae1[_0x1b99('0x12')][_0x1b99('0x14')]);}logger[_0x1b99('0x12')](_0x1b99('0xe'),_0x5cd2d3,_0x415ae1['error'][_0x1b99('0x14')]);return _0x3bb0ee(_0x415ae1['error'][_0x1b99('0x14')]);}else{logger[_0x1b99('0xd')](_0x1b99('0xe'),_0x5cd2d3,'request\x20sent');_0x3bb0ee(_0x415ae1[_0x1b99('0x15')]['message']);}})[_0x1b99('0x16')](function(_0x2f4e6a){logger[_0x1b99('0x12')](_0x1b99('0xe'),_0x5cd2d3,_0x2f4e6a);_0x1694e7(_0x2f4e6a);});});}exports[_0x1b99('0x17')]=function(_0x4e219e){var _0x1d314a=this;return new Promise(function(_0x480e94,_0x3983c8){return db[_0x1b99('0x18')][_0x1b99('0x19')](_0x4e219e[_0x1b99('0x1a')],{'raw':_0x4e219e[_0x1b99('0x1b')]?_0x4e219e[_0x1b99('0x1b')][_0x1b99('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e219e[_0x1b99('0x1b')]?_0x4e219e[_0x1b99('0x1b')][_0x1b99('0x1d')]||null:null,'attributes':_0x4e219e['options']?_0x4e219e['options'][_0x1b99('0x1e')]||null:null,'limit':_0x4e219e[_0x1b99('0x1b')]?_0x4e219e[_0x1b99('0x1b')]['limit']||null:null})['then'](function(_0xa7ded2){logger[_0x1b99('0xd')](_0x1b99('0x17'),_0x4e219e);logger[_0x1b99('0x1f')](_0x1b99('0x17'),_0x4e219e,JSON[_0x1b99('0x11')](_0xa7ded2));_0x480e94(_0xa7ded2);})[_0x1b99('0x16')](function(_0x270c88){logger['error'](_0x1b99('0x17'),_0x270c88[_0x1b99('0x14')],_0x4e219e);_0x3983c8(_0x1d314a['error'](0x1f4,_0x270c88[_0x1b99('0x14')]));});});};
\ No newline at end of file
+var _0x10d6=['debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailApplication','update','body','options','raw','where','attributes','UpdateMailApplication','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x366936,_0x52dd0d){var _0x1ef23b=function(_0x1860ba){while(--_0x1860ba){_0x366936['push'](_0x366936['shift']());}};_0x1ef23b(++_0x52dd0d);}(_0x10d6,0x145));var _0x610d=function(_0x4128f9,_0x2700bd){_0x4128f9=_0x4128f9-0x0;var _0x3d74fd=_0x10d6[_0x4128f9];return _0x3d74fd;};'use strict';var _=require('lodash');var util=require(_0x610d('0x0'));var moment=require(_0x610d('0x1'));var BPromise=require(_0x610d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x610d('0x3'));var db=require(_0x610d('0x4'))['db'];var utils=require(_0x610d('0x5'));var logger=require(_0x610d('0x6'))(_0x610d('0x7'));var config=require(_0x610d('0x8'));var jayson=require(_0x610d('0x9'));var client=jayson['client'][_0x610d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19f748,_0x289610,_0x1c3d9c){return new BPromise(function(_0x510827,_0x38838d){return client[_0x610d('0xb')](_0x19f748,_0x1c3d9c)[_0x610d('0xc')](function(_0x1bc097){logger[_0x610d('0xd')](_0x610d('0xe'),_0x289610,_0x610d('0xf'));logger[_0x610d('0x10')](_0x610d('0x11'),_0x289610,'request\x20sent',JSON[_0x610d('0x12')](_0x1bc097));if(_0x1bc097[_0x610d('0x13')]){if(_0x1bc097['error'][_0x610d('0x14')]===0x1f4){logger[_0x610d('0x13')]('MailApplication,\x20%s,\x20%s',_0x289610,_0x1bc097[_0x610d('0x13')][_0x610d('0x15')]);return _0x38838d(_0x1bc097[_0x610d('0x13')]['message']);}logger[_0x610d('0x13')](_0x610d('0xe'),_0x289610,_0x1bc097[_0x610d('0x13')]['message']);return _0x510827(_0x1bc097['error']['message']);}else{logger[_0x610d('0xd')](_0x610d('0xe'),_0x289610,_0x610d('0xf'));_0x510827(_0x1bc097['result'][_0x610d('0x15')]);}})['catch'](function(_0x13b023){logger[_0x610d('0x13')](_0x610d('0xe'),_0x289610,_0x13b023);_0x38838d(_0x13b023);});});}exports['UpdateMailApplication']=function(_0x2a4f41){var _0x4b6dc9=this;return new Promise(function(_0x19b6e1,_0x4c46a9){return db[_0x610d('0x16')][_0x610d('0x17')](_0x2a4f41[_0x610d('0x18')],{'raw':_0x2a4f41[_0x610d('0x19')]?_0x2a4f41[_0x610d('0x19')][_0x610d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a4f41[_0x610d('0x19')]?_0x2a4f41['options'][_0x610d('0x1b')]||null:null,'attributes':_0x2a4f41[_0x610d('0x19')]?_0x2a4f41['options'][_0x610d('0x1c')]||null:null,'limit':_0x2a4f41[_0x610d('0x19')]?_0x2a4f41[_0x610d('0x19')]['limit']||null:null})[_0x610d('0xc')](function(_0x6bd107){logger['info']('UpdateMailApplication',_0x2a4f41);logger[_0x610d('0x10')](_0x610d('0x1d'),_0x2a4f41,JSON[_0x610d('0x12')](_0x6bd107));_0x19b6e1(_0x6bd107);})[_0x610d('0x1e')](function(_0x5c2a7d){logger[_0x610d('0x13')](_0x610d('0x1d'),_0x5c2a7d[_0x610d('0x15')],_0x2a4f41);_0x4c46a9(_0x4b6dc9[_0x610d('0x13')](0x1f4,_0x5c2a7d[_0x610d('0x15')]));});});};
\ No newline at end of file
index 5c30242..d0529aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83b1=['removeTags','exports','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','mail','put','tracked','mailinteraction:destroy','delete'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x83b1,0x98));var _0x183b=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x83b1[_0x3a6efd];return _0x487b9a;};'use strict';var express=require(_0x183b('0x0'));var router=express['Router']();var auth=require(_0x183b('0x1'));var interaction=require(_0x183b('0x2'));var controller=require(_0x183b('0x3'));router[_0x183b('0x4')]('/',auth[_0x183b('0x5')](),controller[_0x183b('0x6')]);router['get'](_0x183b('0x7'),auth[_0x183b('0x5')](),controller['describe']);router[_0x183b('0x4')](_0x183b('0x8'),auth[_0x183b('0x5')](),controller[_0x183b('0x9')]);router[_0x183b('0x4')]('/:id/messages',auth[_0x183b('0x5')](),controller[_0x183b('0xa')]);router[_0x183b('0x4')](_0x183b('0xb'),auth['isAuthenticated'](),controller[_0x183b('0xc')]);router[_0x183b('0xd')]('/',auth[_0x183b('0x5')](),controller[_0x183b('0xe')]);router['post'](_0x183b('0xf'),auth[_0x183b('0x5')](),controller[_0x183b('0x10')]);router['post'](_0x183b('0x11'),auth[_0x183b('0x5')](),interaction['tracked'](_0x183b('0x12'),'mailinteraction:addtags'),controller['addTags']);router[_0x183b('0x13')](_0x183b('0x8'),auth['isAuthenticated'](),interaction[_0x183b('0x14')](_0x183b('0x12'),'mailinteraction:update'),controller['update']);router['delete']('/:id',auth[_0x183b('0x5')](),interaction['tracked'](_0x183b('0x12'),_0x183b('0x15')),controller['destroy']);router[_0x183b('0x16')]('/:id/tags',auth[_0x183b('0x5')](),controller[_0x183b('0x17')]);module[_0x183b('0x18')]=router;
\ No newline at end of file
+var _0xc2b9=['/describe','describe','/:id','show','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index'];(function(_0x2acce8,_0x24c744){var _0x4b8601=function(_0x487ecc){while(--_0x487ecc){_0x2acce8['push'](_0x2acce8['shift']());}};_0x4b8601(++_0x24c744);}(_0xc2b9,0x13e));var _0x9c2b=function(_0x4c2342,_0x5d9002){_0x4c2342=_0x4c2342-0x0;var _0x82d06d=_0xc2b9[_0x4c2342];return _0x82d06d;};'use strict';var express=require('express');var router=express[_0x9c2b('0x0')]();var auth=require(_0x9c2b('0x1'));var interaction=require(_0x9c2b('0x2'));var controller=require(_0x9c2b('0x3'));router[_0x9c2b('0x4')]('/',auth[_0x9c2b('0x5')](),controller[_0x9c2b('0x6')]);router[_0x9c2b('0x4')](_0x9c2b('0x7'),auth[_0x9c2b('0x5')](),controller[_0x9c2b('0x8')]);router[_0x9c2b('0x4')](_0x9c2b('0x9'),auth[_0x9c2b('0x5')](),controller[_0x9c2b('0xa')]);router[_0x9c2b('0x4')]('/:id/messages',auth[_0x9c2b('0x5')](),controller['getMessages']);router[_0x9c2b('0x4')]('/:id/download',auth[_0x9c2b('0x5')](),controller['download']);router[_0x9c2b('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9c2b('0xb')]('/:id/messages',auth[_0x9c2b('0x5')](),controller[_0x9c2b('0xc')]);router[_0x9c2b('0xb')](_0x9c2b('0xd'),auth[_0x9c2b('0x5')](),interaction[_0x9c2b('0xe')](_0x9c2b('0xf'),_0x9c2b('0x10')),controller[_0x9c2b('0x11')]);router[_0x9c2b('0x12')]('/:id',auth[_0x9c2b('0x5')](),interaction[_0x9c2b('0xe')](_0x9c2b('0xf'),_0x9c2b('0x13')),controller[_0x9c2b('0x14')]);router[_0x9c2b('0x15')](_0x9c2b('0x9'),auth[_0x9c2b('0x5')](),interaction['tracked']('mail','mailinteraction:destroy'),controller[_0x9c2b('0x16')]);router['delete']('/:id/tags',auth[_0x9c2b('0x5')](),controller[_0x9c2b('0x17')]);module[_0x9c2b('0x18')]=router;
\ No newline at end of file
index 1aa2bb5..4851858 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d59=['BOOLEAN','ENUM','out','sequelize','iconv','exports','DATE','STRING','TEXT'];(function(_0x49fc66,_0x4882b1){var _0x4557c5=function(_0x31ed09){while(--_0x31ed09){_0x49fc66['push'](_0x49fc66['shift']());}};_0x4557c5(++_0x4882b1);}(_0x5d59,0x159));var _0x95d5=function(_0x16169b,_0x1fe209){_0x16169b=_0x16169b-0x0;var _0x7a7d78=_0x5d59[_0x16169b];return _0x7a7d78;};'use strict';var Sequelize=require(_0x95d5('0x0'));var iconv=require(_0x95d5('0x1'));module[_0x95d5('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x95d5('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x95d5('0x4')]},'note':{'type':Sequelize[_0x95d5('0x4')]},'inReplyTo':{'type':Sequelize[_0x95d5('0x4')](0x1fe)},'to':{'type':Sequelize[_0x95d5('0x4')]},'cc':{'type':Sequelize[_0x95d5('0x5')]('long')},'subject':{'type':Sequelize[_0x95d5('0x5')]()},'attach':{'type':Sequelize[_0x95d5('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x95d5('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x95d5('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x95d5('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x95d5('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x95d5('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3de2=['out','sequelize','exports','BOOLEAN','DATE','STRING','TEXT','ENUM'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3de2,0x79));var _0x23de=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x3de2[_0xef8146];return _0x5a6cb0;};'use strict';var Sequelize=require(_0x23de('0x0'));var iconv=require('iconv');module[_0x23de('0x1')]={'closed':{'type':Sequelize[_0x23de('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x23de('0x3')]},'disposition':{'type':Sequelize[_0x23de('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x23de('0x4')]},'inReplyTo':{'type':Sequelize[_0x23de('0x4')](0x1fe)},'to':{'type':Sequelize[_0x23de('0x4')]},'cc':{'type':Sequelize[_0x23de('0x5')]('long')},'subject':{'type':Sequelize[_0x23de('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x23de('0x3')]},'substatus':{'type':Sequelize[_0x23de('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x23de('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x23de('0x6')]('in',_0x23de('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x23de('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x23de('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x23de('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 8245a56..d28d432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x45b69d,_0x3c11f8){var _0x4b0da9=function(_0x2cebc3){while(--_0x2cebc3){_0x45b69d['push'](_0x45b69d['shift']());}};_0x4b0da9(++_0x3c11f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('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');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));};
\ No newline at end of file
+var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xb10b,0x12a));var _0xbb10=function(_0x56be45,_0x10cd0e){_0x56be45=_0x56be45-0x0;var _0x1b75d3=_0xb10b[_0x56be45];return _0x1b75d3;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));};
\ No newline at end of file
index 90ab12b..ddb34e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3f3=['Users','map','findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x2cc157,_0x5a6161){var _0x2c9897=function(_0x5dfd59){while(--_0x5dfd59){_0x2cc157['push'](_0x2cc157['shift']());}};_0x2c9897(++_0x5a6161);}(_0xb3f3,0x1b5));var _0x3b3f=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xb3f3[_0x4c445a];return _0x2f611c;};'use strict';var EventEmitter=require(_0x3b3f('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x3b3f('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3b3f('0x2')](0x0);var events={'afterCreate':_0x3b3f('0x3'),'afterUpdate':'update','afterDestroy':_0x3b3f('0x4')};function emitEvent(_0x1f7c1b){return function(_0x8fe6ea,_0x202b30,_0x183ce0){_0x8fe6ea['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x11f403){_0x8fe6ea['setDataValue'](_0x3b3f('0x5'),_0x11f403[_0x3b3f('0x6')](function(_0x279fa4){return{'id':_0x279fa4['id']};}));return MailMessage[_0x3b3f('0x7')]({'where':{'MailInteractionId':_0x8fe6ea['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3b3f('0x8')](function(_0x5906a2){_0x8fe6ea[_0x3b3f('0x9')](_0x3b3f('0xa'),_0x5906a2[_0x3b3f('0xb')]);MailInteractionEvents[_0x3b3f('0xc')](_0x1f7c1b+':'+_0x8fe6ea['id'],_0x8fe6ea);MailInteractionEvents[_0x3b3f('0xc')](_0x1f7c1b,_0x8fe6ea);_0x183ce0(null);})[_0x3b3f('0xd')](_0x183ce0(null));};}for(var e in events){if(events[_0x3b3f('0xe')](e)){var event=events[e];MailInteraction[_0x3b3f('0xf')](e,emitEvent(event));}}module[_0x3b3f('0x10')]=MailInteractionEvents;
\ No newline at end of file
+var _0xacd6=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','remove','then','setDataValue','map','unreadMessages'];(function(_0xf8ef4a,_0x34a9d5){var _0x1869c9=function(_0x130a7e){while(--_0x130a7e){_0xf8ef4a['push'](_0xf8ef4a['shift']());}};_0x1869c9(++_0x34a9d5);}(_0xacd6,0x1b6));var _0x6acd=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xacd6[_0x819464];return _0x49dcc0;};'use strict';var EventEmitter=require(_0x6acd('0x0'));var MailInteraction=require(_0x6acd('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x6acd('0x1'))['db'][_0x6acd('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6acd('0x3')](0x0);var events={'afterCreate':_0x6acd('0x4'),'afterUpdate':'update','afterDestroy':_0x6acd('0x5')};function emitEvent(_0x7363ca){return function(_0x2bfbe3,_0x2d1033,_0x496913){_0x2bfbe3['getUsers']({'attributes':['id'],'raw':!![]})[_0x6acd('0x6')](function(_0x2e2b03){_0x2bfbe3[_0x6acd('0x7')]('Users',_0x2e2b03[_0x6acd('0x8')](function(_0x41135b){return{'id':_0x41135b['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x2bfbe3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3a84fa){_0x2bfbe3[_0x6acd('0x7')](_0x6acd('0x9'),_0x3a84fa[_0x6acd('0xa')]);MailInteractionEvents[_0x6acd('0xb')](_0x7363ca+':'+_0x2bfbe3['id'],_0x2bfbe3);MailInteractionEvents[_0x6acd('0xb')](_0x7363ca,_0x2bfbe3);_0x496913(null);})[_0x6acd('0xc')](_0x496913(null));};}for(var e in events){if(events[_0x6acd('0xd')](e)){var event=events[e];MailInteraction[_0x6acd('0xe')](e,emitEvent(event));}}module[_0x6acd('0xf')]=MailInteractionEvents;
\ No newline at end of file
index 57a9832..8ff776d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8102=['changed','substatus','models','MailMessage','update','then','catch','utf8mb4','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt'];(function(_0x4ef1c3,_0x1594c3){var _0x3407e8=function(_0x3e3acd){while(--_0x3e3acd){_0x4ef1c3['push'](_0x4ef1c3['shift']());}};_0x3407e8(++_0x1594c3);}(_0x8102,0xf2));var _0x2810=function(_0x83c3eb,_0x17d3a6){_0x83c3eb=_0x83c3eb-0x0;var _0xc1dfa=_0x8102[_0x83c3eb];return _0xc1dfa;};'use strict';var _=require('lodash');var util=require(_0x2810('0x0'));var logger=require(_0x2810('0x1'))(_0x2810('0x2'));var moment=require('moment');var BPromise=require(_0x2810('0x3'));var rp=require(_0x2810('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2810('0x5'));var config=require(_0x2810('0x6'));var attributes=require(_0x2810('0x7'));module[_0x2810('0x8')]=function(_0x42678e,_0x19eaa0){return _0x42678e[_0x2810('0x9')](_0x2810('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x2810('0xb'),'fields':['subject','to'],'type':_0x2810('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3449bd,_0x438afc,_0x2757a9){if(_0x3449bd['substatus']){_0x3449bd[_0x2810('0xd')]=moment()[_0x2810('0xe')](_0x2810('0xf'));}if(_0x3449bd[_0x2810('0x10')]){_0x3449bd[_0x2810('0x11')]=moment()['format'](_0x2810('0xf'));}_0x2757a9(null,_0x438afc);},'beforeUpdate':function(_0x1620f4,_0x265731,_0x2723ce){if(_0x1620f4[_0x2810('0x12')](_0x2810('0x13'))){_0x1620f4['substatusAt']=_0x1620f4[_0x2810('0x13')]?moment()['format'](_0x2810('0xf')):null;}if(_0x1620f4[_0x2810('0x12')](_0x2810('0x10'))){_0x1620f4['closedAt']=moment()[_0x2810('0xe')](_0x2810('0xf'));_0x1620f4[_0x2810('0x13')]=null;_0x1620f4[_0x2810('0xd')]=null;}_0x2723ce(null,_0x1620f4);},'afterUpdate':function(_0x2c31a3,_0x2153e2,_0x53ed23){var _0x280f57=_0x42678e[_0x2810('0x14')];var _0x233882=_0x2c31a3['get']({'plain':!![]});if(_0x233882[_0x2810('0x10')]){return _0x280f57[_0x2810('0x15')][_0x2810('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x233882['id']}})[_0x2810('0x17')](function(){_0x53ed23();})[_0x2810('0x18')](function(_0x859b28){_0x53ed23(_0x859b28);});}else{_0x53ed23();}}},'charset':_0x2810('0x19'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8017=['util','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','get','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x275741,_0x43c5c2){var _0x193c3f=function(_0x5be5ca){while(--_0x5be5ca){_0x275741['push'](_0x275741['shift']());}};_0x193c3f(++_0x43c5c2);}(_0x8017,0x137));var _0x7801=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0x8017[_0x2d982d];return _0x4f36b0;};'use strict';var _=require(_0x7801('0x0'));var util=require(_0x7801('0x1'));var logger=require('../../config/logger')(_0x7801('0x2'));var moment=require(_0x7801('0x3'));var BPromise=require(_0x7801('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7801('0x5'));var rimraf=require(_0x7801('0x6'));var config=require(_0x7801('0x7'));var attributes=require(_0x7801('0x8'));module[_0x7801('0x9')]=function(_0x1d32f3,_0x3a29cb){return _0x1d32f3[_0x7801('0xa')](_0x7801('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x7801('0xc'),'to'],'type':_0x7801('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2c0dd8,_0x56cfd8,_0x590217){if(_0x2c0dd8[_0x7801('0xe')]){_0x2c0dd8[_0x7801('0xf')]=moment()['format'](_0x7801('0x10'));}if(_0x2c0dd8[_0x7801('0x11')]){_0x2c0dd8[_0x7801('0x12')]=moment()[_0x7801('0x13')]('YYYY-MM-DD\x20HH:mm:ss');}_0x590217(null,_0x56cfd8);},'beforeUpdate':function(_0x134add,_0x3eee19,_0x2cb1cc){if(_0x134add[_0x7801('0x14')](_0x7801('0xe'))){_0x134add[_0x7801('0xf')]=_0x134add[_0x7801('0xe')]?moment()[_0x7801('0x13')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x134add['changed']('closed')){_0x134add[_0x7801('0x12')]=moment()[_0x7801('0x13')](_0x7801('0x10'));_0x134add[_0x7801('0xe')]=null;_0x134add['substatusAt']=null;}_0x2cb1cc(null,_0x134add);},'afterUpdate':function(_0xe5268b,_0x573254,_0xc7b153){var _0x2a1f8c=_0x1d32f3['models'];var _0x56eba9=_0xe5268b[_0x7801('0x15')]({'plain':!![]});if(_0x56eba9[_0x7801('0x11')]){return _0x2a1f8c['MailMessage'][_0x7801('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x56eba9['id']}})['then'](function(){_0xc7b153();})[_0x7801('0x17')](function(_0x370428){_0xc7b153(_0x370428);});}else{_0xc7b153();}}},'charset':_0x7801('0x18'),'collate':_0x7801('0x19')});};
\ No newline at end of file
index 5b5880d..581195a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4745=['attributes','limit','AddTagsToMailInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateMailInteraction','body','options','raw','where'];(function(_0x1bb030,_0x27d05f){var _0x28ef4f=function(_0xb1150e){while(--_0xb1150e){_0x1bb030['push'](_0x1bb030['shift']());}};_0x28ef4f(++_0x27d05f);}(_0x4745,0x1e7));var _0x5474=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x4745[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var BPromise=require(_0x5474('0x3'));var rs=require(_0x5474('0x4'));var fs=require('fs');var Redis=require(_0x5474('0x5'));var db=require(_0x5474('0x6'))['db'];var utils=require(_0x5474('0x7'));var logger=require(_0x5474('0x8'))(_0x5474('0x9'));var config=require(_0x5474('0xa'));var jayson=require(_0x5474('0xb'));var client=jayson['client'][_0x5474('0xc')]({'port':0x232a});config[_0x5474('0xd')]=_['defaults'](config[_0x5474('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x5474('0xe'))(new Redis(config[_0x5474('0xd')]));require('./mailInteraction.socket')[_0x5474('0xf')](socket);function respondWithRpcPromise(_0x11dcb2,_0x46b4b3,_0x26cceb){return new BPromise(function(_0x4444dd,_0x40c4a8){return client[_0x5474('0x10')](_0x11dcb2,_0x26cceb)[_0x5474('0x11')](function(_0x48fc51){logger[_0x5474('0x12')](_0x5474('0x13'),_0x46b4b3,_0x5474('0x14'));logger[_0x5474('0x15')](_0x5474('0x16'),_0x46b4b3,_0x5474('0x14'),JSON[_0x5474('0x17')](_0x48fc51));if(_0x48fc51[_0x5474('0x18')]){if(_0x48fc51[_0x5474('0x18')]['code']===0x1f4){logger[_0x5474('0x18')](_0x5474('0x13'),_0x46b4b3,_0x48fc51[_0x5474('0x18')][_0x5474('0x19')]);return _0x40c4a8(_0x48fc51['error']['message']);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x46b4b3,_0x48fc51[_0x5474('0x18')][_0x5474('0x19')]);return _0x4444dd(_0x48fc51[_0x5474('0x18')]['message']);}else{logger[_0x5474('0x12')](_0x5474('0x13'),_0x46b4b3,'request\x20sent');_0x4444dd(_0x48fc51[_0x5474('0x1a')][_0x5474('0x19')]);}})[_0x5474('0x1b')](function(_0x469d62){logger[_0x5474('0x18')]('MailInteraction,\x20%s,\x20%s',_0x46b4b3,_0x469d62);_0x40c4a8(_0x469d62);});});}exports[_0x5474('0x1c')]=function(_0x5f31a9){var _0x3023cd=this;return new Promise(function(_0x178e5c,_0x50d3a1){return db['MailInteraction']['update'](_0x5f31a9[_0x5474('0x1d')],{'raw':_0x5f31a9[_0x5474('0x1e')]?_0x5f31a9[_0x5474('0x1e')][_0x5474('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f31a9[_0x5474('0x1e')]?_0x5f31a9[_0x5474('0x1e')][_0x5474('0x20')]||null:null,'attributes':_0x5f31a9[_0x5474('0x1e')]?_0x5f31a9[_0x5474('0x1e')][_0x5474('0x21')]||null:null,'limit':_0x5f31a9['options']?_0x5f31a9['options'][_0x5474('0x22')]||null:null})[_0x5474('0x11')](function(_0x40151a){logger['info'](_0x5474('0x1c'),_0x5f31a9);logger['debug'](_0x5474('0x1c'),_0x5f31a9,JSON[_0x5474('0x17')](_0x40151a));_0x178e5c(_0x40151a);})['catch'](function(_0x2a5f03){logger['error'](_0x5474('0x1c'),_0x2a5f03['message'],_0x5f31a9);_0x50d3a1(_0x3023cd[_0x5474('0x18')](0x1f4,_0x2a5f03[_0x5474('0x19')]));});});};exports[_0x5474('0x23')]=function(_0x5865fe){return new Promise(function(_0x574ed6,_0x42b99a){return db['MailInteraction']['find']({'where':_0x5865fe['options']?_0x5865fe['options'][_0x5474('0x20')]||null:null})[_0x5474('0x11')](function(_0x54cd0c){if(_0x54cd0c){return _0x54cd0c[_0x5474('0x24')](_0x5865fe['body'][_0x5474('0x25')],_['omit'](_0x5865fe[_0x5474('0x1d')],['ids','id'])||{});}})[_0x5474('0x26')](function(_0x596221){logger[_0x5474('0x12')](_0x5474('0x27'),_0x5865fe);logger[_0x5474('0x15')](_0x5474('0x27'),_0x5865fe,JSON['stringify'](_0x596221));_0x574ed6(_0x596221);})['catch'](function(_0x44e089){logger[_0x5474('0x18')](_0x5474('0x27'),_0x44e089[_0x5474('0x19')],_0x5865fe);_0x42b99a(_this['error'](0x1f4,_0x44e089['message']));});});};
\ No newline at end of file
+var _0x463e=['then','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateMailInteraction','update','options','where','limit','debug','AddTagsToMailInteraction','find','addTags','body','ids','spread','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x463e,0x13f));var _0xe463=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x463e[_0x411add];return _0x238242;};'use strict';var _=require(_0xe463('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe463('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe463('0x2'));var db=require(_0xe463('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe463('0x4'))(_0xe463('0x5'));var config=require(_0xe463('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe463('0x7')]({'port':0x232a});config[_0xe463('0x8')]=_[_0xe463('0x9')](config[_0xe463('0x8')],{'host':_0xe463('0xa'),'port':0x18eb});var socket=require(_0xe463('0xb'))(new Redis(config['redis']));require(_0xe463('0xc'))['register'](socket);function respondWithRpcPromise(_0x2d77f3,_0x116cf0,_0x2733be){return new BPromise(function(_0x23dea3,_0x360725){return client[_0xe463('0xd')](_0x2d77f3,_0x2733be)[_0xe463('0xe')](function(_0x4d16fc){logger['info'](_0xe463('0xf'),_0x116cf0,_0xe463('0x10'));logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x116cf0,_0xe463('0x10'),JSON[_0xe463('0x11')](_0x4d16fc));if(_0x4d16fc[_0xe463('0x12')]){if(_0x4d16fc[_0xe463('0x12')][_0xe463('0x13')]===0x1f4){logger[_0xe463('0x12')]('MailInteraction,\x20%s,\x20%s',_0x116cf0,_0x4d16fc[_0xe463('0x12')][_0xe463('0x14')]);return _0x360725(_0x4d16fc['error'][_0xe463('0x14')]);}logger[_0xe463('0x12')](_0xe463('0xf'),_0x116cf0,_0x4d16fc[_0xe463('0x12')]['message']);return _0x23dea3(_0x4d16fc[_0xe463('0x12')][_0xe463('0x14')]);}else{logger[_0xe463('0x15')](_0xe463('0xf'),_0x116cf0,'request\x20sent');_0x23dea3(_0x4d16fc[_0xe463('0x16')][_0xe463('0x14')]);}})[_0xe463('0x17')](function(_0x32430f){logger['error'](_0xe463('0xf'),_0x116cf0,_0x32430f);_0x360725(_0x32430f);});});}exports[_0xe463('0x18')]=function(_0x2dc56c){var _0x169f64=this;return new Promise(function(_0x16a677,_0x502410){return db['MailInteraction'][_0xe463('0x19')](_0x2dc56c['body'],{'raw':_0x2dc56c[_0xe463('0x1a')]?_0x2dc56c[_0xe463('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dc56c['options']?_0x2dc56c[_0xe463('0x1a')][_0xe463('0x1b')]||null:null,'attributes':_0x2dc56c[_0xe463('0x1a')]?_0x2dc56c[_0xe463('0x1a')]['attributes']||null:null,'limit':_0x2dc56c[_0xe463('0x1a')]?_0x2dc56c[_0xe463('0x1a')][_0xe463('0x1c')]||null:null})[_0xe463('0xe')](function(_0x157ea4){logger[_0xe463('0x15')](_0xe463('0x18'),_0x2dc56c);logger[_0xe463('0x1d')](_0xe463('0x18'),_0x2dc56c,JSON[_0xe463('0x11')](_0x157ea4));_0x16a677(_0x157ea4);})['catch'](function(_0x1e8a3){logger['error'](_0xe463('0x18'),_0x1e8a3[_0xe463('0x14')],_0x2dc56c);_0x502410(_0x169f64[_0xe463('0x12')](0x1f4,_0x1e8a3['message']));});});};exports[_0xe463('0x1e')]=function(_0x96940b){return new Promise(function(_0x22cae,_0xe6ab8){return db['MailInteraction'][_0xe463('0x1f')]({'where':_0x96940b[_0xe463('0x1a')]?_0x96940b['options'][_0xe463('0x1b')]||null:null})[_0xe463('0xe')](function(_0x119c64){if(_0x119c64){return _0x119c64[_0xe463('0x20')](_0x96940b[_0xe463('0x21')]['ids'],_['omit'](_0x96940b[_0xe463('0x21')],[_0xe463('0x22'),'id'])||{});}})[_0xe463('0x23')](function(_0x33ee35){logger[_0xe463('0x15')](_0xe463('0x24'),_0x96940b);logger[_0xe463('0x1d')]('AddTags',_0x96940b,JSON['stringify'](_0x33ee35));_0x22cae(_0x33ee35);})[_0xe463('0x17')](function(_0x167c98){logger['error']('AddTags',_0x167c98[_0xe463('0x14')],_0x96940b);_0xe6ab8(_this['error'](0x1f4,_0x167c98[_0xe463('0x14')]));});});};
\ No newline at end of file
index 985a0df..5bbcf22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe952=['length','mailInteraction:','./mailInteraction.events','save','remove','update','removeListener','register'];(function(_0x28b463,_0x21eec9){var _0x4e9535=function(_0xd9000c){while(--_0xd9000c){_0x28b463['push'](_0x28b463['shift']());}};_0x4e9535(++_0x21eec9);}(_0xe952,0x1da));var _0x2e95=function(_0x4f04db,_0x53ed80){_0x4f04db=_0x4f04db-0x0;var _0xe38a0f=_0xe952[_0x4f04db];return _0xe38a0f;};'use strict';var MailInteractionEvents=require(_0x2e95('0x0'));var events=[_0x2e95('0x1'),_0x2e95('0x2'),_0x2e95('0x3')];function createListener(_0x15ac5c,_0x5f581d){return function(_0x251c66){_0x5f581d['emit'](_0x15ac5c,_0x251c66);};}function removeListener(_0x260d35,_0x30ebe8){return function(){MailInteractionEvents[_0x2e95('0x4')](_0x260d35,_0x30ebe8);};}exports[_0x2e95('0x5')]=function(_0x55f433){for(var _0x1cc430=0x0,_0x32e764=events[_0x2e95('0x6')];_0x1cc430<_0x32e764;_0x1cc430++){var _0xf44a59=events[_0x1cc430];var _0x3b1406=createListener(_0x2e95('0x7')+_0xf44a59,_0x55f433);MailInteractionEvents['on'](_0xf44a59,_0x3b1406);}};
\ No newline at end of file
+var _0xbba3=['emit','register','length','mailInteraction:','./mailInteraction.events','save','remove','update'];(function(_0x269810,_0x53c8c9){var _0xc26fe2=function(_0x4f40f2){while(--_0x4f40f2){_0x269810['push'](_0x269810['shift']());}};_0xc26fe2(++_0x53c8c9);}(_0xbba3,0x134));var _0x3bba=function(_0xc5a306,_0x50974d){_0xc5a306=_0xc5a306-0x0;var _0x485583=_0xbba3[_0xc5a306];return _0x485583;};'use strict';var MailInteractionEvents=require(_0x3bba('0x0'));var events=[_0x3bba('0x1'),_0x3bba('0x2'),_0x3bba('0x3')];function createListener(_0x1aeb7e,_0xcc1406){return function(_0x2a4ff2){_0xcc1406[_0x3bba('0x4')](_0x1aeb7e,_0x2a4ff2);};}function removeListener(_0x4636c7,_0x419bf4){return function(){MailInteractionEvents['removeListener'](_0x4636c7,_0x419bf4);};}exports[_0x3bba('0x5')]=function(_0x4ce85f){for(var _0x5617d3=0x0,_0x4a5a17=events[_0x3bba('0x6')];_0x5617d3<_0x4a5a17;_0x5617d3++){var _0x10f162=events[_0x5617d3];var _0x54ac71=createListener(_0x3bba('0x7')+_0x10f162,_0x4ce85f);MailInteractionEvents['on'](_0x10f162,_0x54ac71);}};
\ No newline at end of file
index c02055e..ca8b1b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1ee=['index','show','download','post','mail','mailmessage:create','create','put','/:id','update','/:id/accept','accept','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated'];(function(_0x4e85fa,_0x4093e5){var _0x55a2ce=function(_0x230539){while(--_0x230539){_0x4e85fa['push'](_0x4e85fa['shift']());}};_0x55a2ce(++_0x4093e5);}(_0xe1ee,0x158));var _0xee1e=function(_0x14fd4a,_0x145947){_0x14fd4a=_0x14fd4a-0x0;var _0x448502=_0xe1ee[_0x14fd4a];return _0x448502;};'use strict';var multer=require(_0xee1e('0x0'));var util=require(_0xee1e('0x1'));var path=require('path');var timeout=require(_0xee1e('0x2'));var express=require(_0xee1e('0x3'));var router=express['Router']();var fs_extra=require(_0xee1e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xee1e('0x5'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xee1e('0x6')]('/',auth[_0xee1e('0x7')](),controller[_0xee1e('0x8')]);router[_0xee1e('0x6')]('/describe',auth[_0xee1e('0x7')](),controller['describe']);router['get']('/:id',auth[_0xee1e('0x7')](),controller[_0xee1e('0x9')]);router[_0xee1e('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0xee1e('0xa')]);router[_0xee1e('0xb')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xee1e('0xc'),_0xee1e('0xd')),controller[_0xee1e('0xe')]);router[_0xee1e('0xf')](_0xee1e('0x10'),auth['isAuthenticated'](),controller[_0xee1e('0x11')]);router[_0xee1e('0xf')](_0xee1e('0x12'),auth[_0xee1e('0x7')](),controller[_0xee1e('0x13')]);router[_0xee1e('0xf')]('/:id/reject',auth[_0xee1e('0x7')](),controller['reject']);router[_0xee1e('0x14')]('/:id',auth[_0xee1e('0x7')](),controller['destroy']);module[_0xee1e('0x15')]=router;
\ No newline at end of file
+var _0x1be1=['create','put','update','/:id/accept','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','mailmessage:create'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0x1be1,0x192));var _0x11be=function(_0x5efb2b,_0xf80b90){_0x5efb2b=_0x5efb2b-0x0;var _0x3cbc03=_0x1be1[_0x5efb2b];return _0x3cbc03;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/describe',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['show']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),interaction[_0x11be('0xe')]('mail',_0x11be('0xf')),controller[_0x11be('0x10')]);router[_0x11be('0x11')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x12')]);router['put'](_0x11be('0x13'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x11be('0xa'),auth['isAuthenticated'](),controller[_0x11be('0x14')]);module[_0x11be('0x15')]=router;
\ No newline at end of file
index 2c851dd..6598a56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01b5=['exports','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','sequelize','lodash'];(function(_0x417416,_0x4cdbfd){var _0x46a344=function(_0x3315da){while(--_0x3315da){_0x417416['push'](_0x417416['shift']());}};_0x46a344(++_0x4cdbfd);}(_0x01b5,0xca));var _0x501b=function(_0x3e29df,_0x42fdf8){_0x3e29df=_0x3e29df-0x0;var _0x3e3ba9=_0x01b5[_0x3e29df];return _0x3e3ba9;};'use strict';var Sequelize=require(_0x501b('0x0'));var _=require(_0x501b('0x1'));module[_0x501b('0x2')]={'body':{'type':Sequelize[_0x501b('0x3')](_0x501b('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x501b('0x3')]('medium')},'read':{'type':Sequelize[_0x501b('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x501b('0x6')]('in',_0x501b('0x7')),'defaultValue':_0x501b('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x501b('0x8')]},'to':{'type':Sequelize[_0x501b('0x3')](_0x501b('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x501b('0x4'))},'bcc':{'type':Sequelize[_0x501b('0x3')](_0x501b('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x501b('0x9')]},'attach':{'type':Sequelize[_0x501b('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x501b('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x501b('0x9')]},'originTo':{'type':Sequelize[_0x501b('0x3')](_0x501b('0x4'))},'originCc':{'type':Sequelize[_0x501b('0x3')](_0x501b('0x4'))},'originChannel':{'type':Sequelize[_0x501b('0x6')]('Email','Chat'),'defaultValue':_0x501b('0xb'),'allowNull':![]}};
\ No newline at end of file
+var _0xfc10=['Email','sequelize','lodash','TEXT','long','medium','out','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x42b02c,_0x5c7b99){var _0x105518=function(_0x305734){while(--_0x305734){_0x42b02c['push'](_0x42b02c['shift']());}};_0x105518(++_0x5c7b99);}(_0xfc10,0x85));var _0x0fc1=function(_0x2408e1,_0x2caf9b){_0x2408e1=_0x2408e1-0x0;var _0x242777=_0xfc10[_0x2408e1];return _0x242777;};'use strict';var Sequelize=require(_0x0fc1('0x0'));var _=require(_0x0fc1('0x1'));module['exports']={'body':{'type':Sequelize[_0x0fc1('0x2')](_0x0fc1('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0fc1('0x2')](_0x0fc1('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0fc1('0x5')),'defaultValue':_0x0fc1('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0fc1('0x6')](0x1fe)},'from':{'type':Sequelize[_0x0fc1('0x6')]},'to':{'type':Sequelize[_0x0fc1('0x2')](_0x0fc1('0x3'))},'cc':{'type':Sequelize[_0x0fc1('0x2')](_0x0fc1('0x3'))},'bcc':{'type':Sequelize[_0x0fc1('0x2')](_0x0fc1('0x3'))},'subject':{'type':Sequelize[_0x0fc1('0x2')]},'sentAt':{'type':Sequelize[_0x0fc1('0x7')]},'attach':{'type':Sequelize[_0x0fc1('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0fc1('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x0fc1('0x2')](_0x0fc1('0x3'))},'originCc':{'type':Sequelize[_0x0fc1('0x2')]('long')},'originChannel':{'type':Sequelize['ENUM']('Email','Chat'),'defaultValue':_0x0fc1('0xa'),'allowNull':![]}};
\ No newline at end of file
index 8cd677e..7de4f5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69c0=['length','hasOwnProperty','nolimit','limit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','update','body','describe','create','out','split','MailAccount','MailAccountId','CmList','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','user','pass','service','auth','attachments','join','root','server/files/attachments','basename','List','Contacts','ListId','List\x20not\x20found','sendMail','messageId','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','RejectMessage','ContactId','sequelize','interface','download','unix','toString','server','tmp','files','message-%s.eml','from','Attachment','Attachments','subject','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','existsSync','readFileSync','build','writeFileSync','unlinkSync','moment','bluebird','util','path','lodash','html-to-text','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailMessage,\x20%s,\x20%s','info','result','status','json','undefined','count','offset','set','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x525790,_0x1064af){var _0x3e82db=function(_0x214308){while(--_0x214308){_0x525790['push'](_0x525790['shift']());}};_0x3e82db(++_0x1064af);}(_0x69c0,0x70));var _0x069c=function(_0x5d5b1a,_0xea27e5){_0x5d5b1a=_0x5d5b1a-0x0;var _0x5d35a7=_0x69c0[_0x5d5b1a];return _0x5d35a7;};'use strict';var emlformat=require('eml-format');var moment=require(_0x069c('0x0'));var BPromise=require(_0x069c('0x1'));var util=require(_0x069c('0x2'));var path=require(_0x069c('0x3'));var fs=require('fs');var _=require(_0x069c('0x4'));var Redis=require('ioredis');var htmlToText=require(_0x069c('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x069c('0x6'))(_0x069c('0x7'));var interaction_log=require(_0x069c('0x6'))('mail-interactions');var config=require(_0x069c('0x8'));var db=require(_0x069c('0x9'))['db'];config[_0x069c('0xa')]=_[_0x069c('0xb')](config[_0x069c('0xa')],{'host':_0x069c('0xc'),'port':0x18eb});var socket=require(_0x069c('0xd'))(new Redis(config[_0x069c('0xa')]));require('./mailMessage.socket')[_0x069c('0xe')](socket);var jayson=require(_0x069c('0xf'));var client=jayson['client'][_0x069c('0x10')]({'port':0x232c});var client9003=jayson[_0x069c('0x11')][_0x069c('0x10')]({'port':0x232b});var client9002=jayson[_0x069c('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x466e21,_0x4ff35c,_0x1d399c,_0x3cf665){return new BPromise(function(_0x26101a,_0x83bb0){var _0x4553da=_0x3cf665||client;return _0x4553da[_0x069c('0x12')](_0x466e21,_0x1d399c)[_0x069c('0x13')](function(_0x43b637){logger['info']('MailMessage,\x20%s,\x20%s',_0x4ff35c,'request\x20sent');logger['debug'](_0x069c('0x14'),_0x4ff35c,_0x069c('0x15'),JSON[_0x069c('0x16')](_0x43b637));if(_0x43b637[_0x069c('0x17')]){if(_0x43b637[_0x069c('0x17')]['code']===0x1f4){logger[_0x069c('0x17')]('MailMessage,\x20%s,\x20%s',_0x4ff35c,_0x43b637['error'][_0x069c('0x18')]);return _0x83bb0(_0x43b637[_0x069c('0x17')][_0x069c('0x18')]);}logger[_0x069c('0x17')](_0x069c('0x19'),_0x4ff35c,_0x43b637[_0x069c('0x17')][_0x069c('0x18')]);return _0x26101a(_0x43b637[_0x069c('0x17')][_0x069c('0x18')]);}else{logger[_0x069c('0x1a')](_0x069c('0x19'),_0x4ff35c,_0x069c('0x15'));_0x26101a(_0x43b637[_0x069c('0x1b')][_0x069c('0x18')]);}})['catch'](function(_0x4ade4d){logger[_0x069c('0x17')]('MailMessage,\x20%s,\x20%s',_0x4ff35c,_0x4ade4d);_0x83bb0(_0x4ade4d);});});}function respondWithResult(_0x34cd42,_0xbda819){_0xbda819=_0xbda819||0xc8;return function(_0x5c0194){if(_0x5c0194){return _0x34cd42[_0x069c('0x1c')](_0xbda819)[_0x069c('0x1d')](_0x5c0194);}};}function respondWithFilteredResult(_0x477244,_0x1a6521){return function(_0x442a9b){if(_0x442a9b){var _0x409cac=typeof _0x1a6521['offset']===_0x069c('0x1e')&&typeof _0x1a6521['limit']==='undefined';var _0x38ba40=_0x442a9b[_0x069c('0x1f')];var _0x5004b1=_0x409cac?0x0:_0x1a6521[_0x069c('0x20')];var _0x3b22ad=_0x409cac?_0x442a9b[_0x069c('0x1f')]:_0x1a6521[_0x069c('0x20')]+_0x1a6521['limit'];var _0x6d098b;if(_0x3b22ad>=_0x38ba40){_0x3b22ad=_0x38ba40;_0x6d098b=0xc8;}else{_0x6d098b=0xce;}_0x477244[_0x069c('0x1c')](_0x6d098b);return _0x477244[_0x069c('0x21')]('Content-Range',_0x5004b1+'-'+_0x3b22ad+'/'+_0x38ba40)[_0x069c('0x1d')](_0x442a9b);}return null;};}function saveUpdates(_0x59afdd){return function(_0x2b4468){if(_0x2b4468){return _0x2b4468['update'](_0x59afdd)[_0x069c('0x13')](function(_0x22b242){return _0x22b242;});}return null;};}function removeEntity(_0x7eb7a3){return function(_0x151d3a){if(_0x151d3a){return _0x151d3a[_0x069c('0x22')]()['then'](function(){_0x7eb7a3[_0x069c('0x1c')](0xcc)[_0x069c('0x23')]();});}};}function handleEntityNotFound(_0x5af847){return function(_0x1b24a9){if(!_0x1b24a9){_0x5af847[_0x069c('0x24')](0x194);}return _0x1b24a9;};}function handleError(_0x39022d,_0x475bd6){_0x475bd6=_0x475bd6||0x1f4;return function(_0x2c3be8){logger[_0x069c('0x17')](_0x2c3be8[_0x069c('0x25')]);if(_0x2c3be8[_0x069c('0x26')]){delete _0x2c3be8[_0x069c('0x26')];}_0x39022d[_0x069c('0x1c')](_0x475bd6)[_0x069c('0x27')](_0x2c3be8);};}exports[_0x069c('0x28')]=function(_0x4dd1f2,_0x40fb91){var _0x2cd62a={},_0x521be6={},_0x24343b={'count':0x0,'rows':[]};var _0x214bd6=_[_0x069c('0x29')](db[_0x069c('0x2a')]['rawAttributes'],function(_0x3e3f3a){return{'name':_0x3e3f3a[_0x069c('0x2b')],'type':_0x3e3f3a[_0x069c('0x2c')]['key']};});_0x521be6[_0x069c('0x2d')]=_[_0x069c('0x29')](_0x214bd6,_0x069c('0x26'));_0x521be6[_0x069c('0x2e')]=_[_0x069c('0x2f')](_0x4dd1f2[_0x069c('0x2e')]);_0x521be6[_0x069c('0x30')]=_[_0x069c('0x31')](_0x521be6[_0x069c('0x2d')],_0x521be6[_0x069c('0x2e')]);_0x2cd62a['attributes']=_[_0x069c('0x31')](_0x521be6[_0x069c('0x2d')],qs['fields'](_0x4dd1f2[_0x069c('0x2e')][_0x069c('0x32')]));_0x2cd62a[_0x069c('0x33')]=_0x2cd62a['attributes'][_0x069c('0x34')]?_0x2cd62a['attributes']:_0x521be6[_0x069c('0x2d')];if(!_0x4dd1f2[_0x069c('0x2e')][_0x069c('0x35')](_0x069c('0x36'))){_0x2cd62a['limit']=qs[_0x069c('0x37')](_0x4dd1f2['query'][_0x069c('0x37')]);_0x2cd62a[_0x069c('0x20')]=qs[_0x069c('0x20')](_0x4dd1f2[_0x069c('0x2e')][_0x069c('0x20')]);}_0x2cd62a[_0x069c('0x38')]=qs[_0x069c('0x39')](_0x4dd1f2[_0x069c('0x2e')]['sort']);_0x2cd62a['where']=qs['filters'](_['pick'](_0x4dd1f2[_0x069c('0x2e')],_0x521be6[_0x069c('0x30')]),_0x214bd6);if(_0x4dd1f2[_0x069c('0x2e')]['filter']){_0x2cd62a[_0x069c('0x3a')]=_[_0x069c('0x3b')](_0x2cd62a['where'],{'$or':_[_0x069c('0x29')](_0x214bd6,function(_0x405882){if(_0x405882['type']!=='VIRTUAL'){var _0x4aaf13={};_0x4aaf13[_0x405882['name']]={'$like':'%'+_0x4dd1f2[_0x069c('0x2e')][_0x069c('0x3c')]+'%'};return _0x4aaf13;}})});}_0x2cd62a=_[_0x069c('0x3b')]({},_0x2cd62a,_0x4dd1f2[_0x069c('0x3d')]);var _0x185b94={'where':_0x2cd62a['where']};return db[_0x069c('0x2a')][_0x069c('0x1f')](_0x185b94)[_0x069c('0x13')](function(_0x2cc3bf){_0x24343b[_0x069c('0x1f')]=_0x2cc3bf;if(_0x4dd1f2[_0x069c('0x2e')][_0x069c('0x3e')]){_0x2cd62a[_0x069c('0x3f')]=[{'all':!![]}];}return db[_0x069c('0x2a')][_0x069c('0x40')](_0x2cd62a);})[_0x069c('0x13')](function(_0x320c15){_0x24343b[_0x069c('0x41')]=_0x320c15;return _0x24343b;})[_0x069c('0x13')](respondWithFilteredResult(_0x40fb91,_0x2cd62a))[_0x069c('0x42')](handleError(_0x40fb91,null));};exports[_0x069c('0x43')]=function(_0x1c788f,_0xe3291f){var _0x523737={'raw':!![],'where':{'id':_0x1c788f[_0x069c('0x44')]['id']}},_0x8ed6dc={};_0x8ed6dc[_0x069c('0x2d')]=_['keys'](db['MailMessage'][_0x069c('0x45')]);_0x8ed6dc[_0x069c('0x2e')]=_[_0x069c('0x2f')](_0x1c788f[_0x069c('0x2e')]);_0x8ed6dc['filters']=_[_0x069c('0x31')](_0x8ed6dc['model'],_0x8ed6dc[_0x069c('0x2e')]);_0x523737['attributes']=_[_0x069c('0x31')](_0x8ed6dc[_0x069c('0x2d')],qs[_0x069c('0x32')](_0x1c788f[_0x069c('0x2e')][_0x069c('0x32')]));_0x523737[_0x069c('0x33')]=_0x523737['attributes'][_0x069c('0x34')]?_0x523737[_0x069c('0x33')]:_0x8ed6dc[_0x069c('0x2d')];if(_0x1c788f[_0x069c('0x2e')][_0x069c('0x3e')]){_0x523737[_0x069c('0x3f')]=[{'all':!![]}];}_0x523737=_[_0x069c('0x3b')]({},_0x523737,_0x1c788f[_0x069c('0x3d')]);return db[_0x069c('0x2a')][_0x069c('0x46')](_0x523737)[_0x069c('0x13')](handleEntityNotFound(_0xe3291f,null))[_0x069c('0x13')](respondWithResult(_0xe3291f,null))[_0x069c('0x42')](handleError(_0xe3291f,null));};exports[_0x069c('0x47')]=function(_0x520bdb,_0x5c2ec9){if(_0x520bdb[_0x069c('0x48')]['id']){delete _0x520bdb[_0x069c('0x48')]['id'];}return db[_0x069c('0x2a')][_0x069c('0x46')]({'where':{'id':_0x520bdb[_0x069c('0x44')]['id']}})[_0x069c('0x13')](handleEntityNotFound(_0x5c2ec9,null))[_0x069c('0x13')](saveUpdates(_0x520bdb['body'],null))['then'](respondWithResult(_0x5c2ec9,null))[_0x069c('0x42')](handleError(_0x5c2ec9,null));};exports[_0x069c('0x22')]=function(_0x19e6d0,_0x497911){return db[_0x069c('0x2a')]['find']({'where':{'id':_0x19e6d0[_0x069c('0x44')]['id']}})[_0x069c('0x13')](handleEntityNotFound(_0x497911,null))[_0x069c('0x13')](removeEntity(_0x497911,null))['catch'](handleError(_0x497911,null));};exports[_0x069c('0x49')]=function(_0x35e93a,_0x415007){return db[_0x069c('0x2a')][_0x069c('0x49')]()[_0x069c('0x13')](respondWithResult(_0x415007,null))[_0x069c('0x42')](handleError(_0x415007,null));};exports['create']=function(_0x34df9b,_0x17e062){return db[_0x069c('0x2a')][_0x069c('0x4a')](_0x34df9b['body'])['then'](function(_0x54bc43){if(_0x54bc43){if(_0x54bc43['direction']===_0x069c('0x4b')&&!_0x54bc43['secret']){var _0x555437,_0x1add36,_0x3de4fc;if(_0x34df9b[_0x069c('0x48')]['to']){_0x1add36=_0x34df9b['body']['to'][_0x069c('0x4c')](',')[0x0];}return db[_0x069c('0x4d')]['findOne']({'where':{'id':_0x54bc43[_0x069c('0x4e')]},'include':[{'model':db[_0x069c('0x4f')],'as':'List','include':[{'model':db[_0x069c('0x50')],'as':'Contacts','where':{'email':_0x1add36},'limit':0x1,'order':[[_0x069c('0x51'),_0x069c('0x52')]]}]},{'model':db[_0x069c('0x53')],'as':_0x069c('0x54'),'raw':!![]}]})[_0x069c('0x13')](function(_0x18bfca){_0x555437=_0x18bfca;if(_0x555437&&_0x555437[_0x069c('0x54')]){var _0x551e32={'tls':{'rejectUnauthorized':![]}};if(_[_0x069c('0x55')](_0x555437[_0x069c('0x54')]['service'])){_0x551e32[_0x069c('0x56')]=_0x555437['Smtp'][_0x069c('0x56')];_0x551e32[_0x069c('0x57')]=_0x555437[_0x069c('0x54')][_0x069c('0x57')];_0x551e32[_0x069c('0x58')]=_0x555437[_0x069c('0x54')][_0x069c('0x58')];if(_0x555437['Smtp'][_0x069c('0x59')]){_0x551e32['auth']={'user':_0x555437[_0x069c('0x54')][_0x069c('0x5a')],'pass':_0x555437[_0x069c('0x54')][_0x069c('0x5b')]};}}else{_0x551e32[_0x069c('0x5c')]=_0x555437[_0x069c('0x54')][_0x069c('0x5c')];_0x551e32[_0x069c('0x5d')]={'user':_0x555437['Smtp'][_0x069c('0x5a')],'pass':_0x555437[_0x069c('0x54')][_0x069c('0x5b')]};_0x551e32['secure']=_0x555437[_0x069c('0x54')][_0x069c('0x58')];}if(_0x34df9b[_0x069c('0x48')]['attachments']&&_0x34df9b['body']['attachments'][_0x069c('0x34')]){for(var _0x1daedb=0x0;_0x1daedb<_0x34df9b[_0x069c('0x48')]['attachments'][_0x069c('0x34')];_0x1daedb+=0x1){_0x34df9b[_0x069c('0x48')][_0x069c('0x5e')][_0x1daedb]={'filename':_0x34df9b[_0x069c('0x48')][_0x069c('0x5e')][_0x1daedb][_0x069c('0x26')],'path':path[_0x069c('0x5f')](config[_0x069c('0x60')],_0x069c('0x61'),_0x34df9b['body'][_0x069c('0x5e')][_0x1daedb][_0x069c('0x62')])};}}_0x3de4fc={'account':_0x551e32,'message':_0x34df9b[_0x069c('0x48')]};return;}})[_0x069c('0x13')](function(){if(_0x555437[_0x069c('0x63')]){if(_0x555437[_0x069c('0x63')][_0x069c('0x64')][_0x069c('0x34')]){return _0x555437[_0x069c('0x63')][_0x069c('0x64')][0x0];}else{return db['CmContact'][_0x069c('0x4a')](_['defaults'](_0x34df9b['body'],{'firstName':_0x34df9b['body']['to'],'email':_0x34df9b['body']['to'],'phone':_0x34df9b[_0x069c('0x48')]['to'],'ListId':_0x555437[_0x069c('0x65')]}));}}else{throw new Error(_0x069c('0x66'));}})['then'](function(){if(_0x3de4fc){return respondWithRpcPromise('SendMail',_0x069c('0x67'),_0x3de4fc,client9003)[_0x069c('0x13')](function(_0x24a7f9){return _0x54bc43[_0x069c('0x47')]({'read':!![],'messageId':_0x24a7f9[_0x069c('0x68')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x301350){logger['error']('%s',JSON[_0x069c('0x16')](_0x301350));return _0x54bc43;});}return _0x54bc43;});}return _0x54bc43;}})[_0x069c('0x13')](respondWithResult(_0x17e062,0xc9))[_0x069c('0x42')](handleError(_0x17e062,null));};exports['accept']=function(_0x47134a,_0x14e4b8){var _0x350d4e={'agent':{},'channel':_0x069c('0x69')};if(_0x47134a[_0x069c('0x48')]['id']){delete _0x47134a[_0x069c('0x48')]['id'];}_0x47134a[_0x069c('0x48')][_0x069c('0x6a')]=!![];_0x47134a[_0x069c('0x48')][_0x069c('0x6b')]=moment()[_0x069c('0x6c')](_0x069c('0x6d'));_0x47134a['body'][_0x069c('0x6e')]=_0x47134a[_0x069c('0x48')][_0x069c('0x6e')]||_0x47134a[_0x069c('0x5a')]['id'];_0x350d4e[_0x069c('0x6f')]['id']=_0x47134a['body'][_0x069c('0x6e')];return db[_0x069c('0x2a')][_0x069c('0x46')]({'where':{'id':_0x47134a[_0x069c('0x44')]['id'],'UserId':null}})[_0x069c('0x13')](handleEntityNotFound(_0x14e4b8,null))[_0x069c('0x13')](saveUpdates(_0x47134a[_0x069c('0x48')],null))[_0x069c('0x13')](function(_0x1c261b){if(_0x1c261b){_0x350d4e[_0x069c('0x18')]=_0x1c261b[_0x069c('0x70')]({'plain':!![]});return db[_0x069c('0x71')][_0x069c('0x46')]({'where':{'id':_0x1c261b[_0x069c('0x72')]}});}return null;})[_0x069c('0x13')](handleEntityNotFound(_0x14e4b8,null))[_0x069c('0x13')](function(_0x33cae5){if(_0x33cae5){return _0x33cae5['update']({'UserId':_0x47134a[_0x069c('0x48')][_0x069c('0x6e')],'read1stAt':_[_0x069c('0x55')](_0x33cae5[_0x069c('0x73')])?moment()[_0x069c('0x6c')](_0x069c('0x6d')):undefined});}return null;})[_0x069c('0x13')](function(_0x18769a){if(_0x18769a){_0x350d4e[_0x069c('0x74')]=_0x18769a[_0x069c('0x70')]({'plain':!![]});interaction_log[_0x069c('0x1a')](_0x069c('0x75'),_0x47134a['user']['id'],_0x47134a[_0x069c('0x5a')]['name'],_0x47134a[_0x069c('0x5a')][_0x069c('0x76')],_0x350d4e[_0x069c('0x74')]['id'],_0x47134a[_0x069c('0x48')]?JSON[_0x069c('0x16')](_0x47134a['body']):_0x069c('0x77'));return respondWithRpcPromise(_0x069c('0x78'),_0x069c('0x79'),_0x350d4e);}return null;})[_0x069c('0x13')](function(_0x4465ea){var _0x36b0b6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4465ea[_0x069c('0x18')]['ContactId'];return db['sequelize'][_0x069c('0x2e')](_0x36b0b6,{'type':db[_0x069c('0x7a')][_0x069c('0x7b')][_0x069c('0x7c')],'raw':!![]})['then'](function(_0x2a0a73){return _0x2a0a73;});})[_0x069c('0x13')](function(_0x194937){if(_0x194937){_0x350d4e['message'][_0x069c('0x7d')]=_0x194937[0x0];if(!_0x47134a[_0x069c('0x48')][_0x069c('0x6e')])return;return db[_0x069c('0x7e')][_0x069c('0x46')]({'where':{'id':_0x47134a['body']['UserId'],'role':'agent'},'attributes':['id',_0x069c('0x26'),_0x069c('0x7f'),_0x069c('0x80'),_0x069c('0x81')],'raw':!![]});}return null;})[_0x069c('0x13')](function(_0x35c86b){if(!_0x35c86b)return null;_0x350d4e[_0x069c('0x18')]['agent']=_0x35c86b;return _0x350d4e;})['then'](function(_0x10ebb4){if(_0x10ebb4){if(_0x47134a[_0x069c('0x48')][_0x069c('0x82')]){_0x350d4e[_0x069c('0x18')]['interface']=util[_0x069c('0x6c')](_0x069c('0x83'),_0x47134a[_0x069c('0x5a')]['name']);_0x350d4e[_0x069c('0x18')][_0x069c('0x84')]=_0x350d4e['channel'];_0x350d4e[_0x069c('0x18')][_0x069c('0x85')]=_0x350d4e[_0x069c('0x84')];_0x350d4e[_0x069c('0x18')][_0x069c('0x86')]=_0x069c('0x87');_0x350d4e[_0x069c('0x18')][_0x069c('0x48')]=htmlToText['fromString'](_0x350d4e[_0x069c('0x18')]['body']);return respondWithRpcPromise(_0x069c('0x88'),_0x069c('0x88'),{'event':_0x069c('0x89'),'message':_0x350d4e[_0x069c('0x18')]},client9002)[_0x069c('0x13')](function(){return _0x350d4e;});}return _0x350d4e;}return null;})[_0x069c('0x13')](respondWithResult(_0x14e4b8,null))[_0x069c('0x42')](handleError(_0x14e4b8,null));};exports[_0x069c('0x8a')]=function(_0x57ddb3,_0x1a9255){var _0x232d6f={'agent':{},'channel':_0x069c('0x69')};if(_0x57ddb3[_0x069c('0x48')]['id']){delete _0x57ddb3['body']['id'];}_0x57ddb3[_0x069c('0x48')]['UserId']=_0x57ddb3[_0x069c('0x48')][_0x069c('0x6e')]||_0x57ddb3[_0x069c('0x5a')]['id'];_0x232d6f[_0x069c('0x6f')]['id']=_0x57ddb3['body'][_0x069c('0x6e')];return db[_0x069c('0x2a')][_0x069c('0x46')]({'where':{'id':_0x57ddb3[_0x069c('0x44')]['id'],'UserId':null}})[_0x069c('0x13')](handleEntityNotFound(_0x1a9255,null))[_0x069c('0x13')](function(_0x48a499){if(_0x48a499){_0x232d6f[_0x069c('0x18')]=_0x48a499['get']({'plain':!![]});return db[_0x069c('0x71')][_0x069c('0x46')]({'where':{'id':_0x48a499[_0x069c('0x72')]}});}return null;})['then'](handleEntityNotFound(_0x1a9255,null))[_0x069c('0x13')](function(_0x3aca50){if(_0x3aca50){_0x232d6f[_0x069c('0x74')]=_0x3aca50[_0x069c('0x70')]({'plain':!![]});interaction_log[_0x069c('0x1a')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x57ddb3[_0x069c('0x5a')]['id'],_0x57ddb3[_0x069c('0x5a')]['name'],_0x57ddb3[_0x069c('0x5a')][_0x069c('0x76')],_0x232d6f['interaction']['id'],_0x57ddb3[_0x069c('0x48')]?JSON[_0x069c('0x16')](_0x57ddb3['body']):_0x069c('0x77'));return respondWithRpcPromise(_0x069c('0x8b'),'rejectMessage',_0x232d6f);}return null;})[_0x069c('0x13')](function(_0x4027c9){var _0x394ae4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4027c9['message'][_0x069c('0x8c')];return db[_0x069c('0x8d')][_0x069c('0x2e')](_0x394ae4,{'type':db['Sequelize']['QueryTypes'][_0x069c('0x7c')],'raw':!![]})['then'](function(_0x42f68e){return _0x42f68e;});})['then'](function(_0x5be281){if(_0x5be281){_0x232d6f[_0x069c('0x18')][_0x069c('0x7d')]=_0x5be281[0x0];if(!_0x57ddb3['body'][_0x069c('0x6e')])return;return db['User'][_0x069c('0x46')]({'where':{'id':_0x57ddb3['body']['UserId'],'role':_0x069c('0x6f')},'attributes':['id',_0x069c('0x26'),_0x069c('0x7f'),'email',_0x069c('0x81')],'raw':!![]});}return null;})[_0x069c('0x13')](function(_0x442b89){if(!_0x442b89)return null;_0x232d6f[_0x069c('0x18')]['agent']=_0x442b89;return _0x232d6f;})[_0x069c('0x13')](function(_0x25da45){if(_0x25da45){_0x25da45[_0x069c('0x18')][_0x069c('0x8e')]=util[_0x069c('0x6c')](_0x069c('0x83'),_0x57ddb3['user'][_0x069c('0x26')]);_0x25da45['message'][_0x069c('0x84')]=_0x232d6f[_0x069c('0x84')];_0x25da45[_0x069c('0x18')][_0x069c('0x85')]=_0x232d6f[_0x069c('0x84')];_0x25da45[_0x069c('0x18')]['event']=_0x069c('0x8a');_0x25da45[_0x069c('0x18')][_0x069c('0x48')]=htmlToText['fromString'](_0x232d6f['message']['body']);respondWithRpcPromise('EventManager',_0x069c('0x88'),{'event':'rejectmessage','message':_0x25da45[_0x069c('0x18')]},client9002);return _0x232d6f;}return null;})['then'](respondWithResult(_0x1a9255,null))['catch'](handleError(_0x1a9255,null));};exports[_0x069c('0x8f')]=function(_0x50446d,_0x23e693){var _0x4a780a=moment()[_0x069c('0x90')]()[_0x069c('0x91')]();var _0x8fdeed=path['join'](config[_0x069c('0x60')],_0x069c('0x92'),'files',_0x069c('0x93'));var _0x4ded4b=path[_0x069c('0x5f')](config['root'],_0x069c('0x92'),_0x069c('0x94'),_0x069c('0x5e'));var _0x44f573=util[_0x069c('0x6c')](_0x069c('0x95'),_0x4a780a);return db[_0x069c('0x2a')]['find']({'where':{'id':_0x50446d['params']['id']},'attributes':['id',_0x069c('0x48'),_0x069c('0x96'),'to','cc','bcc','subject','createdAt'],'include':_0x50446d[_0x069c('0x2e')]['attachments']?[{'model':db[_0x069c('0x97')],'as':_0x069c('0x98')}]:undefined})['then'](handleEntityNotFound(_0x23e693,null))[_0x069c('0x13')](function(_0x4cbf70){if(_0x4cbf70){var _0x31c3d2=_0x4cbf70;var _0x394447={'from':_0x31c3d2[_0x069c('0x96')],'to':_0x31c3d2['to'],'subject':_0x31c3d2[_0x069c('0x99')],'html':_0x31c3d2[_0x069c('0x48')],'headers':{'Date':moment(_0x31c3d2[_0x069c('0x9a')])['format'](_0x069c('0x9b'))},'attachments':[]};if(_0x4cbf70['cc']){_0x394447['headers']['Cc']=_0x4cbf70['cc'];}if(_0x4cbf70[_0x069c('0x9c')]){_0x394447[_0x069c('0x9d')][_0x069c('0x9e')]=_0x4cbf70['bcc'];}return new BPromise(function(_0x4af2c1,_0x4592f9){if(_0x4cbf70['Attachments']){for(var _0x5be557=0x0;_0x5be557<_0x4cbf70[_0x069c('0x98')][_0x069c('0x34')];_0x5be557++){var _0x6e1dcf=_0x4cbf70[_0x069c('0x98')][_0x5be557];var _0x3d8824=path['join'](_0x4ded4b,_0x6e1dcf[_0x069c('0x62')]);if(fs[_0x069c('0x9f')](_0x3d8824)){_0x394447[_0x069c('0x5e')]['push']({'name':_0x6e1dcf[_0x069c('0x26')],'contentType':_0x6e1dcf[_0x069c('0x2c')],'data':fs[_0x069c('0xa0')](_0x3d8824)});}}}emlformat[_0x069c('0xa1')](_0x394447,function(_0x538ab4,_0x5a258e){if(_0x538ab4)return _0x4592f9(_0x538ab4);fs[_0x069c('0xa2')](path[_0x069c('0x5f')](_0x8fdeed,_0x44f573),_0x5a258e);return _0x4af2c1(_0x5a258e);});});}})[_0x069c('0x13')](function(_0x49b07f){if(_0x49b07f){return _0x23e693['download'](path[_0x069c('0x5f')](_0x8fdeed,_0x44f573),_0x44f573,function(_0x5944bb){if(!_0x5944bb)fs[_0x069c('0xa3')](path['join'](_0x8fdeed,_0x44f573));});}})[_0x069c('0x42')](handleError(_0x23e693,null));};
\ No newline at end of file
+var _0x4ee0=['messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','MailInteraction','MailInteractionId','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','root','server','files','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','params','length','options','body','find','describe','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','updatedAt','DESC','Smtp','isNil','host','port','secure','authentication','auth','user','pass','service','attachments','join','server/files/attachments','CmContact','create','defaults','ListId','SendMail','sendMail'];(function(_0x377582,_0x5502eb){var _0x324f9d=function(_0x41afef){while(--_0x41afef){_0x377582['push'](_0x377582['shift']());}};_0x324f9d(++_0x5502eb);}(_0x4ee0,0x18f));var _0x04ee=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x4ee0[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0x04ee('0x0'));var moment=require(_0x04ee('0x1'));var BPromise=require(_0x04ee('0x2'));var util=require(_0x04ee('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x04ee('0x4'));var Redis=require(_0x04ee('0x5'));var htmlToText=require(_0x04ee('0x6'));var qs=require(_0x04ee('0x7'));var logger=require(_0x04ee('0x8'))(_0x04ee('0x9'));var interaction_log=require('../../config/logger')(_0x04ee('0xa'));var config=require(_0x04ee('0xb'));var db=require(_0x04ee('0xc'))['db'];config[_0x04ee('0xd')]=_['defaults'](config[_0x04ee('0xd')],{'host':_0x04ee('0xe'),'port':0x18eb});var socket=require(_0x04ee('0xf'))(new Redis(config[_0x04ee('0xd')]));require(_0x04ee('0x10'))[_0x04ee('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0x04ee('0x12')][_0x04ee('0x13')]({'port':0x232c});var client9003=jayson[_0x04ee('0x12')][_0x04ee('0x13')]({'port':0x232b});var client9002=jayson[_0x04ee('0x12')][_0x04ee('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x2d9584,_0x13051e,_0x2498c8,_0x2a0711){return new BPromise(function(_0x3cdd4,_0x305673){var _0x2f6d79=_0x2a0711||client;return _0x2f6d79['request'](_0x2d9584,_0x2498c8)[_0x04ee('0x14')](function(_0xe3c459){logger[_0x04ee('0x15')](_0x04ee('0x16'),_0x13051e,_0x04ee('0x17'));logger[_0x04ee('0x18')](_0x04ee('0x19'),_0x13051e,_0x04ee('0x17'),JSON[_0x04ee('0x1a')](_0xe3c459));if(_0xe3c459[_0x04ee('0x1b')]){if(_0xe3c459[_0x04ee('0x1b')]['code']===0x1f4){logger[_0x04ee('0x1b')]('MailMessage,\x20%s,\x20%s',_0x13051e,_0xe3c459[_0x04ee('0x1b')][_0x04ee('0x1c')]);return _0x305673(_0xe3c459[_0x04ee('0x1b')][_0x04ee('0x1c')]);}logger[_0x04ee('0x1b')](_0x04ee('0x16'),_0x13051e,_0xe3c459[_0x04ee('0x1b')][_0x04ee('0x1c')]);return _0x3cdd4(_0xe3c459[_0x04ee('0x1b')][_0x04ee('0x1c')]);}else{logger[_0x04ee('0x15')](_0x04ee('0x16'),_0x13051e,_0x04ee('0x17'));_0x3cdd4(_0xe3c459[_0x04ee('0x1d')][_0x04ee('0x1c')]);}})['catch'](function(_0xe9d29c){logger[_0x04ee('0x1b')]('MailMessage,\x20%s,\x20%s',_0x13051e,_0xe9d29c);_0x305673(_0xe9d29c);});});}function respondWithResult(_0x4fce15,_0x53cd5a){_0x53cd5a=_0x53cd5a||0xc8;return function(_0x1fb99a){if(_0x1fb99a){return _0x4fce15[_0x04ee('0x1e')](_0x53cd5a)[_0x04ee('0x1f')](_0x1fb99a);}};}function respondWithFilteredResult(_0x5148a2,_0x48e0af){return function(_0x3710f4){if(_0x3710f4){var _0x1f69d6=typeof _0x48e0af[_0x04ee('0x20')]===_0x04ee('0x21')&&typeof _0x48e0af['limit']==='undefined';var _0xe11a54=_0x3710f4['count'];var _0x2bfe7d=_0x1f69d6?0x0:_0x48e0af[_0x04ee('0x20')];var _0x3811eb=_0x1f69d6?_0x3710f4[_0x04ee('0x22')]:_0x48e0af['offset']+_0x48e0af[_0x04ee('0x23')];var _0x281ae4;if(_0x3811eb>=_0xe11a54){_0x3811eb=_0xe11a54;_0x281ae4=0xc8;}else{_0x281ae4=0xce;}_0x5148a2[_0x04ee('0x1e')](_0x281ae4);return _0x5148a2[_0x04ee('0x24')](_0x04ee('0x25'),_0x2bfe7d+'-'+_0x3811eb+'/'+_0xe11a54)[_0x04ee('0x1f')](_0x3710f4);}return null;};}function saveUpdates(_0x101a7a){return function(_0x4564b0){if(_0x4564b0){return _0x4564b0[_0x04ee('0x26')](_0x101a7a)[_0x04ee('0x14')](function(_0x3fc223){return _0x3fc223;});}return null;};}function removeEntity(_0x2c8c2){return function(_0x38a972){if(_0x38a972){return _0x38a972[_0x04ee('0x27')]()[_0x04ee('0x14')](function(){_0x2c8c2['status'](0xcc)[_0x04ee('0x28')]();});}};}function handleEntityNotFound(_0x13457a){return function(_0x25a80a){if(!_0x25a80a){_0x13457a['sendStatus'](0x194);}return _0x25a80a;};}function handleError(_0x5f7df9,_0x5c7e67){_0x5c7e67=_0x5c7e67||0x1f4;return function(_0x1e06d4){logger['error'](_0x1e06d4[_0x04ee('0x29')]);if(_0x1e06d4[_0x04ee('0x2a')]){delete _0x1e06d4[_0x04ee('0x2a')];}_0x5f7df9['status'](_0x5c7e67)[_0x04ee('0x2b')](_0x1e06d4);};}exports[_0x04ee('0x2c')]=function(_0x5ab7d6,_0x370305){var _0x1c89c9={},_0x3f61ad={},_0x1bb9dd={'count':0x0,'rows':[]};var _0x196f66=_[_0x04ee('0x2d')](db[_0x04ee('0x2e')][_0x04ee('0x2f')],function(_0x4a1626){return{'name':_0x4a1626[_0x04ee('0x30')],'type':_0x4a1626[_0x04ee('0x31')][_0x04ee('0x32')]};});_0x3f61ad['model']=_[_0x04ee('0x2d')](_0x196f66,_0x04ee('0x2a'));_0x3f61ad[_0x04ee('0x33')]=_[_0x04ee('0x34')](_0x5ab7d6[_0x04ee('0x33')]);_0x3f61ad[_0x04ee('0x35')]=_[_0x04ee('0x36')](_0x3f61ad['model'],_0x3f61ad[_0x04ee('0x33')]);_0x1c89c9[_0x04ee('0x37')]=_[_0x04ee('0x36')](_0x3f61ad['model'],qs[_0x04ee('0x38')](_0x5ab7d6[_0x04ee('0x33')]['fields']));_0x1c89c9[_0x04ee('0x37')]=_0x1c89c9['attributes']['length']?_0x1c89c9['attributes']:_0x3f61ad[_0x04ee('0x39')];if(!_0x5ab7d6[_0x04ee('0x33')][_0x04ee('0x3a')](_0x04ee('0x3b'))){_0x1c89c9[_0x04ee('0x23')]=qs['limit'](_0x5ab7d6[_0x04ee('0x33')][_0x04ee('0x23')]);_0x1c89c9[_0x04ee('0x20')]=qs[_0x04ee('0x20')](_0x5ab7d6[_0x04ee('0x33')][_0x04ee('0x20')]);}_0x1c89c9[_0x04ee('0x3c')]=qs[_0x04ee('0x3d')](_0x5ab7d6[_0x04ee('0x33')]['sort']);_0x1c89c9[_0x04ee('0x3e')]=qs[_0x04ee('0x35')](_[_0x04ee('0x3f')](_0x5ab7d6[_0x04ee('0x33')],_0x3f61ad['filters']),_0x196f66);if(_0x5ab7d6['query'][_0x04ee('0x40')]){_0x1c89c9[_0x04ee('0x3e')]=_[_0x04ee('0x41')](_0x1c89c9[_0x04ee('0x3e')],{'$or':_[_0x04ee('0x2d')](_0x196f66,function(_0x1a19ad){if(_0x1a19ad[_0x04ee('0x31')]!==_0x04ee('0x42')){var _0x6d5b74={};_0x6d5b74[_0x1a19ad[_0x04ee('0x2a')]]={'$like':'%'+_0x5ab7d6[_0x04ee('0x33')][_0x04ee('0x40')]+'%'};return _0x6d5b74;}})});}_0x1c89c9=_[_0x04ee('0x41')]({},_0x1c89c9,_0x5ab7d6['options']);var _0xe653b8={'where':_0x1c89c9[_0x04ee('0x3e')]};return db[_0x04ee('0x2e')][_0x04ee('0x22')](_0xe653b8)['then'](function(_0x54e617){_0x1bb9dd[_0x04ee('0x22')]=_0x54e617;if(_0x5ab7d6['query']['includeAll']){_0x1c89c9[_0x04ee('0x43')]=[{'all':!![]}];}return db[_0x04ee('0x2e')][_0x04ee('0x44')](_0x1c89c9);})['then'](function(_0x557b5e){_0x1bb9dd['rows']=_0x557b5e;return _0x1bb9dd;})[_0x04ee('0x14')](respondWithFilteredResult(_0x370305,_0x1c89c9))[_0x04ee('0x45')](handleError(_0x370305,null));};exports['show']=function(_0x182523,_0x237be7){var _0x50d36d={'raw':!![],'where':{'id':_0x182523[_0x04ee('0x46')]['id']}},_0x51e954={};_0x51e954[_0x04ee('0x39')]=_[_0x04ee('0x34')](db['MailMessage'][_0x04ee('0x2f')]);_0x51e954['query']=_[_0x04ee('0x34')](_0x182523['query']);_0x51e954[_0x04ee('0x35')]=_[_0x04ee('0x36')](_0x51e954[_0x04ee('0x39')],_0x51e954['query']);_0x50d36d[_0x04ee('0x37')]=_[_0x04ee('0x36')](_0x51e954[_0x04ee('0x39')],qs[_0x04ee('0x38')](_0x182523[_0x04ee('0x33')][_0x04ee('0x38')]));_0x50d36d[_0x04ee('0x37')]=_0x50d36d[_0x04ee('0x37')][_0x04ee('0x47')]?_0x50d36d[_0x04ee('0x37')]:_0x51e954['model'];if(_0x182523[_0x04ee('0x33')]['includeAll']){_0x50d36d['include']=[{'all':!![]}];}_0x50d36d=_[_0x04ee('0x41')]({},_0x50d36d,_0x182523[_0x04ee('0x48')]);return db['MailMessage']['find'](_0x50d36d)[_0x04ee('0x14')](handleEntityNotFound(_0x237be7,null))[_0x04ee('0x14')](respondWithResult(_0x237be7,null))['catch'](handleError(_0x237be7,null));};exports[_0x04ee('0x26')]=function(_0x2bb0dd,_0x244c01){if(_0x2bb0dd[_0x04ee('0x49')]['id']){delete _0x2bb0dd['body']['id'];}return db[_0x04ee('0x2e')]['find']({'where':{'id':_0x2bb0dd[_0x04ee('0x46')]['id']}})[_0x04ee('0x14')](handleEntityNotFound(_0x244c01,null))[_0x04ee('0x14')](saveUpdates(_0x2bb0dd['body'],null))['then'](respondWithResult(_0x244c01,null))[_0x04ee('0x45')](handleError(_0x244c01,null));};exports[_0x04ee('0x27')]=function(_0x67dc69,_0x29b621){return db[_0x04ee('0x2e')][_0x04ee('0x4a')]({'where':{'id':_0x67dc69[_0x04ee('0x46')]['id']}})[_0x04ee('0x14')](handleEntityNotFound(_0x29b621,null))['then'](removeEntity(_0x29b621,null))[_0x04ee('0x45')](handleError(_0x29b621,null));};exports['describe']=function(_0x3ca2ca,_0x515840){return db[_0x04ee('0x2e')][_0x04ee('0x4b')]()[_0x04ee('0x14')](respondWithResult(_0x515840,null))[_0x04ee('0x45')](handleError(_0x515840,null));};exports['create']=function(_0x3695eb,_0x2a4206){return db[_0x04ee('0x2e')]['create'](_0x3695eb[_0x04ee('0x49')])[_0x04ee('0x14')](function(_0x434c55){if(_0x434c55){if(_0x434c55[_0x04ee('0x4c')]===_0x04ee('0x4d')&&!_0x434c55[_0x04ee('0x4e')]){var _0xe0932,_0x3b95ad,_0x51edcd;if(_0x3695eb[_0x04ee('0x49')]['to']){_0x3b95ad=_0x3695eb[_0x04ee('0x49')]['to']['split'](',')[0x0];}return db[_0x04ee('0x4f')][_0x04ee('0x50')]({'where':{'id':_0x434c55[_0x04ee('0x51')]},'include':[{'model':db[_0x04ee('0x52')],'as':_0x04ee('0x53'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x3b95ad},'limit':0x1,'order':[[_0x04ee('0x54'),_0x04ee('0x55')]]}]},{'model':db['MailServerOut'],'as':_0x04ee('0x56'),'raw':!![]}]})['then'](function(_0x475ec8){_0xe0932=_0x475ec8;if(_0xe0932&&_0xe0932[_0x04ee('0x56')]){var _0x2b9b81={'tls':{'rejectUnauthorized':![]}};if(_[_0x04ee('0x57')](_0xe0932['Smtp']['service'])){_0x2b9b81[_0x04ee('0x58')]=_0xe0932[_0x04ee('0x56')][_0x04ee('0x58')];_0x2b9b81[_0x04ee('0x59')]=_0xe0932[_0x04ee('0x56')]['port'];_0x2b9b81[_0x04ee('0x5a')]=_0xe0932[_0x04ee('0x56')][_0x04ee('0x5a')];if(_0xe0932[_0x04ee('0x56')][_0x04ee('0x5b')]){_0x2b9b81[_0x04ee('0x5c')]={'user':_0xe0932['Smtp'][_0x04ee('0x5d')],'pass':_0xe0932['Smtp'][_0x04ee('0x5e')]};}}else{_0x2b9b81[_0x04ee('0x5f')]=_0xe0932[_0x04ee('0x56')][_0x04ee('0x5f')];_0x2b9b81['auth']={'user':_0xe0932[_0x04ee('0x56')][_0x04ee('0x5d')],'pass':_0xe0932[_0x04ee('0x56')][_0x04ee('0x5e')]};_0x2b9b81['secure']=_0xe0932[_0x04ee('0x56')]['secure'];}if(_0x3695eb[_0x04ee('0x49')][_0x04ee('0x60')]&&_0x3695eb[_0x04ee('0x49')]['attachments'][_0x04ee('0x47')]){for(var _0x1e9cb8=0x0;_0x1e9cb8<_0x3695eb[_0x04ee('0x49')][_0x04ee('0x60')][_0x04ee('0x47')];_0x1e9cb8+=0x1){_0x3695eb[_0x04ee('0x49')][_0x04ee('0x60')][_0x1e9cb8]={'filename':_0x3695eb[_0x04ee('0x49')][_0x04ee('0x60')][_0x1e9cb8][_0x04ee('0x2a')],'path':path[_0x04ee('0x61')](config['root'],_0x04ee('0x62'),_0x3695eb[_0x04ee('0x49')][_0x04ee('0x60')][_0x1e9cb8]['basename'])};}}_0x51edcd={'account':_0x2b9b81,'message':_0x3695eb[_0x04ee('0x49')]};return;}})[_0x04ee('0x14')](function(){if(_0xe0932[_0x04ee('0x53')]){if(_0xe0932[_0x04ee('0x53')]['Contacts'][_0x04ee('0x47')]){return _0xe0932['List']['Contacts'][0x0];}else{return db[_0x04ee('0x63')][_0x04ee('0x64')](_[_0x04ee('0x65')](_0x3695eb[_0x04ee('0x49')],{'firstName':_0x3695eb[_0x04ee('0x49')]['to'],'email':_0x3695eb['body']['to'],'phone':_0x3695eb['body']['to'],'ListId':_0xe0932[_0x04ee('0x66')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x51edcd){return respondWithRpcPromise(_0x04ee('0x67'),_0x04ee('0x68'),_0x51edcd,client9003)[_0x04ee('0x14')](function(_0xaa143){return _0x434c55['update']({'read':!![],'messageId':_0xaa143[_0x04ee('0x69')],'sentAt':moment()[_0x04ee('0x6a')](_0x04ee('0x6b'))});})[_0x04ee('0x45')](function(_0x502c68){logger[_0x04ee('0x1b')]('%s',JSON[_0x04ee('0x1a')](_0x502c68));return _0x434c55;});}return _0x434c55;});}return _0x434c55;}})[_0x04ee('0x14')](respondWithResult(_0x2a4206,0xc9))[_0x04ee('0x45')](handleError(_0x2a4206,null));};exports[_0x04ee('0x6c')]=function(_0x56cda0,_0x114254){var _0x2fb8df={'agent':{},'channel':_0x04ee('0x6d')};if(_0x56cda0[_0x04ee('0x49')]['id']){delete _0x56cda0[_0x04ee('0x49')]['id'];}_0x56cda0[_0x04ee('0x49')][_0x04ee('0x6e')]=!![];_0x56cda0[_0x04ee('0x49')][_0x04ee('0x6f')]=moment()['format'](_0x04ee('0x6b'));_0x56cda0[_0x04ee('0x49')]['UserId']=_0x56cda0[_0x04ee('0x49')][_0x04ee('0x70')]||_0x56cda0[_0x04ee('0x5d')]['id'];_0x2fb8df[_0x04ee('0x71')]['id']=_0x56cda0[_0x04ee('0x49')][_0x04ee('0x70')];return db[_0x04ee('0x2e')][_0x04ee('0x4a')]({'where':{'id':_0x56cda0[_0x04ee('0x46')]['id'],'UserId':null}})[_0x04ee('0x14')](handleEntityNotFound(_0x114254,null))[_0x04ee('0x14')](saveUpdates(_0x56cda0[_0x04ee('0x49')],null))['then'](function(_0x3ea0df){if(_0x3ea0df){_0x2fb8df[_0x04ee('0x1c')]=_0x3ea0df['get']({'plain':!![]});return db[_0x04ee('0x72')][_0x04ee('0x4a')]({'where':{'id':_0x3ea0df[_0x04ee('0x73')]}});}return null;})[_0x04ee('0x14')](handleEntityNotFound(_0x114254,null))[_0x04ee('0x14')](function(_0x4a9220){if(_0x4a9220){return _0x4a9220['update']({'UserId':_0x56cda0[_0x04ee('0x49')]['UserId'],'read1stAt':_[_0x04ee('0x57')](_0x4a9220['read1stAt'])?moment()[_0x04ee('0x6a')](_0x04ee('0x6b')):undefined});}return null;})[_0x04ee('0x14')](function(_0x4d5c42){if(_0x4d5c42){_0x2fb8df[_0x04ee('0x74')]=_0x4d5c42[_0x04ee('0x75')]({'plain':!![]});interaction_log[_0x04ee('0x15')](_0x04ee('0x76'),_0x56cda0[_0x04ee('0x5d')]['id'],_0x56cda0[_0x04ee('0x5d')][_0x04ee('0x2a')],_0x56cda0['user']['role'],_0x2fb8df[_0x04ee('0x74')]['id'],_0x56cda0[_0x04ee('0x49')]?JSON['stringify'](_0x56cda0['body']):_0x04ee('0x77'));return respondWithRpcPromise(_0x04ee('0x78'),_0x04ee('0x79'),_0x2fb8df);}return null;})[_0x04ee('0x14')](function(_0xb55975){var _0x5c09b9=_0x04ee('0x7a')+_0xb55975['message'][_0x04ee('0x7b')];return db[_0x04ee('0x7c')][_0x04ee('0x33')](_0x5c09b9,{'type':db[_0x04ee('0x7d')][_0x04ee('0x7e')][_0x04ee('0x7f')],'raw':!![]})[_0x04ee('0x14')](function(_0x3b2543){return _0x3b2543;});})[_0x04ee('0x14')](function(_0x42b682){if(_0x42b682){_0x2fb8df[_0x04ee('0x1c')][_0x04ee('0x80')]=_0x42b682[0x0];if(!_0x56cda0[_0x04ee('0x49')][_0x04ee('0x70')])return;return db[_0x04ee('0x81')]['find']({'where':{'id':_0x56cda0['body'][_0x04ee('0x70')],'role':'agent'},'attributes':['id',_0x04ee('0x2a'),_0x04ee('0x82'),_0x04ee('0x83'),_0x04ee('0x84')],'raw':!![]});}return null;})[_0x04ee('0x14')](function(_0x1c65d0){if(!_0x1c65d0)return null;_0x2fb8df[_0x04ee('0x1c')][_0x04ee('0x71')]=_0x1c65d0;return _0x2fb8df;})[_0x04ee('0x14')](function(_0x34fa32){if(_0x34fa32){if(_0x56cda0['body'][_0x04ee('0x85')]){_0x2fb8df['message'][_0x04ee('0x86')]=util[_0x04ee('0x6a')](_0x04ee('0x87'),_0x56cda0[_0x04ee('0x5d')]['name']);_0x2fb8df['message']['channel']=_0x2fb8df[_0x04ee('0x88')];_0x2fb8df['message'][_0x04ee('0x89')]=_0x2fb8df[_0x04ee('0x88')];_0x2fb8df[_0x04ee('0x1c')][_0x04ee('0x8a')]=_0x04ee('0x6c');_0x2fb8df[_0x04ee('0x1c')][_0x04ee('0x49')]=htmlToText[_0x04ee('0x8b')](_0x2fb8df['message']['body']);return respondWithRpcPromise(_0x04ee('0x8c'),_0x04ee('0x8c'),{'event':_0x04ee('0x8d'),'message':_0x2fb8df[_0x04ee('0x1c')]},client9002)[_0x04ee('0x14')](function(){return _0x2fb8df;});}return _0x2fb8df;}return null;})[_0x04ee('0x14')](respondWithResult(_0x114254,null))['catch'](handleError(_0x114254,null));};exports[_0x04ee('0x8e')]=function(_0x3d6cbb,_0xb0b19b){var _0x2fe071={'agent':{},'channel':'mail'};if(_0x3d6cbb[_0x04ee('0x49')]['id']){delete _0x3d6cbb[_0x04ee('0x49')]['id'];}_0x3d6cbb[_0x04ee('0x49')][_0x04ee('0x70')]=_0x3d6cbb[_0x04ee('0x49')]['UserId']||_0x3d6cbb[_0x04ee('0x5d')]['id'];_0x2fe071[_0x04ee('0x71')]['id']=_0x3d6cbb[_0x04ee('0x49')][_0x04ee('0x70')];return db['MailMessage']['find']({'where':{'id':_0x3d6cbb[_0x04ee('0x46')]['id'],'UserId':null}})[_0x04ee('0x14')](handleEntityNotFound(_0xb0b19b,null))['then'](function(_0x406744){if(_0x406744){_0x2fe071[_0x04ee('0x1c')]=_0x406744[_0x04ee('0x75')]({'plain':!![]});return db['MailInteraction'][_0x04ee('0x4a')]({'where':{'id':_0x406744[_0x04ee('0x73')]}});}return null;})[_0x04ee('0x14')](handleEntityNotFound(_0xb0b19b,null))[_0x04ee('0x14')](function(_0x21bbc5){if(_0x21bbc5){_0x2fe071[_0x04ee('0x74')]=_0x21bbc5[_0x04ee('0x75')]({'plain':!![]});interaction_log[_0x04ee('0x15')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3d6cbb['user']['id'],_0x3d6cbb[_0x04ee('0x5d')][_0x04ee('0x2a')],_0x3d6cbb['user']['role'],_0x2fe071[_0x04ee('0x74')]['id'],_0x3d6cbb[_0x04ee('0x49')]?JSON['stringify'](_0x3d6cbb[_0x04ee('0x49')]):'null');return respondWithRpcPromise(_0x04ee('0x8f'),_0x04ee('0x90'),_0x2fe071);}return null;})[_0x04ee('0x14')](function(_0x287290){var _0x6f6da2=_0x04ee('0x7a')+_0x287290['message'][_0x04ee('0x7b')];return db['sequelize']['query'](_0x6f6da2,{'type':db[_0x04ee('0x7d')][_0x04ee('0x7e')][_0x04ee('0x7f')],'raw':!![]})['then'](function(_0x491da3){return _0x491da3;});})[_0x04ee('0x14')](function(_0x3cba46){if(_0x3cba46){_0x2fe071[_0x04ee('0x1c')][_0x04ee('0x80')]=_0x3cba46[0x0];if(!_0x3d6cbb[_0x04ee('0x49')][_0x04ee('0x70')])return;return db[_0x04ee('0x81')][_0x04ee('0x4a')]({'where':{'id':_0x3d6cbb[_0x04ee('0x49')][_0x04ee('0x70')],'role':_0x04ee('0x71')},'attributes':['id','name',_0x04ee('0x82'),_0x04ee('0x83'),_0x04ee('0x84')],'raw':!![]});}return null;})[_0x04ee('0x14')](function(_0x35523e){if(!_0x35523e)return null;_0x2fe071[_0x04ee('0x1c')]['agent']=_0x35523e;return _0x2fe071;})[_0x04ee('0x14')](function(_0x32778b){if(_0x32778b){_0x32778b[_0x04ee('0x1c')]['interface']=util[_0x04ee('0x6a')](_0x04ee('0x87'),_0x3d6cbb[_0x04ee('0x5d')]['name']);_0x32778b[_0x04ee('0x1c')]['channel']=_0x2fe071[_0x04ee('0x88')];_0x32778b['message'][_0x04ee('0x89')]=_0x2fe071[_0x04ee('0x88')];_0x32778b[_0x04ee('0x1c')][_0x04ee('0x8a')]=_0x04ee('0x8e');_0x32778b['message'][_0x04ee('0x49')]=htmlToText[_0x04ee('0x8b')](_0x2fe071[_0x04ee('0x1c')][_0x04ee('0x49')]);respondWithRpcPromise('EventManager',_0x04ee('0x8c'),{'event':_0x04ee('0x91'),'message':_0x32778b['message']},client9002);return _0x2fe071;}return null;})[_0x04ee('0x14')](respondWithResult(_0xb0b19b,null))[_0x04ee('0x45')](handleError(_0xb0b19b,null));};exports[_0x04ee('0x92')]=function(_0x4bcb45,_0x1fd9fe){var _0x27065d=moment()[_0x04ee('0x93')]()[_0x04ee('0x94')]();var _0x5f21e0=path[_0x04ee('0x61')](config[_0x04ee('0x95')],_0x04ee('0x96'),_0x04ee('0x97'),'tmp');var _0x86e48a=path['join'](config[_0x04ee('0x95')],'server',_0x04ee('0x97'),'attachments');var _0x3675f7=util[_0x04ee('0x6a')](_0x04ee('0x98'),_0x27065d);return db[_0x04ee('0x2e')][_0x04ee('0x4a')]({'where':{'id':_0x4bcb45[_0x04ee('0x46')]['id']},'attributes':['id',_0x04ee('0x49'),_0x04ee('0x99'),'to','cc',_0x04ee('0x9a'),'subject',_0x04ee('0x9b')],'include':_0x4bcb45[_0x04ee('0x33')][_0x04ee('0x60')]?[{'model':db[_0x04ee('0x9c')],'as':_0x04ee('0x9d')}]:undefined})['then'](handleEntityNotFound(_0x1fd9fe,null))['then'](function(_0x481688){if(_0x481688){var _0x382e36=_0x481688;var _0x46bfdc={'from':_0x382e36[_0x04ee('0x99')],'to':_0x382e36['to'],'subject':_0x382e36[_0x04ee('0x9e')],'html':_0x382e36[_0x04ee('0x49')],'headers':{'Date':moment(_0x382e36['createdAt'])[_0x04ee('0x6a')](_0x04ee('0x9f'))},'attachments':[]};if(_0x481688['cc']){_0x46bfdc[_0x04ee('0xa0')]['Cc']=_0x481688['cc'];}if(_0x481688[_0x04ee('0x9a')]){_0x46bfdc[_0x04ee('0xa0')][_0x04ee('0xa1')]=_0x481688[_0x04ee('0x9a')];}return new BPromise(function(_0xc19dba,_0x2d27a0){if(_0x481688[_0x04ee('0x9d')]){for(var _0x791014=0x0;_0x791014<_0x481688['Attachments']['length'];_0x791014++){var _0x555a05=_0x481688[_0x04ee('0x9d')][_0x791014];var _0x178e8f=path['join'](_0x86e48a,_0x555a05[_0x04ee('0xa2')]);if(fs['existsSync'](_0x178e8f)){_0x46bfdc[_0x04ee('0x60')][_0x04ee('0xa3')]({'name':_0x555a05[_0x04ee('0x2a')],'contentType':_0x555a05[_0x04ee('0x31')],'data':fs[_0x04ee('0xa4')](_0x178e8f)});}}}emlformat[_0x04ee('0xa5')](_0x46bfdc,function(_0x1fc01a,_0x1a7100){if(_0x1fc01a)return _0x2d27a0(_0x1fc01a);fs[_0x04ee('0xa6')](path['join'](_0x5f21e0,_0x3675f7),_0x1a7100);return _0xc19dba(_0x1a7100);});});}})[_0x04ee('0x14')](function(_0x4b50be){if(_0x4b50be){return _0x1fd9fe['download'](path[_0x04ee('0x61')](_0x5f21e0,_0x3675f7),_0x3675f7,function(_0x44c21f){if(!_0x44c21f)fs[_0x04ee('0xa7')](path['join'](_0x5f21e0,_0x3675f7));});}})[_0x04ee('0x45')](handleError(_0x1fd9fe,null));};
\ No newline at end of file
index 62200da..15b9ade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8321=['update','emit','hasOwnProperty','events','../../mysqldb','MailMessage'];(function(_0x443027,_0x528eee){var _0x29a344=function(_0x5f0523){while(--_0x5f0523){_0x443027['push'](_0x443027['shift']());}};_0x29a344(++_0x528eee);}(_0x8321,0xa5));var _0x1832=function(_0x473c59,_0x74845b){_0x473c59=_0x473c59-0x0;var _0x4b1e57=_0x8321[_0x473c59];return _0x4b1e57;};'use strict';var EventEmitter=require(_0x1832('0x0'));var MailMessage=require(_0x1832('0x1'))['db'][_0x1832('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1832('0x3'),'afterDestroy':'remove'};function emitEvent(_0x594df1){return function(_0xf76a65,_0x52e10b,_0x34a84e){MailMessageEvents[_0x1832('0x4')](_0x594df1+':'+_0xf76a65['id'],_0xf76a65);MailMessageEvents[_0x1832('0x4')](_0x594df1,_0xf76a65);_0x34a84e(null);};}for(var e in events){if(events[_0x1832('0x5')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
+var _0x0b52=['hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','hasOwnProperty'];(function(_0x336e2f,_0x160988){var _0x29011f=function(_0x40874d){while(--_0x40874d){_0x336e2f['push'](_0x336e2f['shift']());}};_0x29011f(++_0x160988);}(_0x0b52,0x1b2));var _0x20b5=function(_0x1aafb5,_0x82a1c){_0x1aafb5=_0x1aafb5-0x0;var _0x149ee8=_0x0b52[_0x1aafb5];return _0x149ee8;};'use strict';var EventEmitter=require(_0x20b5('0x0'));var MailMessage=require(_0x20b5('0x1'))['db'][_0x20b5('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x20b5('0x3')](0x0);var events={'afterCreate':_0x20b5('0x4'),'afterUpdate':_0x20b5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x18bd31){return function(_0x4c4772,_0x232e5b,_0x1108dc){MailMessageEvents['emit'](_0x18bd31+':'+_0x4c4772['id'],_0x4c4772);MailMessageEvents['emit'](_0x18bd31,_0x4c4772);_0x1108dc(null);};}for(var e in events){if(events[_0x20b5('0x6')](e)){var event=events[e];MailMessage[_0x20b5('0x7')](e,emitEvent(event));}}module[_0x20b5('0x8')]=MailMessageEvents;
\ No newline at end of file
index 12a693a..145adf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32db=['exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','html-to-text','path','./mailMessage.attributes'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x32db,0xee));var _0xb32d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x32db[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xb32d('0x0'));var logger=require(_0xb32d('0x1'))('api');var moment=require(_0xb32d('0x2'));var BPromise=require(_0xb32d('0x3'));var rp=require('request-promise');var htmlToText=require(_0xb32d('0x4'));var fs=require('fs');var path=require(_0xb32d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb32d('0x6'));module[_0xb32d('0x7')]=function(_0x1a8d18,_0x25557b){return _0x1a8d18[_0xb32d('0x8')](_0xb32d('0x9'),attributes,{'tableName':_0xb32d('0xa'),'paranoid':![],'indexes':[{'name':_0xb32d('0xb'),'fields':[_0xb32d('0xb')]},{'name':_0xb32d('0xc'),'fields':[_0xb32d('0xd'),_0xb32d('0xe')],'type':_0xb32d('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b6156,_0x1aa678,_0x1ed653){if(_0x2b6156[_0xb32d('0x10')]){_0x2b6156[_0xb32d('0xd')]=htmlToText[_0xb32d('0x11')](_0x2b6156[_0xb32d('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1ed653(null,_0x1aa678);},'afterCreate':function(_0x2d63d9,_0x282845,_0x1914a1){var _0x4e3daf=_0x1a8d18[_0xb32d('0x12')];var _0x554d33=_0x2d63d9[_0xb32d('0x13')]({'plain':!![]});if(_0x554d33[_0xb32d('0x14')]['toLowerCase']()==='in'||_0x554d33[_0xb32d('0x14')][_0xb32d('0x15')]()===_0xb32d('0x16')&&!_0x554d33[_0xb32d('0x17')]&&!_[_0xb32d('0x18')](_0x554d33[_0xb32d('0x19')])){_0x4e3daf[_0xb32d('0x1a')]['findOne']({'where':{'id':_0x554d33[_0xb32d('0x1b')]}})[_0xb32d('0x1c')](function(_0x45a48a){if(_0x45a48a){_0x45a48a[_0xb32d('0x1d')]({'lastMsgAt':_0x554d33[_0xb32d('0x1e')],'lastMsgDirection':_0x554d33[_0xb32d('0x14')]['toLowerCase']()});}})[_0xb32d('0x1f')](function(_0x28921b){console[_0xb32d('0x20')](_0x28921b);});}_0x1914a1();}},'charset':_0xb32d('0x21'),'collate':_0xb32d('0x22')});};
\ No newline at end of file
+var _0xb332=['exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes'];(function(_0x2cff04,_0x2f0e1c){var _0x37e381=function(_0x17ff77){while(--_0x17ff77){_0x2cff04['push'](_0x2cff04['shift']());}};_0x37e381(++_0x2f0e1c);}(_0xb332,0x132));var _0x2b33=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0xb332[_0x2f227c];return _0x5032bc;};'use strict';var _=require(_0x2b33('0x0'));var util=require(_0x2b33('0x1'));var logger=require('../../config/logger')(_0x2b33('0x2'));var moment=require(_0x2b33('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0x2b33('0x4'));var fs=require('fs');var path=require(_0x2b33('0x5'));var rimraf=require(_0x2b33('0x6'));var config=require(_0x2b33('0x7'));var attributes=require(_0x2b33('0x8'));module[_0x2b33('0x9')]=function(_0x183349,_0x4942dc){return _0x183349[_0x2b33('0xa')](_0x2b33('0xb'),attributes,{'tableName':_0x2b33('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x2b33('0xd')]},{'name':_0x2b33('0xe'),'fields':[_0x2b33('0xf'),_0x2b33('0x10')],'type':_0x2b33('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4630c8,_0x919d4d,_0x86e52e){if(_0x4630c8[_0x2b33('0x12')]){_0x4630c8['plainBody']=htmlToText[_0x2b33('0x13')](_0x4630c8[_0x2b33('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x86e52e(null,_0x919d4d);},'afterCreate':function(_0x47496b,_0x283cfb,_0x32b7a4){var _0x128f5b=_0x183349[_0x2b33('0x14')];var _0x42f340=_0x47496b[_0x2b33('0x15')]({'plain':!![]});if(_0x42f340[_0x2b33('0x16')][_0x2b33('0x17')]()==='in'||_0x42f340[_0x2b33('0x16')][_0x2b33('0x17')]()==='out'&&!_0x42f340[_0x2b33('0x18')]&&!_[_0x2b33('0x19')](_0x42f340[_0x2b33('0x1a')])){_0x128f5b[_0x2b33('0x1b')][_0x2b33('0x1c')]({'where':{'id':_0x42f340['MailInteractionId']}})[_0x2b33('0x1d')](function(_0x4d06a4){if(_0x4d06a4){_0x4d06a4[_0x2b33('0x1e')]({'lastMsgAt':_0x42f340['createdAt'],'lastMsgDirection':_0x42f340[_0x2b33('0x16')][_0x2b33('0x17')]()});}})[_0x2b33('0x1f')](function(_0x36e2c7){console[_0x2b33('0x20')](_0x36e2c7);});}_0x32b7a4();}},'charset':_0x2b33('0x21'),'collate':_0x2b33('0x22')});};
\ No newline at end of file
index 3440628..46a5352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd824=['request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','CreateMailMessage','MailMessage','create','body','options','raw','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','redis','localhost','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x115ce9,_0xf7a2b9){var _0x543a23=function(_0x22601f){while(--_0x22601f){_0x115ce9['push'](_0x115ce9['shift']());}};_0x543a23(++_0xf7a2b9);}(_0xd824,0xc2));var _0x4d82=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd824[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});config['redis']=_[_0x4d82('0x9')](config[_0x4d82('0xa')],{'host':_0x4d82('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d82('0xa')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x580bbd,_0x27b777,_0x392f17){return new BPromise(function(_0x480c05,_0x318d1d){return client['request'](_0x580bbd,_0x392f17)[_0x4d82('0xc')](function(_0x303645){logger[_0x4d82('0xd')]('MailMessage,\x20%s,\x20%s',_0x27b777,'request\x20sent');logger[_0x4d82('0xe')](_0x4d82('0xf'),_0x27b777,_0x4d82('0x10'),JSON[_0x4d82('0x11')](_0x303645));if(_0x303645['error']){if(_0x303645[_0x4d82('0x12')][_0x4d82('0x13')]===0x1f4){logger[_0x4d82('0x12')]('MailMessage,\x20%s,\x20%s',_0x27b777,_0x303645[_0x4d82('0x12')]['message']);return _0x318d1d(_0x303645[_0x4d82('0x12')]['message']);}logger[_0x4d82('0x12')]('MailMessage,\x20%s,\x20%s',_0x27b777,_0x303645[_0x4d82('0x12')][_0x4d82('0x14')]);return _0x480c05(_0x303645[_0x4d82('0x12')][_0x4d82('0x14')]);}else{logger[_0x4d82('0xd')](_0x4d82('0x15'),_0x27b777,_0x4d82('0x10'));_0x480c05(_0x303645[_0x4d82('0x16')][_0x4d82('0x14')]);}})['catch'](function(_0x2919b0){logger[_0x4d82('0x12')](_0x4d82('0x15'),_0x27b777,_0x2919b0);_0x318d1d(_0x2919b0);});});}exports[_0x4d82('0x17')]=function(_0xe6260){var _0xd5f47=this;return new Promise(function(_0x1a513d,_0x64669c){return db[_0x4d82('0x18')][_0x4d82('0x19')](_0xe6260[_0x4d82('0x1a')],{'raw':_0xe6260['options']?_0xe6260[_0x4d82('0x1b')][_0x4d82('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1a419f){logger[_0x4d82('0xd')](_0x4d82('0x17'),_0xe6260);logger[_0x4d82('0xe')](_0x4d82('0x17'),_0xe6260,JSON[_0x4d82('0x11')](_0x1a419f));_0x1a513d(_0x1a419f);})[_0x4d82('0x1d')](function(_0x462258){logger[_0x4d82('0x12')](_0x4d82('0x17'),_0x462258[_0x4d82('0x14')],_0xe6260);_0x64669c(_0xd5f47[_0x4d82('0x12')](0x1f4,_0x462258[_0x4d82('0x14')]));});});};
\ No newline at end of file
+var _0x583c=['request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','CreateMailMessage','MailMessage','create','body','options','raw','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register'];(function(_0x500923,_0x3689d9){var _0x4c4e33=function(_0x48f469){while(--_0x48f469){_0x500923['push'](_0x500923['shift']());}};_0x4c4e33(++_0x3689d9);}(_0x583c,0x12b));var _0xc583=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0x583c[_0x58fbb0];return _0x1783d2;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});config[_0xc583('0xa')]=_[_0xc583('0xb')](config['redis'],{'host':_0xc583('0xc'),'port':0x18eb});var socket=require(_0xc583('0xd'))(new Redis(config['redis']));require(_0xc583('0xe'))[_0xc583('0xf')](socket);function respondWithRpcPromise(_0x25f8d3,_0xb23f07,_0x2d99ca){return new BPromise(function(_0x550b1e,_0x3437be){return client[_0xc583('0x10')](_0x25f8d3,_0x2d99ca)['then'](function(_0x23c51a){logger[_0xc583('0x11')]('MailMessage,\x20%s,\x20%s',_0xb23f07,_0xc583('0x12'));logger[_0xc583('0x13')](_0xc583('0x14'),_0xb23f07,_0xc583('0x12'),JSON[_0xc583('0x15')](_0x23c51a));if(_0x23c51a[_0xc583('0x16')]){if(_0x23c51a[_0xc583('0x16')][_0xc583('0x17')]===0x1f4){logger[_0xc583('0x16')]('MailMessage,\x20%s,\x20%s',_0xb23f07,_0x23c51a[_0xc583('0x16')]['message']);return _0x3437be(_0x23c51a[_0xc583('0x16')][_0xc583('0x18')]);}logger['error'](_0xc583('0x19'),_0xb23f07,_0x23c51a[_0xc583('0x16')]['message']);return _0x550b1e(_0x23c51a[_0xc583('0x16')][_0xc583('0x18')]);}else{logger['info'](_0xc583('0x19'),_0xb23f07,_0xc583('0x12'));_0x550b1e(_0x23c51a[_0xc583('0x1a')][_0xc583('0x18')]);}})['catch'](function(_0x3dd3cc){logger['error'](_0xc583('0x19'),_0xb23f07,_0x3dd3cc);_0x3437be(_0x3dd3cc);});});}exports[_0xc583('0x1b')]=function(_0xfd9a60){var _0x774f4c=this;return new Promise(function(_0x1052b5,_0x12b910){return db[_0xc583('0x1c')][_0xc583('0x1d')](_0xfd9a60[_0xc583('0x1e')],{'raw':_0xfd9a60[_0xc583('0x1f')]?_0xfd9a60[_0xc583('0x1f')][_0xc583('0x20')]===undefined?!![]:![]:!![]})[_0xc583('0x21')](function(_0x478ee1){logger['info'](_0xc583('0x1b'),_0xfd9a60);logger[_0xc583('0x13')](_0xc583('0x1b'),_0xfd9a60,JSON['stringify'](_0x478ee1));_0x1052b5(_0x478ee1);})[_0xc583('0x22')](function(_0x959500){logger[_0xc583('0x16')](_0xc583('0x1b'),_0x959500[_0xc583('0x18')],_0xfd9a60);_0x12b910(_0x774f4c['error'](0x1f4,_0x959500['message']));});});};
\ No newline at end of file
index 3f2e02e..7c3ca7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd1a=['emit','removeListener','register','length','./mailMessage.events','save','remove'];(function(_0x414806,_0x12a8c2){var _0x14e039=function(_0x40fb9c){while(--_0x40fb9c){_0x414806['push'](_0x414806['shift']());}};_0x14e039(++_0x12a8c2);}(_0xcd1a,0x115));var _0xacd1=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xcd1a[_0x5d6456];return _0x4d66c1;};'use strict';var MailMessageEvents=require(_0xacd1('0x0'));var events=[_0xacd1('0x1'),_0xacd1('0x2'),'update'];function createListener(_0x373411,_0x17abdc){return function(_0x57e941){_0x17abdc[_0xacd1('0x3')](_0x373411,_0x57e941);};}function removeListener(_0x51a40f,_0x25c9b4){return function(){MailMessageEvents[_0xacd1('0x4')](_0x51a40f,_0x25c9b4);};}exports[_0xacd1('0x5')]=function(_0x4376e7){for(var _0x30bc88=0x0,_0x57d81d=events[_0xacd1('0x6')];_0x30bc88<_0x57d81d;_0x30bc88++){var _0x39e829=events[_0x30bc88];var _0x2ba0e7=createListener('mailMessage:'+_0x39e829,_0x4376e7);MailMessageEvents['on'](_0x39e829,_0x2ba0e7);}};
\ No newline at end of file
+var _0xe9da=['length','mailMessage:','emit','removeListener','register'];(function(_0x3cdef7,_0x4c2d1e){var _0x2cd9fb=function(_0x33db50){while(--_0x33db50){_0x3cdef7['push'](_0x3cdef7['shift']());}};_0x2cd9fb(++_0x4c2d1e);}(_0xe9da,0x1dd));var _0xae9d=function(_0x61f330,_0x27d2c9){_0x61f330=_0x61f330-0x0;var _0x45daf0=_0xe9da[_0x61f330];return _0x45daf0;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove','update'];function createListener(_0x5a87c7,_0x301bd7){return function(_0x52f8d6){_0x301bd7[_0xae9d('0x0')](_0x5a87c7,_0x52f8d6);};}function removeListener(_0x4fbe3b,_0x186f40){return function(){MailMessageEvents[_0xae9d('0x1')](_0x4fbe3b,_0x186f40);};}exports[_0xae9d('0x2')]=function(_0x231c01){for(var _0x189d75=0x0,_0x35f87d=events[_0xae9d('0x3')];_0x189d75<_0x35f87d;_0x189d75++){var _0x2c270e=events[_0x189d75];var _0x28fe51=createListener(_0xae9d('0x4')+_0x2c270e,_0x231c01);MailMessageEvents['on'](_0x2c270e,_0x28fe51);}};
\ No newline at end of file
index 811a134..87c3c38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x816b=['./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','post','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x23bca9,_0x590fef){var _0x5eb135=function(_0x5e2e39){while(--_0x5e2e39){_0x23bca9['push'](_0x23bca9['shift']());}};_0x5eb135(++_0x590fef);}(_0x816b,0xb5));var _0xb816=function(_0x4c2940,_0x586dd8){_0x4c2940=_0x4c2940-0x0;var _0x241bde=_0x816b[_0x4c2940];return _0x241bde;};'use strict';var multer=require(_0xb816('0x0'));var util=require(_0xb816('0x1'));var path=require('path');var timeout=require(_0xb816('0x2'));var express=require(_0xb816('0x3'));var router=express['Router']();var fs_extra=require(_0xb816('0x4'));var auth=require(_0xb816('0x5'));var interaction=require(_0xb816('0x6'));var config=require(_0xb816('0x7'));var controller=require(_0xb816('0x8'));router['get']('/',auth[_0xb816('0x9')](),controller[_0xb816('0xa')]);router[_0xb816('0xb')](_0xb816('0xc'),auth['isAuthenticated'](),controller[_0xb816('0xd')]);router['get'](_0xb816('0xe'),auth[_0xb816('0x9')](),controller[_0xb816('0xf')]);router[_0xb816('0xb')](_0xb816('0x10'),auth[_0xb816('0x9')](),controller['getMembers']);router['get'](_0xb816('0x11'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xb816('0x12'),auth[_0xb816('0x9')](),controller['getAgents']);router[_0xb816('0x13')]('/',auth[_0xb816('0x9')](),controller['create']);router[_0xb816('0x13')](_0xb816('0x11'),auth[_0xb816('0x9')](),controller['addTeams']);router[_0xb816('0x13')](_0xb816('0x12'),auth[_0xb816('0x9')](),controller[_0xb816('0x14')]);router[_0xb816('0x15')](_0xb816('0xe'),auth['isAuthenticated'](),controller[_0xb816('0x16')]);router[_0xb816('0x17')](_0xb816('0xe'),auth[_0xb816('0x9')](),controller['destroy']);router[_0xb816('0x17')](_0xb816('0x11'),auth[_0xb816('0x9')](),controller[_0xb816('0x18')]);router[_0xb816('0x17')](_0xb816('0x12'),auth[_0xb816('0x9')](),controller[_0xb816('0x19')]);module[_0xb816('0x1a')]=router;
\ No newline at end of file
+var _0x9345=['../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','addAgents','put','update','delete','removeAgents','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4bf2ba,_0x506cd0){var _0x3ea44e=function(_0x3ff3b3){while(--_0x3ff3b3){_0x4bf2ba['push'](_0x4bf2ba['shift']());}};_0x3ea44e(++_0x506cd0);}(_0x9345,0x19e));var _0x5934=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x9345[_0x5b5cde];return _0x364ad2;};'use strict';var multer=require('multer');var util=require(_0x5934('0x0'));var path=require('path');var timeout=require(_0x5934('0x1'));var express=require('express');var router=express[_0x5934('0x2')]();var fs_extra=require(_0x5934('0x3'));var auth=require(_0x5934('0x4'));var interaction=require(_0x5934('0x5'));var config=require(_0x5934('0x6'));var controller=require(_0x5934('0x7'));router[_0x5934('0x8')]('/',auth[_0x5934('0x9')](),controller['index']);router[_0x5934('0x8')](_0x5934('0xa'),auth[_0x5934('0x9')](),controller[_0x5934('0xb')]);router[_0x5934('0x8')](_0x5934('0xc'),auth['isAuthenticated'](),controller[_0x5934('0xd')]);router['get'](_0x5934('0xe'),auth['isAuthenticated'](),controller[_0x5934('0xf')]);router[_0x5934('0x8')](_0x5934('0x10'),auth[_0x5934('0x9')](),controller[_0x5934('0x11')]);router[_0x5934('0x8')]('/:id/users',auth[_0x5934('0x9')](),controller[_0x5934('0x12')]);router[_0x5934('0x13')]('/',auth['isAuthenticated'](),controller[_0x5934('0x14')]);router[_0x5934('0x13')]('/:id/teams',auth[_0x5934('0x9')](),controller[_0x5934('0x15')]);router[_0x5934('0x13')]('/:id/users',auth[_0x5934('0x9')](),controller[_0x5934('0x16')]);router[_0x5934('0x17')](_0x5934('0xc'),auth[_0x5934('0x9')](),controller[_0x5934('0x18')]);router[_0x5934('0x19')](_0x5934('0xc'),auth[_0x5934('0x9')](),controller['destroy']);router[_0x5934('0x19')]('/:id/teams',auth[_0x5934('0x9')](),controller['removeTeams']);router[_0x5934('0x19')]('/:id/users',auth[_0x5934('0x9')](),controller[_0x5934('0x1a')]);module[_0x5934('0x1b')]=router;
\ No newline at end of file
index be11202..922e69a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1de=['exports','STRING','ENUM','rrmemory','beepall'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xd1de,0x17c));var _0xed1d=function(_0x8d9399,_0x490955){_0x8d9399=_0x8d9399-0x0;var _0x5a0645=_0xd1de[_0x8d9399];return _0x5a0645;};'use strict';var Sequelize=require('sequelize');module[_0xed1d('0x0')]={'name':{'type':Sequelize[_0xed1d('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xed1d('0x2')](_0xed1d('0x3'),_0xed1d('0x4'),'roundrobin')}};
\ No newline at end of file
+var _0x8fa5=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x542466,_0x488f22){var _0x4ec7bb=function(_0x110315){while(--_0x110315){_0x542466['push'](_0x542466['shift']());}};_0x4ec7bb(++_0x488f22);}(_0x8fa5,0xfc));var _0x58fa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8fa5[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x58fa('0x0'));module[_0x58fa('0x1')]={'name':{'type':Sequelize[_0x58fa('0x2')],'unique':_0x58fa('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x58fa('0x2')]},'timeout':{'type':Sequelize[_0x58fa('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x58fa('0x5'),_0x58fa('0x6'),_0x58fa('0x7'))}};
\ No newline at end of file
index 178eae8..220a442 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa446=['agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','fast-json-patch','moment','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/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','send','index','MailQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','order','sort','where','merge','VIRTUAL','filter','findAll','rows','catch','params','fields','includeAll','include','body','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','findOne','hasOwnProperty','nolimit','options','UserMailQueue','User','findAndCountAll','UserId'];(function(_0x443448,_0x55a089){var _0x169140=function(_0x557d79){while(--_0x557d79){_0x443448['push'](_0x443448['shift']());}};_0x169140(++_0x55a089);}(_0xa446,0xc6));var _0x6a44=function(_0x40f2bf,_0xba95d3){_0x40f2bf=_0x40f2bf-0x0;var _0x595a5b=_0xa446[_0x40f2bf];return _0x595a5b;};'use strict';var emlformat=require(_0x6a44('0x0'));var rimraf=require(_0x6a44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a44('0x2'));var rp=require('request-promise');var moment=require(_0x6a44('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a44('0x4'));var util=require('util');var path=require(_0x6a44('0x5'));var sox=require(_0x6a44('0x6'));var csv=require(_0x6a44('0x7'));var ejs=require(_0x6a44('0x8'));var fs=require('fs');var fs_extra=require(_0x6a44('0x9'));var _=require(_0x6a44('0xa'));var squel=require('squel');var crypto=require(_0x6a44('0xb'));var jsforce=require(_0x6a44('0xc'));var deskjs=require(_0x6a44('0xd'));var toCsv=require(_0x6a44('0x7'));var querystring=require(_0x6a44('0xe'));var Papa=require('papaparse');var Redis=require(_0x6a44('0xf'));var authService=require(_0x6a44('0x10'));var qs=require(_0x6a44('0x11'));var as=require(_0x6a44('0x12'));var hardwareService=require(_0x6a44('0x13'));var logger=require(_0x6a44('0x14'))(_0x6a44('0x15'));var utils=require('../../config/utils');var config=require(_0x6a44('0x16'));var licenseUtil=require(_0x6a44('0x17'));var db=require('../../mysqldb')['db'];config[_0x6a44('0x18')]=_[_0x6a44('0x19')](config[_0x6a44('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6a44('0x1a'))(new Redis(config[_0x6a44('0x18')]));require(_0x6a44('0x1b'))[_0x6a44('0x1c')](socket);function respondWithStatusCode(_0x156a27,_0x1481ed){_0x1481ed=_0x1481ed||0xcc;return function(_0x553bc1){if(_0x553bc1){return _0x156a27['sendStatus'](_0x1481ed);}return _0x156a27[_0x6a44('0x1d')](_0x1481ed)[_0x6a44('0x1e')]();};}function respondWithResult(_0x577275,_0xa665c0){_0xa665c0=_0xa665c0||0xc8;return function(_0x38f796){if(_0x38f796){return _0x577275[_0x6a44('0x1d')](_0xa665c0)[_0x6a44('0x1f')](_0x38f796);}};}function respondWithFilteredResult(_0x2ff2a0,_0x1e1de0){return function(_0x3dde7f){if(_0x3dde7f){var _0x6054d3=typeof _0x1e1de0[_0x6a44('0x20')]===_0x6a44('0x21')&&typeof _0x1e1de0[_0x6a44('0x22')]===_0x6a44('0x21');var _0x1b8920=_0x3dde7f[_0x6a44('0x23')];var _0x4c485e=_0x6054d3?0x0:_0x1e1de0['offset'];var _0x5e3673=_0x6054d3?_0x3dde7f[_0x6a44('0x23')]:_0x1e1de0[_0x6a44('0x20')]+_0x1e1de0[_0x6a44('0x22')];var _0x1a7990;if(_0x5e3673>=_0x1b8920){_0x5e3673=_0x1b8920;_0x1a7990=0xc8;}else{_0x1a7990=0xce;}_0x2ff2a0['status'](_0x1a7990);return _0x2ff2a0[_0x6a44('0x24')](_0x6a44('0x25'),_0x4c485e+'-'+_0x5e3673+'/'+_0x1b8920)['json'](_0x3dde7f);}return null;};}function patchUpdates(_0xebf7d6){return function(_0x24c04a){try{jsonpatch[_0x6a44('0x26')](_0x24c04a,_0xebf7d6,!![]);}catch(_0x153a7a){return BPromise[_0x6a44('0x27')](_0x153a7a);}return _0x24c04a[_0x6a44('0x28')]();};}function saveUpdates(_0x178b35,_0x1650fe){return function(_0x33c4d1){if(_0x33c4d1){return _0x33c4d1['update'](_0x178b35)[_0x6a44('0x29')](function(_0x99475e){return _0x99475e;});}return null;};}function removeEntity(_0x466c54,_0x36b027){return function(_0x499e87){if(_0x499e87){return _0x499e87[_0x6a44('0x2a')]()['then'](function(){var _0x3ad23e=_0x499e87[_0x6a44('0x2b')]({'plain':!![]});var _0x23d6a1=_0x6a44('0x2c');return db[_0x6a44('0x2d')][_0x6a44('0x2a')]({'where':{'type':_0x23d6a1,'resourceId':_0x3ad23e['id']}})[_0x6a44('0x29')](function(){return _0x499e87;});})[_0x6a44('0x29')](function(){_0x466c54[_0x6a44('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a5eab,_0x265f9d){return function(_0x5abc23){if(!_0x5abc23){_0x4a5eab[_0x6a44('0x2e')](0x194);}return _0x5abc23;};}function handleError(_0x5b46cd,_0x5e3985){_0x5e3985=_0x5e3985||0x1f4;return function(_0x391f33){logger[_0x6a44('0x2f')](_0x391f33[_0x6a44('0x30')]);if(_0x391f33['name']){delete _0x391f33[_0x6a44('0x31')];}_0x5b46cd['status'](_0x5e3985)[_0x6a44('0x32')](_0x391f33);};}exports[_0x6a44('0x33')]=function(_0x4b41c6,_0x58a1b4){var _0x3697e9={},_0x358433={},_0x4178fb={'count':0x0,'rows':[]};var _0x56a0f0=_['map'](db[_0x6a44('0x34')][_0x6a44('0x35')],function(_0x70e134){return{'name':_0x70e134['fieldName'],'type':_0x70e134[_0x6a44('0x36')][_0x6a44('0x37')]};});_0x358433[_0x6a44('0x38')]=_[_0x6a44('0x39')](_0x56a0f0,_0x6a44('0x31'));_0x358433[_0x6a44('0x3a')]=_[_0x6a44('0x3b')](_0x4b41c6[_0x6a44('0x3a')]);_0x358433[_0x6a44('0x3c')]=_[_0x6a44('0x3d')](_0x358433[_0x6a44('0x38')],_0x358433[_0x6a44('0x3a')]);_0x3697e9['attributes']=_[_0x6a44('0x3d')](_0x358433['model'],qs['fields'](_0x4b41c6['query']['fields']));_0x3697e9[_0x6a44('0x3e')]=_0x3697e9['attributes'][_0x6a44('0x3f')]?_0x3697e9['attributes']:_0x358433[_0x6a44('0x38')];if(!_0x4b41c6[_0x6a44('0x3a')]['hasOwnProperty']('nolimit')){_0x3697e9[_0x6a44('0x22')]=qs[_0x6a44('0x22')](_0x4b41c6[_0x6a44('0x3a')][_0x6a44('0x22')]);_0x3697e9['offset']=qs[_0x6a44('0x20')](_0x4b41c6[_0x6a44('0x3a')][_0x6a44('0x20')]);}_0x3697e9[_0x6a44('0x40')]=qs[_0x6a44('0x41')](_0x4b41c6[_0x6a44('0x3a')]['sort']);_0x3697e9[_0x6a44('0x42')]=qs[_0x6a44('0x3c')](_['pick'](_0x4b41c6[_0x6a44('0x3a')],_0x358433['filters']),_0x56a0f0);if(_0x4b41c6[_0x6a44('0x3a')]['filter']){_0x3697e9[_0x6a44('0x42')]=_[_0x6a44('0x43')](_0x3697e9[_0x6a44('0x42')],{'$or':_[_0x6a44('0x39')](_0x56a0f0,function(_0x220b00){if(_0x220b00['type']!==_0x6a44('0x44')){var _0x2eb2a0={};_0x2eb2a0[_0x220b00[_0x6a44('0x31')]]={'$like':'%'+_0x4b41c6['query'][_0x6a44('0x45')]+'%'};return _0x2eb2a0;}})});}_0x3697e9=_[_0x6a44('0x43')]({},_0x3697e9,_0x4b41c6['options']);var _0x4af24b={'where':_0x3697e9['where']};return db['MailQueue'][_0x6a44('0x23')](_0x4af24b)[_0x6a44('0x29')](function(_0x21ba45){_0x4178fb[_0x6a44('0x23')]=_0x21ba45;if(_0x4b41c6[_0x6a44('0x3a')]['includeAll']){_0x3697e9['include']=[{'all':!![]}];}return db[_0x6a44('0x34')][_0x6a44('0x46')](_0x3697e9);})[_0x6a44('0x29')](function(_0x4eb5d6){_0x4178fb[_0x6a44('0x47')]=_0x4eb5d6;return _0x4178fb;})[_0x6a44('0x29')](respondWithFilteredResult(_0x58a1b4,_0x3697e9))[_0x6a44('0x48')](handleError(_0x58a1b4,null));};exports['show']=function(_0x11c0ac,_0x3e809f){var _0x36dac5={'raw':!![],'where':{'id':_0x11c0ac[_0x6a44('0x49')]['id']}},_0x1055aa={};_0x1055aa[_0x6a44('0x38')]=_[_0x6a44('0x3b')](db[_0x6a44('0x34')]['rawAttributes']);_0x1055aa[_0x6a44('0x3a')]=_[_0x6a44('0x3b')](_0x11c0ac[_0x6a44('0x3a')]);_0x1055aa[_0x6a44('0x3c')]=_[_0x6a44('0x3d')](_0x1055aa[_0x6a44('0x38')],_0x1055aa[_0x6a44('0x3a')]);_0x36dac5[_0x6a44('0x3e')]=_[_0x6a44('0x3d')](_0x1055aa['model'],qs[_0x6a44('0x4a')](_0x11c0ac[_0x6a44('0x3a')][_0x6a44('0x4a')]));_0x36dac5[_0x6a44('0x3e')]=_0x36dac5[_0x6a44('0x3e')][_0x6a44('0x3f')]?_0x36dac5[_0x6a44('0x3e')]:_0x1055aa[_0x6a44('0x38')];if(_0x11c0ac['query'][_0x6a44('0x4b')]){_0x36dac5[_0x6a44('0x4c')]=[{'all':!![]}];}_0x36dac5=_[_0x6a44('0x43')]({},_0x36dac5,_0x11c0ac['options']);return db[_0x6a44('0x34')]['find'](_0x36dac5)['then'](handleEntityNotFound(_0x3e809f,null))[_0x6a44('0x29')](respondWithResult(_0x3e809f,null))[_0x6a44('0x48')](handleError(_0x3e809f,null));};exports['create']=function(_0x4f7468,_0x32fe47){return db[_0x6a44('0x34')]['create'](_0x4f7468[_0x6a44('0x4d')],{})['then'](function(_0x18f09a){var _0x434ded=_0x4f7468[_0x6a44('0x4e')]['get']({'plain':!![]});if(!_0x434ded)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x434ded['role']==='user'){var _0x267fe8=_0x18f09a[_0x6a44('0x2b')]({'plain':!![]});var _0x428a08=_0x6a44('0x2c');return db[_0x6a44('0x4f')]['find']({'where':{'name':_0x428a08,'userProfileId':_0x434ded[_0x6a44('0x50')]},'raw':!![]})['then'](function(_0x28855c){if(_0x28855c&&_0x28855c[_0x6a44('0x51')]===0x0){return db['UserProfileResource'][_0x6a44('0x52')]({'name':_0x267fe8[_0x6a44('0x31')],'resourceId':_0x267fe8['id'],'type':_0x28855c['name'],'sectionId':_0x28855c['id']},{})[_0x6a44('0x29')](function(){return _0x18f09a;});}else{return _0x18f09a;}})[_0x6a44('0x48')](function(_0x2f6390){logger[_0x6a44('0x2f')](_0x6a44('0x53'),_0x2f6390);throw _0x2f6390;});}return _0x18f09a;})[_0x6a44('0x29')](respondWithResult(_0x32fe47,0xc9))[_0x6a44('0x48')](handleError(_0x32fe47,null));};exports[_0x6a44('0x54')]=function(_0x2672ca,_0x2ba936){if(_0x2672ca['body']['id']){delete _0x2672ca[_0x6a44('0x4d')]['id'];}return db['MailQueue'][_0x6a44('0x55')]({'where':{'id':_0x2672ca[_0x6a44('0x49')]['id']}})[_0x6a44('0x29')](handleEntityNotFound(_0x2ba936,null))[_0x6a44('0x29')](saveUpdates(_0x2672ca[_0x6a44('0x4d')],null))['then'](respondWithResult(_0x2ba936,null))[_0x6a44('0x48')](handleError(_0x2ba936,null));};exports[_0x6a44('0x2a')]=function(_0x3806b0,_0x2276b5){return db[_0x6a44('0x34')][_0x6a44('0x55')]({'where':{'id':_0x3806b0[_0x6a44('0x49')]['id']}})[_0x6a44('0x29')](handleEntityNotFound(_0x2276b5,null))[_0x6a44('0x29')](removeEntity(_0x2276b5,null))[_0x6a44('0x48')](handleError(_0x2276b5,null));};exports[_0x6a44('0x56')]=function(_0x51e7df,_0x668d2a){return db[_0x6a44('0x34')][_0x6a44('0x56')]()[_0x6a44('0x29')](respondWithResult(_0x668d2a,null))[_0x6a44('0x48')](handleError(_0x668d2a,null));};exports[_0x6a44('0x57')]=function(_0x15a037,_0x330263,_0x276625){var _0x4fabb8={'raw':!![],'where':{}},_0x1d6d70={},_0x15ff59;return db[_0x6a44('0x34')][_0x6a44('0x58')]({'where':{'id':_0x15a037['params']['id']}})[_0x6a44('0x29')](handleEntityNotFound(_0x330263,null))[_0x6a44('0x29')](function(_0x3d9a14){if(_0x3d9a14){_0x15ff59=_0x3d9a14['get']({'plain':!![]});_0x1d6d70[_0x6a44('0x38')]=_['keys'](db['UserMailQueue'][_0x6a44('0x35')]);_0x1d6d70[_0x6a44('0x3a')]=_[_0x6a44('0x3b')](_0x15a037[_0x6a44('0x3a')]);_0x1d6d70[_0x6a44('0x3c')]=_['intersection'](_0x1d6d70[_0x6a44('0x38')],_0x1d6d70[_0x6a44('0x3a')]);_0x4fabb8['attributes']=_['intersection'](_0x1d6d70[_0x6a44('0x38')],qs[_0x6a44('0x4a')](_0x15a037[_0x6a44('0x3a')][_0x6a44('0x4a')]));_0x4fabb8['attributes']=_0x4fabb8[_0x6a44('0x3e')][_0x6a44('0x3f')]?_0x4fabb8['attributes']:_0x1d6d70['model'];if(!_0x15a037[_0x6a44('0x3a')][_0x6a44('0x59')](_0x6a44('0x5a'))){_0x4fabb8['limit']=qs[_0x6a44('0x22')](_0x15a037[_0x6a44('0x3a')][_0x6a44('0x22')]);_0x4fabb8[_0x6a44('0x20')]=qs[_0x6a44('0x20')](_0x15a037[_0x6a44('0x3a')]['offset']);}_0x4fabb8[_0x6a44('0x40')]=qs[_0x6a44('0x41')](_0x15a037['query'][_0x6a44('0x41')]);_0x4fabb8[_0x6a44('0x42')]=qs[_0x6a44('0x3c')](_['pick'](_0x15a037['query'],_0x1d6d70[_0x6a44('0x3c')]));_0x4fabb8[_0x6a44('0x42')]['MailQueueId']=_0x3d9a14['id'];if(_0x15a037[_0x6a44('0x3a')]['filter']){_0x4fabb8[_0x6a44('0x42')]=_[_0x6a44('0x43')](_0x4fabb8[_0x6a44('0x42')],{'$or':_[_0x6a44('0x39')](_0x4fabb8['attributes'],function(_0x4cf4c4){var _0x1d202c={};_0x1d202c[_0x4cf4c4]={'$like':'%'+_0x15a037[_0x6a44('0x3a')][_0x6a44('0x45')]+'%'};return _0x1d202c;})});}_0x4fabb8=_[_0x6a44('0x43')]({},_0x4fabb8,_0x15a037[_0x6a44('0x5b')]);return db[_0x6a44('0x5c')][_0x6a44('0x46')](_0x4fabb8);}})[_0x6a44('0x29')](function(_0x36e872){if(_0x36e872){return db[_0x6a44('0x5d')][_0x6a44('0x5e')]({'where':{'id':_[_0x6a44('0x39')](_0x36e872,_0x6a44('0x5f')),'role':_0x6a44('0x60')},'attributes':['id',_0x6a44('0x31'),_0x6a44('0x61'),_0x6a44('0x62'),_0x6a44('0x63')]});}})[_0x6a44('0x29')](function(_0x35459e){if(_0x35459e){return{'count':_0x35459e['count'],'rows':_[_0x6a44('0x39')](_0x35459e[_0x6a44('0x47')],function(_0x437375){return{'membername':_0x437375[_0x6a44('0x31')],'UserId':_0x437375['id'],'queue_name':_0x15ff59['name'],'MailQueueId':_0x15ff59['id'],'interface':util[_0x6a44('0x64')](_0x6a44('0x65'),_0x6a44('0x66'),_0x437375[_0x6a44('0x31')]),'penalty':0x0,'paused':_0x437375[_0x6a44('0x61')],'createdAt':_0x437375[_0x6a44('0x63')],'updatedAt':_0x437375['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6a44('0x29')](respondWithFilteredResult(_0x330263,_0x4fabb8))[_0x6a44('0x48')](handleError(_0x330263,null));};exports[_0x6a44('0x67')]=function(_0x34e348,_0x36c59d,_0x13aead){var _0x57fd0b={};var _0x1c813c={};var _0x52fe43;var _0x5cb6c3;return db[_0x6a44('0x34')][_0x6a44('0x58')]({'where':{'id':_0x34e348[_0x6a44('0x49')]['id']}})['then'](handleEntityNotFound(_0x36c59d,null))[_0x6a44('0x29')](function(_0x4b389b){if(_0x4b389b){_0x52fe43=_0x4b389b;_0x1c813c[_0x6a44('0x38')]=_['keys'](db[_0x6a44('0x68')]['rawAttributes']);_0x1c813c[_0x6a44('0x3a')]=_[_0x6a44('0x3b')](_0x34e348[_0x6a44('0x3a')]);_0x1c813c['filters']=_['intersection'](_0x1c813c[_0x6a44('0x38')],_0x1c813c[_0x6a44('0x3a')]);_0x57fd0b[_0x6a44('0x3e')]=_[_0x6a44('0x3d')](_0x1c813c[_0x6a44('0x38')],qs['fields'](_0x34e348[_0x6a44('0x3a')][_0x6a44('0x4a')]));_0x57fd0b[_0x6a44('0x3e')]=_0x57fd0b[_0x6a44('0x3e')][_0x6a44('0x3f')]?_0x57fd0b[_0x6a44('0x3e')]:_0x1c813c[_0x6a44('0x38')];_0x57fd0b['order']=qs[_0x6a44('0x41')](_0x34e348[_0x6a44('0x3a')][_0x6a44('0x41')]);_0x57fd0b[_0x6a44('0x42')]=qs[_0x6a44('0x3c')](_[_0x6a44('0x69')](_0x34e348[_0x6a44('0x3a')],_0x1c813c[_0x6a44('0x3c')]));if(_0x34e348[_0x6a44('0x3a')]['filter']){_0x57fd0b[_0x6a44('0x42')]=_[_0x6a44('0x43')](_0x57fd0b['where'],{'$or':_['map'](_0x57fd0b[_0x6a44('0x3e')],function(_0x44a2e2){var _0xcf855c={};_0xcf855c[_0x44a2e2]={'$like':'%'+_0x34e348[_0x6a44('0x3a')][_0x6a44('0x45')]+'%'};return _0xcf855c;})});}_0x57fd0b=_['merge']({},_0x57fd0b,_0x34e348[_0x6a44('0x5b')]);return _0x52fe43['getTeams'](_0x57fd0b);}})[_0x6a44('0x29')](function(_0x1bf50d){if(_0x1bf50d){_0x5cb6c3=_0x1bf50d[_0x6a44('0x3f')];if(!_0x34e348['query'][_0x6a44('0x59')](_0x6a44('0x5a'))){_0x57fd0b[_0x6a44('0x22')]=qs[_0x6a44('0x22')](_0x34e348[_0x6a44('0x3a')][_0x6a44('0x22')]);_0x57fd0b['offset']=qs[_0x6a44('0x20')](_0x34e348['query']['offset']);}return _0x52fe43[_0x6a44('0x67')](_0x57fd0b);}})[_0x6a44('0x29')](function(_0x51880a){if(_0x51880a){return _0x51880a?{'count':_0x5cb6c3,'rows':_0x51880a}:null;}})['then'](respondWithResult(_0x36c59d,null))[_0x6a44('0x48')](handleError(_0x36c59d,null));};exports[_0x6a44('0x6a')]=function(_0x10917d,_0x12f8a7,_0x1d312c){var _0x2a7819=_0x10917d[_0x6a44('0x4d')][_0x6a44('0x6b')];return db[_0x6a44('0x68')][_0x6a44('0x46')]({'where':{'id':_0x2a7819},'attributes':['id'],'include':[{'model':db[_0x6a44('0x5d')],'as':_0x6a44('0x6c'),'attributes':['id',_0x6a44('0x31'),_0x6a44('0x6d'),_0x6a44('0x6e'),_0x6a44('0x6f')],'raw':!![]}]})['then'](function(_0x53be18){if(_0x53be18){var _0x415fc4=_['flatMap'](_0x53be18,function(_0x1c3df0){var _0x38fcb1=_0x1c3df0['get']({'plain':!![]});return _0x38fcb1[_0x6a44('0x6c')];});return db['MailQueue'][_0x6a44('0x55')]({'where':{'id':_0x10917d[_0x6a44('0x49')]['id']}})[_0x6a44('0x29')](function(_0x2b22f3){return db[_0x6a44('0x70')][_0x6a44('0x71')](function(_0x4aac1c){return _0x2b22f3[_0x6a44('0x6a')](_0x2a7819,{'transaction':_0x4aac1c})[_0x6a44('0x29')](function(){return BPromise[_0x6a44('0x72')](_0x415fc4,function(_0x458ea3){return db['UserMailQueue'][_0x6a44('0x73')]({'where':{'UserId':_0x458ea3['id'],'MailQueueId':_0x10917d[_0x6a44('0x49')]['id']},'transaction':_0x4aac1c});});})[_0x6a44('0x29')](function(){_0x415fc4[_0x6a44('0x74')](function(_0x570e1c){socket[_0x6a44('0x75')](_0x6a44('0x76'),{'UserId':_0x570e1c['id'],'MailQueueId':_0x2b22f3['id']});});});});});}})[_0x6a44('0x29')](respondWithStatusCode(_0x12f8a7,null))[_0x6a44('0x48')](handleError(_0x12f8a7,null));};exports[_0x6a44('0x77')]=function(_0x23ebe0,_0x44e22a,_0x2ad499){return db[_0x6a44('0x68')][_0x6a44('0x46')]({'where':{'id':_0x23ebe0[_0x6a44('0x3a')][_0x6a44('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6a44('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x6a44('0x29')](handleEntityNotFound(_0x44e22a,null))['then'](function(_0xd00b93){var _0x306ede=_['map'](_0xd00b93,'id');var _0xb5ec7=[];var _0x1d5d4d=[];var _0x12e649=squel[_0x6a44('0x78')]();_0x12e649[_0x6a44('0x79')](_0x6a44('0x7a'))[_0x6a44('0x7b')](_0x6a44('0x7c'),'tq')[_0x6a44('0x7d')](_0x6a44('0x7e'),'ut',_0x6a44('0x7f'))[_0x6a44('0x42')](_0x6a44('0x80'),_0x23ebe0[_0x6a44('0x49')]['id']);for(var _0x25301e=0x0;_0x25301e<_0xd00b93[_0x6a44('0x3f')];_0x25301e+=0x1){let _0x17e228=_0xd00b93[_0x25301e];for(var _0x1fcef4=0x0;_0x1fcef4<_0x17e228[_0x6a44('0x6c')]['length'];_0x1fcef4+=0x1){let _0x150313=_0x17e228['Agents'][_0x1fcef4];var _0x5396ec=_0x12e649[_0x6a44('0x81')]();_0x5396ec[_0x6a44('0x42')](_0x6a44('0x82'),_0x150313['id']);_0x1d5d4d[_0x6a44('0x83')](db[_0x6a44('0x70')][_0x6a44('0x3a')](_0x5396ec['toString'](),{'type':db[_0x6a44('0x70')][_0x6a44('0x84')][_0x6a44('0x85')]})['then'](function(_0x1f635a){if(_0x1f635a[_0x6a44('0x3f')]===0x1){return _0x150313['id'];}else{var _0x5ab0ce=_[_0x6a44('0x86')](_[_0x6a44('0x39')](_0x1f635a,_0x6a44('0x87')),function(_0x38d690){return _['includes'](_0x306ede,_0x38d690);});if(_0x5ab0ce){return _0x150313['id'];}}}));}}return BPromise[_0x6a44('0x88')](_0x1d5d4d)['then'](function(_0x1400a9){_0xb5ec7=_(_0xb5ec7)[_0x6a44('0x89')](_0x1400a9)[_0x6a44('0x8a')]()[_0x6a44('0x8b')]();return db[_0x6a44('0x34')]['find']({'where':{'id':_0x23ebe0['params']['id']}})[_0x6a44('0x29')](function(_0x340cca){return db['sequelize'][_0x6a44('0x71')](function(_0xb6cd5c){return _0x340cca['removeTeams'](_0x23ebe0[_0x6a44('0x3a')][_0x6a44('0x6b')],{'transaction':_0xb6cd5c})['then'](function(){if(!_[_0x6a44('0x8c')](_0xb5ec7)){return _0x340cca[_0x6a44('0x8d')](_0xb5ec7,{'transaction':_0xb6cd5c});}})[_0x6a44('0x29')](function(){_0xb5ec7[_0x6a44('0x74')](function(_0x250311){socket['emit'](_0x6a44('0x8e'),{'UserId':_0x250311,'MailQueueId':_0x340cca['id']});});});});});});})['then'](respondWithStatusCode(_0x44e22a,null))[_0x6a44('0x48')](handleError(_0x44e22a,null));};exports[_0x6a44('0x8f')]=function(_0x42d6ad,_0x6bc830,_0x3155d4){return db['MailQueue'][_0x6a44('0x55')]({'where':{'id':_0x42d6ad[_0x6a44('0x49')]['id']}})[_0x6a44('0x29')](handleEntityNotFound(_0x6bc830,null))['then'](function(_0x558eac){if(_0x558eac){return _0x558eac[_0x6a44('0x8f')](_0x42d6ad[_0x6a44('0x4d')]['ids'],_[_0x6a44('0x90')](_0x42d6ad[_0x6a44('0x4d')],[_0x6a44('0x6b'),'id'])||{})[_0x6a44('0x91')](function(_0x1cca54){for(var _0x5c73cb=0x0;_0x5c73cb<_0x42d6ad[_0x6a44('0x4d')]['ids'][_0x6a44('0x3f')];_0x5c73cb+=0x1){socket[_0x6a44('0x75')](_0x6a44('0x76'),{'UserId':Number(_0x42d6ad[_0x6a44('0x4d')][_0x6a44('0x6b')][_0x5c73cb]),'MailQueueId':Number(_0x42d6ad['params']['id'])});}return _0x1cca54;});}})['then'](respondWithResult(_0x6bc830,null))[_0x6a44('0x48')](handleError(_0x6bc830,null));};exports[_0x6a44('0x8d')]=function(_0xde9068,_0x2dbc22,_0x20f806){return db[_0x6a44('0x34')]['find']({'where':{'id':_0xde9068['params']['id']}})['then'](handleEntityNotFound(_0x2dbc22,null))['then'](function(_0x452312){if(_0x452312){return _0x452312[_0x6a44('0x8d')](_0xde9068['query'][_0x6a44('0x6b')])['then'](function(){if(_['isArray'](_0xde9068[_0x6a44('0x3a')][_0x6a44('0x6b')])){for(var _0x33b94e=0x0;_0x33b94e<_0xde9068['query'][_0x6a44('0x6b')][_0x6a44('0x3f')];_0x33b94e+=0x1){socket['emit'](_0x6a44('0x8e'),{'UserId':Number(_0xde9068['query'][_0x6a44('0x6b')][_0x33b94e]),'MailQueueId':Number(_0xde9068[_0x6a44('0x49')]['id'])});}}else{socket[_0x6a44('0x75')](_0x6a44('0x8e'),{'UserId':Number(_0xde9068[_0x6a44('0x3a')][_0x6a44('0x6b')]),'MailQueueId':Number(_0xde9068[_0x6a44('0x49')]['id'])});}});}})[_0x6a44('0x29')](respondWithStatusCode(_0x2dbc22,null))[_0x6a44('0x48')](handleError(_0x2dbc22,null));};exports[_0x6a44('0x92')]=function(_0x1b74ef,_0x4e5163,_0x45a5a0){var _0x2fc264={};var _0x47f046={};var _0x516549;var _0x3f3b68;return db[_0x6a44('0x34')][_0x6a44('0x58')]({'where':{'id':_0x1b74ef[_0x6a44('0x49')]['id']}})[_0x6a44('0x29')](handleEntityNotFound(_0x4e5163,null))[_0x6a44('0x29')](function(_0x5b987e){if(_0x5b987e){_0x516549=_0x5b987e;_0x47f046[_0x6a44('0x38')]=_[_0x6a44('0x3b')](db['User'][_0x6a44('0x35')]);_0x47f046[_0x6a44('0x3a')]=_[_0x6a44('0x3b')](_0x1b74ef[_0x6a44('0x3a')]);_0x47f046['filters']=_['intersection'](_0x47f046[_0x6a44('0x38')],_0x47f046['query']);_0x2fc264[_0x6a44('0x3e')]=_['intersection'](_0x47f046[_0x6a44('0x38')],qs[_0x6a44('0x4a')](_0x1b74ef['query'][_0x6a44('0x4a')]));_0x2fc264[_0x6a44('0x3e')]=_0x2fc264[_0x6a44('0x3e')][_0x6a44('0x3f')]?_0x2fc264[_0x6a44('0x3e')]:_0x47f046[_0x6a44('0x38')];_0x2fc264['order']=qs[_0x6a44('0x41')](_0x1b74ef[_0x6a44('0x3a')]['sort']);_0x2fc264[_0x6a44('0x42')]=qs[_0x6a44('0x3c')](_['pick'](_0x1b74ef[_0x6a44('0x3a')],_0x47f046['filters']));if(_0x1b74ef[_0x6a44('0x3a')][_0x6a44('0x45')]){_0x2fc264['where']=_['merge'](_0x2fc264[_0x6a44('0x42')],{'$or':_[_0x6a44('0x39')](_0x2fc264[_0x6a44('0x3e')],function(_0xbf8699){var _0x2012c0={};_0x2012c0[_0xbf8699]={'$like':'%'+_0x1b74ef[_0x6a44('0x3a')][_0x6a44('0x45')]+'%'};return _0x2012c0;})});}_0x2fc264=_['merge']({},_0x2fc264,_0x1b74ef[_0x6a44('0x5b')]);return _0x516549[_0x6a44('0x92')](_0x2fc264);}})[_0x6a44('0x29')](function(_0x4b8b57){if(_0x4b8b57){_0x3f3b68=_0x4b8b57['length'];if(!_0x1b74ef[_0x6a44('0x3a')][_0x6a44('0x59')]('nolimit')){_0x2fc264[_0x6a44('0x22')]=qs['limit'](_0x1b74ef[_0x6a44('0x3a')][_0x6a44('0x22')]);_0x2fc264['offset']=qs[_0x6a44('0x20')](_0x1b74ef[_0x6a44('0x3a')][_0x6a44('0x20')]);}return _0x516549[_0x6a44('0x92')](_0x2fc264);}})[_0x6a44('0x29')](function(_0x25c0aa){if(_0x25c0aa){return _0x25c0aa?{'count':_0x3f3b68,'rows':_0x25c0aa}:null;}})[_0x6a44('0x29')](respondWithResult(_0x4e5163,null))['catch'](handleError(_0x4e5163,null));};
\ No newline at end of file
+var _0x125f=['user','MailQueues','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','hasOwnProperty','nolimit','MailQueueId','UserMailQueue','User','findAndCountAll','mailPause','updatedAt','createdAt','format','SIP','Team','getTeams','addTeams','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','ids','isEmpty','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','getAgents','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','MailQueue','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x4843f9,_0x4af459){var _0x193c6a=function(_0x51eca9){while(--_0x51eca9){_0x4843f9['push'](_0x4843f9['shift']());}};_0x193c6a(++_0x4af459);}(_0x125f,0x1e4));var _0xf125=function(_0x43c619,_0x574a80){_0x43c619=_0x43c619-0x0;var _0x2a2a4c=_0x125f[_0x43c619];return _0x2a2a4c;};'use strict';var emlformat=require(_0xf125('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf125('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf125('0x2'));var Mustache=require(_0xf125('0x3'));var util=require(_0xf125('0x4'));var path=require(_0xf125('0x5'));var sox=require(_0xf125('0x6'));var csv=require(_0xf125('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf125('0x8'));var _=require(_0xf125('0x9'));var squel=require(_0xf125('0xa'));var crypto=require('crypto');var jsforce=require(_0xf125('0xb'));var deskjs=require(_0xf125('0xc'));var toCsv=require(_0xf125('0x7'));var querystring=require(_0xf125('0xd'));var Papa=require(_0xf125('0xe'));var Redis=require(_0xf125('0xf'));var authService=require(_0xf125('0x10'));var qs=require(_0xf125('0x11'));var as=require(_0xf125('0x12'));var hardwareService=require(_0xf125('0x13'));var logger=require(_0xf125('0x14'))('api');var utils=require(_0xf125('0x15'));var config=require(_0xf125('0x16'));var licenseUtil=require(_0xf125('0x17'));var db=require(_0xf125('0x18'))['db'];config['redis']=_[_0xf125('0x19')](config[_0xf125('0x1a')],{'host':_0xf125('0x1b'),'port':0x18eb});var socket=require(_0xf125('0x1c'))(new Redis(config[_0xf125('0x1a')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x5a1909,_0x51a5b6){_0x51a5b6=_0x51a5b6||0xcc;return function(_0x2959f9){if(_0x2959f9){return _0x5a1909[_0xf125('0x1d')](_0x51a5b6);}return _0x5a1909[_0xf125('0x1e')](_0x51a5b6)['end']();};}function respondWithResult(_0x476e41,_0x1fc755){_0x1fc755=_0x1fc755||0xc8;return function(_0x70cdb5){if(_0x70cdb5){return _0x476e41[_0xf125('0x1e')](_0x1fc755)[_0xf125('0x1f')](_0x70cdb5);}};}function respondWithFilteredResult(_0xb27a88,_0x27253b){return function(_0x3ff778){if(_0x3ff778){var _0x48a4a6=typeof _0x27253b[_0xf125('0x20')]==='undefined'&&typeof _0x27253b['limit']===_0xf125('0x21');var _0x12449a=_0x3ff778['count'];var _0x3f861f=_0x48a4a6?0x0:_0x27253b[_0xf125('0x20')];var _0x54eede=_0x48a4a6?_0x3ff778[_0xf125('0x22')]:_0x27253b[_0xf125('0x20')]+_0x27253b['limit'];var _0x386bba;if(_0x54eede>=_0x12449a){_0x54eede=_0x12449a;_0x386bba=0xc8;}else{_0x386bba=0xce;}_0xb27a88['status'](_0x386bba);return _0xb27a88[_0xf125('0x23')]('Content-Range',_0x3f861f+'-'+_0x54eede+'/'+_0x12449a)[_0xf125('0x1f')](_0x3ff778);}return null;};}function patchUpdates(_0x1c6c1a){return function(_0x786715){try{jsonpatch[_0xf125('0x24')](_0x786715,_0x1c6c1a,!![]);}catch(_0x2d73d4){return BPromise[_0xf125('0x25')](_0x2d73d4);}return _0x786715[_0xf125('0x26')]();};}function saveUpdates(_0x32aa6a,_0x54d4e9){return function(_0xa79a08){if(_0xa79a08){return _0xa79a08[_0xf125('0x27')](_0x32aa6a)[_0xf125('0x28')](function(_0x41cf58){return _0x41cf58;});}return null;};}function removeEntity(_0x281661,_0x5cf79b){return function(_0x362054){if(_0x362054){return _0x362054[_0xf125('0x29')]()[_0xf125('0x28')](function(){var _0x42baba=_0x362054[_0xf125('0x2a')]({'plain':!![]});var _0x25ad22='MailQueues';return db[_0xf125('0x2b')][_0xf125('0x29')]({'where':{'type':_0x25ad22,'resourceId':_0x42baba['id']}})[_0xf125('0x28')](function(){return _0x362054;});})['then'](function(){_0x281661[_0xf125('0x1e')](0xcc)[_0xf125('0x2c')]();});}};}function handleEntityNotFound(_0x17868d,_0xb7057f){return function(_0x4e5127){if(!_0x4e5127){_0x17868d[_0xf125('0x1d')](0x194);}return _0x4e5127;};}function handleError(_0x271dce,_0x182f09){_0x182f09=_0x182f09||0x1f4;return function(_0x2fbad7){logger[_0xf125('0x2d')](_0x2fbad7[_0xf125('0x2e')]);if(_0x2fbad7[_0xf125('0x2f')]){delete _0x2fbad7['name'];}_0x271dce[_0xf125('0x1e')](_0x182f09)[_0xf125('0x30')](_0x2fbad7);};}exports[_0xf125('0x31')]=function(_0x5a9ad2,_0x12ce87){var _0x3b7ed3={},_0x562147={},_0x2ef85b={'count':0x0,'rows':[]};var _0x587502=_[_0xf125('0x32')](db['MailQueue'][_0xf125('0x33')],function(_0x3f5970){return{'name':_0x3f5970[_0xf125('0x34')],'type':_0x3f5970['type'][_0xf125('0x35')]};});_0x562147[_0xf125('0x36')]=_[_0xf125('0x32')](_0x587502,_0xf125('0x2f'));_0x562147[_0xf125('0x37')]=_[_0xf125('0x38')](_0x5a9ad2[_0xf125('0x37')]);_0x562147[_0xf125('0x39')]=_[_0xf125('0x3a')](_0x562147['model'],_0x562147[_0xf125('0x37')]);_0x3b7ed3[_0xf125('0x3b')]=_[_0xf125('0x3a')](_0x562147[_0xf125('0x36')],qs[_0xf125('0x3c')](_0x5a9ad2[_0xf125('0x37')][_0xf125('0x3c')]));_0x3b7ed3[_0xf125('0x3b')]=_0x3b7ed3[_0xf125('0x3b')][_0xf125('0x3d')]?_0x3b7ed3[_0xf125('0x3b')]:_0x562147[_0xf125('0x36')];if(!_0x5a9ad2[_0xf125('0x37')]['hasOwnProperty']('nolimit')){_0x3b7ed3[_0xf125('0x3e')]=qs[_0xf125('0x3e')](_0x5a9ad2[_0xf125('0x37')][_0xf125('0x3e')]);_0x3b7ed3[_0xf125('0x20')]=qs[_0xf125('0x20')](_0x5a9ad2['query'][_0xf125('0x20')]);}_0x3b7ed3[_0xf125('0x3f')]=qs['sort'](_0x5a9ad2[_0xf125('0x37')][_0xf125('0x40')]);_0x3b7ed3[_0xf125('0x41')]=qs[_0xf125('0x39')](_[_0xf125('0x42')](_0x5a9ad2[_0xf125('0x37')],_0x562147[_0xf125('0x39')]),_0x587502);if(_0x5a9ad2['query'][_0xf125('0x43')]){_0x3b7ed3[_0xf125('0x41')]=_[_0xf125('0x44')](_0x3b7ed3[_0xf125('0x41')],{'$or':_[_0xf125('0x32')](_0x587502,function(_0x19c443){if(_0x19c443[_0xf125('0x45')]!==_0xf125('0x46')){var _0x372bb2={};_0x372bb2[_0x19c443[_0xf125('0x2f')]]={'$like':'%'+_0x5a9ad2[_0xf125('0x37')][_0xf125('0x43')]+'%'};return _0x372bb2;}})});}_0x3b7ed3=_[_0xf125('0x44')]({},_0x3b7ed3,_0x5a9ad2[_0xf125('0x47')]);var _0x5eaca2={'where':_0x3b7ed3['where']};return db['MailQueue']['count'](_0x5eaca2)[_0xf125('0x28')](function(_0x4bca00){_0x2ef85b[_0xf125('0x22')]=_0x4bca00;if(_0x5a9ad2[_0xf125('0x37')][_0xf125('0x48')]){_0x3b7ed3[_0xf125('0x49')]=[{'all':!![]}];}return db[_0xf125('0x4a')][_0xf125('0x4b')](_0x3b7ed3);})[_0xf125('0x28')](function(_0x290dd4){_0x2ef85b[_0xf125('0x4c')]=_0x290dd4;return _0x2ef85b;})[_0xf125('0x28')](respondWithFilteredResult(_0x12ce87,_0x3b7ed3))[_0xf125('0x4d')](handleError(_0x12ce87,null));};exports['show']=function(_0x3e9a1a,_0x8f9711){var _0x40b298={'raw':!![],'where':{'id':_0x3e9a1a[_0xf125('0x4e')]['id']}},_0x169b8c={};_0x169b8c[_0xf125('0x36')]=_[_0xf125('0x38')](db['MailQueue'][_0xf125('0x33')]);_0x169b8c[_0xf125('0x37')]=_['keys'](_0x3e9a1a[_0xf125('0x37')]);_0x169b8c[_0xf125('0x39')]=_[_0xf125('0x3a')](_0x169b8c[_0xf125('0x36')],_0x169b8c['query']);_0x40b298[_0xf125('0x3b')]=_[_0xf125('0x3a')](_0x169b8c[_0xf125('0x36')],qs[_0xf125('0x3c')](_0x3e9a1a[_0xf125('0x37')]['fields']));_0x40b298[_0xf125('0x3b')]=_0x40b298[_0xf125('0x3b')][_0xf125('0x3d')]?_0x40b298[_0xf125('0x3b')]:_0x169b8c[_0xf125('0x36')];if(_0x3e9a1a[_0xf125('0x37')][_0xf125('0x48')]){_0x40b298[_0xf125('0x49')]=[{'all':!![]}];}_0x40b298=_['merge']({},_0x40b298,_0x3e9a1a[_0xf125('0x47')]);return db[_0xf125('0x4a')][_0xf125('0x4f')](_0x40b298)['then'](handleEntityNotFound(_0x8f9711,null))[_0xf125('0x28')](respondWithResult(_0x8f9711,null))[_0xf125('0x4d')](handleError(_0x8f9711,null));};exports['create']=function(_0x342d0c,_0x2debd9){return db[_0xf125('0x4a')][_0xf125('0x50')](_0x342d0c[_0xf125('0x51')],{})['then'](function(_0x55cf1f){var _0x38817f=_0x342d0c['user'][_0xf125('0x2a')]({'plain':!![]});if(!_0x38817f)throw new Error(_0xf125('0x52'));if(_0x38817f[_0xf125('0x53')]===_0xf125('0x54')){var _0x21fda4=_0x55cf1f[_0xf125('0x2a')]({'plain':!![]});var _0x5318e0=_0xf125('0x55');return db[_0xf125('0x56')]['find']({'where':{'name':_0x5318e0,'userProfileId':_0x38817f[_0xf125('0x57')]},'raw':!![]})[_0xf125('0x28')](function(_0xd48455){if(_0xd48455&&_0xd48455[_0xf125('0x58')]===0x0){return db[_0xf125('0x2b')]['create']({'name':_0x21fda4[_0xf125('0x2f')],'resourceId':_0x21fda4['id'],'type':_0xd48455[_0xf125('0x2f')],'sectionId':_0xd48455['id']},{})['then'](function(){return _0x55cf1f;});}else{return _0x55cf1f;}})[_0xf125('0x4d')](function(_0x947ec3){logger[_0xf125('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x947ec3);throw _0x947ec3;});}return _0x55cf1f;})[_0xf125('0x28')](respondWithResult(_0x2debd9,0xc9))[_0xf125('0x4d')](handleError(_0x2debd9,null));};exports[_0xf125('0x27')]=function(_0x5420bf,_0x3cc140){if(_0x5420bf[_0xf125('0x51')]['id']){delete _0x5420bf[_0xf125('0x51')]['id'];}return db['MailQueue'][_0xf125('0x4f')]({'where':{'id':_0x5420bf[_0xf125('0x4e')]['id']}})[_0xf125('0x28')](handleEntityNotFound(_0x3cc140,null))['then'](saveUpdates(_0x5420bf[_0xf125('0x51')],null))[_0xf125('0x28')](respondWithResult(_0x3cc140,null))['catch'](handleError(_0x3cc140,null));};exports[_0xf125('0x29')]=function(_0xae41a6,_0x2c1f8e){return db[_0xf125('0x4a')][_0xf125('0x4f')]({'where':{'id':_0xae41a6[_0xf125('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c1f8e,null))[_0xf125('0x28')](removeEntity(_0x2c1f8e,null))['catch'](handleError(_0x2c1f8e,null));};exports[_0xf125('0x59')]=function(_0x15df9e,_0x400ef6){return db['MailQueue'][_0xf125('0x59')]()[_0xf125('0x28')](respondWithResult(_0x400ef6,null))['catch'](handleError(_0x400ef6,null));};exports[_0xf125('0x5a')]=function(_0x303ee7,_0x5ae645,_0x2259cc){var _0x4c3b3a={'raw':!![],'where':{}},_0x17213c={},_0x2cd810;return db[_0xf125('0x4a')][_0xf125('0x5b')]({'where':{'id':_0x303ee7['params']['id']}})[_0xf125('0x28')](handleEntityNotFound(_0x5ae645,null))['then'](function(_0xeecbd8){if(_0xeecbd8){_0x2cd810=_0xeecbd8[_0xf125('0x2a')]({'plain':!![]});_0x17213c[_0xf125('0x36')]=_[_0xf125('0x38')](db['UserMailQueue'][_0xf125('0x33')]);_0x17213c['query']=_[_0xf125('0x38')](_0x303ee7[_0xf125('0x37')]);_0x17213c[_0xf125('0x39')]=_[_0xf125('0x3a')](_0x17213c[_0xf125('0x36')],_0x17213c[_0xf125('0x37')]);_0x4c3b3a[_0xf125('0x3b')]=_[_0xf125('0x3a')](_0x17213c[_0xf125('0x36')],qs[_0xf125('0x3c')](_0x303ee7[_0xf125('0x37')]['fields']));_0x4c3b3a[_0xf125('0x3b')]=_0x4c3b3a['attributes'][_0xf125('0x3d')]?_0x4c3b3a['attributes']:_0x17213c[_0xf125('0x36')];if(!_0x303ee7[_0xf125('0x37')][_0xf125('0x5c')](_0xf125('0x5d'))){_0x4c3b3a[_0xf125('0x3e')]=qs[_0xf125('0x3e')](_0x303ee7['query'][_0xf125('0x3e')]);_0x4c3b3a[_0xf125('0x20')]=qs[_0xf125('0x20')](_0x303ee7[_0xf125('0x37')][_0xf125('0x20')]);}_0x4c3b3a[_0xf125('0x3f')]=qs[_0xf125('0x40')](_0x303ee7[_0xf125('0x37')][_0xf125('0x40')]);_0x4c3b3a[_0xf125('0x41')]=qs[_0xf125('0x39')](_[_0xf125('0x42')](_0x303ee7[_0xf125('0x37')],_0x17213c[_0xf125('0x39')]));_0x4c3b3a[_0xf125('0x41')][_0xf125('0x5e')]=_0xeecbd8['id'];if(_0x303ee7[_0xf125('0x37')][_0xf125('0x43')]){_0x4c3b3a['where']=_[_0xf125('0x44')](_0x4c3b3a[_0xf125('0x41')],{'$or':_['map'](_0x4c3b3a[_0xf125('0x3b')],function(_0x2ff1e0){var _0x1eb71a={};_0x1eb71a[_0x2ff1e0]={'$like':'%'+_0x303ee7[_0xf125('0x37')][_0xf125('0x43')]+'%'};return _0x1eb71a;})});}_0x4c3b3a=_['merge']({},_0x4c3b3a,_0x303ee7[_0xf125('0x47')]);return db[_0xf125('0x5f')][_0xf125('0x4b')](_0x4c3b3a);}})[_0xf125('0x28')](function(_0x580557){if(_0x580557){return db[_0xf125('0x60')][_0xf125('0x61')]({'where':{'id':_[_0xf125('0x32')](_0x580557,'UserId'),'role':'agent'},'attributes':['id',_0xf125('0x2f'),_0xf125('0x62'),_0xf125('0x63'),_0xf125('0x64')]});}})[_0xf125('0x28')](function(_0x1e63f1){if(_0x1e63f1){return{'count':_0x1e63f1['count'],'rows':_[_0xf125('0x32')](_0x1e63f1[_0xf125('0x4c')],function(_0x96afe5){return{'membername':_0x96afe5[_0xf125('0x2f')],'UserId':_0x96afe5['id'],'queue_name':_0x2cd810[_0xf125('0x2f')],'MailQueueId':_0x2cd810['id'],'interface':util[_0xf125('0x65')]('%s/%s',_0xf125('0x66'),_0x96afe5['name']),'penalty':0x0,'paused':_0x96afe5[_0xf125('0x62')],'createdAt':_0x96afe5[_0xf125('0x64')],'updatedAt':_0x96afe5[_0xf125('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf125('0x28')](respondWithFilteredResult(_0x5ae645,_0x4c3b3a))['catch'](handleError(_0x5ae645,null));};exports['getTeams']=function(_0x2fb460,_0x9e750,_0x594631){var _0xf4aa2a={};var _0x5add3d={};var _0x4dd370;var _0x1d6713;return db[_0xf125('0x4a')][_0xf125('0x5b')]({'where':{'id':_0x2fb460[_0xf125('0x4e')]['id']}})[_0xf125('0x28')](handleEntityNotFound(_0x9e750,null))[_0xf125('0x28')](function(_0x482a2c){if(_0x482a2c){_0x4dd370=_0x482a2c;_0x5add3d[_0xf125('0x36')]=_['keys'](db[_0xf125('0x67')]['rawAttributes']);_0x5add3d[_0xf125('0x37')]=_[_0xf125('0x38')](_0x2fb460[_0xf125('0x37')]);_0x5add3d[_0xf125('0x39')]=_['intersection'](_0x5add3d[_0xf125('0x36')],_0x5add3d['query']);_0xf4aa2a['attributes']=_[_0xf125('0x3a')](_0x5add3d[_0xf125('0x36')],qs[_0xf125('0x3c')](_0x2fb460[_0xf125('0x37')][_0xf125('0x3c')]));_0xf4aa2a['attributes']=_0xf4aa2a[_0xf125('0x3b')][_0xf125('0x3d')]?_0xf4aa2a[_0xf125('0x3b')]:_0x5add3d[_0xf125('0x36')];_0xf4aa2a[_0xf125('0x3f')]=qs[_0xf125('0x40')](_0x2fb460[_0xf125('0x37')][_0xf125('0x40')]);_0xf4aa2a['where']=qs[_0xf125('0x39')](_[_0xf125('0x42')](_0x2fb460[_0xf125('0x37')],_0x5add3d[_0xf125('0x39')]));if(_0x2fb460['query'][_0xf125('0x43')]){_0xf4aa2a[_0xf125('0x41')]=_['merge'](_0xf4aa2a[_0xf125('0x41')],{'$or':_[_0xf125('0x32')](_0xf4aa2a[_0xf125('0x3b')],function(_0x445d99){var _0x3024ad={};_0x3024ad[_0x445d99]={'$like':'%'+_0x2fb460[_0xf125('0x37')][_0xf125('0x43')]+'%'};return _0x3024ad;})});}_0xf4aa2a=_[_0xf125('0x44')]({},_0xf4aa2a,_0x2fb460[_0xf125('0x47')]);return _0x4dd370['getTeams'](_0xf4aa2a);}})[_0xf125('0x28')](function(_0x284cba){if(_0x284cba){_0x1d6713=_0x284cba[_0xf125('0x3d')];if(!_0x2fb460[_0xf125('0x37')][_0xf125('0x5c')]('nolimit')){_0xf4aa2a[_0xf125('0x3e')]=qs[_0xf125('0x3e')](_0x2fb460[_0xf125('0x37')][_0xf125('0x3e')]);_0xf4aa2a[_0xf125('0x20')]=qs[_0xf125('0x20')](_0x2fb460[_0xf125('0x37')]['offset']);}return _0x4dd370[_0xf125('0x68')](_0xf4aa2a);}})[_0xf125('0x28')](function(_0x2de858){if(_0x2de858){return _0x2de858?{'count':_0x1d6713,'rows':_0x2de858}:null;}})[_0xf125('0x28')](respondWithResult(_0x9e750,null))[_0xf125('0x4d')](handleError(_0x9e750,null));};exports[_0xf125('0x69')]=function(_0x22634e,_0x290022,_0x36bf08){var _0x3a421c=_0x22634e[_0xf125('0x51')]['ids'];return db[_0xf125('0x67')]['findAll']({'where':{'id':_0x3a421c},'attributes':['id'],'include':[{'model':db[_0xf125('0x60')],'as':_0xf125('0x6a'),'attributes':['id',_0xf125('0x2f'),'online',_0xf125('0x6b'),_0xf125('0x6c')],'raw':!![]}]})[_0xf125('0x28')](function(_0x265cad){if(_0x265cad){var _0x236be3=_[_0xf125('0x6d')](_0x265cad,function(_0x5028c1){var _0x43cc59=_0x5028c1[_0xf125('0x2a')]({'plain':!![]});return _0x43cc59['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x22634e[_0xf125('0x4e')]['id']}})['then'](function(_0x3ec9b6){return db[_0xf125('0x6e')]['transaction'](function(_0x41f578){return _0x3ec9b6[_0xf125('0x69')](_0x3a421c,{'transaction':_0x41f578})[_0xf125('0x28')](function(){return BPromise[_0xf125('0x6f')](_0x236be3,function(_0x2e50ba){return db['UserMailQueue'][_0xf125('0x70')]({'where':{'UserId':_0x2e50ba['id'],'MailQueueId':_0x22634e['params']['id']},'transaction':_0x41f578});});})[_0xf125('0x28')](function(){_0x236be3[_0xf125('0x71')](function(_0x29c9c6){socket[_0xf125('0x72')]('userMailQueue:save',{'UserId':_0x29c9c6['id'],'MailQueueId':_0x3ec9b6['id']});});});});});}})[_0xf125('0x28')](respondWithStatusCode(_0x290022,null))[_0xf125('0x4d')](handleError(_0x290022,null));};exports[_0xf125('0x73')]=function(_0x1dd9b3,_0x3d552f,_0x54a92f){return db[_0xf125('0x67')][_0xf125('0x4b')]({'where':{'id':_0x1dd9b3[_0xf125('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf125('0x60')],'as':_0xf125('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xf125('0x28')](handleEntityNotFound(_0x3d552f,null))[_0xf125('0x28')](function(_0x196836){var _0x57c18c=_[_0xf125('0x32')](_0x196836,'id');var _0x475af3=[];var _0x1dbe25=[];var _0x1f369a=squel[_0xf125('0x74')]();_0x1f369a['field']('tq.TeamId')[_0xf125('0x75')](_0xf125('0x76'),'tq')[_0xf125('0x77')](_0xf125('0x78'),'ut',_0xf125('0x79'))[_0xf125('0x41')](_0xf125('0x7a'),_0x1dd9b3['params']['id']);for(var _0x2d82bf=0x0;_0x2d82bf<_0x196836[_0xf125('0x3d')];_0x2d82bf+=0x1){let _0x572f85=_0x196836[_0x2d82bf];for(var _0x1da3de=0x0;_0x1da3de<_0x572f85['Agents']['length'];_0x1da3de+=0x1){let _0x5b811b=_0x572f85[_0xf125('0x6a')][_0x1da3de];var _0x6ea140=_0x1f369a[_0xf125('0x7b')]();_0x6ea140[_0xf125('0x41')]('ut.UserId\x20=\x20?',_0x5b811b['id']);_0x1dbe25[_0xf125('0x7c')](db['sequelize'][_0xf125('0x37')](_0x6ea140['toString'](),{'type':db[_0xf125('0x6e')][_0xf125('0x7d')][_0xf125('0x7e')]})[_0xf125('0x28')](function(_0x23eb11){if(_0x23eb11[_0xf125('0x3d')]===0x1){return _0x5b811b['id'];}else{var _0x2dc048=_[_0xf125('0x7f')](_[_0xf125('0x32')](_0x23eb11,_0xf125('0x80')),function(_0x292828){return _[_0xf125('0x81')](_0x57c18c,_0x292828);});if(_0x2dc048){return _0x5b811b['id'];}}}));}}return BPromise[_0xf125('0x82')](_0x1dbe25)[_0xf125('0x28')](function(_0x3cf789){_0x475af3=_(_0x475af3)[_0xf125('0x83')](_0x3cf789)[_0xf125('0x84')]()[_0xf125('0x85')]();return db[_0xf125('0x4a')][_0xf125('0x4f')]({'where':{'id':_0x1dd9b3['params']['id']}})[_0xf125('0x28')](function(_0x1ef563){return db['sequelize']['transaction'](function(_0x1a8c46){return _0x1ef563['removeTeams'](_0x1dd9b3[_0xf125('0x37')][_0xf125('0x86')],{'transaction':_0x1a8c46})[_0xf125('0x28')](function(){if(!_[_0xf125('0x87')](_0x475af3)){return _0x1ef563['removeAgents'](_0x475af3,{'transaction':_0x1a8c46});}})[_0xf125('0x28')](function(){_0x475af3[_0xf125('0x71')](function(_0x14ab61){socket[_0xf125('0x72')](_0xf125('0x88'),{'UserId':_0x14ab61,'MailQueueId':_0x1ef563['id']});});});});});});})[_0xf125('0x28')](respondWithStatusCode(_0x3d552f,null))['catch'](handleError(_0x3d552f,null));};exports[_0xf125('0x89')]=function(_0x15ec54,_0xbc66f1,_0x202dee){return db[_0xf125('0x4a')][_0xf125('0x4f')]({'where':{'id':_0x15ec54['params']['id']}})[_0xf125('0x28')](handleEntityNotFound(_0xbc66f1,null))[_0xf125('0x28')](function(_0x3e7b70){if(_0x3e7b70){return _0x3e7b70['addAgents'](_0x15ec54['body'][_0xf125('0x86')],_[_0xf125('0x8a')](_0x15ec54[_0xf125('0x51')],['ids','id'])||{})[_0xf125('0x8b')](function(_0x13b9f0){for(var _0x138afe=0x0;_0x138afe<_0x15ec54[_0xf125('0x51')][_0xf125('0x86')][_0xf125('0x3d')];_0x138afe+=0x1){socket['emit'](_0xf125('0x8c'),{'UserId':Number(_0x15ec54[_0xf125('0x51')][_0xf125('0x86')][_0x138afe]),'MailQueueId':Number(_0x15ec54[_0xf125('0x4e')]['id'])});}return _0x13b9f0;});}})[_0xf125('0x28')](respondWithResult(_0xbc66f1,null))[_0xf125('0x4d')](handleError(_0xbc66f1,null));};exports['removeAgents']=function(_0x43a280,_0x44e5f2,_0x3fb460){return db[_0xf125('0x4a')]['find']({'where':{'id':_0x43a280['params']['id']}})[_0xf125('0x28')](handleEntityNotFound(_0x44e5f2,null))[_0xf125('0x28')](function(_0x51dc53){if(_0x51dc53){return _0x51dc53['removeAgents'](_0x43a280[_0xf125('0x37')]['ids'])[_0xf125('0x28')](function(){if(_['isArray'](_0x43a280[_0xf125('0x37')][_0xf125('0x86')])){for(var _0x3146fe=0x0;_0x3146fe<_0x43a280[_0xf125('0x37')]['ids'][_0xf125('0x3d')];_0x3146fe+=0x1){socket[_0xf125('0x72')](_0xf125('0x88'),{'UserId':Number(_0x43a280[_0xf125('0x37')][_0xf125('0x86')][_0x3146fe]),'MailQueueId':Number(_0x43a280[_0xf125('0x4e')]['id'])});}}else{socket[_0xf125('0x72')](_0xf125('0x88'),{'UserId':Number(_0x43a280[_0xf125('0x37')][_0xf125('0x86')]),'MailQueueId':Number(_0x43a280[_0xf125('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x44e5f2,null))[_0xf125('0x4d')](handleError(_0x44e5f2,null));};exports['getAgents']=function(_0x29c23b,_0x1233a7,_0x4d1747){var _0x364fc8={};var _0x33be92={};var _0x1386d9;var _0x4e5d7d;return db[_0xf125('0x4a')][_0xf125('0x5b')]({'where':{'id':_0x29c23b[_0xf125('0x4e')]['id']}})[_0xf125('0x28')](handleEntityNotFound(_0x1233a7,null))[_0xf125('0x28')](function(_0x11bc9e){if(_0x11bc9e){_0x1386d9=_0x11bc9e;_0x33be92[_0xf125('0x36')]=_[_0xf125('0x38')](db[_0xf125('0x60')]['rawAttributes']);_0x33be92['query']=_[_0xf125('0x38')](_0x29c23b[_0xf125('0x37')]);_0x33be92[_0xf125('0x39')]=_[_0xf125('0x3a')](_0x33be92[_0xf125('0x36')],_0x33be92[_0xf125('0x37')]);_0x364fc8[_0xf125('0x3b')]=_[_0xf125('0x3a')](_0x33be92[_0xf125('0x36')],qs[_0xf125('0x3c')](_0x29c23b[_0xf125('0x37')]['fields']));_0x364fc8['attributes']=_0x364fc8[_0xf125('0x3b')][_0xf125('0x3d')]?_0x364fc8[_0xf125('0x3b')]:_0x33be92[_0xf125('0x36')];_0x364fc8[_0xf125('0x3f')]=qs[_0xf125('0x40')](_0x29c23b['query']['sort']);_0x364fc8['where']=qs[_0xf125('0x39')](_[_0xf125('0x42')](_0x29c23b['query'],_0x33be92[_0xf125('0x39')]));if(_0x29c23b[_0xf125('0x37')][_0xf125('0x43')]){_0x364fc8[_0xf125('0x41')]=_[_0xf125('0x44')](_0x364fc8[_0xf125('0x41')],{'$or':_[_0xf125('0x32')](_0x364fc8[_0xf125('0x3b')],function(_0x5e4acc){var _0x5be370={};_0x5be370[_0x5e4acc]={'$like':'%'+_0x29c23b['query'][_0xf125('0x43')]+'%'};return _0x5be370;})});}_0x364fc8=_[_0xf125('0x44')]({},_0x364fc8,_0x29c23b['options']);return _0x1386d9[_0xf125('0x8d')](_0x364fc8);}})[_0xf125('0x28')](function(_0x4845f0){if(_0x4845f0){_0x4e5d7d=_0x4845f0[_0xf125('0x3d')];if(!_0x29c23b[_0xf125('0x37')][_0xf125('0x5c')](_0xf125('0x5d'))){_0x364fc8['limit']=qs[_0xf125('0x3e')](_0x29c23b['query'][_0xf125('0x3e')]);_0x364fc8['offset']=qs['offset'](_0x29c23b[_0xf125('0x37')][_0xf125('0x20')]);}return _0x1386d9[_0xf125('0x8d')](_0x364fc8);}})[_0xf125('0x28')](function(_0x16ddd3){if(_0x16ddd3){return _0x16ddd3?{'count':_0x4e5d7d,'rows':_0x16ddd3}:null;}})[_0xf125('0x28')](respondWithResult(_0x1233a7,null))['catch'](handleError(_0x1233a7,null));};
\ No newline at end of file
index cf4b363..6bc4352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01b7=['remove','emit','hasOwnProperty','exports','../../mysqldb','MailQueue','save'];(function(_0x179c83,_0x5ab198){var _0x88c788=function(_0x2b7ecf){while(--_0x2b7ecf){_0x179c83['push'](_0x179c83['shift']());}};_0x88c788(++_0x5ab198);}(_0x01b7,0x1ee));var _0x701b=function(_0x5be861,_0x40498a){_0x5be861=_0x5be861-0x0;var _0x5de1e1=_0x01b7[_0x5be861];return _0x5de1e1;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x701b('0x0'))['db'][_0x701b('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x701b('0x2'),'afterUpdate':'update','afterDestroy':_0x701b('0x3')};function emitEvent(_0x58c9c3){return function(_0x25c87c,_0x4df1ae,_0x1f8af7){MailQueueEvents[_0x701b('0x4')](_0x58c9c3+':'+_0x25c87c['id'],_0x25c87c);MailQueueEvents['emit'](_0x58c9c3,_0x25c87c);_0x1f8af7(null);};}for(var e in events){if(events[_0x701b('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x701b('0x6')]=MailQueueEvents;
\ No newline at end of file
+var _0x632d=['remove','emit','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x37cbf0,_0x259eda){var _0x129a65=function(_0x2c556c){while(--_0x2c556c){_0x37cbf0['push'](_0x37cbf0['shift']());}};_0x129a65(++_0x259eda);}(_0x632d,0x108));var _0xd632=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x632d[_0x484c03];return _0x294127;};'use strict';var EventEmitter=require(_0xd632('0x0'));var MailQueue=require(_0xd632('0x1'))['db'][_0xd632('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd632('0x3')](0x0);var events={'afterCreate':_0xd632('0x4'),'afterUpdate':_0xd632('0x5'),'afterDestroy':_0xd632('0x6')};function emitEvent(_0xb4cf63){return function(_0x154d85,_0x1b6c6c,_0x443cfd){MailQueueEvents[_0xd632('0x7')](_0xb4cf63+':'+_0x154d85['id'],_0x154d85);MailQueueEvents[_0xd632('0x7')](_0xb4cf63,_0x154d85);_0x443cfd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xd632('0x8')](e,emitEvent(event));}}module[_0xd632('0x9')]=MailQueueEvents;
\ No newline at end of file
index a0195eb..2b71fe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0608=['util','../../config/logger','api','moment','path','../../config/environment','mail_queues'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0608,0x8c));var _0x8060=function(_0x569949,_0x2ccc7f){_0x569949=_0x569949-0x0;var _0x1c4ffb=_0x0608[_0x569949];return _0x1c4ffb;};'use strict';var _=require('lodash');var util=require(_0x8060('0x0'));var logger=require(_0x8060('0x1'))(_0x8060('0x2'));var moment=require(_0x8060('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8060('0x4'));var rimraf=require('rimraf');var config=require(_0x8060('0x5'));var attributes=require('./mailQueue.attributes');module['exports']=function(_0x3a7bd1,_0x38f2a7){return _0x3a7bd1['define']('MailQueue',attributes,{'tableName':_0x8060('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b41=['api','moment','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','lodash','util'];(function(_0x2f5913,_0x593055){var _0x178130=function(_0xea3123){while(--_0xea3123){_0x2f5913['push'](_0x2f5913['shift']());}};_0x178130(++_0x593055);}(_0x6b41,0x1d7));var _0x16b4=function(_0x58e0b3,_0x136017){_0x58e0b3=_0x58e0b3-0x0;var _0x14441e=_0x6b41[_0x58e0b3];return _0x14441e;};'use strict';var _=require(_0x16b4('0x0'));var util=require(_0x16b4('0x1'));var logger=require('../../config/logger')(_0x16b4('0x2'));var moment=require(_0x16b4('0x3'));var BPromise=require(_0x16b4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16b4('0x5'));var rimraf=require(_0x16b4('0x6'));var config=require(_0x16b4('0x7'));var attributes=require(_0x16b4('0x8'));module[_0x16b4('0x9')]=function(_0x5ec204,_0x3cd326){return _0x5ec204['define'](_0x16b4('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a090992..d0f06c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf04a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue','findAll','options','raw','where','attributes','limit','map','include','model','GetMailQueue','debug','find','ShowMailQueue','util','moment','bluebird'];(function(_0x14e99c,_0x1ac877){var _0x896bd8=function(_0x153fc7){while(--_0x153fc7){_0x14e99c['push'](_0x14e99c['shift']());}};_0x896bd8(++_0x1ac877);}(_0xf04a,0xa9));var _0xaf04=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf04a[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0xaf04('0x0'));var moment=require(_0xaf04('0x1'));var BPromise=require(_0xaf04('0x2'));var rs=require(_0xaf04('0x3'));var fs=require('fs');var Redis=require(_0xaf04('0x4'));var db=require(_0xaf04('0x5'))['db'];var utils=require(_0xaf04('0x6'));var logger=require(_0xaf04('0x7'))(_0xaf04('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf04('0x9'));var client=jayson[_0xaf04('0xa')]['http']({'port':0x232a});config[_0xaf04('0xb')]=_[_0xaf04('0xc')](config['redis'],{'host':_0xaf04('0xd'),'port':0x18eb});var socket=require(_0xaf04('0xe'))(new Redis(config[_0xaf04('0xb')]));require(_0xaf04('0xf'))[_0xaf04('0x10')](socket);function respondWithRpcPromise(_0x4a19d7,_0x4c3fc0,_0x2e7f09){return new BPromise(function(_0x4a9d98,_0x271935){return client[_0xaf04('0x11')](_0x4a19d7,_0x2e7f09)[_0xaf04('0x12')](function(_0x29e7b6){logger[_0xaf04('0x13')](_0xaf04('0x14'),_0x4c3fc0,_0xaf04('0x15'));logger['debug'](_0xaf04('0x16'),_0x4c3fc0,'request\x20sent',JSON[_0xaf04('0x17')](_0x29e7b6));if(_0x29e7b6['error']){if(_0x29e7b6[_0xaf04('0x18')][_0xaf04('0x19')]===0x1f4){logger['error'](_0xaf04('0x14'),_0x4c3fc0,_0x29e7b6[_0xaf04('0x18')][_0xaf04('0x1a')]);return _0x271935(_0x29e7b6['error']['message']);}logger['error']('MailQueue,\x20%s,\x20%s',_0x4c3fc0,_0x29e7b6[_0xaf04('0x18')][_0xaf04('0x1a')]);return _0x4a9d98(_0x29e7b6[_0xaf04('0x18')][_0xaf04('0x1a')]);}else{logger[_0xaf04('0x13')]('MailQueue,\x20%s,\x20%s',_0x4c3fc0,_0xaf04('0x15'));_0x4a9d98(_0x29e7b6[_0xaf04('0x1b')][_0xaf04('0x1a')]);}})[_0xaf04('0x1c')](function(_0x33cbff){logger[_0xaf04('0x18')](_0xaf04('0x14'),_0x4c3fc0,_0x33cbff);_0x271935(_0x33cbff);});});}exports['GetMailQueue']=function(_0x5c3179){var _0x44071e=this;return new Promise(function(_0x55eca0,_0x306999){return db[_0xaf04('0x1d')][_0xaf04('0x1e')]({'raw':_0x5c3179[_0xaf04('0x1f')]?_0x5c3179[_0xaf04('0x1f')][_0xaf04('0x20')]===undefined?!![]:![]:!![],'where':_0x5c3179[_0xaf04('0x1f')]?_0x5c3179[_0xaf04('0x1f')][_0xaf04('0x21')]||null:null,'attributes':_0x5c3179['options']?_0x5c3179[_0xaf04('0x1f')][_0xaf04('0x22')]||null:null,'limit':_0x5c3179['options']?_0x5c3179['options'][_0xaf04('0x23')]||null:null,'include':_0x5c3179[_0xaf04('0x1f')]?_0x5c3179['options']['include']?_[_0xaf04('0x24')](_0x5c3179['options'][_0xaf04('0x25')],function(_0x2579e2){return{'model':db[_0x2579e2['model']],'as':_0x2579e2['as'],'attributes':_0x2579e2['attributes'],'include':_0x2579e2[_0xaf04('0x25')]?_[_0xaf04('0x24')](_0x2579e2[_0xaf04('0x25')],function(_0xfc6d30){return{'model':db[_0xfc6d30[_0xaf04('0x26')]],'as':_0xfc6d30['as'],'attributes':_0xfc6d30['attributes'],'include':_0xfc6d30[_0xaf04('0x25')]?_[_0xaf04('0x24')](_0xfc6d30['include'],function(_0x36e848){return{'model':db[_0x36e848[_0xaf04('0x26')]],'as':_0x36e848['as'],'attributes':_0x36e848[_0xaf04('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaf04('0x12')](function(_0x21f1e6){logger[_0xaf04('0x13')](_0xaf04('0x27'),_0x5c3179);logger[_0xaf04('0x28')](_0xaf04('0x27'),_0x5c3179,JSON['stringify'](_0x21f1e6));_0x55eca0(_0x21f1e6);})[_0xaf04('0x1c')](function(_0x1bc7cb){logger[_0xaf04('0x18')](_0xaf04('0x27'),_0x1bc7cb['message'],_0x5c3179);_0x306999(_0x44071e[_0xaf04('0x18')](0x1f4,_0x1bc7cb[_0xaf04('0x1a')]));});});};exports['ShowMailQueue']=function(_0x2e7d98){var _0x109d20=this;return new Promise(function(_0x56dc70,_0x4faf36){return db[_0xaf04('0x1d')][_0xaf04('0x29')]({'raw':_0x2e7d98[_0xaf04('0x1f')]?_0x2e7d98[_0xaf04('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2e7d98[_0xaf04('0x1f')]?_0x2e7d98[_0xaf04('0x1f')][_0xaf04('0x21')]||null:null,'attributes':_0x2e7d98[_0xaf04('0x1f')]?_0x2e7d98['options'][_0xaf04('0x22')]||null:null,'include':_0x2e7d98[_0xaf04('0x1f')]?_0x2e7d98[_0xaf04('0x1f')][_0xaf04('0x25')]?_[_0xaf04('0x24')](_0x2e7d98[_0xaf04('0x1f')]['include'],function(_0x12fc8b){return{'model':db[_0x12fc8b[_0xaf04('0x26')]],'as':_0x12fc8b['as'],'attributes':_0x12fc8b[_0xaf04('0x22')],'include':_0x12fc8b[_0xaf04('0x25')]?_['map'](_0x12fc8b[_0xaf04('0x25')],function(_0x124b25){return{'model':db[_0x124b25['model']],'as':_0x124b25['as'],'attributes':_0x124b25['attributes'],'include':_0x124b25[_0xaf04('0x25')]?_[_0xaf04('0x24')](_0x124b25[_0xaf04('0x25')],function(_0xdb94f0){return{'model':db[_0xdb94f0[_0xaf04('0x26')]],'as':_0xdb94f0['as'],'attributes':_0xdb94f0[_0xaf04('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5677a0){logger[_0xaf04('0x13')](_0xaf04('0x2a'),_0x2e7d98);logger[_0xaf04('0x28')](_0xaf04('0x2a'),_0x2e7d98,JSON['stringify'](_0x5677a0));_0x56dc70(_0x5677a0);})['catch'](function(_0x50fee7){logger[_0xaf04('0x18')](_0xaf04('0x2a'),_0x50fee7[_0xaf04('0x1a')],_0x2e7d98);_0x4faf36(_0x109d20[_0xaf04('0x18')](0x1f4,_0x50fee7[_0xaf04('0x1a')]));});});};
\ No newline at end of file
+var _0xf446=['raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','request','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','findAll','options','where','attributes','limit','map','include','model','ShowMailQueue','find'];(function(_0xd22293,_0x1ffd15){var _0x2b5aef=function(_0x3adafc){while(--_0x3adafc){_0xd22293['push'](_0xd22293['shift']());}};_0x2b5aef(++_0x1ffd15);}(_0xf446,0xfd));var _0x6f44=function(_0x502081,_0x32ae78){_0x502081=_0x502081-0x0;var _0x29fbb7=_0xf446[_0x502081];return _0x29fbb7;};'use strict';var _=require('lodash');var util=require(_0x6f44('0x0'));var moment=require(_0x6f44('0x1'));var BPromise=require(_0x6f44('0x2'));var rs=require(_0x6f44('0x3'));var fs=require('fs');var Redis=require(_0x6f44('0x4'));var db=require(_0x6f44('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6f44('0x6'));var config=require('../../config/environment');var jayson=require(_0x6f44('0x7'));var client=jayson[_0x6f44('0x8')][_0x6f44('0x9')]({'port':0x232a});config['redis']=_[_0x6f44('0xa')](config['redis'],{'host':_0x6f44('0xb'),'port':0x18eb});var socket=require(_0x6f44('0xc'))(new Redis(config[_0x6f44('0xd')]));require(_0x6f44('0xe'))[_0x6f44('0xf')](socket);function respondWithRpcPromise(_0x9e32b,_0x54e8e5,_0x55f7a9){return new BPromise(function(_0xe218e4,_0x2a76ed){return client[_0x6f44('0x10')](_0x9e32b,_0x55f7a9)[_0x6f44('0x11')](function(_0x4d5957){logger[_0x6f44('0x12')](_0x6f44('0x13'),_0x54e8e5,_0x6f44('0x14'));logger[_0x6f44('0x15')](_0x6f44('0x16'),_0x54e8e5,_0x6f44('0x14'),JSON[_0x6f44('0x17')](_0x4d5957));if(_0x4d5957[_0x6f44('0x18')]){if(_0x4d5957['error'][_0x6f44('0x19')]===0x1f4){logger[_0x6f44('0x18')](_0x6f44('0x13'),_0x54e8e5,_0x4d5957['error']['message']);return _0x2a76ed(_0x4d5957['error'][_0x6f44('0x1a')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0x54e8e5,_0x4d5957['error'][_0x6f44('0x1a')]);return _0xe218e4(_0x4d5957['error']['message']);}else{logger[_0x6f44('0x12')](_0x6f44('0x13'),_0x54e8e5,_0x6f44('0x14'));_0xe218e4(_0x4d5957[_0x6f44('0x1b')][_0x6f44('0x1a')]);}})[_0x6f44('0x1c')](function(_0x2b1f2a){logger[_0x6f44('0x18')](_0x6f44('0x13'),_0x54e8e5,_0x2b1f2a);_0x2a76ed(_0x2b1f2a);});});}exports[_0x6f44('0x1d')]=function(_0x4a001f){var _0x342d58=this;return new Promise(function(_0x3af74b,_0x581bba){return db[_0x6f44('0x1e')][_0x6f44('0x1f')]({'raw':_0x4a001f[_0x6f44('0x20')]?_0x4a001f[_0x6f44('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x4a001f[_0x6f44('0x20')]?_0x4a001f['options'][_0x6f44('0x21')]||null:null,'attributes':_0x4a001f[_0x6f44('0x20')]?_0x4a001f[_0x6f44('0x20')][_0x6f44('0x22')]||null:null,'limit':_0x4a001f[_0x6f44('0x20')]?_0x4a001f[_0x6f44('0x20')][_0x6f44('0x23')]||null:null,'include':_0x4a001f[_0x6f44('0x20')]?_0x4a001f['options']['include']?_[_0x6f44('0x24')](_0x4a001f[_0x6f44('0x20')][_0x6f44('0x25')],function(_0x3464dd){return{'model':db[_0x3464dd[_0x6f44('0x26')]],'as':_0x3464dd['as'],'attributes':_0x3464dd[_0x6f44('0x22')],'include':_0x3464dd['include']?_[_0x6f44('0x24')](_0x3464dd[_0x6f44('0x25')],function(_0x51b832){return{'model':db[_0x51b832[_0x6f44('0x26')]],'as':_0x51b832['as'],'attributes':_0x51b832[_0x6f44('0x22')],'include':_0x51b832['include']?_['map'](_0x51b832[_0x6f44('0x25')],function(_0x3aa0b3){return{'model':db[_0x3aa0b3['model']],'as':_0x3aa0b3['as'],'attributes':_0x3aa0b3['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f44('0x11')](function(_0x113cc1){logger['info']('GetMailQueue',_0x4a001f);logger['debug'](_0x6f44('0x1d'),_0x4a001f,JSON[_0x6f44('0x17')](_0x113cc1));_0x3af74b(_0x113cc1);})[_0x6f44('0x1c')](function(_0x342499){logger[_0x6f44('0x18')](_0x6f44('0x1d'),_0x342499[_0x6f44('0x1a')],_0x4a001f);_0x581bba(_0x342d58['error'](0x1f4,_0x342499[_0x6f44('0x1a')]));});});};exports[_0x6f44('0x27')]=function(_0x2b1ad3){var _0x443967=this;return new Promise(function(_0x1e83f1,_0xc18d4b){return db['MailQueue'][_0x6f44('0x28')]({'raw':_0x2b1ad3[_0x6f44('0x20')]?_0x2b1ad3[_0x6f44('0x20')][_0x6f44('0x29')]===undefined?!![]:![]:!![],'where':_0x2b1ad3[_0x6f44('0x20')]?_0x2b1ad3[_0x6f44('0x20')][_0x6f44('0x21')]||null:null,'attributes':_0x2b1ad3['options']?_0x2b1ad3[_0x6f44('0x20')]['attributes']||null:null,'include':_0x2b1ad3['options']?_0x2b1ad3['options'][_0x6f44('0x25')]?_[_0x6f44('0x24')](_0x2b1ad3[_0x6f44('0x20')][_0x6f44('0x25')],function(_0x1dfef8){return{'model':db[_0x1dfef8['model']],'as':_0x1dfef8['as'],'attributes':_0x1dfef8['attributes'],'include':_0x1dfef8[_0x6f44('0x25')]?_[_0x6f44('0x24')](_0x1dfef8['include'],function(_0x59930f){return{'model':db[_0x59930f['model']],'as':_0x59930f['as'],'attributes':_0x59930f[_0x6f44('0x22')],'include':_0x59930f[_0x6f44('0x25')]?_[_0x6f44('0x24')](_0x59930f[_0x6f44('0x25')],function(_0x26cced){return{'model':db[_0x26cced[_0x6f44('0x26')]],'as':_0x26cced['as'],'attributes':_0x26cced[_0x6f44('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6f44('0x11')](function(_0x2ddde9){logger[_0x6f44('0x12')](_0x6f44('0x27'),_0x2b1ad3);logger[_0x6f44('0x15')](_0x6f44('0x27'),_0x2b1ad3,JSON[_0x6f44('0x17')](_0x2ddde9));_0x1e83f1(_0x2ddde9);})['catch'](function(_0x30e410){logger['error'](_0x6f44('0x27'),_0x30e410[_0x6f44('0x1a')],_0x2b1ad3);_0xc18d4b(_0x443967[_0x6f44('0x18')](0x1f4,_0x30e410[_0x6f44('0x1a')]));});});};
\ No newline at end of file
index 937b38b..211b116 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x676b=['emit','removeListener','register','length','mailQueue:','save','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x676b,0x6d));var _0xb676=function(_0x5f519b,_0x5b606f){_0x5f519b=_0x5f519b-0x0;var _0x2461e2=_0x676b[_0x5f519b];return _0x2461e2;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xb676('0x0'),_0xb676('0x1'),_0xb676('0x2')];function createListener(_0x5a9490,_0x9f353c){return function(_0x4d05be){_0x9f353c[_0xb676('0x3')](_0x5a9490,_0x4d05be);};}function removeListener(_0x5a045e,_0x3138e6){return function(){MailQueueEvents[_0xb676('0x4')](_0x5a045e,_0x3138e6);};}exports[_0xb676('0x5')]=function(_0x3173f0){for(var _0x4fbf36=0x0,_0x3e25c8=events[_0xb676('0x6')];_0x4fbf36<_0x3e25c8;_0x4fbf36++){var _0x320a7e=events[_0x4fbf36];var _0x489057=createListener(_0xb676('0x7')+_0x320a7e,_0x3173f0);MailQueueEvents['on'](_0x320a7e,_0x489057);}};
\ No newline at end of file
+var _0x61d7=['mailQueue:','./mailQueue.events','remove','update','emit','removeListener','register'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x61d7,0xef));var _0x761d=function(_0x5c0118,_0x121b3a){_0x5c0118=_0x5c0118-0x0;var _0x57799f=_0x61d7[_0x5c0118];return _0x57799f;};'use strict';var MailQueueEvents=require(_0x761d('0x0'));var events=['save',_0x761d('0x1'),_0x761d('0x2')];function createListener(_0x4bf523,_0x13ce96){return function(_0x2a0b17){_0x13ce96[_0x761d('0x3')](_0x4bf523,_0x2a0b17);};}function removeListener(_0x18feea,_0x4ff687){return function(){MailQueueEvents[_0x761d('0x4')](_0x18feea,_0x4ff687);};}exports[_0x761d('0x5')]=function(_0x17c295){for(var _0x13e509=0x0,_0x4f1ef6=events['length'];_0x13e509<_0x4f1ef6;_0x13e509++){var _0x2fdd7b=events[_0x13e509];var _0x38decc=createListener(_0x761d('0x6')+_0x2fdd7b,_0x17c295);MailQueueEvents['on'](_0x2fdd7b,_0x38decc);}};
\ No newline at end of file
index 1ca6988..4ea6ad3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe79b=['/:id','show','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x2def74,_0x5ec6fb){var _0x14f89f=function(_0x2fb173){while(--_0x2fb173){_0x2def74['push'](_0x2def74['shift']());}};_0x14f89f(++_0x5ec6fb);}(_0xe79b,0x137));var _0xbe79=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0xe79b[_0x29e0eb];return _0x597d2d;};'use strict';var multer=require(_0xbe79('0x0'));var util=require(_0xbe79('0x1'));var path=require(_0xbe79('0x2'));var timeout=require(_0xbe79('0x3'));var express=require(_0xbe79('0x4'));var router=express['Router']();var fs_extra=require(_0xbe79('0x5'));var auth=require(_0xbe79('0x6'));var interaction=require(_0xbe79('0x7'));var config=require(_0xbe79('0x8'));var controller=require('./mailQueueReport.controller');router[_0xbe79('0x9')]('/',auth[_0xbe79('0xa')](),controller[_0xbe79('0xb')]);router[_0xbe79('0x9')]('/describe',auth[_0xbe79('0xa')](),controller[_0xbe79('0xc')]);router[_0xbe79('0x9')](_0xbe79('0xd'),auth[_0xbe79('0xa')](),controller[_0xbe79('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe79('0xf')](_0xbe79('0xd'),auth[_0xbe79('0xa')](),controller[_0xbe79('0x10')]);router[_0xbe79('0x11')]('/:id',auth[_0xbe79('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x10d4=['post','create','put','update','destroy','exports','multer','util','path','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x5d6268,_0x33bf74){var _0x14abba=function(_0xa318de){while(--_0xa318de){_0x5d6268['push'](_0x5d6268['shift']());}};_0x14abba(++_0x33bf74);}(_0x10d4,0x126));var _0x410d=function(_0x22395a,_0x4a4fd0){_0x22395a=_0x22395a-0x0;var _0x436c90=_0x10d4[_0x22395a];return _0x436c90;};'use strict';var multer=require(_0x410d('0x0'));var util=require(_0x410d('0x1'));var path=require(_0x410d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x410d('0x3')]();var fs_extra=require(_0x410d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x410d('0x5'));var controller=require('./mailQueueReport.controller');router[_0x410d('0x6')]('/',auth[_0x410d('0x7')](),controller['index']);router[_0x410d('0x6')]('/describe',auth[_0x410d('0x7')](),controller['describe']);router[_0x410d('0x6')](_0x410d('0x8'),auth[_0x410d('0x7')](),controller[_0x410d('0x9')]);router[_0x410d('0xa')]('/',auth[_0x410d('0x7')](),controller[_0x410d('0xb')]);router[_0x410d('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x410d('0xd')]);router['delete']('/:id',auth[_0x410d('0x7')](),controller[_0x410d('0xe')]);module[_0x410d('0xf')]=router;
\ No newline at end of file
index cd81945..453c98f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x791d=['exports','STRING','DATE','moment','sequelize'];(function(_0x329e19,_0x42cfc5){var _0x324ddd=function(_0x4928c3){while(--_0x4928c3){_0x329e19['push'](_0x329e19['shift']());}};_0x324ddd(++_0x42cfc5);}(_0x791d,0xe9));var _0xd791=function(_0x1bca02,_0x3ea0b1){_0x1bca02=_0x1bca02-0x0;var _0x1eb5bf=_0x791d[_0x1bca02];return _0x1eb5bf;};'use strict';var moment=require(_0xd791('0x0'));var Sequelize=require(_0xd791('0x1'));module[_0xd791('0x2')]={'uniqueid':{'type':Sequelize[_0xd791('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd791('0x4')]},'leaveAt':{'type':Sequelize[_0xd791('0x4')]},'acceptAt':{'type':Sequelize[_0xd791('0x4')]},'exitAt':{'type':Sequelize[_0xd791('0x4')]},'reason':{'type':Sequelize[_0xd791('0x3')]}};
\ No newline at end of file
+var _0x17ed=['exports','STRING','DATE','sequelize'];(function(_0x424900,_0x5565b8){var _0x32968d=function(_0x1255c9){while(--_0x1255c9){_0x424900['push'](_0x424900['shift']());}};_0x32968d(++_0x5565b8);}(_0x17ed,0xeb));var _0xd17e=function(_0x3602cc,_0x18fd38){_0x3602cc=_0x3602cc-0x0;var _0x44721c=_0x17ed[_0x3602cc];return _0x44721c;};'use strict';var moment=require('moment');var Sequelize=require(_0xd17e('0x0'));module[_0xd17e('0x1')]={'uniqueid':{'type':Sequelize[_0xd17e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd17e('0x2')]},'joinAt':{'type':Sequelize[_0xd17e('0x3')]},'leaveAt':{'type':Sequelize[_0xd17e('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd17e('0x3')]},'reason':{'type':Sequelize[_0xd17e('0x2')]}};
\ No newline at end of file
index cd758da..b2d6244 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5af=['length','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','MailQueueReport','includeAll','include','findAll','catch','params','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xe5af,0x9c));var _0xfe5a=function(_0x3f2668,_0x156268){_0x3f2668=_0x3f2668-0x0;var _0x1da0b7=_0xe5af[_0x3f2668];return _0x1da0b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe5a('0x0'));var zipdir=require(_0xfe5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe5a('0x2'));var moment=require(_0xfe5a('0x3'));var BPromise=require(_0xfe5a('0x4'));var Mustache=require('mustache');var util=require(_0xfe5a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xfe5a('0x6'));var ejs=require(_0xfe5a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfe5a('0x8'));var crypto=require(_0xfe5a('0x9'));var jsforce=require(_0xfe5a('0xa'));var deskjs=require(_0xfe5a('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfe5a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe5a('0xd'));var qs=require(_0xfe5a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe5a('0xf'));var logger=require(_0xfe5a('0x10'))(_0xfe5a('0x11'));var utils=require(_0xfe5a('0x12'));var config=require(_0xfe5a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe5a('0x14'))['db'];function respondWithStatusCode(_0x9d1f4f,_0x20b206){_0x20b206=_0x20b206||0xcc;return function(_0x374ded){if(_0x374ded){return _0x9d1f4f[_0xfe5a('0x15')](_0x20b206);}return _0x9d1f4f['status'](_0x20b206)[_0xfe5a('0x16')]();};}function respondWithResult(_0x17bbbe,_0x42969b){_0x42969b=_0x42969b||0xc8;return function(_0x362115){if(_0x362115){return _0x17bbbe[_0xfe5a('0x17')](_0x42969b)[_0xfe5a('0x18')](_0x362115);}};}function respondWithFilteredResult(_0x375380,_0xeb454){return function(_0x111d4d){if(_0x111d4d){var _0x18c57b=typeof _0xeb454[_0xfe5a('0x19')]===_0xfe5a('0x1a')&&typeof _0xeb454[_0xfe5a('0x1b')]===_0xfe5a('0x1a');var _0x3edcab=_0x111d4d[_0xfe5a('0x1c')];var _0x5bf597=_0x18c57b?0x0:_0xeb454[_0xfe5a('0x19')];var _0x456707=_0x18c57b?_0x111d4d['count']:_0xeb454[_0xfe5a('0x19')]+_0xeb454[_0xfe5a('0x1b')];var _0x39d905;if(_0x456707>=_0x3edcab){_0x456707=_0x3edcab;_0x39d905=0xc8;}else{_0x39d905=0xce;}_0x375380['status'](_0x39d905);return _0x375380['set'](_0xfe5a('0x1d'),_0x5bf597+'-'+_0x456707+'/'+_0x3edcab)[_0xfe5a('0x18')](_0x111d4d);}return null;};}function patchUpdates(_0xded538){return function(_0x3b3022){try{jsonpatch[_0xfe5a('0x1e')](_0x3b3022,_0xded538,!![]);}catch(_0x355869){return BPromise['reject'](_0x355869);}return _0x3b3022[_0xfe5a('0x1f')]();};}function saveUpdates(_0x592521,_0x3dfa57){return function(_0x39d825){if(_0x39d825){return _0x39d825[_0xfe5a('0x20')](_0x592521)['then'](function(_0x4bbef1){return _0x4bbef1;});}return null;};}function removeEntity(_0x247be4,_0x3e55fd){return function(_0x494df3){if(_0x494df3){return _0x494df3[_0xfe5a('0x21')]()[_0xfe5a('0x22')](function(){_0x247be4['status'](0xcc)[_0xfe5a('0x16')]();});}};}function handleEntityNotFound(_0x3a4f3c,_0x31cc60){return function(_0x2b4f1c){if(!_0x2b4f1c){_0x3a4f3c['sendStatus'](0x194);}return _0x2b4f1c;};}function handleError(_0x42136e,_0x2f5d04){_0x2f5d04=_0x2f5d04||0x1f4;return function(_0x24481f){logger[_0xfe5a('0x23')](_0x24481f[_0xfe5a('0x24')]);if(_0x24481f[_0xfe5a('0x25')]){delete _0x24481f[_0xfe5a('0x25')];}_0x42136e[_0xfe5a('0x17')](_0x2f5d04)['send'](_0x24481f);};}exports['index']=function(_0x712b44,_0x485f9d){var _0xc53869={},_0xfcb05b={},_0x11bf97={'count':0x0,'rows':[]};var _0x482a35=_['map'](db['MailQueueReport'][_0xfe5a('0x26')],function(_0x582f2d){return{'name':_0x582f2d['fieldName'],'type':_0x582f2d['type'][_0xfe5a('0x27')]};});_0xfcb05b[_0xfe5a('0x28')]=_[_0xfe5a('0x29')](_0x482a35,_0xfe5a('0x25'));_0xfcb05b[_0xfe5a('0x2a')]=_[_0xfe5a('0x2b')](_0x712b44[_0xfe5a('0x2a')]);_0xfcb05b[_0xfe5a('0x2c')]=_[_0xfe5a('0x2d')](_0xfcb05b[_0xfe5a('0x28')],_0xfcb05b[_0xfe5a('0x2a')]);_0xc53869['attributes']=_[_0xfe5a('0x2d')](_0xfcb05b[_0xfe5a('0x28')],qs['fields'](_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x2e')]));_0xc53869[_0xfe5a('0x2f')]=_0xc53869[_0xfe5a('0x2f')][_0xfe5a('0x30')]?_0xc53869['attributes']:_0xfcb05b['model'];if(!_0x712b44[_0xfe5a('0x2a')]['hasOwnProperty'](_0xfe5a('0x31'))){_0xc53869[_0xfe5a('0x1b')]=qs[_0xfe5a('0x1b')](_0x712b44[_0xfe5a('0x2a')]['limit']);_0xc53869[_0xfe5a('0x19')]=qs[_0xfe5a('0x19')](_0x712b44[_0xfe5a('0x2a')]['offset']);}_0xc53869[_0xfe5a('0x32')]=qs[_0xfe5a('0x33')](_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x33')]);_0xc53869['where']=qs[_0xfe5a('0x2c')](_['pick'](_0x712b44[_0xfe5a('0x2a')],_0xfcb05b[_0xfe5a('0x2c')]),_0x482a35);if(_0x712b44['query'][_0xfe5a('0x34')]){_0xc53869[_0xfe5a('0x35')]=_[_0xfe5a('0x36')](_0xc53869[_0xfe5a('0x35')],{'$or':_['map'](_0x482a35,function(_0x193ce0){if(_0x193ce0[_0xfe5a('0x37')]!==_0xfe5a('0x38')){var _0x560088={};_0x560088[_0x193ce0[_0xfe5a('0x25')]]={'$like':'%'+_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x34')]+'%'};return _0x560088;}})});}_0xc53869=_[_0xfe5a('0x36')]({},_0xc53869,_0x712b44[_0xfe5a('0x39')]);var _0x162c48={'where':_0xc53869[_0xfe5a('0x35')]};return db[_0xfe5a('0x3a')][_0xfe5a('0x1c')](_0x162c48)[_0xfe5a('0x22')](function(_0x20da14){_0x11bf97['count']=_0x20da14;if(_0x712b44[_0xfe5a('0x2a')][_0xfe5a('0x3b')]){_0xc53869[_0xfe5a('0x3c')]=[{'all':!![]}];}return db[_0xfe5a('0x3a')][_0xfe5a('0x3d')](_0xc53869);})[_0xfe5a('0x22')](function(_0x3475fb){_0x11bf97['rows']=_0x3475fb;return _0x11bf97;})[_0xfe5a('0x22')](respondWithFilteredResult(_0x485f9d,_0xc53869))[_0xfe5a('0x3e')](handleError(_0x485f9d,null));};exports['show']=function(_0x59caa1,_0x252904){var _0x4c17fd={'raw':!![],'where':{'id':_0x59caa1[_0xfe5a('0x3f')]['id']}},_0x54096d={};_0x54096d[_0xfe5a('0x28')]=_['keys'](db[_0xfe5a('0x3a')]['rawAttributes']);_0x54096d[_0xfe5a('0x2a')]=_[_0xfe5a('0x2b')](_0x59caa1[_0xfe5a('0x2a')]);_0x54096d[_0xfe5a('0x2c')]=_[_0xfe5a('0x2d')](_0x54096d[_0xfe5a('0x28')],_0x54096d['query']);_0x4c17fd[_0xfe5a('0x2f')]=_[_0xfe5a('0x2d')](_0x54096d[_0xfe5a('0x28')],qs[_0xfe5a('0x2e')](_0x59caa1[_0xfe5a('0x2a')][_0xfe5a('0x2e')]));_0x4c17fd[_0xfe5a('0x2f')]=_0x4c17fd[_0xfe5a('0x2f')][_0xfe5a('0x30')]?_0x4c17fd[_0xfe5a('0x2f')]:_0x54096d[_0xfe5a('0x28')];if(_0x59caa1[_0xfe5a('0x2a')][_0xfe5a('0x3b')]){_0x4c17fd[_0xfe5a('0x3c')]=[{'all':!![]}];}_0x4c17fd=_['merge']({},_0x4c17fd,_0x59caa1[_0xfe5a('0x39')]);return db[_0xfe5a('0x3a')]['find'](_0x4c17fd)['then'](handleEntityNotFound(_0x252904,null))[_0xfe5a('0x22')](respondWithResult(_0x252904,null))[_0xfe5a('0x3e')](handleError(_0x252904,null));};exports[_0xfe5a('0x40')]=function(_0x3ccf98,_0x3cf1b5){return db[_0xfe5a('0x3a')][_0xfe5a('0x40')](_0x3ccf98['body'],{})[_0xfe5a('0x22')](respondWithResult(_0x3cf1b5,0xc9))['catch'](handleError(_0x3cf1b5,null));};exports[_0xfe5a('0x20')]=function(_0x5a807e,_0x433562){if(_0x5a807e[_0xfe5a('0x41')]['id']){delete _0x5a807e[_0xfe5a('0x41')]['id'];}return db[_0xfe5a('0x3a')]['find']({'where':{'id':_0x5a807e[_0xfe5a('0x3f')]['id']}})[_0xfe5a('0x22')](handleEntityNotFound(_0x433562,null))['then'](saveUpdates(_0x5a807e[_0xfe5a('0x41')],null))['then'](respondWithResult(_0x433562,null))['catch'](handleError(_0x433562,null));};exports[_0xfe5a('0x21')]=function(_0x4e02c9,_0x374ce5){return db[_0xfe5a('0x3a')][_0xfe5a('0x42')]({'where':{'id':_0x4e02c9[_0xfe5a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x374ce5,null))[_0xfe5a('0x22')](removeEntity(_0x374ce5,null))['catch'](handleError(_0x374ce5,null));};exports[_0xfe5a('0x43')]=function(_0x38409b,_0x149132){return db['MailQueueReport'][_0xfe5a('0x43')]()[_0xfe5a('0x22')](respondWithResult(_0x149132,null))['catch'](handleError(_0x149132,null));};
\ No newline at end of file
+var _0x0120=['name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x596e28,_0x417067){var _0x292273=function(_0x110750){while(--_0x110750){_0x596e28['push'](_0x596e28['shift']());}};_0x292273(++_0x417067);}(_0x0120,0x6f));var _0x0012=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x0120[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x0012('0x0'));var rimraf=require(_0x0012('0x1'));var zipdir=require(_0x0012('0x2'));var jsonpatch=require(_0x0012('0x3'));var rp=require(_0x0012('0x4'));var moment=require(_0x0012('0x5'));var BPromise=require(_0x0012('0x6'));var Mustache=require(_0x0012('0x7'));var util=require(_0x0012('0x8'));var path=require(_0x0012('0x9'));var sox=require(_0x0012('0xa'));var csv=require(_0x0012('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0012('0xc'));var crypto=require(_0x0012('0xd'));var jsforce=require(_0x0012('0xe'));var deskjs=require(_0x0012('0xf'));var toCsv=require(_0x0012('0xb'));var querystring=require('querystring');var Papa=require(_0x0012('0x10'));var Redis=require(_0x0012('0x11'));var authService=require(_0x0012('0x12'));var qs=require(_0x0012('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0012('0x14'));var logger=require('../../config/logger')(_0x0012('0x15'));var utils=require(_0x0012('0x16'));var config=require(_0x0012('0x17'));var licenseUtil=require(_0x0012('0x18'));var db=require(_0x0012('0x19'))['db'];function respondWithStatusCode(_0x4d3e7a,_0x6d4a1a){_0x6d4a1a=_0x6d4a1a||0xcc;return function(_0x4f0ee1){if(_0x4f0ee1){return _0x4d3e7a['sendStatus'](_0x6d4a1a);}return _0x4d3e7a['status'](_0x6d4a1a)['end']();};}function respondWithResult(_0x3a7d50,_0x496a2b){_0x496a2b=_0x496a2b||0xc8;return function(_0x3995fd){if(_0x3995fd){return _0x3a7d50[_0x0012('0x1a')](_0x496a2b)['json'](_0x3995fd);}};}function respondWithFilteredResult(_0x24f4ed,_0x1a0c0d){return function(_0x348810){if(_0x348810){var _0x3b8dfc=typeof _0x1a0c0d['offset']==='undefined'&&typeof _0x1a0c0d[_0x0012('0x1b')]===_0x0012('0x1c');var _0x3948bf=_0x348810[_0x0012('0x1d')];var _0x1d0423=_0x3b8dfc?0x0:_0x1a0c0d[_0x0012('0x1e')];var _0x1e78ee=_0x3b8dfc?_0x348810[_0x0012('0x1d')]:_0x1a0c0d['offset']+_0x1a0c0d[_0x0012('0x1b')];var _0x56b0e1;if(_0x1e78ee>=_0x3948bf){_0x1e78ee=_0x3948bf;_0x56b0e1=0xc8;}else{_0x56b0e1=0xce;}_0x24f4ed['status'](_0x56b0e1);return _0x24f4ed[_0x0012('0x1f')](_0x0012('0x20'),_0x1d0423+'-'+_0x1e78ee+'/'+_0x3948bf)[_0x0012('0x21')](_0x348810);}return null;};}function patchUpdates(_0x2c837e){return function(_0x53ac2d){try{jsonpatch['apply'](_0x53ac2d,_0x2c837e,!![]);}catch(_0x460d82){return BPromise[_0x0012('0x22')](_0x460d82);}return _0x53ac2d[_0x0012('0x23')]();};}function saveUpdates(_0x7177bc,_0x190f07){return function(_0x2e6a2c){if(_0x2e6a2c){return _0x2e6a2c[_0x0012('0x24')](_0x7177bc)[_0x0012('0x25')](function(_0x57487e){return _0x57487e;});}return null;};}function removeEntity(_0x24674c,_0x24a280){return function(_0x4cf4bd){if(_0x4cf4bd){return _0x4cf4bd[_0x0012('0x26')]()[_0x0012('0x25')](function(){_0x24674c[_0x0012('0x1a')](0xcc)[_0x0012('0x27')]();});}};}function handleEntityNotFound(_0x42bcd7,_0x5e820b){return function(_0x351ffd){if(!_0x351ffd){_0x42bcd7[_0x0012('0x28')](0x194);}return _0x351ffd;};}function handleError(_0xbb5b55,_0x2a0302){_0x2a0302=_0x2a0302||0x1f4;return function(_0x173cb3){logger[_0x0012('0x29')](_0x173cb3[_0x0012('0x2a')]);if(_0x173cb3[_0x0012('0x2b')]){delete _0x173cb3[_0x0012('0x2b')];}_0xbb5b55[_0x0012('0x1a')](_0x2a0302)[_0x0012('0x2c')](_0x173cb3);};}exports[_0x0012('0x2d')]=function(_0x45c3ca,_0x3ce788){var _0x1282bb={},_0x276389={},_0x1b676d={'count':0x0,'rows':[]};var _0x1f4a0a=_[_0x0012('0x2e')](db[_0x0012('0x2f')][_0x0012('0x30')],function(_0x4d0998){return{'name':_0x4d0998[_0x0012('0x31')],'type':_0x4d0998[_0x0012('0x32')]['key']};});_0x276389[_0x0012('0x33')]=_[_0x0012('0x2e')](_0x1f4a0a,_0x0012('0x2b'));_0x276389[_0x0012('0x34')]=_[_0x0012('0x35')](_0x45c3ca['query']);_0x276389[_0x0012('0x36')]=_[_0x0012('0x37')](_0x276389[_0x0012('0x33')],_0x276389['query']);_0x1282bb[_0x0012('0x38')]=_[_0x0012('0x37')](_0x276389[_0x0012('0x33')],qs[_0x0012('0x39')](_0x45c3ca[_0x0012('0x34')][_0x0012('0x39')]));_0x1282bb['attributes']=_0x1282bb[_0x0012('0x38')][_0x0012('0x3a')]?_0x1282bb[_0x0012('0x38')]:_0x276389[_0x0012('0x33')];if(!_0x45c3ca['query']['hasOwnProperty'](_0x0012('0x3b'))){_0x1282bb[_0x0012('0x1b')]=qs[_0x0012('0x1b')](_0x45c3ca[_0x0012('0x34')][_0x0012('0x1b')]);_0x1282bb[_0x0012('0x1e')]=qs[_0x0012('0x1e')](_0x45c3ca['query'][_0x0012('0x1e')]);}_0x1282bb[_0x0012('0x3c')]=qs['sort'](_0x45c3ca[_0x0012('0x34')][_0x0012('0x3d')]);_0x1282bb[_0x0012('0x3e')]=qs[_0x0012('0x36')](_[_0x0012('0x3f')](_0x45c3ca[_0x0012('0x34')],_0x276389[_0x0012('0x36')]),_0x1f4a0a);if(_0x45c3ca['query'][_0x0012('0x40')]){_0x1282bb['where']=_[_0x0012('0x41')](_0x1282bb['where'],{'$or':_['map'](_0x1f4a0a,function(_0x1c35aa){if(_0x1c35aa[_0x0012('0x32')]!==_0x0012('0x42')){var _0x4e4424={};_0x4e4424[_0x1c35aa[_0x0012('0x2b')]]={'$like':'%'+_0x45c3ca[_0x0012('0x34')][_0x0012('0x40')]+'%'};return _0x4e4424;}})});}_0x1282bb=_[_0x0012('0x41')]({},_0x1282bb,_0x45c3ca[_0x0012('0x43')]);var _0x379780={'where':_0x1282bb[_0x0012('0x3e')]};return db[_0x0012('0x2f')]['count'](_0x379780)[_0x0012('0x25')](function(_0x25aff1){_0x1b676d[_0x0012('0x1d')]=_0x25aff1;if(_0x45c3ca[_0x0012('0x34')][_0x0012('0x44')]){_0x1282bb[_0x0012('0x45')]=[{'all':!![]}];}return db[_0x0012('0x2f')]['findAll'](_0x1282bb);})['then'](function(_0x1c54de){_0x1b676d['rows']=_0x1c54de;return _0x1b676d;})[_0x0012('0x25')](respondWithFilteredResult(_0x3ce788,_0x1282bb))[_0x0012('0x46')](handleError(_0x3ce788,null));};exports[_0x0012('0x47')]=function(_0x40f80d,_0x32c1f9){var _0x5348a2={'raw':!![],'where':{'id':_0x40f80d[_0x0012('0x48')]['id']}},_0x1bd93a={};_0x1bd93a['model']=_[_0x0012('0x35')](db[_0x0012('0x2f')][_0x0012('0x30')]);_0x1bd93a[_0x0012('0x34')]=_['keys'](_0x40f80d['query']);_0x1bd93a[_0x0012('0x36')]=_['intersection'](_0x1bd93a[_0x0012('0x33')],_0x1bd93a['query']);_0x5348a2[_0x0012('0x38')]=_[_0x0012('0x37')](_0x1bd93a[_0x0012('0x33')],qs[_0x0012('0x39')](_0x40f80d['query'][_0x0012('0x39')]));_0x5348a2['attributes']=_0x5348a2[_0x0012('0x38')][_0x0012('0x3a')]?_0x5348a2[_0x0012('0x38')]:_0x1bd93a[_0x0012('0x33')];if(_0x40f80d[_0x0012('0x34')][_0x0012('0x44')]){_0x5348a2[_0x0012('0x45')]=[{'all':!![]}];}_0x5348a2=_['merge']({},_0x5348a2,_0x40f80d[_0x0012('0x43')]);return db[_0x0012('0x2f')][_0x0012('0x49')](_0x5348a2)[_0x0012('0x25')](handleEntityNotFound(_0x32c1f9,null))[_0x0012('0x25')](respondWithResult(_0x32c1f9,null))[_0x0012('0x46')](handleError(_0x32c1f9,null));};exports['create']=function(_0x5894ee,_0x48de64){return db['MailQueueReport'][_0x0012('0x4a')](_0x5894ee[_0x0012('0x4b')],{})[_0x0012('0x25')](respondWithResult(_0x48de64,0xc9))[_0x0012('0x46')](handleError(_0x48de64,null));};exports[_0x0012('0x24')]=function(_0x53d552,_0x44ffaf){if(_0x53d552[_0x0012('0x4b')]['id']){delete _0x53d552[_0x0012('0x4b')]['id'];}return db[_0x0012('0x2f')][_0x0012('0x49')]({'where':{'id':_0x53d552[_0x0012('0x48')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x44ffaf,null))[_0x0012('0x25')](saveUpdates(_0x53d552[_0x0012('0x4b')],null))[_0x0012('0x25')](respondWithResult(_0x44ffaf,null))[_0x0012('0x46')](handleError(_0x44ffaf,null));};exports['destroy']=function(_0x2389cd,_0x12cb8f){return db[_0x0012('0x2f')]['find']({'where':{'id':_0x2389cd[_0x0012('0x48')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x12cb8f,null))[_0x0012('0x25')](removeEntity(_0x12cb8f,null))[_0x0012('0x46')](handleError(_0x12cb8f,null));};exports[_0x0012('0x4c')]=function(_0x5f283f,_0xd11428){return db['MailQueueReport'][_0x0012('0x4c')]()[_0x0012('0x25')](respondWithResult(_0xd11428,null))['catch'](handleError(_0xd11428,null));};
\ No newline at end of file
index 844eff8..82caff7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9247=['exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x42e98c,_0x1c6bb9){var _0x59803e=function(_0x3a587e){while(--_0x3a587e){_0x42e98c['push'](_0x42e98c['shift']());}};_0x59803e(++_0x1c6bb9);}(_0x9247,0x11d));var _0x7924=function(_0x505099,_0xb10ee1){_0x505099=_0x505099-0x0;var _0x577eba=_0x9247[_0x505099];return _0x577eba;};'use strict';var _=require(_0x7924('0x0'));var util=require(_0x7924('0x1'));var logger=require(_0x7924('0x2'))('api');var moment=require(_0x7924('0x3'));var BPromise=require(_0x7924('0x4'));var rp=require(_0x7924('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7924('0x6'));var config=require(_0x7924('0x7'));var attributes=require(_0x7924('0x8'));module[_0x7924('0x9')]=function(_0x5af313,_0x591d82){return _0x5af313[_0x7924('0xa')](_0x7924('0xb'),attributes,{'tableName':_0x7924('0xc'),'paranoid':![],'indexes':[{'name':_0x7924('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb554=['api','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger'];(function(_0x3bd139,_0x52a505){var _0xa9342a=function(_0xb2a913){while(--_0xb2a913){_0x3bd139['push'](_0x3bd139['shift']());}};_0xa9342a(++_0x52a505);}(_0xb554,0x73));var _0x4b55=function(_0x2896e9,_0x4c8547){_0x2896e9=_0x2896e9-0x0;var _0x161c76=_0xb554[_0x2896e9];return _0x161c76;};'use strict';var _=require(_0x4b55('0x0'));var util=require('util');var logger=require(_0x4b55('0x1'))(_0x4b55('0x2'));var moment=require(_0x4b55('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b55('0x4'));var fs=require('fs');var path=require(_0x4b55('0x5'));var rimraf=require(_0x4b55('0x6'));var config=require(_0x4b55('0x7'));var attributes=require(_0x4b55('0x8'));module[_0x4b55('0x9')]=function(_0x4eb98d,_0x255ca3){return _0x4eb98d['define'](_0x4b55('0xa'),attributes,{'tableName':_0x4b55('0xb'),'paranoid':![],'indexes':[{'name':_0x4b55('0xc'),'fields':[_0x4b55('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index e457413..ca77f42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x139b65,_0x319e35){var _0x44cbd0=function(_0x2741fd){while(--_0x2741fd){_0x139b65['push'](_0x139b65['shift']());}};_0x44cbd0(++_0x319e35);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});};
\ No newline at end of file
+var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x2317af,_0x1332d3){var _0x3cb58d=function(_0x4e75a0){while(--_0x4e75a0){_0x2317af['push'](_0x2317af['shift']());}};_0x3cb58d(++_0x1332d3);}(_0xdb28,0x106));var _0x8db2=function(_0x2257c5,_0x5129ba){_0x2257c5=_0x2257c5-0x0;var _0x42ddd0=_0xdb28[_0x2257c5];return _0x42ddd0;};'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')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});};
\ No newline at end of file
index 978dd59..cd890b5 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(_0x4d354d,_0xd0ca6e){var _0x440f60=function(_0x21d4d7){while(--_0x21d4d7){_0x4d354d['push'](_0x4d354d['shift']());}};_0x440f60(++_0xd0ca6e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x7a1404,_0x1b603e){var _0x4978b3=function(_0xb0c32c){while(--_0xb0c32c){_0x7a1404['push'](_0x7a1404['shift']());}};_0x4978b3(++_0x1b603e);}(_0xe706,0xa3));var _0x6e70=function(_0x58916b,_0x43fc5d){_0x58916b=_0x58916b-0x0;var _0x238322=_0xe706[_0x58916b];return _0x238322;};'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 6aec3b0..fb4cccc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44a3=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x1c954a,_0x153b09){var _0x8fa834=function(_0x4a0519){while(--_0x4a0519){_0x1c954a['push'](_0x1c954a['shift']());}};_0x8fa834(++_0x153b09);}(_0x44a3,0x1a9));var _0x344a=function(_0x34a14d,_0xc49d24){_0x34a14d=_0x34a14d-0x0;var _0x2015f2=_0x44a3[_0x34a14d];return _0x2015f2;};'use strict';var Sequelize=require(_0x344a('0x0'));module[_0x344a('0x1')]={'description':{'type':Sequelize[_0x344a('0x2')]},'host':{'type':Sequelize[_0x344a('0x2')]},'authentication':{'type':Sequelize[_0x344a('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x344a('0x2')]},'password':{'type':Sequelize[_0x344a('0x2')]},'port':{'type':Sequelize[_0x344a('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x344a('0x2')],'defaultValue':_0x344a('0x5')},'connTimeout':{'type':Sequelize[_0x344a('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x344a('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x344a('0x2')]}};
\ No newline at end of file
+var _0x0bb5=['BOOLEAN','STRING','INTEGER','INBOX','sequelize','exports'];(function(_0x27a94f,_0x4db811){var _0x1cd41b=function(_0x24f9cb){while(--_0x24f9cb){_0x27a94f['push'](_0x27a94f['shift']());}};_0x1cd41b(++_0x4db811);}(_0x0bb5,0x148));var _0x50bb=function(_0x68b429,_0x48a6d2){_0x68b429=_0x68b429-0x0;var _0x30c2ae=_0x0bb5[_0x68b429];return _0x30c2ae;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x50bb('0x3')]},'password':{'type':Sequelize[_0x50bb('0x3')]},'port':{'type':Sequelize[_0x50bb('0x4')]},'tls':{'type':Sequelize[_0x50bb('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x50bb('0x3')],'defaultValue':_0x50bb('0x5')},'connTimeout':{'type':Sequelize[_0x50bb('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e64c08a..60909b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcf8=['request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1d7049,_0x5d13f7){var _0x21eabd=function(_0x4f62b0){while(--_0x4f62b0){_0x1d7049['push'](_0x1d7049['shift']());}};_0x21eabd(++_0x5d13f7);}(_0xbcf8,0x1e9));var _0x8bcf=function(_0x3f456f,_0x239ca9){_0x3f456f=_0x3f456f-0x0;var _0x5f47fe=_0xbcf8[_0x3f456f];return _0x5f47fe;};'use strict';var _=require(_0x8bcf('0x0'));var util=require(_0x8bcf('0x1'));var logger=require(_0x8bcf('0x2'))(_0x8bcf('0x3'));var moment=require(_0x8bcf('0x4'));var BPromise=require(_0x8bcf('0x5'));var rp=require(_0x8bcf('0x6'));var fs=require('fs');var path=require(_0x8bcf('0x7'));var rimraf=require(_0x8bcf('0x8'));var config=require(_0x8bcf('0x9'));var attributes=require(_0x8bcf('0xa'));module[_0x8bcf('0xb')]=function(_0x3d38fa,_0x19bce3){return _0x3d38fa[_0x8bcf('0xc')](_0x8bcf('0xd'),attributes,{'tableName':_0x8bcf('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0c7a=['define','MailServerIn','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x19fc3e,_0x1a060e){var _0x56a220=function(_0x4edc8d){while(--_0x4edc8d){_0x19fc3e['push'](_0x19fc3e['shift']());}};_0x56a220(++_0x1a060e);}(_0x0c7a,0xb7));var _0xa0c7=function(_0x507803,_0x4114fc){_0x507803=_0x507803-0x0;var _0x325696=_0x0c7a[_0x507803];return _0x325696;};'use strict';var _=require(_0xa0c7('0x0'));var util=require('util');var logger=require(_0xa0c7('0x1'))(_0xa0c7('0x2'));var moment=require(_0xa0c7('0x3'));var BPromise=require(_0xa0c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa0c7('0x5'));var config=require(_0xa0c7('0x6'));var attributes=require(_0xa0c7('0x7'));module[_0xa0c7('0x8')]=function(_0x3f2495,_0x332ea7){return _0x3f2495[_0xa0c7('0x9')](_0xa0c7('0xa'),attributes,{'tableName':_0xa0c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 27fac33..7962098 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x639a=['then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailServerIn','options','raw','limit','map','include','model','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x4a9beb,_0x159482){var _0x2d4c58=function(_0x28dabf){while(--_0x28dabf){_0x4a9beb['push'](_0x4a9beb['shift']());}};_0x2d4c58(++_0x159482);}(_0x639a,0xec));var _0xa639=function(_0x44bd3b,_0x37b0ef){_0x44bd3b=_0x44bd3b-0x0;var _0x311747=_0x639a[_0x44bd3b];return _0x311747;};'use strict';var _=require('lodash');var util=require(_0xa639('0x0'));var moment=require(_0xa639('0x1'));var BPromise=require(_0xa639('0x2'));var rs=require(_0xa639('0x3'));var fs=require('fs');var Redis=require(_0xa639('0x4'));var db=require(_0xa639('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa639('0x6'))(_0xa639('0x7'));var config=require(_0xa639('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa639('0x9')][_0xa639('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29d2e4,_0x4223f6,_0x4c4ebf){return new BPromise(function(_0xfb7f17,_0x3ec583){return client[_0xa639('0xb')](_0x29d2e4,_0x4c4ebf)[_0xa639('0xc')](function(_0x324365){logger[_0xa639('0xd')](_0xa639('0xe'),_0x4223f6,_0xa639('0xf'));logger[_0xa639('0x10')](_0xa639('0x11'),_0x4223f6,_0xa639('0xf'),JSON[_0xa639('0x12')](_0x324365));if(_0x324365[_0xa639('0x13')]){if(_0x324365[_0xa639('0x13')]['code']===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x4223f6,_0x324365[_0xa639('0x13')][_0xa639('0x14')]);return _0x3ec583(_0x324365['error']['message']);}logger[_0xa639('0x13')](_0xa639('0xe'),_0x4223f6,_0x324365['error'][_0xa639('0x14')]);return _0xfb7f17(_0x324365[_0xa639('0x13')][_0xa639('0x14')]);}else{logger['info'](_0xa639('0xe'),_0x4223f6,_0xa639('0xf'));_0xfb7f17(_0x324365[_0xa639('0x15')][_0xa639('0x14')]);}})[_0xa639('0x16')](function(_0x5924bd){logger[_0xa639('0x13')]('MailServerIn,\x20%s,\x20%s',_0x4223f6,_0x5924bd);_0x3ec583(_0x5924bd);});});}exports[_0xa639('0x17')]=function(_0x2e23a9){var _0xbd8a9=this;return new Promise(function(_0x229545,_0x3a8ee9){return db['MailServerIn']['findAll']({'raw':_0x2e23a9[_0xa639('0x18')]?_0x2e23a9[_0xa639('0x18')][_0xa639('0x19')]===undefined?!![]:![]:!![],'where':_0x2e23a9[_0xa639('0x18')]?_0x2e23a9[_0xa639('0x18')]['where']||null:null,'attributes':_0x2e23a9['options']?_0x2e23a9[_0xa639('0x18')]['attributes']||null:null,'limit':_0x2e23a9['options']?_0x2e23a9['options'][_0xa639('0x1a')]||null:null,'include':_0x2e23a9[_0xa639('0x18')]?_0x2e23a9[_0xa639('0x18')]['include']?_[_0xa639('0x1b')](_0x2e23a9['options'][_0xa639('0x1c')],function(_0x351a33){return{'model':db[_0x351a33['model']],'as':_0x351a33['as'],'attributes':_0x351a33['attributes'],'include':_0x351a33['include']?_[_0xa639('0x1b')](_0x351a33['include'],function(_0x42b5d8){return{'model':db[_0x42b5d8[_0xa639('0x1d')]],'as':_0x42b5d8['as'],'attributes':_0x42b5d8[_0xa639('0x1e')],'include':_0x42b5d8[_0xa639('0x1c')]?_['map'](_0x42b5d8[_0xa639('0x1c')],function(_0x1a0d4e){return{'model':db[_0x1a0d4e[_0xa639('0x1d')]],'as':_0x1a0d4e['as'],'attributes':_0x1a0d4e[_0xa639('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa639('0xc')](function(_0x398055){logger[_0xa639('0xd')](_0xa639('0x17'),_0x2e23a9);logger[_0xa639('0x10')](_0xa639('0x17'),_0x2e23a9,JSON['stringify'](_0x398055));_0x229545(_0x398055);})[_0xa639('0x16')](function(_0x38ff11){logger[_0xa639('0x13')](_0xa639('0x17'),_0x38ff11[_0xa639('0x14')],_0x2e23a9);_0x3a8ee9(_0xbd8a9['error'](0x1f4,_0x38ff11[_0xa639('0x14')]));});});};
\ No newline at end of file
+var _0x8891=['result','catch','GetMailServerIn','MailServerIn','findAll','options','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x286cc0,_0x5abfc0){var _0x2d2309=function(_0x33e09e){while(--_0x33e09e){_0x286cc0['push'](_0x286cc0['shift']());}};_0x2d2309(++_0x5abfc0);}(_0x8891,0x119));var _0x1889=function(_0x1f52ea,_0x1dd436){_0x1f52ea=_0x1f52ea-0x0;var _0x2d4b16=_0x8891[_0x1f52ea];return _0x2d4b16;};'use strict';var _=require(_0x1889('0x0'));var util=require(_0x1889('0x1'));var moment=require('moment');var BPromise=require(_0x1889('0x2'));var rs=require(_0x1889('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1889('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1889('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1889('0x6')][_0x1889('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3fc592,_0x4c4892,_0x2c0c3d){return new BPromise(function(_0x2b3a00,_0x2695f1){return client[_0x1889('0x8')](_0x3fc592,_0x2c0c3d)[_0x1889('0x9')](function(_0x35262d){logger[_0x1889('0xa')](_0x1889('0xb'),_0x4c4892,'request\x20sent');logger[_0x1889('0xc')](_0x1889('0xd'),_0x4c4892,_0x1889('0xe'),JSON[_0x1889('0xf')](_0x35262d));if(_0x35262d[_0x1889('0x10')]){if(_0x35262d['error'][_0x1889('0x11')]===0x1f4){logger[_0x1889('0x10')]('MailServerIn,\x20%s,\x20%s',_0x4c4892,_0x35262d[_0x1889('0x10')][_0x1889('0x12')]);return _0x2695f1(_0x35262d['error']['message']);}logger[_0x1889('0x10')]('MailServerIn,\x20%s,\x20%s',_0x4c4892,_0x35262d[_0x1889('0x10')][_0x1889('0x12')]);return _0x2b3a00(_0x35262d[_0x1889('0x10')][_0x1889('0x12')]);}else{logger[_0x1889('0xa')](_0x1889('0xb'),_0x4c4892,_0x1889('0xe'));_0x2b3a00(_0x35262d[_0x1889('0x13')]['message']);}})[_0x1889('0x14')](function(_0xeefd85){logger[_0x1889('0x10')](_0x1889('0xb'),_0x4c4892,_0xeefd85);_0x2695f1(_0xeefd85);});});}exports[_0x1889('0x15')]=function(_0x3f8e14){var _0x270c03=this;return new Promise(function(_0x336b06,_0x4c0abe){return db[_0x1889('0x16')][_0x1889('0x17')]({'raw':_0x3f8e14[_0x1889('0x18')]?_0x3f8e14['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f8e14[_0x1889('0x18')]?_0x3f8e14[_0x1889('0x18')]['where']||null:null,'attributes':_0x3f8e14[_0x1889('0x18')]?_0x3f8e14[_0x1889('0x18')][_0x1889('0x19')]||null:null,'limit':_0x3f8e14[_0x1889('0x18')]?_0x3f8e14[_0x1889('0x18')][_0x1889('0x1a')]||null:null,'include':_0x3f8e14['options']?_0x3f8e14['options'][_0x1889('0x1b')]?_[_0x1889('0x1c')](_0x3f8e14[_0x1889('0x18')][_0x1889('0x1b')],function(_0x5a77c0){return{'model':db[_0x5a77c0[_0x1889('0x1d')]],'as':_0x5a77c0['as'],'attributes':_0x5a77c0[_0x1889('0x19')],'include':_0x5a77c0[_0x1889('0x1b')]?_[_0x1889('0x1c')](_0x5a77c0[_0x1889('0x1b')],function(_0x382b9f){return{'model':db[_0x382b9f['model']],'as':_0x382b9f['as'],'attributes':_0x382b9f[_0x1889('0x19')],'include':_0x382b9f[_0x1889('0x1b')]?_['map'](_0x382b9f[_0x1889('0x1b')],function(_0x12fd3f){return{'model':db[_0x12fd3f['model']],'as':_0x12fd3f['as'],'attributes':_0x12fd3f[_0x1889('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1889('0x9')](function(_0x1c3e1b){logger['info'](_0x1889('0x15'),_0x3f8e14);logger[_0x1889('0xc')](_0x1889('0x15'),_0x3f8e14,JSON[_0x1889('0xf')](_0x1c3e1b));_0x336b06(_0x1c3e1b);})[_0x1889('0x14')](function(_0x1e0237){logger[_0x1889('0x10')](_0x1889('0x15'),_0x1e0237[_0x1889('0x12')],_0x3f8e14);_0x4c0abe(_0x270c03['error'](0x1f4,_0x1e0237[_0x1889('0x12')]));});});};
\ No newline at end of file
index b9c8716..3843c06 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(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0x51807e,_0x3457bf){_0x51807e=_0x51807e-0x0;var _0x10f42a=_0x7a54[_0x51807e];return _0x10f42a;};'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(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x7a54,0x106));var _0x47a5=function(_0x3a243e,_0x13947e){_0x3a243e=_0x3a243e-0x0;var _0x565955=_0x7a54[_0x3a243e];return _0x565955;};'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 c9af9d6..1d92dc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2168=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x2168,0x112));var _0x8216=function(_0x2558df,_0x25f647){_0x2558df=_0x2558df-0x0;var _0x12c488=_0x2168[_0x2558df];return _0x12c488;};'use strict';var Sequelize=require(_0x8216('0x0'));module[_0x8216('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x8216('0x2')]},'user':{'type':Sequelize[_0x8216('0x2')]},'pass':{'type':Sequelize[_0x8216('0x2')]},'port':{'type':Sequelize[_0x8216('0x3')]},'secure':{'type':Sequelize[_0x8216('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x8216('0x2')]},'authentication':{'type':Sequelize[_0x8216('0x4')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xdc73=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x4f2552,_0x57e712){var _0x3e193d=function(_0x1e07cb){while(--_0x1e07cb){_0x4f2552['push'](_0x4f2552['shift']());}};_0x3e193d(++_0x57e712);}(_0xdc73,0x19c));var _0x3dc7=function(_0x14ae93,_0x42d8c1){_0x14ae93=_0x14ae93-0x0;var _0x1e1107=_0xdc73[_0x14ae93];return _0x1e1107;};'use strict';var Sequelize=require('sequelize');module[_0x3dc7('0x0')]={'description':{'type':Sequelize[_0x3dc7('0x1')]},'host':{'type':Sequelize[_0x3dc7('0x1')]},'user':{'type':Sequelize[_0x3dc7('0x1')]},'pass':{'type':Sequelize[_0x3dc7('0x1')]},'port':{'type':Sequelize[_0x3dc7('0x2')]},'secure':{'type':Sequelize[_0x3dc7('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x3dc7('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 3a19bb8..fe6d12f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e7f=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','MailServerOut','include','rows','catch','show','params','keys','includeAll','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','filters'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x8e7f,0xad));var _0xf8e7=function(_0x4ef724,_0x2eaa8f){_0x4ef724=_0x4ef724-0x0;var _0x16b426=_0x8e7f[_0x4ef724];return _0x16b426;};'use strict';var emlformat=require(_0xf8e7('0x0'));var rimraf=require(_0xf8e7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf8e7('0x2'));var rp=require(_0xf8e7('0x3'));var moment=require(_0xf8e7('0x4'));var BPromise=require(_0xf8e7('0x5'));var Mustache=require('mustache');var util=require(_0xf8e7('0x6'));var path=require(_0xf8e7('0x7'));var sox=require(_0xf8e7('0x8'));var csv=require(_0xf8e7('0x9'));var ejs=require(_0xf8e7('0xa'));var fs=require('fs');var fs_extra=require(_0xf8e7('0xb'));var _=require('lodash');var squel=require(_0xf8e7('0xc'));var crypto=require(_0xf8e7('0xd'));var jsforce=require(_0xf8e7('0xe'));var deskjs=require(_0xf8e7('0xf'));var toCsv=require(_0xf8e7('0x9'));var querystring=require(_0xf8e7('0x10'));var Papa=require(_0xf8e7('0x11'));var Redis=require(_0xf8e7('0x12'));var authService=require(_0xf8e7('0x13'));var qs=require(_0xf8e7('0x14'));var as=require(_0xf8e7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf8e7('0x16'))(_0xf8e7('0x17'));var utils=require(_0xf8e7('0x18'));var config=require(_0xf8e7('0x19'));var licenseUtil=require(_0xf8e7('0x1a'));var db=require(_0xf8e7('0x1b'))['db'];function respondWithStatusCode(_0x24f189,_0x5ea3c9){_0x5ea3c9=_0x5ea3c9||0xcc;return function(_0x960cfb){if(_0x960cfb){return _0x24f189['sendStatus'](_0x5ea3c9);}return _0x24f189['status'](_0x5ea3c9)[_0xf8e7('0x1c')]();};}function respondWithResult(_0x3d88db,_0x4726d1){_0x4726d1=_0x4726d1||0xc8;return function(_0xcda557){if(_0xcda557){return _0x3d88db[_0xf8e7('0x1d')](_0x4726d1)['json'](_0xcda557);}};}function respondWithFilteredResult(_0x19b280,_0x172162){return function(_0x23f95f){if(_0x23f95f){var _0x431d89=typeof _0x172162[_0xf8e7('0x1e')]===_0xf8e7('0x1f')&&typeof _0x172162[_0xf8e7('0x20')]===_0xf8e7('0x1f');var _0x4789d2=_0x23f95f[_0xf8e7('0x21')];var _0x21c954=_0x431d89?0x0:_0x172162['offset'];var _0x376e26=_0x431d89?_0x23f95f[_0xf8e7('0x21')]:_0x172162['offset']+_0x172162['limit'];var _0x4bc51f;if(_0x376e26>=_0x4789d2){_0x376e26=_0x4789d2;_0x4bc51f=0xc8;}else{_0x4bc51f=0xce;}_0x19b280['status'](_0x4bc51f);return _0x19b280['set'](_0xf8e7('0x22'),_0x21c954+'-'+_0x376e26+'/'+_0x4789d2)[_0xf8e7('0x23')](_0x23f95f);}return null;};}function patchUpdates(_0xad3662){return function(_0x35d6df){try{jsonpatch[_0xf8e7('0x24')](_0x35d6df,_0xad3662,!![]);}catch(_0x29621a){return BPromise['reject'](_0x29621a);}return _0x35d6df[_0xf8e7('0x25')]();};}function saveUpdates(_0xb9e329,_0x26220d){return function(_0x5bb5cd){if(_0x5bb5cd){return _0x5bb5cd[_0xf8e7('0x26')](_0xb9e329)[_0xf8e7('0x27')](function(_0xb4417e){return _0xb4417e;});}return null;};}function removeEntity(_0x47897e,_0x13711c){return function(_0x5396ec){if(_0x5396ec){return _0x5396ec[_0xf8e7('0x28')]()[_0xf8e7('0x27')](function(){_0x47897e[_0xf8e7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57f471,_0x5d35f9){return function(_0x23e899){if(!_0x23e899){_0x57f471['sendStatus'](0x194);}return _0x23e899;};}function handleError(_0x272ced,_0x352668){_0x352668=_0x352668||0x1f4;return function(_0x17a019){logger[_0xf8e7('0x29')](_0x17a019[_0xf8e7('0x2a')]);if(_0x17a019['name']){delete _0x17a019[_0xf8e7('0x2b')];}_0x272ced[_0xf8e7('0x1d')](_0x352668)[_0xf8e7('0x2c')](_0x17a019);};}exports['index']=function(_0x59ddb4,_0x5432c1){var _0x440f67={},_0x370655={},_0x1a7e13={'count':0x0,'rows':[]};var _0xce36b9=_[_0xf8e7('0x2d')](db['MailServerOut'][_0xf8e7('0x2e')],function(_0x3aa3a5){return{'name':_0x3aa3a5['fieldName'],'type':_0x3aa3a5[_0xf8e7('0x2f')][_0xf8e7('0x30')]};});_0x370655[_0xf8e7('0x31')]=_['map'](_0xce36b9,_0xf8e7('0x2b'));_0x370655['query']=_['keys'](_0x59ddb4[_0xf8e7('0x32')]);_0x370655[_0xf8e7('0x33')]=_['intersection'](_0x370655[_0xf8e7('0x31')],_0x370655[_0xf8e7('0x32')]);_0x440f67['attributes']=_[_0xf8e7('0x34')](_0x370655[_0xf8e7('0x31')],qs[_0xf8e7('0x35')](_0x59ddb4[_0xf8e7('0x32')][_0xf8e7('0x35')]));_0x440f67['attributes']=_0x440f67[_0xf8e7('0x36')][_0xf8e7('0x37')]?_0x440f67['attributes']:_0x370655[_0xf8e7('0x31')];if(!_0x59ddb4[_0xf8e7('0x32')][_0xf8e7('0x38')](_0xf8e7('0x39'))){_0x440f67[_0xf8e7('0x20')]=qs[_0xf8e7('0x20')](_0x59ddb4[_0xf8e7('0x32')][_0xf8e7('0x20')]);_0x440f67['offset']=qs[_0xf8e7('0x1e')](_0x59ddb4[_0xf8e7('0x32')][_0xf8e7('0x1e')]);}_0x440f67[_0xf8e7('0x3a')]=qs['sort'](_0x59ddb4[_0xf8e7('0x32')]['sort']);_0x440f67[_0xf8e7('0x3b')]=qs['filters'](_['pick'](_0x59ddb4[_0xf8e7('0x32')],_0x370655[_0xf8e7('0x33')]),_0xce36b9);if(_0x59ddb4['query'][_0xf8e7('0x3c')]){_0x440f67[_0xf8e7('0x3b')]=_['merge'](_0x440f67[_0xf8e7('0x3b')],{'$or':_['map'](_0xce36b9,function(_0x466c46){if(_0x466c46[_0xf8e7('0x2f')]!==_0xf8e7('0x3d')){var _0x1d6f97={};_0x1d6f97[_0x466c46[_0xf8e7('0x2b')]]={'$like':'%'+_0x59ddb4['query']['filter']+'%'};return _0x1d6f97;}})});}_0x440f67=_[_0xf8e7('0x3e')]({},_0x440f67,_0x59ddb4['options']);var _0x1fdfa0={'where':_0x440f67[_0xf8e7('0x3b')]};return db[_0xf8e7('0x3f')]['count'](_0x1fdfa0)[_0xf8e7('0x27')](function(_0x403169){_0x1a7e13[_0xf8e7('0x21')]=_0x403169;if(_0x59ddb4[_0xf8e7('0x32')]['includeAll']){_0x440f67[_0xf8e7('0x40')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x440f67);})[_0xf8e7('0x27')](function(_0x4ad96b){_0x1a7e13[_0xf8e7('0x41')]=_0x4ad96b;return _0x1a7e13;})[_0xf8e7('0x27')](respondWithFilteredResult(_0x5432c1,_0x440f67))[_0xf8e7('0x42')](handleError(_0x5432c1,null));};exports[_0xf8e7('0x43')]=function(_0x3559ac,_0x2272a3){var _0x290b24={'raw':!![],'where':{'id':_0x3559ac[_0xf8e7('0x44')]['id']}},_0xcae3a0={};_0xcae3a0['model']=_['keys'](db['MailServerOut'][_0xf8e7('0x2e')]);_0xcae3a0[_0xf8e7('0x32')]=_[_0xf8e7('0x45')](_0x3559ac['query']);_0xcae3a0[_0xf8e7('0x33')]=_[_0xf8e7('0x34')](_0xcae3a0[_0xf8e7('0x31')],_0xcae3a0[_0xf8e7('0x32')]);_0x290b24[_0xf8e7('0x36')]=_[_0xf8e7('0x34')](_0xcae3a0[_0xf8e7('0x31')],qs['fields'](_0x3559ac[_0xf8e7('0x32')][_0xf8e7('0x35')]));_0x290b24['attributes']=_0x290b24[_0xf8e7('0x36')][_0xf8e7('0x37')]?_0x290b24[_0xf8e7('0x36')]:_0xcae3a0[_0xf8e7('0x31')];if(_0x3559ac[_0xf8e7('0x32')][_0xf8e7('0x46')]){_0x290b24[_0xf8e7('0x40')]=[{'all':!![]}];}_0x290b24=_[_0xf8e7('0x3e')]({},_0x290b24,_0x3559ac[_0xf8e7('0x47')]);return db[_0xf8e7('0x3f')]['find'](_0x290b24)[_0xf8e7('0x27')](handleEntityNotFound(_0x2272a3,null))[_0xf8e7('0x27')](respondWithResult(_0x2272a3,null))[_0xf8e7('0x42')](handleError(_0x2272a3,null));};exports[_0xf8e7('0x48')]=function(_0x3c1a88,_0x4dcfeb){return db[_0xf8e7('0x3f')][_0xf8e7('0x48')](_0x3c1a88[_0xf8e7('0x49')],{})[_0xf8e7('0x27')](respondWithResult(_0x4dcfeb,0xc9))['catch'](handleError(_0x4dcfeb,null));};exports[_0xf8e7('0x26')]=function(_0x23b6b7,_0x4da368){if(_0x23b6b7[_0xf8e7('0x49')]['id']){delete _0x23b6b7[_0xf8e7('0x49')]['id'];}return db[_0xf8e7('0x3f')][_0xf8e7('0x4a')]({'where':{'id':_0x23b6b7[_0xf8e7('0x44')]['id']}})[_0xf8e7('0x27')](handleEntityNotFound(_0x4da368,null))[_0xf8e7('0x27')](saveUpdates(_0x23b6b7[_0xf8e7('0x49')],null))[_0xf8e7('0x27')](respondWithResult(_0x4da368,null))[_0xf8e7('0x42')](handleError(_0x4da368,null));};exports[_0xf8e7('0x28')]=function(_0x47f0f9,_0x437d4c){return db[_0xf8e7('0x3f')]['find']({'where':{'id':_0x47f0f9['params']['id']}})[_0xf8e7('0x27')](handleEntityNotFound(_0x437d4c,null))[_0xf8e7('0x27')](removeEntity(_0x437d4c,null))[_0xf8e7('0x42')](handleError(_0x437d4c,null));};
\ No newline at end of file
+var _0x4586=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','MailServerOut','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll','catch','show','params','rawAttributes','length','include','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x25e412,_0x177961){var _0x34042f=function(_0x47b25b){while(--_0x47b25b){_0x25e412['push'](_0x25e412['shift']());}};_0x34042f(++_0x177961);}(_0x4586,0x1a3));var _0x6458=function(_0x48ebe8,_0x300832){_0x48ebe8=_0x48ebe8-0x0;var _0x5c65fb=_0x4586[_0x48ebe8];return _0x5c65fb;};'use strict';var emlformat=require(_0x6458('0x0'));var rimraf=require(_0x6458('0x1'));var zipdir=require(_0x6458('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6458('0x3'));var BPromise=require(_0x6458('0x4'));var Mustache=require(_0x6458('0x5'));var util=require(_0x6458('0x6'));var path=require(_0x6458('0x7'));var sox=require(_0x6458('0x8'));var csv=require('to-csv');var ejs=require(_0x6458('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6458('0xa'));var squel=require(_0x6458('0xb'));var crypto=require(_0x6458('0xc'));var jsforce=require(_0x6458('0xd'));var deskjs=require(_0x6458('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6458('0xf'));var Papa=require(_0x6458('0x10'));var Redis=require(_0x6458('0x11'));var authService=require(_0x6458('0x12'));var qs=require(_0x6458('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6458('0x14'));var logger=require(_0x6458('0x15'))(_0x6458('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6458('0x17'))['db'];function respondWithStatusCode(_0x2995ea,_0x159821){_0x159821=_0x159821||0xcc;return function(_0x1cc78a){if(_0x1cc78a){return _0x2995ea[_0x6458('0x18')](_0x159821);}return _0x2995ea[_0x6458('0x19')](_0x159821)[_0x6458('0x1a')]();};}function respondWithResult(_0x639c7,_0x24fe66){_0x24fe66=_0x24fe66||0xc8;return function(_0x4b9c0f){if(_0x4b9c0f){return _0x639c7[_0x6458('0x19')](_0x24fe66)[_0x6458('0x1b')](_0x4b9c0f);}};}function respondWithFilteredResult(_0x94d7ec,_0x5c4587){return function(_0xfefdcf){if(_0xfefdcf){var _0x571745=typeof _0x5c4587[_0x6458('0x1c')]===_0x6458('0x1d')&&typeof _0x5c4587[_0x6458('0x1e')]===_0x6458('0x1d');var _0x60a8f2=_0xfefdcf[_0x6458('0x1f')];var _0x4232e5=_0x571745?0x0:_0x5c4587[_0x6458('0x1c')];var _0x1fa3b9=_0x571745?_0xfefdcf[_0x6458('0x1f')]:_0x5c4587[_0x6458('0x1c')]+_0x5c4587[_0x6458('0x1e')];var _0x432603;if(_0x1fa3b9>=_0x60a8f2){_0x1fa3b9=_0x60a8f2;_0x432603=0xc8;}else{_0x432603=0xce;}_0x94d7ec[_0x6458('0x19')](_0x432603);return _0x94d7ec[_0x6458('0x20')](_0x6458('0x21'),_0x4232e5+'-'+_0x1fa3b9+'/'+_0x60a8f2)[_0x6458('0x1b')](_0xfefdcf);}return null;};}function patchUpdates(_0xe57fbe){return function(_0x41081d){try{jsonpatch['apply'](_0x41081d,_0xe57fbe,!![]);}catch(_0x81de7f){return BPromise[_0x6458('0x22')](_0x81de7f);}return _0x41081d[_0x6458('0x23')]();};}function saveUpdates(_0x48ad04,_0x16e1a7){return function(_0x5daabb){if(_0x5daabb){return _0x5daabb[_0x6458('0x24')](_0x48ad04)[_0x6458('0x25')](function(_0x1eb197){return _0x1eb197;});}return null;};}function removeEntity(_0x55a7f1,_0x133b22){return function(_0xf3a9dc){if(_0xf3a9dc){return _0xf3a9dc[_0x6458('0x26')]()['then'](function(){_0x55a7f1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25b1c0,_0x244f90){return function(_0xf0bb6a){if(!_0xf0bb6a){_0x25b1c0[_0x6458('0x18')](0x194);}return _0xf0bb6a;};}function handleError(_0x27d985,_0xc78b0a){_0xc78b0a=_0xc78b0a||0x1f4;return function(_0x5309f6){logger['error'](_0x5309f6[_0x6458('0x27')]);if(_0x5309f6[_0x6458('0x28')]){delete _0x5309f6['name'];}_0x27d985['status'](_0xc78b0a)[_0x6458('0x29')](_0x5309f6);};}exports['index']=function(_0x2a7213,_0x43a5b0){var _0x346267={},_0x574a89={},_0x516a22={'count':0x0,'rows':[]};var _0x20d138=_[_0x6458('0x2a')](db[_0x6458('0x2b')]['rawAttributes'],function(_0x478bf1){return{'name':_0x478bf1[_0x6458('0x2c')],'type':_0x478bf1[_0x6458('0x2d')][_0x6458('0x2e')]};});_0x574a89[_0x6458('0x2f')]=_[_0x6458('0x2a')](_0x20d138,_0x6458('0x28'));_0x574a89[_0x6458('0x30')]=_[_0x6458('0x31')](_0x2a7213['query']);_0x574a89[_0x6458('0x32')]=_[_0x6458('0x33')](_0x574a89[_0x6458('0x2f')],_0x574a89[_0x6458('0x30')]);_0x346267['attributes']=_[_0x6458('0x33')](_0x574a89[_0x6458('0x2f')],qs[_0x6458('0x34')](_0x2a7213[_0x6458('0x30')][_0x6458('0x34')]));_0x346267[_0x6458('0x35')]=_0x346267[_0x6458('0x35')]['length']?_0x346267['attributes']:_0x574a89[_0x6458('0x2f')];if(!_0x2a7213[_0x6458('0x30')][_0x6458('0x36')](_0x6458('0x37'))){_0x346267[_0x6458('0x1e')]=qs[_0x6458('0x1e')](_0x2a7213[_0x6458('0x30')][_0x6458('0x1e')]);_0x346267['offset']=qs[_0x6458('0x1c')](_0x2a7213[_0x6458('0x30')][_0x6458('0x1c')]);}_0x346267['order']=qs[_0x6458('0x38')](_0x2a7213[_0x6458('0x30')][_0x6458('0x38')]);_0x346267['where']=qs[_0x6458('0x32')](_[_0x6458('0x39')](_0x2a7213['query'],_0x574a89['filters']),_0x20d138);if(_0x2a7213[_0x6458('0x30')][_0x6458('0x3a')]){_0x346267[_0x6458('0x3b')]=_[_0x6458('0x3c')](_0x346267[_0x6458('0x3b')],{'$or':_[_0x6458('0x2a')](_0x20d138,function(_0x49c1a2){if(_0x49c1a2[_0x6458('0x2d')]!=='VIRTUAL'){var _0x12036a={};_0x12036a[_0x49c1a2[_0x6458('0x28')]]={'$like':'%'+_0x2a7213[_0x6458('0x30')][_0x6458('0x3a')]+'%'};return _0x12036a;}})});}_0x346267=_[_0x6458('0x3c')]({},_0x346267,_0x2a7213[_0x6458('0x3d')]);var _0xb1eaf9={'where':_0x346267[_0x6458('0x3b')]};return db[_0x6458('0x2b')][_0x6458('0x1f')](_0xb1eaf9)[_0x6458('0x25')](function(_0x3b14a9){_0x516a22[_0x6458('0x1f')]=_0x3b14a9;if(_0x2a7213['query'][_0x6458('0x3e')]){_0x346267['include']=[{'all':!![]}];}return db[_0x6458('0x2b')][_0x6458('0x3f')](_0x346267);})[_0x6458('0x25')](function(_0xd7ef7b){_0x516a22['rows']=_0xd7ef7b;return _0x516a22;})[_0x6458('0x25')](respondWithFilteredResult(_0x43a5b0,_0x346267))[_0x6458('0x40')](handleError(_0x43a5b0,null));};exports[_0x6458('0x41')]=function(_0x357d46,_0x3ad045){var _0x2e1513={'raw':!![],'where':{'id':_0x357d46[_0x6458('0x42')]['id']}},_0x25d1e4={};_0x25d1e4[_0x6458('0x2f')]=_[_0x6458('0x31')](db['MailServerOut'][_0x6458('0x43')]);_0x25d1e4[_0x6458('0x30')]=_[_0x6458('0x31')](_0x357d46['query']);_0x25d1e4[_0x6458('0x32')]=_[_0x6458('0x33')](_0x25d1e4[_0x6458('0x2f')],_0x25d1e4[_0x6458('0x30')]);_0x2e1513['attributes']=_['intersection'](_0x25d1e4[_0x6458('0x2f')],qs[_0x6458('0x34')](_0x357d46['query']['fields']));_0x2e1513[_0x6458('0x35')]=_0x2e1513[_0x6458('0x35')][_0x6458('0x44')]?_0x2e1513[_0x6458('0x35')]:_0x25d1e4[_0x6458('0x2f')];if(_0x357d46[_0x6458('0x30')][_0x6458('0x3e')]){_0x2e1513[_0x6458('0x45')]=[{'all':!![]}];}_0x2e1513=_[_0x6458('0x3c')]({},_0x2e1513,_0x357d46[_0x6458('0x3d')]);return db[_0x6458('0x2b')]['find'](_0x2e1513)[_0x6458('0x25')](handleEntityNotFound(_0x3ad045,null))[_0x6458('0x25')](respondWithResult(_0x3ad045,null))[_0x6458('0x40')](handleError(_0x3ad045,null));};exports[_0x6458('0x46')]=function(_0x522501,_0x3de880){return db['MailServerOut']['create'](_0x522501[_0x6458('0x47')],{})[_0x6458('0x25')](respondWithResult(_0x3de880,0xc9))[_0x6458('0x40')](handleError(_0x3de880,null));};exports[_0x6458('0x24')]=function(_0x49164f,_0x45d402){if(_0x49164f[_0x6458('0x47')]['id']){delete _0x49164f[_0x6458('0x47')]['id'];}return db[_0x6458('0x2b')][_0x6458('0x48')]({'where':{'id':_0x49164f[_0x6458('0x42')]['id']}})[_0x6458('0x25')](handleEntityNotFound(_0x45d402,null))[_0x6458('0x25')](saveUpdates(_0x49164f[_0x6458('0x47')],null))[_0x6458('0x25')](respondWithResult(_0x45d402,null))[_0x6458('0x40')](handleError(_0x45d402,null));};exports[_0x6458('0x26')]=function(_0x24d943,_0x5dc3dc){return db['MailServerOut']['find']({'where':{'id':_0x24d943[_0x6458('0x42')]['id']}})[_0x6458('0x25')](handleEntityNotFound(_0x5dc3dc,null))[_0x6458('0x25')](removeEntity(_0x5dc3dc,null))[_0x6458('0x40')](handleError(_0x5dc3dc,null));};
\ No newline at end of file
index c5a5220..7a3358d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0321=['exports','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailServerOut.attributes'];(function(_0x35c709,_0x2128d6){var _0x3262ce=function(_0x10d5ec){while(--_0x10d5ec){_0x35c709['push'](_0x35c709['shift']());}};_0x3262ce(++_0x2128d6);}(_0x0321,0x1bf));var _0x1032=function(_0x1c9f88,_0x4739d0){_0x1c9f88=_0x1c9f88-0x0;var _0x3df7a5=_0x0321[_0x1c9f88];return _0x3df7a5;};'use strict';var _=require(_0x1032('0x0'));var util=require(_0x1032('0x1'));var logger=require(_0x1032('0x2'))(_0x1032('0x3'));var moment=require(_0x1032('0x4'));var BPromise=require(_0x1032('0x5'));var rp=require(_0x1032('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1032('0x7'));var attributes=require(_0x1032('0x8'));module[_0x1032('0x9')]=function(_0x5e252f,_0x4de5ef){return _0x5e252f['define'](_0x1032('0xa'),attributes,{'tableName':_0x1032('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5bab=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','MailServerOut','mail_servers_out'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5bab,0x82));var _0xb5ba=function(_0x2d7bbf,_0x3174b0){_0x2d7bbf=_0x2d7bbf-0x0;var _0x1b0a9c=_0x5bab[_0x2d7bbf];return _0x1b0a9c;};'use strict';var _=require(_0xb5ba('0x0'));var util=require(_0xb5ba('0x1'));var logger=require(_0xb5ba('0x2'))(_0xb5ba('0x3'));var moment=require(_0xb5ba('0x4'));var BPromise=require(_0xb5ba('0x5'));var rp=require(_0xb5ba('0x6'));var fs=require('fs');var path=require(_0xb5ba('0x7'));var rimraf=require(_0xb5ba('0x8'));var config=require(_0xb5ba('0x9'));var attributes=require(_0xb5ba('0xa'));module['exports']=function(_0x562260,_0x385323){return _0x562260['define'](_0xb5ba('0xb'),attributes,{'tableName':_0xb5ba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a7cbf46..765f5e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x111322,_0x5b6e95){var _0x365132=function(_0x336224){while(--_0x336224){_0x111322['push'](_0x111322['shift']());}};_0x365132(++_0x5b6e95);}(_0xdb28,0x106));var _0x8db2=function(_0x4417f0,_0x260878){_0x4417f0=_0x4417f0-0x0;var _0x50ba1f=_0xdb28[_0x4417f0];return _0x50ba1f;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x424e10,_0x5dcb5e){var _0x18453b=function(_0x3e8fbd){while(--_0x3e8fbd){_0x424e10['push'](_0x424e10['shift']());}};_0x18453b(++_0x5dcb5e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
index 49cbc8e..f7f5858 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6fc=['put','update','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','create'];(function(_0x3d38ae,_0x51102b){var _0x3757ee=function(_0x22bac8){while(--_0x22bac8){_0x3d38ae['push'](_0x3d38ae['shift']());}};_0x3757ee(++_0x51102b);}(_0xb6fc,0x1bd));var _0xcb6f=function(_0x1a1ea6,_0x58e082){_0x1a1ea6=_0x1a1ea6-0x0;var _0x59ec5f=_0xb6fc[_0x1a1ea6];return _0x59ec5f;};'use strict';var multer=require(_0xcb6f('0x0'));var util=require('util');var path=require(_0xcb6f('0x1'));var timeout=require(_0xcb6f('0x2'));var express=require(_0xcb6f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcb6f('0x4'));var interaction=require(_0xcb6f('0x5'));var config=require('../../config/environment');var controller=require(_0xcb6f('0x6'));router[_0xcb6f('0x7')]('/',auth[_0xcb6f('0x8')](),controller[_0xcb6f('0x9')]);router[_0xcb6f('0x7')](_0xcb6f('0xa'),auth[_0xcb6f('0x8')](),controller[_0xcb6f('0xb')]);router[_0xcb6f('0x7')](_0xcb6f('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xcb6f('0xd')]);router[_0xcb6f('0xe')](_0xcb6f('0xc'),auth[_0xcb6f('0x8')](),controller[_0xcb6f('0xf')]);router['delete'](_0xcb6f('0xc'),auth[_0xcb6f('0x8')](),controller[_0xcb6f('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xa7e8=['update','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','/describe','describe','get','/:id','show','post','put'];(function(_0x53db6f,_0x3b0fc1){var _0x386a7f=function(_0x24a595){while(--_0x24a595){_0x53db6f['push'](_0x53db6f['shift']());}};_0x386a7f(++_0x3b0fc1);}(_0xa7e8,0xae));var _0x8a7e=function(_0x9d55cf,_0x517452){_0x9d55cf=_0x9d55cf-0x0;var _0x28b7a1=_0xa7e8[_0x9d55cf];return _0x28b7a1;};'use strict';var multer=require(_0x8a7e('0x0'));var util=require(_0x8a7e('0x1'));var path=require(_0x8a7e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8a7e('0x3')]();var fs_extra=require(_0x8a7e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8a7e('0x5'));var config=require(_0x8a7e('0x6'));var controller=require(_0x8a7e('0x7'));router['get']('/',auth[_0x8a7e('0x8')](),controller['index']);router['get'](_0x8a7e('0x9'),auth['isAuthenticated'](),controller[_0x8a7e('0xa')]);router[_0x8a7e('0xb')](_0x8a7e('0xc'),auth[_0x8a7e('0x8')](),controller[_0x8a7e('0xd')]);router[_0x8a7e('0xe')]('/',auth[_0x8a7e('0x8')](),controller['create']);router[_0x8a7e('0xf')](_0x8a7e('0xc'),auth[_0x8a7e('0x8')](),controller[_0x8a7e('0x10')]);router[_0x8a7e('0x11')](_0x8a7e('0xc'),auth[_0x8a7e('0x8')](),controller['destroy']);module[_0x8a7e('0x12')]=router;
\ No newline at end of file
index 6cccd49..b88f7ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['STRING','name','sequelize','exports'];(function(_0x3cccb6,_0x4418ad){var _0x245b2d=function(_0x139aeb){while(--_0x139aeb){_0x3cccb6['push'](_0x3cccb6['shift']());}};_0x245b2d(++_0x4418ad);}(_0x53ec,0x192));var _0xc53e=function(_0x583829,_0x188b0e){_0x583829=_0x583829-0x0;var _0x34d994=_0x53ec[_0x583829];return _0x34d994;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'unique':_0xc53e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc53e('0x2')]}};
\ No newline at end of file
+var _0x2675=['STRING','sequelize'];(function(_0x2606e7,_0x1fbaff){var _0x154740=function(_0x34d0b5){while(--_0x34d0b5){_0x2606e7['push'](_0x2606e7['shift']());}};_0x154740(++_0x1fbaff);}(_0x2675,0x75));var _0x5267=function(_0x5ecfc0,_0x453d32){_0x5ecfc0=_0x5ecfc0-0x0;var _0x367e3f=_0x2675[_0x5ecfc0];return _0x367e3f;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5267('0x1')]}};
\ No newline at end of file
index 3937d1e..ec7ba11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c71=['stack','name','map','MailSubstatus','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4c71,0xb0));var _0x14c7=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x4c71[_0x88cd7b];return _0x56fcc8;};'use strict';var emlformat=require(_0x14c7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x14c7('0x1'));var jsonpatch=require(_0x14c7('0x2'));var rp=require('request-promise');var moment=require(_0x14c7('0x3'));var BPromise=require(_0x14c7('0x4'));var Mustache=require(_0x14c7('0x5'));var util=require('util');var path=require(_0x14c7('0x6'));var sox=require(_0x14c7('0x7'));var csv=require('to-csv');var ejs=require(_0x14c7('0x8'));var fs=require('fs');var fs_extra=require(_0x14c7('0x9'));var _=require(_0x14c7('0xa'));var squel=require(_0x14c7('0xb'));var crypto=require(_0x14c7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x14c7('0xd'));var querystring=require(_0x14c7('0xe'));var Papa=require('papaparse');var Redis=require(_0x14c7('0xf'));var authService=require(_0x14c7('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14c7('0x11'));var logger=require('../../config/logger')(_0x14c7('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x14c7('0x13'));var db=require(_0x14c7('0x14'))['db'];function respondWithStatusCode(_0x3a5fc5,_0x5ee9a4){_0x5ee9a4=_0x5ee9a4||0xcc;return function(_0x114f0e){if(_0x114f0e){return _0x3a5fc5[_0x14c7('0x15')](_0x5ee9a4);}return _0x3a5fc5['status'](_0x5ee9a4)['end']();};}function respondWithResult(_0x1c7a14,_0x3b8f95){_0x3b8f95=_0x3b8f95||0xc8;return function(_0x187ee0){if(_0x187ee0){return _0x1c7a14[_0x14c7('0x16')](_0x3b8f95)[_0x14c7('0x17')](_0x187ee0);}};}function respondWithFilteredResult(_0x17a2ec,_0x2d1a3e){return function(_0xcbe0a){if(_0xcbe0a){var _0x19955c=typeof _0x2d1a3e[_0x14c7('0x18')]===_0x14c7('0x19')&&typeof _0x2d1a3e[_0x14c7('0x1a')]==='undefined';var _0x3ccc6e=_0xcbe0a[_0x14c7('0x1b')];var _0x5b5083=_0x19955c?0x0:_0x2d1a3e['offset'];var _0x42d3f9=_0x19955c?_0xcbe0a[_0x14c7('0x1b')]:_0x2d1a3e[_0x14c7('0x18')]+_0x2d1a3e[_0x14c7('0x1a')];var _0xd5593a;if(_0x42d3f9>=_0x3ccc6e){_0x42d3f9=_0x3ccc6e;_0xd5593a=0xc8;}else{_0xd5593a=0xce;}_0x17a2ec[_0x14c7('0x16')](_0xd5593a);return _0x17a2ec[_0x14c7('0x1c')](_0x14c7('0x1d'),_0x5b5083+'-'+_0x42d3f9+'/'+_0x3ccc6e)[_0x14c7('0x17')](_0xcbe0a);}return null;};}function patchUpdates(_0x30d795){return function(_0x1f2c84){try{jsonpatch[_0x14c7('0x1e')](_0x1f2c84,_0x30d795,!![]);}catch(_0x385caa){return BPromise['reject'](_0x385caa);}return _0x1f2c84[_0x14c7('0x1f')]();};}function saveUpdates(_0x540874,_0x45cf26){return function(_0x412348){if(_0x412348){return _0x412348[_0x14c7('0x20')](_0x540874)[_0x14c7('0x21')](function(_0x3928a2){return _0x3928a2;});}return null;};}function removeEntity(_0x33e497,_0x2eeedb){return function(_0x11fa4e){if(_0x11fa4e){return _0x11fa4e[_0x14c7('0x22')]()[_0x14c7('0x21')](function(){_0x33e497['status'](0xcc)[_0x14c7('0x23')]();});}};}function handleEntityNotFound(_0x4ff7d9,_0x5ae707){return function(_0x2a1a51){if(!_0x2a1a51){_0x4ff7d9[_0x14c7('0x15')](0x194);}return _0x2a1a51;};}function handleError(_0x290f40,_0x2fc48e){_0x2fc48e=_0x2fc48e||0x1f4;return function(_0x4fed11){logger[_0x14c7('0x24')](_0x4fed11[_0x14c7('0x25')]);if(_0x4fed11[_0x14c7('0x26')]){delete _0x4fed11[_0x14c7('0x26')];}_0x290f40['status'](_0x2fc48e)['send'](_0x4fed11);};}exports['index']=function(_0x5b14e4,_0x399379){var _0x5232c5={},_0x4c8ea4={},_0x240a7f={'count':0x0,'rows':[]};var _0x49b6c9=_[_0x14c7('0x27')](db[_0x14c7('0x28')]['rawAttributes'],function(_0x1a5777){return{'name':_0x1a5777[_0x14c7('0x29')],'type':_0x1a5777[_0x14c7('0x2a')][_0x14c7('0x2b')]};});_0x4c8ea4['model']=_[_0x14c7('0x27')](_0x49b6c9,_0x14c7('0x26'));_0x4c8ea4[_0x14c7('0x2c')]=_[_0x14c7('0x2d')](_0x5b14e4[_0x14c7('0x2c')]);_0x4c8ea4['filters']=_[_0x14c7('0x2e')](_0x4c8ea4['model'],_0x4c8ea4[_0x14c7('0x2c')]);_0x5232c5[_0x14c7('0x2f')]=_[_0x14c7('0x2e')](_0x4c8ea4[_0x14c7('0x30')],qs[_0x14c7('0x31')](_0x5b14e4[_0x14c7('0x2c')][_0x14c7('0x31')]));_0x5232c5[_0x14c7('0x2f')]=_0x5232c5[_0x14c7('0x2f')][_0x14c7('0x32')]?_0x5232c5[_0x14c7('0x2f')]:_0x4c8ea4[_0x14c7('0x30')];if(!_0x5b14e4[_0x14c7('0x2c')][_0x14c7('0x33')](_0x14c7('0x34'))){_0x5232c5[_0x14c7('0x1a')]=qs[_0x14c7('0x1a')](_0x5b14e4[_0x14c7('0x2c')][_0x14c7('0x1a')]);_0x5232c5['offset']=qs[_0x14c7('0x18')](_0x5b14e4[_0x14c7('0x2c')]['offset']);}_0x5232c5['order']=qs[_0x14c7('0x35')](_0x5b14e4[_0x14c7('0x2c')]['sort']);_0x5232c5[_0x14c7('0x36')]=qs[_0x14c7('0x37')](_[_0x14c7('0x38')](_0x5b14e4[_0x14c7('0x2c')],_0x4c8ea4[_0x14c7('0x37')]),_0x49b6c9);if(_0x5b14e4['query'][_0x14c7('0x39')]){_0x5232c5['where']=_[_0x14c7('0x3a')](_0x5232c5[_0x14c7('0x36')],{'$or':_[_0x14c7('0x27')](_0x49b6c9,function(_0x35a036){if(_0x35a036['type']!==_0x14c7('0x3b')){var _0x935a48={};_0x935a48[_0x35a036[_0x14c7('0x26')]]={'$like':'%'+_0x5b14e4['query'][_0x14c7('0x39')]+'%'};return _0x935a48;}})});}_0x5232c5=_[_0x14c7('0x3a')]({},_0x5232c5,_0x5b14e4[_0x14c7('0x3c')]);var _0x514e1e={'where':_0x5232c5['where']};return db[_0x14c7('0x28')][_0x14c7('0x1b')](_0x514e1e)[_0x14c7('0x21')](function(_0x53f5fd){_0x240a7f['count']=_0x53f5fd;if(_0x5b14e4[_0x14c7('0x2c')][_0x14c7('0x3d')]){_0x5232c5[_0x14c7('0x3e')]=[{'all':!![]}];}return db['MailSubstatus'][_0x14c7('0x3f')](_0x5232c5);})[_0x14c7('0x21')](function(_0x4eebf5){_0x240a7f['rows']=_0x4eebf5;return _0x240a7f;})[_0x14c7('0x21')](respondWithFilteredResult(_0x399379,_0x5232c5))[_0x14c7('0x40')](handleError(_0x399379,null));};exports['show']=function(_0x782457,_0x1e3221){var _0x31bded={'raw':!![],'where':{'id':_0x782457[_0x14c7('0x41')]['id']}},_0x5b6767={};_0x5b6767['model']=_[_0x14c7('0x2d')](db[_0x14c7('0x28')][_0x14c7('0x42')]);_0x5b6767[_0x14c7('0x2c')]=_[_0x14c7('0x2d')](_0x782457[_0x14c7('0x2c')]);_0x5b6767['filters']=_['intersection'](_0x5b6767[_0x14c7('0x30')],_0x5b6767[_0x14c7('0x2c')]);_0x31bded[_0x14c7('0x2f')]=_['intersection'](_0x5b6767[_0x14c7('0x30')],qs[_0x14c7('0x31')](_0x782457['query'][_0x14c7('0x31')]));_0x31bded[_0x14c7('0x2f')]=_0x31bded['attributes']['length']?_0x31bded[_0x14c7('0x2f')]:_0x5b6767['model'];if(_0x782457[_0x14c7('0x2c')][_0x14c7('0x3d')]){_0x31bded[_0x14c7('0x3e')]=[{'all':!![]}];}_0x31bded=_[_0x14c7('0x3a')]({},_0x31bded,_0x782457['options']);return db[_0x14c7('0x28')][_0x14c7('0x43')](_0x31bded)[_0x14c7('0x21')](handleEntityNotFound(_0x1e3221,null))[_0x14c7('0x21')](respondWithResult(_0x1e3221,null))[_0x14c7('0x40')](handleError(_0x1e3221,null));};exports[_0x14c7('0x44')]=function(_0x52b763,_0xfe081b){return db[_0x14c7('0x28')]['create'](_0x52b763[_0x14c7('0x45')],{})[_0x14c7('0x21')](respondWithResult(_0xfe081b,0xc9))['catch'](handleError(_0xfe081b,null));};exports[_0x14c7('0x20')]=function(_0x146c13,_0x19da5d){if(_0x146c13['body']['id']){delete _0x146c13[_0x14c7('0x45')]['id'];}return db['MailSubstatus'][_0x14c7('0x43')]({'where':{'id':_0x146c13[_0x14c7('0x41')]['id']}})[_0x14c7('0x21')](handleEntityNotFound(_0x19da5d,null))['then'](saveUpdates(_0x146c13[_0x14c7('0x45')],null))[_0x14c7('0x21')](respondWithResult(_0x19da5d,null))['catch'](handleError(_0x19da5d,null));};exports[_0x14c7('0x22')]=function(_0x3d2c94,_0x3d29c1){return db[_0x14c7('0x28')][_0x14c7('0x43')]({'where':{'id':_0x3d2c94[_0x14c7('0x41')]['id']}})[_0x14c7('0x21')](handleEntityNotFound(_0x3d29c1,null))[_0x14c7('0x21')](removeEntity(_0x3d29c1,null))[_0x14c7('0x40')](handleError(_0x3d29c1,null));};exports[_0x14c7('0x46')]=function(_0x335651,_0x5840e4){return db['MailSubstatus'][_0x14c7('0x46')]()[_0x14c7('0x21')](respondWithResult(_0x5840e4,null))[_0x14c7('0x40')](handleError(_0x5840e4,null));};
\ No newline at end of file
+var _0x6456=['name','index','map','MailSubstatus','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','type','merge','findAll','catch','params','keys','includeAll','include','find','create','body','update','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','stack'];(function(_0x1ae2ab,_0x4269ce){var _0x5f130b=function(_0x1a0369){while(--_0x1a0369){_0x1ae2ab['push'](_0x1ae2ab['shift']());}};_0x5f130b(++_0x4269ce);}(_0x6456,0xf7));var _0x6645=function(_0x4886c1,_0x5d2666){_0x4886c1=_0x4886c1-0x0;var _0x2b2c46=_0x6456[_0x4886c1];return _0x2b2c46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6645('0x0'));var zipdir=require(_0x6645('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6645('0x2'));var moment=require(_0x6645('0x3'));var BPromise=require(_0x6645('0x4'));var Mustache=require(_0x6645('0x5'));var util=require(_0x6645('0x6'));var path=require(_0x6645('0x7'));var sox=require(_0x6645('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6645('0x9'));var _=require(_0x6645('0xa'));var squel=require(_0x6645('0xb'));var crypto=require(_0x6645('0xc'));var jsforce=require(_0x6645('0xd'));var deskjs=require(_0x6645('0xe'));var toCsv=require(_0x6645('0xf'));var querystring=require('querystring');var Papa=require(_0x6645('0x10'));var Redis=require(_0x6645('0x11'));var authService=require(_0x6645('0x12'));var qs=require(_0x6645('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6645('0x14'));var logger=require(_0x6645('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6645('0x16'));var licenseUtil=require(_0x6645('0x17'));var db=require(_0x6645('0x18'))['db'];function respondWithStatusCode(_0x132b08,_0x19de3d){_0x19de3d=_0x19de3d||0xcc;return function(_0x3f17d6){if(_0x3f17d6){return _0x132b08[_0x6645('0x19')](_0x19de3d);}return _0x132b08[_0x6645('0x1a')](_0x19de3d)[_0x6645('0x1b')]();};}function respondWithResult(_0x2eed41,_0x13d53a){_0x13d53a=_0x13d53a||0xc8;return function(_0xdaff01){if(_0xdaff01){return _0x2eed41[_0x6645('0x1a')](_0x13d53a)[_0x6645('0x1c')](_0xdaff01);}};}function respondWithFilteredResult(_0x31bd6f,_0x318b8d){return function(_0x4c3328){if(_0x4c3328){var _0x298efb=typeof _0x318b8d[_0x6645('0x1d')]===_0x6645('0x1e')&&typeof _0x318b8d['limit']==='undefined';var _0x1ff4a2=_0x4c3328[_0x6645('0x1f')];var _0xe2c882=_0x298efb?0x0:_0x318b8d[_0x6645('0x1d')];var _0x3d6295=_0x298efb?_0x4c3328[_0x6645('0x1f')]:_0x318b8d[_0x6645('0x1d')]+_0x318b8d[_0x6645('0x20')];var _0x5c05d7;if(_0x3d6295>=_0x1ff4a2){_0x3d6295=_0x1ff4a2;_0x5c05d7=0xc8;}else{_0x5c05d7=0xce;}_0x31bd6f[_0x6645('0x1a')](_0x5c05d7);return _0x31bd6f[_0x6645('0x21')](_0x6645('0x22'),_0xe2c882+'-'+_0x3d6295+'/'+_0x1ff4a2)[_0x6645('0x1c')](_0x4c3328);}return null;};}function patchUpdates(_0x22deba){return function(_0x270315){try{jsonpatch[_0x6645('0x23')](_0x270315,_0x22deba,!![]);}catch(_0x5dc908){return BPromise['reject'](_0x5dc908);}return _0x270315[_0x6645('0x24')]();};}function saveUpdates(_0x9b3b6b,_0x1aa34d){return function(_0x307967){if(_0x307967){return _0x307967['update'](_0x9b3b6b)[_0x6645('0x25')](function(_0x238ee4){return _0x238ee4;});}return null;};}function removeEntity(_0x25f6f6,_0x57f484){return function(_0x35b769){if(_0x35b769){return _0x35b769[_0x6645('0x26')]()[_0x6645('0x25')](function(){_0x25f6f6[_0x6645('0x1a')](0xcc)[_0x6645('0x1b')]();});}};}function handleEntityNotFound(_0x556b66,_0x217b22){return function(_0x1f49f4){if(!_0x1f49f4){_0x556b66[_0x6645('0x19')](0x194);}return _0x1f49f4;};}function handleError(_0xa8f46e,_0x4abfa1){_0x4abfa1=_0x4abfa1||0x1f4;return function(_0x5a9290){logger[_0x6645('0x27')](_0x5a9290[_0x6645('0x28')]);if(_0x5a9290[_0x6645('0x29')]){delete _0x5a9290[_0x6645('0x29')];}_0xa8f46e['status'](_0x4abfa1)['send'](_0x5a9290);};}exports[_0x6645('0x2a')]=function(_0x54f1d6,_0x127676){var _0x4b530b={},_0x6664c7={},_0x49323b={'count':0x0,'rows':[]};var _0x1b3b3d=_[_0x6645('0x2b')](db[_0x6645('0x2c')][_0x6645('0x2d')],function(_0x2d391a){return{'name':_0x2d391a['fieldName'],'type':_0x2d391a['type'][_0x6645('0x2e')]};});_0x6664c7[_0x6645('0x2f')]=_[_0x6645('0x2b')](_0x1b3b3d,'name');_0x6664c7['query']=_['keys'](_0x54f1d6[_0x6645('0x30')]);_0x6664c7[_0x6645('0x31')]=_['intersection'](_0x6664c7[_0x6645('0x2f')],_0x6664c7[_0x6645('0x30')]);_0x4b530b['attributes']=_[_0x6645('0x32')](_0x6664c7['model'],qs[_0x6645('0x33')](_0x54f1d6[_0x6645('0x30')]['fields']));_0x4b530b[_0x6645('0x34')]=_0x4b530b[_0x6645('0x34')][_0x6645('0x35')]?_0x4b530b[_0x6645('0x34')]:_0x6664c7[_0x6645('0x2f')];if(!_0x54f1d6['query']['hasOwnProperty'](_0x6645('0x36'))){_0x4b530b[_0x6645('0x20')]=qs[_0x6645('0x20')](_0x54f1d6[_0x6645('0x30')][_0x6645('0x20')]);_0x4b530b[_0x6645('0x1d')]=qs['offset'](_0x54f1d6[_0x6645('0x30')][_0x6645('0x1d')]);}_0x4b530b['order']=qs[_0x6645('0x37')](_0x54f1d6['query']['sort']);_0x4b530b[_0x6645('0x38')]=qs[_0x6645('0x31')](_[_0x6645('0x39')](_0x54f1d6[_0x6645('0x30')],_0x6664c7['filters']),_0x1b3b3d);if(_0x54f1d6[_0x6645('0x30')][_0x6645('0x3a')]){_0x4b530b[_0x6645('0x38')]=_['merge'](_0x4b530b[_0x6645('0x38')],{'$or':_['map'](_0x1b3b3d,function(_0x344842){if(_0x344842[_0x6645('0x3b')]!=='VIRTUAL'){var _0x4cd15b={};_0x4cd15b[_0x344842[_0x6645('0x29')]]={'$like':'%'+_0x54f1d6[_0x6645('0x30')]['filter']+'%'};return _0x4cd15b;}})});}_0x4b530b=_[_0x6645('0x3c')]({},_0x4b530b,_0x54f1d6['options']);var _0x542ba9={'where':_0x4b530b[_0x6645('0x38')]};return db[_0x6645('0x2c')][_0x6645('0x1f')](_0x542ba9)['then'](function(_0x2b38ea){_0x49323b[_0x6645('0x1f')]=_0x2b38ea;if(_0x54f1d6[_0x6645('0x30')]['includeAll']){_0x4b530b['include']=[{'all':!![]}];}return db[_0x6645('0x2c')][_0x6645('0x3d')](_0x4b530b);})['then'](function(_0x451cb6){_0x49323b['rows']=_0x451cb6;return _0x49323b;})[_0x6645('0x25')](respondWithFilteredResult(_0x127676,_0x4b530b))[_0x6645('0x3e')](handleError(_0x127676,null));};exports['show']=function(_0x446c99,_0x22710a){var _0x3df359={'raw':!![],'where':{'id':_0x446c99[_0x6645('0x3f')]['id']}},_0x4d214a={};_0x4d214a[_0x6645('0x2f')]=_[_0x6645('0x40')](db[_0x6645('0x2c')][_0x6645('0x2d')]);_0x4d214a[_0x6645('0x30')]=_[_0x6645('0x40')](_0x446c99[_0x6645('0x30')]);_0x4d214a[_0x6645('0x31')]=_['intersection'](_0x4d214a['model'],_0x4d214a[_0x6645('0x30')]);_0x3df359[_0x6645('0x34')]=_[_0x6645('0x32')](_0x4d214a[_0x6645('0x2f')],qs[_0x6645('0x33')](_0x446c99[_0x6645('0x30')][_0x6645('0x33')]));_0x3df359['attributes']=_0x3df359[_0x6645('0x34')][_0x6645('0x35')]?_0x3df359[_0x6645('0x34')]:_0x4d214a[_0x6645('0x2f')];if(_0x446c99[_0x6645('0x30')][_0x6645('0x41')]){_0x3df359[_0x6645('0x42')]=[{'all':!![]}];}_0x3df359=_[_0x6645('0x3c')]({},_0x3df359,_0x446c99['options']);return db[_0x6645('0x2c')][_0x6645('0x43')](_0x3df359)[_0x6645('0x25')](handleEntityNotFound(_0x22710a,null))[_0x6645('0x25')](respondWithResult(_0x22710a,null))[_0x6645('0x3e')](handleError(_0x22710a,null));};exports[_0x6645('0x44')]=function(_0x39e8fc,_0x34770a){return db[_0x6645('0x2c')][_0x6645('0x44')](_0x39e8fc[_0x6645('0x45')],{})[_0x6645('0x25')](respondWithResult(_0x34770a,0xc9))['catch'](handleError(_0x34770a,null));};exports[_0x6645('0x46')]=function(_0x5917a9,_0x556219){if(_0x5917a9[_0x6645('0x45')]['id']){delete _0x5917a9[_0x6645('0x45')]['id'];}return db[_0x6645('0x2c')][_0x6645('0x43')]({'where':{'id':_0x5917a9[_0x6645('0x3f')]['id']}})[_0x6645('0x25')](handleEntityNotFound(_0x556219,null))[_0x6645('0x25')](saveUpdates(_0x5917a9[_0x6645('0x45')],null))['then'](respondWithResult(_0x556219,null))[_0x6645('0x3e')](handleError(_0x556219,null));};exports[_0x6645('0x26')]=function(_0x3f331b,_0x2e2f71){return db[_0x6645('0x2c')][_0x6645('0x43')]({'where':{'id':_0x3f331b[_0x6645('0x3f')]['id']}})[_0x6645('0x25')](handleEntityNotFound(_0x2e2f71,null))[_0x6645('0x25')](removeEntity(_0x2e2f71,null))[_0x6645('0x3e')](handleError(_0x2e2f71,null));};exports[_0x6645('0x47')]=function(_0x13a458,_0x237e32){return db[_0x6645('0x2c')]['describe']()[_0x6645('0x25')](respondWithResult(_0x237e32,null))['catch'](handleError(_0x237e32,null));};
\ No newline at end of file
index 511c49d..a92640e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3293=['api','moment','bluebird','path','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','../../config/logger'];(function(_0x480843,_0x8121e6){var _0x1d5cd9=function(_0x54ca2a){while(--_0x54ca2a){_0x480843['push'](_0x480843['shift']());}};_0x1d5cd9(++_0x8121e6);}(_0x3293,0x17f));var _0x3329=function(_0xf799b7,_0x1c2da4){_0xf799b7=_0xf799b7-0x0;var _0x1f8be6=_0x3293[_0xf799b7];return _0x1f8be6;};'use strict';var _=require(_0x3329('0x0'));var util=require('util');var logger=require(_0x3329('0x1'))(_0x3329('0x2'));var moment=require(_0x3329('0x3'));var BPromise=require(_0x3329('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3329('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3329('0x6'));module[_0x3329('0x7')]=function(_0x6dcfe6,_0x17fa09){return _0x6dcfe6[_0x3329('0x8')](_0x3329('0x9'),attributes,{'tableName':_0x3329('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc024=['../../config/environment','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x23f5c6,_0x521879){var _0x18eb29=function(_0x2c0fa6){while(--_0x2c0fa6){_0x23f5c6['push'](_0x23f5c6['shift']());}};_0x18eb29(++_0x521879);}(_0xc024,0x14e));var _0x4c02=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc024[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x4c02('0x0'));var util=require(_0x4c02('0x1'));var logger=require(_0x4c02('0x2'))(_0x4c02('0x3'));var moment=require(_0x4c02('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c02('0x5'));var rimraf=require(_0x4c02('0x6'));var config=require(_0x4c02('0x7'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x5c9b30,_0x29e525){return _0x5c9b30[_0x4c02('0x8')](_0x4c02('0x9'),attributes,{'tableName':_0x4c02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3ab54fc..2b7786b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8994=['rpc','jayson/promise','client','http','request','then','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0xc2a57a,_0x1aff8c){var _0xe8a404=function(_0x4393ea){while(--_0x4393ea){_0xc2a57a['push'](_0xc2a57a['shift']());}};_0xe8a404(++_0x1aff8c);}(_0x8994,0x16f));var _0x4899=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8994[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4899('0x0'));var util=require(_0x4899('0x1'));var moment=require(_0x4899('0x2'));var BPromise=require(_0x4899('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4899('0x4'));var db=require(_0x4899('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4899('0x6'))(_0x4899('0x7'));var config=require('../../config/environment');var jayson=require(_0x4899('0x8'));var client=jayson[_0x4899('0x9')][_0x4899('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x123126,_0x252436,_0x4d0809){return new BPromise(function(_0x3e6e5f,_0x542cf9){return client[_0x4899('0xb')](_0x123126,_0x4d0809)[_0x4899('0xc')](function(_0x26d2ab){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x252436,'request\x20sent');logger[_0x4899('0xd')](_0x4899('0xe'),_0x252436,_0x4899('0xf'),JSON[_0x4899('0x10')](_0x26d2ab));if(_0x26d2ab['error']){if(_0x26d2ab[_0x4899('0x11')][_0x4899('0x12')]===0x1f4){logger[_0x4899('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x252436,_0x26d2ab[_0x4899('0x11')][_0x4899('0x13')]);return _0x542cf9(_0x26d2ab[_0x4899('0x11')][_0x4899('0x13')]);}logger['error'](_0x4899('0x14'),_0x252436,_0x26d2ab[_0x4899('0x11')]['message']);return _0x3e6e5f(_0x26d2ab[_0x4899('0x11')][_0x4899('0x13')]);}else{logger['info'](_0x4899('0x14'),_0x252436,'request\x20sent');_0x3e6e5f(_0x26d2ab[_0x4899('0x15')]['message']);}})['catch'](function(_0x463884){logger['error'](_0x4899('0x14'),_0x252436,_0x463884);_0x542cf9(_0x463884);});});}
\ No newline at end of file
+var _0xbecc=['MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x25d5e9,_0x340fda){var _0xa351e2=function(_0x14bc4a){while(--_0x14bc4a){_0x25d5e9['push'](_0x25d5e9['shift']());}};_0xa351e2(++_0x340fda);}(_0xbecc,0x16e));var _0xcbec=function(_0xdb622a,_0x2b9b53){_0xdb622a=_0xdb622a-0x0;var _0x2f404e=_0xbecc[_0xdb622a];return _0x2f404e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcbec('0x0'));var BPromise=require(_0xcbec('0x1'));var rs=require(_0xcbec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbec('0x3'))['db'];var utils=require(_0xcbec('0x4'));var logger=require(_0xcbec('0x5'))(_0xcbec('0x6'));var config=require('../../config/environment');var jayson=require(_0xcbec('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x265b5b,_0x4c56d1,_0xda1c3e){return new BPromise(function(_0x30b026,_0x3934dc){return client[_0xcbec('0x8')](_0x265b5b,_0xda1c3e)[_0xcbec('0x9')](function(_0x1d2f58){logger[_0xcbec('0xa')](_0xcbec('0xb'),_0x4c56d1,'request\x20sent');logger['debug'](_0xcbec('0xc'),_0x4c56d1,_0xcbec('0xd'),JSON['stringify'](_0x1d2f58));if(_0x1d2f58[_0xcbec('0xe')]){if(_0x1d2f58[_0xcbec('0xe')]['code']===0x1f4){logger[_0xcbec('0xe')](_0xcbec('0xb'),_0x4c56d1,_0x1d2f58[_0xcbec('0xe')][_0xcbec('0xf')]);return _0x3934dc(_0x1d2f58['error'][_0xcbec('0xf')]);}logger[_0xcbec('0xe')](_0xcbec('0xb'),_0x4c56d1,_0x1d2f58[_0xcbec('0xe')][_0xcbec('0xf')]);return _0x30b026(_0x1d2f58[_0xcbec('0xe')][_0xcbec('0xf')]);}else{logger[_0xcbec('0xa')](_0xcbec('0xb'),_0x4c56d1,_0xcbec('0xd'));_0x30b026(_0x1d2f58[_0xcbec('0x10')][_0xcbec('0xf')]);}})[_0xcbec('0x11')](function(_0x407ce2){logger[_0xcbec('0xe')](_0xcbec('0xb'),_0x4c56d1,_0x407ce2);_0x3934dc(_0x407ce2);});});}
\ No newline at end of file
index dd8ac67..d8c09cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a3d=['fs-extra','../../components/auth/service','./mailTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','put','update','destroy','multer','util','connect-timeout','express','Router'];(function(_0x5bd4f6,_0xf4e45c){var _0x33a165=function(_0x37eef6){while(--_0x37eef6){_0x5bd4f6['push'](_0x5bd4f6['shift']());}};_0x33a165(++_0xf4e45c);}(_0x3a3d,0x1bd));var _0xd3a3=function(_0x15f11f,_0x1188e8){_0x15f11f=_0x15f11f-0x0;var _0x566797=_0x3a3d[_0x15f11f];return _0x566797;};'use strict';var multer=require(_0xd3a3('0x0'));var util=require(_0xd3a3('0x1'));var path=require('path');var timeout=require(_0xd3a3('0x2'));var express=require(_0xd3a3('0x3'));var router=express[_0xd3a3('0x4')]();var fs_extra=require(_0xd3a3('0x5'));var auth=require(_0xd3a3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd3a3('0x7'));router['get']('/',auth[_0xd3a3('0x8')](),controller['index']);router[_0xd3a3('0x9')](_0xd3a3('0xa'),auth[_0xd3a3('0x8')](),controller[_0xd3a3('0xb')]);router[_0xd3a3('0x9')](_0xd3a3('0xc'),auth[_0xd3a3('0x8')](),controller[_0xd3a3('0xd')]);router[_0xd3a3('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd3a3('0xf')](_0xd3a3('0xc'),auth[_0xd3a3('0x8')](),controller[_0xd3a3('0x10')]);router['delete'](_0xd3a3('0xc'),auth[_0xd3a3('0x8')](),controller[_0xd3a3('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x5623=['put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5623,0x144));var _0x3562=function(_0x196467,_0x1ed2c6){_0x196467=_0x196467-0x0;var _0x375dda=_0x5623[_0x196467];return _0x375dda;};'use strict';var multer=require('multer');var util=require(_0x3562('0x0'));var path=require(_0x3562('0x1'));var timeout=require(_0x3562('0x2'));var express=require(_0x3562('0x3'));var router=express[_0x3562('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3562('0x5'));var config=require(_0x3562('0x6'));var controller=require(_0x3562('0x7'));router[_0x3562('0x8')]('/',auth[_0x3562('0x9')](),controller['index']);router[_0x3562('0x8')](_0x3562('0xa'),auth[_0x3562('0x9')](),controller[_0x3562('0xb')]);router[_0x3562('0x8')](_0x3562('0xc'),auth[_0x3562('0x9')](),controller[_0x3562('0xd')]);router[_0x3562('0xe')]('/',auth[_0x3562('0x9')](),controller[_0x3562('0xf')]);router[_0x3562('0x10')](_0x3562('0xc'),auth[_0x3562('0x9')](),controller[_0x3562('0x11')]);router[_0x3562('0x12')](_0x3562('0xc'),auth[_0x3562('0x9')](),controller[_0x3562('0x13')]);module['exports']=router;
\ No newline at end of file
index 998d5bb..669fc71 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(_0x120fd6,_0x2e72){var _0x4a0da7=function(_0x57c49b){while(--_0x57c49b){_0x120fd6['push'](_0x120fd6['shift']());}};_0x4a0da7(++_0x2e72);}(_0xedd9,0xfc));var _0x9edd=function(_0x17f5b4,_0x3716fa){_0x17f5b4=_0x17f5b4-0x0;var _0x37e3d6=_0xedd9[_0x17f5b4];return _0x37e3d6;};'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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x333ed9,_0x242aa7){var _0x34bd40=function(_0x971fb5){while(--_0x971fb5){_0x333ed9['push'](_0x333ed9['shift']());}};_0x34bd40(++_0x242aa7);}(_0x4b84,0x1cc));var _0x44b8=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0x4b84[_0x48c615];return _0x3d9e22;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index dba49ac..32458ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2aeb=['json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','end','error','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','key','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','params','catch','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x18a83f,_0x33ea94){var _0x41cfe8=function(_0x5c7e78){while(--_0x5c7e78){_0x18a83f['push'](_0x18a83f['shift']());}};_0x41cfe8(++_0x33ea94);}(_0x2aeb,0x11a));var _0xb2ae=function(_0x49da8a,_0x4f73ac){_0x49da8a=_0x49da8a-0x0;var _0x496523=_0x2aeb[_0x49da8a];return _0x496523;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2ae('0x0'));var zipdir=require(_0xb2ae('0x1'));var jsonpatch=require(_0xb2ae('0x2'));var rp=require('request-promise');var moment=require(_0xb2ae('0x3'));var BPromise=require(_0xb2ae('0x4'));var Mustache=require(_0xb2ae('0x5'));var util=require('util');var path=require(_0xb2ae('0x6'));var sox=require(_0xb2ae('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb2ae('0x8'));var _=require(_0xb2ae('0x9'));var squel=require(_0xb2ae('0xa'));var crypto=require(_0xb2ae('0xb'));var jsforce=require(_0xb2ae('0xc'));var deskjs=require(_0xb2ae('0xd'));var toCsv=require(_0xb2ae('0xe'));var querystring=require(_0xb2ae('0xf'));var Papa=require(_0xb2ae('0x10'));var Redis=require('ioredis');var authService=require(_0xb2ae('0x11'));var qs=require(_0xb2ae('0x12'));var as=require(_0xb2ae('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2ae('0x14'))(_0xb2ae('0x15'));var utils=require('../../config/utils');var config=require(_0xb2ae('0x16'));var licenseUtil=require(_0xb2ae('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x789bfa,_0x3ce8e3){_0x3ce8e3=_0x3ce8e3||0xcc;return function(_0x324ec6){if(_0x324ec6){return _0x789bfa[_0xb2ae('0x18')](_0x3ce8e3);}return _0x789bfa[_0xb2ae('0x19')](_0x3ce8e3)['end']();};}function respondWithResult(_0x53dffe,_0xc2b71a){_0xc2b71a=_0xc2b71a||0xc8;return function(_0x626f53){if(_0x626f53){return _0x53dffe[_0xb2ae('0x19')](_0xc2b71a)[_0xb2ae('0x1a')](_0x626f53);}};}function respondWithFilteredResult(_0x32553f,_0x53eeb6){return function(_0x55db3e){if(_0x55db3e){var _0x35f670=typeof _0x53eeb6['offset']==='undefined'&&typeof _0x53eeb6[_0xb2ae('0x1b')]===_0xb2ae('0x1c');var _0x49b06b=_0x55db3e[_0xb2ae('0x1d')];var _0x3f55ee=_0x35f670?0x0:_0x53eeb6[_0xb2ae('0x1e')];var _0x475830=_0x35f670?_0x55db3e[_0xb2ae('0x1d')]:_0x53eeb6['offset']+_0x53eeb6['limit'];var _0x24b6e3;if(_0x475830>=_0x49b06b){_0x475830=_0x49b06b;_0x24b6e3=0xc8;}else{_0x24b6e3=0xce;}_0x32553f['status'](_0x24b6e3);return _0x32553f[_0xb2ae('0x1f')](_0xb2ae('0x20'),_0x3f55ee+'-'+_0x475830+'/'+_0x49b06b)['json'](_0x55db3e);}return null;};}function patchUpdates(_0x4dcf77){return function(_0x2572ed){try{jsonpatch[_0xb2ae('0x21')](_0x2572ed,_0x4dcf77,!![]);}catch(_0x39bcd8){return BPromise[_0xb2ae('0x22')](_0x39bcd8);}return _0x2572ed[_0xb2ae('0x23')]();};}function saveUpdates(_0x141815,_0x4fa0e3){return function(_0x44b5d4){if(_0x44b5d4){return _0x44b5d4[_0xb2ae('0x24')](_0x141815)['then'](function(_0x2ad7ab){return _0x2ad7ab;});}return null;};}function removeEntity(_0x2bcdb8,_0x5c9521){return function(_0x38830a){if(_0x38830a){return _0x38830a['destroy']()['then'](function(){_0x2bcdb8[_0xb2ae('0x19')](0xcc)[_0xb2ae('0x25')]();});}};}function handleEntityNotFound(_0x2890c2,_0xb80bc5){return function(_0x2a868c){if(!_0x2a868c){_0x2890c2[_0xb2ae('0x18')](0x194);}return _0x2a868c;};}function handleError(_0x59f14f,_0xdfcf51){_0xdfcf51=_0xdfcf51||0x1f4;return function(_0x141ed1){logger[_0xb2ae('0x26')](_0x141ed1[_0xb2ae('0x27')]);if(_0x141ed1[_0xb2ae('0x28')]){delete _0x141ed1[_0xb2ae('0x28')];}_0x59f14f[_0xb2ae('0x19')](_0xdfcf51)['send'](_0x141ed1);};}exports[_0xb2ae('0x29')]=function(_0x2c1b1f,_0xfff0f6){var _0x1dd8be={},_0x299112={},_0x30fe24={'count':0x0,'rows':[]};var _0x55a85e=_[_0xb2ae('0x2a')](db[_0xb2ae('0x2b')][_0xb2ae('0x2c')],function(_0x116529){return{'name':_0x116529[_0xb2ae('0x2d')],'type':_0x116529['type'][_0xb2ae('0x2e')]};});_0x299112['model']=_['map'](_0x55a85e,'name');_0x299112['query']=_[_0xb2ae('0x2f')](_0x2c1b1f['query']);_0x299112[_0xb2ae('0x30')]=_[_0xb2ae('0x31')](_0x299112[_0xb2ae('0x32')],_0x299112['query']);_0x1dd8be[_0xb2ae('0x33')]=_['intersection'](_0x299112[_0xb2ae('0x32')],qs[_0xb2ae('0x34')](_0x2c1b1f[_0xb2ae('0x35')][_0xb2ae('0x34')]));_0x1dd8be['attributes']=_0x1dd8be[_0xb2ae('0x33')][_0xb2ae('0x36')]?_0x1dd8be['attributes']:_0x299112[_0xb2ae('0x32')];if(!_0x2c1b1f[_0xb2ae('0x35')][_0xb2ae('0x37')]('nolimit')){_0x1dd8be[_0xb2ae('0x1b')]=qs[_0xb2ae('0x1b')](_0x2c1b1f[_0xb2ae('0x35')]['limit']);_0x1dd8be[_0xb2ae('0x1e')]=qs['offset'](_0x2c1b1f[_0xb2ae('0x35')]['offset']);}_0x1dd8be[_0xb2ae('0x38')]=qs['sort'](_0x2c1b1f[_0xb2ae('0x35')][_0xb2ae('0x39')]);_0x1dd8be['where']=qs[_0xb2ae('0x30')](_[_0xb2ae('0x3a')](_0x2c1b1f['query'],_0x299112['filters']),_0x55a85e);if(_0x2c1b1f[_0xb2ae('0x35')][_0xb2ae('0x3b')]){_0x1dd8be[_0xb2ae('0x3c')]=_[_0xb2ae('0x3d')](_0x1dd8be[_0xb2ae('0x3c')],{'$or':_[_0xb2ae('0x2a')](_0x55a85e,function(_0x372e56){if(_0x372e56[_0xb2ae('0x3e')]!==_0xb2ae('0x3f')){var _0x31c7a3={};_0x31c7a3[_0x372e56['name']]={'$like':'%'+_0x2c1b1f[_0xb2ae('0x35')]['filter']+'%'};return _0x31c7a3;}})});}_0x1dd8be=_['merge']({},_0x1dd8be,_0x2c1b1f[_0xb2ae('0x40')]);var _0x21ca42={'where':_0x1dd8be[_0xb2ae('0x3c')]};return db[_0xb2ae('0x2b')][_0xb2ae('0x1d')](_0x21ca42)[_0xb2ae('0x41')](function(_0x251a72){_0x30fe24[_0xb2ae('0x1d')]=_0x251a72;if(_0x2c1b1f[_0xb2ae('0x35')][_0xb2ae('0x42')]){_0x1dd8be[_0xb2ae('0x43')]=[{'all':!![]}];}return db[_0xb2ae('0x2b')][_0xb2ae('0x44')](_0x1dd8be);})['then'](function(_0x55d89c){_0x30fe24[_0xb2ae('0x45')]=_0x55d89c;return _0x30fe24;})['then'](respondWithFilteredResult(_0xfff0f6,_0x1dd8be))['catch'](handleError(_0xfff0f6,null));};exports['show']=function(_0x14f9f4,_0x2b2f07){var _0x2ab6d8={'raw':!![],'where':{'id':_0x14f9f4[_0xb2ae('0x46')]['id']}},_0x5e3778={};_0x5e3778['model']=_[_0xb2ae('0x2f')](db[_0xb2ae('0x2b')][_0xb2ae('0x2c')]);_0x5e3778['query']=_[_0xb2ae('0x2f')](_0x14f9f4[_0xb2ae('0x35')]);_0x5e3778[_0xb2ae('0x30')]=_[_0xb2ae('0x31')](_0x5e3778[_0xb2ae('0x32')],_0x5e3778['query']);_0x2ab6d8[_0xb2ae('0x33')]=_[_0xb2ae('0x31')](_0x5e3778[_0xb2ae('0x32')],qs[_0xb2ae('0x34')](_0x14f9f4[_0xb2ae('0x35')][_0xb2ae('0x34')]));_0x2ab6d8['attributes']=_0x2ab6d8[_0xb2ae('0x33')][_0xb2ae('0x36')]?_0x2ab6d8['attributes']:_0x5e3778['model'];if(_0x14f9f4[_0xb2ae('0x35')][_0xb2ae('0x42')]){_0x2ab6d8[_0xb2ae('0x43')]=[{'all':!![]}];}_0x2ab6d8=_[_0xb2ae('0x3d')]({},_0x2ab6d8,_0x14f9f4[_0xb2ae('0x40')]);return db[_0xb2ae('0x2b')]['find'](_0x2ab6d8)[_0xb2ae('0x41')](handleEntityNotFound(_0x2b2f07,null))[_0xb2ae('0x41')](respondWithResult(_0x2b2f07,null))[_0xb2ae('0x47')](handleError(_0x2b2f07,null));};exports[_0xb2ae('0x48')]=function(_0xc2bebb,_0xc000f2){return db[_0xb2ae('0x2b')][_0xb2ae('0x48')](_0xc2bebb[_0xb2ae('0x49')],{})[_0xb2ae('0x41')](respondWithResult(_0xc000f2,0xc9))[_0xb2ae('0x47')](handleError(_0xc000f2,null));};exports[_0xb2ae('0x24')]=function(_0x1fd6de,_0x5e8428){if(_0x1fd6de[_0xb2ae('0x49')]['id']){delete _0x1fd6de[_0xb2ae('0x49')]['id'];}return db[_0xb2ae('0x2b')][_0xb2ae('0x4a')]({'where':{'id':_0x1fd6de[_0xb2ae('0x46')]['id']}})[_0xb2ae('0x41')](handleEntityNotFound(_0x5e8428,null))[_0xb2ae('0x41')](saveUpdates(_0x1fd6de[_0xb2ae('0x49')],null))[_0xb2ae('0x41')](respondWithResult(_0x5e8428,null))[_0xb2ae('0x47')](handleError(_0x5e8428,null));};exports[_0xb2ae('0x4b')]=function(_0x70b627,_0x4d95e1){return db[_0xb2ae('0x2b')][_0xb2ae('0x4a')]({'where':{'id':_0x70b627['params']['id']}})[_0xb2ae('0x41')](handleEntityNotFound(_0x4d95e1,null))['then'](removeEntity(_0x4d95e1,null))[_0xb2ae('0x47')](handleError(_0x4d95e1,null));};exports[_0xb2ae('0x4c')]=function(_0x4e5342,_0x38af02){return db[_0xb2ae('0x2b')][_0xb2ae('0x4c')]()[_0xb2ae('0x41')](respondWithResult(_0x38af02,null))[_0xb2ae('0x47')](handleError(_0x38af02,null));};
\ No newline at end of file
+var _0xe093=['index','map','rawAttributes','type','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','includeAll','findAll','rows','catch','show','intersection','find','create','body','params','describe','eml-format','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send'];(function(_0x4a395e,_0x22b300){var _0x4e9460=function(_0x90eaf9){while(--_0x90eaf9){_0x4a395e['push'](_0x4a395e['shift']());}};_0x4e9460(++_0x22b300);}(_0xe093,0x6f));var _0x3e09=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xe093[_0x45d3f0];return _0x314b79;};'use strict';var emlformat=require(_0x3e09('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e09('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3e09('0x2'));var BPromise=require(_0x3e09('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3e09('0x4'));var sox=require(_0x3e09('0x5'));var csv=require(_0x3e09('0x6'));var ejs=require(_0x3e09('0x7'));var fs=require('fs');var fs_extra=require(_0x3e09('0x8'));var _=require(_0x3e09('0x9'));var squel=require(_0x3e09('0xa'));var crypto=require(_0x3e09('0xb'));var jsforce=require(_0x3e09('0xc'));var deskjs=require(_0x3e09('0xd'));var toCsv=require(_0x3e09('0x6'));var querystring=require(_0x3e09('0xe'));var Papa=require(_0x3e09('0xf'));var Redis=require(_0x3e09('0x10'));var authService=require(_0x3e09('0x11'));var qs=require(_0x3e09('0x12'));var as=require(_0x3e09('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e09('0x14'))(_0x3e09('0x15'));var utils=require(_0x3e09('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3e09('0x17'));var db=require(_0x3e09('0x18'))['db'];function respondWithStatusCode(_0x751ed8,_0x23e7d8){_0x23e7d8=_0x23e7d8||0xcc;return function(_0x58f4c5){if(_0x58f4c5){return _0x751ed8[_0x3e09('0x19')](_0x23e7d8);}return _0x751ed8['status'](_0x23e7d8)[_0x3e09('0x1a')]();};}function respondWithResult(_0xc38809,_0x1c02f6){_0x1c02f6=_0x1c02f6||0xc8;return function(_0x55448a){if(_0x55448a){return _0xc38809[_0x3e09('0x1b')](_0x1c02f6)[_0x3e09('0x1c')](_0x55448a);}};}function respondWithFilteredResult(_0x368ce2,_0x19d5ca){return function(_0x5ac314){if(_0x5ac314){var _0x1e57c9=typeof _0x19d5ca[_0x3e09('0x1d')]==='undefined'&&typeof _0x19d5ca[_0x3e09('0x1e')]===_0x3e09('0x1f');var _0x35a20c=_0x5ac314[_0x3e09('0x20')];var _0x2b01c1=_0x1e57c9?0x0:_0x19d5ca[_0x3e09('0x1d')];var _0xe2c9a6=_0x1e57c9?_0x5ac314[_0x3e09('0x20')]:_0x19d5ca['offset']+_0x19d5ca[_0x3e09('0x1e')];var _0x30ec5e;if(_0xe2c9a6>=_0x35a20c){_0xe2c9a6=_0x35a20c;_0x30ec5e=0xc8;}else{_0x30ec5e=0xce;}_0x368ce2[_0x3e09('0x1b')](_0x30ec5e);return _0x368ce2[_0x3e09('0x21')](_0x3e09('0x22'),_0x2b01c1+'-'+_0xe2c9a6+'/'+_0x35a20c)[_0x3e09('0x1c')](_0x5ac314);}return null;};}function patchUpdates(_0x438cb6){return function(_0x16135f){try{jsonpatch[_0x3e09('0x23')](_0x16135f,_0x438cb6,!![]);}catch(_0x589154){return BPromise['reject'](_0x589154);}return _0x16135f[_0x3e09('0x24')]();};}function saveUpdates(_0x137cfa,_0x238816){return function(_0x42d713){if(_0x42d713){return _0x42d713[_0x3e09('0x25')](_0x137cfa)['then'](function(_0x381060){return _0x381060;});}return null;};}function removeEntity(_0x27b7e0,_0x25716b){return function(_0xa7111b){if(_0xa7111b){return _0xa7111b['destroy']()[_0x3e09('0x26')](function(){_0x27b7e0[_0x3e09('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2107d6,_0x39c10f){return function(_0x4e5a45){if(!_0x4e5a45){_0x2107d6['sendStatus'](0x194);}return _0x4e5a45;};}function handleError(_0x2ae7d8,_0x38115c){_0x38115c=_0x38115c||0x1f4;return function(_0x134e11){logger[_0x3e09('0x27')](_0x134e11[_0x3e09('0x28')]);if(_0x134e11[_0x3e09('0x29')]){delete _0x134e11[_0x3e09('0x29')];}_0x2ae7d8[_0x3e09('0x1b')](_0x38115c)[_0x3e09('0x2a')](_0x134e11);};}exports[_0x3e09('0x2b')]=function(_0x4b0710,_0x522cd6){var _0x301801={},_0x3e865d={},_0x38fdd5={'count':0x0,'rows':[]};var _0x1c0ebe=_[_0x3e09('0x2c')](db['MailTransferReport'][_0x3e09('0x2d')],function(_0x5c8142){return{'name':_0x5c8142['fieldName'],'type':_0x5c8142[_0x3e09('0x2e')][_0x3e09('0x2f')]};});_0x3e865d['model']=_['map'](_0x1c0ebe,_0x3e09('0x29'));_0x3e865d['query']=_[_0x3e09('0x30')](_0x4b0710[_0x3e09('0x31')]);_0x3e865d[_0x3e09('0x32')]=_['intersection'](_0x3e865d[_0x3e09('0x33')],_0x3e865d['query']);_0x301801[_0x3e09('0x34')]=_['intersection'](_0x3e865d['model'],qs[_0x3e09('0x35')](_0x4b0710[_0x3e09('0x31')][_0x3e09('0x35')]));_0x301801[_0x3e09('0x34')]=_0x301801[_0x3e09('0x34')][_0x3e09('0x36')]?_0x301801['attributes']:_0x3e865d['model'];if(!_0x4b0710[_0x3e09('0x31')][_0x3e09('0x37')](_0x3e09('0x38'))){_0x301801[_0x3e09('0x1e')]=qs[_0x3e09('0x1e')](_0x4b0710[_0x3e09('0x31')]['limit']);_0x301801[_0x3e09('0x1d')]=qs[_0x3e09('0x1d')](_0x4b0710[_0x3e09('0x31')]['offset']);}_0x301801[_0x3e09('0x39')]=qs[_0x3e09('0x3a')](_0x4b0710[_0x3e09('0x31')]['sort']);_0x301801['where']=qs[_0x3e09('0x32')](_[_0x3e09('0x3b')](_0x4b0710['query'],_0x3e865d[_0x3e09('0x32')]),_0x1c0ebe);if(_0x4b0710['query'][_0x3e09('0x3c')]){_0x301801[_0x3e09('0x3d')]=_[_0x3e09('0x3e')](_0x301801['where'],{'$or':_[_0x3e09('0x2c')](_0x1c0ebe,function(_0x3941f7){if(_0x3941f7['type']!==_0x3e09('0x3f')){var _0x38b339={};_0x38b339[_0x3941f7[_0x3e09('0x29')]]={'$like':'%'+_0x4b0710[_0x3e09('0x31')]['filter']+'%'};return _0x38b339;}})});}_0x301801=_['merge']({},_0x301801,_0x4b0710[_0x3e09('0x40')]);var _0x2bf3c8={'where':_0x301801[_0x3e09('0x3d')]};return db[_0x3e09('0x41')][_0x3e09('0x20')](_0x2bf3c8)[_0x3e09('0x26')](function(_0x1e54c9){_0x38fdd5['count']=_0x1e54c9;if(_0x4b0710['query'][_0x3e09('0x42')]){_0x301801['include']=[{'all':!![]}];}return db[_0x3e09('0x41')][_0x3e09('0x43')](_0x301801);})[_0x3e09('0x26')](function(_0x45042b){_0x38fdd5[_0x3e09('0x44')]=_0x45042b;return _0x38fdd5;})[_0x3e09('0x26')](respondWithFilteredResult(_0x522cd6,_0x301801))[_0x3e09('0x45')](handleError(_0x522cd6,null));};exports[_0x3e09('0x46')]=function(_0x5c9de9,_0xd58d18){var _0x4cefca={'raw':!![],'where':{'id':_0x5c9de9['params']['id']}},_0x1c03cc={};_0x1c03cc[_0x3e09('0x33')]=_[_0x3e09('0x30')](db['MailTransferReport'][_0x3e09('0x2d')]);_0x1c03cc[_0x3e09('0x31')]=_[_0x3e09('0x30')](_0x5c9de9['query']);_0x1c03cc['filters']=_[_0x3e09('0x47')](_0x1c03cc[_0x3e09('0x33')],_0x1c03cc[_0x3e09('0x31')]);_0x4cefca['attributes']=_[_0x3e09('0x47')](_0x1c03cc[_0x3e09('0x33')],qs[_0x3e09('0x35')](_0x5c9de9[_0x3e09('0x31')][_0x3e09('0x35')]));_0x4cefca[_0x3e09('0x34')]=_0x4cefca[_0x3e09('0x34')][_0x3e09('0x36')]?_0x4cefca[_0x3e09('0x34')]:_0x1c03cc[_0x3e09('0x33')];if(_0x5c9de9[_0x3e09('0x31')]['includeAll']){_0x4cefca['include']=[{'all':!![]}];}_0x4cefca=_['merge']({},_0x4cefca,_0x5c9de9['options']);return db[_0x3e09('0x41')][_0x3e09('0x48')](_0x4cefca)[_0x3e09('0x26')](handleEntityNotFound(_0xd58d18,null))['then'](respondWithResult(_0xd58d18,null))[_0x3e09('0x45')](handleError(_0xd58d18,null));};exports[_0x3e09('0x49')]=function(_0x6437de,_0x11b7fb){return db[_0x3e09('0x41')][_0x3e09('0x49')](_0x6437de['body'],{})[_0x3e09('0x26')](respondWithResult(_0x11b7fb,0xc9))['catch'](handleError(_0x11b7fb,null));};exports['update']=function(_0x6d4245,_0x43fc9f){if(_0x6d4245['body']['id']){delete _0x6d4245[_0x3e09('0x4a')]['id'];}return db[_0x3e09('0x41')][_0x3e09('0x48')]({'where':{'id':_0x6d4245[_0x3e09('0x4b')]['id']}})[_0x3e09('0x26')](handleEntityNotFound(_0x43fc9f,null))[_0x3e09('0x26')](saveUpdates(_0x6d4245[_0x3e09('0x4a')],null))[_0x3e09('0x26')](respondWithResult(_0x43fc9f,null))[_0x3e09('0x45')](handleError(_0x43fc9f,null));};exports['destroy']=function(_0xbc21eb,_0x21ae2f){return db[_0x3e09('0x41')][_0x3e09('0x48')]({'where':{'id':_0xbc21eb['params']['id']}})[_0x3e09('0x26')](handleEntityNotFound(_0x21ae2f,null))[_0x3e09('0x26')](removeEntity(_0x21ae2f,null))[_0x3e09('0x45')](handleError(_0x21ae2f,null));};exports[_0x3e09('0x4c')]=function(_0x1ab7b3,_0x9884e0){return db[_0x3e09('0x41')][_0x3e09('0x4c')]()[_0x3e09('0x26')](respondWithResult(_0x9884e0,null))['catch'](handleError(_0x9884e0,null));};
\ No newline at end of file
index 902d8f1..1e9f7ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x181d=['uniqueid','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','MailTransferReport','report_mail_transfer'];(function(_0x3ddce0,_0x11741e){var _0x567d64=function(_0x29a45b){while(--_0x29a45b){_0x3ddce0['push'](_0x3ddce0['shift']());}};_0x567d64(++_0x11741e);}(_0x181d,0x10f));var _0xd181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x181d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd181('0x0'))('api');var moment=require(_0xd181('0x1'));var BPromise=require(_0xd181('0x2'));var rp=require(_0xd181('0x3'));var fs=require('fs');var path=require(_0xd181('0x4'));var rimraf=require('rimraf');var config=require(_0xd181('0x5'));var attributes=require(_0xd181('0x6'));module['exports']=function(_0x4a92e1,_0x1ceb30){return _0x4a92e1['define'](_0xd181('0x7'),attributes,{'tableName':_0xd181('0x8'),'paranoid':![],'indexes':[{'name':_0xd181('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6a6=['uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','MailTransferReport','report_mail_transfer'];(function(_0x497a85,_0x2bd7cf){var _0x33207e=function(_0x56e9ec){while(--_0x56e9ec){_0x497a85['push'](_0x497a85['shift']());}};_0x33207e(++_0x2bd7cf);}(_0xb6a6,0x1ed));var _0x6b6a=function(_0x556ccf,_0x6f9fca){_0x556ccf=_0x556ccf-0x0;var _0x4276b4=_0xb6a6[_0x556ccf];return _0x4276b4;};'use strict';var _=require('lodash');var util=require(_0x6b6a('0x0'));var logger=require(_0x6b6a('0x1'))(_0x6b6a('0x2'));var moment=require(_0x6b6a('0x3'));var BPromise=require('bluebird');var rp=require(_0x6b6a('0x4'));var fs=require('fs');var path=require(_0x6b6a('0x5'));var rimraf=require(_0x6b6a('0x6'));var config=require(_0x6b6a('0x7'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0xb5bba7,_0x46fc69){return _0xb5bba7[_0x6b6a('0x8')](_0x6b6a('0x9'),attributes,{'tableName':_0x6b6a('0xa'),'paranoid':![],'indexes':[{'name':_0x6b6a('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 37fd805..b0baf15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20c9=['then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2f89dc,_0x326a2c){var _0x1ef443=function(_0x532e5f){while(--_0x532e5f){_0x2f89dc['push'](_0x2f89dc['shift']());}};_0x1ef443(++_0x326a2c);}(_0x20c9,0x1d7));var _0x920c=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x20c9[_0x217c2e];return _0x22b7d8;};'use strict';var _=require(_0x920c('0x0'));var util=require(_0x920c('0x1'));var moment=require(_0x920c('0x2'));var BPromise=require('bluebird');var rs=require(_0x920c('0x3'));var fs=require('fs');var Redis=require(_0x920c('0x4'));var db=require(_0x920c('0x5'))['db'];var utils=require(_0x920c('0x6'));var logger=require(_0x920c('0x7'))(_0x920c('0x8'));var config=require(_0x920c('0x9'));var jayson=require(_0x920c('0xa'));var client=jayson['client'][_0x920c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5421ae,_0x24463c,_0x4dff39){return new BPromise(function(_0x3b27fe,_0x4c8e47){return client[_0x920c('0xc')](_0x5421ae,_0x4dff39)[_0x920c('0xd')](function(_0x1296f1){logger[_0x920c('0xe')](_0x920c('0xf'),_0x24463c,'request\x20sent');logger[_0x920c('0x10')](_0x920c('0x11'),_0x24463c,_0x920c('0x12'),JSON['stringify'](_0x1296f1));if(_0x1296f1['error']){if(_0x1296f1[_0x920c('0x13')]['code']===0x1f4){logger[_0x920c('0x13')](_0x920c('0xf'),_0x24463c,_0x1296f1['error'][_0x920c('0x14')]);return _0x4c8e47(_0x1296f1[_0x920c('0x13')]['message']);}logger[_0x920c('0x13')](_0x920c('0xf'),_0x24463c,_0x1296f1[_0x920c('0x13')][_0x920c('0x14')]);return _0x3b27fe(_0x1296f1[_0x920c('0x13')][_0x920c('0x14')]);}else{logger[_0x920c('0xe')](_0x920c('0xf'),_0x24463c,'request\x20sent');_0x3b27fe(_0x1296f1[_0x920c('0x15')]['message']);}})['catch'](function(_0x5b95cd){logger[_0x920c('0x13')](_0x920c('0xf'),_0x24463c,_0x5b95cd);_0x4c8e47(_0x5b95cd);});});}
\ No newline at end of file
+var _0x34be=['code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x34be,0x191));var _0xe34b=function(_0x3d5f84,_0x569548){_0x3d5f84=_0x3d5f84-0x0;var _0x1981b8=_0x34be[_0x3d5f84];return _0x1981b8;};'use strict';var _=require(_0xe34b('0x0'));var util=require(_0xe34b('0x1'));var moment=require(_0xe34b('0x2'));var BPromise=require('bluebird');var rs=require(_0xe34b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe34b('0x4'))['db'];var utils=require(_0xe34b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe34b('0x6'));var jayson=require(_0xe34b('0x7'));var client=jayson[_0xe34b('0x8')][_0xe34b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x296a65,_0x53c56c,_0x281d9e){return new BPromise(function(_0x3951c8,_0x532724){return client[_0xe34b('0xa')](_0x296a65,_0x281d9e)[_0xe34b('0xb')](function(_0x15d400){logger['info'](_0xe34b('0xc'),_0x53c56c,_0xe34b('0xd'));logger[_0xe34b('0xe')](_0xe34b('0xf'),_0x53c56c,_0xe34b('0xd'),JSON['stringify'](_0x15d400));if(_0x15d400['error']){if(_0x15d400[_0xe34b('0x10')][_0xe34b('0x11')]===0x1f4){logger[_0xe34b('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x53c56c,_0x15d400[_0xe34b('0x10')][_0xe34b('0x12')]);return _0x532724(_0x15d400['error'][_0xe34b('0x12')]);}logger['error'](_0xe34b('0xc'),_0x53c56c,_0x15d400[_0xe34b('0x10')][_0xe34b('0x12')]);return _0x3951c8(_0x15d400[_0xe34b('0x10')]['message']);}else{logger[_0xe34b('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x53c56c,_0xe34b('0xd'));_0x3951c8(_0x15d400[_0xe34b('0x14')]['message']);}})[_0xe34b('0x15')](function(_0xb44162){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x53c56c,_0xb44162);_0x532724(_0xb44162);});});}
\ No newline at end of file
index 0a31a30..4add836 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x026c=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','update','delete','destroy','exports','util','path'];(function(_0x1a45e3,_0x385589){var _0x3615f8=function(_0x40ce0a){while(--_0x40ce0a){_0x1a45e3['push'](_0x1a45e3['shift']());}};_0x3615f8(++_0x385589);}(_0x026c,0x142));var _0xc026=function(_0xb9fe33,_0x47a545){_0xb9fe33=_0xb9fe33-0x0;var _0x15f7c2=_0x026c[_0xb9fe33];return _0x15f7c2;};'use strict';var multer=require('multer');var util=require(_0xc026('0x0'));var path=require(_0xc026('0x1'));var timeout=require(_0xc026('0x2'));var express=require(_0xc026('0x3'));var router=express[_0xc026('0x4')]();var fs_extra=require(_0xc026('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc026('0x6'));var config=require(_0xc026('0x7'));var controller=require('./memberReport.controller');router[_0xc026('0x8')]('/',auth[_0xc026('0x9')](),controller['index']);router[_0xc026('0x8')](_0xc026('0xa'),auth['isAuthenticated'](),controller[_0xc026('0xb')]);router[_0xc026('0x8')](_0xc026('0xc'),auth[_0xc026('0x9')](),controller['show']);router['post']('/',auth[_0xc026('0x9')](),controller[_0xc026('0xd')]);router['put'](_0xc026('0xc'),auth[_0xc026('0x9')](),controller[_0xc026('0xe')]);router[_0xc026('0xf')](_0xc026('0xc'),auth[_0xc026('0x9')](),controller[_0xc026('0x10')]);module[_0xc026('0x11')]=router;
\ No newline at end of file
+var _0xe183=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1ff8b7,_0x32a351){var _0x1aa938=function(_0x3fab97){while(--_0x3fab97){_0x1ff8b7['push'](_0x1ff8b7['shift']());}};_0x1aa938(++_0x32a351);}(_0xe183,0x1c4));var _0x3e18=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0xe183[_0x54b283];return _0x2462b3;};'use strict';var multer=require(_0x3e18('0x0'));var util=require(_0x3e18('0x1'));var path=require(_0x3e18('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e18('0x3'));var router=express[_0x3e18('0x4')]();var fs_extra=require(_0x3e18('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3e18('0x6'));var config=require(_0x3e18('0x7'));var controller=require('./memberReport.controller');router[_0x3e18('0x8')]('/',auth[_0x3e18('0x9')](),controller[_0x3e18('0xa')]);router[_0x3e18('0x8')](_0x3e18('0xb'),auth[_0x3e18('0x9')](),controller[_0x3e18('0xc')]);router[_0x3e18('0x8')](_0x3e18('0xd'),auth['isAuthenticated'](),controller[_0x3e18('0xe')]);router[_0x3e18('0xf')]('/',auth[_0x3e18('0x9')](),controller[_0x3e18('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3e18('0x11')]);router['delete'](_0x3e18('0xd'),auth[_0x3e18('0x9')](),controller[_0x3e18('0x12')]);module[_0x3e18('0x13')]=router;
\ No newline at end of file
index 6085d2f..fed35bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d30=['getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x1d30,0x15e));var _0x01d3=function(_0x25f808,_0x1e7681){_0x25f808=_0x25f808-0x0;var _0x4f0ae8=_0x1d30[_0x25f808];return _0x4f0ae8;};'use strict';var Sequelize=require(_0x01d3('0x0'));var moment=require('moment');module[_0x01d3('0x1')]={'channel':{'type':Sequelize[_0x01d3('0x2')]},'membername':{'type':Sequelize[_0x01d3('0x2')]},'interface':{'type':Sequelize[_0x01d3('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x01d3('0x3'),'comment':_0x01d3('0x4')},'duration':{'type':Sequelize[_0x01d3('0x5')]},'enterAt':{'type':Sequelize[_0x01d3('0x6')]},'exitAt':{'type':Sequelize[_0x01d3('0x6')],'set':function(_0x5a5a14){var _0x11d63d=moment(_0x5a5a14);var _0x2cfe46=moment(this[_0x01d3('0x7')](_0x01d3('0x8')));var _0xb539fb=_0x11d63d[_0x01d3('0x9')](_0x2cfe46,_0x01d3('0xa'));this[_0x01d3('0xb')](_0x01d3('0xc'),_0x5a5a14);this['setDataValue'](_0x01d3('0xd'),_0xb539fb>=0x0?_0xb539fb:null);}},'data1':{'type':Sequelize[_0x01d3('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x01d3('0x2')],'comment':_0x01d3('0xe')},'data3':{'type':Sequelize[_0x01d3('0x2')],'comment':_0x01d3('0xf')},'data4':{'type':Sequelize[_0x01d3('0x2')],'comment':_0x01d3('0x10')},'data5':{'type':Sequelize[_0x01d3('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x01d3('0x5')]},'uniqueid':{'type':Sequelize[_0x01d3('0x2')]}};
\ No newline at end of file
+var _0x84c1=['talk:[queue]','moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','talk:[start]','talk:[dial\x20string]'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x84c1,0x15d));var _0x184c=function(_0x177cae,_0x3246d9){_0x177cae=_0x177cae-0x0;var _0x409a7c=_0x84c1[_0x177cae];return _0x409a7c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x184c('0x0'));module['exports']={'channel':{'type':Sequelize[_0x184c('0x1')]},'membername':{'type':Sequelize[_0x184c('0x1')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x184c('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x184c('0x3')]},'enterAt':{'type':Sequelize[_0x184c('0x4')]},'exitAt':{'type':Sequelize[_0x184c('0x4')],'set':function(_0x2dada6){var _0x53ebf5=moment(_0x2dada6);var _0xbaaee8=moment(this[_0x184c('0x5')]('enterAt'));var _0x32ebce=_0x53ebf5[_0x184c('0x6')](_0xbaaee8,_0x184c('0x7'));this[_0x184c('0x8')]('exitAt',_0x2dada6);this[_0x184c('0x8')]('duration',_0x32ebce>=0x0?_0x32ebce:null);}},'data1':{'type':Sequelize[_0x184c('0x1')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x184c('0x1')],'comment':_0x184c('0x9')},'data3':{'type':Sequelize[_0x184c('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0x184c('0xa')},'data5':{'type':Sequelize[_0x184c('0x1')],'comment':_0x184c('0xb')},'role':{'type':Sequelize[_0x184c('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x184c('0x1')]}};
\ No newline at end of file
index a892928..1b475c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0xccf2c8,_0x448f50){var _0x363c76=function(_0x445bff){while(--_0x445bff){_0xccf2c8['push'](_0xccf2c8['shift']());}};_0x363c76(++_0x448f50);}(_0x3e74,0x175));var _0x43e7=function(_0x3e7ad0,_0x2bbed4){_0x3e7ad0=_0x3e7ad0-0x0;var _0x41f46e=_0x3e74[_0x3e7ad0];return _0x41f46e;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));};
\ No newline at end of file
+var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0x34e8,0x12c));var _0x834e=function(_0x3615d7,_0x45d90b){_0x3615d7=_0x3615d7-0x0;var _0x4b7de7=_0x34e8[_0x3615d7];return _0x4b7de7;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));};
\ No newline at end of file
index 7aa31cc..cddb02d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['membername_interface','membername','interface','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports','define','report_member'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fc3,0xa8));var _0x35fc=function(_0x48d6a3,_0x37c848){_0x48d6a3=_0x48d6a3-0x0;var _0x38bfa0=_0x5fc3[_0x48d6a3];return _0x38bfa0;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('MemberReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xd'),_0x35fc('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9cae=['request-promise','../../config/environment','exports','MemberReport','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird'];(function(_0x5aa93,_0x4b8358){var _0xde7fce=function(_0x1c089e){while(--_0x1c089e){_0x5aa93['push'](_0x5aa93['shift']());}};_0xde7fce(++_0x4b8358);}(_0x9cae,0xeb));var _0xe9ca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9cae[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe9ca('0x0'));var logger=require(_0xe9ca('0x1'))(_0xe9ca('0x2'));var moment=require(_0xe9ca('0x3'));var BPromise=require(_0xe9ca('0x4'));var rp=require(_0xe9ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe9ca('0x6'));var attributes=require('./memberReport.attributes');module[_0xe9ca('0x7')]=function(_0x3e943f,_0x5ea761){return _0x3e943f['define'](_0xe9ca('0x8'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xe9ca('0x9'),'fields':[_0xe9ca('0xa'),_0xe9ca('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index d3e6aa2..dfc8b98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b1=['update','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','http','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','info','result','catch','GetMemberReport','findAll','options','raw','attributes','limit','include','map','model','then','debug','CreateMemberReport','MemberReport','create','body','UpdateMemberReport'];(function(_0xdddc0f,_0x34dd3d){var _0x21a019=function(_0x420cbb){while(--_0x420cbb){_0xdddc0f['push'](_0xdddc0f['shift']());}};_0x21a019(++_0x34dd3d);}(_0xd8b1,0x105));var _0x1d8b=function(_0x29ede1,_0x1b7421){_0x29ede1=_0x29ede1-0x0;var _0xe09d8e=_0xd8b1[_0x29ede1];return _0xe09d8e;};'use strict';var _=require(_0x1d8b('0x0'));var util=require(_0x1d8b('0x1'));var moment=require(_0x1d8b('0x2'));var BPromise=require(_0x1d8b('0x3'));var rs=require(_0x1d8b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d8b('0x5'))['db'];var utils=require(_0x1d8b('0x6'));var logger=require('../../config/logger')(_0x1d8b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f5bbd,_0x3eb93a,_0xdba2e5){return new BPromise(function(_0x2b28e2,_0x4480cf){return client['request'](_0x5f5bbd,_0xdba2e5)['then'](function(_0x28be45){logger['info']('MemberReport,\x20%s,\x20%s',_0x3eb93a,_0x1d8b('0x9'));logger['debug'](_0x1d8b('0xa'),_0x3eb93a,'request\x20sent',JSON[_0x1d8b('0xb')](_0x28be45));if(_0x28be45[_0x1d8b('0xc')]){if(_0x28be45[_0x1d8b('0xc')][_0x1d8b('0xd')]===0x1f4){logger[_0x1d8b('0xc')](_0x1d8b('0xe'),_0x3eb93a,_0x28be45['error'][_0x1d8b('0xf')]);return _0x4480cf(_0x28be45[_0x1d8b('0xc')][_0x1d8b('0xf')]);}logger[_0x1d8b('0xc')](_0x1d8b('0xe'),_0x3eb93a,_0x28be45[_0x1d8b('0xc')][_0x1d8b('0xf')]);return _0x2b28e2(_0x28be45[_0x1d8b('0xc')]['message']);}else{logger[_0x1d8b('0x10')](_0x1d8b('0xe'),_0x3eb93a,_0x1d8b('0x9'));_0x2b28e2(_0x28be45[_0x1d8b('0x11')][_0x1d8b('0xf')]);}})[_0x1d8b('0x12')](function(_0x144556){logger['error']('MemberReport,\x20%s,\x20%s',_0x3eb93a,_0x144556);_0x4480cf(_0x144556);});});}exports[_0x1d8b('0x13')]=function(_0x100a9b){var _0x3710b2=this;return new Promise(function(_0x1b6440,_0x41b6fe){return db['MemberReport'][_0x1d8b('0x14')]({'raw':_0x100a9b[_0x1d8b('0x15')]?_0x100a9b['options'][_0x1d8b('0x16')]===undefined?!![]:![]:!![],'where':_0x100a9b[_0x1d8b('0x15')]?_0x100a9b[_0x1d8b('0x15')]['where']||null:null,'attributes':_0x100a9b[_0x1d8b('0x15')]?_0x100a9b[_0x1d8b('0x15')][_0x1d8b('0x17')]||null:null,'limit':_0x100a9b[_0x1d8b('0x15')]?_0x100a9b[_0x1d8b('0x15')][_0x1d8b('0x18')]||null:null,'include':_0x100a9b[_0x1d8b('0x15')]?_0x100a9b['options'][_0x1d8b('0x19')]?_[_0x1d8b('0x1a')](_0x100a9b[_0x1d8b('0x15')][_0x1d8b('0x19')],function(_0x5235b6){return{'model':db[_0x5235b6['model']],'as':_0x5235b6['as'],'attributes':_0x5235b6[_0x1d8b('0x17')],'include':_0x5235b6[_0x1d8b('0x19')]?_['map'](_0x5235b6[_0x1d8b('0x19')],function(_0x461405){return{'model':db[_0x461405['model']],'as':_0x461405['as'],'attributes':_0x461405['attributes'],'include':_0x461405[_0x1d8b('0x19')]?_[_0x1d8b('0x1a')](_0x461405[_0x1d8b('0x19')],function(_0xe76d45){return{'model':db[_0xe76d45[_0x1d8b('0x1b')]],'as':_0xe76d45['as'],'attributes':_0xe76d45[_0x1d8b('0x17')]};}):[]};}):[]};}):[]:[]})[_0x1d8b('0x1c')](function(_0x59d3bf){logger[_0x1d8b('0x10')]('GetMemberReport',_0x100a9b);logger[_0x1d8b('0x1d')]('GetMemberReport',_0x100a9b,JSON[_0x1d8b('0xb')](_0x59d3bf));_0x1b6440(_0x59d3bf);})[_0x1d8b('0x12')](function(_0x14928e){logger[_0x1d8b('0xc')]('GetMemberReport',_0x14928e['message'],_0x100a9b);_0x41b6fe(_0x3710b2[_0x1d8b('0xc')](0x1f4,_0x14928e[_0x1d8b('0xf')]));});});};exports[_0x1d8b('0x1e')]=function(_0xb8a9d){var _0x2305d8=this;return new Promise(function(_0x38a747,_0x505435){return db[_0x1d8b('0x1f')][_0x1d8b('0x20')](_0xb8a9d[_0x1d8b('0x21')],{'raw':_0xb8a9d[_0x1d8b('0x15')]?_0xb8a9d[_0x1d8b('0x15')][_0x1d8b('0x16')]===undefined?!![]:![]:!![]})[_0x1d8b('0x1c')](function(_0x352c3f){logger[_0x1d8b('0x10')]('CreateMemberReport',_0xb8a9d);logger[_0x1d8b('0x1d')]('CreateMemberReport',_0xb8a9d,JSON['stringify'](_0x352c3f));_0x38a747(_0x352c3f);})['catch'](function(_0x25a4db){logger[_0x1d8b('0xc')](_0x1d8b('0x1e'),_0x25a4db[_0x1d8b('0xf')],_0xb8a9d);_0x505435(_0x2305d8[_0x1d8b('0xc')](0x1f4,_0x25a4db['message']));});});};exports[_0x1d8b('0x22')]=function(_0x12822b){var _0x1bb100=this;return new Promise(function(_0xd18d69,_0x32dbba){return db[_0x1d8b('0x1f')][_0x1d8b('0x23')](_0x12822b[_0x1d8b('0x21')],{'raw':_0x12822b['options']?_0x12822b[_0x1d8b('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12822b[_0x1d8b('0x15')]?_0x12822b['options'][_0x1d8b('0x24')]||null:null,'attributes':_0x12822b[_0x1d8b('0x15')]?_0x12822b[_0x1d8b('0x15')]['attributes']||null:null,'limit':_0x12822b[_0x1d8b('0x15')]?_0x12822b[_0x1d8b('0x15')][_0x1d8b('0x18')]||null:null})[_0x1d8b('0x1c')](function(_0x5e1f52){logger[_0x1d8b('0x10')](_0x1d8b('0x22'),_0x12822b);logger['debug'](_0x1d8b('0x22'),_0x12822b,JSON['stringify'](_0x5e1f52));_0xd18d69(_0x5e1f52);})['catch'](function(_0x59b7ee){logger[_0x1d8b('0xc')](_0x1d8b('0x22'),_0x59b7ee[_0x1d8b('0xf')],_0x12822b);_0x32dbba(_0x1bb100[_0x1d8b('0xc')](0x1f4,_0x59b7ee[_0x1d8b('0xf')]));});});};
\ No newline at end of file
+var _0x3fa4=['MemberReport,\x20%s,\x20%s','result','catch','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','CreateMemberReport','body','UpdateMemberReport','update','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3fa4,0xf0));var _0x43fa=function(_0x242d6d,_0x472a00){_0x242d6d=_0x242d6d-0x0;var _0x50e882=_0x3fa4[_0x242d6d];return _0x50e882;};'use strict';var _=require(_0x43fa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43fa('0x1'));var fs=require('fs');var Redis=require(_0x43fa('0x2'));var db=require(_0x43fa('0x3'))['db'];var utils=require(_0x43fa('0x4'));var logger=require(_0x43fa('0x5'))(_0x43fa('0x6'));var config=require(_0x43fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x43fa('0x8')][_0x43fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6df71c,_0x584209,_0x3dc891){return new BPromise(function(_0x46adc7,_0x1dc401){return client['request'](_0x6df71c,_0x3dc891)[_0x43fa('0xa')](function(_0x36d40d){logger['info']('MemberReport,\x20%s,\x20%s',_0x584209,_0x43fa('0xb'));logger[_0x43fa('0xc')](_0x43fa('0xd'),_0x584209,_0x43fa('0xb'),JSON[_0x43fa('0xe')](_0x36d40d));if(_0x36d40d['error']){if(_0x36d40d[_0x43fa('0xf')][_0x43fa('0x10')]===0x1f4){logger[_0x43fa('0xf')]('MemberReport,\x20%s,\x20%s',_0x584209,_0x36d40d[_0x43fa('0xf')][_0x43fa('0x11')]);return _0x1dc401(_0x36d40d[_0x43fa('0xf')]['message']);}logger[_0x43fa('0xf')]('MemberReport,\x20%s,\x20%s',_0x584209,_0x36d40d['error']['message']);return _0x46adc7(_0x36d40d[_0x43fa('0xf')]['message']);}else{logger[_0x43fa('0x12')](_0x43fa('0x13'),_0x584209,'request\x20sent');_0x46adc7(_0x36d40d[_0x43fa('0x14')][_0x43fa('0x11')]);}})[_0x43fa('0x15')](function(_0x2439d4){logger[_0x43fa('0xf')](_0x43fa('0x13'),_0x584209,_0x2439d4);_0x1dc401(_0x2439d4);});});}exports['GetMemberReport']=function(_0x479d81){var _0x1c98bb=this;return new Promise(function(_0x29b8aa,_0x1c2463){return db[_0x43fa('0x16')][_0x43fa('0x17')]({'raw':_0x479d81[_0x43fa('0x18')]?_0x479d81[_0x43fa('0x18')][_0x43fa('0x19')]===undefined?!![]:![]:!![],'where':_0x479d81[_0x43fa('0x18')]?_0x479d81['options'][_0x43fa('0x1a')]||null:null,'attributes':_0x479d81[_0x43fa('0x18')]?_0x479d81[_0x43fa('0x18')][_0x43fa('0x1b')]||null:null,'limit':_0x479d81[_0x43fa('0x18')]?_0x479d81['options'][_0x43fa('0x1c')]||null:null,'include':_0x479d81[_0x43fa('0x18')]?_0x479d81[_0x43fa('0x18')][_0x43fa('0x1d')]?_[_0x43fa('0x1e')](_0x479d81[_0x43fa('0x18')][_0x43fa('0x1d')],function(_0x241948){return{'model':db[_0x241948[_0x43fa('0x1f')]],'as':_0x241948['as'],'attributes':_0x241948['attributes'],'include':_0x241948['include']?_[_0x43fa('0x1e')](_0x241948[_0x43fa('0x1d')],function(_0x28f695){return{'model':db[_0x28f695[_0x43fa('0x1f')]],'as':_0x28f695['as'],'attributes':_0x28f695[_0x43fa('0x1b')],'include':_0x28f695[_0x43fa('0x1d')]?_['map'](_0x28f695['include'],function(_0x1fa077){return{'model':db[_0x1fa077[_0x43fa('0x1f')]],'as':_0x1fa077['as'],'attributes':_0x1fa077[_0x43fa('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x43fa('0xa')](function(_0x573261){logger[_0x43fa('0x12')](_0x43fa('0x20'),_0x479d81);logger[_0x43fa('0xc')](_0x43fa('0x20'),_0x479d81,JSON['stringify'](_0x573261));_0x29b8aa(_0x573261);})[_0x43fa('0x15')](function(_0x44fdef){logger[_0x43fa('0xf')](_0x43fa('0x20'),_0x44fdef[_0x43fa('0x11')],_0x479d81);_0x1c2463(_0x1c98bb[_0x43fa('0xf')](0x1f4,_0x44fdef[_0x43fa('0x11')]));});});};exports[_0x43fa('0x21')]=function(_0xd383ff){var _0x2662f1=this;return new Promise(function(_0x3ef547,_0x218643){return db['MemberReport']['create'](_0xd383ff[_0x43fa('0x22')],{'raw':_0xd383ff[_0x43fa('0x18')]?_0xd383ff[_0x43fa('0x18')][_0x43fa('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xd8db16){logger[_0x43fa('0x12')](_0x43fa('0x21'),_0xd383ff);logger['debug'](_0x43fa('0x21'),_0xd383ff,JSON[_0x43fa('0xe')](_0xd8db16));_0x3ef547(_0xd8db16);})[_0x43fa('0x15')](function(_0x7be71){logger['error'](_0x43fa('0x21'),_0x7be71['message'],_0xd383ff);_0x218643(_0x2662f1[_0x43fa('0xf')](0x1f4,_0x7be71[_0x43fa('0x11')]));});});};exports[_0x43fa('0x23')]=function(_0x4e06e0){var _0x383fee=this;return new Promise(function(_0x52d4e5,_0x564dd9){return db[_0x43fa('0x16')][_0x43fa('0x24')](_0x4e06e0[_0x43fa('0x22')],{'raw':_0x4e06e0['options']?_0x4e06e0[_0x43fa('0x18')][_0x43fa('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e06e0[_0x43fa('0x18')]?_0x4e06e0[_0x43fa('0x18')][_0x43fa('0x1a')]||null:null,'attributes':_0x4e06e0['options']?_0x4e06e0[_0x43fa('0x18')][_0x43fa('0x1b')]||null:null,'limit':_0x4e06e0[_0x43fa('0x18')]?_0x4e06e0[_0x43fa('0x18')]['limit']||null:null})['then'](function(_0x3a4f62){logger[_0x43fa('0x12')](_0x43fa('0x23'),_0x4e06e0);logger[_0x43fa('0xc')](_0x43fa('0x23'),_0x4e06e0,JSON['stringify'](_0x3a4f62));_0x52d4e5(_0x3a4f62);})[_0x43fa('0x15')](function(_0x578688){logger['error'](_0x43fa('0x23'),_0x578688['message'],_0x4e06e0);_0x564dd9(_0x383fee[_0x43fa('0xf')](0x1f4,_0x578688[_0x43fa('0x11')]));});});};
\ No newline at end of file
index 21f4ff4..3a7ff8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd59d=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','index','exports','multer','path','connect-timeout'];(function(_0x255dd6,_0x1f5603){var _0x3ea7e0=function(_0x33a593){while(--_0x33a593){_0x255dd6['push'](_0x255dd6['shift']());}};_0x3ea7e0(++_0x1f5603);}(_0xd59d,0x81));var _0xdd59=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0xd59d[_0x1aba25];return _0x47d997;};'use strict';var multer=require(_0xdd59('0x0'));var util=require('util');var path=require(_0xdd59('0x1'));var timeout=require(_0xdd59('0x2'));var express=require(_0xdd59('0x3'));var router=express[_0xdd59('0x4')]();var fs_extra=require(_0xdd59('0x5'));var auth=require(_0xdd59('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdd59('0x7'));var controller=require(_0xdd59('0x8'));router['get']('/',controller[_0xdd59('0x9')]);module[_0xdd59('0xa')]=router;
\ No newline at end of file
+var _0x2028=['get','index','exports','path','express','Router','fs-extra','../../components/interaction/service','./migration.controller'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x2028,0x1e0));var _0x8202=function(_0x8708df,_0x33a15f){_0x8708df=_0x8708df-0x0;var _0x1a6731=_0x2028[_0x8708df];return _0x1a6731;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8202('0x0'));var timeout=require('connect-timeout');var express=require(_0x8202('0x1'));var router=express[_0x8202('0x2')]();var fs_extra=require(_0x8202('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8202('0x4'));var config=require('../../config/environment');var controller=require(_0x8202('0x5'));router[_0x8202('0x6')]('/',controller[_0x8202('0x7')]);module[_0x8202('0x8')]=router;
\ No newline at end of file
index 1cd38e3..609b19d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f49=['STRING','sequelize','exports'];(function(_0x4900de,_0x3d9e92){var _0x297061=function(_0x5361a9){while(--_0x5361a9){_0x4900de['push'](_0x4900de['shift']());}};_0x297061(++_0x3d9e92);}(_0x2f49,0xdc));var _0x92f4=function(_0x272312,_0x564896){_0x272312=_0x272312-0x0;var _0x3345c3=_0x2f49[_0x272312];return _0x3345c3;};'use strict';var Sequelize=require(_0x92f4('0x0'));module[_0x92f4('0x1')]={'version':{'type':Sequelize[_0x92f4('0x2')],'unique':'version'}};
\ No newline at end of file
+var _0x7b2d=['exports','STRING','version'];(function(_0x893a2,_0x1b01db){var _0x5d78bb=function(_0x329e1f){while(--_0x329e1f){_0x893a2['push'](_0x893a2['shift']());}};_0x5d78bb(++_0x1b01db);}(_0x7b2d,0xbd));var _0xd7b2=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x7b2d[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0xd7b2('0x0')]={'version':{'type':Sequelize[_0xd7b2('0x1')],'unique':_0xd7b2('0x2')}};
\ No newline at end of file
index ffe8f13..f960f4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe79a=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','limit','count','status','json','apply','save','then','destroy','end','error','stack','name','send','map','Migration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','includeAll','include','catch','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe79a,0x134));var _0xae79=function(_0x181d2d,_0x480cc8){_0x181d2d=_0x181d2d-0x0;var _0x4a0cfc=_0xe79a[_0x181d2d];return _0x4a0cfc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae79('0x1'));var rp=require(_0xae79('0x2'));var moment=require(_0xae79('0x3'));var BPromise=require(_0xae79('0x4'));var Mustache=require(_0xae79('0x5'));var util=require(_0xae79('0x6'));var path=require('path');var sox=require(_0xae79('0x7'));var csv=require(_0xae79('0x8'));var ejs=require(_0xae79('0x9'));var fs=require('fs');var fs_extra=require(_0xae79('0xa'));var _=require(_0xae79('0xb'));var squel=require(_0xae79('0xc'));var crypto=require('crypto');var jsforce=require(_0xae79('0xd'));var deskjs=require(_0xae79('0xe'));var toCsv=require('to-csv');var querystring=require(_0xae79('0xf'));var Papa=require(_0xae79('0x10'));var Redis=require(_0xae79('0x11'));var authService=require(_0xae79('0x12'));var qs=require(_0xae79('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae79('0x14'));var logger=require('../../config/logger')(_0xae79('0x15'));var utils=require(_0xae79('0x16'));var config=require(_0xae79('0x17'));var licenseUtil=require(_0xae79('0x18'));var db=require(_0xae79('0x19'))['db'];function respondWithStatusCode(_0x241b22,_0x82741b){_0x82741b=_0x82741b||0xcc;return function(_0x1d5bef){if(_0x1d5bef){return _0x241b22[_0xae79('0x1a')](_0x82741b);}return _0x241b22['status'](_0x82741b)['end']();};}function respondWithResult(_0xd087ce,_0x276b64){_0x276b64=_0x276b64||0xc8;return function(_0x55245f){if(_0x55245f){return _0xd087ce['status'](_0x276b64)['json'](_0x55245f);}};}function respondWithFilteredResult(_0x2a33fa,_0x1be259){return function(_0x436190){if(_0x436190){var _0x3adb50=typeof _0x1be259[_0xae79('0x1b')]===_0xae79('0x1c')&&typeof _0x1be259[_0xae79('0x1d')]===_0xae79('0x1c');var _0x527d5b=_0x436190[_0xae79('0x1e')];var _0x141769=_0x3adb50?0x0:_0x1be259[_0xae79('0x1b')];var _0x567ef7=_0x3adb50?_0x436190[_0xae79('0x1e')]:_0x1be259[_0xae79('0x1b')]+_0x1be259[_0xae79('0x1d')];var _0x482062;if(_0x567ef7>=_0x527d5b){_0x567ef7=_0x527d5b;_0x482062=0xc8;}else{_0x482062=0xce;}_0x2a33fa[_0xae79('0x1f')](_0x482062);return _0x2a33fa['set']('Content-Range',_0x141769+'-'+_0x567ef7+'/'+_0x527d5b)[_0xae79('0x20')](_0x436190);}return null;};}function patchUpdates(_0x4c0273){return function(_0x4765bc){try{jsonpatch[_0xae79('0x21')](_0x4765bc,_0x4c0273,!![]);}catch(_0x4641bf){return BPromise['reject'](_0x4641bf);}return _0x4765bc[_0xae79('0x22')]();};}function saveUpdates(_0x3f36aa,_0x4279c3){return function(_0x5080a1){if(_0x5080a1){return _0x5080a1['update'](_0x3f36aa)[_0xae79('0x23')](function(_0x41eeff){return _0x41eeff;});}return null;};}function removeEntity(_0x35eb26,_0x24bfb8){return function(_0x2680cf){if(_0x2680cf){return _0x2680cf[_0xae79('0x24')]()[_0xae79('0x23')](function(){_0x35eb26[_0xae79('0x1f')](0xcc)[_0xae79('0x25')]();});}};}function handleEntityNotFound(_0x2b849d,_0x30bc6c){return function(_0x5342ba){if(!_0x5342ba){_0x2b849d['sendStatus'](0x194);}return _0x5342ba;};}function handleError(_0x272a3e,_0x565e5d){_0x565e5d=_0x565e5d||0x1f4;return function(_0x3c0dc8){logger[_0xae79('0x26')](_0x3c0dc8[_0xae79('0x27')]);if(_0x3c0dc8[_0xae79('0x28')]){delete _0x3c0dc8[_0xae79('0x28')];}_0x272a3e['status'](_0x565e5d)[_0xae79('0x29')](_0x3c0dc8);};}exports['index']=function(_0x1a05cf,_0x1c80a7){var _0x5c671e={},_0x4c8e5c={},_0x53244a={'count':0x0,'rows':[]};var _0x17c24d=_[_0xae79('0x2a')](db[_0xae79('0x2b')][_0xae79('0x2c')],function(_0x5cff1b){return{'name':_0x5cff1b[_0xae79('0x2d')],'type':_0x5cff1b['type'][_0xae79('0x2e')]};});_0x4c8e5c[_0xae79('0x2f')]=_[_0xae79('0x2a')](_0x17c24d,_0xae79('0x28'));_0x4c8e5c['query']=_[_0xae79('0x30')](_0x1a05cf[_0xae79('0x31')]);_0x4c8e5c[_0xae79('0x32')]=_[_0xae79('0x33')](_0x4c8e5c[_0xae79('0x2f')],_0x4c8e5c[_0xae79('0x31')]);_0x5c671e[_0xae79('0x34')]=_[_0xae79('0x33')](_0x4c8e5c['model'],qs['fields'](_0x1a05cf[_0xae79('0x31')][_0xae79('0x35')]));_0x5c671e[_0xae79('0x34')]=_0x5c671e['attributes']['length']?_0x5c671e[_0xae79('0x34')]:_0x4c8e5c[_0xae79('0x2f')];if(!_0x1a05cf[_0xae79('0x31')]['hasOwnProperty'](_0xae79('0x36'))){_0x5c671e[_0xae79('0x1d')]=qs[_0xae79('0x1d')](_0x1a05cf['query'][_0xae79('0x1d')]);_0x5c671e[_0xae79('0x1b')]=qs['offset'](_0x1a05cf['query'][_0xae79('0x1b')]);}_0x5c671e[_0xae79('0x37')]=qs[_0xae79('0x38')](_0x1a05cf[_0xae79('0x31')][_0xae79('0x38')]);_0x5c671e['where']=qs[_0xae79('0x32')](_[_0xae79('0x39')](_0x1a05cf[_0xae79('0x31')],_0x4c8e5c[_0xae79('0x32')]),_0x17c24d);if(_0x1a05cf[_0xae79('0x31')]['filter']){_0x5c671e['where']=_[_0xae79('0x3a')](_0x5c671e[_0xae79('0x3b')],{'$or':_[_0xae79('0x2a')](_0x17c24d,function(_0x61654d){if(_0x61654d[_0xae79('0x3c')]!==_0xae79('0x3d')){var _0x244c1e={};_0x244c1e[_0x61654d[_0xae79('0x28')]]={'$like':'%'+_0x1a05cf['query'][_0xae79('0x3e')]+'%'};return _0x244c1e;}})});}_0x5c671e=_[_0xae79('0x3a')]({},_0x5c671e,_0x1a05cf['options']);var _0x51773b={'where':_0x5c671e['where']};return db[_0xae79('0x2b')][_0xae79('0x1e')](_0x51773b)[_0xae79('0x23')](function(_0xc10617){_0x53244a[_0xae79('0x1e')]=_0xc10617;if(_0x1a05cf[_0xae79('0x31')][_0xae79('0x3f')]){_0x5c671e[_0xae79('0x40')]=[{'all':!![]}];}return db['Migration']['findAll'](_0x5c671e);})[_0xae79('0x23')](function(_0x23c86d){_0x53244a['rows']=_0x23c86d;return _0x53244a;})['then'](respondWithFilteredResult(_0x1c80a7,_0x5c671e))[_0xae79('0x41')](handleError(_0x1c80a7,null));};
\ No newline at end of file
+var _0xe574=['../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','Migration','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x20e84b,_0x4b7a97){var _0x42d872=function(_0x21548a){while(--_0x21548a){_0x20e84b['push'](_0x20e84b['shift']());}};_0x42d872(++_0x4b7a97);}(_0xe574,0x100));var _0x4e57=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xe574[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x4e57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e57('0x1'));var jsonpatch=require(_0x4e57('0x2'));var rp=require(_0x4e57('0x3'));var moment=require(_0x4e57('0x4'));var BPromise=require(_0x4e57('0x5'));var Mustache=require(_0x4e57('0x6'));var util=require(_0x4e57('0x7'));var path=require(_0x4e57('0x8'));var sox=require(_0x4e57('0x9'));var csv=require(_0x4e57('0xa'));var ejs=require(_0x4e57('0xb'));var fs=require('fs');var fs_extra=require(_0x4e57('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4e57('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e57('0xa'));var querystring=require(_0x4e57('0xe'));var Papa=require(_0x4e57('0xf'));var Redis=require(_0x4e57('0x10'));var authService=require(_0x4e57('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4e57('0x12'));var hardwareService=require(_0x4e57('0x13'));var logger=require(_0x4e57('0x14'))(_0x4e57('0x15'));var utils=require(_0x4e57('0x16'));var config=require(_0x4e57('0x17'));var licenseUtil=require(_0x4e57('0x18'));var db=require(_0x4e57('0x19'))['db'];function respondWithStatusCode(_0xed8cbc,_0x40c8c8){_0x40c8c8=_0x40c8c8||0xcc;return function(_0x330868){if(_0x330868){return _0xed8cbc[_0x4e57('0x1a')](_0x40c8c8);}return _0xed8cbc[_0x4e57('0x1b')](_0x40c8c8)[_0x4e57('0x1c')]();};}function respondWithResult(_0x28f876,_0x2e9fa8){_0x2e9fa8=_0x2e9fa8||0xc8;return function(_0x4f088a){if(_0x4f088a){return _0x28f876[_0x4e57('0x1b')](_0x2e9fa8)['json'](_0x4f088a);}};}function respondWithFilteredResult(_0x254285,_0x4af0a6){return function(_0x3401c4){if(_0x3401c4){var _0x214957=typeof _0x4af0a6['offset']===_0x4e57('0x1d')&&typeof _0x4af0a6[_0x4e57('0x1e')]===_0x4e57('0x1d');var _0xb06d8=_0x3401c4['count'];var _0x2ed980=_0x214957?0x0:_0x4af0a6[_0x4e57('0x1f')];var _0x3c2978=_0x214957?_0x3401c4[_0x4e57('0x20')]:_0x4af0a6[_0x4e57('0x1f')]+_0x4af0a6['limit'];var _0x182286;if(_0x3c2978>=_0xb06d8){_0x3c2978=_0xb06d8;_0x182286=0xc8;}else{_0x182286=0xce;}_0x254285[_0x4e57('0x1b')](_0x182286);return _0x254285[_0x4e57('0x21')](_0x4e57('0x22'),_0x2ed980+'-'+_0x3c2978+'/'+_0xb06d8)['json'](_0x3401c4);}return null;};}function patchUpdates(_0x372295){return function(_0x59df7a){try{jsonpatch[_0x4e57('0x23')](_0x59df7a,_0x372295,!![]);}catch(_0x5b6127){return BPromise[_0x4e57('0x24')](_0x5b6127);}return _0x59df7a[_0x4e57('0x25')]();};}function saveUpdates(_0x427c6b,_0x43c9a7){return function(_0x45f9cd){if(_0x45f9cd){return _0x45f9cd['update'](_0x427c6b)['then'](function(_0x17e309){return _0x17e309;});}return null;};}function removeEntity(_0x58d6ea,_0x315f7c){return function(_0x4cfa0e){if(_0x4cfa0e){return _0x4cfa0e[_0x4e57('0x26')]()[_0x4e57('0x27')](function(){_0x58d6ea[_0x4e57('0x1b')](0xcc)[_0x4e57('0x1c')]();});}};}function handleEntityNotFound(_0x29df93,_0xc75cb3){return function(_0x4fb5db){if(!_0x4fb5db){_0x29df93[_0x4e57('0x1a')](0x194);}return _0x4fb5db;};}function handleError(_0x316988,_0x503eaa){_0x503eaa=_0x503eaa||0x1f4;return function(_0x36b415){logger[_0x4e57('0x28')](_0x36b415[_0x4e57('0x29')]);if(_0x36b415[_0x4e57('0x2a')]){delete _0x36b415[_0x4e57('0x2a')];}_0x316988[_0x4e57('0x1b')](_0x503eaa)[_0x4e57('0x2b')](_0x36b415);};}exports['index']=function(_0x1a26f6,_0x431794){var _0x1da085={},_0x197bc1={},_0x27a22f={'count':0x0,'rows':[]};var _0x5d55b9=_['map'](db[_0x4e57('0x2c')][_0x4e57('0x2d')],function(_0x3ce391){return{'name':_0x3ce391[_0x4e57('0x2e')],'type':_0x3ce391['type'][_0x4e57('0x2f')]};});_0x197bc1[_0x4e57('0x30')]=_[_0x4e57('0x31')](_0x5d55b9,_0x4e57('0x2a'));_0x197bc1[_0x4e57('0x32')]=_['keys'](_0x1a26f6[_0x4e57('0x32')]);_0x197bc1[_0x4e57('0x33')]=_['intersection'](_0x197bc1[_0x4e57('0x30')],_0x197bc1['query']);_0x1da085['attributes']=_[_0x4e57('0x34')](_0x197bc1[_0x4e57('0x30')],qs[_0x4e57('0x35')](_0x1a26f6['query'][_0x4e57('0x35')]));_0x1da085['attributes']=_0x1da085[_0x4e57('0x36')][_0x4e57('0x37')]?_0x1da085[_0x4e57('0x36')]:_0x197bc1['model'];if(!_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x38')](_0x4e57('0x39'))){_0x1da085[_0x4e57('0x1e')]=qs[_0x4e57('0x1e')](_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x1e')]);_0x1da085[_0x4e57('0x1f')]=qs[_0x4e57('0x1f')](_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x1f')]);}_0x1da085['order']=qs[_0x4e57('0x3a')](_0x1a26f6['query'][_0x4e57('0x3a')]);_0x1da085[_0x4e57('0x3b')]=qs[_0x4e57('0x33')](_[_0x4e57('0x3c')](_0x1a26f6['query'],_0x197bc1['filters']),_0x5d55b9);if(_0x1a26f6[_0x4e57('0x32')][_0x4e57('0x3d')]){_0x1da085[_0x4e57('0x3b')]=_[_0x4e57('0x3e')](_0x1da085[_0x4e57('0x3b')],{'$or':_[_0x4e57('0x31')](_0x5d55b9,function(_0x1ab62){if(_0x1ab62[_0x4e57('0x3f')]!==_0x4e57('0x40')){var _0x4ac448={};_0x4ac448[_0x1ab62[_0x4e57('0x2a')]]={'$like':'%'+_0x1a26f6['query'][_0x4e57('0x3d')]+'%'};return _0x4ac448;}})});}_0x1da085=_[_0x4e57('0x3e')]({},_0x1da085,_0x1a26f6['options']);var _0x1ff9e7={'where':_0x1da085[_0x4e57('0x3b')]};return db[_0x4e57('0x2c')][_0x4e57('0x20')](_0x1ff9e7)[_0x4e57('0x27')](function(_0x386d3a){_0x27a22f[_0x4e57('0x20')]=_0x386d3a;if(_0x1a26f6['query'][_0x4e57('0x41')]){_0x1da085[_0x4e57('0x42')]=[{'all':!![]}];}return db['Migration'][_0x4e57('0x43')](_0x1da085);})[_0x4e57('0x27')](function(_0x2ef995){_0x27a22f[_0x4e57('0x44')]=_0x2ef995;return _0x27a22f;})[_0x4e57('0x27')](respondWithFilteredResult(_0x431794,_0x1da085))[_0x4e57('0x45')](handleError(_0x431794,null));};
\ No newline at end of file
index 20f10d3..402b299 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x431e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','Migration','migrations'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x431e,0x144));var _0xe431=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x431e[_0x490be3];return _0x3f5140;};'use strict';var _=require(_0xe431('0x0'));var util=require(_0xe431('0x1'));var logger=require(_0xe431('0x2'))(_0xe431('0x3'));var moment=require(_0xe431('0x4'));var BPromise=require(_0xe431('0x5'));var rp=require(_0xe431('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe431('0x7'));var config=require(_0xe431('0x8'));var attributes=require('./migration.attributes');module['exports']=function(_0x5a6912,_0x17d091){return _0x5a6912[_0xe431('0x9')](_0xe431('0xa'),attributes,{'tableName':_0xe431('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a12=['request-promise','path','rimraf','Migration','lodash','../../config/logger','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9a12,0x1b4));var _0x29a1=function(_0xc3e30b,_0xaf8036){_0xc3e30b=_0xc3e30b-0x0;var _0x4bb432=_0x9a12[_0xc3e30b];return _0x4bb432;};'use strict';var _=require(_0x29a1('0x0'));var util=require('util');var logger=require(_0x29a1('0x1'))('api');var moment=require(_0x29a1('0x2'));var BPromise=require(_0x29a1('0x3'));var rp=require(_0x29a1('0x4'));var fs=require('fs');var path=require(_0x29a1('0x5'));var rimraf=require(_0x29a1('0x6'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module['exports']=function(_0x361131,_0x5debd7){return _0x361131['define'](_0x29a1('0x7'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dbd64ef..34f79e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb264=['code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x2e2009,_0x162bb9){var _0x19833e=function(_0x3a4647){while(--_0x3a4647){_0x2e2009['push'](_0x2e2009['shift']());}};_0x19833e(++_0x162bb9);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b26('0x0'));var util=require(_0x4b26('0x1'));var moment=require('moment');var BPromise=require(_0x4b26('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b26('0x3'))['db'];var utils=require(_0x4b26('0x4'));var logger=require(_0x4b26('0x5'))(_0x4b26('0x6'));var config=require(_0x4b26('0x7'));var jayson=require(_0x4b26('0x8'));var client=jayson[_0x4b26('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x165096,_0x337ddc,_0x5a8c67){return new BPromise(function(_0x1edb7c,_0xec9f8a){return client[_0x4b26('0xa')](_0x165096,_0x5a8c67)['then'](function(_0x2ab5e2){logger[_0x4b26('0xb')](_0x4b26('0xc'),_0x337ddc,_0x4b26('0xd'));logger[_0x4b26('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x337ddc,_0x4b26('0xd'),JSON['stringify'](_0x2ab5e2));if(_0x2ab5e2[_0x4b26('0xf')]){if(_0x2ab5e2[_0x4b26('0xf')][_0x4b26('0x10')]===0x1f4){logger[_0x4b26('0xf')](_0x4b26('0xc'),_0x337ddc,_0x2ab5e2['error'][_0x4b26('0x11')]);return _0xec9f8a(_0x2ab5e2[_0x4b26('0xf')]['message']);}logger['error'](_0x4b26('0xc'),_0x337ddc,_0x2ab5e2['error'][_0x4b26('0x11')]);return _0x1edb7c(_0x2ab5e2[_0x4b26('0xf')][_0x4b26('0x11')]);}else{logger['info'](_0x4b26('0xc'),_0x337ddc,_0x4b26('0xd'));_0x1edb7c(_0x2ab5e2[_0x4b26('0x12')][_0x4b26('0x11')]);}})[_0x4b26('0x13')](function(_0x1582a3){logger[_0x4b26('0xf')](_0x4b26('0xc'),_0x337ddc,_0x1582a3);_0xec9f8a(_0x1582a3);});});}
\ No newline at end of file
+var _0xcc8d=['then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x37afd0,_0x1f7abc){var _0x546280=function(_0x91d036){while(--_0x91d036){_0x37afd0['push'](_0x37afd0['shift']());}};_0x546280(++_0x1f7abc);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0xcc8d[_0x575057];return _0x49dbc8;};'use strict';var _=require('lodash');var util=require(_0xdcc8('0x0'));var moment=require(_0xdcc8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdcc8('0x2'));var db=require(_0xdcc8('0x3'))['db'];var utils=require(_0xdcc8('0x4'));var logger=require(_0xdcc8('0x5'))(_0xdcc8('0x6'));var config=require(_0xdcc8('0x7'));var jayson=require(_0xdcc8('0x8'));var client=jayson['client'][_0xdcc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfeebba,_0x10dd63,_0x237528){return new BPromise(function(_0x11c497,_0x5a85bd){return client[_0xdcc8('0xa')](_0xfeebba,_0x237528)[_0xdcc8('0xb')](function(_0x118798){logger[_0xdcc8('0xc')](_0xdcc8('0xd'),_0x10dd63,_0xdcc8('0xe'));logger[_0xdcc8('0xf')](_0xdcc8('0x10'),_0x10dd63,_0xdcc8('0xe'),JSON[_0xdcc8('0x11')](_0x118798));if(_0x118798[_0xdcc8('0x12')]){if(_0x118798[_0xdcc8('0x12')]['code']===0x1f4){logger[_0xdcc8('0x12')](_0xdcc8('0xd'),_0x10dd63,_0x118798['error'][_0xdcc8('0x13')]);return _0x5a85bd(_0x118798[_0xdcc8('0x12')][_0xdcc8('0x13')]);}logger[_0xdcc8('0x12')]('Migration,\x20%s,\x20%s',_0x10dd63,_0x118798[_0xdcc8('0x12')][_0xdcc8('0x13')]);return _0x11c497(_0x118798['error'][_0xdcc8('0x13')]);}else{logger['info'](_0xdcc8('0xd'),_0x10dd63,_0xdcc8('0xe'));_0x11c497(_0x118798[_0xdcc8('0x14')][_0xdcc8('0x13')]);}})[_0xdcc8('0x15')](function(_0x12ace8){logger[_0xdcc8('0x12')]('Migration,\x20%s,\x20%s',_0x10dd63,_0x12ace8);_0x5a85bd(_0x12ace8);});});}
\ No newline at end of file
index c2b978d..bbf9b14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a96=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x8014d8,_0x134a36){var _0x581b7b=function(_0x45c7ce){while(--_0x45c7ce){_0x8014d8['push'](_0x8014d8['shift']());}};_0x581b7b(++_0x134a36);}(_0x9a96,0x117));var _0x69a9=function(_0x199cd1,_0x4acbf8){_0x199cd1=_0x199cd1-0x0;var _0x218a19=_0x9a96[_0x199cd1];return _0x218a19;};'use strict';var multer=require(_0x69a9('0x0'));var util=require('util');var path=require(_0x69a9('0x1'));var timeout=require(_0x69a9('0x2'));var express=require(_0x69a9('0x3'));var router=express[_0x69a9('0x4')]();var fs_extra=require(_0x69a9('0x5'));var auth=require(_0x69a9('0x6'));var interaction=require(_0x69a9('0x7'));var config=require(_0x69a9('0x8'));var controller=require('./network.controller');router[_0x69a9('0x9')]('/',auth[_0x69a9('0xa')](),controller[_0x69a9('0xb')]);router[_0x69a9('0x9')](_0x69a9('0xc'),auth['isAuthenticated'](),controller[_0x69a9('0xd')]);router[_0x69a9('0xe')]('/',auth[_0x69a9('0xa')](),controller[_0x69a9('0xf')]);router['put'](_0x69a9('0xc'),auth[_0x69a9('0xa')](),controller['update']);router[_0x69a9('0x10')](_0x69a9('0xc'),auth[_0x69a9('0xa')](),controller[_0x69a9('0x11')]);module[_0x69a9('0x12')]=router;
\ No newline at end of file
+var _0xdc86=['isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xdc86,0x118));var _0x6dc8=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xdc86[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0x6dc8('0x0'));var path=require('path');var timeout=require(_0x6dc8('0x1'));var express=require('express');var router=express[_0x6dc8('0x2')]();var fs_extra=require(_0x6dc8('0x3'));var auth=require(_0x6dc8('0x4'));var interaction=require(_0x6dc8('0x5'));var config=require(_0x6dc8('0x6'));var controller=require('./network.controller');router[_0x6dc8('0x7')]('/',auth[_0x6dc8('0x8')](),controller[_0x6dc8('0x9')]);router[_0x6dc8('0x7')](_0x6dc8('0xa'),auth[_0x6dc8('0x8')](),controller[_0x6dc8('0xb')]);router[_0x6dc8('0xc')]('/',auth['isAuthenticated'](),controller[_0x6dc8('0xd')]);router['put'](_0x6dc8('0xa'),auth[_0x6dc8('0x8')](),controller[_0x6dc8('0xe')]);router[_0x6dc8('0xf')]('/:id',auth[_0x6dc8('0x8')](),controller[_0x6dc8('0x10')]);module[_0x6dc8('0x11')]=router;
\ No newline at end of file
index d22f493..4304e2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddc2=['sequelize','localnet','externip','turn','STRING'];(function(_0x29d24e,_0x1fa276){var _0x1f5c40=function(_0x2a08da){while(--_0x2a08da){_0x29d24e['push'](_0x29d24e['shift']());}};_0x1f5c40(++_0x1fa276);}(_0xddc2,0x1cc));var _0x2ddc=function(_0xe286ca,_0x126184){_0xe286ca=_0xe286ca-0x0;var _0x11fa5d=_0xddc2[_0xe286ca];return _0x11fa5d;};'use strict';var Sequelize=require(_0x2ddc('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x2ddc('0x1'),_0x2ddc('0x2'),'stun',_0x2ddc('0x3'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2ddc('0x4')]}};
\ No newline at end of file
+var _0x8c97=['ENUM','localnet','stun','turn','STRING','sequelize','exports'];(function(_0x27ed6c,_0x2cadc5){var _0x38272c=function(_0x21a256){while(--_0x21a256){_0x27ed6c['push'](_0x27ed6c['shift']());}};_0x38272c(++_0x2cadc5);}(_0x8c97,0x194));var _0x78c9=function(_0x5a11b5,_0x555819){_0x5a11b5=_0x5a11b5-0x0;var _0x32ed5a=_0x8c97[_0x5a11b5];return _0x32ed5a;};'use strict';var Sequelize=require(_0x78c9('0x0'));module[_0x78c9('0x1')]={'type':{'type':Sequelize[_0x78c9('0x2')](_0x78c9('0x3'),'externip',_0x78c9('0x4'),_0x78c9('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x78c9('0x6')]},'password':{'type':Sequelize[_0x78c9('0x6')]}};
\ No newline at end of file
index 27e279f..487301f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d83=['utf8','render','/etc/asterisk/stun_xcally.conf','TURN','readFileSync','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','format','toLowerCase','res_stun_monitor.so','server/files/templates/network.ejs','Reload','STUN','destroy','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','Network','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','length','include','find','create','sequelize','transaction','body','toUpperCase','join','root','server/files/templates/stun_multiple.ejs'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x2d83,0x1dc));var _0x32d8=function(_0x498152,_0x1ebfe5){_0x498152=_0x498152-0x0;var _0x36cf88=_0x2d83[_0x498152];return _0x36cf88;};'use strict';var emlformat=require(_0x32d8('0x0'));var rimraf=require(_0x32d8('0x1'));var zipdir=require(_0x32d8('0x2'));var jsonpatch=require(_0x32d8('0x3'));var rp=require(_0x32d8('0x4'));var moment=require(_0x32d8('0x5'));var BPromise=require(_0x32d8('0x6'));var Mustache=require(_0x32d8('0x7'));var util=require('util');var path=require(_0x32d8('0x8'));var sox=require(_0x32d8('0x9'));var csv=require(_0x32d8('0xa'));var ejs=require(_0x32d8('0xb'));var fs=require('fs');var fs_extra=require(_0x32d8('0xc'));var _=require(_0x32d8('0xd'));var squel=require(_0x32d8('0xe'));var crypto=require(_0x32d8('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x32d8('0x10'));var toCsv=require('to-csv');var querystring=require(_0x32d8('0x11'));var Papa=require(_0x32d8('0x12'));var Redis=require(_0x32d8('0x13'));var authService=require(_0x32d8('0x14'));var qs=require(_0x32d8('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32d8('0x16'));var logger=require('../../config/logger')(_0x32d8('0x17'));var utils=require(_0x32d8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x32d8('0x19'));var db=require(_0x32d8('0x1a'))['db'];var jayson=require(_0x32d8('0x1b'));var client=jayson[_0x32d8('0x1c')][_0x32d8('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1b261d,_0x39eca1,_0x1d750e,_0x2e2737){return new BPromise(function(_0x1c903b,_0x4493eb){var _0x438331=_0x2e2737||client;return _0x438331[_0x32d8('0x1e')](_0x1b261d,_0x1d750e)[_0x32d8('0x1f')](function(_0x4f0cfa){logger['info'](_0x32d8('0x20'),_0x39eca1,_0x32d8('0x21'));logger[_0x32d8('0x22')](_0x32d8('0x23'),_0x39eca1,_0x32d8('0x21'),JSON[_0x32d8('0x24')](_0x4f0cfa));if(_0x4f0cfa[_0x32d8('0x25')]){if(_0x4f0cfa[_0x32d8('0x25')][_0x32d8('0x26')]===0x1f4){logger[_0x32d8('0x25')](_0x32d8('0x20'),_0x39eca1,_0x4f0cfa[_0x32d8('0x25')][_0x32d8('0x27')]);return _0x4493eb(_0x4f0cfa[_0x32d8('0x25')]['message']);}logger[_0x32d8('0x25')](_0x32d8('0x20'),_0x39eca1,_0x4f0cfa[_0x32d8('0x25')]['message']);return _0x1c903b(_0x4f0cfa[_0x32d8('0x25')][_0x32d8('0x27')]);}else{logger[_0x32d8('0x28')](_0x32d8('0x20'),_0x39eca1,_0x32d8('0x21'));_0x1c903b(_0x4f0cfa[_0x32d8('0x29')][_0x32d8('0x27')]);}})[_0x32d8('0x2a')](function(_0x2d65a8){logger[_0x32d8('0x25')]('Network,\x20%s,\x20%s',_0x39eca1,_0x2d65a8);_0x4493eb(_0x2d65a8);});});}function respondWithStatusCode(_0x502e1d,_0x1d5a3e){_0x1d5a3e=_0x1d5a3e||0xcc;return function(_0x1fd076){if(_0x1fd076){return _0x502e1d[_0x32d8('0x2b')](_0x1d5a3e);}return _0x502e1d[_0x32d8('0x2c')](_0x1d5a3e)[_0x32d8('0x2d')]();};}function respondWithResult(_0x336ad5,_0x44569b){_0x44569b=_0x44569b||0xc8;return function(_0x6faeab){if(_0x6faeab){return _0x336ad5['status'](_0x44569b)[_0x32d8('0x2e')](_0x6faeab);}};}function respondWithFilteredResult(_0x1bc0cf,_0x11411e){return function(_0x42b2f2){if(_0x42b2f2){var _0x3c0725=typeof _0x11411e[_0x32d8('0x2f')]==='undefined'&&typeof _0x11411e['limit']===_0x32d8('0x30');var _0x235a1c=_0x42b2f2['count'];var _0x5c229d=_0x3c0725?0x0:_0x11411e['offset'];var _0x55c2f9=_0x3c0725?_0x42b2f2[_0x32d8('0x31')]:_0x11411e['offset']+_0x11411e[_0x32d8('0x32')];var _0x4d980c;if(_0x55c2f9>=_0x235a1c){_0x55c2f9=_0x235a1c;_0x4d980c=0xc8;}else{_0x4d980c=0xce;}_0x1bc0cf[_0x32d8('0x2c')](_0x4d980c);return _0x1bc0cf[_0x32d8('0x33')](_0x32d8('0x34'),_0x5c229d+'-'+_0x55c2f9+'/'+_0x235a1c)[_0x32d8('0x2e')](_0x42b2f2);}return null;};}function patchUpdates(_0x19576b){return function(_0xbcdc87){try{jsonpatch[_0x32d8('0x35')](_0xbcdc87,_0x19576b,!![]);}catch(_0xb29e22){return BPromise[_0x32d8('0x36')](_0xb29e22);}return _0xbcdc87[_0x32d8('0x37')]();};}function saveUpdates(_0x3337bb,_0x23bba0){return function(_0x521077){if(_0x521077){return _0x521077[_0x32d8('0x38')](_0x3337bb)[_0x32d8('0x1f')](function(_0xf56637){return _0xf56637;});}return null;};}function removeEntity(_0x277964,_0x11273b){return function(_0x12c364){if(_0x12c364){return _0x12c364['destroy']()['then'](function(){_0x277964[_0x32d8('0x2c')](0xcc)[_0x32d8('0x2d')]();});}};}function handleEntityNotFound(_0x4510be,_0x2e7cc5){return function(_0x24009d){if(!_0x24009d){_0x4510be[_0x32d8('0x2b')](0x194);}return _0x24009d;};}function handleError(_0x334d2e,_0x258a5a){_0x258a5a=_0x258a5a||0x1f4;return function(_0x41512d){logger['error'](_0x41512d[_0x32d8('0x39')]);if(_0x41512d[_0x32d8('0x3a')]){delete _0x41512d['name'];}_0x334d2e[_0x32d8('0x2c')](_0x258a5a)[_0x32d8('0x3b')](_0x41512d);};}exports[_0x32d8('0x3c')]=function(_0x1ae1b1,_0x54e208){var _0x585647={},_0x51295c={},_0x20bb02={'count':0x0,'rows':[]};var _0x37d0af=_[_0x32d8('0x3d')](db[_0x32d8('0x3e')]['rawAttributes'],function(_0x407dd9){return{'name':_0x407dd9[_0x32d8('0x3f')],'type':_0x407dd9[_0x32d8('0x40')][_0x32d8('0x41')]};});_0x51295c[_0x32d8('0x42')]=_['map'](_0x37d0af,_0x32d8('0x3a'));_0x51295c[_0x32d8('0x43')]=_['keys'](_0x1ae1b1[_0x32d8('0x43')]);_0x51295c[_0x32d8('0x44')]=_[_0x32d8('0x45')](_0x51295c['model'],_0x51295c[_0x32d8('0x43')]);_0x585647[_0x32d8('0x46')]=_[_0x32d8('0x45')](_0x51295c[_0x32d8('0x42')],qs[_0x32d8('0x47')](_0x1ae1b1[_0x32d8('0x43')][_0x32d8('0x47')]));_0x585647[_0x32d8('0x46')]=_0x585647['attributes']['length']?_0x585647[_0x32d8('0x46')]:_0x51295c[_0x32d8('0x42')];if(!_0x1ae1b1['query'][_0x32d8('0x48')](_0x32d8('0x49'))){_0x585647['limit']=qs[_0x32d8('0x32')](_0x1ae1b1[_0x32d8('0x43')][_0x32d8('0x32')]);_0x585647[_0x32d8('0x2f')]=qs[_0x32d8('0x2f')](_0x1ae1b1[_0x32d8('0x43')][_0x32d8('0x2f')]);}_0x585647[_0x32d8('0x4a')]=qs[_0x32d8('0x4b')](_0x1ae1b1[_0x32d8('0x43')][_0x32d8('0x4b')]);_0x585647[_0x32d8('0x4c')]=qs['filters'](_[_0x32d8('0x4d')](_0x1ae1b1[_0x32d8('0x43')],_0x51295c[_0x32d8('0x44')]),_0x37d0af);if(_0x1ae1b1[_0x32d8('0x43')][_0x32d8('0x4e')]){_0x585647[_0x32d8('0x4c')]=_[_0x32d8('0x4f')](_0x585647[_0x32d8('0x4c')],{'$or':_[_0x32d8('0x3d')](_0x37d0af,function(_0x42f3d0){if(_0x42f3d0[_0x32d8('0x40')]!==_0x32d8('0x50')){var _0x19fc69={};_0x19fc69[_0x42f3d0[_0x32d8('0x3a')]]={'$like':'%'+_0x1ae1b1[_0x32d8('0x43')][_0x32d8('0x4e')]+'%'};return _0x19fc69;}})});}_0x585647=_[_0x32d8('0x4f')]({},_0x585647,_0x1ae1b1[_0x32d8('0x51')]);var _0x5c8b0b={'where':_0x585647[_0x32d8('0x4c')]};return db[_0x32d8('0x3e')][_0x32d8('0x31')](_0x5c8b0b)[_0x32d8('0x1f')](function(_0xc50079){_0x20bb02[_0x32d8('0x31')]=_0xc50079;if(_0x1ae1b1[_0x32d8('0x43')][_0x32d8('0x52')]){_0x585647['include']=[{'all':!![]}];}return db[_0x32d8('0x3e')][_0x32d8('0x53')](_0x585647);})['then'](function(_0x27085a){_0x20bb02[_0x32d8('0x54')]=_0x27085a;return _0x20bb02;})[_0x32d8('0x1f')](respondWithFilteredResult(_0x54e208,_0x585647))[_0x32d8('0x2a')](handleError(_0x54e208,null));};exports[_0x32d8('0x55')]=function(_0x20e2d3,_0x50f391){var _0x3b2f80={'raw':!![],'where':{'id':_0x20e2d3[_0x32d8('0x56')]['id']}},_0x303cc3={};_0x303cc3['model']=_[_0x32d8('0x57')](db[_0x32d8('0x3e')]['rawAttributes']);_0x303cc3['query']=_['keys'](_0x20e2d3[_0x32d8('0x43')]);_0x303cc3[_0x32d8('0x44')]=_['intersection'](_0x303cc3['model'],_0x303cc3[_0x32d8('0x43')]);_0x3b2f80[_0x32d8('0x46')]=_[_0x32d8('0x45')](_0x303cc3[_0x32d8('0x42')],qs[_0x32d8('0x47')](_0x20e2d3[_0x32d8('0x43')][_0x32d8('0x47')]));_0x3b2f80[_0x32d8('0x46')]=_0x3b2f80[_0x32d8('0x46')][_0x32d8('0x58')]?_0x3b2f80[_0x32d8('0x46')]:_0x303cc3[_0x32d8('0x42')];if(_0x20e2d3[_0x32d8('0x43')][_0x32d8('0x52')]){_0x3b2f80[_0x32d8('0x59')]=[{'all':!![]}];}_0x3b2f80=_[_0x32d8('0x4f')]({},_0x3b2f80,_0x20e2d3[_0x32d8('0x51')]);return db[_0x32d8('0x3e')][_0x32d8('0x5a')](_0x3b2f80)[_0x32d8('0x1f')](handleEntityNotFound(_0x50f391,null))[_0x32d8('0x1f')](respondWithResult(_0x50f391,null))[_0x32d8('0x2a')](handleError(_0x50f391,null));};exports[_0x32d8('0x5b')]=function(_0x346eab,_0x256d3d,_0x1ed059){var _0x38fc4e;return db[_0x32d8('0x5c')][_0x32d8('0x5d')](function(_0x49c8e3){return db['Network'][_0x32d8('0x5b')](_0x346eab['body'],{'raw':!![]})[_0x32d8('0x1f')](function(_0x10be96){_0x38fc4e=_0x10be96;return db['Network'][_0x32d8('0x53')]({'where':{'type':_0x346eab[_0x32d8('0x5e')][_0x32d8('0x40')]},'raw':!![]});})['then'](function(_0x478693){if(_0x38fc4e[_0x32d8('0x40')][_0x32d8('0x5f')]()=='STUN'){var _0x44958e=fs['readFileSync'](path[_0x32d8('0x60')](config[_0x32d8('0x61')],_0x32d8('0x62')),_0x32d8('0x63'));var _0x52fa29=ejs[_0x32d8('0x64')](_0x44958e,{'networks':_0x478693||[]});fs['writeFileSync'](_0x32d8('0x65'),_0x52fa29);return respondWithRpcPromise('Reload',_0x32d8('0x5b'),{'module':'res_stun_monitor.so'});}else if(_0x38fc4e[_0x32d8('0x40')][_0x32d8('0x5f')]()==_0x32d8('0x66')){var _0x491b0c=fs[_0x32d8('0x67')](path[_0x32d8('0x60')](config['root'],_0x32d8('0x68')),_0x32d8('0x63'));var _0x25b9f4=ejs[_0x32d8('0x64')](_0x491b0c,{'networks':_0x478693||[]});fs[_0x32d8('0x69')](_0x32d8('0x6a'),_0x25b9f4);return respondWithRpcPromise('Reload','create',{'module':'res_stun_monitor.so'});}else{var _0x297b6c=fs[_0x32d8('0x67')](path['join'](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x1ac7dc=ejs[_0x32d8('0x64')](_0x297b6c,{'networks':_0x478693||[]});fs['writeFileSync'](util[_0x32d8('0x6b')]('/etc/asterisk/sip_xcally_%s.conf',_0x346eab[_0x32d8('0x5e')][_0x32d8('0x40')][_0x32d8('0x6c')]()),_0x1ac7dc);return respondWithRpcPromise('Reload',_0x32d8('0x5b'),{'module':'chan_sip.so'});}return null;})['then'](function(){return _0x38fc4e;});})[_0x32d8('0x1f')](respondWithResult(_0x256d3d,0xc9))[_0x32d8('0x2a')](handleError(_0x256d3d,null));};exports[_0x32d8('0x38')]=function(_0x248187,_0x418205,_0x2357ec){var _0x241bf1;return db[_0x32d8('0x5c')]['transaction'](function(_0x15e883){return db[_0x32d8('0x3e')][_0x32d8('0x5a')]({'where':{'id':_0x248187[_0x32d8('0x56')]['id']}})['then'](handleEntityNotFound(_0x418205,null))[_0x32d8('0x1f')](saveUpdates(_0x248187[_0x32d8('0x5e')],null))[_0x32d8('0x1f')](function(_0x4debea){if(_0x4debea){_0x241bf1=_0x4debea;return db[_0x32d8('0x3e')][_0x32d8('0x53')]({'where':{'type':_0x241bf1['type']},'raw':!![]});}return null;})['then'](function(_0x254152){if(_0x241bf1[_0x32d8('0x40')]['toUpperCase']()=='STUN'){var _0x1efba1=fs['readFileSync'](path[_0x32d8('0x60')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x32d8('0x63'));var _0x89805f=ejs['render'](_0x1efba1,{'networks':_0x254152||[]});fs[_0x32d8('0x69')]('/etc/asterisk/stun_xcally.conf',_0x89805f);return respondWithRpcPromise('Reload','update',{'module':_0x32d8('0x6d')});}else if(_0x241bf1[_0x32d8('0x40')]['toUpperCase']()==_0x32d8('0x66')){var _0x550fdd=fs['readFileSync'](path[_0x32d8('0x60')](config[_0x32d8('0x61')],_0x32d8('0x68')),_0x32d8('0x63'));var _0x2b591f=ejs[_0x32d8('0x64')](_0x550fdd,{'networks':_0x254152||[]});fs[_0x32d8('0x69')](_0x32d8('0x6a'),_0x2b591f);return respondWithRpcPromise('Reload',_0x32d8('0x38'),{'module':_0x32d8('0x6d')});}else{var _0x3575e3=fs[_0x32d8('0x67')](path[_0x32d8('0x60')](config[_0x32d8('0x61')],_0x32d8('0x6e')),'utf8');var _0x1d7e6c=ejs['render'](_0x3575e3,{'networks':_0x254152||[]});fs['writeFileSync'](util[_0x32d8('0x6b')]('/etc/asterisk/sip_xcally_%s.conf',_0x248187[_0x32d8('0x5e')][_0x32d8('0x40')][_0x32d8('0x6c')]()),_0x1d7e6c);return respondWithRpcPromise(_0x32d8('0x6f'),_0x32d8('0x38'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x12580f){if(_0x12580f){return _0x241bf1;}return null;});})[_0x32d8('0x1f')](respondWithResult(_0x418205,null))[_0x32d8('0x2a')](handleError(_0x418205,null));};exports['destroy']=function(_0x2517ed,_0x7e8304,_0x19628f){var _0x2cd62a;return db[_0x32d8('0x3e')][_0x32d8('0x5a')]({'where':{'id':_0x2517ed['params']['id']}})[_0x32d8('0x1f')](function(_0x40bf79){_0x2cd62a=_0x40bf79;return _0x40bf79;})['then'](handleEntityNotFound(_0x7e8304,null))[_0x32d8('0x1f')](removeEntity(_0x7e8304,null))[_0x32d8('0x1f')](function(){if(_0x2cd62a){return db['Network'][_0x32d8('0x53')]({'where':{'type':_0x2cd62a[_0x32d8('0x40')]},'raw':!![]});}})[_0x32d8('0x1f')](function(_0x4dfdcc){if(_0x2cd62a[_0x32d8('0x40')]['toUpperCase']()==_0x32d8('0x70')){var _0xb2adbb=fs['readFileSync'](path[_0x32d8('0x60')](config[_0x32d8('0x61')],_0x32d8('0x62')),_0x32d8('0x63'));var _0x469a21=ejs['render'](_0xb2adbb,{'networks':_0x4dfdcc||[]});fs['writeFileSync'](_0x32d8('0x65'),_0x469a21);return respondWithRpcPromise(_0x32d8('0x6f'),_0x32d8('0x71'),{'module':'res_stun_monitor.so'});}else if(_0x2cd62a['type'][_0x32d8('0x5f')]()=='TURN'){var _0x2d7b65=fs[_0x32d8('0x67')](path[_0x32d8('0x60')](config[_0x32d8('0x61')],_0x32d8('0x68')),_0x32d8('0x63'));var _0x4e09da=ejs['render'](_0x2d7b65,{'networks':_0x4dfdcc||[]});fs[_0x32d8('0x69')]('/etc/asterisk/turn_xcally.conf',_0x4e09da);return respondWithRpcPromise(_0x32d8('0x6f'),_0x32d8('0x71'),{'module':_0x32d8('0x6d')});}else{var _0x1db387=fs['readFileSync'](path[_0x32d8('0x60')](config[_0x32d8('0x61')],_0x32d8('0x6e')),_0x32d8('0x63'));var _0x5d34c8=ejs[_0x32d8('0x64')](_0x1db387,{'networks':_0x4dfdcc||[]});fs['writeFileSync'](util[_0x32d8('0x6b')](_0x32d8('0x72'),_0x2517ed[_0x32d8('0x5e')][_0x32d8('0x40')]['toLowerCase']()),_0x5d34c8);return respondWithRpcPromise('Reload',_0x32d8('0x71'),{'module':'chan_sip.so'});}return null;})[_0x32d8('0x2a')](handleError(_0x7e8304,null));};
\ No newline at end of file
+var _0xbc8d=['findAll','rows','show','params','find','sequelize','create','body','STUN','root','server/files/templates/stun_multiple.ejs','utf8','render','Reload','toUpperCase','TURN','readFileSync','join','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','update','transaction','format','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','destroy','stack','name','send','Network','rawAttributes','fieldName','key','keys','query','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x4de2e3,_0x7c3e2a){var _0x5df1c7=function(_0x2d2d8d){while(--_0x2d2d8d){_0x4de2e3['push'](_0x4de2e3['shift']());}};_0x5df1c7(++_0x7c3e2a);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xdbc8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbc8('0x1'));var jsonpatch=require(_0xdbc8('0x2'));var rp=require(_0xdbc8('0x3'));var moment=require(_0xdbc8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdbc8('0x5'));var util=require(_0xdbc8('0x6'));var path=require(_0xdbc8('0x7'));var sox=require('sox');var csv=require(_0xdbc8('0x8'));var ejs=require(_0xdbc8('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc8('0xa'));var _=require('lodash');var squel=require(_0xdbc8('0xb'));var crypto=require('crypto');var jsforce=require(_0xdbc8('0xc'));var deskjs=require(_0xdbc8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdbc8('0xe'));var Papa=require(_0xdbc8('0xf'));var Redis=require(_0xdbc8('0x10'));var authService=require(_0xdbc8('0x11'));var qs=require(_0xdbc8('0x12'));var as=require(_0xdbc8('0x13'));var hardwareService=require(_0xdbc8('0x14'));var logger=require(_0xdbc8('0x15'))(_0xdbc8('0x16'));var utils=require(_0xdbc8('0x17'));var config=require(_0xdbc8('0x18'));var licenseUtil=require(_0xdbc8('0x19'));var db=require(_0xdbc8('0x1a'))['db'];var jayson=require(_0xdbc8('0x1b'));var client=jayson[_0xdbc8('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ceaa6,_0x562914,_0x42acc5,_0x40e6cf){return new BPromise(function(_0x43765f,_0x3a7698){var _0x1406b9=_0x40e6cf||client;return _0x1406b9[_0xdbc8('0x1d')](_0x2ceaa6,_0x42acc5)[_0xdbc8('0x1e')](function(_0x32c678){logger[_0xdbc8('0x1f')](_0xdbc8('0x20'),_0x562914,_0xdbc8('0x21'));logger[_0xdbc8('0x22')](_0xdbc8('0x23'),_0x562914,_0xdbc8('0x21'),JSON['stringify'](_0x32c678));if(_0x32c678[_0xdbc8('0x24')]){if(_0x32c678['error']['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x562914,_0x32c678[_0xdbc8('0x24')][_0xdbc8('0x25')]);return _0x3a7698(_0x32c678[_0xdbc8('0x24')][_0xdbc8('0x25')]);}logger[_0xdbc8('0x24')](_0xdbc8('0x20'),_0x562914,_0x32c678[_0xdbc8('0x24')][_0xdbc8('0x25')]);return _0x43765f(_0x32c678[_0xdbc8('0x24')][_0xdbc8('0x25')]);}else{logger[_0xdbc8('0x1f')](_0xdbc8('0x20'),_0x562914,_0xdbc8('0x21'));_0x43765f(_0x32c678[_0xdbc8('0x26')][_0xdbc8('0x25')]);}})[_0xdbc8('0x27')](function(_0x3d3c46){logger[_0xdbc8('0x24')](_0xdbc8('0x20'),_0x562914,_0x3d3c46);_0x3a7698(_0x3d3c46);});});}function respondWithStatusCode(_0x52a331,_0x2794fa){_0x2794fa=_0x2794fa||0xcc;return function(_0x2126c2){if(_0x2126c2){return _0x52a331[_0xdbc8('0x28')](_0x2794fa);}return _0x52a331[_0xdbc8('0x29')](_0x2794fa)[_0xdbc8('0x2a')]();};}function respondWithResult(_0x1ead26,_0xb7c29c){_0xb7c29c=_0xb7c29c||0xc8;return function(_0xbc557a){if(_0xbc557a){return _0x1ead26[_0xdbc8('0x29')](_0xb7c29c)[_0xdbc8('0x2b')](_0xbc557a);}};}function respondWithFilteredResult(_0x139bca,_0x19886c){return function(_0x26064a){if(_0x26064a){var _0x556d28=typeof _0x19886c[_0xdbc8('0x2c')]===_0xdbc8('0x2d')&&typeof _0x19886c[_0xdbc8('0x2e')]===_0xdbc8('0x2d');var _0x36a8d9=_0x26064a['count'];var _0x27ef0e=_0x556d28?0x0:_0x19886c['offset'];var _0x137c8e=_0x556d28?_0x26064a[_0xdbc8('0x2f')]:_0x19886c[_0xdbc8('0x2c')]+_0x19886c['limit'];var _0x243670;if(_0x137c8e>=_0x36a8d9){_0x137c8e=_0x36a8d9;_0x243670=0xc8;}else{_0x243670=0xce;}_0x139bca[_0xdbc8('0x29')](_0x243670);return _0x139bca[_0xdbc8('0x30')]('Content-Range',_0x27ef0e+'-'+_0x137c8e+'/'+_0x36a8d9)[_0xdbc8('0x2b')](_0x26064a);}return null;};}function patchUpdates(_0x46a34c){return function(_0x2f465a){try{jsonpatch[_0xdbc8('0x31')](_0x2f465a,_0x46a34c,!![]);}catch(_0x3293e3){return BPromise['reject'](_0x3293e3);}return _0x2f465a['save']();};}function saveUpdates(_0x21d0d9,_0x54d5d1){return function(_0x341af3){if(_0x341af3){return _0x341af3['update'](_0x21d0d9)['then'](function(_0x463b43){return _0x463b43;});}return null;};}function removeEntity(_0x4b605d,_0x3780f8){return function(_0x117d42){if(_0x117d42){return _0x117d42[_0xdbc8('0x32')]()[_0xdbc8('0x1e')](function(){_0x4b605d[_0xdbc8('0x29')](0xcc)[_0xdbc8('0x2a')]();});}};}function handleEntityNotFound(_0x47cad1,_0x1edf94){return function(_0xdf5ad4){if(!_0xdf5ad4){_0x47cad1['sendStatus'](0x194);}return _0xdf5ad4;};}function handleError(_0x34a3e0,_0x2768a6){_0x2768a6=_0x2768a6||0x1f4;return function(_0x9ade8f){logger['error'](_0x9ade8f[_0xdbc8('0x33')]);if(_0x9ade8f[_0xdbc8('0x34')]){delete _0x9ade8f[_0xdbc8('0x34')];}_0x34a3e0[_0xdbc8('0x29')](_0x2768a6)[_0xdbc8('0x35')](_0x9ade8f);};}exports['index']=function(_0x59eb28,_0x39d913){var _0x2a557e={},_0x6eb2b7={},_0x3c8647={'count':0x0,'rows':[]};var _0x46c391=_['map'](db[_0xdbc8('0x36')][_0xdbc8('0x37')],function(_0x4905d2){return{'name':_0x4905d2[_0xdbc8('0x38')],'type':_0x4905d2['type'][_0xdbc8('0x39')]};});_0x6eb2b7['model']=_['map'](_0x46c391,'name');_0x6eb2b7['query']=_[_0xdbc8('0x3a')](_0x59eb28[_0xdbc8('0x3b')]);_0x6eb2b7['filters']=_[_0xdbc8('0x3c')](_0x6eb2b7[_0xdbc8('0x3d')],_0x6eb2b7[_0xdbc8('0x3b')]);_0x2a557e['attributes']=_[_0xdbc8('0x3c')](_0x6eb2b7[_0xdbc8('0x3d')],qs[_0xdbc8('0x3e')](_0x59eb28[_0xdbc8('0x3b')][_0xdbc8('0x3e')]));_0x2a557e[_0xdbc8('0x3f')]=_0x2a557e[_0xdbc8('0x3f')][_0xdbc8('0x40')]?_0x2a557e[_0xdbc8('0x3f')]:_0x6eb2b7[_0xdbc8('0x3d')];if(!_0x59eb28[_0xdbc8('0x3b')]['hasOwnProperty'](_0xdbc8('0x41'))){_0x2a557e[_0xdbc8('0x2e')]=qs['limit'](_0x59eb28['query'][_0xdbc8('0x2e')]);_0x2a557e[_0xdbc8('0x2c')]=qs[_0xdbc8('0x2c')](_0x59eb28[_0xdbc8('0x3b')][_0xdbc8('0x2c')]);}_0x2a557e['order']=qs['sort'](_0x59eb28[_0xdbc8('0x3b')][_0xdbc8('0x42')]);_0x2a557e[_0xdbc8('0x43')]=qs['filters'](_[_0xdbc8('0x44')](_0x59eb28['query'],_0x6eb2b7[_0xdbc8('0x45')]),_0x46c391);if(_0x59eb28[_0xdbc8('0x3b')][_0xdbc8('0x46')]){_0x2a557e[_0xdbc8('0x43')]=_[_0xdbc8('0x47')](_0x2a557e[_0xdbc8('0x43')],{'$or':_['map'](_0x46c391,function(_0x48cda1){if(_0x48cda1[_0xdbc8('0x48')]!==_0xdbc8('0x49')){var _0x222c6c={};_0x222c6c[_0x48cda1[_0xdbc8('0x34')]]={'$like':'%'+_0x59eb28[_0xdbc8('0x3b')][_0xdbc8('0x46')]+'%'};return _0x222c6c;}})});}_0x2a557e=_['merge']({},_0x2a557e,_0x59eb28[_0xdbc8('0x4a')]);var _0x520363={'where':_0x2a557e[_0xdbc8('0x43')]};return db[_0xdbc8('0x36')]['count'](_0x520363)[_0xdbc8('0x1e')](function(_0x168e59){_0x3c8647[_0xdbc8('0x2f')]=_0x168e59;if(_0x59eb28['query'][_0xdbc8('0x4b')]){_0x2a557e[_0xdbc8('0x4c')]=[{'all':!![]}];}return db['Network'][_0xdbc8('0x4d')](_0x2a557e);})[_0xdbc8('0x1e')](function(_0x465eba){_0x3c8647[_0xdbc8('0x4e')]=_0x465eba;return _0x3c8647;})[_0xdbc8('0x1e')](respondWithFilteredResult(_0x39d913,_0x2a557e))[_0xdbc8('0x27')](handleError(_0x39d913,null));};exports[_0xdbc8('0x4f')]=function(_0x21f023,_0x101cf9){var _0x21fba7={'raw':!![],'where':{'id':_0x21f023[_0xdbc8('0x50')]['id']}},_0x426efc={};_0x426efc[_0xdbc8('0x3d')]=_['keys'](db['Network'][_0xdbc8('0x37')]);_0x426efc['query']=_['keys'](_0x21f023['query']);_0x426efc['filters']=_[_0xdbc8('0x3c')](_0x426efc[_0xdbc8('0x3d')],_0x426efc[_0xdbc8('0x3b')]);_0x21fba7['attributes']=_[_0xdbc8('0x3c')](_0x426efc['model'],qs[_0xdbc8('0x3e')](_0x21f023[_0xdbc8('0x3b')][_0xdbc8('0x3e')]));_0x21fba7[_0xdbc8('0x3f')]=_0x21fba7[_0xdbc8('0x3f')][_0xdbc8('0x40')]?_0x21fba7[_0xdbc8('0x3f')]:_0x426efc[_0xdbc8('0x3d')];if(_0x21f023[_0xdbc8('0x3b')][_0xdbc8('0x4b')]){_0x21fba7[_0xdbc8('0x4c')]=[{'all':!![]}];}_0x21fba7=_[_0xdbc8('0x47')]({},_0x21fba7,_0x21f023['options']);return db[_0xdbc8('0x36')][_0xdbc8('0x51')](_0x21fba7)[_0xdbc8('0x1e')](handleEntityNotFound(_0x101cf9,null))['then'](respondWithResult(_0x101cf9,null))['catch'](handleError(_0x101cf9,null));};exports['create']=function(_0x351365,_0x20d196,_0x5dbd09){var _0x3869cf;return db[_0xdbc8('0x52')]['transaction'](function(_0x1fe0ad){return db['Network'][_0xdbc8('0x53')](_0x351365[_0xdbc8('0x54')],{'raw':!![]})[_0xdbc8('0x1e')](function(_0x2980a4){_0x3869cf=_0x2980a4;return db[_0xdbc8('0x36')][_0xdbc8('0x4d')]({'where':{'type':_0x351365[_0xdbc8('0x54')][_0xdbc8('0x48')]},'raw':!![]});})[_0xdbc8('0x1e')](function(_0x209774){if(_0x3869cf[_0xdbc8('0x48')]['toUpperCase']()==_0xdbc8('0x55')){var _0x5af35c=fs['readFileSync'](path['join'](config[_0xdbc8('0x56')],_0xdbc8('0x57')),_0xdbc8('0x58'));var _0x35f2fb=ejs[_0xdbc8('0x59')](_0x5af35c,{'networks':_0x209774||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x35f2fb);return respondWithRpcPromise(_0xdbc8('0x5a'),_0xdbc8('0x53'),{'module':'res_stun_monitor.so'});}else if(_0x3869cf['type'][_0xdbc8('0x5b')]()==_0xdbc8('0x5c')){var _0x42c3b2=fs[_0xdbc8('0x5d')](path[_0xdbc8('0x5e')](config[_0xdbc8('0x56')],_0xdbc8('0x5f')),_0xdbc8('0x58'));var _0x3a0a4d=ejs[_0xdbc8('0x59')](_0x42c3b2,{'networks':_0x209774||[]});fs[_0xdbc8('0x60')](_0xdbc8('0x61'),_0x3a0a4d);return respondWithRpcPromise('Reload','create',{'module':_0xdbc8('0x62')});}else{var _0x22d3c3=fs[_0xdbc8('0x5d')](path[_0xdbc8('0x5e')](config[_0xdbc8('0x56')],_0xdbc8('0x63')),_0xdbc8('0x58'));var _0x19894f=ejs[_0xdbc8('0x59')](_0x22d3c3,{'networks':_0x209774||[]});fs['writeFileSync'](util['format'](_0xdbc8('0x64'),_0x351365[_0xdbc8('0x54')][_0xdbc8('0x48')]['toLowerCase']()),_0x19894f);return respondWithRpcPromise('Reload','create',{'module':_0xdbc8('0x65')});}return null;})[_0xdbc8('0x1e')](function(){return _0x3869cf;});})['then'](respondWithResult(_0x20d196,0xc9))[_0xdbc8('0x27')](handleError(_0x20d196,null));};exports[_0xdbc8('0x66')]=function(_0x1e9fb9,_0x501ae7,_0x3e0b5f){var _0x18b23f;return db[_0xdbc8('0x52')][_0xdbc8('0x67')](function(_0x40fa7b){return db[_0xdbc8('0x36')][_0xdbc8('0x51')]({'where':{'id':_0x1e9fb9[_0xdbc8('0x50')]['id']}})[_0xdbc8('0x1e')](handleEntityNotFound(_0x501ae7,null))[_0xdbc8('0x1e')](saveUpdates(_0x1e9fb9[_0xdbc8('0x54')],null))[_0xdbc8('0x1e')](function(_0x2bb685){if(_0x2bb685){_0x18b23f=_0x2bb685;return db['Network'][_0xdbc8('0x4d')]({'where':{'type':_0x18b23f['type']},'raw':!![]});}return null;})[_0xdbc8('0x1e')](function(_0x4333b5){if(_0x18b23f[_0xdbc8('0x48')][_0xdbc8('0x5b')]()==_0xdbc8('0x55')){var _0x411631=fs[_0xdbc8('0x5d')](path[_0xdbc8('0x5e')](config[_0xdbc8('0x56')],_0xdbc8('0x57')),_0xdbc8('0x58'));var _0x4fed1f=ejs[_0xdbc8('0x59')](_0x411631,{'networks':_0x4333b5||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x4fed1f);return respondWithRpcPromise(_0xdbc8('0x5a'),_0xdbc8('0x66'),{'module':_0xdbc8('0x62')});}else if(_0x18b23f[_0xdbc8('0x48')]['toUpperCase']()==_0xdbc8('0x5c')){var _0x51f142=fs[_0xdbc8('0x5d')](path[_0xdbc8('0x5e')](config[_0xdbc8('0x56')],_0xdbc8('0x5f')),'utf8');var _0x587941=ejs[_0xdbc8('0x59')](_0x51f142,{'networks':_0x4333b5||[]});fs['writeFileSync'](_0xdbc8('0x61'),_0x587941);return respondWithRpcPromise(_0xdbc8('0x5a'),_0xdbc8('0x66'),{'module':'res_stun_monitor.so'});}else{var _0x305c63=fs[_0xdbc8('0x5d')](path[_0xdbc8('0x5e')](config[_0xdbc8('0x56')],_0xdbc8('0x63')),'utf8');var _0x28187c=ejs[_0xdbc8('0x59')](_0x305c63,{'networks':_0x4333b5||[]});fs[_0xdbc8('0x60')](util[_0xdbc8('0x68')](_0xdbc8('0x64'),_0x1e9fb9[_0xdbc8('0x54')][_0xdbc8('0x48')][_0xdbc8('0x69')]()),_0x28187c);return respondWithRpcPromise('Reload','update',{'module':_0xdbc8('0x65')});}return null;})['then'](function(_0x4f747e){if(_0x4f747e){return _0x18b23f;}return null;});})['then'](respondWithResult(_0x501ae7,null))[_0xdbc8('0x27')](handleError(_0x501ae7,null));};exports[_0xdbc8('0x32')]=function(_0x2d9a51,_0x545d46,_0x277596){var _0x3153bd;return db[_0xdbc8('0x36')]['find']({'where':{'id':_0x2d9a51[_0xdbc8('0x50')]['id']}})['then'](function(_0x5431f1){_0x3153bd=_0x5431f1;return _0x5431f1;})['then'](handleEntityNotFound(_0x545d46,null))[_0xdbc8('0x1e')](removeEntity(_0x545d46,null))['then'](function(){if(_0x3153bd){return db[_0xdbc8('0x36')][_0xdbc8('0x4d')]({'where':{'type':_0x3153bd[_0xdbc8('0x48')]},'raw':!![]});}})['then'](function(_0x34ddf6){if(_0x3153bd['type']['toUpperCase']()=='STUN'){var _0x51cc08=fs['readFileSync'](path[_0xdbc8('0x5e')](config['root'],'server/files/templates/stun_multiple.ejs'),_0xdbc8('0x58'));var _0x55aba0=ejs['render'](_0x51cc08,{'networks':_0x34ddf6||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x55aba0);return respondWithRpcPromise(_0xdbc8('0x5a'),_0xdbc8('0x32'),{'module':_0xdbc8('0x62')});}else if(_0x3153bd[_0xdbc8('0x48')][_0xdbc8('0x5b')]()==_0xdbc8('0x5c')){var _0x40f589=fs[_0xdbc8('0x5d')](path[_0xdbc8('0x5e')](config[_0xdbc8('0x56')],_0xdbc8('0x5f')),_0xdbc8('0x58'));var _0x5f1b93=ejs[_0xdbc8('0x59')](_0x40f589,{'networks':_0x34ddf6||[]});fs[_0xdbc8('0x60')]('/etc/asterisk/turn_xcally.conf',_0x5f1b93);return respondWithRpcPromise(_0xdbc8('0x5a'),_0xdbc8('0x32'),{'module':_0xdbc8('0x62')});}else{var _0xa5d33f=fs[_0xdbc8('0x5d')](path[_0xdbc8('0x5e')](config[_0xdbc8('0x56')],_0xdbc8('0x63')),_0xdbc8('0x58'));var _0x1461ab=ejs[_0xdbc8('0x59')](_0xa5d33f,{'networks':_0x34ddf6||[]});fs[_0xdbc8('0x60')](util[_0xdbc8('0x68')](_0xdbc8('0x64'),_0x2d9a51[_0xdbc8('0x54')][_0xdbc8('0x48')]['toLowerCase']()),_0x1461ab);return respondWithRpcPromise(_0xdbc8('0x5a'),'destroy',{'module':'chan_sip.so'});}return null;})[_0xdbc8('0x27')](handleError(_0x545d46,null));};
\ No newline at end of file
index ac895b7..82f38a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x131e=['request-promise','path','rimraf','./network.attributes','exports','define','api','moment','bluebird'];(function(_0x168127,_0x59cea1){var _0x4c99ad=function(_0x4ab3f2){while(--_0x4ab3f2){_0x168127['push'](_0x168127['shift']());}};_0x4c99ad(++_0x59cea1);}(_0x131e,0x1ec));var _0xe131=function(_0x22659e,_0x15b59e){_0x22659e=_0x22659e-0x0;var _0x53601b=_0x131e[_0x22659e];return _0x53601b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe131('0x0'));var moment=require(_0xe131('0x1'));var BPromise=require(_0xe131('0x2'));var rp=require(_0xe131('0x3'));var fs=require('fs');var path=require(_0xe131('0x4'));var rimraf=require(_0xe131('0x5'));var config=require('../../config/environment');var attributes=require(_0xe131('0x6'));module[_0xe131('0x7')]=function(_0x2de969,_0x1eb0df){return _0x2de969[_0xe131('0x8')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd52d=['../../config/environment','./network.attributes','exports','define','network','util','../../config/logger','moment','path','rimraf'];(function(_0x10dee3,_0xfbaca9){var _0xaa3040=function(_0x2a58d8){while(--_0x2a58d8){_0x10dee3['push'](_0x10dee3['shift']());}};_0xaa3040(++_0xfbaca9);}(_0xd52d,0x1c7));var _0xdd52=function(_0x1cc270,_0xe7294e){_0x1cc270=_0x1cc270-0x0;var _0x4ce2df=_0xd52d[_0x1cc270];return _0x4ce2df;};'use strict';var _=require('lodash');var util=require(_0xdd52('0x0'));var logger=require(_0xdd52('0x1'))('api');var moment=require(_0xdd52('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd52('0x3'));var rimraf=require(_0xdd52('0x4'));var config=require(_0xdd52('0x5'));var attributes=require(_0xdd52('0x6'));module[_0xdd52('0x7')]=function(_0x3b56e5,_0x319c4a){return _0x3b56e5[_0xdd52('0x8')]('Network',attributes,{'tableName':_0xdd52('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 58c5a1d..c185951 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(_0x4eef98,_0x5b400a){_0x4eef98=_0x4eef98-0x0;var _0x30b2a1=_0x7a54[_0x4eef98];return _0x30b2a1;};'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(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x444f00,_0x559039){_0x444f00=_0x444f00-0x0;var _0x484546=_0x7a54[_0x444f00];return _0x484546;};'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 ff81787..00045a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb8b=['create','/:id/notify','notify','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','post'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xeb8b,0x1a4));var _0xbeb8=function(_0x16418a,_0x5e4e0c){_0x16418a=_0x16418a-0x0;var _0x4abc9e=_0xeb8b[_0x16418a];return _0x4abc9e;};'use strict';var multer=require(_0xbeb8('0x0'));var util=require(_0xbeb8('0x1'));var path=require(_0xbeb8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbeb8('0x3')]();var fs_extra=require(_0xbeb8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbeb8('0x5'));var config=require(_0xbeb8('0x6'));var controller=require('./openchannelAccount.controller');router[_0xbeb8('0x7')]('/',auth['isAuthenticated'](),controller[_0xbeb8('0x8')]);router['get'](_0xbeb8('0x9'),auth[_0xbeb8('0xa')](),controller[_0xbeb8('0xb')]);router[_0xbeb8('0x7')](_0xbeb8('0xc'),auth[_0xbeb8('0xa')](),controller['show']);router['get'](_0xbeb8('0xd'),auth[_0xbeb8('0xa')](),controller[_0xbeb8('0xe')]);router[_0xbeb8('0x7')](_0xbeb8('0xf'),auth[_0xbeb8('0xa')](),controller[_0xbeb8('0x10')]);router['get'](_0xbeb8('0x11'),auth[_0xbeb8('0xa')](),controller['getApplications']);router['get'](_0xbeb8('0x12'),auth['isAuthenticated'](),controller[_0xbeb8('0x13')]);router[_0xbeb8('0x7')](_0xbeb8('0x14'),auth[_0xbeb8('0xa')](),controller['getAgents']);router[_0xbeb8('0x15')]('/',auth[_0xbeb8('0xa')](),controller[_0xbeb8('0x16')]);router[_0xbeb8('0x15')](_0xbeb8('0xd'),auth[_0xbeb8('0xa')](),controller['addDisposition']);router[_0xbeb8('0x15')]('/:id/canned_answers',auth[_0xbeb8('0xa')](),controller['addAnswer']);router['post'](_0xbeb8('0x17'),controller[_0xbeb8('0x18')]);router[_0xbeb8('0x15')](_0xbeb8('0x11'),auth[_0xbeb8('0xa')](),controller[_0xbeb8('0x19')]);router['post'](_0xbeb8('0x14'),auth[_0xbeb8('0xa')](),controller['addAgents']);router[_0xbeb8('0x15')](_0xbeb8('0x1a'),auth[_0xbeb8('0xa')](),controller[_0xbeb8('0x1b')]);router[_0xbeb8('0x1c')]('/:id',auth[_0xbeb8('0xa')](),controller[_0xbeb8('0x1d')]);router[_0xbeb8('0x1e')](_0xbeb8('0xc'),auth['isAuthenticated'](),controller[_0xbeb8('0x1f')]);router[_0xbeb8('0x1e')](_0xbeb8('0xd'),auth[_0xbeb8('0xa')](),controller[_0xbeb8('0x20')]);router[_0xbeb8('0x1e')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0xbeb8('0x1e')](_0xbeb8('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xbeb8('0x21')]=router;
\ No newline at end of file
+var _0x4108=['addApplications','/:id/users','/:id/send','put','delete','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','/:id/interactions','getAgents','post','addDisposition','addAnswer','/:id/notify','notify'];(function(_0x579dbd,_0x26f50c){var _0x2449c9=function(_0x31a0f6){while(--_0x31a0f6){_0x579dbd['push'](_0x579dbd['shift']());}};_0x2449c9(++_0x26f50c);}(_0x4108,0x165));var _0x8410=function(_0x115264,_0x126464){_0x115264=_0x115264-0x0;var _0x150f82=_0x4108[_0x115264];return _0x150f82;};'use strict';var multer=require(_0x8410('0x0'));var util=require(_0x8410('0x1'));var path=require(_0x8410('0x2'));var timeout=require(_0x8410('0x3'));var express=require(_0x8410('0x4'));var router=express[_0x8410('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8410('0x6'));var interaction=require(_0x8410('0x7'));var config=require(_0x8410('0x8'));var controller=require(_0x8410('0x9'));router[_0x8410('0xa')]('/',auth[_0x8410('0xb')](),controller[_0x8410('0xc')]);router[_0x8410('0xa')](_0x8410('0xd'),auth[_0x8410('0xb')](),controller[_0x8410('0xe')]);router[_0x8410('0xa')](_0x8410('0xf'),auth[_0x8410('0xb')](),controller[_0x8410('0x10')]);router['get'](_0x8410('0x11'),auth[_0x8410('0xb')](),controller[_0x8410('0x12')]);router[_0x8410('0xa')](_0x8410('0x13'),auth[_0x8410('0xb')](),controller['getAnswers']);router['get'](_0x8410('0x14'),auth[_0x8410('0xb')](),controller['getApplications']);router[_0x8410('0xa')](_0x8410('0x15'),auth[_0x8410('0xb')](),controller['getInteractions']);router[_0x8410('0xa')]('/:id/users',auth[_0x8410('0xb')](),controller[_0x8410('0x16')]);router[_0x8410('0x17')]('/',auth[_0x8410('0xb')](),controller['create']);router[_0x8410('0x17')](_0x8410('0x11'),auth[_0x8410('0xb')](),controller[_0x8410('0x18')]);router[_0x8410('0x17')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8410('0x19')]);router[_0x8410('0x17')](_0x8410('0x1a'),controller[_0x8410('0x1b')]);router['post'](_0x8410('0x14'),auth[_0x8410('0xb')](),controller[_0x8410('0x1c')]);router[_0x8410('0x17')](_0x8410('0x1d'),auth['isAuthenticated'](),controller['addAgents']);router[_0x8410('0x17')](_0x8410('0x1e'),auth[_0x8410('0xb')](),controller['send']);router[_0x8410('0x1f')](_0x8410('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8410('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0x8410('0x20')](_0x8410('0x11'),auth['isAuthenticated'](),controller[_0x8410('0x21')]);router[_0x8410('0x20')](_0x8410('0x13'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x8410('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0x8410('0x22')]);module['exports']=router;
\ No newline at end of file
index b5d98c2..0ee3bbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4fa=['mandatoryDispositionPauseId','sequelize','STRING','name','generate','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xd4fa,0xb5));var _0xad4f=function(_0x4e7c1c,_0x56eafd){_0x4e7c1c=_0x4e7c1c-0x0;var _0x47adb2=_0xd4fa[_0x4e7c1c];return _0x47adb2;};'use strict';var Sequelize=require(_0xad4f('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xad4f('0x1')],'unique':_0xad4f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xad4f('0x1')]},'token':{'type':Sequelize[_0xad4f('0x1')],'defaultValue':function(){return rs[_0xad4f('0x3')]();}},'replyUri':{'type':Sequelize[_0xad4f('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xad4f('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xad4f('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xad4f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xad4f('0x1')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xad4f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xad4f('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xad4f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xad4f('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xad4f('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xad4f('0x4')],'defaultValue':![],'comment':_0xad4f('0x7'),'set':function(_0x392e35){if(!_0x392e35)this[_0xad4f('0x8')](_0xad4f('0x9'),null);this[_0xad4f('0x8')]('mandatoryDisposition',_0x392e35);}}};
\ No newline at end of file
+var _0x6474=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports','STRING','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x2c50a6,_0x2a9854){var _0x3e6556=function(_0x3ad784){while(--_0x3ad784){_0x2c50a6['push'](_0x2c50a6['shift']());}};_0x3e6556(++_0x2a9854);}(_0x6474,0x12c));var _0x4647=function(_0x18543e,_0x346b94){_0x18543e=_0x18543e-0x0;var _0x5efeaa=_0x6474[_0x18543e];return _0x5efeaa;};'use strict';var Sequelize=require(_0x4647('0x0'));var rs=require('randomstring');module[_0x4647('0x1')]={'name':{'type':Sequelize[_0x4647('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x4647('0x2')]},'token':{'type':Sequelize[_0x4647('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x4647('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4647('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4647('0x3')],'defaultValue':function(){return _0x4647('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4647('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x4647('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4647('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4647('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4647('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x4647('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4647('0x8'),'set':function(_0x182a41){if(!_0x182a41)this[_0x4647('0x9')](_0x4647('0xa'),null);this[_0x4647('0x9')]('mandatoryDisposition',_0x182a41);}}};
\ No newline at end of file
index 790d375..70ade02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc54c=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','sort','removeDispositions','ids','CannedAnswer','findOne','findAll','removeAnswers','notify','openchannel','CmContact','Sequelize','difference','updatedAt','createdAt','isNil','from\x20is\x20mandatory','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','Applications','account','applications','orderBy','ListId','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','lastName','messageId','interaction','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','OpenchannelApplication','priority','getApplications','getInteractions','Contact','Owner','fullname','Tags','color','tag','addAgents','omit','spread','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','OpenchannelMessage','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','jayson/promise','http','client','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','VIRTUAL','where','includeAll','rows','catch','show','params','include','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0xc54c,0x1d0));var _0xcc54=function(_0x4bdf64,_0x3022b2){_0x4bdf64=_0x4bdf64-0x0;var _0x9a1a19=_0xc54c[_0x4bdf64];return _0x9a1a19;};'use strict';var emlformat=require(_0xcc54('0x0'));var rimraf=require(_0xcc54('0x1'));var zipdir=require(_0xcc54('0x2'));var jsonpatch=require(_0xcc54('0x3'));var rp=require(_0xcc54('0x4'));var moment=require(_0xcc54('0x5'));var BPromise=require(_0xcc54('0x6'));var Mustache=require(_0xcc54('0x7'));var util=require('util');var path=require('path');var sox=require(_0xcc54('0x8'));var csv=require(_0xcc54('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc54('0xa'));var _=require('lodash');var squel=require(_0xcc54('0xb'));var crypto=require(_0xcc54('0xc'));var jsforce=require(_0xcc54('0xd'));var deskjs=require(_0xcc54('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcc54('0xf'));var Redis=require(_0xcc54('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcc54('0x11'));var as=require(_0xcc54('0x12'));var hardwareService=require(_0xcc54('0x13'));var logger=require(_0xcc54('0x14'))(_0xcc54('0x15'));var utils=require(_0xcc54('0x16'));var config=require(_0xcc54('0x17'));var licenseUtil=require(_0xcc54('0x18'));var db=require('../../mysqldb')['db'];config[_0xcc54('0x19')]=_[_0xcc54('0x1a')](config['redis'],{'host':_0xcc54('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcc54('0x19')]));require('./openchannelAccount.socket')[_0xcc54('0x1c')](socket);var jayson=require(_0xcc54('0x1d'));var client=jayson['client'][_0xcc54('0x1e')]({'port':0x232c});var client9002=jayson[_0xcc54('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c436b,_0x293f54,_0x450cdf,_0x1028ce){return new BPromise(function(_0x5ad4ff,_0x51c944){var _0x1435a4=_0x1028ce||client;return _0x1435a4[_0xcc54('0x20')](_0x3c436b,_0x450cdf)[_0xcc54('0x21')](function(_0x33639f){logger['info'](_0xcc54('0x22'),_0x293f54,_0xcc54('0x23'));logger[_0xcc54('0x24')](_0xcc54('0x25'),_0x293f54,_0xcc54('0x23'),JSON[_0xcc54('0x26')](_0x33639f));if(_0x33639f['error']){if(_0x33639f['error'][_0xcc54('0x27')]===0x1f4){logger[_0xcc54('0x28')](_0xcc54('0x22'),_0x293f54,_0x33639f[_0xcc54('0x28')]['message']);return _0x51c944(_0x33639f[_0xcc54('0x28')]['message']);}logger['error'](_0xcc54('0x22'),_0x293f54,_0x33639f[_0xcc54('0x28')][_0xcc54('0x29')]);return _0x5ad4ff(_0x33639f[_0xcc54('0x28')]['message']);}else{logger[_0xcc54('0x2a')](_0xcc54('0x22'),_0x293f54,_0xcc54('0x23'));_0x5ad4ff(_0x33639f[_0xcc54('0x2b')][_0xcc54('0x29')]);}})['catch'](function(_0x5b79b1){logger[_0xcc54('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x293f54,_0x5b79b1);_0x51c944(_0x5b79b1);});});}function respondWithStatusCode(_0x38feca,_0x402dd9){_0x402dd9=_0x402dd9||0xcc;return function(_0x5ba0ab){if(_0x5ba0ab){return _0x38feca[_0xcc54('0x2c')](_0x402dd9);}return _0x38feca[_0xcc54('0x2d')](_0x402dd9)[_0xcc54('0x2e')]();};}function respondWithResult(_0x3b4c02,_0x4f598a){_0x4f598a=_0x4f598a||0xc8;return function(_0x226a1b){if(_0x226a1b){return _0x3b4c02['status'](_0x4f598a)['json'](_0x226a1b);}};}function respondWithFilteredResult(_0x40b26f,_0x235207){return function(_0x2c51c1){if(_0x2c51c1){var _0x245593=typeof _0x235207[_0xcc54('0x2f')]==='undefined'&&typeof _0x235207[_0xcc54('0x30')]==='undefined';var _0x647b26=_0x2c51c1['count'];var _0xfcef0d=_0x245593?0x0:_0x235207[_0xcc54('0x2f')];var _0x2d6640=_0x245593?_0x2c51c1[_0xcc54('0x31')]:_0x235207[_0xcc54('0x2f')]+_0x235207[_0xcc54('0x30')];var _0x592d3f;if(_0x2d6640>=_0x647b26){_0x2d6640=_0x647b26;_0x592d3f=0xc8;}else{_0x592d3f=0xce;}_0x40b26f[_0xcc54('0x2d')](_0x592d3f);return _0x40b26f[_0xcc54('0x32')](_0xcc54('0x33'),_0xfcef0d+'-'+_0x2d6640+'/'+_0x647b26)[_0xcc54('0x34')](_0x2c51c1);}return null;};}function patchUpdates(_0x164cd8){return function(_0x40909d){try{jsonpatch[_0xcc54('0x35')](_0x40909d,_0x164cd8,!![]);}catch(_0x142d12){return BPromise[_0xcc54('0x36')](_0x142d12);}return _0x40909d[_0xcc54('0x37')]();};}function saveUpdates(_0xddcf81,_0x55296c){return function(_0xbb0d21){if(_0xbb0d21){return _0xbb0d21[_0xcc54('0x38')](_0xddcf81)[_0xcc54('0x21')](function(_0x4cf603){return _0x4cf603;});}return null;};}function removeEntity(_0x21bc01,_0x47b18f){return function(_0x3fb99b){if(_0x3fb99b){return _0x3fb99b['destroy']()[_0xcc54('0x21')](function(){var _0x2116a2=_0x3fb99b['get']({'plain':!![]});var _0x5e3f92=_0xcc54('0x39');return db[_0xcc54('0x3a')][_0xcc54('0x3b')]({'where':{'type':_0x5e3f92,'resourceId':_0x2116a2['id']}})['then'](function(){return _0x3fb99b;});})[_0xcc54('0x21')](function(){_0x21bc01[_0xcc54('0x2d')](0xcc)[_0xcc54('0x2e')]();});}};}function handleEntityNotFound(_0x53dae3,_0x512a27){return function(_0x47aff6){if(!_0x47aff6){_0x53dae3['sendStatus'](0x194);}return _0x47aff6;};}function handleError(_0x3d49a6,_0x2d99ff){_0x2d99ff=_0x2d99ff||0x1f4;return function(_0x27a634){logger['error'](_0x27a634[_0xcc54('0x3c')]);if(_0x27a634['name']){delete _0x27a634[_0xcc54('0x3d')];}_0x3d49a6[_0xcc54('0x2d')](_0x2d99ff)[_0xcc54('0x3e')](_0x27a634);};}exports[_0xcc54('0x3f')]=function(_0x11aee9,_0x46b75b){var _0x1218a9={'include':[{'model':db[_0xcc54('0x40')],'as':_0xcc54('0x41')}]},_0xcb8daa={},_0x57f23e={'count':0x0,'rows':[]};var _0x886c3=_['map'](db[_0xcc54('0x42')][_0xcc54('0x43')],function(_0x14d244){return{'name':_0x14d244[_0xcc54('0x44')],'type':_0x14d244[_0xcc54('0x45')][_0xcc54('0x46')]};});_0xcb8daa[_0xcc54('0x47')]=_[_0xcc54('0x48')](_0x886c3,_0xcc54('0x3d'));_0xcb8daa[_0xcc54('0x49')]=_[_0xcc54('0x4a')](_0x11aee9[_0xcc54('0x49')]);_0xcb8daa[_0xcc54('0x4b')]=_[_0xcc54('0x4c')](_0xcb8daa[_0xcc54('0x47')],_0xcb8daa[_0xcc54('0x49')]);_0x1218a9[_0xcc54('0x4d')]=_[_0xcc54('0x4c')](_0xcb8daa[_0xcc54('0x47')],qs[_0xcc54('0x4e')](_0x11aee9[_0xcc54('0x49')][_0xcc54('0x4e')]));_0x1218a9[_0xcc54('0x4d')]=_0x1218a9['attributes'][_0xcc54('0x4f')]?_0x1218a9[_0xcc54('0x4d')]:_0xcb8daa[_0xcc54('0x47')];if(!_0x11aee9[_0xcc54('0x49')][_0xcc54('0x50')](_0xcc54('0x51'))){_0x1218a9[_0xcc54('0x30')]=qs[_0xcc54('0x30')](_0x11aee9[_0xcc54('0x49')][_0xcc54('0x30')]);_0x1218a9[_0xcc54('0x2f')]=qs['offset'](_0x11aee9[_0xcc54('0x49')][_0xcc54('0x2f')]);}_0x1218a9[_0xcc54('0x52')]=qs['sort'](_0x11aee9[_0xcc54('0x49')]['sort']);_0x1218a9['where']=qs[_0xcc54('0x4b')](_[_0xcc54('0x53')](_0x11aee9[_0xcc54('0x49')],_0xcb8daa[_0xcc54('0x4b')]),_0x886c3);if(_0x11aee9[_0xcc54('0x49')][_0xcc54('0x54')]){_0x1218a9['where']=_[_0xcc54('0x55')](_0x1218a9['where'],{'$or':_[_0xcc54('0x48')](_0x886c3,function(_0x3d99bf){if(_0x3d99bf[_0xcc54('0x45')]!==_0xcc54('0x56')){var _0x5b3077={};_0x5b3077[_0x3d99bf[_0xcc54('0x3d')]]={'$like':'%'+_0x11aee9[_0xcc54('0x49')][_0xcc54('0x54')]+'%'};return _0x5b3077;}})});}_0x1218a9=_[_0xcc54('0x55')]({},_0x1218a9,_0x11aee9['options']);var _0x231d2a={'where':_0x1218a9[_0xcc54('0x57')]};return db[_0xcc54('0x42')][_0xcc54('0x31')](_0x231d2a)[_0xcc54('0x21')](function(_0x54c4b3){_0x57f23e[_0xcc54('0x31')]=_0x54c4b3;if(_0x11aee9['query'][_0xcc54('0x58')]){_0x1218a9['include']=[{'all':!![]}];}return db[_0xcc54('0x42')]['findAll'](_0x1218a9);})['then'](function(_0x10de31){_0x57f23e[_0xcc54('0x59')]=_0x10de31;return _0x57f23e;})[_0xcc54('0x21')](respondWithFilteredResult(_0x46b75b,_0x1218a9))[_0xcc54('0x5a')](handleError(_0x46b75b,null));};exports[_0xcc54('0x5b')]=function(_0x335189,_0x59c5b5){var _0x246e51={'raw':![],'where':{'id':_0x335189[_0xcc54('0x5c')]['id']},'include':[{'model':db[_0xcc54('0x40')],'as':_0xcc54('0x41')}]},_0x346a32={};_0x346a32[_0xcc54('0x47')]=_['keys'](db['OpenchannelAccount'][_0xcc54('0x43')]);_0x346a32['query']=_['keys'](_0x335189[_0xcc54('0x49')]);_0x346a32[_0xcc54('0x4b')]=_['intersection'](_0x346a32[_0xcc54('0x47')],_0x346a32['query']);_0x246e51[_0xcc54('0x4d')]=_[_0xcc54('0x4c')](_0x346a32[_0xcc54('0x47')],qs[_0xcc54('0x4e')](_0x335189['query']['fields']));_0x246e51[_0xcc54('0x4d')]=_0x246e51[_0xcc54('0x4d')]['length']?_0x246e51[_0xcc54('0x4d')]:_0x346a32['model'];if(_0x335189[_0xcc54('0x49')][_0xcc54('0x58')]){_0x246e51[_0xcc54('0x5d')]=[{'all':!![]}];}_0x246e51=_[_0xcc54('0x55')]({},_0x246e51,_0x335189[_0xcc54('0x5e')]);return db['OpenchannelAccount'][_0xcc54('0x5f')](_0x246e51)[_0xcc54('0x21')](handleEntityNotFound(_0x59c5b5,null))[_0xcc54('0x21')](respondWithResult(_0x59c5b5,null))[_0xcc54('0x5a')](handleError(_0x59c5b5,null));};exports[_0xcc54('0x60')]=function(_0x3c36d6,_0x122d7e){return db[_0xcc54('0x42')][_0xcc54('0x60')](_0x3c36d6[_0xcc54('0x61')],{})[_0xcc54('0x21')](function(_0x5de187){var _0x21ada2=_0x3c36d6['user'][_0xcc54('0x62')]({'plain':!![]});if(!_0x21ada2)throw new Error(_0xcc54('0x63'));if(_0x21ada2[_0xcc54('0x64')]===_0xcc54('0x65')){var _0x499aef=_0x5de187[_0xcc54('0x62')]({'plain':!![]});var _0x3392df='OpenchannelAccounts';return db[_0xcc54('0x66')][_0xcc54('0x5f')]({'where':{'name':_0x3392df,'userProfileId':_0x21ada2['userProfileId']},'raw':!![]})[_0xcc54('0x21')](function(_0x2b30a7){if(_0x2b30a7&&_0x2b30a7[_0xcc54('0x67')]===0x0){return db[_0xcc54('0x3a')][_0xcc54('0x60')]({'name':_0x499aef['name'],'resourceId':_0x499aef['id'],'type':_0x2b30a7['name'],'sectionId':_0x2b30a7['id']},{})[_0xcc54('0x21')](function(){return _0x5de187;});}else{return _0x5de187;}})[_0xcc54('0x5a')](function(_0xa5cba3){logger[_0xcc54('0x28')](_0xcc54('0x68'),_0xa5cba3);throw _0xa5cba3;});}return _0x5de187;})[_0xcc54('0x21')](respondWithResult(_0x122d7e,0xc9))[_0xcc54('0x5a')](handleError(_0x122d7e,null));};exports['update']=function(_0x3d536f,_0x531d06){if(_0x3d536f[_0xcc54('0x61')]['id']){delete _0x3d536f[_0xcc54('0x61')]['id'];}return db[_0xcc54('0x42')][_0xcc54('0x5f')]({'where':{'id':_0x3d536f[_0xcc54('0x5c')]['id']},'include':[{'model':db[_0xcc54('0x40')],'as':_0xcc54('0x41')}]})[_0xcc54('0x21')](handleEntityNotFound(_0x531d06,null))[_0xcc54('0x21')](saveUpdates(_0x3d536f[_0xcc54('0x61')],null))[_0xcc54('0x21')](respondWithResult(_0x531d06,null))[_0xcc54('0x5a')](handleError(_0x531d06,null));};exports['destroy']=function(_0x19389d,_0x39928c){return db[_0xcc54('0x42')]['find']({'where':{'id':_0x19389d['params']['id']}})[_0xcc54('0x21')](handleEntityNotFound(_0x39928c,null))[_0xcc54('0x21')](removeEntity(_0x39928c,null))['catch'](handleError(_0x39928c,null));};exports['describe']=function(_0x331b00,_0x278aa1){return db[_0xcc54('0x42')][_0xcc54('0x69')]()[_0xcc54('0x21')](respondWithResult(_0x278aa1,null))['catch'](handleError(_0x278aa1,null));};exports[_0xcc54('0x6a')]=function(_0x219123,_0x5f4cd7,_0xed198a){if(_0x219123[_0xcc54('0x61')]['id']){delete _0x219123[_0xcc54('0x61')]['id'];}return db[_0xcc54('0x42')][_0xcc54('0x5f')]({'where':{'id':_0x219123['params']['id']}})[_0xcc54('0x21')](handleEntityNotFound(_0x5f4cd7,null))[_0xcc54('0x21')](function(_0x24b677){if(_0x24b677){_0x219123[_0xcc54('0x61')][_0xcc54('0x6b')]=_0x24b677['id'];return db[_0xcc54('0x6c')][_0xcc54('0x60')](_0x219123[_0xcc54('0x61')]);}})[_0xcc54('0x21')](respondWithResult(_0x5f4cd7,null))[_0xcc54('0x5a')](handleError(_0x5f4cd7,null));};exports[_0xcc54('0x6d')]=function(_0x58bf20,_0x481a65,_0x32b86b){var _0x5009ab={'raw':![],'where':{}};var _0x210bad={};var _0x5838ef={'count':0x0,'rows':[]};return db[_0xcc54('0x42')]['findOne']({'where':{'id':_0x58bf20[_0xcc54('0x5c')]['id']}})['then'](handleEntityNotFound(_0x481a65,null))[_0xcc54('0x21')](function(_0x12c3f0){if(_0x12c3f0){_0x210bad[_0xcc54('0x47')]=_['keys'](db[_0xcc54('0x6c')][_0xcc54('0x43')]);_0x210bad[_0xcc54('0x49')]=_['keys'](_0x58bf20[_0xcc54('0x49')]);_0x210bad[_0xcc54('0x4b')]=_[_0xcc54('0x4c')](_0x210bad[_0xcc54('0x47')],_0x210bad[_0xcc54('0x49')]);_0x5009ab['attributes']=_[_0xcc54('0x4c')](_0x210bad[_0xcc54('0x47')],qs[_0xcc54('0x4e')](_0x58bf20['query'][_0xcc54('0x4e')]));_0x5009ab['attributes']=_0x5009ab[_0xcc54('0x4d')][_0xcc54('0x4f')]?_0x5009ab[_0xcc54('0x4d')]:_0x210bad['model'];if(!_0x58bf20['query']['hasOwnProperty'](_0xcc54('0x51'))){_0x5009ab[_0xcc54('0x30')]=qs['limit'](_0x58bf20[_0xcc54('0x49')][_0xcc54('0x30')]);_0x5009ab['offset']=qs[_0xcc54('0x2f')](_0x58bf20[_0xcc54('0x49')][_0xcc54('0x2f')]);}_0x5009ab['order']=qs[_0xcc54('0x6e')](_0x58bf20[_0xcc54('0x49')]['sort']);_0x5009ab[_0xcc54('0x57')]=qs['filters'](_['pick'](_0x58bf20[_0xcc54('0x49')],_0x210bad[_0xcc54('0x4b')]));_0x5009ab[_0xcc54('0x57')][_0xcc54('0x6b')]=_0x12c3f0['id'];if(_0x58bf20[_0xcc54('0x49')][_0xcc54('0x54')]){_0x5009ab['where']=_['merge'](_0x5009ab[_0xcc54('0x57')],{'$or':_[_0xcc54('0x48')](_0x5009ab['attributes'],function(_0x276368){var _0x4f539d={};_0x4f539d[_0x276368]={'$like':'%'+_0x58bf20['query'][_0xcc54('0x54')]+'%'};return _0x4f539d;})});}_0x5009ab=_[_0xcc54('0x55')]({},_0x5009ab,_0x58bf20[_0xcc54('0x5e')]);return db[_0xcc54('0x6c')][_0xcc54('0x31')]({'where':_0x5009ab[_0xcc54('0x57')]})[_0xcc54('0x21')](function(_0x3974d4){_0x5838ef[_0xcc54('0x31')]=_0x3974d4;if(_0x58bf20['query'][_0xcc54('0x58')]){_0x5009ab['include']=[{'all':!![]}];}return db[_0xcc54('0x6c')]['findAll'](_0x5009ab);})[_0xcc54('0x21')](function(_0x3d0ac5){_0x5838ef['rows']=_0x3d0ac5;return _0x5838ef;});}})[_0xcc54('0x21')](respondWithFilteredResult(_0x481a65,_0x5009ab))['catch'](handleError(_0x481a65,null));};exports[_0xcc54('0x6f')]=function(_0xbbdb47,_0x252286,_0x3f4ce1){return db[_0xcc54('0x42')][_0xcc54('0x5f')]({'where':{'id':_0xbbdb47['params']['id']}})[_0xcc54('0x21')](handleEntityNotFound(_0x252286,null))[_0xcc54('0x21')](function(_0x2e362a){if(_0x2e362a){return _0x2e362a[_0xcc54('0x6f')](_0xbbdb47[_0xcc54('0x49')][_0xcc54('0x70')]);}})[_0xcc54('0x21')](respondWithStatusCode(_0x252286,null))['catch'](handleError(_0x252286,null));};exports['addAnswer']=function(_0xb6e586,_0x431062,_0x38b9c8){if(_0xb6e586['body']['id']){delete _0xb6e586['body']['id'];}return db[_0xcc54('0x42')][_0xcc54('0x5f')]({'where':{'id':_0xb6e586[_0xcc54('0x5c')]['id']}})[_0xcc54('0x21')](handleEntityNotFound(_0x431062,null))[_0xcc54('0x21')](function(_0x597b32){if(_0x597b32){_0xb6e586[_0xcc54('0x61')][_0xcc54('0x6b')]=_0x597b32['id'];return db[_0xcc54('0x71')]['create'](_0xb6e586[_0xcc54('0x61')]);}})[_0xcc54('0x21')](respondWithResult(_0x431062,null))[_0xcc54('0x5a')](handleError(_0x431062,null));};exports['getAnswers']=function(_0x531fd2,_0x2f1e18,_0x1bf193){var _0x4a50b2={'raw':![],'where':{}};var _0x4d4925={};var _0x427811={'count':0x0,'rows':[]};return db[_0xcc54('0x42')][_0xcc54('0x72')]({'where':{'id':_0x531fd2[_0xcc54('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2f1e18,null))[_0xcc54('0x21')](function(_0x3933a0){if(_0x3933a0){_0x4d4925[_0xcc54('0x47')]=_[_0xcc54('0x4a')](db['CannedAnswer'][_0xcc54('0x43')]);_0x4d4925[_0xcc54('0x49')]=_['keys'](_0x531fd2[_0xcc54('0x49')]);_0x4d4925[_0xcc54('0x4b')]=_[_0xcc54('0x4c')](_0x4d4925[_0xcc54('0x47')],_0x4d4925[_0xcc54('0x49')]);_0x4a50b2['attributes']=_[_0xcc54('0x4c')](_0x4d4925['model'],qs['fields'](_0x531fd2[_0xcc54('0x49')][_0xcc54('0x4e')]));_0x4a50b2[_0xcc54('0x4d')]=_0x4a50b2[_0xcc54('0x4d')][_0xcc54('0x4f')]?_0x4a50b2[_0xcc54('0x4d')]:_0x4d4925[_0xcc54('0x47')];if(!_0x531fd2[_0xcc54('0x49')][_0xcc54('0x50')](_0xcc54('0x51'))){_0x4a50b2[_0xcc54('0x30')]=qs['limit'](_0x531fd2[_0xcc54('0x49')][_0xcc54('0x30')]);_0x4a50b2[_0xcc54('0x2f')]=qs[_0xcc54('0x2f')](_0x531fd2[_0xcc54('0x49')]['offset']);}_0x4a50b2[_0xcc54('0x52')]=qs[_0xcc54('0x6e')](_0x531fd2[_0xcc54('0x49')][_0xcc54('0x6e')]);_0x4a50b2[_0xcc54('0x57')]=qs[_0xcc54('0x4b')](_['pick'](_0x531fd2[_0xcc54('0x49')],_0x4d4925[_0xcc54('0x4b')]));_0x4a50b2[_0xcc54('0x57')][_0xcc54('0x6b')]=_0x3933a0['id'];if(_0x531fd2[_0xcc54('0x49')][_0xcc54('0x54')]){_0x4a50b2['where']=_[_0xcc54('0x55')](_0x4a50b2[_0xcc54('0x57')],{'$or':_[_0xcc54('0x48')](_0x4a50b2[_0xcc54('0x4d')],function(_0x143b02){var _0x20bea1={};_0x20bea1[_0x143b02]={'$like':'%'+_0x531fd2[_0xcc54('0x49')][_0xcc54('0x54')]+'%'};return _0x20bea1;})});}_0x4a50b2=_['merge']({},_0x4a50b2,_0x531fd2['options']);return db['CannedAnswer']['count']({'where':_0x4a50b2['where']})[_0xcc54('0x21')](function(_0x140453){_0x427811[_0xcc54('0x31')]=_0x140453;if(_0x531fd2[_0xcc54('0x49')][_0xcc54('0x58')]){_0x4a50b2[_0xcc54('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xcc54('0x73')](_0x4a50b2);})[_0xcc54('0x21')](function(_0x8080d9){_0x427811['rows']=_0x8080d9;return _0x427811;});}})[_0xcc54('0x21')](respondWithFilteredResult(_0x2f1e18,_0x4a50b2))['catch'](handleError(_0x2f1e18,null));};exports[_0xcc54('0x74')]=function(_0x462045,_0x593d3c,_0x39a44f){return db[_0xcc54('0x42')][_0xcc54('0x5f')]({'where':{'id':_0x462045[_0xcc54('0x5c')]['id']}})[_0xcc54('0x21')](handleEntityNotFound(_0x593d3c,null))[_0xcc54('0x21')](function(_0x2c3dba){if(_0x2c3dba){return _0x2c3dba['removeAnswers'](_0x462045[_0xcc54('0x49')][_0xcc54('0x70')]);}})[_0xcc54('0x21')](respondWithStatusCode(_0x593d3c,null))['catch'](handleError(_0x593d3c,null));};exports[_0xcc54('0x75')]=function(_0x32e4ac,_0x307072,_0x3b3ee0){var _0x4d524c={'body':_0x32e4ac[_0xcc54('0x61')],'channel':_0xcc54('0x76')};var _0x2cb69f=[];var _0x208ce9=[];var _0x44abdf={};var _0x11e136=![];return db[_0xcc54('0x77')][_0xcc54('0x69')]()[_0xcc54('0x21')](function(_0x46867d){if(!_0x46867d){throw new db[(_0xcc54('0x78'))]['ValidationError']('no\x20available\x20attributes');}_0x2cb69f=_[_0xcc54('0x79')](_[_0xcc54('0x4a')](_0x46867d),['createdAt',_0xcc54('0x7a')]);_0x208ce9=_[_0xcc54('0x79')](_[_0xcc54('0x4a')](_0x46867d),[_0xcc54('0x7b'),_0xcc54('0x7a'),'CompanyId','ListId']);if(_0x32e4ac[_0xcc54('0x61')]['id']){delete _0x32e4ac[_0xcc54('0x61')]['id'];}if(_[_0xcc54('0x7c')](_0x32e4ac[_0xcc54('0x61')]['from'])){throw new db[(_0xcc54('0x78'))]['ValidationError'](_0xcc54('0x7d'));}if(_[_0xcc54('0x7c')](_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x61')])||_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x61')]===''){throw new db[(_0xcc54('0x78'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xcc54('0x7c')](_0x32e4ac[_0xcc54('0x61')]['mapKey'])){throw new db['Sequelize'][(_0xcc54('0x7e'))](_0xcc54('0x7f')+_0x208ce9);}if(!_[_0xcc54('0x80')](_0x208ce9,_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x81')])){throw new db[(_0xcc54('0x78'))][(_0xcc54('0x7e'))](_0xcc54('0x82')+_0x208ce9);}_0x44abdf[_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x81')]]=_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x83')];})[_0xcc54('0x21')](function(){return db[_0xcc54('0x42')][_0xcc54('0x5f')]({'where':{'id':_0x32e4ac['params']['id']},'include':[{'model':db[_0xcc54('0x84')],'as':_0xcc54('0x85'),'include':[{'model':db[_0xcc54('0x77')],'as':_0xcc54('0x86'),'where':_0x44abdf,'limit':0x1,'order':[['updatedAt',_0xcc54('0x87')]]}]},{'model':db['OpenchannelApplication'],'as':_0xcc54('0x88')}]});})[_0xcc54('0x21')](handleEntityNotFound(_0x307072,null))[_0xcc54('0x21')](function(_0xcb9158){if(_0xcb9158&&_0xcb9158[_0xcc54('0x85')]){_0x4d524c[_0xcc54('0x89')]=_0xcb9158;_0x4d524c[_0xcc54('0x8a')]=_0xcb9158[_0xcc54('0x88')];_0x4d524c['list']=_0xcb9158[_0xcc54('0x85')];_0x4d524c[_0xcc54('0x8a')]=_[_0xcc54('0x8b')](_0x4d524c[_0xcc54('0x8a')],['priority'],['asc']);if(_0x4d524c['account']['Applications']){delete _0x4d524c[_0xcc54('0x89')][_0xcc54('0x88')];}if(_0x4d524c['account'][_0xcc54('0x85')]&&_0x4d524c[_0xcc54('0x89')][_0xcc54('0x85')][_0xcc54('0x86')][_0xcc54('0x4f')]){return _0x4d524c['account'][_0xcc54('0x85')]['Contacts'][0x0];}var _0x116994=_[_0xcc54('0x1a')](_0x32e4ac['body'],{'firstName':_0x32e4ac['body']['from'],'ListId':_0xcb9158[_0xcc54('0x8c')]});_0x116994[_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x81')]]=_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x83')];return db[_0xcc54('0x77')][_0xcc54('0x60')](_0x116994,{'fields':_0x2cb69f,'raw':!![]});}})[_0xcc54('0x21')](handleEntityNotFound(_0x307072,null))[_0xcc54('0x21')](function(_0x480864){_0x4d524c[_0xcc54('0x8d')]=_0x480864;if(_0x480864){var _0x90acc4={'ContactId':_0x480864['id'],'OpenchannelAccountId':_0x32e4ac['params']['id'],'from':(_0x480864[_0xcc54('0x8e')]||'')+'\x20'+(_0x480864['lastName']||'')};var _0x5ea72c={'OpenchannelAccountId':_0x32e4ac['params']['id'],'closed':![]};if(_0x32e4ac[_0xcc54('0x61')]['threadId']){_0x5ea72c[_0xcc54('0x8f')]=_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x8f')];return db[_0xcc54('0x90')]['find']({'where':_0x5ea72c})[_0xcc54('0x21')](function(_0x179ff9){if(_0x179ff9){return[_0x179ff9,![]];}_0x90acc4[_0xcc54('0x8f')]=_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x8f')];_0x90acc4['externalUrl']=_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x91')];return db[_0xcc54('0x90')][_0xcc54('0x60')](_0x90acc4)['then'](function(_0x222626){return[_0x222626,!![]];});});}else{_0x5ea72c[_0xcc54('0x8f')]=null;}_0x5ea72c[_0xcc54('0x92')]=_0x480864['id'];return db[_0xcc54('0x90')]['find']({'where':_0x5ea72c})['then'](function(_0x5c21ba){if(_0x5c21ba){return[_0x5c21ba,![]];}return db[_0xcc54('0x90')][_0xcc54('0x60')](_0x90acc4)[_0xcc54('0x21')](function(_0x551bd0){return[_0x551bd0,!![]];});});}})['spread'](function(_0x3b7a68,_0x55f276){if(_0x3b7a68){_0x11e136=_0x55f276;if(!_0x55f276){var _0xbd32aa={'from':(_0x4d524c[_0xcc54('0x8d')]['firstName']||'')+'\x20'+(_0x4d524c[_0xcc54('0x8d')][_0xcc54('0x93')]||'')};if(_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x8f')]&&_0x32e4ac[_0xcc54('0x61')]['messageId']&&_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x8f')]!=_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x94')]){_0xbd32aa[_0xcc54('0x8f')]=_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x94')];}return _0x3b7a68[_0xcc54('0x38')](_0xbd32aa);}else{return _0x3b7a68;}}})[_0xcc54('0x21')](function(_0x20e481){_0x4d524c[_0xcc54('0x95')]=_0x20e481[_0xcc54('0x62')]({'plain':!![]});_0x4d524c[_0xcc54('0x95')]['created']=_0x11e136;if(_0x4d524c[_0xcc54('0x95')][_0xcc54('0x96')]){if(_0x4d524c['account'][_0xcc54('0x97')]){_0x4d524c[_0xcc54('0x8a')][_0xcc54('0x98')]({'id':0x0,'priority':_0x4d524c[_0xcc54('0x8a')]['length']+0x1,'app':_0xcc54('0x99'),'appdata':'unmanaged','interval':_0xcc54('0x9a')});}}return db['OpenchannelMessage'][_0xcc54('0x60')]({'body':_0x32e4ac['body'][_0xcc54('0x61')],'OpenchannelAccountId':_0x32e4ac[_0xcc54('0x5c')]['id'],'OpenchannelInteractionId':_0x20e481['id'],'direction':'in','ContactId':_0x4d524c[_0xcc54('0x8d')]['id'],'AttachmentId':_0x32e4ac[_0xcc54('0x61')][_0xcc54('0x9b')]});})[_0xcc54('0x21')](function(_0x10a54c){_0x4d524c['message']=_0x10a54c;if(_0x4d524c[_0xcc54('0x95')][_0xcc54('0x9c')]){return db[_0xcc54('0x9d')][_0xcc54('0x5f')]({'attributes':['id',_0xcc54('0x3d')],'where':{'id':_0x4d524c[_0xcc54('0x95')]['UserId']}})[_0xcc54('0x21')](function(_0x53df54){if(_0x53df54){_0x4d524c[_0xcc54('0x8a')][_0xcc54('0x9e')]({'id':0x0,'priority':0x0,'app':_0xcc54('0x9f'),'appdata':_0x53df54[_0xcc54('0x3d')]+','+(_0x4d524c[_0xcc54('0x89')][_0xcc54('0xa0')]||0xa),'interval':_0xcc54('0x9a')});_0x4d524c[_0xcc54('0xa1')]=![];}return respondWithRpcPromise(_0xcc54('0xa2'),_0xcc54('0xa3'),_0x4d524c);});}return respondWithRpcPromise(_0xcc54('0xa2'),_0xcc54('0xa3'),_0x4d524c);})['then'](function(_0x39c921){respondWithRpcPromise(_0xcc54('0xa4'),_0xcc54('0xa4'),{'event':_0xcc54('0x75'),'message':_0x39c921},client9002);return _0x39c921;})['then'](respondWithResult(_0x307072,null))[_0xcc54('0x5a')](handleError(_0x307072,null));};exports['addApplications']=function(_0x5c3849,_0x534e12,_0x1f2195){return db[_0xcc54('0x42')][_0xcc54('0x72')]({'where':{'id':_0x5c3849['params']['id']}})[_0xcc54('0x21')](handleEntityNotFound(_0x534e12,null))[_0xcc54('0x21')](function(_0x20cc73){if(_0x20cc73){return db[_0xcc54('0xa5')][_0xcc54('0xa6')](function(_0x271c8a){return db[_0xcc54('0xa7')][_0xcc54('0x3b')]({'where':{'OpenchannelAccountId':_0x5c3849['params']['id']},'transaction':_0x271c8a})[_0xcc54('0x21')](function(_0x57fceb){var _0x5017dc=_[_0xcc54('0x48')](_0x5c3849[_0xcc54('0x61')],function(_0x147727){_0x147727[_0xcc54('0x6b')]=_0x5c3849[_0xcc54('0x5c')]['id'];return _0x147727;});return db['OpenchannelApplication']['bulkCreate'](_0x5017dc,{'transaction':_0x271c8a});});})[_0xcc54('0x21')](function(){return db[_0xcc54('0xa7')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x5c3849['params']['id']},'order':_0xcc54('0xa8')});});}})['then'](respondWithResult(_0x534e12,null))[_0xcc54('0x5a')](handleError(_0x534e12,null));};exports[_0xcc54('0xa9')]=function(_0x51adc8,_0x56d853,_0x5c1948){var _0x5617fd={};var _0xcb3f4b={};var _0x53abbf;var _0x6e7d61;return db[_0xcc54('0x42')][_0xcc54('0x72')]({'where':{'id':_0x51adc8[_0xcc54('0x5c')]['id']}})[_0xcc54('0x21')](handleEntityNotFound(_0x56d853,null))[_0xcc54('0x21')](function(_0x5cbbcd){if(_0x5cbbcd){_0x53abbf=_0x5cbbcd;_0xcb3f4b[_0xcc54('0x47')]=_[_0xcc54('0x4a')](db[_0xcc54('0xa7')][_0xcc54('0x43')]);_0xcb3f4b[_0xcc54('0x49')]=_[_0xcc54('0x4a')](_0x51adc8[_0xcc54('0x49')]);_0xcb3f4b['filters']=_[_0xcc54('0x4c')](_0xcb3f4b[_0xcc54('0x47')],_0xcb3f4b[_0xcc54('0x49')]);_0x5617fd[_0xcc54('0x4d')]=_[_0xcc54('0x4c')](_0xcb3f4b['model'],qs[_0xcc54('0x4e')](_0x51adc8[_0xcc54('0x49')]['fields']));_0x5617fd[_0xcc54('0x4d')]=_0x5617fd[_0xcc54('0x4d')][_0xcc54('0x4f')]?_0x5617fd[_0xcc54('0x4d')]:_0xcb3f4b[_0xcc54('0x47')];_0x5617fd['order']=qs[_0xcc54('0x6e')](_0x51adc8[_0xcc54('0x49')][_0xcc54('0x6e')]);_0x5617fd[_0xcc54('0x57')]=qs['filters'](_[_0xcc54('0x53')](_0x51adc8[_0xcc54('0x49')],_0xcb3f4b[_0xcc54('0x4b')]));if(_0x51adc8['query']['filter']){_0x5617fd[_0xcc54('0x57')]=_['merge'](_0x5617fd['where'],{'$or':_['map'](_0x5617fd[_0xcc54('0x4d')],function(_0xdf795d){var _0x4f7aa7={};_0x4f7aa7[_0xdf795d]={'$like':'%'+_0x51adc8[_0xcc54('0x49')]['filter']+'%'};return _0x4f7aa7;})});}_0x5617fd=_[_0xcc54('0x55')]({},_0x5617fd,_0x51adc8['options']);return _0x53abbf[_0xcc54('0xa9')](_0x5617fd);}})[_0xcc54('0x21')](function(_0x2ca9f5){if(_0x2ca9f5){_0x6e7d61=_0x2ca9f5[_0xcc54('0x4f')];if(!_0x51adc8[_0xcc54('0x49')][_0xcc54('0x50')](_0xcc54('0x51'))){_0x5617fd[_0xcc54('0x30')]=qs[_0xcc54('0x30')](_0x51adc8['query']['limit']);_0x5617fd[_0xcc54('0x2f')]=qs[_0xcc54('0x2f')](_0x51adc8[_0xcc54('0x49')][_0xcc54('0x2f')]);}return _0x53abbf[_0xcc54('0xa9')](_0x5617fd);}})[_0xcc54('0x21')](function(_0x115189){if(_0x115189){return _0x115189?{'count':_0x6e7d61,'rows':_0x115189}:null;}})[_0xcc54('0x21')](respondWithResult(_0x56d853,null))['catch'](handleError(_0x56d853,null));};exports[_0xcc54('0xaa')]=function(_0x465c15,_0x4bae4b,_0x48e090){var _0x1dcf20={'raw':![],'where':{}};var _0x2431f6={};var _0x2faf5a={'count':0x0,'rows':[]};return db[_0xcc54('0x42')][_0xcc54('0x72')]({'where':{'id':_0x465c15[_0xcc54('0x5c')]['id']}})[_0xcc54('0x21')](handleEntityNotFound(_0x4bae4b,null))[_0xcc54('0x21')](function(_0x5a74e4){if(_0x5a74e4){_0x2431f6[_0xcc54('0x47')]=_['keys'](db[_0xcc54('0x90')][_0xcc54('0x43')]);_0x2431f6['query']=_[_0xcc54('0x4a')](_0x465c15[_0xcc54('0x49')]);_0x2431f6['filters']=_['intersection'](_0x2431f6[_0xcc54('0x47')],_0x2431f6[_0xcc54('0x49')]);_0x1dcf20[_0xcc54('0x4d')]=_[_0xcc54('0x4c')](_0x2431f6[_0xcc54('0x47')],qs[_0xcc54('0x4e')](_0x465c15[_0xcc54('0x49')][_0xcc54('0x4e')]));_0x1dcf20[_0xcc54('0x4d')]=_0x1dcf20[_0xcc54('0x4d')][_0xcc54('0x4f')]?_0x1dcf20['attributes']:_0x2431f6['model'];if(!_0x465c15[_0xcc54('0x49')][_0xcc54('0x50')](_0xcc54('0x51'))){_0x1dcf20[_0xcc54('0x30')]=qs[_0xcc54('0x30')](_0x465c15[_0xcc54('0x49')]['limit']);_0x1dcf20[_0xcc54('0x2f')]=qs[_0xcc54('0x2f')](_0x465c15[_0xcc54('0x49')][_0xcc54('0x2f')]);}_0x1dcf20[_0xcc54('0x52')]=qs[_0xcc54('0x6e')](_0x465c15['query'][_0xcc54('0x6e')]);_0x1dcf20[_0xcc54('0x57')]=qs[_0xcc54('0x4b')](_['pick'](_0x465c15['query'],_0x2431f6[_0xcc54('0x4b')]));_0x1dcf20[_0xcc54('0x57')]['OpenchannelAccountId']=_0x5a74e4['id'];if(_0x465c15[_0xcc54('0x49')]['filter']){_0x1dcf20[_0xcc54('0x57')]=_[_0xcc54('0x55')](_0x1dcf20[_0xcc54('0x57')],{'$or':_[_0xcc54('0x48')](_0x1dcf20[_0xcc54('0x4d')],function(_0x59b9b8){var _0x25d229={};_0x25d229[_0x59b9b8]={'$like':'%'+_0x465c15['query'][_0xcc54('0x54')]+'%'};return _0x25d229;})});}_0x1dcf20=_['merge']({},_0x1dcf20,_0x465c15[_0xcc54('0x5e')]);return db[_0xcc54('0x90')]['count']({'where':_0x1dcf20[_0xcc54('0x57')]})[_0xcc54('0x21')](function(_0x7c0cee){_0x2faf5a[_0xcc54('0x31')]=_0x7c0cee;if(_0x465c15['query']['includeAll']){_0x1dcf20[_0xcc54('0x5d')]=[{'model':db['CmContact'],'as':_0xcc54('0xab'),'required':![]},{'model':db['User'],'as':_0xcc54('0xac'),'attributes':[_0xcc54('0x3d'),_0xcc54('0xad'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xcc54('0xae'),'attributes':['id','name',_0xcc54('0xaf')],'where':_0x465c15[_0xcc54('0x49')][_0xcc54('0xb0')]?{'id':_0x465c15[_0xcc54('0x49')][_0xcc54('0xb0')]}:undefined,'required':_0x465c15[_0xcc54('0x49')][_0xcc54('0xb0')]?!![]:![]}];}return db[_0xcc54('0x90')][_0xcc54('0x73')](_0x1dcf20);})[_0xcc54('0x21')](function(_0x321822){_0x2faf5a[_0xcc54('0x59')]=_0x321822;return _0x2faf5a;});}})[_0xcc54('0x21')](respondWithFilteredResult(_0x4bae4b,_0x1dcf20))[_0xcc54('0x5a')](handleError(_0x4bae4b,null));};exports[_0xcc54('0xb1')]=function(_0x524f49,_0x14c021,_0x1fab12){return db[_0xcc54('0x42')][_0xcc54('0x5f')]({'where':{'id':_0x524f49[_0xcc54('0x5c')]['id']}})[_0xcc54('0x21')](handleEntityNotFound(_0x14c021,null))[_0xcc54('0x21')](function(_0x589406){if(_0x589406){return _0x589406[_0xcc54('0xb1')](_0x524f49[_0xcc54('0x61')][_0xcc54('0x70')],_[_0xcc54('0xb2')](_0x524f49[_0xcc54('0x61')],['ids','id'])||{})[_0xcc54('0xb3')](function(_0x3921a9){for(var _0x3fd262=0x0;_0x3fd262<_0x524f49['body'][_0xcc54('0x70')]['length'];_0x3fd262+=0x1){socket[_0xcc54('0xb4')]('userOpenchannelAccount:save',{'UserId':Number(_0x524f49[_0xcc54('0x61')][_0xcc54('0x70')][_0x3fd262]),'OpenchannelAccountId':Number(_0x524f49[_0xcc54('0x5c')]['id'])});}return _0x3921a9;});}})[_0xcc54('0x21')](respondWithResult(_0x14c021,null))[_0xcc54('0x5a')](handleError(_0x14c021,null));};exports['removeAgents']=function(_0x357844,_0x5c3318,_0x8528e4){return db['OpenchannelAccount'][_0xcc54('0x5f')]({'where':{'id':_0x357844[_0xcc54('0x5c')]['id']}})[_0xcc54('0x21')](handleEntityNotFound(_0x5c3318,null))[_0xcc54('0x21')](function(_0x58c5c0){if(_0x58c5c0){return _0x58c5c0[_0xcc54('0xb5')](_0x357844[_0xcc54('0x49')]['ids'])[_0xcc54('0x21')](function(){if(_[_0xcc54('0xb6')](_0x357844[_0xcc54('0x49')][_0xcc54('0x70')])){for(var _0x40fd07=0x0;_0x40fd07<_0x357844[_0xcc54('0x49')]['ids']['length'];_0x40fd07+=0x1){socket[_0xcc54('0xb4')](_0xcc54('0xb7'),{'UserId':Number(_0x357844['query']['ids'][_0x40fd07]),'OpenchannelAccountId':Number(_0x357844[_0xcc54('0x5c')]['id'])});}}else{socket['emit'](_0xcc54('0xb7'),{'UserId':Number(_0x357844['query'][_0xcc54('0x70')]),'OpenchannelAccountId':Number(_0x357844[_0xcc54('0x5c')]['id'])});}});}})[_0xcc54('0x21')](respondWithStatusCode(_0x5c3318,null))['catch'](handleError(_0x5c3318,null));};exports['getAgents']=function(_0x59ef7a,_0x3a289f,_0x469759){var _0x33ec3d={};var _0x1b1c2a={};var _0x546c54;var _0x43cbac;return db[_0xcc54('0x42')][_0xcc54('0x72')]({'where':{'id':_0x59ef7a[_0xcc54('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3a289f,null))[_0xcc54('0x21')](function(_0x159b67){if(_0x159b67){_0x546c54=_0x159b67;_0x1b1c2a[_0xcc54('0x47')]=_['keys'](db[_0xcc54('0x9d')][_0xcc54('0x43')]);_0x1b1c2a[_0xcc54('0x49')]=_[_0xcc54('0x4a')](_0x59ef7a[_0xcc54('0x49')]);_0x1b1c2a[_0xcc54('0x4b')]=_[_0xcc54('0x4c')](_0x1b1c2a[_0xcc54('0x47')],_0x1b1c2a['query']);_0x33ec3d[_0xcc54('0x4d')]=_[_0xcc54('0x4c')](_0x1b1c2a['model'],qs[_0xcc54('0x4e')](_0x59ef7a['query']['fields']));_0x33ec3d[_0xcc54('0x4d')]=_0x33ec3d[_0xcc54('0x4d')]['length']?_0x33ec3d[_0xcc54('0x4d')]:_0x1b1c2a[_0xcc54('0x47')];_0x33ec3d[_0xcc54('0x52')]=qs['sort'](_0x59ef7a['query'][_0xcc54('0x6e')]);_0x33ec3d[_0xcc54('0x57')]=qs['filters'](_[_0xcc54('0x53')](_0x59ef7a[_0xcc54('0x49')],_0x1b1c2a['filters']));if(_0x59ef7a[_0xcc54('0x49')][_0xcc54('0x54')]){_0x33ec3d['where']=_['merge'](_0x33ec3d[_0xcc54('0x57')],{'$or':_[_0xcc54('0x48')](_0x33ec3d[_0xcc54('0x4d')],function(_0x2c1b66){var _0xfc603a={};_0xfc603a[_0x2c1b66]={'$like':'%'+_0x59ef7a[_0xcc54('0x49')][_0xcc54('0x54')]+'%'};return _0xfc603a;})});}_0x33ec3d=_[_0xcc54('0x55')]({},_0x33ec3d,_0x59ef7a[_0xcc54('0x5e')]);return _0x546c54[_0xcc54('0xb8')](_0x33ec3d);}})[_0xcc54('0x21')](function(_0x2e4943){if(_0x2e4943){_0x43cbac=_0x2e4943[_0xcc54('0x4f')];if(!_0x59ef7a[_0xcc54('0x49')][_0xcc54('0x50')]('nolimit')){_0x33ec3d['limit']=qs[_0xcc54('0x30')](_0x59ef7a[_0xcc54('0x49')][_0xcc54('0x30')]);_0x33ec3d['offset']=qs[_0xcc54('0x2f')](_0x59ef7a[_0xcc54('0x49')]['offset']);}return _0x546c54['getAgents'](_0x33ec3d);}})[_0xcc54('0x21')](function(_0x342c3b){if(_0x342c3b){return _0x342c3b?{'count':_0x43cbac,'rows':_0x342c3b}:null;}})['then'](respondWithResult(_0x3a289f,null))[_0xcc54('0x5a')](handleError(_0x3a289f,null));};exports[_0xcc54('0x3e')]=function(_0x3c7d55,_0x424eab,_0xc603f){var _0xfb21d2,_0xd6cc2a,_0xe43de4;if(_['isNil'](_0x3c7d55[_0xcc54('0x61')][_0xcc54('0x61')])||_0x3c7d55[_0xcc54('0x61')][_0xcc54('0x61')]===''){throw new db[(_0xcc54('0x78'))][(_0xcc54('0x7e'))](_0xcc54('0xb9'));}if(_[_0xcc54('0x7c')](_0x3c7d55[_0xcc54('0x61')]['to'])){}_0xfb21d2=_0x3c7d55[_0xcc54('0x61')]['to'];return db[_0xcc54('0x42')]['findOne']({'where':{'id':_0x3c7d55[_0xcc54('0x5c')]['id']}})['then'](handleEntityNotFound(_0x424eab,null))['then'](function(_0x492e10){if(_0x492e10){return db['OpenchannelAccount'][_0xcc54('0x5f')]({'where':{'id':_0x492e10['id']},'include':[{'model':db['CmList'],'as':_0xcc54('0x85'),'include':[{'model':db[_0xcc54('0x77')],'as':'Contacts','where':{[_0x492e10['mapKey']]:_0xfb21d2},'limit':0x1,'order':[[_0xcc54('0x7a'),_0xcc54('0x87')]]}]}]})[_0xcc54('0x21')](handleEntityNotFound(_0x424eab,null))[_0xcc54('0x21')](function(_0x355011){if(_0x355011&&_0x355011[_0xcc54('0x85')]){_0xd6cc2a=_0x355011[_0xcc54('0x62')]({'plain':!![]});if(_0xd6cc2a[_0xcc54('0x85')]&&_0xd6cc2a[_0xcc54('0x85')][_0xcc54('0x86')][_0xcc54('0x4f')]){return _0xd6cc2a[_0xcc54('0x85')]['Contacts'][0x0];}return db[_0xcc54('0x77')][_0xcc54('0x60')](_[_0xcc54('0x1a')](_0x3c7d55['body'],{'firstName':_0xfb21d2,[_0x355011['mapKey']]:_0xfb21d2,'phone':_0xfb21d2,'ListId':_0xd6cc2a[_0xcc54('0x8c')]}));}})[_0xcc54('0x21')](handleEntityNotFound(_0x424eab,null))['then'](function(_0x1a2d1d){if(_0x1a2d1d){_0xe43de4=_0x1a2d1d;return db[_0xcc54('0x90')][_0xcc54('0x5f')]({'where':{'ContactId':_0xe43de4['id'],'closed':![],'OpenchannelAccountId':_0xd6cc2a['id']}})['then'](function(_0x2cd0c9){if(_0x2cd0c9){return[_0x2cd0c9,![]];}return db[_0xcc54('0x90')]['create']({'UserId':_0x3c7d55[_0xcc54('0x65')]['id'],'ContactId':_0xe43de4['id'],'OpenchannelAccountId':_0xd6cc2a['id'],'lastMsgDirection':'out','Messages':[_[_0xcc54('0x55')](_0x3c7d55[_0xcc54('0x61')],{'read':![],'body':_0x3c7d55[_0xcc54('0x61')]['body'],'OpenchannelAccountId':_0xd6cc2a['id'],'UserId':_0x3c7d55[_0xcc54('0x65')]['id'],'ContactId':_0xe43de4['id']})]},{'include':[{'model':db[_0xcc54('0xba')],'as':'Messages'}]})[_0xcc54('0x21')](function(_0x5e3731){return[_0x5e3731,!![]];});});}})[_0xcc54('0xb3')](function(_0x40b05c,_0x483967){if(_0x483967){return _0x40b05c;}return db[_0xcc54('0xba')][_0xcc54('0x60')](_[_0xcc54('0x55')](_0x3c7d55[_0xcc54('0x61')],{'read':![],'body':_0x3c7d55[_0xcc54('0x61')]['body'],'OpenchannelAccountId':_0xd6cc2a['id'],'OpenchannelInteractionId':_0x40b05c['id'],'UserId':_0x3c7d55[_0xcc54('0x65')]['id'],'ContactId':_0xe43de4['id']}))[_0xcc54('0x21')](function(_0x10d7ea){_0x40b05c[_0xcc54('0xbb')][_0xcc54('0xbc')]=[];_0x40b05c[_0xcc54('0xbb')][_0xcc54('0xbc')][_0xcc54('0x98')](_0x10d7ea[_0xcc54('0xbb')]);return _0x40b05c;});});}})['then'](respondWithResult(_0x424eab,null))[_0xcc54('0x5a')](handleError(_0x424eab,null));};
\ No newline at end of file
+var _0x73d1=['localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','undefined','limit','count','offset','Content-Range','update','destroy','OpenchannelAccounts','UserProfileResource','end','name','send','index','Pause','map','OpenchannelAccount','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','rawAttributes','include','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','mandatoryDispositionPause','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','getAnswers','CannedAnswer','findAll','removeAnswers','ids','notify','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','defaults','ListId','contact','firstName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','lastName','messageId','interaction','created','autoclose','push','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','getAgents','DESC','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x73d1,0x15e));var _0x173d=function(_0x336d23,_0x5ee69a){_0x336d23=_0x336d23-0x0;var _0x3d7248=_0x73d1[_0x336d23];return _0x3d7248;};'use strict';var emlformat=require(_0x173d('0x0'));var rimraf=require(_0x173d('0x1'));var zipdir=require(_0x173d('0x2'));var jsonpatch=require(_0x173d('0x3'));var rp=require(_0x173d('0x4'));var moment=require(_0x173d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x173d('0x6'));var util=require('util');var path=require(_0x173d('0x7'));var sox=require(_0x173d('0x8'));var csv=require('to-csv');var ejs=require(_0x173d('0x9'));var fs=require('fs');var fs_extra=require(_0x173d('0xa'));var _=require(_0x173d('0xb'));var squel=require(_0x173d('0xc'));var crypto=require(_0x173d('0xd'));var jsforce=require(_0x173d('0xe'));var deskjs=require(_0x173d('0xf'));var toCsv=require(_0x173d('0x10'));var querystring=require(_0x173d('0x11'));var Papa=require(_0x173d('0x12'));var Redis=require('ioredis');var authService=require(_0x173d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x173d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x173d('0x15'));var utils=require('../../config/utils');var config=require(_0x173d('0x16'));var licenseUtil=require(_0x173d('0x17'));var db=require(_0x173d('0x18'))['db'];config[_0x173d('0x19')]=_['defaults'](config['redis'],{'host':_0x173d('0x1a'),'port':0x18eb});var socket=require(_0x173d('0x1b'))(new Redis(config[_0x173d('0x19')]));require(_0x173d('0x1c'))[_0x173d('0x1d')](socket);var jayson=require(_0x173d('0x1e'));var client=jayson['client'][_0x173d('0x1f')]({'port':0x232c});var client9002=jayson[_0x173d('0x20')][_0x173d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x26b491,_0x5d4a22,_0x35e5e3,_0x4e7f8e){return new BPromise(function(_0x3c8b27,_0x1e3434){var _0x282946=_0x4e7f8e||client;return _0x282946[_0x173d('0x21')](_0x26b491,_0x35e5e3)[_0x173d('0x22')](function(_0x4db4a8){logger[_0x173d('0x23')](_0x173d('0x24'),_0x5d4a22,_0x173d('0x25'));logger[_0x173d('0x26')](_0x173d('0x27'),_0x5d4a22,_0x173d('0x25'),JSON[_0x173d('0x28')](_0x4db4a8));if(_0x4db4a8[_0x173d('0x29')]){if(_0x4db4a8[_0x173d('0x29')][_0x173d('0x2a')]===0x1f4){logger[_0x173d('0x29')](_0x173d('0x24'),_0x5d4a22,_0x4db4a8[_0x173d('0x29')]['message']);return _0x1e3434(_0x4db4a8[_0x173d('0x29')][_0x173d('0x2b')]);}logger[_0x173d('0x29')](_0x173d('0x24'),_0x5d4a22,_0x4db4a8[_0x173d('0x29')][_0x173d('0x2b')]);return _0x3c8b27(_0x4db4a8[_0x173d('0x29')][_0x173d('0x2b')]);}else{logger[_0x173d('0x23')](_0x173d('0x24'),_0x5d4a22,_0x173d('0x25'));_0x3c8b27(_0x4db4a8[_0x173d('0x2c')]['message']);}})['catch'](function(_0x361bfb){logger[_0x173d('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x5d4a22,_0x361bfb);_0x1e3434(_0x361bfb);});});}function respondWithStatusCode(_0x510158,_0x49687e){_0x49687e=_0x49687e||0xcc;return function(_0x25a37b){if(_0x25a37b){return _0x510158[_0x173d('0x2d')](_0x49687e);}return _0x510158[_0x173d('0x2e')](_0x49687e)['end']();};}function respondWithResult(_0x372194,_0x5118a0){_0x5118a0=_0x5118a0||0xc8;return function(_0x44d7d0){if(_0x44d7d0){return _0x372194[_0x173d('0x2e')](_0x5118a0)[_0x173d('0x2f')](_0x44d7d0);}};}function respondWithFilteredResult(_0x125472,_0x3e387d){return function(_0x559b5e){if(_0x559b5e){var _0x4d095f=typeof _0x3e387d['offset']===_0x173d('0x30')&&typeof _0x3e387d[_0x173d('0x31')]===_0x173d('0x30');var _0x391ca1=_0x559b5e['count'];var _0x4c7670=_0x4d095f?0x0:_0x3e387d['offset'];var _0x29c071=_0x4d095f?_0x559b5e[_0x173d('0x32')]:_0x3e387d[_0x173d('0x33')]+_0x3e387d[_0x173d('0x31')];var _0x39ac47;if(_0x29c071>=_0x391ca1){_0x29c071=_0x391ca1;_0x39ac47=0xc8;}else{_0x39ac47=0xce;}_0x125472[_0x173d('0x2e')](_0x39ac47);return _0x125472['set'](_0x173d('0x34'),_0x4c7670+'-'+_0x29c071+'/'+_0x391ca1)[_0x173d('0x2f')](_0x559b5e);}return null;};}function patchUpdates(_0x3023fd){return function(_0x49cf9e){try{jsonpatch['apply'](_0x49cf9e,_0x3023fd,!![]);}catch(_0x2cd1c0){return BPromise['reject'](_0x2cd1c0);}return _0x49cf9e['save']();};}function saveUpdates(_0x381a42,_0x39d1e3){return function(_0x148a56){if(_0x148a56){return _0x148a56[_0x173d('0x35')](_0x381a42)['then'](function(_0x3b5097){return _0x3b5097;});}return null;};}function removeEntity(_0x1377f1,_0x27ac54){return function(_0x32cdd4){if(_0x32cdd4){return _0x32cdd4[_0x173d('0x36')]()['then'](function(){var _0x45cd5e=_0x32cdd4['get']({'plain':!![]});var _0x44a11c=_0x173d('0x37');return db[_0x173d('0x38')][_0x173d('0x36')]({'where':{'type':_0x44a11c,'resourceId':_0x45cd5e['id']}})['then'](function(){return _0x32cdd4;});})[_0x173d('0x22')](function(){_0x1377f1['status'](0xcc)[_0x173d('0x39')]();});}};}function handleEntityNotFound(_0x398a42,_0x22a1fe){return function(_0x52454b){if(!_0x52454b){_0x398a42['sendStatus'](0x194);}return _0x52454b;};}function handleError(_0x8d181c,_0x3faa35){_0x3faa35=_0x3faa35||0x1f4;return function(_0x186b0b){logger[_0x173d('0x29')](_0x186b0b['stack']);if(_0x186b0b[_0x173d('0x3a')]){delete _0x186b0b[_0x173d('0x3a')];}_0x8d181c[_0x173d('0x2e')](_0x3faa35)[_0x173d('0x3b')](_0x186b0b);};}exports[_0x173d('0x3c')]=function(_0xed6323,_0x1d713a){var _0xcaabc0={'include':[{'model':db[_0x173d('0x3d')],'as':'mandatoryDispositionPause'}]},_0x1d6106={},_0x32f5c0={'count':0x0,'rows':[]};var _0x22d133=_[_0x173d('0x3e')](db[_0x173d('0x3f')]['rawAttributes'],function(_0x2ce5b1){return{'name':_0x2ce5b1[_0x173d('0x40')],'type':_0x2ce5b1[_0x173d('0x41')]['key']};});_0x1d6106[_0x173d('0x42')]=_[_0x173d('0x3e')](_0x22d133,_0x173d('0x3a'));_0x1d6106['query']=_[_0x173d('0x43')](_0xed6323[_0x173d('0x44')]);_0x1d6106[_0x173d('0x45')]=_[_0x173d('0x46')](_0x1d6106[_0x173d('0x42')],_0x1d6106[_0x173d('0x44')]);_0xcaabc0[_0x173d('0x47')]=_[_0x173d('0x46')](_0x1d6106['model'],qs[_0x173d('0x48')](_0xed6323['query'][_0x173d('0x48')]));_0xcaabc0[_0x173d('0x47')]=_0xcaabc0[_0x173d('0x47')][_0x173d('0x49')]?_0xcaabc0['attributes']:_0x1d6106[_0x173d('0x42')];if(!_0xed6323[_0x173d('0x44')]['hasOwnProperty']('nolimit')){_0xcaabc0['limit']=qs[_0x173d('0x31')](_0xed6323[_0x173d('0x44')]['limit']);_0xcaabc0[_0x173d('0x33')]=qs['offset'](_0xed6323[_0x173d('0x44')][_0x173d('0x33')]);}_0xcaabc0[_0x173d('0x4a')]=qs[_0x173d('0x4b')](_0xed6323[_0x173d('0x44')]['sort']);_0xcaabc0['where']=qs[_0x173d('0x45')](_[_0x173d('0x4c')](_0xed6323[_0x173d('0x44')],_0x1d6106[_0x173d('0x45')]),_0x22d133);if(_0xed6323['query'][_0x173d('0x4d')]){_0xcaabc0[_0x173d('0x4e')]=_[_0x173d('0x4f')](_0xcaabc0[_0x173d('0x4e')],{'$or':_[_0x173d('0x3e')](_0x22d133,function(_0x43bd31){if(_0x43bd31[_0x173d('0x41')]!==_0x173d('0x50')){var _0x33f2b0={};_0x33f2b0[_0x43bd31[_0x173d('0x3a')]]={'$like':'%'+_0xed6323[_0x173d('0x44')][_0x173d('0x4d')]+'%'};return _0x33f2b0;}})});}_0xcaabc0=_[_0x173d('0x4f')]({},_0xcaabc0,_0xed6323[_0x173d('0x51')]);var _0x4b7e25={'where':_0xcaabc0[_0x173d('0x4e')]};return db[_0x173d('0x3f')][_0x173d('0x32')](_0x4b7e25)[_0x173d('0x22')](function(_0x40e356){_0x32f5c0['count']=_0x40e356;if(_0xed6323['query'][_0x173d('0x52')]){_0xcaabc0['include']=[{'all':!![]}];}return db[_0x173d('0x3f')]['findAll'](_0xcaabc0);})['then'](function(_0x2c5471){_0x32f5c0[_0x173d('0x53')]=_0x2c5471;return _0x32f5c0;})[_0x173d('0x22')](respondWithFilteredResult(_0x1d713a,_0xcaabc0))[_0x173d('0x54')](handleError(_0x1d713a,null));};exports[_0x173d('0x55')]=function(_0xeb9d5,_0x16203b){var _0x2c598c={'raw':![],'where':{'id':_0xeb9d5['params']['id']},'include':[{'model':db[_0x173d('0x3d')],'as':'mandatoryDispositionPause'}]},_0x4a2c70={};_0x4a2c70[_0x173d('0x42')]=_[_0x173d('0x43')](db[_0x173d('0x3f')][_0x173d('0x56')]);_0x4a2c70['query']=_['keys'](_0xeb9d5[_0x173d('0x44')]);_0x4a2c70['filters']=_[_0x173d('0x46')](_0x4a2c70[_0x173d('0x42')],_0x4a2c70[_0x173d('0x44')]);_0x2c598c[_0x173d('0x47')]=_[_0x173d('0x46')](_0x4a2c70['model'],qs['fields'](_0xeb9d5[_0x173d('0x44')][_0x173d('0x48')]));_0x2c598c[_0x173d('0x47')]=_0x2c598c[_0x173d('0x47')]['length']?_0x2c598c[_0x173d('0x47')]:_0x4a2c70[_0x173d('0x42')];if(_0xeb9d5[_0x173d('0x44')][_0x173d('0x52')]){_0x2c598c[_0x173d('0x57')]=[{'all':!![]}];}_0x2c598c=_[_0x173d('0x4f')]({},_0x2c598c,_0xeb9d5[_0x173d('0x51')]);return db[_0x173d('0x3f')][_0x173d('0x58')](_0x2c598c)[_0x173d('0x22')](handleEntityNotFound(_0x16203b,null))[_0x173d('0x22')](respondWithResult(_0x16203b,null))[_0x173d('0x54')](handleError(_0x16203b,null));};exports[_0x173d('0x59')]=function(_0x1b43f6,_0x443ba1){return db[_0x173d('0x3f')][_0x173d('0x59')](_0x1b43f6['body'],{})[_0x173d('0x22')](function(_0x2de3c3){var _0x2ce87e=_0x1b43f6[_0x173d('0x5a')][_0x173d('0x5b')]({'plain':!![]});if(!_0x2ce87e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ce87e[_0x173d('0x5c')]==='user'){var _0x2b1bcb=_0x2de3c3['get']({'plain':!![]});var _0x14c834='OpenchannelAccounts';return db[_0x173d('0x5d')][_0x173d('0x58')]({'where':{'name':_0x14c834,'userProfileId':_0x2ce87e[_0x173d('0x5e')]},'raw':!![]})['then'](function(_0x1922a5){if(_0x1922a5&&_0x1922a5[_0x173d('0x5f')]===0x0){return db[_0x173d('0x38')]['create']({'name':_0x2b1bcb[_0x173d('0x3a')],'resourceId':_0x2b1bcb['id'],'type':_0x1922a5[_0x173d('0x3a')],'sectionId':_0x1922a5['id']},{})[_0x173d('0x22')](function(){return _0x2de3c3;});}else{return _0x2de3c3;}})['catch'](function(_0x453094){logger['error'](_0x173d('0x60'),_0x453094);throw _0x453094;});}return _0x2de3c3;})[_0x173d('0x22')](respondWithResult(_0x443ba1,0xc9))[_0x173d('0x54')](handleError(_0x443ba1,null));};exports[_0x173d('0x35')]=function(_0x169c8e,_0x3bafce){if(_0x169c8e[_0x173d('0x61')]['id']){delete _0x169c8e[_0x173d('0x61')]['id'];}return db[_0x173d('0x3f')][_0x173d('0x58')]({'where':{'id':_0x169c8e[_0x173d('0x62')]['id']},'include':[{'model':db[_0x173d('0x3d')],'as':_0x173d('0x63')}]})[_0x173d('0x22')](handleEntityNotFound(_0x3bafce,null))[_0x173d('0x22')](saveUpdates(_0x169c8e[_0x173d('0x61')],null))['then'](respondWithResult(_0x3bafce,null))[_0x173d('0x54')](handleError(_0x3bafce,null));};exports['destroy']=function(_0x4178b4,_0x5d0c2d){return db['OpenchannelAccount'][_0x173d('0x58')]({'where':{'id':_0x4178b4['params']['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x5d0c2d,null))['then'](removeEntity(_0x5d0c2d,null))[_0x173d('0x54')](handleError(_0x5d0c2d,null));};exports['describe']=function(_0x1a4561,_0x3c2dc5){return db[_0x173d('0x3f')][_0x173d('0x64')]()[_0x173d('0x22')](respondWithResult(_0x3c2dc5,null))[_0x173d('0x54')](handleError(_0x3c2dc5,null));};exports[_0x173d('0x65')]=function(_0x93b599,_0x142069,_0x10f6ea){if(_0x93b599[_0x173d('0x61')]['id']){delete _0x93b599[_0x173d('0x61')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x93b599[_0x173d('0x62')]['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x142069,null))[_0x173d('0x22')](function(_0x13203b){if(_0x13203b){_0x93b599[_0x173d('0x61')][_0x173d('0x66')]=_0x13203b['id'];return db[_0x173d('0x67')]['create'](_0x93b599[_0x173d('0x61')]);}})[_0x173d('0x22')](respondWithResult(_0x142069,null))[_0x173d('0x54')](handleError(_0x142069,null));};exports[_0x173d('0x68')]=function(_0xb032b9,_0x2b2467,_0x4e7041){var _0x44bde5={'raw':![],'where':{}};var _0x33e2d9={};var _0x5805fd={'count':0x0,'rows':[]};return db[_0x173d('0x3f')][_0x173d('0x69')]({'where':{'id':_0xb032b9['params']['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x2b2467,null))[_0x173d('0x22')](function(_0x3ef2c6){if(_0x3ef2c6){_0x33e2d9[_0x173d('0x42')]=_[_0x173d('0x43')](db[_0x173d('0x67')]['rawAttributes']);_0x33e2d9[_0x173d('0x44')]=_[_0x173d('0x43')](_0xb032b9[_0x173d('0x44')]);_0x33e2d9['filters']=_[_0x173d('0x46')](_0x33e2d9[_0x173d('0x42')],_0x33e2d9['query']);_0x44bde5[_0x173d('0x47')]=_[_0x173d('0x46')](_0x33e2d9[_0x173d('0x42')],qs['fields'](_0xb032b9['query']['fields']));_0x44bde5[_0x173d('0x47')]=_0x44bde5[_0x173d('0x47')][_0x173d('0x49')]?_0x44bde5['attributes']:_0x33e2d9[_0x173d('0x42')];if(!_0xb032b9['query'][_0x173d('0x6a')](_0x173d('0x6b'))){_0x44bde5[_0x173d('0x31')]=qs['limit'](_0xb032b9[_0x173d('0x44')][_0x173d('0x31')]);_0x44bde5['offset']=qs[_0x173d('0x33')](_0xb032b9[_0x173d('0x44')]['offset']);}_0x44bde5[_0x173d('0x4a')]=qs[_0x173d('0x4b')](_0xb032b9[_0x173d('0x44')][_0x173d('0x4b')]);_0x44bde5[_0x173d('0x4e')]=qs['filters'](_['pick'](_0xb032b9[_0x173d('0x44')],_0x33e2d9[_0x173d('0x45')]));_0x44bde5['where']['OpenchannelAccountId']=_0x3ef2c6['id'];if(_0xb032b9[_0x173d('0x44')][_0x173d('0x4d')]){_0x44bde5['where']=_[_0x173d('0x4f')](_0x44bde5[_0x173d('0x4e')],{'$or':_['map'](_0x44bde5[_0x173d('0x47')],function(_0x5dacaa){var _0x236743={};_0x236743[_0x5dacaa]={'$like':'%'+_0xb032b9[_0x173d('0x44')][_0x173d('0x4d')]+'%'};return _0x236743;})});}_0x44bde5=_[_0x173d('0x4f')]({},_0x44bde5,_0xb032b9[_0x173d('0x51')]);return db[_0x173d('0x67')][_0x173d('0x32')]({'where':_0x44bde5[_0x173d('0x4e')]})[_0x173d('0x22')](function(_0x4ccce0){_0x5805fd[_0x173d('0x32')]=_0x4ccce0;if(_0xb032b9[_0x173d('0x44')][_0x173d('0x52')]){_0x44bde5[_0x173d('0x57')]=[{'all':!![]}];}return db[_0x173d('0x67')]['findAll'](_0x44bde5);})[_0x173d('0x22')](function(_0x21333d){_0x5805fd['rows']=_0x21333d;return _0x5805fd;});}})[_0x173d('0x22')](respondWithFilteredResult(_0x2b2467,_0x44bde5))[_0x173d('0x54')](handleError(_0x2b2467,null));};exports['removeDispositions']=function(_0x59f97f,_0x170759,_0x223d45){return db['OpenchannelAccount'][_0x173d('0x58')]({'where':{'id':_0x59f97f['params']['id']}})['then'](handleEntityNotFound(_0x170759,null))[_0x173d('0x22')](function(_0x2e28b9){if(_0x2e28b9){return _0x2e28b9[_0x173d('0x6c')](_0x59f97f[_0x173d('0x44')]['ids']);}})[_0x173d('0x22')](respondWithStatusCode(_0x170759,null))['catch'](handleError(_0x170759,null));};exports['addAnswer']=function(_0x5593ad,_0x26981f,_0x12e011){if(_0x5593ad['body']['id']){delete _0x5593ad[_0x173d('0x61')]['id'];}return db[_0x173d('0x3f')]['find']({'where':{'id':_0x5593ad['params']['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x26981f,null))[_0x173d('0x22')](function(_0x1158ff){if(_0x1158ff){_0x5593ad['body'][_0x173d('0x66')]=_0x1158ff['id'];return db['CannedAnswer'][_0x173d('0x59')](_0x5593ad[_0x173d('0x61')]);}})['then'](respondWithResult(_0x26981f,null))['catch'](handleError(_0x26981f,null));};exports[_0x173d('0x6d')]=function(_0x5476b8,_0x5d1588,_0x6e9722){var _0x62193b={'raw':![],'where':{}};var _0x1516b6={};var _0x133094={'count':0x0,'rows':[]};return db[_0x173d('0x3f')][_0x173d('0x69')]({'where':{'id':_0x5476b8[_0x173d('0x62')]['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x5d1588,null))[_0x173d('0x22')](function(_0x5e4fcb){if(_0x5e4fcb){_0x1516b6[_0x173d('0x42')]=_[_0x173d('0x43')](db[_0x173d('0x6e')][_0x173d('0x56')]);_0x1516b6[_0x173d('0x44')]=_[_0x173d('0x43')](_0x5476b8[_0x173d('0x44')]);_0x1516b6[_0x173d('0x45')]=_[_0x173d('0x46')](_0x1516b6['model'],_0x1516b6[_0x173d('0x44')]);_0x62193b[_0x173d('0x47')]=_['intersection'](_0x1516b6[_0x173d('0x42')],qs['fields'](_0x5476b8[_0x173d('0x44')][_0x173d('0x48')]));_0x62193b[_0x173d('0x47')]=_0x62193b['attributes']['length']?_0x62193b[_0x173d('0x47')]:_0x1516b6['model'];if(!_0x5476b8[_0x173d('0x44')][_0x173d('0x6a')](_0x173d('0x6b'))){_0x62193b[_0x173d('0x31')]=qs[_0x173d('0x31')](_0x5476b8[_0x173d('0x44')][_0x173d('0x31')]);_0x62193b['offset']=qs[_0x173d('0x33')](_0x5476b8[_0x173d('0x44')][_0x173d('0x33')]);}_0x62193b[_0x173d('0x4a')]=qs['sort'](_0x5476b8[_0x173d('0x44')][_0x173d('0x4b')]);_0x62193b['where']=qs['filters'](_[_0x173d('0x4c')](_0x5476b8[_0x173d('0x44')],_0x1516b6[_0x173d('0x45')]));_0x62193b[_0x173d('0x4e')][_0x173d('0x66')]=_0x5e4fcb['id'];if(_0x5476b8[_0x173d('0x44')][_0x173d('0x4d')]){_0x62193b['where']=_[_0x173d('0x4f')](_0x62193b[_0x173d('0x4e')],{'$or':_['map'](_0x62193b['attributes'],function(_0x2967d3){var _0x41bf63={};_0x41bf63[_0x2967d3]={'$like':'%'+_0x5476b8[_0x173d('0x44')][_0x173d('0x4d')]+'%'};return _0x41bf63;})});}_0x62193b=_[_0x173d('0x4f')]({},_0x62193b,_0x5476b8[_0x173d('0x51')]);return db[_0x173d('0x6e')][_0x173d('0x32')]({'where':_0x62193b[_0x173d('0x4e')]})[_0x173d('0x22')](function(_0x2b69ce){_0x133094[_0x173d('0x32')]=_0x2b69ce;if(_0x5476b8['query'][_0x173d('0x52')]){_0x62193b['include']=[{'all':!![]}];}return db[_0x173d('0x6e')][_0x173d('0x6f')](_0x62193b);})[_0x173d('0x22')](function(_0x194bea){_0x133094[_0x173d('0x53')]=_0x194bea;return _0x133094;});}})[_0x173d('0x22')](respondWithFilteredResult(_0x5d1588,_0x62193b))[_0x173d('0x54')](handleError(_0x5d1588,null));};exports[_0x173d('0x70')]=function(_0x11fbc4,_0x49d95c,_0x2d8af4){return db['OpenchannelAccount'][_0x173d('0x58')]({'where':{'id':_0x11fbc4[_0x173d('0x62')]['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x49d95c,null))[_0x173d('0x22')](function(_0x63e00e){if(_0x63e00e){return _0x63e00e[_0x173d('0x70')](_0x11fbc4['query'][_0x173d('0x71')]);}})[_0x173d('0x22')](respondWithStatusCode(_0x49d95c,null))['catch'](handleError(_0x49d95c,null));};exports[_0x173d('0x72')]=function(_0x3360b8,_0x3582e4,_0x180223){var _0xb0b1e6={'body':_0x3360b8['body'],'channel':'openchannel'};var _0x1adb77=[];var _0x3cf33f=[];var _0x40a695={};var _0x196dc2=![];return db['CmContact'][_0x173d('0x64')]()['then'](function(_0x427b31){if(!_0x427b31){throw new db[(_0x173d('0x73'))][(_0x173d('0x74'))](_0x173d('0x75'));}_0x1adb77=_[_0x173d('0x76')](_['keys'](_0x427b31),[_0x173d('0x77'),'updatedAt']);_0x3cf33f=_['difference'](_[_0x173d('0x43')](_0x427b31),[_0x173d('0x77'),_0x173d('0x78'),_0x173d('0x79'),'ListId']);if(_0x3360b8[_0x173d('0x61')]['id']){delete _0x3360b8['body']['id'];}if(_['isNil'](_0x3360b8[_0x173d('0x61')][_0x173d('0x7a')])){throw new db[(_0x173d('0x73'))]['ValidationError'](_0x173d('0x7b'));}if(_[_0x173d('0x7c')](_0x3360b8[_0x173d('0x61')][_0x173d('0x61')])||_0x3360b8[_0x173d('0x61')][_0x173d('0x61')]===''){throw new db[(_0x173d('0x73'))][(_0x173d('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x173d('0x7c')](_0x3360b8[_0x173d('0x61')][_0x173d('0x7d')])){throw new db[(_0x173d('0x73'))][(_0x173d('0x74'))](_0x173d('0x7e')+_0x3cf33f);}if(!_[_0x173d('0x7f')](_0x3cf33f,_0x3360b8[_0x173d('0x61')]['mapKey'])){throw new db['Sequelize'][(_0x173d('0x74'))](_0x173d('0x80')+_0x3cf33f);}_0x40a695[_0x3360b8['body'][_0x173d('0x7d')]]=_0x3360b8[_0x173d('0x61')][_0x173d('0x7a')];})[_0x173d('0x22')](function(){return db[_0x173d('0x3f')][_0x173d('0x58')]({'where':{'id':_0x3360b8[_0x173d('0x62')]['id']},'include':[{'model':db[_0x173d('0x81')],'as':_0x173d('0x82'),'include':[{'model':db[_0x173d('0x83')],'as':_0x173d('0x84'),'where':_0x40a695,'limit':0x1,'order':[[_0x173d('0x78'),'DESC']]}]},{'model':db[_0x173d('0x85')],'as':'Applications'}]});})[_0x173d('0x22')](handleEntityNotFound(_0x3582e4,null))[_0x173d('0x22')](function(_0x8d9e91){if(_0x8d9e91&&_0x8d9e91['List']){_0xb0b1e6[_0x173d('0x86')]=_0x8d9e91;_0xb0b1e6[_0x173d('0x87')]=_0x8d9e91[_0x173d('0x88')];_0xb0b1e6[_0x173d('0x89')]=_0x8d9e91['List'];_0xb0b1e6['applications']=_[_0x173d('0x8a')](_0xb0b1e6[_0x173d('0x87')],[_0x173d('0x8b')],['asc']);if(_0xb0b1e6['account'][_0x173d('0x88')]){delete _0xb0b1e6[_0x173d('0x86')][_0x173d('0x88')];}if(_0xb0b1e6[_0x173d('0x86')][_0x173d('0x82')]&&_0xb0b1e6['account'][_0x173d('0x82')]['Contacts'][_0x173d('0x49')]){return _0xb0b1e6[_0x173d('0x86')]['List']['Contacts'][0x0];}var _0x499b1c=_[_0x173d('0x8c')](_0x3360b8[_0x173d('0x61')],{'firstName':_0x3360b8[_0x173d('0x61')]['from'],'ListId':_0x8d9e91[_0x173d('0x8d')]});_0x499b1c[_0x3360b8[_0x173d('0x61')][_0x173d('0x7d')]]=_0x3360b8['body'][_0x173d('0x7a')];return db[_0x173d('0x83')][_0x173d('0x59')](_0x499b1c,{'fields':_0x1adb77,'raw':!![]});}})[_0x173d('0x22')](handleEntityNotFound(_0x3582e4,null))[_0x173d('0x22')](function(_0x5173d0){_0xb0b1e6[_0x173d('0x8e')]=_0x5173d0;if(_0x5173d0){var _0x292394={'ContactId':_0x5173d0['id'],'OpenchannelAccountId':_0x3360b8['params']['id'],'from':(_0x5173d0[_0x173d('0x8f')]||'')+'\x20'+(_0x5173d0['lastName']||'')};var _0x3cfc40={'OpenchannelAccountId':_0x3360b8[_0x173d('0x62')]['id'],'closed':![]};if(_0x3360b8[_0x173d('0x61')][_0x173d('0x90')]){_0x3cfc40[_0x173d('0x90')]=_0x3360b8[_0x173d('0x61')][_0x173d('0x90')];return db['OpenchannelInteraction'][_0x173d('0x58')]({'where':_0x3cfc40})[_0x173d('0x22')](function(_0x2ae124){if(_0x2ae124){return[_0x2ae124,![]];}_0x292394[_0x173d('0x90')]=_0x3360b8[_0x173d('0x61')][_0x173d('0x90')];_0x292394[_0x173d('0x91')]=_0x3360b8[_0x173d('0x61')][_0x173d('0x91')];return db[_0x173d('0x92')][_0x173d('0x59')](_0x292394)['then'](function(_0x232bc4){return[_0x232bc4,!![]];});});}else{_0x3cfc40[_0x173d('0x90')]=null;}_0x3cfc40[_0x173d('0x93')]=_0x5173d0['id'];return db['OpenchannelInteraction'][_0x173d('0x58')]({'where':_0x3cfc40})[_0x173d('0x22')](function(_0x563477){if(_0x563477){return[_0x563477,![]];}return db[_0x173d('0x92')][_0x173d('0x59')](_0x292394)[_0x173d('0x22')](function(_0x287531){return[_0x287531,!![]];});});}})[_0x173d('0x94')](function(_0x5573d7,_0x119f65){if(_0x5573d7){_0x196dc2=_0x119f65;if(!_0x119f65){var _0x2cc0bf={'from':(_0xb0b1e6[_0x173d('0x8e')][_0x173d('0x8f')]||'')+'\x20'+(_0xb0b1e6[_0x173d('0x8e')][_0x173d('0x95')]||'')};if(_0x3360b8['body'][_0x173d('0x90')]&&_0x3360b8[_0x173d('0x61')][_0x173d('0x96')]&&_0x3360b8[_0x173d('0x61')][_0x173d('0x90')]!=_0x3360b8[_0x173d('0x61')]['messageId']){_0x2cc0bf[_0x173d('0x90')]=_0x3360b8[_0x173d('0x61')][_0x173d('0x96')];}return _0x5573d7['update'](_0x2cc0bf);}else{return _0x5573d7;}}})[_0x173d('0x22')](function(_0x5cd395){_0xb0b1e6[_0x173d('0x97')]=_0x5cd395[_0x173d('0x5b')]({'plain':!![]});_0xb0b1e6[_0x173d('0x97')][_0x173d('0x98')]=_0x196dc2;if(_0xb0b1e6[_0x173d('0x97')][_0x173d('0x98')]){if(_0xb0b1e6[_0x173d('0x86')][_0x173d('0x99')]){_0xb0b1e6[_0x173d('0x87')][_0x173d('0x9a')]({'id':0x0,'priority':_0xb0b1e6[_0x173d('0x87')][_0x173d('0x49')]+0x1,'app':'close','appdata':_0x173d('0x9b'),'interval':'*,*,*,*'});}}return db[_0x173d('0x9c')][_0x173d('0x59')]({'body':_0x3360b8[_0x173d('0x61')]['body'],'OpenchannelAccountId':_0x3360b8[_0x173d('0x62')]['id'],'OpenchannelInteractionId':_0x5cd395['id'],'direction':'in','ContactId':_0xb0b1e6[_0x173d('0x8e')]['id'],'AttachmentId':_0x3360b8[_0x173d('0x61')][_0x173d('0x9d')]});})['then'](function(_0x2f12d0){_0xb0b1e6[_0x173d('0x2b')]=_0x2f12d0;if(_0xb0b1e6[_0x173d('0x97')][_0x173d('0x9e')]){return db[_0x173d('0x9f')][_0x173d('0x58')]({'attributes':['id','name'],'where':{'id':_0xb0b1e6[_0x173d('0x97')][_0x173d('0x9e')]}})['then'](function(_0x123092){if(_0x123092){_0xb0b1e6['applications'][_0x173d('0xa0')]({'id':0x0,'priority':0x0,'app':_0x173d('0xa1'),'appdata':_0x123092['name']+','+(_0xb0b1e6['account'][_0x173d('0xa2')]||0xa),'interval':'*,*,*,*'});_0xb0b1e6[_0x173d('0xa3')]=![];}return respondWithRpcPromise(_0x173d('0xa4'),_0x173d('0xa5'),_0xb0b1e6);});}return respondWithRpcPromise(_0x173d('0xa4'),'startRouting',_0xb0b1e6);})[_0x173d('0x22')](function(_0x2121e6){respondWithRpcPromise(_0x173d('0xa6'),'EventManager',{'event':_0x173d('0x72'),'message':_0x2121e6},client9002);return _0x2121e6;})[_0x173d('0x22')](respondWithResult(_0x3582e4,null))[_0x173d('0x54')](handleError(_0x3582e4,null));};exports[_0x173d('0xa7')]=function(_0x2c63d7,_0x77de6d,_0x4ab9a7){return db['OpenchannelAccount'][_0x173d('0x69')]({'where':{'id':_0x2c63d7[_0x173d('0x62')]['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x77de6d,null))[_0x173d('0x22')](function(_0x3420e1){if(_0x3420e1){return db[_0x173d('0xa8')][_0x173d('0xa9')](function(_0x59f08c){return db[_0x173d('0x85')][_0x173d('0x36')]({'where':{'OpenchannelAccountId':_0x2c63d7[_0x173d('0x62')]['id']},'transaction':_0x59f08c})[_0x173d('0x22')](function(_0x22554e){var _0x32a024=_[_0x173d('0x3e')](_0x2c63d7[_0x173d('0x61')],function(_0x2bd492){_0x2bd492[_0x173d('0x66')]=_0x2c63d7['params']['id'];return _0x2bd492;});return db[_0x173d('0x85')][_0x173d('0xaa')](_0x32a024,{'transaction':_0x59f08c});});})[_0x173d('0x22')](function(){return db[_0x173d('0x85')][_0x173d('0xab')]({'where':{'OpenchannelAccountId':_0x2c63d7[_0x173d('0x62')]['id']},'order':_0x173d('0x8b')});});}})[_0x173d('0x22')](respondWithResult(_0x77de6d,null))[_0x173d('0x54')](handleError(_0x77de6d,null));};exports[_0x173d('0xac')]=function(_0x43f09c,_0x47610a,_0x2d42d6){var _0x3d7297={};var _0x213cd3={};var _0x45c632;var _0x4ba52e;return db[_0x173d('0x3f')][_0x173d('0x69')]({'where':{'id':_0x43f09c['params']['id']}})['then'](handleEntityNotFound(_0x47610a,null))['then'](function(_0xb2c927){if(_0xb2c927){_0x45c632=_0xb2c927;_0x213cd3['model']=_[_0x173d('0x43')](db[_0x173d('0x85')][_0x173d('0x56')]);_0x213cd3['query']=_[_0x173d('0x43')](_0x43f09c[_0x173d('0x44')]);_0x213cd3[_0x173d('0x45')]=_['intersection'](_0x213cd3[_0x173d('0x42')],_0x213cd3['query']);_0x3d7297['attributes']=_[_0x173d('0x46')](_0x213cd3[_0x173d('0x42')],qs[_0x173d('0x48')](_0x43f09c[_0x173d('0x44')][_0x173d('0x48')]));_0x3d7297[_0x173d('0x47')]=_0x3d7297[_0x173d('0x47')][_0x173d('0x49')]?_0x3d7297[_0x173d('0x47')]:_0x213cd3[_0x173d('0x42')];_0x3d7297[_0x173d('0x4a')]=qs['sort'](_0x43f09c['query'][_0x173d('0x4b')]);_0x3d7297['where']=qs[_0x173d('0x45')](_[_0x173d('0x4c')](_0x43f09c[_0x173d('0x44')],_0x213cd3[_0x173d('0x45')]));if(_0x43f09c[_0x173d('0x44')][_0x173d('0x4d')]){_0x3d7297[_0x173d('0x4e')]=_[_0x173d('0x4f')](_0x3d7297['where'],{'$or':_['map'](_0x3d7297[_0x173d('0x47')],function(_0x22eec6){var _0xb151d0={};_0xb151d0[_0x22eec6]={'$like':'%'+_0x43f09c[_0x173d('0x44')]['filter']+'%'};return _0xb151d0;})});}_0x3d7297=_['merge']({},_0x3d7297,_0x43f09c[_0x173d('0x51')]);return _0x45c632[_0x173d('0xac')](_0x3d7297);}})['then'](function(_0x41a77f){if(_0x41a77f){_0x4ba52e=_0x41a77f[_0x173d('0x49')];if(!_0x43f09c['query'][_0x173d('0x6a')]('nolimit')){_0x3d7297[_0x173d('0x31')]=qs[_0x173d('0x31')](_0x43f09c[_0x173d('0x44')][_0x173d('0x31')]);_0x3d7297[_0x173d('0x33')]=qs['offset'](_0x43f09c[_0x173d('0x44')]['offset']);}return _0x45c632[_0x173d('0xac')](_0x3d7297);}})[_0x173d('0x22')](function(_0x56872d){if(_0x56872d){return _0x56872d?{'count':_0x4ba52e,'rows':_0x56872d}:null;}})['then'](respondWithResult(_0x47610a,null))[_0x173d('0x54')](handleError(_0x47610a,null));};exports[_0x173d('0xad')]=function(_0x3ef405,_0x1048bd,_0x227796){var _0x2b94b3={'raw':![],'where':{}};var _0xb3355b={};var _0x18572d={'count':0x0,'rows':[]};return db[_0x173d('0x3f')]['findOne']({'where':{'id':_0x3ef405[_0x173d('0x62')]['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x1048bd,null))['then'](function(_0x312f7e){if(_0x312f7e){_0xb3355b[_0x173d('0x42')]=_[_0x173d('0x43')](db[_0x173d('0x92')][_0x173d('0x56')]);_0xb3355b[_0x173d('0x44')]=_['keys'](_0x3ef405[_0x173d('0x44')]);_0xb3355b[_0x173d('0x45')]=_['intersection'](_0xb3355b[_0x173d('0x42')],_0xb3355b['query']);_0x2b94b3['attributes']=_[_0x173d('0x46')](_0xb3355b[_0x173d('0x42')],qs[_0x173d('0x48')](_0x3ef405[_0x173d('0x44')][_0x173d('0x48')]));_0x2b94b3[_0x173d('0x47')]=_0x2b94b3['attributes'][_0x173d('0x49')]?_0x2b94b3[_0x173d('0x47')]:_0xb3355b['model'];if(!_0x3ef405[_0x173d('0x44')][_0x173d('0x6a')](_0x173d('0x6b'))){_0x2b94b3['limit']=qs[_0x173d('0x31')](_0x3ef405[_0x173d('0x44')][_0x173d('0x31')]);_0x2b94b3[_0x173d('0x33')]=qs[_0x173d('0x33')](_0x3ef405[_0x173d('0x44')][_0x173d('0x33')]);}_0x2b94b3[_0x173d('0x4a')]=qs[_0x173d('0x4b')](_0x3ef405['query'][_0x173d('0x4b')]);_0x2b94b3[_0x173d('0x4e')]=qs[_0x173d('0x45')](_[_0x173d('0x4c')](_0x3ef405[_0x173d('0x44')],_0xb3355b[_0x173d('0x45')]));_0x2b94b3[_0x173d('0x4e')][_0x173d('0x66')]=_0x312f7e['id'];if(_0x3ef405['query'][_0x173d('0x4d')]){_0x2b94b3['where']=_['merge'](_0x2b94b3['where'],{'$or':_[_0x173d('0x3e')](_0x2b94b3[_0x173d('0x47')],function(_0x2988e8){var _0x456552={};_0x456552[_0x2988e8]={'$like':'%'+_0x3ef405[_0x173d('0x44')][_0x173d('0x4d')]+'%'};return _0x456552;})});}_0x2b94b3=_[_0x173d('0x4f')]({},_0x2b94b3,_0x3ef405['options']);return db[_0x173d('0x92')][_0x173d('0x32')]({'where':_0x2b94b3[_0x173d('0x4e')]})[_0x173d('0x22')](function(_0x104899){_0x18572d[_0x173d('0x32')]=_0x104899;if(_0x3ef405[_0x173d('0x44')]['includeAll']){_0x2b94b3['include']=[{'model':db[_0x173d('0x83')],'as':_0x173d('0xae'),'required':![]},{'model':db['User'],'as':_0x173d('0xaf'),'attributes':[_0x173d('0x3a'),_0x173d('0xb0'),_0x173d('0xb1')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x173d('0x3a'),'color'],'where':_0x3ef405['query'][_0x173d('0xb2')]?{'id':_0x3ef405['query']['tag']}:undefined,'required':_0x3ef405[_0x173d('0x44')][_0x173d('0xb2')]?!![]:![]}];}return db[_0x173d('0x92')][_0x173d('0x6f')](_0x2b94b3);})[_0x173d('0x22')](function(_0x106bae){_0x18572d['rows']=_0x106bae;return _0x18572d;});}})['then'](respondWithFilteredResult(_0x1048bd,_0x2b94b3))[_0x173d('0x54')](handleError(_0x1048bd,null));};exports[_0x173d('0xb3')]=function(_0x5d7a0d,_0x4355d5,_0x59c3d0){return db[_0x173d('0x3f')]['find']({'where':{'id':_0x5d7a0d[_0x173d('0x62')]['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x4355d5,null))['then'](function(_0x1cf763){if(_0x1cf763){return _0x1cf763['addAgents'](_0x5d7a0d[_0x173d('0x61')]['ids'],_['omit'](_0x5d7a0d[_0x173d('0x61')],[_0x173d('0x71'),'id'])||{})[_0x173d('0x94')](function(_0x108032){for(var _0x55f859=0x0;_0x55f859<_0x5d7a0d[_0x173d('0x61')][_0x173d('0x71')][_0x173d('0x49')];_0x55f859+=0x1){socket[_0x173d('0xb4')](_0x173d('0xb5'),{'UserId':Number(_0x5d7a0d[_0x173d('0x61')]['ids'][_0x55f859]),'OpenchannelAccountId':Number(_0x5d7a0d[_0x173d('0x62')]['id'])});}return _0x108032;});}})[_0x173d('0x22')](respondWithResult(_0x4355d5,null))[_0x173d('0x54')](handleError(_0x4355d5,null));};exports[_0x173d('0xb6')]=function(_0x45990c,_0x4148ad,_0x229ecd){return db[_0x173d('0x3f')]['find']({'where':{'id':_0x45990c[_0x173d('0x62')]['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x4148ad,null))[_0x173d('0x22')](function(_0x3b691d){if(_0x3b691d){return _0x3b691d[_0x173d('0xb6')](_0x45990c['query']['ids'])[_0x173d('0x22')](function(){if(_[_0x173d('0xb7')](_0x45990c[_0x173d('0x44')][_0x173d('0x71')])){for(var _0x479de6=0x0;_0x479de6<_0x45990c['query'][_0x173d('0x71')][_0x173d('0x49')];_0x479de6+=0x1){socket[_0x173d('0xb4')]('userOpenchannelAccount:remove',{'UserId':Number(_0x45990c[_0x173d('0x44')][_0x173d('0x71')][_0x479de6]),'OpenchannelAccountId':Number(_0x45990c['params']['id'])});}}else{socket[_0x173d('0xb4')]('userOpenchannelAccount:remove',{'UserId':Number(_0x45990c[_0x173d('0x44')][_0x173d('0x71')]),'OpenchannelAccountId':Number(_0x45990c[_0x173d('0x62')]['id'])});}});}})[_0x173d('0x22')](respondWithStatusCode(_0x4148ad,null))[_0x173d('0x54')](handleError(_0x4148ad,null));};exports[_0x173d('0xb8')]=function(_0x54b609,_0x2ded6b,_0x49e763){var _0x46f7c0={};var _0x44445f={};var _0x16aeb6;var _0xefeec2;return db[_0x173d('0x3f')][_0x173d('0x69')]({'where':{'id':_0x54b609[_0x173d('0x62')]['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x2ded6b,null))[_0x173d('0x22')](function(_0x5919a8){if(_0x5919a8){_0x16aeb6=_0x5919a8;_0x44445f['model']=_[_0x173d('0x43')](db[_0x173d('0x9f')]['rawAttributes']);_0x44445f['query']=_['keys'](_0x54b609[_0x173d('0x44')]);_0x44445f['filters']=_[_0x173d('0x46')](_0x44445f[_0x173d('0x42')],_0x44445f[_0x173d('0x44')]);_0x46f7c0['attributes']=_['intersection'](_0x44445f[_0x173d('0x42')],qs[_0x173d('0x48')](_0x54b609[_0x173d('0x44')]['fields']));_0x46f7c0['attributes']=_0x46f7c0[_0x173d('0x47')][_0x173d('0x49')]?_0x46f7c0[_0x173d('0x47')]:_0x44445f[_0x173d('0x42')];_0x46f7c0[_0x173d('0x4a')]=qs[_0x173d('0x4b')](_0x54b609[_0x173d('0x44')][_0x173d('0x4b')]);_0x46f7c0[_0x173d('0x4e')]=qs[_0x173d('0x45')](_[_0x173d('0x4c')](_0x54b609[_0x173d('0x44')],_0x44445f[_0x173d('0x45')]));if(_0x54b609['query'][_0x173d('0x4d')]){_0x46f7c0['where']=_[_0x173d('0x4f')](_0x46f7c0[_0x173d('0x4e')],{'$or':_[_0x173d('0x3e')](_0x46f7c0[_0x173d('0x47')],function(_0x4a0393){var _0x3dcfd5={};_0x3dcfd5[_0x4a0393]={'$like':'%'+_0x54b609[_0x173d('0x44')][_0x173d('0x4d')]+'%'};return _0x3dcfd5;})});}_0x46f7c0=_[_0x173d('0x4f')]({},_0x46f7c0,_0x54b609['options']);return _0x16aeb6[_0x173d('0xb8')](_0x46f7c0);}})['then'](function(_0x506e58){if(_0x506e58){_0xefeec2=_0x506e58[_0x173d('0x49')];if(!_0x54b609[_0x173d('0x44')][_0x173d('0x6a')]('nolimit')){_0x46f7c0[_0x173d('0x31')]=qs[_0x173d('0x31')](_0x54b609[_0x173d('0x44')][_0x173d('0x31')]);_0x46f7c0['offset']=qs['offset'](_0x54b609['query']['offset']);}return _0x16aeb6['getAgents'](_0x46f7c0);}})[_0x173d('0x22')](function(_0x2cfe4f){if(_0x2cfe4f){return _0x2cfe4f?{'count':_0xefeec2,'rows':_0x2cfe4f}:null;}})[_0x173d('0x22')](respondWithResult(_0x2ded6b,null))['catch'](handleError(_0x2ded6b,null));};exports['send']=function(_0x104849,_0x4f59d0,_0x225881){var _0x4273bd,_0xaacabf,_0x36b5bf;if(_[_0x173d('0x7c')](_0x104849['body'][_0x173d('0x61')])||_0x104849[_0x173d('0x61')]['body']===''){throw new db[(_0x173d('0x73'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x173d('0x7c')](_0x104849[_0x173d('0x61')]['to'])){}_0x4273bd=_0x104849['body']['to'];return db[_0x173d('0x3f')][_0x173d('0x69')]({'where':{'id':_0x104849[_0x173d('0x62')]['id']}})[_0x173d('0x22')](handleEntityNotFound(_0x4f59d0,null))[_0x173d('0x22')](function(_0x402a31){if(_0x402a31){return db[_0x173d('0x3f')][_0x173d('0x58')]({'where':{'id':_0x402a31['id']},'include':[{'model':db[_0x173d('0x81')],'as':_0x173d('0x82'),'include':[{'model':db[_0x173d('0x83')],'as':_0x173d('0x84'),'where':{[_0x402a31['mapKey']]:_0x4273bd},'limit':0x1,'order':[[_0x173d('0x78'),_0x173d('0xb9')]]}]}]})[_0x173d('0x22')](handleEntityNotFound(_0x4f59d0,null))[_0x173d('0x22')](function(_0x186e60){if(_0x186e60&&_0x186e60[_0x173d('0x82')]){_0xaacabf=_0x186e60[_0x173d('0x5b')]({'plain':!![]});if(_0xaacabf[_0x173d('0x82')]&&_0xaacabf[_0x173d('0x82')]['Contacts'][_0x173d('0x49')]){return _0xaacabf['List']['Contacts'][0x0];}return db[_0x173d('0x83')]['create'](_[_0x173d('0x8c')](_0x104849[_0x173d('0x61')],{'firstName':_0x4273bd,[_0x186e60[_0x173d('0x7d')]]:_0x4273bd,'phone':_0x4273bd,'ListId':_0xaacabf['ListId']}));}})['then'](handleEntityNotFound(_0x4f59d0,null))[_0x173d('0x22')](function(_0x13b86b){if(_0x13b86b){_0x36b5bf=_0x13b86b;return db['OpenchannelInteraction'][_0x173d('0x58')]({'where':{'ContactId':_0x36b5bf['id'],'closed':![],'OpenchannelAccountId':_0xaacabf['id']}})[_0x173d('0x22')](function(_0x31efa9){if(_0x31efa9){return[_0x31efa9,![]];}return db[_0x173d('0x92')]['create']({'UserId':_0x104849['user']['id'],'ContactId':_0x36b5bf['id'],'OpenchannelAccountId':_0xaacabf['id'],'lastMsgDirection':'out','Messages':[_[_0x173d('0x4f')](_0x104849[_0x173d('0x61')],{'read':![],'body':_0x104849[_0x173d('0x61')][_0x173d('0x61')],'OpenchannelAccountId':_0xaacabf['id'],'UserId':_0x104849[_0x173d('0x5a')]['id'],'ContactId':_0x36b5bf['id']})]},{'include':[{'model':db[_0x173d('0x9c')],'as':_0x173d('0xba')}]})[_0x173d('0x22')](function(_0x3964fd){return[_0x3964fd,!![]];});});}})[_0x173d('0x94')](function(_0x2cbfdc,_0x1c23d){if(_0x1c23d){return _0x2cbfdc;}return db['OpenchannelMessage'][_0x173d('0x59')](_['merge'](_0x104849[_0x173d('0x61')],{'read':![],'body':_0x104849[_0x173d('0x61')]['body'],'OpenchannelAccountId':_0xaacabf['id'],'OpenchannelInteractionId':_0x2cbfdc['id'],'UserId':_0x104849['user']['id'],'ContactId':_0x36b5bf['id']}))['then'](function(_0x29d97e){_0x2cbfdc[_0x173d('0xbb')][_0x173d('0xba')]=[];_0x2cbfdc[_0x173d('0xbb')][_0x173d('0xba')][_0x173d('0x9a')](_0x29d97e[_0x173d('0xbb')]);return _0x2cbfdc;});});}})[_0x173d('0x22')](respondWithResult(_0x4f59d0,null))[_0x173d('0x54')](handleError(_0x4f59d0,null));};
\ No newline at end of file
index 8c168ed..04284a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x326432,_0x35f878){var _0x4ddfaf=function(_0x2616b8){while(--_0x2616b8){_0x326432['push'](_0x326432['shift']());}};_0x4ddfaf(++_0x35f878);}(_0xb688,0xcf));var _0x8b68=function(_0x1a9fe7,_0x32d00c){_0x1a9fe7=_0x1a9fe7-0x0;var _0x194ad5=_0xb688[_0x1a9fe7];return _0x194ad5;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x8b68('0x0'))['db'][_0x8b68('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8b68('0x2')](0x0);var events={'afterCreate':_0x8b68('0x3'),'afterUpdate':_0x8b68('0x4'),'afterDestroy':_0x8b68('0x5')};function emitEvent(_0x4e281c){return function(_0x41030e,_0x27925d,_0x30f33d){OpenchannelAccountEvents[_0x8b68('0x6')](_0x4e281c+':'+_0x41030e['id'],_0x41030e);OpenchannelAccountEvents['emit'](_0x4e281c,_0x41030e);_0x30f33d(null);};}for(var e in events){if(events[_0x8b68('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8b68('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x8f9d76,_0x33dd62){var _0x551cd8=function(_0x2541fd){while(--_0x2541fd){_0x8f9d76['push'](_0x8f9d76['shift']());}};_0x551cd8(++_0x33dd62);}(_0xee5b,0x1f4));var _0xbee5=function(_0x2b5e0f,_0x4d876b){_0x2b5e0f=_0x2b5e0f-0x0;var _0x221cad=_0xee5b[_0x2b5e0f];return _0x221cad;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
index 3ba5d8d..7272a9f 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(_0x2f10f8,_0x477024){var _0xe33c7d=function(_0x1c95e4){while(--_0x1c95e4){_0x2f10f8['push'](_0x2f10f8['shift']());}};_0xe33c7d(++_0x477024);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x45af35,_0x5e8e99){var _0x51c25c=function(_0x2923c6){while(--_0x2923c6){_0x45af35['push'](_0x45af35['shift']());}};_0x51c25c(++_0x5e8e99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 bfa2e4f..00badcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa478=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util'];(function(_0x28d6b9,_0xbe9964){var _0x1e2bee=function(_0xc75f76){while(--_0xc75f76){_0x28d6b9['push'](_0x28d6b9['shift']());}};_0x1e2bee(++_0xbe9964);}(_0xa478,0x136));var _0x8a47=function(_0x285824,_0x3da647){_0x285824=_0x285824-0x0;var _0x311d7e=_0xa478[_0x285824];return _0x311d7e;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var moment=require(_0x8a47('0x2'));var BPromise=require(_0x8a47('0x3'));var rs=require(_0x8a47('0x4'));var fs=require('fs');var Redis=require(_0x8a47('0x5'));var db=require(_0x8a47('0x6'))['db'];var utils=require(_0x8a47('0x7'));var logger=require(_0x8a47('0x8'))(_0x8a47('0x9'));var config=require(_0x8a47('0xa'));var jayson=require(_0x8a47('0xb'));var client=jayson['client'][_0x8a47('0xc')]({'port':0x232a});config[_0x8a47('0xd')]=_[_0x8a47('0xe')](config[_0x8a47('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x8a47('0xf'))(new Redis(config['redis']));require(_0x8a47('0x10'))[_0x8a47('0x11')](socket);function respondWithRpcPromise(_0x3a6cc4,_0x574c96,_0xe65646){return new BPromise(function(_0x230a11,_0x493d7b){return client[_0x8a47('0x12')](_0x3a6cc4,_0xe65646)['then'](function(_0x39da50){logger[_0x8a47('0x13')](_0x8a47('0x14'),_0x574c96,'request\x20sent');logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x574c96,_0x8a47('0x15'),JSON[_0x8a47('0x16')](_0x39da50));if(_0x39da50['error']){if(_0x39da50[_0x8a47('0x17')][_0x8a47('0x18')]===0x1f4){logger[_0x8a47('0x17')](_0x8a47('0x14'),_0x574c96,_0x39da50[_0x8a47('0x17')][_0x8a47('0x19')]);return _0x493d7b(_0x39da50[_0x8a47('0x17')][_0x8a47('0x19')]);}logger[_0x8a47('0x17')](_0x8a47('0x14'),_0x574c96,_0x39da50[_0x8a47('0x17')][_0x8a47('0x19')]);return _0x230a11(_0x39da50[_0x8a47('0x17')]['message']);}else{logger[_0x8a47('0x13')](_0x8a47('0x14'),_0x574c96,_0x8a47('0x15'));_0x230a11(_0x39da50['result'][_0x8a47('0x19')]);}})['catch'](function(_0x538ed2){logger[_0x8a47('0x17')](_0x8a47('0x14'),_0x574c96,_0x538ed2);_0x493d7b(_0x538ed2);});});}
\ No newline at end of file
+var _0x9e0d=['code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x8228f7,_0xdfbb10){_0x8228f7=_0x8228f7-0x0;var _0x4de151=_0x9e0d[_0x8228f7];return _0x4de151;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9e0('0x4'));var db=require(_0xd9e0('0x5'))['db'];var utils=require(_0xd9e0('0x6'));var logger=require(_0xd9e0('0x7'))(_0xd9e0('0x8'));var config=require(_0xd9e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd9e0('0xa')]({'port':0x232a});config[_0xd9e0('0xb')]=_[_0xd9e0('0xc')](config[_0xd9e0('0xb')],{'host':_0xd9e0('0xd'),'port':0x18eb});var socket=require(_0xd9e0('0xe'))(new Redis(config['redis']));require(_0xd9e0('0xf'))[_0xd9e0('0x10')](socket);function respondWithRpcPromise(_0x57763b,_0x5bd6ad,_0x1fc11b){return new BPromise(function(_0x912d1e,_0x28f8be){return client['request'](_0x57763b,_0x1fc11b)[_0xd9e0('0x11')](function(_0x1f8eae){logger['info'](_0xd9e0('0x12'),_0x5bd6ad,_0xd9e0('0x13'));logger[_0xd9e0('0x14')](_0xd9e0('0x15'),_0x5bd6ad,_0xd9e0('0x13'),JSON['stringify'](_0x1f8eae));if(_0x1f8eae[_0xd9e0('0x16')]){if(_0x1f8eae['error'][_0xd9e0('0x17')]===0x1f4){logger['error'](_0xd9e0('0x12'),_0x5bd6ad,_0x1f8eae[_0xd9e0('0x16')][_0xd9e0('0x18')]);return _0x28f8be(_0x1f8eae[_0xd9e0('0x16')][_0xd9e0('0x18')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5bd6ad,_0x1f8eae['error'][_0xd9e0('0x18')]);return _0x912d1e(_0x1f8eae[_0xd9e0('0x16')][_0xd9e0('0x18')]);}else{logger[_0xd9e0('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x5bd6ad,_0xd9e0('0x13'));_0x912d1e(_0x1f8eae['result']['message']);}})[_0xd9e0('0x1a')](function(_0x30a342){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5bd6ad,_0x30a342);_0x28f8be(_0x30a342);});});}
\ No newline at end of file
index a0c0b54..4ba9ec0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa7c=['remove','update','emit','register','openchannelAccount:','./openchannelAccount.events'];(function(_0x1c7bcd,_0x478875){var _0x554320=function(_0x1acb8d){while(--_0x1acb8d){_0x1c7bcd['push'](_0x1c7bcd['shift']());}};_0x554320(++_0x478875);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x368240,_0x25c040){_0x368240=_0x368240-0x0;var _0x4b9448=_0xfa7c[_0x368240];return _0x4b9448;};'use strict';var OpenchannelAccountEvents=require(_0xcfa7('0x0'));var events=['save',_0xcfa7('0x1'),_0xcfa7('0x2')];function createListener(_0x252259,_0x1d6921){return function(_0x19beaf){_0x1d6921[_0xcfa7('0x3')](_0x252259,_0x19beaf);};}function removeListener(_0x45411c,_0x1f671b){return function(){OpenchannelAccountEvents['removeListener'](_0x45411c,_0x1f671b);};}exports[_0xcfa7('0x4')]=function(_0x3bf816){for(var _0x9d96a2=0x0,_0x1d5f85=events['length'];_0x9d96a2<_0x1d5f85;_0x9d96a2++){var _0x816590=events[_0x9d96a2];var _0x573432=createListener(_0xcfa7('0x5')+_0x816590,_0x3bf816);OpenchannelAccountEvents['on'](_0x816590,_0x573432);}};
\ No newline at end of file
+var _0x25b5=['removeListener','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit'];(function(_0x629a48,_0x5dbd3f){var _0x44b629=function(_0x3686b7){while(--_0x3686b7){_0x629a48['push'](_0x629a48['shift']());}};_0x44b629(++_0x5dbd3f);}(_0x25b5,0x198));var _0x525b=function(_0x30dc8e,_0x1c2592){_0x30dc8e=_0x30dc8e-0x0;var _0x599aed=_0x25b5[_0x30dc8e];return _0x599aed;};'use strict';var OpenchannelAccountEvents=require(_0x525b('0x0'));var events=[_0x525b('0x1'),_0x525b('0x2'),_0x525b('0x3')];function createListener(_0x15a957,_0x55c204){return function(_0x1086a1){_0x55c204[_0x525b('0x4')](_0x15a957,_0x1086a1);};}function removeListener(_0xae34c2,_0x17823f){return function(){OpenchannelAccountEvents[_0x525b('0x5')](_0xae34c2,_0x17823f);};}exports['register']=function(_0x5cca3f){for(var _0x982127=0x0,_0x511ef5=events['length'];_0x982127<_0x511ef5;_0x982127++){var _0x17b475=events[_0x982127];var _0x3ef6f1=createListener(_0x525b('0x6')+_0x17b475,_0x5cca3f);OpenchannelAccountEvents['on'](_0x17b475,_0x3ef6f1);}};
\ No newline at end of file
index 5a4c138..4abbb8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf99=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','index','get','/:id','isAuthenticated','show','post','put','update','exports','multer','util','path','connect-timeout','Router'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xcf99,0x151));var _0x9cf9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcf99[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x9cf9('0x0'));var util=require(_0x9cf9('0x1'));var path=require(_0x9cf9('0x2'));var timeout=require(_0x9cf9('0x3'));var express=require('express');var router=express[_0x9cf9('0x4')]();var fs_extra=require(_0x9cf9('0x5'));var auth=require(_0x9cf9('0x6'));var interaction=require(_0x9cf9('0x7'));var config=require(_0x9cf9('0x8'));var controller=require(_0x9cf9('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9cf9('0xa')]);router[_0x9cf9('0xb')](_0x9cf9('0xc'),auth[_0x9cf9('0xd')](),controller[_0x9cf9('0xe')]);router[_0x9cf9('0xf')]('/',auth[_0x9cf9('0xd')](),controller['create']);router[_0x9cf9('0x10')]('/:id',auth[_0x9cf9('0xd')](),controller[_0x9cf9('0x11')]);router['delete'](_0x9cf9('0xc'),auth[_0x9cf9('0xd')](),controller['destroy']);module[_0x9cf9('0x12')]=router;
\ No newline at end of file
+var _0xe98a=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','get','index','/:id','isAuthenticated','show','create','put','update'];(function(_0x1d393d,_0x26262){var _0x8a557d=function(_0x2637e0){while(--_0x2637e0){_0x1d393d['push'](_0x1d393d['shift']());}};_0x8a557d(++_0x26262);}(_0xe98a,0x1bb));var _0xae98=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xe98a[_0x2f6f50];return _0x2cf365;};'use strict';var multer=require(_0xae98('0x0'));var util=require(_0xae98('0x1'));var path=require(_0xae98('0x2'));var timeout=require(_0xae98('0x3'));var express=require('express');var router=express[_0xae98('0x4')]();var fs_extra=require(_0xae98('0x5'));var auth=require(_0xae98('0x6'));var interaction=require(_0xae98('0x7'));var config=require('../../config/environment');var controller=require(_0xae98('0x8'));router[_0xae98('0x9')]('/',auth['isAuthenticated'](),controller[_0xae98('0xa')]);router['get'](_0xae98('0xb'),auth[_0xae98('0xc')](),controller[_0xae98('0xd')]);router['post']('/',auth[_0xae98('0xc')](),controller[_0xae98('0xe')]);router[_0xae98('0xf')](_0xae98('0xb'),auth[_0xae98('0xc')](),controller[_0xae98('0x10')]);router[_0xae98('0x11')](_0xae98('0xb'),auth[_0xae98('0xc')](),controller[_0xae98('0x12')]);module[_0xae98('0x13')]=router;
\ No newline at end of file
index 037e2ef..29691ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cd0=['STRING','*,*,*,*','exports','INTEGER','noop'];(function(_0x372eb8,_0x549c93){var _0x3ff6c3=function(_0xec2b2e){while(--_0xec2b2e){_0x372eb8['push'](_0x372eb8['shift']());}};_0x3ff6c3(++_0x549c93);}(_0x4cd0,0xcf));var _0x04cd=function(_0x3bdf49,_0x47ddb4){_0x3bdf49=_0x3bdf49-0x0;var _0x556d46=_0x4cd0[_0x3bdf49];return _0x556d46;};'use strict';var Sequelize=require('sequelize');module[_0x04cd('0x0')]={'priority':{'type':Sequelize[_0x04cd('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x04cd('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x04cd('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x04cd('0x4')}};
\ No newline at end of file
+var _0xa2d3=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x22dc7a,_0x1565b7){var _0x11ae4e=function(_0x239ab6){while(--_0x239ab6){_0x22dc7a['push'](_0x22dc7a['shift']());}};_0x11ae4e(++_0x1565b7);}(_0xa2d3,0x1df));var _0x3a2d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa2d3[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x3a2d('0x0'));module[_0x3a2d('0x1')]={'priority':{'type':Sequelize[_0x3a2d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3a2d('0x3')],'allowNull':![],'defaultValue':_0x3a2d('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3a2d('0x3')]},'interval':{'type':Sequelize[_0x3a2d('0x3')],'defaultValue':_0x3a2d('0x5')}};
\ No newline at end of file
index c348d41..5be6c53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11cb=['to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','OpenchannelApplication','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x556ae4,_0x191132){var _0x2836be=function(_0x39f14e){while(--_0x39f14e){_0x556ae4['push'](_0x556ae4['shift']());}};_0x2836be(++_0x191132);}(_0x11cb,0x12b));var _0xb11c=function(_0x570f90,_0x568e70){_0x570f90=_0x570f90-0x0;var _0x500a5e=_0x11cb[_0x570f90];return _0x500a5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb11c('0x0'));var zipdir=require(_0xb11c('0x1'));var jsonpatch=require(_0xb11c('0x2'));var rp=require('request-promise');var moment=require(_0xb11c('0x3'));var BPromise=require(_0xb11c('0x4'));var Mustache=require(_0xb11c('0x5'));var util=require(_0xb11c('0x6'));var path=require(_0xb11c('0x7'));var sox=require(_0xb11c('0x8'));var csv=require(_0xb11c('0x9'));var ejs=require(_0xb11c('0xa'));var fs=require('fs');var fs_extra=require(_0xb11c('0xb'));var _=require('lodash');var squel=require(_0xb11c('0xc'));var crypto=require('crypto');var jsforce=require(_0xb11c('0xd'));var deskjs=require(_0xb11c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb11c('0xf'));var Papa=require(_0xb11c('0x10'));var Redis=require('ioredis');var authService=require(_0xb11c('0x11'));var qs=require(_0xb11c('0x12'));var as=require(_0xb11c('0x13'));var hardwareService=require(_0xb11c('0x14'));var logger=require(_0xb11c('0x15'))(_0xb11c('0x16'));var utils=require(_0xb11c('0x17'));var config=require(_0xb11c('0x18'));var licenseUtil=require(_0xb11c('0x19'));var db=require(_0xb11c('0x1a'))['db'];function respondWithStatusCode(_0x12b4e5,_0x258150){_0x258150=_0x258150||0xcc;return function(_0x198783){if(_0x198783){return _0x12b4e5['sendStatus'](_0x258150);}return _0x12b4e5[_0xb11c('0x1b')](_0x258150)[_0xb11c('0x1c')]();};}function respondWithResult(_0x4fdd75,_0x23a37e){_0x23a37e=_0x23a37e||0xc8;return function(_0x189eca){if(_0x189eca){return _0x4fdd75['status'](_0x23a37e)[_0xb11c('0x1d')](_0x189eca);}};}function respondWithFilteredResult(_0xc131b,_0x17ff48){return function(_0x195bbf){if(_0x195bbf){var _0x4c0089=typeof _0x17ff48['offset']===_0xb11c('0x1e')&&typeof _0x17ff48[_0xb11c('0x1f')]==='undefined';var _0x191359=_0x195bbf[_0xb11c('0x20')];var _0x26f44f=_0x4c0089?0x0:_0x17ff48[_0xb11c('0x21')];var _0xdae4a3=_0x4c0089?_0x195bbf[_0xb11c('0x20')]:_0x17ff48[_0xb11c('0x21')]+_0x17ff48[_0xb11c('0x1f')];var _0x4fba50;if(_0xdae4a3>=_0x191359){_0xdae4a3=_0x191359;_0x4fba50=0xc8;}else{_0x4fba50=0xce;}_0xc131b[_0xb11c('0x1b')](_0x4fba50);return _0xc131b[_0xb11c('0x22')](_0xb11c('0x23'),_0x26f44f+'-'+_0xdae4a3+'/'+_0x191359)[_0xb11c('0x1d')](_0x195bbf);}return null;};}function patchUpdates(_0x3bc83c){return function(_0x10a4fb){try{jsonpatch['apply'](_0x10a4fb,_0x3bc83c,!![]);}catch(_0x33f09d){return BPromise[_0xb11c('0x24')](_0x33f09d);}return _0x10a4fb[_0xb11c('0x25')]();};}function saveUpdates(_0x143927,_0x503c8a){return function(_0x507bdd){if(_0x507bdd){return _0x507bdd[_0xb11c('0x26')](_0x143927)[_0xb11c('0x27')](function(_0x54be81){return _0x54be81;});}return null;};}function removeEntity(_0x5a6a5c,_0x374e49){return function(_0x463e45){if(_0x463e45){return _0x463e45[_0xb11c('0x28')]()[_0xb11c('0x27')](function(){_0x5a6a5c[_0xb11c('0x1b')](0xcc)[_0xb11c('0x1c')]();});}};}function handleEntityNotFound(_0x10b583,_0x437ce7){return function(_0x5866a8){if(!_0x5866a8){_0x10b583[_0xb11c('0x29')](0x194);}return _0x5866a8;};}function handleError(_0x313dbd,_0x55fc32){_0x55fc32=_0x55fc32||0x1f4;return function(_0x1f60e3){logger[_0xb11c('0x2a')](_0x1f60e3[_0xb11c('0x2b')]);if(_0x1f60e3[_0xb11c('0x2c')]){delete _0x1f60e3['name'];}_0x313dbd[_0xb11c('0x1b')](_0x55fc32)[_0xb11c('0x2d')](_0x1f60e3);};}exports['index']=function(_0x2caf6a,_0x3303d6){var _0x32d3b4={},_0x47df8a={},_0x5d499e={'count':0x0,'rows':[]};var _0x1de89f=_['map'](db[_0xb11c('0x2e')][_0xb11c('0x2f')],function(_0x110aa0){return{'name':_0x110aa0['fieldName'],'type':_0x110aa0[_0xb11c('0x30')][_0xb11c('0x31')]};});_0x47df8a['model']=_['map'](_0x1de89f,_0xb11c('0x2c'));_0x47df8a['query']=_[_0xb11c('0x32')](_0x2caf6a[_0xb11c('0x33')]);_0x47df8a['filters']=_[_0xb11c('0x34')](_0x47df8a['model'],_0x47df8a[_0xb11c('0x33')]);_0x32d3b4['attributes']=_[_0xb11c('0x34')](_0x47df8a[_0xb11c('0x35')],qs[_0xb11c('0x36')](_0x2caf6a['query'][_0xb11c('0x36')]));_0x32d3b4[_0xb11c('0x37')]=_0x32d3b4[_0xb11c('0x37')][_0xb11c('0x38')]?_0x32d3b4[_0xb11c('0x37')]:_0x47df8a[_0xb11c('0x35')];if(!_0x2caf6a[_0xb11c('0x33')]['hasOwnProperty'](_0xb11c('0x39'))){_0x32d3b4[_0xb11c('0x1f')]=qs['limit'](_0x2caf6a['query'][_0xb11c('0x1f')]);_0x32d3b4[_0xb11c('0x21')]=qs[_0xb11c('0x21')](_0x2caf6a['query'][_0xb11c('0x21')]);}_0x32d3b4[_0xb11c('0x3a')]=qs['sort'](_0x2caf6a[_0xb11c('0x33')][_0xb11c('0x3b')]);_0x32d3b4[_0xb11c('0x3c')]=qs[_0xb11c('0x3d')](_[_0xb11c('0x3e')](_0x2caf6a['query'],_0x47df8a[_0xb11c('0x3d')]),_0x1de89f);if(_0x2caf6a[_0xb11c('0x33')][_0xb11c('0x3f')]){_0x32d3b4[_0xb11c('0x3c')]=_[_0xb11c('0x40')](_0x32d3b4[_0xb11c('0x3c')],{'$or':_[_0xb11c('0x41')](_0x1de89f,function(_0x559cdd){if(_0x559cdd[_0xb11c('0x30')]!=='VIRTUAL'){var _0x2f9490={};_0x2f9490[_0x559cdd[_0xb11c('0x2c')]]={'$like':'%'+_0x2caf6a[_0xb11c('0x33')][_0xb11c('0x3f')]+'%'};return _0x2f9490;}})});}_0x32d3b4=_[_0xb11c('0x40')]({},_0x32d3b4,_0x2caf6a[_0xb11c('0x42')]);var _0x31a936={'where':_0x32d3b4[_0xb11c('0x3c')]};return db[_0xb11c('0x2e')]['count'](_0x31a936)[_0xb11c('0x27')](function(_0x1211db){_0x5d499e[_0xb11c('0x20')]=_0x1211db;if(_0x2caf6a[_0xb11c('0x33')][_0xb11c('0x43')]){_0x32d3b4[_0xb11c('0x44')]=[{'all':!![]}];}return db[_0xb11c('0x2e')][_0xb11c('0x45')](_0x32d3b4);})[_0xb11c('0x27')](function(_0x15a956){_0x5d499e[_0xb11c('0x46')]=_0x15a956;return _0x5d499e;})[_0xb11c('0x27')](respondWithFilteredResult(_0x3303d6,_0x32d3b4))[_0xb11c('0x47')](handleError(_0x3303d6,null));};exports[_0xb11c('0x48')]=function(_0x4753e0,_0x18afdc){var _0x65ec2f={'raw':!![],'where':{'id':_0x4753e0[_0xb11c('0x49')]['id']}},_0x6d5c7a={};_0x6d5c7a[_0xb11c('0x35')]=_[_0xb11c('0x32')](db[_0xb11c('0x2e')][_0xb11c('0x2f')]);_0x6d5c7a[_0xb11c('0x33')]=_[_0xb11c('0x32')](_0x4753e0[_0xb11c('0x33')]);_0x6d5c7a['filters']=_[_0xb11c('0x34')](_0x6d5c7a[_0xb11c('0x35')],_0x6d5c7a[_0xb11c('0x33')]);_0x65ec2f['attributes']=_[_0xb11c('0x34')](_0x6d5c7a['model'],qs[_0xb11c('0x36')](_0x4753e0[_0xb11c('0x33')]['fields']));_0x65ec2f[_0xb11c('0x37')]=_0x65ec2f[_0xb11c('0x37')]['length']?_0x65ec2f[_0xb11c('0x37')]:_0x6d5c7a['model'];if(_0x4753e0['query']['includeAll']){_0x65ec2f[_0xb11c('0x44')]=[{'all':!![]}];}_0x65ec2f=_[_0xb11c('0x40')]({},_0x65ec2f,_0x4753e0['options']);return db[_0xb11c('0x2e')][_0xb11c('0x4a')](_0x65ec2f)[_0xb11c('0x27')](handleEntityNotFound(_0x18afdc,null))[_0xb11c('0x27')](respondWithResult(_0x18afdc,null))[_0xb11c('0x47')](handleError(_0x18afdc,null));};exports[_0xb11c('0x4b')]=function(_0x3a168f,_0x42e884){return db[_0xb11c('0x2e')]['create'](_0x3a168f[_0xb11c('0x4c')],{})[_0xb11c('0x27')](respondWithResult(_0x42e884,0xc9))[_0xb11c('0x47')](handleError(_0x42e884,null));};exports[_0xb11c('0x26')]=function(_0x150be1,_0x1ca1bd){if(_0x150be1[_0xb11c('0x4c')]['id']){delete _0x150be1[_0xb11c('0x4c')]['id'];}return db[_0xb11c('0x2e')]['find']({'where':{'id':_0x150be1[_0xb11c('0x49')]['id']}})[_0xb11c('0x27')](handleEntityNotFound(_0x1ca1bd,null))[_0xb11c('0x27')](saveUpdates(_0x150be1[_0xb11c('0x4c')],null))[_0xb11c('0x27')](respondWithResult(_0x1ca1bd,null))[_0xb11c('0x47')](handleError(_0x1ca1bd,null));};exports[_0xb11c('0x28')]=function(_0x177b00,_0x3c9e0c){return db[_0xb11c('0x2e')]['find']({'where':{'id':_0x177b00[_0xb11c('0x49')]['id']}})[_0xb11c('0x27')](handleEntityNotFound(_0x3c9e0c,null))[_0xb11c('0x27')](removeEntity(_0x3c9e0c,null))[_0xb11c('0x47')](handleError(_0x3c9e0c,null));};
\ No newline at end of file
+var _0x69c6=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','OpenchannelApplication','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','type'];(function(_0x1b21be,_0x2ccf31){var _0x29002a=function(_0x1d88d9){while(--_0x1d88d9){_0x1b21be['push'](_0x1b21be['shift']());}};_0x29002a(++_0x2ccf31);}(_0x69c6,0x1de));var _0x669c=function(_0x1bb49c,_0x510210){_0x1bb49c=_0x1bb49c-0x0;var _0x45db79=_0x69c6[_0x1bb49c];return _0x45db79;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x669c('0x0'));var jsonpatch=require(_0x669c('0x1'));var rp=require(_0x669c('0x2'));var moment=require(_0x669c('0x3'));var BPromise=require(_0x669c('0x4'));var Mustache=require(_0x669c('0x5'));var util=require(_0x669c('0x6'));var path=require(_0x669c('0x7'));var sox=require(_0x669c('0x8'));var csv=require(_0x669c('0x9'));var ejs=require(_0x669c('0xa'));var fs=require('fs');var fs_extra=require(_0x669c('0xb'));var _=require(_0x669c('0xc'));var squel=require(_0x669c('0xd'));var crypto=require('crypto');var jsforce=require(_0x669c('0xe'));var deskjs=require(_0x669c('0xf'));var toCsv=require(_0x669c('0x9'));var querystring=require(_0x669c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x669c('0x11'));var qs=require(_0x669c('0x12'));var as=require(_0x669c('0x13'));var hardwareService=require(_0x669c('0x14'));var logger=require(_0x669c('0x15'))(_0x669c('0x16'));var utils=require(_0x669c('0x17'));var config=require(_0x669c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x669c('0x19'))['db'];function respondWithStatusCode(_0x24752e,_0x510845){_0x510845=_0x510845||0xcc;return function(_0x6f2a11){if(_0x6f2a11){return _0x24752e[_0x669c('0x1a')](_0x510845);}return _0x24752e[_0x669c('0x1b')](_0x510845)[_0x669c('0x1c')]();};}function respondWithResult(_0x4b9ab8,_0x4c2983){_0x4c2983=_0x4c2983||0xc8;return function(_0x51babf){if(_0x51babf){return _0x4b9ab8[_0x669c('0x1b')](_0x4c2983)['json'](_0x51babf);}};}function respondWithFilteredResult(_0x43c6de,_0x2fbe09){return function(_0x239bc7){if(_0x239bc7){var _0x1ebe97=typeof _0x2fbe09['offset']==='undefined'&&typeof _0x2fbe09[_0x669c('0x1d')]===_0x669c('0x1e');var _0x19b4b=_0x239bc7[_0x669c('0x1f')];var _0x5c64b0=_0x1ebe97?0x0:_0x2fbe09[_0x669c('0x20')];var _0x1cf553=_0x1ebe97?_0x239bc7[_0x669c('0x1f')]:_0x2fbe09[_0x669c('0x20')]+_0x2fbe09[_0x669c('0x1d')];var _0xf2df84;if(_0x1cf553>=_0x19b4b){_0x1cf553=_0x19b4b;_0xf2df84=0xc8;}else{_0xf2df84=0xce;}_0x43c6de[_0x669c('0x1b')](_0xf2df84);return _0x43c6de[_0x669c('0x21')](_0x669c('0x22'),_0x5c64b0+'-'+_0x1cf553+'/'+_0x19b4b)[_0x669c('0x23')](_0x239bc7);}return null;};}function patchUpdates(_0x2b5902){return function(_0x263ad3){try{jsonpatch['apply'](_0x263ad3,_0x2b5902,!![]);}catch(_0x213b41){return BPromise[_0x669c('0x24')](_0x213b41);}return _0x263ad3['save']();};}function saveUpdates(_0x3b9d8c,_0x406116){return function(_0x5e5216){if(_0x5e5216){return _0x5e5216[_0x669c('0x25')](_0x3b9d8c)[_0x669c('0x26')](function(_0x248eab){return _0x248eab;});}return null;};}function removeEntity(_0x545c93,_0x140d05){return function(_0x352245){if(_0x352245){return _0x352245[_0x669c('0x27')]()[_0x669c('0x26')](function(){_0x545c93[_0x669c('0x1b')](0xcc)[_0x669c('0x1c')]();});}};}function handleEntityNotFound(_0x3882f1,_0x23aeb7){return function(_0x246110){if(!_0x246110){_0x3882f1[_0x669c('0x1a')](0x194);}return _0x246110;};}function handleError(_0xb983e5,_0x595b7e){_0x595b7e=_0x595b7e||0x1f4;return function(_0x2d7e7e){logger[_0x669c('0x28')](_0x2d7e7e[_0x669c('0x29')]);if(_0x2d7e7e[_0x669c('0x2a')]){delete _0x2d7e7e[_0x669c('0x2a')];}_0xb983e5['status'](_0x595b7e)['send'](_0x2d7e7e);};}exports[_0x669c('0x2b')]=function(_0x12c849,_0x30a409){var _0x438a49={},_0x443b84={},_0x52e387={'count':0x0,'rows':[]};var _0x2e53aa=_[_0x669c('0x2c')](db['OpenchannelApplication'][_0x669c('0x2d')],function(_0x5c0e59){return{'name':_0x5c0e59['fieldName'],'type':_0x5c0e59[_0x669c('0x2e')][_0x669c('0x2f')]};});_0x443b84[_0x669c('0x30')]=_[_0x669c('0x2c')](_0x2e53aa,'name');_0x443b84[_0x669c('0x31')]=_[_0x669c('0x32')](_0x12c849['query']);_0x443b84[_0x669c('0x33')]=_[_0x669c('0x34')](_0x443b84['model'],_0x443b84[_0x669c('0x31')]);_0x438a49[_0x669c('0x35')]=_[_0x669c('0x34')](_0x443b84[_0x669c('0x30')],qs[_0x669c('0x36')](_0x12c849[_0x669c('0x31')][_0x669c('0x36')]));_0x438a49['attributes']=_0x438a49[_0x669c('0x35')][_0x669c('0x37')]?_0x438a49['attributes']:_0x443b84[_0x669c('0x30')];if(!_0x12c849[_0x669c('0x31')][_0x669c('0x38')](_0x669c('0x39'))){_0x438a49[_0x669c('0x1d')]=qs[_0x669c('0x1d')](_0x12c849[_0x669c('0x31')][_0x669c('0x1d')]);_0x438a49[_0x669c('0x20')]=qs['offset'](_0x12c849['query'][_0x669c('0x20')]);}_0x438a49['order']=qs[_0x669c('0x3a')](_0x12c849['query']['sort']);_0x438a49[_0x669c('0x3b')]=qs[_0x669c('0x33')](_['pick'](_0x12c849[_0x669c('0x31')],_0x443b84[_0x669c('0x33')]),_0x2e53aa);if(_0x12c849['query'][_0x669c('0x3c')]){_0x438a49[_0x669c('0x3b')]=_['merge'](_0x438a49['where'],{'$or':_['map'](_0x2e53aa,function(_0x5c274e){if(_0x5c274e[_0x669c('0x2e')]!==_0x669c('0x3d')){var _0x56c2aa={};_0x56c2aa[_0x5c274e[_0x669c('0x2a')]]={'$like':'%'+_0x12c849['query']['filter']+'%'};return _0x56c2aa;}})});}_0x438a49=_[_0x669c('0x3e')]({},_0x438a49,_0x12c849['options']);var _0x3a192c={'where':_0x438a49[_0x669c('0x3b')]};return db[_0x669c('0x3f')][_0x669c('0x1f')](_0x3a192c)[_0x669c('0x26')](function(_0x2658b2){_0x52e387[_0x669c('0x1f')]=_0x2658b2;if(_0x12c849['query'][_0x669c('0x40')]){_0x438a49[_0x669c('0x41')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x669c('0x42')](_0x438a49);})[_0x669c('0x26')](function(_0x3ca633){_0x52e387[_0x669c('0x43')]=_0x3ca633;return _0x52e387;})['then'](respondWithFilteredResult(_0x30a409,_0x438a49))[_0x669c('0x44')](handleError(_0x30a409,null));};exports[_0x669c('0x45')]=function(_0x2d5b66,_0x4b911f){var _0xa850b3={'raw':!![],'where':{'id':_0x2d5b66[_0x669c('0x46')]['id']}},_0x524562={};_0x524562[_0x669c('0x30')]=_[_0x669c('0x32')](db[_0x669c('0x3f')][_0x669c('0x2d')]);_0x524562['query']=_[_0x669c('0x32')](_0x2d5b66[_0x669c('0x31')]);_0x524562[_0x669c('0x33')]=_[_0x669c('0x34')](_0x524562[_0x669c('0x30')],_0x524562[_0x669c('0x31')]);_0xa850b3[_0x669c('0x35')]=_[_0x669c('0x34')](_0x524562[_0x669c('0x30')],qs[_0x669c('0x36')](_0x2d5b66[_0x669c('0x31')][_0x669c('0x36')]));_0xa850b3[_0x669c('0x35')]=_0xa850b3[_0x669c('0x35')]['length']?_0xa850b3['attributes']:_0x524562['model'];if(_0x2d5b66['query'][_0x669c('0x40')]){_0xa850b3[_0x669c('0x41')]=[{'all':!![]}];}_0xa850b3=_[_0x669c('0x3e')]({},_0xa850b3,_0x2d5b66[_0x669c('0x47')]);return db[_0x669c('0x3f')]['find'](_0xa850b3)[_0x669c('0x26')](handleEntityNotFound(_0x4b911f,null))[_0x669c('0x26')](respondWithResult(_0x4b911f,null))[_0x669c('0x44')](handleError(_0x4b911f,null));};exports[_0x669c('0x48')]=function(_0x29ebe7,_0x45fb4d){return db[_0x669c('0x3f')][_0x669c('0x48')](_0x29ebe7[_0x669c('0x49')],{})['then'](respondWithResult(_0x45fb4d,0xc9))[_0x669c('0x44')](handleError(_0x45fb4d,null));};exports[_0x669c('0x25')]=function(_0x4c5660,_0x2db0fb){if(_0x4c5660[_0x669c('0x49')]['id']){delete _0x4c5660[_0x669c('0x49')]['id'];}return db['OpenchannelApplication'][_0x669c('0x4a')]({'where':{'id':_0x4c5660[_0x669c('0x46')]['id']}})[_0x669c('0x26')](handleEntityNotFound(_0x2db0fb,null))[_0x669c('0x26')](saveUpdates(_0x4c5660['body'],null))['then'](respondWithResult(_0x2db0fb,null))[_0x669c('0x44')](handleError(_0x2db0fb,null));};exports[_0x669c('0x27')]=function(_0x144993,_0x58cf8e){return db[_0x669c('0x3f')][_0x669c('0x4a')]({'where':{'id':_0x144993[_0x669c('0x46')]['id']}})['then'](handleEntityNotFound(_0x58cf8e,null))['then'](removeEntity(_0x58cf8e,null))[_0x669c('0x44')](handleError(_0x58cf8e,null));};
\ No newline at end of file
index 7216758..2a98569 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfb1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x30beb8,_0x44669a){var _0x3cedb2=function(_0x1e8f38){while(--_0x1e8f38){_0x30beb8['push'](_0x30beb8['shift']());}};_0x3cedb2(++_0x44669a);}(_0xdfb1,0xcc));var _0x1dfb=function(_0xdead06,_0x3fcddb){_0xdead06=_0xdead06-0x0;var _0x338677=_0xdfb1[_0xdead06];return _0x338677;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var logger=require(_0x1dfb('0x2'))(_0x1dfb('0x3'));var moment=require(_0x1dfb('0x4'));var BPromise=require(_0x1dfb('0x5'));var rp=require(_0x1dfb('0x6'));var fs=require('fs');var path=require(_0x1dfb('0x7'));var rimraf=require(_0x1dfb('0x8'));var config=require(_0x1dfb('0x9'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0xe943c5,_0x28e6ef){return _0xe943c5['define'](_0x1dfb('0xa'),attributes,{'tableName':_0x1dfb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1dfb('0xc')});};
\ No newline at end of file
+var _0x865d=['OpenchannelApplication','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports'];(function(_0x35561d,_0x59a5cf){var _0x2ccc5b=function(_0x6d37d2){while(--_0x6d37d2){_0x35561d['push'](_0x35561d['shift']());}};_0x2ccc5b(++_0x59a5cf);}(_0x865d,0x105));var _0xd865=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x865d[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xd865('0x0'));var util=require('util');var logger=require(_0xd865('0x1'))(_0xd865('0x2'));var moment=require('moment');var BPromise=require(_0xd865('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd865('0x4'));var rimraf=require(_0xd865('0x5'));var config=require(_0xd865('0x6'));var attributes=require(_0xd865('0x7'));module[_0xd865('0x8')]=function(_0x248822,_0x4175b9){return _0x248822['define'](_0xd865('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index a38ae89..f063462 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ab8=['../../config/logger','rpc','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','limit','lodash','moment','randomstring','ioredis','../../config/utils'];(function(_0x2aa850,_0x7a936d){var _0x593273=function(_0x77dfc){while(--_0x77dfc){_0x2aa850['push'](_0x2aa850['shift']());}};_0x593273(++_0x7a936d);}(_0x0ab8,0x11d));var _0x80ab=function(_0x3f6344,_0x10cbd3){_0x3f6344=_0x3f6344-0x0;var _0x26559e=_0x0ab8[_0x3f6344];return _0x26559e;};'use strict';var _=require(_0x80ab('0x0'));var util=require('util');var moment=require(_0x80ab('0x1'));var BPromise=require('bluebird');var rs=require(_0x80ab('0x2'));var fs=require('fs');var Redis=require(_0x80ab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x80ab('0x4'));var logger=require(_0x80ab('0x5'))(_0x80ab('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x80ab('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x535ca5,_0x10b8dc,_0x461031){return new BPromise(function(_0x236186,_0x2f74c1){return client[_0x80ab('0x8')](_0x535ca5,_0x461031)[_0x80ab('0x9')](function(_0x1e32cc){logger[_0x80ab('0xa')](_0x80ab('0xb'),_0x10b8dc,_0x80ab('0xc'));logger[_0x80ab('0xd')](_0x80ab('0xe'),_0x10b8dc,_0x80ab('0xc'),JSON[_0x80ab('0xf')](_0x1e32cc));if(_0x1e32cc[_0x80ab('0x10')]){if(_0x1e32cc[_0x80ab('0x10')][_0x80ab('0x11')]===0x1f4){logger[_0x80ab('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x10b8dc,_0x1e32cc[_0x80ab('0x10')][_0x80ab('0x12')]);return _0x2f74c1(_0x1e32cc[_0x80ab('0x10')]['message']);}logger[_0x80ab('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x10b8dc,_0x1e32cc[_0x80ab('0x10')]['message']);return _0x236186(_0x1e32cc[_0x80ab('0x10')][_0x80ab('0x12')]);}else{logger[_0x80ab('0xa')](_0x80ab('0xb'),_0x10b8dc,_0x80ab('0xc'));_0x236186(_0x1e32cc[_0x80ab('0x13')][_0x80ab('0x12')]);}})[_0x80ab('0x14')](function(_0x87d7fa){logger[_0x80ab('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x10b8dc,_0x87d7fa);_0x2f74c1(_0x87d7fa);});});}exports[_0x80ab('0x15')]=function(_0x9b9deb){var _0x2b59f5=this;return new Promise(function(_0x35eab2,_0x20cf76){return db[_0x80ab('0x16')][_0x80ab('0x17')](_0x9b9deb[_0x80ab('0x18')],{'raw':_0x9b9deb['options']?_0x9b9deb[_0x80ab('0x19')][_0x80ab('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9b9deb[_0x80ab('0x19')]?_0x9b9deb[_0x80ab('0x19')][_0x80ab('0x1b')]||null:null,'attributes':_0x9b9deb['options']?_0x9b9deb[_0x80ab('0x19')]['attributes']||null:null,'limit':_0x9b9deb['options']?_0x9b9deb['options'][_0x80ab('0x1c')]||null:null})[_0x80ab('0x9')](function(_0x5b4284){logger[_0x80ab('0xa')](_0x80ab('0x15'),_0x9b9deb);logger[_0x80ab('0xd')]('UpdateOpenchannelApplication',_0x9b9deb,JSON[_0x80ab('0xf')](_0x5b4284));_0x35eab2(_0x5b4284);})[_0x80ab('0x14')](function(_0x5ebef2){logger[_0x80ab('0x10')](_0x80ab('0x15'),_0x5ebef2[_0x80ab('0x12')],_0x9b9deb);_0x20cf76(_0x2b59f5[_0x80ab('0x10')](0x1f4,_0x5ebef2[_0x80ab('0x12')]));});});};
\ No newline at end of file
+var _0xe561=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','attributes','info','lodash','util','moment','bluebird','randomstring'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0xe561,0x1e8));var _0x1e56=function(_0x298e73,_0x4a537c){_0x298e73=_0x298e73-0x0;var _0x5391d8=_0xe561[_0x298e73];return _0x5391d8;};'use strict';var _=require(_0x1e56('0x0'));var util=require(_0x1e56('0x1'));var moment=require(_0x1e56('0x2'));var BPromise=require(_0x1e56('0x3'));var rs=require(_0x1e56('0x4'));var fs=require('fs');var Redis=require(_0x1e56('0x5'));var db=require(_0x1e56('0x6'))['db'];var utils=require(_0x1e56('0x7'));var logger=require(_0x1e56('0x8'))(_0x1e56('0x9'));var config=require('../../config/environment');var jayson=require(_0x1e56('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b720b,_0x15df56,_0x3e731c){return new BPromise(function(_0x38c962,_0x28b777){return client['request'](_0x1b720b,_0x3e731c)[_0x1e56('0xb')](function(_0x1abe7b){logger['info'](_0x1e56('0xc'),_0x15df56,_0x1e56('0xd'));logger[_0x1e56('0xe')](_0x1e56('0xf'),_0x15df56,'request\x20sent',JSON[_0x1e56('0x10')](_0x1abe7b));if(_0x1abe7b[_0x1e56('0x11')]){if(_0x1abe7b['error'][_0x1e56('0x12')]===0x1f4){logger[_0x1e56('0x11')](_0x1e56('0xc'),_0x15df56,_0x1abe7b[_0x1e56('0x11')][_0x1e56('0x13')]);return _0x28b777(_0x1abe7b[_0x1e56('0x11')][_0x1e56('0x13')]);}logger['error'](_0x1e56('0xc'),_0x15df56,_0x1abe7b[_0x1e56('0x11')][_0x1e56('0x13')]);return _0x38c962(_0x1abe7b[_0x1e56('0x11')][_0x1e56('0x13')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x15df56,_0x1e56('0xd'));_0x38c962(_0x1abe7b[_0x1e56('0x14')][_0x1e56('0x13')]);}})[_0x1e56('0x15')](function(_0x47382e){logger[_0x1e56('0x11')](_0x1e56('0xc'),_0x15df56,_0x47382e);_0x28b777(_0x47382e);});});}exports[_0x1e56('0x16')]=function(_0x20768e){var _0xf740fa=this;return new Promise(function(_0x41ac19,_0x5207d9){return db[_0x1e56('0x17')][_0x1e56('0x18')](_0x20768e[_0x1e56('0x19')],{'raw':_0x20768e[_0x1e56('0x1a')]?_0x20768e[_0x1e56('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20768e[_0x1e56('0x1a')]?_0x20768e[_0x1e56('0x1a')]['where']||null:null,'attributes':_0x20768e['options']?_0x20768e['options'][_0x1e56('0x1b')]||null:null,'limit':_0x20768e[_0x1e56('0x1a')]?_0x20768e[_0x1e56('0x1a')]['limit']||null:null})['then'](function(_0x3a06d1){logger[_0x1e56('0x1c')](_0x1e56('0x16'),_0x20768e);logger[_0x1e56('0xe')](_0x1e56('0x16'),_0x20768e,JSON[_0x1e56('0x10')](_0x3a06d1));_0x41ac19(_0x3a06d1);})['catch'](function(_0x1d2bd0){logger[_0x1e56('0x11')](_0x1e56('0x16'),_0x1d2bd0[_0x1e56('0x13')],_0x20768e);_0x5207d9(_0xf740fa['error'](0x1f4,_0x1d2bd0['message']));});});};
\ No newline at end of file
index 2d30b94..07fa686 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabe8=['post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download'];(function(_0x48a572,_0x212e8c){var _0xe9ede6=function(_0x3cfd49){while(--_0x3cfd49){_0x48a572['push'](_0x48a572['shift']());}};_0xe9ede6(++_0x212e8c);}(_0xabe8,0x18e));var _0x8abe=function(_0x506ff5,_0x16d10f){_0x506ff5=_0x506ff5-0x0;var _0x2bd51b=_0xabe8[_0x506ff5];return _0x2bd51b;};'use strict';var multer=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var path=require(_0x8abe('0x2'));var timeout=require(_0x8abe('0x3'));var express=require(_0x8abe('0x4'));var router=express[_0x8abe('0x5')]();var fs_extra=require(_0x8abe('0x6'));var auth=require(_0x8abe('0x7'));var interaction=require(_0x8abe('0x8'));var config=require('../../config/environment');var controller=require(_0x8abe('0x9'));router[_0x8abe('0xa')]('/',auth[_0x8abe('0xb')](),controller[_0x8abe('0xc')]);router[_0x8abe('0xa')](_0x8abe('0xd'),auth[_0x8abe('0xb')](),controller['describe']);router[_0x8abe('0xa')]('/:id',auth[_0x8abe('0xb')](),controller[_0x8abe('0xe')]);router[_0x8abe('0xa')](_0x8abe('0xf'),auth[_0x8abe('0xb')](),controller[_0x8abe('0x10')]);router[_0x8abe('0xa')](_0x8abe('0x11'),auth[_0x8abe('0xb')](),controller['download']);router[_0x8abe('0x12')]('/',auth[_0x8abe('0xb')](),controller['create']);router[_0x8abe('0x12')](_0x8abe('0xf'),auth[_0x8abe('0xb')](),controller[_0x8abe('0x13')]);router[_0x8abe('0x12')](_0x8abe('0x14'),auth[_0x8abe('0xb')](),interaction['tracked'](_0x8abe('0x15'),_0x8abe('0x16')),controller[_0x8abe('0x17')]);router[_0x8abe('0x18')]('/:id',auth[_0x8abe('0xb')](),interaction[_0x8abe('0x19')](_0x8abe('0x15'),_0x8abe('0x1a')),controller[_0x8abe('0x1b')]);router[_0x8abe('0x1c')]('/:id',auth[_0x8abe('0xb')](),interaction[_0x8abe('0x19')](_0x8abe('0x15'),_0x8abe('0x1d')),controller['destroy']);router[_0x8abe('0x1c')](_0x8abe('0x14'),auth[_0x8abe('0xb')](),controller[_0x8abe('0x1e')]);module[_0x8abe('0x1f')]=router;
\ No newline at end of file
+var _0xc5f8=['../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','update','delete','openchannelinteraction:destroy','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5b6e4c,_0x4f7cd2){var _0x229510=function(_0x2a1474){while(--_0x2a1474){_0x5b6e4c['push'](_0x5b6e4c['shift']());}};_0x229510(++_0x4f7cd2);}(_0xc5f8,0x8f));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x8c5f('0x0'));var path=require(_0x8c5f('0x1'));var timeout=require(_0x8c5f('0x2'));var express=require(_0x8c5f('0x3'));var router=express[_0x8c5f('0x4')]();var fs_extra=require(_0x8c5f('0x5'));var auth=require(_0x8c5f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8c5f('0x7'));var controller=require(_0x8c5f('0x8'));router[_0x8c5f('0x9')]('/',auth[_0x8c5f('0xa')](),controller[_0x8c5f('0xb')]);router['get'](_0x8c5f('0xc'),auth[_0x8c5f('0xa')](),controller[_0x8c5f('0xd')]);router[_0x8c5f('0x9')](_0x8c5f('0xe'),auth['isAuthenticated'](),controller[_0x8c5f('0xf')]);router['get'](_0x8c5f('0x10'),auth[_0x8c5f('0xa')](),controller[_0x8c5f('0x11')]);router[_0x8c5f('0x9')]('/:id/download',auth[_0x8c5f('0xa')](),controller['download']);router[_0x8c5f('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c5f('0x12')](_0x8c5f('0x10'),auth['isAuthenticated'](),controller[_0x8c5f('0x13')]);router[_0x8c5f('0x12')](_0x8c5f('0x14'),auth[_0x8c5f('0xa')](),interaction[_0x8c5f('0x15')](_0x8c5f('0x16'),_0x8c5f('0x17')),controller[_0x8c5f('0x18')]);router['put'](_0x8c5f('0xe'),auth['isAuthenticated'](),interaction[_0x8c5f('0x15')](_0x8c5f('0x16'),'openchannelinteraction:update'),controller[_0x8c5f('0x19')]);router[_0x8c5f('0x1a')]('/:id',auth[_0x8c5f('0xa')](),interaction['tracked']('openchannel',_0x8c5f('0x1b')),controller[_0x8c5f('0x1c')]);router['delete'](_0x8c5f('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0x8c5f('0x1d')]=router;
\ No newline at end of file
index 443a7df..4cbbb7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5089=['out','BOOLEAN','sequelize','exports','DATE','STRING','ENUM'];(function(_0x477050,_0x41eb1c){var _0x2b943a=function(_0x43be00){while(--_0x43be00){_0x477050['push'](_0x477050['shift']());}};_0x2b943a(++_0x41eb1c);}(_0x5089,0x1bb));var _0x9508=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x5089[_0x289891];return _0x31cf2e;};'use strict';var Sequelize=require(_0x9508('0x0'));module[_0x9508('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9508('0x2')]},'disposition':{'type':Sequelize[_0x9508('0x3')]},'secondDisposition':{'type':Sequelize[_0x9508('0x3')]},'thirdDisposition':{'type':Sequelize[_0x9508('0x3')]},'note':{'type':Sequelize[_0x9508('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x9508('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x9508('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x9508('0x4')]('in',_0x9508('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x9508('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x83c8=['STRING','ENUM','out','sequelize','DATE'];(function(_0x5ea0fd,_0x3c36e4){var _0x32ebf6=function(_0x4ee91d){while(--_0x4ee91d){_0x5ea0fd['push'](_0x5ea0fd['shift']());}};_0x32ebf6(++_0x3c36e4);}(_0x83c8,0x8a));var _0x883c=function(_0x2bb930,_0xe92f28){_0x2bb930=_0x2bb930-0x0;var _0x4a7d19=_0x83c8[_0x2bb930];return _0x4a7d19;};'use strict';var Sequelize=require(_0x883c('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x883c('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x883c('0x2')]},'thirdDisposition':{'type':Sequelize[_0x883c('0x2')]},'note':{'type':Sequelize[_0x883c('0x2')]},'read1stAt':{'type':Sequelize[_0x883c('0x1')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x883c('0x3')]('in',_0x883c('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 77a12bb..8254f2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7bc=['UserId','text','start','type','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','OpenchannelAccountId','sequelize','toString','keyBy','merge','Account.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','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','addMessage','omit','ids','findOne','format','OpenchannelMessage','findAll','setTags','spread','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','User','fullname','CmContact','Contact','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','YYYY-MM-DD\x20HH:mm:ss','closed','threadId','Public','basename','existsSync','pipe','createWriteStream','out','firstName','lastName','renderFile','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','localhost','./openchannelInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','send','Users','map','Tags','TagIds','split','forEach','push','then','catch','index','OpenchannelInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','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)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union'];(function(_0x7cb10c,_0x2fcc3a){var _0x11df59=function(_0x75305f){while(--_0x75305f){_0x7cb10c['push'](_0x7cb10c['shift']());}};_0x11df59(++_0x2fcc3a);}(_0xd7bc,0x7f));var _0xcd7b=function(_0x325501,_0x5242f6){_0x325501=_0x325501-0x0;var _0x2c1626=_0xd7bc[_0x325501];return _0x2c1626;};'use strict';var emlformat=require(_0xcd7b('0x0'));var rimraf=require(_0xcd7b('0x1'));var zipdir=require(_0xcd7b('0x2'));var jsonpatch=require(_0xcd7b('0x3'));var rp=require(_0xcd7b('0x4'));var moment=require(_0xcd7b('0x5'));var BPromise=require(_0xcd7b('0x6'));var Mustache=require(_0xcd7b('0x7'));var util=require(_0xcd7b('0x8'));var path=require(_0xcd7b('0x9'));var sox=require(_0xcd7b('0xa'));var csv=require(_0xcd7b('0xb'));var ejs=require(_0xcd7b('0xc'));var fs=require('fs');var fs_extra=require(_0xcd7b('0xd'));var _=require(_0xcd7b('0xe'));var squel=require('squel');var crypto=require(_0xcd7b('0xf'));var jsforce=require(_0xcd7b('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcd7b('0x11'));var Papa=require(_0xcd7b('0x12'));var Redis=require(_0xcd7b('0x13'));var authService=require(_0xcd7b('0x14'));var qs=require(_0xcd7b('0x15'));var as=require(_0xcd7b('0x16'));var pdf=require(_0xcd7b('0x17'));var hardwareService=require(_0xcd7b('0x18'));var logger=require('../../config/logger')(_0xcd7b('0x19'));var utils=require(_0xcd7b('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xcd7b('0x1b'));var db=require('../../mysqldb')['db'];config[_0xcd7b('0x1c')]=_['defaults'](config[_0xcd7b('0x1c')],{'host':_0xcd7b('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcd7b('0x1e'))[_0xcd7b('0x1f')](socket);function respondWithStatusCode(_0x508843,_0x157b04){_0x157b04=_0x157b04||0xcc;return function(_0x3c5ad0){if(_0x3c5ad0){return _0x508843[_0xcd7b('0x20')](_0x157b04);}return _0x508843[_0xcd7b('0x21')](_0x157b04)['end']();};}function respondWithResult(_0x1b697d,_0x394d6e){_0x394d6e=_0x394d6e||0xc8;return function(_0x4d31ce){if(_0x4d31ce){return _0x1b697d[_0xcd7b('0x21')](_0x394d6e)[_0xcd7b('0x22')](_0x4d31ce);}};}function respondWithFilteredResult(_0x285235,_0x285dbf){return function(_0x544b5e){if(_0x544b5e){var _0x42e891=typeof _0x285dbf[_0xcd7b('0x23')]===_0xcd7b('0x24')&&typeof _0x285dbf[_0xcd7b('0x25')]==='undefined';var _0x4cdcf5=_0x544b5e[_0xcd7b('0x26')];var _0x51bc7f=_0x42e891?0x0:_0x285dbf['offset'];var _0xc06f67=_0x42e891?_0x544b5e['count']:_0x285dbf[_0xcd7b('0x23')]+_0x285dbf[_0xcd7b('0x25')];var _0x54aeb3;if(_0xc06f67>=_0x4cdcf5){_0xc06f67=_0x4cdcf5;_0x54aeb3=0xc8;}else{_0x54aeb3=0xce;}_0x285235[_0xcd7b('0x21')](_0x54aeb3);return _0x285235[_0xcd7b('0x27')](_0xcd7b('0x28'),_0x51bc7f+'-'+_0xc06f67+'/'+_0x4cdcf5)[_0xcd7b('0x22')](_0x544b5e);}return null;};}function patchUpdates(_0x3eed2b){return function(_0x26582a){try{jsonpatch['apply'](_0x26582a,_0x3eed2b,!![]);}catch(_0x38f14d){return BPromise[_0xcd7b('0x29')](_0x38f14d);}return _0x26582a['save']();};}function saveUpdates(_0x5383eb,_0x3363a8){return function(_0x324dc4){if(_0x324dc4){return _0x324dc4[_0xcd7b('0x2a')](_0x5383eb)['then'](function(_0x450fcb){return _0x450fcb;});}return null;};}function removeEntity(_0x148507,_0x5ae1e4){return function(_0x5bbf12){if(_0x5bbf12){return _0x5bbf12['destroy']()['then'](function(){_0x148507['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e30ae,_0x449cda){return function(_0x4cee9e){if(!_0x4cee9e){_0x4e30ae[_0xcd7b('0x20')](0x194);}return _0x4cee9e;};}function handleError(_0x7ccf9c,_0x16af50){_0x16af50=_0x16af50||0x1f4;return function(_0x380acc){logger[_0xcd7b('0x2b')](_0x380acc[_0xcd7b('0x2c')]);if(_0x380acc['name']){delete _0x380acc[_0xcd7b('0x2d')];}_0x7ccf9c[_0xcd7b('0x21')](_0x16af50)[_0xcd7b('0x2e')](_0x380acc);};}function getInteractionUsers(_0x3e2e2c,_0x29926d){return new BPromise(function(_0x4beb43,_0x13b078){try{if(_0x29926d[_0x3e2e2c['id']]){_0x3e2e2c[_0xcd7b('0x2f')]=_[_0xcd7b('0x30')](_0x29926d[_0x3e2e2c['id']],function(_0x56b13b){return{'id':_0x56b13b['id'],'fullname':_0x56b13b['fullname']};});}}catch(_0x200850){_0x13b078(_0x200850);}_0x4beb43(_0x3e2e2c);});}function getInteractionTags(_0x50a9fd,_0x511b5e){return new BPromise(function(_0x327b7d,_0x1eb905){try{if(_0x50a9fd['TagIds']){_0x50a9fd[_0xcd7b('0x31')]=[];_0x50a9fd[_0xcd7b('0x32')][_0xcd7b('0x33')](',')[_0xcd7b('0x34')](function(_0x80058c){_0x50a9fd[_0xcd7b('0x31')][_0xcd7b('0x35')](_0x511b5e[_0x80058c]);});}delete _0x50a9fd[_0xcd7b('0x32')];}catch(_0x5c169a){_0x1eb905(_0x5c169a);}_0x327b7d(_0x50a9fd);});}function updateOpenchannelInteraction(_0x235402,_0x5dcbaf,_0x9bae5a){return new BPromise(function(_0x1bea8a,_0x10b5d8){return getInteractionUsers(_0x235402,_0x9bae5a)[_0xcd7b('0x36')](function(_0x45dec2){return getInteractionTags(_0x45dec2,_0x5dcbaf);})[_0xcd7b('0x36')](function(_0xa425e){_0x1bea8a(_0xa425e);})[_0xcd7b('0x37')](function(_0x284b7c){_0x10b5d8(_0x284b7c);});});}exports[_0xcd7b('0x38')]=function(_0x4e636c,_0x2447ca){var _0x502df1={},_0x43fd1b={},_0x19879d={'count':0x0,'rows':[]};var _0x1d429c=_[_0xcd7b('0x30')](db[_0xcd7b('0x39')][_0xcd7b('0x3a')],function(_0x205eeb){return{'name':_0x205eeb[_0xcd7b('0x3b')],'type':_0x205eeb['type'][_0xcd7b('0x3c')]};});_0x43fd1b[_0xcd7b('0x3d')]=_[_0xcd7b('0x30')](_0x1d429c,_0xcd7b('0x2d'));_0x43fd1b[_0xcd7b('0x3e')]=_[_0xcd7b('0x3f')](_0x4e636c[_0xcd7b('0x3e')]);_0x43fd1b[_0xcd7b('0x40')]=_['intersection'](_0x43fd1b[_0xcd7b('0x3d')],_0x43fd1b[_0xcd7b('0x3e')]);_0x502df1['attributes']=_[_0xcd7b('0x41')](_0x43fd1b['model'],qs[_0xcd7b('0x42')](_0x4e636c[_0xcd7b('0x3e')][_0xcd7b('0x42')]));_0x502df1['attributes']=_0x502df1[_0xcd7b('0x43')]['length']?_0x502df1[_0xcd7b('0x43')]:_0x43fd1b[_0xcd7b('0x3d')];if(!_0x4e636c['query'][_0xcd7b('0x44')](_0xcd7b('0x45'))){_0x502df1[_0xcd7b('0x25')]=qs['limit'](_0x4e636c[_0xcd7b('0x3e')][_0xcd7b('0x25')]);_0x502df1['offset']=qs['offset'](_0x4e636c['query'][_0xcd7b('0x23')]);}_0x502df1[_0xcd7b('0x46')]=qs[_0xcd7b('0x47')](_0x4e636c[_0xcd7b('0x3e')]['sort']);_0x502df1[_0xcd7b('0x48')]=qs[_0xcd7b('0x40')](_[_0xcd7b('0x49')](_0x4e636c[_0xcd7b('0x3e')],_0x43fd1b['filters']),_0x1d429c);var _0x2c3bde=[];var _0x2b08ca=squel[_0xcd7b('0x4a')]()[_0xcd7b('0x4b')]('id')[_0xcd7b('0x4b')](_0xcd7b('0x2d'))['field'](_0xcd7b('0x4c'))['from'](_0xcd7b('0x4d'));var _0xa13ef4=squel[_0xcd7b('0x4a')]()[_0xcd7b('0x4b')](_0xcd7b('0x4e'))[_0xcd7b('0x4b')](_0xcd7b('0x4f'))[_0xcd7b('0x4b')](_0xcd7b('0x50'))[_0xcd7b('0x51')](_0xcd7b('0x52'),'ui')['left_join'](_0xcd7b('0x53'),'u',_0xcd7b('0x54'));var _0x56994f=squel['select']()[_0xcd7b('0x51')](_0xcd7b('0x55'),'i')[_0xcd7b('0x56')](_0xcd7b('0x57'),'c',_0xcd7b('0x58'))['left_join'](_0xcd7b('0x53'),'o','o.id\x20=\x20i.UserId')[_0xcd7b('0x56')]('openchannel_accounts','a',_0xcd7b('0x59'))[_0xcd7b('0x56')]('openchannel_messages','me',_0xcd7b('0x5a'))['left_join'](_0xcd7b('0x5b'),'it',_0xcd7b('0x5c'))[_0xcd7b('0x56')](_0xcd7b('0x4d'),'t',_0xcd7b('0x5d'));var _0x5926ba=squel[_0xcd7b('0x5e')]();var _0x79472c=[];var _0x1efdad=squel['expr']();var _0x583efb;if(_0x4e636c['query'][_0xcd7b('0x5f')]){_0x583efb=as[_0xcd7b('0x60')](_0x4e636c['query'][_0xcd7b('0x5f')]);var _0x79b230=_0x583efb[_0xcd7b('0x61')];for(var _0xf5263b=0x0;_0xf5263b<_0x583efb[_0xcd7b('0x62')][_0xcd7b('0x63')];_0xf5263b++){var _0x2028a6=_0x583efb[_0xcd7b('0x62')][_0xf5263b];var _0x15ca0a='i';var _0x367ca2=_[_0xcd7b('0x64')](_0x1d429c,['name',_0x2028a6[_0xcd7b('0x4b')]]);if(!_0x367ca2){switch(_0x2028a6[_0xcd7b('0x4b')]){case _0xcd7b('0x65'):if(_0x2028a6[_0xcd7b('0x66')]==0x1){_0x56994f[_0xcd7b('0x67')]('`'+_0x2028a6['field']+'`\x20=\x200');}else{_0x56994f[_0xcd7b('0x67')]('`'+_0x2028a6[_0xcd7b('0x4b')]+_0xcd7b('0x68'));}break;case'Contact':if(_0x2028a6[_0xcd7b('0x69')]===_0xcd7b('0x6a')){if(_0x2028a6['value'][_0xcd7b('0x33')]('\x20')['length']>0x1){_0x5926ba[_0x79b230](_0xcd7b('0x6b'),qs[_0xcd7b('0x6c')](_0x2028a6['value']),null);}else{var _0x1163ff='%'+_0x2028a6[_0xcd7b('0x66')]+'%';_0x5926ba[_0x79b230](_0xcd7b('0x6d'),_0x1163ff,_0x1163ff,_0x1163ff);}}else{_0x367ca2=_['find'](_0x1d429c,[_0xcd7b('0x2d'),_0xcd7b('0x6e')]);_0x2028a6[_0xcd7b('0x4b')]=_0xcd7b('0x6e');_0x1f95ab=as[_0xcd7b('0x6f')](_0x15ca0a,_0x367ca2['type'],_0x2028a6);_0x5926ba[_0x79b230](_0x1f95ab['text'],_0x1f95ab[_0xcd7b('0x66')]['start'],_0x1f95ab['value'][_0xcd7b('0x70')]);}break;case _0xcd7b('0x71'):var _0xa4e628=_0x2028a6[_0xcd7b('0x66')][_0xcd7b('0x33')](',')[_0xcd7b('0x30')](function(_0x12cf1f){return Number(_0x12cf1f);});_0xa4e628[_0xcd7b('0x34')](function(_0x3c8d47){_0x1efdad['or'](_0xcd7b('0x72'),'%,'+_0x3c8d47+',%');});_0x79472c=_[_0xcd7b('0x73')](_0x79472c,_0xa4e628);break;case'User':if(_0x2028a6[_0xcd7b('0x69')]==='$substring'){_0x5926ba[_0x79b230]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2028a6[_0xcd7b('0x66')]+'%',null);}else{_0x367ca2=_['find'](_0x1d429c,[_0xcd7b('0x2d'),_0xcd7b('0x74')]);_0x2028a6[_0xcd7b('0x4b')]=_0xcd7b('0x74');_0x1f95ab=as[_0xcd7b('0x6f')](_0x15ca0a,_0x367ca2['type'],_0x2028a6);_0x5926ba[_0x79b230](_0x1f95ab[_0xcd7b('0x75')],_0x1f95ab['value'][_0xcd7b('0x76')],_0x1f95ab[_0xcd7b('0x66')][_0xcd7b('0x70')]);}break;case'body':_0x1f95ab=as[_0xcd7b('0x6f')]('me',null,_0x2028a6);_0x5926ba[_0x79b230](_0x1f95ab[_0xcd7b('0x75')],_0x1f95ab[_0xcd7b('0x66')][_0xcd7b('0x76')],_0x1f95ab[_0xcd7b('0x66')][_0xcd7b('0x70')]);break;}}else{var _0x1f95ab=as[_0xcd7b('0x6f')](_0x15ca0a,_0x367ca2[_0xcd7b('0x77')],_0x2028a6);_0x5926ba[_0x79b230](_0x1f95ab['text'],_0x1f95ab[_0xcd7b('0x66')]['start'],_0x1f95ab[_0xcd7b('0x66')]['end']);}}}else{var _0x56c1cb=_(_0x4e636c[_0xcd7b('0x3e')])[_0xcd7b('0x3f')]()[_0xcd7b('0x30')](function(_0x467c2d){return _[_0xcd7b('0x78')](_0x1d429c,['name',_0x467c2d])?_0x467c2d:undefined;})[_0xcd7b('0x79')]()[_0xcd7b('0x66')]();if(!_[_0xcd7b('0x7a')](_0x56c1cb)){_0x56c1cb[_0xcd7b('0x34')](function(_0x52b4c7){if(_0x52b4c7==='OpenchannelAccountId'){_0x56994f[_0xcd7b('0x48')](_0xcd7b('0x7b'),[][_0xcd7b('0x7c')](_0x4e636c['query'][_0x52b4c7]));}else if(_0x52b4c7===_0xcd7b('0x7d')){var _0x9a4a97=JSON[_0xcd7b('0x7e')](_0x4e636c[_0xcd7b('0x3e')][_0x52b4c7])[_0xcd7b('0x7f')];var _0x1aee4f=JSON[_0xcd7b('0x7e')](_0x4e636c[_0xcd7b('0x3e')][_0x52b4c7])[_0xcd7b('0x80')];_0x56994f[_0xcd7b('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x9a4a97,_0x1aee4f);}else{if(_0x4e636c[_0xcd7b('0x3e')][_0x52b4c7]===_0xcd7b('0x81')){_0x56994f[_0xcd7b('0x48')]('i.'+_0x52b4c7+_0xcd7b('0x82'));}else{_0x56994f['where']('i.'+_0x52b4c7+'\x20=\x20?',_0x4e636c['query'][_0x52b4c7]);}}});}if(_0x4e636c['query']['read']){if(_0x4e636c[_0xcd7b('0x3e')][_0xcd7b('0x83')]==0x1){_0x56994f['having']('`unreadMessages`\x20=\x200');}else{_0x56994f[_0xcd7b('0x67')]('`unreadMessages`\x20>\x200');}}if(_0x4e636c[_0xcd7b('0x3e')][_0xcd7b('0x84')]){_0x79472c=_[_0xcd7b('0x85')](_0x4e636c[_0xcd7b('0x3e')][_0xcd7b('0x84')])?_0x4e636c[_0xcd7b('0x3e')][_0xcd7b('0x84')]:new Array(_0x4e636c[_0xcd7b('0x3e')][_0xcd7b('0x84')]);_0x79472c[_0xcd7b('0x34')](function(_0x4238ad){_0x1efdad['or'](_0xcd7b('0x72'),'%,'+_0x4238ad+',%');});}if(_0x4e636c[_0xcd7b('0x3e')][_0xcd7b('0x86')]){var _0x25e87c=_0x4e636c[_0xcd7b('0x3e')][_0xcd7b('0x86')][_0xcd7b('0x87')]('\x5c','\x5c\x5c')[_0xcd7b('0x87')](/'/g,'\x27\x27');if(qs[_0xcd7b('0x88')](_0x25e87c)){_0x5926ba['or']('i.id\x20LIKE\x20?',_0x25e87c+'%');}else{_0x5926ba['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xcd7b('0x6c')](_0x25e87c))['or'](_0xcd7b('0x89'),_0x25e87c+'%')['or'](_0xcd7b('0x8a'),_0x25e87c+'%');}}}_0x56994f['where'](_0x5926ba);_0x56994f[_0xcd7b('0x8b')](_0xcd7b('0x8c'));var _0xad30c5={'type':db[_0xcd7b('0x8d')]['QueryTypes'][_0xcd7b('0x8e')],'raw':!![]};var _0xb4e9f=_0x56994f[_0xcd7b('0x8f')]();_0xb4e9f[_0xcd7b('0x4b')]('i.id');_0xb4e9f[_0xcd7b('0x4b')](_0xcd7b('0x90'),'unreadMessages');if(_0x502df1[_0xcd7b('0x46')]){_0x502df1[_0xcd7b('0x46')][_0xcd7b('0x34')](function(_0x2cd82e){var _0x180b86=_0x2cd82e[0x0]===_0xcd7b('0x91')?_0x2cd82e[0x0]:'i.'+_0x2cd82e[0x0];_0x56994f[_0xcd7b('0x46')](_0x180b86,_0x2cd82e[0x1]===_0xcd7b('0x92')?![]:!![]);});}if(!_[_0xcd7b('0x7a')](_0x79472c)){_0x56994f[_0xcd7b('0x67')](_0x1efdad);_0xb4e9f[_0xcd7b('0x48')](_0xcd7b('0x93'),_0x79472c);}BPromise[_0xcd7b('0x94')]()[_0xcd7b('0x36')](function(){if(!_0x583efb){if(_0x4e636c[_0xcd7b('0x3e')]['OpenchannelAccountId'])return;_0xb4e9f[_0xcd7b('0x48')](_0xcd7b('0x95'));_0x56994f['where'](_0xcd7b('0x95'));return;}if(_0x4e636c[_0xcd7b('0x96')][_0xcd7b('0x97')]!==_0xcd7b('0x98'))return;return _0x4e636c[_0xcd7b('0x96')][_0xcd7b('0x99')]({'attributes':['id'],'raw':!![]})[_0xcd7b('0x36')](function(_0x43d0ba){if(_[_0xcd7b('0x7a')](_0x43d0ba)){_0xb4e9f[_0xcd7b('0x48')](_0xcd7b('0x9a'));_0x56994f[_0xcd7b('0x48')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0xb4e9f[_0xcd7b('0x48')](_0xcd7b('0x7b'),_[_0xcd7b('0x30')](_0x43d0ba,'id'));_0x56994f[_0xcd7b('0x48')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xcd7b('0x30')](_0x43d0ba,'id'));}});})[_0xcd7b('0x36')](function(){if(_0x4e636c['user'][_0xcd7b('0x97')]===_0xcd7b('0x98')&&!_0x583efb&&!_0x4e636c['query'][_0xcd7b('0x9b')])return[];return db[_0xcd7b('0x9c')][_0xcd7b('0x3e')](_0xb4e9f[_0xcd7b('0x9d')](),_0xad30c5);})[_0xcd7b('0x36')](function(_0x57c0e7){_0x19879d[_0xcd7b('0x26')]=_0x57c0e7['length'];if(_0x19879d[_0xcd7b('0x26')]===0x0)return[];return db[_0xcd7b('0x9c')][_0xcd7b('0x3e')](_0x2b08ca[_0xcd7b('0x9d')](),_0xad30c5)[_0xcd7b('0x36')](function(_0x1c6d49){_0x2c3bde=_[_0xcd7b('0x9e')](_0x1c6d49,'id');_0xad30c5=_[_0xcd7b('0x9f')](_0xad30c5,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4e636c[_0xcd7b('0x3e')][_0xcd7b('0x42')]){_0x502df1[_0xcd7b('0x43')][_0xcd7b('0x34')](function(_0x470a32){_0x56994f['field']('i.'+_0x470a32);});}else{_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0x90'),_0xcd7b('0x65'));_0x56994f[_0xcd7b('0x4b')]('a.key',_0xcd7b('0xa0'));_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0xa1'),_0xcd7b('0xa2'));_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0xa3'),'contactName');_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0xa4'));_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0xa5'),'Contact.firstName');_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0xa6'),'Contact.lastName');_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0xa7'),_0xcd7b('0xa8'));_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0xa9'),_0xcd7b('0xaa'));_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0xab'),_0xcd7b('0xac'));_0x56994f[_0xcd7b('0x4b')]('c.fax',_0xcd7b('0xad'));_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0xae'),_0xcd7b('0xaf'));_0x56994f[_0xcd7b('0x4b')](_0xcd7b('0xb0'),_0xcd7b('0xb1'));_0x56994f['field'](_0xcd7b('0xb2'),_0xcd7b('0x32'));}if(_0x502df1[_0xcd7b('0x25')])_0x56994f[_0xcd7b('0x25')](_0x502df1[_0xcd7b('0x25')]);if(_0x502df1['offset'])_0x56994f[_0xcd7b('0x23')](_0x502df1[_0xcd7b('0x23')]);return db[_0xcd7b('0x9c')]['query'](_0x56994f[_0xcd7b('0x9d')](),_0xad30c5);})[_0xcd7b('0x36')](function(_0x5cebc4){if(_0x5cebc4[_0xcd7b('0x63')]>0x0)_0xa13ef4[_0xcd7b('0x48')](_0xcd7b('0xb3'),_[_0xcd7b('0x30')](_0x5cebc4,'id'));return db[_0xcd7b('0x9c')][_0xcd7b('0x3e')](_0xa13ef4[_0xcd7b('0x9d')](),_0xad30c5)[_0xcd7b('0x36')](function(_0x46751f){var _0xea3486=_['groupBy'](_0x46751f,_0xcd7b('0xb4'));var _0x2fd0e8=[];_0x5cebc4[_0xcd7b('0x34')](function(_0x3ca520){_0x2fd0e8[_0xcd7b('0x35')](updateOpenchannelInteraction(_0x3ca520,_0x2c3bde,_0xea3486));});return BPromise[_0xcd7b('0xb5')](_0x2fd0e8);});});})['then'](function(_0x5d4aa7){_0x19879d[_0xcd7b('0xb6')]=_0x5d4aa7;return _0x19879d;})['then'](respondWithFilteredResult(_0x2447ca,_0x502df1))[_0xcd7b('0x37')](handleError(_0x2447ca,null));};exports[_0xcd7b('0xb7')]=function(_0x4382ad,_0x5f0bf0){var _0x59af06={};if(_0x4382ad[_0xcd7b('0x3e')]['type']&&_0x4382ad['query'][_0xcd7b('0x77')]===_0xcd7b('0x51')){_0x59af06[_0xcd7b('0x51')]=_0x4382ad[_0xcd7b('0xb8')]['id'];}else{_0x59af06['id']=_0x4382ad[_0xcd7b('0xb8')]['id'];}var _0x2da2d1={'raw':![],'where':_0x59af06},_0x2e7a48={};_0x2e7a48[_0xcd7b('0x3d')]=_[_0xcd7b('0x3f')](db[_0xcd7b('0x39')][_0xcd7b('0x3a')]);_0x2e7a48[_0xcd7b('0x3e')]=_['keys'](_0x4382ad[_0xcd7b('0x3e')]);_0x2e7a48[_0xcd7b('0x40')]=_[_0xcd7b('0x41')](_0x2e7a48['model'],_0x2e7a48[_0xcd7b('0x3e')]);_0x2da2d1['attributes']=_['intersection'](_0x2e7a48['model'],qs[_0xcd7b('0x42')](_0x4382ad[_0xcd7b('0x3e')][_0xcd7b('0x42')]));_0x2da2d1[_0xcd7b('0x43')]=_0x2da2d1[_0xcd7b('0x43')][_0xcd7b('0x63')]?_0x2da2d1[_0xcd7b('0x43')]:_0x2e7a48[_0xcd7b('0x3d')];if(_0x4382ad['query'][_0xcd7b('0xb9')]){_0x2da2d1[_0xcd7b('0xba')]=[{'all':!![]}];}_0x2da2d1=_[_0xcd7b('0x9f')]({},_0x2da2d1,_0x4382ad[_0xcd7b('0xbb')]);return db[_0xcd7b('0x39')][_0xcd7b('0x64')](_0x2da2d1)[_0xcd7b('0x36')](handleEntityNotFound(_0x5f0bf0,null))[_0xcd7b('0x36')](respondWithResult(_0x5f0bf0,null))[_0xcd7b('0x37')](handleError(_0x5f0bf0,null));};exports[_0xcd7b('0xbc')]=function(_0x2a2c89,_0x2458fe){return db[_0xcd7b('0x39')][_0xcd7b('0xbc')](_0x2a2c89[_0xcd7b('0xbd')],{})[_0xcd7b('0x36')](respondWithResult(_0x2458fe,0xc9))[_0xcd7b('0x37')](handleError(_0x2458fe,null));};exports[_0xcd7b('0x2a')]=function(_0x394705,_0x2d05ed){if(_0x394705[_0xcd7b('0xbd')]['id']){delete _0x394705['body']['id'];}return db[_0xcd7b('0x39')][_0xcd7b('0x64')]({'where':{'id':_0x394705[_0xcd7b('0xb8')]['id']}})[_0xcd7b('0x36')](handleEntityNotFound(_0x2d05ed,null))[_0xcd7b('0x36')](saveUpdates(_0x394705[_0xcd7b('0xbd')],null))[_0xcd7b('0x36')](respondWithResult(_0x2d05ed,null))[_0xcd7b('0x37')](handleError(_0x2d05ed,null));};exports['destroy']=function(_0x1f37f9,_0x4f82bf){return db['OpenchannelInteraction'][_0xcd7b('0x64')]({'where':{'id':_0x1f37f9[_0xcd7b('0xb8')]['id']}})[_0xcd7b('0x36')](handleEntityNotFound(_0x4f82bf,null))[_0xcd7b('0x36')](removeEntity(_0x4f82bf,null))[_0xcd7b('0x37')](handleError(_0x4f82bf,null));};exports[_0xcd7b('0xbe')]=function(_0x347fdc,_0x59935e){return db[_0xcd7b('0x39')][_0xcd7b('0xbe')]()[_0xcd7b('0x36')](respondWithResult(_0x59935e,null))[_0xcd7b('0x37')](handleError(_0x59935e,null));};exports[_0xcd7b('0xbf')]=function(_0x16e8c0,_0xb3db8c,_0x27831f){return db['OpenchannelMessage'][_0xcd7b('0x64')]({'where':{'id':_0x16e8c0[_0xcd7b('0xb8')]['id']}})['then'](handleEntityNotFound(_0xb3db8c,null))['then'](function(_0x52b921){if(_0x52b921){return _0x52b921['addMessage'](_0x16e8c0[_0xcd7b('0xbd')]['ids'],_[_0xcd7b('0xc0')](_0x16e8c0[_0xcd7b('0xbd')],[_0xcd7b('0xc1'),'id'])||{});}})['then'](respondWithResult(_0xb3db8c,null))[_0xcd7b('0x37')](handleError(_0xb3db8c,null));};exports['getMessages']=function(_0x5c9921,_0x3dcbcc,_0x517c9a){var _0xf3a78f={'raw':![],'where':{}};var _0x2ef794={};var _0x5b3640={'count':0x0,'rows':[]};return db[_0xcd7b('0x39')][_0xcd7b('0xc2')]({'where':{'id':_0x5c9921[_0xcd7b('0xb8')]['id']}})['then'](handleEntityNotFound(_0x3dcbcc,null))[_0xcd7b('0x36')](function(_0x15c6af){if(_0x15c6af){_0x2ef794[_0xcd7b('0x3d')]=_['keys'](db['OpenchannelMessage'][_0xcd7b('0x3a')]);_0x2ef794['query']=_[_0xcd7b('0x3f')](_0x5c9921[_0xcd7b('0x3e')]);_0x2ef794[_0xcd7b('0x40')]=_[_0xcd7b('0x41')](_0x2ef794[_0xcd7b('0x3d')],_0x2ef794[_0xcd7b('0x3e')]);_0xf3a78f[_0xcd7b('0x43')]=_[_0xcd7b('0x41')](_0x2ef794[_0xcd7b('0x3d')],qs[_0xcd7b('0x42')](_0x5c9921[_0xcd7b('0x3e')][_0xcd7b('0x42')]));_0xf3a78f[_0xcd7b('0x43')]=_0xf3a78f['attributes']['length']?_0xf3a78f['attributes']:_0x2ef794['model'];if(!_0x5c9921[_0xcd7b('0x3e')][_0xcd7b('0x44')](_0xcd7b('0x45'))){_0xf3a78f['limit']=qs['limit'](_0x5c9921[_0xcd7b('0x3e')][_0xcd7b('0x25')]);_0xf3a78f['offset']=qs[_0xcd7b('0x23')](_0x5c9921['query'][_0xcd7b('0x23')]);}_0xf3a78f[_0xcd7b('0x46')]=qs[_0xcd7b('0x47')](_0x5c9921['query'][_0xcd7b('0x47')]);_0xf3a78f['where']=qs[_0xcd7b('0x40')](_[_0xcd7b('0x49')](_0x5c9921[_0xcd7b('0x3e')],_0x2ef794[_0xcd7b('0x40')]));_0xf3a78f[_0xcd7b('0x48')]['OpenchannelInteractionId']=_0x15c6af['id'];if(_0x5c9921[_0xcd7b('0x3e')][_0xcd7b('0x86')]){_0xf3a78f[_0xcd7b('0x48')]=_[_0xcd7b('0x9f')](_0xf3a78f['where'],{'$or':_[_0xcd7b('0x30')](_0xf3a78f[_0xcd7b('0x43')],function(_0x57f99b){var _0x3a311e={};_0x3a311e[_0x57f99b]={'$like':'%'+_0x5c9921['query'][_0xcd7b('0x86')]+'%'};return _0x3a311e;})});}if(_0x5c9921[_0xcd7b('0x3e')][_0xcd7b('0x7f')]){var _0x24307c=_0x5c9921[_0xcd7b('0x3e')]['$gte'][_0xcd7b('0x33')](',');var _0x482cd2={};_0x482cd2[_0x24307c[0x0]]={'$gte':moment(_0x24307c[0x1])[_0xcd7b('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')};_0xf3a78f[_0xcd7b('0x48')]=_[_0xcd7b('0x9f')](_0xf3a78f['where'],_0x482cd2);}_0xf3a78f=_[_0xcd7b('0x9f')]({},_0xf3a78f,_0x5c9921[_0xcd7b('0xbb')]);return db[_0xcd7b('0xc4')][_0xcd7b('0x26')]({'where':_0xf3a78f[_0xcd7b('0x48')]})[_0xcd7b('0x36')](function(_0x21facf){_0x5b3640[_0xcd7b('0x26')]=_0x21facf;if(_0x5c9921[_0xcd7b('0x3e')]['includeAll']){_0xf3a78f[_0xcd7b('0xba')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xcd7b('0xc5')](_0xf3a78f);})[_0xcd7b('0x36')](function(_0x4cf298){_0x5b3640[_0xcd7b('0xb6')]=_0x4cf298;return _0x5b3640;});}})[_0xcd7b('0x36')](respondWithFilteredResult(_0x3dcbcc,_0xf3a78f))[_0xcd7b('0x37')](handleError(_0x3dcbcc,null));};exports['addTags']=function(_0x59a6c2,_0x1adf5d,_0x2d2fa2){return db[_0xcd7b('0x39')][_0xcd7b('0x64')]({'where':{'id':_0x59a6c2[_0xcd7b('0xb8')]['id']}})[_0xcd7b('0x36')](handleEntityNotFound(_0x1adf5d,null))['then'](function(_0x2e8b3e){if(_0x2e8b3e){return _0x2e8b3e[_0xcd7b('0xc6')](_0x59a6c2[_0xcd7b('0xbd')]['ids'],_[_0xcd7b('0xc0')](_0x59a6c2['body'],['ids','id'])||{})[_0xcd7b('0xc7')](function(){return db[_0xcd7b('0x71')][_0xcd7b('0xc5')]({'attributes':['id','name',_0xcd7b('0x4c')],'where':{'id':_0x59a6c2[_0xcd7b('0xbd')][_0xcd7b('0xc1')]}});})[_0xcd7b('0x36')](function(_0x3bb5bf){socket[_0xcd7b('0xc8')](_0xcd7b('0xc9'),{'id':Number(_0x59a6c2['params']['id']),'tags':_0x3bb5bf||[]});return{'id':Number(_0x59a6c2[_0xcd7b('0xb8')]['id']),'tags':_0x3bb5bf||[]};});}})[_0xcd7b('0x36')](respondWithResult(_0x1adf5d,null))['catch'](handleError(_0x1adf5d,null));};exports[_0xcd7b('0xca')]=function(_0x282db1,_0x3028f6,_0x571922){return db[_0xcd7b('0x39')]['find']({'where':{'id':_0x282db1['params']['id']}})[_0xcd7b('0x36')](handleEntityNotFound(_0x3028f6,null))[_0xcd7b('0x36')](function(_0x5a60e0){if(_0x5a60e0){return _0x5a60e0[_0xcd7b('0xca')](_0x282db1[_0xcd7b('0x3e')][_0xcd7b('0xc1')]);}})[_0xcd7b('0x36')](respondWithStatusCode(_0x3028f6,null))['catch'](handleError(_0x3028f6,null));};exports['download']=function(_0x275815,_0x1d6e3a){var _0x310905=moment()[_0xcd7b('0xcb')]()[_0xcd7b('0x9d')]();var _0x31dd67=path[_0xcd7b('0xcc')](config[_0xcd7b('0xcd')],_0xcd7b('0xce'),_0xcd7b('0xcf'),_0xcd7b('0xd0'));var _0x559011=path[_0xcd7b('0xcc')](config[_0xcd7b('0xcd')],_0xcd7b('0xce'),_0xcd7b('0xcf'),_0xcd7b('0xd1'));var _0x481b1d=path[_0xcd7b('0xcc')](_0x31dd67,_0x310905);var _0x5099e3=util[_0xcd7b('0xc3')]('transcript-%d-%s.zip',_0x275815[_0xcd7b('0xb8')]['id'],_0x310905);var _0x6b31b8=path[_0xcd7b('0xcc')](_0x31dd67,_0x5099e3);var _0x51f417=[];_0x51f417[_0xcd7b('0x35')]({'model':db[_0xcd7b('0xd2')],'as':_0xcd7b('0xd2'),'attributes':['id',_0xcd7b('0xd3')],'raw':!![]});_0x51f417[_0xcd7b('0x35')]({'model':db[_0xcd7b('0xd4')],'as':_0xcd7b('0xd5'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x275815['query'][_0xcd7b('0xd1')]){_0x51f417[_0xcd7b('0x35')]({'model':db[_0xcd7b('0xd6')],'as':'Attachment','raw':!![]});}var _0x53636e=[{'model':db['OpenchannelMessage'],'as':_0xcd7b('0xd7'),'attributes':['id','body','createdAt',_0xcd7b('0xd8'),_0xcd7b('0xd9'),_0xcd7b('0x83')],'include':_0x51f417}];_0x53636e['push']({'model':db[_0xcd7b('0xda')],'as':_0xcd7b('0xdb'),'attributes':['id',_0xcd7b('0x2d')]});_0x53636e[_0xcd7b('0x35')]({'model':db['User'],'as':_0xcd7b('0xdc'),'attributes':['id',_0xcd7b('0xd3')]});return db[_0xcd7b('0x39')][_0xcd7b('0x64')]({'where':{'id':_0x275815[_0xcd7b('0xb8')]['id']},'include':_0x53636e})[_0xcd7b('0x36')](handleEntityNotFound(_0x1d6e3a,null))[_0xcd7b('0x36')](function(_0x25b265){if(_0x25b265){var _0x55d68d=_0x25b265[_0xcd7b('0xdd')]({'plain':!![]});fs[_0xcd7b('0xde')](_0x481b1d);var _0x298491={'channel':_0xcd7b('0xdf'),'account':_0x55d68d['Account'][_0xcd7b('0x2d')],'agent':_0x55d68d[_0xcd7b('0xdc')]?_0x55d68d['Owner'][_0xcd7b('0xd3')]:'N.A.','createdAt':moment(_0x55d68d[_0xcd7b('0x7d')])[_0xcd7b('0xc3')](_0xcd7b('0xe0'))['toString'](),'closedAt':_0x55d68d[_0xcd7b('0xe1')]?moment(_0x55d68d['closedAt'])[_0xcd7b('0xc3')](_0xcd7b('0xe0'))[_0xcd7b('0x9d')]():'','disposition':_0x55d68d['disposition'],'visibility':_0x55d68d[_0xcd7b('0xe2')]?_0xcd7b('0xe3'):'Private','messages':_(_0x55d68d[_0xcd7b('0xd7')])[_0xcd7b('0x86')]({'secret':![]})[_0xcd7b('0x30')](function(_0x12960a){if(_0x12960a[_0xcd7b('0xd6')]){var _0x348f97=path[_0xcd7b('0xcc')](_0x559011,_0x12960a[_0xcd7b('0xd6')][_0xcd7b('0xe4')]);if(fs[_0xcd7b('0xe5')](_0x348f97)){fs['createReadStream'](_0x348f97)[_0xcd7b('0xe6')](fs[_0xcd7b('0xe7')](path[_0xcd7b('0xcc')](_0x481b1d,_0x12960a[_0xcd7b('0xd6')][_0xcd7b('0xe4')])));}}return{'date':moment(_0x12960a[_0xcd7b('0x7d')])[_0xcd7b('0xc3')](_0xcd7b('0xe0'))['toString'](),'sender':_0x12960a['direction']===_0xcd7b('0xe8')?_0x12960a[_0xcd7b('0xd2')]?_0x12960a[_0xcd7b('0xd2')][_0xcd7b('0xd3')]:'System':_0x12960a[_0xcd7b('0xd5')][_0xcd7b('0xe9')]+(_0x12960a[_0xcd7b('0xd5')][_0xcd7b('0xea')]?'\x20'+_0x12960a[_0xcd7b('0xd5')][_0xcd7b('0xea')]:''),'body':_0x12960a['Attachment']?_0x12960a[_0xcd7b('0xd6')][_0xcd7b('0xe4')]:_0x12960a[_0xcd7b('0xbd')],'direction':_0x12960a['direction']===_0xcd7b('0xe8')?'A':'C','secret':_0x12960a[_0xcd7b('0xd9')],'read':_0x12960a['read'],'attachment':_0x12960a[_0xcd7b('0xd6')]};})[_0xcd7b('0x66')]()};return ejs[_0xcd7b('0xeb')](path[_0xcd7b('0xcc')](config[_0xcd7b('0xcd')],_0xcd7b('0xce'),'views',_0xcd7b('0xec')),{'interaction':_0x298491})['then'](function(_0x25ed76){var _0x57c385=path['join'](_0x481b1d,_0xcd7b('0xed')+_0x55d68d['id']+'-'+_0x310905+_0xcd7b('0xee'));var _0x5464d6={'path':_0x57c385,'channel':_0xcd7b('0xdf'),'interactionId':_0x55d68d['id']};return pdf['createPdfFromHTML'](_0x25ed76,_0x5464d6);})[_0xcd7b('0x36')](function(){return new BPromise(function(_0x2aaa15,_0x261433){zipdir(_0x481b1d,{'saveTo':_0x6b31b8},function(_0x157454,_0x3cb031){if(_0x157454)return _0x261433(_0x157454);return _0x2aaa15(_0x3cb031);});})['then'](function(){return new BPromise(function(_0xc2a5f9,_0x2b0a5e){rimraf(_0x481b1d,function(_0x124e0c){if(_0x124e0c)_0x2b0a5e(_0x124e0c);return _0xc2a5f9();});});})[_0xcd7b('0x36')](function(){return _0x1d6e3a[_0xcd7b('0xef')](_0x6b31b8,_0x5099e3,function(_0x5054d5){if(_0x5054d5){console[_0xcd7b('0xf0')](_0xcd7b('0xf1'),_0x5054d5);}else{fs[_0xcd7b('0xf2')](_0x6b31b8);}});});});}else{return _0x1d6e3a[_0xcd7b('0x20')](0xc8);}})[_0xcd7b('0x37')](handleError(_0x1d6e3a,null));};
\ No newline at end of file
+var _0x4202=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','OpenchannelInteraction','fieldName','key','model','query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','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','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','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','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','type','body','buildExpression','some','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.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','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','rows','show','params','rawAttributes','intersection','include','merge','options','create','describe','OpenchannelMessage','addMessage','ids','getMessages','findOne','OpenchannelInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','omit','findAll','color','emit','removeTags','download','unix','root','server','tmp','join','attachments','transcript-%d-%s.zip','CmContact','firstName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','threadId','Public','existsSync','createReadStream','pipe','createWriteStream','basename','System','lastName','out','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','sendStatus','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end'];(function(_0x2643d1,_0x23e69b){var _0x1e8c17=function(_0x5b9ffe){while(--_0x5b9ffe){_0x2643d1['push'](_0x2643d1['shift']());}};_0x1e8c17(++_0x23e69b);}(_0x4202,0x1c2));var _0x2420=function(_0x1bec0d,_0x338db4){_0x1bec0d=_0x1bec0d-0x0;var _0x49e3e3=_0x4202[_0x1bec0d];return _0x49e3e3;};'use strict';var emlformat=require(_0x2420('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2420('0x1'));var jsonpatch=require(_0x2420('0x2'));var rp=require(_0x2420('0x3'));var moment=require(_0x2420('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2420('0x5'));var csv=require(_0x2420('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2420('0x7'));var squel=require(_0x2420('0x8'));var crypto=require('crypto');var jsforce=require(_0x2420('0x9'));var deskjs=require(_0x2420('0xa'));var toCsv=require(_0x2420('0x6'));var querystring=require(_0x2420('0xb'));var Papa=require(_0x2420('0xc'));var Redis=require(_0x2420('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2420('0xe'));var as=require(_0x2420('0xf'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x2420('0x10'));var logger=require(_0x2420('0x11'))('api');var utils=require(_0x2420('0x12'));var config=require(_0x2420('0x13'));var licenseUtil=require(_0x2420('0x14'));var db=require(_0x2420('0x15'))['db'];config[_0x2420('0x16')]=_[_0x2420('0x17')](config[_0x2420('0x16')],{'host':_0x2420('0x18'),'port':0x18eb});var socket=require(_0x2420('0x19'))(new Redis(config[_0x2420('0x16')]));require(_0x2420('0x1a'))[_0x2420('0x1b')](socket);function respondWithStatusCode(_0x43de73,_0x5726db){_0x5726db=_0x5726db||0xcc;return function(_0x4b3a00){if(_0x4b3a00){return _0x43de73['sendStatus'](_0x5726db);}return _0x43de73[_0x2420('0x1c')](_0x5726db)[_0x2420('0x1d')]();};}function respondWithResult(_0x11bb70,_0x4d92f5){_0x4d92f5=_0x4d92f5||0xc8;return function(_0x3c6f49){if(_0x3c6f49){return _0x11bb70['status'](_0x4d92f5)[_0x2420('0x1e')](_0x3c6f49);}};}function respondWithFilteredResult(_0x924896,_0x3f7944){return function(_0x37569a){if(_0x37569a){var _0x5e245b=typeof _0x3f7944[_0x2420('0x1f')]===_0x2420('0x20')&&typeof _0x3f7944[_0x2420('0x21')]===_0x2420('0x20');var _0x2b85cb=_0x37569a[_0x2420('0x22')];var _0x1384b7=_0x5e245b?0x0:_0x3f7944[_0x2420('0x1f')];var _0x248c60=_0x5e245b?_0x37569a['count']:_0x3f7944[_0x2420('0x1f')]+_0x3f7944['limit'];var _0x3440c8;if(_0x248c60>=_0x2b85cb){_0x248c60=_0x2b85cb;_0x3440c8=0xc8;}else{_0x3440c8=0xce;}_0x924896[_0x2420('0x1c')](_0x3440c8);return _0x924896[_0x2420('0x23')](_0x2420('0x24'),_0x1384b7+'-'+_0x248c60+'/'+_0x2b85cb)[_0x2420('0x1e')](_0x37569a);}return null;};}function patchUpdates(_0x15c097){return function(_0x2688ce){try{jsonpatch[_0x2420('0x25')](_0x2688ce,_0x15c097,!![]);}catch(_0x24da39){return BPromise[_0x2420('0x26')](_0x24da39);}return _0x2688ce['save']();};}function saveUpdates(_0x37ece2,_0x21523a){return function(_0x10d553){if(_0x10d553){return _0x10d553[_0x2420('0x27')](_0x37ece2)['then'](function(_0x304d74){return _0x304d74;});}return null;};}function removeEntity(_0x453c1d,_0x42c859){return function(_0x2061de){if(_0x2061de){return _0x2061de['destroy']()[_0x2420('0x28')](function(){_0x453c1d[_0x2420('0x1c')](0xcc)[_0x2420('0x1d')]();});}};}function handleEntityNotFound(_0x59ae0d,_0x406b14){return function(_0x415c74){if(!_0x415c74){_0x59ae0d['sendStatus'](0x194);}return _0x415c74;};}function handleError(_0x117e75,_0x1dca46){_0x1dca46=_0x1dca46||0x1f4;return function(_0x104eb0){logger[_0x2420('0x29')](_0x104eb0[_0x2420('0x2a')]);if(_0x104eb0['name']){delete _0x104eb0[_0x2420('0x2b')];}_0x117e75[_0x2420('0x1c')](_0x1dca46)['send'](_0x104eb0);};}function getInteractionUsers(_0x28bfb6,_0x19f97d){return new BPromise(function(_0x521111,_0x2201f0){try{if(_0x19f97d[_0x28bfb6['id']]){_0x28bfb6[_0x2420('0x2c')]=_[_0x2420('0x2d')](_0x19f97d[_0x28bfb6['id']],function(_0x18462c){return{'id':_0x18462c['id'],'fullname':_0x18462c[_0x2420('0x2e')]};});}}catch(_0x5203cb){_0x2201f0(_0x5203cb);}_0x521111(_0x28bfb6);});}function getInteractionTags(_0x1618b8,_0x5a2e84){return new BPromise(function(_0x315605,_0x3267a8){try{if(_0x1618b8[_0x2420('0x2f')]){_0x1618b8[_0x2420('0x30')]=[];_0x1618b8[_0x2420('0x2f')][_0x2420('0x31')](',')[_0x2420('0x32')](function(_0x4b794d){_0x1618b8[_0x2420('0x30')][_0x2420('0x33')](_0x5a2e84[_0x4b794d]);});}delete _0x1618b8['TagIds'];}catch(_0x3df93c){_0x3267a8(_0x3df93c);}_0x315605(_0x1618b8);});}function updateOpenchannelInteraction(_0x3d198e,_0x3af7bd,_0x491a4d){return new BPromise(function(_0x7f9726,_0x412444){return getInteractionUsers(_0x3d198e,_0x491a4d)[_0x2420('0x28')](function(_0x2ccf68){return getInteractionTags(_0x2ccf68,_0x3af7bd);})[_0x2420('0x28')](function(_0x935a5a){_0x7f9726(_0x935a5a);})[_0x2420('0x34')](function(_0x292a45){_0x412444(_0x292a45);});});}exports['index']=function(_0x60c18a,_0x5d8481){var _0x1356cf={},_0x59b0d3={},_0x162b12={'count':0x0,'rows':[]};var _0x118a11=_[_0x2420('0x2d')](db[_0x2420('0x35')]['rawAttributes'],function(_0x3f1a8e){return{'name':_0x3f1a8e[_0x2420('0x36')],'type':_0x3f1a8e['type'][_0x2420('0x37')]};});_0x59b0d3[_0x2420('0x38')]=_['map'](_0x118a11,'name');_0x59b0d3[_0x2420('0x39')]=_[_0x2420('0x3a')](_0x60c18a[_0x2420('0x39')]);_0x59b0d3['filters']=_['intersection'](_0x59b0d3['model'],_0x59b0d3[_0x2420('0x39')]);_0x1356cf[_0x2420('0x3b')]=_['intersection'](_0x59b0d3[_0x2420('0x38')],qs[_0x2420('0x3c')](_0x60c18a[_0x2420('0x39')][_0x2420('0x3c')]));_0x1356cf[_0x2420('0x3b')]=_0x1356cf['attributes']['length']?_0x1356cf[_0x2420('0x3b')]:_0x59b0d3['model'];if(!_0x60c18a[_0x2420('0x39')][_0x2420('0x3d')](_0x2420('0x3e'))){_0x1356cf[_0x2420('0x21')]=qs[_0x2420('0x21')](_0x60c18a[_0x2420('0x39')][_0x2420('0x21')]);_0x1356cf['offset']=qs['offset'](_0x60c18a[_0x2420('0x39')][_0x2420('0x1f')]);}_0x1356cf[_0x2420('0x3f')]=qs[_0x2420('0x40')](_0x60c18a[_0x2420('0x39')][_0x2420('0x40')]);_0x1356cf['where']=qs[_0x2420('0x41')](_[_0x2420('0x42')](_0x60c18a[_0x2420('0x39')],_0x59b0d3[_0x2420('0x41')]),_0x118a11);var _0x4567e2=[];var _0x2108b4=squel[_0x2420('0x43')]()[_0x2420('0x44')]('id')[_0x2420('0x44')]('name')[_0x2420('0x44')]('color')[_0x2420('0x45')](_0x2420('0x46'));var _0x1d792a=squel[_0x2420('0x43')]()[_0x2420('0x44')](_0x2420('0x47'))[_0x2420('0x44')](_0x2420('0x48'))['field'](_0x2420('0x49'))[_0x2420('0x45')]('user_has_openchannel_interactions','ui')[_0x2420('0x4a')]('users','u',_0x2420('0x4b'));var _0x4d5c53=squel[_0x2420('0x43')]()[_0x2420('0x45')]('openchannel_interactions','i')[_0x2420('0x4a')](_0x2420('0x4c'),'c',_0x2420('0x4d'))[_0x2420('0x4a')](_0x2420('0x4e'),'o',_0x2420('0x4f'))[_0x2420('0x4a')](_0x2420('0x50'),'a',_0x2420('0x51'))[_0x2420('0x4a')](_0x2420('0x52'),'me',_0x2420('0x53'))[_0x2420('0x4a')](_0x2420('0x54'),'it',_0x2420('0x55'))[_0x2420('0x4a')](_0x2420('0x46'),'t',_0x2420('0x56'));var _0x23c5f9=squel['expr']();var _0x4beee6=[];var _0x50379a=squel[_0x2420('0x57')]();var _0x197952;if(_0x60c18a[_0x2420('0x39')][_0x2420('0x58')]){_0x197952=as['parseSearch'](_0x60c18a['query'][_0x2420('0x58')]);var _0x473229=_0x197952['sqlOperator'];for(var _0x39477e=0x0;_0x39477e<_0x197952[_0x2420('0x59')]['length'];_0x39477e++){var _0x45241e=_0x197952[_0x2420('0x59')][_0x39477e];var _0x115fe4='i';var _0x30c9d7=_[_0x2420('0x5a')](_0x118a11,['name',_0x45241e[_0x2420('0x44')]]);if(!_0x30c9d7){switch(_0x45241e['field']){case _0x2420('0x5b'):if(_0x45241e[_0x2420('0x5c')]==0x1){_0x4d5c53[_0x2420('0x5d')]('`'+_0x45241e[_0x2420('0x44')]+_0x2420('0x5e'));}else{_0x4d5c53[_0x2420('0x5d')]('`'+_0x45241e[_0x2420('0x44')]+_0x2420('0x5f'));}break;case _0x2420('0x60'):if(_0x45241e['operator']===_0x2420('0x61')){if(_0x45241e[_0x2420('0x5c')]['split']('\x20')[_0x2420('0x62')]>0x1){_0x23c5f9[_0x473229](_0x2420('0x63'),qs['getFullTextValue'](_0x45241e[_0x2420('0x5c')]),null);}else{var _0x898e07='%'+_0x45241e[_0x2420('0x5c')]+'%';_0x23c5f9[_0x473229](_0x2420('0x64'),_0x898e07,_0x898e07,_0x898e07);}}else{_0x30c9d7=_['find'](_0x118a11,[_0x2420('0x2b'),_0x2420('0x65')]);_0x45241e[_0x2420('0x44')]='ContactId';_0x257c57=as['buildExpression'](_0x115fe4,_0x30c9d7['type'],_0x45241e);_0x23c5f9[_0x473229](_0x257c57[_0x2420('0x66')],_0x257c57[_0x2420('0x5c')][_0x2420('0x67')],_0x257c57[_0x2420('0x5c')]['end']);}break;case _0x2420('0x68'):var _0x3380d8=_0x45241e[_0x2420('0x5c')]['split'](',')[_0x2420('0x2d')](function(_0x4ee736){return Number(_0x4ee736);});_0x3380d8[_0x2420('0x32')](function(_0xea9b68){_0x50379a['or'](_0x2420('0x69'),'%,'+_0xea9b68+',%');});_0x4beee6=_['union'](_0x4beee6,_0x3380d8);break;case _0x2420('0x6a'):if(_0x45241e['operator']===_0x2420('0x61')){_0x23c5f9[_0x473229](_0x2420('0x6b'),'%'+_0x45241e[_0x2420('0x5c')]+'%',null);}else{_0x30c9d7=_['find'](_0x118a11,['name',_0x2420('0x6c')]);_0x45241e[_0x2420('0x44')]='UserId';_0x257c57=as['buildExpression'](_0x115fe4,_0x30c9d7[_0x2420('0x6d')],_0x45241e);_0x23c5f9[_0x473229](_0x257c57[_0x2420('0x66')],_0x257c57[_0x2420('0x5c')][_0x2420('0x67')],_0x257c57[_0x2420('0x5c')][_0x2420('0x1d')]);}break;case _0x2420('0x6e'):_0x257c57=as[_0x2420('0x6f')]('me',null,_0x45241e);_0x23c5f9[_0x473229](_0x257c57['text'],_0x257c57[_0x2420('0x5c')][_0x2420('0x67')],_0x257c57[_0x2420('0x5c')][_0x2420('0x1d')]);break;}}else{var _0x257c57=as[_0x2420('0x6f')](_0x115fe4,_0x30c9d7['type'],_0x45241e);_0x23c5f9[_0x473229](_0x257c57['text'],_0x257c57['value']['start'],_0x257c57[_0x2420('0x5c')][_0x2420('0x1d')]);}}}else{var _0x10cf2c=_(_0x60c18a[_0x2420('0x39')])[_0x2420('0x3a')]()[_0x2420('0x2d')](function(_0x2b3353){return _[_0x2420('0x70')](_0x118a11,[_0x2420('0x2b'),_0x2b3353])?_0x2b3353:undefined;})[_0x2420('0x71')]()[_0x2420('0x5c')]();if(!_[_0x2420('0x72')](_0x10cf2c)){_0x10cf2c['forEach'](function(_0x44caed){if(_0x44caed===_0x2420('0x73')){_0x4d5c53[_0x2420('0x74')](_0x2420('0x75'),[]['concat'](_0x60c18a[_0x2420('0x39')][_0x44caed]));}else if(_0x44caed===_0x2420('0x76')){var _0x2e0f38=JSON[_0x2420('0x77')](_0x60c18a[_0x2420('0x39')][_0x44caed])['$gte'];var _0x1bed21=JSON[_0x2420('0x77')](_0x60c18a[_0x2420('0x39')][_0x44caed])[_0x2420('0x78')];_0x4d5c53['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e0f38,_0x1bed21);}else{if(_0x60c18a[_0x2420('0x39')][_0x44caed]==='null'){_0x4d5c53[_0x2420('0x74')]('i.'+_0x44caed+_0x2420('0x79'));}else{_0x4d5c53[_0x2420('0x74')]('i.'+_0x44caed+_0x2420('0x7a'),_0x60c18a[_0x2420('0x39')][_0x44caed]);}}});}if(_0x60c18a[_0x2420('0x39')][_0x2420('0x7b')]){if(_0x60c18a['query'][_0x2420('0x7b')]==0x1){_0x4d5c53['having'](_0x2420('0x7c'));}else{_0x4d5c53[_0x2420('0x5d')]('`unreadMessages`\x20>\x200');}}if(_0x60c18a[_0x2420('0x39')]['tag']){_0x4beee6=_[_0x2420('0x7d')](_0x60c18a[_0x2420('0x39')][_0x2420('0x7e')])?_0x60c18a[_0x2420('0x39')][_0x2420('0x7e')]:new Array(_0x60c18a['query'][_0x2420('0x7e')]);_0x4beee6['forEach'](function(_0x51061f){_0x50379a['or'](_0x2420('0x69'),'%,'+_0x51061f+',%');});}if(_0x60c18a[_0x2420('0x39')][_0x2420('0x7f')]){var _0x48111d=_0x60c18a[_0x2420('0x39')]['filter'][_0x2420('0x80')]('\x5c','\x5c\x5c')[_0x2420('0x80')](/'/g,'\x27\x27');if(qs[_0x2420('0x81')](_0x48111d)){_0x23c5f9['or'](_0x2420('0x82'),_0x48111d+'%');}else{_0x23c5f9['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2420('0x83')](_0x48111d))['or'](_0x2420('0x84'),_0x48111d+'%')['or'](_0x2420('0x85'),_0x48111d+'%');}}}_0x4d5c53[_0x2420('0x74')](_0x23c5f9);_0x4d5c53[_0x2420('0x86')]('i.id');var _0x55183b={'type':db['Sequelize'][_0x2420('0x87')][_0x2420('0x88')],'raw':!![]};var _0xf812a8=_0x4d5c53[_0x2420('0x89')]();_0xf812a8[_0x2420('0x44')](_0x2420('0x8a'));_0xf812a8[_0x2420('0x44')](_0x2420('0x8b'),_0x2420('0x5b'));if(_0x1356cf[_0x2420('0x3f')]){_0x1356cf[_0x2420('0x3f')]['forEach'](function(_0x1e00df){var _0x9f82bf=_0x1e00df[0x0]===_0x2420('0x8c')?_0x1e00df[0x0]:'i.'+_0x1e00df[0x0];_0x4d5c53['order'](_0x9f82bf,_0x1e00df[0x1]===_0x2420('0x8d')?![]:!![]);});}if(!_[_0x2420('0x72')](_0x4beee6)){_0x4d5c53[_0x2420('0x5d')](_0x50379a);_0xf812a8[_0x2420('0x74')](_0x2420('0x8e'),_0x4beee6);}BPromise[_0x2420('0x8f')]()['then'](function(){if(!_0x197952){if(_0x60c18a[_0x2420('0x39')][_0x2420('0x73')])return;_0xf812a8[_0x2420('0x74')](_0x2420('0x90'));_0x4d5c53[_0x2420('0x74')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x60c18a[_0x2420('0x91')][_0x2420('0x92')]!==_0x2420('0x93'))return;return _0x60c18a[_0x2420('0x91')][_0x2420('0x94')]({'attributes':['id'],'raw':!![]})[_0x2420('0x28')](function(_0x1d9170){if(_[_0x2420('0x72')](_0x1d9170)){_0xf812a8[_0x2420('0x74')](_0x2420('0x95'));_0x4d5c53['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0xf812a8[_0x2420('0x74')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x2420('0x2d')](_0x1d9170,'id'));_0x4d5c53[_0x2420('0x74')](_0x2420('0x75'),_['map'](_0x1d9170,'id'));}});})['then'](function(){if(_0x60c18a['user'][_0x2420('0x92')]===_0x2420('0x93')&&!_0x197952&&!_0x60c18a[_0x2420('0x39')][_0x2420('0x73')])return[];return db[_0x2420('0x96')][_0x2420('0x39')](_0xf812a8[_0x2420('0x97')](),_0x55183b);})['then'](function(_0x32896c){_0x162b12['count']=_0x32896c[_0x2420('0x62')];if(_0x162b12[_0x2420('0x22')]===0x0)return[];return db[_0x2420('0x96')]['query'](_0x2108b4[_0x2420('0x97')](),_0x55183b)[_0x2420('0x28')](function(_0x58cd4a){_0x4567e2=_[_0x2420('0x98')](_0x58cd4a,'id');_0x55183b=_['merge'](_0x55183b,{'model':db[_0x2420('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x60c18a[_0x2420('0x39')]['fields']){_0x1356cf['attributes'][_0x2420('0x32')](function(_0x2880cb){_0x4d5c53[_0x2420('0x44')]('i.'+_0x2880cb);});}else{_0x4d5c53[_0x2420('0x44')](_0x2420('0x8b'),_0x2420('0x5b'));_0x4d5c53[_0x2420('0x44')]('a.key',_0x2420('0x99'));_0x4d5c53[_0x2420('0x44')](_0x2420('0x9a'),_0x2420('0x9b'));_0x4d5c53[_0x2420('0x44')](_0x2420('0x9c'),_0x2420('0x8c'));_0x4d5c53[_0x2420('0x44')](_0x2420('0x9d'));_0x4d5c53[_0x2420('0x44')](_0x2420('0x9e'),_0x2420('0x9f'));_0x4d5c53['field'](_0x2420('0xa0'),_0x2420('0xa1'));_0x4d5c53[_0x2420('0x44')](_0x2420('0xa2'),_0x2420('0xa3'));_0x4d5c53[_0x2420('0x44')](_0x2420('0xa4'),'Contact.phone');_0x4d5c53[_0x2420('0x44')](_0x2420('0xa5'),_0x2420('0xa6'));_0x4d5c53['field'](_0x2420('0xa7'),'Contact.fax');_0x4d5c53[_0x2420('0x44')](_0x2420('0xa8'),_0x2420('0xa9'));_0x4d5c53['field']('o.internal','Owner.internal');_0x4d5c53[_0x2420('0x44')](_0x2420('0xaa'),'TagIds');}if(_0x1356cf[_0x2420('0x21')])_0x4d5c53['limit'](_0x1356cf[_0x2420('0x21')]);if(_0x1356cf['offset'])_0x4d5c53['offset'](_0x1356cf[_0x2420('0x1f')]);return db[_0x2420('0x96')]['query'](_0x4d5c53[_0x2420('0x97')](),_0x55183b);})[_0x2420('0x28')](function(_0x4529d6){if(_0x4529d6['length']>0x0)_0x1d792a['where'](_0x2420('0xab'),_['map'](_0x4529d6,'id'));return db[_0x2420('0x96')][_0x2420('0x39')](_0x1d792a[_0x2420('0x97')](),_0x55183b)[_0x2420('0x28')](function(_0xccd534){var _0x2c1311=_[_0x2420('0xac')](_0xccd534,'OpenchannelInteractionId');var _0x577f1f=[];_0x4529d6[_0x2420('0x32')](function(_0x3e9f60){_0x577f1f['push'](updateOpenchannelInteraction(_0x3e9f60,_0x4567e2,_0x2c1311));});return BPromise[_0x2420('0xad')](_0x577f1f);});});})[_0x2420('0x28')](function(_0xe2a89a){_0x162b12[_0x2420('0xae')]=_0xe2a89a;return _0x162b12;})[_0x2420('0x28')](respondWithFilteredResult(_0x5d8481,_0x1356cf))[_0x2420('0x34')](handleError(_0x5d8481,null));};exports[_0x2420('0xaf')]=function(_0x206d50,_0x2dca88){var _0x2a0ea1={};if(_0x206d50[_0x2420('0x39')][_0x2420('0x6d')]&&_0x206d50[_0x2420('0x39')][_0x2420('0x6d')]===_0x2420('0x45')){_0x2a0ea1[_0x2420('0x45')]=_0x206d50[_0x2420('0xb0')]['id'];}else{_0x2a0ea1['id']=_0x206d50[_0x2420('0xb0')]['id'];}var _0x2c5267={'raw':![],'where':_0x2a0ea1},_0x2188e7={};_0x2188e7[_0x2420('0x38')]=_[_0x2420('0x3a')](db['OpenchannelInteraction'][_0x2420('0xb1')]);_0x2188e7[_0x2420('0x39')]=_['keys'](_0x206d50[_0x2420('0x39')]);_0x2188e7[_0x2420('0x41')]=_[_0x2420('0xb2')](_0x2188e7['model'],_0x2188e7[_0x2420('0x39')]);_0x2c5267[_0x2420('0x3b')]=_[_0x2420('0xb2')](_0x2188e7[_0x2420('0x38')],qs[_0x2420('0x3c')](_0x206d50[_0x2420('0x39')]['fields']));_0x2c5267[_0x2420('0x3b')]=_0x2c5267['attributes']['length']?_0x2c5267[_0x2420('0x3b')]:_0x2188e7[_0x2420('0x38')];if(_0x206d50['query']['includeAll']){_0x2c5267[_0x2420('0xb3')]=[{'all':!![]}];}_0x2c5267=_[_0x2420('0xb4')]({},_0x2c5267,_0x206d50[_0x2420('0xb5')]);return db['OpenchannelInteraction'][_0x2420('0x5a')](_0x2c5267)[_0x2420('0x28')](handleEntityNotFound(_0x2dca88,null))['then'](respondWithResult(_0x2dca88,null))['catch'](handleError(_0x2dca88,null));};exports['create']=function(_0x210b8f,_0xfa674a){return db['OpenchannelInteraction'][_0x2420('0xb6')](_0x210b8f[_0x2420('0x6e')],{})[_0x2420('0x28')](respondWithResult(_0xfa674a,0xc9))[_0x2420('0x34')](handleError(_0xfa674a,null));};exports[_0x2420('0x27')]=function(_0x1d3866,_0x3e9129){if(_0x1d3866[_0x2420('0x6e')]['id']){delete _0x1d3866['body']['id'];}return db[_0x2420('0x35')][_0x2420('0x5a')]({'where':{'id':_0x1d3866[_0x2420('0xb0')]['id']}})['then'](handleEntityNotFound(_0x3e9129,null))[_0x2420('0x28')](saveUpdates(_0x1d3866[_0x2420('0x6e')],null))[_0x2420('0x28')](respondWithResult(_0x3e9129,null))[_0x2420('0x34')](handleError(_0x3e9129,null));};exports['destroy']=function(_0x4a90c1,_0x139205){return db[_0x2420('0x35')][_0x2420('0x5a')]({'where':{'id':_0x4a90c1[_0x2420('0xb0')]['id']}})[_0x2420('0x28')](handleEntityNotFound(_0x139205,null))[_0x2420('0x28')](removeEntity(_0x139205,null))[_0x2420('0x34')](handleError(_0x139205,null));};exports[_0x2420('0xb7')]=function(_0xf3c855,_0x462440){return db[_0x2420('0x35')][_0x2420('0xb7')]()[_0x2420('0x28')](respondWithResult(_0x462440,null))[_0x2420('0x34')](handleError(_0x462440,null));};exports['addMessage']=function(_0x3fa077,_0x40154b,_0x22f635){return db[_0x2420('0xb8')][_0x2420('0x5a')]({'where':{'id':_0x3fa077[_0x2420('0xb0')]['id']}})[_0x2420('0x28')](handleEntityNotFound(_0x40154b,null))[_0x2420('0x28')](function(_0x2653e3){if(_0x2653e3){return _0x2653e3[_0x2420('0xb9')](_0x3fa077[_0x2420('0x6e')][_0x2420('0xba')],_['omit'](_0x3fa077['body'],[_0x2420('0xba'),'id'])||{});}})[_0x2420('0x28')](respondWithResult(_0x40154b,null))['catch'](handleError(_0x40154b,null));};exports[_0x2420('0xbb')]=function(_0x104f78,_0x5249fb,_0x21d682){var _0x26c44d={'raw':![],'where':{}};var _0x210dd3={};var _0x5ae8a3={'count':0x0,'rows':[]};return db[_0x2420('0x35')][_0x2420('0xbc')]({'where':{'id':_0x104f78[_0x2420('0xb0')]['id']}})[_0x2420('0x28')](handleEntityNotFound(_0x5249fb,null))[_0x2420('0x28')](function(_0x4c393c){if(_0x4c393c){_0x210dd3['model']=_['keys'](db[_0x2420('0xb8')][_0x2420('0xb1')]);_0x210dd3[_0x2420('0x39')]=_[_0x2420('0x3a')](_0x104f78['query']);_0x210dd3[_0x2420('0x41')]=_['intersection'](_0x210dd3[_0x2420('0x38')],_0x210dd3[_0x2420('0x39')]);_0x26c44d['attributes']=_['intersection'](_0x210dd3[_0x2420('0x38')],qs[_0x2420('0x3c')](_0x104f78[_0x2420('0x39')][_0x2420('0x3c')]));_0x26c44d[_0x2420('0x3b')]=_0x26c44d[_0x2420('0x3b')]['length']?_0x26c44d[_0x2420('0x3b')]:_0x210dd3['model'];if(!_0x104f78['query']['hasOwnProperty']('nolimit')){_0x26c44d[_0x2420('0x21')]=qs[_0x2420('0x21')](_0x104f78[_0x2420('0x39')][_0x2420('0x21')]);_0x26c44d[_0x2420('0x1f')]=qs['offset'](_0x104f78['query'][_0x2420('0x1f')]);}_0x26c44d['order']=qs['sort'](_0x104f78['query']['sort']);_0x26c44d[_0x2420('0x74')]=qs[_0x2420('0x41')](_['pick'](_0x104f78[_0x2420('0x39')],_0x210dd3[_0x2420('0x41')]));_0x26c44d[_0x2420('0x74')][_0x2420('0xbd')]=_0x4c393c['id'];if(_0x104f78['query']['filter']){_0x26c44d[_0x2420('0x74')]=_['merge'](_0x26c44d[_0x2420('0x74')],{'$or':_[_0x2420('0x2d')](_0x26c44d[_0x2420('0x3b')],function(_0x47162a){var _0x47fb19={};_0x47fb19[_0x47162a]={'$like':'%'+_0x104f78[_0x2420('0x39')][_0x2420('0x7f')]+'%'};return _0x47fb19;})});}if(_0x104f78[_0x2420('0x39')][_0x2420('0xbe')]){var _0x136ad8=_0x104f78[_0x2420('0x39')]['$gte'][_0x2420('0x31')](',');var _0x5b410a={};_0x5b410a[_0x136ad8[0x0]]={'$gte':moment(_0x136ad8[0x1])[_0x2420('0xbf')](_0x2420('0xc0'))};_0x26c44d[_0x2420('0x74')]=_[_0x2420('0xb4')](_0x26c44d[_0x2420('0x74')],_0x5b410a);}_0x26c44d=_['merge']({},_0x26c44d,_0x104f78[_0x2420('0xb5')]);return db[_0x2420('0xb8')][_0x2420('0x22')]({'where':_0x26c44d[_0x2420('0x74')]})['then'](function(_0x145363){_0x5ae8a3[_0x2420('0x22')]=_0x145363;if(_0x104f78[_0x2420('0x39')][_0x2420('0xc1')]){_0x26c44d['include']=[{'all':!![]}];}return db[_0x2420('0xb8')]['findAll'](_0x26c44d);})[_0x2420('0x28')](function(_0x3d8190){_0x5ae8a3['rows']=_0x3d8190;return _0x5ae8a3;});}})['then'](respondWithFilteredResult(_0x5249fb,_0x26c44d))['catch'](handleError(_0x5249fb,null));};exports[_0x2420('0xc2')]=function(_0x47cb4d,_0x22940f,_0x51edb6){return db[_0x2420('0x35')][_0x2420('0x5a')]({'where':{'id':_0x47cb4d[_0x2420('0xb0')]['id']}})[_0x2420('0x28')](handleEntityNotFound(_0x22940f,null))[_0x2420('0x28')](function(_0xfd8e94){if(_0xfd8e94){return _0xfd8e94[_0x2420('0xc3')](_0x47cb4d[_0x2420('0x6e')][_0x2420('0xba')],_[_0x2420('0xc4')](_0x47cb4d[_0x2420('0x6e')],[_0x2420('0xba'),'id'])||{})['spread'](function(){return db[_0x2420('0x68')][_0x2420('0xc5')]({'attributes':['id',_0x2420('0x2b'),_0x2420('0xc6')],'where':{'id':_0x47cb4d[_0x2420('0x6e')][_0x2420('0xba')]}});})['then'](function(_0x2b7548){socket[_0x2420('0xc7')]('openchannelInteractionTags:save',{'id':Number(_0x47cb4d[_0x2420('0xb0')]['id']),'tags':_0x2b7548||[]});return{'id':Number(_0x47cb4d['params']['id']),'tags':_0x2b7548||[]};});}})[_0x2420('0x28')](respondWithResult(_0x22940f,null))[_0x2420('0x34')](handleError(_0x22940f,null));};exports[_0x2420('0xc8')]=function(_0x3d69b5,_0x440ad9,_0xdfb1c1){return db[_0x2420('0x35')][_0x2420('0x5a')]({'where':{'id':_0x3d69b5['params']['id']}})[_0x2420('0x28')](handleEntityNotFound(_0x440ad9,null))['then'](function(_0x421caa){if(_0x421caa){return _0x421caa[_0x2420('0xc8')](_0x3d69b5[_0x2420('0x39')]['ids']);}})[_0x2420('0x28')](respondWithStatusCode(_0x440ad9,null))['catch'](handleError(_0x440ad9,null));};exports[_0x2420('0xc9')]=function(_0x312c39,_0x270a78){var _0x4ebcbe=moment()[_0x2420('0xca')]()['toString']();var _0x383bce=path['join'](config[_0x2420('0xcb')],_0x2420('0xcc'),'files',_0x2420('0xcd'));var _0x45a0c4=path[_0x2420('0xce')](config[_0x2420('0xcb')],_0x2420('0xcc'),'files',_0x2420('0xcf'));var _0x53496a=path[_0x2420('0xce')](_0x383bce,_0x4ebcbe);var _0x149964=util[_0x2420('0xbf')](_0x2420('0xd0'),_0x312c39[_0x2420('0xb0')]['id'],_0x4ebcbe);var _0x193524=path[_0x2420('0xce')](_0x383bce,_0x149964);var _0x41ad42=[];_0x41ad42[_0x2420('0x33')]({'model':db['User'],'as':_0x2420('0x6a'),'attributes':['id',_0x2420('0x2e')],'raw':!![]});_0x41ad42[_0x2420('0x33')]({'model':db[_0x2420('0xd1')],'as':_0x2420('0x60'),'attributes':['id',_0x2420('0xd2'),'lastName'],'raw':!![]});if(_0x312c39['query'][_0x2420('0xcf')]){_0x41ad42[_0x2420('0x33')]({'model':db[_0x2420('0xd3')],'as':'Attachment','raw':!![]});}var _0x16c5bc=[{'model':db['OpenchannelMessage'],'as':_0x2420('0xd4'),'attributes':['id',_0x2420('0x6e'),'createdAt',_0x2420('0xd5'),_0x2420('0xd6'),_0x2420('0x7b')],'include':_0x41ad42}];_0x16c5bc[_0x2420('0x33')]({'model':db[_0x2420('0xd7')],'as':_0x2420('0xd8'),'attributes':['id',_0x2420('0x2b')]});_0x16c5bc['push']({'model':db[_0x2420('0x6a')],'as':_0x2420('0xd9'),'attributes':['id',_0x2420('0x2e')]});return db[_0x2420('0x35')][_0x2420('0x5a')]({'where':{'id':_0x312c39[_0x2420('0xb0')]['id']},'include':_0x16c5bc})['then'](handleEntityNotFound(_0x270a78,null))['then'](function(_0x4ff729){if(_0x4ff729){var _0x1c9961=_0x4ff729['get']({'plain':!![]});fs[_0x2420('0xda')](_0x53496a);var _0x5232cf={'channel':_0x2420('0xdb'),'account':_0x1c9961[_0x2420('0xd8')][_0x2420('0x2b')],'agent':_0x1c9961[_0x2420('0xd9')]?_0x1c9961[_0x2420('0xd9')]['fullname']:_0x2420('0xdc'),'createdAt':moment(_0x1c9961[_0x2420('0x76')])[_0x2420('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2420('0x97')](),'closedAt':_0x1c9961[_0x2420('0xdd')]?moment(_0x1c9961[_0x2420('0xde')])[_0x2420('0xbf')](_0x2420('0xc0'))[_0x2420('0x97')]():'','disposition':_0x1c9961[_0x2420('0xdf')],'visibility':_0x1c9961[_0x2420('0xe0')]?_0x2420('0xe1'):'Private','messages':_(_0x1c9961[_0x2420('0xd4')])['filter']({'secret':![]})[_0x2420('0x2d')](function(_0x18b125){if(_0x18b125[_0x2420('0xd3')]){var _0x4b47a9=path[_0x2420('0xce')](_0x45a0c4,_0x18b125[_0x2420('0xd3')]['basename']);if(fs[_0x2420('0xe2')](_0x4b47a9)){fs[_0x2420('0xe3')](_0x4b47a9)[_0x2420('0xe4')](fs[_0x2420('0xe5')](path['join'](_0x53496a,_0x18b125[_0x2420('0xd3')][_0x2420('0xe6')])));}}return{'date':moment(_0x18b125['createdAt'])['format'](_0x2420('0xc0'))[_0x2420('0x97')](),'sender':_0x18b125[_0x2420('0xd5')]==='out'?_0x18b125[_0x2420('0x6a')]?_0x18b125[_0x2420('0x6a')]['fullname']:_0x2420('0xe7'):_0x18b125[_0x2420('0x60')][_0x2420('0xd2')]+(_0x18b125[_0x2420('0x60')][_0x2420('0xe8')]?'\x20'+_0x18b125[_0x2420('0x60')][_0x2420('0xe8')]:''),'body':_0x18b125[_0x2420('0xd3')]?_0x18b125['Attachment'][_0x2420('0xe6')]:_0x18b125[_0x2420('0x6e')],'direction':_0x18b125[_0x2420('0xd5')]===_0x2420('0xe9')?'A':'C','secret':_0x18b125[_0x2420('0xd6')],'read':_0x18b125[_0x2420('0x7b')],'attachment':_0x18b125[_0x2420('0xd3')]};})[_0x2420('0x5c')]()};return ejs['renderFile'](path[_0x2420('0xce')](config['root'],_0x2420('0xcc'),_0x2420('0xea'),_0x2420('0xeb')),{'interaction':_0x5232cf})[_0x2420('0x28')](function(_0x43b6c8){var _0x9b6cd5=path[_0x2420('0xce')](_0x53496a,'transcript-'+_0x1c9961['id']+'-'+_0x4ebcbe+_0x2420('0xec'));var _0x2f6690={'path':_0x9b6cd5,'channel':_0x2420('0xdb'),'interactionId':_0x1c9961['id']};return pdf[_0x2420('0xed')](_0x43b6c8,_0x2f6690);})[_0x2420('0x28')](function(){return new BPromise(function(_0x3ac786,_0x4e9a2f){zipdir(_0x53496a,{'saveTo':_0x193524},function(_0x58c31b,_0x570a98){if(_0x58c31b)return _0x4e9a2f(_0x58c31b);return _0x3ac786(_0x570a98);});})[_0x2420('0x28')](function(){return new BPromise(function(_0x46c244,_0x51b9e2){rimraf(_0x53496a,function(_0x41b7c3){if(_0x41b7c3)_0x51b9e2(_0x41b7c3);return _0x46c244();});});})[_0x2420('0x28')](function(){return _0x270a78[_0x2420('0xc9')](_0x193524,_0x149964,function(_0x44a05c){if(_0x44a05c){console[_0x2420('0xee')]('err',_0x44a05c);}else{fs['unlinkSync'](_0x193524);}});});});}else{return _0x270a78[_0x2420('0xef')](0xc8);}})[_0x2420('0x34')](handleError(_0x270a78,null));};
\ No newline at end of file
index c09ed71..6967ddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x643c=['remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','update'];(function(_0x48996e,_0x48fe8a){var _0x4823bc=function(_0x2f12c8){while(--_0x2f12c8){_0x48996e['push'](_0x48996e['shift']());}};_0x4823bc(++_0x48fe8a);}(_0x643c,0x1e1));var _0xc643=function(_0x2aa66d,_0x514ebb){_0x2aa66d=_0x2aa66d-0x0;var _0xc49132=_0x643c[_0x2aa66d];return _0xc49132;};'use strict';var EventEmitter=require(_0xc643('0x0'));var OpenchannelInteraction=require(_0xc643('0x1'))['db'][_0xc643('0x2')];var OpenchannelMessage=require(_0xc643('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc643('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc643('0x4'),'afterDestroy':_0xc643('0x5')};function emitEvent(_0x56da23){return function(_0x3ad575,_0x1ea8ff,_0x542ee5){_0x3ad575[_0xc643('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4ba35d){_0x3ad575[_0xc643('0x7')](_0xc643('0x8'),_0x4ba35d[_0xc643('0x9')](function(_0x5da22c){return{'id':_0x5da22c['id']};}));return OpenchannelMessage[_0xc643('0xa')]({'where':{'OpenchannelInteractionId':_0x3ad575['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc643('0xb')](function(_0x1dd650){_0x3ad575[_0xc643('0x7')](_0xc643('0xc'),_0x1dd650[_0xc643('0xd')]);OpenchannelInteractionEvents[_0xc643('0xe')](_0x56da23+':'+_0x3ad575['id'],_0x3ad575);OpenchannelInteractionEvents['emit'](_0x56da23,_0x3ad575);_0x542ee5(null);})[_0xc643('0xf')](_0x542ee5(null));};}for(var e in events){if(events[_0xc643('0x10')](e)){var event=events[e];OpenchannelInteraction[_0xc643('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x6009=['update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners'];(function(_0x1a304d,_0x1aab00){var _0x489a70=function(_0x4d5284){while(--_0x4d5284){_0x1a304d['push'](_0x1a304d['shift']());}};_0x489a70(++_0x1aab00);}(_0x6009,0x1ac));var _0x9600=function(_0x3f0743,_0x19c784){_0x3f0743=_0x3f0743-0x0;var _0x291c35=_0x6009[_0x3f0743];return _0x291c35;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x9600('0x0'))['db'][_0x9600('0x1')];var OpenchannelMessage=require(_0x9600('0x0'))['db'][_0x9600('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9600('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9600('0x4'),'afterDestroy':_0x9600('0x5')};function emitEvent(_0x2b2c25){return function(_0x4e9ee0,_0x415fad,_0x30d054){_0x4e9ee0[_0x9600('0x6')]({'attributes':['id'],'raw':!![]})[_0x9600('0x7')](function(_0x2231dd){_0x4e9ee0['setDataValue'](_0x9600('0x8'),_0x2231dd[_0x9600('0x9')](function(_0x404fe4){return{'id':_0x404fe4['id']};}));return OpenchannelMessage[_0x9600('0xa')]({'where':{'OpenchannelInteractionId':_0x4e9ee0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9600('0x7')](function(_0x36d04c){_0x4e9ee0[_0x9600('0xb')](_0x9600('0xc'),_0x36d04c['length']);OpenchannelInteractionEvents[_0x9600('0xd')](_0x2b2c25+':'+_0x4e9ee0['id'],_0x4e9ee0);OpenchannelInteractionEvents[_0x9600('0xd')](_0x2b2c25,_0x4e9ee0);_0x30d054(null);})[_0x9600('0xe')](_0x30d054(null));};}for(var e in events){if(events[_0x9600('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x9600('0x10')](e,emitEvent(event));}}module[_0x9600('0x11')]=OpenchannelInteractionEvents;
\ No newline at end of file
index ddd81dd..1a1be58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcac=['./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed','closedAt','format','lodash','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x469438,_0x17483a){var _0x224821=function(_0x21de54){while(--_0x21de54){_0x469438['push'](_0x469438['shift']());}};_0x224821(++_0x17483a);}(_0xfcac,0x1a9));var _0xcfca=function(_0x1b7c17,_0x3db643){_0x1b7c17=_0x1b7c17-0x0;var _0x155d7b=_0xfcac[_0x1b7c17];return _0x155d7b;};'use strict';var _=require(_0xcfca('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcfca('0x1'));var moment=require(_0xcfca('0x2'));var BPromise=require(_0xcfca('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfca('0x4'));var rimraf=require(_0xcfca('0x5'));var config=require(_0xcfca('0x6'));var attributes=require(_0xcfca('0x7'));module['exports']=function(_0x52ff7e,_0x3d39e2){return _0x52ff7e[_0xcfca('0x8')](_0xcfca('0x9'),attributes,{'tableName':_0xcfca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcfca('0xb'),'collate':_0xcfca('0xc'),'hooks':{'beforeUpdate':function(_0x1d50a2,_0x25c177,_0x7eefc8){if(_0x1d50a2['changed'](_0xcfca('0xd'))){_0x1d50a2[_0xcfca('0xe')]=moment()[_0xcfca('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x7eefc8(null,_0x1d50a2);}}});};
\ No newline at end of file
+var _0x1e8f=['utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','moment','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4'];(function(_0x144db7,_0x592719){var _0x3efe6a=function(_0x4ed8da){while(--_0x4ed8da){_0x144db7['push'](_0x144db7['shift']());}};_0x3efe6a(++_0x592719);}(_0x1e8f,0x149));var _0xf1e8=function(_0x165d8e,_0x51411b){_0x165d8e=_0x165d8e-0x0;var _0x50141d=_0x1e8f[_0x165d8e];return _0x50141d;};'use strict';var _=require('lodash');var util=require(_0xf1e8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf1e8('0x1'));var BPromise=require('bluebird');var rp=require(_0xf1e8('0x2'));var fs=require('fs');var path=require(_0xf1e8('0x3'));var rimraf=require(_0xf1e8('0x4'));var config=require(_0xf1e8('0x5'));var attributes=require(_0xf1e8('0x6'));module['exports']=function(_0x425b98,_0x3108f4){return _0x425b98[_0xf1e8('0x7')](_0xf1e8('0x8'),attributes,{'tableName':_0xf1e8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf1e8('0xa'),'collate':_0xf1e8('0xb'),'hooks':{'beforeUpdate':function(_0x3e2ee5,_0x4bba19,_0x1bbdc1){if(_0x3e2ee5[_0xf1e8('0xc')](_0xf1e8('0xd'))){_0x3e2ee5[_0xf1e8('0xe')]=moment()[_0xf1e8('0xf')](_0xf1e8('0x10'));}_0x1bbdc1(null,_0x3e2ee5);}}});};
\ No newline at end of file
index 63f4c27..11dd38e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcefd=['update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','omit','ids','spread','AddTags','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction'];(function(_0x5d44ed,_0x3ff59b){var _0x124871=function(_0xc9be4c){while(--_0xc9be4c){_0x5d44ed['push'](_0x5d44ed['shift']());}};_0x124871(++_0x3ff59b);}(_0xcefd,0xc7));var _0xdcef=function(_0x3a0f3e,_0x52601f){_0x3a0f3e=_0x3a0f3e-0x0;var _0x300e5a=_0xcefd[_0x3a0f3e];return _0x300e5a;};'use strict';var _=require(_0xdcef('0x0'));var util=require(_0xdcef('0x1'));var moment=require(_0xdcef('0x2'));var BPromise=require(_0xdcef('0x3'));var rs=require(_0xdcef('0x4'));var fs=require('fs');var Redis=require(_0xdcef('0x5'));var db=require(_0xdcef('0x6'))['db'];var utils=require(_0xdcef('0x7'));var logger=require(_0xdcef('0x8'))(_0xdcef('0x9'));var config=require('../../config/environment');var jayson=require(_0xdcef('0xa'));var client=jayson[_0xdcef('0xb')]['http']({'port':0x232a});config[_0xdcef('0xc')]=_['defaults'](config[_0xdcef('0xc')],{'host':_0xdcef('0xd'),'port':0x18eb});var socket=require(_0xdcef('0xe'))(new Redis(config['redis']));require(_0xdcef('0xf'))[_0xdcef('0x10')](socket);function respondWithRpcPromise(_0x2b782d,_0x361b96,_0x5ead61){return new BPromise(function(_0x5259de,_0x38968d){return client[_0xdcef('0x11')](_0x2b782d,_0x5ead61)[_0xdcef('0x12')](function(_0x4e378b){logger['info'](_0xdcef('0x13'),_0x361b96,_0xdcef('0x14'));logger[_0xdcef('0x15')](_0xdcef('0x16'),_0x361b96,_0xdcef('0x14'),JSON[_0xdcef('0x17')](_0x4e378b));if(_0x4e378b[_0xdcef('0x18')]){if(_0x4e378b[_0xdcef('0x18')][_0xdcef('0x19')]===0x1f4){logger[_0xdcef('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x361b96,_0x4e378b[_0xdcef('0x18')][_0xdcef('0x1a')]);return _0x38968d(_0x4e378b['error'][_0xdcef('0x1a')]);}logger[_0xdcef('0x18')](_0xdcef('0x13'),_0x361b96,_0x4e378b[_0xdcef('0x18')][_0xdcef('0x1a')]);return _0x5259de(_0x4e378b[_0xdcef('0x18')][_0xdcef('0x1a')]);}else{logger[_0xdcef('0x1b')]('OpenchannelInteraction,\x20%s,\x20%s',_0x361b96,'request\x20sent');_0x5259de(_0x4e378b[_0xdcef('0x1c')][_0xdcef('0x1a')]);}})['catch'](function(_0x44ab23){logger[_0xdcef('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x361b96,_0x44ab23);_0x38968d(_0x44ab23);});});}exports[_0xdcef('0x1d')]=function(_0x4cb168){var _0x56cb77=this;return new Promise(function(_0x454dd5,_0x9a6f2e){return db[_0xdcef('0x1e')][_0xdcef('0x1f')](_0x4cb168[_0xdcef('0x20')],{'raw':_0x4cb168[_0xdcef('0x21')]?_0x4cb168[_0xdcef('0x21')][_0xdcef('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cb168[_0xdcef('0x21')]?_0x4cb168['options'][_0xdcef('0x23')]||null:null,'attributes':_0x4cb168[_0xdcef('0x21')]?_0x4cb168[_0xdcef('0x21')][_0xdcef('0x24')]||null:null,'limit':_0x4cb168[_0xdcef('0x21')]?_0x4cb168['options'][_0xdcef('0x25')]||null:null})['then'](function(_0x5299f4){logger['info']('UpdateOpenchannelInteraction',_0x4cb168);logger[_0xdcef('0x15')](_0xdcef('0x1d'),_0x4cb168,JSON[_0xdcef('0x17')](_0x5299f4));_0x454dd5(_0x5299f4);})['catch'](function(_0x10a858){logger[_0xdcef('0x18')](_0xdcef('0x1d'),_0x10a858[_0xdcef('0x1a')],_0x4cb168);_0x9a6f2e(_0x56cb77[_0xdcef('0x18')](0x1f4,_0x10a858[_0xdcef('0x1a')]));});});};exports[_0xdcef('0x26')]=function(_0x37f898){return new Promise(function(_0xe428e4,_0x3b70a4){return db[_0xdcef('0x1e')][_0xdcef('0x27')]({'where':_0x37f898[_0xdcef('0x21')]?_0x37f898[_0xdcef('0x21')][_0xdcef('0x23')]||null:null})[_0xdcef('0x12')](function(_0x14368b){if(_0x14368b){return _0x14368b[_0xdcef('0x28')](_0x37f898[_0xdcef('0x20')]['ids'],_[_0xdcef('0x29')](_0x37f898[_0xdcef('0x20')],[_0xdcef('0x2a'),'id'])||{});}})[_0xdcef('0x2b')](function(_0x3f1dbe){logger[_0xdcef('0x1b')](_0xdcef('0x2c'),_0x37f898);logger[_0xdcef('0x15')](_0xdcef('0x2c'),_0x37f898,JSON['stringify'](_0x3f1dbe));_0xe428e4(_0x3f1dbe);})[_0xdcef('0x2d')](function(_0x5c2497){logger[_0xdcef('0x18')](_0xdcef('0x2c'),_0x5c2497[_0xdcef('0x1a')],_0x37f898);_0x3b70a4(_this['error'](0x1f4,_0x5c2497['message']));});});};
\ No newline at end of file
+var _0x4426=['error','code','message','result','UpdateOpenchannelInteraction','body','options','raw','where','attributes','limit','then','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4426,0x1dc));var _0x6442=function(_0x21d47d,_0x46cab0){_0x21d47d=_0x21d47d-0x0;var _0x395148=_0x4426[_0x21d47d];return _0x395148;};'use strict';var _=require('lodash');var util=require(_0x6442('0x0'));var moment=require(_0x6442('0x1'));var BPromise=require(_0x6442('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6442('0x3'));var logger=require(_0x6442('0x4'))('rpc');var config=require(_0x6442('0x5'));var jayson=require(_0x6442('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x6442('0x7')]=_[_0x6442('0x8')](config[_0x6442('0x7')],{'host':_0x6442('0x9'),'port':0x18eb});var socket=require(_0x6442('0xa'))(new Redis(config[_0x6442('0x7')]));require(_0x6442('0xb'))[_0x6442('0xc')](socket);function respondWithRpcPromise(_0x472b93,_0x18abcc,_0x3e6a63){return new BPromise(function(_0x40b4f6,_0x207fd2){return client[_0x6442('0xd')](_0x472b93,_0x3e6a63)['then'](function(_0x5cafe2){logger[_0x6442('0xe')](_0x6442('0xf'),_0x18abcc,_0x6442('0x10'));logger[_0x6442('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x18abcc,_0x6442('0x10'),JSON['stringify'](_0x5cafe2));if(_0x5cafe2[_0x6442('0x12')]){if(_0x5cafe2[_0x6442('0x12')][_0x6442('0x13')]===0x1f4){logger[_0x6442('0x12')](_0x6442('0xf'),_0x18abcc,_0x5cafe2[_0x6442('0x12')][_0x6442('0x14')]);return _0x207fd2(_0x5cafe2[_0x6442('0x12')][_0x6442('0x14')]);}logger[_0x6442('0x12')](_0x6442('0xf'),_0x18abcc,_0x5cafe2['error'][_0x6442('0x14')]);return _0x40b4f6(_0x5cafe2[_0x6442('0x12')][_0x6442('0x14')]);}else{logger[_0x6442('0xe')](_0x6442('0xf'),_0x18abcc,'request\x20sent');_0x40b4f6(_0x5cafe2[_0x6442('0x15')][_0x6442('0x14')]);}})['catch'](function(_0x1bc17d){logger[_0x6442('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x18abcc,_0x1bc17d);_0x207fd2(_0x1bc17d);});});}exports[_0x6442('0x16')]=function(_0x1a1f7f){var _0x4b042f=this;return new Promise(function(_0x5a971e,_0x44f3a2){return db['OpenchannelInteraction']['update'](_0x1a1f7f[_0x6442('0x17')],{'raw':_0x1a1f7f[_0x6442('0x18')]?_0x1a1f7f['options'][_0x6442('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a1f7f['options']?_0x1a1f7f[_0x6442('0x18')][_0x6442('0x1a')]||null:null,'attributes':_0x1a1f7f[_0x6442('0x18')]?_0x1a1f7f[_0x6442('0x18')][_0x6442('0x1b')]||null:null,'limit':_0x1a1f7f[_0x6442('0x18')]?_0x1a1f7f[_0x6442('0x18')][_0x6442('0x1c')]||null:null})[_0x6442('0x1d')](function(_0x573e2c){logger['info']('UpdateOpenchannelInteraction',_0x1a1f7f);logger[_0x6442('0x11')](_0x6442('0x16'),_0x1a1f7f,JSON[_0x6442('0x1e')](_0x573e2c));_0x5a971e(_0x573e2c);})['catch'](function(_0x3c7813){logger['error'](_0x6442('0x16'),_0x3c7813['message'],_0x1a1f7f);_0x44f3a2(_0x4b042f[_0x6442('0x12')](0x1f4,_0x3c7813['message']));});});};exports[_0x6442('0x1f')]=function(_0x539e37){return new Promise(function(_0x22d875,_0x312668){return db[_0x6442('0x20')]['find']({'where':_0x539e37['options']?_0x539e37[_0x6442('0x18')][_0x6442('0x1a')]||null:null})[_0x6442('0x1d')](function(_0x72743c){if(_0x72743c){return _0x72743c[_0x6442('0x21')](_0x539e37[_0x6442('0x17')][_0x6442('0x22')],_[_0x6442('0x23')](_0x539e37['body'],[_0x6442('0x22'),'id'])||{});}})[_0x6442('0x24')](function(_0x19991b){logger[_0x6442('0xe')]('AddTags',_0x539e37);logger[_0x6442('0x11')]('AddTags',_0x539e37,JSON['stringify'](_0x19991b));_0x22d875(_0x19991b);})['catch'](function(_0x5e70d0){logger[_0x6442('0x12')](_0x6442('0x25'),_0x5e70d0[_0x6442('0x14')],_0x539e37);_0x312668(_this[_0x6442('0x12')](0x1f4,_0x5e70d0[_0x6442('0x14')]));});});};
\ No newline at end of file
index 436ed6c..e0aedd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ee8=['remove','update','removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x19a9a5,_0x2bf8b2){var _0x5306fe=function(_0x20f9e1){while(--_0x20f9e1){_0x19a9a5['push'](_0x19a9a5['shift']());}};_0x5306fe(++_0x2bf8b2);}(_0x5ee8,0xde));var _0x85ee=function(_0x2f1a42,_0x1061e5){_0x2f1a42=_0x2f1a42-0x0;var _0x11cfdc=_0x5ee8[_0x2f1a42];return _0x11cfdc;};'use strict';var OpenchannelInteractionEvents=require(_0x85ee('0x0'));var events=[_0x85ee('0x1'),_0x85ee('0x2'),_0x85ee('0x3')];function createListener(_0x26e0f0,_0xe214b1){return function(_0x14c045){_0xe214b1['emit'](_0x26e0f0,_0x14c045);};}function removeListener(_0x43bfa3,_0x3714f4){return function(){OpenchannelInteractionEvents[_0x85ee('0x4')](_0x43bfa3,_0x3714f4);};}exports[_0x85ee('0x5')]=function(_0x5d9b2d){for(var _0x4145a7=0x0,_0x439917=events['length'];_0x4145a7<_0x439917;_0x4145a7++){var _0x527747=events[_0x4145a7];var _0x292ebe=createListener(_0x85ee('0x6')+_0x527747,_0x5d9b2d);OpenchannelInteractionEvents['on'](_0x527747,_0x292ebe);}};
\ No newline at end of file
+var _0xc4a4=['length','./openchannelInteraction.events','save','update','emit','removeListener','register'];(function(_0x36f82a,_0x4ec395){var _0x495067=function(_0x2ede56){while(--_0x2ede56){_0x36f82a['push'](_0x36f82a['shift']());}};_0x495067(++_0x4ec395);}(_0xc4a4,0x158));var _0x4c4a=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xc4a4[_0x4e9628];return _0x27bc8c;};'use strict';var OpenchannelInteractionEvents=require(_0x4c4a('0x0'));var events=[_0x4c4a('0x1'),'remove',_0x4c4a('0x2')];function createListener(_0x398888,_0x4b9cfe){return function(_0x5c3f72){_0x4b9cfe[_0x4c4a('0x3')](_0x398888,_0x5c3f72);};}function removeListener(_0x2b8d9f,_0x1cbab3){return function(){OpenchannelInteractionEvents[_0x4c4a('0x4')](_0x2b8d9f,_0x1cbab3);};}exports[_0x4c4a('0x5')]=function(_0x40eeac){for(var _0x1cb31d=0x0,_0xaf4b6a=events[_0x4c4a('0x6')];_0x1cb31d<_0xaf4b6a;_0x1cb31d++){var _0x4447bd=events[_0x1cb31d];var _0x49b0fd=createListener('openchannelInteraction:'+_0x4447bd,_0x40eeac);OpenchannelInteractionEvents['on'](_0x4447bd,_0x49b0fd);}};
\ No newline at end of file
index 368ebe9..2c3fcc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x59fc7f,_0x33a2ba){var _0x25535a=function(_0xd11ba0){while(--_0xd11ba0){_0x59fc7f['push'](_0x59fc7f['shift']());}};_0x25535a(++_0x33a2ba);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x348c0f,_0x196872){var _0x462ede=function(_0x22bfde){while(--_0x22bfde){_0x348c0f['push'](_0x348c0f['shift']());}};_0x462ede(++_0x196872);}(_0x9c44,0x178));var _0x49c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c44[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router;
\ No newline at end of file
index 7775366..d8a9080 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa321=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x40e64d,_0x2758f9){var _0x333948=function(_0xbb8c81){while(--_0xbb8c81){_0x40e64d['push'](_0x40e64d['shift']());}};_0x333948(++_0x2758f9);}(_0xa321,0x9d));var _0x1a32=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0xa321[_0x28fbbf];return _0x543af6;};'use strict';var Sequelize=require(_0x1a32('0x0'));module[_0x1a32('0x1')]={'body':{'type':Sequelize[_0x1a32('0x2')](_0x1a32('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x1a32('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1a32('0x5')]('in','out'),'defaultValue':_0x1a32('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1a32('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x37e9=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37e9,0x1e7));var _0x937e=function(_0x58cdfd,_0x5dc3eb){_0x58cdfd=_0x58cdfd-0x0;var _0x150d8c=_0x37e9[_0x58cdfd];return _0x150d8c;};'use strict';var Sequelize=require(_0x937e('0x0'));module[_0x937e('0x1')]={'body':{'type':Sequelize[_0x937e('0x2')](_0x937e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x937e('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x937e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x937e('0x5')]('in','out'),'defaultValue':_0x937e('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x937e('0x7')]},'providerName':{'type':Sequelize[_0x937e('0x8')]},'providerResponse':{'type':Sequelize[_0x937e('0x2')]}};
\ No newline at end of file
index a9edfcc..8a69adf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x149e=['UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','update','isNil','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','channel','motionChannel','event','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','ContactId','SIP/%s','EventManager','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','name','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','rows','show','params','find','create','body','describe','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x149e,0x9b));var _0xe149=function(_0x18391a,_0x2075cc){_0x18391a=_0x18391a-0x0;var _0x1c5ca6=_0x149e[_0x18391a];return _0x1c5ca6;};'use strict';var emlformat=require(_0xe149('0x0'));var rimraf=require(_0xe149('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe149('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe149('0x3'));var Mustache=require('mustache');var util=require(_0xe149('0x4'));var path=require(_0xe149('0x5'));var sox=require(_0xe149('0x6'));var csv=require(_0xe149('0x7'));var ejs=require(_0xe149('0x8'));var fs=require('fs');var fs_extra=require(_0xe149('0x9'));var _=require('lodash');var squel=require(_0xe149('0xa'));var crypto=require(_0xe149('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe149('0xc'));var Papa=require(_0xe149('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe149('0xe'));var hardwareService=require(_0xe149('0xf'));var logger=require(_0xe149('0x10'))(_0xe149('0x11'));var utils=require(_0xe149('0x12'));var config=require(_0xe149('0x13'));var licenseUtil=require(_0xe149('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe149('0x15')](config[_0xe149('0x16')],{'host':_0xe149('0x17'),'port':0x18eb});var socket=require(_0xe149('0x18'))(new Redis(config[_0xe149('0x16')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0xe149('0x19'));var client=jayson[_0xe149('0x1a')][_0xe149('0x1b')]({'port':0x232c});var client9002=jayson[_0xe149('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46ba42,_0x15f5c6,_0x1bc8f2,_0x136791){return new BPromise(function(_0x144576,_0x108d23){var _0x45f34e=_0x136791||client;return _0x45f34e['request'](_0x46ba42,_0x1bc8f2)[_0xe149('0x1c')](function(_0x5e9ff8){logger[_0xe149('0x1d')](_0xe149('0x1e'),_0x15f5c6,_0xe149('0x1f'));logger['debug'](_0xe149('0x20'),_0x15f5c6,_0xe149('0x1f'),JSON[_0xe149('0x21')](_0x5e9ff8));if(_0x5e9ff8[_0xe149('0x22')]){if(_0x5e9ff8[_0xe149('0x22')][_0xe149('0x23')]===0x1f4){logger[_0xe149('0x22')](_0xe149('0x1e'),_0x15f5c6,_0x5e9ff8[_0xe149('0x22')][_0xe149('0x24')]);return _0x108d23(_0x5e9ff8[_0xe149('0x22')][_0xe149('0x24')]);}logger[_0xe149('0x22')](_0xe149('0x1e'),_0x15f5c6,_0x5e9ff8[_0xe149('0x22')][_0xe149('0x24')]);return _0x144576(_0x5e9ff8['error']['message']);}else{logger['info'](_0xe149('0x1e'),_0x15f5c6,_0xe149('0x1f'));_0x144576(_0x5e9ff8['result']['message']);}})[_0xe149('0x25')](function(_0x277679){logger[_0xe149('0x22')](_0xe149('0x1e'),_0x15f5c6,_0x277679);_0x108d23(_0x277679);});});}function respondWithStatusCode(_0x18dd6f,_0x13db5e){_0x13db5e=_0x13db5e||0xcc;return function(_0x123943){if(_0x123943){return _0x18dd6f[_0xe149('0x26')](_0x13db5e);}return _0x18dd6f[_0xe149('0x27')](_0x13db5e)[_0xe149('0x28')]();};}function respondWithResult(_0x2144cd,_0x3356ae){_0x3356ae=_0x3356ae||0xc8;return function(_0x26af96){if(_0x26af96){return _0x2144cd[_0xe149('0x27')](_0x3356ae)['json'](_0x26af96);}};}function respondWithFilteredResult(_0x3f7549,_0x5b1058){return function(_0x8ac1e0){if(_0x8ac1e0){var _0x517f8d=typeof _0x5b1058[_0xe149('0x29')]===_0xe149('0x2a')&&typeof _0x5b1058[_0xe149('0x2b')]===_0xe149('0x2a');var _0x2c276a=_0x8ac1e0[_0xe149('0x2c')];var _0x11c184=_0x517f8d?0x0:_0x5b1058[_0xe149('0x29')];var _0x23984b=_0x517f8d?_0x8ac1e0[_0xe149('0x2c')]:_0x5b1058['offset']+_0x5b1058['limit'];var _0x6ae0c7;if(_0x23984b>=_0x2c276a){_0x23984b=_0x2c276a;_0x6ae0c7=0xc8;}else{_0x6ae0c7=0xce;}_0x3f7549[_0xe149('0x27')](_0x6ae0c7);return _0x3f7549[_0xe149('0x2d')](_0xe149('0x2e'),_0x11c184+'-'+_0x23984b+'/'+_0x2c276a)[_0xe149('0x2f')](_0x8ac1e0);}return null;};}function patchUpdates(_0x14707c){return function(_0x56dafc){try{jsonpatch['apply'](_0x56dafc,_0x14707c,!![]);}catch(_0x4dd2be){return BPromise['reject'](_0x4dd2be);}return _0x56dafc['save']();};}function saveUpdates(_0x5b5246,_0x2c91ee){return function(_0x7e3182){if(_0x7e3182){return _0x7e3182['update'](_0x5b5246)[_0xe149('0x1c')](function(_0x7f6ea9){return _0x7f6ea9;});}return null;};}function removeEntity(_0x796952,_0x2bdd5){return function(_0x3a6426){if(_0x3a6426){return _0x3a6426[_0xe149('0x30')]()[_0xe149('0x1c')](function(){_0x796952[_0xe149('0x27')](0xcc)[_0xe149('0x28')]();});}};}function handleEntityNotFound(_0x7599b3,_0xd4874d){return function(_0x4ae03e){if(!_0x4ae03e){_0x7599b3[_0xe149('0x26')](0x194);}return _0x4ae03e;};}function handleError(_0x4da839,_0x44f1a6){_0x44f1a6=_0x44f1a6||0x1f4;return function(_0xb90377){logger['error'](_0xb90377['stack']);if(_0xb90377[_0xe149('0x31')]){delete _0xb90377[_0xe149('0x31')];}_0x4da839[_0xe149('0x27')](_0x44f1a6)['send'](_0xb90377);};}exports['index']=function(_0x5ad56d,_0x420678){var _0x209f80={},_0x500169={},_0x1c8f17={'count':0x0,'rows':[]};var _0x4c6496=_['map'](db[_0xe149('0x32')][_0xe149('0x33')],function(_0x256a62){return{'name':_0x256a62[_0xe149('0x34')],'type':_0x256a62[_0xe149('0x35')][_0xe149('0x36')]};});_0x500169[_0xe149('0x37')]=_['map'](_0x4c6496,_0xe149('0x31'));_0x500169[_0xe149('0x38')]=_[_0xe149('0x39')](_0x5ad56d[_0xe149('0x38')]);_0x500169[_0xe149('0x3a')]=_['intersection'](_0x500169[_0xe149('0x37')],_0x500169[_0xe149('0x38')]);_0x209f80['attributes']=_[_0xe149('0x3b')](_0x500169[_0xe149('0x37')],qs[_0xe149('0x3c')](_0x5ad56d['query']['fields']));_0x209f80[_0xe149('0x3d')]=_0x209f80['attributes'][_0xe149('0x3e')]?_0x209f80[_0xe149('0x3d')]:_0x500169[_0xe149('0x37')];if(!_0x5ad56d[_0xe149('0x38')]['hasOwnProperty'](_0xe149('0x3f'))){_0x209f80['limit']=qs[_0xe149('0x2b')](_0x5ad56d[_0xe149('0x38')]['limit']);_0x209f80[_0xe149('0x29')]=qs[_0xe149('0x29')](_0x5ad56d[_0xe149('0x38')]['offset']);}_0x209f80[_0xe149('0x40')]=qs['sort'](_0x5ad56d[_0xe149('0x38')][_0xe149('0x41')]);_0x209f80[_0xe149('0x42')]=qs[_0xe149('0x3a')](_[_0xe149('0x43')](_0x5ad56d[_0xe149('0x38')],_0x500169[_0xe149('0x3a')]),_0x4c6496);if(_0x5ad56d['query'][_0xe149('0x44')]){_0x209f80['where']=_[_0xe149('0x45')](_0x209f80['where'],{'$or':_[_0xe149('0x46')](_0x4c6496,function(_0x403640){if(_0x403640[_0xe149('0x35')]!=='VIRTUAL'){var _0x370ea5={};_0x370ea5[_0x403640[_0xe149('0x31')]]={'$like':'%'+_0x5ad56d[_0xe149('0x38')]['filter']+'%'};return _0x370ea5;}})});}_0x209f80=_[_0xe149('0x45')]({},_0x209f80,_0x5ad56d[_0xe149('0x47')]);var _0x10f215={'where':_0x209f80[_0xe149('0x42')]};return db[_0xe149('0x32')][_0xe149('0x2c')](_0x10f215)[_0xe149('0x1c')](function(_0x4b5841){_0x1c8f17[_0xe149('0x2c')]=_0x4b5841;if(_0x5ad56d[_0xe149('0x38')][_0xe149('0x48')]){_0x209f80[_0xe149('0x49')]=[{'all':!![]}];}return db[_0xe149('0x32')]['findAll'](_0x209f80);})[_0xe149('0x1c')](function(_0x3ee45f){_0x1c8f17[_0xe149('0x4a')]=_0x3ee45f;return _0x1c8f17;})[_0xe149('0x1c')](respondWithFilteredResult(_0x420678,_0x209f80))[_0xe149('0x25')](handleError(_0x420678,null));};exports[_0xe149('0x4b')]=function(_0x195500,_0x40886d){var _0xa0a3cb={'raw':!![],'where':{'id':_0x195500[_0xe149('0x4c')]['id']}},_0x5069d0={};_0x5069d0[_0xe149('0x37')]=_[_0xe149('0x39')](db[_0xe149('0x32')]['rawAttributes']);_0x5069d0[_0xe149('0x38')]=_['keys'](_0x195500[_0xe149('0x38')]);_0x5069d0[_0xe149('0x3a')]=_[_0xe149('0x3b')](_0x5069d0[_0xe149('0x37')],_0x5069d0[_0xe149('0x38')]);_0xa0a3cb[_0xe149('0x3d')]=_[_0xe149('0x3b')](_0x5069d0['model'],qs[_0xe149('0x3c')](_0x195500[_0xe149('0x38')]['fields']));_0xa0a3cb[_0xe149('0x3d')]=_0xa0a3cb['attributes']['length']?_0xa0a3cb[_0xe149('0x3d')]:_0x5069d0[_0xe149('0x37')];if(_0x195500[_0xe149('0x38')][_0xe149('0x48')]){_0xa0a3cb[_0xe149('0x49')]=[{'all':!![]}];}_0xa0a3cb=_['merge']({},_0xa0a3cb,_0x195500[_0xe149('0x47')]);return db[_0xe149('0x32')][_0xe149('0x4d')](_0xa0a3cb)[_0xe149('0x1c')](handleEntityNotFound(_0x40886d,null))[_0xe149('0x1c')](respondWithResult(_0x40886d,null))['catch'](handleError(_0x40886d,null));};exports[_0xe149('0x4e')]=function(_0x186655,_0x153c04){return db[_0xe149('0x32')][_0xe149('0x4e')](_0x186655[_0xe149('0x4f')],{})[_0xe149('0x1c')](respondWithResult(_0x153c04,0xc9))['catch'](handleError(_0x153c04,null));};exports['update']=function(_0x34dbe4,_0xd39669){if(_0x34dbe4[_0xe149('0x4f')]['id']){delete _0x34dbe4[_0xe149('0x4f')]['id'];}return db['OpenchannelMessage'][_0xe149('0x4d')]({'where':{'id':_0x34dbe4[_0xe149('0x4c')]['id']}})[_0xe149('0x1c')](handleEntityNotFound(_0xd39669,null))[_0xe149('0x1c')](saveUpdates(_0x34dbe4[_0xe149('0x4f')],null))['then'](respondWithResult(_0xd39669,null))[_0xe149('0x25')](handleError(_0xd39669,null));};exports[_0xe149('0x30')]=function(_0xb07e0d,_0x4c35b1){return db[_0xe149('0x32')][_0xe149('0x4d')]({'where':{'id':_0xb07e0d[_0xe149('0x4c')]['id']}})[_0xe149('0x1c')](handleEntityNotFound(_0x4c35b1,null))[_0xe149('0x1c')](removeEntity(_0x4c35b1,null))[_0xe149('0x25')](handleError(_0x4c35b1,null));};exports[_0xe149('0x50')]=function(_0x4ca3fa,_0x34f865){return db[_0xe149('0x32')][_0xe149('0x50')]()[_0xe149('0x1c')](respondWithResult(_0x34f865,null))['catch'](handleError(_0x34f865,null));};var interaction_log=require(_0xe149('0x10'))(_0xe149('0x51'));exports[_0xe149('0x52')]=function(_0x14cf13,_0x1e6844,_0x577fdb){var _0x99b8ca={'agent':{},'channel':_0xe149('0x53')};if(_0x14cf13[_0xe149('0x4f')]['id']){delete _0x14cf13[_0xe149('0x4f')]['id'];}_0x14cf13[_0xe149('0x4f')]['read']=!![];_0x14cf13[_0xe149('0x4f')][_0xe149('0x54')]=moment()[_0xe149('0x55')](_0xe149('0x56'));_0x14cf13[_0xe149('0x4f')][_0xe149('0x57')]=_0x14cf13[_0xe149('0x4f')][_0xe149('0x57')]||_0x14cf13[_0xe149('0x58')]['id'];_0x99b8ca[_0xe149('0x59')]['id']=_0x14cf13[_0xe149('0x4f')][_0xe149('0x57')];return db[_0xe149('0x32')][_0xe149('0x4d')]({'where':{'id':_0x14cf13['params']['id'],'UserId':null}})[_0xe149('0x1c')](handleEntityNotFound(_0x1e6844,null))[_0xe149('0x1c')](saveUpdates(_0x14cf13[_0xe149('0x4f')],null))[_0xe149('0x1c')](function(_0x53d684){if(_0x53d684){_0x99b8ca[_0xe149('0x24')]=_0x53d684[_0xe149('0x5a')]({'plain':!![]});return db[_0xe149('0x5b')][_0xe149('0x4d')]({'where':{'id':_0x53d684[_0xe149('0x5c')]}});}return null;})['then'](handleEntityNotFound(_0x1e6844,null))[_0xe149('0x1c')](function(_0x2493ea){if(_0x2493ea){return _0x2493ea[_0xe149('0x5d')]({'UserId':_0x14cf13[_0xe149('0x4f')][_0xe149('0x57')],'read1stAt':_[_0xe149('0x5e')](_0x2493ea['read1stAt'])?moment()[_0xe149('0x55')](_0xe149('0x56')):undefined});}return null;})['then'](function(_0x6fed31){if(_0x6fed31){_0x99b8ca[_0xe149('0x5f')]=_0x6fed31[_0xe149('0x5a')]({'plain':!![]});interaction_log['info'](_0xe149('0x60'),_0x14cf13['user']['id'],_0x14cf13[_0xe149('0x58')][_0xe149('0x31')],_0x14cf13['user']['role'],_0x99b8ca[_0xe149('0x5f')]['id'],_0x14cf13[_0xe149('0x4f')]?JSON['stringify'](_0x14cf13[_0xe149('0x4f')]):'null');return respondWithRpcPromise(_0xe149('0x61'),_0xe149('0x62'),_0x99b8ca);}return null;})[_0xe149('0x1c')](function(_0x56e814){var _0xeca66c=_0xe149('0x63')+_0x56e814[_0xe149('0x24')]['ContactId'];return db[_0xe149('0x64')][_0xe149('0x38')](_0xeca66c,{'type':db['Sequelize'][_0xe149('0x65')][_0xe149('0x66')],'raw':!![]})[_0xe149('0x1c')](function(_0x3efa72){return _0x3efa72;});})[_0xe149('0x1c')](function(_0x4f2a65){if(_0x4f2a65){_0x99b8ca[_0xe149('0x24')][_0xe149('0x67')]=_0x4f2a65[0x0];if(!_0x14cf13['body'][_0xe149('0x57')])return;return db[_0xe149('0x68')][_0xe149('0x4d')]({'where':{'id':_0x14cf13[_0xe149('0x4f')][_0xe149('0x57')],'role':_0xe149('0x59')},'attributes':['id',_0xe149('0x31'),_0xe149('0x69'),'email',_0xe149('0x6a')],'raw':!![]});}return null;})[_0xe149('0x1c')](function(_0x16ec04){if(!_0x16ec04)return null;_0x99b8ca['message']['agent']=_0x16ec04;return _0x99b8ca;})[_0xe149('0x1c')](function(_0x24cd10){if(_0x24cd10){if(_0x14cf13[_0xe149('0x4f')][_0xe149('0x6b')]){_0x99b8ca[_0xe149('0x24')][_0xe149('0x6c')]=util[_0xe149('0x55')]('SIP/%s',_0x14cf13[_0xe149('0x58')][_0xe149('0x31')]);_0x99b8ca[_0xe149('0x24')]['channel']=_0x99b8ca[_0xe149('0x6d')];_0x99b8ca['message'][_0xe149('0x6e')]=_0x99b8ca[_0xe149('0x6d')];_0x99b8ca['message'][_0xe149('0x6f')]=_0xe149('0x52');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x99b8ca['message']},client9002)[_0xe149('0x1c')](function(){return _0x99b8ca;});}return _0x99b8ca;}return null;})['then'](respondWithResult(_0x1e6844,null))['catch'](handleError(_0x1e6844,null));};var interaction_log=require(_0xe149('0x10'))('openchannel-interactions');exports[_0xe149('0x70')]=function(_0x17f831,_0x9c58d4,_0x570f11){var _0x45ac76={'agent':{},'channel':'openchannel'};if(_0x17f831['body']['id']){delete _0x17f831[_0xe149('0x4f')]['id'];}_0x17f831[_0xe149('0x4f')]['UserId']=_0x17f831[_0xe149('0x4f')][_0xe149('0x57')]||_0x17f831[_0xe149('0x58')]['id'];_0x45ac76[_0xe149('0x59')]['id']=_0x17f831['body']['UserId'];return db['OpenchannelMessage'][_0xe149('0x4d')]({'where':{'id':_0x17f831[_0xe149('0x4c')]['id'],'UserId':null}})[_0xe149('0x1c')](handleEntityNotFound(_0x9c58d4,null))[_0xe149('0x1c')](function(_0x5577dc){if(_0x5577dc){_0x45ac76['message']=_0x5577dc[_0xe149('0x5a')]({'plain':!![]});return db[_0xe149('0x5b')][_0xe149('0x4d')]({'where':{'id':_0x5577dc[_0xe149('0x5c')]}});}return null;})[_0xe149('0x1c')](handleEntityNotFound(_0x9c58d4,null))['then'](function(_0x3e813a){if(_0x3e813a){_0x45ac76[_0xe149('0x5f')]=_0x3e813a['get']({'plain':!![]});interaction_log[_0xe149('0x1d')](_0xe149('0x71'),_0x17f831[_0xe149('0x58')]['id'],_0x17f831[_0xe149('0x58')]['name'],_0x17f831['user'][_0xe149('0x72')],_0x45ac76[_0xe149('0x5f')]['id'],_0x17f831[_0xe149('0x4f')]?JSON[_0xe149('0x21')](_0x17f831[_0xe149('0x4f')]):_0xe149('0x73'));return respondWithRpcPromise(_0xe149('0x74'),_0xe149('0x75'),_0x45ac76);}return null;})[_0xe149('0x1c')](function(_0x594942){var _0x55b1b2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x594942[_0xe149('0x24')][_0xe149('0x76')];return db[_0xe149('0x64')][_0xe149('0x38')](_0x55b1b2,{'type':db['Sequelize'][_0xe149('0x65')][_0xe149('0x66')],'raw':!![]})[_0xe149('0x1c')](function(_0x456c7b){return _0x456c7b;});})[_0xe149('0x1c')](function(_0x454366){if(_0x454366){_0x45ac76[_0xe149('0x24')][_0xe149('0x67')]=_0x454366[0x0];if(!_0x17f831['body']['UserId'])return;return db[_0xe149('0x68')][_0xe149('0x4d')]({'where':{'id':_0x17f831[_0xe149('0x4f')][_0xe149('0x57')],'role':'agent'},'attributes':['id','name',_0xe149('0x69'),'email',_0xe149('0x6a')],'raw':!![]});}return null;})[_0xe149('0x1c')](function(_0x515f68){if(!_0x515f68)return null;_0x45ac76[_0xe149('0x24')][_0xe149('0x59')]=_0x515f68;return _0x45ac76;})[_0xe149('0x1c')](function(_0x4d1fc5){if(_0x4d1fc5){_0x4d1fc5['message'][_0xe149('0x6c')]=util['format'](_0xe149('0x77'),_0x17f831[_0xe149('0x58')][_0xe149('0x31')]);_0x4d1fc5[_0xe149('0x24')]['channel']=_0x45ac76['channel'];_0x4d1fc5[_0xe149('0x24')][_0xe149('0x6e')]=_0x45ac76[_0xe149('0x6d')];_0x4d1fc5[_0xe149('0x24')][_0xe149('0x6f')]=_0xe149('0x70');respondWithRpcPromise(_0xe149('0x78'),_0xe149('0x78'),{'event':'rejectmessage','message':_0x4d1fc5[_0xe149('0x24')]},client9002);return _0x45ac76;}return null;})[_0xe149('0x1c')](respondWithResult(_0x9c58d4,null))['catch'](handleError(_0x9c58d4,null));};
\ No newline at end of file
+var _0x15ae=['defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','end','sendStatus','stack','send','index','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','OpenchannelMessage','includeAll','findAll','rows','params','length','include','options','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','find','get','OpenchannelInteractionId','isNil','user','role','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','agent','fullname','email','internal','manual','interface','motionChannel','channel','event','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','User','SIP/%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','fs-extra','lodash','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis'];(function(_0x51ed6d,_0x42190d){var _0xf5872c=function(_0x34a2b0){while(--_0x34a2b0){_0x51ed6d['push'](_0x51ed6d['shift']());}};_0xf5872c(++_0x42190d);}(_0x15ae,0x6b));var _0xe15a=function(_0x210cf6,_0x237754){_0x210cf6=_0x210cf6-0x0;var _0x860a0e=_0x15ae[_0x210cf6];return _0x860a0e;};'use strict';var emlformat=require(_0xe15a('0x0'));var rimraf=require(_0xe15a('0x1'));var zipdir=require(_0xe15a('0x2'));var jsonpatch=require(_0xe15a('0x3'));var rp=require('request-promise');var moment=require(_0xe15a('0x4'));var BPromise=require(_0xe15a('0x5'));var Mustache=require(_0xe15a('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe15a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe15a('0x8'));var _=require(_0xe15a('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(_0xe15a('0xa'));var Papa=require(_0xe15a('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe15a('0xc'));var as=require(_0xe15a('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe15a('0xe'))(_0xe15a('0xf'));var utils=require(_0xe15a('0x10'));var config=require(_0xe15a('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xe15a('0x12'))['db'];config[_0xe15a('0x13')]=_[_0xe15a('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe15a('0x15'))(new Redis(config['redis']));require(_0xe15a('0x16'))[_0xe15a('0x17')](socket);var jayson=require(_0xe15a('0x18'));var client=jayson[_0xe15a('0x19')][_0xe15a('0x1a')]({'port':0x232c});var client9002=jayson[_0xe15a('0x19')][_0xe15a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x2e7462,_0x41370a,_0x50be64,_0x28697d){return new BPromise(function(_0x4a5253,_0x3b6b3f){var _0x2307d1=_0x28697d||client;return _0x2307d1[_0xe15a('0x1b')](_0x2e7462,_0x50be64)[_0xe15a('0x1c')](function(_0x424258){logger[_0xe15a('0x1d')](_0xe15a('0x1e'),_0x41370a,'request\x20sent');logger[_0xe15a('0x1f')](_0xe15a('0x20'),_0x41370a,_0xe15a('0x21'),JSON[_0xe15a('0x22')](_0x424258));if(_0x424258[_0xe15a('0x23')]){if(_0x424258[_0xe15a('0x23')][_0xe15a('0x24')]===0x1f4){logger['error'](_0xe15a('0x1e'),_0x41370a,_0x424258['error'][_0xe15a('0x25')]);return _0x3b6b3f(_0x424258[_0xe15a('0x23')][_0xe15a('0x25')]);}logger[_0xe15a('0x23')](_0xe15a('0x1e'),_0x41370a,_0x424258[_0xe15a('0x23')][_0xe15a('0x25')]);return _0x4a5253(_0x424258[_0xe15a('0x23')][_0xe15a('0x25')]);}else{logger['info'](_0xe15a('0x1e'),_0x41370a,_0xe15a('0x21'));_0x4a5253(_0x424258[_0xe15a('0x26')][_0xe15a('0x25')]);}})[_0xe15a('0x27')](function(_0x11a0fa){logger[_0xe15a('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x41370a,_0x11a0fa);_0x3b6b3f(_0x11a0fa);});});}function respondWithStatusCode(_0x1b5e49,_0x24a96b){_0x24a96b=_0x24a96b||0xcc;return function(_0x4ae1b8){if(_0x4ae1b8){return _0x1b5e49['sendStatus'](_0x24a96b);}return _0x1b5e49[_0xe15a('0x28')](_0x24a96b)['end']();};}function respondWithResult(_0x1d37b2,_0x1c90e3){_0x1c90e3=_0x1c90e3||0xc8;return function(_0x5a8c1b){if(_0x5a8c1b){return _0x1d37b2[_0xe15a('0x28')](_0x1c90e3)[_0xe15a('0x29')](_0x5a8c1b);}};}function respondWithFilteredResult(_0x592004,_0x470a31){return function(_0x558b6b){if(_0x558b6b){var _0x2ee6ba=typeof _0x470a31[_0xe15a('0x2a')]==='undefined'&&typeof _0x470a31['limit']===_0xe15a('0x2b');var _0x5f2925=_0x558b6b[_0xe15a('0x2c')];var _0x1dcf16=_0x2ee6ba?0x0:_0x470a31[_0xe15a('0x2a')];var _0x2f4cc8=_0x2ee6ba?_0x558b6b[_0xe15a('0x2c')]:_0x470a31[_0xe15a('0x2a')]+_0x470a31[_0xe15a('0x2d')];var _0x546e76;if(_0x2f4cc8>=_0x5f2925){_0x2f4cc8=_0x5f2925;_0x546e76=0xc8;}else{_0x546e76=0xce;}_0x592004[_0xe15a('0x28')](_0x546e76);return _0x592004['set'](_0xe15a('0x2e'),_0x1dcf16+'-'+_0x2f4cc8+'/'+_0x5f2925)['json'](_0x558b6b);}return null;};}function patchUpdates(_0x1d42d6){return function(_0x5e273d){try{jsonpatch[_0xe15a('0x2f')](_0x5e273d,_0x1d42d6,!![]);}catch(_0xdd50c6){return BPromise['reject'](_0xdd50c6);}return _0x5e273d[_0xe15a('0x30')]();};}function saveUpdates(_0x5d6c1d,_0x158325){return function(_0x57fe32){if(_0x57fe32){return _0x57fe32[_0xe15a('0x31')](_0x5d6c1d)[_0xe15a('0x1c')](function(_0x3d1de1){return _0x3d1de1;});}return null;};}function removeEntity(_0x126c15,_0x5d4c51){return function(_0x1b5bbb){if(_0x1b5bbb){return _0x1b5bbb[_0xe15a('0x32')]()[_0xe15a('0x1c')](function(){_0x126c15[_0xe15a('0x28')](0xcc)[_0xe15a('0x33')]();});}};}function handleEntityNotFound(_0x5957ef,_0x253a0e){return function(_0x1aca10){if(!_0x1aca10){_0x5957ef[_0xe15a('0x34')](0x194);}return _0x1aca10;};}function handleError(_0x1e0704,_0x498e87){_0x498e87=_0x498e87||0x1f4;return function(_0x5601e2){logger[_0xe15a('0x23')](_0x5601e2[_0xe15a('0x35')]);if(_0x5601e2['name']){delete _0x5601e2['name'];}_0x1e0704[_0xe15a('0x28')](_0x498e87)[_0xe15a('0x36')](_0x5601e2);};}exports[_0xe15a('0x37')]=function(_0x236c40,_0x503d0b){var _0x5b0283={},_0x55fb0a={},_0x5094b3={'count':0x0,'rows':[]};var _0xde808d=_['map'](db['OpenchannelMessage'][_0xe15a('0x38')],function(_0x1f5350){return{'name':_0x1f5350[_0xe15a('0x39')],'type':_0x1f5350[_0xe15a('0x3a')][_0xe15a('0x3b')]};});_0x55fb0a[_0xe15a('0x3c')]=_['map'](_0xde808d,_0xe15a('0x3d'));_0x55fb0a[_0xe15a('0x3e')]=_[_0xe15a('0x3f')](_0x236c40[_0xe15a('0x3e')]);_0x55fb0a[_0xe15a('0x40')]=_[_0xe15a('0x41')](_0x55fb0a[_0xe15a('0x3c')],_0x55fb0a[_0xe15a('0x3e')]);_0x5b0283['attributes']=_[_0xe15a('0x41')](_0x55fb0a[_0xe15a('0x3c')],qs[_0xe15a('0x42')](_0x236c40[_0xe15a('0x3e')][_0xe15a('0x42')]));_0x5b0283['attributes']=_0x5b0283[_0xe15a('0x43')]['length']?_0x5b0283[_0xe15a('0x43')]:_0x55fb0a['model'];if(!_0x236c40[_0xe15a('0x3e')][_0xe15a('0x44')](_0xe15a('0x45'))){_0x5b0283[_0xe15a('0x2d')]=qs[_0xe15a('0x2d')](_0x236c40[_0xe15a('0x3e')][_0xe15a('0x2d')]);_0x5b0283[_0xe15a('0x2a')]=qs['offset'](_0x236c40[_0xe15a('0x3e')]['offset']);}_0x5b0283[_0xe15a('0x46')]=qs[_0xe15a('0x47')](_0x236c40[_0xe15a('0x3e')][_0xe15a('0x47')]);_0x5b0283[_0xe15a('0x48')]=qs[_0xe15a('0x40')](_[_0xe15a('0x49')](_0x236c40[_0xe15a('0x3e')],_0x55fb0a['filters']),_0xde808d);if(_0x236c40[_0xe15a('0x3e')][_0xe15a('0x4a')]){_0x5b0283['where']=_[_0xe15a('0x4b')](_0x5b0283['where'],{'$or':_[_0xe15a('0x4c')](_0xde808d,function(_0x35bbf1){if(_0x35bbf1['type']!==_0xe15a('0x4d')){var _0x38f775={};_0x38f775[_0x35bbf1[_0xe15a('0x3d')]]={'$like':'%'+_0x236c40[_0xe15a('0x3e')]['filter']+'%'};return _0x38f775;}})});}_0x5b0283=_[_0xe15a('0x4b')]({},_0x5b0283,_0x236c40['options']);var _0x2675a9={'where':_0x5b0283[_0xe15a('0x48')]};return db[_0xe15a('0x4e')][_0xe15a('0x2c')](_0x2675a9)['then'](function(_0x5b947f){_0x5094b3['count']=_0x5b947f;if(_0x236c40[_0xe15a('0x3e')][_0xe15a('0x4f')]){_0x5b0283['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xe15a('0x50')](_0x5b0283);})[_0xe15a('0x1c')](function(_0x1f0bca){_0x5094b3[_0xe15a('0x51')]=_0x1f0bca;return _0x5094b3;})[_0xe15a('0x1c')](respondWithFilteredResult(_0x503d0b,_0x5b0283))[_0xe15a('0x27')](handleError(_0x503d0b,null));};exports['show']=function(_0x229674,_0x3689c1){var _0x5ead19={'raw':!![],'where':{'id':_0x229674[_0xe15a('0x52')]['id']}},_0x28f56d={};_0x28f56d[_0xe15a('0x3c')]=_[_0xe15a('0x3f')](db['OpenchannelMessage']['rawAttributes']);_0x28f56d['query']=_[_0xe15a('0x3f')](_0x229674[_0xe15a('0x3e')]);_0x28f56d['filters']=_[_0xe15a('0x41')](_0x28f56d[_0xe15a('0x3c')],_0x28f56d[_0xe15a('0x3e')]);_0x5ead19['attributes']=_[_0xe15a('0x41')](_0x28f56d['model'],qs[_0xe15a('0x42')](_0x229674[_0xe15a('0x3e')][_0xe15a('0x42')]));_0x5ead19['attributes']=_0x5ead19[_0xe15a('0x43')][_0xe15a('0x53')]?_0x5ead19[_0xe15a('0x43')]:_0x28f56d[_0xe15a('0x3c')];if(_0x229674[_0xe15a('0x3e')][_0xe15a('0x4f')]){_0x5ead19[_0xe15a('0x54')]=[{'all':!![]}];}_0x5ead19=_[_0xe15a('0x4b')]({},_0x5ead19,_0x229674[_0xe15a('0x55')]);return db[_0xe15a('0x4e')]['find'](_0x5ead19)[_0xe15a('0x1c')](handleEntityNotFound(_0x3689c1,null))[_0xe15a('0x1c')](respondWithResult(_0x3689c1,null))[_0xe15a('0x27')](handleError(_0x3689c1,null));};exports[_0xe15a('0x56')]=function(_0x1e895d,_0x285e09){return db[_0xe15a('0x4e')][_0xe15a('0x56')](_0x1e895d[_0xe15a('0x57')],{})[_0xe15a('0x1c')](respondWithResult(_0x285e09,0xc9))[_0xe15a('0x27')](handleError(_0x285e09,null));};exports[_0xe15a('0x31')]=function(_0x342664,_0x5494d1){if(_0x342664[_0xe15a('0x57')]['id']){delete _0x342664[_0xe15a('0x57')]['id'];}return db[_0xe15a('0x4e')]['find']({'where':{'id':_0x342664[_0xe15a('0x52')]['id']}})[_0xe15a('0x1c')](handleEntityNotFound(_0x5494d1,null))[_0xe15a('0x1c')](saveUpdates(_0x342664['body'],null))[_0xe15a('0x1c')](respondWithResult(_0x5494d1,null))[_0xe15a('0x27')](handleError(_0x5494d1,null));};exports['destroy']=function(_0x5c6589,_0x5a593f){return db['OpenchannelMessage']['find']({'where':{'id':_0x5c6589[_0xe15a('0x52')]['id']}})['then'](handleEntityNotFound(_0x5a593f,null))[_0xe15a('0x1c')](removeEntity(_0x5a593f,null))[_0xe15a('0x27')](handleError(_0x5a593f,null));};exports[_0xe15a('0x58')]=function(_0x1f2732,_0x5df2d9){return db[_0xe15a('0x4e')][_0xe15a('0x58')]()[_0xe15a('0x1c')](respondWithResult(_0x5df2d9,null))[_0xe15a('0x27')](handleError(_0x5df2d9,null));};var interaction_log=require(_0xe15a('0xe'))(_0xe15a('0x59'));exports[_0xe15a('0x5a')]=function(_0x532287,_0x4a01db,_0x3702b0){var _0x25acc0={'agent':{},'channel':_0xe15a('0x5b')};if(_0x532287[_0xe15a('0x57')]['id']){delete _0x532287[_0xe15a('0x57')]['id'];}_0x532287[_0xe15a('0x57')][_0xe15a('0x5c')]=!![];_0x532287[_0xe15a('0x57')][_0xe15a('0x5d')]=moment()[_0xe15a('0x5e')](_0xe15a('0x5f'));_0x532287['body'][_0xe15a('0x60')]=_0x532287[_0xe15a('0x57')][_0xe15a('0x60')]||_0x532287['user']['id'];_0x25acc0['agent']['id']=_0x532287[_0xe15a('0x57')][_0xe15a('0x60')];return db[_0xe15a('0x4e')][_0xe15a('0x61')]({'where':{'id':_0x532287[_0xe15a('0x52')]['id'],'UserId':null}})[_0xe15a('0x1c')](handleEntityNotFound(_0x4a01db,null))[_0xe15a('0x1c')](saveUpdates(_0x532287[_0xe15a('0x57')],null))[_0xe15a('0x1c')](function(_0xa2b311){if(_0xa2b311){_0x25acc0[_0xe15a('0x25')]=_0xa2b311[_0xe15a('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0xe15a('0x61')]({'where':{'id':_0xa2b311[_0xe15a('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4a01db,null))[_0xe15a('0x1c')](function(_0x5676d8){if(_0x5676d8){return _0x5676d8['update']({'UserId':_0x532287[_0xe15a('0x57')]['UserId'],'read1stAt':_[_0xe15a('0x64')](_0x5676d8['read1stAt'])?moment()[_0xe15a('0x5e')](_0xe15a('0x5f')):undefined});}return null;})[_0xe15a('0x1c')](function(_0x587dc7){if(_0x587dc7){_0x25acc0['interaction']=_0x587dc7[_0xe15a('0x62')]({'plain':!![]});interaction_log[_0xe15a('0x1d')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x532287['user']['id'],_0x532287[_0xe15a('0x65')]['name'],_0x532287['user'][_0xe15a('0x66')],_0x25acc0[_0xe15a('0x67')]['id'],_0x532287[_0xe15a('0x57')]?JSON[_0xe15a('0x22')](_0x532287[_0xe15a('0x57')]):_0xe15a('0x68'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x25acc0);}return null;})['then'](function(_0x5692ab){var _0x4de5d7=_0xe15a('0x69')+_0x5692ab[_0xe15a('0x25')][_0xe15a('0x6a')];return db[_0xe15a('0x6b')][_0xe15a('0x3e')](_0x4de5d7,{'type':db[_0xe15a('0x6c')]['QueryTypes'][_0xe15a('0x6d')],'raw':!![]})[_0xe15a('0x1c')](function(_0x306295){return _0x306295;});})[_0xe15a('0x1c')](function(_0x4dd99b){if(_0x4dd99b){_0x25acc0[_0xe15a('0x25')]['contact']=_0x4dd99b[0x0];if(!_0x532287['body'][_0xe15a('0x60')])return;return db['User'][_0xe15a('0x61')]({'where':{'id':_0x532287[_0xe15a('0x57')][_0xe15a('0x60')],'role':_0xe15a('0x6e')},'attributes':['id',_0xe15a('0x3d'),_0xe15a('0x6f'),_0xe15a('0x70'),_0xe15a('0x71')],'raw':!![]});}return null;})[_0xe15a('0x1c')](function(_0x531f0c){if(!_0x531f0c)return null;_0x25acc0['message']['agent']=_0x531f0c;return _0x25acc0;})[_0xe15a('0x1c')](function(_0x19e251){if(_0x19e251){if(_0x532287[_0xe15a('0x57')][_0xe15a('0x72')]){_0x25acc0[_0xe15a('0x25')][_0xe15a('0x73')]=util[_0xe15a('0x5e')]('SIP/%s',_0x532287['user'][_0xe15a('0x3d')]);_0x25acc0[_0xe15a('0x25')]['channel']=_0x25acc0['channel'];_0x25acc0[_0xe15a('0x25')][_0xe15a('0x74')]=_0x25acc0[_0xe15a('0x75')];_0x25acc0[_0xe15a('0x25')][_0xe15a('0x76')]='accept';return respondWithRpcPromise(_0xe15a('0x77'),_0xe15a('0x77'),{'event':_0xe15a('0x78'),'message':_0x25acc0['message']},client9002)['then'](function(){return _0x25acc0;});}return _0x25acc0;}return null;})['then'](respondWithResult(_0x4a01db,null))[_0xe15a('0x27')](handleError(_0x4a01db,null));};var interaction_log=require('../../config/logger')(_0xe15a('0x59'));exports['reject']=function(_0x556cff,_0x4a2758,_0x16b38c){var _0x16ee1f={'agent':{},'channel':_0xe15a('0x5b')};if(_0x556cff[_0xe15a('0x57')]['id']){delete _0x556cff[_0xe15a('0x57')]['id'];}_0x556cff[_0xe15a('0x57')][_0xe15a('0x60')]=_0x556cff[_0xe15a('0x57')][_0xe15a('0x60')]||_0x556cff[_0xe15a('0x65')]['id'];_0x16ee1f['agent']['id']=_0x556cff[_0xe15a('0x57')]['UserId'];return db[_0xe15a('0x4e')][_0xe15a('0x61')]({'where':{'id':_0x556cff[_0xe15a('0x52')]['id'],'UserId':null}})[_0xe15a('0x1c')](handleEntityNotFound(_0x4a2758,null))[_0xe15a('0x1c')](function(_0xdea1fe){if(_0xdea1fe){_0x16ee1f[_0xe15a('0x25')]=_0xdea1fe[_0xe15a('0x62')]({'plain':!![]});return db[_0xe15a('0x79')][_0xe15a('0x61')]({'where':{'id':_0xdea1fe[_0xe15a('0x63')]}});}return null;})[_0xe15a('0x1c')](handleEntityNotFound(_0x4a2758,null))[_0xe15a('0x1c')](function(_0x1d6e44){if(_0x1d6e44){_0x16ee1f['interaction']=_0x1d6e44[_0xe15a('0x62')]({'plain':!![]});interaction_log[_0xe15a('0x1d')](_0xe15a('0x7a'),_0x556cff[_0xe15a('0x65')]['id'],_0x556cff['user'][_0xe15a('0x3d')],_0x556cff[_0xe15a('0x65')]['role'],_0x16ee1f[_0xe15a('0x67')]['id'],_0x556cff[_0xe15a('0x57')]?JSON[_0xe15a('0x22')](_0x556cff[_0xe15a('0x57')]):_0xe15a('0x68'));return respondWithRpcPromise('RejectMessage',_0xe15a('0x7b'),_0x16ee1f);}return null;})[_0xe15a('0x1c')](function(_0x42eef6){var _0x4e663f=_0xe15a('0x69')+_0x42eef6[_0xe15a('0x25')][_0xe15a('0x6a')];return db[_0xe15a('0x6b')]['query'](_0x4e663f,{'type':db[_0xe15a('0x6c')]['QueryTypes'][_0xe15a('0x6d')],'raw':!![]})[_0xe15a('0x1c')](function(_0xf9a7ed){return _0xf9a7ed;});})[_0xe15a('0x1c')](function(_0xcfb7cf){if(_0xcfb7cf){_0x16ee1f[_0xe15a('0x25')][_0xe15a('0x7c')]=_0xcfb7cf[0x0];if(!_0x556cff['body']['UserId'])return;return db[_0xe15a('0x7d')][_0xe15a('0x61')]({'where':{'id':_0x556cff[_0xe15a('0x57')][_0xe15a('0x60')],'role':'agent'},'attributes':['id',_0xe15a('0x3d'),_0xe15a('0x6f'),_0xe15a('0x70'),_0xe15a('0x71')],'raw':!![]});}return null;})[_0xe15a('0x1c')](function(_0xf2d7ef){if(!_0xf2d7ef)return null;_0x16ee1f[_0xe15a('0x25')][_0xe15a('0x6e')]=_0xf2d7ef;return _0x16ee1f;})[_0xe15a('0x1c')](function(_0x12b51c){if(_0x12b51c){_0x12b51c[_0xe15a('0x25')][_0xe15a('0x73')]=util['format'](_0xe15a('0x7e'),_0x556cff[_0xe15a('0x65')][_0xe15a('0x3d')]);_0x12b51c[_0xe15a('0x25')][_0xe15a('0x75')]=_0x16ee1f[_0xe15a('0x75')];_0x12b51c[_0xe15a('0x25')][_0xe15a('0x74')]=_0x16ee1f[_0xe15a('0x75')];_0x12b51c[_0xe15a('0x25')][_0xe15a('0x76')]='reject';respondWithRpcPromise(_0xe15a('0x77'),_0xe15a('0x77'),{'event':'rejectmessage','message':_0x12b51c['message']},client9002);return _0x16ee1f;}return null;})[_0xe15a('0x1c')](respondWithResult(_0x4a2758,null))[_0xe15a('0x27')](handleError(_0x4a2758,null));};
\ No newline at end of file
index 45ce55f..e2f51fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc10=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x37649e,_0x41b369){var _0x183324=function(_0x3c7b18){while(--_0x3c7b18){_0x37649e['push'](_0x37649e['shift']());}};_0x183324(++_0x41b369);}(_0xcc10,0x1a7));var _0x0cc1=function(_0x355825,_0x5726f2){_0x355825=_0x355825-0x0;var _0x5c46ae=_0xcc10[_0x355825];return _0x5c46ae;};'use strict';var EventEmitter=require(_0x0cc1('0x0'));var OpenchannelMessage=require(_0x0cc1('0x1'))['db'][_0x0cc1('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0cc1('0x3')](0x0);var events={'afterCreate':_0x0cc1('0x4'),'afterUpdate':_0x0cc1('0x5'),'afterDestroy':_0x0cc1('0x6')};function emitEvent(_0x58c488){return function(_0x3c4838,_0x5a994f,_0x4709ee){OpenchannelMessageEvents['emit'](_0x58c488+':'+_0x3c4838['id'],_0x3c4838);OpenchannelMessageEvents[_0x0cc1('0x7')](_0x58c488,_0x3c4838);_0x4709ee(null);};}for(var e in events){if(events[_0x0cc1('0x8')](e)){var event=events[e];OpenchannelMessage[_0x0cc1('0x9')](e,emitEvent(event));}}module[_0x0cc1('0xa')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xc7da=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x20ec02,_0x4ec84b){var _0x3eae7f=function(_0x364374){while(--_0x364374){_0x20ec02['push'](_0x20ec02['shift']());}};_0x3eae7f(++_0x4ec84b);}(_0xc7da,0x6f));var _0xac7d=function(_0x4da6e6,_0x189d98){_0x4da6e6=_0x4da6e6-0x0;var _0x3dcbc8=_0xc7da[_0x4da6e6];return _0x3dcbc8;};'use strict';var EventEmitter=require(_0xac7d('0x0'));var OpenchannelMessage=require(_0xac7d('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xac7d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xac7d('0x3'),'afterDestroy':_0xac7d('0x4')};function emitEvent(_0x253f22){return function(_0x3322a7,_0x4e4b48,_0xb13062){OpenchannelMessageEvents[_0xac7d('0x5')](_0x253f22+':'+_0x3322a7['id'],_0x3322a7);OpenchannelMessageEvents['emit'](_0x253f22,_0x3322a7);_0xb13062(null);};}for(var e in events){if(events[_0xac7d('0x6')](e)){var event=events[e];OpenchannelMessage[_0xac7d('0x7')](e,emitEvent(event));}}module[_0xac7d('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
index d1565e4..09239bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a85=['openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','error','CmContact','then','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','POST','method','GET','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','OpenchannelMessage'];(function(_0x449d11,_0x3510ae){var _0x4d7d02=function(_0x42d886){while(--_0x42d886){_0x449d11['push'](_0x449d11['shift']());}};_0x4d7d02(++_0x3510ae);}(_0x1a85,0x178));var _0x51a8=function(_0x187309,_0x2cb520){_0x187309=_0x187309-0x0;var _0x1d3711=_0x1a85[_0x187309];return _0x1d3711;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x51a8('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56e1b4,_0x39e06a,_0x2f276b){var _0x1a476d=_0x4b76a8[_0x51a8('0xa')];var _0x418f06=_0x56e1b4[_0x51a8('0xb')]({'plain':!![]});if(_0x418f06[_0x51a8('0xc')][_0x51a8('0xd')]()==='in'||_0x418f06[_0x51a8('0xc')][_0x51a8('0xd')]()===_0x51a8('0xe')&&!_0x418f06[_0x51a8('0xf')]&&!_[_0x51a8('0x10')](_0x418f06[_0x51a8('0x11')])){_0x1a476d[_0x51a8('0x12')][_0x51a8('0x13')]({'where':{'id':_0x418f06[_0x51a8('0x14')]}})['then'](function(_0x461f5c){if(_0x461f5c){_0x461f5c[_0x51a8('0x15')]({'lastMsgAt':_0x418f06[_0x51a8('0x16')],'lastMsgDirection':_0x418f06['direction'][_0x51a8('0xd')]()});}})['catch'](function(_0x10584b){console[_0x51a8('0x17')](_0x10584b);});}if(_0x418f06[_0x51a8('0xc')]===_0x51a8('0xe')&&!_0x418f06[_0x51a8('0xf')]){var _0x3e0603;_0x1a476d[_0x51a8('0x18')]['describe']()[_0x51a8('0x19')](function(_0x45a433){return _0x1a476d[_0x51a8('0x1a')][_0x51a8('0x1b')]({'where':{'id':_0x418f06[_0x51a8('0x1c')]},'include':[{'model':_0x1a476d[_0x51a8('0x12')],'as':'Interactions','where':{'id':_0x418f06[_0x51a8('0x14')]},'limit':0x1,'include':[{'model':_0x1a476d[_0x51a8('0x18')],'as':_0x51a8('0x1d'),'attributes':_[_0x51a8('0x1e')](_0x45a433)}]}]});})[_0x51a8('0x19')](function(_0x3bc044){_0x3e0603=_0x3bc044[_0x51a8('0xb')]({'plain':!![]});if(_0x3e0603&&_0x3e0603[_0x51a8('0x1f')]){logger['info'](_0x51a8('0x20'),'afterCreate',util[_0x51a8('0x21')](_0x51a8('0x22'),_0x418f06['id'],_0x3e0603[_0x51a8('0x1f')]));if(_0x3e0603[_0x51a8('0x23')]&&_0x3e0603['Interactions'][_0x51a8('0x24')]){_0x418f06['Interaction']=_['omit'](_0x3e0603[_0x51a8('0x23')][0x0],'Contact');_0x418f06[_0x51a8('0x1d')]=_0x3e0603[_0x51a8('0x23')][0x0][_0x51a8('0x1d')];}var _0x39e06a={'method':_0x51a8('0x25'),'uri':encodeURI(_0x3e0603[_0x51a8('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x39e06a[_0x51a8('0x26')]){case _0x51a8('0x27'):_0x39e06a['qs']=_0x418f06;break;case'POST':_0x39e06a[_0x51a8('0x9')]=_0x418f06;break;}return rp(_0x39e06a)[_0x51a8('0x19')](function(_0xca5746){logger[_0x51a8('0x28')](_0x51a8('0x20'),_0x51a8('0x29'),util[_0x51a8('0x21')](_0x51a8('0x2a'),_0x418f06['id'],_0x3e0603[_0x51a8('0x1f')]));if(_0xca5746[_0x51a8('0x9')][_0x51a8('0x2b')]&&_0xca5746[_0x51a8('0x9')]['threadId']!=_0x418f06[_0x51a8('0x2c')]['threadId']){return _0x1a476d[_0x51a8('0x12')][_0x51a8('0x15')]({'threadId':_0xca5746[_0x51a8('0x9')][_0x51a8('0x2b')]},{'logging':!![],'where':{'id':_0x418f06[_0x51a8('0x2c')]['id']}});}else{return;}})['then'](function(){return _0x56e1b4[_0x51a8('0x15')]({'read':!![]});})['catch'](function(_0x41c4de){logger[_0x51a8('0x17')](_0x51a8('0x20'),'afterCreate',util[_0x51a8('0x2d')](_0x41c4de,{'showHidden':![],'depth':null}));_0x2f276b();});}else{_0x2f276b();}})['finally'](function(){_0x2f276b();});}else{_0x2f276b();}}},'charset':_0x51a8('0x2e'),'collate':_0x51a8('0x2f')});};
\ No newline at end of file
+var _0xefda=['request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','omit','POST','method','GET','format','threadId','inspect','finally','utf8mb4','lodash','api','moment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xefda,0x96));var _0xaefd=function(_0x447dbd,_0x56bc26){_0x447dbd=_0x447dbd-0x0;var _0x5eda35=_0xefda[_0x447dbd];return _0x5eda35;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var BPromise=require('bluebird');var rp=require(_0xaefd('0x3'));var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var attributes=require(_0xaefd('0x7'));module[_0xaefd('0x8')]=function(_0x497258,_0x3677ea){return _0x497258[_0xaefd('0x9')](_0xaefd('0xa'),attributes,{'tableName':_0xaefd('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xaefd('0xc')],'type':_0xaefd('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x463ce7,_0x4d44ed,_0x48a255){var _0x54a3b1=_0x497258[_0xaefd('0xe')];var _0x16b36e=_0x463ce7[_0xaefd('0xf')]({'plain':!![]});if(_0x16b36e[_0xaefd('0x10')][_0xaefd('0x11')]()==='in'||_0x16b36e[_0xaefd('0x10')][_0xaefd('0x11')]()===_0xaefd('0x12')&&!_0x16b36e[_0xaefd('0x13')]&&!_[_0xaefd('0x14')](_0x16b36e[_0xaefd('0x15')])){_0x54a3b1['OpenchannelInteraction'][_0xaefd('0x16')]({'where':{'id':_0x16b36e['OpenchannelInteractionId']}})[_0xaefd('0x17')](function(_0x1725af){if(_0x1725af){_0x1725af[_0xaefd('0x18')]({'lastMsgAt':_0x16b36e[_0xaefd('0x19')],'lastMsgDirection':_0x16b36e['direction'][_0xaefd('0x11')]()});}})[_0xaefd('0x1a')](function(_0x41f345){console[_0xaefd('0x1b')](_0x41f345);});}if(_0x16b36e[_0xaefd('0x10')]===_0xaefd('0x12')&&!_0x16b36e[_0xaefd('0x13')]){var _0x23d736;_0x54a3b1['CmContact'][_0xaefd('0x1c')]()[_0xaefd('0x17')](function(_0x9748f4){return _0x54a3b1[_0xaefd('0x1d')][_0xaefd('0x1e')]({'where':{'id':_0x16b36e[_0xaefd('0x1f')]},'include':[{'model':_0x54a3b1['OpenchannelInteraction'],'as':_0xaefd('0x20'),'where':{'id':_0x16b36e[_0xaefd('0x21')]},'limit':0x1,'include':[{'model':_0x54a3b1[_0xaefd('0x22')],'as':_0xaefd('0x23'),'attributes':_[_0xaefd('0x24')](_0x9748f4)}]}]});})[_0xaefd('0x17')](function(_0x5282ed){_0x23d736=_0x5282ed[_0xaefd('0xf')]({'plain':!![]});if(_0x23d736&&_0x23d736[_0xaefd('0x25')]){logger[_0xaefd('0x26')](_0xaefd('0x27'),_0xaefd('0x28'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x16b36e['id'],_0x23d736['replyUri']));if(_0x23d736[_0xaefd('0x20')]&&_0x23d736[_0xaefd('0x20')][_0xaefd('0x29')]){_0x16b36e['Interaction']=_[_0xaefd('0x2a')](_0x23d736['Interactions'][0x0],_0xaefd('0x23'));_0x16b36e[_0xaefd('0x23')]=_0x23d736[_0xaefd('0x20')][0x0]['Contact'];}var _0x4d44ed={'method':_0xaefd('0x2b'),'uri':encodeURI(_0x23d736[_0xaefd('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4d44ed[_0xaefd('0x2c')]){case _0xaefd('0x2d'):_0x4d44ed['qs']=_0x16b36e;break;case'POST':_0x4d44ed[_0xaefd('0xc')]=_0x16b36e;break;}return rp(_0x4d44ed)['then'](function(_0x810bf){logger[_0xaefd('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0xaefd('0x28'),util[_0xaefd('0x2e')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x16b36e['id'],_0x23d736[_0xaefd('0x25')]));if(_0x810bf[_0xaefd('0xc')][_0xaefd('0x2f')]&&_0x810bf['body'][_0xaefd('0x2f')]!=_0x16b36e['Interaction'][_0xaefd('0x2f')]){return _0x54a3b1['OpenchannelInteraction']['update']({'threadId':_0x810bf[_0xaefd('0xc')][_0xaefd('0x2f')]},{'logging':!![],'where':{'id':_0x16b36e['Interaction']['id']}});}else{return;}})['then'](function(){return _0x463ce7['update']({'read':!![]});})[_0xaefd('0x1a')](function(_0x280eab){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0xaefd('0x28'),util[_0xaefd('0x30')](_0x280eab,{'showHidden':![],'depth':null}));_0x48a255();});}else{_0x48a255();}})[_0xaefd('0x31')](function(){_0x48a255();});}else{_0x48a255();}}},'charset':_0xaefd('0x32'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index fd2b847..125a3a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x46f7e5,_0x57b9e7){var _0x3e81b0=function(_0x25c4a8){while(--_0x25c4a8){_0x46f7e5['push'](_0x46f7e5['shift']());}};_0x3e81b0(++_0x57b9e7);}(_0xadb5,0xad));var _0x5adb=function(_0x307bab,_0x259ba6){_0x307bab=_0x307bab-0x0;var _0x1c670f=_0xadb5[_0x307bab];return _0x1c670f;};'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});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});};
\ No newline at end of file
+var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0xfb43f8,_0x317a7a){var _0x33b435=function(_0x2b7b86){while(--_0x2b7b86){_0xfb43f8['push'](_0xfb43f8['shift']());}};_0x33b435(++_0x317a7a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});};
\ No newline at end of file
index 64217eb..67196f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cf5=['length','save','remove','update','emit','removeListener','register'];(function(_0x545dbe,_0x41afaa){var _0x2fc53a=function(_0x5d048d){while(--_0x5d048d){_0x545dbe['push'](_0x545dbe['shift']());}};_0x2fc53a(++_0x41afaa);}(_0x1cf5,0x78));var _0x51cf=function(_0x1a1e23,_0x3c2f9b){_0x1a1e23=_0x1a1e23-0x0;var _0x39d845=_0x1cf5[_0x1a1e23];return _0x39d845;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x51cf('0x0'),_0x51cf('0x1'),_0x51cf('0x2')];function createListener(_0x564cf8,_0x17a16d){return function(_0x55bc4a){_0x17a16d[_0x51cf('0x3')](_0x564cf8,_0x55bc4a);};}function removeListener(_0x283b8e,_0x235c0f){return function(){OpenchannelMessageEvents[_0x51cf('0x4')](_0x283b8e,_0x235c0f);};}exports[_0x51cf('0x5')]=function(_0x3f5b0f){for(var _0x23db61=0x0,_0x496b4a=events[_0x51cf('0x6')];_0x23db61<_0x496b4a;_0x23db61++){var _0x1ea4b1=events[_0x23db61];var _0x2659f8=createListener('openchannelMessage:'+_0x1ea4b1,_0x3f5b0f);OpenchannelMessageEvents['on'](_0x1ea4b1,_0x2659f8);}};
\ No newline at end of file
+var _0x544f=['removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit'];(function(_0x4968d6,_0x261a57){var _0x130aab=function(_0x205663){while(--_0x205663){_0x4968d6['push'](_0x4968d6['shift']());}};_0x130aab(++_0x261a57);}(_0x544f,0xbc));var _0xf544=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x544f[_0x31991b];return _0x307304;};'use strict';var OpenchannelMessageEvents=require(_0xf544('0x0'));var events=[_0xf544('0x1'),_0xf544('0x2'),'update'];function createListener(_0x2c66a8,_0x115277){return function(_0x46b7f0){_0x115277[_0xf544('0x3')](_0x2c66a8,_0x46b7f0);};}function removeListener(_0x57ce3f,_0x4a2100){return function(){OpenchannelMessageEvents[_0xf544('0x4')](_0x57ce3f,_0x4a2100);};}exports[_0xf544('0x5')]=function(_0x2f77e8){for(var _0x1b93c3=0x0,_0x57ff7a=events[_0xf544('0x6')];_0x1b93c3<_0x57ff7a;_0x1b93c3++){var _0xe67ba0=events[_0x1b93c3];var _0x53a698=createListener(_0xf544('0x7')+_0xe67ba0,_0x2f77e8);OpenchannelMessageEvents['on'](_0xe67ba0,_0x53a698);}};
\ No newline at end of file
index 8dafdf4..2a3f0a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9e6=['put','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','./openchannelQueue.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xd9e6,0x13c));var _0x6d9e=function(_0x5add95,_0x44d4ba){_0x5add95=_0x5add95-0x0;var _0x68f096=_0xd9e6[_0x5add95];return _0x68f096;};'use strict';var multer=require('multer');var util=require(_0x6d9e('0x0'));var path=require('path');var timeout=require(_0x6d9e('0x1'));var express=require('express');var router=express[_0x6d9e('0x2')]();var fs_extra=require(_0x6d9e('0x3'));var auth=require(_0x6d9e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6d9e('0x5'));router[_0x6d9e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6d9e('0x6')](_0x6d9e('0x7'),auth[_0x6d9e('0x8')](),controller[_0x6d9e('0x9')]);router[_0x6d9e('0x6')](_0x6d9e('0xa'),auth['isAuthenticated'](),controller[_0x6d9e('0xb')]);router[_0x6d9e('0x6')](_0x6d9e('0xc'),auth[_0x6d9e('0x8')](),controller['getMembers']);router[_0x6d9e('0x6')]('/:id/teams',auth[_0x6d9e('0x8')](),controller['getTeams']);router[_0x6d9e('0x6')](_0x6d9e('0xd'),auth[_0x6d9e('0x8')](),controller[_0x6d9e('0xe')]);router[_0x6d9e('0xf')]('/',auth[_0x6d9e('0x8')](),controller[_0x6d9e('0x10')]);router[_0x6d9e('0xf')](_0x6d9e('0x11'),auth[_0x6d9e('0x8')](),controller[_0x6d9e('0x12')]);router['post'](_0x6d9e('0xd'),auth[_0x6d9e('0x8')](),controller[_0x6d9e('0x13')]);router[_0x6d9e('0x14')](_0x6d9e('0xa'),auth[_0x6d9e('0x8')](),controller[_0x6d9e('0x15')]);router[_0x6d9e('0x16')](_0x6d9e('0xa'),auth[_0x6d9e('0x8')](),controller[_0x6d9e('0x17')]);router['delete'](_0x6d9e('0x11'),auth[_0x6d9e('0x8')](),controller['removeTeams']);router['delete'](_0x6d9e('0xd'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x3ccb=['getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers'];(function(_0x320ee1,_0xc23924){var _0x27f4bd=function(_0x3d41ca){while(--_0x3d41ca){_0x320ee1['push'](_0x320ee1['shift']());}};_0x27f4bd(++_0xc23924);}(_0x3ccb,0x1eb));var _0xb3cc=function(_0x126c0d,_0x1644a5){_0x126c0d=_0x126c0d-0x0;var _0x299c58=_0x3ccb[_0x126c0d];return _0x299c58;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb3cc('0x0'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb3cc('0x1'));var interaction=require(_0xb3cc('0x2'));var config=require(_0xb3cc('0x3'));var controller=require(_0xb3cc('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xb3cc('0x5')]);router[_0xb3cc('0x6')](_0xb3cc('0x7'),auth[_0xb3cc('0x8')](),controller[_0xb3cc('0x9')]);router[_0xb3cc('0x6')](_0xb3cc('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xb3cc('0x6')](_0xb3cc('0xb'),auth[_0xb3cc('0x8')](),controller[_0xb3cc('0xc')]);router['get']('/:id/teams',auth[_0xb3cc('0x8')](),controller[_0xb3cc('0xd')]);router['get'](_0xb3cc('0xe'),auth[_0xb3cc('0x8')](),controller[_0xb3cc('0xf')]);router['post']('/',auth[_0xb3cc('0x8')](),controller[_0xb3cc('0x10')]);router[_0xb3cc('0x11')]('/:id/teams',auth[_0xb3cc('0x8')](),controller[_0xb3cc('0x12')]);router[_0xb3cc('0x11')](_0xb3cc('0xe'),auth[_0xb3cc('0x8')](),controller[_0xb3cc('0x13')]);router[_0xb3cc('0x14')]('/:id',auth[_0xb3cc('0x8')](),controller[_0xb3cc('0x15')]);router[_0xb3cc('0x16')](_0xb3cc('0xa'),auth['isAuthenticated'](),controller[_0xb3cc('0x17')]);router[_0xb3cc('0x16')](_0xb3cc('0x18'),auth[_0xb3cc('0x8')](),controller[_0xb3cc('0x19')]);router[_0xb3cc('0x16')](_0xb3cc('0xe'),auth[_0xb3cc('0x8')](),controller[_0xb3cc('0x1a')]);module[_0xb3cc('0x1b')]=router;
\ No newline at end of file
index 298193b..988db9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x736d=['roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0xe4502,_0x3f9bbf){var _0x91b60=function(_0x13ce7a){while(--_0x13ce7a){_0xe4502['push'](_0xe4502['shift']());}};_0x91b60(++_0x3f9bbf);}(_0x736d,0x91));var _0xd736=function(_0x323fff,_0x38f93e){_0x323fff=_0x323fff-0x0;var _0x326de5=_0x736d[_0x323fff];return _0x326de5;};'use strict';var Sequelize=require(_0xd736('0x0'));module['exports']={'name':{'type':Sequelize[_0xd736('0x1')],'unique':_0xd736('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd736('0x1')]},'timeout':{'type':Sequelize[_0xd736('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd736('0x4')](_0xd736('0x5'),_0xd736('0x6'),_0xd736('0x7'))}};
\ No newline at end of file
+var _0x9119=['name','INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0x9119,0x85));var _0x9911=function(_0xb0114f,_0x18a8f9){_0xb0114f=_0xb0114f-0x0;var _0x41a68b=_0x9119[_0xb0114f];return _0x41a68b;};'use strict';var Sequelize=require(_0x9911('0x0'));module[_0x9911('0x1')]={'name':{'type':Sequelize[_0x9911('0x2')],'unique':_0x9911('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9911('0x2')]},'timeout':{'type':Sequelize[_0x9911('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9911('0x5')]('rrmemory',_0x9911('0x6'),_0x9911('0x7'))}};
\ No newline at end of file
index 013d94a..7af5e24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4644=['format','%s/%s','SIP','createdAt','getTeams','ids','Team','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','tq.TeamId','from','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','union','value','isEmpty','removeAgents','addAgents','isArray','userOpenchannelQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','OpenchannelQueues','sendStatus','error','stack','name','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','updatedAt'];(function(_0x4dfa7d,_0x169d7b){var _0x2736b5=function(_0x472712){while(--_0x472712){_0x4dfa7d['push'](_0x4dfa7d['shift']());}};_0x2736b5(++_0x169d7b);}(_0x4644,0xaa));var _0x4464=function(_0x431363,_0x10dc30){_0x431363=_0x431363-0x0;var _0x2bb93e=_0x4644[_0x431363];return _0x2bb93e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4464('0x0'));var zipdir=require(_0x4464('0x1'));var jsonpatch=require(_0x4464('0x2'));var rp=require(_0x4464('0x3'));var moment=require(_0x4464('0x4'));var BPromise=require(_0x4464('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4464('0x6'));var csv=require(_0x4464('0x7'));var ejs=require(_0x4464('0x8'));var fs=require('fs');var fs_extra=require(_0x4464('0x9'));var _=require(_0x4464('0xa'));var squel=require(_0x4464('0xb'));var crypto=require('crypto');var jsforce=require(_0x4464('0xc'));var deskjs=require(_0x4464('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4464('0xe'));var Papa=require(_0x4464('0xf'));var Redis=require(_0x4464('0x10'));var authService=require(_0x4464('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4464('0x12'));var hardwareService=require(_0x4464('0x13'));var logger=require('../../config/logger')(_0x4464('0x14'));var utils=require(_0x4464('0x15'));var config=require(_0x4464('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4464('0x17'))['db'];config[_0x4464('0x18')]=_[_0x4464('0x19')](config[_0x4464('0x18')],{'host':_0x4464('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4464('0x18')]));require(_0x4464('0x1b'))['register'](socket);function respondWithStatusCode(_0x2f8358,_0x37d321){_0x37d321=_0x37d321||0xcc;return function(_0x4e705a){if(_0x4e705a){return _0x2f8358['sendStatus'](_0x37d321);}return _0x2f8358[_0x4464('0x1c')](_0x37d321)[_0x4464('0x1d')]();};}function respondWithResult(_0x15f4ac,_0x5ce6bb){_0x5ce6bb=_0x5ce6bb||0xc8;return function(_0x5642c0){if(_0x5642c0){return _0x15f4ac[_0x4464('0x1c')](_0x5ce6bb)['json'](_0x5642c0);}};}function respondWithFilteredResult(_0x3a232c,_0x13c7ea){return function(_0x20e0db){if(_0x20e0db){var _0x3eda1a=typeof _0x13c7ea[_0x4464('0x1e')]==='undefined'&&typeof _0x13c7ea[_0x4464('0x1f')]===_0x4464('0x20');var _0x3cfcf6=_0x20e0db[_0x4464('0x21')];var _0x17d374=_0x3eda1a?0x0:_0x13c7ea[_0x4464('0x1e')];var _0x2f0795=_0x3eda1a?_0x20e0db[_0x4464('0x21')]:_0x13c7ea['offset']+_0x13c7ea[_0x4464('0x1f')];var _0x252d31;if(_0x2f0795>=_0x3cfcf6){_0x2f0795=_0x3cfcf6;_0x252d31=0xc8;}else{_0x252d31=0xce;}_0x3a232c[_0x4464('0x1c')](_0x252d31);return _0x3a232c[_0x4464('0x22')](_0x4464('0x23'),_0x17d374+'-'+_0x2f0795+'/'+_0x3cfcf6)[_0x4464('0x24')](_0x20e0db);}return null;};}function patchUpdates(_0x45e210){return function(_0x28ba33){try{jsonpatch[_0x4464('0x25')](_0x28ba33,_0x45e210,!![]);}catch(_0x1142ea){return BPromise[_0x4464('0x26')](_0x1142ea);}return _0x28ba33[_0x4464('0x27')]();};}function saveUpdates(_0x58cbee,_0x1b4774){return function(_0x8161b8){if(_0x8161b8){return _0x8161b8[_0x4464('0x28')](_0x58cbee)[_0x4464('0x29')](function(_0x3117d2){return _0x3117d2;});}return null;};}function removeEntity(_0x5dd7d3,_0x27cdfa){return function(_0x203911){if(_0x203911){return _0x203911[_0x4464('0x2a')]()[_0x4464('0x29')](function(){var _0x420808=_0x203911['get']({'plain':!![]});var _0x2a5a79=_0x4464('0x2b');return db['UserProfileResource'][_0x4464('0x2a')]({'where':{'type':_0x2a5a79,'resourceId':_0x420808['id']}})[_0x4464('0x29')](function(){return _0x203911;});})[_0x4464('0x29')](function(){_0x5dd7d3[_0x4464('0x1c')](0xcc)[_0x4464('0x1d')]();});}};}function handleEntityNotFound(_0x42bb16,_0x4622d5){return function(_0x1ec72f){if(!_0x1ec72f){_0x42bb16[_0x4464('0x2c')](0x194);}return _0x1ec72f;};}function handleError(_0x2358bd,_0x43bff6){_0x43bff6=_0x43bff6||0x1f4;return function(_0x4625aa){logger[_0x4464('0x2d')](_0x4625aa[_0x4464('0x2e')]);if(_0x4625aa[_0x4464('0x2f')]){delete _0x4625aa['name'];}_0x2358bd['status'](_0x43bff6)['send'](_0x4625aa);};}exports['index']=function(_0x561ce3,_0x1a190f){var _0x17a786={},_0x56ea45={},_0x4c6dce={'count':0x0,'rows':[]};var _0x3d3087=_[_0x4464('0x30')](db[_0x4464('0x31')][_0x4464('0x32')],function(_0x325152){return{'name':_0x325152[_0x4464('0x33')],'type':_0x325152[_0x4464('0x34')][_0x4464('0x35')]};});_0x56ea45[_0x4464('0x36')]=_[_0x4464('0x30')](_0x3d3087,'name');_0x56ea45[_0x4464('0x37')]=_[_0x4464('0x38')](_0x561ce3[_0x4464('0x37')]);_0x56ea45[_0x4464('0x39')]=_[_0x4464('0x3a')](_0x56ea45[_0x4464('0x36')],_0x56ea45[_0x4464('0x37')]);_0x17a786['attributes']=_[_0x4464('0x3a')](_0x56ea45[_0x4464('0x36')],qs[_0x4464('0x3b')](_0x561ce3[_0x4464('0x37')][_0x4464('0x3b')]));_0x17a786[_0x4464('0x3c')]=_0x17a786[_0x4464('0x3c')]['length']?_0x17a786[_0x4464('0x3c')]:_0x56ea45['model'];if(!_0x561ce3[_0x4464('0x37')][_0x4464('0x3d')](_0x4464('0x3e'))){_0x17a786[_0x4464('0x1f')]=qs['limit'](_0x561ce3[_0x4464('0x37')][_0x4464('0x1f')]);_0x17a786[_0x4464('0x1e')]=qs['offset'](_0x561ce3['query'][_0x4464('0x1e')]);}_0x17a786[_0x4464('0x3f')]=qs[_0x4464('0x40')](_0x561ce3[_0x4464('0x37')][_0x4464('0x40')]);_0x17a786[_0x4464('0x41')]=qs[_0x4464('0x39')](_[_0x4464('0x42')](_0x561ce3[_0x4464('0x37')],_0x56ea45['filters']),_0x3d3087);if(_0x561ce3[_0x4464('0x37')]['filter']){_0x17a786[_0x4464('0x41')]=_[_0x4464('0x43')](_0x17a786[_0x4464('0x41')],{'$or':_[_0x4464('0x30')](_0x3d3087,function(_0x2f9187){if(_0x2f9187[_0x4464('0x34')]!==_0x4464('0x44')){var _0x2e1e6c={};_0x2e1e6c[_0x2f9187[_0x4464('0x2f')]]={'$like':'%'+_0x561ce3['query'][_0x4464('0x45')]+'%'};return _0x2e1e6c;}})});}_0x17a786=_['merge']({},_0x17a786,_0x561ce3[_0x4464('0x46')]);var _0x2f1d28={'where':_0x17a786[_0x4464('0x41')]};return db[_0x4464('0x31')][_0x4464('0x21')](_0x2f1d28)[_0x4464('0x29')](function(_0x2b41a1){_0x4c6dce[_0x4464('0x21')]=_0x2b41a1;if(_0x561ce3[_0x4464('0x37')][_0x4464('0x47')]){_0x17a786[_0x4464('0x48')]=[{'all':!![]}];}return db[_0x4464('0x31')][_0x4464('0x49')](_0x17a786);})[_0x4464('0x29')](function(_0x1010d4){_0x4c6dce[_0x4464('0x4a')]=_0x1010d4;return _0x4c6dce;})[_0x4464('0x29')](respondWithFilteredResult(_0x1a190f,_0x17a786))[_0x4464('0x4b')](handleError(_0x1a190f,null));};exports[_0x4464('0x4c')]=function(_0x3657a2,_0x5d0e3a){var _0x4159c3={'raw':!![],'where':{'id':_0x3657a2['params']['id']}},_0x845b39={};_0x845b39[_0x4464('0x36')]=_['keys'](db[_0x4464('0x31')][_0x4464('0x32')]);_0x845b39[_0x4464('0x37')]=_['keys'](_0x3657a2[_0x4464('0x37')]);_0x845b39['filters']=_[_0x4464('0x3a')](_0x845b39['model'],_0x845b39['query']);_0x4159c3[_0x4464('0x3c')]=_['intersection'](_0x845b39[_0x4464('0x36')],qs['fields'](_0x3657a2[_0x4464('0x37')][_0x4464('0x3b')]));_0x4159c3[_0x4464('0x3c')]=_0x4159c3['attributes'][_0x4464('0x4d')]?_0x4159c3[_0x4464('0x3c')]:_0x845b39[_0x4464('0x36')];if(_0x3657a2[_0x4464('0x37')]['includeAll']){_0x4159c3[_0x4464('0x48')]=[{'all':!![]}];}_0x4159c3=_[_0x4464('0x43')]({},_0x4159c3,_0x3657a2['options']);return db['OpenchannelQueue'][_0x4464('0x4e')](_0x4159c3)[_0x4464('0x29')](handleEntityNotFound(_0x5d0e3a,null))[_0x4464('0x29')](respondWithResult(_0x5d0e3a,null))['catch'](handleError(_0x5d0e3a,null));};exports[_0x4464('0x4f')]=function(_0x270b90,_0x22cb19){return db[_0x4464('0x31')][_0x4464('0x4f')](_0x270b90[_0x4464('0x50')],{})[_0x4464('0x29')](function(_0x2987a5){var _0x29cf60=_0x270b90[_0x4464('0x51')][_0x4464('0x52')]({'plain':!![]});if(!_0x29cf60)throw new Error(_0x4464('0x53'));if(_0x29cf60[_0x4464('0x54')]===_0x4464('0x51')){var _0x1f5d76=_0x2987a5[_0x4464('0x52')]({'plain':!![]});var _0x4ef292='OpenchannelQueues';return db['UserProfileSection'][_0x4464('0x4e')]({'where':{'name':_0x4ef292,'userProfileId':_0x29cf60[_0x4464('0x55')]},'raw':!![]})['then'](function(_0x5307f3){if(_0x5307f3&&_0x5307f3[_0x4464('0x56')]===0x0){return db[_0x4464('0x57')]['create']({'name':_0x1f5d76['name'],'resourceId':_0x1f5d76['id'],'type':_0x5307f3['name'],'sectionId':_0x5307f3['id']},{})[_0x4464('0x29')](function(){return _0x2987a5;});}else{return _0x2987a5;}})['catch'](function(_0x81d11){logger[_0x4464('0x2d')](_0x4464('0x58'),_0x81d11);throw _0x81d11;});}return _0x2987a5;})['then'](respondWithResult(_0x22cb19,0xc9))[_0x4464('0x4b')](handleError(_0x22cb19,null));};exports['update']=function(_0x39d4cb,_0x5a0959){if(_0x39d4cb[_0x4464('0x50')]['id']){delete _0x39d4cb[_0x4464('0x50')]['id'];}return db[_0x4464('0x31')][_0x4464('0x4e')]({'where':{'id':_0x39d4cb['params']['id']}})[_0x4464('0x29')](handleEntityNotFound(_0x5a0959,null))['then'](saveUpdates(_0x39d4cb[_0x4464('0x50')],null))[_0x4464('0x29')](respondWithResult(_0x5a0959,null))[_0x4464('0x4b')](handleError(_0x5a0959,null));};exports[_0x4464('0x2a')]=function(_0x5d96bb,_0x13424f){return db['OpenchannelQueue'][_0x4464('0x4e')]({'where':{'id':_0x5d96bb[_0x4464('0x59')]['id']}})[_0x4464('0x29')](handleEntityNotFound(_0x13424f,null))[_0x4464('0x29')](removeEntity(_0x13424f,null))[_0x4464('0x4b')](handleError(_0x13424f,null));};exports[_0x4464('0x5a')]=function(_0x17538f,_0x412f0a){return db[_0x4464('0x31')][_0x4464('0x5a')]()[_0x4464('0x29')](respondWithResult(_0x412f0a,null))[_0x4464('0x4b')](handleError(_0x412f0a,null));};exports[_0x4464('0x5b')]=function(_0xcc7ff3,_0x4c6e43,_0xc453af){var _0x37079d={'raw':!![],'where':{}},_0x47316e={},_0x52dee5;return db[_0x4464('0x31')][_0x4464('0x5c')]({'where':{'id':_0xcc7ff3['params']['id']}})[_0x4464('0x29')](handleEntityNotFound(_0x4c6e43,null))[_0x4464('0x29')](function(_0x480a2e){if(_0x480a2e){_0x52dee5=_0x480a2e[_0x4464('0x52')]({'plain':!![]});_0x47316e[_0x4464('0x36')]=_[_0x4464('0x38')](db[_0x4464('0x5d')][_0x4464('0x32')]);_0x47316e[_0x4464('0x37')]=_[_0x4464('0x38')](_0xcc7ff3['query']);_0x47316e['filters']=_['intersection'](_0x47316e[_0x4464('0x36')],_0x47316e['query']);_0x37079d[_0x4464('0x3c')]=_[_0x4464('0x3a')](_0x47316e[_0x4464('0x36')],qs[_0x4464('0x3b')](_0xcc7ff3[_0x4464('0x37')][_0x4464('0x3b')]));_0x37079d[_0x4464('0x3c')]=_0x37079d[_0x4464('0x3c')][_0x4464('0x4d')]?_0x37079d[_0x4464('0x3c')]:_0x47316e[_0x4464('0x36')];if(!_0xcc7ff3[_0x4464('0x37')]['hasOwnProperty'](_0x4464('0x3e'))){_0x37079d[_0x4464('0x1f')]=qs[_0x4464('0x1f')](_0xcc7ff3[_0x4464('0x37')][_0x4464('0x1f')]);_0x37079d[_0x4464('0x1e')]=qs['offset'](_0xcc7ff3['query'][_0x4464('0x1e')]);}_0x37079d[_0x4464('0x3f')]=qs[_0x4464('0x40')](_0xcc7ff3['query'][_0x4464('0x40')]);_0x37079d[_0x4464('0x41')]=qs[_0x4464('0x39')](_['pick'](_0xcc7ff3['query'],_0x47316e['filters']));_0x37079d[_0x4464('0x41')][_0x4464('0x5e')]=_0x480a2e['id'];if(_0xcc7ff3['query'][_0x4464('0x45')]){_0x37079d['where']=_['merge'](_0x37079d[_0x4464('0x41')],{'$or':_[_0x4464('0x30')](_0x37079d[_0x4464('0x3c')],function(_0x470a33){var _0x42c464={};_0x42c464[_0x470a33]={'$like':'%'+_0xcc7ff3['query'][_0x4464('0x45')]+'%'};return _0x42c464;})});}_0x37079d=_[_0x4464('0x43')]({},_0x37079d,_0xcc7ff3[_0x4464('0x46')]);return db[_0x4464('0x5d')][_0x4464('0x49')](_0x37079d);}})[_0x4464('0x29')](function(_0x38e9cd){if(_0x38e9cd){return db[_0x4464('0x5f')][_0x4464('0x60')]({'where':{'id':_['map'](_0x38e9cd,'UserId'),'role':_0x4464('0x61')},'attributes':['id','name',_0x4464('0x62'),_0x4464('0x63'),'createdAt']});}})[_0x4464('0x29')](function(_0x49f812){if(_0x49f812){return{'count':_0x49f812[_0x4464('0x21')],'rows':_[_0x4464('0x30')](_0x49f812['rows'],function(_0xa4285d){return{'membername':_0xa4285d[_0x4464('0x2f')],'UserId':_0xa4285d['id'],'queue_name':_0x52dee5[_0x4464('0x2f')],'OpenchannelQueueId':_0x52dee5['id'],'interface':util[_0x4464('0x64')](_0x4464('0x65'),_0x4464('0x66'),_0xa4285d[_0x4464('0x2f')]),'penalty':0x0,'paused':_0xa4285d[_0x4464('0x62')],'createdAt':_0xa4285d[_0x4464('0x67')],'updatedAt':_0xa4285d[_0x4464('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4c6e43,_0x37079d))[_0x4464('0x4b')](handleError(_0x4c6e43,null));};exports[_0x4464('0x68')]=function(_0x2a4b0e,_0x9c9a3a,_0x56eeab){var _0x4d5394={};var _0x37a1d8={};var _0x184d39;var _0x7bcc85;return db[_0x4464('0x31')][_0x4464('0x5c')]({'where':{'id':_0x2a4b0e[_0x4464('0x59')]['id']}})[_0x4464('0x29')](handleEntityNotFound(_0x9c9a3a,null))[_0x4464('0x29')](function(_0x4fb6ef){if(_0x4fb6ef){_0x184d39=_0x4fb6ef;_0x37a1d8[_0x4464('0x36')]=_[_0x4464('0x38')](db['Team'][_0x4464('0x32')]);_0x37a1d8[_0x4464('0x37')]=_[_0x4464('0x38')](_0x2a4b0e[_0x4464('0x37')]);_0x37a1d8[_0x4464('0x39')]=_['intersection'](_0x37a1d8['model'],_0x37a1d8['query']);_0x4d5394['attributes']=_['intersection'](_0x37a1d8[_0x4464('0x36')],qs[_0x4464('0x3b')](_0x2a4b0e['query'][_0x4464('0x3b')]));_0x4d5394[_0x4464('0x3c')]=_0x4d5394['attributes'][_0x4464('0x4d')]?_0x4d5394['attributes']:_0x37a1d8[_0x4464('0x36')];_0x4d5394['order']=qs[_0x4464('0x40')](_0x2a4b0e['query'][_0x4464('0x40')]);_0x4d5394[_0x4464('0x41')]=qs[_0x4464('0x39')](_[_0x4464('0x42')](_0x2a4b0e[_0x4464('0x37')],_0x37a1d8['filters']));if(_0x2a4b0e['query']['filter']){_0x4d5394['where']=_[_0x4464('0x43')](_0x4d5394['where'],{'$or':_[_0x4464('0x30')](_0x4d5394[_0x4464('0x3c')],function(_0xef927e){var _0x13ec45={};_0x13ec45[_0xef927e]={'$like':'%'+_0x2a4b0e[_0x4464('0x37')]['filter']+'%'};return _0x13ec45;})});}_0x4d5394=_[_0x4464('0x43')]({},_0x4d5394,_0x2a4b0e[_0x4464('0x46')]);return _0x184d39[_0x4464('0x68')](_0x4d5394);}})[_0x4464('0x29')](function(_0x2b9677){if(_0x2b9677){_0x7bcc85=_0x2b9677[_0x4464('0x4d')];if(!_0x2a4b0e[_0x4464('0x37')][_0x4464('0x3d')](_0x4464('0x3e'))){_0x4d5394['limit']=qs['limit'](_0x2a4b0e['query'][_0x4464('0x1f')]);_0x4d5394[_0x4464('0x1e')]=qs[_0x4464('0x1e')](_0x2a4b0e[_0x4464('0x37')][_0x4464('0x1e')]);}return _0x184d39[_0x4464('0x68')](_0x4d5394);}})[_0x4464('0x29')](function(_0x408151){if(_0x408151){return _0x408151?{'count':_0x7bcc85,'rows':_0x408151}:null;}})['then'](respondWithResult(_0x9c9a3a,null))['catch'](handleError(_0x9c9a3a,null));};exports['addTeams']=function(_0x2b5500,_0x259fb8,_0x1aed77){var _0x2a3e14=_0x2b5500[_0x4464('0x50')][_0x4464('0x69')];return db[_0x4464('0x6a')][_0x4464('0x49')]({'where':{'id':_0x2a3e14},'attributes':['id'],'include':[{'model':db[_0x4464('0x5f')],'as':'Agents','attributes':['id',_0x4464('0x2f'),_0x4464('0x6b'),_0x4464('0x6c'),_0x4464('0x6d')],'raw':!![]}]})['then'](function(_0xafc72){if(_0xafc72){var _0x137903=_[_0x4464('0x6e')](_0xafc72,function(_0x162d69){var _0x18bcfb=_0x162d69['get']({'plain':!![]});return _0x18bcfb[_0x4464('0x6f')];});return db[_0x4464('0x31')]['find']({'where':{'id':_0x2b5500['params']['id']}})['then'](function(_0x58e860){return db['sequelize'][_0x4464('0x70')](function(_0xaa3fec){return _0x58e860['addTeams'](_0x2a3e14,{'transaction':_0xaa3fec})[_0x4464('0x29')](function(){return BPromise[_0x4464('0x71')](_0x137903,function(_0x99b23c){return db['UserOpenchannelQueue'][_0x4464('0x72')]({'where':{'UserId':_0x99b23c['id'],'OpenchannelQueueId':_0x2b5500[_0x4464('0x59')]['id']},'transaction':_0xaa3fec});});})[_0x4464('0x29')](function(){_0x137903[_0x4464('0x73')](function(_0x547e6f){socket[_0x4464('0x74')]('userOpenchannelQueue:save',{'UserId':_0x547e6f['id'],'OpenchannelQueueId':_0x58e860['id']});});});});});}})['then'](respondWithStatusCode(_0x259fb8,null))['catch'](handleError(_0x259fb8,null));};exports[_0x4464('0x75')]=function(_0x511cc4,_0x3d19bc,_0x402187){return db['Team'][_0x4464('0x49')]({'where':{'id':_0x511cc4[_0x4464('0x37')][_0x4464('0x69')]},'attributes':['id'],'include':[{'model':db[_0x4464('0x5f')],'as':_0x4464('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x4464('0x29')](handleEntityNotFound(_0x3d19bc,null))[_0x4464('0x29')](function(_0x2ad979){var _0x26d087=_[_0x4464('0x30')](_0x2ad979,'id');var _0x540829=[];var _0x6bdab7=[];var _0x267113=squel['select']();_0x267113['field'](_0x4464('0x76'))[_0x4464('0x77')]('team_has_openchannel_queues','tq')['join'](_0x4464('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x4464('0x79'),_0x511cc4[_0x4464('0x59')]['id']);for(var _0x14559c=0x0;_0x14559c<_0x2ad979[_0x4464('0x4d')];_0x14559c+=0x1){let _0x46e590=_0x2ad979[_0x14559c];for(var _0x463545=0x0;_0x463545<_0x46e590[_0x4464('0x6f')][_0x4464('0x4d')];_0x463545+=0x1){let _0x31efb7=_0x46e590[_0x4464('0x6f')][_0x463545];var _0x49770b=_0x267113['clone']();_0x49770b[_0x4464('0x41')](_0x4464('0x7a'),_0x31efb7['id']);_0x6bdab7[_0x4464('0x7b')](db[_0x4464('0x7c')][_0x4464('0x37')](_0x49770b[_0x4464('0x7d')](),{'type':db['sequelize'][_0x4464('0x7e')]['SELECT']})['then'](function(_0x42fe23){if(_0x42fe23[_0x4464('0x4d')]===0x1){return _0x31efb7['id'];}else{var _0x3bc9c5=_['every'](_[_0x4464('0x30')](_0x42fe23,'TeamId'),function(_0x543f6c){return _['includes'](_0x26d087,_0x543f6c);});if(_0x3bc9c5){return _0x31efb7['id'];}}}));}}return BPromise['all'](_0x6bdab7)[_0x4464('0x29')](function(_0x999102){_0x540829=_(_0x540829)[_0x4464('0x7f')](_0x999102)['compact']()[_0x4464('0x80')]();return db['OpenchannelQueue'][_0x4464('0x4e')]({'where':{'id':_0x511cc4[_0x4464('0x59')]['id']}})[_0x4464('0x29')](function(_0x22cdb3){return db[_0x4464('0x7c')][_0x4464('0x70')](function(_0x1ce8df){return _0x22cdb3['removeTeams'](_0x511cc4['query']['ids'],{'transaction':_0x1ce8df})[_0x4464('0x29')](function(){if(!_[_0x4464('0x81')](_0x540829)){return _0x22cdb3[_0x4464('0x82')](_0x540829,{'transaction':_0x1ce8df});}})[_0x4464('0x29')](function(){_0x540829[_0x4464('0x73')](function(_0x223688){socket[_0x4464('0x74')]('userOpenchannelQueue:remove',{'UserId':_0x223688,'OpenchannelQueueId':_0x22cdb3['id']});});});});});});})[_0x4464('0x29')](respondWithStatusCode(_0x3d19bc,null))[_0x4464('0x4b')](handleError(_0x3d19bc,null));};exports[_0x4464('0x83')]=function(_0x1fa9ae,_0x58eac9,_0x3a7945){return db[_0x4464('0x31')]['find']({'where':{'id':_0x1fa9ae[_0x4464('0x59')]['id']}})['then'](handleEntityNotFound(_0x58eac9,null))[_0x4464('0x29')](function(_0xf3a7e3){if(_0xf3a7e3){return _0xf3a7e3[_0x4464('0x83')](_0x1fa9ae['body']['ids'],_['omit'](_0x1fa9ae[_0x4464('0x50')],[_0x4464('0x69'),'id'])||{})['spread'](function(_0x1116e2){for(var _0x56ed3d=0x0;_0x56ed3d<_0x1fa9ae[_0x4464('0x50')][_0x4464('0x69')][_0x4464('0x4d')];_0x56ed3d+=0x1){socket[_0x4464('0x74')]('userOpenchannelQueue:save',{'UserId':Number(_0x1fa9ae[_0x4464('0x50')][_0x4464('0x69')][_0x56ed3d]),'OpenchannelQueueId':Number(_0x1fa9ae['params']['id'])});}return _0x1116e2;});}})[_0x4464('0x29')](respondWithResult(_0x58eac9,null))['catch'](handleError(_0x58eac9,null));};exports[_0x4464('0x82')]=function(_0x1ac107,_0x269cf9,_0x275d32){return db[_0x4464('0x31')][_0x4464('0x4e')]({'where':{'id':_0x1ac107[_0x4464('0x59')]['id']}})[_0x4464('0x29')](handleEntityNotFound(_0x269cf9,null))[_0x4464('0x29')](function(_0x5e9fe3){if(_0x5e9fe3){return _0x5e9fe3[_0x4464('0x82')](_0x1ac107[_0x4464('0x37')][_0x4464('0x69')])['then'](function(){if(_[_0x4464('0x84')](_0x1ac107[_0x4464('0x37')][_0x4464('0x69')])){for(var _0x294c57=0x0;_0x294c57<_0x1ac107[_0x4464('0x37')][_0x4464('0x69')][_0x4464('0x4d')];_0x294c57+=0x1){socket[_0x4464('0x74')](_0x4464('0x85'),{'UserId':Number(_0x1ac107[_0x4464('0x37')][_0x4464('0x69')][_0x294c57]),'OpenchannelQueueId':Number(_0x1ac107[_0x4464('0x59')]['id'])});}}else{socket[_0x4464('0x74')](_0x4464('0x85'),{'UserId':Number(_0x1ac107['query'][_0x4464('0x69')]),'OpenchannelQueueId':Number(_0x1ac107[_0x4464('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x269cf9,null))['catch'](handleError(_0x269cf9,null));};exports[_0x4464('0x86')]=function(_0x5bdf08,_0x5b3bf4,_0x45fba4){var _0x5412b3={};var _0x3d07e2={};var _0x4ace8a;var _0x2d8b5d;return db['OpenchannelQueue'][_0x4464('0x5c')]({'where':{'id':_0x5bdf08[_0x4464('0x59')]['id']}})[_0x4464('0x29')](handleEntityNotFound(_0x5b3bf4,null))[_0x4464('0x29')](function(_0x22a0eb){if(_0x22a0eb){_0x4ace8a=_0x22a0eb;_0x3d07e2['model']=_['keys'](db[_0x4464('0x5f')][_0x4464('0x32')]);_0x3d07e2[_0x4464('0x37')]=_[_0x4464('0x38')](_0x5bdf08['query']);_0x3d07e2[_0x4464('0x39')]=_[_0x4464('0x3a')](_0x3d07e2['model'],_0x3d07e2[_0x4464('0x37')]);_0x5412b3[_0x4464('0x3c')]=_[_0x4464('0x3a')](_0x3d07e2[_0x4464('0x36')],qs[_0x4464('0x3b')](_0x5bdf08[_0x4464('0x37')][_0x4464('0x3b')]));_0x5412b3[_0x4464('0x3c')]=_0x5412b3[_0x4464('0x3c')][_0x4464('0x4d')]?_0x5412b3['attributes']:_0x3d07e2[_0x4464('0x36')];_0x5412b3[_0x4464('0x3f')]=qs[_0x4464('0x40')](_0x5bdf08[_0x4464('0x37')][_0x4464('0x40')]);_0x5412b3[_0x4464('0x41')]=qs['filters'](_[_0x4464('0x42')](_0x5bdf08[_0x4464('0x37')],_0x3d07e2[_0x4464('0x39')]));if(_0x5bdf08['query'][_0x4464('0x45')]){_0x5412b3[_0x4464('0x41')]=_[_0x4464('0x43')](_0x5412b3[_0x4464('0x41')],{'$or':_[_0x4464('0x30')](_0x5412b3['attributes'],function(_0xc105ca){var _0x29167e={};_0x29167e[_0xc105ca]={'$like':'%'+_0x5bdf08[_0x4464('0x37')][_0x4464('0x45')]+'%'};return _0x29167e;})});}_0x5412b3=_[_0x4464('0x43')]({},_0x5412b3,_0x5bdf08[_0x4464('0x46')]);return _0x4ace8a[_0x4464('0x86')](_0x5412b3);}})[_0x4464('0x29')](function(_0x1f4bf9){if(_0x1f4bf9){_0x2d8b5d=_0x1f4bf9['length'];if(!_0x5bdf08['query']['hasOwnProperty'](_0x4464('0x3e'))){_0x5412b3['limit']=qs[_0x4464('0x1f')](_0x5bdf08['query'][_0x4464('0x1f')]);_0x5412b3[_0x4464('0x1e')]=qs[_0x4464('0x1e')](_0x5bdf08['query']['offset']);}return _0x4ace8a[_0x4464('0x86')](_0x5412b3);}})[_0x4464('0x29')](function(_0x5f10f2){if(_0x5f10f2){return _0x5f10f2?{'count':_0x2d8b5d,'rows':_0x5f10f2}:null;}})[_0x4464('0x29')](respondWithResult(_0x5b3bf4,null))[_0x4464('0x4b')](handleError(_0x5b3bf4,null));};
\ No newline at end of file
+var _0xccce=['options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserOpenchannelQueue','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','ids','Team','User','Agents','online','voicePause','interface','transaction','addTeams','each','emit','userOpenchannelQueue:save','removeTeams','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','order','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','end','stack','name','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','filter','merge','includeAll','include','OpenchannelQueue','findAll','rows','catch','show','length'];(function(_0x200827,_0x4af951){var _0x120047=function(_0x4431de){while(--_0x4431de){_0x200827['push'](_0x200827['shift']());}};_0x120047(++_0x4af951);}(_0xccce,0x155));var _0xeccc=function(_0x12ef95,_0x1040e3){_0x12ef95=_0x12ef95-0x0;var _0x43a9a9=_0xccce[_0x12ef95];return _0x43a9a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeccc('0x0'));var zipdir=require(_0xeccc('0x1'));var jsonpatch=require(_0xeccc('0x2'));var rp=require(_0xeccc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeccc('0x4'));var util=require(_0xeccc('0x5'));var path=require('path');var sox=require(_0xeccc('0x6'));var csv=require(_0xeccc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeccc('0x8'));var squel=require(_0xeccc('0x9'));var crypto=require(_0xeccc('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeccc('0x7'));var querystring=require(_0xeccc('0xb'));var Papa=require(_0xeccc('0xc'));var Redis=require(_0xeccc('0xd'));var authService=require(_0xeccc('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeccc('0xf'));var logger=require('../../config/logger')(_0xeccc('0x10'));var utils=require(_0xeccc('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xeccc('0x12'));var db=require(_0xeccc('0x13'))['db'];config[_0xeccc('0x14')]=_[_0xeccc('0x15')](config['redis'],{'host':_0xeccc('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeccc('0x14')]));require(_0xeccc('0x17'))['register'](socket);function respondWithStatusCode(_0x20f937,_0x304c61){_0x304c61=_0x304c61||0xcc;return function(_0x3a26a6){if(_0x3a26a6){return _0x20f937[_0xeccc('0x18')](_0x304c61);}return _0x20f937['status'](_0x304c61)['end']();};}function respondWithResult(_0x78a811,_0xc7eb06){_0xc7eb06=_0xc7eb06||0xc8;return function(_0x3990b2){if(_0x3990b2){return _0x78a811[_0xeccc('0x19')](_0xc7eb06)[_0xeccc('0x1a')](_0x3990b2);}};}function respondWithFilteredResult(_0x5b2003,_0xe39ff8){return function(_0x37bf43){if(_0x37bf43){var _0x3692e4=typeof _0xe39ff8[_0xeccc('0x1b')]==='undefined'&&typeof _0xe39ff8[_0xeccc('0x1c')]===_0xeccc('0x1d');var _0x5b175f=_0x37bf43[_0xeccc('0x1e')];var _0x3f94de=_0x3692e4?0x0:_0xe39ff8[_0xeccc('0x1b')];var _0x381f6a=_0x3692e4?_0x37bf43['count']:_0xe39ff8[_0xeccc('0x1b')]+_0xe39ff8[_0xeccc('0x1c')];var _0x1c3fa2;if(_0x381f6a>=_0x5b175f){_0x381f6a=_0x5b175f;_0x1c3fa2=0xc8;}else{_0x1c3fa2=0xce;}_0x5b2003[_0xeccc('0x19')](_0x1c3fa2);return _0x5b2003[_0xeccc('0x1f')](_0xeccc('0x20'),_0x3f94de+'-'+_0x381f6a+'/'+_0x5b175f)[_0xeccc('0x1a')](_0x37bf43);}return null;};}function patchUpdates(_0x335cfe){return function(_0x2cf397){try{jsonpatch[_0xeccc('0x21')](_0x2cf397,_0x335cfe,!![]);}catch(_0x1e9e10){return BPromise[_0xeccc('0x22')](_0x1e9e10);}return _0x2cf397[_0xeccc('0x23')]();};}function saveUpdates(_0x17e7da,_0x19c1c7){return function(_0x4c7970){if(_0x4c7970){return _0x4c7970[_0xeccc('0x24')](_0x17e7da)[_0xeccc('0x25')](function(_0x1c5c60){return _0x1c5c60;});}return null;};}function removeEntity(_0x4c8116,_0x523cac){return function(_0x2f6dc5){if(_0x2f6dc5){return _0x2f6dc5[_0xeccc('0x26')]()[_0xeccc('0x25')](function(){var _0x6d6a4c=_0x2f6dc5['get']({'plain':!![]});var _0x5f3c87=_0xeccc('0x27');return db[_0xeccc('0x28')]['destroy']({'where':{'type':_0x5f3c87,'resourceId':_0x6d6a4c['id']}})[_0xeccc('0x25')](function(){return _0x2f6dc5;});})['then'](function(){_0x4c8116[_0xeccc('0x19')](0xcc)[_0xeccc('0x29')]();});}};}function handleEntityNotFound(_0x58bec1,_0x2c2a76){return function(_0x575c12){if(!_0x575c12){_0x58bec1[_0xeccc('0x18')](0x194);}return _0x575c12;};}function handleError(_0x99bcd3,_0x201152){_0x201152=_0x201152||0x1f4;return function(_0x3e09d8){logger['error'](_0x3e09d8[_0xeccc('0x2a')]);if(_0x3e09d8[_0xeccc('0x2b')]){delete _0x3e09d8['name'];}_0x99bcd3['status'](_0x201152)[_0xeccc('0x2c')](_0x3e09d8);};}exports[_0xeccc('0x2d')]=function(_0x54c3a1,_0x59ef3f){var _0x16a22c={},_0x1b7aec={},_0x51bce3={'count':0x0,'rows':[]};var _0x4847df=_['map'](db['OpenchannelQueue'][_0xeccc('0x2e')],function(_0x261c99){return{'name':_0x261c99['fieldName'],'type':_0x261c99[_0xeccc('0x2f')][_0xeccc('0x30')]};});_0x1b7aec[_0xeccc('0x31')]=_['map'](_0x4847df,_0xeccc('0x2b'));_0x1b7aec[_0xeccc('0x32')]=_[_0xeccc('0x33')](_0x54c3a1[_0xeccc('0x32')]);_0x1b7aec[_0xeccc('0x34')]=_['intersection'](_0x1b7aec[_0xeccc('0x31')],_0x1b7aec['query']);_0x16a22c['attributes']=_[_0xeccc('0x35')](_0x1b7aec[_0xeccc('0x31')],qs[_0xeccc('0x36')](_0x54c3a1[_0xeccc('0x32')][_0xeccc('0x36')]));_0x16a22c[_0xeccc('0x37')]=_0x16a22c[_0xeccc('0x37')]['length']?_0x16a22c[_0xeccc('0x37')]:_0x1b7aec[_0xeccc('0x31')];if(!_0x54c3a1['query'][_0xeccc('0x38')](_0xeccc('0x39'))){_0x16a22c[_0xeccc('0x1c')]=qs[_0xeccc('0x1c')](_0x54c3a1[_0xeccc('0x32')][_0xeccc('0x1c')]);_0x16a22c['offset']=qs[_0xeccc('0x1b')](_0x54c3a1[_0xeccc('0x32')][_0xeccc('0x1b')]);}_0x16a22c['order']=qs[_0xeccc('0x3a')](_0x54c3a1[_0xeccc('0x32')]['sort']);_0x16a22c[_0xeccc('0x3b')]=qs['filters'](_[_0xeccc('0x3c')](_0x54c3a1[_0xeccc('0x32')],_0x1b7aec[_0xeccc('0x34')]),_0x4847df);if(_0x54c3a1['query']['filter']){_0x16a22c[_0xeccc('0x3b')]=_['merge'](_0x16a22c[_0xeccc('0x3b')],{'$or':_[_0xeccc('0x3d')](_0x4847df,function(_0x475ee9){if(_0x475ee9['type']!==_0xeccc('0x3e')){var _0x64d443={};_0x64d443[_0x475ee9['name']]={'$like':'%'+_0x54c3a1['query'][_0xeccc('0x3f')]+'%'};return _0x64d443;}})});}_0x16a22c=_[_0xeccc('0x40')]({},_0x16a22c,_0x54c3a1['options']);var _0x1fd658={'where':_0x16a22c[_0xeccc('0x3b')]};return db['OpenchannelQueue'][_0xeccc('0x1e')](_0x1fd658)[_0xeccc('0x25')](function(_0x15a53b){_0x51bce3[_0xeccc('0x1e')]=_0x15a53b;if(_0x54c3a1[_0xeccc('0x32')][_0xeccc('0x41')]){_0x16a22c[_0xeccc('0x42')]=[{'all':!![]}];}return db[_0xeccc('0x43')][_0xeccc('0x44')](_0x16a22c);})[_0xeccc('0x25')](function(_0x40680a){_0x51bce3[_0xeccc('0x45')]=_0x40680a;return _0x51bce3;})[_0xeccc('0x25')](respondWithFilteredResult(_0x59ef3f,_0x16a22c))[_0xeccc('0x46')](handleError(_0x59ef3f,null));};exports[_0xeccc('0x47')]=function(_0x40d28b,_0x2b686d){var _0x91b817={'raw':!![],'where':{'id':_0x40d28b['params']['id']}},_0x5418da={};_0x5418da['model']=_[_0xeccc('0x33')](db['OpenchannelQueue'][_0xeccc('0x2e')]);_0x5418da[_0xeccc('0x32')]=_[_0xeccc('0x33')](_0x40d28b['query']);_0x5418da[_0xeccc('0x34')]=_['intersection'](_0x5418da[_0xeccc('0x31')],_0x5418da[_0xeccc('0x32')]);_0x91b817[_0xeccc('0x37')]=_['intersection'](_0x5418da[_0xeccc('0x31')],qs[_0xeccc('0x36')](_0x40d28b[_0xeccc('0x32')][_0xeccc('0x36')]));_0x91b817[_0xeccc('0x37')]=_0x91b817[_0xeccc('0x37')][_0xeccc('0x48')]?_0x91b817[_0xeccc('0x37')]:_0x5418da[_0xeccc('0x31')];if(_0x40d28b[_0xeccc('0x32')][_0xeccc('0x41')]){_0x91b817[_0xeccc('0x42')]=[{'all':!![]}];}_0x91b817=_[_0xeccc('0x40')]({},_0x91b817,_0x40d28b[_0xeccc('0x49')]);return db[_0xeccc('0x43')][_0xeccc('0x4a')](_0x91b817)[_0xeccc('0x25')](handleEntityNotFound(_0x2b686d,null))[_0xeccc('0x25')](respondWithResult(_0x2b686d,null))[_0xeccc('0x46')](handleError(_0x2b686d,null));};exports[_0xeccc('0x4b')]=function(_0xdcece0,_0x14bf00){return db[_0xeccc('0x43')][_0xeccc('0x4b')](_0xdcece0[_0xeccc('0x4c')],{})[_0xeccc('0x25')](function(_0x20c0b7){var _0x5ec9e2=_0xdcece0[_0xeccc('0x4d')][_0xeccc('0x4e')]({'plain':!![]});if(!_0x5ec9e2)throw new Error(_0xeccc('0x4f'));if(_0x5ec9e2[_0xeccc('0x50')]===_0xeccc('0x4d')){var _0x483f36=_0x20c0b7['get']({'plain':!![]});var _0x52d79a=_0xeccc('0x27');return db['UserProfileSection'][_0xeccc('0x4a')]({'where':{'name':_0x52d79a,'userProfileId':_0x5ec9e2[_0xeccc('0x51')]},'raw':!![]})[_0xeccc('0x25')](function(_0x25c405){if(_0x25c405&&_0x25c405['autoAssociation']===0x0){return db[_0xeccc('0x28')]['create']({'name':_0x483f36[_0xeccc('0x2b')],'resourceId':_0x483f36['id'],'type':_0x25c405[_0xeccc('0x2b')],'sectionId':_0x25c405['id']},{})[_0xeccc('0x25')](function(){return _0x20c0b7;});}else{return _0x20c0b7;}})[_0xeccc('0x46')](function(_0x23ea1){logger[_0xeccc('0x52')](_0xeccc('0x53'),_0x23ea1);throw _0x23ea1;});}return _0x20c0b7;})['then'](respondWithResult(_0x14bf00,0xc9))[_0xeccc('0x46')](handleError(_0x14bf00,null));};exports[_0xeccc('0x24')]=function(_0x44e182,_0x5bca90){if(_0x44e182[_0xeccc('0x4c')]['id']){delete _0x44e182[_0xeccc('0x4c')]['id'];}return db[_0xeccc('0x43')][_0xeccc('0x4a')]({'where':{'id':_0x44e182['params']['id']}})['then'](handleEntityNotFound(_0x5bca90,null))[_0xeccc('0x25')](saveUpdates(_0x44e182[_0xeccc('0x4c')],null))['then'](respondWithResult(_0x5bca90,null))[_0xeccc('0x46')](handleError(_0x5bca90,null));};exports[_0xeccc('0x26')]=function(_0x18c07e,_0x53f2fc){return db[_0xeccc('0x43')][_0xeccc('0x4a')]({'where':{'id':_0x18c07e[_0xeccc('0x54')]['id']}})[_0xeccc('0x25')](handleEntityNotFound(_0x53f2fc,null))[_0xeccc('0x25')](removeEntity(_0x53f2fc,null))[_0xeccc('0x46')](handleError(_0x53f2fc,null));};exports[_0xeccc('0x55')]=function(_0x2dda80,_0xf37555){return db[_0xeccc('0x43')][_0xeccc('0x55')]()[_0xeccc('0x25')](respondWithResult(_0xf37555,null))[_0xeccc('0x46')](handleError(_0xf37555,null));};exports['getMembers']=function(_0x4ebbb4,_0xb03e41,_0x4d7d67){var _0x29a42e={'raw':!![],'where':{}},_0x3795a6={},_0x51bcf3;return db[_0xeccc('0x43')][_0xeccc('0x56')]({'where':{'id':_0x4ebbb4['params']['id']}})[_0xeccc('0x25')](handleEntityNotFound(_0xb03e41,null))[_0xeccc('0x25')](function(_0x4f95f0){if(_0x4f95f0){_0x51bcf3=_0x4f95f0[_0xeccc('0x4e')]({'plain':!![]});_0x3795a6[_0xeccc('0x31')]=_[_0xeccc('0x33')](db[_0xeccc('0x57')][_0xeccc('0x2e')]);_0x3795a6[_0xeccc('0x32')]=_[_0xeccc('0x33')](_0x4ebbb4[_0xeccc('0x32')]);_0x3795a6[_0xeccc('0x34')]=_[_0xeccc('0x35')](_0x3795a6[_0xeccc('0x31')],_0x3795a6[_0xeccc('0x32')]);_0x29a42e[_0xeccc('0x37')]=_['intersection'](_0x3795a6['model'],qs[_0xeccc('0x36')](_0x4ebbb4['query'][_0xeccc('0x36')]));_0x29a42e[_0xeccc('0x37')]=_0x29a42e[_0xeccc('0x37')]['length']?_0x29a42e['attributes']:_0x3795a6[_0xeccc('0x31')];if(!_0x4ebbb4[_0xeccc('0x32')][_0xeccc('0x38')](_0xeccc('0x39'))){_0x29a42e[_0xeccc('0x1c')]=qs[_0xeccc('0x1c')](_0x4ebbb4[_0xeccc('0x32')][_0xeccc('0x1c')]);_0x29a42e['offset']=qs['offset'](_0x4ebbb4[_0xeccc('0x32')][_0xeccc('0x1b')]);}_0x29a42e['order']=qs[_0xeccc('0x3a')](_0x4ebbb4[_0xeccc('0x32')][_0xeccc('0x3a')]);_0x29a42e[_0xeccc('0x3b')]=qs[_0xeccc('0x34')](_['pick'](_0x4ebbb4['query'],_0x3795a6[_0xeccc('0x34')]));_0x29a42e[_0xeccc('0x3b')]['OpenchannelQueueId']=_0x4f95f0['id'];if(_0x4ebbb4[_0xeccc('0x32')][_0xeccc('0x3f')]){_0x29a42e[_0xeccc('0x3b')]=_['merge'](_0x29a42e[_0xeccc('0x3b')],{'$or':_[_0xeccc('0x3d')](_0x29a42e['attributes'],function(_0x22d24d){var _0x2c1da1={};_0x2c1da1[_0x22d24d]={'$like':'%'+_0x4ebbb4[_0xeccc('0x32')][_0xeccc('0x3f')]+'%'};return _0x2c1da1;})});}_0x29a42e=_[_0xeccc('0x40')]({},_0x29a42e,_0x4ebbb4[_0xeccc('0x49')]);return db['UserOpenchannelQueue'][_0xeccc('0x44')](_0x29a42e);}})[_0xeccc('0x25')](function(_0x35aad0){if(_0x35aad0){return db['User'][_0xeccc('0x58')]({'where':{'id':_[_0xeccc('0x3d')](_0x35aad0,_0xeccc('0x59')),'role':_0xeccc('0x5a')},'attributes':['id','name',_0xeccc('0x5b'),_0xeccc('0x5c'),'createdAt']});}})[_0xeccc('0x25')](function(_0x376041){if(_0x376041){return{'count':_0x376041[_0xeccc('0x1e')],'rows':_[_0xeccc('0x3d')](_0x376041[_0xeccc('0x45')],function(_0x799582){return{'membername':_0x799582[_0xeccc('0x2b')],'UserId':_0x799582['id'],'queue_name':_0x51bcf3['name'],'OpenchannelQueueId':_0x51bcf3['id'],'interface':util[_0xeccc('0x5d')](_0xeccc('0x5e'),_0xeccc('0x5f'),_0x799582['name']),'penalty':0x0,'paused':_0x799582[_0xeccc('0x5b')],'createdAt':_0x799582[_0xeccc('0x60')],'updatedAt':_0x799582[_0xeccc('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xeccc('0x25')](respondWithFilteredResult(_0xb03e41,_0x29a42e))[_0xeccc('0x46')](handleError(_0xb03e41,null));};exports[_0xeccc('0x61')]=function(_0x3b603f,_0x41c7a5,_0x1eca3c){var _0x53d301={};var _0x3414de={};var _0x5499e0;var _0x2b8d50;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x3b603f['params']['id']}})[_0xeccc('0x25')](handleEntityNotFound(_0x41c7a5,null))[_0xeccc('0x25')](function(_0x3199ee){if(_0x3199ee){_0x5499e0=_0x3199ee;_0x3414de[_0xeccc('0x31')]=_[_0xeccc('0x33')](db['Team']['rawAttributes']);_0x3414de['query']=_[_0xeccc('0x33')](_0x3b603f[_0xeccc('0x32')]);_0x3414de[_0xeccc('0x34')]=_[_0xeccc('0x35')](_0x3414de[_0xeccc('0x31')],_0x3414de[_0xeccc('0x32')]);_0x53d301[_0xeccc('0x37')]=_[_0xeccc('0x35')](_0x3414de['model'],qs['fields'](_0x3b603f[_0xeccc('0x32')][_0xeccc('0x36')]));_0x53d301[_0xeccc('0x37')]=_0x53d301[_0xeccc('0x37')][_0xeccc('0x48')]?_0x53d301['attributes']:_0x3414de[_0xeccc('0x31')];_0x53d301['order']=qs[_0xeccc('0x3a')](_0x3b603f['query'][_0xeccc('0x3a')]);_0x53d301[_0xeccc('0x3b')]=qs[_0xeccc('0x34')](_[_0xeccc('0x3c')](_0x3b603f['query'],_0x3414de[_0xeccc('0x34')]));if(_0x3b603f[_0xeccc('0x32')][_0xeccc('0x3f')]){_0x53d301[_0xeccc('0x3b')]=_[_0xeccc('0x40')](_0x53d301['where'],{'$or':_['map'](_0x53d301[_0xeccc('0x37')],function(_0x146f09){var _0x543c88={};_0x543c88[_0x146f09]={'$like':'%'+_0x3b603f['query'][_0xeccc('0x3f')]+'%'};return _0x543c88;})});}_0x53d301=_[_0xeccc('0x40')]({},_0x53d301,_0x3b603f['options']);return _0x5499e0[_0xeccc('0x61')](_0x53d301);}})[_0xeccc('0x25')](function(_0x2f8d0a){if(_0x2f8d0a){_0x2b8d50=_0x2f8d0a['length'];if(!_0x3b603f[_0xeccc('0x32')][_0xeccc('0x38')](_0xeccc('0x39'))){_0x53d301[_0xeccc('0x1c')]=qs[_0xeccc('0x1c')](_0x3b603f[_0xeccc('0x32')][_0xeccc('0x1c')]);_0x53d301[_0xeccc('0x1b')]=qs[_0xeccc('0x1b')](_0x3b603f[_0xeccc('0x32')][_0xeccc('0x1b')]);}return _0x5499e0[_0xeccc('0x61')](_0x53d301);}})[_0xeccc('0x25')](function(_0x273046){if(_0x273046){return _0x273046?{'count':_0x2b8d50,'rows':_0x273046}:null;}})[_0xeccc('0x25')](respondWithResult(_0x41c7a5,null))[_0xeccc('0x46')](handleError(_0x41c7a5,null));};exports['addTeams']=function(_0x2eb9c6,_0x60c9ef,_0x1a2012){var _0x4952d3=_0x2eb9c6[_0xeccc('0x4c')][_0xeccc('0x62')];return db[_0xeccc('0x63')][_0xeccc('0x44')]({'where':{'id':_0x4952d3},'attributes':['id'],'include':[{'model':db[_0xeccc('0x64')],'as':_0xeccc('0x65'),'attributes':['id',_0xeccc('0x2b'),_0xeccc('0x66'),_0xeccc('0x67'),_0xeccc('0x68')],'raw':!![]}]})[_0xeccc('0x25')](function(_0x485f3e){if(_0x485f3e){var _0x1969bc=_['flatMap'](_0x485f3e,function(_0xc904d6){var _0x33b16d=_0xc904d6[_0xeccc('0x4e')]({'plain':!![]});return _0x33b16d['Agents'];});return db['OpenchannelQueue'][_0xeccc('0x4a')]({'where':{'id':_0x2eb9c6[_0xeccc('0x54')]['id']}})[_0xeccc('0x25')](function(_0x383688){return db['sequelize'][_0xeccc('0x69')](function(_0x133000){return _0x383688[_0xeccc('0x6a')](_0x4952d3,{'transaction':_0x133000})[_0xeccc('0x25')](function(){return BPromise[_0xeccc('0x6b')](_0x1969bc,function(_0x289e75){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x289e75['id'],'OpenchannelQueueId':_0x2eb9c6[_0xeccc('0x54')]['id']},'transaction':_0x133000});});})[_0xeccc('0x25')](function(){_0x1969bc['forEach'](function(_0xc8ef60){socket[_0xeccc('0x6c')](_0xeccc('0x6d'),{'UserId':_0xc8ef60['id'],'OpenchannelQueueId':_0x383688['id']});});});});});}})[_0xeccc('0x25')](respondWithStatusCode(_0x60c9ef,null))['catch'](handleError(_0x60c9ef,null));};exports[_0xeccc('0x6e')]=function(_0x57234a,_0x2fed79,_0x58ef6f){return db[_0xeccc('0x63')][_0xeccc('0x44')]({'where':{'id':_0x57234a['query'][_0xeccc('0x62')]},'attributes':['id'],'include':[{'model':db[_0xeccc('0x64')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xeccc('0x25')](handleEntityNotFound(_0x2fed79,null))[_0xeccc('0x25')](function(_0x421d75){var _0x3632cb=_['map'](_0x421d75,'id');var _0x46bf91=[];var _0x15f726=[];var _0x8380b5=squel['select']();_0x8380b5['field'](_0xeccc('0x6f'))['from']('team_has_openchannel_queues','tq')[_0xeccc('0x70')](_0xeccc('0x71'),'ut',_0xeccc('0x72'))[_0xeccc('0x3b')](_0xeccc('0x73'),_0x57234a[_0xeccc('0x54')]['id']);for(var _0x11ce25=0x0;_0x11ce25<_0x421d75[_0xeccc('0x48')];_0x11ce25+=0x1){let _0xd8d5ed=_0x421d75[_0x11ce25];for(var _0x3c2e5f=0x0;_0x3c2e5f<_0xd8d5ed[_0xeccc('0x65')]['length'];_0x3c2e5f+=0x1){let _0x21d455=_0xd8d5ed[_0xeccc('0x65')][_0x3c2e5f];var _0x10cd63=_0x8380b5[_0xeccc('0x74')]();_0x10cd63[_0xeccc('0x3b')]('ut.UserId\x20=\x20?',_0x21d455['id']);_0x15f726[_0xeccc('0x75')](db[_0xeccc('0x76')]['query'](_0x10cd63[_0xeccc('0x77')](),{'type':db[_0xeccc('0x76')][_0xeccc('0x78')]['SELECT']})[_0xeccc('0x25')](function(_0x43ead3){if(_0x43ead3[_0xeccc('0x48')]===0x1){return _0x21d455['id'];}else{var _0x4bd4b7=_[_0xeccc('0x79')](_[_0xeccc('0x3d')](_0x43ead3,_0xeccc('0x7a')),function(_0x2bd62a){return _[_0xeccc('0x7b')](_0x3632cb,_0x2bd62a);});if(_0x4bd4b7){return _0x21d455['id'];}}}));}}return BPromise[_0xeccc('0x7c')](_0x15f726)[_0xeccc('0x25')](function(_0x53840a){_0x46bf91=_(_0x46bf91)[_0xeccc('0x7d')](_0x53840a)[_0xeccc('0x7e')]()[_0xeccc('0x7f')]();return db[_0xeccc('0x43')]['find']({'where':{'id':_0x57234a[_0xeccc('0x54')]['id']}})[_0xeccc('0x25')](function(_0x4612d1){return db[_0xeccc('0x76')]['transaction'](function(_0x2cfc8e){return _0x4612d1[_0xeccc('0x6e')](_0x57234a[_0xeccc('0x32')]['ids'],{'transaction':_0x2cfc8e})[_0xeccc('0x25')](function(){if(!_[_0xeccc('0x80')](_0x46bf91)){return _0x4612d1[_0xeccc('0x81')](_0x46bf91,{'transaction':_0x2cfc8e});}})[_0xeccc('0x25')](function(){_0x46bf91[_0xeccc('0x82')](function(_0x543ec5){socket['emit'](_0xeccc('0x83'),{'UserId':_0x543ec5,'OpenchannelQueueId':_0x4612d1['id']});});});});});});})[_0xeccc('0x25')](respondWithStatusCode(_0x2fed79,null))['catch'](handleError(_0x2fed79,null));};exports[_0xeccc('0x84')]=function(_0x1f8135,_0x4d5989,_0x5e05ed){return db[_0xeccc('0x43')][_0xeccc('0x4a')]({'where':{'id':_0x1f8135[_0xeccc('0x54')]['id']}})[_0xeccc('0x25')](handleEntityNotFound(_0x4d5989,null))[_0xeccc('0x25')](function(_0x159c5a){if(_0x159c5a){return _0x159c5a[_0xeccc('0x84')](_0x1f8135[_0xeccc('0x4c')]['ids'],_[_0xeccc('0x85')](_0x1f8135['body'],[_0xeccc('0x62'),'id'])||{})[_0xeccc('0x86')](function(_0x484e5f){for(var _0x4713c3=0x0;_0x4713c3<_0x1f8135['body'][_0xeccc('0x62')][_0xeccc('0x48')];_0x4713c3+=0x1){socket[_0xeccc('0x6c')](_0xeccc('0x6d'),{'UserId':Number(_0x1f8135['body'][_0xeccc('0x62')][_0x4713c3]),'OpenchannelQueueId':Number(_0x1f8135['params']['id'])});}return _0x484e5f;});}})[_0xeccc('0x25')](respondWithResult(_0x4d5989,null))[_0xeccc('0x46')](handleError(_0x4d5989,null));};exports[_0xeccc('0x81')]=function(_0x190190,_0x1698dc,_0x3497cb){return db[_0xeccc('0x43')][_0xeccc('0x4a')]({'where':{'id':_0x190190[_0xeccc('0x54')]['id']}})['then'](handleEntityNotFound(_0x1698dc,null))[_0xeccc('0x25')](function(_0x5ac08f){if(_0x5ac08f){return _0x5ac08f[_0xeccc('0x81')](_0x190190[_0xeccc('0x32')][_0xeccc('0x62')])[_0xeccc('0x25')](function(){if(_[_0xeccc('0x87')](_0x190190['query'][_0xeccc('0x62')])){for(var _0x5d2d9c=0x0;_0x5d2d9c<_0x190190['query'][_0xeccc('0x62')]['length'];_0x5d2d9c+=0x1){socket[_0xeccc('0x6c')](_0xeccc('0x83'),{'UserId':Number(_0x190190[_0xeccc('0x32')][_0xeccc('0x62')][_0x5d2d9c]),'OpenchannelQueueId':Number(_0x190190[_0xeccc('0x54')]['id'])});}}else{socket['emit'](_0xeccc('0x83'),{'UserId':Number(_0x190190[_0xeccc('0x32')][_0xeccc('0x62')]),'OpenchannelQueueId':Number(_0x190190[_0xeccc('0x54')]['id'])});}});}})[_0xeccc('0x25')](respondWithStatusCode(_0x1698dc,null))[_0xeccc('0x46')](handleError(_0x1698dc,null));};exports[_0xeccc('0x88')]=function(_0x21d53c,_0x42f767,_0x52a060){var _0x588f36={};var _0x447b6c={};var _0x2ab216;var _0x4b7d69;return db[_0xeccc('0x43')][_0xeccc('0x56')]({'where':{'id':_0x21d53c['params']['id']}})[_0xeccc('0x25')](handleEntityNotFound(_0x42f767,null))[_0xeccc('0x25')](function(_0x4ea7fc){if(_0x4ea7fc){_0x2ab216=_0x4ea7fc;_0x447b6c['model']=_[_0xeccc('0x33')](db[_0xeccc('0x64')][_0xeccc('0x2e')]);_0x447b6c[_0xeccc('0x32')]=_['keys'](_0x21d53c[_0xeccc('0x32')]);_0x447b6c['filters']=_[_0xeccc('0x35')](_0x447b6c[_0xeccc('0x31')],_0x447b6c[_0xeccc('0x32')]);_0x588f36[_0xeccc('0x37')]=_[_0xeccc('0x35')](_0x447b6c[_0xeccc('0x31')],qs[_0xeccc('0x36')](_0x21d53c[_0xeccc('0x32')]['fields']));_0x588f36[_0xeccc('0x37')]=_0x588f36[_0xeccc('0x37')][_0xeccc('0x48')]?_0x588f36['attributes']:_0x447b6c['model'];_0x588f36[_0xeccc('0x89')]=qs[_0xeccc('0x3a')](_0x21d53c['query'][_0xeccc('0x3a')]);_0x588f36['where']=qs[_0xeccc('0x34')](_[_0xeccc('0x3c')](_0x21d53c[_0xeccc('0x32')],_0x447b6c[_0xeccc('0x34')]));if(_0x21d53c['query']['filter']){_0x588f36[_0xeccc('0x3b')]=_[_0xeccc('0x40')](_0x588f36[_0xeccc('0x3b')],{'$or':_[_0xeccc('0x3d')](_0x588f36['attributes'],function(_0x5eaf12){var _0x5897d4={};_0x5897d4[_0x5eaf12]={'$like':'%'+_0x21d53c[_0xeccc('0x32')][_0xeccc('0x3f')]+'%'};return _0x5897d4;})});}_0x588f36=_[_0xeccc('0x40')]({},_0x588f36,_0x21d53c[_0xeccc('0x49')]);return _0x2ab216[_0xeccc('0x88')](_0x588f36);}})[_0xeccc('0x25')](function(_0xb42421){if(_0xb42421){_0x4b7d69=_0xb42421[_0xeccc('0x48')];if(!_0x21d53c['query'][_0xeccc('0x38')](_0xeccc('0x39'))){_0x588f36[_0xeccc('0x1c')]=qs['limit'](_0x21d53c[_0xeccc('0x32')][_0xeccc('0x1c')]);_0x588f36[_0xeccc('0x1b')]=qs[_0xeccc('0x1b')](_0x21d53c['query'][_0xeccc('0x1b')]);}return _0x2ab216[_0xeccc('0x88')](_0x588f36);}})[_0xeccc('0x25')](function(_0x264dbd){if(_0x264dbd){return _0x264dbd?{'count':_0x4b7d69,'rows':_0x264dbd}:null;}})['then'](respondWithResult(_0x42f767,null))[_0xeccc('0x46')](handleError(_0x42f767,null));};
\ No newline at end of file
index 2e02b71..e66f3e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbad1=['../../mysqldb','OpenchannelQueue','save','update','emit','hasOwnProperty','exports','events'];(function(_0xb38338,_0xe81a45){var _0x52f113=function(_0x4b19b8){while(--_0x4b19b8){_0xb38338['push'](_0xb38338['shift']());}};_0x52f113(++_0xe81a45);}(_0xbad1,0x197));var _0x1bad=function(_0x3e2a69,_0x49e167){_0x3e2a69=_0x3e2a69-0x0;var _0x41c3f0=_0xbad1[_0x3e2a69];return _0x41c3f0;};'use strict';var EventEmitter=require(_0x1bad('0x0'));var OpenchannelQueue=require(_0x1bad('0x1'))['db'][_0x1bad('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1bad('0x3'),'afterUpdate':_0x1bad('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1a73be){return function(_0x5e26d5,_0x18c872,_0x1d059f){OpenchannelQueueEvents[_0x1bad('0x5')](_0x1a73be+':'+_0x5e26d5['id'],_0x5e26d5);OpenchannelQueueEvents[_0x1bad('0x5')](_0x1a73be,_0x5e26d5);_0x1d059f(null);};}for(var e in events){if(events[_0x1bad('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x1bad('0x7')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xae6d=['hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3b1c1c,_0x270b7f){var _0x2d37d5=function(_0x5b6397){while(--_0x5b6397){_0x3b1c1c['push'](_0x3b1c1c['shift']());}};_0x2d37d5(++_0x270b7f);}(_0xae6d,0x19f));var _0xdae6=function(_0x1cbaa2,_0x16f4d8){_0x1cbaa2=_0x1cbaa2-0x0;var _0x114440=_0xae6d[_0x1cbaa2];return _0x114440;};'use strict';var EventEmitter=require(_0xdae6('0x0'));var OpenchannelQueue=require(_0xdae6('0x1'))['db'][_0xdae6('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xdae6('0x3')](0x0);var events={'afterCreate':_0xdae6('0x4'),'afterUpdate':_0xdae6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2d068b){return function(_0x52583d,_0x503d76,_0x383007){OpenchannelQueueEvents['emit'](_0x2d068b+':'+_0x52583d['id'],_0x52583d);OpenchannelQueueEvents[_0xdae6('0x6')](_0x2d068b,_0x52583d);_0x383007(null);};}for(var e in events){if(events[_0xdae6('0x7')](e)){var event=events[e];OpenchannelQueue[_0xdae6('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index 0b73200..982db47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b90=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment'];(function(_0x19000c,_0x107896){var _0x2d07eb=function(_0x44232b){while(--_0x44232b){_0x19000c['push'](_0x19000c['shift']());}};_0x2d07eb(++_0x107896);}(_0x6b90,0x95));var _0x06b9=function(_0x3f1861,_0x7b4285){_0x3f1861=_0x3f1861-0x0;var _0x7ca70a=_0x6b90[_0x3f1861];return _0x7ca70a;};'use strict';var _=require(_0x06b9('0x0'));var util=require(_0x06b9('0x1'));var logger=require(_0x06b9('0x2'))(_0x06b9('0x3'));var moment=require(_0x06b9('0x4'));var BPromise=require(_0x06b9('0x5'));var rp=require(_0x06b9('0x6'));var fs=require('fs');var path=require(_0x06b9('0x7'));var rimraf=require(_0x06b9('0x8'));var config=require(_0x06b9('0x9'));var attributes=require(_0x06b9('0xa'));module['exports']=function(_0x4e1c21,_0x5aa0e7){return _0x4e1c21[_0x06b9('0xb')](_0x06b9('0xc'),attributes,{'tableName':_0x06b9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1524=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x5d934c,_0x5060f0){var _0x5d9b68=function(_0x445bce){while(--_0x445bce){_0x5d934c['push'](_0x5d934c['shift']());}};_0x5d9b68(++_0x5060f0);}(_0x1524,0x18b));var _0x4152=function(_0x42ddf8,_0x264fc9){_0x42ddf8=_0x42ddf8-0x0;var _0x558152=_0x1524[_0x42ddf8];return _0x558152;};'use strict';var _=require(_0x4152('0x0'));var util=require(_0x4152('0x1'));var logger=require(_0x4152('0x2'))(_0x4152('0x3'));var moment=require(_0x4152('0x4'));var BPromise=require(_0x4152('0x5'));var rp=require(_0x4152('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4152('0x7'));var attributes=require(_0x4152('0x8'));module['exports']=function(_0xdddb07,_0x3ef247){return _0xdddb07[_0x4152('0x9')](_0x4152('0xa'),attributes,{'tableName':_0x4152('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ee64d87..437cd8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x940a=['catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','map','attributes','model','find','ShowOpenchannelQueue','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result'];(function(_0x3a218d,_0x340ffa){var _0x23580d=function(_0x2c4dbb){while(--_0x2c4dbb){_0x3a218d['push'](_0x3a218d['shift']());}};_0x23580d(++_0x340ffa);}(_0x940a,0x146));var _0xa940=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x940a[_0x3e7e96];return _0x13f6f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa940('0x0'));var BPromise=require('bluebird');var rs=require(_0xa940('0x1'));var fs=require('fs');var Redis=require(_0xa940('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa940('0x3'));var logger=require(_0xa940('0x4'))(_0xa940('0x5'));var config=require('../../config/environment');var jayson=require(_0xa940('0x6'));var client=jayson['client'][_0xa940('0x7')]({'port':0x232a});config[_0xa940('0x8')]=_[_0xa940('0x9')](config[_0xa940('0x8')],{'host':_0xa940('0xa'),'port':0x18eb});var socket=require(_0xa940('0xb'))(new Redis(config['redis']));require(_0xa940('0xc'))[_0xa940('0xd')](socket);function respondWithRpcPromise(_0x398dec,_0x4f44af,_0x39aa66){return new BPromise(function(_0x566a9e,_0x3f94cf){return client['request'](_0x398dec,_0x39aa66)[_0xa940('0xe')](function(_0x262b4f){logger[_0xa940('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x4f44af,_0xa940('0x10'));logger[_0xa940('0x11')](_0xa940('0x12'),_0x4f44af,_0xa940('0x10'),JSON[_0xa940('0x13')](_0x262b4f));if(_0x262b4f[_0xa940('0x14')]){if(_0x262b4f[_0xa940('0x14')][_0xa940('0x15')]===0x1f4){logger['error'](_0xa940('0x16'),_0x4f44af,_0x262b4f[_0xa940('0x14')][_0xa940('0x17')]);return _0x3f94cf(_0x262b4f[_0xa940('0x14')][_0xa940('0x17')]);}logger[_0xa940('0x14')](_0xa940('0x16'),_0x4f44af,_0x262b4f[_0xa940('0x14')][_0xa940('0x17')]);return _0x566a9e(_0x262b4f[_0xa940('0x14')][_0xa940('0x17')]);}else{logger[_0xa940('0xf')](_0xa940('0x16'),_0x4f44af,_0xa940('0x10'));_0x566a9e(_0x262b4f[_0xa940('0x18')][_0xa940('0x17')]);}})[_0xa940('0x19')](function(_0x36ed13){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x4f44af,_0x36ed13);_0x3f94cf(_0x36ed13);});});}exports[_0xa940('0x1a')]=function(_0x1ebcc){var _0x5de9e5=this;return new Promise(function(_0x589b59,_0x584352){return db[_0xa940('0x1b')][_0xa940('0x1c')]({'raw':_0x1ebcc[_0xa940('0x1d')]?_0x1ebcc[_0xa940('0x1d')][_0xa940('0x1e')]===undefined?!![]:![]:!![],'where':_0x1ebcc['options']?_0x1ebcc['options'][_0xa940('0x1f')]||null:null,'attributes':_0x1ebcc['options']?_0x1ebcc[_0xa940('0x1d')]['attributes']||null:null,'limit':_0x1ebcc['options']?_0x1ebcc[_0xa940('0x1d')][_0xa940('0x20')]||null:null,'include':_0x1ebcc[_0xa940('0x1d')]?_0x1ebcc['options'][_0xa940('0x21')]?_[_0xa940('0x22')](_0x1ebcc['options'][_0xa940('0x21')],function(_0x55cd28){return{'model':db[_0x55cd28['model']],'as':_0x55cd28['as'],'attributes':_0x55cd28[_0xa940('0x23')],'include':_0x55cd28[_0xa940('0x21')]?_['map'](_0x55cd28[_0xa940('0x21')],function(_0x260bfe){return{'model':db[_0x260bfe[_0xa940('0x24')]],'as':_0x260bfe['as'],'attributes':_0x260bfe['attributes'],'include':_0x260bfe[_0xa940('0x21')]?_[_0xa940('0x22')](_0x260bfe[_0xa940('0x21')],function(_0x5262c9){return{'model':db[_0x5262c9[_0xa940('0x24')]],'as':_0x5262c9['as'],'attributes':_0x5262c9[_0xa940('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa940('0xe')](function(_0x2f6aec){logger['info'](_0xa940('0x1a'),_0x1ebcc);logger[_0xa940('0x11')](_0xa940('0x1a'),_0x1ebcc,JSON[_0xa940('0x13')](_0x2f6aec));_0x589b59(_0x2f6aec);})[_0xa940('0x19')](function(_0x30c106){logger[_0xa940('0x14')](_0xa940('0x1a'),_0x30c106[_0xa940('0x17')],_0x1ebcc);_0x584352(_0x5de9e5['error'](0x1f4,_0x30c106[_0xa940('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x5c10c7){var _0x595e72=this;return new Promise(function(_0x34e7a8,_0x3c0894){return db[_0xa940('0x1b')][_0xa940('0x25')]({'raw':_0x5c10c7[_0xa940('0x1d')]?_0x5c10c7[_0xa940('0x1d')][_0xa940('0x1e')]===undefined?!![]:![]:!![],'where':_0x5c10c7[_0xa940('0x1d')]?_0x5c10c7[_0xa940('0x1d')][_0xa940('0x1f')]||null:null,'attributes':_0x5c10c7[_0xa940('0x1d')]?_0x5c10c7[_0xa940('0x1d')]['attributes']||null:null,'include':_0x5c10c7[_0xa940('0x1d')]?_0x5c10c7['options']['include']?_[_0xa940('0x22')](_0x5c10c7[_0xa940('0x1d')][_0xa940('0x21')],function(_0x24c850){return{'model':db[_0x24c850['model']],'as':_0x24c850['as'],'attributes':_0x24c850[_0xa940('0x23')],'include':_0x24c850[_0xa940('0x21')]?_[_0xa940('0x22')](_0x24c850[_0xa940('0x21')],function(_0x3f28d6){return{'model':db[_0x3f28d6[_0xa940('0x24')]],'as':_0x3f28d6['as'],'attributes':_0x3f28d6[_0xa940('0x23')],'include':_0x3f28d6[_0xa940('0x21')]?_[_0xa940('0x22')](_0x3f28d6[_0xa940('0x21')],function(_0x9c2c0b){return{'model':db[_0x9c2c0b[_0xa940('0x24')]],'as':_0x9c2c0b['as'],'attributes':_0x9c2c0b[_0xa940('0x23')]};}):[]};}):[]};}):[]:[]})[_0xa940('0xe')](function(_0x229e01){logger['info'](_0xa940('0x26'),_0x5c10c7);logger[_0xa940('0x11')](_0xa940('0x26'),_0x5c10c7,JSON[_0xa940('0x13')](_0x229e01));_0x34e7a8(_0x229e01);})[_0xa940('0x19')](function(_0x546e76){logger['error'](_0xa940('0x26'),_0x546e76[_0xa940('0x17')],_0x5c10c7);_0x3c0894(_0x595e72[_0xa940('0x14')](0x1f4,_0x546e76[_0xa940('0x17')]));});});};
\ No newline at end of file
+var _0xdd52=['../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','request\x20sent','debug','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3b3d8f,_0x3b01b7){var _0x2686b6=function(_0x49d99a){while(--_0x49d99a){_0x3b3d8f['push'](_0x3b3d8f['shift']());}};_0x2686b6(++_0x3b01b7);}(_0xdd52,0xc6));var _0x2dd5=function(_0x484145,_0x3af188){_0x484145=_0x484145-0x0;var _0x204fb5=_0xdd52[_0x484145];return _0x204fb5;};'use strict';var _=require(_0x2dd5('0x0'));var util=require(_0x2dd5('0x1'));var moment=require(_0x2dd5('0x2'));var BPromise=require(_0x2dd5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2dd5('0x4'));var db=require(_0x2dd5('0x5'))['db'];var utils=require(_0x2dd5('0x6'));var logger=require(_0x2dd5('0x7'))('rpc');var config=require(_0x2dd5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2dd5('0x9')][_0x2dd5('0xa')]({'port':0x232a});config[_0x2dd5('0xb')]=_[_0x2dd5('0xc')](config[_0x2dd5('0xb')],{'host':_0x2dd5('0xd'),'port':0x18eb});var socket=require(_0x2dd5('0xe'))(new Redis(config[_0x2dd5('0xb')]));require(_0x2dd5('0xf'))[_0x2dd5('0x10')](socket);function respondWithRpcPromise(_0x5e1e69,_0x49be3b,_0x4e4410){return new BPromise(function(_0x2d8dbe,_0x21fbac){return client['request'](_0x5e1e69,_0x4e4410)[_0x2dd5('0x11')](function(_0x256b25){logger[_0x2dd5('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x49be3b,_0x2dd5('0x13'));logger[_0x2dd5('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x49be3b,_0x2dd5('0x13'),JSON[_0x2dd5('0x15')](_0x256b25));if(_0x256b25[_0x2dd5('0x16')]){if(_0x256b25[_0x2dd5('0x16')][_0x2dd5('0x17')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x49be3b,_0x256b25[_0x2dd5('0x16')][_0x2dd5('0x18')]);return _0x21fbac(_0x256b25[_0x2dd5('0x16')][_0x2dd5('0x18')]);}logger['error'](_0x2dd5('0x19'),_0x49be3b,_0x256b25[_0x2dd5('0x16')][_0x2dd5('0x18')]);return _0x2d8dbe(_0x256b25[_0x2dd5('0x16')][_0x2dd5('0x18')]);}else{logger[_0x2dd5('0x12')](_0x2dd5('0x19'),_0x49be3b,'request\x20sent');_0x2d8dbe(_0x256b25[_0x2dd5('0x1a')][_0x2dd5('0x18')]);}})[_0x2dd5('0x1b')](function(_0x1b44ae){logger[_0x2dd5('0x16')](_0x2dd5('0x19'),_0x49be3b,_0x1b44ae);_0x21fbac(_0x1b44ae);});});}exports[_0x2dd5('0x1c')]=function(_0x4541a3){var _0x3a5327=this;return new Promise(function(_0x30a86e,_0xc921f9){return db[_0x2dd5('0x1d')][_0x2dd5('0x1e')]({'raw':_0x4541a3[_0x2dd5('0x1f')]?_0x4541a3[_0x2dd5('0x1f')][_0x2dd5('0x20')]===undefined?!![]:![]:!![],'where':_0x4541a3['options']?_0x4541a3[_0x2dd5('0x1f')][_0x2dd5('0x21')]||null:null,'attributes':_0x4541a3[_0x2dd5('0x1f')]?_0x4541a3[_0x2dd5('0x1f')][_0x2dd5('0x22')]||null:null,'limit':_0x4541a3[_0x2dd5('0x1f')]?_0x4541a3['options'][_0x2dd5('0x23')]||null:null,'include':_0x4541a3[_0x2dd5('0x1f')]?_0x4541a3['options'][_0x2dd5('0x24')]?_[_0x2dd5('0x25')](_0x4541a3[_0x2dd5('0x1f')][_0x2dd5('0x24')],function(_0x179679){return{'model':db[_0x179679[_0x2dd5('0x26')]],'as':_0x179679['as'],'attributes':_0x179679[_0x2dd5('0x22')],'include':_0x179679[_0x2dd5('0x24')]?_[_0x2dd5('0x25')](_0x179679['include'],function(_0x3fd397){return{'model':db[_0x3fd397[_0x2dd5('0x26')]],'as':_0x3fd397['as'],'attributes':_0x3fd397[_0x2dd5('0x22')],'include':_0x3fd397[_0x2dd5('0x24')]?_[_0x2dd5('0x25')](_0x3fd397[_0x2dd5('0x24')],function(_0x52ade2){return{'model':db[_0x52ade2[_0x2dd5('0x26')]],'as':_0x52ade2['as'],'attributes':_0x52ade2[_0x2dd5('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x228f09){logger[_0x2dd5('0x12')](_0x2dd5('0x1c'),_0x4541a3);logger['debug']('GetOpenchannelQueue',_0x4541a3,JSON[_0x2dd5('0x15')](_0x228f09));_0x30a86e(_0x228f09);})[_0x2dd5('0x1b')](function(_0x568fc3){logger['error'](_0x2dd5('0x1c'),_0x568fc3[_0x2dd5('0x18')],_0x4541a3);_0xc921f9(_0x3a5327[_0x2dd5('0x16')](0x1f4,_0x568fc3['message']));});});};exports['ShowOpenchannelQueue']=function(_0x6d36d5){var _0x14ce73=this;return new Promise(function(_0x21bed1,_0xb0b971){return db[_0x2dd5('0x1d')][_0x2dd5('0x27')]({'raw':_0x6d36d5[_0x2dd5('0x1f')]?_0x6d36d5[_0x2dd5('0x1f')][_0x2dd5('0x20')]===undefined?!![]:![]:!![],'where':_0x6d36d5[_0x2dd5('0x1f')]?_0x6d36d5[_0x2dd5('0x1f')][_0x2dd5('0x21')]||null:null,'attributes':_0x6d36d5[_0x2dd5('0x1f')]?_0x6d36d5['options'][_0x2dd5('0x22')]||null:null,'include':_0x6d36d5['options']?_0x6d36d5['options'][_0x2dd5('0x24')]?_[_0x2dd5('0x25')](_0x6d36d5[_0x2dd5('0x1f')][_0x2dd5('0x24')],function(_0x1c614e){return{'model':db[_0x1c614e['model']],'as':_0x1c614e['as'],'attributes':_0x1c614e[_0x2dd5('0x22')],'include':_0x1c614e[_0x2dd5('0x24')]?_['map'](_0x1c614e[_0x2dd5('0x24')],function(_0x5415e6){return{'model':db[_0x5415e6['model']],'as':_0x5415e6['as'],'attributes':_0x5415e6[_0x2dd5('0x22')],'include':_0x5415e6[_0x2dd5('0x24')]?_[_0x2dd5('0x25')](_0x5415e6[_0x2dd5('0x24')],function(_0x1fb300){return{'model':db[_0x1fb300[_0x2dd5('0x26')]],'as':_0x1fb300['as'],'attributes':_0x1fb300['attributes']};}):[]};}):[]};}):[]:[]})[_0x2dd5('0x11')](function(_0x21e0d){logger[_0x2dd5('0x12')](_0x2dd5('0x28'),_0x6d36d5);logger[_0x2dd5('0x14')](_0x2dd5('0x28'),_0x6d36d5,JSON[_0x2dd5('0x15')](_0x21e0d));_0x21bed1(_0x21e0d);})[_0x2dd5('0x1b')](function(_0x4a8dc7){logger[_0x2dd5('0x16')](_0x2dd5('0x28'),_0x4a8dc7[_0x2dd5('0x18')],_0x6d36d5);_0xb0b971(_0x14ce73[_0x2dd5('0x16')](0x1f4,_0x4a8dc7[_0x2dd5('0x18')]));});});};
\ No newline at end of file
index 8f25fd7..a402061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7110=['./openchannelQueue.events','save','update','emit','removeListener','register','length'];(function(_0xf786a5,_0x164895){var _0x2ec74f=function(_0xf85c4){while(--_0xf85c4){_0xf786a5['push'](_0xf786a5['shift']());}};_0x2ec74f(++_0x164895);}(_0x7110,0x149));var _0x0711=function(_0x3b7184,_0x53297b){_0x3b7184=_0x3b7184-0x0;var _0x3ef45e=_0x7110[_0x3b7184];return _0x3ef45e;};'use strict';var OpenchannelQueueEvents=require(_0x0711('0x0'));var events=[_0x0711('0x1'),'remove',_0x0711('0x2')];function createListener(_0x11afcd,_0x5e5c7a){return function(_0x10a88d){_0x5e5c7a[_0x0711('0x3')](_0x11afcd,_0x10a88d);};}function removeListener(_0xe93202,_0x2a6b7c){return function(){OpenchannelQueueEvents[_0x0711('0x4')](_0xe93202,_0x2a6b7c);};}exports[_0x0711('0x5')]=function(_0x6682cc){for(var _0x173a28=0x0,_0x166245=events[_0x0711('0x6')];_0x173a28<_0x166245;_0x173a28++){var _0x16acbd=events[_0x173a28];var _0x17f473=createListener('openchannelQueue:'+_0x16acbd,_0x6682cc);OpenchannelQueueEvents['on'](_0x16acbd,_0x17f473);}};
\ No newline at end of file
+var _0xb155=['length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x126928,_0x34bbe2){var _0x5ee1bc=function(_0x12edf1){while(--_0x12edf1){_0x126928['push'](_0x126928['shift']());}};_0x5ee1bc(++_0x34bbe2);}(_0xb155,0x89));var _0x5b15=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0xb155[_0x25b24a];return _0x224e68;};'use strict';var OpenchannelQueueEvents=require(_0x5b15('0x0'));var events=[_0x5b15('0x1'),_0x5b15('0x2'),_0x5b15('0x3')];function createListener(_0x34c87b,_0x327b5b){return function(_0x141063){_0x327b5b[_0x5b15('0x4')](_0x34c87b,_0x141063);};}function removeListener(_0x24d45b,_0x2506df){return function(){OpenchannelQueueEvents[_0x5b15('0x5')](_0x24d45b,_0x2506df);};}exports[_0x5b15('0x6')]=function(_0x428fbe){for(var _0x48f568=0x0,_0x51bac2=events[_0x5b15('0x7')];_0x48f568<_0x51bac2;_0x48f568++){var _0x3fc5e1=events[_0x48f568];var _0x434549=createListener(_0x5b15('0x8')+_0x3fc5e1,_0x428fbe);OpenchannelQueueEvents['on'](_0x3fc5e1,_0x434549);}};
\ No newline at end of file
index f9b72a5..1ae3d71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x783a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x16a686,_0x46680c){var _0x364a13=function(_0x5d1b71){while(--_0x5d1b71){_0x16a686['push'](_0x16a686['shift']());}};_0x364a13(++_0x46680c);}(_0x783a,0x140));var _0xa783=function(_0x453956,_0x1373c3){_0x453956=_0x453956-0x0;var _0x5c9dfa=_0x783a[_0x453956];return _0x5c9dfa;};'use strict';var multer=require(_0xa783('0x0'));var util=require(_0xa783('0x1'));var path=require(_0xa783('0x2'));var timeout=require(_0xa783('0x3'));var express=require(_0xa783('0x4'));var router=express[_0xa783('0x5')]();var fs_extra=require(_0xa783('0x6'));var auth=require(_0xa783('0x7'));var interaction=require(_0xa783('0x8'));var config=require(_0xa783('0x9'));var controller=require(_0xa783('0xa'));router[_0xa783('0xb')]('/',auth[_0xa783('0xc')](),controller[_0xa783('0xd')]);router[_0xa783('0xb')](_0xa783('0xe'),auth[_0xa783('0xc')](),controller[_0xa783('0xf')]);router['get'](_0xa783('0x10'),auth[_0xa783('0xc')](),controller[_0xa783('0x11')]);router[_0xa783('0x12')]('/',auth[_0xa783('0xc')](),controller[_0xa783('0x13')]);router['put'](_0xa783('0x10'),auth['isAuthenticated'](),controller[_0xa783('0x14')]);router[_0xa783('0x15')](_0xa783('0x10'),auth[_0xa783('0xc')](),controller['destroy']);module[_0xa783('0x16')]=router;
\ No newline at end of file
+var _0x6a6d=['/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','describe','show','post','create','put','update','delete'];(function(_0x1db751,_0x19b281){var _0x5153c1=function(_0x48ddf9){while(--_0x48ddf9){_0x1db751['push'](_0x1db751['shift']());}};_0x5153c1(++_0x19b281);}(_0x6a6d,0xb6));var _0xd6a6=function(_0x49af2b,_0x2c2884){_0x49af2b=_0x49af2b-0x0;var _0x14cd9d=_0x6a6d[_0x49af2b];return _0x14cd9d;};'use strict';var multer=require(_0xd6a6('0x0'));var util=require(_0xd6a6('0x1'));var path=require(_0xd6a6('0x2'));var timeout=require(_0xd6a6('0x3'));var express=require(_0xd6a6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd6a6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd6a6('0x6'));var controller=require(_0xd6a6('0x7'));router['get']('/',auth[_0xd6a6('0x8')](),controller[_0xd6a6('0x9')]);router[_0xd6a6('0xa')]('/describe',auth[_0xd6a6('0x8')](),controller[_0xd6a6('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd6a6('0xc')]);router[_0xd6a6('0xd')]('/',auth[_0xd6a6('0x8')](),controller[_0xd6a6('0xe')]);router[_0xd6a6('0xf')]('/:id',auth[_0xd6a6('0x8')](),controller[_0xd6a6('0x10')]);router[_0xd6a6('0x11')](_0xd6a6('0x12'),auth[_0xd6a6('0x8')](),controller['destroy']);module[_0xd6a6('0x13')]=router;
\ No newline at end of file
index 57ce7ba..f8e4187 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa027=['DATE','moment','exports','STRING'];(function(_0x7cbc3c,_0x2bad4d){var _0x4c4433=function(_0x3f6cbd){while(--_0x3f6cbd){_0x7cbc3c['push'](_0x7cbc3c['shift']());}};_0x4c4433(++_0x2bad4d);}(_0xa027,0x1dd));var _0x7a02=function(_0x6edf26,_0x48df2d){_0x6edf26=_0x6edf26-0x0;var _0x513b05=_0xa027[_0x6edf26];return _0x513b05;};'use strict';var moment=require(_0x7a02('0x0'));var Sequelize=require('sequelize');module[_0x7a02('0x1')]={'uniqueid':{'type':Sequelize[_0x7a02('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7a02('0x2')]},'joinAt':{'type':Sequelize[_0x7a02('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7a02('0x3')]},'exitAt':{'type':Sequelize[_0x7a02('0x3')]},'reason':{'type':Sequelize[_0x7a02('0x2')]}};
\ No newline at end of file
+var _0xcfae=['STRING','DATE','moment','exports'];(function(_0x1e900d,_0x96b654){var _0x18f4c9=function(_0x1a2c5d){while(--_0x1a2c5d){_0x1e900d['push'](_0x1e900d['shift']());}};_0x18f4c9(++_0x96b654);}(_0xcfae,0x1ca));var _0xecfa=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xcfae[_0x27e811];return _0x1627fa;};'use strict';var moment=require(_0xecfa('0x0'));var Sequelize=require('sequelize');module[_0xecfa('0x1')]={'uniqueid':{'type':Sequelize[_0xecfa('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xecfa('0x2')]},'joinAt':{'type':Sequelize[_0xecfa('0x3')]},'leaveAt':{'type':Sequelize[_0xecfa('0x3')]},'acceptAt':{'type':Sequelize[_0xecfa('0x3')]},'exitAt':{'type':Sequelize[_0xecfa('0x3')]},'reason':{'type':Sequelize[_0xecfa('0x2')]}};
\ No newline at end of file
index 09f09e3..fc445df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cab=['attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','OpenchannelQueueReport','rows','params','include','options','catch','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','type','key','model','keys','filters','intersection','query','fields'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9cab,0x17d));var _0xb9ca=function(_0x1343e4,_0xaba5a0){_0x1343e4=_0x1343e4-0x0;var _0x3977f2=_0x9cab[_0x1343e4];return _0x3977f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9ca('0x0'));var zipdir=require(_0xb9ca('0x1'));var jsonpatch=require(_0xb9ca('0x2'));var rp=require(_0xb9ca('0x3'));var moment=require('moment');var BPromise=require(_0xb9ca('0x4'));var Mustache=require(_0xb9ca('0x5'));var util=require(_0xb9ca('0x6'));var path=require('path');var sox=require(_0xb9ca('0x7'));var csv=require(_0xb9ca('0x8'));var ejs=require(_0xb9ca('0x9'));var fs=require('fs');var fs_extra=require(_0xb9ca('0xa'));var _=require(_0xb9ca('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb9ca('0xc'));var deskjs=require(_0xb9ca('0xd'));var toCsv=require(_0xb9ca('0x8'));var querystring=require(_0xb9ca('0xe'));var Papa=require(_0xb9ca('0xf'));var Redis=require(_0xb9ca('0x10'));var authService=require(_0xb9ca('0x11'));var qs=require(_0xb9ca('0x12'));var as=require(_0xb9ca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb9ca('0x14'));var utils=require('../../config/utils');var config=require(_0xb9ca('0x15'));var licenseUtil=require(_0xb9ca('0x16'));var db=require(_0xb9ca('0x17'))['db'];function respondWithStatusCode(_0x3a13fb,_0x4f6fe1){_0x4f6fe1=_0x4f6fe1||0xcc;return function(_0x21863d){if(_0x21863d){return _0x3a13fb[_0xb9ca('0x18')](_0x4f6fe1);}return _0x3a13fb['status'](_0x4f6fe1)[_0xb9ca('0x19')]();};}function respondWithResult(_0x48ad04,_0x4a1ab1){_0x4a1ab1=_0x4a1ab1||0xc8;return function(_0x558d9f){if(_0x558d9f){return _0x48ad04[_0xb9ca('0x1a')](_0x4a1ab1)[_0xb9ca('0x1b')](_0x558d9f);}};}function respondWithFilteredResult(_0xc52c2d,_0x2cf201){return function(_0x37b248){if(_0x37b248){var _0x472fec=typeof _0x2cf201[_0xb9ca('0x1c')]===_0xb9ca('0x1d')&&typeof _0x2cf201[_0xb9ca('0x1e')]==='undefined';var _0x18f139=_0x37b248[_0xb9ca('0x1f')];var _0x15f410=_0x472fec?0x0:_0x2cf201[_0xb9ca('0x1c')];var _0x2e02a0=_0x472fec?_0x37b248[_0xb9ca('0x1f')]:_0x2cf201[_0xb9ca('0x1c')]+_0x2cf201[_0xb9ca('0x1e')];var _0x233251;if(_0x2e02a0>=_0x18f139){_0x2e02a0=_0x18f139;_0x233251=0xc8;}else{_0x233251=0xce;}_0xc52c2d[_0xb9ca('0x1a')](_0x233251);return _0xc52c2d['set'](_0xb9ca('0x20'),_0x15f410+'-'+_0x2e02a0+'/'+_0x18f139)[_0xb9ca('0x1b')](_0x37b248);}return null;};}function patchUpdates(_0x531fb7){return function(_0x53820a){try{jsonpatch[_0xb9ca('0x21')](_0x53820a,_0x531fb7,!![]);}catch(_0x2ce8f9){return BPromise[_0xb9ca('0x22')](_0x2ce8f9);}return _0x53820a[_0xb9ca('0x23')]();};}function saveUpdates(_0x5bdfaa,_0x58ece8){return function(_0x18a468){if(_0x18a468){return _0x18a468[_0xb9ca('0x24')](_0x5bdfaa)['then'](function(_0x4b47a1){return _0x4b47a1;});}return null;};}function removeEntity(_0x2db1e3,_0x2bc259){return function(_0x11d7cb){if(_0x11d7cb){return _0x11d7cb['destroy']()[_0xb9ca('0x25')](function(){_0x2db1e3[_0xb9ca('0x1a')](0xcc)[_0xb9ca('0x19')]();});}};}function handleEntityNotFound(_0x4fc734,_0x5c1383){return function(_0x430408){if(!_0x430408){_0x4fc734[_0xb9ca('0x18')](0x194);}return _0x430408;};}function handleError(_0xca1070,_0x985486){_0x985486=_0x985486||0x1f4;return function(_0x52717c){logger[_0xb9ca('0x26')](_0x52717c[_0xb9ca('0x27')]);if(_0x52717c['name']){delete _0x52717c[_0xb9ca('0x28')];}_0xca1070['status'](_0x985486)['send'](_0x52717c);};}exports[_0xb9ca('0x29')]=function(_0x3df44f,_0x1250c0){var _0x5cbbed={},_0x5743bc={},_0x33dc3a={'count':0x0,'rows':[]};var _0x4d2804=_[_0xb9ca('0x2a')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x97971f){return{'name':_0x97971f['fieldName'],'type':_0x97971f[_0xb9ca('0x2b')][_0xb9ca('0x2c')]};});_0x5743bc[_0xb9ca('0x2d')]=_[_0xb9ca('0x2a')](_0x4d2804,_0xb9ca('0x28'));_0x5743bc['query']=_[_0xb9ca('0x2e')](_0x3df44f['query']);_0x5743bc[_0xb9ca('0x2f')]=_[_0xb9ca('0x30')](_0x5743bc['model'],_0x5743bc[_0xb9ca('0x31')]);_0x5cbbed['attributes']=_[_0xb9ca('0x30')](_0x5743bc[_0xb9ca('0x2d')],qs[_0xb9ca('0x32')](_0x3df44f[_0xb9ca('0x31')][_0xb9ca('0x32')]));_0x5cbbed[_0xb9ca('0x33')]=_0x5cbbed[_0xb9ca('0x33')]['length']?_0x5cbbed['attributes']:_0x5743bc[_0xb9ca('0x2d')];if(!_0x3df44f[_0xb9ca('0x31')][_0xb9ca('0x34')](_0xb9ca('0x35'))){_0x5cbbed[_0xb9ca('0x1e')]=qs[_0xb9ca('0x1e')](_0x3df44f['query'][_0xb9ca('0x1e')]);_0x5cbbed[_0xb9ca('0x1c')]=qs[_0xb9ca('0x1c')](_0x3df44f[_0xb9ca('0x31')][_0xb9ca('0x1c')]);}_0x5cbbed['order']=qs[_0xb9ca('0x36')](_0x3df44f[_0xb9ca('0x31')]['sort']);_0x5cbbed[_0xb9ca('0x37')]=qs[_0xb9ca('0x2f')](_[_0xb9ca('0x38')](_0x3df44f[_0xb9ca('0x31')],_0x5743bc[_0xb9ca('0x2f')]),_0x4d2804);if(_0x3df44f[_0xb9ca('0x31')][_0xb9ca('0x39')]){_0x5cbbed[_0xb9ca('0x37')]=_[_0xb9ca('0x3a')](_0x5cbbed[_0xb9ca('0x37')],{'$or':_[_0xb9ca('0x2a')](_0x4d2804,function(_0x309e3a){if(_0x309e3a[_0xb9ca('0x2b')]!==_0xb9ca('0x3b')){var _0x4eb27a={};_0x4eb27a[_0x309e3a[_0xb9ca('0x28')]]={'$like':'%'+_0x3df44f[_0xb9ca('0x31')][_0xb9ca('0x39')]+'%'};return _0x4eb27a;}})});}_0x5cbbed=_[_0xb9ca('0x3a')]({},_0x5cbbed,_0x3df44f['options']);var _0x2497e2={'where':_0x5cbbed[_0xb9ca('0x37')]};return db['OpenchannelQueueReport'][_0xb9ca('0x1f')](_0x2497e2)[_0xb9ca('0x25')](function(_0x528684){_0x33dc3a[_0xb9ca('0x1f')]=_0x528684;if(_0x3df44f['query'][_0xb9ca('0x3c')]){_0x5cbbed['include']=[{'all':!![]}];}return db[_0xb9ca('0x3d')]['findAll'](_0x5cbbed);})[_0xb9ca('0x25')](function(_0x57f2a0){_0x33dc3a[_0xb9ca('0x3e')]=_0x57f2a0;return _0x33dc3a;})['then'](respondWithFilteredResult(_0x1250c0,_0x5cbbed))['catch'](handleError(_0x1250c0,null));};exports['show']=function(_0x3bf030,_0x1535da){var _0x47a193={'raw':!![],'where':{'id':_0x3bf030[_0xb9ca('0x3f')]['id']}},_0x34c3e1={};_0x34c3e1[_0xb9ca('0x2d')]=_[_0xb9ca('0x2e')](db['OpenchannelQueueReport']['rawAttributes']);_0x34c3e1[_0xb9ca('0x31')]=_['keys'](_0x3bf030['query']);_0x34c3e1[_0xb9ca('0x2f')]=_[_0xb9ca('0x30')](_0x34c3e1[_0xb9ca('0x2d')],_0x34c3e1['query']);_0x47a193[_0xb9ca('0x33')]=_[_0xb9ca('0x30')](_0x34c3e1['model'],qs[_0xb9ca('0x32')](_0x3bf030[_0xb9ca('0x31')][_0xb9ca('0x32')]));_0x47a193[_0xb9ca('0x33')]=_0x47a193[_0xb9ca('0x33')]['length']?_0x47a193['attributes']:_0x34c3e1[_0xb9ca('0x2d')];if(_0x3bf030['query']['includeAll']){_0x47a193[_0xb9ca('0x40')]=[{'all':!![]}];}_0x47a193=_['merge']({},_0x47a193,_0x3bf030[_0xb9ca('0x41')]);return db[_0xb9ca('0x3d')]['find'](_0x47a193)['then'](handleEntityNotFound(_0x1535da,null))['then'](respondWithResult(_0x1535da,null))[_0xb9ca('0x42')](handleError(_0x1535da,null));};exports[_0xb9ca('0x43')]=function(_0x5515a7,_0x347e1e){return db[_0xb9ca('0x3d')]['create'](_0x5515a7['body'],{})[_0xb9ca('0x25')](respondWithResult(_0x347e1e,0xc9))[_0xb9ca('0x42')](handleError(_0x347e1e,null));};exports[_0xb9ca('0x24')]=function(_0x179d9d,_0x4649ba){if(_0x179d9d[_0xb9ca('0x44')]['id']){delete _0x179d9d['body']['id'];}return db[_0xb9ca('0x3d')][_0xb9ca('0x45')]({'where':{'id':_0x179d9d[_0xb9ca('0x3f')]['id']}})[_0xb9ca('0x25')](handleEntityNotFound(_0x4649ba,null))['then'](saveUpdates(_0x179d9d[_0xb9ca('0x44')],null))[_0xb9ca('0x25')](respondWithResult(_0x4649ba,null))[_0xb9ca('0x42')](handleError(_0x4649ba,null));};exports[_0xb9ca('0x46')]=function(_0x2ceec1,_0xb20e93){return db[_0xb9ca('0x3d')][_0xb9ca('0x45')]({'where':{'id':_0x2ceec1[_0xb9ca('0x3f')]['id']}})['then'](handleEntityNotFound(_0xb20e93,null))[_0xb9ca('0x25')](removeEntity(_0xb20e93,null))['catch'](handleError(_0xb20e93,null));};exports[_0xb9ca('0x47')]=function(_0x11de24,_0x41184e){return db['OpenchannelQueueReport']['describe']()[_0xb9ca('0x25')](respondWithResult(_0x41184e,null))[_0xb9ca('0x42')](handleError(_0x41184e,null));};
\ No newline at end of file
+var _0x51c1=['undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','filters','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','show','params','include','find','catch','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','limit'];(function(_0x2f7c40,_0xb36203){var _0x57a4a5=function(_0x47db35){while(--_0x47db35){_0x2f7c40['push'](_0x2f7c40['shift']());}};_0x57a4a5(++_0xb36203);}(_0x51c1,0x10c));var _0x151c=function(_0xe3e0af,_0x4564ed){_0xe3e0af=_0xe3e0af-0x0;var _0x4828e9=_0x51c1[_0xe3e0af];return _0x4828e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x151c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x151c('0x1'));var rp=require(_0x151c('0x2'));var moment=require(_0x151c('0x3'));var BPromise=require(_0x151c('0x4'));var Mustache=require(_0x151c('0x5'));var util=require(_0x151c('0x6'));var path=require(_0x151c('0x7'));var sox=require(_0x151c('0x8'));var csv=require('to-csv');var ejs=require(_0x151c('0x9'));var fs=require('fs');var fs_extra=require(_0x151c('0xa'));var _=require('lodash');var squel=require(_0x151c('0xb'));var crypto=require(_0x151c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x151c('0xd'));var toCsv=require(_0x151c('0xe'));var querystring=require(_0x151c('0xf'));var Papa=require(_0x151c('0x10'));var Redis=require('ioredis');var authService=require(_0x151c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x151c('0x12'));var hardwareService=require(_0x151c('0x13'));var logger=require(_0x151c('0x14'))('api');var utils=require(_0x151c('0x15'));var config=require(_0x151c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8979fd,_0x4a699a){_0x4a699a=_0x4a699a||0xcc;return function(_0x49f4d2){if(_0x49f4d2){return _0x8979fd[_0x151c('0x17')](_0x4a699a);}return _0x8979fd[_0x151c('0x18')](_0x4a699a)[_0x151c('0x19')]();};}function respondWithResult(_0x48f2c4,_0x2cd9d3){_0x2cd9d3=_0x2cd9d3||0xc8;return function(_0xb04ec9){if(_0xb04ec9){return _0x48f2c4[_0x151c('0x18')](_0x2cd9d3)[_0x151c('0x1a')](_0xb04ec9);}};}function respondWithFilteredResult(_0x1b7467,_0x3c61f8){return function(_0x5220ec){if(_0x5220ec){var _0x1f74ec=typeof _0x3c61f8['offset']==='undefined'&&typeof _0x3c61f8[_0x151c('0x1b')]===_0x151c('0x1c');var _0x3ad1e4=_0x5220ec[_0x151c('0x1d')];var _0x37c475=_0x1f74ec?0x0:_0x3c61f8[_0x151c('0x1e')];var _0x437c3a=_0x1f74ec?_0x5220ec[_0x151c('0x1d')]:_0x3c61f8['offset']+_0x3c61f8[_0x151c('0x1b')];var _0x5405c0;if(_0x437c3a>=_0x3ad1e4){_0x437c3a=_0x3ad1e4;_0x5405c0=0xc8;}else{_0x5405c0=0xce;}_0x1b7467[_0x151c('0x18')](_0x5405c0);return _0x1b7467[_0x151c('0x1f')](_0x151c('0x20'),_0x37c475+'-'+_0x437c3a+'/'+_0x3ad1e4)[_0x151c('0x1a')](_0x5220ec);}return null;};}function patchUpdates(_0x518f58){return function(_0x370835){try{jsonpatch[_0x151c('0x21')](_0x370835,_0x518f58,!![]);}catch(_0x567a86){return BPromise[_0x151c('0x22')](_0x567a86);}return _0x370835[_0x151c('0x23')]();};}function saveUpdates(_0x4a1c54,_0x85f585){return function(_0x37cae5){if(_0x37cae5){return _0x37cae5[_0x151c('0x24')](_0x4a1c54)[_0x151c('0x25')](function(_0x4baf62){return _0x4baf62;});}return null;};}function removeEntity(_0x3b5eca,_0x4d13e4){return function(_0x5bb90a){if(_0x5bb90a){return _0x5bb90a[_0x151c('0x26')]()['then'](function(){_0x3b5eca[_0x151c('0x18')](0xcc)[_0x151c('0x19')]();});}};}function handleEntityNotFound(_0x340b6b,_0x25d869){return function(_0xe67fb){if(!_0xe67fb){_0x340b6b[_0x151c('0x17')](0x194);}return _0xe67fb;};}function handleError(_0x3e555f,_0x587e11){_0x587e11=_0x587e11||0x1f4;return function(_0x3dbf4b){logger[_0x151c('0x27')](_0x3dbf4b['stack']);if(_0x3dbf4b[_0x151c('0x28')]){delete _0x3dbf4b['name'];}_0x3e555f['status'](_0x587e11)[_0x151c('0x29')](_0x3dbf4b);};}exports[_0x151c('0x2a')]=function(_0x3fadd4,_0x2fdcf0){var _0x31b6ca={},_0x434ce1={},_0x78c7a9={'count':0x0,'rows':[]};var _0x5226d0=_[_0x151c('0x2b')](db[_0x151c('0x2c')][_0x151c('0x2d')],function(_0x40ae00){return{'name':_0x40ae00[_0x151c('0x2e')],'type':_0x40ae00['type'][_0x151c('0x2f')]};});_0x434ce1['model']=_['map'](_0x5226d0,_0x151c('0x28'));_0x434ce1['query']=_[_0x151c('0x30')](_0x3fadd4[_0x151c('0x31')]);_0x434ce1['filters']=_['intersection'](_0x434ce1['model'],_0x434ce1[_0x151c('0x31')]);_0x31b6ca['attributes']=_[_0x151c('0x32')](_0x434ce1[_0x151c('0x33')],qs[_0x151c('0x34')](_0x3fadd4[_0x151c('0x31')]['fields']));_0x31b6ca[_0x151c('0x35')]=_0x31b6ca['attributes'][_0x151c('0x36')]?_0x31b6ca[_0x151c('0x35')]:_0x434ce1[_0x151c('0x33')];if(!_0x3fadd4['query']['hasOwnProperty'](_0x151c('0x37'))){_0x31b6ca[_0x151c('0x1b')]=qs[_0x151c('0x1b')](_0x3fadd4[_0x151c('0x31')]['limit']);_0x31b6ca[_0x151c('0x1e')]=qs[_0x151c('0x1e')](_0x3fadd4['query'][_0x151c('0x1e')]);}_0x31b6ca[_0x151c('0x38')]=qs['sort'](_0x3fadd4[_0x151c('0x31')][_0x151c('0x39')]);_0x31b6ca['where']=qs[_0x151c('0x3a')](_['pick'](_0x3fadd4[_0x151c('0x31')],_0x434ce1[_0x151c('0x3a')]),_0x5226d0);if(_0x3fadd4[_0x151c('0x31')][_0x151c('0x3b')]){_0x31b6ca['where']=_[_0x151c('0x3c')](_0x31b6ca[_0x151c('0x3d')],{'$or':_[_0x151c('0x2b')](_0x5226d0,function(_0x1fbb18){if(_0x1fbb18[_0x151c('0x3e')]!==_0x151c('0x3f')){var _0x4de238={};_0x4de238[_0x1fbb18[_0x151c('0x28')]]={'$like':'%'+_0x3fadd4['query'][_0x151c('0x3b')]+'%'};return _0x4de238;}})});}_0x31b6ca=_[_0x151c('0x3c')]({},_0x31b6ca,_0x3fadd4[_0x151c('0x40')]);var _0x1b872f={'where':_0x31b6ca[_0x151c('0x3d')]};return db[_0x151c('0x2c')]['count'](_0x1b872f)[_0x151c('0x25')](function(_0xeab18a){_0x78c7a9[_0x151c('0x1d')]=_0xeab18a;if(_0x3fadd4[_0x151c('0x31')][_0x151c('0x41')]){_0x31b6ca['include']=[{'all':!![]}];}return db[_0x151c('0x2c')][_0x151c('0x42')](_0x31b6ca);})[_0x151c('0x25')](function(_0x179b98){_0x78c7a9['rows']=_0x179b98;return _0x78c7a9;})[_0x151c('0x25')](respondWithFilteredResult(_0x2fdcf0,_0x31b6ca))['catch'](handleError(_0x2fdcf0,null));};exports[_0x151c('0x43')]=function(_0x51b1fb,_0xca999a){var _0x4f9d6c={'raw':!![],'where':{'id':_0x51b1fb[_0x151c('0x44')]['id']}},_0x558980={};_0x558980['model']=_[_0x151c('0x30')](db[_0x151c('0x2c')][_0x151c('0x2d')]);_0x558980[_0x151c('0x31')]=_[_0x151c('0x30')](_0x51b1fb[_0x151c('0x31')]);_0x558980[_0x151c('0x3a')]=_[_0x151c('0x32')](_0x558980[_0x151c('0x33')],_0x558980[_0x151c('0x31')]);_0x4f9d6c[_0x151c('0x35')]=_[_0x151c('0x32')](_0x558980[_0x151c('0x33')],qs[_0x151c('0x34')](_0x51b1fb[_0x151c('0x31')][_0x151c('0x34')]));_0x4f9d6c['attributes']=_0x4f9d6c[_0x151c('0x35')][_0x151c('0x36')]?_0x4f9d6c[_0x151c('0x35')]:_0x558980[_0x151c('0x33')];if(_0x51b1fb[_0x151c('0x31')][_0x151c('0x41')]){_0x4f9d6c[_0x151c('0x45')]=[{'all':!![]}];}_0x4f9d6c=_['merge']({},_0x4f9d6c,_0x51b1fb[_0x151c('0x40')]);return db[_0x151c('0x2c')][_0x151c('0x46')](_0x4f9d6c)['then'](handleEntityNotFound(_0xca999a,null))[_0x151c('0x25')](respondWithResult(_0xca999a,null))[_0x151c('0x47')](handleError(_0xca999a,null));};exports[_0x151c('0x48')]=function(_0xed6bb2,_0xec8a23){return db[_0x151c('0x2c')][_0x151c('0x48')](_0xed6bb2[_0x151c('0x49')],{})['then'](respondWithResult(_0xec8a23,0xc9))[_0x151c('0x47')](handleError(_0xec8a23,null));};exports[_0x151c('0x24')]=function(_0x1c1097,_0x167db2){if(_0x1c1097[_0x151c('0x49')]['id']){delete _0x1c1097[_0x151c('0x49')]['id'];}return db[_0x151c('0x2c')][_0x151c('0x46')]({'where':{'id':_0x1c1097['params']['id']}})[_0x151c('0x25')](handleEntityNotFound(_0x167db2,null))['then'](saveUpdates(_0x1c1097['body'],null))['then'](respondWithResult(_0x167db2,null))[_0x151c('0x47')](handleError(_0x167db2,null));};exports[_0x151c('0x26')]=function(_0x51bc5c,_0x34128a){return db[_0x151c('0x2c')][_0x151c('0x46')]({'where':{'id':_0x51bc5c[_0x151c('0x44')]['id']}})[_0x151c('0x25')](handleEntityNotFound(_0x34128a,null))[_0x151c('0x25')](removeEntity(_0x34128a,null))[_0x151c('0x47')](handleError(_0x34128a,null));};exports['describe']=function(_0x403526,_0x584304){return db[_0x151c('0x2c')]['describe']()[_0x151c('0x25')](respondWithResult(_0x584304,null))['catch'](handleError(_0x584304,null));};
\ No newline at end of file
index a75069e..ddc74ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x58a73d,_0x450aad){var _0x1510e5=function(_0x18465b){while(--_0x18465b){_0x58a73d['push'](_0x58a73d['shift']());}};_0x1510e5(++_0x450aad);}(_0x2ef3,0xba));var _0x32ef=function(_0x98d031,_0x55235a){_0x98d031=_0x98d031-0x0;var _0x373901=_0x2ef3[_0x98d031];return _0x373901;};'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')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0xda5904,_0xa5f648){var _0x2d5306=function(_0xae044e){while(--_0xae044e){_0xda5904['push'](_0xda5904['shift']());}};_0x2d5306(++_0xa5f648);}(_0xe14b,0x93));var _0xbe14=function(_0x20221d,_0x21edd6){_0x20221d=_0x20221d-0x0;var _0x1e00fd=_0xe14b[_0x20221d];return _0x1e00fd;};'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 9de4e92..97146d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd070=['catch','create','options','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x332ef9,_0x387cb2){var _0x64da7d=function(_0x34daa0){while(--_0x34daa0){_0x332ef9['push'](_0x332ef9['shift']());}};_0x64da7d(++_0x387cb2);}(_0xd070,0x8e));var _0x0d07=function(_0x490be4,_0x32b4e4){_0x490be4=_0x490be4-0x0;var _0x20e395=_0xd070[_0x490be4];return _0x20e395;};'use strict';var _=require(_0x0d07('0x0'));var util=require('util');var moment=require(_0x0d07('0x1'));var BPromise=require(_0x0d07('0x2'));var rs=require(_0x0d07('0x3'));var fs=require('fs');var Redis=require(_0x0d07('0x4'));var db=require(_0x0d07('0x5'))['db'];var utils=require(_0x0d07('0x6'));var logger=require(_0x0d07('0x7'))(_0x0d07('0x8'));var config=require(_0x0d07('0x9'));var jayson=require(_0x0d07('0xa'));var client=jayson[_0x0d07('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13d75a,_0x5a4366,_0x20fd56){return new BPromise(function(_0x8c16d8,_0x1f989e){return client[_0x0d07('0xc')](_0x13d75a,_0x20fd56)[_0x0d07('0xd')](function(_0xc5b04d){logger[_0x0d07('0xe')](_0x0d07('0xf'),_0x5a4366,_0x0d07('0x10'));logger[_0x0d07('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x5a4366,'request\x20sent',JSON[_0x0d07('0x12')](_0xc5b04d));if(_0xc5b04d[_0x0d07('0x13')]){if(_0xc5b04d['error'][_0x0d07('0x14')]===0x1f4){logger['error'](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')]['message']);return _0x1f989e(_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);}logger[_0x0d07('0x13')](_0x0d07('0xf'),_0x5a4366,_0xc5b04d[_0x0d07('0x13')][_0x0d07('0x15')]);return _0x8c16d8(_0xc5b04d['error'][_0x0d07('0x15')]);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x5a4366,_0x0d07('0x10'));_0x8c16d8(_0xc5b04d[_0x0d07('0x16')][_0x0d07('0x15')]);}})[_0x0d07('0x17')](function(_0x220203){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x5a4366,_0x220203);_0x1f989e(_0x220203);});});}exports['CreateOpenchannelQueueReport']=function(_0x187df2){var _0x312015=this;return new Promise(function(_0x52cb4b,_0x410ad2){return db['OpenchannelQueueReport'][_0x0d07('0x18')](_0x187df2['body'],{'raw':_0x187df2['options']?_0x187df2[_0x0d07('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0d07('0xd')](function(_0x54790f){logger[_0x0d07('0xe')]('CreateOpenchannelQueueReport',_0x187df2);logger['debug'](_0x0d07('0x1a'),_0x187df2,JSON[_0x0d07('0x12')](_0x54790f));_0x52cb4b(_0x54790f);})[_0x0d07('0x17')](function(_0x57e997){logger[_0x0d07('0x13')]('CreateOpenchannelQueueReport',_0x57e997['message'],_0x187df2);_0x410ad2(_0x312015[_0x0d07('0x13')](0x1f4,_0x57e997[_0x0d07('0x15')]));});});};exports[_0x0d07('0x1b')]=function(_0x19f82f){var _0x4e0c97=this;return new Promise(function(_0x5898db,_0x9d9bfd){return db['OpenchannelQueueReport'][_0x0d07('0x1c')](_0x19f82f[_0x0d07('0x1d')],{'raw':_0x19f82f['options']?_0x19f82f[_0x0d07('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19f82f['options']?_0x19f82f['options'][_0x0d07('0x1e')]||null:null,'attributes':_0x19f82f[_0x0d07('0x19')]?_0x19f82f[_0x0d07('0x19')][_0x0d07('0x1f')]||null:null,'limit':_0x19f82f[_0x0d07('0x19')]?_0x19f82f[_0x0d07('0x19')][_0x0d07('0x20')]||null:null})[_0x0d07('0xd')](function(_0x4c68d7){logger['info'](_0x0d07('0x1b'),_0x19f82f);logger[_0x0d07('0x11')](_0x0d07('0x1b'),_0x19f82f,JSON[_0x0d07('0x12')](_0x4c68d7));_0x5898db(_0x4c68d7);})[_0x0d07('0x17')](function(_0xb7d4d){logger[_0x0d07('0x13')](_0x0d07('0x1b'),_0xb7d4d[_0x0d07('0x15')],_0x19f82f);_0x9d9bfd(_0x4e0c97[_0x0d07('0x13')](0x1f4,_0xb7d4d[_0x0d07('0x15')]));});});};
\ No newline at end of file
+var _0x23a3=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','raw','UpdateOpenchannelQueueReport','body','options','where','attributes','limit','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0x23a3,0x131));var _0x323a=function(_0x363eb6,_0x28d16c){_0x363eb6=_0x363eb6-0x0;var _0x546fa6=_0x23a3[_0x363eb6];return _0x546fa6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x323a('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x323a('0x1'));var db=require(_0x323a('0x2'))['db'];var utils=require(_0x323a('0x3'));var logger=require(_0x323a('0x4'))(_0x323a('0x5'));var config=require(_0x323a('0x6'));var jayson=require(_0x323a('0x7'));var client=jayson[_0x323a('0x8')][_0x323a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ad5a,_0x3452d3,_0x3544bd){return new BPromise(function(_0x568996,_0x385a54){return client[_0x323a('0xa')](_0x50ad5a,_0x3544bd)[_0x323a('0xb')](function(_0x4a74bd){logger[_0x323a('0xc')](_0x323a('0xd'),_0x3452d3,_0x323a('0xe'));logger[_0x323a('0xf')](_0x323a('0x10'),_0x3452d3,_0x323a('0xe'),JSON[_0x323a('0x11')](_0x4a74bd));if(_0x4a74bd[_0x323a('0x12')]){if(_0x4a74bd[_0x323a('0x12')][_0x323a('0x13')]===0x1f4){logger[_0x323a('0x12')](_0x323a('0xd'),_0x3452d3,_0x4a74bd[_0x323a('0x12')][_0x323a('0x14')]);return _0x385a54(_0x4a74bd['error'][_0x323a('0x14')]);}logger['error'](_0x323a('0xd'),_0x3452d3,_0x4a74bd['error']['message']);return _0x568996(_0x4a74bd[_0x323a('0x12')]['message']);}else{logger[_0x323a('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3452d3,_0x323a('0xe'));_0x568996(_0x4a74bd[_0x323a('0x15')]['message']);}})[_0x323a('0x16')](function(_0x32674f){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x3452d3,_0x32674f);_0x385a54(_0x32674f);});});}exports[_0x323a('0x17')]=function(_0x221ae4){var _0x2feed1=this;return new Promise(function(_0x29dd21,_0x303338){return db[_0x323a('0x18')]['create'](_0x221ae4['body'],{'raw':_0x221ae4['options']?_0x221ae4['options'][_0x323a('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xc0f3e4){logger[_0x323a('0xc')](_0x323a('0x17'),_0x221ae4);logger[_0x323a('0xf')]('CreateOpenchannelQueueReport',_0x221ae4,JSON[_0x323a('0x11')](_0xc0f3e4));_0x29dd21(_0xc0f3e4);})['catch'](function(_0x12c8d7){logger[_0x323a('0x12')](_0x323a('0x17'),_0x12c8d7['message'],_0x221ae4);_0x303338(_0x2feed1[_0x323a('0x12')](0x1f4,_0x12c8d7[_0x323a('0x14')]));});});};exports[_0x323a('0x1a')]=function(_0x2960e0){var _0x35f8ec=this;return new Promise(function(_0x204f76,_0x5ba015){return db[_0x323a('0x18')]['update'](_0x2960e0[_0x323a('0x1b')],{'raw':_0x2960e0[_0x323a('0x1c')]?_0x2960e0[_0x323a('0x1c')][_0x323a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2960e0[_0x323a('0x1c')]?_0x2960e0['options'][_0x323a('0x1d')]||null:null,'attributes':_0x2960e0[_0x323a('0x1c')]?_0x2960e0[_0x323a('0x1c')][_0x323a('0x1e')]||null:null,'limit':_0x2960e0[_0x323a('0x1c')]?_0x2960e0['options'][_0x323a('0x1f')]||null:null})['then'](function(_0x24747b){logger[_0x323a('0xc')](_0x323a('0x1a'),_0x2960e0);logger[_0x323a('0xf')](_0x323a('0x1a'),_0x2960e0,JSON[_0x323a('0x11')](_0x24747b));_0x204f76(_0x24747b);})['catch'](function(_0x2a1a85){logger[_0x323a('0x12')]('UpdateOpenchannelQueueReport',_0x2a1a85[_0x323a('0x14')],_0x2960e0);_0x5ba015(_0x35f8ec['error'](0x1f4,_0x2a1a85['message']));});});};
\ No newline at end of file
index 1ac21f7..30c3174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c48=['./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a9c95,_0x2affe8){var _0x49c997=function(_0x561f26){while(--_0x561f26){_0x1a9c95['push'](_0x1a9c95['shift']());}};_0x49c997(++_0x2affe8);}(_0x2c48,0xca));var _0x82c4=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0x2c48[_0x15fc3c];return _0x94c5c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x82c4('0x0'));var timeout=require(_0x82c4('0x1'));var express=require(_0x82c4('0x2'));var router=express[_0x82c4('0x3')]();var fs_extra=require(_0x82c4('0x4'));var auth=require(_0x82c4('0x5'));var interaction=require(_0x82c4('0x6'));var config=require(_0x82c4('0x7'));var controller=require(_0x82c4('0x8'));router[_0x82c4('0x9')]('/',auth[_0x82c4('0xa')](),controller[_0x82c4('0xb')]);router['get'](_0x82c4('0xc'),auth[_0x82c4('0xa')](),controller['describe']);router[_0x82c4('0x9')](_0x82c4('0xd'),auth[_0x82c4('0xa')](),controller[_0x82c4('0xe')]);router[_0x82c4('0xf')]('/',auth[_0x82c4('0xa')](),controller[_0x82c4('0x10')]);router[_0x82c4('0x11')]('/:id',auth[_0x82c4('0xa')](),controller[_0x82c4('0x12')]);router[_0x82c4('0x13')](_0x82c4('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x82c4('0x14')]=router;
\ No newline at end of file
+var _0xeb06=['create','put','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeb06,0x6a));var _0x6eb0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xeb06[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x6eb0('0x0'));var util=require(_0x6eb0('0x1'));var path=require(_0x6eb0('0x2'));var timeout=require(_0x6eb0('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6eb0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6eb0('0x5'));var config=require(_0x6eb0('0x6'));var controller=require(_0x6eb0('0x7'));router[_0x6eb0('0x8')]('/',auth[_0x6eb0('0x9')](),controller[_0x6eb0('0xa')]);router[_0x6eb0('0x8')]('/describe',auth[_0x6eb0('0x9')](),controller['describe']);router['get'](_0x6eb0('0xb'),auth['isAuthenticated'](),controller[_0x6eb0('0xc')]);router['post']('/',auth[_0x6eb0('0x9')](),controller[_0x6eb0('0xd')]);router[_0x6eb0('0xe')](_0x6eb0('0xb'),auth['isAuthenticated'](),controller[_0x6eb0('0xf')]);router['delete'](_0x6eb0('0xb'),auth[_0x6eb0('0x9')](),controller[_0x6eb0('0x10')]);module['exports']=router;
\ No newline at end of file
index d54c17f..e55b307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3ac0ad,_0x9d75ae){var _0x3c0b18=function(_0x5da814){while(--_0x5da814){_0x3ac0ad['push'](_0x3ac0ad['shift']());}};_0x3c0b18(++_0x9d75ae);}(_0x70e0,0x17b));var _0x070e=function(_0x57e8c9,_0x4a99c4){_0x57e8c9=_0x57e8c9-0x0;var _0x352d16=_0x70e0[_0x57e8c9];return _0x352d16;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5d8d18,_0x341ad4){var _0x12cbb5=function(_0x5bd2d5){while(--_0x5bd2d5){_0x5d8d18['push'](_0x5d8d18['shift']());}};_0x12cbb5(++_0x341ad4);}(_0x008c,0x188));var _0xc008=function(_0x550eb7,_0x465856){_0x550eb7=_0x550eb7-0x0;var _0x33bffe=_0x008c[_0x550eb7];return _0x33bffe;};'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 4341bf0..dff3812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eda=['stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','pick','where','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','catch','show','params','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','apply','save','then','destroy','sendStatus'];(function(_0x4ce15c,_0x1bbcbd){var _0x5ee259=function(_0xfb0acd){while(--_0xfb0acd){_0x4ce15c['push'](_0x4ce15c['shift']());}};_0x5ee259(++_0x1bbcbd);}(_0x5eda,0xef));var _0xa5ed=function(_0x1870be,_0x20af98){_0x1870be=_0x1870be-0x0;var _0x4d816c=_0x5eda[_0x1870be];return _0x4d816c;};'use strict';var emlformat=require(_0xa5ed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5ed('0x1'));var jsonpatch=require(_0xa5ed('0x2'));var rp=require(_0xa5ed('0x3'));var moment=require(_0xa5ed('0x4'));var BPromise=require(_0xa5ed('0x5'));var Mustache=require('mustache');var util=require(_0xa5ed('0x6'));var path=require(_0xa5ed('0x7'));var sox=require('sox');var csv=require(_0xa5ed('0x8'));var ejs=require(_0xa5ed('0x9'));var fs=require('fs');var fs_extra=require(_0xa5ed('0xa'));var _=require(_0xa5ed('0xb'));var squel=require(_0xa5ed('0xc'));var crypto=require(_0xa5ed('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa5ed('0xe'));var toCsv=require(_0xa5ed('0x8'));var querystring=require(_0xa5ed('0xf'));var Papa=require(_0xa5ed('0x10'));var Redis=require(_0xa5ed('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa5ed('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5ed('0x13'))(_0xa5ed('0x14'));var utils=require(_0xa5ed('0x15'));var config=require(_0xa5ed('0x16'));var licenseUtil=require(_0xa5ed('0x17'));var db=require(_0xa5ed('0x18'))['db'];function respondWithStatusCode(_0xa1ca7,_0x1db7d5){_0x1db7d5=_0x1db7d5||0xcc;return function(_0x595010){if(_0x595010){return _0xa1ca7['sendStatus'](_0x1db7d5);}return _0xa1ca7[_0xa5ed('0x19')](_0x1db7d5)[_0xa5ed('0x1a')]();};}function respondWithResult(_0x4a7b6f,_0x150022){_0x150022=_0x150022||0xc8;return function(_0x2c3575){if(_0x2c3575){return _0x4a7b6f[_0xa5ed('0x19')](_0x150022)['json'](_0x2c3575);}};}function respondWithFilteredResult(_0x39f1fe,_0x5efd8e){return function(_0x188b44){if(_0x188b44){var _0x57f603=typeof _0x5efd8e['offset']===_0xa5ed('0x1b')&&typeof _0x5efd8e[_0xa5ed('0x1c')]===_0xa5ed('0x1b');var _0x4438e3=_0x188b44[_0xa5ed('0x1d')];var _0x4a861d=_0x57f603?0x0:_0x5efd8e[_0xa5ed('0x1e')];var _0x396ab5=_0x57f603?_0x188b44[_0xa5ed('0x1d')]:_0x5efd8e['offset']+_0x5efd8e[_0xa5ed('0x1c')];var _0x359b9e;if(_0x396ab5>=_0x4438e3){_0x396ab5=_0x4438e3;_0x359b9e=0xc8;}else{_0x359b9e=0xce;}_0x39f1fe[_0xa5ed('0x19')](_0x359b9e);return _0x39f1fe[_0xa5ed('0x1f')]('Content-Range',_0x4a861d+'-'+_0x396ab5+'/'+_0x4438e3)['json'](_0x188b44);}return null;};}function patchUpdates(_0x3dc2ea){return function(_0x5ea475){try{jsonpatch[_0xa5ed('0x20')](_0x5ea475,_0x3dc2ea,!![]);}catch(_0x10c344){return BPromise['reject'](_0x10c344);}return _0x5ea475[_0xa5ed('0x21')]();};}function saveUpdates(_0x4ac01e,_0x5e3dcb){return function(_0x44ad9c){if(_0x44ad9c){return _0x44ad9c['update'](_0x4ac01e)[_0xa5ed('0x22')](function(_0x4045ed){return _0x4045ed;});}return null;};}function removeEntity(_0x15f3cb,_0xa01168){return function(_0x1a72e4){if(_0x1a72e4){return _0x1a72e4[_0xa5ed('0x23')]()[_0xa5ed('0x22')](function(){_0x15f3cb[_0xa5ed('0x19')](0xcc)[_0xa5ed('0x1a')]();});}};}function handleEntityNotFound(_0xc00cc4,_0x257ff9){return function(_0x1a3b0a){if(!_0x1a3b0a){_0xc00cc4[_0xa5ed('0x24')](0x194);}return _0x1a3b0a;};}function handleError(_0x2a0e73,_0x30f6a2){_0x30f6a2=_0x30f6a2||0x1f4;return function(_0x1ffcf2){logger['error'](_0x1ffcf2[_0xa5ed('0x25')]);if(_0x1ffcf2[_0xa5ed('0x26')]){delete _0x1ffcf2['name'];}_0x2a0e73[_0xa5ed('0x19')](_0x30f6a2)[_0xa5ed('0x27')](_0x1ffcf2);};}exports[_0xa5ed('0x28')]=function(_0x198f16,_0x4fa686){var _0x368add={},_0x54685c={},_0x1c66b3={'count':0x0,'rows':[]};var _0x1b31b6=_[_0xa5ed('0x29')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x2844a6){return{'name':_0x2844a6[_0xa5ed('0x2a')],'type':_0x2844a6[_0xa5ed('0x2b')][_0xa5ed('0x2c')]};});_0x54685c[_0xa5ed('0x2d')]=_[_0xa5ed('0x29')](_0x1b31b6,_0xa5ed('0x26'));_0x54685c[_0xa5ed('0x2e')]=_[_0xa5ed('0x2f')](_0x198f16[_0xa5ed('0x2e')]);_0x54685c[_0xa5ed('0x30')]=_[_0xa5ed('0x31')](_0x54685c[_0xa5ed('0x2d')],_0x54685c[_0xa5ed('0x2e')]);_0x368add['attributes']=_[_0xa5ed('0x31')](_0x54685c[_0xa5ed('0x2d')],qs[_0xa5ed('0x32')](_0x198f16['query'][_0xa5ed('0x32')]));_0x368add[_0xa5ed('0x33')]=_0x368add[_0xa5ed('0x33')][_0xa5ed('0x34')]?_0x368add[_0xa5ed('0x33')]:_0x54685c['model'];if(!_0x198f16[_0xa5ed('0x2e')]['hasOwnProperty']('nolimit')){_0x368add[_0xa5ed('0x1c')]=qs['limit'](_0x198f16[_0xa5ed('0x2e')][_0xa5ed('0x1c')]);_0x368add[_0xa5ed('0x1e')]=qs[_0xa5ed('0x1e')](_0x198f16[_0xa5ed('0x2e')][_0xa5ed('0x1e')]);}_0x368add['order']=qs[_0xa5ed('0x35')](_0x198f16[_0xa5ed('0x2e')][_0xa5ed('0x35')]);_0x368add['where']=qs['filters'](_[_0xa5ed('0x36')](_0x198f16['query'],_0x54685c[_0xa5ed('0x30')]),_0x1b31b6);if(_0x198f16[_0xa5ed('0x2e')]['filter']){_0x368add['where']=_['merge'](_0x368add[_0xa5ed('0x37')],{'$or':_[_0xa5ed('0x29')](_0x1b31b6,function(_0x591610){if(_0x591610[_0xa5ed('0x2b')]!==_0xa5ed('0x38')){var _0x2685bd={};_0x2685bd[_0x591610[_0xa5ed('0x26')]]={'$like':'%'+_0x198f16[_0xa5ed('0x2e')]['filter']+'%'};return _0x2685bd;}})});}_0x368add=_['merge']({},_0x368add,_0x198f16[_0xa5ed('0x39')]);var _0x271f26={'where':_0x368add[_0xa5ed('0x37')]};return db[_0xa5ed('0x3a')][_0xa5ed('0x1d')](_0x271f26)['then'](function(_0x140b20){_0x1c66b3['count']=_0x140b20;if(_0x198f16[_0xa5ed('0x2e')][_0xa5ed('0x3b')]){_0x368add[_0xa5ed('0x3c')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x368add);})[_0xa5ed('0x22')](function(_0x5454d6){_0x1c66b3['rows']=_0x5454d6;return _0x1c66b3;})[_0xa5ed('0x22')](respondWithFilteredResult(_0x4fa686,_0x368add))[_0xa5ed('0x3d')](handleError(_0x4fa686,null));};exports[_0xa5ed('0x3e')]=function(_0x577109,_0x57cfe7){var _0x292e42={'raw':!![],'where':{'id':_0x577109[_0xa5ed('0x3f')]['id']}},_0x350b2a={};_0x350b2a[_0xa5ed('0x2d')]=_[_0xa5ed('0x2f')](db[_0xa5ed('0x3a')]['rawAttributes']);_0x350b2a['query']=_['keys'](_0x577109[_0xa5ed('0x2e')]);_0x350b2a[_0xa5ed('0x30')]=_[_0xa5ed('0x31')](_0x350b2a[_0xa5ed('0x2d')],_0x350b2a[_0xa5ed('0x2e')]);_0x292e42['attributes']=_[_0xa5ed('0x31')](_0x350b2a[_0xa5ed('0x2d')],qs['fields'](_0x577109[_0xa5ed('0x2e')][_0xa5ed('0x32')]));_0x292e42[_0xa5ed('0x33')]=_0x292e42[_0xa5ed('0x33')][_0xa5ed('0x34')]?_0x292e42['attributes']:_0x350b2a['model'];if(_0x577109['query'][_0xa5ed('0x3b')]){_0x292e42['include']=[{'all':!![]}];}_0x292e42=_[_0xa5ed('0x40')]({},_0x292e42,_0x577109[_0xa5ed('0x39')]);return db['OpenchannelTransferReport'][_0xa5ed('0x41')](_0x292e42)['then'](handleEntityNotFound(_0x57cfe7,null))[_0xa5ed('0x22')](respondWithResult(_0x57cfe7,null))[_0xa5ed('0x3d')](handleError(_0x57cfe7,null));};exports[_0xa5ed('0x42')]=function(_0x5bc3ab,_0x478913){return db['OpenchannelTransferReport'][_0xa5ed('0x42')](_0x5bc3ab[_0xa5ed('0x43')],{})[_0xa5ed('0x22')](respondWithResult(_0x478913,0xc9))['catch'](handleError(_0x478913,null));};exports['update']=function(_0x1eea3e,_0x5f420e){if(_0x1eea3e[_0xa5ed('0x43')]['id']){delete _0x1eea3e['body']['id'];}return db['OpenchannelTransferReport'][_0xa5ed('0x41')]({'where':{'id':_0x1eea3e[_0xa5ed('0x3f')]['id']}})[_0xa5ed('0x22')](handleEntityNotFound(_0x5f420e,null))['then'](saveUpdates(_0x1eea3e[_0xa5ed('0x43')],null))[_0xa5ed('0x22')](respondWithResult(_0x5f420e,null))['catch'](handleError(_0x5f420e,null));};exports[_0xa5ed('0x23')]=function(_0x490f24,_0x219b5f){return db[_0xa5ed('0x3a')][_0xa5ed('0x41')]({'where':{'id':_0x490f24['params']['id']}})[_0xa5ed('0x22')](handleEntityNotFound(_0x219b5f,null))[_0xa5ed('0x22')](removeEntity(_0x219b5f,null))[_0xa5ed('0x3d')](handleError(_0x219b5f,null));};exports[_0xa5ed('0x44')]=function(_0x483fc1,_0x382327){return db[_0xa5ed('0x3a')][_0xa5ed('0x44')]()['then'](respondWithResult(_0x382327,null))['catch'](handleError(_0x382327,null));};
\ No newline at end of file
+var _0x366a=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','end','map','OpenchannelTransferReport','fieldName','type','key','model','name','query','keys','filters','intersection'];(function(_0x5e2a12,_0x32f699){var _0x81b1f1=function(_0x1f34b4){while(--_0x1f34b4){_0x5e2a12['push'](_0x5e2a12['shift']());}};_0x81b1f1(++_0x32f699);}(_0x366a,0xee));var _0xa366=function(_0x3b16e1,_0x3bda3e){_0x3b16e1=_0x3b16e1-0x0;var _0x311d1b=_0x366a[_0x3b16e1];return _0x311d1b;};'use strict';var emlformat=require(_0xa366('0x0'));var rimraf=require(_0xa366('0x1'));var zipdir=require(_0xa366('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa366('0x3'));var BPromise=require(_0xa366('0x4'));var Mustache=require(_0xa366('0x5'));var util=require('util');var path=require(_0xa366('0x6'));var sox=require(_0xa366('0x7'));var csv=require(_0xa366('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa366('0x9'));var _=require(_0xa366('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa366('0xb'));var deskjs=require(_0xa366('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa366('0xd'));var Papa=require(_0xa366('0xe'));var Redis=require(_0xa366('0xf'));var authService=require(_0xa366('0x10'));var qs=require(_0xa366('0x11'));var as=require(_0xa366('0x12'));var hardwareService=require(_0xa366('0x13'));var logger=require(_0xa366('0x14'))('api');var utils=require(_0xa366('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa366('0x16'));var db=require(_0xa366('0x17'))['db'];function respondWithStatusCode(_0x20be87,_0x270f7c){_0x270f7c=_0x270f7c||0xcc;return function(_0x235787){if(_0x235787){return _0x20be87[_0xa366('0x18')](_0x270f7c);}return _0x20be87['status'](_0x270f7c)['end']();};}function respondWithResult(_0x5e168c,_0xbfdbfa){_0xbfdbfa=_0xbfdbfa||0xc8;return function(_0x1f7efa){if(_0x1f7efa){return _0x5e168c['status'](_0xbfdbfa)[_0xa366('0x19')](_0x1f7efa);}};}function respondWithFilteredResult(_0x53e2db,_0xaeccb9){return function(_0x1b9d0c){if(_0x1b9d0c){var _0x4d8a11=typeof _0xaeccb9[_0xa366('0x1a')]===_0xa366('0x1b')&&typeof _0xaeccb9[_0xa366('0x1c')]===_0xa366('0x1b');var _0xc1fdc2=_0x1b9d0c[_0xa366('0x1d')];var _0x1fd2d6=_0x4d8a11?0x0:_0xaeccb9[_0xa366('0x1a')];var _0x5e62ec=_0x4d8a11?_0x1b9d0c[_0xa366('0x1d')]:_0xaeccb9['offset']+_0xaeccb9[_0xa366('0x1c')];var _0x1cc4f0;if(_0x5e62ec>=_0xc1fdc2){_0x5e62ec=_0xc1fdc2;_0x1cc4f0=0xc8;}else{_0x1cc4f0=0xce;}_0x53e2db[_0xa366('0x1e')](_0x1cc4f0);return _0x53e2db[_0xa366('0x1f')](_0xa366('0x20'),_0x1fd2d6+'-'+_0x5e62ec+'/'+_0xc1fdc2)[_0xa366('0x19')](_0x1b9d0c);}return null;};}function patchUpdates(_0x25582d){return function(_0x16d39f){try{jsonpatch[_0xa366('0x21')](_0x16d39f,_0x25582d,!![]);}catch(_0x423d03){return BPromise[_0xa366('0x22')](_0x423d03);}return _0x16d39f[_0xa366('0x23')]();};}function saveUpdates(_0x5df182,_0x4044b4){return function(_0xd2b7e7){if(_0xd2b7e7){return _0xd2b7e7['update'](_0x5df182)[_0xa366('0x24')](function(_0x5cb641){return _0x5cb641;});}return null;};}function removeEntity(_0x5f599b,_0x567c4a){return function(_0x1f9ac4){if(_0x1f9ac4){return _0x1f9ac4[_0xa366('0x25')]()[_0xa366('0x24')](function(){_0x5f599b[_0xa366('0x1e')](0xcc)[_0xa366('0x26')]();});}};}function handleEntityNotFound(_0x227a4a,_0xb1414b){return function(_0x4b1391){if(!_0x4b1391){_0x227a4a[_0xa366('0x18')](0x194);}return _0x4b1391;};}function handleError(_0x2202f9,_0x2995de){_0x2995de=_0x2995de||0x1f4;return function(_0x71e66c){logger['error'](_0x71e66c['stack']);if(_0x71e66c['name']){delete _0x71e66c['name'];}_0x2202f9[_0xa366('0x1e')](_0x2995de)['send'](_0x71e66c);};}exports['index']=function(_0x4b48bf,_0x5a5b72){var _0x4e9f07={},_0x421516={},_0x397f28={'count':0x0,'rows':[]};var _0x143b81=_[_0xa366('0x27')](db[_0xa366('0x28')]['rawAttributes'],function(_0x27fc0e){return{'name':_0x27fc0e[_0xa366('0x29')],'type':_0x27fc0e[_0xa366('0x2a')][_0xa366('0x2b')]};});_0x421516[_0xa366('0x2c')]=_['map'](_0x143b81,_0xa366('0x2d'));_0x421516[_0xa366('0x2e')]=_[_0xa366('0x2f')](_0x4b48bf['query']);_0x421516[_0xa366('0x30')]=_[_0xa366('0x31')](_0x421516[_0xa366('0x2c')],_0x421516[_0xa366('0x2e')]);_0x4e9f07[_0xa366('0x32')]=_[_0xa366('0x31')](_0x421516[_0xa366('0x2c')],qs[_0xa366('0x33')](_0x4b48bf[_0xa366('0x2e')][_0xa366('0x33')]));_0x4e9f07[_0xa366('0x32')]=_0x4e9f07[_0xa366('0x32')][_0xa366('0x34')]?_0x4e9f07[_0xa366('0x32')]:_0x421516[_0xa366('0x2c')];if(!_0x4b48bf[_0xa366('0x2e')][_0xa366('0x35')](_0xa366('0x36'))){_0x4e9f07[_0xa366('0x1c')]=qs[_0xa366('0x1c')](_0x4b48bf[_0xa366('0x2e')]['limit']);_0x4e9f07[_0xa366('0x1a')]=qs[_0xa366('0x1a')](_0x4b48bf[_0xa366('0x2e')][_0xa366('0x1a')]);}_0x4e9f07[_0xa366('0x37')]=qs['sort'](_0x4b48bf[_0xa366('0x2e')][_0xa366('0x38')]);_0x4e9f07[_0xa366('0x39')]=qs[_0xa366('0x30')](_[_0xa366('0x3a')](_0x4b48bf[_0xa366('0x2e')],_0x421516[_0xa366('0x30')]),_0x143b81);if(_0x4b48bf[_0xa366('0x2e')][_0xa366('0x3b')]){_0x4e9f07[_0xa366('0x39')]=_[_0xa366('0x3c')](_0x4e9f07[_0xa366('0x39')],{'$or':_[_0xa366('0x27')](_0x143b81,function(_0x32cc53){if(_0x32cc53[_0xa366('0x2a')]!==_0xa366('0x3d')){var _0xd098d4={};_0xd098d4[_0x32cc53[_0xa366('0x2d')]]={'$like':'%'+_0x4b48bf[_0xa366('0x2e')][_0xa366('0x3b')]+'%'};return _0xd098d4;}})});}_0x4e9f07=_['merge']({},_0x4e9f07,_0x4b48bf[_0xa366('0x3e')]);var _0x22569b={'where':_0x4e9f07[_0xa366('0x39')]};return db[_0xa366('0x28')]['count'](_0x22569b)[_0xa366('0x24')](function(_0x366d9c){_0x397f28[_0xa366('0x1d')]=_0x366d9c;if(_0x4b48bf['query'][_0xa366('0x3f')]){_0x4e9f07[_0xa366('0x40')]=[{'all':!![]}];}return db[_0xa366('0x28')]['findAll'](_0x4e9f07);})['then'](function(_0x1ef6bf){_0x397f28['rows']=_0x1ef6bf;return _0x397f28;})[_0xa366('0x24')](respondWithFilteredResult(_0x5a5b72,_0x4e9f07))[_0xa366('0x41')](handleError(_0x5a5b72,null));};exports['show']=function(_0x290d7e,_0x244f0a){var _0x4c9aee={'raw':!![],'where':{'id':_0x290d7e['params']['id']}},_0x19a698={};_0x19a698[_0xa366('0x2c')]=_[_0xa366('0x2f')](db[_0xa366('0x28')][_0xa366('0x42')]);_0x19a698['query']=_[_0xa366('0x2f')](_0x290d7e[_0xa366('0x2e')]);_0x19a698[_0xa366('0x30')]=_[_0xa366('0x31')](_0x19a698['model'],_0x19a698[_0xa366('0x2e')]);_0x4c9aee[_0xa366('0x32')]=_[_0xa366('0x31')](_0x19a698['model'],qs[_0xa366('0x33')](_0x290d7e[_0xa366('0x2e')][_0xa366('0x33')]));_0x4c9aee['attributes']=_0x4c9aee[_0xa366('0x32')][_0xa366('0x34')]?_0x4c9aee[_0xa366('0x32')]:_0x19a698[_0xa366('0x2c')];if(_0x290d7e['query'][_0xa366('0x3f')]){_0x4c9aee[_0xa366('0x40')]=[{'all':!![]}];}_0x4c9aee=_[_0xa366('0x3c')]({},_0x4c9aee,_0x290d7e[_0xa366('0x3e')]);return db[_0xa366('0x28')][_0xa366('0x43')](_0x4c9aee)[_0xa366('0x24')](handleEntityNotFound(_0x244f0a,null))['then'](respondWithResult(_0x244f0a,null))[_0xa366('0x41')](handleError(_0x244f0a,null));};exports[_0xa366('0x44')]=function(_0x1cbcdd,_0x53998a){return db[_0xa366('0x28')][_0xa366('0x44')](_0x1cbcdd[_0xa366('0x45')],{})[_0xa366('0x24')](respondWithResult(_0x53998a,0xc9))[_0xa366('0x41')](handleError(_0x53998a,null));};exports['update']=function(_0x2e5fed,_0x205ee0){if(_0x2e5fed[_0xa366('0x45')]['id']){delete _0x2e5fed['body']['id'];}return db['OpenchannelTransferReport'][_0xa366('0x43')]({'where':{'id':_0x2e5fed['params']['id']}})[_0xa366('0x24')](handleEntityNotFound(_0x205ee0,null))[_0xa366('0x24')](saveUpdates(_0x2e5fed[_0xa366('0x45')],null))[_0xa366('0x24')](respondWithResult(_0x205ee0,null))[_0xa366('0x41')](handleError(_0x205ee0,null));};exports[_0xa366('0x25')]=function(_0x59a22b,_0x2973b4){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x59a22b[_0xa366('0x46')]['id']}})[_0xa366('0x24')](handleEntityNotFound(_0x2973b4,null))[_0xa366('0x24')](removeEntity(_0x2973b4,null))[_0xa366('0x41')](handleError(_0x2973b4,null));};exports[_0xa366('0x47')]=function(_0x14cd7c,_0x43ddb7){return db['OpenchannelTransferReport']['describe']()[_0xa366('0x24')](respondWithResult(_0x43ddb7,null))[_0xa366('0x41')](handleError(_0x43ddb7,null));};
\ No newline at end of file
index 20c1153..d30fff0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf150=['moment','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0xf150,0x10e));var _0x0f15=function(_0x3bae88,_0x23b993){_0x3bae88=_0x3bae88-0x0;var _0x204278=_0xf150[_0x3bae88];return _0x204278;};'use strict';var _=require(_0x0f15('0x0'));var util=require('util');var logger=require(_0x0f15('0x1'))(_0x0f15('0x2'));var moment=require(_0x0f15('0x3'));var BPromise=require('bluebird');var rp=require(_0x0f15('0x4'));var fs=require('fs');var path=require(_0x0f15('0x5'));var rimraf=require('rimraf');var config=require(_0x0f15('0x6'));var attributes=require(_0x0f15('0x7'));module[_0x0f15('0x8')]=function(_0x53275a,_0x20e3fc){return _0x53275a[_0x0f15('0x9')](_0x0f15('0xa'),attributes,{'tableName':_0x0f15('0xb'),'paranoid':![],'indexes':[{'name':_0x0f15('0xc'),'fields':[_0x0f15('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2154=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x24b78f,_0x22d90a){var _0x450887=function(_0x1d675a){while(--_0x1d675a){_0x24b78f['push'](_0x24b78f['shift']());}};_0x450887(++_0x22d90a);}(_0x2154,0x1df));var _0x4215=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x2154[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x4215('0x0'));var util=require('util');var logger=require(_0x4215('0x1'))(_0x4215('0x2'));var moment=require(_0x4215('0x3'));var BPromise=require(_0x4215('0x4'));var rp=require(_0x4215('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4215('0x6'));var config=require(_0x4215('0x7'));var attributes=require(_0x4215('0x8'));module[_0x4215('0x9')]=function(_0x43339c,_0x140742){return _0x43339c[_0x4215('0xa')](_0x4215('0xb'),attributes,{'tableName':_0x4215('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4215('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 876dd62..d32ed88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb0d=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x12d91e,_0x24fa73){_0x12d91e=_0x12d91e-0x0;var _0x253500=_0xeb0d[_0x12d91e];return _0x253500;};'use strict';var _=require(_0xdeb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdeb0('0x1'));var fs=require('fs');var Redis=require(_0xdeb0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xdeb0('0x3'));var logger=require(_0xdeb0('0x4'))(_0xdeb0('0x5'));var config=require(_0xdeb0('0x6'));var jayson=require(_0xdeb0('0x7'));var client=jayson[_0xdeb0('0x8')][_0xdeb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27ebaa,_0x55ffce,_0x28a1a4){return new BPromise(function(_0x16b36b,_0x541d8b){return client[_0xdeb0('0xa')](_0x27ebaa,_0x28a1a4)[_0xdeb0('0xb')](function(_0x3336a6){logger[_0xdeb0('0xc')](_0xdeb0('0xd'),_0x55ffce,_0xdeb0('0xe'));logger[_0xdeb0('0xf')](_0xdeb0('0x10'),_0x55ffce,'request\x20sent',JSON['stringify'](_0x3336a6));if(_0x3336a6[_0xdeb0('0x11')]){if(_0x3336a6['error'][_0xdeb0('0x12')]===0x1f4){logger[_0xdeb0('0x11')](_0xdeb0('0xd'),_0x55ffce,_0x3336a6[_0xdeb0('0x11')][_0xdeb0('0x13')]);return _0x541d8b(_0x3336a6[_0xdeb0('0x11')][_0xdeb0('0x13')]);}logger[_0xdeb0('0x11')](_0xdeb0('0xd'),_0x55ffce,_0x3336a6['error'][_0xdeb0('0x13')]);return _0x16b36b(_0x3336a6[_0xdeb0('0x11')][_0xdeb0('0x13')]);}else{logger[_0xdeb0('0xc')](_0xdeb0('0xd'),_0x55ffce,'request\x20sent');_0x16b36b(_0x3336a6[_0xdeb0('0x14')]['message']);}})[_0xdeb0('0x15')](function(_0x473fb9){logger[_0xdeb0('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x55ffce,_0x473fb9);_0x541d8b(_0x473fb9);});});}
\ No newline at end of file
+var _0x3c6c=['jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3a054b,_0x480582){var _0x25cbe3=function(_0x104580){while(--_0x104580){_0x3a054b['push'](_0x3a054b['shift']());}};_0x25cbe3(++_0x480582);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x363ab2,_0x49f738){_0x363ab2=_0x363ab2-0x0;var _0xb88427=_0x3c6c[_0x363ab2];return _0xb88427;};'use strict';var _=require(_0xc3c6('0x0'));var util=require('util');var moment=require(_0xc3c6('0x1'));var BPromise=require(_0xc3c6('0x2'));var rs=require(_0xc3c6('0x3'));var fs=require('fs');var Redis=require(_0xc3c6('0x4'));var db=require(_0xc3c6('0x5'))['db'];var utils=require(_0xc3c6('0x6'));var logger=require(_0xc3c6('0x7'))(_0xc3c6('0x8'));var config=require('../../config/environment');var jayson=require(_0xc3c6('0x9'));var client=jayson['client'][_0xc3c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d7ae6,_0x50cd05,_0x4aed87){return new BPromise(function(_0x5185c3,_0x4f39dd){return client[_0xc3c6('0xb')](_0x4d7ae6,_0x4aed87)[_0xc3c6('0xc')](function(_0x5bc1c1){logger[_0xc3c6('0xd')](_0xc3c6('0xe'),_0x50cd05,_0xc3c6('0xf'));logger[_0xc3c6('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x50cd05,_0xc3c6('0xf'),JSON[_0xc3c6('0x11')](_0x5bc1c1));if(_0x5bc1c1[_0xc3c6('0x12')]){if(_0x5bc1c1['error']['code']===0x1f4){logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);return _0x4f39dd(_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);}logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);return _0x5185c3(_0x5bc1c1[_0xc3c6('0x12')][_0xc3c6('0x13')]);}else{logger[_0xc3c6('0xd')](_0xc3c6('0xe'),_0x50cd05,_0xc3c6('0xf'));_0x5185c3(_0x5bc1c1[_0xc3c6('0x14')][_0xc3c6('0x13')]);}})[_0xc3c6('0x15')](function(_0x33920c){logger[_0xc3c6('0x12')](_0xc3c6('0xe'),_0x50cd05,_0x33920c);_0x4f39dd(_0x33920c);});});}
\ No newline at end of file
index 3efbcc2..6dddc81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf717=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xf717,0x65));var _0x7f71=function(_0x3d4d05,_0x39c27c){_0x3d4d05=_0x3d4d05-0x0;var _0x58895c=_0xf717[_0x3d4d05];return _0x58895c;};'use strict';var multer=require(_0x7f71('0x0'));var util=require(_0x7f71('0x1'));var path=require(_0x7f71('0x2'));var timeout=require(_0x7f71('0x3'));var express=require('express');var router=express[_0x7f71('0x4')]();var fs_extra=require(_0x7f71('0x5'));var auth=require(_0x7f71('0x6'));var interaction=require(_0x7f71('0x7'));var config=require(_0x7f71('0x8'));var controller=require(_0x7f71('0x9'));router[_0x7f71('0xa')]('/',auth[_0x7f71('0xb')](),controller[_0x7f71('0xc')]);router[_0x7f71('0xa')](_0x7f71('0xd'),auth[_0x7f71('0xb')](),controller[_0x7f71('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7f71('0xf')]);router[_0x7f71('0x10')]('/:id',auth[_0x7f71('0xb')](),controller[_0x7f71('0x11')]);router[_0x7f71('0x12')](_0x7f71('0xd'),auth[_0x7f71('0xb')](),controller[_0x7f71('0x13')]);module[_0x7f71('0x14')]=router;
\ No newline at end of file
+var _0x85e5=['put','/:id','update','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show'];(function(_0x19f00b,_0x5de389){var _0x2f3354=function(_0x29e2d7){while(--_0x29e2d7){_0x19f00b['push'](_0x19f00b['shift']());}};_0x2f3354(++_0x5de389);}(_0x85e5,0x1b4));var _0x585e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x85e5[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x585e('0x0'));var util=require('util');var path=require(_0x585e('0x1'));var timeout=require(_0x585e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x585e('0x3'));var auth=require(_0x585e('0x4'));var interaction=require(_0x585e('0x5'));var config=require(_0x585e('0x6'));var controller=require(_0x585e('0x7'));router[_0x585e('0x8')]('/',auth[_0x585e('0x9')](),controller[_0x585e('0xa')]);router['get']('/:id',auth[_0x585e('0x9')](),controller[_0x585e('0xb')]);router['post']('/',auth[_0x585e('0x9')](),controller['create']);router[_0x585e('0xc')](_0x585e('0xd'),auth[_0x585e('0x9')](),controller[_0x585e('0xe')]);router['delete'](_0x585e('0xd'),auth[_0x585e('0x9')](),controller[_0x585e('0xf')]);module['exports']=router;
\ No newline at end of file
index f829289..4a561e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63af=['name','sequelize','exports','STRING'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x63af,0x1e9));var _0xf63a=function(_0x258874,_0x469590){_0x258874=_0x258874-0x0;var _0x89449f=_0x63af[_0x258874];return _0x89449f;};'use strict';var Sequelize=require(_0xf63a('0x0'));module[_0xf63a('0x1')]={'name':{'type':Sequelize[_0xf63a('0x2')],'unique':_0xf63a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xf63a('0x2')]}};
\ No newline at end of file
+var _0xaa73=['name','sequelize','exports','STRING'];(function(_0x5bc7ee,_0x2b85fc){var _0x1eb76a=function(_0x22758f){while(--_0x22758f){_0x5bc7ee['push'](_0x5bc7ee['shift']());}};_0x1eb76a(++_0x2b85fc);}(_0xaa73,0x195));var _0x3aa7=function(_0x1dd657,_0x39c717){_0x1dd657=_0x1dd657-0x0;var _0x1571e3=_0xaa73[_0x1dd657];return _0x1571e3;};'use strict';var Sequelize=require(_0x3aa7('0x0'));module[_0x3aa7('0x1')]={'name':{'type':Sequelize[_0x3aa7('0x2')],'unique':_0x3aa7('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 31d1770..97ddc0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ed8=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','reject','then','destroy','get','sendStatus','stack','name','send','index','map','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','merge','VIRTUAL','filter','options','Pause','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x4ed8,0x189));var _0x84ed=function(_0x31b927,_0xdf0f1a){_0x31b927=_0x31b927-0x0;var _0x1d87b9=_0x4ed8[_0x31b927];return _0x1d87b9;};'use strict';var emlformat=require(_0x84ed('0x0'));var rimraf=require(_0x84ed('0x1'));var zipdir=require(_0x84ed('0x2'));var jsonpatch=require(_0x84ed('0x3'));var rp=require(_0x84ed('0x4'));var moment=require(_0x84ed('0x5'));var BPromise=require(_0x84ed('0x6'));var Mustache=require('mustache');var util=require(_0x84ed('0x7'));var path=require(_0x84ed('0x8'));var sox=require(_0x84ed('0x9'));var csv=require(_0x84ed('0xa'));var ejs=require(_0x84ed('0xb'));var fs=require('fs');var fs_extra=require(_0x84ed('0xc'));var _=require(_0x84ed('0xd'));var squel=require(_0x84ed('0xe'));var crypto=require(_0x84ed('0xf'));var jsforce=require(_0x84ed('0x10'));var deskjs=require(_0x84ed('0x11'));var toCsv=require(_0x84ed('0xa'));var querystring=require(_0x84ed('0x12'));var Papa=require('papaparse');var Redis=require(_0x84ed('0x13'));var authService=require(_0x84ed('0x14'));var qs=require(_0x84ed('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x84ed('0x16'))('api');var utils=require(_0x84ed('0x17'));var config=require(_0x84ed('0x18'));var licenseUtil=require(_0x84ed('0x19'));var db=require(_0x84ed('0x1a'))['db'];function respondWithStatusCode(_0x3db456,_0x2c7293){_0x2c7293=_0x2c7293||0xcc;return function(_0x4bf669){if(_0x4bf669){return _0x3db456['sendStatus'](_0x2c7293);}return _0x3db456[_0x84ed('0x1b')](_0x2c7293)[_0x84ed('0x1c')]();};}function respondWithResult(_0x3598b2,_0x50c744){_0x50c744=_0x50c744||0xc8;return function(_0x19cefb){if(_0x19cefb){return _0x3598b2['status'](_0x50c744)[_0x84ed('0x1d')](_0x19cefb);}};}function respondWithFilteredResult(_0x2a306d,_0x300302){return function(_0x29c6f8){if(_0x29c6f8){var _0x12ceca=typeof _0x300302[_0x84ed('0x1e')]===_0x84ed('0x1f')&&typeof _0x300302[_0x84ed('0x20')]===_0x84ed('0x1f');var _0x59f19a=_0x29c6f8['count'];var _0x5104d0=_0x12ceca?0x0:_0x300302[_0x84ed('0x1e')];var _0x5e4ed1=_0x12ceca?_0x29c6f8['count']:_0x300302[_0x84ed('0x1e')]+_0x300302[_0x84ed('0x20')];var _0x1659f7;if(_0x5e4ed1>=_0x59f19a){_0x5e4ed1=_0x59f19a;_0x1659f7=0xc8;}else{_0x1659f7=0xce;}_0x2a306d[_0x84ed('0x1b')](_0x1659f7);return _0x2a306d[_0x84ed('0x21')](_0x84ed('0x22'),_0x5104d0+'-'+_0x5e4ed1+'/'+_0x59f19a)[_0x84ed('0x1d')](_0x29c6f8);}return null;};}function patchUpdates(_0x5bdb39){return function(_0x46bdff){try{jsonpatch['apply'](_0x46bdff,_0x5bdb39,!![]);}catch(_0x54cb2b){return BPromise[_0x84ed('0x23')](_0x54cb2b);}return _0x46bdff['save']();};}function saveUpdates(_0x36a443,_0x23f6ba){return function(_0x22455b){if(_0x22455b){return _0x22455b['update'](_0x36a443)[_0x84ed('0x24')](function(_0x115424){return _0x115424;});}return null;};}function removeEntity(_0xcb5fa9,_0x4236c2){return function(_0xc6620){if(_0xc6620){return _0xc6620[_0x84ed('0x25')]()[_0x84ed('0x24')](function(){var _0x51ae35=_0xc6620[_0x84ed('0x26')]({'plain':!![]});var _0x2d9640='Pauses';return db['UserProfileResource'][_0x84ed('0x25')]({'where':{'type':_0x2d9640,'resourceId':_0x51ae35['id']}})[_0x84ed('0x24')](function(){return _0xc6620;});})[_0x84ed('0x24')](function(){_0xcb5fa9[_0x84ed('0x1b')](0xcc)[_0x84ed('0x1c')]();});}};}function handleEntityNotFound(_0x211a42,_0x1305d5){return function(_0x5b2528){if(!_0x5b2528){_0x211a42[_0x84ed('0x27')](0x194);}return _0x5b2528;};}function handleError(_0x229181,_0x236e3f){_0x236e3f=_0x236e3f||0x1f4;return function(_0x512189){logger['error'](_0x512189[_0x84ed('0x28')]);if(_0x512189[_0x84ed('0x29')]){delete _0x512189[_0x84ed('0x29')];}_0x229181[_0x84ed('0x1b')](_0x236e3f)[_0x84ed('0x2a')](_0x512189);};}exports[_0x84ed('0x2b')]=function(_0x2172e8,_0x1864cc){var _0x1c481d={},_0x37a3c3={},_0x189ae9={'count':0x0,'rows':[]};var _0x1a7090=_[_0x84ed('0x2c')](db['Pause']['rawAttributes'],function(_0x1ee006){return{'name':_0x1ee006['fieldName'],'type':_0x1ee006[_0x84ed('0x2d')][_0x84ed('0x2e')]};});_0x37a3c3[_0x84ed('0x2f')]=_['map'](_0x1a7090,_0x84ed('0x29'));_0x37a3c3[_0x84ed('0x30')]=_[_0x84ed('0x31')](_0x2172e8[_0x84ed('0x30')]);_0x37a3c3['filters']=_[_0x84ed('0x32')](_0x37a3c3[_0x84ed('0x2f')],_0x37a3c3[_0x84ed('0x30')]);_0x1c481d[_0x84ed('0x33')]=_[_0x84ed('0x32')](_0x37a3c3[_0x84ed('0x2f')],qs[_0x84ed('0x34')](_0x2172e8[_0x84ed('0x30')][_0x84ed('0x34')]));_0x1c481d['attributes']=_0x1c481d[_0x84ed('0x33')][_0x84ed('0x35')]?_0x1c481d[_0x84ed('0x33')]:_0x37a3c3['model'];if(!_0x2172e8[_0x84ed('0x30')][_0x84ed('0x36')](_0x84ed('0x37'))){_0x1c481d[_0x84ed('0x20')]=qs[_0x84ed('0x20')](_0x2172e8['query'][_0x84ed('0x20')]);_0x1c481d[_0x84ed('0x1e')]=qs[_0x84ed('0x1e')](_0x2172e8[_0x84ed('0x30')]['offset']);}_0x1c481d[_0x84ed('0x38')]=qs[_0x84ed('0x39')](_0x2172e8[_0x84ed('0x30')]['sort']);_0x1c481d['where']=qs[_0x84ed('0x3a')](_['pick'](_0x2172e8[_0x84ed('0x30')],_0x37a3c3['filters']),_0x1a7090);if(_0x2172e8['query']['filter']){_0x1c481d['where']=_[_0x84ed('0x3b')](_0x1c481d['where'],{'$or':_['map'](_0x1a7090,function(_0x2b14d1){if(_0x2b14d1[_0x84ed('0x2d')]!==_0x84ed('0x3c')){var _0xb6824f={};_0xb6824f[_0x2b14d1[_0x84ed('0x29')]]={'$like':'%'+_0x2172e8[_0x84ed('0x30')][_0x84ed('0x3d')]+'%'};return _0xb6824f;}})});}_0x1c481d=_['merge']({},_0x1c481d,_0x2172e8[_0x84ed('0x3e')]);var _0x889508={'where':_0x1c481d['where']};return db[_0x84ed('0x3f')][_0x84ed('0x40')](_0x889508)[_0x84ed('0x24')](function(_0x39b12c){_0x189ae9[_0x84ed('0x40')]=_0x39b12c;if(_0x2172e8[_0x84ed('0x30')][_0x84ed('0x41')]){_0x1c481d[_0x84ed('0x42')]=[{'all':!![]}];}return db['Pause'][_0x84ed('0x43')](_0x1c481d);})[_0x84ed('0x24')](function(_0x4da905){_0x189ae9[_0x84ed('0x44')]=_0x4da905;return _0x189ae9;})['then'](respondWithFilteredResult(_0x1864cc,_0x1c481d))[_0x84ed('0x45')](handleError(_0x1864cc,null));};exports[_0x84ed('0x46')]=function(_0x5ee5d5,_0x468289){var _0x10e68e={'raw':!![],'where':{'id':_0x5ee5d5[_0x84ed('0x47')]['id']}},_0x58f444={};_0x58f444[_0x84ed('0x2f')]=_[_0x84ed('0x31')](db[_0x84ed('0x3f')]['rawAttributes']);_0x58f444[_0x84ed('0x30')]=_['keys'](_0x5ee5d5[_0x84ed('0x30')]);_0x58f444['filters']=_[_0x84ed('0x32')](_0x58f444[_0x84ed('0x2f')],_0x58f444[_0x84ed('0x30')]);_0x10e68e[_0x84ed('0x33')]=_[_0x84ed('0x32')](_0x58f444[_0x84ed('0x2f')],qs[_0x84ed('0x34')](_0x5ee5d5['query'][_0x84ed('0x34')]));_0x10e68e[_0x84ed('0x33')]=_0x10e68e['attributes'][_0x84ed('0x35')]?_0x10e68e[_0x84ed('0x33')]:_0x58f444[_0x84ed('0x2f')];if(_0x5ee5d5[_0x84ed('0x30')][_0x84ed('0x41')]){_0x10e68e[_0x84ed('0x42')]=[{'all':!![]}];}_0x10e68e=_[_0x84ed('0x3b')]({},_0x10e68e,_0x5ee5d5[_0x84ed('0x3e')]);return db[_0x84ed('0x3f')][_0x84ed('0x48')](_0x10e68e)[_0x84ed('0x24')](handleEntityNotFound(_0x468289,null))[_0x84ed('0x24')](respondWithResult(_0x468289,null))[_0x84ed('0x45')](handleError(_0x468289,null));};exports[_0x84ed('0x49')]=function(_0x331261,_0x428459){return db[_0x84ed('0x3f')][_0x84ed('0x49')](_0x331261[_0x84ed('0x4a')],{})[_0x84ed('0x24')](function(_0x1120ba){var _0x26d07a=_0x331261[_0x84ed('0x4b')][_0x84ed('0x26')]({'plain':!![]});if(!_0x26d07a)throw new Error(_0x84ed('0x4c'));if(_0x26d07a['role']===_0x84ed('0x4b')){var _0x19dabf=_0x1120ba[_0x84ed('0x26')]({'plain':!![]});var _0x3986e7=_0x84ed('0x4d');return db['UserProfileSection'][_0x84ed('0x48')]({'where':{'name':_0x3986e7,'userProfileId':_0x26d07a[_0x84ed('0x4e')]},'raw':!![]})[_0x84ed('0x24')](function(_0x1926bc){if(_0x1926bc&&_0x1926bc[_0x84ed('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x19dabf[_0x84ed('0x29')],'resourceId':_0x19dabf['id'],'type':_0x1926bc['name'],'sectionId':_0x1926bc['id']},{})[_0x84ed('0x24')](function(){return _0x1120ba;});}else{return _0x1120ba;}})[_0x84ed('0x45')](function(_0x5d4cdd){logger[_0x84ed('0x50')](_0x84ed('0x51'),_0x5d4cdd);throw _0x5d4cdd;});}return _0x1120ba;})[_0x84ed('0x24')](respondWithResult(_0x428459,0xc9))['catch'](handleError(_0x428459,null));};exports[_0x84ed('0x52')]=function(_0x5d0c96,_0x550aeb){if(_0x5d0c96[_0x84ed('0x4a')]['id']){delete _0x5d0c96['body']['id'];}return db[_0x84ed('0x3f')][_0x84ed('0x48')]({'where':{'id':_0x5d0c96[_0x84ed('0x47')]['id']}})[_0x84ed('0x24')](handleEntityNotFound(_0x550aeb,null))[_0x84ed('0x24')](saveUpdates(_0x5d0c96[_0x84ed('0x4a')],null))[_0x84ed('0x24')](respondWithResult(_0x550aeb,null))['catch'](handleError(_0x550aeb,null));};exports[_0x84ed('0x25')]=function(_0x46c951,_0x1575f4){return db[_0x84ed('0x3f')][_0x84ed('0x48')]({'where':{'id':_0x46c951['params']['id']}})[_0x84ed('0x24')](handleEntityNotFound(_0x1575f4,null))['then'](removeEntity(_0x1575f4,null))[_0x84ed('0x45')](handleError(_0x1575f4,null));};
\ No newline at end of file
+var _0x5a75=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','get','Pauses','UserProfileResource','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','Pause','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x5a75,0x1ed));var _0x55a7=function(_0x12c34e,_0x39287a){_0x12c34e=_0x12c34e-0x0;var _0x244e88=_0x5a75[_0x12c34e];return _0x244e88;};'use strict';var emlformat=require(_0x55a7('0x0'));var rimraf=require(_0x55a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55a7('0x2'));var rp=require(_0x55a7('0x3'));var moment=require(_0x55a7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x55a7('0x5'));var util=require(_0x55a7('0x6'));var path=require('path');var sox=require(_0x55a7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55a7('0x8'));var _=require(_0x55a7('0x9'));var squel=require(_0x55a7('0xa'));var crypto=require(_0x55a7('0xb'));var jsforce=require(_0x55a7('0xc'));var deskjs=require(_0x55a7('0xd'));var toCsv=require(_0x55a7('0xe'));var querystring=require(_0x55a7('0xf'));var Papa=require(_0x55a7('0x10'));var Redis=require(_0x55a7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x55a7('0x12'));var as=require(_0x55a7('0x13'));var hardwareService=require(_0x55a7('0x14'));var logger=require(_0x55a7('0x15'))(_0x55a7('0x16'));var utils=require(_0x55a7('0x17'));var config=require(_0x55a7('0x18'));var licenseUtil=require(_0x55a7('0x19'));var db=require(_0x55a7('0x1a'))['db'];function respondWithStatusCode(_0x1692f9,_0x37876e){_0x37876e=_0x37876e||0xcc;return function(_0x5cdc65){if(_0x5cdc65){return _0x1692f9['sendStatus'](_0x37876e);}return _0x1692f9[_0x55a7('0x1b')](_0x37876e)[_0x55a7('0x1c')]();};}function respondWithResult(_0x428127,_0x382caf){_0x382caf=_0x382caf||0xc8;return function(_0x34b6c3){if(_0x34b6c3){return _0x428127[_0x55a7('0x1b')](_0x382caf)[_0x55a7('0x1d')](_0x34b6c3);}};}function respondWithFilteredResult(_0x6312fb,_0x3139aa){return function(_0x3c0644){if(_0x3c0644){var _0x12acc9=typeof _0x3139aa['offset']==='undefined'&&typeof _0x3139aa[_0x55a7('0x1e')]===_0x55a7('0x1f');var _0x4690b2=_0x3c0644[_0x55a7('0x20')];var _0x293865=_0x12acc9?0x0:_0x3139aa[_0x55a7('0x21')];var _0x5489de=_0x12acc9?_0x3c0644[_0x55a7('0x20')]:_0x3139aa['offset']+_0x3139aa[_0x55a7('0x1e')];var _0x321564;if(_0x5489de>=_0x4690b2){_0x5489de=_0x4690b2;_0x321564=0xc8;}else{_0x321564=0xce;}_0x6312fb[_0x55a7('0x1b')](_0x321564);return _0x6312fb[_0x55a7('0x22')](_0x55a7('0x23'),_0x293865+'-'+_0x5489de+'/'+_0x4690b2)[_0x55a7('0x1d')](_0x3c0644);}return null;};}function patchUpdates(_0x5410b3){return function(_0x1701e1){try{jsonpatch[_0x55a7('0x24')](_0x1701e1,_0x5410b3,!![]);}catch(_0xd0fb68){return BPromise['reject'](_0xd0fb68);}return _0x1701e1[_0x55a7('0x25')]();};}function saveUpdates(_0x20172f,_0x47f3fc){return function(_0x5b7e72){if(_0x5b7e72){return _0x5b7e72[_0x55a7('0x26')](_0x20172f)[_0x55a7('0x27')](function(_0x2c911a){return _0x2c911a;});}return null;};}function removeEntity(_0x301335,_0x5bc97b){return function(_0x3b8db1){if(_0x3b8db1){return _0x3b8db1['destroy']()[_0x55a7('0x27')](function(){var _0x55ed38=_0x3b8db1[_0x55a7('0x28')]({'plain':!![]});var _0x50118d=_0x55a7('0x29');return db[_0x55a7('0x2a')]['destroy']({'where':{'type':_0x50118d,'resourceId':_0x55ed38['id']}})[_0x55a7('0x27')](function(){return _0x3b8db1;});})[_0x55a7('0x27')](function(){_0x301335[_0x55a7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x178608,_0x42910f){return function(_0x439cac){if(!_0x439cac){_0x178608['sendStatus'](0x194);}return _0x439cac;};}function handleError(_0x13c783,_0x14e609){_0x14e609=_0x14e609||0x1f4;return function(_0x4547c8){logger['error'](_0x4547c8[_0x55a7('0x2b')]);if(_0x4547c8[_0x55a7('0x2c')]){delete _0x4547c8[_0x55a7('0x2c')];}_0x13c783[_0x55a7('0x1b')](_0x14e609)[_0x55a7('0x2d')](_0x4547c8);};}exports[_0x55a7('0x2e')]=function(_0x4d77f8,_0x453de3){var _0x4b3696={},_0x284832={},_0x18de4d={'count':0x0,'rows':[]};var _0x487761=_['map'](db['Pause']['rawAttributes'],function(_0x52e8bc){return{'name':_0x52e8bc['fieldName'],'type':_0x52e8bc[_0x55a7('0x2f')][_0x55a7('0x30')]};});_0x284832[_0x55a7('0x31')]=_[_0x55a7('0x32')](_0x487761,_0x55a7('0x2c'));_0x284832[_0x55a7('0x33')]=_[_0x55a7('0x34')](_0x4d77f8[_0x55a7('0x33')]);_0x284832[_0x55a7('0x35')]=_[_0x55a7('0x36')](_0x284832[_0x55a7('0x31')],_0x284832[_0x55a7('0x33')]);_0x4b3696[_0x55a7('0x37')]=_[_0x55a7('0x36')](_0x284832[_0x55a7('0x31')],qs[_0x55a7('0x38')](_0x4d77f8[_0x55a7('0x33')][_0x55a7('0x38')]));_0x4b3696[_0x55a7('0x37')]=_0x4b3696[_0x55a7('0x37')][_0x55a7('0x39')]?_0x4b3696['attributes']:_0x284832[_0x55a7('0x31')];if(!_0x4d77f8[_0x55a7('0x33')][_0x55a7('0x3a')](_0x55a7('0x3b'))){_0x4b3696[_0x55a7('0x1e')]=qs[_0x55a7('0x1e')](_0x4d77f8[_0x55a7('0x33')][_0x55a7('0x1e')]);_0x4b3696[_0x55a7('0x21')]=qs[_0x55a7('0x21')](_0x4d77f8[_0x55a7('0x33')][_0x55a7('0x21')]);}_0x4b3696['order']=qs['sort'](_0x4d77f8[_0x55a7('0x33')][_0x55a7('0x3c')]);_0x4b3696['where']=qs[_0x55a7('0x35')](_[_0x55a7('0x3d')](_0x4d77f8['query'],_0x284832[_0x55a7('0x35')]),_0x487761);if(_0x4d77f8[_0x55a7('0x33')][_0x55a7('0x3e')]){_0x4b3696['where']=_[_0x55a7('0x3f')](_0x4b3696[_0x55a7('0x40')],{'$or':_[_0x55a7('0x32')](_0x487761,function(_0x36a714){if(_0x36a714[_0x55a7('0x2f')]!==_0x55a7('0x41')){var _0x1e28d8={};_0x1e28d8[_0x36a714[_0x55a7('0x2c')]]={'$like':'%'+_0x4d77f8[_0x55a7('0x33')][_0x55a7('0x3e')]+'%'};return _0x1e28d8;}})});}_0x4b3696=_[_0x55a7('0x3f')]({},_0x4b3696,_0x4d77f8[_0x55a7('0x42')]);var _0x38e805={'where':_0x4b3696['where']};return db[_0x55a7('0x43')]['count'](_0x38e805)[_0x55a7('0x27')](function(_0x207994){_0x18de4d[_0x55a7('0x20')]=_0x207994;if(_0x4d77f8[_0x55a7('0x33')][_0x55a7('0x44')]){_0x4b3696[_0x55a7('0x45')]=[{'all':!![]}];}return db[_0x55a7('0x43')][_0x55a7('0x46')](_0x4b3696);})[_0x55a7('0x27')](function(_0x1f7356){_0x18de4d[_0x55a7('0x47')]=_0x1f7356;return _0x18de4d;})[_0x55a7('0x27')](respondWithFilteredResult(_0x453de3,_0x4b3696))[_0x55a7('0x48')](handleError(_0x453de3,null));};exports[_0x55a7('0x49')]=function(_0x2b0929,_0x5726b2){var _0x77c368={'raw':!![],'where':{'id':_0x2b0929[_0x55a7('0x4a')]['id']}},_0x3b5443={};_0x3b5443['model']=_[_0x55a7('0x34')](db[_0x55a7('0x43')]['rawAttributes']);_0x3b5443[_0x55a7('0x33')]=_[_0x55a7('0x34')](_0x2b0929[_0x55a7('0x33')]);_0x3b5443[_0x55a7('0x35')]=_[_0x55a7('0x36')](_0x3b5443['model'],_0x3b5443[_0x55a7('0x33')]);_0x77c368[_0x55a7('0x37')]=_['intersection'](_0x3b5443[_0x55a7('0x31')],qs['fields'](_0x2b0929[_0x55a7('0x33')][_0x55a7('0x38')]));_0x77c368[_0x55a7('0x37')]=_0x77c368[_0x55a7('0x37')][_0x55a7('0x39')]?_0x77c368[_0x55a7('0x37')]:_0x3b5443[_0x55a7('0x31')];if(_0x2b0929[_0x55a7('0x33')][_0x55a7('0x44')]){_0x77c368[_0x55a7('0x45')]=[{'all':!![]}];}_0x77c368=_[_0x55a7('0x3f')]({},_0x77c368,_0x2b0929[_0x55a7('0x42')]);return db[_0x55a7('0x43')][_0x55a7('0x4b')](_0x77c368)[_0x55a7('0x27')](handleEntityNotFound(_0x5726b2,null))[_0x55a7('0x27')](respondWithResult(_0x5726b2,null))[_0x55a7('0x48')](handleError(_0x5726b2,null));};exports[_0x55a7('0x4c')]=function(_0x11ebe7,_0x1423a1){return db[_0x55a7('0x43')][_0x55a7('0x4c')](_0x11ebe7['body'],{})[_0x55a7('0x27')](function(_0x58bbd5){var _0x1b939f=_0x11ebe7['user'][_0x55a7('0x28')]({'plain':!![]});if(!_0x1b939f)throw new Error(_0x55a7('0x4d'));if(_0x1b939f[_0x55a7('0x4e')]==='user'){var _0x528265=_0x58bbd5[_0x55a7('0x28')]({'plain':!![]});var _0x412653=_0x55a7('0x29');return db[_0x55a7('0x4f')][_0x55a7('0x4b')]({'where':{'name':_0x412653,'userProfileId':_0x1b939f[_0x55a7('0x50')]},'raw':!![]})[_0x55a7('0x27')](function(_0x4551f7){if(_0x4551f7&&_0x4551f7[_0x55a7('0x51')]===0x0){return db[_0x55a7('0x2a')][_0x55a7('0x4c')]({'name':_0x528265[_0x55a7('0x2c')],'resourceId':_0x528265['id'],'type':_0x4551f7[_0x55a7('0x2c')],'sectionId':_0x4551f7['id']},{})['then'](function(){return _0x58bbd5;});}else{return _0x58bbd5;}})['catch'](function(_0x2dc0cc){logger[_0x55a7('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2dc0cc);throw _0x2dc0cc;});}return _0x58bbd5;})[_0x55a7('0x27')](respondWithResult(_0x1423a1,0xc9))[_0x55a7('0x48')](handleError(_0x1423a1,null));};exports[_0x55a7('0x26')]=function(_0x3efcfc,_0x4c4115){if(_0x3efcfc['body']['id']){delete _0x3efcfc[_0x55a7('0x53')]['id'];}return db['Pause'][_0x55a7('0x4b')]({'where':{'id':_0x3efcfc[_0x55a7('0x4a')]['id']}})[_0x55a7('0x27')](handleEntityNotFound(_0x4c4115,null))[_0x55a7('0x27')](saveUpdates(_0x3efcfc['body'],null))[_0x55a7('0x27')](respondWithResult(_0x4c4115,null))[_0x55a7('0x48')](handleError(_0x4c4115,null));};exports[_0x55a7('0x54')]=function(_0x695d86,_0x16bbaa){return db[_0x55a7('0x43')]['find']({'where':{'id':_0x695d86[_0x55a7('0x4a')]['id']}})[_0x55a7('0x27')](handleEntityNotFound(_0x16bbaa,null))[_0x55a7('0x27')](removeEntity(_0x16bbaa,null))[_0x55a7('0x48')](handleError(_0x16bbaa,null));};
\ No newline at end of file
index 11ddd66..83d08a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x84a363,_0x7b9af6){var _0x3a60aa=function(_0x4664b7){while(--_0x4664b7){_0x84a363['push'](_0x84a363['shift']());}};_0x3a60aa(++_0x7b9af6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0x5fc3[_0x8ae98b];return _0xc30bd4;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 872dc47..917ebc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x322aed,_0x2c48f4){var _0x2483eb=function(_0x3dabb2){while(--_0x3dabb2){_0x322aed['push'](_0x322aed['shift']());}};_0x2483eb(++_0x2c48f4);}(_0x7a54,0x106));var _0x47a5=function(_0x22594e,_0x54aa67){_0x22594e=_0x22594e-0x0;var _0x21a687=_0x7a54[_0x22594e];return _0x21a687;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x181301,_0x2bfb03){var _0x5a2246=function(_0x123ab2){while(--_0x123ab2){_0x181301['push'](_0x181301['shift']());}};_0x5a2246(++_0x2bfb03);}(_0xb10b,0x12a));var _0xbb10=function(_0x5be98f,_0x291688){_0x5be98f=_0x5be98f-0x0;var _0x1f66b4=_0xb10b[_0x5be98f];return _0x1f66b4;};'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 c05e0f9..052a01c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf873=['update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','basename','extname','now','post','file','upload','webhookPost'];(function(_0x4beab9,_0x464be1){var _0x3ba9a8=function(_0x5afb23){while(--_0x5afb23){_0x4beab9['push'](_0x4beab9['shift']());}};_0x3ba9a8(++_0x464be1);}(_0xf873,0xb2));var _0x3f87=function(_0x53990c,_0x4ccab6){_0x53990c=_0x53990c-0x0;var _0x32c1b4=_0xf873[_0x53990c];return _0x32c1b4;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./plugin.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),controller[_0x3f87('0xd')]);router[_0x3f87('0x9')](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xf')]);router['get'](_0x3f87('0x10'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x11')]);var upload=multer({'storage':multer[_0x3f87('0x12')]({'destination':function(_0x1ad2a9,_0xd41ca0,_0x2aa592){_0x2aa592(null,path[_0x3f87('0x13')](config[_0x3f87('0x14')],_0x3f87('0x15')));},'filename':function(_0x42fde8,_0x593e9,_0xfd5b65){_0x593e9[_0x3f87('0x16')]=_0x593e9['originalname'][_0x3f87('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xfd5b65(null,util[_0x3f87('0x18')]('%s-%s%s',path[_0x3f87('0x19')](_0x593e9[_0x3f87('0x16')],path[_0x3f87('0x1a')](_0x593e9[_0x3f87('0x16')])),Date[_0x3f87('0x1b')](),path[_0x3f87('0x1a')](_0x593e9[_0x3f87('0x16')])));}})});router[_0x3f87('0x1c')]('/',upload['single'](_0x3f87('0x1d')),controller[_0x3f87('0x1e')]);router[_0x3f87('0x1c')]('/webhook',controller[_0x3f87('0x1f')]);router['put'](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x20')]);router[_0x3f87('0x21')](_0x3f87('0xe'),auth['isAuthenticated'](),controller[_0x3f87('0x21')]);module[_0x3f87('0x22')]=router;
\ No newline at end of file
+var _0x4b84=['exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/webhook','get','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','basename','now','extname','upload','webhookPost','/:id','isAuthenticated','delete'];(function(_0x1afea4,_0x106601){var _0x3df48a=function(_0x597a7a){while(--_0x597a7a){_0x1afea4['push'](_0x1afea4['shift']());}};_0x3df48a(++_0x106601);}(_0x4b84,0x1cc));var _0x44b8=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x4b84[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x3'));var interaction=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var controller=require('./plugin.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),controller['webhookGet']);router[_0x44b8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x9')]);router[_0x44b8('0x8')](_0x44b8('0xa'),auth['isAuthenticated'](),controller[_0x44b8('0xb')]);var upload=multer({'storage':multer[_0x44b8('0xc')]({'destination':function(_0x4315f6,_0x9b6048,_0x24dd10){_0x24dd10(null,path[_0x44b8('0xd')](config[_0x44b8('0xe')],'server/files/plugins'));},'filename':function(_0x147529,_0x4301a6,_0x4bcc43){_0x4301a6[_0x44b8('0xf')]=_0x4301a6['originalname'][_0x44b8('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4bcc43(null,util[_0x44b8('0x11')]('%s-%s%s',path[_0x44b8('0x12')](_0x4301a6['originalname'],path['extname'](_0x4301a6[_0x44b8('0xf')])),Date[_0x44b8('0x13')](),path[_0x44b8('0x14')](_0x4301a6[_0x44b8('0xf')])));}})});router['post']('/',upload['single']('file'),controller[_0x44b8('0x15')]);router['post'](_0x44b8('0x7'),controller[_0x44b8('0x16')]);router['put'](_0x44b8('0x17'),auth[_0x44b8('0x18')](),controller['update']);router[_0x44b8('0x19')](_0x44b8('0x17'),auth['isAuthenticated'](),controller[_0x44b8('0x19')]);module[_0x44b8('0x1a')]=router;
\ No newline at end of file
index 0f7618e..0ae9eab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3603=['html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','ENUM'];(function(_0x317b63,_0x2acf92){var _0x36a2e2=function(_0x11024b){while(--_0x11024b){_0x317b63['push'](_0x317b63['shift']());}};_0x36a2e2(++_0x2acf92);}(_0x3603,0x102));var _0x3360=function(_0x525290,_0x361f7c){_0x525290=_0x525290-0x0;var _0x3dcbdd=_0x3603[_0x525290];return _0x3dcbdd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3360('0x0')]},'type':{'type':Sequelize[_0x3360('0x1')](_0x3360('0x2'),_0x3360('0x3'))},'description':{'type':Sequelize[_0x3360('0x4')]},'version':{'type':Sequelize[_0x3360('0x4')]},'path':{'type':Sequelize[_0x3360('0x0')],'comment':_0x3360('0x5')},'active':{'type':Sequelize[_0x3360('0x6')],'defaultValue':0x0,'comment':_0x3360('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x3360('0x8'),_0x3360('0x9'),_0x3360('0xa'),_0x3360('0xb')),'defaultValue':_0x3360('0xa'),'comment':_0x3360('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x3360('0x0')]},'agentUrl':{'type':Sequelize[_0x3360('0x0')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x3360('0x0')]}};
\ No newline at end of file
+var _0x1b69=['TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','ENUM','html','script'];(function(_0x36f5a4,_0x287ef3){var _0x162e10=function(_0x2ed9a5){while(--_0x2ed9a5){_0x36f5a4['push'](_0x36f5a4['shift']());}};_0x162e10(++_0x287ef3);}(_0x1b69,0x190));var _0x91b6=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x1b69[_0x32d457];return _0x338386;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x91b6('0x0')](_0x91b6('0x1'),_0x91b6('0x2'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x91b6('0x3')]},'path':{'type':Sequelize[_0x91b6('0x4')],'comment':_0x91b6('0x5')},'active':{'type':Sequelize[_0x91b6('0x6')],'defaultValue':0x0,'comment':_0x91b6('0x7')},'sidebar':{'type':Sequelize[_0x91b6('0x0')](_0x91b6('0x8'),_0x91b6('0x9'),_0x91b6('0xa'),_0x91b6('0xb')),'defaultValue':_0x91b6('0xa'),'comment':_0x91b6('0xc')},'icon':{'type':Sequelize[_0x91b6('0x4')]},'adminUrl':{'type':Sequelize[_0x91b6('0x4')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x91b6('0x4')]}};
\ No newline at end of file
index 215f061..5ce2036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fb4=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','include','rows','catch','show','params','includeAll','download','server/files/plugins','format','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','root','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','type','Invalid\x20manifest:\x20type\x20missing','parameters','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','version','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','role','user','UserProfileSection','find','Plugins','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','set','statusCode','webhookPost','%s%s','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3a0ad0,_0x49b001){var _0x15c93c=function(_0x508c92){while(--_0x508c92){_0x3a0ad0['push'](_0x3a0ad0['shift']());}};_0x15c93c(++_0x49b001);}(_0x9fb4,0x92));var _0x49fb=function(_0x5cbace,_0x33943c){_0x5cbace=_0x5cbace-0x0;var _0x6de5b8=_0x9fb4[_0x5cbace];return _0x6de5b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x49fb('0x0'));var zipdir=require(_0x49fb('0x1'));var jsonpatch=require(_0x49fb('0x2'));var rp=require('request-promise');var moment=require(_0x49fb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x49fb('0x4'));var util=require('util');var path=require(_0x49fb('0x5'));var sox=require(_0x49fb('0x6'));var csv=require(_0x49fb('0x7'));var ejs=require(_0x49fb('0x8'));var fs=require('fs');var fs_extra=require(_0x49fb('0x9'));var _=require(_0x49fb('0xa'));var squel=require(_0x49fb('0xb'));var crypto=require('crypto');var jsforce=require(_0x49fb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x49fb('0x7'));var querystring=require(_0x49fb('0xd'));var Papa=require(_0x49fb('0xe'));var extract=require(_0x49fb('0xf'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x49fb('0x10'));var authService=require(_0x49fb('0x11'));var qs=require(_0x49fb('0x12'));var as=require(_0x49fb('0x13'));var hardwareService=require(_0x49fb('0x14'));var logger=require('../../config/logger')(_0x49fb('0x15'));var utils=require(_0x49fb('0x16'));var config=require(_0x49fb('0x17'));var licenseUtil=require(_0x49fb('0x18'));var db=require(_0x49fb('0x19'))['db'];config[_0x49fb('0x1a')]=_[_0x49fb('0x1b')](config[_0x49fb('0x1a')],{'host':_0x49fb('0x1c'),'port':0x18eb});var socket=require(_0x49fb('0x1d'))(new Redis(config[_0x49fb('0x1a')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x35977f,_0x25b5f9){_0x25b5f9=_0x25b5f9||0xcc;return function(_0x589fe9){if(_0x589fe9){return _0x35977f[_0x49fb('0x1e')](_0x25b5f9);}return _0x35977f[_0x49fb('0x1f')](_0x25b5f9)[_0x49fb('0x20')]();};}function respondWithResult(_0x1de66a,_0x45eef6){_0x45eef6=_0x45eef6||0xc8;return function(_0x29fafd){if(_0x29fafd){return _0x1de66a[_0x49fb('0x1f')](_0x45eef6)[_0x49fb('0x21')](_0x29fafd);}};}function respondWithFilteredResult(_0x315abe,_0x5b048e){return function(_0x1e4ef1){if(_0x1e4ef1){var _0x2f3fa6=typeof _0x5b048e[_0x49fb('0x22')]===_0x49fb('0x23')&&typeof _0x5b048e[_0x49fb('0x24')]===_0x49fb('0x23');var _0x3574e2=_0x1e4ef1['count'];var _0x2011f3=_0x2f3fa6?0x0:_0x5b048e[_0x49fb('0x22')];var _0x338c8d=_0x2f3fa6?_0x1e4ef1[_0x49fb('0x25')]:_0x5b048e['offset']+_0x5b048e[_0x49fb('0x24')];var _0x2b2641;if(_0x338c8d>=_0x3574e2){_0x338c8d=_0x3574e2;_0x2b2641=0xc8;}else{_0x2b2641=0xce;}_0x315abe[_0x49fb('0x1f')](_0x2b2641);return _0x315abe['set'](_0x49fb('0x26'),_0x2011f3+'-'+_0x338c8d+'/'+_0x3574e2)['json'](_0x1e4ef1);}return null;};}function patchUpdates(_0xfacb3f){return function(_0x40d8b1){try{jsonpatch['apply'](_0x40d8b1,_0xfacb3f,!![]);}catch(_0x547a5e){return BPromise[_0x49fb('0x27')](_0x547a5e);}return _0x40d8b1[_0x49fb('0x28')]();};}function saveUpdates(_0x5f2c82,_0x20d432){return function(_0x10a408){if(_0x10a408){return _0x10a408[_0x49fb('0x29')](_0x5f2c82)['then'](function(_0x4aba5d){return _0x4aba5d;});}return null;};}function removeEntity(_0x3315a3,_0x5a11a6){return function(_0x5bc04d){if(_0x5bc04d){return _0x5bc04d[_0x49fb('0x2a')]()[_0x49fb('0x2b')](function(){var _0x27c432=_0x5bc04d[_0x49fb('0x2c')]({'plain':!![]});var _0x450420='Plugins';return db[_0x49fb('0x2d')][_0x49fb('0x2a')]({'where':{'type':_0x450420,'resourceId':_0x27c432['id']}})[_0x49fb('0x2b')](function(){return _0x5bc04d;});})[_0x49fb('0x2b')](function(){_0x3315a3[_0x49fb('0x1f')](0xcc)[_0x49fb('0x20')]();});}};}function handleEntityNotFound(_0x1e3eee,_0x24d5f3){return function(_0x34f1ec){if(!_0x34f1ec){_0x1e3eee['sendStatus'](0x194);}return _0x34f1ec;};}function handleError(_0x5160c0,_0x450dda){_0x450dda=_0x450dda||0x1f4;return function(_0x25344b){logger[_0x49fb('0x2e')](_0x25344b[_0x49fb('0x2f')]);if(_0x25344b[_0x49fb('0x30')]){delete _0x25344b[_0x49fb('0x30')];}_0x5160c0[_0x49fb('0x1f')](_0x450dda)[_0x49fb('0x31')](_0x25344b);};}exports[_0x49fb('0x32')]=function(_0x37a56a,_0x19fc54){var _0x20a40d={},_0x1df41e={},_0x396db5={'count':0x0,'rows':[]};var _0x4d5147=_[_0x49fb('0x33')](db[_0x49fb('0x34')][_0x49fb('0x35')],function(_0x1b557c){return{'name':_0x1b557c[_0x49fb('0x36')],'type':_0x1b557c['type'][_0x49fb('0x37')]};});_0x1df41e['model']=_[_0x49fb('0x33')](_0x4d5147,_0x49fb('0x30'));_0x1df41e[_0x49fb('0x38')]=_[_0x49fb('0x39')](_0x37a56a[_0x49fb('0x38')]);_0x1df41e['filters']=_[_0x49fb('0x3a')](_0x1df41e[_0x49fb('0x3b')],_0x1df41e['query']);_0x20a40d[_0x49fb('0x3c')]=_[_0x49fb('0x3a')](_0x1df41e[_0x49fb('0x3b')],qs['fields'](_0x37a56a[_0x49fb('0x38')][_0x49fb('0x3d')]));_0x20a40d[_0x49fb('0x3c')]=_0x20a40d['attributes'][_0x49fb('0x3e')]?_0x20a40d[_0x49fb('0x3c')]:_0x1df41e[_0x49fb('0x3b')];if(!_0x37a56a['query'][_0x49fb('0x3f')]('nolimit')){_0x20a40d[_0x49fb('0x24')]=qs['limit'](_0x37a56a[_0x49fb('0x38')][_0x49fb('0x24')]);_0x20a40d[_0x49fb('0x22')]=qs[_0x49fb('0x22')](_0x37a56a['query'][_0x49fb('0x22')]);}_0x20a40d[_0x49fb('0x40')]=qs[_0x49fb('0x41')](_0x37a56a[_0x49fb('0x38')]['sort']);_0x20a40d[_0x49fb('0x42')]=qs[_0x49fb('0x43')](_[_0x49fb('0x44')](_0x37a56a['query'],_0x1df41e[_0x49fb('0x43')]),_0x4d5147);if(_0x37a56a['query'][_0x49fb('0x45')]){_0x20a40d['where']=_[_0x49fb('0x46')](_0x20a40d[_0x49fb('0x42')],{'$or':_[_0x49fb('0x33')](_0x4d5147,function(_0x20cd65){if(_0x20cd65['type']!=='VIRTUAL'){var _0x7d7bf9={};_0x7d7bf9[_0x20cd65[_0x49fb('0x30')]]={'$like':'%'+_0x37a56a[_0x49fb('0x38')][_0x49fb('0x45')]+'%'};return _0x7d7bf9;}})});}_0x20a40d=_['merge']({},_0x20a40d,_0x37a56a[_0x49fb('0x47')]);var _0x2ab703={'where':_0x20a40d[_0x49fb('0x42')]};return db[_0x49fb('0x34')][_0x49fb('0x25')](_0x2ab703)[_0x49fb('0x2b')](function(_0x445087){_0x396db5[_0x49fb('0x25')]=_0x445087;if(_0x37a56a[_0x49fb('0x38')]['includeAll']){_0x20a40d[_0x49fb('0x48')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x20a40d);})[_0x49fb('0x2b')](function(_0x333382){_0x396db5[_0x49fb('0x49')]=_0x333382;return _0x396db5;})[_0x49fb('0x2b')](respondWithFilteredResult(_0x19fc54,_0x20a40d))[_0x49fb('0x4a')](handleError(_0x19fc54,null));};exports[_0x49fb('0x4b')]=function(_0x4b149b,_0x1460a8){var _0x4031ee={'raw':!![],'where':{'id':_0x4b149b[_0x49fb('0x4c')]['id']}},_0x5897a7={};_0x5897a7[_0x49fb('0x3b')]=_[_0x49fb('0x39')](db[_0x49fb('0x34')][_0x49fb('0x35')]);_0x5897a7[_0x49fb('0x38')]=_[_0x49fb('0x39')](_0x4b149b[_0x49fb('0x38')]);_0x5897a7[_0x49fb('0x43')]=_['intersection'](_0x5897a7['model'],_0x5897a7['query']);_0x4031ee[_0x49fb('0x3c')]=_[_0x49fb('0x3a')](_0x5897a7[_0x49fb('0x3b')],qs[_0x49fb('0x3d')](_0x4b149b[_0x49fb('0x38')][_0x49fb('0x3d')]));_0x4031ee[_0x49fb('0x3c')]=_0x4031ee[_0x49fb('0x3c')][_0x49fb('0x3e')]?_0x4031ee[_0x49fb('0x3c')]:_0x5897a7[_0x49fb('0x3b')];if(_0x4b149b[_0x49fb('0x38')][_0x49fb('0x4d')]){_0x4031ee[_0x49fb('0x48')]=[{'all':!![]}];}_0x4031ee=_[_0x49fb('0x46')]({},_0x4031ee,_0x4b149b[_0x49fb('0x47')]);return db[_0x49fb('0x34')]['find'](_0x4031ee)[_0x49fb('0x2b')](handleEntityNotFound(_0x1460a8,null))[_0x49fb('0x2b')](respondWithResult(_0x1460a8,null))['catch'](handleError(_0x1460a8,null));};exports[_0x49fb('0x4e')]=function(_0xae722b,_0x18f02d,_0xdc9718){return db[_0x49fb('0x34')]['find']({'where':{'id':_0xae722b['params']['id']},'attributes':[_0x49fb('0x30'),_0x49fb('0x5')],'raw':!![]})['then'](handleEntityNotFound(_0x18f02d,null))[_0x49fb('0x2b')](function(_0x97b0af){if(_0x97b0af){var _0x46a220=path['join'](config['root'],_0x49fb('0x4f'),util[_0x49fb('0x50')]('%s.zip',path[_0x49fb('0x51')](_0x97b0af[_0x49fb('0x5')])));var _0x3dfdd2=fs[_0x49fb('0x52')](_0x46a220);var _0x363dca=archiver(_0x49fb('0x53'),{'zlib':{'level':0x9}});_0x363dca['on'](_0x49fb('0x54'),function(_0x20b5e9){if(_0x20b5e9['code']===_0x49fb('0x55')){logger[_0x49fb('0x2e')](_0x20b5e9);}else{throw new db[(_0x49fb('0x56'))][(_0x49fb('0x57'))](_0x49fb('0x58'));}});_0x363dca['on'](_0x49fb('0x2e'),function(_0x7dc811){throw new db[(_0x49fb('0x56'))][(_0x49fb('0x57'))](_0x49fb('0x58'));});_0x363dca[_0x49fb('0x59')](_0x3dfdd2);_0x363dca[_0x49fb('0x5a')](_0x49fb('0x5b'),{'cwd':path[_0x49fb('0x5c')](config[_0x49fb('0x5d')],_0x49fb('0x4f'),path['dirname'](_0x97b0af[_0x49fb('0x5')])),'ignore':[path[_0x49fb('0x5c')](path[_0x49fb('0x51')](_0x97b0af[_0x49fb('0x5')]),'node_modules/**/*'),path[_0x49fb('0x5c')](path['basename'](_0x97b0af[_0x49fb('0x5')]),_0x49fb('0x5e'))],'nodir':!![]})[_0x49fb('0x5f')]();_0x3dfdd2['on']('close',function(){if(!fs[_0x49fb('0x60')](_0x46a220)){throw new db['Sequelize'][(_0x49fb('0x57'))](_0x49fb('0x61'));}return _0x18f02d[_0x49fb('0x4e')](_0x46a220,util['format'](_0x49fb('0x62'),path[_0x49fb('0x51')](_0x97b0af[_0x49fb('0x5')])),function(_0x25f3e3){if(_0x25f3e3){throw new db[(_0x49fb('0x56'))]['Error'](_0x49fb('0x63'));}fs[_0x49fb('0x64')](_0x46a220);logger[_0x49fb('0x65')](_0x49fb('0x66'));logger[_0x49fb('0x65')](_0x49fb('0x67'));});});}return null;})[_0x49fb('0x4a')](handleError(_0x18f02d,null));};exports['upload']=function(_0x29d73e,_0x20b3d1,_0x491db4){var _0x3d1d4f=path[_0x49fb('0x51')](_0x29d73e[_0x49fb('0x68')][_0x49fb('0x69')],path[_0x49fb('0x6a')](_0x29d73e['file'][_0x49fb('0x69')]));var _0x114bf3=path[_0x49fb('0x5c')](config[_0x49fb('0x5d')],_0x49fb('0x4f'),_0x29d73e[_0x49fb('0x68')][_0x49fb('0x69')]);var _0x46a094=path['join'](config['root'],_0x49fb('0x4f'),_0x3d1d4f);logger['info'](_0x49fb('0x6b'),_0x114bf3);logger[_0x49fb('0x65')](_0x49fb('0x6c'),_0x46a094);try{fs['chmodSync'](_0x114bf3,parseInt(_0x49fb('0x6d'),0x8));extract(_0x114bf3,{'dir':_0x46a094},function(_0xb6a53c){if(_0xb6a53c){logger[_0x49fb('0x2e')](_0xb6a53c);handleError(_0xb6a53c,!![]);};var _0x35dd15=fs[_0x49fb('0x6e')](_0x46a094);if(_0x35dd15[_0x49fb('0x3e')]>0x1){removeReferences(_0x114bf3,_0x46a094);logger[_0x49fb('0x2e')]('Invalid\x20plugin\x20structure');return _0x491db4(new Error(_0x49fb('0x6f')));}var _0x234382=fs[_0x49fb('0x70')](path['join'](_0x46a094,_0x35dd15[0x0]));if(_0x234382[_0x49fb('0x71')]()){removeReferences(_0x114bf3,_0x46a094);logger[_0x49fb('0x2e')](_0x49fb('0x6f'));return _0x491db4(new Error(_0x49fb('0x6f')));}if(_0x234382['isDirectory']()){var _0x333592=fs[_0x49fb('0x6e')](path[_0x49fb('0x5c')](_0x46a094,_0x35dd15[0x0]));if(_0x333592[_0x49fb('0x3e')]===0x0){removeReferences(_0x114bf3,_0x46a094);logger[_0x49fb('0x2e')](_0x49fb('0x6f'));return _0x491db4(new Error(_0x49fb('0x6f')));}var _0x204bf7=_0x333592[_0x49fb('0x72')](function(_0x3b945e){return _0x3b945e===_0x49fb('0x73');});if(!_0x204bf7){return _0x491db4(new Error(_0x49fb('0x74')));}var _0x4694ba=fs[_0x49fb('0x75')](path[_0x49fb('0x5c')](_0x46a094,_0x35dd15[0x0],_0x49fb('0x73')));var _0xa6a7a8=JSON['parse'](_0x4694ba);if(_0x49fb('0x23')==typeof _0xa6a7a8[_0x49fb('0x30')]){return _0x491db4(new Error(_0x49fb('0x76')));}if(_0x49fb('0x23')==typeof _0xa6a7a8[_0x49fb('0x77')]){return _0x491db4(new Error(_0x49fb('0x78')));}if(_0x49fb('0x23')==typeof _0xa6a7a8['version']){return _0x491db4(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0xa6a7a8[_0x49fb('0x79')]){return _0x491db4(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0xa6a7a8[_0x49fb('0x77')]===_0x49fb('0x7a')){if('undefined'==typeof _0xa6a7a8[_0x49fb('0x79')][_0x49fb('0x7b')]){return _0x491db4(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x49fb('0x23')==typeof _0xa6a7a8[_0x49fb('0x79')]['views'][_0x49fb('0x7c')]&&_0x49fb('0x23')==typeof _0xa6a7a8[_0x49fb('0x79')][_0x49fb('0x7b')][_0x49fb('0x7d')]){return _0x491db4(new Error(_0x49fb('0x7e')));}}else if(_0xa6a7a8[_0x49fb('0x77')]===_0x49fb('0x7f')){if(_0x49fb('0x23')==typeof _0xa6a7a8['parameters'][_0x49fb('0x80')]){return _0x491db4(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x49fb('0x23')==typeof _0xa6a7a8[_0x49fb('0x79')][_0x49fb('0x81')]){return _0x491db4(new Error(_0x49fb('0x82')));}}else{return _0x491db4(new Error(_0x49fb('0x83')));}var _0x40bb11=_0xa6a7a8[_0x49fb('0x30')];var _0x3a8216=_0xa6a7a8[_0x49fb('0x84')];var _0xd9c7b5=_0xa6a7a8[_0x49fb('0x77')];var _0x56e147=_0xa6a7a8[_0x49fb('0x85')]?_0xa6a7a8['sidebar']:'always';var _0x49afd1=_0xa6a7a8[_0x49fb('0x86')]?_0xa6a7a8[_0x49fb('0x86')]:'icon-apps';var _0x4504b2='';var _0x480355='';var _0x24a8c2='';var _0x2f4cf9='';var _0x40e8c7=_0xa6a7a8[_0x49fb('0x87')];if(_0xd9c7b5===_0x49fb('0x7a')){if(_0x49fb('0x23')!=typeof _0xa6a7a8[_0x49fb('0x79')][_0x49fb('0x7b')][_0x49fb('0x7c')]){var _0x9937c9=_0xa6a7a8[_0x49fb('0x79')][_0x49fb('0x7b')][_0x49fb('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x49fb('0x88')](_0x9937c9)){_0x4504b2=path[_0x49fb('0x5c')](_0x49fb('0x89'),_0x3d1d4f,_0x35dd15[0x0],_0x9937c9);}else{_0x4504b2=_0x9937c9;}}else{logger[_0x49fb('0x65')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x49fb('0x23')!=typeof _0xa6a7a8['parameters'][_0x49fb('0x7b')]['agent']){var _0x4b260b=_0xa6a7a8[_0x49fb('0x79')][_0x49fb('0x7b')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x49fb('0x88')](_0x4b260b)){_0x480355=path[_0x49fb('0x5c')]('plugins',_0x3d1d4f,_0x35dd15[0x0],_0x4b260b);}else{_0x480355=_0x4b260b;}}else{logger[_0x49fb('0x65')](_0x49fb('0x8a'));}}else if(_0xd9c7b5===_0x49fb('0x7f')){_0x24a8c2=_0xa6a7a8['parameters'][_0x49fb('0x80')];_0x2f4cf9=_0xa6a7a8[_0x49fb('0x79')][_0x49fb('0x81')];if(_0x49fb('0x23')!=typeof _0xa6a7a8[_0x49fb('0x79')][_0x49fb('0x7b')]){if(_0x49fb('0x23')!=typeof _0xa6a7a8['parameters'][_0x49fb('0x7b')][_0x49fb('0x7c')]){var _0x9937c9=_0xa6a7a8['parameters'][_0x49fb('0x7b')][_0x49fb('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x49fb('0x88')](_0x9937c9)){_0x4504b2=path[_0x49fb('0x5c')](_0x49fb('0x89'),_0x3d1d4f,_0x35dd15[0x0],_0x9937c9);}else{_0x4504b2=_0x9937c9;}}if(_0x49fb('0x23')!=typeof _0xa6a7a8[_0x49fb('0x79')]['views'][_0x49fb('0x7d')]){var _0x4b260b=_0xa6a7a8[_0x49fb('0x79')]['views'][_0x49fb('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4b260b)){_0x480355=path[_0x49fb('0x5c')](_0x49fb('0x89'),_0x3d1d4f,_0x35dd15[0x0],_0x4b260b);}else{_0x480355=_0x4b260b;}}}}var _0xa9e518={'name':_0x40bb11,'description':_0x3a8216,'path':path[_0x49fb('0x5c')](_0x3d1d4f,_0x35dd15[0x0]),'type':_0xd9c7b5,'sidebar':_0x56e147,'icon':_0x49afd1,'adminUrl':_0x4504b2,'agentUrl':_0x480355,'scriptName':_0x24a8c2,'scriptPath':_0x2f4cf9,'version':_0x40e8c7};removeReferences(_0x114bf3,null);return db[_0x49fb('0x34')][_0x49fb('0x8b')](_0xa9e518)[_0x49fb('0x2b')](function(_0x754570){var _0x38c5c7={'role':_0x29d73e[_0x49fb('0x8c')]['role'],'userProfileId':_0x29d73e[_0x49fb('0x8c')][_0x49fb('0x8d')]};if(!_0x38c5c7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38c5c7[_0x49fb('0x8e')]===_0x49fb('0x8f')){var _0x19d024=_0x754570[_0x49fb('0x2c')]({'plain':!![]});return db[_0x49fb('0x90')][_0x49fb('0x91')]({'where':{'name':_0x49fb('0x92'),'userProfileId':_0x38c5c7[_0x49fb('0x8d')]},'raw':!![]})['then'](function(_0x462efd){if(_0x462efd&&_0x462efd['autoAssociation']===0x0){return db['UserProfileResource'][_0x49fb('0x8b')]({'name':_0x19d024[_0x49fb('0x30')],'resourceId':_0x19d024['id'],'type':_0x462efd[_0x49fb('0x30')],'sectionId':_0x462efd['id']},{})['then'](function(){return _0x754570;});}else{return _0x754570;}})[_0x49fb('0x4a')](function(_0x4a2145){logger[_0x49fb('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a2145);throw _0x4a2145;});}return _0x754570;})[_0x49fb('0x2b')](respondWithResult(_0x20b3d1,null))['catch'](handleError(_0x20b3d1,null));}});}catch(_0x5e6c79){_0x20b3d1[_0x49fb('0x1f')](0x1f4)[_0x49fb('0x31')](_0x5e6c79);}};function removeReferences(_0x4b0b83,_0x239cb6){try{if(_0x4b0b83){fs[_0x49fb('0x64')](_0x4b0b83);logger[_0x49fb('0x65')](_0x49fb('0x93'));}if(_0x239cb6){rimraf(_0x239cb6,function(){});logger[_0x49fb('0x65')](_0x49fb('0x94'));}}catch(_0x516a9c){logger[_0x49fb('0x2e')](_0x516a9c);}}exports[_0x49fb('0x29')]=function(_0x41fb87,_0x24ad1b,_0x5d5877){return db['Plugin'][_0x49fb('0x91')]({'where':{'id':_0x41fb87['params']['id']}})['then'](handleEntityNotFound(_0x24ad1b,null))[_0x49fb('0x2b')](saveUpdates(_0x41fb87[_0x49fb('0x8c')],null))[_0x49fb('0x2b')](respondWithResult(_0x24ad1b,null))[_0x49fb('0x4a')](handleError(_0x24ad1b,null));};exports[_0x49fb('0x95')]=function(_0x1e4543,_0xd80247,_0x50a748){return db['Plugin'][_0x49fb('0x91')]({'where':{'id':_0x1e4543[_0x49fb('0x4c')]['id']}})[_0x49fb('0x2b')](function(_0x531994){if(_0x531994){return _0x531994['destroy']();}})[_0x49fb('0x2b')](function(_0x377fd4){rimraf(path['join'](config[_0x49fb('0x5d')],_0x49fb('0x4f'),path[_0x49fb('0x96')](_0x377fd4[_0x49fb('0x5')])),function(){});return _0x377fd4;})[_0x49fb('0x2b')](handleEntityNotFound(_0xd80247,null))['then'](respondWithStatusCode(_0xd80247,null))[_0x49fb('0x4a')](handleError(_0xd80247,null));};exports[_0x49fb('0x97')]=function(_0x395786,_0x3ccabe,_0x424b6c){return BPromise[_0x49fb('0x98')]()[_0x49fb('0x2b')](function(){if(!_0x395786[_0x49fb('0x38')]['path']){throw new Error(_0x49fb('0x99'));}if(!_0x395786[_0x49fb('0x38')][_0x49fb('0x9a')]){throw new Error(_0x49fb('0x9b'));}var _0x59cdfa=_0x395786['query'][_0x49fb('0x9c')]?_0x395786['query'][_0x49fb('0x9c')]+':'+_0x395786[_0x49fb('0x38')][_0x49fb('0x9a')]:_0x49fb('0x9d')+_0x395786['query']['port'];var _0x45e5ef=_0x395786[_0x49fb('0x38')][_0x49fb('0x21')]?_0x395786[_0x49fb('0x38')][_0x49fb('0x21')]:!![];var _0x47445a=_0x395786[_0x49fb('0x38')][_0x49fb('0x9e')]?_0x395786['query'][_0x49fb('0x9e')]:null;var _0x56a1b8={'method':_0x395786[_0x49fb('0x9f')],'uri':util[_0x49fb('0x50')]('%s%s',_0x59cdfa,_0x395786[_0x49fb('0x38')][_0x49fb('0x5')]),'json':_0x45e5ef,'resolveWithFullResponse':!![],'encoding':_0x47445a,'qs':_0x395786[_0x49fb('0x38')]};if(_0x395786[_0x49fb('0xa0')]){_0x56a1b8[_0x49fb('0xa0')]=_0x395786[_0x49fb('0xa0')];if(_0x56a1b8[_0x49fb('0xa0')][_0x49fb('0xa1')]){delete _0x56a1b8[_0x49fb('0xa0')]['content-length'];}}if(_0x56a1b8['headers'][_0x49fb('0xa2')]){delete _0x56a1b8[_0x49fb('0xa0')]['content-type'];}return rp(_0x56a1b8);})[_0x49fb('0x2b')](function(_0x5dd3c5){if(_0x5dd3c5){_0x3ccabe[_0x49fb('0xa3')](_0x5dd3c5[_0x49fb('0xa0')]);logger[_0x49fb('0x65')](_0x5dd3c5['body']);if(_['endsWith'](_0x395786[_0x49fb('0x38')][_0x49fb('0x5')],_0x49fb('0x4e'))&&_0x5dd3c5[_0x49fb('0xa4')]==0x1f4){return _0x3ccabe[_0x49fb('0x1e')](_0x5dd3c5[_0x49fb('0xa4')]);}else{return _0x3ccabe[_0x49fb('0x1f')](_0x5dd3c5['statusCode'])['send'](_0x5dd3c5['body']);}}else{return _0x3ccabe[_0x49fb('0x1e')](0xc8);}})[_0x49fb('0x4a')](handleError(_0x3ccabe,null));};exports[_0x49fb('0xa5')]=function(_0x322191,_0x5de8a5,_0x4c3f91){return BPromise['resolve']()[_0x49fb('0x2b')](function(){if(!_0x322191['query'][_0x49fb('0x5')]){throw new Error(_0x49fb('0x99'));}if(!_0x322191[_0x49fb('0x38')][_0x49fb('0x9a')]){throw new Error(_0x49fb('0x9b'));}var _0x7db00b=_0x322191[_0x49fb('0x38')]['hostname']?_0x322191[_0x49fb('0x38')][_0x49fb('0x9c')]+':'+_0x322191[_0x49fb('0x38')]['port']:_0x49fb('0x9d')+_0x322191[_0x49fb('0x38')]['port'];var _0x566405=_0x322191['query'][_0x49fb('0x21')]?_0x322191[_0x49fb('0x38')][_0x49fb('0x21')]:!![];var _0x1a7318=_0x322191[_0x49fb('0x38')][_0x49fb('0x9e')]?_0x322191[_0x49fb('0x38')][_0x49fb('0x9e')]:null;var _0x3f2608={'method':_0x322191[_0x49fb('0x9f')],'uri':util[_0x49fb('0x50')](_0x49fb('0xa6'),_0x7db00b,_0x322191[_0x49fb('0x38')][_0x49fb('0x5')]),'json':_0x566405,'resolveWithFullResponse':!![],'encoding':_0x1a7318,'body':_0x322191[_0x49fb('0x8c')]};if(_0x322191[_0x49fb('0xa0')]){_0x3f2608[_0x49fb('0xa0')]=_0x322191[_0x49fb('0xa0')];if(_0x3f2608[_0x49fb('0xa0')][_0x49fb('0xa1')]){delete _0x3f2608['headers'][_0x49fb('0xa1')];}}if(_0x3f2608[_0x49fb('0xa0')][_0x49fb('0xa2')]){delete _0x3f2608['headers']['content-type'];}return rp(_0x3f2608);})[_0x49fb('0x2b')](function(_0x94dc97){if(_0x94dc97){_0x5de8a5['set'](_0x94dc97['headers']);logger[_0x49fb('0x65')](_0x94dc97[_0x49fb('0x8c')]);return _0x5de8a5[_0x49fb('0x1f')](_0x94dc97[_0x49fb('0xa4')])[_0x49fb('0x31')](_0x94dc97[_0x49fb('0x8c')]);}else{return _0x5de8a5[_0x49fb('0x1e')](0xc8);}})[_0x49fb('0x4a')](handleError(_0x5de8a5,null));};
\ No newline at end of file
+var _0x968f=['\x27PATH\x27\x20parameter\x20not\x20specified','set','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','save','destroy','get','Plugins','UserProfileResource','then','end','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','key','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','options','includeAll','include','show','params','keys','intersection','find','catch','download','root','server/files/plugins','format','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','dirname','attachments/**/*','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\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'];(function(_0x2419b0,_0x1dfcd6){var _0x159fc2=function(_0x20de4f){while(--_0x20de4f){_0x2419b0['push'](_0x2419b0['shift']());}};_0x159fc2(++_0x1dfcd6);}(_0x968f,0x154));var _0xf968=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x968f[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xf968('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf968('0x1'));var jsonpatch=require(_0xf968('0x2'));var rp=require(_0xf968('0x3'));var moment=require(_0xf968('0x4'));var BPromise=require(_0xf968('0x5'));var Mustache=require(_0xf968('0x6'));var util=require(_0xf968('0x7'));var path=require(_0xf968('0x8'));var sox=require(_0xf968('0x9'));var csv=require(_0xf968('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf968('0xb'));var crypto=require('crypto');var jsforce=require(_0xf968('0xc'));var deskjs=require(_0xf968('0xd'));var toCsv=require(_0xf968('0xa'));var querystring=require(_0xf968('0xe'));var Papa=require(_0xf968('0xf'));var extract=require('extract-zip');var rimraf=require(_0xf968('0x10'));var archiver=require(_0xf968('0x11'));var Redis=require(_0xf968('0x12'));var authService=require(_0xf968('0x13'));var qs=require(_0xf968('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf968('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf968('0x16'));var config=require(_0xf968('0x17'));var licenseUtil=require(_0xf968('0x18'));var db=require(_0xf968('0x19'))['db'];config[_0xf968('0x1a')]=_['defaults'](config[_0xf968('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xf968('0x1b'))(new Redis(config[_0xf968('0x1a')]));require(_0xf968('0x1c'))[_0xf968('0x1d')](socket);function respondWithStatusCode(_0x35f4e3,_0x709818){_0x709818=_0x709818||0xcc;return function(_0x3f1893){if(_0x3f1893){return _0x35f4e3[_0xf968('0x1e')](_0x709818);}return _0x35f4e3[_0xf968('0x1f')](_0x709818)['end']();};}function respondWithResult(_0x2fcde7,_0x22a047){_0x22a047=_0x22a047||0xc8;return function(_0x5f55d5){if(_0x5f55d5){return _0x2fcde7[_0xf968('0x1f')](_0x22a047)['json'](_0x5f55d5);}};}function respondWithFilteredResult(_0x3c462a,_0x3eb6bb){return function(_0x4989e0){if(_0x4989e0){var _0x14dc77=typeof _0x3eb6bb[_0xf968('0x20')]===_0xf968('0x21')&&typeof _0x3eb6bb[_0xf968('0x22')]==='undefined';var _0x545305=_0x4989e0[_0xf968('0x23')];var _0x176ac9=_0x14dc77?0x0:_0x3eb6bb[_0xf968('0x20')];var _0x5408ad=_0x14dc77?_0x4989e0[_0xf968('0x23')]:_0x3eb6bb['offset']+_0x3eb6bb[_0xf968('0x22')];var _0x2ad5e4;if(_0x5408ad>=_0x545305){_0x5408ad=_0x545305;_0x2ad5e4=0xc8;}else{_0x2ad5e4=0xce;}_0x3c462a[_0xf968('0x1f')](_0x2ad5e4);return _0x3c462a['set'](_0xf968('0x24'),_0x176ac9+'-'+_0x5408ad+'/'+_0x545305)[_0xf968('0x25')](_0x4989e0);}return null;};}function patchUpdates(_0x1b60a4){return function(_0x22363a){try{jsonpatch[_0xf968('0x26')](_0x22363a,_0x1b60a4,!![]);}catch(_0x5d5ca7){return BPromise['reject'](_0x5d5ca7);}return _0x22363a[_0xf968('0x27')]();};}function saveUpdates(_0x221eed,_0x345ea9){return function(_0x4f2471){if(_0x4f2471){return _0x4f2471['update'](_0x221eed)['then'](function(_0x19ea47){return _0x19ea47;});}return null;};}function removeEntity(_0xf13f7f,_0x52359d){return function(_0x1f2672){if(_0x1f2672){return _0x1f2672[_0xf968('0x28')]()['then'](function(){var _0x5ed2d6=_0x1f2672[_0xf968('0x29')]({'plain':!![]});var _0x128701=_0xf968('0x2a');return db[_0xf968('0x2b')][_0xf968('0x28')]({'where':{'type':_0x128701,'resourceId':_0x5ed2d6['id']}})[_0xf968('0x2c')](function(){return _0x1f2672;});})[_0xf968('0x2c')](function(){_0xf13f7f[_0xf968('0x1f')](0xcc)[_0xf968('0x2d')]();});}};}function handleEntityNotFound(_0x50183b,_0x2b3bd9){return function(_0x2da9c3){if(!_0x2da9c3){_0x50183b[_0xf968('0x1e')](0x194);}return _0x2da9c3;};}function handleError(_0x45fb36,_0x50cd46){_0x50cd46=_0x50cd46||0x1f4;return function(_0x21dce8){logger[_0xf968('0x2e')](_0x21dce8[_0xf968('0x2f')]);if(_0x21dce8[_0xf968('0x30')]){delete _0x21dce8[_0xf968('0x30')];}_0x45fb36[_0xf968('0x1f')](_0x50cd46)[_0xf968('0x31')](_0x21dce8);};}exports[_0xf968('0x32')]=function(_0x469e4f,_0x373ae4){var _0x45e82d={},_0x36bc56={},_0x3339e4={'count':0x0,'rows':[]};var _0x30453b=_[_0xf968('0x33')](db[_0xf968('0x34')][_0xf968('0x35')],function(_0x25e15e){return{'name':_0x25e15e[_0xf968('0x36')],'type':_0x25e15e['type'][_0xf968('0x37')]};});_0x36bc56['model']=_[_0xf968('0x33')](_0x30453b,_0xf968('0x30'));_0x36bc56['query']=_['keys'](_0x469e4f[_0xf968('0x38')]);_0x36bc56['filters']=_['intersection'](_0x36bc56['model'],_0x36bc56['query']);_0x45e82d[_0xf968('0x39')]=_['intersection'](_0x36bc56[_0xf968('0x3a')],qs[_0xf968('0x3b')](_0x469e4f[_0xf968('0x38')][_0xf968('0x3b')]));_0x45e82d['attributes']=_0x45e82d[_0xf968('0x39')][_0xf968('0x3c')]?_0x45e82d[_0xf968('0x39')]:_0x36bc56['model'];if(!_0x469e4f[_0xf968('0x38')][_0xf968('0x3d')](_0xf968('0x3e'))){_0x45e82d[_0xf968('0x22')]=qs[_0xf968('0x22')](_0x469e4f['query']['limit']);_0x45e82d[_0xf968('0x20')]=qs[_0xf968('0x20')](_0x469e4f[_0xf968('0x38')][_0xf968('0x20')]);}_0x45e82d[_0xf968('0x3f')]=qs['sort'](_0x469e4f[_0xf968('0x38')][_0xf968('0x40')]);_0x45e82d['where']=qs[_0xf968('0x41')](_[_0xf968('0x42')](_0x469e4f['query'],_0x36bc56[_0xf968('0x41')]),_0x30453b);if(_0x469e4f[_0xf968('0x38')][_0xf968('0x43')]){_0x45e82d[_0xf968('0x44')]=_[_0xf968('0x45')](_0x45e82d[_0xf968('0x44')],{'$or':_[_0xf968('0x33')](_0x30453b,function(_0x31f54c){if(_0x31f54c[_0xf968('0x46')]!=='VIRTUAL'){var _0x5e32d3={};_0x5e32d3[_0x31f54c[_0xf968('0x30')]]={'$like':'%'+_0x469e4f[_0xf968('0x38')][_0xf968('0x43')]+'%'};return _0x5e32d3;}})});}_0x45e82d=_[_0xf968('0x45')]({},_0x45e82d,_0x469e4f[_0xf968('0x47')]);var _0xf9f94a={'where':_0x45e82d[_0xf968('0x44')]};return db[_0xf968('0x34')][_0xf968('0x23')](_0xf9f94a)[_0xf968('0x2c')](function(_0x35916d){_0x3339e4[_0xf968('0x23')]=_0x35916d;if(_0x469e4f[_0xf968('0x38')][_0xf968('0x48')]){_0x45e82d[_0xf968('0x49')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x45e82d);})['then'](function(_0x3d1e67){_0x3339e4['rows']=_0x3d1e67;return _0x3339e4;})[_0xf968('0x2c')](respondWithFilteredResult(_0x373ae4,_0x45e82d))['catch'](handleError(_0x373ae4,null));};exports[_0xf968('0x4a')]=function(_0x460e5c,_0x3a9b87){var _0x48ec6e={'raw':!![],'where':{'id':_0x460e5c[_0xf968('0x4b')]['id']}},_0x3d2104={};_0x3d2104['model']=_['keys'](db[_0xf968('0x34')][_0xf968('0x35')]);_0x3d2104[_0xf968('0x38')]=_[_0xf968('0x4c')](_0x460e5c[_0xf968('0x38')]);_0x3d2104['filters']=_[_0xf968('0x4d')](_0x3d2104['model'],_0x3d2104[_0xf968('0x38')]);_0x48ec6e[_0xf968('0x39')]=_[_0xf968('0x4d')](_0x3d2104[_0xf968('0x3a')],qs['fields'](_0x460e5c['query'][_0xf968('0x3b')]));_0x48ec6e[_0xf968('0x39')]=_0x48ec6e['attributes'][_0xf968('0x3c')]?_0x48ec6e[_0xf968('0x39')]:_0x3d2104['model'];if(_0x460e5c['query'][_0xf968('0x48')]){_0x48ec6e[_0xf968('0x49')]=[{'all':!![]}];}_0x48ec6e=_[_0xf968('0x45')]({},_0x48ec6e,_0x460e5c[_0xf968('0x47')]);return db[_0xf968('0x34')][_0xf968('0x4e')](_0x48ec6e)[_0xf968('0x2c')](handleEntityNotFound(_0x3a9b87,null))[_0xf968('0x2c')](respondWithResult(_0x3a9b87,null))[_0xf968('0x4f')](handleError(_0x3a9b87,null));};exports[_0xf968('0x50')]=function(_0x4d33a7,_0x3b0ffd,_0x17ce80){return db[_0xf968('0x34')][_0xf968('0x4e')]({'where':{'id':_0x4d33a7[_0xf968('0x4b')]['id']},'attributes':[_0xf968('0x30'),_0xf968('0x8')],'raw':!![]})[_0xf968('0x2c')](handleEntityNotFound(_0x3b0ffd,null))[_0xf968('0x2c')](function(_0xf66d9e){if(_0xf66d9e){var _0x42169d=path['join'](config[_0xf968('0x51')],_0xf968('0x52'),util[_0xf968('0x53')]('%s.zip',path[_0xf968('0x54')](_0xf66d9e[_0xf968('0x8')])));var _0x46901c=fs[_0xf968('0x55')](_0x42169d);var _0x2b0c55=archiver('zip',{'zlib':{'level':0x9}});_0x2b0c55['on'](_0xf968('0x56'),function(_0x5b62ac){if(_0x5b62ac[_0xf968('0x57')]===_0xf968('0x58')){logger[_0xf968('0x2e')](_0x5b62ac);}else{throw new db[(_0xf968('0x59'))][(_0xf968('0x5a'))](_0xf968('0x5b'));}});_0x2b0c55['on'](_0xf968('0x2e'),function(_0x555047){throw new db[(_0xf968('0x59'))]['Error'](_0xf968('0x5b'));});_0x2b0c55['pipe'](_0x46901c);_0x2b0c55[_0xf968('0x5c')](_0xf968('0x5d'),{'cwd':path[_0xf968('0x5e')](config[_0xf968('0x51')],_0xf968('0x52'),path[_0xf968('0x5f')](_0xf66d9e[_0xf968('0x8')])),'ignore':[path[_0xf968('0x5e')](path['basename'](_0xf66d9e[_0xf968('0x8')]),'node_modules/**/*'),path[_0xf968('0x5e')](path['basename'](_0xf66d9e['path']),_0xf968('0x60'))],'nodir':!![]})['finalize']();_0x46901c['on'](_0xf968('0x61'),function(){if(!fs[_0xf968('0x62')](_0x42169d)){throw new db[(_0xf968('0x59'))][(_0xf968('0x5a'))](_0xf968('0x63'));}return _0x3b0ffd[_0xf968('0x50')](_0x42169d,util[_0xf968('0x53')](_0xf968('0x64'),path[_0xf968('0x54')](_0xf66d9e[_0xf968('0x8')])),function(_0x4894b6){if(_0x4894b6){throw new db['Sequelize']['Error'](_0xf968('0x65'));}fs[_0xf968('0x66')](_0x42169d);logger[_0xf968('0x67')](_0xf968('0x68'));logger[_0xf968('0x67')](_0xf968('0x69'));});});}return null;})[_0xf968('0x4f')](handleError(_0x3b0ffd,null));};exports[_0xf968('0x6a')]=function(_0x468d1f,_0x16caee,_0x3f851f){var _0x23cc1e=path['basename'](_0x468d1f[_0xf968('0x6b')][_0xf968('0x6c')],path[_0xf968('0x6d')](_0x468d1f[_0xf968('0x6b')][_0xf968('0x6c')]));var _0x2609c8=path[_0xf968('0x5e')](config[_0xf968('0x51')],'server/files/plugins',_0x468d1f['file']['filename']);var _0x2a74a0=path[_0xf968('0x5e')](config[_0xf968('0x51')],'server/files/plugins',_0x23cc1e);logger[_0xf968('0x67')](_0xf968('0x6e'),_0x2609c8);logger[_0xf968('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x2a74a0);try{fs[_0xf968('0x6f')](_0x2609c8,parseInt(_0xf968('0x70'),0x8));extract(_0x2609c8,{'dir':_0x2a74a0},function(_0x2c37e4){if(_0x2c37e4){logger[_0xf968('0x2e')](_0x2c37e4);handleError(_0x2c37e4,!![]);};var _0xd6cc57=fs[_0xf968('0x71')](_0x2a74a0);if(_0xd6cc57['length']>0x1){removeReferences(_0x2609c8,_0x2a74a0);logger[_0xf968('0x2e')](_0xf968('0x72'));return _0x3f851f(new Error('Invalid\x20plugin\x20structure'));}var _0x45a374=fs['lstatSync'](path[_0xf968('0x5e')](_0x2a74a0,_0xd6cc57[0x0]));if(_0x45a374['isFile']()){removeReferences(_0x2609c8,_0x2a74a0);logger[_0xf968('0x2e')](_0xf968('0x72'));return _0x3f851f(new Error(_0xf968('0x72')));}if(_0x45a374['isDirectory']()){var _0x45fc19=fs['readdirSync'](path[_0xf968('0x5e')](_0x2a74a0,_0xd6cc57[0x0]));if(_0x45fc19[_0xf968('0x3c')]===0x0){removeReferences(_0x2609c8,_0x2a74a0);logger[_0xf968('0x2e')]('Invalid\x20plugin\x20structure');return _0x3f851f(new Error(_0xf968('0x72')));}var _0x127451=_0x45fc19[_0xf968('0x73')](function(_0x5f26a2){return _0x5f26a2===_0xf968('0x74');});if(!_0x127451){return _0x3f851f(new Error('Plugin\x20manifest\x20missing'));}var _0xa9a685=fs[_0xf968('0x75')](path['join'](_0x2a74a0,_0xd6cc57[0x0],'manifest.json'));var _0xe36c05=JSON[_0xf968('0x76')](_0xa9a685);if(_0xf968('0x21')==typeof _0xe36c05[_0xf968('0x30')]){return _0x3f851f(new Error(_0xf968('0x77')));}if(_0xf968('0x21')==typeof _0xe36c05['type']){return _0x3f851f(new Error(_0xf968('0x78')));}if(_0xf968('0x21')==typeof _0xe36c05[_0xf968('0x79')]){return _0x3f851f(new Error(_0xf968('0x7a')));}if('undefined'==typeof _0xe36c05[_0xf968('0x7b')]){return _0x3f851f(new Error(_0xf968('0x7c')));}if(_0xe36c05[_0xf968('0x46')]==='html'){if(_0xf968('0x21')==typeof _0xe36c05[_0xf968('0x7b')]['views']){return _0x3f851f(new Error(_0xf968('0x7d')));}if(_0xf968('0x21')==typeof _0xe36c05[_0xf968('0x7b')][_0xf968('0x7e')][_0xf968('0x7f')]&&_0xf968('0x21')==typeof _0xe36c05[_0xf968('0x7b')][_0xf968('0x7e')][_0xf968('0x80')]){return _0x3f851f(new Error(_0xf968('0x81')));}}else if(_0xe36c05['type']==='script'){if(_0xf968('0x21')==typeof _0xe36c05['parameters'][_0xf968('0x82')]){return _0x3f851f(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xf968('0x21')==typeof _0xe36c05[_0xf968('0x7b')][_0xf968('0x83')]){return _0x3f851f(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x3f851f(new Error(_0xf968('0x84')));}var _0x52a4fb=_0xe36c05[_0xf968('0x30')];var _0x2a0fff=_0xe36c05[_0xf968('0x85')];var _0x5e9fd3=_0xe36c05[_0xf968('0x46')];var _0x20988d=_0xe36c05['sidebar']?_0xe36c05[_0xf968('0x86')]:_0xf968('0x87');var _0x13574a=_0xe36c05[_0xf968('0x88')]?_0xe36c05['icon']:_0xf968('0x89');var _0x332d86='';var _0x111f10='';var _0x36aaf4='';var _0xf6f72b='';var _0x4e825a=_0xe36c05[_0xf968('0x79')];if(_0x5e9fd3==='html'){if('undefined'!=typeof _0xe36c05[_0xf968('0x7b')][_0xf968('0x7e')][_0xf968('0x7f')]){var _0x3e3166=_0xe36c05[_0xf968('0x7b')][_0xf968('0x7e')][_0xf968('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xf968('0x8a')](_0x3e3166)){_0x332d86=path[_0xf968('0x5e')](_0xf968('0x8b'),_0x23cc1e,_0xd6cc57[0x0],_0x3e3166);}else{_0x332d86=_0x3e3166;}}else{logger[_0xf968('0x67')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xf968('0x21')!=typeof _0xe36c05['parameters'][_0xf968('0x7e')][_0xf968('0x80')]){var _0x1c55f1=_0xe36c05['parameters'][_0xf968('0x7e')][_0xf968('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xf968('0x8a')](_0x1c55f1)){_0x111f10=path[_0xf968('0x5e')]('plugins',_0x23cc1e,_0xd6cc57[0x0],_0x1c55f1);}else{_0x111f10=_0x1c55f1;}}else{logger[_0xf968('0x67')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5e9fd3===_0xf968('0x8c')){_0x36aaf4=_0xe36c05[_0xf968('0x7b')]['scriptName'];_0xf6f72b=_0xe36c05[_0xf968('0x7b')][_0xf968('0x83')];if(_0xf968('0x21')!=typeof _0xe36c05[_0xf968('0x7b')][_0xf968('0x7e')]){if(_0xf968('0x21')!=typeof _0xe36c05['parameters'][_0xf968('0x7e')][_0xf968('0x7f')]){var _0x3e3166=_0xe36c05[_0xf968('0x7b')][_0xf968('0x7e')][_0xf968('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3e3166)){_0x332d86=path[_0xf968('0x5e')](_0xf968('0x8b'),_0x23cc1e,_0xd6cc57[0x0],_0x3e3166);}else{_0x332d86=_0x3e3166;}}if('undefined'!=typeof _0xe36c05['parameters']['views'][_0xf968('0x80')]){var _0x1c55f1=_0xe36c05[_0xf968('0x7b')]['views'][_0xf968('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xf968('0x8a')](_0x1c55f1)){_0x111f10=path[_0xf968('0x5e')](_0xf968('0x8b'),_0x23cc1e,_0xd6cc57[0x0],_0x1c55f1);}else{_0x111f10=_0x1c55f1;}}}}var _0x572d02={'name':_0x52a4fb,'description':_0x2a0fff,'path':path[_0xf968('0x5e')](_0x23cc1e,_0xd6cc57[0x0]),'type':_0x5e9fd3,'sidebar':_0x20988d,'icon':_0x13574a,'adminUrl':_0x332d86,'agentUrl':_0x111f10,'scriptName':_0x36aaf4,'scriptPath':_0xf6f72b,'version':_0x4e825a};removeReferences(_0x2609c8,null);return db[_0xf968('0x34')][_0xf968('0x8d')](_0x572d02)[_0xf968('0x2c')](function(_0x426417){var _0x1a999b={'role':_0x468d1f[_0xf968('0x8e')][_0xf968('0x8f')],'userProfileId':_0x468d1f[_0xf968('0x8e')][_0xf968('0x90')]};if(!_0x1a999b)throw new Error(_0xf968('0x91'));if(_0x1a999b[_0xf968('0x8f')]===_0xf968('0x92')){var _0x334a97=_0x426417[_0xf968('0x29')]({'plain':!![]});return db[_0xf968('0x93')][_0xf968('0x4e')]({'where':{'name':_0xf968('0x2a'),'userProfileId':_0x1a999b[_0xf968('0x90')]},'raw':!![]})[_0xf968('0x2c')](function(_0x498636){if(_0x498636&&_0x498636['autoAssociation']===0x0){return db[_0xf968('0x2b')][_0xf968('0x8d')]({'name':_0x334a97[_0xf968('0x30')],'resourceId':_0x334a97['id'],'type':_0x498636[_0xf968('0x30')],'sectionId':_0x498636['id']},{})[_0xf968('0x2c')](function(){return _0x426417;});}else{return _0x426417;}})[_0xf968('0x4f')](function(_0x17c6fc){logger[_0xf968('0x2e')](_0xf968('0x94'),_0x17c6fc);throw _0x17c6fc;});}return _0x426417;})['then'](respondWithResult(_0x16caee,null))[_0xf968('0x4f')](handleError(_0x16caee,null));}});}catch(_0x22eb68){_0x16caee[_0xf968('0x1f')](0x1f4)[_0xf968('0x31')](_0x22eb68);}};function removeReferences(_0x2b9e37,_0x391265){try{if(_0x2b9e37){fs[_0xf968('0x66')](_0x2b9e37);logger[_0xf968('0x67')]('Zip\x20archive\x20removed');}if(_0x391265){rimraf(_0x391265,function(){});logger[_0xf968('0x67')](_0xf968('0x95'));}}catch(_0x275f69){logger['error'](_0x275f69);}}exports[_0xf968('0x96')]=function(_0x41bb32,_0x1006af,_0x49813e){return db[_0xf968('0x34')][_0xf968('0x4e')]({'where':{'id':_0x41bb32['params']['id']}})['then'](handleEntityNotFound(_0x1006af,null))[_0xf968('0x2c')](saveUpdates(_0x41bb32[_0xf968('0x8e')],null))[_0xf968('0x2c')](respondWithResult(_0x1006af,null))[_0xf968('0x4f')](handleError(_0x1006af,null));};exports[_0xf968('0x97')]=function(_0x5eacb2,_0x32f74e,_0x594727){return db[_0xf968('0x34')]['find']({'where':{'id':_0x5eacb2[_0xf968('0x4b')]['id']}})[_0xf968('0x2c')](function(_0xa0579d){if(_0xa0579d){return _0xa0579d[_0xf968('0x28')]();}})['then'](function(_0x58b029){rimraf(path[_0xf968('0x5e')](config[_0xf968('0x51')],_0xf968('0x52'),path[_0xf968('0x5f')](_0x58b029[_0xf968('0x8')])),function(){});return _0x58b029;})['then'](handleEntityNotFound(_0x32f74e,null))[_0xf968('0x2c')](respondWithStatusCode(_0x32f74e,null))[_0xf968('0x4f')](handleError(_0x32f74e,null));};exports[_0xf968('0x98')]=function(_0x29b0aa,_0x1ffcbe,_0xe49be2){return BPromise[_0xf968('0x99')]()['then'](function(){if(!_0x29b0aa['query'][_0xf968('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x29b0aa[_0xf968('0x38')][_0xf968('0x9a')]){throw new Error(_0xf968('0x9b'));}var _0x4340a5=_0x29b0aa[_0xf968('0x38')][_0xf968('0x9c')]?_0x29b0aa[_0xf968('0x38')]['hostname']+':'+_0x29b0aa['query'][_0xf968('0x9a')]:_0xf968('0x9d')+_0x29b0aa[_0xf968('0x38')][_0xf968('0x9a')];var _0x226d34=_0x29b0aa['query'][_0xf968('0x25')]?_0x29b0aa[_0xf968('0x38')][_0xf968('0x25')]:!![];var _0x4503e3=_0x29b0aa['query']['encoding']?_0x29b0aa[_0xf968('0x38')][_0xf968('0x9e')]:null;var _0x10266a={'method':_0x29b0aa[_0xf968('0x9f')],'uri':util[_0xf968('0x53')](_0xf968('0xa0'),_0x4340a5,_0x29b0aa[_0xf968('0x38')][_0xf968('0x8')]),'json':_0x226d34,'resolveWithFullResponse':!![],'encoding':_0x4503e3,'qs':_0x29b0aa[_0xf968('0x38')]};if(_0x29b0aa[_0xf968('0xa1')]){_0x10266a[_0xf968('0xa1')]=_0x29b0aa[_0xf968('0xa1')];if(_0x10266a[_0xf968('0xa1')][_0xf968('0xa2')]){delete _0x10266a[_0xf968('0xa1')][_0xf968('0xa2')];}}if(_0x10266a['headers'][_0xf968('0xa3')]){delete _0x10266a[_0xf968('0xa1')][_0xf968('0xa3')];}return rp(_0x10266a);})[_0xf968('0x2c')](function(_0x435cc2){if(_0x435cc2){_0x1ffcbe['set'](_0x435cc2[_0xf968('0xa1')]);logger[_0xf968('0x67')](_0x435cc2[_0xf968('0x8e')]);if(_[_0xf968('0xa4')](_0x29b0aa[_0xf968('0x38')]['path'],_0xf968('0x50'))&&_0x435cc2[_0xf968('0xa5')]==0x1f4){return _0x1ffcbe[_0xf968('0x1e')](_0x435cc2[_0xf968('0xa5')]);}else{return _0x1ffcbe[_0xf968('0x1f')](_0x435cc2[_0xf968('0xa5')])[_0xf968('0x31')](_0x435cc2[_0xf968('0x8e')]);}}else{return _0x1ffcbe[_0xf968('0x1e')](0xc8);}})['catch'](handleError(_0x1ffcbe,null));};exports[_0xf968('0xa6')]=function(_0xc7b46b,_0x276cb6,_0x10a199){return BPromise['resolve']()[_0xf968('0x2c')](function(){if(!_0xc7b46b[_0xf968('0x38')][_0xf968('0x8')]){throw new Error(_0xf968('0xa7'));}if(!_0xc7b46b[_0xf968('0x38')][_0xf968('0x9a')]){throw new Error(_0xf968('0x9b'));}var _0xeba48f=_0xc7b46b[_0xf968('0x38')][_0xf968('0x9c')]?_0xc7b46b['query'][_0xf968('0x9c')]+':'+_0xc7b46b[_0xf968('0x38')]['port']:_0xf968('0x9d')+_0xc7b46b[_0xf968('0x38')][_0xf968('0x9a')];var _0x1a5ee2=_0xc7b46b['query'][_0xf968('0x25')]?_0xc7b46b['query'][_0xf968('0x25')]:!![];var _0x1709ea=_0xc7b46b['query']['encoding']?_0xc7b46b['query'][_0xf968('0x9e')]:null;var _0x557db7={'method':_0xc7b46b[_0xf968('0x9f')],'uri':util['format'](_0xf968('0xa0'),_0xeba48f,_0xc7b46b['query']['path']),'json':_0x1a5ee2,'resolveWithFullResponse':!![],'encoding':_0x1709ea,'body':_0xc7b46b['body']};if(_0xc7b46b['headers']){_0x557db7[_0xf968('0xa1')]=_0xc7b46b[_0xf968('0xa1')];if(_0x557db7[_0xf968('0xa1')]['content-length']){delete _0x557db7[_0xf968('0xa1')]['content-length'];}}if(_0x557db7[_0xf968('0xa1')][_0xf968('0xa3')]){delete _0x557db7[_0xf968('0xa1')]['content-type'];}return rp(_0x557db7);})[_0xf968('0x2c')](function(_0x52b49f){if(_0x52b49f){_0x276cb6[_0xf968('0xa8')](_0x52b49f[_0xf968('0xa1')]);logger['info'](_0x52b49f[_0xf968('0x8e')]);return _0x276cb6['status'](_0x52b49f['statusCode'])[_0xf968('0x31')](_0x52b49f['body']);}else{return _0x276cb6['sendStatus'](0xc8);}})[_0xf968('0x4f')](handleError(_0x276cb6,null));};
\ No newline at end of file
index 8e8afbb..46e6bea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00b3=['hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','emit'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x00b3,0x157));var _0x300b=function(_0x1ac15e,_0x22006a){_0x1ac15e=_0x1ac15e-0x0;var _0x423988=_0x00b3[_0x1ac15e];return _0x423988;};'use strict';var EventEmitter=require(_0x300b('0x0'));var Plugin=require(_0x300b('0x1'))['db'][_0x300b('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x300b('0x3')](0x0);var events={'afterCreate':_0x300b('0x4'),'afterUpdate':_0x300b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x968375){return function(_0x204f71,_0x494436,_0x2f3a41){PluginEvents['emit'](_0x968375+':'+_0x204f71['id'],_0x204f71);PluginEvents[_0x300b('0x6')](_0x968375,_0x204f71);_0x2f3a41(null);};}for(var e in events){if(events[_0x300b('0x7')](e)){var event=events[e];Plugin[_0x300b('0x8')](e,emitEvent(event));}}module[_0x300b('0x9')]=PluginEvents;
\ No newline at end of file
+var _0xc99e=['hasOwnProperty','hook','events','../../mysqldb','Plugin','setMaxListeners','save','update','emit'];(function(_0x413da3,_0x2cd7ac){var _0x33bd91=function(_0x562df3){while(--_0x562df3){_0x413da3['push'](_0x413da3['shift']());}};_0x33bd91(++_0x2cd7ac);}(_0xc99e,0x6e));var _0xec99=function(_0x507c9b,_0x535e41){_0x507c9b=_0x507c9b-0x0;var _0x554ccc=_0xc99e[_0x507c9b];return _0x554ccc;};'use strict';var EventEmitter=require(_0xec99('0x0'));var Plugin=require(_0xec99('0x1'))['db'][_0xec99('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xec99('0x3')](0x0);var events={'afterCreate':_0xec99('0x4'),'afterUpdate':_0xec99('0x5'),'afterDestroy':'remove'};function emitEvent(_0xdd6e94){return function(_0x4055ec,_0x111230,_0xc7b94f){PluginEvents[_0xec99('0x6')](_0xdd6e94+':'+_0x4055ec['id'],_0x4055ec);PluginEvents[_0xec99('0x6')](_0xdd6e94,_0x4055ec);_0xc7b94f(null);};}for(var e in events){if(events[_0xec99('0x7')](e)){var event=events[e];Plugin[_0xec99('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
index b27edc7..b7d20c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1280=['exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./plugin.attributes'];(function(_0x58de4a,_0x564dbc){var _0x178820=function(_0x3576ef){while(--_0x3576ef){_0x58de4a['push'](_0x58de4a['shift']());}};_0x178820(++_0x564dbc);}(_0x1280,0xba));var _0x0128=function(_0x1894e7,_0x1253e6){_0x1894e7=_0x1894e7-0x0;var _0x5e857f=_0x1280[_0x1894e7];return _0x5e857f;};'use strict';var _=require(_0x0128('0x0'));var util=require(_0x0128('0x1'));var logger=require(_0x0128('0x2'))(_0x0128('0x3'));var moment=require(_0x0128('0x4'));var BPromise=require(_0x0128('0x5'));var rp=require(_0x0128('0x6'));var fs=require('fs');var path=require(_0x0128('0x7'));var rimraf=require(_0x0128('0x8'));var config=require('../../config/environment');var attributes=require(_0x0128('0x9'));module[_0x0128('0xa')]=function(_0x59959a,_0x589536){return _0x59959a[_0x0128('0xb')](_0x0128('0xc'),attributes,{'tableName':_0x0128('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcde5=['rimraf','../../config/environment','plugins','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x36284b,_0x2b7436){var _0x23c34a=function(_0x14f579){while(--_0x14f579){_0x36284b['push'](_0x36284b['shift']());}};_0x23c34a(++_0x2b7436);}(_0xcde5,0x1ce));var _0x5cde=function(_0x59dcd0,_0x30bbeb){_0x59dcd0=_0x59dcd0-0x0;var _0x1abc78=_0xcde5[_0x59dcd0];return _0x1abc78;};'use strict';var _=require(_0x5cde('0x0'));var util=require(_0x5cde('0x1'));var logger=require(_0x5cde('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5cde('0x3'));var rp=require(_0x5cde('0x4'));var fs=require('fs');var path=require(_0x5cde('0x5'));var rimraf=require(_0x5cde('0x6'));var config=require(_0x5cde('0x7'));var attributes=require('./plugin.attributes');module['exports']=function(_0x4ef416,_0x266273){return _0x4ef416['define']('Plugin',attributes,{'tableName':_0x5cde('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c56f4fc..43774d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dd1=['error','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin','body','options','raw','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','register','request','then','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4d17ff,_0x684251){var _0xdf1209=function(_0xa5bb39){while(--_0xa5bb39){_0x4d17ff['push'](_0x4d17ff['shift']());}};_0xdf1209(++_0x684251);}(_0x7dd1,0x169));var _0x17dd=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7dd1[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x17dd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x17dd('0x1'));var rs=require(_0x17dd('0x2'));var fs=require('fs');var Redis=require(_0x17dd('0x3'));var db=require(_0x17dd('0x4'))['db'];var utils=require(_0x17dd('0x5'));var logger=require(_0x17dd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x17dd('0x7'));var client=jayson['client'][_0x17dd('0x8')]({'port':0x232a});config[_0x17dd('0x9')]=_['defaults'](config[_0x17dd('0x9')],{'host':_0x17dd('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x17dd('0x9')]));require('./plugin.socket')[_0x17dd('0xb')](socket);function respondWithRpcPromise(_0x4b05ce,_0x5dd029,_0x136619){return new BPromise(function(_0x44d1b8,_0x518c7b){return client[_0x17dd('0xc')](_0x4b05ce,_0x136619)[_0x17dd('0xd')](function(_0x1371d7){logger['info']('Plugin,\x20%s,\x20%s',_0x5dd029,_0x17dd('0xe'));logger['debug'](_0x17dd('0xf'),_0x5dd029,_0x17dd('0xe'),JSON[_0x17dd('0x10')](_0x1371d7));if(_0x1371d7[_0x17dd('0x11')]){if(_0x1371d7[_0x17dd('0x11')]['code']===0x1f4){logger[_0x17dd('0x11')](_0x17dd('0x12'),_0x5dd029,_0x1371d7[_0x17dd('0x11')][_0x17dd('0x13')]);return _0x518c7b(_0x1371d7[_0x17dd('0x11')][_0x17dd('0x13')]);}logger['error'](_0x17dd('0x12'),_0x5dd029,_0x1371d7['error']['message']);return _0x44d1b8(_0x1371d7[_0x17dd('0x11')][_0x17dd('0x13')]);}else{logger['info'](_0x17dd('0x12'),_0x5dd029,_0x17dd('0xe'));_0x44d1b8(_0x1371d7['result'][_0x17dd('0x13')]);}})[_0x17dd('0x14')](function(_0x26f670){logger[_0x17dd('0x11')](_0x17dd('0x12'),_0x5dd029,_0x26f670);_0x518c7b(_0x26f670);});});}exports[_0x17dd('0x15')]=function(_0x26907a){var _0x2453eb=this;return new Promise(function(_0x53cc4c,_0x30d55a){return db[_0x17dd('0x16')]['create'](_0x26907a[_0x17dd('0x17')],{'raw':_0x26907a[_0x17dd('0x18')]?_0x26907a[_0x17dd('0x18')][_0x17dd('0x19')]===undefined?!![]:![]:!![]})[_0x17dd('0xd')](function(_0x72eb05){logger['info'](_0x17dd('0x15'),_0x26907a);logger[_0x17dd('0x1a')](_0x17dd('0x15'),_0x26907a,JSON[_0x17dd('0x10')](_0x72eb05));_0x53cc4c(_0x72eb05);})[_0x17dd('0x14')](function(_0x3f08bc){logger[_0x17dd('0x11')]('CreatePlugin',_0x3f08bc[_0x17dd('0x13')],_0x26907a);_0x30d55a(_0x2453eb[_0x17dd('0x11')](0x1f4,_0x3f08bc[_0x17dd('0x13')]));});});};
\ No newline at end of file
+var _0x9863=['then','request\x20sent','debug','stringify','error','code','Plugin,\x20%s,\x20%s','message','info','result','catch','CreatePlugin','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','redis','socket.io-emitter','request'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x9863,0x160));var _0x3986=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9863[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3986('0x0'));var util=require(_0x3986('0x1'));var moment=require(_0x3986('0x2'));var BPromise=require(_0x3986('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3986('0x4'));var db=require(_0x3986('0x5'))['db'];var utils=require(_0x3986('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3986('0x7'));var jayson=require(_0x3986('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x3986('0x9')]=_['defaults'](config[_0x3986('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3986('0xa'))(new Redis(config['redis']));require('./plugin.socket')['register'](socket);function respondWithRpcPromise(_0x2519e1,_0x184a6d,_0x4fe6d6){return new BPromise(function(_0x3b459a,_0x4843fa){return client[_0x3986('0xb')](_0x2519e1,_0x4fe6d6)[_0x3986('0xc')](function(_0x2f00d1){logger['info']('Plugin,\x20%s,\x20%s',_0x184a6d,_0x3986('0xd'));logger[_0x3986('0xe')]('Plugin,\x20%s,\x20%s,\x20%s',_0x184a6d,_0x3986('0xd'),JSON[_0x3986('0xf')](_0x2f00d1));if(_0x2f00d1[_0x3986('0x10')]){if(_0x2f00d1['error'][_0x3986('0x11')]===0x1f4){logger[_0x3986('0x10')](_0x3986('0x12'),_0x184a6d,_0x2f00d1[_0x3986('0x10')][_0x3986('0x13')]);return _0x4843fa(_0x2f00d1[_0x3986('0x10')]['message']);}logger[_0x3986('0x10')](_0x3986('0x12'),_0x184a6d,_0x2f00d1['error'][_0x3986('0x13')]);return _0x3b459a(_0x2f00d1[_0x3986('0x10')][_0x3986('0x13')]);}else{logger[_0x3986('0x14')]('Plugin,\x20%s,\x20%s',_0x184a6d,_0x3986('0xd'));_0x3b459a(_0x2f00d1[_0x3986('0x15')][_0x3986('0x13')]);}})[_0x3986('0x16')](function(_0x570244){logger[_0x3986('0x10')](_0x3986('0x12'),_0x184a6d,_0x570244);_0x4843fa(_0x570244);});});}exports[_0x3986('0x17')]=function(_0x473612){var _0x15333a=this;return new Promise(function(_0x4a2030,_0x2bfd49){return db['Plugin'][_0x3986('0x18')](_0x473612[_0x3986('0x19')],{'raw':_0x473612[_0x3986('0x1a')]?_0x473612[_0x3986('0x1a')][_0x3986('0x1b')]===undefined?!![]:![]:!![]})[_0x3986('0xc')](function(_0x4d05f4){logger['info'](_0x3986('0x17'),_0x473612);logger[_0x3986('0xe')]('CreatePlugin',_0x473612,JSON[_0x3986('0xf')](_0x4d05f4));_0x4a2030(_0x4d05f4);})[_0x3986('0x16')](function(_0x5a2a84){logger[_0x3986('0x10')](_0x3986('0x17'),_0x5a2a84[_0x3986('0x13')],_0x473612);_0x2bfd49(_0x15333a[_0x3986('0x10')](0x1f4,_0x5a2a84[_0x3986('0x13')]));});});};
\ No newline at end of file
index fcd3396..7e49ba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x483a=['emit','removeListener','length','plugin:','./plugin.events','remove','update'];(function(_0x710ad5,_0x266b58){var _0x44381c=function(_0x40e19f){while(--_0x40e19f){_0x710ad5['push'](_0x710ad5['shift']());}};_0x44381c(++_0x266b58);}(_0x483a,0x89));var _0xa483=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x483a[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require(_0xa483('0x0'));var events=['save',_0xa483('0x1'),_0xa483('0x2')];function createListener(_0x15a824,_0x3a493b){return function(_0xfe0622){_0x3a493b[_0xa483('0x3')](_0x15a824,_0xfe0622);};}function removeListener(_0x10c86f,_0x1dbebf){return function(){PluginEvents[_0xa483('0x4')](_0x10c86f,_0x1dbebf);};}exports['register']=function(_0xa9e639){for(var _0x33e731=0x0,_0x31838b=events[_0xa483('0x5')];_0x33e731<_0x31838b;_0x33e731++){var _0x3af8d5=events[_0x33e731];var _0x4c8f93=createListener(_0xa483('0x6')+_0x3af8d5,_0xa9e639);PluginEvents['on'](_0x3af8d5,_0x4c8f93);}};
\ No newline at end of file
+var _0xd093=['remove','emit','removeListener','length','plugin:','./plugin.events','save'];(function(_0x14bf63,_0xdbd373){var _0x410d22=function(_0x2e5e3a){while(--_0x2e5e3a){_0x14bf63['push'](_0x14bf63['shift']());}};_0x410d22(++_0xdbd373);}(_0xd093,0x67));var _0x3d09=function(_0x5908ee,_0xd2caae){_0x5908ee=_0x5908ee-0x0;var _0x48fd1d=_0xd093[_0x5908ee];return _0x48fd1d;};'use strict';var PluginEvents=require(_0x3d09('0x0'));var events=[_0x3d09('0x1'),_0x3d09('0x2'),'update'];function createListener(_0x299aa0,_0x38e060){return function(_0x258d33){_0x38e060[_0x3d09('0x3')](_0x299aa0,_0x258d33);};}function removeListener(_0x435ca5,_0x3e01db){return function(){PluginEvents[_0x3d09('0x4')](_0x435ca5,_0x3e01db);};}exports['register']=function(_0x1a1d19){for(var _0x574897=0x0,_0x3f322e=events[_0x3d09('0x5')];_0x574897<_0x3f322e;_0x574897++){var _0x2fcffe=events[_0x574897];var _0x49da80=createListener(_0x3d09('0x6')+_0x2fcffe,_0x1a1d19);PluginEvents['on'](_0x2fcffe,_0x49da80);}};
\ No newline at end of file
index 5ccbb89..1404183 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(_0x212b50,_0x336ad7){var _0x30407b=function(_0xd13834){while(--_0xd13834){_0x212b50['push'](_0x212b50['shift']());}};_0x30407b(++_0x336ad7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x27ed29,_0x4980c7){var _0x1d78fc=function(_0x38f86b){while(--_0x38f86b){_0x27ed29['push'](_0x27ed29['shift']());}};_0x1d78fc(++_0x4980c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 b143948..04a10ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc368=['update','restart','Unknown\x20status','destroy','delete','dump','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','status','json','error','send','npm\x20install','info','index','list','then','reject','name','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','start','Missing\x20name\x20and/or\x20path'];(function(_0x2169a4,_0x300a49){var _0xee2705=function(_0x4126dc){while(--_0x4126dc){_0x2169a4['push'](_0x2169a4['shift']());}};_0xee2705(++_0x300a49);}(_0xc368,0x7b));var _0x8c36=function(_0x406510,_0x1f73e2){_0x406510=_0x406510-0x0;var _0x385d10=_0xc368[_0x406510];return _0x385d10;};'use strict';var _=require('lodash');var pm2=require(_0x8c36('0x0'));var logger=require('../../config/logger')(_0x8c36('0x1'));var path=require(_0x8c36('0x2'));var exec=require(_0x8c36('0x3'))[_0x8c36('0x4')];var BPromise=require(_0x8c36('0x5'));function handleEntityNotFound(_0x5d3b27,_0x3e9034){return function(_0x3bb30e){if(!_0x3bb30e){_0x5d3b27[_0x8c36('0x6')](0x194);;}return _0x3bb30e;};}function respondWithResult(_0x1d3660,_0x5ebfc1){_0x5ebfc1=_0x5ebfc1||0xc8;return function(_0x554022){if(_0x554022){return _0x1d3660[_0x8c36('0x7')](_0x5ebfc1)[_0x8c36('0x8')](_0x554022);}return null;};}function handleError(_0x3e76be,_0x26bad1){_0x26bad1=_0x26bad1||0x1f4;return function(_0x3af839){logger[_0x8c36('0x9')](_0x3af839['stack']);if(_0x3af839['name']){delete _0x3af839['name'];}_0x3e76be[_0x8c36('0x7')](_0x26bad1)[_0x8c36('0xa')](_0x3af839);};}function execChildProcess(){return new BPromise(function(_0x5132f6,_0x36cb13){exec(_0x8c36('0xb'),function(_0x1d5c61,_0xe7857e,_0x2a8e73){logger[_0x8c36('0xc')](_0xe7857e);logger[_0x8c36('0xc')](_0x2a8e73);if(_0x1d5c61){logger[_0x8c36('0x9')](_0x1d5c61);return _0x36cb13(_0x1d5c61);}return _0x5132f6(_0xe7857e);});});}exports[_0x8c36('0xd')]=function(_0x11f8fa,_0x43736d){return pm2[_0x8c36('0xe')]()[_0x8c36('0xf')](function(_0x220f18){if(_0x220f18){var _0x5dfcd5=_[_0x8c36('0x10')](_0x220f18,function(_0x5e32ad){return _0x5e32ad[_0x8c36('0x11')]===_0x8c36('0x12')||_0x5e32ad[_0x8c36('0x11')]===_0x8c36('0x13');});return{'rows':_0x5dfcd5,'count':_0x5dfcd5[_0x8c36('0x14')]};}return null;})[_0x8c36('0xf')](respondWithResult(_0x43736d,null))[_0x8c36('0x15')](handleError(_0x43736d,null));};exports[_0x8c36('0x16')]=function(_0x30229e,_0x49cafe){return pm2[_0x8c36('0x17')](_0x30229e[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](respondWithResult(_0x49cafe,null))[_0x8c36('0xf')](handleEntityNotFound(_0x49cafe,null))[_0x8c36('0x15')](handleError(_0x49cafe,null));};exports['create']=function(_0x15100f,_0x409de0){if(_0x15100f[_0x8c36('0x19')][_0x8c36('0x11')]&&_0x15100f[_0x8c36('0x19')][_0x8c36('0x1a')]){var _0xfb9763=path[_0x8c36('0x1b')](__dirname,_0x8c36('0x1c'),_0x15100f[_0x8c36('0x19')][_0x8c36('0x1a')]);var _0x14ee6b=process[_0x8c36('0x1d')]();process['chdir'](path['dirname'](_0xfb9763));return execChildProcess()['then'](function(_0x55b844){process[_0x8c36('0x1e')](_0x14ee6b);return pm2[_0x8c36('0x1f')]({'name':_0x15100f[_0x8c36('0x19')][_0x8c36('0x11')],'script':_0xfb9763});})[_0x8c36('0xf')](function(_0x27c0df){pm2['dump']();return _0x27c0df[0x0];})[_0x8c36('0xf')](respondWithResult(_0x409de0,0xc9))['catch'](handleError(_0x409de0,null));}else{return _0x409de0[_0x8c36('0x7')](0x1f4)['send']({'message':_0x8c36('0x20')});}};exports[_0x8c36('0x21')]=function(_0x271ec4,_0x1010c8){if(_0x271ec4['body']['id']){delete _0x271ec4['body']['id'];}var _0x7e7e56={'online':_0x8c36('0x22'),'stopped':'stop'};if(_0x7e7e56['hasOwnProperty'](_0x271ec4[_0x8c36('0x19')][_0x8c36('0x7')])){return pm2[_0x7e7e56[_0x271ec4['body'][_0x8c36('0x7')]]](_0x271ec4[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](respondWithResult(_0x1010c8,0xc8))['catch'](handleError(_0x1010c8,null));}else{return _0x1010c8['status'](0x1f4)[_0x8c36('0xa')]({'message':_0x8c36('0x23')});}};exports[_0x8c36('0x24')]=function(_0x192ce3,_0x3ae970){if(_0x192ce3[_0x8c36('0x19')]['id']){delete _0x192ce3[_0x8c36('0x19')]['id'];}if(_0x192ce3[_0x8c36('0x18')]['id']){return pm2[_0x8c36('0x25')](_0x192ce3[_0x8c36('0x18')]['id'])[_0x8c36('0xf')](function(_0x36648e){pm2[_0x8c36('0x26')]();return _0x36648e[0x0];})[_0x8c36('0xf')](respondWithResult(_0x3ae970,null))[_0x8c36('0x15')](handleError(_0x3ae970,null));}else{return _0x3ae970[_0x8c36('0x7')](0x1f4)[_0x8c36('0xa')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
+var _0x7a2c=['start','dump','catch','status','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','destroy','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','json','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','show','describe','params','create','body','join','script','cwd','chdir','dirname'];(function(_0x4e7035,_0x4fda2c){var _0x1d7585=function(_0x1d135b){while(--_0x1d135b){_0x4e7035['push'](_0x4e7035['shift']());}};_0x1d7585(++_0x4fda2c);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x1e8fc7,_0x4002a7){_0x1e8fc7=_0x1e8fc7-0x0;var _0x53c602=_0x7a2c[_0x1e8fc7];return _0x53c602;};'use strict';var _=require(_0xc7a2('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var path=require(_0xc7a2('0x3'));var exec=require(_0xc7a2('0x4'))[_0xc7a2('0x5')];var BPromise=require(_0xc7a2('0x6'));function handleEntityNotFound(_0x3f2b0d,_0x34cd60){return function(_0x489232){if(!_0x489232){_0x3f2b0d[_0xc7a2('0x7')](0x194);;}return _0x489232;};}function respondWithResult(_0x1ddbae,_0x5f334e){_0x5f334e=_0x5f334e||0xc8;return function(_0x481430){if(_0x481430){return _0x1ddbae['status'](_0x5f334e)[_0xc7a2('0x8')](_0x481430);}return null;};}function handleError(_0x3de428,_0x3f0573){_0x3f0573=_0x3f0573||0x1f4;return function(_0x426fea){logger['error'](_0x426fea[_0xc7a2('0x9')]);if(_0x426fea[_0xc7a2('0xa')]){delete _0x426fea[_0xc7a2('0xa')];}_0x3de428['status'](_0x3f0573)[_0xc7a2('0xb')](_0x426fea);};}function execChildProcess(){return new BPromise(function(_0x4a44c7,_0x3e216a){exec(_0xc7a2('0xc'),function(_0x1a9b38,_0x540267,_0x226982){logger[_0xc7a2('0xd')](_0x540267);logger[_0xc7a2('0xd')](_0x226982);if(_0x1a9b38){logger['error'](_0x1a9b38);return _0x3e216a(_0x1a9b38);}return _0x4a44c7(_0x540267);});});}exports[_0xc7a2('0xe')]=function(_0x1b7844,_0x181f0c){return pm2[_0xc7a2('0xf')]()[_0xc7a2('0x10')](function(_0x2af363){if(_0x2af363){var _0x15d4cf=_[_0xc7a2('0x11')](_0x2af363,function(_0x275be9){return _0x275be9[_0xc7a2('0xa')]===_0xc7a2('0x12')||_0x275be9[_0xc7a2('0xa')]===_0xc7a2('0x13');});return{'rows':_0x15d4cf,'count':_0x15d4cf[_0xc7a2('0x14')]};}return null;})[_0xc7a2('0x10')](respondWithResult(_0x181f0c,null))['catch'](handleError(_0x181f0c,null));};exports[_0xc7a2('0x15')]=function(_0x59e8ad,_0x2414f4){return pm2[_0xc7a2('0x16')](_0x59e8ad[_0xc7a2('0x17')]['id'])[_0xc7a2('0x10')](respondWithResult(_0x2414f4,null))['then'](handleEntityNotFound(_0x2414f4,null))['catch'](handleError(_0x2414f4,null));};exports[_0xc7a2('0x18')]=function(_0x22e80a,_0x51cbb3){if(_0x22e80a['body']['name']&&_0x22e80a[_0xc7a2('0x19')]['script']){var _0x155c42=path[_0xc7a2('0x1a')](__dirname,'../../files/plugins',_0x22e80a[_0xc7a2('0x19')][_0xc7a2('0x1b')]);var _0x1b51a1=process[_0xc7a2('0x1c')]();process[_0xc7a2('0x1d')](path[_0xc7a2('0x1e')](_0x155c42));return execChildProcess()[_0xc7a2('0x10')](function(_0x4a05e1){process['chdir'](_0x1b51a1);return pm2[_0xc7a2('0x1f')]({'name':_0x22e80a[_0xc7a2('0x19')]['name'],'script':_0x155c42});})[_0xc7a2('0x10')](function(_0x3cad61){pm2[_0xc7a2('0x20')]();return _0x3cad61[0x0];})[_0xc7a2('0x10')](respondWithResult(_0x51cbb3,0xc9))[_0xc7a2('0x21')](handleError(_0x51cbb3,null));}else{return _0x51cbb3[_0xc7a2('0x22')](0x1f4)[_0xc7a2('0xb')]({'message':_0xc7a2('0x23')});}};exports['update']=function(_0x35a6e0,_0x505fe8){if(_0x35a6e0[_0xc7a2('0x19')]['id']){delete _0x35a6e0['body']['id'];}var _0x20404b={'online':_0xc7a2('0x24'),'stopped':_0xc7a2('0x25')};if(_0x20404b[_0xc7a2('0x26')](_0x35a6e0['body']['status'])){return pm2[_0x20404b[_0x35a6e0[_0xc7a2('0x19')][_0xc7a2('0x22')]]](_0x35a6e0[_0xc7a2('0x17')]['id'])[_0xc7a2('0x10')](respondWithResult(_0x505fe8,0xc8))[_0xc7a2('0x21')](handleError(_0x505fe8,null));}else{return _0x505fe8[_0xc7a2('0x22')](0x1f4)[_0xc7a2('0xb')]({'message':'Unknown\x20status'});}};exports[_0xc7a2('0x27')]=function(_0x926b6c,_0x496386){if(_0x926b6c[_0xc7a2('0x19')]['id']){delete _0x926b6c[_0xc7a2('0x19')]['id'];}if(_0x926b6c[_0xc7a2('0x17')]['id']){return pm2['delete'](_0x926b6c[_0xc7a2('0x17')]['id'])['then'](function(_0x1f9bdc){pm2['dump']();return _0x1f9bdc[0x0];})['then'](respondWithResult(_0x496386,null))[_0xc7a2('0x21')](handleError(_0x496386,null));}else{return _0x496386['status'](0x1f4)['send']({'message':_0xc7a2('0x28')});}};
\ No newline at end of file
index 51ea236..6b265e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6db4=['Router','../../components/auth/service','./realtime.controller','get','/queues','isAuthenticated','exports'];(function(_0x473faa,_0x54e377){var _0x1c8cbf=function(_0x5ceb6e){while(--_0x5ceb6e){_0x473faa['push'](_0x473faa['shift']());}};_0x1c8cbf(++_0x54e377);}(_0x6db4,0x111));var _0x46db=function(_0x1da035,_0x1ab2c3){_0x1da035=_0x1da035-0x0;var _0x246930=_0x6db4[_0x1da035];return _0x246930;};'use strict';var express=require('express');var router=express[_0x46db('0x0')]();var auth=require(_0x46db('0x1'));var controller=require(_0x46db('0x2'));router[_0x46db('0x3')](_0x46db('0x4'),auth[_0x46db('0x5')](),controller['getQueues']);module[_0x46db('0x6')]=router;
\ No newline at end of file
+var _0x3ace=['getQueues','exports','Router','../../components/auth/service','./realtime.controller','isAuthenticated'];(function(_0x3208fb,_0x4708ec){var _0x17b44a=function(_0x58cc19){while(--_0x58cc19){_0x3208fb['push'](_0x3208fb['shift']());}};_0x17b44a(++_0x4708ec);}(_0x3ace,0xda));var _0xe3ac=function(_0x497044,_0x3d5e26){_0x497044=_0x497044-0x0;var _0xc4b76c=_0x3ace[_0x497044];return _0xc4b76c;};'use strict';var express=require('express');var router=express[_0xe3ac('0x0')]();var auth=require(_0xe3ac('0x1'));var controller=require(_0xe3ac('0x2'));router['get']('/queues',auth[_0xe3ac('0x3')](),controller[_0xe3ac('0x4')]);module[_0xe3ac('0x5')]=router;
\ No newline at end of file
index d48cf67..615b585 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd046=['predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','get','paused','loggedInDb','pTalking','getAgents','online','getMembers','find','UserId','agents','User','Pause','QueueId','findAll','agent','length','rows','catch','lodash','jayson/promise','../../components/parsers/qs','api','http','limit','undefined','status','set','Content-Range','error','stack','name','send','getQueues','mail','chat','sms','openchannel','fax','whatsapp','voice','resolve','query','channel','includes','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','getResources','findAndCountAll','then','count','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','push','originated','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold'];(function(_0x5a99db,_0x1cece5){var _0x3aad62=function(_0x334cb7){while(--_0x334cb7){_0x5a99db['push'](_0x5a99db['shift']());}};_0x3aad62(++_0x1cece5);}(_0xd046,0x129));var _0x6d04=function(_0x48c59f,_0x5cb01e){_0x48c59f=_0x48c59f-0x0;var _0x47e86a=_0xd046[_0x48c59f];return _0x47e86a;};'use strict';var util=require('util');var _=require(_0x6d04('0x0'));var jayson=require(_0x6d04('0x1'));var qs=require(_0x6d04('0x2'));var logger=require('../../config/logger')(_0x6d04('0x3'));var db=require('../../mysqldb')['db'];var client=jayson['client'][_0x6d04('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x6d04('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x4a1d47,_0x4bacb1){return function(_0xf3b4e7){if(_0xf3b4e7){var _0x1968c4=typeof _0x4bacb1['offset']==='undefined'&&typeof _0x4bacb1[_0x6d04('0x5')]===_0x6d04('0x6');var _0x52fc0c=_0xf3b4e7['count'];var _0x27a3d6=_0x1968c4?0x0:_0x4bacb1['offset'];var _0x38bce9=_0x1968c4?_0xf3b4e7['count']:_0x4bacb1['offset']+_0x4bacb1['limit'];var _0x36ae3e;if(_0x38bce9>=_0x52fc0c){_0x38bce9=_0x52fc0c;_0x36ae3e=0xc8;}else{_0x36ae3e=0xce;}_0x4a1d47[_0x6d04('0x7')](_0x36ae3e);return _0x4a1d47[_0x6d04('0x8')](_0x6d04('0x9'),_0x27a3d6+'-'+_0x38bce9+'/'+_0x52fc0c)['json'](_0xf3b4e7);}return null;};}function handleError(_0x26a6ab,_0x103593){_0x103593=_0x103593||0x1f4;return function(_0x39156e){logger[_0x6d04('0xa')](_0x39156e[_0x6d04('0xb')]);if(_0x39156e[_0x6d04('0xc')]){delete _0x39156e[_0x6d04('0xc')];}_0x26a6ab[_0x6d04('0x7')](_0x103593)[_0x6d04('0xd')](_0x39156e);};}exports[_0x6d04('0xe')]=function(_0x252eee,_0x43f451){var _0x165b23=[_0x6d04('0xf'),_0x6d04('0x10'),_0x6d04('0x11'),_0x6d04('0x12'),_0x6d04('0x13'),_0x6d04('0x14'),_0x6d04('0x15')];var _0x14190b={'count':0x0,'rows':[]},_0x41dc21={},_0x2bc798;Promise[_0x6d04('0x16')]()['then'](function(){if(_0x252eee[_0x6d04('0x17')][_0x6d04('0x18')]){if(!_[_0x6d04('0x19')](_0x165b23,_0x252eee[_0x6d04('0x17')][_0x6d04('0x18')][_0x6d04('0x1a')]()))throw new Error(_0x6d04('0x1b'));_0x2bc798=_0x252eee[_0x6d04('0x17')][_0x6d04('0x18')][_0x6d04('0x1a')]();}var _0xbddecb=_[_0x6d04('0x1c')](_0x2bc798)+_0x6d04('0x1d');var _0x5bda3a=_[_0x6d04('0x1e')](db[_0xbddecb][_0x6d04('0x1f')],function(_0x54cf0e){return{'name':_0x54cf0e['fieldName'],'type':_0x54cf0e[_0x6d04('0x20')][_0x6d04('0x21')]};});_0x41dc21=qs[_0x6d04('0x22')](_0x5bda3a,_0x252eee);if(_0x252eee[_0x6d04('0x23')][_0x6d04('0x24')]===_0x6d04('0x23')){var _0x325c71={'params':{'id':_0x252eee[_0x6d04('0x23')][_0x6d04('0x25')]},'query':{'section':_0x2bc798===_0x6d04('0x15')&&_0x252eee[_0x6d04('0x17')][_0x6d04('0x20')]===_0x6d04('0x26')?_0x6d04('0x27'):_['startCase'](_0x2bc798)+_0x6d04('0x28'),'type':_0x252eee[_0x6d04('0x17')][_0x6d04('0x20')],'nolimit':!![],'sort':_0x6d04('0xc'),'filter':_0x252eee[_0x6d04('0x17')][_0x6d04('0x29')]}};return db['UserProfile'][_0x6d04('0x2a')](_0x325c71);}return db[_0xbddecb][_0x6d04('0x2b')](_0x41dc21);})[_0x6d04('0x2c')](function(_0x40b9e6){_0x14190b[_0x6d04('0x2d')]=_0x40b9e6['count'];var _0x5d1033=_0x2bc798==='voice'?client:routingClient;return _0x5d1033['request'](_[_0x6d04('0x1c')](_0x2bc798)+'Queues',_0x252eee)[_0x6d04('0x2c')](function(_0x4ed123){if(_0x4ed123[_0x6d04('0xa')])throw new Error(util[_0x6d04('0x2e')](_0x6d04('0x2f'),_0x2bc798));var _0x9a95df=_0x4ed123[_0x6d04('0x30')];var _0x228b65=[_0x6d04('0x31'),_0x6d04('0x32'),_0x6d04('0x33'),_0x6d04('0x34'),'paused'];if(_0x2bc798==='voice'&&_0x252eee[_0x6d04('0x17')][_0x6d04('0x20')]===_0x6d04('0x26')){_0x228b65[_0x6d04('0x35')]('pTalking',_0x6d04('0x36'),_0x6d04('0x37'),_0x6d04('0x38'),_0x6d04('0x39'),'Trunk',_0x6d04('0x3a'),_0x6d04('0x3b'),_0x6d04('0x3c'),_0x6d04('0x3d'),_0x6d04('0x3e'),_0x6d04('0x3f'),_0x6d04('0x40'),_0x6d04('0x41'),_0x6d04('0x42'),_0x6d04('0x43'),_0x6d04('0x44'),_0x6d04('0x45'),_0x6d04('0x46'),_0x6d04('0x47'),_0x6d04('0x48'),'predictiveIntervalAvgTalktime');}var _0x4dc327=_0x40b9e6['rows'][_0x6d04('0x1e')](function(_0x2f7498){var _0x4c1908=_0x2f7498[_0x6d04('0x49')]({'plain':!![]});_0x4c1908[_0x6d04('0x4a')]=0x0;_0x4c1908[_0x6d04('0x4b')]=0x0;_0x4c1908[_0x6d04('0x31')]=0x0;_0x4c1908[_0x6d04('0x32')]=0x0;_0x4c1908[_0x6d04('0x4a')]=0x0;_0x4c1908[_0x6d04('0x33')]=0x0;if(_0x2bc798===_0x6d04('0x15')){_0x4c1908['talking']=0x0;if(_0x252eee[_0x6d04('0x17')][_0x6d04('0x20')]===_0x6d04('0x26')){_0x4c1908[_0x6d04('0x4c')]=0x0;_0x4c1908[_0x6d04('0x36')]=0x0;}}_0x4c1908['agents']=[];var _0x259313=_['find'](_0x9a95df['rows'],['id',_0x4c1908['id']]);if(_0x259313)_['merge'](_0x4c1908,_['pick'](_0x259313,_0x228b65));if(_0x2bc798==='voice'){return _0x2f7498[_0x6d04('0x4d')]({'attributes':['id','name',_0x6d04('0x4e')],'joinTableAttributes':[],'raw':!![]})[_0x6d04('0x2c')](function(_0x114025){return _0x2f7498[_0x6d04('0x4f')]({'raw':!![]})['then'](function(_0x282e7a){for(var _0x15bf70=0x0;_0x15bf70<_0x114025['length'];_0x15bf70++){var _0x22305f=_[_0x6d04('0x50')](_0x282e7a,[_0x6d04('0x51'),_0x114025[_0x15bf70]['id']]);var _0x44a27d={'id':_0x114025[_0x15bf70]['id'],'name':_0x114025[_0x15bf70][_0x6d04('0xc')],'online':Boolean(_0x114025[_0x15bf70][_0x6d04('0x4e')]),'paused':_0x22305f?Boolean(_0x22305f[_0x6d04('0x4a')]):![]};if(_0x44a27d['online'])_0x4c1908[_0x6d04('0x4b')]++;if(_0x44a27d['paused'])_0x4c1908['paused']++;_0x4c1908[_0x6d04('0x52')]['push'](_0x44a27d);}return _0x4c1908;});});}else{var _0x430722=_0x6d04('0x53')+_['startCase'](_0x2bc798)+_0x6d04('0x1d');var _0x416d46=_0x2bc798+_0x6d04('0x54');return db[_0x430722]['findAll']({'where':{[_['startCase'](_0x2bc798)+_0x6d04('0x55')]:_0x2f7498['id']},'raw':!![]})[_0x6d04('0x2c')](function(_0x31550c){return db[_0x6d04('0x53')][_0x6d04('0x56')]({'attributes':['id','name',_0x6d04('0x4e'),_0x416d46],'where':{'id':_[_0x6d04('0x1e')](_0x31550c,_0x6d04('0x51')),'role':_0x6d04('0x57')},'raw':!![]});})[_0x6d04('0x2c')](function(_0x3d3c66){for(var _0x491de4=0x0;_0x491de4<_0x3d3c66[_0x6d04('0x58')];_0x491de4++){var _0x291514={'id':_0x3d3c66[_0x491de4]['id'],'name':_0x3d3c66[_0x491de4][_0x6d04('0xc')],'online':Boolean(_0x3d3c66[_0x491de4]['online']),'paused':Boolean(_0x3d3c66[_0x491de4][_0x416d46])};if(_0x291514['online'])_0x4c1908[_0x6d04('0x4b')]++;if(_0x291514[_0x6d04('0x4a')])_0x4c1908['paused']++;_0x4c1908['agents']['push'](_0x291514);}return _0x4c1908;});}});return Promise['all'](_0x4dc327);});})['then'](function(_0x4b0349){_0x14190b[_0x6d04('0x59')]=_0x4b0349;return _0x14190b;})[_0x6d04('0x2c')](respondWithFilteredResult(_0x43f451,_0x41dc21))[_0x6d04('0x5a')](handleError(_0x43f451,null));};
\ No newline at end of file
+var _0x0a6b=['channel','includes','query','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','fieldName','key','getOptions','user','userProfileId','type','Queues','filter','UserProfile','getResources','findAndCountAll','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','outbound','push','pTalking','originated','message','dialMethod','Trunk','startProgressive','erlangCalls','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','paused','loggedInDb','find','rows','merge','pick','getAgents','online','getMembers','UserId','agents','User','findAll','agent','length','catch','util','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','set','Content-Range','json','error','stack','name','send','chat','sms','openchannel','voice','resolve','then'];(function(_0x11a38f,_0x60bfc0){var _0x39de06=function(_0x519dff){while(--_0x519dff){_0x11a38f['push'](_0x11a38f['shift']());}};_0x39de06(++_0x60bfc0);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x56fb3c,_0x3474f2){_0x56fb3c=_0x56fb3c-0x0;var _0x2261f8=_0x0a6b[_0x56fb3c];return _0x2261f8;};'use strict';var util=require(_0xb0a6('0x0'));var _=require('lodash');var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0xb0a6('0x1'))('api');var db=require(_0xb0a6('0x2'))['db'];var client=jayson[_0xb0a6('0x3')][_0xb0a6('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0xb0a6('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x4cc3ae,_0xbbdf89){return function(_0x415e9e){if(_0x415e9e){var _0x5e2d2d=typeof _0xbbdf89[_0xb0a6('0x5')]===_0xb0a6('0x6')&&typeof _0xbbdf89[_0xb0a6('0x7')]==='undefined';var _0x47c553=_0x415e9e['count'];var _0x2ded05=_0x5e2d2d?0x0:_0xbbdf89[_0xb0a6('0x5')];var _0x34b835=_0x5e2d2d?_0x415e9e[_0xb0a6('0x8')]:_0xbbdf89['offset']+_0xbbdf89[_0xb0a6('0x7')];var _0x19b144;if(_0x34b835>=_0x47c553){_0x34b835=_0x47c553;_0x19b144=0xc8;}else{_0x19b144=0xce;}_0x4cc3ae['status'](_0x19b144);return _0x4cc3ae[_0xb0a6('0x9')](_0xb0a6('0xa'),_0x2ded05+'-'+_0x34b835+'/'+_0x47c553)[_0xb0a6('0xb')](_0x415e9e);}return null;};}function handleError(_0x2a5bb3,_0x471d0f){_0x471d0f=_0x471d0f||0x1f4;return function(_0x3e06df){logger[_0xb0a6('0xc')](_0x3e06df[_0xb0a6('0xd')]);if(_0x3e06df[_0xb0a6('0xe')]){delete _0x3e06df[_0xb0a6('0xe')];}_0x2a5bb3['status'](_0x471d0f)[_0xb0a6('0xf')](_0x3e06df);};}exports['getQueues']=function(_0x397c36,_0x5351ed){var _0x25582f=['mail',_0xb0a6('0x10'),_0xb0a6('0x11'),_0xb0a6('0x12'),'fax','whatsapp',_0xb0a6('0x13')];var _0x295b53={'count':0x0,'rows':[]},_0x59bc9c={},_0x18f994;Promise[_0xb0a6('0x14')]()[_0xb0a6('0x15')](function(){if(_0x397c36['query'][_0xb0a6('0x16')]){if(!_[_0xb0a6('0x17')](_0x25582f,_0x397c36[_0xb0a6('0x18')][_0xb0a6('0x16')][_0xb0a6('0x19')]()))throw new Error(_0xb0a6('0x1a'));_0x18f994=_0x397c36['query'][_0xb0a6('0x16')][_0xb0a6('0x19')]();}var _0x2d0fca=_[_0xb0a6('0x1b')](_0x18f994)+_0xb0a6('0x1c');var _0x10e56b=_[_0xb0a6('0x1d')](db[_0x2d0fca][_0xb0a6('0x1e')],function(_0x4b9a6c){return{'name':_0x4b9a6c[_0xb0a6('0x1f')],'type':_0x4b9a6c['type'][_0xb0a6('0x20')]};});_0x59bc9c=qs[_0xb0a6('0x21')](_0x10e56b,_0x397c36);if(_0x397c36['user']['role']===_0xb0a6('0x22')){var _0x14993f={'params':{'id':_0x397c36['user'][_0xb0a6('0x23')]},'query':{'section':_0x18f994===_0xb0a6('0x13')&&_0x397c36[_0xb0a6('0x18')][_0xb0a6('0x24')]==='outbound'?'QueueCampaigns':_[_0xb0a6('0x1b')](_0x18f994)+_0xb0a6('0x25'),'type':_0x397c36[_0xb0a6('0x18')]['type'],'nolimit':!![],'sort':_0xb0a6('0xe'),'filter':_0x397c36[_0xb0a6('0x18')][_0xb0a6('0x26')]}};return db[_0xb0a6('0x27')][_0xb0a6('0x28')](_0x14993f);}return db[_0x2d0fca][_0xb0a6('0x29')](_0x59bc9c);})[_0xb0a6('0x15')](function(_0x305661){_0x295b53[_0xb0a6('0x8')]=_0x305661['count'];var _0x12d683=_0x18f994===_0xb0a6('0x13')?client:routingClient;return _0x12d683[_0xb0a6('0x2a')](_['startCase'](_0x18f994)+_0xb0a6('0x25'),_0x397c36)['then'](function(_0x131e46){if(_0x131e46[_0xb0a6('0xc')])throw new Error(util[_0xb0a6('0x2b')](_0xb0a6('0x2c'),_0x18f994));var _0x816aa5=_0x131e46[_0xb0a6('0x2d')];var _0x3ead24=[_0xb0a6('0x2e'),_0xb0a6('0x2f'),_0xb0a6('0x30'),'talking','paused'];if(_0x18f994===_0xb0a6('0x13')&&_0x397c36[_0xb0a6('0x18')][_0xb0a6('0x24')]===_0xb0a6('0x31')){_0x3ead24[_0xb0a6('0x32')](_0xb0a6('0x33'),_0xb0a6('0x34'),_0xb0a6('0x35'),'dialActive',_0xb0a6('0x36'),_0xb0a6('0x37'),'startPredictive',_0xb0a6('0x38'),_0xb0a6('0x39'),'erlangCallToSecond','erlangAbandonmentRate',_0xb0a6('0x3a'),_0xb0a6('0x3b'),_0xb0a6('0x3c'),_0xb0a6('0x3d'),_0xb0a6('0x3e'),_0xb0a6('0x3f'),'predictiveIntervalAnsweredCalls',_0xb0a6('0x40'),'predictiveIntervalDroppedCallsCallersExit',_0xb0a6('0x41'),_0xb0a6('0x42'));}var _0x52e20d=_0x305661['rows']['map'](function(_0x3c4f52){var _0xd484f=_0x3c4f52[_0xb0a6('0x43')]({'plain':!![]});_0xd484f[_0xb0a6('0x44')]=0x0;_0xd484f[_0xb0a6('0x45')]=0x0;_0xd484f['loggedIn']=0x0;_0xd484f[_0xb0a6('0x2f')]=0x0;_0xd484f[_0xb0a6('0x44')]=0x0;_0xd484f[_0xb0a6('0x30')]=0x0;if(_0x18f994===_0xb0a6('0x13')){_0xd484f['talking']=0x0;if(_0x397c36[_0xb0a6('0x18')][_0xb0a6('0x24')]===_0xb0a6('0x31')){_0xd484f[_0xb0a6('0x33')]=0x0;_0xd484f[_0xb0a6('0x34')]=0x0;}}_0xd484f['agents']=[];var _0x53cdfa=_[_0xb0a6('0x46')](_0x816aa5[_0xb0a6('0x47')],['id',_0xd484f['id']]);if(_0x53cdfa)_[_0xb0a6('0x48')](_0xd484f,_[_0xb0a6('0x49')](_0x53cdfa,_0x3ead24));if(_0x18f994===_0xb0a6('0x13')){return _0x3c4f52[_0xb0a6('0x4a')]({'attributes':['id',_0xb0a6('0xe'),_0xb0a6('0x4b')],'joinTableAttributes':[],'raw':!![]})['then'](function(_0x1fe910){return _0x3c4f52[_0xb0a6('0x4c')]({'raw':!![]})[_0xb0a6('0x15')](function(_0x3014df){for(var _0x27f208=0x0;_0x27f208<_0x1fe910['length'];_0x27f208++){var _0x156a4b=_['find'](_0x3014df,[_0xb0a6('0x4d'),_0x1fe910[_0x27f208]['id']]);var _0x53a6d5={'id':_0x1fe910[_0x27f208]['id'],'name':_0x1fe910[_0x27f208][_0xb0a6('0xe')],'online':Boolean(_0x1fe910[_0x27f208]['online']),'paused':_0x156a4b?Boolean(_0x156a4b[_0xb0a6('0x44')]):![]};if(_0x53a6d5[_0xb0a6('0x4b')])_0xd484f[_0xb0a6('0x45')]++;if(_0x53a6d5[_0xb0a6('0x44')])_0xd484f[_0xb0a6('0x44')]++;_0xd484f[_0xb0a6('0x4e')][_0xb0a6('0x32')](_0x53a6d5);}return _0xd484f;});});}else{var _0x2937ef=_0xb0a6('0x4f')+_[_0xb0a6('0x1b')](_0x18f994)+_0xb0a6('0x1c');var _0x449c25=_0x18f994+'Pause';return db[_0x2937ef][_0xb0a6('0x50')]({'where':{[_[_0xb0a6('0x1b')](_0x18f994)+'QueueId']:_0x3c4f52['id']},'raw':!![]})[_0xb0a6('0x15')](function(_0x523794){return db[_0xb0a6('0x4f')][_0xb0a6('0x50')]({'attributes':['id',_0xb0a6('0xe'),'online',_0x449c25],'where':{'id':_[_0xb0a6('0x1d')](_0x523794,_0xb0a6('0x4d')),'role':_0xb0a6('0x51')},'raw':!![]});})[_0xb0a6('0x15')](function(_0x308532){for(var _0x2cb5f6=0x0;_0x2cb5f6<_0x308532[_0xb0a6('0x52')];_0x2cb5f6++){var _0x410886={'id':_0x308532[_0x2cb5f6]['id'],'name':_0x308532[_0x2cb5f6]['name'],'online':Boolean(_0x308532[_0x2cb5f6][_0xb0a6('0x4b')]),'paused':Boolean(_0x308532[_0x2cb5f6][_0x449c25])};if(_0x410886[_0xb0a6('0x4b')])_0xd484f[_0xb0a6('0x45')]++;if(_0x410886[_0xb0a6('0x44')])_0xd484f['paused']++;_0xd484f['agents']['push'](_0x410886);}return _0xd484f;});}});return Promise['all'](_0x52e20d);});})['then'](function(_0x5dd778){_0x295b53['rows']=_0x5dd778;return _0x295b53;})[_0xb0a6('0x15')](respondWithFilteredResult(_0x5351ed,_0x59bc9c))[_0xb0a6('0x53')](handleError(_0x5351ed,null));};
\ No newline at end of file
index e97e7af..d1f1cab 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(_0x1e8982,_0x37bfc7){var _0x115066=function(_0x202cb1){while(--_0x202cb1){_0x1e8982['push'](_0x1e8982['shift']());}};_0x115066(++_0x37bfc7);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x29e172,_0x982c1f){var _0x48d71f=function(_0xa78dda){while(--_0xa78dda){_0x29e172['push'](_0x29e172['shift']());}};_0x48d71f(++_0x982c1f);}(_0x70e0,0x17b));var _0x070e=function(_0x5b381c,_0x3bb43c){_0x5b381c=_0x5b381c-0x0;var _0x226b0b=_0x70e0[_0x5b381c];return _0x226b0b;};'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 ef629e1..f13ecee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9ab=['INTEGER','DATE','STRING','sequelize','exports'];(function(_0x29d693,_0x2daadb){var _0x1210c6=function(_0x3ba2e1){while(--_0x3ba2e1){_0x29d693['push'](_0x29d693['shift']());}};_0x1210c6(++_0x2daadb);}(_0xc9ab,0x125));var _0xbc9a=function(_0x501feb,_0x5b46a2){_0x501feb=_0x501feb-0x0;var _0x279970=_0xc9ab[_0x501feb];return _0x279970;};'use strict';var Sequelize=require(_0xbc9a('0x0'));module[_0xbc9a('0x1')]={'state':{'type':Sequelize[_0xbc9a('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xbc9a('0x3')]},'responsetime':{'type':Sequelize[_0xbc9a('0x3')]},'ringtime':{'type':Sequelize[_0xbc9a('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xbc9a('0x4')]},'campaigntype':{'type':Sequelize[_0xbc9a('0x4')]},'membername':{'type':Sequelize[_0xbc9a('0x4')]}};
\ No newline at end of file
+var _0x4d49=['INTEGER','exports','STRING','DATE'];(function(_0x2363fc,_0x345072){var _0x5c7666=function(_0x608e0a){while(--_0x608e0a){_0x2363fc['push'](_0x2363fc['shift']());}};_0x5c7666(++_0x345072);}(_0x4d49,0x141));var _0x94d4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4d49[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x94d4('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x94d4('0x1')]},'scheduledat':{'type':Sequelize[_0x94d4('0x2')]},'uniqueid':{'type':Sequelize[_0x94d4('0x1')]},'starttime':{'type':Sequelize[_0x94d4('0x2')]},'responsetime':{'type':Sequelize[_0x94d4('0x2')]},'ringtime':{'type':Sequelize[_0x94d4('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x94d4('0x1')]},'campaigntype':{'type':Sequelize[_0x94d4('0x1')]},'membername':{'type':Sequelize[_0x94d4('0x1')]}};
\ No newline at end of file
index fe9d3d9..1383c71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aad=['report_agent_preview','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x0aad,0x119));var _0xd0aa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0aad[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd0aa('0x0'));var util=require(_0xd0aa('0x1'));var logger=require('../../config/logger')(_0xd0aa('0x2'));var moment=require(_0xd0aa('0x3'));var BPromise=require(_0xd0aa('0x4'));var rp=require(_0xd0aa('0x5'));var fs=require('fs');var path=require(_0xd0aa('0x6'));var rimraf=require(_0xd0aa('0x7'));var config=require(_0xd0aa('0x8'));var attributes=require(_0xd0aa('0x9'));module[_0xd0aa('0xa')]=function(_0x31b90e,_0x3cd394){return _0x31b90e[_0xd0aa('0xb')](_0xd0aa('0xc'),attributes,{'tableName':_0xd0aa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x911f=['path','./reportAgentPreview.attributes','ReportAgentPreview','report_agent_preview','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3fefa3,_0x57bde3){var _0x36e712=function(_0x4aed1d){while(--_0x4aed1d){_0x3fefa3['push'](_0x3fefa3['shift']());}};_0x36e712(++_0x57bde3);}(_0x911f,0x199));var _0xf911=function(_0x2aeb11,_0x32c819){_0x2aeb11=_0x2aeb11-0x0;var _0xaeeddc=_0x911f[_0x2aeb11];return _0xaeeddc;};'use strict';var _=require('lodash');var util=require(_0xf911('0x0'));var logger=require(_0xf911('0x1'))(_0xf911('0x2'));var moment=require('moment');var BPromise=require(_0xf911('0x3'));var rp=require(_0xf911('0x4'));var fs=require('fs');var path=require(_0xf911('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf911('0x6'));module['exports']=function(_0x281e16,_0xf5f488){return _0x281e16['define'](_0xf911('0x7'),attributes,{'tableName':_0xf911('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 312e0a4..fdf719e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf50=['client','http','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','create','body','options','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x9550d,_0x5edd63){var _0x488503=function(_0x539966){while(--_0x539966){_0x9550d['push'](_0x9550d['shift']());}};_0x488503(++_0x5edd63);}(_0xbf50,0xe2));var _0x0bf5=function(_0x10cc81,_0x172700){_0x10cc81=_0x10cc81-0x0;var _0x3bbe1e=_0xbf50[_0x10cc81];return _0x3bbe1e;};'use strict';var _=require(_0x0bf5('0x0'));var util=require('util');var moment=require(_0x0bf5('0x1'));var BPromise=require(_0x0bf5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bf5('0x3'));var db=require(_0x0bf5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bf5('0x5'))(_0x0bf5('0x6'));var config=require('../../config/environment');var jayson=require(_0x0bf5('0x7'));var client=jayson[_0x0bf5('0x8')][_0x0bf5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e1d3f,_0x108ca9,_0x3b3c3c){return new BPromise(function(_0x2a76e7,_0x4db747){return client['request'](_0x1e1d3f,_0x3b3c3c)[_0x0bf5('0xa')](function(_0x15f9fd){logger[_0x0bf5('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x108ca9,_0x0bf5('0xc'));logger[_0x0bf5('0xd')](_0x0bf5('0xe'),_0x108ca9,_0x0bf5('0xc'),JSON[_0x0bf5('0xf')](_0x15f9fd));if(_0x15f9fd[_0x0bf5('0x10')]){if(_0x15f9fd[_0x0bf5('0x10')][_0x0bf5('0x11')]===0x1f4){logger[_0x0bf5('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x108ca9,_0x15f9fd[_0x0bf5('0x10')]['message']);return _0x4db747(_0x15f9fd[_0x0bf5('0x10')][_0x0bf5('0x12')]);}logger['error'](_0x0bf5('0x13'),_0x108ca9,_0x15f9fd[_0x0bf5('0x10')]['message']);return _0x2a76e7(_0x15f9fd[_0x0bf5('0x10')][_0x0bf5('0x12')]);}else{logger[_0x0bf5('0xb')](_0x0bf5('0x13'),_0x108ca9,_0x0bf5('0xc'));_0x2a76e7(_0x15f9fd[_0x0bf5('0x14')][_0x0bf5('0x12')]);}})[_0x0bf5('0x15')](function(_0x2c8426){logger[_0x0bf5('0x10')](_0x0bf5('0x13'),_0x108ca9,_0x2c8426);_0x4db747(_0x2c8426);});});}exports[_0x0bf5('0x16')]=function(_0x2007c9){var _0x20c88b=this;return new Promise(function(_0xba0923,_0x3d8d1d){return db['ReportAgentPreview'][_0x0bf5('0x17')](_0x2007c9[_0x0bf5('0x18')],{'raw':_0x2007c9['options']?_0x2007c9[_0x0bf5('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x595a78){logger['info'](_0x0bf5('0x16'),_0x2007c9);logger[_0x0bf5('0xd')](_0x0bf5('0x16'),_0x2007c9,JSON[_0x0bf5('0xf')](_0x595a78));_0xba0923(_0x595a78);})[_0x0bf5('0x15')](function(_0x496f28){logger[_0x0bf5('0x10')]('CreateReportAgentPreview',_0x496f28[_0x0bf5('0x12')],_0x2007c9);_0x3d8d1d(_0x20c88b['error'](0x1f4,_0x496f28[_0x0bf5('0x12')]));});});};
\ No newline at end of file
+var _0x530d=['info','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','ReportAgentPreview,\x20%s,\x20%s','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x694103,_0x4801){var _0x1866c5=function(_0x2298ad){while(--_0x2298ad){_0x694103['push'](_0x694103['shift']());}};_0x1866c5(++_0x4801);}(_0x530d,0xb5));var _0xd530=function(_0x2c66dd,_0x5d5f47){_0x2c66dd=_0x2c66dd-0x0;var _0x303da7=_0x530d[_0x2c66dd];return _0x303da7;};'use strict';var _=require(_0xd530('0x0'));var util=require(_0xd530('0x1'));var moment=require('moment');var BPromise=require(_0xd530('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd530('0x3'))['db'];var utils=require(_0xd530('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd530('0x5'));var jayson=require(_0xd530('0x6'));var client=jayson[_0xd530('0x7')][_0xd530('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f161a,_0x381483,_0x17777f){return new BPromise(function(_0x5d17db,_0x1c4a1c){return client[_0xd530('0x9')](_0x5f161a,_0x17777f)[_0xd530('0xa')](function(_0x4e15b0){logger[_0xd530('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x381483,'request\x20sent');logger['debug'](_0xd530('0xc'),_0x381483,'request\x20sent',JSON['stringify'](_0x4e15b0));if(_0x4e15b0['error']){if(_0x4e15b0[_0xd530('0xd')][_0xd530('0xe')]===0x1f4){logger['error'](_0xd530('0xf'),_0x381483,_0x4e15b0['error']['message']);return _0x1c4a1c(_0x4e15b0[_0xd530('0xd')][_0xd530('0x10')]);}logger[_0xd530('0xd')](_0xd530('0xf'),_0x381483,_0x4e15b0[_0xd530('0xd')]['message']);return _0x5d17db(_0x4e15b0[_0xd530('0xd')]['message']);}else{logger[_0xd530('0xb')](_0xd530('0xf'),_0x381483,'request\x20sent');_0x5d17db(_0x4e15b0['result'][_0xd530('0x10')]);}})[_0xd530('0x11')](function(_0x34cc7a){logger[_0xd530('0xd')](_0xd530('0xf'),_0x381483,_0x34cc7a);_0x1c4a1c(_0x34cc7a);});});}exports[_0xd530('0x12')]=function(_0x42ab45){var _0x1e8186=this;return new Promise(function(_0x148a52,_0x3dea9b){return db[_0xd530('0x13')][_0xd530('0x14')](_0x42ab45[_0xd530('0x15')],{'raw':_0x42ab45[_0xd530('0x16')]?_0x42ab45['options'][_0xd530('0x17')]===undefined?!![]:![]:!![]})[_0xd530('0xa')](function(_0x432bc4){logger[_0xd530('0xb')](_0xd530('0x12'),_0x42ab45);logger['debug']('CreateReportAgentPreview',_0x42ab45,JSON['stringify'](_0x432bc4));_0x148a52(_0x432bc4);})[_0xd530('0x11')](function(_0x1d5395){logger['error'](_0xd530('0x12'),_0x1d5395[_0xd530('0x10')],_0x42ab45);_0x3dea9b(_0x1e8186[_0xd530('0xd')](0x1f4,_0x1d5395[_0xd530('0x10')]));});});};
\ No newline at end of file
index a8a8085..0b4a27c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe89d=['agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','outbound','/outbound/channels','/agents'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe89d,0x18a));var _0xde89=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xe89d[_0x3511d3];return _0x5d6321;};'use strict';var multer=require(_0xde89('0x0'));var util=require(_0xde89('0x1'));var path=require(_0xde89('0x2'));var express=require(_0xde89('0x3'));var router=express[_0xde89('0x4')]();var auth=require(_0xde89('0x5'));var controller=require(_0xde89('0x6'));router[_0xde89('0x7')]('/voice/channels',auth['isAuthenticated'](),controller[_0xde89('0x8')]);router[_0xde89('0x7')](_0xde89('0x9'),auth[_0xde89('0xa')](),controller[_0xde89('0xb')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xde89('0xa')](),controller[_0xde89('0xc')]);router[_0xde89('0x7')](_0xde89('0xd'),auth[_0xde89('0xa')](),controller[_0xde89('0xe')]);router[_0xde89('0x7')](_0xde89('0xf'),auth[_0xde89('0xa')](),controller[_0xde89('0x10')]);router[_0xde89('0x7')](_0xde89('0x11'),auth[_0xde89('0xa')](),controller[_0xde89('0x12')]);router[_0xde89('0x7')](_0xde89('0x13'),auth[_0xde89('0xa')](),controller[_0xde89('0x14')]);router[_0xde89('0x7')](_0xde89('0x15'),auth[_0xde89('0xa')](),controller[_0xde89('0x16')]);router[_0xde89('0x7')]('/sms/queues',auth[_0xde89('0xa')](),controller['smsQueues']);router[_0xde89('0x7')](_0xde89('0x17'),auth[_0xde89('0xa')](),controller[_0xde89('0x18')]);router[_0xde89('0x7')](_0xde89('0x19'),auth[_0xde89('0xa')](),controller['faxQueues']);router[_0xde89('0x7')](_0xde89('0x1a'),auth['isAuthenticated'](),controller[_0xde89('0x1b')]);router['get'](_0xde89('0x1c'),auth['isAuthenticated'](),controller[_0xde89('0x1d')]);router['get'](_0xde89('0x1e'),auth[_0xde89('0xa')](),controller[_0xde89('0x1f')]);router['get'](_0xde89('0x20'),auth[_0xde89('0xa')](),controller['voiceQueuesChannelHangup']);router[_0xde89('0x7')](_0xde89('0x21'),auth[_0xde89('0xa')](),controller[_0xde89('0x22')]);router[_0xde89('0x7')](_0xde89('0x23'),auth[_0xde89('0xa')](),controller[_0xde89('0x24')]);router[_0xde89('0x25')](_0xde89('0x23'),auth[_0xde89('0xa')](),controller['updateVoiceQueue']);router['get']('/outbound',auth[_0xde89('0xa')](),controller[_0xde89('0x26')]);router[_0xde89('0x7')](_0xde89('0x27'),auth[_0xde89('0xa')](),controller['outboundChannels']);router['get'](_0xde89('0x28'),auth['isAuthenticated'](),controller[_0xde89('0x29')]);router[_0xde89('0x25')](_0xde89('0x2a'),auth['isAuthenticated'](),controller[_0xde89('0x2b')]);router[_0xde89('0x7')](_0xde89('0x2c'),auth[_0xde89('0xa')](),controller[_0xde89('0x2d')]);router[_0xde89('0x7')](_0xde89('0x2e'),auth[_0xde89('0xa')](),controller[_0xde89('0x2f')]);router[_0xde89('0x7')](_0xde89('0x30'),auth[_0xde89('0xa')](),controller['campaigns']);router[_0xde89('0x7')]('/fax/accounts',auth['isAuthenticated'](),controller[_0xde89('0x31')]);router[_0xde89('0x7')](_0xde89('0x32'),auth[_0xde89('0xa')](),controller[_0xde89('0x33')]);router[_0xde89('0x7')](_0xde89('0x34'),auth[_0xde89('0xa')](),controller['mailQueuesWaitingInteractions']);router[_0xde89('0x7')](_0xde89('0x35'),auth[_0xde89('0xa')](),controller[_0xde89('0x36')]);router['get'](_0xde89('0x37'),auth[_0xde89('0xa')](),controller[_0xde89('0x38')]);router[_0xde89('0x7')](_0xde89('0x39'),auth['isAuthenticated'](),controller[_0xde89('0x3a')]);router[_0xde89('0x7')]('/whatsapp/queues/waitinginteractions',auth[_0xde89('0xa')](),controller[_0xde89('0x3b')]);router[_0xde89('0x7')](_0xde89('0x3c'),auth[_0xde89('0xa')](),controller['faxQueuesWaitingInteractions']);router[_0xde89('0x3d')](_0xde89('0x3e'),auth[_0xde89('0xa')](),controller[_0xde89('0x3f')](_0xde89('0x40')));router[_0xde89('0x7')](_0xde89('0x41'),auth[_0xde89('0xa')](),controller[_0xde89('0x42')]);router[_0xde89('0x3d')](_0xde89('0x43'),auth[_0xde89('0xa')](),controller[_0xde89('0x3f')]('chat'));router[_0xde89('0x7')](_0xde89('0x44'),auth[_0xde89('0xa')](),controller[_0xde89('0x45')]);router[_0xde89('0x3d')](_0xde89('0x46'),auth[_0xde89('0xa')](),controller['queueNotify'](_0xde89('0x47')));router[_0xde89('0x7')](_0xde89('0x48'),auth[_0xde89('0xa')](),controller[_0xde89('0x49')]);router[_0xde89('0x3d')](_0xde89('0x4a'),auth[_0xde89('0xa')](),controller[_0xde89('0x3f')](_0xde89('0x4b')));router[_0xde89('0x7')](_0xde89('0x4c'),auth[_0xde89('0xa')](),controller[_0xde89('0x4d')]);router['post'](_0xde89('0x4e'),auth[_0xde89('0xa')](),controller[_0xde89('0x3f')](_0xde89('0x4f')));router[_0xde89('0x3d')](_0xde89('0x50'),auth[_0xde89('0xa')](),controller[_0xde89('0x3f')](_0xde89('0x51')));router[_0xde89('0x7')](_0xde89('0x52'),auth['isAuthenticated'](),controller['showSmsQueues']);router['get'](_0xde89('0x53'),auth[_0xde89('0xa')](),controller[_0xde89('0x54')]);router[_0xde89('0x3d')](_0xde89('0x55'),auth[_0xde89('0xa')](),controller['agentNotify']);module[_0xde89('0x56')]=router;
\ No newline at end of file
+var _0x116c=['/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues'];(function(_0x4855a7,_0x133b87){var _0x2d3855=function(_0x89fbcb){while(--_0x89fbcb){_0x4855a7['push'](_0x4855a7['shift']());}};_0x2d3855(++_0x133b87);}(_0x116c,0xca));var _0xc116=function(_0x52ec96,_0x4bafd2){_0x52ec96=_0x52ec96-0x0;var _0x21657a=_0x116c[_0x52ec96];return _0x21657a;};'use strict';var multer=require(_0xc116('0x0'));var util=require(_0xc116('0x1'));var path=require(_0xc116('0x2'));var express=require(_0xc116('0x3'));var router=express[_0xc116('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0xc116('0x5'));router[_0xc116('0x6')]('/voice/channels',auth[_0xc116('0x7')](),controller[_0xc116('0x8')]);router[_0xc116('0x6')](_0xc116('0x9'),auth['isAuthenticated'](),controller[_0xc116('0xa')]);router[_0xc116('0x6')](_0xc116('0xb'),auth[_0xc116('0x7')](),controller[_0xc116('0xc')]);router[_0xc116('0x6')](_0xc116('0xd'),auth[_0xc116('0x7')](),controller[_0xc116('0xe')]);router['get'](_0xc116('0xf'),auth[_0xc116('0x7')](),controller[_0xc116('0x10')]);router[_0xc116('0x6')]('/mail/queues',auth[_0xc116('0x7')](),controller[_0xc116('0x11')]);router[_0xc116('0x6')](_0xc116('0x12'),auth[_0xc116('0x7')](),controller[_0xc116('0x13')]);router['get'](_0xc116('0x14'),auth[_0xc116('0x7')](),controller[_0xc116('0x15')]);router[_0xc116('0x6')]('/sms/queues',auth[_0xc116('0x7')](),controller[_0xc116('0x16')]);router[_0xc116('0x6')](_0xc116('0x17'),auth['isAuthenticated'](),controller[_0xc116('0x18')]);router['get']('/fax/queues',auth['isAuthenticated'](),controller[_0xc116('0x19')]);router['get'](_0xc116('0x1a'),auth[_0xc116('0x7')](),controller[_0xc116('0x1b')]);router['get'](_0xc116('0x1c'),auth[_0xc116('0x7')](),controller['voiceQueuesChannels']);router[_0xc116('0x6')]('/voice/queues/channels/:uniqueid',auth[_0xc116('0x7')](),controller[_0xc116('0x1d')]);router[_0xc116('0x6')](_0xc116('0x1e'),auth[_0xc116('0x7')](),controller[_0xc116('0x1f')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xc116('0x7')](),controller[_0xc116('0x20')]);router[_0xc116('0x6')](_0xc116('0x21'),auth['isAuthenticated'](),controller[_0xc116('0x22')]);router[_0xc116('0x23')](_0xc116('0x21'),auth[_0xc116('0x7')](),controller[_0xc116('0x24')]);router[_0xc116('0x6')](_0xc116('0x25'),auth[_0xc116('0x7')](),controller[_0xc116('0x26')]);router[_0xc116('0x6')](_0xc116('0x27'),auth[_0xc116('0x7')](),controller[_0xc116('0x28')]);router[_0xc116('0x6')](_0xc116('0x29'),auth[_0xc116('0x7')](),controller[_0xc116('0x2a')]);router['put'](_0xc116('0x2b'),auth[_0xc116('0x7')](),controller[_0xc116('0x2c')]);router[_0xc116('0x6')](_0xc116('0x2d'),auth[_0xc116('0x7')](),controller[_0xc116('0x2e')]);router[_0xc116('0x6')](_0xc116('0x2f'),auth[_0xc116('0x7')](),controller[_0xc116('0x30')]);router[_0xc116('0x6')]('/campaigns',auth[_0xc116('0x7')](),controller[_0xc116('0x31')]);router[_0xc116('0x6')](_0xc116('0x32'),auth[_0xc116('0x7')](),controller[_0xc116('0x33')]);router[_0xc116('0x6')](_0xc116('0x34'),auth['isAuthenticated'](),controller[_0xc116('0x35')]);router[_0xc116('0x6')](_0xc116('0x36'),auth['isAuthenticated'](),controller[_0xc116('0x37')]);router[_0xc116('0x6')](_0xc116('0x38'),auth[_0xc116('0x7')](),controller[_0xc116('0x39')]);router[_0xc116('0x6')](_0xc116('0x3a'),auth[_0xc116('0x7')](),controller[_0xc116('0x3b')]);router['get'](_0xc116('0x3c'),auth[_0xc116('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0xc116('0x6')](_0xc116('0x3d'),auth['isAuthenticated'](),controller[_0xc116('0x3e')]);router['get']('/fax/queues/waitinginteractions',auth[_0xc116('0x7')](),controller[_0xc116('0x3f')]);router[_0xc116('0x40')](_0xc116('0x41'),auth[_0xc116('0x7')](),controller[_0xc116('0x42')](_0xc116('0x43')));router['get'](_0xc116('0x44'),auth[_0xc116('0x7')](),controller[_0xc116('0x45')]);router[_0xc116('0x40')](_0xc116('0x46'),auth['isAuthenticated'](),controller['queueNotify'](_0xc116('0x47')));router[_0xc116('0x6')](_0xc116('0x48'),auth[_0xc116('0x7')](),controller[_0xc116('0x49')]);router[_0xc116('0x40')](_0xc116('0x4a'),auth[_0xc116('0x7')](),controller[_0xc116('0x42')](_0xc116('0x4b')));router[_0xc116('0x6')](_0xc116('0x4c'),auth['isAuthenticated'](),controller[_0xc116('0x4d')]);router[_0xc116('0x40')](_0xc116('0x4e'),auth[_0xc116('0x7')](),controller[_0xc116('0x42')](_0xc116('0x4f')));router[_0xc116('0x6')](_0xc116('0x50'),auth[_0xc116('0x7')](),controller[_0xc116('0x51')]);router['post'](_0xc116('0x52'),auth[_0xc116('0x7')](),controller['queueNotify'](_0xc116('0x53')));router[_0xc116('0x40')](_0xc116('0x54'),auth[_0xc116('0x7')](),controller['queueNotify'](_0xc116('0x55')));router[_0xc116('0x6')](_0xc116('0x56'),auth[_0xc116('0x7')](),controller[_0xc116('0x57')]);router[_0xc116('0x6')]('/whatsapp/queues/:id',auth[_0xc116('0x7')](),controller[_0xc116('0x58')]);router[_0xc116('0x40')](_0xc116('0x59'),auth['isAuthenticated'](),controller[_0xc116('0x5a')]);module[_0xc116('0x5b')]=router;
\ No newline at end of file
index 4e3fd30..c9dd7b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f47=['voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','telephones','trunks','Trunks','Campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','moment','lodash','../../mysqldb','api','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel'];(function(_0x55513d,_0x10c3a0){var _0x73f171=function(_0x327267){while(--_0x327267){_0x55513d['push'](_0x55513d['shift']());}};_0x73f171(++_0x10c3a0);}(_0x6f47,0xc7));var _0x76f4=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x6f47[_0x710815];return _0x5b3b89;};'use strict';var BPromise=require('bluebird');var moment=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));var util=require('util');var db=require(_0x76f4('0x2'))['db'];var logger=require('../../config/logger')(_0x76f4('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232a});var mailClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x76f4('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){var _0x65d2c7=_0x497f99?_0x497f99:amiClient;return _0x65d2c7[_0x76f4('0x6')](_0xfc2405,_0x2176a7)[_0x76f4('0x7')](function(_0x4c6b5c){if(_0x4c6b5c['error']){if(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0x9')]===0x1f4){return _0x25656d(_0x4c6b5c['error']['message']);}return _0x1a3172(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0xa')]);}else{_0x1a3172(_0x4c6b5c[_0x76f4('0xb')]);}})[_0x76f4('0xc')](function(_0x1aee7f){_0x25656d(_0x1aee7f);});});}function respondWithResult(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xc8;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0xd')](_0xf7e347)['json'](_0x3ec740);}return _0xafd21e[_0x76f4('0xe')](0x194);};}function handleError(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0x1f4;return function(_0x4b6021){logger['error'](_0x4b6021[_0x76f4('0xf')]);if(_0x4b6021[_0x76f4('0x10')]){delete _0x4b6021[_0x76f4('0x10')];}_0x30dabf[_0x76f4('0xd')](_0x5da1ff)[_0x76f4('0x11')](_0x4b6021);};}function findById(_0x2b5e23){return function(_0x46ba51){if(!_[_0x76f4('0x12')](_0x2b5e23)&&!_[_0x76f4('0x12')](_0x46ba51)&&!_[_0x76f4('0x12')](_0x46ba51[_0x76f4('0x13')])){return _[_0x76f4('0x14')](_0x46ba51[_0x76f4('0x13')],function(_0x38450e){return _0x38450e['id']==_0x2b5e23;});}return null;};}exports[_0x76f4('0x15')]=function(_0x397360,_0xfedbe4){return respondWithRpcPromise(_0x76f4('0x16'),_0x397360[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0xfedbe4,null))[_0x76f4('0xc')](handleError(_0xfedbe4,null));};exports[_0x76f4('0x18')]=function(_0x5bf3d5,_0x262937){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x76f4('0x19')](_0x5bf3d5[_0x76f4('0x17')],_0x5bf3d5[_0x76f4('0x1a')]))['then'](respondWithResult(_0x262937,null))['catch'](handleError(_0x262937,null));};exports['voiceChannelStopMixMonitor']=function(_0x465240,_0x681d67){return respondWithRpcPromise(_0x76f4('0x1b'),_[_0x76f4('0x19')](_0x465240[_0x76f4('0x17')],_0x465240[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x681d67,null))['catch'](handleError(_0x681d67,null));};exports['voiceQueues']=function(_0x3794fa,_0x497913){return respondWithRpcPromise(_0x76f4('0x1c'),_0x3794fa['query'])['then'](respondWithResult(_0x497913,null))['catch'](handleError(_0x497913,null));};exports[_0x76f4('0x1d')]=function(_0x38300d,_0xd368a2){return respondWithRpcPromise(_0x76f4('0x1c'),_0x38300d[_0x76f4('0x17')])[_0x76f4('0x7')](findById(_0x38300d['params']['id']))[_0x76f4('0x7')](respondWithResult(_0xd368a2,null))['catch'](handleError(_0xd368a2,null));};exports['updateVoiceQueue']=function(_0x5b3f07,_0x10ddb4){return respondWithRpcPromise(_0x76f4('0x1e'),_[_0x76f4('0x19')](_0x5b3f07[_0x76f4('0x1f')],_0x5b3f07['params']))[_0x76f4('0x7')](respondWithResult(_0x10ddb4,null))['catch'](handleError(_0x10ddb4,null));};exports[_0x76f4('0x20')]=function(_0x3c7513,_0x43ac4a){return respondWithRpcPromise(_0x76f4('0x21'),_[_0x76f4('0x19')](_0x3c7513['query'],_0x3c7513['params']))[_0x76f4('0x7')](respondWithResult(_0x43ac4a,null))[_0x76f4('0xc')](handleError(_0x43ac4a,null));};exports[_0x76f4('0x22')]=function(_0x281db6,_0x1f2adf){return respondWithRpcPromise(_0x76f4('0x23'),_0x281db6[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x1f2adf,null))[_0x76f4('0xc')](handleError(_0x1f2adf,null));};exports[_0x76f4('0x24')]=function(_0x308af2,_0x2527a6){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x308af2['query'],_0x308af2['params']))[_0x76f4('0x7')](respondWithResult(_0x2527a6,null))[_0x76f4('0xc')](handleError(_0x2527a6,null));};exports[_0x76f4('0x25')]=function(_0x456b1f,_0x26fdd6){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x76f4('0x19')](_0x456b1f[_0x76f4('0x17')],_0x456b1f[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x26fdd6,null))[_0x76f4('0xc')](handleError(_0x26fdd6,null));};exports[_0x76f4('0x26')]=function(_0xb806cc,_0x28d9d6){return respondWithRpcPromise(_0x76f4('0x27'),_[_0x76f4('0x19')](_0xb806cc[_0x76f4('0x17')],_0xb806cc[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x28d9d6,null))[_0x76f4('0xc')](handleError(_0x28d9d6,null));};exports[_0x76f4('0x28')]=function(_0x88506b,_0x3308e3){return respondWithRpcPromise(_0x76f4('0x29'),_0x88506b['query'])[_0x76f4('0x7')](respondWithResult(_0x3308e3,null))[_0x76f4('0xc')](handleError(_0x3308e3,null));};exports[_0x76f4('0x2a')]=function(_0x589637,_0x597e83){return respondWithRpcPromise(_0x76f4('0x2b'),_0x589637['query'])[_0x76f4('0x7')](respondWithResult(_0x597e83,null))['catch'](handleError(_0x597e83,null));};exports[_0x76f4('0x2c')]=function(_0x16f36d,_0x312243){var _0x378675;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')])[_0x76f4('0x7')](function(_0x109ad9){_0x378675=_0x109ad9;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')],routingClient);})['then'](function(_0x5b8d2d){return _[_0x76f4('0x19')]({},_0x5b8d2d,_0x378675);})[_0x76f4('0x7')](respondWithResult(_0x312243,null))[_0x76f4('0xc')](handleError(_0x312243,null));};exports[_0x76f4('0x2e')]=function(_0x2b7dc8,_0x2d6068){if(_0x2b7dc8[_0x76f4('0x1f')]&&_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')]&&_0x2b7dc8['user']&&_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')]){for(var _0x4f0d1a in _0x2b7dc8['body'][_0x76f4('0x2f')]){if(_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x76f4('0x31')](_0x4f0d1a)){db[_0x76f4('0x32')]['findAll']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'exitAt':null,'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]&&_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x76f4('0x34')]?{'$notIn':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]}:{'$ne':null}}})['then'](function(_0x571261){var _0x11ea58=moment()[_0x76f4('0x35')](_0x76f4('0x36'));for(var _0x2bea6d=0x0,_0x36fa03=_0x571261['length'];_0x2bea6d<_0x36fa03;_0x2bea6d+=0x1){_0x571261[_0x2bea6d]['updateAttributes']({'exitAt':_0x11ea58});}});for(var _0x8e5b60=0x0;_0x8e5b60<_0x2b7dc8['body'][_0x76f4('0x2f')][_0x4f0d1a][_0x76f4('0x34')];_0x8e5b60+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'uniqueid':_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x8e5b60],'exitAt':null},'defaults':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'interface':_[_0x76f4('0x12')](_0x2b7dc8['user'][_0x76f4('0x37')])?util[_0x76f4('0x35')]('SIP/%s',_0x2b7dc8['user'][_0x76f4('0x10')]):_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x37')],'type':_0x76f4('0x33'),'enterAt':moment()[_0x76f4('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x76f4('0x38'),'internal':_0x2b7dc8['user'][_0x76f4('0x39')],'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a][_0x8e5b60]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b7dc8[_0x76f4('0x1a')]['id'],'capacity':_0x2b7dc8[_0x76f4('0x1f')]['capacity']},routingClient)[_0x76f4('0x7')](respondWithResult(_0x2d6068,null))[_0x76f4('0xc')](handleError(_0x2d6068,null));};exports[_0x76f4('0x3a')]=function(_0x1c658c,_0x40ff20){return respondWithRpcPromise('Telephones',_0x1c658c[_0x76f4('0x17')])['then'](respondWithResult(_0x40ff20,null))[_0x76f4('0xc')](handleError(_0x40ff20,null));};exports[_0x76f4('0x3b')]=function(_0x154ba,_0x5121ec){return respondWithRpcPromise(_0x76f4('0x3c'),_0x154ba[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x5121ec,null))[_0x76f4('0xc')](handleError(_0x5121ec,null));};exports['campaigns']=function(_0x2028e9,_0xf11e07){return respondWithRpcPromise(_0x76f4('0x3d'),_0x2028e9[_0x76f4('0x17')])['then'](respondWithResult(_0xf11e07,null))[_0x76f4('0xc')](handleError(_0xf11e07,null));};exports['chatQueues']=function(_0x129048,_0x190c8d){return respondWithRpcPromise('ChatQueues',_0x129048['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x190c8d,null))[_0x76f4('0xc')](handleError(_0x190c8d,null));};exports[_0x76f4('0x3e')]=function(_0x596b51,_0x27ba06){return respondWithRpcPromise(_0x76f4('0x3f'),_0x596b51[_0x76f4('0x17')],routingClient)['then'](findById(_0x596b51['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x27ba06,null))[_0x76f4('0xc')](handleError(_0x27ba06,null));};exports['mailQueues']=function(_0x490ced,_0x3f1840){return respondWithRpcPromise(_0x76f4('0x40'),_0x490ced[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x3f1840,null))[_0x76f4('0xc')](handleError(_0x3f1840,null));};exports[_0x76f4('0x41')]=function(_0x97be11,_0x36a52a){return respondWithRpcPromise(_0x76f4('0x40'),_0x97be11['query'],routingClient)['then'](findById(_0x97be11['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x36a52a,null))[_0x76f4('0xc')](handleError(_0x36a52a,null));};exports[_0x76f4('0x42')]=function(_0x3b6c16,_0x4c9d64){return respondWithRpcPromise('MailAccounts',_0x3b6c16[_0x76f4('0x17')],mailClient)['then'](respondWithResult(_0x4c9d64,null))[_0x76f4('0xc')](handleError(_0x4c9d64,null));};exports['openchannelQueues']=function(_0x4285dd,_0x25e510){return respondWithRpcPromise(_0x76f4('0x43'),_0x4285dd[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x25e510,null))[_0x76f4('0xc')](handleError(_0x25e510,null));};exports[_0x76f4('0x44')]=function(_0x22a0cc,_0x40c170){return respondWithRpcPromise(_0x76f4('0x43'),_0x22a0cc[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x22a0cc['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x40c170,null))[_0x76f4('0xc')](handleError(_0x40c170,null));};exports[_0x76f4('0x45')]=function(_0x320a87,_0x28cf4c){return respondWithRpcPromise(_0x76f4('0x46'),_0x320a87[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x28cf4c,null))['catch'](handleError(_0x28cf4c,null));};exports['showSmsQueues']=function(_0xa3091a,_0x617924){return respondWithRpcPromise(_0x76f4('0x46'),_0xa3091a['query'],routingClient)[_0x76f4('0x7')](findById(_0xa3091a['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x617924,null))[_0x76f4('0xc')](handleError(_0x617924,null));};exports['whatsappQueues']=function(_0xda0ac2,_0x37b7f7){return respondWithRpcPromise(_0x76f4('0x47'),_0xda0ac2[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x37b7f7,null))[_0x76f4('0xc')](handleError(_0x37b7f7,null));};exports[_0x76f4('0x48')]=function(_0x410d83,_0x1f7257){return respondWithRpcPromise('WhatsappQueues',_0x410d83[_0x76f4('0x17')],routingClient)['then'](findById(_0x410d83[_0x76f4('0x1a')]['id']))[_0x76f4('0x7')](respondWithResult(_0x1f7257,null))[_0x76f4('0xc')](handleError(_0x1f7257,null));};exports[_0x76f4('0x49')]=function(_0xfbb52c,_0x8de630){return respondWithRpcPromise(_0x76f4('0x4a'),_0xfbb52c[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x8de630,null))[_0x76f4('0xc')](handleError(_0x8de630,null));};exports['showFaxQueues']=function(_0x30f3de,_0x6f874d){return respondWithRpcPromise('FaxQueues',_0x30f3de[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x30f3de[_0x76f4('0x1a')]['id']))['then'](respondWithResult(_0x6f874d,null))[_0x76f4('0xc')](handleError(_0x6f874d,null));};exports[_0x76f4('0x4b')]=function(_0x3e829f,_0x52610a){return respondWithRpcPromise(_0x76f4('0x4c'),_0x3e829f[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x52610a,null))[_0x76f4('0xc')](handleError(_0x52610a,null));};exports[_0x76f4('0x4d')]=function(_0x10ee07,_0x19b99c){return respondWithRpcPromise(_0x76f4('0x4e'),_0x10ee07[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x19b99c,null))[_0x76f4('0xc')](handleError(_0x19b99c,null));};exports[_0x76f4('0x4f')]=function(_0x19fdc3,_0x39c9af){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19fdc3[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x39c9af,null))[_0x76f4('0xc')](handleError(_0x39c9af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x43b44d,_0x1375d5){return respondWithRpcPromise(_0x76f4('0x50'),_0x43b44d[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x1375d5,null))['catch'](handleError(_0x1375d5,null));};exports[_0x76f4('0x51')]=function(_0x4dd41f,_0x2b8467){return respondWithRpcPromise(_0x76f4('0x50'),_0x4dd41f['query'],routingClient)['then'](function(_0x58251e){if(_0x4dd41f[_0x76f4('0x17')][_0x76f4('0x52')]!==undefined){var _0x1e7b6=_(_0x58251e[_0x76f4('0x13')])[_0x76f4('0x53')]([_0x4dd41f[_0x76f4('0x17')]['type'],_0x4dd41f[_0x76f4('0x1a')]['id']])[_0x76f4('0x54')](_0x76f4('0x55'))[_0x76f4('0x56')]()[_0x76f4('0x57')]();return _0x58251e[_0x76f4('0x13')][_0x76f4('0x53')](function(_0x202fc8){return _0x1e7b6['indexOf'](_0x202fc8[_0x76f4('0x55')])>-0x1;});}else{return _0x58251e['rows'][_0x76f4('0x53')](function(_0x30358a){return _0x30358a[_0x76f4('0x55')]===parseInt(_0x4dd41f[_0x76f4('0x1a')]['id']);});}})[_0x76f4('0x7')](respondWithResult(_0x2b8467,null))[_0x76f4('0xc')](handleError(_0x2b8467,null));};exports[_0x76f4('0x58')]=function(_0x2a0491,_0x54729b){return respondWithRpcPromise(_0x76f4('0x59'),_0x2a0491['query'],routingClient)['then'](respondWithResult(_0x54729b,null))['catch'](handleError(_0x54729b,null));};exports[_0x76f4('0x5a')]=function(_0x402209,_0x279040){return respondWithRpcPromise(_0x76f4('0x5b'),_0x402209['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x279040,null))[_0x76f4('0xc')](handleError(_0x279040,null));};exports[_0x76f4('0x5c')]=function(_0x5f5c24,_0x12f16e){return respondWithRpcPromise(_0x76f4('0x5d'),_0x5f5c24[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x12f16e,null))[_0x76f4('0xc')](handleError(_0x12f16e,null));};exports[_0x76f4('0x5e')]=function(_0x3b5e15){return function(_0x4b562c,_0x2e991e){var _0xa49e2a,_0x4c7307;var _0x3bc914=_[_0x76f4('0x5f')](_0x3b5e15);var _0x5e6393=_0x3b5e15===_0x76f4('0x60')?_0x76f4('0x61'):_0x76f4('0x62');return db[_0x3bc914+_0x76f4('0x63')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x4b562c[_0x76f4('0x1a')]['id']}})['then'](function(_0x2dac86){if(_[_0x76f4('0x12')](_0x2dac86)){throw new Error(_0x3bc914+_0x76f4('0x65'));}_0xa49e2a=_0x2dac86;return db[_0x3bc914+_0x76f4('0x66')]['findOne']({'where':{'id':_0x4b562c[_0x76f4('0x1f')]['messageId']},'include':[{'model':db[_0x3bc914+_0x76f4('0x67')],'as':'Interaction'},{'model':db[_0x3bc914+_0x5e6393],'as':_0x76f4('0x62')}]});})[_0x76f4('0x7')](function(_0x59e9ed){if(_['isNil'](_0x59e9ed)){throw new Error(_0x3bc914+_0x76f4('0x68'));}_0x4c7307=_0x59e9ed;return _0x59e9ed[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x76f4('0x7')](function(){var _0x4a2969={'uniqueid':_0x3b5e15+'.'+_0x4c7307['id']+'.'+_0x4c7307['Interaction']['id'],'FromUserId':_0x4b562c[_0x76f4('0x30')]['id'],'type':_0x76f4('0x6a')};_0x4a2969[_0x3bc914+_0x76f4('0x6b')]=_0x4c7307['id'];_0x4a2969[_0x3bc914+_0x76f4('0x6c')]=_0x4c7307[_0x76f4('0x67')]['id'];_0x4a2969[_0x76f4('0x6d')+_0x3bc914+_0x5e6393+'Id']=_0x4c7307[_0x76f4('0x62')]['id'];_0x4a2969['To'+_0x3bc914+_0x76f4('0x6e')]=_0xa49e2a['id'];return db[_0x3bc914+'TransferReport']['create'](_0x4a2969);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x3b5e15,'interaction':_0x4c7307[_0x76f4('0x67')],'message':_0x4c7307,'account':_0x4c7307['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x6a'),'appdata':_0xa49e2a[_0x76f4('0x10')]+','+(_0x4c7307[_0x76f4('0x62')][_0x76f4('0x70')]||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x2e991e,null))[_0x76f4('0xc')](handleError(_0x2e991e,null));};};exports['agentNotify']=function(_0x13cf2a,_0x316f86){var _0x3e537b,_0x53252e;if(_[_0x76f4('0x12')](_0x13cf2a[_0x76f4('0x1f')][_0x76f4('0x72')])){throw new Error(_0x76f4('0x73'));}var _0x5080a9=_0x13cf2a[_0x76f4('0x1f')]['channel'];var _0xc80d4c=_['capitalize'](_0x5080a9);var _0x238df3=_0x5080a9===_0x76f4('0x60')?_0x76f4('0x61'):'Account';return db[_0x76f4('0x74')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x13cf2a[_0x76f4('0x1a')]['id'],'role':'agent'}})[_0x76f4('0x7')](function(_0x460867){if(_['isNil'](_0x460867)){throw new Error('Agent\x20not\x20found');}_0x3e537b=_0x460867;return db[_0xc80d4c+_0x76f4('0x66')][_0x76f4('0x64')]({'where':{'id':_0x13cf2a['body']['messageId']},'include':[{'model':db[_0xc80d4c+_0x76f4('0x67')],'as':_0x76f4('0x67')},{'model':db[_0xc80d4c+_0x238df3],'as':'Account'}]});})[_0x76f4('0x7')](function(_0x54ae6c){if(_['isNil'](_0x54ae6c)){throw new Error(_0xc80d4c+'\x20Message\x20not\x20found');}_0x53252e=_0x54ae6c;return _0x54ae6c[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x59265d={'uniqueid':_0x5080a9+'.'+_0x53252e['id']+'.'+_0x53252e[_0x76f4('0x67')]['id'],'FromUserId':_0x13cf2a['user']['id'],'type':'queue','ToUserId':_0x3e537b['id']};_0x59265d[_0xc80d4c+_0x76f4('0x6b')]=_0x53252e['id'];_0x59265d[_0xc80d4c+'InteractionId']=_0x53252e[_0x76f4('0x67')]['id'];_0x59265d[_0x76f4('0x6d')+_0xc80d4c+_0x238df3+'Id']=_0x53252e['Account']['id'];return db[_0xc80d4c+'TransferReport'][_0x76f4('0x75')](_0x59265d);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x5080a9,'interaction':_0x53252e['Interaction'],'message':_0x53252e,'account':_0x53252e[_0x76f4('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x38'),'appdata':_0x3e537b[_0x76f4('0x10')]+','+(_0x53252e[_0x76f4('0x62')]['agentTransferTimeout']||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x316f86,null))[_0x76f4('0xc')](handleError(_0x316f86,null));};
\ No newline at end of file
+var _0x98a8=['openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','QueueId','TransferReport','create','Start','Account','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','Agent\x20not\x20found','messageId','From','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','result','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','format','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions'];(function(_0x5389c5,_0xd4953b){var _0x31f328=function(_0x7e66f0){while(--_0x7e66f0){_0x5389c5['push'](_0x5389c5['shift']());}};_0x31f328(++_0xd4953b);}(_0x98a8,0x12c));var _0x898a=function(_0x4c32f5,_0x41898b){_0x4c32f5=_0x4c32f5-0x0;var _0x525aae=_0x98a8[_0x4c32f5];return _0x525aae;};'use strict';var BPromise=require(_0x898a('0x0'));var moment=require(_0x898a('0x1'));var _=require(_0x898a('0x2'));var util=require(_0x898a('0x3'));var db=require(_0x898a('0x4'))['db'];var logger=require(_0x898a('0x5'))(_0x898a('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0x898a('0x7')][_0x898a('0x8')]({'port':0x232a});var mailClient=jayson[_0x898a('0x7')][_0x898a('0x8')]({'port':0x232b});var routingClient=jayson[_0x898a('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){var _0x283c5=_0xfa8c50?_0xfa8c50:amiClient;return _0x283c5[_0x898a('0x9')](_0x3aadc2,_0x564583)[_0x898a('0xa')](function(_0x3150df){if(_0x3150df[_0x898a('0xb')]){if(_0x3150df[_0x898a('0xb')][_0x898a('0xc')]===0x1f4){return _0x42021d(_0x3150df[_0x898a('0xb')]['message']);}return _0x4fbce5(_0x3150df[_0x898a('0xb')]['message']);}else{_0x4fbce5(_0x3150df[_0x898a('0xd')]);}})['catch'](function(_0x25d7f2){_0x42021d(_0x25d7f2);});});}function respondWithResult(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xc8;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['status'](_0x364a23)['json'](_0x5f5e06);}return _0x2c76b7[_0x898a('0xe')](0x194);};}function handleError(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0x1f4;return function(_0x116fbe){logger[_0x898a('0xb')](_0x116fbe[_0x898a('0xf')]);if(_0x116fbe['name']){delete _0x116fbe[_0x898a('0x10')];}_0x1f5be4['status'](_0xb24335)[_0x898a('0x11')](_0x116fbe);};}function findById(_0x5c96a6){return function(_0x303321){if(!_['isNil'](_0x5c96a6)&&!_[_0x898a('0x12')](_0x303321)&&!_['isNil'](_0x303321[_0x898a('0x13')])){return _[_0x898a('0x14')](_0x303321[_0x898a('0x13')],function(_0x4ddd4d){return _0x4ddd4d['id']==_0x5c96a6;});}return null;};}exports[_0x898a('0x15')]=function(_0x5960e0,_0x54c8f3){return respondWithRpcPromise(_0x898a('0x16'),_0x5960e0[_0x898a('0x17')])['then'](respondWithResult(_0x54c8f3,null))['catch'](handleError(_0x54c8f3,null));};exports[_0x898a('0x18')]=function(_0x26449a,_0x38a8f0){return respondWithRpcPromise(_0x898a('0x19'),_[_0x898a('0x1a')](_0x26449a[_0x898a('0x17')],_0x26449a[_0x898a('0x1b')]))['then'](respondWithResult(_0x38a8f0,null))[_0x898a('0x1c')](handleError(_0x38a8f0,null));};exports[_0x898a('0x1d')]=function(_0x11cae2,_0x3cfd9c){return respondWithRpcPromise(_0x898a('0x1e'),_[_0x898a('0x1a')](_0x11cae2['query'],_0x11cae2[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x3cfd9c,null))[_0x898a('0x1c')](handleError(_0x3cfd9c,null));};exports[_0x898a('0x1f')]=function(_0x3901ab,_0x1426e3){return respondWithRpcPromise('VoiceQueues',_0x3901ab[_0x898a('0x17')])['then'](respondWithResult(_0x1426e3,null))['catch'](handleError(_0x1426e3,null));};exports['showVoiceQueues']=function(_0x3678be,_0x1f4d86){return respondWithRpcPromise(_0x898a('0x20'),_0x3678be[_0x898a('0x17')])[_0x898a('0xa')](findById(_0x3678be[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x1f4d86,null))[_0x898a('0x1c')](handleError(_0x1f4d86,null));};exports[_0x898a('0x21')]=function(_0x58149d,_0x4b3e68){return respondWithRpcPromise('UpdateVoiceQueue',_[_0x898a('0x1a')](_0x58149d[_0x898a('0x22')],_0x58149d[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x4b3e68,null))[_0x898a('0x1c')](handleError(_0x4b3e68,null));};exports[_0x898a('0x23')]=function(_0xe3c983,_0xf74645){return respondWithRpcPromise(_0x898a('0x24'),_[_0x898a('0x1a')](_0xe3c983[_0x898a('0x17')],_0xe3c983[_0x898a('0x1b')]))['then'](respondWithResult(_0xf74645,null))[_0x898a('0x1c')](handleError(_0xf74645,null));};exports[_0x898a('0x25')]=function(_0x26eead,_0x17a980){return respondWithRpcPromise(_0x898a('0x26'),_0x26eead['query'])['then'](respondWithResult(_0x17a980,null))[_0x898a('0x1c')](handleError(_0x17a980,null));};exports[_0x898a('0x27')]=function(_0x1d6d66,_0x4de9bf){return respondWithRpcPromise(_0x898a('0x28'),_[_0x898a('0x1a')](_0x1d6d66[_0x898a('0x17')],_0x1d6d66[_0x898a('0x1b')]))[_0x898a('0xa')](respondWithResult(_0x4de9bf,null))[_0x898a('0x1c')](handleError(_0x4de9bf,null));};exports[_0x898a('0x29')]=function(_0x146f32,_0x50bb4b){return respondWithRpcPromise(_0x898a('0x2a'),_['merge'](_0x146f32['query'],_0x146f32[_0x898a('0x1b')]))['then'](respondWithResult(_0x50bb4b,null))[_0x898a('0x1c')](handleError(_0x50bb4b,null));};exports['voiceQueuesChannelRedirect']=function(_0x37cb11,_0x4f202c){return respondWithRpcPromise(_0x898a('0x2b'),_[_0x898a('0x1a')](_0x37cb11[_0x898a('0x17')],_0x37cb11['params']))['then'](respondWithResult(_0x4f202c,null))['catch'](handleError(_0x4f202c,null));};exports[_0x898a('0x2c')]=function(_0x429c32,_0x5a228f){return respondWithRpcPromise(_0x898a('0x2d'),_0x429c32[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x5a228f,null))[_0x898a('0x1c')](handleError(_0x5a228f,null));};exports['outboundChannels']=function(_0x4b07bc,_0x3aed01){return respondWithRpcPromise(_0x898a('0x2e'),_0x4b07bc['query'])['then'](respondWithResult(_0x3aed01,null))[_0x898a('0x1c')](handleError(_0x3aed01,null));};exports[_0x898a('0x2f')]=function(_0x181cc8,_0xa45405){var _0x51681f;return respondWithRpcPromise(_0x898a('0x30'),_0x181cc8[_0x898a('0x17')])['then'](function(_0x516b8c){_0x51681f=_0x516b8c;return respondWithRpcPromise('Agents',_0x181cc8[_0x898a('0x17')],routingClient);})[_0x898a('0xa')](function(_0x35d767){return _[_0x898a('0x1a')]({},_0x35d767,_0x51681f);})[_0x898a('0xa')](respondWithResult(_0xa45405,null))[_0x898a('0x1c')](handleError(_0xa45405,null));};exports[_0x898a('0x31')]=function(_0x1432ec,_0x3292c2){if(_0x1432ec[_0x898a('0x22')]&&_0x1432ec[_0x898a('0x22')][_0x898a('0x32')]&&_0x1432ec[_0x898a('0x33')]&&_0x1432ec[_0x898a('0x33')][_0x898a('0x10')]){for(var _0x4c8628 in _0x1432ec[_0x898a('0x22')][_0x898a('0x32')]){if(_0x1432ec[_0x898a('0x22')]['interaction'][_0x898a('0x34')](_0x4c8628)){db[_0x898a('0x35')][_0x898a('0x36')]({'where':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')][_0x898a('0x10')],'type':_0x898a('0x37'),'exitAt':null,'uniqueid':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628]&&_0x1432ec['body'][_0x898a('0x32')][_0x4c8628][_0x898a('0x38')]?{'$notIn':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628]}:{'$ne':null}}})['then'](function(_0x3d5fba){var _0x152060=moment()['format'](_0x898a('0x39'));for(var _0x4ce00e=0x0,_0x56a40c=_0x3d5fba['length'];_0x4ce00e<_0x56a40c;_0x4ce00e+=0x1){_0x3d5fba[_0x4ce00e]['updateAttributes']({'exitAt':_0x152060});}});for(var _0x322ecc=0x0;_0x322ecc<_0x1432ec['body'][_0x898a('0x32')][_0x4c8628][_0x898a('0x38')];_0x322ecc+=0x1){db['MemberReport'][_0x898a('0x3a')]({'where':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')]['name'],'type':_0x898a('0x37'),'uniqueid':_0x1432ec[_0x898a('0x22')][_0x898a('0x32')][_0x4c8628][_0x322ecc],'exitAt':null},'defaults':{'channel':_0x4c8628,'membername':_0x1432ec[_0x898a('0x33')]['name'],'interface':_[_0x898a('0x12')](_0x1432ec[_0x898a('0x33')]['interface'])?util[_0x898a('0x3b')](_0x898a('0x3c'),_0x1432ec['user'][_0x898a('0x10')]):_0x1432ec['user'][_0x898a('0x3d')],'type':_0x898a('0x37'),'enterAt':moment()[_0x898a('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x898a('0x3e'),'internal':_0x1432ec[_0x898a('0x33')][_0x898a('0x3f')],'uniqueid':_0x1432ec[_0x898a('0x22')]['interaction'][_0x4c8628][_0x322ecc]}});}}}}return respondWithRpcPromise(_0x898a('0x40'),{'id':_0x1432ec['params']['id'],'capacity':_0x1432ec[_0x898a('0x22')][_0x898a('0x41')]},routingClient)[_0x898a('0xa')](respondWithResult(_0x3292c2,null))['catch'](handleError(_0x3292c2,null));};exports[_0x898a('0x42')]=function(_0x3c4db0,_0x195ac2){return respondWithRpcPromise('Telephones',_0x3c4db0['query'])[_0x898a('0xa')](respondWithResult(_0x195ac2,null))[_0x898a('0x1c')](handleError(_0x195ac2,null));};exports[_0x898a('0x43')]=function(_0x295f1e,_0x28b8c9){return respondWithRpcPromise(_0x898a('0x44'),_0x295f1e[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x28b8c9,null))[_0x898a('0x1c')](handleError(_0x28b8c9,null));};exports[_0x898a('0x45')]=function(_0x2382a9,_0x5e9329){return respondWithRpcPromise(_0x898a('0x46'),_0x2382a9[_0x898a('0x17')])['then'](respondWithResult(_0x5e9329,null))[_0x898a('0x1c')](handleError(_0x5e9329,null));};exports['chatQueues']=function(_0x54c44b,_0x15f11e){return respondWithRpcPromise(_0x898a('0x47'),_0x54c44b[_0x898a('0x17')],routingClient)['then'](respondWithResult(_0x15f11e,null))['catch'](handleError(_0x15f11e,null));};exports[_0x898a('0x48')]=function(_0x1f5e4b,_0x515725){return respondWithRpcPromise(_0x898a('0x47'),_0x1f5e4b[_0x898a('0x17')],routingClient)['then'](findById(_0x1f5e4b[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x515725,null))[_0x898a('0x1c')](handleError(_0x515725,null));};exports['mailQueues']=function(_0xf29714,_0x2ef2f1){return respondWithRpcPromise(_0x898a('0x49'),_0xf29714[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2ef2f1,null))[_0x898a('0x1c')](handleError(_0x2ef2f1,null));};exports['showMailQueues']=function(_0x22a08a,_0x4df5f0){return respondWithRpcPromise(_0x898a('0x49'),_0x22a08a[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0x22a08a[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x4df5f0,null))[_0x898a('0x1c')](handleError(_0x4df5f0,null));};exports[_0x898a('0x4a')]=function(_0x75ff57,_0x3c761c){return respondWithRpcPromise('MailAccounts',_0x75ff57[_0x898a('0x17')],mailClient)[_0x898a('0xa')](respondWithResult(_0x3c761c,null))[_0x898a('0x1c')](handleError(_0x3c761c,null));};exports[_0x898a('0x4b')]=function(_0x219976,_0x2a1345){return respondWithRpcPromise(_0x898a('0x4c'),_0x219976[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2a1345,null))[_0x898a('0x1c')](handleError(_0x2a1345,null));};exports[_0x898a('0x4d')]=function(_0x217dda,_0x3331c0){return respondWithRpcPromise(_0x898a('0x4c'),_0x217dda[_0x898a('0x17')],routingClient)['then'](findById(_0x217dda[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x3331c0,null))['catch'](handleError(_0x3331c0,null));};exports[_0x898a('0x4e')]=function(_0x4583a1,_0x5f0944){return respondWithRpcPromise(_0x898a('0x4f'),_0x4583a1[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x5f0944,null))[_0x898a('0x1c')](handleError(_0x5f0944,null));};exports['showSmsQueues']=function(_0xdc0cc4,_0x11def5){return respondWithRpcPromise(_0x898a('0x4f'),_0xdc0cc4[_0x898a('0x17')],routingClient)['then'](findById(_0xdc0cc4[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x11def5,null))['catch'](handleError(_0x11def5,null));};exports[_0x898a('0x50')]=function(_0x3c0bf6,_0x5b7019){return respondWithRpcPromise(_0x898a('0x51'),_0x3c0bf6['query'],routingClient)[_0x898a('0xa')](respondWithResult(_0x5b7019,null))['catch'](handleError(_0x5b7019,null));};exports['showWhatsappQueues']=function(_0x5ed35e,_0xfdd6d8){return respondWithRpcPromise(_0x898a('0x51'),_0x5ed35e[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0x5ed35e['params']['id']))['then'](respondWithResult(_0xfdd6d8,null))[_0x898a('0x1c')](handleError(_0xfdd6d8,null));};exports[_0x898a('0x52')]=function(_0x1c2661,_0x5dc44e){return respondWithRpcPromise(_0x898a('0x53'),_0x1c2661[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x5dc44e,null))[_0x898a('0x1c')](handleError(_0x5dc44e,null));};exports['showFaxQueues']=function(_0xaac6d4,_0x43bf93){return respondWithRpcPromise('FaxQueues',_0xaac6d4[_0x898a('0x17')],routingClient)[_0x898a('0xa')](findById(_0xaac6d4[_0x898a('0x1b')]['id']))[_0x898a('0xa')](respondWithResult(_0x43bf93,null))[_0x898a('0x1c')](handleError(_0x43bf93,null));};exports[_0x898a('0x54')]=function(_0x3bcc3d,_0x2dc61c){return respondWithRpcPromise(_0x898a('0x55'),_0x3bcc3d[_0x898a('0x17')])[_0x898a('0xa')](respondWithResult(_0x2dc61c,null))[_0x898a('0x1c')](handleError(_0x2dc61c,null));};exports[_0x898a('0x56')]=function(_0x4a7705,_0x2d9a9c){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4a7705[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x2d9a9c,null))[_0x898a('0x1c')](handleError(_0x2d9a9c,null));};exports['mailQueuesWaitingInteractions']=function(_0x31102d,_0x3f0d9f){return respondWithRpcPromise(_0x898a('0x57'),_0x31102d[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x3f0d9f,null))['catch'](handleError(_0x3f0d9f,null));};exports[_0x898a('0x58')]=function(_0x352ebb,_0x37b1d0){return respondWithRpcPromise(_0x898a('0x59'),_0x352ebb[_0x898a('0x17')],routingClient)['then'](respondWithResult(_0x37b1d0,null))[_0x898a('0x1c')](handleError(_0x37b1d0,null));};exports[_0x898a('0x5a')]=function(_0x474029,_0x37d205){return respondWithRpcPromise(_0x898a('0x59'),_0x474029[_0x898a('0x17')],routingClient)[_0x898a('0xa')](function(_0x1b0c09){if(_0x474029['query'][_0x898a('0x5b')]!==undefined){var _0x4607e1=_(_0x1b0c09['rows'])[_0x898a('0x5c')]([_0x474029['query'][_0x898a('0x5b')],_0x474029['params']['id']])[_0x898a('0x5d')](_0x898a('0x5e'))[_0x898a('0x5f')]()[_0x898a('0x60')]();return _0x1b0c09[_0x898a('0x13')][_0x898a('0x5c')](function(_0x170267){return _0x4607e1[_0x898a('0x61')](_0x170267[_0x898a('0x5e')])>-0x1;});}else{return _0x1b0c09['rows'][_0x898a('0x5c')](function(_0xd627d0){return _0xd627d0[_0x898a('0x5e')]===parseInt(_0x474029[_0x898a('0x1b')]['id']);});}})[_0x898a('0xa')](respondWithResult(_0x37d205,null))[_0x898a('0x1c')](handleError(_0x37d205,null));};exports[_0x898a('0x62')]=function(_0x4bcf85,_0x380f8c){return respondWithRpcPromise(_0x898a('0x63'),_0x4bcf85['query'],routingClient)['then'](respondWithResult(_0x380f8c,null))[_0x898a('0x1c')](handleError(_0x380f8c,null));};exports[_0x898a('0x64')]=function(_0x48e9c2,_0x5710a0){return respondWithRpcPromise(_0x898a('0x65'),_0x48e9c2['query'],routingClient)[_0x898a('0xa')](respondWithResult(_0x5710a0,null))[_0x898a('0x1c')](handleError(_0x5710a0,null));};exports['faxQueuesWaitingInteractions']=function(_0x3f6815,_0x1c782e){return respondWithRpcPromise(_0x898a('0x66'),_0x3f6815[_0x898a('0x17')],routingClient)[_0x898a('0xa')](respondWithResult(_0x1c782e,null))[_0x898a('0x1c')](handleError(_0x1c782e,null));};exports[_0x898a('0x67')]=function(_0x49f8ac){return function(_0x3237e8,_0x1efe1e){var _0x37ee4d,_0x50d978;var _0x27560f=_[_0x898a('0x68')](_0x49f8ac);var _0x5c6247=_0x49f8ac===_0x898a('0x69')?'Website':'Account';return db[_0x27560f+'Queue'][_0x898a('0x6a')]({'raw':!![],'where':{'id':_0x3237e8[_0x898a('0x1b')]['id']}})[_0x898a('0xa')](function(_0x2079d0){if(_[_0x898a('0x12')](_0x2079d0)){throw new Error(_0x27560f+_0x898a('0x6b'));}_0x37ee4d=_0x2079d0;return db[_0x27560f+_0x898a('0x6c')]['findOne']({'where':{'id':_0x3237e8[_0x898a('0x22')]['messageId']},'include':[{'model':db[_0x27560f+_0x898a('0x6d')],'as':_0x898a('0x6d')},{'model':db[_0x27560f+_0x5c6247],'as':'Account'}]});})[_0x898a('0xa')](function(_0x2269fb){if(_[_0x898a('0x12')](_0x2269fb)){throw new Error(_0x27560f+_0x898a('0x6e'));}_0x50d978=_0x2269fb;return _0x2269fb[_0x898a('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5847cb={'uniqueid':_0x49f8ac+'.'+_0x50d978['id']+'.'+_0x50d978['Interaction']['id'],'FromUserId':_0x3237e8[_0x898a('0x33')]['id'],'type':_0x898a('0x70')};_0x5847cb[_0x27560f+_0x898a('0x71')]=_0x50d978['id'];_0x5847cb[_0x27560f+'InteractionId']=_0x50d978[_0x898a('0x6d')]['id'];_0x5847cb['From'+_0x27560f+_0x5c6247+'Id']=_0x50d978['Account']['id'];_0x5847cb['To'+_0x27560f+_0x898a('0x72')]=_0x37ee4d['id'];return db[_0x27560f+_0x898a('0x73')][_0x898a('0x74')](_0x5847cb);})[_0x898a('0xa')](function(){return respondWithRpcPromise(_0x898a('0x75'),{'channel':_0x49f8ac,'interaction':_0x50d978[_0x898a('0x6d')],'message':_0x50d978,'account':_0x50d978[_0x898a('0x76')],'applications':[{'id':0x0,'priority':0x1,'app':_0x898a('0x70'),'appdata':_0x37ee4d[_0x898a('0x10')]+','+(_0x50d978[_0x898a('0x76')][_0x898a('0x77')]||0x12c),'interval':_0x898a('0x78')}]},routingClient);})[_0x898a('0xa')](respondWithResult(_0x1efe1e,null))[_0x898a('0x1c')](handleError(_0x1efe1e,null));};};exports[_0x898a('0x79')]=function(_0x3d9634,_0x54c440){var _0x435689,_0x3eaf3e;if(_[_0x898a('0x12')](_0x3d9634[_0x898a('0x22')][_0x898a('0x7a')])){throw new Error(_0x898a('0x7b'));}var _0xd45b78=_0x3d9634[_0x898a('0x22')][_0x898a('0x7a')];var _0x427eff=_[_0x898a('0x68')](_0xd45b78);var _0x381071=_0xd45b78==='chat'?_0x898a('0x7c'):'Account';return db[_0x898a('0x7d')][_0x898a('0x6a')]({'raw':!![],'where':{'id':_0x3d9634[_0x898a('0x1b')]['id'],'role':'agent'}})[_0x898a('0xa')](function(_0x223775){if(_['isNil'](_0x223775)){throw new Error(_0x898a('0x7e'));}_0x435689=_0x223775;return db[_0x427eff+_0x898a('0x6c')][_0x898a('0x6a')]({'where':{'id':_0x3d9634[_0x898a('0x22')][_0x898a('0x7f')]},'include':[{'model':db[_0x427eff+_0x898a('0x6d')],'as':'Interaction'},{'model':db[_0x427eff+_0x381071],'as':'Account'}]});})[_0x898a('0xa')](function(_0x4b7334){if(_[_0x898a('0x12')](_0x4b7334)){throw new Error(_0x427eff+_0x898a('0x6e'));}_0x3eaf3e=_0x4b7334;return _0x4b7334[_0x898a('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x898a('0xa')](function(){var _0x13b3f9={'uniqueid':_0xd45b78+'.'+_0x3eaf3e['id']+'.'+_0x3eaf3e[_0x898a('0x6d')]['id'],'FromUserId':_0x3d9634['user']['id'],'type':'queue','ToUserId':_0x435689['id']};_0x13b3f9[_0x427eff+_0x898a('0x71')]=_0x3eaf3e['id'];_0x13b3f9[_0x427eff+'InteractionId']=_0x3eaf3e[_0x898a('0x6d')]['id'];_0x13b3f9[_0x898a('0x80')+_0x427eff+_0x381071+'Id']=_0x3eaf3e['Account']['id'];return db[_0x427eff+_0x898a('0x73')]['create'](_0x13b3f9);})[_0x898a('0xa')](function(){return respondWithRpcPromise(_0x898a('0x75'),{'channel':_0xd45b78,'interaction':_0x3eaf3e[_0x898a('0x6d')],'message':_0x3eaf3e,'account':_0x3eaf3e['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x435689['name']+','+(_0x3eaf3e[_0x898a('0x76')][_0x898a('0x81')]||0x12c),'interval':_0x898a('0x78')}]},routingClient);})[_0x898a('0xa')](respondWithResult(_0x54c440,null))[_0x898a('0x1c')](handleError(_0x54c440,null));};
\ No newline at end of file
index 96717da..54d7411 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd611=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','/:id/run','run','create','put','update','delete','destroy','multer','util'];(function(_0x2ae653,_0x1f41af){var _0x4bf4ba=function(_0x507a43){while(--_0x507a43){_0x2ae653['push'](_0x2ae653['shift']());}};_0x4bf4ba(++_0x1f41af);}(_0xd611,0x166));var _0x1d61=function(_0x116415,_0x28c819){_0x116415=_0x116415-0x0;var _0x10f8ef=_0xd611[_0x116415];return _0x10f8ef;};'use strict';var multer=require(_0x1d61('0x0'));var util=require(_0x1d61('0x1'));var path=require(_0x1d61('0x2'));var timeout=require(_0x1d61('0x3'));var express=require('express');var router=express[_0x1d61('0x4')]();var fs_extra=require(_0x1d61('0x5'));var auth=require(_0x1d61('0x6'));var interaction=require(_0x1d61('0x7'));var config=require(_0x1d61('0x8'));var controller=require(_0x1d61('0x9'));router[_0x1d61('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1d61('0xa')](_0x1d61('0xb'),auth[_0x1d61('0xc')](),controller['show']);router[_0x1d61('0xa')](_0x1d61('0xd'),auth[_0x1d61('0xc')](),controller[_0x1d61('0xe')]);router['post']('/',auth[_0x1d61('0xc')](),controller[_0x1d61('0xf')]);router[_0x1d61('0x10')](_0x1d61('0xb'),auth[_0x1d61('0xc')](),controller[_0x1d61('0x11')]);router[_0x1d61('0x12')](_0x1d61('0xb'),auth['isAuthenticated'](),controller[_0x1d61('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x6789=['show','/:id/run','run','post','create','/:id','update','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated'];(function(_0x2e282b,_0x1f9828){var _0x4276eb=function(_0xbf40b3){while(--_0xbf40b3){_0x2e282b['push'](_0x2e282b['shift']());}};_0x4276eb(++_0x1f9828);}(_0x6789,0x199));var _0x9678=function(_0x4a169d,_0x42963a){_0x4a169d=_0x4a169d-0x0;var _0x1c9aa0=_0x6789[_0x4a169d];return _0x1c9aa0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9678('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9678('0x1')]();var fs_extra=require(_0x9678('0x2'));var auth=require(_0x9678('0x3'));var interaction=require(_0x9678('0x4'));var config=require(_0x9678('0x5'));var controller=require(_0x9678('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9678('0x7')]('/:id',auth[_0x9678('0x8')](),controller[_0x9678('0x9')]);router[_0x9678('0x7')](_0x9678('0xa'),auth[_0x9678('0x8')](),controller[_0x9678('0xb')]);router[_0x9678('0xc')]('/',auth['isAuthenticated'](),controller[_0x9678('0xd')]);router['put'](_0x9678('0xe'),auth[_0x9678('0x8')](),controller[_0x9678('0xf')]);router[_0x9678('0x10')](_0x9678('0xe'),auth[_0x9678('0x8')](),controller[_0x9678('0x11')]);module[_0x9678('0x12')]=router;
\ No newline at end of file
index 7e44b77..285439a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3386=['ENUM','pdf','xlsx','csv','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','quarters','months','weeks','days','hours','minutes'];(function(_0x55c72d,_0x5d7876){var _0x3b64b6=function(_0x22de97){while(--_0x22de97){_0x55c72d['push'](_0x55c72d['shift']());}};_0x3b64b6(++_0x5d7876);}(_0x3386,0x72));var _0x6338=function(_0x3df31d,_0x5081ff){_0x3df31d=_0x3df31d-0x0;var _0x352dbc=_0x3386[_0x3df31d];return _0x352dbc;};'use strict';var Sequelize=require(_0x6338('0x0'));module[_0x6338('0x1')]={'name':{'type':Sequelize[_0x6338('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6338('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6338('0x2')],'allowNull':![],'defaultValue':_0x6338('0x4')},'startAt':{'type':Sequelize[_0x6338('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x6338('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x6338('0x6'),_0x6338('0x7'),_0x6338('0x8'),_0x6338('0x9'),_0x6338('0xa'),_0x6338('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x6338('0xc')]('csv',_0x6338('0xd'),_0x6338('0xe')),'allowNull':![],'defaultValue':_0x6338('0xf')},'type':{'type':Sequelize[_0x6338('0xc')](_0x6338('0x10'),'default'),'allowNull':![],'defaultValue':_0x6338('0x10')},'sendMail':{'type':Sequelize[_0x6338('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6338('0x11')]},'bcc':{'type':Sequelize[_0x6338('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x6338('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x82a4=['INTEGER','years','quarters','months','days','hours','ENUM','pdf','xlsx','csv','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0x124169,_0x5a81a7){var _0x2a4fd6=function(_0x38c2ff){while(--_0x38c2ff){_0x124169['push'](_0x124169['shift']());}};_0x2a4fd6(++_0x5a81a7);}(_0x82a4,0xf1));var _0x482a=function(_0x400d94,_0x30a412){_0x400d94=_0x400d94-0x0;var _0x148029=_0x82a4[_0x400d94];return _0x148029;};'use strict';var Sequelize=require(_0x482a('0x0'));module[_0x482a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x482a('0x2')]},'active':{'type':Sequelize[_0x482a('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x482a('0x2')],'allowNull':![],'defaultValue':_0x482a('0x4')},'startAt':{'type':Sequelize[_0x482a('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x482a('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x482a('0x7'),_0x482a('0x8'),_0x482a('0x9'),'weeks',_0x482a('0xa'),_0x482a('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x482a('0xa')},'output':{'type':Sequelize[_0x482a('0xc')]('csv',_0x482a('0xd'),_0x482a('0xe')),'allowNull':![],'defaultValue':_0x482a('0xf')},'type':{'type':Sequelize[_0x482a('0xc')](_0x482a('0x10'),_0x482a('0x11')),'allowNull':![],'defaultValue':_0x482a('0x10')},'sendMail':{'type':Sequelize[_0x482a('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x482a('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x482a('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x482a('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index ff4a401..6819f23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd274=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','Scheduler','UserProfileResource','error','stack','name','Schedule','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','body'];(function(_0xe2213a,_0x7a82ed){var _0x30430e=function(_0x5895ba){while(--_0x5895ba){_0xe2213a['push'](_0xe2213a['shift']());}};_0x30430e(++_0x7a82ed);}(_0xd274,0x10a));var _0x4d27=function(_0x19b1ce,_0x3493b8){_0x19b1ce=_0x19b1ce-0x0;var _0x4ee847=_0xd274[_0x19b1ce];return _0x4ee847;};'use strict';var emlformat=require(_0x4d27('0x0'));var rimraf=require(_0x4d27('0x1'));var zipdir=require(_0x4d27('0x2'));var jsonpatch=require(_0x4d27('0x3'));var rp=require(_0x4d27('0x4'));var moment=require(_0x4d27('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4d27('0x6'));var util=require('util');var path=require(_0x4d27('0x7'));var sox=require('sox');var csv=require(_0x4d27('0x8'));var ejs=require(_0x4d27('0x9'));var fs=require('fs');var fs_extra=require(_0x4d27('0xa'));var _=require(_0x4d27('0xb'));var squel=require(_0x4d27('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4d27('0xd'));var toCsv=require(_0x4d27('0x8'));var querystring=require(_0x4d27('0xe'));var Papa=require(_0x4d27('0xf'));var Redis=require(_0x4d27('0x10'));var authService=require(_0x4d27('0x11'));var qs=require(_0x4d27('0x12'));var as=require(_0x4d27('0x13'));var hardwareService=require(_0x4d27('0x14'));var logger=require(_0x4d27('0x15'))('api');var utils=require(_0x4d27('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4d27('0x17'))['db'];function respondWithStatusCode(_0x12e741,_0x5d2cdc){_0x5d2cdc=_0x5d2cdc||0xcc;return function(_0x190c9d){if(_0x190c9d){return _0x12e741[_0x4d27('0x18')](_0x5d2cdc);}return _0x12e741[_0x4d27('0x19')](_0x5d2cdc)[_0x4d27('0x1a')]();};}function respondWithResult(_0x2ea4cd,_0x100bbb){_0x100bbb=_0x100bbb||0xc8;return function(_0x32190f){if(_0x32190f){return _0x2ea4cd[_0x4d27('0x19')](_0x100bbb)[_0x4d27('0x1b')](_0x32190f);}};}function respondWithFilteredResult(_0x128f01,_0x562f42){return function(_0x1be5c5){if(_0x1be5c5){var _0x18a36a=typeof _0x562f42['offset']===_0x4d27('0x1c')&&typeof _0x562f42[_0x4d27('0x1d')]===_0x4d27('0x1c');var _0x38b516=_0x1be5c5['count'];var _0x1c3a36=_0x18a36a?0x0:_0x562f42[_0x4d27('0x1e')];var _0x313213=_0x18a36a?_0x1be5c5[_0x4d27('0x1f')]:_0x562f42['offset']+_0x562f42[_0x4d27('0x1d')];var _0x5b968f;if(_0x313213>=_0x38b516){_0x313213=_0x38b516;_0x5b968f=0xc8;}else{_0x5b968f=0xce;}_0x128f01['status'](_0x5b968f);return _0x128f01[_0x4d27('0x20')](_0x4d27('0x21'),_0x1c3a36+'-'+_0x313213+'/'+_0x38b516)[_0x4d27('0x1b')](_0x1be5c5);}return null;};}function patchUpdates(_0x491509){return function(_0x5ee62b){try{jsonpatch[_0x4d27('0x22')](_0x5ee62b,_0x491509,!![]);}catch(_0x1282d6){return BPromise['reject'](_0x1282d6);}return _0x5ee62b[_0x4d27('0x23')]();};}function saveUpdates(_0x14884d,_0x58d4de){return function(_0x47f0bb){if(_0x47f0bb){return _0x47f0bb[_0x4d27('0x24')](_0x14884d)[_0x4d27('0x25')](function(_0x49cdaf){return _0x49cdaf;});}return null;};}function removeEntity(_0xebf07e,_0x3954c7){return function(_0x568f17){if(_0x568f17){return _0x568f17[_0x4d27('0x26')]()[_0x4d27('0x25')](function(){var _0x3e23a2=_0x568f17['get']({'plain':!![]});var _0x5f1b79=_0x4d27('0x27');return db[_0x4d27('0x28')][_0x4d27('0x26')]({'where':{'type':_0x5f1b79,'resourceId':_0x3e23a2['id']}})[_0x4d27('0x25')](function(){return _0x568f17;});})[_0x4d27('0x25')](function(){_0xebf07e['status'](0xcc)[_0x4d27('0x1a')]();});}};}function handleEntityNotFound(_0x3f331f,_0x54d217){return function(_0x1a24fd){if(!_0x1a24fd){_0x3f331f[_0x4d27('0x18')](0x194);}return _0x1a24fd;};}function handleError(_0x37c717,_0x50bfe9){_0x50bfe9=_0x50bfe9||0x1f4;return function(_0x39a465){logger[_0x4d27('0x29')](_0x39a465[_0x4d27('0x2a')]);if(_0x39a465[_0x4d27('0x2b')]){delete _0x39a465[_0x4d27('0x2b')];}_0x37c717[_0x4d27('0x19')](_0x50bfe9)['send'](_0x39a465);};}exports['index']=function(_0x55f4b2,_0x251133){var _0xbb555a={},_0x5809f4={},_0x58b55e={'count':0x0,'rows':[]};var _0x17ddb4=_['map'](db[_0x4d27('0x2c')][_0x4d27('0x2d')],function(_0x27211a){return{'name':_0x27211a['fieldName'],'type':_0x27211a['type'][_0x4d27('0x2e')]};});_0x5809f4[_0x4d27('0x2f')]=_[_0x4d27('0x30')](_0x17ddb4,_0x4d27('0x2b'));_0x5809f4[_0x4d27('0x31')]=_[_0x4d27('0x32')](_0x55f4b2[_0x4d27('0x31')]);_0x5809f4[_0x4d27('0x33')]=_['intersection'](_0x5809f4['model'],_0x5809f4[_0x4d27('0x31')]);_0xbb555a[_0x4d27('0x34')]=_[_0x4d27('0x35')](_0x5809f4[_0x4d27('0x2f')],qs['fields'](_0x55f4b2[_0x4d27('0x31')]['fields']));_0xbb555a[_0x4d27('0x34')]=_0xbb555a[_0x4d27('0x34')][_0x4d27('0x36')]?_0xbb555a['attributes']:_0x5809f4[_0x4d27('0x2f')];if(!_0x55f4b2['query'][_0x4d27('0x37')](_0x4d27('0x38'))){_0xbb555a[_0x4d27('0x1d')]=qs[_0x4d27('0x1d')](_0x55f4b2[_0x4d27('0x31')][_0x4d27('0x1d')]);_0xbb555a[_0x4d27('0x1e')]=qs['offset'](_0x55f4b2['query'][_0x4d27('0x1e')]);}_0xbb555a[_0x4d27('0x39')]=qs[_0x4d27('0x3a')](_0x55f4b2[_0x4d27('0x31')]['sort']);_0xbb555a[_0x4d27('0x3b')]=qs[_0x4d27('0x33')](_[_0x4d27('0x3c')](_0x55f4b2[_0x4d27('0x31')],_0x5809f4[_0x4d27('0x33')]),_0x17ddb4);if(_0x55f4b2[_0x4d27('0x31')][_0x4d27('0x3d')]){_0xbb555a['where']=_[_0x4d27('0x3e')](_0xbb555a[_0x4d27('0x3b')],{'$or':_[_0x4d27('0x30')](_0x17ddb4,function(_0xa5dff4){if(_0xa5dff4[_0x4d27('0x3f')]!==_0x4d27('0x40')){var _0xb92b11={};_0xb92b11[_0xa5dff4[_0x4d27('0x2b')]]={'$like':'%'+_0x55f4b2[_0x4d27('0x31')][_0x4d27('0x3d')]+'%'};return _0xb92b11;}})});}_0xbb555a=_[_0x4d27('0x3e')]({},_0xbb555a,_0x55f4b2[_0x4d27('0x41')]);var _0x3b4934={'where':_0xbb555a[_0x4d27('0x3b')]};return db[_0x4d27('0x2c')][_0x4d27('0x1f')](_0x3b4934)[_0x4d27('0x25')](function(_0x24ace4){_0x58b55e['count']=_0x24ace4;if(_0x55f4b2[_0x4d27('0x31')][_0x4d27('0x42')]){_0xbb555a[_0x4d27('0x43')]=[{'all':!![]}];}return db[_0x4d27('0x2c')]['findAll'](_0xbb555a);})[_0x4d27('0x25')](function(_0x5770be){_0x58b55e[_0x4d27('0x44')]=_0x5770be;return _0x58b55e;})[_0x4d27('0x25')](respondWithFilteredResult(_0x251133,_0xbb555a))[_0x4d27('0x45')](handleError(_0x251133,null));};exports[_0x4d27('0x46')]=function(_0x3f0d98,_0x4f35d9){var _0x119a1e={'raw':![],'where':{'id':_0x3f0d98[_0x4d27('0x47')]['id']}},_0x8db69d={};_0x8db69d['model']=_[_0x4d27('0x32')](db[_0x4d27('0x2c')][_0x4d27('0x2d')]);_0x8db69d[_0x4d27('0x31')]=_[_0x4d27('0x32')](_0x3f0d98[_0x4d27('0x31')]);_0x8db69d[_0x4d27('0x33')]=_[_0x4d27('0x35')](_0x8db69d['model'],_0x8db69d[_0x4d27('0x31')]);_0x119a1e['attributes']=_[_0x4d27('0x35')](_0x8db69d['model'],qs[_0x4d27('0x48')](_0x3f0d98[_0x4d27('0x31')]['fields']));_0x119a1e[_0x4d27('0x34')]=_0x119a1e['attributes']['length']?_0x119a1e['attributes']:_0x8db69d[_0x4d27('0x2f')];if(_0x3f0d98[_0x4d27('0x31')][_0x4d27('0x42')]){_0x119a1e[_0x4d27('0x43')]=[{'all':!![]}];}_0x119a1e=_[_0x4d27('0x3e')]({},_0x119a1e,_0x3f0d98[_0x4d27('0x41')]);return db[_0x4d27('0x2c')]['find'](_0x119a1e)[_0x4d27('0x25')](handleEntityNotFound(_0x4f35d9,null))[_0x4d27('0x25')](respondWithResult(_0x4f35d9,null))[_0x4d27('0x45')](handleError(_0x4f35d9,null));};exports['create']=function(_0xd4d89e,_0x48a9fe){return db[_0x4d27('0x2c')]['create'](_0xd4d89e[_0x4d27('0x49')],{})[_0x4d27('0x25')](function(_0x4d3fde){var _0x2675df=_0xd4d89e[_0x4d27('0x4a')][_0x4d27('0x4b')]({'plain':!![]});if(!_0x2675df)throw new Error(_0x4d27('0x4c'));if(_0x2675df[_0x4d27('0x4d')]===_0x4d27('0x4a')){var _0x5314ce=_0x4d3fde[_0x4d27('0x4b')]({'plain':!![]});var _0x47efb9=_0x4d27('0x27');return db[_0x4d27('0x4e')][_0x4d27('0x4f')]({'where':{'name':_0x47efb9,'userProfileId':_0x2675df[_0x4d27('0x50')]},'raw':!![]})[_0x4d27('0x25')](function(_0x23db80){if(_0x23db80&&_0x23db80[_0x4d27('0x51')]===0x0){return db[_0x4d27('0x28')]['create']({'name':_0x5314ce[_0x4d27('0x2b')],'resourceId':_0x5314ce['id'],'type':_0x23db80[_0x4d27('0x2b')],'sectionId':_0x23db80['id']},{})[_0x4d27('0x25')](function(){return _0x4d3fde;});}else{return _0x4d3fde;}})['catch'](function(_0xd3057d){logger['error'](_0x4d27('0x52'),_0xd3057d);throw _0xd3057d;});}return _0x4d3fde;})['then'](respondWithResult(_0x48a9fe,0xc9))[_0x4d27('0x45')](handleError(_0x48a9fe,null));};exports[_0x4d27('0x24')]=function(_0x2ef3a2,_0x5cbcc5){if(_0x2ef3a2[_0x4d27('0x49')]['id']){delete _0x2ef3a2[_0x4d27('0x49')]['id'];}return db[_0x4d27('0x2c')][_0x4d27('0x4f')]({'where':{'id':_0x2ef3a2['params']['id']}})[_0x4d27('0x25')](handleEntityNotFound(_0x5cbcc5,null))[_0x4d27('0x25')](saveUpdates(_0x2ef3a2[_0x4d27('0x49')],null))['then'](respondWithResult(_0x5cbcc5,null))[_0x4d27('0x45')](handleError(_0x5cbcc5,null));};exports[_0x4d27('0x26')]=function(_0x47d10d,_0x469d28){return db[_0x4d27('0x2c')]['find']({'where':{'id':_0x47d10d[_0x4d27('0x47')]['id']}})['then'](handleEntityNotFound(_0x469d28,null))[_0x4d27('0x25')](removeEntity(_0x469d28,null))[_0x4d27('0x45')](handleError(_0x469d28,null));};exports[_0x4d27('0x53')]=function(_0x485587,_0x1c9f39,_0x114ba0){var _0x4bd022=require(_0x4d27('0x54'));return db[_0x4d27('0x2c')][_0x4d27('0x4f')]({'where':{'id':_0x485587[_0x4d27('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1c9f39,null))[_0x4d27('0x25')](function(){_0x4bd022['run'](_0x485587[_0x4d27('0x47')]['id']);})['then'](respondWithStatusCode(_0x1c9f39,null))[_0x4d27('0x45')](handleError(_0x1c9f39,null));};
\ No newline at end of file
+var _0x7161=['key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','Schedule','rawAttributes','fieldName','type'];(function(_0x5ed59d,_0xc2dc4a){var _0x25ceb2=function(_0x251cf2){while(--_0x251cf2){_0x5ed59d['push'](_0x5ed59d['shift']());}};_0x25ceb2(++_0xc2dc4a);}(_0x7161,0x135));var _0x1716=function(_0x2a7dbb,_0x52406c){_0x2a7dbb=_0x2a7dbb-0x0;var _0x42e138=_0x7161[_0x2a7dbb];return _0x42e138;};'use strict';var emlformat=require(_0x1716('0x0'));var rimraf=require(_0x1716('0x1'));var zipdir=require(_0x1716('0x2'));var jsonpatch=require(_0x1716('0x3'));var rp=require(_0x1716('0x4'));var moment=require(_0x1716('0x5'));var BPromise=require(_0x1716('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1716('0x7'));var sox=require(_0x1716('0x8'));var csv=require(_0x1716('0x9'));var ejs=require(_0x1716('0xa'));var fs=require('fs');var fs_extra=require(_0x1716('0xb'));var _=require(_0x1716('0xc'));var squel=require(_0x1716('0xd'));var crypto=require(_0x1716('0xe'));var jsforce=require(_0x1716('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1716('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1716('0x10'));var authService=require(_0x1716('0x11'));var qs=require(_0x1716('0x12'));var as=require(_0x1716('0x13'));var hardwareService=require(_0x1716('0x14'));var logger=require(_0x1716('0x15'))(_0x1716('0x16'));var utils=require(_0x1716('0x17'));var config=require(_0x1716('0x18'));var licenseUtil=require(_0x1716('0x19'));var db=require(_0x1716('0x1a'))['db'];function respondWithStatusCode(_0x3ec5da,_0x311d58){_0x311d58=_0x311d58||0xcc;return function(_0x4e168c){if(_0x4e168c){return _0x3ec5da['sendStatus'](_0x311d58);}return _0x3ec5da[_0x1716('0x1b')](_0x311d58)['end']();};}function respondWithResult(_0x57cc80,_0x4832c3){_0x4832c3=_0x4832c3||0xc8;return function(_0x24bc67){if(_0x24bc67){return _0x57cc80[_0x1716('0x1b')](_0x4832c3)[_0x1716('0x1c')](_0x24bc67);}};}function respondWithFilteredResult(_0x35c8b6,_0x319d49){return function(_0x75f18f){if(_0x75f18f){var _0x4f23bb=typeof _0x319d49[_0x1716('0x1d')]===_0x1716('0x1e')&&typeof _0x319d49[_0x1716('0x1f')]===_0x1716('0x1e');var _0x4ae535=_0x75f18f['count'];var _0x2efaa7=_0x4f23bb?0x0:_0x319d49['offset'];var _0x43d031=_0x4f23bb?_0x75f18f[_0x1716('0x20')]:_0x319d49[_0x1716('0x1d')]+_0x319d49[_0x1716('0x1f')];var _0x5d63d7;if(_0x43d031>=_0x4ae535){_0x43d031=_0x4ae535;_0x5d63d7=0xc8;}else{_0x5d63d7=0xce;}_0x35c8b6['status'](_0x5d63d7);return _0x35c8b6[_0x1716('0x21')]('Content-Range',_0x2efaa7+'-'+_0x43d031+'/'+_0x4ae535)[_0x1716('0x1c')](_0x75f18f);}return null;};}function patchUpdates(_0x36711c){return function(_0x3358c0){try{jsonpatch[_0x1716('0x22')](_0x3358c0,_0x36711c,!![]);}catch(_0x2c3cfe){return BPromise[_0x1716('0x23')](_0x2c3cfe);}return _0x3358c0[_0x1716('0x24')]();};}function saveUpdates(_0x5d3562,_0x4b7340){return function(_0x505699){if(_0x505699){return _0x505699[_0x1716('0x25')](_0x5d3562)[_0x1716('0x26')](function(_0x1d92b8){return _0x1d92b8;});}return null;};}function removeEntity(_0x216fe2,_0x43fab4){return function(_0x3ee665){if(_0x3ee665){return _0x3ee665['destroy']()[_0x1716('0x26')](function(){var _0x5c386c=_0x3ee665[_0x1716('0x27')]({'plain':!![]});var _0x4f0159='Scheduler';return db[_0x1716('0x28')][_0x1716('0x29')]({'where':{'type':_0x4f0159,'resourceId':_0x5c386c['id']}})['then'](function(){return _0x3ee665;});})[_0x1716('0x26')](function(){_0x216fe2[_0x1716('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54452b,_0x350b12){return function(_0x2e2f0b){if(!_0x2e2f0b){_0x54452b['sendStatus'](0x194);}return _0x2e2f0b;};}function handleError(_0x47db24,_0x4a12d8){_0x4a12d8=_0x4a12d8||0x1f4;return function(_0x8bc3e8){logger[_0x1716('0x2a')](_0x8bc3e8[_0x1716('0x2b')]);if(_0x8bc3e8[_0x1716('0x2c')]){delete _0x8bc3e8[_0x1716('0x2c')];}_0x47db24[_0x1716('0x1b')](_0x4a12d8)[_0x1716('0x2d')](_0x8bc3e8);};}exports[_0x1716('0x2e')]=function(_0x5861c2,_0x305225){var _0x282cac={},_0x5e09d1={},_0x41c019={'count':0x0,'rows':[]};var _0x38c64b=_['map'](db[_0x1716('0x2f')][_0x1716('0x30')],function(_0x59a824){return{'name':_0x59a824[_0x1716('0x31')],'type':_0x59a824[_0x1716('0x32')][_0x1716('0x33')]};});_0x5e09d1['model']=_[_0x1716('0x34')](_0x38c64b,_0x1716('0x2c'));_0x5e09d1[_0x1716('0x35')]=_[_0x1716('0x36')](_0x5861c2['query']);_0x5e09d1[_0x1716('0x37')]=_[_0x1716('0x38')](_0x5e09d1[_0x1716('0x39')],_0x5e09d1[_0x1716('0x35')]);_0x282cac['attributes']=_[_0x1716('0x38')](_0x5e09d1[_0x1716('0x39')],qs[_0x1716('0x3a')](_0x5861c2['query'][_0x1716('0x3a')]));_0x282cac['attributes']=_0x282cac[_0x1716('0x3b')][_0x1716('0x3c')]?_0x282cac[_0x1716('0x3b')]:_0x5e09d1['model'];if(!_0x5861c2[_0x1716('0x35')][_0x1716('0x3d')](_0x1716('0x3e'))){_0x282cac['limit']=qs[_0x1716('0x1f')](_0x5861c2[_0x1716('0x35')]['limit']);_0x282cac[_0x1716('0x1d')]=qs[_0x1716('0x1d')](_0x5861c2[_0x1716('0x35')]['offset']);}_0x282cac[_0x1716('0x3f')]=qs[_0x1716('0x40')](_0x5861c2['query'][_0x1716('0x40')]);_0x282cac[_0x1716('0x41')]=qs[_0x1716('0x37')](_[_0x1716('0x42')](_0x5861c2['query'],_0x5e09d1[_0x1716('0x37')]),_0x38c64b);if(_0x5861c2[_0x1716('0x35')][_0x1716('0x43')]){_0x282cac['where']=_['merge'](_0x282cac[_0x1716('0x41')],{'$or':_[_0x1716('0x34')](_0x38c64b,function(_0x5619fc){if(_0x5619fc['type']!==_0x1716('0x44')){var _0x2a02ea={};_0x2a02ea[_0x5619fc['name']]={'$like':'%'+_0x5861c2[_0x1716('0x35')][_0x1716('0x43')]+'%'};return _0x2a02ea;}})});}_0x282cac=_[_0x1716('0x45')]({},_0x282cac,_0x5861c2[_0x1716('0x46')]);var _0x58dea2={'where':_0x282cac[_0x1716('0x41')]};return db[_0x1716('0x2f')][_0x1716('0x20')](_0x58dea2)[_0x1716('0x26')](function(_0x452d48){_0x41c019[_0x1716('0x20')]=_0x452d48;if(_0x5861c2[_0x1716('0x35')]['includeAll']){_0x282cac[_0x1716('0x47')]=[{'all':!![]}];}return db[_0x1716('0x2f')][_0x1716('0x48')](_0x282cac);})[_0x1716('0x26')](function(_0x49fb11){_0x41c019[_0x1716('0x49')]=_0x49fb11;return _0x41c019;})['then'](respondWithFilteredResult(_0x305225,_0x282cac))[_0x1716('0x4a')](handleError(_0x305225,null));};exports[_0x1716('0x4b')]=function(_0x6d71ac,_0x347b3c){var _0x131b92={'raw':![],'where':{'id':_0x6d71ac['params']['id']}},_0x5e8822={};_0x5e8822[_0x1716('0x39')]=_[_0x1716('0x36')](db[_0x1716('0x2f')]['rawAttributes']);_0x5e8822['query']=_[_0x1716('0x36')](_0x6d71ac[_0x1716('0x35')]);_0x5e8822[_0x1716('0x37')]=_[_0x1716('0x38')](_0x5e8822[_0x1716('0x39')],_0x5e8822['query']);_0x131b92[_0x1716('0x3b')]=_[_0x1716('0x38')](_0x5e8822[_0x1716('0x39')],qs['fields'](_0x6d71ac['query'][_0x1716('0x3a')]));_0x131b92[_0x1716('0x3b')]=_0x131b92['attributes']['length']?_0x131b92[_0x1716('0x3b')]:_0x5e8822[_0x1716('0x39')];if(_0x6d71ac['query'][_0x1716('0x4c')]){_0x131b92[_0x1716('0x47')]=[{'all':!![]}];}_0x131b92=_['merge']({},_0x131b92,_0x6d71ac[_0x1716('0x46')]);return db[_0x1716('0x2f')]['find'](_0x131b92)[_0x1716('0x26')](handleEntityNotFound(_0x347b3c,null))[_0x1716('0x26')](respondWithResult(_0x347b3c,null))['catch'](handleError(_0x347b3c,null));};exports[_0x1716('0x4d')]=function(_0x2dd804,_0x174324){return db[_0x1716('0x2f')]['create'](_0x2dd804['body'],{})['then'](function(_0x5577e3){var _0x9846a8=_0x2dd804[_0x1716('0x4e')][_0x1716('0x27')]({'plain':!![]});if(!_0x9846a8)throw new Error(_0x1716('0x4f'));if(_0x9846a8[_0x1716('0x50')]===_0x1716('0x4e')){var _0x44d166=_0x5577e3[_0x1716('0x27')]({'plain':!![]});var _0x31e2c2=_0x1716('0x51');return db[_0x1716('0x52')]['find']({'where':{'name':_0x31e2c2,'userProfileId':_0x9846a8[_0x1716('0x53')]},'raw':!![]})[_0x1716('0x26')](function(_0x257481){if(_0x257481&&_0x257481[_0x1716('0x54')]===0x0){return db[_0x1716('0x28')][_0x1716('0x4d')]({'name':_0x44d166[_0x1716('0x2c')],'resourceId':_0x44d166['id'],'type':_0x257481[_0x1716('0x2c')],'sectionId':_0x257481['id']},{})[_0x1716('0x26')](function(){return _0x5577e3;});}else{return _0x5577e3;}})['catch'](function(_0x1284f7){logger[_0x1716('0x2a')](_0x1716('0x55'),_0x1284f7);throw _0x1284f7;});}return _0x5577e3;})[_0x1716('0x26')](respondWithResult(_0x174324,0xc9))[_0x1716('0x4a')](handleError(_0x174324,null));};exports['update']=function(_0x167470,_0x29d052){if(_0x167470[_0x1716('0x56')]['id']){delete _0x167470[_0x1716('0x56')]['id'];}return db[_0x1716('0x2f')][_0x1716('0x57')]({'where':{'id':_0x167470[_0x1716('0x58')]['id']}})[_0x1716('0x26')](handleEntityNotFound(_0x29d052,null))[_0x1716('0x26')](saveUpdates(_0x167470[_0x1716('0x56')],null))[_0x1716('0x26')](respondWithResult(_0x29d052,null))[_0x1716('0x4a')](handleError(_0x29d052,null));};exports['destroy']=function(_0x3ee412,_0x494679){return db[_0x1716('0x2f')]['find']({'where':{'id':_0x3ee412[_0x1716('0x58')]['id']}})['then'](handleEntityNotFound(_0x494679,null))['then'](removeEntity(_0x494679,null))[_0x1716('0x4a')](handleError(_0x494679,null));};exports[_0x1716('0x59')]=function(_0x35b34c,_0x4a7a30,_0x24d5b1){var _0x3a3cc8=require('../../config/schedule');return db[_0x1716('0x2f')][_0x1716('0x57')]({'where':{'id':_0x35b34c[_0x1716('0x58')]['id']},'raw':!![]})[_0x1716('0x26')](handleEntityNotFound(_0x4a7a30,null))[_0x1716('0x26')](function(){_0x3a3cc8['run'](_0x35b34c[_0x1716('0x58')]['id']);})[_0x1716('0x26')](respondWithStatusCode(_0x4a7a30,null))['catch'](handleError(_0x4a7a30,null));};
\ No newline at end of file
index 56442fd..83cba7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b95=['bluebird','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','util','../../config/logger','api'];(function(_0x4beed0,_0x148a13){var _0x174e04=function(_0xe437ef){while(--_0xe437ef){_0x4beed0['push'](_0x4beed0['shift']());}};_0x174e04(++_0x148a13);}(_0x2b95,0x1d1));var _0x52b9=function(_0x54f7c0,_0x27af83){_0x54f7c0=_0x54f7c0-0x0;var _0x245d03=_0x2b95[_0x54f7c0];return _0x245d03;};'use strict';var _=require('lodash');var util=require(_0x52b9('0x0'));var logger=require(_0x52b9('0x1'))(_0x52b9('0x2'));var moment=require('moment');var BPromise=require(_0x52b9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x52b9('0x4'));var attributes=require(_0x52b9('0x5'));module[_0x52b9('0x6')]=function(_0xc2ce82,_0x6af1bc){return _0xc2ce82['define'](_0x52b9('0x7'),attributes,{'tableName':_0x52b9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0da0=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Schedule'];(function(_0x1e09a1,_0x1c14f9){var _0x24ac77=function(_0x272fa1){while(--_0x272fa1){_0x1e09a1['push'](_0x1e09a1['shift']());}};_0x24ac77(++_0x1c14f9);}(_0x0da0,0x1ec));var _0x00da=function(_0x3581bf,_0x51eea2){_0x3581bf=_0x3581bf-0x0;var _0x17944a=_0x0da0[_0x3581bf];return _0x17944a;};'use strict';var _=require(_0x00da('0x0'));var util=require(_0x00da('0x1'));var logger=require(_0x00da('0x2'))(_0x00da('0x3'));var moment=require(_0x00da('0x4'));var BPromise=require(_0x00da('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x00da('0x6'));var rimraf=require(_0x00da('0x7'));var config=require(_0x00da('0x8'));var attributes=require('./schedule.attributes');module[_0x00da('0x9')]=function(_0x2fa778,_0x5af3da){return _0x2fa778[_0x00da('0xa')](_0x00da('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0b1b3a5..15e4c4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebd7=['jayson/promise','client','http','info','request\x20sent','debug','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x326124,_0x1fc78a){var _0x19c552=function(_0x30a0d3){while(--_0x30a0d3){_0x326124['push'](_0x326124['shift']());}};_0x19c552(++_0x1fc78a);}(_0xebd7,0x11d));var _0x7ebd=function(_0x299673,_0x2c3b4e){_0x299673=_0x299673-0x0;var _0x233e61=_0xebd7[_0x299673];return _0x233e61;};'use strict';var _=require('lodash');var util=require(_0x7ebd('0x0'));var moment=require(_0x7ebd('0x1'));var BPromise=require(_0x7ebd('0x2'));var rs=require(_0x7ebd('0x3'));var fs=require('fs');var Redis=require(_0x7ebd('0x4'));var db=require(_0x7ebd('0x5'))['db'];var utils=require(_0x7ebd('0x6'));var logger=require(_0x7ebd('0x7'))('rpc');var config=require(_0x7ebd('0x8'));var jayson=require(_0x7ebd('0x9'));var client=jayson[_0x7ebd('0xa')][_0x7ebd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46c715,_0x490ed9,_0x44c673){return new BPromise(function(_0x418f71,_0x911055){return client['request'](_0x46c715,_0x44c673)['then'](function(_0xa53984){logger[_0x7ebd('0xc')]('Schedule,\x20%s,\x20%s',_0x490ed9,_0x7ebd('0xd'));logger[_0x7ebd('0xe')]('Schedule,\x20%s,\x20%s,\x20%s',_0x490ed9,_0x7ebd('0xd'),JSON[_0x7ebd('0xf')](_0xa53984));if(_0xa53984[_0x7ebd('0x10')]){if(_0xa53984['error'][_0x7ebd('0x11')]===0x1f4){logger[_0x7ebd('0x10')](_0x7ebd('0x12'),_0x490ed9,_0xa53984[_0x7ebd('0x10')][_0x7ebd('0x13')]);return _0x911055(_0xa53984[_0x7ebd('0x10')][_0x7ebd('0x13')]);}logger[_0x7ebd('0x10')](_0x7ebd('0x12'),_0x490ed9,_0xa53984['error']['message']);return _0x418f71(_0xa53984[_0x7ebd('0x10')][_0x7ebd('0x13')]);}else{logger[_0x7ebd('0xc')]('Schedule,\x20%s,\x20%s',_0x490ed9,'request\x20sent');_0x418f71(_0xa53984[_0x7ebd('0x14')][_0x7ebd('0x13')]);}})['catch'](function(_0x47a7af){logger['error']('Schedule,\x20%s,\x20%s',_0x490ed9,_0x47a7af);_0x911055(_0x47a7af);});});}
\ No newline at end of file
+var _0xa693=['error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5f543f,_0x24f34f){var _0x3c2274=function(_0x419b82){while(--_0x419b82){_0x5f543f['push'](_0x5f543f['shift']());}};_0x3c2274(++_0x24f34f);}(_0xa693,0x1cb));var _0x3a69=function(_0x4ab99,_0x219ed2){_0x4ab99=_0x4ab99-0x0;var _0x29e39c=_0xa693[_0x4ab99];return _0x29e39c;};'use strict';var _=require(_0x3a69('0x0'));var util=require('util');var moment=require(_0x3a69('0x1'));var BPromise=require(_0x3a69('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a69('0x3'));var db=require(_0x3a69('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a69('0x5'));var config=require('../../config/environment');var jayson=require(_0x3a69('0x6'));var client=jayson[_0x3a69('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x663d47,_0x4b719c,_0x4f818e){return new BPromise(function(_0xfcd525,_0x34d16f){return client[_0x3a69('0x8')](_0x663d47,_0x4f818e)[_0x3a69('0x9')](function(_0x61f41c){logger[_0x3a69('0xa')](_0x3a69('0xb'),_0x4b719c,_0x3a69('0xc'));logger[_0x3a69('0xd')](_0x3a69('0xe'),_0x4b719c,_0x3a69('0xc'),JSON[_0x3a69('0xf')](_0x61f41c));if(_0x61f41c[_0x3a69('0x10')]){if(_0x61f41c[_0x3a69('0x10')]['code']===0x1f4){logger[_0x3a69('0x10')]('Schedule,\x20%s,\x20%s',_0x4b719c,_0x61f41c[_0x3a69('0x10')][_0x3a69('0x11')]);return _0x34d16f(_0x61f41c[_0x3a69('0x10')]['message']);}logger['error']('Schedule,\x20%s,\x20%s',_0x4b719c,_0x61f41c[_0x3a69('0x10')][_0x3a69('0x11')]);return _0xfcd525(_0x61f41c[_0x3a69('0x10')][_0x3a69('0x11')]);}else{logger[_0x3a69('0xa')](_0x3a69('0xb'),_0x4b719c,_0x3a69('0xc'));_0xfcd525(_0x61f41c[_0x3a69('0x12')][_0x3a69('0x11')]);}})['catch'](function(_0x19ff51){logger[_0x3a69('0x10')]('Schedule,\x20%s,\x20%s',_0x4b719c,_0x19ff51);_0x34d16f(_0x19ff51);});});}
\ No newline at end of file
index 6e25e71..94b74a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f29=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','create','put','update','delete','destroy'];(function(_0x538491,_0x5f1a97){var _0x1f7483=function(_0x4c02f0){while(--_0x4c02f0){_0x538491['push'](_0x538491['shift']());}};_0x1f7483(++_0x5f1a97);}(_0x0f29,0x12c));var _0x90f2=function(_0x242a9c,_0x6d35fd){_0x242a9c=_0x242a9c-0x0;var _0x53d1e6=_0x0f29[_0x242a9c];return _0x53d1e6;};'use strict';var multer=require(_0x90f2('0x0'));var util=require(_0x90f2('0x1'));var path=require(_0x90f2('0x2'));var timeout=require(_0x90f2('0x3'));var express=require(_0x90f2('0x4'));var router=express[_0x90f2('0x5')]();var fs_extra=require(_0x90f2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x90f2('0x7'));var controller=require(_0x90f2('0x8'));router[_0x90f2('0x9')]('/',auth[_0x90f2('0xa')](),controller[_0x90f2('0xb')]);router[_0x90f2('0x9')](_0x90f2('0xc'),auth[_0x90f2('0xa')](),controller[_0x90f2('0xd')]);router[_0x90f2('0x9')](_0x90f2('0xe'),auth['isAuthenticated'](),controller[_0x90f2('0xf')]);router['get']('/:id/download',auth[_0x90f2('0xa')](),controller[_0x90f2('0x10')]);router['post']('/',auth[_0x90f2('0xa')](),controller[_0x90f2('0x11')]);router[_0x90f2('0x12')](_0x90f2('0xe'),auth[_0x90f2('0xa')](),controller[_0x90f2('0x13')]);router[_0x90f2('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x90f2('0x15')]);module[_0x90f2('0x16')]=router;
\ No newline at end of file
+var _0x08d7=['post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/describe','show','/:id/download'];(function(_0x13fcd2,_0x4765b5){var _0x205d2a=function(_0x22472d){while(--_0x22472d){_0x13fcd2['push'](_0x13fcd2['shift']());}};_0x205d2a(++_0x4765b5);}(_0x08d7,0x161));var _0x708d=function(_0x169124,_0x2d98b5){_0x169124=_0x169124-0x0;var _0x3ee0d3=_0x08d7[_0x169124];return _0x3ee0d3;};'use strict';var multer=require(_0x708d('0x0'));var util=require(_0x708d('0x1'));var path=require(_0x708d('0x2'));var timeout=require(_0x708d('0x3'));var express=require(_0x708d('0x4'));var router=express[_0x708d('0x5')]();var fs_extra=require(_0x708d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x708d('0x7'));var controller=require(_0x708d('0x8'));router['get']('/',auth[_0x708d('0x9')](),controller[_0x708d('0xa')]);router[_0x708d('0xb')](_0x708d('0xc'),auth[_0x708d('0x9')](),controller['describe']);router[_0x708d('0xb')]('/:id',auth[_0x708d('0x9')](),controller[_0x708d('0xd')]);router[_0x708d('0xb')](_0x708d('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x708d('0xf')]('/',auth['isAuthenticated'](),controller[_0x708d('0x10')]);router[_0x708d('0x11')]('/:id',auth[_0x708d('0x9')](),controller[_0x708d('0x12')]);router[_0x708d('0x13')](_0x708d('0x14'),auth[_0x708d('0x9')](),controller[_0x708d('0x15')]);module[_0x708d('0x16')]=router;
\ No newline at end of file
index 880cbf0..2d4a83f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b74=['moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','subtract','duration','DATE','startedAt','format','toString','closedAt','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x4b74,0x103));var _0x44b7=function(_0x4180d4,_0xf52c72){_0x4180d4=_0x4180d4-0x0;var _0x60df3a=_0x4b74[_0x4180d4];return _0x60df3a;};'use strict';var Sequelize=require(_0x44b7('0x0'));var moment=require(_0x44b7('0x1'));var path=require(_0x44b7('0x2'));var config=require('../../config/environment');module[_0x44b7('0x3')]={'format':{'type':Sequelize[_0x44b7('0x4')],'get':function(){return this[_0x44b7('0x5')](_0x44b7('0x6'))?path[_0x44b7('0x7')](this[_0x44b7('0x5')](_0x44b7('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x44b7('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x44b7('0x8')],'set':function(_0x2174f2){var _0x7b80e9=_0x2174f2['replace'](/\\/g,'/');this[_0x44b7('0x9')](_0x44b7('0x6'),_0x7b80e9);}},'rating':{'type':Sequelize[_0x44b7('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x7d4b17){this[_0x44b7('0x9')]('startedAt',moment()[_0x44b7('0xb')](_0x7d4b17,'ms'));this[_0x44b7('0x9')]('closedAt',moment());this[_0x44b7('0x9')](_0x44b7('0xc'),_0x7d4b17);}},'startedAt':{'type':Sequelize[_0x44b7('0xd')],'get':function(){return moment(this['getDataValue'](_0x44b7('0xe')))[_0x44b7('0xf')]('MM-DD-YYYY\x20HH:mm')[_0x44b7('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x44b7('0x5')](_0x44b7('0x11')))[_0x44b7('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x44b7('0xd')],'get':function(){return moment(this['getDataValue']('createdAt'))['format'](_0x44b7('0x12'))[_0x44b7('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x44b7('0x5')](_0x44b7('0x13')))[_0x44b7('0xf')](_0x44b7('0x12'))[_0x44b7('0x10')]();}}};
\ No newline at end of file
+var _0xaebd=['subtract','closedAt','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','INTEGER','setDataValue'];(function(_0x270adc,_0x5d1571){var _0x36e943=function(_0x250649){while(--_0x250649){_0x270adc['push'](_0x270adc['shift']());}};_0x36e943(++_0x5d1571);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x39563a,_0x3d0341){_0x39563a=_0x39563a-0x0;var _0x399594=_0xaebd[_0x39563a];return _0x399594;};'use strict';var Sequelize=require(_0xdaeb('0x0'));var moment=require('moment');var path=require(_0xdaeb('0x1'));var config=require(_0xdaeb('0x2'));module[_0xdaeb('0x3')]={'format':{'type':Sequelize[_0xdaeb('0x4')],'get':function(){return this[_0xdaeb('0x5')]('value')?path[_0xdaeb('0x6')](this[_0xdaeb('0x5')](_0xdaeb('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xdaeb('0x8')]},'channel':{'type':Sequelize[_0xdaeb('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x3ea090){var _0x3f7ba1=_0x3ea090['replace'](/\\/g,'/');this['setDataValue'](_0xdaeb('0x7'),_0x3f7ba1);}},'rating':{'type':Sequelize[_0xdaeb('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdaeb('0x9')],'set':function(_0x5e0ae9){this[_0xdaeb('0xa')]('startedAt',moment()[_0xdaeb('0xb')](_0x5e0ae9,'ms'));this['setDataValue'](_0xdaeb('0xc'),moment());this['setDataValue'](_0xdaeb('0xd'),_0x5e0ae9);}},'startedAt':{'type':Sequelize[_0xdaeb('0xe')],'get':function(){return moment(this['getDataValue']('startedAt'))[_0xdaeb('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xdaeb('0x10')]();}},'closedAt':{'type':Sequelize[_0xdaeb('0xe')],'get':function(){return moment(this[_0xdaeb('0x5')](_0xdaeb('0xc')))[_0xdaeb('0xf')](_0xdaeb('0x11'))[_0xdaeb('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xdaeb('0x12')))[_0xdaeb('0xf')](_0xdaeb('0x11'))[_0xdaeb('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xdaeb('0x13')))['format']('MM-DD-YYYY\x20HH:mm')[_0xdaeb('0x10')]();}}};
\ No newline at end of file
index 1a7e395..477a624 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['apply','then','error','name','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','count','includeAll','include','findAll','catch','show','find','create','body','update','duration','closedAt','value','params','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','filename','download','extname','unlink','Not\x20found','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','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','offset','limit','set','Content-Range'];(function(_0x5ed2d7,_0x3932dc){var _0x5ac312=function(_0x10f1f2){while(--_0x10f1f2){_0x5ed2d7['push'](_0x5ed2d7['shift']());}};_0x5ac312(++_0x3932dc);}(_0x2d17,0x17e));var _0x72d1=function(_0x5d12f4,_0x1cefe4){_0x5d12f4=_0x5d12f4-0x0;var _0x231322=_0x2d17[_0x5d12f4];return _0x231322;};'use strict';var emlformat=require(_0x72d1('0x0'));var rimraf=require(_0x72d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72d1('0x2'));var rp=require(_0x72d1('0x3'));var moment=require('moment');var BPromise=require(_0x72d1('0x4'));var Mustache=require(_0x72d1('0x5'));var util=require('util');var path=require(_0x72d1('0x6'));var sox=require('sox');var csv=require(_0x72d1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72d1('0x8'));var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var licenseUtil=require(_0x72d1('0x17'));var db=require(_0x72d1('0x18'))['db'];function respondWithStatusCode(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xcc;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0x19')](_0x5ad4df);}return _0x2f5a78[_0x72d1('0x1a')](_0x5ad4df)[_0x72d1('0x1b')]();};}function respondWithResult(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0xc8;return function(_0x143718){if(_0x143718){return _0x22ac6f[_0x72d1('0x1a')](_0x685a27)[_0x72d1('0x1c')](_0x143718);}};}function respondWithFilteredResult(_0x3f190f,_0x21c85e){return function(_0x23a238){if(_0x23a238){var _0x8d458=typeof _0x21c85e['offset']===_0x72d1('0x1d')&&typeof _0x21c85e['limit']===_0x72d1('0x1d');var _0x2c9851=_0x23a238['count'];var _0x1061b7=_0x8d458?0x0:_0x21c85e[_0x72d1('0x1e')];var _0x1ca18d=_0x8d458?_0x23a238['count']:_0x21c85e['offset']+_0x21c85e[_0x72d1('0x1f')];var _0x10d464;if(_0x1ca18d>=_0x2c9851){_0x1ca18d=_0x2c9851;_0x10d464=0xc8;}else{_0x10d464=0xce;}_0x3f190f[_0x72d1('0x1a')](_0x10d464);return _0x3f190f[_0x72d1('0x20')](_0x72d1('0x21'),_0x1061b7+'-'+_0x1ca18d+'/'+_0x2c9851)[_0x72d1('0x1c')](_0x23a238);}return null;};}function patchUpdates(_0x1e2411){return function(_0x5c7982){try{jsonpatch[_0x72d1('0x22')](_0x5c7982,_0x1e2411,!![]);}catch(_0x56e8d3){return BPromise['reject'](_0x56e8d3);}return _0x5c7982['save']();};}function saveUpdates(_0x585243,_0x445985){return function(_0x374602){if(_0x374602){return _0x374602['update'](_0x585243)[_0x72d1('0x23')](function(_0x256dc1){return _0x256dc1;});}return null;};}function removeEntity(_0x492086,_0x1431ee){return function(_0x26fa35){if(_0x26fa35){return _0x26fa35['destroy']()['then'](function(){_0x492086[_0x72d1('0x1a')](0xcc)[_0x72d1('0x1b')]();});}};}function handleEntityNotFound(_0x2f661,_0x2f879f){return function(_0xdf6a69){if(!_0xdf6a69){_0x2f661[_0x72d1('0x19')](0x194);}return _0xdf6a69;};}function handleError(_0x163bec,_0x589f7c){_0x589f7c=_0x589f7c||0x1f4;return function(_0x57ec9e){logger[_0x72d1('0x24')](_0x57ec9e['stack']);if(_0x57ec9e[_0x72d1('0x25')]){delete _0x57ec9e[_0x72d1('0x25')];}_0x163bec[_0x72d1('0x1a')](_0x589f7c)['send'](_0x57ec9e);};}exports[_0x72d1('0x26')]=function(_0x4c4c41,_0x707cd0){var _0x20055f={},_0x32588f={},_0x2cc0c8={'count':0x0,'rows':[]};var _0x51242b=_[_0x72d1('0x27')](db['ScreenRecording'][_0x72d1('0x28')],function(_0x32dc5e){return{'name':_0x32dc5e['fieldName'],'type':_0x32dc5e[_0x72d1('0x29')][_0x72d1('0x2a')]};});_0x32588f[_0x72d1('0x2b')]=_[_0x72d1('0x2c')](_[_0x72d1('0x27')](_0x51242b,'name'),[_0x72d1('0x2d')]);_0x32588f[_0x72d1('0x2e')]=_[_0x72d1('0x2f')](_0x4c4c41['query']);_0x32588f[_0x72d1('0x30')]=_[_0x72d1('0x31')](_0x32588f['model'],_0x32588f[_0x72d1('0x2e')]);_0x20055f[_0x72d1('0x32')]=_[_0x72d1('0x31')](_0x32588f['model'],qs[_0x72d1('0x33')](_0x4c4c41['query'][_0x72d1('0x33')]));_0x20055f[_0x72d1('0x32')]=_0x20055f[_0x72d1('0x32')][_0x72d1('0x34')]?_0x20055f[_0x72d1('0x32')]:_0x32588f[_0x72d1('0x2b')];if(!_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x35')](_0x72d1('0x36'))){_0x20055f[_0x72d1('0x1f')]=qs[_0x72d1('0x1f')](_0x4c4c41['query'][_0x72d1('0x1f')]);_0x20055f[_0x72d1('0x1e')]=qs[_0x72d1('0x1e')](_0x4c4c41[_0x72d1('0x2e')]['offset']);}_0x20055f[_0x72d1('0x37')]=qs[_0x72d1('0x38')](_0x4c4c41[_0x72d1('0x2e')]['sort']);_0x20055f[_0x72d1('0x39')]=qs[_0x72d1('0x30')](_[_0x72d1('0x3a')](_0x4c4c41['query'],_0x32588f[_0x72d1('0x30')]),_0x51242b);if(_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x3b')]){_0x20055f['where']=_[_0x72d1('0x3c')](_0x20055f[_0x72d1('0x39')],{'$or':_[_0x72d1('0x27')](_0x51242b,function(_0x14cb3d){if(_0x14cb3d[_0x72d1('0x29')]!==_0x72d1('0x3d')){var _0xd7ec0f={};_0xd7ec0f[_0x14cb3d['name']]={'$like':'%'+_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x3b')]+'%'};return _0xd7ec0f;}})});}_0x20055f=_[_0x72d1('0x3c')]({},_0x20055f,_0x4c4c41[_0x72d1('0x3e')]);var _0x20fb2f={'where':_0x20055f[_0x72d1('0x39')]};return db[_0x72d1('0x3f')][_0x72d1('0x40')](_0x20fb2f)['then'](function(_0x44d5b2){_0x2cc0c8[_0x72d1('0x40')]=_0x44d5b2;if(_0x4c4c41[_0x72d1('0x2e')][_0x72d1('0x41')]){_0x20055f[_0x72d1('0x42')]=[{'all':!![]}];}return db[_0x72d1('0x3f')][_0x72d1('0x43')](_0x20055f);})[_0x72d1('0x23')](function(_0x5620f0){_0x2cc0c8['rows']=_0x5620f0;return _0x2cc0c8;})[_0x72d1('0x23')](respondWithFilteredResult(_0x707cd0,_0x20055f))[_0x72d1('0x44')](handleError(_0x707cd0,null));};exports[_0x72d1('0x45')]=function(_0x21d361,_0x5a6bc4){var _0x3fe286={'raw':![],'where':{'id':_0x21d361['params']['id']}},_0x3e80e0={};_0x3e80e0[_0x72d1('0x2b')]=_['keys'](db[_0x72d1('0x3f')][_0x72d1('0x28')]);_0x3e80e0['query']=_[_0x72d1('0x2f')](_0x21d361['query']);_0x3e80e0['filters']=_['intersection'](_0x3e80e0[_0x72d1('0x2b')],_0x3e80e0['query']);_0x3fe286[_0x72d1('0x32')]=_[_0x72d1('0x31')](_0x3e80e0[_0x72d1('0x2b')],qs['fields'](_0x21d361['query'][_0x72d1('0x33')]));_0x3fe286['attributes']=_0x3fe286['attributes'][_0x72d1('0x34')]?_0x3fe286[_0x72d1('0x32')]:_0x3e80e0[_0x72d1('0x2b')];if(_0x21d361['query']['includeAll']){_0x3fe286['include']=[{'all':!![]}];}_0x3fe286=_['merge']({},_0x3fe286,_0x21d361[_0x72d1('0x3e')]);return db[_0x72d1('0x3f')][_0x72d1('0x46')](_0x3fe286)[_0x72d1('0x23')](handleEntityNotFound(_0x5a6bc4,null))[_0x72d1('0x23')](respondWithResult(_0x5a6bc4,null))[_0x72d1('0x44')](handleError(_0x5a6bc4,null));};exports[_0x72d1('0x47')]=function(_0x5924c,_0x1e2c11){return db['ScreenRecording'][_0x72d1('0x47')](_0x5924c[_0x72d1('0x48')],{})[_0x72d1('0x23')](respondWithResult(_0x1e2c11,0xc9))['catch'](handleError(_0x1e2c11,null));};exports[_0x72d1('0x49')]=function(_0x29c88f,_0x12ad75){if(_0x29c88f['body']['id']){delete _0x29c88f[_0x72d1('0x48')]['id'];}delete _0x29c88f[_0x72d1('0x48')][_0x72d1('0x4a')];delete _0x29c88f[_0x72d1('0x48')]['createdAt'];delete _0x29c88f['body'][_0x72d1('0x4b')];delete _0x29c88f[_0x72d1('0x48')][_0x72d1('0x4c')];return db['ScreenRecording'][_0x72d1('0x46')]({'where':{'id':_0x29c88f[_0x72d1('0x4d')]['id']}})[_0x72d1('0x23')](handleEntityNotFound(_0x12ad75,null))[_0x72d1('0x23')](saveUpdates(_0x29c88f[_0x72d1('0x48')],null))[_0x72d1('0x23')](respondWithResult(_0x12ad75,null))[_0x72d1('0x44')](handleError(_0x12ad75,null));};exports[_0x72d1('0x4e')]=function(_0x12870c,_0x18f986){return db[_0x72d1('0x3f')]['describe']()[_0x72d1('0x23')](respondWithResult(_0x18f986,null))['catch'](handleError(_0x18f986,null));};exports['download']=function(_0x356196,_0x5f2bba,_0x3c880e){var _0x7e401b=require(_0x72d1('0x4f'));var _0x162248=![];var _0x473a7b={};if(_0x356196[_0x72d1('0x2e')][_0x72d1('0x29')]&&_0x356196[_0x72d1('0x2e')][_0x72d1('0x29')]===_0x72d1('0x50')){_0x473a7b[_0x72d1('0x50')]=_0x356196['params']['id'];}else{_0x473a7b['id']=_0x356196[_0x72d1('0x4d')]['id'];}return db[_0x72d1('0x3f')][_0x72d1('0x46')]({'where':_0x473a7b,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x5f2bba,null))[_0x72d1('0x23')](function(_0x140f0b){if(_0x140f0b){var _0x16e9e7=path[_0x72d1('0x51')](config[_0x72d1('0x52')],'server/files/screen_recordings',_0x140f0b[_0x72d1('0x4c')]);var _0x48f4a7=util[_0x72d1('0x2d')](_0x72d1('0x53'),_0x16e9e7);if(fs[_0x72d1('0x54')](_0x48f4a7)){_0x162248=!![];return _0x7e401b[_0x72d1('0x55')](_0x48f4a7,_0x16e9e7,config[_0x72d1('0x56')][_0x72d1('0x57')])[_0x72d1('0x23')](function(){return _0x140f0b;});}return _0x140f0b;}})[_0x72d1('0x23')](function(_0x384f0a){if(_0x384f0a){var _0x3a2dfe=path[_0x72d1('0x51')](config[_0x72d1('0x52')],_0x72d1('0x58'),_0x384f0a[_0x72d1('0x4c')]);if(!fs[_0x72d1('0x54')](_0x3a2dfe)){throw new db[(_0x72d1('0x59'))][(_0x72d1('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x384f0a[_0x72d1('0x5b')]){return _0x5f2bba[_0x72d1('0x5c')](_0x3a2dfe,_0x384f0a[_0x72d1('0x5b')]+path[_0x72d1('0x5d')](_0x3a2dfe),function(){if(_0x162248){fs[_0x72d1('0x5e')](_0x3a2dfe);}});}else{return _0x5f2bba[_0x72d1('0x5c')](_0x3a2dfe,function(_0x4e2d85){if(_0x162248){fs[_0x72d1('0x5e')](_0x3a2dfe);}});}}})[_0x72d1('0x44')](function(_0xb05cd9){if(_0xb05cd9['message']==='ScreenRecording\x20not\x20found'){_0x5f2bba[_0x72d1('0x1a')](0x194)['send'](_0x72d1('0x5f'));}else{return handleError(_0x5f2bba,null);}});};exports[_0x72d1('0x60')]=function(_0x201810,_0x41525c){return db[_0x72d1('0x3f')][_0x72d1('0x46')]({'where':{'id':_0x201810[_0x72d1('0x4d')]['id']}})[_0x72d1('0x23')](function(_0x28e42b){if(_['isNil'](_0x28e42b)){throw new ReferenceError('Entity\x20not\x20found');}return _0x28e42b;})[_0x72d1('0x23')](function(_0x1d44f0){var _0x1bd80b=path['join'](config[_0x72d1('0x52')],_0x72d1('0x58'),_0x1d44f0['value']);logger[_0x72d1('0x61')](_0x72d1('0x62'),_0x1bd80b);if(!_[_0x72d1('0x63')](_0x1d44f0[_0x72d1('0x4c')])&&fs[_0x72d1('0x54')](_0x1bd80b)){logger[_0x72d1('0x61')](_0x72d1('0x64')+_0x1bd80b+_0x72d1('0x65'));fs[_0x72d1('0x66')](_0x1bd80b);}_0x1bd80b=_0x1bd80b+_0x72d1('0x67');if(!_[_0x72d1('0x63')](_0x1d44f0[_0x72d1('0x4c')])&&fs['existsSync'](_0x1bd80b)){logger['info'](_0x72d1('0x64')+_0x1bd80b+_0x72d1('0x65'));fs[_0x72d1('0x66')](_0x1bd80b);}return _0x1d44f0;})[_0x72d1('0x23')](function(_0x2ae8c9){if(!_0x2ae8c9)throw new InternalError();return _0x2ae8c9[_0x72d1('0x60')]();})[_0x72d1('0x23')](function(){_0x41525c[_0x72d1('0x1a')](0xcc)['end']();})[_0x72d1('0x44')](handleError(_0x41525c,null));};
\ No newline at end of file
+var _0xd6d6=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','catch','find','create','body','duration','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2db47c,_0x463fd0){var _0x18aa24=function(_0x4544f1){while(--_0x4544f1){_0x2db47c['push'](_0x2db47c['shift']());}};_0x18aa24(++_0x463fd0);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2faf6c,_0x9abbf0){_0x2faf6c=_0x2faf6c-0x0;var _0x2b6275=_0xd6d6[_0x2faf6c];return _0x2b6275;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0xf0df7f,_0x12fab2){return function(_0x554f8e){if(!_0x554f8e){_0xf0df7f[_0x6d6d('0x19')](0x194);}return _0x554f8e;};}function handleError(_0x2b5e31,_0x235451){_0x235451=_0x235451||0x1f4;return function(_0x126ac8){logger[_0x6d6d('0x29')](_0x126ac8[_0x6d6d('0x2a')]);if(_0x126ac8[_0x6d6d('0x2b')]){delete _0x126ac8['name'];}_0x2b5e31[_0x6d6d('0x1a')](_0x235451)[_0x6d6d('0x2c')](_0x126ac8);};}exports['index']=function(_0x553645,_0x3edcce){var _0x5273cd={},_0x8a9a84={},_0x57341f={'count':0x0,'rows':[]};var _0xde3272=_[_0x6d6d('0x2d')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')],function(_0x64d1f7){return{'name':_0x64d1f7[_0x6d6d('0x30')],'type':_0x64d1f7[_0x6d6d('0x31')][_0x6d6d('0x32')]};});_0x8a9a84[_0x6d6d('0x33')]=_[_0x6d6d('0x34')](_['map'](_0xde3272,_0x6d6d('0x2b')),['format']);_0x8a9a84[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x553645[_0x6d6d('0x35')]);_0x8a9a84[_0x6d6d('0x37')]=_['intersection'](_0x8a9a84[_0x6d6d('0x33')],_0x8a9a84['query']);_0x5273cd[_0x6d6d('0x38')]=_[_0x6d6d('0x39')](_0x8a9a84['model'],qs[_0x6d6d('0x3a')](_0x553645[_0x6d6d('0x35')][_0x6d6d('0x3a')]));_0x5273cd[_0x6d6d('0x38')]=_0x5273cd[_0x6d6d('0x38')][_0x6d6d('0x3b')]?_0x5273cd[_0x6d6d('0x38')]:_0x8a9a84[_0x6d6d('0x33')];if(!_0x553645[_0x6d6d('0x35')][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x5273cd[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x553645[_0x6d6d('0x35')]['limit']);_0x5273cd[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x553645[_0x6d6d('0x35')][_0x6d6d('0x1f')]);}_0x5273cd['order']=qs['sort'](_0x553645[_0x6d6d('0x35')][_0x6d6d('0x3e')]);_0x5273cd[_0x6d6d('0x3f')]=qs['filters'](_[_0x6d6d('0x40')](_0x553645[_0x6d6d('0x35')],_0x8a9a84[_0x6d6d('0x37')]),_0xde3272);if(_0x553645[_0x6d6d('0x35')]['filter']){_0x5273cd['where']=_['merge'](_0x5273cd[_0x6d6d('0x3f')],{'$or':_[_0x6d6d('0x2d')](_0xde3272,function(_0x33c8f2){if(_0x33c8f2[_0x6d6d('0x31')]!=='VIRTUAL'){var _0x253416={};_0x253416[_0x33c8f2[_0x6d6d('0x2b')]]={'$like':'%'+_0x553645[_0x6d6d('0x35')][_0x6d6d('0x41')]+'%'};return _0x253416;}})});}_0x5273cd=_[_0x6d6d('0x42')]({},_0x5273cd,_0x553645[_0x6d6d('0x43')]);var _0x4b457d={'where':_0x5273cd[_0x6d6d('0x3f')]};return db[_0x6d6d('0x2e')][_0x6d6d('0x20')](_0x4b457d)[_0x6d6d('0x27')](function(_0x32275b){_0x57341f[_0x6d6d('0x20')]=_0x32275b;if(_0x553645[_0x6d6d('0x35')]['includeAll']){_0x5273cd[_0x6d6d('0x44')]=[{'all':!![]}];}return db[_0x6d6d('0x2e')][_0x6d6d('0x45')](_0x5273cd);})[_0x6d6d('0x27')](function(_0xe1aa77){_0x57341f['rows']=_0xe1aa77;return _0x57341f;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x3edcce,_0x5273cd))[_0x6d6d('0x46')](handleError(_0x3edcce,null));};exports['show']=function(_0x452de2,_0x50dc17){var _0x15bf62={'raw':![],'where':{'id':_0x452de2['params']['id']}},_0x43c03c={};_0x43c03c[_0x6d6d('0x33')]=_[_0x6d6d('0x36')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')]);_0x43c03c[_0x6d6d('0x35')]=_['keys'](_0x452de2['query']);_0x43c03c[_0x6d6d('0x37')]=_['intersection'](_0x43c03c['model'],_0x43c03c[_0x6d6d('0x35')]);_0x15bf62[_0x6d6d('0x38')]=_[_0x6d6d('0x39')](_0x43c03c['model'],qs[_0x6d6d('0x3a')](_0x452de2['query'][_0x6d6d('0x3a')]));_0x15bf62[_0x6d6d('0x38')]=_0x15bf62[_0x6d6d('0x38')][_0x6d6d('0x3b')]?_0x15bf62[_0x6d6d('0x38')]:_0x43c03c[_0x6d6d('0x33')];if(_0x452de2[_0x6d6d('0x35')]['includeAll']){_0x15bf62[_0x6d6d('0x44')]=[{'all':!![]}];}_0x15bf62=_[_0x6d6d('0x42')]({},_0x15bf62,_0x452de2[_0x6d6d('0x43')]);return db[_0x6d6d('0x2e')][_0x6d6d('0x47')](_0x15bf62)[_0x6d6d('0x27')](handleEntityNotFound(_0x50dc17,null))[_0x6d6d('0x27')](respondWithResult(_0x50dc17,null))[_0x6d6d('0x46')](handleError(_0x50dc17,null));};exports[_0x6d6d('0x48')]=function(_0x5e4c04,_0x4d78bb){return db[_0x6d6d('0x2e')][_0x6d6d('0x48')](_0x5e4c04[_0x6d6d('0x49')],{})[_0x6d6d('0x27')](respondWithResult(_0x4d78bb,0xc9))[_0x6d6d('0x46')](handleError(_0x4d78bb,null));};exports['update']=function(_0x47170d,_0x27b396){if(_0x47170d[_0x6d6d('0x49')]['id']){delete _0x47170d[_0x6d6d('0x49')]['id'];}delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4a')];delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4b')];delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4c')];delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4d')];return db['ScreenRecording'][_0x6d6d('0x47')]({'where':{'id':_0x47170d[_0x6d6d('0x4e')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x27b396,null))[_0x6d6d('0x27')](saveUpdates(_0x47170d[_0x6d6d('0x49')],null))['then'](respondWithResult(_0x27b396,null))[_0x6d6d('0x46')](handleError(_0x27b396,null));};exports[_0x6d6d('0x4f')]=function(_0x45340b,_0x4e4c3e){return db['ScreenRecording'][_0x6d6d('0x4f')]()['then'](respondWithResult(_0x4e4c3e,null))[_0x6d6d('0x46')](handleError(_0x4e4c3e,null));};exports[_0x6d6d('0x50')]=function(_0x32aaae,_0x268361,_0x4777a5){var _0x18e2de=require(_0x6d6d('0x51'));var _0x26c23a=![];var _0x1a8f33={};if(_0x32aaae[_0x6d6d('0x35')]['type']&&_0x32aaae[_0x6d6d('0x35')][_0x6d6d('0x31')]===_0x6d6d('0x52')){_0x1a8f33[_0x6d6d('0x52')]=_0x32aaae[_0x6d6d('0x4e')]['id'];}else{_0x1a8f33['id']=_0x32aaae[_0x6d6d('0x4e')]['id'];}return db[_0x6d6d('0x2e')]['find']({'where':_0x1a8f33,'attributes':['id','value'],'raw':!![]})[_0x6d6d('0x27')](handleEntityNotFound(_0x268361,null))[_0x6d6d('0x27')](function(_0x5cc644){if(_0x5cc644){var _0x3e98a0=path[_0x6d6d('0x53')](config[_0x6d6d('0x54')],_0x6d6d('0x55'),_0x5cc644[_0x6d6d('0x4d')]);var _0xc6b96e=util[_0x6d6d('0x56')](_0x6d6d('0x57'),_0x3e98a0);if(fs[_0x6d6d('0x58')](_0xc6b96e)){_0x26c23a=!![];return _0x18e2de[_0x6d6d('0x59')](_0xc6b96e,_0x3e98a0,config[_0x6d6d('0x5a')][_0x6d6d('0x5b')])[_0x6d6d('0x27')](function(){return _0x5cc644;});}return _0x5cc644;}})[_0x6d6d('0x27')](function(_0x3065ea){if(_0x3065ea){var _0x50d8dd=path[_0x6d6d('0x53')](config[_0x6d6d('0x54')],'server/files/screen_recordings',_0x3065ea[_0x6d6d('0x4d')]);if(!fs[_0x6d6d('0x58')](_0x50d8dd)){throw new db[(_0x6d6d('0x5c'))][(_0x6d6d('0x5d'))](_0x6d6d('0x5e'));}if(_0x3065ea[_0x6d6d('0x5f')]){return _0x268361[_0x6d6d('0x50')](_0x50d8dd,_0x3065ea[_0x6d6d('0x5f')]+path[_0x6d6d('0x60')](_0x50d8dd),function(){if(_0x26c23a){fs['unlink'](_0x50d8dd);}});}else{return _0x268361['download'](_0x50d8dd,function(_0x22c3a1){if(_0x26c23a){fs[_0x6d6d('0x61')](_0x50d8dd);}});}}})[_0x6d6d('0x46')](function(_0x5de33f){if(_0x5de33f['message']===_0x6d6d('0x5e')){_0x268361['status'](0x194)[_0x6d6d('0x2c')]('Not\x20found');}else{return handleError(_0x268361,null);}});};exports[_0x6d6d('0x28')]=function(_0x367a6f,_0x21f14c){return db[_0x6d6d('0x2e')][_0x6d6d('0x47')]({'where':{'id':_0x367a6f[_0x6d6d('0x4e')]['id']}})['then'](function(_0x41e576){if(_['isNil'](_0x41e576)){throw new ReferenceError(_0x6d6d('0x62'));}return _0x41e576;})['then'](function(_0x2a21d8){var _0x3e48f7=path[_0x6d6d('0x53')](config[_0x6d6d('0x54')],_0x6d6d('0x55'),_0x2a21d8[_0x6d6d('0x4d')]);logger[_0x6d6d('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x3e48f7);if(!_['isNil'](_0x2a21d8[_0x6d6d('0x4d')])&&fs['existsSync'](_0x3e48f7)){logger[_0x6d6d('0x63')]('File:\x20\x22'+_0x3e48f7+_0x6d6d('0x64'));fs[_0x6d6d('0x65')](_0x3e48f7);}_0x3e48f7=_0x3e48f7+_0x6d6d('0x66');if(!_[_0x6d6d('0x67')](_0x2a21d8[_0x6d6d('0x4d')])&&fs[_0x6d6d('0x58')](_0x3e48f7)){logger['info'](_0x6d6d('0x68')+_0x3e48f7+_0x6d6d('0x64'));fs[_0x6d6d('0x65')](_0x3e48f7);}return _0x2a21d8;})[_0x6d6d('0x27')](function(_0x1ba731){if(!_0x1ba731)throw new InternalError();return _0x1ba731[_0x6d6d('0x28')]();})[_0x6d6d('0x27')](function(){_0x21f14c['status'](0xcc)[_0x6d6d('0x1b')]();})[_0x6d6d('0x46')](handleError(_0x21f14c,null));};
\ No newline at end of file
index 28726b5..f3ed5e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f05=['rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','path'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x5f05,0x19e));var _0x55f0=function(_0x4f38f7,_0x48eb5c){_0x4f38f7=_0x4f38f7-0x0;var _0xd0d5ce=_0x5f05[_0x4f38f7];return _0xd0d5ce;};'use strict';var _=require(_0x55f0('0x0'));var util=require(_0x55f0('0x1'));var logger=require('../../config/logger')(_0x55f0('0x2'));var moment=require(_0x55f0('0x3'));var BPromise=require(_0x55f0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x55f0('0x5'));var rimraf=require(_0x55f0('0x6'));var config=require(_0x55f0('0x7'));var attributes=require(_0x55f0('0x8'));module[_0x55f0('0x9')]=function(_0x45a6f2,_0xfbd08f){return _0x45a6f2[_0x55f0('0xa')](_0x55f0('0xb'),attributes,{'tableName':_0x55f0('0xc'),'paranoid':![],'indexes':[{'name':_0x55f0('0xd'),'fields':[_0x55f0('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xae48=['define','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes'];(function(_0x251dd5,_0x498dc5){var _0x4eaa7e=function(_0x6dfb9e){while(--_0x6dfb9e){_0x251dd5['push'](_0x251dd5['shift']());}};_0x4eaa7e(++_0x498dc5);}(_0xae48,0x122));var _0x8ae4=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0xae48[_0x1af98d];return _0x3553ea;};'use strict';var _=require(_0x8ae4('0x0'));var util=require(_0x8ae4('0x1'));var logger=require(_0x8ae4('0x2'))(_0x8ae4('0x3'));var moment=require(_0x8ae4('0x4'));var BPromise=require(_0x8ae4('0x5'));var rp=require(_0x8ae4('0x6'));var fs=require('fs');var path=require(_0x8ae4('0x7'));var rimraf=require('rimraf');var config=require(_0x8ae4('0x8'));var attributes=require(_0x8ae4('0x9'));module['exports']=function(_0x40216d,_0x37e28b){return _0x40216d[_0x8ae4('0xa')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x8ae4('0xb'),'fields':[_0x8ae4('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index ed1644a..97f03f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fe5=['rpc','../../config/environment','jayson/promise','client','http','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3a864a,_0xd7ad){var _0x5cc748=function(_0x180d13){while(--_0x180d13){_0x3a864a['push'](_0x3a864a['shift']());}};_0x5cc748(++_0xd7ad);}(_0x0fe5,0x1c0));var _0x50fe=function(_0x38eae9,_0x5f38e6){_0x38eae9=_0x38eae9-0x0;var _0x598806=_0x0fe5[_0x38eae9];return _0x598806;};'use strict';var _=require(_0x50fe('0x0'));var util=require(_0x50fe('0x1'));var moment=require(_0x50fe('0x2'));var BPromise=require(_0x50fe('0x3'));var rs=require(_0x50fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50fe('0x5'))['db'];var utils=require(_0x50fe('0x6'));var logger=require(_0x50fe('0x7'))(_0x50fe('0x8'));var config=require(_0x50fe('0x9'));var jayson=require(_0x50fe('0xa'));var client=jayson[_0x50fe('0xb')][_0x50fe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58d047,_0xdc62c0,_0x2ccc3a){return new BPromise(function(_0x1c2dc9,_0x3f3947){return client['request'](_0x58d047,_0x2ccc3a)[_0x50fe('0xd')](function(_0x1e9bc5){logger['info'](_0x50fe('0xe'),_0xdc62c0,_0x50fe('0xf'));logger['debug'](_0x50fe('0x10'),_0xdc62c0,_0x50fe('0xf'),JSON[_0x50fe('0x11')](_0x1e9bc5));if(_0x1e9bc5[_0x50fe('0x12')]){if(_0x1e9bc5['error'][_0x50fe('0x13')]===0x1f4){logger[_0x50fe('0x12')]('ScreenRecording,\x20%s,\x20%s',_0xdc62c0,_0x1e9bc5[_0x50fe('0x12')]['message']);return _0x3f3947(_0x1e9bc5[_0x50fe('0x12')][_0x50fe('0x14')]);}logger[_0x50fe('0x12')](_0x50fe('0xe'),_0xdc62c0,_0x1e9bc5[_0x50fe('0x12')][_0x50fe('0x14')]);return _0x1c2dc9(_0x1e9bc5['error'][_0x50fe('0x14')]);}else{logger[_0x50fe('0x15')](_0x50fe('0xe'),_0xdc62c0,_0x50fe('0xf'));_0x1c2dc9(_0x1e9bc5[_0x50fe('0x16')]['message']);}})[_0x50fe('0x17')](function(_0x118fd1){logger[_0x50fe('0x12')](_0x50fe('0xe'),_0xdc62c0,_0x118fd1);_0x3f3947(_0x118fd1);});});}
\ No newline at end of file
+var _0xfcdd=['message','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x57068b,_0x11a6d7){var _0x5b47c0=function(_0x4d7989){while(--_0x4d7989){_0x57068b['push'](_0x57068b['shift']());}};_0x5b47c0(++_0x11a6d7);}(_0xfcdd,0xa3));var _0xdfcd=function(_0x7505ca,_0x5aaedf){_0x7505ca=_0x7505ca-0x0;var _0x246a63=_0xfcdd[_0x7505ca];return _0x246a63;};'use strict';var _=require(_0xdfcd('0x0'));var util=require(_0xdfcd('0x1'));var moment=require(_0xdfcd('0x2'));var BPromise=require(_0xdfcd('0x3'));var rs=require(_0xdfcd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdfcd('0x5'))['db'];var utils=require(_0xdfcd('0x6'));var logger=require(_0xdfcd('0x7'))(_0xdfcd('0x8'));var config=require(_0xdfcd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdfcd('0xa')][_0xdfcd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d058b,_0x2d79a3,_0x441878){return new BPromise(function(_0x50a7a7,_0x4b02a9){return client[_0xdfcd('0xc')](_0x1d058b,_0x441878)[_0xdfcd('0xd')](function(_0x3adb14){logger['info'](_0xdfcd('0xe'),_0x2d79a3,_0xdfcd('0xf'));logger[_0xdfcd('0x10')](_0xdfcd('0x11'),_0x2d79a3,'request\x20sent',JSON[_0xdfcd('0x12')](_0x3adb14));if(_0x3adb14[_0xdfcd('0x13')]){if(_0x3adb14[_0xdfcd('0x13')][_0xdfcd('0x14')]===0x1f4){logger[_0xdfcd('0x13')](_0xdfcd('0xe'),_0x2d79a3,_0x3adb14['error']['message']);return _0x4b02a9(_0x3adb14[_0xdfcd('0x13')]['message']);}logger[_0xdfcd('0x13')](_0xdfcd('0xe'),_0x2d79a3,_0x3adb14[_0xdfcd('0x13')][_0xdfcd('0x15')]);return _0x50a7a7(_0x3adb14['error'][_0xdfcd('0x15')]);}else{logger[_0xdfcd('0x16')](_0xdfcd('0xe'),_0x2d79a3,_0xdfcd('0xf'));_0x50a7a7(_0x3adb14['result'][_0xdfcd('0x15')]);}})['catch'](function(_0x1680d5){logger[_0xdfcd('0x13')](_0xdfcd('0xe'),_0x2d79a3,_0x1680d5);_0x4b02a9(_0x1680d5);});});}
\ No newline at end of file
index f5e83d8..c68a07d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1842=['/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','extname','originalname','post','file','addLogo','format','logologin','preferred','single','favicon','addFavicon','put','update','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred'];(function(_0x4ea034,_0x5d201a){var _0x561d6c=function(_0x145a90){while(--_0x145a90){_0x4ea034['push'](_0x4ea034['shift']());}};_0x561d6c(++_0x5d201a);}(_0x1842,0x1ee));var _0x2184=function(_0xe92790,_0x7d8434){_0xe92790=_0xe92790-0x0;var _0x423dea=_0x1842[_0xe92790];return _0x423dea;};'use strict';var multer=require('multer');var util=require(_0x2184('0x0'));var path=require(_0x2184('0x1'));var timeout=require(_0x2184('0x2'));var express=require(_0x2184('0x3'));var router=express[_0x2184('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2184('0x5'));var config=require(_0x2184('0x6'));var controller=require(_0x2184('0x7'));router[_0x2184('0x8')]('/',auth[_0x2184('0x9')](),controller[_0x2184('0xa')]);router[_0x2184('0x8')]('/now',controller[_0x2184('0xb')]);router['get'](_0x2184('0xc'),controller[_0x2184('0xd')]);router[_0x2184('0x8')](_0x2184('0xe'),controller[_0x2184('0xf')]);router[_0x2184('0x8')](_0x2184('0x10'),controller[_0x2184('0x11')]);router[_0x2184('0x8')](_0x2184('0x12'),controller[_0x2184('0x13')]);router['get'](_0x2184('0x14'),controller[_0x2184('0x15')]);router[_0x2184('0x8')](_0x2184('0x16'),controller[_0x2184('0x17')]);var upload=multer({'storage':multer[_0x2184('0x18')]({'destination':function(_0x149cdc,_0xbdd540,_0x19b794){_0x19b794(null,path[_0x2184('0x19')](config[_0x2184('0x1a')],_0x2184('0x1b')));},'filename':function(_0x2f7528,_0x30808b,_0x520837){_0x520837(null,util['format'](_0x2184('0x1c'),_0x2184('0x1d'),path[_0x2184('0x1e')](_0x30808b[_0x2184('0x1f')])));}})});router[_0x2184('0x20')](_0x2184('0xe'),upload['single'](_0x2184('0x21')),controller[_0x2184('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e351f,_0x4711e7,_0x2b35e0){_0x2b35e0(null,path['join'](config[_0x2184('0x1a')],_0x2184('0x1b')));},'filename':function(_0x222372,_0x2df064,_0x586a44){_0x586a44(null,util[_0x2184('0x23')](_0x2184('0x1c'),_0x2184('0x24'),path['extname'](_0x2df064['originalname'])));}})});router[_0x2184('0x20')](_0x2184('0x10'),upload['single']('file'),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x2184('0x18')]({'destination':function(_0x5dbb4d,_0x14fb95,_0x32591e){_0x32591e(null,path[_0x2184('0x19')](config[_0x2184('0x1a')],'server/files/images/logos/'));},'filename':function(_0x1183dc,_0xc916d8,_0xb4c9c){_0xb4c9c(null,util[_0x2184('0x23')]('%s%s',_0x2184('0x25'),path[_0x2184('0x1e')](_0xc916d8[_0x2184('0x1f')])));}})});router[_0x2184('0x20')](_0x2184('0x14'),upload[_0x2184('0x26')](_0x2184('0x21')),controller['addPreferred']);var upload=multer({'storage':multer[_0x2184('0x18')]({'destination':function(_0x5350a6,_0x5b1fea,_0x12f7dd){_0x12f7dd(null,path[_0x2184('0x19')](config['root'],'server/files/images/logos/'));},'filename':function(_0x3c6d76,_0x48a01b,_0x3ca89c){_0x3ca89c(null,util[_0x2184('0x23')]('%s%s',_0x2184('0x27'),path[_0x2184('0x1e')](_0x48a01b['originalname'])));}})});router[_0x2184('0x20')](_0x2184('0x16'),upload[_0x2184('0x26')](_0x2184('0x21')),controller[_0x2184('0x28')]);router[_0x2184('0x29')](_0x2184('0xc'),auth['isAuthenticated'](),controller[_0x2184('0x2a')]);module['exports']=router;
\ No newline at end of file
+var _0x8d09=['getDate','show','/:id/logo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','server/files/images/logos/','%s%s','extname','originalname','post','file','addLogo','root','format','logologin','addLogoLogin','preferred','single','addPreferred','favicon','/:id/favicon','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now'];(function(_0x567760,_0x282c85){var _0xbfbb92=function(_0x1d0738){while(--_0x1d0738){_0x567760['push'](_0x567760['shift']());}};_0xbfbb92(++_0x282c85);}(_0x8d09,0x176));var _0x98d0=function(_0x2c8f05,_0x3b5b37){_0x2c8f05=_0x2c8f05-0x0;var _0x3a48fd=_0x8d09[_0x2c8f05];return _0x3a48fd;};'use strict';var multer=require('multer');var util=require(_0x98d0('0x0'));var path=require(_0x98d0('0x1'));var timeout=require(_0x98d0('0x2'));var express=require(_0x98d0('0x3'));var router=express[_0x98d0('0x4')]();var fs_extra=require(_0x98d0('0x5'));var auth=require(_0x98d0('0x6'));var interaction=require(_0x98d0('0x7'));var config=require(_0x98d0('0x8'));var controller=require(_0x98d0('0x9'));router[_0x98d0('0xa')]('/',auth[_0x98d0('0xb')](),controller['index']);router['get'](_0x98d0('0xc'),controller[_0x98d0('0xd')]);router[_0x98d0('0xa')]('/:id',controller[_0x98d0('0xe')]);router[_0x98d0('0xa')](_0x98d0('0xf'),controller['getLogo']);router[_0x98d0('0xa')]('/:id/logo_login',controller[_0x98d0('0x10')]);router[_0x98d0('0xa')](_0x98d0('0x11'),controller[_0x98d0('0x12')]);router[_0x98d0('0xa')](_0x98d0('0x13'),controller[_0x98d0('0x14')]);router[_0x98d0('0xa')]('/:id/favicon',controller[_0x98d0('0x15')]);var upload=multer({'storage':multer[_0x98d0('0x16')]({'destination':function(_0x27434e,_0x1264d8,_0x443ad1){_0x443ad1(null,path[_0x98d0('0x17')](config['root'],_0x98d0('0x18')));},'filename':function(_0x3022f3,_0x15c537,_0x170a50){_0x170a50(null,util['format'](_0x98d0('0x19'),'logo',path[_0x98d0('0x1a')](_0x15c537[_0x98d0('0x1b')])));}})});router[_0x98d0('0x1c')](_0x98d0('0xf'),upload['single'](_0x98d0('0x1d')),controller[_0x98d0('0x1e')]);var upload=multer({'storage':multer[_0x98d0('0x16')]({'destination':function(_0x1019aa,_0x8978d5,_0x543c90){_0x543c90(null,path[_0x98d0('0x17')](config[_0x98d0('0x1f')],'server/files/images/logos/'));},'filename':function(_0x1e1fbb,_0x3723d9,_0x1abd67){_0x1abd67(null,util[_0x98d0('0x20')]('%s%s',_0x98d0('0x21'),path[_0x98d0('0x1a')](_0x3723d9[_0x98d0('0x1b')])));}})});router[_0x98d0('0x1c')]('/:id/logo_login',upload['single'](_0x98d0('0x1d')),controller[_0x98d0('0x22')]);var upload=multer({'storage':multer[_0x98d0('0x16')]({'destination':function(_0x5e3392,_0x2a2e6f,_0x2550f5){_0x2550f5(null,path[_0x98d0('0x17')](config['root'],_0x98d0('0x18')));},'filename':function(_0x2c836d,_0x19a4b4,_0x1582ab){_0x1582ab(null,util[_0x98d0('0x20')](_0x98d0('0x19'),_0x98d0('0x23'),path[_0x98d0('0x1a')](_0x19a4b4[_0x98d0('0x1b')])));}})});router[_0x98d0('0x1c')](_0x98d0('0x13'),upload[_0x98d0('0x24')](_0x98d0('0x1d')),controller[_0x98d0('0x25')]);var upload=multer({'storage':multer[_0x98d0('0x16')]({'destination':function(_0x4d9a50,_0x550586,_0x305fc3){_0x305fc3(null,path[_0x98d0('0x17')](config['root'],_0x98d0('0x18')));},'filename':function(_0x24362d,_0x5edd18,_0x255560){_0x255560(null,util[_0x98d0('0x20')](_0x98d0('0x19'),_0x98d0('0x26'),path[_0x98d0('0x1a')](_0x5edd18[_0x98d0('0x1b')])));}})});router[_0x98d0('0x1c')](_0x98d0('0x27'),upload['single']('file'),controller['addFavicon']);router[_0x98d0('0x28')]('/:id',auth[_0x98d0('0xb')](),controller[_0x98d0('0x29')]);module[_0x98d0('0x2a')]=router;
\ No newline at end of file
index 0137109..134ab3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bf4=['alternate','UNSIGNED','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x5c0e48,_0x334cf1){var _0xb1fe19=function(_0x1952d3){while(--_0x1952d3){_0x5c0e48['push'](_0x5c0e48['shift']());}};_0xb1fe19(++_0x334cf1);}(_0x2bf4,0xb6));var _0x42bf=function(_0x15da5f,_0x3fce0e){_0x15da5f=_0x15da5f-0x0;var _0x1992f1=_0x2bf4[_0x15da5f];return _0x1992f1;};'use strict';var Sequelize=require('sequelize');module['exports']={'min_internal':{'type':Sequelize[_0x42bf('0x0')](0xb),'unique':_0x42bf('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x42bf('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x42bf('0x0')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x42bf('0x3')],'defaultValue':_0x42bf('0x4')},'logo':{'type':Sequelize[_0x42bf('0x3')]},'defaultLogo':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x42bf('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x42bf('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x42bf('0x3')]},'turnaddr':{'type':Sequelize[_0x42bf('0x3')]},'turnusername':{'type':Sequelize[_0x42bf('0x3')]},'turnpassword':{'type':Sequelize[_0x42bf('0x3')]},'pageTitle':{'type':Sequelize[_0x42bf('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x42bf('0x0')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x42bf('0x3')],'defaultValue':_0x42bf('0x6')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x42bf('0x0')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x42bf('0x0')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x42bf('0x3')],'defaultValue':_0x42bf('0x7')},'chatTimeout':{'type':Sequelize[_0x42bf('0x0')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x42bf('0x3')]},'defaultPreferred':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x42bf('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0x42bf('0x0')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x42bf('0x0')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x42bf('0x3')]},'defaultFavicon':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x42bf('0x0')]},'sentimentRegion':{'type':Sequelize[_0x42bf('0x3')]},'language':{'type':Sequelize[_0x42bf('0x3')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x42bf('0x0')](0x2)[_0x42bf('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x42bf('0x0')](0x2)[_0x42bf('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x42bf('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x42bf('0x0')](0x2)[_0x42bf('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x42bf('0x0')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x42bf('0x0')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x42bf('0x0')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x42bf('0x0')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x42bf('0x5')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1cf6=['min_internal','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','UNSIGNED','sequelize','exports'];(function(_0x2e2dda,_0x159861){var _0x354824=function(_0x11f74f){while(--_0x11f74f){_0x2e2dda['push'](_0x2e2dda['shift']());}};_0x354824(++_0x159861);}(_0x1cf6,0x196));var _0x61cf=function(_0x4778bf,_0x5b8a47){_0x4778bf=_0x4778bf-0x0;var _0x580063=_0x1cf6[_0x4778bf];return _0x580063;};'use strict';var Sequelize=require(_0x61cf('0x0'));module[_0x61cf('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x61cf('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x61cf('0x3')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x61cf('0x4')],'defaultValue':_0x61cf('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x61cf('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x61cf('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x61cf('0x4')]},'turnaddr':{'type':Sequelize[_0x61cf('0x4')]},'turnusername':{'type':Sequelize[_0x61cf('0x4')]},'turnpassword':{'type':Sequelize[_0x61cf('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x61cf('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x61cf('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x61cf('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x61cf('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x61cf('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x61cf('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x61cf('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x61cf('0x4')]},'defaultFavicon':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x61cf('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x61cf('0x3')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x61cf('0x3')]},'sentimentRegion':{'type':Sequelize[_0x61cf('0x4')]},'language':{'type':Sequelize[_0x61cf('0x4')]},'bucket':{'type':Sequelize[_0x61cf('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x61cf('0x3')](0x2)[_0x61cf('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0x61cf('0x7')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x61cf('0x3')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x61cf('0x7')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x61cf('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x61cf('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x61cf('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x61cf('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x61cf('0x6')],'defaultValue':!![]}};
\ No newline at end of file
index d19c93d..c495f29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd04b=['update','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','pick','filter','where','merge','VIRTUAL','options','Setting','include','findAll','show','params','fields','includeAll','find','catch','body','addLogo','file','filename','logo','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','ValidationError','upperFirst','\x20not\x20found','getLogoLogin','default_loginLogo.svg','Sequelize','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','favicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x13d06d,_0x58b44f){var _0x20514e=function(_0x2cfeb1){while(--_0x2cfeb1){_0x13d06d['push'](_0x13d06d['shift']());}};_0x20514e(++_0x58b44f);}(_0xd04b,0x145));var _0xbd04=function(_0x4e8043,_0x4daaf7){_0x4e8043=_0x4e8043-0x0;var _0x13921c=_0xd04b[_0x4e8043];return _0x13921c;};'use strict';var emlformat=require(_0xbd04('0x0'));var rimraf=require(_0xbd04('0x1'));var zipdir=require(_0xbd04('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd04('0x3'));var moment=require('moment');var BPromise=require(_0xbd04('0x4'));var Mustache=require(_0xbd04('0x5'));var util=require(_0xbd04('0x6'));var path=require(_0xbd04('0x7'));var sox=require(_0xbd04('0x8'));var csv=require(_0xbd04('0x9'));var ejs=require(_0xbd04('0xa'));var fs=require('fs');var fs_extra=require(_0xbd04('0xb'));var _=require(_0xbd04('0xc'));var squel=require(_0xbd04('0xd'));var crypto=require(_0xbd04('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbd04('0xf'));var toCsv=require(_0xbd04('0x9'));var querystring=require(_0xbd04('0x10'));var Papa=require(_0xbd04('0x11'));var Redis=require(_0xbd04('0x12'));var authService=require(_0xbd04('0x13'));var qs=require(_0xbd04('0x14'));var as=require(_0xbd04('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd04('0x16'))(_0xbd04('0x17'));var utils=require(_0xbd04('0x18'));var config=require(_0xbd04('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd04('0x1a'))['db'];var jayson=require(_0xbd04('0x1b'));var client=jayson[_0xbd04('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48f257,_0x572ee4,_0x5b15f9,_0x2e79c7){return new BPromise(function(_0x291e94,_0x11e875){var _0x4b6813=_0x2e79c7||client;return _0x4b6813['request'](_0x48f257,_0x5b15f9)[_0xbd04('0x1d')](function(_0x5d31e4){logger[_0xbd04('0x1e')](_0xbd04('0x1f'),_0x572ee4,'request\x20sent');logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x572ee4,_0xbd04('0x20'),JSON[_0xbd04('0x21')](_0x5d31e4));if(_0x5d31e4[_0xbd04('0x22')]){if(_0x5d31e4[_0xbd04('0x22')][_0xbd04('0x23')]===0x1f4){logger[_0xbd04('0x22')]('Setting,\x20%s,\x20%s',_0x572ee4,_0x5d31e4['error'][_0xbd04('0x24')]);return _0x11e875(_0x5d31e4[_0xbd04('0x22')]['message']);}logger['error']('Setting,\x20%s,\x20%s',_0x572ee4,_0x5d31e4[_0xbd04('0x22')]['message']);return _0x291e94(_0x5d31e4[_0xbd04('0x22')]['message']);}else{logger[_0xbd04('0x1e')](_0xbd04('0x1f'),_0x572ee4,'request\x20sent');_0x291e94(_0x5d31e4[_0xbd04('0x25')][_0xbd04('0x24')]);}})['catch'](function(_0x45ad2b){logger[_0xbd04('0x22')](_0xbd04('0x1f'),_0x572ee4,_0x45ad2b);_0x11e875(_0x45ad2b);});});}function respondWithStatusCode(_0x457db8,_0x19d792){_0x19d792=_0x19d792||0xcc;return function(_0x5d880b){if(_0x5d880b){return _0x457db8[_0xbd04('0x26')](_0x19d792);}return _0x457db8[_0xbd04('0x27')](_0x19d792)[_0xbd04('0x28')]();};}function respondWithResult(_0x3801a8,_0x3d3e5b){_0x3d3e5b=_0x3d3e5b||0xc8;return function(_0x527a2d){if(_0x527a2d){return _0x3801a8[_0xbd04('0x27')](_0x3d3e5b)['json'](_0x527a2d);}};}function respondWithFilteredResult(_0x1fbca2,_0x348416){return function(_0x45923c){if(_0x45923c){var _0x2eb172=typeof _0x348416[_0xbd04('0x29')]===_0xbd04('0x2a')&&typeof _0x348416[_0xbd04('0x2b')]===_0xbd04('0x2a');var _0x40c4eb=_0x45923c[_0xbd04('0x2c')];var _0x5960e1=_0x2eb172?0x0:_0x348416['offset'];var _0x311374=_0x2eb172?_0x45923c[_0xbd04('0x2c')]:_0x348416[_0xbd04('0x29')]+_0x348416[_0xbd04('0x2b')];var _0x1c322d;if(_0x311374>=_0x40c4eb){_0x311374=_0x40c4eb;_0x1c322d=0xc8;}else{_0x1c322d=0xce;}_0x1fbca2['status'](_0x1c322d);return _0x1fbca2[_0xbd04('0x2d')](_0xbd04('0x2e'),_0x5960e1+'-'+_0x311374+'/'+_0x40c4eb)['json'](_0x45923c);}return null;};}function patchUpdates(_0x486eeb){return function(_0x19b526){try{jsonpatch[_0xbd04('0x2f')](_0x19b526,_0x486eeb,!![]);}catch(_0x5457c5){return BPromise[_0xbd04('0x30')](_0x5457c5);}return _0x19b526[_0xbd04('0x31')]();};}function saveUpdates(_0x562519,_0x8eb8f1){return function(_0x3ea87e){if(_0x3ea87e){return _0x3ea87e[_0xbd04('0x32')](_0x562519)[_0xbd04('0x1d')](function(_0x5cafe9){return _0x5cafe9;});}return null;};}function removeEntity(_0x2bd22f,_0x72d774){return function(_0x15139d){if(_0x15139d){return _0x15139d['destroy']()[_0xbd04('0x1d')](function(){_0x2bd22f[_0xbd04('0x27')](0xcc)[_0xbd04('0x28')]();});}};}function handleEntityNotFound(_0x3ace83,_0x3fb011){return function(_0x9cf93f){if(!_0x9cf93f){_0x3ace83[_0xbd04('0x26')](0x194);}return _0x9cf93f;};}function handleError(_0x24788a,_0x361240){_0x361240=_0x361240||0x1f4;return function(_0x41177e){logger[_0xbd04('0x22')](_0x41177e[_0xbd04('0x33')]);if(_0x41177e[_0xbd04('0x34')]){delete _0x41177e['name'];}_0x24788a[_0xbd04('0x27')](_0x361240)[_0xbd04('0x35')](_0x41177e);};}exports[_0xbd04('0x36')]=function(_0xad3a29,_0x3db72b){var _0xc56048={},_0x3d840c={},_0x36ba53={'count':0x0,'rows':[]};var _0x468aae=_[_0xbd04('0x37')](db['Setting'][_0xbd04('0x38')],function(_0x1e0785){return{'name':_0x1e0785[_0xbd04('0x39')],'type':_0x1e0785[_0xbd04('0x3a')][_0xbd04('0x3b')]};});_0x3d840c[_0xbd04('0x3c')]=_[_0xbd04('0x37')](_0x468aae,_0xbd04('0x34'));_0x3d840c[_0xbd04('0x3d')]=_[_0xbd04('0x3e')](_0xad3a29[_0xbd04('0x3d')]);_0x3d840c[_0xbd04('0x3f')]=_['intersection'](_0x3d840c[_0xbd04('0x3c')],_0x3d840c['query']);_0xc56048[_0xbd04('0x40')]=_[_0xbd04('0x41')](_0x3d840c['model'],qs['fields'](_0xad3a29[_0xbd04('0x3d')]['fields']));_0xc56048[_0xbd04('0x40')]=_0xc56048[_0xbd04('0x40')][_0xbd04('0x42')]?_0xc56048[_0xbd04('0x40')]:_0x3d840c[_0xbd04('0x3c')];if(!_0xad3a29['query'][_0xbd04('0x43')]('nolimit')){_0xc56048[_0xbd04('0x2b')]=qs[_0xbd04('0x2b')](_0xad3a29['query'][_0xbd04('0x2b')]);_0xc56048['offset']=qs[_0xbd04('0x29')](_0xad3a29['query'][_0xbd04('0x29')]);}_0xc56048[_0xbd04('0x44')]=qs['sort'](_0xad3a29[_0xbd04('0x3d')]['sort']);_0xc56048['where']=qs[_0xbd04('0x3f')](_[_0xbd04('0x45')](_0xad3a29['query'],_0x3d840c[_0xbd04('0x3f')]),_0x468aae);if(_0xad3a29['query'][_0xbd04('0x46')]){_0xc56048[_0xbd04('0x47')]=_[_0xbd04('0x48')](_0xc56048[_0xbd04('0x47')],{'$or':_[_0xbd04('0x37')](_0x468aae,function(_0x40eb2b){if(_0x40eb2b['type']!==_0xbd04('0x49')){var _0x5ec629={};_0x5ec629[_0x40eb2b[_0xbd04('0x34')]]={'$like':'%'+_0xad3a29[_0xbd04('0x3d')][_0xbd04('0x46')]+'%'};return _0x5ec629;}})});}_0xc56048=_[_0xbd04('0x48')]({},_0xc56048,_0xad3a29[_0xbd04('0x4a')]);var _0x34abfe={'where':_0xc56048[_0xbd04('0x47')]};return db[_0xbd04('0x4b')][_0xbd04('0x2c')](_0x34abfe)[_0xbd04('0x1d')](function(_0xdbabeb){_0x36ba53[_0xbd04('0x2c')]=_0xdbabeb;if(_0xad3a29[_0xbd04('0x3d')]['includeAll']){_0xc56048[_0xbd04('0x4c')]=[{'all':!![]}];}return db[_0xbd04('0x4b')][_0xbd04('0x4d')](_0xc56048);})['then'](function(_0x5ced26){_0x36ba53['rows']=_0x5ced26;return _0x36ba53;})[_0xbd04('0x1d')](respondWithFilteredResult(_0x3db72b,_0xc56048))['catch'](handleError(_0x3db72b,null));};exports[_0xbd04('0x4e')]=function(_0x41c76c,_0x1de2d1){var _0x4b26cb={'raw':![],'where':{'id':_0x41c76c[_0xbd04('0x4f')]['id']}},_0xfafe46={};_0xfafe46[_0xbd04('0x3c')]=_[_0xbd04('0x3e')](db[_0xbd04('0x4b')]['rawAttributes']);_0xfafe46['query']=_[_0xbd04('0x3e')](_0x41c76c[_0xbd04('0x3d')]);_0xfafe46['filters']=_['intersection'](_0xfafe46[_0xbd04('0x3c')],_0xfafe46[_0xbd04('0x3d')]);_0x4b26cb['attributes']=_[_0xbd04('0x41')](_0xfafe46['model'],qs[_0xbd04('0x50')](_0x41c76c[_0xbd04('0x3d')]['fields']));_0x4b26cb[_0xbd04('0x40')]=_0x4b26cb[_0xbd04('0x40')][_0xbd04('0x42')]?_0x4b26cb[_0xbd04('0x40')]:_0xfafe46[_0xbd04('0x3c')];if(_0x41c76c[_0xbd04('0x3d')][_0xbd04('0x51')]){_0x4b26cb[_0xbd04('0x4c')]=[{'all':!![]}];}_0x4b26cb=_[_0xbd04('0x48')]({},_0x4b26cb,_0x41c76c[_0xbd04('0x4a')]);return db[_0xbd04('0x4b')][_0xbd04('0x52')](_0x4b26cb)['then'](handleEntityNotFound(_0x1de2d1,null))[_0xbd04('0x1d')](respondWithResult(_0x1de2d1,null))[_0xbd04('0x53')](handleError(_0x1de2d1,null));};exports[_0xbd04('0x32')]=function(_0x13f9ec,_0x5222a8){if(_0x13f9ec[_0xbd04('0x54')]['id']){delete _0x13f9ec[_0xbd04('0x54')]['id'];}return db[_0xbd04('0x4b')][_0xbd04('0x52')]({'where':{'id':_0x13f9ec[_0xbd04('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5222a8,null))[_0xbd04('0x1d')](saveUpdates(_0x13f9ec['body'],null))['then'](respondWithResult(_0x5222a8,null))[_0xbd04('0x53')](handleError(_0x5222a8,null));};exports[_0xbd04('0x55')]=function(_0x598037,_0x501569,_0xf7ab76){if(_0x598037[_0xbd04('0x56')]&&_0x598037[_0xbd04('0x56')][_0xbd04('0x57')]){_0x598037[_0xbd04('0x54')][_0xbd04('0x58')]=_0x598037[_0xbd04('0x56')][_0xbd04('0x57')];}return db['Setting'][_0xbd04('0x52')]({'where':{'id':_0x598037[_0xbd04('0x4f')]['id']}})['then'](handleEntityNotFound(_0x501569,null))['then'](saveUpdates(_0x598037['body'],null))[_0xbd04('0x1d')](respondWithResult(_0x501569,null))[_0xbd04('0x53')](handleError(_0x501569,null));};exports['addLogoLogin']=function(_0x1a8076,_0x66d50e,_0x2b9e2b){if(_0x1a8076[_0xbd04('0x56')]&&_0x1a8076[_0xbd04('0x56')][_0xbd04('0x57')]){_0x1a8076[_0xbd04('0x54')][_0xbd04('0x59')]=_0x1a8076[_0xbd04('0x56')]['filename'];}return db[_0xbd04('0x4b')][_0xbd04('0x52')]({'where':{'id':_0x1a8076[_0xbd04('0x4f')]['id']}})[_0xbd04('0x1d')](handleEntityNotFound(_0x66d50e,null))[_0xbd04('0x1d')](saveUpdates(_0x1a8076[_0xbd04('0x54')],null))['then'](respondWithResult(_0x66d50e,null))[_0xbd04('0x53')](handleError(_0x66d50e,null));};var utilLicense=require(_0xbd04('0x5a'));exports[_0xbd04('0x5b')]=function(_0x3439c6,_0x20faaf,_0xb58f7c){var _0x58ba04=_0xbd04('0x5c');var _0x3ca53c={'custom':![]};return utilLicense[_0xbd04('0x5d')]()[_0xbd04('0x1d')](function(_0x2b9870){if(_0x2b9870){_0x3ca53c=_0x2b9870;}return db['Setting']['find']({'where':{'id':_0x3439c6[_0xbd04('0x4f')]['id']},'attributes':[_0xbd04('0x58'),_0xbd04('0x59'),_0xbd04('0x5e'),'favicon','defaultLogo',_0xbd04('0x5f'),_0xbd04('0x60'),_0xbd04('0x61')],'raw':!![]});})[_0xbd04('0x1d')](handleEntityNotFound(_0x20faaf,null))['then'](function(_0x39af71){if(_0x39af71){var _0x50fea4=_0x39af71[_0xbd04('0x58')]&&fs[_0xbd04('0x62')](path[_0xbd04('0x63')](config['root'],_0x58ba04,_['toLower'](_0x39af71[_0xbd04('0x58')])))?path[_0xbd04('0x63')](config[_0xbd04('0x64')],_0x58ba04,_[_0xbd04('0x65')](_0x39af71[_0xbd04('0x58')])):path[_0xbd04('0x63')](config['root'],_0x58ba04,_[_0xbd04('0x65')](_0xbd04('0x66')));var _0x22d7aa=_0xbd04('0x67')+_['upperFirst'](_0xbd04('0x58'));if(_0x39af71[_0x22d7aa]||!_0x3ca53c[_0xbd04('0x68')]){_0x50fea4=path[_0xbd04('0x63')](config['root'],_0x58ba04,_[_0xbd04('0x65')](_0xbd04('0x66')));}if(!fs[_0xbd04('0x62')](_0x50fea4)){throw new db['Sequelize'][(_0xbd04('0x69'))](_[_0xbd04('0x6a')](_0xbd04('0x58'))+_0xbd04('0x6b'));}return _0x20faaf['download'](_0x50fea4);}})[_0xbd04('0x53')](handleError(_0x20faaf,null));};var utilLicense=require(_0xbd04('0x5a'));exports[_0xbd04('0x6c')]=function(_0xa31014,_0x53fb56,_0x196c35){var _0x3f5075='server/files/images/logos';var _0x4c9c30={'custom':![]};return utilLicense[_0xbd04('0x5d')]()[_0xbd04('0x1d')](function(_0x5c592f){if(_0x5c592f){_0x4c9c30=_0x5c592f;}return db[_0xbd04('0x4b')][_0xbd04('0x52')]({'where':{'id':_0xa31014[_0xbd04('0x4f')]['id']},'attributes':[_0xbd04('0x58'),'loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo',_0xbd04('0x60'),_0xbd04('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x53fb56,null))[_0xbd04('0x1d')](function(_0x117ba4){if(_0x117ba4){var _0x245055=_0x117ba4[_0xbd04('0x59')]&&fs['existsSync'](path[_0xbd04('0x63')](config[_0xbd04('0x64')],_0x3f5075,_[_0xbd04('0x65')](_0x117ba4[_0xbd04('0x59')])))?path[_0xbd04('0x63')](config[_0xbd04('0x64')],_0x3f5075,_['toLower'](_0x117ba4[_0xbd04('0x59')])):path[_0xbd04('0x63')](config[_0xbd04('0x64')],_0x3f5075,_[_0xbd04('0x65')](_0xbd04('0x6d')));var _0x1731af=_0xbd04('0x67')+_[_0xbd04('0x6a')](_0xbd04('0x59'));if(_0x117ba4[_0x1731af]||!_0x4c9c30['custom']){_0x245055=path[_0xbd04('0x63')](config[_0xbd04('0x64')],_0x3f5075,_[_0xbd04('0x65')](_0xbd04('0x6d')));}if(!fs['existsSync'](_0x245055)){throw new db[(_0xbd04('0x6e'))][(_0xbd04('0x69'))](_['upperFirst'](_0xbd04('0x59'))+_0xbd04('0x6b'));}return _0x53fb56[_0xbd04('0x6f')](_0x245055);}})[_0xbd04('0x53')](handleError(_0x53fb56,null));};exports[_0xbd04('0x70')]=function(_0x19f470,_0x3508d9){return db[_0xbd04('0x4b')][_0xbd04('0x52')]({'where':{'id':_0x19f470['params']['id']},'attributes':[_0xbd04('0x71')]})[_0xbd04('0x1d')](respondWithResult(_0x3508d9,null))[_0xbd04('0x53')](handleError(_0x3508d9,null));};exports[_0xbd04('0x72')]=function(_0x32a612,_0x4ac4b7,_0x3b2c59){if(_0x32a612['file']&&_0x32a612[_0xbd04('0x56')]['filename']){_0x32a612[_0xbd04('0x54')][_0xbd04('0x5e')]=_0x32a612[_0xbd04('0x56')][_0xbd04('0x57')];}return db['Setting']['find']({'where':{'id':_0x32a612['params']['id']}})[_0xbd04('0x1d')](handleEntityNotFound(_0x4ac4b7,null))[_0xbd04('0x1d')](saveUpdates(_0x32a612[_0xbd04('0x54')],null))[_0xbd04('0x1d')](respondWithResult(_0x4ac4b7,null))[_0xbd04('0x53')](handleError(_0x4ac4b7,null));};var utilLicense=require(_0xbd04('0x5a'));exports[_0xbd04('0x73')]=function(_0x7b9bf5,_0x249ccb,_0x5f3f52){var _0x5a399e=_0xbd04('0x5c');var _0x37366c={'custom':![]};return utilLicense[_0xbd04('0x5d')]()[_0xbd04('0x1d')](function(_0x163767){if(_0x163767){_0x37366c=_0x163767;}return db[_0xbd04('0x4b')]['find']({'where':{'id':_0x7b9bf5[_0xbd04('0x4f')]['id']},'attributes':[_0xbd04('0x58'),_0xbd04('0x59'),'preferred','favicon','defaultLogo','defaultLoginLogo',_0xbd04('0x60'),_0xbd04('0x61')],'raw':!![]});})[_0xbd04('0x1d')](handleEntityNotFound(_0x249ccb,null))[_0xbd04('0x1d')](function(_0x39077a){if(_0x39077a){var _0x2109f1=_0x39077a[_0xbd04('0x5e')]&&fs[_0xbd04('0x62')](path['join'](config[_0xbd04('0x64')],_0x5a399e,_[_0xbd04('0x65')](_0x39077a['preferred'])))?path[_0xbd04('0x63')](config['root'],_0x5a399e,_['toLower'](_0x39077a['preferred'])):path[_0xbd04('0x63')](config['root'],_0x5a399e,_[_0xbd04('0x65')](_0xbd04('0x74')));var _0x108418=_0xbd04('0x67')+_[_0xbd04('0x6a')](_0xbd04('0x5e'));if(_0x39077a[_0x108418]||!_0x37366c[_0xbd04('0x68')]||!_0x37366c[_0xbd04('0x5e')]){_0x2109f1=path[_0xbd04('0x63')](config[_0xbd04('0x64')],_0x5a399e,_[_0xbd04('0x65')](_0xbd04('0x74')));}if(!fs[_0xbd04('0x62')](_0x2109f1)){throw new db[(_0xbd04('0x6e'))]['ValidationError'](_[_0xbd04('0x6a')](_0xbd04('0x5e'))+_0xbd04('0x6b'));}return _0x249ccb[_0xbd04('0x6f')](_0x2109f1);}})[_0xbd04('0x53')](handleError(_0x249ccb,null));};exports[_0xbd04('0x75')]=function(_0x5804d4,_0x5ec218,_0x30b759){if(_0x5804d4[_0xbd04('0x56')]&&_0x5804d4['file'][_0xbd04('0x57')]){_0x5804d4['body'][_0xbd04('0x76')]=_0x5804d4[_0xbd04('0x56')][_0xbd04('0x57')];}return db[_0xbd04('0x4b')][_0xbd04('0x52')]({'where':{'id':_0x5804d4[_0xbd04('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ec218,null))[_0xbd04('0x1d')](saveUpdates(_0x5804d4['body'],null))['then'](respondWithResult(_0x5ec218,null))['catch'](handleError(_0x5ec218,null));};var utilLicense=require(_0xbd04('0x5a'));exports['getFavicon']=function(_0x188119,_0x5adac3,_0x33b058){var _0x16afda=_0xbd04('0x5c');var _0x39f6ff={'custom':![]};return utilLicense['getLicense']()[_0xbd04('0x1d')](function(_0x4814f1){if(_0x4814f1){_0x39f6ff=_0x4814f1;}return db[_0xbd04('0x4b')][_0xbd04('0x52')]({'where':{'id':_0x188119[_0xbd04('0x4f')]['id']},'attributes':[_0xbd04('0x58'),'loginLogo',_0xbd04('0x5e'),'favicon','defaultLogo',_0xbd04('0x5f'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xbd04('0x1d')](handleEntityNotFound(_0x5adac3,null))[_0xbd04('0x1d')](function(_0x25ccfc){if(_0x25ccfc){var _0x22d53a=_0x25ccfc[_0xbd04('0x76')]&&fs[_0xbd04('0x62')](path['join'](config[_0xbd04('0x64')],_0x16afda,_[_0xbd04('0x65')](_0x25ccfc[_0xbd04('0x76')])))?path[_0xbd04('0x63')](config[_0xbd04('0x64')],_0x16afda,_['toLower'](_0x25ccfc[_0xbd04('0x76')])):path[_0xbd04('0x63')](config['root'],_0x16afda,_[_0xbd04('0x65')]('default_favicon.ico'));var _0x1988b1=_0xbd04('0x67')+_[_0xbd04('0x6a')](_0xbd04('0x76'));if(_0x25ccfc[_0x1988b1]||!_0x39f6ff[_0xbd04('0x68')]){_0x22d53a=path['join'](config[_0xbd04('0x64')],_0x16afda,_[_0xbd04('0x65')](_0xbd04('0x77')));}if(!fs[_0xbd04('0x62')](_0x22d53a)){throw new db[(_0xbd04('0x6e'))][(_0xbd04('0x69'))](_['upperFirst'](_0xbd04('0x76'))+_0xbd04('0x6b'));}return _0x5adac3[_0xbd04('0x6f')](_0x22d53a);}})[_0xbd04('0x53')](handleError(_0x5adac3,null));};exports[_0xbd04('0x78')]=function(_0x834dcb,_0x4d25e1){var _0x2fa1e7={'offset':moment()[_0xbd04('0x79')]()};_0x2fa1e7[_0xbd04('0x7a')]=moment()['utcOffset'](_0x2fa1e7[_0xbd04('0x29')])[_0xbd04('0x7b')](_0xbd04('0x7c'));return _0x4d25e1[_0xbd04('0x27')](0xc8)[_0xbd04('0x35')](_0x2fa1e7);};
\ No newline at end of file
+var _0x210d=['rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','sort','filters','pick','filter','where','VIRTUAL','merge','options','Setting','includeAll','rows','show','length','include','find','params','body','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','preferred','favicon','defaultLoginLogo','gdpr','addPreferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format'];(function(_0x5d3d30,_0x3868ae){var _0x36794c=function(_0x4ea04b){while(--_0x4ea04b){_0x5d3d30['push'](_0x5d3d30['shift']());}};_0x36794c(++_0x3868ae);}(_0x210d,0x7c));var _0xd210=function(_0x2abaae,_0x29fd8b){_0x2abaae=_0x2abaae-0x0;var _0x5b5745=_0x210d[_0x2abaae];return _0x5b5745;};'use strict';var emlformat=require(_0xd210('0x0'));var rimraf=require(_0xd210('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd210('0x2'));var rp=require(_0xd210('0x3'));var moment=require(_0xd210('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd210('0x5'));var path=require(_0xd210('0x6'));var sox=require(_0xd210('0x7'));var csv=require(_0xd210('0x8'));var ejs=require(_0xd210('0x9'));var fs=require('fs');var fs_extra=require(_0xd210('0xa'));var _=require(_0xd210('0xb'));var squel=require(_0xd210('0xc'));var crypto=require(_0xd210('0xd'));var jsforce=require(_0xd210('0xe'));var deskjs=require(_0xd210('0xf'));var toCsv=require(_0xd210('0x8'));var querystring=require('querystring');var Papa=require(_0xd210('0x10'));var Redis=require(_0xd210('0x11'));var authService=require(_0xd210('0x12'));var qs=require(_0xd210('0x13'));var as=require(_0xd210('0x14'));var hardwareService=require(_0xd210('0x15'));var logger=require('../../config/logger')(_0xd210('0x16'));var utils=require(_0xd210('0x17'));var config=require(_0xd210('0x18'));var licenseUtil=require(_0xd210('0x19'));var db=require(_0xd210('0x1a'))['db'];var jayson=require(_0xd210('0x1b'));var client=jayson[_0xd210('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b43a2,_0x3d5c0f,_0x51a78d,_0x4b75e1){return new BPromise(function(_0x6d997a,_0x126e72){var _0x461c80=_0x4b75e1||client;return _0x461c80[_0xd210('0x1d')](_0x2b43a2,_0x51a78d)[_0xd210('0x1e')](function(_0x1d4b14){logger['info'](_0xd210('0x1f'),_0x3d5c0f,_0xd210('0x20'));logger[_0xd210('0x21')](_0xd210('0x22'),_0x3d5c0f,_0xd210('0x20'),JSON[_0xd210('0x23')](_0x1d4b14));if(_0x1d4b14[_0xd210('0x24')]){if(_0x1d4b14[_0xd210('0x24')][_0xd210('0x25')]===0x1f4){logger[_0xd210('0x24')]('Setting,\x20%s,\x20%s',_0x3d5c0f,_0x1d4b14[_0xd210('0x24')][_0xd210('0x26')]);return _0x126e72(_0x1d4b14[_0xd210('0x24')][_0xd210('0x26')]);}logger[_0xd210('0x24')](_0xd210('0x1f'),_0x3d5c0f,_0x1d4b14[_0xd210('0x24')][_0xd210('0x26')]);return _0x6d997a(_0x1d4b14[_0xd210('0x24')][_0xd210('0x26')]);}else{logger[_0xd210('0x27')](_0xd210('0x1f'),_0x3d5c0f,'request\x20sent');_0x6d997a(_0x1d4b14[_0xd210('0x28')][_0xd210('0x26')]);}})[_0xd210('0x29')](function(_0x154f71){logger[_0xd210('0x24')]('Setting,\x20%s,\x20%s',_0x3d5c0f,_0x154f71);_0x126e72(_0x154f71);});});}function respondWithStatusCode(_0x57df2e,_0x4bc690){_0x4bc690=_0x4bc690||0xcc;return function(_0x31527d){if(_0x31527d){return _0x57df2e['sendStatus'](_0x4bc690);}return _0x57df2e[_0xd210('0x2a')](_0x4bc690)[_0xd210('0x2b')]();};}function respondWithResult(_0x4d92d8,_0x2a2d33){_0x2a2d33=_0x2a2d33||0xc8;return function(_0x15899a){if(_0x15899a){return _0x4d92d8[_0xd210('0x2a')](_0x2a2d33)[_0xd210('0x2c')](_0x15899a);}};}function respondWithFilteredResult(_0x5a9de3,_0x5ac391){return function(_0x323c17){if(_0x323c17){var _0x5a1b3e=typeof _0x5ac391[_0xd210('0x2d')]==='undefined'&&typeof _0x5ac391[_0xd210('0x2e')]===_0xd210('0x2f');var _0x4474fb=_0x323c17[_0xd210('0x30')];var _0x1065e6=_0x5a1b3e?0x0:_0x5ac391[_0xd210('0x2d')];var _0x3181a2=_0x5a1b3e?_0x323c17[_0xd210('0x30')]:_0x5ac391[_0xd210('0x2d')]+_0x5ac391['limit'];var _0x38298b;if(_0x3181a2>=_0x4474fb){_0x3181a2=_0x4474fb;_0x38298b=0xc8;}else{_0x38298b=0xce;}_0x5a9de3['status'](_0x38298b);return _0x5a9de3[_0xd210('0x31')](_0xd210('0x32'),_0x1065e6+'-'+_0x3181a2+'/'+_0x4474fb)[_0xd210('0x2c')](_0x323c17);}return null;};}function patchUpdates(_0x12e2f8){return function(_0x3bcb27){try{jsonpatch[_0xd210('0x33')](_0x3bcb27,_0x12e2f8,!![]);}catch(_0x1f11f6){return BPromise['reject'](_0x1f11f6);}return _0x3bcb27[_0xd210('0x34')]();};}function saveUpdates(_0x1cc6b8,_0x17f63f){return function(_0x38ce7e){if(_0x38ce7e){return _0x38ce7e['update'](_0x1cc6b8)[_0xd210('0x1e')](function(_0x292b85){return _0x292b85;});}return null;};}function removeEntity(_0x22b388,_0x204c02){return function(_0x321625){if(_0x321625){return _0x321625[_0xd210('0x35')]()[_0xd210('0x1e')](function(){_0x22b388[_0xd210('0x2a')](0xcc)[_0xd210('0x2b')]();});}};}function handleEntityNotFound(_0x3c8669,_0x441839){return function(_0x144753){if(!_0x144753){_0x3c8669[_0xd210('0x36')](0x194);}return _0x144753;};}function handleError(_0x5c3bcf,_0x158c27){_0x158c27=_0x158c27||0x1f4;return function(_0x39e466){logger[_0xd210('0x24')](_0x39e466[_0xd210('0x37')]);if(_0x39e466[_0xd210('0x38')]){delete _0x39e466['name'];}_0x5c3bcf[_0xd210('0x2a')](_0x158c27)[_0xd210('0x39')](_0x39e466);};}exports[_0xd210('0x3a')]=function(_0x3ed4d3,_0x1abc13){var _0x2b7075={},_0x39c123={},_0x28ac2c={'count':0x0,'rows':[]};var _0x2481fd=_[_0xd210('0x3b')](db['Setting'][_0xd210('0x3c')],function(_0x671118){return{'name':_0x671118[_0xd210('0x3d')],'type':_0x671118[_0xd210('0x3e')][_0xd210('0x3f')]};});_0x39c123[_0xd210('0x40')]=_['map'](_0x2481fd,_0xd210('0x38'));_0x39c123[_0xd210('0x41')]=_[_0xd210('0x42')](_0x3ed4d3['query']);_0x39c123['filters']=_[_0xd210('0x43')](_0x39c123[_0xd210('0x40')],_0x39c123[_0xd210('0x41')]);_0x2b7075['attributes']=_[_0xd210('0x43')](_0x39c123[_0xd210('0x40')],qs['fields'](_0x3ed4d3[_0xd210('0x41')][_0xd210('0x44')]));_0x2b7075[_0xd210('0x45')]=_0x2b7075[_0xd210('0x45')]['length']?_0x2b7075[_0xd210('0x45')]:_0x39c123[_0xd210('0x40')];if(!_0x3ed4d3['query'][_0xd210('0x46')]('nolimit')){_0x2b7075[_0xd210('0x2e')]=qs[_0xd210('0x2e')](_0x3ed4d3[_0xd210('0x41')][_0xd210('0x2e')]);_0x2b7075[_0xd210('0x2d')]=qs[_0xd210('0x2d')](_0x3ed4d3[_0xd210('0x41')][_0xd210('0x2d')]);}_0x2b7075['order']=qs[_0xd210('0x47')](_0x3ed4d3[_0xd210('0x41')]['sort']);_0x2b7075['where']=qs[_0xd210('0x48')](_[_0xd210('0x49')](_0x3ed4d3[_0xd210('0x41')],_0x39c123[_0xd210('0x48')]),_0x2481fd);if(_0x3ed4d3['query'][_0xd210('0x4a')]){_0x2b7075[_0xd210('0x4b')]=_['merge'](_0x2b7075['where'],{'$or':_[_0xd210('0x3b')](_0x2481fd,function(_0x281adf){if(_0x281adf[_0xd210('0x3e')]!==_0xd210('0x4c')){var _0x2b9216={};_0x2b9216[_0x281adf[_0xd210('0x38')]]={'$like':'%'+_0x3ed4d3[_0xd210('0x41')][_0xd210('0x4a')]+'%'};return _0x2b9216;}})});}_0x2b7075=_[_0xd210('0x4d')]({},_0x2b7075,_0x3ed4d3[_0xd210('0x4e')]);var _0x4ded0d={'where':_0x2b7075[_0xd210('0x4b')]};return db[_0xd210('0x4f')][_0xd210('0x30')](_0x4ded0d)[_0xd210('0x1e')](function(_0x28cf9e){_0x28ac2c[_0xd210('0x30')]=_0x28cf9e;if(_0x3ed4d3['query'][_0xd210('0x50')]){_0x2b7075['include']=[{'all':!![]}];}return db['Setting']['findAll'](_0x2b7075);})[_0xd210('0x1e')](function(_0x4868c7){_0x28ac2c[_0xd210('0x51')]=_0x4868c7;return _0x28ac2c;})[_0xd210('0x1e')](respondWithFilteredResult(_0x1abc13,_0x2b7075))[_0xd210('0x29')](handleError(_0x1abc13,null));};exports[_0xd210('0x52')]=function(_0x2720f1,_0x422268){var _0x37332c={'raw':![],'where':{'id':_0x2720f1['params']['id']}},_0x4316b9={};_0x4316b9[_0xd210('0x40')]=_['keys'](db[_0xd210('0x4f')][_0xd210('0x3c')]);_0x4316b9[_0xd210('0x41')]=_[_0xd210('0x42')](_0x2720f1['query']);_0x4316b9[_0xd210('0x48')]=_[_0xd210('0x43')](_0x4316b9['model'],_0x4316b9[_0xd210('0x41')]);_0x37332c[_0xd210('0x45')]=_[_0xd210('0x43')](_0x4316b9[_0xd210('0x40')],qs[_0xd210('0x44')](_0x2720f1['query'][_0xd210('0x44')]));_0x37332c[_0xd210('0x45')]=_0x37332c[_0xd210('0x45')][_0xd210('0x53')]?_0x37332c[_0xd210('0x45')]:_0x4316b9['model'];if(_0x2720f1[_0xd210('0x41')][_0xd210('0x50')]){_0x37332c[_0xd210('0x54')]=[{'all':!![]}];}_0x37332c=_[_0xd210('0x4d')]({},_0x37332c,_0x2720f1['options']);return db['Setting'][_0xd210('0x55')](_0x37332c)['then'](handleEntityNotFound(_0x422268,null))[_0xd210('0x1e')](respondWithResult(_0x422268,null))[_0xd210('0x29')](handleError(_0x422268,null));};exports['update']=function(_0x3b3326,_0x4ee82b){if(_0x3b3326['body']['id']){delete _0x3b3326['body']['id'];}return db[_0xd210('0x4f')][_0xd210('0x55')]({'where':{'id':_0x3b3326[_0xd210('0x56')]['id']}})[_0xd210('0x1e')](handleEntityNotFound(_0x4ee82b,null))['then'](saveUpdates(_0x3b3326[_0xd210('0x57')],null))['then'](respondWithResult(_0x4ee82b,null))[_0xd210('0x29')](handleError(_0x4ee82b,null));};exports['addLogo']=function(_0x4aedaf,_0x3d6888,_0x2e9818){if(_0x4aedaf[_0xd210('0x58')]&&_0x4aedaf[_0xd210('0x58')][_0xd210('0x59')]){_0x4aedaf['body'][_0xd210('0x5a')]=_0x4aedaf[_0xd210('0x58')][_0xd210('0x59')];}return db[_0xd210('0x4f')][_0xd210('0x55')]({'where':{'id':_0x4aedaf['params']['id']}})[_0xd210('0x1e')](handleEntityNotFound(_0x3d6888,null))[_0xd210('0x1e')](saveUpdates(_0x4aedaf[_0xd210('0x57')],null))[_0xd210('0x1e')](respondWithResult(_0x3d6888,null))[_0xd210('0x29')](handleError(_0x3d6888,null));};exports[_0xd210('0x5b')]=function(_0x2267f3,_0x46721b,_0xa36bda){if(_0x2267f3[_0xd210('0x58')]&&_0x2267f3[_0xd210('0x58')]['filename']){_0x2267f3['body']['loginLogo']=_0x2267f3[_0xd210('0x58')]['filename'];}return db['Setting'][_0xd210('0x55')]({'where':{'id':_0x2267f3[_0xd210('0x56')]['id']}})['then'](handleEntityNotFound(_0x46721b,null))[_0xd210('0x1e')](saveUpdates(_0x2267f3['body'],null))[_0xd210('0x1e')](respondWithResult(_0x46721b,null))['catch'](handleError(_0x46721b,null));};var utilLicense=require(_0xd210('0x19'));exports[_0xd210('0x5c')]=function(_0x155516,_0x4a1e1a,_0x117ae3){var _0x16317b=_0xd210('0x5d');var _0x2c9672={'custom':![]};return utilLicense[_0xd210('0x5e')]()[_0xd210('0x1e')](function(_0x51543f){if(_0x51543f){_0x2c9672=_0x51543f;}return db[_0xd210('0x4f')][_0xd210('0x55')]({'where':{'id':_0x155516[_0xd210('0x56')]['id']},'attributes':['logo',_0xd210('0x5f'),'preferred','favicon',_0xd210('0x60'),'defaultLoginLogo',_0xd210('0x61'),_0xd210('0x62')],'raw':!![]});})['then'](handleEntityNotFound(_0x4a1e1a,null))[_0xd210('0x1e')](function(_0x1ab0bc){if(_0x1ab0bc){var _0x3d0206=_0x1ab0bc['logo']&&fs[_0xd210('0x63')](path[_0xd210('0x64')](config[_0xd210('0x65')],_0x16317b,_[_0xd210('0x66')](_0x1ab0bc[_0xd210('0x5a')])))?path[_0xd210('0x64')](config[_0xd210('0x65')],_0x16317b,_['toLower'](_0x1ab0bc[_0xd210('0x5a')])):path['join'](config[_0xd210('0x65')],_0x16317b,_[_0xd210('0x66')]('default_logo.svg'));var _0x4caecd=_0xd210('0x67')+_[_0xd210('0x68')](_0xd210('0x5a'));if(_0x1ab0bc[_0x4caecd]||!_0x2c9672[_0xd210('0x69')]){_0x3d0206=path[_0xd210('0x64')](config[_0xd210('0x65')],_0x16317b,_[_0xd210('0x66')](_0xd210('0x6a')));}if(!fs[_0xd210('0x63')](_0x3d0206)){throw new db[(_0xd210('0x6b'))][(_0xd210('0x6c'))](_[_0xd210('0x68')]('logo')+_0xd210('0x6d'));}return _0x4a1e1a[_0xd210('0x6e')](_0x3d0206);}})[_0xd210('0x29')](handleError(_0x4a1e1a,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x481262,_0x3c3c6a,_0x5413ef){var _0x74cd3d='server/files/images/logos';var _0x27e701={'custom':![]};return utilLicense['getLicense']()[_0xd210('0x1e')](function(_0x208e68){if(_0x208e68){_0x27e701=_0x208e68;}return db['Setting'][_0xd210('0x55')]({'where':{'id':_0x481262[_0xd210('0x56')]['id']},'attributes':[_0xd210('0x5a'),_0xd210('0x5f'),_0xd210('0x6f'),_0xd210('0x70'),'defaultLogo',_0xd210('0x71'),_0xd210('0x61'),_0xd210('0x62')],'raw':!![]});})[_0xd210('0x1e')](handleEntityNotFound(_0x3c3c6a,null))[_0xd210('0x1e')](function(_0x3631e3){if(_0x3631e3){var _0x268302=_0x3631e3['loginLogo']&&fs[_0xd210('0x63')](path['join'](config['root'],_0x74cd3d,_[_0xd210('0x66')](_0x3631e3['loginLogo'])))?path[_0xd210('0x64')](config[_0xd210('0x65')],_0x74cd3d,_[_0xd210('0x66')](_0x3631e3[_0xd210('0x5f')])):path[_0xd210('0x64')](config[_0xd210('0x65')],_0x74cd3d,_[_0xd210('0x66')]('default_loginLogo.svg'));var _0x2bf78c=_0xd210('0x67')+_['upperFirst'](_0xd210('0x5f'));if(_0x3631e3[_0x2bf78c]||!_0x27e701[_0xd210('0x69')]){_0x268302=path[_0xd210('0x64')](config[_0xd210('0x65')],_0x74cd3d,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xd210('0x63')](_0x268302)){throw new db[(_0xd210('0x6b'))][(_0xd210('0x6c'))](_[_0xd210('0x68')](_0xd210('0x5f'))+_0xd210('0x6d'));}return _0x3c3c6a[_0xd210('0x6e')](_0x268302);}})[_0xd210('0x29')](handleError(_0x3c3c6a,null));};exports[_0xd210('0x72')]=function(_0x55a5b4,_0x45659f){return db[_0xd210('0x4f')][_0xd210('0x55')]({'where':{'id':_0x55a5b4[_0xd210('0x56')]['id']},'attributes':['securePassword']})[_0xd210('0x1e')](respondWithResult(_0x45659f,null))[_0xd210('0x29')](handleError(_0x45659f,null));};exports[_0xd210('0x73')]=function(_0x333432,_0x497b00,_0x31653c){if(_0x333432[_0xd210('0x58')]&&_0x333432[_0xd210('0x58')][_0xd210('0x59')]){_0x333432[_0xd210('0x57')][_0xd210('0x6f')]=_0x333432[_0xd210('0x58')][_0xd210('0x59')];}return db['Setting'][_0xd210('0x55')]({'where':{'id':_0x333432[_0xd210('0x56')]['id']}})[_0xd210('0x1e')](handleEntityNotFound(_0x497b00,null))[_0xd210('0x1e')](saveUpdates(_0x333432[_0xd210('0x57')],null))['then'](respondWithResult(_0x497b00,null))['catch'](handleError(_0x497b00,null));};var utilLicense=require('../../config/license/util');exports[_0xd210('0x74')]=function(_0x27c8bc,_0x52a0a0,_0x3da001){var _0x3f72a3=_0xd210('0x5d');var _0x1ab45d={'custom':![]};return utilLicense['getLicense']()[_0xd210('0x1e')](function(_0x39b3f9){if(_0x39b3f9){_0x1ab45d=_0x39b3f9;}return db[_0xd210('0x4f')]['find']({'where':{'id':_0x27c8bc[_0xd210('0x56')]['id']},'attributes':['logo',_0xd210('0x5f'),_0xd210('0x6f'),_0xd210('0x70'),_0xd210('0x60'),_0xd210('0x71'),'defaultPreferred',_0xd210('0x62')],'raw':!![]});})[_0xd210('0x1e')](handleEntityNotFound(_0x52a0a0,null))[_0xd210('0x1e')](function(_0x4b7b6c){if(_0x4b7b6c){var _0x4859eb=_0x4b7b6c[_0xd210('0x6f')]&&fs['existsSync'](path[_0xd210('0x64')](config[_0xd210('0x65')],_0x3f72a3,_[_0xd210('0x66')](_0x4b7b6c['preferred'])))?path['join'](config[_0xd210('0x65')],_0x3f72a3,_[_0xd210('0x66')](_0x4b7b6c['preferred'])):path[_0xd210('0x64')](config['root'],_0x3f72a3,_[_0xd210('0x66')]('default_preferred.png'));var _0x2d4722=_0xd210('0x67')+_['upperFirst'](_0xd210('0x6f'));if(_0x4b7b6c[_0x2d4722]||!_0x1ab45d[_0xd210('0x69')]||!_0x1ab45d[_0xd210('0x6f')]){_0x4859eb=path[_0xd210('0x64')](config[_0xd210('0x65')],_0x3f72a3,_[_0xd210('0x66')](_0xd210('0x75')));}if(!fs[_0xd210('0x63')](_0x4859eb)){throw new db['Sequelize']['ValidationError'](_[_0xd210('0x68')](_0xd210('0x6f'))+_0xd210('0x6d'));}return _0x52a0a0[_0xd210('0x6e')](_0x4859eb);}})[_0xd210('0x29')](handleError(_0x52a0a0,null));};exports['addFavicon']=function(_0x6fa51d,_0x13a636,_0xe8dd65){if(_0x6fa51d[_0xd210('0x58')]&&_0x6fa51d['file']['filename']){_0x6fa51d[_0xd210('0x57')][_0xd210('0x70')]=_0x6fa51d[_0xd210('0x58')][_0xd210('0x59')];}return db[_0xd210('0x4f')][_0xd210('0x55')]({'where':{'id':_0x6fa51d[_0xd210('0x56')]['id']}})['then'](handleEntityNotFound(_0x13a636,null))[_0xd210('0x1e')](saveUpdates(_0x6fa51d[_0xd210('0x57')],null))[_0xd210('0x1e')](respondWithResult(_0x13a636,null))[_0xd210('0x29')](handleError(_0x13a636,null));};var utilLicense=require('../../config/license/util');exports[_0xd210('0x76')]=function(_0x348cb4,_0xaa227d,_0x17b1af){var _0x50efeb=_0xd210('0x5d');var _0x25af7c={'custom':![]};return utilLicense[_0xd210('0x5e')]()[_0xd210('0x1e')](function(_0x242abb){if(_0x242abb){_0x25af7c=_0x242abb;}return db['Setting'][_0xd210('0x55')]({'where':{'id':_0x348cb4[_0xd210('0x56')]['id']},'attributes':[_0xd210('0x5a'),_0xd210('0x5f'),_0xd210('0x6f'),_0xd210('0x70'),_0xd210('0x60'),_0xd210('0x71'),_0xd210('0x61'),_0xd210('0x62')],'raw':!![]});})[_0xd210('0x1e')](handleEntityNotFound(_0xaa227d,null))[_0xd210('0x1e')](function(_0x4cf565){if(_0x4cf565){var _0xcbcebb=_0x4cf565['favicon']&&fs[_0xd210('0x63')](path[_0xd210('0x64')](config[_0xd210('0x65')],_0x50efeb,_[_0xd210('0x66')](_0x4cf565[_0xd210('0x70')])))?path[_0xd210('0x64')](config[_0xd210('0x65')],_0x50efeb,_[_0xd210('0x66')](_0x4cf565['favicon'])):path[_0xd210('0x64')](config[_0xd210('0x65')],_0x50efeb,_['toLower']('default_favicon.ico'));var _0x2a130f=_0xd210('0x67')+_[_0xd210('0x68')](_0xd210('0x70'));if(_0x4cf565[_0x2a130f]||!_0x25af7c[_0xd210('0x69')]){_0xcbcebb=path[_0xd210('0x64')](config['root'],_0x50efeb,_[_0xd210('0x66')](_0xd210('0x77')));}if(!fs['existsSync'](_0xcbcebb)){throw new db['Sequelize']['ValidationError'](_[_0xd210('0x68')](_0xd210('0x70'))+'\x20not\x20found');}return _0xaa227d[_0xd210('0x6e')](_0xcbcebb);}})[_0xd210('0x29')](handleError(_0xaa227d,null));};exports[_0xd210('0x78')]=function(_0x30af2b,_0x4ec0c6){var _0x3e15d3={'offset':moment()[_0xd210('0x79')]()};_0x3e15d3[_0xd210('0x7a')]=moment()[_0xd210('0x79')](_0x3e15d3[_0xd210('0x2d')])[_0xd210('0x7b')](_0xd210('0x7c'));return _0x4ec0c6[_0xd210('0x2a')](0xc8)[_0xd210('0x39')](_0x3e15d3);};
\ No newline at end of file
index cac8f74..c85a5c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0x7217,0x19e));var _0x7721=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x7217[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c49c723..b345a2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3ad=['message','result','catch','ShowSetting','Setting','find','options','raw','where','map','attributes','include','model','debug','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x23ffa1,_0x17f98a){var _0xb6eea2=function(_0x1b6a6a){while(--_0x1b6a6a){_0x23ffa1['push'](_0x23ffa1['shift']());}};_0xb6eea2(++_0x17f98a);}(_0xe3ad,0x97));var _0xde3a=function(_0x33021a,_0x3ddf62){_0x33021a=_0x33021a-0x0;var _0x1db0e7=_0xe3ad[_0x33021a];return _0x1db0e7;};'use strict';var _=require(_0xde3a('0x0'));var util=require(_0xde3a('0x1'));var moment=require(_0xde3a('0x2'));var BPromise=require('bluebird');var rs=require(_0xde3a('0x3'));var fs=require('fs');var Redis=require(_0xde3a('0x4'));var db=require(_0xde3a('0x5'))['db'];var utils=require(_0xde3a('0x6'));var logger=require('../../config/logger')(_0xde3a('0x7'));var config=require(_0xde3a('0x8'));var jayson=require(_0xde3a('0x9'));var client=jayson['client'][_0xde3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45a7b7,_0x58b201,_0x3f6ae7){return new BPromise(function(_0x44dfc5,_0x449db3){return client[_0xde3a('0xb')](_0x45a7b7,_0x3f6ae7)[_0xde3a('0xc')](function(_0x114e63){logger[_0xde3a('0xd')](_0xde3a('0xe'),_0x58b201,_0xde3a('0xf'));logger['debug'](_0xde3a('0x10'),_0x58b201,_0xde3a('0xf'),JSON['stringify'](_0x114e63));if(_0x114e63[_0xde3a('0x11')]){if(_0x114e63['error'][_0xde3a('0x12')]===0x1f4){logger['error'](_0xde3a('0xe'),_0x58b201,_0x114e63[_0xde3a('0x11')][_0xde3a('0x13')]);return _0x449db3(_0x114e63['error'][_0xde3a('0x13')]);}logger['error'](_0xde3a('0xe'),_0x58b201,_0x114e63['error'][_0xde3a('0x13')]);return _0x44dfc5(_0x114e63[_0xde3a('0x11')][_0xde3a('0x13')]);}else{logger[_0xde3a('0xd')]('Setting,\x20%s,\x20%s',_0x58b201,_0xde3a('0xf'));_0x44dfc5(_0x114e63[_0xde3a('0x14')][_0xde3a('0x13')]);}})[_0xde3a('0x15')](function(_0x3d00b8){logger['error'](_0xde3a('0xe'),_0x58b201,_0x3d00b8);_0x449db3(_0x3d00b8);});});}exports[_0xde3a('0x16')]=function(_0x2669d3){var _0x3ca757=this;return new Promise(function(_0x118cbc,_0x136989){return db[_0xde3a('0x17')][_0xde3a('0x18')]({'raw':_0x2669d3[_0xde3a('0x19')]?_0x2669d3['options'][_0xde3a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2669d3[_0xde3a('0x19')]?_0x2669d3[_0xde3a('0x19')][_0xde3a('0x1b')]||null:null,'attributes':_0x2669d3['options']?_0x2669d3[_0xde3a('0x19')]['attributes']||null:null,'include':_0x2669d3[_0xde3a('0x19')]?_0x2669d3[_0xde3a('0x19')]['include']?_[_0xde3a('0x1c')](_0x2669d3[_0xde3a('0x19')]['include'],function(_0x52ea0a){return{'model':db[_0x52ea0a['model']],'as':_0x52ea0a['as'],'attributes':_0x52ea0a[_0xde3a('0x1d')],'include':_0x52ea0a[_0xde3a('0x1e')]?_[_0xde3a('0x1c')](_0x52ea0a[_0xde3a('0x1e')],function(_0x7783a5){return{'model':db[_0x7783a5[_0xde3a('0x1f')]],'as':_0x7783a5['as'],'attributes':_0x7783a5[_0xde3a('0x1d')],'include':_0x7783a5[_0xde3a('0x1e')]?_[_0xde3a('0x1c')](_0x7783a5[_0xde3a('0x1e')],function(_0x1165f5){return{'model':db[_0x1165f5[_0xde3a('0x1f')]],'as':_0x1165f5['as'],'attributes':_0x1165f5[_0xde3a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xde3a('0xc')](function(_0x1dbcc6){logger[_0xde3a('0xd')](_0xde3a('0x16'),_0x2669d3);logger[_0xde3a('0x20')](_0xde3a('0x16'),_0x2669d3,JSON[_0xde3a('0x21')](_0x1dbcc6));_0x118cbc(_0x1dbcc6);})[_0xde3a('0x15')](function(_0x45fdcb){logger['error'](_0xde3a('0x16'),_0x45fdcb[_0xde3a('0x13')],_0x2669d3);_0x136989(_0x3ca757[_0xde3a('0x11')](0x1f4,_0x45fdcb[_0xde3a('0x13')]));});});};
\ No newline at end of file
+var _0xba42=['info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','ShowSetting','Setting','options','raw','where','attributes','map','include','model','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x36c90a,_0x24b9e6){var _0x44c0cd=function(_0x31a482){while(--_0x31a482){_0x36c90a['push'](_0x36c90a['shift']());}};_0x44c0cd(++_0x24b9e6);}(_0xba42,0x1b3));var _0x2ba4=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xba42[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0x2ba4('0x0'));var util=require(_0x2ba4('0x1'));var moment=require(_0x2ba4('0x2'));var BPromise=require(_0x2ba4('0x3'));var rs=require(_0x2ba4('0x4'));var fs=require('fs');var Redis=require(_0x2ba4('0x5'));var db=require(_0x2ba4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ba4('0x7'))(_0x2ba4('0x8'));var config=require('../../config/environment');var jayson=require(_0x2ba4('0x9'));var client=jayson[_0x2ba4('0xa')][_0x2ba4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e8f9,_0x466c8c,_0x27347a){return new BPromise(function(_0x49f104,_0xaecdd2){return client[_0x2ba4('0xc')](_0x19e8f9,_0x27347a)['then'](function(_0xe571e9){logger[_0x2ba4('0xd')](_0x2ba4('0xe'),_0x466c8c,_0x2ba4('0xf'));logger[_0x2ba4('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x466c8c,_0x2ba4('0xf'),JSON[_0x2ba4('0x11')](_0xe571e9));if(_0xe571e9[_0x2ba4('0x12')]){if(_0xe571e9['error']['code']===0x1f4){logger[_0x2ba4('0x12')](_0x2ba4('0xe'),_0x466c8c,_0xe571e9['error'][_0x2ba4('0x13')]);return _0xaecdd2(_0xe571e9[_0x2ba4('0x12')][_0x2ba4('0x13')]);}logger[_0x2ba4('0x12')]('Setting,\x20%s,\x20%s',_0x466c8c,_0xe571e9[_0x2ba4('0x12')][_0x2ba4('0x13')]);return _0x49f104(_0xe571e9[_0x2ba4('0x12')]['message']);}else{logger[_0x2ba4('0xd')](_0x2ba4('0xe'),_0x466c8c,_0x2ba4('0xf'));_0x49f104(_0xe571e9[_0x2ba4('0x14')][_0x2ba4('0x13')]);}})['catch'](function(_0x478de7){logger[_0x2ba4('0x12')](_0x2ba4('0xe'),_0x466c8c,_0x478de7);_0xaecdd2(_0x478de7);});});}exports[_0x2ba4('0x15')]=function(_0x268e5c){var _0x2a30f9=this;return new Promise(function(_0x1e9522,_0x4aca3a){return db[_0x2ba4('0x16')]['find']({'raw':_0x268e5c[_0x2ba4('0x17')]?_0x268e5c['options'][_0x2ba4('0x18')]===undefined?!![]:![]:!![],'where':_0x268e5c[_0x2ba4('0x17')]?_0x268e5c[_0x2ba4('0x17')][_0x2ba4('0x19')]||null:null,'attributes':_0x268e5c[_0x2ba4('0x17')]?_0x268e5c[_0x2ba4('0x17')][_0x2ba4('0x1a')]||null:null,'include':_0x268e5c[_0x2ba4('0x17')]?_0x268e5c[_0x2ba4('0x17')]['include']?_[_0x2ba4('0x1b')](_0x268e5c['options'][_0x2ba4('0x1c')],function(_0x36c50c){return{'model':db[_0x36c50c['model']],'as':_0x36c50c['as'],'attributes':_0x36c50c['attributes'],'include':_0x36c50c[_0x2ba4('0x1c')]?_[_0x2ba4('0x1b')](_0x36c50c[_0x2ba4('0x1c')],function(_0x4ff1fb){return{'model':db[_0x4ff1fb[_0x2ba4('0x1d')]],'as':_0x4ff1fb['as'],'attributes':_0x4ff1fb['attributes'],'include':_0x4ff1fb[_0x2ba4('0x1c')]?_[_0x2ba4('0x1b')](_0x4ff1fb[_0x2ba4('0x1c')],function(_0x51dc73){return{'model':db[_0x51dc73[_0x2ba4('0x1d')]],'as':_0x51dc73['as'],'attributes':_0x51dc73[_0x2ba4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2ba4('0x1e')](function(_0x6197e5){logger[_0x2ba4('0xd')](_0x2ba4('0x15'),_0x268e5c);logger[_0x2ba4('0x10')](_0x2ba4('0x15'),_0x268e5c,JSON[_0x2ba4('0x11')](_0x6197e5));_0x1e9522(_0x6197e5);})[_0x2ba4('0x1f')](function(_0x1c5cca){logger[_0x2ba4('0x12')](_0x2ba4('0x15'),_0x1c5cca[_0x2ba4('0x13')],_0x268e5c);_0x4aca3a(_0x2a30f9[_0x2ba4('0x12')](0x1f4,_0x1c5cca['message']));});});};
\ No newline at end of file
index 50f8a2b..a092f50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x48cdeb,_0x11cd60){var _0x3316cc=function(_0x53169a){while(--_0x53169a){_0x48cdeb['push'](_0x48cdeb['shift']());}};_0x3316cc(++_0x11cd60);}(_0x6aa7,0x178));var _0x76aa=function(_0x2855c0,_0x1540cf){_0x2855c0=_0x2855c0-0x0;var _0xa00580=_0x6aa7[_0x2855c0];return _0xa00580;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),auth[_0x76aa('0x8')](),controller['describe']);router[_0x76aa('0x9')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller['show']);router[_0x76aa('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router;
\ No newline at end of file
+var _0x55ca=['describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index'];(function(_0x375126,_0x514a8e){var _0x1f76bb=function(_0x22f2d0){while(--_0x22f2d0){_0x375126['push'](_0x375126['shift']());}};_0x1f76bb(++_0x514a8e);}(_0x55ca,0x126));var _0xa55c=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0x55ca[_0x435044];return _0x33d4c6;};'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['getApplications']);router['get'](_0xa55c('0x11'),auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0xa55c('0x12'),controller[_0xa55c('0x13')]);router[_0xa55c('0x7')](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x17')](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);router[_0xa55c('0x17')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller['addAnswer']);router[_0xa55c('0x17')](_0xa55c('0x19'),controller[_0xa55c('0x1a')]);router[_0xa55c('0x17')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['addApplications']);router['post'](_0xa55c('0x1b'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x1c')]);router['post'](_0xa55c('0x12'),controller[_0xa55c('0x1d')]);router['post'](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x1e')]);router[_0xa55c('0x1f')](_0xa55c('0xb'),auth['isAuthenticated'](),controller[_0xa55c('0x20')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x21')]);router['delete'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x22')]);router[_0xa55c('0x23')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x24')]);router[_0xa55c('0x23')](_0xa55c('0x14'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x25')]);module['exports']=router;
\ No newline at end of file
index 5dc9cad..10b14ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5245=['sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','connectel','clicksend','clickatell','bandwidth','csc','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5245,0x108));var _0x5524=function(_0x338b15,_0x3202d8){_0x338b15=_0x338b15-0x0;var _0x466e43=_0x5245[_0x338b15];return _0x466e43;};'use strict';var Sequelize=require(_0x5524('0x0'));var rs=require(_0x5524('0x1'));module[_0x5524('0x2')]={'name':{'type':Sequelize[_0x5524('0x3')],'unique':_0x5524('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x5524('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x5524('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x5524('0x3')],'defaultValue':function(){return rs[_0x5524('0x5')]();}},'phone':{'type':Sequelize[_0x5524('0x3')]},'type':{'type':Sequelize[_0x5524('0x6')](_0x5524('0x7'),'skebby',_0x5524('0x8'),_0x5524('0x9'),'plivo',_0x5524('0xa'),_0x5524('0xb'),_0x5524('0xc'),_0x5524('0xd'),'intelepeer')},'accountSid':{'type':Sequelize[_0x5524('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x5524('0x3')]},'smsMethod':{'type':Sequelize[_0x5524('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x5524('0x3')]},'password':{'type':Sequelize[_0x5524('0x3')]},'apiKey':{'type':Sequelize[_0x5524('0x3')]},'applicationId':{'type':Sequelize[_0x5524('0x3')]},'accountId':{'type':Sequelize[_0x5524('0x3')]},'senderString':{'type':Sequelize[_0x5524('0x3')]},'deliveryReport':{'type':Sequelize[_0x5524('0xe')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5524('0xf')],'defaultValue':function(){return _0x5524('0x10');}},'notificationSound':{'type':Sequelize[_0x5524('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5524('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5524('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5524('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5524('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x5524('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x5524('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5524('0x13'),'set':function(_0x1d8e48){if(!_0x1d8e48)this[_0x5524('0x14')](_0x5524('0x15'),null);this[_0x5524('0x14')]('mandatoryDisposition',_0x1d8e48);}}};
\ No newline at end of file
+var _0xeee5=['TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','twilio','connectel','clicksend','plivo','clickatell','infobip','intelepeer','ENUM','BOOLEAN'];(function(_0x5b000b,_0x59f8ae){var _0x53cf09=function(_0x32465e){while(--_0x32465e){_0x5b000b['push'](_0x5b000b['shift']());}};_0x53cf09(++_0x59f8ae);}(_0xeee5,0x1ab));var _0x5eee=function(_0x5cb052,_0x44f6df){_0x5cb052=_0x5cb052-0x0;var _0x337f47=_0xeee5[_0x5cb052];return _0x337f47;};'use strict';var Sequelize=require(_0x5eee('0x0'));var rs=require(_0x5eee('0x1'));module['exports']={'name':{'type':Sequelize[_0x5eee('0x2')],'unique':_0x5eee('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x5eee('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5eee('0x4')]();}},'phone':{'type':Sequelize[_0x5eee('0x2')]},'type':{'type':Sequelize['ENUM'](_0x5eee('0x5'),'skebby',_0x5eee('0x6'),_0x5eee('0x7'),_0x5eee('0x8'),_0x5eee('0x9'),'bandwidth','csc',_0x5eee('0xa'),_0x5eee('0xb'))},'accountSid':{'type':Sequelize[_0x5eee('0x2')]},'authId':{'type':Sequelize[_0x5eee('0x2')]},'authToken':{'type':Sequelize[_0x5eee('0x2')]},'smsMethod':{'type':Sequelize[_0x5eee('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x5eee('0x2')]},'password':{'type':Sequelize[_0x5eee('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x5eee('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x5eee('0x2')]},'deliveryReport':{'type':Sequelize[_0x5eee('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x5eee('0x2')]},'notificationTemplate':{'type':Sequelize[_0x5eee('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5eee('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5eee('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5eee('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5eee('0xf')],'comment':_0x5eee('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x5eee('0xd')],'defaultValue':![],'comment':_0x5eee('0x11'),'set':function(_0x409586){if(!_0x409586)this[_0x5eee('0x12')](_0x5eee('0x13'),null);this['setDataValue'](_0x5eee('0x14'),_0x409586);}}};
\ No newline at end of file
index 7813189..6190e1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fb9=['get','SmsAccounts','UserProfileResource','destroy','stack','name','send','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','map','keys','intersection','query','fields','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','options','findAll','rows','catch','show','filters','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','params','describe','Disposition','findOne','nolimit','order','pick','SmsAccountId','filter','removeDispositions','ids','CannedAnswer','removeAnswers','notify','sms','Applications','applications','orderBy','asc','account','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','From','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','plivo','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','interaction','created','autoclose','push','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','twilio','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','SmsApplication','bulkCreate','priority','getApplications','getInteractions','CmContact','Contact','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','spread','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','message_id','status_code','groupName','DELIVERED','intelepeer','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update'];(function(_0x40822a,_0x582b60){var _0x357420=function(_0x6cee0b){while(--_0x6cee0b){_0x40822a['push'](_0x40822a['shift']());}};_0x357420(++_0x582b60);}(_0x8fb9,0x19f));var _0x98fb=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x8fb9[_0x1e1965];return _0x1a2e96;};'use strict';var emlformat=require(_0x98fb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98fb('0x1'));var jsonpatch=require(_0x98fb('0x2'));var rp=require('request-promise');var moment=require(_0x98fb('0x3'));var BPromise=require(_0x98fb('0x4'));var Mustache=require(_0x98fb('0x5'));var util=require(_0x98fb('0x6'));var path=require(_0x98fb('0x7'));var sox=require(_0x98fb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98fb('0x9'));var _=require(_0x98fb('0xa'));var squel=require(_0x98fb('0xb'));var crypto=require(_0x98fb('0xc'));var jsforce=require(_0x98fb('0xd'));var deskjs=require(_0x98fb('0xe'));var toCsv=require(_0x98fb('0xf'));var querystring=require(_0x98fb('0x10'));var Papa=require(_0x98fb('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x98fb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98fb('0x13'));var logger=require(_0x98fb('0x14'))(_0x98fb('0x15'));var utils=require(_0x98fb('0x16'));var config=require(_0x98fb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x98fb('0x18'))['db'];config[_0x98fb('0x19')]=_[_0x98fb('0x1a')](config[_0x98fb('0x19')],{'host':_0x98fb('0x1b'),'port':0x18eb});var socket=require(_0x98fb('0x1c'))(new Redis(config['redis']));require(_0x98fb('0x1d'))[_0x98fb('0x1e')](socket);var jayson=require(_0x98fb('0x1f'));var client=jayson[_0x98fb('0x20')][_0x98fb('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x53f764,_0x20edfe,_0x4f5616,_0xcc9456){return new BPromise(function(_0x46a194,_0x3692fe){var _0x2796f6=_0xcc9456||client;return _0x2796f6[_0x98fb('0x22')](_0x53f764,_0x4f5616)[_0x98fb('0x23')](function(_0x40b20d){logger[_0x98fb('0x24')](_0x98fb('0x25'),_0x20edfe,'request\x20sent');logger[_0x98fb('0x26')](_0x98fb('0x27'),_0x20edfe,_0x98fb('0x28'),JSON['stringify'](_0x40b20d));if(_0x40b20d['error']){if(_0x40b20d['error'][_0x98fb('0x29')]===0x1f4){logger['error'](_0x98fb('0x25'),_0x20edfe,_0x40b20d[_0x98fb('0x2a')][_0x98fb('0x2b')]);return _0x3692fe(_0x40b20d[_0x98fb('0x2a')]['message']);}logger[_0x98fb('0x2a')](_0x98fb('0x25'),_0x20edfe,_0x40b20d[_0x98fb('0x2a')][_0x98fb('0x2b')]);return _0x46a194(_0x40b20d[_0x98fb('0x2a')][_0x98fb('0x2b')]);}else{logger[_0x98fb('0x24')](_0x98fb('0x25'),_0x20edfe,_0x98fb('0x28'));_0x46a194(_0x40b20d[_0x98fb('0x2c')]['message']);}})['catch'](function(_0x59cfa8){logger[_0x98fb('0x2a')]('SmsAccount,\x20%s,\x20%s',_0x20edfe,_0x59cfa8);_0x3692fe(_0x59cfa8);});});}function respondWithStatusCode(_0x439a7a,_0x4f0aa6){_0x4f0aa6=_0x4f0aa6||0xcc;return function(_0x291cf0){if(_0x291cf0){return _0x439a7a[_0x98fb('0x2d')](_0x4f0aa6);}return _0x439a7a[_0x98fb('0x2e')](_0x4f0aa6)[_0x98fb('0x2f')]();};}function respondWithResult(_0x420680,_0x3f5b9f){_0x3f5b9f=_0x3f5b9f||0xc8;return function(_0xb3274){if(_0xb3274){return _0x420680[_0x98fb('0x2e')](_0x3f5b9f)['json'](_0xb3274);}};}function respondWithFilteredResult(_0x3edcdd,_0x1b20a2){return function(_0x515548){if(_0x515548){var _0xeaf2dc=typeof _0x1b20a2[_0x98fb('0x30')]===_0x98fb('0x31')&&typeof _0x1b20a2['limit']==='undefined';var _0x10aaf5=_0x515548[_0x98fb('0x32')];var _0x439905=_0xeaf2dc?0x0:_0x1b20a2['offset'];var _0x2104d8=_0xeaf2dc?_0x515548[_0x98fb('0x32')]:_0x1b20a2['offset']+_0x1b20a2[_0x98fb('0x33')];var _0x17bb01;if(_0x2104d8>=_0x10aaf5){_0x2104d8=_0x10aaf5;_0x17bb01=0xc8;}else{_0x17bb01=0xce;}_0x3edcdd[_0x98fb('0x2e')](_0x17bb01);return _0x3edcdd[_0x98fb('0x34')](_0x98fb('0x35'),_0x439905+'-'+_0x2104d8+'/'+_0x10aaf5)[_0x98fb('0x36')](_0x515548);}return null;};}function patchUpdates(_0x4416d9){return function(_0x41f342){try{jsonpatch[_0x98fb('0x37')](_0x41f342,_0x4416d9,!![]);}catch(_0x181f41){return BPromise[_0x98fb('0x38')](_0x181f41);}return _0x41f342[_0x98fb('0x39')]();};}function saveUpdates(_0x83d6dd,_0x56efd7){return function(_0x27326e){if(_0x27326e){return _0x27326e[_0x98fb('0x3a')](_0x83d6dd)[_0x98fb('0x23')](function(_0x54fc1a){return _0x54fc1a;});}return null;};}function removeEntity(_0x43d042,_0x3a60ec){return function(_0x115209){if(_0x115209){return _0x115209['destroy']()[_0x98fb('0x23')](function(){var _0x351226=_0x115209[_0x98fb('0x3b')]({'plain':!![]});var _0x1aee65=_0x98fb('0x3c');return db[_0x98fb('0x3d')][_0x98fb('0x3e')]({'where':{'type':_0x1aee65,'resourceId':_0x351226['id']}})['then'](function(){return _0x115209;});})[_0x98fb('0x23')](function(){_0x43d042[_0x98fb('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57237e,_0x102a4a){return function(_0x4ea9ad){if(!_0x4ea9ad){_0x57237e['sendStatus'](0x194);}return _0x4ea9ad;};}function handleError(_0x241d47,_0x443749){_0x443749=_0x443749||0x1f4;return function(_0x5cfb50){logger[_0x98fb('0x2a')](_0x5cfb50[_0x98fb('0x3f')]);if(_0x5cfb50[_0x98fb('0x40')]){delete _0x5cfb50['name'];}_0x241d47[_0x98fb('0x2e')](_0x443749)[_0x98fb('0x41')](_0x5cfb50);};}exports['index']=function(_0x5d2a16,_0x99347){var _0x4a6616={'include':[{'model':db['Pause'],'as':_0x98fb('0x42')}]},_0x30f4c8={},_0x7b91d0={'count':0x0,'rows':[]};var _0x33ddcc=_['map'](db[_0x98fb('0x43')][_0x98fb('0x44')],function(_0x5dac8e){return{'name':_0x5dac8e[_0x98fb('0x45')],'type':_0x5dac8e[_0x98fb('0x46')][_0x98fb('0x47')]};});_0x30f4c8[_0x98fb('0x48')]=_[_0x98fb('0x49')](_0x33ddcc,_0x98fb('0x40'));_0x30f4c8['query']=_[_0x98fb('0x4a')](_0x5d2a16['query']);_0x30f4c8['filters']=_[_0x98fb('0x4b')](_0x30f4c8[_0x98fb('0x48')],_0x30f4c8[_0x98fb('0x4c')]);_0x4a6616['attributes']=_[_0x98fb('0x4b')](_0x30f4c8[_0x98fb('0x48')],qs[_0x98fb('0x4d')](_0x5d2a16[_0x98fb('0x4c')][_0x98fb('0x4d')]));_0x4a6616['attributes']=_0x4a6616[_0x98fb('0x4e')][_0x98fb('0x4f')]?_0x4a6616['attributes']:_0x30f4c8[_0x98fb('0x48')];if(!_0x5d2a16['query'][_0x98fb('0x50')]('nolimit')){_0x4a6616[_0x98fb('0x33')]=qs['limit'](_0x5d2a16[_0x98fb('0x4c')][_0x98fb('0x33')]);_0x4a6616[_0x98fb('0x30')]=qs[_0x98fb('0x30')](_0x5d2a16['query'][_0x98fb('0x30')]);}_0x4a6616['order']=qs['sort'](_0x5d2a16[_0x98fb('0x4c')][_0x98fb('0x51')]);_0x4a6616['where']=qs['filters'](_['pick'](_0x5d2a16[_0x98fb('0x4c')],_0x30f4c8['filters']),_0x33ddcc);if(_0x5d2a16['query']['filter']){_0x4a6616[_0x98fb('0x52')]=_[_0x98fb('0x53')](_0x4a6616[_0x98fb('0x52')],{'$or':_[_0x98fb('0x49')](_0x33ddcc,function(_0x4ae0f4){if(_0x4ae0f4[_0x98fb('0x46')]!==_0x98fb('0x54')){var _0x2ccfe7={};_0x2ccfe7[_0x4ae0f4[_0x98fb('0x40')]]={'$like':'%'+_0x5d2a16[_0x98fb('0x4c')]['filter']+'%'};return _0x2ccfe7;}})});}_0x4a6616=_[_0x98fb('0x53')]({},_0x4a6616,_0x5d2a16[_0x98fb('0x55')]);var _0x252502={'where':_0x4a6616['where']};return db['SmsAccount']['count'](_0x252502)['then'](function(_0x1536e2){_0x7b91d0[_0x98fb('0x32')]=_0x1536e2;if(_0x5d2a16['query']['includeAll']){_0x4a6616['include']=[{'all':!![]}];}return db['SmsAccount'][_0x98fb('0x56')](_0x4a6616);})[_0x98fb('0x23')](function(_0x14d0a3){_0x7b91d0[_0x98fb('0x57')]=_0x14d0a3;return _0x7b91d0;})[_0x98fb('0x23')](respondWithFilteredResult(_0x99347,_0x4a6616))[_0x98fb('0x58')](handleError(_0x99347,null));};exports[_0x98fb('0x59')]=function(_0x3e3735,_0x273500){var _0x18fe5b={'raw':![],'where':{'id':_0x3e3735['params']['id']},'include':[{'model':db['Pause'],'as':_0x98fb('0x42')}]},_0x1cb037={};_0x1cb037[_0x98fb('0x48')]=_[_0x98fb('0x4a')](db[_0x98fb('0x43')][_0x98fb('0x44')]);_0x1cb037[_0x98fb('0x4c')]=_[_0x98fb('0x4a')](_0x3e3735[_0x98fb('0x4c')]);_0x1cb037[_0x98fb('0x5a')]=_['intersection'](_0x1cb037['model'],_0x1cb037['query']);_0x18fe5b[_0x98fb('0x4e')]=_[_0x98fb('0x4b')](_0x1cb037[_0x98fb('0x48')],qs[_0x98fb('0x4d')](_0x3e3735[_0x98fb('0x4c')][_0x98fb('0x4d')]));_0x18fe5b[_0x98fb('0x4e')]=_0x18fe5b[_0x98fb('0x4e')][_0x98fb('0x4f')]?_0x18fe5b[_0x98fb('0x4e')]:_0x1cb037[_0x98fb('0x48')];if(_0x3e3735[_0x98fb('0x4c')][_0x98fb('0x5b')]){_0x18fe5b[_0x98fb('0x5c')]=[{'all':!![]}];}_0x18fe5b=_[_0x98fb('0x53')]({},_0x18fe5b,_0x3e3735[_0x98fb('0x55')]);return db[_0x98fb('0x43')][_0x98fb('0x5d')](_0x18fe5b)[_0x98fb('0x23')](handleEntityNotFound(_0x273500,null))[_0x98fb('0x23')](respondWithResult(_0x273500,null))['catch'](handleError(_0x273500,null));};exports['create']=function(_0x232834,_0x229276){return db['SmsAccount'][_0x98fb('0x5e')](_0x232834[_0x98fb('0x5f')],{})[_0x98fb('0x23')](function(_0x1d672a){var _0x512c2e=_0x232834['user'][_0x98fb('0x3b')]({'plain':!![]});if(!_0x512c2e)throw new Error(_0x98fb('0x60'));if(_0x512c2e[_0x98fb('0x61')]===_0x98fb('0x62')){var _0x459f11=_0x1d672a[_0x98fb('0x3b')]({'plain':!![]});var _0x40fe6e=_0x98fb('0x3c');return db['UserProfileSection']['find']({'where':{'name':_0x40fe6e,'userProfileId':_0x512c2e[_0x98fb('0x63')]},'raw':!![]})[_0x98fb('0x23')](function(_0xa64885){if(_0xa64885&&_0xa64885[_0x98fb('0x64')]===0x0){return db[_0x98fb('0x3d')][_0x98fb('0x5e')]({'name':_0x459f11[_0x98fb('0x40')],'resourceId':_0x459f11['id'],'type':_0xa64885[_0x98fb('0x40')],'sectionId':_0xa64885['id']},{})['then'](function(){return _0x1d672a;});}else{return _0x1d672a;}})[_0x98fb('0x58')](function(_0x40fd5a){logger[_0x98fb('0x2a')](_0x98fb('0x65'),_0x40fd5a);throw _0x40fd5a;});}return _0x1d672a;})['then'](respondWithResult(_0x229276,0xc9))[_0x98fb('0x58')](handleError(_0x229276,null));};exports['update']=function(_0x7970b7,_0x3314b7){if(_0x7970b7['body']['id']){delete _0x7970b7[_0x98fb('0x5f')]['id'];}return db['SmsAccount'][_0x98fb('0x5d')]({'where':{'id':_0x7970b7['params']['id']},'include':[{'model':db[_0x98fb('0x66')],'as':_0x98fb('0x42')}]})[_0x98fb('0x23')](handleEntityNotFound(_0x3314b7,null))[_0x98fb('0x23')](saveUpdates(_0x7970b7['body'],null))[_0x98fb('0x23')](respondWithResult(_0x3314b7,null))['catch'](handleError(_0x3314b7,null));};exports[_0x98fb('0x3e')]=function(_0x25d3f7,_0x2768bc){return db[_0x98fb('0x43')][_0x98fb('0x5d')]({'where':{'id':_0x25d3f7[_0x98fb('0x67')]['id']}})['then'](handleEntityNotFound(_0x2768bc,null))[_0x98fb('0x23')](removeEntity(_0x2768bc,null))['catch'](handleError(_0x2768bc,null));};exports['describe']=function(_0x7c213a,_0x3e7759){return db[_0x98fb('0x43')][_0x98fb('0x68')]()[_0x98fb('0x23')](respondWithResult(_0x3e7759,null))[_0x98fb('0x58')](handleError(_0x3e7759,null));};exports['addDisposition']=function(_0x517605,_0x31a41a,_0xfd662e){if(_0x517605[_0x98fb('0x5f')]['id']){delete _0x517605[_0x98fb('0x5f')]['id'];}return db[_0x98fb('0x43')][_0x98fb('0x5d')]({'where':{'id':_0x517605[_0x98fb('0x67')]['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x31a41a,null))[_0x98fb('0x23')](function(_0x4b433e){if(_0x4b433e){_0x517605['body']['SmsAccountId']=_0x4b433e['id'];return db[_0x98fb('0x69')][_0x98fb('0x5e')](_0x517605[_0x98fb('0x5f')]);}})[_0x98fb('0x23')](respondWithResult(_0x31a41a,null))[_0x98fb('0x58')](handleError(_0x31a41a,null));};exports['getDispositions']=function(_0x133f2e,_0x4052b8,_0x383f1e){var _0x1d3112={'raw':![],'where':{}};var _0x1213e0={};var _0x3b8ff6={'count':0x0,'rows':[]};return db['SmsAccount'][_0x98fb('0x6a')]({'where':{'id':_0x133f2e[_0x98fb('0x67')]['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x4052b8,null))[_0x98fb('0x23')](function(_0x19505b){if(_0x19505b){_0x1213e0['model']=_[_0x98fb('0x4a')](db[_0x98fb('0x69')]['rawAttributes']);_0x1213e0[_0x98fb('0x4c')]=_[_0x98fb('0x4a')](_0x133f2e['query']);_0x1213e0[_0x98fb('0x5a')]=_[_0x98fb('0x4b')](_0x1213e0[_0x98fb('0x48')],_0x1213e0[_0x98fb('0x4c')]);_0x1d3112[_0x98fb('0x4e')]=_['intersection'](_0x1213e0['model'],qs[_0x98fb('0x4d')](_0x133f2e[_0x98fb('0x4c')][_0x98fb('0x4d')]));_0x1d3112[_0x98fb('0x4e')]=_0x1d3112[_0x98fb('0x4e')][_0x98fb('0x4f')]?_0x1d3112[_0x98fb('0x4e')]:_0x1213e0[_0x98fb('0x48')];if(!_0x133f2e['query'][_0x98fb('0x50')](_0x98fb('0x6b'))){_0x1d3112['limit']=qs['limit'](_0x133f2e[_0x98fb('0x4c')][_0x98fb('0x33')]);_0x1d3112[_0x98fb('0x30')]=qs[_0x98fb('0x30')](_0x133f2e[_0x98fb('0x4c')][_0x98fb('0x30')]);}_0x1d3112[_0x98fb('0x6c')]=qs[_0x98fb('0x51')](_0x133f2e[_0x98fb('0x4c')][_0x98fb('0x51')]);_0x1d3112[_0x98fb('0x52')]=qs[_0x98fb('0x5a')](_[_0x98fb('0x6d')](_0x133f2e[_0x98fb('0x4c')],_0x1213e0['filters']));_0x1d3112[_0x98fb('0x52')][_0x98fb('0x6e')]=_0x19505b['id'];if(_0x133f2e[_0x98fb('0x4c')][_0x98fb('0x6f')]){_0x1d3112[_0x98fb('0x52')]=_[_0x98fb('0x53')](_0x1d3112['where'],{'$or':_[_0x98fb('0x49')](_0x1d3112['attributes'],function(_0xf93006){var _0x4c59bb={};_0x4c59bb[_0xf93006]={'$like':'%'+_0x133f2e['query'][_0x98fb('0x6f')]+'%'};return _0x4c59bb;})});}_0x1d3112=_['merge']({},_0x1d3112,_0x133f2e[_0x98fb('0x55')]);return db['Disposition'][_0x98fb('0x32')]({'where':_0x1d3112['where']})['then'](function(_0x2eecd4){_0x3b8ff6[_0x98fb('0x32')]=_0x2eecd4;if(_0x133f2e[_0x98fb('0x4c')][_0x98fb('0x5b')]){_0x1d3112[_0x98fb('0x5c')]=[{'all':!![]}];}return db[_0x98fb('0x69')][_0x98fb('0x56')](_0x1d3112);})[_0x98fb('0x23')](function(_0x2fffa0){_0x3b8ff6[_0x98fb('0x57')]=_0x2fffa0;return _0x3b8ff6;});}})['then'](respondWithFilteredResult(_0x4052b8,_0x1d3112))[_0x98fb('0x58')](handleError(_0x4052b8,null));};exports[_0x98fb('0x70')]=function(_0xf185bc,_0x2647a5,_0x1155ab){return db[_0x98fb('0x43')][_0x98fb('0x5d')]({'where':{'id':_0xf185bc['params']['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x2647a5,null))[_0x98fb('0x23')](function(_0x5deee7){if(_0x5deee7){return _0x5deee7['removeDispositions'](_0xf185bc[_0x98fb('0x4c')][_0x98fb('0x71')]);}})[_0x98fb('0x23')](respondWithStatusCode(_0x2647a5,null))[_0x98fb('0x58')](handleError(_0x2647a5,null));};exports['addAnswer']=function(_0x3e06fc,_0x412c85,_0x48bc18){if(_0x3e06fc[_0x98fb('0x5f')]['id']){delete _0x3e06fc['body']['id'];}return db[_0x98fb('0x43')][_0x98fb('0x5d')]({'where':{'id':_0x3e06fc['params']['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x412c85,null))['then'](function(_0x5e8b62){if(_0x5e8b62){_0x3e06fc[_0x98fb('0x5f')][_0x98fb('0x6e')]=_0x5e8b62['id'];return db['CannedAnswer']['create'](_0x3e06fc[_0x98fb('0x5f')]);}})[_0x98fb('0x23')](respondWithResult(_0x412c85,null))[_0x98fb('0x58')](handleError(_0x412c85,null));};exports['getAnswers']=function(_0x2bb671,_0x3c7c8f,_0x5e7d3d){var _0x6fdd37={'raw':![],'where':{}};var _0x424b43={};var _0x5f3c39={'count':0x0,'rows':[]};return db[_0x98fb('0x43')]['findOne']({'where':{'id':_0x2bb671[_0x98fb('0x67')]['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x3c7c8f,null))[_0x98fb('0x23')](function(_0x16e8b6){if(_0x16e8b6){_0x424b43[_0x98fb('0x48')]=_[_0x98fb('0x4a')](db[_0x98fb('0x72')][_0x98fb('0x44')]);_0x424b43['query']=_[_0x98fb('0x4a')](_0x2bb671['query']);_0x424b43[_0x98fb('0x5a')]=_[_0x98fb('0x4b')](_0x424b43[_0x98fb('0x48')],_0x424b43[_0x98fb('0x4c')]);_0x6fdd37['attributes']=_[_0x98fb('0x4b')](_0x424b43['model'],qs['fields'](_0x2bb671[_0x98fb('0x4c')][_0x98fb('0x4d')]));_0x6fdd37[_0x98fb('0x4e')]=_0x6fdd37[_0x98fb('0x4e')][_0x98fb('0x4f')]?_0x6fdd37[_0x98fb('0x4e')]:_0x424b43[_0x98fb('0x48')];if(!_0x2bb671[_0x98fb('0x4c')][_0x98fb('0x50')](_0x98fb('0x6b'))){_0x6fdd37[_0x98fb('0x33')]=qs[_0x98fb('0x33')](_0x2bb671[_0x98fb('0x4c')][_0x98fb('0x33')]);_0x6fdd37[_0x98fb('0x30')]=qs[_0x98fb('0x30')](_0x2bb671[_0x98fb('0x4c')][_0x98fb('0x30')]);}_0x6fdd37[_0x98fb('0x6c')]=qs[_0x98fb('0x51')](_0x2bb671[_0x98fb('0x4c')][_0x98fb('0x51')]);_0x6fdd37[_0x98fb('0x52')]=qs[_0x98fb('0x5a')](_[_0x98fb('0x6d')](_0x2bb671['query'],_0x424b43[_0x98fb('0x5a')]));_0x6fdd37['where'][_0x98fb('0x6e')]=_0x16e8b6['id'];if(_0x2bb671[_0x98fb('0x4c')]['filter']){_0x6fdd37['where']=_[_0x98fb('0x53')](_0x6fdd37[_0x98fb('0x52')],{'$or':_['map'](_0x6fdd37['attributes'],function(_0x43dcf4){var _0x5de733={};_0x5de733[_0x43dcf4]={'$like':'%'+_0x2bb671[_0x98fb('0x4c')][_0x98fb('0x6f')]+'%'};return _0x5de733;})});}_0x6fdd37=_[_0x98fb('0x53')]({},_0x6fdd37,_0x2bb671[_0x98fb('0x55')]);return db['CannedAnswer']['count']({'where':_0x6fdd37[_0x98fb('0x52')]})['then'](function(_0x312523){_0x5f3c39[_0x98fb('0x32')]=_0x312523;if(_0x2bb671[_0x98fb('0x4c')][_0x98fb('0x5b')]){_0x6fdd37[_0x98fb('0x5c')]=[{'all':!![]}];}return db[_0x98fb('0x72')][_0x98fb('0x56')](_0x6fdd37);})[_0x98fb('0x23')](function(_0x865a1b){_0x5f3c39[_0x98fb('0x57')]=_0x865a1b;return _0x5f3c39;});}})['then'](respondWithFilteredResult(_0x3c7c8f,_0x6fdd37))[_0x98fb('0x58')](handleError(_0x3c7c8f,null));};exports[_0x98fb('0x73')]=function(_0x246f3,_0x3c65d5,_0x3b01c5){return db[_0x98fb('0x43')]['find']({'where':{'id':_0x246f3[_0x98fb('0x67')]['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x3c65d5,null))[_0x98fb('0x23')](function(_0x40b88d){if(_0x40b88d){return _0x40b88d[_0x98fb('0x73')](_0x246f3[_0x98fb('0x4c')][_0x98fb('0x71')]);}})[_0x98fb('0x23')](respondWithStatusCode(_0x3c65d5,null))['catch'](handleError(_0x3c65d5,null));};exports[_0x98fb('0x74')]=function(_0x688bd,_0x42743f,_0x2f7ba9){var _0x433a15={'channel':_0x98fb('0x75')};var _0x7f0ef0=[];var _0x1efe65=[];var _0x267c38={};return db[_0x98fb('0x43')][_0x98fb('0x5d')]({'where':{'id':_0x688bd['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0x98fb('0x76')}]})['then'](handleEntityNotFound(_0x42743f,null))[_0x98fb('0x23')](function(_0x56b078){_0x433a15['account']=_0x56b078;_0x433a15[_0x98fb('0x77')]=_[_0x98fb('0x78')](_0x56b078[_0x98fb('0x76')],['priority'],[_0x98fb('0x79')]);if(_0x433a15[_0x98fb('0x7a')][_0x98fb('0x76')]){delete _0x433a15[_0x98fb('0x7a')][_0x98fb('0x76')];}return db['CmContact'][_0x98fb('0x68')]();})[_0x98fb('0x23')](function(_0x5331c1){if(!_0x5331c1){throw new db[(_0x98fb('0x7b'))][(_0x98fb('0x7c'))](_0x98fb('0x7d'));}_0x7f0ef0=_['difference'](_['keys'](_0x5331c1),[_0x98fb('0x7e'),_0x98fb('0x7f')]);_0x1efe65=_[_0x98fb('0x80')](_['keys'](_0x5331c1),[_0x98fb('0x7e'),_0x98fb('0x7f'),_0x98fb('0x81'),_0x98fb('0x82')]);_0x433a15[_0x98fb('0x5f')]={'mapKey':_0x98fb('0x83')};if(_0x433a15[_0x98fb('0x7a')]['type']){switch(_0x433a15[_0x98fb('0x7a')][_0x98fb('0x46')]){case'twilio':_0x433a15[_0x98fb('0x5f')]['from']=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x84')];_0x433a15[_0x98fb('0x5f')]['body']=_0x688bd['body']['Body'];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x85')]=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x86')];break;case _0x98fb('0x87'):_0x433a15[_0x98fb('0x5f')][_0x98fb('0x88')]='+'+_0x688bd[_0x98fb('0x5f')][_0x98fb('0x89')];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x5f')]=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x8a')];break;case _0x98fb('0x8b'):_0x433a15[_0x98fb('0x5f')]['from']=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x88')];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x5f')]=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x2b')];break;case _0x98fb('0x8c'):_0x433a15[_0x98fb('0x5f')][_0x98fb('0x88')]=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x88')];_0x433a15['body'][_0x98fb('0x5f')]=_0x688bd['body'][_0x98fb('0x5f')];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x85')]=_0x688bd[_0x98fb('0x5f')]['message_id'];break;case _0x98fb('0x8d'):_0x433a15['body'][_0x98fb('0x88')]=_0x688bd['body']['From'];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x5f')]=_0x688bd['body']['Text'];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x85')]=_0x688bd['body']['MessageUUID'];break;case _0x98fb('0x8e'):_0x433a15['body'][_0x98fb('0x88')]='+'+_0x688bd['body']['results'][0x0][_0x98fb('0x88')];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x5f')]=_0x688bd[_0x98fb('0x5f')]['results'][0x0][_0x98fb('0x8a')];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x85')]=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x8f')][0x0][_0x98fb('0x85')];break;case _0x98fb('0x90'):_0x433a15[_0x98fb('0x5f')][_0x98fb('0x88')]=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x91')];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x5f')]=_0x688bd['body'][_0x98fb('0x92')][_0x98fb('0x2b')];break;case _0x98fb('0x93'):_0x433a15[_0x98fb('0x5f')]['from']=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x94')];_0x433a15[_0x98fb('0x5f')]['body']=_0x688bd[_0x98fb('0x5f')]['text'];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x85')]=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x95')];break;case _0x98fb('0x96'):_0x433a15['body'][_0x98fb('0x85')]=_0x688bd[_0x98fb('0x5f')][0x0][_0x98fb('0x2b')]['id'];_0x433a15['body'][_0x98fb('0x88')]=_0x688bd[_0x98fb('0x5f')][0x0][_0x98fb('0x2b')]['from'];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x5f')]=_0x688bd[_0x98fb('0x5f')][0x0][_0x98fb('0x2b')][_0x98fb('0x8a')];break;case'intelepeer':_0x433a15[_0x98fb('0x5f')]['from']=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x88')];_0x433a15[_0x98fb('0x5f')][_0x98fb('0x5f')]=_0x688bd['body']['message'];_0x433a15['body'][_0x98fb('0x85')]=_0x688bd[_0x98fb('0x5f')][_0x98fb('0x97')];break;}}if(_0x433a15['body']['id']){delete _0x433a15[_0x98fb('0x5f')]['id'];}if(_['isNil'](_0x433a15['body'][_0x98fb('0x88')])){throw new db['Sequelize'][(_0x98fb('0x7c'))](_0x98fb('0x98'));}if(_[_0x98fb('0x99')](_0x433a15[_0x98fb('0x5f')]['body'])||_0x433a15[_0x98fb('0x5f')][_0x98fb('0x5f')]===''){throw new db[(_0x98fb('0x7b'))][(_0x98fb('0x7c'))](_0x98fb('0x9a'));}if(_['isNil'](_0x433a15[_0x98fb('0x5f')][_0x98fb('0x9b')])){throw new db['Sequelize'][(_0x98fb('0x7c'))](_0x98fb('0x9c')+_0x1efe65);}if(!_['includes'](_0x1efe65,_0x433a15[_0x98fb('0x5f')][_0x98fb('0x9b')])){throw new db[(_0x98fb('0x7b'))][(_0x98fb('0x7c'))](_0x98fb('0x9d')+_0x1efe65);}_0x267c38[_0x433a15[_0x98fb('0x5f')][_0x98fb('0x9b')]]=_0x433a15[_0x98fb('0x5f')][_0x98fb('0x88')];return db[_0x98fb('0x9e')][_0x98fb('0x5d')]({'where':{'id':_0x433a15['account']['ListId']},'include':[{'model':db['CmContact'],'as':_0x98fb('0x9f'),'where':_0x267c38,'limit':0x1,'order':[['updatedAt',_0x98fb('0xa0')]]}]});})[_0x98fb('0x23')](handleEntityNotFound(_0x42743f,null))[_0x98fb('0x23')](function(_0x3c36ba){if(_0x3c36ba){_0x433a15[_0x98fb('0xa1')]=_[_0x98fb('0xa2')](_0x3c36ba,[_0x98fb('0x9f')]);if(_0x3c36ba[_0x98fb('0x9f')][_0x98fb('0x4f')]){return _0x3c36ba['Contacts'][0x0];}var _0x562ac7=_[_0x98fb('0x1a')](_0x433a15['body'],{'firstName':_0x433a15[_0x98fb('0x5f')][_0x98fb('0x88')],'ListId':_0x3c36ba['id']});_0x562ac7[_0x433a15[_0x98fb('0x5f')][_0x98fb('0x9b')]]=_0x433a15['body'][_0x98fb('0x88')];return db['CmContact'][_0x98fb('0x5e')](_0x562ac7,{'fields':_0x7f0ef0,'raw':!![]});}})[_0x98fb('0x23')](handleEntityNotFound(_0x42743f,null))[_0x98fb('0x23')](function(_0x263d34){if(_0x263d34){_0x433a15[_0x98fb('0xa3')]=_0x263d34;var _0x1b2a84={'ContactId':_0x263d34['id'],'phone':_0x433a15[_0x98fb('0x5f')][_0x98fb('0x88')],'SmsAccountId':_0x688bd[_0x98fb('0x67')]['id']};var _0x3a9d49={'ContactId':_0x263d34['id'],'SmsAccountId':_0x688bd[_0x98fb('0x67')]['id'],'closed':![]};return db[_0x98fb('0xa4')][_0x98fb('0x5d')]({'where':_0x3a9d49})[_0x98fb('0x23')](function(_0xe57ae7){if(_0xe57ae7){return[_0xe57ae7,![]];}return db[_0x98fb('0xa4')][_0x98fb('0x5e')](_0x1b2a84)['then'](function(_0x247a45){return[_0x247a45,!![]];});});}})['spread'](function(_0x56a092,_0x1333e5){_0x433a15[_0x98fb('0xa5')]=_0x56a092['get']({'plain':!![]});_0x433a15[_0x98fb('0xa5')][_0x98fb('0xa6')]=![];if(_0x1333e5){if(_0x433a15[_0x98fb('0x7a')][_0x98fb('0xa7')]){_0x433a15[_0x98fb('0x77')][_0x98fb('0xa8')]({'id':0x0,'priority':_0x433a15[_0x98fb('0x77')][_0x98fb('0x4f')]+0x1,'app':'close','appdata':_0x98fb('0xa9'),'interval':_0x98fb('0xaa')});}_0x433a15[_0x98fb('0xa5')][_0x98fb('0xa6')]=!![];}return db[_0x98fb('0xab')]['create']({'phone':_0x433a15[_0x98fb('0x5f')][_0x98fb('0x88')],'messageId':_0x433a15['body'][_0x98fb('0x85')],'body':_0x433a15[_0x98fb('0x5f')]['body'],'SmsAccountId':_0x688bd[_0x98fb('0x67')]['id'],'SmsInteractionId':_0x56a092['id'],'direction':'in','ContactId':_0x56a092[_0x98fb('0xac')],'AttachmentId':_0x433a15[_0x98fb('0x5f')][_0x98fb('0xad')]});})[_0x98fb('0x23')](function(_0x10473f){_0x433a15[_0x98fb('0x2b')]=_0x10473f;if(_0x433a15['interaction'][_0x98fb('0xae')]){return db['User'][_0x98fb('0x5d')]({'attributes':['id',_0x98fb('0x40')],'where':{'id':_0x433a15[_0x98fb('0xa5')][_0x98fb('0xae')]}})[_0x98fb('0x23')](function(_0x40f907){if(_0x40f907){_0x433a15[_0x98fb('0x77')][_0x98fb('0xaf')]({'id':0x0,'priority':0x0,'app':_0x98fb('0xb0'),'appdata':_0x40f907[_0x98fb('0x40')]+','+(_0x433a15[_0x98fb('0x7a')][_0x98fb('0xb1')]||0xa),'interval':_0x98fb('0xaa')});}return respondWithRpcPromise(_0x98fb('0xb2'),_0x98fb('0xb3'),_0x433a15);});}return respondWithRpcPromise('Start',_0x98fb('0xb3'),_0x433a15);})['then'](function(_0x2669f9){if(_0x2669f9){var _0x277226=0xc8;var _0x1ce992=_0x98fb('0xb4');logger['info'](_0x98fb('0x27'),_0x1ce992,_0x277226,_0x98fb('0xb5'));logger[_0x98fb('0x26')](_0x98fb('0xb6'),_0x1ce992,_0x277226,_0x98fb('0xb5'),JSON[_0x98fb('0xb7')](_0x2669f9));if(_0x433a15[_0x98fb('0x7a')][_0x98fb('0x46')]===_0x98fb('0xb8')){return _0x42743f[_0x98fb('0x2e')](_0x277226)[_0x98fb('0x34')](_0x98fb('0xb9'),_0x98fb('0xba'))[_0x98fb('0x41')](_0x98fb('0xbb'));}else{return _0x42743f[_0x98fb('0x2e')](_0x277226)['json'](_0x2669f9);}}})[_0x98fb('0x58')](handleError(_0x42743f,null));};exports[_0x98fb('0xbc')]=function(_0x18b95f,_0x4ac48e,_0x506c6a){return db['SmsAccount'][_0x98fb('0x6a')]({'where':{'id':_0x18b95f[_0x98fb('0x67')]['id']}})['then'](handleEntityNotFound(_0x4ac48e,null))[_0x98fb('0x23')](function(_0x51abd5){if(_0x51abd5){return db[_0x98fb('0xbd')][_0x98fb('0xbe')](function(_0x3530d7){return db[_0x98fb('0xbf')][_0x98fb('0x3e')]({'where':{'SmsAccountId':_0x18b95f[_0x98fb('0x67')]['id']},'transaction':_0x3530d7})[_0x98fb('0x23')](function(_0x53b251){var _0x25a706=_[_0x98fb('0x49')](_0x18b95f['body'],function(_0x420cde){_0x420cde['SmsAccountId']=_0x18b95f['params']['id'];return _0x420cde;});return db[_0x98fb('0xbf')][_0x98fb('0xc0')](_0x25a706,{'transaction':_0x3530d7});});})[_0x98fb('0x23')](function(){return db[_0x98fb('0xbf')]['findAndCountAll']({'where':{'SmsAccountId':_0x18b95f[_0x98fb('0x67')]['id']},'order':_0x98fb('0xc1')});});}})['then'](respondWithResult(_0x4ac48e,null))[_0x98fb('0x58')](handleError(_0x4ac48e,null));};exports['getApplications']=function(_0x596297,_0x489239,_0x515110){var _0x569e16={};var _0x25d90a={};var _0x14d893;var _0x78cd9a;return db[_0x98fb('0x43')]['findOne']({'where':{'id':_0x596297[_0x98fb('0x67')]['id']}})['then'](handleEntityNotFound(_0x489239,null))['then'](function(_0x5dc24e){if(_0x5dc24e){_0x14d893=_0x5dc24e;_0x25d90a[_0x98fb('0x48')]=_[_0x98fb('0x4a')](db[_0x98fb('0xbf')][_0x98fb('0x44')]);_0x25d90a[_0x98fb('0x4c')]=_[_0x98fb('0x4a')](_0x596297[_0x98fb('0x4c')]);_0x25d90a['filters']=_[_0x98fb('0x4b')](_0x25d90a['model'],_0x25d90a[_0x98fb('0x4c')]);_0x569e16[_0x98fb('0x4e')]=_['intersection'](_0x25d90a['model'],qs[_0x98fb('0x4d')](_0x596297['query'][_0x98fb('0x4d')]));_0x569e16[_0x98fb('0x4e')]=_0x569e16[_0x98fb('0x4e')][_0x98fb('0x4f')]?_0x569e16[_0x98fb('0x4e')]:_0x25d90a['model'];_0x569e16[_0x98fb('0x6c')]=qs[_0x98fb('0x51')](_0x596297[_0x98fb('0x4c')][_0x98fb('0x51')]);_0x569e16[_0x98fb('0x52')]=qs[_0x98fb('0x5a')](_[_0x98fb('0x6d')](_0x596297['query'],_0x25d90a[_0x98fb('0x5a')]));if(_0x596297['query'][_0x98fb('0x6f')]){_0x569e16[_0x98fb('0x52')]=_[_0x98fb('0x53')](_0x569e16['where'],{'$or':_[_0x98fb('0x49')](_0x569e16[_0x98fb('0x4e')],function(_0x40f101){var _0x174796={};_0x174796[_0x40f101]={'$like':'%'+_0x596297[_0x98fb('0x4c')][_0x98fb('0x6f')]+'%'};return _0x174796;})});}_0x569e16=_[_0x98fb('0x53')]({},_0x569e16,_0x596297[_0x98fb('0x55')]);return _0x14d893[_0x98fb('0xc2')](_0x569e16);}})[_0x98fb('0x23')](function(_0x551e73){if(_0x551e73){_0x78cd9a=_0x551e73['length'];if(!_0x596297[_0x98fb('0x4c')]['hasOwnProperty'](_0x98fb('0x6b'))){_0x569e16['limit']=qs['limit'](_0x596297['query']['limit']);_0x569e16[_0x98fb('0x30')]=qs[_0x98fb('0x30')](_0x596297['query'][_0x98fb('0x30')]);}return _0x14d893[_0x98fb('0xc2')](_0x569e16);}})[_0x98fb('0x23')](function(_0x3becfe){if(_0x3becfe){return _0x3becfe?{'count':_0x78cd9a,'rows':_0x3becfe}:null;}})[_0x98fb('0x23')](respondWithResult(_0x489239,null))['catch'](handleError(_0x489239,null));};exports[_0x98fb('0xc3')]=function(_0x2945dd,_0x3d0f24,_0x329657){var _0x3490b3={'raw':![],'where':{}};var _0x51516c={};var _0x19f15f={'count':0x0,'rows':[]};return db[_0x98fb('0x43')]['findOne']({'where':{'id':_0x2945dd['params']['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x3d0f24,null))[_0x98fb('0x23')](function(_0x2b92de){if(_0x2b92de){_0x51516c[_0x98fb('0x48')]=_[_0x98fb('0x4a')](db['SmsInteraction'][_0x98fb('0x44')]);_0x51516c[_0x98fb('0x4c')]=_[_0x98fb('0x4a')](_0x2945dd[_0x98fb('0x4c')]);_0x51516c[_0x98fb('0x5a')]=_['intersection'](_0x51516c[_0x98fb('0x48')],_0x51516c['query']);_0x3490b3[_0x98fb('0x4e')]=_[_0x98fb('0x4b')](_0x51516c['model'],qs[_0x98fb('0x4d')](_0x2945dd['query']['fields']));_0x3490b3[_0x98fb('0x4e')]=_0x3490b3['attributes'][_0x98fb('0x4f')]?_0x3490b3[_0x98fb('0x4e')]:_0x51516c[_0x98fb('0x48')];if(!_0x2945dd[_0x98fb('0x4c')]['hasOwnProperty'](_0x98fb('0x6b'))){_0x3490b3['limit']=qs['limit'](_0x2945dd[_0x98fb('0x4c')][_0x98fb('0x33')]);_0x3490b3['offset']=qs[_0x98fb('0x30')](_0x2945dd[_0x98fb('0x4c')][_0x98fb('0x30')]);}_0x3490b3[_0x98fb('0x6c')]=qs[_0x98fb('0x51')](_0x2945dd[_0x98fb('0x4c')]['sort']);_0x3490b3[_0x98fb('0x52')]=qs[_0x98fb('0x5a')](_[_0x98fb('0x6d')](_0x2945dd[_0x98fb('0x4c')],_0x51516c['filters']));_0x3490b3[_0x98fb('0x52')]['SmsAccountId']=_0x2b92de['id'];if(_0x2945dd[_0x98fb('0x4c')][_0x98fb('0x6f')]){_0x3490b3[_0x98fb('0x52')]=_['merge'](_0x3490b3[_0x98fb('0x52')],{'$or':_['map'](_0x3490b3[_0x98fb('0x4e')],function(_0x252098){var _0x349472={};_0x349472[_0x252098]={'$like':'%'+_0x2945dd['query']['filter']+'%'};return _0x349472;})});}_0x3490b3=_[_0x98fb('0x53')]({},_0x3490b3,_0x2945dd[_0x98fb('0x55')]);return db[_0x98fb('0xa4')][_0x98fb('0x32')]({'where':_0x3490b3[_0x98fb('0x52')]})[_0x98fb('0x23')](function(_0x18daf1){_0x19f15f[_0x98fb('0x32')]=_0x18daf1;if(_0x2945dd['query'][_0x98fb('0x5b')]){_0x3490b3[_0x98fb('0x5c')]=[{'model':db[_0x98fb('0xc4')],'as':_0x98fb('0xc5'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x98fb('0x40'),_0x98fb('0xc6'),_0x98fb('0xc7')],'required':![]},{'model':db[_0x98fb('0xc8')],'as':_0x98fb('0xc9'),'attributes':['id',_0x98fb('0x40'),_0x98fb('0xca')],'where':_0x2945dd[_0x98fb('0x4c')][_0x98fb('0xcb')]?{'id':_0x2945dd[_0x98fb('0x4c')]['tag']}:undefined,'required':_0x2945dd['query'][_0x98fb('0xcb')]?!![]:![]}];}return db['SmsInteraction'][_0x98fb('0x56')](_0x3490b3);})['then'](function(_0x7c91d7){_0x19f15f[_0x98fb('0x57')]=_0x7c91d7;return _0x19f15f;});}})[_0x98fb('0x23')](respondWithFilteredResult(_0x3d0f24,_0x3490b3))['catch'](handleError(_0x3d0f24,null));};exports[_0x98fb('0x41')]=function(_0x5be3e6,_0x2cf322,_0x904f42){var _0x444f58,_0x143e6a,_0x56e435;if(_[_0x98fb('0x99')](_0x5be3e6[_0x98fb('0x5f')][_0x98fb('0x5f')])||_0x5be3e6[_0x98fb('0x5f')][_0x98fb('0x5f')]===''){throw new db['Sequelize'][(_0x98fb('0x7c'))](_0x98fb('0x9a'));}if(_['isNil'](_0x5be3e6[_0x98fb('0x5f')]['to'])){throw new db['Sequelize'][(_0x98fb('0x7c'))](_0x98fb('0xcc'));}_0x444f58=_0x5be3e6[_0x98fb('0x5f')]['to'];return db[_0x98fb('0x43')][_0x98fb('0x5d')]({'where':{'id':_0x5be3e6['params']['id']},'include':[{'model':db['CmList'],'as':_0x98fb('0xcd'),'include':[{'model':db[_0x98fb('0xc4')],'as':'Contacts','where':{'mobile':_0x444f58},'limit':0x1,'order':[[_0x98fb('0x7f'),'DESC']]}]}]})[_0x98fb('0x23')](handleEntityNotFound(_0x2cf322,null))[_0x98fb('0x23')](function(_0x33fe98){if(_0x33fe98&&_0x33fe98[_0x98fb('0xcd')]){_0x143e6a=_0x33fe98[_0x98fb('0x3b')]({'plain':!![]});if(_0x143e6a[_0x98fb('0xcd')]&&_0x143e6a[_0x98fb('0xcd')][_0x98fb('0x9f')][_0x98fb('0x4f')]){return _0x143e6a[_0x98fb('0xcd')][_0x98fb('0x9f')][0x0];}return db[_0x98fb('0xc4')][_0x98fb('0x5e')](_['defaults'](_0x5be3e6['body'],{'firstName':_0x444f58,'mobile':_0x444f58,'phone':_0x444f58,'ListId':_0x143e6a[_0x98fb('0x82')]}));}})[_0x98fb('0x23')](handleEntityNotFound(_0x2cf322,null))['then'](function(_0x2523fe){if(_0x2523fe){_0x56e435=_0x2523fe;return db['SmsInteraction'][_0x98fb('0x5d')]({'where':{'ContactId':_0x56e435['id'],'closed':![],'SmsAccountId':_0x143e6a['id']}})['then'](function(_0x469184){if(_0x469184){return[_0x469184,![]];}return db[_0x98fb('0xa4')][_0x98fb('0x5e')]({'UserId':_0x5be3e6[_0x98fb('0x62')]['id'],'ContactId':_0x56e435['id'],'SmsAccountId':_0x143e6a['id'],'phone':_0x444f58,'firstMsgDirection':_0x98fb('0xce'),'Messages':[_['merge'](_0x5be3e6['body'],{'read':![],'body':_0x5be3e6[_0x98fb('0x5f')][_0x98fb('0x5f')],'phone':_0x444f58,'SmsAccountId':_0x143e6a['id'],'UserId':_0x5be3e6[_0x98fb('0x62')]['id'],'ContactId':_0x56e435['id']})]},{'include':[{'model':db[_0x98fb('0xab')],'as':'Messages'}]})[_0x98fb('0x23')](function(_0x2b7405){return[_0x2b7405,!![]];});});}})[_0x98fb('0xcf')](function(_0x3eb280,_0x418382){if(_0x418382){return _0x3eb280;}return db[_0x98fb('0xab')][_0x98fb('0x5e')](_[_0x98fb('0x53')](_0x5be3e6['body'],{'read':![],'body':_0x5be3e6[_0x98fb('0x5f')][_0x98fb('0x5f')],'phone':_0x444f58,'SmsAccountId':_0x143e6a['id'],'SmsInteractionId':_0x3eb280['id'],'UserId':_0x5be3e6[_0x98fb('0x62')]['id'],'ContactId':_0x56e435['id']}))[_0x98fb('0x23')](function(_0x20c034){_0x3eb280[_0x98fb('0xd0')][_0x98fb('0xd1')]=[];_0x3eb280[_0x98fb('0xd0')][_0x98fb('0xd1')][_0x98fb('0xa8')](_0x20c034[_0x98fb('0xd0')]);return _0x3eb280;});})[_0x98fb('0x23')](respondWithResult(_0x2cf322,null))['catch'](handleError(_0x2cf322,null));};exports[_0x98fb('0x2e')]=function(_0x21ca87,_0x355c81,_0x244813){if(_0x21ca87['body']['id']){delete _0x21ca87[_0x98fb('0x5f')]['id'];}var _0x17248e,_0x386acd,_0x3bc89b;return db[_0x98fb('0x43')][_0x98fb('0x5d')]({'where':{'id':_0x21ca87[_0x98fb('0x67')]['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x355c81,null))[_0x98fb('0x23')](function(_0x16d6d9){if(_0x16d6d9){_0x3bc89b=_0x16d6d9;logger[_0x98fb('0x26')](_0x98fb('0x27'),'status',_0x98fb('0xd2'),_0x16d6d9[_0x98fb('0x46')],util[_0x98fb('0xd3')](_0x21ca87[_0x98fb('0x5f')],{'showHidden':![],'depth':null}));switch(_0x16d6d9['type']){case _0x98fb('0x87'):if(_0x21ca87[_0x98fb('0x5f')][_0x98fb('0xd4')]&&_0x21ca87['body']['status']){_0x386acd=_0x21ca87[_0x98fb('0x5f')][_0x98fb('0x2e')];return db['SmsMessage'][_0x98fb('0x5d')]({'where':{'messageId':_0x21ca87[_0x98fb('0x5f')]['skebby_dispatch_id']}});}break;case _0x98fb('0x8b'):if(_0x21ca87[_0x98fb('0x5f')]['requestid']&&_0x21ca87[_0x98fb('0x5f')][_0x98fb('0xd5')]){_0x386acd=_0x21ca87[_0x98fb('0x5f')][_0x98fb('0xd5')];return db[_0x98fb('0xab')][_0x98fb('0x5d')]({'where':{'messageId':_0x21ca87[_0x98fb('0x5f')][_0x98fb('0xd6')]}});}break;case'clicksend':if(_0x21ca87['body'][_0x98fb('0xd7')]&&_0x21ca87[_0x98fb('0x5f')][_0x98fb('0xd8')]){_0x386acd=_0x21ca87[_0x98fb('0x5f')]['status_code'];return db[_0x98fb('0xab')][_0x98fb('0x5d')]({'where':{'messageId':_0x21ca87['body'][_0x98fb('0xd7')]}});}break;case _0x98fb('0x8e'):var _0x4baafc=_0x21ca87['body'][_0x98fb('0x8f')][0x0];if(_0x4baafc[_0x98fb('0x85')]&&_0x4baafc['status'][_0x98fb('0xd9')]===_0x98fb('0xda')){_0x386acd=_0x4baafc['status'][_0x98fb('0xd9')];return db[_0x98fb('0xab')][_0x98fb('0x5d')]({'where':{'messageId':_0x4baafc['messageId']}});}break;case _0x98fb('0x93'):if(_0x21ca87[_0x98fb('0x5f')][_0x98fb('0x85')]&&_0x21ca87[_0x98fb('0x5f')][_0x98fb('0x2e')]){_0x386acd=_0x21ca87[_0x98fb('0x5f')][_0x98fb('0x2e')];return db[_0x98fb('0xab')][_0x98fb('0x5d')]({'where':{'messageId':_0x21ca87['body']['messageId']}});}break;case'bandwidth':if(_0x21ca87['body'][0x0][_0x98fb('0x2b')]['id']){_0x386acd=_0x21ca87[_0x98fb('0x5f')][0x0][_0x98fb('0x46')];return db[_0x98fb('0xab')][_0x98fb('0x5d')]({'where':{'messageId':_0x21ca87[_0x98fb('0x5f')][0x0]['message']['id']}});}break;case _0x98fb('0xdb'):if(_0x21ca87['body']['redif']&&_0x21ca87[_0x98fb('0x5f')][_0x98fb('0x2e')]){_0x386acd=_0x21ca87[_0x98fb('0x5f')][_0x98fb('0x2e')];return db[_0x98fb('0xab')][_0x98fb('0x5d')]({'where':{'messageId':_0x21ca87[_0x98fb('0x5f')]['redif']}});}break;}}})[_0x98fb('0x23')](handleEntityNotFound(_0x355c81,null))[_0x98fb('0x23')](function(_0x2b17fa){if(_0x2b17fa){_0x17248e=_0x2b17fa;switch(_0x3bc89b[_0x98fb('0x46')]){case _0x98fb('0x87'):if(_0x386acd===_0x98fb('0xda')){return _0x17248e['update']({'read':!![]});}else{logger[_0x98fb('0x2a')](_0x98fb('0x27'),'status',_0x98fb('0x87'),util[_0x98fb('0xd3')](_0x21ca87['body'],{'showHidden':![],'depth':null}));}break;case _0x98fb('0x8b'):if(_0x386acd==='1'){return _0x17248e[_0x98fb('0x3a')]({'read':!![]});}else{logger['error'](_0x98fb('0x27'),_0x98fb('0x2e'),_0x98fb('0x87'),util[_0x98fb('0xd3')](_0x21ca87['body'],{'showHidden':![],'depth':null}));}break;case _0x98fb('0x8c'):if(!_0x21ca87[_0x98fb('0x5f')][_0x98fb('0xdc')]&&_0x386acd>=0xc8&&_0x386acd<=0xce){return _0x17248e[_0x98fb('0x3a')]({'read':!![]});}else{logger[_0x98fb('0x2a')](_0x98fb('0x27'),'status',_0x98fb('0x8c'),util['inspect'](_0x21ca87[_0x98fb('0x5f')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4b36c8=_0x21ca87[_0x98fb('0x5f')][_0x98fb('0x8f')][0x0];if(_0x4b36c8[_0x98fb('0x2e')]['groupName']===_0x98fb('0xda')){return _0x17248e['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x98fb('0x2e'),_0x98fb('0x8e'),util[_0x98fb('0xd3')](_0x21ca87[_0x98fb('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x98fb('0x93'):if(_0x386acd==_0x98fb('0xdd')||_0x386acd==_0x98fb('0xde')){return _0x17248e[_0x98fb('0x3a')]({'read':!![]});}else{logger[_0x98fb('0x2a')](_0x98fb('0x27'),'status','clickatell',util[_0x98fb('0xd3')](_0x21ca87[_0x98fb('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x98fb('0x96'):if(_0x386acd==_0x98fb('0xdf')){return _0x17248e[_0x98fb('0x3a')]({'read':!![]});}else{logger['error'](_0x98fb('0x27'),'status',_0x98fb('0x96'),util[_0x98fb('0xd3')](_0x21ca87[_0x98fb('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x98fb('0xdb'):if(_0x386acd===_0x98fb('0xe0')||_0x386acd===_0x98fb('0xe1')){return _0x17248e[_0x98fb('0x3a')]({'read':!![]});}else{logger[_0x98fb('0x2a')](_0x98fb('0x27'),'status','intelepeer',util['inspect'](_0x21ca87[_0x98fb('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x17248e;}})[_0x98fb('0x23')](respondWithResult(_0x355c81,null))[_0x98fb('0x58')](handleError(_0x355c81,null));};exports[_0x98fb('0xe2')]=function(_0x5a72f3,_0x49e856,_0x34414e){var _0x5ee481,_0x2719d1,_0x422c21;return db[_0x98fb('0x43')][_0x98fb('0x5d')]({'where':{'id':_0x5a72f3[_0x98fb('0x67')]['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x49e856,null))[_0x98fb('0x23')](function(_0x5dda83){if(_0x5dda83){_0x422c21=_0x5dda83;logger[_0x98fb('0x26')](_0x98fb('0x27'),_0x98fb('0x2e'),_0x98fb('0xd2'),_0x5dda83[_0x98fb('0x46')],util['inspect'](_0x5a72f3[_0x98fb('0x4c')],{'showHidden':![],'depth':null}));switch(_0x5dda83['type']){case'csc':if(_0x5a72f3[_0x98fb('0x4c')][_0x98fb('0xe3')]&&_0x5a72f3[_0x98fb('0x4c')]['state']){_0x2719d1=_0x5a72f3[_0x98fb('0x4c')][_0x98fb('0xe4')];return db[_0x98fb('0xab')][_0x98fb('0x5d')]({'where':{'messageId':_0x5a72f3['query'][_0x98fb('0xe3')]}});}break;}}})[_0x98fb('0x23')](handleEntityNotFound(_0x49e856,null))[_0x98fb('0x23')](function(_0x997ad1){if(_0x997ad1){_0x5ee481=_0x997ad1;switch(_0x422c21[_0x98fb('0x46')]){case _0x98fb('0x90'):if(_0x2719d1==='2'||_0x2719d1==='6'){return _0x5ee481['update']({'read':!![]});}else{logger[_0x98fb('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x98fb('0x2e'),_0x98fb('0x90'),util[_0x98fb('0xd3')](_0x5a72f3['query'],{'showHidden':![],'depth':null}));};break;}return _0x5ee481;}})[_0x98fb('0x23')](respondWithResult(_0x49e856,null))[_0x98fb('0x58')](handleError(_0x49e856,null));};exports[_0x98fb('0xe5')]=function(_0x575f0b,_0x279a85,_0x241a6f){return db[_0x98fb('0x43')]['find']({'where':{'id':_0x575f0b[_0x98fb('0x67')]['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x279a85,null))['then'](function(_0x5931dc){if(_0x5931dc){return _0x5931dc['addAgents'](_0x575f0b[_0x98fb('0x5f')][_0x98fb('0x71')],_[_0x98fb('0xa2')](_0x575f0b[_0x98fb('0x5f')],['ids','id'])||{})[_0x98fb('0xcf')](function(_0x23df8f){for(var _0x315be=0x0;_0x315be<_0x575f0b[_0x98fb('0x5f')][_0x98fb('0x71')][_0x98fb('0x4f')];_0x315be+=0x1){socket[_0x98fb('0xe6')](_0x98fb('0xe7'),{'UserId':Number(_0x575f0b[_0x98fb('0x5f')][_0x98fb('0x71')][_0x315be]),'SmsAccountId':Number(_0x575f0b[_0x98fb('0x67')]['id'])});}return _0x23df8f;});}})[_0x98fb('0x23')](respondWithResult(_0x279a85,null))[_0x98fb('0x58')](handleError(_0x279a85,null));};exports[_0x98fb('0xe8')]=function(_0x46ad25,_0x1a4893,_0xbe682a){return db['SmsAccount'][_0x98fb('0x5d')]({'where':{'id':_0x46ad25[_0x98fb('0x67')]['id']}})[_0x98fb('0x23')](handleEntityNotFound(_0x1a4893,null))[_0x98fb('0x23')](function(_0x16855a){if(_0x16855a){return _0x16855a['removeAgents'](_0x46ad25['query'][_0x98fb('0x71')])[_0x98fb('0x23')](function(){if(_[_0x98fb('0xe9')](_0x46ad25[_0x98fb('0x4c')][_0x98fb('0x71')])){for(var _0x42c3aa=0x0;_0x42c3aa<_0x46ad25[_0x98fb('0x4c')][_0x98fb('0x71')]['length'];_0x42c3aa+=0x1){socket['emit'](_0x98fb('0xea'),{'UserId':Number(_0x46ad25[_0x98fb('0x4c')][_0x98fb('0x71')][_0x42c3aa]),'SmsAccountId':Number(_0x46ad25[_0x98fb('0x67')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x46ad25[_0x98fb('0x4c')][_0x98fb('0x71')]),'SmsAccountId':Number(_0x46ad25['params']['id'])});}});}})[_0x98fb('0x23')](respondWithStatusCode(_0x1a4893,null))['catch'](handleError(_0x1a4893,null));};exports[_0x98fb('0xeb')]=function(_0x53d0c6,_0x41d189,_0x4b50c4){var _0x57657c={};var _0x2d5b60={};var _0x427297;var _0x51c30e;return db['SmsAccount']['findOne']({'where':{'id':_0x53d0c6['params']['id']}})['then'](handleEntityNotFound(_0x41d189,null))[_0x98fb('0x23')](function(_0x267091){if(_0x267091){_0x427297=_0x267091;_0x2d5b60[_0x98fb('0x48')]=_['keys'](db[_0x98fb('0xec')][_0x98fb('0x44')]);_0x2d5b60[_0x98fb('0x4c')]=_[_0x98fb('0x4a')](_0x53d0c6[_0x98fb('0x4c')]);_0x2d5b60['filters']=_['intersection'](_0x2d5b60['model'],_0x2d5b60['query']);_0x57657c[_0x98fb('0x4e')]=_[_0x98fb('0x4b')](_0x2d5b60['model'],qs[_0x98fb('0x4d')](_0x53d0c6[_0x98fb('0x4c')][_0x98fb('0x4d')]));_0x57657c[_0x98fb('0x4e')]=_0x57657c[_0x98fb('0x4e')][_0x98fb('0x4f')]?_0x57657c['attributes']:_0x2d5b60[_0x98fb('0x48')];_0x57657c[_0x98fb('0x6c')]=qs['sort'](_0x53d0c6[_0x98fb('0x4c')][_0x98fb('0x51')]);_0x57657c[_0x98fb('0x52')]=qs['filters'](_[_0x98fb('0x6d')](_0x53d0c6['query'],_0x2d5b60[_0x98fb('0x5a')]));if(_0x53d0c6['query'][_0x98fb('0x6f')]){_0x57657c[_0x98fb('0x52')]=_['merge'](_0x57657c['where'],{'$or':_[_0x98fb('0x49')](_0x57657c['attributes'],function(_0x51b85a){var _0x134f91={};_0x134f91[_0x51b85a]={'$like':'%'+_0x53d0c6[_0x98fb('0x4c')][_0x98fb('0x6f')]+'%'};return _0x134f91;})});}_0x57657c=_[_0x98fb('0x53')]({},_0x57657c,_0x53d0c6[_0x98fb('0x55')]);return _0x427297[_0x98fb('0xeb')](_0x57657c);}})[_0x98fb('0x23')](function(_0x30438a){if(_0x30438a){_0x51c30e=_0x30438a[_0x98fb('0x4f')];if(!_0x53d0c6[_0x98fb('0x4c')][_0x98fb('0x50')](_0x98fb('0x6b'))){_0x57657c[_0x98fb('0x33')]=qs[_0x98fb('0x33')](_0x53d0c6[_0x98fb('0x4c')][_0x98fb('0x33')]);_0x57657c[_0x98fb('0x30')]=qs[_0x98fb('0x30')](_0x53d0c6[_0x98fb('0x4c')][_0x98fb('0x30')]);}return _0x427297[_0x98fb('0xeb')](_0x57657c);}})['then'](function(_0x175888){if(_0x175888){return _0x175888?{'count':_0x51c30e,'rows':_0x175888}:null;}})[_0x98fb('0x23')](respondWithResult(_0x41d189,null))['catch'](handleError(_0x41d189,null));};
\ No newline at end of file
+var _0x21bd=['offset','limit','count','set','Content-Range','json','apply','reject','destroy','get','SmsAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','options','includeAll','include','SmsAccount','show','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','SmsAccountId','Disposition','getDispositions','findOne','sort','pick','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','Applications','account','orderBy','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','message_id','MessageUUID','results','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','interaction','autoclose','applications','push','close','unmanaged','created','SmsMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','rows','to\x20is\x20mandatory','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','groupName','DELIVERED','redif','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','ids','spread','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','status','end'];(function(_0x22315f,_0x1b6064){var _0x5becc7=function(_0x3f7504){while(--_0x3f7504){_0x22315f['push'](_0x22315f['shift']());}};_0x5becc7(++_0x1b6064);}(_0x21bd,0xb9));var _0xd21b=function(_0x36f935,_0x9d014d){_0x36f935=_0x36f935-0x0;var _0x2cef5f=_0x21bd[_0x36f935];return _0x2cef5f;};'use strict';var emlformat=require(_0xd21b('0x0'));var rimraf=require(_0xd21b('0x1'));var zipdir=require(_0xd21b('0x2'));var jsonpatch=require(_0xd21b('0x3'));var rp=require(_0xd21b('0x4'));var moment=require(_0xd21b('0x5'));var BPromise=require(_0xd21b('0x6'));var Mustache=require('mustache');var util=require(_0xd21b('0x7'));var path=require(_0xd21b('0x8'));var sox=require(_0xd21b('0x9'));var csv=require('to-csv');var ejs=require(_0xd21b('0xa'));var fs=require('fs');var fs_extra=require(_0xd21b('0xb'));var _=require('lodash');var squel=require(_0xd21b('0xc'));var crypto=require('crypto');var jsforce=require(_0xd21b('0xd'));var deskjs=require(_0xd21b('0xe'));var toCsv=require(_0xd21b('0xf'));var querystring=require(_0xd21b('0x10'));var Papa=require(_0xd21b('0x11'));var Redis=require('ioredis');var authService=require(_0xd21b('0x12'));var qs=require(_0xd21b('0x13'));var as=require(_0xd21b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd21b('0x15'))(_0xd21b('0x16'));var utils=require(_0xd21b('0x17'));var config=require(_0xd21b('0x18'));var licenseUtil=require(_0xd21b('0x19'));var db=require(_0xd21b('0x1a'))['db'];config[_0xd21b('0x1b')]=_[_0xd21b('0x1c')](config[_0xd21b('0x1b')],{'host':_0xd21b('0x1d'),'port':0x18eb});var socket=require(_0xd21b('0x1e'))(new Redis(config[_0xd21b('0x1b')]));require('./smsAccount.socket')[_0xd21b('0x1f')](socket);var jayson=require(_0xd21b('0x20'));var client=jayson[_0xd21b('0x21')][_0xd21b('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x8cd37e,_0xbc6271,_0x2fe7c1,_0x404aa1){return new BPromise(function(_0x1992e9,_0x208b8b){var _0x58cd50=_0x404aa1||client;return _0x58cd50[_0xd21b('0x23')](_0x8cd37e,_0x2fe7c1)[_0xd21b('0x24')](function(_0x53c419){logger[_0xd21b('0x25')]('SmsAccount,\x20%s,\x20%s',_0xbc6271,_0xd21b('0x26'));logger[_0xd21b('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xbc6271,_0xd21b('0x26'),JSON[_0xd21b('0x28')](_0x53c419));if(_0x53c419[_0xd21b('0x29')]){if(_0x53c419[_0xd21b('0x29')][_0xd21b('0x2a')]===0x1f4){logger[_0xd21b('0x29')](_0xd21b('0x2b'),_0xbc6271,_0x53c419[_0xd21b('0x29')]['message']);return _0x208b8b(_0x53c419[_0xd21b('0x29')][_0xd21b('0x2c')]);}logger[_0xd21b('0x29')]('SmsAccount,\x20%s,\x20%s',_0xbc6271,_0x53c419['error'][_0xd21b('0x2c')]);return _0x1992e9(_0x53c419[_0xd21b('0x29')]['message']);}else{logger[_0xd21b('0x25')](_0xd21b('0x2b'),_0xbc6271,_0xd21b('0x26'));_0x1992e9(_0x53c419[_0xd21b('0x2d')][_0xd21b('0x2c')]);}})['catch'](function(_0x2e28f1){logger[_0xd21b('0x29')]('SmsAccount,\x20%s,\x20%s',_0xbc6271,_0x2e28f1);_0x208b8b(_0x2e28f1);});});}function respondWithStatusCode(_0x13554d,_0xc171b4){_0xc171b4=_0xc171b4||0xcc;return function(_0x14497b){if(_0x14497b){return _0x13554d['sendStatus'](_0xc171b4);}return _0x13554d[_0xd21b('0x2e')](_0xc171b4)[_0xd21b('0x2f')]();};}function respondWithResult(_0x107ce0,_0x98928){_0x98928=_0x98928||0xc8;return function(_0x477431){if(_0x477431){return _0x107ce0[_0xd21b('0x2e')](_0x98928)['json'](_0x477431);}};}function respondWithFilteredResult(_0x3e0160,_0x32f93){return function(_0x17466c){if(_0x17466c){var _0x51dbda=typeof _0x32f93[_0xd21b('0x30')]==='undefined'&&typeof _0x32f93[_0xd21b('0x31')]==='undefined';var _0x4dfc24=_0x17466c[_0xd21b('0x32')];var _0x2caeb5=_0x51dbda?0x0:_0x32f93[_0xd21b('0x30')];var _0xd66179=_0x51dbda?_0x17466c[_0xd21b('0x32')]:_0x32f93[_0xd21b('0x30')]+_0x32f93[_0xd21b('0x31')];var _0x1dec9d;if(_0xd66179>=_0x4dfc24){_0xd66179=_0x4dfc24;_0x1dec9d=0xc8;}else{_0x1dec9d=0xce;}_0x3e0160[_0xd21b('0x2e')](_0x1dec9d);return _0x3e0160[_0xd21b('0x33')](_0xd21b('0x34'),_0x2caeb5+'-'+_0xd66179+'/'+_0x4dfc24)[_0xd21b('0x35')](_0x17466c);}return null;};}function patchUpdates(_0x3a1b5d){return function(_0x42c122){try{jsonpatch[_0xd21b('0x36')](_0x42c122,_0x3a1b5d,!![]);}catch(_0x37c262){return BPromise[_0xd21b('0x37')](_0x37c262);}return _0x42c122['save']();};}function saveUpdates(_0x16bd09,_0x556308){return function(_0x2325b8){if(_0x2325b8){return _0x2325b8['update'](_0x16bd09)[_0xd21b('0x24')](function(_0x3ca456){return _0x3ca456;});}return null;};}function removeEntity(_0x264082,_0x2c24be){return function(_0x365356){if(_0x365356){return _0x365356[_0xd21b('0x38')]()['then'](function(){var _0x12196e=_0x365356[_0xd21b('0x39')]({'plain':!![]});var _0x18279c=_0xd21b('0x3a');return db[_0xd21b('0x3b')][_0xd21b('0x38')]({'where':{'type':_0x18279c,'resourceId':_0x12196e['id']}})[_0xd21b('0x24')](function(){return _0x365356;});})[_0xd21b('0x24')](function(){_0x264082[_0xd21b('0x2e')](0xcc)[_0xd21b('0x2f')]();});}};}function handleEntityNotFound(_0x391da4,_0x14a6c5){return function(_0x33ce9e){if(!_0x33ce9e){_0x391da4['sendStatus'](0x194);}return _0x33ce9e;};}function handleError(_0x3bfd80,_0x2f22df){_0x2f22df=_0x2f22df||0x1f4;return function(_0x39765c){logger['error'](_0x39765c['stack']);if(_0x39765c[_0xd21b('0x3c')]){delete _0x39765c[_0xd21b('0x3c')];}_0x3bfd80[_0xd21b('0x2e')](_0x2f22df)[_0xd21b('0x3d')](_0x39765c);};}exports['index']=function(_0x1a5cc5,_0x33428d){var _0x12d30c={'include':[{'model':db[_0xd21b('0x3e')],'as':_0xd21b('0x3f')}]},_0x5137ea={},_0x1ea4bb={'count':0x0,'rows':[]};var _0x201e57=_[_0xd21b('0x40')](db['SmsAccount'][_0xd21b('0x41')],function(_0x14979f){return{'name':_0x14979f[_0xd21b('0x42')],'type':_0x14979f[_0xd21b('0x43')][_0xd21b('0x44')]};});_0x5137ea[_0xd21b('0x45')]=_[_0xd21b('0x40')](_0x201e57,_0xd21b('0x3c'));_0x5137ea[_0xd21b('0x46')]=_['keys'](_0x1a5cc5[_0xd21b('0x46')]);_0x5137ea[_0xd21b('0x47')]=_[_0xd21b('0x48')](_0x5137ea[_0xd21b('0x45')],_0x5137ea[_0xd21b('0x46')]);_0x12d30c[_0xd21b('0x49')]=_[_0xd21b('0x48')](_0x5137ea['model'],qs[_0xd21b('0x4a')](_0x1a5cc5[_0xd21b('0x46')][_0xd21b('0x4a')]));_0x12d30c[_0xd21b('0x49')]=_0x12d30c['attributes'][_0xd21b('0x4b')]?_0x12d30c[_0xd21b('0x49')]:_0x5137ea[_0xd21b('0x45')];if(!_0x1a5cc5[_0xd21b('0x46')][_0xd21b('0x4c')](_0xd21b('0x4d'))){_0x12d30c['limit']=qs[_0xd21b('0x31')](_0x1a5cc5[_0xd21b('0x46')][_0xd21b('0x31')]);_0x12d30c[_0xd21b('0x30')]=qs[_0xd21b('0x30')](_0x1a5cc5['query']['offset']);}_0x12d30c[_0xd21b('0x4e')]=qs['sort'](_0x1a5cc5[_0xd21b('0x46')]['sort']);_0x12d30c[_0xd21b('0x4f')]=qs[_0xd21b('0x47')](_['pick'](_0x1a5cc5[_0xd21b('0x46')],_0x5137ea[_0xd21b('0x47')]),_0x201e57);if(_0x1a5cc5[_0xd21b('0x46')][_0xd21b('0x50')]){_0x12d30c[_0xd21b('0x4f')]=_['merge'](_0x12d30c[_0xd21b('0x4f')],{'$or':_['map'](_0x201e57,function(_0x50d25d){if(_0x50d25d['type']!==_0xd21b('0x51')){var _0x95e485={};_0x95e485[_0x50d25d['name']]={'$like':'%'+_0x1a5cc5['query']['filter']+'%'};return _0x95e485;}})});}_0x12d30c=_[_0xd21b('0x52')]({},_0x12d30c,_0x1a5cc5[_0xd21b('0x53')]);var _0x2a6be6={'where':_0x12d30c[_0xd21b('0x4f')]};return db['SmsAccount'][_0xd21b('0x32')](_0x2a6be6)['then'](function(_0x146034){_0x1ea4bb['count']=_0x146034;if(_0x1a5cc5['query'][_0xd21b('0x54')]){_0x12d30c[_0xd21b('0x55')]=[{'all':!![]}];}return db[_0xd21b('0x56')]['findAll'](_0x12d30c);})[_0xd21b('0x24')](function(_0x3bf8d3){_0x1ea4bb['rows']=_0x3bf8d3;return _0x1ea4bb;})[_0xd21b('0x24')](respondWithFilteredResult(_0x33428d,_0x12d30c))['catch'](handleError(_0x33428d,null));};exports[_0xd21b('0x57')]=function(_0x3e1448,_0x22ebe3){var _0x1ac090={'raw':![],'where':{'id':_0x3e1448[_0xd21b('0x58')]['id']},'include':[{'model':db[_0xd21b('0x3e')],'as':_0xd21b('0x3f')}]},_0x502d5a={};_0x502d5a['model']=_[_0xd21b('0x59')](db[_0xd21b('0x56')][_0xd21b('0x41')]);_0x502d5a[_0xd21b('0x46')]=_[_0xd21b('0x59')](_0x3e1448[_0xd21b('0x46')]);_0x502d5a['filters']=_[_0xd21b('0x48')](_0x502d5a[_0xd21b('0x45')],_0x502d5a[_0xd21b('0x46')]);_0x1ac090[_0xd21b('0x49')]=_[_0xd21b('0x48')](_0x502d5a['model'],qs[_0xd21b('0x4a')](_0x3e1448[_0xd21b('0x46')]['fields']));_0x1ac090[_0xd21b('0x49')]=_0x1ac090[_0xd21b('0x49')]['length']?_0x1ac090[_0xd21b('0x49')]:_0x502d5a[_0xd21b('0x45')];if(_0x3e1448['query'][_0xd21b('0x54')]){_0x1ac090[_0xd21b('0x55')]=[{'all':!![]}];}_0x1ac090=_['merge']({},_0x1ac090,_0x3e1448['options']);return db['SmsAccount'][_0xd21b('0x5a')](_0x1ac090)[_0xd21b('0x24')](handleEntityNotFound(_0x22ebe3,null))['then'](respondWithResult(_0x22ebe3,null))[_0xd21b('0x5b')](handleError(_0x22ebe3,null));};exports[_0xd21b('0x5c')]=function(_0x2b861c,_0x4d21dd){return db['SmsAccount']['create'](_0x2b861c[_0xd21b('0x5d')],{})[_0xd21b('0x24')](function(_0x3f13d2){var _0x1549e0=_0x2b861c[_0xd21b('0x5e')][_0xd21b('0x39')]({'plain':!![]});if(!_0x1549e0)throw new Error(_0xd21b('0x5f'));if(_0x1549e0[_0xd21b('0x60')]===_0xd21b('0x5e')){var _0x26ed70=_0x3f13d2[_0xd21b('0x39')]({'plain':!![]});var _0x4324c4=_0xd21b('0x3a');return db[_0xd21b('0x61')][_0xd21b('0x5a')]({'where':{'name':_0x4324c4,'userProfileId':_0x1549e0[_0xd21b('0x62')]},'raw':!![]})[_0xd21b('0x24')](function(_0x2069ea){if(_0x2069ea&&_0x2069ea['autoAssociation']===0x0){return db[_0xd21b('0x3b')]['create']({'name':_0x26ed70[_0xd21b('0x3c')],'resourceId':_0x26ed70['id'],'type':_0x2069ea['name'],'sectionId':_0x2069ea['id']},{})['then'](function(){return _0x3f13d2;});}else{return _0x3f13d2;}})['catch'](function(_0x33b9f0){logger[_0xd21b('0x29')](_0xd21b('0x63'),_0x33b9f0);throw _0x33b9f0;});}return _0x3f13d2;})[_0xd21b('0x24')](respondWithResult(_0x4d21dd,0xc9))['catch'](handleError(_0x4d21dd,null));};exports[_0xd21b('0x64')]=function(_0x4d1ae4,_0x4cf5f2){if(_0x4d1ae4[_0xd21b('0x5d')]['id']){delete _0x4d1ae4[_0xd21b('0x5d')]['id'];}return db['SmsAccount'][_0xd21b('0x5a')]({'where':{'id':_0x4d1ae4[_0xd21b('0x58')]['id']},'include':[{'model':db[_0xd21b('0x3e')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4cf5f2,null))[_0xd21b('0x24')](saveUpdates(_0x4d1ae4[_0xd21b('0x5d')],null))[_0xd21b('0x24')](respondWithResult(_0x4cf5f2,null))[_0xd21b('0x5b')](handleError(_0x4cf5f2,null));};exports[_0xd21b('0x38')]=function(_0x5324ce,_0x5f5a6c){return db[_0xd21b('0x56')][_0xd21b('0x5a')]({'where':{'id':_0x5324ce['params']['id']}})[_0xd21b('0x24')](handleEntityNotFound(_0x5f5a6c,null))[_0xd21b('0x24')](removeEntity(_0x5f5a6c,null))[_0xd21b('0x5b')](handleError(_0x5f5a6c,null));};exports[_0xd21b('0x65')]=function(_0x4b42e9,_0x1b51d2){return db[_0xd21b('0x56')][_0xd21b('0x65')]()['then'](respondWithResult(_0x1b51d2,null))['catch'](handleError(_0x1b51d2,null));};exports['addDisposition']=function(_0x1e7730,_0x508545,_0x412bb2){if(_0x1e7730[_0xd21b('0x5d')]['id']){delete _0x1e7730[_0xd21b('0x5d')]['id'];}return db[_0xd21b('0x56')][_0xd21b('0x5a')]({'where':{'id':_0x1e7730[_0xd21b('0x58')]['id']}})['then'](handleEntityNotFound(_0x508545,null))[_0xd21b('0x24')](function(_0x5c3ff9){if(_0x5c3ff9){_0x1e7730[_0xd21b('0x5d')][_0xd21b('0x66')]=_0x5c3ff9['id'];return db[_0xd21b('0x67')][_0xd21b('0x5c')](_0x1e7730[_0xd21b('0x5d')]);}})[_0xd21b('0x24')](respondWithResult(_0x508545,null))[_0xd21b('0x5b')](handleError(_0x508545,null));};exports[_0xd21b('0x68')]=function(_0x442625,_0x5e857c,_0x45597a){var _0x468d2b={'raw':![],'where':{}};var _0x214f06={};var _0x242068={'count':0x0,'rows':[]};return db[_0xd21b('0x56')][_0xd21b('0x69')]({'where':{'id':_0x442625['params']['id']}})['then'](handleEntityNotFound(_0x5e857c,null))[_0xd21b('0x24')](function(_0x1584e6){if(_0x1584e6){_0x214f06[_0xd21b('0x45')]=_[_0xd21b('0x59')](db[_0xd21b('0x67')][_0xd21b('0x41')]);_0x214f06['query']=_[_0xd21b('0x59')](_0x442625['query']);_0x214f06[_0xd21b('0x47')]=_[_0xd21b('0x48')](_0x214f06[_0xd21b('0x45')],_0x214f06[_0xd21b('0x46')]);_0x468d2b['attributes']=_['intersection'](_0x214f06['model'],qs[_0xd21b('0x4a')](_0x442625[_0xd21b('0x46')][_0xd21b('0x4a')]));_0x468d2b[_0xd21b('0x49')]=_0x468d2b[_0xd21b('0x49')]['length']?_0x468d2b[_0xd21b('0x49')]:_0x214f06[_0xd21b('0x45')];if(!_0x442625['query'][_0xd21b('0x4c')](_0xd21b('0x4d'))){_0x468d2b[_0xd21b('0x31')]=qs[_0xd21b('0x31')](_0x442625[_0xd21b('0x46')][_0xd21b('0x31')]);_0x468d2b['offset']=qs['offset'](_0x442625[_0xd21b('0x46')][_0xd21b('0x30')]);}_0x468d2b[_0xd21b('0x4e')]=qs['sort'](_0x442625[_0xd21b('0x46')][_0xd21b('0x6a')]);_0x468d2b['where']=qs[_0xd21b('0x47')](_[_0xd21b('0x6b')](_0x442625['query'],_0x214f06[_0xd21b('0x47')]));_0x468d2b[_0xd21b('0x4f')][_0xd21b('0x66')]=_0x1584e6['id'];if(_0x442625['query'][_0xd21b('0x50')]){_0x468d2b['where']=_[_0xd21b('0x52')](_0x468d2b[_0xd21b('0x4f')],{'$or':_[_0xd21b('0x40')](_0x468d2b[_0xd21b('0x49')],function(_0xd01206){var _0x21dffb={};_0x21dffb[_0xd01206]={'$like':'%'+_0x442625['query']['filter']+'%'};return _0x21dffb;})});}_0x468d2b=_[_0xd21b('0x52')]({},_0x468d2b,_0x442625[_0xd21b('0x53')]);return db[_0xd21b('0x67')][_0xd21b('0x32')]({'where':_0x468d2b[_0xd21b('0x4f')]})[_0xd21b('0x24')](function(_0x149c92){_0x242068[_0xd21b('0x32')]=_0x149c92;if(_0x442625['query'][_0xd21b('0x54')]){_0x468d2b[_0xd21b('0x55')]=[{'all':!![]}];}return db[_0xd21b('0x67')][_0xd21b('0x6c')](_0x468d2b);})[_0xd21b('0x24')](function(_0x4f5103){_0x242068['rows']=_0x4f5103;return _0x242068;});}})[_0xd21b('0x24')](respondWithFilteredResult(_0x5e857c,_0x468d2b))[_0xd21b('0x5b')](handleError(_0x5e857c,null));};exports[_0xd21b('0x6d')]=function(_0x403216,_0x5808ac,_0x21eeaa){return db['SmsAccount'][_0xd21b('0x5a')]({'where':{'id':_0x403216['params']['id']}})['then'](handleEntityNotFound(_0x5808ac,null))[_0xd21b('0x24')](function(_0x154021){if(_0x154021){return _0x154021['removeDispositions'](_0x403216['query']['ids']);}})[_0xd21b('0x24')](respondWithStatusCode(_0x5808ac,null))['catch'](handleError(_0x5808ac,null));};exports[_0xd21b('0x6e')]=function(_0x559a8b,_0x344aac,_0x1e0180){if(_0x559a8b[_0xd21b('0x5d')]['id']){delete _0x559a8b['body']['id'];}return db['SmsAccount'][_0xd21b('0x5a')]({'where':{'id':_0x559a8b[_0xd21b('0x58')]['id']}})[_0xd21b('0x24')](handleEntityNotFound(_0x344aac,null))[_0xd21b('0x24')](function(_0x3cccfb){if(_0x3cccfb){_0x559a8b[_0xd21b('0x5d')][_0xd21b('0x66')]=_0x3cccfb['id'];return db[_0xd21b('0x6f')][_0xd21b('0x5c')](_0x559a8b[_0xd21b('0x5d')]);}})[_0xd21b('0x24')](respondWithResult(_0x344aac,null))[_0xd21b('0x5b')](handleError(_0x344aac,null));};exports[_0xd21b('0x70')]=function(_0x33278a,_0x2e163c,_0x29d678){var _0x478656={'raw':![],'where':{}};var _0x58a66d={};var _0x867426={'count':0x0,'rows':[]};return db[_0xd21b('0x56')][_0xd21b('0x69')]({'where':{'id':_0x33278a[_0xd21b('0x58')]['id']}})[_0xd21b('0x24')](handleEntityNotFound(_0x2e163c,null))[_0xd21b('0x24')](function(_0x47ff19){if(_0x47ff19){_0x58a66d[_0xd21b('0x45')]=_[_0xd21b('0x59')](db['CannedAnswer'][_0xd21b('0x41')]);_0x58a66d['query']=_[_0xd21b('0x59')](_0x33278a[_0xd21b('0x46')]);_0x58a66d[_0xd21b('0x47')]=_[_0xd21b('0x48')](_0x58a66d[_0xd21b('0x45')],_0x58a66d[_0xd21b('0x46')]);_0x478656['attributes']=_['intersection'](_0x58a66d[_0xd21b('0x45')],qs[_0xd21b('0x4a')](_0x33278a['query'][_0xd21b('0x4a')]));_0x478656['attributes']=_0x478656[_0xd21b('0x49')][_0xd21b('0x4b')]?_0x478656[_0xd21b('0x49')]:_0x58a66d[_0xd21b('0x45')];if(!_0x33278a[_0xd21b('0x46')][_0xd21b('0x4c')]('nolimit')){_0x478656[_0xd21b('0x31')]=qs[_0xd21b('0x31')](_0x33278a[_0xd21b('0x46')]['limit']);_0x478656['offset']=qs[_0xd21b('0x30')](_0x33278a[_0xd21b('0x46')]['offset']);}_0x478656['order']=qs[_0xd21b('0x6a')](_0x33278a[_0xd21b('0x46')][_0xd21b('0x6a')]);_0x478656['where']=qs['filters'](_[_0xd21b('0x6b')](_0x33278a[_0xd21b('0x46')],_0x58a66d[_0xd21b('0x47')]));_0x478656['where']['SmsAccountId']=_0x47ff19['id'];if(_0x33278a['query'][_0xd21b('0x50')]){_0x478656[_0xd21b('0x4f')]=_[_0xd21b('0x52')](_0x478656['where'],{'$or':_[_0xd21b('0x40')](_0x478656['attributes'],function(_0x5b98e9){var _0x94cb90={};_0x94cb90[_0x5b98e9]={'$like':'%'+_0x33278a[_0xd21b('0x46')]['filter']+'%'};return _0x94cb90;})});}_0x478656=_[_0xd21b('0x52')]({},_0x478656,_0x33278a[_0xd21b('0x53')]);return db['CannedAnswer']['count']({'where':_0x478656['where']})['then'](function(_0x17a31f){_0x867426['count']=_0x17a31f;if(_0x33278a['query'][_0xd21b('0x54')]){_0x478656[_0xd21b('0x55')]=[{'all':!![]}];}return db[_0xd21b('0x6f')][_0xd21b('0x6c')](_0x478656);})[_0xd21b('0x24')](function(_0x1f490c){_0x867426['rows']=_0x1f490c;return _0x867426;});}})[_0xd21b('0x24')](respondWithFilteredResult(_0x2e163c,_0x478656))[_0xd21b('0x5b')](handleError(_0x2e163c,null));};exports[_0xd21b('0x71')]=function(_0x10aff,_0x464008,_0x2320b1){return db[_0xd21b('0x56')][_0xd21b('0x5a')]({'where':{'id':_0x10aff[_0xd21b('0x58')]['id']}})[_0xd21b('0x24')](handleEntityNotFound(_0x464008,null))[_0xd21b('0x24')](function(_0x492af8){if(_0x492af8){return _0x492af8[_0xd21b('0x71')](_0x10aff['query']['ids']);}})[_0xd21b('0x24')](respondWithStatusCode(_0x464008,null))[_0xd21b('0x5b')](handleError(_0x464008,null));};exports[_0xd21b('0x72')]=function(_0x4e1c0d,_0x4dfe56,_0x2b45fd){var _0x402ca9={'channel':_0xd21b('0x73')};var _0x5cbe1c=[];var _0x341902=[];var _0x1a1176={};return db[_0xd21b('0x56')][_0xd21b('0x5a')]({'where':{'id':_0x4e1c0d[_0xd21b('0x58')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xd21b('0x74')}]})[_0xd21b('0x24')](handleEntityNotFound(_0x4dfe56,null))[_0xd21b('0x24')](function(_0x2388ed){_0x402ca9[_0xd21b('0x75')]=_0x2388ed;_0x402ca9['applications']=_[_0xd21b('0x76')](_0x2388ed[_0xd21b('0x74')],[_0xd21b('0x77')],[_0xd21b('0x78')]);if(_0x402ca9[_0xd21b('0x75')][_0xd21b('0x74')]){delete _0x402ca9[_0xd21b('0x75')]['Applications'];}return db[_0xd21b('0x79')][_0xd21b('0x65')]();})[_0xd21b('0x24')](function(_0x24fad6){if(!_0x24fad6){throw new db[(_0xd21b('0x7a'))]['ValidationError'](_0xd21b('0x7b'));}_0x5cbe1c=_[_0xd21b('0x7c')](_[_0xd21b('0x59')](_0x24fad6),[_0xd21b('0x7d'),_0xd21b('0x7e')]);_0x341902=_[_0xd21b('0x7c')](_[_0xd21b('0x59')](_0x24fad6),[_0xd21b('0x7d'),_0xd21b('0x7e'),_0xd21b('0x7f'),_0xd21b('0x80')]);_0x402ca9[_0xd21b('0x5d')]={'mapKey':_0xd21b('0x81')};if(_0x402ca9[_0xd21b('0x75')][_0xd21b('0x43')]){switch(_0x402ca9[_0xd21b('0x75')][_0xd21b('0x43')]){case _0xd21b('0x82'):_0x402ca9[_0xd21b('0x5d')]['from']=_0x4e1c0d['body'][_0xd21b('0x83')];_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x5d')]=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x84')];_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x85')]=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x86')];break;case _0xd21b('0x87'):_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x88')]='+'+_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x89')];_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x5d')]=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x8a')];break;case _0xd21b('0x8b'):_0x402ca9['body'][_0xd21b('0x88')]=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x88')];_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x5d')]=_0x4e1c0d['body'][_0xd21b('0x2c')];break;case _0xd21b('0x8c'):_0x402ca9['body'][_0xd21b('0x88')]=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x88')];_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x5d')]=_0x4e1c0d[_0xd21b('0x5d')]['body'];_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x85')]=_0x4e1c0d['body'][_0xd21b('0x8d')];break;case'plivo':_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x88')]=_0x4e1c0d['body']['From'];_0x402ca9[_0xd21b('0x5d')]['body']=_0x4e1c0d[_0xd21b('0x5d')]['Text'];_0x402ca9['body'][_0xd21b('0x85')]=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x8e')];break;case'infobip':_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x88')]='+'+_0x4e1c0d['body'][_0xd21b('0x8f')][0x0][_0xd21b('0x88')];_0x402ca9[_0xd21b('0x5d')]['body']=_0x4e1c0d['body']['results'][0x0]['text'];_0x402ca9[_0xd21b('0x5d')]['messageId']=_0x4e1c0d[_0xd21b('0x5d')]['results'][0x0]['messageId'];break;case'csc':_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x88')]=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x90')];_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x5d')]=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x91')]['message'];break;case _0xd21b('0x92'):_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x88')]=_0x4e1c0d[_0xd21b('0x5d')]['fromNumber'];_0x402ca9[_0xd21b('0x5d')]['body']=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x8a')];_0x402ca9[_0xd21b('0x5d')]['messageId']=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x93')];break;case _0xd21b('0x94'):_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x85')]=_0x4e1c0d[_0xd21b('0x5d')][0x0][_0xd21b('0x2c')]['id'];_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x88')]=_0x4e1c0d[_0xd21b('0x5d')][0x0][_0xd21b('0x2c')]['from'];_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x5d')]=_0x4e1c0d['body'][0x0][_0xd21b('0x2c')][_0xd21b('0x8a')];break;case _0xd21b('0x95'):_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x88')]=_0x4e1c0d['body'][_0xd21b('0x88')];_0x402ca9['body'][_0xd21b('0x5d')]=_0x4e1c0d['body'][_0xd21b('0x2c')];_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x85')]=_0x4e1c0d[_0xd21b('0x5d')][_0xd21b('0x96')];break;}}if(_0x402ca9[_0xd21b('0x5d')]['id']){delete _0x402ca9[_0xd21b('0x5d')]['id'];}if(_['isNil'](_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x88')])){throw new db[(_0xd21b('0x7a'))]['ValidationError'](_0xd21b('0x97'));}if(_[_0xd21b('0x98')](_0x402ca9['body']['body'])||_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x5d')]===''){throw new db[(_0xd21b('0x7a'))][(_0xd21b('0x99'))](_0xd21b('0x9a'));}if(_['isNil'](_0x402ca9[_0xd21b('0x5d')]['mapKey'])){throw new db[(_0xd21b('0x7a'))][(_0xd21b('0x99'))](_0xd21b('0x9b')+_0x341902);}if(!_['includes'](_0x341902,_0x402ca9['body'][_0xd21b('0x9c')])){throw new db[(_0xd21b('0x7a'))][(_0xd21b('0x99'))](_0xd21b('0x9d')+_0x341902);}_0x1a1176[_0x402ca9[_0xd21b('0x5d')]['mapKey']]=_0x402ca9[_0xd21b('0x5d')]['from'];return db[_0xd21b('0x9e')][_0xd21b('0x5a')]({'where':{'id':_0x402ca9[_0xd21b('0x75')]['ListId']},'include':[{'model':db[_0xd21b('0x79')],'as':'Contacts','where':_0x1a1176,'limit':0x1,'order':[[_0xd21b('0x7e'),_0xd21b('0x9f')]]}]});})[_0xd21b('0x24')](handleEntityNotFound(_0x4dfe56,null))[_0xd21b('0x24')](function(_0x8b648d){if(_0x8b648d){_0x402ca9[_0xd21b('0xa0')]=_[_0xd21b('0xa1')](_0x8b648d,[_0xd21b('0xa2')]);if(_0x8b648d['Contacts'][_0xd21b('0x4b')]){return _0x8b648d[_0xd21b('0xa2')][0x0];}var _0x1e669f=_[_0xd21b('0x1c')](_0x402ca9['body'],{'firstName':_0x402ca9[_0xd21b('0x5d')]['from'],'ListId':_0x8b648d['id']});_0x1e669f[_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x9c')]]=_0x402ca9[_0xd21b('0x5d')]['from'];return db['CmContact'][_0xd21b('0x5c')](_0x1e669f,{'fields':_0x5cbe1c,'raw':!![]});}})[_0xd21b('0x24')](handleEntityNotFound(_0x4dfe56,null))[_0xd21b('0x24')](function(_0x3622b3){if(_0x3622b3){_0x402ca9[_0xd21b('0xa3')]=_0x3622b3;var _0x7058de={'ContactId':_0x3622b3['id'],'phone':_0x402ca9['body'][_0xd21b('0x88')],'SmsAccountId':_0x4e1c0d['params']['id']};var _0x2c1298={'ContactId':_0x3622b3['id'],'SmsAccountId':_0x4e1c0d[_0xd21b('0x58')]['id'],'closed':![]};return db['SmsInteraction'][_0xd21b('0x5a')]({'where':_0x2c1298})['then'](function(_0x2f5206){if(_0x2f5206){return[_0x2f5206,![]];}return db[_0xd21b('0xa4')][_0xd21b('0x5c')](_0x7058de)[_0xd21b('0x24')](function(_0x3a92f9){return[_0x3a92f9,!![]];});});}})['spread'](function(_0x4b298e,_0x5961b1){_0x402ca9[_0xd21b('0xa5')]=_0x4b298e[_0xd21b('0x39')]({'plain':!![]});_0x402ca9['interaction']['created']=![];if(_0x5961b1){if(_0x402ca9['account'][_0xd21b('0xa6')]){_0x402ca9[_0xd21b('0xa7')][_0xd21b('0xa8')]({'id':0x0,'priority':_0x402ca9[_0xd21b('0xa7')][_0xd21b('0x4b')]+0x1,'app':_0xd21b('0xa9'),'appdata':_0xd21b('0xaa'),'interval':'*,*,*,*'});}_0x402ca9[_0xd21b('0xa5')][_0xd21b('0xab')]=!![];}return db[_0xd21b('0xac')]['create']({'phone':_0x402ca9['body']['from'],'messageId':_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x85')],'body':_0x402ca9[_0xd21b('0x5d')][_0xd21b('0x5d')],'SmsAccountId':_0x4e1c0d[_0xd21b('0x58')]['id'],'SmsInteractionId':_0x4b298e['id'],'direction':'in','ContactId':_0x4b298e['ContactId'],'AttachmentId':_0x402ca9['body'][_0xd21b('0xad')]});})[_0xd21b('0x24')](function(_0x3e4192){_0x402ca9[_0xd21b('0x2c')]=_0x3e4192;if(_0x402ca9[_0xd21b('0xa5')][_0xd21b('0xae')]){return db[_0xd21b('0xaf')][_0xd21b('0x5a')]({'attributes':['id','name'],'where':{'id':_0x402ca9[_0xd21b('0xa5')]['UserId']}})['then'](function(_0x3d04be){if(_0x3d04be){_0x402ca9[_0xd21b('0xa7')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd21b('0xb0'),'appdata':_0x3d04be[_0xd21b('0x3c')]+','+(_0x402ca9[_0xd21b('0x75')][_0xd21b('0xb1')]||0xa),'interval':_0xd21b('0xb2')});}return respondWithRpcPromise(_0xd21b('0xb3'),_0xd21b('0xb4'),_0x402ca9);});}return respondWithRpcPromise(_0xd21b('0xb3'),_0xd21b('0xb4'),_0x402ca9);})['then'](function(_0x5d1387){if(_0x5d1387){var _0x4a36de=0xc8;var _0x1399f0=_0xd21b('0xb5');logger[_0xd21b('0x25')](_0xd21b('0xb6'),_0x1399f0,_0x4a36de,_0xd21b('0xb7'));logger[_0xd21b('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1399f0,_0x4a36de,_0xd21b('0xb7'),JSON[_0xd21b('0x28')](_0x5d1387));if(_0x402ca9[_0xd21b('0x75')]['type']===_0xd21b('0x82')){return _0x4dfe56[_0xd21b('0x2e')](_0x4a36de)[_0xd21b('0x33')](_0xd21b('0xb8'),_0xd21b('0xb9'))['send'](_0xd21b('0xba'));}else{return _0x4dfe56[_0xd21b('0x2e')](_0x4a36de)['json'](_0x5d1387);}}})['catch'](handleError(_0x4dfe56,null));};exports[_0xd21b('0xbb')]=function(_0x59f580,_0x59eb2d,_0x7cd963){return db[_0xd21b('0x56')][_0xd21b('0x69')]({'where':{'id':_0x59f580[_0xd21b('0x58')]['id']}})['then'](handleEntityNotFound(_0x59eb2d,null))[_0xd21b('0x24')](function(_0x355746){if(_0x355746){return db[_0xd21b('0xbc')][_0xd21b('0xbd')](function(_0xfee599){return db[_0xd21b('0xbe')][_0xd21b('0x38')]({'where':{'SmsAccountId':_0x59f580[_0xd21b('0x58')]['id']},'transaction':_0xfee599})['then'](function(_0xf72279){var _0xc7e713=_['map'](_0x59f580[_0xd21b('0x5d')],function(_0x4911ba){_0x4911ba[_0xd21b('0x66')]=_0x59f580['params']['id'];return _0x4911ba;});return db[_0xd21b('0xbe')][_0xd21b('0xbf')](_0xc7e713,{'transaction':_0xfee599});});})[_0xd21b('0x24')](function(){return db[_0xd21b('0xbe')][_0xd21b('0xc0')]({'where':{'SmsAccountId':_0x59f580[_0xd21b('0x58')]['id']},'order':'priority'});});}})[_0xd21b('0x24')](respondWithResult(_0x59eb2d,null))[_0xd21b('0x5b')](handleError(_0x59eb2d,null));};exports[_0xd21b('0xc1')]=function(_0x304a89,_0x502e19,_0x10bf72){var _0x535aee={};var _0xccc45f={};var _0xebb261;var _0x9ea894;return db['SmsAccount'][_0xd21b('0x69')]({'where':{'id':_0x304a89[_0xd21b('0x58')]['id']}})[_0xd21b('0x24')](handleEntityNotFound(_0x502e19,null))[_0xd21b('0x24')](function(_0x47c130){if(_0x47c130){_0xebb261=_0x47c130;_0xccc45f[_0xd21b('0x45')]=_['keys'](db[_0xd21b('0xbe')][_0xd21b('0x41')]);_0xccc45f[_0xd21b('0x46')]=_[_0xd21b('0x59')](_0x304a89[_0xd21b('0x46')]);_0xccc45f['filters']=_['intersection'](_0xccc45f['model'],_0xccc45f['query']);_0x535aee[_0xd21b('0x49')]=_['intersection'](_0xccc45f[_0xd21b('0x45')],qs[_0xd21b('0x4a')](_0x304a89[_0xd21b('0x46')][_0xd21b('0x4a')]));_0x535aee[_0xd21b('0x49')]=_0x535aee[_0xd21b('0x49')][_0xd21b('0x4b')]?_0x535aee['attributes']:_0xccc45f[_0xd21b('0x45')];_0x535aee[_0xd21b('0x4e')]=qs[_0xd21b('0x6a')](_0x304a89[_0xd21b('0x46')][_0xd21b('0x6a')]);_0x535aee[_0xd21b('0x4f')]=qs[_0xd21b('0x47')](_['pick'](_0x304a89[_0xd21b('0x46')],_0xccc45f[_0xd21b('0x47')]));if(_0x304a89[_0xd21b('0x46')][_0xd21b('0x50')]){_0x535aee[_0xd21b('0x4f')]=_[_0xd21b('0x52')](_0x535aee[_0xd21b('0x4f')],{'$or':_[_0xd21b('0x40')](_0x535aee[_0xd21b('0x49')],function(_0x1b4521){var _0x160315={};_0x160315[_0x1b4521]={'$like':'%'+_0x304a89[_0xd21b('0x46')][_0xd21b('0x50')]+'%'};return _0x160315;})});}_0x535aee=_[_0xd21b('0x52')]({},_0x535aee,_0x304a89[_0xd21b('0x53')]);return _0xebb261[_0xd21b('0xc1')](_0x535aee);}})[_0xd21b('0x24')](function(_0x399a7f){if(_0x399a7f){_0x9ea894=_0x399a7f[_0xd21b('0x4b')];if(!_0x304a89['query'][_0xd21b('0x4c')]('nolimit')){_0x535aee[_0xd21b('0x31')]=qs[_0xd21b('0x31')](_0x304a89[_0xd21b('0x46')][_0xd21b('0x31')]);_0x535aee[_0xd21b('0x30')]=qs[_0xd21b('0x30')](_0x304a89[_0xd21b('0x46')][_0xd21b('0x30')]);}return _0xebb261[_0xd21b('0xc1')](_0x535aee);}})[_0xd21b('0x24')](function(_0x113570){if(_0x113570){return _0x113570?{'count':_0x9ea894,'rows':_0x113570}:null;}})[_0xd21b('0x24')](respondWithResult(_0x502e19,null))['catch'](handleError(_0x502e19,null));};exports[_0xd21b('0xc2')]=function(_0x552670,_0x510679,_0x1b46ea){var _0x53af75={'raw':![],'where':{}};var _0x4a6694={};var _0x2e64cd={'count':0x0,'rows':[]};return db[_0xd21b('0x56')][_0xd21b('0x69')]({'where':{'id':_0x552670[_0xd21b('0x58')]['id']}})[_0xd21b('0x24')](handleEntityNotFound(_0x510679,null))[_0xd21b('0x24')](function(_0x1fcc15){if(_0x1fcc15){_0x4a6694['model']=_[_0xd21b('0x59')](db['SmsInteraction'][_0xd21b('0x41')]);_0x4a6694['query']=_['keys'](_0x552670[_0xd21b('0x46')]);_0x4a6694['filters']=_[_0xd21b('0x48')](_0x4a6694['model'],_0x4a6694[_0xd21b('0x46')]);_0x53af75['attributes']=_[_0xd21b('0x48')](_0x4a6694['model'],qs[_0xd21b('0x4a')](_0x552670[_0xd21b('0x46')][_0xd21b('0x4a')]));_0x53af75['attributes']=_0x53af75[_0xd21b('0x49')][_0xd21b('0x4b')]?_0x53af75[_0xd21b('0x49')]:_0x4a6694['model'];if(!_0x552670['query'][_0xd21b('0x4c')](_0xd21b('0x4d'))){_0x53af75[_0xd21b('0x31')]=qs[_0xd21b('0x31')](_0x552670[_0xd21b('0x46')][_0xd21b('0x31')]);_0x53af75['offset']=qs[_0xd21b('0x30')](_0x552670[_0xd21b('0x46')][_0xd21b('0x30')]);}_0x53af75[_0xd21b('0x4e')]=qs[_0xd21b('0x6a')](_0x552670[_0xd21b('0x46')]['sort']);_0x53af75[_0xd21b('0x4f')]=qs[_0xd21b('0x47')](_[_0xd21b('0x6b')](_0x552670['query'],_0x4a6694[_0xd21b('0x47')]));_0x53af75['where'][_0xd21b('0x66')]=_0x1fcc15['id'];if(_0x552670['query'][_0xd21b('0x50')]){_0x53af75[_0xd21b('0x4f')]=_[_0xd21b('0x52')](_0x53af75[_0xd21b('0x4f')],{'$or':_[_0xd21b('0x40')](_0x53af75[_0xd21b('0x49')],function(_0x3805c1){var _0x546676={};_0x546676[_0x3805c1]={'$like':'%'+_0x552670[_0xd21b('0x46')][_0xd21b('0x50')]+'%'};return _0x546676;})});}_0x53af75=_['merge']({},_0x53af75,_0x552670[_0xd21b('0x53')]);return db[_0xd21b('0xa4')][_0xd21b('0x32')]({'where':_0x53af75[_0xd21b('0x4f')]})[_0xd21b('0x24')](function(_0x17b92e){_0x2e64cd[_0xd21b('0x32')]=_0x17b92e;if(_0x552670[_0xd21b('0x46')]['includeAll']){_0x53af75[_0xd21b('0x55')]=[{'model':db[_0xd21b('0x79')],'as':_0xd21b('0xc3'),'required':![]},{'model':db[_0xd21b('0xaf')],'as':_0xd21b('0xc4'),'attributes':['name',_0xd21b('0xc5'),_0xd21b('0xc6')],'required':![]},{'model':db[_0xd21b('0xc7')],'as':'Tags','attributes':['id',_0xd21b('0x3c'),_0xd21b('0xc8')],'where':_0x552670[_0xd21b('0x46')][_0xd21b('0xc9')]?{'id':_0x552670[_0xd21b('0x46')][_0xd21b('0xc9')]}:undefined,'required':_0x552670[_0xd21b('0x46')][_0xd21b('0xc9')]?!![]:![]}];}return db['SmsInteraction'][_0xd21b('0x6c')](_0x53af75);})[_0xd21b('0x24')](function(_0x82c26d){_0x2e64cd[_0xd21b('0xca')]=_0x82c26d;return _0x2e64cd;});}})['then'](respondWithFilteredResult(_0x510679,_0x53af75))[_0xd21b('0x5b')](handleError(_0x510679,null));};exports[_0xd21b('0x3d')]=function(_0x399562,_0x27a98b,_0xc219d3){var _0x101811,_0x27bad6,_0x4da548;if(_[_0xd21b('0x98')](_0x399562[_0xd21b('0x5d')][_0xd21b('0x5d')])||_0x399562[_0xd21b('0x5d')][_0xd21b('0x5d')]===''){throw new db[(_0xd21b('0x7a'))]['ValidationError'](_0xd21b('0x9a'));}if(_[_0xd21b('0x98')](_0x399562[_0xd21b('0x5d')]['to'])){throw new db[(_0xd21b('0x7a'))][(_0xd21b('0x99'))](_0xd21b('0xcb'));}_0x101811=_0x399562[_0xd21b('0x5d')]['to'];return db[_0xd21b('0x56')]['find']({'where':{'id':_0x399562[_0xd21b('0x58')]['id']},'include':[{'model':db[_0xd21b('0x9e')],'as':_0xd21b('0xcc'),'include':[{'model':db[_0xd21b('0x79')],'as':'Contacts','where':{'mobile':_0x101811},'limit':0x1,'order':[[_0xd21b('0x7e'),_0xd21b('0x9f')]]}]}]})[_0xd21b('0x24')](handleEntityNotFound(_0x27a98b,null))['then'](function(_0x3dc8b6){if(_0x3dc8b6&&_0x3dc8b6[_0xd21b('0xcc')]){_0x27bad6=_0x3dc8b6[_0xd21b('0x39')]({'plain':!![]});if(_0x27bad6[_0xd21b('0xcc')]&&_0x27bad6[_0xd21b('0xcc')]['Contacts'][_0xd21b('0x4b')]){return _0x27bad6[_0xd21b('0xcc')][_0xd21b('0xa2')][0x0];}return db[_0xd21b('0x79')][_0xd21b('0x5c')](_[_0xd21b('0x1c')](_0x399562[_0xd21b('0x5d')],{'firstName':_0x101811,'mobile':_0x101811,'phone':_0x101811,'ListId':_0x27bad6[_0xd21b('0x80')]}));}})[_0xd21b('0x24')](handleEntityNotFound(_0x27a98b,null))[_0xd21b('0x24')](function(_0x55acd8){if(_0x55acd8){_0x4da548=_0x55acd8;return db[_0xd21b('0xa4')][_0xd21b('0x5a')]({'where':{'ContactId':_0x4da548['id'],'closed':![],'SmsAccountId':_0x27bad6['id']}})[_0xd21b('0x24')](function(_0x30055e){if(_0x30055e){return[_0x30055e,![]];}return db['SmsInteraction']['create']({'UserId':_0x399562[_0xd21b('0x5e')]['id'],'ContactId':_0x4da548['id'],'SmsAccountId':_0x27bad6['id'],'phone':_0x101811,'firstMsgDirection':'out','Messages':[_[_0xd21b('0x52')](_0x399562[_0xd21b('0x5d')],{'read':![],'body':_0x399562[_0xd21b('0x5d')][_0xd21b('0x5d')],'phone':_0x101811,'SmsAccountId':_0x27bad6['id'],'UserId':_0x399562[_0xd21b('0x5e')]['id'],'ContactId':_0x4da548['id']})]},{'include':[{'model':db[_0xd21b('0xac')],'as':_0xd21b('0xcd')}]})['then'](function(_0x1c3a58){return[_0x1c3a58,!![]];});});}})['spread'](function(_0x4f0471,_0x32a4b4){if(_0x32a4b4){return _0x4f0471;}return db[_0xd21b('0xac')][_0xd21b('0x5c')](_['merge'](_0x399562[_0xd21b('0x5d')],{'read':![],'body':_0x399562[_0xd21b('0x5d')][_0xd21b('0x5d')],'phone':_0x101811,'SmsAccountId':_0x27bad6['id'],'SmsInteractionId':_0x4f0471['id'],'UserId':_0x399562[_0xd21b('0x5e')]['id'],'ContactId':_0x4da548['id']}))[_0xd21b('0x24')](function(_0x30a5b4){_0x4f0471[_0xd21b('0xce')][_0xd21b('0xcd')]=[];_0x4f0471[_0xd21b('0xce')][_0xd21b('0xcd')]['push'](_0x30a5b4[_0xd21b('0xce')]);return _0x4f0471;});})[_0xd21b('0x24')](respondWithResult(_0x27a98b,null))['catch'](handleError(_0x27a98b,null));};exports[_0xd21b('0x2e')]=function(_0x4688f4,_0x9a47de,_0x3700ee){if(_0x4688f4[_0xd21b('0x5d')]['id']){delete _0x4688f4[_0xd21b('0x5d')]['id'];}var _0x1e5e3f,_0x297e15,_0x396dae;return db[_0xd21b('0x56')]['find']({'where':{'id':_0x4688f4['params']['id']}})[_0xd21b('0x24')](handleEntityNotFound(_0x9a47de,null))[_0xd21b('0x24')](function(_0x2f4849){if(_0x2f4849){_0x396dae=_0x2f4849;logger[_0xd21b('0x27')](_0xd21b('0xb6'),_0xd21b('0x2e'),_0xd21b('0xcf'),_0x2f4849['type'],util[_0xd21b('0xd0')](_0x4688f4[_0xd21b('0x5d')],{'showHidden':![],'depth':null}));switch(_0x2f4849[_0xd21b('0x43')]){case _0xd21b('0x87'):if(_0x4688f4['body'][_0xd21b('0xd1')]&&_0x4688f4[_0xd21b('0x5d')]['status']){_0x297e15=_0x4688f4['body']['status'];return db['SmsMessage'][_0xd21b('0x5a')]({'where':{'messageId':_0x4688f4['body']['skebby_dispatch_id']}});}break;case _0xd21b('0x8b'):if(_0x4688f4[_0xd21b('0x5d')][_0xd21b('0xd2')]&&_0x4688f4[_0xd21b('0x5d')][_0xd21b('0xd3')]){_0x297e15=_0x4688f4[_0xd21b('0x5d')][_0xd21b('0xd3')];return db['SmsMessage'][_0xd21b('0x5a')]({'where':{'messageId':_0x4688f4[_0xd21b('0x5d')][_0xd21b('0xd2')]}});}break;case _0xd21b('0x8c'):if(_0x4688f4[_0xd21b('0x5d')]['message_id']&&_0x4688f4['body']['status_code']){_0x297e15=_0x4688f4[_0xd21b('0x5d')]['status_code'];return db['SmsMessage'][_0xd21b('0x5a')]({'where':{'messageId':_0x4688f4[_0xd21b('0x5d')][_0xd21b('0x8d')]}});}break;case'infobip':var _0x277683=_0x4688f4[_0xd21b('0x5d')][_0xd21b('0x8f')][0x0];if(_0x277683[_0xd21b('0x85')]&&_0x277683['status'][_0xd21b('0xd4')]===_0xd21b('0xd5')){_0x297e15=_0x277683[_0xd21b('0x2e')]['groupName'];return db[_0xd21b('0xac')][_0xd21b('0x5a')]({'where':{'messageId':_0x277683[_0xd21b('0x85')]}});}break;case _0xd21b('0x92'):if(_0x4688f4['body'][_0xd21b('0x85')]&&_0x4688f4['body'][_0xd21b('0x2e')]){_0x297e15=_0x4688f4[_0xd21b('0x5d')][_0xd21b('0x2e')];return db[_0xd21b('0xac')][_0xd21b('0x5a')]({'where':{'messageId':_0x4688f4[_0xd21b('0x5d')]['messageId']}});}break;case _0xd21b('0x94'):if(_0x4688f4[_0xd21b('0x5d')][0x0][_0xd21b('0x2c')]['id']){_0x297e15=_0x4688f4[_0xd21b('0x5d')][0x0]['type'];return db[_0xd21b('0xac')][_0xd21b('0x5a')]({'where':{'messageId':_0x4688f4['body'][0x0][_0xd21b('0x2c')]['id']}});}break;case _0xd21b('0x95'):if(_0x4688f4[_0xd21b('0x5d')][_0xd21b('0xd6')]&&_0x4688f4[_0xd21b('0x5d')][_0xd21b('0x2e')]){_0x297e15=_0x4688f4['body'][_0xd21b('0x2e')];return db[_0xd21b('0xac')][_0xd21b('0x5a')]({'where':{'messageId':_0x4688f4['body'][_0xd21b('0xd6')]}});}break;}}})[_0xd21b('0x24')](handleEntityNotFound(_0x9a47de,null))[_0xd21b('0x24')](function(_0x48521e){if(_0x48521e){_0x1e5e3f=_0x48521e;switch(_0x396dae['type']){case _0xd21b('0x87'):if(_0x297e15===_0xd21b('0xd5')){return _0x1e5e3f[_0xd21b('0x64')]({'read':!![]});}else{logger[_0xd21b('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd21b('0x2e'),_0xd21b('0x87'),util[_0xd21b('0xd0')](_0x4688f4[_0xd21b('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xd21b('0x8b'):if(_0x297e15==='1'){return _0x1e5e3f['update']({'read':!![]});}else{logger[_0xd21b('0x29')](_0xd21b('0xb6'),'status',_0xd21b('0x87'),util[_0xd21b('0xd0')](_0x4688f4[_0xd21b('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xd21b('0x8c'):if(!_0x4688f4[_0xd21b('0x5d')]['error_code']&&_0x297e15>=0xc8&&_0x297e15<=0xce){return _0x1e5e3f[_0xd21b('0x64')]({'read':!![]});}else{logger[_0xd21b('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xd21b('0x2e'),'clicksend',util[_0xd21b('0xd0')](_0x4688f4[_0xd21b('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xd21b('0xd7'):var _0x4c214f=_0x4688f4[_0xd21b('0x5d')][_0xd21b('0x8f')][0x0];if(_0x4c214f[_0xd21b('0x2e')]['groupName']===_0xd21b('0xd5')){return _0x1e5e3f[_0xd21b('0x64')]({'read':!![]});}else{logger[_0xd21b('0x29')](_0xd21b('0xb6'),'status',_0xd21b('0xd7'),util[_0xd21b('0xd0')](_0x4688f4[_0xd21b('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xd21b('0x92'):if(_0x297e15==_0xd21b('0xd8')||_0x297e15==_0xd21b('0xd9')){return _0x1e5e3f[_0xd21b('0x64')]({'read':!![]});}else{logger[_0xd21b('0x29')](_0xd21b('0xb6'),'status',_0xd21b('0x92'),util[_0xd21b('0xd0')](_0x4688f4[_0xd21b('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xd21b('0x94'):if(_0x297e15==_0xd21b('0xda')){return _0x1e5e3f['update']({'read':!![]});}else{logger[_0xd21b('0x29')](_0xd21b('0xb6'),'status',_0xd21b('0x94'),util[_0xd21b('0xd0')](_0x4688f4['body'],{'showHidden':![],'depth':null}));}break;case _0xd21b('0x95'):if(_0x297e15===_0xd21b('0xdb')||_0x297e15===_0xd21b('0xdc')){return _0x1e5e3f[_0xd21b('0x64')]({'read':!![]});}else{logger[_0xd21b('0x29')](_0xd21b('0xb6'),_0xd21b('0x2e'),_0xd21b('0x95'),util['inspect'](_0x4688f4[_0xd21b('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x1e5e3f;}})['then'](respondWithResult(_0x9a47de,null))[_0xd21b('0x5b')](handleError(_0x9a47de,null));};exports[_0xd21b('0xdd')]=function(_0x5a1f91,_0x4b8968,_0x3f0cf6){var _0x58c167,_0x568886,_0xcfeabc;return db[_0xd21b('0x56')][_0xd21b('0x5a')]({'where':{'id':_0x5a1f91[_0xd21b('0x58')]['id']}})[_0xd21b('0x24')](handleEntityNotFound(_0x4b8968,null))[_0xd21b('0x24')](function(_0x16c966){if(_0x16c966){_0xcfeabc=_0x16c966;logger['debug'](_0xd21b('0xb6'),_0xd21b('0x2e'),_0xd21b('0xcf'),_0x16c966[_0xd21b('0x43')],util[_0xd21b('0xd0')](_0x5a1f91[_0xd21b('0x46')],{'showHidden':![],'depth':null}));switch(_0x16c966[_0xd21b('0x43')]){case _0xd21b('0xde'):if(_0x5a1f91[_0xd21b('0x46')][_0xd21b('0xdf')]&&_0x5a1f91[_0xd21b('0x46')][_0xd21b('0xe0')]){_0x568886=_0x5a1f91[_0xd21b('0x46')]['state'];return db[_0xd21b('0xac')][_0xd21b('0x5a')]({'where':{'messageId':_0x5a1f91['query'][_0xd21b('0xdf')]}});}break;}}})['then'](handleEntityNotFound(_0x4b8968,null))[_0xd21b('0x24')](function(_0x69f060){if(_0x69f060){_0x58c167=_0x69f060;switch(_0xcfeabc['type']){case'csc':if(_0x568886==='2'||_0x568886==='6'){return _0x58c167[_0xd21b('0x64')]({'read':!![]});}else{logger[_0xd21b('0x29')](_0xd21b('0xb6'),_0xd21b('0x2e'),'csc',util[_0xd21b('0xd0')](_0x5a1f91[_0xd21b('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x58c167;}})[_0xd21b('0x24')](respondWithResult(_0x4b8968,null))[_0xd21b('0x5b')](handleError(_0x4b8968,null));};exports[_0xd21b('0xe1')]=function(_0x686b5d,_0x2d9e99,_0x40c2df){return db[_0xd21b('0x56')][_0xd21b('0x5a')]({'where':{'id':_0x686b5d[_0xd21b('0x58')]['id']}})['then'](handleEntityNotFound(_0x2d9e99,null))['then'](function(_0x153fbc){if(_0x153fbc){return _0x153fbc[_0xd21b('0xe1')](_0x686b5d[_0xd21b('0x5d')][_0xd21b('0xe2')],_['omit'](_0x686b5d[_0xd21b('0x5d')],['ids','id'])||{})[_0xd21b('0xe3')](function(_0x1d6b09){for(var _0x44af22=0x0;_0x44af22<_0x686b5d[_0xd21b('0x5d')][_0xd21b('0xe2')]['length'];_0x44af22+=0x1){socket[_0xd21b('0xe4')]('userSmsAccount:save',{'UserId':Number(_0x686b5d[_0xd21b('0x5d')]['ids'][_0x44af22]),'SmsAccountId':Number(_0x686b5d[_0xd21b('0x58')]['id'])});}return _0x1d6b09;});}})['then'](respondWithResult(_0x2d9e99,null))['catch'](handleError(_0x2d9e99,null));};exports[_0xd21b('0xe5')]=function(_0x42c241,_0x5977ab,_0x2d7d21){return db['SmsAccount'][_0xd21b('0x5a')]({'where':{'id':_0x42c241[_0xd21b('0x58')]['id']}})[_0xd21b('0x24')](handleEntityNotFound(_0x5977ab,null))[_0xd21b('0x24')](function(_0x18bc45){if(_0x18bc45){return _0x18bc45[_0xd21b('0xe5')](_0x42c241[_0xd21b('0x46')]['ids'])[_0xd21b('0x24')](function(){if(_[_0xd21b('0xe6')](_0x42c241['query'][_0xd21b('0xe2')])){for(var _0x532df6=0x0;_0x532df6<_0x42c241[_0xd21b('0x46')][_0xd21b('0xe2')]['length'];_0x532df6+=0x1){socket['emit'](_0xd21b('0xe7'),{'UserId':Number(_0x42c241['query'][_0xd21b('0xe2')][_0x532df6]),'SmsAccountId':Number(_0x42c241[_0xd21b('0x58')]['id'])});}}else{socket[_0xd21b('0xe4')](_0xd21b('0xe7'),{'UserId':Number(_0x42c241[_0xd21b('0x46')]['ids']),'SmsAccountId':Number(_0x42c241['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5977ab,null))['catch'](handleError(_0x5977ab,null));};exports[_0xd21b('0xe8')]=function(_0x1269af,_0x30af39,_0x11fe1e){var _0x2f47fd={};var _0x456fe6={};var _0x2e068e;var _0x183da1;return db['SmsAccount'][_0xd21b('0x69')]({'where':{'id':_0x1269af[_0xd21b('0x58')]['id']}})[_0xd21b('0x24')](handleEntityNotFound(_0x30af39,null))[_0xd21b('0x24')](function(_0x2e2c0f){if(_0x2e2c0f){_0x2e068e=_0x2e2c0f;_0x456fe6[_0xd21b('0x45')]=_[_0xd21b('0x59')](db[_0xd21b('0xaf')][_0xd21b('0x41')]);_0x456fe6['query']=_[_0xd21b('0x59')](_0x1269af['query']);_0x456fe6[_0xd21b('0x47')]=_['intersection'](_0x456fe6[_0xd21b('0x45')],_0x456fe6[_0xd21b('0x46')]);_0x2f47fd[_0xd21b('0x49')]=_[_0xd21b('0x48')](_0x456fe6[_0xd21b('0x45')],qs[_0xd21b('0x4a')](_0x1269af['query'][_0xd21b('0x4a')]));_0x2f47fd[_0xd21b('0x49')]=_0x2f47fd[_0xd21b('0x49')]['length']?_0x2f47fd[_0xd21b('0x49')]:_0x456fe6[_0xd21b('0x45')];_0x2f47fd['order']=qs[_0xd21b('0x6a')](_0x1269af[_0xd21b('0x46')][_0xd21b('0x6a')]);_0x2f47fd[_0xd21b('0x4f')]=qs['filters'](_['pick'](_0x1269af[_0xd21b('0x46')],_0x456fe6[_0xd21b('0x47')]));if(_0x1269af[_0xd21b('0x46')]['filter']){_0x2f47fd[_0xd21b('0x4f')]=_[_0xd21b('0x52')](_0x2f47fd[_0xd21b('0x4f')],{'$or':_[_0xd21b('0x40')](_0x2f47fd[_0xd21b('0x49')],function(_0x17f197){var _0x4c4e0b={};_0x4c4e0b[_0x17f197]={'$like':'%'+_0x1269af['query'][_0xd21b('0x50')]+'%'};return _0x4c4e0b;})});}_0x2f47fd=_[_0xd21b('0x52')]({},_0x2f47fd,_0x1269af[_0xd21b('0x53')]);return _0x2e068e[_0xd21b('0xe8')](_0x2f47fd);}})[_0xd21b('0x24')](function(_0x9176e){if(_0x9176e){_0x183da1=_0x9176e[_0xd21b('0x4b')];if(!_0x1269af[_0xd21b('0x46')][_0xd21b('0x4c')](_0xd21b('0x4d'))){_0x2f47fd[_0xd21b('0x31')]=qs[_0xd21b('0x31')](_0x1269af[_0xd21b('0x46')]['limit']);_0x2f47fd[_0xd21b('0x30')]=qs[_0xd21b('0x30')](_0x1269af[_0xd21b('0x46')][_0xd21b('0x30')]);}return _0x2e068e[_0xd21b('0xe8')](_0x2f47fd);}})[_0xd21b('0x24')](function(_0x58f505){if(_0x58f505){return _0x58f505?{'count':_0x183da1,'rows':_0x58f505}:null;}})[_0xd21b('0x24')](respondWithResult(_0x30af39,null))['catch'](handleError(_0x30af39,null));};
\ No newline at end of file
index f4ff497..7538c2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacd1=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x223b71,_0x597bfb){var _0x4131e4=function(_0x411d23){while(--_0x411d23){_0x223b71['push'](_0x223b71['shift']());}};_0x4131e4(++_0x597bfb);}(_0xacd1,0x1bf));var _0x1acd=function(_0x567575,_0x1a8d8a){_0x567575=_0x567575-0x0;var _0x384e20=_0xacd1[_0x567575];return _0x384e20;};'use strict';var EventEmitter=require(_0x1acd('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1acd('0x1')](0x0);var events={'afterCreate':_0x1acd('0x2'),'afterUpdate':_0x1acd('0x3'),'afterDestroy':_0x1acd('0x4')};function emitEvent(_0x40f139){return function(_0x1f11fd,_0x100f89,_0x3f11b6){SmsAccountEvents[_0x1acd('0x5')](_0x40f139+':'+_0x1f11fd['id'],_0x1f11fd);SmsAccountEvents[_0x1acd('0x5')](_0x40f139,_0x1f11fd);_0x3f11b6(null);};}for(var e in events){if(events[_0x1acd('0x6')](e)){var event=events[e];SmsAccount[_0x1acd('0x7')](e,emitEvent(event));}}module[_0x1acd('0x8')]=SmsAccountEvents;
\ No newline at end of file
+var _0x98d4=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x45c132,_0x18ed98){var _0x4aa5ae=function(_0x2c76c0){while(--_0x2c76c0){_0x45c132['push'](_0x45c132['shift']());}};_0x4aa5ae(++_0x18ed98);}(_0x98d4,0xcc));var _0x498d=function(_0x55e7d2,_0x56d75e){_0x55e7d2=_0x55e7d2-0x0;var _0x433e09=_0x98d4[_0x55e7d2];return _0x433e09;};'use strict';var EventEmitter=require(_0x498d('0x0'));var SmsAccount=require(_0x498d('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x498d('0x2')](0x0);var events={'afterCreate':_0x498d('0x3'),'afterUpdate':'update','afterDestroy':_0x498d('0x4')};function emitEvent(_0x8ed6ef){return function(_0x19081a,_0x30c6ac,_0x5757d){SmsAccountEvents['emit'](_0x8ed6ef+':'+_0x19081a['id'],_0x19081a);SmsAccountEvents[_0x498d('0x5')](_0x8ed6ef,_0x19081a);_0x5757d(null);};}for(var e in events){if(events[_0x498d('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x498d('0x7')]=SmsAccountEvents;
\ No newline at end of file
index b58448b..b3abcca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e9a=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x156a04,_0x795166){var _0x176fbf=function(_0x1b1b20){while(--_0x1b1b20){_0x156a04['push'](_0x156a04['shift']());}};_0x176fbf(++_0x795166);}(_0x3e9a,0x19b));var _0xa3e9=function(_0x699cc2,_0x300546){_0x699cc2=_0x699cc2-0x0;var _0x21f20f=_0x3e9a[_0x699cc2];return _0x21f20f;};'use strict';var _=require(_0xa3e9('0x0'));var util=require(_0xa3e9('0x1'));var logger=require(_0xa3e9('0x2'))('api');var moment=require(_0xa3e9('0x3'));var BPromise=require(_0xa3e9('0x4'));var rp=require(_0xa3e9('0x5'));var fs=require('fs');var path=require(_0xa3e9('0x6'));var rimraf=require(_0xa3e9('0x7'));var config=require(_0xa3e9('0x8'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x58a171,_0x5e9a72){return _0x58a171[_0xa3e9('0x9')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec23=['rimraf','exports','define','SmsAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0xec23,0xd0));var _0x3ec2=function(_0x46451c,_0x88ddd){_0x46451c=_0x46451c-0x0;var _0x12dce4=_0xec23[_0x46451c];return _0x12dce4;};'use strict';var _=require(_0x3ec2('0x0'));var util=require(_0x3ec2('0x1'));var logger=require(_0x3ec2('0x2'))(_0x3ec2('0x3'));var moment=require(_0x3ec2('0x4'));var BPromise=require(_0x3ec2('0x5'));var rp=require(_0x3ec2('0x6'));var fs=require('fs');var path=require(_0x3ec2('0x7'));var rimraf=require(_0x3ec2('0x8'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x3ec2('0x9')]=function(_0x1aad84,_0xe4b721){return _0x1aad84[_0x3ec2('0xa')](_0x3ec2('0xb'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9678220..ad7e5b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22ff=['SmsAccount','find','options','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./smsAccount.socket','register','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsAccount,\x20%s,\x20%s','info','result','ShowSmsAccount'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x22ff,0x1b8));var _0xf22f=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x22ff[_0x5cab28];return _0xa3554d;};'use strict';var _=require(_0xf22f('0x0'));var util=require(_0xf22f('0x1'));var moment=require(_0xf22f('0x2'));var BPromise=require(_0xf22f('0x3'));var rs=require(_0xf22f('0x4'));var fs=require('fs');var Redis=require(_0xf22f('0x5'));var db=require(_0xf22f('0x6'))['db'];var utils=require(_0xf22f('0x7'));var logger=require(_0xf22f('0x8'))(_0xf22f('0x9'));var config=require(_0xf22f('0xa'));var jayson=require(_0xf22f('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0xf22f('0xc')]=_['defaults'](config[_0xf22f('0xc')],{'host':_0xf22f('0xd'),'port':0x18eb});var socket=require(_0xf22f('0xe'))(new Redis(config[_0xf22f('0xc')]));require(_0xf22f('0xf'))[_0xf22f('0x10')](socket);function respondWithRpcPromise(_0x5f0108,_0x40d8e8,_0x50c00f){return new BPromise(function(_0x12e4f3,_0x40c02d){return client['request'](_0x5f0108,_0x50c00f)[_0xf22f('0x11')](function(_0x210adc){logger['info']('SmsAccount,\x20%s,\x20%s',_0x40d8e8,_0xf22f('0x12'));logger[_0xf22f('0x13')](_0xf22f('0x14'),_0x40d8e8,'request\x20sent',JSON[_0xf22f('0x15')](_0x210adc));if(_0x210adc[_0xf22f('0x16')]){if(_0x210adc['error']['code']===0x1f4){logger[_0xf22f('0x16')]('SmsAccount,\x20%s,\x20%s',_0x40d8e8,_0x210adc[_0xf22f('0x16')][_0xf22f('0x17')]);return _0x40c02d(_0x210adc['error'][_0xf22f('0x17')]);}logger['error'](_0xf22f('0x18'),_0x40d8e8,_0x210adc[_0xf22f('0x16')][_0xf22f('0x17')]);return _0x12e4f3(_0x210adc[_0xf22f('0x16')][_0xf22f('0x17')]);}else{logger[_0xf22f('0x19')](_0xf22f('0x18'),_0x40d8e8,_0xf22f('0x12'));_0x12e4f3(_0x210adc[_0xf22f('0x1a')][_0xf22f('0x17')]);}})['catch'](function(_0x3ae633){logger['error']('SmsAccount,\x20%s,\x20%s',_0x40d8e8,_0x3ae633);_0x40c02d(_0x3ae633);});});}exports[_0xf22f('0x1b')]=function(_0x12c832){var _0x11112b=this;return new Promise(function(_0x3e2b9d,_0x5512e7){return db[_0xf22f('0x1c')][_0xf22f('0x1d')]({'raw':_0x12c832[_0xf22f('0x1e')]?_0x12c832[_0xf22f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x12c832['options']?_0x12c832[_0xf22f('0x1e')]['where']||null:null,'attributes':_0x12c832[_0xf22f('0x1e')]?_0x12c832[_0xf22f('0x1e')][_0xf22f('0x1f')]||null:null,'include':_0x12c832['options']?_0x12c832[_0xf22f('0x1e')][_0xf22f('0x20')]?_[_0xf22f('0x21')](_0x12c832[_0xf22f('0x1e')][_0xf22f('0x20')],function(_0x3b1f2b){return{'model':db[_0x3b1f2b[_0xf22f('0x22')]],'as':_0x3b1f2b['as'],'attributes':_0x3b1f2b[_0xf22f('0x1f')],'include':_0x3b1f2b[_0xf22f('0x20')]?_[_0xf22f('0x21')](_0x3b1f2b['include'],function(_0x3bba7e){return{'model':db[_0x3bba7e['model']],'as':_0x3bba7e['as'],'attributes':_0x3bba7e[_0xf22f('0x1f')],'include':_0x3bba7e['include']?_[_0xf22f('0x21')](_0x3bba7e[_0xf22f('0x20')],function(_0x4f9a59){return{'model':db[_0x4f9a59[_0xf22f('0x22')]],'as':_0x4f9a59['as'],'attributes':_0x4f9a59[_0xf22f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5929e5){logger[_0xf22f('0x19')]('ShowSmsAccount',_0x12c832);logger['debug']('ShowSmsAccount',_0x12c832,JSON[_0xf22f('0x15')](_0x5929e5));_0x3e2b9d(_0x5929e5);})[_0xf22f('0x23')](function(_0xe935b8){logger[_0xf22f('0x16')](_0xf22f('0x1b'),_0xe935b8[_0xf22f('0x17')],_0x12c832);_0x5512e7(_0x11112b[_0xf22f('0x16')](0x1f4,_0xe935b8[_0xf22f('0x17')]));});});};
\ No newline at end of file
+var _0xe97a=['stringify','error','message','result','catch','SmsAccount','find','options','raw','where','attributes','map','include','model','info','ShowSmsAccount','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0xabfab7,_0xe3a150){var _0x261378=function(_0x45c578){while(--_0x45c578){_0xabfab7['push'](_0xabfab7['shift']());}};_0x261378(++_0xe3a150);}(_0xe97a,0x122));var _0xae97=function(_0x4eeca4,_0x5901c9){_0x4eeca4=_0x4eeca4-0x0;var _0x430031=_0xe97a[_0x4eeca4];return _0x430031;};'use strict';var _=require(_0xae97('0x0'));var util=require(_0xae97('0x1'));var moment=require(_0xae97('0x2'));var BPromise=require(_0xae97('0x3'));var rs=require(_0xae97('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae97('0x5'))['db'];var utils=require(_0xae97('0x6'));var logger=require(_0xae97('0x7'))(_0xae97('0x8'));var config=require('../../config/environment');var jayson=require(_0xae97('0x9'));var client=jayson[_0xae97('0xa')][_0xae97('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xae97('0xc')],{'host':_0xae97('0xd'),'port':0x18eb});var socket=require(_0xae97('0xe'))(new Redis(config[_0xae97('0xc')]));require(_0xae97('0xf'))[_0xae97('0x10')](socket);function respondWithRpcPromise(_0x43c552,_0x1b0e61,_0xc6703f){return new BPromise(function(_0x4808b5,_0x536bed){return client[_0xae97('0x11')](_0x43c552,_0xc6703f)[_0xae97('0x12')](function(_0x940aa3){logger['info'](_0xae97('0x13'),_0x1b0e61,_0xae97('0x14'));logger['debug'](_0xae97('0x15'),_0x1b0e61,_0xae97('0x14'),JSON[_0xae97('0x16')](_0x940aa3));if(_0x940aa3[_0xae97('0x17')]){if(_0x940aa3[_0xae97('0x17')]['code']===0x1f4){logger[_0xae97('0x17')](_0xae97('0x13'),_0x1b0e61,_0x940aa3['error'][_0xae97('0x18')]);return _0x536bed(_0x940aa3[_0xae97('0x17')]['message']);}logger['error'](_0xae97('0x13'),_0x1b0e61,_0x940aa3[_0xae97('0x17')][_0xae97('0x18')]);return _0x4808b5(_0x940aa3[_0xae97('0x17')][_0xae97('0x18')]);}else{logger['info'](_0xae97('0x13'),_0x1b0e61,_0xae97('0x14'));_0x4808b5(_0x940aa3[_0xae97('0x19')][_0xae97('0x18')]);}})[_0xae97('0x1a')](function(_0x271e3d){logger[_0xae97('0x17')]('SmsAccount,\x20%s,\x20%s',_0x1b0e61,_0x271e3d);_0x536bed(_0x271e3d);});});}exports['ShowSmsAccount']=function(_0x4f5d30){var _0x4fc67a=this;return new Promise(function(_0x17cb9a,_0x77353a){return db[_0xae97('0x1b')][_0xae97('0x1c')]({'raw':_0x4f5d30[_0xae97('0x1d')]?_0x4f5d30[_0xae97('0x1d')][_0xae97('0x1e')]===undefined?!![]:![]:!![],'where':_0x4f5d30[_0xae97('0x1d')]?_0x4f5d30[_0xae97('0x1d')][_0xae97('0x1f')]||null:null,'attributes':_0x4f5d30['options']?_0x4f5d30[_0xae97('0x1d')][_0xae97('0x20')]||null:null,'include':_0x4f5d30[_0xae97('0x1d')]?_0x4f5d30[_0xae97('0x1d')]['include']?_[_0xae97('0x21')](_0x4f5d30[_0xae97('0x1d')][_0xae97('0x22')],function(_0x379a97){return{'model':db[_0x379a97[_0xae97('0x23')]],'as':_0x379a97['as'],'attributes':_0x379a97['attributes'],'include':_0x379a97[_0xae97('0x22')]?_[_0xae97('0x21')](_0x379a97[_0xae97('0x22')],function(_0x5b99fc){return{'model':db[_0x5b99fc[_0xae97('0x23')]],'as':_0x5b99fc['as'],'attributes':_0x5b99fc[_0xae97('0x20')],'include':_0x5b99fc[_0xae97('0x22')]?_[_0xae97('0x21')](_0x5b99fc[_0xae97('0x22')],function(_0x40d47d){return{'model':db[_0x40d47d[_0xae97('0x23')]],'as':_0x40d47d['as'],'attributes':_0x40d47d[_0xae97('0x20')]};}):[]};}):[]};}):[]:[]})[_0xae97('0x12')](function(_0x47a6e9){logger[_0xae97('0x24')](_0xae97('0x25'),_0x4f5d30);logger[_0xae97('0x26')](_0xae97('0x25'),_0x4f5d30,JSON[_0xae97('0x16')](_0x47a6e9));_0x17cb9a(_0x47a6e9);})['catch'](function(_0x28829e){logger[_0xae97('0x17')](_0xae97('0x25'),_0x28829e[_0xae97('0x18')],_0x4f5d30);_0x77353a(_0x4fc67a[_0xae97('0x17')](0x1f4,_0x28829e['message']));});});};
\ No newline at end of file
index 9d7d290..45990c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 4b2431c..bb0e80a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2f45e7,_0x29431a){var _0xe8dd99=function(_0x2a365f){while(--_0x2a365f){_0x2f45e7['push'](_0x2f45e7['shift']());}};_0xe8dd99(++_0x29431a);}(_0x7217,0x19e));var _0x7721=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7217[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router;
\ No newline at end of file
+var _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(_0x535bcd,_0x1575af){var _0x42f269=function(_0x1463da){while(--_0x1463da){_0x535bcd['push'](_0x535bcd['shift']());}};_0x42f269(++_0x1575af);}(_0x34e8,0x12c));var _0x834e=function(_0xec8a13,_0x2f38ee){_0xec8a13=_0xec8a13-0x0;var _0x2be5be=_0x34e8[_0xec8a13];return _0x2be5be;};'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
index f09cbf2..4a5364c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1be3=['STRING','noop','TEXT','exports','INTEGER'];(function(_0x53ba94,_0x4c800d){var _0x395087=function(_0x35caa2){while(--_0x35caa2){_0x53ba94['push'](_0x53ba94['shift']());}};_0x395087(++_0x4c800d);}(_0x1be3,0x18e));var _0x31be=function(_0x524139,_0x46f7a6){_0x524139=_0x524139-0x0;var _0x380a35=_0x1be3[_0x524139];return _0x380a35;};'use strict';var Sequelize=require('sequelize');module[_0x31be('0x0')]={'priority':{'type':Sequelize[_0x31be('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x31be('0x2')],'allowNull':![],'defaultValue':_0x31be('0x3')},'appdata':{'type':Sequelize[_0x31be('0x4')]()},'description':{'type':Sequelize[_0x31be('0x2')]},'interval':{'type':Sequelize[_0x31be('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xd831=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x4c630b,_0x25f8ef){var _0x181259=function(_0x5d0e58){while(--_0x5d0e58){_0x4c630b['push'](_0x4c630b['shift']());}};_0x181259(++_0x25f8ef);}(_0xd831,0x171));var _0x1d83=function(_0x5efe74,_0x3af3a9){_0x5efe74=_0x5efe74-0x0;var _0x2b3896=_0xd831[_0x5efe74];return _0x2b3896;};'use strict';var Sequelize=require(_0x1d83('0x0'));module[_0x1d83('0x1')]={'priority':{'type':Sequelize[_0x1d83('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1d83('0x3')],'allowNull':![],'defaultValue':_0x1d83('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1d83('0x3')]},'interval':{'type':Sequelize[_0x1d83('0x3')],'defaultValue':_0x1d83('0x5')}};
\ No newline at end of file
index 44a4866..46f54d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8392=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','SmsApplication','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','includeAll','findAll','rows','catch','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x5ad771,_0x34186f){var _0x5b5dce=function(_0x5ad0fb){while(--_0x5ad0fb){_0x5ad771['push'](_0x5ad771['shift']());}};_0x5b5dce(++_0x34186f);}(_0x8392,0x84));var _0x2839=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8392[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x2839('0x0'));var rimraf=require(_0x2839('0x1'));var zipdir=require(_0x2839('0x2'));var jsonpatch=require(_0x2839('0x3'));var rp=require(_0x2839('0x4'));var moment=require(_0x2839('0x5'));var BPromise=require(_0x2839('0x6'));var Mustache=require(_0x2839('0x7'));var util=require(_0x2839('0x8'));var path=require(_0x2839('0x9'));var sox=require(_0x2839('0xa'));var csv=require(_0x2839('0xb'));var ejs=require(_0x2839('0xc'));var fs=require('fs');var fs_extra=require(_0x2839('0xd'));var _=require(_0x2839('0xe'));var squel=require(_0x2839('0xf'));var crypto=require(_0x2839('0x10'));var jsforce=require(_0x2839('0x11'));var deskjs=require(_0x2839('0x12'));var toCsv=require(_0x2839('0xb'));var querystring=require(_0x2839('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2839('0x14'));var qs=require(_0x2839('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2839('0x16'));var logger=require(_0x2839('0x17'))('api');var utils=require(_0x2839('0x18'));var config=require(_0x2839('0x19'));var licenseUtil=require(_0x2839('0x1a'));var db=require(_0x2839('0x1b'))['db'];function respondWithStatusCode(_0x5dff0e,_0x595bf7){_0x595bf7=_0x595bf7||0xcc;return function(_0x45f4de){if(_0x45f4de){return _0x5dff0e[_0x2839('0x1c')](_0x595bf7);}return _0x5dff0e[_0x2839('0x1d')](_0x595bf7)['end']();};}function respondWithResult(_0x3fde99,_0x369510){_0x369510=_0x369510||0xc8;return function(_0x1aa985){if(_0x1aa985){return _0x3fde99[_0x2839('0x1d')](_0x369510)[_0x2839('0x1e')](_0x1aa985);}};}function respondWithFilteredResult(_0x43375c,_0x12d5f4){return function(_0x4ac3ed){if(_0x4ac3ed){var _0x1078fe=typeof _0x12d5f4[_0x2839('0x1f')]===_0x2839('0x20')&&typeof _0x12d5f4[_0x2839('0x21')]===_0x2839('0x20');var _0x2e9122=_0x4ac3ed[_0x2839('0x22')];var _0x235eed=_0x1078fe?0x0:_0x12d5f4['offset'];var _0x1732db=_0x1078fe?_0x4ac3ed[_0x2839('0x22')]:_0x12d5f4[_0x2839('0x1f')]+_0x12d5f4[_0x2839('0x21')];var _0x4825be;if(_0x1732db>=_0x2e9122){_0x1732db=_0x2e9122;_0x4825be=0xc8;}else{_0x4825be=0xce;}_0x43375c['status'](_0x4825be);return _0x43375c['set']('Content-Range',_0x235eed+'-'+_0x1732db+'/'+_0x2e9122)[_0x2839('0x1e')](_0x4ac3ed);}return null;};}function patchUpdates(_0x5be091){return function(_0x4973f8){try{jsonpatch[_0x2839('0x23')](_0x4973f8,_0x5be091,!![]);}catch(_0x522e0e){return BPromise[_0x2839('0x24')](_0x522e0e);}return _0x4973f8[_0x2839('0x25')]();};}function saveUpdates(_0x1c5f2a,_0xf2b02){return function(_0x32a98b){if(_0x32a98b){return _0x32a98b[_0x2839('0x26')](_0x1c5f2a)[_0x2839('0x27')](function(_0x1d312f){return _0x1d312f;});}return null;};}function removeEntity(_0x5c0414,_0x18c96b){return function(_0x5e0b2b){if(_0x5e0b2b){return _0x5e0b2b[_0x2839('0x28')]()['then'](function(){_0x5c0414['status'](0xcc)[_0x2839('0x29')]();});}};}function handleEntityNotFound(_0x12473f,_0x24df80){return function(_0x4ccd17){if(!_0x4ccd17){_0x12473f[_0x2839('0x1c')](0x194);}return _0x4ccd17;};}function handleError(_0xb2b22,_0x3474e6){_0x3474e6=_0x3474e6||0x1f4;return function(_0x1f75e3){logger['error'](_0x1f75e3[_0x2839('0x2a')]);if(_0x1f75e3[_0x2839('0x2b')]){delete _0x1f75e3[_0x2839('0x2b')];}_0xb2b22[_0x2839('0x1d')](_0x3474e6)[_0x2839('0x2c')](_0x1f75e3);};}exports[_0x2839('0x2d')]=function(_0x12b274,_0x52e848){var _0x2e401d={},_0x1039d1={},_0x357d47={'count':0x0,'rows':[]};var _0x3338a8=_[_0x2839('0x2e')](db[_0x2839('0x2f')][_0x2839('0x30')],function(_0x245f0b){return{'name':_0x245f0b['fieldName'],'type':_0x245f0b['type']['key']};});_0x1039d1[_0x2839('0x31')]=_[_0x2839('0x2e')](_0x3338a8,_0x2839('0x2b'));_0x1039d1['query']=_[_0x2839('0x32')](_0x12b274[_0x2839('0x33')]);_0x1039d1[_0x2839('0x34')]=_['intersection'](_0x1039d1[_0x2839('0x31')],_0x1039d1[_0x2839('0x33')]);_0x2e401d[_0x2839('0x35')]=_[_0x2839('0x36')](_0x1039d1[_0x2839('0x31')],qs[_0x2839('0x37')](_0x12b274[_0x2839('0x33')][_0x2839('0x37')]));_0x2e401d[_0x2839('0x35')]=_0x2e401d[_0x2839('0x35')][_0x2839('0x38')]?_0x2e401d['attributes']:_0x1039d1[_0x2839('0x31')];if(!_0x12b274[_0x2839('0x33')][_0x2839('0x39')](_0x2839('0x3a'))){_0x2e401d[_0x2839('0x21')]=qs[_0x2839('0x21')](_0x12b274['query'][_0x2839('0x21')]);_0x2e401d[_0x2839('0x1f')]=qs['offset'](_0x12b274[_0x2839('0x33')][_0x2839('0x1f')]);}_0x2e401d[_0x2839('0x3b')]=qs['sort'](_0x12b274[_0x2839('0x33')][_0x2839('0x3c')]);_0x2e401d[_0x2839('0x3d')]=qs['filters'](_[_0x2839('0x3e')](_0x12b274['query'],_0x1039d1[_0x2839('0x34')]),_0x3338a8);if(_0x12b274['query']['filter']){_0x2e401d['where']=_[_0x2839('0x3f')](_0x2e401d[_0x2839('0x3d')],{'$or':_[_0x2839('0x2e')](_0x3338a8,function(_0x19dc08){if(_0x19dc08[_0x2839('0x40')]!=='VIRTUAL'){var _0x4b4039={};_0x4b4039[_0x19dc08[_0x2839('0x2b')]]={'$like':'%'+_0x12b274[_0x2839('0x33')]['filter']+'%'};return _0x4b4039;}})});}_0x2e401d=_[_0x2839('0x3f')]({},_0x2e401d,_0x12b274[_0x2839('0x41')]);var _0x31205d={'where':_0x2e401d[_0x2839('0x3d')]};return db[_0x2839('0x2f')]['count'](_0x31205d)[_0x2839('0x27')](function(_0x25c31f){_0x357d47[_0x2839('0x22')]=_0x25c31f;if(_0x12b274[_0x2839('0x33')][_0x2839('0x42')]){_0x2e401d['include']=[{'all':!![]}];}return db['SmsApplication'][_0x2839('0x43')](_0x2e401d);})[_0x2839('0x27')](function(_0x4643ec){_0x357d47[_0x2839('0x44')]=_0x4643ec;return _0x357d47;})['then'](respondWithFilteredResult(_0x52e848,_0x2e401d))[_0x2839('0x45')](handleError(_0x52e848,null));};exports['show']=function(_0x50cf2f,_0x1906c3){var _0x360a54={'raw':!![],'where':{'id':_0x50cf2f[_0x2839('0x46')]['id']}},_0xc9308b={};_0xc9308b[_0x2839('0x31')]=_['keys'](db[_0x2839('0x2f')]['rawAttributes']);_0xc9308b[_0x2839('0x33')]=_[_0x2839('0x32')](_0x50cf2f[_0x2839('0x33')]);_0xc9308b[_0x2839('0x34')]=_[_0x2839('0x36')](_0xc9308b[_0x2839('0x31')],_0xc9308b[_0x2839('0x33')]);_0x360a54[_0x2839('0x35')]=_[_0x2839('0x36')](_0xc9308b['model'],qs['fields'](_0x50cf2f['query']['fields']));_0x360a54[_0x2839('0x35')]=_0x360a54['attributes'][_0x2839('0x38')]?_0x360a54['attributes']:_0xc9308b[_0x2839('0x31')];if(_0x50cf2f['query']['includeAll']){_0x360a54[_0x2839('0x47')]=[{'all':!![]}];}_0x360a54=_['merge']({},_0x360a54,_0x50cf2f[_0x2839('0x41')]);return db['SmsApplication'][_0x2839('0x48')](_0x360a54)[_0x2839('0x27')](handleEntityNotFound(_0x1906c3,null))[_0x2839('0x27')](respondWithResult(_0x1906c3,null))['catch'](handleError(_0x1906c3,null));};exports['create']=function(_0x551a4d,_0xb4ba0a){return db[_0x2839('0x2f')][_0x2839('0x49')](_0x551a4d[_0x2839('0x4a')],{})[_0x2839('0x27')](respondWithResult(_0xb4ba0a,0xc9))[_0x2839('0x45')](handleError(_0xb4ba0a,null));};exports['update']=function(_0x1f5c97,_0xaecaa4){if(_0x1f5c97[_0x2839('0x4a')]['id']){delete _0x1f5c97[_0x2839('0x4a')]['id'];}return db[_0x2839('0x2f')][_0x2839('0x48')]({'where':{'id':_0x1f5c97[_0x2839('0x46')]['id']}})['then'](handleEntityNotFound(_0xaecaa4,null))[_0x2839('0x27')](saveUpdates(_0x1f5c97[_0x2839('0x4a')],null))['then'](respondWithResult(_0xaecaa4,null))[_0x2839('0x45')](handleError(_0xaecaa4,null));};exports[_0x2839('0x28')]=function(_0x5dc662,_0x8191c2){return db[_0x2839('0x2f')]['find']({'where':{'id':_0x5dc662['params']['id']}})[_0x2839('0x27')](handleEntityNotFound(_0x8191c2,null))['then'](removeEntity(_0x8191c2,null))[_0x2839('0x45')](handleError(_0x8191c2,null));};
\ No newline at end of file
+var _0xf83f=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','merge','where','type','VIRTUAL','name','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x1ceafa,_0x252713){var _0x2cb283=function(_0x3b68c9){while(--_0x3b68c9){_0x1ceafa['push'](_0x1ceafa['shift']());}};_0x2cb283(++_0x252713);}(_0xf83f,0x122));var _0xff83=function(_0x18e748,_0x2f2763){_0x18e748=_0x18e748-0x0;var _0x853cb9=_0xf83f[_0x18e748];return _0x853cb9;};'use strict';var emlformat=require(_0xff83('0x0'));var rimraf=require(_0xff83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xff83('0x2'));var rp=require(_0xff83('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xff83('0x4'));var util=require(_0xff83('0x5'));var path=require('path');var sox=require(_0xff83('0x6'));var csv=require('to-csv');var ejs=require(_0xff83('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xff83('0x8'));var squel=require('squel');var crypto=require(_0xff83('0x9'));var jsforce=require(_0xff83('0xa'));var deskjs=require(_0xff83('0xb'));var toCsv=require(_0xff83('0xc'));var querystring=require(_0xff83('0xd'));var Papa=require(_0xff83('0xe'));var Redis=require('ioredis');var authService=require(_0xff83('0xf'));var qs=require(_0xff83('0x10'));var as=require(_0xff83('0x11'));var hardwareService=require(_0xff83('0x12'));var logger=require(_0xff83('0x13'))(_0xff83('0x14'));var utils=require(_0xff83('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xff83('0x16'));var db=require(_0xff83('0x17'))['db'];function respondWithStatusCode(_0x51af70,_0x484fe0){_0x484fe0=_0x484fe0||0xcc;return function(_0x4b5764){if(_0x4b5764){return _0x51af70[_0xff83('0x18')](_0x484fe0);}return _0x51af70['status'](_0x484fe0)[_0xff83('0x19')]();};}function respondWithResult(_0x98a7db,_0x5bb8fa){_0x5bb8fa=_0x5bb8fa||0xc8;return function(_0x3935ca){if(_0x3935ca){return _0x98a7db[_0xff83('0x1a')](_0x5bb8fa)[_0xff83('0x1b')](_0x3935ca);}};}function respondWithFilteredResult(_0x6e784a,_0x547604){return function(_0x3a3349){if(_0x3a3349){var _0x20bb0e=typeof _0x547604[_0xff83('0x1c')]===_0xff83('0x1d')&&typeof _0x547604[_0xff83('0x1e')]==='undefined';var _0x7f4818=_0x3a3349[_0xff83('0x1f')];var _0x18dd78=_0x20bb0e?0x0:_0x547604[_0xff83('0x1c')];var _0x42e14f=_0x20bb0e?_0x3a3349[_0xff83('0x1f')]:_0x547604[_0xff83('0x1c')]+_0x547604[_0xff83('0x1e')];var _0x10d0f4;if(_0x42e14f>=_0x7f4818){_0x42e14f=_0x7f4818;_0x10d0f4=0xc8;}else{_0x10d0f4=0xce;}_0x6e784a[_0xff83('0x1a')](_0x10d0f4);return _0x6e784a[_0xff83('0x20')](_0xff83('0x21'),_0x18dd78+'-'+_0x42e14f+'/'+_0x7f4818)[_0xff83('0x1b')](_0x3a3349);}return null;};}function patchUpdates(_0x10627c){return function(_0x317486){try{jsonpatch[_0xff83('0x22')](_0x317486,_0x10627c,!![]);}catch(_0x2cfdf7){return BPromise['reject'](_0x2cfdf7);}return _0x317486[_0xff83('0x23')]();};}function saveUpdates(_0x568ffc,_0x59ed10){return function(_0x24306e){if(_0x24306e){return _0x24306e[_0xff83('0x24')](_0x568ffc)[_0xff83('0x25')](function(_0x39c8f){return _0x39c8f;});}return null;};}function removeEntity(_0x4a6131,_0x3cff08){return function(_0x2aa38d){if(_0x2aa38d){return _0x2aa38d[_0xff83('0x26')]()[_0xff83('0x25')](function(){_0x4a6131[_0xff83('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d53c7,_0x4f3fd4){return function(_0x325ac3){if(!_0x325ac3){_0x2d53c7[_0xff83('0x18')](0x194);}return _0x325ac3;};}function handleError(_0x43d0ea,_0x3aa655){_0x3aa655=_0x3aa655||0x1f4;return function(_0x2b0521){logger[_0xff83('0x27')](_0x2b0521[_0xff83('0x28')]);if(_0x2b0521['name']){delete _0x2b0521['name'];}_0x43d0ea['status'](_0x3aa655)['send'](_0x2b0521);};}exports[_0xff83('0x29')]=function(_0x420c6f,_0x118a0f){var _0x244c74={},_0x29a130={},_0x4c1286={'count':0x0,'rows':[]};var _0x48ab7d=_[_0xff83('0x2a')](db[_0xff83('0x2b')][_0xff83('0x2c')],function(_0x46a0ff){return{'name':_0x46a0ff[_0xff83('0x2d')],'type':_0x46a0ff['type'][_0xff83('0x2e')]};});_0x29a130[_0xff83('0x2f')]=_[_0xff83('0x2a')](_0x48ab7d,'name');_0x29a130[_0xff83('0x30')]=_[_0xff83('0x31')](_0x420c6f[_0xff83('0x30')]);_0x29a130[_0xff83('0x32')]=_[_0xff83('0x33')](_0x29a130[_0xff83('0x2f')],_0x29a130['query']);_0x244c74[_0xff83('0x34')]=_[_0xff83('0x33')](_0x29a130[_0xff83('0x2f')],qs[_0xff83('0x35')](_0x420c6f['query'][_0xff83('0x35')]));_0x244c74[_0xff83('0x34')]=_0x244c74[_0xff83('0x34')][_0xff83('0x36')]?_0x244c74['attributes']:_0x29a130[_0xff83('0x2f')];if(!_0x420c6f[_0xff83('0x30')][_0xff83('0x37')](_0xff83('0x38'))){_0x244c74['limit']=qs[_0xff83('0x1e')](_0x420c6f['query'][_0xff83('0x1e')]);_0x244c74[_0xff83('0x1c')]=qs[_0xff83('0x1c')](_0x420c6f['query'][_0xff83('0x1c')]);}_0x244c74[_0xff83('0x39')]=qs['sort'](_0x420c6f[_0xff83('0x30')]['sort']);_0x244c74['where']=qs[_0xff83('0x32')](_[_0xff83('0x3a')](_0x420c6f['query'],_0x29a130[_0xff83('0x32')]),_0x48ab7d);if(_0x420c6f[_0xff83('0x30')]['filter']){_0x244c74['where']=_[_0xff83('0x3b')](_0x244c74[_0xff83('0x3c')],{'$or':_[_0xff83('0x2a')](_0x48ab7d,function(_0xc63347){if(_0xc63347[_0xff83('0x3d')]!==_0xff83('0x3e')){var _0x5cefac={};_0x5cefac[_0xc63347[_0xff83('0x3f')]]={'$like':'%'+_0x420c6f[_0xff83('0x30')][_0xff83('0x40')]+'%'};return _0x5cefac;}})});}_0x244c74=_[_0xff83('0x3b')]({},_0x244c74,_0x420c6f[_0xff83('0x41')]);var _0x11a783={'where':_0x244c74[_0xff83('0x3c')]};return db[_0xff83('0x2b')][_0xff83('0x1f')](_0x11a783)[_0xff83('0x25')](function(_0x5849ad){_0x4c1286[_0xff83('0x1f')]=_0x5849ad;if(_0x420c6f[_0xff83('0x30')][_0xff83('0x42')]){_0x244c74[_0xff83('0x43')]=[{'all':!![]}];}return db['SmsApplication'][_0xff83('0x44')](_0x244c74);})[_0xff83('0x25')](function(_0x3dfa88){_0x4c1286[_0xff83('0x45')]=_0x3dfa88;return _0x4c1286;})['then'](respondWithFilteredResult(_0x118a0f,_0x244c74))[_0xff83('0x46')](handleError(_0x118a0f,null));};exports[_0xff83('0x47')]=function(_0x439cc0,_0x3ddd58){var _0x329cbf={'raw':!![],'where':{'id':_0x439cc0[_0xff83('0x48')]['id']}},_0x2e7c9b={};_0x2e7c9b['model']=_['keys'](db[_0xff83('0x2b')]['rawAttributes']);_0x2e7c9b[_0xff83('0x30')]=_[_0xff83('0x31')](_0x439cc0['query']);_0x2e7c9b[_0xff83('0x32')]=_[_0xff83('0x33')](_0x2e7c9b[_0xff83('0x2f')],_0x2e7c9b['query']);_0x329cbf[_0xff83('0x34')]=_[_0xff83('0x33')](_0x2e7c9b[_0xff83('0x2f')],qs[_0xff83('0x35')](_0x439cc0['query'][_0xff83('0x35')]));_0x329cbf[_0xff83('0x34')]=_0x329cbf[_0xff83('0x34')][_0xff83('0x36')]?_0x329cbf[_0xff83('0x34')]:_0x2e7c9b['model'];if(_0x439cc0[_0xff83('0x30')][_0xff83('0x42')]){_0x329cbf[_0xff83('0x43')]=[{'all':!![]}];}_0x329cbf=_[_0xff83('0x3b')]({},_0x329cbf,_0x439cc0['options']);return db[_0xff83('0x2b')][_0xff83('0x49')](_0x329cbf)[_0xff83('0x25')](handleEntityNotFound(_0x3ddd58,null))[_0xff83('0x25')](respondWithResult(_0x3ddd58,null))[_0xff83('0x46')](handleError(_0x3ddd58,null));};exports['create']=function(_0x290f49,_0x176255){return db[_0xff83('0x2b')][_0xff83('0x4a')](_0x290f49['body'],{})[_0xff83('0x25')](respondWithResult(_0x176255,0xc9))['catch'](handleError(_0x176255,null));};exports[_0xff83('0x24')]=function(_0xe3373e,_0x2fb216){if(_0xe3373e[_0xff83('0x4b')]['id']){delete _0xe3373e[_0xff83('0x4b')]['id'];}return db[_0xff83('0x2b')][_0xff83('0x49')]({'where':{'id':_0xe3373e[_0xff83('0x48')]['id']}})['then'](handleEntityNotFound(_0x2fb216,null))[_0xff83('0x25')](saveUpdates(_0xe3373e[_0xff83('0x4b')],null))[_0xff83('0x25')](respondWithResult(_0x2fb216,null))['catch'](handleError(_0x2fb216,null));};exports[_0xff83('0x26')]=function(_0x35e5fc,_0x37628e){return db[_0xff83('0x2b')][_0xff83('0x49')]({'where':{'id':_0x35e5fc['params']['id']}})[_0xff83('0x25')](handleEntityNotFound(_0x37628e,null))[_0xff83('0x25')](removeEntity(_0x37628e,null))[_0xff83('0x46')](handleError(_0x37628e,null));};
\ No newline at end of file
index c0f4ba7..20803b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcea7=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcea7,0xd1));var _0x7cea=function(_0x369b38,_0x21ae45){_0x369b38=_0x369b38-0x0;var _0x553ddd=_0xcea7[_0x369b38];return _0x553ddd;};'use strict';var _=require(_0x7cea('0x0'));var util=require(_0x7cea('0x1'));var logger=require(_0x7cea('0x2'))('api');var moment=require(_0x7cea('0x3'));var BPromise=require(_0x7cea('0x4'));var rp=require(_0x7cea('0x5'));var fs=require('fs');var path=require(_0x7cea('0x6'));var rimraf=require('rimraf');var config=require(_0x7cea('0x7'));var attributes=require(_0x7cea('0x8'));module[_0x7cea('0x9')]=function(_0x4d5b50,_0x4544f4){return _0x4d5b50['define'](_0x7cea('0xa'),attributes,{'tableName':_0x7cea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7cea('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7bd6=['../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x7bd6,0x1e7));var _0x67bd=function(_0x2081aa,_0x31d653){_0x2081aa=_0x2081aa-0x0;var _0x36485d=_0x7bd6[_0x2081aa];return _0x36485d;};'use strict';var _=require(_0x67bd('0x0'));var util=require(_0x67bd('0x1'));var logger=require(_0x67bd('0x2'))(_0x67bd('0x3'));var moment=require(_0x67bd('0x4'));var BPromise=require('bluebird');var rp=require(_0x67bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x67bd('0x6'));var config=require(_0x67bd('0x7'));var attributes=require(_0x67bd('0x8'));module['exports']=function(_0x7cb59e,_0x2750a5){return _0x7cb59e[_0x67bd('0x9')](_0x67bd('0xa'),attributes,{'tableName':_0x67bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x67bd('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 9f98cf6..63e2577 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd6e=['request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x16e48d,_0x3e2d9b){var _0x532d02=function(_0xbc232b){while(--_0xbc232b){_0x16e48d['push'](_0x16e48d['shift']());}};_0x532d02(++_0x3e2d9b);}(_0xdd6e,0xa5));var _0xedd6=function(_0x42058e,_0x252ea5){_0x42058e=_0x42058e-0x0;var _0x117198=_0xdd6e[_0x42058e];return _0x117198;};'use strict';var _=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var moment=require(_0xedd6('0x2'));var BPromise=require(_0xedd6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedd6('0x4'));var db=require(_0xedd6('0x5'))['db'];var utils=require(_0xedd6('0x6'));var logger=require(_0xedd6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xedd6('0x8')][_0xedd6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5300a5,_0x135950,_0x30d933){return new BPromise(function(_0x15f317,_0x29743a){return client[_0xedd6('0xa')](_0x5300a5,_0x30d933)['then'](function(_0x4c282c){logger[_0xedd6('0xb')](_0xedd6('0xc'),_0x135950,'request\x20sent');logger[_0xedd6('0xd')](_0xedd6('0xe'),_0x135950,_0xedd6('0xf'),JSON[_0xedd6('0x10')](_0x4c282c));if(_0x4c282c['error']){if(_0x4c282c[_0xedd6('0x11')]['code']===0x1f4){logger[_0xedd6('0x11')](_0xedd6('0xc'),_0x135950,_0x4c282c[_0xedd6('0x11')][_0xedd6('0x12')]);return _0x29743a(_0x4c282c['error'][_0xedd6('0x12')]);}logger[_0xedd6('0x11')](_0xedd6('0xc'),_0x135950,_0x4c282c[_0xedd6('0x11')][_0xedd6('0x12')]);return _0x15f317(_0x4c282c[_0xedd6('0x11')][_0xedd6('0x12')]);}else{logger[_0xedd6('0xb')](_0xedd6('0xc'),_0x135950,_0xedd6('0xf'));_0x15f317(_0x4c282c[_0xedd6('0x13')][_0xedd6('0x12')]);}})['catch'](function(_0x278c18){logger[_0xedd6('0x11')](_0xedd6('0xc'),_0x135950,_0x278c18);_0x29743a(_0x278c18);});});}
\ No newline at end of file
+var _0x9582=['error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1d93c8,_0x15b37b){var _0x33f5bd=function(_0x5d75e0){while(--_0x5d75e0){_0x1d93c8['push'](_0x1d93c8['shift']());}};_0x33f5bd(++_0x15b37b);}(_0x9582,0x95));var _0x2958=function(_0x426315,_0x4de8e3){_0x426315=_0x426315-0x0;var _0x5acfab=_0x9582[_0x426315];return _0x5acfab;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('SmsApplication,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('SmsApplication,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});}
\ No newline at end of file
index f185130..3e12205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefda=['../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','smsinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5d3c91,_0x1283d5){var _0x2a81f3=function(_0x44965d){while(--_0x44965d){_0x5d3c91['push'](_0x5d3c91['shift']());}};_0x2a81f3(++_0x1283d5);}(_0xefda,0x96));var _0xaefd=function(_0x55c614,_0x1ae0c3){_0x55c614=_0x55c614-0x0;var _0x17f3ec=_0xefda[_0x55c614];return _0x17f3ec;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['describe']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['show']);router['get']('/:id/messages',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0x8')](_0xaefd('0xe'),auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0x10')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0x11')]);router[_0xaefd('0x10')](_0xaefd('0x12'),auth['isAuthenticated'](),controller[_0xaefd('0x13')]);router['post'](_0xaefd('0x14'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),'smsinteraction:addtags'),controller[_0xaefd('0x17')]);router[_0xaefd('0x18')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),_0xaefd('0x19')),controller[_0xaefd('0x1a')]);router['delete'](_0xaefd('0xc'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),_0xaefd('0x1b')),controller[_0xaefd('0x1c')]);router['delete'](_0xaefd('0x14'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x1d')]);module[_0xaefd('0x1e')]=router;
\ No newline at end of file
+var _0x36ee=['../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','smsinteraction:addtags','addTags','put','tracked','sms','smsinteraction:update','update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1d275a,_0x16f8f2){var _0x54f6d1=function(_0x56e51e){while(--_0x56e51e){_0x1d275a['push'](_0x1d275a['shift']());}};_0x54f6d1(++_0x16f8f2);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x13')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x14')]);router['post'](_0xe36e('0xf'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x13')]('/:id/tags',auth[_0xe36e('0x9')](),interaction['tracked']('sms',_0xe36e('0x16')),controller[_0xe36e('0x17')]);router[_0xe36e('0x18')](_0xe36e('0xd'),auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')](_0xe36e('0x1a'),_0xe36e('0x1b')),controller[_0xe36e('0x1c')]);router[_0xe36e('0x1d')]('/:id',auth[_0xe36e('0x9')](),interaction[_0xe36e('0x19')]('sms',_0xe36e('0x1e')),controller['destroy']);router[_0xe36e('0x1d')](_0xe36e('0x1f'),auth['isAuthenticated'](),controller[_0xe36e('0x20')]);module[_0xe36e('0x21')]=router;
\ No newline at end of file
index f5190de..64dbd6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4da5=['BOOLEAN','STRING','DATE','out','ENUM','moment','exports'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x4da5,0x1b7));var _0x54da=function(_0x230dab,_0x47c6be){_0x230dab=_0x230dab-0x0;var _0x57f1ea=_0x4da5[_0x230dab];return _0x57f1ea;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x54da('0x0'));module[_0x54da('0x1')]={'closed':{'type':Sequelize[_0x54da('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x54da('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x54da('0x3')]},'note':{'type':Sequelize[_0x54da('0x3')]},'phone':{'type':Sequelize[_0x54da('0x3')]},'read1stAt':{'type':Sequelize[_0x54da('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x54da('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x54da('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x54da('0x6')]('in',_0x54da('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x54da('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9a96=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x91bb9c,_0x55025c){var _0x4b93a4=function(_0x47365b){while(--_0x47365b){_0x91bb9c['push'](_0x91bb9c['shift']());}};_0x4b93a4(++_0x55025c);}(_0x9a96,0xd0));var _0x69a9=function(_0x2ab3f9,_0x10fc1e){_0x2ab3f9=_0x2ab3f9-0x0;var _0x53f72f=_0x9a96[_0x2ab3f9];return _0x53f72f;};'use strict';var Sequelize=require(_0x69a9('0x0'));var moment=require(_0x69a9('0x1'));module[_0x69a9('0x2')]={'closed':{'type':Sequelize[_0x69a9('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x69a9('0x4')]},'disposition':{'type':Sequelize[_0x69a9('0x5')]},'secondDisposition':{'type':Sequelize[_0x69a9('0x5')]},'thirdDisposition':{'type':Sequelize[_0x69a9('0x5')]},'note':{'type':Sequelize[_0x69a9('0x5')]},'phone':{'type':Sequelize[_0x69a9('0x5')]},'read1stAt':{'type':Sequelize[_0x69a9('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x69a9('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x69a9('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x69a9('0x6')]('in',_0x69a9('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x69a9('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 636e36f..a04776d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b08=['request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','fullname','TagIds','split','forEach','index','SmsInteraction','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','select','field','from','u.id','u.fullname','ui.SmsInteractionId','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','length','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','$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?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','isEmpty','i.SmsAccountId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','fields','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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','rows','catch','show','includeAll','include','options','create','destroy','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','sort','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','removeTags','unix','join','root','server','files','format','transcript-%d-%s.zip','push','CmContact','firstName','lastName','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','Messages','out','System','renderFile','views','transcript-','.pdf','Sms','createPdfFromHTML','download','log','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x3e4ca4,_0x307aa8){var _0x46d294=function(_0x4c6313){while(--_0x4c6313){_0x3e4ca4['push'](_0x3e4ca4['shift']());}};_0x46d294(++_0x307aa8);}(_0x8b08,0x1d1));var _0x88b0=function(_0x539263,_0x5b7691){_0x539263=_0x539263-0x0;var _0x2e2b23=_0x8b08[_0x539263];return _0x2e2b23;};'use strict';var emlformat=require(_0x88b0('0x0'));var rimraf=require(_0x88b0('0x1'));var zipdir=require(_0x88b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x88b0('0x3'));var moment=require('moment');var BPromise=require(_0x88b0('0x4'));var Mustache=require(_0x88b0('0x5'));var util=require(_0x88b0('0x6'));var path=require(_0x88b0('0x7'));var sox=require(_0x88b0('0x8'));var csv=require(_0x88b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x88b0('0xa'));var squel=require(_0x88b0('0xb'));var crypto=require(_0x88b0('0xc'));var jsforce=require(_0x88b0('0xd'));var deskjs=require(_0x88b0('0xe'));var toCsv=require(_0x88b0('0x9'));var querystring=require(_0x88b0('0xf'));var Papa=require(_0x88b0('0x10'));var Redis=require(_0x88b0('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x88b0('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x88b0('0x13'));var logger=require(_0x88b0('0x14'))(_0x88b0('0x15'));var utils=require(_0x88b0('0x16'));var config=require(_0x88b0('0x17'));var licenseUtil=require(_0x88b0('0x18'));var db=require(_0x88b0('0x19'))['db'];config[_0x88b0('0x1a')]=_[_0x88b0('0x1b')](config[_0x88b0('0x1a')],{'host':_0x88b0('0x1c'),'port':0x18eb});var socket=require(_0x88b0('0x1d'))(new Redis(config[_0x88b0('0x1a')]));require(_0x88b0('0x1e'))[_0x88b0('0x1f')](socket);function respondWithStatusCode(_0x4cab4a,_0x31391a){_0x31391a=_0x31391a||0xcc;return function(_0x2a6c3c){if(_0x2a6c3c){return _0x4cab4a[_0x88b0('0x20')](_0x31391a);}return _0x4cab4a[_0x88b0('0x21')](_0x31391a)['end']();};}function respondWithResult(_0x28d480,_0x1df92a){_0x1df92a=_0x1df92a||0xc8;return function(_0x6fa123){if(_0x6fa123){return _0x28d480[_0x88b0('0x21')](_0x1df92a)[_0x88b0('0x22')](_0x6fa123);}};}function respondWithFilteredResult(_0x1ca5b1,_0x235e85){return function(_0x3cb47a){if(_0x3cb47a){var _0x506c1b=typeof _0x235e85[_0x88b0('0x23')]==='undefined'&&typeof _0x235e85['limit']===_0x88b0('0x24');var _0x37d047=_0x3cb47a[_0x88b0('0x25')];var _0x2cfb2f=_0x506c1b?0x0:_0x235e85[_0x88b0('0x23')];var _0xe508b=_0x506c1b?_0x3cb47a['count']:_0x235e85[_0x88b0('0x23')]+_0x235e85[_0x88b0('0x26')];var _0x15c928;if(_0xe508b>=_0x37d047){_0xe508b=_0x37d047;_0x15c928=0xc8;}else{_0x15c928=0xce;}_0x1ca5b1[_0x88b0('0x21')](_0x15c928);return _0x1ca5b1[_0x88b0('0x27')](_0x88b0('0x28'),_0x2cfb2f+'-'+_0xe508b+'/'+_0x37d047)[_0x88b0('0x22')](_0x3cb47a);}return null;};}function patchUpdates(_0xa72d9e){return function(_0x1391b2){try{jsonpatch[_0x88b0('0x29')](_0x1391b2,_0xa72d9e,!![]);}catch(_0x50ee2a){return BPromise['reject'](_0x50ee2a);}return _0x1391b2[_0x88b0('0x2a')]();};}function saveUpdates(_0x54dced,_0x394019){return function(_0x47e636){if(_0x47e636){return _0x47e636[_0x88b0('0x2b')](_0x54dced)[_0x88b0('0x2c')](function(_0x3eb1bc){return _0x3eb1bc;});}return null;};}function removeEntity(_0xed5d0e,_0x27849a){return function(_0x2a98fe){if(_0x2a98fe){return _0x2a98fe['destroy']()[_0x88b0('0x2c')](function(){_0xed5d0e[_0x88b0('0x21')](0xcc)[_0x88b0('0x2d')]();});}};}function handleEntityNotFound(_0x166407,_0x47a851){return function(_0x311957){if(!_0x311957){_0x166407[_0x88b0('0x20')](0x194);}return _0x311957;};}function handleError(_0x1520a1,_0x451878){_0x451878=_0x451878||0x1f4;return function(_0x4cf33e){logger[_0x88b0('0x2e')](_0x4cf33e[_0x88b0('0x2f')]);if(_0x4cf33e[_0x88b0('0x30')]){delete _0x4cf33e[_0x88b0('0x30')];}_0x1520a1['status'](_0x451878)['send'](_0x4cf33e);};}function getInteractionUsers(_0x7a063c,_0x1d9d0a){return new BPromise(function(_0x45948b,_0x2017c5){try{if(_0x1d9d0a[_0x7a063c['id']]){_0x7a063c['Users']=_['map'](_0x1d9d0a[_0x7a063c['id']],function(_0x34bf78){return{'id':_0x34bf78['id'],'fullname':_0x34bf78[_0x88b0('0x31')]};});}}catch(_0x323749){_0x2017c5(_0x323749);}_0x45948b(_0x7a063c);});}function getInteractionTags(_0x32826d,_0x230afe){return new BPromise(function(_0x42967c,_0x35ac95){try{if(_0x32826d[_0x88b0('0x32')]){_0x32826d['Tags']=[];_0x32826d['TagIds'][_0x88b0('0x33')](',')[_0x88b0('0x34')](function(_0x34dc9b){_0x32826d['Tags']['push'](_0x230afe[_0x34dc9b]);});}delete _0x32826d[_0x88b0('0x32')];}catch(_0x14818b){_0x35ac95(_0x14818b);}_0x42967c(_0x32826d);});}function updateSmsInteraction(_0x19a507,_0x4e997b,_0x196f59){return new BPromise(function(_0x5aaa65,_0x3dad24){return getInteractionUsers(_0x19a507,_0x196f59)['then'](function(_0x49cb8a){return getInteractionTags(_0x49cb8a,_0x4e997b);})[_0x88b0('0x2c')](function(_0x1dd963){_0x5aaa65(_0x1dd963);})['catch'](function(_0x21d15c){_0x3dad24(_0x21d15c);});});}exports[_0x88b0('0x35')]=function(_0x585b7c,_0x58651c){var _0x531f43={},_0x2c1ed4={},_0x4c42ae={'count':0x0,'rows':[]};var _0x48737a=_['map'](db[_0x88b0('0x36')][_0x88b0('0x37')],function(_0x2b0c53){return{'name':_0x2b0c53[_0x88b0('0x38')],'type':_0x2b0c53[_0x88b0('0x39')][_0x88b0('0x3a')]};});_0x2c1ed4[_0x88b0('0x3b')]=_[_0x88b0('0x3c')](_0x48737a,_0x88b0('0x30'));_0x2c1ed4[_0x88b0('0x3d')]=_['keys'](_0x585b7c[_0x88b0('0x3d')]);_0x2c1ed4[_0x88b0('0x3e')]=_[_0x88b0('0x3f')](_0x2c1ed4[_0x88b0('0x3b')],_0x2c1ed4[_0x88b0('0x3d')]);_0x531f43['attributes']=_['intersection'](_0x2c1ed4['model'],qs['fields'](_0x585b7c[_0x88b0('0x3d')]['fields']));_0x531f43[_0x88b0('0x40')]=_0x531f43['attributes']['length']?_0x531f43[_0x88b0('0x40')]:_0x2c1ed4['model'];if(!_0x585b7c['query'][_0x88b0('0x41')](_0x88b0('0x42'))){_0x531f43['limit']=qs[_0x88b0('0x26')](_0x585b7c[_0x88b0('0x3d')][_0x88b0('0x26')]);_0x531f43[_0x88b0('0x23')]=qs['offset'](_0x585b7c['query'][_0x88b0('0x23')]);}_0x531f43[_0x88b0('0x43')]=qs['sort'](_0x585b7c[_0x88b0('0x3d')]['sort']);_0x531f43['where']=qs[_0x88b0('0x3e')](_['pick'](_0x585b7c[_0x88b0('0x3d')],_0x2c1ed4[_0x88b0('0x3e')]),_0x48737a);var _0x2cb8d4=[];var _0x5edb3f=squel[_0x88b0('0x44')]()[_0x88b0('0x45')]('id')['field']('name')[_0x88b0('0x45')]('color')[_0x88b0('0x46')]('tools_tags');var _0x3527a1=squel['select']()[_0x88b0('0x45')](_0x88b0('0x47'))[_0x88b0('0x45')](_0x88b0('0x48'))['field'](_0x88b0('0x49'))[_0x88b0('0x46')]('user_has_sms_interactions','ui')['left_join'](_0x88b0('0x4a'),'u',_0x88b0('0x4b'));var _0x334cc0=squel[_0x88b0('0x44')]()[_0x88b0('0x46')](_0x88b0('0x4c'),'i')['left_join'](_0x88b0('0x4d'),'c',_0x88b0('0x4e'))[_0x88b0('0x4f')](_0x88b0('0x4a'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x88b0('0x50'),'a',_0x88b0('0x51'))[_0x88b0('0x4f')](_0x88b0('0x52'),'me',_0x88b0('0x53'))[_0x88b0('0x4f')]('sms_interaction_has_tags','it',_0x88b0('0x54'))['left_join'](_0x88b0('0x55'),'t','t.id\x20=\x20it.TagId');var _0x348b7c=squel[_0x88b0('0x56')]();var _0x1a3901=[];var _0x1c7c48=squel[_0x88b0('0x56')]();var _0x4d7b23;if(_0x585b7c[_0x88b0('0x3d')][_0x88b0('0x57')]){_0x4d7b23=as['parseSearch'](_0x585b7c[_0x88b0('0x3d')]['search']);var _0x101143=_0x4d7b23[_0x88b0('0x58')];for(var _0x53647a=0x0;_0x53647a<_0x4d7b23['conditions'][_0x88b0('0x59')];_0x53647a++){var _0x43cf36=_0x4d7b23[_0x88b0('0x5a')][_0x53647a];var _0x503424='i';var _0x45cd19=_[_0x88b0('0x5b')](_0x48737a,[_0x88b0('0x30'),_0x43cf36[_0x88b0('0x45')]]);if(!_0x45cd19){switch(_0x43cf36[_0x88b0('0x45')]){case _0x88b0('0x5c'):if(_0x43cf36[_0x88b0('0x5d')]==0x1){_0x334cc0[_0x88b0('0x5e')]('`'+_0x43cf36[_0x88b0('0x45')]+_0x88b0('0x5f'));}else{_0x334cc0[_0x88b0('0x5e')]('`'+_0x43cf36[_0x88b0('0x45')]+'`\x20>\x200');}break;case _0x88b0('0x60'):if(_0x43cf36['operator']==='$substring'){if(_0x43cf36[_0x88b0('0x5d')][_0x88b0('0x33')]('\x20')[_0x88b0('0x59')]>0x1){_0x348b7c[_0x101143](_0x88b0('0x61'),qs[_0x88b0('0x62')](_0x43cf36[_0x88b0('0x5d')]),null);}else{var _0x5c4bf9='%'+_0x43cf36[_0x88b0('0x5d')]+'%';_0x348b7c[_0x101143](_0x88b0('0x63'),_0x5c4bf9,_0x5c4bf9,_0x5c4bf9);}}else{_0x45cd19=_[_0x88b0('0x5b')](_0x48737a,[_0x88b0('0x30'),'ContactId']);_0x43cf36[_0x88b0('0x45')]=_0x88b0('0x64');_0x1a8185=as[_0x88b0('0x65')](_0x503424,_0x45cd19['type'],_0x43cf36);_0x348b7c[_0x101143](_0x1a8185[_0x88b0('0x66')],_0x1a8185[_0x88b0('0x5d')][_0x88b0('0x67')],_0x1a8185[_0x88b0('0x5d')]['end']);}break;case _0x88b0('0x68'):var _0x2c6c18=_0x43cf36['value'][_0x88b0('0x33')](',')[_0x88b0('0x3c')](function(_0x64c753){return Number(_0x64c753);});_0x2c6c18[_0x88b0('0x34')](function(_0x4c7227){_0x1c7c48['or'](_0x88b0('0x69'),'%,'+_0x4c7227+',%');});_0x1a3901=_[_0x88b0('0x6a')](_0x1a3901,_0x2c6c18);break;case _0x88b0('0x6b'):if(_0x43cf36['operator']===_0x88b0('0x6c')){_0x348b7c[_0x101143](_0x88b0('0x6d'),'%'+_0x43cf36[_0x88b0('0x5d')]+'%',null);}else{_0x45cd19=_[_0x88b0('0x5b')](_0x48737a,['name','UserId']);_0x43cf36[_0x88b0('0x45')]=_0x88b0('0x6e');_0x1a8185=as[_0x88b0('0x65')](_0x503424,_0x45cd19[_0x88b0('0x39')],_0x43cf36);_0x348b7c[_0x101143](_0x1a8185['text'],_0x1a8185[_0x88b0('0x5d')][_0x88b0('0x67')],_0x1a8185['value']['end']);}break;case _0x88b0('0x6f'):_0x1a8185=as[_0x88b0('0x65')]('me',null,_0x43cf36);_0x348b7c[_0x101143](_0x1a8185['text'],_0x1a8185[_0x88b0('0x5d')][_0x88b0('0x67')],_0x1a8185[_0x88b0('0x5d')][_0x88b0('0x2d')]);break;}}else{var _0x1a8185=as[_0x88b0('0x65')](_0x503424,_0x45cd19['type'],_0x43cf36);_0x348b7c[_0x101143](_0x1a8185[_0x88b0('0x66')],_0x1a8185[_0x88b0('0x5d')][_0x88b0('0x67')],_0x1a8185[_0x88b0('0x5d')][_0x88b0('0x2d')]);}}}else{var _0x48d7f4=_(_0x585b7c[_0x88b0('0x3d')])[_0x88b0('0x70')]()['map'](function(_0x431e0a){return _[_0x88b0('0x71')](_0x48737a,[_0x88b0('0x30'),_0x431e0a])?_0x431e0a:undefined;})[_0x88b0('0x72')]()[_0x88b0('0x5d')]();if(!_['isEmpty'](_0x48d7f4)){_0x48d7f4[_0x88b0('0x34')](function(_0x54b02c){if(_0x54b02c===_0x88b0('0x73')){_0x334cc0[_0x88b0('0x74')](_0x88b0('0x75'),[][_0x88b0('0x76')](_0x585b7c[_0x88b0('0x3d')][_0x54b02c]));}else if(_0x54b02c===_0x88b0('0x77')){var _0xd45d0a=JSON['parse'](_0x585b7c[_0x88b0('0x3d')][_0x54b02c])['$gte'];var _0x8f1f55=JSON['parse'](_0x585b7c['query'][_0x54b02c])[_0x88b0('0x78')];_0x334cc0[_0x88b0('0x74')](_0x88b0('0x79'),_0xd45d0a,_0x8f1f55);}else{if(_0x585b7c['query'][_0x54b02c]===_0x88b0('0x7a')){_0x334cc0[_0x88b0('0x74')]('i.'+_0x54b02c+_0x88b0('0x7b'));}else{_0x334cc0[_0x88b0('0x74')]('i.'+_0x54b02c+_0x88b0('0x7c'),_0x585b7c[_0x88b0('0x3d')][_0x54b02c]);}}});}if(_0x585b7c[_0x88b0('0x3d')][_0x88b0('0x7d')]){if(_0x585b7c[_0x88b0('0x3d')][_0x88b0('0x7d')]==0x1){_0x334cc0[_0x88b0('0x5e')](_0x88b0('0x7e'));}else{_0x334cc0[_0x88b0('0x5e')](_0x88b0('0x7f'));}}if(_0x585b7c[_0x88b0('0x3d')][_0x88b0('0x80')]){_0x1a3901=_['isArray'](_0x585b7c[_0x88b0('0x3d')]['tag'])?_0x585b7c[_0x88b0('0x3d')][_0x88b0('0x80')]:new Array(_0x585b7c[_0x88b0('0x3d')][_0x88b0('0x80')]);_0x1a3901[_0x88b0('0x34')](function(_0x51ddb9){_0x1c7c48['or'](_0x88b0('0x69'),'%,'+_0x51ddb9+',%');});}if(_0x585b7c[_0x88b0('0x3d')][_0x88b0('0x81')]){var _0x45928b=_0x585b7c[_0x88b0('0x3d')]['filter'][_0x88b0('0x82')]('\x5c','\x5c\x5c')[_0x88b0('0x82')](/'/g,'\x27\x27');if(qs[_0x88b0('0x83')](_0x45928b)){_0x348b7c['or'](_0x88b0('0x84'),_0x45928b+'%')['or'](_0x88b0('0x85'),_0x45928b+'%');}else{_0x348b7c['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x88b0('0x62')](_0x45928b))['or'](_0x88b0('0x86'),_0x45928b+'%');}}}_0x334cc0['where'](_0x348b7c);_0x334cc0[_0x88b0('0x87')]('i.id');var _0x2b9c82={'type':db[_0x88b0('0x88')][_0x88b0('0x89')][_0x88b0('0x8a')],'raw':!![]};var _0x30103f=_0x334cc0['clone']();_0x30103f[_0x88b0('0x45')](_0x88b0('0x8b'));_0x30103f[_0x88b0('0x45')](_0x88b0('0x8c'),_0x88b0('0x5c'));if(_0x531f43[_0x88b0('0x43')]){_0x531f43['order'][_0x88b0('0x34')](function(_0x4f49eb){var _0x40dd40=_0x4f49eb[0x0]===_0x88b0('0x8d')?_0x4f49eb[0x0]:'i.'+_0x4f49eb[0x0];_0x334cc0[_0x88b0('0x43')](_0x40dd40,_0x4f49eb[0x1]===_0x88b0('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x1a3901)){_0x334cc0[_0x88b0('0x5e')](_0x1c7c48);_0x30103f['where'](_0x88b0('0x8f'),_0x1a3901);}BPromise[_0x88b0('0x90')]()[_0x88b0('0x2c')](function(){if(!_0x4d7b23){if(_0x585b7c[_0x88b0('0x3d')][_0x88b0('0x73')])return;_0x30103f[_0x88b0('0x74')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x334cc0[_0x88b0('0x74')](_0x88b0('0x91'));return;}if(_0x585b7c[_0x88b0('0x92')]['role']!=='agent')return;return _0x585b7c[_0x88b0('0x92')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x88b0('0x2c')](function(_0x408fef){if(_[_0x88b0('0x93')](_0x408fef)){_0x30103f[_0x88b0('0x74')](_0x88b0('0x94'));_0x334cc0[_0x88b0('0x74')](_0x88b0('0x94'));}else{_0x30103f['where'](_0x88b0('0x75'),_[_0x88b0('0x3c')](_0x408fef,'id'));_0x334cc0[_0x88b0('0x74')](_0x88b0('0x75'),_['map'](_0x408fef,'id'));}});})[_0x88b0('0x2c')](function(){if(_0x585b7c[_0x88b0('0x92')][_0x88b0('0x95')]===_0x88b0('0x96')&&!_0x4d7b23&&!_0x585b7c['query'][_0x88b0('0x73')])return[];return db[_0x88b0('0x97')][_0x88b0('0x3d')](_0x30103f[_0x88b0('0x98')](),_0x2b9c82);})[_0x88b0('0x2c')](function(_0x1e9533){_0x4c42ae[_0x88b0('0x25')]=_0x1e9533[_0x88b0('0x59')];if(_0x4c42ae['count']===0x0)return[];return db[_0x88b0('0x97')][_0x88b0('0x3d')](_0x5edb3f['toString'](),_0x2b9c82)['then'](function(_0x4d385b){_0x2cb8d4=_[_0x88b0('0x99')](_0x4d385b,'id');_0x2b9c82=_[_0x88b0('0x9a')](_0x2b9c82,{'model':db[_0x88b0('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x585b7c[_0x88b0('0x3d')][_0x88b0('0x9b')]){_0x531f43[_0x88b0('0x40')]['forEach'](function(_0x41263c){_0x334cc0[_0x88b0('0x45')]('i.'+_0x41263c);});}else{_0x334cc0[_0x88b0('0x45')](_0x88b0('0x8c'),_0x88b0('0x5c'));_0x334cc0[_0x88b0('0x45')](_0x88b0('0x9c'),'Account.key');_0x334cc0[_0x88b0('0x45')]('a.mandatoryDisposition',_0x88b0('0x9d'));_0x334cc0[_0x88b0('0x45')](_0x88b0('0x9e'),_0x88b0('0x8d'));_0x334cc0['field']('i.*');_0x334cc0[_0x88b0('0x45')](_0x88b0('0x9f'),_0x88b0('0xa0'));_0x334cc0['field'](_0x88b0('0xa1'),_0x88b0('0xa2'));_0x334cc0[_0x88b0('0x45')](_0x88b0('0xa3'),_0x88b0('0xa4'));_0x334cc0[_0x88b0('0x45')]('c.phone',_0x88b0('0xa5'));_0x334cc0[_0x88b0('0x45')](_0x88b0('0xa6'),_0x88b0('0xa7'));_0x334cc0[_0x88b0('0x45')](_0x88b0('0xa8'),'Contact.fax');_0x334cc0[_0x88b0('0x45')](_0x88b0('0xa9'),_0x88b0('0xaa'));_0x334cc0[_0x88b0('0x45')]('o.internal','Owner.internal');_0x334cc0['field'](_0x88b0('0xab'),'TagIds');}if(_0x531f43['limit'])_0x334cc0[_0x88b0('0x26')](_0x531f43['limit']);if(_0x531f43[_0x88b0('0x23')])_0x334cc0[_0x88b0('0x23')](_0x531f43[_0x88b0('0x23')]);return db[_0x88b0('0x97')][_0x88b0('0x3d')](_0x334cc0['toString'](),_0x2b9c82);})[_0x88b0('0x2c')](function(_0x270345){if(_0x270345[_0x88b0('0x59')]>0x0)_0x3527a1[_0x88b0('0x74')](_0x88b0('0xac'),_['map'](_0x270345,'id'));return db['sequelize']['query'](_0x3527a1[_0x88b0('0x98')](),_0x2b9c82)[_0x88b0('0x2c')](function(_0x3f5ec7){var _0x57ab29=_['groupBy'](_0x3f5ec7,_0x88b0('0xad'));var _0x27daba=[];_0x270345[_0x88b0('0x34')](function(_0x5623f0){_0x27daba['push'](updateSmsInteraction(_0x5623f0,_0x2cb8d4,_0x57ab29));});return BPromise['all'](_0x27daba);});});})['then'](function(_0x1413e9){_0x4c42ae[_0x88b0('0xae')]=_0x1413e9;return _0x4c42ae;})[_0x88b0('0x2c')](respondWithFilteredResult(_0x58651c,_0x531f43))[_0x88b0('0xaf')](handleError(_0x58651c,null));};exports[_0x88b0('0xb0')]=function(_0x5927a1,_0x994609){var _0x145770={'raw':![],'where':{'id':_0x5927a1['params']['id']}},_0x1b34f8={};_0x1b34f8[_0x88b0('0x3b')]=_[_0x88b0('0x70')](db['SmsInteraction'][_0x88b0('0x37')]);_0x1b34f8['query']=_[_0x88b0('0x70')](_0x5927a1[_0x88b0('0x3d')]);_0x1b34f8[_0x88b0('0x3e')]=_[_0x88b0('0x3f')](_0x1b34f8[_0x88b0('0x3b')],_0x1b34f8[_0x88b0('0x3d')]);_0x145770[_0x88b0('0x40')]=_[_0x88b0('0x3f')](_0x1b34f8[_0x88b0('0x3b')],qs[_0x88b0('0x9b')](_0x5927a1[_0x88b0('0x3d')][_0x88b0('0x9b')]));_0x145770[_0x88b0('0x40')]=_0x145770[_0x88b0('0x40')]['length']?_0x145770[_0x88b0('0x40')]:_0x1b34f8[_0x88b0('0x3b')];if(_0x5927a1[_0x88b0('0x3d')][_0x88b0('0xb1')]){_0x145770[_0x88b0('0xb2')]=[{'all':!![]}];}_0x145770=_[_0x88b0('0x9a')]({},_0x145770,_0x5927a1[_0x88b0('0xb3')]);return db['SmsInteraction'][_0x88b0('0x5b')](_0x145770)[_0x88b0('0x2c')](handleEntityNotFound(_0x994609,null))['then'](respondWithResult(_0x994609,null))[_0x88b0('0xaf')](handleError(_0x994609,null));};exports[_0x88b0('0xb4')]=function(_0x446665,_0x15a94c){return db[_0x88b0('0x36')][_0x88b0('0xb4')](_0x446665['body'],{})['then'](respondWithResult(_0x15a94c,0xc9))['catch'](handleError(_0x15a94c,null));};exports[_0x88b0('0x2b')]=function(_0x31df3d,_0x350f38){if(_0x31df3d[_0x88b0('0x6f')]['id']){delete _0x31df3d[_0x88b0('0x6f')]['id'];}return db[_0x88b0('0x36')][_0x88b0('0x5b')]({'where':{'id':_0x31df3d['params']['id']}})[_0x88b0('0x2c')](handleEntityNotFound(_0x350f38,null))[_0x88b0('0x2c')](saveUpdates(_0x31df3d['body'],null))['then'](respondWithResult(_0x350f38,null))[_0x88b0('0xaf')](handleError(_0x350f38,null));};exports[_0x88b0('0xb5')]=function(_0xff40a1,_0x21a130){return db[_0x88b0('0x36')][_0x88b0('0x5b')]({'where':{'id':_0xff40a1[_0x88b0('0xb6')]['id']}})['then'](handleEntityNotFound(_0x21a130,null))['then'](removeEntity(_0x21a130,null))[_0x88b0('0xaf')](handleError(_0x21a130,null));};exports[_0x88b0('0xb7')]=function(_0x310fbc,_0x2647b1){return db[_0x88b0('0x36')][_0x88b0('0xb7')]()[_0x88b0('0x2c')](respondWithResult(_0x2647b1,null))[_0x88b0('0xaf')](handleError(_0x2647b1,null));};exports[_0x88b0('0xb8')]=function(_0x57fd6d,_0x5d91f0,_0x53d648){return db[_0x88b0('0xb9')]['find']({'where':{'id':_0x57fd6d[_0x88b0('0xb6')]['id']}})[_0x88b0('0x2c')](handleEntityNotFound(_0x5d91f0,null))[_0x88b0('0x2c')](function(_0x4fa95a){if(_0x4fa95a){return _0x4fa95a[_0x88b0('0xb8')](_0x57fd6d['body'][_0x88b0('0xba')],_[_0x88b0('0xbb')](_0x57fd6d[_0x88b0('0x6f')],['ids','id'])||{});}})[_0x88b0('0x2c')](respondWithResult(_0x5d91f0,null))[_0x88b0('0xaf')](handleError(_0x5d91f0,null));};exports[_0x88b0('0xbc')]=function(_0x2afadc,_0x1ab1c7,_0x652751){var _0x1c3922={'raw':![],'where':{}};var _0x4eb6ff={};var _0x4ed798={'count':0x0,'rows':[]};return db[_0x88b0('0x36')][_0x88b0('0xbd')]({'where':{'id':_0x2afadc[_0x88b0('0xb6')]['id']}})['then'](handleEntityNotFound(_0x1ab1c7,null))['then'](function(_0x47c784){if(_0x47c784){_0x4eb6ff[_0x88b0('0x3b')]=_['keys'](db['SmsMessage'][_0x88b0('0x37')]);_0x4eb6ff['query']=_[_0x88b0('0x70')](_0x2afadc['query']);_0x4eb6ff[_0x88b0('0x3e')]=_[_0x88b0('0x3f')](_0x4eb6ff['model'],_0x4eb6ff['query']);_0x1c3922[_0x88b0('0x40')]=_[_0x88b0('0x3f')](_0x4eb6ff[_0x88b0('0x3b')],qs[_0x88b0('0x9b')](_0x2afadc[_0x88b0('0x3d')][_0x88b0('0x9b')]));_0x1c3922[_0x88b0('0x40')]=_0x1c3922['attributes'][_0x88b0('0x59')]?_0x1c3922['attributes']:_0x4eb6ff[_0x88b0('0x3b')];if(!_0x2afadc[_0x88b0('0x3d')]['hasOwnProperty'](_0x88b0('0x42'))){_0x1c3922[_0x88b0('0x26')]=qs[_0x88b0('0x26')](_0x2afadc[_0x88b0('0x3d')][_0x88b0('0x26')]);_0x1c3922[_0x88b0('0x23')]=qs[_0x88b0('0x23')](_0x2afadc['query'][_0x88b0('0x23')]);}_0x1c3922[_0x88b0('0x43')]=qs[_0x88b0('0xbe')](_0x2afadc[_0x88b0('0x3d')][_0x88b0('0xbe')]);_0x1c3922[_0x88b0('0x74')]=qs[_0x88b0('0x3e')](_[_0x88b0('0xbf')](_0x2afadc['query'],_0x4eb6ff[_0x88b0('0x3e')]));_0x1c3922['where'][_0x88b0('0xad')]=_0x47c784['id'];if(_0x2afadc['query'][_0x88b0('0x81')]){_0x1c3922['where']=_[_0x88b0('0x9a')](_0x1c3922[_0x88b0('0x74')],{'$or':_[_0x88b0('0x3c')](_0x1c3922[_0x88b0('0x40')],function(_0x489673){var _0x4a07d9={};_0x4a07d9[_0x489673]={'$like':'%'+_0x2afadc[_0x88b0('0x3d')][_0x88b0('0x81')]+'%'};return _0x4a07d9;})});}if(_0x2afadc[_0x88b0('0x3d')][_0x88b0('0xc0')]){var _0x4276d=_0x2afadc[_0x88b0('0x3d')][_0x88b0('0xc0')]['split'](',');var _0x417144={};_0x417144[_0x4276d[0x0]]={'$gte':moment(_0x4276d[0x1])['format'](_0x88b0('0xc1'))};_0x1c3922['where']=_[_0x88b0('0x9a')](_0x1c3922['where'],_0x417144);}_0x1c3922=_['merge']({},_0x1c3922,_0x2afadc[_0x88b0('0xb3')]);return db[_0x88b0('0xb9')][_0x88b0('0x25')]({'where':_0x1c3922['where']})[_0x88b0('0x2c')](function(_0x39af8f){_0x4ed798[_0x88b0('0x25')]=_0x39af8f;if(_0x2afadc[_0x88b0('0x3d')][_0x88b0('0xb1')]){_0x1c3922['include']=[{'all':!![]}];}return db[_0x88b0('0xb9')][_0x88b0('0xc2')](_0x1c3922);})[_0x88b0('0x2c')](function(_0x4e842c){_0x4ed798[_0x88b0('0xae')]=_0x4e842c;return _0x4ed798;});}})['then'](respondWithFilteredResult(_0x1ab1c7,_0x1c3922))[_0x88b0('0xaf')](handleError(_0x1ab1c7,null));};exports[_0x88b0('0xc3')]=function(_0x27e8b,_0x1858a0,_0x1c5759){return db[_0x88b0('0x36')]['find']({'where':{'id':_0x27e8b['params']['id']}})[_0x88b0('0x2c')](handleEntityNotFound(_0x1858a0,null))['then'](function(_0x4dc221){if(_0x4dc221){return _0x4dc221[_0x88b0('0xc4')](_0x27e8b[_0x88b0('0x6f')][_0x88b0('0xba')],_[_0x88b0('0xbb')](_0x27e8b['body'],['ids','id'])||{})[_0x88b0('0xc5')](function(){return db[_0x88b0('0x68')][_0x88b0('0xc2')]({'attributes':['id','name',_0x88b0('0xc6')],'where':{'id':_0x27e8b[_0x88b0('0x6f')]['ids']}});})[_0x88b0('0x2c')](function(_0x28826d){socket[_0x88b0('0xc7')]('smsInteractionTags:save',{'id':Number(_0x27e8b[_0x88b0('0xb6')]['id']),'tags':_0x28826d||[]});return{'id':Number(_0x27e8b[_0x88b0('0xb6')]['id']),'tags':_0x28826d||[]};});}})[_0x88b0('0x2c')](respondWithResult(_0x1858a0,null))[_0x88b0('0xaf')](handleError(_0x1858a0,null));};exports[_0x88b0('0xc8')]=function(_0x100acc,_0x560bc0,_0x4182c8){return db[_0x88b0('0x36')][_0x88b0('0x5b')]({'where':{'id':_0x100acc[_0x88b0('0xb6')]['id']}})[_0x88b0('0x2c')](handleEntityNotFound(_0x560bc0,null))[_0x88b0('0x2c')](function(_0x20282d){if(_0x20282d){return _0x20282d['removeTags'](_0x100acc[_0x88b0('0x3d')][_0x88b0('0xba')]);}})['then'](respondWithStatusCode(_0x560bc0,null))[_0x88b0('0xaf')](handleError(_0x560bc0,null));};exports['download']=function(_0x41fb6b,_0x15983b){var _0x43295c=moment()[_0x88b0('0xc9')]()[_0x88b0('0x98')]();var _0x2d1a09=path[_0x88b0('0xca')](config[_0x88b0('0xcb')],_0x88b0('0xcc'),_0x88b0('0xcd'),'tmp');var _0x2eb0dc=path[_0x88b0('0xca')](config[_0x88b0('0xcb')],_0x88b0('0xcc'),_0x88b0('0xcd'),'attachments');var _0x540960=path['join'](_0x2d1a09,_0x43295c);var _0x6fd990=util[_0x88b0('0xce')](_0x88b0('0xcf'),_0x41fb6b['params']['id'],_0x43295c);var _0xf7d4ea=path['join'](_0x2d1a09,_0x6fd990);var _0x2f0c48=[];_0x2f0c48[_0x88b0('0xd0')]({'model':db[_0x88b0('0x6b')],'as':_0x88b0('0x6b'),'attributes':['id','fullname'],'raw':!![]});_0x2f0c48[_0x88b0('0xd0')]({'model':db[_0x88b0('0xd1')],'as':_0x88b0('0x60'),'attributes':['id',_0x88b0('0xd2'),_0x88b0('0xd3')],'raw':!![]});var _0x11657c=[{'model':db[_0x88b0('0xb9')],'as':'Messages','attributes':['id',_0x88b0('0x6f'),_0x88b0('0x77'),_0x88b0('0xd4'),_0x88b0('0xd5'),'read'],'include':_0x2f0c48}];_0x11657c[_0x88b0('0xd0')]({'model':db[_0x88b0('0xd6')],'as':_0x88b0('0xd7'),'attributes':['id',_0x88b0('0x30')]});_0x11657c['push']({'model':db['User'],'as':_0x88b0('0xd8'),'attributes':['id',_0x88b0('0x31')]});return db[_0x88b0('0x36')]['find']({'where':{'id':_0x41fb6b[_0x88b0('0xb6')]['id']},'include':_0x11657c})[_0x88b0('0x2c')](handleEntityNotFound(_0x15983b,null))[_0x88b0('0x2c')](function(_0x830f7a){if(_0x830f7a){var _0x20ffb6=_0x830f7a[_0x88b0('0xd9')]({'plain':!![]});fs[_0x88b0('0xda')](_0x540960);var _0x10046e={'channel':'Sms','account':_0x20ffb6['Account'][_0x88b0('0x30')],'agent':_0x20ffb6[_0x88b0('0xd8')]?_0x20ffb6[_0x88b0('0xd8')]['fullname']:_0x88b0('0xdb'),'createdAt':moment(_0x20ffb6['createdAt'])[_0x88b0('0xce')](_0x88b0('0xc1'))[_0x88b0('0x98')](),'closedAt':_0x20ffb6[_0x88b0('0xdc')]?moment(_0x20ffb6[_0x88b0('0xdd')])[_0x88b0('0xce')]('YYYY-MM-DD\x20HH:mm:ss')[_0x88b0('0x98')]():'','disposition':_0x20ffb6['disposition'],'messages':_(_0x20ffb6[_0x88b0('0xde')])[_0x88b0('0x81')]({'secret':![]})[_0x88b0('0x3c')](function(_0x34c7bb){return{'date':moment(_0x34c7bb[_0x88b0('0x77')])['format'](_0x88b0('0xc1'))[_0x88b0('0x98')](),'sender':_0x34c7bb[_0x88b0('0xd4')]===_0x88b0('0xdf')?_0x34c7bb[_0x88b0('0x6b')]?_0x34c7bb['User']['fullname']:_0x88b0('0xe0'):_0x34c7bb[_0x88b0('0x60')][_0x88b0('0xd2')]+(_0x34c7bb[_0x88b0('0x60')][_0x88b0('0xd3')]?'\x20'+_0x34c7bb['Contact'][_0x88b0('0xd3')]:''),'body':_0x34c7bb['body'],'direction':_0x34c7bb[_0x88b0('0xd4')]===_0x88b0('0xdf')?'A':'C','secret':_0x34c7bb[_0x88b0('0xd5')],'read':_0x34c7bb[_0x88b0('0x7d')]};})[_0x88b0('0x5d')]()};return ejs[_0x88b0('0xe1')](path['join'](config[_0x88b0('0xcb')],'server',_0x88b0('0xe2'),'downloadInteraction.ejs'),{'interaction':_0x10046e})[_0x88b0('0x2c')](function(_0x32dd47){var _0x345c37=path[_0x88b0('0xca')](_0x540960,_0x88b0('0xe3')+_0x20ffb6['id']+'-'+_0x43295c+_0x88b0('0xe4'));var _0x3c656e={'path':_0x345c37,'channel':_0x88b0('0xe5'),'interactionId':_0x20ffb6['id']};return pdf[_0x88b0('0xe6')](_0x32dd47,_0x3c656e);})[_0x88b0('0x2c')](function(){return new BPromise(function(_0x43eff9,_0x36ad34){zipdir(_0x540960,{'saveTo':_0xf7d4ea},function(_0x59c26c,_0x5c9420){if(_0x59c26c)return _0x36ad34(_0x59c26c);return _0x43eff9(_0x5c9420);});})[_0x88b0('0x2c')](function(){return new BPromise(function(_0x4eeb05,_0x5c6f53){rimraf(_0x540960,function(_0x346386){if(_0x346386)_0x5c6f53(_0x346386);return _0x4eeb05();});});})[_0x88b0('0x2c')](function(){return _0x15983b[_0x88b0('0xe7')](_0xf7d4ea,_0x6fd990,function(_0x41b327){if(_0x41b327){console[_0x88b0('0xe8')]('err',_0x41b327);}else{fs[_0x88b0('0xe9')](_0xf7d4ea);}});});});}else{return _0x15983b[_0x88b0('0x20')](0xc8);}})['catch'](handleError(_0x15983b,null));};
\ No newline at end of file
+var _0x2b2d=['localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','fullname','Tags','TagIds','split','forEach','catch','SmsInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','users','left_join','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','start','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','fields','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','push','all','rows','show','params','includeAll','include','merge','options','create','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','nolimit','SmsInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','emit','smsInteractionTags:save','removeTags','download','unix','root','server','tmp','join','attachments','transcript-%d-%s.zip','User','CmContact','firstName','Messages','createdAt','direction','secret','Account','get','mkdirSync','Sms','Owner','N.A.','closed','closedAt','lastName','out','.pdf','log','err','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x56a06f,_0x183813){var _0x3309ac=function(_0x562fb0){while(--_0x562fb0){_0x56a06f['push'](_0x56a06f['shift']());}};_0x3309ac(++_0x183813);}(_0x2b2d,0x1ad));var _0xd2b2=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0x2b2d[_0x2a6d45];return _0x295253;};'use strict';var emlformat=require(_0xd2b2('0x0'));var rimraf=require(_0xd2b2('0x1'));var zipdir=require(_0xd2b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd2b2('0x3'));var moment=require(_0xd2b2('0x4'));var BPromise=require(_0xd2b2('0x5'));var Mustache=require(_0xd2b2('0x6'));var util=require(_0xd2b2('0x7'));var path=require(_0xd2b2('0x8'));var sox=require(_0xd2b2('0x9'));var csv=require('to-csv');var ejs=require(_0xd2b2('0xa'));var fs=require('fs');var fs_extra=require(_0xd2b2('0xb'));var _=require(_0xd2b2('0xc'));var squel=require(_0xd2b2('0xd'));var crypto=require('crypto');var jsforce=require(_0xd2b2('0xe'));var deskjs=require(_0xd2b2('0xf'));var toCsv=require(_0xd2b2('0x10'));var querystring=require(_0xd2b2('0x11'));var Papa=require(_0xd2b2('0x12'));var Redis=require(_0xd2b2('0x13'));var authService=require(_0xd2b2('0x14'));var qs=require(_0xd2b2('0x15'));var as=require(_0xd2b2('0x16'));var pdf=require(_0xd2b2('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2b2('0x18'))(_0xd2b2('0x19'));var utils=require(_0xd2b2('0x1a'));var config=require(_0xd2b2('0x1b'));var licenseUtil=require(_0xd2b2('0x1c'));var db=require(_0xd2b2('0x1d'))['db'];config['redis']=_['defaults'](config[_0xd2b2('0x1e')],{'host':_0xd2b2('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd2b2('0x20'))[_0xd2b2('0x21')](socket);function respondWithStatusCode(_0x40ac84,_0x5a2ed4){_0x5a2ed4=_0x5a2ed4||0xcc;return function(_0xae2556){if(_0xae2556){return _0x40ac84[_0xd2b2('0x22')](_0x5a2ed4);}return _0x40ac84[_0xd2b2('0x23')](_0x5a2ed4)[_0xd2b2('0x24')]();};}function respondWithResult(_0x33a7c9,_0x4c13fd){_0x4c13fd=_0x4c13fd||0xc8;return function(_0x26a0e0){if(_0x26a0e0){return _0x33a7c9['status'](_0x4c13fd)[_0xd2b2('0x25')](_0x26a0e0);}};}function respondWithFilteredResult(_0x28e3ef,_0x5037c7){return function(_0x11d708){if(_0x11d708){var _0x1443a4=typeof _0x5037c7[_0xd2b2('0x26')]===_0xd2b2('0x27')&&typeof _0x5037c7[_0xd2b2('0x28')]===_0xd2b2('0x27');var _0x5d2a92=_0x11d708['count'];var _0x59668b=_0x1443a4?0x0:_0x5037c7[_0xd2b2('0x26')];var _0x253ca9=_0x1443a4?_0x11d708[_0xd2b2('0x29')]:_0x5037c7[_0xd2b2('0x26')]+_0x5037c7[_0xd2b2('0x28')];var _0x41067b;if(_0x253ca9>=_0x5d2a92){_0x253ca9=_0x5d2a92;_0x41067b=0xc8;}else{_0x41067b=0xce;}_0x28e3ef[_0xd2b2('0x23')](_0x41067b);return _0x28e3ef['set'](_0xd2b2('0x2a'),_0x59668b+'-'+_0x253ca9+'/'+_0x5d2a92)['json'](_0x11d708);}return null;};}function patchUpdates(_0x4c355d){return function(_0x47b1e0){try{jsonpatch[_0xd2b2('0x2b')](_0x47b1e0,_0x4c355d,!![]);}catch(_0xe2fa54){return BPromise[_0xd2b2('0x2c')](_0xe2fa54);}return _0x47b1e0[_0xd2b2('0x2d')]();};}function saveUpdates(_0xd12285,_0x4f0a65){return function(_0x2c4a38){if(_0x2c4a38){return _0x2c4a38[_0xd2b2('0x2e')](_0xd12285)['then'](function(_0x2bc396){return _0x2bc396;});}return null;};}function removeEntity(_0x4cee18,_0x39f32d){return function(_0x192894){if(_0x192894){return _0x192894[_0xd2b2('0x2f')]()[_0xd2b2('0x30')](function(){_0x4cee18['status'](0xcc)[_0xd2b2('0x24')]();});}};}function handleEntityNotFound(_0x356870,_0x318b1a){return function(_0x38e42b){if(!_0x38e42b){_0x356870['sendStatus'](0x194);}return _0x38e42b;};}function handleError(_0x4f34b1,_0x5a8be2){_0x5a8be2=_0x5a8be2||0x1f4;return function(_0x387115){logger[_0xd2b2('0x31')](_0x387115[_0xd2b2('0x32')]);if(_0x387115[_0xd2b2('0x33')]){delete _0x387115[_0xd2b2('0x33')];}_0x4f34b1['status'](_0x5a8be2)[_0xd2b2('0x34')](_0x387115);};}function getInteractionUsers(_0x304fbf,_0x4e1872){return new BPromise(function(_0x338506,_0x38b89a){try{if(_0x4e1872[_0x304fbf['id']]){_0x304fbf['Users']=_[_0xd2b2('0x35')](_0x4e1872[_0x304fbf['id']],function(_0x2c3193){return{'id':_0x2c3193['id'],'fullname':_0x2c3193[_0xd2b2('0x36')]};});}}catch(_0x5abf8f){_0x38b89a(_0x5abf8f);}_0x338506(_0x304fbf);});}function getInteractionTags(_0x48bd90,_0x38b7fd){return new BPromise(function(_0x140ad9,_0x243b90){try{if(_0x48bd90['TagIds']){_0x48bd90[_0xd2b2('0x37')]=[];_0x48bd90[_0xd2b2('0x38')][_0xd2b2('0x39')](',')[_0xd2b2('0x3a')](function(_0x54b22f){_0x48bd90['Tags']['push'](_0x38b7fd[_0x54b22f]);});}delete _0x48bd90[_0xd2b2('0x38')];}catch(_0x4e267a){_0x243b90(_0x4e267a);}_0x140ad9(_0x48bd90);});}function updateSmsInteraction(_0xa8b410,_0x364254,_0x40253a){return new BPromise(function(_0x518667,_0x5cdb8b){return getInteractionUsers(_0xa8b410,_0x40253a)[_0xd2b2('0x30')](function(_0x78d1f0){return getInteractionTags(_0x78d1f0,_0x364254);})[_0xd2b2('0x30')](function(_0x22611e){_0x518667(_0x22611e);})[_0xd2b2('0x3b')](function(_0x219d4b){_0x5cdb8b(_0x219d4b);});});}exports['index']=function(_0x240eaa,_0x11d2fa){var _0x51ef67={},_0x385f77={},_0x3a446f={'count':0x0,'rows':[]};var _0x73fdea=_[_0xd2b2('0x35')](db[_0xd2b2('0x3c')][_0xd2b2('0x3d')],function(_0x1f34b3){return{'name':_0x1f34b3['fieldName'],'type':_0x1f34b3[_0xd2b2('0x3e')][_0xd2b2('0x3f')]};});_0x385f77[_0xd2b2('0x40')]=_['map'](_0x73fdea,'name');_0x385f77[_0xd2b2('0x41')]=_[_0xd2b2('0x42')](_0x240eaa['query']);_0x385f77[_0xd2b2('0x43')]=_[_0xd2b2('0x44')](_0x385f77[_0xd2b2('0x40')],_0x385f77[_0xd2b2('0x41')]);_0x51ef67[_0xd2b2('0x45')]=_[_0xd2b2('0x44')](_0x385f77[_0xd2b2('0x40')],qs['fields'](_0x240eaa[_0xd2b2('0x41')]['fields']));_0x51ef67[_0xd2b2('0x45')]=_0x51ef67[_0xd2b2('0x45')]['length']?_0x51ef67[_0xd2b2('0x45')]:_0x385f77[_0xd2b2('0x40')];if(!_0x240eaa[_0xd2b2('0x41')]['hasOwnProperty']('nolimit')){_0x51ef67['limit']=qs[_0xd2b2('0x28')](_0x240eaa[_0xd2b2('0x41')][_0xd2b2('0x28')]);_0x51ef67['offset']=qs['offset'](_0x240eaa[_0xd2b2('0x41')][_0xd2b2('0x26')]);}_0x51ef67[_0xd2b2('0x46')]=qs[_0xd2b2('0x47')](_0x240eaa[_0xd2b2('0x41')]['sort']);_0x51ef67[_0xd2b2('0x48')]=qs[_0xd2b2('0x43')](_[_0xd2b2('0x49')](_0x240eaa[_0xd2b2('0x41')],_0x385f77[_0xd2b2('0x43')]),_0x73fdea);var _0x53c60b=[];var _0x4c5584=squel[_0xd2b2('0x4a')]()[_0xd2b2('0x4b')]('id')[_0xd2b2('0x4b')](_0xd2b2('0x33'))[_0xd2b2('0x4b')](_0xd2b2('0x4c'))[_0xd2b2('0x4d')](_0xd2b2('0x4e'));var _0x1db9d1=squel[_0xd2b2('0x4a')]()['field'](_0xd2b2('0x4f'))[_0xd2b2('0x4b')](_0xd2b2('0x50'))[_0xd2b2('0x4b')](_0xd2b2('0x51'))['from'](_0xd2b2('0x52'),'ui')['left_join'](_0xd2b2('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x10186e=squel[_0xd2b2('0x4a')]()[_0xd2b2('0x4d')]('sms_interactions','i')[_0xd2b2('0x54')](_0xd2b2('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd2b2('0x54')]('users','o',_0xd2b2('0x56'))[_0xd2b2('0x54')](_0xd2b2('0x57'),'a',_0xd2b2('0x58'))[_0xd2b2('0x54')](_0xd2b2('0x59'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xd2b2('0x54')](_0xd2b2('0x5a'),'it',_0xd2b2('0x5b'))[_0xd2b2('0x54')]('tools_tags','t',_0xd2b2('0x5c'));var _0x5b2833=squel[_0xd2b2('0x5d')]();var _0x449e1b=[];var _0xac7e1a=squel[_0xd2b2('0x5d')]();var _0x2561b7;if(_0x240eaa[_0xd2b2('0x41')]['search']){_0x2561b7=as['parseSearch'](_0x240eaa[_0xd2b2('0x41')]['search']);var _0x1cae0a=_0x2561b7[_0xd2b2('0x5e')];for(var _0xf96980=0x0;_0xf96980<_0x2561b7[_0xd2b2('0x5f')][_0xd2b2('0x60')];_0xf96980++){var _0x3140a0=_0x2561b7['conditions'][_0xf96980];var _0x447e5f='i';var _0x46a2ac=_[_0xd2b2('0x61')](_0x73fdea,[_0xd2b2('0x33'),_0x3140a0[_0xd2b2('0x4b')]]);if(!_0x46a2ac){switch(_0x3140a0[_0xd2b2('0x4b')]){case _0xd2b2('0x62'):if(_0x3140a0[_0xd2b2('0x63')]==0x1){_0x10186e[_0xd2b2('0x64')]('`'+_0x3140a0[_0xd2b2('0x4b')]+_0xd2b2('0x65'));}else{_0x10186e['having']('`'+_0x3140a0['field']+_0xd2b2('0x66'));}break;case _0xd2b2('0x67'):if(_0x3140a0['operator']===_0xd2b2('0x68')){if(_0x3140a0[_0xd2b2('0x63')][_0xd2b2('0x39')]('\x20')[_0xd2b2('0x60')]>0x1){_0x5b2833[_0x1cae0a](_0xd2b2('0x69'),qs['getFullTextValue'](_0x3140a0[_0xd2b2('0x63')]),null);}else{var _0xf551ba='%'+_0x3140a0[_0xd2b2('0x63')]+'%';_0x5b2833[_0x1cae0a](_0xd2b2('0x6a'),_0xf551ba,_0xf551ba,_0xf551ba);}}else{_0x46a2ac=_[_0xd2b2('0x61')](_0x73fdea,['name','ContactId']);_0x3140a0[_0xd2b2('0x4b')]='ContactId';_0x359466=as[_0xd2b2('0x6b')](_0x447e5f,_0x46a2ac['type'],_0x3140a0);_0x5b2833[_0x1cae0a](_0x359466['text'],_0x359466[_0xd2b2('0x63')][_0xd2b2('0x6c')],_0x359466[_0xd2b2('0x63')]['end']);}break;case _0xd2b2('0x6d'):var _0x3c8de0=_0x3140a0[_0xd2b2('0x63')][_0xd2b2('0x39')](',')[_0xd2b2('0x35')](function(_0x29c160){return Number(_0x29c160);});_0x3c8de0[_0xd2b2('0x3a')](function(_0x5a1ef7){_0xac7e1a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5a1ef7+',%');});_0x449e1b=_[_0xd2b2('0x6e')](_0x449e1b,_0x3c8de0);break;case'User':if(_0x3140a0['operator']===_0xd2b2('0x68')){_0x5b2833[_0x1cae0a](_0xd2b2('0x6f'),'%'+_0x3140a0[_0xd2b2('0x63')]+'%',null);}else{_0x46a2ac=_[_0xd2b2('0x61')](_0x73fdea,[_0xd2b2('0x33'),_0xd2b2('0x70')]);_0x3140a0[_0xd2b2('0x4b')]='UserId';_0x359466=as[_0xd2b2('0x6b')](_0x447e5f,_0x46a2ac['type'],_0x3140a0);_0x5b2833[_0x1cae0a](_0x359466[_0xd2b2('0x71')],_0x359466[_0xd2b2('0x63')][_0xd2b2('0x6c')],_0x359466[_0xd2b2('0x63')][_0xd2b2('0x24')]);}break;case _0xd2b2('0x72'):_0x359466=as[_0xd2b2('0x6b')]('me',null,_0x3140a0);_0x5b2833[_0x1cae0a](_0x359466[_0xd2b2('0x71')],_0x359466[_0xd2b2('0x63')][_0xd2b2('0x6c')],_0x359466['value'][_0xd2b2('0x24')]);break;}}else{var _0x359466=as['buildExpression'](_0x447e5f,_0x46a2ac[_0xd2b2('0x3e')],_0x3140a0);_0x5b2833[_0x1cae0a](_0x359466[_0xd2b2('0x71')],_0x359466[_0xd2b2('0x63')]['start'],_0x359466['value'][_0xd2b2('0x24')]);}}}else{var _0x213f3b=_(_0x240eaa[_0xd2b2('0x41')])[_0xd2b2('0x42')]()[_0xd2b2('0x35')](function(_0x5af80e){return _['some'](_0x73fdea,[_0xd2b2('0x33'),_0x5af80e])?_0x5af80e:undefined;})[_0xd2b2('0x73')]()['value']();if(!_[_0xd2b2('0x74')](_0x213f3b)){_0x213f3b[_0xd2b2('0x3a')](function(_0x11d203){if(_0x11d203===_0xd2b2('0x75')){_0x10186e[_0xd2b2('0x48')](_0xd2b2('0x76'),[][_0xd2b2('0x77')](_0x240eaa[_0xd2b2('0x41')][_0x11d203]));}else if(_0x11d203==='createdAt'){var _0x39dc5a=JSON[_0xd2b2('0x78')](_0x240eaa['query'][_0x11d203])['$gte'];var _0x47acf2=JSON['parse'](_0x240eaa['query'][_0x11d203])['$lte'];_0x10186e[_0xd2b2('0x48')](_0xd2b2('0x79'),_0x39dc5a,_0x47acf2);}else{if(_0x240eaa['query'][_0x11d203]===_0xd2b2('0x7a')){_0x10186e['where']('i.'+_0x11d203+_0xd2b2('0x7b'));}else{_0x10186e[_0xd2b2('0x48')]('i.'+_0x11d203+_0xd2b2('0x7c'),_0x240eaa['query'][_0x11d203]);}}});}if(_0x240eaa[_0xd2b2('0x41')][_0xd2b2('0x7d')]){if(_0x240eaa[_0xd2b2('0x41')][_0xd2b2('0x7d')]==0x1){_0x10186e[_0xd2b2('0x64')]('`unreadMessages`\x20=\x200');}else{_0x10186e[_0xd2b2('0x64')](_0xd2b2('0x7e'));}}if(_0x240eaa[_0xd2b2('0x41')][_0xd2b2('0x7f')]){_0x449e1b=_['isArray'](_0x240eaa[_0xd2b2('0x41')][_0xd2b2('0x7f')])?_0x240eaa[_0xd2b2('0x41')][_0xd2b2('0x7f')]:new Array(_0x240eaa[_0xd2b2('0x41')][_0xd2b2('0x7f')]);_0x449e1b['forEach'](function(_0x31e094){_0xac7e1a['or'](_0xd2b2('0x80'),'%,'+_0x31e094+',%');});}if(_0x240eaa[_0xd2b2('0x41')][_0xd2b2('0x81')]){var _0xba18da=_0x240eaa[_0xd2b2('0x41')]['filter']['replace']('\x5c','\x5c\x5c')[_0xd2b2('0x82')](/'/g,'\x27\x27');if(qs[_0xd2b2('0x83')](_0xba18da)){_0x5b2833['or'](_0xd2b2('0x84'),_0xba18da+'%')['or'](_0xd2b2('0x85'),_0xba18da+'%');}else{_0x5b2833['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd2b2('0x86')](_0xba18da))['or'](_0xd2b2('0x87'),_0xba18da+'%');}}}_0x10186e[_0xd2b2('0x48')](_0x5b2833);_0x10186e[_0xd2b2('0x88')]('i.id');var _0x5c2309={'type':db[_0xd2b2('0x89')][_0xd2b2('0x8a')][_0xd2b2('0x8b')],'raw':!![]};var _0x4be335=_0x10186e[_0xd2b2('0x8c')]();_0x4be335['field']('i.id');_0x4be335[_0xd2b2('0x4b')](_0xd2b2('0x8d'),_0xd2b2('0x62'));if(_0x51ef67[_0xd2b2('0x46')]){_0x51ef67['order'][_0xd2b2('0x3a')](function(_0x416cf5){var _0x270daf=_0x416cf5[0x0]===_0xd2b2('0x8e')?_0x416cf5[0x0]:'i.'+_0x416cf5[0x0];_0x10186e['order'](_0x270daf,_0x416cf5[0x1]===_0xd2b2('0x8f')?![]:!![]);});}if(!_[_0xd2b2('0x74')](_0x449e1b)){_0x10186e[_0xd2b2('0x64')](_0xac7e1a);_0x4be335[_0xd2b2('0x48')](_0xd2b2('0x90'),_0x449e1b);}BPromise['resolve']()[_0xd2b2('0x30')](function(){if(!_0x2561b7){if(_0x240eaa[_0xd2b2('0x41')]['SmsAccountId'])return;_0x4be335[_0xd2b2('0x48')](_0xd2b2('0x91'));_0x10186e['where'](_0xd2b2('0x91'));return;}if(_0x240eaa['user'][_0xd2b2('0x92')]!==_0xd2b2('0x93'))return;return _0x240eaa['user'][_0xd2b2('0x94')]({'attributes':['id'],'raw':!![]})[_0xd2b2('0x30')](function(_0x2e41e4){if(_[_0xd2b2('0x74')](_0x2e41e4)){_0x4be335[_0xd2b2('0x48')](_0xd2b2('0x95'));_0x10186e['where']('i.SmsAccountId\x20IS\x20NULL');}else{_0x4be335[_0xd2b2('0x48')](_0xd2b2('0x76'),_['map'](_0x2e41e4,'id'));_0x10186e[_0xd2b2('0x48')](_0xd2b2('0x76'),_[_0xd2b2('0x35')](_0x2e41e4,'id'));}});})[_0xd2b2('0x30')](function(){if(_0x240eaa['user'][_0xd2b2('0x92')]===_0xd2b2('0x93')&&!_0x2561b7&&!_0x240eaa['query'][_0xd2b2('0x75')])return[];return db[_0xd2b2('0x96')][_0xd2b2('0x41')](_0x4be335[_0xd2b2('0x97')](),_0x5c2309);})[_0xd2b2('0x30')](function(_0x419875){_0x3a446f[_0xd2b2('0x29')]=_0x419875[_0xd2b2('0x60')];if(_0x3a446f[_0xd2b2('0x29')]===0x0)return[];return db[_0xd2b2('0x96')][_0xd2b2('0x41')](_0x4c5584['toString'](),_0x5c2309)[_0xd2b2('0x30')](function(_0x21082a){_0x53c60b=_[_0xd2b2('0x98')](_0x21082a,'id');_0x5c2309=_['merge'](_0x5c2309,{'model':db[_0xd2b2('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x240eaa[_0xd2b2('0x41')][_0xd2b2('0x99')]){_0x51ef67['attributes'][_0xd2b2('0x3a')](function(_0x1b6a8a){_0x10186e[_0xd2b2('0x4b')]('i.'+_0x1b6a8a);});}else{_0x10186e[_0xd2b2('0x4b')](_0xd2b2('0x8d'),_0xd2b2('0x62'));_0x10186e[_0xd2b2('0x4b')](_0xd2b2('0x9a'),'Account.key');_0x10186e['field'](_0xd2b2('0x9b'),_0xd2b2('0x9c'));_0x10186e[_0xd2b2('0x4b')](_0xd2b2('0x9d'),_0xd2b2('0x8e'));_0x10186e[_0xd2b2('0x4b')](_0xd2b2('0x9e'));_0x10186e['field'](_0xd2b2('0x9f'),_0xd2b2('0xa0'));_0x10186e[_0xd2b2('0x4b')](_0xd2b2('0xa1'),_0xd2b2('0xa2'));_0x10186e[_0xd2b2('0x4b')](_0xd2b2('0xa3'),_0xd2b2('0xa4'));_0x10186e[_0xd2b2('0x4b')](_0xd2b2('0xa5'),'Contact.phone');_0x10186e['field']('c.mobile',_0xd2b2('0xa6'));_0x10186e[_0xd2b2('0x4b')]('c.fax',_0xd2b2('0xa7'));_0x10186e[_0xd2b2('0x4b')](_0xd2b2('0xa8'),_0xd2b2('0xa9'));_0x10186e[_0xd2b2('0x4b')](_0xd2b2('0xaa'),_0xd2b2('0xab'));_0x10186e[_0xd2b2('0x4b')](_0xd2b2('0xac'),_0xd2b2('0x38'));}if(_0x51ef67['limit'])_0x10186e[_0xd2b2('0x28')](_0x51ef67[_0xd2b2('0x28')]);if(_0x51ef67[_0xd2b2('0x26')])_0x10186e[_0xd2b2('0x26')](_0x51ef67['offset']);return db[_0xd2b2('0x96')]['query'](_0x10186e[_0xd2b2('0x97')](),_0x5c2309);})[_0xd2b2('0x30')](function(_0x2d315c){if(_0x2d315c[_0xd2b2('0x60')]>0x0)_0x1db9d1[_0xd2b2('0x48')](_0xd2b2('0xad'),_[_0xd2b2('0x35')](_0x2d315c,'id'));return db[_0xd2b2('0x96')][_0xd2b2('0x41')](_0x1db9d1[_0xd2b2('0x97')](),_0x5c2309)[_0xd2b2('0x30')](function(_0x4112b4){var _0x3dd7ca=_[_0xd2b2('0xae')](_0x4112b4,'SmsInteractionId');var _0xf0536e=[];_0x2d315c[_0xd2b2('0x3a')](function(_0x5525bd){_0xf0536e[_0xd2b2('0xaf')](updateSmsInteraction(_0x5525bd,_0x53c60b,_0x3dd7ca));});return BPromise[_0xd2b2('0xb0')](_0xf0536e);});});})['then'](function(_0x2d5481){_0x3a446f[_0xd2b2('0xb1')]=_0x2d5481;return _0x3a446f;})['then'](respondWithFilteredResult(_0x11d2fa,_0x51ef67))[_0xd2b2('0x3b')](handleError(_0x11d2fa,null));};exports[_0xd2b2('0xb2')]=function(_0x1ecd52,_0x48068b){var _0x48715a={'raw':![],'where':{'id':_0x1ecd52[_0xd2b2('0xb3')]['id']}},_0x1b9071={};_0x1b9071['model']=_[_0xd2b2('0x42')](db[_0xd2b2('0x3c')][_0xd2b2('0x3d')]);_0x1b9071[_0xd2b2('0x41')]=_[_0xd2b2('0x42')](_0x1ecd52['query']);_0x1b9071[_0xd2b2('0x43')]=_[_0xd2b2('0x44')](_0x1b9071['model'],_0x1b9071[_0xd2b2('0x41')]);_0x48715a[_0xd2b2('0x45')]=_['intersection'](_0x1b9071[_0xd2b2('0x40')],qs['fields'](_0x1ecd52['query'][_0xd2b2('0x99')]));_0x48715a['attributes']=_0x48715a['attributes'][_0xd2b2('0x60')]?_0x48715a['attributes']:_0x1b9071[_0xd2b2('0x40')];if(_0x1ecd52[_0xd2b2('0x41')][_0xd2b2('0xb4')]){_0x48715a[_0xd2b2('0xb5')]=[{'all':!![]}];}_0x48715a=_[_0xd2b2('0xb6')]({},_0x48715a,_0x1ecd52[_0xd2b2('0xb7')]);return db['SmsInteraction'][_0xd2b2('0x61')](_0x48715a)[_0xd2b2('0x30')](handleEntityNotFound(_0x48068b,null))[_0xd2b2('0x30')](respondWithResult(_0x48068b,null))[_0xd2b2('0x3b')](handleError(_0x48068b,null));};exports[_0xd2b2('0xb8')]=function(_0x915fb3,_0x102d4b){return db[_0xd2b2('0x3c')]['create'](_0x915fb3[_0xd2b2('0x72')],{})[_0xd2b2('0x30')](respondWithResult(_0x102d4b,0xc9))[_0xd2b2('0x3b')](handleError(_0x102d4b,null));};exports[_0xd2b2('0x2e')]=function(_0x14d373,_0x4d84c0){if(_0x14d373[_0xd2b2('0x72')]['id']){delete _0x14d373[_0xd2b2('0x72')]['id'];}return db[_0xd2b2('0x3c')][_0xd2b2('0x61')]({'where':{'id':_0x14d373['params']['id']}})['then'](handleEntityNotFound(_0x4d84c0,null))[_0xd2b2('0x30')](saveUpdates(_0x14d373[_0xd2b2('0x72')],null))['then'](respondWithResult(_0x4d84c0,null))[_0xd2b2('0x3b')](handleError(_0x4d84c0,null));};exports[_0xd2b2('0x2f')]=function(_0x3e6cd0,_0x259b7b){return db[_0xd2b2('0x3c')][_0xd2b2('0x61')]({'where':{'id':_0x3e6cd0[_0xd2b2('0xb3')]['id']}})[_0xd2b2('0x30')](handleEntityNotFound(_0x259b7b,null))[_0xd2b2('0x30')](removeEntity(_0x259b7b,null))['catch'](handleError(_0x259b7b,null));};exports[_0xd2b2('0xb9')]=function(_0x59ca6a,_0x37d900){return db[_0xd2b2('0x3c')][_0xd2b2('0xb9')]()[_0xd2b2('0x30')](respondWithResult(_0x37d900,null))[_0xd2b2('0x3b')](handleError(_0x37d900,null));};exports['addMessage']=function(_0x4d46e6,_0x3c1a17,_0x362eb6){return db[_0xd2b2('0xba')][_0xd2b2('0x61')]({'where':{'id':_0x4d46e6[_0xd2b2('0xb3')]['id']}})['then'](handleEntityNotFound(_0x3c1a17,null))['then'](function(_0x5e83fb){if(_0x5e83fb){return _0x5e83fb[_0xd2b2('0xbb')](_0x4d46e6[_0xd2b2('0x72')][_0xd2b2('0xbc')],_[_0xd2b2('0xbd')](_0x4d46e6[_0xd2b2('0x72')],[_0xd2b2('0xbc'),'id'])||{});}})[_0xd2b2('0x30')](respondWithResult(_0x3c1a17,null))['catch'](handleError(_0x3c1a17,null));};exports[_0xd2b2('0xbe')]=function(_0x458f05,_0x339e20,_0x1fbae7){var _0x388e5e={'raw':![],'where':{}};var _0x260908={};var _0x4db086={'count':0x0,'rows':[]};return db[_0xd2b2('0x3c')][_0xd2b2('0xbf')]({'where':{'id':_0x458f05[_0xd2b2('0xb3')]['id']}})[_0xd2b2('0x30')](handleEntityNotFound(_0x339e20,null))[_0xd2b2('0x30')](function(_0x59a6e3){if(_0x59a6e3){_0x260908[_0xd2b2('0x40')]=_[_0xd2b2('0x42')](db[_0xd2b2('0xba')]['rawAttributes']);_0x260908[_0xd2b2('0x41')]=_[_0xd2b2('0x42')](_0x458f05[_0xd2b2('0x41')]);_0x260908[_0xd2b2('0x43')]=_['intersection'](_0x260908[_0xd2b2('0x40')],_0x260908['query']);_0x388e5e[_0xd2b2('0x45')]=_[_0xd2b2('0x44')](_0x260908[_0xd2b2('0x40')],qs[_0xd2b2('0x99')](_0x458f05['query'][_0xd2b2('0x99')]));_0x388e5e['attributes']=_0x388e5e['attributes'][_0xd2b2('0x60')]?_0x388e5e[_0xd2b2('0x45')]:_0x260908[_0xd2b2('0x40')];if(!_0x458f05[_0xd2b2('0x41')]['hasOwnProperty'](_0xd2b2('0xc0'))){_0x388e5e[_0xd2b2('0x28')]=qs['limit'](_0x458f05[_0xd2b2('0x41')][_0xd2b2('0x28')]);_0x388e5e['offset']=qs[_0xd2b2('0x26')](_0x458f05[_0xd2b2('0x41')][_0xd2b2('0x26')]);}_0x388e5e[_0xd2b2('0x46')]=qs[_0xd2b2('0x47')](_0x458f05[_0xd2b2('0x41')][_0xd2b2('0x47')]);_0x388e5e[_0xd2b2('0x48')]=qs['filters'](_[_0xd2b2('0x49')](_0x458f05[_0xd2b2('0x41')],_0x260908[_0xd2b2('0x43')]));_0x388e5e[_0xd2b2('0x48')][_0xd2b2('0xc1')]=_0x59a6e3['id'];if(_0x458f05[_0xd2b2('0x41')][_0xd2b2('0x81')]){_0x388e5e[_0xd2b2('0x48')]=_[_0xd2b2('0xb6')](_0x388e5e[_0xd2b2('0x48')],{'$or':_[_0xd2b2('0x35')](_0x388e5e[_0xd2b2('0x45')],function(_0x1352fd){var _0x42821f={};_0x42821f[_0x1352fd]={'$like':'%'+_0x458f05[_0xd2b2('0x41')][_0xd2b2('0x81')]+'%'};return _0x42821f;})});}if(_0x458f05[_0xd2b2('0x41')][_0xd2b2('0xc2')]){var _0x2680e8=_0x458f05['query'][_0xd2b2('0xc2')][_0xd2b2('0x39')](',');var _0x6c3db2={};_0x6c3db2[_0x2680e8[0x0]]={'$gte':moment(_0x2680e8[0x1])[_0xd2b2('0xc3')](_0xd2b2('0xc4'))};_0x388e5e[_0xd2b2('0x48')]=_[_0xd2b2('0xb6')](_0x388e5e[_0xd2b2('0x48')],_0x6c3db2);}_0x388e5e=_['merge']({},_0x388e5e,_0x458f05['options']);return db[_0xd2b2('0xba')]['count']({'where':_0x388e5e[_0xd2b2('0x48')]})[_0xd2b2('0x30')](function(_0x49d3de){_0x4db086['count']=_0x49d3de;if(_0x458f05['query'][_0xd2b2('0xb4')]){_0x388e5e[_0xd2b2('0xb5')]=[{'all':!![]}];}return db[_0xd2b2('0xba')][_0xd2b2('0xc5')](_0x388e5e);})[_0xd2b2('0x30')](function(_0x31b744){_0x4db086['rows']=_0x31b744;return _0x4db086;});}})[_0xd2b2('0x30')](respondWithFilteredResult(_0x339e20,_0x388e5e))[_0xd2b2('0x3b')](handleError(_0x339e20,null));};exports['addTags']=function(_0x231743,_0x174175,_0x20010d){return db[_0xd2b2('0x3c')][_0xd2b2('0x61')]({'where':{'id':_0x231743['params']['id']}})[_0xd2b2('0x30')](handleEntityNotFound(_0x174175,null))[_0xd2b2('0x30')](function(_0x3640ad){if(_0x3640ad){return _0x3640ad[_0xd2b2('0xc6')](_0x231743['body'][_0xd2b2('0xbc')],_[_0xd2b2('0xbd')](_0x231743[_0xd2b2('0x72')],['ids','id'])||{})['spread'](function(){return db[_0xd2b2('0x6d')][_0xd2b2('0xc5')]({'attributes':['id',_0xd2b2('0x33'),_0xd2b2('0x4c')],'where':{'id':_0x231743[_0xd2b2('0x72')][_0xd2b2('0xbc')]}});})['then'](function(_0x5dba58){socket[_0xd2b2('0xc7')](_0xd2b2('0xc8'),{'id':Number(_0x231743['params']['id']),'tags':_0x5dba58||[]});return{'id':Number(_0x231743[_0xd2b2('0xb3')]['id']),'tags':_0x5dba58||[]};});}})[_0xd2b2('0x30')](respondWithResult(_0x174175,null))['catch'](handleError(_0x174175,null));};exports['removeTags']=function(_0x49f2b4,_0x193402,_0x8c824f){return db[_0xd2b2('0x3c')][_0xd2b2('0x61')]({'where':{'id':_0x49f2b4[_0xd2b2('0xb3')]['id']}})[_0xd2b2('0x30')](handleEntityNotFound(_0x193402,null))[_0xd2b2('0x30')](function(_0x41dd4a){if(_0x41dd4a){return _0x41dd4a[_0xd2b2('0xc9')](_0x49f2b4[_0xd2b2('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x193402,null))[_0xd2b2('0x3b')](handleError(_0x193402,null));};exports[_0xd2b2('0xca')]=function(_0x473d16,_0x15d087){var _0x55933e=moment()[_0xd2b2('0xcb')]()[_0xd2b2('0x97')]();var _0x44113e=path['join'](config[_0xd2b2('0xcc')],_0xd2b2('0xcd'),'files',_0xd2b2('0xce'));var _0x484847=path[_0xd2b2('0xcf')](config[_0xd2b2('0xcc')],_0xd2b2('0xcd'),'files',_0xd2b2('0xd0'));var _0x552c4=path[_0xd2b2('0xcf')](_0x44113e,_0x55933e);var _0x1a7bf5=util[_0xd2b2('0xc3')](_0xd2b2('0xd1'),_0x473d16[_0xd2b2('0xb3')]['id'],_0x55933e);var _0x563192=path[_0xd2b2('0xcf')](_0x44113e,_0x1a7bf5);var _0x4afb83=[];_0x4afb83['push']({'model':db[_0xd2b2('0xd2')],'as':_0xd2b2('0xd2'),'attributes':['id',_0xd2b2('0x36')],'raw':!![]});_0x4afb83[_0xd2b2('0xaf')]({'model':db[_0xd2b2('0xd3')],'as':_0xd2b2('0x67'),'attributes':['id',_0xd2b2('0xd4'),'lastName'],'raw':!![]});var _0x51365e=[{'model':db[_0xd2b2('0xba')],'as':_0xd2b2('0xd5'),'attributes':['id',_0xd2b2('0x72'),_0xd2b2('0xd6'),_0xd2b2('0xd7'),_0xd2b2('0xd8'),_0xd2b2('0x7d')],'include':_0x4afb83}];_0x51365e['push']({'model':db['SmsAccount'],'as':_0xd2b2('0xd9'),'attributes':['id',_0xd2b2('0x33')]});_0x51365e[_0xd2b2('0xaf')]({'model':db['User'],'as':'Owner','attributes':['id',_0xd2b2('0x36')]});return db['SmsInteraction']['find']({'where':{'id':_0x473d16[_0xd2b2('0xb3')]['id']},'include':_0x51365e})[_0xd2b2('0x30')](handleEntityNotFound(_0x15d087,null))['then'](function(_0x53ef08){if(_0x53ef08){var _0x2531e1=_0x53ef08[_0xd2b2('0xda')]({'plain':!![]});fs[_0xd2b2('0xdb')](_0x552c4);var _0x5dfd3d={'channel':_0xd2b2('0xdc'),'account':_0x2531e1[_0xd2b2('0xd9')][_0xd2b2('0x33')],'agent':_0x2531e1[_0xd2b2('0xdd')]?_0x2531e1[_0xd2b2('0xdd')][_0xd2b2('0x36')]:_0xd2b2('0xde'),'createdAt':moment(_0x2531e1[_0xd2b2('0xd6')])[_0xd2b2('0xc3')](_0xd2b2('0xc4'))['toString'](),'closedAt':_0x2531e1[_0xd2b2('0xdf')]?moment(_0x2531e1[_0xd2b2('0xe0')])[_0xd2b2('0xc3')](_0xd2b2('0xc4'))['toString']():'','disposition':_0x2531e1['disposition'],'messages':_(_0x2531e1[_0xd2b2('0xd5')])['filter']({'secret':![]})['map'](function(_0x5c1375){return{'date':moment(_0x5c1375[_0xd2b2('0xd6')])[_0xd2b2('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd2b2('0x97')](),'sender':_0x5c1375[_0xd2b2('0xd7')]==='out'?_0x5c1375[_0xd2b2('0xd2')]?_0x5c1375[_0xd2b2('0xd2')][_0xd2b2('0x36')]:'System':_0x5c1375[_0xd2b2('0x67')]['firstName']+(_0x5c1375[_0xd2b2('0x67')][_0xd2b2('0xe1')]?'\x20'+_0x5c1375[_0xd2b2('0x67')][_0xd2b2('0xe1')]:''),'body':_0x5c1375['body'],'direction':_0x5c1375['direction']===_0xd2b2('0xe2')?'A':'C','secret':_0x5c1375[_0xd2b2('0xd8')],'read':_0x5c1375[_0xd2b2('0x7d')]};})['value']()};return ejs['renderFile'](path['join'](config[_0xd2b2('0xcc')],_0xd2b2('0xcd'),'views','downloadInteraction.ejs'),{'interaction':_0x5dfd3d})[_0xd2b2('0x30')](function(_0x585337){var _0x148867=path[_0xd2b2('0xcf')](_0x552c4,'transcript-'+_0x2531e1['id']+'-'+_0x55933e+_0xd2b2('0xe3'));var _0x31632f={'path':_0x148867,'channel':_0xd2b2('0xdc'),'interactionId':_0x2531e1['id']};return pdf['createPdfFromHTML'](_0x585337,_0x31632f);})[_0xd2b2('0x30')](function(){return new BPromise(function(_0x461d71,_0x582459){zipdir(_0x552c4,{'saveTo':_0x563192},function(_0x4a985f,_0x2481bb){if(_0x4a985f)return _0x582459(_0x4a985f);return _0x461d71(_0x2481bb);});})['then'](function(){return new BPromise(function(_0x53fa5b,_0x17c065){rimraf(_0x552c4,function(_0x29c75b){if(_0x29c75b)_0x17c065(_0x29c75b);return _0x53fa5b();});});})[_0xd2b2('0x30')](function(){return _0x15d087[_0xd2b2('0xca')](_0x563192,_0x1a7bf5,function(_0x1fed86){if(_0x1fed86){console[_0xd2b2('0xe4')](_0xd2b2('0xe5'),_0x1fed86);}else{fs['unlinkSync'](_0x563192);}});});});}else{return _0x15d087[_0xd2b2('0x22')](0xc8);}})[_0xd2b2('0x3b')](handleError(_0x15d087,null));};
\ No newline at end of file
index 47b4a3b..5cb9690 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x160f=['events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','findAll','then','emit','catch','hook','exports'];(function(_0x43c85a,_0x2c6c62){var _0x339ae2=function(_0x6173b5){while(--_0x6173b5){_0x43c85a['push'](_0x43c85a['shift']());}};_0x339ae2(++_0x2c6c62);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf160('0x0'));var SmsInteraction=require(_0xf160('0x1'))['db'][_0xf160('0x2')];var SmsMessage=require(_0xf160('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xf160('0x3')](0x0);var events={'afterCreate':_0xf160('0x4'),'afterUpdate':_0xf160('0x5'),'afterDestroy':_0xf160('0x6')};function emitEvent(_0x194331){return function(_0xfdbd72,_0x4a6f3d,_0x311d63){_0xfdbd72[_0xf160('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59440e){_0xfdbd72[_0xf160('0x8')]('Users',_0x59440e['map'](function(_0x496014){return{'id':_0x496014['id']};}));return SmsMessage[_0xf160('0x9')]({'where':{'SmsInteractionId':_0xfdbd72['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf160('0xa')](function(_0x393f70){_0xfdbd72[_0xf160('0x8')]('unreadMessages',_0x393f70['length']);SmsInteractionEvents[_0xf160('0xb')](_0x194331+':'+_0xfdbd72['id'],_0xfdbd72);SmsInteractionEvents[_0xf160('0xb')](_0x194331,_0xfdbd72);_0x311d63(null);})[_0xf160('0xc')](_0x311d63(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xf160('0xd')](e,emitEvent(event));}}module[_0xf160('0xe')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x3d04=['SmsInteraction','SmsMessage','setMaxListeners','save','update','Users','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3d04,0xbe));var _0x43d0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3d04[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x43d0('0x0'));var SmsInteraction=require(_0x43d0('0x1'))['db'][_0x43d0('0x2')];var SmsMessage=require(_0x43d0('0x1'))['db'][_0x43d0('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x43d0('0x4')](0x0);var events={'afterCreate':_0x43d0('0x5'),'afterUpdate':_0x43d0('0x6'),'afterDestroy':'remove'};function emitEvent(_0x2a4d4c){return function(_0x1a75d4,_0x746f5e,_0x617bf){_0x1a75d4['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x50919e){_0x1a75d4['setDataValue'](_0x43d0('0x7'),_0x50919e[_0x43d0('0x8')](function(_0x331421){return{'id':_0x331421['id']};}));return SmsMessage[_0x43d0('0x9')]({'where':{'SmsInteractionId':_0x1a75d4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x43d0('0xa')](function(_0x4d75d9){_0x1a75d4['setDataValue'](_0x43d0('0xb'),_0x4d75d9['length']);SmsInteractionEvents['emit'](_0x2a4d4c+':'+_0x1a75d4['id'],_0x1a75d4);SmsInteractionEvents[_0x43d0('0xc')](_0x2a4d4c,_0x1a75d4);_0x617bf(null);})[_0x43d0('0xd')](_0x617bf(null));};}for(var e in events){if(events[_0x43d0('0xe')](e)){var event=events[e];SmsInteraction[_0x43d0('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
index 8dba61d..b1cf547 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc756=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2f2c8e,_0x14b937){var _0x102460=function(_0x48605d){while(--_0x48605d){_0x2f2c8e['push'](_0x2f2c8e['shift']());}};_0x102460(++_0x14b937);}(_0xc756,0x159));var _0x6c75=function(_0x58e275,_0x3ef7e8){_0x58e275=_0x58e275-0x0;var _0x46ca5c=_0xc756[_0x58e275];return _0x46ca5c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x6c75('0x0'));var moment=require(_0x6c75('0x1'));var BPromise=require(_0x6c75('0x2'));var rp=require(_0x6c75('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c75('0x4'));var config=require(_0x6c75('0x5'));var attributes=require(_0x6c75('0x6'));module['exports']=function(_0x2a8fa2,_0x4e3f4e){return _0x2a8fa2[_0x6c75('0x7')](_0x6c75('0x8'),attributes,{'tableName':_0x6c75('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe2c90,_0x1c9055,_0x17f9c1){if(_0xe2c90[_0x6c75('0xa')](_0x6c75('0xb'))){_0xe2c90[_0x6c75('0xc')]=moment()[_0x6c75('0xd')](_0x6c75('0xe'));}_0x17f9c1(null,_0xe2c90);}}});};
\ No newline at end of file
+var _0xf5c8=['closed','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','sms_interactions','changed'];(function(_0x34bfb0,_0xa52bdd){var _0x10aef3=function(_0x10ea47){while(--_0x10ea47){_0x34bfb0['push'](_0x34bfb0['shift']());}};_0x10aef3(++_0xa52bdd);}(_0xf5c8,0x100));var _0x8f5c=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0xf5c8[_0x5a636f];return _0x6a8cfb;};'use strict';var _=require(_0x8f5c('0x0'));var util=require(_0x8f5c('0x1'));var logger=require(_0x8f5c('0x2'))(_0x8f5c('0x3'));var moment=require(_0x8f5c('0x4'));var BPromise=require(_0x8f5c('0x5'));var rp=require(_0x8f5c('0x6'));var fs=require('fs');var path=require(_0x8f5c('0x7'));var rimraf=require(_0x8f5c('0x8'));var config=require(_0x8f5c('0x9'));var attributes=require(_0x8f5c('0xa'));module[_0x8f5c('0xb')]=function(_0x54559a,_0x5e01db){return _0x54559a['define']('SmsInteraction',attributes,{'tableName':_0x8f5c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x256e5f,_0x113e08,_0x11aa7e){if(_0x256e5f[_0x8f5c('0xd')](_0x8f5c('0xe'))){_0x256e5f['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x11aa7e(null,_0x256e5f);}}});};
\ No newline at end of file
index 742e707..8d2f496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x769b=['where','addTags','body','omit','spread','AddTags','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateSmsInteraction','update','options','raw','attributes','limit','catch','AddTagsToSmsInteraction','SmsInteraction','find'];(function(_0x55f2a0,_0x4c44b1){var _0x5dde58=function(_0x412a63){while(--_0x412a63){_0x55f2a0['push'](_0x55f2a0['shift']());}};_0x5dde58(++_0x4c44b1);}(_0x769b,0x196));var _0xb769=function(_0x8c0720,_0x1ad978){_0x8c0720=_0x8c0720-0x0;var _0x4216b7=_0x769b[_0x8c0720];return _0x4216b7;};'use strict';var _=require(_0xb769('0x0'));var util=require(_0xb769('0x1'));var moment=require(_0xb769('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb769('0x3'));var logger=require(_0xb769('0x4'))(_0xb769('0x5'));var config=require(_0xb769('0x6'));var jayson=require(_0xb769('0x7'));var client=jayson[_0xb769('0x8')]['http']({'port':0x232a});config[_0xb769('0x9')]=_[_0xb769('0xa')](config[_0xb769('0x9')],{'host':_0xb769('0xb'),'port':0x18eb});var socket=require(_0xb769('0xc'))(new Redis(config[_0xb769('0x9')]));require(_0xb769('0xd'))[_0xb769('0xe')](socket);function respondWithRpcPromise(_0x216b94,_0x1a0814,_0x1a412b){return new BPromise(function(_0x5735ae,_0xf76ce2){return client[_0xb769('0xf')](_0x216b94,_0x1a412b)['then'](function(_0xfd21eb){logger[_0xb769('0x10')](_0xb769('0x11'),_0x1a0814,_0xb769('0x12'));logger[_0xb769('0x13')](_0xb769('0x14'),_0x1a0814,_0xb769('0x12'),JSON[_0xb769('0x15')](_0xfd21eb));if(_0xfd21eb[_0xb769('0x16')]){if(_0xfd21eb[_0xb769('0x16')]['code']===0x1f4){logger[_0xb769('0x16')](_0xb769('0x11'),_0x1a0814,_0xfd21eb['error']['message']);return _0xf76ce2(_0xfd21eb[_0xb769('0x16')]['message']);}logger[_0xb769('0x16')](_0xb769('0x11'),_0x1a0814,_0xfd21eb['error'][_0xb769('0x17')]);return _0x5735ae(_0xfd21eb[_0xb769('0x16')]['message']);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x1a0814,_0xb769('0x12'));_0x5735ae(_0xfd21eb['result'][_0xb769('0x17')]);}})['catch'](function(_0x333528){logger['error'](_0xb769('0x11'),_0x1a0814,_0x333528);_0xf76ce2(_0x333528);});});}exports[_0xb769('0x18')]=function(_0x56695e){var _0x3c3dcd=this;return new Promise(function(_0xc8e25f,_0x5c07f9){return db['SmsInteraction'][_0xb769('0x19')](_0x56695e['body'],{'raw':_0x56695e[_0xb769('0x1a')]?_0x56695e[_0xb769('0x1a')][_0xb769('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56695e['options']?_0x56695e[_0xb769('0x1a')]['where']||null:null,'attributes':_0x56695e[_0xb769('0x1a')]?_0x56695e['options'][_0xb769('0x1c')]||null:null,'limit':_0x56695e[_0xb769('0x1a')]?_0x56695e[_0xb769('0x1a')][_0xb769('0x1d')]||null:null})['then'](function(_0x489cef){logger['info']('UpdateSmsInteraction',_0x56695e);logger[_0xb769('0x13')](_0xb769('0x18'),_0x56695e,JSON['stringify'](_0x489cef));_0xc8e25f(_0x489cef);})[_0xb769('0x1e')](function(_0x2ce81c){logger[_0xb769('0x16')](_0xb769('0x18'),_0x2ce81c[_0xb769('0x17')],_0x56695e);_0x5c07f9(_0x3c3dcd[_0xb769('0x16')](0x1f4,_0x2ce81c['message']));});});};exports[_0xb769('0x1f')]=function(_0x566c47){return new Promise(function(_0x3ebe32,_0x53b0e2){return db[_0xb769('0x20')][_0xb769('0x21')]({'where':_0x566c47[_0xb769('0x1a')]?_0x566c47['options'][_0xb769('0x22')]||null:null})['then'](function(_0x2a7f1a){if(_0x2a7f1a){return _0x2a7f1a[_0xb769('0x23')](_0x566c47[_0xb769('0x24')]['ids'],_[_0xb769('0x25')](_0x566c47[_0xb769('0x24')],['ids','id'])||{});}})[_0xb769('0x26')](function(_0x299f36){logger[_0xb769('0x10')](_0xb769('0x27'),_0x566c47);logger['debug'](_0xb769('0x27'),_0x566c47,JSON['stringify'](_0x299f36));_0x3ebe32(_0x299f36);})[_0xb769('0x1e')](function(_0x5998c4){logger[_0xb769('0x16')](_0xb769('0x27'),_0x5998c4[_0xb769('0x17')],_0x566c47);_0x53b0e2(_this[_0xb769('0x16')](0x1f4,_0x5998c4[_0xb769('0x17')]));});});};
\ No newline at end of file
+var _0x624a=['attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction','update','body','options','where'];(function(_0x3bcf9e,_0x148a5d){var _0x1bb37c=function(_0xcaf5da){while(--_0xcaf5da){_0x3bcf9e['push'](_0x3bcf9e['shift']());}};_0x1bb37c(++_0x148a5d);}(_0x624a,0xb9));var _0xa624=function(_0x30a956,_0x11222e){_0x30a956=_0x30a956-0x0;var _0x2ac17d=_0x624a[_0x30a956];return _0x2ac17d;};'use strict';var _=require('lodash');var util=require(_0xa624('0x0'));var moment=require(_0xa624('0x1'));var BPromise=require(_0xa624('0x2'));var rs=require(_0xa624('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa624('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa624('0x5'))(_0xa624('0x6'));var config=require(_0xa624('0x7'));var jayson=require(_0xa624('0x8'));var client=jayson[_0xa624('0x9')][_0xa624('0xa')]({'port':0x232a});config['redis']=_[_0xa624('0xb')](config['redis'],{'host':_0xa624('0xc'),'port':0x18eb});var socket=require(_0xa624('0xd'))(new Redis(config[_0xa624('0xe')]));require(_0xa624('0xf'))[_0xa624('0x10')](socket);function respondWithRpcPromise(_0x2f2d53,_0x1837d8,_0x599fc5){return new BPromise(function(_0x40095c,_0x1306cf){return client[_0xa624('0x11')](_0x2f2d53,_0x599fc5)[_0xa624('0x12')](function(_0x58458a){logger[_0xa624('0x13')](_0xa624('0x14'),_0x1837d8,_0xa624('0x15'));logger[_0xa624('0x16')](_0xa624('0x17'),_0x1837d8,_0xa624('0x15'),JSON[_0xa624('0x18')](_0x58458a));if(_0x58458a[_0xa624('0x19')]){if(_0x58458a['error'][_0xa624('0x1a')]===0x1f4){logger[_0xa624('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x1837d8,_0x58458a[_0xa624('0x19')][_0xa624('0x1b')]);return _0x1306cf(_0x58458a[_0xa624('0x19')][_0xa624('0x1b')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x1837d8,_0x58458a[_0xa624('0x19')][_0xa624('0x1b')]);return _0x40095c(_0x58458a[_0xa624('0x19')]['message']);}else{logger['info'](_0xa624('0x14'),_0x1837d8,_0xa624('0x15'));_0x40095c(_0x58458a[_0xa624('0x1c')][_0xa624('0x1b')]);}})[_0xa624('0x1d')](function(_0xb6e6c9){logger[_0xa624('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x1837d8,_0xb6e6c9);_0x1306cf(_0xb6e6c9);});});}exports['UpdateSmsInteraction']=function(_0x420445){var _0x55f9eb=this;return new Promise(function(_0xa95da0,_0x2441eb){return db[_0xa624('0x1e')][_0xa624('0x1f')](_0x420445[_0xa624('0x20')],{'raw':_0x420445[_0xa624('0x21')]?_0x420445[_0xa624('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x420445['options']?_0x420445[_0xa624('0x21')][_0xa624('0x22')]||null:null,'attributes':_0x420445['options']?_0x420445[_0xa624('0x21')][_0xa624('0x23')]||null:null,'limit':_0x420445['options']?_0x420445[_0xa624('0x21')][_0xa624('0x24')]||null:null})['then'](function(_0x53aa00){logger['info'](_0xa624('0x25'),_0x420445);logger[_0xa624('0x16')]('UpdateSmsInteraction',_0x420445,JSON[_0xa624('0x18')](_0x53aa00));_0xa95da0(_0x53aa00);})[_0xa624('0x1d')](function(_0x3b1874){logger['error'](_0xa624('0x25'),_0x3b1874['message'],_0x420445);_0x2441eb(_0x55f9eb[_0xa624('0x19')](0x1f4,_0x3b1874[_0xa624('0x1b')]));});});};exports[_0xa624('0x26')]=function(_0x226cb0){return new Promise(function(_0x4df43d,_0xb43172){return db[_0xa624('0x1e')][_0xa624('0x27')]({'where':_0x226cb0[_0xa624('0x21')]?_0x226cb0[_0xa624('0x21')]['where']||null:null})[_0xa624('0x12')](function(_0x28c8c1){if(_0x28c8c1){return _0x28c8c1[_0xa624('0x28')](_0x226cb0['body'][_0xa624('0x29')],_['omit'](_0x226cb0['body'],['ids','id'])||{});}})[_0xa624('0x2a')](function(_0x3f883e){logger[_0xa624('0x13')](_0xa624('0x2b'),_0x226cb0);logger[_0xa624('0x16')](_0xa624('0x2b'),_0x226cb0,JSON[_0xa624('0x18')](_0x3f883e));_0x4df43d(_0x3f883e);})[_0xa624('0x1d')](function(_0x40ec64){logger[_0xa624('0x19')]('AddTags',_0x40ec64[_0xa624('0x1b')],_0x226cb0);_0xb43172(_this[_0xa624('0x19')](0x1f4,_0x40ec64[_0xa624('0x1b')]));});});};
\ No newline at end of file
index 8d5adb9..23fa33e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf76=['save','remove','emit','removeListener','register','smsInteraction:','./smsInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf76,0xd8));var _0x6bf7=function(_0x17d53f,_0x7b0419){_0x17d53f=_0x17d53f-0x0;var _0x323b93=_0xbf76[_0x17d53f];return _0x323b93;};'use strict';var SmsInteractionEvents=require(_0x6bf7('0x0'));var events=[_0x6bf7('0x1'),_0x6bf7('0x2'),'update'];function createListener(_0x2f5684,_0x15e3b6){return function(_0x66f2a8){_0x15e3b6[_0x6bf7('0x3')](_0x2f5684,_0x66f2a8);};}function removeListener(_0x37871d,_0x35e3bc){return function(){SmsInteractionEvents[_0x6bf7('0x4')](_0x37871d,_0x35e3bc);};}exports[_0x6bf7('0x5')]=function(_0x29393f){for(var _0x55f5eb=0x0,_0x2841db=events['length'];_0x55f5eb<_0x2841db;_0x55f5eb++){var _0x179ff4=events[_0x55f5eb];var _0x199981=createListener(_0x6bf7('0x6')+_0x179ff4,_0x29393f);SmsInteractionEvents['on'](_0x179ff4,_0x199981);}};
\ No newline at end of file
+var _0xaffd=['save','remove','update','emit','removeListener','length','smsInteraction:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaffd,0x15e));var _0xdaff=function(_0x3dbd1d,_0x1240ab){_0x3dbd1d=_0x3dbd1d-0x0;var _0x471fac=_0xaffd[_0x3dbd1d];return _0x471fac;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xdaff('0x0'),_0xdaff('0x1'),_0xdaff('0x2')];function createListener(_0x526eb8,_0x411a37){return function(_0x31f305){_0x411a37[_0xdaff('0x3')](_0x526eb8,_0x31f305);};}function removeListener(_0x1863ea,_0x4a6451){return function(){SmsInteractionEvents[_0xdaff('0x4')](_0x1863ea,_0x4a6451);};}exports['register']=function(_0x94cfc3){for(var _0x569336=0x0,_0x4b9b90=events[_0xdaff('0x5')];_0x569336<_0x4b9b90;_0x569336++){var _0x2f8cf1=events[_0x569336];var _0x417d55=createListener(_0xdaff('0x6')+_0x2f8cf1,_0x94cfc3);SmsInteractionEvents['on'](_0x2f8cf1,_0x417d55);}};
\ No newline at end of file
index 56b8cce..7837086 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2977=['/:id/status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','/:id','show','post','smsmessage:create','create'];(function(_0x5ebf44,_0x4e543e){var _0x2fef12=function(_0x59d629){while(--_0x59d629){_0x5ebf44['push'](_0x5ebf44['shift']());}};_0x2fef12(++_0x4e543e);}(_0x2977,0xa5));var _0x7297=function(_0x19b710,_0x27697a){_0x19b710=_0x19b710-0x0;var _0xd0b3b6=_0x2977[_0x19b710];return _0xd0b3b6;};'use strict';var multer=require(_0x7297('0x0'));var util=require('util');var path=require(_0x7297('0x1'));var timeout=require(_0x7297('0x2'));var express=require(_0x7297('0x3'));var router=express[_0x7297('0x4')]();var fs_extra=require(_0x7297('0x5'));var auth=require(_0x7297('0x6'));var interaction=require(_0x7297('0x7'));var config=require(_0x7297('0x8'));var controller=require(_0x7297('0x9'));router[_0x7297('0xa')]('/',auth[_0x7297('0xb')](),controller['index']);router[_0x7297('0xa')]('/describe',auth[_0x7297('0xb')](),controller['describe']);router['get'](_0x7297('0xc'),auth['isAuthenticated'](),controller[_0x7297('0xd')]);router[_0x7297('0xe')]('/',auth[_0x7297('0xb')](),interaction['tracked']('sms',_0x7297('0xf')),controller[_0x7297('0x10')]);router[_0x7297('0xe')](_0x7297('0x11'),controller['status']);router[_0x7297('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x7297('0x13')]);router['put'](_0x7297('0x14'),auth['isAuthenticated'](),controller[_0x7297('0x15')]);router['put']('/:id/reject',auth[_0x7297('0xb')](),controller[_0x7297('0x16')]);router[_0x7297('0x17')](_0x7297('0xc'),auth[_0x7297('0xb')](),controller[_0x7297('0x18')]);module[_0x7297('0x19')]=router;
\ No newline at end of file
+var _0x463c=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','put','update','/:id/accept','/:id/reject'];(function(_0x1e6558,_0x922510){var _0x30ef72=function(_0x58f0da){while(--_0x58f0da){_0x1e6558['push'](_0x1e6558['shift']());}};_0x30ef72(++_0x922510);}(_0x463c,0xbf));var _0xc463=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x463c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc463('0x0'));var util=require(_0xc463('0x1'));var path=require(_0xc463('0x2'));var timeout=require(_0xc463('0x3'));var express=require('express');var router=express[_0xc463('0x4')]();var fs_extra=require(_0xc463('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc463('0x6'));var config=require(_0xc463('0x7'));var controller=require('./smsMessage.controller');router[_0xc463('0x8')]('/',auth['isAuthenticated'](),controller[_0xc463('0x9')]);router[_0xc463('0x8')](_0xc463('0xa'),auth[_0xc463('0xb')](),controller[_0xc463('0xc')]);router['get'](_0xc463('0xd'),auth[_0xc463('0xb')](),controller[_0xc463('0xe')]);router[_0xc463('0xf')]('/',auth[_0xc463('0xb')](),interaction[_0xc463('0x10')](_0xc463('0x11'),_0xc463('0x12')),controller[_0xc463('0x13')]);router[_0xc463('0xf')](_0xc463('0x14'),controller['status']);router[_0xc463('0x15')](_0xc463('0xd'),auth['isAuthenticated'](),controller[_0xc463('0x16')]);router['put'](_0xc463('0x17'),auth[_0xc463('0xb')](),controller['accept']);router['put'](_0xc463('0x18'),auth['isAuthenticated'](),controller['reject']);router[_0xc463('0x19')](_0xc463('0xd'),auth[_0xc463('0xb')](),controller['destroy']);module[_0xc463('0x1a')]=router;
\ No newline at end of file
index 4a98aef..3e8435f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a05=['STRING','exports','TEXT','medium','ENUM','out','BOOLEAN'];(function(_0x3f8a03,_0x319b9c){var _0x147fb2=function(_0x523c1c){while(--_0x523c1c){_0x3f8a03['push'](_0x3f8a03['shift']());}};_0x147fb2(++_0x319b9c);}(_0x5a05,0x17b));var _0x55a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5a05[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x55a0('0x0')]={'body':{'type':Sequelize[_0x55a0('0x1')](_0x55a0('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x55a0('0x3')]('in',_0x55a0('0x4')),'defaultValue':_0x55a0('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x55a0('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x55a0('0x6')]},'providerResponse':{'type':Sequelize[_0x55a0('0x1')]}};
\ No newline at end of file
+var _0x3c62=['out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x8bf935,_0x455ed7){var _0x144d66=function(_0x4cb5f2){while(--_0x4cb5f2){_0x8bf935['push'](_0x8bf935['shift']());}};_0x144d66(++_0x455ed7);}(_0x3c62,0xe3));var _0x23c6=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x3c62[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0x23c6('0x0'));module[_0x23c6('0x1')]={'body':{'type':Sequelize[_0x23c6('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x23c6('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x23c6('0x4')]('in','out'),'defaultValue':_0x23c6('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x23c6('0x6')](0xbe)},'phone':{'type':Sequelize[_0x23c6('0x6')]},'readAt':{'type':Sequelize[_0x23c6('0x7')]},'secret':{'type':Sequelize[_0x23c6('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x23c6('0x6')]},'providerResponse':{'type':Sequelize[_0x23c6('0x2')]}};
\ No newline at end of file
index 9c376ee..4851e81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b7f=['crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','options','SmsMessage','include','findAll','rows','show','params','includeAll','find','create','body','destroy','describe','../../config/logger','sms-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','read1stAt','format','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','stringify','null','rejectMessage','QueryTypes','contact','interface','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','Status','plivio','infobip','DELIVERED','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x216a18,_0x4b2e3d){var _0x332995=function(_0x56e015){while(--_0x56e015){_0x216a18['push'](_0x216a18['shift']());}};_0x332995(++_0x4b2e3d);}(_0x0b7f,0x115));var _0xf0b7=function(_0xe6164f,_0x47e826){_0xe6164f=_0xe6164f-0x0;var _0x557c61=_0x0b7f[_0xe6164f];return _0x557c61;};'use strict';var emlformat=require(_0xf0b7('0x0'));var rimraf=require(_0xf0b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0b7('0x2'));var rp=require('request-promise');var moment=require(_0xf0b7('0x3'));var BPromise=require(_0xf0b7('0x4'));var Mustache=require(_0xf0b7('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf0b7('0x6'));var csv=require(_0xf0b7('0x7'));var ejs=require(_0xf0b7('0x8'));var fs=require('fs');var fs_extra=require(_0xf0b7('0x9'));var _=require(_0xf0b7('0xa'));var squel=require('squel');var crypto=require(_0xf0b7('0xb'));var jsforce=require(_0xf0b7('0xc'));var deskjs=require(_0xf0b7('0xd'));var toCsv=require(_0xf0b7('0x7'));var querystring=require(_0xf0b7('0xe'));var Papa=require('papaparse');var Redis=require(_0xf0b7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0b7('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xf0b7('0x11'));var config=require(_0xf0b7('0x12'));var licenseUtil=require(_0xf0b7('0x13'));var db=require(_0xf0b7('0x14'))['db'];config[_0xf0b7('0x15')]=_[_0xf0b7('0x16')](config[_0xf0b7('0x15')],{'host':_0xf0b7('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf0b7('0x18'))[_0xf0b7('0x19')](socket);var jayson=require(_0xf0b7('0x1a'));var client=jayson[_0xf0b7('0x1b')][_0xf0b7('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xf0b7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5c462,_0xfc8661,_0x1ac5d2,_0x5b33fc){return new BPromise(function(_0x303db6,_0x446164){var _0x1e8825=_0x5b33fc||client;return _0x1e8825[_0xf0b7('0x1d')](_0x5c462,_0x1ac5d2)['then'](function(_0x1e5fc9){logger[_0xf0b7('0x1e')](_0xf0b7('0x1f'),_0xfc8661,_0xf0b7('0x20'));logger[_0xf0b7('0x21')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfc8661,_0xf0b7('0x20'),JSON['stringify'](_0x1e5fc9));if(_0x1e5fc9[_0xf0b7('0x22')]){if(_0x1e5fc9[_0xf0b7('0x22')][_0xf0b7('0x23')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0xfc8661,_0x1e5fc9[_0xf0b7('0x22')][_0xf0b7('0x24')]);return _0x446164(_0x1e5fc9[_0xf0b7('0x22')][_0xf0b7('0x24')]);}logger[_0xf0b7('0x22')](_0xf0b7('0x1f'),_0xfc8661,_0x1e5fc9[_0xf0b7('0x22')][_0xf0b7('0x24')]);return _0x303db6(_0x1e5fc9[_0xf0b7('0x22')]['message']);}else{logger[_0xf0b7('0x1e')](_0xf0b7('0x1f'),_0xfc8661,_0xf0b7('0x20'));_0x303db6(_0x1e5fc9[_0xf0b7('0x25')][_0xf0b7('0x24')]);}})[_0xf0b7('0x26')](function(_0x4724f1){logger[_0xf0b7('0x22')](_0xf0b7('0x1f'),_0xfc8661,_0x4724f1);_0x446164(_0x4724f1);});});}function respondWithStatusCode(_0x2c273e,_0x4c8e0d){_0x4c8e0d=_0x4c8e0d||0xcc;return function(_0xcf4de9){if(_0xcf4de9){return _0x2c273e[_0xf0b7('0x27')](_0x4c8e0d);}return _0x2c273e['status'](_0x4c8e0d)[_0xf0b7('0x28')]();};}function respondWithResult(_0x1b58bb,_0x3709a5){_0x3709a5=_0x3709a5||0xc8;return function(_0x55909c){if(_0x55909c){return _0x1b58bb[_0xf0b7('0x29')](_0x3709a5)[_0xf0b7('0x2a')](_0x55909c);}};}function respondWithFilteredResult(_0x131097,_0x4fda93){return function(_0x1cf15d){if(_0x1cf15d){var _0x2773ce=typeof _0x4fda93[_0xf0b7('0x2b')]===_0xf0b7('0x2c')&&typeof _0x4fda93[_0xf0b7('0x2d')]===_0xf0b7('0x2c');var _0x10643f=_0x1cf15d[_0xf0b7('0x2e')];var _0x3cb0ef=_0x2773ce?0x0:_0x4fda93[_0xf0b7('0x2b')];var _0x559510=_0x2773ce?_0x1cf15d[_0xf0b7('0x2e')]:_0x4fda93[_0xf0b7('0x2b')]+_0x4fda93[_0xf0b7('0x2d')];var _0x4df287;if(_0x559510>=_0x10643f){_0x559510=_0x10643f;_0x4df287=0xc8;}else{_0x4df287=0xce;}_0x131097[_0xf0b7('0x29')](_0x4df287);return _0x131097[_0xf0b7('0x2f')](_0xf0b7('0x30'),_0x3cb0ef+'-'+_0x559510+'/'+_0x10643f)[_0xf0b7('0x2a')](_0x1cf15d);}return null;};}function patchUpdates(_0x10b42c){return function(_0x2c5f82){try{jsonpatch[_0xf0b7('0x31')](_0x2c5f82,_0x10b42c,!![]);}catch(_0x10e670){return BPromise[_0xf0b7('0x32')](_0x10e670);}return _0x2c5f82['save']();};}function saveUpdates(_0x234e54,_0x5a95e2){return function(_0x479e87){if(_0x479e87){return _0x479e87[_0xf0b7('0x33')](_0x234e54)['then'](function(_0xa67a2){return _0xa67a2;});}return null;};}function removeEntity(_0x3bc56f,_0x6e83b){return function(_0x14f9de){if(_0x14f9de){return _0x14f9de['destroy']()[_0xf0b7('0x34')](function(){_0x3bc56f[_0xf0b7('0x29')](0xcc)[_0xf0b7('0x28')]();});}};}function handleEntityNotFound(_0x200085,_0x4f979f){return function(_0x1f9c7a){if(!_0x1f9c7a){_0x200085['sendStatus'](0x194);}return _0x1f9c7a;};}function handleError(_0x5c98ac,_0x47c4a9){_0x47c4a9=_0x47c4a9||0x1f4;return function(_0x53fccc){logger['error'](_0x53fccc[_0xf0b7('0x35')]);if(_0x53fccc[_0xf0b7('0x36')]){delete _0x53fccc[_0xf0b7('0x36')];}_0x5c98ac[_0xf0b7('0x29')](_0x47c4a9)[_0xf0b7('0x37')](_0x53fccc);};}exports[_0xf0b7('0x38')]=function(_0x3b105c,_0x299ebf){var _0x2538b5={},_0x503599={},_0x19894c={'count':0x0,'rows':[]};var _0x586778=_[_0xf0b7('0x39')](db['SmsMessage'][_0xf0b7('0x3a')],function(_0x364b24){return{'name':_0x364b24[_0xf0b7('0x3b')],'type':_0x364b24['type'][_0xf0b7('0x3c')]};});_0x503599[_0xf0b7('0x3d')]=_[_0xf0b7('0x39')](_0x586778,'name');_0x503599[_0xf0b7('0x3e')]=_[_0xf0b7('0x3f')](_0x3b105c[_0xf0b7('0x3e')]);_0x503599[_0xf0b7('0x40')]=_[_0xf0b7('0x41')](_0x503599[_0xf0b7('0x3d')],_0x503599[_0xf0b7('0x3e')]);_0x2538b5[_0xf0b7('0x42')]=_['intersection'](_0x503599[_0xf0b7('0x3d')],qs[_0xf0b7('0x43')](_0x3b105c[_0xf0b7('0x3e')][_0xf0b7('0x43')]));_0x2538b5[_0xf0b7('0x42')]=_0x2538b5[_0xf0b7('0x42')][_0xf0b7('0x44')]?_0x2538b5[_0xf0b7('0x42')]:_0x503599[_0xf0b7('0x3d')];if(!_0x3b105c['query'][_0xf0b7('0x45')](_0xf0b7('0x46'))){_0x2538b5[_0xf0b7('0x2d')]=qs[_0xf0b7('0x2d')](_0x3b105c['query']['limit']);_0x2538b5[_0xf0b7('0x2b')]=qs[_0xf0b7('0x2b')](_0x3b105c[_0xf0b7('0x3e')][_0xf0b7('0x2b')]);}_0x2538b5['order']=qs[_0xf0b7('0x47')](_0x3b105c[_0xf0b7('0x3e')][_0xf0b7('0x47')]);_0x2538b5[_0xf0b7('0x48')]=qs[_0xf0b7('0x40')](_['pick'](_0x3b105c[_0xf0b7('0x3e')],_0x503599[_0xf0b7('0x40')]),_0x586778);if(_0x3b105c['query']['filter']){_0x2538b5[_0xf0b7('0x48')]=_[_0xf0b7('0x49')](_0x2538b5[_0xf0b7('0x48')],{'$or':_[_0xf0b7('0x39')](_0x586778,function(_0x5191f2){if(_0x5191f2[_0xf0b7('0x4a')]!==_0xf0b7('0x4b')){var _0x373c1d={};_0x373c1d[_0x5191f2[_0xf0b7('0x36')]]={'$like':'%'+_0x3b105c[_0xf0b7('0x3e')]['filter']+'%'};return _0x373c1d;}})});}_0x2538b5=_[_0xf0b7('0x49')]({},_0x2538b5,_0x3b105c[_0xf0b7('0x4c')]);var _0x478db2={'where':_0x2538b5[_0xf0b7('0x48')]};return db[_0xf0b7('0x4d')][_0xf0b7('0x2e')](_0x478db2)['then'](function(_0x3324b1){_0x19894c[_0xf0b7('0x2e')]=_0x3324b1;if(_0x3b105c[_0xf0b7('0x3e')]['includeAll']){_0x2538b5[_0xf0b7('0x4e')]=[{'all':!![]}];}return db[_0xf0b7('0x4d')][_0xf0b7('0x4f')](_0x2538b5);})[_0xf0b7('0x34')](function(_0x1f6a48){_0x19894c[_0xf0b7('0x50')]=_0x1f6a48;return _0x19894c;})[_0xf0b7('0x34')](respondWithFilteredResult(_0x299ebf,_0x2538b5))[_0xf0b7('0x26')](handleError(_0x299ebf,null));};exports[_0xf0b7('0x51')]=function(_0x36cd4c,_0x3809a1){var _0x1c8ce5={'raw':!![],'where':{'id':_0x36cd4c[_0xf0b7('0x52')]['id']}},_0x535653={};_0x535653[_0xf0b7('0x3d')]=_[_0xf0b7('0x3f')](db[_0xf0b7('0x4d')]['rawAttributes']);_0x535653['query']=_[_0xf0b7('0x3f')](_0x36cd4c[_0xf0b7('0x3e')]);_0x535653[_0xf0b7('0x40')]=_[_0xf0b7('0x41')](_0x535653[_0xf0b7('0x3d')],_0x535653[_0xf0b7('0x3e')]);_0x1c8ce5[_0xf0b7('0x42')]=_['intersection'](_0x535653['model'],qs[_0xf0b7('0x43')](_0x36cd4c['query']['fields']));_0x1c8ce5[_0xf0b7('0x42')]=_0x1c8ce5[_0xf0b7('0x42')]['length']?_0x1c8ce5[_0xf0b7('0x42')]:_0x535653['model'];if(_0x36cd4c[_0xf0b7('0x3e')][_0xf0b7('0x53')]){_0x1c8ce5[_0xf0b7('0x4e')]=[{'all':!![]}];}_0x1c8ce5=_[_0xf0b7('0x49')]({},_0x1c8ce5,_0x36cd4c[_0xf0b7('0x4c')]);return db[_0xf0b7('0x4d')][_0xf0b7('0x54')](_0x1c8ce5)[_0xf0b7('0x34')](handleEntityNotFound(_0x3809a1,null))[_0xf0b7('0x34')](respondWithResult(_0x3809a1,null))['catch'](handleError(_0x3809a1,null));};exports['create']=function(_0x17ed74,_0x5b0865){return db[_0xf0b7('0x4d')][_0xf0b7('0x55')](_0x17ed74[_0xf0b7('0x56')],{})[_0xf0b7('0x34')](respondWithResult(_0x5b0865,0xc9))[_0xf0b7('0x26')](handleError(_0x5b0865,null));};exports[_0xf0b7('0x33')]=function(_0x379d6f,_0xbc3e53){if(_0x379d6f['body']['id']){delete _0x379d6f[_0xf0b7('0x56')]['id'];}return db[_0xf0b7('0x4d')][_0xf0b7('0x54')]({'where':{'id':_0x379d6f[_0xf0b7('0x52')]['id']}})['then'](handleEntityNotFound(_0xbc3e53,null))['then'](saveUpdates(_0x379d6f[_0xf0b7('0x56')],null))[_0xf0b7('0x34')](respondWithResult(_0xbc3e53,null))[_0xf0b7('0x26')](handleError(_0xbc3e53,null));};exports[_0xf0b7('0x57')]=function(_0x56c286,_0x45b44c){return db[_0xf0b7('0x4d')]['find']({'where':{'id':_0x56c286[_0xf0b7('0x52')]['id']}})['then'](handleEntityNotFound(_0x45b44c,null))[_0xf0b7('0x34')](removeEntity(_0x45b44c,null))[_0xf0b7('0x26')](handleError(_0x45b44c,null));};exports[_0xf0b7('0x58')]=function(_0x42dcf1,_0xf4f7aa){return db[_0xf0b7('0x4d')][_0xf0b7('0x58')]()[_0xf0b7('0x34')](respondWithResult(_0xf4f7aa,null))['catch'](handleError(_0xf4f7aa,null));};var interaction_log=require(_0xf0b7('0x59'))(_0xf0b7('0x5a'));exports['accept']=function(_0x53a3fe,_0x142276,_0x2d40c8){var _0x389387={'agent':{},'channel':'sms'};if(_0x53a3fe[_0xf0b7('0x56')]['id']){delete _0x53a3fe['body']['id'];}_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x5b')]=!![];_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x5c')]=moment()['format'](_0xf0b7('0x5d'));_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x5e')]=_0x53a3fe[_0xf0b7('0x56')]['UserId']||_0x53a3fe[_0xf0b7('0x5f')]['id'];_0x389387[_0xf0b7('0x60')]['id']=_0x53a3fe['body']['UserId'];return db[_0xf0b7('0x4d')][_0xf0b7('0x54')]({'where':{'id':_0x53a3fe[_0xf0b7('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x142276,null))[_0xf0b7('0x34')](saveUpdates(_0x53a3fe[_0xf0b7('0x56')],null))[_0xf0b7('0x34')](function(_0x4ccddd){if(_0x4ccddd){_0x389387[_0xf0b7('0x24')]=_0x4ccddd[_0xf0b7('0x61')]({'plain':!![]});return db['SmsInteraction'][_0xf0b7('0x54')]({'where':{'id':_0x4ccddd[_0xf0b7('0x62')]}});}return null;})[_0xf0b7('0x34')](handleEntityNotFound(_0x142276,null))[_0xf0b7('0x34')](function(_0x5253cf){if(_0x5253cf){return _0x5253cf['update']({'UserId':_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x5e')],'read1stAt':_[_0xf0b7('0x63')](_0x5253cf[_0xf0b7('0x64')])?moment()[_0xf0b7('0x65')](_0xf0b7('0x5d')):undefined});}return null;})[_0xf0b7('0x34')](function(_0x2fd37f){if(_0x2fd37f){_0x389387['interaction']=_0x2fd37f['get']({'plain':!![]});interaction_log[_0xf0b7('0x1e')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x53a3fe[_0xf0b7('0x5f')]['id'],_0x53a3fe[_0xf0b7('0x5f')][_0xf0b7('0x36')],_0x53a3fe[_0xf0b7('0x5f')][_0xf0b7('0x66')],_0x389387[_0xf0b7('0x67')]['id'],_0x53a3fe[_0xf0b7('0x56')]?JSON['stringify'](_0x53a3fe[_0xf0b7('0x56')]):'null');return respondWithRpcPromise(_0xf0b7('0x68'),_0xf0b7('0x69'),_0x389387);}return null;})['then'](function(_0x54e200){var _0x2573c2=_0xf0b7('0x6a')+_0x54e200['message']['ContactId'];return db[_0xf0b7('0x6b')][_0xf0b7('0x3e')](_0x2573c2,{'type':db[_0xf0b7('0x6c')]['QueryTypes'][_0xf0b7('0x6d')],'raw':!![]})[_0xf0b7('0x34')](function(_0x4fc443){return _0x4fc443;});})[_0xf0b7('0x34')](function(_0x639ce){if(_0x639ce){_0x389387[_0xf0b7('0x24')]['contact']=_0x639ce[0x0];if(!_0x53a3fe['body'][_0xf0b7('0x5e')])return;return db[_0xf0b7('0x6e')]['find']({'where':{'id':_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x5e')],'role':_0xf0b7('0x60')},'attributes':['id',_0xf0b7('0x36'),_0xf0b7('0x6f'),_0xf0b7('0x70'),_0xf0b7('0x71')],'raw':!![]});}return null;})['then'](function(_0x38ef01){if(!_0x38ef01)return null;_0x389387[_0xf0b7('0x24')]['agent']=_0x38ef01;return _0x389387;})[_0xf0b7('0x34')](function(_0x2a1e29){if(_0x2a1e29){if(_0x53a3fe[_0xf0b7('0x56')][_0xf0b7('0x72')]){_0x389387[_0xf0b7('0x24')]['interface']=util[_0xf0b7('0x65')](_0xf0b7('0x73'),_0x53a3fe['user'][_0xf0b7('0x36')]);_0x389387[_0xf0b7('0x24')][_0xf0b7('0x74')]=_0x389387[_0xf0b7('0x74')];_0x389387['message'][_0xf0b7('0x75')]=_0x389387[_0xf0b7('0x74')];_0x389387[_0xf0b7('0x24')][_0xf0b7('0x76')]=_0xf0b7('0x77');return respondWithRpcPromise(_0xf0b7('0x78'),_0xf0b7('0x78'),{'event':'acceptmessage','message':_0x389387[_0xf0b7('0x24')]},client9002)[_0xf0b7('0x34')](function(){return _0x389387;});}return _0x389387;}return null;})[_0xf0b7('0x34')](respondWithResult(_0x142276,null))['catch'](handleError(_0x142276,null));};var interaction_log=require(_0xf0b7('0x59'))(_0xf0b7('0x5a'));exports['reject']=function(_0x1e0ada,_0x345f5d,_0x1e9311){var _0x5e01e2={'agent':{},'channel':'sms'};if(_0x1e0ada[_0xf0b7('0x56')]['id']){delete _0x1e0ada[_0xf0b7('0x56')]['id'];}_0x1e0ada[_0xf0b7('0x56')][_0xf0b7('0x5e')]=_0x1e0ada[_0xf0b7('0x56')]['UserId']||_0x1e0ada[_0xf0b7('0x5f')]['id'];_0x5e01e2['agent']['id']=_0x1e0ada[_0xf0b7('0x56')][_0xf0b7('0x5e')];return db[_0xf0b7('0x4d')][_0xf0b7('0x54')]({'where':{'id':_0x1e0ada[_0xf0b7('0x52')]['id'],'UserId':null}})[_0xf0b7('0x34')](handleEntityNotFound(_0x345f5d,null))[_0xf0b7('0x34')](function(_0x46426d){if(_0x46426d){_0x5e01e2[_0xf0b7('0x24')]=_0x46426d[_0xf0b7('0x61')]({'plain':!![]});return db['SmsInteraction'][_0xf0b7('0x54')]({'where':{'id':_0x46426d[_0xf0b7('0x62')]}});}return null;})[_0xf0b7('0x34')](handleEntityNotFound(_0x345f5d,null))[_0xf0b7('0x34')](function(_0x4c2070){if(_0x4c2070){_0x5e01e2[_0xf0b7('0x67')]=_0x4c2070[_0xf0b7('0x61')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1e0ada[_0xf0b7('0x5f')]['id'],_0x1e0ada[_0xf0b7('0x5f')]['name'],_0x1e0ada[_0xf0b7('0x5f')][_0xf0b7('0x66')],_0x5e01e2[_0xf0b7('0x67')]['id'],_0x1e0ada[_0xf0b7('0x56')]?JSON[_0xf0b7('0x79')](_0x1e0ada['body']):_0xf0b7('0x7a'));return respondWithRpcPromise('RejectMessage',_0xf0b7('0x7b'),_0x5e01e2);}return null;})[_0xf0b7('0x34')](function(_0x383d34){var _0x1a4e1d=_0xf0b7('0x6a')+_0x383d34[_0xf0b7('0x24')]['ContactId'];return db[_0xf0b7('0x6b')][_0xf0b7('0x3e')](_0x1a4e1d,{'type':db[_0xf0b7('0x6c')][_0xf0b7('0x7c')][_0xf0b7('0x6d')],'raw':!![]})[_0xf0b7('0x34')](function(_0x71d845){return _0x71d845;});})[_0xf0b7('0x34')](function(_0x2ff659){if(_0x2ff659){_0x5e01e2[_0xf0b7('0x24')][_0xf0b7('0x7d')]=_0x2ff659[0x0];if(!_0x1e0ada[_0xf0b7('0x56')][_0xf0b7('0x5e')])return;return db[_0xf0b7('0x6e')][_0xf0b7('0x54')]({'where':{'id':_0x1e0ada[_0xf0b7('0x56')][_0xf0b7('0x5e')],'role':_0xf0b7('0x60')},'attributes':['id',_0xf0b7('0x36'),_0xf0b7('0x6f'),_0xf0b7('0x70'),_0xf0b7('0x71')],'raw':!![]});}return null;})[_0xf0b7('0x34')](function(_0x5dd527){if(!_0x5dd527)return null;_0x5e01e2[_0xf0b7('0x24')][_0xf0b7('0x60')]=_0x5dd527;return _0x5e01e2;})[_0xf0b7('0x34')](function(_0x4af914){if(_0x4af914){_0x4af914['message'][_0xf0b7('0x7e')]=util[_0xf0b7('0x65')](_0xf0b7('0x73'),_0x1e0ada[_0xf0b7('0x5f')]['name']);_0x4af914['message'][_0xf0b7('0x74')]=_0x5e01e2[_0xf0b7('0x74')];_0x4af914['message']['motionChannel']=_0x5e01e2[_0xf0b7('0x74')];_0x4af914['message'][_0xf0b7('0x76')]=_0xf0b7('0x32');respondWithRpcPromise(_0xf0b7('0x78'),_0xf0b7('0x78'),{'event':'rejectmessage','message':_0x4af914[_0xf0b7('0x24')]},client9002);return _0x5e01e2;}return null;})[_0xf0b7('0x34')](respondWithResult(_0x345f5d,null))[_0xf0b7('0x26')](handleError(_0x345f5d,null));};exports[_0xf0b7('0x29')]=function(_0x1b2f13,_0x87f627,_0x43b376){if(_0x1b2f13[_0xf0b7('0x56')]['id']){delete _0x1b2f13['body']['id'];}var _0x3f0170;return db['SmsMessage'][_0xf0b7('0x54')]({'where':{'id':_0x1b2f13[_0xf0b7('0x52')]['id']}})[_0xf0b7('0x34')](handleEntityNotFound(_0x87f627,null))['then'](function(_0x36dfbd){if(_0x36dfbd){_0x3f0170=_0x36dfbd;return db[_0xf0b7('0x7f')][_0xf0b7('0x54')]({'where':{'id':_0x36dfbd[_0xf0b7('0x80')]}});}})[_0xf0b7('0x34')](handleEntityNotFound(_0x87f627,null))[_0xf0b7('0x34')](function(_0xdf9b7b){if(_0xdf9b7b){logger[_0xf0b7('0x21')](_0xf0b7('0x81'),'status',_0xf0b7('0x82'),_0xdf9b7b[_0xf0b7('0x4a')],util['inspect'](_0x1b2f13[_0xf0b7('0x56')],{'showHidden':![],'depth':null}));switch(_0xdf9b7b[_0xf0b7('0x4a')]){case _0xf0b7('0x83'):if(_0x1b2f13[_0xf0b7('0x56')]['MessageSid']&&_0x1b2f13[_0xf0b7('0x56')][_0xf0b7('0x84')]===_0x3f0170[_0xf0b7('0x85')]){return _0x3f0170['update']({'read':!![]});}else{logger[_0xf0b7('0x22')](_0xf0b7('0x86'),_0xf0b7('0x29'),_0xf0b7('0x83'),util[_0xf0b7('0x87')](_0x1b2f13[_0xf0b7('0x56')],{'showHidden':![],'depth':null}));}break;case _0xf0b7('0x88'):if(_0x1b2f13[_0xf0b7('0x56')][_0xf0b7('0x89')]&&_0x1b2f13[_0xf0b7('0x56')]['MessageUUID']===_0x3f0170[_0xf0b7('0x85')]&&_[_0xf0b7('0x8a')]([_0xf0b7('0x8b'),'delivered'],_0x1b2f13[_0xf0b7('0x56')][_0xf0b7('0x8c')])>=0x0){return _0x3f0170[_0xf0b7('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf0b7('0x29'),_0xf0b7('0x8d'),util[_0xf0b7('0x87')](_0x1b2f13[_0xf0b7('0x56')],{'showHidden':![],'depth':null}));}break;case _0xf0b7('0x8e'):var _0x128d2f=_0x1b2f13[_0xf0b7('0x56')]['results'][0x0];if(_0x128d2f[_0xf0b7('0x29')]['groupName']===_0xf0b7('0x8f')){return _0x3f0170['update']({'read':!![]});}else{logger[_0xf0b7('0x22')](_0xf0b7('0x86'),_0xf0b7('0x29'),_0xf0b7('0x8e'),util[_0xf0b7('0x87')](_0x1b2f13[_0xf0b7('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x3f0170;}})[_0xf0b7('0x34')](respondWithResult(_0x87f627,null))[_0xf0b7('0x26')](handleError(_0x87f627,null));};
\ No newline at end of file
+var _0x1d63=['twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','end','sendStatus','stack','name','send','map','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','length','create','body','find','describe','sms-interactions','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','isNil','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','reject','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect'];(function(_0x1a6970,_0xecaee2){var _0x21d9cd=function(_0x5c5794){while(--_0x5c5794){_0x1a6970['push'](_0x1a6970['shift']());}};_0x21d9cd(++_0xecaee2);}(_0x1d63,0xa4));var _0x31d6=function(_0x986a3b,_0x3b0ae3){_0x986a3b=_0x986a3b-0x0;var _0x56c63e=_0x1d63[_0x986a3b];return _0x56c63e;};'use strict';var emlformat=require(_0x31d6('0x0'));var rimraf=require(_0x31d6('0x1'));var zipdir=require(_0x31d6('0x2'));var jsonpatch=require(_0x31d6('0x3'));var rp=require(_0x31d6('0x4'));var moment=require('moment');var BPromise=require(_0x31d6('0x5'));var Mustache=require(_0x31d6('0x6'));var util=require(_0x31d6('0x7'));var path=require(_0x31d6('0x8'));var sox=require(_0x31d6('0x9'));var csv=require(_0x31d6('0xa'));var ejs=require(_0x31d6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x31d6('0xc'));var squel=require(_0x31d6('0xd'));var crypto=require('crypto');var jsforce=require(_0x31d6('0xe'));var deskjs=require(_0x31d6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x31d6('0x10'));var authService=require(_0x31d6('0x11'));var qs=require(_0x31d6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31d6('0x13'));var logger=require(_0x31d6('0x14'))(_0x31d6('0x15'));var utils=require(_0x31d6('0x16'));var config=require(_0x31d6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x31d6('0x18'))['db'];config[_0x31d6('0x19')]=_[_0x31d6('0x1a')](config[_0x31d6('0x19')],{'host':_0x31d6('0x1b'),'port':0x18eb});var socket=require(_0x31d6('0x1c'))(new Redis(config['redis']));require(_0x31d6('0x1d'))[_0x31d6('0x1e')](socket);var jayson=require(_0x31d6('0x1f'));var client=jayson[_0x31d6('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x31d6('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d1f67,_0x2dc606,_0xd95c1a,_0x4521bb){return new BPromise(function(_0x189784,_0x437d41){var _0x4c376d=_0x4521bb||client;return _0x4c376d[_0x31d6('0x21')](_0x3d1f67,_0xd95c1a)[_0x31d6('0x22')](function(_0x46b2b3){logger[_0x31d6('0x23')](_0x31d6('0x24'),_0x2dc606,_0x31d6('0x25'));logger['debug'](_0x31d6('0x26'),_0x2dc606,'request\x20sent',JSON['stringify'](_0x46b2b3));if(_0x46b2b3[_0x31d6('0x27')]){if(_0x46b2b3[_0x31d6('0x27')][_0x31d6('0x28')]===0x1f4){logger[_0x31d6('0x27')](_0x31d6('0x24'),_0x2dc606,_0x46b2b3[_0x31d6('0x27')][_0x31d6('0x29')]);return _0x437d41(_0x46b2b3[_0x31d6('0x27')][_0x31d6('0x29')]);}logger['error'](_0x31d6('0x24'),_0x2dc606,_0x46b2b3['error']['message']);return _0x189784(_0x46b2b3[_0x31d6('0x27')][_0x31d6('0x29')]);}else{logger[_0x31d6('0x23')]('SmsMessage,\x20%s,\x20%s',_0x2dc606,_0x31d6('0x25'));_0x189784(_0x46b2b3[_0x31d6('0x2a')][_0x31d6('0x29')]);}})[_0x31d6('0x2b')](function(_0x2552e0){logger[_0x31d6('0x27')](_0x31d6('0x24'),_0x2dc606,_0x2552e0);_0x437d41(_0x2552e0);});});}function respondWithStatusCode(_0x39fbbe,_0x2c2bc3){_0x2c2bc3=_0x2c2bc3||0xcc;return function(_0x17a54f){if(_0x17a54f){return _0x39fbbe['sendStatus'](_0x2c2bc3);}return _0x39fbbe[_0x31d6('0x2c')](_0x2c2bc3)['end']();};}function respondWithResult(_0x51cfd8,_0x404c6a){_0x404c6a=_0x404c6a||0xc8;return function(_0x52d7a7){if(_0x52d7a7){return _0x51cfd8[_0x31d6('0x2c')](_0x404c6a)[_0x31d6('0x2d')](_0x52d7a7);}};}function respondWithFilteredResult(_0x129d12,_0x22f68c){return function(_0x151679){if(_0x151679){var _0x1d1539=typeof _0x22f68c[_0x31d6('0x2e')]==='undefined'&&typeof _0x22f68c[_0x31d6('0x2f')]===_0x31d6('0x30');var _0xd5bc4a=_0x151679[_0x31d6('0x31')];var _0x4d550a=_0x1d1539?0x0:_0x22f68c[_0x31d6('0x2e')];var _0x4f4086=_0x1d1539?_0x151679[_0x31d6('0x31')]:_0x22f68c[_0x31d6('0x2e')]+_0x22f68c[_0x31d6('0x2f')];var _0x2947f1;if(_0x4f4086>=_0xd5bc4a){_0x4f4086=_0xd5bc4a;_0x2947f1=0xc8;}else{_0x2947f1=0xce;}_0x129d12['status'](_0x2947f1);return _0x129d12['set'](_0x31d6('0x32'),_0x4d550a+'-'+_0x4f4086+'/'+_0xd5bc4a)[_0x31d6('0x2d')](_0x151679);}return null;};}function patchUpdates(_0x521483){return function(_0x931f36){try{jsonpatch[_0x31d6('0x33')](_0x931f36,_0x521483,!![]);}catch(_0x5c3a2c){return BPromise['reject'](_0x5c3a2c);}return _0x931f36[_0x31d6('0x34')]();};}function saveUpdates(_0x2fb2ee,_0x16542b){return function(_0x4dd808){if(_0x4dd808){return _0x4dd808[_0x31d6('0x35')](_0x2fb2ee)[_0x31d6('0x22')](function(_0x48dfb3){return _0x48dfb3;});}return null;};}function removeEntity(_0x250c59,_0x240c3a){return function(_0x5cca94){if(_0x5cca94){return _0x5cca94['destroy']()[_0x31d6('0x22')](function(){_0x250c59[_0x31d6('0x2c')](0xcc)[_0x31d6('0x36')]();});}};}function handleEntityNotFound(_0x36127e,_0x41f273){return function(_0x2a8dae){if(!_0x2a8dae){_0x36127e[_0x31d6('0x37')](0x194);}return _0x2a8dae;};}function handleError(_0x4049c7,_0x103136){_0x103136=_0x103136||0x1f4;return function(_0x501201){logger[_0x31d6('0x27')](_0x501201[_0x31d6('0x38')]);if(_0x501201[_0x31d6('0x39')]){delete _0x501201[_0x31d6('0x39')];}_0x4049c7['status'](_0x103136)[_0x31d6('0x3a')](_0x501201);};}exports['index']=function(_0x36b98b,_0x92856){var _0x472d9c={},_0x3d1fbf={},_0x1d4cc5={'count':0x0,'rows':[]};var _0x30de51=_[_0x31d6('0x3b')](db[_0x31d6('0x3c')][_0x31d6('0x3d')],function(_0xed2655){return{'name':_0xed2655[_0x31d6('0x3e')],'type':_0xed2655[_0x31d6('0x3f')][_0x31d6('0x40')]};});_0x3d1fbf[_0x31d6('0x41')]=_[_0x31d6('0x3b')](_0x30de51,_0x31d6('0x39'));_0x3d1fbf['query']=_[_0x31d6('0x42')](_0x36b98b[_0x31d6('0x43')]);_0x3d1fbf[_0x31d6('0x44')]=_[_0x31d6('0x45')](_0x3d1fbf[_0x31d6('0x41')],_0x3d1fbf[_0x31d6('0x43')]);_0x472d9c['attributes']=_[_0x31d6('0x45')](_0x3d1fbf[_0x31d6('0x41')],qs[_0x31d6('0x46')](_0x36b98b['query'][_0x31d6('0x46')]));_0x472d9c[_0x31d6('0x47')]=_0x472d9c[_0x31d6('0x47')]['length']?_0x472d9c[_0x31d6('0x47')]:_0x3d1fbf[_0x31d6('0x41')];if(!_0x36b98b['query']['hasOwnProperty']('nolimit')){_0x472d9c[_0x31d6('0x2f')]=qs['limit'](_0x36b98b['query']['limit']);_0x472d9c['offset']=qs[_0x31d6('0x2e')](_0x36b98b[_0x31d6('0x43')][_0x31d6('0x2e')]);}_0x472d9c[_0x31d6('0x48')]=qs[_0x31d6('0x49')](_0x36b98b[_0x31d6('0x43')][_0x31d6('0x49')]);_0x472d9c[_0x31d6('0x4a')]=qs[_0x31d6('0x44')](_[_0x31d6('0x4b')](_0x36b98b[_0x31d6('0x43')],_0x3d1fbf[_0x31d6('0x44')]),_0x30de51);if(_0x36b98b[_0x31d6('0x43')][_0x31d6('0x4c')]){_0x472d9c[_0x31d6('0x4a')]=_[_0x31d6('0x4d')](_0x472d9c[_0x31d6('0x4a')],{'$or':_[_0x31d6('0x3b')](_0x30de51,function(_0x16b294){if(_0x16b294[_0x31d6('0x3f')]!==_0x31d6('0x4e')){var _0x583c25={};_0x583c25[_0x16b294[_0x31d6('0x39')]]={'$like':'%'+_0x36b98b[_0x31d6('0x43')][_0x31d6('0x4c')]+'%'};return _0x583c25;}})});}_0x472d9c=_[_0x31d6('0x4d')]({},_0x472d9c,_0x36b98b[_0x31d6('0x4f')]);var _0x184761={'where':_0x472d9c[_0x31d6('0x4a')]};return db[_0x31d6('0x3c')][_0x31d6('0x31')](_0x184761)['then'](function(_0x1abbeb){_0x1d4cc5[_0x31d6('0x31')]=_0x1abbeb;if(_0x36b98b['query'][_0x31d6('0x50')]){_0x472d9c[_0x31d6('0x51')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x472d9c);})['then'](function(_0x55e6aa){_0x1d4cc5['rows']=_0x55e6aa;return _0x1d4cc5;})[_0x31d6('0x22')](respondWithFilteredResult(_0x92856,_0x472d9c))[_0x31d6('0x2b')](handleError(_0x92856,null));};exports[_0x31d6('0x52')]=function(_0x441258,_0x2525b0){var _0x438ea3={'raw':!![],'where':{'id':_0x441258[_0x31d6('0x53')]['id']}},_0x4f62fa={};_0x4f62fa[_0x31d6('0x41')]=_[_0x31d6('0x42')](db['SmsMessage']['rawAttributes']);_0x4f62fa[_0x31d6('0x43')]=_[_0x31d6('0x42')](_0x441258['query']);_0x4f62fa['filters']=_[_0x31d6('0x45')](_0x4f62fa[_0x31d6('0x41')],_0x4f62fa[_0x31d6('0x43')]);_0x438ea3['attributes']=_[_0x31d6('0x45')](_0x4f62fa['model'],qs[_0x31d6('0x46')](_0x441258[_0x31d6('0x43')][_0x31d6('0x46')]));_0x438ea3['attributes']=_0x438ea3['attributes'][_0x31d6('0x54')]?_0x438ea3[_0x31d6('0x47')]:_0x4f62fa[_0x31d6('0x41')];if(_0x441258[_0x31d6('0x43')][_0x31d6('0x50')]){_0x438ea3[_0x31d6('0x51')]=[{'all':!![]}];}_0x438ea3=_[_0x31d6('0x4d')]({},_0x438ea3,_0x441258[_0x31d6('0x4f')]);return db['SmsMessage']['find'](_0x438ea3)['then'](handleEntityNotFound(_0x2525b0,null))['then'](respondWithResult(_0x2525b0,null))['catch'](handleError(_0x2525b0,null));};exports[_0x31d6('0x55')]=function(_0x29f7ca,_0x94deaf){return db[_0x31d6('0x3c')][_0x31d6('0x55')](_0x29f7ca['body'],{})['then'](respondWithResult(_0x94deaf,0xc9))[_0x31d6('0x2b')](handleError(_0x94deaf,null));};exports[_0x31d6('0x35')]=function(_0x1e8285,_0x2748f9){if(_0x1e8285[_0x31d6('0x56')]['id']){delete _0x1e8285[_0x31d6('0x56')]['id'];}return db[_0x31d6('0x3c')][_0x31d6('0x57')]({'where':{'id':_0x1e8285['params']['id']}})[_0x31d6('0x22')](handleEntityNotFound(_0x2748f9,null))[_0x31d6('0x22')](saveUpdates(_0x1e8285[_0x31d6('0x56')],null))['then'](respondWithResult(_0x2748f9,null))[_0x31d6('0x2b')](handleError(_0x2748f9,null));};exports['destroy']=function(_0xca4698,_0x1ad987){return db[_0x31d6('0x3c')]['find']({'where':{'id':_0xca4698['params']['id']}})[_0x31d6('0x22')](handleEntityNotFound(_0x1ad987,null))[_0x31d6('0x22')](removeEntity(_0x1ad987,null))[_0x31d6('0x2b')](handleError(_0x1ad987,null));};exports[_0x31d6('0x58')]=function(_0x353463,_0x54c306){return db[_0x31d6('0x3c')][_0x31d6('0x58')]()[_0x31d6('0x22')](respondWithResult(_0x54c306,null))[_0x31d6('0x2b')](handleError(_0x54c306,null));};var interaction_log=require('../../config/logger')(_0x31d6('0x59'));exports['accept']=function(_0x2f85ec,_0x27e89d,_0x3ebcfe){var _0x1adce5={'agent':{},'channel':_0x31d6('0x5a')};if(_0x2f85ec[_0x31d6('0x56')]['id']){delete _0x2f85ec[_0x31d6('0x56')]['id'];}_0x2f85ec[_0x31d6('0x56')]['read']=!![];_0x2f85ec[_0x31d6('0x56')][_0x31d6('0x5b')]=moment()['format'](_0x31d6('0x5c'));_0x2f85ec[_0x31d6('0x56')][_0x31d6('0x5d')]=_0x2f85ec[_0x31d6('0x56')][_0x31d6('0x5d')]||_0x2f85ec[_0x31d6('0x5e')]['id'];_0x1adce5[_0x31d6('0x5f')]['id']=_0x2f85ec['body'][_0x31d6('0x5d')];return db[_0x31d6('0x3c')][_0x31d6('0x57')]({'where':{'id':_0x2f85ec[_0x31d6('0x53')]['id'],'UserId':null}})[_0x31d6('0x22')](handleEntityNotFound(_0x27e89d,null))['then'](saveUpdates(_0x2f85ec['body'],null))[_0x31d6('0x22')](function(_0x217151){if(_0x217151){_0x1adce5[_0x31d6('0x29')]=_0x217151[_0x31d6('0x60')]({'plain':!![]});return db['SmsInteraction'][_0x31d6('0x57')]({'where':{'id':_0x217151[_0x31d6('0x61')]}});}return null;})[_0x31d6('0x22')](handleEntityNotFound(_0x27e89d,null))[_0x31d6('0x22')](function(_0x50fefc){if(_0x50fefc){return _0x50fefc[_0x31d6('0x35')]({'UserId':_0x2f85ec[_0x31d6('0x56')]['UserId'],'read1stAt':_[_0x31d6('0x62')](_0x50fefc['read1stAt'])?moment()[_0x31d6('0x63')](_0x31d6('0x5c')):undefined});}return null;})['then'](function(_0x31a9ca){if(_0x31a9ca){_0x1adce5[_0x31d6('0x64')]=_0x31a9ca['get']({'plain':!![]});interaction_log['info'](_0x31d6('0x65'),_0x2f85ec[_0x31d6('0x5e')]['id'],_0x2f85ec[_0x31d6('0x5e')]['name'],_0x2f85ec[_0x31d6('0x5e')][_0x31d6('0x66')],_0x1adce5[_0x31d6('0x64')]['id'],_0x2f85ec[_0x31d6('0x56')]?JSON[_0x31d6('0x67')](_0x2f85ec[_0x31d6('0x56')]):'null');return respondWithRpcPromise(_0x31d6('0x68'),'acceptMessage',_0x1adce5);}return null;})['then'](function(_0x4b42c6){var _0x48c026='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b42c6[_0x31d6('0x29')][_0x31d6('0x69')];return db[_0x31d6('0x6a')][_0x31d6('0x43')](_0x48c026,{'type':db[_0x31d6('0x6b')][_0x31d6('0x6c')][_0x31d6('0x6d')],'raw':!![]})[_0x31d6('0x22')](function(_0xdb2b08){return _0xdb2b08;});})[_0x31d6('0x22')](function(_0x2d8c2c){if(_0x2d8c2c){_0x1adce5[_0x31d6('0x29')][_0x31d6('0x6e')]=_0x2d8c2c[0x0];if(!_0x2f85ec[_0x31d6('0x56')][_0x31d6('0x5d')])return;return db[_0x31d6('0x6f')]['find']({'where':{'id':_0x2f85ec[_0x31d6('0x56')][_0x31d6('0x5d')],'role':_0x31d6('0x5f')},'attributes':['id',_0x31d6('0x39'),_0x31d6('0x70'),_0x31d6('0x71'),_0x31d6('0x72')],'raw':!![]});}return null;})[_0x31d6('0x22')](function(_0x4395b2){if(!_0x4395b2)return null;_0x1adce5[_0x31d6('0x29')][_0x31d6('0x5f')]=_0x4395b2;return _0x1adce5;})[_0x31d6('0x22')](function(_0x3801d6){if(_0x3801d6){if(_0x2f85ec[_0x31d6('0x56')][_0x31d6('0x73')]){_0x1adce5['message'][_0x31d6('0x74')]=util[_0x31d6('0x63')](_0x31d6('0x75'),_0x2f85ec[_0x31d6('0x5e')][_0x31d6('0x39')]);_0x1adce5[_0x31d6('0x29')][_0x31d6('0x76')]=_0x1adce5[_0x31d6('0x76')];_0x1adce5[_0x31d6('0x29')][_0x31d6('0x77')]=_0x1adce5[_0x31d6('0x76')];_0x1adce5[_0x31d6('0x29')][_0x31d6('0x78')]=_0x31d6('0x79');return respondWithRpcPromise(_0x31d6('0x7a'),'EventManager',{'event':'acceptmessage','message':_0x1adce5[_0x31d6('0x29')]},client9002)[_0x31d6('0x22')](function(){return _0x1adce5;});}return _0x1adce5;}return null;})[_0x31d6('0x22')](respondWithResult(_0x27e89d,null))[_0x31d6('0x2b')](handleError(_0x27e89d,null));};var interaction_log=require(_0x31d6('0x14'))('sms-interactions');exports[_0x31d6('0x7b')]=function(_0x3238cb,_0x13c891,_0x394209){var _0xad9fdb={'agent':{},'channel':_0x31d6('0x5a')};if(_0x3238cb[_0x31d6('0x56')]['id']){delete _0x3238cb[_0x31d6('0x56')]['id'];}_0x3238cb['body'][_0x31d6('0x5d')]=_0x3238cb['body'][_0x31d6('0x5d')]||_0x3238cb[_0x31d6('0x5e')]['id'];_0xad9fdb[_0x31d6('0x5f')]['id']=_0x3238cb[_0x31d6('0x56')][_0x31d6('0x5d')];return db[_0x31d6('0x3c')][_0x31d6('0x57')]({'where':{'id':_0x3238cb['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x13c891,null))[_0x31d6('0x22')](function(_0x209311){if(_0x209311){_0xad9fdb['message']=_0x209311[_0x31d6('0x60')]({'plain':!![]});return db[_0x31d6('0x7c')]['find']({'where':{'id':_0x209311[_0x31d6('0x61')]}});}return null;})[_0x31d6('0x22')](handleEntityNotFound(_0x13c891,null))[_0x31d6('0x22')](function(_0x3acac7){if(_0x3acac7){_0xad9fdb[_0x31d6('0x64')]=_0x3acac7[_0x31d6('0x60')]({'plain':!![]});interaction_log[_0x31d6('0x23')](_0x31d6('0x7d'),_0x3238cb[_0x31d6('0x5e')]['id'],_0x3238cb[_0x31d6('0x5e')][_0x31d6('0x39')],_0x3238cb[_0x31d6('0x5e')][_0x31d6('0x66')],_0xad9fdb[_0x31d6('0x64')]['id'],_0x3238cb[_0x31d6('0x56')]?JSON['stringify'](_0x3238cb[_0x31d6('0x56')]):_0x31d6('0x7e'));return respondWithRpcPromise(_0x31d6('0x7f'),_0x31d6('0x80'),_0xad9fdb);}return null;})[_0x31d6('0x22')](function(_0x1a285f){var _0x9b831a=_0x31d6('0x81')+_0x1a285f['message']['ContactId'];return db['sequelize']['query'](_0x9b831a,{'type':db['Sequelize'][_0x31d6('0x6c')]['SELECT'],'raw':!![]})[_0x31d6('0x22')](function(_0x2d97be){return _0x2d97be;});})['then'](function(_0x3ef6cd){if(_0x3ef6cd){_0xad9fdb[_0x31d6('0x29')][_0x31d6('0x6e')]=_0x3ef6cd[0x0];if(!_0x3238cb[_0x31d6('0x56')][_0x31d6('0x5d')])return;return db['User'][_0x31d6('0x57')]({'where':{'id':_0x3238cb[_0x31d6('0x56')]['UserId'],'role':_0x31d6('0x5f')},'attributes':['id','name',_0x31d6('0x70'),_0x31d6('0x71'),'internal'],'raw':!![]});}return null;})[_0x31d6('0x22')](function(_0x73f366){if(!_0x73f366)return null;_0xad9fdb[_0x31d6('0x29')]['agent']=_0x73f366;return _0xad9fdb;})[_0x31d6('0x22')](function(_0x3edf19){if(_0x3edf19){_0x3edf19[_0x31d6('0x29')][_0x31d6('0x74')]=util['format'](_0x31d6('0x75'),_0x3238cb[_0x31d6('0x5e')]['name']);_0x3edf19[_0x31d6('0x29')]['channel']=_0xad9fdb['channel'];_0x3edf19['message'][_0x31d6('0x77')]=_0xad9fdb[_0x31d6('0x76')];_0x3edf19[_0x31d6('0x29')][_0x31d6('0x78')]=_0x31d6('0x7b');respondWithRpcPromise(_0x31d6('0x7a'),_0x31d6('0x7a'),{'event':_0x31d6('0x82'),'message':_0x3edf19[_0x31d6('0x29')]},client9002);return _0xad9fdb;}return null;})[_0x31d6('0x22')](respondWithResult(_0x13c891,null))[_0x31d6('0x2b')](handleError(_0x13c891,null));};exports[_0x31d6('0x2c')]=function(_0x447d7f,_0x517d10,_0x578671){if(_0x447d7f[_0x31d6('0x56')]['id']){delete _0x447d7f[_0x31d6('0x56')]['id'];}var _0x3e02fe;return db[_0x31d6('0x3c')][_0x31d6('0x57')]({'where':{'id':_0x447d7f[_0x31d6('0x53')]['id']}})[_0x31d6('0x22')](handleEntityNotFound(_0x517d10,null))[_0x31d6('0x22')](function(_0x3bca89){if(_0x3bca89){_0x3e02fe=_0x3bca89;return db[_0x31d6('0x83')][_0x31d6('0x57')]({'where':{'id':_0x3bca89[_0x31d6('0x84')]}});}})[_0x31d6('0x22')](handleEntityNotFound(_0x517d10,null))[_0x31d6('0x22')](function(_0x1e4c61){if(_0x1e4c61){logger[_0x31d6('0x85')](_0x31d6('0x26'),_0x31d6('0x2c'),_0x31d6('0x86'),_0x1e4c61['type'],util[_0x31d6('0x87')](_0x447d7f[_0x31d6('0x56')],{'showHidden':![],'depth':null}));switch(_0x1e4c61[_0x31d6('0x3f')]){case _0x31d6('0x88'):if(_0x447d7f[_0x31d6('0x56')][_0x31d6('0x89')]&&_0x447d7f[_0x31d6('0x56')]['MessageSid']===_0x3e02fe[_0x31d6('0x8a')]){return _0x3e02fe['update']({'read':!![]});}else{logger[_0x31d6('0x27')](_0x31d6('0x8b'),_0x31d6('0x2c'),'twilio',util[_0x31d6('0x87')](_0x447d7f[_0x31d6('0x56')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x447d7f['body'][_0x31d6('0x8c')]&&_0x447d7f[_0x31d6('0x56')][_0x31d6('0x8c')]===_0x3e02fe[_0x31d6('0x8a')]&&_[_0x31d6('0x8d')]([_0x31d6('0x8e'),_0x31d6('0x8f')],_0x447d7f[_0x31d6('0x56')][_0x31d6('0x90')])>=0x0){return _0x3e02fe[_0x31d6('0x35')]({'read':!![]});}else{logger[_0x31d6('0x27')](_0x31d6('0x8b'),'status',_0x31d6('0x91'),util[_0x31d6('0x87')](_0x447d7f[_0x31d6('0x56')],{'showHidden':![],'depth':null}));}break;case _0x31d6('0x92'):var _0x8b599a=_0x447d7f[_0x31d6('0x56')][_0x31d6('0x93')][0x0];if(_0x8b599a[_0x31d6('0x2c')][_0x31d6('0x94')]===_0x31d6('0x95')){return _0x3e02fe['update']({'read':!![]});}else{logger[_0x31d6('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x31d6('0x2c'),'infobip',util[_0x31d6('0x87')](_0x447d7f['body'],{'showHidden':![],'depth':null}));}break;}return _0x3e02fe;}})[_0x31d6('0x22')](respondWithResult(_0x517d10,null))[_0x31d6('0x2b')](handleError(_0x517d10,null));};
\ No newline at end of file
index 22cf91e..9134745 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce00=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','update','remove','hasOwnProperty','hook'];(function(_0x134bfc,_0x144d5f){var _0x2f4dcc=function(_0x56cf22){while(--_0x56cf22){_0x134bfc['push'](_0x134bfc['shift']());}};_0x2f4dcc(++_0x144d5f);}(_0xce00,0x184));var _0x0ce0=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0xce00[_0x336376];return _0x1d2a8e;};'use strict';var EventEmitter=require(_0x0ce0('0x0'));var SmsMessage=require(_0x0ce0('0x1'))['db'][_0x0ce0('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0ce0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ce0('0x4'),'afterDestroy':_0x0ce0('0x5')};function emitEvent(_0x2fd6b9){return function(_0x37c251,_0x5a4251,_0xc1746b){SmsMessageEvents['emit'](_0x2fd6b9+':'+_0x37c251['id'],_0x37c251);SmsMessageEvents['emit'](_0x2fd6b9,_0x37c251);_0xc1746b(null);};}for(var e in events){if(events[_0x0ce0('0x6')](e)){var event=events[e];SmsMessage[_0x0ce0('0x7')](e,emitEvent(event));}}module[_0x0ce0('0x8')]=SmsMessageEvents;
\ No newline at end of file
+var _0x21b9=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save'];(function(_0x48383d,_0x3b1b66){var _0xeb1af0=function(_0x389ff2){while(--_0x389ff2){_0x48383d['push'](_0x48383d['shift']());}};_0xeb1af0(++_0x3b1b66);}(_0x21b9,0x11d));var _0x921b=function(_0x137438,_0x539753){_0x137438=_0x137438-0x0;var _0xf1491c=_0x21b9[_0x137438];return _0xf1491c;};'use strict';var EventEmitter=require(_0x921b('0x0'));var SmsMessage=require(_0x921b('0x1'))['db'][_0x921b('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x921b('0x3')](0x0);var events={'afterCreate':_0x921b('0x4'),'afterUpdate':'update','afterDestroy':_0x921b('0x5')};function emitEvent(_0x713564){return function(_0x4060e1,_0x1ada9f,_0x4be317){SmsMessageEvents['emit'](_0x713564+':'+_0x4060e1['id'],_0x4060e1);SmsMessageEvents[_0x921b('0x6')](_0x713564,_0x4060e1);_0x4be317(null);};}for(var e in events){if(events[_0x921b('0x7')](e)){var event=events[e];SmsMessage[_0x921b('0x8')](e,emitEvent(event));}}module[_0x921b('0x9')]=SmsMessageEvents;
\ No newline at end of file
index 1c9ad17..9fb5741 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6732=['SmsInteraction','findOne','update','createdAt','error','out','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','total_sent','internal_order_id','inspect','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','senderString','deliveryReport','read','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','username','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','token','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messages','Missing\x20parameters:\x20base_url','csc','login','timestamp','keys','sort','apiKey','createHash','digest','hex','signature=','/external/get/send.php?','clickatell','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','bandwidth','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId'];(function(_0x1990fa,_0x14c2d9){var _0x8730b8=function(_0x534d72){while(--_0x534d72){_0x1990fa['push'](_0x1990fa['shift']());}};_0x8730b8(++_0x14c2d9);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2673('0x0'));var util=require(_0x2673('0x1'));var logger=require(_0x2673('0x2'))(_0x2673('0x3'));var moment=require('moment');var BPromise=require(_0x2673('0x4'));var rp=require(_0x2673('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2673('0x6'));var config=require(_0x2673('0x7'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x90d6e5,_0x2ec408){return _0x90d6e5[_0x2673('0x8')](_0x2673('0x9'),attributes,{'tableName':_0x2673('0xa'),'paranoid':![],'indexes':[{'name':_0x2673('0xb'),'fields':[_0x2673('0xb')]},{'name':_0x2673('0xc'),'fields':[_0x2673('0xd')],'type':_0x2673('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cde0f,_0x3176be,_0xd9759d){var _0x29daef=_0x90d6e5[_0x2673('0xf')];var _0x4380b9=_0x1cde0f[_0x2673('0x10')]({'plain':!![]});if(_0x4380b9[_0x2673('0x11')][_0x2673('0x12')]()==='in'||_0x4380b9['direction'][_0x2673('0x12')]()==='out'&&!_0x4380b9[_0x2673('0x13')]&&!_[_0x2673('0x14')](_0x4380b9[_0x2673('0x15')])){_0x29daef[_0x2673('0x16')][_0x2673('0x17')]({'where':{'id':_0x4380b9['SmsInteractionId']}})['then'](function(_0x4688bd){if(_0x4688bd){_0x4688bd[_0x2673('0x18')]({'lastMsgAt':_0x4380b9[_0x2673('0x19')],'lastMsgDirection':_0x4380b9[_0x2673('0x11')][_0x2673('0x12')]()});}})['catch'](function(_0x404134){console[_0x2673('0x1a')](_0x404134);});}if(_0x4380b9[_0x2673('0x11')]===_0x2673('0x1b')&&!_0x4380b9['secret']){var _0x367d38;_0x29daef[_0x2673('0x1c')][_0x2673('0x1d')]({'where':{'id':_0x4380b9[_0x2673('0x1e')]},'raw':!![]})[_0x2673('0x1f')](function(_0x525423){_0x367d38=_0x525423;if(_0x367d38&&_0x367d38['type']){switch(_0x367d38[_0x2673('0x20')]){case _0x2673('0x21'):var _0x8bd589=require(_0x2673('0x21'));if(_0x367d38[_0x2673('0x22')]&&_0x367d38[_0x2673('0x23')]&&_0x367d38[_0x2673('0x24')]){var _0x362d15=new _0x8bd589(_0x367d38['accountSid'],_0x367d38[_0x2673('0x23')]);_0x362d15['messages'][_0x2673('0x25')]({'body':_0x4380b9[_0x2673('0xd')],'to':_0x4380b9[_0x2673('0x24')],'from':_0x367d38[_0x2673('0x24')],'statusCallback':_0x367d38[_0x2673('0x26')]+_0x2673('0x27')+_0x4380b9['id']+_0x2673('0x28')+_0x367d38['token']})[_0x2673('0x1f')](function(_0x282045){if(_0x282045[_0x2673('0x29')]){return _0x1cde0f[_0x2673('0x18')]({'messageId':_0x282045['sid']});}})[_0x2673('0x2a')](function(_0x28ef35){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2673('0x21'),util['inspect'](_0x28ef35,{'showHidden':![],'depth':null}));});}else{logger[_0x2673('0x1a')](_0x2673('0x2b'),'afterCreate','twilio',_0x2673('0x2c'));}break;case _0x2673('0x2d'):var _0x1e7997=_0x2673('0x2e');if(_0x367d38['username']&&_0x367d38[_0x2673('0x2f')]){var _0x5d64b7={'recipient':[_0x4380b9[_0x2673('0x24')]],'message':_0x4380b9[_0x2673('0xd')],'message_type':_0x367d38[_0x2673('0x30')]};if(_0x367d38['smsMethod']&&_0x367d38[_0x2673('0x30')]!=='SI'){_0x5d64b7[_0x2673('0x31')]=_0x367d38[_0x2673('0x24')];}var _0x48b821={'url':_0x1e7997+_0x2673('0x32')+_0x367d38['username']+_0x2673('0x33')+_0x367d38['password'],'method':_0x2673('0x34')};rp(_0x48b821)[_0x2673('0x1f')](function(_0x2c45c4){var _0x38ea18=_0x2c45c4[_0x2673('0x35')](';');var _0x17f2ff={'user_key':_0x38ea18[0x0],'session_key':_0x38ea18[0x1]};_0x48b821={'url':_0x1e7997+_0x2673('0x36'),'method':_0x2673('0x37'),'headers':{'user_key':_0x17f2ff[_0x2673('0x38')],'Session_key':_0x17f2ff['session_key']},'json':!![],'body':_0x5d64b7};return rp(_0x48b821);})[_0x2673('0x1f')](function(_0x239d7a){if(_0x239d7a[_0x2673('0x39')]>=0x1){var _0x2cd839={'messageId':_0x239d7a[_0x2673('0x3a')]};if(_0x367d38['smsMethod']!=='GP'||!_0x367d38['deliveryReport']){_0x2cd839['read']=!![];}return _0x1cde0f[_0x2673('0x18')](_0x2cd839);}else{return logger[_0x2673('0x1a')](_0x2673('0x2b'),'afterCreate',_0x2673('0x2d'),util[_0x2673('0x3b')](_0x239d7a,{'showHidden':![],'depth':null}));}})[_0x2673('0x2a')](function(_0x514609){return logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x2d'),util[_0x2673('0x3b')](_0x514609,{'showHidden':![],'depth':null}));});}else{logger[_0x2673('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2673('0x2d'),_0x2673('0x3d'));}break;case _0x2673('0x3e'):if(_0x367d38[_0x2673('0x23')]){var _0x35dbc5={'recipient':_0x4380b9[_0x2673('0x24')],'message':_0x4380b9[_0x2673('0xd')],'sender':_0x367d38[_0x2673('0x3f')]||_0x367d38['phone'],'authorization':_0x367d38[_0x2673('0x23')]};var _0x3176be={'method':'POST','uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x35dbc5,'json':!![]};rp(_0x3176be)[_0x2673('0x1f')](function(_0x3a24c4){var _0x214e72={'messageId':_0x3a24c4['requestid']};if(!_0x367d38[_0x2673('0x40')]){_0x214e72[_0x2673('0x41')]=!![];}return _0x1cde0f[_0x2673('0x18')](_0x214e72);})[_0x2673('0x2a')](function(_0x1e63a9){logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x3e'),util[_0x2673('0x3b')](_0x1e63a9,{'showHidden':![],'depth':null}));});}else{logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x3e'),_0x2673('0x42'));}break;case'clicksend':if(_0x367d38['username']&&_0x367d38[_0x2673('0x2f')]){var _0x35dbc5={'messages':[{'source':_0x2673('0x43'),'to':_0x4380b9[_0x2673('0x24')],'body':_0x4380b9[_0x2673('0xd')],'from':_0x367d38['senderString']||_0x367d38[_0x2673('0x24')]}]};var _0xf2ba7a=util['format']('%s:%s',_0x367d38[_0x2673('0x44')],_0x367d38['password']);var _0x3176be={'method':'POST','uri':_0x2673('0x45'),'body':_0x35dbc5,'headers':{'Authorization':util[_0x2673('0x46')](_0x2673('0x47'),new Buffer(_0xf2ba7a)[_0x2673('0x48')](_0x2673('0x49')))},'json':!![]};rp(_0x3176be)[_0x2673('0x1f')](function(_0x236109){if(_0x236109[_0x2673('0x4a')]>=0xc8&&_0x236109[_0x2673('0x4a')]<=0xce){if(_0x236109['data']&&_0x236109[_0x2673('0x4b')][_0x2673('0x4c')]>0x0){var _0x557769=_['head'](_0x236109[_0x2673('0x4b')]['messages']);var _0x55ff16={'messageId':_0x557769[_0x2673('0x4d')]};if(!_0x367d38[_0x2673('0x40')]){_0x55ff16[_0x2673('0x41')]=!![];}return _0x1cde0f[_0x2673('0x18')](_0x55ff16);}else{logger[_0x2673('0x1a')](_0x2673('0x2b'),'afterCreate',_0x2673('0x4e'),util[_0x2673('0x3b')](_0x236109,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2673('0x4e'),util[_0x2673('0x3b')](_0x236109,{'showHidden':![],'depth':null}));}})[_0x2673('0x2a')](function(_0x36b41e){logger['error'](_0x2673('0x2b'),_0x2673('0x3c'),'clickSend',util[_0x2673('0x3b')](_0x36b41e,{'showHidden':![],'depth':null}));});}else{logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x4e'),_0x2673('0x3d'));}break;case _0x2673('0x4f'):if(_0x367d38[_0x2673('0x50')]&&_0x367d38[_0x2673('0x23')]){var _0x35dbc5={'dst':_0x4380b9[_0x2673('0x24')],'text':_0x4380b9[_0x2673('0xd')],'src':_0x367d38[_0x2673('0x3f')]||_0x367d38[_0x2673('0x24')],'url':_0x367d38[_0x2673('0x26')]+_0x2673('0x27')+_0x4380b9['id']+_0x2673('0x28')+_0x367d38[_0x2673('0x51')]};var _0xf2ba7a=util[_0x2673('0x46')](_0x2673('0x52'),_0x367d38[_0x2673('0x50')],_0x367d38[_0x2673('0x23')]);var _0x3176be={'method':_0x2673('0x37'),'uri':util[_0x2673('0x46')](_0x2673('0x53'),_0x367d38[_0x2673('0x50')]),'body':_0x35dbc5,'headers':{'Authorization':util[_0x2673('0x46')]('Basic\x20%s',new Buffer(_0xf2ba7a)[_0x2673('0x48')](_0x2673('0x49')))},'json':!![]};rp(_0x3176be)[_0x2673('0x1f')](function(_0x2068da){var _0x1b3536={'messageId':_0x2068da[_0x2673('0x54')][0x0]};return _0x1cde0f[_0x2673('0x18')](_0x1b3536);})[_0x2673('0x2a')](function(_0x5a240d){logger[_0x2673('0x1a')](_0x2673('0x2b'),'afterCreate','plivo',util['inspect'](_0x5a240d,{'showHidden':![],'depth':null}));});}else{logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),'plivo',_0x2673('0x55'));}break;case _0x2673('0x56'):if(_0x367d38[_0x2673('0x44')]&&_0x367d38[_0x2673('0x2f')]){if(_0x367d38[_0x2673('0x57')]){var _0x43fc74={'method':_0x2673('0x37'),'uri':_0x367d38[_0x2673('0x57')]+_0x2673('0x58'),'body':{'username':_0x367d38['username'],'password':_0x367d38[_0x2673('0x2f')]},'json':!![]};return rp(_0x43fc74)[_0x2673('0x1f')](function(_0x4e6252){var _0x172098={'method':_0x2673('0x37'),'uri':_0x367d38['baseUrl']+_0x2673('0x59'),'body':{'messages':[{'from':_0x367d38['phone'],'destinations':[{'to':_0x4380b9['phone']}],'text':_0x4380b9['body'],'notifyUrl':_0x367d38[_0x2673('0x26')]+_0x2673('0x27')+_0x4380b9['id']+_0x2673('0x28')+_0x367d38[_0x2673('0x51')],'notifyContentType':_0x2673('0x5a'),'callbackData':_0x367d38[_0x2673('0x24')]+';'+_0x4380b9['body']}]},'headers':{'Authorization':_0x2673('0x5b')+_0x4e6252['token']},'json':!![]};return rp(_0x172098)['then'](function(_0x4ed4d1){if(_0x4ed4d1[_0x2673('0x5c')]){var _0x301728={'messageId':_0x4ed4d1[_0x2673('0x5c')][0x0][_0x2673('0xb')]};if(!_0x367d38[_0x2673('0x40')]){_0x301728[_0x2673('0x41')]=!![];}return _0x1cde0f['update'](_0x301728);}else{return logger['error'](_0x2673('0x2b'),_0x2673('0x3c'),'infobip',util[_0x2673('0x3b')](_0x4ed4d1,{'showHidden':![],'depth':null}));}});})[_0x2673('0x2a')](function(_0x16d3e2){return logger[_0x2673('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2673('0x3c'),_0x2673('0x56'),util[_0x2673('0x3b')](_0x16d3e2,{'showHidden':![],'depth':null}));});}else{logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x56'),_0x2673('0x5d'));}}else{logger['error'](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x56'),_0x2673('0x3d'));}break;case _0x2673('0x5e'):var _0x3b90cf=require('crypto');if(_0x367d38['apiKey']){var _0x3cf629={};_0x3cf629[_0x2673('0x5f')]=_0x367d38[_0x2673('0x44')];_0x3cf629['phone']=_0x4380b9['phone'];_0x3cf629[_0x2673('0x31')]=_0x367d38[_0x2673('0x24')];_0x3cf629['text']=_0x4380b9[_0x2673('0xd')];_0x3cf629[_0x2673('0x60')]=+new Date();var _0x4aa4f4='';var _0xfcf80a='';var _0x18a662=Object[_0x2673('0x61')](_0x3cf629);_0x18a662[_0x2673('0x62')]();for(var _0x10dbe8=0x0;_0x10dbe8<_0x18a662['length'];_0x10dbe8++){if(_0x4aa4f4!=''){_0x4aa4f4+='&';}_0x4aa4f4+=_0x18a662[_0x10dbe8]+'='+encodeURIComponent(_0x3cf629[_0x18a662[_0x10dbe8]]);_0xfcf80a+=_0x3cf629[_0x18a662[_0x10dbe8]];}_0xfcf80a+=_0x367d38[_0x2673('0x63')];_0xfcf80a=_0x3b90cf[_0x2673('0x64')]('md5')[_0x2673('0x18')](_0xfcf80a)[_0x2673('0x65')](_0x2673('0x66'));if(_0x4aa4f4!==''){_0x4aa4f4+='&';}_0x4aa4f4+=_0x2673('0x67')+_0xfcf80a;var _0x48b821={'method':'GET','uri':_0x367d38['baseUrl']+_0x2673('0x68')+_0x4aa4f4,'json':!![]};return rp(_0x48b821)['then'](function(_0x12d802){var _0x1b0726=Object[_0x2673('0x61')](_0x12d802);if(_0x12d802[_0x1b0726[0x0]][_0x2673('0x1a')]&&parseInt(_0x12d802[_0x1b0726[0x0]][_0x2673('0x1a')])===0x0){var _0x291c9d={'messageId':_0x12d802[_0x1b0726[0x0]]['id_sms']};if(!_0x367d38[_0x2673('0x40')]){_0x291c9d[_0x2673('0x41')]=!![];}return _0x1cde0f['update'](_0x291c9d);}else{return logger[_0x2673('0x1a')](_0x2673('0x2b'),'afterCreate',_0x2673('0x5e'),util[_0x2673('0x3b')](_0x12d802[_0x2673('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x57e3f){return logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),'csc',util['inspect'](_0x57e3f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2673('0x2b'),'afterCreate',_0x2673('0x5e'),'Missing\x20parameters:\x20apiKey');}break;case _0x2673('0x69'):if(_0x367d38['apiKey']){var _0x3804e0={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x367d38[_0x2673('0x63')]},'body':{'content':_0x4380b9[_0x2673('0xd')],'to':[_0x4380b9[_0x2673('0x24')]],'from':_0x367d38[_0x2673('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0x2673('0x6a')},'json':!![]};rp(_0x3804e0)[_0x2673('0x1f')](function(_0x27a105){if(!_0x27a105[_0x2673('0x1a')]){var _0xe716d4={'messageId':_0x27a105[_0x2673('0x5c')][0x0][_0x2673('0x6b')]};if(!_0x367d38[_0x2673('0x40')]){_0xe716d4['read']=!![];}return _0x1cde0f['update'](_0xe716d4);}else{return logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x69'),util[_0x2673('0x3b')](_0x27a105['error'],{'showHidden':![],'depth':null}));}})[_0x2673('0x2a')](function(_0xb9d158){return logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x69'),util[_0x2673('0x3b')](_0xb9d158,{'showHidden':![],'depth':null}));});}else{logger[_0x2673('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2673('0x3c'),'clickatell',_0x2673('0x6c'));}break;case'bandwidth':if(_0x367d38[_0x2673('0x44')]&&_0x367d38[_0x2673('0x2f')]){var _0xf2ba7a=util[_0x2673('0x46')]('%s:%s',_0x367d38[_0x2673('0x44')],_0x367d38[_0x2673('0x2f')]);var _0x3176be={'method':_0x2673('0x37'),'uri':_0x2673('0x6d')+_0x367d38['accountId']+_0x2673('0x6e'),'body':{'to':[_0x4380b9[_0x2673('0x24')]],'text':_0x4380b9[_0x2673('0xd')],'from':_0x367d38['phone'],'applicationId':_0x367d38[_0x2673('0x6f')]},'headers':{'Authorization':util[_0x2673('0x46')](_0x2673('0x47'),new Buffer(_0xf2ba7a)['toString'](_0x2673('0x49')))},'json':!![]};rp(_0x3176be)[_0x2673('0x1f')](function(_0x11c740){if(_0x11c740['id']){var _0xbbaef2={'messageId':_0x11c740['id']};return _0x1cde0f[_0x2673('0x18')](_0xbbaef2);}else{logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x70'),util['inspect'](_0x11c740,{'showHidden':![],'depth':null}));}})[_0x2673('0x2a')](function(_0x28ada1){logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x70'),util[_0x2673('0x3b')](_0x28ada1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2673('0x3c'),_0x2673('0x70'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2673('0x71'):if(_0x367d38[_0x2673('0x63')]){var _0x2e0273={};var _0x48b821={'method':_0x2673('0x37'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x2673('0x72')+_0x367d38[_0x2673('0x63')],'Content-Type':_0x2673('0x5a')},'body':{'from':_0x367d38[_0x2673('0x24')],'to':_0x4380b9['phone'],'text':_0x4380b9[_0x2673('0xd')]},'json':!![]};return rp(_0x48b821)[_0x2673('0x1f')](function(_0x124dae){if(_0x124dae[_0x2673('0x73')]==0xca){_0x2e0273[_0x2673('0x74')]=_0x124dae;var _0x278332={'method':_0x2673('0x37'),'uri':_0x2673('0x75'),'headers':{'Authorization':_0x2673('0x72')+_0x367d38[_0x2673('0x63')],'Content-Type':_0x2673('0x5a')},'body':{'refid':_0x2e0273[_0x2673('0x74')][_0x2673('0x76')]},'json':!![]};return rp(_0x278332)[_0x2673('0x1f')](function(_0x1265f4){_0x2e0273[_0x2673('0x77')]=_0x1265f4;var _0x3f802f={'messageId':_0x2e0273[_0x2673('0x74')][_0x2673('0x76')],'read':!![]};return _0x1cde0f[_0x2673('0x18')](_0x3f802f);});}else{return logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),_0x2673('0x71'),util[_0x2673('0x3b')](_0x124dae,{'showHidden':![],'depth':null}));}})[_0x2673('0x2a')](function(_0x2d8a1c){return logger[_0x2673('0x1a')](_0x2673('0x2b'),_0x2673('0x3c'),'intelepeer',util[_0x2673('0x3b')](_0x2d8a1c,{'showHidden':![],'depth':null}));});}else{return logger[_0x2673('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',_0x2673('0x78'));}break;}}})[_0x2673('0x79')](function(){_0xd9759d();});}else{_0xd9759d();}}},'charset':_0x2673('0x7a'),'collate':_0x2673('0x7b')});};
\ No newline at end of file
+var _0x33a4=['signature=','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','intelepeer','Token\x20not\x20received','utf8mb4','util','api','moment','bluebird','../../config/environment','./smsMessage.attributes','exports','SmsMessage','messageId','fti_sms_messages','body','models','toLowerCase','direction','out','isNil','UserId','findOne','then','update','catch','error','SmsAccount','find','SmsAccountId','type','twilio','authToken','messages','create','phone','remote','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','sender','login?username=','username','&password=','password','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','read','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','senderString','deliveryReport','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','/api/sms/messages/','%s:%s','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','/status?token=','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','length','createHash','md5','digest','hex'];(function(_0x346c70,_0x1ef475){var _0x3d98f8=function(_0x1209c9){while(--_0x1209c9){_0x346c70['push'](_0x346c70['shift']());}};_0x3d98f8(++_0x1ef475);}(_0x33a4,0x88));var _0x433a=function(_0x16febf,_0x1d881f){_0x16febf=_0x16febf-0x0;var _0x33b2b4=_0x33a4[_0x16febf];return _0x33b2b4;};'use strict';var _=require('lodash');var util=require(_0x433a('0x0'));var logger=require('../../config/logger')(_0x433a('0x1'));var moment=require(_0x433a('0x2'));var BPromise=require(_0x433a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x433a('0x4'));var attributes=require(_0x433a('0x5'));module[_0x433a('0x6')]=function(_0x60b6b3,_0x1b6f5a){return _0x60b6b3['define'](_0x433a('0x7'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x433a('0x8'),'fields':[_0x433a('0x8')]},{'name':_0x433a('0x9'),'fields':[_0x433a('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ac437,_0x3e52a0,_0x12db5c){var _0x19a533=_0x60b6b3[_0x433a('0xb')];var _0x3ba384=_0x4ac437['get']({'plain':!![]});if(_0x3ba384['direction'][_0x433a('0xc')]()==='in'||_0x3ba384[_0x433a('0xd')][_0x433a('0xc')]()===_0x433a('0xe')&&!_0x3ba384['secret']&&!_[_0x433a('0xf')](_0x3ba384[_0x433a('0x10')])){_0x19a533['SmsInteraction'][_0x433a('0x11')]({'where':{'id':_0x3ba384['SmsInteractionId']}})[_0x433a('0x12')](function(_0x1f6cee){if(_0x1f6cee){_0x1f6cee[_0x433a('0x13')]({'lastMsgAt':_0x3ba384['createdAt'],'lastMsgDirection':_0x3ba384['direction'][_0x433a('0xc')]()});}})[_0x433a('0x14')](function(_0x35ebaf){console[_0x433a('0x15')](_0x35ebaf);});}if(_0x3ba384[_0x433a('0xd')]==='out'&&!_0x3ba384['secret']){var _0x2f6a70;_0x19a533[_0x433a('0x16')][_0x433a('0x17')]({'where':{'id':_0x3ba384[_0x433a('0x18')]},'raw':!![]})[_0x433a('0x12')](function(_0xfcdced){_0x2f6a70=_0xfcdced;if(_0x2f6a70&&_0x2f6a70[_0x433a('0x19')]){switch(_0x2f6a70[_0x433a('0x19')]){case _0x433a('0x1a'):var _0x3da3c4=require(_0x433a('0x1a'));if(_0x2f6a70['accountSid']&&_0x2f6a70[_0x433a('0x1b')]&&_0x2f6a70['phone']){var _0x2f16a8=new _0x3da3c4(_0x2f6a70['accountSid'],_0x2f6a70[_0x433a('0x1b')]);_0x2f16a8[_0x433a('0x1c')][_0x433a('0x1d')]({'body':_0x3ba384[_0x433a('0xa')],'to':_0x3ba384[_0x433a('0x1e')],'from':_0x2f6a70[_0x433a('0x1e')],'statusCallback':_0x2f6a70[_0x433a('0x1f')]+'/api/sms/messages/'+_0x3ba384['id']+'/status?token='+_0x2f6a70[_0x433a('0x20')]})['then'](function(_0x326785){if(_0x326785['sid']){return _0x4ac437[_0x433a('0x13')]({'messageId':_0x326785[_0x433a('0x21')]});}})[_0x433a('0x14')](function(_0x3ef4ab){logger[_0x433a('0x15')](_0x433a('0x22'),'afterCreate',_0x433a('0x1a'),util[_0x433a('0x23')](_0x3ef4ab,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x433a('0x22'),'afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x433a('0x24'):var _0x4fcecc=_0x433a('0x25');if(_0x2f6a70['username']&&_0x2f6a70['password']){var _0x46e452={'recipient':[_0x3ba384[_0x433a('0x1e')]],'message':_0x3ba384[_0x433a('0xa')],'message_type':_0x2f6a70['smsMethod']};if(_0x2f6a70[_0x433a('0x26')]&&_0x2f6a70[_0x433a('0x26')]!=='SI'){_0x46e452[_0x433a('0x27')]=_0x2f6a70['phone'];}var _0x210494={'url':_0x4fcecc+_0x433a('0x28')+_0x2f6a70[_0x433a('0x29')]+_0x433a('0x2a')+_0x2f6a70[_0x433a('0x2b')],'method':_0x433a('0x2c')};rp(_0x210494)[_0x433a('0x12')](function(_0x1fd322){var _0x3b6a19=_0x1fd322['split'](';');var _0x3c84cb={'user_key':_0x3b6a19[0x0],'session_key':_0x3b6a19[0x1]};_0x210494={'url':_0x4fcecc+_0x433a('0x2d'),'method':_0x433a('0x2e'),'headers':{'user_key':_0x3c84cb[_0x433a('0x2f')],'Session_key':_0x3c84cb[_0x433a('0x30')]},'json':!![],'body':_0x46e452};return rp(_0x210494);})[_0x433a('0x12')](function(_0x29fd7f){if(_0x29fd7f[_0x433a('0x31')]>=0x1){var _0x102f13={'messageId':_0x29fd7f[_0x433a('0x32')]};if(_0x2f6a70[_0x433a('0x26')]!=='GP'||!_0x2f6a70['deliveryReport']){_0x102f13[_0x433a('0x33')]=!![];}return _0x4ac437[_0x433a('0x13')](_0x102f13);}else{return logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x24'),util[_0x433a('0x23')](_0x29fd7f,{'showHidden':![],'depth':null}));}})[_0x433a('0x14')](function(_0x1756d2){return logger[_0x433a('0x15')](_0x433a('0x22'),'afterCreate',_0x433a('0x24'),util[_0x433a('0x23')](_0x1756d2,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x433a('0x34'),'skebby',_0x433a('0x35'));}break;case _0x433a('0x36'):if(_0x2f6a70[_0x433a('0x1b')]){var _0xbb9531={'recipient':_0x3ba384['phone'],'message':_0x3ba384[_0x433a('0xa')],'sender':_0x2f6a70[_0x433a('0x37')]||_0x2f6a70[_0x433a('0x1e')],'authorization':_0x2f6a70[_0x433a('0x1b')]};var _0x3e52a0={'method':_0x433a('0x2e'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0xbb9531,'json':!![]};rp(_0x3e52a0)['then'](function(_0x1989c0){var _0x16ce14={'messageId':_0x1989c0['requestid']};if(!_0x2f6a70[_0x433a('0x38')]){_0x16ce14[_0x433a('0x33')]=!![];}return _0x4ac437[_0x433a('0x13')](_0x16ce14);})[_0x433a('0x14')](function(_0x3b4ec4){logger[_0x433a('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x433a('0x34'),_0x433a('0x36'),util[_0x433a('0x23')](_0x3b4ec4,{'showHidden':![],'depth':null}));});}else{logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x36'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x2f6a70[_0x433a('0x29')]&&_0x2f6a70[_0x433a('0x2b')]){var _0xbb9531={'messages':[{'source':'xCALLY\x20Motion','to':_0x3ba384[_0x433a('0x1e')],'body':_0x3ba384['body'],'from':_0x2f6a70[_0x433a('0x37')]||_0x2f6a70[_0x433a('0x1e')]}]};var _0x81b67f=util[_0x433a('0x39')]('%s:%s',_0x2f6a70[_0x433a('0x29')],_0x2f6a70[_0x433a('0x2b')]);var _0x3e52a0={'method':_0x433a('0x2e'),'uri':_0x433a('0x3a'),'body':_0xbb9531,'headers':{'Authorization':util[_0x433a('0x39')](_0x433a('0x3b'),new Buffer(_0x81b67f)['toString'](_0x433a('0x3c')))},'json':!![]};rp(_0x3e52a0)[_0x433a('0x12')](function(_0x1b56b1){if(_0x1b56b1[_0x433a('0x3d')]>=0xc8&&_0x1b56b1[_0x433a('0x3d')]<=0xce){if(_0x1b56b1[_0x433a('0x3e')]&&_0x1b56b1[_0x433a('0x3e')][_0x433a('0x3f')]>0x0){var _0x20f1eb=_['head'](_0x1b56b1[_0x433a('0x3e')][_0x433a('0x1c')]);var _0x31d62c={'messageId':_0x20f1eb[_0x433a('0x40')]};if(!_0x2f6a70['deliveryReport']){_0x31d62c[_0x433a('0x33')]=!![];}return _0x4ac437[_0x433a('0x13')](_0x31d62c);}else{logger[_0x433a('0x15')](_0x433a('0x22'),'afterCreate','clickSend',util[_0x433a('0x23')](_0x1b56b1,{'showHidden':![],'depth':null}));}}else{logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x41'),util[_0x433a('0x23')](_0x1b56b1,{'showHidden':![],'depth':null}));}})[_0x433a('0x14')](function(_0x3254c8){logger[_0x433a('0x15')](_0x433a('0x22'),'afterCreate',_0x433a('0x41'),util[_0x433a('0x23')](_0x3254c8,{'showHidden':![],'depth':null}));});}else{logger[_0x433a('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x433a('0x41'),_0x433a('0x35'));}break;case _0x433a('0x42'):if(_0x2f6a70[_0x433a('0x43')]&&_0x2f6a70[_0x433a('0x1b')]){var _0xbb9531={'dst':_0x3ba384['phone'],'text':_0x3ba384[_0x433a('0xa')],'src':_0x2f6a70[_0x433a('0x37')]||_0x2f6a70[_0x433a('0x1e')],'url':_0x2f6a70[_0x433a('0x1f')]+_0x433a('0x44')+_0x3ba384['id']+'/status?token='+_0x2f6a70[_0x433a('0x20')]};var _0x81b67f=util[_0x433a('0x39')](_0x433a('0x45'),_0x2f6a70[_0x433a('0x43')],_0x2f6a70['authToken']);var _0x3e52a0={'method':_0x433a('0x2e'),'uri':util[_0x433a('0x39')]('https://api.plivo.com/v1/Account/%s/Message/',_0x2f6a70[_0x433a('0x43')]),'body':_0xbb9531,'headers':{'Authorization':util['format'](_0x433a('0x3b'),new Buffer(_0x81b67f)[_0x433a('0x46')]('base64'))},'json':!![]};rp(_0x3e52a0)['then'](function(_0x3e447b){var _0x2efeb7={'messageId':_0x3e447b[_0x433a('0x47')][0x0]};return _0x4ac437[_0x433a('0x13')](_0x2efeb7);})[_0x433a('0x14')](function(_0xcc313b){logger[_0x433a('0x15')](_0x433a('0x22'),'afterCreate',_0x433a('0x42'),util['inspect'](_0xcc313b,{'showHidden':![],'depth':null}));});}else{logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),'plivo',_0x433a('0x48'));}break;case _0x433a('0x49'):if(_0x2f6a70[_0x433a('0x29')]&&_0x2f6a70[_0x433a('0x2b')]){if(_0x2f6a70[_0x433a('0x4a')]){var _0x4c3914={'method':_0x433a('0x2e'),'uri':_0x2f6a70[_0x433a('0x4a')]+'/auth/1/session','body':{'username':_0x2f6a70[_0x433a('0x29')],'password':_0x2f6a70[_0x433a('0x2b')]},'json':!![]};return rp(_0x4c3914)[_0x433a('0x12')](function(_0x57ecb5){var _0x1117be={'method':_0x433a('0x2e'),'uri':_0x2f6a70[_0x433a('0x4a')]+_0x433a('0x4b'),'body':{'messages':[{'from':_0x2f6a70[_0x433a('0x1e')],'destinations':[{'to':_0x3ba384['phone']}],'text':_0x3ba384['body'],'notifyUrl':_0x2f6a70[_0x433a('0x1f')]+_0x433a('0x44')+_0x3ba384['id']+_0x433a('0x4c')+_0x2f6a70[_0x433a('0x20')],'notifyContentType':_0x433a('0x4d'),'callbackData':_0x2f6a70[_0x433a('0x1e')]+';'+_0x3ba384[_0x433a('0xa')]}]},'headers':{'Authorization':_0x433a('0x4e')+_0x57ecb5[_0x433a('0x20')]},'json':!![]};return rp(_0x1117be)[_0x433a('0x12')](function(_0x55b646){if(_0x55b646[_0x433a('0x1c')]){var _0x58c581={'messageId':_0x55b646[_0x433a('0x1c')][0x0][_0x433a('0x8')]};if(!_0x2f6a70[_0x433a('0x38')]){_0x58c581[_0x433a('0x33')]=!![];}return _0x4ac437[_0x433a('0x13')](_0x58c581);}else{return logger[_0x433a('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x433a('0x34'),_0x433a('0x49'),util[_0x433a('0x23')](_0x55b646,{'showHidden':![],'depth':null}));}});})[_0x433a('0x14')](function(_0x5695a2){return logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x49'),util[_0x433a('0x23')](_0x5695a2,{'showHidden':![],'depth':null}));});}else{logger[_0x433a('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x433a('0x34'),'infobip',_0x433a('0x4f'));}}else{logger['error'](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x49'),_0x433a('0x35'));}break;case _0x433a('0x50'):var _0x251b55=require(_0x433a('0x51'));if(_0x2f6a70[_0x433a('0x52')]){var _0x5581d2={};_0x5581d2[_0x433a('0x53')]=_0x2f6a70[_0x433a('0x29')];_0x5581d2['phone']=_0x3ba384[_0x433a('0x1e')];_0x5581d2[_0x433a('0x27')]=_0x2f6a70['phone'];_0x5581d2[_0x433a('0x54')]=_0x3ba384[_0x433a('0xa')];_0x5581d2[_0x433a('0x55')]=+new Date();var _0x26964d='';var _0x3c9721='';var _0x192c9e=Object[_0x433a('0x56')](_0x5581d2);_0x192c9e['sort']();for(var _0x2c6b5b=0x0;_0x2c6b5b<_0x192c9e[_0x433a('0x57')];_0x2c6b5b++){if(_0x26964d!=''){_0x26964d+='&';}_0x26964d+=_0x192c9e[_0x2c6b5b]+'='+encodeURIComponent(_0x5581d2[_0x192c9e[_0x2c6b5b]]);_0x3c9721+=_0x5581d2[_0x192c9e[_0x2c6b5b]];}_0x3c9721+=_0x2f6a70[_0x433a('0x52')];_0x3c9721=_0x251b55[_0x433a('0x58')](_0x433a('0x59'))['update'](_0x3c9721)[_0x433a('0x5a')](_0x433a('0x5b'));if(_0x26964d!==''){_0x26964d+='&';}_0x26964d+=_0x433a('0x5c')+_0x3c9721;var _0x210494={'method':'GET','uri':_0x2f6a70[_0x433a('0x4a')]+_0x433a('0x5d')+_0x26964d,'json':!![]};return rp(_0x210494)['then'](function(_0x30f16c){var _0x12e41e=Object[_0x433a('0x56')](_0x30f16c);if(_0x30f16c[_0x12e41e[0x0]][_0x433a('0x15')]&&parseInt(_0x30f16c[_0x12e41e[0x0]][_0x433a('0x15')])===0x0){var _0x1e553c={'messageId':_0x30f16c[_0x12e41e[0x0]][_0x433a('0x5e')]};if(!_0x2f6a70[_0x433a('0x38')]){_0x1e553c[_0x433a('0x33')]=!![];}return _0x4ac437[_0x433a('0x13')](_0x1e553c);}else{return logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),'csc',util['inspect'](_0x30f16c[_0x433a('0x15')],{'showHidden':![],'depth':null}));}})[_0x433a('0x14')](function(_0x7a2b0){return logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x50'),util[_0x433a('0x23')](_0x7a2b0,{'showHidden':![],'depth':null}));});}else{logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x50'),'Missing\x20parameters:\x20apiKey');}break;case _0x433a('0x5f'):if(_0x2f6a70[_0x433a('0x52')]){var _0x20b7ff={'method':'POST','uri':_0x433a('0x60'),'headers':{'Authorization':_0x2f6a70[_0x433a('0x52')]},'body':{'content':_0x3ba384[_0x433a('0xa')],'to':[_0x3ba384[_0x433a('0x1e')]],'from':_0x2f6a70[_0x433a('0x1e')],'binary':![],'clientMessageId':_0x433a('0x61'),'charset':_0x433a('0x62')},'json':!![]};rp(_0x20b7ff)[_0x433a('0x12')](function(_0x168386){if(!_0x168386[_0x433a('0x15')]){var _0x2e7093={'messageId':_0x168386[_0x433a('0x1c')][0x0][_0x433a('0x63')]};if(!_0x2f6a70[_0x433a('0x38')]){_0x2e7093[_0x433a('0x33')]=!![];}return _0x4ac437[_0x433a('0x13')](_0x2e7093);}else{return logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x5f'),util[_0x433a('0x23')](_0x168386[_0x433a('0x15')],{'showHidden':![],'depth':null}));}})[_0x433a('0x14')](function(_0x3b94bf){return logger[_0x433a('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x433a('0x34'),_0x433a('0x5f'),util['inspect'](_0x3b94bf,{'showHidden':![],'depth':null}));});}else{logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x5f'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x2f6a70[_0x433a('0x29')]&&_0x2f6a70[_0x433a('0x2b')]){var _0x81b67f=util[_0x433a('0x39')]('%s:%s',_0x2f6a70['username'],_0x2f6a70[_0x433a('0x2b')]);var _0x3e52a0={'method':'POST','uri':_0x433a('0x64')+_0x2f6a70[_0x433a('0x65')]+_0x433a('0x66'),'body':{'to':[_0x3ba384[_0x433a('0x1e')]],'text':_0x3ba384[_0x433a('0xa')],'from':_0x2f6a70[_0x433a('0x1e')],'applicationId':_0x2f6a70[_0x433a('0x67')]},'headers':{'Authorization':util[_0x433a('0x39')](_0x433a('0x3b'),new Buffer(_0x81b67f)[_0x433a('0x46')]('base64'))},'json':!![]};rp(_0x3e52a0)[_0x433a('0x12')](function(_0xe6abea){if(_0xe6abea['id']){var _0x399dd1={'messageId':_0xe6abea['id']};return _0x4ac437[_0x433a('0x13')](_0x399dd1);}else{logger[_0x433a('0x15')](_0x433a('0x22'),'afterCreate',_0x433a('0x68'),util[_0x433a('0x23')](_0xe6abea,{'showHidden':![],'depth':null}));}})[_0x433a('0x14')](function(_0x7b4ea9){logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x68'),util[_0x433a('0x23')](_0x7b4ea9,{'showHidden':![],'depth':null}));});}else{logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x68'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x2f6a70[_0x433a('0x52')]){var _0xbbdd60={};var _0x210494={'method':_0x433a('0x2e'),'uri':_0x433a('0x69'),'headers':{'Authorization':_0x433a('0x6a')+_0x2f6a70['apiKey'],'Content-Type':_0x433a('0x4d')},'body':{'from':_0x2f6a70[_0x433a('0x1e')],'to':_0x3ba384[_0x433a('0x1e')],'text':_0x3ba384[_0x433a('0xa')]},'json':!![]};return rp(_0x210494)[_0x433a('0x12')](function(_0xe20ed1){if(_0xe20ed1[_0x433a('0x6b')]==0xca){_0xbbdd60[_0x433a('0x6c')]=_0xe20ed1;var _0x21abe7={'method':_0x433a('0x2e'),'uri':_0x433a('0x6d'),'headers':{'Authorization':_0x433a('0x6a')+_0x2f6a70[_0x433a('0x52')],'Content-Type':'application/json'},'body':{'refid':_0xbbdd60[_0x433a('0x6c')]['refid']},'json':!![]};return rp(_0x21abe7)['then'](function(_0x5bb814){_0xbbdd60['status']=_0x5bb814;var _0x59d9d0={'messageId':_0xbbdd60[_0x433a('0x6c')][_0x433a('0x6e')],'read':!![]};return _0x4ac437[_0x433a('0x13')](_0x59d9d0);});}else{return logger[_0x433a('0x15')](_0x433a('0x22'),'afterCreate',_0x433a('0x6f'),util[_0x433a('0x23')](_0xe20ed1,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5799db){return logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x6f'),util[_0x433a('0x23')](_0x5799db,{'showHidden':![],'depth':null}));});}else{return logger[_0x433a('0x15')](_0x433a('0x22'),_0x433a('0x34'),_0x433a('0x6f'),_0x433a('0x70'));}break;}}})['finally'](function(){_0x12db5c();});}else{_0x12db5c();}}},'charset':_0x433a('0x71'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 029cb58..c9ab433 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1489=['socket.io-emitter','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1489,0x1a6));var _0x9148=function(_0x42f50b,_0x3d5fa7){_0x42f50b=_0x42f50b-0x0;var _0x454ece=_0x1489[_0x42f50b];return _0x454ece;};'use strict';var _=require(_0x9148('0x0'));var util=require('util');var moment=require(_0x9148('0x1'));var BPromise=require(_0x9148('0x2'));var rs=require(_0x9148('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9148('0x4'));var logger=require(_0x9148('0x5'))(_0x9148('0x6'));var config=require('../../config/environment');var jayson=require(_0x9148('0x7'));var client=jayson['client'][_0x9148('0x8')]({'port':0x232a});config[_0x9148('0x9')]=_[_0x9148('0xa')](config['redis'],{'host':_0x9148('0xb'),'port':0x18eb});var socket=require(_0x9148('0xc'))(new Redis(config[_0x9148('0x9')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x422ba6,_0x3c9917,_0x5897db){return new BPromise(function(_0x357a3d,_0x4ec496){return client[_0x9148('0xd')](_0x422ba6,_0x5897db)[_0x9148('0xe')](function(_0x2a0ea7){logger[_0x9148('0xf')](_0x9148('0x10'),_0x3c9917,_0x9148('0x11'));logger[_0x9148('0x12')](_0x9148('0x13'),_0x3c9917,_0x9148('0x11'),JSON[_0x9148('0x14')](_0x2a0ea7));if(_0x2a0ea7[_0x9148('0x15')]){if(_0x2a0ea7[_0x9148('0x15')][_0x9148('0x16')]===0x1f4){logger[_0x9148('0x15')](_0x9148('0x10'),_0x3c9917,_0x2a0ea7['error'][_0x9148('0x17')]);return _0x4ec496(_0x2a0ea7['error'][_0x9148('0x17')]);}logger[_0x9148('0x15')]('SmsMessage,\x20%s,\x20%s',_0x3c9917,_0x2a0ea7[_0x9148('0x15')][_0x9148('0x17')]);return _0x357a3d(_0x2a0ea7[_0x9148('0x15')][_0x9148('0x17')]);}else{logger[_0x9148('0xf')](_0x9148('0x10'),_0x3c9917,_0x9148('0x11'));_0x357a3d(_0x2a0ea7[_0x9148('0x18')][_0x9148('0x17')]);}})[_0x9148('0x19')](function(_0x13902c){logger[_0x9148('0x15')](_0x9148('0x10'),_0x3c9917,_0x13902c);_0x4ec496(_0x13902c);});});}exports[_0x9148('0x1a')]=function(_0x46734b){var _0x537025=this;return new Promise(function(_0x4e48d6,_0x3317c6){return db['SmsMessage'][_0x9148('0x1b')](_0x46734b[_0x9148('0x1c')],{'raw':_0x46734b['options']?_0x46734b[_0x9148('0x1d')][_0x9148('0x1e')]===undefined?!![]:![]:!![]})[_0x9148('0xe')](function(_0x4009b7){logger[_0x9148('0xf')](_0x9148('0x1a'),_0x46734b);logger['debug'](_0x9148('0x1a'),_0x46734b,JSON['stringify'](_0x4009b7));_0x4e48d6(_0x4009b7);})[_0x9148('0x19')](function(_0x169d2e){logger['error']('CreateSmsMessage',_0x169d2e[_0x9148('0x17')],_0x46734b);_0x3317c6(_0x537025['error'](0x1f4,_0x169d2e[_0x9148('0x17')]));});});};
\ No newline at end of file
+var _0xba41=['error','code','message','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a5ba4,_0x790f53){var _0x37a886=function(_0x46d536){while(--_0x46d536){_0x3a5ba4['push'](_0x3a5ba4['shift']());}};_0x37a886(++_0x790f53);}(_0xba41,0x71));var _0x1ba4=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xba41[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x1ba4('0x0'));var util=require(_0x1ba4('0x1'));var moment=require(_0x1ba4('0x2'));var BPromise=require(_0x1ba4('0x3'));var rs=require(_0x1ba4('0x4'));var fs=require('fs');var Redis=require(_0x1ba4('0x5'));var db=require(_0x1ba4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ba4('0x7'))(_0x1ba4('0x8'));var config=require(_0x1ba4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1ba4('0xa')][_0x1ba4('0xb')]({'port':0x232a});config[_0x1ba4('0xc')]=_[_0x1ba4('0xd')](config[_0x1ba4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ba4('0xe'))(new Redis(config[_0x1ba4('0xc')]));require(_0x1ba4('0xf'))[_0x1ba4('0x10')](socket);function respondWithRpcPromise(_0x195dd1,_0x42a453,_0x398b44){return new BPromise(function(_0x5330b8,_0x5bb217){return client['request'](_0x195dd1,_0x398b44)['then'](function(_0x50ded8){logger[_0x1ba4('0x11')](_0x1ba4('0x12'),_0x42a453,_0x1ba4('0x13'));logger[_0x1ba4('0x14')](_0x1ba4('0x15'),_0x42a453,'request\x20sent',JSON[_0x1ba4('0x16')](_0x50ded8));if(_0x50ded8[_0x1ba4('0x17')]){if(_0x50ded8['error'][_0x1ba4('0x18')]===0x1f4){logger['error'](_0x1ba4('0x12'),_0x42a453,_0x50ded8[_0x1ba4('0x17')][_0x1ba4('0x19')]);return _0x5bb217(_0x50ded8[_0x1ba4('0x17')][_0x1ba4('0x19')]);}logger[_0x1ba4('0x17')](_0x1ba4('0x12'),_0x42a453,_0x50ded8[_0x1ba4('0x17')][_0x1ba4('0x19')]);return _0x5330b8(_0x50ded8[_0x1ba4('0x17')][_0x1ba4('0x19')]);}else{logger[_0x1ba4('0x11')]('SmsMessage,\x20%s,\x20%s',_0x42a453,_0x1ba4('0x13'));_0x5330b8(_0x50ded8['result'][_0x1ba4('0x19')]);}})[_0x1ba4('0x1a')](function(_0xb64f1c){logger[_0x1ba4('0x17')](_0x1ba4('0x12'),_0x42a453,_0xb64f1c);_0x5bb217(_0xb64f1c);});});}exports[_0x1ba4('0x1b')]=function(_0x3d91ec){var _0x5e9b0d=this;return new Promise(function(_0x143707,_0x2fa780){return db[_0x1ba4('0x1c')][_0x1ba4('0x1d')](_0x3d91ec[_0x1ba4('0x1e')],{'raw':_0x3d91ec[_0x1ba4('0x1f')]?_0x3d91ec[_0x1ba4('0x1f')][_0x1ba4('0x20')]===undefined?!![]:![]:!![]})[_0x1ba4('0x21')](function(_0x1a2b97){logger['info'](_0x1ba4('0x1b'),_0x3d91ec);logger['debug'](_0x1ba4('0x1b'),_0x3d91ec,JSON[_0x1ba4('0x16')](_0x1a2b97));_0x143707(_0x1a2b97);})['catch'](function(_0x232c40){logger[_0x1ba4('0x17')](_0x1ba4('0x1b'),_0x232c40['message'],_0x3d91ec);_0x2fa780(_0x5e9b0d[_0x1ba4('0x17')](0x1f4,_0x232c40[_0x1ba4('0x19')]));});});};
\ No newline at end of file
index 520fe7a..c7faf93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfe3=['emit','removeListener','length','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x182455,_0x22d90d){var _0xd3508a=function(_0x4557de){while(--_0x4557de){_0x182455['push'](_0x182455['shift']());}};_0xd3508a(++_0x22d90d);}(_0xcfe3,0x1ac));var _0x3cfe=function(_0x1ea54b,_0x50ace4){_0x1ea54b=_0x1ea54b-0x0;var _0x5c1572=_0xcfe3[_0x1ea54b];return _0x5c1572;};'use strict';var SmsMessageEvents=require(_0x3cfe('0x0'));var events=[_0x3cfe('0x1'),_0x3cfe('0x2'),_0x3cfe('0x3')];function createListener(_0x1687ef,_0x3a5a8c){return function(_0x4d7a38){_0x3a5a8c[_0x3cfe('0x4')](_0x1687ef,_0x4d7a38);};}function removeListener(_0x1ae73d,_0x17cfc8){return function(){SmsMessageEvents[_0x3cfe('0x5')](_0x1ae73d,_0x17cfc8);};}exports['register']=function(_0x440312){for(var _0x390eea=0x0,_0x263759=events[_0x3cfe('0x6')];_0x390eea<_0x263759;_0x390eea++){var _0x454f8d=events[_0x390eea];var _0x5137e1=createListener(_0x3cfe('0x7')+_0x454f8d,_0x440312);SmsMessageEvents['on'](_0x454f8d,_0x5137e1);}};
\ No newline at end of file
+var _0x8dc0=['length','./smsMessage.events','remove','emit','removeListener'];(function(_0x44f0a1,_0x457d11){var _0x4af42e=function(_0x15fcbf){while(--_0x15fcbf){_0x44f0a1['push'](_0x44f0a1['shift']());}};_0x4af42e(++_0x457d11);}(_0x8dc0,0xf6));var _0x08dc=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0x8dc0[_0x1428d9];return _0x438019;};'use strict';var SmsMessageEvents=require(_0x08dc('0x0'));var events=['save',_0x08dc('0x1'),'update'];function createListener(_0x5ae82f,_0x18f070){return function(_0x2e67bc){_0x18f070[_0x08dc('0x2')](_0x5ae82f,_0x2e67bc);};}function removeListener(_0x16610d,_0x3338d9){return function(){SmsMessageEvents[_0x08dc('0x3')](_0x16610d,_0x3338d9);};}exports['register']=function(_0x4cf9ee){for(var _0x4dd4b6=0x0,_0x36ec1e=events[_0x08dc('0x4')];_0x4dd4b6<_0x36ec1e;_0x4dd4b6++){var _0x2f6264=events[_0x4dd4b6];var _0x5b2cf3=createListener('smsMessage:'+_0x2f6264,_0x4cf9ee);SmsMessageEvents['on'](_0x2f6264,_0x5b2cf3);}};
\ No newline at end of file
index 3770d0f..326b4ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb67a=['/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index'];(function(_0x3f465d,_0xbd2037){var _0x121ad1=function(_0x5b13d6){while(--_0x5b13d6){_0x3f465d['push'](_0x3f465d['shift']());}};_0x121ad1(++_0xbd2037);}(_0xb67a,0x148));var _0xab67=function(_0x3c1891,_0x154204){_0x3c1891=_0x3c1891-0x0;var _0x26d46f=_0xb67a[_0x3c1891];return _0x26d46f;};'use strict';var multer=require(_0xab67('0x0'));var util=require('util');var path=require(_0xab67('0x1'));var timeout=require(_0xab67('0x2'));var express=require(_0xab67('0x3'));var router=express[_0xab67('0x4')]();var fs_extra=require(_0xab67('0x5'));var auth=require(_0xab67('0x6'));var interaction=require(_0xab67('0x7'));var config=require(_0xab67('0x8'));var controller=require(_0xab67('0x9'));router[_0xab67('0xa')]('/',auth[_0xab67('0xb')](),controller[_0xab67('0xc')]);router['get'](_0xab67('0xd'),auth[_0xab67('0xb')](),controller[_0xab67('0xe')]);router[_0xab67('0xa')](_0xab67('0xf'),auth[_0xab67('0xb')](),controller[_0xab67('0x10')]);router['get'](_0xab67('0x11'),auth[_0xab67('0xb')](),controller[_0xab67('0x12')]);router[_0xab67('0xa')](_0xab67('0x13'),auth[_0xab67('0xb')](),controller[_0xab67('0x14')]);router[_0xab67('0xa')](_0xab67('0x15'),auth[_0xab67('0xb')](),controller[_0xab67('0x16')]);router[_0xab67('0x17')]('/',auth[_0xab67('0xb')](),controller[_0xab67('0x18')]);router['post'](_0xab67('0x13'),auth[_0xab67('0xb')](),controller[_0xab67('0x19')]);router[_0xab67('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xab67('0x1a')]);router[_0xab67('0x1b')](_0xab67('0xf'),auth['isAuthenticated'](),controller[_0xab67('0x1c')]);router['delete'](_0xab67('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0xab67('0x1d')](_0xab67('0x13'),auth[_0xab67('0xb')](),controller[_0xab67('0x1e')]);router[_0xab67('0x1d')](_0xab67('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xbb07=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','index','/describe','isAuthenticated','/:id','get','getMembers','getTeams','/:id/users','post','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x4d4d79,_0x11657d){var _0x1c1fe0=function(_0x34541d){while(--_0x34541d){_0x4d4d79['push'](_0x4d4d79['shift']());}};_0x1c1fe0(++_0x11657d);}(_0xbb07,0x166));var _0x7bb0=function(_0x5a31f7,_0x2dca9c){_0x5a31f7=_0x5a31f7-0x0;var _0x46f6e2=_0xbb07[_0x5a31f7];return _0x46f6e2;};'use strict';var multer=require(_0x7bb0('0x0'));var util=require(_0x7bb0('0x1'));var path=require('path');var timeout=require(_0x7bb0('0x2'));var express=require(_0x7bb0('0x3'));var router=express[_0x7bb0('0x4')]();var fs_extra=require(_0x7bb0('0x5'));var auth=require(_0x7bb0('0x6'));var interaction=require(_0x7bb0('0x7'));var config=require(_0x7bb0('0x8'));var controller=require(_0x7bb0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bb0('0xa')]);router['get'](_0x7bb0('0xb'),auth[_0x7bb0('0xc')](),controller['describe']);router['get'](_0x7bb0('0xd'),auth[_0x7bb0('0xc')](),controller['show']);router[_0x7bb0('0xe')]('/:id/members',auth['isAuthenticated'](),controller[_0x7bb0('0xf')]);router[_0x7bb0('0xe')]('/:id/teams',auth[_0x7bb0('0xc')](),controller[_0x7bb0('0x10')]);router[_0x7bb0('0xe')](_0x7bb0('0x11'),auth[_0x7bb0('0xc')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7bb0('0x12')]('/:id/teams',auth[_0x7bb0('0xc')](),controller['addTeams']);router[_0x7bb0('0x12')]('/:id/users',auth[_0x7bb0('0xc')](),controller[_0x7bb0('0x13')]);router[_0x7bb0('0x14')](_0x7bb0('0xd'),auth[_0x7bb0('0xc')](),controller[_0x7bb0('0x15')]);router[_0x7bb0('0x16')](_0x7bb0('0xd'),auth[_0x7bb0('0xc')](),controller[_0x7bb0('0x17')]);router['delete'](_0x7bb0('0x18'),auth[_0x7bb0('0xc')](),controller[_0x7bb0('0x19')]);router[_0x7bb0('0x16')](_0x7bb0('0x11'),auth[_0x7bb0('0xc')](),controller[_0x7bb0('0x1a')]);module[_0x7bb0('0x1b')]=router;
\ No newline at end of file
index 550f95c..60af532 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf709=['sequelize','STRING','name','ENUM','rrmemory','roundrobin'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xf709,0x1aa));var _0x9f70=function(_0xc6a343,_0x51d0cc){_0xc6a343=_0xc6a343-0x0;var _0x41ac73=_0xf709[_0xc6a343];return _0x41ac73;};'use strict';var Sequelize=require(_0x9f70('0x0'));module['exports']={'name':{'type':Sequelize[_0x9f70('0x1')],'unique':_0x9f70('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9f70('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9f70('0x3')](_0x9f70('0x4'),'beepall',_0x9f70('0x5'))}};
\ No newline at end of file
+var _0x5b61=['roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x267061,_0x32a508){var _0x108f7c=function(_0x642d){while(--_0x642d){_0x267061['push'](_0x267061['shift']());}};_0x108f7c(++_0x32a508);}(_0x5b61,0x151));var _0x15b6=function(_0x318256,_0xa773f3){_0x318256=_0x318256-0x0;var _0xb1e352=_0x5b61[_0x318256];return _0xb1e352;};'use strict';var Sequelize=require(_0x15b6('0x0'));module[_0x15b6('0x1')]={'name':{'type':Sequelize[_0x15b6('0x2')],'unique':_0x15b6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x15b6('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x15b6('0x4')](_0x15b6('0x5'),_0x15b6('0x6'),_0x15b6('0x7'))}};
\ No newline at end of file
index 1b92c94..41280db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c1d=['../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','SmsQueues','UserProfileResource','destroy','error','stack','send','map','SmsQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','rows','format','%s/%s','SIP','getTeams','findOne','ids','Team','Agents','online','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','removeAgents','addAgents','omit','spread','userSmsQueue:save','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','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','api','../../config/utils'];(function(_0x6ca7f4,_0x51a5df){var _0x494fa6=function(_0x359532){while(--_0x359532){_0x6ca7f4['push'](_0x6ca7f4['shift']());}};_0x494fa6(++_0x51a5df);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x5d8eb4,_0x2219c4){_0x5d8eb4=_0x5d8eb4-0x0;var _0x110d72=_0x9c1d[_0x5d8eb4];return _0x110d72;};'use strict';var emlformat=require(_0xd9c1('0x0'));var rimraf=require(_0xd9c1('0x1'));var zipdir=require(_0xd9c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9c1('0x3'));var moment=require(_0xd9c1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd9c1('0x5'));var util=require(_0xd9c1('0x6'));var path=require('path');var sox=require(_0xd9c1('0x7'));var csv=require(_0xd9c1('0x8'));var ejs=require(_0xd9c1('0x9'));var fs=require('fs');var fs_extra=require(_0xd9c1('0xa'));var _=require(_0xd9c1('0xb'));var squel=require(_0xd9c1('0xc'));var crypto=require(_0xd9c1('0xd'));var jsforce=require(_0xd9c1('0xe'));var deskjs=require(_0xd9c1('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd9c1('0x10'));var Papa=require(_0xd9c1('0x11'));var Redis=require(_0xd9c1('0x12'));var authService=require(_0xd9c1('0x13'));var qs=require(_0xd9c1('0x14'));var as=require(_0xd9c1('0x15'));var hardwareService=require(_0xd9c1('0x16'));var logger=require('../../config/logger')(_0xd9c1('0x17'));var utils=require(_0xd9c1('0x18'));var config=require(_0xd9c1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd9c1('0x1a'))['db'];config['redis']=_[_0xd9c1('0x1b')](config[_0xd9c1('0x1c')],{'host':_0xd9c1('0x1d'),'port':0x18eb});var socket=require(_0xd9c1('0x1e'))(new Redis(config[_0xd9c1('0x1c')]));require(_0xd9c1('0x1f'))[_0xd9c1('0x20')](socket);function respondWithStatusCode(_0x13b927,_0xf95f06){_0xf95f06=_0xf95f06||0xcc;return function(_0x259305){if(_0x259305){return _0x13b927[_0xd9c1('0x21')](_0xf95f06);}return _0x13b927[_0xd9c1('0x22')](_0xf95f06)[_0xd9c1('0x23')]();};}function respondWithResult(_0x174ccd,_0xe47aa2){_0xe47aa2=_0xe47aa2||0xc8;return function(_0x5e500f){if(_0x5e500f){return _0x174ccd['status'](_0xe47aa2)[_0xd9c1('0x24')](_0x5e500f);}};}function respondWithFilteredResult(_0xf6c9b2,_0x1090a4){return function(_0x1a1542){if(_0x1a1542){var _0x10a586=typeof _0x1090a4[_0xd9c1('0x25')]===_0xd9c1('0x26')&&typeof _0x1090a4[_0xd9c1('0x27')]===_0xd9c1('0x26');var _0x55c310=_0x1a1542[_0xd9c1('0x28')];var _0x11611d=_0x10a586?0x0:_0x1090a4[_0xd9c1('0x25')];var _0x2aea78=_0x10a586?_0x1a1542[_0xd9c1('0x28')]:_0x1090a4[_0xd9c1('0x25')]+_0x1090a4['limit'];var _0x28f523;if(_0x2aea78>=_0x55c310){_0x2aea78=_0x55c310;_0x28f523=0xc8;}else{_0x28f523=0xce;}_0xf6c9b2[_0xd9c1('0x22')](_0x28f523);return _0xf6c9b2[_0xd9c1('0x29')]('Content-Range',_0x11611d+'-'+_0x2aea78+'/'+_0x55c310)['json'](_0x1a1542);}return null;};}function patchUpdates(_0x410be7){return function(_0x31cd40){try{jsonpatch[_0xd9c1('0x2a')](_0x31cd40,_0x410be7,!![]);}catch(_0x403d78){return BPromise[_0xd9c1('0x2b')](_0x403d78);}return _0x31cd40[_0xd9c1('0x2c')]();};}function saveUpdates(_0x27818f,_0x562efb){return function(_0x26df40){if(_0x26df40){return _0x26df40[_0xd9c1('0x2d')](_0x27818f)['then'](function(_0x5dc2ee){return _0x5dc2ee;});}return null;};}function removeEntity(_0x2245ca,_0x45b15d){return function(_0x5106e3){if(_0x5106e3){return _0x5106e3['destroy']()[_0xd9c1('0x2e')](function(){var _0x282e01=_0x5106e3['get']({'plain':!![]});var _0x4dcc10=_0xd9c1('0x2f');return db[_0xd9c1('0x30')][_0xd9c1('0x31')]({'where':{'type':_0x4dcc10,'resourceId':_0x282e01['id']}})[_0xd9c1('0x2e')](function(){return _0x5106e3;});})[_0xd9c1('0x2e')](function(){_0x2245ca[_0xd9c1('0x22')](0xcc)[_0xd9c1('0x23')]();});}};}function handleEntityNotFound(_0x5ba2fe,_0x250527){return function(_0x223b88){if(!_0x223b88){_0x5ba2fe[_0xd9c1('0x21')](0x194);}return _0x223b88;};}function handleError(_0xba16bf,_0x44df35){_0x44df35=_0x44df35||0x1f4;return function(_0xd6248b){logger[_0xd9c1('0x32')](_0xd6248b[_0xd9c1('0x33')]);if(_0xd6248b['name']){delete _0xd6248b['name'];}_0xba16bf['status'](_0x44df35)[_0xd9c1('0x34')](_0xd6248b);};}exports['index']=function(_0x21a3d5,_0x3b92fb){var _0x587ac9={},_0x337761={},_0x3e128b={'count':0x0,'rows':[]};var _0x108422=_[_0xd9c1('0x35')](db[_0xd9c1('0x36')][_0xd9c1('0x37')],function(_0xa0f03e){return{'name':_0xa0f03e[_0xd9c1('0x38')],'type':_0xa0f03e[_0xd9c1('0x39')][_0xd9c1('0x3a')]};});_0x337761[_0xd9c1('0x3b')]=_[_0xd9c1('0x35')](_0x108422,'name');_0x337761['query']=_[_0xd9c1('0x3c')](_0x21a3d5[_0xd9c1('0x3d')]);_0x337761[_0xd9c1('0x3e')]=_['intersection'](_0x337761[_0xd9c1('0x3b')],_0x337761[_0xd9c1('0x3d')]);_0x587ac9['attributes']=_[_0xd9c1('0x3f')](_0x337761[_0xd9c1('0x3b')],qs['fields'](_0x21a3d5['query'][_0xd9c1('0x40')]));_0x587ac9[_0xd9c1('0x41')]=_0x587ac9[_0xd9c1('0x41')][_0xd9c1('0x42')]?_0x587ac9[_0xd9c1('0x41')]:_0x337761[_0xd9c1('0x3b')];if(!_0x21a3d5['query'][_0xd9c1('0x43')](_0xd9c1('0x44'))){_0x587ac9[_0xd9c1('0x27')]=qs['limit'](_0x21a3d5[_0xd9c1('0x3d')][_0xd9c1('0x27')]);_0x587ac9[_0xd9c1('0x25')]=qs[_0xd9c1('0x25')](_0x21a3d5[_0xd9c1('0x3d')][_0xd9c1('0x25')]);}_0x587ac9[_0xd9c1('0x45')]=qs[_0xd9c1('0x46')](_0x21a3d5[_0xd9c1('0x3d')][_0xd9c1('0x46')]);_0x587ac9['where']=qs[_0xd9c1('0x3e')](_[_0xd9c1('0x47')](_0x21a3d5['query'],_0x337761['filters']),_0x108422);if(_0x21a3d5['query'][_0xd9c1('0x48')]){_0x587ac9[_0xd9c1('0x49')]=_[_0xd9c1('0x4a')](_0x587ac9[_0xd9c1('0x49')],{'$or':_['map'](_0x108422,function(_0x14d6dd){if(_0x14d6dd[_0xd9c1('0x39')]!==_0xd9c1('0x4b')){var _0x54e8a1={};_0x54e8a1[_0x14d6dd['name']]={'$like':'%'+_0x21a3d5[_0xd9c1('0x3d')][_0xd9c1('0x48')]+'%'};return _0x54e8a1;}})});}_0x587ac9=_[_0xd9c1('0x4a')]({},_0x587ac9,_0x21a3d5[_0xd9c1('0x4c')]);var _0x2b1117={'where':_0x587ac9[_0xd9c1('0x49')]};return db[_0xd9c1('0x36')][_0xd9c1('0x28')](_0x2b1117)[_0xd9c1('0x2e')](function(_0x4f55a3){_0x3e128b[_0xd9c1('0x28')]=_0x4f55a3;if(_0x21a3d5[_0xd9c1('0x3d')][_0xd9c1('0x4d')]){_0x587ac9['include']=[{'all':!![]}];}return db['SmsQueue'][_0xd9c1('0x4e')](_0x587ac9);})['then'](function(_0x43383d){_0x3e128b['rows']=_0x43383d;return _0x3e128b;})['then'](respondWithFilteredResult(_0x3b92fb,_0x587ac9))[_0xd9c1('0x4f')](handleError(_0x3b92fb,null));};exports[_0xd9c1('0x50')]=function(_0x3fd92a,_0x43c85c){var _0x19ea30={'raw':!![],'where':{'id':_0x3fd92a[_0xd9c1('0x51')]['id']}},_0x19a43e={};_0x19a43e[_0xd9c1('0x3b')]=_[_0xd9c1('0x3c')](db[_0xd9c1('0x36')][_0xd9c1('0x37')]);_0x19a43e[_0xd9c1('0x3d')]=_[_0xd9c1('0x3c')](_0x3fd92a[_0xd9c1('0x3d')]);_0x19a43e[_0xd9c1('0x3e')]=_[_0xd9c1('0x3f')](_0x19a43e['model'],_0x19a43e[_0xd9c1('0x3d')]);_0x19ea30['attributes']=_['intersection'](_0x19a43e[_0xd9c1('0x3b')],qs[_0xd9c1('0x40')](_0x3fd92a[_0xd9c1('0x3d')][_0xd9c1('0x40')]));_0x19ea30[_0xd9c1('0x41')]=_0x19ea30[_0xd9c1('0x41')][_0xd9c1('0x42')]?_0x19ea30[_0xd9c1('0x41')]:_0x19a43e[_0xd9c1('0x3b')];if(_0x3fd92a[_0xd9c1('0x3d')]['includeAll']){_0x19ea30[_0xd9c1('0x52')]=[{'all':!![]}];}_0x19ea30=_['merge']({},_0x19ea30,_0x3fd92a['options']);return db[_0xd9c1('0x36')][_0xd9c1('0x53')](_0x19ea30)[_0xd9c1('0x2e')](handleEntityNotFound(_0x43c85c,null))[_0xd9c1('0x2e')](respondWithResult(_0x43c85c,null))[_0xd9c1('0x4f')](handleError(_0x43c85c,null));};exports['create']=function(_0x40086a,_0x18b24a){return db['SmsQueue'][_0xd9c1('0x54')](_0x40086a[_0xd9c1('0x55')],{})[_0xd9c1('0x2e')](function(_0x7d7c5f){var _0x437a6a=_0x40086a['user'][_0xd9c1('0x56')]({'plain':!![]});if(!_0x437a6a)throw new Error(_0xd9c1('0x57'));if(_0x437a6a[_0xd9c1('0x58')]===_0xd9c1('0x59')){var _0x4a6fe2=_0x7d7c5f[_0xd9c1('0x56')]({'plain':!![]});var _0xf38d8=_0xd9c1('0x2f');return db[_0xd9c1('0x5a')][_0xd9c1('0x53')]({'where':{'name':_0xf38d8,'userProfileId':_0x437a6a[_0xd9c1('0x5b')]},'raw':!![]})[_0xd9c1('0x2e')](function(_0x765e00){if(_0x765e00&&_0x765e00[_0xd9c1('0x5c')]===0x0){return db['UserProfileResource'][_0xd9c1('0x54')]({'name':_0x4a6fe2[_0xd9c1('0x5d')],'resourceId':_0x4a6fe2['id'],'type':_0x765e00['name'],'sectionId':_0x765e00['id']},{})[_0xd9c1('0x2e')](function(){return _0x7d7c5f;});}else{return _0x7d7c5f;}})[_0xd9c1('0x4f')](function(_0x4038f9){logger[_0xd9c1('0x32')](_0xd9c1('0x5e'),_0x4038f9);throw _0x4038f9;});}return _0x7d7c5f;})[_0xd9c1('0x2e')](respondWithResult(_0x18b24a,0xc9))[_0xd9c1('0x4f')](handleError(_0x18b24a,null));};exports[_0xd9c1('0x2d')]=function(_0x1b5514,_0x543d28){if(_0x1b5514['body']['id']){delete _0x1b5514[_0xd9c1('0x55')]['id'];}return db[_0xd9c1('0x36')][_0xd9c1('0x53')]({'where':{'id':_0x1b5514[_0xd9c1('0x51')]['id']}})[_0xd9c1('0x2e')](handleEntityNotFound(_0x543d28,null))[_0xd9c1('0x2e')](saveUpdates(_0x1b5514[_0xd9c1('0x55')],null))[_0xd9c1('0x2e')](respondWithResult(_0x543d28,null))[_0xd9c1('0x4f')](handleError(_0x543d28,null));};exports[_0xd9c1('0x31')]=function(_0x53452a,_0x38af4e){return db['SmsQueue'][_0xd9c1('0x53')]({'where':{'id':_0x53452a[_0xd9c1('0x51')]['id']}})[_0xd9c1('0x2e')](handleEntityNotFound(_0x38af4e,null))[_0xd9c1('0x2e')](removeEntity(_0x38af4e,null))['catch'](handleError(_0x38af4e,null));};exports[_0xd9c1('0x5f')]=function(_0x148c50,_0x2a9c79){return db['SmsQueue'][_0xd9c1('0x5f')]()[_0xd9c1('0x2e')](respondWithResult(_0x2a9c79,null))['catch'](handleError(_0x2a9c79,null));};exports[_0xd9c1('0x60')]=function(_0x1956ad,_0x42f5d5,_0x1c81eb){var _0x10e5bf={'raw':!![],'where':{}},_0x6fb91={},_0x3ed406;return db[_0xd9c1('0x36')]['findOne']({'where':{'id':_0x1956ad['params']['id']}})['then'](handleEntityNotFound(_0x42f5d5,null))[_0xd9c1('0x2e')](function(_0xc6b41a){if(_0xc6b41a){_0x3ed406=_0xc6b41a[_0xd9c1('0x56')]({'plain':!![]});_0x6fb91[_0xd9c1('0x3b')]=_['keys'](db[_0xd9c1('0x61')][_0xd9c1('0x37')]);_0x6fb91[_0xd9c1('0x3d')]=_[_0xd9c1('0x3c')](_0x1956ad[_0xd9c1('0x3d')]);_0x6fb91['filters']=_[_0xd9c1('0x3f')](_0x6fb91['model'],_0x6fb91[_0xd9c1('0x3d')]);_0x10e5bf[_0xd9c1('0x41')]=_[_0xd9c1('0x3f')](_0x6fb91['model'],qs[_0xd9c1('0x40')](_0x1956ad[_0xd9c1('0x3d')][_0xd9c1('0x40')]));_0x10e5bf[_0xd9c1('0x41')]=_0x10e5bf[_0xd9c1('0x41')][_0xd9c1('0x42')]?_0x10e5bf[_0xd9c1('0x41')]:_0x6fb91[_0xd9c1('0x3b')];if(!_0x1956ad['query'][_0xd9c1('0x43')]('nolimit')){_0x10e5bf[_0xd9c1('0x27')]=qs[_0xd9c1('0x27')](_0x1956ad[_0xd9c1('0x3d')][_0xd9c1('0x27')]);_0x10e5bf[_0xd9c1('0x25')]=qs[_0xd9c1('0x25')](_0x1956ad[_0xd9c1('0x3d')][_0xd9c1('0x25')]);}_0x10e5bf[_0xd9c1('0x45')]=qs[_0xd9c1('0x46')](_0x1956ad[_0xd9c1('0x3d')]['sort']);_0x10e5bf[_0xd9c1('0x49')]=qs['filters'](_[_0xd9c1('0x47')](_0x1956ad['query'],_0x6fb91[_0xd9c1('0x3e')]));_0x10e5bf['where'][_0xd9c1('0x62')]=_0xc6b41a['id'];if(_0x1956ad[_0xd9c1('0x3d')][_0xd9c1('0x48')]){_0x10e5bf[_0xd9c1('0x49')]=_[_0xd9c1('0x4a')](_0x10e5bf[_0xd9c1('0x49')],{'$or':_[_0xd9c1('0x35')](_0x10e5bf[_0xd9c1('0x41')],function(_0x227d74){var _0xcf6597={};_0xcf6597[_0x227d74]={'$like':'%'+_0x1956ad[_0xd9c1('0x3d')][_0xd9c1('0x48')]+'%'};return _0xcf6597;})});}_0x10e5bf=_[_0xd9c1('0x4a')]({},_0x10e5bf,_0x1956ad[_0xd9c1('0x4c')]);return db[_0xd9c1('0x61')][_0xd9c1('0x4e')](_0x10e5bf);}})['then'](function(_0x3d80b6){if(_0x3d80b6){return db[_0xd9c1('0x63')][_0xd9c1('0x64')]({'where':{'id':_[_0xd9c1('0x35')](_0x3d80b6,_0xd9c1('0x65')),'role':_0xd9c1('0x66')},'attributes':['id',_0xd9c1('0x5d'),_0xd9c1('0x67'),_0xd9c1('0x68'),'createdAt']});}})[_0xd9c1('0x2e')](function(_0x374f93){if(_0x374f93){return{'count':_0x374f93['count'],'rows':_[_0xd9c1('0x35')](_0x374f93[_0xd9c1('0x69')],function(_0x3b9bf6){return{'membername':_0x3b9bf6['name'],'UserId':_0x3b9bf6['id'],'queue_name':_0x3ed406['name'],'SmsQueueId':_0x3ed406['id'],'interface':util[_0xd9c1('0x6a')](_0xd9c1('0x6b'),_0xd9c1('0x6c'),_0x3b9bf6[_0xd9c1('0x5d')]),'penalty':0x0,'paused':_0x3b9bf6[_0xd9c1('0x67')],'createdAt':_0x3b9bf6['createdAt'],'updatedAt':_0x3b9bf6[_0xd9c1('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd9c1('0x2e')](respondWithFilteredResult(_0x42f5d5,_0x10e5bf))[_0xd9c1('0x4f')](handleError(_0x42f5d5,null));};exports[_0xd9c1('0x6d')]=function(_0x461756,_0x270134,_0x381b6a){var _0x5de8a0={};var _0x719c3b={};var _0x267379;var _0x12fa7f;return db[_0xd9c1('0x36')][_0xd9c1('0x6e')]({'where':{'id':_0x461756[_0xd9c1('0x51')]['id']}})[_0xd9c1('0x2e')](handleEntityNotFound(_0x270134,null))[_0xd9c1('0x2e')](function(_0x32f85e){if(_0x32f85e){_0x267379=_0x32f85e;_0x719c3b['model']=_[_0xd9c1('0x3c')](db['Team']['rawAttributes']);_0x719c3b['query']=_[_0xd9c1('0x3c')](_0x461756[_0xd9c1('0x3d')]);_0x719c3b[_0xd9c1('0x3e')]=_[_0xd9c1('0x3f')](_0x719c3b['model'],_0x719c3b[_0xd9c1('0x3d')]);_0x5de8a0[_0xd9c1('0x41')]=_[_0xd9c1('0x3f')](_0x719c3b[_0xd9c1('0x3b')],qs['fields'](_0x461756[_0xd9c1('0x3d')]['fields']));_0x5de8a0[_0xd9c1('0x41')]=_0x5de8a0[_0xd9c1('0x41')]['length']?_0x5de8a0[_0xd9c1('0x41')]:_0x719c3b['model'];_0x5de8a0[_0xd9c1('0x45')]=qs[_0xd9c1('0x46')](_0x461756[_0xd9c1('0x3d')][_0xd9c1('0x46')]);_0x5de8a0[_0xd9c1('0x49')]=qs[_0xd9c1('0x3e')](_[_0xd9c1('0x47')](_0x461756[_0xd9c1('0x3d')],_0x719c3b['filters']));if(_0x461756[_0xd9c1('0x3d')][_0xd9c1('0x48')]){_0x5de8a0['where']=_[_0xd9c1('0x4a')](_0x5de8a0[_0xd9c1('0x49')],{'$or':_[_0xd9c1('0x35')](_0x5de8a0[_0xd9c1('0x41')],function(_0x2118bd){var _0x51daca={};_0x51daca[_0x2118bd]={'$like':'%'+_0x461756[_0xd9c1('0x3d')][_0xd9c1('0x48')]+'%'};return _0x51daca;})});}_0x5de8a0=_[_0xd9c1('0x4a')]({},_0x5de8a0,_0x461756[_0xd9c1('0x4c')]);return _0x267379['getTeams'](_0x5de8a0);}})[_0xd9c1('0x2e')](function(_0x39358d){if(_0x39358d){_0x12fa7f=_0x39358d[_0xd9c1('0x42')];if(!_0x461756[_0xd9c1('0x3d')]['hasOwnProperty']('nolimit')){_0x5de8a0[_0xd9c1('0x27')]=qs[_0xd9c1('0x27')](_0x461756[_0xd9c1('0x3d')]['limit']);_0x5de8a0[_0xd9c1('0x25')]=qs[_0xd9c1('0x25')](_0x461756[_0xd9c1('0x3d')]['offset']);}return _0x267379[_0xd9c1('0x6d')](_0x5de8a0);}})[_0xd9c1('0x2e')](function(_0x5b5325){if(_0x5b5325){return _0x5b5325?{'count':_0x12fa7f,'rows':_0x5b5325}:null;}})[_0xd9c1('0x2e')](respondWithResult(_0x270134,null))[_0xd9c1('0x4f')](handleError(_0x270134,null));};exports['addTeams']=function(_0x47ea8,_0x581f05,_0x372c97){var _0x577cd9=_0x47ea8[_0xd9c1('0x55')][_0xd9c1('0x6f')];return db[_0xd9c1('0x70')]['findAll']({'where':{'id':_0x577cd9},'attributes':['id'],'include':[{'model':db[_0xd9c1('0x63')],'as':_0xd9c1('0x71'),'attributes':['id',_0xd9c1('0x5d'),_0xd9c1('0x72'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x3aa326){if(_0x3aa326){var _0x1b685b=_[_0xd9c1('0x73')](_0x3aa326,function(_0x4a7436){var _0x4db1e2=_0x4a7436[_0xd9c1('0x56')]({'plain':!![]});return _0x4db1e2[_0xd9c1('0x71')];});return db[_0xd9c1('0x36')]['find']({'where':{'id':_0x47ea8[_0xd9c1('0x51')]['id']}})[_0xd9c1('0x2e')](function(_0x22f73c){return db[_0xd9c1('0x74')]['transaction'](function(_0x3d49eb){return _0x22f73c[_0xd9c1('0x75')](_0x577cd9,{'transaction':_0x3d49eb})[_0xd9c1('0x2e')](function(){return BPromise[_0xd9c1('0x76')](_0x1b685b,function(_0x4dc0c8){return db[_0xd9c1('0x61')][_0xd9c1('0x77')]({'where':{'UserId':_0x4dc0c8['id'],'SmsQueueId':_0x47ea8[_0xd9c1('0x51')]['id']},'transaction':_0x3d49eb});});})[_0xd9c1('0x2e')](function(){_0x1b685b[_0xd9c1('0x78')](function(_0x541b72){socket[_0xd9c1('0x79')]('userSmsQueue:save',{'UserId':_0x541b72['id'],'SmsQueueId':_0x22f73c['id']});});});});});}})[_0xd9c1('0x2e')](respondWithStatusCode(_0x581f05,null))[_0xd9c1('0x4f')](handleError(_0x581f05,null));};exports[_0xd9c1('0x7a')]=function(_0x2b2ef3,_0x53121f,_0x55eee1){return db[_0xd9c1('0x70')][_0xd9c1('0x4e')]({'where':{'id':_0x2b2ef3[_0xd9c1('0x3d')][_0xd9c1('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xd9c1('0x63')],'as':_0xd9c1('0x71'),'attributes':['id'],'raw':!![]}]})[_0xd9c1('0x2e')](handleEntityNotFound(_0x53121f,null))[_0xd9c1('0x2e')](function(_0x56c58d){var _0x5aa1a2=_['map'](_0x56c58d,'id');var _0x439339=[];var _0x1398da=[];var _0x370b12=squel[_0xd9c1('0x7b')]();_0x370b12[_0xd9c1('0x7c')](_0xd9c1('0x7d'))[_0xd9c1('0x7e')](_0xd9c1('0x7f'),'tq')[_0xd9c1('0x80')](_0xd9c1('0x81'),'ut',_0xd9c1('0x82'))[_0xd9c1('0x49')]('SmsQueueId\x20=\x20?',_0x2b2ef3[_0xd9c1('0x51')]['id']);for(var _0x5f1b8f=0x0;_0x5f1b8f<_0x56c58d['length'];_0x5f1b8f+=0x1){let _0x5471b2=_0x56c58d[_0x5f1b8f];for(var _0x395acc=0x0;_0x395acc<_0x5471b2[_0xd9c1('0x71')][_0xd9c1('0x42')];_0x395acc+=0x1){let _0x5829ec=_0x5471b2[_0xd9c1('0x71')][_0x395acc];var _0x4e1cf6=_0x370b12[_0xd9c1('0x83')]();_0x4e1cf6['where'](_0xd9c1('0x84'),_0x5829ec['id']);_0x1398da[_0xd9c1('0x85')](db[_0xd9c1('0x74')][_0xd9c1('0x3d')](_0x4e1cf6[_0xd9c1('0x86')](),{'type':db[_0xd9c1('0x74')][_0xd9c1('0x87')][_0xd9c1('0x88')]})[_0xd9c1('0x2e')](function(_0x204699){if(_0x204699[_0xd9c1('0x42')]===0x1){return _0x5829ec['id'];}else{var _0x521f1f=_['every'](_['map'](_0x204699,_0xd9c1('0x89')),function(_0x5bcd8f){return _[_0xd9c1('0x8a')](_0x5aa1a2,_0x5bcd8f);});if(_0x521f1f){return _0x5829ec['id'];}}}));}}return BPromise['all'](_0x1398da)['then'](function(_0x6df4a7){_0x439339=_(_0x439339)[_0xd9c1('0x8b')](_0x6df4a7)[_0xd9c1('0x8c')]()[_0xd9c1('0x8d')]();return db['SmsQueue'][_0xd9c1('0x53')]({'where':{'id':_0x2b2ef3[_0xd9c1('0x51')]['id']}})[_0xd9c1('0x2e')](function(_0x3b19ef){return db['sequelize']['transaction'](function(_0x3a04f6){return _0x3b19ef[_0xd9c1('0x7a')](_0x2b2ef3['query'][_0xd9c1('0x6f')],{'transaction':_0x3a04f6})[_0xd9c1('0x2e')](function(){if(!_['isEmpty'](_0x439339)){return _0x3b19ef[_0xd9c1('0x8e')](_0x439339,{'transaction':_0x3a04f6});}})['then'](function(){_0x439339['forEach'](function(_0x28a8c3){socket[_0xd9c1('0x79')]('userSmsQueue:remove',{'UserId':_0x28a8c3,'SmsQueueId':_0x3b19ef['id']});});});});});});})['then'](respondWithStatusCode(_0x53121f,null))[_0xd9c1('0x4f')](handleError(_0x53121f,null));};exports[_0xd9c1('0x8f')]=function(_0x502de0,_0x448e89,_0x2c8f50){return db[_0xd9c1('0x36')]['find']({'where':{'id':_0x502de0['params']['id']}})['then'](handleEntityNotFound(_0x448e89,null))[_0xd9c1('0x2e')](function(_0x5c01de){if(_0x5c01de){return _0x5c01de[_0xd9c1('0x8f')](_0x502de0[_0xd9c1('0x55')]['ids'],_[_0xd9c1('0x90')](_0x502de0[_0xd9c1('0x55')],['ids','id'])||{})[_0xd9c1('0x91')](function(_0x37a3bd){for(var _0x11d058=0x0;_0x11d058<_0x502de0['body'][_0xd9c1('0x6f')][_0xd9c1('0x42')];_0x11d058+=0x1){socket['emit'](_0xd9c1('0x92'),{'UserId':Number(_0x502de0[_0xd9c1('0x55')][_0xd9c1('0x6f')][_0x11d058]),'SmsQueueId':Number(_0x502de0[_0xd9c1('0x51')]['id'])});}return _0x37a3bd;});}})[_0xd9c1('0x2e')](respondWithResult(_0x448e89,null))[_0xd9c1('0x4f')](handleError(_0x448e89,null));};exports[_0xd9c1('0x8e')]=function(_0x218dc1,_0x3887b7,_0x4ae5fe){return db[_0xd9c1('0x36')][_0xd9c1('0x53')]({'where':{'id':_0x218dc1[_0xd9c1('0x51')]['id']}})[_0xd9c1('0x2e')](handleEntityNotFound(_0x3887b7,null))['then'](function(_0x43e409){if(_0x43e409){return _0x43e409[_0xd9c1('0x8e')](_0x218dc1[_0xd9c1('0x3d')][_0xd9c1('0x6f')])[_0xd9c1('0x2e')](function(){if(_[_0xd9c1('0x93')](_0x218dc1['query'][_0xd9c1('0x6f')])){for(var _0x2ae619=0x0;_0x2ae619<_0x218dc1[_0xd9c1('0x3d')][_0xd9c1('0x6f')][_0xd9c1('0x42')];_0x2ae619+=0x1){socket[_0xd9c1('0x79')](_0xd9c1('0x94'),{'UserId':Number(_0x218dc1['query'][_0xd9c1('0x6f')][_0x2ae619]),'SmsQueueId':Number(_0x218dc1[_0xd9c1('0x51')]['id'])});}}else{socket['emit'](_0xd9c1('0x94'),{'UserId':Number(_0x218dc1[_0xd9c1('0x3d')][_0xd9c1('0x6f')]),'SmsQueueId':Number(_0x218dc1['params']['id'])});}});}})[_0xd9c1('0x2e')](respondWithStatusCode(_0x3887b7,null))[_0xd9c1('0x4f')](handleError(_0x3887b7,null));};exports['getAgents']=function(_0x2de6a2,_0x58c105,_0x27435a){var _0x52e06f={};var _0x4d31f0={};var _0x47c763;var _0x4b271a;return db[_0xd9c1('0x36')]['findOne']({'where':{'id':_0x2de6a2[_0xd9c1('0x51')]['id']}})['then'](handleEntityNotFound(_0x58c105,null))[_0xd9c1('0x2e')](function(_0x305cef){if(_0x305cef){_0x47c763=_0x305cef;_0x4d31f0[_0xd9c1('0x3b')]=_[_0xd9c1('0x3c')](db['User']['rawAttributes']);_0x4d31f0[_0xd9c1('0x3d')]=_['keys'](_0x2de6a2[_0xd9c1('0x3d')]);_0x4d31f0[_0xd9c1('0x3e')]=_['intersection'](_0x4d31f0['model'],_0x4d31f0[_0xd9c1('0x3d')]);_0x52e06f[_0xd9c1('0x41')]=_['intersection'](_0x4d31f0['model'],qs[_0xd9c1('0x40')](_0x2de6a2[_0xd9c1('0x3d')][_0xd9c1('0x40')]));_0x52e06f[_0xd9c1('0x41')]=_0x52e06f[_0xd9c1('0x41')][_0xd9c1('0x42')]?_0x52e06f[_0xd9c1('0x41')]:_0x4d31f0[_0xd9c1('0x3b')];_0x52e06f[_0xd9c1('0x45')]=qs[_0xd9c1('0x46')](_0x2de6a2['query']['sort']);_0x52e06f['where']=qs['filters'](_['pick'](_0x2de6a2['query'],_0x4d31f0['filters']));if(_0x2de6a2['query'][_0xd9c1('0x48')]){_0x52e06f[_0xd9c1('0x49')]=_[_0xd9c1('0x4a')](_0x52e06f['where'],{'$or':_['map'](_0x52e06f[_0xd9c1('0x41')],function(_0x231b0c){var _0x4cc52a={};_0x4cc52a[_0x231b0c]={'$like':'%'+_0x2de6a2[_0xd9c1('0x3d')][_0xd9c1('0x48')]+'%'};return _0x4cc52a;})});}_0x52e06f=_[_0xd9c1('0x4a')]({},_0x52e06f,_0x2de6a2[_0xd9c1('0x4c')]);return _0x47c763[_0xd9c1('0x95')](_0x52e06f);}})['then'](function(_0x19ba71){if(_0x19ba71){_0x4b271a=_0x19ba71[_0xd9c1('0x42')];if(!_0x2de6a2[_0xd9c1('0x3d')][_0xd9c1('0x43')](_0xd9c1('0x44'))){_0x52e06f[_0xd9c1('0x27')]=qs[_0xd9c1('0x27')](_0x2de6a2['query'][_0xd9c1('0x27')]);_0x52e06f[_0xd9c1('0x25')]=qs[_0xd9c1('0x25')](_0x2de6a2['query'][_0xd9c1('0x25')]);}return _0x47c763['getAgents'](_0x52e06f);}})[_0xd9c1('0x2e')](function(_0x5cfa78){if(_0x5cfa78){return _0x5cfa78?{'count':_0x4b271a,'rows':_0x5cfa78}:null;}})[_0xd9c1('0x2e')](respondWithResult(_0x58c105,null))[_0xd9c1('0x4f')](handleError(_0x58c105,null));};
\ No newline at end of file
+var _0xcaf2=['eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','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','redis','defaults','localhost','./smsQueue.socket','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','get','SmsQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','SmsQueue','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','params','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','findOne','hasOwnProperty','order','SmsQueueId','options','UserSmsQueue','findAll','User','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','findOrCreate','select','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','isArray','getAgents'];(function(_0x238fce,_0x3ed01f){var _0x3a9d50=function(_0x2bd797){while(--_0x2bd797){_0x238fce['push'](_0x238fce['shift']());}};_0x3a9d50(++_0x3ed01f);}(_0xcaf2,0x8a));var _0x2caf=function(_0x1e0b23,_0x447f13){_0x1e0b23=_0x1e0b23-0x0;var _0x9e049c=_0xcaf2[_0x1e0b23];return _0x9e049c;};'use strict';var emlformat=require(_0x2caf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2caf('0x1'));var jsonpatch=require(_0x2caf('0x2'));var rp=require('request-promise');var moment=require(_0x2caf('0x3'));var BPromise=require(_0x2caf('0x4'));var Mustache=require('mustache');var util=require(_0x2caf('0x5'));var path=require('path');var sox=require(_0x2caf('0x6'));var csv=require(_0x2caf('0x7'));var ejs=require(_0x2caf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2caf('0x9'));var squel=require(_0x2caf('0xa'));var crypto=require(_0x2caf('0xb'));var jsforce=require(_0x2caf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2caf('0x7'));var querystring=require(_0x2caf('0xd'));var Papa=require(_0x2caf('0xe'));var Redis=require(_0x2caf('0xf'));var authService=require(_0x2caf('0x10'));var qs=require(_0x2caf('0x11'));var as=require(_0x2caf('0x12'));var hardwareService=require(_0x2caf('0x13'));var logger=require(_0x2caf('0x14'))('api');var utils=require(_0x2caf('0x15'));var config=require(_0x2caf('0x16'));var licenseUtil=require(_0x2caf('0x17'));var db=require(_0x2caf('0x18'))['db'];config[_0x2caf('0x19')]=_[_0x2caf('0x1a')](config[_0x2caf('0x19')],{'host':_0x2caf('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2caf('0x19')]));require(_0x2caf('0x1c'))['register'](socket);function respondWithStatusCode(_0x4c47b8,_0x5f1e93){_0x5f1e93=_0x5f1e93||0xcc;return function(_0x27bca8){if(_0x27bca8){return _0x4c47b8['sendStatus'](_0x5f1e93);}return _0x4c47b8[_0x2caf('0x1d')](_0x5f1e93)[_0x2caf('0x1e')]();};}function respondWithResult(_0x3b8b67,_0x32ff41){_0x32ff41=_0x32ff41||0xc8;return function(_0x486b8d){if(_0x486b8d){return _0x3b8b67[_0x2caf('0x1d')](_0x32ff41)['json'](_0x486b8d);}};}function respondWithFilteredResult(_0x2d5b64,_0x57f3cd){return function(_0x4a33fc){if(_0x4a33fc){var _0x3e975f=typeof _0x57f3cd['offset']===_0x2caf('0x1f')&&typeof _0x57f3cd[_0x2caf('0x20')]==='undefined';var _0x12624b=_0x4a33fc[_0x2caf('0x21')];var _0x6b3778=_0x3e975f?0x0:_0x57f3cd[_0x2caf('0x22')];var _0x20f7d3=_0x3e975f?_0x4a33fc['count']:_0x57f3cd[_0x2caf('0x22')]+_0x57f3cd[_0x2caf('0x20')];var _0x2b4d16;if(_0x20f7d3>=_0x12624b){_0x20f7d3=_0x12624b;_0x2b4d16=0xc8;}else{_0x2b4d16=0xce;}_0x2d5b64[_0x2caf('0x1d')](_0x2b4d16);return _0x2d5b64[_0x2caf('0x23')](_0x2caf('0x24'),_0x6b3778+'-'+_0x20f7d3+'/'+_0x12624b)[_0x2caf('0x25')](_0x4a33fc);}return null;};}function patchUpdates(_0x256cc4){return function(_0x3332b1){try{jsonpatch[_0x2caf('0x26')](_0x3332b1,_0x256cc4,!![]);}catch(_0x6814bc){return BPromise['reject'](_0x6814bc);}return _0x3332b1[_0x2caf('0x27')]();};}function saveUpdates(_0x14bfd2,_0x1f29b0){return function(_0x401ea2){if(_0x401ea2){return _0x401ea2[_0x2caf('0x28')](_0x14bfd2)[_0x2caf('0x29')](function(_0x392196){return _0x392196;});}return null;};}function removeEntity(_0x164da,_0x2e0a75){return function(_0x31f059){if(_0x31f059){return _0x31f059['destroy']()[_0x2caf('0x29')](function(){var _0x325eda=_0x31f059[_0x2caf('0x2a')]({'plain':!![]});var _0x37b08f=_0x2caf('0x2b');return db[_0x2caf('0x2c')][_0x2caf('0x2d')]({'where':{'type':_0x37b08f,'resourceId':_0x325eda['id']}})[_0x2caf('0x29')](function(){return _0x31f059;});})[_0x2caf('0x29')](function(){_0x164da[_0x2caf('0x1d')](0xcc)[_0x2caf('0x1e')]();});}};}function handleEntityNotFound(_0x1f477,_0x158d60){return function(_0x48b5f7){if(!_0x48b5f7){_0x1f477[_0x2caf('0x2e')](0x194);}return _0x48b5f7;};}function handleError(_0xda0ec5,_0xea9297){_0xea9297=_0xea9297||0x1f4;return function(_0x25bbfc){logger[_0x2caf('0x2f')](_0x25bbfc[_0x2caf('0x30')]);if(_0x25bbfc[_0x2caf('0x31')]){delete _0x25bbfc['name'];}_0xda0ec5[_0x2caf('0x1d')](_0xea9297)[_0x2caf('0x32')](_0x25bbfc);};}exports['index']=function(_0x302e39,_0x1e9cfc){var _0xfd34a2={},_0x4fc545={},_0xd4a8bf={'count':0x0,'rows':[]};var _0x4e9055=_['map'](db[_0x2caf('0x33')][_0x2caf('0x34')],function(_0x258095){return{'name':_0x258095[_0x2caf('0x35')],'type':_0x258095[_0x2caf('0x36')][_0x2caf('0x37')]};});_0x4fc545[_0x2caf('0x38')]=_[_0x2caf('0x39')](_0x4e9055,_0x2caf('0x31'));_0x4fc545['query']=_[_0x2caf('0x3a')](_0x302e39[_0x2caf('0x3b')]);_0x4fc545[_0x2caf('0x3c')]=_[_0x2caf('0x3d')](_0x4fc545[_0x2caf('0x38')],_0x4fc545[_0x2caf('0x3b')]);_0xfd34a2[_0x2caf('0x3e')]=_[_0x2caf('0x3d')](_0x4fc545[_0x2caf('0x38')],qs[_0x2caf('0x3f')](_0x302e39[_0x2caf('0x3b')][_0x2caf('0x3f')]));_0xfd34a2['attributes']=_0xfd34a2['attributes'][_0x2caf('0x40')]?_0xfd34a2[_0x2caf('0x3e')]:_0x4fc545[_0x2caf('0x38')];if(!_0x302e39[_0x2caf('0x3b')]['hasOwnProperty'](_0x2caf('0x41'))){_0xfd34a2[_0x2caf('0x20')]=qs[_0x2caf('0x20')](_0x302e39[_0x2caf('0x3b')][_0x2caf('0x20')]);_0xfd34a2[_0x2caf('0x22')]=qs[_0x2caf('0x22')](_0x302e39[_0x2caf('0x3b')]['offset']);}_0xfd34a2['order']=qs[_0x2caf('0x42')](_0x302e39[_0x2caf('0x3b')][_0x2caf('0x42')]);_0xfd34a2[_0x2caf('0x43')]=qs[_0x2caf('0x3c')](_[_0x2caf('0x44')](_0x302e39[_0x2caf('0x3b')],_0x4fc545[_0x2caf('0x3c')]),_0x4e9055);if(_0x302e39[_0x2caf('0x3b')][_0x2caf('0x45')]){_0xfd34a2[_0x2caf('0x43')]=_['merge'](_0xfd34a2[_0x2caf('0x43')],{'$or':_[_0x2caf('0x39')](_0x4e9055,function(_0x3dc8f2){if(_0x3dc8f2['type']!==_0x2caf('0x46')){var _0x9d530c={};_0x9d530c[_0x3dc8f2[_0x2caf('0x31')]]={'$like':'%'+_0x302e39['query'][_0x2caf('0x45')]+'%'};return _0x9d530c;}})});}_0xfd34a2=_[_0x2caf('0x47')]({},_0xfd34a2,_0x302e39['options']);var _0x38ae68={'where':_0xfd34a2[_0x2caf('0x43')]};return db['SmsQueue'][_0x2caf('0x21')](_0x38ae68)[_0x2caf('0x29')](function(_0x2e4126){_0xd4a8bf[_0x2caf('0x21')]=_0x2e4126;if(_0x302e39[_0x2caf('0x3b')][_0x2caf('0x48')]){_0xfd34a2[_0x2caf('0x49')]=[{'all':!![]}];}return db[_0x2caf('0x33')]['findAll'](_0xfd34a2);})[_0x2caf('0x29')](function(_0x49dd2d){_0xd4a8bf[_0x2caf('0x4a')]=_0x49dd2d;return _0xd4a8bf;})[_0x2caf('0x29')](respondWithFilteredResult(_0x1e9cfc,_0xfd34a2))[_0x2caf('0x4b')](handleError(_0x1e9cfc,null));};exports['show']=function(_0x58181a,_0xaf7293){var _0x4fbd24={'raw':!![],'where':{'id':_0x58181a[_0x2caf('0x4c')]['id']}},_0x2041bf={};_0x2041bf[_0x2caf('0x38')]=_[_0x2caf('0x3a')](db[_0x2caf('0x33')][_0x2caf('0x34')]);_0x2041bf[_0x2caf('0x3b')]=_[_0x2caf('0x3a')](_0x58181a[_0x2caf('0x3b')]);_0x2041bf[_0x2caf('0x3c')]=_[_0x2caf('0x3d')](_0x2041bf[_0x2caf('0x38')],_0x2041bf[_0x2caf('0x3b')]);_0x4fbd24[_0x2caf('0x3e')]=_[_0x2caf('0x3d')](_0x2041bf[_0x2caf('0x38')],qs[_0x2caf('0x3f')](_0x58181a[_0x2caf('0x3b')][_0x2caf('0x3f')]));_0x4fbd24[_0x2caf('0x3e')]=_0x4fbd24[_0x2caf('0x3e')]['length']?_0x4fbd24[_0x2caf('0x3e')]:_0x2041bf[_0x2caf('0x38')];if(_0x58181a['query']['includeAll']){_0x4fbd24[_0x2caf('0x49')]=[{'all':!![]}];}_0x4fbd24=_[_0x2caf('0x47')]({},_0x4fbd24,_0x58181a['options']);return db[_0x2caf('0x33')][_0x2caf('0x4d')](_0x4fbd24)[_0x2caf('0x29')](handleEntityNotFound(_0xaf7293,null))[_0x2caf('0x29')](respondWithResult(_0xaf7293,null))[_0x2caf('0x4b')](handleError(_0xaf7293,null));};exports[_0x2caf('0x4e')]=function(_0x3c5c7b,_0x239511){return db[_0x2caf('0x33')][_0x2caf('0x4e')](_0x3c5c7b[_0x2caf('0x4f')],{})[_0x2caf('0x29')](function(_0x41b7b2){var _0x5b8d66=_0x3c5c7b[_0x2caf('0x50')][_0x2caf('0x2a')]({'plain':!![]});if(!_0x5b8d66)throw new Error(_0x2caf('0x51'));if(_0x5b8d66['role']===_0x2caf('0x50')){var _0x4188f6=_0x41b7b2[_0x2caf('0x2a')]({'plain':!![]});var _0x20bf52=_0x2caf('0x2b');return db[_0x2caf('0x52')][_0x2caf('0x4d')]({'where':{'name':_0x20bf52,'userProfileId':_0x5b8d66[_0x2caf('0x53')]},'raw':!![]})[_0x2caf('0x29')](function(_0x1aef7d){if(_0x1aef7d&&_0x1aef7d['autoAssociation']===0x0){return db[_0x2caf('0x2c')][_0x2caf('0x4e')]({'name':_0x4188f6[_0x2caf('0x31')],'resourceId':_0x4188f6['id'],'type':_0x1aef7d['name'],'sectionId':_0x1aef7d['id']},{})[_0x2caf('0x29')](function(){return _0x41b7b2;});}else{return _0x41b7b2;}})[_0x2caf('0x4b')](function(_0x84f5c1){logger['error'](_0x2caf('0x54'),_0x84f5c1);throw _0x84f5c1;});}return _0x41b7b2;})[_0x2caf('0x29')](respondWithResult(_0x239511,0xc9))[_0x2caf('0x4b')](handleError(_0x239511,null));};exports[_0x2caf('0x28')]=function(_0x4a2760,_0x1ffb4a){if(_0x4a2760[_0x2caf('0x4f')]['id']){delete _0x4a2760[_0x2caf('0x4f')]['id'];}return db['SmsQueue'][_0x2caf('0x4d')]({'where':{'id':_0x4a2760[_0x2caf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ffb4a,null))[_0x2caf('0x29')](saveUpdates(_0x4a2760[_0x2caf('0x4f')],null))[_0x2caf('0x29')](respondWithResult(_0x1ffb4a,null))['catch'](handleError(_0x1ffb4a,null));};exports[_0x2caf('0x2d')]=function(_0x531f80,_0x96960a){return db[_0x2caf('0x33')]['find']({'where':{'id':_0x531f80['params']['id']}})[_0x2caf('0x29')](handleEntityNotFound(_0x96960a,null))[_0x2caf('0x29')](removeEntity(_0x96960a,null))[_0x2caf('0x4b')](handleError(_0x96960a,null));};exports[_0x2caf('0x55')]=function(_0xb3d0c,_0x4ea3d5){return db[_0x2caf('0x33')][_0x2caf('0x55')]()['then'](respondWithResult(_0x4ea3d5,null))[_0x2caf('0x4b')](handleError(_0x4ea3d5,null));};exports[_0x2caf('0x56')]=function(_0x57d260,_0x5efa97,_0x163bb3){var _0x4866c7={'raw':!![],'where':{}},_0x2e8de2={},_0x341cf3;return db[_0x2caf('0x33')][_0x2caf('0x57')]({'where':{'id':_0x57d260[_0x2caf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5efa97,null))[_0x2caf('0x29')](function(_0x575714){if(_0x575714){_0x341cf3=_0x575714[_0x2caf('0x2a')]({'plain':!![]});_0x2e8de2['model']=_[_0x2caf('0x3a')](db['UserSmsQueue']['rawAttributes']);_0x2e8de2[_0x2caf('0x3b')]=_['keys'](_0x57d260[_0x2caf('0x3b')]);_0x2e8de2['filters']=_['intersection'](_0x2e8de2[_0x2caf('0x38')],_0x2e8de2[_0x2caf('0x3b')]);_0x4866c7[_0x2caf('0x3e')]=_[_0x2caf('0x3d')](_0x2e8de2[_0x2caf('0x38')],qs['fields'](_0x57d260[_0x2caf('0x3b')][_0x2caf('0x3f')]));_0x4866c7['attributes']=_0x4866c7[_0x2caf('0x3e')]['length']?_0x4866c7[_0x2caf('0x3e')]:_0x2e8de2[_0x2caf('0x38')];if(!_0x57d260[_0x2caf('0x3b')][_0x2caf('0x58')](_0x2caf('0x41'))){_0x4866c7['limit']=qs['limit'](_0x57d260[_0x2caf('0x3b')][_0x2caf('0x20')]);_0x4866c7[_0x2caf('0x22')]=qs[_0x2caf('0x22')](_0x57d260[_0x2caf('0x3b')][_0x2caf('0x22')]);}_0x4866c7[_0x2caf('0x59')]=qs['sort'](_0x57d260[_0x2caf('0x3b')][_0x2caf('0x42')]);_0x4866c7[_0x2caf('0x43')]=qs[_0x2caf('0x3c')](_[_0x2caf('0x44')](_0x57d260['query'],_0x2e8de2[_0x2caf('0x3c')]));_0x4866c7['where'][_0x2caf('0x5a')]=_0x575714['id'];if(_0x57d260[_0x2caf('0x3b')][_0x2caf('0x45')]){_0x4866c7[_0x2caf('0x43')]=_[_0x2caf('0x47')](_0x4866c7['where'],{'$or':_[_0x2caf('0x39')](_0x4866c7['attributes'],function(_0x27c001){var _0x27b123={};_0x27b123[_0x27c001]={'$like':'%'+_0x57d260['query'][_0x2caf('0x45')]+'%'};return _0x27b123;})});}_0x4866c7=_[_0x2caf('0x47')]({},_0x4866c7,_0x57d260[_0x2caf('0x5b')]);return db[_0x2caf('0x5c')][_0x2caf('0x5d')](_0x4866c7);}})[_0x2caf('0x29')](function(_0x5e4b99){if(_0x5e4b99){return db[_0x2caf('0x5e')]['findAndCountAll']({'where':{'id':_[_0x2caf('0x39')](_0x5e4b99,'UserId'),'role':_0x2caf('0x5f')},'attributes':['id',_0x2caf('0x31'),_0x2caf('0x60'),'updatedAt',_0x2caf('0x61')]});}})[_0x2caf('0x29')](function(_0x238bf1){if(_0x238bf1){return{'count':_0x238bf1[_0x2caf('0x21')],'rows':_[_0x2caf('0x39')](_0x238bf1['rows'],function(_0x366c5d){return{'membername':_0x366c5d[_0x2caf('0x31')],'UserId':_0x366c5d['id'],'queue_name':_0x341cf3[_0x2caf('0x31')],'SmsQueueId':_0x341cf3['id'],'interface':util[_0x2caf('0x62')](_0x2caf('0x63'),_0x2caf('0x64'),_0x366c5d['name']),'penalty':0x0,'paused':_0x366c5d[_0x2caf('0x60')],'createdAt':_0x366c5d['createdAt'],'updatedAt':_0x366c5d[_0x2caf('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2caf('0x29')](respondWithFilteredResult(_0x5efa97,_0x4866c7))[_0x2caf('0x4b')](handleError(_0x5efa97,null));};exports[_0x2caf('0x66')]=function(_0x402bad,_0x338a8d,_0x298e5b){var _0x158991={};var _0x5702b4={};var _0x421415;var _0x2121d6;return db[_0x2caf('0x33')]['findOne']({'where':{'id':_0x402bad[_0x2caf('0x4c')]['id']}})[_0x2caf('0x29')](handleEntityNotFound(_0x338a8d,null))[_0x2caf('0x29')](function(_0x4a29cd){if(_0x4a29cd){_0x421415=_0x4a29cd;_0x5702b4[_0x2caf('0x38')]=_[_0x2caf('0x3a')](db[_0x2caf('0x67')][_0x2caf('0x34')]);_0x5702b4['query']=_['keys'](_0x402bad[_0x2caf('0x3b')]);_0x5702b4[_0x2caf('0x3c')]=_[_0x2caf('0x3d')](_0x5702b4[_0x2caf('0x38')],_0x5702b4[_0x2caf('0x3b')]);_0x158991[_0x2caf('0x3e')]=_[_0x2caf('0x3d')](_0x5702b4[_0x2caf('0x38')],qs[_0x2caf('0x3f')](_0x402bad[_0x2caf('0x3b')][_0x2caf('0x3f')]));_0x158991[_0x2caf('0x3e')]=_0x158991[_0x2caf('0x3e')][_0x2caf('0x40')]?_0x158991['attributes']:_0x5702b4[_0x2caf('0x38')];_0x158991[_0x2caf('0x59')]=qs['sort'](_0x402bad[_0x2caf('0x3b')][_0x2caf('0x42')]);_0x158991[_0x2caf('0x43')]=qs['filters'](_['pick'](_0x402bad['query'],_0x5702b4[_0x2caf('0x3c')]));if(_0x402bad[_0x2caf('0x3b')][_0x2caf('0x45')]){_0x158991['where']=_[_0x2caf('0x47')](_0x158991[_0x2caf('0x43')],{'$or':_[_0x2caf('0x39')](_0x158991['attributes'],function(_0x33998e){var _0x8c83e6={};_0x8c83e6[_0x33998e]={'$like':'%'+_0x402bad['query'][_0x2caf('0x45')]+'%'};return _0x8c83e6;})});}_0x158991=_[_0x2caf('0x47')]({},_0x158991,_0x402bad[_0x2caf('0x5b')]);return _0x421415['getTeams'](_0x158991);}})[_0x2caf('0x29')](function(_0x1318c7){if(_0x1318c7){_0x2121d6=_0x1318c7[_0x2caf('0x40')];if(!_0x402bad[_0x2caf('0x3b')][_0x2caf('0x58')](_0x2caf('0x41'))){_0x158991['limit']=qs['limit'](_0x402bad[_0x2caf('0x3b')][_0x2caf('0x20')]);_0x158991[_0x2caf('0x22')]=qs[_0x2caf('0x22')](_0x402bad[_0x2caf('0x3b')][_0x2caf('0x22')]);}return _0x421415[_0x2caf('0x66')](_0x158991);}})[_0x2caf('0x29')](function(_0x3222a6){if(_0x3222a6){return _0x3222a6?{'count':_0x2121d6,'rows':_0x3222a6}:null;}})[_0x2caf('0x29')](respondWithResult(_0x338a8d,null))[_0x2caf('0x4b')](handleError(_0x338a8d,null));};exports[_0x2caf('0x68')]=function(_0x5129d4,_0x447300,_0x313273){var _0x217778=_0x5129d4['body'][_0x2caf('0x69')];return db['Team']['findAll']({'where':{'id':_0x217778},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2caf('0x6a'),'attributes':['id',_0x2caf('0x31'),_0x2caf('0x6b'),_0x2caf('0x6c'),'interface'],'raw':!![]}]})[_0x2caf('0x29')](function(_0x2065c2){if(_0x2065c2){var _0x4a21d2=_[_0x2caf('0x6d')](_0x2065c2,function(_0x22cd27){var _0xb1f581=_0x22cd27[_0x2caf('0x2a')]({'plain':!![]});return _0xb1f581['Agents'];});return db['SmsQueue'][_0x2caf('0x4d')]({'where':{'id':_0x5129d4['params']['id']}})[_0x2caf('0x29')](function(_0x51df18){return db[_0x2caf('0x6e')]['transaction'](function(_0x4f2cf1){return _0x51df18[_0x2caf('0x68')](_0x217778,{'transaction':_0x4f2cf1})['then'](function(){return BPromise['each'](_0x4a21d2,function(_0x30fab4){return db[_0x2caf('0x5c')][_0x2caf('0x6f')]({'where':{'UserId':_0x30fab4['id'],'SmsQueueId':_0x5129d4[_0x2caf('0x4c')]['id']},'transaction':_0x4f2cf1});});})[_0x2caf('0x29')](function(){_0x4a21d2['forEach'](function(_0x6e3553){socket['emit']('userSmsQueue:save',{'UserId':_0x6e3553['id'],'SmsQueueId':_0x51df18['id']});});});});});}})[_0x2caf('0x29')](respondWithStatusCode(_0x447300,null))['catch'](handleError(_0x447300,null));};exports['removeTeams']=function(_0x222afd,_0x27199a,_0x84a87d){return db['Team'][_0x2caf('0x5d')]({'where':{'id':_0x222afd[_0x2caf('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2caf('0x5e')],'as':_0x2caf('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x2caf('0x29')](handleEntityNotFound(_0x27199a,null))[_0x2caf('0x29')](function(_0x2fdba6){var _0x88978d=_['map'](_0x2fdba6,'id');var _0x54dd23=[];var _0xf758ac=[];var _0x4a6b69=squel[_0x2caf('0x70')]();_0x4a6b69['field']('tq.TeamId')['from']('team_has_sms_queues','tq')[_0x2caf('0x71')](_0x2caf('0x72'),'ut',_0x2caf('0x73'))[_0x2caf('0x43')](_0x2caf('0x74'),_0x222afd[_0x2caf('0x4c')]['id']);for(var _0x1c506e=0x0;_0x1c506e<_0x2fdba6[_0x2caf('0x40')];_0x1c506e+=0x1){let _0x5ae6c9=_0x2fdba6[_0x1c506e];for(var _0x54d721=0x0;_0x54d721<_0x5ae6c9[_0x2caf('0x6a')][_0x2caf('0x40')];_0x54d721+=0x1){let _0x536c1d=_0x5ae6c9['Agents'][_0x54d721];var _0x739c66=_0x4a6b69[_0x2caf('0x75')]();_0x739c66[_0x2caf('0x43')](_0x2caf('0x76'),_0x536c1d['id']);_0xf758ac['push'](db[_0x2caf('0x6e')][_0x2caf('0x3b')](_0x739c66[_0x2caf('0x77')](),{'type':db[_0x2caf('0x6e')][_0x2caf('0x78')][_0x2caf('0x79')]})['then'](function(_0x1580c2){if(_0x1580c2[_0x2caf('0x40')]===0x1){return _0x536c1d['id'];}else{var _0x102599=_['every'](_[_0x2caf('0x39')](_0x1580c2,_0x2caf('0x7a')),function(_0x511202){return _[_0x2caf('0x7b')](_0x88978d,_0x511202);});if(_0x102599){return _0x536c1d['id'];}}}));}}return BPromise[_0x2caf('0x7c')](_0xf758ac)['then'](function(_0x4b3493){_0x54dd23=_(_0x54dd23)[_0x2caf('0x7d')](_0x4b3493)[_0x2caf('0x7e')]()[_0x2caf('0x7f')]();return db['SmsQueue'][_0x2caf('0x4d')]({'where':{'id':_0x222afd[_0x2caf('0x4c')]['id']}})[_0x2caf('0x29')](function(_0x152075){return db[_0x2caf('0x6e')][_0x2caf('0x80')](function(_0x4cb83b){return _0x152075[_0x2caf('0x81')](_0x222afd[_0x2caf('0x3b')][_0x2caf('0x69')],{'transaction':_0x4cb83b})['then'](function(){if(!_[_0x2caf('0x82')](_0x54dd23)){return _0x152075[_0x2caf('0x83')](_0x54dd23,{'transaction':_0x4cb83b});}})['then'](function(){_0x54dd23['forEach'](function(_0x1ca67c){socket[_0x2caf('0x84')](_0x2caf('0x85'),{'UserId':_0x1ca67c,'SmsQueueId':_0x152075['id']});});});});});});})[_0x2caf('0x29')](respondWithStatusCode(_0x27199a,null))[_0x2caf('0x4b')](handleError(_0x27199a,null));};exports[_0x2caf('0x86')]=function(_0x196213,_0x4dda15,_0x3ce1dc){return db[_0x2caf('0x33')][_0x2caf('0x4d')]({'where':{'id':_0x196213[_0x2caf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4dda15,null))[_0x2caf('0x29')](function(_0x4b8721){if(_0x4b8721){return _0x4b8721['addAgents'](_0x196213['body'][_0x2caf('0x69')],_[_0x2caf('0x87')](_0x196213[_0x2caf('0x4f')],[_0x2caf('0x69'),'id'])||{})['spread'](function(_0x314503){for(var _0xa19e7b=0x0;_0xa19e7b<_0x196213['body'][_0x2caf('0x69')][_0x2caf('0x40')];_0xa19e7b+=0x1){socket[_0x2caf('0x84')]('userSmsQueue:save',{'UserId':Number(_0x196213['body'][_0x2caf('0x69')][_0xa19e7b]),'SmsQueueId':Number(_0x196213[_0x2caf('0x4c')]['id'])});}return _0x314503;});}})[_0x2caf('0x29')](respondWithResult(_0x4dda15,null))[_0x2caf('0x4b')](handleError(_0x4dda15,null));};exports[_0x2caf('0x83')]=function(_0x6069c2,_0x259ac2,_0x37b6da){return db[_0x2caf('0x33')][_0x2caf('0x4d')]({'where':{'id':_0x6069c2[_0x2caf('0x4c')]['id']}})[_0x2caf('0x29')](handleEntityNotFound(_0x259ac2,null))[_0x2caf('0x29')](function(_0x137ff1){if(_0x137ff1){return _0x137ff1[_0x2caf('0x83')](_0x6069c2['query'][_0x2caf('0x69')])['then'](function(){if(_[_0x2caf('0x88')](_0x6069c2['query']['ids'])){for(var _0x790dac=0x0;_0x790dac<_0x6069c2[_0x2caf('0x3b')][_0x2caf('0x69')][_0x2caf('0x40')];_0x790dac+=0x1){socket[_0x2caf('0x84')](_0x2caf('0x85'),{'UserId':Number(_0x6069c2[_0x2caf('0x3b')][_0x2caf('0x69')][_0x790dac]),'SmsQueueId':Number(_0x6069c2['params']['id'])});}}else{socket[_0x2caf('0x84')](_0x2caf('0x85'),{'UserId':Number(_0x6069c2[_0x2caf('0x3b')][_0x2caf('0x69')]),'SmsQueueId':Number(_0x6069c2[_0x2caf('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x259ac2,null))[_0x2caf('0x4b')](handleError(_0x259ac2,null));};exports[_0x2caf('0x89')]=function(_0x42c1b8,_0x2cad81,_0xea7498){var _0x5c1ca7={};var _0x3af6bc={};var _0x447fa9;var _0x21a8f8;return db['SmsQueue'][_0x2caf('0x57')]({'where':{'id':_0x42c1b8[_0x2caf('0x4c')]['id']}})[_0x2caf('0x29')](handleEntityNotFound(_0x2cad81,null))[_0x2caf('0x29')](function(_0x3c9cb9){if(_0x3c9cb9){_0x447fa9=_0x3c9cb9;_0x3af6bc[_0x2caf('0x38')]=_[_0x2caf('0x3a')](db[_0x2caf('0x5e')][_0x2caf('0x34')]);_0x3af6bc['query']=_[_0x2caf('0x3a')](_0x42c1b8[_0x2caf('0x3b')]);_0x3af6bc[_0x2caf('0x3c')]=_[_0x2caf('0x3d')](_0x3af6bc['model'],_0x3af6bc['query']);_0x5c1ca7[_0x2caf('0x3e')]=_[_0x2caf('0x3d')](_0x3af6bc[_0x2caf('0x38')],qs['fields'](_0x42c1b8[_0x2caf('0x3b')]['fields']));_0x5c1ca7['attributes']=_0x5c1ca7[_0x2caf('0x3e')][_0x2caf('0x40')]?_0x5c1ca7['attributes']:_0x3af6bc['model'];_0x5c1ca7[_0x2caf('0x59')]=qs['sort'](_0x42c1b8['query'][_0x2caf('0x42')]);_0x5c1ca7[_0x2caf('0x43')]=qs[_0x2caf('0x3c')](_[_0x2caf('0x44')](_0x42c1b8[_0x2caf('0x3b')],_0x3af6bc[_0x2caf('0x3c')]));if(_0x42c1b8[_0x2caf('0x3b')][_0x2caf('0x45')]){_0x5c1ca7[_0x2caf('0x43')]=_[_0x2caf('0x47')](_0x5c1ca7[_0x2caf('0x43')],{'$or':_[_0x2caf('0x39')](_0x5c1ca7[_0x2caf('0x3e')],function(_0x45e008){var _0x5d2715={};_0x5d2715[_0x45e008]={'$like':'%'+_0x42c1b8[_0x2caf('0x3b')][_0x2caf('0x45')]+'%'};return _0x5d2715;})});}_0x5c1ca7=_[_0x2caf('0x47')]({},_0x5c1ca7,_0x42c1b8[_0x2caf('0x5b')]);return _0x447fa9[_0x2caf('0x89')](_0x5c1ca7);}})['then'](function(_0x19e9b4){if(_0x19e9b4){_0x21a8f8=_0x19e9b4[_0x2caf('0x40')];if(!_0x42c1b8['query']['hasOwnProperty'](_0x2caf('0x41'))){_0x5c1ca7[_0x2caf('0x20')]=qs[_0x2caf('0x20')](_0x42c1b8[_0x2caf('0x3b')][_0x2caf('0x20')]);_0x5c1ca7[_0x2caf('0x22')]=qs[_0x2caf('0x22')](_0x42c1b8[_0x2caf('0x3b')][_0x2caf('0x22')]);}return _0x447fa9[_0x2caf('0x89')](_0x5c1ca7);}})[_0x2caf('0x29')](function(_0x7fc0c8){if(_0x7fc0c8){return _0x7fc0c8?{'count':_0x21a8f8,'rows':_0x7fc0c8}:null;}})[_0x2caf('0x29')](respondWithResult(_0x2cad81,null))['catch'](handleError(_0x2cad81,null));};
\ No newline at end of file
index ae77f84..40f9777 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa14c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x49c4e6,_0x2fbbb5){var _0x4f1992=function(_0x17015e){while(--_0x17015e){_0x49c4e6['push'](_0x49c4e6['shift']());}};_0x4f1992(++_0x2fbbb5);}(_0xa14c,0xbb));var _0xca14=function(_0x44d7df,_0x247a04){_0x44d7df=_0x44d7df-0x0;var _0x336d48=_0xa14c[_0x44d7df];return _0x336d48;};'use strict';var EventEmitter=require(_0xca14('0x0'));var SmsQueue=require(_0xca14('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xca14('0x2')](0x0);var events={'afterCreate':_0xca14('0x3'),'afterUpdate':_0xca14('0x4'),'afterDestroy':_0xca14('0x5')};function emitEvent(_0x321120){return function(_0x1e7df0,_0x59011c,_0x4f245a){SmsQueueEvents[_0xca14('0x6')](_0x321120+':'+_0x1e7df0['id'],_0x1e7df0);SmsQueueEvents[_0xca14('0x6')](_0x321120,_0x1e7df0);_0x4f245a(null);};}for(var e in events){if(events[_0xca14('0x7')](e)){var event=events[e];SmsQueue[_0xca14('0x8')](e,emitEvent(event));}}module[_0xca14('0x9')]=SmsQueueEvents;
\ No newline at end of file
+var _0x6303=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsQueue'];(function(_0x56d392,_0x48b306){var _0xf11b94=function(_0x529e6e){while(--_0x529e6e){_0x56d392['push'](_0x56d392['shift']());}};_0xf11b94(++_0x48b306);}(_0x6303,0xf7));var _0x3630=function(_0x13cf9e,_0x5bfc61){_0x13cf9e=_0x13cf9e-0x0;var _0x31f145=_0x6303[_0x13cf9e];return _0x31f145;};'use strict';var EventEmitter=require(_0x3630('0x0'));var SmsQueue=require(_0x3630('0x1'))['db'][_0x3630('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3630('0x3')](0x0);var events={'afterCreate':_0x3630('0x4'),'afterUpdate':_0x3630('0x5'),'afterDestroy':_0x3630('0x6')};function emitEvent(_0x41e88c){return function(_0x70b5e7,_0x1ac22f,_0x5f13c8){SmsQueueEvents[_0x3630('0x7')](_0x41e88c+':'+_0x70b5e7['id'],_0x70b5e7);SmsQueueEvents[_0x3630('0x7')](_0x41e88c,_0x70b5e7);_0x5f13c8(null);};}for(var e in events){if(events[_0x3630('0x8')](e)){var event=events[e];SmsQueue[_0x3630('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index dc49727..de66929 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bfc=['./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x169571,_0xbcda34){var _0x42b9be=function(_0x54079c){while(--_0x54079c){_0x169571['push'](_0x169571['shift']());}};_0x42b9be(++_0xbcda34);}(_0x2bfc,0x1e4));var _0xc2bf=function(_0x456f43,_0x31a177){_0x456f43=_0x456f43-0x0;var _0x364705=_0x2bfc[_0x456f43];return _0x364705;};'use strict';var _=require(_0xc2bf('0x0'));var util=require('util');var logger=require(_0xc2bf('0x1'))('api');var moment=require(_0xc2bf('0x2'));var BPromise=require(_0xc2bf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc2bf('0x4'));var config=require(_0xc2bf('0x5'));var attributes=require(_0xc2bf('0x6'));module[_0xc2bf('0x7')]=function(_0x1a95af,_0x5d26ec){return _0x1a95af['define'](_0xc2bf('0x8'),attributes,{'tableName':_0xc2bf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xce79=['moment','bluebird','request-promise','rimraf','../../config/environment','define','SmsQueue','sms_queues','lodash','util','api'];(function(_0x3b5377,_0x1cf47a){var _0x40ffde=function(_0x3011df){while(--_0x3011df){_0x3b5377['push'](_0x3b5377['shift']());}};_0x40ffde(++_0x1cf47a);}(_0xce79,0xe4));var _0x9ce7=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0xce79[_0x28e74e];return _0xb45ac1;};'use strict';var _=require(_0x9ce7('0x0'));var util=require(_0x9ce7('0x1'));var logger=require('../../config/logger')(_0x9ce7('0x2'));var moment=require(_0x9ce7('0x3'));var BPromise=require(_0x9ce7('0x4'));var rp=require(_0x9ce7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ce7('0x6'));var config=require(_0x9ce7('0x7'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0xf28682,_0x54209c){return _0xf28682[_0x9ce7('0x8')](_0x9ce7('0x9'),attributes,{'tableName':_0x9ce7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f03f271..248f743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b0c=['ShowSmsQueue','find','raw','where','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','GetSmsQueue','SmsQueue','options','attributes','limit','include','map','model','debug'];(function(_0x2491d1,_0x3cba9f){var _0x212fb2=function(_0x5afc79){while(--_0x5afc79){_0x2491d1['push'](_0x2491d1['shift']());}};_0x212fb2(++_0x3cba9f);}(_0x6b0c,0x80));var _0xc6b0=function(_0x4ee438,_0x133d3b){_0x4ee438=_0x4ee438-0x0;var _0x200538=_0x6b0c[_0x4ee438];return _0x200538;};'use strict';var _=require(_0xc6b0('0x0'));var util=require(_0xc6b0('0x1'));var moment=require(_0xc6b0('0x2'));var BPromise=require(_0xc6b0('0x3'));var rs=require(_0xc6b0('0x4'));var fs=require('fs');var Redis=require(_0xc6b0('0x5'));var db=require(_0xc6b0('0x6'))['db'];var utils=require(_0xc6b0('0x7'));var logger=require('../../config/logger')(_0xc6b0('0x8'));var config=require('../../config/environment');var jayson=require(_0xc6b0('0x9'));var client=jayson[_0xc6b0('0xa')][_0xc6b0('0xb')]({'port':0x232a});config['redis']=_[_0xc6b0('0xc')](config[_0xc6b0('0xd')],{'host':_0xc6b0('0xe'),'port':0x18eb});var socket=require(_0xc6b0('0xf'))(new Redis(config['redis']));require(_0xc6b0('0x10'))[_0xc6b0('0x11')](socket);function respondWithRpcPromise(_0xac7311,_0x39eb72,_0x281b3c){return new BPromise(function(_0x500f68,_0x299c19){return client[_0xc6b0('0x12')](_0xac7311,_0x281b3c)[_0xc6b0('0x13')](function(_0x328ef6){logger['info'](_0xc6b0('0x14'),_0x39eb72,'request\x20sent');logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x39eb72,_0xc6b0('0x15'),JSON['stringify'](_0x328ef6));if(_0x328ef6[_0xc6b0('0x16')]){if(_0x328ef6[_0xc6b0('0x16')][_0xc6b0('0x17')]===0x1f4){logger[_0xc6b0('0x16')](_0xc6b0('0x14'),_0x39eb72,_0x328ef6[_0xc6b0('0x16')]['message']);return _0x299c19(_0x328ef6[_0xc6b0('0x16')]['message']);}logger[_0xc6b0('0x16')](_0xc6b0('0x14'),_0x39eb72,_0x328ef6[_0xc6b0('0x16')][_0xc6b0('0x18')]);return _0x500f68(_0x328ef6[_0xc6b0('0x16')][_0xc6b0('0x18')]);}else{logger[_0xc6b0('0x19')](_0xc6b0('0x14'),_0x39eb72,'request\x20sent');_0x500f68(_0x328ef6['result']['message']);}})[_0xc6b0('0x1a')](function(_0x306ec5){logger[_0xc6b0('0x16')](_0xc6b0('0x14'),_0x39eb72,_0x306ec5);_0x299c19(_0x306ec5);});});}exports[_0xc6b0('0x1b')]=function(_0x10eaef){var _0x28a234=this;return new Promise(function(_0x58842f,_0x1ce9df){return db[_0xc6b0('0x1c')]['findAll']({'raw':_0x10eaef[_0xc6b0('0x1d')]?_0x10eaef['options']['raw']===undefined?!![]:![]:!![],'where':_0x10eaef[_0xc6b0('0x1d')]?_0x10eaef[_0xc6b0('0x1d')]['where']||null:null,'attributes':_0x10eaef[_0xc6b0('0x1d')]?_0x10eaef[_0xc6b0('0x1d')][_0xc6b0('0x1e')]||null:null,'limit':_0x10eaef[_0xc6b0('0x1d')]?_0x10eaef[_0xc6b0('0x1d')][_0xc6b0('0x1f')]||null:null,'include':_0x10eaef[_0xc6b0('0x1d')]?_0x10eaef['options'][_0xc6b0('0x20')]?_[_0xc6b0('0x21')](_0x10eaef[_0xc6b0('0x1d')][_0xc6b0('0x20')],function(_0x2f6dea){return{'model':db[_0x2f6dea[_0xc6b0('0x22')]],'as':_0x2f6dea['as'],'attributes':_0x2f6dea[_0xc6b0('0x1e')],'include':_0x2f6dea[_0xc6b0('0x20')]?_[_0xc6b0('0x21')](_0x2f6dea[_0xc6b0('0x20')],function(_0xcc8a9d){return{'model':db[_0xcc8a9d[_0xc6b0('0x22')]],'as':_0xcc8a9d['as'],'attributes':_0xcc8a9d[_0xc6b0('0x1e')],'include':_0xcc8a9d['include']?_[_0xc6b0('0x21')](_0xcc8a9d[_0xc6b0('0x20')],function(_0x1de3b3){return{'model':db[_0x1de3b3[_0xc6b0('0x22')]],'as':_0x1de3b3['as'],'attributes':_0x1de3b3[_0xc6b0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e704c){logger[_0xc6b0('0x19')](_0xc6b0('0x1b'),_0x10eaef);logger[_0xc6b0('0x23')](_0xc6b0('0x1b'),_0x10eaef,JSON['stringify'](_0x2e704c));_0x58842f(_0x2e704c);})[_0xc6b0('0x1a')](function(_0x3662fd){logger[_0xc6b0('0x16')](_0xc6b0('0x1b'),_0x3662fd[_0xc6b0('0x18')],_0x10eaef);_0x1ce9df(_0x28a234[_0xc6b0('0x16')](0x1f4,_0x3662fd['message']));});});};exports[_0xc6b0('0x24')]=function(_0x3e6a04){var _0x3969ac=this;return new Promise(function(_0x500132,_0x1c837c){return db[_0xc6b0('0x1c')][_0xc6b0('0x25')]({'raw':_0x3e6a04[_0xc6b0('0x1d')]?_0x3e6a04['options'][_0xc6b0('0x26')]===undefined?!![]:![]:!![],'where':_0x3e6a04[_0xc6b0('0x1d')]?_0x3e6a04['options'][_0xc6b0('0x27')]||null:null,'attributes':_0x3e6a04['options']?_0x3e6a04['options']['attributes']||null:null,'include':_0x3e6a04[_0xc6b0('0x1d')]?_0x3e6a04[_0xc6b0('0x1d')][_0xc6b0('0x20')]?_[_0xc6b0('0x21')](_0x3e6a04[_0xc6b0('0x1d')][_0xc6b0('0x20')],function(_0x185594){return{'model':db[_0x185594[_0xc6b0('0x22')]],'as':_0x185594['as'],'attributes':_0x185594[_0xc6b0('0x1e')],'include':_0x185594['include']?_[_0xc6b0('0x21')](_0x185594[_0xc6b0('0x20')],function(_0x1b5658){return{'model':db[_0x1b5658['model']],'as':_0x1b5658['as'],'attributes':_0x1b5658[_0xc6b0('0x1e')],'include':_0x1b5658[_0xc6b0('0x20')]?_[_0xc6b0('0x21')](_0x1b5658['include'],function(_0x3cd258){return{'model':db[_0x3cd258['model']],'as':_0x3cd258['as'],'attributes':_0x3cd258[_0xc6b0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc6b0('0x13')](function(_0x89a096){logger[_0xc6b0('0x19')](_0xc6b0('0x24'),_0x3e6a04);logger[_0xc6b0('0x23')](_0xc6b0('0x24'),_0x3e6a04,JSON[_0xc6b0('0x28')](_0x89a096));_0x500132(_0x89a096);})['catch'](function(_0x92813){logger[_0xc6b0('0x16')](_0xc6b0('0x24'),_0x92813['message'],_0x3e6a04);_0x1c837c(_0x3969ac[_0xc6b0('0x16')](0x1f4,_0x92813['message']));});});};
\ No newline at end of file
+var _0x2602=['SmsQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','GetSmsQueue','options','raw','attributes','limit','include','map','model','catch','ShowSmsQueue','SmsQueue','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2602,0xd1));var _0x2260=function(_0x4c788b,_0x215354){_0x4c788b=_0x4c788b-0x0;var _0x3cd965=_0x2602[_0x4c788b];return _0x3cd965;};'use strict';var _=require(_0x2260('0x0'));var util=require(_0x2260('0x1'));var moment=require(_0x2260('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2260('0x3'));var db=require(_0x2260('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2260('0x5'))(_0x2260('0x6'));var config=require(_0x2260('0x7'));var jayson=require(_0x2260('0x8'));var client=jayson[_0x2260('0x9')][_0x2260('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2260('0xb')],{'host':_0x2260('0xc'),'port':0x18eb});var socket=require(_0x2260('0xd'))(new Redis(config[_0x2260('0xb')]));require(_0x2260('0xe'))[_0x2260('0xf')](socket);function respondWithRpcPromise(_0x24348d,_0x5df4de,_0x3292ab){return new BPromise(function(_0x58f9d8,_0x55fcbb){return client[_0x2260('0x10')](_0x24348d,_0x3292ab)[_0x2260('0x11')](function(_0x47e180){logger[_0x2260('0x12')](_0x2260('0x13'),_0x5df4de,'request\x20sent');logger[_0x2260('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x5df4de,_0x2260('0x15'),JSON['stringify'](_0x47e180));if(_0x47e180['error']){if(_0x47e180[_0x2260('0x16')][_0x2260('0x17')]===0x1f4){logger['error'](_0x2260('0x13'),_0x5df4de,_0x47e180[_0x2260('0x16')][_0x2260('0x18')]);return _0x55fcbb(_0x47e180[_0x2260('0x16')][_0x2260('0x18')]);}logger[_0x2260('0x16')]('SmsQueue,\x20%s,\x20%s',_0x5df4de,_0x47e180['error'][_0x2260('0x18')]);return _0x58f9d8(_0x47e180['error'][_0x2260('0x18')]);}else{logger[_0x2260('0x12')](_0x2260('0x13'),_0x5df4de,_0x2260('0x15'));_0x58f9d8(_0x47e180[_0x2260('0x19')]['message']);}})['catch'](function(_0x1cb2c0){logger[_0x2260('0x16')](_0x2260('0x13'),_0x5df4de,_0x1cb2c0);_0x55fcbb(_0x1cb2c0);});});}exports[_0x2260('0x1a')]=function(_0x3da440){var _0x49d85a=this;return new Promise(function(_0x1771d3,_0xb5b42b){return db['SmsQueue']['findAll']({'raw':_0x3da440['options']?_0x3da440[_0x2260('0x1b')][_0x2260('0x1c')]===undefined?!![]:![]:!![],'where':_0x3da440['options']?_0x3da440[_0x2260('0x1b')]['where']||null:null,'attributes':_0x3da440[_0x2260('0x1b')]?_0x3da440[_0x2260('0x1b')][_0x2260('0x1d')]||null:null,'limit':_0x3da440[_0x2260('0x1b')]?_0x3da440[_0x2260('0x1b')][_0x2260('0x1e')]||null:null,'include':_0x3da440['options']?_0x3da440[_0x2260('0x1b')][_0x2260('0x1f')]?_[_0x2260('0x20')](_0x3da440['options'][_0x2260('0x1f')],function(_0x108169){return{'model':db[_0x108169['model']],'as':_0x108169['as'],'attributes':_0x108169['attributes'],'include':_0x108169['include']?_[_0x2260('0x20')](_0x108169[_0x2260('0x1f')],function(_0x39a65f){return{'model':db[_0x39a65f[_0x2260('0x21')]],'as':_0x39a65f['as'],'attributes':_0x39a65f[_0x2260('0x1d')],'include':_0x39a65f[_0x2260('0x1f')]?_[_0x2260('0x20')](_0x39a65f[_0x2260('0x1f')],function(_0x38f45f){return{'model':db[_0x38f45f[_0x2260('0x21')]],'as':_0x38f45f['as'],'attributes':_0x38f45f[_0x2260('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2260('0x11')](function(_0xf2a8ae){logger[_0x2260('0x12')](_0x2260('0x1a'),_0x3da440);logger[_0x2260('0x14')](_0x2260('0x1a'),_0x3da440,JSON['stringify'](_0xf2a8ae));_0x1771d3(_0xf2a8ae);})[_0x2260('0x22')](function(_0x34fa0a){logger[_0x2260('0x16')](_0x2260('0x1a'),_0x34fa0a['message'],_0x3da440);_0xb5b42b(_0x49d85a[_0x2260('0x16')](0x1f4,_0x34fa0a['message']));});});};exports[_0x2260('0x23')]=function(_0x5df63f){var _0x5aee91=this;return new Promise(function(_0x3184de,_0x52e3e2){return db[_0x2260('0x24')]['find']({'raw':_0x5df63f[_0x2260('0x1b')]?_0x5df63f[_0x2260('0x1b')][_0x2260('0x1c')]===undefined?!![]:![]:!![],'where':_0x5df63f[_0x2260('0x1b')]?_0x5df63f[_0x2260('0x1b')]['where']||null:null,'attributes':_0x5df63f['options']?_0x5df63f[_0x2260('0x1b')][_0x2260('0x1d')]||null:null,'include':_0x5df63f[_0x2260('0x1b')]?_0x5df63f[_0x2260('0x1b')][_0x2260('0x1f')]?_[_0x2260('0x20')](_0x5df63f[_0x2260('0x1b')][_0x2260('0x1f')],function(_0x26d34f){return{'model':db[_0x26d34f[_0x2260('0x21')]],'as':_0x26d34f['as'],'attributes':_0x26d34f['attributes'],'include':_0x26d34f[_0x2260('0x1f')]?_[_0x2260('0x20')](_0x26d34f[_0x2260('0x1f')],function(_0x1a5405){return{'model':db[_0x1a5405['model']],'as':_0x1a5405['as'],'attributes':_0x1a5405[_0x2260('0x1d')],'include':_0x1a5405[_0x2260('0x1f')]?_[_0x2260('0x20')](_0x1a5405[_0x2260('0x1f')],function(_0x287830){return{'model':db[_0x287830[_0x2260('0x21')]],'as':_0x287830['as'],'attributes':_0x287830[_0x2260('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2260('0x11')](function(_0x13cd5f){logger[_0x2260('0x12')]('ShowSmsQueue',_0x5df63f);logger['debug'](_0x2260('0x23'),_0x5df63f,JSON[_0x2260('0x25')](_0x13cd5f));_0x3184de(_0x13cd5f);})['catch'](function(_0x38897c){logger[_0x2260('0x16')](_0x2260('0x23'),_0x38897c['message'],_0x5df63f);_0x52e3e2(_0x5aee91[_0x2260('0x16')](0x1f4,_0x38897c['message']));});});};
\ No newline at end of file
index f2f50da..f11a0fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcec1=['update','emit','removeListener','register','smsQueue:','save'];(function(_0x12082d,_0x225abd){var _0x4ed1f7=function(_0x531b71){while(--_0x531b71){_0x12082d['push'](_0x12082d['shift']());}};_0x4ed1f7(++_0x225abd);}(_0xcec1,0x1bb));var _0x1cec=function(_0x2c4454,_0x364e21){_0x2c4454=_0x2c4454-0x0;var _0x1fa744=_0xcec1[_0x2c4454];return _0x1fa744;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x1cec('0x0'),'remove',_0x1cec('0x1')];function createListener(_0x153aa7,_0xd870e7){return function(_0x131026){_0xd870e7[_0x1cec('0x2')](_0x153aa7,_0x131026);};}function removeListener(_0x5838f0,_0x880a62){return function(){SmsQueueEvents[_0x1cec('0x3')](_0x5838f0,_0x880a62);};}exports[_0x1cec('0x4')]=function(_0x35723b){for(var _0x3b5b19=0x0,_0x15516e=events['length'];_0x3b5b19<_0x15516e;_0x3b5b19++){var _0x48f916=events[_0x3b5b19];var _0x366e48=createListener(_0x1cec('0x5')+_0x48f916,_0x35723b);SmsQueueEvents['on'](_0x48f916,_0x366e48);}};
\ No newline at end of file
+var _0x9600=['remove','update','emit','removeListener','register','length','smsQueue:','./smsQueue.events','save'];(function(_0x5edb09,_0xf042c7){var _0x221f2c=function(_0x4a2f36){while(--_0x4a2f36){_0x5edb09['push'](_0x5edb09['shift']());}};_0x221f2c(++_0xf042c7);}(_0x9600,0xbb));var _0x0960=function(_0x379b40,_0x245e67){_0x379b40=_0x379b40-0x0;var _0x146b45=_0x9600[_0x379b40];return _0x146b45;};'use strict';var SmsQueueEvents=require(_0x0960('0x0'));var events=[_0x0960('0x1'),_0x0960('0x2'),_0x0960('0x3')];function createListener(_0x56ab3d,_0x37d3f6){return function(_0x53eb4e){_0x37d3f6[_0x0960('0x4')](_0x56ab3d,_0x53eb4e);};}function removeListener(_0x4e2204,_0x25119d){return function(){SmsQueueEvents[_0x0960('0x5')](_0x4e2204,_0x25119d);};}exports[_0x0960('0x6')]=function(_0x1858dd){for(var _0x2188e7=0x0,_0x4fa1e3=events[_0x0960('0x7')];_0x2188e7<_0x4fa1e3;_0x2188e7++){var _0x306a1a=events[_0x2188e7];var _0x5622be=createListener(_0x0960('0x8')+_0x306a1a,_0x1858dd);SmsQueueEvents['on'](_0x306a1a,_0x5622be);}};
\ No newline at end of file
index 75dbc2e..3077aef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe13a=['exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy'];(function(_0x519424,_0x16460c){var _0x4d5573=function(_0x591939){while(--_0x591939){_0x519424['push'](_0x519424['shift']());}};_0x4d5573(++_0x16460c);}(_0xe13a,0x1ee));var _0xae13=function(_0x1fd1b4,_0x1774c5){_0x1fd1b4=_0x1fd1b4-0x0;var _0x3ca0d2=_0xe13a[_0x1fd1b4];return _0x3ca0d2;};'use strict';var multer=require(_0xae13('0x0'));var util=require(_0xae13('0x1'));var path=require(_0xae13('0x2'));var timeout=require('connect-timeout');var express=require(_0xae13('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xae13('0x4'));var interaction=require(_0xae13('0x5'));var config=require('../../config/environment');var controller=require(_0xae13('0x6'));router[_0xae13('0x7')]('/',auth[_0xae13('0x8')](),controller['index']);router[_0xae13('0x7')]('/describe',auth[_0xae13('0x8')](),controller['describe']);router[_0xae13('0x7')](_0xae13('0x9'),auth[_0xae13('0x8')](),controller[_0xae13('0xa')]);router[_0xae13('0xb')]('/',auth[_0xae13('0x8')](),controller['create']);router[_0xae13('0xc')](_0xae13('0x9'),auth[_0xae13('0x8')](),controller[_0xae13('0xd')]);router[_0xae13('0xe')](_0xae13('0x9'),auth['isAuthenticated'](),controller[_0xae13('0xf')]);module[_0xae13('0x10')]=router;
\ No newline at end of file
+var _0x77f7=['get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c093e,_0x10dad7){var _0x399228=function(_0x4d00dd){while(--_0x4d00dd){_0x4c093e['push'](_0x4c093e['shift']());}};_0x399228(++_0x10dad7);}(_0x77f7,0xbd));var _0x777f=function(_0x410947,_0x231adf){_0x410947=_0x410947-0x0;var _0x4fbe59=_0x77f7[_0x410947];return _0x4fbe59;};'use strict';var multer=require(_0x777f('0x0'));var util=require(_0x777f('0x1'));var path=require(_0x777f('0x2'));var timeout=require(_0x777f('0x3'));var express=require(_0x777f('0x4'));var router=express[_0x777f('0x5')]();var fs_extra=require(_0x777f('0x6'));var auth=require(_0x777f('0x7'));var interaction=require(_0x777f('0x8'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0x777f('0x9')]('/',auth[_0x777f('0xa')](),controller[_0x777f('0xb')]);router[_0x777f('0x9')](_0x777f('0xc'),auth[_0x777f('0xa')](),controller[_0x777f('0xd')]);router[_0x777f('0x9')](_0x777f('0xe'),auth[_0x777f('0xa')](),controller['show']);router[_0x777f('0xf')]('/',auth['isAuthenticated'](),controller[_0x777f('0x10')]);router[_0x777f('0x11')]('/:id',auth[_0x777f('0xa')](),controller[_0x777f('0x12')]);router[_0x777f('0x13')]('/:id',auth[_0x777f('0xa')](),controller[_0x777f('0x14')]);module[_0x777f('0x15')]=router;
\ No newline at end of file
index d501c79..57b9c55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8435=['DATE','moment','sequelize','exports','STRING'];(function(_0x211191,_0x4528cc){var _0x4cb3bc=function(_0x2fdb20){while(--_0x2fdb20){_0x211191['push'](_0x211191['shift']());}};_0x4cb3bc(++_0x4528cc);}(_0x8435,0xf6));var _0x5843=function(_0x6b3347,_0x204a6d){_0x6b3347=_0x6b3347-0x0;var _0xfdd8a2=_0x8435[_0x6b3347];return _0xfdd8a2;};'use strict';var moment=require(_0x5843('0x0'));var Sequelize=require(_0x5843('0x1'));module[_0x5843('0x2')]={'uniqueid':{'type':Sequelize[_0x5843('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5843('0x3')]},'joinAt':{'type':Sequelize[_0x5843('0x4')]},'leaveAt':{'type':Sequelize[_0x5843('0x4')]},'acceptAt':{'type':Sequelize[_0x5843('0x4')]},'exitAt':{'type':Sequelize[_0x5843('0x4')]},'reason':{'type':Sequelize[_0x5843('0x3')]}};
\ No newline at end of file
+var _0x4575=['sequelize','exports','STRING','DATE','moment'];(function(_0x3767e8,_0x33dc50){var _0x32b356=function(_0x3f59ba){while(--_0x3f59ba){_0x3767e8['push'](_0x3767e8['shift']());}};_0x32b356(++_0x33dc50);}(_0x4575,0x1c1));var _0x5457=function(_0xd22918,_0x1de1a1){_0xd22918=_0xd22918-0x0;var _0x30c9f9=_0x4575[_0xd22918];return _0x30c9f9;};'use strict';var moment=require(_0x5457('0x0'));var Sequelize=require(_0x5457('0x1'));module[_0x5457('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5457('0x3')]},'joinAt':{'type':Sequelize[_0x5457('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5457('0x3')]}};
\ No newline at end of file
index da5b52e..f15ff77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0812=['set','Content-Range','json','apply','reject','update','destroy','then','end','sendStatus','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','offset','undefined','limit','count'];(function(_0x3a7f4,_0x2ca41e){var _0x471f13=function(_0x575dbf){while(--_0x575dbf){_0x3a7f4['push'](_0x3a7f4['shift']());}};_0x471f13(++_0x2ca41e);}(_0x0812,0xc0));var _0x2081=function(_0x51cdd3,_0x320122){_0x51cdd3=_0x51cdd3-0x0;var _0x19b0b4=_0x0812[_0x51cdd3];return _0x19b0b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2081('0x0'));var zipdir=require(_0x2081('0x1'));var jsonpatch=require(_0x2081('0x2'));var rp=require(_0x2081('0x3'));var moment=require(_0x2081('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2081('0x5'));var util=require(_0x2081('0x6'));var path=require(_0x2081('0x7'));var sox=require(_0x2081('0x8'));var csv=require(_0x2081('0x9'));var ejs=require(_0x2081('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2081('0xb'));var squel=require('squel');var crypto=require(_0x2081('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2081('0xd'));var toCsv=require(_0x2081('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2081('0xe'));var qs=require(_0x2081('0xf'));var as=require(_0x2081('0x10'));var hardwareService=require(_0x2081('0x11'));var logger=require(_0x2081('0x12'))(_0x2081('0x13'));var utils=require(_0x2081('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2081('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19f57d,_0x5377a5){_0x5377a5=_0x5377a5||0xcc;return function(_0x239236){if(_0x239236){return _0x19f57d['sendStatus'](_0x5377a5);}return _0x19f57d[_0x2081('0x16')](_0x5377a5)['end']();};}function respondWithResult(_0x1ca513,_0x75e776){_0x75e776=_0x75e776||0xc8;return function(_0x22e40e){if(_0x22e40e){return _0x1ca513[_0x2081('0x16')](_0x75e776)['json'](_0x22e40e);}};}function respondWithFilteredResult(_0x5ae924,_0x2319e7){return function(_0xe8c6ea){if(_0xe8c6ea){var _0x2180c4=typeof _0x2319e7[_0x2081('0x17')]===_0x2081('0x18')&&typeof _0x2319e7[_0x2081('0x19')]===_0x2081('0x18');var _0x5e1a31=_0xe8c6ea['count'];var _0x3209d4=_0x2180c4?0x0:_0x2319e7[_0x2081('0x17')];var _0x3de36c=_0x2180c4?_0xe8c6ea[_0x2081('0x1a')]:_0x2319e7['offset']+_0x2319e7[_0x2081('0x19')];var _0x4ee909;if(_0x3de36c>=_0x5e1a31){_0x3de36c=_0x5e1a31;_0x4ee909=0xc8;}else{_0x4ee909=0xce;}_0x5ae924[_0x2081('0x16')](_0x4ee909);return _0x5ae924[_0x2081('0x1b')](_0x2081('0x1c'),_0x3209d4+'-'+_0x3de36c+'/'+_0x5e1a31)[_0x2081('0x1d')](_0xe8c6ea);}return null;};}function patchUpdates(_0x3882f3){return function(_0x6f644e){try{jsonpatch[_0x2081('0x1e')](_0x6f644e,_0x3882f3,!![]);}catch(_0x3a844a){return BPromise[_0x2081('0x1f')](_0x3a844a);}return _0x6f644e['save']();};}function saveUpdates(_0x3b505b,_0x274741){return function(_0x150c9f){if(_0x150c9f){return _0x150c9f[_0x2081('0x20')](_0x3b505b)['then'](function(_0x3b115c){return _0x3b115c;});}return null;};}function removeEntity(_0x530eeb,_0x4dda5b){return function(_0x558bdd){if(_0x558bdd){return _0x558bdd[_0x2081('0x21')]()[_0x2081('0x22')](function(){_0x530eeb['status'](0xcc)[_0x2081('0x23')]();});}};}function handleEntityNotFound(_0xce7193,_0x28df9d){return function(_0x405540){if(!_0x405540){_0xce7193[_0x2081('0x24')](0x194);}return _0x405540;};}function handleError(_0x2cf9fd,_0x209309){_0x209309=_0x209309||0x1f4;return function(_0x1611fa){logger['error'](_0x1611fa[_0x2081('0x25')]);if(_0x1611fa[_0x2081('0x26')]){delete _0x1611fa[_0x2081('0x26')];}_0x2cf9fd['status'](_0x209309)[_0x2081('0x27')](_0x1611fa);};}exports[_0x2081('0x28')]=function(_0x2fb3c2,_0x55b96a){var _0x44f46c={},_0x17a214={},_0x4dfb23={'count':0x0,'rows':[]};var _0xf9414e=_[_0x2081('0x29')](db[_0x2081('0x2a')][_0x2081('0x2b')],function(_0x3cd7a2){return{'name':_0x3cd7a2[_0x2081('0x2c')],'type':_0x3cd7a2[_0x2081('0x2d')][_0x2081('0x2e')]};});_0x17a214[_0x2081('0x2f')]=_[_0x2081('0x29')](_0xf9414e,_0x2081('0x26'));_0x17a214[_0x2081('0x30')]=_['keys'](_0x2fb3c2[_0x2081('0x30')]);_0x17a214[_0x2081('0x31')]=_[_0x2081('0x32')](_0x17a214[_0x2081('0x2f')],_0x17a214[_0x2081('0x30')]);_0x44f46c[_0x2081('0x33')]=_[_0x2081('0x32')](_0x17a214[_0x2081('0x2f')],qs['fields'](_0x2fb3c2[_0x2081('0x30')][_0x2081('0x34')]));_0x44f46c[_0x2081('0x33')]=_0x44f46c['attributes'][_0x2081('0x35')]?_0x44f46c[_0x2081('0x33')]:_0x17a214['model'];if(!_0x2fb3c2[_0x2081('0x30')][_0x2081('0x36')](_0x2081('0x37'))){_0x44f46c['limit']=qs[_0x2081('0x19')](_0x2fb3c2[_0x2081('0x30')][_0x2081('0x19')]);_0x44f46c[_0x2081('0x17')]=qs[_0x2081('0x17')](_0x2fb3c2['query'][_0x2081('0x17')]);}_0x44f46c[_0x2081('0x38')]=qs[_0x2081('0x39')](_0x2fb3c2[_0x2081('0x30')][_0x2081('0x39')]);_0x44f46c[_0x2081('0x3a')]=qs[_0x2081('0x31')](_['pick'](_0x2fb3c2[_0x2081('0x30')],_0x17a214[_0x2081('0x31')]),_0xf9414e);if(_0x2fb3c2[_0x2081('0x30')][_0x2081('0x3b')]){_0x44f46c['where']=_[_0x2081('0x3c')](_0x44f46c[_0x2081('0x3a')],{'$or':_[_0x2081('0x29')](_0xf9414e,function(_0x367985){if(_0x367985[_0x2081('0x2d')]!==_0x2081('0x3d')){var _0x232d57={};_0x232d57[_0x367985[_0x2081('0x26')]]={'$like':'%'+_0x2fb3c2[_0x2081('0x30')]['filter']+'%'};return _0x232d57;}})});}_0x44f46c=_['merge']({},_0x44f46c,_0x2fb3c2['options']);var _0x1f19a2={'where':_0x44f46c[_0x2081('0x3a')]};return db[_0x2081('0x2a')][_0x2081('0x1a')](_0x1f19a2)[_0x2081('0x22')](function(_0x4b0f36){_0x4dfb23['count']=_0x4b0f36;if(_0x2fb3c2[_0x2081('0x30')][_0x2081('0x3e')]){_0x44f46c[_0x2081('0x3f')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x44f46c);})[_0x2081('0x22')](function(_0x2cff41){_0x4dfb23[_0x2081('0x40')]=_0x2cff41;return _0x4dfb23;})['then'](respondWithFilteredResult(_0x55b96a,_0x44f46c))[_0x2081('0x41')](handleError(_0x55b96a,null));};exports[_0x2081('0x42')]=function(_0x11b41e,_0x313e7d){var _0x4e589d={'raw':!![],'where':{'id':_0x11b41e[_0x2081('0x43')]['id']}},_0x570358={};_0x570358[_0x2081('0x2f')]=_[_0x2081('0x44')](db[_0x2081('0x2a')][_0x2081('0x2b')]);_0x570358[_0x2081('0x30')]=_['keys'](_0x11b41e[_0x2081('0x30')]);_0x570358[_0x2081('0x31')]=_[_0x2081('0x32')](_0x570358[_0x2081('0x2f')],_0x570358[_0x2081('0x30')]);_0x4e589d['attributes']=_['intersection'](_0x570358['model'],qs[_0x2081('0x34')](_0x11b41e[_0x2081('0x30')][_0x2081('0x34')]));_0x4e589d[_0x2081('0x33')]=_0x4e589d[_0x2081('0x33')][_0x2081('0x35')]?_0x4e589d[_0x2081('0x33')]:_0x570358[_0x2081('0x2f')];if(_0x11b41e['query']['includeAll']){_0x4e589d[_0x2081('0x3f')]=[{'all':!![]}];}_0x4e589d=_[_0x2081('0x3c')]({},_0x4e589d,_0x11b41e[_0x2081('0x45')]);return db[_0x2081('0x2a')][_0x2081('0x46')](_0x4e589d)[_0x2081('0x22')](handleEntityNotFound(_0x313e7d,null))[_0x2081('0x22')](respondWithResult(_0x313e7d,null))[_0x2081('0x41')](handleError(_0x313e7d,null));};exports[_0x2081('0x47')]=function(_0x468f47,_0x5c5db9){return db[_0x2081('0x2a')]['create'](_0x468f47[_0x2081('0x48')],{})[_0x2081('0x22')](respondWithResult(_0x5c5db9,0xc9))[_0x2081('0x41')](handleError(_0x5c5db9,null));};exports['update']=function(_0x138b36,_0x2947ee){if(_0x138b36[_0x2081('0x48')]['id']){delete _0x138b36[_0x2081('0x48')]['id'];}return db[_0x2081('0x2a')][_0x2081('0x46')]({'where':{'id':_0x138b36['params']['id']}})[_0x2081('0x22')](handleEntityNotFound(_0x2947ee,null))[_0x2081('0x22')](saveUpdates(_0x138b36['body'],null))[_0x2081('0x22')](respondWithResult(_0x2947ee,null))[_0x2081('0x41')](handleError(_0x2947ee,null));};exports[_0x2081('0x21')]=function(_0x1f3faf,_0x131ac0){return db[_0x2081('0x2a')]['find']({'where':{'id':_0x1f3faf[_0x2081('0x43')]['id']}})[_0x2081('0x22')](handleEntityNotFound(_0x131ac0,null))[_0x2081('0x22')](removeEntity(_0x131ac0,null))[_0x2081('0x41')](handleError(_0x131ac0,null));};exports['describe']=function(_0x5bdc93,_0x4d91c7){return db['SmsQueueReport']['describe']()[_0x2081('0x22')](respondWithResult(_0x4d91c7,null))[_0x2081('0x41')](handleError(_0x4d91c7,null));};
\ No newline at end of file
+var _0x18fe=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','sendStatus','error','name','send','map','SmsQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse'];(function(_0x521e8d,_0x23a290){var _0x518bbd=function(_0x4241eb){while(--_0x4241eb){_0x521e8d['push'](_0x521e8d['shift']());}};_0x518bbd(++_0x23a290);}(_0x18fe,0x1b7));var _0xe18f=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0x18fe[_0x95ac8b];return _0x5b0792;};'use strict';var emlformat=require(_0xe18f('0x0'));var rimraf=require(_0xe18f('0x1'));var zipdir=require(_0xe18f('0x2'));var jsonpatch=require(_0xe18f('0x3'));var rp=require(_0xe18f('0x4'));var moment=require(_0xe18f('0x5'));var BPromise=require(_0xe18f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe18f('0x7'));var sox=require(_0xe18f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe18f('0x9'));var _=require(_0xe18f('0xa'));var squel=require(_0xe18f('0xb'));var crypto=require(_0xe18f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe18f('0xd'));var toCsv=require(_0xe18f('0xe'));var querystring=require(_0xe18f('0xf'));var Papa=require(_0xe18f('0x10'));var Redis=require('ioredis');var authService=require(_0xe18f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe18f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe18f('0x13'))(_0xe18f('0x14'));var utils=require('../../config/utils');var config=require(_0xe18f('0x15'));var licenseUtil=require(_0xe18f('0x16'));var db=require(_0xe18f('0x17'))['db'];function respondWithStatusCode(_0x766e73,_0x2727a5){_0x2727a5=_0x2727a5||0xcc;return function(_0x5f2b16){if(_0x5f2b16){return _0x766e73['sendStatus'](_0x2727a5);}return _0x766e73['status'](_0x2727a5)[_0xe18f('0x18')]();};}function respondWithResult(_0xbbf856,_0x2c8300){_0x2c8300=_0x2c8300||0xc8;return function(_0x46a335){if(_0x46a335){return _0xbbf856[_0xe18f('0x19')](_0x2c8300)['json'](_0x46a335);}};}function respondWithFilteredResult(_0x13cfc8,_0x4c033f){return function(_0x4c3a04){if(_0x4c3a04){var _0x5d7e1f=typeof _0x4c033f['offset']===_0xe18f('0x1a')&&typeof _0x4c033f[_0xe18f('0x1b')]==='undefined';var _0x3b0173=_0x4c3a04[_0xe18f('0x1c')];var _0xed4823=_0x5d7e1f?0x0:_0x4c033f[_0xe18f('0x1d')];var _0x4878aa=_0x5d7e1f?_0x4c3a04[_0xe18f('0x1c')]:_0x4c033f[_0xe18f('0x1d')]+_0x4c033f[_0xe18f('0x1b')];var _0x27d393;if(_0x4878aa>=_0x3b0173){_0x4878aa=_0x3b0173;_0x27d393=0xc8;}else{_0x27d393=0xce;}_0x13cfc8[_0xe18f('0x19')](_0x27d393);return _0x13cfc8[_0xe18f('0x1e')](_0xe18f('0x1f'),_0xed4823+'-'+_0x4878aa+'/'+_0x3b0173)[_0xe18f('0x20')](_0x4c3a04);}return null;};}function patchUpdates(_0x268604){return function(_0x20e622){try{jsonpatch[_0xe18f('0x21')](_0x20e622,_0x268604,!![]);}catch(_0x4244d3){return BPromise[_0xe18f('0x22')](_0x4244d3);}return _0x20e622['save']();};}function saveUpdates(_0x5068c8,_0x29e824){return function(_0x305dc5){if(_0x305dc5){return _0x305dc5[_0xe18f('0x23')](_0x5068c8)[_0xe18f('0x24')](function(_0xb7942e){return _0xb7942e;});}return null;};}function removeEntity(_0x47c7a2,_0x1eebaf){return function(_0x39be5d){if(_0x39be5d){return _0x39be5d['destroy']()[_0xe18f('0x24')](function(){_0x47c7a2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bd4c7,_0x5a2a47){return function(_0x28da4e){if(!_0x28da4e){_0x5bd4c7[_0xe18f('0x25')](0x194);}return _0x28da4e;};}function handleError(_0x1eb122,_0x5c2504){_0x5c2504=_0x5c2504||0x1f4;return function(_0x47bf00){logger[_0xe18f('0x26')](_0x47bf00['stack']);if(_0x47bf00[_0xe18f('0x27')]){delete _0x47bf00[_0xe18f('0x27')];}_0x1eb122[_0xe18f('0x19')](_0x5c2504)[_0xe18f('0x28')](_0x47bf00);};}exports['index']=function(_0x1c55d2,_0x4f7fd7){var _0x2a8118={},_0x182b62={},_0xaea309={'count':0x0,'rows':[]};var _0x52e862=_[_0xe18f('0x29')](db[_0xe18f('0x2a')]['rawAttributes'],function(_0xc0c431){return{'name':_0xc0c431[_0xe18f('0x2b')],'type':_0xc0c431[_0xe18f('0x2c')][_0xe18f('0x2d')]};});_0x182b62[_0xe18f('0x2e')]=_['map'](_0x52e862,_0xe18f('0x27'));_0x182b62[_0xe18f('0x2f')]=_[_0xe18f('0x30')](_0x1c55d2[_0xe18f('0x2f')]);_0x182b62[_0xe18f('0x31')]=_['intersection'](_0x182b62['model'],_0x182b62[_0xe18f('0x2f')]);_0x2a8118[_0xe18f('0x32')]=_[_0xe18f('0x33')](_0x182b62[_0xe18f('0x2e')],qs[_0xe18f('0x34')](_0x1c55d2['query'][_0xe18f('0x34')]));_0x2a8118[_0xe18f('0x32')]=_0x2a8118[_0xe18f('0x32')][_0xe18f('0x35')]?_0x2a8118[_0xe18f('0x32')]:_0x182b62[_0xe18f('0x2e')];if(!_0x1c55d2[_0xe18f('0x2f')][_0xe18f('0x36')](_0xe18f('0x37'))){_0x2a8118[_0xe18f('0x1b')]=qs[_0xe18f('0x1b')](_0x1c55d2[_0xe18f('0x2f')][_0xe18f('0x1b')]);_0x2a8118[_0xe18f('0x1d')]=qs['offset'](_0x1c55d2[_0xe18f('0x2f')][_0xe18f('0x1d')]);}_0x2a8118[_0xe18f('0x38')]=qs[_0xe18f('0x39')](_0x1c55d2['query'][_0xe18f('0x39')]);_0x2a8118[_0xe18f('0x3a')]=qs[_0xe18f('0x31')](_[_0xe18f('0x3b')](_0x1c55d2[_0xe18f('0x2f')],_0x182b62[_0xe18f('0x31')]),_0x52e862);if(_0x1c55d2[_0xe18f('0x2f')][_0xe18f('0x3c')]){_0x2a8118[_0xe18f('0x3a')]=_[_0xe18f('0x3d')](_0x2a8118[_0xe18f('0x3a')],{'$or':_[_0xe18f('0x29')](_0x52e862,function(_0x20f501){if(_0x20f501['type']!=='VIRTUAL'){var _0x2c0ca0={};_0x2c0ca0[_0x20f501[_0xe18f('0x27')]]={'$like':'%'+_0x1c55d2[_0xe18f('0x2f')]['filter']+'%'};return _0x2c0ca0;}})});}_0x2a8118=_[_0xe18f('0x3d')]({},_0x2a8118,_0x1c55d2[_0xe18f('0x3e')]);var _0x343f4b={'where':_0x2a8118[_0xe18f('0x3a')]};return db[_0xe18f('0x2a')][_0xe18f('0x1c')](_0x343f4b)[_0xe18f('0x24')](function(_0x35e85c){_0xaea309['count']=_0x35e85c;if(_0x1c55d2[_0xe18f('0x2f')][_0xe18f('0x3f')]){_0x2a8118[_0xe18f('0x40')]=[{'all':!![]}];}return db[_0xe18f('0x2a')][_0xe18f('0x41')](_0x2a8118);})[_0xe18f('0x24')](function(_0x55af84){_0xaea309[_0xe18f('0x42')]=_0x55af84;return _0xaea309;})[_0xe18f('0x24')](respondWithFilteredResult(_0x4f7fd7,_0x2a8118))['catch'](handleError(_0x4f7fd7,null));};exports[_0xe18f('0x43')]=function(_0x1a6496,_0x3d4234){var _0x3fd0eb={'raw':!![],'where':{'id':_0x1a6496[_0xe18f('0x44')]['id']}},_0x2ecffb={};_0x2ecffb[_0xe18f('0x2e')]=_['keys'](db['SmsQueueReport'][_0xe18f('0x45')]);_0x2ecffb[_0xe18f('0x2f')]=_['keys'](_0x1a6496['query']);_0x2ecffb[_0xe18f('0x31')]=_[_0xe18f('0x33')](_0x2ecffb['model'],_0x2ecffb[_0xe18f('0x2f')]);_0x3fd0eb[_0xe18f('0x32')]=_['intersection'](_0x2ecffb[_0xe18f('0x2e')],qs[_0xe18f('0x34')](_0x1a6496[_0xe18f('0x2f')][_0xe18f('0x34')]));_0x3fd0eb['attributes']=_0x3fd0eb[_0xe18f('0x32')]['length']?_0x3fd0eb[_0xe18f('0x32')]:_0x2ecffb['model'];if(_0x1a6496[_0xe18f('0x2f')][_0xe18f('0x3f')]){_0x3fd0eb[_0xe18f('0x40')]=[{'all':!![]}];}_0x3fd0eb=_['merge']({},_0x3fd0eb,_0x1a6496[_0xe18f('0x3e')]);return db[_0xe18f('0x2a')][_0xe18f('0x46')](_0x3fd0eb)['then'](handleEntityNotFound(_0x3d4234,null))[_0xe18f('0x24')](respondWithResult(_0x3d4234,null))[_0xe18f('0x47')](handleError(_0x3d4234,null));};exports['create']=function(_0x255130,_0x385404){return db[_0xe18f('0x2a')][_0xe18f('0x48')](_0x255130[_0xe18f('0x49')],{})['then'](respondWithResult(_0x385404,0xc9))[_0xe18f('0x47')](handleError(_0x385404,null));};exports[_0xe18f('0x23')]=function(_0x1b1d9d,_0x302636){if(_0x1b1d9d[_0xe18f('0x49')]['id']){delete _0x1b1d9d[_0xe18f('0x49')]['id'];}return db[_0xe18f('0x2a')][_0xe18f('0x46')]({'where':{'id':_0x1b1d9d[_0xe18f('0x44')]['id']}})[_0xe18f('0x24')](handleEntityNotFound(_0x302636,null))['then'](saveUpdates(_0x1b1d9d[_0xe18f('0x49')],null))[_0xe18f('0x24')](respondWithResult(_0x302636,null))[_0xe18f('0x47')](handleError(_0x302636,null));};exports[_0xe18f('0x4a')]=function(_0x4b8866,_0x50ccad){return db['SmsQueueReport'][_0xe18f('0x46')]({'where':{'id':_0x4b8866[_0xe18f('0x44')]['id']}})[_0xe18f('0x24')](handleEntityNotFound(_0x50ccad,null))[_0xe18f('0x24')](removeEntity(_0x50ccad,null))[_0xe18f('0x47')](handleError(_0x50ccad,null));};exports[_0xe18f('0x4b')]=function(_0x46ab78,_0x18e611){return db['SmsQueueReport'][_0xe18f('0x4b')]()[_0xe18f('0x24')](respondWithResult(_0x18e611,null))[_0xe18f('0x47')](handleError(_0x18e611,null));};
\ No newline at end of file
index 065eefe..48401c2 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','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x51ec61,_0xf9d1e3){var _0x223200=function(_0x3bd510){while(--_0x3bd510){_0x51ec61['push'](_0x51ec61['shift']());}};_0x223200(++_0xf9d1e3);}(_0xe706,0xa3));var _0x6e70=function(_0x19fbdc,_0x2e1d6a){_0x19fbdc=_0x19fbdc-0x0;var _0x176533=_0xe706[_0x19fbdc];return _0x176533;};'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
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x2e78db,_0x5ab8a1){var _0x195fb4=function(_0x4d24f3){while(--_0x4d24f3){_0x2e78db['push'](_0x2e78db['shift']());}};_0x195fb4(++_0x5ab8a1);}(_0xe706,0xa3));var _0x6e70=function(_0xe33b12,_0x2a9761){_0xe33b12=_0xe33b12-0x0;var _0x30699d=_0xe706[_0xe33b12];return _0x30699d;};'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 a39fa78..db68567 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98ba=['SmsQueueReport','update','body','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueueReport,\x20%s,\x20%s','info','catch','CreateSmsQueueReport','create','options','UpdateSmsQueueReport'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x98ba,0x125));var _0xa98b=function(_0x30515a,_0xe43242){_0x30515a=_0x30515a-0x0;var _0x1819ea=_0x98ba[_0x30515a];return _0x1819ea;};'use strict';var _=require(_0xa98b('0x0'));var util=require(_0xa98b('0x1'));var moment=require('moment');var BPromise=require(_0xa98b('0x2'));var rs=require(_0xa98b('0x3'));var fs=require('fs');var Redis=require(_0xa98b('0x4'));var db=require(_0xa98b('0x5'))['db'];var utils=require(_0xa98b('0x6'));var logger=require(_0xa98b('0x7'))(_0xa98b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa98b('0x9')][_0xa98b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40387d,_0x39a26a,_0x245170){return new BPromise(function(_0xb92f5,_0x284170){return client[_0xa98b('0xb')](_0x40387d,_0x245170)[_0xa98b('0xc')](function(_0x1560fa){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x39a26a,_0xa98b('0xd'));logger[_0xa98b('0xe')](_0xa98b('0xf'),_0x39a26a,_0xa98b('0xd'),JSON[_0xa98b('0x10')](_0x1560fa));if(_0x1560fa[_0xa98b('0x11')]){if(_0x1560fa[_0xa98b('0x11')][_0xa98b('0x12')]===0x1f4){logger[_0xa98b('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x39a26a,_0x1560fa['error'][_0xa98b('0x13')]);return _0x284170(_0x1560fa['error']['message']);}logger[_0xa98b('0x11')](_0xa98b('0x14'),_0x39a26a,_0x1560fa[_0xa98b('0x11')][_0xa98b('0x13')]);return _0xb92f5(_0x1560fa['error']['message']);}else{logger[_0xa98b('0x15')]('SmsQueueReport,\x20%s,\x20%s',_0x39a26a,_0xa98b('0xd'));_0xb92f5(_0x1560fa['result'][_0xa98b('0x13')]);}})[_0xa98b('0x16')](function(_0x24d259){logger[_0xa98b('0x11')](_0xa98b('0x14'),_0x39a26a,_0x24d259);_0x284170(_0x24d259);});});}exports[_0xa98b('0x17')]=function(_0x50e58c){var _0x53a468=this;return new Promise(function(_0x5474ba,_0x2408d6){return db['SmsQueueReport'][_0xa98b('0x18')](_0x50e58c['body'],{'raw':_0x50e58c[_0xa98b('0x19')]?_0x50e58c[_0xa98b('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xa98b('0xc')](function(_0x524de6){logger[_0xa98b('0x15')]('CreateSmsQueueReport',_0x50e58c);logger[_0xa98b('0xe')](_0xa98b('0x17'),_0x50e58c,JSON[_0xa98b('0x10')](_0x524de6));_0x5474ba(_0x524de6);})[_0xa98b('0x16')](function(_0x176e6f){logger[_0xa98b('0x11')](_0xa98b('0x17'),_0x176e6f[_0xa98b('0x13')],_0x50e58c);_0x2408d6(_0x53a468[_0xa98b('0x11')](0x1f4,_0x176e6f[_0xa98b('0x13')]));});});};exports[_0xa98b('0x1a')]=function(_0x281053){var _0xc47b39=this;return new Promise(function(_0x4fe764,_0x23aa65){return db[_0xa98b('0x1b')][_0xa98b('0x1c')](_0x281053[_0xa98b('0x1d')],{'raw':_0x281053[_0xa98b('0x19')]?_0x281053[_0xa98b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x281053[_0xa98b('0x19')]?_0x281053['options'][_0xa98b('0x1e')]||null:null,'attributes':_0x281053[_0xa98b('0x19')]?_0x281053[_0xa98b('0x19')]['attributes']||null:null,'limit':_0x281053[_0xa98b('0x19')]?_0x281053[_0xa98b('0x19')][_0xa98b('0x1f')]||null:null})[_0xa98b('0xc')](function(_0x55782e){logger[_0xa98b('0x15')](_0xa98b('0x1a'),_0x281053);logger[_0xa98b('0xe')](_0xa98b('0x1a'),_0x281053,JSON['stringify'](_0x55782e));_0x4fe764(_0x55782e);})['catch'](function(_0x35c811){logger[_0xa98b('0x11')]('UpdateSmsQueueReport',_0x35c811[_0xa98b('0x13')],_0x281053);_0x23aa65(_0xc47b39[_0xa98b('0x11')](0x1f4,_0x35c811['message']));});});};
\ No newline at end of file
+var _0xfbd5=['stringify','error','code','message','info','request\x20sent','result','catch','CreateSmsQueueReport','options','SmsQueueReport','update','body','raw','where','attributes','limit','UpdateSmsQueueReport','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x24dfbe,_0x1e3792){var _0x559033=function(_0x5d95e2){while(--_0x5d95e2){_0x24dfbe['push'](_0x24dfbe['shift']());}};_0x559033(++_0x1e3792);}(_0xfbd5,0x9a));var _0x5fbd=function(_0x4522bb,_0x392b70){_0x4522bb=_0x4522bb-0x0;var _0x47e688=_0xfbd5[_0x4522bb];return _0x47e688;};'use strict';var _=require(_0x5fbd('0x0'));var util=require('util');var moment=require(_0x5fbd('0x1'));var BPromise=require(_0x5fbd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fbd('0x3'));var db=require(_0x5fbd('0x4'))['db'];var utils=require(_0x5fbd('0x5'));var logger=require(_0x5fbd('0x6'))(_0x5fbd('0x7'));var config=require(_0x5fbd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5fbd('0x9')][_0x5fbd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c5c19,_0x8e85ee,_0x31fb64){return new BPromise(function(_0x420e29,_0x5289d1){return client[_0x5fbd('0xb')](_0x1c5c19,_0x31fb64)[_0x5fbd('0xc')](function(_0x482591){logger['info'](_0x5fbd('0xd'),_0x8e85ee,'request\x20sent');logger[_0x5fbd('0xe')](_0x5fbd('0xf'),_0x8e85ee,'request\x20sent',JSON[_0x5fbd('0x10')](_0x482591));if(_0x482591[_0x5fbd('0x11')]){if(_0x482591['error'][_0x5fbd('0x12')]===0x1f4){logger['error'](_0x5fbd('0xd'),_0x8e85ee,_0x482591[_0x5fbd('0x11')][_0x5fbd('0x13')]);return _0x5289d1(_0x482591[_0x5fbd('0x11')]['message']);}logger[_0x5fbd('0x11')](_0x5fbd('0xd'),_0x8e85ee,_0x482591[_0x5fbd('0x11')][_0x5fbd('0x13')]);return _0x420e29(_0x482591[_0x5fbd('0x11')][_0x5fbd('0x13')]);}else{logger[_0x5fbd('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x8e85ee,_0x5fbd('0x15'));_0x420e29(_0x482591[_0x5fbd('0x16')][_0x5fbd('0x13')]);}})[_0x5fbd('0x17')](function(_0x48c377){logger[_0x5fbd('0x11')](_0x5fbd('0xd'),_0x8e85ee,_0x48c377);_0x5289d1(_0x48c377);});});}exports[_0x5fbd('0x18')]=function(_0x4c6d80){var _0x9192e8=this;return new Promise(function(_0x18c1db,_0x30de14){return db['SmsQueueReport']['create'](_0x4c6d80['body'],{'raw':_0x4c6d80[_0x5fbd('0x19')]?_0x4c6d80['options']['raw']===undefined?!![]:![]:!![]})[_0x5fbd('0xc')](function(_0x4e9d54){logger[_0x5fbd('0x14')]('CreateSmsQueueReport',_0x4c6d80);logger[_0x5fbd('0xe')](_0x5fbd('0x18'),_0x4c6d80,JSON[_0x5fbd('0x10')](_0x4e9d54));_0x18c1db(_0x4e9d54);})[_0x5fbd('0x17')](function(_0x7ac21f){logger['error']('CreateSmsQueueReport',_0x7ac21f[_0x5fbd('0x13')],_0x4c6d80);_0x30de14(_0x9192e8['error'](0x1f4,_0x7ac21f['message']));});});};exports['UpdateSmsQueueReport']=function(_0x3cebfd){var _0x1ff370=this;return new Promise(function(_0x346922,_0x56ece6){return db[_0x5fbd('0x1a')][_0x5fbd('0x1b')](_0x3cebfd[_0x5fbd('0x1c')],{'raw':_0x3cebfd[_0x5fbd('0x19')]?_0x3cebfd[_0x5fbd('0x19')][_0x5fbd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cebfd[_0x5fbd('0x19')]?_0x3cebfd['options'][_0x5fbd('0x1e')]||null:null,'attributes':_0x3cebfd[_0x5fbd('0x19')]?_0x3cebfd[_0x5fbd('0x19')][_0x5fbd('0x1f')]||null:null,'limit':_0x3cebfd[_0x5fbd('0x19')]?_0x3cebfd[_0x5fbd('0x19')][_0x5fbd('0x20')]||null:null})[_0x5fbd('0xc')](function(_0x402a56){logger['info']('UpdateSmsQueueReport',_0x3cebfd);logger['debug'](_0x5fbd('0x21'),_0x3cebfd,JSON[_0x5fbd('0x10')](_0x402a56));_0x346922(_0x402a56);})[_0x5fbd('0x17')](function(_0x1dddce){logger[_0x5fbd('0x11')](_0x5fbd('0x21'),_0x1dddce['message'],_0x3cebfd);_0x56ece6(_0x1ff370[_0x5fbd('0x11')](0x1f4,_0x1dddce[_0x5fbd('0x13')]));});});};
\ No newline at end of file
index 6e11a8c..87f1e82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec39=['Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x17d028,_0x1e3e55){var _0x8a667c=function(_0x1c70f6){while(--_0x1c70f6){_0x17d028['push'](_0x17d028['shift']());}};_0x8a667c(++_0x1e3e55);}(_0xec39,0x19f));var _0x9ec3=function(_0x5685cc,_0x55f685){_0x5685cc=_0x5685cc-0x0;var _0x287139=_0xec39[_0x5685cc];return _0x287139;};'use strict';var multer=require(_0x9ec3('0x0'));var util=require(_0x9ec3('0x1'));var path=require(_0x9ec3('0x2'));var timeout=require(_0x9ec3('0x3'));var express=require(_0x9ec3('0x4'));var router=express[_0x9ec3('0x5')]();var fs_extra=require(_0x9ec3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9ec3('0x7'));var config=require(_0x9ec3('0x8'));var controller=require(_0x9ec3('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9ec3('0xa')](_0x9ec3('0xb'),auth[_0x9ec3('0xc')](),controller['describe']);router[_0x9ec3('0xa')](_0x9ec3('0xd'),auth[_0x9ec3('0xc')](),controller[_0x9ec3('0xe')]);router[_0x9ec3('0xf')]('/',auth[_0x9ec3('0xc')](),controller[_0x9ec3('0x10')]);router['put'](_0x9ec3('0xd'),auth[_0x9ec3('0xc')](),controller[_0x9ec3('0x11')]);router[_0x9ec3('0x12')](_0x9ec3('0xd'),auth[_0x9ec3('0xc')](),controller[_0x9ec3('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xdbf5=['show','post','put','update','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x17165e,_0x4a371d){_0x17165e=_0x17165e-0x0;var _0x48ddc0=_0xdbf5[_0x17165e];return _0x48ddc0;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')]('/',auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xa')]);router[_0x5dbf('0x8')](_0x5dbf('0xb'),auth[_0x5dbf('0x9')](),controller['describe']);router[_0x5dbf('0x8')]('/:id',auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xc')]);router[_0x5dbf('0xd')]('/',auth[_0x5dbf('0x9')](),controller['create']);router[_0x5dbf('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x5dbf('0xf')]);router['delete']('/:id',auth[_0x5dbf('0x9')](),controller['destroy']);module[_0x5dbf('0x10')]=router;
\ No newline at end of file
index b9f284a..545ed12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x9bde,0xe1));var _0xe9bd=function(_0x28fc94,_0x18ff8f){_0x28fc94=_0x28fc94-0x0;var _0x3bb5b4=_0x9bde[_0x28fc94];return _0x3bb5b4;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4f0c2b,_0x2c9d14){var _0x526436=function(_0x2e13b6){while(--_0x2e13b6){_0x4f0c2b['push'](_0x4f0c2b['shift']());}};_0x526436(++_0x2c9d14);}(_0x9bde,0xe1));var _0xe9bd=function(_0x38a676,_0x1a0e6a){_0x38a676=_0x38a676-0x0;var _0x164d4c=_0x9bde[_0x38a676];return _0x164d4c;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
index abfa0e1..c949e7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb60c=['then','destroy','end','error','stack','name','send','index','SmsTransferReport','rawAttributes','type','key','model','query','keys','intersection','attributes','length','sort','where','pick','filters','filter','merge','map','include','findAll','rows','catch','show','params','fields','includeAll','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save'];(function(_0x2e3c3a,_0x418a5f){var _0x5b16c5=function(_0x25f203){while(--_0x25f203){_0x2e3c3a['push'](_0x2e3c3a['shift']());}};_0x5b16c5(++_0x418a5f);}(_0xb60c,0x1a2));var _0xcb60=function(_0x32cbda,_0x42448c){_0x32cbda=_0x32cbda-0x0;var _0xa33f86=_0xb60c[_0x32cbda];return _0xa33f86;};'use strict';var emlformat=require(_0xcb60('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb60('0x1'));var jsonpatch=require(_0xcb60('0x2'));var rp=require('request-promise');var moment=require(_0xcb60('0x3'));var BPromise=require(_0xcb60('0x4'));var Mustache=require(_0xcb60('0x5'));var util=require(_0xcb60('0x6'));var path=require(_0xcb60('0x7'));var sox=require(_0xcb60('0x8'));var csv=require(_0xcb60('0x9'));var ejs=require(_0xcb60('0xa'));var fs=require('fs');var fs_extra=require(_0xcb60('0xb'));var _=require(_0xcb60('0xc'));var squel=require(_0xcb60('0xd'));var crypto=require(_0xcb60('0xe'));var jsforce=require(_0xcb60('0xf'));var deskjs=require(_0xcb60('0x10'));var toCsv=require(_0xcb60('0x9'));var querystring=require(_0xcb60('0x11'));var Papa=require(_0xcb60('0x12'));var Redis=require(_0xcb60('0x13'));var authService=require(_0xcb60('0x14'));var qs=require(_0xcb60('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb60('0x16'));var logger=require(_0xcb60('0x17'))(_0xcb60('0x18'));var utils=require(_0xcb60('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcb60('0x1a'))['db'];function respondWithStatusCode(_0x5b638d,_0xcfb4e6){_0xcfb4e6=_0xcfb4e6||0xcc;return function(_0x153075){if(_0x153075){return _0x5b638d[_0xcb60('0x1b')](_0xcfb4e6);}return _0x5b638d[_0xcb60('0x1c')](_0xcfb4e6)['end']();};}function respondWithResult(_0x515880,_0x1aa9f4){_0x1aa9f4=_0x1aa9f4||0xc8;return function(_0x6f37e1){if(_0x6f37e1){return _0x515880[_0xcb60('0x1c')](_0x1aa9f4)[_0xcb60('0x1d')](_0x6f37e1);}};}function respondWithFilteredResult(_0x1ee7cc,_0x4f065d){return function(_0x34c7a0){if(_0x34c7a0){var _0x3fbbc1=typeof _0x4f065d[_0xcb60('0x1e')]===_0xcb60('0x1f')&&typeof _0x4f065d[_0xcb60('0x20')]===_0xcb60('0x1f');var _0x5a3f43=_0x34c7a0['count'];var _0x2dc6a3=_0x3fbbc1?0x0:_0x4f065d[_0xcb60('0x1e')];var _0x2a31cf=_0x3fbbc1?_0x34c7a0[_0xcb60('0x21')]:_0x4f065d[_0xcb60('0x1e')]+_0x4f065d[_0xcb60('0x20')];var _0x552ad6;if(_0x2a31cf>=_0x5a3f43){_0x2a31cf=_0x5a3f43;_0x552ad6=0xc8;}else{_0x552ad6=0xce;}_0x1ee7cc['status'](_0x552ad6);return _0x1ee7cc[_0xcb60('0x22')]('Content-Range',_0x2dc6a3+'-'+_0x2a31cf+'/'+_0x5a3f43)[_0xcb60('0x1d')](_0x34c7a0);}return null;};}function patchUpdates(_0xb2de30){return function(_0xe18d44){try{jsonpatch[_0xcb60('0x23')](_0xe18d44,_0xb2de30,!![]);}catch(_0x2dd6e2){return BPromise[_0xcb60('0x24')](_0x2dd6e2);}return _0xe18d44[_0xcb60('0x25')]();};}function saveUpdates(_0x1c7a18,_0x1816d0){return function(_0x93e60c){if(_0x93e60c){return _0x93e60c['update'](_0x1c7a18)[_0xcb60('0x26')](function(_0x50b2eb){return _0x50b2eb;});}return null;};}function removeEntity(_0x29dbae,_0x2e8b6a){return function(_0x5acd27){if(_0x5acd27){return _0x5acd27[_0xcb60('0x27')]()[_0xcb60('0x26')](function(){_0x29dbae[_0xcb60('0x1c')](0xcc)[_0xcb60('0x28')]();});}};}function handleEntityNotFound(_0x4ab850,_0x31b946){return function(_0x318b10){if(!_0x318b10){_0x4ab850[_0xcb60('0x1b')](0x194);}return _0x318b10;};}function handleError(_0x34bc0f,_0x48f4fa){_0x48f4fa=_0x48f4fa||0x1f4;return function(_0x4274b4){logger[_0xcb60('0x29')](_0x4274b4[_0xcb60('0x2a')]);if(_0x4274b4['name']){delete _0x4274b4[_0xcb60('0x2b')];}_0x34bc0f[_0xcb60('0x1c')](_0x48f4fa)[_0xcb60('0x2c')](_0x4274b4);};}exports[_0xcb60('0x2d')]=function(_0x2542c9,_0x2e0089){var _0x117b1f={},_0x5106ca={},_0x1e4939={'count':0x0,'rows':[]};var _0x4f671f=_['map'](db[_0xcb60('0x2e')][_0xcb60('0x2f')],function(_0x45fe02){return{'name':_0x45fe02['fieldName'],'type':_0x45fe02[_0xcb60('0x30')][_0xcb60('0x31')]};});_0x5106ca[_0xcb60('0x32')]=_['map'](_0x4f671f,_0xcb60('0x2b'));_0x5106ca[_0xcb60('0x33')]=_[_0xcb60('0x34')](_0x2542c9[_0xcb60('0x33')]);_0x5106ca['filters']=_['intersection'](_0x5106ca['model'],_0x5106ca['query']);_0x117b1f['attributes']=_[_0xcb60('0x35')](_0x5106ca['model'],qs['fields'](_0x2542c9[_0xcb60('0x33')]['fields']));_0x117b1f[_0xcb60('0x36')]=_0x117b1f[_0xcb60('0x36')][_0xcb60('0x37')]?_0x117b1f['attributes']:_0x5106ca[_0xcb60('0x32')];if(!_0x2542c9[_0xcb60('0x33')]['hasOwnProperty']('nolimit')){_0x117b1f[_0xcb60('0x20')]=qs[_0xcb60('0x20')](_0x2542c9['query'][_0xcb60('0x20')]);_0x117b1f[_0xcb60('0x1e')]=qs[_0xcb60('0x1e')](_0x2542c9[_0xcb60('0x33')]['offset']);}_0x117b1f['order']=qs[_0xcb60('0x38')](_0x2542c9[_0xcb60('0x33')]['sort']);_0x117b1f[_0xcb60('0x39')]=qs['filters'](_[_0xcb60('0x3a')](_0x2542c9[_0xcb60('0x33')],_0x5106ca[_0xcb60('0x3b')]),_0x4f671f);if(_0x2542c9['query'][_0xcb60('0x3c')]){_0x117b1f[_0xcb60('0x39')]=_[_0xcb60('0x3d')](_0x117b1f[_0xcb60('0x39')],{'$or':_[_0xcb60('0x3e')](_0x4f671f,function(_0x369c51){if(_0x369c51[_0xcb60('0x30')]!=='VIRTUAL'){var _0x189003={};_0x189003[_0x369c51[_0xcb60('0x2b')]]={'$like':'%'+_0x2542c9[_0xcb60('0x33')][_0xcb60('0x3c')]+'%'};return _0x189003;}})});}_0x117b1f=_[_0xcb60('0x3d')]({},_0x117b1f,_0x2542c9['options']);var _0x3e1242={'where':_0x117b1f[_0xcb60('0x39')]};return db[_0xcb60('0x2e')][_0xcb60('0x21')](_0x3e1242)[_0xcb60('0x26')](function(_0x270cf5){_0x1e4939[_0xcb60('0x21')]=_0x270cf5;if(_0x2542c9[_0xcb60('0x33')]['includeAll']){_0x117b1f[_0xcb60('0x3f')]=[{'all':!![]}];}return db[_0xcb60('0x2e')][_0xcb60('0x40')](_0x117b1f);})[_0xcb60('0x26')](function(_0x2cecb2){_0x1e4939[_0xcb60('0x41')]=_0x2cecb2;return _0x1e4939;})['then'](respondWithFilteredResult(_0x2e0089,_0x117b1f))[_0xcb60('0x42')](handleError(_0x2e0089,null));};exports[_0xcb60('0x43')]=function(_0x43dbb3,_0x58e50e){var _0x5eb4a8={'raw':!![],'where':{'id':_0x43dbb3[_0xcb60('0x44')]['id']}},_0x4c0607={};_0x4c0607[_0xcb60('0x32')]=_[_0xcb60('0x34')](db[_0xcb60('0x2e')][_0xcb60('0x2f')]);_0x4c0607[_0xcb60('0x33')]=_[_0xcb60('0x34')](_0x43dbb3['query']);_0x4c0607[_0xcb60('0x3b')]=_[_0xcb60('0x35')](_0x4c0607[_0xcb60('0x32')],_0x4c0607['query']);_0x5eb4a8[_0xcb60('0x36')]=_['intersection'](_0x4c0607[_0xcb60('0x32')],qs[_0xcb60('0x45')](_0x43dbb3[_0xcb60('0x33')][_0xcb60('0x45')]));_0x5eb4a8[_0xcb60('0x36')]=_0x5eb4a8[_0xcb60('0x36')][_0xcb60('0x37')]?_0x5eb4a8[_0xcb60('0x36')]:_0x4c0607[_0xcb60('0x32')];if(_0x43dbb3[_0xcb60('0x33')][_0xcb60('0x46')]){_0x5eb4a8[_0xcb60('0x3f')]=[{'all':!![]}];}_0x5eb4a8=_[_0xcb60('0x3d')]({},_0x5eb4a8,_0x43dbb3[_0xcb60('0x47')]);return db[_0xcb60('0x2e')][_0xcb60('0x48')](_0x5eb4a8)['then'](handleEntityNotFound(_0x58e50e,null))[_0xcb60('0x26')](respondWithResult(_0x58e50e,null))[_0xcb60('0x42')](handleError(_0x58e50e,null));};exports[_0xcb60('0x49')]=function(_0x729431,_0x255c08){return db['SmsTransferReport'][_0xcb60('0x49')](_0x729431[_0xcb60('0x4a')],{})[_0xcb60('0x26')](respondWithResult(_0x255c08,0xc9))[_0xcb60('0x42')](handleError(_0x255c08,null));};exports['update']=function(_0x2109ba,_0x8d1717){if(_0x2109ba[_0xcb60('0x4a')]['id']){delete _0x2109ba[_0xcb60('0x4a')]['id'];}return db[_0xcb60('0x2e')][_0xcb60('0x48')]({'where':{'id':_0x2109ba['params']['id']}})[_0xcb60('0x26')](handleEntityNotFound(_0x8d1717,null))[_0xcb60('0x26')](saveUpdates(_0x2109ba[_0xcb60('0x4a')],null))[_0xcb60('0x26')](respondWithResult(_0x8d1717,null))[_0xcb60('0x42')](handleError(_0x8d1717,null));};exports[_0xcb60('0x27')]=function(_0x409ac0,_0x4963f9){return db[_0xcb60('0x2e')][_0xcb60('0x48')]({'where':{'id':_0x409ac0[_0xcb60('0x44')]['id']}})[_0xcb60('0x26')](handleEntityNotFound(_0x4963f9,null))['then'](removeEntity(_0x4963f9,null))[_0xcb60('0x42')](handleError(_0x4963f9,null));};exports[_0xcb60('0x4b')]=function(_0x4e526e,_0x317adb){return db[_0xcb60('0x2e')][_0xcb60('0x4b')]()[_0xcb60('0x26')](respondWithResult(_0x317adb,null))[_0xcb60('0x42')](handleError(_0x317adb,null));};
\ No newline at end of file
+var _0x8d88=['undefined','limit','set','apply','save','update','destroy','end','stack','name','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','where','filters','filter','merge','VIRTUAL','options','SmsTransferReport','count','then','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','params','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset'];(function(_0x2c5b54,_0x3624ca){var _0x405c8b=function(_0x299a44){while(--_0x299a44){_0x2c5b54['push'](_0x2c5b54['shift']());}};_0x405c8b(++_0x3624ca);}(_0x8d88,0x1d5));var _0x88d8=function(_0x13d0ab,_0x44ad81){_0x13d0ab=_0x13d0ab-0x0;var _0x1b0c54=_0x8d88[_0x13d0ab];return _0x1b0c54;};'use strict';var emlformat=require(_0x88d8('0x0'));var rimraf=require(_0x88d8('0x1'));var zipdir=require(_0x88d8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x88d8('0x3'));var BPromise=require(_0x88d8('0x4'));var Mustache=require('mustache');var util=require(_0x88d8('0x5'));var path=require(_0x88d8('0x6'));var sox=require(_0x88d8('0x7'));var csv=require('to-csv');var ejs=require(_0x88d8('0x8'));var fs=require('fs');var fs_extra=require(_0x88d8('0x9'));var _=require(_0x88d8('0xa'));var squel=require(_0x88d8('0xb'));var crypto=require(_0x88d8('0xc'));var jsforce=require(_0x88d8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x88d8('0xe'));var querystring=require(_0x88d8('0xf'));var Papa=require(_0x88d8('0x10'));var Redis=require(_0x88d8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x88d8('0x12'));var as=require(_0x88d8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x88d8('0x14'))('api');var utils=require(_0x88d8('0x15'));var config=require(_0x88d8('0x16'));var licenseUtil=require(_0x88d8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x531951,_0x3d3458){_0x3d3458=_0x3d3458||0xcc;return function(_0xf25d58){if(_0xf25d58){return _0x531951[_0x88d8('0x18')](_0x3d3458);}return _0x531951[_0x88d8('0x19')](_0x3d3458)['end']();};}function respondWithResult(_0x1b5b49,_0x441aef){_0x441aef=_0x441aef||0xc8;return function(_0x5de4ee){if(_0x5de4ee){return _0x1b5b49[_0x88d8('0x19')](_0x441aef)[_0x88d8('0x1a')](_0x5de4ee);}};}function respondWithFilteredResult(_0x12bd95,_0x5a5474){return function(_0x3df728){if(_0x3df728){var _0x48e786=typeof _0x5a5474[_0x88d8('0x1b')]===_0x88d8('0x1c')&&typeof _0x5a5474['limit']===_0x88d8('0x1c');var _0x585132=_0x3df728['count'];var _0x5ba5fb=_0x48e786?0x0:_0x5a5474[_0x88d8('0x1b')];var _0x2e8d32=_0x48e786?_0x3df728['count']:_0x5a5474[_0x88d8('0x1b')]+_0x5a5474[_0x88d8('0x1d')];var _0x4582ba;if(_0x2e8d32>=_0x585132){_0x2e8d32=_0x585132;_0x4582ba=0xc8;}else{_0x4582ba=0xce;}_0x12bd95[_0x88d8('0x19')](_0x4582ba);return _0x12bd95[_0x88d8('0x1e')]('Content-Range',_0x5ba5fb+'-'+_0x2e8d32+'/'+_0x585132)[_0x88d8('0x1a')](_0x3df728);}return null;};}function patchUpdates(_0x133637){return function(_0x181dab){try{jsonpatch[_0x88d8('0x1f')](_0x181dab,_0x133637,!![]);}catch(_0x53a7e6){return BPromise['reject'](_0x53a7e6);}return _0x181dab[_0x88d8('0x20')]();};}function saveUpdates(_0x28a3be,_0x4a4ad8){return function(_0xe962b4){if(_0xe962b4){return _0xe962b4[_0x88d8('0x21')](_0x28a3be)['then'](function(_0x4e1cfe){return _0x4e1cfe;});}return null;};}function removeEntity(_0x5e5776,_0x1ce500){return function(_0x17a54b){if(_0x17a54b){return _0x17a54b[_0x88d8('0x22')]()['then'](function(){_0x5e5776['status'](0xcc)[_0x88d8('0x23')]();});}};}function handleEntityNotFound(_0x4ddb1b,_0x543343){return function(_0x35462e){if(!_0x35462e){_0x4ddb1b[_0x88d8('0x18')](0x194);}return _0x35462e;};}function handleError(_0x1bd980,_0xa8ca74){_0xa8ca74=_0xa8ca74||0x1f4;return function(_0x535313){logger['error'](_0x535313[_0x88d8('0x24')]);if(_0x535313[_0x88d8('0x25')]){delete _0x535313[_0x88d8('0x25')];}_0x1bd980[_0x88d8('0x19')](_0xa8ca74)['send'](_0x535313);};}exports[_0x88d8('0x26')]=function(_0x3ddf3d,_0xd025ff){var _0x4108a0={},_0x4c0687={},_0x2a4f5a={'count':0x0,'rows':[]};var _0x653d07=_[_0x88d8('0x27')](db['SmsTransferReport']['rawAttributes'],function(_0x39adc3){return{'name':_0x39adc3[_0x88d8('0x28')],'type':_0x39adc3[_0x88d8('0x29')][_0x88d8('0x2a')]};});_0x4c0687[_0x88d8('0x2b')]=_[_0x88d8('0x27')](_0x653d07,_0x88d8('0x25'));_0x4c0687[_0x88d8('0x2c')]=_[_0x88d8('0x2d')](_0x3ddf3d[_0x88d8('0x2c')]);_0x4c0687['filters']=_['intersection'](_0x4c0687[_0x88d8('0x2b')],_0x4c0687[_0x88d8('0x2c')]);_0x4108a0[_0x88d8('0x2e')]=_[_0x88d8('0x2f')](_0x4c0687[_0x88d8('0x2b')],qs[_0x88d8('0x30')](_0x3ddf3d[_0x88d8('0x2c')][_0x88d8('0x30')]));_0x4108a0[_0x88d8('0x2e')]=_0x4108a0['attributes']['length']?_0x4108a0[_0x88d8('0x2e')]:_0x4c0687[_0x88d8('0x2b')];if(!_0x3ddf3d['query']['hasOwnProperty'](_0x88d8('0x31'))){_0x4108a0[_0x88d8('0x1d')]=qs[_0x88d8('0x1d')](_0x3ddf3d['query'][_0x88d8('0x1d')]);_0x4108a0['offset']=qs[_0x88d8('0x1b')](_0x3ddf3d[_0x88d8('0x2c')][_0x88d8('0x1b')]);}_0x4108a0[_0x88d8('0x32')]=qs['sort'](_0x3ddf3d[_0x88d8('0x2c')]['sort']);_0x4108a0[_0x88d8('0x33')]=qs[_0x88d8('0x34')](_['pick'](_0x3ddf3d[_0x88d8('0x2c')],_0x4c0687[_0x88d8('0x34')]),_0x653d07);if(_0x3ddf3d[_0x88d8('0x2c')][_0x88d8('0x35')]){_0x4108a0[_0x88d8('0x33')]=_[_0x88d8('0x36')](_0x4108a0[_0x88d8('0x33')],{'$or':_[_0x88d8('0x27')](_0x653d07,function(_0x77be91){if(_0x77be91[_0x88d8('0x29')]!==_0x88d8('0x37')){var _0x300966={};_0x300966[_0x77be91[_0x88d8('0x25')]]={'$like':'%'+_0x3ddf3d[_0x88d8('0x2c')][_0x88d8('0x35')]+'%'};return _0x300966;}})});}_0x4108a0=_[_0x88d8('0x36')]({},_0x4108a0,_0x3ddf3d[_0x88d8('0x38')]);var _0x99d7d0={'where':_0x4108a0[_0x88d8('0x33')]};return db[_0x88d8('0x39')][_0x88d8('0x3a')](_0x99d7d0)[_0x88d8('0x3b')](function(_0x3b742d){_0x2a4f5a['count']=_0x3b742d;if(_0x3ddf3d[_0x88d8('0x2c')]['includeAll']){_0x4108a0[_0x88d8('0x3c')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x88d8('0x3d')](_0x4108a0);})[_0x88d8('0x3b')](function(_0x40b338){_0x2a4f5a[_0x88d8('0x3e')]=_0x40b338;return _0x2a4f5a;})[_0x88d8('0x3b')](respondWithFilteredResult(_0xd025ff,_0x4108a0))[_0x88d8('0x3f')](handleError(_0xd025ff,null));};exports[_0x88d8('0x40')]=function(_0x2fb8bf,_0x1918f2){var _0x46a48a={'raw':!![],'where':{'id':_0x2fb8bf['params']['id']}},_0x558c41={};_0x558c41[_0x88d8('0x2b')]=_[_0x88d8('0x2d')](db[_0x88d8('0x39')][_0x88d8('0x41')]);_0x558c41['query']=_[_0x88d8('0x2d')](_0x2fb8bf[_0x88d8('0x2c')]);_0x558c41[_0x88d8('0x34')]=_[_0x88d8('0x2f')](_0x558c41[_0x88d8('0x2b')],_0x558c41['query']);_0x46a48a[_0x88d8('0x2e')]=_['intersection'](_0x558c41[_0x88d8('0x2b')],qs['fields'](_0x2fb8bf[_0x88d8('0x2c')]['fields']));_0x46a48a[_0x88d8('0x2e')]=_0x46a48a['attributes'][_0x88d8('0x42')]?_0x46a48a[_0x88d8('0x2e')]:_0x558c41['model'];if(_0x2fb8bf[_0x88d8('0x2c')]['includeAll']){_0x46a48a[_0x88d8('0x3c')]=[{'all':!![]}];}_0x46a48a=_[_0x88d8('0x36')]({},_0x46a48a,_0x2fb8bf['options']);return db[_0x88d8('0x39')][_0x88d8('0x43')](_0x46a48a)[_0x88d8('0x3b')](handleEntityNotFound(_0x1918f2,null))[_0x88d8('0x3b')](respondWithResult(_0x1918f2,null))[_0x88d8('0x3f')](handleError(_0x1918f2,null));};exports['create']=function(_0x4e211e,_0x1398bd){return db['SmsTransferReport'][_0x88d8('0x44')](_0x4e211e['body'],{})[_0x88d8('0x3b')](respondWithResult(_0x1398bd,0xc9))[_0x88d8('0x3f')](handleError(_0x1398bd,null));};exports[_0x88d8('0x21')]=function(_0x56d93f,_0x3ea8c0){if(_0x56d93f[_0x88d8('0x45')]['id']){delete _0x56d93f[_0x88d8('0x45')]['id'];}return db[_0x88d8('0x39')][_0x88d8('0x43')]({'where':{'id':_0x56d93f['params']['id']}})[_0x88d8('0x3b')](handleEntityNotFound(_0x3ea8c0,null))[_0x88d8('0x3b')](saveUpdates(_0x56d93f[_0x88d8('0x45')],null))['then'](respondWithResult(_0x3ea8c0,null))['catch'](handleError(_0x3ea8c0,null));};exports['destroy']=function(_0x226f16,_0x142232){return db[_0x88d8('0x39')]['find']({'where':{'id':_0x226f16[_0x88d8('0x46')]['id']}})[_0x88d8('0x3b')](handleEntityNotFound(_0x142232,null))[_0x88d8('0x3b')](removeEntity(_0x142232,null))[_0x88d8('0x3f')](handleError(_0x142232,null));};exports['describe']=function(_0x3c0431,_0x5b0cdd){return db['SmsTransferReport']['describe']()['then'](respondWithResult(_0x5b0cdd,null))[_0x88d8('0x3f')](handleError(_0x5b0cdd,null));};
\ No newline at end of file
index 8ab4c37..30f2e3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27ba=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x27ba,0xaf));var _0xa27b=function(_0x4b6fb3,_0x55da82){_0x4b6fb3=_0x4b6fb3-0x0;var _0x10414a=_0x27ba[_0x4b6fb3];return _0x10414a;};'use strict';var _=require(_0xa27b('0x0'));var util=require(_0xa27b('0x1'));var logger=require(_0xa27b('0x2'))(_0xa27b('0x3'));var moment=require(_0xa27b('0x4'));var BPromise=require(_0xa27b('0x5'));var rp=require(_0xa27b('0x6'));var fs=require('fs');var path=require(_0xa27b('0x7'));var rimraf=require(_0xa27b('0x8'));var config=require(_0xa27b('0x9'));var attributes=require(_0xa27b('0xa'));module[_0xa27b('0xb')]=function(_0x2eaeae,_0x38a991){return _0x2eaeae[_0xa27b('0xc')](_0xa27b('0xd'),attributes,{'tableName':_0xa27b('0xe'),'paranoid':![],'indexes':[{'name':_0xa27b('0xf'),'fields':[_0xa27b('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3805=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define'];(function(_0x5c6f93,_0x171294){var _0x1acaf2=function(_0x187fe4){while(--_0x187fe4){_0x5c6f93['push'](_0x5c6f93['shift']());}};_0x1acaf2(++_0x171294);}(_0x3805,0x111));var _0x5380=function(_0x2a8860,_0x2da926){_0x2a8860=_0x2a8860-0x0;var _0x2f47a4=_0x3805[_0x2a8860];return _0x2f47a4;};'use strict';var _=require(_0x5380('0x0'));var util=require(_0x5380('0x1'));var logger=require(_0x5380('0x2'))(_0x5380('0x3'));var moment=require(_0x5380('0x4'));var BPromise=require(_0x5380('0x5'));var rp=require(_0x5380('0x6'));var fs=require('fs');var path=require(_0x5380('0x7'));var rimraf=require(_0x5380('0x8'));var config=require(_0x5380('0x9'));var attributes=require(_0x5380('0xa'));module['exports']=function(_0x35f2c4,_0x2ed1d8){return _0x35f2c4[_0x5380('0xb')](_0x5380('0xc'),attributes,{'tableName':_0x5380('0xd'),'paranoid':![],'indexes':[{'name':_0x5380('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index c3b27e3..aa63804 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d92=['info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsTransferReport,\x20%s,\x20%s','message'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9d92,0xdf));var _0x29d9=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0x9d92[_0x3825a8];return _0xabc9bc;};'use strict';var _=require(_0x29d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x29d9('0x1'));var rs=require(_0x29d9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29d9('0x3'))['db'];var utils=require(_0x29d9('0x4'));var logger=require(_0x29d9('0x5'))(_0x29d9('0x6'));var config=require(_0x29d9('0x7'));var jayson=require(_0x29d9('0x8'));var client=jayson[_0x29d9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x209595,_0x2f6ac2,_0x392265){return new BPromise(function(_0x5aeb53,_0x26cd90){return client[_0x29d9('0xa')](_0x209595,_0x392265)[_0x29d9('0xb')](function(_0x55b0a5){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x2f6ac2,'request\x20sent');logger[_0x29d9('0xc')](_0x29d9('0xd'),_0x2f6ac2,_0x29d9('0xe'),JSON['stringify'](_0x55b0a5));if(_0x55b0a5[_0x29d9('0xf')]){if(_0x55b0a5[_0x29d9('0xf')][_0x29d9('0x10')]===0x1f4){logger[_0x29d9('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x2f6ac2,_0x55b0a5[_0x29d9('0xf')]['message']);return _0x26cd90(_0x55b0a5['error']['message']);}logger[_0x29d9('0xf')](_0x29d9('0x11'),_0x2f6ac2,_0x55b0a5[_0x29d9('0xf')][_0x29d9('0x12')]);return _0x5aeb53(_0x55b0a5['error'][_0x29d9('0x12')]);}else{logger[_0x29d9('0x13')](_0x29d9('0x11'),_0x2f6ac2,_0x29d9('0xe'));_0x5aeb53(_0x55b0a5[_0x29d9('0x14')][_0x29d9('0x12')]);}})[_0x29d9('0x15')](function(_0x327c5f){logger[_0x29d9('0xf')](_0x29d9('0x11'),_0x2f6ac2,_0x327c5f);_0x26cd90(_0x327c5f);});});}
\ No newline at end of file
+var _0xe0c3=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x455353,_0x54196f){var _0x4e50ea=function(_0x401360){while(--_0x401360){_0x455353['push'](_0x455353['shift']());}};_0x4e50ea(++_0x54196f);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3e0c('0x0'));var util=require('util');var moment=require(_0x3e0c('0x1'));var BPromise=require(_0x3e0c('0x2'));var rs=require(_0x3e0c('0x3'));var fs=require('fs');var Redis=require(_0x3e0c('0x4'));var db=require(_0x3e0c('0x5'))['db'];var utils=require(_0x3e0c('0x6'));var logger=require(_0x3e0c('0x7'))(_0x3e0c('0x8'));var config=require(_0x3e0c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e0c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e339a,_0x3f6607,_0x243b5b){return new BPromise(function(_0x29673d,_0x2d2c39){return client[_0x3e0c('0xb')](_0x1e339a,_0x243b5b)[_0x3e0c('0xc')](function(_0x13ac88){logger[_0x3e0c('0xd')](_0x3e0c('0xe'),_0x3f6607,'request\x20sent');logger['debug'](_0x3e0c('0xf'),_0x3f6607,_0x3e0c('0x10'),JSON[_0x3e0c('0x11')](_0x13ac88));if(_0x13ac88[_0x3e0c('0x12')]){if(_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x13')]===0x1f4){logger[_0x3e0c('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x3f6607,_0x13ac88[_0x3e0c('0x12')]['message']);return _0x2d2c39(_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x14')]);}logger['error'](_0x3e0c('0xe'),_0x3f6607,_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x14')]);return _0x29673d(_0x13ac88[_0x3e0c('0x12')][_0x3e0c('0x14')]);}else{logger[_0x3e0c('0xd')](_0x3e0c('0xe'),_0x3f6607,_0x3e0c('0x10'));_0x29673d(_0x13ac88[_0x3e0c('0x15')][_0x3e0c('0x14')]);}})[_0x3e0c('0x16')](function(_0x1f8e71){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x3f6607,_0x1f8e71);_0x2d2c39(_0x1f8e71);});});}
\ No newline at end of file
index 3c1fdea..2f11b56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fa4=['./sound.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','now','post','single','file','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2f1cab,_0x22bfb5){var _0x368201=function(_0x4f9af0){while(--_0x4f9af0){_0x2f1cab['push'](_0x2f1cab['shift']());}};_0x368201(++_0x22bfb5);}(_0x3fa4,0x17e));var _0x43fa=function(_0x13c2a4,_0x4c65d9){_0x13c2a4=_0x13c2a4-0x0;var _0x32d965=_0x3fa4[_0x13c2a4];return _0x32d965;};'use strict';var multer=require('multer');var util=require(_0x43fa('0x0'));var path=require(_0x43fa('0x1'));var timeout=require(_0x43fa('0x2'));var express=require(_0x43fa('0x3'));var router=express[_0x43fa('0x4')]();var fs_extra=require(_0x43fa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x43fa('0x6'));var config=require(_0x43fa('0x7'));var controller=require(_0x43fa('0x8'));router[_0x43fa('0x9')]('/',auth[_0x43fa('0xa')](),controller[_0x43fa('0xb')]);router[_0x43fa('0x9')](_0x43fa('0xc'),auth[_0x43fa('0xa')](),controller[_0x43fa('0xd')]);router[_0x43fa('0x9')]('/:id/download',auth[_0x43fa('0xa')](),controller[_0x43fa('0xe')]);var upload=multer({'storage':multer[_0x43fa('0xf')]({'destination':function(_0xb2f1c9,_0x2c8591,_0x56fa5a){_0x56fa5a(null,path[_0x43fa('0x10')](config[_0x43fa('0x11')],'server/files/sounds/original/'));},'filename':function(_0x47d7b0,_0xa3904d,_0x272319){_0xa3904d[_0x43fa('0x12')]=_0xa3904d[_0x43fa('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x272319(null,util[_0x43fa('0x13')](_0x43fa('0x14'),path[_0x43fa('0x15')](_0xa3904d[_0x43fa('0x12')],path[_0x43fa('0x16')](_0xa3904d[_0x43fa('0x12')])),Date[_0x43fa('0x17')](),path['extname'](_0xa3904d[_0x43fa('0x12')])));}})});router[_0x43fa('0x18')]('/',upload[_0x43fa('0x19')](_0x43fa('0x1a')),controller['create']);router[_0x43fa('0x1b')](_0x43fa('0xc'),auth[_0x43fa('0xa')](),controller['update']);router[_0x43fa('0x1c')](_0x43fa('0xc'),auth[_0x43fa('0xa')](),controller['delete']);module[_0x43fa('0x1d')]=router;
\ No newline at end of file
+var _0xf046=['single','file','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf046,0x150));var _0x6f04=function(_0x17ee38,_0x5bdff4){_0x17ee38=_0x17ee38-0x0;var _0x439a4e=_0xf046[_0x17ee38];return _0x439a4e;};'use strict';var multer=require('multer');var util=require(_0x6f04('0x0'));var path=require(_0x6f04('0x1'));var timeout=require(_0x6f04('0x2'));var express=require(_0x6f04('0x3'));var router=express[_0x6f04('0x4')]();var fs_extra=require(_0x6f04('0x5'));var auth=require(_0x6f04('0x6'));var interaction=require(_0x6f04('0x7'));var config=require(_0x6f04('0x8'));var controller=require(_0x6f04('0x9'));router['get']('/',auth[_0x6f04('0xa')](),controller[_0x6f04('0xb')]);router[_0x6f04('0xc')](_0x6f04('0xd'),auth[_0x6f04('0xa')](),controller[_0x6f04('0xe')]);router[_0x6f04('0xc')](_0x6f04('0xf'),auth[_0x6f04('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3eb5a7,_0x317e05,_0x324b1d){_0x324b1d(null,path[_0x6f04('0x10')](config[_0x6f04('0x11')],_0x6f04('0x12')));},'filename':function(_0x4d422f,_0x370983,_0x3c4e91){_0x370983['originalname']=_0x370983[_0x6f04('0x13')][_0x6f04('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3c4e91(null,util[_0x6f04('0x15')](_0x6f04('0x16'),path[_0x6f04('0x17')](_0x370983['originalname'],path[_0x6f04('0x18')](_0x370983['originalname'])),Date[_0x6f04('0x19')](),path[_0x6f04('0x18')](_0x370983['originalname'])));}})});router[_0x6f04('0x1a')]('/',upload[_0x6f04('0x1b')](_0x6f04('0x1c')),controller['create']);router[_0x6f04('0x1d')](_0x6f04('0xd'),auth[_0x6f04('0xa')](),controller[_0x6f04('0x1e')]);router[_0x6f04('0x1f')](_0x6f04('0xd'),auth[_0x6f04('0xa')](),controller[_0x6f04('0x1f')]);module[_0x6f04('0x20')]=router;
\ No newline at end of file
index 241fea8..5b3b8ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53d0=['STRING','FLOAT','INTEGER','BIGINT','sequelize','exports','name'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x53d0,0x107));var _0x053d=function(_0x57cd65,_0x4684cb){_0x57cd65=_0x57cd65-0x0;var _0x564c6f=_0x53d0[_0x57cd65];return _0x564c6f;};'use strict';var Sequelize=require(_0x053d('0x0'));module[_0x053d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x053d('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x053d('0x3')]},'display_name':{'type':Sequelize[_0x053d('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x053d('0x3')]},'original_format':{'type':Sequelize[_0x053d('0x3')]},'original_duration':{'type':Sequelize[_0x053d('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x053d('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x053d('0x5')]},'converted_format':{'type':Sequelize[_0x053d('0x3')]},'converted_duration':{'type':Sequelize[_0x053d('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x053d('0x6')]},'converted_channelCount':{'type':Sequelize[_0x053d('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xe9c9=['sequelize','exports','name','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x407494,_0x17a8ff){var _0x39696d=function(_0x30367a){while(--_0x30367a){_0x407494['push'](_0x407494['shift']());}};_0x39696d(++_0x17a8ff);}(_0xe9c9,0x19d));var _0x9e9c=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xe9c9[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x9e9c('0x0'));module[_0x9e9c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9e9c('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x9e9c('0x3')]},'display_name':{'type':Sequelize[_0x9e9c('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x9e9c('0x3')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x9e9c('0x4')]},'original_sampleCount':{'type':Sequelize[_0x9e9c('0x5')]},'original_channelCount':{'type':Sequelize[_0x9e9c('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x9e9c('0x6')]},'converted_format':{'type':Sequelize[_0x9e9c('0x3')]},'converted_duration':{'type':Sequelize[_0x9e9c('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x9e9c('0x5')]},'converted_channelCount':{'type':Sequelize[_0x9e9c('0x6')]},'converted_bitRate':{'type':Sequelize[_0x9e9c('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 8650f01..6a41e77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb8a=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','name','send','index','map','Sound','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','length','hasOwnProperty','sort','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','attributes','include','find','download','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','extname','file','originalname','basename','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','error','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','original_format','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x1e9eb9,_0x2e9a43){var _0x493ba3=function(_0x50560e){while(--_0x50560e){_0x1e9eb9['push'](_0x1e9eb9['shift']());}};_0x493ba3(++_0x2e9a43);}(_0xcb8a,0x15a));var _0xacb8=function(_0x5e75d1,_0x35baad){_0x5e75d1=_0x5e75d1-0x0;var _0x167807=_0xcb8a[_0x5e75d1];return _0x167807;};'use strict';var emlformat=require(_0xacb8('0x0'));var rimraf=require(_0xacb8('0x1'));var zipdir=require(_0xacb8('0x2'));var jsonpatch=require(_0xacb8('0x3'));var rp=require(_0xacb8('0x4'));var moment=require(_0xacb8('0x5'));var BPromise=require(_0xacb8('0x6'));var Mustache=require('mustache');var util=require(_0xacb8('0x7'));var path=require(_0xacb8('0x8'));var sox=require(_0xacb8('0x9'));var csv=require(_0xacb8('0xa'));var ejs=require(_0xacb8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xacb8('0xc'));var squel=require(_0xacb8('0xd'));var crypto=require(_0xacb8('0xe'));var jsforce=require(_0xacb8('0xf'));var deskjs=require(_0xacb8('0x10'));var toCsv=require(_0xacb8('0xa'));var querystring=require(_0xacb8('0x11'));var Papa=require(_0xacb8('0x12'));var Redis=require(_0xacb8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xacb8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacb8('0x15'));var logger=require('../../config/logger')(_0xacb8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xacb8('0x17'));var db=require(_0xacb8('0x18'))['db'];function respondWithStatusCode(_0x40e9dd,_0x3b055f){_0x3b055f=_0x3b055f||0xcc;return function(_0x522778){if(_0x522778){return _0x40e9dd[_0xacb8('0x19')](_0x3b055f);}return _0x40e9dd[_0xacb8('0x1a')](_0x3b055f)[_0xacb8('0x1b')]();};}function respondWithResult(_0x2d35e7,_0x23cf2b){_0x23cf2b=_0x23cf2b||0xc8;return function(_0x12cb80){if(_0x12cb80){return _0x2d35e7['status'](_0x23cf2b)[_0xacb8('0x1c')](_0x12cb80);}};}function respondWithFilteredResult(_0x4f8eb5,_0x1b9729){return function(_0x4bfcd4){if(_0x4bfcd4){var _0x50c1ba=typeof _0x1b9729[_0xacb8('0x1d')]===_0xacb8('0x1e')&&typeof _0x1b9729[_0xacb8('0x1f')]===_0xacb8('0x1e');var _0x4f17f3=_0x4bfcd4[_0xacb8('0x20')];var _0xccac87=_0x50c1ba?0x0:_0x1b9729[_0xacb8('0x1d')];var _0x38c2df=_0x50c1ba?_0x4bfcd4[_0xacb8('0x20')]:_0x1b9729[_0xacb8('0x1d')]+_0x1b9729[_0xacb8('0x1f')];var _0x4630d6;if(_0x38c2df>=_0x4f17f3){_0x38c2df=_0x4f17f3;_0x4630d6=0xc8;}else{_0x4630d6=0xce;}_0x4f8eb5[_0xacb8('0x1a')](_0x4630d6);return _0x4f8eb5[_0xacb8('0x21')](_0xacb8('0x22'),_0xccac87+'-'+_0x38c2df+'/'+_0x4f17f3)[_0xacb8('0x1c')](_0x4bfcd4);}return null;};}function patchUpdates(_0x439e00){return function(_0x5929ac){try{jsonpatch[_0xacb8('0x23')](_0x5929ac,_0x439e00,!![]);}catch(_0xd34283){return BPromise[_0xacb8('0x24')](_0xd34283);}return _0x5929ac[_0xacb8('0x25')]();};}function saveUpdates(_0x5d2662,_0x44ffa6){return function(_0x137d6d){if(_0x137d6d){return _0x137d6d[_0xacb8('0x26')](_0x5d2662)[_0xacb8('0x27')](function(_0x5e63cd){return _0x5e63cd;});}return null;};}function removeEntity(_0x1daeed,_0x486eec){return function(_0x441383){if(_0x441383){return _0x441383[_0xacb8('0x28')]()['then'](function(){var _0x566797=_0x441383[_0xacb8('0x29')]({'plain':!![]});var _0x5a3e89='Sounds';return db[_0xacb8('0x2a')][_0xacb8('0x28')]({'where':{'type':_0x5a3e89,'resourceId':_0x566797['id']}})[_0xacb8('0x27')](function(){return _0x441383;});})[_0xacb8('0x27')](function(){_0x1daeed['status'](0xcc)[_0xacb8('0x1b')]();});}};}function handleEntityNotFound(_0x1de5a7,_0x56bdf7){return function(_0x55514c){if(!_0x55514c){_0x1de5a7[_0xacb8('0x19')](0x194);}return _0x55514c;};}function handleError(_0x4eb681,_0x212f84){_0x212f84=_0x212f84||0x1f4;return function(_0x56f98e){logger['error'](_0x56f98e['stack']);if(_0x56f98e[_0xacb8('0x2b')]){delete _0x56f98e[_0xacb8('0x2b')];}_0x4eb681[_0xacb8('0x1a')](_0x212f84)[_0xacb8('0x2c')](_0x56f98e);};}exports[_0xacb8('0x2d')]=function(_0x553a0d,_0x432800){var _0x218c0={},_0x4b7c5b={},_0xae67dc={'count':0x0,'rows':[]};var _0x1c371e=_[_0xacb8('0x2e')](db[_0xacb8('0x2f')][_0xacb8('0x30')],function(_0x5dbc78){return{'name':_0x5dbc78[_0xacb8('0x31')],'type':_0x5dbc78['type'][_0xacb8('0x32')]};});_0x4b7c5b[_0xacb8('0x33')]=_['map'](_0x1c371e,_0xacb8('0x2b'));_0x4b7c5b['query']=_[_0xacb8('0x34')](_0x553a0d[_0xacb8('0x35')]);_0x4b7c5b[_0xacb8('0x36')]=_[_0xacb8('0x37')](_0x4b7c5b[_0xacb8('0x33')],_0x4b7c5b[_0xacb8('0x35')]);_0x218c0['attributes']=_[_0xacb8('0x37')](_0x4b7c5b[_0xacb8('0x33')],qs[_0xacb8('0x38')](_0x553a0d[_0xacb8('0x35')][_0xacb8('0x38')]));_0x218c0['attributes']=_0x218c0['attributes'][_0xacb8('0x39')]?_0x218c0['attributes']:_0x4b7c5b['model'];if(!_0x553a0d[_0xacb8('0x35')][_0xacb8('0x3a')]('nolimit')){_0x218c0['limit']=qs[_0xacb8('0x1f')](_0x553a0d['query'][_0xacb8('0x1f')]);_0x218c0['offset']=qs[_0xacb8('0x1d')](_0x553a0d[_0xacb8('0x35')][_0xacb8('0x1d')]);}_0x218c0['order']=qs[_0xacb8('0x3b')](_0x553a0d[_0xacb8('0x35')][_0xacb8('0x3b')]);_0x218c0['where']=qs[_0xacb8('0x36')](_['pick'](_0x553a0d[_0xacb8('0x35')],_0x4b7c5b[_0xacb8('0x36')]),_0x1c371e);if(_0x553a0d[_0xacb8('0x35')][_0xacb8('0x3c')]){_0x218c0['where']=_[_0xacb8('0x3d')](_0x218c0[_0xacb8('0x3e')],{'$or':_[_0xacb8('0x2e')](_0x1c371e,function(_0x10719a){if(_0x10719a[_0xacb8('0x3f')]!==_0xacb8('0x40')){var _0x1fcf29={};_0x1fcf29[_0x10719a[_0xacb8('0x2b')]]={'$like':'%'+_0x553a0d['query'][_0xacb8('0x3c')]+'%'};return _0x1fcf29;}})});}_0x218c0=_[_0xacb8('0x3d')]({},_0x218c0,_0x553a0d[_0xacb8('0x41')]);var _0x3804fa={'where':_0x218c0['where']};return db[_0xacb8('0x2f')][_0xacb8('0x20')](_0x3804fa)[_0xacb8('0x27')](function(_0x4c4e6e){_0xae67dc[_0xacb8('0x20')]=_0x4c4e6e;if(_0x553a0d[_0xacb8('0x35')][_0xacb8('0x42')]){_0x218c0['include']=[{'all':!![]}];}return db[_0xacb8('0x2f')][_0xacb8('0x43')](_0x218c0);})[_0xacb8('0x27')](function(_0x16e123){_0xae67dc[_0xacb8('0x44')]=_0x16e123;return _0xae67dc;})[_0xacb8('0x27')](respondWithFilteredResult(_0x432800,_0x218c0))[_0xacb8('0x45')](handleError(_0x432800,null));};exports['show']=function(_0xc1ec6a,_0x5e402e){var _0x291bf0={'raw':!![],'where':{'id':_0xc1ec6a[_0xacb8('0x46')]['id']}},_0xded73a={};_0xded73a[_0xacb8('0x33')]=_[_0xacb8('0x34')](db[_0xacb8('0x2f')][_0xacb8('0x30')]);_0xded73a[_0xacb8('0x35')]=_[_0xacb8('0x34')](_0xc1ec6a[_0xacb8('0x35')]);_0xded73a[_0xacb8('0x36')]=_[_0xacb8('0x37')](_0xded73a[_0xacb8('0x33')],_0xded73a[_0xacb8('0x35')]);_0x291bf0[_0xacb8('0x47')]=_[_0xacb8('0x37')](_0xded73a[_0xacb8('0x33')],qs['fields'](_0xc1ec6a['query'][_0xacb8('0x38')]));_0x291bf0[_0xacb8('0x47')]=_0x291bf0[_0xacb8('0x47')][_0xacb8('0x39')]?_0x291bf0[_0xacb8('0x47')]:_0xded73a[_0xacb8('0x33')];if(_0xc1ec6a[_0xacb8('0x35')]['includeAll']){_0x291bf0[_0xacb8('0x48')]=[{'all':!![]}];}_0x291bf0=_[_0xacb8('0x3d')]({},_0x291bf0,_0xc1ec6a[_0xacb8('0x41')]);return db[_0xacb8('0x2f')][_0xacb8('0x49')](_0x291bf0)[_0xacb8('0x27')](handleEntityNotFound(_0x5e402e,null))['then'](respondWithResult(_0x5e402e,null))[_0xacb8('0x45')](handleError(_0x5e402e,null));};exports[_0xacb8('0x4a')]=function(_0x2c0d29,_0x58afe4,_0x130ed0){return db['Sound']['find']({'where':{'id':_0x2c0d29[_0xacb8('0x46')]['id']},'attributes':[_0xacb8('0x2b'),_0xacb8('0x4b'),_0xacb8('0x4c')],'raw':!![]})[_0xacb8('0x27')](handleEntityNotFound(_0x58afe4,null))[_0xacb8('0x27')](function(_0x312112){if(_0x312112){if(!fs['existsSync'](path[_0xacb8('0x4d')](config[_0xacb8('0x4e')],_0xacb8('0x4f'),_0x312112[_0xacb8('0x4b')]+'.'+_0x312112[_0xacb8('0x4c')]))){throw new db[(_0xacb8('0x50'))][(_0xacb8('0x51'))](_0xacb8('0x52'));}return _0x58afe4[_0xacb8('0x4a')](path[_0xacb8('0x4d')](config[_0xacb8('0x4e')],_0xacb8('0x4f'),util[_0xacb8('0x53')](_0xacb8('0x54'),_0x312112[_0xacb8('0x4b')],_0x312112[_0xacb8('0x4c')])),util[_0xacb8('0x53')]('%s.%s',_0x312112['name'],_0x312112[_0xacb8('0x4c')]));}return null;})['catch'](handleError(_0x58afe4,null));};exports[_0xacb8('0x55')]=function(_0x4be4f2,_0x574055,_0xe8d986){var _0x553ff6={'name':path['basename'](_0x4be4f2['file']['originalname'],path[_0xacb8('0x56')](_0x4be4f2[_0xacb8('0x57')][_0xacb8('0x58')])),'save_name':path[_0xacb8('0x59')](_0x4be4f2[_0xacb8('0x57')][_0xacb8('0x5a')],path[_0xacb8('0x56')](_0x4be4f2['file'][_0xacb8('0x5a')])),'original_format':path[_0xacb8('0x56')](_0x4be4f2[_0xacb8('0x57')][_0xacb8('0x58')])['substring'](0x1),'converted_format':_0xacb8('0x5b')};var _0x4c91a0=path[_0xacb8('0x4d')](config[_0xacb8('0x4e')],_0xacb8('0x5c'),_0x4be4f2[_0xacb8('0x57')][_0xacb8('0x5a')]);var _0xa5c845=path['join'](config[_0xacb8('0x4e')],_0xacb8('0x4f'),util['format'](_0xacb8('0x54'),path[_0xacb8('0x59')](_0x4be4f2['file'][_0xacb8('0x5a')],path[_0xacb8('0x56')](_0x4be4f2[_0xacb8('0x57')]['filename'])),_0x553ff6[_0xacb8('0x4c')]));logger[_0xacb8('0x5d')](_0xacb8('0x5e'),_0x4c91a0);logger[_0xacb8('0x5d')](_0xacb8('0x5f'),_0xa5c845);try{fs[_0xacb8('0x60')](_0x4c91a0,parseInt(_0xacb8('0x61'),0x8));var _0x22e96b=sox['transcode'](_0x4c91a0,_0xa5c845,{'sampleRate':0x1f40,'format':_0xacb8('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x22e96b['on'](_0xacb8('0x62'),function(_0x248194){fs['unlinkSync'](_0x4c91a0);_0x574055[_0xacb8('0x1a')](0x1f4)[_0xacb8('0x2c')](_0x248194);});_0x22e96b['on'](_0xacb8('0x63'),function(_0x44552e){_0x553ff6['original_duration']=isNaN(_0x44552e[_0xacb8('0x64')])?null:_0x44552e[_0xacb8('0x64')]*0x3e8;_0x553ff6[_0xacb8('0x65')]=isNaN(_0x44552e[_0xacb8('0x66')])?null:_0x44552e['sampleCount'];_0x553ff6[_0xacb8('0x67')]=isNaN(_0x44552e[_0xacb8('0x68')])?null:_0x44552e[_0xacb8('0x68')];_0x553ff6[_0xacb8('0x69')]=isNaN(_0x44552e[_0xacb8('0x6a')])?null:_0x44552e[_0xacb8('0x6a')];_0x553ff6['original_sampleRate']=isNaN(_0x44552e[_0xacb8('0x6b')])?null:_0x44552e[_0xacb8('0x6b')];});_0x22e96b['on'](_0xacb8('0x6c'),function(_0x4ce854){_0x553ff6[_0xacb8('0x6d')]=isNaN(_0x4ce854[_0xacb8('0x64')])?null:_0x4ce854[_0xacb8('0x64')]*0x3e8;_0x553ff6[_0xacb8('0x6e')]=isNaN(_0x4ce854[_0xacb8('0x66')])?null:_0x4ce854[_0xacb8('0x66')];_0x553ff6[_0xacb8('0x6f')]=isNaN(_0x4ce854[_0xacb8('0x68')])?null:_0x4ce854['channelCount'];_0x553ff6[_0xacb8('0x70')]=isNaN(_0x4ce854[_0xacb8('0x6a')])?null:_0x4ce854['bitRate'];_0x553ff6[_0xacb8('0x71')]=isNaN(_0x4ce854[_0xacb8('0x6b')])?null:_0x4ce854[_0xacb8('0x6b')];});_0x22e96b['on'](_0xacb8('0x1b'),function(){fs[_0xacb8('0x60')](_0xa5c845,parseInt(_0xacb8('0x61'),0x8));return db[_0xacb8('0x2f')][_0xacb8('0x55')](_0x553ff6)[_0xacb8('0x27')](function(_0x3b8377){var _0x45f25e={'role':_0x4be4f2[_0xacb8('0x72')]['role'],'userProfileId':_0x4be4f2[_0xacb8('0x72')][_0xacb8('0x73')]};if(!_0x45f25e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45f25e['role']===_0xacb8('0x74')){var _0x1e77a9=_0x3b8377[_0xacb8('0x29')]({'plain':!![]});return db[_0xacb8('0x75')][_0xacb8('0x49')]({'where':{'name':'Sounds','userProfileId':_0x45f25e[_0xacb8('0x73')]},'raw':!![]})[_0xacb8('0x27')](function(_0x32371f){if(_0x32371f&&_0x32371f[_0xacb8('0x76')]===0x0){return db[_0xacb8('0x2a')]['create']({'name':_0x1e77a9[_0xacb8('0x2b')],'resourceId':_0x1e77a9['id'],'type':_0x32371f['name'],'sectionId':_0x32371f['id']},{})[_0xacb8('0x27')](function(){return _0x3b8377;});}else{return _0x3b8377;}})[_0xacb8('0x45')](function(_0x16503e){logger['error'](_0xacb8('0x77'),_0x16503e);throw _0x16503e;});}return _0x3b8377;})['then'](respondWithResult(_0x574055,null))['catch'](handleError(_0x574055,null));});_0x22e96b[_0xacb8('0x78')]();}catch(_0x4da774){_0x574055['status'](0x1f4)[_0xacb8('0x2c')](_0x4da774);}};exports[_0xacb8('0x26')]=function(_0x3de319,_0x13e0c2,_0x3f8517){return db[_0xacb8('0x2f')][_0xacb8('0x49')]({'where':{'id':_0x3de319[_0xacb8('0x46')]['id']}})[_0xacb8('0x27')](handleEntityNotFound(_0x13e0c2,null))['then'](saveUpdates(_[_0xacb8('0x79')](_0x3de319[_0xacb8('0x72')],['name',_0xacb8('0x7a')]),null))[_0xacb8('0x27')](respondWithResult(_0x13e0c2,null))[_0xacb8('0x45')](handleError(_0x13e0c2,null));};exports['delete']=function(_0x45cf7f,_0x370ef3,_0x9a1516){return db[_0xacb8('0x2f')][_0xacb8('0x49')]({'where':{'id':_0x45cf7f[_0xacb8('0x46')]['id']}})[_0xacb8('0x27')](function(_0x318e71){if(_0x318e71){return _0x318e71[_0xacb8('0x28')]();}})[_0xacb8('0x27')](function(_0x5046fa){var _0x5e6e86=path[_0xacb8('0x4d')](config['root'],'server/files/sounds/original',util[_0xacb8('0x53')](_0xacb8('0x54'),_0x5046fa[_0xacb8('0x4b')],_0x5046fa[_0xacb8('0x7b')]));var _0x1a1fcf=path[_0xacb8('0x4d')](config[_0xacb8('0x4e')],_0xacb8('0x4f'),util[_0xacb8('0x53')](_0xacb8('0x54'),_0x5046fa[_0xacb8('0x4b')],_0x5046fa[_0xacb8('0x4c')]));fs[_0xacb8('0x7c')](_0x5e6e86);fs[_0xacb8('0x7c')](_0x1a1fcf);return _0x5046fa;})['then'](function(_0x2f624e){if(_0x2f624e){return _0x370ef3[_0xacb8('0x1a')](0xcc)[_0xacb8('0x1b')]();}})['then'](handleEntityNotFound(_0x370ef3,null))[_0xacb8('0x45')](handleError(_0x370ef3,null));};
\ No newline at end of file
+var _0x67f2=['delete','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','get','Sounds','UserProfileResource','error','index','Sound','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','map','VIRTUAL','filter','merge','include','rows','catch','show','params','includeAll','options','find','download','save_name','existsSync','root','converted_format','Sequelize','ValidationError','join','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_channelCount','0777','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description'];(function(_0x517107,_0x37e31f){var _0x553321=function(_0x337ec2){while(--_0x337ec2){_0x517107['push'](_0x517107['shift']());}};_0x553321(++_0x37e31f);}(_0x67f2,0x7c));var _0x267f=function(_0x42c4eb,_0x5ecc24){_0x42c4eb=_0x42c4eb-0x0;var _0x2317c9=_0x67f2[_0x42c4eb];return _0x2317c9;};'use strict';var emlformat=require(_0x267f('0x0'));var rimraf=require(_0x267f('0x1'));var zipdir=require(_0x267f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x267f('0x3'));var moment=require(_0x267f('0x4'));var BPromise=require(_0x267f('0x5'));var Mustache=require(_0x267f('0x6'));var util=require(_0x267f('0x7'));var path=require(_0x267f('0x8'));var sox=require(_0x267f('0x9'));var csv=require(_0x267f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x267f('0xb'));var squel=require(_0x267f('0xc'));var crypto=require(_0x267f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x267f('0xe'));var toCsv=require(_0x267f('0xa'));var querystring=require(_0x267f('0xf'));var Papa=require(_0x267f('0x10'));var Redis=require('ioredis');var authService=require(_0x267f('0x11'));var qs=require(_0x267f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x267f('0x13'));var logger=require(_0x267f('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x267f('0x15'))['db'];function respondWithStatusCode(_0x8baf0f,_0x3299e4){_0x3299e4=_0x3299e4||0xcc;return function(_0x3b19cb){if(_0x3b19cb){return _0x8baf0f[_0x267f('0x16')](_0x3299e4);}return _0x8baf0f[_0x267f('0x17')](_0x3299e4)[_0x267f('0x18')]();};}function respondWithResult(_0x415e63,_0x44a170){_0x44a170=_0x44a170||0xc8;return function(_0x567709){if(_0x567709){return _0x415e63[_0x267f('0x17')](_0x44a170)[_0x267f('0x19')](_0x567709);}};}function respondWithFilteredResult(_0xc7151c,_0x402bc2){return function(_0x46a71f){if(_0x46a71f){var _0x5db491=typeof _0x402bc2[_0x267f('0x1a')]===_0x267f('0x1b')&&typeof _0x402bc2['limit']===_0x267f('0x1b');var _0x3f80b1=_0x46a71f[_0x267f('0x1c')];var _0x29e55a=_0x5db491?0x0:_0x402bc2[_0x267f('0x1a')];var _0x50ba1a=_0x5db491?_0x46a71f[_0x267f('0x1c')]:_0x402bc2['offset']+_0x402bc2[_0x267f('0x1d')];var _0x42542e;if(_0x50ba1a>=_0x3f80b1){_0x50ba1a=_0x3f80b1;_0x42542e=0xc8;}else{_0x42542e=0xce;}_0xc7151c[_0x267f('0x17')](_0x42542e);return _0xc7151c[_0x267f('0x1e')](_0x267f('0x1f'),_0x29e55a+'-'+_0x50ba1a+'/'+_0x3f80b1)[_0x267f('0x19')](_0x46a71f);}return null;};}function patchUpdates(_0x5c2f5f){return function(_0x342773){try{jsonpatch[_0x267f('0x20')](_0x342773,_0x5c2f5f,!![]);}catch(_0xe0390e){return BPromise['reject'](_0xe0390e);}return _0x342773['save']();};}function saveUpdates(_0x363e21,_0x4bc082){return function(_0x5010ef){if(_0x5010ef){return _0x5010ef[_0x267f('0x21')](_0x363e21)[_0x267f('0x22')](function(_0x496c6e){return _0x496c6e;});}return null;};}function removeEntity(_0x1ae000,_0x47d5dd){return function(_0x29b38f){if(_0x29b38f){return _0x29b38f[_0x267f('0x23')]()[_0x267f('0x22')](function(){var _0xf59d10=_0x29b38f[_0x267f('0x24')]({'plain':!![]});var _0x2a8018=_0x267f('0x25');return db[_0x267f('0x26')][_0x267f('0x23')]({'where':{'type':_0x2a8018,'resourceId':_0xf59d10['id']}})[_0x267f('0x22')](function(){return _0x29b38f;});})[_0x267f('0x22')](function(){_0x1ae000[_0x267f('0x17')](0xcc)[_0x267f('0x18')]();});}};}function handleEntityNotFound(_0x3f2f1e,_0x29d9dd){return function(_0x37ccab){if(!_0x37ccab){_0x3f2f1e[_0x267f('0x16')](0x194);}return _0x37ccab;};}function handleError(_0x52dadf,_0x31419a){_0x31419a=_0x31419a||0x1f4;return function(_0x27651d){logger[_0x267f('0x27')](_0x27651d['stack']);if(_0x27651d['name']){delete _0x27651d['name'];}_0x52dadf[_0x267f('0x17')](_0x31419a)['send'](_0x27651d);};}exports[_0x267f('0x28')]=function(_0x2666cc,_0xf83fd6){var _0x247c23={},_0x163578={},_0x559573={'count':0x0,'rows':[]};var _0x294654=_['map'](db[_0x267f('0x29')][_0x267f('0x2a')],function(_0x7c0ff8){return{'name':_0x7c0ff8['fieldName'],'type':_0x7c0ff8[_0x267f('0x2b')][_0x267f('0x2c')]};});_0x163578[_0x267f('0x2d')]=_['map'](_0x294654,_0x267f('0x2e'));_0x163578[_0x267f('0x2f')]=_[_0x267f('0x30')](_0x2666cc[_0x267f('0x2f')]);_0x163578[_0x267f('0x31')]=_[_0x267f('0x32')](_0x163578[_0x267f('0x2d')],_0x163578['query']);_0x247c23[_0x267f('0x33')]=_['intersection'](_0x163578[_0x267f('0x2d')],qs[_0x267f('0x34')](_0x2666cc[_0x267f('0x2f')]['fields']));_0x247c23['attributes']=_0x247c23[_0x267f('0x33')][_0x267f('0x35')]?_0x247c23[_0x267f('0x33')]:_0x163578['model'];if(!_0x2666cc[_0x267f('0x2f')][_0x267f('0x36')]('nolimit')){_0x247c23['limit']=qs['limit'](_0x2666cc[_0x267f('0x2f')][_0x267f('0x1d')]);_0x247c23[_0x267f('0x1a')]=qs[_0x267f('0x1a')](_0x2666cc['query'][_0x267f('0x1a')]);}_0x247c23[_0x267f('0x37')]=qs['sort'](_0x2666cc[_0x267f('0x2f')][_0x267f('0x38')]);_0x247c23[_0x267f('0x39')]=qs[_0x267f('0x31')](_['pick'](_0x2666cc[_0x267f('0x2f')],_0x163578[_0x267f('0x31')]),_0x294654);if(_0x2666cc[_0x267f('0x2f')]['filter']){_0x247c23[_0x267f('0x39')]=_['merge'](_0x247c23[_0x267f('0x39')],{'$or':_[_0x267f('0x3a')](_0x294654,function(_0x10bf2d){if(_0x10bf2d[_0x267f('0x2b')]!==_0x267f('0x3b')){var _0x335d72={};_0x335d72[_0x10bf2d[_0x267f('0x2e')]]={'$like':'%'+_0x2666cc[_0x267f('0x2f')][_0x267f('0x3c')]+'%'};return _0x335d72;}})});}_0x247c23=_[_0x267f('0x3d')]({},_0x247c23,_0x2666cc['options']);var _0x4eef3b={'where':_0x247c23[_0x267f('0x39')]};return db[_0x267f('0x29')][_0x267f('0x1c')](_0x4eef3b)[_0x267f('0x22')](function(_0xf381bf){_0x559573[_0x267f('0x1c')]=_0xf381bf;if(_0x2666cc['query']['includeAll']){_0x247c23[_0x267f('0x3e')]=[{'all':!![]}];}return db[_0x267f('0x29')]['findAll'](_0x247c23);})[_0x267f('0x22')](function(_0x35a7e7){_0x559573[_0x267f('0x3f')]=_0x35a7e7;return _0x559573;})['then'](respondWithFilteredResult(_0xf83fd6,_0x247c23))[_0x267f('0x40')](handleError(_0xf83fd6,null));};exports[_0x267f('0x41')]=function(_0x404b32,_0x475750){var _0x577420={'raw':!![],'where':{'id':_0x404b32[_0x267f('0x42')]['id']}},_0x7d59f5={};_0x7d59f5['model']=_[_0x267f('0x30')](db['Sound']['rawAttributes']);_0x7d59f5[_0x267f('0x2f')]=_['keys'](_0x404b32['query']);_0x7d59f5[_0x267f('0x31')]=_['intersection'](_0x7d59f5[_0x267f('0x2d')],_0x7d59f5[_0x267f('0x2f')]);_0x577420['attributes']=_[_0x267f('0x32')](_0x7d59f5[_0x267f('0x2d')],qs[_0x267f('0x34')](_0x404b32['query'][_0x267f('0x34')]));_0x577420['attributes']=_0x577420['attributes'][_0x267f('0x35')]?_0x577420[_0x267f('0x33')]:_0x7d59f5['model'];if(_0x404b32[_0x267f('0x2f')][_0x267f('0x43')]){_0x577420[_0x267f('0x3e')]=[{'all':!![]}];}_0x577420=_['merge']({},_0x577420,_0x404b32[_0x267f('0x44')]);return db['Sound'][_0x267f('0x45')](_0x577420)['then'](handleEntityNotFound(_0x475750,null))[_0x267f('0x22')](respondWithResult(_0x475750,null))[_0x267f('0x40')](handleError(_0x475750,null));};exports[_0x267f('0x46')]=function(_0x231496,_0xbb0c9b,_0x378dcb){return db[_0x267f('0x29')][_0x267f('0x45')]({'where':{'id':_0x231496['params']['id']},'attributes':[_0x267f('0x2e'),_0x267f('0x47'),'converted_format'],'raw':!![]})[_0x267f('0x22')](handleEntityNotFound(_0xbb0c9b,null))[_0x267f('0x22')](function(_0x689484){if(_0x689484){if(!fs[_0x267f('0x48')](path['join'](config[_0x267f('0x49')],'server/files/sounds/converted',_0x689484[_0x267f('0x47')]+'.'+_0x689484[_0x267f('0x4a')]))){throw new db[(_0x267f('0x4b'))][(_0x267f('0x4c'))]('Sound\x20not\x20found');}return _0xbb0c9b['download'](path[_0x267f('0x4d')](config[_0x267f('0x49')],_0x267f('0x4e'),util[_0x267f('0x4f')](_0x267f('0x50'),_0x689484['save_name'],_0x689484['converted_format'])),util[_0x267f('0x4f')]('%s.%s',_0x689484['name'],_0x689484[_0x267f('0x4a')]));}return null;})[_0x267f('0x40')](handleError(_0xbb0c9b,null));};exports[_0x267f('0x51')]=function(_0x2e5141,_0x2b5e83,_0x351750){var _0x21ec62={'name':path[_0x267f('0x52')](_0x2e5141[_0x267f('0x53')][_0x267f('0x54')],path[_0x267f('0x55')](_0x2e5141[_0x267f('0x53')][_0x267f('0x54')])),'save_name':path[_0x267f('0x52')](_0x2e5141[_0x267f('0x53')][_0x267f('0x56')],path[_0x267f('0x55')](_0x2e5141[_0x267f('0x53')][_0x267f('0x56')])),'original_format':path[_0x267f('0x55')](_0x2e5141[_0x267f('0x53')][_0x267f('0x54')])[_0x267f('0x57')](0x1),'converted_format':_0x267f('0x58')};var _0x5214d8=path[_0x267f('0x4d')](config[_0x267f('0x49')],_0x267f('0x59'),_0x2e5141['file']['filename']);var _0x5d333e=path[_0x267f('0x4d')](config[_0x267f('0x49')],'server/files/sounds/converted',util[_0x267f('0x4f')](_0x267f('0x50'),path[_0x267f('0x52')](_0x2e5141[_0x267f('0x53')][_0x267f('0x56')],path['extname'](_0x2e5141[_0x267f('0x53')]['filename'])),_0x21ec62['converted_format']));logger[_0x267f('0x5a')](_0x267f('0x5b'),_0x5214d8);logger[_0x267f('0x5a')](_0x267f('0x5c'),_0x5d333e);try{fs[_0x267f('0x5d')](_0x5214d8,parseInt('0777',0x8));var _0xf310=sox['transcode'](_0x5214d8,_0x5d333e,{'sampleRate':0x1f40,'format':_0x267f('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xf310['on'](_0x267f('0x27'),function(_0x70f69a){fs[_0x267f('0x5e')](_0x5214d8);_0x2b5e83[_0x267f('0x17')](0x1f4)[_0x267f('0x5f')](_0x70f69a);});_0xf310['on'](_0x267f('0x60'),function(_0x23b38d){_0x21ec62[_0x267f('0x61')]=isNaN(_0x23b38d[_0x267f('0x62')])?null:_0x23b38d[_0x267f('0x62')]*0x3e8;_0x21ec62[_0x267f('0x63')]=isNaN(_0x23b38d[_0x267f('0x64')])?null:_0x23b38d['sampleCount'];_0x21ec62['original_channelCount']=isNaN(_0x23b38d[_0x267f('0x65')])?null:_0x23b38d[_0x267f('0x65')];_0x21ec62[_0x267f('0x66')]=isNaN(_0x23b38d[_0x267f('0x67')])?null:_0x23b38d[_0x267f('0x67')];_0x21ec62[_0x267f('0x68')]=isNaN(_0x23b38d[_0x267f('0x69')])?null:_0x23b38d[_0x267f('0x69')];});_0xf310['on'](_0x267f('0x6a'),function(_0x4f1411){_0x21ec62['converted_duration']=isNaN(_0x4f1411['duration'])?null:_0x4f1411[_0x267f('0x62')]*0x3e8;_0x21ec62['converted_sampleCount']=isNaN(_0x4f1411[_0x267f('0x64')])?null:_0x4f1411[_0x267f('0x64')];_0x21ec62[_0x267f('0x6b')]=isNaN(_0x4f1411['channelCount'])?null:_0x4f1411[_0x267f('0x65')];_0x21ec62['converted_bitRate']=isNaN(_0x4f1411[_0x267f('0x67')])?null:_0x4f1411[_0x267f('0x67')];_0x21ec62['converted_sampleRate']=isNaN(_0x4f1411[_0x267f('0x69')])?null:_0x4f1411['sampleRate'];});_0xf310['on'](_0x267f('0x18'),function(){fs['chmodSync'](_0x5d333e,parseInt(_0x267f('0x6c'),0x8));return db['Sound'][_0x267f('0x51')](_0x21ec62)[_0x267f('0x22')](function(_0xb8150f){var _0x5d004a={'role':_0x2e5141[_0x267f('0x6d')][_0x267f('0x6e')],'userProfileId':_0x2e5141[_0x267f('0x6d')][_0x267f('0x6f')]};if(!_0x5d004a)throw new Error(_0x267f('0x70'));if(_0x5d004a[_0x267f('0x6e')]===_0x267f('0x71')){var _0x2fa9b2=_0xb8150f[_0x267f('0x24')]({'plain':!![]});return db[_0x267f('0x72')][_0x267f('0x45')]({'where':{'name':_0x267f('0x25'),'userProfileId':_0x5d004a[_0x267f('0x6f')]},'raw':!![]})['then'](function(_0x4ec7c8){if(_0x4ec7c8&&_0x4ec7c8[_0x267f('0x73')]===0x0){return db['UserProfileResource']['create']({'name':_0x2fa9b2[_0x267f('0x2e')],'resourceId':_0x2fa9b2['id'],'type':_0x4ec7c8[_0x267f('0x2e')],'sectionId':_0x4ec7c8['id']},{})['then'](function(){return _0xb8150f;});}else{return _0xb8150f;}})[_0x267f('0x40')](function(_0x592d41){logger[_0x267f('0x27')](_0x267f('0x74'),_0x592d41);throw _0x592d41;});}return _0xb8150f;})[_0x267f('0x22')](respondWithResult(_0x2b5e83,null))['catch'](handleError(_0x2b5e83,null));});_0xf310[_0x267f('0x75')]();}catch(_0x2e0e0a){_0x2b5e83['status'](0x1f4)[_0x267f('0x5f')](_0x2e0e0a);}};exports[_0x267f('0x21')]=function(_0x100fb8,_0xb733da,_0x3f4d7a){return db[_0x267f('0x29')][_0x267f('0x45')]({'where':{'id':_0x100fb8[_0x267f('0x42')]['id']}})[_0x267f('0x22')](handleEntityNotFound(_0xb733da,null))[_0x267f('0x22')](saveUpdates(_[_0x267f('0x76')](_0x100fb8[_0x267f('0x6d')],[_0x267f('0x2e'),_0x267f('0x77')]),null))[_0x267f('0x22')](respondWithResult(_0xb733da,null))[_0x267f('0x40')](handleError(_0xb733da,null));};exports[_0x267f('0x78')]=function(_0xaf4765,_0x28d54d,_0x36c652){return db[_0x267f('0x29')][_0x267f('0x45')]({'where':{'id':_0xaf4765[_0x267f('0x42')]['id']}})[_0x267f('0x22')](function(_0x29b7ed){if(_0x29b7ed){return _0x29b7ed[_0x267f('0x23')]();}})[_0x267f('0x22')](function(_0x488223){var _0x11c5f1=path[_0x267f('0x4d')](config[_0x267f('0x49')],_0x267f('0x59'),util[_0x267f('0x4f')](_0x267f('0x50'),_0x488223['save_name'],_0x488223[_0x267f('0x79')]));var _0x1ae9c8=path[_0x267f('0x4d')](config[_0x267f('0x49')],_0x267f('0x4e'),util[_0x267f('0x4f')](_0x267f('0x50'),_0x488223[_0x267f('0x47')],_0x488223['converted_format']));fs[_0x267f('0x5e')](_0x11c5f1);fs['unlinkSync'](_0x1ae9c8);return _0x488223;})[_0x267f('0x22')](function(_0x34ca9c){if(_0x34ca9c){return _0x28d54d[_0x267f('0x17')](0xcc)[_0x267f('0x18')]();}})['then'](handleEntityNotFound(_0x28d54d,null))[_0x267f('0x40')](handleError(_0x28d54d,null));};
\ No newline at end of file
index f246ced..3debe36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e5=['Sound','tools_sounds','api','bluebird','request-promise','path','rimraf','./sound.attributes','exports'];(function(_0x1f0db2,_0x510ac1){var _0x15261a=function(_0xd62e0a){while(--_0xd62e0a){_0x1f0db2['push'](_0x1f0db2['shift']());}};_0x15261a(++_0x510ac1);}(_0x34e5,0x1df));var _0x534e=function(_0x2a1144,_0x45b079){_0x2a1144=_0x2a1144-0x0;var _0x50120a=_0x34e5[_0x2a1144];return _0x50120a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x534e('0x0'));var moment=require('moment');var BPromise=require(_0x534e('0x1'));var rp=require(_0x534e('0x2'));var fs=require('fs');var path=require(_0x534e('0x3'));var rimraf=require(_0x534e('0x4'));var config=require('../../config/environment');var attributes=require(_0x534e('0x5'));module[_0x534e('0x6')]=function(_0x481103,_0x58888e){return _0x481103['define'](_0x534e('0x7'),attributes,{'tableName':_0x534e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd56f=['bluebird','path','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','api','moment'];(function(_0x9cd324,_0x3d6f7a){var _0x16db9c=function(_0x1fc8ea){while(--_0x1fc8ea){_0x9cd324['push'](_0x9cd324['shift']());}};_0x16db9c(++_0x3d6f7a);}(_0xd56f,0x140));var _0xfd56=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0xd56f[_0x1af05b];return _0x5be7cc;};'use strict';var _=require(_0xfd56('0x0'));var util=require('util');var logger=require(_0xfd56('0x1'))(_0xfd56('0x2'));var moment=require(_0xfd56('0x3'));var BPromise=require(_0xfd56('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd56('0x5'));var rimraf=require('rimraf');var config=require(_0xfd56('0x6'));var attributes=require(_0xfd56('0x7'));module[_0xfd56('0x8')]=function(_0x2a6f26,_0x51d0c8){return _0x2a6f26[_0xfd56('0x9')](_0xfd56('0xa'),attributes,{'tableName':_0xfd56('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 11acd16..84386f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8007=['where','include','map','attributes','model','ShowSound','debug','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','message','Sound,\x20%s,\x20%s','info','result','catch','Sound','find','options','raw'];(function(_0x22207c,_0x2ba640){var _0x46a3a3=function(_0x134baa){while(--_0x134baa){_0x22207c['push'](_0x22207c['shift']());}};_0x46a3a3(++_0x2ba640);}(_0x8007,0x100));var _0x7800=function(_0x1469c6,_0x455db8){_0x1469c6=_0x1469c6-0x0;var _0x4a40a0=_0x8007[_0x1469c6];return _0x4a40a0;};'use strict';var _=require(_0x7800('0x0'));var util=require('util');var moment=require(_0x7800('0x1'));var BPromise=require('bluebird');var rs=require(_0x7800('0x2'));var fs=require('fs');var Redis=require(_0x7800('0x3'));var db=require(_0x7800('0x4'))['db'];var utils=require(_0x7800('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7800('0x6'));var jayson=require(_0x7800('0x7'));var client=jayson[_0x7800('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e07ee,_0x2ab004,_0x574de2){return new BPromise(function(_0x3a3672,_0x41b2bf){return client[_0x7800('0x9')](_0x5e07ee,_0x574de2)[_0x7800('0xa')](function(_0x2ab04b){logger['info']('Sound,\x20%s,\x20%s',_0x2ab004,_0x7800('0xb'));logger['debug'](_0x7800('0xc'),_0x2ab004,'request\x20sent',JSON['stringify'](_0x2ab04b));if(_0x2ab04b[_0x7800('0xd')]){if(_0x2ab04b[_0x7800('0xd')]['code']===0x1f4){logger[_0x7800('0xd')]('Sound,\x20%s,\x20%s',_0x2ab004,_0x2ab04b['error'][_0x7800('0xe')]);return _0x41b2bf(_0x2ab04b[_0x7800('0xd')]['message']);}logger[_0x7800('0xd')](_0x7800('0xf'),_0x2ab004,_0x2ab04b['error'][_0x7800('0xe')]);return _0x3a3672(_0x2ab04b['error'][_0x7800('0xe')]);}else{logger[_0x7800('0x10')](_0x7800('0xf'),_0x2ab004,_0x7800('0xb'));_0x3a3672(_0x2ab04b[_0x7800('0x11')]['message']);}})[_0x7800('0x12')](function(_0x49c73b){logger[_0x7800('0xd')]('Sound,\x20%s,\x20%s',_0x2ab004,_0x49c73b);_0x41b2bf(_0x49c73b);});});}exports['ShowSound']=function(_0x4bc992){var _0x1757ff=this;return new Promise(function(_0x3261de,_0x158d73){return db[_0x7800('0x13')][_0x7800('0x14')]({'raw':_0x4bc992[_0x7800('0x15')]?_0x4bc992[_0x7800('0x15')][_0x7800('0x16')]===undefined?!![]:![]:!![],'where':_0x4bc992['options']?_0x4bc992['options'][_0x7800('0x17')]||null:null,'attributes':_0x4bc992[_0x7800('0x15')]?_0x4bc992[_0x7800('0x15')]['attributes']||null:null,'include':_0x4bc992[_0x7800('0x15')]?_0x4bc992['options'][_0x7800('0x18')]?_[_0x7800('0x19')](_0x4bc992[_0x7800('0x15')][_0x7800('0x18')],function(_0x9bba9b){return{'model':db[_0x9bba9b['model']],'as':_0x9bba9b['as'],'attributes':_0x9bba9b[_0x7800('0x1a')],'include':_0x9bba9b[_0x7800('0x18')]?_['map'](_0x9bba9b[_0x7800('0x18')],function(_0x31ff66){return{'model':db[_0x31ff66[_0x7800('0x1b')]],'as':_0x31ff66['as'],'attributes':_0x31ff66[_0x7800('0x1a')],'include':_0x31ff66[_0x7800('0x18')]?_[_0x7800('0x19')](_0x31ff66[_0x7800('0x18')],function(_0x243373){return{'model':db[_0x243373[_0x7800('0x1b')]],'as':_0x243373['as'],'attributes':_0x243373[_0x7800('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bacf7){logger[_0x7800('0x10')](_0x7800('0x1c'),_0x4bc992);logger[_0x7800('0x1d')](_0x7800('0x1c'),_0x4bc992,JSON[_0x7800('0x1e')](_0x1bacf7));_0x3261de(_0x1bacf7);})[_0x7800('0x12')](function(_0x28351f){logger[_0x7800('0xd')](_0x7800('0x1c'),_0x28351f[_0x7800('0xe')],_0x4bc992);_0x158d73(_0x1757ff[_0x7800('0xd')](0x1f4,_0x28351f[_0x7800('0xe')]));});});};
\ No newline at end of file
+var _0x73a7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSound','Sound','find','options','where','attributes','include','map','model','then','catch','lodash','util'];(function(_0x1fd8d6,_0x25ce47){var _0x3bd93c=function(_0x11adda){while(--_0x11adda){_0x1fd8d6['push'](_0x1fd8d6['shift']());}};_0x3bd93c(++_0x25ce47);}(_0x73a7,0xa3));var _0x773a=function(_0x278078,_0x391cb3){_0x278078=_0x278078-0x0;var _0x888452=_0x73a7[_0x278078];return _0x888452;};'use strict';var _=require(_0x773a('0x0'));var util=require(_0x773a('0x1'));var moment=require('moment');var BPromise=require(_0x773a('0x2'));var rs=require(_0x773a('0x3'));var fs=require('fs');var Redis=require(_0x773a('0x4'));var db=require(_0x773a('0x5'))['db'];var utils=require(_0x773a('0x6'));var logger=require(_0x773a('0x7'))(_0x773a('0x8'));var config=require(_0x773a('0x9'));var jayson=require(_0x773a('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a2969,_0x5d6751,_0x44c4c0){return new BPromise(function(_0x22b66e,_0x4795c8){return client[_0x773a('0xb')](_0x1a2969,_0x44c4c0)['then'](function(_0x5ef33c){logger[_0x773a('0xc')](_0x773a('0xd'),_0x5d6751,'request\x20sent');logger[_0x773a('0xe')](_0x773a('0xf'),_0x5d6751,_0x773a('0x10'),JSON[_0x773a('0x11')](_0x5ef33c));if(_0x5ef33c[_0x773a('0x12')]){if(_0x5ef33c[_0x773a('0x12')][_0x773a('0x13')]===0x1f4){logger[_0x773a('0x12')](_0x773a('0xd'),_0x5d6751,_0x5ef33c['error']['message']);return _0x4795c8(_0x5ef33c[_0x773a('0x12')]['message']);}logger[_0x773a('0x12')](_0x773a('0xd'),_0x5d6751,_0x5ef33c[_0x773a('0x12')][_0x773a('0x14')]);return _0x22b66e(_0x5ef33c[_0x773a('0x12')][_0x773a('0x14')]);}else{logger[_0x773a('0xc')](_0x773a('0xd'),_0x5d6751,_0x773a('0x10'));_0x22b66e(_0x5ef33c[_0x773a('0x15')][_0x773a('0x14')]);}})['catch'](function(_0xa11825){logger[_0x773a('0x12')](_0x773a('0xd'),_0x5d6751,_0xa11825);_0x4795c8(_0xa11825);});});}exports[_0x773a('0x16')]=function(_0x2b3407){var _0x1be850=this;return new Promise(function(_0x1d215d,_0x35741d){return db[_0x773a('0x17')][_0x773a('0x18')]({'raw':_0x2b3407[_0x773a('0x19')]?_0x2b3407[_0x773a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2b3407[_0x773a('0x19')]?_0x2b3407[_0x773a('0x19')][_0x773a('0x1a')]||null:null,'attributes':_0x2b3407['options']?_0x2b3407[_0x773a('0x19')][_0x773a('0x1b')]||null:null,'include':_0x2b3407[_0x773a('0x19')]?_0x2b3407[_0x773a('0x19')][_0x773a('0x1c')]?_[_0x773a('0x1d')](_0x2b3407['options'][_0x773a('0x1c')],function(_0x2fa4a9){return{'model':db[_0x2fa4a9[_0x773a('0x1e')]],'as':_0x2fa4a9['as'],'attributes':_0x2fa4a9['attributes'],'include':_0x2fa4a9[_0x773a('0x1c')]?_[_0x773a('0x1d')](_0x2fa4a9[_0x773a('0x1c')],function(_0x246e3d){return{'model':db[_0x246e3d['model']],'as':_0x246e3d['as'],'attributes':_0x246e3d[_0x773a('0x1b')],'include':_0x246e3d[_0x773a('0x1c')]?_['map'](_0x246e3d[_0x773a('0x1c')],function(_0x28d77a){return{'model':db[_0x28d77a[_0x773a('0x1e')]],'as':_0x28d77a['as'],'attributes':_0x28d77a[_0x773a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x773a('0x1f')](function(_0x142e9b){logger['info'](_0x773a('0x16'),_0x2b3407);logger[_0x773a('0xe')](_0x773a('0x16'),_0x2b3407,JSON[_0x773a('0x11')](_0x142e9b));_0x1d215d(_0x142e9b);})[_0x773a('0x20')](function(_0x30fa08){logger[_0x773a('0x12')](_0x773a('0x16'),_0x30fa08[_0x773a('0x14')],_0x2b3407);_0x35741d(_0x1be850[_0x773a('0x12')](0x1f4,_0x30fa08[_0x773a('0x14')]));});});};
\ No newline at end of file
index 9fe47d5..19b69a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x528d5d,_0x431c95){var _0x58e6c0=function(_0xc1c0aa){while(--_0xc1c0aa){_0x528d5d['push'](_0x528d5d['shift']());}};_0x58e6c0(++_0x431c95);}(_0x0b0e,0x187));var _0xe0b0=function(_0x45f4e9,_0x5246fd){_0x45f4e9=_0x45f4e9-0x0;var _0x559d8f=_0x0b0e[_0x45f4e9];return _0x559d8f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router;
\ No newline at end of file
+var _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x1049f6,_0x27bae1){var _0x3f4a73=function(_0x396b9e){while(--_0x396b9e){_0x1049f6['push'](_0x1049f6['shift']());}};_0x3f4a73(++_0x27bae1);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x5eb8[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router;
\ No newline at end of file
index e0c1066..817c430 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7487=['TEXT','ENUM','out','exports','STRING'];(function(_0xe4cd7d,_0x3c7064){var _0x2ff977=function(_0x27db03){while(--_0x27db03){_0xe4cd7d['push'](_0xe4cd7d['shift']());}};_0x2ff977(++_0x3c7064);}(_0x7487,0x198));var _0x7748=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7487[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require('sequelize');module[_0x7748('0x0')]={'uniqueid':{'type':Sequelize[_0x7748('0x1')]},'body':{'type':Sequelize[_0x7748('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x7748('0x3')]('in',_0x7748('0x4')),'defaultValue':_0x7748('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7748('0x2')]}};
\ No newline at end of file
+var _0x0dd9=['out','exports','STRING','TEXT','ENUM'];(function(_0x1e7d8f,_0x3418a8){var _0x4ccbdd=function(_0x464025){while(--_0x464025){_0x1e7d8f['push'](_0x1e7d8f['shift']());}};_0x4ccbdd(++_0x3418a8);}(_0x0dd9,0x182));var _0x90dd=function(_0x4f05ba,_0x2bea98){_0x4f05ba=_0x4f05ba-0x0;var _0x52e7c7=_0x0dd9[_0x4f05ba];return _0x52e7c7;};'use strict';var Sequelize=require('sequelize');module[_0x90dd('0x0')]={'uniqueid':{'type':Sequelize[_0x90dd('0x1')]},'body':{'type':Sequelize[_0x90dd('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x90dd('0x3')]('in',_0x90dd('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x90dd('0x2')]}};
\ No newline at end of file
index b4fa963..6cae20c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd4d=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','SquareMessage','findAll','catch','show','keys','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0xa21fa0,_0x423401){var _0x4deb53=function(_0x5d2bb8){while(--_0x5d2bb8){_0xa21fa0['push'](_0xa21fa0['shift']());}};_0x4deb53(++_0x423401);}(_0xcd4d,0xe4));var _0xdcd4=function(_0x287f81,_0xdbd80c){_0x287f81=_0x287f81-0x0;var _0x5b6933=_0xcd4d[_0x287f81];return _0x5b6933;};'use strict';var emlformat=require(_0xdcd4('0x0'));var rimraf=require(_0xdcd4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdcd4('0x2'));var rp=require(_0xdcd4('0x3'));var moment=require(_0xdcd4('0x4'));var BPromise=require(_0xdcd4('0x5'));var Mustache=require(_0xdcd4('0x6'));var util=require(_0xdcd4('0x7'));var path=require(_0xdcd4('0x8'));var sox=require(_0xdcd4('0x9'));var csv=require(_0xdcd4('0xa'));var ejs=require(_0xdcd4('0xb'));var fs=require('fs');var fs_extra=require(_0xdcd4('0xc'));var _=require(_0xdcd4('0xd'));var squel=require(_0xdcd4('0xe'));var crypto=require(_0xdcd4('0xf'));var jsforce=require(_0xdcd4('0x10'));var deskjs=require(_0xdcd4('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdcd4('0x12'));var Papa=require(_0xdcd4('0x13'));var Redis=require('ioredis');var authService=require(_0xdcd4('0x14'));var qs=require(_0xdcd4('0x15'));var as=require(_0xdcd4('0x16'));var hardwareService=require(_0xdcd4('0x17'));var logger=require(_0xdcd4('0x18'))('api');var utils=require(_0xdcd4('0x19'));var config=require(_0xdcd4('0x1a'));var licenseUtil=require(_0xdcd4('0x1b'));var db=require(_0xdcd4('0x1c'))['db'];function respondWithStatusCode(_0x2bf080,_0x553279){_0x553279=_0x553279||0xcc;return function(_0x12af2b){if(_0x12af2b){return _0x2bf080[_0xdcd4('0x1d')](_0x553279);}return _0x2bf080['status'](_0x553279)[_0xdcd4('0x1e')]();};}function respondWithResult(_0x16f7e5,_0x4aa877){_0x4aa877=_0x4aa877||0xc8;return function(_0x49f85e){if(_0x49f85e){return _0x16f7e5[_0xdcd4('0x1f')](_0x4aa877)[_0xdcd4('0x20')](_0x49f85e);}};}function respondWithFilteredResult(_0x282a21,_0x26b226){return function(_0x280598){if(_0x280598){var _0x3a1d3a=typeof _0x26b226[_0xdcd4('0x21')]===_0xdcd4('0x22')&&typeof _0x26b226[_0xdcd4('0x23')]===_0xdcd4('0x22');var _0xdb8b41=_0x280598['count'];var _0x579125=_0x3a1d3a?0x0:_0x26b226[_0xdcd4('0x21')];var _0x7682f8=_0x3a1d3a?_0x280598[_0xdcd4('0x24')]:_0x26b226[_0xdcd4('0x21')]+_0x26b226[_0xdcd4('0x23')];var _0x2433f0;if(_0x7682f8>=_0xdb8b41){_0x7682f8=_0xdb8b41;_0x2433f0=0xc8;}else{_0x2433f0=0xce;}_0x282a21[_0xdcd4('0x1f')](_0x2433f0);return _0x282a21[_0xdcd4('0x25')](_0xdcd4('0x26'),_0x579125+'-'+_0x7682f8+'/'+_0xdb8b41)[_0xdcd4('0x20')](_0x280598);}return null;};}function patchUpdates(_0x28bec2){return function(_0x2864c9){try{jsonpatch[_0xdcd4('0x27')](_0x2864c9,_0x28bec2,!![]);}catch(_0x196619){return BPromise[_0xdcd4('0x28')](_0x196619);}return _0x2864c9['save']();};}function saveUpdates(_0x21a330,_0xb4414e){return function(_0x520bb7){if(_0x520bb7){return _0x520bb7[_0xdcd4('0x29')](_0x21a330)[_0xdcd4('0x2a')](function(_0x17faa9){return _0x17faa9;});}return null;};}function removeEntity(_0x4d1e32,_0x46768f){return function(_0x427c92){if(_0x427c92){return _0x427c92[_0xdcd4('0x2b')]()['then'](function(){_0x4d1e32[_0xdcd4('0x1f')](0xcc)[_0xdcd4('0x1e')]();});}};}function handleEntityNotFound(_0x48b046,_0x2bb8d0){return function(_0xb8472f){if(!_0xb8472f){_0x48b046[_0xdcd4('0x1d')](0x194);}return _0xb8472f;};}function handleError(_0x8f8ea4,_0x41b3d2){_0x41b3d2=_0x41b3d2||0x1f4;return function(_0x44c843){logger[_0xdcd4('0x2c')](_0x44c843[_0xdcd4('0x2d')]);if(_0x44c843['name']){delete _0x44c843[_0xdcd4('0x2e')];}_0x8f8ea4['status'](_0x41b3d2)[_0xdcd4('0x2f')](_0x44c843);};}exports[_0xdcd4('0x30')]=function(_0x5b9f9d,_0x583fef){var _0x574e84={},_0x58cf67={},_0x18d0e1={'count':0x0,'rows':[]};var _0x2804aa=_[_0xdcd4('0x31')](db['SquareMessage'][_0xdcd4('0x32')],function(_0x1d0937){return{'name':_0x1d0937['fieldName'],'type':_0x1d0937[_0xdcd4('0x33')][_0xdcd4('0x34')]};});_0x58cf67[_0xdcd4('0x35')]=_[_0xdcd4('0x31')](_0x2804aa,_0xdcd4('0x2e'));_0x58cf67[_0xdcd4('0x36')]=_['keys'](_0x5b9f9d[_0xdcd4('0x36')]);_0x58cf67['filters']=_[_0xdcd4('0x37')](_0x58cf67[_0xdcd4('0x35')],_0x58cf67[_0xdcd4('0x36')]);_0x574e84[_0xdcd4('0x38')]=_[_0xdcd4('0x37')](_0x58cf67['model'],qs['fields'](_0x5b9f9d[_0xdcd4('0x36')][_0xdcd4('0x39')]));_0x574e84[_0xdcd4('0x38')]=_0x574e84['attributes'][_0xdcd4('0x3a')]?_0x574e84[_0xdcd4('0x38')]:_0x58cf67['model'];if(!_0x5b9f9d['query'][_0xdcd4('0x3b')](_0xdcd4('0x3c'))){_0x574e84[_0xdcd4('0x23')]=qs[_0xdcd4('0x23')](_0x5b9f9d[_0xdcd4('0x36')][_0xdcd4('0x23')]);_0x574e84['offset']=qs[_0xdcd4('0x21')](_0x5b9f9d['query'][_0xdcd4('0x21')]);}_0x574e84[_0xdcd4('0x3d')]=qs[_0xdcd4('0x3e')](_0x5b9f9d['query'][_0xdcd4('0x3e')]);_0x574e84[_0xdcd4('0x3f')]=qs[_0xdcd4('0x40')](_[_0xdcd4('0x41')](_0x5b9f9d['query'],_0x58cf67['filters']),_0x2804aa);if(_0x5b9f9d['query'][_0xdcd4('0x42')]){_0x574e84['where']=_[_0xdcd4('0x43')](_0x574e84[_0xdcd4('0x3f')],{'$or':_[_0xdcd4('0x31')](_0x2804aa,function(_0x2482af){if(_0x2482af[_0xdcd4('0x33')]!==_0xdcd4('0x44')){var _0x254516={};_0x254516[_0x2482af[_0xdcd4('0x2e')]]={'$like':'%'+_0x5b9f9d['query'][_0xdcd4('0x42')]+'%'};return _0x254516;}})});}_0x574e84=_['merge']({},_0x574e84,_0x5b9f9d[_0xdcd4('0x45')]);var _0x933d07={'where':_0x574e84[_0xdcd4('0x3f')]};return db['SquareMessage'][_0xdcd4('0x24')](_0x933d07)[_0xdcd4('0x2a')](function(_0x584541){_0x18d0e1[_0xdcd4('0x24')]=_0x584541;if(_0x5b9f9d[_0xdcd4('0x36')][_0xdcd4('0x46')]){_0x574e84['include']=[{'all':!![]}];}return db[_0xdcd4('0x47')][_0xdcd4('0x48')](_0x574e84);})['then'](function(_0x82cd5e){_0x18d0e1['rows']=_0x82cd5e;return _0x18d0e1;})[_0xdcd4('0x2a')](respondWithFilteredResult(_0x583fef,_0x574e84))[_0xdcd4('0x49')](handleError(_0x583fef,null));};exports[_0xdcd4('0x4a')]=function(_0x45e53a,_0x4bc9ed){var _0x282089={'raw':!![],'where':{'id':_0x45e53a['params']['id']}},_0x30a725={};_0x30a725[_0xdcd4('0x35')]=_[_0xdcd4('0x4b')](db[_0xdcd4('0x47')][_0xdcd4('0x32')]);_0x30a725[_0xdcd4('0x36')]=_[_0xdcd4('0x4b')](_0x45e53a[_0xdcd4('0x36')]);_0x30a725[_0xdcd4('0x40')]=_[_0xdcd4('0x37')](_0x30a725[_0xdcd4('0x35')],_0x30a725[_0xdcd4('0x36')]);_0x282089['attributes']=_[_0xdcd4('0x37')](_0x30a725[_0xdcd4('0x35')],qs[_0xdcd4('0x39')](_0x45e53a[_0xdcd4('0x36')][_0xdcd4('0x39')]));_0x282089[_0xdcd4('0x38')]=_0x282089[_0xdcd4('0x38')]['length']?_0x282089['attributes']:_0x30a725[_0xdcd4('0x35')];if(_0x45e53a['query']['includeAll']){_0x282089['include']=[{'all':!![]}];}_0x282089=_['merge']({},_0x282089,_0x45e53a[_0xdcd4('0x45')]);return db[_0xdcd4('0x47')]['find'](_0x282089)[_0xdcd4('0x2a')](handleEntityNotFound(_0x4bc9ed,null))[_0xdcd4('0x2a')](respondWithResult(_0x4bc9ed,null))[_0xdcd4('0x49')](handleError(_0x4bc9ed,null));};exports['create']=function(_0x15f124,_0x329e08){return db[_0xdcd4('0x47')][_0xdcd4('0x4c')](_0x15f124[_0xdcd4('0x4d')],{})[_0xdcd4('0x2a')](respondWithResult(_0x329e08,0xc9))[_0xdcd4('0x49')](handleError(_0x329e08,null));};exports[_0xdcd4('0x29')]=function(_0x942d98,_0xa91417){if(_0x942d98['body']['id']){delete _0x942d98[_0xdcd4('0x4d')]['id'];}return db[_0xdcd4('0x47')][_0xdcd4('0x4e')]({'where':{'id':_0x942d98[_0xdcd4('0x4f')]['id']}})[_0xdcd4('0x2a')](handleEntityNotFound(_0xa91417,null))['then'](saveUpdates(_0x942d98[_0xdcd4('0x4d')],null))[_0xdcd4('0x2a')](respondWithResult(_0xa91417,null))['catch'](handleError(_0xa91417,null));};exports['destroy']=function(_0x5a1695,_0xb325d1){return db['SquareMessage'][_0xdcd4('0x4e')]({'where':{'id':_0x5a1695[_0xdcd4('0x4f')]['id']}})[_0xdcd4('0x2a')](handleEntityNotFound(_0xb325d1,null))[_0xdcd4('0x2a')](removeEntity(_0xb325d1,null))['catch'](handleError(_0xb325d1,null));};
\ No newline at end of file
+var _0x62ec=['mustache','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','SquareMessage','findAll','rows','catch','show','includeAll','options','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x23991f,_0x3cf4ee){var _0x536c7b=function(_0x1b9249){while(--_0x1b9249){_0x23991f['push'](_0x23991f['shift']());}};_0x536c7b(++_0x3cf4ee);}(_0x62ec,0xe0));var _0xc62e=function(_0x2247db,_0x2065c0){_0x2247db=_0x2247db-0x0;var _0x1c1e19=_0x62ec[_0x2247db];return _0x1c1e19;};'use strict';var emlformat=require(_0xc62e('0x0'));var rimraf=require(_0xc62e('0x1'));var zipdir=require(_0xc62e('0x2'));var jsonpatch=require(_0xc62e('0x3'));var rp=require(_0xc62e('0x4'));var moment=require(_0xc62e('0x5'));var BPromise=require(_0xc62e('0x6'));var Mustache=require(_0xc62e('0x7'));var util=require('util');var path=require('path');var sox=require(_0xc62e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc62e('0x9'));var squel=require(_0xc62e('0xa'));var crypto=require(_0xc62e('0xb'));var jsforce=require(_0xc62e('0xc'));var deskjs=require(_0xc62e('0xd'));var toCsv=require(_0xc62e('0xe'));var querystring=require(_0xc62e('0xf'));var Papa=require(_0xc62e('0x10'));var Redis=require(_0xc62e('0x11'));var authService=require(_0xc62e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc62e('0x13'));var hardwareService=require(_0xc62e('0x14'));var logger=require('../../config/logger')(_0xc62e('0x15'));var utils=require(_0xc62e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc62e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42b62c,_0x3b7e26){_0x3b7e26=_0x3b7e26||0xcc;return function(_0x3dc922){if(_0x3dc922){return _0x42b62c[_0xc62e('0x18')](_0x3b7e26);}return _0x42b62c['status'](_0x3b7e26)[_0xc62e('0x19')]();};}function respondWithResult(_0xe48933,_0x378a35){_0x378a35=_0x378a35||0xc8;return function(_0x279543){if(_0x279543){return _0xe48933[_0xc62e('0x1a')](_0x378a35)[_0xc62e('0x1b')](_0x279543);}};}function respondWithFilteredResult(_0x549b58,_0x235791){return function(_0x5685b8){if(_0x5685b8){var _0x395f4d=typeof _0x235791['offset']===_0xc62e('0x1c')&&typeof _0x235791[_0xc62e('0x1d')]===_0xc62e('0x1c');var _0x3d24f9=_0x5685b8['count'];var _0x54efa4=_0x395f4d?0x0:_0x235791['offset'];var _0x4b4a39=_0x395f4d?_0x5685b8[_0xc62e('0x1e')]:_0x235791[_0xc62e('0x1f')]+_0x235791[_0xc62e('0x1d')];var _0x5a6084;if(_0x4b4a39>=_0x3d24f9){_0x4b4a39=_0x3d24f9;_0x5a6084=0xc8;}else{_0x5a6084=0xce;}_0x549b58[_0xc62e('0x1a')](_0x5a6084);return _0x549b58[_0xc62e('0x20')](_0xc62e('0x21'),_0x54efa4+'-'+_0x4b4a39+'/'+_0x3d24f9)[_0xc62e('0x1b')](_0x5685b8);}return null;};}function patchUpdates(_0x846d06){return function(_0x54ff1b){try{jsonpatch[_0xc62e('0x22')](_0x54ff1b,_0x846d06,!![]);}catch(_0x3ad2b7){return BPromise[_0xc62e('0x23')](_0x3ad2b7);}return _0x54ff1b['save']();};}function saveUpdates(_0x2f1c8e,_0x134075){return function(_0x5e7df6){if(_0x5e7df6){return _0x5e7df6[_0xc62e('0x24')](_0x2f1c8e)[_0xc62e('0x25')](function(_0x5a2caf){return _0x5a2caf;});}return null;};}function removeEntity(_0x54795a,_0x1cb4f2){return function(_0x3f5639){if(_0x3f5639){return _0x3f5639['destroy']()[_0xc62e('0x25')](function(){_0x54795a[_0xc62e('0x1a')](0xcc)[_0xc62e('0x19')]();});}};}function handleEntityNotFound(_0x5ace39,_0x582584){return function(_0x471093){if(!_0x471093){_0x5ace39[_0xc62e('0x18')](0x194);}return _0x471093;};}function handleError(_0x3f0d88,_0x31a3df){_0x31a3df=_0x31a3df||0x1f4;return function(_0x1b7fdb){logger[_0xc62e('0x26')](_0x1b7fdb[_0xc62e('0x27')]);if(_0x1b7fdb[_0xc62e('0x28')]){delete _0x1b7fdb[_0xc62e('0x28')];}_0x3f0d88[_0xc62e('0x1a')](_0x31a3df)[_0xc62e('0x29')](_0x1b7fdb);};}exports[_0xc62e('0x2a')]=function(_0x477a19,_0x20decd){var _0x8b3a19={},_0x2b9b72={},_0x4b01ab={'count':0x0,'rows':[]};var _0x556850=_['map'](db['SquareMessage'][_0xc62e('0x2b')],function(_0x1ed8b0){return{'name':_0x1ed8b0[_0xc62e('0x2c')],'type':_0x1ed8b0[_0xc62e('0x2d')][_0xc62e('0x2e')]};});_0x2b9b72['model']=_[_0xc62e('0x2f')](_0x556850,_0xc62e('0x28'));_0x2b9b72['query']=_[_0xc62e('0x30')](_0x477a19[_0xc62e('0x31')]);_0x2b9b72['filters']=_['intersection'](_0x2b9b72['model'],_0x2b9b72['query']);_0x8b3a19[_0xc62e('0x32')]=_[_0xc62e('0x33')](_0x2b9b72[_0xc62e('0x34')],qs[_0xc62e('0x35')](_0x477a19['query'][_0xc62e('0x35')]));_0x8b3a19[_0xc62e('0x32')]=_0x8b3a19['attributes'][_0xc62e('0x36')]?_0x8b3a19[_0xc62e('0x32')]:_0x2b9b72[_0xc62e('0x34')];if(!_0x477a19[_0xc62e('0x31')][_0xc62e('0x37')](_0xc62e('0x38'))){_0x8b3a19[_0xc62e('0x1d')]=qs[_0xc62e('0x1d')](_0x477a19[_0xc62e('0x31')]['limit']);_0x8b3a19['offset']=qs[_0xc62e('0x1f')](_0x477a19['query']['offset']);}_0x8b3a19[_0xc62e('0x39')]=qs['sort'](_0x477a19[_0xc62e('0x31')][_0xc62e('0x3a')]);_0x8b3a19[_0xc62e('0x3b')]=qs[_0xc62e('0x3c')](_[_0xc62e('0x3d')](_0x477a19[_0xc62e('0x31')],_0x2b9b72[_0xc62e('0x3c')]),_0x556850);if(_0x477a19[_0xc62e('0x31')]['filter']){_0x8b3a19[_0xc62e('0x3b')]=_[_0xc62e('0x3e')](_0x8b3a19['where'],{'$or':_[_0xc62e('0x2f')](_0x556850,function(_0x51a5f3){if(_0x51a5f3[_0xc62e('0x2d')]!==_0xc62e('0x3f')){var _0x24df13={};_0x24df13[_0x51a5f3['name']]={'$like':'%'+_0x477a19[_0xc62e('0x31')][_0xc62e('0x40')]+'%'};return _0x24df13;}})});}_0x8b3a19=_['merge']({},_0x8b3a19,_0x477a19['options']);var _0x252b5f={'where':_0x8b3a19[_0xc62e('0x3b')]};return db['SquareMessage'][_0xc62e('0x1e')](_0x252b5f)[_0xc62e('0x25')](function(_0x3096b9){_0x4b01ab[_0xc62e('0x1e')]=_0x3096b9;if(_0x477a19[_0xc62e('0x31')]['includeAll']){_0x8b3a19[_0xc62e('0x41')]=[{'all':!![]}];}return db[_0xc62e('0x42')][_0xc62e('0x43')](_0x8b3a19);})['then'](function(_0x5d7949){_0x4b01ab[_0xc62e('0x44')]=_0x5d7949;return _0x4b01ab;})[_0xc62e('0x25')](respondWithFilteredResult(_0x20decd,_0x8b3a19))[_0xc62e('0x45')](handleError(_0x20decd,null));};exports[_0xc62e('0x46')]=function(_0x34a936,_0x276a04){var _0x3a8ad5={'raw':!![],'where':{'id':_0x34a936['params']['id']}},_0x5c52b7={};_0x5c52b7[_0xc62e('0x34')]=_[_0xc62e('0x30')](db[_0xc62e('0x42')][_0xc62e('0x2b')]);_0x5c52b7[_0xc62e('0x31')]=_[_0xc62e('0x30')](_0x34a936['query']);_0x5c52b7['filters']=_[_0xc62e('0x33')](_0x5c52b7[_0xc62e('0x34')],_0x5c52b7[_0xc62e('0x31')]);_0x3a8ad5['attributes']=_[_0xc62e('0x33')](_0x5c52b7[_0xc62e('0x34')],qs[_0xc62e('0x35')](_0x34a936[_0xc62e('0x31')][_0xc62e('0x35')]));_0x3a8ad5[_0xc62e('0x32')]=_0x3a8ad5[_0xc62e('0x32')][_0xc62e('0x36')]?_0x3a8ad5[_0xc62e('0x32')]:_0x5c52b7[_0xc62e('0x34')];if(_0x34a936[_0xc62e('0x31')][_0xc62e('0x47')]){_0x3a8ad5['include']=[{'all':!![]}];}_0x3a8ad5=_[_0xc62e('0x3e')]({},_0x3a8ad5,_0x34a936[_0xc62e('0x48')]);return db[_0xc62e('0x42')][_0xc62e('0x49')](_0x3a8ad5)['then'](handleEntityNotFound(_0x276a04,null))[_0xc62e('0x25')](respondWithResult(_0x276a04,null))[_0xc62e('0x45')](handleError(_0x276a04,null));};exports['create']=function(_0x156715,_0x1a0e94){return db['SquareMessage']['create'](_0x156715[_0xc62e('0x4a')],{})['then'](respondWithResult(_0x1a0e94,0xc9))[_0xc62e('0x45')](handleError(_0x1a0e94,null));};exports[_0xc62e('0x24')]=function(_0x4a28e5,_0x5c9b68){if(_0x4a28e5['body']['id']){delete _0x4a28e5[_0xc62e('0x4a')]['id'];}return db[_0xc62e('0x42')][_0xc62e('0x49')]({'where':{'id':_0x4a28e5[_0xc62e('0x4b')]['id']}})[_0xc62e('0x25')](handleEntityNotFound(_0x5c9b68,null))[_0xc62e('0x25')](saveUpdates(_0x4a28e5[_0xc62e('0x4a')],null))[_0xc62e('0x25')](respondWithResult(_0x5c9b68,null))[_0xc62e('0x45')](handleError(_0x5c9b68,null));};exports[_0xc62e('0x4c')]=function(_0x2668a1,_0x5deccb){return db[_0xc62e('0x42')][_0xc62e('0x49')]({'where':{'id':_0x2668a1[_0xc62e('0x4b')]['id']}})[_0xc62e('0x25')](handleEntityNotFound(_0x5deccb,null))['then'](removeEntity(_0x5deccb,null))['catch'](handleError(_0x5deccb,null));};
\ No newline at end of file
index 18a5b2e..f924b10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccd4=['define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareMessage.attributes','exports'];(function(_0x2e0f77,_0x23099a){var _0x17baa8=function(_0x4cbe28){while(--_0x4cbe28){_0x2e0f77['push'](_0x2e0f77['shift']());}};_0x17baa8(++_0x23099a);}(_0xccd4,0x1e3));var _0x4ccd=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xccd4[_0x75f869];return _0x10af8b;};'use strict';var _=require(_0x4ccd('0x0'));var util=require('util');var logger=require(_0x4ccd('0x1'))(_0x4ccd('0x2'));var moment=require(_0x4ccd('0x3'));var BPromise=require(_0x4ccd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ccd('0x5'));var rimraf=require('rimraf');var config=require(_0x4ccd('0x6'));var attributes=require(_0x4ccd('0x7'));module[_0x4ccd('0x8')]=function(_0x3f8153,_0xfb5460){return _0x3f8153[_0x4ccd('0x9')](_0x4ccd('0xa'),attributes,{'tableName':_0x4ccd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcffe=['path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','../../config/logger','api'];(function(_0x59cc5c,_0x201ad5){var _0x188fd8=function(_0x41e0c3){while(--_0x41e0c3){_0x59cc5c['push'](_0x59cc5c['shift']());}};_0x188fd8(++_0x201ad5);}(_0xcffe,0x120));var _0xecff=function(_0x14bd60,_0x73b2f9){_0x14bd60=_0x14bd60-0x0;var _0x4b0a31=_0xcffe[_0x14bd60];return _0x4b0a31;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xecff('0x0'))(_0xecff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xecff('0x2'));var rimraf=require(_0xecff('0x3'));var config=require(_0xecff('0x4'));var attributes=require(_0xecff('0x5'));module[_0xecff('0x6')]=function(_0x278a87,_0x597ec4){return _0x278a87[_0xecff('0x7')](_0xecff('0x8'),attributes,{'tableName':_0xecff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7876912..403a56d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6130=['stringify','error','code','message','result','catch','SquareMessage','body','options','CreateSquareMessage','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2e6744,_0x495160){var _0x20ef10=function(_0x5540d6){while(--_0x5540d6){_0x2e6744['push'](_0x2e6744['shift']());}};_0x20ef10(++_0x495160);}(_0x6130,0xd5));var _0x0613=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x6130[_0x4b2863];return _0x567d67;};'use strict';var _=require('lodash');var util=require(_0x0613('0x0'));var moment=require(_0x0613('0x1'));var BPromise=require(_0x0613('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0613('0x3'));var db=require(_0x0613('0x4'))['db'];var utils=require(_0x0613('0x5'));var logger=require(_0x0613('0x6'))(_0x0613('0x7'));var config=require(_0x0613('0x8'));var jayson=require(_0x0613('0x9'));var client=jayson[_0x0613('0xa')][_0x0613('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x319acb,_0x3ce5dd,_0x5cfa81){return new BPromise(function(_0x48102a,_0x4df55b){return client[_0x0613('0xc')](_0x319acb,_0x5cfa81)[_0x0613('0xd')](function(_0x446ace){logger[_0x0613('0xe')](_0x0613('0xf'),_0x3ce5dd,_0x0613('0x10'));logger[_0x0613('0x11')](_0x0613('0x12'),_0x3ce5dd,_0x0613('0x10'),JSON[_0x0613('0x13')](_0x446ace));if(_0x446ace[_0x0613('0x14')]){if(_0x446ace[_0x0613('0x14')][_0x0613('0x15')]===0x1f4){logger[_0x0613('0x14')](_0x0613('0xf'),_0x3ce5dd,_0x446ace['error'][_0x0613('0x16')]);return _0x4df55b(_0x446ace[_0x0613('0x14')][_0x0613('0x16')]);}logger[_0x0613('0x14')](_0x0613('0xf'),_0x3ce5dd,_0x446ace['error'][_0x0613('0x16')]);return _0x48102a(_0x446ace[_0x0613('0x14')][_0x0613('0x16')]);}else{logger[_0x0613('0xe')](_0x0613('0xf'),_0x3ce5dd,_0x0613('0x10'));_0x48102a(_0x446ace[_0x0613('0x17')][_0x0613('0x16')]);}})[_0x0613('0x18')](function(_0x5cdbdc){logger['error'](_0x0613('0xf'),_0x3ce5dd,_0x5cdbdc);_0x4df55b(_0x5cdbdc);});});}exports['CreateSquareMessage']=function(_0x5cb280){var _0x2dd3c4=this;return new Promise(function(_0x28fc5a,_0x51ccc1){return db[_0x0613('0x19')]['create'](_0x5cb280[_0x0613('0x1a')],{'raw':_0x5cb280[_0x0613('0x1b')]?_0x5cb280[_0x0613('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x141c11){logger[_0x0613('0xe')]('CreateSquareMessage',_0x5cb280);logger[_0x0613('0x11')](_0x0613('0x1c'),_0x5cb280,JSON[_0x0613('0x13')](_0x141c11));_0x28fc5a(_0x141c11);})['catch'](function(_0x53156f){logger['error'](_0x0613('0x1c'),_0x53156f['message'],_0x5cb280);_0x51ccc1(_0x2dd3c4[_0x0613('0x14')](0x1f4,_0x53156f[_0x0613('0x16')]));});});};
\ No newline at end of file
+var _0xfd1a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','create','body','options','then','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfd1a,0x187));var _0xafd1=function(_0x193459,_0x250ab3){_0x193459=_0x193459-0x0;var _0x3dea56=_0xfd1a[_0x193459];return _0x3dea56;};'use strict';var _=require(_0xafd1('0x0'));var util=require('util');var moment=require(_0xafd1('0x1'));var BPromise=require('bluebird');var rs=require(_0xafd1('0x2'));var fs=require('fs');var Redis=require(_0xafd1('0x3'));var db=require(_0xafd1('0x4'))['db'];var utils=require(_0xafd1('0x5'));var logger=require(_0xafd1('0x6'))(_0xafd1('0x7'));var config=require(_0xafd1('0x8'));var jayson=require(_0xafd1('0x9'));var client=jayson[_0xafd1('0xa')][_0xafd1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x566297,_0x472555,_0x1e98f2){return new BPromise(function(_0x2a7cb2,_0x596153){return client[_0xafd1('0xc')](_0x566297,_0x1e98f2)['then'](function(_0x360f92){logger[_0xafd1('0xd')]('SquareMessage,\x20%s,\x20%s',_0x472555,_0xafd1('0xe'));logger[_0xafd1('0xf')](_0xafd1('0x10'),_0x472555,_0xafd1('0xe'),JSON[_0xafd1('0x11')](_0x360f92));if(_0x360f92[_0xafd1('0x12')]){if(_0x360f92[_0xafd1('0x12')]['code']===0x1f4){logger['error'](_0xafd1('0x13'),_0x472555,_0x360f92[_0xafd1('0x12')][_0xafd1('0x14')]);return _0x596153(_0x360f92[_0xafd1('0x12')]['message']);}logger[_0xafd1('0x12')](_0xafd1('0x13'),_0x472555,_0x360f92[_0xafd1('0x12')]['message']);return _0x2a7cb2(_0x360f92[_0xafd1('0x12')]['message']);}else{logger[_0xafd1('0xd')](_0xafd1('0x13'),_0x472555,_0xafd1('0xe'));_0x2a7cb2(_0x360f92[_0xafd1('0x15')]['message']);}})[_0xafd1('0x16')](function(_0x12c961){logger[_0xafd1('0x12')](_0xafd1('0x13'),_0x472555,_0x12c961);_0x596153(_0x12c961);});});}exports[_0xafd1('0x17')]=function(_0x5347fe){var _0x19a4f6=this;return new Promise(function(_0x568378,_0xb8dfbb){return db['SquareMessage'][_0xafd1('0x18')](_0x5347fe[_0xafd1('0x19')],{'raw':_0x5347fe[_0xafd1('0x1a')]?_0x5347fe[_0xafd1('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xafd1('0x1b')](function(_0x757f39){logger[_0xafd1('0xd')](_0xafd1('0x17'),_0x5347fe);logger[_0xafd1('0xf')]('CreateSquareMessage',_0x5347fe,JSON[_0xafd1('0x11')](_0x757f39));_0x568378(_0x757f39);})['catch'](function(_0x528266){logger[_0xafd1('0x12')](_0xafd1('0x17'),_0x528266['message'],_0x5347fe);_0xb8dfbb(_0x19a4f6[_0xafd1('0x12')](0x1f4,_0x528266['message']));});});};
\ No newline at end of file
index e44dd68..15d1aac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb49d=['express','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','test','create','put','delete','destroy','exports','connect-timeout'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0xb49d,0x10f));var _0xdb49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb49d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdb49('0x0'));var express=require(_0xdb49('0x1'));var router=express[_0xdb49('0x2')]();var fs_extra=require(_0xdb49('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdb49('0x4'));var config=require('../../config/environment');var controller=require(_0xdb49('0x5'));router[_0xdb49('0x6')]('/',auth[_0xdb49('0x7')](),controller[_0xdb49('0x8')]);router[_0xdb49('0x6')](_0xdb49('0x9'),auth[_0xdb49('0x7')](),controller[_0xdb49('0xa')]);router['get']('/:id/test',auth[_0xdb49('0x7')](),timeout('15s'),controller[_0xdb49('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdb49('0xc')]);router[_0xdb49('0xd')](_0xdb49('0x9'),auth[_0xdb49('0x7')](),controller['update']);router[_0xdb49('0xe')](_0xdb49('0x9'),auth['isAuthenticated'](),controller[_0xdb49('0xf')]);module[_0xdb49('0x10')]=router;
\ No newline at end of file
+var _0x19e6=['connect-timeout','express','Router','fs-extra','../../config/environment','./squareOdbc.controller','isAuthenticated','get','/:id/test','15s','test','post','create','put','update','/:id','destroy','exports','util','path'];(function(_0x2e7a97,_0x20748d){var _0x2d40ff=function(_0x130f04){while(--_0x130f04){_0x2e7a97['push'](_0x2e7a97['shift']());}};_0x2d40ff(++_0x20748d);}(_0x19e6,0x102));var _0x619e=function(_0x367c3c,_0x8d20a5){_0x367c3c=_0x367c3c-0x0;var _0x1261fc=_0x19e6[_0x367c3c];return _0x1261fc;};'use strict';var multer=require('multer');var util=require(_0x619e('0x0'));var path=require(_0x619e('0x1'));var timeout=require(_0x619e('0x2'));var express=require(_0x619e('0x3'));var router=express[_0x619e('0x4')]();var fs_extra=require(_0x619e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x619e('0x6'));var controller=require(_0x619e('0x7'));router['get']('/',auth[_0x619e('0x8')](),controller['index']);router[_0x619e('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x619e('0x9')](_0x619e('0xa'),auth[_0x619e('0x8')](),timeout(_0x619e('0xb')),controller[_0x619e('0xc')]);router[_0x619e('0xd')]('/',auth['isAuthenticated'](),controller[_0x619e('0xe')]);router[_0x619e('0xf')]('/:id',auth[_0x619e('0x8')](),controller[_0x619e('0x10')]);router['delete'](_0x619e('0x11'),auth[_0x619e('0x8')](),controller[_0x619e('0x12')]);module[_0x619e('0x13')]=router;
\ No newline at end of file
index 6883a77..748651d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe554=['exports','STRING'];(function(_0x2de945,_0x24086e){var _0x4e1201=function(_0x4df61a){while(--_0x4df61a){_0x2de945['push'](_0x2de945['shift']());}};_0x4e1201(++_0x24086e);}(_0xe554,0x70));var _0x4e55=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xe554[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require('sequelize');module[_0x4e55('0x0')]={'name':{'type':Sequelize[_0x4e55('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x4e55('0x1')]},'description':{'type':Sequelize[_0x4e55('0x1')]}};
\ No newline at end of file
+var _0xcd92=['STRING','sequelize','exports'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xcd92,0x12a));var _0x2cd9=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xcd92[_0x82129b];return _0x2ae5dc;};'use strict';var Sequelize=require(_0x2cd9('0x0'));module[_0x2cd9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x2cd9('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 046dcdb..34a033b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9624=['index','map','SquareOdbc','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','test','dsn','odbc','openSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','ODBC','UserProfileResource','error','stack','name'];(function(_0x2f94df,_0x111491){var _0x97b57a=function(_0x30b18c){while(--_0x30b18c){_0x2f94df['push'](_0x2f94df['shift']());}};_0x97b57a(++_0x111491);}(_0x9624,0xd7));var _0x4962=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9624[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x4962('0x0'));var rimraf=require(_0x4962('0x1'));var zipdir=require(_0x4962('0x2'));var jsonpatch=require(_0x4962('0x3'));var rp=require('request-promise');var moment=require(_0x4962('0x4'));var BPromise=require(_0x4962('0x5'));var Mustache=require(_0x4962('0x6'));var util=require(_0x4962('0x7'));var path=require('path');var sox=require(_0x4962('0x8'));var csv=require(_0x4962('0x9'));var ejs=require(_0x4962('0xa'));var fs=require('fs');var fs_extra=require(_0x4962('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4962('0xc'));var deskjs=require(_0x4962('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4962('0xe'));var Papa=require(_0x4962('0xf'));var Redis=require(_0x4962('0x10'));var authService=require(_0x4962('0x11'));var qs=require(_0x4962('0x12'));var as=require(_0x4962('0x13'));var hardwareService=require(_0x4962('0x14'));var logger=require('../../config/logger')(_0x4962('0x15'));var utils=require('../../config/utils');var config=require(_0x4962('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4962('0x17'))['db'];function respondWithStatusCode(_0x522652,_0x384b52){_0x384b52=_0x384b52||0xcc;return function(_0x4b76b2){if(_0x4b76b2){return _0x522652[_0x4962('0x18')](_0x384b52);}return _0x522652[_0x4962('0x19')](_0x384b52)[_0x4962('0x1a')]();};}function respondWithResult(_0x57e9b3,_0x2a26f6){_0x2a26f6=_0x2a26f6||0xc8;return function(_0x135dfa){if(_0x135dfa){return _0x57e9b3['status'](_0x2a26f6)[_0x4962('0x1b')](_0x135dfa);}};}function respondWithFilteredResult(_0x19877b,_0x57fcd3){return function(_0x289160){if(_0x289160){var _0x14097c=typeof _0x57fcd3[_0x4962('0x1c')]===_0x4962('0x1d')&&typeof _0x57fcd3['limit']===_0x4962('0x1d');var _0x5d8a34=_0x289160[_0x4962('0x1e')];var _0xd833dd=_0x14097c?0x0:_0x57fcd3['offset'];var _0x27f71e=_0x14097c?_0x289160['count']:_0x57fcd3[_0x4962('0x1c')]+_0x57fcd3[_0x4962('0x1f')];var _0x24eda7;if(_0x27f71e>=_0x5d8a34){_0x27f71e=_0x5d8a34;_0x24eda7=0xc8;}else{_0x24eda7=0xce;}_0x19877b['status'](_0x24eda7);return _0x19877b[_0x4962('0x20')](_0x4962('0x21'),_0xd833dd+'-'+_0x27f71e+'/'+_0x5d8a34)['json'](_0x289160);}return null;};}function patchUpdates(_0x585505){return function(_0x2fe695){try{jsonpatch[_0x4962('0x22')](_0x2fe695,_0x585505,!![]);}catch(_0xf3297){return BPromise[_0x4962('0x23')](_0xf3297);}return _0x2fe695[_0x4962('0x24')]();};}function saveUpdates(_0x2e6e6a,_0x387c9a){return function(_0x431ffd){if(_0x431ffd){return _0x431ffd[_0x4962('0x25')](_0x2e6e6a)['then'](function(_0x14c3f6){return _0x14c3f6;});}return null;};}function removeEntity(_0x496a92,_0x5d63f7){return function(_0x5af0c6){if(_0x5af0c6){return _0x5af0c6[_0x4962('0x26')]()[_0x4962('0x27')](function(){var _0x4e4674=_0x5af0c6[_0x4962('0x28')]({'plain':!![]});var _0x1e8c5e=_0x4962('0x29');return db[_0x4962('0x2a')][_0x4962('0x26')]({'where':{'type':_0x1e8c5e,'resourceId':_0x4e4674['id']}})[_0x4962('0x27')](function(){return _0x5af0c6;});})['then'](function(){_0x496a92[_0x4962('0x19')](0xcc)[_0x4962('0x1a')]();});}};}function handleEntityNotFound(_0x5056c5,_0x240af0){return function(_0x44ff95){if(!_0x44ff95){_0x5056c5[_0x4962('0x18')](0x194);}return _0x44ff95;};}function handleError(_0x11f70d,_0x4dd70c){_0x4dd70c=_0x4dd70c||0x1f4;return function(_0x55794f){logger[_0x4962('0x2b')](_0x55794f[_0x4962('0x2c')]);if(_0x55794f['name']){delete _0x55794f[_0x4962('0x2d')];}_0x11f70d[_0x4962('0x19')](_0x4dd70c)['send'](_0x55794f);};}exports[_0x4962('0x2e')]=function(_0x1e6e32,_0x54af6b){var _0x217a1c={},_0x4a223e={},_0x251577={'count':0x0,'rows':[]};var _0x5d3599=_[_0x4962('0x2f')](db[_0x4962('0x30')][_0x4962('0x31')],function(_0x211f5d){return{'name':_0x211f5d[_0x4962('0x32')],'type':_0x211f5d['type'][_0x4962('0x33')]};});_0x4a223e[_0x4962('0x34')]=_[_0x4962('0x2f')](_0x5d3599,_0x4962('0x2d'));_0x4a223e[_0x4962('0x35')]=_[_0x4962('0x36')](_0x1e6e32[_0x4962('0x35')]);_0x4a223e[_0x4962('0x37')]=_[_0x4962('0x38')](_0x4a223e[_0x4962('0x34')],_0x4a223e['query']);_0x217a1c['attributes']=_[_0x4962('0x38')](_0x4a223e[_0x4962('0x34')],qs[_0x4962('0x39')](_0x1e6e32['query'][_0x4962('0x39')]));_0x217a1c[_0x4962('0x3a')]=_0x217a1c[_0x4962('0x3a')][_0x4962('0x3b')]?_0x217a1c[_0x4962('0x3a')]:_0x4a223e[_0x4962('0x34')];if(!_0x1e6e32[_0x4962('0x35')][_0x4962('0x3c')]('nolimit')){_0x217a1c[_0x4962('0x1f')]=qs[_0x4962('0x1f')](_0x1e6e32[_0x4962('0x35')][_0x4962('0x1f')]);_0x217a1c[_0x4962('0x1c')]=qs[_0x4962('0x1c')](_0x1e6e32[_0x4962('0x35')][_0x4962('0x1c')]);}_0x217a1c[_0x4962('0x3d')]=qs[_0x4962('0x3e')](_0x1e6e32['query'][_0x4962('0x3e')]);_0x217a1c[_0x4962('0x3f')]=qs[_0x4962('0x37')](_[_0x4962('0x40')](_0x1e6e32[_0x4962('0x35')],_0x4a223e[_0x4962('0x37')]),_0x5d3599);if(_0x1e6e32[_0x4962('0x35')][_0x4962('0x41')]){_0x217a1c[_0x4962('0x3f')]=_[_0x4962('0x42')](_0x217a1c[_0x4962('0x3f')],{'$or':_['map'](_0x5d3599,function(_0x2f1541){if(_0x2f1541[_0x4962('0x43')]!==_0x4962('0x44')){var _0x4cde7b={};_0x4cde7b[_0x2f1541[_0x4962('0x2d')]]={'$like':'%'+_0x1e6e32['query'][_0x4962('0x41')]+'%'};return _0x4cde7b;}})});}_0x217a1c=_[_0x4962('0x42')]({},_0x217a1c,_0x1e6e32[_0x4962('0x45')]);var _0x4e2943={'where':_0x217a1c[_0x4962('0x3f')]};return db['SquareOdbc'][_0x4962('0x1e')](_0x4e2943)[_0x4962('0x27')](function(_0x20f9e0){_0x251577['count']=_0x20f9e0;if(_0x1e6e32[_0x4962('0x35')][_0x4962('0x46')]){_0x217a1c[_0x4962('0x47')]=[{'all':!![]}];}return db[_0x4962('0x30')][_0x4962('0x48')](_0x217a1c);})[_0x4962('0x27')](function(_0x35a20b){_0x251577['rows']=_0x35a20b;return _0x251577;})['then'](respondWithFilteredResult(_0x54af6b,_0x217a1c))[_0x4962('0x49')](handleError(_0x54af6b,null));};exports[_0x4962('0x4a')]=function(_0x2c4d64,_0x3a43cb){var _0x2db667={'raw':!![],'where':{'id':_0x2c4d64['params']['id']}},_0x83d8f2={};_0x83d8f2[_0x4962('0x34')]=_[_0x4962('0x36')](db['SquareOdbc'][_0x4962('0x31')]);_0x83d8f2[_0x4962('0x35')]=_['keys'](_0x2c4d64[_0x4962('0x35')]);_0x83d8f2[_0x4962('0x37')]=_[_0x4962('0x38')](_0x83d8f2[_0x4962('0x34')],_0x83d8f2['query']);_0x2db667[_0x4962('0x3a')]=_['intersection'](_0x83d8f2['model'],qs['fields'](_0x2c4d64[_0x4962('0x35')][_0x4962('0x39')]));_0x2db667[_0x4962('0x3a')]=_0x2db667[_0x4962('0x3a')][_0x4962('0x3b')]?_0x2db667[_0x4962('0x3a')]:_0x83d8f2[_0x4962('0x34')];if(_0x2c4d64[_0x4962('0x35')][_0x4962('0x46')]){_0x2db667[_0x4962('0x47')]=[{'all':!![]}];}_0x2db667=_[_0x4962('0x42')]({},_0x2db667,_0x2c4d64[_0x4962('0x45')]);return db[_0x4962('0x30')][_0x4962('0x4b')](_0x2db667)[_0x4962('0x27')](handleEntityNotFound(_0x3a43cb,null))['then'](respondWithResult(_0x3a43cb,null))[_0x4962('0x49')](handleError(_0x3a43cb,null));};exports[_0x4962('0x4c')]=function(_0x176c90,_0x49df5b){return db[_0x4962('0x30')][_0x4962('0x4c')](_0x176c90[_0x4962('0x4d')],{})[_0x4962('0x27')](function(_0xc88d27){var _0x3122e8=_0x176c90['user'][_0x4962('0x28')]({'plain':!![]});if(!_0x3122e8)throw new Error(_0x4962('0x4e'));if(_0x3122e8[_0x4962('0x4f')]==='user'){var _0x3c1f74=_0xc88d27['get']({'plain':!![]});var _0x55542f=_0x4962('0x29');return db[_0x4962('0x50')][_0x4962('0x4b')]({'where':{'name':_0x55542f,'userProfileId':_0x3122e8['userProfileId']},'raw':!![]})[_0x4962('0x27')](function(_0x5738ec){if(_0x5738ec&&_0x5738ec[_0x4962('0x51')]===0x0){return db['UserProfileResource'][_0x4962('0x4c')]({'name':_0x3c1f74[_0x4962('0x2d')],'resourceId':_0x3c1f74['id'],'type':_0x5738ec[_0x4962('0x2d')],'sectionId':_0x5738ec['id']},{})[_0x4962('0x27')](function(){return _0xc88d27;});}else{return _0xc88d27;}})[_0x4962('0x49')](function(_0x56615f){logger[_0x4962('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56615f);throw _0x56615f;});}return _0xc88d27;})[_0x4962('0x27')](respondWithResult(_0x49df5b,0xc9))[_0x4962('0x49')](handleError(_0x49df5b,null));};exports[_0x4962('0x25')]=function(_0x542c0d,_0x524aa8){if(_0x542c0d[_0x4962('0x4d')]['id']){delete _0x542c0d[_0x4962('0x4d')]['id'];}return db[_0x4962('0x30')][_0x4962('0x4b')]({'where':{'id':_0x542c0d[_0x4962('0x52')]['id']}})[_0x4962('0x27')](handleEntityNotFound(_0x524aa8,null))['then'](saveUpdates(_0x542c0d['body'],null))[_0x4962('0x27')](respondWithResult(_0x524aa8,null))['catch'](handleError(_0x524aa8,null));};exports[_0x4962('0x26')]=function(_0x33997d,_0x4dd920){return db['SquareOdbc'][_0x4962('0x4b')]({'where':{'id':_0x33997d[_0x4962('0x52')]['id']}})[_0x4962('0x27')](handleEntityNotFound(_0x4dd920,null))['then'](removeEntity(_0x4dd920,null))[_0x4962('0x49')](handleError(_0x4dd920,null));};exports[_0x4962('0x53')]=function(_0x15e34b,_0x251503,_0x4cb7f1){var _0x4efde5;return db[_0x4962('0x30')][_0x4962('0x4b')]({'where':{'id':_0x15e34b[_0x4962('0x52')]['id']},'attributes':['id',_0x4962('0x54')]})[_0x4962('0x27')](handleEntityNotFound(_0x251503,null))[_0x4962('0x27')](function(_0x2d9c4b){if(_0x2d9c4b){var _0x5e4106=require(_0x4962('0x55'))();_0x5e4106[_0x4962('0x56')](_0x2d9c4b['dsn']);_0x5e4106['closeSync']();return _0x2d9c4b;}})[_0x4962('0x27')](respondWithResult(_0x251503,null))[_0x4962('0x49')](handleError(_0x251503,null));};
\ No newline at end of file
+var _0x08aa=['params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','dsn','odbc','closeSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','then','destroy','ODBC','UserProfileResource','error','stack','name','send','map','SquareOdbc','fieldName','key','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','rows'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x08aa,0x117));var _0xa08a=function(_0x293abe,_0x36dc25){_0x293abe=_0x293abe-0x0;var _0x47aead=_0x08aa[_0x293abe];return _0x47aead;};'use strict';var emlformat=require(_0xa08a('0x0'));var rimraf=require(_0xa08a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa08a('0x2'));var rp=require(_0xa08a('0x3'));var moment=require('moment');var BPromise=require(_0xa08a('0x4'));var Mustache=require(_0xa08a('0x5'));var util=require('util');var path=require(_0xa08a('0x6'));var sox=require(_0xa08a('0x7'));var csv=require(_0xa08a('0x8'));var ejs=require(_0xa08a('0x9'));var fs=require('fs');var fs_extra=require(_0xa08a('0xa'));var _=require(_0xa08a('0xb'));var squel=require(_0xa08a('0xc'));var crypto=require(_0xa08a('0xd'));var jsforce=require(_0xa08a('0xe'));var deskjs=require(_0xa08a('0xf'));var toCsv=require(_0xa08a('0x8'));var querystring=require(_0xa08a('0x10'));var Papa=require(_0xa08a('0x11'));var Redis=require(_0xa08a('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa08a('0x13'));var logger=require('../../config/logger')(_0xa08a('0x14'));var utils=require(_0xa08a('0x15'));var config=require(_0xa08a('0x16'));var licenseUtil=require(_0xa08a('0x17'));var db=require(_0xa08a('0x18'))['db'];function respondWithStatusCode(_0x4d80a9,_0x1b7ff1){_0x1b7ff1=_0x1b7ff1||0xcc;return function(_0x131081){if(_0x131081){return _0x4d80a9[_0xa08a('0x19')](_0x1b7ff1);}return _0x4d80a9['status'](_0x1b7ff1)[_0xa08a('0x1a')]();};}function respondWithResult(_0x37fe1a,_0xff8b5d){_0xff8b5d=_0xff8b5d||0xc8;return function(_0x25f51d){if(_0x25f51d){return _0x37fe1a['status'](_0xff8b5d)[_0xa08a('0x1b')](_0x25f51d);}};}function respondWithFilteredResult(_0x29d257,_0x32481f){return function(_0x2cb6f5){if(_0x2cb6f5){var _0x42baef=typeof _0x32481f[_0xa08a('0x1c')]===_0xa08a('0x1d')&&typeof _0x32481f['limit']===_0xa08a('0x1d');var _0x197f0c=_0x2cb6f5[_0xa08a('0x1e')];var _0x5db480=_0x42baef?0x0:_0x32481f['offset'];var _0x57ddb7=_0x42baef?_0x2cb6f5[_0xa08a('0x1e')]:_0x32481f['offset']+_0x32481f[_0xa08a('0x1f')];var _0x526916;if(_0x57ddb7>=_0x197f0c){_0x57ddb7=_0x197f0c;_0x526916=0xc8;}else{_0x526916=0xce;}_0x29d257[_0xa08a('0x20')](_0x526916);return _0x29d257['set'](_0xa08a('0x21'),_0x5db480+'-'+_0x57ddb7+'/'+_0x197f0c)[_0xa08a('0x1b')](_0x2cb6f5);}return null;};}function patchUpdates(_0x354b72){return function(_0x157017){try{jsonpatch[_0xa08a('0x22')](_0x157017,_0x354b72,!![]);}catch(_0x121c70){return BPromise[_0xa08a('0x23')](_0x121c70);}return _0x157017[_0xa08a('0x24')]();};}function saveUpdates(_0x1c05e0,_0x232a4f){return function(_0x117839){if(_0x117839){return _0x117839['update'](_0x1c05e0)[_0xa08a('0x25')](function(_0x35dc38){return _0x35dc38;});}return null;};}function removeEntity(_0x1f2838,_0x302b47){return function(_0x5d7cf0){if(_0x5d7cf0){return _0x5d7cf0[_0xa08a('0x26')]()[_0xa08a('0x25')](function(){var _0x855d29=_0x5d7cf0['get']({'plain':!![]});var _0x310be8=_0xa08a('0x27');return db[_0xa08a('0x28')]['destroy']({'where':{'type':_0x310be8,'resourceId':_0x855d29['id']}})[_0xa08a('0x25')](function(){return _0x5d7cf0;});})[_0xa08a('0x25')](function(){_0x1f2838[_0xa08a('0x20')](0xcc)[_0xa08a('0x1a')]();});}};}function handleEntityNotFound(_0x39cd44,_0x19c7c2){return function(_0xf056b1){if(!_0xf056b1){_0x39cd44[_0xa08a('0x19')](0x194);}return _0xf056b1;};}function handleError(_0x109ee0,_0x5cc499){_0x5cc499=_0x5cc499||0x1f4;return function(_0x3a601a){logger[_0xa08a('0x29')](_0x3a601a[_0xa08a('0x2a')]);if(_0x3a601a[_0xa08a('0x2b')]){delete _0x3a601a['name'];}_0x109ee0['status'](_0x5cc499)[_0xa08a('0x2c')](_0x3a601a);};}exports['index']=function(_0x23c25b,_0x17edc8){var _0x409d9e={},_0x51945c={},_0x5896a1={'count':0x0,'rows':[]};var _0x4de92a=_[_0xa08a('0x2d')](db[_0xa08a('0x2e')]['rawAttributes'],function(_0x520c70){return{'name':_0x520c70[_0xa08a('0x2f')],'type':_0x520c70['type'][_0xa08a('0x30')]};});_0x51945c[_0xa08a('0x31')]=_[_0xa08a('0x2d')](_0x4de92a,_0xa08a('0x2b'));_0x51945c['query']=_[_0xa08a('0x32')](_0x23c25b['query']);_0x51945c[_0xa08a('0x33')]=_[_0xa08a('0x34')](_0x51945c[_0xa08a('0x31')],_0x51945c['query']);_0x409d9e[_0xa08a('0x35')]=_[_0xa08a('0x34')](_0x51945c[_0xa08a('0x31')],qs[_0xa08a('0x36')](_0x23c25b['query'][_0xa08a('0x36')]));_0x409d9e[_0xa08a('0x35')]=_0x409d9e[_0xa08a('0x35')][_0xa08a('0x37')]?_0x409d9e[_0xa08a('0x35')]:_0x51945c[_0xa08a('0x31')];if(!_0x23c25b[_0xa08a('0x38')][_0xa08a('0x39')]('nolimit')){_0x409d9e[_0xa08a('0x1f')]=qs[_0xa08a('0x1f')](_0x23c25b[_0xa08a('0x38')]['limit']);_0x409d9e['offset']=qs[_0xa08a('0x1c')](_0x23c25b[_0xa08a('0x38')][_0xa08a('0x1c')]);}_0x409d9e['order']=qs[_0xa08a('0x3a')](_0x23c25b['query']['sort']);_0x409d9e['where']=qs[_0xa08a('0x33')](_[_0xa08a('0x3b')](_0x23c25b['query'],_0x51945c['filters']),_0x4de92a);if(_0x23c25b[_0xa08a('0x38')][_0xa08a('0x3c')]){_0x409d9e[_0xa08a('0x3d')]=_['merge'](_0x409d9e['where'],{'$or':_[_0xa08a('0x2d')](_0x4de92a,function(_0x4bc54a){if(_0x4bc54a[_0xa08a('0x3e')]!==_0xa08a('0x3f')){var _0x4c2b15={};_0x4c2b15[_0x4bc54a[_0xa08a('0x2b')]]={'$like':'%'+_0x23c25b[_0xa08a('0x38')][_0xa08a('0x3c')]+'%'};return _0x4c2b15;}})});}_0x409d9e=_[_0xa08a('0x40')]({},_0x409d9e,_0x23c25b[_0xa08a('0x41')]);var _0x353dcc={'where':_0x409d9e[_0xa08a('0x3d')]};return db[_0xa08a('0x2e')][_0xa08a('0x1e')](_0x353dcc)[_0xa08a('0x25')](function(_0x39760b){_0x5896a1[_0xa08a('0x1e')]=_0x39760b;if(_0x23c25b['query'][_0xa08a('0x42')]){_0x409d9e[_0xa08a('0x43')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x409d9e);})[_0xa08a('0x25')](function(_0x50fc1f){_0x5896a1[_0xa08a('0x44')]=_0x50fc1f;return _0x5896a1;})[_0xa08a('0x25')](respondWithFilteredResult(_0x17edc8,_0x409d9e))['catch'](handleError(_0x17edc8,null));};exports['show']=function(_0x5b654e,_0x23697b){var _0x12cc5e={'raw':!![],'where':{'id':_0x5b654e[_0xa08a('0x45')]['id']}},_0x47266c={};_0x47266c[_0xa08a('0x31')]=_[_0xa08a('0x32')](db[_0xa08a('0x2e')]['rawAttributes']);_0x47266c['query']=_[_0xa08a('0x32')](_0x5b654e[_0xa08a('0x38')]);_0x47266c[_0xa08a('0x33')]=_[_0xa08a('0x34')](_0x47266c['model'],_0x47266c[_0xa08a('0x38')]);_0x12cc5e[_0xa08a('0x35')]=_[_0xa08a('0x34')](_0x47266c[_0xa08a('0x31')],qs['fields'](_0x5b654e[_0xa08a('0x38')]['fields']));_0x12cc5e[_0xa08a('0x35')]=_0x12cc5e[_0xa08a('0x35')][_0xa08a('0x37')]?_0x12cc5e[_0xa08a('0x35')]:_0x47266c[_0xa08a('0x31')];if(_0x5b654e[_0xa08a('0x38')][_0xa08a('0x42')]){_0x12cc5e['include']=[{'all':!![]}];}_0x12cc5e=_[_0xa08a('0x40')]({},_0x12cc5e,_0x5b654e['options']);return db[_0xa08a('0x2e')][_0xa08a('0x46')](_0x12cc5e)[_0xa08a('0x25')](handleEntityNotFound(_0x23697b,null))['then'](respondWithResult(_0x23697b,null))[_0xa08a('0x47')](handleError(_0x23697b,null));};exports[_0xa08a('0x48')]=function(_0x2ec235,_0x3a2780){return db[_0xa08a('0x2e')][_0xa08a('0x48')](_0x2ec235['body'],{})[_0xa08a('0x25')](function(_0x2bd641){var _0x5f2a4e=_0x2ec235[_0xa08a('0x49')][_0xa08a('0x4a')]({'plain':!![]});if(!_0x5f2a4e)throw new Error(_0xa08a('0x4b'));if(_0x5f2a4e[_0xa08a('0x4c')]===_0xa08a('0x49')){var _0x37fe16=_0x2bd641['get']({'plain':!![]});var _0x102252=_0xa08a('0x27');return db[_0xa08a('0x4d')]['find']({'where':{'name':_0x102252,'userProfileId':_0x5f2a4e[_0xa08a('0x4e')]},'raw':!![]})[_0xa08a('0x25')](function(_0x4ea7f9){if(_0x4ea7f9&&_0x4ea7f9[_0xa08a('0x4f')]===0x0){return db[_0xa08a('0x28')][_0xa08a('0x48')]({'name':_0x37fe16['name'],'resourceId':_0x37fe16['id'],'type':_0x4ea7f9['name'],'sectionId':_0x4ea7f9['id']},{})[_0xa08a('0x25')](function(){return _0x2bd641;});}else{return _0x2bd641;}})['catch'](function(_0xe7e8f1){logger[_0xa08a('0x29')](_0xa08a('0x50'),_0xe7e8f1);throw _0xe7e8f1;});}return _0x2bd641;})[_0xa08a('0x25')](respondWithResult(_0x3a2780,0xc9))['catch'](handleError(_0x3a2780,null));};exports[_0xa08a('0x51')]=function(_0x40d184,_0x1bedd2){if(_0x40d184[_0xa08a('0x52')]['id']){delete _0x40d184[_0xa08a('0x52')]['id'];}return db['SquareOdbc'][_0xa08a('0x46')]({'where':{'id':_0x40d184[_0xa08a('0x45')]['id']}})[_0xa08a('0x25')](handleEntityNotFound(_0x1bedd2,null))['then'](saveUpdates(_0x40d184['body'],null))['then'](respondWithResult(_0x1bedd2,null))[_0xa08a('0x47')](handleError(_0x1bedd2,null));};exports[_0xa08a('0x26')]=function(_0x1c335f,_0x757a4e){return db['SquareOdbc'][_0xa08a('0x46')]({'where':{'id':_0x1c335f[_0xa08a('0x45')]['id']}})[_0xa08a('0x25')](handleEntityNotFound(_0x757a4e,null))[_0xa08a('0x25')](removeEntity(_0x757a4e,null))[_0xa08a('0x47')](handleError(_0x757a4e,null));};exports[_0xa08a('0x53')]=function(_0x4ddebf,_0x418463,_0x36c9d7){var _0x56dbf2;return db[_0xa08a('0x2e')]['find']({'where':{'id':_0x4ddebf[_0xa08a('0x45')]['id']},'attributes':['id',_0xa08a('0x54')]})['then'](handleEntityNotFound(_0x418463,null))[_0xa08a('0x25')](function(_0x109503){if(_0x109503){var _0xaf73b7=require(_0xa08a('0x55'))();_0xaf73b7['openSync'](_0x109503[_0xa08a('0x54')]);_0xaf73b7[_0xa08a('0x56')]();return _0x109503;}})[_0xa08a('0x25')](respondWithResult(_0x418463,null))[_0xa08a('0x47')](handleError(_0x418463,null));};
\ No newline at end of file
index e36bf19..705fbbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38c1=['path','rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x370c4e,_0x5d9adb){var _0x53537b=function(_0x1a3374){while(--_0x1a3374){_0x370c4e['push'](_0x370c4e['shift']());}};_0x53537b(++_0x5d9adb);}(_0x38c1,0xfe));var _0x138c=function(_0x566667,_0x3f99c2){_0x566667=_0x566667-0x0;var _0x277136=_0x38c1[_0x566667];return _0x277136;};'use strict';var _=require(_0x138c('0x0'));var util=require(_0x138c('0x1'));var logger=require(_0x138c('0x2'))(_0x138c('0x3'));var moment=require('moment');var BPromise=require(_0x138c('0x4'));var rp=require(_0x138c('0x5'));var fs=require('fs');var path=require(_0x138c('0x6'));var rimraf=require(_0x138c('0x7'));var config=require('../../config/environment');var attributes=require(_0x138c('0x8'));module[_0x138c('0x9')]=function(_0x342dba,_0x4bfb76){return _0x342dba[_0x138c('0xa')](_0x138c('0xb'),attributes,{'tableName':_0x138c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5445=['exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x3303c0,_0x1eaa43){var _0x454848=function(_0x6200b2){while(--_0x6200b2){_0x3303c0['push'](_0x3303c0['shift']());}};_0x454848(++_0x1eaa43);}(_0x5445,0x170));var _0x5544=function(_0x3e0863,_0x5e7b9a){_0x3e0863=_0x3e0863-0x0;var _0x5cf89=_0x5445[_0x3e0863];return _0x5cf89;};'use strict';var _=require(_0x5544('0x0'));var util=require(_0x5544('0x1'));var logger=require(_0x5544('0x2'))(_0x5544('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5544('0x4'));var fs=require('fs');var path=require(_0x5544('0x5'));var rimraf=require(_0x5544('0x6'));var config=require(_0x5544('0x7'));var attributes=require(_0x5544('0x8'));module[_0x5544('0x9')]=function(_0xc92014,_0x23dffc){return _0xc92014[_0x5544('0xa')](_0x5544('0xb'),attributes,{'tableName':_0x5544('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e6fd49e..6386b3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7614=['catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','error','message','SquareOdbc,\x20%s,\x20%s','result','SquareOdbc','options','raw','where','attributes','include','map','model','ShowSquareOdbc','debug','stringify'];(function(_0x1f5a7d,_0x25e805){var _0x2e68db=function(_0x1a6872){while(--_0x1a6872){_0x1f5a7d['push'](_0x1f5a7d['shift']());}};_0x2e68db(++_0x25e805);}(_0x7614,0x137));var _0x4761=function(_0x15bb61,_0xeaaf50){_0x15bb61=_0x15bb61-0x0;var _0x40f6fc=_0x7614[_0x15bb61];return _0x40f6fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4761('0x0'));var BPromise=require(_0x4761('0x1'));var rs=require(_0x4761('0x2'));var fs=require('fs');var Redis=require(_0x4761('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4761('0x4'));var logger=require(_0x4761('0x5'))(_0x4761('0x6'));var config=require(_0x4761('0x7'));var jayson=require(_0x4761('0x8'));var client=jayson[_0x4761('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b07d0,_0x2dfb8a,_0x1e8a7b){return new BPromise(function(_0x27e826,_0x1d0505){return client[_0x4761('0xa')](_0x2b07d0,_0x1e8a7b)[_0x4761('0xb')](function(_0x452773){logger[_0x4761('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x2dfb8a,_0x4761('0xd'));logger['debug'](_0x4761('0xe'),_0x2dfb8a,_0x4761('0xd'),JSON['stringify'](_0x452773));if(_0x452773[_0x4761('0xf')]){if(_0x452773[_0x4761('0xf')]['code']===0x1f4){logger[_0x4761('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x2dfb8a,_0x452773[_0x4761('0xf')][_0x4761('0x10')]);return _0x1d0505(_0x452773[_0x4761('0xf')]['message']);}logger['error'](_0x4761('0x11'),_0x2dfb8a,_0x452773[_0x4761('0xf')][_0x4761('0x10')]);return _0x27e826(_0x452773[_0x4761('0xf')][_0x4761('0x10')]);}else{logger[_0x4761('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x2dfb8a,_0x4761('0xd'));_0x27e826(_0x452773[_0x4761('0x12')][_0x4761('0x10')]);}})['catch'](function(_0x2660d4){logger['error'](_0x4761('0x11'),_0x2dfb8a,_0x2660d4);_0x1d0505(_0x2660d4);});});}exports['ShowSquareOdbc']=function(_0x433192){var _0x14797d=this;return new Promise(function(_0x239676,_0x22ec06){return db[_0x4761('0x13')]['find']({'raw':_0x433192[_0x4761('0x14')]?_0x433192[_0x4761('0x14')][_0x4761('0x15')]===undefined?!![]:![]:!![],'where':_0x433192[_0x4761('0x14')]?_0x433192['options'][_0x4761('0x16')]||null:null,'attributes':_0x433192['options']?_0x433192['options'][_0x4761('0x17')]||null:null,'include':_0x433192['options']?_0x433192[_0x4761('0x14')][_0x4761('0x18')]?_[_0x4761('0x19')](_0x433192[_0x4761('0x14')][_0x4761('0x18')],function(_0x52a9ce){return{'model':db[_0x52a9ce['model']],'as':_0x52a9ce['as'],'attributes':_0x52a9ce[_0x4761('0x17')],'include':_0x52a9ce[_0x4761('0x18')]?_[_0x4761('0x19')](_0x52a9ce[_0x4761('0x18')],function(_0x5cc8e6){return{'model':db[_0x5cc8e6[_0x4761('0x1a')]],'as':_0x5cc8e6['as'],'attributes':_0x5cc8e6['attributes'],'include':_0x5cc8e6[_0x4761('0x18')]?_[_0x4761('0x19')](_0x5cc8e6[_0x4761('0x18')],function(_0x57624f){return{'model':db[_0x57624f[_0x4761('0x1a')]],'as':_0x57624f['as'],'attributes':_0x57624f['attributes']};}):[]};}):[]};}):[]:[]})[_0x4761('0xb')](function(_0x1a4d5f){logger[_0x4761('0xc')](_0x4761('0x1b'),_0x433192);logger[_0x4761('0x1c')](_0x4761('0x1b'),_0x433192,JSON[_0x4761('0x1d')](_0x1a4d5f));_0x239676(_0x1a4d5f);})[_0x4761('0x1e')](function(_0xaa8e4c){logger['error'](_0x4761('0x1b'),_0xaa8e4c[_0x4761('0x10')],_0x433192);_0x22ec06(_0x14797d[_0x4761('0xf')](0x1f4,_0xaa8e4c[_0x4761('0x10')]));});});};
\ No newline at end of file
+var _0x0008=['code','SquareOdbc,\x20%s,\x20%s','message','result','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include','model','map','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0008,0x140));var _0x8000=function(_0x1c4b31,_0x33f926){_0x1c4b31=_0x1c4b31-0x0;var _0x429be1=_0x0008[_0x1c4b31];return _0x429be1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8000('0x0'));var BPromise=require(_0x8000('0x1'));var rs=require(_0x8000('0x2'));var fs=require('fs');var Redis=require(_0x8000('0x3'));var db=require(_0x8000('0x4'))['db'];var utils=require(_0x8000('0x5'));var logger=require(_0x8000('0x6'))(_0x8000('0x7'));var config=require(_0x8000('0x8'));var jayson=require(_0x8000('0x9'));var client=jayson[_0x8000('0xa')][_0x8000('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56782b,_0x5e928a,_0x525f41){return new BPromise(function(_0x502926,_0x153a7d){return client[_0x8000('0xc')](_0x56782b,_0x525f41)[_0x8000('0xd')](function(_0x4566e7){logger[_0x8000('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x5e928a,_0x8000('0xf'));logger[_0x8000('0x10')](_0x8000('0x11'),_0x5e928a,'request\x20sent',JSON[_0x8000('0x12')](_0x4566e7));if(_0x4566e7[_0x8000('0x13')]){if(_0x4566e7[_0x8000('0x13')][_0x8000('0x14')]===0x1f4){logger[_0x8000('0x13')](_0x8000('0x15'),_0x5e928a,_0x4566e7[_0x8000('0x13')][_0x8000('0x16')]);return _0x153a7d(_0x4566e7[_0x8000('0x13')]['message']);}logger['error'](_0x8000('0x15'),_0x5e928a,_0x4566e7[_0x8000('0x13')]['message']);return _0x502926(_0x4566e7[_0x8000('0x13')][_0x8000('0x16')]);}else{logger[_0x8000('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x5e928a,_0x8000('0xf'));_0x502926(_0x4566e7[_0x8000('0x17')][_0x8000('0x16')]);}})['catch'](function(_0x399ae9){logger[_0x8000('0x13')](_0x8000('0x15'),_0x5e928a,_0x399ae9);_0x153a7d(_0x399ae9);});});}exports[_0x8000('0x18')]=function(_0x273522){var _0x397a19=this;return new Promise(function(_0x2398f9,_0x56c3f4){return db[_0x8000('0x19')]['find']({'raw':_0x273522[_0x8000('0x1a')]?_0x273522['options'][_0x8000('0x1b')]===undefined?!![]:![]:!![],'where':_0x273522[_0x8000('0x1a')]?_0x273522[_0x8000('0x1a')][_0x8000('0x1c')]||null:null,'attributes':_0x273522[_0x8000('0x1a')]?_0x273522[_0x8000('0x1a')][_0x8000('0x1d')]||null:null,'include':_0x273522['options']?_0x273522[_0x8000('0x1a')]['include']?_['map'](_0x273522['options'][_0x8000('0x1e')],function(_0x539ed1){return{'model':db[_0x539ed1[_0x8000('0x1f')]],'as':_0x539ed1['as'],'attributes':_0x539ed1[_0x8000('0x1d')],'include':_0x539ed1[_0x8000('0x1e')]?_[_0x8000('0x20')](_0x539ed1[_0x8000('0x1e')],function(_0x2c6669){return{'model':db[_0x2c6669['model']],'as':_0x2c6669['as'],'attributes':_0x2c6669[_0x8000('0x1d')],'include':_0x2c6669[_0x8000('0x1e')]?_['map'](_0x2c6669['include'],function(_0xa6d39e){return{'model':db[_0xa6d39e[_0x8000('0x1f')]],'as':_0xa6d39e['as'],'attributes':_0xa6d39e[_0x8000('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cbd37){logger['info'](_0x8000('0x18'),_0x273522);logger[_0x8000('0x10')]('ShowSquareOdbc',_0x273522,JSON[_0x8000('0x12')](_0x3cbd37));_0x2398f9(_0x3cbd37);})[_0x8000('0x21')](function(_0x316c0d){logger[_0x8000('0x13')](_0x8000('0x18'),_0x316c0d[_0x8000('0x16')],_0x273522);_0x56c3f4(_0x397a19['error'](0x1f4,_0x316c0d['message']));});});};
\ No newline at end of file
index 6dea541..2560025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f18=['../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','post','create','addUsers','put','update','delete','/:id','destroy','removeUsers','exports','multer','path','express','Router'];(function(_0x261ed9,_0x52f03a){var _0x570a67=function(_0x1de1b6){while(--_0x1de1b6){_0x261ed9['push'](_0x261ed9['shift']());}};_0x570a67(++_0x52f03a);}(_0x6f18,0x1b4));var _0x86f1=function(_0x1a6c73,_0x2ef9c6){_0x1a6c73=_0x1a6c73-0x0;var _0x9d1c46=_0x6f18[_0x1a6c73];return _0x9d1c46;};'use strict';var multer=require(_0x86f1('0x0'));var util=require('util');var path=require(_0x86f1('0x1'));var timeout=require('connect-timeout');var express=require(_0x86f1('0x2'));var router=express[_0x86f1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x86f1('0x4'));var interaction=require(_0x86f1('0x5'));var config=require('../../config/environment');var controller=require(_0x86f1('0x6'));router[_0x86f1('0x7')]('/',auth[_0x86f1('0x8')](),controller[_0x86f1('0x9')]);router[_0x86f1('0x7')]('/:id',auth[_0x86f1('0x8')](),controller[_0x86f1('0xa')]);router[_0x86f1('0x7')](_0x86f1('0xb'),auth[_0x86f1('0x8')](),controller['getUsers']);router[_0x86f1('0xc')]('/',auth[_0x86f1('0x8')](),controller[_0x86f1('0xd')]);router[_0x86f1('0xc')](_0x86f1('0xb'),auth[_0x86f1('0x8')](),controller[_0x86f1('0xe')]);router[_0x86f1('0xf')]('/:id',auth[_0x86f1('0x8')](),controller[_0x86f1('0x10')]);router[_0x86f1('0x11')](_0x86f1('0x12'),auth[_0x86f1('0x8')](),controller[_0x86f1('0x13')]);router['delete'](_0x86f1('0xb'),auth[_0x86f1('0x8')](),controller[_0x86f1('0x14')]);module[_0x86f1('0x15')]=router;
\ No newline at end of file
+var _0xb98e=['getUsers','post','addUsers','put','/:id','update','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','get','show','/:id/users'];(function(_0x25194c,_0x10f4ae){var _0x255dbf=function(_0x4377ba){while(--_0x4377ba){_0x25194c['push'](_0x25194c['shift']());}};_0x255dbf(++_0x10f4ae);}(_0xb98e,0x184));var _0xeb98=function(_0x2190d8,_0x1b4b7d){_0x2190d8=_0x2190d8-0x0;var _0x502d5f=_0xb98e[_0x2190d8];return _0x502d5f;};'use strict';var multer=require(_0xeb98('0x0'));var util=require(_0xeb98('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeb98('0x2'));var router=express[_0xeb98('0x3')]();var fs_extra=require(_0xeb98('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeb98('0x5'));var config=require(_0xeb98('0x6'));var controller=require(_0xeb98('0x7'));router['get']('/',auth[_0xeb98('0x8')](),controller['index']);router[_0xeb98('0x9')]('/:id',auth[_0xeb98('0x8')](),controller[_0xeb98('0xa')]);router[_0xeb98('0x9')](_0xeb98('0xb'),auth[_0xeb98('0x8')](),controller[_0xeb98('0xc')]);router[_0xeb98('0xd')]('/',auth[_0xeb98('0x8')](),controller['create']);router[_0xeb98('0xd')](_0xeb98('0xb'),auth[_0xeb98('0x8')](),controller[_0xeb98('0xe')]);router[_0xeb98('0xf')](_0xeb98('0x10'),auth[_0xeb98('0x8')](),controller[_0xeb98('0x11')]);router[_0xeb98('0x12')](_0xeb98('0x10'),auth[_0xeb98('0x8')](),controller['destroy']);router[_0xeb98('0x12')](_0xeb98('0xb'),auth['isAuthenticated'](),controller['removeUsers']);module[_0xeb98('0x13')]=router;
\ No newline at end of file
index 6022722..fb6897f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7d8=['utf8','BLOB','production','toString','DATE','sequelize','exports','STRING','long','getDataValue','preproduction'];(function(_0x1e1674,_0xf5f66f){var _0xabe77e=function(_0x459561){while(--_0x459561){_0x1e1674['push'](_0x1e1674['shift']());}};_0xabe77e(++_0xf5f66f);}(_0xb7d8,0x10d));var _0x8b7d=function(_0xf101d,_0x28422a){_0xf101d=_0xf101d-0x0;var _0x2770f7=_0xb7d8[_0xf101d];return _0x2770f7;};'use strict';var Sequelize=require(_0x8b7d('0x0'));module[_0x8b7d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x8b7d('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x8b7d('0x3')),'get':function(){if(this[_0x8b7d('0x4')](_0x8b7d('0x5'))){return this['getDataValue'](_0x8b7d('0x5'))['toString'](_0x8b7d('0x6'));}}},'production':{'type':Sequelize[_0x8b7d('0x7')](_0x8b7d('0x3')),'get':function(){if(this['getDataValue']('production')){return this[_0x8b7d('0x4')](_0x8b7d('0x8'))[_0x8b7d('0x9')](_0x8b7d('0x6'));}}},'savedAt':{'type':Sequelize[_0x8b7d('0xa')]},'publishedAt':{'type':Sequelize[_0x8b7d('0xa')]}};
\ No newline at end of file
+var _0xe6ba=['production','DATE','exports','STRING','TEXT','BLOB','getDataValue','toString','long'];(function(_0x5dce4d,_0xabee39){var _0x3d97b2=function(_0x2d9786){while(--_0x2d9786){_0x5dce4d['push'](_0x5dce4d['shift']());}};_0x3d97b2(++_0xabee39);}(_0xe6ba,0x122));var _0xae6b=function(_0x3752fb,_0x3e058b){_0x3752fb=_0x3752fb-0x0;var _0x2e49e9=_0xe6ba[_0x3752fb];return _0x2e49e9;};'use strict';var Sequelize=require('sequelize');module[_0xae6b('0x0')]={'name':{'type':Sequelize[_0xae6b('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xae6b('0x1')]},'notes':{'type':Sequelize[_0xae6b('0x2')]},'preproduction':{'type':Sequelize[_0xae6b('0x3')]('long'),'get':function(){if(this[_0xae6b('0x4')]('preproduction')){return this[_0xae6b('0x4')]('preproduction')[_0xae6b('0x5')]('utf8');}}},'production':{'type':Sequelize[_0xae6b('0x3')](_0xae6b('0x6')),'get':function(){if(this['getDataValue'](_0xae6b('0x7'))){return this[_0xae6b('0x4')](_0xae6b('0x7'))[_0xae6b('0x5')]('utf8');}}},'savedAt':{'type':Sequelize[_0xae6b('0x8')]},'publishedAt':{'type':Sequelize[_0xae6b('0x8')]}};
\ No newline at end of file
index 89e92a0..29f9ed9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6717=['then','destroy','get','UserProfileResource','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','show','params','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','findOne','getUsers','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x2cfa5b,_0x55cb50){var _0x2ea089=function(_0x590216){while(--_0x590216){_0x2cfa5b['push'](_0x2cfa5b['shift']());}};_0x2ea089(++_0x55cb50);}(_0x6717,0xa1));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7671('0x0'));var rimraf=require(_0x7671('0x1'));var zipdir=require(_0x7671('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7671('0x3'));var moment=require(_0x7671('0x4'));var BPromise=require(_0x7671('0x5'));var Mustache=require(_0x7671('0x6'));var util=require(_0x7671('0x7'));var path=require(_0x7671('0x8'));var sox=require(_0x7671('0x9'));var csv=require(_0x7671('0xa'));var ejs=require(_0x7671('0xb'));var fs=require('fs');var fs_extra=require(_0x7671('0xc'));var _=require('lodash');var squel=require(_0x7671('0xd'));var crypto=require(_0x7671('0xe'));var jsforce=require(_0x7671('0xf'));var deskjs=require(_0x7671('0x10'));var toCsv=require(_0x7671('0xa'));var querystring=require(_0x7671('0x11'));var Papa=require(_0x7671('0x12'));var Redis=require(_0x7671('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7671('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7671('0x15'));var logger=require(_0x7671('0x16'))('api');var utils=require(_0x7671('0x17'));var config=require(_0x7671('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7671('0x19'))['db'];config[_0x7671('0x1a')]=_[_0x7671('0x1b')](config[_0x7671('0x1a')],{'host':_0x7671('0x1c'),'port':0x18eb});var socket=require(_0x7671('0x1d'))(new Redis(config[_0x7671('0x1a')]));require('./squareProject.socket')[_0x7671('0x1e')](socket);function respondWithStatusCode(_0x251f66,_0x3e847d){_0x3e847d=_0x3e847d||0xcc;return function(_0x1ca91){if(_0x1ca91){return _0x251f66[_0x7671('0x1f')](_0x3e847d);}return _0x251f66[_0x7671('0x20')](_0x3e847d)[_0x7671('0x21')]();};}function respondWithResult(_0xbb2d67,_0x38d2e0){_0x38d2e0=_0x38d2e0||0xc8;return function(_0x9e3a32){if(_0x9e3a32){return _0xbb2d67[_0x7671('0x20')](_0x38d2e0)[_0x7671('0x22')](_0x9e3a32);}};}function respondWithFilteredResult(_0x270f2c,_0x1dbfb2){return function(_0x577887){if(_0x577887){var _0x4c584f=typeof _0x1dbfb2[_0x7671('0x23')]===_0x7671('0x24')&&typeof _0x1dbfb2[_0x7671('0x25')]==='undefined';var _0x23f5b4=_0x577887[_0x7671('0x26')];var _0x2eebd3=_0x4c584f?0x0:_0x1dbfb2[_0x7671('0x23')];var _0xd2154a=_0x4c584f?_0x577887[_0x7671('0x26')]:_0x1dbfb2[_0x7671('0x23')]+_0x1dbfb2[_0x7671('0x25')];var _0x2b3325;if(_0xd2154a>=_0x23f5b4){_0xd2154a=_0x23f5b4;_0x2b3325=0xc8;}else{_0x2b3325=0xce;}_0x270f2c[_0x7671('0x20')](_0x2b3325);return _0x270f2c[_0x7671('0x27')](_0x7671('0x28'),_0x2eebd3+'-'+_0xd2154a+'/'+_0x23f5b4)[_0x7671('0x22')](_0x577887);}return null;};}function patchUpdates(_0x521e41){return function(_0x4c0185){try{jsonpatch[_0x7671('0x29')](_0x4c0185,_0x521e41,!![]);}catch(_0x2e2ca8){return BPromise[_0x7671('0x2a')](_0x2e2ca8);}return _0x4c0185[_0x7671('0x2b')]();};}function saveUpdates(_0x4cceae,_0x4f7e4f){return function(_0xfe12ef){if(_0xfe12ef){return _0xfe12ef[_0x7671('0x2c')](_0x4cceae)[_0x7671('0x2d')](function(_0x24796){return _0x24796;});}return null;};}function removeEntity(_0x1e3238,_0x4b3896){return function(_0x3c9a89){if(_0x3c9a89){return _0x3c9a89[_0x7671('0x2e')]()['then'](function(){var _0x1136e0=_0x3c9a89[_0x7671('0x2f')]({'plain':!![]});var _0x25e87c='SquareProjects';return db[_0x7671('0x30')][_0x7671('0x2e')]({'where':{'type':_0x25e87c,'resourceId':_0x1136e0['id']}})[_0x7671('0x2d')](function(){return _0x3c9a89;});})[_0x7671('0x2d')](function(){_0x1e3238['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53890c,_0x27a709){return function(_0xb8a202){if(!_0xb8a202){_0x53890c[_0x7671('0x1f')](0x194);}return _0xb8a202;};}function handleError(_0x30175e,_0x51f36b){_0x51f36b=_0x51f36b||0x1f4;return function(_0x313ff1){logger[_0x7671('0x31')](_0x313ff1[_0x7671('0x32')]);if(_0x313ff1[_0x7671('0x33')]){delete _0x313ff1[_0x7671('0x33')];}_0x30175e['status'](_0x51f36b)[_0x7671('0x34')](_0x313ff1);};}exports[_0x7671('0x35')]=function(_0x234dd7,_0x5232c6){var _0x4866f8={},_0xa0320c={},_0x5e2c9d={'count':0x0,'rows':[]};var _0x4921fc=_[_0x7671('0x36')](db[_0x7671('0x37')][_0x7671('0x38')],function(_0x328e51){return{'name':_0x328e51[_0x7671('0x39')],'type':_0x328e51[_0x7671('0x3a')][_0x7671('0x3b')]};});_0xa0320c['model']=_[_0x7671('0x36')](_0x4921fc,'name');_0xa0320c[_0x7671('0x3c')]=_[_0x7671('0x3d')](_0x234dd7[_0x7671('0x3c')]);_0xa0320c[_0x7671('0x3e')]=_[_0x7671('0x3f')](_0xa0320c['model'],_0xa0320c[_0x7671('0x3c')]);_0x4866f8[_0x7671('0x40')]=_[_0x7671('0x3f')](_0xa0320c[_0x7671('0x41')],qs[_0x7671('0x42')](_0x234dd7['query'][_0x7671('0x42')]));_0x4866f8[_0x7671('0x40')]=_0x4866f8[_0x7671('0x40')][_0x7671('0x43')]?_0x4866f8[_0x7671('0x40')]:_0xa0320c[_0x7671('0x41')];if(!_0x234dd7['query'][_0x7671('0x44')](_0x7671('0x45'))){_0x4866f8[_0x7671('0x25')]=qs[_0x7671('0x25')](_0x234dd7[_0x7671('0x3c')]['limit']);_0x4866f8['offset']=qs['offset'](_0x234dd7[_0x7671('0x3c')][_0x7671('0x23')]);}_0x4866f8[_0x7671('0x46')]=qs[_0x7671('0x47')](_0x234dd7[_0x7671('0x3c')][_0x7671('0x47')]);_0x4866f8[_0x7671('0x48')]=qs[_0x7671('0x3e')](_[_0x7671('0x49')](_0x234dd7['query'],_0xa0320c[_0x7671('0x3e')]),_0x4921fc);if(_0x234dd7[_0x7671('0x3c')]['filter']){_0x4866f8[_0x7671('0x48')]=_[_0x7671('0x4a')](_0x4866f8[_0x7671('0x48')],{'$or':_[_0x7671('0x36')](_0x4921fc,function(_0x1f7859){if(_0x1f7859[_0x7671('0x3a')]!==_0x7671('0x4b')){var _0x50322e={};_0x50322e[_0x1f7859[_0x7671('0x33')]]={'$like':'%'+_0x234dd7[_0x7671('0x3c')][_0x7671('0x4c')]+'%'};return _0x50322e;}})});}_0x4866f8=_[_0x7671('0x4a')]({},_0x4866f8,_0x234dd7[_0x7671('0x4d')]);var _0xfcafe7={'where':_0x4866f8[_0x7671('0x48')]};return db['SquareProject'][_0x7671('0x26')](_0xfcafe7)['then'](function(_0x5b051f){_0x5e2c9d['count']=_0x5b051f;if(_0x234dd7['query']['includeAll']){_0x4866f8['include']=[{'all':!![]}];}return db[_0x7671('0x37')][_0x7671('0x4e')](_0x4866f8);})[_0x7671('0x2d')](function(_0x26732c){_0x5e2c9d[_0x7671('0x4f')]=_0x26732c;return _0x5e2c9d;})[_0x7671('0x2d')](respondWithFilteredResult(_0x5232c6,_0x4866f8))['catch'](handleError(_0x5232c6,null));};exports[_0x7671('0x50')]=function(_0x557ed8,_0x299e96){var _0x415566={'raw':![],'where':{'id':_0x557ed8[_0x7671('0x51')]['id']}},_0x2165cb={};_0x2165cb['model']=_[_0x7671('0x3d')](db[_0x7671('0x37')][_0x7671('0x38')]);_0x2165cb[_0x7671('0x3c')]=_[_0x7671('0x3d')](_0x557ed8[_0x7671('0x3c')]);_0x2165cb[_0x7671('0x3e')]=_[_0x7671('0x3f')](_0x2165cb[_0x7671('0x41')],_0x2165cb[_0x7671('0x3c')]);_0x415566[_0x7671('0x40')]=_[_0x7671('0x3f')](_0x2165cb['model'],qs[_0x7671('0x42')](_0x557ed8[_0x7671('0x3c')][_0x7671('0x42')]));_0x415566[_0x7671('0x40')]=_0x415566[_0x7671('0x40')]['length']?_0x415566['attributes']:_0x2165cb[_0x7671('0x41')];if(_0x557ed8[_0x7671('0x3c')]['includeAll']){_0x415566[_0x7671('0x52')]=[{'all':!![]}];}_0x415566=_[_0x7671('0x4a')]({},_0x415566,_0x557ed8[_0x7671('0x4d')]);return db['SquareProject'][_0x7671('0x53')](_0x415566)[_0x7671('0x2d')](handleEntityNotFound(_0x299e96,null))['then'](respondWithResult(_0x299e96,null))[_0x7671('0x54')](handleError(_0x299e96,null));};exports['create']=function(_0x5a09f5,_0x1a35ba){return db[_0x7671('0x37')][_0x7671('0x55')](_0x5a09f5[_0x7671('0x56')],{})['then'](function(_0x355c41){var _0x3a1a8b=_0x5a09f5['user'][_0x7671('0x2f')]({'plain':!![]});if(!_0x3a1a8b)throw new Error(_0x7671('0x57'));if(_0x3a1a8b[_0x7671('0x58')]===_0x7671('0x59')){var _0x4e50b3=_0x355c41['get']({'plain':!![]});var _0x4be6eb=_0x7671('0x5a');return db[_0x7671('0x5b')][_0x7671('0x53')]({'where':{'name':_0x4be6eb,'userProfileId':_0x3a1a8b[_0x7671('0x5c')]},'raw':!![]})['then'](function(_0x9ed94b){if(_0x9ed94b&&_0x9ed94b[_0x7671('0x5d')]===0x0){return db[_0x7671('0x30')][_0x7671('0x55')]({'name':_0x4e50b3[_0x7671('0x33')],'resourceId':_0x4e50b3['id'],'type':_0x9ed94b[_0x7671('0x33')],'sectionId':_0x9ed94b['id']},{})[_0x7671('0x2d')](function(){return _0x355c41;});}else{return _0x355c41;}})['catch'](function(_0x29c886){logger[_0x7671('0x31')](_0x7671('0x5e'),_0x29c886);throw _0x29c886;});}return _0x355c41;})[_0x7671('0x2d')](respondWithResult(_0x1a35ba,0xc9))[_0x7671('0x54')](handleError(_0x1a35ba,null));};exports['update']=function(_0x22710d,_0x5aa9a0){if(_0x22710d[_0x7671('0x56')]['id']){delete _0x22710d[_0x7671('0x56')]['id'];}return db[_0x7671('0x37')]['find']({'where':{'id':_0x22710d[_0x7671('0x51')]['id']}})[_0x7671('0x2d')](handleEntityNotFound(_0x5aa9a0,null))['then'](saveUpdates(_0x22710d[_0x7671('0x56')],null))[_0x7671('0x2d')](respondWithResult(_0x5aa9a0,null))[_0x7671('0x54')](handleError(_0x5aa9a0,null));};exports[_0x7671('0x2e')]=function(_0x51aa55,_0x2d4263){return db[_0x7671('0x37')][_0x7671('0x53')]({'where':{'id':_0x51aa55['params']['id']}})[_0x7671('0x2d')](handleEntityNotFound(_0x2d4263,null))['then'](removeEntity(_0x2d4263,null))[_0x7671('0x54')](handleError(_0x2d4263,null));};exports['addUsers']=function(_0x2cff31,_0x18fa46,_0x24a71d){return db[_0x7671('0x37')][_0x7671('0x53')]({'where':{'id':_0x2cff31[_0x7671('0x51')]['id']}})['then'](handleEntityNotFound(_0x18fa46,null))['then'](function(_0x4209f5){if(_0x4209f5){return _0x4209f5[_0x7671('0x5f')](_0x2cff31[_0x7671('0x56')][_0x7671('0x60')],_[_0x7671('0x61')](_0x2cff31['body'],[_0x7671('0x60'),'id'])||{});}})[_0x7671('0x2d')](respondWithResult(_0x18fa46,null))[_0x7671('0x54')](handleError(_0x18fa46,null));};exports[_0x7671('0x62')]=function(_0x2a9ca8,_0x3b5fd9,_0x43aa40){return db[_0x7671('0x37')]['find']({'where':{'id':_0x2a9ca8[_0x7671('0x51')]['id']}})[_0x7671('0x2d')](handleEntityNotFound(_0x3b5fd9,null))[_0x7671('0x2d')](function(_0x1b254d){if(_0x1b254d){return _0x1b254d['removeUsers'](_0x2a9ca8[_0x7671('0x3c')]['ids'])[_0x7671('0x2d')](function(){if(_['isArray'](_0x2a9ca8['query'][_0x7671('0x60')])){for(var _0x2af263=0x0;_0x2af263<_0x2a9ca8[_0x7671('0x3c')][_0x7671('0x60')][_0x7671('0x43')];_0x2af263+=0x1){socket[_0x7671('0x63')](_0x7671('0x64'),{'UserId':Number(_0x2a9ca8[_0x7671('0x3c')]['ids'][_0x2af263]),'SquareProjectId':Number(_0x2a9ca8[_0x7671('0x51')]['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x2a9ca8[_0x7671('0x3c')][_0x7671('0x60')]),'SquareProjectId':Number(_0x2a9ca8[_0x7671('0x51')]['id'])});}});}})[_0x7671('0x2d')](respondWithStatusCode(_0x3b5fd9,null))[_0x7671('0x54')](handleError(_0x3b5fd9,null));};exports['getUsers']=function(_0x205077,_0x29ed17,_0x258dab){var _0x1d8890={};var _0x5b2a69={};var _0x3d46b8;var _0x15f850;return db[_0x7671('0x37')][_0x7671('0x65')]({'where':{'id':_0x205077[_0x7671('0x51')]['id']}})[_0x7671('0x2d')](handleEntityNotFound(_0x29ed17,null))[_0x7671('0x2d')](function(_0x34bf2d){if(_0x34bf2d){_0x3d46b8=_0x34bf2d;_0x5b2a69[_0x7671('0x41')]=_[_0x7671('0x3d')](db['User'][_0x7671('0x38')]);_0x5b2a69[_0x7671('0x3c')]=_[_0x7671('0x3d')](_0x205077['query']);_0x5b2a69[_0x7671('0x3e')]=_[_0x7671('0x3f')](_0x5b2a69['model'],_0x5b2a69[_0x7671('0x3c')]);_0x1d8890[_0x7671('0x40')]=_[_0x7671('0x3f')](_0x5b2a69[_0x7671('0x41')],qs['fields'](_0x205077[_0x7671('0x3c')]['fields']));_0x1d8890[_0x7671('0x40')]=_0x1d8890[_0x7671('0x40')][_0x7671('0x43')]?_0x1d8890[_0x7671('0x40')]:_0x5b2a69['model'];_0x1d8890[_0x7671('0x46')]=qs[_0x7671('0x47')](_0x205077[_0x7671('0x3c')][_0x7671('0x47')]);_0x1d8890[_0x7671('0x48')]=qs[_0x7671('0x3e')](_[_0x7671('0x49')](_0x205077[_0x7671('0x3c')],_0x5b2a69['filters']));if(_0x205077[_0x7671('0x3c')][_0x7671('0x4c')]){_0x1d8890['where']=_[_0x7671('0x4a')](_0x1d8890[_0x7671('0x48')],{'$or':_['map'](_0x1d8890[_0x7671('0x40')],function(_0x23abf8){var _0x455c9c={};_0x455c9c[_0x23abf8]={'$like':'%'+_0x205077['query'][_0x7671('0x4c')]+'%'};return _0x455c9c;})});}_0x1d8890=_['merge']({},_0x1d8890,_0x205077['options']);return _0x3d46b8[_0x7671('0x66')](_0x1d8890);}})[_0x7671('0x2d')](function(_0x32e08c){if(_0x32e08c){_0x15f850=_0x32e08c[_0x7671('0x43')];if(!_0x205077[_0x7671('0x3c')][_0x7671('0x44')](_0x7671('0x45'))){_0x1d8890[_0x7671('0x25')]=qs['limit'](_0x205077[_0x7671('0x3c')]['limit']);_0x1d8890[_0x7671('0x23')]=qs[_0x7671('0x23')](_0x205077[_0x7671('0x3c')][_0x7671('0x23')]);}return _0x3d46b8[_0x7671('0x66')](_0x1d8890);}})[_0x7671('0x2d')](function(_0x4d19d3){if(_0x4d19d3){return _0x4d19d3?{'count':_0x15f850,'rows':_0x4d19d3}:null;}})[_0x7671('0x2d')](respondWithResult(_0x29ed17,null))['catch'](handleError(_0x29ed17,null));};
\ No newline at end of file
+var _0x852b=['zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','SquareProjects','UserProfileResource','name','send','map','SquareProject','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','hasOwnProperty','rimraf'];(function(_0x5cc99c,_0x5e2544){var _0x57f4fa=function(_0x1f9a95){while(--_0x1f9a95){_0x5cc99c['push'](_0x5cc99c['shift']());}};_0x57f4fa(++_0x5e2544);}(_0x852b,0xb9));var _0xb852=function(_0x1a3f6e,_0x5b19f1){_0x1a3f6e=_0x1a3f6e-0x0;var _0x1149b5=_0x852b[_0x1a3f6e];return _0x1149b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb852('0x0'));var zipdir=require(_0xb852('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb852('0x2'));var moment=require(_0xb852('0x3'));var BPromise=require(_0xb852('0x4'));var Mustache=require(_0xb852('0x5'));var util=require('util');var path=require(_0xb852('0x6'));var sox=require(_0xb852('0x7'));var csv=require(_0xb852('0x8'));var ejs=require(_0xb852('0x9'));var fs=require('fs');var fs_extra=require(_0xb852('0xa'));var _=require('lodash');var squel=require(_0xb852('0xb'));var crypto=require(_0xb852('0xc'));var jsforce=require(_0xb852('0xd'));var deskjs=require(_0xb852('0xe'));var toCsv=require(_0xb852('0x8'));var querystring=require(_0xb852('0xf'));var Papa=require(_0xb852('0x10'));var Redis=require('ioredis');var authService=require(_0xb852('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb852('0x12'));var hardwareService=require(_0xb852('0x13'));var logger=require('../../config/logger')(_0xb852('0x14'));var utils=require(_0xb852('0x15'));var config=require(_0xb852('0x16'));var licenseUtil=require(_0xb852('0x17'));var db=require(_0xb852('0x18'))['db'];config[_0xb852('0x19')]=_['defaults'](config[_0xb852('0x19')],{'host':_0xb852('0x1a'),'port':0x18eb});var socket=require(_0xb852('0x1b'))(new Redis(config[_0xb852('0x19')]));require('./squareProject.socket')[_0xb852('0x1c')](socket);function respondWithStatusCode(_0x16e800,_0x2323ba){_0x2323ba=_0x2323ba||0xcc;return function(_0x35e815){if(_0x35e815){return _0x16e800[_0xb852('0x1d')](_0x2323ba);}return _0x16e800[_0xb852('0x1e')](_0x2323ba)[_0xb852('0x1f')]();};}function respondWithResult(_0x5d2db0,_0x3f9f6c){_0x3f9f6c=_0x3f9f6c||0xc8;return function(_0x58713c){if(_0x58713c){return _0x5d2db0[_0xb852('0x1e')](_0x3f9f6c)['json'](_0x58713c);}};}function respondWithFilteredResult(_0x1517a5,_0x3bd5d3){return function(_0x47509a){if(_0x47509a){var _0xf9fac6=typeof _0x3bd5d3[_0xb852('0x20')]===_0xb852('0x21')&&typeof _0x3bd5d3[_0xb852('0x22')]===_0xb852('0x21');var _0x2d05fb=_0x47509a[_0xb852('0x23')];var _0x4385d1=_0xf9fac6?0x0:_0x3bd5d3[_0xb852('0x20')];var _0x3d0b56=_0xf9fac6?_0x47509a[_0xb852('0x23')]:_0x3bd5d3[_0xb852('0x20')]+_0x3bd5d3[_0xb852('0x22')];var _0x1490ef;if(_0x3d0b56>=_0x2d05fb){_0x3d0b56=_0x2d05fb;_0x1490ef=0xc8;}else{_0x1490ef=0xce;}_0x1517a5[_0xb852('0x1e')](_0x1490ef);return _0x1517a5[_0xb852('0x24')](_0xb852('0x25'),_0x4385d1+'-'+_0x3d0b56+'/'+_0x2d05fb)['json'](_0x47509a);}return null;};}function patchUpdates(_0x2f715c){return function(_0x55c4ef){try{jsonpatch[_0xb852('0x26')](_0x55c4ef,_0x2f715c,!![]);}catch(_0x2654ea){return BPromise[_0xb852('0x27')](_0x2654ea);}return _0x55c4ef[_0xb852('0x28')]();};}function saveUpdates(_0x1d4638,_0x2992d2){return function(_0xc50c8b){if(_0xc50c8b){return _0xc50c8b[_0xb852('0x29')](_0x1d4638)['then'](function(_0xf88ba6){return _0xf88ba6;});}return null;};}function removeEntity(_0x5025b4,_0x53b7bf){return function(_0x3cbf42){if(_0x3cbf42){return _0x3cbf42[_0xb852('0x2a')]()[_0xb852('0x2b')](function(){var _0x5a8938=_0x3cbf42['get']({'plain':!![]});var _0x1ffb26=_0xb852('0x2c');return db[_0xb852('0x2d')][_0xb852('0x2a')]({'where':{'type':_0x1ffb26,'resourceId':_0x5a8938['id']}})[_0xb852('0x2b')](function(){return _0x3cbf42;});})[_0xb852('0x2b')](function(){_0x5025b4[_0xb852('0x1e')](0xcc)[_0xb852('0x1f')]();});}};}function handleEntityNotFound(_0x2c0c88,_0xadecd6){return function(_0x41e3cd){if(!_0x41e3cd){_0x2c0c88[_0xb852('0x1d')](0x194);}return _0x41e3cd;};}function handleError(_0x3ef0bd,_0x52b624){_0x52b624=_0x52b624||0x1f4;return function(_0x4adc35){logger['error'](_0x4adc35['stack']);if(_0x4adc35[_0xb852('0x2e')]){delete _0x4adc35[_0xb852('0x2e')];}_0x3ef0bd[_0xb852('0x1e')](_0x52b624)[_0xb852('0x2f')](_0x4adc35);};}exports['index']=function(_0x5598bc,_0xc3b968){var _0x3c64b5={},_0x1b9983={},_0x3a21ce={'count':0x0,'rows':[]};var _0x4de62b=_[_0xb852('0x30')](db[_0xb852('0x31')][_0xb852('0x32')],function(_0x384eba){return{'name':_0x384eba[_0xb852('0x33')],'type':_0x384eba['type']['key']};});_0x1b9983['model']=_[_0xb852('0x30')](_0x4de62b,_0xb852('0x2e'));_0x1b9983[_0xb852('0x34')]=_[_0xb852('0x35')](_0x5598bc['query']);_0x1b9983['filters']=_[_0xb852('0x36')](_0x1b9983[_0xb852('0x37')],_0x1b9983[_0xb852('0x34')]);_0x3c64b5[_0xb852('0x38')]=_[_0xb852('0x36')](_0x1b9983['model'],qs[_0xb852('0x39')](_0x5598bc['query'][_0xb852('0x39')]));_0x3c64b5[_0xb852('0x38')]=_0x3c64b5['attributes'][_0xb852('0x3a')]?_0x3c64b5[_0xb852('0x38')]:_0x1b9983['model'];if(!_0x5598bc[_0xb852('0x34')]['hasOwnProperty'](_0xb852('0x3b'))){_0x3c64b5['limit']=qs['limit'](_0x5598bc['query']['limit']);_0x3c64b5[_0xb852('0x20')]=qs[_0xb852('0x20')](_0x5598bc[_0xb852('0x34')][_0xb852('0x20')]);}_0x3c64b5[_0xb852('0x3c')]=qs[_0xb852('0x3d')](_0x5598bc[_0xb852('0x34')][_0xb852('0x3d')]);_0x3c64b5[_0xb852('0x3e')]=qs[_0xb852('0x3f')](_[_0xb852('0x40')](_0x5598bc['query'],_0x1b9983[_0xb852('0x3f')]),_0x4de62b);if(_0x5598bc['query']['filter']){_0x3c64b5[_0xb852('0x3e')]=_[_0xb852('0x41')](_0x3c64b5[_0xb852('0x3e')],{'$or':_[_0xb852('0x30')](_0x4de62b,function(_0xa1904d){if(_0xa1904d[_0xb852('0x42')]!==_0xb852('0x43')){var _0x74ccef={};_0x74ccef[_0xa1904d['name']]={'$like':'%'+_0x5598bc[_0xb852('0x34')][_0xb852('0x44')]+'%'};return _0x74ccef;}})});}_0x3c64b5=_['merge']({},_0x3c64b5,_0x5598bc[_0xb852('0x45')]);var _0x543e0f={'where':_0x3c64b5[_0xb852('0x3e')]};return db['SquareProject'][_0xb852('0x23')](_0x543e0f)[_0xb852('0x2b')](function(_0x90fe0){_0x3a21ce['count']=_0x90fe0;if(_0x5598bc['query']['includeAll']){_0x3c64b5[_0xb852('0x46')]=[{'all':!![]}];}return db[_0xb852('0x31')][_0xb852('0x47')](_0x3c64b5);})[_0xb852('0x2b')](function(_0xbbf066){_0x3a21ce['rows']=_0xbbf066;return _0x3a21ce;})[_0xb852('0x2b')](respondWithFilteredResult(_0xc3b968,_0x3c64b5))[_0xb852('0x48')](handleError(_0xc3b968,null));};exports[_0xb852('0x49')]=function(_0x10ac31,_0x4f23db){var _0xbbf4bd={'raw':![],'where':{'id':_0x10ac31[_0xb852('0x4a')]['id']}},_0x2ee5bc={};_0x2ee5bc[_0xb852('0x37')]=_[_0xb852('0x35')](db[_0xb852('0x31')]['rawAttributes']);_0x2ee5bc[_0xb852('0x34')]=_[_0xb852('0x35')](_0x10ac31['query']);_0x2ee5bc[_0xb852('0x3f')]=_[_0xb852('0x36')](_0x2ee5bc[_0xb852('0x37')],_0x2ee5bc[_0xb852('0x34')]);_0xbbf4bd[_0xb852('0x38')]=_[_0xb852('0x36')](_0x2ee5bc[_0xb852('0x37')],qs[_0xb852('0x39')](_0x10ac31[_0xb852('0x34')]['fields']));_0xbbf4bd[_0xb852('0x38')]=_0xbbf4bd['attributes'][_0xb852('0x3a')]?_0xbbf4bd[_0xb852('0x38')]:_0x2ee5bc[_0xb852('0x37')];if(_0x10ac31[_0xb852('0x34')]['includeAll']){_0xbbf4bd['include']=[{'all':!![]}];}_0xbbf4bd=_[_0xb852('0x41')]({},_0xbbf4bd,_0x10ac31[_0xb852('0x45')]);return db[_0xb852('0x31')][_0xb852('0x4b')](_0xbbf4bd)[_0xb852('0x2b')](handleEntityNotFound(_0x4f23db,null))[_0xb852('0x2b')](respondWithResult(_0x4f23db,null))['catch'](handleError(_0x4f23db,null));};exports[_0xb852('0x4c')]=function(_0x4ab912,_0x400dda){return db[_0xb852('0x31')][_0xb852('0x4c')](_0x4ab912[_0xb852('0x4d')],{})[_0xb852('0x2b')](function(_0x1d6f32){var _0x478280=_0x4ab912['user'][_0xb852('0x4e')]({'plain':!![]});if(!_0x478280)throw new Error(_0xb852('0x4f'));if(_0x478280['role']==='user'){var _0x42613d=_0x1d6f32[_0xb852('0x4e')]({'plain':!![]});var _0x2185fc=_0xb852('0x2c');return db[_0xb852('0x50')][_0xb852('0x4b')]({'where':{'name':_0x2185fc,'userProfileId':_0x478280[_0xb852('0x51')]},'raw':!![]})[_0xb852('0x2b')](function(_0x57ef12){if(_0x57ef12&&_0x57ef12[_0xb852('0x52')]===0x0){return db[_0xb852('0x2d')][_0xb852('0x4c')]({'name':_0x42613d[_0xb852('0x2e')],'resourceId':_0x42613d['id'],'type':_0x57ef12[_0xb852('0x2e')],'sectionId':_0x57ef12['id']},{})[_0xb852('0x2b')](function(){return _0x1d6f32;});}else{return _0x1d6f32;}})[_0xb852('0x48')](function(_0x23844c){logger['error'](_0xb852('0x53'),_0x23844c);throw _0x23844c;});}return _0x1d6f32;})['then'](respondWithResult(_0x400dda,0xc9))['catch'](handleError(_0x400dda,null));};exports['update']=function(_0x122272,_0x39475b){if(_0x122272[_0xb852('0x4d')]['id']){delete _0x122272[_0xb852('0x4d')]['id'];}return db['SquareProject'][_0xb852('0x4b')]({'where':{'id':_0x122272[_0xb852('0x4a')]['id']}})[_0xb852('0x2b')](handleEntityNotFound(_0x39475b,null))[_0xb852('0x2b')](saveUpdates(_0x122272[_0xb852('0x4d')],null))[_0xb852('0x2b')](respondWithResult(_0x39475b,null))[_0xb852('0x48')](handleError(_0x39475b,null));};exports['destroy']=function(_0x45f90f,_0x4cc72d){return db[_0xb852('0x31')]['find']({'where':{'id':_0x45f90f['params']['id']}})[_0xb852('0x2b')](handleEntityNotFound(_0x4cc72d,null))['then'](removeEntity(_0x4cc72d,null))[_0xb852('0x48')](handleError(_0x4cc72d,null));};exports[_0xb852('0x54')]=function(_0x1c56b8,_0x32ce7c,_0x461ba5){return db[_0xb852('0x31')]['find']({'where':{'id':_0x1c56b8[_0xb852('0x4a')]['id']}})[_0xb852('0x2b')](handleEntityNotFound(_0x32ce7c,null))[_0xb852('0x2b')](function(_0x1ee240){if(_0x1ee240){return _0x1ee240['addUsers'](_0x1c56b8['body'][_0xb852('0x55')],_['omit'](_0x1c56b8['body'],['ids','id'])||{});}})[_0xb852('0x2b')](respondWithResult(_0x32ce7c,null))[_0xb852('0x48')](handleError(_0x32ce7c,null));};exports[_0xb852('0x56')]=function(_0x3a793d,_0x481197,_0x3c66c6){return db[_0xb852('0x31')][_0xb852('0x4b')]({'where':{'id':_0x3a793d[_0xb852('0x4a')]['id']}})[_0xb852('0x2b')](handleEntityNotFound(_0x481197,null))[_0xb852('0x2b')](function(_0x4f9c37){if(_0x4f9c37){return _0x4f9c37[_0xb852('0x56')](_0x3a793d[_0xb852('0x34')][_0xb852('0x55')])['then'](function(){if(_['isArray'](_0x3a793d[_0xb852('0x34')][_0xb852('0x55')])){for(var _0x4c09c2=0x0;_0x4c09c2<_0x3a793d[_0xb852('0x34')][_0xb852('0x55')][_0xb852('0x3a')];_0x4c09c2+=0x1){socket[_0xb852('0x57')](_0xb852('0x58'),{'UserId':Number(_0x3a793d['query'][_0xb852('0x55')][_0x4c09c2]),'SquareProjectId':Number(_0x3a793d[_0xb852('0x4a')]['id'])});}}else{socket[_0xb852('0x57')](_0xb852('0x58'),{'UserId':Number(_0x3a793d['query'][_0xb852('0x55')]),'SquareProjectId':Number(_0x3a793d[_0xb852('0x4a')]['id'])});}});}})[_0xb852('0x2b')](respondWithStatusCode(_0x481197,null))[_0xb852('0x48')](handleError(_0x481197,null));};exports[_0xb852('0x59')]=function(_0x1b357a,_0x235f85,_0x23d61e){var _0x227616={};var _0xff0bd={};var _0x5d541c;var _0x4e0e84;return db[_0xb852('0x31')][_0xb852('0x5a')]({'where':{'id':_0x1b357a['params']['id']}})['then'](handleEntityNotFound(_0x235f85,null))['then'](function(_0x712a5d){if(_0x712a5d){_0x5d541c=_0x712a5d;_0xff0bd[_0xb852('0x37')]=_[_0xb852('0x35')](db[_0xb852('0x5b')][_0xb852('0x32')]);_0xff0bd['query']=_['keys'](_0x1b357a[_0xb852('0x34')]);_0xff0bd[_0xb852('0x3f')]=_[_0xb852('0x36')](_0xff0bd[_0xb852('0x37')],_0xff0bd[_0xb852('0x34')]);_0x227616[_0xb852('0x38')]=_[_0xb852('0x36')](_0xff0bd[_0xb852('0x37')],qs[_0xb852('0x39')](_0x1b357a[_0xb852('0x34')][_0xb852('0x39')]));_0x227616[_0xb852('0x38')]=_0x227616[_0xb852('0x38')][_0xb852('0x3a')]?_0x227616[_0xb852('0x38')]:_0xff0bd[_0xb852('0x37')];_0x227616[_0xb852('0x3c')]=qs[_0xb852('0x3d')](_0x1b357a[_0xb852('0x34')]['sort']);_0x227616['where']=qs[_0xb852('0x3f')](_[_0xb852('0x40')](_0x1b357a[_0xb852('0x34')],_0xff0bd[_0xb852('0x3f')]));if(_0x1b357a['query']['filter']){_0x227616[_0xb852('0x3e')]=_[_0xb852('0x41')](_0x227616[_0xb852('0x3e')],{'$or':_['map'](_0x227616[_0xb852('0x38')],function(_0x174ac0){var _0x308b30={};_0x308b30[_0x174ac0]={'$like':'%'+_0x1b357a[_0xb852('0x34')]['filter']+'%'};return _0x308b30;})});}_0x227616=_[_0xb852('0x41')]({},_0x227616,_0x1b357a[_0xb852('0x45')]);return _0x5d541c['getUsers'](_0x227616);}})[_0xb852('0x2b')](function(_0x40811e){if(_0x40811e){_0x4e0e84=_0x40811e[_0xb852('0x3a')];if(!_0x1b357a['query'][_0xb852('0x5c')](_0xb852('0x3b'))){_0x227616[_0xb852('0x22')]=qs[_0xb852('0x22')](_0x1b357a[_0xb852('0x34')]['limit']);_0x227616[_0xb852('0x20')]=qs[_0xb852('0x20')](_0x1b357a['query']['offset']);}return _0x5d541c[_0xb852('0x59')](_0x227616);}})[_0xb852('0x2b')](function(_0xf83da2){if(_0xf83da2){return _0xf83da2?{'count':_0x4e0e84,'rows':_0xf83da2}:null;}})[_0xb852('0x2b')](respondWithResult(_0x235f85,null))[_0xb852('0x48')](handleError(_0x235f85,null));};
\ No newline at end of file
index da114e6..852a170 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x873a=['../../mysqldb','SquareProject','setMaxListeners','save','update','remove','hasOwnProperty','exports','events'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x873a,0xe0));var _0xa873=function(_0x549fb5,_0x92e928){_0x549fb5=_0x549fb5-0x0;var _0xc1f541=_0x873a[_0x549fb5];return _0xc1f541;};'use strict';var EventEmitter=require(_0xa873('0x0'));var SquareProject=require(_0xa873('0x1'))['db'][_0xa873('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xa873('0x3')](0x0);var events={'afterCreate':_0xa873('0x4'),'afterUpdate':_0xa873('0x5'),'afterDestroy':_0xa873('0x6')};function emitEvent(_0x552e91){return function(_0x171ee5,_0x24477b,_0x29b1c9){SquareProjectEvents['emit'](_0x552e91+':'+_0x171ee5['id'],_0x171ee5);SquareProjectEvents['emit'](_0x552e91,_0x171ee5);_0x29b1c9(null);};}for(var e in events){if(events[_0xa873('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xa873('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0x25e7=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject'];(function(_0x52e3bf,_0x1a7cf7){var _0x5cab67=function(_0x28c644){while(--_0x28c644){_0x52e3bf['push'](_0x52e3bf['shift']());}};_0x5cab67(++_0x1a7cf7);}(_0x25e7,0x133));var _0x725e=function(_0x185133,_0x29a472){_0x185133=_0x185133-0x0;var _0x862f7f=_0x25e7[_0x185133];return _0x862f7f;};'use strict';var EventEmitter=require(_0x725e('0x0'));var SquareProject=require(_0x725e('0x1'))['db'][_0x725e('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x725e('0x3')](0x0);var events={'afterCreate':_0x725e('0x4'),'afterUpdate':_0x725e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x262793){return function(_0x35631c,_0x49c501,_0x52ade7){SquareProjectEvents[_0x725e('0x6')](_0x262793+':'+_0x35631c['id'],_0x35631c);SquareProjectEvents[_0x725e('0x6')](_0x262793,_0x35631c);_0x52ade7(null);};}for(var e in events){if(events[_0x725e('0x7')](e)){var event=events[e];SquareProject[_0x725e('0x8')](e,emitEvent(event));}}module[_0x725e('0x9')]=SquareProjectEvents;
\ No newline at end of file
index 965e9a1..7a147f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dbb=['path','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject','changed','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','api','bluebird','request-promise'];(function(_0x24fc3d,_0x1b10d0){var _0x144024=function(_0x20e738){while(--_0x20e738){_0x24fc3d['push'](_0x24fc3d['shift']());}};_0x144024(++_0x1b10d0);}(_0x5dbb,0x191));var _0xb5db=function(_0x533b40,_0x204696){_0x533b40=_0x533b40-0x0;var _0x2b0292=_0x5dbb[_0x533b40];return _0x2b0292;};'use strict';var _=require('lodash');var util=require(_0xb5db('0x0'));var logger=require('../../config/logger')(_0xb5db('0x1'));var moment=require('moment');var BPromise=require(_0xb5db('0x2'));var rp=require(_0xb5db('0x3'));var fs=require('fs');var path=require(_0xb5db('0x4'));var rimraf=require(_0xb5db('0x5'));var config=require(_0xb5db('0x6'));var attributes=require(_0xb5db('0x7'));module[_0xb5db('0x8')]=function(_0x249fc6,_0x85d2e4){return _0x249fc6['define'](_0xb5db('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5da9e3,_0x55e657,_0x2c1e3e){if(_0x5da9e3[_0xb5db('0xa')]('preproduction')){_0x5da9e3['savedAt']=moment()[_0xb5db('0xb')](_0xb5db('0xc'));}if(_0x5da9e3[_0xb5db('0xa')](_0xb5db('0xd'))){_0x5da9e3[_0xb5db('0xe')]=moment()[_0xb5db('0xb')](_0xb5db('0xc'));}_0x2c1e3e(null,_0x5da9e3);}}});};
\ No newline at end of file
+var _0xc329=['request-promise','path','rimraf','./squareProject.attributes','define','square_projects','changed','preproduction','savedAt','format','production','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x472ee2,_0x295444){var _0x18387b=function(_0x320611){while(--_0x320611){_0x472ee2['push'](_0x472ee2['shift']());}};_0x18387b(++_0x295444);}(_0xc329,0x1d7));var _0x9c32=function(_0x191c44,_0x20a896){_0x191c44=_0x191c44-0x0;var _0x1086cd=_0xc329[_0x191c44];return _0x1086cd;};'use strict';var _=require(_0x9c32('0x0'));var util=require(_0x9c32('0x1'));var logger=require(_0x9c32('0x2'))(_0x9c32('0x3'));var moment=require(_0x9c32('0x4'));var BPromise=require('bluebird');var rp=require(_0x9c32('0x5'));var fs=require('fs');var path=require(_0x9c32('0x6'));var rimraf=require(_0x9c32('0x7'));var config=require('../../config/environment');var attributes=require(_0x9c32('0x8'));module['exports']=function(_0x40b6ea,_0x39e290){return _0x40b6ea[_0x9c32('0x9')]('SquareProject',attributes,{'tableName':_0x9c32('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4631e0,_0x198a40,_0x3a4f09){if(_0x4631e0[_0x9c32('0xb')](_0x9c32('0xc'))){_0x4631e0[_0x9c32('0xd')]=moment()[_0x9c32('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4631e0[_0x9c32('0xb')](_0x9c32('0xf'))){_0x4631e0['publishedAt']=moment()[_0x9c32('0xe')](_0x9c32('0x10'));}_0x3a4f09(null,_0x4631e0);}}});};
\ No newline at end of file
index d5854d5..af6e9de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f48=['../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSquareProject','options','raw','where','attributes','include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xc5facc,_0x3ad6e6){var _0x462d49=function(_0x1fadb4){while(--_0x1fadb4){_0xc5facc['push'](_0xc5facc['shift']());}};_0x462d49(++_0x3ad6e6);}(_0x7f48,0x13d));var _0x87f4=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x7f48[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x87f4('0x0'));var util=require('util');var moment=require(_0x87f4('0x1'));var BPromise=require(_0x87f4('0x2'));var rs=require(_0x87f4('0x3'));var fs=require('fs');var Redis=require(_0x87f4('0x4'));var db=require(_0x87f4('0x5'))['db'];var utils=require(_0x87f4('0x6'));var logger=require(_0x87f4('0x7'))('rpc');var config=require(_0x87f4('0x8'));var jayson=require(_0x87f4('0x9'));var client=jayson[_0x87f4('0xa')]['http']({'port':0x232a});config[_0x87f4('0xb')]=_[_0x87f4('0xc')](config[_0x87f4('0xb')],{'host':_0x87f4('0xd'),'port':0x18eb});var socket=require(_0x87f4('0xe'))(new Redis(config[_0x87f4('0xb')]));require(_0x87f4('0xf'))[_0x87f4('0x10')](socket);function respondWithRpcPromise(_0x41aeab,_0x592aa4,_0x180f63){return new BPromise(function(_0x72733b,_0x17e526){return client[_0x87f4('0x11')](_0x41aeab,_0x180f63)['then'](function(_0x51f629){logger[_0x87f4('0x12')](_0x87f4('0x13'),_0x592aa4,_0x87f4('0x14'));logger[_0x87f4('0x15')](_0x87f4('0x16'),_0x592aa4,_0x87f4('0x14'),JSON[_0x87f4('0x17')](_0x51f629));if(_0x51f629[_0x87f4('0x18')]){if(_0x51f629['error']['code']===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x592aa4,_0x51f629['error']['message']);return _0x17e526(_0x51f629['error']['message']);}logger[_0x87f4('0x18')](_0x87f4('0x13'),_0x592aa4,_0x51f629[_0x87f4('0x18')][_0x87f4('0x19')]);return _0x72733b(_0x51f629[_0x87f4('0x18')][_0x87f4('0x19')]);}else{logger[_0x87f4('0x12')]('SquareProject,\x20%s,\x20%s',_0x592aa4,'request\x20sent');_0x72733b(_0x51f629[_0x87f4('0x1a')][_0x87f4('0x19')]);}})['catch'](function(_0x501e4f){logger[_0x87f4('0x18')](_0x87f4('0x13'),_0x592aa4,_0x501e4f);_0x17e526(_0x501e4f);});});}exports[_0x87f4('0x1b')]=function(_0xbc5d9e){var _0x12695e=this;return new Promise(function(_0x578e2c,_0x31eb02){return db['SquareProject']['find']({'raw':_0xbc5d9e[_0x87f4('0x1c')]?_0xbc5d9e[_0x87f4('0x1c')][_0x87f4('0x1d')]===undefined?!![]:![]:!![],'where':_0xbc5d9e[_0x87f4('0x1c')]?_0xbc5d9e['options'][_0x87f4('0x1e')]||null:null,'attributes':_0xbc5d9e[_0x87f4('0x1c')]?_0xbc5d9e[_0x87f4('0x1c')][_0x87f4('0x1f')]||null:null,'include':_0xbc5d9e[_0x87f4('0x1c')]?_0xbc5d9e[_0x87f4('0x1c')][_0x87f4('0x20')]?_[_0x87f4('0x21')](_0xbc5d9e[_0x87f4('0x1c')][_0x87f4('0x20')],function(_0x279792){return{'model':db[_0x279792['model']],'as':_0x279792['as'],'attributes':_0x279792[_0x87f4('0x1f')],'include':_0x279792[_0x87f4('0x20')]?_[_0x87f4('0x21')](_0x279792[_0x87f4('0x20')],function(_0xcac3fc){return{'model':db[_0xcac3fc[_0x87f4('0x22')]],'as':_0xcac3fc['as'],'attributes':_0xcac3fc['attributes'],'include':_0xcac3fc['include']?_[_0x87f4('0x21')](_0xcac3fc[_0x87f4('0x20')],function(_0x3c0d73){return{'model':db[_0x3c0d73[_0x87f4('0x22')]],'as':_0x3c0d73['as'],'attributes':_0x3c0d73['attributes']};}):[]};}):[]};}):[]:[]})[_0x87f4('0x23')](function(_0x1dfbe8){logger[_0x87f4('0x12')](_0x87f4('0x1b'),_0xbc5d9e);logger[_0x87f4('0x15')](_0x87f4('0x1b'),_0xbc5d9e,JSON['stringify'](_0x1dfbe8));_0x578e2c(_0x1dfbe8);})['catch'](function(_0x343bc3){logger[_0x87f4('0x18')]('ShowSquareProject',_0x343bc3[_0x87f4('0x19')],_0xbc5d9e);_0x31eb02(_0x12695e[_0x87f4('0x18')](0x1f4,_0x343bc3[_0x87f4('0x19')]));});});};
\ No newline at end of file
+var _0x13d3=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareProject,\x20%s,\x20%s','result','ShowSquareProject','find','options','where','attributes','include','model','map'];(function(_0x2cf93b,_0x82de9a){var _0x487342=function(_0x562301){while(--_0x562301){_0x2cf93b['push'](_0x2cf93b['shift']());}};_0x487342(++_0x82de9a);}(_0x13d3,0x88));var _0x313d=function(_0x55805d,_0x3815b2){_0x55805d=_0x55805d-0x0;var _0x263d53=_0x13d3[_0x55805d];return _0x263d53;};'use strict';var _=require(_0x313d('0x0'));var util=require('util');var moment=require(_0x313d('0x1'));var BPromise=require(_0x313d('0x2'));var rs=require(_0x313d('0x3'));var fs=require('fs');var Redis=require(_0x313d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x313d('0x5'));var logger=require(_0x313d('0x6'))(_0x313d('0x7'));var config=require(_0x313d('0x8'));var jayson=require(_0x313d('0x9'));var client=jayson[_0x313d('0xa')][_0x313d('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x313d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x313d('0xc')]));require('./squareProject.socket')[_0x313d('0xd')](socket);function respondWithRpcPromise(_0x4820db,_0x4122c2,_0x20a56b){return new BPromise(function(_0x3bac83,_0x344b1d){return client[_0x313d('0xe')](_0x4820db,_0x20a56b)[_0x313d('0xf')](function(_0x5136ce){logger[_0x313d('0x10')]('SquareProject,\x20%s,\x20%s',_0x4122c2,_0x313d('0x11'));logger[_0x313d('0x12')](_0x313d('0x13'),_0x4122c2,_0x313d('0x11'),JSON[_0x313d('0x14')](_0x5136ce));if(_0x5136ce[_0x313d('0x15')]){if(_0x5136ce[_0x313d('0x15')][_0x313d('0x16')]===0x1f4){logger[_0x313d('0x15')]('SquareProject,\x20%s,\x20%s',_0x4122c2,_0x5136ce[_0x313d('0x15')][_0x313d('0x17')]);return _0x344b1d(_0x5136ce[_0x313d('0x15')]['message']);}logger[_0x313d('0x15')]('SquareProject,\x20%s,\x20%s',_0x4122c2,_0x5136ce[_0x313d('0x15')][_0x313d('0x17')]);return _0x3bac83(_0x5136ce['error']['message']);}else{logger['info'](_0x313d('0x18'),_0x4122c2,_0x313d('0x11'));_0x3bac83(_0x5136ce[_0x313d('0x19')][_0x313d('0x17')]);}})['catch'](function(_0x2cdfab){logger[_0x313d('0x15')](_0x313d('0x18'),_0x4122c2,_0x2cdfab);_0x344b1d(_0x2cdfab);});});}exports[_0x313d('0x1a')]=function(_0x56dcce){var _0x6dc3d6=this;return new Promise(function(_0x3b21e6,_0x56f76f){return db['SquareProject'][_0x313d('0x1b')]({'raw':_0x56dcce[_0x313d('0x1c')]?_0x56dcce['options']['raw']===undefined?!![]:![]:!![],'where':_0x56dcce[_0x313d('0x1c')]?_0x56dcce[_0x313d('0x1c')][_0x313d('0x1d')]||null:null,'attributes':_0x56dcce['options']?_0x56dcce[_0x313d('0x1c')][_0x313d('0x1e')]||null:null,'include':_0x56dcce[_0x313d('0x1c')]?_0x56dcce[_0x313d('0x1c')][_0x313d('0x1f')]?_['map'](_0x56dcce[_0x313d('0x1c')][_0x313d('0x1f')],function(_0xa0349){return{'model':db[_0xa0349[_0x313d('0x20')]],'as':_0xa0349['as'],'attributes':_0xa0349[_0x313d('0x1e')],'include':_0xa0349[_0x313d('0x1f')]?_[_0x313d('0x21')](_0xa0349['include'],function(_0xb4d6df){return{'model':db[_0xb4d6df[_0x313d('0x20')]],'as':_0xb4d6df['as'],'attributes':_0xb4d6df[_0x313d('0x1e')],'include':_0xb4d6df[_0x313d('0x1f')]?_['map'](_0xb4d6df['include'],function(_0x2acc4c){return{'model':db[_0x2acc4c['model']],'as':_0x2acc4c['as'],'attributes':_0x2acc4c[_0x313d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x313d('0xf')](function(_0xbb7db1){logger[_0x313d('0x10')](_0x313d('0x1a'),_0x56dcce);logger[_0x313d('0x12')]('ShowSquareProject',_0x56dcce,JSON[_0x313d('0x14')](_0xbb7db1));_0x3b21e6(_0xbb7db1);})['catch'](function(_0x250186){logger[_0x313d('0x15')](_0x313d('0x1a'),_0x250186[_0x313d('0x17')],_0x56dcce);_0x56f76f(_0x6dc3d6['error'](0x1f4,_0x250186[_0x313d('0x17')]));});});};
\ No newline at end of file
index 5d68fac..c1e438f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd709=['length','./squareProject.events','update','emit','removeListener','register'];(function(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0xd709,0x97));var _0x9d70=function(_0x21f868,_0x2da753){_0x21f868=_0x21f868-0x0;var _0x4202e=_0xd709[_0x21f868];return _0x4202e;};'use strict';var SquareProjectEvents=require(_0x9d70('0x0'));var events=['save','remove',_0x9d70('0x1')];function createListener(_0x2b0afe,_0x421349){return function(_0x2d404e){_0x421349[_0x9d70('0x2')](_0x2b0afe,_0x2d404e);};}function removeListener(_0x51dac0,_0xe2e684){return function(){SquareProjectEvents[_0x9d70('0x3')](_0x51dac0,_0xe2e684);};}exports[_0x9d70('0x4')]=function(_0x5f2955){for(var _0x4023cf=0x0,_0x54f647=events[_0x9d70('0x5')];_0x4023cf<_0x54f647;_0x4023cf++){var _0x30350d=events[_0x4023cf];var _0x57bacc=createListener('squareProject:'+_0x30350d,_0x5f2955);SquareProjectEvents['on'](_0x30350d,_0x57bacc);}};
\ No newline at end of file
+var _0x55dd=['remove','update','emit','removeListener','length','squareProject:','./squareProject.events','save'];(function(_0x51ddfe,_0x13e270){var _0x625d68=function(_0x5d4ecd){while(--_0x5d4ecd){_0x51ddfe['push'](_0x51ddfe['shift']());}};_0x625d68(++_0x13e270);}(_0x55dd,0x186));var _0xd55d=function(_0x109371,_0x441c8e){_0x109371=_0x109371-0x0;var _0x4fd858=_0x55dd[_0x109371];return _0x4fd858;};'use strict';var SquareProjectEvents=require(_0xd55d('0x0'));var events=[_0xd55d('0x1'),_0xd55d('0x2'),_0xd55d('0x3')];function createListener(_0x25efbd,_0x25be5b){return function(_0x4c5141){_0x25be5b[_0xd55d('0x4')](_0x25efbd,_0x4c5141);};}function removeListener(_0xcb17bf,_0x127cd3){return function(){SquareProjectEvents[_0xd55d('0x5')](_0xcb17bf,_0x127cd3);};}exports['register']=function(_0x1379f0){for(var _0x50dd4e=0x0,_0xe52558=events[_0xd55d('0x6')];_0x50dd4e<_0xe52558;_0x50dd4e++){var _0x2baa0d=events[_0x50dd4e];var _0x497bed=createListener(_0xd55d('0x7')+_0x2baa0d,_0x1379f0);SquareProjectEvents['on'](_0x2baa0d,_0x497bed);}};
\ No newline at end of file
index f48af2e..df83333 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1a29df,_0x310f66){var _0x4ebf65=function(_0x548d5f){while(--_0x548d5f){_0x1a29df['push'](_0x1a29df['shift']());}};_0x4ebf65(++_0x310f66);}(_0x4975,0x86));var _0x5497=function(_0x5f06e8,_0x5a5056){_0x5f06e8=_0x5f06e8-0x0;var _0x4cd2b7=_0x4975[_0x5f06e8];return _0x4cd2b7;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router;
\ No newline at end of file
+var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x4f2957,_0x246f8){var _0x5fb382=function(_0x199132){while(--_0x199132){_0x4f2957['push'](_0x4f2957['shift']());}};_0x5fb382(++_0x246f8);}(_0x5fab,0x177));var _0xb5fa=function(_0x102376,_0x16c6a2){_0x102376=_0x102376-0x0;var _0x29bc9c=_0x5fab[_0x102376];return _0x29bc9c;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router;
\ No newline at end of file
index f570071..66ad618 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5075=['savePath','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x475191,_0x5bce86){var _0x189e96=function(_0x46d6a2){while(--_0x46d6a2){_0x475191['push'](_0x475191['shift']());}};_0x189e96(++_0x5bce86);}(_0x5075,0x73));var _0x5507=function(_0x5585a6,_0x1ad47d){_0x5585a6=_0x5585a6-0x0;var _0x36a760=_0x5075[_0x5585a6];return _0x36a760;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'uniqueid':{'type':Sequelize[_0x5507('0x2')]},'callerid':{'type':Sequelize[_0x5507('0x2')]},'calleridname':{'type':Sequelize[_0x5507('0x2')]},'context':{'type':Sequelize[_0x5507('0x2')]},'extension':{'type':Sequelize[_0x5507('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5507('0x2')]},'dnid':{'type':Sequelize[_0x5507('0x2')]},'projectName':{'type':Sequelize[_0x5507('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x5507('0x2')]},'format':{'type':Sequelize[_0x5507('0x3')],'get':function(){var _0x4c2d6d='';var _0x42c232=this[_0x5507('0x4')](_0x5507('0x5'));if(_0x42c232){_0x4c2d6d=_0x42c232['substring'](_0x42c232['lastIndexOf']('.'));}return _0x4c2d6d;}}};
\ No newline at end of file
+var _0x5fc3=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0x5fc3[_0x548627];return _0x844a84;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x35fc('0x2')]},'calleridname':{'type':Sequelize[_0x35fc('0x2')]},'context':{'type':Sequelize[_0x35fc('0x2')]},'extension':{'type':Sequelize[_0x35fc('0x2')]},'priority':{'type':Sequelize[_0x35fc('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x35fc('0x2')]},'projectName':{'type':Sequelize[_0x35fc('0x2')]},'saveName':{'type':Sequelize[_0x35fc('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x35fc('0x3')],'get':function(){var _0x508b32='';var _0x16e153=this[_0x35fc('0x4')](_0x35fc('0x5'));if(_0x16e153){_0x508b32=_0x16e153[_0x35fc('0x6')](_0x16e153[_0x35fc('0x7')]('.'));}return _0x508b32;}}};
\ No newline at end of file
index 82adc83..d4e4a00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3b7=['then','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','download','../../components/encryptor','uniqueid','find','savePath','existsSync','decryptFile','secrets','recording','ValidationError','filename','extname','unlink','message','SquareRecording\x20not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd3b7,0xf1));var _0x7d3b=function(_0x56a1cf,_0x4fb132){_0x56a1cf=_0x56a1cf-0x0;var _0x5a4c20=_0xd3b7[_0x56a1cf];return _0x5a4c20;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7d3b('0x0'));var rp=require(_0x7d3b('0x1'));var moment=require('moment');var BPromise=require(_0x7d3b('0x2'));var Mustache=require('mustache');var util=require(_0x7d3b('0x3'));var path=require(_0x7d3b('0x4'));var sox=require(_0x7d3b('0x5'));var csv=require(_0x7d3b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d3b('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7d3b('0x8'));var deskjs=require(_0x7d3b('0x9'));var toCsv=require(_0x7d3b('0x6'));var querystring=require(_0x7d3b('0xa'));var Papa=require(_0x7d3b('0xb'));var Redis=require('ioredis');var authService=require(_0x7d3b('0xc'));var qs=require(_0x7d3b('0xd'));var as=require(_0x7d3b('0xe'));var hardwareService=require(_0x7d3b('0xf'));var logger=require(_0x7d3b('0x10'))(_0x7d3b('0x11'));var utils=require('../../config/utils');var config=require(_0x7d3b('0x12'));var licenseUtil=require(_0x7d3b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a6baf,_0x1ef380){_0x1ef380=_0x1ef380||0xcc;return function(_0x2ed439){if(_0x2ed439){return _0x5a6baf[_0x7d3b('0x14')](_0x1ef380);}return _0x5a6baf[_0x7d3b('0x15')](_0x1ef380)[_0x7d3b('0x16')]();};}function respondWithResult(_0x5d4ace,_0x14ab0a){_0x14ab0a=_0x14ab0a||0xc8;return function(_0x49db08){if(_0x49db08){return _0x5d4ace[_0x7d3b('0x15')](_0x14ab0a)['json'](_0x49db08);}};}function respondWithFilteredResult(_0x5f580e,_0x3900b7){return function(_0x3b3268){if(_0x3b3268){var _0x125a2e=typeof _0x3900b7[_0x7d3b('0x17')]===_0x7d3b('0x18')&&typeof _0x3900b7[_0x7d3b('0x19')]==='undefined';var _0xd1cac=_0x3b3268['count'];var _0x1c59be=_0x125a2e?0x0:_0x3900b7['offset'];var _0x118deb=_0x125a2e?_0x3b3268[_0x7d3b('0x1a')]:_0x3900b7['offset']+_0x3900b7[_0x7d3b('0x19')];var _0x56cf85;if(_0x118deb>=_0xd1cac){_0x118deb=_0xd1cac;_0x56cf85=0xc8;}else{_0x56cf85=0xce;}_0x5f580e[_0x7d3b('0x15')](_0x56cf85);return _0x5f580e[_0x7d3b('0x1b')]('Content-Range',_0x1c59be+'-'+_0x118deb+'/'+_0xd1cac)['json'](_0x3b3268);}return null;};}function patchUpdates(_0x39b755){return function(_0x39d504){try{jsonpatch[_0x7d3b('0x1c')](_0x39d504,_0x39b755,!![]);}catch(_0x2b893e){return BPromise[_0x7d3b('0x1d')](_0x2b893e);}return _0x39d504[_0x7d3b('0x1e')]();};}function saveUpdates(_0x4c4edc,_0x3ddac2){return function(_0xcfbfce){if(_0xcfbfce){return _0xcfbfce[_0x7d3b('0x1f')](_0x4c4edc)[_0x7d3b('0x20')](function(_0x565fc0){return _0x565fc0;});}return null;};}function removeEntity(_0x254da7,_0x59e4e2){return function(_0x4fed34){if(_0x4fed34){return _0x4fed34[_0x7d3b('0x21')]()[_0x7d3b('0x20')](function(){_0x254da7[_0x7d3b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e8f83,_0x5945ea){return function(_0x2eccec){if(!_0x2eccec){_0x5e8f83[_0x7d3b('0x14')](0x194);}return _0x2eccec;};}function handleError(_0x3e7c74,_0x5e7c74){_0x5e7c74=_0x5e7c74||0x1f4;return function(_0x28838d){logger[_0x7d3b('0x22')](_0x28838d[_0x7d3b('0x23')]);if(_0x28838d[_0x7d3b('0x24')]){delete _0x28838d[_0x7d3b('0x24')];}_0x3e7c74[_0x7d3b('0x15')](_0x5e7c74)[_0x7d3b('0x25')](_0x28838d);};}exports[_0x7d3b('0x26')]=function(_0x3698cf,_0x5630fe){var _0x44e471={},_0x2b96d8={},_0x2ee9fd={'count':0x0,'rows':[]};var _0x2e63fa=_['map'](db[_0x7d3b('0x27')][_0x7d3b('0x28')],function(_0x36deee){return{'name':_0x36deee['fieldName'],'type':_0x36deee[_0x7d3b('0x29')][_0x7d3b('0x2a')]};});_0x2b96d8[_0x7d3b('0x2b')]=_['map'](_0x2e63fa,'name');_0x2b96d8[_0x7d3b('0x2c')]=_[_0x7d3b('0x2d')](_0x3698cf[_0x7d3b('0x2c')]);_0x2b96d8[_0x7d3b('0x2e')]=_['intersection'](_0x2b96d8[_0x7d3b('0x2b')],_0x2b96d8['query']);_0x44e471[_0x7d3b('0x2f')]=_[_0x7d3b('0x30')](_0x2b96d8[_0x7d3b('0x2b')],qs[_0x7d3b('0x31')](_0x3698cf[_0x7d3b('0x2c')]['fields']));_0x44e471[_0x7d3b('0x2f')]=_0x44e471[_0x7d3b('0x2f')]['length']?_0x44e471[_0x7d3b('0x2f')]:_0x2b96d8[_0x7d3b('0x2b')];if(!_0x3698cf[_0x7d3b('0x2c')][_0x7d3b('0x32')](_0x7d3b('0x33'))){_0x44e471[_0x7d3b('0x19')]=qs['limit'](_0x3698cf[_0x7d3b('0x2c')][_0x7d3b('0x19')]);_0x44e471[_0x7d3b('0x17')]=qs[_0x7d3b('0x17')](_0x3698cf[_0x7d3b('0x2c')][_0x7d3b('0x17')]);}_0x44e471[_0x7d3b('0x34')]=qs[_0x7d3b('0x35')](_0x3698cf['query'][_0x7d3b('0x35')]);_0x44e471['where']=qs[_0x7d3b('0x2e')](_[_0x7d3b('0x36')](_0x3698cf[_0x7d3b('0x2c')],_0x2b96d8['filters']),_0x2e63fa);if(_0x3698cf[_0x7d3b('0x2c')][_0x7d3b('0x37')]){_0x44e471[_0x7d3b('0x38')]=_['merge'](_0x44e471['where'],{'$or':_['map'](_0x2e63fa,function(_0x3a4d53){if(_0x3a4d53[_0x7d3b('0x29')]!==_0x7d3b('0x39')){var _0x3f2981={};_0x3f2981[_0x3a4d53[_0x7d3b('0x24')]]={'$like':'%'+_0x3698cf[_0x7d3b('0x2c')]['filter']+'%'};return _0x3f2981;}})});}_0x44e471=_[_0x7d3b('0x3a')]({},_0x44e471,_0x3698cf[_0x7d3b('0x3b')]);var _0xfb84b9={'where':_0x44e471[_0x7d3b('0x38')]};return db[_0x7d3b('0x27')][_0x7d3b('0x1a')](_0xfb84b9)['then'](function(_0x436b12){_0x2ee9fd[_0x7d3b('0x1a')]=_0x436b12;if(_0x3698cf[_0x7d3b('0x2c')][_0x7d3b('0x3c')]){_0x44e471[_0x7d3b('0x3d')]=[{'all':!![]}];}return db[_0x7d3b('0x27')][_0x7d3b('0x3e')](_0x44e471);})['then'](function(_0x166419){_0x2ee9fd[_0x7d3b('0x3f')]=_0x166419;return _0x2ee9fd;})[_0x7d3b('0x20')](respondWithFilteredResult(_0x5630fe,_0x44e471))[_0x7d3b('0x40')](handleError(_0x5630fe,null));};exports[_0x7d3b('0x41')]=function(_0x3746e4,_0x20dbeb){var _0xbb8e6c={'raw':!![],'where':{'id':_0x3746e4[_0x7d3b('0x42')]['id']}},_0x2f781a={};_0x2f781a[_0x7d3b('0x2b')]=_['keys'](db[_0x7d3b('0x27')][_0x7d3b('0x28')]);_0x2f781a[_0x7d3b('0x2c')]=_[_0x7d3b('0x2d')](_0x3746e4[_0x7d3b('0x2c')]);_0x2f781a[_0x7d3b('0x2e')]=_[_0x7d3b('0x30')](_0x2f781a[_0x7d3b('0x2b')],_0x2f781a['query']);_0xbb8e6c[_0x7d3b('0x2f')]=_['intersection'](_0x2f781a[_0x7d3b('0x2b')],qs[_0x7d3b('0x31')](_0x3746e4['query']['fields']));_0xbb8e6c[_0x7d3b('0x2f')]=_0xbb8e6c[_0x7d3b('0x2f')]['length']?_0xbb8e6c[_0x7d3b('0x2f')]:_0x2f781a[_0x7d3b('0x2b')];if(_0x3746e4['query']['includeAll']){_0xbb8e6c[_0x7d3b('0x3d')]=[{'all':!![]}];}_0xbb8e6c=_[_0x7d3b('0x3a')]({},_0xbb8e6c,_0x3746e4[_0x7d3b('0x3b')]);return db[_0x7d3b('0x27')]['find'](_0xbb8e6c)['then'](handleEntityNotFound(_0x20dbeb,null))['then'](respondWithResult(_0x20dbeb,null))['catch'](handleError(_0x20dbeb,null));};exports[_0x7d3b('0x43')]=function(_0x33e373,_0xb270f9){return db[_0x7d3b('0x27')][_0x7d3b('0x43')](_0x33e373[_0x7d3b('0x44')],{})[_0x7d3b('0x20')](respondWithResult(_0xb270f9,0xc9))[_0x7d3b('0x40')](handleError(_0xb270f9,null));};exports[_0x7d3b('0x1f')]=function(_0x122ac2,_0x39ba3a){if(_0x122ac2[_0x7d3b('0x44')]['id']){delete _0x122ac2[_0x7d3b('0x44')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x122ac2[_0x7d3b('0x42')]['id']}})[_0x7d3b('0x20')](handleEntityNotFound(_0x39ba3a,null))[_0x7d3b('0x20')](saveUpdates(_0x122ac2[_0x7d3b('0x44')],null))[_0x7d3b('0x20')](respondWithResult(_0x39ba3a,null))['catch'](handleError(_0x39ba3a,null));};exports[_0x7d3b('0x45')]=function(_0x1c7ec3,_0x48e339,_0x1896de){var _0x42c42f=require(_0x7d3b('0x46'));var _0x5907b1=![];var _0x57ad33={};if(_0x1c7ec3['query'][_0x7d3b('0x29')]&&_0x1c7ec3[_0x7d3b('0x2c')][_0x7d3b('0x29')]===_0x7d3b('0x47')){_0x57ad33[_0x7d3b('0x47')]=_0x1c7ec3[_0x7d3b('0x42')]['id'];}else{_0x57ad33['id']=_0x1c7ec3['params']['id'];}return db[_0x7d3b('0x27')][_0x7d3b('0x48')]({'where':_0x57ad33,'attributes':['id',_0x7d3b('0x49'),'filename'],'raw':!![]})[_0x7d3b('0x20')](handleEntityNotFound(_0x48e339,null))[_0x7d3b('0x20')](function(_0x31a601){if(_0x31a601){var _0x5623e1=_0x31a601[_0x7d3b('0x49')];var _0x158b5e=util['format']('%s.cypher',_0x5623e1);if(fs[_0x7d3b('0x4a')](_0x158b5e)){_0x5907b1=!![];return _0x42c42f[_0x7d3b('0x4b')](_0x158b5e,_0x5623e1,config[_0x7d3b('0x4c')][_0x7d3b('0x4d')])[_0x7d3b('0x20')](function(){return _0x31a601;});}return _0x31a601;}})[_0x7d3b('0x20')](function(_0x2b7577){if(_0x2b7577){var _0x4f75ee=_0x2b7577['savePath'];if(!fs[_0x7d3b('0x4a')](_0x4f75ee)){throw new db['Sequelize'][(_0x7d3b('0x4e'))]('SquareRecording\x20not\x20found');}if(_0x2b7577[_0x7d3b('0x4f')]){return _0x48e339[_0x7d3b('0x45')](_0x4f75ee,_0x2b7577[_0x7d3b('0x4f')]+path[_0x7d3b('0x50')](_0x4f75ee),function(){if(_0x5907b1){fs[_0x7d3b('0x51')](_0x4f75ee);}});}else{return _0x48e339['download'](_0x4f75ee,function(_0x2dbf38){if(_0x5907b1){fs[_0x7d3b('0x51')](_0x4f75ee);}});}}})['catch'](function(_0x2b85f7){if(_0x2b85f7[_0x7d3b('0x52')]===_0x7d3b('0x53')){_0x48e339[_0x7d3b('0x15')](0x194)[_0x7d3b('0x25')]('Not\x20found');}else{return handleError(_0x48e339,null);}});};exports['destroy']=function(_0x41bf2c,_0x6abf3b){return db['SquareRecording'][_0x7d3b('0x48')]({'where':{'id':_0x41bf2c['params']['id']}})[_0x7d3b('0x20')](function(_0x52f227){if(_[_0x7d3b('0x54')](_0x52f227)){throw new ReferenceError(_0x7d3b('0x55'));}return _0x52f227;})[_0x7d3b('0x20')](function(_0x2cc3eb){var _0x4030a6=_0x2cc3eb[_0x7d3b('0x49')];logger[_0x7d3b('0x56')]('cancellazione\x20fisica\x20documento\x20%s',_0x4030a6);if(!_[_0x7d3b('0x54')](_0x2cc3eb[_0x7d3b('0x49')])&&fs[_0x7d3b('0x4a')](_0x4030a6)){logger['info'](_0x7d3b('0x57')+_0x4030a6+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x4030a6);}_0x4030a6=_0x4030a6+_0x7d3b('0x58');if(!_[_0x7d3b('0x54')](_0x2cc3eb['savePath'])&&fs[_0x7d3b('0x4a')](_0x4030a6)){logger[_0x7d3b('0x56')]('File:\x20\x22'+_0x4030a6+_0x7d3b('0x59'));fs[_0x7d3b('0x5a')](_0x4030a6);}return _0x2cc3eb;})[_0x7d3b('0x20')](function(_0x4e66b7){if(!_0x4e66b7)throw new InternalError();return _0x4e66b7[_0x7d3b('0x21')]();})[_0x7d3b('0x20')](function(){_0x6abf3b[_0x7d3b('0x15')](0xcc)[_0x7d3b('0x16')]();})[_0x7d3b('0x40')](handleError(_0x6abf3b,null));};
\ No newline at end of file
+var _0xb27e=['params','rawAttributes','intersection','length','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','decryptFile','recording','existsSync','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','SquareRecording','includeAll','findAll','rows','catch','show'];(function(_0x88fbcc,_0x2b462b){var _0x4c9dc2=function(_0x1a2457){while(--_0x1a2457){_0x88fbcc['push'](_0x88fbcc['shift']());}};_0x4c9dc2(++_0x2b462b);}(_0xb27e,0xd9));var _0xeb27=function(_0xff2528,_0x570fc7){_0xff2528=_0xff2528-0x0;var _0x4ee224=_0xb27e[_0xff2528];return _0x4ee224;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb27('0x0'));var zipdir=require(_0xeb27('0x1'));var jsonpatch=require(_0xeb27('0x2'));var rp=require(_0xeb27('0x3'));var moment=require('moment');var BPromise=require(_0xeb27('0x4'));var Mustache=require(_0xeb27('0x5'));var util=require(_0xeb27('0x6'));var path=require(_0xeb27('0x7'));var sox=require(_0xeb27('0x8'));var csv=require('to-csv');var ejs=require(_0xeb27('0x9'));var fs=require('fs');var fs_extra=require(_0xeb27('0xa'));var _=require(_0xeb27('0xb'));var squel=require('squel');var crypto=require(_0xeb27('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xeb27('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeb27('0xe'));var Papa=require(_0xeb27('0xf'));var Redis=require('ioredis');var authService=require(_0xeb27('0x10'));var qs=require(_0xeb27('0x11'));var as=require(_0xeb27('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb27('0x13'))(_0xeb27('0x14'));var utils=require(_0xeb27('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xeb27('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50d19b,_0x62b307){_0x62b307=_0x62b307||0xcc;return function(_0x1652a7){if(_0x1652a7){return _0x50d19b[_0xeb27('0x17')](_0x62b307);}return _0x50d19b[_0xeb27('0x18')](_0x62b307)[_0xeb27('0x19')]();};}function respondWithResult(_0x439a6f,_0x73ae0e){_0x73ae0e=_0x73ae0e||0xc8;return function(_0x359201){if(_0x359201){return _0x439a6f[_0xeb27('0x18')](_0x73ae0e)[_0xeb27('0x1a')](_0x359201);}};}function respondWithFilteredResult(_0x1578e1,_0x7d0ba7){return function(_0x435e57){if(_0x435e57){var _0x43c185=typeof _0x7d0ba7['offset']===_0xeb27('0x1b')&&typeof _0x7d0ba7[_0xeb27('0x1c')]===_0xeb27('0x1b');var _0x2cf454=_0x435e57['count'];var _0x186e88=_0x43c185?0x0:_0x7d0ba7[_0xeb27('0x1d')];var _0x46e73b=_0x43c185?_0x435e57['count']:_0x7d0ba7[_0xeb27('0x1d')]+_0x7d0ba7[_0xeb27('0x1c')];var _0x3db42c;if(_0x46e73b>=_0x2cf454){_0x46e73b=_0x2cf454;_0x3db42c=0xc8;}else{_0x3db42c=0xce;}_0x1578e1['status'](_0x3db42c);return _0x1578e1[_0xeb27('0x1e')](_0xeb27('0x1f'),_0x186e88+'-'+_0x46e73b+'/'+_0x2cf454)[_0xeb27('0x1a')](_0x435e57);}return null;};}function patchUpdates(_0x109f60){return function(_0x3ec7be){try{jsonpatch[_0xeb27('0x20')](_0x3ec7be,_0x109f60,!![]);}catch(_0x5268a1){return BPromise[_0xeb27('0x21')](_0x5268a1);}return _0x3ec7be[_0xeb27('0x22')]();};}function saveUpdates(_0x3cb648,_0x4b97b9){return function(_0x2752f8){if(_0x2752f8){return _0x2752f8[_0xeb27('0x23')](_0x3cb648)['then'](function(_0x20ebaa){return _0x20ebaa;});}return null;};}function removeEntity(_0x107d68,_0xb66cdb){return function(_0x8109f1){if(_0x8109f1){return _0x8109f1[_0xeb27('0x24')]()[_0xeb27('0x25')](function(){_0x107d68[_0xeb27('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf2a96,_0x37c548){return function(_0x1192db){if(!_0x1192db){_0xf2a96[_0xeb27('0x17')](0x194);}return _0x1192db;};}function handleError(_0x54788d,_0x5b676f){_0x5b676f=_0x5b676f||0x1f4;return function(_0xb0608){logger[_0xeb27('0x26')](_0xb0608[_0xeb27('0x27')]);if(_0xb0608[_0xeb27('0x28')]){delete _0xb0608[_0xeb27('0x28')];}_0x54788d[_0xeb27('0x18')](_0x5b676f)['send'](_0xb0608);};}exports['index']=function(_0x4dd991,_0x25ead0){var _0x32e109={},_0x54b4bb={},_0x56a3f0={'count':0x0,'rows':[]};var _0xf4e62=_[_0xeb27('0x29')](db['SquareRecording']['rawAttributes'],function(_0x2e8b4d){return{'name':_0x2e8b4d['fieldName'],'type':_0x2e8b4d[_0xeb27('0x2a')][_0xeb27('0x2b')]};});_0x54b4bb[_0xeb27('0x2c')]=_['map'](_0xf4e62,_0xeb27('0x28'));_0x54b4bb[_0xeb27('0x2d')]=_[_0xeb27('0x2e')](_0x4dd991[_0xeb27('0x2d')]);_0x54b4bb[_0xeb27('0x2f')]=_['intersection'](_0x54b4bb[_0xeb27('0x2c')],_0x54b4bb['query']);_0x32e109[_0xeb27('0x30')]=_['intersection'](_0x54b4bb[_0xeb27('0x2c')],qs['fields'](_0x4dd991['query'][_0xeb27('0x31')]));_0x32e109['attributes']=_0x32e109[_0xeb27('0x30')]['length']?_0x32e109['attributes']:_0x54b4bb[_0xeb27('0x2c')];if(!_0x4dd991['query'][_0xeb27('0x32')](_0xeb27('0x33'))){_0x32e109[_0xeb27('0x1c')]=qs['limit'](_0x4dd991[_0xeb27('0x2d')][_0xeb27('0x1c')]);_0x32e109[_0xeb27('0x1d')]=qs[_0xeb27('0x1d')](_0x4dd991[_0xeb27('0x2d')][_0xeb27('0x1d')]);}_0x32e109['order']=qs['sort'](_0x4dd991[_0xeb27('0x2d')][_0xeb27('0x34')]);_0x32e109['where']=qs[_0xeb27('0x2f')](_[_0xeb27('0x35')](_0x4dd991[_0xeb27('0x2d')],_0x54b4bb['filters']),_0xf4e62);if(_0x4dd991[_0xeb27('0x2d')][_0xeb27('0x36')]){_0x32e109['where']=_['merge'](_0x32e109[_0xeb27('0x37')],{'$or':_['map'](_0xf4e62,function(_0x5116bc){if(_0x5116bc[_0xeb27('0x2a')]!==_0xeb27('0x38')){var _0x32e171={};_0x32e171[_0x5116bc[_0xeb27('0x28')]]={'$like':'%'+_0x4dd991[_0xeb27('0x2d')]['filter']+'%'};return _0x32e171;}})});}_0x32e109=_[_0xeb27('0x39')]({},_0x32e109,_0x4dd991[_0xeb27('0x3a')]);var _0x5c7d36={'where':_0x32e109[_0xeb27('0x37')]};return db[_0xeb27('0x3b')]['count'](_0x5c7d36)[_0xeb27('0x25')](function(_0x400450){_0x56a3f0['count']=_0x400450;if(_0x4dd991[_0xeb27('0x2d')][_0xeb27('0x3c')]){_0x32e109['include']=[{'all':!![]}];}return db['SquareRecording'][_0xeb27('0x3d')](_0x32e109);})[_0xeb27('0x25')](function(_0x22bacf){_0x56a3f0[_0xeb27('0x3e')]=_0x22bacf;return _0x56a3f0;})[_0xeb27('0x25')](respondWithFilteredResult(_0x25ead0,_0x32e109))[_0xeb27('0x3f')](handleError(_0x25ead0,null));};exports[_0xeb27('0x40')]=function(_0x50e30a,_0x359ce2){var _0x4b2a89={'raw':!![],'where':{'id':_0x50e30a[_0xeb27('0x41')]['id']}},_0x3ab89e={};_0x3ab89e['model']=_[_0xeb27('0x2e')](db[_0xeb27('0x3b')][_0xeb27('0x42')]);_0x3ab89e[_0xeb27('0x2d')]=_[_0xeb27('0x2e')](_0x50e30a[_0xeb27('0x2d')]);_0x3ab89e[_0xeb27('0x2f')]=_[_0xeb27('0x43')](_0x3ab89e[_0xeb27('0x2c')],_0x3ab89e[_0xeb27('0x2d')]);_0x4b2a89[_0xeb27('0x30')]=_[_0xeb27('0x43')](_0x3ab89e[_0xeb27('0x2c')],qs['fields'](_0x50e30a[_0xeb27('0x2d')]['fields']));_0x4b2a89[_0xeb27('0x30')]=_0x4b2a89[_0xeb27('0x30')][_0xeb27('0x44')]?_0x4b2a89[_0xeb27('0x30')]:_0x3ab89e[_0xeb27('0x2c')];if(_0x50e30a['query'][_0xeb27('0x3c')]){_0x4b2a89['include']=[{'all':!![]}];}_0x4b2a89=_[_0xeb27('0x39')]({},_0x4b2a89,_0x50e30a[_0xeb27('0x3a')]);return db[_0xeb27('0x3b')][_0xeb27('0x45')](_0x4b2a89)['then'](handleEntityNotFound(_0x359ce2,null))['then'](respondWithResult(_0x359ce2,null))[_0xeb27('0x3f')](handleError(_0x359ce2,null));};exports[_0xeb27('0x46')]=function(_0x4f4a2c,_0x449242){return db['SquareRecording'][_0xeb27('0x46')](_0x4f4a2c['body'],{})[_0xeb27('0x25')](respondWithResult(_0x449242,0xc9))[_0xeb27('0x3f')](handleError(_0x449242,null));};exports[_0xeb27('0x23')]=function(_0x4e0d5e,_0x1fa77c){if(_0x4e0d5e['body']['id']){delete _0x4e0d5e[_0xeb27('0x47')]['id'];}return db[_0xeb27('0x3b')][_0xeb27('0x45')]({'where':{'id':_0x4e0d5e[_0xeb27('0x41')]['id']}})[_0xeb27('0x25')](handleEntityNotFound(_0x1fa77c,null))[_0xeb27('0x25')](saveUpdates(_0x4e0d5e[_0xeb27('0x47')],null))[_0xeb27('0x25')](respondWithResult(_0x1fa77c,null))['catch'](handleError(_0x1fa77c,null));};exports[_0xeb27('0x48')]=function(_0x12d6b2,_0x27f080,_0xef96f6){var _0x22f421=require(_0xeb27('0x49'));var _0x6f27ab=![];var _0xba60c={};if(_0x12d6b2[_0xeb27('0x2d')]['type']&&_0x12d6b2[_0xeb27('0x2d')][_0xeb27('0x2a')]===_0xeb27('0x4a')){_0xba60c[_0xeb27('0x4a')]=_0x12d6b2[_0xeb27('0x41')]['id'];}else{_0xba60c['id']=_0x12d6b2['params']['id'];}return db['SquareRecording']['find']({'where':_0xba60c,'attributes':['id',_0xeb27('0x4b'),_0xeb27('0x4c')],'raw':!![]})[_0xeb27('0x25')](handleEntityNotFound(_0x27f080,null))[_0xeb27('0x25')](function(_0x180184){if(_0x180184){var _0x1ee3c4=_0x180184[_0xeb27('0x4b')];var _0x45cfa0=util['format'](_0xeb27('0x4d'),_0x1ee3c4);if(fs['existsSync'](_0x45cfa0)){_0x6f27ab=!![];return _0x22f421[_0xeb27('0x4e')](_0x45cfa0,_0x1ee3c4,config['secrets'][_0xeb27('0x4f')])[_0xeb27('0x25')](function(){return _0x180184;});}return _0x180184;}})[_0xeb27('0x25')](function(_0x514c03){if(_0x514c03){var _0x4b4cf7=_0x514c03[_0xeb27('0x4b')];if(!fs[_0xeb27('0x50')](_0x4b4cf7)){throw new db[(_0xeb27('0x51'))]['ValidationError'](_0xeb27('0x52'));}if(_0x514c03[_0xeb27('0x4c')]){return _0x27f080[_0xeb27('0x48')](_0x4b4cf7,_0x514c03[_0xeb27('0x4c')]+path[_0xeb27('0x53')](_0x4b4cf7),function(){if(_0x6f27ab){fs[_0xeb27('0x54')](_0x4b4cf7);}});}else{return _0x27f080[_0xeb27('0x48')](_0x4b4cf7,function(_0x249f63){if(_0x6f27ab){fs['unlink'](_0x4b4cf7);}});}}})[_0xeb27('0x3f')](function(_0x208688){if(_0x208688[_0xeb27('0x55')]===_0xeb27('0x52')){_0x27f080['status'](0x194)['send'](_0xeb27('0x56'));}else{return handleError(_0x27f080,null);}});};exports[_0xeb27('0x24')]=function(_0x479282,_0x5b961c){return db['SquareRecording']['find']({'where':{'id':_0x479282['params']['id']}})[_0xeb27('0x25')](function(_0x1699b7){if(_[_0xeb27('0x57')](_0x1699b7)){throw new ReferenceError(_0xeb27('0x58'));}return _0x1699b7;})[_0xeb27('0x25')](function(_0x32002f){var _0x23dc8b=_0x32002f[_0xeb27('0x4b')];logger[_0xeb27('0x59')](_0xeb27('0x5a'),_0x23dc8b);if(!_[_0xeb27('0x57')](_0x32002f['savePath'])&&fs[_0xeb27('0x50')](_0x23dc8b)){logger[_0xeb27('0x59')](_0xeb27('0x5b')+_0x23dc8b+_0xeb27('0x5c'));fs['unlinkSync'](_0x23dc8b);}_0x23dc8b=_0x23dc8b+'.cypher';if(!_['isNil'](_0x32002f[_0xeb27('0x4b')])&&fs[_0xeb27('0x50')](_0x23dc8b)){logger[_0xeb27('0x59')](_0xeb27('0x5b')+_0x23dc8b+_0xeb27('0x5c'));fs[_0xeb27('0x5d')](_0x23dc8b);}return _0x32002f;})[_0xeb27('0x25')](function(_0x146498){if(!_0x146498)throw new InternalError();return _0x146498['destroy']();})[_0xeb27('0x25')](function(){_0x5b961c['status'](0xcc)[_0xeb27('0x19')]();})['catch'](handleError(_0x5b961c,null));};
\ No newline at end of file
index 68e3259..afd87b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3b3=['path','rimraf','../../config/environment','exports','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x5063d3,_0x1bb4b7){_0x5063d3=_0x5063d3-0x0;var _0x5daa07=_0xe3b3[_0x5063d3];return _0x5daa07;};'use strict';var _=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var logger=require(_0x3e3b('0x2'))(_0x3e3b('0x3'));var moment=require(_0x3e3b('0x4'));var BPromise=require(_0x3e3b('0x5'));var rp=require(_0x3e3b('0x6'));var fs=require('fs');var path=require(_0x3e3b('0x7'));var rimraf=require(_0x3e3b('0x8'));var config=require(_0x3e3b('0x9'));var attributes=require('./squareRecording.attributes');module[_0x3e3b('0xa')]=function(_0x3fd79a,_0x410458){return _0x3fd79a['define'](_0x3e3b('0xb'),attributes,{'tableName':_0x3e3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ff3=['./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x1a660d,_0x182bba){var _0x3c1a19=function(_0x49f149){while(--_0x49f149){_0x1a660d['push'](_0x1a660d['shift']());}};_0x3c1a19(++_0x182bba);}(_0x8ff3,0x72));var _0x38ff=function(_0x2d486b,_0x5f213c){_0x2d486b=_0x2d486b-0x0;var _0x4291d1=_0x8ff3[_0x2d486b];return _0x4291d1;};'use strict';var _=require(_0x38ff('0x0'));var util=require(_0x38ff('0x1'));var logger=require('../../config/logger')(_0x38ff('0x2'));var moment=require(_0x38ff('0x3'));var BPromise=require(_0x38ff('0x4'));var rp=require(_0x38ff('0x5'));var fs=require('fs');var path=require(_0x38ff('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x38ff('0x7'));module['exports']=function(_0x32a606,_0x5428e3){return _0x32a606[_0x38ff('0x8')](_0x38ff('0x9'),attributes,{'tableName':_0x38ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 50ec10d..0388c6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce06=['catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x30eb78,_0x438ad7){var _0x562c60=function(_0xfec164){while(--_0xfec164){_0x30eb78['push'](_0x30eb78['shift']());}};_0x562c60(++_0x438ad7);}(_0xce06,0x10c));var _0x6ce0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xce06[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6ce0('0x0'));var util=require(_0x6ce0('0x1'));var moment=require(_0x6ce0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ce0('0x3'));var db=require(_0x6ce0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ce0('0x5'))('rpc');var config=require(_0x6ce0('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6ce0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a7853,_0x4ed6d6,_0x2ab1c6){return new BPromise(function(_0x523139,_0x406a73){return client[_0x6ce0('0x8')](_0x1a7853,_0x2ab1c6)['then'](function(_0x269ed0){logger[_0x6ce0('0x9')](_0x6ce0('0xa'),_0x4ed6d6,_0x6ce0('0xb'));logger[_0x6ce0('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x4ed6d6,_0x6ce0('0xb'),JSON[_0x6ce0('0xd')](_0x269ed0));if(_0x269ed0[_0x6ce0('0xe')]){if(_0x269ed0[_0x6ce0('0xe')][_0x6ce0('0xf')]===0x1f4){logger['error'](_0x6ce0('0xa'),_0x4ed6d6,_0x269ed0[_0x6ce0('0xe')]['message']);return _0x406a73(_0x269ed0[_0x6ce0('0xe')][_0x6ce0('0x10')]);}logger[_0x6ce0('0xe')](_0x6ce0('0xa'),_0x4ed6d6,_0x269ed0[_0x6ce0('0xe')][_0x6ce0('0x10')]);return _0x523139(_0x269ed0[_0x6ce0('0xe')]['message']);}else{logger[_0x6ce0('0x9')](_0x6ce0('0xa'),_0x4ed6d6,'request\x20sent');_0x523139(_0x269ed0[_0x6ce0('0x11')]['message']);}})[_0x6ce0('0x12')](function(_0x598f53){logger['error'](_0x6ce0('0xa'),_0x4ed6d6,_0x598f53);_0x406a73(_0x598f53);});});}exports[_0x6ce0('0x13')]=function(_0x4a3887){var _0xd83ba5=this;return new Promise(function(_0x29b8f5,_0x2515f8){return db[_0x6ce0('0x14')][_0x6ce0('0x15')](_0x4a3887[_0x6ce0('0x16')],{'raw':_0x4a3887['options']?_0x4a3887[_0x6ce0('0x17')][_0x6ce0('0x18')]===undefined?!![]:![]:!![]})[_0x6ce0('0x19')](function(_0x210ae4){logger[_0x6ce0('0x9')](_0x6ce0('0x13'),_0x4a3887);logger[_0x6ce0('0xc')](_0x6ce0('0x13'),_0x4a3887,JSON[_0x6ce0('0xd')](_0x210ae4));_0x29b8f5(_0x210ae4);})[_0x6ce0('0x12')](function(_0x103531){logger[_0x6ce0('0xe')]('CreateSquareRecording',_0x103531[_0x6ce0('0x10')],_0x4a3887);_0x2515f8(_0xd83ba5[_0x6ce0('0xe')](0x1f4,_0x103531[_0x6ce0('0x10')]));});});};
\ No newline at end of file
+var _0x9657=['debug','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','SquareRecording','create','options','raw','CreateSquareRecording'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9657,0x110));var _0x7965=function(_0x4c5474,_0x439c77){_0x4c5474=_0x4c5474-0x0;var _0x46417f=_0x9657[_0x4c5474];return _0x46417f;};'use strict';var _=require('lodash');var util=require(_0x7965('0x0'));var moment=require(_0x7965('0x1'));var BPromise=require(_0x7965('0x2'));var rs=require(_0x7965('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7965('0x4'))['db'];var utils=require(_0x7965('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7965('0x6'));var client=jayson[_0x7965('0x7')][_0x7965('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e3f75,_0x3c439d,_0x89d77b){return new BPromise(function(_0xcb138a,_0x41bfa8){return client[_0x7965('0x9')](_0x2e3f75,_0x89d77b)[_0x7965('0xa')](function(_0xfe7adc){logger[_0x7965('0xb')]('SquareRecording,\x20%s,\x20%s',_0x3c439d,_0x7965('0xc'));logger['debug'](_0x7965('0xd'),_0x3c439d,_0x7965('0xc'),JSON[_0x7965('0xe')](_0xfe7adc));if(_0xfe7adc[_0x7965('0xf')]){if(_0xfe7adc['error'][_0x7965('0x10')]===0x1f4){logger[_0x7965('0xf')](_0x7965('0x11'),_0x3c439d,_0xfe7adc['error'][_0x7965('0x12')]);return _0x41bfa8(_0xfe7adc[_0x7965('0xf')][_0x7965('0x12')]);}logger['error'](_0x7965('0x11'),_0x3c439d,_0xfe7adc['error'][_0x7965('0x12')]);return _0xcb138a(_0xfe7adc[_0x7965('0xf')][_0x7965('0x12')]);}else{logger[_0x7965('0xb')](_0x7965('0x11'),_0x3c439d,_0x7965('0xc'));_0xcb138a(_0xfe7adc[_0x7965('0x13')][_0x7965('0x12')]);}})['catch'](function(_0x24b57c){logger[_0x7965('0xf')](_0x7965('0x11'),_0x3c439d,_0x24b57c);_0x41bfa8(_0x24b57c);});});}exports['CreateSquareRecording']=function(_0x5e2154){var _0x320f5e=this;return new Promise(function(_0x50a81c,_0xa5c0a0){return db[_0x7965('0x14')][_0x7965('0x15')](_0x5e2154['body'],{'raw':_0x5e2154[_0x7965('0x16')]?_0x5e2154[_0x7965('0x16')][_0x7965('0x17')]===undefined?!![]:![]:!![]})[_0x7965('0xa')](function(_0x5a7f3f){logger[_0x7965('0xb')](_0x7965('0x18'),_0x5e2154);logger[_0x7965('0x19')]('CreateSquareRecording',_0x5e2154,JSON[_0x7965('0xe')](_0x5a7f3f));_0x50a81c(_0x5a7f3f);})[_0x7965('0x1a')](function(_0xc48311){logger['error'](_0x7965('0x18'),_0xc48311[_0x7965('0x12')],_0x5e2154);_0xa5c0a0(_0x320f5e[_0x7965('0xf')](0x1f4,_0xc48311[_0x7965('0x12')]));});});};
\ No newline at end of file
index 8aac49e..2747acf 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(_0x262e54,_0x16e543){var _0x1e3b06=function(_0xbec1c){while(--_0xbec1c){_0x262e54['push'](_0x262e54['shift']());}};_0x1e3b06(++_0x16e543);}(_0xe706,0xa3));var _0x6e70=function(_0x28b3d7,_0x17b41d){_0x28b3d7=_0x28b3d7-0x0;var _0x49619d=_0xe706[_0x28b3d7];return _0x49619d;};'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 _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x3ffe1b,_0x2087ff){var _0x3cdd8e=function(_0xd946b){while(--_0xd946b){_0x3ffe1b['push'](_0x3ffe1b['shift']());}};_0x3cdd8e(++_0x2087ff);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
index dfba0e9..0fa9504 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1af=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x211c9f,_0x33f5e8){var _0x5070f3=function(_0x3eddf7){while(--_0x3eddf7){_0x211c9f['push'](_0x211c9f['shift']());}};_0x5070f3(++_0x33f5e8);}(_0xa1af,0x6b));var _0xfa1a=function(_0x2b1bdb,_0x18db1f){_0x2b1bdb=_0x2b1bdb-0x0;var _0x2b9f2e=_0xa1af[_0x2b1bdb];return _0x2b9f2e;};'use strict';var Sequelize=require(_0xfa1a('0x0'));module[_0xfa1a('0x1')]={'network':{'type':Sequelize[_0xfa1a('0x2')]},'network_script':{'type':Sequelize[_0xfa1a('0x2')]},'request':{'type':Sequelize[_0xfa1a('0x2')]},'channel':{'type':Sequelize[_0xfa1a('0x2')]},'language':{'type':Sequelize[_0xfa1a('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xfa1a('0x2')]},'callerid':{'type':Sequelize[_0xfa1a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xfa1a('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xfa1a('0x2')]},'rdnis':{'type':Sequelize[_0xfa1a('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xfa1a('0x2')]},'enhanced':{'type':Sequelize[_0xfa1a('0x2')]},'accountcode':{'type':Sequelize[_0xfa1a('0x2')]},'threadid':{'type':Sequelize[_0xfa1a('0x2')]},'project_name':{'type':Sequelize[_0xfa1a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfa1a('0x3')]},'bot':{'type':Sequelize[_0xfa1a('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe018=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xe018,0x7a));var _0x8e01=function(_0x458dd1,_0x1afcd8){_0x458dd1=_0x458dd1-0x0;var _0x590a36=_0xe018[_0x458dd1];return _0x590a36;};'use strict';var Sequelize=require(_0x8e01('0x0'));module[_0x8e01('0x1')]={'network':{'type':Sequelize[_0x8e01('0x2')]},'network_script':{'type':Sequelize[_0x8e01('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8e01('0x2')]},'language':{'type':Sequelize[_0x8e01('0x2')]},'type':{'type':Sequelize[_0x8e01('0x2')]},'uniqueid':{'type':Sequelize[_0x8e01('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8e01('0x2')]},'callingpres':{'type':Sequelize[_0x8e01('0x2')]},'callingani2':{'type':Sequelize[_0x8e01('0x2')]},'callington':{'type':Sequelize[_0x8e01('0x2')]},'callingtns':{'type':Sequelize[_0x8e01('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x8e01('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x8e01('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8e01('0x2')]},'threadid':{'type':Sequelize[_0x8e01('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8e01('0x3')]},'bot':{'type':Sequelize[_0x8e01('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 2327f8d..e7e9aed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1009=['rows','catch','show','params','options','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','send','map','SquareReport','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','includeAll','include','findAll'];(function(_0x31949c,_0x5112c2){var _0x16a18b=function(_0x3a4c4b){while(--_0x3a4c4b){_0x31949c['push'](_0x31949c['shift']());}};_0x16a18b(++_0x5112c2);}(_0x1009,0x1d3));var _0x9100=function(_0x42d110,_0xb0a690){_0x42d110=_0x42d110-0x0;var _0x5f1f47=_0x1009[_0x42d110];return _0x5f1f47;};'use strict';var emlformat=require(_0x9100('0x0'));var rimraf=require(_0x9100('0x1'));var zipdir=require(_0x9100('0x2'));var jsonpatch=require(_0x9100('0x3'));var rp=require(_0x9100('0x4'));var moment=require(_0x9100('0x5'));var BPromise=require(_0x9100('0x6'));var Mustache=require(_0x9100('0x7'));var util=require(_0x9100('0x8'));var path=require(_0x9100('0x9'));var sox=require(_0x9100('0xa'));var csv=require(_0x9100('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9100('0xc'));var _=require(_0x9100('0xd'));var squel=require(_0x9100('0xe'));var crypto=require(_0x9100('0xf'));var jsforce=require(_0x9100('0x10'));var deskjs=require(_0x9100('0x11'));var toCsv=require(_0x9100('0xb'));var querystring=require('querystring');var Papa=require(_0x9100('0x12'));var Redis=require(_0x9100('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9100('0x14'));var logger=require(_0x9100('0x15'))(_0x9100('0x16'));var utils=require('../../config/utils');var config=require(_0x9100('0x17'));var licenseUtil=require(_0x9100('0x18'));var db=require(_0x9100('0x19'))['db'];function respondWithStatusCode(_0x162db4,_0x536b90){_0x536b90=_0x536b90||0xcc;return function(_0x450650){if(_0x450650){return _0x162db4[_0x9100('0x1a')](_0x536b90);}return _0x162db4[_0x9100('0x1b')](_0x536b90)[_0x9100('0x1c')]();};}function respondWithResult(_0x3234ff,_0x270687){_0x270687=_0x270687||0xc8;return function(_0xfaf157){if(_0xfaf157){return _0x3234ff[_0x9100('0x1b')](_0x270687)[_0x9100('0x1d')](_0xfaf157);}};}function respondWithFilteredResult(_0x3fbb0d,_0x34b5c4){return function(_0x49286e){if(_0x49286e){var _0xf20f80=typeof _0x34b5c4[_0x9100('0x1e')]===_0x9100('0x1f')&&typeof _0x34b5c4[_0x9100('0x20')]==='undefined';var _0x2d994f=_0x49286e[_0x9100('0x21')];var _0xf8dd65=_0xf20f80?0x0:_0x34b5c4[_0x9100('0x1e')];var _0x49a7d4=_0xf20f80?_0x49286e[_0x9100('0x21')]:_0x34b5c4[_0x9100('0x1e')]+_0x34b5c4[_0x9100('0x20')];var _0x4e7c41;if(_0x49a7d4>=_0x2d994f){_0x49a7d4=_0x2d994f;_0x4e7c41=0xc8;}else{_0x4e7c41=0xce;}_0x3fbb0d['status'](_0x4e7c41);return _0x3fbb0d[_0x9100('0x22')](_0x9100('0x23'),_0xf8dd65+'-'+_0x49a7d4+'/'+_0x2d994f)[_0x9100('0x1d')](_0x49286e);}return null;};}function patchUpdates(_0x229cfd){return function(_0x29613b){try{jsonpatch['apply'](_0x29613b,_0x229cfd,!![]);}catch(_0x2a9d5a){return BPromise[_0x9100('0x24')](_0x2a9d5a);}return _0x29613b[_0x9100('0x25')]();};}function saveUpdates(_0x346e65,_0x5bcf4a){return function(_0x17344b){if(_0x17344b){return _0x17344b['update'](_0x346e65)[_0x9100('0x26')](function(_0x198239){return _0x198239;});}return null;};}function removeEntity(_0x3a73d4,_0x5bff19){return function(_0x536bf5){if(_0x536bf5){return _0x536bf5['destroy']()[_0x9100('0x26')](function(){_0x3a73d4[_0x9100('0x1b')](0xcc)[_0x9100('0x1c')]();});}};}function handleEntityNotFound(_0x750e83,_0x29e697){return function(_0x2f1a87){if(!_0x2f1a87){_0x750e83['sendStatus'](0x194);}return _0x2f1a87;};}function handleError(_0x497f82,_0x16afd7){_0x16afd7=_0x16afd7||0x1f4;return function(_0x393c71){logger['error'](_0x393c71['stack']);if(_0x393c71['name']){delete _0x393c71['name'];}_0x497f82[_0x9100('0x1b')](_0x16afd7)[_0x9100('0x27')](_0x393c71);};}exports['index']=function(_0x1baf07,_0xd76842){var _0x54a515={},_0x48695e={},_0x56400f={'count':0x0,'rows':[]};var _0x39522e=_[_0x9100('0x28')](db[_0x9100('0x29')][_0x9100('0x2a')],function(_0x591de9){return{'name':_0x591de9[_0x9100('0x2b')],'type':_0x591de9[_0x9100('0x2c')][_0x9100('0x2d')]};});_0x48695e[_0x9100('0x2e')]=_[_0x9100('0x28')](_0x39522e,_0x9100('0x2f'));_0x48695e['query']=_[_0x9100('0x30')](_0x1baf07[_0x9100('0x31')]);_0x48695e['filters']=_[_0x9100('0x32')](_0x48695e[_0x9100('0x2e')],_0x48695e[_0x9100('0x31')]);_0x54a515[_0x9100('0x33')]=_[_0x9100('0x32')](_0x48695e['model'],qs[_0x9100('0x34')](_0x1baf07[_0x9100('0x31')][_0x9100('0x34')]));_0x54a515[_0x9100('0x33')]=_0x54a515[_0x9100('0x33')][_0x9100('0x35')]?_0x54a515[_0x9100('0x33')]:_0x48695e[_0x9100('0x2e')];if(!_0x1baf07[_0x9100('0x31')]['hasOwnProperty'](_0x9100('0x36'))){_0x54a515[_0x9100('0x20')]=qs[_0x9100('0x20')](_0x1baf07[_0x9100('0x31')]['limit']);_0x54a515[_0x9100('0x1e')]=qs[_0x9100('0x1e')](_0x1baf07['query'][_0x9100('0x1e')]);}_0x54a515[_0x9100('0x37')]=qs[_0x9100('0x38')](_0x1baf07[_0x9100('0x31')][_0x9100('0x38')]);_0x54a515[_0x9100('0x39')]=qs[_0x9100('0x3a')](_['pick'](_0x1baf07[_0x9100('0x31')],_0x48695e[_0x9100('0x3a')]),_0x39522e);if(_0x1baf07[_0x9100('0x31')]['filter']){_0x54a515[_0x9100('0x39')]=_['merge'](_0x54a515[_0x9100('0x39')],{'$or':_[_0x9100('0x28')](_0x39522e,function(_0x264912){if(_0x264912[_0x9100('0x2c')]!==_0x9100('0x3b')){var _0xfa7ed5={};_0xfa7ed5[_0x264912[_0x9100('0x2f')]]={'$like':'%'+_0x1baf07['query'][_0x9100('0x3c')]+'%'};return _0xfa7ed5;}})});}_0x54a515=_[_0x9100('0x3d')]({},_0x54a515,_0x1baf07['options']);var _0x1daf2f={'where':_0x54a515[_0x9100('0x39')]};return db[_0x9100('0x29')]['count'](_0x1daf2f)['then'](function(_0x379628){_0x56400f[_0x9100('0x21')]=_0x379628;if(_0x1baf07[_0x9100('0x31')][_0x9100('0x3e')]){_0x54a515[_0x9100('0x3f')]=[{'all':!![]}];}return db[_0x9100('0x29')][_0x9100('0x40')](_0x54a515);})['then'](function(_0x4e2c94){_0x56400f[_0x9100('0x41')]=_0x4e2c94;return _0x56400f;})[_0x9100('0x26')](respondWithFilteredResult(_0xd76842,_0x54a515))[_0x9100('0x42')](handleError(_0xd76842,null));};exports[_0x9100('0x43')]=function(_0x300119,_0x2c9aff){var _0x51c8ef={'raw':!![],'where':{'id':_0x300119[_0x9100('0x44')]['id']}},_0x27529f={};_0x27529f[_0x9100('0x2e')]=_[_0x9100('0x30')](db['SquareReport'][_0x9100('0x2a')]);_0x27529f[_0x9100('0x31')]=_[_0x9100('0x30')](_0x300119[_0x9100('0x31')]);_0x27529f[_0x9100('0x3a')]=_[_0x9100('0x32')](_0x27529f['model'],_0x27529f['query']);_0x51c8ef['attributes']=_['intersection'](_0x27529f[_0x9100('0x2e')],qs[_0x9100('0x34')](_0x300119[_0x9100('0x31')][_0x9100('0x34')]));_0x51c8ef[_0x9100('0x33')]=_0x51c8ef[_0x9100('0x33')]['length']?_0x51c8ef['attributes']:_0x27529f[_0x9100('0x2e')];if(_0x300119[_0x9100('0x31')][_0x9100('0x3e')]){_0x51c8ef[_0x9100('0x3f')]=[{'all':!![]}];}_0x51c8ef=_[_0x9100('0x3d')]({},_0x51c8ef,_0x300119[_0x9100('0x45')]);return db[_0x9100('0x29')][_0x9100('0x46')](_0x51c8ef)[_0x9100('0x26')](handleEntityNotFound(_0x2c9aff,null))[_0x9100('0x26')](respondWithResult(_0x2c9aff,null))[_0x9100('0x42')](handleError(_0x2c9aff,null));};exports[_0x9100('0x47')]=function(_0x40a737,_0x2c2c1b){return db[_0x9100('0x29')][_0x9100('0x47')](_0x40a737[_0x9100('0x48')],{})[_0x9100('0x26')](respondWithResult(_0x2c2c1b,0xc9))[_0x9100('0x42')](handleError(_0x2c2c1b,null));};exports[_0x9100('0x49')]=function(_0x565e49,_0x3d0373){if(_0x565e49[_0x9100('0x48')]['id']){delete _0x565e49[_0x9100('0x48')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x565e49[_0x9100('0x44')]['id']}})[_0x9100('0x26')](handleEntityNotFound(_0x3d0373,null))['then'](saveUpdates(_0x565e49[_0x9100('0x48')],null))[_0x9100('0x26')](respondWithResult(_0x3d0373,null))[_0x9100('0x42')](handleError(_0x3d0373,null));};exports[_0x9100('0x4a')]=function(_0x2a0df8,_0x118ef0){return db[_0x9100('0x29')][_0x9100('0x46')]({'where':{'id':_0x2a0df8[_0x9100('0x44')]['id']}})[_0x9100('0x26')](handleEntityNotFound(_0x118ef0,null))['then'](removeEntity(_0x118ef0,null))[_0x9100('0x42')](handleError(_0x118ef0,null));};exports[_0x9100('0x4b')]=function(_0x276f6b,_0x33cba3){return db['SquareReport'][_0x9100('0x4b')]()[_0x9100('0x26')](respondWithResult(_0x33cba3,null))[_0x9100('0x42')](handleError(_0x33cba3,null));};
\ No newline at end of file
+var _0x0091=['rows','show','keys','length','include','find','catch','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','offset','set','reject','update','destroy','then','end','stack','name','send','index','map','SquareReport','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','count','findAll'];(function(_0x3275,_0x70abd2){var _0x5cdb49=function(_0x412105){while(--_0x412105){_0x3275['push'](_0x3275['shift']());}};_0x5cdb49(++_0x70abd2);}(_0x0091,0x9a));var _0x1009=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0091[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x1009('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1009('0x1'));var jsonpatch=require(_0x1009('0x2'));var rp=require(_0x1009('0x3'));var moment=require('moment');var BPromise=require(_0x1009('0x4'));var Mustache=require(_0x1009('0x5'));var util=require('util');var path=require(_0x1009('0x6'));var sox=require(_0x1009('0x7'));var csv=require(_0x1009('0x8'));var ejs=require(_0x1009('0x9'));var fs=require('fs');var fs_extra=require(_0x1009('0xa'));var _=require(_0x1009('0xb'));var squel=require(_0x1009('0xc'));var crypto=require('crypto');var jsforce=require(_0x1009('0xd'));var deskjs=require(_0x1009('0xe'));var toCsv=require(_0x1009('0x8'));var querystring=require('querystring');var Papa=require(_0x1009('0xf'));var Redis=require(_0x1009('0x10'));var authService=require(_0x1009('0x11'));var qs=require(_0x1009('0x12'));var as=require(_0x1009('0x13'));var hardwareService=require(_0x1009('0x14'));var logger=require(_0x1009('0x15'))('api');var utils=require(_0x1009('0x16'));var config=require(_0x1009('0x17'));var licenseUtil=require(_0x1009('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x267c12,_0x123ba3){_0x123ba3=_0x123ba3||0xcc;return function(_0x3e9121){if(_0x3e9121){return _0x267c12[_0x1009('0x19')](_0x123ba3);}return _0x267c12[_0x1009('0x1a')](_0x123ba3)['end']();};}function respondWithResult(_0x509830,_0x1df100){_0x1df100=_0x1df100||0xc8;return function(_0x596015){if(_0x596015){return _0x509830[_0x1009('0x1a')](_0x1df100)[_0x1009('0x1b')](_0x596015);}};}function respondWithFilteredResult(_0x316e53,_0x569e79){return function(_0x585276){if(_0x585276){var _0x2a883c=typeof _0x569e79['offset']==='undefined'&&typeof _0x569e79[_0x1009('0x1c')]===_0x1009('0x1d');var _0x5205e1=_0x585276['count'];var _0x2ddea7=_0x2a883c?0x0:_0x569e79[_0x1009('0x1e')];var _0x3c0dde=_0x2a883c?_0x585276['count']:_0x569e79[_0x1009('0x1e')]+_0x569e79[_0x1009('0x1c')];var _0x148b6f;if(_0x3c0dde>=_0x5205e1){_0x3c0dde=_0x5205e1;_0x148b6f=0xc8;}else{_0x148b6f=0xce;}_0x316e53[_0x1009('0x1a')](_0x148b6f);return _0x316e53[_0x1009('0x1f')]('Content-Range',_0x2ddea7+'-'+_0x3c0dde+'/'+_0x5205e1)[_0x1009('0x1b')](_0x585276);}return null;};}function patchUpdates(_0xf60690){return function(_0x3dca78){try{jsonpatch['apply'](_0x3dca78,_0xf60690,!![]);}catch(_0xe06434){return BPromise[_0x1009('0x20')](_0xe06434);}return _0x3dca78['save']();};}function saveUpdates(_0x5ca9f3,_0x3b8554){return function(_0x701961){if(_0x701961){return _0x701961[_0x1009('0x21')](_0x5ca9f3)['then'](function(_0x11a9df){return _0x11a9df;});}return null;};}function removeEntity(_0x1f0986,_0x371630){return function(_0x548b5d){if(_0x548b5d){return _0x548b5d[_0x1009('0x22')]()[_0x1009('0x23')](function(){_0x1f0986[_0x1009('0x1a')](0xcc)[_0x1009('0x24')]();});}};}function handleEntityNotFound(_0x4e262f,_0x24ba72){return function(_0xf3c216){if(!_0xf3c216){_0x4e262f[_0x1009('0x19')](0x194);}return _0xf3c216;};}function handleError(_0x555f9a,_0x2de478){_0x2de478=_0x2de478||0x1f4;return function(_0x174fd8){logger['error'](_0x174fd8[_0x1009('0x25')]);if(_0x174fd8[_0x1009('0x26')]){delete _0x174fd8['name'];}_0x555f9a[_0x1009('0x1a')](_0x2de478)[_0x1009('0x27')](_0x174fd8);};}exports[_0x1009('0x28')]=function(_0x35ea05,_0x496dbf){var _0x268c14={},_0x57ac0e={},_0x53face={'count':0x0,'rows':[]};var _0x4e7e8a=_[_0x1009('0x29')](db[_0x1009('0x2a')][_0x1009('0x2b')],function(_0xd8c55c){return{'name':_0xd8c55c['fieldName'],'type':_0xd8c55c[_0x1009('0x2c')][_0x1009('0x2d')]};});_0x57ac0e['model']=_[_0x1009('0x29')](_0x4e7e8a,_0x1009('0x26'));_0x57ac0e[_0x1009('0x2e')]=_['keys'](_0x35ea05['query']);_0x57ac0e[_0x1009('0x2f')]=_[_0x1009('0x30')](_0x57ac0e[_0x1009('0x31')],_0x57ac0e[_0x1009('0x2e')]);_0x268c14['attributes']=_['intersection'](_0x57ac0e[_0x1009('0x31')],qs[_0x1009('0x32')](_0x35ea05[_0x1009('0x2e')][_0x1009('0x32')]));_0x268c14[_0x1009('0x33')]=_0x268c14[_0x1009('0x33')]['length']?_0x268c14[_0x1009('0x33')]:_0x57ac0e[_0x1009('0x31')];if(!_0x35ea05[_0x1009('0x2e')][_0x1009('0x34')](_0x1009('0x35'))){_0x268c14['limit']=qs['limit'](_0x35ea05['query'][_0x1009('0x1c')]);_0x268c14[_0x1009('0x1e')]=qs[_0x1009('0x1e')](_0x35ea05[_0x1009('0x2e')][_0x1009('0x1e')]);}_0x268c14[_0x1009('0x36')]=qs['sort'](_0x35ea05['query'][_0x1009('0x37')]);_0x268c14[_0x1009('0x38')]=qs[_0x1009('0x2f')](_['pick'](_0x35ea05[_0x1009('0x2e')],_0x57ac0e['filters']),_0x4e7e8a);if(_0x35ea05[_0x1009('0x2e')]['filter']){_0x268c14[_0x1009('0x38')]=_['merge'](_0x268c14[_0x1009('0x38')],{'$or':_[_0x1009('0x29')](_0x4e7e8a,function(_0x11782c){if(_0x11782c[_0x1009('0x2c')]!==_0x1009('0x39')){var _0x50b200={};_0x50b200[_0x11782c[_0x1009('0x26')]]={'$like':'%'+_0x35ea05[_0x1009('0x2e')]['filter']+'%'};return _0x50b200;}})});}_0x268c14=_[_0x1009('0x3a')]({},_0x268c14,_0x35ea05[_0x1009('0x3b')]);var _0xc49588={'where':_0x268c14[_0x1009('0x38')]};return db[_0x1009('0x2a')][_0x1009('0x3c')](_0xc49588)[_0x1009('0x23')](function(_0x34f845){_0x53face[_0x1009('0x3c')]=_0x34f845;if(_0x35ea05[_0x1009('0x2e')]['includeAll']){_0x268c14['include']=[{'all':!![]}];}return db[_0x1009('0x2a')][_0x1009('0x3d')](_0x268c14);})[_0x1009('0x23')](function(_0x379d53){_0x53face[_0x1009('0x3e')]=_0x379d53;return _0x53face;})[_0x1009('0x23')](respondWithFilteredResult(_0x496dbf,_0x268c14))['catch'](handleError(_0x496dbf,null));};exports[_0x1009('0x3f')]=function(_0x3c0504,_0x299d66){var _0x226203={'raw':!![],'where':{'id':_0x3c0504['params']['id']}},_0x20500f={};_0x20500f['model']=_[_0x1009('0x40')](db[_0x1009('0x2a')][_0x1009('0x2b')]);_0x20500f[_0x1009('0x2e')]=_[_0x1009('0x40')](_0x3c0504[_0x1009('0x2e')]);_0x20500f['filters']=_['intersection'](_0x20500f[_0x1009('0x31')],_0x20500f[_0x1009('0x2e')]);_0x226203['attributes']=_[_0x1009('0x30')](_0x20500f[_0x1009('0x31')],qs[_0x1009('0x32')](_0x3c0504[_0x1009('0x2e')][_0x1009('0x32')]));_0x226203['attributes']=_0x226203[_0x1009('0x33')][_0x1009('0x41')]?_0x226203[_0x1009('0x33')]:_0x20500f[_0x1009('0x31')];if(_0x3c0504[_0x1009('0x2e')]['includeAll']){_0x226203[_0x1009('0x42')]=[{'all':!![]}];}_0x226203=_[_0x1009('0x3a')]({},_0x226203,_0x3c0504['options']);return db['SquareReport'][_0x1009('0x43')](_0x226203)[_0x1009('0x23')](handleEntityNotFound(_0x299d66,null))[_0x1009('0x23')](respondWithResult(_0x299d66,null))['catch'](handleError(_0x299d66,null));};exports['create']=function(_0x239f07,_0x4e8219){return db[_0x1009('0x2a')]['create'](_0x239f07['body'],{})['then'](respondWithResult(_0x4e8219,0xc9))[_0x1009('0x44')](handleError(_0x4e8219,null));};exports['update']=function(_0x21ddb8,_0xec0632){if(_0x21ddb8['body']['id']){delete _0x21ddb8[_0x1009('0x45')]['id'];}return db['SquareReport'][_0x1009('0x43')]({'where':{'id':_0x21ddb8['params']['id']}})['then'](handleEntityNotFound(_0xec0632,null))['then'](saveUpdates(_0x21ddb8[_0x1009('0x45')],null))[_0x1009('0x23')](respondWithResult(_0xec0632,null))[_0x1009('0x44')](handleError(_0xec0632,null));};exports[_0x1009('0x22')]=function(_0x1b4a52,_0x1eba06){return db[_0x1009('0x2a')][_0x1009('0x43')]({'where':{'id':_0x1b4a52[_0x1009('0x46')]['id']}})[_0x1009('0x23')](handleEntityNotFound(_0x1eba06,null))['then'](removeEntity(_0x1eba06,null))[_0x1009('0x44')](handleError(_0x1eba06,null));};exports[_0x1009('0x47')]=function(_0x5a7cc1,_0x1e42ba){return db[_0x1009('0x2a')][_0x1009('0x47')]()['then'](respondWithResult(_0x1e42ba,null))['catch'](handleError(_0x1e42ba,null));};
\ No newline at end of file
index 80dbd91..fa736a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e34=['SquareReport','uid_pname','uniqueid','project_name','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define'];(function(_0x46558e,_0x499b36){var _0x373ea2=function(_0x231a56){while(--_0x231a56){_0x46558e['push'](_0x46558e['shift']());}};_0x373ea2(++_0x499b36);}(_0x8e34,0xac));var _0x48e3=function(_0x48b12f,_0x281609){_0x48b12f=_0x48b12f-0x0;var _0x4f455e=_0x8e34[_0x48b12f];return _0x4f455e;};'use strict';var _=require(_0x48e3('0x0'));var util=require(_0x48e3('0x1'));var logger=require(_0x48e3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x48e3('0x3'));var rp=require(_0x48e3('0x4'));var fs=require('fs');var path=require(_0x48e3('0x5'));var rimraf=require(_0x48e3('0x6'));var config=require(_0x48e3('0x7'));var attributes=require(_0x48e3('0x8'));module['exports']=function(_0x2fd4d9,_0x337dae){return _0x2fd4d9[_0x48e3('0x9')](_0x48e3('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x48e3('0xb'),'fields':[_0x48e3('0xc'),_0x48e3('0xd')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e2e=['./squareReport.attributes','define','SquareReport','report_square','uniqueid','project_name','leaveAt','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3bd56e,_0x2cfed2){var _0x59fb3b=function(_0x377a7a){while(--_0x377a7a){_0x3bd56e['push'](_0x3bd56e['shift']());}};_0x59fb3b(++_0x2cfed2);}(_0x0e2e,0x18d));var _0xe0e2=function(_0x3320f1,_0x412195){_0x3320f1=_0x3320f1-0x0;var _0x111f83=_0x0e2e[_0x3320f1];return _0x111f83;};'use strict';var _=require(_0xe0e2('0x0'));var util=require(_0xe0e2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe0e2('0x2'));var BPromise=require(_0xe0e2('0x3'));var rp=require(_0xe0e2('0x4'));var fs=require('fs');var path=require(_0xe0e2('0x5'));var rimraf=require(_0xe0e2('0x6'));var config=require(_0xe0e2('0x7'));var attributes=require(_0xe0e2('0x8'));module['exports']=function(_0x4dfe03,_0x38b568){return _0x4dfe03[_0xe0e2('0x9')](_0xe0e2('0xa'),attributes,{'tableName':_0xe0e2('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xe0e2('0xc'),_0xe0e2('0xd')]},{'name':_0xe0e2('0xe'),'fields':[_0xe0e2('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index d374e8c..dd3022f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cdf=['code','message','result','CreateSquareReport','SquareReport','create','options','raw','info','catch','update','body','where','attributes','limit','UpdateSquareReport','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3d63f6,_0x8cd7e4){var _0x2ac67b=function(_0x4dd921){while(--_0x4dd921){_0x3d63f6['push'](_0x3d63f6['shift']());}};_0x2ac67b(++_0x8cd7e4);}(_0x0cdf,0x146));var _0xf0cd=function(_0x2567f1,_0x16d4c1){_0x2567f1=_0x2567f1-0x0;var _0x8a4cda=_0x0cdf[_0x2567f1];return _0x8a4cda;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf0cd('0x0'));var BPromise=require(_0xf0cd('0x1'));var rs=require(_0xf0cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0cd('0x3'))['db'];var utils=require(_0xf0cd('0x4'));var logger=require(_0xf0cd('0x5'))(_0xf0cd('0x6'));var config=require(_0xf0cd('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ad222,_0x5cc068,_0x58e579){return new BPromise(function(_0x380731,_0x4da6a0){return client['request'](_0x2ad222,_0x58e579)[_0xf0cd('0x8')](function(_0x1f8685){logger['info'](_0xf0cd('0x9'),_0x5cc068,_0xf0cd('0xa'));logger[_0xf0cd('0xb')](_0xf0cd('0xc'),_0x5cc068,'request\x20sent',JSON[_0xf0cd('0xd')](_0x1f8685));if(_0x1f8685[_0xf0cd('0xe')]){if(_0x1f8685[_0xf0cd('0xe')][_0xf0cd('0xf')]===0x1f4){logger[_0xf0cd('0xe')](_0xf0cd('0x9'),_0x5cc068,_0x1f8685[_0xf0cd('0xe')][_0xf0cd('0x10')]);return _0x4da6a0(_0x1f8685['error']['message']);}logger['error'](_0xf0cd('0x9'),_0x5cc068,_0x1f8685[_0xf0cd('0xe')]['message']);return _0x380731(_0x1f8685[_0xf0cd('0xe')][_0xf0cd('0x10')]);}else{logger['info'](_0xf0cd('0x9'),_0x5cc068,_0xf0cd('0xa'));_0x380731(_0x1f8685[_0xf0cd('0x11')]['message']);}})['catch'](function(_0x10eb07){logger[_0xf0cd('0xe')](_0xf0cd('0x9'),_0x5cc068,_0x10eb07);_0x4da6a0(_0x10eb07);});});}exports[_0xf0cd('0x12')]=function(_0x186596){var _0x268e3a=this;return new Promise(function(_0x30c487,_0x1488a6){return db[_0xf0cd('0x13')][_0xf0cd('0x14')](_0x186596['body'],{'raw':_0x186596[_0xf0cd('0x15')]?_0x186596[_0xf0cd('0x15')][_0xf0cd('0x16')]===undefined?!![]:![]:!![]})[_0xf0cd('0x8')](function(_0x3dbf6e){logger[_0xf0cd('0x17')](_0xf0cd('0x12'),_0x186596);logger[_0xf0cd('0xb')](_0xf0cd('0x12'),_0x186596,JSON[_0xf0cd('0xd')](_0x3dbf6e));_0x30c487(_0x3dbf6e);})[_0xf0cd('0x18')](function(_0x18c202){logger[_0xf0cd('0xe')](_0xf0cd('0x12'),_0x18c202[_0xf0cd('0x10')],_0x186596);_0x1488a6(_0x268e3a[_0xf0cd('0xe')](0x1f4,_0x18c202['message']));});});};exports['UpdateSquareReport']=function(_0x21ff5e){var _0xe6811=this;return new Promise(function(_0x14aab6,_0x154d35){return db[_0xf0cd('0x13')][_0xf0cd('0x19')](_0x21ff5e[_0xf0cd('0x1a')],{'raw':_0x21ff5e[_0xf0cd('0x15')]?_0x21ff5e[_0xf0cd('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21ff5e['options']?_0x21ff5e[_0xf0cd('0x15')][_0xf0cd('0x1b')]||null:null,'attributes':_0x21ff5e[_0xf0cd('0x15')]?_0x21ff5e[_0xf0cd('0x15')][_0xf0cd('0x1c')]||null:null,'limit':_0x21ff5e[_0xf0cd('0x15')]?_0x21ff5e[_0xf0cd('0x15')][_0xf0cd('0x1d')]||null:null})[_0xf0cd('0x8')](function(_0x51e16a){logger[_0xf0cd('0x17')](_0xf0cd('0x1e'),_0x21ff5e);logger[_0xf0cd('0xb')](_0xf0cd('0x1e'),_0x21ff5e,JSON[_0xf0cd('0xd')](_0x51e16a));_0x14aab6(_0x51e16a);})['catch'](function(_0xed99ef){logger[_0xf0cd('0xe')](_0xf0cd('0x1e'),_0xed99ef[_0xf0cd('0x10')],_0x21ff5e);_0x154d35(_0xe6811[_0xf0cd('0xe')](0x1f4,_0xed99ef['message']));});});};
\ No newline at end of file
+var _0x34bd=['CreateSquareReport','debug','update','body','where','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','SquareReport','options','raw'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0x34bd,0x173));var _0xd34b=function(_0x1c413e,_0x51788b){_0x1c413e=_0x1c413e-0x0;var _0x1d8309=_0x34bd[_0x1c413e];return _0x1d8309;};'use strict';var _=require(_0xd34b('0x0'));var util=require(_0xd34b('0x1'));var moment=require(_0xd34b('0x2'));var BPromise=require(_0xd34b('0x3'));var rs=require(_0xd34b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd34b('0x5'));var logger=require(_0xd34b('0x6'))('rpc');var config=require(_0xd34b('0x7'));var jayson=require(_0xd34b('0x8'));var client=jayson[_0xd34b('0x9')][_0xd34b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa2d5db,_0x51f3a3,_0x177434){return new BPromise(function(_0x55b9b8,_0x20204c){return client[_0xd34b('0xb')](_0xa2d5db,_0x177434)[_0xd34b('0xc')](function(_0x350b24){logger[_0xd34b('0xd')]('SquareReport,\x20%s,\x20%s',_0x51f3a3,'request\x20sent');logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x51f3a3,_0xd34b('0xe'),JSON[_0xd34b('0xf')](_0x350b24));if(_0x350b24[_0xd34b('0x10')]){if(_0x350b24[_0xd34b('0x10')][_0xd34b('0x11')]===0x1f4){logger[_0xd34b('0x10')](_0xd34b('0x12'),_0x51f3a3,_0x350b24['error']['message']);return _0x20204c(_0x350b24[_0xd34b('0x10')][_0xd34b('0x13')]);}logger[_0xd34b('0x10')](_0xd34b('0x12'),_0x51f3a3,_0x350b24['error'][_0xd34b('0x13')]);return _0x55b9b8(_0x350b24[_0xd34b('0x10')][_0xd34b('0x13')]);}else{logger[_0xd34b('0xd')]('SquareReport,\x20%s,\x20%s',_0x51f3a3,_0xd34b('0xe'));_0x55b9b8(_0x350b24[_0xd34b('0x14')][_0xd34b('0x13')]);}})[_0xd34b('0x15')](function(_0x1b4416){logger['error'](_0xd34b('0x12'),_0x51f3a3,_0x1b4416);_0x20204c(_0x1b4416);});});}exports['CreateSquareReport']=function(_0x356bbe){var _0x5a8031=this;return new Promise(function(_0x3e89e9,_0x597024){return db[_0xd34b('0x16')]['create'](_0x356bbe['body'],{'raw':_0x356bbe[_0xd34b('0x17')]?_0x356bbe[_0xd34b('0x17')][_0xd34b('0x18')]===undefined?!![]:![]:!![]})[_0xd34b('0xc')](function(_0xe59524){logger[_0xd34b('0xd')](_0xd34b('0x19'),_0x356bbe);logger[_0xd34b('0x1a')](_0xd34b('0x19'),_0x356bbe,JSON['stringify'](_0xe59524));_0x3e89e9(_0xe59524);})[_0xd34b('0x15')](function(_0x25bdab){logger[_0xd34b('0x10')](_0xd34b('0x19'),_0x25bdab[_0xd34b('0x13')],_0x356bbe);_0x597024(_0x5a8031[_0xd34b('0x10')](0x1f4,_0x25bdab[_0xd34b('0x13')]));});});};exports['UpdateSquareReport']=function(_0x4a92f4){var _0x5d0da5=this;return new Promise(function(_0x6ebc6f,_0x5875e5){return db[_0xd34b('0x16')][_0xd34b('0x1b')](_0x4a92f4[_0xd34b('0x1c')],{'raw':_0x4a92f4[_0xd34b('0x17')]?_0x4a92f4[_0xd34b('0x17')][_0xd34b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a92f4['options']?_0x4a92f4['options'][_0xd34b('0x1d')]||null:null,'attributes':_0x4a92f4['options']?_0x4a92f4[_0xd34b('0x17')][_0xd34b('0x1e')]||null:null,'limit':_0x4a92f4['options']?_0x4a92f4[_0xd34b('0x17')][_0xd34b('0x1f')]||null:null})[_0xd34b('0xc')](function(_0x45e530){logger[_0xd34b('0xd')](_0xd34b('0x20'),_0x4a92f4);logger[_0xd34b('0x1a')](_0xd34b('0x20'),_0x4a92f4,JSON[_0xd34b('0xf')](_0x45e530));_0x6ebc6f(_0x45e530);})[_0xd34b('0x15')](function(_0x2c6d87){logger[_0xd34b('0x10')](_0xd34b('0x20'),_0x2c6d87[_0xd34b('0x13')],_0x4a92f4);_0x5875e5(_0x5d0da5[_0xd34b('0x10')](0x1f4,_0x2c6d87[_0xd34b('0x13')]));});});};
\ No newline at end of file
index 3359b28..488fc36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb179=['create','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','get','/describe','/:id','show','post'];(function(_0x55ef89,_0x2f7eff){var _0x143826=function(_0x8016c5){while(--_0x8016c5){_0x55ef89['push'](_0x55ef89['shift']());}};_0x143826(++_0x2f7eff);}(_0xb179,0x1ea));var _0x9b17=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb179[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x9b17('0x0'));var path=require(_0x9b17('0x1'));var timeout=require(_0x9b17('0x2'));var express=require('express');var router=express[_0x9b17('0x3')]();var fs_extra=require(_0x9b17('0x4'));var auth=require(_0x9b17('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9b17('0x6'));var controller=require(_0x9b17('0x7'));router['get']('/',auth[_0x9b17('0x8')](),controller['index']);router[_0x9b17('0x9')](_0x9b17('0xa'),auth[_0x9b17('0x8')](),controller['describe']);router['get'](_0x9b17('0xb'),auth[_0x9b17('0x8')](),controller[_0x9b17('0xc')]);router[_0x9b17('0xd')]('/',auth['isAuthenticated'](),controller[_0x9b17('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9b17('0xf')]);router[_0x9b17('0x10')](_0x9b17('0xb'),auth[_0x9b17('0x8')](),controller['destroy']);module[_0x9b17('0x11')]=router;
\ No newline at end of file
+var _0xd0a7=['../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x42ad82,_0x3e615b){var _0x13ce0c=function(_0x5dd5f4){while(--_0x5dd5f4){_0x42ad82['push'](_0x42ad82['shift']());}};_0x13ce0c(++_0x3e615b);}(_0xd0a7,0x19d));var _0x7d0a=function(_0x922d7d,_0xc843df){_0x922d7d=_0x922d7d-0x0;var _0x295e5b=_0xd0a7[_0x922d7d];return _0x295e5b;};'use strict';var multer=require(_0x7d0a('0x0'));var util=require(_0x7d0a('0x1'));var path=require(_0x7d0a('0x2'));var timeout=require(_0x7d0a('0x3'));var express=require(_0x7d0a('0x4'));var router=express[_0x7d0a('0x5')]();var fs_extra=require(_0x7d0a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7d0a('0x7'));var config=require(_0x7d0a('0x8'));var controller=require(_0x7d0a('0x9'));router[_0x7d0a('0xa')]('/',auth[_0x7d0a('0xb')](),controller['index']);router[_0x7d0a('0xa')](_0x7d0a('0xc'),auth['isAuthenticated'](),controller[_0x7d0a('0xd')]);router['get'](_0x7d0a('0xe'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0xf')]);router[_0x7d0a('0x10')]('/',auth[_0x7d0a('0xb')](),controller['create']);router[_0x7d0a('0x11')](_0x7d0a('0xe'),auth[_0x7d0a('0xb')](),controller[_0x7d0a('0x12')]);router[_0x7d0a('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7d0a('0x14')]);module['exports']=router;
\ No newline at end of file
index 6c7f066..f1ef1ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc7a=['sequelize','exports','STRING','TEXT'];(function(_0x359d3e,_0x9d9e5b){var _0x533931=function(_0x553875){while(--_0x553875){_0x359d3e['push'](_0x359d3e['shift']());}};_0x533931(++_0x9d9e5b);}(_0xdc7a,0x1a8));var _0xadc7=function(_0xaf2427,_0x504859){_0xaf2427=_0xaf2427-0x0;var _0x67addb=_0xdc7a[_0xaf2427];return _0x67addb;};'use strict';var Sequelize=require(_0xadc7('0x0'));module[_0xadc7('0x1')]={'uniqueid':{'type':Sequelize[_0xadc7('0x2')]},'node':{'type':Sequelize[_0xadc7('0x2')]},'application':{'type':Sequelize[_0xadc7('0x2')]},'data':{'type':Sequelize[_0xadc7('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6c47=['sequelize','exports','STRING','TEXT'];(function(_0x196995,_0x2575dd){var _0x1ff73a=function(_0x4b6aeb){while(--_0x4b6aeb){_0x196995['push'](_0x196995['shift']());}};_0x1ff73a(++_0x2575dd);}(_0x6c47,0x188));var _0x76c4=function(_0xa0fe18,_0x4f95d1){_0xa0fe18=_0xa0fe18-0x0;var _0x22befb=_0x6c47[_0xa0fe18];return _0x22befb;};'use strict';var Sequelize=require(_0x76c4('0x0'));module[_0x76c4('0x1')]={'uniqueid':{'type':Sequelize[_0x76c4('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x76c4('0x3')]},'project_name':{'type':Sequelize[_0x76c4('0x2')]},'callerid':{'type':Sequelize[_0x76c4('0x2')]}};
\ No newline at end of file
index b686478..359f552 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x160b=['end','status','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','error','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x160b,0xc5));var _0xb160=function(_0x4edcf6,_0x51253b){_0x4edcf6=_0x4edcf6-0x0;var _0xa9bfac=_0x160b[_0x4edcf6];return _0xa9bfac;};'use strict';var emlformat=require(_0xb160('0x0'));var rimraf=require(_0xb160('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb160('0x2'));var rp=require(_0xb160('0x3'));var moment=require(_0xb160('0x4'));var BPromise=require(_0xb160('0x5'));var Mustache=require(_0xb160('0x6'));var util=require(_0xb160('0x7'));var path=require(_0xb160('0x8'));var sox=require('sox');var csv=require(_0xb160('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb160('0xa'));var squel=require(_0xb160('0xb'));var crypto=require(_0xb160('0xc'));var jsforce=require(_0xb160('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb160('0x9'));var querystring=require(_0xb160('0xe'));var Papa=require(_0xb160('0xf'));var Redis=require('ioredis');var authService=require(_0xb160('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb160('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb160('0x12'))(_0xb160('0x13'));var utils=require(_0xb160('0x14'));var config=require(_0xb160('0x15'));var licenseUtil=require(_0xb160('0x16'));var db=require(_0xb160('0x17'))['db'];function respondWithStatusCode(_0x2bf719,_0x2ddc27){_0x2ddc27=_0x2ddc27||0xcc;return function(_0x3470){if(_0x3470){return _0x2bf719[_0xb160('0x18')](_0x2ddc27);}return _0x2bf719['status'](_0x2ddc27)[_0xb160('0x19')]();};}function respondWithResult(_0x77c8af,_0x45c433){_0x45c433=_0x45c433||0xc8;return function(_0x4e34f8){if(_0x4e34f8){return _0x77c8af[_0xb160('0x1a')](_0x45c433)['json'](_0x4e34f8);}};}function respondWithFilteredResult(_0x533092,_0x479a24){return function(_0x10fad5){if(_0x10fad5){var _0x463837=typeof _0x479a24[_0xb160('0x1b')]===_0xb160('0x1c')&&typeof _0x479a24['limit']==='undefined';var _0x11dfb1=_0x10fad5[_0xb160('0x1d')];var _0x2bf018=_0x463837?0x0:_0x479a24[_0xb160('0x1b')];var _0x4bb236=_0x463837?_0x10fad5[_0xb160('0x1d')]:_0x479a24[_0xb160('0x1b')]+_0x479a24[_0xb160('0x1e')];var _0x19d382;if(_0x4bb236>=_0x11dfb1){_0x4bb236=_0x11dfb1;_0x19d382=0xc8;}else{_0x19d382=0xce;}_0x533092[_0xb160('0x1a')](_0x19d382);return _0x533092['set'](_0xb160('0x1f'),_0x2bf018+'-'+_0x4bb236+'/'+_0x11dfb1)[_0xb160('0x20')](_0x10fad5);}return null;};}function patchUpdates(_0x1a5797){return function(_0x4cc552){try{jsonpatch['apply'](_0x4cc552,_0x1a5797,!![]);}catch(_0x4395c8){return BPromise[_0xb160('0x21')](_0x4395c8);}return _0x4cc552[_0xb160('0x22')]();};}function saveUpdates(_0x3365a1,_0x3b78f6){return function(_0x443455){if(_0x443455){return _0x443455[_0xb160('0x23')](_0x3365a1)[_0xb160('0x24')](function(_0x277b76){return _0x277b76;});}return null;};}function removeEntity(_0x6e60cc,_0x24b293){return function(_0x42c7df){if(_0x42c7df){return _0x42c7df['destroy']()[_0xb160('0x24')](function(){_0x6e60cc['status'](0xcc)[_0xb160('0x19')]();});}};}function handleEntityNotFound(_0x4cce43,_0x7cff2f){return function(_0x1b0750){if(!_0x1b0750){_0x4cce43[_0xb160('0x18')](0x194);}return _0x1b0750;};}function handleError(_0x32523e,_0x245b1d){_0x245b1d=_0x245b1d||0x1f4;return function(_0x26e425){logger[_0xb160('0x25')](_0x26e425['stack']);if(_0x26e425[_0xb160('0x26')]){delete _0x26e425[_0xb160('0x26')];}_0x32523e[_0xb160('0x1a')](_0x245b1d)[_0xb160('0x27')](_0x26e425);};}exports[_0xb160('0x28')]=function(_0x6c958,_0x298ec0){var _0x174fde={},_0x37323a={},_0x168e1e={'count':0x0,'rows':[]};var _0x5eaba0=_['map'](db[_0xb160('0x29')][_0xb160('0x2a')],function(_0x221d98){return{'name':_0x221d98[_0xb160('0x2b')],'type':_0x221d98[_0xb160('0x2c')][_0xb160('0x2d')]};});_0x37323a[_0xb160('0x2e')]=_[_0xb160('0x2f')](_0x5eaba0,_0xb160('0x26'));_0x37323a[_0xb160('0x30')]=_['keys'](_0x6c958[_0xb160('0x30')]);_0x37323a[_0xb160('0x31')]=_[_0xb160('0x32')](_0x37323a['model'],_0x37323a[_0xb160('0x30')]);_0x174fde[_0xb160('0x33')]=_[_0xb160('0x32')](_0x37323a[_0xb160('0x2e')],qs[_0xb160('0x34')](_0x6c958[_0xb160('0x30')][_0xb160('0x34')]));_0x174fde[_0xb160('0x33')]=_0x174fde[_0xb160('0x33')][_0xb160('0x35')]?_0x174fde[_0xb160('0x33')]:_0x37323a['model'];if(!_0x6c958[_0xb160('0x30')][_0xb160('0x36')](_0xb160('0x37'))){_0x174fde[_0xb160('0x1e')]=qs[_0xb160('0x1e')](_0x6c958[_0xb160('0x30')]['limit']);_0x174fde[_0xb160('0x1b')]=qs[_0xb160('0x1b')](_0x6c958[_0xb160('0x30')][_0xb160('0x1b')]);}_0x174fde[_0xb160('0x38')]=qs['sort'](_0x6c958[_0xb160('0x30')][_0xb160('0x39')]);_0x174fde[_0xb160('0x3a')]=qs[_0xb160('0x31')](_[_0xb160('0x3b')](_0x6c958[_0xb160('0x30')],_0x37323a[_0xb160('0x31')]),_0x5eaba0);if(_0x6c958[_0xb160('0x30')][_0xb160('0x3c')]){_0x174fde['where']=_[_0xb160('0x3d')](_0x174fde[_0xb160('0x3a')],{'$or':_[_0xb160('0x2f')](_0x5eaba0,function(_0x254317){if(_0x254317['type']!==_0xb160('0x3e')){var _0x10702a={};_0x10702a[_0x254317[_0xb160('0x26')]]={'$like':'%'+_0x6c958[_0xb160('0x30')][_0xb160('0x3c')]+'%'};return _0x10702a;}})});}_0x174fde=_['merge']({},_0x174fde,_0x6c958[_0xb160('0x3f')]);var _0x252e4f={'where':_0x174fde['where']};return db[_0xb160('0x29')][_0xb160('0x1d')](_0x252e4f)['then'](function(_0x3f7bb8){_0x168e1e['count']=_0x3f7bb8;if(_0x6c958[_0xb160('0x30')][_0xb160('0x40')]){_0x174fde[_0xb160('0x41')]=[{'all':!![]}];}return db[_0xb160('0x29')][_0xb160('0x42')](_0x174fde);})[_0xb160('0x24')](function(_0x44305d){_0x168e1e['rows']=_0x44305d;return _0x168e1e;})[_0xb160('0x24')](respondWithFilteredResult(_0x298ec0,_0x174fde))[_0xb160('0x43')](handleError(_0x298ec0,null));};exports[_0xb160('0x44')]=function(_0x155748,_0x3a7800){var _0x301661={'raw':!![],'where':{'id':_0x155748[_0xb160('0x45')]['id']}},_0x4a008d={};_0x4a008d['model']=_[_0xb160('0x46')](db['SquareDetailsReport']['rawAttributes']);_0x4a008d[_0xb160('0x30')]=_[_0xb160('0x46')](_0x155748[_0xb160('0x30')]);_0x4a008d[_0xb160('0x31')]=_['intersection'](_0x4a008d['model'],_0x4a008d[_0xb160('0x30')]);_0x301661[_0xb160('0x33')]=_[_0xb160('0x32')](_0x4a008d[_0xb160('0x2e')],qs[_0xb160('0x34')](_0x155748['query'][_0xb160('0x34')]));_0x301661['attributes']=_0x301661['attributes'][_0xb160('0x35')]?_0x301661[_0xb160('0x33')]:_0x4a008d[_0xb160('0x2e')];if(_0x155748['query'][_0xb160('0x40')]){_0x301661[_0xb160('0x41')]=[{'all':!![]}];}_0x301661=_[_0xb160('0x3d')]({},_0x301661,_0x155748[_0xb160('0x3f')]);return db[_0xb160('0x29')][_0xb160('0x47')](_0x301661)[_0xb160('0x24')](handleEntityNotFound(_0x3a7800,null))['then'](respondWithResult(_0x3a7800,null))[_0xb160('0x43')](handleError(_0x3a7800,null));};exports['create']=function(_0x8d7796,_0x2e99ae){return db[_0xb160('0x29')]['create'](_0x8d7796[_0xb160('0x48')],{})['then'](respondWithResult(_0x2e99ae,0xc9))[_0xb160('0x43')](handleError(_0x2e99ae,null));};exports['update']=function(_0x560b90,_0x3887fe){if(_0x560b90[_0xb160('0x48')]['id']){delete _0x560b90['body']['id'];}return db[_0xb160('0x29')]['find']({'where':{'id':_0x560b90[_0xb160('0x45')]['id']}})['then'](handleEntityNotFound(_0x3887fe,null))['then'](saveUpdates(_0x560b90[_0xb160('0x48')],null))[_0xb160('0x24')](respondWithResult(_0x3887fe,null))['catch'](handleError(_0x3887fe,null));};exports[_0xb160('0x49')]=function(_0x388516,_0x6de7b){return db[_0xb160('0x29')][_0xb160('0x47')]({'where':{'id':_0x388516[_0xb160('0x45')]['id']}})[_0xb160('0x24')](handleEntityNotFound(_0x6de7b,null))[_0xb160('0x24')](removeEntity(_0x6de7b,null))[_0xb160('0x43')](handleError(_0x6de7b,null));};exports['describe']=function(_0xb68d0c,_0x2fcbaa){return db[_0xb160('0x29')]['describe']()[_0xb160('0x24')](respondWithResult(_0x2fcbaa,null))[_0xb160('0x43')](handleError(_0x2fcbaa,null));};
\ No newline at end of file
+var _0xcb1a=['fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','catch','create','body','update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes'];(function(_0x3d2721,_0x1ad26d){var _0x1f163a=function(_0x17fa8e){while(--_0x17fa8e){_0x3d2721['push'](_0x3d2721['shift']());}};_0x1f163a(++_0x1ad26d);}(_0xcb1a,0x1cd));var _0xacb1=function(_0x456f43,_0x31a177){_0x456f43=_0x456f43-0x0;var _0x364705=_0xcb1a[_0x456f43];return _0x364705;};'use strict';var emlformat=require(_0xacb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xacb1('0x1'));var jsonpatch=require(_0xacb1('0x2'));var rp=require(_0xacb1('0x3'));var moment=require(_0xacb1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xacb1('0x5'));var util=require('util');var path=require(_0xacb1('0x6'));var sox=require('sox');var csv=require(_0xacb1('0x7'));var ejs=require(_0xacb1('0x8'));var fs=require('fs');var fs_extra=require(_0xacb1('0x9'));var _=require(_0xacb1('0xa'));var squel=require('squel');var crypto=require(_0xacb1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xacb1('0xc'));var toCsv=require(_0xacb1('0x7'));var querystring=require(_0xacb1('0xd'));var Papa=require('papaparse');var Redis=require(_0xacb1('0xe'));var authService=require(_0xacb1('0xf'));var qs=require(_0xacb1('0x10'));var as=require(_0xacb1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacb1('0x12'))(_0xacb1('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e804e,_0x1a1d99){_0x1a1d99=_0x1a1d99||0xcc;return function(_0x14c2b7){if(_0x14c2b7){return _0x3e804e[_0xacb1('0x14')](_0x1a1d99);}return _0x3e804e[_0xacb1('0x15')](_0x1a1d99)[_0xacb1('0x16')]();};}function respondWithResult(_0x1f735a,_0x173576){_0x173576=_0x173576||0xc8;return function(_0x3af729){if(_0x3af729){return _0x1f735a[_0xacb1('0x15')](_0x173576)[_0xacb1('0x17')](_0x3af729);}};}function respondWithFilteredResult(_0x477dbb,_0x2cc9af){return function(_0xf1b5a0){if(_0xf1b5a0){var _0x496b2b=typeof _0x2cc9af[_0xacb1('0x18')]===_0xacb1('0x19')&&typeof _0x2cc9af[_0xacb1('0x1a')]===_0xacb1('0x19');var _0x46f373=_0xf1b5a0[_0xacb1('0x1b')];var _0x1aaa44=_0x496b2b?0x0:_0x2cc9af[_0xacb1('0x18')];var _0x199536=_0x496b2b?_0xf1b5a0[_0xacb1('0x1b')]:_0x2cc9af[_0xacb1('0x18')]+_0x2cc9af['limit'];var _0x29b6f2;if(_0x199536>=_0x46f373){_0x199536=_0x46f373;_0x29b6f2=0xc8;}else{_0x29b6f2=0xce;}_0x477dbb[_0xacb1('0x15')](_0x29b6f2);return _0x477dbb['set'](_0xacb1('0x1c'),_0x1aaa44+'-'+_0x199536+'/'+_0x46f373)[_0xacb1('0x17')](_0xf1b5a0);}return null;};}function patchUpdates(_0x1804eb){return function(_0x2277b8){try{jsonpatch[_0xacb1('0x1d')](_0x2277b8,_0x1804eb,!![]);}catch(_0x347db0){return BPromise[_0xacb1('0x1e')](_0x347db0);}return _0x2277b8[_0xacb1('0x1f')]();};}function saveUpdates(_0x237b30,_0x329d2f){return function(_0x334803){if(_0x334803){return _0x334803['update'](_0x237b30)[_0xacb1('0x20')](function(_0x1b2ba5){return _0x1b2ba5;});}return null;};}function removeEntity(_0x221621,_0x3bbee9){return function(_0x4ad5a5){if(_0x4ad5a5){return _0x4ad5a5[_0xacb1('0x21')]()[_0xacb1('0x20')](function(){_0x221621[_0xacb1('0x15')](0xcc)[_0xacb1('0x16')]();});}};}function handleEntityNotFound(_0x21eaa1,_0xc3e82b){return function(_0x88e508){if(!_0x88e508){_0x21eaa1['sendStatus'](0x194);}return _0x88e508;};}function handleError(_0x5e0f15,_0x34c42e){_0x34c42e=_0x34c42e||0x1f4;return function(_0x27cd21){logger[_0xacb1('0x22')](_0x27cd21[_0xacb1('0x23')]);if(_0x27cd21[_0xacb1('0x24')]){delete _0x27cd21['name'];}_0x5e0f15[_0xacb1('0x15')](_0x34c42e)[_0xacb1('0x25')](_0x27cd21);};}exports[_0xacb1('0x26')]=function(_0x5aa310,_0x22f999){var _0x32d959={},_0x57bf9f={},_0x17b6f5={'count':0x0,'rows':[]};var _0x347057=_['map'](db[_0xacb1('0x27')][_0xacb1('0x28')],function(_0x3bb1aa){return{'name':_0x3bb1aa[_0xacb1('0x29')],'type':_0x3bb1aa[_0xacb1('0x2a')]['key']};});_0x57bf9f[_0xacb1('0x2b')]=_[_0xacb1('0x2c')](_0x347057,_0xacb1('0x24'));_0x57bf9f[_0xacb1('0x2d')]=_[_0xacb1('0x2e')](_0x5aa310[_0xacb1('0x2d')]);_0x57bf9f[_0xacb1('0x2f')]=_[_0xacb1('0x30')](_0x57bf9f[_0xacb1('0x2b')],_0x57bf9f[_0xacb1('0x2d')]);_0x32d959[_0xacb1('0x31')]=_[_0xacb1('0x30')](_0x57bf9f[_0xacb1('0x2b')],qs['fields'](_0x5aa310[_0xacb1('0x2d')][_0xacb1('0x32')]));_0x32d959[_0xacb1('0x31')]=_0x32d959[_0xacb1('0x31')][_0xacb1('0x33')]?_0x32d959[_0xacb1('0x31')]:_0x57bf9f[_0xacb1('0x2b')];if(!_0x5aa310[_0xacb1('0x2d')]['hasOwnProperty'](_0xacb1('0x34'))){_0x32d959['limit']=qs[_0xacb1('0x1a')](_0x5aa310['query'][_0xacb1('0x1a')]);_0x32d959['offset']=qs[_0xacb1('0x18')](_0x5aa310['query'][_0xacb1('0x18')]);}_0x32d959[_0xacb1('0x35')]=qs['sort'](_0x5aa310[_0xacb1('0x2d')][_0xacb1('0x36')]);_0x32d959[_0xacb1('0x37')]=qs[_0xacb1('0x2f')](_[_0xacb1('0x38')](_0x5aa310[_0xacb1('0x2d')],_0x57bf9f[_0xacb1('0x2f')]),_0x347057);if(_0x5aa310['query']['filter']){_0x32d959['where']=_[_0xacb1('0x39')](_0x32d959[_0xacb1('0x37')],{'$or':_[_0xacb1('0x2c')](_0x347057,function(_0x3106ab){if(_0x3106ab[_0xacb1('0x2a')]!==_0xacb1('0x3a')){var _0x1bfaaa={};_0x1bfaaa[_0x3106ab[_0xacb1('0x24')]]={'$like':'%'+_0x5aa310[_0xacb1('0x2d')][_0xacb1('0x3b')]+'%'};return _0x1bfaaa;}})});}_0x32d959=_[_0xacb1('0x39')]({},_0x32d959,_0x5aa310[_0xacb1('0x3c')]);var _0x113ce0={'where':_0x32d959[_0xacb1('0x37')]};return db[_0xacb1('0x27')]['count'](_0x113ce0)[_0xacb1('0x20')](function(_0x4c48e0){_0x17b6f5[_0xacb1('0x1b')]=_0x4c48e0;if(_0x5aa310['query'][_0xacb1('0x3d')]){_0x32d959[_0xacb1('0x3e')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xacb1('0x3f')](_0x32d959);})[_0xacb1('0x20')](function(_0x5e088c){_0x17b6f5[_0xacb1('0x40')]=_0x5e088c;return _0x17b6f5;})[_0xacb1('0x20')](respondWithFilteredResult(_0x22f999,_0x32d959))['catch'](handleError(_0x22f999,null));};exports[_0xacb1('0x41')]=function(_0x147ce4,_0x1ccdbe){var _0x10a89d={'raw':!![],'where':{'id':_0x147ce4[_0xacb1('0x42')]['id']}},_0x2f11d4={};_0x2f11d4[_0xacb1('0x2b')]=_[_0xacb1('0x2e')](db[_0xacb1('0x27')]['rawAttributes']);_0x2f11d4['query']=_[_0xacb1('0x2e')](_0x147ce4['query']);_0x2f11d4[_0xacb1('0x2f')]=_[_0xacb1('0x30')](_0x2f11d4[_0xacb1('0x2b')],_0x2f11d4['query']);_0x10a89d['attributes']=_[_0xacb1('0x30')](_0x2f11d4[_0xacb1('0x2b')],qs['fields'](_0x147ce4[_0xacb1('0x2d')][_0xacb1('0x32')]));_0x10a89d[_0xacb1('0x31')]=_0x10a89d[_0xacb1('0x31')][_0xacb1('0x33')]?_0x10a89d[_0xacb1('0x31')]:_0x2f11d4[_0xacb1('0x2b')];if(_0x147ce4[_0xacb1('0x2d')][_0xacb1('0x3d')]){_0x10a89d[_0xacb1('0x3e')]=[{'all':!![]}];}_0x10a89d=_[_0xacb1('0x39')]({},_0x10a89d,_0x147ce4[_0xacb1('0x3c')]);return db[_0xacb1('0x27')]['find'](_0x10a89d)['then'](handleEntityNotFound(_0x1ccdbe,null))[_0xacb1('0x20')](respondWithResult(_0x1ccdbe,null))[_0xacb1('0x43')](handleError(_0x1ccdbe,null));};exports['create']=function(_0x240ad0,_0x5e053e){return db[_0xacb1('0x27')][_0xacb1('0x44')](_0x240ad0[_0xacb1('0x45')],{})['then'](respondWithResult(_0x5e053e,0xc9))[_0xacb1('0x43')](handleError(_0x5e053e,null));};exports[_0xacb1('0x46')]=function(_0xa5d3d9,_0x7c0c){if(_0xa5d3d9[_0xacb1('0x45')]['id']){delete _0xa5d3d9[_0xacb1('0x45')]['id'];}return db[_0xacb1('0x27')][_0xacb1('0x47')]({'where':{'id':_0xa5d3d9[_0xacb1('0x42')]['id']}})['then'](handleEntityNotFound(_0x7c0c,null))[_0xacb1('0x20')](saveUpdates(_0xa5d3d9[_0xacb1('0x45')],null))[_0xacb1('0x20')](respondWithResult(_0x7c0c,null))[_0xacb1('0x43')](handleError(_0x7c0c,null));};exports[_0xacb1('0x21')]=function(_0x3aaed6,_0x24afe1){return db['SquareDetailsReport'][_0xacb1('0x47')]({'where':{'id':_0x3aaed6[_0xacb1('0x42')]['id']}})['then'](handleEntityNotFound(_0x24afe1,null))[_0xacb1('0x20')](removeEntity(_0x24afe1,null))[_0xacb1('0x43')](handleError(_0x24afe1,null));};exports[_0xacb1('0x48')]=function(_0x287444,_0x120597){return db['SquareDetailsReport'][_0xacb1('0x48')]()[_0xacb1('0x20')](respondWithResult(_0x120597,null))['catch'](handleError(_0x120597,null));};
\ No newline at end of file
index 5804214..2ba022c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9220=['./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x354bfc,_0x2b7209){var _0x535a05=function(_0x55df14){while(--_0x55df14){_0x354bfc['push'](_0x354bfc['shift']());}};_0x535a05(++_0x2b7209);}(_0x9220,0x72));var _0x0922=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x9220[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x0922('0x0'));var util=require(_0x0922('0x1'));var logger=require(_0x0922('0x2'))(_0x0922('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0922('0x4'));var rimraf=require(_0x0922('0x5'));var config=require(_0x0922('0x6'));var attributes=require(_0x0922('0x7'));module[_0x0922('0x8')]=function(_0x1aa08b,_0x1ccd4d){return _0x1aa08b['define'](_0x0922('0x9'),attributes,{'tableName':_0x0922('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcce4=['report_square_details','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define','SquareDetailsReport'];(function(_0x40a77f,_0x1d5f8d){var _0x415aa1=function(_0x1e45bc){while(--_0x1e45bc){_0x40a77f['push'](_0x40a77f['shift']());}};_0x415aa1(++_0x1d5f8d);}(_0xcce4,0x1ae));var _0x4cce=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0xcce4[_0xc14df7];return _0x34a445;};'use strict';var _=require(_0x4cce('0x0'));var util=require(_0x4cce('0x1'));var logger=require(_0x4cce('0x2'))(_0x4cce('0x3'));var moment=require('moment');var BPromise=require(_0x4cce('0x4'));var rp=require(_0x4cce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4cce('0x6'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x4cce('0x7')]=function(_0x4a3510,_0x3002d0){return _0x4a3510[_0x4cce('0x8')](_0x4cce('0x9'),attributes,{'tableName':_0x4cce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 80a52af..bb112e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0x34b7,0x196));var _0x734b=function(_0x378f89,_0x13f5c7){_0x378f89=_0x378f89-0x0;var _0x3239d5=_0x34b7[_0x378f89];return _0x3239d5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')](_0x5edbe9[_0x734b('0x18')],{'raw':_0x5edbe9[_0x734b('0x19')]?_0x5edbe9[_0x734b('0x19')][_0x734b('0x1a')]===undefined?!![]:![]:!![]})[_0x734b('0x1b')](function(_0x67eed){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x67eed));_0x56a95c(_0x67eed);})['catch'](function(_0x1e4dcc){logger[_0x734b('0xf')]('CreateSquareDetailsReport',_0x1e4dcc[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1e4dcc[_0x734b('0x12')]));});});};
\ No newline at end of file
+var _0x5204=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','lodash'];(function(_0x3f3ba4,_0x6b08be){var _0x4c5c03=function(_0x1505f4){while(--_0x1505f4){_0x3f3ba4['push'](_0x3f3ba4['shift']());}};_0x4c5c03(++_0x6b08be);}(_0x5204,0xdf));var _0x4520=function(_0x53f964,_0x3b52b8){_0x53f964=_0x53f964-0x0;var _0x17be6c=_0x5204[_0x53f964];return _0x17be6c;};'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);});});}exports[_0x4520('0x17')]=function(_0x2e00f4){var _0x1dcf51=this;return new Promise(function(_0x4ba69f,_0x3791b6){return db[_0x4520('0x18')][_0x4520('0x19')](_0x2e00f4[_0x4520('0x1a')],{'raw':_0x2e00f4['options']?_0x2e00f4[_0x4520('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c46c5){logger[_0x4520('0xc')]('CreateSquareDetailsReport',_0x2e00f4);logger[_0x4520('0xf')](_0x4520('0x17'),_0x2e00f4,JSON[_0x4520('0x11')](_0x4c46c5));_0x4ba69f(_0x4c46c5);})['catch'](function(_0x3199a9){logger[_0x4520('0x12')](_0x4520('0x17'),_0x3199a9['message'],_0x2e00f4);_0x3791b6(_0x1dcf51[_0x4520('0x12')](0x1f4,_0x3199a9[_0x4520('0x14')]));});});};
\ No newline at end of file
index a932bf1..a03bf12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2922=['../../components/auth/service','./system.controller','get','index','isAuthenticated','killProcess','exports','express','Router'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x2922,0xe8));var _0x2292=function(_0x30398d,_0x48aa69){_0x30398d=_0x30398d-0x0;var _0x4735b5=_0x2922[_0x30398d];return _0x4735b5;};'use strict';var express=require(_0x2292('0x0'));var router=express[_0x2292('0x1')]();var auth=require(_0x2292('0x2'));var controller=require(_0x2292('0x3'));router[_0x2292('0x4')]('/',auth['isAuthenticated'](),controller[_0x2292('0x5')]);router['get']('/process/:pid/kill',auth[_0x2292('0x6')](),controller[_0x2292('0x7')]);module[_0x2292('0x8')]=router;
\ No newline at end of file
+var _0x0c91=['Router','../../components/auth/service','./system.controller','get','isAuthenticated','index','killProcess','express'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0c91,0x10f));var _0x10c9=function(_0x442be9,_0x229476){_0x442be9=_0x442be9-0x0;var _0x538515=_0x0c91[_0x442be9];return _0x538515;};'use strict';var express=require(_0x10c9('0x0'));var router=express[_0x10c9('0x1')]();var auth=require(_0x10c9('0x2'));var controller=require(_0x10c9('0x3'));router[_0x10c9('0x4')]('/',auth[_0x10c9('0x5')](),controller[_0x10c9('0x6')]);router[_0x10c9('0x4')]('/process/:pid/kill',auth[_0x10c9('0x5')](),controller[_0x10c9('0x7')]);module['exports']=router;
\ No newline at end of file
index 994c9f9..9cba51a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1a4=['bluebird','lodash','error','inspect','index','getAllData','then','status','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger','api','util'];(function(_0x35af6d,_0x48afc4){var _0x1fd188=function(_0x5a0587){while(--_0x5a0587){_0x35af6d['push'](_0x35af6d['shift']());}};_0x1fd188(++_0x48afc4);}(_0xd1a4,0x125));var _0x4d1a=function(_0x37fc62,_0x5120f9){_0x37fc62=_0x37fc62-0x0;var _0x58109b=_0xd1a4[_0x37fc62];return _0x58109b;};'use strict';var info=require('systeminformation');var exec=require(_0x4d1a('0x0'))['exec'];var logger=require(_0x4d1a('0x1'))(_0x4d1a('0x2'));var util=require(_0x4d1a('0x3'));var BPromise=require(_0x4d1a('0x4'));var _=require(_0x4d1a('0x5'));function handleError(_0x1ad639,_0x553e47,_0x3a147d){_0x553e47=_0x553e47||0x1f4;return function(_0x3564c7){logger[_0x4d1a('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x3a147d,_0x553e47,util[_0x4d1a('0x7')](_0x3564c7,{'showHidden':![],'depth':null}));delete _0x3564c7['name'];_0x1ad639['status'](_0x553e47)['send'](_0x3564c7);};}exports[_0x4d1a('0x8')]=function(_0x46c228,_0x3e9f7f){return info[_0x4d1a('0x9')]()[_0x4d1a('0xa')](function(_0x3d5b28){return _0x3e9f7f[_0x4d1a('0xb')](0xc8)[_0x4d1a('0xc')](_0x3d5b28);})[_0x4d1a('0xd')](function(_0x279881){return _0x3e9f7f['status'](0x1f4)[_0x4d1a('0xc')](_0x279881);});};exports[_0x4d1a('0xe')]=function(_0x1fc151,_0x4d3e86){var _0x3093f4=[_0x4d1a('0xf')];return new BPromise(function(_0x155f03,_0xee452f){return exec(util[_0x4d1a('0x10')](_0x4d1a('0x11'),_0x1fc151[_0x4d1a('0x12')]['pid']),function(_0x4aac5b,_0x459df5,_0x24b6c9){if(_0x4aac5b){return _0xee452f(_0x4aac5b);}return _0x155f03(_0x459df5);});})[_0x4d1a('0xa')](function(_0x4df104){var _0x55d7d0=![];var _0x194f10=_0x4df104[_0x4d1a('0x13')](/\n/);for(var _0x2ade81=0x0,_0xa0480d=_0x3093f4[_0x4d1a('0x14')];_0x2ade81<_0xa0480d,_0x55d7d0===![];_0x2ade81+=0x1){if(_0x4df104[_0x4d1a('0x15')](_0x3093f4[_0x2ade81])>=0x0){_0x55d7d0=!![];}}if(!_0x55d7d0){throw new Error(util['format'](_0x4d1a('0x16'),_0x1fc151[_0x4d1a('0x12')][_0x4d1a('0x17')]));}process[_0x4d1a('0x18')](_0x1fc151['params'][_0x4d1a('0x17')],_0x4d1a('0x19'));return _0x4d3e86[_0x4d1a('0xb')](0xc8)[_0x4d1a('0xc')]({'message':util[_0x4d1a('0x10')](_0x4d1a('0x1a'),_0x1fc151[_0x4d1a('0x12')]['pid'])});})['catch'](handleError(_0x4d3e86,null,_0x4d1a('0xe')));};
\ No newline at end of file
+var _0xbee0=['systeminformation','child_process','exec','../../config/logger','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch'];(function(_0x490bb9,_0x5b5675){var _0x215601=function(_0x2f08a4){while(--_0x2f08a4){_0x490bb9['push'](_0x490bb9['shift']());}};_0x215601(++_0x5b5675);}(_0xbee0,0x188));var _0x0bee=function(_0x5971ff,_0x3b2e60){_0x5971ff=_0x5971ff-0x0;var _0x446e95=_0xbee0[_0x5971ff];return _0x446e95;};'use strict';var info=require(_0x0bee('0x0'));var exec=require(_0x0bee('0x1'))[_0x0bee('0x2')];var logger=require(_0x0bee('0x3'))('api');var util=require(_0x0bee('0x4'));var BPromise=require('bluebird');var _=require(_0x0bee('0x5'));function handleError(_0x45dde6,_0x346fb9,_0xf1b282){_0x346fb9=_0x346fb9||0x1f4;return function(_0x2f3add){logger[_0x0bee('0x6')](_0x0bee('0x7'),_0xf1b282,_0x346fb9,util[_0x0bee('0x8')](_0x2f3add,{'showHidden':![],'depth':null}));delete _0x2f3add[_0x0bee('0x9')];_0x45dde6[_0x0bee('0xa')](_0x346fb9)['send'](_0x2f3add);};}exports[_0x0bee('0xb')]=function(_0x2805ce,_0x4461a5){return info[_0x0bee('0xc')]()[_0x0bee('0xd')](function(_0x70f396){return _0x4461a5[_0x0bee('0xa')](0xc8)[_0x0bee('0xe')](_0x70f396);})['catch'](function(_0x401efe){return _0x4461a5[_0x0bee('0xa')](0x1f4)[_0x0bee('0xe')](_0x401efe);});};exports[_0x0bee('0xf')]=function(_0xeac2e7,_0x57b4f8){var _0x1c661c=[_0x0bee('0x10')];return new BPromise(function(_0x12a085,_0xbb2d44){return exec(util[_0x0bee('0x11')](_0x0bee('0x12'),_0xeac2e7[_0x0bee('0x13')][_0x0bee('0x14')]),function(_0x3f92cc,_0xf960e,_0x27938d){if(_0x3f92cc){return _0xbb2d44(_0x3f92cc);}return _0x12a085(_0xf960e);});})[_0x0bee('0xd')](function(_0x3801a1){var _0x18908d=![];var _0x229c4e=_0x3801a1[_0x0bee('0x15')](/\n/);for(var _0x58fb89=0x0,_0x36ca6c=_0x1c661c[_0x0bee('0x16')];_0x58fb89<_0x36ca6c,_0x18908d===![];_0x58fb89+=0x1){if(_0x3801a1['indexOf'](_0x1c661c[_0x58fb89])>=0x0){_0x18908d=!![];}}if(!_0x18908d){throw new Error(util['format'](_0x0bee('0x17'),_0xeac2e7[_0x0bee('0x13')]['pid']));}process[_0x0bee('0x18')](_0xeac2e7[_0x0bee('0x13')]['pid'],_0x0bee('0x19'));return _0x57b4f8[_0x0bee('0xa')](0xc8)[_0x0bee('0xe')]({'message':util[_0x0bee('0x11')](_0x0bee('0x1a'),_0xeac2e7[_0x0bee('0x13')]['pid'])});})[_0x0bee('0x1b')](handleError(_0x57b4f8,null,'killProcess'));};
\ No newline at end of file
index 6590aa1..6b3fd06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bf7=['multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_0x4bf7,0x198));var _0x74bf=function(_0x372a1a,_0x150960){_0x372a1a=_0x372a1a-0x0;var _0x4472b8=_0x4bf7[_0x372a1a];return _0x4472b8;};'use strict';var multer=require(_0x74bf('0x0'));var util=require('util');var path=require(_0x74bf('0x1'));var timeout=require('connect-timeout');var express=require(_0x74bf('0x2'));var router=express['Router']();var fs_extra=require(_0x74bf('0x3'));var auth=require(_0x74bf('0x4'));var interaction=require(_0x74bf('0x5'));var config=require(_0x74bf('0x6'));var controller=require('./tag.controller');router['get']('/',auth[_0x74bf('0x7')](),controller['index']);router[_0x74bf('0x8')](_0x74bf('0x9'),auth[_0x74bf('0x7')](),controller[_0x74bf('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x74bf('0xb')]);router[_0x74bf('0xc')](_0x74bf('0x9'),auth[_0x74bf('0x7')](),controller[_0x74bf('0xd')]);router[_0x74bf('0xe')](_0x74bf('0x9'),auth['isAuthenticated'](),controller[_0x74bf('0xf')]);module[_0x74bf('0x10')]=router;
\ No newline at end of file
+var _0x3391=['show','post','create','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','isAuthenticated','index'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x3391,0x13f));var _0x1339=function(_0x1d7bfc,_0x9dc01){_0x1d7bfc=_0x1d7bfc-0x0;var _0x34d68d=_0x3391[_0x1d7bfc];return _0x34d68d;};'use strict';var multer=require('multer');var util=require(_0x1339('0x0'));var path=require(_0x1339('0x1'));var timeout=require(_0x1339('0x2'));var express=require(_0x1339('0x3'));var router=express[_0x1339('0x4')]();var fs_extra=require(_0x1339('0x5'));var auth=require(_0x1339('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1339('0x7'));var controller=require(_0x1339('0x8'));router['get']('/',auth[_0x1339('0x9')](),controller[_0x1339('0xa')]);router['get']('/:id',auth[_0x1339('0x9')](),controller[_0x1339('0xb')]);router[_0x1339('0xc')]('/',auth[_0x1339('0x9')](),controller[_0x1339('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1339('0xe')]=router;
\ No newline at end of file
index f466ce1..62e02e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ca5=['name','#0091EA','sequelize','exports','STRING'];(function(_0x2123ba,_0x53c15a){var _0xe01ff1=function(_0x1e1c49){while(--_0x1e1c49){_0x2123ba['push'](_0x2123ba['shift']());}};_0xe01ff1(++_0x53c15a);}(_0x0ca5,0xfc));var _0x50ca=function(_0x2f50c9,_0x5ab69f){_0x2f50c9=_0x2f50c9-0x0;var _0x2a7d72=_0x0ca5[_0x2f50c9];return _0x2a7d72;};'use strict';var Sequelize=require(_0x50ca('0x0'));module[_0x50ca('0x1')]={'name':{'type':Sequelize[_0x50ca('0x2')],'unique':_0x50ca('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x50ca('0x2')],'defaultValue':_0x50ca('0x4')},'description':{'type':Sequelize[_0x50ca('0x2')]}};
\ No newline at end of file
+var _0x1d21=['exports','STRING','name','#0091EA','sequelize'];(function(_0x1aa5c6,_0x531ab5){var _0x480582=function(_0x5e9da8){while(--_0x5e9da8){_0x1aa5c6['push'](_0x1aa5c6['shift']());}};_0x480582(++_0x531ab5);}(_0x1d21,0x158));var _0x11d2=function(_0x52740f,_0x343961){_0x52740f=_0x52740f-0x0;var _0x1cbe11=_0x1d21[_0x52740f];return _0x1cbe11;};'use strict';var Sequelize=require(_0x11d2('0x0'));module[_0x11d2('0x1')]={'name':{'type':Sequelize[_0x11d2('0x2')],'unique':_0x11d2('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x11d2('0x4')},'description':{'type':Sequelize[_0x11d2('0x2')]}};
\ No newline at end of file
index 2db0565..e054e20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7f=['json','apply','reject','update','then','destroy','get','end','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Tag','includeAll','findAll','rows','catch','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range'];(function(_0x49c34c,_0x53613c){var _0x268be7=function(_0xc78f31){while(--_0xc78f31){_0x49c34c['push'](_0x49c34c['shift']());}};_0x268be7(++_0x53613c);}(_0x6f7f,0x177));var _0xf6f7=function(_0x21297f,_0x99b667){_0x21297f=_0x21297f-0x0;var _0x343759=_0x6f7f[_0x21297f];return _0x343759;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6f7('0x0'));var zipdir=require(_0xf6f7('0x1'));var jsonpatch=require(_0xf6f7('0x2'));var rp=require(_0xf6f7('0x3'));var moment=require(_0xf6f7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf6f7('0x5'));var util=require('util');var path=require(_0xf6f7('0x6'));var sox=require(_0xf6f7('0x7'));var csv=require(_0xf6f7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6f7('0x9'));var _=require('lodash');var squel=require(_0xf6f7('0xa'));var crypto=require(_0xf6f7('0xb'));var jsforce=require(_0xf6f7('0xc'));var deskjs=require(_0xf6f7('0xd'));var toCsv=require(_0xf6f7('0x8'));var querystring=require(_0xf6f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xf6f7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6f7('0x10'));var logger=require(_0xf6f7('0x11'))(_0xf6f7('0x12'));var utils=require(_0xf6f7('0x13'));var config=require(_0xf6f7('0x14'));var licenseUtil=require(_0xf6f7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47c447,_0x2493ec){_0x2493ec=_0x2493ec||0xcc;return function(_0x37f2ce){if(_0x37f2ce){return _0x47c447[_0xf6f7('0x16')](_0x2493ec);}return _0x47c447[_0xf6f7('0x17')](_0x2493ec)['end']();};}function respondWithResult(_0x568242,_0xc4fe52){_0xc4fe52=_0xc4fe52||0xc8;return function(_0x4f8d9b){if(_0x4f8d9b){return _0x568242[_0xf6f7('0x17')](_0xc4fe52)['json'](_0x4f8d9b);}};}function respondWithFilteredResult(_0x3f9293,_0x2ca201){return function(_0x35958e){if(_0x35958e){var _0x2758c0=typeof _0x2ca201[_0xf6f7('0x18')]==='undefined'&&typeof _0x2ca201[_0xf6f7('0x19')]===_0xf6f7('0x1a');var _0x566589=_0x35958e[_0xf6f7('0x1b')];var _0x438e3d=_0x2758c0?0x0:_0x2ca201[_0xf6f7('0x18')];var _0x5cc7a1=_0x2758c0?_0x35958e['count']:_0x2ca201[_0xf6f7('0x18')]+_0x2ca201[_0xf6f7('0x19')];var _0x512b07;if(_0x5cc7a1>=_0x566589){_0x5cc7a1=_0x566589;_0x512b07=0xc8;}else{_0x512b07=0xce;}_0x3f9293[_0xf6f7('0x17')](_0x512b07);return _0x3f9293[_0xf6f7('0x1c')](_0xf6f7('0x1d'),_0x438e3d+'-'+_0x5cc7a1+'/'+_0x566589)[_0xf6f7('0x1e')](_0x35958e);}return null;};}function patchUpdates(_0x3143d1){return function(_0x93bbfc){try{jsonpatch[_0xf6f7('0x1f')](_0x93bbfc,_0x3143d1,!![]);}catch(_0x564e5f){return BPromise[_0xf6f7('0x20')](_0x564e5f);}return _0x93bbfc['save']();};}function saveUpdates(_0x58ca0f,_0x66e5e4){return function(_0x532ee4){if(_0x532ee4){return _0x532ee4[_0xf6f7('0x21')](_0x58ca0f)[_0xf6f7('0x22')](function(_0x50b550){return _0x50b550;});}return null;};}function removeEntity(_0x3ce38d,_0x5ec44f){return function(_0x4c349d){if(_0x4c349d){return _0x4c349d[_0xf6f7('0x23')]()[_0xf6f7('0x22')](function(){var _0x2d5079=_0x4c349d[_0xf6f7('0x24')]({'plain':!![]});var _0xa903ff='Tags';return db['UserProfileResource'][_0xf6f7('0x23')]({'where':{'type':_0xa903ff,'resourceId':_0x2d5079['id']}})[_0xf6f7('0x22')](function(){return _0x4c349d;});})[_0xf6f7('0x22')](function(){_0x3ce38d[_0xf6f7('0x17')](0xcc)[_0xf6f7('0x25')]();});}};}function handleEntityNotFound(_0x2c93c8,_0x4b6e82){return function(_0x49dd11){if(!_0x49dd11){_0x2c93c8[_0xf6f7('0x16')](0x194);}return _0x49dd11;};}function handleError(_0x3a6f6a,_0x33258c){_0x33258c=_0x33258c||0x1f4;return function(_0x35a384){logger[_0xf6f7('0x26')](_0x35a384[_0xf6f7('0x27')]);if(_0x35a384['name']){delete _0x35a384['name'];}_0x3a6f6a['status'](_0x33258c)[_0xf6f7('0x28')](_0x35a384);};}exports['index']=function(_0x29661e,_0x35b586){var _0x5bf191={},_0x50ef5b={},_0x3b85db={'count':0x0,'rows':[]};var _0x26610f=_[_0xf6f7('0x29')](db['Tag'][_0xf6f7('0x2a')],function(_0x505b20){return{'name':_0x505b20[_0xf6f7('0x2b')],'type':_0x505b20[_0xf6f7('0x2c')][_0xf6f7('0x2d')]};});_0x50ef5b[_0xf6f7('0x2e')]=_[_0xf6f7('0x29')](_0x26610f,_0xf6f7('0x2f'));_0x50ef5b[_0xf6f7('0x30')]=_[_0xf6f7('0x31')](_0x29661e[_0xf6f7('0x30')]);_0x50ef5b[_0xf6f7('0x32')]=_[_0xf6f7('0x33')](_0x50ef5b[_0xf6f7('0x2e')],_0x50ef5b['query']);_0x5bf191[_0xf6f7('0x34')]=_['intersection'](_0x50ef5b[_0xf6f7('0x2e')],qs[_0xf6f7('0x35')](_0x29661e[_0xf6f7('0x30')][_0xf6f7('0x35')]));_0x5bf191[_0xf6f7('0x34')]=_0x5bf191[_0xf6f7('0x34')][_0xf6f7('0x36')]?_0x5bf191[_0xf6f7('0x34')]:_0x50ef5b[_0xf6f7('0x2e')];if(!_0x29661e['query']['hasOwnProperty'](_0xf6f7('0x37'))){_0x5bf191[_0xf6f7('0x19')]=qs[_0xf6f7('0x19')](_0x29661e[_0xf6f7('0x30')][_0xf6f7('0x19')]);_0x5bf191[_0xf6f7('0x18')]=qs[_0xf6f7('0x18')](_0x29661e[_0xf6f7('0x30')][_0xf6f7('0x18')]);}_0x5bf191[_0xf6f7('0x38')]=qs[_0xf6f7('0x39')](_0x29661e[_0xf6f7('0x30')][_0xf6f7('0x39')]);_0x5bf191[_0xf6f7('0x3a')]=qs[_0xf6f7('0x32')](_[_0xf6f7('0x3b')](_0x29661e['query'],_0x50ef5b['filters']),_0x26610f);if(_0x29661e[_0xf6f7('0x30')][_0xf6f7('0x3c')]){_0x5bf191[_0xf6f7('0x3a')]=_[_0xf6f7('0x3d')](_0x5bf191[_0xf6f7('0x3a')],{'$or':_[_0xf6f7('0x29')](_0x26610f,function(_0x57145f){if(_0x57145f[_0xf6f7('0x2c')]!==_0xf6f7('0x3e')){var _0x14e4ee={};_0x14e4ee[_0x57145f[_0xf6f7('0x2f')]]={'$like':'%'+_0x29661e['query']['filter']+'%'};return _0x14e4ee;}})});}_0x5bf191=_[_0xf6f7('0x3d')]({},_0x5bf191,_0x29661e['options']);var _0x5b75ec={'where':_0x5bf191[_0xf6f7('0x3a')]};return db[_0xf6f7('0x3f')][_0xf6f7('0x1b')](_0x5b75ec)['then'](function(_0x1ecb03){_0x3b85db[_0xf6f7('0x1b')]=_0x1ecb03;if(_0x29661e[_0xf6f7('0x30')][_0xf6f7('0x40')]){_0x5bf191['include']=[{'all':!![]}];}return db[_0xf6f7('0x3f')][_0xf6f7('0x41')](_0x5bf191);})['then'](function(_0x4788f0){_0x3b85db[_0xf6f7('0x42')]=_0x4788f0;return _0x3b85db;})['then'](respondWithFilteredResult(_0x35b586,_0x5bf191))[_0xf6f7('0x43')](handleError(_0x35b586,null));};exports['show']=function(_0x4c168a,_0x5007f6){var _0x2ee09d={'raw':!![],'where':{'id':_0x4c168a[_0xf6f7('0x44')]['id']}},_0x2bc188={};_0x2bc188[_0xf6f7('0x2e')]=_['keys'](db[_0xf6f7('0x3f')]['rawAttributes']);_0x2bc188[_0xf6f7('0x30')]=_['keys'](_0x4c168a['query']);_0x2bc188[_0xf6f7('0x32')]=_[_0xf6f7('0x33')](_0x2bc188[_0xf6f7('0x2e')],_0x2bc188['query']);_0x2ee09d[_0xf6f7('0x34')]=_[_0xf6f7('0x33')](_0x2bc188['model'],qs['fields'](_0x4c168a[_0xf6f7('0x30')]['fields']));_0x2ee09d[_0xf6f7('0x34')]=_0x2ee09d['attributes']['length']?_0x2ee09d[_0xf6f7('0x34')]:_0x2bc188['model'];if(_0x4c168a[_0xf6f7('0x30')]['includeAll']){_0x2ee09d[_0xf6f7('0x45')]=[{'all':!![]}];}_0x2ee09d=_['merge']({},_0x2ee09d,_0x4c168a['options']);return db[_0xf6f7('0x3f')][_0xf6f7('0x46')](_0x2ee09d)[_0xf6f7('0x22')](handleEntityNotFound(_0x5007f6,null))[_0xf6f7('0x22')](respondWithResult(_0x5007f6,null))[_0xf6f7('0x43')](handleError(_0x5007f6,null));};exports[_0xf6f7('0x47')]=function(_0x1d944a,_0xa5a85){return db[_0xf6f7('0x3f')][_0xf6f7('0x47')](_0x1d944a[_0xf6f7('0x48')],{})[_0xf6f7('0x22')](function(_0x50c120){var _0x4003b7=_0x1d944a['user'][_0xf6f7('0x24')]({'plain':!![]});if(!_0x4003b7)throw new Error(_0xf6f7('0x49'));if(_0x4003b7[_0xf6f7('0x4a')]==='user'){var _0x142cb4=_0x50c120[_0xf6f7('0x24')]({'plain':!![]});var _0xb32f1a=_0xf6f7('0x4b');return db[_0xf6f7('0x4c')]['find']({'where':{'name':_0xb32f1a,'userProfileId':_0x4003b7[_0xf6f7('0x4d')]},'raw':!![]})['then'](function(_0xda555f){if(_0xda555f&&_0xda555f[_0xf6f7('0x4e')]===0x0){return db[_0xf6f7('0x4f')]['create']({'name':_0x142cb4['name'],'resourceId':_0x142cb4['id'],'type':_0xda555f[_0xf6f7('0x2f')],'sectionId':_0xda555f['id']},{})[_0xf6f7('0x22')](function(){return _0x50c120;});}else{return _0x50c120;}})[_0xf6f7('0x43')](function(_0x4f439e){logger[_0xf6f7('0x26')](_0xf6f7('0x50'),_0x4f439e);throw _0x4f439e;});}return _0x50c120;})[_0xf6f7('0x22')](respondWithResult(_0xa5a85,0xc9))[_0xf6f7('0x43')](handleError(_0xa5a85,null));};exports[_0xf6f7('0x21')]=function(_0x1c03fe,_0x491fc2){if(_0x1c03fe[_0xf6f7('0x48')]['id']){delete _0x1c03fe[_0xf6f7('0x48')]['id'];}return db['Tag']['find']({'where':{'id':_0x1c03fe[_0xf6f7('0x44')]['id']}})[_0xf6f7('0x22')](handleEntityNotFound(_0x491fc2,null))['then'](saveUpdates(_0x1c03fe[_0xf6f7('0x48')],null))['then'](respondWithResult(_0x491fc2,null))[_0xf6f7('0x43')](handleError(_0x491fc2,null));};exports[_0xf6f7('0x23')]=function(_0x32cbfc,_0xe674ca){return db[_0xf6f7('0x3f')][_0xf6f7('0x46')]({'where':{'id':_0x32cbfc[_0xf6f7('0x44')]['id']}})[_0xf6f7('0x22')](handleEntityNotFound(_0xe674ca,null))['then'](removeEntity(_0xe674ca,null))['catch'](handleError(_0xe674ca,null));};
\ No newline at end of file
+var _0x4c4e=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Tags','destroy','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','Tag','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x4c4e,0x152));var _0xe4c4=function(_0x70815a,_0x50a14b){_0x70815a=_0x70815a-0x0;var _0x4db3c4=_0x4c4e[_0x70815a];return _0x4db3c4;};'use strict';var emlformat=require(_0xe4c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4c4('0x1'));var jsonpatch=require(_0xe4c4('0x2'));var rp=require(_0xe4c4('0x3'));var moment=require('moment');var BPromise=require(_0xe4c4('0x4'));var Mustache=require(_0xe4c4('0x5'));var util=require(_0xe4c4('0x6'));var path=require('path');var sox=require(_0xe4c4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4c4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x9'));var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0x10'));var authService=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var as=require(_0xe4c4('0x13'));var hardwareService=require(_0xe4c4('0x14'));var logger=require(_0xe4c4('0x15'))('api');var utils=require(_0xe4c4('0x16'));var config=require(_0xe4c4('0x17'));var licenseUtil=require(_0xe4c4('0x18'));var db=require(_0xe4c4('0x19'))['db'];function respondWithStatusCode(_0x50bfab,_0x262083){_0x262083=_0x262083||0xcc;return function(_0x115802){if(_0x115802){return _0x50bfab['sendStatus'](_0x262083);}return _0x50bfab[_0xe4c4('0x1a')](_0x262083)[_0xe4c4('0x1b')]();};}function respondWithResult(_0x5aa89b,_0x42ce9e){_0x42ce9e=_0x42ce9e||0xc8;return function(_0x29766a){if(_0x29766a){return _0x5aa89b['status'](_0x42ce9e)[_0xe4c4('0x1c')](_0x29766a);}};}function respondWithFilteredResult(_0x465c9b,_0x26ea05){return function(_0x40a36e){if(_0x40a36e){var _0x19e59b=typeof _0x26ea05[_0xe4c4('0x1d')]===_0xe4c4('0x1e')&&typeof _0x26ea05[_0xe4c4('0x1f')]===_0xe4c4('0x1e');var _0x36b10c=_0x40a36e[_0xe4c4('0x20')];var _0x42242c=_0x19e59b?0x0:_0x26ea05[_0xe4c4('0x1d')];var _0x43a9ce=_0x19e59b?_0x40a36e[_0xe4c4('0x20')]:_0x26ea05['offset']+_0x26ea05[_0xe4c4('0x1f')];var _0x24f946;if(_0x43a9ce>=_0x36b10c){_0x43a9ce=_0x36b10c;_0x24f946=0xc8;}else{_0x24f946=0xce;}_0x465c9b[_0xe4c4('0x1a')](_0x24f946);return _0x465c9b[_0xe4c4('0x21')]('Content-Range',_0x42242c+'-'+_0x43a9ce+'/'+_0x36b10c)[_0xe4c4('0x1c')](_0x40a36e);}return null;};}function patchUpdates(_0x1cad5d){return function(_0x1727eb){try{jsonpatch[_0xe4c4('0x22')](_0x1727eb,_0x1cad5d,!![]);}catch(_0x2c5aea){return BPromise[_0xe4c4('0x23')](_0x2c5aea);}return _0x1727eb[_0xe4c4('0x24')]();};}function saveUpdates(_0x393c96,_0x21bbb1){return function(_0x1a7690){if(_0x1a7690){return _0x1a7690[_0xe4c4('0x25')](_0x393c96)[_0xe4c4('0x26')](function(_0x138ead){return _0x138ead;});}return null;};}function removeEntity(_0x1db719,_0x15873e){return function(_0x59498e){if(_0x59498e){return _0x59498e['destroy']()[_0xe4c4('0x26')](function(){var _0x4dc8cc=_0x59498e[_0xe4c4('0x27')]({'plain':!![]});var _0x5374fd=_0xe4c4('0x28');return db['UserProfileResource'][_0xe4c4('0x29')]({'where':{'type':_0x5374fd,'resourceId':_0x4dc8cc['id']}})['then'](function(){return _0x59498e;});})[_0xe4c4('0x26')](function(){_0x1db719['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cea1f,_0x5d66ab){return function(_0x3221cd){if(!_0x3221cd){_0x4cea1f['sendStatus'](0x194);}return _0x3221cd;};}function handleError(_0x5b5ea5,_0xe2c1b4){_0xe2c1b4=_0xe2c1b4||0x1f4;return function(_0x11deab){logger['error'](_0x11deab['stack']);if(_0x11deab[_0xe4c4('0x2a')]){delete _0x11deab[_0xe4c4('0x2a')];}_0x5b5ea5['status'](_0xe2c1b4)[_0xe4c4('0x2b')](_0x11deab);};}exports[_0xe4c4('0x2c')]=function(_0x3f60fc,_0x48060e){var _0x5d49fd={},_0x46db7e={},_0x2c5652={'count':0x0,'rows':[]};var _0x12bde8=_[_0xe4c4('0x2d')](db['Tag']['rawAttributes'],function(_0x1731c8){return{'name':_0x1731c8[_0xe4c4('0x2e')],'type':_0x1731c8['type'][_0xe4c4('0x2f')]};});_0x46db7e[_0xe4c4('0x30')]=_[_0xe4c4('0x2d')](_0x12bde8,'name');_0x46db7e[_0xe4c4('0x31')]=_['keys'](_0x3f60fc[_0xe4c4('0x31')]);_0x46db7e[_0xe4c4('0x32')]=_[_0xe4c4('0x33')](_0x46db7e[_0xe4c4('0x30')],_0x46db7e[_0xe4c4('0x31')]);_0x5d49fd[_0xe4c4('0x34')]=_[_0xe4c4('0x33')](_0x46db7e[_0xe4c4('0x30')],qs[_0xe4c4('0x35')](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x35')]));_0x5d49fd[_0xe4c4('0x34')]=_0x5d49fd['attributes'][_0xe4c4('0x36')]?_0x5d49fd[_0xe4c4('0x34')]:_0x46db7e[_0xe4c4('0x30')];if(!_0x3f60fc['query'][_0xe4c4('0x37')](_0xe4c4('0x38'))){_0x5d49fd[_0xe4c4('0x1f')]=qs['limit'](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x1f')]);_0x5d49fd[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x1d')]);}_0x5d49fd[_0xe4c4('0x39')]=qs[_0xe4c4('0x3a')](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x3a')]);_0x5d49fd['where']=qs[_0xe4c4('0x32')](_[_0xe4c4('0x3b')](_0x3f60fc[_0xe4c4('0x31')],_0x46db7e[_0xe4c4('0x32')]),_0x12bde8);if(_0x3f60fc['query'][_0xe4c4('0x3c')]){_0x5d49fd[_0xe4c4('0x3d')]=_['merge'](_0x5d49fd[_0xe4c4('0x3d')],{'$or':_[_0xe4c4('0x2d')](_0x12bde8,function(_0x4db15d){if(_0x4db15d[_0xe4c4('0x3e')]!==_0xe4c4('0x3f')){var _0x127bcd={};_0x127bcd[_0x4db15d[_0xe4c4('0x2a')]]={'$like':'%'+_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x3c')]+'%'};return _0x127bcd;}})});}_0x5d49fd=_[_0xe4c4('0x40')]({},_0x5d49fd,_0x3f60fc[_0xe4c4('0x41')]);var _0x1e457c={'where':_0x5d49fd[_0xe4c4('0x3d')]};return db[_0xe4c4('0x42')][_0xe4c4('0x20')](_0x1e457c)['then'](function(_0x3773dd){_0x2c5652[_0xe4c4('0x20')]=_0x3773dd;if(_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x43')]){_0x5d49fd[_0xe4c4('0x44')]=[{'all':!![]}];}return db[_0xe4c4('0x42')]['findAll'](_0x5d49fd);})[_0xe4c4('0x26')](function(_0x526bef){_0x2c5652[_0xe4c4('0x45')]=_0x526bef;return _0x2c5652;})[_0xe4c4('0x26')](respondWithFilteredResult(_0x48060e,_0x5d49fd))[_0xe4c4('0x46')](handleError(_0x48060e,null));};exports[_0xe4c4('0x47')]=function(_0x48177f,_0x566eb7){var _0x55b527={'raw':!![],'where':{'id':_0x48177f[_0xe4c4('0x48')]['id']}},_0x23a668={};_0x23a668[_0xe4c4('0x30')]=_['keys'](db[_0xe4c4('0x42')][_0xe4c4('0x49')]);_0x23a668[_0xe4c4('0x31')]=_[_0xe4c4('0x4a')](_0x48177f['query']);_0x23a668[_0xe4c4('0x32')]=_[_0xe4c4('0x33')](_0x23a668[_0xe4c4('0x30')],_0x23a668[_0xe4c4('0x31')]);_0x55b527[_0xe4c4('0x34')]=_[_0xe4c4('0x33')](_0x23a668[_0xe4c4('0x30')],qs[_0xe4c4('0x35')](_0x48177f[_0xe4c4('0x31')]['fields']));_0x55b527[_0xe4c4('0x34')]=_0x55b527['attributes'][_0xe4c4('0x36')]?_0x55b527[_0xe4c4('0x34')]:_0x23a668[_0xe4c4('0x30')];if(_0x48177f[_0xe4c4('0x31')][_0xe4c4('0x43')]){_0x55b527[_0xe4c4('0x44')]=[{'all':!![]}];}_0x55b527=_[_0xe4c4('0x40')]({},_0x55b527,_0x48177f[_0xe4c4('0x41')]);return db[_0xe4c4('0x42')][_0xe4c4('0x4b')](_0x55b527)[_0xe4c4('0x26')](handleEntityNotFound(_0x566eb7,null))[_0xe4c4('0x26')](respondWithResult(_0x566eb7,null))[_0xe4c4('0x46')](handleError(_0x566eb7,null));};exports[_0xe4c4('0x4c')]=function(_0x535bcc,_0x4922f5){return db[_0xe4c4('0x42')][_0xe4c4('0x4c')](_0x535bcc['body'],{})[_0xe4c4('0x26')](function(_0x2853da){var _0x1211f9=_0x535bcc[_0xe4c4('0x4d')][_0xe4c4('0x27')]({'plain':!![]});if(!_0x1211f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1211f9[_0xe4c4('0x4e')]===_0xe4c4('0x4d')){var _0x4f6e03=_0x2853da[_0xe4c4('0x27')]({'plain':!![]});var _0x24b0e7='Tags';return db[_0xe4c4('0x4f')]['find']({'where':{'name':_0x24b0e7,'userProfileId':_0x1211f9[_0xe4c4('0x50')]},'raw':!![]})[_0xe4c4('0x26')](function(_0x2a54ef){if(_0x2a54ef&&_0x2a54ef[_0xe4c4('0x51')]===0x0){return db[_0xe4c4('0x52')]['create']({'name':_0x4f6e03[_0xe4c4('0x2a')],'resourceId':_0x4f6e03['id'],'type':_0x2a54ef[_0xe4c4('0x2a')],'sectionId':_0x2a54ef['id']},{})[_0xe4c4('0x26')](function(){return _0x2853da;});}else{return _0x2853da;}})[_0xe4c4('0x46')](function(_0x3c9fc4){logger[_0xe4c4('0x53')](_0xe4c4('0x54'),_0x3c9fc4);throw _0x3c9fc4;});}return _0x2853da;})[_0xe4c4('0x26')](respondWithResult(_0x4922f5,0xc9))[_0xe4c4('0x46')](handleError(_0x4922f5,null));};exports[_0xe4c4('0x25')]=function(_0x1fe354,_0x1940e3){if(_0x1fe354[_0xe4c4('0x55')]['id']){delete _0x1fe354[_0xe4c4('0x55')]['id'];}return db[_0xe4c4('0x42')][_0xe4c4('0x4b')]({'where':{'id':_0x1fe354['params']['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x1940e3,null))[_0xe4c4('0x26')](saveUpdates(_0x1fe354[_0xe4c4('0x55')],null))['then'](respondWithResult(_0x1940e3,null))[_0xe4c4('0x46')](handleError(_0x1940e3,null));};exports[_0xe4c4('0x29')]=function(_0x35f750,_0x512ca9){return db[_0xe4c4('0x42')]['find']({'where':{'id':_0x35f750[_0xe4c4('0x48')]['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x512ca9,null))[_0xe4c4('0x26')](removeEntity(_0x512ca9,null))['catch'](handleError(_0x512ca9,null));};
\ No newline at end of file
index 566f153..6ee99b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad74=['../../config/logger','api','bluebird','path','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util'];(function(_0x383f19,_0x4d4844){var _0x5452a5=function(_0x45c45d){while(--_0x45c45d){_0x383f19['push'](_0x383f19['shift']());}};_0x5452a5(++_0x4d4844);}(_0xad74,0x17e));var _0x4ad7=function(_0x1e1a40,_0x120381){_0x1e1a40=_0x1e1a40-0x0;var _0x233c8e=_0xad74[_0x1e1a40];return _0x233c8e;};'use strict';var _=require(_0x4ad7('0x0'));var util=require(_0x4ad7('0x1'));var logger=require(_0x4ad7('0x2'))(_0x4ad7('0x3'));var moment=require('moment');var BPromise=require(_0x4ad7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ad7('0x5'));var rimraf=require('rimraf');var config=require(_0x4ad7('0x6'));var attributes=require(_0x4ad7('0x7'));module[_0x4ad7('0x8')]=function(_0x457fce,_0x3277c7){return _0x457fce[_0x4ad7('0x9')](_0x4ad7('0xa'),attributes,{'tableName':_0x4ad7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc9cd=['./tag.attributes','exports','define','Tag','tools_tags','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x10d52b,_0xc6a4f1){var _0x2bf44a=function(_0x286009){while(--_0x286009){_0x10d52b['push'](_0x10d52b['shift']());}};_0x2bf44a(++_0xc6a4f1);}(_0xc9cd,0x89));var _0xdc9c=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xc9cd[_0x31b5a5];return _0x364cc9;};'use strict';var _=require(_0xdc9c('0x0'));var util=require('util');var logger=require(_0xdc9c('0x1'))(_0xdc9c('0x2'));var moment=require(_0xdc9c('0x3'));var BPromise=require(_0xdc9c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc9c('0x5'));var rimraf=require('rimraf');var config=require(_0xdc9c('0x6'));var attributes=require(_0xdc9c('0x7'));module[_0xdc9c('0x8')]=function(_0x95cac4,_0x258a8e){return _0x95cac4[_0xdc9c('0x9')](_0xdc9c('0xa'),attributes,{'tableName':_0xdc9c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b86c880..fec22bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe181=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0xe181,0x68));var _0x1e18=function(_0xc85fbd,_0x21d671){_0xc85fbd=_0xc85fbd-0x0;var _0x64f2d9=_0xe181[_0xc85fbd];return _0x64f2d9;};'use strict';var _=require(_0x1e18('0x0'));var util=require('util');var moment=require(_0x1e18('0x1'));var BPromise=require(_0x1e18('0x2'));var rs=require(_0x1e18('0x3'));var fs=require('fs');var Redis=require(_0x1e18('0x4'));var db=require(_0x1e18('0x5'))['db'];var utils=require(_0x1e18('0x6'));var logger=require(_0x1e18('0x7'))('rpc');var config=require(_0x1e18('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1e18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x182c98,_0x46ba95,_0x25b786){return new BPromise(function(_0x9f9541,_0x398f77){return client['request'](_0x182c98,_0x25b786)[_0x1e18('0xa')](function(_0x40fda9){logger[_0x1e18('0xb')](_0x1e18('0xc'),_0x46ba95,_0x1e18('0xd'));logger[_0x1e18('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x46ba95,_0x1e18('0xd'),JSON[_0x1e18('0xf')](_0x40fda9));if(_0x40fda9[_0x1e18('0x10')]){if(_0x40fda9[_0x1e18('0x10')][_0x1e18('0x11')]===0x1f4){logger[_0x1e18('0x10')](_0x1e18('0xc'),_0x46ba95,_0x40fda9[_0x1e18('0x10')]['message']);return _0x398f77(_0x40fda9[_0x1e18('0x10')]['message']);}logger[_0x1e18('0x10')]('Tag,\x20%s,\x20%s',_0x46ba95,_0x40fda9[_0x1e18('0x10')][_0x1e18('0x12')]);return _0x9f9541(_0x40fda9[_0x1e18('0x10')][_0x1e18('0x12')]);}else{logger[_0x1e18('0xb')](_0x1e18('0xc'),_0x46ba95,_0x1e18('0xd'));_0x9f9541(_0x40fda9[_0x1e18('0x13')][_0x1e18('0x12')]);}})[_0x1e18('0x14')](function(_0x12ef98){logger[_0x1e18('0x10')](_0x1e18('0xc'),_0x46ba95,_0x12ef98);_0x398f77(_0x12ef98);});});}
\ No newline at end of file
+var _0xb332=['ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xb332,0xd9));var _0x2b33=function(_0x4f83ca,_0x46f67a){_0x4f83ca=_0x4f83ca-0x0;var _0x1fbac3=_0xb332[_0x4f83ca];return _0x1fbac3;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var moment=require(_0x2b33('0x1'));var BPromise=require(_0x2b33('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2b33('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b33('0x4'));var logger=require('../../config/logger')(_0x2b33('0x5'));var config=require('../../config/environment');var jayson=require(_0x2b33('0x6'));var client=jayson[_0x2b33('0x7')][_0x2b33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x461d44,_0x5a7a3f,_0x5ccf2d){return new BPromise(function(_0x4302b7,_0x5f29ab){return client[_0x2b33('0x9')](_0x461d44,_0x5ccf2d)[_0x2b33('0xa')](function(_0x2f2cb3){logger[_0x2b33('0xb')]('Tag,\x20%s,\x20%s',_0x5a7a3f,_0x2b33('0xc'));logger[_0x2b33('0xd')](_0x2b33('0xe'),_0x5a7a3f,_0x2b33('0xc'),JSON[_0x2b33('0xf')](_0x2f2cb3));if(_0x2f2cb3[_0x2b33('0x10')]){if(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x11')]===0x1f4){logger[_0x2b33('0x10')](_0x2b33('0x12'),_0x5a7a3f,_0x2f2cb3[_0x2b33('0x10')]['message']);return _0x5f29ab(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x13')]);}logger[_0x2b33('0x10')]('Tag,\x20%s,\x20%s',_0x5a7a3f,_0x2f2cb3[_0x2b33('0x10')]['message']);return _0x4302b7(_0x2f2cb3[_0x2b33('0x10')][_0x2b33('0x13')]);}else{logger[_0x2b33('0xb')]('Tag,\x20%s,\x20%s',_0x5a7a3f,'request\x20sent');_0x4302b7(_0x2f2cb3[_0x2b33('0x14')][_0x2b33('0x13')]);}})[_0x2b33('0x15')](function(_0x2f5119){logger[_0x2b33('0x10')]('Tag,\x20%s,\x20%s',_0x5a7a3f,_0x2f5119);_0x5f29ab(_0x2f5119);});});}
\ No newline at end of file
index 614696c..418ef50 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 639eaad..851e414 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['exports','STRING'];(function(_0x531adc,_0x11312f){var _0xcb04b6=function(_0x16d58a){while(--_0x16d58a){_0x531adc['push'](_0x531adc['shift']());}};_0xcb04b6(++_0x11312f);}(_0x757a,0xde));var _0xa757=function(_0xa94fc4,_0x19c5b7){_0xa94fc4=_0xa94fc4-0x0;var _0x502f26=_0x757a[_0xa94fc4];return _0x502f26;};'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(_0x1fb955,_0x27a157){var _0x54d5f4=function(_0x5683bf){while(--_0x5683bf){_0x1fb955['push'](_0x1fb955['shift']());}};_0x54d5f4(++_0x27a157);}(_0x757a,0xde));var _0xa757=function(_0xcbfdcb,_0x2fa9a8){_0xcbfdcb=_0xcbfdcb-0x0;var _0x4d89c9=_0x757a[_0xcbfdcb];return _0x4d89c9;};'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 1d41232..816188c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa271=['update','params','destroy','getQueues','findOne','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','pick','toLowerCase','Queues','addQueues','add','ids','removeQueues','remove','Voice','Sms','Openchannel','sequelize','transaction','through','penalty','QueueId','defaults','TeamVoiceQueue','User','Queue','findOrCreate','emit','interface','UserVoiceQueueRt','upsert','SIP/%s','voicePause','all','UserVoicePrefix','VoicePrefixId','addAgents','spread','removeAgents','isArray','Chat','Mail','Whatsapp','Queue:remove','TeamVoicePrefix','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','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','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','get','Teams','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','Team','findAll','then','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x2bdde8,_0x43c634){var _0x259cff=function(_0xc263b9){while(--_0xc263b9){_0x2bdde8['push'](_0x2bdde8['shift']());}};_0x259cff(++_0x43c634);}(_0xa271,0x13b));var _0x1a27=function(_0x7f816c,_0x25f12e){_0x7f816c=_0x7f816c-0x0;var _0x9106ca=_0xa271[_0x7f816c];return _0x9106ca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1a27('0x0'));var jsonpatch=require(_0x1a27('0x1'));var rp=require(_0x1a27('0x2'));var moment=require(_0x1a27('0x3'));var BPromise=require(_0x1a27('0x4'));var Mustache=require(_0x1a27('0x5'));var util=require(_0x1a27('0x6'));var path=require(_0x1a27('0x7'));var sox=require(_0x1a27('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1a27('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1a27('0xa'));var toCsv=require(_0x1a27('0xb'));var querystring=require(_0x1a27('0xc'));var Papa=require(_0x1a27('0xd'));var Redis=require(_0x1a27('0xe'));var authService=require(_0x1a27('0xf'));var qs=require(_0x1a27('0x10'));var as=require(_0x1a27('0x11'));var hardwareService=require(_0x1a27('0x12'));var logger=require(_0x1a27('0x13'))('api');var utils=require(_0x1a27('0x14'));var config=require(_0x1a27('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x1a27('0x16')]=_['defaults'](config[_0x1a27('0x16')],{'host':_0x1a27('0x17'),'port':0x18eb});var socket=require(_0x1a27('0x18'))(new Redis(config[_0x1a27('0x16')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x58a013,_0xd073ac){_0xd073ac=_0xd073ac||0xcc;return function(_0x3c00ed){if(_0x3c00ed){return _0x58a013[_0x1a27('0x19')](_0xd073ac);}return _0x58a013[_0x1a27('0x1a')](_0xd073ac)['end']();};}function respondWithResult(_0x28709e,_0x5663a7){_0x5663a7=_0x5663a7||0xc8;return function(_0x4b29c5){if(_0x4b29c5){return _0x28709e[_0x1a27('0x1a')](_0x5663a7)[_0x1a27('0x1b')](_0x4b29c5);}};}function respondWithFilteredResult(_0x53a92e,_0xef265a){return function(_0x57586b){if(_0x57586b){var _0x4fa762=typeof _0xef265a[_0x1a27('0x1c')]===_0x1a27('0x1d')&&typeof _0xef265a[_0x1a27('0x1e')]==='undefined';var _0x3aca87=_0x57586b[_0x1a27('0x1f')];var _0x28e20b=_0x4fa762?0x0:_0xef265a[_0x1a27('0x1c')];var _0x52461e=_0x4fa762?_0x57586b['count']:_0xef265a[_0x1a27('0x1c')]+_0xef265a[_0x1a27('0x1e')];var _0x40b5a9;if(_0x52461e>=_0x3aca87){_0x52461e=_0x3aca87;_0x40b5a9=0xc8;}else{_0x40b5a9=0xce;}_0x53a92e['status'](_0x40b5a9);return _0x53a92e[_0x1a27('0x20')]('Content-Range',_0x28e20b+'-'+_0x52461e+'/'+_0x3aca87)['json'](_0x57586b);}return null;};}function patchUpdates(_0x5ea9be){return function(_0x5b1589){try{jsonpatch[_0x1a27('0x21')](_0x5b1589,_0x5ea9be,!![]);}catch(_0x2c27ab){return BPromise[_0x1a27('0x22')](_0x2c27ab);}return _0x5b1589[_0x1a27('0x23')]();};}function saveUpdates(_0x2569b2,_0x51c685){return function(_0x510c93){if(_0x510c93){return _0x510c93['update'](_0x2569b2)['then'](function(_0x2547b7){return _0x2547b7;});}return null;};}function removeEntity(_0x2b1083,_0x19ce9a){return function(_0x384a04){if(_0x384a04){return _0x384a04['destroy']()['then'](function(){var _0x4b7d52=_0x384a04[_0x1a27('0x24')]({'plain':!![]});var _0x348f66=_0x1a27('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x348f66,'resourceId':_0x4b7d52['id']}})['then'](function(){return _0x384a04;});})['then'](function(){_0x2b1083[_0x1a27('0x1a')](0xcc)[_0x1a27('0x26')]();});}};}function handleEntityNotFound(_0x203b04,_0x464157){return function(_0x43f706){if(!_0x43f706){_0x203b04[_0x1a27('0x19')](0x194);}return _0x43f706;};}function handleError(_0x16473e,_0x4a58f9){_0x4a58f9=_0x4a58f9||0x1f4;return function(_0x5968a8){logger[_0x1a27('0x27')](_0x5968a8[_0x1a27('0x28')]);if(_0x5968a8[_0x1a27('0x29')]){delete _0x5968a8[_0x1a27('0x29')];}_0x16473e[_0x1a27('0x1a')](_0x4a58f9)[_0x1a27('0x2a')](_0x5968a8);};}exports[_0x1a27('0x2b')]=function(_0x5dfa0a,_0x5ccfc){var _0x1723cd={},_0x56ecc5={},_0x2d02e3={'count':0x0,'rows':[]};var _0x5d2d7c=_[_0x1a27('0x2c')](db['Team'][_0x1a27('0x2d')],function(_0x370501){return{'name':_0x370501['fieldName'],'type':_0x370501[_0x1a27('0x2e')][_0x1a27('0x2f')]};});_0x56ecc5[_0x1a27('0x30')]=_['map'](_0x5d2d7c,_0x1a27('0x29'));_0x56ecc5[_0x1a27('0x31')]=_[_0x1a27('0x32')](_0x5dfa0a[_0x1a27('0x31')]);_0x56ecc5[_0x1a27('0x33')]=_[_0x1a27('0x34')](_0x56ecc5[_0x1a27('0x30')],_0x56ecc5[_0x1a27('0x31')]);_0x1723cd['attributes']=_['intersection'](_0x56ecc5[_0x1a27('0x30')],qs[_0x1a27('0x35')](_0x5dfa0a[_0x1a27('0x31')]['fields']));_0x1723cd['attributes']=_0x1723cd['attributes'][_0x1a27('0x36')]?_0x1723cd[_0x1a27('0x37')]:_0x56ecc5[_0x1a27('0x30')];if(!_0x5dfa0a[_0x1a27('0x31')][_0x1a27('0x38')](_0x1a27('0x39'))){_0x1723cd[_0x1a27('0x1e')]=qs[_0x1a27('0x1e')](_0x5dfa0a[_0x1a27('0x31')][_0x1a27('0x1e')]);_0x1723cd[_0x1a27('0x1c')]=qs[_0x1a27('0x1c')](_0x5dfa0a[_0x1a27('0x31')][_0x1a27('0x1c')]);}_0x1723cd[_0x1a27('0x3a')]=qs[_0x1a27('0x3b')](_0x5dfa0a[_0x1a27('0x31')]['sort']);_0x1723cd[_0x1a27('0x3c')]=qs[_0x1a27('0x33')](_['pick'](_0x5dfa0a['query'],_0x56ecc5['filters']),_0x5d2d7c);if(_0x5dfa0a[_0x1a27('0x31')]['filter']){_0x1723cd['where']=_[_0x1a27('0x3d')](_0x1723cd[_0x1a27('0x3c')],{'$or':_[_0x1a27('0x2c')](_0x5d2d7c,function(_0x19e1b4){if(_0x19e1b4[_0x1a27('0x2e')]!==_0x1a27('0x3e')){var _0x1ec714={};_0x1ec714[_0x19e1b4[_0x1a27('0x29')]]={'$like':'%'+_0x5dfa0a[_0x1a27('0x31')][_0x1a27('0x3f')]+'%'};return _0x1ec714;}})});}_0x1723cd=_['merge']({},_0x1723cd,_0x5dfa0a[_0x1a27('0x40')]);var _0x163f36={'where':_0x1723cd[_0x1a27('0x3c')]};return db['Team'][_0x1a27('0x1f')](_0x163f36)['then'](function(_0x32e7bd){_0x2d02e3['count']=_0x32e7bd;if(_0x5dfa0a[_0x1a27('0x31')][_0x1a27('0x41')]){_0x1723cd[_0x1a27('0x42')]=[{'all':!![]}];}return db[_0x1a27('0x43')][_0x1a27('0x44')](_0x1723cd);})[_0x1a27('0x45')](function(_0x2a73c0){_0x2d02e3['rows']=_0x2a73c0;return _0x2d02e3;})['then'](respondWithFilteredResult(_0x5ccfc,_0x1723cd))[_0x1a27('0x46')](handleError(_0x5ccfc,null));};exports[_0x1a27('0x47')]=function(_0x11d244,_0x62da96){var _0x41d9d3={'raw':![],'where':{'id':_0x11d244['params']['id']}},_0x2b4575={};_0x2b4575['model']=_['keys'](db[_0x1a27('0x43')]['rawAttributes']);_0x2b4575[_0x1a27('0x31')]=_[_0x1a27('0x32')](_0x11d244[_0x1a27('0x31')]);_0x2b4575['filters']=_[_0x1a27('0x34')](_0x2b4575['model'],_0x2b4575['query']);_0x41d9d3['attributes']=_[_0x1a27('0x34')](_0x2b4575['model'],qs[_0x1a27('0x35')](_0x11d244['query'][_0x1a27('0x35')]));_0x41d9d3[_0x1a27('0x37')]=_0x41d9d3[_0x1a27('0x37')][_0x1a27('0x36')]?_0x41d9d3[_0x1a27('0x37')]:_0x2b4575[_0x1a27('0x30')];if(_0x11d244['query'][_0x1a27('0x41')]){_0x41d9d3['include']=[{'all':!![]}];}_0x41d9d3=_['merge']({},_0x41d9d3,_0x11d244[_0x1a27('0x40')]);return db[_0x1a27('0x43')]['find'](_0x41d9d3)['then'](handleEntityNotFound(_0x62da96,null))['then'](respondWithResult(_0x62da96,null))[_0x1a27('0x46')](handleError(_0x62da96,null));};exports['create']=function(_0x58b09d,_0x80d8ec){return db[_0x1a27('0x43')][_0x1a27('0x48')](_0x58b09d[_0x1a27('0x49')],{})[_0x1a27('0x45')](function(_0x55d3c2){var _0x439390=_0x58b09d[_0x1a27('0x4a')]['get']({'plain':!![]});if(!_0x439390)throw new Error(_0x1a27('0x4b'));if(_0x439390['role']==='user'){var _0x588de5=_0x55d3c2[_0x1a27('0x24')]({'plain':!![]});var _0x5ba019=_0x1a27('0x25');return db[_0x1a27('0x4c')][_0x1a27('0x4d')]({'where':{'name':_0x5ba019,'userProfileId':_0x439390[_0x1a27('0x4e')]},'raw':!![]})[_0x1a27('0x45')](function(_0x5054a6){if(_0x5054a6&&_0x5054a6[_0x1a27('0x4f')]===0x0){return db['UserProfileResource'][_0x1a27('0x48')]({'name':_0x588de5[_0x1a27('0x29')],'resourceId':_0x588de5['id'],'type':_0x5054a6[_0x1a27('0x29')],'sectionId':_0x5054a6['id']},{})[_0x1a27('0x45')](function(){return _0x55d3c2;});}else{return _0x55d3c2;}})[_0x1a27('0x46')](function(_0x572828){logger[_0x1a27('0x27')](_0x1a27('0x50'),_0x572828);throw _0x572828;});}return _0x55d3c2;})[_0x1a27('0x45')](respondWithResult(_0x80d8ec,0xc9))['catch'](handleError(_0x80d8ec,null));};exports[_0x1a27('0x51')]=function(_0x194d26,_0x24a65c){if(_0x194d26[_0x1a27('0x49')]['id']){delete _0x194d26[_0x1a27('0x49')]['id'];}return db['Team'][_0x1a27('0x4d')]({'where':{'id':_0x194d26[_0x1a27('0x52')]['id']}})['then'](handleEntityNotFound(_0x24a65c,null))[_0x1a27('0x45')](saveUpdates(_0x194d26[_0x1a27('0x49')],null))[_0x1a27('0x45')](respondWithResult(_0x24a65c,null))[_0x1a27('0x46')](handleError(_0x24a65c,null));};exports[_0x1a27('0x53')]=function(_0x166baa,_0x2854cb){return db[_0x1a27('0x43')][_0x1a27('0x4d')]({'where':{'id':_0x166baa[_0x1a27('0x52')]['id']}})[_0x1a27('0x45')](handleEntityNotFound(_0x2854cb,null))[_0x1a27('0x45')](removeEntity(_0x2854cb,null))['catch'](handleError(_0x2854cb,null));};exports[_0x1a27('0x54')]=function(_0x89c3ce,_0x5d1554,_0x42bced){return db[_0x1a27('0x43')][_0x1a27('0x55')]({'where':{'id':_0x89c3ce['params']['id']}})[_0x1a27('0x45')](handleEntityNotFound(_0x5d1554,null))[_0x1a27('0x45')](function(_0x58e08c){if(!_0x89c3ce['query']['channel']||!utils[_0x1a27('0x56')](_0x89c3ce['query'][_0x1a27('0x57')])){throw new db[(_0x1a27('0x58'))][(_0x1a27('0x59'))](_0x1a27('0x5a'));}var _0x46ad2f={};var _0x41d308={};_0x41d308['model']=_[_0x1a27('0x32')](db[_[_0x1a27('0x5b')](_0x89c3ce['query'][_0x1a27('0x57')]['toLowerCase']())+'Queue'][_0x1a27('0x2d')]);_0x41d308['query']=_['keys'](_0x89c3ce['query']);_0x41d308['filters']=_[_0x1a27('0x34')](_0x41d308[_0x1a27('0x30')],_0x41d308[_0x1a27('0x31')]);_0x46ad2f['attributes']=_[_0x1a27('0x34')](_0x41d308[_0x1a27('0x30')],qs['fields'](_0x89c3ce[_0x1a27('0x31')][_0x1a27('0x35')]));_0x46ad2f[_0x1a27('0x37')]=_0x46ad2f[_0x1a27('0x37')]['length']?_0x46ad2f[_0x1a27('0x37')]:_0x41d308['model'];_0x46ad2f[_0x1a27('0x1e')]=qs['limit'](_0x89c3ce[_0x1a27('0x31')][_0x1a27('0x1e')]);_0x46ad2f[_0x1a27('0x1c')]=qs['offset'](_0x89c3ce[_0x1a27('0x31')]['offset']);_0x46ad2f[_0x1a27('0x3a')]=qs[_0x1a27('0x3b')](_0x89c3ce[_0x1a27('0x31')]['sort']);_0x46ad2f[_0x1a27('0x3c')]=qs[_0x1a27('0x33')](_[_0x1a27('0x5c')](_0x89c3ce[_0x1a27('0x31')],_0x41d308[_0x1a27('0x33')]));_0x46ad2f=_[_0x1a27('0x3d')]({},_0x46ad2f,_0x89c3ce[_0x1a27('0x40')]);return _0x58e08c[_0x1a27('0x24')+_['capitalize'](_0x89c3ce['query'][_0x1a27('0x57')][_0x1a27('0x5d')]())+_0x1a27('0x5e')](_0x46ad2f);})[_0x1a27('0x45')](respondWithResult(_0x5d1554,null))[_0x1a27('0x46')](handleError(_0x5d1554,null));};exports[_0x1a27('0x5f')]=function(_0x5b3e55,_0x16c79c,_0x73f788){return db[_0x1a27('0x43')][_0x1a27('0x55')]({'where':{'id':_0x5b3e55[_0x1a27('0x52')]['id']}})[_0x1a27('0x45')](function(_0x19efd5){if(_0x19efd5){if(!_0x5b3e55['body'][_0x1a27('0x57')]||!utils[_0x1a27('0x56')](_0x5b3e55[_0x1a27('0x49')]['channel'])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x19efd5[_0x1a27('0x60')+_[_0x1a27('0x5b')](_0x5b3e55[_0x1a27('0x49')][_0x1a27('0x57')][_0x1a27('0x5d')]())+_0x1a27('0x5e')](_0x5b3e55[_0x1a27('0x49')][_0x1a27('0x61')]);}return null;})['then'](handleEntityNotFound(_0x16c79c,null))[_0x1a27('0x45')](respondWithStatusCode(_0x16c79c,null))['catch'](handleError(_0x16c79c,null));};exports[_0x1a27('0x62')]=function(_0x2e0a9d,_0x5f4ad3,_0x46d269){return db[_0x1a27('0x43')][_0x1a27('0x55')]({'where':{'id':_0x2e0a9d[_0x1a27('0x52')]['id']}})[_0x1a27('0x45')](function(_0x31a5bd){if(_0x31a5bd){if(!_0x2e0a9d[_0x1a27('0x31')][_0x1a27('0x57')]||!utils[_0x1a27('0x56')](_0x2e0a9d[_0x1a27('0x31')]['channel'])){throw new db[(_0x1a27('0x58'))][(_0x1a27('0x59'))]('Unknown\x20channel');}return _0x31a5bd[_0x1a27('0x63')+_[_0x1a27('0x5b')](_0x2e0a9d[_0x1a27('0x31')][_0x1a27('0x57')][_0x1a27('0x5d')]())+_0x1a27('0x5e')](_0x2e0a9d['query'][_0x1a27('0x61')]);}return null;})[_0x1a27('0x45')](handleEntityNotFound(_0x5f4ad3,null))[_0x1a27('0x45')](respondWithStatusCode(_0x5f4ad3,null))['catch'](handleError(_0x5f4ad3,null));};exports['addAgents']=function(_0x2ae778,_0x2a6198){var _0x867842=_['isArray'](_0x2ae778[_0x1a27('0x49')][_0x1a27('0x61')])?_0x2ae778['body']['ids']:[_0x2ae778[_0x1a27('0x49')][_0x1a27('0x61')]];var _0x437a8f=_0x2ae778[_0x1a27('0x52')]['id'];return db['Team']['find']({'where':{'id':_0x437a8f}})[_0x1a27('0x45')](handleEntityNotFound(_0x2a6198,null))[_0x1a27('0x45')](function(_0x1ab1e5){if(_0x1ab1e5){var _0x5ace58=[_0x1a27('0x64'),'Chat','Mail',_0x1a27('0x65'),'Fax',_0x1a27('0x66'),'Whatsapp'];return db[_0x1a27('0x67')][_0x1a27('0x68')](function(_0x1f6ad3){var _0x2d2ee1=_[_0x1a27('0x2c')](_0x5ace58,function(_0x17bd1c){var _0x23ae83={'attributes':['id',_0x1a27('0x29')]};if(_0x17bd1c===_0x1a27('0x64')){_0x23ae83[_0x1a27('0x69')]={'attributes':[_0x1a27('0x6a')]};}return _0x1ab1e5[_0x1a27('0x24')+_0x17bd1c+_0x1a27('0x5e')](_0x23ae83)[_0x1a27('0x45')](function(_0x491d10){var _0x10b6fd=_[_0x1a27('0x2c')](_0x491d10,function(_0x3891c6){var _0x4568de=_[_0x1a27('0x2c')](_0x867842,function(_0x389236){var _0x21fbb3={'where':{'UserId':_0x389236,[_0x17bd1c+_0x1a27('0x6b')]:_0x3891c6['id']},'transaction':_0x1f6ad3};if(_0x17bd1c===_0x1a27('0x64')){_0x21fbb3[_0x1a27('0x6c')]={'penalty':_0x3891c6[_0x1a27('0x6d')][_0x1a27('0x6a')]};}return db[_0x1a27('0x6e')+_0x17bd1c+_0x1a27('0x6f')][_0x1a27('0x70')](_0x21fbb3)[_0x1a27('0x45')](function(){socket[_0x1a27('0x71')]('user'+_0x17bd1c+'Queue:save',{'UserId':_0x389236,[_0x17bd1c+'QueueId']:_0x3891c6['id']});if(_0x17bd1c!==_0x1a27('0x64')){return;}return db[_0x1a27('0x6e')][_0x1a27('0x44')]({'where':{'id':_0x867842,'online':0x1},'attributes':['id',_0x1a27('0x29'),'online','voicePause',_0x1a27('0x72')],'raw':!![]})['then'](function(_0x1f515f){var _0x495a79=_[_0x1a27('0x2c')](_0x1f515f,function(_0x4f80f7){return db[_0x1a27('0x73')][_0x1a27('0x74')]({'membername':_0x4f80f7[_0x1a27('0x29')],'UserId':_0x4f80f7['id'],'queue_name':_0x3891c6[_0x1a27('0x29')],'VoiceQueueId':_0x3891c6['id'],'interface':_['isNil'](_0x4f80f7[_0x1a27('0x72')])?util['format'](_0x1a27('0x75'),_0x4f80f7[_0x1a27('0x29')]):_0x4f80f7[_0x1a27('0x72')],'paused':_0x4f80f7[_0x1a27('0x76')]||![],'penalty':_0x3891c6['TeamVoiceQueue']['penalty']},{'transaction':_0x1f6ad3});});return Promise[_0x1a27('0x77')](_0x495a79);});});});return Promise['all'](_0x4568de);});return Promise[_0x1a27('0x77')](_0x10b6fd);})[_0x1a27('0x45')](function(){return db['TeamVoicePrefix'][_0x1a27('0x55')]({'where':{'teamId':_0x437a8f}})[_0x1a27('0x45')](function(_0x43ff3f){if(_0x43ff3f){var _0x215247=_[_0x1a27('0x2c')](_0x867842,function(_0x32a9ef){db[_0x1a27('0x78')]['upsert']({'UserId':_0x32a9ef,'VoicePrefixId':_0x43ff3f[_0x1a27('0x79')]});});return Promise[_0x1a27('0x77')](_0x215247);}});});});return Promise[_0x1a27('0x77')](_0x2d2ee1)[_0x1a27('0x45')](function(){return _0x1ab1e5[_0x1a27('0x7a')](_0x867842,{'transaction':_0x1f6ad3})[_0x1a27('0x7b')](function(_0x400bae){return _0x400bae;});});});}})[_0x1a27('0x45')](respondWithResult(_0x2a6198,null))[_0x1a27('0x46')](handleError(_0x2a6198,null));};exports[_0x1a27('0x7c')]=function(_0x16d122,_0x14b760){var _0x385f73=_[_0x1a27('0x7d')](_0x16d122[_0x1a27('0x31')][_0x1a27('0x61')])?_0x16d122[_0x1a27('0x31')][_0x1a27('0x61')]:[_0x16d122[_0x1a27('0x31')][_0x1a27('0x61')]];var _0xc0ab14=_0x16d122[_0x1a27('0x52')]['id'];return db['Team']['find']({'where':{'id':_0xc0ab14}})[_0x1a27('0x45')](handleEntityNotFound(_0x14b760,null))[_0x1a27('0x45')](function(_0x23378c){if(_0x23378c){var _0x4dd7aa=[_0x1a27('0x64'),_0x1a27('0x7e'),_0x1a27('0x7f'),_0x1a27('0x65'),'Fax','Openchannel',_0x1a27('0x80')];return db[_0x1a27('0x67')][_0x1a27('0x68')](function(_0xa5e1ef){var _0x35323e=_[_0x1a27('0x2c')](_0x4dd7aa,function(_0x589a9d){var _0x1dd52a={'attributes':['id',_0x1a27('0x29')]};return _0x23378c[_0x1a27('0x24')+_0x589a9d+_0x1a27('0x5e')](_0x1dd52a)[_0x1a27('0x45')](function(_0x3fec44){var _0x6184d0=_[_0x1a27('0x2c')](_0x3fec44,function(_0x5e561d){return _0x5e561d[_0x1a27('0x7c')](_0x385f73,{'transaction':_0xa5e1ef})[_0x1a27('0x45')](function(){var _0x212f25=_[_0x1a27('0x2c')](_0x385f73,function(_0x236f30){socket[_0x1a27('0x71')](_0x1a27('0x4a')+_0x589a9d+_0x1a27('0x81'),{'UserId':Number(_0x236f30),[_0x589a9d+_0x1a27('0x6b')]:_0x5e561d['id']});if(_0x589a9d!=='Voice'){return;}return db[_0x1a27('0x73')]['destroy']({'where':{'VoiceQueueId':_0x5e561d['id'],'UserId':_0x236f30},'transaction':_0xa5e1ef});});return Promise[_0x1a27('0x77')](_0x212f25);});});return Promise[_0x1a27('0x77')](_0x6184d0);});});return Promise[_0x1a27('0x77')](_0x35323e)[_0x1a27('0x45')](function(){return _0x23378c[_0x1a27('0x7c')](_0x385f73,{'transaction':_0xa5e1ef});})[_0x1a27('0x45')](function(){return db[_0x1a27('0x82')][_0x1a27('0x55')]({'where':{'teamId':_0xc0ab14}})[_0x1a27('0x45')](function(_0x5abe8b){if(_0x5abe8b){var _0x3faca0=_[_0x1a27('0x2c')](_0x385f73,function(_0x2db526){db[_0x1a27('0x78')][_0x1a27('0x53')]({'where':{'UserId':_0x2db526,'VoicePrefixId':_0x5abe8b[_0x1a27('0x79')]}});});return Promise[_0x1a27('0x77')](_0x3faca0);}});});});}})[_0x1a27('0x45')](respondWithStatusCode(_0x14b760,null))[_0x1a27('0x46')](handleError(_0x14b760,null));};exports['getAgents']=function(_0x51c0aa,_0xb496e6,_0x3da301){var _0xa4e1f0={};var _0xc87401={};var _0x4f549b;var _0x4b743d;return db['Team'][_0x1a27('0x55')]({'where':{'id':_0x51c0aa[_0x1a27('0x52')]['id']}})[_0x1a27('0x45')](handleEntityNotFound(_0xb496e6,null))[_0x1a27('0x45')](function(_0x4b3005){if(_0x4b3005){_0x4f549b=_0x4b3005;_0xc87401[_0x1a27('0x30')]=_[_0x1a27('0x32')](db[_0x1a27('0x6e')]['rawAttributes']);_0xc87401[_0x1a27('0x31')]=_[_0x1a27('0x32')](_0x51c0aa[_0x1a27('0x31')]);_0xc87401[_0x1a27('0x33')]=_[_0x1a27('0x34')](_0xc87401[_0x1a27('0x30')],_0xc87401[_0x1a27('0x31')]);_0xa4e1f0[_0x1a27('0x37')]=_[_0x1a27('0x34')](_0xc87401[_0x1a27('0x30')],qs['fields'](_0x51c0aa[_0x1a27('0x31')]['fields']));_0xa4e1f0[_0x1a27('0x37')]=_0xa4e1f0[_0x1a27('0x37')][_0x1a27('0x36')]?_0xa4e1f0['attributes']:_0xc87401['model'];_0xa4e1f0[_0x1a27('0x3a')]=qs[_0x1a27('0x3b')](_0x51c0aa[_0x1a27('0x31')]['sort']);_0xa4e1f0[_0x1a27('0x3c')]=qs[_0x1a27('0x33')](_[_0x1a27('0x5c')](_0x51c0aa['query'],_0xc87401[_0x1a27('0x33')]));if(_0x51c0aa['query']['filter']){_0xa4e1f0[_0x1a27('0x3c')]=_['merge'](_0xa4e1f0[_0x1a27('0x3c')],{'$or':_[_0x1a27('0x2c')](_0xa4e1f0['attributes'],function(_0x544343){var _0x5ad36d={};_0x5ad36d[_0x544343]={'$like':'%'+_0x51c0aa['query']['filter']+'%'};return _0x5ad36d;})});}_0xa4e1f0=_[_0x1a27('0x3d')]({},_0xa4e1f0,_0x51c0aa[_0x1a27('0x40')]);return _0x4f549b[_0x1a27('0x83')](_0xa4e1f0);}})[_0x1a27('0x45')](function(_0x5d5636){if(_0x5d5636){_0x4b743d=_0x5d5636['length'];if(!_0x51c0aa['query'][_0x1a27('0x38')](_0x1a27('0x39'))){_0xa4e1f0['limit']=qs[_0x1a27('0x1e')](_0x51c0aa[_0x1a27('0x31')][_0x1a27('0x1e')]);_0xa4e1f0['offset']=qs[_0x1a27('0x1c')](_0x51c0aa['query'][_0x1a27('0x1c')]);}return _0x4f549b['getAgents'](_0xa4e1f0);}})['then'](function(_0x59b624){if(_0x59b624){return _0x59b624?{'count':_0x4b743d,'rows':_0x59b624}:null;}})[_0x1a27('0x45')](respondWithResult(_0xb496e6,null))[_0x1a27('0x46')](handleError(_0xb496e6,null));};
\ No newline at end of file
+var _0x0497=['Queue:save','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','addAgents','spread','Mail','Sms','Queue:remove','removeAgents','getAgents','sort','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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/environment','../../config/license/util','redis','defaults','socket.io-emitter','./team.socket','sendStatus','status','json','limit','undefined','offset','set','Content-Range','apply','save','then','destroy','get','Teams','UserProfileResource','end','name','index','Team','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','count','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','pick','Queues','addQueues','add','removeQueues','remove','ids','isArray','Chat','Fax','Openchannel','Whatsapp','sequelize','transaction','Voice','through','penalty','QueueId','TeamVoiceQueue','User','Queue','emit'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0x0497,0x9a));var _0x7049=function(_0x3a485b,_0x1a1b38){_0x3a485b=_0x3a485b-0x0;var _0x379adc=_0x0497[_0x3a485b];return _0x379adc;};'use strict';var emlformat=require(_0x7049('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7049('0x1'));var jsonpatch=require(_0x7049('0x2'));var rp=require('request-promise');var moment=require(_0x7049('0x3'));var BPromise=require(_0x7049('0x4'));var Mustache=require(_0x7049('0x5'));var util=require(_0x7049('0x6'));var path=require('path');var sox=require(_0x7049('0x7'));var csv=require(_0x7049('0x8'));var ejs=require(_0x7049('0x9'));var fs=require('fs');var fs_extra=require(_0x7049('0xa'));var _=require(_0x7049('0xb'));var squel=require(_0x7049('0xc'));var crypto=require('crypto');var jsforce=require(_0x7049('0xd'));var deskjs=require(_0x7049('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7049('0xf'));var Papa=require(_0x7049('0x10'));var Redis=require('ioredis');var authService=require(_0x7049('0x11'));var qs=require(_0x7049('0x12'));var as=require(_0x7049('0x13'));var hardwareService=require(_0x7049('0x14'));var logger=require(_0x7049('0x15'))(_0x7049('0x16'));var utils=require('../../config/utils');var config=require(_0x7049('0x17'));var licenseUtil=require(_0x7049('0x18'));var db=require('../../mysqldb')['db'];config[_0x7049('0x19')]=_[_0x7049('0x1a')](config[_0x7049('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x7049('0x1b'))(new Redis(config[_0x7049('0x19')]));require(_0x7049('0x1c'))['register'](socket);function respondWithStatusCode(_0x286b6c,_0x270140){_0x270140=_0x270140||0xcc;return function(_0x5ab1c3){if(_0x5ab1c3){return _0x286b6c[_0x7049('0x1d')](_0x270140);}return _0x286b6c[_0x7049('0x1e')](_0x270140)['end']();};}function respondWithResult(_0x5516f9,_0x46d308){_0x46d308=_0x46d308||0xc8;return function(_0x5f0b79){if(_0x5f0b79){return _0x5516f9[_0x7049('0x1e')](_0x46d308)[_0x7049('0x1f')](_0x5f0b79);}};}function respondWithFilteredResult(_0x5e441a,_0x401a58){return function(_0x1ae055){if(_0x1ae055){var _0x11d75c=typeof _0x401a58['offset']==='undefined'&&typeof _0x401a58[_0x7049('0x20')]===_0x7049('0x21');var _0xa2889a=_0x1ae055['count'];var _0x1a196f=_0x11d75c?0x0:_0x401a58['offset'];var _0x6328b6=_0x11d75c?_0x1ae055['count']:_0x401a58[_0x7049('0x22')]+_0x401a58[_0x7049('0x20')];var _0x12751d;if(_0x6328b6>=_0xa2889a){_0x6328b6=_0xa2889a;_0x12751d=0xc8;}else{_0x12751d=0xce;}_0x5e441a['status'](_0x12751d);return _0x5e441a[_0x7049('0x23')](_0x7049('0x24'),_0x1a196f+'-'+_0x6328b6+'/'+_0xa2889a)['json'](_0x1ae055);}return null;};}function patchUpdates(_0xac0579){return function(_0x5c957a){try{jsonpatch[_0x7049('0x25')](_0x5c957a,_0xac0579,!![]);}catch(_0x587155){return BPromise['reject'](_0x587155);}return _0x5c957a[_0x7049('0x26')]();};}function saveUpdates(_0x3cb67f,_0x6da08b){return function(_0x3d770d){if(_0x3d770d){return _0x3d770d['update'](_0x3cb67f)[_0x7049('0x27')](function(_0x2f3cf4){return _0x2f3cf4;});}return null;};}function removeEntity(_0x3ce092,_0x32723a){return function(_0x3bc8d8){if(_0x3bc8d8){return _0x3bc8d8[_0x7049('0x28')]()[_0x7049('0x27')](function(){var _0x295f3f=_0x3bc8d8[_0x7049('0x29')]({'plain':!![]});var _0x1d095c=_0x7049('0x2a');return db[_0x7049('0x2b')]['destroy']({'where':{'type':_0x1d095c,'resourceId':_0x295f3f['id']}})[_0x7049('0x27')](function(){return _0x3bc8d8;});})[_0x7049('0x27')](function(){_0x3ce092[_0x7049('0x1e')](0xcc)[_0x7049('0x2c')]();});}};}function handleEntityNotFound(_0x2de8e8,_0x50d646){return function(_0x534958){if(!_0x534958){_0x2de8e8[_0x7049('0x1d')](0x194);}return _0x534958;};}function handleError(_0x14a5bf,_0x4e6d78){_0x4e6d78=_0x4e6d78||0x1f4;return function(_0x54c28f){logger['error'](_0x54c28f['stack']);if(_0x54c28f[_0x7049('0x2d')]){delete _0x54c28f[_0x7049('0x2d')];}_0x14a5bf[_0x7049('0x1e')](_0x4e6d78)['send'](_0x54c28f);};}exports[_0x7049('0x2e')]=function(_0x205aea,_0x409dbc){var _0x36b261={},_0x340fd5={},_0x4a438f={'count':0x0,'rows':[]};var _0x381854=_['map'](db[_0x7049('0x2f')][_0x7049('0x30')],function(_0x3733a1){return{'name':_0x3733a1[_0x7049('0x31')],'type':_0x3733a1[_0x7049('0x32')][_0x7049('0x33')]};});_0x340fd5[_0x7049('0x34')]=_[_0x7049('0x35')](_0x381854,_0x7049('0x2d'));_0x340fd5[_0x7049('0x36')]=_[_0x7049('0x37')](_0x205aea[_0x7049('0x36')]);_0x340fd5[_0x7049('0x38')]=_[_0x7049('0x39')](_0x340fd5[_0x7049('0x34')],_0x340fd5[_0x7049('0x36')]);_0x36b261[_0x7049('0x3a')]=_[_0x7049('0x39')](_0x340fd5[_0x7049('0x34')],qs[_0x7049('0x3b')](_0x205aea[_0x7049('0x36')]['fields']));_0x36b261[_0x7049('0x3a')]=_0x36b261[_0x7049('0x3a')][_0x7049('0x3c')]?_0x36b261[_0x7049('0x3a')]:_0x340fd5['model'];if(!_0x205aea[_0x7049('0x36')][_0x7049('0x3d')](_0x7049('0x3e'))){_0x36b261[_0x7049('0x20')]=qs[_0x7049('0x20')](_0x205aea[_0x7049('0x36')]['limit']);_0x36b261['offset']=qs[_0x7049('0x22')](_0x205aea[_0x7049('0x36')][_0x7049('0x22')]);}_0x36b261[_0x7049('0x3f')]=qs['sort'](_0x205aea[_0x7049('0x36')]['sort']);_0x36b261['where']=qs['filters'](_['pick'](_0x205aea['query'],_0x340fd5[_0x7049('0x38')]),_0x381854);if(_0x205aea[_0x7049('0x36')][_0x7049('0x40')]){_0x36b261[_0x7049('0x41')]=_[_0x7049('0x42')](_0x36b261[_0x7049('0x41')],{'$or':_[_0x7049('0x35')](_0x381854,function(_0x4b33ac){if(_0x4b33ac[_0x7049('0x32')]!==_0x7049('0x43')){var _0x5ab9bc={};_0x5ab9bc[_0x4b33ac[_0x7049('0x2d')]]={'$like':'%'+_0x205aea[_0x7049('0x36')][_0x7049('0x40')]+'%'};return _0x5ab9bc;}})});}_0x36b261=_[_0x7049('0x42')]({},_0x36b261,_0x205aea['options']);var _0x3efede={'where':_0x36b261[_0x7049('0x41')]};return db[_0x7049('0x2f')]['count'](_0x3efede)[_0x7049('0x27')](function(_0x531b2f){_0x4a438f[_0x7049('0x44')]=_0x531b2f;if(_0x205aea[_0x7049('0x36')]['includeAll']){_0x36b261[_0x7049('0x45')]=[{'all':!![]}];}return db[_0x7049('0x2f')][_0x7049('0x46')](_0x36b261);})[_0x7049('0x27')](function(_0x88f70b){_0x4a438f['rows']=_0x88f70b;return _0x4a438f;})[_0x7049('0x27')](respondWithFilteredResult(_0x409dbc,_0x36b261))[_0x7049('0x47')](handleError(_0x409dbc,null));};exports[_0x7049('0x48')]=function(_0x1d1dbf,_0x3404b3){var _0x8bc4a3={'raw':![],'where':{'id':_0x1d1dbf[_0x7049('0x49')]['id']}},_0x5db642={};_0x5db642['model']=_['keys'](db['Team'][_0x7049('0x30')]);_0x5db642[_0x7049('0x36')]=_['keys'](_0x1d1dbf['query']);_0x5db642['filters']=_['intersection'](_0x5db642[_0x7049('0x34')],_0x5db642[_0x7049('0x36')]);_0x8bc4a3['attributes']=_[_0x7049('0x39')](_0x5db642['model'],qs[_0x7049('0x3b')](_0x1d1dbf[_0x7049('0x36')]['fields']));_0x8bc4a3['attributes']=_0x8bc4a3['attributes'][_0x7049('0x3c')]?_0x8bc4a3[_0x7049('0x3a')]:_0x5db642['model'];if(_0x1d1dbf[_0x7049('0x36')][_0x7049('0x4a')]){_0x8bc4a3[_0x7049('0x45')]=[{'all':!![]}];}_0x8bc4a3=_[_0x7049('0x42')]({},_0x8bc4a3,_0x1d1dbf['options']);return db[_0x7049('0x2f')][_0x7049('0x4b')](_0x8bc4a3)['then'](handleEntityNotFound(_0x3404b3,null))['then'](respondWithResult(_0x3404b3,null))['catch'](handleError(_0x3404b3,null));};exports['create']=function(_0x5a4a53,_0x42abfb){return db[_0x7049('0x2f')][_0x7049('0x4c')](_0x5a4a53[_0x7049('0x4d')],{})['then'](function(_0x306c26){var _0x18ae47=_0x5a4a53[_0x7049('0x4e')][_0x7049('0x29')]({'plain':!![]});if(!_0x18ae47)throw new Error(_0x7049('0x4f'));if(_0x18ae47[_0x7049('0x50')]===_0x7049('0x4e')){var _0x47c86d=_0x306c26['get']({'plain':!![]});var _0x1a585b=_0x7049('0x2a');return db[_0x7049('0x51')]['find']({'where':{'name':_0x1a585b,'userProfileId':_0x18ae47['userProfileId']},'raw':!![]})[_0x7049('0x27')](function(_0x4f8756){if(_0x4f8756&&_0x4f8756[_0x7049('0x52')]===0x0){return db[_0x7049('0x2b')][_0x7049('0x4c')]({'name':_0x47c86d[_0x7049('0x2d')],'resourceId':_0x47c86d['id'],'type':_0x4f8756[_0x7049('0x2d')],'sectionId':_0x4f8756['id']},{})[_0x7049('0x27')](function(){return _0x306c26;});}else{return _0x306c26;}})['catch'](function(_0x4cd749){logger['error'](_0x7049('0x53'),_0x4cd749);throw _0x4cd749;});}return _0x306c26;})[_0x7049('0x27')](respondWithResult(_0x42abfb,0xc9))['catch'](handleError(_0x42abfb,null));};exports[_0x7049('0x54')]=function(_0x1b0006,_0x1504f8){if(_0x1b0006[_0x7049('0x4d')]['id']){delete _0x1b0006[_0x7049('0x4d')]['id'];}return db[_0x7049('0x2f')][_0x7049('0x4b')]({'where':{'id':_0x1b0006[_0x7049('0x49')]['id']}})['then'](handleEntityNotFound(_0x1504f8,null))[_0x7049('0x27')](saveUpdates(_0x1b0006[_0x7049('0x4d')],null))[_0x7049('0x27')](respondWithResult(_0x1504f8,null))[_0x7049('0x47')](handleError(_0x1504f8,null));};exports[_0x7049('0x28')]=function(_0x319a3c,_0x104695){return db[_0x7049('0x2f')]['find']({'where':{'id':_0x319a3c[_0x7049('0x49')]['id']}})[_0x7049('0x27')](handleEntityNotFound(_0x104695,null))[_0x7049('0x27')](removeEntity(_0x104695,null))[_0x7049('0x47')](handleError(_0x104695,null));};exports[_0x7049('0x55')]=function(_0x15b2de,_0x4da095,_0x5d47d4){return db['Team'][_0x7049('0x56')]({'where':{'id':_0x15b2de[_0x7049('0x49')]['id']}})['then'](handleEntityNotFound(_0x4da095,null))['then'](function(_0x1b79ad){if(!_0x15b2de[_0x7049('0x36')][_0x7049('0x57')]||!utils[_0x7049('0x58')](_0x15b2de['query']['channel'])){throw new db[(_0x7049('0x59'))][(_0x7049('0x5a'))](_0x7049('0x5b'));}var _0x3ba37f={};var _0x689bad={};_0x689bad[_0x7049('0x34')]=_[_0x7049('0x37')](db[_[_0x7049('0x5c')](_0x15b2de['query'][_0x7049('0x57')][_0x7049('0x5d')]())+'Queue'][_0x7049('0x30')]);_0x689bad[_0x7049('0x36')]=_[_0x7049('0x37')](_0x15b2de[_0x7049('0x36')]);_0x689bad[_0x7049('0x38')]=_[_0x7049('0x39')](_0x689bad[_0x7049('0x34')],_0x689bad[_0x7049('0x36')]);_0x3ba37f['attributes']=_[_0x7049('0x39')](_0x689bad[_0x7049('0x34')],qs[_0x7049('0x3b')](_0x15b2de['query'][_0x7049('0x3b')]));_0x3ba37f[_0x7049('0x3a')]=_0x3ba37f[_0x7049('0x3a')][_0x7049('0x3c')]?_0x3ba37f[_0x7049('0x3a')]:_0x689bad[_0x7049('0x34')];_0x3ba37f[_0x7049('0x20')]=qs['limit'](_0x15b2de[_0x7049('0x36')]['limit']);_0x3ba37f[_0x7049('0x22')]=qs[_0x7049('0x22')](_0x15b2de[_0x7049('0x36')]['offset']);_0x3ba37f[_0x7049('0x3f')]=qs['sort'](_0x15b2de[_0x7049('0x36')]['sort']);_0x3ba37f['where']=qs[_0x7049('0x38')](_[_0x7049('0x5e')](_0x15b2de[_0x7049('0x36')],_0x689bad[_0x7049('0x38')]));_0x3ba37f=_[_0x7049('0x42')]({},_0x3ba37f,_0x15b2de['options']);return _0x1b79ad[_0x7049('0x29')+_[_0x7049('0x5c')](_0x15b2de[_0x7049('0x36')][_0x7049('0x57')]['toLowerCase']())+_0x7049('0x5f')](_0x3ba37f);})['then'](respondWithResult(_0x4da095,null))[_0x7049('0x47')](handleError(_0x4da095,null));};exports[_0x7049('0x60')]=function(_0x1aff11,_0x359f17,_0x2578a4){return db[_0x7049('0x2f')][_0x7049('0x56')]({'where':{'id':_0x1aff11[_0x7049('0x49')]['id']}})[_0x7049('0x27')](function(_0x4e910e){if(_0x4e910e){if(!_0x1aff11[_0x7049('0x4d')][_0x7049('0x57')]||!utils[_0x7049('0x58')](_0x1aff11[_0x7049('0x4d')][_0x7049('0x57')])){throw new db[(_0x7049('0x59'))][(_0x7049('0x5a'))]('Unknown\x20channel');}return _0x4e910e[_0x7049('0x61')+_['capitalize'](_0x1aff11[_0x7049('0x4d')]['channel'][_0x7049('0x5d')]())+_0x7049('0x5f')](_0x1aff11['body']['ids']);}return null;})[_0x7049('0x27')](handleEntityNotFound(_0x359f17,null))[_0x7049('0x27')](respondWithStatusCode(_0x359f17,null))[_0x7049('0x47')](handleError(_0x359f17,null));};exports[_0x7049('0x62')]=function(_0x30df22,_0x3dd4d5,_0x415752){return db[_0x7049('0x2f')][_0x7049('0x56')]({'where':{'id':_0x30df22[_0x7049('0x49')]['id']}})[_0x7049('0x27')](function(_0x40882a){if(_0x40882a){if(!_0x30df22[_0x7049('0x36')]['channel']||!utils[_0x7049('0x58')](_0x30df22['query'][_0x7049('0x57')])){throw new db[(_0x7049('0x59'))]['ValidationError'](_0x7049('0x5b'));}return _0x40882a[_0x7049('0x63')+_[_0x7049('0x5c')](_0x30df22[_0x7049('0x36')][_0x7049('0x57')][_0x7049('0x5d')]())+_0x7049('0x5f')](_0x30df22[_0x7049('0x36')][_0x7049('0x64')]);}return null;})[_0x7049('0x27')](handleEntityNotFound(_0x3dd4d5,null))[_0x7049('0x27')](respondWithStatusCode(_0x3dd4d5,null))['catch'](handleError(_0x3dd4d5,null));};exports['addAgents']=function(_0x151162,_0x5150df){var _0x2d102b=_[_0x7049('0x65')](_0x151162[_0x7049('0x4d')][_0x7049('0x64')])?_0x151162[_0x7049('0x4d')]['ids']:[_0x151162[_0x7049('0x4d')][_0x7049('0x64')]];var _0x5df9d8=_0x151162[_0x7049('0x49')]['id'];return db[_0x7049('0x2f')][_0x7049('0x4b')]({'where':{'id':_0x5df9d8}})[_0x7049('0x27')](handleEntityNotFound(_0x5150df,null))['then'](function(_0x5c32da){if(_0x5c32da){var _0x1651be=['Voice',_0x7049('0x66'),'Mail','Sms',_0x7049('0x67'),_0x7049('0x68'),_0x7049('0x69')];return db[_0x7049('0x6a')][_0x7049('0x6b')](function(_0x4e48f6){var _0x374bd6=_['map'](_0x1651be,function(_0x1ef740){var _0x4c878a={'attributes':['id',_0x7049('0x2d')]};if(_0x1ef740===_0x7049('0x6c')){_0x4c878a[_0x7049('0x6d')]={'attributes':[_0x7049('0x6e')]};}return _0x5c32da[_0x7049('0x29')+_0x1ef740+_0x7049('0x5f')](_0x4c878a)[_0x7049('0x27')](function(_0x3556f0){var _0x4a4762=_[_0x7049('0x35')](_0x3556f0,function(_0x548283){var _0xd14168=_['map'](_0x2d102b,function(_0x41c4b0){var _0x414718={'where':{'UserId':_0x41c4b0,[_0x1ef740+_0x7049('0x6f')]:_0x548283['id']},'transaction':_0x4e48f6};if(_0x1ef740===_0x7049('0x6c')){_0x414718['defaults']={'penalty':_0x548283[_0x7049('0x70')][_0x7049('0x6e')]};}return db[_0x7049('0x71')+_0x1ef740+_0x7049('0x72')]['findOrCreate'](_0x414718)[_0x7049('0x27')](function(){socket[_0x7049('0x73')](_0x7049('0x4e')+_0x1ef740+_0x7049('0x74'),{'UserId':_0x41c4b0,[_0x1ef740+_0x7049('0x6f')]:_0x548283['id']});if(_0x1ef740!==_0x7049('0x6c')){return;}return db['User'][_0x7049('0x46')]({'where':{'id':_0x2d102b,'online':0x1},'attributes':['id',_0x7049('0x2d'),'online','voicePause',_0x7049('0x75')],'raw':!![]})['then'](function(_0x19f94a){var _0x46b88b=_[_0x7049('0x35')](_0x19f94a,function(_0x753d49){return db[_0x7049('0x76')][_0x7049('0x77')]({'membername':_0x753d49[_0x7049('0x2d')],'UserId':_0x753d49['id'],'queue_name':_0x548283[_0x7049('0x2d')],'VoiceQueueId':_0x548283['id'],'interface':_[_0x7049('0x78')](_0x753d49[_0x7049('0x75')])?util[_0x7049('0x79')](_0x7049('0x7a'),_0x753d49['name']):_0x753d49['interface'],'paused':_0x753d49['voicePause']||![],'penalty':_0x548283[_0x7049('0x70')][_0x7049('0x6e')]},{'transaction':_0x4e48f6});});return Promise['all'](_0x46b88b);});});});return Promise[_0x7049('0x7b')](_0xd14168);});return Promise[_0x7049('0x7b')](_0x4a4762);})[_0x7049('0x27')](function(){return db[_0x7049('0x7c')][_0x7049('0x56')]({'where':{'teamId':_0x5df9d8}})[_0x7049('0x27')](function(_0x4c85dd){if(_0x4c85dd){var _0x38e00b=_[_0x7049('0x35')](_0x2d102b,function(_0x4fa4f8){db[_0x7049('0x7d')][_0x7049('0x77')]({'UserId':_0x4fa4f8,'VoicePrefixId':_0x4c85dd[_0x7049('0x7e')]});});return Promise[_0x7049('0x7b')](_0x38e00b);}});});});return Promise[_0x7049('0x7b')](_0x374bd6)[_0x7049('0x27')](function(){return _0x5c32da[_0x7049('0x7f')](_0x2d102b,{'transaction':_0x4e48f6})[_0x7049('0x80')](function(_0x3f4110){return _0x3f4110;});});});}})[_0x7049('0x27')](respondWithResult(_0x5150df,null))[_0x7049('0x47')](handleError(_0x5150df,null));};exports['removeAgents']=function(_0x43c461,_0x483be4){var _0x1d8ecf=_[_0x7049('0x65')](_0x43c461[_0x7049('0x36')]['ids'])?_0x43c461[_0x7049('0x36')]['ids']:[_0x43c461[_0x7049('0x36')][_0x7049('0x64')]];var _0xcb5195=_0x43c461[_0x7049('0x49')]['id'];return db[_0x7049('0x2f')][_0x7049('0x4b')]({'where':{'id':_0xcb5195}})[_0x7049('0x27')](handleEntityNotFound(_0x483be4,null))[_0x7049('0x27')](function(_0x24e5db){if(_0x24e5db){var _0x3b8c76=[_0x7049('0x6c'),_0x7049('0x66'),_0x7049('0x81'),_0x7049('0x82'),_0x7049('0x67'),_0x7049('0x68'),_0x7049('0x69')];return db[_0x7049('0x6a')][_0x7049('0x6b')](function(_0x3ea504){var _0x4311f5=_[_0x7049('0x35')](_0x3b8c76,function(_0x325c96){var _0x1d5cfe={'attributes':['id',_0x7049('0x2d')]};return _0x24e5db['get'+_0x325c96+'Queues'](_0x1d5cfe)['then'](function(_0x1637cc){var _0x32fb35=_['map'](_0x1637cc,function(_0x1011c4){return _0x1011c4['removeAgents'](_0x1d8ecf,{'transaction':_0x3ea504})[_0x7049('0x27')](function(){var _0xa90ed9=_[_0x7049('0x35')](_0x1d8ecf,function(_0x56f2aa){socket[_0x7049('0x73')](_0x7049('0x4e')+_0x325c96+_0x7049('0x83'),{'UserId':Number(_0x56f2aa),[_0x325c96+_0x7049('0x6f')]:_0x1011c4['id']});if(_0x325c96!==_0x7049('0x6c')){return;}return db[_0x7049('0x76')][_0x7049('0x28')]({'where':{'VoiceQueueId':_0x1011c4['id'],'UserId':_0x56f2aa},'transaction':_0x3ea504});});return Promise[_0x7049('0x7b')](_0xa90ed9);});});return Promise[_0x7049('0x7b')](_0x32fb35);});});return Promise[_0x7049('0x7b')](_0x4311f5)[_0x7049('0x27')](function(){return _0x24e5db[_0x7049('0x84')](_0x1d8ecf,{'transaction':_0x3ea504});})[_0x7049('0x27')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0xcb5195}})[_0x7049('0x27')](function(_0x3523f2){if(_0x3523f2){var _0x11cd95=_[_0x7049('0x35')](_0x1d8ecf,function(_0x287f64){db['UserVoicePrefix'][_0x7049('0x28')]({'where':{'UserId':_0x287f64,'VoicePrefixId':_0x3523f2[_0x7049('0x7e')]}});});return Promise['all'](_0x11cd95);}});});});}})[_0x7049('0x27')](respondWithStatusCode(_0x483be4,null))[_0x7049('0x47')](handleError(_0x483be4,null));};exports[_0x7049('0x85')]=function(_0x43f0b8,_0x287c92,_0x512db3){var _0x28aa6e={};var _0x9713df={};var _0x49cd1b;var _0x1c406b;return db[_0x7049('0x2f')][_0x7049('0x56')]({'where':{'id':_0x43f0b8[_0x7049('0x49')]['id']}})[_0x7049('0x27')](handleEntityNotFound(_0x287c92,null))[_0x7049('0x27')](function(_0x494e01){if(_0x494e01){_0x49cd1b=_0x494e01;_0x9713df['model']=_['keys'](db[_0x7049('0x71')]['rawAttributes']);_0x9713df[_0x7049('0x36')]=_[_0x7049('0x37')](_0x43f0b8[_0x7049('0x36')]);_0x9713df[_0x7049('0x38')]=_[_0x7049('0x39')](_0x9713df[_0x7049('0x34')],_0x9713df[_0x7049('0x36')]);_0x28aa6e[_0x7049('0x3a')]=_[_0x7049('0x39')](_0x9713df['model'],qs[_0x7049('0x3b')](_0x43f0b8['query'][_0x7049('0x3b')]));_0x28aa6e['attributes']=_0x28aa6e[_0x7049('0x3a')][_0x7049('0x3c')]?_0x28aa6e[_0x7049('0x3a')]:_0x9713df[_0x7049('0x34')];_0x28aa6e[_0x7049('0x3f')]=qs[_0x7049('0x86')](_0x43f0b8[_0x7049('0x36')]['sort']);_0x28aa6e[_0x7049('0x41')]=qs[_0x7049('0x38')](_[_0x7049('0x5e')](_0x43f0b8[_0x7049('0x36')],_0x9713df[_0x7049('0x38')]));if(_0x43f0b8[_0x7049('0x36')][_0x7049('0x40')]){_0x28aa6e[_0x7049('0x41')]=_[_0x7049('0x42')](_0x28aa6e[_0x7049('0x41')],{'$or':_['map'](_0x28aa6e[_0x7049('0x3a')],function(_0x4f8b46){var _0x3b3a24={};_0x3b3a24[_0x4f8b46]={'$like':'%'+_0x43f0b8['query'][_0x7049('0x40')]+'%'};return _0x3b3a24;})});}_0x28aa6e=_[_0x7049('0x42')]({},_0x28aa6e,_0x43f0b8['options']);return _0x49cd1b[_0x7049('0x85')](_0x28aa6e);}})[_0x7049('0x27')](function(_0x4b1441){if(_0x4b1441){_0x1c406b=_0x4b1441[_0x7049('0x3c')];if(!_0x43f0b8[_0x7049('0x36')][_0x7049('0x3d')](_0x7049('0x3e'))){_0x28aa6e[_0x7049('0x20')]=qs[_0x7049('0x20')](_0x43f0b8[_0x7049('0x36')][_0x7049('0x20')]);_0x28aa6e['offset']=qs[_0x7049('0x22')](_0x43f0b8['query'][_0x7049('0x22')]);}return _0x49cd1b[_0x7049('0x85')](_0x28aa6e);}})['then'](function(_0x2266fb){if(_0x2266fb){return _0x2266fb?{'count':_0x1c406b,'rows':_0x2266fb}:null;}})[_0x7049('0x27')](respondWithResult(_0x287c92,null))[_0x7049('0x47')](handleError(_0x287c92,null));};
\ No newline at end of file
index dd0193d..2762c7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe899=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x44741a,_0xe406fd){var _0x2463ec=function(_0x443fba){while(--_0x443fba){_0x44741a['push'](_0x44741a['shift']());}};_0x2463ec(++_0xe406fd);}(_0xe899,0x1bf));var _0x9e89=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0xe899[_0xae1a83];return _0xdb9da8;};'use strict';var EventEmitter=require(_0x9e89('0x0'));var Team=require(_0x9e89('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x9e89('0x2')](0x0);var events={'afterCreate':_0x9e89('0x3'),'afterUpdate':_0x9e89('0x4'),'afterDestroy':_0x9e89('0x5')};function emitEvent(_0x25cb02){return function(_0x51a07c,_0x199c58,_0x407517){TeamEvents['emit'](_0x25cb02+':'+_0x51a07c['id'],_0x51a07c);TeamEvents[_0x9e89('0x6')](_0x25cb02,_0x51a07c);_0x407517(null);};}for(var e in events){if(events[_0x9e89('0x7')](e)){var event=events[e];Team[_0x9e89('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
+var _0x0ad5=['../../mysqldb','setMaxListeners','save','remove','emit','exports','events'];(function(_0x5d9204,_0x29664a){var _0x176010=function(_0x161b5f){while(--_0x161b5f){_0x5d9204['push'](_0x5d9204['shift']());}};_0x176010(++_0x29664a);}(_0x0ad5,0xed));var _0x50ad=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0ad5[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x50ad('0x0'));var Team=require(_0x50ad('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x50ad('0x2')](0x0);var events={'afterCreate':_0x50ad('0x3'),'afterUpdate':'update','afterDestroy':_0x50ad('0x4')};function emitEvent(_0x3f1856){return function(_0x382826,_0x587d16,_0x380949){TeamEvents[_0x50ad('0x5')](_0x3f1856+':'+_0x382826['id'],_0x382826);TeamEvents[_0x50ad('0x5')](_0x3f1856,_0x382826);_0x380949(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x50ad('0x6')]=TeamEvents;
\ No newline at end of file
index 87ffd66..6b4957e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8810=['rimraf','../../config/environment','./team.attributes','exports','define','Team','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8810,0x7e));var _0x0881=function(_0x409179,_0x38c6ba){_0x409179=_0x409179-0x0;var _0x279d0a=_0x8810[_0x409179];return _0x279d0a;};'use strict';var _=require(_0x0881('0x0'));var util=require(_0x0881('0x1'));var logger=require('../../config/logger')(_0x0881('0x2'));var moment=require(_0x0881('0x3'));var BPromise=require(_0x0881('0x4'));var rp=require(_0x0881('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0881('0x6'));var config=require(_0x0881('0x7'));var attributes=require(_0x0881('0x8'));module[_0x0881('0x9')]=function(_0x1997b7,_0xe8c99){return _0x1997b7[_0x0881('0xa')](_0x0881('0xb'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9afb=['api','bluebird','request-promise','rimraf','../../config/environment','exports','teams','lodash','util','../../config/logger'];(function(_0x5c0507,_0xa4d539){var _0x38d647=function(_0xf1da79){while(--_0xf1da79){_0x5c0507['push'](_0x5c0507['shift']());}};_0x38d647(++_0xa4d539);}(_0x9afb,0x15b));var _0xb9af=function(_0x4be3ec,_0x218441){_0x4be3ec=_0x4be3ec-0x0;var _0x44b79f=_0x9afb[_0x4be3ec];return _0x44b79f;};'use strict';var _=require(_0xb9af('0x0'));var util=require(_0xb9af('0x1'));var logger=require(_0xb9af('0x2'))(_0xb9af('0x3'));var moment=require('moment');var BPromise=require(_0xb9af('0x4'));var rp=require(_0xb9af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9af('0x6'));var config=require(_0xb9af('0x7'));var attributes=require('./team.attributes');module[_0xb9af('0x8')]=function(_0x57fb02,_0xd45a26){return _0x57fb02['define']('Team',attributes,{'tableName':_0xb9af('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 78261d2..297d0df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb30d=['Team,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./team.socket','register','request','info','debug','request\x20sent','error','code'];(function(_0x529586,_0x3ed7c9){var _0xe01e5e=function(_0x2b5b3d){while(--_0x2b5b3d){_0x529586['push'](_0x529586['shift']());}};_0xe01e5e(++_0x3ed7c9);}(_0xb30d,0xdc));var _0xdb30=function(_0xbe40ad,_0x44343c){_0xbe40ad=_0xbe40ad-0x0;var _0x50fac9=_0xb30d[_0xbe40ad];return _0x50fac9;};'use strict';var _=require('lodash');var util=require(_0xdb30('0x0'));var moment=require('moment');var BPromise=require(_0xdb30('0x1'));var rs=require(_0xdb30('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb30('0x3'))['db'];var utils=require(_0xdb30('0x4'));var logger=require(_0xdb30('0x5'))('rpc');var config=require(_0xdb30('0x6'));var jayson=require(_0xdb30('0x7'));var client=jayson['client'][_0xdb30('0x8')]({'port':0x232a});config[_0xdb30('0x9')]=_[_0xdb30('0xa')](config[_0xdb30('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb30('0xb'))(new Redis(config[_0xdb30('0x9')]));require(_0xdb30('0xc'))[_0xdb30('0xd')](socket);function respondWithRpcPromise(_0x52cf0a,_0xb29719,_0x237480){return new BPromise(function(_0x90b48c,_0xbb70c4){return client[_0xdb30('0xe')](_0x52cf0a,_0x237480)['then'](function(_0x425f6a){logger[_0xdb30('0xf')]('Team,\x20%s,\x20%s',_0xb29719,'request\x20sent');logger[_0xdb30('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0xb29719,_0xdb30('0x11'),JSON['stringify'](_0x425f6a));if(_0x425f6a[_0xdb30('0x12')]){if(_0x425f6a[_0xdb30('0x12')][_0xdb30('0x13')]===0x1f4){logger[_0xdb30('0x12')](_0xdb30('0x14'),_0xb29719,_0x425f6a[_0xdb30('0x12')][_0xdb30('0x15')]);return _0xbb70c4(_0x425f6a[_0xdb30('0x12')][_0xdb30('0x15')]);}logger[_0xdb30('0x12')](_0xdb30('0x14'),_0xb29719,_0x425f6a['error'][_0xdb30('0x15')]);return _0x90b48c(_0x425f6a[_0xdb30('0x12')][_0xdb30('0x15')]);}else{logger[_0xdb30('0xf')](_0xdb30('0x14'),_0xb29719,'request\x20sent');_0x90b48c(_0x425f6a[_0xdb30('0x16')][_0xdb30('0x15')]);}})[_0xdb30('0x17')](function(_0xe52e6f){logger[_0xdb30('0x12')](_0xdb30('0x14'),_0xb29719,_0xe52e6f);_0xbb70c4(_0xe52e6f);});});}
\ No newline at end of file
+var _0x65b6=['client','http','redis','localhost','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x65b6,0xfc));var _0x665b=function(_0x53f8f4,_0x25b240){_0x53f8f4=_0x53f8f4-0x0;var _0x55e4eb=_0x65b6[_0x53f8f4];return _0x55e4eb;};'use strict';var _=require('lodash');var util=require(_0x665b('0x0'));var moment=require(_0x665b('0x1'));var BPromise=require(_0x665b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x665b('0x3'));var db=require(_0x665b('0x4'))['db'];var utils=require(_0x665b('0x5'));var logger=require(_0x665b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x665b('0x7'));var client=jayson[_0x665b('0x8')][_0x665b('0x9')]({'port':0x232a});config[_0x665b('0xa')]=_['defaults'](config[_0x665b('0xa')],{'host':_0x665b('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x665b('0xa')]));require(_0x665b('0xc'))[_0x665b('0xd')](socket);function respondWithRpcPromise(_0x340d44,_0x555732,_0x5ae3c9){return new BPromise(function(_0x4a1f60,_0x599b95){return client[_0x665b('0xe')](_0x340d44,_0x5ae3c9)[_0x665b('0xf')](function(_0x56e51f){logger[_0x665b('0x10')](_0x665b('0x11'),_0x555732,_0x665b('0x12'));logger[_0x665b('0x13')](_0x665b('0x14'),_0x555732,_0x665b('0x12'),JSON['stringify'](_0x56e51f));if(_0x56e51f[_0x665b('0x15')]){if(_0x56e51f[_0x665b('0x15')][_0x665b('0x16')]===0x1f4){logger['error'](_0x665b('0x11'),_0x555732,_0x56e51f[_0x665b('0x15')][_0x665b('0x17')]);return _0x599b95(_0x56e51f[_0x665b('0x15')][_0x665b('0x17')]);}logger[_0x665b('0x15')]('Team,\x20%s,\x20%s',_0x555732,_0x56e51f[_0x665b('0x15')][_0x665b('0x17')]);return _0x4a1f60(_0x56e51f[_0x665b('0x15')][_0x665b('0x17')]);}else{logger[_0x665b('0x10')](_0x665b('0x11'),_0x555732,_0x665b('0x12'));_0x4a1f60(_0x56e51f[_0x665b('0x18')][_0x665b('0x17')]);}})[_0x665b('0x19')](function(_0x5c83de){logger['error'](_0x665b('0x11'),_0x555732,_0x5c83de);_0x599b95(_0x5c83de);});});}
\ No newline at end of file
index 9117b97..96746f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0ae=['remove','update','emit','removeListener','register','length','team:','./team.events','save'];(function(_0x329602,_0x2f3860){var _0x18cbdc=function(_0x532adc){while(--_0x532adc){_0x329602['push'](_0x329602['shift']());}};_0x18cbdc(++_0x2f3860);}(_0xd0ae,0x1ae));var _0xed0a=function(_0x3f97cf,_0xffce5){_0x3f97cf=_0x3f97cf-0x0;var _0xed9beb=_0xd0ae[_0x3f97cf];return _0xed9beb;};'use strict';var TeamEvents=require(_0xed0a('0x0'));var events=[_0xed0a('0x1'),_0xed0a('0x2'),_0xed0a('0x3')];function createListener(_0x4aad0c,_0x23515c){return function(_0x484294){_0x23515c[_0xed0a('0x4')](_0x4aad0c,_0x484294);};}function removeListener(_0x5e4485,_0x11cb66){return function(){TeamEvents[_0xed0a('0x5')](_0x5e4485,_0x11cb66);};}exports[_0xed0a('0x6')]=function(_0x13e9af){for(var _0x4f591d=0x0,_0x22a013=events[_0xed0a('0x7')];_0x4f591d<_0x22a013;_0x4f591d++){var _0x465192=events[_0x4f591d];var _0x10cc6c=createListener(_0xed0a('0x8')+_0x465192,_0x13e9af);TeamEvents['on'](_0x465192,_0x10cc6c);}};
\ No newline at end of file
+var _0xecf3=['removeListener','register','length','team:','remove','update','emit'];(function(_0x1a8ff0,_0x20788d){var _0x3588bf=function(_0x3b5499){while(--_0x3b5499){_0x1a8ff0['push'](_0x1a8ff0['shift']());}};_0x3588bf(++_0x20788d);}(_0xecf3,0x66));var _0x3ecf=function(_0x3924ef,_0x1924df){_0x3924ef=_0x3924ef-0x0;var _0x4c7881=_0xecf3[_0x3924ef];return _0x4c7881;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x3ecf('0x0'),_0x3ecf('0x1')];function createListener(_0x294758,_0x495af3){return function(_0x21ce9e){_0x495af3[_0x3ecf('0x2')](_0x294758,_0x21ce9e);};}function removeListener(_0x2665ba,_0x5a5b9a){return function(){TeamEvents[_0x3ecf('0x3')](_0x2665ba,_0x5a5b9a);};}exports[_0x3ecf('0x4')]=function(_0x4af095){for(var _0xe52550=0x0,_0x4d13b8=events[_0x3ecf('0x5')];_0xe52550<_0x4d13b8;_0xe52550++){var _0x17dd93=events[_0xe52550];var _0x1ef6c3=createListener(_0x3ecf('0x6')+_0x17dd93,_0x4af095);TeamEvents['on'](_0x17dd93,_0x1ef6c3);}};
\ No newline at end of file
index 197a5eb..d9e0248 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cd9=['exports','INTEGER'];(function(_0x24942b,_0x4310e2){var _0x335545=function(_0x1dd0ea){while(--_0x1dd0ea){_0x24942b['push'](_0x24942b['shift']());}};_0x335545(++_0x4310e2);}(_0x5cd9,0x13c));var _0x95cd=function(_0x16ebe2,_0x10c45f){_0x16ebe2=_0x16ebe2-0x0;var _0x1824e1=_0x5cd9[_0x16ebe2];return _0x1824e1;};'use strict';var Sequelize=require('sequelize');module[_0x95cd('0x0')]={'TeamId':{'type':Sequelize[_0x95cd('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x95cd('0x1')]}};
\ No newline at end of file
+var _0x1ee2=['exports','INTEGER','sequelize'];(function(_0x506a65,_0x3a4513){var _0x1f2572=function(_0xb911ea){while(--_0xb911ea){_0x506a65['push'](_0x506a65['shift']());}};_0x1f2572(++_0x3a4513);}(_0x1ee2,0x11c));var _0x21ee=function(_0x37b1ae,_0x47f4b4){_0x37b1ae=_0x37b1ae-0x0;var _0x449462=_0x1ee2[_0x37b1ae];return _0x449462;};'use strict';var Sequelize=require(_0x21ee('0x0'));module[_0x21ee('0x1')]={'TeamId':{'type':Sequelize[_0x21ee('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x21ee('0x2')]}};
\ No newline at end of file
index 3eed1b9..764e3fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60a5=['request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','lodash','api'];(function(_0xd8af12,_0x24bb8f){var _0x2324ff=function(_0x483577){while(--_0x483577){_0xd8af12['push'](_0xd8af12['shift']());}};_0x2324ff(++_0x24bb8f);}(_0x60a5,0x83));var _0x560a=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x60a5[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x560a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x560a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x560a('0x2'));var fs=require('fs');var path=require(_0x560a('0x3'));var rimraf=require(_0x560a('0x4'));var config=require('../../config/environment');var attributes=require(_0x560a('0x5'));module[_0x560a('0x6')]=function(_0x3856ae,_0x5aaec6){return _0x3856ae['define']('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7269=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x1d8d44,_0x5345d7){var _0x372ec8=function(_0x106e96){while(--_0x106e96){_0x1d8d44['push'](_0x1d8d44['shift']());}};_0x372ec8(++_0x5345d7);}(_0x7269,0x76));var _0x9726=function(_0x51bf5d,_0x21f000){_0x51bf5d=_0x51bf5d-0x0;var _0x40f2b3=_0x7269[_0x51bf5d];return _0x40f2b3;};'use strict';var _=require(_0x9726('0x0'));var util=require(_0x9726('0x1'));var logger=require(_0x9726('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9726('0x3'));var rp=require(_0x9726('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9726('0x5'));var config=require(_0x9726('0x6'));var attributes=require(_0x9726('0x7'));module[_0x9726('0x8')]=function(_0x795889,_0x832cb){return _0x795889[_0x9726('0x9')](_0x9726('0xa'),attributes,{'tableName':_0x9726('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c2d6706..07f5ab1 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(_0x473285,_0x22c6fd){var _0x5e9791=function(_0x47a245){while(--_0x47a245){_0x473285['push'](_0x473285['shift']());}};_0x5e9791(++_0x22c6fd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x14c09a,_0x26e7d2){var _0x3927b2=function(_0x5006ff){while(--_0x5006ff){_0x14c09a['push'](_0x14c09a['shift']());}};_0x3927b2(++_0x26e7d2);}(_0xe706,0xa3));var _0x6e70=function(_0x47fd45,_0x40dd67){_0x47fd45=_0x47fd45-0x0;var _0x363313=_0xe706[_0x47fd45];return _0x363313;};'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 55bd3df..45fc9a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45ae=['sequelize','exports','INTEGER'];(function(_0x2dab9f,_0x12b77c){var _0x5c98f8=function(_0xd2aa95){while(--_0xd2aa95){_0x2dab9f['push'](_0x2dab9f['shift']());}};_0x5c98f8(++_0x12b77c);}(_0x45ae,0xc6));var _0xe45a=function(_0x4365f6,_0x464cc3){_0x4365f6=_0x4365f6-0x0;var _0x48fc20=_0x45ae[_0x4365f6];return _0x48fc20;};'use strict';var Sequelize=require(_0xe45a('0x0'));module[_0xe45a('0x1')]={'penalty':{'type':Sequelize[_0xe45a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcc42=['INTEGER'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xcc42,0x84));var _0x2cc4=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0xcc42[_0x3e0b8f];return _0x22f742;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x2cc4('0x0')],'defaultValue':0x0}};
\ No newline at end of file
index 1b6e97c..0e3e5bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x257e=['define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2cbc32,_0x2f3834){var _0x3ce04d=function(_0x4dd5e2){while(--_0x4dd5e2){_0x2cbc32['push'](_0x2cbc32['shift']());}};_0x3ce04d(++_0x2f3834);}(_0x257e,0x1dc));var _0xe257=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0x257e[_0x34f701];return _0x3e2429;};'use strict';var _=require('lodash');var util=require(_0xe257('0x0'));var logger=require(_0xe257('0x1'))('api');var moment=require(_0xe257('0x2'));var BPromise=require('bluebird');var rp=require(_0xe257('0x3'));var fs=require('fs');var path=require(_0xe257('0x4'));var rimraf=require(_0xe257('0x5'));var config=require(_0xe257('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0xe257('0x7')]=function(_0x2a01fe,_0x5dcd04){return _0x2a01fe[_0xe257('0x8')](_0xe257('0x9'),attributes,{'tableName':_0xe257('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f7d=['define','TeamVoiceQueue','team_has_voice_queues','lodash','util','api','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports'];(function(_0x2c712e,_0x1f7801){var _0x590398=function(_0xb33b8b){while(--_0xb33b8b){_0x2c712e['push'](_0x2c712e['shift']());}};_0x590398(++_0x1f7801);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x1cb77b,_0x469538){_0x1cb77b=_0x1cb77b-0x0;var _0xfa36b3=_0x8f7d[_0x1cb77b];return _0xfa36b3;};'use strict';var _=require(_0xd8f7('0x0'));var util=require(_0xd8f7('0x1'));var logger=require('../../config/logger')(_0xd8f7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd8f7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8f7('0x4'));var config=require(_0xd8f7('0x5'));var attributes=require(_0xd8f7('0x6'));module[_0xd8f7('0x7')]=function(_0x524a2e,_0x4090c9){return _0x524a2e[_0xd8f7('0x8')](_0xd8f7('0x9'),attributes,{'tableName':_0xd8f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6409876..1deadd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28f3=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e0a8e,_0x15ea5b){var _0x520ad1=function(_0x57ff7c){while(--_0x57ff7c){_0x3e0a8e['push'](_0x3e0a8e['shift']());}};_0x520ad1(++_0x15ea5b);}(_0x28f3,0x9d));var _0x328f=function(_0x549d84,_0x4ad469){_0x549d84=_0x549d84-0x0;var _0x46de0f=_0x28f3[_0x549d84];return _0x46de0f;};'use strict';var _=require(_0x328f('0x0'));var util=require(_0x328f('0x1'));var moment=require('moment');var BPromise=require(_0x328f('0x2'));var rs=require(_0x328f('0x3'));var fs=require('fs');var Redis=require(_0x328f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x328f('0x5'));var config=require(_0x328f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x328f('0x7')][_0x328f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fb66c,_0x254912,_0x4b30ef){return new BPromise(function(_0x46552e,_0x1311c){return client[_0x328f('0x9')](_0x2fb66c,_0x4b30ef)[_0x328f('0xa')](function(_0x4c9eb6){logger[_0x328f('0xb')](_0x328f('0xc'),_0x254912,_0x328f('0xd'));logger[_0x328f('0xe')](_0x328f('0xf'),_0x254912,'request\x20sent',JSON[_0x328f('0x10')](_0x4c9eb6));if(_0x4c9eb6[_0x328f('0x11')]){if(_0x4c9eb6['error'][_0x328f('0x12')]===0x1f4){logger[_0x328f('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x254912,_0x4c9eb6[_0x328f('0x11')]['message']);return _0x1311c(_0x4c9eb6[_0x328f('0x11')][_0x328f('0x13')]);}logger[_0x328f('0x11')](_0x328f('0xc'),_0x254912,_0x4c9eb6[_0x328f('0x11')][_0x328f('0x13')]);return _0x46552e(_0x4c9eb6[_0x328f('0x11')][_0x328f('0x13')]);}else{logger[_0x328f('0xb')](_0x328f('0xc'),_0x254912,_0x328f('0xd'));_0x46552e(_0x4c9eb6[_0x328f('0x14')][_0x328f('0x13')]);}})[_0x328f('0x15')](function(_0x384ef4){logger['error'](_0x328f('0xc'),_0x254912,_0x384ef4);_0x1311c(_0x384ef4);});});}
\ No newline at end of file
+var _0x4c95=['then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request'];(function(_0x3b2806,_0x329a73){var _0x3c10bb=function(_0x4464f4){while(--_0x4464f4){_0x3b2806['push'](_0x3b2806['shift']());}};_0x3c10bb(++_0x329a73);}(_0x4c95,0x180));var _0x54c9=function(_0x158a2e,_0x235c64){_0x158a2e=_0x158a2e-0x0;var _0x1502be=_0x4c95[_0x158a2e];return _0x1502be;};'use strict';var _=require(_0x54c9('0x0'));var util=require(_0x54c9('0x1'));var moment=require(_0x54c9('0x2'));var BPromise=require(_0x54c9('0x3'));var rs=require(_0x54c9('0x4'));var fs=require('fs');var Redis=require(_0x54c9('0x5'));var db=require(_0x54c9('0x6'))['db'];var utils=require(_0x54c9('0x7'));var logger=require(_0x54c9('0x8'))(_0x54c9('0x9'));var config=require('../../config/environment');var jayson=require(_0x54c9('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ff118,_0x9f8b19,_0x7a09d2){return new BPromise(function(_0x3ec5df,_0x302c19){return client[_0x54c9('0xb')](_0x1ff118,_0x7a09d2)[_0x54c9('0xc')](function(_0x4a2f32){logger['info'](_0x54c9('0xd'),_0x9f8b19,_0x54c9('0xe'));logger[_0x54c9('0xf')](_0x54c9('0x10'),_0x9f8b19,_0x54c9('0xe'),JSON['stringify'](_0x4a2f32));if(_0x4a2f32[_0x54c9('0x11')]){if(_0x4a2f32[_0x54c9('0x11')][_0x54c9('0x12')]===0x1f4){logger[_0x54c9('0x11')](_0x54c9('0xd'),_0x9f8b19,_0x4a2f32[_0x54c9('0x11')][_0x54c9('0x13')]);return _0x302c19(_0x4a2f32['error'][_0x54c9('0x13')]);}logger[_0x54c9('0x11')](_0x54c9('0xd'),_0x9f8b19,_0x4a2f32[_0x54c9('0x11')][_0x54c9('0x13')]);return _0x3ec5df(_0x4a2f32[_0x54c9('0x11')][_0x54c9('0x13')]);}else{logger[_0x54c9('0x14')](_0x54c9('0xd'),_0x9f8b19,_0x54c9('0xe'));_0x3ec5df(_0x4a2f32['result'][_0x54c9('0x13')]);}})[_0x54c9('0x15')](function(_0x347d60){logger[_0x54c9('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x9f8b19,_0x347d60);_0x302c19(_0x347d60);});});}
\ No newline at end of file
index 9ab3ddf..6870fa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccef=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xccef,0x1d4));var _0xfcce=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xccef[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0xfcce('0x0'));var path=require('path');var timeout=require(_0xfcce('0x1'));var express=require(_0xfcce('0x2'));var router=express[_0xfcce('0x3')]();var fs_extra=require(_0xfcce('0x4'));var auth=require(_0xfcce('0x5'));var interaction=require(_0xfcce('0x6'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0xfcce('0x7')]('/',auth['isAuthenticated'](),controller[_0xfcce('0x8')]);router[_0xfcce('0x7')](_0xfcce('0x9'),auth[_0xfcce('0xa')](),controller[_0xfcce('0xb')]);router[_0xfcce('0xc')]('/',auth[_0xfcce('0xa')](),controller['create']);router[_0xfcce('0xd')](_0xfcce('0x9'),auth[_0xfcce('0xa')](),controller[_0xfcce('0xe')]);router[_0xfcce('0xf')](_0xfcce('0x9'),auth[_0xfcce('0xa')](),controller[_0xfcce('0x10')]);module[_0xfcce('0x11')]=router;
\ No newline at end of file
+var _0xc2a2=['create','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','post'];(function(_0x47d4bd,_0x1cedd3){var _0x34efac=function(_0x4ceed7){while(--_0x4ceed7){_0x47d4bd['push'](_0x47d4bd['shift']());}};_0x34efac(++_0x1cedd3);}(_0xc2a2,0x84));var _0x2c2a=function(_0x25dcbc,_0x1f639f){_0x25dcbc=_0x25dcbc-0x0;var _0x157363=_0xc2a2[_0x25dcbc];return _0x157363;};'use strict';var multer=require(_0x2c2a('0x0'));var util=require(_0x2c2a('0x1'));var path=require(_0x2c2a('0x2'));var timeout=require(_0x2c2a('0x3'));var express=require('express');var router=express[_0x2c2a('0x4')]();var fs_extra=require(_0x2c2a('0x5'));var auth=require(_0x2c2a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2c2a('0x7'));var controller=require(_0x2c2a('0x8'));router[_0x2c2a('0x9')]('/',auth[_0x2c2a('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2c2a('0xb')]('/',auth['isAuthenticated'](),controller[_0x2c2a('0xc')]);router['put'](_0x2c2a('0xd'),auth[_0x2c2a('0xa')](),controller[_0x2c2a('0xe')]);router[_0x2c2a('0xf')](_0x2c2a('0xd'),auth[_0x2c2a('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 8240e3a..dc96cd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ac2=['STRING','sequelize','exports'];(function(_0x11c711,_0x30e2ea){var _0x3aece1=function(_0x42d71c){while(--_0x42d71c){_0x11c711['push'](_0x11c711['shift']());}};_0x3aece1(++_0x30e2ea);}(_0x1ac2,0xc1));var _0x21ac=function(_0x426fb9,_0x73b8ed){_0x426fb9=_0x426fb9-0x0;var _0x2d1760=_0x1ac2[_0x426fb9];return _0x2d1760;};'use strict';var Sequelize=require(_0x21ac('0x0'));module[_0x21ac('0x1')]={'name':{'type':Sequelize[_0x21ac('0x2')]},'description':{'type':Sequelize[_0x21ac('0x2')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2ac8=['sequelize','exports','STRING','TEXT'];(function(_0x24ae93,_0x364bd5){var _0x2fc1f3=function(_0x3cba31){while(--_0x3cba31){_0x24ae93['push'](_0x24ae93['shift']());}};_0x2fc1f3(++_0x364bd5);}(_0x2ac8,0x1a8));var _0x82ac=function(_0x2bdd89,_0x54d1e2){_0x2bdd89=_0x2bdd89-0x0;var _0x55be74=_0x2ac8[_0x2bdd89];return _0x55be74;};'use strict';var Sequelize=require(_0x82ac('0x0'));module[_0x82ac('0x1')]={'name':{'type':Sequelize[_0x82ac('0x2')]},'description':{'type':Sequelize[_0x82ac('0x2')]},'html':{'type':Sequelize[_0x82ac('0x3')]}};
\ No newline at end of file
index e6cdb0d..036250f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6a8=['ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','Template','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0xb6a8,0x195));var _0x8b6a=function(_0x1a7464,_0x48a8bb){_0x1a7464=_0x1a7464-0x0;var _0xe5ed6a=_0xb6a8[_0x1a7464];return _0xe5ed6a;};'use strict';var emlformat=require(_0x8b6a('0x0'));var rimraf=require(_0x8b6a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b6a('0x2'));var rp=require(_0x8b6a('0x3'));var moment=require(_0x8b6a('0x4'));var BPromise=require(_0x8b6a('0x5'));var Mustache=require(_0x8b6a('0x6'));var util=require('util');var path=require(_0x8b6a('0x7'));var sox=require(_0x8b6a('0x8'));var csv=require(_0x8b6a('0x9'));var ejs=require(_0x8b6a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b6a('0xb'));var squel=require(_0x8b6a('0xc'));var crypto=require(_0x8b6a('0xd'));var jsforce=require(_0x8b6a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b6a('0x9'));var querystring=require(_0x8b6a('0xf'));var Papa=require(_0x8b6a('0x10'));var Redis=require(_0x8b6a('0x11'));var authService=require(_0x8b6a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b6a('0x13'));var logger=require(_0x8b6a('0x14'))(_0x8b6a('0x15'));var utils=require('../../config/utils');var config=require(_0x8b6a('0x16'));var licenseUtil=require(_0x8b6a('0x17'));var db=require(_0x8b6a('0x18'))['db'];function respondWithStatusCode(_0x500145,_0x650d6e){_0x650d6e=_0x650d6e||0xcc;return function(_0x1e4ae4){if(_0x1e4ae4){return _0x500145[_0x8b6a('0x19')](_0x650d6e);}return _0x500145['status'](_0x650d6e)[_0x8b6a('0x1a')]();};}function respondWithResult(_0x45d5c6,_0x9eea4b){_0x9eea4b=_0x9eea4b||0xc8;return function(_0x16eaae){if(_0x16eaae){return _0x45d5c6[_0x8b6a('0x1b')](_0x9eea4b)[_0x8b6a('0x1c')](_0x16eaae);}};}function respondWithFilteredResult(_0x41d392,_0x1d51dc){return function(_0x191b90){if(_0x191b90){var _0x4ef686=typeof _0x1d51dc[_0x8b6a('0x1d')]===_0x8b6a('0x1e')&&typeof _0x1d51dc[_0x8b6a('0x1f')]===_0x8b6a('0x1e');var _0x4aac0c=_0x191b90['count'];var _0x347c7f=_0x4ef686?0x0:_0x1d51dc[_0x8b6a('0x1d')];var _0x2e54c5=_0x4ef686?_0x191b90[_0x8b6a('0x20')]:_0x1d51dc[_0x8b6a('0x1d')]+_0x1d51dc['limit'];var _0x5c8104;if(_0x2e54c5>=_0x4aac0c){_0x2e54c5=_0x4aac0c;_0x5c8104=0xc8;}else{_0x5c8104=0xce;}_0x41d392[_0x8b6a('0x1b')](_0x5c8104);return _0x41d392[_0x8b6a('0x21')]('Content-Range',_0x347c7f+'-'+_0x2e54c5+'/'+_0x4aac0c)[_0x8b6a('0x1c')](_0x191b90);}return null;};}function patchUpdates(_0x44fcb7){return function(_0x159c11){try{jsonpatch[_0x8b6a('0x22')](_0x159c11,_0x44fcb7,!![]);}catch(_0x190c82){return BPromise[_0x8b6a('0x23')](_0x190c82);}return _0x159c11[_0x8b6a('0x24')]();};}function saveUpdates(_0x4b2651,_0xfaf7a2){return function(_0x35c179){if(_0x35c179){return _0x35c179[_0x8b6a('0x25')](_0x4b2651)[_0x8b6a('0x26')](function(_0x1b71f1){return _0x1b71f1;});}return null;};}function removeEntity(_0xc4010f,_0x2c2b22){return function(_0xc1c416){if(_0xc1c416){return _0xc1c416['destroy']()[_0x8b6a('0x26')](function(){var _0x3a8770=_0xc1c416[_0x8b6a('0x27')]({'plain':!![]});var _0x44bcff='Templates';return db[_0x8b6a('0x28')][_0x8b6a('0x29')]({'where':{'type':_0x44bcff,'resourceId':_0x3a8770['id']}})[_0x8b6a('0x26')](function(){return _0xc1c416;});})[_0x8b6a('0x26')](function(){_0xc4010f[_0x8b6a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d9aa0,_0x3925c1){return function(_0x2a9151){if(!_0x2a9151){_0x4d9aa0['sendStatus'](0x194);}return _0x2a9151;};}function handleError(_0x402399,_0x66faee){_0x66faee=_0x66faee||0x1f4;return function(_0x46181b){logger[_0x8b6a('0x2a')](_0x46181b[_0x8b6a('0x2b')]);if(_0x46181b[_0x8b6a('0x2c')]){delete _0x46181b['name'];}_0x402399[_0x8b6a('0x1b')](_0x66faee)['send'](_0x46181b);};}exports['index']=function(_0x652bbf,_0xc9edcf){var _0x58f5b0={},_0x26983d={},_0x5cf346={'count':0x0,'rows':[]};var _0x163bf7=_['map'](db[_0x8b6a('0x2d')][_0x8b6a('0x2e')],function(_0x3afdc0){return{'name':_0x3afdc0['fieldName'],'type':_0x3afdc0[_0x8b6a('0x2f')][_0x8b6a('0x30')]};});_0x26983d['model']=_[_0x8b6a('0x31')](_0x163bf7,_0x8b6a('0x2c'));_0x26983d[_0x8b6a('0x32')]=_[_0x8b6a('0x33')](_0x652bbf[_0x8b6a('0x32')]);_0x26983d[_0x8b6a('0x34')]=_[_0x8b6a('0x35')](_0x26983d[_0x8b6a('0x36')],_0x26983d[_0x8b6a('0x32')]);_0x58f5b0[_0x8b6a('0x37')]=_[_0x8b6a('0x35')](_0x26983d[_0x8b6a('0x36')],qs[_0x8b6a('0x38')](_0x652bbf[_0x8b6a('0x32')][_0x8b6a('0x38')]));_0x58f5b0[_0x8b6a('0x37')]=_0x58f5b0['attributes'][_0x8b6a('0x39')]?_0x58f5b0[_0x8b6a('0x37')]:_0x26983d[_0x8b6a('0x36')];if(!_0x652bbf['query'][_0x8b6a('0x3a')](_0x8b6a('0x3b'))){_0x58f5b0[_0x8b6a('0x1f')]=qs['limit'](_0x652bbf[_0x8b6a('0x32')][_0x8b6a('0x1f')]);_0x58f5b0[_0x8b6a('0x1d')]=qs[_0x8b6a('0x1d')](_0x652bbf['query'][_0x8b6a('0x1d')]);}_0x58f5b0[_0x8b6a('0x3c')]=qs['sort'](_0x652bbf['query'][_0x8b6a('0x3d')]);_0x58f5b0[_0x8b6a('0x3e')]=qs[_0x8b6a('0x34')](_[_0x8b6a('0x3f')](_0x652bbf['query'],_0x26983d['filters']),_0x163bf7);if(_0x652bbf['query'][_0x8b6a('0x40')]){_0x58f5b0[_0x8b6a('0x3e')]=_[_0x8b6a('0x41')](_0x58f5b0[_0x8b6a('0x3e')],{'$or':_[_0x8b6a('0x31')](_0x163bf7,function(_0x2f52b2){if(_0x2f52b2[_0x8b6a('0x2f')]!==_0x8b6a('0x42')){var _0x5de8c2={};_0x5de8c2[_0x2f52b2[_0x8b6a('0x2c')]]={'$like':'%'+_0x652bbf[_0x8b6a('0x32')][_0x8b6a('0x40')]+'%'};return _0x5de8c2;}})});}_0x58f5b0=_[_0x8b6a('0x41')]({},_0x58f5b0,_0x652bbf[_0x8b6a('0x43')]);var _0x26eddf={'where':_0x58f5b0[_0x8b6a('0x3e')]};return db[_0x8b6a('0x2d')][_0x8b6a('0x20')](_0x26eddf)[_0x8b6a('0x26')](function(_0x3d3e94){_0x5cf346[_0x8b6a('0x20')]=_0x3d3e94;if(_0x652bbf[_0x8b6a('0x32')][_0x8b6a('0x44')]){_0x58f5b0[_0x8b6a('0x45')]=[{'all':!![]}];}return db[_0x8b6a('0x2d')][_0x8b6a('0x46')](_0x58f5b0);})[_0x8b6a('0x26')](function(_0x397f0a){_0x5cf346['rows']=_0x397f0a;return _0x5cf346;})[_0x8b6a('0x26')](respondWithFilteredResult(_0xc9edcf,_0x58f5b0))[_0x8b6a('0x47')](handleError(_0xc9edcf,null));};exports[_0x8b6a('0x48')]=function(_0x3aa40f,_0x2b9266){var _0x7f682e={'raw':!![],'where':{'id':_0x3aa40f[_0x8b6a('0x49')]['id']}},_0xdfb701={};_0xdfb701[_0x8b6a('0x36')]=_[_0x8b6a('0x33')](db['Template']['rawAttributes']);_0xdfb701['query']=_[_0x8b6a('0x33')](_0x3aa40f[_0x8b6a('0x32')]);_0xdfb701[_0x8b6a('0x34')]=_[_0x8b6a('0x35')](_0xdfb701[_0x8b6a('0x36')],_0xdfb701[_0x8b6a('0x32')]);_0x7f682e[_0x8b6a('0x37')]=_[_0x8b6a('0x35')](_0xdfb701[_0x8b6a('0x36')],qs[_0x8b6a('0x38')](_0x3aa40f['query'][_0x8b6a('0x38')]));_0x7f682e[_0x8b6a('0x37')]=_0x7f682e['attributes'][_0x8b6a('0x39')]?_0x7f682e['attributes']:_0xdfb701[_0x8b6a('0x36')];if(_0x3aa40f['query'][_0x8b6a('0x44')]){_0x7f682e[_0x8b6a('0x45')]=[{'all':!![]}];}_0x7f682e=_[_0x8b6a('0x41')]({},_0x7f682e,_0x3aa40f[_0x8b6a('0x43')]);return db[_0x8b6a('0x2d')][_0x8b6a('0x4a')](_0x7f682e)[_0x8b6a('0x26')](handleEntityNotFound(_0x2b9266,null))[_0x8b6a('0x26')](respondWithResult(_0x2b9266,null))[_0x8b6a('0x47')](handleError(_0x2b9266,null));};exports[_0x8b6a('0x4b')]=function(_0x35a2ce,_0xfe9178){return db[_0x8b6a('0x2d')]['create'](_0x35a2ce[_0x8b6a('0x4c')],{})['then'](function(_0x496047){var _0x59b6b2=_0x35a2ce['user']['get']({'plain':!![]});if(!_0x59b6b2)throw new Error(_0x8b6a('0x4d'));if(_0x59b6b2[_0x8b6a('0x4e')]===_0x8b6a('0x4f')){var _0x3663f5=_0x496047[_0x8b6a('0x27')]({'plain':!![]});var _0x671c8b=_0x8b6a('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x671c8b,'userProfileId':_0x59b6b2['userProfileId']},'raw':!![]})[_0x8b6a('0x26')](function(_0x37b101){if(_0x37b101&&_0x37b101[_0x8b6a('0x51')]===0x0){return db[_0x8b6a('0x28')][_0x8b6a('0x4b')]({'name':_0x3663f5['name'],'resourceId':_0x3663f5['id'],'type':_0x37b101['name'],'sectionId':_0x37b101['id']},{})[_0x8b6a('0x26')](function(){return _0x496047;});}else{return _0x496047;}})[_0x8b6a('0x47')](function(_0x4a1f91){logger[_0x8b6a('0x2a')](_0x8b6a('0x52'),_0x4a1f91);throw _0x4a1f91;});}return _0x496047;})['then'](respondWithResult(_0xfe9178,0xc9))[_0x8b6a('0x47')](handleError(_0xfe9178,null));};exports[_0x8b6a('0x25')]=function(_0x3252b5,_0x4d4ac3){if(_0x3252b5[_0x8b6a('0x4c')]['id']){delete _0x3252b5[_0x8b6a('0x4c')]['id'];}return db['Template'][_0x8b6a('0x4a')]({'where':{'id':_0x3252b5[_0x8b6a('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d4ac3,null))[_0x8b6a('0x26')](saveUpdates(_0x3252b5['body'],null))[_0x8b6a('0x26')](respondWithResult(_0x4d4ac3,null))['catch'](handleError(_0x4d4ac3,null));};exports[_0x8b6a('0x29')]=function(_0x1c3977,_0x297093){return db[_0x8b6a('0x2d')]['find']({'where':{'id':_0x1c3977[_0x8b6a('0x49')]['id']}})['then'](handleEntityNotFound(_0x297093,null))[_0x8b6a('0x26')](removeEntity(_0x297093,null))['catch'](handleError(_0x297093,null));};
\ No newline at end of file
+var _0x42dc=['offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','get','Templates','UserProfileResource','end','error','stack','name','send','map','Template','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0x42dc,0xdb));var _0xc42d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x42dc[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc42d('0x0'));var zipdir=require(_0xc42d('0x1'));var jsonpatch=require(_0xc42d('0x2'));var rp=require(_0xc42d('0x3'));var moment=require(_0xc42d('0x4'));var BPromise=require(_0xc42d('0x5'));var Mustache=require(_0xc42d('0x6'));var util=require(_0xc42d('0x7'));var path=require(_0xc42d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc42d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc42d('0xa'));var squel=require(_0xc42d('0xb'));var crypto=require('crypto');var jsforce=require(_0xc42d('0xc'));var deskjs=require(_0xc42d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc42d('0xe'));var Redis=require(_0xc42d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc42d('0x10'));var as=require(_0xc42d('0x11'));var hardwareService=require(_0xc42d('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc42d('0x13'));var config=require(_0xc42d('0x14'));var licenseUtil=require(_0xc42d('0x15'));var db=require(_0xc42d('0x16'))['db'];function respondWithStatusCode(_0x492018,_0x492085){_0x492085=_0x492085||0xcc;return function(_0x5b1fc6){if(_0x5b1fc6){return _0x492018['sendStatus'](_0x492085);}return _0x492018[_0xc42d('0x17')](_0x492085)['end']();};}function respondWithResult(_0x414f9b,_0x432f3b){_0x432f3b=_0x432f3b||0xc8;return function(_0x1c5d11){if(_0x1c5d11){return _0x414f9b[_0xc42d('0x17')](_0x432f3b)['json'](_0x1c5d11);}};}function respondWithFilteredResult(_0x304e88,_0x4cbf03){return function(_0x284eda){if(_0x284eda){var _0x4bce68=typeof _0x4cbf03[_0xc42d('0x18')]===_0xc42d('0x19')&&typeof _0x4cbf03[_0xc42d('0x1a')]===_0xc42d('0x19');var _0x437002=_0x284eda[_0xc42d('0x1b')];var _0x61c00=_0x4bce68?0x0:_0x4cbf03[_0xc42d('0x18')];var _0x46a06b=_0x4bce68?_0x284eda[_0xc42d('0x1b')]:_0x4cbf03[_0xc42d('0x18')]+_0x4cbf03[_0xc42d('0x1a')];var _0x3de8ec;if(_0x46a06b>=_0x437002){_0x46a06b=_0x437002;_0x3de8ec=0xc8;}else{_0x3de8ec=0xce;}_0x304e88[_0xc42d('0x17')](_0x3de8ec);return _0x304e88[_0xc42d('0x1c')](_0xc42d('0x1d'),_0x61c00+'-'+_0x46a06b+'/'+_0x437002)[_0xc42d('0x1e')](_0x284eda);}return null;};}function patchUpdates(_0x43d4d4){return function(_0x23f630){try{jsonpatch['apply'](_0x23f630,_0x43d4d4,!![]);}catch(_0x4a0f1f){return BPromise[_0xc42d('0x1f')](_0x4a0f1f);}return _0x23f630[_0xc42d('0x20')]();};}function saveUpdates(_0x3b873b,_0x3b69b5){return function(_0xd508f1){if(_0xd508f1){return _0xd508f1['update'](_0x3b873b)[_0xc42d('0x21')](function(_0x13eabb){return _0x13eabb;});}return null;};}function removeEntity(_0x44e9d1,_0x2096fa){return function(_0x1f22d9){if(_0x1f22d9){return _0x1f22d9[_0xc42d('0x22')]()[_0xc42d('0x21')](function(){var _0x4af87f=_0x1f22d9[_0xc42d('0x23')]({'plain':!![]});var _0x424c72=_0xc42d('0x24');return db[_0xc42d('0x25')]['destroy']({'where':{'type':_0x424c72,'resourceId':_0x4af87f['id']}})['then'](function(){return _0x1f22d9;});})[_0xc42d('0x21')](function(){_0x44e9d1[_0xc42d('0x17')](0xcc)[_0xc42d('0x26')]();});}};}function handleEntityNotFound(_0x439019,_0x39a0f3){return function(_0x5e98b0){if(!_0x5e98b0){_0x439019['sendStatus'](0x194);}return _0x5e98b0;};}function handleError(_0x3fbf0a,_0x5dfc39){_0x5dfc39=_0x5dfc39||0x1f4;return function(_0x42d606){logger[_0xc42d('0x27')](_0x42d606[_0xc42d('0x28')]);if(_0x42d606['name']){delete _0x42d606[_0xc42d('0x29')];}_0x3fbf0a['status'](_0x5dfc39)[_0xc42d('0x2a')](_0x42d606);};}exports['index']=function(_0x5dba23,_0x47bc58){var _0x24348a={},_0x4859cb={},_0x4c676d={'count':0x0,'rows':[]};var _0x48e61f=_[_0xc42d('0x2b')](db[_0xc42d('0x2c')][_0xc42d('0x2d')],function(_0x598bac){return{'name':_0x598bac[_0xc42d('0x2e')],'type':_0x598bac[_0xc42d('0x2f')][_0xc42d('0x30')]};});_0x4859cb[_0xc42d('0x31')]=_['map'](_0x48e61f,_0xc42d('0x29'));_0x4859cb[_0xc42d('0x32')]=_[_0xc42d('0x33')](_0x5dba23[_0xc42d('0x32')]);_0x4859cb['filters']=_[_0xc42d('0x34')](_0x4859cb[_0xc42d('0x31')],_0x4859cb[_0xc42d('0x32')]);_0x24348a['attributes']=_[_0xc42d('0x34')](_0x4859cb[_0xc42d('0x31')],qs[_0xc42d('0x35')](_0x5dba23[_0xc42d('0x32')][_0xc42d('0x35')]));_0x24348a[_0xc42d('0x36')]=_0x24348a['attributes'][_0xc42d('0x37')]?_0x24348a[_0xc42d('0x36')]:_0x4859cb[_0xc42d('0x31')];if(!_0x5dba23[_0xc42d('0x32')]['hasOwnProperty'](_0xc42d('0x38'))){_0x24348a[_0xc42d('0x1a')]=qs[_0xc42d('0x1a')](_0x5dba23[_0xc42d('0x32')][_0xc42d('0x1a')]);_0x24348a[_0xc42d('0x18')]=qs[_0xc42d('0x18')](_0x5dba23[_0xc42d('0x32')][_0xc42d('0x18')]);}_0x24348a[_0xc42d('0x39')]=qs['sort'](_0x5dba23[_0xc42d('0x32')][_0xc42d('0x3a')]);_0x24348a[_0xc42d('0x3b')]=qs[_0xc42d('0x3c')](_[_0xc42d('0x3d')](_0x5dba23[_0xc42d('0x32')],_0x4859cb[_0xc42d('0x3c')]),_0x48e61f);if(_0x5dba23[_0xc42d('0x32')][_0xc42d('0x3e')]){_0x24348a['where']=_[_0xc42d('0x3f')](_0x24348a['where'],{'$or':_['map'](_0x48e61f,function(_0x3ba4dd){if(_0x3ba4dd[_0xc42d('0x2f')]!==_0xc42d('0x40')){var _0x6239ba={};_0x6239ba[_0x3ba4dd[_0xc42d('0x29')]]={'$like':'%'+_0x5dba23[_0xc42d('0x32')]['filter']+'%'};return _0x6239ba;}})});}_0x24348a=_[_0xc42d('0x3f')]({},_0x24348a,_0x5dba23[_0xc42d('0x41')]);var _0xc8038={'where':_0x24348a[_0xc42d('0x3b')]};return db[_0xc42d('0x2c')]['count'](_0xc8038)[_0xc42d('0x21')](function(_0x50e26b){_0x4c676d[_0xc42d('0x1b')]=_0x50e26b;if(_0x5dba23['query'][_0xc42d('0x42')]){_0x24348a[_0xc42d('0x43')]=[{'all':!![]}];}return db[_0xc42d('0x2c')]['findAll'](_0x24348a);})[_0xc42d('0x21')](function(_0x346275){_0x4c676d['rows']=_0x346275;return _0x4c676d;})[_0xc42d('0x21')](respondWithFilteredResult(_0x47bc58,_0x24348a))[_0xc42d('0x44')](handleError(_0x47bc58,null));};exports[_0xc42d('0x45')]=function(_0x16e43e,_0x4c5067){var _0x207cf6={'raw':!![],'where':{'id':_0x16e43e[_0xc42d('0x46')]['id']}},_0x1bf528={};_0x1bf528[_0xc42d('0x31')]=_[_0xc42d('0x33')](db['Template'][_0xc42d('0x2d')]);_0x1bf528['query']=_[_0xc42d('0x33')](_0x16e43e[_0xc42d('0x32')]);_0x1bf528[_0xc42d('0x3c')]=_[_0xc42d('0x34')](_0x1bf528[_0xc42d('0x31')],_0x1bf528['query']);_0x207cf6[_0xc42d('0x36')]=_[_0xc42d('0x34')](_0x1bf528[_0xc42d('0x31')],qs[_0xc42d('0x35')](_0x16e43e['query'][_0xc42d('0x35')]));_0x207cf6[_0xc42d('0x36')]=_0x207cf6[_0xc42d('0x36')]['length']?_0x207cf6[_0xc42d('0x36')]:_0x1bf528[_0xc42d('0x31')];if(_0x16e43e[_0xc42d('0x32')][_0xc42d('0x42')]){_0x207cf6[_0xc42d('0x43')]=[{'all':!![]}];}_0x207cf6=_[_0xc42d('0x3f')]({},_0x207cf6,_0x16e43e['options']);return db['Template'][_0xc42d('0x47')](_0x207cf6)[_0xc42d('0x21')](handleEntityNotFound(_0x4c5067,null))[_0xc42d('0x21')](respondWithResult(_0x4c5067,null))['catch'](handleError(_0x4c5067,null));};exports[_0xc42d('0x48')]=function(_0x3bfd80,_0x3692f3){return db[_0xc42d('0x2c')][_0xc42d('0x48')](_0x3bfd80[_0xc42d('0x49')],{})[_0xc42d('0x21')](function(_0x4e5be3){var _0x26f982=_0x3bfd80['user'][_0xc42d('0x23')]({'plain':!![]});if(!_0x26f982)throw new Error(_0xc42d('0x4a'));if(_0x26f982[_0xc42d('0x4b')]===_0xc42d('0x4c')){var _0x565b00=_0x4e5be3[_0xc42d('0x23')]({'plain':!![]});var _0x13c6e8=_0xc42d('0x24');return db[_0xc42d('0x4d')][_0xc42d('0x47')]({'where':{'name':_0x13c6e8,'userProfileId':_0x26f982[_0xc42d('0x4e')]},'raw':!![]})['then'](function(_0x3ec19f){if(_0x3ec19f&&_0x3ec19f[_0xc42d('0x4f')]===0x0){return db[_0xc42d('0x25')][_0xc42d('0x48')]({'name':_0x565b00[_0xc42d('0x29')],'resourceId':_0x565b00['id'],'type':_0x3ec19f[_0xc42d('0x29')],'sectionId':_0x3ec19f['id']},{})[_0xc42d('0x21')](function(){return _0x4e5be3;});}else{return _0x4e5be3;}})[_0xc42d('0x44')](function(_0x250918){logger[_0xc42d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x250918);throw _0x250918;});}return _0x4e5be3;})['then'](respondWithResult(_0x3692f3,0xc9))[_0xc42d('0x44')](handleError(_0x3692f3,null));};exports[_0xc42d('0x50')]=function(_0x3834ac,_0x6eafaf){if(_0x3834ac[_0xc42d('0x49')]['id']){delete _0x3834ac['body']['id'];}return db[_0xc42d('0x2c')]['find']({'where':{'id':_0x3834ac[_0xc42d('0x46')]['id']}})[_0xc42d('0x21')](handleEntityNotFound(_0x6eafaf,null))['then'](saveUpdates(_0x3834ac[_0xc42d('0x49')],null))[_0xc42d('0x21')](respondWithResult(_0x6eafaf,null))[_0xc42d('0x44')](handleError(_0x6eafaf,null));};exports['destroy']=function(_0x12bd18,_0x275393){return db[_0xc42d('0x2c')][_0xc42d('0x47')]({'where':{'id':_0x12bd18[_0xc42d('0x46')]['id']}})[_0xc42d('0x21')](handleEntityNotFound(_0x275393,null))[_0xc42d('0x21')](removeEntity(_0x275393,null))['catch'](handleError(_0x275393,null));};
\ No newline at end of file
index 017b73d..f0dd1d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe352=['request-promise','path','rimraf','exports','define','Template','lodash','util','../../config/logger','api'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xe352,0x132));var _0x2e35=function(_0x4fbb76,_0x39aaa8){_0x4fbb76=_0x4fbb76-0x0;var _0x407333=_0xe352[_0x4fbb76];return _0x407333;};'use strict';var _=require(_0x2e35('0x0'));var util=require(_0x2e35('0x1'));var logger=require(_0x2e35('0x2'))(_0x2e35('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2e35('0x4'));var fs=require('fs');var path=require(_0x2e35('0x5'));var rimraf=require(_0x2e35('0x6'));var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0x2e35('0x7')]=function(_0x14007e,_0x3d8ac1){return _0x14007e[_0x2e35('0x8')](_0x2e35('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc114=['moment','request-promise','path','./template.attributes','define','tools_templates','lodash','util','api'];(function(_0x5bcdf5,_0x31dedc){var _0x6cbf49=function(_0x578497){while(--_0x578497){_0x5bcdf5['push'](_0x5bcdf5['shift']());}};_0x6cbf49(++_0x31dedc);}(_0xc114,0x69));var _0x4c11=function(_0xa29a8a,_0x4f0cf3){_0xa29a8a=_0xa29a8a-0x0;var _0x4c6fba=_0xc114[_0xa29a8a];return _0x4c6fba;};'use strict';var _=require(_0x4c11('0x0'));var util=require(_0x4c11('0x1'));var logger=require('../../config/logger')(_0x4c11('0x2'));var moment=require(_0x4c11('0x3'));var BPromise=require('bluebird');var rp=require(_0x4c11('0x4'));var fs=require('fs');var path=require(_0x4c11('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4c11('0x6'));module['exports']=function(_0x27d9ce,_0x3168d0){return _0x27d9ce[_0x4c11('0x7')]('Template',attributes,{'tableName':_0x4c11('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9ef3b23..71b4836 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45de=['result','GetTemplate','Template','findAll','options','attributes','limit','map','include','model','debug','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x363311,_0x56e121){var _0x36f8cc=function(_0x16f60c){while(--_0x16f60c){_0x363311['push'](_0x363311['shift']());}};_0x36f8cc(++_0x56e121);}(_0x45de,0xe4));var _0xe45d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x45de[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe45d('0x0'));var rs=require(_0xe45d('0x1'));var fs=require('fs');var Redis=require(_0xe45d('0x2'));var db=require(_0xe45d('0x3'))['db'];var utils=require(_0xe45d('0x4'));var logger=require(_0xe45d('0x5'))(_0xe45d('0x6'));var config=require(_0xe45d('0x7'));var jayson=require(_0xe45d('0x8'));var client=jayson[_0xe45d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26bff8,_0x2c19c5,_0x44d1f5){return new BPromise(function(_0x2e4d06,_0x464318){return client[_0xe45d('0xa')](_0x26bff8,_0x44d1f5)[_0xe45d('0xb')](function(_0x29455b){logger[_0xe45d('0xc')](_0xe45d('0xd'),_0x2c19c5,_0xe45d('0xe'));logger['debug'](_0xe45d('0xf'),_0x2c19c5,_0xe45d('0xe'),JSON[_0xe45d('0x10')](_0x29455b));if(_0x29455b[_0xe45d('0x11')]){if(_0x29455b[_0xe45d('0x11')][_0xe45d('0x12')]===0x1f4){logger['error'](_0xe45d('0xd'),_0x2c19c5,_0x29455b['error'][_0xe45d('0x13')]);return _0x464318(_0x29455b['error'][_0xe45d('0x13')]);}logger['error'](_0xe45d('0xd'),_0x2c19c5,_0x29455b['error'][_0xe45d('0x13')]);return _0x2e4d06(_0x29455b[_0xe45d('0x11')]['message']);}else{logger[_0xe45d('0xc')](_0xe45d('0xd'),_0x2c19c5,'request\x20sent');_0x2e4d06(_0x29455b[_0xe45d('0x14')][_0xe45d('0x13')]);}})['catch'](function(_0x35c5b6){logger['error'](_0xe45d('0xd'),_0x2c19c5,_0x35c5b6);_0x464318(_0x35c5b6);});});}exports[_0xe45d('0x15')]=function(_0x4daba3){var _0x43682e=this;return new Promise(function(_0x4e6c3b,_0x5aa419){return db[_0xe45d('0x16')][_0xe45d('0x17')]({'raw':_0x4daba3[_0xe45d('0x18')]?_0x4daba3[_0xe45d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4daba3['options']?_0x4daba3[_0xe45d('0x18')]['where']||null:null,'attributes':_0x4daba3[_0xe45d('0x18')]?_0x4daba3['options'][_0xe45d('0x19')]||null:null,'limit':_0x4daba3['options']?_0x4daba3[_0xe45d('0x18')][_0xe45d('0x1a')]||null:null,'include':_0x4daba3['options']?_0x4daba3[_0xe45d('0x18')]['include']?_[_0xe45d('0x1b')](_0x4daba3['options'][_0xe45d('0x1c')],function(_0x307d18){return{'model':db[_0x307d18[_0xe45d('0x1d')]],'as':_0x307d18['as'],'attributes':_0x307d18[_0xe45d('0x19')],'include':_0x307d18[_0xe45d('0x1c')]?_[_0xe45d('0x1b')](_0x307d18[_0xe45d('0x1c')],function(_0x836a5e){return{'model':db[_0x836a5e[_0xe45d('0x1d')]],'as':_0x836a5e['as'],'attributes':_0x836a5e[_0xe45d('0x19')],'include':_0x836a5e['include']?_['map'](_0x836a5e[_0xe45d('0x1c')],function(_0xb254d4){return{'model':db[_0xb254d4['model']],'as':_0xb254d4['as'],'attributes':_0xb254d4[_0xe45d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f167b){logger[_0xe45d('0xc')]('GetTemplate',_0x4daba3);logger[_0xe45d('0x1e')](_0xe45d('0x15'),_0x4daba3,JSON[_0xe45d('0x10')](_0x2f167b));_0x4e6c3b(_0x2f167b);})['catch'](function(_0x135886){logger['error'](_0xe45d('0x15'),_0x135886[_0xe45d('0x13')],_0x4daba3);_0x5aa419(_0x43682e[_0xe45d('0x11')](0x1f4,_0x135886[_0xe45d('0x13')]));});});};
\ No newline at end of file
+var _0x840a=['client','http','then','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Template,\x20%s,\x20%s','GetTemplate','findAll','options','raw','limit','include','map','model','attributes','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3de27a,_0x26aeb5){var _0x1058ca=function(_0x54ddb6){while(--_0x54ddb6){_0x3de27a['push'](_0x3de27a['shift']());}};_0x1058ca(++_0x26aeb5);}(_0x840a,0x77));var _0xa840=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x840a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa840('0x0'));var util=require(_0xa840('0x1'));var moment=require(_0xa840('0x2'));var BPromise=require('bluebird');var rs=require(_0xa840('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa840('0x4'))['db'];var utils=require(_0xa840('0x5'));var logger=require('../../config/logger')(_0xa840('0x6'));var config=require(_0xa840('0x7'));var jayson=require(_0xa840('0x8'));var client=jayson[_0xa840('0x9')][_0xa840('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e7a18,_0xc611af,_0x4c484a){return new BPromise(function(_0x4a25b4,_0x2c12f6){return client['request'](_0x5e7a18,_0x4c484a)[_0xa840('0xb')](function(_0x3172b3){logger['info']('Template,\x20%s,\x20%s',_0xc611af,_0xa840('0xc'));logger[_0xa840('0xd')](_0xa840('0xe'),_0xc611af,_0xa840('0xc'),JSON[_0xa840('0xf')](_0x3172b3));if(_0x3172b3['error']){if(_0x3172b3[_0xa840('0x10')][_0xa840('0x11')]===0x1f4){logger[_0xa840('0x10')]('Template,\x20%s,\x20%s',_0xc611af,_0x3172b3[_0xa840('0x10')][_0xa840('0x12')]);return _0x2c12f6(_0x3172b3[_0xa840('0x10')][_0xa840('0x12')]);}logger[_0xa840('0x10')]('Template,\x20%s,\x20%s',_0xc611af,_0x3172b3[_0xa840('0x10')][_0xa840('0x12')]);return _0x4a25b4(_0x3172b3['error'][_0xa840('0x12')]);}else{logger[_0xa840('0x13')]('Template,\x20%s,\x20%s',_0xc611af,_0xa840('0xc'));_0x4a25b4(_0x3172b3[_0xa840('0x14')][_0xa840('0x12')]);}})[_0xa840('0x15')](function(_0x342bb8){logger[_0xa840('0x10')](_0xa840('0x16'),_0xc611af,_0x342bb8);_0x2c12f6(_0x342bb8);});});}exports[_0xa840('0x17')]=function(_0x4ca2e0){var _0xa8dfa4=this;return new Promise(function(_0x2dd568,_0xfe6973){return db['Template'][_0xa840('0x18')]({'raw':_0x4ca2e0[_0xa840('0x19')]?_0x4ca2e0['options'][_0xa840('0x1a')]===undefined?!![]:![]:!![],'where':_0x4ca2e0[_0xa840('0x19')]?_0x4ca2e0['options']['where']||null:null,'attributes':_0x4ca2e0[_0xa840('0x19')]?_0x4ca2e0[_0xa840('0x19')]['attributes']||null:null,'limit':_0x4ca2e0[_0xa840('0x19')]?_0x4ca2e0[_0xa840('0x19')][_0xa840('0x1b')]||null:null,'include':_0x4ca2e0[_0xa840('0x19')]?_0x4ca2e0['options'][_0xa840('0x1c')]?_[_0xa840('0x1d')](_0x4ca2e0[_0xa840('0x19')][_0xa840('0x1c')],function(_0x73490c){return{'model':db[_0x73490c[_0xa840('0x1e')]],'as':_0x73490c['as'],'attributes':_0x73490c[_0xa840('0x1f')],'include':_0x73490c[_0xa840('0x1c')]?_[_0xa840('0x1d')](_0x73490c[_0xa840('0x1c')],function(_0x271116){return{'model':db[_0x271116[_0xa840('0x1e')]],'as':_0x271116['as'],'attributes':_0x271116[_0xa840('0x1f')],'include':_0x271116[_0xa840('0x1c')]?_[_0xa840('0x1d')](_0x271116[_0xa840('0x1c')],function(_0x2a4e92){return{'model':db[_0x2a4e92[_0xa840('0x1e')]],'as':_0x2a4e92['as'],'attributes':_0x2a4e92['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4faee3){logger[_0xa840('0x13')](_0xa840('0x17'),_0x4ca2e0);logger[_0xa840('0xd')]('GetTemplate',_0x4ca2e0,JSON[_0xa840('0xf')](_0x4faee3));_0x2dd568(_0x4faee3);})['catch'](function(_0x536411){logger[_0xa840('0x10')](_0xa840('0x17'),_0x536411[_0xa840('0x12')],_0x4ca2e0);_0xfe6973(_0xa8dfa4[_0xa840('0x10')](0x1f4,_0x536411[_0xa840('0x12')]));});});};
\ No newline at end of file
index 8f2df21..5703df8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38c1=['./trigger.controller','get','isAuthenticated','/:id','show','/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x25aea0,_0x5dbc63){var _0x5653a7=function(_0x14b912){while(--_0x14b912){_0x25aea0['push'](_0x25aea0['shift']());}};_0x5653a7(++_0x5dbc63);}(_0x38c1,0x7f));var _0x138c=function(_0x2c658a,_0x18d39e){_0x2c658a=_0x2c658a-0x0;var _0x26806e=_0x38c1[_0x2c658a];return _0x26806e;};'use strict';var multer=require(_0x138c('0x0'));var util=require(_0x138c('0x1'));var path=require(_0x138c('0x2'));var timeout=require(_0x138c('0x3'));var express=require(_0x138c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x138c('0x5'));var interaction=require(_0x138c('0x6'));var config=require(_0x138c('0x7'));var controller=require(_0x138c('0x8'));router[_0x138c('0x9')]('/',auth[_0x138c('0xa')](),controller['index']);router[_0x138c('0x9')](_0x138c('0xb'),auth[_0x138c('0xa')](),controller[_0x138c('0xc')]);router[_0x138c('0x9')](_0x138c('0xd'),auth[_0x138c('0xa')](),controller['getAllConditions']);router['get'](_0x138c('0xe'),auth[_0x138c('0xa')](),controller['getAnyConditions']);router['get'](_0x138c('0xf'),auth['isAuthenticated'](),controller[_0x138c('0x10')]);router[_0x138c('0x11')]('/',auth['isAuthenticated'](),controller[_0x138c('0x12')]);router[_0x138c('0x11')]('/:id/all_conditions',auth[_0x138c('0xa')](),controller[_0x138c('0x13')]);router[_0x138c('0x11')](_0x138c('0xe'),auth['isAuthenticated'](),controller[_0x138c('0x14')]);router[_0x138c('0x11')](_0x138c('0xf'),auth['isAuthenticated'](),controller[_0x138c('0x15')]);router[_0x138c('0x16')](_0x138c('0xb'),auth[_0x138c('0xa')](),controller[_0x138c('0x17')]);router[_0x138c('0x18')]('/:id',auth[_0x138c('0xa')](),controller[_0x138c('0x19')]);module[_0x138c('0x1a')]=router;
\ No newline at end of file
+var _0xe5a9=['/:id','isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','post','create','addAllCondition','/:id/actions','addAction','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get'];(function(_0x181cd3,_0xbb7f9e){var _0x50b066=function(_0x538c22){while(--_0x538c22){_0x181cd3['push'](_0x181cd3['shift']());}};_0x50b066(++_0xbb7f9e);}(_0xe5a9,0x9e));var _0x9e5a=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xe5a9[_0x9df060];return _0x338dfe;};'use strict';var multer=require('multer');var util=require(_0x9e5a('0x0'));var path=require(_0x9e5a('0x1'));var timeout=require(_0x9e5a('0x2'));var express=require(_0x9e5a('0x3'));var router=express[_0x9e5a('0x4')]();var fs_extra=require(_0x9e5a('0x5'));var auth=require(_0x9e5a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9e5a('0x7'));var controller=require(_0x9e5a('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9e5a('0x9')](_0x9e5a('0xa'),auth[_0x9e5a('0xb')](),controller['show']);router[_0x9e5a('0x9')](_0x9e5a('0xc'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0xd')]);router['get'](_0x9e5a('0xe'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0xf')]);router['get']('/:id/actions',auth[_0x9e5a('0xb')](),controller['getActions']);router[_0x9e5a('0x10')]('/',auth[_0x9e5a('0xb')](),controller[_0x9e5a('0x11')]);router['post'](_0x9e5a('0xc'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0x12')]);router['post'](_0x9e5a('0xe'),auth[_0x9e5a('0xb')](),controller['addAnyCondition']);router[_0x9e5a('0x10')](_0x9e5a('0x13'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0x14')]);router[_0x9e5a('0x15')](_0x9e5a('0xa'),auth[_0x9e5a('0xb')](),controller[_0x9e5a('0x16')]);router[_0x9e5a('0x17')](_0x9e5a('0xa'),auth[_0x9e5a('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 57f8e36..6ea0a06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76da=['STRING','BOOLEAN','sequelize'];(function(_0x210aa7,_0x33d8b5){var _0x205dbf=function(_0x2dc981){while(--_0x2dc981){_0x210aa7['push'](_0x210aa7['shift']());}};_0x205dbf(++_0x33d8b5);}(_0x76da,0x15e));var _0xa76d=function(_0xefc228,_0xa7a556){_0xefc228=_0xefc228-0x0;var _0x320061=_0x76da[_0xefc228];return _0x320061;};'use strict';var Sequelize=require(_0xa76d('0x0'));module['exports']={'name':{'type':Sequelize[_0xa76d('0x1')]},'channel':{'type':Sequelize[_0xa76d('0x1')]},'description':{'type':Sequelize[_0xa76d('0x1')]},'status':{'type':Sequelize[_0xa76d('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9ac1=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2932e0,_0x50e3d5){var _0x20e7da=function(_0x1a20b4){while(--_0x1a20b4){_0x2932e0['push'](_0x2932e0['shift']());}};_0x20e7da(++_0x50e3d5);}(_0x9ac1,0x154));var _0x19ac=function(_0x4e684b,_0x2d7148){_0x4e684b=_0x4e684b-0x0;var _0x2df0e4=_0x9ac1[_0x4e684b];return _0x2df0e4;};'use strict';var Sequelize=require(_0x19ac('0x0'));module[_0x19ac('0x1')]={'name':{'type':Sequelize[_0x19ac('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x19ac('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 95222a3..43fde02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x040b=['path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','Triggers','UserProfileResource','error','name','send','map','Trigger','rawAttributes','fieldName','type','model','keys','filters','intersection','fields','query','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x040b,0xb5));var _0xb040=function(_0x5c4535,_0xe34ba){_0x5c4535=_0x5c4535-0x0;var _0x5700f6=_0x040b[_0x5c4535];return _0x5700f6;};'use strict';var emlformat=require(_0xb040('0x0'));var rimraf=require(_0xb040('0x1'));var zipdir=require(_0xb040('0x2'));var jsonpatch=require(_0xb040('0x3'));var rp=require(_0xb040('0x4'));var moment=require(_0xb040('0x5'));var BPromise=require(_0xb040('0x6'));var Mustache=require(_0xb040('0x7'));var util=require(_0xb040('0x8'));var path=require(_0xb040('0x9'));var sox=require(_0xb040('0xa'));var csv=require(_0xb040('0xb'));var ejs=require(_0xb040('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb040('0xd'));var squel=require('squel');var crypto=require(_0xb040('0xe'));var jsforce=require(_0xb040('0xf'));var deskjs=require(_0xb040('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb040('0x11'));var Papa=require(_0xb040('0x12'));var Redis=require(_0xb040('0x13'));var authService=require(_0xb040('0x14'));var qs=require(_0xb040('0x15'));var as=require(_0xb040('0x16'));var hardwareService=require(_0xb040('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xb040('0x18'));var config=require(_0xb040('0x19'));var licenseUtil=require(_0xb040('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x553e58,_0x8d16fd){_0x8d16fd=_0x8d16fd||0xcc;return function(_0x397b5b){if(_0x397b5b){return _0x553e58[_0xb040('0x1b')](_0x8d16fd);}return _0x553e58[_0xb040('0x1c')](_0x8d16fd)[_0xb040('0x1d')]();};}function respondWithResult(_0x5444e7,_0x358828){_0x358828=_0x358828||0xc8;return function(_0x339113){if(_0x339113){return _0x5444e7['status'](_0x358828)[_0xb040('0x1e')](_0x339113);}};}function respondWithFilteredResult(_0x35f34b,_0x458b77){return function(_0xce2a7b){if(_0xce2a7b){var _0x227027=typeof _0x458b77[_0xb040('0x1f')]===_0xb040('0x20')&&typeof _0x458b77[_0xb040('0x21')]===_0xb040('0x20');var _0x235032=_0xce2a7b[_0xb040('0x22')];var _0x4e678a=_0x227027?0x0:_0x458b77[_0xb040('0x1f')];var _0x28b5b2=_0x227027?_0xce2a7b[_0xb040('0x22')]:_0x458b77[_0xb040('0x1f')]+_0x458b77[_0xb040('0x21')];var _0x54549d;if(_0x28b5b2>=_0x235032){_0x28b5b2=_0x235032;_0x54549d=0xc8;}else{_0x54549d=0xce;}_0x35f34b[_0xb040('0x1c')](_0x54549d);return _0x35f34b['set'](_0xb040('0x23'),_0x4e678a+'-'+_0x28b5b2+'/'+_0x235032)[_0xb040('0x1e')](_0xce2a7b);}return null;};}function patchUpdates(_0x16e552){return function(_0x588b0e){try{jsonpatch[_0xb040('0x24')](_0x588b0e,_0x16e552,!![]);}catch(_0xcd4a4){return BPromise[_0xb040('0x25')](_0xcd4a4);}return _0x588b0e[_0xb040('0x26')]();};}function saveUpdates(_0x4aafe5,_0x2642ce){return function(_0x1de3bc){if(_0x1de3bc){return _0x1de3bc['update'](_0x4aafe5)['then'](function(_0x11dd38){return _0x11dd38;});}return null;};}function removeEntity(_0x225529,_0x36b983){return function(_0x3ce2b2){if(_0x3ce2b2){return _0x3ce2b2[_0xb040('0x27')]()[_0xb040('0x28')](function(){var _0x34c74d=_0x3ce2b2[_0xb040('0x29')]({'plain':!![]});var _0x291284=_0xb040('0x2a');return db[_0xb040('0x2b')][_0xb040('0x27')]({'where':{'type':_0x291284,'resourceId':_0x34c74d['id']}})[_0xb040('0x28')](function(){return _0x3ce2b2;});})['then'](function(){_0x225529['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x517cbb,_0x5373cd){return function(_0x5888cd){if(!_0x5888cd){_0x517cbb[_0xb040('0x1b')](0x194);}return _0x5888cd;};}function handleError(_0x58397b,_0x3d7ed5){_0x3d7ed5=_0x3d7ed5||0x1f4;return function(_0xdf2b61){logger[_0xb040('0x2c')](_0xdf2b61['stack']);if(_0xdf2b61['name']){delete _0xdf2b61[_0xb040('0x2d')];}_0x58397b['status'](_0x3d7ed5)[_0xb040('0x2e')](_0xdf2b61);};}exports['index']=function(_0x2dab4b,_0x555aa8){var _0x1c3ffd={},_0x1c3cd4={},_0x9e5b4a={'count':0x0,'rows':[]};var _0x57fe00=_[_0xb040('0x2f')](db[_0xb040('0x30')][_0xb040('0x31')],function(_0x3c1bac){return{'name':_0x3c1bac[_0xb040('0x32')],'type':_0x3c1bac[_0xb040('0x33')]['key']};});_0x1c3cd4[_0xb040('0x34')]=_[_0xb040('0x2f')](_0x57fe00,_0xb040('0x2d'));_0x1c3cd4['query']=_[_0xb040('0x35')](_0x2dab4b['query']);_0x1c3cd4[_0xb040('0x36')]=_['intersection'](_0x1c3cd4[_0xb040('0x34')],_0x1c3cd4['query']);_0x1c3ffd['attributes']=_[_0xb040('0x37')](_0x1c3cd4['model'],qs[_0xb040('0x38')](_0x2dab4b[_0xb040('0x39')][_0xb040('0x38')]));_0x1c3ffd[_0xb040('0x3a')]=_0x1c3ffd[_0xb040('0x3a')][_0xb040('0x3b')]?_0x1c3ffd[_0xb040('0x3a')]:_0x1c3cd4[_0xb040('0x34')];if(!_0x2dab4b[_0xb040('0x39')]['hasOwnProperty'](_0xb040('0x3c'))){_0x1c3ffd[_0xb040('0x21')]=qs[_0xb040('0x21')](_0x2dab4b[_0xb040('0x39')][_0xb040('0x21')]);_0x1c3ffd[_0xb040('0x1f')]=qs[_0xb040('0x1f')](_0x2dab4b[_0xb040('0x39')][_0xb040('0x1f')]);}_0x1c3ffd[_0xb040('0x3d')]=qs[_0xb040('0x3e')](_0x2dab4b[_0xb040('0x39')]['sort']);_0x1c3ffd[_0xb040('0x3f')]=qs[_0xb040('0x36')](_[_0xb040('0x40')](_0x2dab4b[_0xb040('0x39')],_0x1c3cd4[_0xb040('0x36')]),_0x57fe00);if(_0x2dab4b['query'][_0xb040('0x41')]){_0x1c3ffd[_0xb040('0x3f')]=_[_0xb040('0x42')](_0x1c3ffd[_0xb040('0x3f')],{'$or':_[_0xb040('0x2f')](_0x57fe00,function(_0x3637f3){if(_0x3637f3[_0xb040('0x33')]!==_0xb040('0x43')){var _0x91c945={};_0x91c945[_0x3637f3['name']]={'$like':'%'+_0x2dab4b[_0xb040('0x39')]['filter']+'%'};return _0x91c945;}})});}_0x1c3ffd=_[_0xb040('0x42')]({},_0x1c3ffd,_0x2dab4b[_0xb040('0x44')]);var _0xff3607={'where':_0x1c3ffd[_0xb040('0x3f')]};return db[_0xb040('0x30')]['count'](_0xff3607)[_0xb040('0x28')](function(_0x3c664e){_0x9e5b4a['count']=_0x3c664e;if(_0x2dab4b[_0xb040('0x39')][_0xb040('0x45')]){_0x1c3ffd[_0xb040('0x46')]=[{'all':!![]}];}return db[_0xb040('0x30')][_0xb040('0x47')](_0x1c3ffd);})[_0xb040('0x28')](function(_0x374009){_0x9e5b4a[_0xb040('0x48')]=_0x374009;return _0x9e5b4a;})['then'](respondWithFilteredResult(_0x555aa8,_0x1c3ffd))[_0xb040('0x49')](handleError(_0x555aa8,null));};exports[_0xb040('0x4a')]=function(_0x5f4ad5,_0x51a3be){var _0x4c6da2={'raw':![],'where':{'id':_0x5f4ad5[_0xb040('0x4b')]['id']}},_0x44ea4d={};_0x44ea4d[_0xb040('0x34')]=_[_0xb040('0x35')](db['Trigger'][_0xb040('0x31')]);_0x44ea4d['query']=_[_0xb040('0x35')](_0x5f4ad5[_0xb040('0x39')]);_0x44ea4d[_0xb040('0x36')]=_['intersection'](_0x44ea4d[_0xb040('0x34')],_0x44ea4d[_0xb040('0x39')]);_0x4c6da2[_0xb040('0x3a')]=_[_0xb040('0x37')](_0x44ea4d[_0xb040('0x34')],qs['fields'](_0x5f4ad5[_0xb040('0x39')][_0xb040('0x38')]));_0x4c6da2[_0xb040('0x3a')]=_0x4c6da2[_0xb040('0x3a')][_0xb040('0x3b')]?_0x4c6da2[_0xb040('0x3a')]:_0x44ea4d[_0xb040('0x34')];if(_0x5f4ad5[_0xb040('0x39')][_0xb040('0x45')]){_0x4c6da2['include']=[{'all':!![]}];}_0x4c6da2=_[_0xb040('0x42')]({},_0x4c6da2,_0x5f4ad5['options']);return db[_0xb040('0x30')][_0xb040('0x4c')](_0x4c6da2)[_0xb040('0x28')](handleEntityNotFound(_0x51a3be,null))['then'](respondWithResult(_0x51a3be,null))[_0xb040('0x49')](handleError(_0x51a3be,null));};exports[_0xb040('0x4d')]=function(_0x4807d8,_0x284cd9){return db[_0xb040('0x30')][_0xb040('0x4d')](_0x4807d8[_0xb040('0x4e')],{})[_0xb040('0x28')](function(_0x5a54f0){var _0x27eda0=_0x4807d8['user'][_0xb040('0x29')]({'plain':!![]});if(!_0x27eda0)throw new Error(_0xb040('0x4f'));if(_0x27eda0['role']===_0xb040('0x50')){var _0x2917ce=_0x5a54f0[_0xb040('0x29')]({'plain':!![]});var _0x742e8d='Triggers';return db['UserProfileSection']['find']({'where':{'name':_0x742e8d,'userProfileId':_0x27eda0['userProfileId']},'raw':!![]})['then'](function(_0xcfd361){if(_0xcfd361&&_0xcfd361[_0xb040('0x51')]===0x0){return db[_0xb040('0x2b')][_0xb040('0x4d')]({'name':_0x2917ce[_0xb040('0x2d')],'resourceId':_0x2917ce['id'],'type':_0xcfd361[_0xb040('0x2d')],'sectionId':_0xcfd361['id']},{})[_0xb040('0x28')](function(){return _0x5a54f0;});}else{return _0x5a54f0;}})[_0xb040('0x49')](function(_0x1e673d){logger['error'](_0xb040('0x52'),_0x1e673d);throw _0x1e673d;});}return _0x5a54f0;})[_0xb040('0x28')](respondWithResult(_0x284cd9,0xc9))['catch'](handleError(_0x284cd9,null));};exports[_0xb040('0x53')]=function(_0x152e09,_0x1e0937){if(_0x152e09[_0xb040('0x4e')]['id']){delete _0x152e09[_0xb040('0x4e')]['id'];}return db['Trigger']['find']({'where':{'id':_0x152e09[_0xb040('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e0937,null))[_0xb040('0x28')](saveUpdates(_0x152e09[_0xb040('0x4e')],null))[_0xb040('0x28')](respondWithResult(_0x1e0937,null))[_0xb040('0x49')](handleError(_0x1e0937,null));};exports[_0xb040('0x27')]=function(_0x33ba83,_0x111bb5){return db[_0xb040('0x30')][_0xb040('0x4c')]({'where':{'id':_0x33ba83[_0xb040('0x4b')]['id']}})[_0xb040('0x28')](handleEntityNotFound(_0x111bb5,null))['then'](removeEntity(_0x111bb5,null))[_0xb040('0x49')](handleError(_0x111bb5,null));};exports['addAllCondition']=function(_0x34c49a,_0x2f12c0,_0x1418c4){if(_0x34c49a[_0xb040('0x4e')]['id']){delete _0x34c49a[_0xb040('0x4e')]['id'];}return db['Trigger']['find']({'where':{'id':_0x34c49a[_0xb040('0x4b')]['id']}})[_0xb040('0x28')](handleEntityNotFound(_0x2f12c0,null))[_0xb040('0x28')](function(_0x215554){if(_0x215554){_0x34c49a[_0xb040('0x4e')]['TriggerAllId']=_0x215554['id'];return db[_0xb040('0x54')]['create'](_0x34c49a[_0xb040('0x4e')]);}})[_0xb040('0x28')](respondWithResult(_0x2f12c0,null))[_0xb040('0x49')](handleError(_0x2f12c0,null));};exports[_0xb040('0x55')]=function(_0x2645fb,_0x4e3373,_0x9d7a80){if(_0x2645fb[_0xb040('0x4e')]['id']){delete _0x2645fb[_0xb040('0x4e')]['id'];}return db[_0xb040('0x30')]['find']({'where':{'id':_0x2645fb[_0xb040('0x4b')]['id']}})[_0xb040('0x28')](handleEntityNotFound(_0x4e3373,null))[_0xb040('0x28')](function(_0x35ff38){if(_0x35ff38){_0x2645fb[_0xb040('0x4e')][_0xb040('0x56')]=_0x35ff38['id'];return db[_0xb040('0x54')]['create'](_0x2645fb[_0xb040('0x4e')]);}})['then'](respondWithResult(_0x4e3373,null))[_0xb040('0x49')](handleError(_0x4e3373,null));};exports[_0xb040('0x57')]=function(_0x235db6,_0x44b1de,_0x229fbe){var _0x215a15={};var _0x16592b={};var _0x2ca354;var _0x623a0a;return db[_0xb040('0x30')][_0xb040('0x58')]({'where':{'id':_0x235db6[_0xb040('0x4b')]['id']}})['then'](handleEntityNotFound(_0x44b1de,null))[_0xb040('0x28')](function(_0x2c9bc5){if(_0x2c9bc5){_0x2ca354=_0x2c9bc5;_0x16592b[_0xb040('0x34')]=_[_0xb040('0x35')](db['Condition'][_0xb040('0x31')]);_0x16592b[_0xb040('0x39')]=_['keys'](_0x235db6['query']);_0x16592b[_0xb040('0x36')]=_[_0xb040('0x37')](_0x16592b[_0xb040('0x34')],_0x16592b[_0xb040('0x39')]);_0x215a15[_0xb040('0x3a')]=_[_0xb040('0x37')](_0x16592b['model'],qs[_0xb040('0x38')](_0x235db6[_0xb040('0x39')][_0xb040('0x38')]));_0x215a15[_0xb040('0x3a')]=_0x215a15[_0xb040('0x3a')][_0xb040('0x3b')]?_0x215a15['attributes']:_0x16592b['model'];_0x215a15[_0xb040('0x3d')]=qs[_0xb040('0x3e')](_0x235db6[_0xb040('0x39')][_0xb040('0x3e')]);_0x215a15[_0xb040('0x3f')]=qs[_0xb040('0x36')](_[_0xb040('0x40')](_0x235db6[_0xb040('0x39')],_0x16592b[_0xb040('0x36')]));if(_0x235db6[_0xb040('0x39')][_0xb040('0x41')]){_0x215a15['where']=_[_0xb040('0x42')](_0x215a15[_0xb040('0x3f')],{'$or':_[_0xb040('0x2f')](_0x215a15[_0xb040('0x3a')],function(_0x15563f){var _0x1f6e5b={};_0x1f6e5b[_0x15563f]={'$like':'%'+_0x235db6[_0xb040('0x39')][_0xb040('0x41')]+'%'};return _0x1f6e5b;})});}_0x215a15=_[_0xb040('0x42')]({},_0x215a15,_0x235db6[_0xb040('0x44')]);return _0x2ca354['getAllConditions'](_0x215a15);}})[_0xb040('0x28')](function(_0x425540){if(_0x425540){_0x623a0a=_0x425540[_0xb040('0x3b')];if(!_0x235db6[_0xb040('0x39')]['hasOwnProperty'](_0xb040('0x3c'))){_0x215a15[_0xb040('0x21')]=qs[_0xb040('0x21')](_0x235db6['query']['limit']);_0x215a15[_0xb040('0x1f')]=qs['offset'](_0x235db6['query'][_0xb040('0x1f')]);}return _0x2ca354[_0xb040('0x57')](_0x215a15);}})['then'](function(_0x3840b2){if(_0x3840b2){return _0x3840b2?{'count':_0x623a0a,'rows':_0x3840b2}:null;}})[_0xb040('0x28')](respondWithResult(_0x44b1de,null))['catch'](handleError(_0x44b1de,null));};exports[_0xb040('0x59')]=function(_0x20c2a4,_0x1755f4,_0x26836a){var _0x50b481={};var _0x2514af={};var _0x664761;var _0x45b4f5;return db[_0xb040('0x30')][_0xb040('0x58')]({'where':{'id':_0x20c2a4[_0xb040('0x4b')]['id']}})[_0xb040('0x28')](handleEntityNotFound(_0x1755f4,null))['then'](function(_0x2aa348){if(_0x2aa348){_0x664761=_0x2aa348;_0x2514af[_0xb040('0x34')]=_[_0xb040('0x35')](db[_0xb040('0x54')]['rawAttributes']);_0x2514af[_0xb040('0x39')]=_[_0xb040('0x35')](_0x20c2a4[_0xb040('0x39')]);_0x2514af[_0xb040('0x36')]=_[_0xb040('0x37')](_0x2514af[_0xb040('0x34')],_0x2514af['query']);_0x50b481['attributes']=_['intersection'](_0x2514af[_0xb040('0x34')],qs[_0xb040('0x38')](_0x20c2a4['query'][_0xb040('0x38')]));_0x50b481[_0xb040('0x3a')]=_0x50b481[_0xb040('0x3a')][_0xb040('0x3b')]?_0x50b481[_0xb040('0x3a')]:_0x2514af[_0xb040('0x34')];_0x50b481[_0xb040('0x3d')]=qs[_0xb040('0x3e')](_0x20c2a4['query'][_0xb040('0x3e')]);_0x50b481[_0xb040('0x3f')]=qs[_0xb040('0x36')](_[_0xb040('0x40')](_0x20c2a4[_0xb040('0x39')],_0x2514af[_0xb040('0x36')]));if(_0x20c2a4[_0xb040('0x39')][_0xb040('0x41')]){_0x50b481[_0xb040('0x3f')]=_[_0xb040('0x42')](_0x50b481[_0xb040('0x3f')],{'$or':_['map'](_0x50b481[_0xb040('0x3a')],function(_0x1c1759){var _0x5410b9={};_0x5410b9[_0x1c1759]={'$like':'%'+_0x20c2a4[_0xb040('0x39')]['filter']+'%'};return _0x5410b9;})});}_0x50b481=_['merge']({},_0x50b481,_0x20c2a4[_0xb040('0x44')]);return _0x664761[_0xb040('0x59')](_0x50b481);}})[_0xb040('0x28')](function(_0x4a3480){if(_0x4a3480){_0x45b4f5=_0x4a3480['length'];if(!_0x20c2a4['query']['hasOwnProperty']('nolimit')){_0x50b481['limit']=qs[_0xb040('0x21')](_0x20c2a4[_0xb040('0x39')][_0xb040('0x21')]);_0x50b481[_0xb040('0x1f')]=qs[_0xb040('0x1f')](_0x20c2a4['query'][_0xb040('0x1f')]);}return _0x664761['getAnyConditions'](_0x50b481);}})[_0xb040('0x28')](function(_0x4ee542){if(_0x4ee542){return _0x4ee542?{'count':_0x45b4f5,'rows':_0x4ee542}:null;}})[_0xb040('0x28')](respondWithResult(_0x1755f4,null))[_0xb040('0x49')](handleError(_0x1755f4,null));};exports[_0xb040('0x5a')]=function(_0x5d2fb6,_0xbfa2cc,_0x21d1e8){if(_0x5d2fb6[_0xb040('0x4e')]['id']){delete _0x5d2fb6['body']['id'];}return db[_0xb040('0x30')]['find']({'where':{'id':_0x5d2fb6['params']['id']}})['then'](handleEntityNotFound(_0xbfa2cc,null))[_0xb040('0x28')](function(_0x17b11c){if(_0x17b11c){_0x5d2fb6[_0xb040('0x4e')][_0xb040('0x5b')]=_0x17b11c['id'];return db[_0xb040('0x5c')]['create'](_0x5d2fb6[_0xb040('0x4e')]);}})['then'](respondWithResult(_0xbfa2cc,null))[_0xb040('0x49')](handleError(_0xbfa2cc,null));};exports[_0xb040('0x5d')]=function(_0x449dfc,_0x453fbb,_0x365727){var _0x29cda5={};var _0x260f17={};var _0x53a6ef;var _0x53810f;return db[_0xb040('0x30')][_0xb040('0x58')]({'where':{'id':_0x449dfc[_0xb040('0x4b')]['id']}})[_0xb040('0x28')](handleEntityNotFound(_0x453fbb,null))['then'](function(_0x557da4){if(_0x557da4){_0x53a6ef=_0x557da4;_0x260f17[_0xb040('0x34')]=_[_0xb040('0x35')](db['Action'][_0xb040('0x31')]);_0x260f17[_0xb040('0x39')]=_['keys'](_0x449dfc[_0xb040('0x39')]);_0x260f17[_0xb040('0x36')]=_['intersection'](_0x260f17[_0xb040('0x34')],_0x260f17[_0xb040('0x39')]);_0x29cda5[_0xb040('0x3a')]=_['intersection'](_0x260f17['model'],qs[_0xb040('0x38')](_0x449dfc[_0xb040('0x39')][_0xb040('0x38')]));_0x29cda5[_0xb040('0x3a')]=_0x29cda5[_0xb040('0x3a')][_0xb040('0x3b')]?_0x29cda5[_0xb040('0x3a')]:_0x260f17[_0xb040('0x34')];_0x29cda5[_0xb040('0x3d')]=qs[_0xb040('0x3e')](_0x449dfc[_0xb040('0x39')][_0xb040('0x3e')]);_0x29cda5[_0xb040('0x3f')]=qs[_0xb040('0x36')](_[_0xb040('0x40')](_0x449dfc[_0xb040('0x39')],_0x260f17[_0xb040('0x36')]));if(_0x449dfc['query'][_0xb040('0x41')]){_0x29cda5['where']=_[_0xb040('0x42')](_0x29cda5[_0xb040('0x3f')],{'$or':_[_0xb040('0x2f')](_0x29cda5[_0xb040('0x3a')],function(_0x9b730d){var _0xff78a0={};_0xff78a0[_0x9b730d]={'$like':'%'+_0x449dfc[_0xb040('0x39')]['filter']+'%'};return _0xff78a0;})});}_0x29cda5=_[_0xb040('0x42')]({},_0x29cda5,_0x449dfc[_0xb040('0x44')]);return _0x53a6ef[_0xb040('0x5d')](_0x29cda5);}})[_0xb040('0x28')](function(_0x281561){if(_0x281561){_0x53810f=_0x281561[_0xb040('0x3b')];if(!_0x449dfc[_0xb040('0x39')][_0xb040('0x5e')](_0xb040('0x3c'))){_0x29cda5[_0xb040('0x21')]=qs['limit'](_0x449dfc['query'][_0xb040('0x21')]);_0x29cda5[_0xb040('0x1f')]=qs['offset'](_0x449dfc['query']['offset']);}return _0x53a6ef['getActions'](_0x29cda5);}})[_0xb040('0x28')](function(_0x6b0be3){if(_0x6b0be3){return _0x6b0be3?{'count':_0x53810f,'rows':_0x6b0be3}:null;}})[_0xb040('0x28')](respondWithResult(_0x453fbb,null))[_0xb040('0x49')](handleError(_0x453fbb,null));};
\ No newline at end of file
+var _0x1084=['undefined','limit','count','set','json','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1084,0x104));var _0x4108=function(_0x39bd38,_0x332f92){_0x39bd38=_0x39bd38-0x0;var _0x5f3a72=_0x1084[_0x39bd38];return _0x5f3a72;};'use strict';var emlformat=require(_0x4108('0x0'));var rimraf=require(_0x4108('0x1'));var zipdir=require(_0x4108('0x2'));var jsonpatch=require(_0x4108('0x3'));var rp=require('request-promise');var moment=require(_0x4108('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4108('0x5'));var path=require(_0x4108('0x6'));var sox=require(_0x4108('0x7'));var csv=require(_0x4108('0x8'));var ejs=require(_0x4108('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4108('0xa'));var squel=require(_0x4108('0xb'));var crypto=require(_0x4108('0xc'));var jsforce=require(_0x4108('0xd'));var deskjs=require(_0x4108('0xe'));var toCsv=require(_0x4108('0x8'));var querystring=require(_0x4108('0xf'));var Papa=require(_0x4108('0x10'));var Redis=require(_0x4108('0x11'));var authService=require(_0x4108('0x12'));var qs=require(_0x4108('0x13'));var as=require(_0x4108('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4108('0x15'))(_0x4108('0x16'));var utils=require(_0x4108('0x17'));var config=require(_0x4108('0x18'));var licenseUtil=require(_0x4108('0x19'));var db=require(_0x4108('0x1a'))['db'];function respondWithStatusCode(_0x12f624,_0x6808dd){_0x6808dd=_0x6808dd||0xcc;return function(_0x251f7d){if(_0x251f7d){return _0x12f624[_0x4108('0x1b')](_0x6808dd);}return _0x12f624[_0x4108('0x1c')](_0x6808dd)[_0x4108('0x1d')]();};}function respondWithResult(_0x4f07c4,_0x5104a2){_0x5104a2=_0x5104a2||0xc8;return function(_0x2284e9){if(_0x2284e9){return _0x4f07c4[_0x4108('0x1c')](_0x5104a2)['json'](_0x2284e9);}};}function respondWithFilteredResult(_0x5941a7,_0xea2b35){return function(_0x3ba03b){if(_0x3ba03b){var _0x3c072b=typeof _0xea2b35[_0x4108('0x1e')]===_0x4108('0x1f')&&typeof _0xea2b35[_0x4108('0x20')]===_0x4108('0x1f');var _0xcac2cb=_0x3ba03b[_0x4108('0x21')];var _0x2139aa=_0x3c072b?0x0:_0xea2b35[_0x4108('0x1e')];var _0x332d81=_0x3c072b?_0x3ba03b['count']:_0xea2b35[_0x4108('0x1e')]+_0xea2b35[_0x4108('0x20')];var _0x34a77a;if(_0x332d81>=_0xcac2cb){_0x332d81=_0xcac2cb;_0x34a77a=0xc8;}else{_0x34a77a=0xce;}_0x5941a7[_0x4108('0x1c')](_0x34a77a);return _0x5941a7[_0x4108('0x22')]('Content-Range',_0x2139aa+'-'+_0x332d81+'/'+_0xcac2cb)[_0x4108('0x23')](_0x3ba03b);}return null;};}function patchUpdates(_0x47dc15){return function(_0x2e7218){try{jsonpatch[_0x4108('0x24')](_0x2e7218,_0x47dc15,!![]);}catch(_0x570e70){return BPromise[_0x4108('0x25')](_0x570e70);}return _0x2e7218[_0x4108('0x26')]();};}function saveUpdates(_0x596088,_0x3bb8ed){return function(_0x4edfd2){if(_0x4edfd2){return _0x4edfd2[_0x4108('0x27')](_0x596088)[_0x4108('0x28')](function(_0x4253dc){return _0x4253dc;});}return null;};}function removeEntity(_0x564619,_0x417224){return function(_0x39ede6){if(_0x39ede6){return _0x39ede6[_0x4108('0x29')]()[_0x4108('0x28')](function(){var _0x2ce7f7=_0x39ede6['get']({'plain':!![]});var _0x4b9a50=_0x4108('0x2a');return db[_0x4108('0x2b')][_0x4108('0x29')]({'where':{'type':_0x4b9a50,'resourceId':_0x2ce7f7['id']}})[_0x4108('0x28')](function(){return _0x39ede6;});})['then'](function(){_0x564619[_0x4108('0x1c')](0xcc)[_0x4108('0x1d')]();});}};}function handleEntityNotFound(_0x52f314,_0x109183){return function(_0x1f3d42){if(!_0x1f3d42){_0x52f314[_0x4108('0x1b')](0x194);}return _0x1f3d42;};}function handleError(_0x4c15ae,_0x33d316){_0x33d316=_0x33d316||0x1f4;return function(_0x5a6c37){logger[_0x4108('0x2c')](_0x5a6c37[_0x4108('0x2d')]);if(_0x5a6c37[_0x4108('0x2e')]){delete _0x5a6c37[_0x4108('0x2e')];}_0x4c15ae[_0x4108('0x1c')](_0x33d316)[_0x4108('0x2f')](_0x5a6c37);};}exports[_0x4108('0x30')]=function(_0x3e6a51,_0x4fa118){var _0x39ccc3={},_0x20c2fe={},_0x201422={'count':0x0,'rows':[]};var _0x2c83c7=_[_0x4108('0x31')](db[_0x4108('0x32')][_0x4108('0x33')],function(_0x33344d){return{'name':_0x33344d['fieldName'],'type':_0x33344d[_0x4108('0x34')][_0x4108('0x35')]};});_0x20c2fe[_0x4108('0x36')]=_['map'](_0x2c83c7,_0x4108('0x2e'));_0x20c2fe['query']=_[_0x4108('0x37')](_0x3e6a51[_0x4108('0x38')]);_0x20c2fe[_0x4108('0x39')]=_['intersection'](_0x20c2fe[_0x4108('0x36')],_0x20c2fe['query']);_0x39ccc3[_0x4108('0x3a')]=_[_0x4108('0x3b')](_0x20c2fe['model'],qs['fields'](_0x3e6a51[_0x4108('0x38')][_0x4108('0x3c')]));_0x39ccc3[_0x4108('0x3a')]=_0x39ccc3[_0x4108('0x3a')][_0x4108('0x3d')]?_0x39ccc3[_0x4108('0x3a')]:_0x20c2fe[_0x4108('0x36')];if(!_0x3e6a51[_0x4108('0x38')][_0x4108('0x3e')](_0x4108('0x3f'))){_0x39ccc3['limit']=qs['limit'](_0x3e6a51[_0x4108('0x38')][_0x4108('0x20')]);_0x39ccc3[_0x4108('0x1e')]=qs[_0x4108('0x1e')](_0x3e6a51['query']['offset']);}_0x39ccc3[_0x4108('0x40')]=qs[_0x4108('0x41')](_0x3e6a51[_0x4108('0x38')]['sort']);_0x39ccc3[_0x4108('0x42')]=qs['filters'](_[_0x4108('0x43')](_0x3e6a51[_0x4108('0x38')],_0x20c2fe[_0x4108('0x39')]),_0x2c83c7);if(_0x3e6a51['query'][_0x4108('0x44')]){_0x39ccc3[_0x4108('0x42')]=_[_0x4108('0x45')](_0x39ccc3[_0x4108('0x42')],{'$or':_[_0x4108('0x31')](_0x2c83c7,function(_0x582ec9){if(_0x582ec9[_0x4108('0x34')]!=='VIRTUAL'){var _0x2cce17={};_0x2cce17[_0x582ec9[_0x4108('0x2e')]]={'$like':'%'+_0x3e6a51['query'][_0x4108('0x44')]+'%'};return _0x2cce17;}})});}_0x39ccc3=_['merge']({},_0x39ccc3,_0x3e6a51['options']);var _0x5aa1d1={'where':_0x39ccc3['where']};return db[_0x4108('0x32')]['count'](_0x5aa1d1)[_0x4108('0x28')](function(_0x19f3e6){_0x201422['count']=_0x19f3e6;if(_0x3e6a51[_0x4108('0x38')][_0x4108('0x46')]){_0x39ccc3[_0x4108('0x47')]=[{'all':!![]}];}return db[_0x4108('0x32')][_0x4108('0x48')](_0x39ccc3);})['then'](function(_0x239029){_0x201422['rows']=_0x239029;return _0x201422;})[_0x4108('0x28')](respondWithFilteredResult(_0x4fa118,_0x39ccc3))[_0x4108('0x49')](handleError(_0x4fa118,null));};exports[_0x4108('0x4a')]=function(_0x529cb4,_0x485851){var _0x490195={'raw':![],'where':{'id':_0x529cb4[_0x4108('0x4b')]['id']}},_0x27177b={};_0x27177b[_0x4108('0x36')]=_['keys'](db['Trigger'][_0x4108('0x33')]);_0x27177b[_0x4108('0x38')]=_[_0x4108('0x37')](_0x529cb4['query']);_0x27177b['filters']=_[_0x4108('0x3b')](_0x27177b[_0x4108('0x36')],_0x27177b['query']);_0x490195[_0x4108('0x3a')]=_[_0x4108('0x3b')](_0x27177b[_0x4108('0x36')],qs[_0x4108('0x3c')](_0x529cb4[_0x4108('0x38')]['fields']));_0x490195[_0x4108('0x3a')]=_0x490195['attributes'][_0x4108('0x3d')]?_0x490195[_0x4108('0x3a')]:_0x27177b['model'];if(_0x529cb4[_0x4108('0x38')]['includeAll']){_0x490195[_0x4108('0x47')]=[{'all':!![]}];}_0x490195=_['merge']({},_0x490195,_0x529cb4[_0x4108('0x4c')]);return db[_0x4108('0x32')][_0x4108('0x4d')](_0x490195)[_0x4108('0x28')](handleEntityNotFound(_0x485851,null))['then'](respondWithResult(_0x485851,null))[_0x4108('0x49')](handleError(_0x485851,null));};exports[_0x4108('0x4e')]=function(_0x4b2c1c,_0x199a18){return db[_0x4108('0x32')][_0x4108('0x4e')](_0x4b2c1c[_0x4108('0x4f')],{})['then'](function(_0x403b41){var _0x3fa855=_0x4b2c1c[_0x4108('0x50')][_0x4108('0x51')]({'plain':!![]});if(!_0x3fa855)throw new Error(_0x4108('0x52'));if(_0x3fa855[_0x4108('0x53')]===_0x4108('0x50')){var _0x52b25e=_0x403b41[_0x4108('0x51')]({'plain':!![]});var _0x215e91='Triggers';return db[_0x4108('0x54')][_0x4108('0x4d')]({'where':{'name':_0x215e91,'userProfileId':_0x3fa855[_0x4108('0x55')]},'raw':!![]})[_0x4108('0x28')](function(_0x3cb20a){if(_0x3cb20a&&_0x3cb20a['autoAssociation']===0x0){return db[_0x4108('0x2b')][_0x4108('0x4e')]({'name':_0x52b25e['name'],'resourceId':_0x52b25e['id'],'type':_0x3cb20a[_0x4108('0x2e')],'sectionId':_0x3cb20a['id']},{})[_0x4108('0x28')](function(){return _0x403b41;});}else{return _0x403b41;}})[_0x4108('0x49')](function(_0x250c76){logger[_0x4108('0x2c')](_0x4108('0x56'),_0x250c76);throw _0x250c76;});}return _0x403b41;})[_0x4108('0x28')](respondWithResult(_0x199a18,0xc9))['catch'](handleError(_0x199a18,null));};exports[_0x4108('0x27')]=function(_0x300420,_0x709d75){if(_0x300420['body']['id']){delete _0x300420['body']['id'];}return db[_0x4108('0x32')][_0x4108('0x4d')]({'where':{'id':_0x300420['params']['id']}})[_0x4108('0x28')](handleEntityNotFound(_0x709d75,null))[_0x4108('0x28')](saveUpdates(_0x300420[_0x4108('0x4f')],null))[_0x4108('0x28')](respondWithResult(_0x709d75,null))[_0x4108('0x49')](handleError(_0x709d75,null));};exports[_0x4108('0x29')]=function(_0x402fb1,_0x389b08){return db[_0x4108('0x32')][_0x4108('0x4d')]({'where':{'id':_0x402fb1[_0x4108('0x4b')]['id']}})[_0x4108('0x28')](handleEntityNotFound(_0x389b08,null))[_0x4108('0x28')](removeEntity(_0x389b08,null))[_0x4108('0x49')](handleError(_0x389b08,null));};exports[_0x4108('0x57')]=function(_0x362ce,_0x52f195,_0x1fdde5){if(_0x362ce[_0x4108('0x4f')]['id']){delete _0x362ce[_0x4108('0x4f')]['id'];}return db[_0x4108('0x32')][_0x4108('0x4d')]({'where':{'id':_0x362ce['params']['id']}})[_0x4108('0x28')](handleEntityNotFound(_0x52f195,null))[_0x4108('0x28')](function(_0x172f51){if(_0x172f51){_0x362ce['body'][_0x4108('0x58')]=_0x172f51['id'];return db['Condition'][_0x4108('0x4e')](_0x362ce[_0x4108('0x4f')]);}})[_0x4108('0x28')](respondWithResult(_0x52f195,null))[_0x4108('0x49')](handleError(_0x52f195,null));};exports['addAnyCondition']=function(_0x499a7a,_0x222594,_0x3aa465){if(_0x499a7a['body']['id']){delete _0x499a7a['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x499a7a['params']['id']}})['then'](handleEntityNotFound(_0x222594,null))['then'](function(_0x54f6c5){if(_0x54f6c5){_0x499a7a[_0x4108('0x4f')]['TriggerAnyId']=_0x54f6c5['id'];return db[_0x4108('0x59')][_0x4108('0x4e')](_0x499a7a['body']);}})['then'](respondWithResult(_0x222594,null))[_0x4108('0x49')](handleError(_0x222594,null));};exports[_0x4108('0x5a')]=function(_0x720dd4,_0x4729fc,_0x3487e8){var _0x48e380={};var _0x512c99={};var _0x39308;var _0x403c33;return db[_0x4108('0x32')][_0x4108('0x5b')]({'where':{'id':_0x720dd4['params']['id']}})[_0x4108('0x28')](handleEntityNotFound(_0x4729fc,null))[_0x4108('0x28')](function(_0x4d0a1e){if(_0x4d0a1e){_0x39308=_0x4d0a1e;_0x512c99[_0x4108('0x36')]=_['keys'](db['Condition']['rawAttributes']);_0x512c99[_0x4108('0x38')]=_['keys'](_0x720dd4['query']);_0x512c99[_0x4108('0x39')]=_['intersection'](_0x512c99[_0x4108('0x36')],_0x512c99[_0x4108('0x38')]);_0x48e380['attributes']=_[_0x4108('0x3b')](_0x512c99[_0x4108('0x36')],qs['fields'](_0x720dd4['query'][_0x4108('0x3c')]));_0x48e380[_0x4108('0x3a')]=_0x48e380[_0x4108('0x3a')][_0x4108('0x3d')]?_0x48e380[_0x4108('0x3a')]:_0x512c99[_0x4108('0x36')];_0x48e380['order']=qs[_0x4108('0x41')](_0x720dd4['query'][_0x4108('0x41')]);_0x48e380['where']=qs[_0x4108('0x39')](_[_0x4108('0x43')](_0x720dd4[_0x4108('0x38')],_0x512c99['filters']));if(_0x720dd4[_0x4108('0x38')][_0x4108('0x44')]){_0x48e380[_0x4108('0x42')]=_['merge'](_0x48e380[_0x4108('0x42')],{'$or':_[_0x4108('0x31')](_0x48e380[_0x4108('0x3a')],function(_0x593292){var _0x44c56c={};_0x44c56c[_0x593292]={'$like':'%'+_0x720dd4[_0x4108('0x38')][_0x4108('0x44')]+'%'};return _0x44c56c;})});}_0x48e380=_[_0x4108('0x45')]({},_0x48e380,_0x720dd4['options']);return _0x39308[_0x4108('0x5a')](_0x48e380);}})['then'](function(_0x5a77ec){if(_0x5a77ec){_0x403c33=_0x5a77ec[_0x4108('0x3d')];if(!_0x720dd4[_0x4108('0x38')][_0x4108('0x3e')](_0x4108('0x3f'))){_0x48e380[_0x4108('0x20')]=qs[_0x4108('0x20')](_0x720dd4[_0x4108('0x38')][_0x4108('0x20')]);_0x48e380['offset']=qs[_0x4108('0x1e')](_0x720dd4['query']['offset']);}return _0x39308[_0x4108('0x5a')](_0x48e380);}})['then'](function(_0x374673){if(_0x374673){return _0x374673?{'count':_0x403c33,'rows':_0x374673}:null;}})[_0x4108('0x28')](respondWithResult(_0x4729fc,null))['catch'](handleError(_0x4729fc,null));};exports[_0x4108('0x5c')]=function(_0x49d7aa,_0x338c2b,_0x57ffac){var _0xc7654={};var _0x275b30={};var _0xe0b8c8;var _0x184de1;return db[_0x4108('0x32')]['findOne']({'where':{'id':_0x49d7aa[_0x4108('0x4b')]['id']}})[_0x4108('0x28')](handleEntityNotFound(_0x338c2b,null))[_0x4108('0x28')](function(_0x3b0cbd){if(_0x3b0cbd){_0xe0b8c8=_0x3b0cbd;_0x275b30['model']=_[_0x4108('0x37')](db[_0x4108('0x59')][_0x4108('0x33')]);_0x275b30['query']=_[_0x4108('0x37')](_0x49d7aa[_0x4108('0x38')]);_0x275b30[_0x4108('0x39')]=_[_0x4108('0x3b')](_0x275b30['model'],_0x275b30['query']);_0xc7654['attributes']=_['intersection'](_0x275b30[_0x4108('0x36')],qs[_0x4108('0x3c')](_0x49d7aa[_0x4108('0x38')]['fields']));_0xc7654[_0x4108('0x3a')]=_0xc7654[_0x4108('0x3a')]['length']?_0xc7654['attributes']:_0x275b30[_0x4108('0x36')];_0xc7654[_0x4108('0x40')]=qs[_0x4108('0x41')](_0x49d7aa[_0x4108('0x38')][_0x4108('0x41')]);_0xc7654[_0x4108('0x42')]=qs[_0x4108('0x39')](_[_0x4108('0x43')](_0x49d7aa[_0x4108('0x38')],_0x275b30[_0x4108('0x39')]));if(_0x49d7aa['query'][_0x4108('0x44')]){_0xc7654[_0x4108('0x42')]=_[_0x4108('0x45')](_0xc7654[_0x4108('0x42')],{'$or':_[_0x4108('0x31')](_0xc7654[_0x4108('0x3a')],function(_0x5a1d23){var _0x3ac079={};_0x3ac079[_0x5a1d23]={'$like':'%'+_0x49d7aa[_0x4108('0x38')][_0x4108('0x44')]+'%'};return _0x3ac079;})});}_0xc7654=_['merge']({},_0xc7654,_0x49d7aa[_0x4108('0x4c')]);return _0xe0b8c8['getAnyConditions'](_0xc7654);}})[_0x4108('0x28')](function(_0xe0243){if(_0xe0243){_0x184de1=_0xe0243[_0x4108('0x3d')];if(!_0x49d7aa[_0x4108('0x38')][_0x4108('0x3e')]('nolimit')){_0xc7654['limit']=qs['limit'](_0x49d7aa[_0x4108('0x38')][_0x4108('0x20')]);_0xc7654[_0x4108('0x1e')]=qs['offset'](_0x49d7aa[_0x4108('0x38')][_0x4108('0x1e')]);}return _0xe0b8c8['getAnyConditions'](_0xc7654);}})['then'](function(_0x55aee5){if(_0x55aee5){return _0x55aee5?{'count':_0x184de1,'rows':_0x55aee5}:null;}})['then'](respondWithResult(_0x338c2b,null))[_0x4108('0x49')](handleError(_0x338c2b,null));};exports[_0x4108('0x5d')]=function(_0x212bc9,_0x5a821d,_0x1c2316){if(_0x212bc9[_0x4108('0x4f')]['id']){delete _0x212bc9['body']['id'];}return db[_0x4108('0x32')][_0x4108('0x4d')]({'where':{'id':_0x212bc9[_0x4108('0x4b')]['id']}})[_0x4108('0x28')](handleEntityNotFound(_0x5a821d,null))[_0x4108('0x28')](function(_0xe8f13b){if(_0xe8f13b){_0x212bc9[_0x4108('0x4f')][_0x4108('0x5e')]=_0xe8f13b['id'];return db[_0x4108('0x5f')][_0x4108('0x4e')](_0x212bc9['body']);}})[_0x4108('0x28')](respondWithResult(_0x5a821d,null))[_0x4108('0x49')](handleError(_0x5a821d,null));};exports[_0x4108('0x60')]=function(_0x3aed26,_0x583713,_0x3485b2){var _0x2ec2ae={};var _0x3d4698={};var _0x3d8b3e;var _0x5b633f;return db['Trigger']['findOne']({'where':{'id':_0x3aed26[_0x4108('0x4b')]['id']}})[_0x4108('0x28')](handleEntityNotFound(_0x583713,null))[_0x4108('0x28')](function(_0x15e019){if(_0x15e019){_0x3d8b3e=_0x15e019;_0x3d4698[_0x4108('0x36')]=_[_0x4108('0x37')](db['Action'][_0x4108('0x33')]);_0x3d4698[_0x4108('0x38')]=_[_0x4108('0x37')](_0x3aed26['query']);_0x3d4698[_0x4108('0x39')]=_[_0x4108('0x3b')](_0x3d4698['model'],_0x3d4698[_0x4108('0x38')]);_0x2ec2ae['attributes']=_['intersection'](_0x3d4698[_0x4108('0x36')],qs[_0x4108('0x3c')](_0x3aed26[_0x4108('0x38')]['fields']));_0x2ec2ae[_0x4108('0x3a')]=_0x2ec2ae['attributes'][_0x4108('0x3d')]?_0x2ec2ae[_0x4108('0x3a')]:_0x3d4698[_0x4108('0x36')];_0x2ec2ae[_0x4108('0x40')]=qs[_0x4108('0x41')](_0x3aed26[_0x4108('0x38')][_0x4108('0x41')]);_0x2ec2ae[_0x4108('0x42')]=qs[_0x4108('0x39')](_['pick'](_0x3aed26['query'],_0x3d4698['filters']));if(_0x3aed26['query'][_0x4108('0x44')]){_0x2ec2ae['where']=_[_0x4108('0x45')](_0x2ec2ae['where'],{'$or':_['map'](_0x2ec2ae[_0x4108('0x3a')],function(_0x5ae5af){var _0x3ba3ca={};_0x3ba3ca[_0x5ae5af]={'$like':'%'+_0x3aed26[_0x4108('0x38')][_0x4108('0x44')]+'%'};return _0x3ba3ca;})});}_0x2ec2ae=_[_0x4108('0x45')]({},_0x2ec2ae,_0x3aed26[_0x4108('0x4c')]);return _0x3d8b3e[_0x4108('0x60')](_0x2ec2ae);}})[_0x4108('0x28')](function(_0x33b930){if(_0x33b930){_0x5b633f=_0x33b930['length'];if(!_0x3aed26['query'][_0x4108('0x3e')](_0x4108('0x3f'))){_0x2ec2ae[_0x4108('0x20')]=qs[_0x4108('0x20')](_0x3aed26[_0x4108('0x38')][_0x4108('0x20')]);_0x2ec2ae[_0x4108('0x1e')]=qs[_0x4108('0x1e')](_0x3aed26['query'][_0x4108('0x1e')]);}return _0x3d8b3e[_0x4108('0x60')](_0x2ec2ae);}})[_0x4108('0x28')](function(_0x43748c){if(_0x43748c){return _0x43748c?{'count':_0x5b633f,'rows':_0x43748c}:null;}})[_0x4108('0x28')](respondWithResult(_0x583713,null))[_0x4108('0x49')](handleError(_0x583713,null));};
\ No newline at end of file
index 0210fb3..9d51b98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45ea=['./trigger.attributes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3fc2bc,_0x194286){var _0x10396d=function(_0x21f91e){while(--_0x21f91e){_0x3fc2bc['push'](_0x3fc2bc['shift']());}};_0x10396d(++_0x194286);}(_0x45ea,0x1f0));var _0xa45e=function(_0x6ca6fc,_0x14a8c3){_0x6ca6fc=_0x6ca6fc-0x0;var _0x1c1da3=_0x45ea[_0x6ca6fc];return _0x1c1da3;};'use strict';var _=require(_0xa45e('0x0'));var util=require(_0xa45e('0x1'));var logger=require(_0xa45e('0x2'))(_0xa45e('0x3'));var moment=require(_0xa45e('0x4'));var BPromise=require(_0xa45e('0x5'));var rp=require(_0xa45e('0x6'));var fs=require('fs');var path=require(_0xa45e('0x7'));var rimraf=require(_0xa45e('0x8'));var config=require(_0xa45e('0x9'));var attributes=require(_0xa45e('0xa'));module['exports']=function(_0x418a41,_0x3ee60d){return _0x418a41['define']('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ece=['api','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','lodash','util','../../config/logger'];(function(_0x9e6975,_0x29e110){var _0x31d6d4=function(_0x1ff283){while(--_0x1ff283){_0x9e6975['push'](_0x9e6975['shift']());}};_0x31d6d4(++_0x29e110);}(_0x8ece,0x195));var _0xe8ec=function(_0x3aee5a,_0x525e62){_0x3aee5a=_0x3aee5a-0x0;var _0xa34b72=_0x8ece[_0x3aee5a];return _0xa34b72;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var logger=require(_0xe8ec('0x2'))(_0xe8ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe8ec('0x4'));var fs=require('fs');var path=require(_0xe8ec('0x5'));var rimraf=require(_0xe8ec('0x6'));var config=require(_0xe8ec('0x7'));var attributes=require(_0xe8ec('0x8'));module['exports']=function(_0x346577,_0x23fa35){return _0x346577[_0xe8ec('0x9')](_0xe8ec('0xa'),attributes,{'tableName':_0xe8ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 05d490b..84748f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5062=['client','http','request','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetTrigger','stringify','ShowTrigger','Trigger','find','then','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x314203,_0x400f84){var _0x296da7=function(_0xc560fc){while(--_0xc560fc){_0x314203['push'](_0x314203['shift']());}};_0x296da7(++_0x400f84);}(_0x5062,0xcf));var _0x2506=function(_0x4d3b90,_0x38d793){_0x4d3b90=_0x4d3b90-0x0;var _0x354113=_0x5062[_0x4d3b90];return _0x354113;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2506('0x0'));var BPromise=require(_0x2506('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2506('0x2'));var db=require(_0x2506('0x3'))['db'];var utils=require(_0x2506('0x4'));var logger=require(_0x2506('0x5'))(_0x2506('0x6'));var config=require(_0x2506('0x7'));var jayson=require(_0x2506('0x8'));var client=jayson[_0x2506('0x9')][_0x2506('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32ab07,_0x5f56fc,_0x3f7356){return new BPromise(function(_0x364813,_0x122315){return client[_0x2506('0xb')](_0x32ab07,_0x3f7356)['then'](function(_0x204805){logger[_0x2506('0xc')](_0x2506('0xd'),_0x5f56fc,'request\x20sent');logger[_0x2506('0xe')](_0x2506('0xf'),_0x5f56fc,_0x2506('0x10'),JSON['stringify'](_0x204805));if(_0x204805[_0x2506('0x11')]){if(_0x204805['error']['code']===0x1f4){logger[_0x2506('0x11')](_0x2506('0xd'),_0x5f56fc,_0x204805[_0x2506('0x11')]['message']);return _0x122315(_0x204805[_0x2506('0x11')][_0x2506('0x12')]);}logger[_0x2506('0x11')](_0x2506('0xd'),_0x5f56fc,_0x204805[_0x2506('0x11')][_0x2506('0x12')]);return _0x364813(_0x204805['error'][_0x2506('0x12')]);}else{logger[_0x2506('0xc')](_0x2506('0xd'),_0x5f56fc,_0x2506('0x10'));_0x364813(_0x204805[_0x2506('0x13')][_0x2506('0x12')]);}})[_0x2506('0x14')](function(_0x193bea){logger[_0x2506('0x11')]('Trigger,\x20%s,\x20%s',_0x5f56fc,_0x193bea);_0x122315(_0x193bea);});});}exports['GetTrigger']=function(_0x4462d5){var _0x4fb3c4=this;return new Promise(function(_0x3455a9,_0x3faba1){return db['Trigger'][_0x2506('0x15')]({'raw':_0x4462d5[_0x2506('0x16')]?_0x4462d5[_0x2506('0x16')][_0x2506('0x17')]===undefined?!![]:![]:!![],'where':_0x4462d5[_0x2506('0x16')]?_0x4462d5[_0x2506('0x16')][_0x2506('0x18')]||null:null,'attributes':_0x4462d5['options']?_0x4462d5[_0x2506('0x16')][_0x2506('0x19')]||null:null,'limit':_0x4462d5[_0x2506('0x16')]?_0x4462d5[_0x2506('0x16')][_0x2506('0x1a')]||null:null,'include':_0x4462d5['options']?_0x4462d5[_0x2506('0x16')][_0x2506('0x1b')]?_[_0x2506('0x1c')](_0x4462d5[_0x2506('0x16')][_0x2506('0x1b')],function(_0x1e8f96){return{'model':db[_0x1e8f96[_0x2506('0x1d')]],'as':_0x1e8f96['as'],'attributes':_0x1e8f96[_0x2506('0x19')],'include':_0x1e8f96[_0x2506('0x1b')]?_[_0x2506('0x1c')](_0x1e8f96['include'],function(_0x1a42ae){return{'model':db[_0x1a42ae[_0x2506('0x1d')]],'as':_0x1a42ae['as'],'attributes':_0x1a42ae['attributes'],'include':_0x1a42ae[_0x2506('0x1b')]?_[_0x2506('0x1c')](_0x1a42ae[_0x2506('0x1b')],function(_0x37a644){return{'model':db[_0x37a644['model']],'as':_0x37a644['as'],'attributes':_0x37a644['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33ec49){logger[_0x2506('0xc')]('GetTrigger',_0x4462d5);logger[_0x2506('0xe')](_0x2506('0x1e'),_0x4462d5,JSON[_0x2506('0x1f')](_0x33ec49));_0x3455a9(_0x33ec49);})[_0x2506('0x14')](function(_0x2b70f3){logger[_0x2506('0x11')](_0x2506('0x1e'),_0x2b70f3[_0x2506('0x12')],_0x4462d5);_0x3faba1(_0x4fb3c4['error'](0x1f4,_0x2b70f3[_0x2506('0x12')]));});});};exports[_0x2506('0x20')]=function(_0x4f1333){var _0x3f3297=this;return new Promise(function(_0x253554,_0x3514c6){return db[_0x2506('0x21')][_0x2506('0x22')]({'raw':_0x4f1333[_0x2506('0x16')]?_0x4f1333[_0x2506('0x16')][_0x2506('0x17')]===undefined?!![]:![]:!![],'where':_0x4f1333[_0x2506('0x16')]?_0x4f1333[_0x2506('0x16')][_0x2506('0x18')]||null:null,'attributes':_0x4f1333[_0x2506('0x16')]?_0x4f1333[_0x2506('0x16')]['attributes']||null:null,'include':_0x4f1333[_0x2506('0x16')]?_0x4f1333['options']['include']?_[_0x2506('0x1c')](_0x4f1333[_0x2506('0x16')][_0x2506('0x1b')],function(_0x49ef78){return{'model':db[_0x49ef78[_0x2506('0x1d')]],'as':_0x49ef78['as'],'attributes':_0x49ef78[_0x2506('0x19')],'include':_0x49ef78[_0x2506('0x1b')]?_[_0x2506('0x1c')](_0x49ef78[_0x2506('0x1b')],function(_0x5cc68e){return{'model':db[_0x5cc68e['model']],'as':_0x5cc68e['as'],'attributes':_0x5cc68e['attributes'],'include':_0x5cc68e['include']?_[_0x2506('0x1c')](_0x5cc68e[_0x2506('0x1b')],function(_0x5d6381){return{'model':db[_0x5d6381[_0x2506('0x1d')]],'as':_0x5d6381['as'],'attributes':_0x5d6381[_0x2506('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2506('0x23')](function(_0x275bbb){logger[_0x2506('0xc')]('ShowTrigger',_0x4f1333);logger[_0x2506('0xe')](_0x2506('0x20'),_0x4f1333,JSON[_0x2506('0x1f')](_0x275bbb));_0x253554(_0x275bbb);})[_0x2506('0x14')](function(_0x4a7f7a){logger[_0x2506('0x11')]('ShowTrigger',_0x4a7f7a[_0x2506('0x12')],_0x4f1333);_0x3514c6(_0x3f3297['error'](0x1f4,_0x4a7f7a[_0x2506('0x12')]));});});};
\ No newline at end of file
+var _0x5eea=['catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','ShowTrigger','find','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x5544b5,_0x3626c9){var _0x33a707=function(_0x176cff){while(--_0x176cff){_0x5544b5['push'](_0x5544b5['shift']());}};_0x33a707(++_0x3626c9);}(_0x5eea,0x77));var _0xa5ee=function(_0x20e260,_0x53d3a1){_0x20e260=_0x20e260-0x0;var _0x225141=_0x5eea[_0x20e260];return _0x225141;};'use strict';var _=require(_0xa5ee('0x0'));var util=require('util');var moment=require(_0xa5ee('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5ee('0x2'));var fs=require('fs');var Redis=require(_0xa5ee('0x3'));var db=require(_0xa5ee('0x4'))['db'];var utils=require(_0xa5ee('0x5'));var logger=require(_0xa5ee('0x6'))(_0xa5ee('0x7'));var config=require(_0xa5ee('0x8'));var jayson=require(_0xa5ee('0x9'));var client=jayson[_0xa5ee('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23f8ef,_0x447c08,_0x281597){return new BPromise(function(_0x5a4000,_0x3974bd){return client[_0xa5ee('0xb')](_0x23f8ef,_0x281597)['then'](function(_0x1cd634){logger[_0xa5ee('0xc')](_0xa5ee('0xd'),_0x447c08,_0xa5ee('0xe'));logger[_0xa5ee('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x447c08,_0xa5ee('0xe'),JSON[_0xa5ee('0x10')](_0x1cd634));if(_0x1cd634[_0xa5ee('0x11')]){if(_0x1cd634['error'][_0xa5ee('0x12')]===0x1f4){logger[_0xa5ee('0x11')](_0xa5ee('0xd'),_0x447c08,_0x1cd634['error'][_0xa5ee('0x13')]);return _0x3974bd(_0x1cd634['error']['message']);}logger[_0xa5ee('0x11')](_0xa5ee('0xd'),_0x447c08,_0x1cd634[_0xa5ee('0x11')][_0xa5ee('0x13')]);return _0x5a4000(_0x1cd634[_0xa5ee('0x11')][_0xa5ee('0x13')]);}else{logger[_0xa5ee('0xc')](_0xa5ee('0xd'),_0x447c08,_0xa5ee('0xe'));_0x5a4000(_0x1cd634[_0xa5ee('0x14')][_0xa5ee('0x13')]);}})[_0xa5ee('0x15')](function(_0x51dce1){logger['error'](_0xa5ee('0xd'),_0x447c08,_0x51dce1);_0x3974bd(_0x51dce1);});});}exports[_0xa5ee('0x16')]=function(_0x59524b){var _0x163288=this;return new Promise(function(_0xd6dd4f,_0x19c2d4){return db[_0xa5ee('0x17')][_0xa5ee('0x18')]({'raw':_0x59524b[_0xa5ee('0x19')]?_0x59524b[_0xa5ee('0x19')][_0xa5ee('0x1a')]===undefined?!![]:![]:!![],'where':_0x59524b[_0xa5ee('0x19')]?_0x59524b[_0xa5ee('0x19')]['where']||null:null,'attributes':_0x59524b[_0xa5ee('0x19')]?_0x59524b['options'][_0xa5ee('0x1b')]||null:null,'limit':_0x59524b[_0xa5ee('0x19')]?_0x59524b[_0xa5ee('0x19')][_0xa5ee('0x1c')]||null:null,'include':_0x59524b[_0xa5ee('0x19')]?_0x59524b[_0xa5ee('0x19')][_0xa5ee('0x1d')]?_[_0xa5ee('0x1e')](_0x59524b[_0xa5ee('0x19')]['include'],function(_0x589acc){return{'model':db[_0x589acc[_0xa5ee('0x1f')]],'as':_0x589acc['as'],'attributes':_0x589acc[_0xa5ee('0x1b')],'include':_0x589acc[_0xa5ee('0x1d')]?_['map'](_0x589acc[_0xa5ee('0x1d')],function(_0x3cc9fa){return{'model':db[_0x3cc9fa[_0xa5ee('0x1f')]],'as':_0x3cc9fa['as'],'attributes':_0x3cc9fa[_0xa5ee('0x1b')],'include':_0x3cc9fa[_0xa5ee('0x1d')]?_[_0xa5ee('0x1e')](_0x3cc9fa[_0xa5ee('0x1d')],function(_0x5d2513){return{'model':db[_0x5d2513[_0xa5ee('0x1f')]],'as':_0x5d2513['as'],'attributes':_0x5d2513[_0xa5ee('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd65485){logger['info']('GetTrigger',_0x59524b);logger['debug']('GetTrigger',_0x59524b,JSON[_0xa5ee('0x10')](_0xd65485));_0xd6dd4f(_0xd65485);})[_0xa5ee('0x15')](function(_0x54917d){logger['error'](_0xa5ee('0x16'),_0x54917d[_0xa5ee('0x13')],_0x59524b);_0x19c2d4(_0x163288[_0xa5ee('0x11')](0x1f4,_0x54917d[_0xa5ee('0x13')]));});});};exports[_0xa5ee('0x20')]=function(_0x39ee98){var _0x51eb58=this;return new Promise(function(_0x202319,_0xf44edc){return db[_0xa5ee('0x17')][_0xa5ee('0x21')]({'raw':_0x39ee98['options']?_0x39ee98[_0xa5ee('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x39ee98[_0xa5ee('0x19')]?_0x39ee98[_0xa5ee('0x19')]['where']||null:null,'attributes':_0x39ee98[_0xa5ee('0x19')]?_0x39ee98[_0xa5ee('0x19')][_0xa5ee('0x1b')]||null:null,'include':_0x39ee98[_0xa5ee('0x19')]?_0x39ee98[_0xa5ee('0x19')][_0xa5ee('0x1d')]?_['map'](_0x39ee98[_0xa5ee('0x19')]['include'],function(_0x5bbc94){return{'model':db[_0x5bbc94['model']],'as':_0x5bbc94['as'],'attributes':_0x5bbc94[_0xa5ee('0x1b')],'include':_0x5bbc94[_0xa5ee('0x1d')]?_[_0xa5ee('0x1e')](_0x5bbc94[_0xa5ee('0x1d')],function(_0x12861a){return{'model':db[_0x12861a['model']],'as':_0x12861a['as'],'attributes':_0x12861a[_0xa5ee('0x1b')],'include':_0x12861a[_0xa5ee('0x1d')]?_[_0xa5ee('0x1e')](_0x12861a[_0xa5ee('0x1d')],function(_0x146458){return{'model':db[_0x146458[_0xa5ee('0x1f')]],'as':_0x146458['as'],'attributes':_0x146458[_0xa5ee('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa5ee('0x22')](function(_0x3e7351){logger[_0xa5ee('0xc')](_0xa5ee('0x20'),_0x39ee98);logger[_0xa5ee('0xf')]('ShowTrigger',_0x39ee98,JSON[_0xa5ee('0x10')](_0x3e7351));_0x202319(_0x3e7351);})[_0xa5ee('0x15')](function(_0x142652){logger['error'](_0xa5ee('0x20'),_0x142652[_0xa5ee('0x13')],_0x39ee98);_0xf44edc(_0x51eb58['error'](0x1f4,_0x142652[_0xa5ee('0x13')]));});});};
\ No newline at end of file
index 527055e..aac9799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabc6=['put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','/:id/clone'];(function(_0x43f4b8,_0x537ee2){var _0x39ecb9=function(_0x59e4d1){while(--_0x59e4d1){_0x43f4b8['push'](_0x43f4b8['shift']());}};_0x39ecb9(++_0x537ee2);}(_0xabc6,0x1c7));var _0x6abc=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xabc6[_0x3740fe];return _0x55492b;};'use strict';var multer=require(_0x6abc('0x0'));var util=require('util');var path=require(_0x6abc('0x1'));var timeout=require('connect-timeout');var express=require(_0x6abc('0x2'));var router=express[_0x6abc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6abc('0x4'));var interaction=require(_0x6abc('0x5'));var config=require(_0x6abc('0x6'));var controller=require('./trunk.controller');router[_0x6abc('0x7')]('/',auth['isAuthenticated'](),controller[_0x6abc('0x8')]);router[_0x6abc('0x7')]('/:id',auth[_0x6abc('0x9')](),controller[_0x6abc('0xa')]);router[_0x6abc('0xb')](_0x6abc('0xc'),auth['isAuthenticated'](),controller['clone']);router[_0x6abc('0xb')]('/',auth[_0x6abc('0x9')](),controller['create']);router[_0x6abc('0xd')]('/:id',auth[_0x6abc('0x9')](),controller[_0x6abc('0xe')]);router[_0x6abc('0xf')]('/:id',auth[_0x6abc('0x9')](),controller[_0x6abc('0x10')]);module[_0x6abc('0x11')]=router;
\ No newline at end of file
+var _0x2c6a=['fs-extra','../../components/auth/service','./trunk.controller','get','isAuthenticated','/:id','post','/:id/clone','clone','create','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2c6a,0xa6));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa2c6('0x0'));var util=require(_0xa2c6('0x1'));var path=require(_0xa2c6('0x2'));var timeout=require('connect-timeout');var express=require(_0xa2c6('0x3'));var router=express[_0xa2c6('0x4')]();var fs_extra=require(_0xa2c6('0x5'));var auth=require(_0xa2c6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa2c6('0x7'));router[_0xa2c6('0x8')]('/',auth[_0xa2c6('0x9')](),controller['index']);router[_0xa2c6('0x8')](_0xa2c6('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa2c6('0xb')](_0xa2c6('0xc'),auth['isAuthenticated'](),controller[_0xa2c6('0xd')]);router['post']('/',auth[_0xa2c6('0x9')](),controller[_0xa2c6('0xe')]);router[_0xa2c6('0xf')](_0xa2c6('0xa'),auth[_0xa2c6('0x9')](),controller[_0xa2c6('0x10')]);router['delete'](_0xa2c6('0xa'),auth['isAuthenticated'](),controller[_0xa2c6('0x11')]);module[_0xa2c6('0x12')]=router;
\ No newline at end of file
index 87d8aff..7c2284c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5393=['update,nonat','BOOLEAN','sequelize','exports','name','friend','user','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','STRING','udp','setDataValue','transport','join','getDataValue','split','rfc2833','info','inband','nonat','outgoing','yes','force_rport,comedia','nat','all','allow','ulaw;alaw;gsm','port,invite','insecure','never','INTEGER','always','refuse','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','update'];(function(_0x4a499a,_0x3f6a6b){var _0xe410d4=function(_0x1820a3){while(--_0x1820a3){_0x4a499a['push'](_0x4a499a['shift']());}};_0xe410d4(++_0x3f6a6b);}(_0x5393,0xed));var _0x3539=function(_0x2abe3b,_0xd22602){_0x2abe3b=_0x2abe3b-0x0;var _0x2fef46=_0x5393[_0x2abe3b];return _0x2fef46;};'use strict';var Sequelize=require(_0x3539('0x0'));module[_0x3539('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3539('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x3539('0x3'),_0x3539('0x4'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3539('0x5')},'callingpres':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x7'),_0x3539('0x8'),_0x3539('0x9'),'ALLOWED',_0x3539('0xa'),_0x3539('0xb'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0x3539('0xc')]},'permit':{'type':Sequelize[_0x3539('0xc')]},'secret':{'type':Sequelize[_0x3539('0xc')]},'md5secret':{'type':Sequelize[_0x3539('0xc')]},'remotesecret':{'type':Sequelize[_0x3539('0xc')]},'transport':{'type':Sequelize[_0x3539('0xc')],'defaultValue':_0x3539('0xd'),'set':function(_0x417790){this[_0x3539('0xe')](_0x3539('0xf'),_0x417790?_0x417790[_0x3539('0x10')](','):null);},'get':function(){return this[_0x3539('0x11')](_0x3539('0xf'))?this[_0x3539('0x11')](_0x3539('0xf'))[_0x3539('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x3539('0x13'),_0x3539('0x14'),'shortinfo',_0x3539('0x15'),'auto'),'defaultValue':_0x3539('0x13')},'directmedia':{'type':Sequelize[_0x3539('0x6')]('yes','no',_0x3539('0x16'),'update',_0x3539('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3539('0xc')]},'directmediadeny':{'type':Sequelize[_0x3539('0xc')]},'nat':{'type':Sequelize[_0x3539('0xc')],'defaultValue':_0x3539('0x19'),'set':function(_0x1a7ec5){this[_0x3539('0xe')](_0x3539('0x1a'),_0x1a7ec5?_0x1a7ec5[_0x3539('0x10')](','):null);},'get':function(){return this[_0x3539('0x11')]('nat')?this[_0x3539('0x11')](_0x3539('0x1a'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x3539('0xc')]},'namedcallgroup':{'type':Sequelize[_0x3539('0xc')]},'pickupgroup':{'type':Sequelize[_0x3539('0xc')]},'namedpickupgroup':{'type':Sequelize[_0x3539('0xc')]},'language':{'type':Sequelize[_0x3539('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x3539('0x1b')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5218ea){this[_0x3539('0xe')](_0x3539('0x1c'),_0x5218ea?_0x5218ea['join'](';'):_0x3539('0x1d'));},'get':function(){return this[_0x3539('0x11')](_0x3539('0x1c'))?this['getDataValue']('allow')[_0x3539('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x3539('0x6')]('yes','no')},'insecure':{'type':Sequelize[_0x3539('0xc')],'defaultValue':_0x3539('0x1e'),'set':function(_0xe4a5a8){this[_0x3539('0xe')](_0x3539('0x1f'),_0xe4a5a8?_0xe4a5a8[_0x3539('0x10')](','):null);},'get':function(){return this[_0x3539('0x11')](_0x3539('0x1f'))?this[_0x3539('0x11')](_0x3539('0x1f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x3539('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3539('0x6')]('yes','no',_0x3539('0x20'))},'promiscredir':{'type':Sequelize['ENUM'](_0x3539('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM']('yes','no')},'accountcode':{'type':Sequelize[_0x3539('0x21')](0xb)},'setvar':{'type':Sequelize[_0x3539('0xc')]},'callerid':{'type':Sequelize[_0x3539('0xc')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no'),'defaultValue':_0x3539('0x18')},'busylevel':{'type':Sequelize[_0x3539('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3539('0x6')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x3539('0xc')]},'template':{'type':Sequelize[_0x3539('0xc')]},'videosupport':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no',_0x3539('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3539('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x3539('0x6')]('accept',_0x3539('0x23'),'originate')},'session_expires':{'type':Sequelize[_0x3539('0x21')](0xb)},'session_minse':{'type':Sequelize[_0x3539('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x24'),_0x3539('0x25')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x3539('0xc')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x3539('0xc')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x3539('0x21')](0xb)},'defaultip':{'type':Sequelize[_0x3539('0xc')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x3539('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no',_0x3539('0x26')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3539('0xc')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x3539('0x21')](0xb)},'timerb':{'type':Sequelize[_0x3539('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3539('0x21')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x3539('0xc')]},'unsolicited_mailbox':{'type':Sequelize[_0x3539('0xc')]},'use_q850_reason':{'type':Sequelize[_0x3539('0xc')]},'maxforwards':{'type':Sequelize[_0x3539('0x21')](0xb)},'encryption':{'type':Sequelize[_0x3539('0x6')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize['ENUM'](_0x3539('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no',_0x3539('0x27'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x3539('0xc')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x3539('0xc')]},'dtlscafile':{'type':Sequelize[_0x3539('0xc')]},'dtlscapath':{'type':Sequelize[_0x3539('0xc')]},'dtlssetup':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x28'),_0x3539('0x29'),_0x3539('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x3539('0x6')](_0x3539('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3539('0xc')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x3539('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3539('0x6')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x3539('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x3539('0xc')]},'mohsuggest':{'type':Sequelize[_0x3539('0xc')]},'parkinglot':{'type':Sequelize[_0x3539('0xc')]},'description':{'type':Sequelize[_0x3539('0xc')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x3539('0x2b')},'canreinvite':{'type':Sequelize['ENUM'](_0x3539('0x18'),'no',_0x3539('0x16'),_0x3539('0x2c'),_0x3539('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3539('0xc')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3539('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3539('0xc')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xce17=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','certificate','active','actpass','update,nonat','sequelize','STRING','name','ENUM','user','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','setDataValue','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite'];(function(_0x1a72de,_0x427b56){var _0x34f762=function(_0x1bbf21){while(--_0x1bbf21){_0x1a72de['push'](_0x1a72de['shift']());}};_0x34f762(++_0x427b56);}(_0xce17,0x14e));var _0x7ce1=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0xce17[_0x4e8286];return _0x44a440;};'use strict';var Sequelize=require(_0x7ce1('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ce1('0x1')],'allowNull':![],'unique':_0x7ce1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7ce1('0x3')]('friend',_0x7ce1('0x4'),'peer'),'allowNull':![],'defaultValue':_0x7ce1('0x5')},'context':{'type':Sequelize[_0x7ce1('0x1')],'allowNull':![],'defaultValue':_0x7ce1('0x6')},'callingpres':{'type':Sequelize[_0x7ce1('0x3')]('ALLOWED_NOT_SCREENED',_0x7ce1('0x7'),_0x7ce1('0x8'),'ALLOWED',_0x7ce1('0x9'),_0x7ce1('0xa'),_0x7ce1('0xb'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x7ce1('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x7ce1('0x1')],'defaultValue':_0x7ce1('0xc'),'set':function(_0x4826f7){this['setDataValue']('transport',_0x4826f7?_0x4826f7[_0x7ce1('0xd')](','):null);},'get':function(){return this[_0x7ce1('0xe')](_0x7ce1('0xf'))?this[_0x7ce1('0xe')](_0x7ce1('0xf'))[_0x7ce1('0x10')](','):null;},'comment':_0x7ce1('0x11')},'dtmfmode':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x12'),'info','shortinfo',_0x7ce1('0x13'),_0x7ce1('0x14')),'defaultValue':_0x7ce1('0x12')},'directmedia':{'type':Sequelize[_0x7ce1('0x3')]('yes','no',_0x7ce1('0x15'),_0x7ce1('0x16'),_0x7ce1('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7ce1('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x7ce1('0x1')],'defaultValue':_0x7ce1('0x19'),'set':function(_0x5311ce){this['setDataValue'](_0x7ce1('0x1a'),_0x5311ce?_0x5311ce[_0x7ce1('0xd')](','):null);},'get':function(){return this[_0x7ce1('0xe')](_0x7ce1('0x1a'))?this[_0x7ce1('0xe')](_0x7ce1('0x1a'))[_0x7ce1('0x10')](','):null;},'comment':_0x7ce1('0x1b')},'callgroup':{'type':Sequelize[_0x7ce1('0x1')]},'namedcallgroup':{'type':Sequelize[_0x7ce1('0x1')]},'pickupgroup':{'type':Sequelize[_0x7ce1('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x7ce1('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7ce1('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7ce1('0x1')],'defaultValue':_0x7ce1('0x1c')},'allow':{'type':Sequelize[_0x7ce1('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5ac06b){this[_0x7ce1('0x1d')]('allow',_0x5ac06b?_0x5ac06b[_0x7ce1('0xd')](';'):_0x7ce1('0x1e'));},'get':function(){return this['getDataValue'](_0x7ce1('0x1f'))?this[_0x7ce1('0xe')](_0x7ce1('0x1f'))[_0x7ce1('0x10')](';'):null;},'comment':_0x7ce1('0x20')},'autoframing':{'type':Sequelize['ENUM'](_0x7ce1('0x18'),'no')},'insecure':{'type':Sequelize[_0x7ce1('0x1')],'defaultValue':_0x7ce1('0x21'),'set':function(_0x1b1697){this[_0x7ce1('0x1d')]('insecure',_0x1b1697?_0x1b1697[_0x7ce1('0xd')](','):null);},'get':function(){return this[_0x7ce1('0xe')]('insecure')?this[_0x7ce1('0xe')]('insecure')[_0x7ce1('0x10')](','):null;},'comment':_0x7ce1('0x22')},'trustrpid':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no','never')},'promiscredir':{'type':Sequelize[_0x7ce1('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no')},'accountcode':{'type':Sequelize[_0x7ce1('0x23')](0xb)},'setvar':{'type':Sequelize[_0x7ce1('0x1')]},'callerid':{'type':Sequelize[_0x7ce1('0x1')],'defaultValue':_0x7ce1('0x24')},'amaflags':{'type':Sequelize[_0x7ce1('0x1')]},'callcounter':{'type':Sequelize[_0x7ce1('0x3')]('yes','no'),'defaultValue':_0x7ce1('0x18')},'busylevel':{'type':Sequelize[_0x7ce1('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x7ce1('0x18'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x7ce1('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7ce1('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x7ce1('0x1')]},'template':{'type':Sequelize[_0x7ce1('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0x7ce1('0x18'),'no',_0x7ce1('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7ce1('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no')},'mailbox':{'type':Sequelize[_0x7ce1('0x1')]},'session_timers':{'type':Sequelize[_0x7ce1('0x3')]('accept',_0x7ce1('0x26'),_0x7ce1('0x27'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x7ce1('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x7ce1('0x28'),_0x7ce1('0x29')),'defaultValue':_0x7ce1('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x7ce1('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7ce1('0x23')](0x5)},'qualify':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no'),'defaultValue':_0x7ce1('0x18')},'keepalive':{'type':Sequelize[_0x7ce1('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x7ce1('0x1')]},'defaultuser':{'type':Sequelize[_0x7ce1('0x1')]},'rtptimeout':{'type':Sequelize[_0x7ce1('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x7ce1('0x23')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7ce1('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x7ce1('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x7ce1('0x23')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x7ce1('0x1')]},'contactacl':{'type':Sequelize[_0x7ce1('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x7ce1('0x23')](0xb)},'encryption':{'type':Sequelize[_0x7ce1('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x7ce1('0x3')]('yes','no','fingerprint',_0x7ce1('0x2a'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x7ce1('0x1')]},'dtlscipher':{'type':Sequelize[_0x7ce1('0x1')]},'dtlscafile':{'type':Sequelize[_0x7ce1('0x1')]},'dtlscapath':{'type':Sequelize[_0x7ce1('0x1')]},'dtlssetup':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x2b'),'passive',_0x7ce1('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7ce1('0x1')]},'usereqphone':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x7ce1('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x7ce1('0x3')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x7ce1('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7ce1('0x1')]},'host':{'type':Sequelize[_0x7ce1('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x7ce1('0x3')](_0x7ce1('0x18'),'no','nonat','update',_0x7ce1('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7ce1('0x1')],'defaultValue':'no'}};
\ No newline at end of file
index e1ff9e9..fcdc70d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x1fa3e2,_0x58020c){var _0x1261fc=function(_0x439e3b){while(--_0x439e3b){_0x1fa3e2['push'](_0x1fa3e2['shift']());}};_0x1261fc(++_0x58020c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x11c007,_0x330d4b){_0x11c007=_0x11c007-0x0;var _0x26a3d0=_0x8d0e[_0x11c007];return _0x26a3d0;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));};
\ No newline at end of file
+var _0x3e74=['map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','merge','options','includeAll','include','findAll','params','clone','find','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','stack','name','send','index'];(function(_0x4adc21,_0x6506fd){var _0x478dc8=function(_0x45b1be){while(--_0x45b1be){_0x4adc21['push'](_0x4adc21['shift']());}};_0x478dc8(++_0x6506fd);}(_0x3e74,0x175));var _0x43e7=function(_0x318a6f,_0x5b484b){_0x318a6f=_0x318a6f-0x0;var _0x2b44d4=_0x3e74[_0x318a6f];return _0x2b44d4;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];var jayson=require(_0x43e7('0x15'));var client=jayson[_0x43e7('0x16')][_0x43e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e008c,_0x583d85,_0x2fcb36,_0x21fdd3){return new BPromise(function(_0x44b0bd,_0x51b974){var _0x5e641c=_0x21fdd3||client;return _0x5e641c[_0x43e7('0x18')](_0x4e008c,_0x2fcb36)[_0x43e7('0x19')](function(_0x203378){logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,'request\x20sent');logger[_0x43e7('0x1b')](_0x43e7('0x1c'),_0x583d85,_0x43e7('0x1d'),JSON['stringify'](_0x203378));if(_0x203378['error']){if(_0x203378[_0x43e7('0x1e')][_0x43e7('0x1f')]===0x1f4){logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x51b974(_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);}logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x44b0bd(_0x203378['error'][_0x43e7('0x21')]);}else{logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x43e7('0x1d'));_0x44b0bd(_0x203378[_0x43e7('0x22')][_0x43e7('0x21')]);}})[_0x43e7('0x23')](function(_0x4077fb){logger[_0x43e7('0x1e')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x4077fb);_0x51b974(_0x4077fb);});});}function respondWithStatusCode(_0x454359,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x4c9df3){if(_0x4c9df3){return _0x454359[_0x43e7('0x24')](_0x4eea52);}return _0x454359[_0x43e7('0x25')](_0x4eea52)['end']();};}function respondWithResult(_0x1f0673,_0x4ca5cf){_0x4ca5cf=_0x4ca5cf||0xc8;return function(_0x326dab){if(_0x326dab){return _0x1f0673['status'](_0x4ca5cf)[_0x43e7('0x26')](_0x326dab);}};}function respondWithFilteredResult(_0x1b5f50,_0x20888b){return function(_0x405f85){if(_0x405f85){var _0x51f4d7=typeof _0x20888b['offset']===_0x43e7('0x27')&&typeof _0x20888b['limit']===_0x43e7('0x27');var _0x40dc8f=_0x405f85[_0x43e7('0x28')];var _0xb1fc63=_0x51f4d7?0x0:_0x20888b['offset'];var _0x33a1a5=_0x51f4d7?_0x405f85[_0x43e7('0x28')]:_0x20888b[_0x43e7('0x29')]+_0x20888b[_0x43e7('0x2a')];var _0x442c3b;if(_0x33a1a5>=_0x40dc8f){_0x33a1a5=_0x40dc8f;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0x1b5f50[_0x43e7('0x25')](_0x442c3b);return _0x1b5f50[_0x43e7('0x2b')](_0x43e7('0x2c'),_0xb1fc63+'-'+_0x33a1a5+'/'+_0x40dc8f)[_0x43e7('0x26')](_0x405f85);}return null;};}function patchUpdates(_0x35dbcd){return function(_0x17df44){try{jsonpatch[_0x43e7('0x2d')](_0x17df44,_0x35dbcd,!![]);}catch(_0x2bde44){return BPromise[_0x43e7('0x2e')](_0x2bde44);}return _0x17df44['save']();};}function saveUpdates(_0x238321,_0x44f6b0){return function(_0x3b8f78){if(_0x3b8f78){return _0x3b8f78[_0x43e7('0x2f')](_0x238321)[_0x43e7('0x19')](function(_0x4c8650){return _0x4c8650;});}return null;};}function removeEntity(_0x1eba65,_0x49b83d){return function(_0x30d47e){if(_0x30d47e){return _0x30d47e[_0x43e7('0x30')]()['then'](function(){var _0x5a7342=_0x30d47e['get']({'plain':!![]});var _0xf8320=_0x43e7('0x31');return db[_0x43e7('0x32')][_0x43e7('0x30')]({'where':{'type':_0xf8320,'resourceId':_0x5a7342['id']}})[_0x43e7('0x19')](function(){return _0x30d47e;});})[_0x43e7('0x19')](function(){_0x1eba65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac23d,_0x59e5b2){return function(_0x4e8e86){if(!_0x4e8e86){_0x4ac23d['sendStatus'](0x194);}return _0x4e8e86;};}function handleError(_0x5cb753,_0x14d888){_0x14d888=_0x14d888||0x1f4;return function(_0x49cda6){logger[_0x43e7('0x1e')](_0x49cda6[_0x43e7('0x33')]);if(_0x49cda6[_0x43e7('0x34')]){delete _0x49cda6[_0x43e7('0x34')];}_0x5cb753[_0x43e7('0x25')](_0x14d888)[_0x43e7('0x35')](_0x49cda6);};}exports[_0x43e7('0x36')]=function(_0x4f1a5f,_0x5332d9){var _0x5d84f4={},_0xfa0474={},_0xfe70e9={'count':0x0,'rows':[]};var _0x199ff6=_[_0x43e7('0x37')](db[_0x43e7('0x38')][_0x43e7('0x39')],function(_0x1d4589){return{'name':_0x1d4589[_0x43e7('0x3a')],'type':_0x1d4589['type'][_0x43e7('0x3b')]};});_0xfa0474[_0x43e7('0x3c')]=_['map'](_0x199ff6,_0x43e7('0x34'));_0xfa0474['query']=_[_0x43e7('0x3d')](_0x4f1a5f[_0x43e7('0x3e')]);_0xfa0474[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfa0474[_0x43e7('0x3c')],_0xfa0474[_0x43e7('0x3e')]);_0x5d84f4['attributes']=_['intersection'](_0xfa0474[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x41')]));_0x5d84f4[_0x43e7('0x42')]=_0x5d84f4['attributes'][_0x43e7('0x43')]?_0x5d84f4[_0x43e7('0x42')]:_0xfa0474['model'];if(!_0x4f1a5f[_0x43e7('0x3e')]['hasOwnProperty'](_0x43e7('0x44'))){_0x5d84f4['limit']=qs[_0x43e7('0x2a')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x2a')]);_0x5d84f4[_0x43e7('0x29')]=qs['offset'](_0x4f1a5f['query'][_0x43e7('0x29')]);}_0x5d84f4[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x4f1a5f[_0x43e7('0x3e')]['sort']);_0x5d84f4['where']=qs['filters'](_[_0x43e7('0x47')](_0x4f1a5f['query'],_0xfa0474[_0x43e7('0x3f')]),_0x199ff6);if(_0x4f1a5f['query']['filter']){_0x5d84f4[_0x43e7('0x48')]=_['merge'](_0x5d84f4[_0x43e7('0x48')],{'$or':_[_0x43e7('0x37')](_0x199ff6,function(_0x257bd8){if(_0x257bd8[_0x43e7('0x49')]!=='VIRTUAL'){var _0x91f1e4={};_0x91f1e4[_0x257bd8[_0x43e7('0x34')]]={'$like':'%'+_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x4a')]+'%'};return _0x91f1e4;}})});}_0x5d84f4=_[_0x43e7('0x4b')]({},_0x5d84f4,_0x4f1a5f[_0x43e7('0x4c')]);var _0x51eef4={'where':_0x5d84f4['where']};return db[_0x43e7('0x38')][_0x43e7('0x28')](_0x51eef4)[_0x43e7('0x19')](function(_0x4c00a8){_0xfe70e9['count']=_0x4c00a8;if(_0x4f1a5f['query'][_0x43e7('0x4d')]){_0x5d84f4[_0x43e7('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x43e7('0x4f')](_0x5d84f4);})[_0x43e7('0x19')](function(_0x3c96fe){_0xfe70e9['rows']=_0x3c96fe;return _0xfe70e9;})['then'](respondWithFilteredResult(_0x5332d9,_0x5d84f4))['catch'](handleError(_0x5332d9,null));};exports['show']=function(_0x214e7e,_0xe955fc){var _0x52fea5={'raw':![],'where':{'id':_0x214e7e[_0x43e7('0x50')]['id']}},_0x23e7cb={};_0x23e7cb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0x23e7cb['query']=_['keys'](_0x214e7e[_0x43e7('0x3e')]);_0x23e7cb[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],_0x23e7cb[_0x43e7('0x3e')]);_0x52fea5[_0x43e7('0x42')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x214e7e[_0x43e7('0x3e')]['fields']));_0x52fea5[_0x43e7('0x42')]=_0x52fea5[_0x43e7('0x42')]['length']?_0x52fea5[_0x43e7('0x42')]:_0x23e7cb['model'];if(_0x214e7e[_0x43e7('0x3e')][_0x43e7('0x4d')]){_0x52fea5[_0x43e7('0x4e')]=[{'all':!![]}];}_0x52fea5=_[_0x43e7('0x4b')]({},_0x52fea5,_0x214e7e[_0x43e7('0x4c')]);return db['Trunk']['find'](_0x52fea5)[_0x43e7('0x19')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x19')](respondWithResult(_0xe955fc,null))[_0x43e7('0x23')](handleError(_0xe955fc,null));};exports[_0x43e7('0x51')]=function(_0x23d835,_0x25bb44){var _0xa47464={'where':{'id':_0x23d835[_0x43e7('0x50')]['id']}},_0x44f8a0={};_0x44f8a0[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0xa47464[_0x43e7('0x42')]=_['intersection'](_0x44f8a0[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x23d835[_0x43e7('0x3e')]['fields']));_0xa47464['attributes']=_0xa47464[_0x43e7('0x42')][_0x43e7('0x43')]?_0xa47464['attributes']:_0x44f8a0[_0x43e7('0x3c')];if(_0x23d835['query']['includeAll']){_0xa47464[_0x43e7('0x4e')]=[{'all':!![]}];}_0xa47464=_[_0x43e7('0x4b')]({},_0xa47464,_0x23d835[_0x43e7('0x4c')]);return db[_0x43e7('0x38')][_0x43e7('0x52')](_0xa47464)['then'](handleEntityNotFound(_0x25bb44,null))[_0x43e7('0x19')](function(_0xdb9fbe){if(_0xdb9fbe){var _0x4d89bd=_0xdb9fbe[_0x43e7('0x53')]({'plain':!![]});_0x4d89bd=qs[_0x43e7('0x54')](_0x4d89bd,['id',_0x43e7('0x55'),'updatedAt']);_0x23d835['body']=_['omit'](_0x23d835[_0x43e7('0x56')],['id',_0x43e7('0x55'),_0x43e7('0x57')]);return db[_0x43e7('0x38')]['create'](_['merge'](_0x4d89bd,_0x23d835[_0x43e7('0x56')]),{'include':_0x23d835[_0x43e7('0x3e')][_0x43e7('0x4d')]?[{'all':!![]}]:undefined})[_0x43e7('0x19')](function(_0x5ea0db){var _0x4438c0=_0x23d835[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x4438c0)throw new Error(_0x43e7('0x59'));if(_0x4438c0[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x4665db=_0x5ea0db[_0x43e7('0x53')]({'plain':!![]});var _0x406155=_0x43e7('0x31');return db[_0x43e7('0x5b')]['find']({'where':{'name':_0x406155,'userProfileId':_0x4438c0['userProfileId']},'raw':!![]})[_0x43e7('0x19')](function(_0x58a3a8){if(_0x58a3a8&&_0x58a3a8['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x5c')]({'name':_0x4665db[_0x43e7('0x34')],'resourceId':_0x4665db['id'],'type':_0x58a3a8['name'],'sectionId':_0x58a3a8['id']},{})[_0x43e7('0x19')](function(){return _0x5ea0db;});}else{return _0x5ea0db;}})[_0x43e7('0x23')](function(_0x1d8438){logger['error'](_0x43e7('0x5d'),_0x1d8438);throw _0x1d8438;});}return _0x5ea0db;});}})[_0x43e7('0x19')](respondWithResult(_0x25bb44,0xc9))[_0x43e7('0x23')](handleError(_0x25bb44,null));};exports[_0x43e7('0x5c')]=function(_0x2f43d7,_0x472a19,_0x1e02fa){var _0x515f01;return db[_0x43e7('0x38')][_0x43e7('0x5c')](_0x2f43d7[_0x43e7('0x56')],{'raw':!![]})['then'](function(_0x56b06d){_0x515f01=_0x56b06d;return db[_0x43e7('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x1b793d){var _0x154e47=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x16499c=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x4e5956=ejs[_0x43e7('0x64')](_0x154e47,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x65'),_0x4e5956);if(_0x515f01[_0x43e7('0x66')]){var _0x37301b=ejs[_0x43e7('0x64')](_0x16499c,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x37301b);}})[_0x43e7('0x19')](function(){return respondWithRpcPromise(_0x43e7('0x68'),'create',{'module':_0x43e7('0x69')});})[_0x43e7('0x19')](function(){var _0x219dc6=_0x2f43d7[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x219dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219dc6[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x35d133=_0x515f01[_0x43e7('0x53')]({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x52')]({'where':{'name':_0x43e7('0x31'),'userProfileId':_0x219dc6['userProfileId']},'raw':!![]})['then'](function(_0x405faa){if(_0x405faa&&_0x405faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x35d133[_0x43e7('0x34')],'resourceId':_0x35d133['id'],'type':_0x405faa[_0x43e7('0x34')],'sectionId':_0x405faa['id']},{})[_0x43e7('0x19')](function(){return _0x515f01;});}else{return _0x515f01;}})[_0x43e7('0x23')](function(_0x18713b){logger[_0x43e7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18713b);throw _0x18713b;});}return _0x515f01;})[_0x43e7('0x19')](respondWithResult(_0x472a19,0xc9))[_0x43e7('0x23')](handleError(_0x472a19,null));};exports[_0x43e7('0x2f')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){var _0x184ae3;return db[_0x43e7('0x38')][_0x43e7('0x52')]({'where':{'id':_0x5b4c76[_0x43e7('0x50')]['id']}})[_0x43e7('0x19')](handleEntityNotFound(_0x2abca0,null))[_0x43e7('0x19')](saveUpdates(_0x5b4c76['body'],null))['then'](function(_0x55990c){if(_0x55990c){_0x184ae3=_0x55990c;return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});}})['then'](function(_0x3fe23f){if(_0x3fe23f){var _0x39a787=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x177a7a=fs[_0x43e7('0x62')](path['join'](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x3b7e5b=ejs['render'](_0x39a787,{'trunks':_0x3fe23f||[]});fs[_0x43e7('0x6a')](_0x43e7('0x65'),_0x3b7e5b);var _0x401654=ejs[_0x43e7('0x64')](_0x177a7a,{'trunks':_0x3fe23f||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x401654);return respondWithRpcPromise('Reload',_0x43e7('0x2f'),{'module':_0x43e7('0x69')});}return null;})[_0x43e7('0x19')](function(_0x90667c){if(_0x90667c){return _0x184ae3;}})[_0x43e7('0x19')](respondWithResult(_0x2abca0,null))[_0x43e7('0x23')](handleError(_0x2abca0,null));};exports[_0x43e7('0x30')]=function(_0x5e8d4e,_0x109c86,_0x40257e){var _0x1aea4e;return db[_0x43e7('0x38')]['find']({'where':{'id':_0x5e8d4e['params']['id']}})['then'](handleEntityNotFound(_0x109c86,null))[_0x43e7('0x19')](removeEntity(_0x109c86,null))['then'](function(){return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});})[_0x43e7('0x19')](function(_0x7387f6){var _0xa75254=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x3de22e=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x63')),_0x43e7('0x61'));var _0x206e54=ejs['render'](_0xa75254,{'trunks':_0x7387f6});var _0x5e04ec=ejs[_0x43e7('0x64')](_0x3de22e,{'trunks':_0x7387f6});fs[_0x43e7('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x206e54);fs[_0x43e7('0x6a')](_0x43e7('0x67'),_0x5e04ec);return respondWithRpcPromise('Reload','destroy',{'module':_0x43e7('0x69')});})[_0x43e7('0x23')](handleError(_0x109c86,null));};
\ No newline at end of file
index 6519b26..2f12c78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e19=['moment','bluebird','request-promise','path','rimraf','./trunk.attributes','exports','define','Trunk','tools_trunks','util','../../config/logger','api'];(function(_0x1b7e0c,_0x318d81){var _0x20548d=function(_0x480f97){while(--_0x480f97){_0x1b7e0c['push'](_0x1b7e0c['shift']());}};_0x20548d(++_0x318d81);}(_0x0e19,0x1d1));var _0x90e1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0e19[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x90e1('0x0'));var logger=require(_0x90e1('0x1'))(_0x90e1('0x2'));var moment=require(_0x90e1('0x3'));var BPromise=require(_0x90e1('0x4'));var rp=require(_0x90e1('0x5'));var fs=require('fs');var path=require(_0x90e1('0x6'));var rimraf=require(_0x90e1('0x7'));var config=require('../../config/environment');var attributes=require(_0x90e1('0x8'));module[_0x90e1('0x9')]=function(_0x8cbf70,_0x1480b0){return _0x8cbf70[_0x90e1('0xa')](_0x90e1('0xb'),attributes,{'tableName':_0x90e1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f62=['exports','Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x38c3c4,_0x22fa29){var _0x2cf445=function(_0x31a6cd){while(--_0x31a6cd){_0x38c3c4['push'](_0x38c3c4['shift']());}};_0x2cf445(++_0x22fa29);}(_0x3f62,0xe7));var _0x23f6=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3f62[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x23f6('0x0'));var util=require('util');var logger=require(_0x23f6('0x1'))(_0x23f6('0x2'));var moment=require(_0x23f6('0x3'));var BPromise=require(_0x23f6('0x4'));var rp=require(_0x23f6('0x5'));var fs=require('fs');var path=require(_0x23f6('0x6'));var rimraf=require(_0x23f6('0x7'));var config=require(_0x23f6('0x8'));var attributes=require('./trunk.attributes');module[_0x23f6('0x9')]=function(_0x305c2c,_0x3b609c){return _0x305c2c['define'](_0x23f6('0xa'),attributes,{'tableName':_0x23f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0978dbb..54c5889 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x072b=['raw','where','attributes','limit','include','map','model','stringify','catch','ShowTrunk','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','GetTrunk','Trunk','findAll','options'];(function(_0x5b9dc9,_0x34c93f){var _0x43fadf=function(_0xc648){while(--_0xc648){_0x5b9dc9['push'](_0x5b9dc9['shift']());}};_0x43fadf(++_0x34c93f);}(_0x072b,0x1ae));var _0xb072=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x072b[_0x344a3f];return _0x264712;};'use strict';var _=require(_0xb072('0x0'));var util=require(_0xb072('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb072('0x2'));var fs=require('fs');var Redis=require(_0xb072('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb072('0x4'));var logger=require(_0xb072('0x5'))(_0xb072('0x6'));var config=require(_0xb072('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb072('0x8')][_0xb072('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c8805,_0x12319a,_0x36764d){return new BPromise(function(_0x267bc4,_0x32df21){return client[_0xb072('0xa')](_0x5c8805,_0x36764d)[_0xb072('0xb')](function(_0x3f3257){logger[_0xb072('0xc')](_0xb072('0xd'),_0x12319a,_0xb072('0xe'));logger[_0xb072('0xf')](_0xb072('0x10'),_0x12319a,'request\x20sent',JSON['stringify'](_0x3f3257));if(_0x3f3257[_0xb072('0x11')]){if(_0x3f3257[_0xb072('0x11')][_0xb072('0x12')]===0x1f4){logger[_0xb072('0x11')]('Trunk,\x20%s,\x20%s',_0x12319a,_0x3f3257['error']['message']);return _0x32df21(_0x3f3257[_0xb072('0x11')][_0xb072('0x13')]);}logger[_0xb072('0x11')](_0xb072('0xd'),_0x12319a,_0x3f3257[_0xb072('0x11')][_0xb072('0x13')]);return _0x267bc4(_0x3f3257[_0xb072('0x11')][_0xb072('0x13')]);}else{logger['info'](_0xb072('0xd'),_0x12319a,_0xb072('0xe'));_0x267bc4(_0x3f3257[_0xb072('0x14')][_0xb072('0x13')]);}})['catch'](function(_0x1c3cea){logger[_0xb072('0x11')](_0xb072('0xd'),_0x12319a,_0x1c3cea);_0x32df21(_0x1c3cea);});});}exports[_0xb072('0x15')]=function(_0xe2c9bc){var _0x51c309=this;return new Promise(function(_0x321172,_0x221f99){return db[_0xb072('0x16')][_0xb072('0x17')]({'raw':_0xe2c9bc[_0xb072('0x18')]?_0xe2c9bc['options'][_0xb072('0x19')]===undefined?!![]:![]:!![],'where':_0xe2c9bc[_0xb072('0x18')]?_0xe2c9bc[_0xb072('0x18')][_0xb072('0x1a')]||null:null,'attributes':_0xe2c9bc[_0xb072('0x18')]?_0xe2c9bc[_0xb072('0x18')][_0xb072('0x1b')]||null:null,'limit':_0xe2c9bc[_0xb072('0x18')]?_0xe2c9bc[_0xb072('0x18')][_0xb072('0x1c')]||null:null,'include':_0xe2c9bc[_0xb072('0x18')]?_0xe2c9bc['options'][_0xb072('0x1d')]?_[_0xb072('0x1e')](_0xe2c9bc[_0xb072('0x18')]['include'],function(_0x417be7){return{'model':db[_0x417be7[_0xb072('0x1f')]],'as':_0x417be7['as'],'attributes':_0x417be7[_0xb072('0x1b')],'include':_0x417be7[_0xb072('0x1d')]?_['map'](_0x417be7['include'],function(_0x3aef1a){return{'model':db[_0x3aef1a[_0xb072('0x1f')]],'as':_0x3aef1a['as'],'attributes':_0x3aef1a[_0xb072('0x1b')],'include':_0x3aef1a['include']?_[_0xb072('0x1e')](_0x3aef1a[_0xb072('0x1d')],function(_0x568c55){return{'model':db[_0x568c55[_0xb072('0x1f')]],'as':_0x568c55['as'],'attributes':_0x568c55[_0xb072('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb072('0xb')](function(_0x1f6577){logger[_0xb072('0xc')](_0xb072('0x15'),_0xe2c9bc);logger[_0xb072('0xf')](_0xb072('0x15'),_0xe2c9bc,JSON[_0xb072('0x20')](_0x1f6577));_0x321172(_0x1f6577);})[_0xb072('0x21')](function(_0xafa63d){logger['error'](_0xb072('0x15'),_0xafa63d[_0xb072('0x13')],_0xe2c9bc);_0x221f99(_0x51c309[_0xb072('0x11')](0x1f4,_0xafa63d[_0xb072('0x13')]));});});};exports['ShowTrunk']=function(_0x5a5f28){var _0x23abd2=this;return new Promise(function(_0x554924,_0x3c704d){return db[_0xb072('0x16')]['find']({'raw':_0x5a5f28[_0xb072('0x18')]?_0x5a5f28[_0xb072('0x18')][_0xb072('0x19')]===undefined?!![]:![]:!![],'where':_0x5a5f28['options']?_0x5a5f28[_0xb072('0x18')][_0xb072('0x1a')]||null:null,'attributes':_0x5a5f28['options']?_0x5a5f28['options']['attributes']||null:null,'include':_0x5a5f28[_0xb072('0x18')]?_0x5a5f28[_0xb072('0x18')]['include']?_[_0xb072('0x1e')](_0x5a5f28[_0xb072('0x18')]['include'],function(_0xb37bde){return{'model':db[_0xb37bde[_0xb072('0x1f')]],'as':_0xb37bde['as'],'attributes':_0xb37bde[_0xb072('0x1b')],'include':_0xb37bde[_0xb072('0x1d')]?_['map'](_0xb37bde[_0xb072('0x1d')],function(_0x50061b){return{'model':db[_0x50061b[_0xb072('0x1f')]],'as':_0x50061b['as'],'attributes':_0x50061b['attributes'],'include':_0x50061b['include']?_['map'](_0x50061b[_0xb072('0x1d')],function(_0x7e9e10){return{'model':db[_0x7e9e10[_0xb072('0x1f')]],'as':_0x7e9e10['as'],'attributes':_0x7e9e10['attributes']};}):[]};}):[]};}):[]:[]})[_0xb072('0xb')](function(_0x1efdea){logger['info'](_0xb072('0x22'),_0x5a5f28);logger['debug'](_0xb072('0x22'),_0x5a5f28,JSON[_0xb072('0x20')](_0x1efdea));_0x554924(_0x1efdea);})[_0xb072('0x21')](function(_0x4db906){logger[_0xb072('0x11')]('ShowTrunk',_0x4db906[_0xb072('0x13')],_0x5a5f28);_0x3c704d(_0x23abd2['error'](0x1f4,_0x4db906[_0xb072('0x13')]));});});};
\ No newline at end of file
+var _0x4283=['http','request','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Trunk,\x20%s,\x20%s','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','model','map','ShowTrunk','find','then','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x52f764,_0x220437){var _0x40d18b=function(_0x2a0703){while(--_0x2a0703){_0x52f764['push'](_0x52f764['shift']());}};_0x40d18b(++_0x220437);}(_0x4283,0x119));var _0x3428=function(_0x3f7863,_0x4994ef){_0x3f7863=_0x3f7863-0x0;var _0x2212a8=_0x4283[_0x3f7863];return _0x2212a8;};'use strict';var _=require(_0x3428('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3428('0x1'));var rs=require(_0x3428('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3428('0x3'))['db'];var utils=require(_0x3428('0x4'));var logger=require(_0x3428('0x5'))('rpc');var config=require(_0x3428('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3428('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45dd0c,_0x5d1e5e,_0x443d07){return new BPromise(function(_0x28b47d,_0x481239){return client[_0x3428('0x8')](_0x45dd0c,_0x443d07)['then'](function(_0x2b5310){logger[_0x3428('0x9')]('Trunk,\x20%s,\x20%s',_0x5d1e5e,_0x3428('0xa'));logger[_0x3428('0xb')](_0x3428('0xc'),_0x5d1e5e,'request\x20sent',JSON[_0x3428('0xd')](_0x2b5310));if(_0x2b5310['error']){if(_0x2b5310[_0x3428('0xe')][_0x3428('0xf')]===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x5d1e5e,_0x2b5310[_0x3428('0xe')][_0x3428('0x10')]);return _0x481239(_0x2b5310['error'][_0x3428('0x10')]);}logger[_0x3428('0xe')]('Trunk,\x20%s,\x20%s',_0x5d1e5e,_0x2b5310[_0x3428('0xe')][_0x3428('0x10')]);return _0x28b47d(_0x2b5310[_0x3428('0xe')][_0x3428('0x10')]);}else{logger[_0x3428('0x9')]('Trunk,\x20%s,\x20%s',_0x5d1e5e,_0x3428('0xa'));_0x28b47d(_0x2b5310['result']['message']);}})[_0x3428('0x11')](function(_0x1df926){logger['error'](_0x3428('0x12'),_0x5d1e5e,_0x1df926);_0x481239(_0x1df926);});});}exports[_0x3428('0x13')]=function(_0x215bd8){var _0x4b5f74=this;return new Promise(function(_0x2f1538,_0x32758b){return db[_0x3428('0x14')][_0x3428('0x15')]({'raw':_0x215bd8[_0x3428('0x16')]?_0x215bd8[_0x3428('0x16')][_0x3428('0x17')]===undefined?!![]:![]:!![],'where':_0x215bd8[_0x3428('0x16')]?_0x215bd8['options'][_0x3428('0x18')]||null:null,'attributes':_0x215bd8[_0x3428('0x16')]?_0x215bd8[_0x3428('0x16')][_0x3428('0x19')]||null:null,'limit':_0x215bd8[_0x3428('0x16')]?_0x215bd8[_0x3428('0x16')]['limit']||null:null,'include':_0x215bd8[_0x3428('0x16')]?_0x215bd8[_0x3428('0x16')][_0x3428('0x1a')]?_['map'](_0x215bd8[_0x3428('0x16')][_0x3428('0x1a')],function(_0x14addb){return{'model':db[_0x14addb[_0x3428('0x1b')]],'as':_0x14addb['as'],'attributes':_0x14addb[_0x3428('0x19')],'include':_0x14addb[_0x3428('0x1a')]?_[_0x3428('0x1c')](_0x14addb[_0x3428('0x1a')],function(_0xcbbfdf){return{'model':db[_0xcbbfdf[_0x3428('0x1b')]],'as':_0xcbbfdf['as'],'attributes':_0xcbbfdf[_0x3428('0x19')],'include':_0xcbbfdf['include']?_[_0x3428('0x1c')](_0xcbbfdf[_0x3428('0x1a')],function(_0x587c1e){return{'model':db[_0x587c1e[_0x3428('0x1b')]],'as':_0x587c1e['as'],'attributes':_0x587c1e[_0x3428('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15bac1){logger[_0x3428('0x9')](_0x3428('0x13'),_0x215bd8);logger[_0x3428('0xb')](_0x3428('0x13'),_0x215bd8,JSON['stringify'](_0x15bac1));_0x2f1538(_0x15bac1);})[_0x3428('0x11')](function(_0x4257ea){logger['error'](_0x3428('0x13'),_0x4257ea[_0x3428('0x10')],_0x215bd8);_0x32758b(_0x4b5f74[_0x3428('0xe')](0x1f4,_0x4257ea[_0x3428('0x10')]));});});};exports[_0x3428('0x1d')]=function(_0x33bf7a){var _0x21252f=this;return new Promise(function(_0x3ed7b5,_0x4e0bff){return db['Trunk'][_0x3428('0x1e')]({'raw':_0x33bf7a['options']?_0x33bf7a[_0x3428('0x16')][_0x3428('0x17')]===undefined?!![]:![]:!![],'where':_0x33bf7a[_0x3428('0x16')]?_0x33bf7a[_0x3428('0x16')][_0x3428('0x18')]||null:null,'attributes':_0x33bf7a['options']?_0x33bf7a[_0x3428('0x16')][_0x3428('0x19')]||null:null,'include':_0x33bf7a[_0x3428('0x16')]?_0x33bf7a['options'][_0x3428('0x1a')]?_['map'](_0x33bf7a[_0x3428('0x16')][_0x3428('0x1a')],function(_0x43dcde){return{'model':db[_0x43dcde[_0x3428('0x1b')]],'as':_0x43dcde['as'],'attributes':_0x43dcde[_0x3428('0x19')],'include':_0x43dcde['include']?_[_0x3428('0x1c')](_0x43dcde[_0x3428('0x1a')],function(_0x3e68d4){return{'model':db[_0x3e68d4[_0x3428('0x1b')]],'as':_0x3e68d4['as'],'attributes':_0x3e68d4[_0x3428('0x19')],'include':_0x3e68d4[_0x3428('0x1a')]?_['map'](_0x3e68d4[_0x3428('0x1a')],function(_0x2d76a1){return{'model':db[_0x2d76a1[_0x3428('0x1b')]],'as':_0x2d76a1['as'],'attributes':_0x2d76a1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3428('0x1f')](function(_0x349f4c){logger['info'](_0x3428('0x1d'),_0x33bf7a);logger[_0x3428('0xb')](_0x3428('0x1d'),_0x33bf7a,JSON[_0x3428('0xd')](_0x349f4c));_0x3ed7b5(_0x349f4c);})[_0x3428('0x11')](function(_0xef0e24){logger[_0x3428('0xe')](_0x3428('0x1d'),_0xef0e24[_0x3428('0x10')],_0x33bf7a);_0x4e0bff(_0x21252f[_0x3428('0xe')](0x1f4,_0xef0e24[_0x3428('0x10')]));});});};
\ No newline at end of file
index 465f367..55580c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9157=['addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id','update','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','/:id/square_projects','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','show','/:id/avatar','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','create','/create_many','bulkCreate','join','root','%s-%s','now','originalname','single','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions'];(function(_0x3b682c,_0x399745){var _0x3630a6=function(_0x3d56dd){while(--_0x3d56dd){_0x3b682c['push'](_0x3b682c['shift']());}};_0x3630a6(++_0x399745);}(_0x9157,0x190));var _0x7915=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x9157[_0x59162a];return _0x35e50d;};'use strict';var multer=require(_0x7915('0x0'));var util=require(_0x7915('0x1'));var path=require(_0x7915('0x2'));var timeout=require(_0x7915('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7915('0x4'));var auth=require(_0x7915('0x5'));var interaction=require(_0x7915('0x6'));var config=require(_0x7915('0x7'));var controller=require(_0x7915('0x8'));router[_0x7915('0x9')]('/',auth[_0x7915('0xa')](),controller[_0x7915('0xb')]);router[_0x7915('0x9')](_0x7915('0xc'),auth['isAuthenticated'](),controller[_0x7915('0xd')]);router[_0x7915('0x9')](_0x7915('0xe'),auth[_0x7915('0xa')](),controller[_0x7915('0xf')]);router[_0x7915('0x9')](_0x7915('0x10'),auth[_0x7915('0xa')](),controller[_0x7915('0x11')]);router[_0x7915('0x9')]('/:id',auth[_0x7915('0xa')](),controller[_0x7915('0x12')]);router[_0x7915('0x9')](_0x7915('0x13'),controller['getAvatar']);router[_0x7915('0x9')]('/:id/open_tabs',auth[_0x7915('0xa')](),controller[_0x7915('0x14')]);router['get']('/:id/contacts',auth[_0x7915('0xa')](),controller[_0x7915('0x15')]);router[_0x7915('0x9')](_0x7915('0x16'),auth[_0x7915('0xa')](),controller[_0x7915('0x17')]);router['get'](_0x7915('0x18'),auth['isAuthenticated'](),controller[_0x7915('0x19')]);router['get'](_0x7915('0x1a'),auth[_0x7915('0xa')](),controller[_0x7915('0x1b')]);router[_0x7915('0x9')](_0x7915('0x1c'),auth['isAuthenticated'](),controller[_0x7915('0x1d')]);router[_0x7915('0x9')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0x7915('0x1e')]);router[_0x7915('0x9')](_0x7915('0x1f'),auth[_0x7915('0xa')](),controller[_0x7915('0x20')]);router[_0x7915('0x9')]('/:id/openchannel/interactions',auth[_0x7915('0xa')](),controller[_0x7915('0x21')]);router[_0x7915('0x9')](_0x7915('0x22'),auth[_0x7915('0xa')](),controller[_0x7915('0x23')]);router[_0x7915('0x9')](_0x7915('0x24'),auth[_0x7915('0xa')](),controller[_0x7915('0x25')]);router['get'](_0x7915('0x26'),auth[_0x7915('0xa')](),controller[_0x7915('0x27')]);router[_0x7915('0x9')](_0x7915('0x28'),auth[_0x7915('0xa')](),controller[_0x7915('0x29')]);router['get'](_0x7915('0x2a'),auth[_0x7915('0xa')](),controller[_0x7915('0x2b')]);router[_0x7915('0x9')]('/:id/lists',auth[_0x7915('0xa')](),controller[_0x7915('0x2c')]);router[_0x7915('0x9')]('/:id/agents',auth[_0x7915('0xa')](),controller[_0x7915('0x2d')]);router[_0x7915('0x9')](_0x7915('0x2e'),auth[_0x7915('0xa')](),controller[_0x7915('0x2f')]);router['get'](_0x7915('0x30'),auth[_0x7915('0xa')](),controller[_0x7915('0x31')]);router[_0x7915('0x9')](_0x7915('0x32'),auth[_0x7915('0xa')](),controller['getMailAccounts']);router[_0x7915('0x9')]('/:id/openchannel_accounts',auth[_0x7915('0xa')](),controller[_0x7915('0x33')]);router[_0x7915('0x9')](_0x7915('0x34'),auth[_0x7915('0xa')](),controller['getSmsAccounts']);router[_0x7915('0x9')](_0x7915('0x35'),auth[_0x7915('0xa')](),controller[_0x7915('0x36')]);router[_0x7915('0x9')](_0x7915('0x37'),auth[_0x7915('0xa')](),controller[_0x7915('0x38')]);router[_0x7915('0x9')]('/:id/square_projects',auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x7915('0x9')]('/:id/scheduled_calls',auth[_0x7915('0xa')](),controller[_0x7915('0x39')]);router[_0x7915('0x9')](_0x7915('0x3a'),auth[_0x7915('0xa')](),controller[_0x7915('0x3b')]);router[_0x7915('0x3c')](_0x7915('0x3d'),auth['isAuthenticated'](),controller[_0x7915('0x3e')]);router[_0x7915('0x3c')]('/',auth[_0x7915('0xa')](),controller[_0x7915('0x3f')]);router[_0x7915('0x3c')](_0x7915('0x40'),auth[_0x7915('0xa')](),controller[_0x7915('0x41')]);router[_0x7915('0x3c')](_0x7915('0x16'),auth[_0x7915('0xa')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b373e,_0x7fbb7d,_0xffee8b){_0xffee8b(null,path[_0x7915('0x42')](config[_0x7915('0x43')],'server/files/images/'));},'filename':function(_0x1631ce,_0x237a4d,_0x164568){_0x164568(null,util['format'](_0x7915('0x44'),Date[_0x7915('0x45')](),_0x237a4d[_0x7915('0x46')]));}})});router[_0x7915('0x3c')]('/:id/avatar',upload[_0x7915('0x47')]('file'),controller[_0x7915('0x48')]);router[_0x7915('0x3c')](_0x7915('0x49'),auth[_0x7915('0xa')](),controller['login']);router[_0x7915('0x3c')](_0x7915('0x4a'),auth['isAuthenticated'](),controller[_0x7915('0x4b')]);router[_0x7915('0x3c')](_0x7915('0x4c'),auth[_0x7915('0xa')](),controller[_0x7915('0x4d')]);router['post'](_0x7915('0x4e'),auth['isAuthenticated'](),controller[_0x7915('0x4f')]);router['post'](_0x7915('0x2a'),auth[_0x7915('0xa')](),controller[_0x7915('0x50')]);router[_0x7915('0x3c')](_0x7915('0x51'),auth[_0x7915('0xa')](),controller[_0x7915('0x52')]);router['post']('/:id/mail_interactions',auth[_0x7915('0xa')](),controller['addMailInteractions']);router[_0x7915('0x3c')](_0x7915('0x53'),auth[_0x7915('0xa')](),controller[_0x7915('0x54')]);router[_0x7915('0x3c')](_0x7915('0x55'),auth[_0x7915('0xa')](),controller[_0x7915('0x56')]);router[_0x7915('0x3c')](_0x7915('0x57'),auth[_0x7915('0xa')](),controller[_0x7915('0x58')]);router[_0x7915('0x3c')](_0x7915('0x59'),auth[_0x7915('0xa')](),controller['addWhatsappInteractions']);router[_0x7915('0x3c')]('/:id/fax_accounts',auth[_0x7915('0xa')](),controller[_0x7915('0x5a')]);router[_0x7915('0x3c')](_0x7915('0x32'),auth[_0x7915('0xa')](),controller[_0x7915('0x5b')]);router['post'](_0x7915('0x5c'),auth[_0x7915('0xa')](),controller[_0x7915('0x5d')]);router[_0x7915('0x3c')]('/:id/sms_accounts',auth[_0x7915('0xa')](),controller[_0x7915('0x5e')]);router[_0x7915('0x3c')]('/:id/chat_websites',auth[_0x7915('0xa')](),controller[_0x7915('0x5f')]);router[_0x7915('0x3c')](_0x7915('0x37'),auth['isAuthenticated'](),controller[_0x7915('0x60')]);router[_0x7915('0x3c')]('/:id/square_projects',auth[_0x7915('0xa')](),controller[_0x7915('0x61')]);router[_0x7915('0x3c')](_0x7915('0x3a'),auth[_0x7915('0xa')](),controller[_0x7915('0x62')]);router[_0x7915('0x63')](_0x7915('0x64'),auth[_0x7915('0xa')](),controller[_0x7915('0x65')]);router[_0x7915('0x63')]('/:id/password',auth[_0x7915('0xa')](),controller['changePassword']);router[_0x7915('0x66')](_0x7915('0x16'),auth[_0x7915('0xa')](),controller[_0x7915('0x67')]);router[_0x7915('0x66')]('/:id/teams',auth[_0x7915('0xa')](),controller[_0x7915('0x68')]);router[_0x7915('0x66')](_0x7915('0x64'),auth[_0x7915('0xa')](),controller[_0x7915('0x69')]);router[_0x7915('0x66')](_0x7915('0x51'),auth[_0x7915('0xa')](),controller[_0x7915('0x6a')]);router['delete'](_0x7915('0x6b'),auth[_0x7915('0xa')](),controller[_0x7915('0x6c')]);router[_0x7915('0x66')](_0x7915('0x53'),auth['isAuthenticated'](),controller[_0x7915('0x6d')]);router[_0x7915('0x66')](_0x7915('0x55'),auth[_0x7915('0xa')](),controller[_0x7915('0x6e')]);router[_0x7915('0x66')](_0x7915('0x57'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router['delete'](_0x7915('0x59'),auth[_0x7915('0xa')](),controller[_0x7915('0x6f')]);router[_0x7915('0x66')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x7915('0x70')]);router['delete']('/:id/mail_accounts',auth[_0x7915('0xa')](),controller[_0x7915('0x71')]);router[_0x7915('0x66')](_0x7915('0x5c'),auth[_0x7915('0xa')](),controller[_0x7915('0x72')]);router[_0x7915('0x66')](_0x7915('0x34'),auth[_0x7915('0xa')](),controller[_0x7915('0x73')]);router[_0x7915('0x66')]('/:id/chat_websites',auth[_0x7915('0xa')](),controller[_0x7915('0x74')]);router['delete']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router['delete'](_0x7915('0x75'),auth[_0x7915('0xa')](),controller[_0x7915('0x76')]);router[_0x7915('0x66')](_0x7915('0x3a'),auth['isAuthenticated'](),controller[_0x7915('0x77')]);module[_0x7915('0x78')]=router;
\ No newline at end of file
+var _0xa6b0=['/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','bulkCreate','addQueues','diskStorage','join','root','%s-%s','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','/:id/openchannel_accounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/whoami','/:id','show','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes'];(function(_0x64572b,_0x4335af){var _0x55868f=function(_0x5d1f95){while(--_0x5d1f95){_0x64572b['push'](_0x64572b['shift']());}};_0x55868f(++_0x4335af);}(_0xa6b0,0xc0));var _0x0a6b=function(_0x4c94d6,_0x5d7929){_0x4c94d6=_0x4c94d6-0x0;var _0x2973eb=_0xa6b0[_0x4c94d6];return _0x2973eb;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require(_0x0a6b('0x2'));var express=require('express');var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require('./user.controller');router[_0x0a6b('0x7')]('/',auth[_0x0a6b('0x8')](),controller['index']);router[_0x0a6b('0x7')](_0x0a6b('0x9'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x7')](_0x0a6b('0xb'),auth[_0x0a6b('0x8')](),controller['whoami']);router[_0x0a6b('0x7')]('/presence',auth['isAuthenticated'](),controller['getPresence']);router[_0x0a6b('0x7')](_0x0a6b('0xc'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xd')]);router[_0x0a6b('0x7')]('/:id/avatar',controller[_0x0a6b('0xe')]);router['get']('/:id/open_tabs',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xf')]);router['get'](_0x0a6b('0x10'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x7')](_0x0a6b('0x12'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x13')]);router[_0x0a6b('0x7')]('/:id/queues_rt',auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router['get'](_0x0a6b('0x14'),auth['isAuthenticated'](),controller[_0x0a6b('0x15')]);router['get'](_0x0a6b('0x16'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x17')]);router[_0x0a6b('0x7')]('/:id/screen_recordings',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x18')]);router['get'](_0x0a6b('0x19'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x1a')]);router[_0x0a6b('0x7')](_0x0a6b('0x1b'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x1c')]);router['get'](_0x0a6b('0x1d'),auth['isAuthenticated'](),controller[_0x0a6b('0x1e')]);router[_0x0a6b('0x7')](_0x0a6b('0x1f'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x20')]);router[_0x0a6b('0x7')](_0x0a6b('0x21'),auth['isAuthenticated'](),controller[_0x0a6b('0x22')]);router[_0x0a6b('0x7')](_0x0a6b('0x23'),auth[_0x0a6b('0x8')](),controller['getWhatsappInteractions']);router[_0x0a6b('0x7')](_0x0a6b('0x24'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x25')]);router[_0x0a6b('0x7')](_0x0a6b('0x26'),auth['isAuthenticated'](),controller[_0x0a6b('0x27')]);router[_0x0a6b('0x7')](_0x0a6b('0x28'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x29')]);router[_0x0a6b('0x7')](_0x0a6b('0x2a'),auth['isAuthenticated'](),controller[_0x0a6b('0x2b')]);router[_0x0a6b('0x7')](_0x0a6b('0x2c'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x2d')]);router['get']('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x0a6b('0x2e')]);router['get']('/:id/openchannel_accounts',auth[_0x0a6b('0x8')](),controller['getOpenchannelAccounts']);router[_0x0a6b('0x7')](_0x0a6b('0x2f'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x30')]);router['get']('/:id/chat_websites',auth[_0x0a6b('0x8')](),controller['getChatWebsites']);router[_0x0a6b('0x7')](_0x0a6b('0x31'),auth['isAuthenticated'](),controller[_0x0a6b('0x32')]);router[_0x0a6b('0x7')](_0x0a6b('0x33'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x34')]);router[_0x0a6b('0x7')]('/:id/scheduled_calls',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x35')]);router[_0x0a6b('0x7')](_0x0a6b('0x36'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x37')]);router[_0x0a6b('0x38')]('/:id/contacts',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x39')]);router[_0x0a6b('0x38')]('/',auth[_0x0a6b('0x8')](),controller['create']);router[_0x0a6b('0x38')]('/create_many',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x3a')]);router[_0x0a6b('0x38')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a6b('0x3b')]);var upload=multer({'storage':multer[_0x0a6b('0x3c')]({'destination':function(_0x5b5e7e,_0x14525a,_0x3523b3){_0x3523b3(null,path[_0x0a6b('0x3d')](config[_0x0a6b('0x3e')],'server/files/images/'));},'filename':function(_0x101ace,_0x54e6ef,_0x2c97c1){_0x2c97c1(null,util['format'](_0x0a6b('0x3f'),Date['now'](),_0x54e6ef['originalname']));}})});router[_0x0a6b('0x38')](_0x0a6b('0x40'),upload[_0x0a6b('0x41')](_0x0a6b('0x42')),controller[_0x0a6b('0x43')]);router['post'](_0x0a6b('0x44'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x45')]);router[_0x0a6b('0x38')](_0x0a6b('0x46'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x47')]);router[_0x0a6b('0x38')](_0x0a6b('0x48'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x49')]);router[_0x0a6b('0x38')](_0x0a6b('0x4a'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x4b')]);router[_0x0a6b('0x38')](_0x0a6b('0x24'),auth[_0x0a6b('0x8')](),controller['addTeams']);router['post'](_0x0a6b('0x4c'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x4d')]);router[_0x0a6b('0x38')](_0x0a6b('0x4e'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x4f')]);router[_0x0a6b('0x38')](_0x0a6b('0x50'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x51')]);router[_0x0a6b('0x38')](_0x0a6b('0x52'),auth['isAuthenticated'](),controller[_0x0a6b('0x53')]);router[_0x0a6b('0x38')](_0x0a6b('0x54'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x55')]);router['post'](_0x0a6b('0x56'),auth['isAuthenticated'](),controller[_0x0a6b('0x57')]);router['post'](_0x0a6b('0x2c'),auth['isAuthenticated'](),controller[_0x0a6b('0x58')]);router[_0x0a6b('0x38')](_0x0a6b('0x59'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x5a')]);router[_0x0a6b('0x38')](_0x0a6b('0x5b'),auth[_0x0a6b('0x8')](),controller['addOpenchannelAccounts']);router[_0x0a6b('0x38')]('/:id/sms_accounts',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x5c')]);router['post']('/:id/chat_websites',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x5d')]);router['post'](_0x0a6b('0x31'),auth[_0x0a6b('0x8')](),controller['addWhatsappAccounts']);router[_0x0a6b('0x38')](_0x0a6b('0x33'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x5e')]);router[_0x0a6b('0x38')](_0x0a6b('0x36'),auth['isAuthenticated'](),controller[_0x0a6b('0x5f')]);router[_0x0a6b('0x60')](_0x0a6b('0xc'),auth['isAuthenticated'](),controller[_0x0a6b('0x61')]);router['put'](_0x0a6b('0x62'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x63')]);router[_0x0a6b('0x64')](_0x0a6b('0x12'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x65')]);router[_0x0a6b('0x64')](_0x0a6b('0x24'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x66')]);router[_0x0a6b('0x64')](_0x0a6b('0xc'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x67')]);router[_0x0a6b('0x64')]('/:id/chat_interactions',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x68')]);router[_0x0a6b('0x64')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x0a6b('0x69')]);router[_0x0a6b('0x64')](_0x0a6b('0x50'),auth[_0x0a6b('0x8')](),controller['removeFaxInteractions']);router['delete'](_0x0a6b('0x52'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x6a')]);router[_0x0a6b('0x64')](_0x0a6b('0x54'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x6b')]);router[_0x0a6b('0x64')]('/:id/whatsapp_interactions',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x6c')]);router[_0x0a6b('0x64')](_0x0a6b('0x2c'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x6d')]);router[_0x0a6b('0x64')](_0x0a6b('0x59'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x6e')]);router[_0x0a6b('0x64')](_0x0a6b('0x5b'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x6f')]);router['delete'](_0x0a6b('0x2f'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x70')]);router[_0x0a6b('0x64')](_0x0a6b('0x71'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x72')]);router[_0x0a6b('0x64')](_0x0a6b('0x31'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x73')]);router[_0x0a6b('0x64')](_0x0a6b('0x33'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x74')]);router[_0x0a6b('0x64')]('/:id/api_key',auth[_0x0a6b('0x8')](),controller['removeApiKey']);module[_0x0a6b('0x75')]=router;
\ No newline at end of file
index c245dd9..a35b4bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f44=['update,nonat','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','lodash','exports','STRING','name','setDataValue','defaultuser','callerid','format','getDataValue','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','internal','\x22%s\x22\x20<%s>','fullname','BOOLEAN','DATE','dynamic','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','auto','rfc2833','yes','update','force_rport,comedia','nat','all','allow','join','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','uas','fingerprint','certificate','active','passive','actpass','nonat'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x6f44,0x1ea));var _0x46f4=function(_0x3878c5,_0x6f3252){_0x3878c5=_0x3878c5-0x0;var _0x1360a0=_0x6f44[_0x3878c5];return _0x1360a0;};'use strict';var Sequelize=require(_0x46f4('0x0'));var moment=require(_0x46f4('0x1'));var util=require('util');var _=require(_0x46f4('0x2'));module[_0x46f4('0x3')]={'name':{'type':Sequelize[_0x46f4('0x4')],'allowNull':![],'unique':_0x46f4('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4099a9){this[_0x46f4('0x6')](_0x46f4('0x5'),_0x4099a9);this[_0x46f4('0x6')](_0x46f4('0x7'),_0x4099a9);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x46f4('0x4')],'allowNull':![],'set':function(_0x2a50b1){this[_0x46f4('0x6')]('fullname',_0x2a50b1);this['setDataValue'](_0x46f4('0x8'),util[_0x46f4('0x9')]('\x22%s\x22\x20<%s>',_0x2a50b1,this[_0x46f4('0xa')]('internal')));}},'alias':{'type':Sequelize[_0x46f4('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x46f4('0xb'),'validate':{'isEmail':!![]},'set':function(_0x1fe1a5){if(_0x1fe1a5){this[_0x46f4('0x6')](_0x46f4('0xb'),_0x1fe1a5[_0x46f4('0xc')]());}}},'role':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0xe'),_0x46f4('0xf'),_0x46f4('0x10'),_0x46f4('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x46f4('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x46f4('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':![],'unique':_0x46f4('0x13'),'set':function(_0x52db86){this[_0x46f4('0x6')](_0x46f4('0x13'),_0x52db86);this[_0x46f4('0x6')]('accountcode',_0x52db86);this[_0x46f4('0x6')]('callerid',util['format'](_0x46f4('0x14'),this[_0x46f4('0xa')](_0x46f4('0x15')),_0x52db86));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x46f4('0x4')]},'userpic':{'type':Sequelize[_0x46f4('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x46f4('0x4')]},'online':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x46f4('0x17')]},'voicePause':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x46f4('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x46f4('0x17')]},'chatCapacity':{'type':Sequelize[_0x46f4('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x46f4('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x46f4('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x46f4('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x46f4('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x46f4('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x46f4('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x46f4('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x46f4('0x18')},'ipaddr':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x46f4('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user',_0x46f4('0x19')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![],'defaultValue':_0x46f4('0x1a')},'callingpres':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x1b'),_0x46f4('0x1c'),'ALLOWED_FAILED_SCREEN',_0x46f4('0x1d'),_0x46f4('0x1e'),_0x46f4('0x1f'),'PROHIB_FAILED_SCREEN',_0x46f4('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![],'defaultValue':_0x46f4('0x21'),'set':function(_0x4c760b){this[_0x46f4('0x6')](_0x46f4('0x22'),_0x4c760b?_0x4c760b['join'](','):null);},'get':function(){return this[_0x46f4('0xa')]('transport')?this[_0x46f4('0xa')](_0x46f4('0x22'))[_0x46f4('0x23')](','):null;},'comment':_0x46f4('0x24')},'dtmfmode':{'type':Sequelize[_0x46f4('0xd')]('rfc2833',_0x46f4('0x25'),_0x46f4('0x26'),'inband',_0x46f4('0x27')),'allowNull':!![],'defaultValue':_0x46f4('0x28')},'directmedia':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no','nonat',_0x46f4('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x46f4('0x2b'),'set':function(_0x5cf06f){this['setDataValue'](_0x46f4('0x2c'),_0x5cf06f?_0x5cf06f['join'](','):null);},'get':function(){return this['getDataValue'](_0x46f4('0x2c'))?this[_0x46f4('0xa')]('nat')[_0x46f4('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x46f4('0x4')]},'namedcallgroup':{'type':Sequelize[_0x46f4('0x4')]},'pickupgroup':{'type':Sequelize[_0x46f4('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x46f4('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x46f4('0x4')]},'disallow':{'type':Sequelize[_0x46f4('0x4')],'allowNull':![],'defaultValue':_0x46f4('0x2d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4a44a6){this[_0x46f4('0x6')](_0x46f4('0x2e'),_0x4a44a6?_0x4a44a6[_0x46f4('0x2f')](';'):_0x46f4('0x30'));},'get':function(){return this['getDataValue'](_0x46f4('0x2e'))?this[_0x46f4('0xa')](_0x46f4('0x2e'))[_0x46f4('0x23')](';'):null;},'comment':_0x46f4('0x31')},'autoframing':{'type':Sequelize['ENUM'](_0x46f4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![],'set':function(_0x297cf9){this[_0x46f4('0x6')](_0x46f4('0x32'),_0x297cf9?_0x297cf9['join'](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x46f4('0xa')](_0x46f4('0x32'))[_0x46f4('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no',_0x46f4('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x46f4('0x34')},'amaflags':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![],'defaultValue':_0x46f4('0x29')},'busylevel':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x46f4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no',_0x46f4('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x46f4('0xd')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x36'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x46f4('0xd')]('uac','uas'),'allowNull':!![],'defaultValue':_0x46f4('0x37')},'t38pt_usertpsource':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x46f4('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0x46f4('0x29')},'keepalive':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x46f4('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x46f4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x46f4('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x46f4('0x29'),'no',_0x46f4('0x38'),_0x46f4('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x3a'),_0x46f4('0x3b'),_0x46f4('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x46f4('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x46f4('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x46f4('0x3d'),'update',_0x46f4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x46f4('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x46f4('0x17')]},'passwordResetAt':{'type':Sequelize[_0x46f4('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x46f4('0x12')],'defaultValue':0x0,'set':function(_0x47ecbc){this['setDataValue'](_0x46f4('0x3f'),_0x47ecbc);var _0x17bce9=this[_0x46f4('0x40')]({'plain':!![]});switch(_0x47ecbc){case 0x0:case 0x1:var _0x2e648b=_0x17bce9[_0x46f4('0x22')]?_[_0x46f4('0x41')](_0x17bce9['transport'])?_0x17bce9[_0x46f4('0x22')][_0x46f4('0x2f')]():_0x17bce9[_0x46f4('0x22')]:_0x46f4('0x21');if(_0x2e648b===_0x46f4('0x42')){_0x2e648b=_0x46f4('0x21');}this[_0x46f4('0x6')](_0x46f4('0x22'),_0x2e648b);this[_0x46f4('0x6')](_0x46f4('0x43'),'no');this[_0x46f4('0x6')](_0x46f4('0x44'),null);this[_0x46f4('0x6')](_0x46f4('0x45'),null);this[_0x46f4('0x6')](_0x46f4('0x46'),null);this[_0x46f4('0x6')](_0x46f4('0x47'),null);this['setDataValue'](_0x46f4('0x48'),null);this[_0x46f4('0x6')](_0x46f4('0x49'),null);this[_0x46f4('0x6')](_0x46f4('0x4a'),null);this['setDataValue'](_0x46f4('0x4b'),null);this[_0x46f4('0x6')](_0x46f4('0x4c'),'no');break;case 0x2:this[_0x46f4('0x6')](_0x46f4('0x22'),_0x46f4('0x42'));this[_0x46f4('0x6')](_0x46f4('0x43'),_0x46f4('0x29'));this[_0x46f4('0x6')](_0x46f4('0x44'),_0x46f4('0x29'));this[_0x46f4('0x6')](_0x46f4('0x45'),_0x46f4('0x29'));this[_0x46f4('0x6')](_0x46f4('0x46'),_0x46f4('0x29'));this[_0x46f4('0x6')](_0x46f4('0x47'),_0x46f4('0x29'));this[_0x46f4('0x6')](_0x46f4('0x48'),'no');this[_0x46f4('0x6')](_0x46f4('0x49'),'actpass');this[_0x46f4('0x6')]('dtlscertfile',_0x17bce9[_0x46f4('0x4a')]||_0x46f4('0x4d'));this[_0x46f4('0x6')](_0x46f4('0x4b'),_0x17bce9[_0x46f4('0x4b')]||_0x46f4('0x4e'));this[_0x46f4('0x6')](_0x46f4('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x46f4('0x4f')],'set':function(_0x18b72a){this['setDataValue'](_0x46f4('0x50'),_0x18b72a?_0x18b72a[_0x46f4('0x2f')](','):[]);},'get':function(){return this[_0x46f4('0xa')](_0x46f4('0x50'))?_[_0x46f4('0x51')](this['getDataValue'](_0x46f4('0x50'))['split'](','),function(_0x231d84){return parseInt(_0x231d84,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x46f4('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x46f4('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x46f4('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x46f4('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x46f4('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x46f4('0xd')](_0x46f4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x46f4('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x46f4('0x52')],'get':function(){return this[_0x46f4('0xa')](_0x46f4('0x53'))?this[_0x46f4('0xa')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x46f4('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4476f0){if(typeof _0x4476f0===_0x46f4('0x54')){var _0x30a679=_0x4476f0==='1'?!![]:_0x4476f0==='0'?![]:_0x4476f0===_0x46f4('0x55')?!![]:_0x4476f0===_0x46f4('0x56')?![]:![];this[_0x46f4('0x6')](_0x46f4('0x57'),_0x30a679);}else{this['setDataValue'](_0x46f4('0x57'),_0x4476f0);}}},'blocked':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':![],'set':function(_0x383d7c){this[_0x46f4('0x6')](_0x46f4('0x58'),_0x383d7c);if(_0x383d7c===!![]){this[_0x46f4('0x6')]('blockedAt',moment());this[_0x46f4('0x6')](_0x46f4('0x59'),0x0);}else{this['setDataValue'](_0x46f4('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x46f4('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x46f4('0x12')](0x5)[_0x46f4('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x46f4('0x16')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x677a=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','yes','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','actpass','TEXT','showWebBar','get','wss','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','dtlscertfile','/etc/pki/tls/private/motion.key','map','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','getDataValue','email','toLowerCase','admin','user','agent','telephone','INTEGER','internal','accountcode','callerid','format','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','auto','rfc2833','nonat','update','outgoing','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x677a,0xd6));var _0xa677=function(_0xaebd6f,_0x245e8a){_0xaebd6f=_0xaebd6f-0x0;var _0x52fca9=_0x677a[_0xaebd6f];return _0x52fca9;};'use strict';var Sequelize=require(_0xa677('0x0'));var moment=require('moment');var util=require(_0xa677('0x1'));var _=require(_0xa677('0x2'));module[_0xa677('0x3')]={'name':{'type':Sequelize[_0xa677('0x4')],'allowNull':![],'unique':_0xa677('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4a7c34){this[_0xa677('0x6')](_0xa677('0x5'),_0x4a7c34);this[_0xa677('0x6')](_0xa677('0x7'),_0x4a7c34);},'comment':_0xa677('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x303092){this[_0xa677('0x6')](_0xa677('0x9'),_0x303092);this[_0xa677('0x6')]('callerid',util['format']('\x22%s\x22\x20<%s>',_0x303092,this[_0xa677('0xa')]('internal')));}},'alias':{'type':Sequelize[_0xa677('0x4')]},'email':{'type':Sequelize[_0xa677('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0xead831){if(_0xead831){this[_0xa677('0x6')](_0xa677('0xb'),_0xead831[_0xa677('0xc')]());}}},'role':{'type':Sequelize['ENUM'](_0xa677('0xd'),_0xa677('0xe'),_0xa677('0xf'),_0xa677('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa677('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':![],'unique':_0xa677('0x12'),'set':function(_0x155021){this[_0xa677('0x6')](_0xa677('0x12'),_0x155021);this[_0xa677('0x6')](_0xa677('0x13'),_0x155021);this[_0xa677('0x6')](_0xa677('0x14'),util[_0xa677('0x15')](_0xa677('0x16'),this[_0xa677('0xa')](_0xa677('0x9')),_0x155021));}},'salt':{'type':Sequelize[_0xa677('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xa677('0x4')]},'address':{'type':Sequelize[_0xa677('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa677('0x4')]},'country':{'type':Sequelize[_0xa677('0x4')]},'online':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xa677('0x18')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xa677('0x19')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xa677('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xa677('0x11')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa677('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xa677('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xa677('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xa677('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xa677('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![],'defaultValue':_0xa677('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xa677('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xa677('0x1b'),_0xa677('0xe'),_0xa677('0x1c')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![],'defaultValue':_0xa677('0x1d')},'callingpres':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x1f'),'ALLOWED_PASSED_SCREEN',_0xa677('0x20'),_0xa677('0x21'),_0xa677('0x22'),'PROHIB_PASSED_SCREEN',_0xa677('0x23'),_0xa677('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x14fda0){this['setDataValue'](_0xa677('0x25'),_0x14fda0?_0x14fda0[_0xa677('0x26')](','):null);},'get':function(){return this[_0xa677('0xa')](_0xa677('0x25'))?this[_0xa677('0xa')](_0xa677('0x25'))[_0xa677('0x27')](','):null;},'comment':_0xa677('0x28')},'dtmfmode':{'type':Sequelize[_0xa677('0x1e')]('rfc2833',_0xa677('0x29'),'shortinfo',_0xa677('0x2a'),_0xa677('0x2b')),'allowNull':!![],'defaultValue':_0xa677('0x2c')},'directmedia':{'type':Sequelize[_0xa677('0x1e')]('yes','no',_0xa677('0x2d'),_0xa677('0x2e'),_0xa677('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x5952d0){this[_0xa677('0x6')](_0xa677('0x30'),_0x5952d0?_0x5952d0[_0xa677('0x26')](','):null);},'get':function(){return this[_0xa677('0xa')]('nat')?this[_0xa677('0xa')](_0xa677('0x30'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa677('0x4')]},'namedcallgroup':{'type':Sequelize[_0xa677('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xa677('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa677('0x4')]},'disallow':{'type':Sequelize[_0xa677('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xa677('0x4')],'allowNull':![],'defaultValue':_0xa677('0x31'),'set':function(_0x23ae91){this[_0xa677('0x6')](_0xa677('0x32'),_0x23ae91?_0x23ae91[_0xa677('0x26')](';'):_0xa677('0x31'));},'get':function(){return this[_0xa677('0xa')](_0xa677('0x32'))?this['getDataValue'](_0xa677('0x32'))[_0xa677('0x27')](';'):null;},'comment':_0xa677('0x33')},'autoframing':{'type':Sequelize[_0xa677('0x1e')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x596044){this[_0xa677('0x6')](_0xa677('0x34'),_0x596044?_0x596044['join'](','):null);},'get':function(){return this[_0xa677('0xa')](_0xa677('0x34'))?this[_0xa677('0xa')]('insecure')[_0xa677('0x27')](','):null;},'comment':_0xa677('0x35')},'trustrpid':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no',_0xa677('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![],'defaultValue':_0xa677('0x38')},'amaflags':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![],'defaultValue':_0xa677('0x36')},'busylevel':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xa677('0x36'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xa677('0x36'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no',_0xa677('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xa677('0x36'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x3a'),_0xa677('0x3b'),_0xa677('0x3c')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xa677('0x3d'),_0xa677('0x3e')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![],'defaultValue':_0xa677('0x36')},'keepalive':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xa677('0x36'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa677('0x1e')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa677('0x1e')]('yes','no','fingerprint',_0xa677('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xa677('0x1e')]('active','passive',_0xa677('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xa677('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa677('0x1e')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no',_0xa677('0x2d'),_0xa677('0x2e'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa677('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0xa677('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xa677('0x41')]},'showWebBar':{'type':Sequelize[_0xa677('0x11')],'defaultValue':0x0,'set':function(_0x951f45){this['setDataValue'](_0xa677('0x42'),_0x951f45);var _0x233827=this[_0xa677('0x43')]({'plain':!![]});switch(_0x951f45){case 0x0:case 0x1:var _0x1f5479=_0x233827['transport']?_['isArray'](_0x233827[_0xa677('0x25')])?_0x233827[_0xa677('0x25')]['join']():_0x233827['transport']:'udp';if(_0x1f5479===_0xa677('0x44')){_0x1f5479='udp';}this[_0xa677('0x6')]('transport',_0x1f5479);this[_0xa677('0x6')]('encryption','no');this[_0xa677('0x6')](_0xa677('0x45'),null);this[_0xa677('0x6')](_0xa677('0x46'),null);this[_0xa677('0x6')](_0xa677('0x47'),null);this[_0xa677('0x6')](_0xa677('0x48'),null);this['setDataValue'](_0xa677('0x49'),null);this[_0xa677('0x6')](_0xa677('0x4a'),null);this[_0xa677('0x6')]('dtlscertfile',null);this[_0xa677('0x6')](_0xa677('0x4b'),null);this[_0xa677('0x6')](_0xa677('0x4c'),'no');break;case 0x2:this[_0xa677('0x6')](_0xa677('0x25'),_0xa677('0x44'));this[_0xa677('0x6')](_0xa677('0x4d'),'yes');this[_0xa677('0x6')]('avpf',_0xa677('0x36'));this[_0xa677('0x6')](_0xa677('0x46'),_0xa677('0x36'));this[_0xa677('0x6')](_0xa677('0x47'),_0xa677('0x36'));this[_0xa677('0x6')]('dtlsenable',_0xa677('0x36'));this[_0xa677('0x6')]('dtlsverify','no');this[_0xa677('0x6')]('dtlssetup',_0xa677('0x40'));this[_0xa677('0x6')](_0xa677('0x4e'),_0x233827['dtlscertfile']||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0xa677('0x4b'),_0x233827[_0xa677('0x4b')]||_0xa677('0x4f'));this[_0xa677('0x6')]('rtcp_mux',_0xa677('0x36'));break;default:}}},'permissions':{'type':Sequelize[_0xa677('0x41')],'set':function(_0x55208a){this[_0xa677('0x6')]('permissions',_0x55208a?_0x55208a['join'](','):[]);},'get':function(){return this[_0xa677('0xa')]('permissions')?_[_0xa677('0x50')](this['getDataValue'](_0xa677('0x51'))[_0xa677('0x27')](','),function(_0x120ebe){return parseInt(_0x120ebe,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xa677('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa677('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xa677('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xa677('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xa677('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xa677('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa677('0x1e')](_0xa677('0x36'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa677('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa677('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa677('0x52')],'get':function(){return this['getDataValue'](_0xa677('0x53'))?this[_0xa677('0xa')](_0xa677('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0xa677('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xa677('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![],'set':function(_0x33b378){if(typeof _0x33b378==='string'){var _0x27d3e1=_0x33b378==='1'?!![]:_0x33b378==='0'?![]:_0x33b378===_0xa677('0x54')?!![]:_0x33b378===_0xa677('0x55')?![]:![];this[_0xa677('0x6')](_0xa677('0x56'),_0x27d3e1);}else{this[_0xa677('0x6')](_0xa677('0x56'),_0x33b378);}}},'blocked':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![],'set':function(_0x384b99){this['setDataValue'](_0xa677('0x57'),_0x384b99);if(_0x384b99===!![]){this['setDataValue'](_0xa677('0x58'),moment());this[_0xa677('0x6')]('loginAttempts',0x0);}else{this[_0xa677('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xa677('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xa677('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xa677('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xa677('0x11')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa677('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 65629ce..484d3e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['attributes','findAll','rows','true','length','chat','dataValues','push','fax','mail','openchannel','all','model','keys','filters','intersection','fields','options','openTabs','sms','whatsapp','body','params','describe','addContacts','omit','ids','internal','Setting','findById','securePassword','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','agent','permissions','101','102','103','106','100','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','autoAssociation','compact','changePassword','oldPassword','Sequelize','authenticate','ValidationError','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','spread','QueueId','voice','VoiceQueue','format','SIP/%s','removeQueues','remove','isArray','emit','Queue:remove','UserVoiceQueueRt','userpic','file','filename','join','root','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','createdAt','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','CmContact','sort','pick','merge','hasOwnProperty','CmList','Tags','color','tag','nolimit','getContacts','order','Queue','Queues','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','socket','remoteAddress','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','bulkCreate','resolve','logout','pause','QueuePause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','getTeams','Team','addTeams','setDataValue','Voice','Chat','getMailQueues','Mail','getSmsQueues','getWhatsappQueues','Whatsapp','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','penalty','Queue:save','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getChatQueues','Sms','Fax','removeAgent','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','isEmpty','lower','col','toString','asc','desc','substring','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','select','ui.','InteractionId','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','lodash','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','socket.io-emitter','redis','defaults','localhost','client','then','info','User,\x20%s,\x20%s','debug','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','get','admin','Users','user','Agents','Telephones','telephone','map','value','includes','role','find','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','filter','password','where','User','query','includeAll','include'];(function(_0xfec4f,_0x516119){var _0x4d8bad=function(_0x3d5eaa){while(--_0x3d5eaa){_0xfec4f['push'](_0xfec4f['shift']());}};_0x4d8bad(++_0x516119);}(_0xb016,0x159));var _0x6b01=function(_0x1691a8,_0x52a3b4){_0x1691a8=_0x1691a8-0x0;var _0x4389a3=_0xb016[_0x1691a8];return _0x4389a3;};'use strict';var moment=require(_0x6b01('0x0'));var BPromise=require(_0x6b01('0x1'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x6b01('0x2'));var squel=require('squel');var jayson=require(_0x6b01('0x3'));var Redis=require(_0x6b01('0x4'));var authService=require(_0x6b01('0x5'));var qs=require(_0x6b01('0x6'));var logger=require('../../config/logger')(_0x6b01('0x7'));var utils=require(_0x6b01('0x8'));var config=require(_0x6b01('0x9'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var socket=require(_0x6b01('0xa'))(new Redis(config[_0x6b01('0xb')]));require('./user.socket')['register'](socket);config[_0x6b01('0xb')]=_[_0x6b01('0xc')](config[_0x6b01('0xb')],{'host':_0x6b01('0xd'),'port':0x18eb});var client=jayson[_0x6b01('0xe')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x4b4a4d,_0x4627ef,_0x24049f,_0x2660c7){return new BPromise(function(_0x5a8817,_0x200614){var _0x5c54e4=_0x2660c7||client;return _0x5c54e4['request'](_0x4b4a4d,_0x24049f)[_0x6b01('0xf')](function(_0x4fa826){logger[_0x6b01('0x10')](_0x6b01('0x11'),_0x4627ef,'request\x20sent');logger[_0x6b01('0x12')]('User,\x20%s,\x20%s,\x20%s',_0x4627ef,'request\x20sent',JSON['stringify'](_0x4fa826));if(_0x4fa826[_0x6b01('0x13')]){if(_0x4fa826['error']['code']===0x1f4){logger[_0x6b01('0x13')](_0x6b01('0x11'),_0x4627ef,_0x4fa826[_0x6b01('0x13')][_0x6b01('0x14')]);return _0x200614(_0x4fa826[_0x6b01('0x13')][_0x6b01('0x14')]);}logger[_0x6b01('0x13')](_0x6b01('0x11'),_0x4627ef,_0x4fa826[_0x6b01('0x13')][_0x6b01('0x14')]);return _0x5a8817(_0x4fa826[_0x6b01('0x13')]['message']);}else{logger[_0x6b01('0x10')](_0x6b01('0x11'),_0x4627ef,_0x6b01('0x15'));_0x5a8817(_0x4fa826[_0x6b01('0x16')][_0x6b01('0x14')]);}})[_0x6b01('0x17')](function(_0x33753f){logger[_0x6b01('0x13')]('User,\x20%s,\x20%s',_0x4627ef,_0x33753f);_0x200614(_0x33753f);});});}function respondWithStatusCode(_0x3029e2,_0xc1f453){_0xc1f453=_0xc1f453||0xcc;return function(_0x424cd3){if(_0x424cd3){return _0x3029e2[_0x6b01('0x18')](_0xc1f453);}return _0x3029e2[_0x6b01('0x19')](_0xc1f453)[_0x6b01('0x1a')]();};}function respondWithResult(_0x2cea6e,_0x542fab){_0x542fab=_0x542fab||0xc8;return function(_0x7caa07){if(_0x7caa07){return _0x2cea6e[_0x6b01('0x19')](_0x542fab)[_0x6b01('0x1b')](_0x7caa07);}};}function respondWithFilteredResult(_0x51243c,_0x399808){return function(_0x70a1c0){if(_0x70a1c0){var _0x304393=typeof _0x399808[_0x6b01('0x1c')]===_0x6b01('0x1d')&&typeof _0x399808[_0x6b01('0x1e')]===_0x6b01('0x1d');var _0x136452=_0x70a1c0[_0x6b01('0x1f')];var _0x152dda=_0x304393?0x0:_0x399808[_0x6b01('0x1c')];var _0xa846d8=_0x304393?_0x70a1c0[_0x6b01('0x1f')]:_0x399808['offset']+_0x399808[_0x6b01('0x1e')];var _0x220efb;if(_0xa846d8>=_0x136452){_0xa846d8=_0x136452;_0x220efb=0xc8;}else{_0x220efb=0xce;}_0x51243c[_0x6b01('0x19')](_0x220efb);return _0x51243c[_0x6b01('0x20')](_0x6b01('0x21'),_0x152dda+'-'+_0xa846d8+'/'+_0x136452)['json'](_0x70a1c0);}return null;};}function saveUpdates(_0x54f030){return function(_0x3fae61){if(_0x3fae61){return _0x3fae61[_0x6b01('0x22')](_0x54f030)[_0x6b01('0xf')](function(_0x8883d1){return _0x8883d1;});}return null;};}function removeEntity(_0x2a894e){return function(_0x25d38d){if(_0x25d38d){return _0x25d38d['destroy']()[_0x6b01('0xf')](function(){var _0x5482a8=_0x25d38d[_0x6b01('0x23')]({'plain':!![]});if(_0x5482a8['role']===_0x6b01('0x24'))return;var _0xa6b2b6=[{'name':_0x6b01('0x25'),'value':_0x6b01('0x26'),'ignore':!![]},{'name':_0x6b01('0x27'),'value':'agent','ignore':![]},{'name':_0x6b01('0x28'),'value':_0x6b01('0x29'),'ignore':![]}];var _0x3bb4b1=_(_0xa6b2b6)['filter']('ignore')[_0x6b01('0x2a')]('value')[_0x6b01('0x2b')]();if(_[_0x6b01('0x2c')](_0x3bb4b1,_0x5482a8[_0x6b01('0x2d')])){return;}var _0x536641=_[_0x6b01('0x2e')](_0xa6b2b6,[_0x6b01('0x2b'),_0x5482a8[_0x6b01('0x2d')]])['name'];return db[_0x6b01('0x2f')][_0x6b01('0x30')]({'where':{'type':_0x536641,'resourceId':_0x5482a8['id']}})[_0x6b01('0xf')](function(){return _0x25d38d;});})[_0x6b01('0xf')](function(){_0x2a894e[_0x6b01('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa041ea){return function(_0x20ee6d){if(!_0x20ee6d){_0xa041ea[_0x6b01('0x18')](0x194);}return _0x20ee6d;};}function handleError(_0x5269c7,_0xce4545){_0xce4545=_0xce4545||0x1f4;return function(_0xc644f2){logger[_0x6b01('0x13')](_0xc644f2[_0x6b01('0x31')]);if(_0xc644f2['name']){delete _0xc644f2[_0x6b01('0x32')];}_0x5269c7['status'](_0xce4545)[_0x6b01('0x33')](_0xc644f2);};}exports[_0x6b01('0x34')]=function(_0x1baac5,_0x318b8b){var _0x167d08={},_0x457c93={'count':0x0,'rows':[]};var _0x3df1d8=_(db['User'][_0x6b01('0x35')])[_0x6b01('0x2a')](function(_0x2c3385){return{'name':_0x2c3385[_0x6b01('0x36')],'type':_0x2c3385[_0x6b01('0x37')][_0x6b01('0x38')]};})[_0x6b01('0x39')](function(_0x44bf46){return!_['includes']([_0x6b01('0x3a'),'salt'],_0x44bf46[_0x6b01('0x32')]);})[_0x6b01('0x2b')]();_0x167d08=qs['getOptions'](_0x3df1d8,_0x1baac5);var _0x37ae5d={'where':_0x167d08[_0x6b01('0x3b')]};return db[_0x6b01('0x3c')][_0x6b01('0x1f')](_0x37ae5d)[_0x6b01('0xf')](function(_0x33a9ea){_0x457c93[_0x6b01('0x1f')]=_0x33a9ea;if(_0x1baac5[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x167d08[_0x6b01('0x3f')]=[{'all':!![]}];}if(!_['includes'](_0x167d08[_0x6b01('0x40')],'id')){_0x167d08[_0x6b01('0x40')]['push']('id');}return db['User'][_0x6b01('0x41')](_0x167d08);})[_0x6b01('0xf')](function(_0x558ec1){_0x457c93[_0x6b01('0x42')]=_0x558ec1;if(_0x1baac5[_0x6b01('0x3d')]['openTabs']===_0x6b01('0x43')){var _0x5e6f28=[];for(var _0x2ab117=0x0;_0x2ab117<_0x457c93[_0x6b01('0x42')][_0x6b01('0x44')];_0x2ab117++){_0x5e6f28['push'](get_open_tabs(_0x6b01('0x45'),_0x457c93[_0x6b01('0x42')][_0x2ab117]['dataValues']));_0x5e6f28['push'](get_open_tabs('sms',_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28['push'](get_open_tabs(_0x6b01('0x49'),_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x4a'),_0x457c93[_0x6b01('0x42')][_0x2ab117]['dataValues']));_0x5e6f28[_0x6b01('0x47')](get_open_tabs('whatsapp',_0x457c93['rows'][_0x2ab117][_0x6b01('0x46')]));}return BPromise[_0x6b01('0x4b')](_0x5e6f28)['then'](function(_0x408bb0){return _0x457c93;});}else{return _0x457c93;}})[_0x6b01('0xf')](respondWithFilteredResult(_0x318b8b,_0x167d08))[_0x6b01('0x17')](handleError(_0x318b8b,null));};exports['show']=function(_0x51eec0,_0x5545f6){var _0x24b860={'raw':![],'where':{'id':_0x51eec0['params']['id']}},_0x12160f={};_0x12160f[_0x6b01('0x4c')]=_['differenceBy'](_['keys'](db['User'][_0x6b01('0x35')]),[_0x6b01('0x3a'),'salt']);_0x12160f['query']=_[_0x6b01('0x4d')](_0x51eec0['query']);_0x12160f[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x12160f[_0x6b01('0x4c')],_0x12160f[_0x6b01('0x3d')]);_0x24b860[_0x6b01('0x40')]=_['intersection'](_0x12160f[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x51eec0[_0x6b01('0x3d')]['fields']));_0x24b860[_0x6b01('0x40')]=_0x24b860[_0x6b01('0x40')]['length']?_0x24b860[_0x6b01('0x40')]:_0x12160f[_0x6b01('0x4c')];if(_0x51eec0[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x24b860['include']=[{'all':!![]}];}_0x24b860=_['merge']({},_0x24b860,_0x51eec0[_0x6b01('0x51')]);if(!_['includes'](_0x24b860['attributes'],'id')){_0x24b860[_0x6b01('0x40')][_0x6b01('0x47')]('id');}return db['User'][_0x6b01('0x2e')](_0x24b860)[_0x6b01('0xf')](handleEntityNotFound(_0x5545f6,null))['then'](function(_0x1bd851){var _0x1ce46d=[];values=_0x1bd851;if(_0x51eec0[_0x6b01('0x3d')][_0x6b01('0x52')]===_0x6b01('0x43')){_0x1ce46d['push'](get_open_tabs(_0x6b01('0x45'),_0x1bd851['dataValues']));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x53'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d['push'](get_open_tabs(_0x6b01('0x4a'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x54'),_0x1bd851['dataValues']));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d['push'](get_open_tabs('mail',_0x1bd851[_0x6b01('0x46')]));return BPromise[_0x6b01('0x4b')](_0x1ce46d);}else{return values;}})[_0x6b01('0xf')](function(_0x4e1702){return values;})[_0x6b01('0xf')](respondWithResult(_0x5545f6,null))[_0x6b01('0x17')](handleError(_0x5545f6,null));};exports[_0x6b01('0x22')]=function(_0x5459d5,_0x54b3ae){if(_0x5459d5[_0x6b01('0x55')]['id']){delete _0x5459d5[_0x6b01('0x55')]['id'];}delete _0x5459d5['body'][_0x6b01('0x2d')];return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5459d5[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x54b3ae,null))[_0x6b01('0xf')](saveUpdates(_0x5459d5[_0x6b01('0x55')],null))[_0x6b01('0xf')](respondWithResult(_0x54b3ae,null))[_0x6b01('0x17')](handleError(_0x54b3ae,null));};exports['describe']=function(_0x2aa892,_0x204a9a){return db[_0x6b01('0x3c')][_0x6b01('0x57')]()[_0x6b01('0xf')](respondWithResult(_0x204a9a,null))[_0x6b01('0x17')](handleError(_0x204a9a,null));};exports[_0x6b01('0x58')]=function(_0x289294,_0x281e55){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x289294[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x281e55,null))[_0x6b01('0xf')](function(_0xef971f){if(_0xef971f){return _0xef971f[_0x6b01('0x58')](_0x289294['body']['ids'],_[_0x6b01('0x59')](_0x289294[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0x281e55,null))[_0x6b01('0x17')](handleError(_0x281e55,null));};function validateUser(_0x41e8dc){return new BPromise(function(_0x59bf90,_0x2bd87d){if(_0x41e8dc[_0x6b01('0x5b')])return _0x59bf90(_0x41e8dc);return db[_0x6b01('0x5c')][_0x6b01('0x5d')](0x1)[_0x6b01('0xf')](function(_0xf31bfa){if(_0xf31bfa[_0x6b01('0x5e')])authService['validatePasswordPattern'](_0x41e8dc[_0x6b01('0x3a')]);db['User'][_0x6b01('0x5f')](_0x6b01('0x5b'))[_0x6b01('0xf')](function(_0x48bfcd){if(_[_0x6b01('0x60')](_0x48bfcd)){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')]||0x1;return;}if(_[_0x6b01('0x60')](_0xf31bfa[_0x6b01('0x61')])||_0xf31bfa[_0x6b01('0x61')]===_0x48bfcd){_0x41e8dc[_0x6b01('0x5b')]=_0x48bfcd+0x1;return;}if(_0xf31bfa[_0x6b01('0x61')]>_0x48bfcd){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')];return;}return db[_0x6b01('0x62')][_0x6b01('0x3d')](_0x6b01('0x63'),{'type':db[_0x6b01('0x62')][_0x6b01('0x64')][_0x6b01('0x65')]})[_0x6b01('0xf')](function(_0x3f077f){if(_0x3f077f&&_0x3f077f[_0x6b01('0x44')]){for(var _0x4a8fcb=0x0,_0x27526f=_0x3f077f[_0x6b01('0x44')];_0x4a8fcb<_0x27526f&&_[_0x6b01('0x60')](_0x41e8dc[_0x6b01('0x5b')]);_0x4a8fcb++){if(_0xf31bfa[_0x6b01('0x61')]<=_0x3f077f[_0x4a8fcb][_0x6b01('0x66')]){_0x41e8dc[_0x6b01('0x5b')]=_0x3f077f[_0x4a8fcb][_0x6b01('0x66')];}else if(_0xf31bfa[_0x6b01('0x61')]>_0x3f077f[_0x4a8fcb][_0x6b01('0x66')]&&_0xf31bfa[_0x6b01('0x61')]<=_0x3f077f[_0x4a8fcb]['to']){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')];}}}if(_[_0x6b01('0x60')](_0x41e8dc[_0x6b01('0x5b')])){_0x41e8dc['internal']=_0x48bfcd+0x1;}return _0x59bf90(_0x41e8dc);});});})[_0x6b01('0x17')](function(_0x2d42ec){_0x2bd87d(_0x2d42ec);});});}function updateUser(_0x19a6d9){return new BPromise(function(_0x3ec668,_0x191348){try{if(_0x19a6d9[_0x6b01('0x67')]){_0x19a6d9[_0x6b01('0x68')]=_0x19a6d9[_0x6b01('0x5b')];_0x19a6d9[_0x6b01('0x69')]={'mailbox':_0x19a6d9[_0x6b01('0x5b')],'password':_0x19a6d9[_0x6b01('0x3a')],'fullname':_0x19a6d9[_0x6b01('0x6a')],'email':_0x19a6d9[_0x6b01('0x6b')]};}if(_0x19a6d9[_0x6b01('0x2d')]===_0x6b01('0x6c')){if(!_0x19a6d9[_0x6b01('0x6d')])_0x19a6d9[_0x6b01('0x6d')]=[_0x6b01('0x6e'),_0x6b01('0x6f'),_0x6b01('0x70'),'113','110','104','105',_0x6b01('0x71'),'107','108','109',_0x6b01('0x72'),'111',_0x6b01('0x73'),_0x6b01('0x74')];}_0x3ec668(_0x19a6d9);}catch(_0x44ac98){_0x191348(_0x44ac98);}});}exports[_0x6b01('0x75')]=function(_0x3bd5d3,_0x59f807){if(_0x3bd5d3['user'][_0x6b01('0x2d')]===_0x6b01('0x6c'))throw new Error(_0x6b01('0x76'));if(_0x3bd5d3['body'][_0x6b01('0x2d')]===_0x6b01('0x26')&&_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3bd5d3[_0x6b01('0x55')]['role']===_0x6b01('0x24')&&_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x77'));}return licenseUtil['checkUserLimits']([_0x3bd5d3[_0x6b01('0x55')]])[_0x6b01('0xf')](function(){return validateUser(_0x3bd5d3[_0x6b01('0x55')]);})[_0x6b01('0xf')](function(_0x4dbd69){return updateUser(_0x4dbd69)[_0x6b01('0xf')](function(_0x27c738){if(_0x27c738[_0x6b01('0x2d')]===_0x6b01('0x24')){_0x27c738[_0x6b01('0x78')]=_0x3bd5d3[_0x6b01('0x26')]['settingsEnabled'];delete _0x27c738['userProfileId'];}return _0x27c738;});})['then'](function(_0x16fa3b){return db[_0x6b01('0x3c')]['create'](_0x16fa3b,{'include':[{'model':db[_0x6b01('0x69')],'as':_0x6b01('0x69')}]});})[_0x6b01('0xf')](function(_0x2c2c1c){if(_0x3bd5d3['body'][_0x6b01('0x2d')]==='user')return _0x2c2c1c;if(_0x3bd5d3[_0x6b01('0x26')]['role']!==_0x6b01('0x26'))return _0x2c2c1c;return db['UserProfileSection'][_0x6b01('0x2e')]({'where':{'name':_0x2c2c1c[_0x6b01('0x2d')]===_0x6b01('0x6c')?_0x6b01('0x27'):_0x6b01('0x28'),'userProfileId':_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x79')]},'raw':!![]})['then'](function(_0xc8f10){if(!_0xc8f10||_0xc8f10['autoAssociation']!=0x0)return _0x2c2c1c;return db[_0x6b01('0x2f')][_0x6b01('0x75')]({'name':_0x2c2c1c[_0x6b01('0x32')],'resourceId':_0x2c2c1c['id'],'type':_0xc8f10[_0x6b01('0x32')],'sectionId':_0xc8f10['id']},{})[_0x6b01('0xf')](function(){return _0x2c2c1c;});})[_0x6b01('0x17')](function(_0x30ac0c){logger[_0x6b01('0x13')](_0x6b01('0x7a'),_0x30ac0c);throw _0x30ac0c;});})[_0x6b01('0xf')](respondWithResult(_0x59f807,0xc9))[_0x6b01('0x17')](handleError(_0x59f807,null));};exports['bulkCreate']=function(_0x1e9300,_0x4091a8){var _0x197c8d=_0x1e9300[_0x6b01('0x55')];var _0x5ac0b6=[];if(_0x1e9300[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x6c'))throw new Error(_0x6b01('0x76'));if(_[_0x6b01('0x7b')](_0x197c8d,['role',_0x6b01('0x26')])&&_0x1e9300['user'][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x7c'));}if(_[_0x6b01('0x7b')](_0x197c8d,[_0x6b01('0x2d'),_0x6b01('0x24')])&&_0x1e9300[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x7d'));}return licenseUtil[_0x6b01('0x7e')](_0x197c8d)[_0x6b01('0xf')](function(){return validateUser(_0x197c8d[0x0]);})[_0x6b01('0xf')](function(){for(var _0x748219=0x1;_0x748219<_0x197c8d['length'];_0x748219++){var _0x2f180=_0x197c8d[_0x748219-0x1]['internal'];if(!_0x197c8d[_0x748219]['internal'])_0x197c8d[_0x748219][_0x6b01('0x5b')]=_0x2f180+0x1;_0x5ac0b6[_0x6b01('0x47')](validateUser(_0x197c8d[_0x748219]));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);})[_0x6b01('0xf')](function(){_0x5ac0b6=[];for(var _0x5dc77c=0x0;_0x5dc77c<_0x197c8d[_0x6b01('0x44')];_0x5dc77c++){_0x5ac0b6[_0x6b01('0x47')](updateUser(_0x197c8d[_0x5dc77c]));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);})['then'](function(){return BPromise[_0x6b01('0x7f')](_0x197c8d,function(_0x327f31){return db[_0x6b01('0x3c')][_0x6b01('0x75')](_0x327f31,{'include':[{'model':db[_0x6b01('0x69')],'as':_0x6b01('0x69')}]})[_0x6b01('0xf')](function(_0x21b294){_0x327f31['id']=_0x21b294['id'];return _0x327f31;});});})['then'](function(_0x135aeb){if(_0x1e9300[_0x6b01('0x55')][_0x6b01('0x2d')]===_0x6b01('0x26'))return _0x135aeb;if(_0x1e9300['user']['role']!==_0x6b01('0x26'))return _0x135aeb;var _0x191fc0=_[_0x6b01('0x7b')](_0x135aeb,function(_0xcd8de3){return _0xcd8de3[_0x6b01('0x2d')]===_0x6b01('0x6c')||_0xcd8de3[_0x6b01('0x2d')]===_0x6b01('0x29');});if(!_0x191fc0)return _0x135aeb;return db['UserProfileSection'][_0x6b01('0x41')]({'where':{'name':{'$or':[_0x6b01('0x27'),_0x6b01('0x28')]},'userProfileId':_0x1e9300[_0x6b01('0x26')][_0x6b01('0x79')]},'raw':!![]})[_0x6b01('0xf')](function(_0x188010){if(_['isEmpty'](_0x188010)||!_[_0x6b01('0x7b')](_0x188010,['autoAssociation',0x0]))return _0x135aeb;_0x5ac0b6=[];var _0xe9de3b=_(_0x188010)[_0x6b01('0x2a')](function(_0x16f234){if(_0x16f234[_0x6b01('0x80')]===0x1)return;return _0x16f234[_0x6b01('0x32')]==='Agents'?_0x6b01('0x6c'):'telephone';})[_0x6b01('0x81')]()[_0x6b01('0x2b')]();for(var _0x59141e=0x0;_0x59141e<_0x135aeb[_0x6b01('0x44')];_0x59141e++){if(!_[_0x6b01('0x2c')](_0xe9de3b,_0x135aeb[_0x59141e][_0x6b01('0x2d')]))return;var _0x2cc3eb=_0x135aeb[_0x59141e][_0x6b01('0x2d')]==='agent'?'Agents':_0x6b01('0x28');_0x5ac0b6[_0x6b01('0x47')](db[_0x6b01('0x2f')][_0x6b01('0x75')]({'name':_0x135aeb[_0x59141e][_0x6b01('0x32')],'resourceId':_0x135aeb[_0x59141e]['id'],'type':_0x2cc3eb,'sectionId':_[_0x6b01('0x2e')](_0x188010,[_0x6b01('0x32'),_0x2cc3eb])['id']},{}));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);});})[_0x6b01('0xf')](respondWithResult(_0x4091a8,0xc9))['catch'](handleError(_0x4091a8,null));};exports[_0x6b01('0x82')]=function(_0x5ee5ed,_0x7ac756){if(_0x5ee5ed['body']['id']){delete _0x5ee5ed[_0x6b01('0x55')]['id'];}return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5ee5ed['params']['id']}})[_0x6b01('0xf')](function(_0xa9cd5f){if(!_0xa9cd5f)return null;if(_0xa9cd5f['id']===_0x5ee5ed[_0x6b01('0x26')]['id']){if(!_0x5ee5ed['body'][_0x6b01('0x83')]||!_0x5ee5ed[_0x6b01('0x55')]['newPassword']){throw new db[(_0x6b01('0x84'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xa9cd5f[_0x6b01('0x85')](_0x5ee5ed[_0x6b01('0x55')]['oldPassword'])){throw new db['Sequelize'][(_0x6b01('0x86'))]('Wrong\x20credentials');}if(_0x5ee5ed['body'][_0x6b01('0x83')]===_0x5ee5ed['body'][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x88'));}}else if(_0x5ee5ed[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x24')){if(!_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x89'));}}else if(_0x5ee5ed[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x26')){if(!_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x89'));}if(_0xa9cd5f[_0x6b01('0x2d')]!=='agent'){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x76'));}}else{throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x76'));}return _0xa9cd5f;})[_0x6b01('0xf')](handleEntityNotFound(_0x7ac756,null))[_0x6b01('0xf')](function(_0x5736fe){return db[_0x6b01('0x5c')][_0x6b01('0x8a')]({'attributes':['id','securePassword',_0x6b01('0x8b'),_0x6b01('0x8c')]})[_0x6b01('0xf')](function(_0x51f42e){if(_0x51f42e[_0x6b01('0x5e')])authService[_0x6b01('0x8d')](_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]);if(!_0x51f42e['enforcePasswordHistory']||!_0x5736fe['previousPasswords'])return _0x5736fe;authService[_0x6b01('0x8e')](_0x5ee5ed[_0x6b01('0x55')]['newPassword'],_0x5736fe[_0x6b01('0x8f')],_0x51f42e[_0x6b01('0x8c')]);return _0x5736fe;})[_0x6b01('0xf')](saveUpdates({'password':_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')],'passwordResetAt':_0x5ee5ed[_0x6b01('0x26')]['id']==_0x5ee5ed['params']['id']?moment():null,'previousPasswords':authService[_0x6b01('0x90')](_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')],_0x5736fe[_0x6b01('0x8f')])},null));})[_0x6b01('0xf')](respondWithResult(_0x7ac756,null))[_0x6b01('0x17')](handleError(_0x7ac756,null));};exports['addQueues']=function(_0x471015,_0x3db037){var _0x59cdd1=_0x471015[_0x6b01('0x55')][_0x6b01('0x91')];return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x471015[_0x6b01('0x56')]['id']},'attributes':['id','name',_0x6b01('0x2d'),_0x6b01('0x92'),_0x6b01('0x93'),_0x6b01('0x94'),_0x6b01('0x95')]})[_0x6b01('0xf')](handleEntityNotFound(_0x3db037,null))[_0x6b01('0xf')](function(_0x19167c){if(_0x19167c){if(!utils[_0x6b01('0x96')](_0x59cdd1)){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x97'));}return _0x19167c[_0x6b01('0x98')+_[_0x6b01('0x99')](_0x59cdd1[_0x6b01('0x9a')]())+'Queues'](_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')],{'penalty':_0x471015[_0x6b01('0x55')]['penalty']||0x0})[_0x6b01('0x9b')](function(_0x2877ea){for(var _0x424865=0x0;_0x424865<_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x424865+=0x1){var _0x4ade00={'UserId':Number(_0x471015['params']['id'])};_0x4ade00[_['capitalize'](_0x59cdd1['toLowerCase']())+_0x6b01('0x9c')]=Number(_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')][_0x424865]);socket['emit'](_0x6b01('0x26')+_['capitalize'](_0x59cdd1[_0x6b01('0x9a')]())+'Queue:save',_0x4ade00);}return _0x2877ea;})[_0x6b01('0xf')](function(){if(_0x59cdd1===_0x6b01('0x9d')){return db[_0x6b01('0x9e')][_0x6b01('0x41')]({'where':{'id':_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')]||[]},'raw':!![],'attributes':['id',_0x6b01('0x32')]});}})[_0x6b01('0xf')](function(_0x353f84){var _0x4ad87a=_0x19167c['get']({'plain':!![]});var _0x40aaaa=[];if(_0x59cdd1===_0x6b01('0x9d')&&_0x4ad87a[_0x6b01('0x2d')]==='agent'&&_0x4ad87a['online']){for(var _0x446b91=0x0;_0x446b91<_0x353f84['length'];_0x446b91+=0x1){_0x40aaaa[_0x6b01('0x47')]({'membername':_0x4ad87a[_0x6b01('0x32')],'UserId':_0x4ad87a['id'],'queue_name':_0x353f84[_0x446b91][_0x6b01('0x32')],'VoiceQueueId':_0x353f84[_0x446b91]['id'],'interface':_[_0x6b01('0x60')](_0x4ad87a[_0x6b01('0x95')])?util[_0x6b01('0x9f')](_0x6b01('0xa0'),_0x4ad87a[_0x6b01('0x32')]):_0x4ad87a[_0x6b01('0x95')],'paused':_0x4ad87a[_0x6b01('0x94')]||![],'penalty':_0x471015[_0x6b01('0x55')]['penalty']||0x0});}return BPromise[_0x6b01('0x7f')](_0x40aaaa,function(_0x52d6b4){return db['UserVoiceQueueRt']['upsert'](_0x52d6b4);});}return _0x19167c;});}})[_0x6b01('0xf')](respondWithStatusCode(_0x3db037,null))['catch'](handleError(_0x3db037,null));};exports[_0x6b01('0xa1')]=function(_0x33b13f,_0x3a8609){var _0x26aa9b;return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x33b13f[_0x6b01('0x56')]['id']},'attributes':['id',_0x6b01('0x32'),_0x6b01('0x2d')]})[_0x6b01('0xf')](handleEntityNotFound(_0x3a8609,null))[_0x6b01('0xf')](function(_0x14df77){if(_0x14df77){_0x26aa9b=_0x14df77;if(!_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')]||!utils[_0x6b01('0x96')](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')])){throw new db['Sequelize'][(_0x6b01('0x86'))]('Unknown\x20channel');}return _0x14df77[_0x6b01('0xa2')+_['capitalize'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')]['toLowerCase']())+'Queues'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})['then'](function(_0x34adde){if(_[_0x6b01('0xa3')](_0x33b13f[_0x6b01('0x3d')]['ids'])){for(var _0x5a7af0=0x0;_0x5a7af0<_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x5a7af0+=0x1){var _0x293fc0={'UserId':Number(_0x33b13f['params']['id'])};_0x293fc0[_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')][_0x6b01('0x9a')]())+'QueueId']=Number(_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x5a7af0]);socket[_0x6b01('0xa4')](_0x6b01('0x26')+_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')]['channel']['toLowerCase']())+'Queue:remove',_0x293fc0);}}else{var _0x293fc0={'UserId':Number(_0x33b13f['params']['id'])};_0x293fc0[_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')]['channel'][_0x6b01('0x9a')]())+_0x6b01('0x9c')]=Number(_0x33b13f['query'][_0x6b01('0x5a')]);socket['emit']('user'+_['capitalize'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')][_0x6b01('0x9a')]())+_0x6b01('0xa5'),_0x293fc0);}return _0x34adde;})['then'](function(){if(_0x33b13f['query'][_0x6b01('0x91')]===_0x6b01('0x9d')){return db[_0x6b01('0xa6')][_0x6b01('0x30')]({'where':{'UserId':_0x33b13f['params']['id'],'VoiceQueueId':_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')]},'individualHooks':!![]})[_0x6b01('0xf')](function(){return _0x26aa9b;});}return _0x26aa9b;})[_0x6b01('0xf')](respondWithStatusCode(_0x3a8609,null))[_0x6b01('0x17')](handleError(_0x3a8609,null));};exports['addAvatar']=function(_0x5175a7,_0x490a27){_0x5175a7['body'][_0x6b01('0xa7')]=_0x5175a7[_0x6b01('0xa8')][_0x6b01('0xa9')];return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x5175a7[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x490a27,null))[_0x6b01('0xf')](saveUpdates(_0x5175a7[_0x6b01('0x55')],null))[_0x6b01('0xf')](respondWithResult(_0x490a27,null))[_0x6b01('0x17')](handleError(_0x490a27,null));};exports['getAvatar']=function(_0x1b8867,_0x7e66c2){var _0x141cfc=path[_0x6b01('0xaa')](config[_0x6b01('0xab')],'server/files/images/logos/default_profile.png');return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x1b8867[_0x6b01('0x56')]['id']},'attributes':['id',_0x6b01('0xa7')],'raw':!![]})[_0x6b01('0xf')](handleEntityNotFound(_0x7e66c2,null))['then'](function(_0x34b8b4){if(_0x34b8b4){if(_[_0x6b01('0x60')](_0x34b8b4[_0x6b01('0xa7')])){return _0x7e66c2[_0x6b01('0xac')](_0x141cfc);}else{if(!fs[_0x6b01('0xad')](path['join'](config[_0x6b01('0xab')],'server/files/images/',_0x34b8b4[_0x6b01('0xa7')]))){return _0x7e66c2[_0x6b01('0xac')](_0x141cfc);}return _0x7e66c2['download'](path[_0x6b01('0xaa')](config[_0x6b01('0xab')],_0x6b01('0xae'),_0x34b8b4[_0x6b01('0xa7')]));}}})['catch'](handleError(_0x7e66c2,null));};exports[_0x6b01('0xaf')]=function(_0x2dcae8,_0x5bab46){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x2dcae8[_0x6b01('0x56')]['id']},'attributes':['id']})[_0x6b01('0xf')](handleEntityNotFound(_0x5bab46,null))[_0x6b01('0xf')](function(_0x45f78f){var _0x463454=[];values=_0x45f78f[_0x6b01('0x46')];_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x45'),_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs('sms',_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs('openchannel',_0x45f78f[_0x6b01('0x46')]));_0x463454['push'](get_open_tabs('whatsapp',_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x49'),_0x45f78f['dataValues']));return BPromise[_0x6b01('0x4b')](_0x463454);})['then'](function(_0x1b2744){var _0x24d53f=[];if(_0x1b2744){for(var _0x3f782a=0x0;_0x3f782a<values[_0x6b01('0xb0')][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xb0')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':_0x6b01('0xb1'),'id':_0x3ebed7['id'],'createdAt':_0x3ebed7['createdAt']});}for(var _0x3f782a=0x0;_0x3f782a<values['FaxOpenTabs'][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xb2')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':_0x6b01('0xb3'),'id':_0x3ebed7['id'],'createdAt':_0x3ebed7['createdAt']});}for(var _0x3f782a=0x0;_0x3f782a<values[_0x6b01('0xb4')][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xb4')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':_0x6b01('0xb5'),'id':_0x3ebed7['id'],'createdAt':_0x3ebed7[_0x6b01('0xb6')]});}for(var _0x3f782a=0x0;_0x3f782a<values[_0x6b01('0xb7')][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xb7')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':'MAIL','id':_0x3ebed7['id'],'createdAt':_0x3ebed7[_0x6b01('0xb6')]});}for(var _0x3f782a=0x0;_0x3f782a<values[_0x6b01('0xb8')][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xb8')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':_0x6b01('0xb9'),'id':_0x3ebed7['id'],'createdAt':_0x3ebed7[_0x6b01('0xb6')]});}for(var _0x3f782a=0x0;_0x3f782a<values['WhatsappOpenTabs'][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xba')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':_0x6b01('0xbb'),'id':_0x3ebed7['id'],'createdAt':_0x3ebed7[_0x6b01('0xb6')]});}var _0x4c8fa2={'count':_0x24d53f['length'],'rows':_0x24d53f};return _0x4c8fa2;}else return null;})[_0x6b01('0xf')](respondWithResult(_0x5bab46,null))['catch'](handleError(_0x5bab46,null));};exports['getContacts']=function(_0x33af83,_0x16f282){var _0x50e989={};var _0x4fb4b0={};var _0x116fe2;var _0x50dfe8;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x33af83['params']['id']}})['then'](handleEntityNotFound(_0x16f282,null))[_0x6b01('0xf')](function(_0x429a72){if(_0x429a72){_0x116fe2=_0x429a72;_0x4fb4b0['model']=_[_0x6b01('0x4d')](db[_0x6b01('0xbc')]['rawAttributes']);_0x4fb4b0['query']=_[_0x6b01('0x4d')](_0x33af83['query']);_0x4fb4b0[_0x6b01('0x4e')]=_['intersection'](_0x4fb4b0[_0x6b01('0x4c')],_0x4fb4b0[_0x6b01('0x3d')]);_0x50e989[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x4fb4b0[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x33af83['query'][_0x6b01('0x50')]));_0x50e989[_0x6b01('0x40')]=_0x50e989[_0x6b01('0x40')][_0x6b01('0x44')]?_0x50e989['attributes']:_0x4fb4b0['model'];_0x50e989['order']=qs[_0x6b01('0xbd')](_0x33af83[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x50e989['where']=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x33af83[_0x6b01('0x3d')],_0x4fb4b0[_0x6b01('0x4e')]));if(_0x33af83[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x50e989[_0x6b01('0x3b')]=_['merge'](_0x50e989[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x50e989['attributes'],function(_0x40d4b1){var _0x4ff689={};_0x4ff689[_0x40d4b1]={'$like':'%'+_0x33af83[_0x6b01('0x3d')]['filter']+'%'};return _0x4ff689;})});}_0x50e989=_[_0x6b01('0xbf')]({},_0x50e989,_0x33af83[_0x6b01('0x51')]);return _0x116fe2['getContacts'](_0x50e989);}})['then'](function(_0x5315e5){if(_0x5315e5){_0x50dfe8=_0x5315e5['length'];if(_0x33af83[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0x3e'))){_0x50e989['include']=[{'model':db[_0x6b01('0xc1')],'as':'List','required':![]},{'model':db['Tag'],'as':_0x6b01('0xc2'),'attributes':['id',_0x6b01('0x32'),_0x6b01('0xc3')],'where':_0x33af83[_0x6b01('0x3d')][_0x6b01('0xc4')]?{'id':_0x33af83[_0x6b01('0x3d')]['tag']}:undefined,'required':_0x33af83[_0x6b01('0x3d')][_0x6b01('0xc4')]?!![]:![]}];}if(!_0x33af83[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x50e989[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x33af83[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x50e989['offset']=qs[_0x6b01('0x1c')](_0x33af83[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x116fe2[_0x6b01('0xc6')](_0x50e989);}})[_0x6b01('0xf')](function(_0x2ac926){if(_0x2ac926){return _0x2ac926?{'count':_0x50dfe8,'rows':_0x2ac926}:null;}})['then'](respondWithResult(_0x16f282,null))[_0x6b01('0x17')](handleError(_0x16f282,null));};exports['getQueues']=function(_0x190fe0,_0xf3f67f){var _0x208578;var _0x372e33;var _0x2ab981={};var _0x13d3a1;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x190fe0['params']['id']},'attributes':['id',_0x6b01('0x32'),_0x6b01('0x2d')]})['then'](handleEntityNotFound(_0xf3f67f,null))[_0x6b01('0xf')](function(_0x3a8afa){if(!utils[_0x6b01('0x96')](_0x190fe0['query'][_0x6b01('0x91')])){throw new db[(_0x6b01('0x84'))]['ValidationError'](_0x6b01('0x97'));}_0x208578=_0x3a8afa;var _0x268688={};_0x268688[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_[_0x6b01('0x99')](_0x190fe0['query'][_0x6b01('0x91')])+'Queue']['rawAttributes']);_0x268688['query']=_[_0x6b01('0x4d')](_0x190fe0['query']);_0x268688[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x268688[_0x6b01('0x4c')],_0x268688[_0x6b01('0x3d')]);_0x2ab981[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x268688[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x190fe0[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x2ab981[_0x6b01('0x40')]=_0x2ab981[_0x6b01('0x40')][_0x6b01('0x44')]?_0x2ab981[_0x6b01('0x40')]:_0x268688[_0x6b01('0x4c')];_0x2ab981[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x190fe0[_0x6b01('0x3d')]['sort']);_0x2ab981[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x190fe0[_0x6b01('0x3d')],_0x268688[_0x6b01('0x4e')]));if(_0x190fe0[_0x6b01('0x3d')]['filter']){_0x2ab981['where']=_['merge'](_0x2ab981[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x2ab981['attributes'],function(_0x2f8fff){var _0x47d66d={};_0x47d66d[_0x2f8fff]={'$like':'%'+_0x190fe0[_0x6b01('0x3d')]['filter']+'%'};return _0x47d66d;})});}_0x2ab981=_['merge']({},_0x2ab981,_0x190fe0['options']);switch(_0x208578[_0x6b01('0x2d')]){case _0x6b01('0x24'):return db[_['capitalize'](_0x190fe0['query'][_0x6b01('0x91')])+_0x6b01('0xc8')][_0x6b01('0x41')](_0x2ab981);case _0x6b01('0x26'):case'agent':return _0x208578[_0x6b01('0x23')+_[_0x6b01('0x99')](_0x190fe0[_0x6b01('0x3d')][_0x6b01('0x91')])+_0x6b01('0xc9')](_0x2ab981);default:throw new db['Sequelize'][(_0x6b01('0x86'))](_0x6b01('0xca'));}})[_0x6b01('0xf')](function(_0x44ca62){_0x13d3a1=_0x44ca62[_0x6b01('0x44')];if(!_0x190fe0[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x2ab981[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x190fe0[_0x6b01('0x3d')]['limit']);_0x2ab981['offset']=qs[_0x6b01('0x1c')](_0x190fe0['query'][_0x6b01('0x1c')]);}switch(_0x208578[_0x6b01('0x2d')]){case _0x6b01('0x24'):return db[_[_0x6b01('0x99')](_0x190fe0[_0x6b01('0x3d')][_0x6b01('0x91')])+_0x6b01('0xc8')]['findAll'](_0x2ab981);case _0x6b01('0x26'):case _0x6b01('0x6c'):return _0x208578[_0x6b01('0x23')+_[_0x6b01('0x99')](_0x190fe0[_0x6b01('0x3d')][_0x6b01('0x91')])+_0x6b01('0xc9')](_0x2ab981);}})[_0x6b01('0xf')](function(_0x51df93){return{'count':_0x13d3a1,'rows':_0x51df93};})[_0x6b01('0xf')](respondWithResult(_0xf3f67f,null))['catch'](handleError(_0xf3f67f,null));};exports['getVoiceQueuesRt']=function(_0x42f5b2,_0xc2d596){var _0x579eef={};var _0x48ccea={};var _0x1fae57;var _0x1f446d;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x42f5b2[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0xc2d596,null))[_0x6b01('0xf')](function(_0x71796b){if(_0x71796b){_0x1fae57=_0x71796b;_0x48ccea[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db['UserVoiceQueueRt'][_0x6b01('0x35')]);_0x48ccea[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x42f5b2[_0x6b01('0x3d')]);_0x48ccea[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x48ccea[_0x6b01('0x4c')],_0x48ccea[_0x6b01('0x3d')]);_0x579eef[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x48ccea['model'],qs[_0x6b01('0x50')](_0x42f5b2[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x579eef['attributes']=_0x579eef[_0x6b01('0x40')][_0x6b01('0x44')]?_0x579eef[_0x6b01('0x40')]:_0x48ccea['model'];_0x579eef[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x42f5b2['query'][_0x6b01('0xbd')]);_0x579eef[_0x6b01('0x3b')]=qs['filters'](_[_0x6b01('0xbe')](_0x42f5b2[_0x6b01('0x3d')],_0x48ccea[_0x6b01('0x4e')]));if(_0x42f5b2[_0x6b01('0x3d')]['filter']){_0x579eef['where']=_['merge'](_0x579eef[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x579eef[_0x6b01('0x40')],function(_0x27e22f){var _0x32d70b={};_0x32d70b[_0x27e22f]={'$like':'%'+_0x42f5b2[_0x6b01('0x3d')]['filter']+'%'};return _0x32d70b;})});}_0x579eef=_[_0x6b01('0xbf')]({},_0x579eef,_0x42f5b2[_0x6b01('0x51')]);return _0x1fae57[_0x6b01('0xcb')](_0x579eef);}})[_0x6b01('0xf')](function(_0x40a8cd){if(_0x40a8cd){_0x1f446d=_0x40a8cd['length'];if(!_0x42f5b2[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x579eef['limit']=qs['limit'](_0x42f5b2[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x579eef[_0x6b01('0x1c')]=qs['offset'](_0x42f5b2['query'][_0x6b01('0x1c')]);}return _0x1fae57[_0x6b01('0xcb')](_0x579eef);}})[_0x6b01('0xf')](function(_0x101150){if(_0x101150){return _0x101150?{'count':_0x1f446d,'rows':_0x101150}:null;}})[_0x6b01('0xf')](respondWithResult(_0xc2d596,null))[_0x6b01('0x17')](handleError(_0xc2d596,null));};exports[_0x6b01('0xcc')]=function(_0x32bf17,_0x5dc56b){var _0x25654a={};var _0x4922ba={};var _0x475e73;var _0x53e745;return db['User']['findOne']({'where':{'id':_0x32bf17['params']['id']}})['then'](handleEntityNotFound(_0x5dc56b,null))['then'](function(_0x1fb150){if(_0x1fb150){_0x475e73=_0x1fb150;_0x4922ba[_0x6b01('0x4c')]=_['keys'](db[_0x6b01('0xcd')][_0x6b01('0x35')]);_0x4922ba[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x32bf17[_0x6b01('0x3d')]);_0x4922ba[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x4922ba[_0x6b01('0x4c')],_0x4922ba[_0x6b01('0x3d')]);_0x25654a[_0x6b01('0x40')]=_['intersection'](_0x4922ba[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x32bf17[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x25654a[_0x6b01('0x40')]=_0x25654a[_0x6b01('0x40')][_0x6b01('0x44')]?_0x25654a[_0x6b01('0x40')]:_0x4922ba['model'];_0x25654a['order']=qs[_0x6b01('0xbd')](_0x32bf17[_0x6b01('0x3d')]['sort']);_0x25654a[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x32bf17[_0x6b01('0x3d')],_0x4922ba[_0x6b01('0x4e')]));if(_0x32bf17['query'][_0x6b01('0x39')]){_0x25654a[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x25654a[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x25654a['attributes'],function(_0x3d555e){var _0xffba5d={};_0xffba5d[_0x3d555e]={'$like':'%'+_0x32bf17['query']['filter']+'%'};return _0xffba5d;})});}_0x25654a=_[_0x6b01('0xbf')]({},_0x25654a,_0x32bf17[_0x6b01('0x51')]);return _0x475e73[_0x6b01('0xcc')](_0x25654a);}})[_0x6b01('0xf')](function(_0x5a6b33){if(_0x5a6b33){_0x53e745=_0x5a6b33['length'];if(!_0x32bf17[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x25654a['limit']=qs['limit'](_0x32bf17['query'][_0x6b01('0x1e')]);_0x25654a['offset']=qs[_0x6b01('0x1c')](_0x32bf17[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x475e73[_0x6b01('0xcc')](_0x25654a);}})[_0x6b01('0xf')](function(_0x8984ca){if(_0x8984ca){return _0x8984ca?{'count':_0x53e745,'rows':_0x8984ca}:null;}})[_0x6b01('0xf')](respondWithResult(_0x5dc56b,null))[_0x6b01('0x17')](handleError(_0x5dc56b,null));};exports[_0x6b01('0xce')]=function(_0x32dd85,_0x70740f){var _0x5076ba={'raw':!![],'where':{}};var _0x2a67ac={};var _0x43be16={'count':0x0,'rows':[]};return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x32dd85['params']['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x70740f,null))[_0x6b01('0xf')](function(_0x43dcdd){if(_0x43dcdd){_0x2a67ac['model']=_[_0x6b01('0x4d')](db[_0x6b01('0xcf')][_0x6b01('0x35')]);_0x2a67ac[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x32dd85[_0x6b01('0x3d')]);_0x2a67ac['filters']=_['intersection'](_0x2a67ac[_0x6b01('0x4c')],_0x2a67ac[_0x6b01('0x3d')]);_0x5076ba[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x2a67ac[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x32dd85[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x5076ba['attributes']=_0x5076ba[_0x6b01('0x40')][_0x6b01('0x44')]?_0x5076ba[_0x6b01('0x40')]:_0x2a67ac[_0x6b01('0x4c')];if(!_0x32dd85[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x5076ba[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x32dd85['query'][_0x6b01('0x1e')]);_0x5076ba[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x32dd85[_0x6b01('0x3d')][_0x6b01('0x1c')]);}_0x5076ba[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x32dd85['query'][_0x6b01('0xbd')]);_0x5076ba[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x32dd85['query'],_0x2a67ac[_0x6b01('0x4e')]));_0x5076ba[_0x6b01('0x3b')][_0x6b01('0xd0')]=_0x43dcdd['id'];if(_0x32dd85[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x5076ba[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x5076ba[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x5076ba[_0x6b01('0x40')],function(_0x1f4aa9){var _0x2e1205={};_0x2e1205[_0x1f4aa9]={'$like':'%'+_0x32dd85['query']['filter']+'%'};return _0x2e1205;})});}_0x5076ba=_[_0x6b01('0xbf')]({},_0x5076ba,_0x32dd85[_0x6b01('0x51')]);return db[_0x6b01('0xcf')][_0x6b01('0x1f')]({'where':_0x5076ba[_0x6b01('0x3b')]})['then'](function(_0x3120dc){_0x43be16[_0x6b01('0x1f')]=_0x3120dc;if(_0x32dd85['query']['includeAll']){_0x5076ba[_0x6b01('0x3f')]=[{'all':!![]}];}return db[_0x6b01('0xcf')][_0x6b01('0x41')](_0x5076ba);})[_0x6b01('0xf')](function(_0x2fe71e){_0x43be16[_0x6b01('0x42')]=_0x2fe71e;return _0x43be16;});}})[_0x6b01('0xf')](respondWithFilteredResult(_0x70740f,_0x5076ba))[_0x6b01('0x17')](handleError(_0x70740f,null));};exports[_0x6b01('0xd1')]=function(_0x34fbcf,_0x196121){var _0x442c1a={'raw':!![],'where':{}};var _0x3db8c7={};var _0x267d16={'count':0x0,'rows':[]};return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x34fbcf[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x196121,null))[_0x6b01('0xf')](function(_0x1f6d59){if(_0x1f6d59){_0x3db8c7[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0xd2')][_0x6b01('0x35')]);_0x3db8c7['query']=_['keys'](_0x34fbcf[_0x6b01('0x3d')]);_0x3db8c7[_0x6b01('0x4e')]=_['intersection'](_0x3db8c7['model'],_0x3db8c7[_0x6b01('0x3d')]);_0x442c1a[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x3db8c7['model'],qs[_0x6b01('0x50')](_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x442c1a[_0x6b01('0x40')]=_0x442c1a['attributes'][_0x6b01('0x44')]?_0x442c1a[_0x6b01('0x40')]:_0x3db8c7['model'];if(!_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x442c1a[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x442c1a[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x1c')]);}_0x442c1a[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x34fbcf['query'][_0x6b01('0xbd')]);_0x442c1a['where']=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x34fbcf[_0x6b01('0x3d')],_0x3db8c7[_0x6b01('0x4e')]));_0x442c1a[_0x6b01('0x3b')][_0x6b01('0xd0')]=_0x1f6d59['id'];if(_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x442c1a[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x442c1a['where'],{'$or':_[_0x6b01('0x2a')](_0x442c1a[_0x6b01('0x40')],function(_0x5edbe7){var _0x14f5fb={};_0x14f5fb[_0x5edbe7]={'$like':'%'+_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x14f5fb;})});}_0x442c1a=_[_0x6b01('0xbf')]({},_0x442c1a,_0x34fbcf[_0x6b01('0x51')]);return db[_0x6b01('0xd2')][_0x6b01('0x1f')]({'where':_0x442c1a[_0x6b01('0x3b')]})['then'](function(_0x4795ce){_0x267d16[_0x6b01('0x1f')]=_0x4795ce;if(_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x442c1a[_0x6b01('0x3f')]=[{'all':!![]}];}return db[_0x6b01('0xd2')][_0x6b01('0x41')](_0x442c1a);})[_0x6b01('0xf')](function(_0x10b5d9){_0x267d16[_0x6b01('0x42')]=_0x10b5d9;return _0x267d16;});}})[_0x6b01('0xf')](respondWithFilteredResult(_0x196121,_0x442c1a))['catch'](handleError(_0x196121,null));};exports[_0x6b01('0xd3')]=function(_0x40d03a,_0x365441){var _0x405825={};var _0x53549c={};var _0x5db0f3;var _0xa03302;return db['User']['findOne']({'where':{'id':_0x40d03a[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x365441,null))[_0x6b01('0xf')](function(_0x1f037c){if(_0x1f037c){_0x5db0f3=_0x1f037c;_0x53549c[_0x6b01('0x4c')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x53549c['query']=_[_0x6b01('0x4d')](_0x40d03a[_0x6b01('0x3d')]);_0x53549c['filters']=_[_0x6b01('0x4f')](_0x53549c[_0x6b01('0x4c')],_0x53549c['query']);_0x405825[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x53549c[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x40d03a['query']['fields']));_0x405825[_0x6b01('0x40')]=_0x405825[_0x6b01('0x40')][_0x6b01('0x44')]?_0x405825[_0x6b01('0x40')]:_0x53549c[_0x6b01('0x4c')];_0x405825[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x40d03a[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x405825[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x40d03a[_0x6b01('0x3d')],_0x53549c[_0x6b01('0x4e')]));if(_0x40d03a[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x405825[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x405825[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x405825['attributes'],function(_0x1a7590){var _0x4a70a4={};_0x4a70a4[_0x1a7590]={'$like':'%'+_0x40d03a['query'][_0x6b01('0x39')]+'%'};return _0x4a70a4;})});}_0x405825=_[_0x6b01('0xbf')]({},_0x405825,_0x40d03a['options']);return _0x5db0f3['getChatInteractions'](_0x405825);}})[_0x6b01('0xf')](function(_0x50d732){if(_0x50d732){_0xa03302=_0x50d732['length'];if(!_0x40d03a['query'][_0x6b01('0xc0')]('nolimit')){_0x405825[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x40d03a[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x405825[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x40d03a[_0x6b01('0x3d')]['offset']);}return _0x5db0f3['getChatInteractions'](_0x405825);}})['then'](function(_0x237ed2){if(_0x237ed2){return _0x237ed2?{'count':_0xa03302,'rows':_0x237ed2}:null;}})[_0x6b01('0xf')](respondWithResult(_0x365441,null))['catch'](handleError(_0x365441,null));};exports['getOpenchannelInteractions']=function(_0x24e3f1,_0xb5df82){var _0x231e29={};var _0x36e2f6={};var _0x1d1434;var _0x585516;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x24e3f1[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0xb5df82,null))[_0x6b01('0xf')](function(_0x7c1bc){if(_0x7c1bc){_0x1d1434=_0x7c1bc;_0x36e2f6['model']=_[_0x6b01('0x4d')](db[_0x6b01('0xd4')]['rawAttributes']);_0x36e2f6['query']=_[_0x6b01('0x4d')](_0x24e3f1['query']);_0x36e2f6[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x36e2f6['model'],_0x36e2f6[_0x6b01('0x3d')]);_0x231e29[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x36e2f6[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x231e29[_0x6b01('0x40')]=_0x231e29['attributes'][_0x6b01('0x44')]?_0x231e29['attributes']:_0x36e2f6[_0x6b01('0x4c')];_0x231e29['order']=qs[_0x6b01('0xbd')](_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x231e29[_0x6b01('0x3b')]=qs['filters'](_[_0x6b01('0xbe')](_0x24e3f1[_0x6b01('0x3d')],_0x36e2f6['filters']));if(_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x231e29['where']=_[_0x6b01('0xbf')](_0x231e29[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x231e29[_0x6b01('0x40')],function(_0x3c5483){var _0x3d9891={};_0x3d9891[_0x3c5483]={'$like':'%'+_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x3d9891;})});}_0x231e29=_[_0x6b01('0xbf')]({},_0x231e29,_0x24e3f1[_0x6b01('0x51')]);return _0x1d1434[_0x6b01('0xd5')](_0x231e29);}})[_0x6b01('0xf')](function(_0x705e47){if(_0x705e47){_0x585516=_0x705e47[_0x6b01('0x44')];if(!_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x231e29[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x231e29[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x1d1434[_0x6b01('0xd5')](_0x231e29);}})['then'](function(_0x85328e){if(_0x85328e){return _0x85328e?{'count':_0x585516,'rows':_0x85328e}:null;}})[_0x6b01('0xf')](respondWithResult(_0xb5df82,null))['catch'](handleError(_0xb5df82,null));};exports[_0x6b01('0xd6')]=function(_0x113e6a,_0x1cbf86){var _0x7ea009={'raw':!![],'where':{}};var _0x363004={};var _0x254046={'count':0x0,'rows':[]};return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x113e6a[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x1cbf86,null))[_0x6b01('0xf')](function(_0x11f3d7){if(_0x11f3d7){_0x363004[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0xd7')]['rawAttributes']);_0x363004[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x113e6a['query']);_0x363004[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x363004['model'],_0x363004['query']);_0x7ea009[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x363004['model'],qs[_0x6b01('0x50')](_0x113e6a[_0x6b01('0x3d')]['fields']));_0x7ea009[_0x6b01('0x40')]=_0x7ea009[_0x6b01('0x40')][_0x6b01('0x44')]?_0x7ea009[_0x6b01('0x40')]:_0x363004[_0x6b01('0x4c')];if(!_0x113e6a['query'][_0x6b01('0xc0')]('nolimit')){_0x7ea009['limit']=qs['limit'](_0x113e6a[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x7ea009[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x113e6a[_0x6b01('0x3d')][_0x6b01('0x1c')]);}_0x7ea009[_0x6b01('0xc7')]=qs['sort'](_0x113e6a[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x7ea009[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_['pick'](_0x113e6a[_0x6b01('0x3d')],_0x363004[_0x6b01('0x4e')]));_0x7ea009[_0x6b01('0x3b')]['UserId']=_0x11f3d7['id'];if(_0x113e6a[_0x6b01('0x3d')]['filter']){_0x7ea009[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x7ea009[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x7ea009[_0x6b01('0x40')],function(_0xc092ee){var _0x1a8ac5={};_0x1a8ac5[_0xc092ee]={'$like':'%'+_0x113e6a[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x1a8ac5;})});}_0x7ea009=_[_0x6b01('0xbf')]({},_0x7ea009,_0x113e6a['options']);return db[_0x6b01('0xd7')][_0x6b01('0x1f')]({'where':_0x7ea009[_0x6b01('0x3b')]})[_0x6b01('0xf')](function(_0x2f7caf){_0x254046[_0x6b01('0x1f')]=_0x2f7caf;if(_0x113e6a[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x7ea009[_0x6b01('0x3f')]=[{'all':!![]}];}return db[_0x6b01('0xd7')][_0x6b01('0x41')](_0x7ea009);})[_0x6b01('0xf')](function(_0x22b5e7){_0x254046['rows']=_0x22b5e7;return _0x254046;});}})[_0x6b01('0xf')](respondWithFilteredResult(_0x1cbf86,_0x7ea009))[_0x6b01('0x17')](handleError(_0x1cbf86,null));};exports[_0x6b01('0xd8')]=function(_0x4c442e,_0x406047){var _0xbd0475={};var _0x201523={};var _0x74ab81;var _0x5d6d8b;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x4c442e[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x406047,null))['then'](function(_0x351ca9){if(_0x351ca9){_0x74ab81=_0x351ca9;_0x201523['model']=_[_0x6b01('0x4d')](db[_0x6b01('0xd9')][_0x6b01('0x35')]);_0x201523[_0x6b01('0x3d')]=_['keys'](_0x4c442e['query']);_0x201523['filters']=_['intersection'](_0x201523[_0x6b01('0x4c')],_0x201523['query']);_0xbd0475[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x201523['model'],qs['fields'](_0x4c442e[_0x6b01('0x3d')][_0x6b01('0x50')]));_0xbd0475[_0x6b01('0x40')]=_0xbd0475[_0x6b01('0x40')][_0x6b01('0x44')]?_0xbd0475[_0x6b01('0x40')]:_0x201523[_0x6b01('0x4c')];_0xbd0475[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x4c442e['query'][_0x6b01('0xbd')]);_0xbd0475[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x4c442e[_0x6b01('0x3d')],_0x201523[_0x6b01('0x4e')]));if(_0x4c442e['query'][_0x6b01('0x39')]){_0xbd0475[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0xbd0475['where'],{'$or':_[_0x6b01('0x2a')](_0xbd0475[_0x6b01('0x40')],function(_0xa5405e){var _0x4d9e87={};_0x4d9e87[_0xa5405e]={'$like':'%'+_0x4c442e[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x4d9e87;})});}_0xbd0475=_[_0x6b01('0xbf')]({},_0xbd0475,_0x4c442e[_0x6b01('0x51')]);return _0x74ab81['getSmsInteractions'](_0xbd0475);}})['then'](function(_0x36dff4){if(_0x36dff4){_0x5d6d8b=_0x36dff4[_0x6b01('0x44')];if(!_0x4c442e['query']['hasOwnProperty'](_0x6b01('0xc5'))){_0xbd0475[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x4c442e['query'][_0x6b01('0x1e')]);_0xbd0475[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x4c442e[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x74ab81[_0x6b01('0xd8')](_0xbd0475);}})[_0x6b01('0xf')](function(_0x5eda2c){if(_0x5eda2c){return _0x5eda2c?{'count':_0x5d6d8b,'rows':_0x5eda2c}:null;}})['then'](respondWithResult(_0x406047,null))['catch'](handleError(_0x406047,null));};exports[_0x6b01('0xda')]=function(_0x292da0,_0x4a76cf){var _0x4e65f6={};var _0x109aa6={};var _0x449656;var _0x2be26b;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x292da0[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x4a76cf,null))[_0x6b01('0xf')](function(_0x59d1da){if(_0x59d1da){_0x449656=_0x59d1da;_0x109aa6['model']=_[_0x6b01('0x4d')](db['FaxInteraction'][_0x6b01('0x35')]);_0x109aa6['query']=_['keys'](_0x292da0['query']);_0x109aa6[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x109aa6[_0x6b01('0x4c')],_0x109aa6[_0x6b01('0x3d')]);_0x4e65f6[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x109aa6[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x292da0[_0x6b01('0x3d')]['fields']));_0x4e65f6[_0x6b01('0x40')]=_0x4e65f6['attributes'][_0x6b01('0x44')]?_0x4e65f6[_0x6b01('0x40')]:_0x109aa6[_0x6b01('0x4c')];_0x4e65f6[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x292da0[_0x6b01('0x3d')]['sort']);_0x4e65f6[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x292da0[_0x6b01('0x3d')],_0x109aa6[_0x6b01('0x4e')]));if(_0x292da0[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x4e65f6[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x4e65f6['where'],{'$or':_[_0x6b01('0x2a')](_0x4e65f6['attributes'],function(_0x54c715){var _0x5f29ec={};_0x5f29ec[_0x54c715]={'$like':'%'+_0x292da0[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x5f29ec;})});}_0x4e65f6=_[_0x6b01('0xbf')]({},_0x4e65f6,_0x292da0[_0x6b01('0x51')]);return _0x449656[_0x6b01('0xda')](_0x4e65f6);}})[_0x6b01('0xf')](function(_0xa336c4){if(_0xa336c4){_0x2be26b=_0xa336c4['length'];if(!_0x292da0[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x4e65f6['limit']=qs[_0x6b01('0x1e')](_0x292da0['query']['limit']);_0x4e65f6[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x292da0['query'][_0x6b01('0x1c')]);}return _0x449656[_0x6b01('0xda')](_0x4e65f6);}})[_0x6b01('0xf')](function(_0x3b2c83){if(_0x3b2c83){return _0x3b2c83?{'count':_0x2be26b,'rows':_0x3b2c83}:null;}})['then'](respondWithResult(_0x4a76cf,null))[_0x6b01('0x17')](handleError(_0x4a76cf,null));};exports['getWhatsappInteractions']=function(_0xdfebea,_0xcf34ce){var _0x485f21={};var _0x312f51={};var _0x483409;var _0x114ca3;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0xdfebea[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0xcf34ce,null))[_0x6b01('0xf')](function(_0x36dcb9){if(_0x36dcb9){_0x483409=_0x36dcb9;_0x312f51[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0xdb')][_0x6b01('0x35')]);_0x312f51[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0xdfebea[_0x6b01('0x3d')]);_0x312f51[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x312f51[_0x6b01('0x4c')],_0x312f51['query']);_0x485f21[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x312f51[_0x6b01('0x4c')],qs['fields'](_0xdfebea[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x485f21['attributes']=_0x485f21[_0x6b01('0x40')][_0x6b01('0x44')]?_0x485f21['attributes']:_0x312f51[_0x6b01('0x4c')];_0x485f21[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0xdfebea[_0x6b01('0x3d')]['sort']);_0x485f21[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_['pick'](_0xdfebea[_0x6b01('0x3d')],_0x312f51[_0x6b01('0x4e')]));if(_0xdfebea[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x485f21['where']=_[_0x6b01('0xbf')](_0x485f21['where'],{'$or':_['map'](_0x485f21[_0x6b01('0x40')],function(_0x4e9460){var _0x2d50c2={};_0x2d50c2[_0x4e9460]={'$like':'%'+_0xdfebea[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x2d50c2;})});}_0x485f21=_[_0x6b01('0xbf')]({},_0x485f21,_0xdfebea['options']);return _0x483409['getWhatsappInteractions'](_0x485f21);}})[_0x6b01('0xf')](function(_0x386c8a){if(_0x386c8a){_0x114ca3=_0x386c8a[_0x6b01('0x44')];if(!_0xdfebea[_0x6b01('0x3d')][_0x6b01('0xc0')]('nolimit')){_0x485f21[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0xdfebea[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x485f21['offset']=qs[_0x6b01('0x1c')](_0xdfebea['query'][_0x6b01('0x1c')]);}return _0x483409[_0x6b01('0xdc')](_0x485f21);}})[_0x6b01('0xf')](function(_0x122c3b){if(_0x122c3b){return _0x122c3b?{'count':_0x114ca3,'rows':_0x122c3b}:null;}})[_0x6b01('0xf')](respondWithResult(_0xcf34ce,null))[_0x6b01('0x17')](handleError(_0xcf34ce,null));};exports[_0x6b01('0xdd')]=function(_0x5caca6,_0x12f88d,_0x3d87e9){var _0xb812af;var _0x1717f9;var _0x773fb5;var _0x5966be=!_[_0x6b01('0x60')](_0x5caca6[_0x6b01('0x56')]['id'])?_0x5caca6[_0x6b01('0x56')]['id']:!_[_0x6b01('0x60')](_0x5caca6[_0x6b01('0x26')]['id'])?_0x5caca6[_0x6b01('0x26')]['id']:null;return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5966be,'role':{'$or':['admin',_0x6b01('0x26'),_0x6b01('0x6c')]}},'attributes':['id','name',_0x6b01('0xde'),_0x6b01('0xdf'),_0x6b01('0x2d'),_0x6b01('0x5b'),_0x6b01('0x93')]})['then'](function(_0x426a26){if(_0x426a26){if(_0x426a26[_0x6b01('0x2d')]===_0x6b01('0x6c')){_0xb812af=_0x426a26;if(_0x5caca6[_0x6b01('0x55')]['interface']){_0x773fb5=util[_0x6b01('0x9f')](_0x6b01('0xe0'),_0xb812af[_0x5caca6[_0x6b01('0x55')]['interface']]);}else if(_0x5caca6[_0x6b01('0x55')][_0x6b01('0xe1')]){_0x773fb5=util['format'](_0x6b01('0xa0'),_0x5caca6[_0x6b01('0x55')]['intrf']);}else{_0x773fb5=util[_0x6b01('0x9f')](_0x6b01('0xa0'),_0xb812af[_0x6b01('0x32')]);}socket['to'](util[_0x6b01('0x9f')](_0x6b01('0xe2'),_0xb812af[_0x6b01('0x32')]))[_0x6b01('0xa4')](_0x6b01('0xe3'),{'user':{'id':_0xb812af['id'],'name':_0xb812af['name']},'ip':_0x5caca6[_0x6b01('0xe4')][_0x6b01('0xe5')]||_0x5caca6[_0x6b01('0xe6')]['remoteAddress']||_0x5caca6[_0x6b01('0xe7')][_0x6b01('0xe8')]||_0x5caca6['connection'][_0x6b01('0xe7')]['remoteAddress']});return db['UserVoiceQueueRt'][_0x6b01('0x30')]({'where':{'membername':_0xb812af['name']},'individualHooks':!![]});}}else{throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x6b01('0xf')](function(){if(_0xb812af){return _0xb812af[_0x6b01('0xe9')]({'raw':!![]});}})['then'](function(_0xd38583){if(_0xb812af){var _0x3540e8=[];if(_0xd38583){_0x1717f9=_0xd38583;if(_0x1717f9[_0x6b01('0x44')]){for(var _0x584247=0x0;_0x584247<_0x1717f9[_0x6b01('0x44')];_0x584247++){_0x3540e8[_0x6b01('0x47')]({'membername':_0xb812af[_0x6b01('0x32')],'UserId':_0xb812af['id'],'queue_name':_0x1717f9[_0x584247]['name'],'VoiceQueueId':_0x1717f9[_0x584247]['id'],'interface':_0x773fb5,'paused':_0xb812af['loginInPause']||![],'penalty':_0x1717f9[_0x584247][_0x6b01('0xea')]||0x0});}return BPromise['each'](_0x3540e8,function(_0x247d88){return db[_0x6b01('0xa6')][_0x6b01('0xeb')](_0x247d88);});}}}})[_0x6b01('0xf')](function(){if(_0xb812af){return db[_0x6b01('0xec')]['findAll']({'where':{'membername':_0xb812af[_0x6b01('0x32')],'exitAt':null}});}})['then'](function(_0x5acecb){if(_0xb812af){var _0x20d4a2=[];_0x5acecb[_0x6b01('0xed')](function(_0xe42a25){_0x20d4a2['push'](_0xe42a25[_0x6b01('0x22')]({'exitAt':moment()[_0x6b01('0x9f')](_0x6b01('0xee'))}));});return BPromise[_0x6b01('0x4b')](_0x20d4a2);}})[_0x6b01('0xf')](function(){if(_0xb812af){var _0x523b2e=[];var _0x47faa8=[];var _0x4fab2f=utils[_0x6b01('0xef')]();var _0x4bae02={'membername':_0xb812af[_0x6b01('0x32')],'interface':_0x773fb5,'enterAt':moment()[_0x6b01('0x9f')](_0x6b01('0xee')),'role':_0xb812af[_0x6b01('0x2d')],'internal':_0xb812af[_0x6b01('0x5b')]};_0x4fab2f[_0x6b01('0xed')](function(_0x278246){_0x523b2e[_0x6b01('0x47')](_[_0x6b01('0xbf')]({'channel':_0x278246,'type':'LOGIN','data1':_0x5caca6[_0x6b01('0x55')][_0x6b01('0xf0')],'data2':_0x773fb5},_0x4bae02));if(_0xb812af[_0x6b01('0x93')]){_0x47faa8[_0x6b01('0x47')](_[_0x6b01('0xbf')]({'channel':_0x278246,'type':_0x6b01('0xf1'),'data1':_0x6b01('0xf2')},_0x4bae02));}});return db[_0x6b01('0xec')][_0x6b01('0xf3')](_0x523b2e['concat'](_0x47faa8),{'individualHooks':!![]});}})[_0x6b01('0xf')](function(){if(_0xb812af){return _0xb812af[_0x6b01('0x22')]({'online':!![],'lastLoginAt':moment()['format'](_0x6b01('0xee')),'voicePause':_0xb812af['loginInPause']||![],'mailPause':_0xb812af[_0x6b01('0x93')]||![],'chatPause':_0xb812af['loginInPause']||![],'faxPause':_0xb812af[_0x6b01('0x93')]||![],'smsPause':_0xb812af[_0x6b01('0x93')]||![],'openchannelPause':_0xb812af[_0x6b01('0x93')]||![],'whatsappPause':_0xb812af['loginInPause']||![],'pauseType':_0xb812af['loginInPause']?_0x6b01('0xf2'):null,'interface':_0x773fb5,'lastPauseAt':moment()[_0x6b01('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x6b01('0xf')](function(_0x258da4){if(_0x5caca6['isMiddleware']){return _0x3d87e9();}else{return BPromise[_0x6b01('0xf4')](_0x258da4)[_0x6b01('0xf')](respondWithResult(_0x12f88d,null));}})[_0x6b01('0x17')](handleError(_0x12f88d,null));};exports[_0x6b01('0xf5')]=function(_0x138694,_0x47cb88){var _0x372c35;return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x138694[_0x6b01('0x56')]['id'],'role':_0x6b01('0x6c')},'attributes':['id',_0x6b01('0x32'),_0x6b01('0x2d')]})[_0x6b01('0xf')](handleEntityNotFound(_0x47cb88,null))[_0x6b01('0xf')](function(_0x31548d){if(_0x31548d){_0x372c35=_0x31548d;return db[_0x6b01('0xa6')][_0x6b01('0x30')]({'where':{'membername':_0x372c35['name']},'individualHooks':!![]});}})[_0x6b01('0xf')](function(){return db[_0x6b01('0xec')][_0x6b01('0x41')]({'where':{'membername':_0x372c35[_0x6b01('0x32')],'exitAt':null}});})[_0x6b01('0xf')](function(_0x46a924){var _0x10c2ed=[];_0x46a924[_0x6b01('0xed')](function(_0x3a6cfb){_0x10c2ed[_0x6b01('0x47')](_0x3a6cfb[_0x6b01('0x22')]({'exitAt':moment()[_0x6b01('0x9f')](_0x6b01('0xee'))}));});return BPromise[_0x6b01('0x4b')](_0x10c2ed);})[_0x6b01('0xf')](function(){return _0x372c35[_0x6b01('0x22')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6b01('0xf')](respondWithResult(_0x47cb88,null))[_0x6b01('0x17')](handleError(_0x47cb88,null));};exports[_0x6b01('0xf6')]=function(_0x41de48,_0x3f6bfe){var _0x14c05b;return db[_0x6b01('0xa6')][_0x6b01('0x22')]({'paused':0x1},{'where':{'UserId':_0x41de48['params']['id']},'individualHooks':!![]})[_0x6b01('0xf')](function(){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x41de48[_0x6b01('0x56')]['id'],'role':_0x6b01('0x6c')},'attributes':['id',_0x6b01('0x32'),_0x6b01('0x2d'),_0x6b01('0x5b'),'interface']});})[_0x6b01('0xf')](handleEntityNotFound(_0x3f6bfe,null))[_0x6b01('0xf')](function(_0x1fadac){if(_0x1fadac){_0x14c05b=_0x1fadac;return respondWithRpcPromise(_0x6b01('0xf7'),_0x6b01('0xf6'),{'id':_0x14c05b['id'],'name':_0x14c05b[_0x6b01('0x32')],'pause':!![]});}})['then'](function(){if(_0x14c05b){return db[_0x6b01('0xec')]['findAll']({'where':{'membername':_0x14c05b[_0x6b01('0x32')],'type':_0x6b01('0xf1'),'exitAt':null}});}})['then'](function(_0xd491a){if(_0xd491a[_0x6b01('0x44')]){var _0x286ab4=moment()['format'](_0x6b01('0xee'));for(var _0x4f747b=0x0,_0xa5274=_0xd491a[_0x6b01('0x44')];_0x4f747b<_0xa5274;_0x4f747b++){_0xd491a[_0x4f747b]['updateAttributes']({'exitAt':_0x286ab4});}}})[_0x6b01('0xf')](function(){var _0x4eab36=[];var _0x32e360=utils[_0x6b01('0xef')]();_0x32e360[_0x6b01('0xed')](function(_0x548a55){_0x4eab36[_0x6b01('0x47')]({'channel':_0x548a55,'membername':_0x14c05b['name'],'interface':_[_0x6b01('0x60')](_0x14c05b['interface'])?util['format']('SIP/%s',_0x14c05b['name']):_0x14c05b[_0x6b01('0x95')],'type':'PAUSE','enterAt':moment()[_0x6b01('0x9f')](_0x6b01('0xee')),'data1':_0x41de48[_0x6b01('0x55')][_0x6b01('0x37')]||_0x6b01('0xf8'),'role':_0x14c05b[_0x6b01('0x2d')],'internal':_0x14c05b[_0x6b01('0x5b')]});});return db[_0x6b01('0xec')][_0x6b01('0xf3')](_0x4eab36,{'individualHooks':!![]});})['then'](function(){return _0x14c05b[_0x6b01('0x22')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x41de48[_0x6b01('0x55')][_0x6b01('0x37')]||_0x6b01('0xf8'),'lastPauseAt':moment()[_0x6b01('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x6b01('0xf')](respondWithResult(_0x3f6bfe,null))['catch'](handleError(_0x3f6bfe,null));};exports[_0x6b01('0xf9')]=function(_0x1ef856,_0x174130){var _0x3f6ac7;return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x1ef856[_0x6b01('0x56')]['id']},'attributes':['id','name','role',_0x6b01('0x94'),_0x6b01('0xfa'),_0x6b01('0xfb'),_0x6b01('0xfc'),_0x6b01('0xfd'),'smsPause',_0x6b01('0xfe'),_0x6b01('0xff'),_0x6b01('0x100')]})['then'](handleEntityNotFound(_0x174130,null))[_0x6b01('0xf')](function(_0x1f6202){if(_0x1f6202){_0x3f6ac7=_0x1f6202;if(_0x1ef856[_0x6b01('0x55')][_0x6b01('0x91')]&&!utils[_0x6b01('0x96')](_0x1ef856[_0x6b01('0x55')][_0x6b01('0x91')])){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x97'));}switch(_0x1ef856[_0x6b01('0x55')][_0x6b01('0x91')]){case _0x6b01('0x9d'):return respondWithRpcPromise(_0x6b01('0xf7'),_0x6b01('0xf9'),{'id':_0x3f6ac7['id'],'name':_0x3f6ac7[_0x6b01('0x32')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt'][_0x6b01('0x22')]({'paused':0x0},{'where':{'UserId':_0x3f6ac7['id']},'individualHooks':!![]});})['then'](function(){return db[_0x6b01('0xec')][_0x6b01('0x2e')]({'where':{'channel':_0x1ef856[_0x6b01('0x55')]['channel'],'membername':_0x3f6ac7['name'],'type':_0x6b01('0xf1'),'exitAt':null}});})[_0x6b01('0xf')](function(_0x34e103){if(_0x34e103){return _0x34e103[_0x6b01('0x22')]({'exitAt':moment()['format'](_0x6b01('0xee')),'data2':_0x6b01('0x101')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3f6ac7['update']({'voicePause':![]});});case _0x6b01('0x49'):case _0x6b01('0x45'):case _0x6b01('0x48'):case _0x6b01('0x53'):case'whatsapp':case'openchannel':return db['MemberReport'][_0x6b01('0x2e')]({'where':{'channel':_0x1ef856[_0x6b01('0x55')][_0x6b01('0x91')],'membername':_0x3f6ac7[_0x6b01('0x32')],'type':_0x6b01('0xf1'),'exitAt':null}})[_0x6b01('0xf')](function(_0x56687e){if(_0x56687e){return _0x56687e['update']({'exitAt':moment()[_0x6b01('0x9f')](_0x6b01('0xee')),'data2':_0x6b01('0x101')},{'individualHooks':!![]});}return null;})[_0x6b01('0xf')](function(){var _0x283900={};_[_0x6b01('0x20')](_0x283900,util[_0x6b01('0x9f')](_0x6b01('0x102'),_0x1ef856[_0x6b01('0x55')]['channel'],'Pause'),![]);return _0x3f6ac7[_0x6b01('0x22')](_0x283900);});default:return respondWithRpcPromise(_0x6b01('0xf7'),_0x6b01('0xf9'),{'id':_0x3f6ac7['id'],'name':_0x3f6ac7[_0x6b01('0x32')],'pause':![]})[_0x6b01('0xf')](function(){return db[_0x6b01('0xa6')]['update']({'paused':0x0},{'where':{'UserId':_0x3f6ac7['id']}});})['then'](function(){return db['MemberReport'][_0x6b01('0x41')]({'where':{'membername':_0x3f6ac7[_0x6b01('0x32')],'type':_0x6b01('0xf1'),'exitAt':null}});})[_0x6b01('0xf')](function(_0x38a069){var _0x3b83b0=[];_0x38a069[_0x6b01('0xed')](function(_0x45f6e1){_0x3b83b0[_0x6b01('0x47')](_0x45f6e1[_0x6b01('0x22')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6b01('0x101')}));});return BPromise[_0x6b01('0x4b')](_0x3b83b0);})[_0x6b01('0xf')](function(){return _0x3f6ac7[_0x6b01('0x22')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x6b01('0xf')](respondWithResult(_0x174130,null))['catch'](handleError(_0x174130,null));};exports[_0x6b01('0x103')]=function(_0x3db9dd,_0x41fee4){var _0x39c796={};var _0x12b7e8={};var _0x41029d;var _0x47d960;return db['User']['findOne']({'where':{'id':_0x3db9dd[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x41fee4,null))[_0x6b01('0xf')](function(_0x1b633e){if(_0x1b633e){_0x41029d=_0x1b633e;_0x12b7e8[_0x6b01('0x4c')]=_['keys'](db[_0x6b01('0x104')][_0x6b01('0x35')]);_0x12b7e8[_0x6b01('0x3d')]=_['keys'](_0x3db9dd[_0x6b01('0x3d')]);_0x12b7e8['filters']=_[_0x6b01('0x4f')](_0x12b7e8[_0x6b01('0x4c')],_0x12b7e8[_0x6b01('0x3d')]);_0x39c796[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x12b7e8[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x3db9dd['query'][_0x6b01('0x50')]));_0x39c796[_0x6b01('0x40')]=_0x39c796[_0x6b01('0x40')][_0x6b01('0x44')]?_0x39c796[_0x6b01('0x40')]:_0x12b7e8['model'];_0x39c796[_0x6b01('0xc7')]=qs['sort'](_0x3db9dd[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x39c796[_0x6b01('0x3b')]=qs['filters'](_[_0x6b01('0xbe')](_0x3db9dd[_0x6b01('0x3d')],_0x12b7e8[_0x6b01('0x4e')]));if(_0x3db9dd[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x39c796[_0x6b01('0x3b')]=_['merge'](_0x39c796['where'],{'$or':_[_0x6b01('0x2a')](_0x39c796[_0x6b01('0x40')],function(_0x126168){var _0x1ea4d7={};_0x1ea4d7[_0x126168]={'$like':'%'+_0x3db9dd[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x1ea4d7;})});}_0x39c796=_[_0x6b01('0xbf')]({},_0x39c796,_0x3db9dd[_0x6b01('0x51')]);return _0x41029d[_0x6b01('0x103')](_0x39c796);}})[_0x6b01('0xf')](function(_0x5d0aa8){if(_0x5d0aa8){_0x47d960=_0x5d0aa8[_0x6b01('0x44')];if(!_0x3db9dd['query']['hasOwnProperty'](_0x6b01('0xc5'))){_0x39c796[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x3db9dd[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x39c796[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x3db9dd[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x41029d[_0x6b01('0x103')](_0x39c796);}})[_0x6b01('0xf')](function(_0x1ea6a0){if(_0x1ea6a0){return _0x1ea6a0?{'count':_0x47d960,'rows':_0x1ea6a0}:null;}})[_0x6b01('0xf')](respondWithResult(_0x41fee4,null))[_0x6b01('0x17')](handleError(_0x41fee4,null));};exports[_0x6b01('0x105')]=function(_0x332030,_0x2dc0d8){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x332030['params']['id']}})['then'](handleEntityNotFound(_0x2dc0d8,null))['then'](function(_0x60e63f){if(_0x60e63f){var _0x336fa2=_0x60e63f[_0x6b01('0x23')]({'plain':!![]});return _0x60e63f[_0x6b01('0x105')](_0x332030[_0x6b01('0x55')]['ids'],_[_0x6b01('0x59')](_0x332030['body'],[_0x6b01('0x5a'),'id'])||{})[_0x6b01('0xf')](function(){for(var _0x743e53=0x0;_0x743e53<_0x332030[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x743e53++){var _0x24c54a=[];var _0x2538c9={};db['Team'][_0x6b01('0x8a')]({'where':{'id':_0x332030[_0x6b01('0x55')][_0x6b01('0x5a')][_0x743e53]}})[_0x6b01('0xf')](function(_0x198323){_0x2538c9=_0x198323[_0x6b01('0x46')];_0x24c54a[_0x6b01('0x47')](_0x198323[_0x6b01('0xe9')]()[_0x6b01('0xf')](function(_0x332748){for(var _0x2c1df7=0x0;_0x2c1df7<_0x332748[_0x6b01('0x44')];_0x2c1df7++){_0x332748[_0x2c1df7][_0x6b01('0x106')]('channel',_0x6b01('0x107'));}return _0x332748;}));_0x24c54a['push'](_0x198323['getChatQueues']()[_0x6b01('0xf')](function(_0x1135ca){for(var _0x1ccc3b=0x0;_0x1ccc3b<_0x1135ca[_0x6b01('0x44')];_0x1ccc3b++){_0x1135ca[_0x1ccc3b]['setDataValue'](_0x6b01('0x91'),_0x6b01('0x108'));}return _0x1135ca;}));_0x24c54a[_0x6b01('0x47')](_0x198323[_0x6b01('0x109')]()[_0x6b01('0xf')](function(_0x1a72ee){for(var _0x55ea59=0x0;_0x55ea59<_0x1a72ee['length'];_0x55ea59++){_0x1a72ee[_0x55ea59][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x10a'));}return _0x1a72ee;}));_0x24c54a[_0x6b01('0x47')](_0x198323[_0x6b01('0x10b')]()[_0x6b01('0xf')](function(_0x557477){for(var _0x576d05=0x0;_0x576d05<_0x557477[_0x6b01('0x44')];_0x576d05++){_0x557477[_0x576d05][_0x6b01('0x106')](_0x6b01('0x91'),'Sms');}return _0x557477;}));_0x24c54a[_0x6b01('0x47')](_0x198323[_0x6b01('0x10c')]()[_0x6b01('0xf')](function(_0x175825){for(var _0x3977a1=0x0;_0x3977a1<_0x175825['length'];_0x3977a1++){_0x175825[_0x3977a1][_0x6b01('0x106')]('channel',_0x6b01('0x10d'));}return _0x175825;}));_0x24c54a['push'](_0x198323['getFaxQueues']()[_0x6b01('0xf')](function(_0x3a44d7){for(var _0x1bce10=0x0;_0x1bce10<_0x3a44d7[_0x6b01('0x44')];_0x1bce10++){_0x3a44d7[_0x1bce10][_0x6b01('0x106')]('channel','Fax');}return _0x3a44d7;}));_0x24c54a['push'](_0x198323[_0x6b01('0x10e')]()[_0x6b01('0xf')](function(_0x42b16a){for(var _0x17fa24=0x0;_0x17fa24<_0x42b16a[_0x6b01('0x44')];_0x17fa24++){_0x42b16a[_0x17fa24][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x10f'));}return _0x42b16a;}));return BPromise['all'](_0x24c54a);})[_0x6b01('0xf')](function(_0x4ddd28){var _0x1de2c7=_[_0x6b01('0x110')](_0x4ddd28);_0x24c54a=[];return db[_0x6b01('0x62')][_0x6b01('0x111')](function(_0x2e77a3){for(var _0x227435=0x0;_0x227435<_0x1de2c7['length'];_0x227435++){_0x24c54a['push'](_0x1de2c7[_0x227435][_0x6b01('0x112')](_0x336fa2['id']),{'transaction':_0x2e77a3});}return BPromise[_0x6b01('0x4b')](_0x24c54a)['then'](function(){if(_0x336fa2[_0x6b01('0x92')]){return BPromise['each'](_[_0x6b01('0x39')](_0x1de2c7,function(_0x392e8e){return _0x392e8e[_0x6b01('0x113')](_0x6b01('0x91'))===_0x6b01('0x107');}),function(_0x459fbf){return db[_0x6b01('0xa6')][_0x6b01('0xeb')]({'membername':_0x336fa2['name'],'UserId':_0x336fa2['id'],'queue_name':_0x459fbf[_0x6b01('0x32')],'VoiceQueueId':_0x459fbf['id'],'interface':_['isNil'](_0x336fa2[_0x6b01('0x95')])?util[_0x6b01('0x9f')](_0x6b01('0xa0'),_0x336fa2[_0x6b01('0x32')]):_0x336fa2[_0x6b01('0x95')],'paused':_0x336fa2['voicePause']||![],'penalty':_0x336fa2[_0x6b01('0x114')]},{'transaction':_0x2e77a3});});}else{return;}})[_0x6b01('0xf')](function(){for(var _0x2df36a=0x0;_0x2df36a<_0x1de2c7[_0x6b01('0x44')];_0x2df36a++){var _0x263dcf=_0x1de2c7[_0x2df36a][_0x6b01('0x113')](_0x6b01('0x91'));var _0x18841e=_0x263dcf+'QueueId';socket[_0x6b01('0xa4')](_0x6b01('0x26')+_0x263dcf+_0x6b01('0x115'),{'UserId':_0x336fa2['id'],['queueField']:_0x1de2c7[_0x2df36a]['id']});}});});})[_0x6b01('0xf')](function(){db[_0x6b01('0x116')][_0x6b01('0x8a')]({'where':{'teamId':_0x2538c9['id']}})[_0x6b01('0xf')](function(_0xb8a717){if(_0xb8a717){db[_0x6b01('0x117')][_0x6b01('0x75')]({'UserId':_0x332030[_0x6b01('0x56')]['id'],'VoicePrefixId':_0xb8a717[_0x6b01('0x118')]});}});});}});}})[_0x6b01('0xf')](respondWithStatusCode(_0x2dc0d8,null))[_0x6b01('0x17')](handleError(_0x2dc0d8,null));};exports['removeTeams']=function(_0x27c681,_0x3f405f){return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x27c681['params']['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x3f405f,null))[_0x6b01('0xf')](function(_0x31d65c){if(_0x31d65c){var _0x4175d6=_0x31d65c[_0x6b01('0x23')]({'plain':!![]});var _0x1fd628=_0x27c681[_0x6b01('0x3d')][_0x6b01('0x5a')];return _0x31d65c[_0x6b01('0x119')](_0x1fd628)['then'](function(){for(var _0x3e850f=0x0;_0x3e850f<_0x1fd628[_0x6b01('0x44')];_0x3e850f++){var _0x5a985d=[];var _0x1a7b5d={};db[_0x6b01('0x104')][_0x6b01('0x8a')]({'where':{'id':_0x1fd628[_0x3e850f]}})[_0x6b01('0xf')](function(_0x4c00d8){_0x1a7b5d=_0x4c00d8['dataValues'];_0x5a985d[_0x6b01('0x47')](_0x4c00d8[_0x6b01('0xe9')]()[_0x6b01('0xf')](function(_0x4296b){for(var _0x4885b1=0x0;_0x4885b1<_0x4296b[_0x6b01('0x44')];_0x4885b1++){_0x4296b[_0x4885b1]['setDataValue'](_0x6b01('0x91'),_0x6b01('0x107'));}return _0x4296b;}));_0x5a985d[_0x6b01('0x47')](_0x4c00d8[_0x6b01('0x11a')]()[_0x6b01('0xf')](function(_0x4bce89){for(var _0x4fbad0=0x0;_0x4fbad0<_0x4bce89[_0x6b01('0x44')];_0x4fbad0++){_0x4bce89[_0x4fbad0][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x108'));}return _0x4bce89;}));_0x5a985d[_0x6b01('0x47')](_0x4c00d8[_0x6b01('0x109')]()[_0x6b01('0xf')](function(_0x4e74de){for(var _0x269276=0x0;_0x269276<_0x4e74de[_0x6b01('0x44')];_0x269276++){_0x4e74de[_0x269276][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x10a'));}return _0x4e74de;}));_0x5a985d['push'](_0x4c00d8[_0x6b01('0x10b')]()[_0x6b01('0xf')](function(_0x54047b){for(var _0x5a73eb=0x0;_0x5a73eb<_0x54047b[_0x6b01('0x44')];_0x5a73eb++){_0x54047b[_0x5a73eb]['setDataValue'](_0x6b01('0x91'),_0x6b01('0x11b'));}return _0x54047b;}));_0x5a985d['push'](_0x4c00d8['getWhatsappQueues']()[_0x6b01('0xf')](function(_0x324352){for(var _0x384ff5=0x0;_0x384ff5<_0x324352[_0x6b01('0x44')];_0x384ff5++){_0x324352[_0x384ff5][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x10d'));}return _0x324352;}));_0x5a985d[_0x6b01('0x47')](_0x4c00d8['getFaxQueues']()['then'](function(_0x3dd6fb){for(var _0x1f39f0=0x0;_0x1f39f0<_0x3dd6fb[_0x6b01('0x44')];_0x1f39f0++){_0x3dd6fb[_0x1f39f0][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x11c'));}return _0x3dd6fb;}));_0x5a985d[_0x6b01('0x47')](_0x4c00d8[_0x6b01('0x10e')]()['then'](function(_0x2673fc){for(var _0x41bc19=0x0;_0x41bc19<_0x2673fc[_0x6b01('0x44')];_0x41bc19++){_0x2673fc[_0x41bc19][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x10f'));}return _0x2673fc;}));return BPromise[_0x6b01('0x4b')](_0x5a985d);})[_0x6b01('0xf')](function(_0x5e98e9){var _0x516d02=_[_0x6b01('0x110')](_0x5e98e9);_0x5a985d=[];return db[_0x6b01('0x62')][_0x6b01('0x111')](function(_0x15b2a8){for(var _0x51aca6=0x0;_0x51aca6<_0x516d02[_0x6b01('0x44')];_0x51aca6++){_0x5a985d[_0x6b01('0x47')](_0x516d02[_0x51aca6][_0x6b01('0x11d')](_0x4175d6['id']),{'transaction':_0x15b2a8});}return BPromise[_0x6b01('0x4b')](_0x5a985d)['then'](function(){if(_0x4175d6['online']){return BPromise[_0x6b01('0x7f')](_[_0x6b01('0x39')](_0x516d02,function(_0x51034a){return _0x51034a['getDataValue'](_0x6b01('0x91'))===_0x6b01('0x107');}),function(_0x549251){return db[_0x6b01('0xa6')]['destroy']({'where':{'VoiceQueueId':_0x549251['id'],'UserId':_0x4175d6['id']},'transaction':_0x15b2a8});});}else{return;}})['then'](function(){db[_0x6b01('0x116')][_0x6b01('0x8a')]({'where':{'teamId':_0x1a7b5d['id']}})['then'](function(_0x418c24){if(_0x418c24){return db[_0x6b01('0x117')][_0x6b01('0x30')]({'where':{'UserId':_0x4175d6['id'],'VoicePrefixId':_0x418c24[_0x6b01('0x46')][_0x6b01('0x118')]}});}});})['then'](function(){for(var _0xe41cdd=0x0;_0xe41cdd<_0x516d02[_0x6b01('0x44')];_0xe41cdd++){var _0x487a1f=_0x516d02[_0xe41cdd][_0x6b01('0x113')](_0x6b01('0x91'));var _0x18b76c=_0x487a1f+'QueueId';socket['emit'](_0x6b01('0x26')+_0x487a1f+_0x6b01('0xa5'),{'UserId':_0x4175d6['id'],['queueField']:_0x516d02[_0xe41cdd]['id']});}});});});}});}})[_0x6b01('0xf')](respondWithStatusCode(_0x3f405f,null))['catch'](handleError(_0x3f405f,null));};exports[_0x6b01('0x11e')]=function(_0x1954f6,_0x34b307){var _0x31f592={};var _0x105973={};var _0x5d9402;var _0x4a3fb5;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x1954f6['params']['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x34b307,null))[_0x6b01('0xf')](function(_0xbc554c){if(_0xbc554c){_0x5d9402=_0xbc554c;_0x105973['model']=_[_0x6b01('0x4d')](db[_0x6b01('0xc1')][_0x6b01('0x35')]);_0x105973['query']=_['keys'](_0x1954f6[_0x6b01('0x3d')]);_0x105973[_0x6b01('0x4e')]=_['intersection'](_0x105973['model'],_0x105973[_0x6b01('0x3d')]);_0x31f592[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x105973[_0x6b01('0x4c')],qs['fields'](_0x1954f6[_0x6b01('0x3d')]['fields']));_0x31f592[_0x6b01('0x40')]=_0x31f592[_0x6b01('0x40')][_0x6b01('0x44')]?_0x31f592[_0x6b01('0x40')]:_0x105973[_0x6b01('0x4c')];_0x31f592[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x1954f6[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x31f592[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x1954f6[_0x6b01('0x3d')],_0x105973['filters']));if(_0x1954f6[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x31f592[_0x6b01('0x3b')]=_['merge'](_0x31f592[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x31f592['attributes'],function(_0x17f0c1){var _0x4b7d87={};_0x4b7d87[_0x17f0c1]={'$like':'%'+_0x1954f6['query'][_0x6b01('0x39')]+'%'};return _0x4b7d87;})});}_0x31f592=_[_0x6b01('0xbf')]({},_0x31f592,_0x1954f6['options']);return _0x5d9402[_0x6b01('0x11e')](_0x31f592);}})[_0x6b01('0xf')](function(_0x24f78d){if(_0x24f78d){_0x4a3fb5=_0x24f78d['length'];if(!_0x1954f6['query']['hasOwnProperty'](_0x6b01('0xc5'))){_0x31f592[_0x6b01('0x1e')]=qs['limit'](_0x1954f6[_0x6b01('0x3d')]['limit']);_0x31f592[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x1954f6[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x5d9402['getLists'](_0x31f592);}})[_0x6b01('0xf')](function(_0x57fe8c){if(_0x57fe8c){return _0x57fe8c?{'count':_0x4a3fb5,'rows':_0x57fe8c}:null;}})[_0x6b01('0xf')](respondWithResult(_0x34b307,null))['catch'](handleError(_0x34b307,null));};exports[_0x6b01('0x11f')]=function(_0x2217aa,_0x57c71a){var _0x43e8d1={};var _0xdb77f8={};var _0x199b56;var _0x4d430b;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x2217aa[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x57c71a,null))[_0x6b01('0xf')](function(_0x1f7c3a){if(_0x1f7c3a){_0x199b56=_0x1f7c3a;_0xdb77f8[_0x6b01('0x4c')]=_['keys'](db['User']['rawAttributes']);_0xdb77f8[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x2217aa[_0x6b01('0x3d')]);_0xdb77f8[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0xdb77f8[_0x6b01('0x4c')],_0xdb77f8[_0x6b01('0x3d')]);_0x43e8d1[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0xdb77f8[_0x6b01('0x4c')],qs['fields'](_0x2217aa[_0x6b01('0x3d')]['fields']));_0x43e8d1[_0x6b01('0x40')]=_0x43e8d1[_0x6b01('0x40')][_0x6b01('0x44')]?_0x43e8d1['attributes']:_0xdb77f8[_0x6b01('0x4c')];_0x43e8d1[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x2217aa[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x43e8d1[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x2217aa['query'],_0xdb77f8[_0x6b01('0x4e')]));if(_0x2217aa[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x43e8d1['where']=_[_0x6b01('0xbf')](_0x43e8d1[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x43e8d1[_0x6b01('0x40')],function(_0x30a49b){var _0x53526e={};_0x53526e[_0x30a49b]={'$like':'%'+_0x2217aa[_0x6b01('0x3d')]['filter']+'%'};return _0x53526e;})});}_0x43e8d1[_0x6b01('0x4c')]=db[_0x6b01('0x3c')];_0x43e8d1['as']=_0x6b01('0x27');_0x43e8d1=_[_0x6b01('0xbf')]({},_0x43e8d1,_0x2217aa[_0x6b01('0x51')]);return _0x199b56[_0x6b01('0xe9')]({'include':[_0x43e8d1]});}})[_0x6b01('0xf')](function(_0x3cdd4f){if(_0x3cdd4f){var _0x585135={},_0x15c158=[],_0x4a72b6=0x0;for(var _0x4a1659=0x0;_0x4a1659<_0x3cdd4f[_0x6b01('0x44')];_0x4a1659+=0x1){for(var _0x21628e=0x0,_0x24709b;_0x21628e<_0x3cdd4f[_0x4a1659][_0x6b01('0x27')][_0x6b01('0x44')];_0x21628e+=0x1){_0x24709b=_0x3cdd4f[_0x4a1659]['Agents'][_0x21628e][_0x6b01('0x23')]({'plain':!![]});_0x585135[_0x24709b['id']]=_0x24709b;}}_0x585135=_['values'](_0x585135);for(var _0x52814b=qs['offset'](_0x2217aa['query'][_0x6b01('0x1c')]);_0x52814b<_0x585135[_0x6b01('0x44')]&&_0x15c158[_0x6b01('0x44')]<qs['limit'](_0x2217aa['query'][_0x6b01('0x1e')]);_0x52814b+=0x1){if(_0x585135[_0x52814b]){_0x15c158[_0x6b01('0x47')](_0x585135[_0x52814b]);}}return{'count':_0x585135[_0x6b01('0x44')],'rows':_0x15c158};}})['then'](respondWithResult(_0x57c71a,null))[_0x6b01('0x17')](handleError(_0x57c71a,null));};exports[_0x6b01('0x30')]=function(_0x3817fb,_0x27de60){if(_0x3817fb['user']['id']==_0x3817fb['params']['id']){return _0x27de60['status'](0x1f4)[_0x6b01('0x33')]({'message':_0x6b01('0x120')});}return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x3817fb[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x27de60,null))['then'](removeEntity(_0x27de60,null))['catch'](handleError(_0x27de60,null));};exports[_0x6b01('0x121')]=function(_0x7f2440,_0x19adb6){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x7f2440[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x19adb6,null))[_0x6b01('0xf')](function(_0x4cab66){if(_0x4cab66){return _0x4cab66[_0x6b01('0x121')](_0x7f2440['body'][_0x6b01('0x5a')],_['omit'](_0x7f2440[_0x6b01('0x55')],['ids','id'])||{})[_0x6b01('0x9b')](function(){for(var _0x5db868=0x0;_0x5db868<_0x7f2440[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x5db868+=0x1){socket['emit'](_0x6b01('0x122'),{'ChatInteractionId':Number(_0x7f2440[_0x6b01('0x55')][_0x6b01('0x5a')][_0x5db868]),'UserId':Number(_0x7f2440['params']['id'])});}return _0x7f2440['body'][_0x6b01('0x5a')];});}})[_0x6b01('0xf')](respondWithResult(_0x19adb6,null))[_0x6b01('0x17')](handleError(_0x19adb6,null));};exports[_0x6b01('0x123')]=function(_0x41b92e,_0x124db5){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x41b92e[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x124db5,null))[_0x6b01('0xf')](function(_0x411074){if(_0x411074){return _0x411074[_0x6b01('0x123')](_0x41b92e['query']['ids'])[_0x6b01('0xf')](function(){if(_['isArray'](_0x41b92e[_0x6b01('0x3d')][_0x6b01('0x5a')])){for(var _0x48a902=0x0;_0x48a902<_0x41b92e[_0x6b01('0x3d')]['ids'][_0x6b01('0x44')];_0x48a902+=0x1){socket[_0x6b01('0xa4')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x41b92e['query']['ids'][_0x48a902]),'UserId':Number(_0x41b92e[_0x6b01('0x56')]['id'])});}}else{socket['emit'](_0x6b01('0x124'),{'ChatInteractionId':Number(_0x41b92e[_0x6b01('0x3d')][_0x6b01('0x5a')]),'UserId':Number(_0x41b92e[_0x6b01('0x56')]['id'])});}});}})[_0x6b01('0xf')](respondWithStatusCode(_0x124db5,null))[_0x6b01('0x17')](handleError(_0x124db5,null));};exports[_0x6b01('0x125')]=function(_0x4bd0a3,_0x59f12){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x4bd0a3['params']['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x59f12,null))[_0x6b01('0xf')](function(_0x3832d1){if(_0x3832d1){return _0x3832d1[_0x6b01('0x125')](_0x4bd0a3['body'][_0x6b01('0x5a')],_['omit'](_0x4bd0a3[_0x6b01('0x55')],['ids','id'])||{})['spread'](function(){for(var _0x513965=0x0;_0x513965<_0x4bd0a3[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x513965+=0x1){socket[_0x6b01('0xa4')](_0x6b01('0x126'),{'MailInteractionId':Number(_0x4bd0a3['body']['ids'][_0x513965]),'UserId':Number(_0x4bd0a3[_0x6b01('0x56')]['id'])});}return _0x4bd0a3[_0x6b01('0x55')][_0x6b01('0x5a')];});}})[_0x6b01('0xf')](respondWithResult(_0x59f12,null))['catch'](handleError(_0x59f12,null));};exports[_0x6b01('0x127')]=function(_0x2b1223,_0x263ad1){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x2b1223['params']['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x263ad1,null))[_0x6b01('0xf')](function(_0x1b7932){if(_0x1b7932){return _0x1b7932[_0x6b01('0x127')](_0x2b1223['query']['ids'])['then'](function(){if(_[_0x6b01('0xa3')](_0x2b1223[_0x6b01('0x3d')]['ids'])){for(var _0x131ef2=0x0;_0x131ef2<_0x2b1223[_0x6b01('0x3d')]['ids'][_0x6b01('0x44')];_0x131ef2+=0x1){socket[_0x6b01('0xa4')](_0x6b01('0x128'),{'MailInteractionId':Number(_0x2b1223['query'][_0x6b01('0x5a')][_0x131ef2]),'UserId':Number(_0x2b1223[_0x6b01('0x56')]['id'])});}}else{socket[_0x6b01('0xa4')](_0x6b01('0x128'),{'MailInteractionId':Number(_0x2b1223[_0x6b01('0x3d')][_0x6b01('0x5a')]),'UserId':Number(_0x2b1223[_0x6b01('0x56')]['id'])});}});}})[_0x6b01('0xf')](respondWithStatusCode(_0x263ad1,null))[_0x6b01('0x17')](handleError(_0x263ad1,null));};exports[_0x6b01('0x129')]=function(_0x3ce9cf,_0x43aea4){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x3ce9cf[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x43aea4,null))[_0x6b01('0xf')](function(_0x12e991){if(_0x12e991){return _0x12e991['addFaxInteractions'](_0x3ce9cf['body'][_0x6b01('0x5a')],_[_0x6b01('0x59')](_0x3ce9cf[_0x6b01('0x55')],['ids','id'])||{})[_0x6b01('0x9b')](function(){for(var _0x4e17b1=0x0;_0x4e17b1<_0x3ce9cf['body'][_0x6b01('0x5a')]['length'];_0x4e17b1+=0x1){socket['emit'](_0x6b01('0x12a'),{'FaxInteractionId':Number(_0x3ce9cf[_0x6b01('0x55')][_0x6b01('0x5a')][_0x4e17b1]),'UserId':Number(_0x3ce9cf[_0x6b01('0x56')]['id'])});}return _0x3ce9cf['body']['ids'];});}})[_0x6b01('0xf')](respondWithResult(_0x43aea4,null))[_0x6b01('0x17')](handleError(_0x43aea4,null));};exports['removeFaxInteractions']=function(_0x3bb2d1,_0x28b9d1){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x3bb2d1[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x28b9d1,null))[_0x6b01('0xf')](function(_0x20941f){if(_0x20941f){return _0x20941f['removeFaxInteractions'](_0x3bb2d1[_0x6b01('0x3d')][_0x6b01('0x5a')])['then'](function(){if(_[_0x6b01('0xa3')](_0x3bb2d1[_0x6b01('0x3d')][_0x6b01('0x5a')])){for(var _0x84587f=0x0;_0x84587f<_0x3bb2d1['query'][_0x6b01('0x5a')]['length'];_0x84587f+=0x1){socket[_0x6b01('0xa4')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3bb2d1[_0x6b01('0x3d')]['ids'][_0x84587f]),'UserId':Number(_0x3bb2d1[_0x6b01('0x56')]['id'])});}}else{socket['emit'](_0x6b01('0x12b'),{'FaxInteractionId':Number(_0x3bb2d1[_0x6b01('0x3d')][_0x6b01('0x5a')]),'UserId':Number(_0x3bb2d1[_0x6b01('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x28b9d1,null))[_0x6b01('0x17')](handleError(_0x28b9d1,null));};exports[_0x6b01('0x12c')]=function(_0x8e9750,_0x5847e5){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x8e9750[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x5847e5,null))[_0x6b01('0xf')](function(_0x18e0f4){if(_0x18e0f4){return _0x18e0f4[_0x6b01('0x12c')](_0x8e9750[_0x6b01('0x55')][_0x6b01('0x5a')],_[_0x6b01('0x59')](_0x8e9750['body'],[_0x6b01('0x5a'),'id'])||{})[_0x6b01('0x9b')](function(){for(var _0x2aee23=0x0;_0x2aee23<_0x8e9750[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x2aee23+=0x1){socket[_0x6b01('0xa4')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x8e9750[_0x6b01('0x55')][_0x6b01('0x5a')][_0x2aee23]),'UserId':Number(_0x8e9750[_0x6b01('0x56')]['id'])});}return _0x8e9750[_0x6b01('0x55')][_0x6b01('0x5a')];});}})[_0x6b01('0xf')](respondWithResult(_0x5847e5,null))['catch'](handleError(_0x5847e5,null));};exports[_0x6b01('0x12d')]=function(_0x357943,_0x57b659){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x357943['params']['id']}})['then'](handleEntityNotFound(_0x57b659,null))['then'](function(_0xc05b2d){if(_0xc05b2d){return _0xc05b2d[_0x6b01('0x12d')](_0x357943[_0x6b01('0x3d')][_0x6b01('0x5a')])[_0x6b01('0xf')](function(){if(_[_0x6b01('0xa3')](_0x357943[_0x6b01('0x3d')]['ids'])){for(var _0x101555=0x0;_0x101555<_0x357943[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x101555+=0x1){socket[_0x6b01('0xa4')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x357943[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x101555]),'UserId':Number(_0x357943[_0x6b01('0x56')]['id'])});}}else{socket[_0x6b01('0xa4')](_0x6b01('0x12e'),{'SmsInteractionId':Number(_0x357943['query'][_0x6b01('0x5a')]),'UserId':Number(_0x357943['params']['id'])});}});}})['then'](respondWithStatusCode(_0x57b659,null))[_0x6b01('0x17')](handleError(_0x57b659,null));};exports[_0x6b01('0x12f')]=function(_0x574489,_0x4a08b5){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x574489[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x4a08b5,null))[_0x6b01('0xf')](function(_0x53d7be){if(_0x53d7be){return _0x53d7be[_0x6b01('0x12f')](_0x574489[_0x6b01('0x55')]['ids'],_[_0x6b01('0x59')](_0x574489['body'],[_0x6b01('0x5a'),'id'])||{})['spread'](function(){for(var _0x4b2b00=0x0;_0x4b2b00<_0x574489[_0x6b01('0x55')]['ids'][_0x6b01('0x44')];_0x4b2b00+=0x1){socket[_0x6b01('0xa4')](_0x6b01('0x130'),{'OpenchannelInteractionId':Number(_0x574489[_0x6b01('0x55')][_0x6b01('0x5a')][_0x4b2b00]),'UserId':Number(_0x574489[_0x6b01('0x56')]['id'])});}return _0x574489[_0x6b01('0x55')][_0x6b01('0x5a')];});}})['then'](respondWithResult(_0x4a08b5,null))['catch'](handleError(_0x4a08b5,null));};exports[_0x6b01('0x131')]=function(_0x4c632d,_0x1de2cf){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x4c632d[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x1de2cf,null))['then'](function(_0x6603bc){if(_0x6603bc){return _0x6603bc[_0x6b01('0x131')](_0x4c632d['query']['ids'])[_0x6b01('0xf')](function(){if(_[_0x6b01('0xa3')](_0x4c632d[_0x6b01('0x3d')][_0x6b01('0x5a')])){for(var _0x24cc30=0x0;_0x24cc30<_0x4c632d['query'][_0x6b01('0x5a')][_0x6b01('0x44')];_0x24cc30+=0x1){socket[_0x6b01('0xa4')](_0x6b01('0x132'),{'OpenchannelInteractionId':Number(_0x4c632d[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x24cc30]),'UserId':Number(_0x4c632d[_0x6b01('0x56')]['id'])});}}else{socket[_0x6b01('0xa4')](_0x6b01('0x132'),{'OpenchannelInteractionId':Number(_0x4c632d[_0x6b01('0x3d')][_0x6b01('0x5a')]),'UserId':Number(_0x4c632d[_0x6b01('0x56')]['id'])});}});}})[_0x6b01('0xf')](respondWithStatusCode(_0x1de2cf,null))[_0x6b01('0x17')](handleError(_0x1de2cf,null));};exports['addWhatsappInteractions']=function(_0x2343d,_0x27faca){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x2343d[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x27faca,null))[_0x6b01('0xf')](function(_0x1c9a30){if(_0x1c9a30){return _0x1c9a30[_0x6b01('0x133')](_0x2343d[_0x6b01('0x55')]['ids'],_[_0x6b01('0x59')](_0x2343d[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{})['spread'](function(){for(var _0x3e8cf8=0x0;_0x3e8cf8<_0x2343d[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x3e8cf8+=0x1){socket['emit'](_0x6b01('0x134'),{'WhatsappInteractionId':Number(_0x2343d[_0x6b01('0x55')][_0x6b01('0x5a')][_0x3e8cf8]),'UserId':Number(_0x2343d[_0x6b01('0x56')]['id'])});}return _0x2343d['body'][_0x6b01('0x5a')];});}})['then'](respondWithResult(_0x27faca,null))[_0x6b01('0x17')](handleError(_0x27faca,null));};exports[_0x6b01('0x135')]=function(_0x48821a,_0x21b4b6){return db['User']['find']({'where':{'id':_0x48821a[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x21b4b6,null))['then'](function(_0x3c2f3e){if(_0x3c2f3e){return _0x3c2f3e[_0x6b01('0x135')](_0x48821a[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})[_0x6b01('0xf')](respondWithStatusCode(_0x21b4b6,null))[_0x6b01('0x17')](handleError(_0x21b4b6,null));};exports[_0x6b01('0x136')]=function(_0x4b0781,_0x4062d2){var _0x29a46d={};var _0x58828d={};var _0x2341e9;var _0x116ef9;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x4b0781[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x4062d2,null))[_0x6b01('0xf')](function(_0x1450d6){if(_0x1450d6){_0x2341e9=_0x1450d6;_0x58828d[_0x6b01('0x4c')]=_['keys'](db[_0x6b01('0x137')]['rawAttributes']);_0x58828d[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x4b0781[_0x6b01('0x3d')]);_0x58828d['filters']=_['intersection'](_0x58828d[_0x6b01('0x4c')],_0x58828d['query']);_0x29a46d[_0x6b01('0x40')]=_['intersection'](_0x58828d[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x4b0781[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x29a46d[_0x6b01('0x40')]=_0x29a46d[_0x6b01('0x40')]['length']?_0x29a46d[_0x6b01('0x40')]:_0x58828d[_0x6b01('0x4c')];_0x29a46d['order']=qs[_0x6b01('0xbd')](_0x4b0781[_0x6b01('0x3d')]['sort']);_0x29a46d[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x4b0781[_0x6b01('0x3d')],_0x58828d[_0x6b01('0x4e')]));if(_0x4b0781[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x29a46d['where']=_[_0x6b01('0xbf')](_0x29a46d['where'],{'$or':_[_0x6b01('0x2a')](_0x29a46d[_0x6b01('0x40')],function(_0x5b8d50){var _0x456bdd={};_0x456bdd[_0x5b8d50]={'$like':'%'+_0x4b0781['query'][_0x6b01('0x39')]+'%'};return _0x456bdd;})});}_0x29a46d=_[_0x6b01('0xbf')]({},_0x29a46d,_0x4b0781['options']);return _0x2341e9[_0x6b01('0x136')](_0x29a46d);}})[_0x6b01('0xf')](function(_0x75ac8b){if(_0x75ac8b){_0x116ef9=_0x75ac8b[_0x6b01('0x44')];if(!_0x4b0781[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x29a46d[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x4b0781[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x29a46d[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x4b0781[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x2341e9[_0x6b01('0x136')](_0x29a46d);}})['then'](function(_0x8e1654){if(_0x8e1654){return _0x8e1654?{'count':_0x116ef9,'rows':_0x8e1654}:null;}})[_0x6b01('0xf')](respondWithResult(_0x4062d2,null))['catch'](handleError(_0x4062d2,null));};exports[_0x6b01('0x138')]=function(_0x100837,_0xa38112){var _0x5959e9={};var _0x237f09={};var _0x4efbaa;var _0x462499;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x100837['params']['id']}})['then'](handleEntityNotFound(_0xa38112,null))['then'](function(_0xd6313a){if(_0xd6313a){_0x4efbaa=_0xd6313a;_0x237f09[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0x139')][_0x6b01('0x35')]);_0x237f09['query']=_['keys'](_0x100837['query']);_0x237f09[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x237f09[_0x6b01('0x4c')],_0x237f09['query']);_0x5959e9[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x237f09[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x100837[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x5959e9[_0x6b01('0x40')]=_0x5959e9['attributes'][_0x6b01('0x44')]?_0x5959e9['attributes']:_0x237f09['model'];_0x5959e9[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x100837['query'][_0x6b01('0xbd')]);_0x5959e9[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x100837[_0x6b01('0x3d')],_0x237f09['filters']));if(_0x100837['query'][_0x6b01('0x39')]){_0x5959e9[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x5959e9[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x5959e9[_0x6b01('0x40')],function(_0x27fb79){var _0x36f2ec={};_0x36f2ec[_0x27fb79]={'$like':'%'+_0x100837[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x36f2ec;})});}_0x5959e9=_[_0x6b01('0xbf')]({},_0x5959e9,_0x100837[_0x6b01('0x51')]);return _0x4efbaa[_0x6b01('0x138')](_0x5959e9);}})[_0x6b01('0xf')](function(_0x440453){if(_0x440453){_0x462499=_0x440453['length'];if(!_0x100837['query']['hasOwnProperty'](_0x6b01('0xc5'))){_0x5959e9[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x100837[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x5959e9[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x100837[_0x6b01('0x3d')]['offset']);}return _0x4efbaa['getFaxAccounts'](_0x5959e9);}})[_0x6b01('0xf')](function(_0x308852){if(_0x308852){return _0x308852?{'count':_0x462499,'rows':_0x308852}:null;}})[_0x6b01('0xf')](respondWithResult(_0xa38112,null))[_0x6b01('0x17')](handleError(_0xa38112,null));};exports[_0x6b01('0x13a')]=function(_0x1d4b06,_0x2eb9a4){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x1d4b06[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x2eb9a4,null))[_0x6b01('0xf')](function(_0x4d3714){if(_0x4d3714){return _0x4d3714[_0x6b01('0x13a')](_0x1d4b06[_0x6b01('0x55')]['ids'],_['omit'](_0x1d4b06[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x2eb9a4,null))[_0x6b01('0x17')](handleError(_0x2eb9a4,null));};exports['removeFaxAccounts']=function(_0x211710,_0x4cf51b){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x211710[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x4cf51b,null))[_0x6b01('0xf')](function(_0x84cd2b){if(_0x84cd2b){return _0x84cd2b[_0x6b01('0x13b')](_0x211710[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})[_0x6b01('0xf')](respondWithStatusCode(_0x4cf51b,null))['catch'](handleError(_0x4cf51b,null));};exports['getMailAccounts']=function(_0x11884f,_0x35fbf7){var _0x5cd08c={};var _0x26fbab={};var _0x42093a;var _0x55b3f4;return db['User']['findOne']({'where':{'id':_0x11884f[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x35fbf7,null))[_0x6b01('0xf')](function(_0xd4c3aa){if(_0xd4c3aa){_0x42093a=_0xd4c3aa;_0x26fbab[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0x13c')][_0x6b01('0x35')]);_0x26fbab[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x11884f[_0x6b01('0x3d')]);_0x26fbab[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x26fbab[_0x6b01('0x4c')],_0x26fbab['query']);_0x5cd08c[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x26fbab[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x11884f[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x5cd08c['attributes']=_0x5cd08c['attributes'][_0x6b01('0x44')]?_0x5cd08c[_0x6b01('0x40')]:_0x26fbab['model'];_0x5cd08c[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x11884f[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x5cd08c[_0x6b01('0x3b')]=qs['filters'](_[_0x6b01('0xbe')](_0x11884f['query'],_0x26fbab[_0x6b01('0x4e')]));if(_0x11884f[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x5cd08c['where']=_[_0x6b01('0xbf')](_0x5cd08c[_0x6b01('0x3b')],{'$or':_['map'](_0x5cd08c['attributes'],function(_0x5e2413){var _0x110884={};_0x110884[_0x5e2413]={'$like':'%'+_0x11884f['query'][_0x6b01('0x39')]+'%'};return _0x110884;})});}_0x5cd08c=_[_0x6b01('0xbf')]({},_0x5cd08c,_0x11884f[_0x6b01('0x51')]);return _0x42093a[_0x6b01('0x13d')](_0x5cd08c);}})[_0x6b01('0xf')](function(_0x573716){if(_0x573716){_0x55b3f4=_0x573716[_0x6b01('0x44')];if(!_0x11884f[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x5cd08c[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x11884f[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x5cd08c['offset']=qs[_0x6b01('0x1c')](_0x11884f['query'][_0x6b01('0x1c')]);}return _0x42093a[_0x6b01('0x13d')](_0x5cd08c);}})['then'](function(_0x5624d4){if(_0x5624d4){return _0x5624d4?{'count':_0x55b3f4,'rows':_0x5624d4}:null;}})[_0x6b01('0xf')](respondWithResult(_0x35fbf7,null))['catch'](handleError(_0x35fbf7,null));};exports[_0x6b01('0x13e')]=function(_0x5bdc0f,_0x501ceb){return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x5bdc0f[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x501ceb,null))[_0x6b01('0xf')](function(_0xe4969c){if(_0xe4969c){return _0xe4969c[_0x6b01('0x13e')](_0x5bdc0f[_0x6b01('0x55')][_0x6b01('0x5a')],_[_0x6b01('0x59')](_0x5bdc0f[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x501ceb,null))[_0x6b01('0x17')](handleError(_0x501ceb,null));};exports[_0x6b01('0x13f')]=function(_0x33bcdd,_0x3c2a46){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x33bcdd[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x3c2a46,null))[_0x6b01('0xf')](function(_0x24ec41){if(_0x24ec41){return _0x24ec41[_0x6b01('0x13f')](_0x33bcdd[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})[_0x6b01('0xf')](respondWithStatusCode(_0x3c2a46,null))[_0x6b01('0x17')](handleError(_0x3c2a46,null));};exports[_0x6b01('0x140')]=function(_0x3eaa98,_0x1cd5a4){var _0x452646={};var _0x2b40e6={};var _0x47ef48;var _0xe7bffb;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x3eaa98[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x1cd5a4,null))[_0x6b01('0xf')](function(_0x4d31ba){if(_0x4d31ba){_0x47ef48=_0x4d31ba;_0x2b40e6['model']=_['keys'](db[_0x6b01('0x141')][_0x6b01('0x35')]);_0x2b40e6[_0x6b01('0x3d')]=_['keys'](_0x3eaa98[_0x6b01('0x3d')]);_0x2b40e6[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x2b40e6[_0x6b01('0x4c')],_0x2b40e6[_0x6b01('0x3d')]);_0x452646[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x2b40e6[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x3eaa98['query'][_0x6b01('0x50')]));_0x452646[_0x6b01('0x40')]=_0x452646[_0x6b01('0x40')]['length']?_0x452646[_0x6b01('0x40')]:_0x2b40e6[_0x6b01('0x4c')];_0x452646[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x3eaa98[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x452646[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x3eaa98['query'],_0x2b40e6[_0x6b01('0x4e')]));if(_0x3eaa98[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x452646['where']=_[_0x6b01('0xbf')](_0x452646[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x452646[_0x6b01('0x40')],function(_0x1dfd5e){var _0x4065cb={};_0x4065cb[_0x1dfd5e]={'$like':'%'+_0x3eaa98[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x4065cb;})});}_0x452646=_[_0x6b01('0xbf')]({},_0x452646,_0x3eaa98[_0x6b01('0x51')]);return _0x47ef48['getOpenchannelAccounts'](_0x452646);}})[_0x6b01('0xf')](function(_0x5509c8){if(_0x5509c8){_0xe7bffb=_0x5509c8[_0x6b01('0x44')];if(!_0x3eaa98[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x452646[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x3eaa98['query']['limit']);_0x452646[_0x6b01('0x1c')]=qs['offset'](_0x3eaa98[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x47ef48[_0x6b01('0x140')](_0x452646);}})['then'](function(_0x3603f3){if(_0x3603f3){return _0x3603f3?{'count':_0xe7bffb,'rows':_0x3603f3}:null;}})[_0x6b01('0xf')](respondWithResult(_0x1cd5a4,null))[_0x6b01('0x17')](handleError(_0x1cd5a4,null));};exports[_0x6b01('0x142')]=function(_0x334af1,_0x494477){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x334af1[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x494477,null))[_0x6b01('0xf')](function(_0x1e4cf2){if(_0x1e4cf2){return _0x1e4cf2['addOpenchannelAccounts'](_0x334af1['body'][_0x6b01('0x5a')],_['omit'](_0x334af1['body'],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0x494477,null))[_0x6b01('0x17')](handleError(_0x494477,null));};exports[_0x6b01('0x143')]=function(_0x21c6a3,_0x4d710b){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x21c6a3['params']['id']}})['then'](handleEntityNotFound(_0x4d710b,null))[_0x6b01('0xf')](function(_0x1aea40){if(_0x1aea40){return _0x1aea40[_0x6b01('0x143')](_0x21c6a3[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})[_0x6b01('0xf')](respondWithStatusCode(_0x4d710b,null))['catch'](handleError(_0x4d710b,null));};exports[_0x6b01('0x144')]=function(_0x1d1744,_0x33a502){var _0x4bb2b5={};var _0x53d6a6={};var _0x98e2f9;var _0x3a9c9d;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x1d1744[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x33a502,null))[_0x6b01('0xf')](function(_0x54e17d){if(_0x54e17d){_0x98e2f9=_0x54e17d;_0x53d6a6['model']=_[_0x6b01('0x4d')](db[_0x6b01('0x145')]['rawAttributes']);_0x53d6a6['query']=_[_0x6b01('0x4d')](_0x1d1744[_0x6b01('0x3d')]);_0x53d6a6[_0x6b01('0x4e')]=_['intersection'](_0x53d6a6[_0x6b01('0x4c')],_0x53d6a6['query']);_0x4bb2b5[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x53d6a6['model'],qs[_0x6b01('0x50')](_0x1d1744[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x4bb2b5[_0x6b01('0x40')]=_0x4bb2b5[_0x6b01('0x40')][_0x6b01('0x44')]?_0x4bb2b5[_0x6b01('0x40')]:_0x53d6a6[_0x6b01('0x4c')];_0x4bb2b5['order']=qs['sort'](_0x1d1744[_0x6b01('0x3d')]['sort']);_0x4bb2b5[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x1d1744[_0x6b01('0x3d')],_0x53d6a6[_0x6b01('0x4e')]));if(_0x1d1744[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x4bb2b5[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x4bb2b5['where'],{'$or':_['map'](_0x4bb2b5[_0x6b01('0x40')],function(_0x18a11d){var _0x4e14c9={};_0x4e14c9[_0x18a11d]={'$like':'%'+_0x1d1744[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x4e14c9;})});}_0x4bb2b5=_[_0x6b01('0xbf')]({},_0x4bb2b5,_0x1d1744[_0x6b01('0x51')]);return _0x98e2f9['getSmsAccounts'](_0x4bb2b5);}})[_0x6b01('0xf')](function(_0x4c0df3){if(_0x4c0df3){_0x3a9c9d=_0x4c0df3[_0x6b01('0x44')];if(!_0x1d1744[_0x6b01('0x3d')]['hasOwnProperty']('nolimit')){_0x4bb2b5[_0x6b01('0x1e')]=qs['limit'](_0x1d1744['query'][_0x6b01('0x1e')]);_0x4bb2b5['offset']=qs[_0x6b01('0x1c')](_0x1d1744[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x98e2f9[_0x6b01('0x144')](_0x4bb2b5);}})[_0x6b01('0xf')](function(_0x53d1a7){if(_0x53d1a7){return _0x53d1a7?{'count':_0x3a9c9d,'rows':_0x53d1a7}:null;}})['then'](respondWithResult(_0x33a502,null))[_0x6b01('0x17')](handleError(_0x33a502,null));};exports[_0x6b01('0x146')]=function(_0x34a141,_0x2c2b28){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x34a141[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x2c2b28,null))[_0x6b01('0xf')](function(_0x57e772){if(_0x57e772){return _0x57e772[_0x6b01('0x146')](_0x34a141[_0x6b01('0x55')][_0x6b01('0x5a')],_[_0x6b01('0x59')](_0x34a141[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0x2c2b28,null))['catch'](handleError(_0x2c2b28,null));};exports['removeSmsAccounts']=function(_0x553890,_0x577e2d){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x553890['params']['id']}})['then'](handleEntityNotFound(_0x577e2d,null))['then'](function(_0x76a222){if(_0x76a222){return _0x76a222[_0x6b01('0x147')](_0x553890[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})['then'](respondWithStatusCode(_0x577e2d,null))[_0x6b01('0x17')](handleError(_0x577e2d,null));};exports['getChatWebsites']=function(_0x29f6f7,_0x1681d7){var _0x50f95f={};var _0x540951={};var _0x5df840;var _0x5ba7d6;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x29f6f7[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x1681d7,null))[_0x6b01('0xf')](function(_0x12fdd0){if(_0x12fdd0){_0x5df840=_0x12fdd0;_0x540951[_0x6b01('0x4c')]=_['keys'](db[_0x6b01('0x148')]['rawAttributes']);_0x540951[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x29f6f7[_0x6b01('0x3d')]);_0x540951[_0x6b01('0x4e')]=_['intersection'](_0x540951[_0x6b01('0x4c')],_0x540951[_0x6b01('0x3d')]);_0x50f95f['attributes']=_[_0x6b01('0x4f')](_0x540951['model'],qs[_0x6b01('0x50')](_0x29f6f7[_0x6b01('0x3d')]['fields']));_0x50f95f['attributes']=_0x50f95f[_0x6b01('0x40')]['length']?_0x50f95f['attributes']:_0x540951[_0x6b01('0x4c')];_0x50f95f[_0x6b01('0xc7')]=qs['sort'](_0x29f6f7[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x50f95f[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x29f6f7[_0x6b01('0x3d')],_0x540951[_0x6b01('0x4e')]));if(_0x29f6f7[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x50f95f[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x50f95f['where'],{'$or':_['map'](_0x50f95f[_0x6b01('0x40')],function(_0xebda43){var _0x552d6b={};_0x552d6b[_0xebda43]={'$like':'%'+_0x29f6f7[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x552d6b;})});}_0x50f95f=_['merge']({},_0x50f95f,_0x29f6f7[_0x6b01('0x51')]);return _0x5df840[_0x6b01('0x149')](_0x50f95f);}})[_0x6b01('0xf')](function(_0x275acf){if(_0x275acf){_0x5ba7d6=_0x275acf[_0x6b01('0x44')];if(!_0x29f6f7['query'][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x50f95f[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x29f6f7[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x50f95f[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x29f6f7['query'][_0x6b01('0x1c')]);}return _0x5df840['getChatWebsites'](_0x50f95f);}})[_0x6b01('0xf')](function(_0x40ecd9){if(_0x40ecd9){return _0x40ecd9?{'count':_0x5ba7d6,'rows':_0x40ecd9}:null;}})[_0x6b01('0xf')](respondWithResult(_0x1681d7,null))[_0x6b01('0x17')](handleError(_0x1681d7,null));};exports[_0x6b01('0x14a')]=function(_0x4b069b,_0xe588a6){return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x4b069b[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0xe588a6,null))[_0x6b01('0xf')](function(_0x44d963){if(_0x44d963){return _0x44d963[_0x6b01('0x14a')](_0x4b069b[_0x6b01('0x55')][_0x6b01('0x5a')],_[_0x6b01('0x59')](_0x4b069b['body'],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0xe588a6,null))[_0x6b01('0x17')](handleError(_0xe588a6,null));};exports[_0x6b01('0x14b')]=function(_0x48b34e,_0xc1fa99){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x48b34e[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0xc1fa99,null))[_0x6b01('0xf')](function(_0x547d9a){if(_0x547d9a){return _0x547d9a[_0x6b01('0x14b')](_0x48b34e['query'][_0x6b01('0x5a')]);}})['then'](respondWithStatusCode(_0xc1fa99,null))[_0x6b01('0x17')](handleError(_0xc1fa99,null));};exports[_0x6b01('0x14c')]=function(_0xa37626,_0x13df04){var _0x2d94d5={};var _0x1feb70={};var _0x3b9d4b;var _0x5c26bb;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0xa37626[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x13df04,null))[_0x6b01('0xf')](function(_0x22bb5c){if(_0x22bb5c){_0x3b9d4b=_0x22bb5c;_0x1feb70[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db['WhatsappAccount'][_0x6b01('0x35')]);_0x1feb70[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0xa37626[_0x6b01('0x3d')]);_0x1feb70[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x1feb70[_0x6b01('0x4c')],_0x1feb70[_0x6b01('0x3d')]);_0x2d94d5[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x1feb70['model'],qs['fields'](_0xa37626[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x2d94d5['attributes']=_0x2d94d5['attributes'][_0x6b01('0x44')]?_0x2d94d5[_0x6b01('0x40')]:_0x1feb70[_0x6b01('0x4c')];_0x2d94d5[_0x6b01('0xc7')]=qs['sort'](_0xa37626[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x2d94d5['where']=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0xa37626[_0x6b01('0x3d')],_0x1feb70['filters']));if(_0xa37626[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x2d94d5[_0x6b01('0x3b')]=_['merge'](_0x2d94d5['where'],{'$or':_['map'](_0x2d94d5[_0x6b01('0x40')],function(_0x1244e9){var _0x1551fc={};_0x1551fc[_0x1244e9]={'$like':'%'+_0xa37626['query']['filter']+'%'};return _0x1551fc;})});}_0x2d94d5=_[_0x6b01('0xbf')]({},_0x2d94d5,_0xa37626[_0x6b01('0x51')]);return _0x3b9d4b['getWhatsappAccounts'](_0x2d94d5);}})[_0x6b01('0xf')](function(_0x35c0c2){if(_0x35c0c2){_0x5c26bb=_0x35c0c2[_0x6b01('0x44')];if(!_0xa37626[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x2d94d5[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0xa37626[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x2d94d5[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0xa37626[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x3b9d4b['getWhatsappAccounts'](_0x2d94d5);}})[_0x6b01('0xf')](function(_0x25dff9){if(_0x25dff9){return _0x25dff9?{'count':_0x5c26bb,'rows':_0x25dff9}:null;}})[_0x6b01('0xf')](respondWithResult(_0x13df04,null))[_0x6b01('0x17')](handleError(_0x13df04,null));};exports[_0x6b01('0x14d')]=function(_0x57605a,_0x17911c){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x57605a[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x17911c,null))[_0x6b01('0xf')](function(_0x502939){if(_0x502939){return _0x502939[_0x6b01('0x14d')](_0x57605a['body'][_0x6b01('0x5a')],_['omit'](_0x57605a['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x17911c,null))[_0x6b01('0x17')](handleError(_0x17911c,null));};exports[_0x6b01('0x14e')]=function(_0x623999,_0xccb3d6){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x623999[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0xccb3d6,null))[_0x6b01('0xf')](function(_0x245451){if(_0x245451){return _0x245451['removeWhatsappAccounts'](_0x623999[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})['then'](respondWithStatusCode(_0xccb3d6,null))[_0x6b01('0x17')](handleError(_0xccb3d6,null));};exports[_0x6b01('0x14f')]=function(_0x4dbf3a,_0x12da57){var _0x3555b8={};var _0xba0e91={};var _0x529483;var _0x120ec3;return db[_0x6b01('0x3c')]['findOne']({'where':{'id':_0x4dbf3a[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x12da57,null))[_0x6b01('0xf')](function(_0x29f074){if(_0x29f074){_0x529483=_0x29f074;_0xba0e91[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0x150')][_0x6b01('0x35')]);_0xba0e91['query']=_[_0x6b01('0x4d')](_0x4dbf3a[_0x6b01('0x3d')]);_0xba0e91[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0xba0e91['model'],_0xba0e91[_0x6b01('0x3d')]);_0x3555b8[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0xba0e91[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x4dbf3a['query'][_0x6b01('0x50')]));_0x3555b8[_0x6b01('0x40')]=_0x3555b8[_0x6b01('0x40')]['length']?_0x3555b8[_0x6b01('0x40')]:_0xba0e91[_0x6b01('0x4c')];_0x3555b8[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x4dbf3a[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x3555b8[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x4dbf3a[_0x6b01('0x3d')],_0xba0e91[_0x6b01('0x4e')]));if(_0x4dbf3a['query'][_0x6b01('0x39')]){_0x3555b8['where']=_[_0x6b01('0xbf')](_0x3555b8['where'],{'$or':_[_0x6b01('0x2a')](_0x3555b8[_0x6b01('0x40')],function(_0x52da34){var _0x2604f4={};_0x2604f4[_0x52da34]={'$like':'%'+_0x4dbf3a['query'][_0x6b01('0x39')]+'%'};return _0x2604f4;})});}_0x3555b8=_['merge']({},_0x3555b8,_0x4dbf3a['options']);return _0x529483[_0x6b01('0x14f')](_0x3555b8);}})[_0x6b01('0xf')](function(_0x1453aa){if(_0x1453aa){_0x120ec3=_0x1453aa[_0x6b01('0x44')];if(!_0x4dbf3a[_0x6b01('0x3d')][_0x6b01('0xc0')]('nolimit')){_0x3555b8[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x4dbf3a['query'][_0x6b01('0x1e')]);_0x3555b8['offset']=qs[_0x6b01('0x1c')](_0x4dbf3a[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x529483[_0x6b01('0x14f')](_0x3555b8);}})['then'](function(_0x33bfff){if(_0x33bfff){return _0x33bfff?{'count':_0x120ec3,'rows':_0x33bfff}:null;}})[_0x6b01('0xf')](respondWithResult(_0x12da57,null))[_0x6b01('0x17')](handleError(_0x12da57,null));};exports[_0x6b01('0x151')]=function(_0x5c1960,_0x350356){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5c1960[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x350356,null))[_0x6b01('0xf')](function(_0x545d98){if(_0x545d98){return _0x545d98[_0x6b01('0x151')](_0x5c1960[_0x6b01('0x55')]['ids'],_[_0x6b01('0x59')](_0x5c1960[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0x350356,null))[_0x6b01('0x17')](handleError(_0x350356,null));};exports[_0x6b01('0x152')]=function(_0x1e1e5d,_0x19957b){return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x1e1e5d[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x19957b,null))[_0x6b01('0xf')](function(_0x5b9323){if(_0x5b9323){return _0x5b9323[_0x6b01('0x152')](_0x1e1e5d[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})[_0x6b01('0xf')](respondWithStatusCode(_0x19957b,null))[_0x6b01('0x17')](handleError(_0x19957b,null));};exports[_0x6b01('0x153')]=function(_0x151854,_0x12646f){var _0x4f10dd={},_0x1b6d76={},_0x284798={'count':0x0,'rows':[]};var _0x2fd617=db[_0x6b01('0x154')]['rawAttributes'];_0x1b6d76[_0x6b01('0x4c')]=_['keys'](_0x2fd617);_0x1b6d76[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x151854[_0x6b01('0x3d')]);_0x1b6d76[_0x6b01('0x4e')]=_['intersection'](_0x1b6d76[_0x6b01('0x4c')],_0x1b6d76['query']);_0x1b6d76[_0x6b01('0x4e')]=_[_0x6b01('0x155')](_0x1b6d76['filters'],[_0x6b01('0x156'),_0x6b01('0x157'),_0x6b01('0x158'),_0x6b01('0x159'),_0x6b01('0x15a'),'$lte',_0x6b01('0x15b'),_0x6b01('0x15c'),_0x6b01('0x15d'),_0x6b01('0x15e'),_0x6b01('0x15f'),_0x6b01('0x160'),'$notIn',_0x6b01('0x161'),_0x6b01('0x162'),_0x6b01('0x163'),_0x6b01('0x164'),_0x6b01('0x161'),'$overlap',_0x6b01('0x165'),_0x6b01('0x166'),_0x6b01('0x167')]);_0x4f10dd[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x1b6d76[_0x6b01('0x4c')],qs['fields'](_0x151854[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x4f10dd[_0x6b01('0x40')]=_0x4f10dd[_0x6b01('0x40')][_0x6b01('0x44')]?_0x4f10dd[_0x6b01('0x40')]:_0x1b6d76[_0x6b01('0x4c')];if(!_0x151854[_0x6b01('0x3d')][_0x6b01('0xc0')]('nolimit')){_0x4f10dd[_0x6b01('0x1e')]=qs['limit'](_0x151854[_0x6b01('0x3d')]['limit']);_0x4f10dd['offset']=qs['offset'](_0x151854[_0x6b01('0x3d')][_0x6b01('0x1c')]);}_0x4f10dd[_0x6b01('0xc7')]=qs['sort'](_0x151854[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x4f10dd['where']=qs[_0x6b01('0x4e')](_['pick'](_0x151854['query'],_0x1b6d76['filters']));if(_0x151854[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x4f10dd[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x4f10dd[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x4f10dd[_0x6b01('0x40')],function(_0x3ce04e){var _0x17f8db={};_0x17f8db[_0x3ce04e]={'$like':'%'+_0x151854[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x17f8db;})});}_0x4f10dd[_0x6b01('0x3b')]={'$and':[_0x4f10dd[_0x6b01('0x3b')],{'$or':[{'UserId':_0x151854['params']['id']},{'OwnerId':_0x151854['params']['id']}]}]};_0x4f10dd=_[_0x6b01('0xbf')]({},_0x4f10dd,_0x151854['options']);var _0x501894={'where':_0x4f10dd[_0x6b01('0x3b')]};return db['CmHopper']['count'](_0x501894)[_0x6b01('0xf')](function(_0x13877c){_0x284798[_0x6b01('0x1f')]=_0x13877c;if(_0x151854['query'][_0x6b01('0x3e')]){_0x4f10dd[_0x6b01('0x3f')]=[{'attributes':['id',_0x6b01('0x168'),_0x6b01('0x169'),'phone'],'model':db['CmContact'],'as':_0x6b01('0x16a')},{'attributes':['id',_0x6b01('0x32'),_0x6b01('0x16b')],'model':db['VoiceQueue'],'as':_0x6b01('0xc8')}];}return db['CmHopper'][_0x6b01('0x41')](_0x4f10dd);})[_0x6b01('0xf')](function(_0x31c7c5){_0x284798[_0x6b01('0x42')]=_0x31c7c5;return _0x284798;})['then'](respondWithFilteredResult(_0x12646f,_0x4f10dd))[_0x6b01('0x17')](handleError(_0x12646f,null));};exports[_0x6b01('0x16c')]=function(_0x4a162e,_0x3b98bf){if(!_[_0x6b01('0x60')](_0x4a162e['user']['id'])&&(_0x4a162e[_0x6b01('0x26')][_0x6b01('0x2d')]==_0x6b01('0x24')||_0x4a162e[_0x6b01('0x26')]['role']=='user')){return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x4a162e[_0x6b01('0x56')]['id']},'raw':!![]})[_0x6b01('0xf')](function(_0x278825){return authService[_0x6b01('0x16d')](_0x278825);})['then'](function(_0x7b78bf){if(_0x7b78bf){return _0x3b98bf[_0x6b01('0x19')](0xc8)['json']({'api_key':_0x7b78bf[_0x6b01('0x16e')]});}else{return _0x3b98bf[_0x6b01('0x19')](0xcc)[_0x6b01('0x1b')]({'message':_0x6b01('0x16f')});}})[_0x6b01('0x17')](handleError(_0x3b98bf,0x193));}else{return _0x3b98bf[_0x6b01('0x19')](0x191)[_0x6b01('0x1b')]({'message':_0x6b01('0x170')});}};exports[_0x6b01('0x171')]=function(_0x4d761b,_0x4e940d){if(!_[_0x6b01('0x60')](_0x4d761b['user']['id'])&&(_0x4d761b[_0x6b01('0x26')][_0x6b01('0x2d')]=='admin'||_0x4d761b['user'][_0x6b01('0x2d')]==_0x6b01('0x26'))){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x4d761b[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](function(_0x423044){return authService['generateApiKey'](_0x423044);})[_0x6b01('0xf')](function(_0x12623c){return db[_0x6b01('0x3c')][_0x6b01('0x22')]({'apiKeyIat':_0x12623c[_0x6b01('0x172')],'apiKeyNonce':_0x12623c[_0x6b01('0x173')]},{'where':{'id':_0x4d761b[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](function(){return _0x4e940d[_0x6b01('0x19')](0xc8)['json']({'api_key':_0x12623c[_0x6b01('0x16e')]});});})['catch'](handleError(_0x4e940d,0x193));}else{return _0x4e940d[_0x6b01('0x19')](0x191)[_0x6b01('0x1b')]({'message':_0x6b01('0x170')});}};exports[_0x6b01('0x174')]=function(_0x233eab,_0x5e48ea){if(!_[_0x6b01('0x60')](_0x233eab[_0x6b01('0x26')]['id'])&&(_0x233eab[_0x6b01('0x26')][_0x6b01('0x2d')]==_0x6b01('0x24')||_0x233eab['user'][_0x6b01('0x2d')]==_0x6b01('0x26'))){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x233eab[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x5e48ea,null))[_0x6b01('0xf')](function(_0xb5ca9b){if(_0xb5ca9b&&_0xb5ca9b['apiKeyNonce']&&_0xb5ca9b[_0x6b01('0x175')])return _0xb5ca9b;else throw{'message':'API\x20key\x20not\x20available'};})[_0x6b01('0xf')](function(_0x427632){return db[_0x6b01('0x3c')][_0x6b01('0x22')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x233eab['params']['id']}});})['then'](respondWithStatusCode(_0x5e48ea,0xc8))[_0x6b01('0x17')](handleError(_0x5e48ea,0x193));}else{return _0x5e48ea['status'](0x191)[_0x6b01('0x1b')]({'message':_0x6b01('0x170')});}};exports[_0x6b01('0x176')]=function(_0x3ae15d,_0x4b4e24){var _0x47f644=_0x3ae15d[_0x6b01('0x26')][_0x6b01('0x23')]({'plain':!![]});if(!_0x47f644){return _0x4b4e24[_0x6b01('0x19')](0x191)[_0x6b01('0x33')](_0x6b01('0x177'));}else{return _0x4b4e24[_0x6b01('0x19')](0xc8)[_0x6b01('0x1b')](_0x47f644);}};exports[_0x6b01('0x178')]=function(_0x32073b,_0x2011d2){var _0x572666={'offset':0x0},_0x1586f9={'count':0x0,'rows':[]};Promise[_0x6b01('0xf4')]()[_0x6b01('0xf')](function(){if(!_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')]&&!_0x32073b[_0x6b01('0x3d')][_0x6b01('0x179')]&&!_0x32073b[_0x6b01('0x3d')][_0x6b01('0x17a')])return[];return Promise[_0x6b01('0xf4')]()[_0x6b01('0xf')](function(){var _0x206603=[];if(!_[_0x6b01('0x17b')](_0x32073b[_0x6b01('0x3d')][_0x6b01('0x179')])){_0x206603[_0x6b01('0x47')](db[_0x6b01('0x104')][_0x6b01('0x41')]({'attributes':['id','name'],'where':{'id':_0x32073b[_0x6b01('0x3d')][_0x6b01('0x179')]}}));}if(!_[_0x6b01('0x17b')](_0x32073b['query'][_0x6b01('0x17a')])){_0x206603[_0x6b01('0x47')](db['VoiceQueue'][_0x6b01('0x41')]({'attributes':['id',_0x6b01('0x32')],'type':'inbound','where':{'id':_0x32073b[_0x6b01('0x3d')][_0x6b01('0x17a')]}}));}return Promise[_0x6b01('0x4b')](_0x206603);})[_0x6b01('0xf')](function(_0x144708){var _0x22aa5f=_[_0x6b01('0x110')](_0x144708)[_0x6b01('0x2a')](function(_0xcf9f4d){return _0xcf9f4d['getAgents']({'attributes':['id',_0x6b01('0x32'),_0x6b01('0x5b'),_0x6b01('0x92')],'raw':!![]});});return Promise[_0x6b01('0x4b')](_0x22aa5f);})[_0x6b01('0xf')](function(_0x1ff1ad){var _0x502e30=_[_0x6b01('0x110')](_0x1ff1ad);if(!_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')])return _0x502e30;if(_[_0x6b01('0x17b')](_0x502e30)){return db[_0x6b01('0x3c')]['findAll']({'attributes':['id',_0x6b01('0x32'),_0x6b01('0x5b'),'online'],'where':{'role':_0x6b01('0x6c'),'$or':[db[_0x6b01('0x62')][_0x6b01('0x3b')](db['sequelize']['fn'](_0x6b01('0x17c'),db['sequelize'][_0x6b01('0x17d')](_0x6b01('0x32'))),{'$like':'%'+_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')]['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'}}]},'raw':!![]});}else{return _(_0x502e30)['flatten']()['filter'](function(_0x342374){return _0x342374[_0x6b01('0x32')]['toLowerCase']()[_0x6b01('0x2c')](_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')][_0x6b01('0x9a')]())||_0x342374['internal'][_0x6b01('0x17e')]()['includes'](_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')]);})[_0x6b01('0x2b')]();}})[_0x6b01('0xf')](function(_0x3d8dcf){var _0x59f418='name';var _0x3f1d05=_0x6b01('0x17f');if(_0x32073b[_0x6b01('0x3d')]['sort']){var _0x3f1d05=_0x32073b[_0x6b01('0x3d')]['sort'][0x0]==='-'?_0x6b01('0x180'):'asc';var _0x59f418=_0x3f1d05===_0x6b01('0x17f')?_0x32073b[_0x6b01('0x3d')]['sort']:_0x32073b[_0x6b01('0x3d')][_0x6b01('0xbd')][_0x6b01('0x181')](0x1);}return _(_0x3d8dcf)[_0x6b01('0x182')]('id')[_0x6b01('0x183')]([function(_0x23ffa8){return _0x59f418===_0x6b01('0x32')?_0x23ffa8[_0x59f418][_0x6b01('0x9a')]():_0x23ffa8[_0x59f418];}],[_0x3f1d05])[_0x6b01('0x2a')](function(_0xff2fae){return _[_0x6b01('0xbe')](_0xff2fae,['id','name','internal',_0x6b01('0x92')]);})[_0x6b01('0x2b')]();})[_0x6b01('0xf')](function(_0x1f8608){return client[_0x6b01('0x184')]('Agents',_0x32073b)[_0x6b01('0xf')](function(_0x8cc12e){if(_0x8cc12e[_0x6b01('0x13')])throw new Error(_0x6b01('0x185'));var _0x310dee=_0x8cc12e['result'];var _0xabd5c3=jayson[_0x6b01('0xe')][_0x6b01('0x186')]({'port':0x232c});return _0xabd5c3[_0x6b01('0x184')](_0x6b01('0x27'),_0x32073b)[_0x6b01('0xf')](function(_0x138833){if(_0x138833[_0x6b01('0x13')])throw new Error(_0x6b01('0x187'));var _0x4f9505=_0x138833['result'];return _[_0x6b01('0xbf')]({},_0x4f9505,_0x310dee);});})[_0x6b01('0xf')](function(_0x820a53){return _[_0x6b01('0x2a')](_0x1f8608,function(_0x39e851){var _0x27655d=_[_0x6b01('0x2e')](_0x820a53[_0x6b01('0x42')],['id',_0x39e851['id']]);if(!_0x27655d||!_0x39e851[_0x6b01('0x92')]){_0x39e851[_0x6b01('0x19')]=_0x6b01('0x188');}else if(_0x27655d['voicePause']){_0x39e851[_0x6b01('0x19')]=_0x6b01('0xf6');}else{_0x39e851['status']=_['includes']([_0x6b01('0x189'),_0x6b01('0x18a'),_0x6b01('0x18b'),_0x6b01('0x18c'),null,undefined],_0x27655d[_0x6b01('0x18d')])?_0x6b01('0x92'):_0x6b01('0x18e');}return _0x39e851;});});});})[_0x6b01('0xf')](function(_0x43af22){if(!_0x32073b['query']['hasOwnProperty']('nolimit')){_0x572666[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x32073b['query'][_0x6b01('0x1e')]||0xa);_0x572666['offset']=qs[_0x6b01('0x1c')](_0x32073b[_0x6b01('0x3d')][_0x6b01('0x1c')]);}_0x1586f9[_0x6b01('0x1f')]=_0x43af22['length'];_0x1586f9[_0x6b01('0x42')]=_0x572666[_0x6b01('0x1e')]?_0x43af22['slice'](_0x572666[_0x6b01('0x1c')],_0x572666[_0x6b01('0x1c')]+_0x572666[_0x6b01('0x1e')]):_0x43af22;return _0x1586f9;})[_0x6b01('0xf')](respondWithFilteredResult(_0x2011d2,_0x572666))[_0x6b01('0x17')](handleError(_0x2011d2,null));};function get_open_tabs(_0x11fa92,_0x55f646){var _0x1b8401=_0x11fa92['charAt'](0x0)['toUpperCase']()+_0x11fa92[_0x6b01('0x18f')](0x1);var _0x305d99={'type':db[_0x6b01('0x84')][_0x6b01('0x64')][_0x6b01('0x65')],'raw':!![]};return new BPromise(function(_0x371a7d,_0x1e4346){var _0x3498b2=squel[_0x6b01('0x190')]()['field'](_0x6b01('0x191')+_0x1b8401+_0x6b01('0x192'),'id')[_0x6b01('0x193')](_0x6b01('0x194'))[_0x6b01('0x66')](_0x6b01('0x195')+_0x11fa92+_0x6b01('0x196'),'ui')[_0x6b01('0x3b')](_0x6b01('0x197'),_0x55f646['id']);return db[_0x6b01('0x62')][_0x6b01('0x3d')](_0x3498b2[_0x6b01('0x17e')](),_0x305d99)[_0x6b01('0xf')](function(_0x22123f){_0x55f646[_0x1b8401+_0x6b01('0x198')]=_0x22123f;_0x371a7d(_0x22123f);})['catch'](function(_0x5f1dbe){_0x1e4346(_0x5f1dbe);});});};
\ No newline at end of file
+var _0xc6ac=['include','attributes','push','findAll','rows','openTabs','true','length','chat','dataValues','sms','mail','openchannel','whatsapp','all','show','model','differenceBy','keys','filters','intersection','fields','merge','options','find','fax','body','params','describe','addContacts','ids','internal','Setting','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)','from','voicemail','VoiceMail','fullname','101','102','103','113','110','104','106','107','108','109','100','111','create','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','some','isEmpty','changePassword','oldPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','channel','loginInPause','voicePause','interface','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','QueueId','Queue:save','VoiceQueue','voice','online','format','SIP/%s','UserVoiceQueueRt','isValidChannel','remove','isArray','Queue:remove','emit','addAvatar','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','order','sort','where','pick','filter','hasOwnProperty','CmList','List','color','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','upsert','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','LOGININPAUSE','MemberReport','bulkCreate','concat','resolve','logout','update','pause','QueuePause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','omit','setDataValue','Voice','getChatQueues','Chat','Mail','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','flatten','transaction','addAgent','TeamVoicePrefix','UserVoicePrefix','removeTeams','getMailQueues','getSmsQueues','Openchannel','removeAgent','getDataValue','VoicePrefixId','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$eq','$not','$notBetween','$in','$notIn','$like','$iLike','$contains','$contained','$any','firstName','lastName','CmContact','Contact','dialActive','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','col','toString','asc','desc','substring','uniqBy','orderBy','request','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','ringing','busy','slice','charAt','toUpperCase','QueryTypes','SELECT','select','InteractionId','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','http','then','info','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','User,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','get','role','Users','user','Agents','agent','Telephones','telephone','ignore','map','value','includes','stack','name','send','index','User','rawAttributes','fieldName','type','password','salt','getOptions','query','includeAll'];(function(_0x3d73ba,_0x356e23){var _0x47e406=function(_0x90df31){while(--_0x90df31){_0x3d73ba['push'](_0x3d73ba['shift']());}};_0x47e406(++_0x356e23);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x33c8ef,_0x1d9e21){_0x33c8ef=_0x33c8ef-0x0;var _0x2647e4=_0xc6ac[_0x33c8ef];return _0x2647e4;};'use strict';var moment=require(_0xcc6a('0x0'));var BPromise=require(_0xcc6a('0x1'));var util=require(_0xcc6a('0x2'));var path=require(_0xcc6a('0x3'));var fs=require('fs');var _=require(_0xcc6a('0x4'));var squel=require(_0xcc6a('0x5'));var jayson=require(_0xcc6a('0x6'));var Redis=require(_0xcc6a('0x7'));var authService=require(_0xcc6a('0x8'));var qs=require(_0xcc6a('0x9'));var logger=require(_0xcc6a('0xa'))(_0xcc6a('0xb'));var utils=require(_0xcc6a('0xc'));var config=require(_0xcc6a('0xd'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc6a('0xe'))['db'];var socket=require(_0xcc6a('0xf'))(new Redis(config[_0xcc6a('0x10')]));require('./user.socket')[_0xcc6a('0x11')](socket);config[_0xcc6a('0x10')]=_[_0xcc6a('0x12')](config[_0xcc6a('0x10')],{'host':_0xcc6a('0x13'),'port':0x18eb});var client=jayson['client'][_0xcc6a('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x290119,_0x109693,_0x4f034a,_0x1d91a5){return new BPromise(function(_0x9e9a63,_0x27b63a){var _0x55af93=_0x1d91a5||client;return _0x55af93['request'](_0x290119,_0x4f034a)[_0xcc6a('0x15')](function(_0x211444){logger[_0xcc6a('0x16')]('User,\x20%s,\x20%s',_0x109693,'request\x20sent');logger[_0xcc6a('0x17')](_0xcc6a('0x18'),_0x109693,_0xcc6a('0x19'),JSON[_0xcc6a('0x1a')](_0x211444));if(_0x211444[_0xcc6a('0x1b')]){if(_0x211444[_0xcc6a('0x1b')][_0xcc6a('0x1c')]===0x1f4){logger[_0xcc6a('0x1b')]('User,\x20%s,\x20%s',_0x109693,_0x211444['error']['message']);return _0x27b63a(_0x211444[_0xcc6a('0x1b')][_0xcc6a('0x1d')]);}logger[_0xcc6a('0x1b')](_0xcc6a('0x1e'),_0x109693,_0x211444[_0xcc6a('0x1b')][_0xcc6a('0x1d')]);return _0x9e9a63(_0x211444[_0xcc6a('0x1b')][_0xcc6a('0x1d')]);}else{logger[_0xcc6a('0x16')](_0xcc6a('0x1e'),_0x109693,_0xcc6a('0x19'));_0x9e9a63(_0x211444['result'][_0xcc6a('0x1d')]);}})[_0xcc6a('0x1f')](function(_0x355b6f){logger[_0xcc6a('0x1b')](_0xcc6a('0x1e'),_0x109693,_0x355b6f);_0x27b63a(_0x355b6f);});});}function respondWithStatusCode(_0x30b8ed,_0x36c80f){_0x36c80f=_0x36c80f||0xcc;return function(_0x43f510){if(_0x43f510){return _0x30b8ed[_0xcc6a('0x20')](_0x36c80f);}return _0x30b8ed[_0xcc6a('0x21')](_0x36c80f)[_0xcc6a('0x22')]();};}function respondWithResult(_0x845088,_0x51be9a){_0x51be9a=_0x51be9a||0xc8;return function(_0x41c4c8){if(_0x41c4c8){return _0x845088[_0xcc6a('0x21')](_0x51be9a)[_0xcc6a('0x23')](_0x41c4c8);}};}function respondWithFilteredResult(_0x581aae,_0x10016a){return function(_0x294486){if(_0x294486){var _0x3a00e5=typeof _0x10016a[_0xcc6a('0x24')]===_0xcc6a('0x25')&&typeof _0x10016a[_0xcc6a('0x26')]==='undefined';var _0x26def8=_0x294486[_0xcc6a('0x27')];var _0x3514f3=_0x3a00e5?0x0:_0x10016a['offset'];var _0x3afb3a=_0x3a00e5?_0x294486[_0xcc6a('0x27')]:_0x10016a['offset']+_0x10016a[_0xcc6a('0x26')];var _0x8b1b2b;if(_0x3afb3a>=_0x26def8){_0x3afb3a=_0x26def8;_0x8b1b2b=0xc8;}else{_0x8b1b2b=0xce;}_0x581aae[_0xcc6a('0x21')](_0x8b1b2b);return _0x581aae[_0xcc6a('0x28')]('Content-Range',_0x3514f3+'-'+_0x3afb3a+'/'+_0x26def8)[_0xcc6a('0x23')](_0x294486);}return null;};}function saveUpdates(_0x3cf14c){return function(_0x2c6d88){if(_0x2c6d88){return _0x2c6d88['update'](_0x3cf14c)[_0xcc6a('0x15')](function(_0x5308d4){return _0x5308d4;});}return null;};}function removeEntity(_0x4f67d3){return function(_0x33b72b){if(_0x33b72b){return _0x33b72b[_0xcc6a('0x29')]()[_0xcc6a('0x15')](function(){var _0x11b481=_0x33b72b[_0xcc6a('0x2a')]({'plain':!![]});if(_0x11b481[_0xcc6a('0x2b')]==='admin')return;var _0x7b2b54=[{'name':_0xcc6a('0x2c'),'value':_0xcc6a('0x2d'),'ignore':!![]},{'name':_0xcc6a('0x2e'),'value':_0xcc6a('0x2f'),'ignore':![]},{'name':_0xcc6a('0x30'),'value':_0xcc6a('0x31'),'ignore':![]}];var _0xcbe838=_(_0x7b2b54)['filter'](_0xcc6a('0x32'))[_0xcc6a('0x33')](_0xcc6a('0x34'))[_0xcc6a('0x34')]();if(_[_0xcc6a('0x35')](_0xcbe838,_0x11b481[_0xcc6a('0x2b')])){return;}var _0x28b16e=_['find'](_0x7b2b54,[_0xcc6a('0x34'),_0x11b481['role']])['name'];return db['UserProfileResource'][_0xcc6a('0x29')]({'where':{'type':_0x28b16e,'resourceId':_0x11b481['id']}})[_0xcc6a('0x15')](function(){return _0x33b72b;});})[_0xcc6a('0x15')](function(){_0x4f67d3[_0xcc6a('0x21')](0xcc)[_0xcc6a('0x22')]();});}};}function handleEntityNotFound(_0x5856af){return function(_0x58f6ee){if(!_0x58f6ee){_0x5856af[_0xcc6a('0x20')](0x194);}return _0x58f6ee;};}function handleError(_0x11173a,_0x4598a8){_0x4598a8=_0x4598a8||0x1f4;return function(_0x538ea5){logger[_0xcc6a('0x1b')](_0x538ea5[_0xcc6a('0x36')]);if(_0x538ea5[_0xcc6a('0x37')]){delete _0x538ea5[_0xcc6a('0x37')];}_0x11173a[_0xcc6a('0x21')](_0x4598a8)[_0xcc6a('0x38')](_0x538ea5);};}exports[_0xcc6a('0x39')]=function(_0x18a252,_0x2a1cd2){var _0x373d5b={},_0x5b11c8={'count':0x0,'rows':[]};var _0x2c14ba=_(db[_0xcc6a('0x3a')][_0xcc6a('0x3b')])[_0xcc6a('0x33')](function(_0x33e8c8){return{'name':_0x33e8c8[_0xcc6a('0x3c')],'type':_0x33e8c8[_0xcc6a('0x3d')]['key']};})['filter'](function(_0x1d3e45){return!_[_0xcc6a('0x35')]([_0xcc6a('0x3e'),_0xcc6a('0x3f')],_0x1d3e45[_0xcc6a('0x37')]);})[_0xcc6a('0x34')]();_0x373d5b=qs[_0xcc6a('0x40')](_0x2c14ba,_0x18a252);var _0x1199f1={'where':_0x373d5b['where']};return db['User'][_0xcc6a('0x27')](_0x1199f1)['then'](function(_0x578525){_0x5b11c8['count']=_0x578525;if(_0x18a252[_0xcc6a('0x41')][_0xcc6a('0x42')]){_0x373d5b[_0xcc6a('0x43')]=[{'all':!![]}];}if(!_[_0xcc6a('0x35')](_0x373d5b[_0xcc6a('0x44')],'id')){_0x373d5b['attributes'][_0xcc6a('0x45')]('id');}return db[_0xcc6a('0x3a')][_0xcc6a('0x46')](_0x373d5b);})[_0xcc6a('0x15')](function(_0x14ca90){_0x5b11c8[_0xcc6a('0x47')]=_0x14ca90;if(_0x18a252['query'][_0xcc6a('0x48')]===_0xcc6a('0x49')){var _0x103eee=[];for(var _0x11c137=0x0;_0x11c137<_0x5b11c8['rows'][_0xcc6a('0x4a')];_0x11c137++){_0x103eee['push'](get_open_tabs(_0xcc6a('0x4b'),_0x5b11c8[_0xcc6a('0x47')][_0x11c137][_0xcc6a('0x4c')]));_0x103eee['push'](get_open_tabs(_0xcc6a('0x4d'),_0x5b11c8[_0xcc6a('0x47')][_0x11c137][_0xcc6a('0x4c')]));_0x103eee['push'](get_open_tabs('fax',_0x5b11c8[_0xcc6a('0x47')][_0x11c137][_0xcc6a('0x4c')]));_0x103eee[_0xcc6a('0x45')](get_open_tabs(_0xcc6a('0x4e'),_0x5b11c8[_0xcc6a('0x47')][_0x11c137]['dataValues']));_0x103eee[_0xcc6a('0x45')](get_open_tabs(_0xcc6a('0x4f'),_0x5b11c8['rows'][_0x11c137][_0xcc6a('0x4c')]));_0x103eee[_0xcc6a('0x45')](get_open_tabs(_0xcc6a('0x50'),_0x5b11c8[_0xcc6a('0x47')][_0x11c137][_0xcc6a('0x4c')]));}return BPromise[_0xcc6a('0x51')](_0x103eee)['then'](function(_0x4e1a0b){return _0x5b11c8;});}else{return _0x5b11c8;}})['then'](respondWithFilteredResult(_0x2a1cd2,_0x373d5b))[_0xcc6a('0x1f')](handleError(_0x2a1cd2,null));};exports[_0xcc6a('0x52')]=function(_0x13f4df,_0x323bb7){var _0x4a25ce={'raw':![],'where':{'id':_0x13f4df['params']['id']}},_0x1c3bb8={};_0x1c3bb8[_0xcc6a('0x53')]=_[_0xcc6a('0x54')](_[_0xcc6a('0x55')](db[_0xcc6a('0x3a')][_0xcc6a('0x3b')]),[_0xcc6a('0x3e'),'salt']);_0x1c3bb8[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x13f4df[_0xcc6a('0x41')]);_0x1c3bb8[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x1c3bb8[_0xcc6a('0x53')],_0x1c3bb8[_0xcc6a('0x41')]);_0x4a25ce[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x1c3bb8[_0xcc6a('0x53')],qs['fields'](_0x13f4df[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x4a25ce[_0xcc6a('0x44')]=_0x4a25ce[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x4a25ce[_0xcc6a('0x44')]:_0x1c3bb8['model'];if(_0x13f4df['query'][_0xcc6a('0x42')]){_0x4a25ce['include']=[{'all':!![]}];}_0x4a25ce=_[_0xcc6a('0x59')]({},_0x4a25ce,_0x13f4df[_0xcc6a('0x5a')]);if(!_[_0xcc6a('0x35')](_0x4a25ce[_0xcc6a('0x44')],'id')){_0x4a25ce[_0xcc6a('0x44')][_0xcc6a('0x45')]('id');}return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')](_0x4a25ce)[_0xcc6a('0x15')](handleEntityNotFound(_0x323bb7,null))[_0xcc6a('0x15')](function(_0x12224f){var _0x47c131=[];values=_0x12224f;if(_0x13f4df[_0xcc6a('0x41')]['openTabs']===_0xcc6a('0x49')){_0x47c131[_0xcc6a('0x45')](get_open_tabs(_0xcc6a('0x4b'),_0x12224f['dataValues']));_0x47c131[_0xcc6a('0x45')](get_open_tabs('sms',_0x12224f[_0xcc6a('0x4c')]));_0x47c131['push'](get_open_tabs(_0xcc6a('0x4f'),_0x12224f[_0xcc6a('0x4c')]));_0x47c131[_0xcc6a('0x45')](get_open_tabs(_0xcc6a('0x50'),_0x12224f[_0xcc6a('0x4c')]));_0x47c131[_0xcc6a('0x45')](get_open_tabs(_0xcc6a('0x5c'),_0x12224f[_0xcc6a('0x4c')]));_0x47c131['push'](get_open_tabs(_0xcc6a('0x4e'),_0x12224f['dataValues']));return BPromise[_0xcc6a('0x51')](_0x47c131);}else{return values;}})['then'](function(_0x1807cb){return values;})[_0xcc6a('0x15')](respondWithResult(_0x323bb7,null))[_0xcc6a('0x1f')](handleError(_0x323bb7,null));};exports['update']=function(_0x2fa7fa,_0x5e4447){if(_0x2fa7fa['body']['id']){delete _0x2fa7fa[_0xcc6a('0x5d')]['id'];}delete _0x2fa7fa[_0xcc6a('0x5d')][_0xcc6a('0x2b')];return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x2fa7fa[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x5e4447,null))[_0xcc6a('0x15')](saveUpdates(_0x2fa7fa[_0xcc6a('0x5d')],null))[_0xcc6a('0x15')](respondWithResult(_0x5e4447,null))[_0xcc6a('0x1f')](handleError(_0x5e4447,null));};exports[_0xcc6a('0x5f')]=function(_0x2cc561,_0x483aa4){return db[_0xcc6a('0x3a')][_0xcc6a('0x5f')]()[_0xcc6a('0x15')](respondWithResult(_0x483aa4,null))[_0xcc6a('0x1f')](handleError(_0x483aa4,null));};exports['addContacts']=function(_0x46d93b,_0x4ed702){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x46d93b[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x4ed702,null))[_0xcc6a('0x15')](function(_0x3f1361){if(_0x3f1361){return _0x3f1361[_0xcc6a('0x60')](_0x46d93b[_0xcc6a('0x5d')]['ids'],_['omit'](_0x46d93b['body'],[_0xcc6a('0x61'),'id'])||{});}})[_0xcc6a('0x15')](respondWithResult(_0x4ed702,null))[_0xcc6a('0x1f')](handleError(_0x4ed702,null));};function validateUser(_0x4a9f34){return new BPromise(function(_0x2f7787,_0x2fa1ec){if(_0x4a9f34[_0xcc6a('0x62')])return _0x2f7787(_0x4a9f34);return db[_0xcc6a('0x63')]['findById'](0x1)['then'](function(_0xaec5e8){if(_0xaec5e8[_0xcc6a('0x64')])authService[_0xcc6a('0x65')](_0x4a9f34[_0xcc6a('0x3e')]);db['User'][_0xcc6a('0x66')](_0xcc6a('0x62'))[_0xcc6a('0x15')](function(_0x3b5e04){if(_[_0xcc6a('0x67')](_0x3b5e04)){_0x4a9f34['internal']=_0xaec5e8['min_internal']||0x1;return;}if(_[_0xcc6a('0x67')](_0xaec5e8[_0xcc6a('0x68')])||_0xaec5e8[_0xcc6a('0x68')]===_0x3b5e04){_0x4a9f34[_0xcc6a('0x62')]=_0x3b5e04+0x1;return;}if(_0xaec5e8['min_internal']>_0x3b5e04){_0x4a9f34['internal']=_0xaec5e8[_0xcc6a('0x68')];return;}return db[_0xcc6a('0x69')][_0xcc6a('0x41')](_0xcc6a('0x6a'),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0xcc6a('0x15')](function(_0x25df30){if(_0x25df30&&_0x25df30[_0xcc6a('0x4a')]){for(var _0x729b2=0x0,_0x51a10b=_0x25df30[_0xcc6a('0x4a')];_0x729b2<_0x51a10b&&_[_0xcc6a('0x67')](_0x4a9f34['internal']);_0x729b2++){if(_0xaec5e8[_0xcc6a('0x68')]<=_0x25df30[_0x729b2]['from']){_0x4a9f34[_0xcc6a('0x62')]=_0x25df30[_0x729b2]['from'];}else if(_0xaec5e8[_0xcc6a('0x68')]>_0x25df30[_0x729b2][_0xcc6a('0x6b')]&&_0xaec5e8[_0xcc6a('0x68')]<=_0x25df30[_0x729b2]['to']){_0x4a9f34['internal']=_0xaec5e8[_0xcc6a('0x68')];}}}if(_['isNil'](_0x4a9f34[_0xcc6a('0x62')])){_0x4a9f34['internal']=_0x3b5e04+0x1;}return _0x2f7787(_0x4a9f34);});});})[_0xcc6a('0x1f')](function(_0x2e7e44){_0x2fa1ec(_0x2e7e44);});});}function updateUser(_0x29a029){return new BPromise(function(_0x2dc347,_0x122422){try{if(_0x29a029[_0xcc6a('0x6c')]){_0x29a029['mailbox']=_0x29a029[_0xcc6a('0x62')];_0x29a029[_0xcc6a('0x6d')]={'mailbox':_0x29a029[_0xcc6a('0x62')],'password':_0x29a029[_0xcc6a('0x3e')],'fullname':_0x29a029[_0xcc6a('0x6e')],'email':_0x29a029['email']};}if(_0x29a029[_0xcc6a('0x2b')]===_0xcc6a('0x2f')){if(!_0x29a029['permissions'])_0x29a029['permissions']=[_0xcc6a('0x6f'),_0xcc6a('0x70'),_0xcc6a('0x71'),_0xcc6a('0x72'),_0xcc6a('0x73'),_0xcc6a('0x74'),'105',_0xcc6a('0x75'),_0xcc6a('0x76'),_0xcc6a('0x77'),_0xcc6a('0x78'),_0xcc6a('0x79'),_0xcc6a('0x7a'),'114','115'];}_0x2dc347(_0x29a029);}catch(_0x2ff473){_0x122422(_0x2ff473);}});}exports[_0xcc6a('0x7b')]=function(_0x17ae8d,_0x2e6855){if(_0x17ae8d[_0xcc6a('0x2d')][_0xcc6a('0x2b')]===_0xcc6a('0x2f'))throw new Error('Unauthorized');if(_0x17ae8d[_0xcc6a('0x5d')][_0xcc6a('0x2b')]===_0xcc6a('0x2d')&&_0x17ae8d[_0xcc6a('0x2d')][_0xcc6a('0x2b')]!==_0xcc6a('0x7c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x17ae8d[_0xcc6a('0x5d')][_0xcc6a('0x2b')]===_0xcc6a('0x7c')&&_0x17ae8d['user'][_0xcc6a('0x2b')]!==_0xcc6a('0x7c')){throw new Error(_0xcc6a('0x7d'));}return licenseUtil[_0xcc6a('0x7e')]([_0x17ae8d[_0xcc6a('0x5d')]])[_0xcc6a('0x15')](function(){return validateUser(_0x17ae8d['body']);})[_0xcc6a('0x15')](function(_0x3c4948){return updateUser(_0x3c4948)['then'](function(_0x1848dd){if(_0x1848dd[_0xcc6a('0x2b')]===_0xcc6a('0x7c')){_0x1848dd[_0xcc6a('0x7f')]=_0x17ae8d[_0xcc6a('0x2d')]['settingsEnabled'];delete _0x1848dd[_0xcc6a('0x80')];}return _0x1848dd;});})[_0xcc6a('0x15')](function(_0xbd536e){return db[_0xcc6a('0x3a')][_0xcc6a('0x7b')](_0xbd536e,{'include':[{'model':db[_0xcc6a('0x6d')],'as':'VoiceMail'}]});})['then'](function(_0x225bf6){if(_0x17ae8d['body'][_0xcc6a('0x2b')]===_0xcc6a('0x2d'))return _0x225bf6;if(_0x17ae8d[_0xcc6a('0x2d')][_0xcc6a('0x2b')]!==_0xcc6a('0x2d'))return _0x225bf6;return db[_0xcc6a('0x81')][_0xcc6a('0x5b')]({'where':{'name':_0x225bf6[_0xcc6a('0x2b')]===_0xcc6a('0x2f')?_0xcc6a('0x2e'):_0xcc6a('0x30'),'userProfileId':_0x17ae8d[_0xcc6a('0x2d')]['userProfileId']},'raw':!![]})[_0xcc6a('0x15')](function(_0x443e5b){if(!_0x443e5b||_0x443e5b[_0xcc6a('0x82')]!=0x0)return _0x225bf6;return db[_0xcc6a('0x83')]['create']({'name':_0x225bf6[_0xcc6a('0x37')],'resourceId':_0x225bf6['id'],'type':_0x443e5b['name'],'sectionId':_0x443e5b['id']},{})[_0xcc6a('0x15')](function(){return _0x225bf6;});})[_0xcc6a('0x1f')](function(_0xe09f7){logger[_0xcc6a('0x1b')](_0xcc6a('0x84'),_0xe09f7);throw _0xe09f7;});})[_0xcc6a('0x15')](respondWithResult(_0x2e6855,0xc9))[_0xcc6a('0x1f')](handleError(_0x2e6855,null));};exports['bulkCreate']=function(_0x357b66,_0x60c0a2){var _0x2dd98a=_0x357b66[_0xcc6a('0x5d')];var _0xc5cc18=[];if(_0x357b66[_0xcc6a('0x2d')]['role']===_0xcc6a('0x2f'))throw new Error(_0xcc6a('0x85'));if(_['some'](_0x2dd98a,['role',_0xcc6a('0x2d')])&&_0x357b66[_0xcc6a('0x2d')][_0xcc6a('0x2b')]!==_0xcc6a('0x7c')){throw new Error(_0xcc6a('0x86'));}if(_['some'](_0x2dd98a,[_0xcc6a('0x2b'),'admin'])&&_0x357b66[_0xcc6a('0x2d')][_0xcc6a('0x2b')]!==_0xcc6a('0x7c')){throw new Error(_0xcc6a('0x87'));}return licenseUtil[_0xcc6a('0x7e')](_0x2dd98a)[_0xcc6a('0x15')](function(){return validateUser(_0x2dd98a[0x0]);})[_0xcc6a('0x15')](function(){for(var _0x1f4c4e=0x1;_0x1f4c4e<_0x2dd98a['length'];_0x1f4c4e++){var _0x312431=_0x2dd98a[_0x1f4c4e-0x1][_0xcc6a('0x62')];if(!_0x2dd98a[_0x1f4c4e][_0xcc6a('0x62')])_0x2dd98a[_0x1f4c4e]['internal']=_0x312431+0x1;_0xc5cc18[_0xcc6a('0x45')](validateUser(_0x2dd98a[_0x1f4c4e]));}return BPromise[_0xcc6a('0x51')](_0xc5cc18);})[_0xcc6a('0x15')](function(){_0xc5cc18=[];for(var _0x290196=0x0;_0x290196<_0x2dd98a[_0xcc6a('0x4a')];_0x290196++){_0xc5cc18[_0xcc6a('0x45')](updateUser(_0x2dd98a[_0x290196]));}return BPromise[_0xcc6a('0x51')](_0xc5cc18);})['then'](function(){return BPromise[_0xcc6a('0x88')](_0x2dd98a,function(_0x402df1){return db[_0xcc6a('0x3a')][_0xcc6a('0x7b')](_0x402df1,{'include':[{'model':db[_0xcc6a('0x6d')],'as':_0xcc6a('0x6d')}]})[_0xcc6a('0x15')](function(_0x1dd2f2){_0x402df1['id']=_0x1dd2f2['id'];return _0x402df1;});});})['then'](function(_0x47e671){if(_0x357b66[_0xcc6a('0x5d')]['role']===_0xcc6a('0x2d'))return _0x47e671;if(_0x357b66[_0xcc6a('0x2d')][_0xcc6a('0x2b')]!==_0xcc6a('0x2d'))return _0x47e671;var _0x2281bd=_[_0xcc6a('0x89')](_0x47e671,function(_0x35aa5e){return _0x35aa5e['role']===_0xcc6a('0x2f')||_0x35aa5e['role']==='telephone';});if(!_0x2281bd)return _0x47e671;return db[_0xcc6a('0x81')]['findAll']({'where':{'name':{'$or':[_0xcc6a('0x2e'),_0xcc6a('0x30')]},'userProfileId':_0x357b66['user']['userProfileId']},'raw':!![]})[_0xcc6a('0x15')](function(_0x4d0e37){if(_[_0xcc6a('0x8a')](_0x4d0e37)||!_[_0xcc6a('0x89')](_0x4d0e37,[_0xcc6a('0x82'),0x0]))return _0x47e671;_0xc5cc18=[];var _0x2e7f3e=_(_0x4d0e37)[_0xcc6a('0x33')](function(_0x41c474){if(_0x41c474['autoAssociation']===0x1)return;return _0x41c474[_0xcc6a('0x37')]===_0xcc6a('0x2e')?_0xcc6a('0x2f'):_0xcc6a('0x31');})['compact']()[_0xcc6a('0x34')]();for(var _0x35b777=0x0;_0x35b777<_0x47e671[_0xcc6a('0x4a')];_0x35b777++){if(!_[_0xcc6a('0x35')](_0x2e7f3e,_0x47e671[_0x35b777][_0xcc6a('0x2b')]))return;var _0x421298=_0x47e671[_0x35b777][_0xcc6a('0x2b')]==='agent'?_0xcc6a('0x2e'):_0xcc6a('0x30');_0xc5cc18['push'](db[_0xcc6a('0x83')][_0xcc6a('0x7b')]({'name':_0x47e671[_0x35b777][_0xcc6a('0x37')],'resourceId':_0x47e671[_0x35b777]['id'],'type':_0x421298,'sectionId':_[_0xcc6a('0x5b')](_0x4d0e37,[_0xcc6a('0x37'),_0x421298])['id']},{}));}return BPromise[_0xcc6a('0x51')](_0xc5cc18);});})[_0xcc6a('0x15')](respondWithResult(_0x60c0a2,0xc9))[_0xcc6a('0x1f')](handleError(_0x60c0a2,null));};exports[_0xcc6a('0x8b')]=function(_0x44fa34,_0x3efe1c){if(_0x44fa34[_0xcc6a('0x5d')]['id']){delete _0x44fa34[_0xcc6a('0x5d')]['id'];}return db[_0xcc6a('0x3a')]['find']({'where':{'id':_0x44fa34['params']['id']}})[_0xcc6a('0x15')](function(_0x44f737){if(!_0x44f737)return null;if(_0x44f737['id']===_0x44fa34['user']['id']){if(!_0x44fa34[_0xcc6a('0x5d')][_0xcc6a('0x8c')]||!_0x44fa34[_0xcc6a('0x5d')]['newPassword']){throw new db[(_0xcc6a('0x8d'))]['ValidationError'](_0xcc6a('0x8e'));}if(!_0x44f737[_0xcc6a('0x8f')](_0x44fa34['body'][_0xcc6a('0x8c')])){throw new db['Sequelize'][(_0xcc6a('0x90'))](_0xcc6a('0x91'));}if(_0x44fa34[_0xcc6a('0x5d')][_0xcc6a('0x8c')]===_0x44fa34[_0xcc6a('0x5d')][_0xcc6a('0x92')]){throw new db['Sequelize']['ValidationError'](_0xcc6a('0x93'));}}else if(_0x44fa34[_0xcc6a('0x2d')][_0xcc6a('0x2b')]==='admin'){if(!_0x44fa34[_0xcc6a('0x5d')][_0xcc6a('0x92')]){throw new db[(_0xcc6a('0x8d'))][(_0xcc6a('0x90'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x44fa34[_0xcc6a('0x2d')][_0xcc6a('0x2b')]===_0xcc6a('0x2d')){if(!_0x44fa34['body'][_0xcc6a('0x92')]){throw new db['Sequelize'][(_0xcc6a('0x90'))](_0xcc6a('0x94'));}if(_0x44f737['role']!==_0xcc6a('0x2f')){throw new db[(_0xcc6a('0x8d'))][(_0xcc6a('0x90'))](_0xcc6a('0x85'));}}else{throw new db[(_0xcc6a('0x8d'))][(_0xcc6a('0x90'))](_0xcc6a('0x85'));}return _0x44f737;})[_0xcc6a('0x15')](handleEntityNotFound(_0x3efe1c,null))[_0xcc6a('0x15')](function(_0x22d659){return db[_0xcc6a('0x63')]['findOne']({'attributes':['id','securePassword',_0xcc6a('0x95'),'passwordHistoryLimit']})[_0xcc6a('0x15')](function(_0x4970d9){if(_0x4970d9['securePassword'])authService[_0xcc6a('0x65')](_0x44fa34[_0xcc6a('0x5d')][_0xcc6a('0x92')]);if(!_0x4970d9[_0xcc6a('0x95')]||!_0x22d659['previousPasswords'])return _0x22d659;authService[_0xcc6a('0x96')](_0x44fa34['body']['newPassword'],_0x22d659[_0xcc6a('0x97')],_0x4970d9[_0xcc6a('0x98')]);return _0x22d659;})[_0xcc6a('0x15')](saveUpdates({'password':_0x44fa34[_0xcc6a('0x5d')][_0xcc6a('0x92')],'passwordResetAt':_0x44fa34[_0xcc6a('0x2d')]['id']==_0x44fa34[_0xcc6a('0x5e')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x44fa34[_0xcc6a('0x5d')][_0xcc6a('0x92')],_0x22d659[_0xcc6a('0x97')])},null));})['then'](respondWithResult(_0x3efe1c,null))[_0xcc6a('0x1f')](handleError(_0x3efe1c,null));};exports['addQueues']=function(_0x2f07f3,_0x5ab0eb){var _0x57553b=_0x2f07f3[_0xcc6a('0x5d')][_0xcc6a('0x99')];return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x2f07f3[_0xcc6a('0x5e')]['id']},'attributes':['id','name','role','online',_0xcc6a('0x9a'),_0xcc6a('0x9b'),_0xcc6a('0x9c')]})[_0xcc6a('0x15')](handleEntityNotFound(_0x5ab0eb,null))[_0xcc6a('0x15')](function(_0x2848a8){if(_0x2848a8){if(!utils['isValidChannel'](_0x57553b)){throw new db[(_0xcc6a('0x8d'))]['ValidationError'](_0xcc6a('0x9d'));}return _0x2848a8[_0xcc6a('0x9e')+_[_0xcc6a('0x9f')](_0x57553b[_0xcc6a('0xa0')]())+_0xcc6a('0xa1')](_0x2f07f3['body']['ids'],{'penalty':_0x2f07f3[_0xcc6a('0x5d')][_0xcc6a('0xa2')]||0x0})['spread'](function(_0xfccb6f){for(var _0x307113=0x0;_0x307113<_0x2f07f3[_0xcc6a('0x5d')][_0xcc6a('0x61')][_0xcc6a('0x4a')];_0x307113+=0x1){var _0x2c8fbd={'UserId':Number(_0x2f07f3['params']['id'])};_0x2c8fbd[_[_0xcc6a('0x9f')](_0x57553b[_0xcc6a('0xa0')]())+_0xcc6a('0xa3')]=Number(_0x2f07f3['body']['ids'][_0x307113]);socket['emit']('user'+_[_0xcc6a('0x9f')](_0x57553b['toLowerCase']())+_0xcc6a('0xa4'),_0x2c8fbd);}return _0xfccb6f;})[_0xcc6a('0x15')](function(){if(_0x57553b==='voice'){return db[_0xcc6a('0xa5')]['findAll']({'where':{'id':_0x2f07f3[_0xcc6a('0x5d')][_0xcc6a('0x61')]||[]},'raw':!![],'attributes':['id',_0xcc6a('0x37')]});}})[_0xcc6a('0x15')](function(_0x65280b){var _0x197961=_0x2848a8[_0xcc6a('0x2a')]({'plain':!![]});var _0x299110=[];if(_0x57553b===_0xcc6a('0xa6')&&_0x197961[_0xcc6a('0x2b')]===_0xcc6a('0x2f')&&_0x197961[_0xcc6a('0xa7')]){for(var _0x27182c=0x0;_0x27182c<_0x65280b[_0xcc6a('0x4a')];_0x27182c+=0x1){_0x299110[_0xcc6a('0x45')]({'membername':_0x197961[_0xcc6a('0x37')],'UserId':_0x197961['id'],'queue_name':_0x65280b[_0x27182c][_0xcc6a('0x37')],'VoiceQueueId':_0x65280b[_0x27182c]['id'],'interface':_[_0xcc6a('0x67')](_0x197961[_0xcc6a('0x9c')])?util[_0xcc6a('0xa8')](_0xcc6a('0xa9'),_0x197961[_0xcc6a('0x37')]):_0x197961['interface'],'paused':_0x197961[_0xcc6a('0x9b')]||![],'penalty':_0x2f07f3[_0xcc6a('0x5d')][_0xcc6a('0xa2')]||0x0});}return BPromise['each'](_0x299110,function(_0x32fe46){return db[_0xcc6a('0xaa')]['upsert'](_0x32fe46);});}return _0x2848a8;});}})[_0xcc6a('0x15')](respondWithStatusCode(_0x5ab0eb,null))[_0xcc6a('0x1f')](handleError(_0x5ab0eb,null));};exports['removeQueues']=function(_0xa113c7,_0x2d147c){var _0x10e242;return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0xa113c7[_0xcc6a('0x5e')]['id']},'attributes':['id','name','role']})[_0xcc6a('0x15')](handleEntityNotFound(_0x2d147c,null))[_0xcc6a('0x15')](function(_0x50a8fe){if(_0x50a8fe){_0x10e242=_0x50a8fe;if(!_0xa113c7[_0xcc6a('0x41')]['channel']||!utils[_0xcc6a('0xab')](_0xa113c7['query'][_0xcc6a('0x99')])){throw new db[(_0xcc6a('0x8d'))][(_0xcc6a('0x90'))]('Unknown\x20channel');}return _0x50a8fe[_0xcc6a('0xac')+_[_0xcc6a('0x9f')](_0xa113c7[_0xcc6a('0x41')]['channel']['toLowerCase']())+'Queues'](_0xa113c7[_0xcc6a('0x41')][_0xcc6a('0x61')]);}})[_0xcc6a('0x15')](function(_0x412c37){if(_[_0xcc6a('0xad')](_0xa113c7[_0xcc6a('0x41')][_0xcc6a('0x61')])){for(var _0x80ca93=0x0;_0x80ca93<_0xa113c7[_0xcc6a('0x41')][_0xcc6a('0x61')][_0xcc6a('0x4a')];_0x80ca93+=0x1){var _0x4c8dc9={'UserId':Number(_0xa113c7['params']['id'])};_0x4c8dc9[_[_0xcc6a('0x9f')](_0xa113c7[_0xcc6a('0x41')][_0xcc6a('0x99')]['toLowerCase']())+_0xcc6a('0xa3')]=Number(_0xa113c7[_0xcc6a('0x41')][_0xcc6a('0x61')][_0x80ca93]);socket['emit'](_0xcc6a('0x2d')+_[_0xcc6a('0x9f')](_0xa113c7[_0xcc6a('0x41')][_0xcc6a('0x99')]['toLowerCase']())+_0xcc6a('0xae'),_0x4c8dc9);}}else{var _0x4c8dc9={'UserId':Number(_0xa113c7['params']['id'])};_0x4c8dc9[_['capitalize'](_0xa113c7[_0xcc6a('0x41')]['channel']['toLowerCase']())+_0xcc6a('0xa3')]=Number(_0xa113c7[_0xcc6a('0x41')][_0xcc6a('0x61')]);socket[_0xcc6a('0xaf')](_0xcc6a('0x2d')+_[_0xcc6a('0x9f')](_0xa113c7['query']['channel']['toLowerCase']())+_0xcc6a('0xae'),_0x4c8dc9);}return _0x412c37;})[_0xcc6a('0x15')](function(){if(_0xa113c7[_0xcc6a('0x41')][_0xcc6a('0x99')]===_0xcc6a('0xa6')){return db[_0xcc6a('0xaa')]['destroy']({'where':{'UserId':_0xa113c7['params']['id'],'VoiceQueueId':_0xa113c7[_0xcc6a('0x41')][_0xcc6a('0x61')]},'individualHooks':!![]})[_0xcc6a('0x15')](function(){return _0x10e242;});}return _0x10e242;})[_0xcc6a('0x15')](respondWithStatusCode(_0x2d147c,null))['catch'](handleError(_0x2d147c,null));};exports[_0xcc6a('0xb0')]=function(_0x519a8b,_0x2a38e6){_0x519a8b[_0xcc6a('0x5d')][_0xcc6a('0xb1')]=_0x519a8b[_0xcc6a('0xb2')][_0xcc6a('0xb3')];return db['User']['find']({'where':{'id':_0x519a8b[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x2a38e6,null))['then'](saveUpdates(_0x519a8b[_0xcc6a('0x5d')],null))[_0xcc6a('0x15')](respondWithResult(_0x2a38e6,null))[_0xcc6a('0x1f')](handleError(_0x2a38e6,null));};exports[_0xcc6a('0xb4')]=function(_0x1dc459,_0x2a9336){var _0x46fe90=path[_0xcc6a('0xb5')](config[_0xcc6a('0xb6')],_0xcc6a('0xb7'));return db['User']['find']({'where':{'id':_0x1dc459[_0xcc6a('0x5e')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xcc6a('0x15')](handleEntityNotFound(_0x2a9336,null))[_0xcc6a('0x15')](function(_0x15a4c9){if(_0x15a4c9){if(_['isNil'](_0x15a4c9[_0xcc6a('0xb1')])){return _0x2a9336['download'](_0x46fe90);}else{if(!fs[_0xcc6a('0xb8')](path[_0xcc6a('0xb5')](config[_0xcc6a('0xb6')],_0xcc6a('0xb9'),_0x15a4c9['userpic']))){return _0x2a9336[_0xcc6a('0xba')](_0x46fe90);}return _0x2a9336[_0xcc6a('0xba')](path[_0xcc6a('0xb5')](config[_0xcc6a('0xb6')],_0xcc6a('0xb9'),_0x15a4c9[_0xcc6a('0xb1')]));}}})[_0xcc6a('0x1f')](handleError(_0x2a9336,null));};exports['getOpenTabs']=function(_0x55630e,_0x537b7d){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x55630e['params']['id']},'attributes':['id']})[_0xcc6a('0x15')](handleEntityNotFound(_0x537b7d,null))[_0xcc6a('0x15')](function(_0x16ee2b){var _0x4c029e=[];values=_0x16ee2b[_0xcc6a('0x4c')];_0x4c029e['push'](get_open_tabs(_0xcc6a('0x4b'),_0x16ee2b['dataValues']));_0x4c029e[_0xcc6a('0x45')](get_open_tabs(_0xcc6a('0x4d'),_0x16ee2b[_0xcc6a('0x4c')]));_0x4c029e[_0xcc6a('0x45')](get_open_tabs('openchannel',_0x16ee2b[_0xcc6a('0x4c')]));_0x4c029e[_0xcc6a('0x45')](get_open_tabs(_0xcc6a('0x50'),_0x16ee2b['dataValues']));_0x4c029e['push'](get_open_tabs('fax',_0x16ee2b[_0xcc6a('0x4c')]));_0x4c029e[_0xcc6a('0x45')](get_open_tabs(_0xcc6a('0x4e'),_0x16ee2b[_0xcc6a('0x4c')]));return BPromise[_0xcc6a('0x51')](_0x4c029e);})[_0xcc6a('0x15')](function(_0x2d9a99){var _0x162a66=[];if(_0x2d9a99){for(var _0x1ffda2=0x0;_0x1ffda2<values[_0xcc6a('0xbb')][_0xcc6a('0x4a')];_0x1ffda2++){var _0x4c85e2=values['ChatOpenTabs'][_0x1ffda2];_0x162a66[_0xcc6a('0x45')]({'channel':_0xcc6a('0xbc'),'id':_0x4c85e2['id'],'createdAt':_0x4c85e2[_0xcc6a('0xbd')]});}for(var _0x1ffda2=0x0;_0x1ffda2<values[_0xcc6a('0xbe')][_0xcc6a('0x4a')];_0x1ffda2++){var _0x4c85e2=values[_0xcc6a('0xbe')][_0x1ffda2];_0x162a66[_0xcc6a('0x45')]({'channel':_0xcc6a('0xbf'),'id':_0x4c85e2['id'],'createdAt':_0x4c85e2[_0xcc6a('0xbd')]});}for(var _0x1ffda2=0x0;_0x1ffda2<values[_0xcc6a('0xc0')]['length'];_0x1ffda2++){var _0x4c85e2=values['OpenchannelOpenTabs'][_0x1ffda2];_0x162a66[_0xcc6a('0x45')]({'channel':_0xcc6a('0xc1'),'id':_0x4c85e2['id'],'createdAt':_0x4c85e2[_0xcc6a('0xbd')]});}for(var _0x1ffda2=0x0;_0x1ffda2<values['MailOpenTabs'][_0xcc6a('0x4a')];_0x1ffda2++){var _0x4c85e2=values[_0xcc6a('0xc2')][_0x1ffda2];_0x162a66[_0xcc6a('0x45')]({'channel':_0xcc6a('0xc3'),'id':_0x4c85e2['id'],'createdAt':_0x4c85e2['createdAt']});}for(var _0x1ffda2=0x0;_0x1ffda2<values[_0xcc6a('0xc4')][_0xcc6a('0x4a')];_0x1ffda2++){var _0x4c85e2=values[_0xcc6a('0xc4')][_0x1ffda2];_0x162a66['push']({'channel':_0xcc6a('0xc5'),'id':_0x4c85e2['id'],'createdAt':_0x4c85e2[_0xcc6a('0xbd')]});}for(var _0x1ffda2=0x0;_0x1ffda2<values[_0xcc6a('0xc6')][_0xcc6a('0x4a')];_0x1ffda2++){var _0x4c85e2=values[_0xcc6a('0xc6')][_0x1ffda2];_0x162a66[_0xcc6a('0x45')]({'channel':_0xcc6a('0xc7'),'id':_0x4c85e2['id'],'createdAt':_0x4c85e2[_0xcc6a('0xbd')]});}var _0x5d2f52={'count':_0x162a66[_0xcc6a('0x4a')],'rows':_0x162a66};return _0x5d2f52;}else return null;})[_0xcc6a('0x15')](respondWithResult(_0x537b7d,null))[_0xcc6a('0x1f')](handleError(_0x537b7d,null));};exports[_0xcc6a('0xc8')]=function(_0x28aacd,_0x3a96ee){var _0x13c47b={};var _0x24603b={};var _0x1e2c76;var _0x2e0f10;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x28aacd['params']['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x3a96ee,null))['then'](function(_0x107d99){if(_0x107d99){_0x1e2c76=_0x107d99;_0x24603b['model']=_[_0xcc6a('0x55')](db['CmContact'][_0xcc6a('0x3b')]);_0x24603b[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x28aacd['query']);_0x24603b['filters']=_['intersection'](_0x24603b[_0xcc6a('0x53')],_0x24603b[_0xcc6a('0x41')]);_0x13c47b[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x24603b[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x28aacd[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x13c47b['attributes']=_0x13c47b['attributes']['length']?_0x13c47b[_0xcc6a('0x44')]:_0x24603b['model'];_0x13c47b[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x28aacd['query']['sort']);_0x13c47b[_0xcc6a('0xcc')]=qs['filters'](_[_0xcc6a('0xcd')](_0x28aacd[_0xcc6a('0x41')],_0x24603b['filters']));if(_0x28aacd[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x13c47b[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x13c47b[_0xcc6a('0xcc')],{'$or':_['map'](_0x13c47b[_0xcc6a('0x44')],function(_0x118ea0){var _0x8da160={};_0x8da160[_0x118ea0]={'$like':'%'+_0x28aacd[_0xcc6a('0x41')]['filter']+'%'};return _0x8da160;})});}_0x13c47b=_['merge']({},_0x13c47b,_0x28aacd[_0xcc6a('0x5a')]);return _0x1e2c76['getContacts'](_0x13c47b);}})[_0xcc6a('0x15')](function(_0x5be7ca){if(_0x5be7ca){_0x2e0f10=_0x5be7ca['length'];if(_0x28aacd['query'][_0xcc6a('0xcf')](_0xcc6a('0x42'))){_0x13c47b['include']=[{'model':db[_0xcc6a('0xd0')],'as':_0xcc6a('0xd1'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xcc6a('0x37'),_0xcc6a('0xd2')],'where':_0x28aacd['query'][_0xcc6a('0xd3')]?{'id':_0x28aacd[_0xcc6a('0x41')][_0xcc6a('0xd3')]}:undefined,'required':_0x28aacd['query'][_0xcc6a('0xd3')]?!![]:![]}];}if(!_0x28aacd[_0xcc6a('0x41')][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0x13c47b['limit']=qs[_0xcc6a('0x26')](_0x28aacd[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x13c47b[_0xcc6a('0x24')]=qs['offset'](_0x28aacd['query'][_0xcc6a('0x24')]);}return _0x1e2c76['getContacts'](_0x13c47b);}})[_0xcc6a('0x15')](function(_0xc65a9d){if(_0xc65a9d){return _0xc65a9d?{'count':_0x2e0f10,'rows':_0xc65a9d}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x3a96ee,null))['catch'](handleError(_0x3a96ee,null));};exports[_0xcc6a('0xd5')]=function(_0x3ef204,_0x5bca52){var _0x3f8a04;var _0x1d1bfa;var _0x454474={};var _0x23df54;return db['User'][_0xcc6a('0xc9')]({'where':{'id':_0x3ef204['params']['id']},'attributes':['id',_0xcc6a('0x37'),_0xcc6a('0x2b')]})['then'](handleEntityNotFound(_0x5bca52,null))['then'](function(_0xa563c9){if(!utils[_0xcc6a('0xab')](_0x3ef204[_0xcc6a('0x41')][_0xcc6a('0x99')])){throw new db[(_0xcc6a('0x8d'))][(_0xcc6a('0x90'))](_0xcc6a('0x9d'));}_0x3f8a04=_0xa563c9;var _0x590359={};_0x590359[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db[_[_0xcc6a('0x9f')](_0x3ef204['query'][_0xcc6a('0x99')])+'Queue']['rawAttributes']);_0x590359[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x3ef204[_0xcc6a('0x41')]);_0x590359['filters']=_['intersection'](_0x590359[_0xcc6a('0x53')],_0x590359[_0xcc6a('0x41')]);_0x454474[_0xcc6a('0x44')]=_['intersection'](_0x590359[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x3ef204[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x454474[_0xcc6a('0x44')]=_0x454474[_0xcc6a('0x44')]['length']?_0x454474[_0xcc6a('0x44')]:_0x590359[_0xcc6a('0x53')];_0x454474['order']=qs[_0xcc6a('0xcb')](_0x3ef204[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x454474[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_['pick'](_0x3ef204[_0xcc6a('0x41')],_0x590359['filters']));if(_0x3ef204[_0xcc6a('0x41')]['filter']){_0x454474[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x454474[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x454474['attributes'],function(_0xc40ae){var _0x4ff3c3={};_0x4ff3c3[_0xc40ae]={'$like':'%'+_0x3ef204['query'][_0xcc6a('0xce')]+'%'};return _0x4ff3c3;})});}_0x454474=_['merge']({},_0x454474,_0x3ef204[_0xcc6a('0x5a')]);switch(_0x3f8a04['role']){case _0xcc6a('0x7c'):return db[_[_0xcc6a('0x9f')](_0x3ef204['query']['channel'])+_0xcc6a('0xd6')][_0xcc6a('0x46')](_0x454474);case _0xcc6a('0x2d'):case'agent':return _0x3f8a04['get'+_[_0xcc6a('0x9f')](_0x3ef204[_0xcc6a('0x41')]['channel'])+_0xcc6a('0xa1')](_0x454474);default:throw new db[(_0xcc6a('0x8d'))][(_0xcc6a('0x90'))]('Unknown\x20role');}})[_0xcc6a('0x15')](function(_0x14cfdd){_0x23df54=_0x14cfdd[_0xcc6a('0x4a')];if(!_0x3ef204[_0xcc6a('0x41')][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0x454474[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x3ef204[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x454474[_0xcc6a('0x24')]=qs[_0xcc6a('0x24')](_0x3ef204['query']['offset']);}switch(_0x3f8a04[_0xcc6a('0x2b')]){case _0xcc6a('0x7c'):return db[_[_0xcc6a('0x9f')](_0x3ef204[_0xcc6a('0x41')][_0xcc6a('0x99')])+_0xcc6a('0xd6')]['findAll'](_0x454474);case _0xcc6a('0x2d'):case _0xcc6a('0x2f'):return _0x3f8a04['get'+_[_0xcc6a('0x9f')](_0x3ef204[_0xcc6a('0x41')][_0xcc6a('0x99')])+'Queues'](_0x454474);}})[_0xcc6a('0x15')](function(_0x5ef738){return{'count':_0x23df54,'rows':_0x5ef738};})[_0xcc6a('0x15')](respondWithResult(_0x5bca52,null))[_0xcc6a('0x1f')](handleError(_0x5bca52,null));};exports[_0xcc6a('0xd7')]=function(_0x2107a4,_0x22ade7){var _0x3425da={};var _0x199f47={};var _0x23848a;var _0x409532;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x2107a4[_0xcc6a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x22ade7,null))[_0xcc6a('0x15')](function(_0x40f369){if(_0x40f369){_0x23848a=_0x40f369;_0x199f47['model']=_[_0xcc6a('0x55')](db[_0xcc6a('0xaa')][_0xcc6a('0x3b')]);_0x199f47[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x2107a4[_0xcc6a('0x41')]);_0x199f47[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x199f47[_0xcc6a('0x53')],_0x199f47[_0xcc6a('0x41')]);_0x3425da[_0xcc6a('0x44')]=_['intersection'](_0x199f47['model'],qs[_0xcc6a('0x58')](_0x2107a4['query'][_0xcc6a('0x58')]));_0x3425da[_0xcc6a('0x44')]=_0x3425da[_0xcc6a('0x44')]['length']?_0x3425da[_0xcc6a('0x44')]:_0x199f47[_0xcc6a('0x53')];_0x3425da[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x2107a4[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x3425da[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_['pick'](_0x2107a4[_0xcc6a('0x41')],_0x199f47[_0xcc6a('0x56')]));if(_0x2107a4[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x3425da[_0xcc6a('0xcc')]=_['merge'](_0x3425da[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x3425da[_0xcc6a('0x44')],function(_0x5c49cc){var _0xb32706={};_0xb32706[_0x5c49cc]={'$like':'%'+_0x2107a4['query'][_0xcc6a('0xce')]+'%'};return _0xb32706;})});}_0x3425da=_[_0xcc6a('0x59')]({},_0x3425da,_0x2107a4[_0xcc6a('0x5a')]);return _0x23848a[_0xcc6a('0xd7')](_0x3425da);}})[_0xcc6a('0x15')](function(_0x305f07){if(_0x305f07){_0x409532=_0x305f07['length'];if(!_0x2107a4[_0xcc6a('0x41')][_0xcc6a('0xcf')]('nolimit')){_0x3425da[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x2107a4[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x3425da['offset']=qs[_0xcc6a('0x24')](_0x2107a4[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x23848a['getVoiceQueuesRt'](_0x3425da);}})[_0xcc6a('0x15')](function(_0x3c4e5e){if(_0x3c4e5e){return _0x3c4e5e?{'count':_0x409532,'rows':_0x3c4e5e}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x22ade7,null))[_0xcc6a('0x1f')](handleError(_0x22ade7,null));};exports[_0xcc6a('0xd8')]=function(_0x2739c5,_0x293d8e){var _0x330afb={};var _0x4961ad={};var _0x28effd;var _0x2ba238;return db[_0xcc6a('0x3a')]['findOne']({'where':{'id':_0x2739c5[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x293d8e,null))[_0xcc6a('0x15')](function(_0x424644){if(_0x424644){_0x28effd=_0x424644;_0x4961ad['model']=_[_0xcc6a('0x55')](db[_0xcc6a('0xd9')]['rawAttributes']);_0x4961ad[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x2739c5['query']);_0x4961ad[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x4961ad[_0xcc6a('0x53')],_0x4961ad[_0xcc6a('0x41')]);_0x330afb['attributes']=_[_0xcc6a('0x57')](_0x4961ad[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x2739c5[_0xcc6a('0x41')]['fields']));_0x330afb[_0xcc6a('0x44')]=_0x330afb['attributes'][_0xcc6a('0x4a')]?_0x330afb[_0xcc6a('0x44')]:_0x4961ad[_0xcc6a('0x53')];_0x330afb[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x2739c5[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x330afb['where']=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x2739c5[_0xcc6a('0x41')],_0x4961ad[_0xcc6a('0x56')]));if(_0x2739c5[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x330afb[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x330afb[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x330afb[_0xcc6a('0x44')],function(_0x4c0bd9){var _0x587cfc={};_0x587cfc[_0x4c0bd9]={'$like':'%'+_0x2739c5[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'};return _0x587cfc;})});}_0x330afb=_[_0xcc6a('0x59')]({},_0x330afb,_0x2739c5['options']);return _0x28effd[_0xcc6a('0xd8')](_0x330afb);}})[_0xcc6a('0x15')](function(_0x4cf817){if(_0x4cf817){_0x2ba238=_0x4cf817['length'];if(!_0x2739c5['query']['hasOwnProperty']('nolimit')){_0x330afb[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x2739c5[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x330afb[_0xcc6a('0x24')]=qs[_0xcc6a('0x24')](_0x2739c5[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x28effd[_0xcc6a('0xd8')](_0x330afb);}})[_0xcc6a('0x15')](function(_0xfff54b){if(_0xfff54b){return _0xfff54b?{'count':_0x2ba238,'rows':_0xfff54b}:null;}})['then'](respondWithResult(_0x293d8e,null))['catch'](handleError(_0x293d8e,null));};exports[_0xcc6a('0xda')]=function(_0x464e5f,_0x252048){var _0x35a8e9={'raw':!![],'where':{}};var _0x50a0c2={};var _0xad4ff0={'count':0x0,'rows':[]};return db['User'][_0xcc6a('0xc9')]({'where':{'id':_0x464e5f[_0xcc6a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x252048,null))[_0xcc6a('0x15')](function(_0x470c63){if(_0x470c63){_0x50a0c2[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db[_0xcc6a('0xdb')][_0xcc6a('0x3b')]);_0x50a0c2[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x464e5f[_0xcc6a('0x41')]);_0x50a0c2[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x50a0c2[_0xcc6a('0x53')],_0x50a0c2[_0xcc6a('0x41')]);_0x35a8e9[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x50a0c2['model'],qs['fields'](_0x464e5f[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x35a8e9['attributes']=_0x35a8e9[_0xcc6a('0x44')]['length']?_0x35a8e9['attributes']:_0x50a0c2['model'];if(!_0x464e5f['query'][_0xcc6a('0xcf')]('nolimit')){_0x35a8e9[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x464e5f[_0xcc6a('0x41')]['limit']);_0x35a8e9['offset']=qs[_0xcc6a('0x24')](_0x464e5f['query'][_0xcc6a('0x24')]);}_0x35a8e9[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x464e5f['query']['sort']);_0x35a8e9[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x464e5f[_0xcc6a('0x41')],_0x50a0c2['filters']));_0x35a8e9[_0xcc6a('0xcc')][_0xcc6a('0xdc')]=_0x470c63['id'];if(_0x464e5f[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x35a8e9[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x35a8e9[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x35a8e9[_0xcc6a('0x44')],function(_0x5d5b29){var _0x1aefa7={};_0x1aefa7[_0x5d5b29]={'$like':'%'+_0x464e5f[_0xcc6a('0x41')]['filter']+'%'};return _0x1aefa7;})});}_0x35a8e9=_[_0xcc6a('0x59')]({},_0x35a8e9,_0x464e5f['options']);return db['VoiceRecording'][_0xcc6a('0x27')]({'where':_0x35a8e9['where']})['then'](function(_0x4f2f41){_0xad4ff0['count']=_0x4f2f41;if(_0x464e5f[_0xcc6a('0x41')][_0xcc6a('0x42')]){_0x35a8e9['include']=[{'all':!![]}];}return db[_0xcc6a('0xdb')]['findAll'](_0x35a8e9);})[_0xcc6a('0x15')](function(_0x21e1de){_0xad4ff0[_0xcc6a('0x47')]=_0x21e1de;return _0xad4ff0;});}})[_0xcc6a('0x15')](respondWithFilteredResult(_0x252048,_0x35a8e9))['catch'](handleError(_0x252048,null));};exports[_0xcc6a('0xdd')]=function(_0x2758fc,_0x300bb6){var _0x3eca86={'raw':!![],'where':{}};var _0x26f654={};var _0x1ff9c9={'count':0x0,'rows':[]};return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x2758fc['params']['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x300bb6,null))[_0xcc6a('0x15')](function(_0x35c17c){if(_0x35c17c){_0x26f654[_0xcc6a('0x53')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x26f654[_0xcc6a('0x41')]=_['keys'](_0x2758fc[_0xcc6a('0x41')]);_0x26f654[_0xcc6a('0x56')]=_['intersection'](_0x26f654[_0xcc6a('0x53')],_0x26f654['query']);_0x3eca86[_0xcc6a('0x44')]=_['intersection'](_0x26f654[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x2758fc['query']['fields']));_0x3eca86[_0xcc6a('0x44')]=_0x3eca86[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x3eca86[_0xcc6a('0x44')]:_0x26f654[_0xcc6a('0x53')];if(!_0x2758fc[_0xcc6a('0x41')]['hasOwnProperty'](_0xcc6a('0xd4'))){_0x3eca86[_0xcc6a('0x26')]=qs['limit'](_0x2758fc[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x3eca86[_0xcc6a('0x24')]=qs[_0xcc6a('0x24')](_0x2758fc[_0xcc6a('0x41')][_0xcc6a('0x24')]);}_0x3eca86[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x2758fc[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x3eca86[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x2758fc[_0xcc6a('0x41')],_0x26f654[_0xcc6a('0x56')]));_0x3eca86[_0xcc6a('0xcc')][_0xcc6a('0xdc')]=_0x35c17c['id'];if(_0x2758fc[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x3eca86[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x3eca86[_0xcc6a('0xcc')],{'$or':_['map'](_0x3eca86[_0xcc6a('0x44')],function(_0x525058){var _0x5219a4={};_0x5219a4[_0x525058]={'$like':'%'+_0x2758fc['query'][_0xcc6a('0xce')]+'%'};return _0x5219a4;})});}_0x3eca86=_[_0xcc6a('0x59')]({},_0x3eca86,_0x2758fc[_0xcc6a('0x5a')]);return db[_0xcc6a('0xde')][_0xcc6a('0x27')]({'where':_0x3eca86[_0xcc6a('0xcc')]})[_0xcc6a('0x15')](function(_0x37b72b){_0x1ff9c9[_0xcc6a('0x27')]=_0x37b72b;if(_0x2758fc['query'][_0xcc6a('0x42')]){_0x3eca86[_0xcc6a('0x43')]=[{'all':!![]}];}return db[_0xcc6a('0xde')][_0xcc6a('0x46')](_0x3eca86);})[_0xcc6a('0x15')](function(_0x5d8f47){_0x1ff9c9[_0xcc6a('0x47')]=_0x5d8f47;return _0x1ff9c9;});}})[_0xcc6a('0x15')](respondWithFilteredResult(_0x300bb6,_0x3eca86))[_0xcc6a('0x1f')](handleError(_0x300bb6,null));};exports['getChatInteractions']=function(_0x2feb2b,_0x3fdd45){var _0x12d73d={};var _0x4a7c78={};var _0x541207;var _0x56d803;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x2feb2b[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x3fdd45,null))[_0xcc6a('0x15')](function(_0x4a63a2){if(_0x4a63a2){_0x541207=_0x4a63a2;_0x4a7c78[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db[_0xcc6a('0xdf')][_0xcc6a('0x3b')]);_0x4a7c78['query']=_[_0xcc6a('0x55')](_0x2feb2b[_0xcc6a('0x41')]);_0x4a7c78[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x4a7c78[_0xcc6a('0x53')],_0x4a7c78[_0xcc6a('0x41')]);_0x12d73d[_0xcc6a('0x44')]=_['intersection'](_0x4a7c78[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x2feb2b[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x12d73d[_0xcc6a('0x44')]=_0x12d73d['attributes'][_0xcc6a('0x4a')]?_0x12d73d['attributes']:_0x4a7c78[_0xcc6a('0x53')];_0x12d73d[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x2feb2b[_0xcc6a('0x41')]['sort']);_0x12d73d[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x2feb2b[_0xcc6a('0x41')],_0x4a7c78[_0xcc6a('0x56')]));if(_0x2feb2b[_0xcc6a('0x41')]['filter']){_0x12d73d[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x12d73d[_0xcc6a('0xcc')],{'$or':_['map'](_0x12d73d['attributes'],function(_0x3ccf95){var _0x598b81={};_0x598b81[_0x3ccf95]={'$like':'%'+_0x2feb2b[_0xcc6a('0x41')]['filter']+'%'};return _0x598b81;})});}_0x12d73d=_['merge']({},_0x12d73d,_0x2feb2b[_0xcc6a('0x5a')]);return _0x541207[_0xcc6a('0xe0')](_0x12d73d);}})[_0xcc6a('0x15')](function(_0x2e861f){if(_0x2e861f){_0x56d803=_0x2e861f['length'];if(!_0x2feb2b['query'][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0x12d73d['limit']=qs[_0xcc6a('0x26')](_0x2feb2b[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x12d73d[_0xcc6a('0x24')]=qs[_0xcc6a('0x24')](_0x2feb2b[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x541207[_0xcc6a('0xe0')](_0x12d73d);}})[_0xcc6a('0x15')](function(_0x2be735){if(_0x2be735){return _0x2be735?{'count':_0x56d803,'rows':_0x2be735}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x3fdd45,null))[_0xcc6a('0x1f')](handleError(_0x3fdd45,null));};exports[_0xcc6a('0xe1')]=function(_0x105804,_0x323d17){var _0x4b5647={};var _0xe87104={};var _0x57e5f4;var _0x591916;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x105804['params']['id']}})['then'](handleEntityNotFound(_0x323d17,null))['then'](function(_0x3d43d2){if(_0x3d43d2){_0x57e5f4=_0x3d43d2;_0xe87104['model']=_[_0xcc6a('0x55')](db[_0xcc6a('0xe2')][_0xcc6a('0x3b')]);_0xe87104['query']=_[_0xcc6a('0x55')](_0x105804[_0xcc6a('0x41')]);_0xe87104[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0xe87104[_0xcc6a('0x53')],_0xe87104[_0xcc6a('0x41')]);_0x4b5647[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0xe87104[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x105804[_0xcc6a('0x41')]['fields']));_0x4b5647[_0xcc6a('0x44')]=_0x4b5647[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x4b5647[_0xcc6a('0x44')]:_0xe87104[_0xcc6a('0x53')];_0x4b5647['order']=qs[_0xcc6a('0xcb')](_0x105804[_0xcc6a('0x41')]['sort']);_0x4b5647[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x105804['query'],_0xe87104[_0xcc6a('0x56')]));if(_0x105804[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x4b5647[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x4b5647[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x4b5647[_0xcc6a('0x44')],function(_0xd98d8a){var _0x2a0257={};_0x2a0257[_0xd98d8a]={'$like':'%'+_0x105804[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'};return _0x2a0257;})});}_0x4b5647=_[_0xcc6a('0x59')]({},_0x4b5647,_0x105804[_0xcc6a('0x5a')]);return _0x57e5f4[_0xcc6a('0xe1')](_0x4b5647);}})[_0xcc6a('0x15')](function(_0x1f6d39){if(_0x1f6d39){_0x591916=_0x1f6d39[_0xcc6a('0x4a')];if(!_0x105804['query'][_0xcc6a('0xcf')]('nolimit')){_0x4b5647[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x105804['query'][_0xcc6a('0x26')]);_0x4b5647[_0xcc6a('0x24')]=qs['offset'](_0x105804['query'][_0xcc6a('0x24')]);}return _0x57e5f4[_0xcc6a('0xe1')](_0x4b5647);}})[_0xcc6a('0x15')](function(_0x2a1ed2){if(_0x2a1ed2){return _0x2a1ed2?{'count':_0x591916,'rows':_0x2a1ed2}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x323d17,null))['catch'](handleError(_0x323d17,null));};exports[_0xcc6a('0xe3')]=function(_0x341df6,_0x586ab0){var _0x10e9ec={'raw':!![],'where':{}};var _0x4af97d={};var _0x57b05b={'count':0x0,'rows':[]};return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x341df6[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x586ab0,null))[_0xcc6a('0x15')](function(_0x4aff44){if(_0x4aff44){_0x4af97d['model']=_['keys'](db[_0xcc6a('0xe4')][_0xcc6a('0x3b')]);_0x4af97d[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x341df6[_0xcc6a('0x41')]);_0x4af97d[_0xcc6a('0x56')]=_['intersection'](_0x4af97d[_0xcc6a('0x53')],_0x4af97d[_0xcc6a('0x41')]);_0x10e9ec[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x4af97d[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x341df6[_0xcc6a('0x41')]['fields']));_0x10e9ec[_0xcc6a('0x44')]=_0x10e9ec[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x10e9ec[_0xcc6a('0x44')]:_0x4af97d['model'];if(!_0x341df6['query']['hasOwnProperty'](_0xcc6a('0xd4'))){_0x10e9ec['limit']=qs[_0xcc6a('0x26')](_0x341df6['query'][_0xcc6a('0x26')]);_0x10e9ec[_0xcc6a('0x24')]=qs['offset'](_0x341df6[_0xcc6a('0x41')][_0xcc6a('0x24')]);}_0x10e9ec['order']=qs[_0xcc6a('0xcb')](_0x341df6[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x10e9ec[_0xcc6a('0xcc')]=qs['filters'](_[_0xcc6a('0xcd')](_0x341df6[_0xcc6a('0x41')],_0x4af97d[_0xcc6a('0x56')]));_0x10e9ec[_0xcc6a('0xcc')]['UserId']=_0x4aff44['id'];if(_0x341df6[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x10e9ec[_0xcc6a('0xcc')]=_['merge'](_0x10e9ec['where'],{'$or':_[_0xcc6a('0x33')](_0x10e9ec[_0xcc6a('0x44')],function(_0x9663d5){var _0x5adbac={};_0x5adbac[_0x9663d5]={'$like':'%'+_0x341df6[_0xcc6a('0x41')]['filter']+'%'};return _0x5adbac;})});}_0x10e9ec=_[_0xcc6a('0x59')]({},_0x10e9ec,_0x341df6['options']);return db[_0xcc6a('0xe4')][_0xcc6a('0x27')]({'where':_0x10e9ec['where']})[_0xcc6a('0x15')](function(_0x2c469e){_0x57b05b[_0xcc6a('0x27')]=_0x2c469e;if(_0x341df6[_0xcc6a('0x41')][_0xcc6a('0x42')]){_0x10e9ec[_0xcc6a('0x43')]=[{'all':!![]}];}return db[_0xcc6a('0xe4')][_0xcc6a('0x46')](_0x10e9ec);})[_0xcc6a('0x15')](function(_0x451fd5){_0x57b05b[_0xcc6a('0x47')]=_0x451fd5;return _0x57b05b;});}})[_0xcc6a('0x15')](respondWithFilteredResult(_0x586ab0,_0x10e9ec))[_0xcc6a('0x1f')](handleError(_0x586ab0,null));};exports[_0xcc6a('0xe5')]=function(_0x326641,_0x19f963){var _0x5c1b59={};var _0x34e332={};var _0x444260;var _0x1110a7;return db[_0xcc6a('0x3a')]['findOne']({'where':{'id':_0x326641[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x19f963,null))[_0xcc6a('0x15')](function(_0x59bfd1){if(_0x59bfd1){_0x444260=_0x59bfd1;_0x34e332['model']=_[_0xcc6a('0x55')](db['SmsInteraction'][_0xcc6a('0x3b')]);_0x34e332[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x326641[_0xcc6a('0x41')]);_0x34e332[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x34e332[_0xcc6a('0x53')],_0x34e332[_0xcc6a('0x41')]);_0x5c1b59[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x34e332[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x326641[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x5c1b59['attributes']=_0x5c1b59[_0xcc6a('0x44')]['length']?_0x5c1b59[_0xcc6a('0x44')]:_0x34e332[_0xcc6a('0x53')];_0x5c1b59[_0xcc6a('0xca')]=qs['sort'](_0x326641[_0xcc6a('0x41')]['sort']);_0x5c1b59[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_['pick'](_0x326641[_0xcc6a('0x41')],_0x34e332['filters']));if(_0x326641[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x5c1b59[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x5c1b59['where'],{'$or':_['map'](_0x5c1b59['attributes'],function(_0x3f8922){var _0x4fbd2d={};_0x4fbd2d[_0x3f8922]={'$like':'%'+_0x326641[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'};return _0x4fbd2d;})});}_0x5c1b59=_[_0xcc6a('0x59')]({},_0x5c1b59,_0x326641[_0xcc6a('0x5a')]);return _0x444260[_0xcc6a('0xe5')](_0x5c1b59);}})[_0xcc6a('0x15')](function(_0xe9b029){if(_0xe9b029){_0x1110a7=_0xe9b029[_0xcc6a('0x4a')];if(!_0x326641[_0xcc6a('0x41')][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0x5c1b59[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x326641[_0xcc6a('0x41')]['limit']);_0x5c1b59[_0xcc6a('0x24')]=qs[_0xcc6a('0x24')](_0x326641['query'][_0xcc6a('0x24')]);}return _0x444260[_0xcc6a('0xe5')](_0x5c1b59);}})[_0xcc6a('0x15')](function(_0x40c128){if(_0x40c128){return _0x40c128?{'count':_0x1110a7,'rows':_0x40c128}:null;}})['then'](respondWithResult(_0x19f963,null))[_0xcc6a('0x1f')](handleError(_0x19f963,null));};exports['getFaxInteractions']=function(_0x59e89d,_0x3cb1e5){var _0x29a72b={};var _0xe3c2aa={};var _0x59fde2;var _0x1ebfd9;return db[_0xcc6a('0x3a')]['findOne']({'where':{'id':_0x59e89d[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x3cb1e5,null))['then'](function(_0x133d40){if(_0x133d40){_0x59fde2=_0x133d40;_0xe3c2aa[_0xcc6a('0x53')]=_['keys'](db[_0xcc6a('0xe6')][_0xcc6a('0x3b')]);_0xe3c2aa[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x59e89d[_0xcc6a('0x41')]);_0xe3c2aa[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0xe3c2aa[_0xcc6a('0x53')],_0xe3c2aa[_0xcc6a('0x41')]);_0x29a72b[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0xe3c2aa[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x59e89d[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x29a72b['attributes']=_0x29a72b[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x29a72b[_0xcc6a('0x44')]:_0xe3c2aa[_0xcc6a('0x53')];_0x29a72b[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x59e89d[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x29a72b[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x59e89d['query'],_0xe3c2aa[_0xcc6a('0x56')]));if(_0x59e89d[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x29a72b[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x29a72b[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x29a72b['attributes'],function(_0x4f709d){var _0x18d021={};_0x18d021[_0x4f709d]={'$like':'%'+_0x59e89d[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'};return _0x18d021;})});}_0x29a72b=_[_0xcc6a('0x59')]({},_0x29a72b,_0x59e89d[_0xcc6a('0x5a')]);return _0x59fde2[_0xcc6a('0xe7')](_0x29a72b);}})[_0xcc6a('0x15')](function(_0x5e0f3c){if(_0x5e0f3c){_0x1ebfd9=_0x5e0f3c[_0xcc6a('0x4a')];if(!_0x59e89d[_0xcc6a('0x41')][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0x29a72b[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x59e89d[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x29a72b[_0xcc6a('0x24')]=qs['offset'](_0x59e89d[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x59fde2[_0xcc6a('0xe7')](_0x29a72b);}})[_0xcc6a('0x15')](function(_0x521a4c){if(_0x521a4c){return _0x521a4c?{'count':_0x1ebfd9,'rows':_0x521a4c}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x3cb1e5,null))['catch'](handleError(_0x3cb1e5,null));};exports[_0xcc6a('0xe8')]=function(_0x2e9544,_0x1fd266){var _0x447a50={};var _0x51a142={};var _0x55125d;var _0xfbd895;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x2e9544[_0xcc6a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1fd266,null))[_0xcc6a('0x15')](function(_0x1e6e71){if(_0x1e6e71){_0x55125d=_0x1e6e71;_0x51a142[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db[_0xcc6a('0xe9')][_0xcc6a('0x3b')]);_0x51a142[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x2e9544[_0xcc6a('0x41')]);_0x51a142['filters']=_[_0xcc6a('0x57')](_0x51a142[_0xcc6a('0x53')],_0x51a142[_0xcc6a('0x41')]);_0x447a50[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x51a142[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x2e9544[_0xcc6a('0x41')]['fields']));_0x447a50['attributes']=_0x447a50[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x447a50['attributes']:_0x51a142[_0xcc6a('0x53')];_0x447a50[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x2e9544[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x447a50[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x2e9544[_0xcc6a('0x41')],_0x51a142[_0xcc6a('0x56')]));if(_0x2e9544[_0xcc6a('0x41')]['filter']){_0x447a50[_0xcc6a('0xcc')]=_['merge'](_0x447a50['where'],{'$or':_[_0xcc6a('0x33')](_0x447a50[_0xcc6a('0x44')],function(_0x30e8ec){var _0x1cf74a={};_0x1cf74a[_0x30e8ec]={'$like':'%'+_0x2e9544[_0xcc6a('0x41')]['filter']+'%'};return _0x1cf74a;})});}_0x447a50=_[_0xcc6a('0x59')]({},_0x447a50,_0x2e9544[_0xcc6a('0x5a')]);return _0x55125d[_0xcc6a('0xe8')](_0x447a50);}})[_0xcc6a('0x15')](function(_0xf34dae){if(_0xf34dae){_0xfbd895=_0xf34dae[_0xcc6a('0x4a')];if(!_0x2e9544[_0xcc6a('0x41')]['hasOwnProperty'](_0xcc6a('0xd4'))){_0x447a50[_0xcc6a('0x26')]=qs['limit'](_0x2e9544['query']['limit']);_0x447a50[_0xcc6a('0x24')]=qs['offset'](_0x2e9544[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x55125d[_0xcc6a('0xe8')](_0x447a50);}})[_0xcc6a('0x15')](function(_0x318207){if(_0x318207){return _0x318207?{'count':_0xfbd895,'rows':_0x318207}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x1fd266,null))[_0xcc6a('0x1f')](handleError(_0x1fd266,null));};exports[_0xcc6a('0xea')]=function(_0xc0e4f1,_0x446ea3,_0x3ef2f4){var _0x5e792e;var _0x2f7109;var _0x48febb;var _0x3a0b78=!_['isNil'](_0xc0e4f1[_0xcc6a('0x5e')]['id'])?_0xc0e4f1[_0xcc6a('0x5e')]['id']:!_['isNil'](_0xc0e4f1['user']['id'])?_0xc0e4f1[_0xcc6a('0x2d')]['id']:null;return db[_0xcc6a('0x3a')]['find']({'where':{'id':_0x3a0b78,'role':{'$or':[_0xcc6a('0x7c'),'user',_0xcc6a('0x2f')]}},'attributes':['id',_0xcc6a('0x37'),_0xcc6a('0xeb'),_0xcc6a('0xec'),'role',_0xcc6a('0x62'),_0xcc6a('0x9a')]})['then'](function(_0x56dc6e){if(_0x56dc6e){if(_0x56dc6e[_0xcc6a('0x2b')]===_0xcc6a('0x2f')){_0x5e792e=_0x56dc6e;if(_0xc0e4f1[_0xcc6a('0x5d')]['interface']){_0x48febb=util[_0xcc6a('0xa8')](_0xcc6a('0xed'),_0x5e792e[_0xc0e4f1[_0xcc6a('0x5d')]['interface']]);}else if(_0xc0e4f1[_0xcc6a('0x5d')][_0xcc6a('0xee')]){_0x48febb=util['format'](_0xcc6a('0xa9'),_0xc0e4f1[_0xcc6a('0x5d')]['intrf']);}else{_0x48febb=util[_0xcc6a('0xa8')]('SIP/%s',_0x5e792e[_0xcc6a('0x37')]);}socket['to'](util[_0xcc6a('0xa8')](_0xcc6a('0xef'),_0x5e792e[_0xcc6a('0x37')]))[_0xcc6a('0xaf')](_0xcc6a('0xf0'),{'user':{'id':_0x5e792e['id'],'name':_0x5e792e[_0xcc6a('0x37')]},'ip':_0xc0e4f1[_0xcc6a('0xf1')]['x-forwarded-for']||_0xc0e4f1[_0xcc6a('0xf2')]['remoteAddress']||_0xc0e4f1[_0xcc6a('0xf3')][_0xcc6a('0xf4')]||_0xc0e4f1['connection'][_0xcc6a('0xf3')][_0xcc6a('0xf4')]});return db[_0xcc6a('0xaa')]['destroy']({'where':{'membername':_0x5e792e['name']},'individualHooks':!![]});}}else{throw new db[(_0xcc6a('0x8d'))][(_0xcc6a('0x90'))](_0xcc6a('0xf5'));}})['then'](function(){if(_0x5e792e){return _0x5e792e[_0xcc6a('0xf6')]({'raw':!![]});}})[_0xcc6a('0x15')](function(_0x33448c){if(_0x5e792e){var _0x4199b3=[];if(_0x33448c){_0x2f7109=_0x33448c;if(_0x2f7109[_0xcc6a('0x4a')]){for(var _0x31e6b8=0x0;_0x31e6b8<_0x2f7109[_0xcc6a('0x4a')];_0x31e6b8++){_0x4199b3[_0xcc6a('0x45')]({'membername':_0x5e792e[_0xcc6a('0x37')],'UserId':_0x5e792e['id'],'queue_name':_0x2f7109[_0x31e6b8]['name'],'VoiceQueueId':_0x2f7109[_0x31e6b8]['id'],'interface':_0x48febb,'paused':_0x5e792e[_0xcc6a('0x9a')]||![],'penalty':_0x2f7109[_0x31e6b8]['UserVoiceQueue.penalty']||0x0});}return BPromise[_0xcc6a('0x88')](_0x4199b3,function(_0x5b1605){return db['UserVoiceQueueRt'][_0xcc6a('0xf7')](_0x5b1605);});}}}})['then'](function(){if(_0x5e792e){return db['MemberReport']['findAll']({'where':{'membername':_0x5e792e[_0xcc6a('0x37')],'exitAt':null}});}})[_0xcc6a('0x15')](function(_0x44dd0d){if(_0x5e792e){var _0x6a6871=[];_0x44dd0d[_0xcc6a('0xf8')](function(_0x30aa6a){_0x6a6871[_0xcc6a('0x45')](_0x30aa6a['update']({'exitAt':moment()['format'](_0xcc6a('0xf9'))}));});return BPromise[_0xcc6a('0x51')](_0x6a6871);}})[_0xcc6a('0x15')](function(){if(_0x5e792e){var _0x325551=[];var _0x22b3f7=[];var _0x13b9e5=utils[_0xcc6a('0xfa')]();var _0x24961f={'membername':_0x5e792e[_0xcc6a('0x37')],'interface':_0x48febb,'enterAt':moment()[_0xcc6a('0xa8')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5e792e[_0xcc6a('0x2b')],'internal':_0x5e792e[_0xcc6a('0x62')]};_0x13b9e5[_0xcc6a('0xf8')](function(_0x1f2e64){_0x325551[_0xcc6a('0x45')](_[_0xcc6a('0x59')]({'channel':_0x1f2e64,'type':_0xcc6a('0xfb'),'data1':_0xc0e4f1['body']['device'],'data2':_0x48febb},_0x24961f));if(_0x5e792e[_0xcc6a('0x9a')]){_0x22b3f7['push'](_[_0xcc6a('0x59')]({'channel':_0x1f2e64,'type':_0xcc6a('0xfc'),'data1':_0xcc6a('0xfd')},_0x24961f));}});return db[_0xcc6a('0xfe')][_0xcc6a('0xff')](_0x325551[_0xcc6a('0x100')](_0x22b3f7),{'individualHooks':!![]});}})[_0xcc6a('0x15')](function(){if(_0x5e792e){return _0x5e792e['update']({'online':!![],'lastLoginAt':moment()[_0xcc6a('0xa8')](_0xcc6a('0xf9')),'voicePause':_0x5e792e[_0xcc6a('0x9a')]||![],'mailPause':_0x5e792e[_0xcc6a('0x9a')]||![],'chatPause':_0x5e792e['loginInPause']||![],'faxPause':_0x5e792e[_0xcc6a('0x9a')]||![],'smsPause':_0x5e792e[_0xcc6a('0x9a')]||![],'openchannelPause':_0x5e792e[_0xcc6a('0x9a')]||![],'whatsappPause':_0x5e792e[_0xcc6a('0x9a')]||![],'pauseType':_0x5e792e['loginInPause']?_0xcc6a('0xfd'):null,'interface':_0x48febb,'lastPauseAt':moment()[_0xcc6a('0xa8')](_0xcc6a('0xf9'))});}})['then'](function(_0x383a3d){if(_0xc0e4f1['isMiddleware']){return _0x3ef2f4();}else{return BPromise[_0xcc6a('0x101')](_0x383a3d)[_0xcc6a('0x15')](respondWithResult(_0x446ea3,null));}})[_0xcc6a('0x1f')](handleError(_0x446ea3,null));};exports[_0xcc6a('0x102')]=function(_0xa1753c,_0x559ec8){var _0x234dad;return db['User']['find']({'where':{'id':_0xa1753c['params']['id'],'role':_0xcc6a('0x2f')},'attributes':['id',_0xcc6a('0x37'),_0xcc6a('0x2b')]})[_0xcc6a('0x15')](handleEntityNotFound(_0x559ec8,null))['then'](function(_0x437b4c){if(_0x437b4c){_0x234dad=_0x437b4c;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x234dad[_0xcc6a('0x37')]},'individualHooks':!![]});}})['then'](function(){return db[_0xcc6a('0xfe')][_0xcc6a('0x46')]({'where':{'membername':_0x234dad[_0xcc6a('0x37')],'exitAt':null}});})['then'](function(_0x10f5d3){var _0x2ce1ca=[];_0x10f5d3[_0xcc6a('0xf8')](function(_0x35cc4f){_0x2ce1ca[_0xcc6a('0x45')](_0x35cc4f[_0xcc6a('0x103')]({'exitAt':moment()[_0xcc6a('0xa8')](_0xcc6a('0xf9'))}));});return BPromise[_0xcc6a('0x51')](_0x2ce1ca);})[_0xcc6a('0x15')](function(){return _0x234dad['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xcc6a('0x15')](respondWithResult(_0x559ec8,null))[_0xcc6a('0x1f')](handleError(_0x559ec8,null));};exports[_0xcc6a('0x104')]=function(_0x479851,_0x3a271f){var _0x34ba15;return db[_0xcc6a('0xaa')][_0xcc6a('0x103')]({'paused':0x1},{'where':{'UserId':_0x479851[_0xcc6a('0x5e')]['id']},'individualHooks':!![]})[_0xcc6a('0x15')](function(){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x479851[_0xcc6a('0x5e')]['id'],'role':_0xcc6a('0x2f')},'attributes':['id',_0xcc6a('0x37'),_0xcc6a('0x2b'),_0xcc6a('0x62'),_0xcc6a('0x9c')]});})[_0xcc6a('0x15')](handleEntityNotFound(_0x3a271f,null))[_0xcc6a('0x15')](function(_0x92284b){if(_0x92284b){_0x34ba15=_0x92284b;return respondWithRpcPromise(_0xcc6a('0x105'),_0xcc6a('0x104'),{'id':_0x34ba15['id'],'name':_0x34ba15['name'],'pause':!![]});}})['then'](function(){if(_0x34ba15){return db[_0xcc6a('0xfe')]['findAll']({'where':{'membername':_0x34ba15[_0xcc6a('0x37')],'type':_0xcc6a('0xfc'),'exitAt':null}});}})[_0xcc6a('0x15')](function(_0x4b936a){if(_0x4b936a[_0xcc6a('0x4a')]){var _0x5df174=moment()[_0xcc6a('0xa8')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x507a2e=0x0,_0x5545c2=_0x4b936a[_0xcc6a('0x4a')];_0x507a2e<_0x5545c2;_0x507a2e++){_0x4b936a[_0x507a2e]['updateAttributes']({'exitAt':_0x5df174});}}})[_0xcc6a('0x15')](function(){var _0x4f3e2b=[];var _0xfb0f8c=utils[_0xcc6a('0xfa')]();_0xfb0f8c[_0xcc6a('0xf8')](function(_0x314c7a){_0x4f3e2b[_0xcc6a('0x45')]({'channel':_0x314c7a,'membername':_0x34ba15[_0xcc6a('0x37')],'interface':_[_0xcc6a('0x67')](_0x34ba15['interface'])?util['format'](_0xcc6a('0xa9'),_0x34ba15[_0xcc6a('0x37')]):_0x34ba15[_0xcc6a('0x9c')],'type':'PAUSE','enterAt':moment()[_0xcc6a('0xa8')](_0xcc6a('0xf9')),'data1':_0x479851[_0xcc6a('0x5d')][_0xcc6a('0x3d')]||_0xcc6a('0x106'),'role':_0x34ba15['role'],'internal':_0x34ba15[_0xcc6a('0x62')]});});return db[_0xcc6a('0xfe')][_0xcc6a('0xff')](_0x4f3e2b,{'individualHooks':!![]});})[_0xcc6a('0x15')](function(){return _0x34ba15['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x479851[_0xcc6a('0x5d')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xcc6a('0xa8')](_0xcc6a('0xf9'))});})[_0xcc6a('0x15')](respondWithResult(_0x3a271f,null))[_0xcc6a('0x1f')](handleError(_0x3a271f,null));};exports[_0xcc6a('0x107')]=function(_0x1ff2b7,_0x4d2d0f){var _0x3d00aa;return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x1ff2b7[_0xcc6a('0x5e')]['id']},'attributes':['id',_0xcc6a('0x37'),_0xcc6a('0x2b'),'voicePause',_0xcc6a('0x108'),_0xcc6a('0x109'),'faxPause','openchannelPause','smsPause','whatsapppause','pauseType',_0xcc6a('0x10a')]})[_0xcc6a('0x15')](handleEntityNotFound(_0x4d2d0f,null))[_0xcc6a('0x15')](function(_0x2a39f0){if(_0x2a39f0){_0x3d00aa=_0x2a39f0;if(_0x1ff2b7[_0xcc6a('0x5d')][_0xcc6a('0x99')]&&!utils['isValidChannel'](_0x1ff2b7[_0xcc6a('0x5d')][_0xcc6a('0x99')])){throw new db[(_0xcc6a('0x8d'))][(_0xcc6a('0x90'))](_0xcc6a('0x9d'));}switch(_0x1ff2b7[_0xcc6a('0x5d')][_0xcc6a('0x99')]){case _0xcc6a('0xa6'):return respondWithRpcPromise('QueuePause',_0xcc6a('0x107'),{'id':_0x3d00aa['id'],'name':_0x3d00aa[_0xcc6a('0x37')],'pause':![]})[_0xcc6a('0x15')](function(){return db[_0xcc6a('0xaa')][_0xcc6a('0x103')]({'paused':0x0},{'where':{'UserId':_0x3d00aa['id']},'individualHooks':!![]});})['then'](function(){return db[_0xcc6a('0xfe')]['find']({'where':{'channel':_0x1ff2b7[_0xcc6a('0x5d')][_0xcc6a('0x99')],'membername':_0x3d00aa[_0xcc6a('0x37')],'type':_0xcc6a('0xfc'),'exitAt':null}});})[_0xcc6a('0x15')](function(_0x266ee5){if(_0x266ee5){return _0x266ee5[_0xcc6a('0x103')]({'exitAt':moment()[_0xcc6a('0xa8')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3d00aa[_0xcc6a('0x103')]({'voicePause':![]});});case _0xcc6a('0x4e'):case'chat':case _0xcc6a('0x5c'):case'sms':case _0xcc6a('0x50'):case _0xcc6a('0x4f'):return db[_0xcc6a('0xfe')][_0xcc6a('0x5b')]({'where':{'channel':_0x1ff2b7[_0xcc6a('0x5d')]['channel'],'membername':_0x3d00aa['name'],'type':_0xcc6a('0xfc'),'exitAt':null}})['then'](function(_0x145a84){if(_0x145a84){return _0x145a84[_0xcc6a('0x103')]({'exitAt':moment()[_0xcc6a('0xa8')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xcc6a('0x10b')},{'individualHooks':!![]});}return null;})[_0xcc6a('0x15')](function(){var _0x5337c8={};_[_0xcc6a('0x28')](_0x5337c8,util[_0xcc6a('0xa8')](_0xcc6a('0x10c'),_0x1ff2b7[_0xcc6a('0x5d')]['channel'],_0xcc6a('0x10d')),![]);return _0x3d00aa[_0xcc6a('0x103')](_0x5337c8);});default:return respondWithRpcPromise(_0xcc6a('0x105'),_0xcc6a('0x107'),{'id':_0x3d00aa['id'],'name':_0x3d00aa[_0xcc6a('0x37')],'pause':![]})['then'](function(){return db[_0xcc6a('0xaa')][_0xcc6a('0x103')]({'paused':0x0},{'where':{'UserId':_0x3d00aa['id']}});})['then'](function(){return db[_0xcc6a('0xfe')][_0xcc6a('0x46')]({'where':{'membername':_0x3d00aa[_0xcc6a('0x37')],'type':_0xcc6a('0xfc'),'exitAt':null}});})[_0xcc6a('0x15')](function(_0x3356f6){var _0x4899ed=[];_0x3356f6['forEach'](function(_0x1231b3){_0x4899ed[_0xcc6a('0x45')](_0x1231b3['update']({'exitAt':moment()[_0xcc6a('0xa8')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'}));});return BPromise['all'](_0x4899ed);})['then'](function(){return _0x3d00aa[_0xcc6a('0x103')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xcc6a('0x15')](respondWithResult(_0x4d2d0f,null))['catch'](handleError(_0x4d2d0f,null));};exports[_0xcc6a('0x10e')]=function(_0x3388ba,_0x1d1889){var _0x565294={};var _0x240ba9={};var _0x58c6a3;var _0x4f3f56;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x3388ba[_0xcc6a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1d1889,null))[_0xcc6a('0x15')](function(_0x58c704){if(_0x58c704){_0x58c6a3=_0x58c704;_0x240ba9[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db[_0xcc6a('0x10f')][_0xcc6a('0x3b')]);_0x240ba9[_0xcc6a('0x41')]=_['keys'](_0x3388ba['query']);_0x240ba9[_0xcc6a('0x56')]=_['intersection'](_0x240ba9[_0xcc6a('0x53')],_0x240ba9[_0xcc6a('0x41')]);_0x565294[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x240ba9[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x3388ba[_0xcc6a('0x41')]['fields']));_0x565294[_0xcc6a('0x44')]=_0x565294[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x565294[_0xcc6a('0x44')]:_0x240ba9[_0xcc6a('0x53')];_0x565294['order']=qs[_0xcc6a('0xcb')](_0x3388ba[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x565294[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x3388ba['query'],_0x240ba9['filters']));if(_0x3388ba[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x565294[_0xcc6a('0xcc')]=_['merge'](_0x565294['where'],{'$or':_[_0xcc6a('0x33')](_0x565294[_0xcc6a('0x44')],function(_0x30b0fe){var _0x14f14f={};_0x14f14f[_0x30b0fe]={'$like':'%'+_0x3388ba[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'};return _0x14f14f;})});}_0x565294=_['merge']({},_0x565294,_0x3388ba[_0xcc6a('0x5a')]);return _0x58c6a3[_0xcc6a('0x10e')](_0x565294);}})[_0xcc6a('0x15')](function(_0x4aaa3f){if(_0x4aaa3f){_0x4f3f56=_0x4aaa3f['length'];if(!_0x3388ba[_0xcc6a('0x41')][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0x565294[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x3388ba[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x565294['offset']=qs[_0xcc6a('0x24')](_0x3388ba['query'][_0xcc6a('0x24')]);}return _0x58c6a3['getTeams'](_0x565294);}})['then'](function(_0x1e3623){if(_0x1e3623){return _0x1e3623?{'count':_0x4f3f56,'rows':_0x1e3623}:null;}})['then'](respondWithResult(_0x1d1889,null))['catch'](handleError(_0x1d1889,null));};exports[_0xcc6a('0x110')]=function(_0x3bbc41,_0x4c07e2){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x3bbc41[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x4c07e2,null))['then'](function(_0x23fe38){if(_0x23fe38){var _0x15b569=_0x23fe38['get']({'plain':!![]});return _0x23fe38[_0xcc6a('0x110')](_0x3bbc41[_0xcc6a('0x5d')][_0xcc6a('0x61')],_[_0xcc6a('0x111')](_0x3bbc41[_0xcc6a('0x5d')],['ids','id'])||{})[_0xcc6a('0x15')](function(){for(var _0x85f83c=0x0;_0x85f83c<_0x3bbc41[_0xcc6a('0x5d')][_0xcc6a('0x61')][_0xcc6a('0x4a')];_0x85f83c++){var _0x45c420=[];var _0x24a07a={};db[_0xcc6a('0x10f')][_0xcc6a('0xc9')]({'where':{'id':_0x3bbc41[_0xcc6a('0x5d')]['ids'][_0x85f83c]}})[_0xcc6a('0x15')](function(_0x3ec5c2){_0x24a07a=_0x3ec5c2[_0xcc6a('0x4c')];_0x45c420[_0xcc6a('0x45')](_0x3ec5c2[_0xcc6a('0xf6')]()[_0xcc6a('0x15')](function(_0x2e957e){for(var _0x372f87=0x0;_0x372f87<_0x2e957e[_0xcc6a('0x4a')];_0x372f87++){_0x2e957e[_0x372f87][_0xcc6a('0x112')](_0xcc6a('0x99'),_0xcc6a('0x113'));}return _0x2e957e;}));_0x45c420[_0xcc6a('0x45')](_0x3ec5c2[_0xcc6a('0x114')]()[_0xcc6a('0x15')](function(_0x286da9){for(var _0x393c59=0x0;_0x393c59<_0x286da9[_0xcc6a('0x4a')];_0x393c59++){_0x286da9[_0x393c59]['setDataValue'](_0xcc6a('0x99'),_0xcc6a('0x115'));}return _0x286da9;}));_0x45c420[_0xcc6a('0x45')](_0x3ec5c2['getMailQueues']()[_0xcc6a('0x15')](function(_0x47b3ab){for(var _0x40a4eb=0x0;_0x40a4eb<_0x47b3ab[_0xcc6a('0x4a')];_0x40a4eb++){_0x47b3ab[_0x40a4eb][_0xcc6a('0x112')]('channel',_0xcc6a('0x116'));}return _0x47b3ab;}));_0x45c420[_0xcc6a('0x45')](_0x3ec5c2['getSmsQueues']()[_0xcc6a('0x15')](function(_0xf264af){for(var _0x12858a=0x0;_0x12858a<_0xf264af[_0xcc6a('0x4a')];_0x12858a++){_0xf264af[_0x12858a]['setDataValue']('channel',_0xcc6a('0x117'));}return _0xf264af;}));_0x45c420['push'](_0x3ec5c2[_0xcc6a('0x118')]()[_0xcc6a('0x15')](function(_0x3d3c6e){for(var _0x39a562=0x0;_0x39a562<_0x3d3c6e[_0xcc6a('0x4a')];_0x39a562++){_0x3d3c6e[_0x39a562][_0xcc6a('0x112')](_0xcc6a('0x99'),_0xcc6a('0x119'));}return _0x3d3c6e;}));_0x45c420[_0xcc6a('0x45')](_0x3ec5c2[_0xcc6a('0x11a')]()[_0xcc6a('0x15')](function(_0x20b494){for(var _0x2328ae=0x0;_0x2328ae<_0x20b494[_0xcc6a('0x4a')];_0x2328ae++){_0x20b494[_0x2328ae][_0xcc6a('0x112')](_0xcc6a('0x99'),_0xcc6a('0x11b'));}return _0x20b494;}));_0x45c420[_0xcc6a('0x45')](_0x3ec5c2[_0xcc6a('0x11c')]()[_0xcc6a('0x15')](function(_0x501331){for(var _0x23b01f=0x0;_0x23b01f<_0x501331['length'];_0x23b01f++){_0x501331[_0x23b01f][_0xcc6a('0x112')](_0xcc6a('0x99'),'Openchannel');}return _0x501331;}));return BPromise[_0xcc6a('0x51')](_0x45c420);})[_0xcc6a('0x15')](function(_0x317ad9){var _0x52d84e=_[_0xcc6a('0x11d')](_0x317ad9);_0x45c420=[];return db[_0xcc6a('0x69')][_0xcc6a('0x11e')](function(_0x349744){for(var _0x4fe9ed=0x0;_0x4fe9ed<_0x52d84e['length'];_0x4fe9ed++){_0x45c420[_0xcc6a('0x45')](_0x52d84e[_0x4fe9ed][_0xcc6a('0x11f')](_0x15b569['id']),{'transaction':_0x349744});}return BPromise[_0xcc6a('0x51')](_0x45c420)[_0xcc6a('0x15')](function(){if(_0x15b569['online']){return BPromise[_0xcc6a('0x88')](_[_0xcc6a('0xce')](_0x52d84e,function(_0x3bf94c){return _0x3bf94c['getDataValue'](_0xcc6a('0x99'))==='Voice';}),function(_0x47c5af){return db[_0xcc6a('0xaa')][_0xcc6a('0xf7')]({'membername':_0x15b569[_0xcc6a('0x37')],'UserId':_0x15b569['id'],'queue_name':_0x47c5af[_0xcc6a('0x37')],'VoiceQueueId':_0x47c5af['id'],'interface':_[_0xcc6a('0x67')](_0x15b569[_0xcc6a('0x9c')])?util[_0xcc6a('0xa8')](_0xcc6a('0xa9'),_0x15b569['name']):_0x15b569[_0xcc6a('0x9c')],'paused':_0x15b569[_0xcc6a('0x9b')]||![],'penalty':_0x15b569[_0xcc6a('0xa2')]},{'transaction':_0x349744});});}else{return;}})[_0xcc6a('0x15')](function(){for(var _0x559fb0=0x0;_0x559fb0<_0x52d84e[_0xcc6a('0x4a')];_0x559fb0++){var _0xae10a=_0x52d84e[_0x559fb0]['getDataValue'](_0xcc6a('0x99'));var _0x1286c4=_0xae10a+_0xcc6a('0xa3');socket[_0xcc6a('0xaf')]('user'+_0xae10a+_0xcc6a('0xa4'),{'UserId':_0x15b569['id'],['queueField']:_0x52d84e[_0x559fb0]['id']});}});});})['then'](function(){db[_0xcc6a('0x120')][_0xcc6a('0xc9')]({'where':{'teamId':_0x24a07a['id']}})[_0xcc6a('0x15')](function(_0x45c8fd){if(_0x45c8fd){db[_0xcc6a('0x121')]['create']({'UserId':_0x3bbc41[_0xcc6a('0x5e')]['id'],'VoicePrefixId':_0x45c8fd['VoicePrefixId']});}});});}});}})[_0xcc6a('0x15')](respondWithStatusCode(_0x4c07e2,null))[_0xcc6a('0x1f')](handleError(_0x4c07e2,null));};exports[_0xcc6a('0x122')]=function(_0x31763a,_0x3fec28){return db['User'][_0xcc6a('0xc9')]({'where':{'id':_0x31763a[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x3fec28,null))[_0xcc6a('0x15')](function(_0x20f4d3){if(_0x20f4d3){var _0x2a27d9=_0x20f4d3[_0xcc6a('0x2a')]({'plain':!![]});var _0x429ad3=_0x31763a[_0xcc6a('0x41')][_0xcc6a('0x61')];return _0x20f4d3[_0xcc6a('0x122')](_0x429ad3)[_0xcc6a('0x15')](function(){for(var _0x4712bc=0x0;_0x4712bc<_0x429ad3[_0xcc6a('0x4a')];_0x4712bc++){var _0x498c09=[];var _0x2c136a={};db[_0xcc6a('0x10f')][_0xcc6a('0xc9')]({'where':{'id':_0x429ad3[_0x4712bc]}})['then'](function(_0x1a0604){_0x2c136a=_0x1a0604[_0xcc6a('0x4c')];_0x498c09[_0xcc6a('0x45')](_0x1a0604[_0xcc6a('0xf6')]()[_0xcc6a('0x15')](function(_0x366432){for(var _0x550151=0x0;_0x550151<_0x366432[_0xcc6a('0x4a')];_0x550151++){_0x366432[_0x550151]['setDataValue']('channel',_0xcc6a('0x113'));}return _0x366432;}));_0x498c09[_0xcc6a('0x45')](_0x1a0604[_0xcc6a('0x114')]()[_0xcc6a('0x15')](function(_0x508395){for(var _0x4ff125=0x0;_0x4ff125<_0x508395[_0xcc6a('0x4a')];_0x4ff125++){_0x508395[_0x4ff125][_0xcc6a('0x112')](_0xcc6a('0x99'),_0xcc6a('0x115'));}return _0x508395;}));_0x498c09[_0xcc6a('0x45')](_0x1a0604[_0xcc6a('0x123')]()['then'](function(_0x4e2e69){for(var _0x12226b=0x0;_0x12226b<_0x4e2e69[_0xcc6a('0x4a')];_0x12226b++){_0x4e2e69[_0x12226b][_0xcc6a('0x112')]('channel','Mail');}return _0x4e2e69;}));_0x498c09['push'](_0x1a0604[_0xcc6a('0x124')]()['then'](function(_0x597ebd){for(var _0x1f6f80=0x0;_0x1f6f80<_0x597ebd[_0xcc6a('0x4a')];_0x1f6f80++){_0x597ebd[_0x1f6f80][_0xcc6a('0x112')](_0xcc6a('0x99'),_0xcc6a('0x117'));}return _0x597ebd;}));_0x498c09['push'](_0x1a0604[_0xcc6a('0x118')]()['then'](function(_0x47515b){for(var _0x1fde49=0x0;_0x1fde49<_0x47515b[_0xcc6a('0x4a')];_0x1fde49++){_0x47515b[_0x1fde49][_0xcc6a('0x112')]('channel',_0xcc6a('0x119'));}return _0x47515b;}));_0x498c09['push'](_0x1a0604[_0xcc6a('0x11a')]()[_0xcc6a('0x15')](function(_0x14c7ff){for(var _0x356c01=0x0;_0x356c01<_0x14c7ff[_0xcc6a('0x4a')];_0x356c01++){_0x14c7ff[_0x356c01][_0xcc6a('0x112')](_0xcc6a('0x99'),_0xcc6a('0x11b'));}return _0x14c7ff;}));_0x498c09[_0xcc6a('0x45')](_0x1a0604[_0xcc6a('0x11c')]()['then'](function(_0x113c25){for(var _0x53cc96=0x0;_0x53cc96<_0x113c25['length'];_0x53cc96++){_0x113c25[_0x53cc96][_0xcc6a('0x112')]('channel',_0xcc6a('0x125'));}return _0x113c25;}));return BPromise[_0xcc6a('0x51')](_0x498c09);})[_0xcc6a('0x15')](function(_0x2f1dd6){var _0x10210f=_[_0xcc6a('0x11d')](_0x2f1dd6);_0x498c09=[];return db[_0xcc6a('0x69')][_0xcc6a('0x11e')](function(_0x318d05){for(var _0x5a8ed3=0x0;_0x5a8ed3<_0x10210f[_0xcc6a('0x4a')];_0x5a8ed3++){_0x498c09[_0xcc6a('0x45')](_0x10210f[_0x5a8ed3][_0xcc6a('0x126')](_0x2a27d9['id']),{'transaction':_0x318d05});}return BPromise[_0xcc6a('0x51')](_0x498c09)[_0xcc6a('0x15')](function(){if(_0x2a27d9[_0xcc6a('0xa7')]){return BPromise[_0xcc6a('0x88')](_[_0xcc6a('0xce')](_0x10210f,function(_0x2ee275){return _0x2ee275[_0xcc6a('0x127')](_0xcc6a('0x99'))==='Voice';}),function(_0x58a960){return db[_0xcc6a('0xaa')][_0xcc6a('0x29')]({'where':{'VoiceQueueId':_0x58a960['id'],'UserId':_0x2a27d9['id']},'transaction':_0x318d05});});}else{return;}})[_0xcc6a('0x15')](function(){db[_0xcc6a('0x120')][_0xcc6a('0xc9')]({'where':{'teamId':_0x2c136a['id']}})[_0xcc6a('0x15')](function(_0x52e80c){if(_0x52e80c){return db[_0xcc6a('0x121')][_0xcc6a('0x29')]({'where':{'UserId':_0x2a27d9['id'],'VoicePrefixId':_0x52e80c[_0xcc6a('0x4c')][_0xcc6a('0x128')]}});}});})['then'](function(){for(var _0xa69eee=0x0;_0xa69eee<_0x10210f[_0xcc6a('0x4a')];_0xa69eee++){var _0xf6d41f=_0x10210f[_0xa69eee][_0xcc6a('0x127')](_0xcc6a('0x99'));var _0x490884=_0xf6d41f+_0xcc6a('0xa3');socket[_0xcc6a('0xaf')](_0xcc6a('0x2d')+_0xf6d41f+_0xcc6a('0xae'),{'UserId':_0x2a27d9['id'],['queueField']:_0x10210f[_0xa69eee]['id']});}});});});}});}})[_0xcc6a('0x15')](respondWithStatusCode(_0x3fec28,null))['catch'](handleError(_0x3fec28,null));};exports[_0xcc6a('0x129')]=function(_0x57df2e,_0x8ad2d0){var _0x2f20d2={};var _0x3a302b={};var _0x5b1f23;var _0x43442d;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x57df2e[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x8ad2d0,null))[_0xcc6a('0x15')](function(_0x4ecf6d){if(_0x4ecf6d){_0x5b1f23=_0x4ecf6d;_0x3a302b['model']=_[_0xcc6a('0x55')](db['CmList'][_0xcc6a('0x3b')]);_0x3a302b[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x57df2e[_0xcc6a('0x41')]);_0x3a302b['filters']=_['intersection'](_0x3a302b['model'],_0x3a302b[_0xcc6a('0x41')]);_0x2f20d2['attributes']=_[_0xcc6a('0x57')](_0x3a302b['model'],qs['fields'](_0x57df2e[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x2f20d2['attributes']=_0x2f20d2[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x2f20d2[_0xcc6a('0x44')]:_0x3a302b['model'];_0x2f20d2[_0xcc6a('0xca')]=qs['sort'](_0x57df2e[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x2f20d2[_0xcc6a('0xcc')]=qs['filters'](_[_0xcc6a('0xcd')](_0x57df2e[_0xcc6a('0x41')],_0x3a302b[_0xcc6a('0x56')]));if(_0x57df2e[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x2f20d2[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x2f20d2[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x2f20d2['attributes'],function(_0x5d0458){var _0x4f4f08={};_0x4f4f08[_0x5d0458]={'$like':'%'+_0x57df2e[_0xcc6a('0x41')]['filter']+'%'};return _0x4f4f08;})});}_0x2f20d2=_[_0xcc6a('0x59')]({},_0x2f20d2,_0x57df2e[_0xcc6a('0x5a')]);return _0x5b1f23[_0xcc6a('0x129')](_0x2f20d2);}})['then'](function(_0xf63fde){if(_0xf63fde){_0x43442d=_0xf63fde['length'];if(!_0x57df2e[_0xcc6a('0x41')][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0x2f20d2['limit']=qs[_0xcc6a('0x26')](_0x57df2e[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x2f20d2[_0xcc6a('0x24')]=qs[_0xcc6a('0x24')](_0x57df2e[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x5b1f23['getLists'](_0x2f20d2);}})[_0xcc6a('0x15')](function(_0x28d665){if(_0x28d665){return _0x28d665?{'count':_0x43442d,'rows':_0x28d665}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x8ad2d0,null))[_0xcc6a('0x1f')](handleError(_0x8ad2d0,null));};exports['getAgents']=function(_0x4c2a37,_0x1d52fb){var _0x5dd53b={};var _0x2a7d52={};var _0x1c3834;var _0x46204f;return db['User']['findOne']({'where':{'id':_0x4c2a37['params']['id']}})['then'](handleEntityNotFound(_0x1d52fb,null))[_0xcc6a('0x15')](function(_0x608c23){if(_0x608c23){_0x1c3834=_0x608c23;_0x2a7d52[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db[_0xcc6a('0x3a')][_0xcc6a('0x3b')]);_0x2a7d52['query']=_[_0xcc6a('0x55')](_0x4c2a37[_0xcc6a('0x41')]);_0x2a7d52[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x2a7d52['model'],_0x2a7d52['query']);_0x5dd53b['attributes']=_[_0xcc6a('0x57')](_0x2a7d52[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x4c2a37[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x5dd53b[_0xcc6a('0x44')]=_0x5dd53b[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x5dd53b['attributes']:_0x2a7d52[_0xcc6a('0x53')];_0x5dd53b['order']=qs[_0xcc6a('0xcb')](_0x4c2a37[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x5dd53b['where']=qs['filters'](_[_0xcc6a('0xcd')](_0x4c2a37[_0xcc6a('0x41')],_0x2a7d52[_0xcc6a('0x56')]));if(_0x4c2a37[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x5dd53b[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x5dd53b['where'],{'$or':_['map'](_0x5dd53b['attributes'],function(_0x35579f){var _0x3c2863={};_0x3c2863[_0x35579f]={'$like':'%'+_0x4c2a37[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'};return _0x3c2863;})});}_0x5dd53b['model']=db[_0xcc6a('0x3a')];_0x5dd53b['as']=_0xcc6a('0x2e');_0x5dd53b=_[_0xcc6a('0x59')]({},_0x5dd53b,_0x4c2a37['options']);return _0x1c3834[_0xcc6a('0xf6')]({'include':[_0x5dd53b]});}})[_0xcc6a('0x15')](function(_0x45b04d){if(_0x45b04d){var _0x1d3fb0={},_0x155b03=[],_0x15565c=0x0;for(var _0x1da02b=0x0;_0x1da02b<_0x45b04d[_0xcc6a('0x4a')];_0x1da02b+=0x1){for(var _0x18d18d=0x0,_0x303466;_0x18d18d<_0x45b04d[_0x1da02b][_0xcc6a('0x2e')]['length'];_0x18d18d+=0x1){_0x303466=_0x45b04d[_0x1da02b]['Agents'][_0x18d18d]['get']({'plain':!![]});_0x1d3fb0[_0x303466['id']]=_0x303466;}}_0x1d3fb0=_[_0xcc6a('0x12a')](_0x1d3fb0);for(var _0x1a909e=qs['offset'](_0x4c2a37[_0xcc6a('0x41')]['offset']);_0x1a909e<_0x1d3fb0[_0xcc6a('0x4a')]&&_0x155b03[_0xcc6a('0x4a')]<qs[_0xcc6a('0x26')](_0x4c2a37[_0xcc6a('0x41')]['limit']);_0x1a909e+=0x1){if(_0x1d3fb0[_0x1a909e]){_0x155b03['push'](_0x1d3fb0[_0x1a909e]);}}return{'count':_0x1d3fb0[_0xcc6a('0x4a')],'rows':_0x155b03};}})['then'](respondWithResult(_0x1d52fb,null))['catch'](handleError(_0x1d52fb,null));};exports[_0xcc6a('0x29')]=function(_0x2ae683,_0x216a3a){if(_0x2ae683[_0xcc6a('0x2d')]['id']==_0x2ae683[_0xcc6a('0x5e')]['id']){return _0x216a3a[_0xcc6a('0x21')](0x1f4)[_0xcc6a('0x38')]({'message':_0xcc6a('0x12b')});}return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x2ae683[_0xcc6a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x216a3a,null))[_0xcc6a('0x15')](removeEntity(_0x216a3a,null))[_0xcc6a('0x1f')](handleError(_0x216a3a,null));};exports[_0xcc6a('0x12c')]=function(_0x56e187,_0x192643){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x56e187[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x192643,null))['then'](function(_0x3245d9){if(_0x3245d9){return _0x3245d9[_0xcc6a('0x12c')](_0x56e187[_0xcc6a('0x5d')]['ids'],_[_0xcc6a('0x111')](_0x56e187[_0xcc6a('0x5d')],[_0xcc6a('0x61'),'id'])||{})[_0xcc6a('0x12d')](function(){for(var _0xb338c9=0x0;_0xb338c9<_0x56e187[_0xcc6a('0x5d')]['ids']['length'];_0xb338c9+=0x1){socket[_0xcc6a('0xaf')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x56e187[_0xcc6a('0x5d')][_0xcc6a('0x61')][_0xb338c9]),'UserId':Number(_0x56e187[_0xcc6a('0x5e')]['id'])});}return _0x56e187[_0xcc6a('0x5d')][_0xcc6a('0x61')];});}})[_0xcc6a('0x15')](respondWithResult(_0x192643,null))[_0xcc6a('0x1f')](handleError(_0x192643,null));};exports[_0xcc6a('0x12e')]=function(_0x121520,_0x2b1d3d){return db[_0xcc6a('0x3a')]['find']({'where':{'id':_0x121520[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x2b1d3d,null))[_0xcc6a('0x15')](function(_0x542b7c){if(_0x542b7c){return _0x542b7c[_0xcc6a('0x12e')](_0x121520[_0xcc6a('0x41')][_0xcc6a('0x61')])['then'](function(){if(_[_0xcc6a('0xad')](_0x121520['query'][_0xcc6a('0x61')])){for(var _0x554873=0x0;_0x554873<_0x121520['query'][_0xcc6a('0x61')][_0xcc6a('0x4a')];_0x554873+=0x1){socket['emit'](_0xcc6a('0x12f'),{'ChatInteractionId':Number(_0x121520['query'][_0xcc6a('0x61')][_0x554873]),'UserId':Number(_0x121520['params']['id'])});}}else{socket[_0xcc6a('0xaf')](_0xcc6a('0x12f'),{'ChatInteractionId':Number(_0x121520[_0xcc6a('0x41')][_0xcc6a('0x61')]),'UserId':Number(_0x121520[_0xcc6a('0x5e')]['id'])});}});}})[_0xcc6a('0x15')](respondWithStatusCode(_0x2b1d3d,null))[_0xcc6a('0x1f')](handleError(_0x2b1d3d,null));};exports[_0xcc6a('0x130')]=function(_0xd399e3,_0x50d7fc){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0xd399e3[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x50d7fc,null))['then'](function(_0x48afb2){if(_0x48afb2){return _0x48afb2[_0xcc6a('0x130')](_0xd399e3['body']['ids'],_[_0xcc6a('0x111')](_0xd399e3[_0xcc6a('0x5d')],['ids','id'])||{})[_0xcc6a('0x12d')](function(){for(var _0x497fdc=0x0;_0x497fdc<_0xd399e3['body'][_0xcc6a('0x61')][_0xcc6a('0x4a')];_0x497fdc+=0x1){socket[_0xcc6a('0xaf')](_0xcc6a('0x131'),{'MailInteractionId':Number(_0xd399e3['body'][_0xcc6a('0x61')][_0x497fdc]),'UserId':Number(_0xd399e3[_0xcc6a('0x5e')]['id'])});}return _0xd399e3[_0xcc6a('0x5d')][_0xcc6a('0x61')];});}})[_0xcc6a('0x15')](respondWithResult(_0x50d7fc,null))[_0xcc6a('0x1f')](handleError(_0x50d7fc,null));};exports[_0xcc6a('0x132')]=function(_0x4c9674,_0x3547fe){return db[_0xcc6a('0x3a')]['find']({'where':{'id':_0x4c9674[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x3547fe,null))[_0xcc6a('0x15')](function(_0x19a0b3){if(_0x19a0b3){return _0x19a0b3[_0xcc6a('0x132')](_0x4c9674[_0xcc6a('0x41')][_0xcc6a('0x61')])[_0xcc6a('0x15')](function(){if(_[_0xcc6a('0xad')](_0x4c9674['query']['ids'])){for(var _0x3ef69d=0x0;_0x3ef69d<_0x4c9674[_0xcc6a('0x41')][_0xcc6a('0x61')][_0xcc6a('0x4a')];_0x3ef69d+=0x1){socket['emit'](_0xcc6a('0x133'),{'MailInteractionId':Number(_0x4c9674['query'][_0xcc6a('0x61')][_0x3ef69d]),'UserId':Number(_0x4c9674['params']['id'])});}}else{socket['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x4c9674[_0xcc6a('0x41')][_0xcc6a('0x61')]),'UserId':Number(_0x4c9674[_0xcc6a('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x3547fe,null))[_0xcc6a('0x1f')](handleError(_0x3547fe,null));};exports['addFaxInteractions']=function(_0x21f1f4,_0x377a80){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x21f1f4[_0xcc6a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x377a80,null))['then'](function(_0x240820){if(_0x240820){return _0x240820[_0xcc6a('0x134')](_0x21f1f4[_0xcc6a('0x5d')]['ids'],_['omit'](_0x21f1f4[_0xcc6a('0x5d')],[_0xcc6a('0x61'),'id'])||{})[_0xcc6a('0x12d')](function(){for(var _0x4c607d=0x0;_0x4c607d<_0x21f1f4[_0xcc6a('0x5d')][_0xcc6a('0x61')][_0xcc6a('0x4a')];_0x4c607d+=0x1){socket[_0xcc6a('0xaf')](_0xcc6a('0x135'),{'FaxInteractionId':Number(_0x21f1f4['body'][_0xcc6a('0x61')][_0x4c607d]),'UserId':Number(_0x21f1f4[_0xcc6a('0x5e')]['id'])});}return _0x21f1f4[_0xcc6a('0x5d')][_0xcc6a('0x61')];});}})[_0xcc6a('0x15')](respondWithResult(_0x377a80,null))[_0xcc6a('0x1f')](handleError(_0x377a80,null));};exports[_0xcc6a('0x136')]=function(_0x33930c,_0x4acb09){return db['User'][_0xcc6a('0x5b')]({'where':{'id':_0x33930c[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x4acb09,null))[_0xcc6a('0x15')](function(_0x9aca24){if(_0x9aca24){return _0x9aca24[_0xcc6a('0x136')](_0x33930c[_0xcc6a('0x41')][_0xcc6a('0x61')])[_0xcc6a('0x15')](function(){if(_[_0xcc6a('0xad')](_0x33930c[_0xcc6a('0x41')]['ids'])){for(var _0x34458d=0x0;_0x34458d<_0x33930c[_0xcc6a('0x41')][_0xcc6a('0x61')]['length'];_0x34458d+=0x1){socket[_0xcc6a('0xaf')](_0xcc6a('0x137'),{'FaxInteractionId':Number(_0x33930c[_0xcc6a('0x41')][_0xcc6a('0x61')][_0x34458d]),'UserId':Number(_0x33930c[_0xcc6a('0x5e')]['id'])});}}else{socket[_0xcc6a('0xaf')](_0xcc6a('0x137'),{'FaxInteractionId':Number(_0x33930c[_0xcc6a('0x41')][_0xcc6a('0x61')]),'UserId':Number(_0x33930c[_0xcc6a('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x4acb09,null))[_0xcc6a('0x1f')](handleError(_0x4acb09,null));};exports[_0xcc6a('0x138')]=function(_0x5f442d,_0x3e98ac){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x5f442d[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x3e98ac,null))['then'](function(_0x1ae4b7){if(_0x1ae4b7){return _0x1ae4b7[_0xcc6a('0x138')](_0x5f442d[_0xcc6a('0x5d')][_0xcc6a('0x61')],_[_0xcc6a('0x111')](_0x5f442d[_0xcc6a('0x5d')],[_0xcc6a('0x61'),'id'])||{})[_0xcc6a('0x12d')](function(){for(var _0x130666=0x0;_0x130666<_0x5f442d[_0xcc6a('0x5d')]['ids']['length'];_0x130666+=0x1){socket[_0xcc6a('0xaf')](_0xcc6a('0x139'),{'SmsInteractionId':Number(_0x5f442d[_0xcc6a('0x5d')][_0xcc6a('0x61')][_0x130666]),'UserId':Number(_0x5f442d['params']['id'])});}return _0x5f442d[_0xcc6a('0x5d')][_0xcc6a('0x61')];});}})[_0xcc6a('0x15')](respondWithResult(_0x3e98ac,null))[_0xcc6a('0x1f')](handleError(_0x3e98ac,null));};exports[_0xcc6a('0x13a')]=function(_0x42cf50,_0x19c90b){return db['User'][_0xcc6a('0x5b')]({'where':{'id':_0x42cf50[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x19c90b,null))['then'](function(_0x151c63){if(_0x151c63){return _0x151c63['removeSmsInteractions'](_0x42cf50[_0xcc6a('0x41')][_0xcc6a('0x61')])[_0xcc6a('0x15')](function(){if(_[_0xcc6a('0xad')](_0x42cf50[_0xcc6a('0x41')]['ids'])){for(var _0x3c2b86=0x0;_0x3c2b86<_0x42cf50[_0xcc6a('0x41')]['ids'][_0xcc6a('0x4a')];_0x3c2b86+=0x1){socket[_0xcc6a('0xaf')](_0xcc6a('0x13b'),{'SmsInteractionId':Number(_0x42cf50[_0xcc6a('0x41')]['ids'][_0x3c2b86]),'UserId':Number(_0x42cf50[_0xcc6a('0x5e')]['id'])});}}else{socket[_0xcc6a('0xaf')](_0xcc6a('0x13b'),{'SmsInteractionId':Number(_0x42cf50['query']['ids']),'UserId':Number(_0x42cf50[_0xcc6a('0x5e')]['id'])});}});}})[_0xcc6a('0x15')](respondWithStatusCode(_0x19c90b,null))[_0xcc6a('0x1f')](handleError(_0x19c90b,null));};exports['addOpenchannelInteractions']=function(_0x549fd9,_0x379f1e){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x549fd9[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x379f1e,null))[_0xcc6a('0x15')](function(_0x109008){if(_0x109008){return _0x109008[_0xcc6a('0x13c')](_0x549fd9['body'][_0xcc6a('0x61')],_[_0xcc6a('0x111')](_0x549fd9[_0xcc6a('0x5d')],[_0xcc6a('0x61'),'id'])||{})['spread'](function(){for(var _0x29180e=0x0;_0x29180e<_0x549fd9[_0xcc6a('0x5d')][_0xcc6a('0x61')]['length'];_0x29180e+=0x1){socket[_0xcc6a('0xaf')](_0xcc6a('0x13d'),{'OpenchannelInteractionId':Number(_0x549fd9[_0xcc6a('0x5d')][_0xcc6a('0x61')][_0x29180e]),'UserId':Number(_0x549fd9['params']['id'])});}return _0x549fd9[_0xcc6a('0x5d')]['ids'];});}})[_0xcc6a('0x15')](respondWithResult(_0x379f1e,null))['catch'](handleError(_0x379f1e,null));};exports[_0xcc6a('0x13e')]=function(_0x52bbc3,_0xa2bd0a){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x52bbc3[_0xcc6a('0x5e')]['id']}})['then'](handleEntityNotFound(_0xa2bd0a,null))[_0xcc6a('0x15')](function(_0x7ad6a5){if(_0x7ad6a5){return _0x7ad6a5['removeOpenchannelInteractions'](_0x52bbc3['query']['ids'])[_0xcc6a('0x15')](function(){if(_[_0xcc6a('0xad')](_0x52bbc3[_0xcc6a('0x41')][_0xcc6a('0x61')])){for(var _0x104f50=0x0;_0x104f50<_0x52bbc3[_0xcc6a('0x41')][_0xcc6a('0x61')]['length'];_0x104f50+=0x1){socket[_0xcc6a('0xaf')](_0xcc6a('0x13f'),{'OpenchannelInteractionId':Number(_0x52bbc3['query'][_0xcc6a('0x61')][_0x104f50]),'UserId':Number(_0x52bbc3[_0xcc6a('0x5e')]['id'])});}}else{socket['emit'](_0xcc6a('0x13f'),{'OpenchannelInteractionId':Number(_0x52bbc3[_0xcc6a('0x41')]['ids']),'UserId':Number(_0x52bbc3[_0xcc6a('0x5e')]['id'])});}});}})[_0xcc6a('0x15')](respondWithStatusCode(_0xa2bd0a,null))[_0xcc6a('0x1f')](handleError(_0xa2bd0a,null));};exports[_0xcc6a('0x140')]=function(_0x5319df,_0x10ecb8){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x5319df[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x10ecb8,null))['then'](function(_0x5100d3){if(_0x5100d3){return _0x5100d3[_0xcc6a('0x140')](_0x5319df[_0xcc6a('0x5d')][_0xcc6a('0x61')],_['omit'](_0x5319df['body'],[_0xcc6a('0x61'),'id'])||{})['spread'](function(){for(var _0x2c57a6=0x0;_0x2c57a6<_0x5319df[_0xcc6a('0x5d')]['ids'][_0xcc6a('0x4a')];_0x2c57a6+=0x1){socket[_0xcc6a('0xaf')](_0xcc6a('0x141'),{'WhatsappInteractionId':Number(_0x5319df[_0xcc6a('0x5d')][_0xcc6a('0x61')][_0x2c57a6]),'UserId':Number(_0x5319df[_0xcc6a('0x5e')]['id'])});}return _0x5319df[_0xcc6a('0x5d')][_0xcc6a('0x61')];});}})['then'](respondWithResult(_0x10ecb8,null))[_0xcc6a('0x1f')](handleError(_0x10ecb8,null));};exports[_0xcc6a('0x142')]=function(_0xb65b5a,_0x249ffa){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0xb65b5a['params']['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x249ffa,null))[_0xcc6a('0x15')](function(_0x4bffba){if(_0x4bffba){return _0x4bffba[_0xcc6a('0x142')](_0xb65b5a['query']['ids']);}})[_0xcc6a('0x15')](respondWithStatusCode(_0x249ffa,null))['catch'](handleError(_0x249ffa,null));};exports[_0xcc6a('0x143')]=function(_0x114969,_0x170004){var _0x551584={};var _0x1c1262={};var _0x4cb93d;var _0x35b109;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x114969[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x170004,null))[_0xcc6a('0x15')](function(_0x53698a){if(_0x53698a){_0x4cb93d=_0x53698a;_0x1c1262[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db[_0xcc6a('0x144')]['rawAttributes']);_0x1c1262[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x114969[_0xcc6a('0x41')]);_0x1c1262[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x1c1262[_0xcc6a('0x53')],_0x1c1262[_0xcc6a('0x41')]);_0x551584[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x1c1262[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x114969[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x551584[_0xcc6a('0x44')]=_0x551584['attributes'][_0xcc6a('0x4a')]?_0x551584['attributes']:_0x1c1262['model'];_0x551584[_0xcc6a('0xca')]=qs['sort'](_0x114969['query'][_0xcc6a('0xcb')]);_0x551584['where']=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x114969[_0xcc6a('0x41')],_0x1c1262['filters']));if(_0x114969['query'][_0xcc6a('0xce')]){_0x551584['where']=_[_0xcc6a('0x59')](_0x551584[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x551584[_0xcc6a('0x44')],function(_0x5705d1){var _0x4a1c89={};_0x4a1c89[_0x5705d1]={'$like':'%'+_0x114969[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'};return _0x4a1c89;})});}_0x551584=_[_0xcc6a('0x59')]({},_0x551584,_0x114969[_0xcc6a('0x5a')]);return _0x4cb93d[_0xcc6a('0x143')](_0x551584);}})[_0xcc6a('0x15')](function(_0x19362d){if(_0x19362d){_0x35b109=_0x19362d['length'];if(!_0x114969[_0xcc6a('0x41')][_0xcc6a('0xcf')]('nolimit')){_0x551584[_0xcc6a('0x26')]=qs['limit'](_0x114969[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x551584[_0xcc6a('0x24')]=qs[_0xcc6a('0x24')](_0x114969['query'][_0xcc6a('0x24')]);}return _0x4cb93d['getVoicePrefixes'](_0x551584);}})['then'](function(_0x297556){if(_0x297556){return _0x297556?{'count':_0x35b109,'rows':_0x297556}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x170004,null))[_0xcc6a('0x1f')](handleError(_0x170004,null));};exports[_0xcc6a('0x145')]=function(_0x51519b,_0x54dc36){var _0x4df411={};var _0xe6be36={};var _0x3f7b51;var _0xeca7f;return db['User'][_0xcc6a('0xc9')]({'where':{'id':_0x51519b[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x54dc36,null))[_0xcc6a('0x15')](function(_0x25ebd5){if(_0x25ebd5){_0x3f7b51=_0x25ebd5;_0xe6be36[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db['FaxAccount']['rawAttributes']);_0xe6be36[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x51519b[_0xcc6a('0x41')]);_0xe6be36['filters']=_[_0xcc6a('0x57')](_0xe6be36['model'],_0xe6be36[_0xcc6a('0x41')]);_0x4df411[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0xe6be36[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x51519b['query']['fields']));_0x4df411['attributes']=_0x4df411[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x4df411[_0xcc6a('0x44')]:_0xe6be36[_0xcc6a('0x53')];_0x4df411[_0xcc6a('0xca')]=qs['sort'](_0x51519b[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x4df411[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_['pick'](_0x51519b['query'],_0xe6be36[_0xcc6a('0x56')]));if(_0x51519b[_0xcc6a('0x41')]['filter']){_0x4df411[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x4df411[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x4df411[_0xcc6a('0x44')],function(_0x539a92){var _0x1885a8={};_0x1885a8[_0x539a92]={'$like':'%'+_0x51519b['query'][_0xcc6a('0xce')]+'%'};return _0x1885a8;})});}_0x4df411=_[_0xcc6a('0x59')]({},_0x4df411,_0x51519b[_0xcc6a('0x5a')]);return _0x3f7b51['getFaxAccounts'](_0x4df411);}})[_0xcc6a('0x15')](function(_0x106c89){if(_0x106c89){_0xeca7f=_0x106c89[_0xcc6a('0x4a')];if(!_0x51519b[_0xcc6a('0x41')]['hasOwnProperty']('nolimit')){_0x4df411[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x51519b['query'][_0xcc6a('0x26')]);_0x4df411[_0xcc6a('0x24')]=qs[_0xcc6a('0x24')](_0x51519b[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x3f7b51['getFaxAccounts'](_0x4df411);}})[_0xcc6a('0x15')](function(_0x27e454){if(_0x27e454){return _0x27e454?{'count':_0xeca7f,'rows':_0x27e454}:null;}})['then'](respondWithResult(_0x54dc36,null))[_0xcc6a('0x1f')](handleError(_0x54dc36,null));};exports[_0xcc6a('0x146')]=function(_0x1ad141,_0x3e957b){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x1ad141[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x3e957b,null))[_0xcc6a('0x15')](function(_0x20cbdd){if(_0x20cbdd){return _0x20cbdd[_0xcc6a('0x146')](_0x1ad141[_0xcc6a('0x5d')][_0xcc6a('0x61')],_[_0xcc6a('0x111')](_0x1ad141['body'],[_0xcc6a('0x61'),'id'])||{});}})['then'](respondWithResult(_0x3e957b,null))[_0xcc6a('0x1f')](handleError(_0x3e957b,null));};exports['removeFaxAccounts']=function(_0x1bd555,_0xc7636b){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x1bd555[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0xc7636b,null))[_0xcc6a('0x15')](function(_0x19a591){if(_0x19a591){return _0x19a591[_0xcc6a('0x147')](_0x1bd555[_0xcc6a('0x41')][_0xcc6a('0x61')]);}})[_0xcc6a('0x15')](respondWithStatusCode(_0xc7636b,null))[_0xcc6a('0x1f')](handleError(_0xc7636b,null));};exports[_0xcc6a('0x148')]=function(_0x119951,_0x2e1c00){var _0x8a2678={};var _0x31dae5={};var _0x5bc11b;var _0x2d883a;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x119951[_0xcc6a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2e1c00,null))[_0xcc6a('0x15')](function(_0x194738){if(_0x194738){_0x5bc11b=_0x194738;_0x31dae5[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db['MailAccount']['rawAttributes']);_0x31dae5['query']=_[_0xcc6a('0x55')](_0x119951[_0xcc6a('0x41')]);_0x31dae5[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x31dae5[_0xcc6a('0x53')],_0x31dae5['query']);_0x8a2678[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x31dae5[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x119951['query']['fields']));_0x8a2678[_0xcc6a('0x44')]=_0x8a2678[_0xcc6a('0x44')][_0xcc6a('0x4a')]?_0x8a2678[_0xcc6a('0x44')]:_0x31dae5[_0xcc6a('0x53')];_0x8a2678[_0xcc6a('0xca')]=qs['sort'](_0x119951[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x8a2678[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_['pick'](_0x119951['query'],_0x31dae5['filters']));if(_0x119951['query']['filter']){_0x8a2678[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x8a2678['where'],{'$or':_[_0xcc6a('0x33')](_0x8a2678[_0xcc6a('0x44')],function(_0x2f5bdd){var _0x471302={};_0x471302[_0x2f5bdd]={'$like':'%'+_0x119951['query'][_0xcc6a('0xce')]+'%'};return _0x471302;})});}_0x8a2678=_[_0xcc6a('0x59')]({},_0x8a2678,_0x119951[_0xcc6a('0x5a')]);return _0x5bc11b[_0xcc6a('0x148')](_0x8a2678);}})[_0xcc6a('0x15')](function(_0x211f82){if(_0x211f82){_0x2d883a=_0x211f82[_0xcc6a('0x4a')];if(!_0x119951[_0xcc6a('0x41')]['hasOwnProperty'](_0xcc6a('0xd4'))){_0x8a2678[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x119951['query']['limit']);_0x8a2678['offset']=qs['offset'](_0x119951[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x5bc11b['getMailAccounts'](_0x8a2678);}})['then'](function(_0x5353f2){if(_0x5353f2){return _0x5353f2?{'count':_0x2d883a,'rows':_0x5353f2}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x2e1c00,null))[_0xcc6a('0x1f')](handleError(_0x2e1c00,null));};exports[_0xcc6a('0x149')]=function(_0x11a4fe,_0x493822){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x11a4fe['params']['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x493822,null))[_0xcc6a('0x15')](function(_0x256ed4){if(_0x256ed4){return _0x256ed4[_0xcc6a('0x149')](_0x11a4fe['body']['ids'],_[_0xcc6a('0x111')](_0x11a4fe[_0xcc6a('0x5d')],['ids','id'])||{});}})['then'](respondWithResult(_0x493822,null))[_0xcc6a('0x1f')](handleError(_0x493822,null));};exports[_0xcc6a('0x14a')]=function(_0x2b02dd,_0x58e0f6){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x2b02dd['params']['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x58e0f6,null))[_0xcc6a('0x15')](function(_0x5f303a){if(_0x5f303a){return _0x5f303a['removeMailAccounts'](_0x2b02dd[_0xcc6a('0x41')][_0xcc6a('0x61')]);}})[_0xcc6a('0x15')](respondWithStatusCode(_0x58e0f6,null))[_0xcc6a('0x1f')](handleError(_0x58e0f6,null));};exports['getOpenchannelAccounts']=function(_0x2ae924,_0x349973){var _0x41efa3={};var _0x3d3e7f={};var _0x25d715;var _0x4d9e65;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x2ae924[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x349973,null))['then'](function(_0x4bdf7c){if(_0x4bdf7c){_0x25d715=_0x4bdf7c;_0x3d3e7f['model']=_[_0xcc6a('0x55')](db[_0xcc6a('0x14b')][_0xcc6a('0x3b')]);_0x3d3e7f[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x2ae924[_0xcc6a('0x41')]);_0x3d3e7f[_0xcc6a('0x56')]=_['intersection'](_0x3d3e7f[_0xcc6a('0x53')],_0x3d3e7f[_0xcc6a('0x41')]);_0x41efa3[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x3d3e7f[_0xcc6a('0x53')],qs['fields'](_0x2ae924[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x41efa3[_0xcc6a('0x44')]=_0x41efa3[_0xcc6a('0x44')]['length']?_0x41efa3[_0xcc6a('0x44')]:_0x3d3e7f[_0xcc6a('0x53')];_0x41efa3['order']=qs[_0xcc6a('0xcb')](_0x2ae924[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x41efa3['where']=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x2ae924[_0xcc6a('0x41')],_0x3d3e7f[_0xcc6a('0x56')]));if(_0x2ae924[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x41efa3['where']=_[_0xcc6a('0x59')](_0x41efa3[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x41efa3[_0xcc6a('0x44')],function(_0x351e59){var _0x9b6220={};_0x9b6220[_0x351e59]={'$like':'%'+_0x2ae924['query'][_0xcc6a('0xce')]+'%'};return _0x9b6220;})});}_0x41efa3=_['merge']({},_0x41efa3,_0x2ae924['options']);return _0x25d715[_0xcc6a('0x14c')](_0x41efa3);}})[_0xcc6a('0x15')](function(_0x494cd6){if(_0x494cd6){_0x4d9e65=_0x494cd6[_0xcc6a('0x4a')];if(!_0x2ae924['query'][_0xcc6a('0xcf')]('nolimit')){_0x41efa3[_0xcc6a('0x26')]=qs['limit'](_0x2ae924[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x41efa3[_0xcc6a('0x24')]=qs['offset'](_0x2ae924[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x25d715[_0xcc6a('0x14c')](_0x41efa3);}})[_0xcc6a('0x15')](function(_0x2fe97f){if(_0x2fe97f){return _0x2fe97f?{'count':_0x4d9e65,'rows':_0x2fe97f}:null;}})['then'](respondWithResult(_0x349973,null))[_0xcc6a('0x1f')](handleError(_0x349973,null));};exports[_0xcc6a('0x14d')]=function(_0x48cc70,_0x2b433a){return db['User']['find']({'where':{'id':_0x48cc70[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x2b433a,null))[_0xcc6a('0x15')](function(_0x58b1a2){if(_0x58b1a2){return _0x58b1a2[_0xcc6a('0x14d')](_0x48cc70[_0xcc6a('0x5d')][_0xcc6a('0x61')],_[_0xcc6a('0x111')](_0x48cc70[_0xcc6a('0x5d')],['ids','id'])||{});}})[_0xcc6a('0x15')](respondWithResult(_0x2b433a,null))[_0xcc6a('0x1f')](handleError(_0x2b433a,null));};exports[_0xcc6a('0x14e')]=function(_0x174e7a,_0x3ca233){return db[_0xcc6a('0x3a')]['find']({'where':{'id':_0x174e7a[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x3ca233,null))[_0xcc6a('0x15')](function(_0x4a9ddf){if(_0x4a9ddf){return _0x4a9ddf[_0xcc6a('0x14e')](_0x174e7a[_0xcc6a('0x41')][_0xcc6a('0x61')]);}})[_0xcc6a('0x15')](respondWithStatusCode(_0x3ca233,null))[_0xcc6a('0x1f')](handleError(_0x3ca233,null));};exports[_0xcc6a('0x14f')]=function(_0x32b932,_0x18c798){var _0x1f8dec={};var _0x291efe={};var _0x17f23a;var _0x3682f8;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x32b932[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x18c798,null))[_0xcc6a('0x15')](function(_0xfd2bbe){if(_0xfd2bbe){_0x17f23a=_0xfd2bbe;_0x291efe[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db[_0xcc6a('0x150')]['rawAttributes']);_0x291efe[_0xcc6a('0x41')]=_['keys'](_0x32b932[_0xcc6a('0x41')]);_0x291efe[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x291efe[_0xcc6a('0x53')],_0x291efe[_0xcc6a('0x41')]);_0x1f8dec[_0xcc6a('0x44')]=_['intersection'](_0x291efe[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x32b932[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x1f8dec[_0xcc6a('0x44')]=_0x1f8dec['attributes'][_0xcc6a('0x4a')]?_0x1f8dec[_0xcc6a('0x44')]:_0x291efe[_0xcc6a('0x53')];_0x1f8dec[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x32b932['query'][_0xcc6a('0xcb')]);_0x1f8dec[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x32b932[_0xcc6a('0x41')],_0x291efe[_0xcc6a('0x56')]));if(_0x32b932[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x1f8dec['where']=_[_0xcc6a('0x59')](_0x1f8dec['where'],{'$or':_[_0xcc6a('0x33')](_0x1f8dec[_0xcc6a('0x44')],function(_0x5510ca){var _0x1c1f2a={};_0x1c1f2a[_0x5510ca]={'$like':'%'+_0x32b932[_0xcc6a('0x41')]['filter']+'%'};return _0x1c1f2a;})});}_0x1f8dec=_[_0xcc6a('0x59')]({},_0x1f8dec,_0x32b932[_0xcc6a('0x5a')]);return _0x17f23a[_0xcc6a('0x14f')](_0x1f8dec);}})[_0xcc6a('0x15')](function(_0x38ef64){if(_0x38ef64){_0x3682f8=_0x38ef64[_0xcc6a('0x4a')];if(!_0x32b932['query'][_0xcc6a('0xcf')]('nolimit')){_0x1f8dec['limit']=qs[_0xcc6a('0x26')](_0x32b932[_0xcc6a('0x41')]['limit']);_0x1f8dec[_0xcc6a('0x24')]=qs['offset'](_0x32b932[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x17f23a[_0xcc6a('0x14f')](_0x1f8dec);}})['then'](function(_0xa05277){if(_0xa05277){return _0xa05277?{'count':_0x3682f8,'rows':_0xa05277}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x18c798,null))[_0xcc6a('0x1f')](handleError(_0x18c798,null));};exports['addSmsAccounts']=function(_0x3c9244,_0x5835ce){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x3c9244[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x5835ce,null))[_0xcc6a('0x15')](function(_0xc9992f){if(_0xc9992f){return _0xc9992f[_0xcc6a('0x151')](_0x3c9244[_0xcc6a('0x5d')][_0xcc6a('0x61')],_['omit'](_0x3c9244[_0xcc6a('0x5d')],['ids','id'])||{});}})[_0xcc6a('0x15')](respondWithResult(_0x5835ce,null))[_0xcc6a('0x1f')](handleError(_0x5835ce,null));};exports[_0xcc6a('0x152')]=function(_0x425b5e,_0x4d0b52){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x425b5e[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x4d0b52,null))[_0xcc6a('0x15')](function(_0x2207e9){if(_0x2207e9){return _0x2207e9[_0xcc6a('0x152')](_0x425b5e[_0xcc6a('0x41')][_0xcc6a('0x61')]);}})[_0xcc6a('0x15')](respondWithStatusCode(_0x4d0b52,null))['catch'](handleError(_0x4d0b52,null));};exports[_0xcc6a('0x153')]=function(_0x2b727d,_0x2f0702){var _0x487dd0={};var _0x585280={};var _0x3768f8;var _0x2a4167;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x2b727d[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x2f0702,null))[_0xcc6a('0x15')](function(_0x5d02bc){if(_0x5d02bc){_0x3768f8=_0x5d02bc;_0x585280['model']=_['keys'](db['ChatWebsite'][_0xcc6a('0x3b')]);_0x585280[_0xcc6a('0x41')]=_['keys'](_0x2b727d[_0xcc6a('0x41')]);_0x585280[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x585280['model'],_0x585280['query']);_0x487dd0[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x585280['model'],qs['fields'](_0x2b727d[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x487dd0[_0xcc6a('0x44')]=_0x487dd0['attributes'][_0xcc6a('0x4a')]?_0x487dd0[_0xcc6a('0x44')]:_0x585280[_0xcc6a('0x53')];_0x487dd0[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x2b727d['query']['sort']);_0x487dd0[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x2b727d[_0xcc6a('0x41')],_0x585280['filters']));if(_0x2b727d[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x487dd0[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x487dd0[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x487dd0['attributes'],function(_0x4ec4bf){var _0x39f5bb={};_0x39f5bb[_0x4ec4bf]={'$like':'%'+_0x2b727d[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'};return _0x39f5bb;})});}_0x487dd0=_[_0xcc6a('0x59')]({},_0x487dd0,_0x2b727d[_0xcc6a('0x5a')]);return _0x3768f8[_0xcc6a('0x153')](_0x487dd0);}})['then'](function(_0x2abc4a){if(_0x2abc4a){_0x2a4167=_0x2abc4a[_0xcc6a('0x4a')];if(!_0x2b727d[_0xcc6a('0x41')][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0x487dd0[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x2b727d['query'][_0xcc6a('0x26')]);_0x487dd0[_0xcc6a('0x24')]=qs['offset'](_0x2b727d[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x3768f8[_0xcc6a('0x153')](_0x487dd0);}})[_0xcc6a('0x15')](function(_0x439a92){if(_0x439a92){return _0x439a92?{'count':_0x2a4167,'rows':_0x439a92}:null;}})['then'](respondWithResult(_0x2f0702,null))[_0xcc6a('0x1f')](handleError(_0x2f0702,null));};exports['addChatWebsites']=function(_0x30fab9,_0x114ccb){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x30fab9[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x114ccb,null))[_0xcc6a('0x15')](function(_0x2112ca){if(_0x2112ca){return _0x2112ca[_0xcc6a('0x154')](_0x30fab9[_0xcc6a('0x5d')][_0xcc6a('0x61')],_['omit'](_0x30fab9[_0xcc6a('0x5d')],['ids','id'])||{});}})['then'](respondWithResult(_0x114ccb,null))[_0xcc6a('0x1f')](handleError(_0x114ccb,null));};exports[_0xcc6a('0x155')]=function(_0x542b0d,_0x2c9b70){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x542b0d['params']['id']}})['then'](handleEntityNotFound(_0x2c9b70,null))[_0xcc6a('0x15')](function(_0x4c9929){if(_0x4c9929){return _0x4c9929['removeChatWebsites'](_0x542b0d[_0xcc6a('0x41')]['ids']);}})[_0xcc6a('0x15')](respondWithStatusCode(_0x2c9b70,null))['catch'](handleError(_0x2c9b70,null));};exports[_0xcc6a('0x156')]=function(_0x5e2683,_0x24ae2a){var _0x14148d={};var _0x30ca49={};var _0x1e597d;var _0x2f7e92;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x5e2683[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x24ae2a,null))[_0xcc6a('0x15')](function(_0x21395b){if(_0x21395b){_0x1e597d=_0x21395b;_0x30ca49['model']=_[_0xcc6a('0x55')](db[_0xcc6a('0x157')][_0xcc6a('0x3b')]);_0x30ca49[_0xcc6a('0x41')]=_['keys'](_0x5e2683[_0xcc6a('0x41')]);_0x30ca49[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x30ca49[_0xcc6a('0x53')],_0x30ca49[_0xcc6a('0x41')]);_0x14148d[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x30ca49[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x5e2683[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x14148d['attributes']=_0x14148d['attributes']['length']?_0x14148d[_0xcc6a('0x44')]:_0x30ca49[_0xcc6a('0x53')];_0x14148d[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x5e2683[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x14148d[_0xcc6a('0xcc')]=qs[_0xcc6a('0x56')](_['pick'](_0x5e2683['query'],_0x30ca49[_0xcc6a('0x56')]));if(_0x5e2683[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x14148d[_0xcc6a('0xcc')]=_['merge'](_0x14148d['where'],{'$or':_['map'](_0x14148d[_0xcc6a('0x44')],function(_0x559eb7){var _0xe771ca={};_0xe771ca[_0x559eb7]={'$like':'%'+_0x5e2683['query'][_0xcc6a('0xce')]+'%'};return _0xe771ca;})});}_0x14148d=_[_0xcc6a('0x59')]({},_0x14148d,_0x5e2683[_0xcc6a('0x5a')]);return _0x1e597d[_0xcc6a('0x156')](_0x14148d);}})[_0xcc6a('0x15')](function(_0x383236){if(_0x383236){_0x2f7e92=_0x383236[_0xcc6a('0x4a')];if(!_0x5e2683[_0xcc6a('0x41')][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0x14148d['limit']=qs[_0xcc6a('0x26')](_0x5e2683['query'][_0xcc6a('0x26')]);_0x14148d['offset']=qs['offset'](_0x5e2683[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x1e597d[_0xcc6a('0x156')](_0x14148d);}})[_0xcc6a('0x15')](function(_0x327304){if(_0x327304){return _0x327304?{'count':_0x2f7e92,'rows':_0x327304}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x24ae2a,null))[_0xcc6a('0x1f')](handleError(_0x24ae2a,null));};exports[_0xcc6a('0x158')]=function(_0x5c843e,_0xfda99a){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x5c843e['params']['id']}})['then'](handleEntityNotFound(_0xfda99a,null))['then'](function(_0x51b005){if(_0x51b005){return _0x51b005[_0xcc6a('0x158')](_0x5c843e[_0xcc6a('0x5d')][_0xcc6a('0x61')],_[_0xcc6a('0x111')](_0x5c843e['body'],[_0xcc6a('0x61'),'id'])||{});}})['then'](respondWithResult(_0xfda99a,null))[_0xcc6a('0x1f')](handleError(_0xfda99a,null));};exports[_0xcc6a('0x159')]=function(_0xb21631,_0xbd71a){return db['User']['find']({'where':{'id':_0xb21631[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0xbd71a,null))[_0xcc6a('0x15')](function(_0x357064){if(_0x357064){return _0x357064['removeWhatsappAccounts'](_0xb21631[_0xcc6a('0x41')]['ids']);}})[_0xcc6a('0x15')](respondWithStatusCode(_0xbd71a,null))['catch'](handleError(_0xbd71a,null));};exports[_0xcc6a('0x15a')]=function(_0x11fb94,_0x4821d3){var _0x3d5a45={};var _0x18abe5={};var _0x3f84f4;var _0x156320;return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x11fb94[_0xcc6a('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4821d3,null))['then'](function(_0x488c74){if(_0x488c74){_0x3f84f4=_0x488c74;_0x18abe5[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](db[_0xcc6a('0x15b')]['rawAttributes']);_0x18abe5[_0xcc6a('0x41')]=_[_0xcc6a('0x55')](_0x11fb94[_0xcc6a('0x41')]);_0x18abe5[_0xcc6a('0x56')]=_['intersection'](_0x18abe5[_0xcc6a('0x53')],_0x18abe5['query']);_0x3d5a45['attributes']=_['intersection'](_0x18abe5[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x11fb94[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x3d5a45[_0xcc6a('0x44')]=_0x3d5a45[_0xcc6a('0x44')]['length']?_0x3d5a45['attributes']:_0x18abe5['model'];_0x3d5a45[_0xcc6a('0xca')]=qs['sort'](_0x11fb94[_0xcc6a('0x41')][_0xcc6a('0xcb')]);_0x3d5a45['where']=qs[_0xcc6a('0x56')](_['pick'](_0x11fb94['query'],_0x18abe5['filters']));if(_0x11fb94[_0xcc6a('0x41')][_0xcc6a('0xce')]){_0x3d5a45[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x3d5a45[_0xcc6a('0xcc')],{'$or':_['map'](_0x3d5a45[_0xcc6a('0x44')],function(_0x5638db){var _0x551762={};_0x551762[_0x5638db]={'$like':'%'+_0x11fb94[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'};return _0x551762;})});}_0x3d5a45=_['merge']({},_0x3d5a45,_0x11fb94['options']);return _0x3f84f4[_0xcc6a('0x15a')](_0x3d5a45);}})[_0xcc6a('0x15')](function(_0x19d2d9){if(_0x19d2d9){_0x156320=_0x19d2d9[_0xcc6a('0x4a')];if(!_0x11fb94['query'][_0xcc6a('0xcf')]('nolimit')){_0x3d5a45[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x11fb94[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x3d5a45[_0xcc6a('0x24')]=qs['offset'](_0x11fb94[_0xcc6a('0x41')][_0xcc6a('0x24')]);}return _0x3f84f4[_0xcc6a('0x15a')](_0x3d5a45);}})[_0xcc6a('0x15')](function(_0x140826){if(_0x140826){return _0x140826?{'count':_0x156320,'rows':_0x140826}:null;}})[_0xcc6a('0x15')](respondWithResult(_0x4821d3,null))[_0xcc6a('0x1f')](handleError(_0x4821d3,null));};exports[_0xcc6a('0x15c')]=function(_0x545836,_0x596d06){return db['User'][_0xcc6a('0x5b')]({'where':{'id':_0x545836[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x596d06,null))[_0xcc6a('0x15')](function(_0x36eb4a){if(_0x36eb4a){return _0x36eb4a[_0xcc6a('0x15c')](_0x545836[_0xcc6a('0x5d')][_0xcc6a('0x61')],_[_0xcc6a('0x111')](_0x545836[_0xcc6a('0x5d')],[_0xcc6a('0x61'),'id'])||{});}})[_0xcc6a('0x15')](respondWithResult(_0x596d06,null))['catch'](handleError(_0x596d06,null));};exports[_0xcc6a('0x15d')]=function(_0x59ec40,_0x56741a){return db['User'][_0xcc6a('0x5b')]({'where':{'id':_0x59ec40[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x56741a,null))[_0xcc6a('0x15')](function(_0xdbfca6){if(_0xdbfca6){return _0xdbfca6[_0xcc6a('0x15d')](_0x59ec40[_0xcc6a('0x41')][_0xcc6a('0x61')]);}})['then'](respondWithStatusCode(_0x56741a,null))['catch'](handleError(_0x56741a,null));};exports[_0xcc6a('0x15e')]=function(_0x23fce7,_0x3c5f45){var _0x3f8621={},_0x17eaf2={},_0x1b9750={'count':0x0,'rows':[]};var _0x3a799c=db[_0xcc6a('0x15f')][_0xcc6a('0x3b')];_0x17eaf2[_0xcc6a('0x53')]=_[_0xcc6a('0x55')](_0x3a799c);_0x17eaf2['query']=_[_0xcc6a('0x55')](_0x23fce7[_0xcc6a('0x41')]);_0x17eaf2[_0xcc6a('0x56')]=_[_0xcc6a('0x57')](_0x17eaf2['model'],_0x17eaf2[_0xcc6a('0x41')]);_0x17eaf2[_0xcc6a('0x56')]=_[_0xcc6a('0x100')](_0x17eaf2['filters'],[_0xcc6a('0x160'),_0xcc6a('0x161'),_0xcc6a('0x162'),_0xcc6a('0x163'),_0xcc6a('0x164'),_0xcc6a('0x165'),'$ne',_0xcc6a('0x166'),_0xcc6a('0x167'),'$between',_0xcc6a('0x168'),_0xcc6a('0x169'),_0xcc6a('0x16a'),_0xcc6a('0x16b'),'$notLike',_0xcc6a('0x16c'),'$notILike','$like','$overlap',_0xcc6a('0x16d'),_0xcc6a('0x16e'),_0xcc6a('0x16f')]);_0x3f8621[_0xcc6a('0x44')]=_[_0xcc6a('0x57')](_0x17eaf2[_0xcc6a('0x53')],qs[_0xcc6a('0x58')](_0x23fce7[_0xcc6a('0x41')][_0xcc6a('0x58')]));_0x3f8621[_0xcc6a('0x44')]=_0x3f8621['attributes'][_0xcc6a('0x4a')]?_0x3f8621[_0xcc6a('0x44')]:_0x17eaf2[_0xcc6a('0x53')];if(!_0x23fce7[_0xcc6a('0x41')][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0x3f8621[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x23fce7[_0xcc6a('0x41')][_0xcc6a('0x26')]);_0x3f8621[_0xcc6a('0x24')]=qs['offset'](_0x23fce7[_0xcc6a('0x41')][_0xcc6a('0x24')]);}_0x3f8621[_0xcc6a('0xca')]=qs[_0xcc6a('0xcb')](_0x23fce7['query'][_0xcc6a('0xcb')]);_0x3f8621['where']=qs[_0xcc6a('0x56')](_[_0xcc6a('0xcd')](_0x23fce7[_0xcc6a('0x41')],_0x17eaf2['filters']));if(_0x23fce7['query']['filter']){_0x3f8621[_0xcc6a('0xcc')]=_[_0xcc6a('0x59')](_0x3f8621[_0xcc6a('0xcc')],{'$or':_[_0xcc6a('0x33')](_0x3f8621[_0xcc6a('0x44')],function(_0x3fd30a){var _0x1b69e7={};_0x1b69e7[_0x3fd30a]={'$like':'%'+_0x23fce7[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'};return _0x1b69e7;})});}_0x3f8621[_0xcc6a('0xcc')]={'$and':[_0x3f8621['where'],{'$or':[{'UserId':_0x23fce7[_0xcc6a('0x5e')]['id']},{'OwnerId':_0x23fce7[_0xcc6a('0x5e')]['id']}]}]};_0x3f8621=_[_0xcc6a('0x59')]({},_0x3f8621,_0x23fce7[_0xcc6a('0x5a')]);var _0xa0e1a0={'where':_0x3f8621[_0xcc6a('0xcc')]};return db['CmHopper'][_0xcc6a('0x27')](_0xa0e1a0)[_0xcc6a('0x15')](function(_0x5c2652){_0x1b9750['count']=_0x5c2652;if(_0x23fce7[_0xcc6a('0x41')]['includeAll']){_0x3f8621['include']=[{'attributes':['id',_0xcc6a('0x170'),_0xcc6a('0x171'),_0xcc6a('0xeb')],'model':db[_0xcc6a('0x172')],'as':_0xcc6a('0x173')},{'attributes':['id','name',_0xcc6a('0x174')],'model':db[_0xcc6a('0xa5')],'as':_0xcc6a('0xd6')}];}return db[_0xcc6a('0x15f')][_0xcc6a('0x46')](_0x3f8621);})[_0xcc6a('0x15')](function(_0x2f9927){_0x1b9750[_0xcc6a('0x47')]=_0x2f9927;return _0x1b9750;})[_0xcc6a('0x15')](respondWithFilteredResult(_0x3c5f45,_0x3f8621))[_0xcc6a('0x1f')](handleError(_0x3c5f45,null));};exports['getApiKey']=function(_0x216df8,_0x53c3a3){if(!_[_0xcc6a('0x67')](_0x216df8[_0xcc6a('0x2d')]['id'])&&(_0x216df8[_0xcc6a('0x2d')][_0xcc6a('0x2b')]==_0xcc6a('0x7c')||_0x216df8[_0xcc6a('0x2d')][_0xcc6a('0x2b')]=='user')){return db[_0xcc6a('0x3a')][_0xcc6a('0xc9')]({'where':{'id':_0x216df8[_0xcc6a('0x5e')]['id']},'raw':!![]})[_0xcc6a('0x15')](function(_0x4b68ee){return authService[_0xcc6a('0x175')](_0x4b68ee);})['then'](function(_0x463e93){if(_0x463e93){return _0x53c3a3[_0xcc6a('0x21')](0xc8)[_0xcc6a('0x23')]({'api_key':_0x463e93[_0xcc6a('0x176')]});}else{return _0x53c3a3[_0xcc6a('0x21')](0xcc)[_0xcc6a('0x23')]({'message':'No\x20API\x20access\x20key\x20found!'});}})[_0xcc6a('0x1f')](handleError(_0x53c3a3,0x193));}else{return _0x53c3a3[_0xcc6a('0x21')](0x191)[_0xcc6a('0x23')]({'message':_0xcc6a('0x177')});}};exports[_0xcc6a('0x178')]=function(_0x5e97ec,_0x33f778){if(!_['isNil'](_0x5e97ec['user']['id'])&&(_0x5e97ec['user'][_0xcc6a('0x2b')]==_0xcc6a('0x7c')||_0x5e97ec[_0xcc6a('0x2d')][_0xcc6a('0x2b')]==_0xcc6a('0x2d'))){return db[_0xcc6a('0x3a')][_0xcc6a('0x5b')]({'where':{'id':_0x5e97ec['params']['id']}})[_0xcc6a('0x15')](function(_0x1965e4){return authService['generateApiKey'](_0x1965e4);})['then'](function(_0x53c7d7){return db[_0xcc6a('0x3a')][_0xcc6a('0x103')]({'apiKeyIat':_0x53c7d7[_0xcc6a('0x179')],'apiKeyNonce':_0x53c7d7[_0xcc6a('0x17a')]},{'where':{'id':_0x5e97ec[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](function(){return _0x33f778['status'](0xc8)[_0xcc6a('0x23')]({'api_key':_0x53c7d7[_0xcc6a('0x176')]});});})[_0xcc6a('0x1f')](handleError(_0x33f778,0x193));}else{return _0x33f778[_0xcc6a('0x21')](0x191)[_0xcc6a('0x23')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports['removeApiKey']=function(_0xc7f5a8,_0x2e88c8){if(!_['isNil'](_0xc7f5a8['user']['id'])&&(_0xc7f5a8[_0xcc6a('0x2d')][_0xcc6a('0x2b')]==_0xcc6a('0x7c')||_0xc7f5a8[_0xcc6a('0x2d')][_0xcc6a('0x2b')]=='user')){return db[_0xcc6a('0x3a')]['find']({'where':{'id':_0xc7f5a8[_0xcc6a('0x5e')]['id']}})[_0xcc6a('0x15')](handleEntityNotFound(_0x2e88c8,null))[_0xcc6a('0x15')](function(_0xb31c97){if(_0xb31c97&&_0xb31c97[_0xcc6a('0x17b')]&&_0xb31c97[_0xcc6a('0x17c')])return _0xb31c97;else throw{'message':'API\x20key\x20not\x20available'};})[_0xcc6a('0x15')](function(_0x94b0e2){return db['User'][_0xcc6a('0x103')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0xc7f5a8[_0xcc6a('0x5e')]['id']}});})[_0xcc6a('0x15')](respondWithStatusCode(_0x2e88c8,0xc8))[_0xcc6a('0x1f')](handleError(_0x2e88c8,0x193));}else{return _0x2e88c8[_0xcc6a('0x21')](0x191)['json']({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xcc6a('0x17d')]=function(_0x1924e7,_0xd201fa){var _0x5b2f28=_0x1924e7[_0xcc6a('0x2d')][_0xcc6a('0x2a')]({'plain':!![]});if(!_0x5b2f28){return _0xd201fa[_0xcc6a('0x21')](0x191)[_0xcc6a('0x38')](_0xcc6a('0x17e'));}else{return _0xd201fa['status'](0xc8)[_0xcc6a('0x23')](_0x5b2f28);}};exports[_0xcc6a('0x17f')]=function(_0x44fee8,_0x265df9){var _0xa28f0e={'offset':0x0},_0x46a6df={'count':0x0,'rows':[]};Promise[_0xcc6a('0x101')]()[_0xcc6a('0x15')](function(){if(!_0x44fee8[_0xcc6a('0x41')][_0xcc6a('0xce')]&&!_0x44fee8['query']['teams']&&!_0x44fee8[_0xcc6a('0x41')]['queues'])return[];return Promise['resolve']()[_0xcc6a('0x15')](function(){var _0x532104=[];if(!_[_0xcc6a('0x8a')](_0x44fee8['query'][_0xcc6a('0x180')])){_0x532104[_0xcc6a('0x45')](db[_0xcc6a('0x10f')][_0xcc6a('0x46')]({'attributes':['id','name'],'where':{'id':_0x44fee8[_0xcc6a('0x41')]['teams']}}));}if(!_[_0xcc6a('0x8a')](_0x44fee8['query'][_0xcc6a('0x181')])){_0x532104['push'](db[_0xcc6a('0xa5')][_0xcc6a('0x46')]({'attributes':['id',_0xcc6a('0x37')],'type':'inbound','where':{'id':_0x44fee8[_0xcc6a('0x41')][_0xcc6a('0x181')]}}));}return Promise[_0xcc6a('0x51')](_0x532104);})[_0xcc6a('0x15')](function(_0x43f7d2){var _0xbe7406=_[_0xcc6a('0x11d')](_0x43f7d2)['map'](function(_0x53b8d5){return _0x53b8d5['getAgents']({'attributes':['id',_0xcc6a('0x37'),'internal',_0xcc6a('0xa7')],'raw':!![]});});return Promise['all'](_0xbe7406);})[_0xcc6a('0x15')](function(_0x158375){var _0x300b69=_['flatten'](_0x158375);if(!_0x44fee8[_0xcc6a('0x41')][_0xcc6a('0xce')])return _0x300b69;if(_[_0xcc6a('0x8a')](_0x300b69)){return db[_0xcc6a('0x3a')][_0xcc6a('0x46')]({'attributes':['id',_0xcc6a('0x37'),_0xcc6a('0x62'),'online'],'where':{'role':_0xcc6a('0x2f'),'$or':[db['sequelize'][_0xcc6a('0xcc')](db[_0xcc6a('0x69')]['fn']('lower',db[_0xcc6a('0x69')][_0xcc6a('0x182')](_0xcc6a('0x37'))),{'$like':'%'+_0x44fee8['query']['filter'][_0xcc6a('0xa0')]()+'%'}),{'internal':{'$like':'%'+_0x44fee8[_0xcc6a('0x41')][_0xcc6a('0xce')]+'%'}}]},'raw':!![]});}else{return _(_0x300b69)['flatten']()[_0xcc6a('0xce')](function(_0x1f5300){return _0x1f5300[_0xcc6a('0x37')][_0xcc6a('0xa0')]()['includes'](_0x44fee8[_0xcc6a('0x41')]['filter']['toLowerCase']())||_0x1f5300[_0xcc6a('0x62')][_0xcc6a('0x183')]()[_0xcc6a('0x35')](_0x44fee8[_0xcc6a('0x41')][_0xcc6a('0xce')]);})['value']();}})['then'](function(_0x52ae4b){var _0x58be89=_0xcc6a('0x37');var _0x4d12fc=_0xcc6a('0x184');if(_0x44fee8[_0xcc6a('0x41')][_0xcc6a('0xcb')]){var _0x4d12fc=_0x44fee8[_0xcc6a('0x41')][_0xcc6a('0xcb')][0x0]==='-'?_0xcc6a('0x185'):'asc';var _0x58be89=_0x4d12fc===_0xcc6a('0x184')?_0x44fee8[_0xcc6a('0x41')][_0xcc6a('0xcb')]:_0x44fee8[_0xcc6a('0x41')]['sort'][_0xcc6a('0x186')](0x1);}return _(_0x52ae4b)[_0xcc6a('0x187')]('id')[_0xcc6a('0x188')]([function(_0x2bec93){return _0x58be89===_0xcc6a('0x37')?_0x2bec93[_0x58be89]['toLowerCase']():_0x2bec93[_0x58be89];}],[_0x4d12fc])[_0xcc6a('0x33')](function(_0x42f8c4){return _['pick'](_0x42f8c4,['id',_0xcc6a('0x37'),_0xcc6a('0x62'),'online']);})[_0xcc6a('0x34')]();})[_0xcc6a('0x15')](function(_0x50054f){return client[_0xcc6a('0x189')](_0xcc6a('0x2e'),_0x44fee8)['then'](function(_0x2d6643){if(_0x2d6643[_0xcc6a('0x1b')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x410302=_0x2d6643[_0xcc6a('0x18a')];var _0x4194f0=jayson['client'][_0xcc6a('0x14')]({'port':0x232c});return _0x4194f0[_0xcc6a('0x189')](_0xcc6a('0x2e'),_0x44fee8)['then'](function(_0x45c8a7){if(_0x45c8a7[_0xcc6a('0x1b')])throw new Error(_0xcc6a('0x18b'));var _0x3efdf8=_0x45c8a7['result'];return _[_0xcc6a('0x59')]({},_0x3efdf8,_0x410302);});})['then'](function(_0x3f931b){return _[_0xcc6a('0x33')](_0x50054f,function(_0x97c7be){var _0x586472=_[_0xcc6a('0x5b')](_0x3f931b[_0xcc6a('0x47')],['id',_0x97c7be['id']]);if(!_0x586472||!_0x97c7be[_0xcc6a('0xa7')]){_0x97c7be[_0xcc6a('0x21')]='offline';}else if(_0x586472[_0xcc6a('0x9b')]){_0x97c7be[_0xcc6a('0x21')]=_0xcc6a('0x104');}else{_0x97c7be[_0xcc6a('0x21')]=_[_0xcc6a('0x35')]([_0xcc6a('0x18c'),_0xcc6a('0x18d'),_0xcc6a('0x18e'),_0xcc6a('0x18f'),null,undefined],_0x586472['voiceStatus'])?_0xcc6a('0xa7'):_0xcc6a('0x190');}return _0x97c7be;});});});})[_0xcc6a('0x15')](function(_0x5d9644){if(!_0x44fee8[_0xcc6a('0x41')][_0xcc6a('0xcf')](_0xcc6a('0xd4'))){_0xa28f0e[_0xcc6a('0x26')]=qs[_0xcc6a('0x26')](_0x44fee8[_0xcc6a('0x41')]['limit']||0xa);_0xa28f0e[_0xcc6a('0x24')]=qs[_0xcc6a('0x24')](_0x44fee8[_0xcc6a('0x41')][_0xcc6a('0x24')]);}_0x46a6df[_0xcc6a('0x27')]=_0x5d9644[_0xcc6a('0x4a')];_0x46a6df[_0xcc6a('0x47')]=_0xa28f0e[_0xcc6a('0x26')]?_0x5d9644[_0xcc6a('0x191')](_0xa28f0e['offset'],_0xa28f0e[_0xcc6a('0x24')]+_0xa28f0e['limit']):_0x5d9644;return _0x46a6df;})[_0xcc6a('0x15')](respondWithFilteredResult(_0x265df9,_0xa28f0e))[_0xcc6a('0x1f')](handleError(_0x265df9,null));};function get_open_tabs(_0x188df0,_0x425e29){var _0x51a0ab=_0x188df0[_0xcc6a('0x192')](0x0)[_0xcc6a('0x193')]()+_0x188df0[_0xcc6a('0x191')](0x1);var _0x40edf1={'type':db[_0xcc6a('0x8d')][_0xcc6a('0x194')][_0xcc6a('0x195')],'raw':!![]};return new BPromise(function(_0x2db14c,_0x387c01){var _0x4200fc=squel[_0xcc6a('0x196')]()['field']('ui.'+_0x51a0ab+_0xcc6a('0x197'),'id')[_0xcc6a('0x198')](_0xcc6a('0x199'))[_0xcc6a('0x6b')](_0xcc6a('0x19a')+_0x188df0+_0xcc6a('0x19b'),'ui')[_0xcc6a('0xcc')](_0xcc6a('0x19c'),_0x425e29['id']);return db[_0xcc6a('0x69')][_0xcc6a('0x41')](_0x4200fc[_0xcc6a('0x183')](),_0x40edf1)[_0xcc6a('0x15')](function(_0x24d46d){_0x425e29[_0x51a0ab+_0xcc6a('0x19d')]=_0x24d46d;_0x2db14c(_0x24d46d);})[_0xcc6a('0x1f')](function(_0x51112a){_0x387c01(_0x51112a);});});};
\ No newline at end of file
index 8d89666..aa352d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b9e=['events','../../mysqldb','User','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x4c3549,_0x49d131){var _0x5678e3=function(_0x4ea8a5){while(--_0x4ea8a5){_0x4c3549['push'](_0x4c3549['shift']());}};_0x5678e3(++_0x49d131);}(_0x1b9e,0x183));var _0xe1b9=function(_0x337251,_0x5b1eab){_0x337251=_0x337251-0x0;var _0x12c428=_0x1b9e[_0x337251];return _0x12c428;};'use strict';var EventEmitter=require(_0xe1b9('0x0'));var User=require(_0xe1b9('0x1'))['db'][_0xe1b9('0x2')];var UserEvents=new EventEmitter();UserEvents[_0xe1b9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe1b9('0x4'),'afterDestroy':_0xe1b9('0x5')};function emitEvent(_0x295180){return function(_0x3783d7,_0x2d4f19,_0x108e1f){UserEvents['emit'](_0x295180+':'+_0x3783d7['id'],_0x3783d7);UserEvents[_0xe1b9('0x6')](_0x295180,_0x3783d7);_0x108e1f(null);};}for(var e in events){if(events[_0xe1b9('0x7')](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0xe1b9('0x8')]=UserEvents;
\ No newline at end of file
+var _0x7469=['../../mysqldb','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x35747a,_0x5763f4){var _0x224e75=function(_0x16e3dd){while(--_0x16e3dd){_0x35747a['push'](_0x35747a['shift']());}};_0x224e75(++_0x5763f4);}(_0x7469,0xd7));var _0x9746=function(_0x45455c,_0xdee0ea){_0x45455c=_0x45455c-0x0;var _0x176141=_0x7469[_0x45455c];return _0x176141;};'use strict';var EventEmitter=require(_0x9746('0x0'));var User=require(_0x9746('0x1'))['db']['User'];var UserEvents=new EventEmitter();UserEvents[_0x9746('0x2')](0x0);var events={'afterCreate':_0x9746('0x3'),'afterUpdate':_0x9746('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1211f4){return function(_0x51fb56,_0x3ea58e,_0x17b973){UserEvents[_0x9746('0x5')](_0x1211f4+':'+_0x51fb56['id'],_0x51fb56);UserEvents[_0x9746('0x5')](_0x1211f4,_0x51fb56);_0x17b973(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0x9746('0x6')](e,emitEvent(event));}}module[_0x9746('0x7')]=UserEvents;
\ No newline at end of file
index f8dd558..158f6cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe88=['merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','name','options','join','wav','WAV','context','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Hangup','priority','defaults','findAll','then','internal','concat','catch','models','define','User','users','utf8','utf8_bin','undefined','find','userProfileId','privacyEnabled','updateMd5Password','updatePassword','resolve','changed','UserProfile','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','base64','salt','pbkdf2','sha1','indexOf','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','bluebird','crypto','util','md5','lodash','./user.attributes','length','from-sip','system','prefix','push'];(function(_0x153c6a,_0x2a217a){var _0xce898f=function(_0x84c97c){while(--_0x84c97c){_0x153c6a['push'](_0x153c6a['shift']());}};_0xce898f(++_0x2a217a);}(_0xfe88,0x167));var _0x8fe8=function(_0x496ee9,_0x4dba12){_0x496ee9=_0x496ee9-0x0;var _0xb7016a=_0xfe88[_0x496ee9];return _0xb7016a;};'use strict';var BPromise=require(_0x8fe8('0x0'));var crypto=require(_0x8fe8('0x1'));var util=require(_0x8fe8('0x2'));var md5=require(_0x8fe8('0x3'));var _=require(_0x8fe8('0x4'));var attributes=require(_0x8fe8('0x5'));var authTypes=['google'];var validatePresenceOf=function(_0x53a2f3){return _0x53a2f3&&_0x53a2f3[_0x8fe8('0x6')];};var getChanSpyApplications=function(_0x1d25b0,_0x5323b2,_0xc872a7){var _0x4fd113={'context':_0x1d25b0['context']||_0x8fe8('0x7'),'type':_0x8fe8('0x8'),'isApp':![],'UserId':_0x1d25b0['id']};var _0x3c9aa1=[];for(var _0x44f996=0x0,_0x137444=0x1;_0x44f996<_0xc872a7['length'];_0x44f996++,_0x137444=0x1){var _0x1b5200={'exten':util['format']('%s%s',_0xc872a7[_0x44f996][_0x8fe8('0x9')],_0x5323b2),'ChanSpyId':_0xc872a7[_0x44f996]['id']};_0x3c9aa1[_0x8fe8('0xa')](_[_0x8fe8('0xb')]({'app':_0x8fe8('0xc'),'appdata':util[_0x8fe8('0xd')](_0x8fe8('0xe'),_0x8fe8('0xf')),'priority':_0x137444++},_0x4fd113,_0x1b5200));if(_0xc872a7[_0x44f996][_0x8fe8('0x10')]){_0x3c9aa1[_0x8fe8('0xa')](_[_0x8fe8('0xb')]({'app':_0x8fe8('0x11'),'appdata':util[_0x8fe8('0xd')](_0x8fe8('0x12'),_0xc872a7[_0x44f996][_0x8fe8('0x13')]),'priority':_0x137444++},_0x4fd113,_0x1b5200));}if(_0xc872a7[_0x44f996]['auth']){_0x3c9aa1['push'](_[_0x8fe8('0xb')]({'app':_0x8fe8('0x14'),'appdata':_0xc872a7[_0x44f996][_0x8fe8('0x15')],'priority':_0x137444++},_0x4fd113,_0x1b5200));}_0x3c9aa1['push'](_[_0x8fe8('0xb')]({'app':_0x8fe8('0x16'),'appdata':util[_0x8fe8('0xd')]('SIP/%s,%s',_0x1d25b0[_0x8fe8('0x17')],_0xc872a7[_0x44f996][_0x8fe8('0x18')]?_0xc872a7[_0x44f996][_0x8fe8('0x18')][_0x8fe8('0x19')](''):''),'priority':_0x137444++},_0x4fd113,_0x1b5200));if(_0xc872a7[_0x44f996]['record']){_0x3c9aa1['push'](_[_0x8fe8('0xb')]({'app':'StopMixMonitor','priority':_0x137444++},_0x4fd113,_0x1b5200));}}return _0x3c9aa1;};var getUserApplications=function(_0x124ced,_0xcc6317){var _0x37b54f=[_0x8fe8('0x1a'),_0x8fe8('0x1b'),'gsm'];var _0x3effbe={'context':_0x124ced[_0x8fe8('0x1c')]||_0x8fe8('0x7'),'exten':_0xcc6317,'type':_0x8fe8('0x8'),'isApp':![],'UserId':_0x124ced['id']};var _0x3efdc6=[{'app':_0x8fe8('0xc'),'appdata':_0x8fe8('0x1d')}];if(_0x124ced[_0x8fe8('0x1e')]&&_[_0x8fe8('0x1f')](_0x37b54f,_0x124ced['extensionMonitor'])){_0x3efdc6[_0x8fe8('0xa')]({'app':_0x8fe8('0xc'),'appdata':_0x8fe8('0x20')});_0x3efdc6[_0x8fe8('0xa')]({'app':_0x8fe8('0xc'),'appdata':util[_0x8fe8('0xd')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x124ced['extensionMonitor'])});_0x3efdc6[_0x8fe8('0xa')]({'app':_0x8fe8('0x21'),'appdata':util[_0x8fe8('0xd')](_0x8fe8('0x22'),_0x124ced[_0x8fe8('0x17')])});}else{_0x3efdc6['push']({'app':_0x8fe8('0x21'),'appdata':util['format']('SIP/%s,,tTxX',_0x124ced[_0x8fe8('0x17')])});}_0x3efdc6[_0x8fe8('0xa')]({'app':_0x8fe8('0x23')});for(var _0x3a45bc=0x0;_0x3a45bc<_0x3efdc6[_0x8fe8('0x6')];_0x3a45bc++){_0x3efdc6[_0x3a45bc][_0x8fe8('0x24')]=_0x3a45bc+0x1;_0x3efdc6[_0x3a45bc]=_[_0x8fe8('0x25')](_0x3efdc6[_0x3a45bc],_0x3effbe);}return _0x3efdc6;};var getChanSpyPromise=function(_0xa210d4,_0x2554aa){return new BPromise(function(_0x2d2f21,_0x294f5c){return _0xa210d4['VoiceChanSpy'][_0x8fe8('0x26')]()[_0x8fe8('0x27')](function(_0x418e37){if(_0x418e37){var _0x256aff=getChanSpyApplications(_0x2554aa,_0x2554aa[_0x8fe8('0x28')],_0x418e37);if(_0x2554aa[_0x8fe8('0x28')]!=_0x2554aa['name']){_0x256aff=_0x256aff[_0x8fe8('0x29')](getChanSpyApplications(_0x2554aa,_0x2554aa[_0x8fe8('0x17')],_0x418e37));}return _0x2d2f21(_0x256aff);}return _0x2d2f21([]);})[_0x8fe8('0x2a')](function(_0xb3675c){_0x294f5c(_0xb3675c);});});};module['exports']=function(_0x30c917,_0x4e867c){var _0x5e25bb=_0x30c917[_0x8fe8('0x2b')];return _0x30c917[_0x8fe8('0x2c')](_0x8fe8('0x2d'),attributes,{'tableName':_0x8fe8('0x2e'),'charset':_0x8fe8('0x2f'),'collate':_0x8fe8('0x30'),'hooks':{'beforeCreate':function(_0x1a4cad,_0x4158d9,_0xca50bb){var _0x5c7331=typeof _0x1a4cad['userProfileId']===_0x8fe8('0x31')?BPromise['resolve'](null):_0x5e25bb['UserProfile'][_0x8fe8('0x32')]({'where':{'id':_0x1a4cad[_0x8fe8('0x33')]}});_0x5c7331[_0x8fe8('0x27')](function(_0x473eb8){if(_0x473eb8){_0x1a4cad[_0x8fe8('0x34')]=_0x473eb8[_0x8fe8('0x34')];}})[_0x8fe8('0x27')](function(){_0x1a4cad[_0x8fe8('0x35')]();_0x1a4cad[_0x8fe8('0x36')](_0xca50bb);})[_0x8fe8('0x2a')](function(_0x1f3de7){_0xca50bb(_0x1f3de7);});},'beforeUpdate':function(_0x12592d,_0x5ec762,_0x2db2a6){Promise[_0x8fe8('0x37')]()[_0x8fe8('0x27')](function(){if(_0x12592d[_0x8fe8('0x38')](_0x8fe8('0x33'))===![])return;return _0x5e25bb[_0x8fe8('0x39')]['find']({'where':{'id':_0x12592d[_0x8fe8('0x33')]}})[_0x8fe8('0x27')](function(_0x290d19){if(_0x290d19)_0x12592d[_0x8fe8('0x34')]=_0x290d19['privacyEnabled'];return;});})[_0x8fe8('0x27')](function(){if(_0x12592d[_0x8fe8('0x38')]('password')){_0x12592d[_0x8fe8('0x35')]();return _0x12592d[_0x8fe8('0x36')](_0x2db2a6);}_0x2db2a6();})[_0x8fe8('0x2a')](function(_0x33cf0e){_0x2db2a6(_0x33cf0e);});},'afterCreate':function(_0xe4efd9,_0x12daa0,_0x164351){var _0x6db24f=getUserApplications(_0xe4efd9,_0xe4efd9[_0x8fe8('0x28')]);if(_0xe4efd9[_0x8fe8('0x28')]!=_0xe4efd9[_0x8fe8('0x17')]){_0x6db24f=_0x6db24f[_0x8fe8('0x29')](getUserApplications(_0xe4efd9,_0xe4efd9['name']));}return _0x5e25bb[_0x8fe8('0x3a')][_0x8fe8('0x3b')](_0x6db24f)[_0x8fe8('0x27')](function(){if(_0xe4efd9[_0x8fe8('0xf')]){return getChanSpyPromise(_0x5e25bb,_0xe4efd9);}})[_0x8fe8('0x27')](function(_0x15235f){if(_0x15235f&&_0x15235f[_0x8fe8('0x6')]){return _0x5e25bb[_0x8fe8('0x3a')]['bulkCreate'](_0x15235f);}})[_0x8fe8('0x27')](function(){_0x164351();})[_0x8fe8('0x2a')](function(_0x22f43b){_0x164351(_0x22f43b);});},'afterUpdate':function(_0x1bd529,_0x2bf6e3,_0xb6a53e){return BPromise[_0x8fe8('0x37')]()[_0x8fe8('0x27')](function(){if(_0x1bd529['changed'](_0x8fe8('0xf'))||_0x1bd529[_0x8fe8('0x38')](_0x8fe8('0x1c'))){return _0x5e25bb[_0x8fe8('0x3a')][_0x8fe8('0x3c')]({'where':{'UserId':_0x1bd529['id'],'type':_0x8fe8('0x8'),'ChanSpyId':{'$ne':null}}})[_0x8fe8('0x27')](function(){if(_0x1bd529[_0x8fe8('0xf')]){return getChanSpyPromise(_0x5e25bb,_0x1bd529)[_0x8fe8('0x27')](function(_0x42f8fc){if(_0x42f8fc&&_0x42f8fc['length']){return _0x5e25bb[_0x8fe8('0x3a')]['bulkCreate'](_0x42f8fc);}});}});}})[_0x8fe8('0x27')](function(){if(_0x1bd529[_0x8fe8('0x38')](_0x8fe8('0x1e'))||_0x1bd529[_0x8fe8('0x38')](_0x8fe8('0x1c'))){return _0x5e25bb[_0x8fe8('0x3a')]['destroy']({'where':{'UserId':_0x1bd529['id'],'type':_0x8fe8('0x8'),'ChanSpyId':null}})[_0x8fe8('0x27')](function(){var _0x1eb441=getUserApplications(_0x1bd529,_0x1bd529[_0x8fe8('0x28')]);if(_0x1bd529[_0x8fe8('0x28')]!=_0x1bd529[_0x8fe8('0x17')]){_0x1eb441=_0x1eb441[_0x8fe8('0x29')](getUserApplications(_0x1bd529,_0x1bd529['name']));}return _0x5e25bb[_0x8fe8('0x3a')]['bulkCreate'](_0x1eb441);});}})['then'](function(){_0xb6a53e();})[_0x8fe8('0x2a')](function(_0x2bdaec){_0xb6a53e(_0x2bdaec);});},'afterDestroy':function(_0x5c37eb,_0x36c28a){return _0x5e25bb[_0x8fe8('0x3a')][_0x8fe8('0x3c')]({'where':{'UserId':_0x5c37eb['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x399d46,_0x16fd05){if(!_0x16fd05){return this[_0x8fe8('0x15')]===this[_0x8fe8('0x3d')](_0x399d46);}var _0x58759e=this;this[_0x8fe8('0x3d')](_0x399d46,function(_0x294f5d,_0x3a443e){if(_0x294f5d){_0x16fd05(_0x294f5d);}if(_0x58759e[_0x8fe8('0x15')]===_0x3a443e){_0x16fd05(null,!![]);}else{_0x16fd05(null,![]);}});},'makeSalt':function(_0x2705d1,_0x4f8064){var _0x27370e=0x10;if(typeof arguments[0x0]==='function'){_0x4f8064=arguments[0x0];_0x2705d1=_0x27370e;}else if(typeof arguments[0x1]===_0x8fe8('0x3e')){_0x4f8064=arguments[0x1];}else{throw new Error(_0x8fe8('0x3f'));}if(!_0x2705d1){_0x2705d1=_0x27370e;}return crypto['randomBytes'](_0x2705d1,function(_0x477874,_0x12da77){if(_0x477874){_0x4f8064(_0x477874);}return _0x4f8064(null,_0x12da77['toString'](_0x8fe8('0x40')));});},'encryptPassword':function(_0x134d92,_0x3ef02e){if(!_0x134d92||!this[_0x8fe8('0x41')]){return _0x3ef02e?_0x3ef02e(null):null;}var _0x47fe99=0x2710;var _0xa8d331=0x40;var _0x279609=new Buffer(this[_0x8fe8('0x41')],_0x8fe8('0x40'));if(!_0x3ef02e){return crypto['pbkdf2Sync'](_0x134d92,_0x279609,_0x47fe99,_0xa8d331,'sha1')['toString']('base64');}return crypto[_0x8fe8('0x42')](_0x134d92,_0x279609,_0x47fe99,_0xa8d331,_0x8fe8('0x43'),function(_0x5ccb01,_0x148dad){if(_0x5ccb01){_0x3ef02e(_0x5ccb01);}return _0x3ef02e(null,_0x148dad['toString']('base64'));});},'updatePassword':function(_0x3086a8){if(!this[_0x8fe8('0x15')]){return _0x3086a8(null);}if(!validatePresenceOf(this[_0x8fe8('0x15')])&&authTypes[_0x8fe8('0x44')](this[_0x8fe8('0x45')])===-0x1){_0x3086a8(new Error(_0x8fe8('0x46')));}var _0x5251c8=this;this[_0x8fe8('0x47')](function(_0x12bb68,_0x13d774){if(_0x12bb68){return _0x3086a8(_0x12bb68);}_0x5251c8[_0x8fe8('0x41')]=_0x13d774;_0x5251c8[_0x8fe8('0x3d')](_0x5251c8[_0x8fe8('0x15')],function(_0x15e233,_0x21e9a2){if(_0x15e233){_0x3086a8(_0x15e233);}_0x5251c8[_0x8fe8('0x15')]=_0x21e9a2;_0x3086a8(null);});});},'updateMd5Password':function(){this[_0x8fe8('0x48')]=md5(this[_0x8fe8('0x17')]+_0x8fe8('0x49')+this['password']);return this[_0x8fe8('0x48')];}}});};
\ No newline at end of file
+var _0xb87a=['util','md5','google','length','context','from-sip','format','%s%s','push','CDR(type)=%s','chanspy','record','merge','${UNIQUEID}.%s,a','auth','Authenticate','SIP/%s,%s','name','options','StopMixMonitor','WAV','gsm','system','Set','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','then','internal','catch','models','define','utf8','undefined','resolve','UserProfile','find','privacyEnabled','updateMd5Password','updatePassword','changed','userProfileId','password','concat','bulkCreate','VoiceExtension','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','makeSalt','md5secret',':asterisk:','bluebird'];(function(_0x480ca0,_0xb393e1){var _0x43e7d2=function(_0x3e4ce4){while(--_0x3e4ce4){_0x480ca0['push'](_0x480ca0['shift']());}};_0x43e7d2(++_0xb393e1);}(_0xb87a,0x8f));var _0xab87=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xb87a[_0x5c3c0b];return _0x52ecd2;};'use strict';var BPromise=require(_0xab87('0x0'));var crypto=require('crypto');var util=require(_0xab87('0x1'));var md5=require(_0xab87('0x2'));var _=require('lodash');var attributes=require('./user.attributes');var authTypes=[_0xab87('0x3')];var validatePresenceOf=function(_0xbf3417){return _0xbf3417&&_0xbf3417[_0xab87('0x4')];};var getChanSpyApplications=function(_0x4b2426,_0x3cc51d,_0x14d9aa){var _0x1c6f3c={'context':_0x4b2426[_0xab87('0x5')]||_0xab87('0x6'),'type':'system','isApp':![],'UserId':_0x4b2426['id']};var _0xeac422=[];for(var _0x1debf5=0x0,_0x5e3a45=0x1;_0x1debf5<_0x14d9aa[_0xab87('0x4')];_0x1debf5++,_0x5e3a45=0x1){var _0x3de2fc={'exten':util[_0xab87('0x7')](_0xab87('0x8'),_0x14d9aa[_0x1debf5]['prefix'],_0x3cc51d),'ChanSpyId':_0x14d9aa[_0x1debf5]['id']};_0xeac422[_0xab87('0x9')](_['merge']({'app':'Set','appdata':util['format'](_0xab87('0xa'),_0xab87('0xb')),'priority':_0x5e3a45++},_0x1c6f3c,_0x3de2fc));if(_0x14d9aa[_0x1debf5][_0xab87('0xc')]){_0xeac422[_0xab87('0x9')](_[_0xab87('0xd')]({'app':'MixMonitor','appdata':util[_0xab87('0x7')](_0xab87('0xe'),_0x14d9aa[_0x1debf5]['recordingFormat']),'priority':_0x5e3a45++},_0x1c6f3c,_0x3de2fc));}if(_0x14d9aa[_0x1debf5][_0xab87('0xf')]){_0xeac422[_0xab87('0x9')](_[_0xab87('0xd')]({'app':_0xab87('0x10'),'appdata':_0x14d9aa[_0x1debf5]['password'],'priority':_0x5e3a45++},_0x1c6f3c,_0x3de2fc));}_0xeac422[_0xab87('0x9')](_[_0xab87('0xd')]({'app':'ChanSpy','appdata':util[_0xab87('0x7')](_0xab87('0x11'),_0x4b2426[_0xab87('0x12')],_0x14d9aa[_0x1debf5][_0xab87('0x13')]?_0x14d9aa[_0x1debf5][_0xab87('0x13')]['join'](''):''),'priority':_0x5e3a45++},_0x1c6f3c,_0x3de2fc));if(_0x14d9aa[_0x1debf5][_0xab87('0xc')]){_0xeac422[_0xab87('0x9')](_[_0xab87('0xd')]({'app':_0xab87('0x14'),'priority':_0x5e3a45++},_0x1c6f3c,_0x3de2fc));}}return _0xeac422;};var getUserApplications=function(_0x40e343,_0x272634){var _0x336e14=['wav',_0xab87('0x15'),_0xab87('0x16')];var _0x5762ad={'context':_0x40e343[_0xab87('0x5')]||_0xab87('0x6'),'exten':_0x272634,'type':_0xab87('0x17'),'isApp':![],'UserId':_0x40e343['id']};var _0x4ec4c6=[{'app':_0xab87('0x18'),'appdata':_0xab87('0x19')}];if(_0x40e343[_0xab87('0x1a')]&&_[_0xab87('0x1b')](_0x336e14,_0x40e343[_0xab87('0x1a')])){_0x4ec4c6[_0xab87('0x9')]({'app':'Set','appdata':_0xab87('0x1c')});_0x4ec4c6[_0xab87('0x9')]({'app':_0xab87('0x18'),'appdata':util[_0xab87('0x7')](_0xab87('0x1d'),_0x40e343[_0xab87('0x1a')])});_0x4ec4c6[_0xab87('0x9')]({'app':_0xab87('0x1e'),'appdata':util[_0xab87('0x7')](_0xab87('0x1f'),_0x40e343[_0xab87('0x12')])});}else{_0x4ec4c6['push']({'app':_0xab87('0x1e'),'appdata':util['format'](_0xab87('0x20'),_0x40e343[_0xab87('0x12')])});}_0x4ec4c6[_0xab87('0x9')]({'app':_0xab87('0x21')});for(var _0x598c7f=0x0;_0x598c7f<_0x4ec4c6[_0xab87('0x4')];_0x598c7f++){_0x4ec4c6[_0x598c7f][_0xab87('0x22')]=_0x598c7f+0x1;_0x4ec4c6[_0x598c7f]=_[_0xab87('0x23')](_0x4ec4c6[_0x598c7f],_0x5762ad);}return _0x4ec4c6;};var getChanSpyPromise=function(_0x2673bb,_0xc039e){return new BPromise(function(_0x239c84,_0x3e48ac){return _0x2673bb[_0xab87('0x24')]['findAll']()[_0xab87('0x25')](function(_0x4d27b4){if(_0x4d27b4){var _0x2f985f=getChanSpyApplications(_0xc039e,_0xc039e[_0xab87('0x26')],_0x4d27b4);if(_0xc039e[_0xab87('0x26')]!=_0xc039e[_0xab87('0x12')]){_0x2f985f=_0x2f985f['concat'](getChanSpyApplications(_0xc039e,_0xc039e[_0xab87('0x12')],_0x4d27b4));}return _0x239c84(_0x2f985f);}return _0x239c84([]);})[_0xab87('0x27')](function(_0x49fc26){_0x3e48ac(_0x49fc26);});});};module['exports']=function(_0x4976f7,_0x4e57f8){var _0xfddcc8=_0x4976f7[_0xab87('0x28')];return _0x4976f7[_0xab87('0x29')]('User',attributes,{'tableName':'users','charset':_0xab87('0x2a'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x4bbd93,_0x2b9498,_0x3e9b31){var _0x1a87d0=typeof _0x4bbd93['userProfileId']===_0xab87('0x2b')?BPromise[_0xab87('0x2c')](null):_0xfddcc8[_0xab87('0x2d')][_0xab87('0x2e')]({'where':{'id':_0x4bbd93['userProfileId']}});_0x1a87d0[_0xab87('0x25')](function(_0x1c49a0){if(_0x1c49a0){_0x4bbd93[_0xab87('0x2f')]=_0x1c49a0[_0xab87('0x2f')];}})[_0xab87('0x25')](function(){_0x4bbd93[_0xab87('0x30')]();_0x4bbd93[_0xab87('0x31')](_0x3e9b31);})[_0xab87('0x27')](function(_0x20a080){_0x3e9b31(_0x20a080);});},'beforeUpdate':function(_0x522382,_0x396818,_0x1246e0){Promise['resolve']()['then'](function(){if(_0x522382[_0xab87('0x32')](_0xab87('0x33'))===![])return;return _0xfddcc8[_0xab87('0x2d')][_0xab87('0x2e')]({'where':{'id':_0x522382[_0xab87('0x33')]}})[_0xab87('0x25')](function(_0x2b774d){if(_0x2b774d)_0x522382[_0xab87('0x2f')]=_0x2b774d[_0xab87('0x2f')];return;});})[_0xab87('0x25')](function(){if(_0x522382['changed'](_0xab87('0x34'))){_0x522382['updateMd5Password']();return _0x522382['updatePassword'](_0x1246e0);}_0x1246e0();})[_0xab87('0x27')](function(_0x3188bc){_0x1246e0(_0x3188bc);});},'afterCreate':function(_0x399db4,_0x25515c,_0x46c6d7){var _0x37d5ea=getUserApplications(_0x399db4,_0x399db4['internal']);if(_0x399db4['internal']!=_0x399db4[_0xab87('0x12')]){_0x37d5ea=_0x37d5ea[_0xab87('0x35')](getUserApplications(_0x399db4,_0x399db4['name']));}return _0xfddcc8['VoiceExtension'][_0xab87('0x36')](_0x37d5ea)['then'](function(){if(_0x399db4[_0xab87('0xb')]){return getChanSpyPromise(_0xfddcc8,_0x399db4);}})[_0xab87('0x25')](function(_0x410f68){if(_0x410f68&&_0x410f68[_0xab87('0x4')]){return _0xfddcc8['VoiceExtension'][_0xab87('0x36')](_0x410f68);}})[_0xab87('0x25')](function(){_0x46c6d7();})[_0xab87('0x27')](function(_0x112885){_0x46c6d7(_0x112885);});},'afterUpdate':function(_0x52fa63,_0x4dc789,_0x53d929){return BPromise[_0xab87('0x2c')]()['then'](function(){if(_0x52fa63[_0xab87('0x32')]('chanspy')||_0x52fa63[_0xab87('0x32')](_0xab87('0x5'))){return _0xfddcc8[_0xab87('0x37')]['destroy']({'where':{'UserId':_0x52fa63['id'],'type':_0xab87('0x17'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x52fa63['chanspy']){return getChanSpyPromise(_0xfddcc8,_0x52fa63)[_0xab87('0x25')](function(_0x39b80b){if(_0x39b80b&&_0x39b80b[_0xab87('0x4')]){return _0xfddcc8[_0xab87('0x37')][_0xab87('0x36')](_0x39b80b);}});}});}})['then'](function(){if(_0x52fa63['changed'](_0xab87('0x1a'))||_0x52fa63[_0xab87('0x32')](_0xab87('0x5'))){return _0xfddcc8[_0xab87('0x37')]['destroy']({'where':{'UserId':_0x52fa63['id'],'type':_0xab87('0x17'),'ChanSpyId':null}})[_0xab87('0x25')](function(){var _0x1ec852=getUserApplications(_0x52fa63,_0x52fa63['internal']);if(_0x52fa63[_0xab87('0x26')]!=_0x52fa63[_0xab87('0x12')]){_0x1ec852=_0x1ec852[_0xab87('0x35')](getUserApplications(_0x52fa63,_0x52fa63[_0xab87('0x12')]));}return _0xfddcc8['VoiceExtension'][_0xab87('0x36')](_0x1ec852);});}})[_0xab87('0x25')](function(){_0x53d929();})['catch'](function(_0x1faa8b){_0x53d929(_0x1faa8b);});},'afterDestroy':function(_0x99321b,_0x323340){return _0xfddcc8[_0xab87('0x37')][_0xab87('0x38')]({'where':{'UserId':_0x99321b['id'],'type':_0xab87('0x17')}});}},'instanceMethods':{'authenticate':function(_0x50f7b4,_0xee8700){if(!_0xee8700){return this['password']===this[_0xab87('0x39')](_0x50f7b4);}var _0x546643=this;this[_0xab87('0x39')](_0x50f7b4,function(_0x2d2aec,_0x4cf957){if(_0x2d2aec){_0xee8700(_0x2d2aec);}if(_0x546643['password']===_0x4cf957){_0xee8700(null,!![]);}else{_0xee8700(null,![]);}});},'makeSalt':function(_0x4e1a88,_0x4ac076){var _0x3ff251=0x10;if(typeof arguments[0x0]==='function'){_0x4ac076=arguments[0x0];_0x4e1a88=_0x3ff251;}else if(typeof arguments[0x1]===_0xab87('0x3a')){_0x4ac076=arguments[0x1];}else{throw new Error(_0xab87('0x3b'));}if(!_0x4e1a88){_0x4e1a88=_0x3ff251;}return crypto[_0xab87('0x3c')](_0x4e1a88,function(_0x220c71,_0xf00c78){if(_0x220c71){_0x4ac076(_0x220c71);}return _0x4ac076(null,_0xf00c78[_0xab87('0x3d')](_0xab87('0x3e')));});},'encryptPassword':function(_0x559147,_0x3b3004){if(!_0x559147||!this['salt']){return _0x3b3004?_0x3b3004(null):null;}var _0x3c9789=0x2710;var _0x382c74=0x40;var _0x188fba=new Buffer(this[_0xab87('0x3f')],_0xab87('0x3e'));if(!_0x3b3004){return crypto[_0xab87('0x40')](_0x559147,_0x188fba,_0x3c9789,_0x382c74,_0xab87('0x41'))[_0xab87('0x3d')](_0xab87('0x3e'));}return crypto[_0xab87('0x42')](_0x559147,_0x188fba,_0x3c9789,_0x382c74,_0xab87('0x41'),function(_0xd1bbf9,_0x26be69){if(_0xd1bbf9){_0x3b3004(_0xd1bbf9);}return _0x3b3004(null,_0x26be69[_0xab87('0x3d')](_0xab87('0x3e')));});},'updatePassword':function(_0x59a266){if(!this[_0xab87('0x34')]){return _0x59a266(null);}if(!validatePresenceOf(this[_0xab87('0x34')])&&authTypes[_0xab87('0x43')](this[_0xab87('0x44')])===-0x1){_0x59a266(new Error('Invalid\x20password'));}var _0x2fb2f6=this;this[_0xab87('0x45')](function(_0x4bf8a2,_0x34c3b7){if(_0x4bf8a2){return _0x59a266(_0x4bf8a2);}_0x2fb2f6['salt']=_0x34c3b7;_0x2fb2f6[_0xab87('0x39')](_0x2fb2f6['password'],function(_0x1fb5a3,_0x4dcb80){if(_0x1fb5a3){_0x59a266(_0x1fb5a3);}_0x2fb2f6[_0xab87('0x34')]=_0x4dcb80;_0x59a266(null);});});},'updateMd5Password':function(){this[_0xab87('0x46')]=md5(this[_0xab87('0x12')]+_0xab87('0x47')+this['password']);return this[_0xab87('0x46')];}}});};
\ No newline at end of file
index 39bb036..079b5d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc1e=['Pause','all','LogoutUser','destroy','LoginUser','mobile','phone','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','loginInPause','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','./user.socket','register','request','info','User,\x20%s,\x20%s','debug','code','error','message','request\x20sent','result','catch','User','findAll','options','raw','where','limit','include','map','model','attributes','then','find','ShowUser','stringify','name','role','interface','update','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','isNil','format','SIP/%s','body','type','DEFAULT\x20PAUSE','internal','uniqueid','MemberReport','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','voice','UserVoiceQueueRt','system','mail','chat','fax','whatsapp','set'];(function(_0x55adee,_0x4d9108){var _0x5f0455=function(_0x216c59){while(--_0x216c59){_0x55adee['push'](_0x55adee['shift']());}};_0x5f0455(++_0x4d9108);}(_0xfc1e,0xca));var _0xefc1=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0xfc1e[_0x3ec122];return _0x4ecf41;};'use strict';var _=require('lodash');var util=require(_0xefc1('0x0'));var moment=require(_0xefc1('0x1'));var BPromise=require(_0xefc1('0x2'));var rs=require(_0xefc1('0x3'));var fs=require('fs');var Redis=require(_0xefc1('0x4'));var db=require(_0xefc1('0x5'))['db'];var utils=require(_0xefc1('0x6'));var logger=require(_0xefc1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xefc1('0x8'));var client=jayson['client'][_0xefc1('0x9')]({'port':0x232a});config[_0xefc1('0xa')]=_[_0xefc1('0xb')](config[_0xefc1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xefc1('0xc'))(new Redis(config[_0xefc1('0xa')]));require(_0xefc1('0xd'))[_0xefc1('0xe')](socket);function respondWithRpcPromise(_0x25f33a,_0x59d1b0,_0x5d38b8){return new BPromise(function(_0x32d9ec,_0x22bfb4){return client[_0xefc1('0xf')](_0x25f33a,_0x5d38b8)['then'](function(_0x47077f){logger[_0xefc1('0x10')](_0xefc1('0x11'),_0x59d1b0,'request\x20sent');logger[_0xefc1('0x12')]('User,\x20%s,\x20%s,\x20%s',_0x59d1b0,'request\x20sent',JSON['stringify'](_0x47077f));if(_0x47077f['error']){if(_0x47077f['error'][_0xefc1('0x13')]===0x1f4){logger[_0xefc1('0x14')](_0xefc1('0x11'),_0x59d1b0,_0x47077f[_0xefc1('0x14')][_0xefc1('0x15')]);return _0x22bfb4(_0x47077f[_0xefc1('0x14')][_0xefc1('0x15')]);}logger[_0xefc1('0x14')](_0xefc1('0x11'),_0x59d1b0,_0x47077f['error'][_0xefc1('0x15')]);return _0x32d9ec(_0x47077f[_0xefc1('0x14')][_0xefc1('0x15')]);}else{logger[_0xefc1('0x10')](_0xefc1('0x11'),_0x59d1b0,_0xefc1('0x16'));_0x32d9ec(_0x47077f[_0xefc1('0x17')][_0xefc1('0x15')]);}})[_0xefc1('0x18')](function(_0x14dcae){logger['error'](_0xefc1('0x11'),_0x59d1b0,_0x14dcae);_0x22bfb4(_0x14dcae);});});}exports['GetUser']=function(_0x331074){var _0x4d7cd1=this;return new Promise(function(_0x2e18ca,_0x212134){return db[_0xefc1('0x19')][_0xefc1('0x1a')]({'raw':_0x331074[_0xefc1('0x1b')]?_0x331074['options'][_0xefc1('0x1c')]===undefined?!![]:![]:!![],'where':_0x331074['options']?_0x331074[_0xefc1('0x1b')][_0xefc1('0x1d')]||null:null,'attributes':_0x331074[_0xefc1('0x1b')]?_0x331074['options']['attributes']||null:null,'limit':_0x331074[_0xefc1('0x1b')]?_0x331074[_0xefc1('0x1b')][_0xefc1('0x1e')]||null:null,'include':_0x331074['options']?_0x331074[_0xefc1('0x1b')][_0xefc1('0x1f')]?_[_0xefc1('0x20')](_0x331074[_0xefc1('0x1b')]['include'],function(_0x13b5c9){return{'model':db[_0x13b5c9[_0xefc1('0x21')]],'as':_0x13b5c9['as'],'attributes':_0x13b5c9[_0xefc1('0x22')],'include':_0x13b5c9[_0xefc1('0x1f')]?_['map'](_0x13b5c9[_0xefc1('0x1f')],function(_0x23ac9d){return{'model':db[_0x23ac9d['model']],'as':_0x23ac9d['as'],'attributes':_0x23ac9d[_0xefc1('0x22')],'include':_0x23ac9d[_0xefc1('0x1f')]?_[_0xefc1('0x20')](_0x23ac9d['include'],function(_0x45898a){return{'model':db[_0x45898a[_0xefc1('0x21')]],'as':_0x45898a['as'],'attributes':_0x45898a[_0xefc1('0x22')]};}):[]};}):[]};}):[]:[]})[_0xefc1('0x23')](function(_0x46834a){logger[_0xefc1('0x10')]('GetUser',_0x331074);logger[_0xefc1('0x12')]('GetUser',_0x331074,JSON['stringify'](_0x46834a));_0x2e18ca(_0x46834a);})[_0xefc1('0x18')](function(_0x5005be){logger[_0xefc1('0x14')]('GetUser',_0x5005be[_0xefc1('0x15')],_0x331074);_0x212134(_0x4d7cd1[_0xefc1('0x14')](0x1f4,_0x5005be[_0xefc1('0x15')]));});});};exports['ShowUser']=function(_0x228b8a){var _0x42f013=this;return new Promise(function(_0x137543,_0x10fd4f){return db['User'][_0xefc1('0x24')]({'raw':_0x228b8a[_0xefc1('0x1b')]?_0x228b8a[_0xefc1('0x1b')][_0xefc1('0x1c')]===undefined?!![]:![]:!![],'where':_0x228b8a[_0xefc1('0x1b')]?_0x228b8a[_0xefc1('0x1b')][_0xefc1('0x1d')]||null:null,'attributes':_0x228b8a[_0xefc1('0x1b')]?_0x228b8a['options'][_0xefc1('0x22')]||null:null,'include':_0x228b8a['options']?_0x228b8a[_0xefc1('0x1b')][_0xefc1('0x1f')]?_[_0xefc1('0x20')](_0x228b8a['options'][_0xefc1('0x1f')],function(_0x1059b4){return{'model':db[_0x1059b4[_0xefc1('0x21')]],'as':_0x1059b4['as'],'attributes':_0x1059b4['attributes'],'include':_0x1059b4[_0xefc1('0x1f')]?_['map'](_0x1059b4[_0xefc1('0x1f')],function(_0x53330a){return{'model':db[_0x53330a[_0xefc1('0x21')]],'as':_0x53330a['as'],'attributes':_0x53330a[_0xefc1('0x22')],'include':_0x53330a[_0xefc1('0x1f')]?_[_0xefc1('0x20')](_0x53330a[_0xefc1('0x1f')],function(_0x2fd086){return{'model':db[_0x2fd086[_0xefc1('0x21')]],'as':_0x2fd086['as'],'attributes':_0x2fd086[_0xefc1('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x205d06){logger['info'](_0xefc1('0x25'),_0x228b8a);logger[_0xefc1('0x12')]('ShowUser',_0x228b8a,JSON[_0xefc1('0x26')](_0x205d06));_0x137543(_0x205d06);})[_0xefc1('0x18')](function(_0x9b83e1){logger[_0xefc1('0x14')](_0xefc1('0x25'),_0x9b83e1['message'],_0x228b8a);_0x10fd4f(_0x42f013[_0xefc1('0x14')](0x1f4,_0x9b83e1[_0xefc1('0x15')]));});});};exports['PauseUser']=function(_0x55117f){var _0x2adfe9=this;return new Promise(function(_0x4f1b99,_0x6ff71){var _0x3e245c;return db['User']['find']({'where':_0x55117f['options'][_0xefc1('0x1d')]||{},'attributes':['id',_0xefc1('0x27'),_0xefc1('0x28'),'internal',_0xefc1('0x29')]})[_0xefc1('0x23')](function(_0x29e794){if(_0x29e794){_0x3e245c=_0x29e794;return db['UserVoiceQueueRt'][_0xefc1('0x2a')]({'paused':0x1},{'where':{'UserId':_0x3e245c['id']},'individualHooks':!![]});}})[_0xefc1('0x23')](function(){if(_0x3e245c){return db['MemberReport']['findAll']({'where':{'membername':_0x3e245c[_0xefc1('0x27')],'type':_0xefc1('0x2b'),'exitAt':null}});}})[_0xefc1('0x23')](function(_0x2faf32){if(_0x3e245c){if(_0x2faf32&&_0x2faf32[_0xefc1('0x2c')]){var _0x47b06a=moment()['format'](_0xefc1('0x2d'));for(var _0x5a099e=0x0,_0x1b0c41=_0x2faf32[_0xefc1('0x2c')];_0x5a099e<_0x1b0c41;_0x5a099e++){_0x2faf32[_0x5a099e][_0xefc1('0x2e')]({'exitAt':_0x47b06a});}}}})[_0xefc1('0x23')](function(){if(_0x3e245c){var _0x24587f=[];var _0x358ccf=utils['getChannels']();_0x358ccf[_0xefc1('0x2f')](function(_0x35ea5f){_0x24587f[_0xefc1('0x30')]({'channel':_0x35ea5f,'membername':_0x3e245c[_0xefc1('0x27')],'interface':_[_0xefc1('0x31')](_0x3e245c['interface'])?util[_0xefc1('0x32')](_0xefc1('0x33'),_0x3e245c[_0xefc1('0x27')]):_0x3e245c[_0xefc1('0x29')],'type':_0xefc1('0x2b'),'enterAt':moment()[_0xefc1('0x32')](_0xefc1('0x2d')),'data1':_0x55117f[_0xefc1('0x34')][_0xefc1('0x35')]||_0xefc1('0x36'),'role':_0x3e245c[_0xefc1('0x28')],'internal':_0x3e245c[_0xefc1('0x37')],'uniqueid':_0x55117f['body'][_0xefc1('0x38')]||null});});return db[_0xefc1('0x39')][_0xefc1('0x3a')](_0x24587f,{'individualHooks':!![]});}})[_0xefc1('0x23')](function(){if(_0x3e245c){return _0x3e245c[_0xefc1('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x55117f['body'][_0xefc1('0x35')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xefc1('0x32')](_0xefc1('0x2d'))});}})['then'](function(_0x3cb394){_0x4f1b99(_0x3cb394);})[_0xefc1('0x18')](function(_0xffe8b7){_0x6ff71(_0x2adfe9['error'](0x1f4,_0xffe8b7['message']));});});};exports[_0xefc1('0x3b')]=function(_0x18c793){var _0x1eebfe=this;return new Promise(function(_0x4742fc,_0x4f24a1){var _0x23f37c;return db[_0xefc1('0x19')][_0xefc1('0x3c')]({'where':_0x18c793[_0xefc1('0x1b')][_0xefc1('0x1d')]||{},'attributes':['id',_0xefc1('0x27')]})[_0xefc1('0x23')](function(_0x32f949){if(_0x32f949){_0x23f37c=_0x32f949;if(_0x18c793['body'][_0xefc1('0x3d')]&&!utils[_0xefc1('0x3e')](_0x18c793[_0xefc1('0x34')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x18c793[_0xefc1('0x34')]['channel']){case _0xefc1('0x3f'):return db[_0xefc1('0x40')][_0xefc1('0x2a')]({'paused':0x0},{'where':{'UserId':_0x23f37c['id']}})[_0xefc1('0x23')](function(){return db[_0xefc1('0x39')][_0xefc1('0x24')]({'where':{'channel':_0x18c793[_0xefc1('0x34')][_0xefc1('0x3d')],'membername':_0x23f37c['name'],'type':_0xefc1('0x2b'),'exitAt':null}});})[_0xefc1('0x23')](function(_0x5f3879){if(_0x5f3879){return _0x5f3879[_0xefc1('0x2a')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xefc1('0x41')},{'individualHooks':!![]});}return null;})[_0xefc1('0x23')](function(){return _0x23f37c[_0xefc1('0x2a')]({'voicePause':![]});});case _0xefc1('0x42'):case _0xefc1('0x43'):case _0xefc1('0x44'):case'sms':case'openchannel':case _0xefc1('0x45'):return db[_0xefc1('0x39')][_0xefc1('0x24')]({'where':{'channel':_0x18c793[_0xefc1('0x34')][_0xefc1('0x3d')],'membername':_0x23f37c[_0xefc1('0x27')],'type':_0xefc1('0x2b'),'exitAt':null}})[_0xefc1('0x23')](function(_0x3875a3){return _0x3875a3[_0xefc1('0x2a')]({'exitAt':moment()['format'](_0xefc1('0x2d')),'data2':'system'},{'individualHooks':!![]});})[_0xefc1('0x23')](function(){var _0x283cbb={};_[_0xefc1('0x46')](_0x283cbb,util[_0xefc1('0x32')]('%s%s',_0x18c793[_0xefc1('0x34')][_0xefc1('0x3d')],_0xefc1('0x47')),![]);return _0x23f37c[_0xefc1('0x2a')](_0x283cbb);});default:return db[_0xefc1('0x40')][_0xefc1('0x2a')]({'paused':0x0},{'where':{'UserId':_0x23f37c['id']}})['then'](function(){return db[_0xefc1('0x39')][_0xefc1('0x1a')]({'where':{'membername':_0x23f37c['name'],'type':_0xefc1('0x2b'),'exitAt':null}});})['then'](function(_0x2cd230){var _0x9a7959=[];_0x2cd230[_0xefc1('0x2f')](function(_0x144b91){_0x9a7959['push'](_0x144b91[_0xefc1('0x2a')]({'exitAt':moment()['format'](_0xefc1('0x2d')),'data2':_0xefc1('0x41')}));});return BPromise[_0xefc1('0x48')](_0x9a7959);})[_0xefc1('0x23')](function(){return _0x23f37c[_0xefc1('0x2a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xefc1('0x23')](function(_0x146296){_0x4742fc(_0x146296);})['catch'](function(_0x5aa551){_0x4f24a1(_0x1eebfe[_0xefc1('0x14')](0x1f4,_0x5aa551[_0xefc1('0x15')]));});});};exports[_0xefc1('0x49')]=function(_0x3cfda9){var _0x2a9730=this;return new Promise(function(_0x360aad,_0x2ab396){var _0x266d01;return db[_0xefc1('0x19')][_0xefc1('0x3c')]({'where':_0x3cfda9[_0xefc1('0x1b')][_0xefc1('0x1d')]||{},'attributes':['id',_0xefc1('0x27')]})['then'](function(_0x325b4c){if(_0x325b4c){_0x266d01=_0x325b4c;return db[_0xefc1('0x40')][_0xefc1('0x4a')]({'where':{'membername':_0x266d01['name']},'individualHooks':!![]});}})[_0xefc1('0x23')](function(){if(_0x266d01){return db[_0xefc1('0x39')][_0xefc1('0x1a')]({'where':{'membername':_0x266d01[_0xefc1('0x27')],'exitAt':null}});}})[_0xefc1('0x23')](function(_0x5c9d49){if(_0x266d01){if(_0x5c9d49&&_0x5c9d49[_0xefc1('0x2c')]){var _0x2300ae=[];_0x5c9d49['forEach'](function(_0x1781f6){_0x2300ae['push'](_0x1781f6[_0xefc1('0x2a')]({'exitAt':moment()[_0xefc1('0x32')](_0xefc1('0x2d'))}));});return BPromise[_0xefc1('0x48')](_0x2300ae);}}})['then'](function(){if(_0x266d01){return _0x266d01[_0xefc1('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xefc1('0x23')](function(_0x917209){_0x360aad(_0x917209);})['catch'](function(_0x43bca6){_0x2ab396(_0x2a9730[_0xefc1('0x14')](0x1f4,_0x43bca6[_0xefc1('0x15')]));});});};exports[_0xefc1('0x4b')]=function(_0x4c4139){var _0x407554=this;return new Promise(function(_0x489b66,_0x3e71d7){var _0x36ed2b;var _0x36fd5c;var _0x16507f;var _0x2ccbd;return db['User'][_0xefc1('0x3c')]({'where':_0x4c4139[_0xefc1('0x1b')][_0xefc1('0x1d')]||{},'attributes':['id',_0xefc1('0x27'),_0xefc1('0x28'),_0xefc1('0x4c'),_0xefc1('0x4d'),_0xefc1('0x37'),'loginInPause',_0xefc1('0x29')]})[_0xefc1('0x23')](function(_0x142d1d){if(_0x142d1d){_0x36ed2b=_0x142d1d;_0x2ccbd=_0x4c4139[_0xefc1('0x34')]['interface']?_0x4c4139['body'][_0xefc1('0x29')]:util[_0xefc1('0x32')](_0xefc1('0x33'),_0x36ed2b[_0xefc1('0x27')]);return db[_0xefc1('0x19')][_0xefc1('0x4e')]({'where':{'role':_0xefc1('0x4f'),'online':!![],'id':{'$ne':_0x36ed2b['id']}}});}})[_0xefc1('0x23')](function(_0x446efe){if(_0x446efe){_0x16507f=_0x446efe;return require(_0xefc1('0x50'))[_0xefc1('0x51')]();}})[_0xefc1('0x23')](function(_0x142d22){if(_0x142d22&&_0x142d22['agents']&&_0x16507f>=_0x142d22[_0xefc1('0x52')]){throw new Error(_0xefc1('0x53'));}})[_0xefc1('0x23')](function(){if(_0x36ed2b){return db[_0xefc1('0x40')]['destroy']({'where':{'membername':_0x36ed2b[_0xefc1('0x27')]},'individualHooks':!![]});}})[_0xefc1('0x23')](function(){if(_0x36ed2b){return _0x36ed2b['getVoiceQueues']({'raw':!![]});}})[_0xefc1('0x23')](function(_0x3104ab){if(_0x36ed2b){if(_0x3104ab){var _0x2f3159=[];_0x36fd5c=_0x3104ab;if(_0x36fd5c[_0xefc1('0x2c')]){for(var _0x4d3be9=0x0;_0x4d3be9<_0x36fd5c['length'];_0x4d3be9++){_0x2f3159['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x36ed2b[_0xefc1('0x27')],'UserId':_0x36ed2b['id'],'queue_name':_0x36fd5c[_0x4d3be9][_0xefc1('0x27')],'VoiceQueueId':_0x36fd5c[_0x4d3be9]['id'],'interface':_0x2ccbd,'paused':_0x36ed2b[_0xefc1('0x54')]||![],'penalty':_0x36fd5c[_0x4d3be9]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xefc1('0x48')](_0x2f3159);}}}})[_0xefc1('0x23')](function(){if(_0x36ed2b){return db['MemberReport'][_0xefc1('0x1a')]({'where':{'membername':_0x36ed2b[_0xefc1('0x27')],'exitAt':null}});}})['then'](function(_0x275b7b){if(_0x36ed2b){if(_0x275b7b&&_0x275b7b[_0xefc1('0x2c')]){var _0xb5283c=[];_0x275b7b['forEach'](function(_0x5ef481){_0xb5283c[_0xefc1('0x30')](_0x5ef481['update']({'exitAt':moment()['format'](_0xefc1('0x2d'))}));});return BPromise[_0xefc1('0x48')](_0xb5283c);}}})[_0xefc1('0x23')](function(_0x44d4e3){if(_0x36ed2b){var _0x2eacdf=[];var _0x2b41f9=[];var _0x36bd42=utils[_0xefc1('0x55')]();var _0x34afd9={'membername':_0x36ed2b[_0xefc1('0x27')],'interface':_0x2ccbd,'enterAt':moment()[_0xefc1('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x36ed2b[_0xefc1('0x28')],'internal':_0x36ed2b[_0xefc1('0x37')]};_0x36bd42[_0xefc1('0x2f')](function(_0x1d2160){_0x2eacdf['push'](_[_0xefc1('0x56')]({'channel':_0x1d2160,'type':_0xefc1('0x57'),'data1':_0xefc1('0x58'),'data2':_0x2ccbd},_0x34afd9));if(_0x36ed2b[_0xefc1('0x54')]){_0x2b41f9[_0xefc1('0x30')](_[_0xefc1('0x56')]({'channel':_0x1d2160,'type':_0xefc1('0x2b'),'data1':_0xefc1('0x59')},_0x34afd9));}});return db['MemberReport'][_0xefc1('0x3a')](_0x2eacdf[_0xefc1('0x5a')](_0x2b41f9),{'individualHooks':!![]});}})['then'](function(){if(_0x36ed2b){return _0x36ed2b[_0xefc1('0x2a')]({'online':!![],'lastLoginAt':moment()[_0xefc1('0x32')](_0xefc1('0x2d')),'voicePause':_0x36ed2b[_0xefc1('0x54')]||![],'mailPause':_0x36ed2b['loginInPause']||![],'chatPause':_0x36ed2b[_0xefc1('0x54')]||![],'faxPause':_0x36ed2b['loginInPause']||![],'smsPause':_0x36ed2b[_0xefc1('0x54')]||![],'openchannelPause':_0x36ed2b['loginInPause']||![],'pauseType':_0x36ed2b[_0xefc1('0x54')]?_0xefc1('0x59'):null,'lastPauseAt':moment()['format'](_0xefc1('0x2d')),'interface':_0x2ccbd});}})[_0xefc1('0x23')](function(_0xc2547a){_0x489b66(_0xc2547a);})['catch'](function(_0x3bb589){_0x3e71d7(_0x407554[_0xefc1('0x14')](0x1f4,_0x3bb589[_0xefc1('0x15')]));});});};
\ No newline at end of file
+var _0x809b=['code','message','result','catch','GetUser','options','raw','attributes','limit','include','map','model','then','ShowUser','User','find','where','PauseUser','name','interface','update','MemberReport','findAll','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','fax','sms','openchannel','set','Pause','push','all','LogoutUser','LoginUser','mobile','phone','internal','count','../../config/license/util','getLicense','agents','destroy','getVoiceQueues','loginInPause','LOGIN','callysquare','merge','LOGININPAUSE','concat','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./user.socket','register','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x809b,0x9e));var _0xb809=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x809b[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require(_0xb809('0x0'));var moment=require(_0xb809('0x1'));var BPromise=require(_0xb809('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb809('0x3'));var db=require(_0xb809('0x4'))['db'];var utils=require(_0xb809('0x5'));var logger=require(_0xb809('0x6'))(_0xb809('0x7'));var config=require(_0xb809('0x8'));var jayson=require(_0xb809('0x9'));var client=jayson[_0xb809('0xa')][_0xb809('0xb')]({'port':0x232a});config[_0xb809('0xc')]=_[_0xb809('0xd')](config['redis'],{'host':_0xb809('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb809('0xf'))[_0xb809('0x10')](socket);function respondWithRpcPromise(_0x349729,_0x202da4,_0x5958ad){return new BPromise(function(_0x173d5e,_0x2ddb6a){return client['request'](_0x349729,_0x5958ad)['then'](function(_0x43536b){logger[_0xb809('0x11')](_0xb809('0x12'),_0x202da4,_0xb809('0x13'));logger[_0xb809('0x14')](_0xb809('0x15'),_0x202da4,_0xb809('0x13'),JSON[_0xb809('0x16')](_0x43536b));if(_0x43536b['error']){if(_0x43536b[_0xb809('0x17')][_0xb809('0x18')]===0x1f4){logger['error'](_0xb809('0x12'),_0x202da4,_0x43536b['error'][_0xb809('0x19')]);return _0x2ddb6a(_0x43536b[_0xb809('0x17')][_0xb809('0x19')]);}logger[_0xb809('0x17')](_0xb809('0x12'),_0x202da4,_0x43536b[_0xb809('0x17')][_0xb809('0x19')]);return _0x173d5e(_0x43536b[_0xb809('0x17')][_0xb809('0x19')]);}else{logger[_0xb809('0x11')](_0xb809('0x12'),_0x202da4,_0xb809('0x13'));_0x173d5e(_0x43536b[_0xb809('0x1a')][_0xb809('0x19')]);}})[_0xb809('0x1b')](function(_0x50694b){logger[_0xb809('0x17')](_0xb809('0x12'),_0x202da4,_0x50694b);_0x2ddb6a(_0x50694b);});});}exports[_0xb809('0x1c')]=function(_0x7f5d88){var _0x269e82=this;return new Promise(function(_0x475ccc,_0x46f07f){return db['User']['findAll']({'raw':_0x7f5d88[_0xb809('0x1d')]?_0x7f5d88['options'][_0xb809('0x1e')]===undefined?!![]:![]:!![],'where':_0x7f5d88[_0xb809('0x1d')]?_0x7f5d88[_0xb809('0x1d')]['where']||null:null,'attributes':_0x7f5d88[_0xb809('0x1d')]?_0x7f5d88['options'][_0xb809('0x1f')]||null:null,'limit':_0x7f5d88[_0xb809('0x1d')]?_0x7f5d88[_0xb809('0x1d')][_0xb809('0x20')]||null:null,'include':_0x7f5d88[_0xb809('0x1d')]?_0x7f5d88[_0xb809('0x1d')][_0xb809('0x21')]?_[_0xb809('0x22')](_0x7f5d88[_0xb809('0x1d')]['include'],function(_0x3d113c){return{'model':db[_0x3d113c[_0xb809('0x23')]],'as':_0x3d113c['as'],'attributes':_0x3d113c[_0xb809('0x1f')],'include':_0x3d113c[_0xb809('0x21')]?_[_0xb809('0x22')](_0x3d113c['include'],function(_0x58ed9f){return{'model':db[_0x58ed9f[_0xb809('0x23')]],'as':_0x58ed9f['as'],'attributes':_0x58ed9f[_0xb809('0x1f')],'include':_0x58ed9f['include']?_[_0xb809('0x22')](_0x58ed9f[_0xb809('0x21')],function(_0x20f45b){return{'model':db[_0x20f45b[_0xb809('0x23')]],'as':_0x20f45b['as'],'attributes':_0x20f45b[_0xb809('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb809('0x24')](function(_0xe381d4){logger['info'](_0xb809('0x1c'),_0x7f5d88);logger[_0xb809('0x14')]('GetUser',_0x7f5d88,JSON[_0xb809('0x16')](_0xe381d4));_0x475ccc(_0xe381d4);})[_0xb809('0x1b')](function(_0x1b0975){logger['error']('GetUser',_0x1b0975[_0xb809('0x19')],_0x7f5d88);_0x46f07f(_0x269e82['error'](0x1f4,_0x1b0975['message']));});});};exports[_0xb809('0x25')]=function(_0x11efc2){var _0x4f8b59=this;return new Promise(function(_0x443643,_0x193377){return db[_0xb809('0x26')][_0xb809('0x27')]({'raw':_0x11efc2[_0xb809('0x1d')]?_0x11efc2[_0xb809('0x1d')][_0xb809('0x1e')]===undefined?!![]:![]:!![],'where':_0x11efc2[_0xb809('0x1d')]?_0x11efc2[_0xb809('0x1d')][_0xb809('0x28')]||null:null,'attributes':_0x11efc2['options']?_0x11efc2['options'][_0xb809('0x1f')]||null:null,'include':_0x11efc2['options']?_0x11efc2[_0xb809('0x1d')][_0xb809('0x21')]?_['map'](_0x11efc2[_0xb809('0x1d')][_0xb809('0x21')],function(_0x5d8b8d){return{'model':db[_0x5d8b8d[_0xb809('0x23')]],'as':_0x5d8b8d['as'],'attributes':_0x5d8b8d[_0xb809('0x1f')],'include':_0x5d8b8d[_0xb809('0x21')]?_[_0xb809('0x22')](_0x5d8b8d['include'],function(_0x2af964){return{'model':db[_0x2af964[_0xb809('0x23')]],'as':_0x2af964['as'],'attributes':_0x2af964['attributes'],'include':_0x2af964[_0xb809('0x21')]?_[_0xb809('0x22')](_0x2af964[_0xb809('0x21')],function(_0x1b15f5){return{'model':db[_0x1b15f5[_0xb809('0x23')]],'as':_0x1b15f5['as'],'attributes':_0x1b15f5[_0xb809('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37235a){logger[_0xb809('0x11')]('ShowUser',_0x11efc2);logger[_0xb809('0x14')]('ShowUser',_0x11efc2,JSON[_0xb809('0x16')](_0x37235a));_0x443643(_0x37235a);})['catch'](function(_0x3b244c){logger[_0xb809('0x17')](_0xb809('0x25'),_0x3b244c['message'],_0x11efc2);_0x193377(_0x4f8b59['error'](0x1f4,_0x3b244c[_0xb809('0x19')]));});});};exports[_0xb809('0x29')]=function(_0x27fadf){var _0x39e31d=this;return new Promise(function(_0x2f4502,_0x4ca08b){var _0x2fb2fb;return db[_0xb809('0x26')][_0xb809('0x27')]({'where':_0x27fadf[_0xb809('0x1d')][_0xb809('0x28')]||{},'attributes':['id',_0xb809('0x2a'),'role','internal',_0xb809('0x2b')]})['then'](function(_0x1153a7){if(_0x1153a7){_0x2fb2fb=_0x1153a7;return db['UserVoiceQueueRt'][_0xb809('0x2c')]({'paused':0x1},{'where':{'UserId':_0x2fb2fb['id']},'individualHooks':!![]});}})[_0xb809('0x24')](function(){if(_0x2fb2fb){return db[_0xb809('0x2d')][_0xb809('0x2e')]({'where':{'membername':_0x2fb2fb[_0xb809('0x2a')],'type':_0xb809('0x2f'),'exitAt':null}});}})[_0xb809('0x24')](function(_0x534da5){if(_0x2fb2fb){if(_0x534da5&&_0x534da5[_0xb809('0x30')]){var _0x58558b=moment()[_0xb809('0x31')](_0xb809('0x32'));for(var _0x4077fe=0x0,_0x32e4fe=_0x534da5['length'];_0x4077fe<_0x32e4fe;_0x4077fe++){_0x534da5[_0x4077fe]['updateAttributes']({'exitAt':_0x58558b});}}}})['then'](function(){if(_0x2fb2fb){var _0x21780b=[];var _0x38c501=utils[_0xb809('0x33')]();_0x38c501[_0xb809('0x34')](function(_0x489526){_0x21780b['push']({'channel':_0x489526,'membername':_0x2fb2fb[_0xb809('0x2a')],'interface':_['isNil'](_0x2fb2fb[_0xb809('0x2b')])?util['format'](_0xb809('0x35'),_0x2fb2fb['name']):_0x2fb2fb['interface'],'type':_0xb809('0x2f'),'enterAt':moment()[_0xb809('0x31')](_0xb809('0x32')),'data1':_0x27fadf[_0xb809('0x36')][_0xb809('0x37')]||_0xb809('0x38'),'role':_0x2fb2fb['role'],'internal':_0x2fb2fb['internal'],'uniqueid':_0x27fadf[_0xb809('0x36')][_0xb809('0x39')]||null});});return db['MemberReport'][_0xb809('0x3a')](_0x21780b,{'individualHooks':!![]});}})[_0xb809('0x24')](function(){if(_0x2fb2fb){return _0x2fb2fb[_0xb809('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x27fadf[_0xb809('0x36')][_0xb809('0x37')]||_0xb809('0x38'),'lastPauseAt':moment()[_0xb809('0x31')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xb809('0x24')](function(_0x5b8d3d){_0x2f4502(_0x5b8d3d);})[_0xb809('0x1b')](function(_0x4ae5b5){_0x4ca08b(_0x39e31d[_0xb809('0x17')](0x1f4,_0x4ae5b5['message']));});});};exports['UnpauseUser']=function(_0x5aca5a){var _0x338630=this;return new Promise(function(_0xd7e66b,_0x26aa0b){var _0x3bf2cb;return db['User'][_0xb809('0x3b')]({'where':_0x5aca5a[_0xb809('0x1d')]['where']||{},'attributes':['id',_0xb809('0x2a')]})[_0xb809('0x24')](function(_0x55e248){if(_0x55e248){_0x3bf2cb=_0x55e248;if(_0x5aca5a['body'][_0xb809('0x3c')]&&!utils[_0xb809('0x3d')](_0x5aca5a[_0xb809('0x36')]['channel'])){throw new Error(_0xb809('0x3e'));}switch(_0x5aca5a[_0xb809('0x36')]['channel']){case _0xb809('0x3f'):return db[_0xb809('0x40')][_0xb809('0x2c')]({'paused':0x0},{'where':{'UserId':_0x3bf2cb['id']}})['then'](function(){return db[_0xb809('0x2d')][_0xb809('0x27')]({'where':{'channel':_0x5aca5a['body'][_0xb809('0x3c')],'membername':_0x3bf2cb[_0xb809('0x2a')],'type':_0xb809('0x2f'),'exitAt':null}});})[_0xb809('0x24')](function(_0xae1e77){if(_0xae1e77){return _0xae1e77[_0xb809('0x2c')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xb809('0x41')},{'individualHooks':!![]});}return null;})[_0xb809('0x24')](function(){return _0x3bf2cb[_0xb809('0x2c')]({'voicePause':![]});});case _0xb809('0x42'):case'chat':case _0xb809('0x43'):case _0xb809('0x44'):case _0xb809('0x45'):case'whatsapp':return db[_0xb809('0x2d')][_0xb809('0x27')]({'where':{'channel':_0x5aca5a['body']['channel'],'membername':_0x3bf2cb[_0xb809('0x2a')],'type':_0xb809('0x2f'),'exitAt':null}})[_0xb809('0x24')](function(_0x4fc4fc){return _0x4fc4fc['update']({'exitAt':moment()[_0xb809('0x31')](_0xb809('0x32')),'data2':_0xb809('0x41')},{'individualHooks':!![]});})[_0xb809('0x24')](function(){var _0x114895={};_[_0xb809('0x46')](_0x114895,util[_0xb809('0x31')]('%s%s',_0x5aca5a[_0xb809('0x36')][_0xb809('0x3c')],_0xb809('0x47')),![]);return _0x3bf2cb['update'](_0x114895);});default:return db[_0xb809('0x40')][_0xb809('0x2c')]({'paused':0x0},{'where':{'UserId':_0x3bf2cb['id']}})[_0xb809('0x24')](function(){return db[_0xb809('0x2d')][_0xb809('0x2e')]({'where':{'membername':_0x3bf2cb['name'],'type':_0xb809('0x2f'),'exitAt':null}});})[_0xb809('0x24')](function(_0x107310){var _0x452fbc=[];_0x107310['forEach'](function(_0x5e55c3){_0x452fbc[_0xb809('0x48')](_0x5e55c3[_0xb809('0x2c')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xb809('0x41')}));});return BPromise[_0xb809('0x49')](_0x452fbc);})['then'](function(){return _0x3bf2cb[_0xb809('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xb809('0x24')](function(_0x1411ed){_0xd7e66b(_0x1411ed);})['catch'](function(_0xacffd3){_0x26aa0b(_0x338630[_0xb809('0x17')](0x1f4,_0xacffd3[_0xb809('0x19')]));});});};exports[_0xb809('0x4a')]=function(_0x356e51){var _0x1450bf=this;return new Promise(function(_0x2bbd88,_0x1c5147){var _0x58fc63;return db[_0xb809('0x26')][_0xb809('0x3b')]({'where':_0x356e51[_0xb809('0x1d')][_0xb809('0x28')]||{},'attributes':['id',_0xb809('0x2a')]})['then'](function(_0x1234e6){if(_0x1234e6){_0x58fc63=_0x1234e6;return db[_0xb809('0x40')]['destroy']({'where':{'membername':_0x58fc63[_0xb809('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x58fc63){return db['MemberReport'][_0xb809('0x2e')]({'where':{'membername':_0x58fc63[_0xb809('0x2a')],'exitAt':null}});}})[_0xb809('0x24')](function(_0xeb5409){if(_0x58fc63){if(_0xeb5409&&_0xeb5409[_0xb809('0x30')]){var _0x26fbcb=[];_0xeb5409[_0xb809('0x34')](function(_0x5b1292){_0x26fbcb[_0xb809('0x48')](_0x5b1292[_0xb809('0x2c')]({'exitAt':moment()[_0xb809('0x31')](_0xb809('0x32'))}));});return BPromise['all'](_0x26fbcb);}}})[_0xb809('0x24')](function(){if(_0x58fc63){return _0x58fc63['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x164623){_0x2bbd88(_0x164623);})[_0xb809('0x1b')](function(_0x29ad6d){_0x1c5147(_0x1450bf[_0xb809('0x17')](0x1f4,_0x29ad6d[_0xb809('0x19')]));});});};exports[_0xb809('0x4b')]=function(_0x24ed98){var _0x4abe43=this;return new Promise(function(_0x460b4a,_0x40180a){var _0x1528fc;var _0x1b7f3d;var _0x4b2574;var _0x297af0;return db[_0xb809('0x26')]['findOne']({'where':_0x24ed98[_0xb809('0x1d')]['where']||{},'attributes':['id',_0xb809('0x2a'),'role',_0xb809('0x4c'),_0xb809('0x4d'),_0xb809('0x4e'),'loginInPause',_0xb809('0x2b')]})[_0xb809('0x24')](function(_0x3b5a9d){if(_0x3b5a9d){_0x1528fc=_0x3b5a9d;_0x297af0=_0x24ed98[_0xb809('0x36')]['interface']?_0x24ed98[_0xb809('0x36')][_0xb809('0x2b')]:util[_0xb809('0x31')]('SIP/%s',_0x1528fc['name']);return db[_0xb809('0x26')][_0xb809('0x4f')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1528fc['id']}}});}})[_0xb809('0x24')](function(_0x4ae34b){if(_0x4ae34b){_0x4b2574=_0x4ae34b;return require(_0xb809('0x50'))[_0xb809('0x51')]();}})[_0xb809('0x24')](function(_0x4ed7b0){if(_0x4ed7b0&&_0x4ed7b0[_0xb809('0x52')]&&_0x4b2574>=_0x4ed7b0['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xb809('0x24')](function(){if(_0x1528fc){return db[_0xb809('0x40')][_0xb809('0x53')]({'where':{'membername':_0x1528fc[_0xb809('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x1528fc){return _0x1528fc[_0xb809('0x54')]({'raw':!![]});}})[_0xb809('0x24')](function(_0x376c35){if(_0x1528fc){if(_0x376c35){var _0x50677c=[];_0x1b7f3d=_0x376c35;if(_0x1b7f3d[_0xb809('0x30')]){for(var _0x165eb6=0x0;_0x165eb6<_0x1b7f3d[_0xb809('0x30')];_0x165eb6++){_0x50677c[_0xb809('0x48')](db['UserVoiceQueueRt']['upsert']({'membername':_0x1528fc[_0xb809('0x2a')],'UserId':_0x1528fc['id'],'queue_name':_0x1b7f3d[_0x165eb6]['name'],'VoiceQueueId':_0x1b7f3d[_0x165eb6]['id'],'interface':_0x297af0,'paused':_0x1528fc[_0xb809('0x55')]||![],'penalty':_0x1b7f3d[_0x165eb6]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xb809('0x49')](_0x50677c);}}}})[_0xb809('0x24')](function(){if(_0x1528fc){return db[_0xb809('0x2d')]['findAll']({'where':{'membername':_0x1528fc[_0xb809('0x2a')],'exitAt':null}});}})[_0xb809('0x24')](function(_0x4046f7){if(_0x1528fc){if(_0x4046f7&&_0x4046f7[_0xb809('0x30')]){var _0x218141=[];_0x4046f7[_0xb809('0x34')](function(_0x16e129){_0x218141['push'](_0x16e129[_0xb809('0x2c')]({'exitAt':moment()[_0xb809('0x31')](_0xb809('0x32'))}));});return BPromise[_0xb809('0x49')](_0x218141);}}})[_0xb809('0x24')](function(_0x3908db){if(_0x1528fc){var _0x4821a9=[];var _0x2465d0=[];var _0x108e5e=utils['getChannels']();var _0x1d2e2a={'membername':_0x1528fc['name'],'interface':_0x297af0,'enterAt':moment()[_0xb809('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x1528fc['role'],'internal':_0x1528fc[_0xb809('0x4e')]};_0x108e5e[_0xb809('0x34')](function(_0x1409fe){_0x4821a9[_0xb809('0x48')](_['merge']({'channel':_0x1409fe,'type':_0xb809('0x56'),'data1':_0xb809('0x57'),'data2':_0x297af0},_0x1d2e2a));if(_0x1528fc['loginInPause']){_0x2465d0[_0xb809('0x48')](_[_0xb809('0x58')]({'channel':_0x1409fe,'type':_0xb809('0x2f'),'data1':_0xb809('0x59')},_0x1d2e2a));}});return db['MemberReport'][_0xb809('0x3a')](_0x4821a9[_0xb809('0x5a')](_0x2465d0),{'individualHooks':!![]});}})[_0xb809('0x24')](function(){if(_0x1528fc){return _0x1528fc[_0xb809('0x2c')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x1528fc[_0xb809('0x55')]||![],'mailPause':_0x1528fc[_0xb809('0x55')]||![],'chatPause':_0x1528fc['loginInPause']||![],'faxPause':_0x1528fc[_0xb809('0x55')]||![],'smsPause':_0x1528fc[_0xb809('0x55')]||![],'openchannelPause':_0x1528fc['loginInPause']||![],'pauseType':_0x1528fc[_0xb809('0x55')]?_0xb809('0x59'):null,'lastPauseAt':moment()[_0xb809('0x31')](_0xb809('0x32')),'interface':_0x297af0});}})[_0xb809('0x24')](function(_0x181ef7){_0x460b4a(_0x181ef7);})[_0xb809('0x1b')](function(_0x4c3d3e){_0x40180a(_0x4abe43[_0xb809('0x17')](0x1f4,_0x4c3d3e[_0xb809('0x19')]));});});};
\ No newline at end of file
index 2a416ea..fcefdf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb624=['emit','removeListener','register','length','user:','save','remove','update'];(function(_0x9363c8,_0x4beb6a){var _0x54a754=function(_0x53428c){while(--_0x53428c){_0x9363c8['push'](_0x9363c8['shift']());}};_0x54a754(++_0x4beb6a);}(_0xb624,0x135));var _0x4b62=function(_0x3d9557,_0x5d09d2){_0x3d9557=_0x3d9557-0x0;var _0x359ff8=_0xb624[_0x3d9557];return _0x359ff8;};'use strict';var UserEvents=require('./user.events');var events=[_0x4b62('0x0'),_0x4b62('0x1'),_0x4b62('0x2')];function createListener(_0xf11973,_0xf2fba6){return function(_0x547917){_0xf2fba6[_0x4b62('0x3')](_0xf11973,_0x547917);};}function removeListener(_0x3926a3,_0x3f50ac){return function(){UserEvents[_0x4b62('0x4')](_0x3926a3,_0x3f50ac);};}exports[_0x4b62('0x5')]=function(_0x57b5fc){for(var _0x155ce1=0x0,_0x2f64a0=events[_0x4b62('0x6')];_0x155ce1<_0x2f64a0;_0x155ce1++){var _0x373868=events[_0x155ce1];var _0x251e5b=createListener(_0x4b62('0x7')+_0x373868,_0x57b5fc);UserEvents['on'](_0x373868,_0x251e5b);}};
\ No newline at end of file
+var _0x0c50=['register','length','./user.events','save','remove','emit','removeListener'];(function(_0x266bc7,_0x77d82b){var _0x21b9ae=function(_0x3ad9ba){while(--_0x3ad9ba){_0x266bc7['push'](_0x266bc7['shift']());}};_0x21b9ae(++_0x77d82b);}(_0x0c50,0xe9));var _0x00c5=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x0c50[_0x46aff0];return _0x9d78cf;};'use strict';var UserEvents=require(_0x00c5('0x0'));var events=[_0x00c5('0x1'),_0x00c5('0x2'),'update'];function createListener(_0x44f30b,_0x33d585){return function(_0x5d2581){_0x33d585[_0x00c5('0x3')](_0x44f30b,_0x5d2581);};}function removeListener(_0x4bfac3,_0x597e50){return function(){UserEvents[_0x00c5('0x4')](_0x4bfac3,_0x597e50);};}exports[_0x00c5('0x5')]=function(_0x4ec342){for(var _0x4d5264=0x0,_0x1270f4=events[_0x00c5('0x6')];_0x4d5264<_0x1270f4;_0x4d5264++){var _0x491731=events[_0x4d5264];var _0x101f90=createListener('user:'+_0x491731,_0x4ec342);UserEvents['on'](_0x491731,_0x101f90);}};
\ No newline at end of file
index 20c3c99..7f9a60a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x24d22f,_0xfa6241){var _0x33b153=function(_0x28caa6){while(--_0x28caa6){_0x24d22f['push'](_0x24d22f['shift']());}};_0x33b153(++_0xfa6241);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4a11ea,_0x2ac9df){var _0x2964fd=function(_0x4868d7){while(--_0x4868d7){_0x4a11ea['push'](_0x4a11ea['shift']());}};_0x2964fd(++_0x2ac9df);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0xcb91[_0xd9f102];return _0x2652e4;};'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 ee36b11..e1779da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc82=['sequelize'];(function(_0x728945,_0x220dfd){var _0x39971b=function(_0x157244){while(--_0x157244){_0x728945['push'](_0x728945['shift']());}};_0x39971b(++_0x220dfd);}(_0xbc82,0x13e));var _0x2bc8=function(_0x2a92cb,_0x5c8805){_0x2a92cb=_0x2a92cb-0x0;var _0x156f80=_0xbc82[_0x2a92cb];return _0x156f80;};'use strict';var Sequelize=require(_0x2bc8('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbfec=['sequelize','exports','INTEGER'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xbfec,0x1b3));var _0xcbfe=function(_0x521cad,_0x54a0a6){_0x521cad=_0x521cad-0x0;var _0x314fa9=_0xbfec[_0x521cad];return _0x314fa9;};'use strict';var Sequelize=require(_0xcbfe('0x0'));module[_0xcbfe('0x1')]={'penalty':{'type':Sequelize[_0xcbfe('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 5228269..d478c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7990=['path','../../config/environment','define','user_has_chat_queues','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x9041e6,_0x52788a){var _0x3d7b82=function(_0x40df10){while(--_0x40df10){_0x9041e6['push'](_0x9041e6['shift']());}};_0x3d7b82(++_0x52788a);}(_0x7990,0x1bd));var _0x0799=function(_0x45aafb,_0x239e30){_0x45aafb=_0x45aafb-0x0;var _0x339e54=_0x7990[_0x45aafb];return _0x339e54;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0799('0x0'))(_0x0799('0x1'));var moment=require(_0x0799('0x2'));var BPromise=require(_0x0799('0x3'));var rp=require(_0x0799('0x4'));var fs=require('fs');var path=require(_0x0799('0x5'));var rimraf=require('rimraf');var config=require(_0x0799('0x6'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x5933b9,_0x4d86d1){return _0x5933b9[_0x0799('0x7')]('UserChatQueue',attributes,{'tableName':_0x0799('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd36b=['exports','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','./userChatQueue.attributes'];(function(_0x36e5fe,_0x425955){var _0x3cded9=function(_0x46615b){while(--_0x46615b){_0x36e5fe['push'](_0x36e5fe['shift']());}};_0x3cded9(++_0x425955);}(_0xd36b,0x13c));var _0xbd36=function(_0x482903,_0x5370e3){_0x482903=_0x482903-0x0;var _0x267211=_0xd36b[_0x482903];return _0x267211;};'use strict';var _=require('lodash');var util=require(_0xbd36('0x0'));var logger=require(_0xbd36('0x1'))(_0xbd36('0x2'));var moment=require(_0xbd36('0x3'));var BPromise=require(_0xbd36('0x4'));var rp=require(_0xbd36('0x5'));var fs=require('fs');var path=require(_0xbd36('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbd36('0x7'));module[_0xbd36('0x8')]=function(_0x2b8816,_0x46905d){return _0x2b8816[_0xbd36('0x9')](_0xbd36('0xa'),attributes,{'tableName':_0xbd36('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6065b66..f590fe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27da=['../../config/environment','jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x1c537c,_0x9c16d3){var _0x3ece19=function(_0x232b5a){while(--_0x232b5a){_0x1c537c['push'](_0x1c537c['shift']());}};_0x3ece19(++_0x9c16d3);}(_0x27da,0x82));var _0xa27d=function(_0x42f42f,_0x261e3c){_0x42f42f=_0x42f42f-0x0;var _0x2113d7=_0x27da[_0x42f42f];return _0x2113d7;};'use strict';var _=require(_0xa27d('0x0'));var util=require(_0xa27d('0x1'));var moment=require(_0xa27d('0x2'));var BPromise=require(_0xa27d('0x3'));var rs=require(_0xa27d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa27d('0x5'));var logger=require(_0xa27d('0x6'))(_0xa27d('0x7'));var config=require(_0xa27d('0x8'));var jayson=require(_0xa27d('0x9'));var client=jayson[_0xa27d('0xa')][_0xa27d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53b90c,_0x48e05a,_0x1accf4){return new BPromise(function(_0xd99343,_0x737399){return client['request'](_0x53b90c,_0x1accf4)[_0xa27d('0xc')](function(_0xa5d698){logger[_0xa27d('0xd')](_0xa27d('0xe'),_0x48e05a,_0xa27d('0xf'));logger[_0xa27d('0x10')](_0xa27d('0x11'),_0x48e05a,_0xa27d('0xf'),JSON[_0xa27d('0x12')](_0xa5d698));if(_0xa5d698[_0xa27d('0x13')]){if(_0xa5d698['error'][_0xa27d('0x14')]===0x1f4){logger[_0xa27d('0x13')](_0xa27d('0xe'),_0x48e05a,_0xa5d698[_0xa27d('0x13')]['message']);return _0x737399(_0xa5d698[_0xa27d('0x13')]['message']);}logger[_0xa27d('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x48e05a,_0xa5d698[_0xa27d('0x13')][_0xa27d('0x15')]);return _0xd99343(_0xa5d698[_0xa27d('0x13')][_0xa27d('0x15')]);}else{logger[_0xa27d('0xd')](_0xa27d('0xe'),_0x48e05a,_0xa27d('0xf'));_0xd99343(_0xa5d698['result'][_0xa27d('0x15')]);}})[_0xa27d('0x16')](function(_0xc8353e){logger[_0xa27d('0x13')](_0xa27d('0xe'),_0x48e05a,_0xc8353e);_0x737399(_0xc8353e);});});}
\ No newline at end of file
+var _0x7fdb=['info','request\x20sent','debug','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x57f87f,_0x37fdc0){var _0x2b9fe9=function(_0x5adf04){while(--_0x5adf04){_0x57f87f['push'](_0x57f87f['shift']());}};_0x2b9fe9(++_0x37fdc0);}(_0x7fdb,0x9c));var _0xb7fd=function(_0x3c307c,_0x1b06c4){_0x3c307c=_0x3c307c-0x0;var _0x32cf08=_0x7fdb[_0x3c307c];return _0x32cf08;};'use strict';var _=require('lodash');var util=require(_0xb7fd('0x0'));var moment=require(_0xb7fd('0x1'));var BPromise=require(_0xb7fd('0x2'));var rs=require(_0xb7fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7fd('0x4'))['db'];var utils=require(_0xb7fd('0x5'));var logger=require(_0xb7fd('0x6'))(_0xb7fd('0x7'));var config=require(_0xb7fd('0x8'));var jayson=require(_0xb7fd('0x9'));var client=jayson[_0xb7fd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xce7340,_0x1d9cba,_0x58301d){return new BPromise(function(_0x46d36a,_0x1fb8b4){return client[_0xb7fd('0xb')](_0xce7340,_0x58301d)['then'](function(_0x36913d){logger[_0xb7fd('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x1d9cba,_0xb7fd('0xd'));logger[_0xb7fd('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1d9cba,_0xb7fd('0xd'),JSON['stringify'](_0x36913d));if(_0x36913d[_0xb7fd('0xf')]){if(_0x36913d['error'][_0xb7fd('0x10')]===0x1f4){logger['error'](_0xb7fd('0x11'),_0x1d9cba,_0x36913d['error'][_0xb7fd('0x12')]);return _0x1fb8b4(_0x36913d[_0xb7fd('0xf')]['message']);}logger['error'](_0xb7fd('0x11'),_0x1d9cba,_0x36913d[_0xb7fd('0xf')][_0xb7fd('0x12')]);return _0x46d36a(_0x36913d[_0xb7fd('0xf')][_0xb7fd('0x12')]);}else{logger[_0xb7fd('0xc')](_0xb7fd('0x11'),_0x1d9cba,_0xb7fd('0xd'));_0x46d36a(_0x36913d[_0xb7fd('0x13')]['message']);}})[_0xb7fd('0x14')](function(_0x605b7f){logger[_0xb7fd('0xf')](_0xb7fd('0x11'),_0x1d9cba,_0x605b7f);_0x1fb8b4(_0x605b7f);});});}
\ No newline at end of file
index f3e14ba..50a765f 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(_0x4f3272,_0x5cbecc){var _0xcdf61f=function(_0x2ce9ad){while(--_0x2ce9ad){_0x4f3272['push'](_0x4f3272['shift']());}};_0xcdf61f(++_0x5cbecc);}(_0xe706,0xa3));var _0x6e70=function(_0xc0be57,_0x2d1e96){_0xc0be57=_0xc0be57-0x0;var _0x2d786d=_0xe706[_0xc0be57];return _0x2d786d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x295321,_0x1a7a3d){var _0x2a86eb=function(_0x41fcc7){while(--_0x41fcc7){_0x295321['push'](_0x295321['shift']());}};_0x2a86eb(++_0x1a7a3d);}(_0xedd9,0xfc));var _0x9edd=function(_0x46e2d8,_0x332714){_0x46e2d8=_0x46e2d8-0x0;var _0x1cebfb=_0xedd9[_0x46e2d8];return _0x1cebfb;};'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 cb3e691..f9a2e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f30=['INTEGER','sequelize','exports'];(function(_0x181826,_0x2e1c94){var _0x492e69=function(_0xcd7b01){while(--_0xcd7b01){_0x181826['push'](_0x181826['shift']());}};_0x492e69(++_0x2e1c94);}(_0x0f30,0xf7));var _0x00f3=function(_0x1d3d1a,_0x2a3dde){_0x1d3d1a=_0x1d3d1a-0x0;var _0x4bc3ad=_0x0f30[_0x1d3d1a];return _0x4bc3ad;};'use strict';var Sequelize=require(_0x00f3('0x0'));module[_0x00f3('0x1')]={'penalty':{'type':Sequelize[_0x00f3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x00f3('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x684e=['INTEGER','STRING','sequelize','exports'];(function(_0x303f17,_0x4f8d86){var _0x3107f7=function(_0x2d6763){while(--_0x2d6763){_0x303f17['push'](_0x303f17['shift']());}};_0x3107f7(++_0x4f8d86);}(_0x684e,0x10a));var _0xe684=function(_0x5a2d5d,_0x143db8){_0x5a2d5d=_0x5a2d5d-0x0;var _0x1e41f5=_0x684e[_0x5a2d5d];return _0x1e41f5;};'use strict';var Sequelize=require(_0xe684('0x0'));module[_0xe684('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xe684('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xe684('0x3')]}};
\ No newline at end of file
index 92966ca..144b549 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3da3=['rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment'];(function(_0x9dba4,_0xb8724f){var _0x148aa8=function(_0x2c2403){while(--_0x2c2403){_0x9dba4['push'](_0x9dba4['shift']());}};_0x148aa8(++_0xb8724f);}(_0x3da3,0xdd));var _0x33da=function(_0x3e7ff6,_0x5288ad){_0x3e7ff6=_0x3e7ff6-0x0;var _0xf0ffc8=_0x3da3[_0x3e7ff6];return _0xf0ffc8;};'use strict';var _=require(_0x33da('0x0'));var util=require(_0x33da('0x1'));var logger=require(_0x33da('0x2'))('api');var moment=require(_0x33da('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x33da('0x4'));var config=require('../../config/environment');var attributes=require(_0x33da('0x5'));module[_0x33da('0x6')]=function(_0x549a5d,_0x223f71){return _0x549a5d['define'](_0x33da('0x7'),attributes,{'tableName':_0x33da('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c3f=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues'];(function(_0x4cac5b,_0x4aa6fe){var _0x42f947=function(_0x58b29e){while(--_0x58b29e){_0x4cac5b['push'](_0x4cac5b['shift']());}};_0x42f947(++_0x4aa6fe);}(_0x1c3f,0x1bc));var _0xf1c3=function(_0x53b05c,_0x40dc18){_0x53b05c=_0x53b05c-0x0;var _0x1f6a0a=_0x1c3f[_0x53b05c];return _0x1f6a0a;};'use strict';var _=require(_0xf1c3('0x0'));var util=require(_0xf1c3('0x1'));var logger=require('../../config/logger')(_0xf1c3('0x2'));var moment=require(_0xf1c3('0x3'));var BPromise=require(_0xf1c3('0x4'));var rp=require(_0xf1c3('0x5'));var fs=require('fs');var path=require(_0xf1c3('0x6'));var rimraf=require(_0xf1c3('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1c3('0x8'));module[_0xf1c3('0x9')]=function(_0x4e8385,_0x58546a){return _0x4e8385['define'](_0xf1c3('0xa'),attributes,{'tableName':_0xf1c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1c8ff11..6a144fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6429=['error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x6429,0x1d2));var _0x9642=function(_0x1d537c,_0x2b834d){_0x1d537c=_0x1d537c-0x0;var _0x184fb9=_0x6429[_0x1d537c];return _0x184fb9;};'use strict';var _=require(_0x9642('0x0'));var util=require(_0x9642('0x1'));var moment=require(_0x9642('0x2'));var BPromise=require(_0x9642('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9642('0x4'));var db=require(_0x9642('0x5'))['db'];var utils=require(_0x9642('0x6'));var logger=require('../../config/logger')(_0x9642('0x7'));var config=require('../../config/environment');var jayson=require(_0x9642('0x8'));var client=jayson['client'][_0x9642('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13e244,_0x4cfa82,_0x3f487c){return new BPromise(function(_0x187ce7,_0x51eed3){return client['request'](_0x13e244,_0x3f487c)[_0x9642('0xa')](function(_0x5eee82){logger[_0x9642('0xb')](_0x9642('0xc'),_0x4cfa82,'request\x20sent');logger[_0x9642('0xd')](_0x9642('0xe'),_0x4cfa82,_0x9642('0xf'),JSON[_0x9642('0x10')](_0x5eee82));if(_0x5eee82[_0x9642('0x11')]){if(_0x5eee82['error']['code']===0x1f4){logger['error'](_0x9642('0xc'),_0x4cfa82,_0x5eee82[_0x9642('0x11')][_0x9642('0x12')]);return _0x51eed3(_0x5eee82['error'][_0x9642('0x12')]);}logger['error'](_0x9642('0xc'),_0x4cfa82,_0x5eee82[_0x9642('0x11')][_0x9642('0x12')]);return _0x187ce7(_0x5eee82[_0x9642('0x11')][_0x9642('0x12')]);}else{logger[_0x9642('0xb')](_0x9642('0xc'),_0x4cfa82,_0x9642('0xf'));_0x187ce7(_0x5eee82[_0x9642('0x13')]['message']);}})[_0x9642('0x14')](function(_0x4c2e41){logger[_0x9642('0x11')](_0x9642('0xc'),_0x4cfa82,_0x4c2e41);_0x51eed3(_0x4c2e41);});});}
\ No newline at end of file
+var _0x5266=['result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserFaxQueue,\x20%s,\x20%s','message'];(function(_0x3d1b08,_0x5cb481){var _0x45932b=function(_0x471b9d){while(--_0x471b9d){_0x3d1b08['push'](_0x3d1b08['shift']());}};_0x45932b(++_0x5cb481);}(_0x5266,0x94));var _0x6526=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x5266[_0x43a37c];return _0x5d1d40;};'use strict';var _=require(_0x6526('0x0'));var util=require(_0x6526('0x1'));var moment=require(_0x6526('0x2'));var BPromise=require('bluebird');var rs=require(_0x6526('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6526('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6526('0x5'))(_0x6526('0x6'));var config=require(_0x6526('0x7'));var jayson=require(_0x6526('0x8'));var client=jayson[_0x6526('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec91b,_0x28ab55,_0x45e9f7){return new BPromise(function(_0x1c678f,_0x4caae6){return client[_0x6526('0xa')](_0x5ec91b,_0x45e9f7)[_0x6526('0xb')](function(_0x1e0c3a){logger[_0x6526('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x28ab55,'request\x20sent');logger[_0x6526('0xd')](_0x6526('0xe'),_0x28ab55,_0x6526('0xf'),JSON['stringify'](_0x1e0c3a));if(_0x1e0c3a['error']){if(_0x1e0c3a[_0x6526('0x10')][_0x6526('0x11')]===0x1f4){logger[_0x6526('0x10')](_0x6526('0x12'),_0x28ab55,_0x1e0c3a[_0x6526('0x10')][_0x6526('0x13')]);return _0x4caae6(_0x1e0c3a[_0x6526('0x10')][_0x6526('0x13')]);}logger[_0x6526('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x28ab55,_0x1e0c3a['error'][_0x6526('0x13')]);return _0x1c678f(_0x1e0c3a[_0x6526('0x10')][_0x6526('0x13')]);}else{logger[_0x6526('0xc')](_0x6526('0x12'),_0x28ab55,'request\x20sent');_0x1c678f(_0x1e0c3a[_0x6526('0x14')][_0x6526('0x13')]);}})['catch'](function(_0x32bafb){logger['error'](_0x6526('0x12'),_0x28ab55,_0x32bafb);_0x4caae6(_0x32bafb);});});}
\ No newline at end of file
index eed4cfb..ea8543f 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(_0x4c16a0,_0x234c98){var _0x57c3c1=function(_0x2fe0af){while(--_0x2fe0af){_0x4c16a0['push'](_0x4c16a0['shift']());}};_0x57c3c1(++_0x234c98);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1ca346,_0x217e53){var _0x57770d=function(_0x14209b){while(--_0x14209b){_0x1ca346['push'](_0x1ca346['shift']());}};_0x57770d(++_0x217e53);}(_0x70e0,0x17b));var _0x070e=function(_0x2e0449,_0x901160){_0x2e0449=_0x2e0449-0x0;var _0x3629c0=_0x70e0[_0x2e0449];return _0x3629c0;};'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 940ca00..ee4653b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5949=['sequelize','exports'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x5949,0x176));var _0x9594=function(_0x58cbde,_0x4b0f62){_0x58cbde=_0x58cbde-0x0;var _0x5799f3=_0x5949[_0x58cbde];return _0x5799f3;};'use strict';var Sequelize=require(_0x9594('0x0'));module[_0x9594('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc8bd=['sequelize','exports'];(function(_0x1e4cd9,_0x5aca8a){var _0x56700d=function(_0x29b6b3){while(--_0x29b6b3){_0x1e4cd9['push'](_0x1e4cd9['shift']());}};_0x56700d(++_0x5aca8a);}(_0xc8bd,0x1b0));var _0xdc8b=function(_0x3aeea1,_0x4cfbb9){_0x3aeea1=_0x3aeea1-0x0;var _0x424cc1=_0xc8bd[_0x3aeea1];return _0x424cc1;};'use strict';var Sequelize=require(_0xdc8b('0x0'));module[_0xdc8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 618f5b8..1dec07a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35f6=['../../config/environment','exports','define','user_has_mail_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3926de,_0x274789){var _0x3a4e82=function(_0x2d0b07){while(--_0x2d0b07){_0x3926de['push'](_0x3926de['shift']());}};_0x3a4e82(++_0x274789);}(_0x35f6,0x10c));var _0x635f=function(_0x21c75b,_0x28a544){_0x21c75b=_0x21c75b-0x0;var _0x39d1eb=_0x35f6[_0x21c75b];return _0x39d1eb;};'use strict';var _=require('lodash');var util=require(_0x635f('0x0'));var logger=require(_0x635f('0x1'))(_0x635f('0x2'));var moment=require(_0x635f('0x3'));var BPromise=require(_0x635f('0x4'));var rp=require(_0x635f('0x5'));var fs=require('fs');var path=require(_0x635f('0x6'));var rimraf=require(_0x635f('0x7'));var config=require(_0x635f('0x8'));var attributes=require('./userMailQueue.attributes');module[_0x635f('0x9')]=function(_0x1d40b6,_0xa82590){return _0x1d40b6[_0x635f('0xa')]('UserMailQueue',attributes,{'tableName':_0x635f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4735=['rimraf','../../config/environment','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x517724,_0x51e5c0){var _0x4c73a5=function(_0x1a3858){while(--_0x1a3858){_0x517724['push'](_0x517724['shift']());}};_0x4c73a5(++_0x51e5c0);}(_0x4735,0x1ce));var _0x5473=function(_0x4cf61b,_0x3fe192){_0x4cf61b=_0x4cf61b-0x0;var _0x3d15f3=_0x4735[_0x4cf61b];return _0x3d15f3;};'use strict';var _=require(_0x5473('0x0'));var util=require(_0x5473('0x1'));var logger=require(_0x5473('0x2'))('api');var moment=require(_0x5473('0x3'));var BPromise=require(_0x5473('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5473('0x5'));var rimraf=require(_0x5473('0x6'));var config=require(_0x5473('0x7'));var attributes=require(_0x5473('0x8'));module[_0x5473('0x9')]=function(_0x1adf45,_0x4ae5a7){return _0x1adf45[_0x5473('0xa')]('UserMailQueue',attributes,{'tableName':_0x5473('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e84d07a..13b3f7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0x232197,_0x1386ae){var _0x35fa89=function(_0x1491ab){while(--_0x1491ab){_0x232197['push'](_0x232197['shift']());}};_0x35fa89(++_0x1386ae);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0x4b84[_0x1f9f5f];return _0x51d649;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}
\ No newline at end of file
+var _0x7fbe=['request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x541345,_0x2997bd){var _0xa09458=function(_0x2e9af3){while(--_0x2e9af3){_0x541345['push'](_0x541345['shift']());}};_0xa09458(++_0x2997bd);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0x7fbe[_0xdd827a];return _0x2f46f1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
index ee62e2e..9e2db1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x587b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','connect-timeout'];(function(_0x2b31af,_0x2484f7){var _0x45451e=function(_0x283331){while(--_0x283331){_0x2b31af['push'](_0x2b31af['shift']());}};_0x45451e(++_0x2484f7);}(_0x587b,0x97));var _0xb587=function(_0x8bd40b,_0xb27354){_0x8bd40b=_0x8bd40b-0x0;var _0x24946b=_0x587b[_0x8bd40b];return _0x24946b;};'use strict';var multer=require(_0xb587('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb587('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb587('0x2'));var interaction=require(_0xb587('0x3'));var config=require(_0xb587('0x4'));var controller=require(_0xb587('0x5'));router[_0xb587('0x6')]('/',auth[_0xb587('0x7')](),controller['sendUserNotification']);module[_0xb587('0x8')]=router;
\ No newline at end of file
+var _0x57c8=['../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e8ce7,_0x40ef19){var _0x563d95=function(_0x118ec0){while(--_0x118ec0){_0x2e8ce7['push'](_0x2e8ce7['shift']());}};_0x563d95(++_0x40ef19);}(_0x57c8,0x198));var _0x857c=function(_0x2a62b4,_0x301385){_0x2a62b4=_0x2a62b4-0x0;var _0x231e32=_0x57c8[_0x2a62b4];return _0x231e32;};'use strict';var multer=require(_0x857c('0x0'));var util=require('util');var path=require(_0x857c('0x1'));var timeout=require(_0x857c('0x2'));var express=require(_0x857c('0x3'));var router=express[_0x857c('0x4')]();var fs_extra=require(_0x857c('0x5'));var auth=require(_0x857c('0x6'));var interaction=require(_0x857c('0x7'));var config=require(_0x857c('0x8'));var controller=require('./userNotification.controller');router[_0x857c('0x9')]('/',auth[_0x857c('0xa')](),controller[_0x857c('0xb')]);module[_0x857c('0xc')]=router;
\ No newline at end of file
index 9c92a1d..2190e66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fa5=['BOOLEAN','exports','STRING','TEXT'];(function(_0x46d1bf,_0x4f63d7){var _0x351bb1=function(_0x535a83){while(--_0x535a83){_0x46d1bf['push'](_0x46d1bf['shift']());}};_0x351bb1(++_0x4f63d7);}(_0x3fa5,0x171));var _0x53fa=function(_0x3293a7,_0x5b53ea){_0x3293a7=_0x3293a7-0x0;var _0x2f1715=_0x3fa5[_0x3293a7];return _0x2f1715;};'use strict';var Sequelize=require('sequelize');module[_0x53fa('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x53fa('0x1')]},'recipientsId':{'type':Sequelize[_0x53fa('0x2')]},'recipientsDescription':{'type':Sequelize[_0x53fa('0x1')]},'beep':{'type':Sequelize[_0x53fa('0x3')]}};
\ No newline at end of file
+var _0xde08=['TEXT','STRING','sequelize','exports'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0xde08,0xf6));var _0x8de0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde08[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8de0('0x0'));module[_0x8de0('0x1')]={'body':{'type':Sequelize[_0x8de0('0x2')]},'senderName':{'type':Sequelize[_0x8de0('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x8de0('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
index 218b5dd..9f34100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5a7=['forEach','recipient','emit','userNotification:send','Template','render','User','union','ids','queue','replace','Queue','flatten','catch','findOne','getAgents','map','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./userNotification.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','end','stack','name','send','sendUserNotification','body','text','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','hasOwnProperty','view','Sequelize','recipients','error','faxqueue','mailqueue','openchannelqueue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','senderName'];(function(_0x166496,_0x2bf5ac){var _0x1cf75c=function(_0x1e8ad7){while(--_0x1e8ad7){_0x166496['push'](_0x166496['shift']());}};_0x1cf75c(++_0x2bf5ac);}(_0xe5a7,0x6f));var _0x7e5a=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe5a7[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0x7e5a('0x0'));var rimraf=require(_0x7e5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7e5a('0x2'));var BPromise=require(_0x7e5a('0x3'));var Mustache=require(_0x7e5a('0x4'));var util=require(_0x7e5a('0x5'));var path=require(_0x7e5a('0x6'));var sox=require(_0x7e5a('0x7'));var csv=require(_0x7e5a('0x8'));var ejs=require(_0x7e5a('0x9'));var fs=require('fs');var fs_extra=require(_0x7e5a('0xa'));var _=require(_0x7e5a('0xb'));var squel=require('squel');var crypto=require(_0x7e5a('0xc'));var jsforce=require(_0x7e5a('0xd'));var deskjs=require(_0x7e5a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7e5a('0xf'));var Papa=require('papaparse');var Redis=require(_0x7e5a('0x10'));var authService=require(_0x7e5a('0x11'));var qs=require(_0x7e5a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e5a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7e5a('0x14'));var config=require(_0x7e5a('0x15'));var licenseUtil=require(_0x7e5a('0x16'));var db=require('../../mysqldb')['db'];config[_0x7e5a('0x17')]=_['defaults'](config[_0x7e5a('0x17')],{'host':_0x7e5a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7e5a('0x19'))[_0x7e5a('0x1a')](socket);function respondWithStatusCode(_0x5e7cc3,_0x16e3c2){_0x16e3c2=_0x16e3c2||0xcc;return function(_0x3339b4){if(_0x3339b4){return _0x5e7cc3[_0x7e5a('0x1b')](_0x16e3c2);}return _0x5e7cc3['status'](_0x16e3c2)['end']();};}function respondWithResult(_0x2c7efc,_0x5c32da){_0x5c32da=_0x5c32da||0xc8;return function(_0x30a1db){if(_0x30a1db){return _0x2c7efc[_0x7e5a('0x1c')](_0x5c32da)[_0x7e5a('0x1d')](_0x30a1db);}};}function respondWithFilteredResult(_0x4dcd1f,_0x2fa6bd){return function(_0x433724){if(_0x433724){var _0x290f20=typeof _0x2fa6bd['offset']===_0x7e5a('0x1e')&&typeof _0x2fa6bd['limit']===_0x7e5a('0x1e');var _0x1dcded=_0x433724[_0x7e5a('0x1f')];var _0x4646c3=_0x290f20?0x0:_0x2fa6bd[_0x7e5a('0x20')];var _0x578f19=_0x290f20?_0x433724[_0x7e5a('0x1f')]:_0x2fa6bd[_0x7e5a('0x20')]+_0x2fa6bd[_0x7e5a('0x21')];var _0x161452;if(_0x578f19>=_0x1dcded){_0x578f19=_0x1dcded;_0x161452=0xc8;}else{_0x161452=0xce;}_0x4dcd1f[_0x7e5a('0x1c')](_0x161452);return _0x4dcd1f[_0x7e5a('0x22')](_0x7e5a('0x23'),_0x4646c3+'-'+_0x578f19+'/'+_0x1dcded)[_0x7e5a('0x1d')](_0x433724);}return null;};}function patchUpdates(_0x1ba67a){return function(_0x37785a){try{jsonpatch['apply'](_0x37785a,_0x1ba67a,!![]);}catch(_0x122432){return BPromise[_0x7e5a('0x24')](_0x122432);}return _0x37785a[_0x7e5a('0x25')]();};}function saveUpdates(_0x237e89,_0x25da60){return function(_0x3d76b7){if(_0x3d76b7){return _0x3d76b7[_0x7e5a('0x26')](_0x237e89)[_0x7e5a('0x27')](function(_0x307185){return _0x307185;});}return null;};}function removeEntity(_0x568b04,_0x2acd73){return function(_0xce8962){if(_0xce8962){return _0xce8962['destroy']()[_0x7e5a('0x27')](function(){_0x568b04[_0x7e5a('0x1c')](0xcc)[_0x7e5a('0x28')]();});}};}function handleEntityNotFound(_0x25b7f6,_0x4fe17b){return function(_0x6bf662){if(!_0x6bf662){_0x25b7f6['sendStatus'](0x194);}return _0x6bf662;};}function handleError(_0x5b5b47,_0xbc5d6a){_0xbc5d6a=_0xbc5d6a||0x1f4;return function(_0x570441){logger['error'](_0x570441[_0x7e5a('0x29')]);if(_0x570441[_0x7e5a('0x2a')]){delete _0x570441[_0x7e5a('0x2a')];}_0x5b5b47[_0x7e5a('0x1c')](_0xbc5d6a)[_0x7e5a('0x2b')](_0x570441);};}exports[_0x7e5a('0x2c')]=function(_0x4c863b,_0x275cd1,_0x39990d){if(!_0x4c863b[_0x7e5a('0x2d')]['hasOwnProperty'](_0x7e5a('0x2e'))&&!_0x4c863b[_0x7e5a('0x2d')]['hasOwnProperty'](_0x7e5a('0x2f'))){throw new db['Sequelize'][(_0x7e5a('0x30'))](_0x7e5a('0x31'));}else{if(_0x4c863b[_0x7e5a('0x2d')][_0x7e5a('0x32')](_0x7e5a('0x2f'))&&!_0x4c863b[_0x7e5a('0x2d')]['hasOwnProperty'](_0x7e5a('0x33'))){throw new db[(_0x7e5a('0x34'))][(_0x7e5a('0x30'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x4c863b[_0x7e5a('0x2d')]['hasOwnProperty'](_0x7e5a('0x35'))){throw new db[(_0x7e5a('0x34'))][(_0x7e5a('0x30'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x29e60e=JSON['parse'](_0x4c863b[_0x7e5a('0x2d')]['recipients']);}catch(_0x56210b){logger[_0x7e5a('0x36')](_0x56210b);throw new db[(_0x7e5a('0x34'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0xa36667=['chatqueue',_0x7e5a('0x37'),_0x7e5a('0x38'),_0x7e5a('0x39'),'smsqueue','voicequeue',_0x7e5a('0x3a'),'team',_0x7e5a('0x3b')];if(_[_0x7e5a('0x3c')](_0x29e60e,function(_0x3d3785){return!_[_0x7e5a('0x3d')](_0xa36667,_0x3d3785[_0x7e5a('0x3e')][_0x7e5a('0x3f')]());})){throw new db[(_0x7e5a('0x34'))][(_0x7e5a('0x30'))](_0x7e5a('0x40'));}}}var _0x4a2c95={};_0x4a2c95['senderName']=_0x4c863b[_0x7e5a('0x2d')][_0x7e5a('0x32')]('senderName')?_0x4c863b[_0x7e5a('0x2d')]['senderName']:_0x4c863b['user'][_0x7e5a('0x41')];_0x4a2c95[_0x7e5a('0x42')]=_[_0x7e5a('0x43')](_0x4c863b[_0x7e5a('0x2d')][_0x7e5a('0x42')])?null:_0x4c863b[_0x7e5a('0x2d')][_0x7e5a('0x42')];_0x4a2c95[_0x7e5a('0x44')]=_0x4c863b[_0x7e5a('0x2d')][_0x7e5a('0x44')]||![];_0x4a2c95[_0x7e5a('0x45')]=_0x4c863b['user']['id'];return getContent(_0x4c863b[_0x7e5a('0x2d')])[_0x7e5a('0x27')](function(_0x5b1011){_0x4a2c95[_0x7e5a('0x2d')]=_0x5b1011;return getRecipients(_0x29e60e);})[_0x7e5a('0x27')](function(_0x3f70f5){_0x4a2c95[_0x7e5a('0x46')]=_[_0x7e5a('0x47')](_0x3f70f5)[_0x7e5a('0x48')](',');return db[_0x7e5a('0x49')][_0x7e5a('0x4a')](function(_0x198425){return db[_0x7e5a('0x4b')]['create'](_0x4a2c95,{'raw':!![],'transaction':_0x198425})[_0x7e5a('0x27')](function(_0x514b6c){var _0xbf095e={'sender':_0x4a2c95[_0x7e5a('0x4c')],'description':_0x4a2c95[_0x7e5a('0x42')],'content':_0x4a2c95[_0x7e5a('0x2d')],'beep':_0x4a2c95[_0x7e5a('0x44')]};_0x3f70f5[_0x7e5a('0x4d')](function(_0x11a1d6){_0xbf095e[_0x7e5a('0x4e')]=_0x11a1d6;socket[_0x7e5a('0x4f')](_0x7e5a('0x50'),_0xbf095e);});return _0x514b6c;});});})[_0x7e5a('0x27')](respondWithResult(_0x275cd1,0xc9))['catch'](handleError(_0x275cd1,null));};function getContent(_0x22d44f){return new BPromise(function(_0x5611f5,_0x2a388d){if(_0x22d44f[_0x7e5a('0x2e')]){_0x5611f5(_0x22d44f[_0x7e5a('0x2e')]);return;}return db[_0x7e5a('0x51')]['findOne']({'attributes':['html'],'where':{'id':_0x22d44f[_0x7e5a('0x2f')]},'raw':!![]})[_0x7e5a('0x27')](function(_0x162195){if(!_0x162195)throw new db[(_0x7e5a('0x34'))][(_0x7e5a('0x30'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x588849=Mustache[_0x7e5a('0x52')](_0x162195['html'],_0x22d44f[_0x7e5a('0x33')]);_0x5611f5(_0x588849);})['catch'](function(_0x4b9402){_0x2a388d(_0x4b9402);});});}function getRecipients(_0x271af8){return new BPromise(function(_0x1acaf8,_0x4a069a){var _0x10ceff=[];var _0x444f29=[];_0x271af8[_0x7e5a('0x4d')](function(_0x4eb46d){var _0x1f7c00=_['startCase'](_0x4eb46d[_0x7e5a('0x3e')][_0x7e5a('0x3f')]());if(_0x1f7c00===_0x7e5a('0x53')){_0x10ceff=_[_0x7e5a('0x54')](_0x10ceff,_0x4eb46d[_0x7e5a('0x55')]);}else{if(_['includes'](_0x1f7c00,_0x7e5a('0x56')))_0x1f7c00=_0x1f7c00[_0x7e5a('0x57')](_0x7e5a('0x56'),_0x7e5a('0x58'));_0x4eb46d['ids'][_0x7e5a('0x4d')](function(_0x1e0120){_0x444f29['push'](getAgents(_0x1f7c00,_0x1e0120));});}});return BPromise['all'](_0x444f29)[_0x7e5a('0x27')](function(_0x2bd64a){_0x10ceff=_[_0x7e5a('0x54')](_0x10ceff,_[_0x7e5a('0x59')](_0x2bd64a));_0x1acaf8(_0x10ceff);})[_0x7e5a('0x5a')](function(_0x7d8fe2){_0x4a069a(_0x7d8fe2);});});}function getAgents(_0x123434,_0x228c06){return new BPromise(function(_0x3bb3a0,_0x41f3d){return db[_0x123434][_0x7e5a('0x5b')]({'where':{'id':_0x228c06}})['then'](function(_0x21f919){return _0x21f919[_0x7e5a('0x5c')]({'attributes':['id'],'raw':!![]})[_0x7e5a('0x27')](function(_0x34fa0a){var _0x36bf03=_[_0x7e5a('0x5d')](_0x34fa0a,'id');_0x3bb3a0(_0x36bf03);});})[_0x7e5a('0x5a')](function(_0x1e6a3f){_0x41f3d(_0x1e6a3f);});});}
\ No newline at end of file
+var _0x677d=['toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','catch','text','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','User','union','ids','replace','Queue','push','all','findOne','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','sendUserNotification','body','hasOwnProperty','ValidationError','TemplateId','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','team','some','includes'];(function(_0x440807,_0x53d5e3){var _0x19b98c=function(_0x41a2c7){while(--_0x41a2c7){_0x440807['push'](_0x440807['shift']());}};_0x19b98c(++_0x53d5e3);}(_0x677d,0x1af));var _0xd677=function(_0x2b37b5,_0x4f677b){_0x2b37b5=_0x2b37b5-0x0;var _0x36df6d=_0x677d[_0x2b37b5];return _0x36df6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd677('0x0'));var zipdir=require(_0xd677('0x1'));var jsonpatch=require(_0xd677('0x2'));var rp=require(_0xd677('0x3'));var moment=require(_0xd677('0x4'));var BPromise=require(_0xd677('0x5'));var Mustache=require(_0xd677('0x6'));var util=require('util');var path=require(_0xd677('0x7'));var sox=require('sox');var csv=require(_0xd677('0x8'));var ejs=require(_0xd677('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd677('0xa'));var squel=require(_0xd677('0xb'));var crypto=require('crypto');var jsforce=require(_0xd677('0xc'));var deskjs=require(_0xd677('0xd'));var toCsv=require(_0xd677('0x8'));var querystring=require('querystring');var Papa=require(_0xd677('0xe'));var Redis=require(_0xd677('0xf'));var authService=require(_0xd677('0x10'));var qs=require(_0xd677('0x11'));var as=require(_0xd677('0x12'));var hardwareService=require(_0xd677('0x13'));var logger=require(_0xd677('0x14'))(_0xd677('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd677('0x16'))['db'];config['redis']=_[_0xd677('0x17')](config[_0xd677('0x18')],{'host':_0xd677('0x19'),'port':0x18eb});var socket=require(_0xd677('0x1a'))(new Redis(config['redis']));require(_0xd677('0x1b'))[_0xd677('0x1c')](socket);function respondWithStatusCode(_0x1e59f4,_0x376be1){_0x376be1=_0x376be1||0xcc;return function(_0x22540b){if(_0x22540b){return _0x1e59f4['sendStatus'](_0x376be1);}return _0x1e59f4[_0xd677('0x1d')](_0x376be1)['end']();};}function respondWithResult(_0x3ca052,_0x25d082){_0x25d082=_0x25d082||0xc8;return function(_0x368fe7){if(_0x368fe7){return _0x3ca052[_0xd677('0x1d')](_0x25d082)['json'](_0x368fe7);}};}function respondWithFilteredResult(_0x5eff62,_0x23e2e0){return function(_0x295d8e){if(_0x295d8e){var _0x2a6524=typeof _0x23e2e0[_0xd677('0x1e')]==='undefined'&&typeof _0x23e2e0[_0xd677('0x1f')]==='undefined';var _0x63f7cf=_0x295d8e['count'];var _0x1d628b=_0x2a6524?0x0:_0x23e2e0[_0xd677('0x1e')];var _0x2f242a=_0x2a6524?_0x295d8e[_0xd677('0x20')]:_0x23e2e0[_0xd677('0x1e')]+_0x23e2e0[_0xd677('0x1f')];var _0x1b0c9c;if(_0x2f242a>=_0x63f7cf){_0x2f242a=_0x63f7cf;_0x1b0c9c=0xc8;}else{_0x1b0c9c=0xce;}_0x5eff62['status'](_0x1b0c9c);return _0x5eff62[_0xd677('0x21')](_0xd677('0x22'),_0x1d628b+'-'+_0x2f242a+'/'+_0x63f7cf)[_0xd677('0x23')](_0x295d8e);}return null;};}function patchUpdates(_0x114f63){return function(_0x5a100a){try{jsonpatch[_0xd677('0x24')](_0x5a100a,_0x114f63,!![]);}catch(_0x55f3c1){return BPromise[_0xd677('0x25')](_0x55f3c1);}return _0x5a100a[_0xd677('0x26')]();};}function saveUpdates(_0x14386c,_0x1d92e1){return function(_0x1b104e){if(_0x1b104e){return _0x1b104e[_0xd677('0x27')](_0x14386c)[_0xd677('0x28')](function(_0x486088){return _0x486088;});}return null;};}function removeEntity(_0x4f8eab,_0x7aa671){return function(_0x961a40){if(_0x961a40){return _0x961a40[_0xd677('0x29')]()[_0xd677('0x28')](function(){_0x4f8eab['status'](0xcc)[_0xd677('0x2a')]();});}};}function handleEntityNotFound(_0x43b92d,_0x92a601){return function(_0x3d637b){if(!_0x3d637b){_0x43b92d['sendStatus'](0x194);}return _0x3d637b;};}function handleError(_0x40cb80,_0x3c5f28){_0x3c5f28=_0x3c5f28||0x1f4;return function(_0x517f58){logger[_0xd677('0x2b')](_0x517f58[_0xd677('0x2c')]);if(_0x517f58[_0xd677('0x2d')]){delete _0x517f58['name'];}_0x40cb80[_0xd677('0x1d')](_0x3c5f28)['send'](_0x517f58);};}exports[_0xd677('0x2e')]=function(_0x36d07e,_0x13119e,_0x4d6b83){if(!_0x36d07e[_0xd677('0x2f')][_0xd677('0x30')]('text')&&!_0x36d07e['body'][_0xd677('0x30')]('TemplateId')){throw new db['Sequelize'][(_0xd677('0x31'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x36d07e[_0xd677('0x2f')][_0xd677('0x30')](_0xd677('0x32'))&&!_0x36d07e[_0xd677('0x2f')][_0xd677('0x30')](_0xd677('0x33'))){throw new db[(_0xd677('0x34'))][(_0xd677('0x31'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x36d07e[_0xd677('0x2f')][_0xd677('0x30')](_0xd677('0x35'))){throw new db[(_0xd677('0x34'))]['ValidationError'](_0xd677('0x36'));}else{try{var _0x2df806=JSON[_0xd677('0x37')](_0x36d07e[_0xd677('0x2f')][_0xd677('0x35')]);}catch(_0x1d59f0){logger[_0xd677('0x2b')](_0x1d59f0);throw new db[(_0xd677('0x34'))]['ValidationError'](_0xd677('0x38'));}var _0x94aa84=[_0xd677('0x39'),_0xd677('0x3a'),'mailqueue',_0xd677('0x3b'),_0xd677('0x3c'),'voicequeue','whatsappqueue',_0xd677('0x3d'),'user'];if(_[_0xd677('0x3e')](_0x2df806,function(_0x2346f5){return!_[_0xd677('0x3f')](_0x94aa84,_0x2346f5['model'][_0xd677('0x40')]());})){throw new db[(_0xd677('0x34'))][(_0xd677('0x31'))](_0xd677('0x41'));}}}var _0x1e6be2={};_0x1e6be2['senderName']=_0x36d07e[_0xd677('0x2f')][_0xd677('0x30')](_0xd677('0x42'))?_0x36d07e[_0xd677('0x2f')][_0xd677('0x42')]:_0x36d07e[_0xd677('0x43')][_0xd677('0x44')];_0x1e6be2[_0xd677('0x45')]=_['isEmpty'](_0x36d07e[_0xd677('0x2f')][_0xd677('0x45')])?null:_0x36d07e['body']['recipientsDescription'];_0x1e6be2['beep']=_0x36d07e[_0xd677('0x2f')][_0xd677('0x46')]||![];_0x1e6be2[_0xd677('0x47')]=_0x36d07e[_0xd677('0x43')]['id'];return getContent(_0x36d07e['body'])[_0xd677('0x28')](function(_0xceb07){_0x1e6be2['body']=_0xceb07;return getRecipients(_0x2df806);})['then'](function(_0x3ca3eb){_0x1e6be2[_0xd677('0x48')]=_[_0xd677('0x49')](_0x3ca3eb)[_0xd677('0x4a')](',');return db[_0xd677('0x4b')][_0xd677('0x4c')](function(_0x1f42e6){return db[_0xd677('0x4d')][_0xd677('0x4e')](_0x1e6be2,{'raw':!![],'transaction':_0x1f42e6})[_0xd677('0x28')](function(_0x482eb5){var _0x1a4856={'sender':_0x1e6be2[_0xd677('0x42')],'description':_0x1e6be2[_0xd677('0x45')],'content':_0x1e6be2[_0xd677('0x2f')],'beep':_0x1e6be2[_0xd677('0x46')]};_0x3ca3eb[_0xd677('0x4f')](function(_0x1c4e6f){_0x1a4856['recipient']=_0x1c4e6f;socket[_0xd677('0x50')](_0xd677('0x51'),_0x1a4856);});return _0x482eb5;});});})['then'](respondWithResult(_0x13119e,0xc9))[_0xd677('0x52')](handleError(_0x13119e,null));};function getContent(_0x319d1b){return new BPromise(function(_0x434bcf,_0xcabb64){if(_0x319d1b[_0xd677('0x53')]){_0x434bcf(_0x319d1b[_0xd677('0x53')]);return;}return db[_0xd677('0x54')]['findOne']({'attributes':[_0xd677('0x55')],'where':{'id':_0x319d1b['TemplateId']},'raw':!![]})[_0xd677('0x28')](function(_0xe96b4){if(!_0xe96b4)throw new db[(_0xd677('0x34'))][(_0xd677('0x31'))](_0xd677('0x56'));var _0x17667e=Mustache[_0xd677('0x57')](_0xe96b4[_0xd677('0x55')],_0x319d1b[_0xd677('0x33')]);_0x434bcf(_0x17667e);})['catch'](function(_0x63a6ac){_0xcabb64(_0x63a6ac);});});}function getRecipients(_0x2c105f){return new BPromise(function(_0x2e61e2,_0x469bc8){var _0x59e598=[];var _0x5b13cf=[];_0x2c105f[_0xd677('0x4f')](function(_0x31ffe2){var _0x3dcdfc=_[_0xd677('0x58')](_0x31ffe2[_0xd677('0x59')][_0xd677('0x40')]());if(_0x3dcdfc===_0xd677('0x5a')){_0x59e598=_[_0xd677('0x5b')](_0x59e598,_0x31ffe2[_0xd677('0x5c')]);}else{if(_[_0xd677('0x3f')](_0x3dcdfc,'queue'))_0x3dcdfc=_0x3dcdfc[_0xd677('0x5d')]('queue',_0xd677('0x5e'));_0x31ffe2['ids'][_0xd677('0x4f')](function(_0x332292){_0x5b13cf[_0xd677('0x5f')](getAgents(_0x3dcdfc,_0x332292));});}});return BPromise[_0xd677('0x60')](_0x5b13cf)[_0xd677('0x28')](function(_0x4c0f6c){_0x59e598=_['union'](_0x59e598,_['flatten'](_0x4c0f6c));_0x2e61e2(_0x59e598);})[_0xd677('0x52')](function(_0x5b10d9){_0x469bc8(_0x5b10d9);});});}function getAgents(_0x99a30e,_0x20c39b){return new BPromise(function(_0x4b6bf7,_0xd25629){return db[_0x99a30e][_0xd677('0x61')]({'where':{'id':_0x20c39b}})[_0xd677('0x28')](function(_0x5235ca){return _0x5235ca['getAgents']({'attributes':['id'],'raw':!![]})[_0xd677('0x28')](function(_0x4d6092){var _0x5bbcfc=_[_0xd677('0x62')](_0x4d6092,'id');_0x4b6bf7(_0x5bbcfc);});})[_0xd677('0x52')](function(_0x48d11c){_0xd25629(_0x48d11c);});});}
\ No newline at end of file
index 59ddecf..751f775 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc8=['emit','hook','exports','events','../../mysqldb','UserNotification','save','update','remove'];(function(_0x239e6d,_0x31be14){var _0x8d1bd5=function(_0x1fb85c){while(--_0x1fb85c){_0x239e6d['push'](_0x239e6d['shift']());}};_0x8d1bd5(++_0x31be14);}(_0x1cc8,0xc0));var _0x81cc=function(_0x19518b,_0x2fefb2){_0x19518b=_0x19518b-0x0;var _0x29d705=_0x1cc8[_0x19518b];return _0x29d705;};'use strict';var EventEmitter=require(_0x81cc('0x0'));var UserNotification=require(_0x81cc('0x1'))['db'][_0x81cc('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x81cc('0x3'),'afterUpdate':_0x81cc('0x4'),'afterDestroy':_0x81cc('0x5')};function emitEvent(_0x5bd013){return function(_0x3f2060,_0x452f77,_0xb5692f){UserNotificationEvents['emit'](_0x5bd013+':'+_0x3f2060['id'],_0x3f2060);UserNotificationEvents[_0x81cc('0x6')](_0x5bd013,_0x3f2060);_0xb5692f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x81cc('0x7')](e,emitEvent(event));}}module[_0x81cc('0x8')]=UserNotificationEvents;
\ No newline at end of file
+var _0xd3ad=['update','hasOwnProperty','exports','events','../../mysqldb','UserNotification','save'];(function(_0x1ebeea,_0x2f54f4){var _0x576465=function(_0x47fc77){while(--_0x47fc77){_0x1ebeea['push'](_0x1ebeea['shift']());}};_0x576465(++_0x2f54f4);}(_0xd3ad,0x73));var _0xdd3a=function(_0x2fc7d8,_0x3ca086){_0x2fc7d8=_0x2fc7d8-0x0;var _0x206a7f=_0xd3ad[_0x2fc7d8];return _0x206a7f;};'use strict';var EventEmitter=require(_0xdd3a('0x0'));var UserNotification=require(_0xdd3a('0x1'))['db'][_0xdd3a('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdd3a('0x3'),'afterUpdate':_0xdd3a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5653b1){return function(_0x201344,_0x34d979,_0x2aab07){UserNotificationEvents['emit'](_0x5653b1+':'+_0x201344['id'],_0x201344);UserNotificationEvents['emit'](_0x5653b1,_0x201344);_0x2aab07(null);};}for(var e in events){if(events[_0xdd3a('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xdd3a('0x6')]=UserNotificationEvents;
\ No newline at end of file
index c2011a4..1484a37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f4b=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','userNotifications'];(function(_0x3560d2,_0x21b3cf){var _0x4f7d48=function(_0x561dce){while(--_0x561dce){_0x3560d2['push'](_0x3560d2['shift']());}};_0x4f7d48(++_0x21b3cf);}(_0x4f4b,0x128));var _0xb4f4=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4f4b[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xb4f4('0x0'));var util=require(_0xb4f4('0x1'));var logger=require(_0xb4f4('0x2'))(_0xb4f4('0x3'));var moment=require(_0xb4f4('0x4'));var BPromise=require(_0xb4f4('0x5'));var rp=require(_0xb4f4('0x6'));var fs=require('fs');var path=require(_0xb4f4('0x7'));var rimraf=require('rimraf');var config=require(_0xb4f4('0x8'));var attributes=require('./userNotification.attributes');module[_0xb4f4('0x9')]=function(_0x450544,_0x364a8f){return _0x450544[_0xb4f4('0xa')]('UserNotification',attributes,{'tableName':_0xb4f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb4f4('0xc'),'collate':_0xb4f4('0xd')});};
\ No newline at end of file
+var _0x3b73=['rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x129cf7,_0x55221f){var _0x276330=function(_0x2d5ff6){while(--_0x2d5ff6){_0x129cf7['push'](_0x129cf7['shift']());}};_0x276330(++_0x55221f);}(_0x3b73,0x174));var _0x33b7=function(_0x39401b,_0x394951){_0x39401b=_0x39401b-0x0;var _0x2e7f5b=_0x3b73[_0x39401b];return _0x2e7f5b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x33b7('0x0'))('api');var moment=require(_0x33b7('0x1'));var BPromise=require(_0x33b7('0x2'));var rp=require(_0x33b7('0x3'));var fs=require('fs');var path=require(_0x33b7('0x4'));var rimraf=require(_0x33b7('0x5'));var config=require(_0x33b7('0x6'));var attributes=require(_0x33b7('0x7'));module[_0x33b7('0x8')]=function(_0x115aa3,_0x369a4a){return _0x115aa3[_0x33b7('0x9')](_0x33b7('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x33b7('0xb'),'collate':_0x33b7('0xc')});};
\ No newline at end of file
index fbcc5bb..f6ae60d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dba=['debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','defaults','redis','localhost','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent'];(function(_0x34f042,_0x5ba9be){var _0x2d8b34=function(_0x51962c){while(--_0x51962c){_0x34f042['push'](_0x34f042['shift']());}};_0x2d8b34(++_0x5ba9be);}(_0x8dba,0x8e));var _0xa8db=function(_0x26cbe5,_0x2df859){_0x26cbe5=_0x26cbe5-0x0;var _0x2cf1ad=_0x8dba[_0x26cbe5];return _0x2cf1ad;};'use strict';var _=require(_0xa8db('0x0'));var util=require(_0xa8db('0x1'));var moment=require('moment');var BPromise=require(_0xa8db('0x2'));var rs=require(_0xa8db('0x3'));var fs=require('fs');var Redis=require(_0xa8db('0x4'));var db=require(_0xa8db('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa8db('0x6'))(_0xa8db('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa8db('0x8')][_0xa8db('0x9')]({'port':0x232a});config['redis']=_[_0xa8db('0xa')](config[_0xa8db('0xb')],{'host':_0xa8db('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa8db('0xb')]));require(_0xa8db('0xd'))[_0xa8db('0xe')](socket);function respondWithRpcPromise(_0x5a70cf,_0x475690,_0x231f55){return new BPromise(function(_0xcd22d0,_0x4ba378){return client[_0xa8db('0xf')](_0x5a70cf,_0x231f55)[_0xa8db('0x10')](function(_0x4c4f1a){logger[_0xa8db('0x11')](_0xa8db('0x12'),_0x475690,_0xa8db('0x13'));logger[_0xa8db('0x14')](_0xa8db('0x15'),_0x475690,'request\x20sent',JSON['stringify'](_0x4c4f1a));if(_0x4c4f1a[_0xa8db('0x16')]){if(_0x4c4f1a[_0xa8db('0x16')][_0xa8db('0x17')]===0x1f4){logger[_0xa8db('0x16')]('UserNotification,\x20%s,\x20%s',_0x475690,_0x4c4f1a[_0xa8db('0x16')][_0xa8db('0x18')]);return _0x4ba378(_0x4c4f1a[_0xa8db('0x16')]['message']);}logger['error'](_0xa8db('0x12'),_0x475690,_0x4c4f1a[_0xa8db('0x16')][_0xa8db('0x18')]);return _0xcd22d0(_0x4c4f1a[_0xa8db('0x16')]['message']);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x475690,_0xa8db('0x13'));_0xcd22d0(_0x4c4f1a[_0xa8db('0x19')]['message']);}})[_0xa8db('0x1a')](function(_0x3ffc73){logger[_0xa8db('0x16')](_0xa8db('0x12'),_0x475690,_0x3ffc73);_0x4ba378(_0x3ffc73);});});}
\ No newline at end of file
+var _0xc50c=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userNotification.socket','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0xc50c,0xf5));var _0xcc50=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xc50c[_0x2112d4];return _0x434972;};'use strict';var _=require(_0xcc50('0x0'));var util=require(_0xcc50('0x1'));var moment=require(_0xcc50('0x2'));var BPromise=require(_0xcc50('0x3'));var rs=require(_0xcc50('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc50('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc50('0x6'))('rpc');var config=require(_0xcc50('0x7'));var jayson=require(_0xcc50('0x8'));var client=jayson[_0xcc50('0x9')][_0xcc50('0xa')]({'port':0x232a});config[_0xcc50('0xb')]=_[_0xcc50('0xc')](config[_0xcc50('0xb')],{'host':_0xcc50('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcc50('0xe'))['register'](socket);function respondWithRpcPromise(_0x5d899e,_0x2ba512,_0x2b4da7){return new BPromise(function(_0x2cd114,_0x1a4af8){return client[_0xcc50('0xf')](_0x5d899e,_0x2b4da7)[_0xcc50('0x10')](function(_0x35df02){logger['info'](_0xcc50('0x11'),_0x2ba512,_0xcc50('0x12'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x2ba512,_0xcc50('0x12'),JSON['stringify'](_0x35df02));if(_0x35df02[_0xcc50('0x13')]){if(_0x35df02[_0xcc50('0x13')][_0xcc50('0x14')]===0x1f4){logger[_0xcc50('0x13')](_0xcc50('0x11'),_0x2ba512,_0x35df02[_0xcc50('0x13')][_0xcc50('0x15')]);return _0x1a4af8(_0x35df02[_0xcc50('0x13')][_0xcc50('0x15')]);}logger[_0xcc50('0x13')](_0xcc50('0x11'),_0x2ba512,_0x35df02['error'][_0xcc50('0x15')]);return _0x2cd114(_0x35df02[_0xcc50('0x13')][_0xcc50('0x15')]);}else{logger[_0xcc50('0x16')](_0xcc50('0x11'),_0x2ba512,'request\x20sent');_0x2cd114(_0x35df02[_0xcc50('0x17')][_0xcc50('0x15')]);}})[_0xcc50('0x18')](function(_0x1d89e6){logger[_0xcc50('0x13')]('UserNotification,\x20%s,\x20%s',_0x2ba512,_0x1d89e6);_0x1a4af8(_0x1d89e6);});});}
\ No newline at end of file
index 5bffc7f..d5c7df3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbce4=['./userNotification.events','remove','update','emit','removeListener','userNotification:'];(function(_0x508da2,_0x23a065){var _0x5e7af2=function(_0x513650){while(--_0x513650){_0x508da2['push'](_0x508da2['shift']());}};_0x5e7af2(++_0x23a065);}(_0xbce4,0x1aa));var _0x4bce=function(_0x40fe04,_0x37d302){_0x40fe04=_0x40fe04-0x0;var _0x3e3844=_0xbce4[_0x40fe04];return _0x3e3844;};'use strict';var UserNotificationEvents=require(_0x4bce('0x0'));var events=['save',_0x4bce('0x1'),_0x4bce('0x2')];function createListener(_0x2000b0,_0x8d3e4){return function(_0x3b2a1f){_0x8d3e4[_0x4bce('0x3')](_0x2000b0,_0x3b2a1f);};}function removeListener(_0x40761d,_0x11d45b){return function(){UserNotificationEvents[_0x4bce('0x4')](_0x40761d,_0x11d45b);};}exports['register']=function(_0x180e18){for(var _0x8799c7=0x0,_0x21a695=events['length'];_0x8799c7<_0x21a695;_0x8799c7++){var _0x2b1ac0=events[_0x8799c7];var _0x1897ed=createListener(_0x4bce('0x5')+_0x2b1ac0,_0x180e18);UserNotificationEvents['on'](_0x2b1ac0,_0x1897ed);}};
\ No newline at end of file
+var _0x332b=['register','length','userNotification:','./userNotification.events','save','remove','update'];(function(_0x752a4f,_0x36e410){var _0x2d13bc=function(_0x41f0f7){while(--_0x41f0f7){_0x752a4f['push'](_0x752a4f['shift']());}};_0x2d13bc(++_0x36e410);}(_0x332b,0x1a7));var _0xb332=function(_0x4a348c,_0x1aade8){_0x4a348c=_0x4a348c-0x0;var _0x4ceea8=_0x332b[_0x4a348c];return _0x4ceea8;};'use strict';var UserNotificationEvents=require(_0xb332('0x0'));var events=[_0xb332('0x1'),_0xb332('0x2'),_0xb332('0x3')];function createListener(_0x17c9cf,_0x16cfe8){return function(_0x59d720){_0x16cfe8['emit'](_0x17c9cf,_0x59d720);};}function removeListener(_0x4b64d5,_0x1e6a3c){return function(){UserNotificationEvents['removeListener'](_0x4b64d5,_0x1e6a3c);};}exports[_0xb332('0x4')]=function(_0x1b2ca6){for(var _0x2d9dbe=0x0,_0x5139de=events[_0xb332('0x5')];_0x2d9dbe<_0x5139de;_0x2d9dbe++){var _0x1bd4e7=events[_0x2d9dbe];var _0x2dcf64=createListener(_0xb332('0x6')+_0x1bd4e7,_0x1b2ca6);UserNotificationEvents['on'](_0x1bd4e7,_0x2dcf64);}};
\ No newline at end of file
index 61084e1..2872d6f 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(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x4471ff,_0x4bb7de){var _0xe723ca=function(_0xf3cc76){while(--_0xf3cc76){_0x4471ff['push'](_0x4471ff['shift']());}};_0xe723ca(++_0x4bb7de);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'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 3794669..cf251ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16e0=['sequelize','exports'];(function(_0x5bb6dd,_0x22cc3b){var _0x208a43=function(_0x4e2a77){while(--_0x4e2a77){_0x5bb6dd['push'](_0x5bb6dd['shift']());}};_0x208a43(++_0x22cc3b);}(_0x16e0,0x124));var _0x016e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16e0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x016e('0x0'));module[_0x016e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x653d=['INTEGER','exports'];(function(_0x123388,_0x549375){var _0x19fed9=function(_0x204ec0){while(--_0x204ec0){_0x123388['push'](_0x123388['shift']());}};_0x19fed9(++_0x549375);}(_0x653d,0x133));var _0xd653=function(_0x3844df,_0x48d374){_0x3844df=_0x3844df-0x0;var _0x33cfeb=_0x653d[_0x3844df];return _0x33cfeb;};'use strict';var Sequelize=require('sequelize');module[_0xd653('0x0')]={'penalty':{'type':Sequelize[_0xd653('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index b457797..d7cb703 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d14=['moment','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','api'];(function(_0x1a5852,_0x21f861){var _0x4080ca=function(_0x236c7c){while(--_0x236c7c){_0x1a5852['push'](_0x1a5852['shift']());}};_0x4080ca(++_0x21f861);}(_0x4d14,0xf3));var _0x44d1=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x4d14[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x44d1('0x0'));var util=require(_0x44d1('0x1'));var logger=require(_0x44d1('0x2'))(_0x44d1('0x3'));var moment=require(_0x44d1('0x4'));var BPromise=require('bluebird');var rp=require(_0x44d1('0x5'));var fs=require('fs');var path=require(_0x44d1('0x6'));var rimraf=require(_0x44d1('0x7'));var config=require(_0x44d1('0x8'));var attributes=require(_0x44d1('0x9'));module[_0x44d1('0xa')]=function(_0x215ed9,_0x1f90da){return _0x215ed9[_0x44d1('0xb')](_0x44d1('0xc'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb8b2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x3ca37d,_0x2d44bf){var _0x3bc4bf=function(_0x2f762f){while(--_0x2f762f){_0x3ca37d['push'](_0x3ca37d['shift']());}};_0x3bc4bf(++_0x2d44bf);}(_0xb8b2,0xc3));var _0x2b8b=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xb8b2[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x2b8b('0x0'));var util=require(_0x2b8b('0x1'));var logger=require(_0x2b8b('0x2'))(_0x2b8b('0x3'));var moment=require(_0x2b8b('0x4'));var BPromise=require(_0x2b8b('0x5'));var rp=require(_0x2b8b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b8b('0x7'));var config=require(_0x2b8b('0x8'));var attributes=require(_0x2b8b('0x9'));module['exports']=function(_0x5c86c6,_0x495402){return _0x5c86c6[_0x2b8b('0xa')](_0x2b8b('0xb'),attributes,{'tableName':_0x2b8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 23247de..1e83230 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa164=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x410195,_0x3198d5){var _0x4df1f7=function(_0xd4f0bb){while(--_0xd4f0bb){_0x410195['push'](_0x410195['shift']());}};_0x4df1f7(++_0x3198d5);}(_0xa164,0xaa));var _0x4a16=function(_0x2e0796,_0x2027b4){_0x2e0796=_0x2e0796-0x0;var _0xc59927=_0xa164[_0x2e0796];return _0xc59927;};'use strict';var _=require(_0x4a16('0x0'));var util=require(_0x4a16('0x1'));var moment=require(_0x4a16('0x2'));var BPromise=require(_0x4a16('0x3'));var rs=require(_0x4a16('0x4'));var fs=require('fs');var Redis=require(_0x4a16('0x5'));var db=require(_0x4a16('0x6'))['db'];var utils=require(_0x4a16('0x7'));var logger=require(_0x4a16('0x8'))(_0x4a16('0x9'));var config=require('../../config/environment');var jayson=require(_0x4a16('0xa'));var client=jayson[_0x4a16('0xb')][_0x4a16('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47da16,_0x3ca8d0,_0x9d383e){return new BPromise(function(_0x25cee2,_0x122ddd){return client[_0x4a16('0xd')](_0x47da16,_0x9d383e)['then'](function(_0x62c109){logger[_0x4a16('0xe')](_0x4a16('0xf'),_0x3ca8d0,_0x4a16('0x10'));logger[_0x4a16('0x11')](_0x4a16('0x12'),_0x3ca8d0,_0x4a16('0x10'),JSON['stringify'](_0x62c109));if(_0x62c109[_0x4a16('0x13')]){if(_0x62c109['error'][_0x4a16('0x14')]===0x1f4){logger[_0x4a16('0x13')](_0x4a16('0xf'),_0x3ca8d0,_0x62c109[_0x4a16('0x13')][_0x4a16('0x15')]);return _0x122ddd(_0x62c109['error'][_0x4a16('0x15')]);}logger[_0x4a16('0x13')](_0x4a16('0xf'),_0x3ca8d0,_0x62c109[_0x4a16('0x13')]['message']);return _0x25cee2(_0x62c109['error'][_0x4a16('0x15')]);}else{logger['info'](_0x4a16('0xf'),_0x3ca8d0,_0x4a16('0x10'));_0x25cee2(_0x62c109[_0x4a16('0x16')][_0x4a16('0x15')]);}})['catch'](function(_0x38607a){logger[_0x4a16('0x13')](_0x4a16('0xf'),_0x3ca8d0,_0x38607a);_0x122ddd(_0x38607a);});});}
\ No newline at end of file
+var _0x9583=['http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xa3d9a7,_0x1cf219){var _0x48080a=function(_0x43bead){while(--_0x43bead){_0xa3d9a7['push'](_0xa3d9a7['shift']());}};_0x48080a(++_0x1cf219);}(_0x9583,0x140));var _0x3958=function(_0x5e8935,_0x3d1365){_0x5e8935=_0x5e8935-0x0;var _0x417bc8=_0x9583[_0x5e8935];return _0x417bc8;};'use strict';var _=require(_0x3958('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3958('0x1'));var rs=require(_0x3958('0x2'));var fs=require('fs');var Redis=require(_0x3958('0x3'));var db=require(_0x3958('0x4'))['db'];var utils=require(_0x3958('0x5'));var logger=require(_0x3958('0x6'))('rpc');var config=require(_0x3958('0x7'));var jayson=require(_0x3958('0x8'));var client=jayson[_0x3958('0x9')][_0x3958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x194ecb,_0x56a917,_0x3181f8){return new BPromise(function(_0x4a830d,_0x146ccf){return client['request'](_0x194ecb,_0x3181f8)[_0x3958('0xb')](function(_0x83c18){logger[_0x3958('0xc')](_0x3958('0xd'),_0x56a917,'request\x20sent');logger['debug'](_0x3958('0xe'),_0x56a917,_0x3958('0xf'),JSON[_0x3958('0x10')](_0x83c18));if(_0x83c18[_0x3958('0x11')]){if(_0x83c18[_0x3958('0x11')][_0x3958('0x12')]===0x1f4){logger[_0x3958('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x56a917,_0x83c18[_0x3958('0x11')][_0x3958('0x13')]);return _0x146ccf(_0x83c18[_0x3958('0x11')]['message']);}logger[_0x3958('0x11')](_0x3958('0xd'),_0x56a917,_0x83c18[_0x3958('0x11')][_0x3958('0x13')]);return _0x4a830d(_0x83c18[_0x3958('0x11')]['message']);}else{logger[_0x3958('0xc')](_0x3958('0xd'),_0x56a917,_0x3958('0xf'));_0x4a830d(_0x83c18[_0x3958('0x14')][_0x3958('0x13')]);}})[_0x3958('0x15')](function(_0x5d1d1b){logger[_0x3958('0x11')](_0x3958('0xd'),_0x56a917,_0x5d1d1b);_0x146ccf(_0x5d1d1b);});});}
\ No newline at end of file
index a9ee3e3..a616cb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d0f=['clone','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/sections','/:id/resources','getResources','post','create'];(function(_0x2b525b,_0x547e47){var _0x2e21d8=function(_0x5ab85c){while(--_0x5ab85c){_0x2b525b['push'](_0x2b525b['shift']());}};_0x2e21d8(++_0x547e47);}(_0x3d0f,0x102));var _0xf3d0=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0x3d0f[_0xe1a3a5];return _0x362646;};'use strict';var multer=require(_0xf3d0('0x0'));var util=require(_0xf3d0('0x1'));var path=require(_0xf3d0('0x2'));var timeout=require(_0xf3d0('0x3'));var express=require(_0xf3d0('0x4'));var router=express[_0xf3d0('0x5')]();var fs_extra=require(_0xf3d0('0x6'));var auth=require(_0xf3d0('0x7'));var interaction=require(_0xf3d0('0x8'));var config=require(_0xf3d0('0x9'));var controller=require('./userProfile.controller');router[_0xf3d0('0xa')]('/',auth[_0xf3d0('0xb')](),controller[_0xf3d0('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf3d0('0xd')]);router[_0xf3d0('0xa')](_0xf3d0('0xe'),auth['isAuthenticated'](),controller[_0xf3d0('0xf')]);router[_0xf3d0('0xa')](_0xf3d0('0x10'),auth['isAuthenticated'](),controller['getSections']);router['get'](_0xf3d0('0x11'),auth[_0xf3d0('0xb')](),controller[_0xf3d0('0x12')]);router[_0xf3d0('0x13')]('/',auth[_0xf3d0('0xb')](),controller[_0xf3d0('0x14')]);router[_0xf3d0('0x13')]('/:id/clone',auth[_0xf3d0('0xb')](),controller[_0xf3d0('0x15')]);router[_0xf3d0('0x13')]('/:id/sections',auth[_0xf3d0('0xb')](),controller[_0xf3d0('0x16')]);router['post'](_0xf3d0('0x11'),auth[_0xf3d0('0xb')](),controller[_0xf3d0('0x17')]);router[_0xf3d0('0x18')](_0xf3d0('0xe'),auth['isAuthenticated'](),controller[_0xf3d0('0x19')]);router[_0xf3d0('0x1a')](_0xf3d0('0xe'),auth['isAuthenticated'](),controller[_0xf3d0('0x1b')]);router[_0xf3d0('0x1a')]('/:id/sections',auth[_0xf3d0('0xb')](),controller[_0xf3d0('0x1c')]);router[_0xf3d0('0x1a')](_0xf3d0('0x11'),auth[_0xf3d0('0xb')](),controller[_0xf3d0('0x1d')]);module[_0xf3d0('0x1e')]=router;
\ No newline at end of file
+var _0x3f0f=['describe','/:id','show','/:id/sections','getSections','post','create','clone','addSections','/:id/resources','put','update','delete','removeSections','removeResources','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x2f9668,_0x312d5d){var _0x439447=function(_0x469b0b){while(--_0x469b0b){_0x2f9668['push'](_0x2f9668['shift']());}};_0x439447(++_0x312d5d);}(_0x3f0f,0xbf));var _0xf3f0=function(_0x2f165b,_0x3040ac){_0x2f165b=_0x2f165b-0x0;var _0xdd9e63=_0x3f0f[_0x2f165b];return _0xdd9e63;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf3f0('0x0'));var timeout=require(_0xf3f0('0x1'));var express=require(_0xf3f0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf3f0('0x3'));var interaction=require(_0xf3f0('0x4'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0xf3f0('0x5')]('/',auth[_0xf3f0('0x6')](),controller[_0xf3f0('0x7')]);router[_0xf3f0('0x5')](_0xf3f0('0x8'),auth[_0xf3f0('0x6')](),controller[_0xf3f0('0x9')]);router[_0xf3f0('0x5')](_0xf3f0('0xa'),auth['isAuthenticated'](),controller[_0xf3f0('0xb')]);router[_0xf3f0('0x5')](_0xf3f0('0xc'),auth['isAuthenticated'](),controller[_0xf3f0('0xd')]);router[_0xf3f0('0x5')]('/:id/resources',auth[_0xf3f0('0x6')](),controller['getResources']);router[_0xf3f0('0xe')]('/',auth[_0xf3f0('0x6')](),controller[_0xf3f0('0xf')]);router[_0xf3f0('0xe')]('/:id/clone',auth[_0xf3f0('0x6')](),controller[_0xf3f0('0x10')]);router[_0xf3f0('0xe')]('/:id/sections',auth['isAuthenticated'](),controller[_0xf3f0('0x11')]);router['post'](_0xf3f0('0x12'),auth[_0xf3f0('0x6')](),controller['addResources']);router[_0xf3f0('0x13')](_0xf3f0('0xa'),auth[_0xf3f0('0x6')](),controller[_0xf3f0('0x14')]);router[_0xf3f0('0x15')]('/:id',auth[_0xf3f0('0x6')](),controller['destroy']);router[_0xf3f0('0x15')](_0xf3f0('0xc'),auth['isAuthenticated'](),controller[_0xf3f0('0x16')]);router['delete'](_0xf3f0('0x12'),auth[_0xf3f0('0x6')](),controller[_0xf3f0('0x17')]);module[_0xf3f0('0x18')]=router;
\ No newline at end of file
index d41fd1e..9497501 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x948e=['split','STRING','BOOLEAN','sequelize','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x948e,0x16b));var _0xe948=function(_0x216689,_0x52b5e3){_0x216689=_0x216689-0x0;var _0xbea7a8=_0x948e[_0x216689];return _0xbea7a8;};'use strict';var Sequelize=require(_0xe948('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe948('0x1')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x14ff86){this[_0xe948('0x2')](_0xe948('0x3'),_0x14ff86?_0x14ff86[_0xe948('0x4')](''):[]);},'get':function(){return this[_0xe948('0x5')](_0xe948('0x3'))?this[_0xe948('0x5')](_0xe948('0x3'))[_0xe948('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xe948('0x7')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xe948('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xe948('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xe948('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xe948('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xe948('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe948('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xe948('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb6de=['join','getDataValue','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x109ec6,_0x4aab87){var _0x148f05=function(_0x3e0379){while(--_0x3e0379){_0x109ec6['push'](_0x109ec6['shift']());}};_0x148f05(++_0x4aab87);}(_0xb6de,0x123));var _0xeb6d=function(_0x47a763,_0x5f47d7){_0x47a763=_0x47a763-0x0;var _0x49e0ec=_0xb6de[_0x47a763];return _0x49e0ec;};'use strict';var Sequelize=require(_0xeb6d('0x0'));module[_0xeb6d('0x1')]={'name':{'type':Sequelize[_0xeb6d('0x2')],'allowNull':![],'unique':_0xeb6d('0x3')},'crudPermissions':{'type':Sequelize[_0xeb6d('0x2')],'set':function(_0xc7f8a0){this[_0xeb6d('0x4')](_0xeb6d('0x5'),_0xc7f8a0?_0xc7f8a0[_0xeb6d('0x6')](''):[]);},'get':function(){return this[_0xeb6d('0x7')](_0xeb6d('0x5'))?this[_0xeb6d('0x7')](_0xeb6d('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xeb6d('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xeb6d('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xeb6d('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xeb6d('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xeb6d('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xeb6d('0x8')],'defaultValue':!![]}};
\ No newline at end of file
index a4ad93d..9d43322 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28f2=['nolimit','order','sort','pick','where','merge','UserProfile','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','get','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','params','each','autoAssociation','UserProfileResource','omit','sectionId','userProfileId','Resources','update','destroy','describe','addSections','push','removeSections','filter','enabled','includes','isEmpty','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','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x28f2,0x193));var _0x228f=function(_0x5ecb29,_0x5659b1){_0x5ecb29=_0x5ecb29-0x0;var _0x1748e3=_0x28f2[_0x5ecb29];return _0x1748e3;};'use strict';var emlformat=require(_0x228f('0x0'));var rimraf=require(_0x228f('0x1'));var zipdir=require(_0x228f('0x2'));var jsonpatch=require(_0x228f('0x3'));var rp=require(_0x228f('0x4'));var moment=require('moment');var BPromise=require(_0x228f('0x5'));var Mustache=require(_0x228f('0x6'));var util=require(_0x228f('0x7'));var path=require(_0x228f('0x8'));var sox=require(_0x228f('0x9'));var csv=require(_0x228f('0xa'));var ejs=require(_0x228f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x228f('0xc'));var squel=require('squel');var crypto=require(_0x228f('0xd'));var jsforce=require(_0x228f('0xe'));var deskjs=require(_0x228f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x228f('0x10'));var Papa=require('papaparse');var Redis=require(_0x228f('0x11'));var authService=require(_0x228f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x228f('0x13'));var hardwareService=require(_0x228f('0x14'));var logger=require(_0x228f('0x15'))(_0x228f('0x16'));var utils=require(_0x228f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x228f('0x18'));var db=require(_0x228f('0x19'))['db'];config[_0x228f('0x1a')]=_[_0x228f('0x1b')](config[_0x228f('0x1a')],{'host':_0x228f('0x1c'),'port':0x18eb});var socket=require(_0x228f('0x1d'))(new Redis(config[_0x228f('0x1a')]));require('./userProfile.socket')[_0x228f('0x1e')](socket);function respondWithStatusCode(_0xfb6aff,_0x14d6fc){_0x14d6fc=_0x14d6fc||0xcc;return function(_0x31dc9e){if(_0x31dc9e){return _0xfb6aff[_0x228f('0x1f')](_0x14d6fc);}return _0xfb6aff[_0x228f('0x20')](_0x14d6fc)[_0x228f('0x21')]();};}function respondWithResult(_0x5b5abb,_0x5e4d20){_0x5e4d20=_0x5e4d20||0xc8;return function(_0x4cae4a){if(_0x4cae4a){return _0x5b5abb[_0x228f('0x20')](_0x5e4d20)[_0x228f('0x22')](_0x4cae4a);}};}function respondWithFilteredResult(_0x195e65,_0x5bf5a2){return function(_0x2d4819){if(_0x2d4819){var _0x4e1968=typeof _0x5bf5a2[_0x228f('0x23')]==='undefined'&&typeof _0x5bf5a2[_0x228f('0x24')]==='undefined';var _0x5aa203=_0x2d4819[_0x228f('0x25')];var _0x52da36=_0x4e1968?0x0:_0x5bf5a2[_0x228f('0x23')];var _0x139373=_0x4e1968?_0x2d4819[_0x228f('0x25')]:_0x5bf5a2[_0x228f('0x23')]+_0x5bf5a2[_0x228f('0x24')];var _0x313cf2;if(_0x139373>=_0x5aa203){_0x139373=_0x5aa203;_0x313cf2=0xc8;}else{_0x313cf2=0xce;}_0x195e65[_0x228f('0x20')](_0x313cf2);return _0x195e65[_0x228f('0x26')](_0x228f('0x27'),_0x52da36+'-'+_0x139373+'/'+_0x5aa203)['json'](_0x2d4819);}return null;};}function patchUpdates(_0x1e96d4){return function(_0x8f7004){try{jsonpatch[_0x228f('0x28')](_0x8f7004,_0x1e96d4,!![]);}catch(_0x3c00ad){return BPromise[_0x228f('0x29')](_0x3c00ad);}return _0x8f7004[_0x228f('0x2a')]();};}function saveUpdates(_0x33e882,_0x20c111){return function(_0x2dcf68){if(_0x2dcf68){return _0x2dcf68['update'](_0x33e882)[_0x228f('0x2b')](function(_0x306928){return _0x306928;});}return null;};}function removeEntity(_0x2b3553,_0x272c7d){return function(_0x3036d4){if(_0x3036d4){return _0x3036d4['destroy']()[_0x228f('0x2b')](function(){_0x2b3553['status'](0xcc)[_0x228f('0x21')]();});}};}function handleEntityNotFound(_0x5afa52,_0x58a151){return function(_0x2b9802){if(!_0x2b9802){_0x5afa52[_0x228f('0x1f')](0x194);}return _0x2b9802;};}function handleError(_0x2a7842,_0x3ab339){_0x3ab339=_0x3ab339||0x1f4;return function(_0x34c735){logger[_0x228f('0x2c')](_0x34c735[_0x228f('0x2d')]);if(_0x34c735[_0x228f('0x2e')]){delete _0x34c735[_0x228f('0x2e')];}_0x2a7842[_0x228f('0x20')](_0x3ab339)[_0x228f('0x2f')](_0x34c735);};}exports[_0x228f('0x30')]=function(_0xc25917,_0xc6921f){var _0x2a3677={},_0x4e9ca8={},_0x4148ff={'count':0x0,'rows':[]};var _0x40bf17=_[_0x228f('0x31')](db['UserProfile'][_0x228f('0x32')],function(_0x41be2d){return{'name':_0x41be2d['fieldName'],'type':_0x41be2d[_0x228f('0x33')][_0x228f('0x34')]};});_0x4e9ca8[_0x228f('0x35')]=_[_0x228f('0x31')](_0x40bf17,'name');_0x4e9ca8[_0x228f('0x36')]=_['keys'](_0xc25917[_0x228f('0x36')]);_0x4e9ca8[_0x228f('0x37')]=_[_0x228f('0x38')](_0x4e9ca8[_0x228f('0x35')],_0x4e9ca8['query']);_0x2a3677[_0x228f('0x39')]=_[_0x228f('0x38')](_0x4e9ca8['model'],qs['fields'](_0xc25917['query'][_0x228f('0x3a')]));_0x2a3677[_0x228f('0x39')]=_0x2a3677[_0x228f('0x39')][_0x228f('0x3b')]?_0x2a3677[_0x228f('0x39')]:_0x4e9ca8[_0x228f('0x35')];if(!_0xc25917[_0x228f('0x36')][_0x228f('0x3c')](_0x228f('0x3d'))){_0x2a3677['limit']=qs['limit'](_0xc25917[_0x228f('0x36')][_0x228f('0x24')]);_0x2a3677[_0x228f('0x23')]=qs[_0x228f('0x23')](_0xc25917[_0x228f('0x36')][_0x228f('0x23')]);}_0x2a3677[_0x228f('0x3e')]=qs[_0x228f('0x3f')](_0xc25917[_0x228f('0x36')][_0x228f('0x3f')]);_0x2a3677['where']=qs['filters'](_[_0x228f('0x40')](_0xc25917[_0x228f('0x36')],_0x4e9ca8[_0x228f('0x37')]),_0x40bf17);if(_0xc25917[_0x228f('0x36')]['filter']){_0x2a3677[_0x228f('0x41')]=_[_0x228f('0x42')](_0x2a3677['where'],{'$or':_['map'](_0x40bf17,function(_0x3da115){if(_0x3da115[_0x228f('0x33')]!=='VIRTUAL'){var _0x12a750={};_0x12a750[_0x3da115[_0x228f('0x2e')]]={'$like':'%'+_0xc25917['query']['filter']+'%'};return _0x12a750;}})});}_0x2a3677=_[_0x228f('0x42')]({},_0x2a3677,_0xc25917['options']);var _0x323d68={'where':_0x2a3677[_0x228f('0x41')]};return db[_0x228f('0x43')][_0x228f('0x25')](_0x323d68)[_0x228f('0x2b')](function(_0x20c178){_0x4148ff['count']=_0x20c178;if(_0xc25917[_0x228f('0x36')]['includeAll']){_0x2a3677[_0x228f('0x44')]=[{'all':!![]}];}return db[_0x228f('0x43')][_0x228f('0x45')](_0x2a3677);})[_0x228f('0x2b')](function(_0x41cba5){_0x4148ff[_0x228f('0x46')]=_0x41cba5;return _0x4148ff;})[_0x228f('0x2b')](respondWithFilteredResult(_0xc6921f,_0x2a3677))[_0x228f('0x47')](handleError(_0xc6921f,null));};exports[_0x228f('0x48')]=function(_0x2592a1,_0x788e8b){var _0x345114={'raw':![],'where':{'id':_0x2592a1['params']['id']}},_0x19839d={};_0x19839d['model']=_[_0x228f('0x49')](db[_0x228f('0x43')][_0x228f('0x32')]);_0x19839d[_0x228f('0x36')]=_[_0x228f('0x49')](_0x2592a1[_0x228f('0x36')]);_0x19839d[_0x228f('0x37')]=_[_0x228f('0x38')](_0x19839d[_0x228f('0x35')],_0x19839d[_0x228f('0x36')]);_0x345114['attributes']=_[_0x228f('0x38')](_0x19839d[_0x228f('0x35')],qs['fields'](_0x2592a1[_0x228f('0x36')]['fields']));_0x345114[_0x228f('0x39')]=_0x345114['attributes'][_0x228f('0x3b')]?_0x345114['attributes']:_0x19839d[_0x228f('0x35')];if(_0x2592a1[_0x228f('0x36')][_0x228f('0x4a')]){_0x345114[_0x228f('0x44')]=[{'all':!![]}];}_0x345114=_[_0x228f('0x42')]({},_0x345114,_0x2592a1[_0x228f('0x4b')]);return db[_0x228f('0x43')][_0x228f('0x4c')](_0x345114)[_0x228f('0x2b')](handleEntityNotFound(_0x788e8b,null))[_0x228f('0x2b')](respondWithResult(_0x788e8b,null))[_0x228f('0x47')](handleError(_0x788e8b,null));};exports[_0x228f('0x4d')]=function(_0x4099d4,_0x250345){return db[_0x228f('0x43')][_0x228f('0x4d')](_0x4099d4[_0x228f('0x4e')],{})[_0x228f('0x2b')](respondWithResult(_0x250345,0xc9))[_0x228f('0x47')](handleError(_0x250345,null));};exports['clone']=function(_0x47cb21,_0xa538ce){var _0xed803c={'where':{'id':_0x47cb21['params']['id']}},_0x36299f={};_0x36299f[_0x228f('0x35')]=_[_0x228f('0x49')](db[_0x228f('0x43')]['rawAttributes']);_0xed803c['attributes']=_['intersection'](_0x36299f[_0x228f('0x35')],qs[_0x228f('0x3a')](_0x47cb21[_0x228f('0x36')][_0x228f('0x3a')]));_0xed803c[_0x228f('0x39')]=_0xed803c[_0x228f('0x39')][_0x228f('0x3b')]?_0xed803c[_0x228f('0x39')]:_0x36299f[_0x228f('0x35')];if(_0x47cb21[_0x228f('0x36')][_0x228f('0x4a')]){_0xed803c[_0x228f('0x44')]=[{'all':!![]}];}_0xed803c=_['merge']({},_0xed803c,_0x47cb21[_0x228f('0x4b')]);return db[_0x228f('0x43')][_0x228f('0x4c')](_0xed803c)[_0x228f('0x2b')](handleEntityNotFound(_0xa538ce,null))[_0x228f('0x2b')](function(_0x3da11f){if(_0x3da11f){var _0x671142=_0x3da11f[_0x228f('0x4f')]({'plain':!![]});_0x671142=qs['omit'](_0x671142,['id',_0x228f('0x50'),_0x228f('0x51'),_0x228f('0x52')]);_0x47cb21[_0x228f('0x4e')]=_['omit'](_0x47cb21[_0x228f('0x4e')],['id',_0x228f('0x50'),'updatedAt']);return db[_0x228f('0x53')][_0x228f('0x54')](function(_0x2ed88e){return db[_0x228f('0x43')][_0x228f('0x4d')](_[_0x228f('0x42')](_0x671142,_0x47cb21[_0x228f('0x4e')]),{'include':_0x47cb21[_0x228f('0x36')][_0x228f('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x2ed88e})[_0x228f('0x2b')](function(_0x4fbaa3){var _0x2dddf0=_0x4fbaa3['get']({'plain':!![]});return db[_0x228f('0x55')][_0x228f('0x45')]({'where':{'userProfileId':_0x47cb21[_0x228f('0x56')]['id']},'raw':!![]})[_0x228f('0x2b')](function(_0x1cbc84){if(_0x1cbc84){return BPromise[_0x228f('0x57')](_0x1cbc84,function(_0x1c8be4){return new BPromise(function(_0xadb0e6,_0x56d70f){if(_0x1c8be4[_0x228f('0x58')]===null||_0x1c8be4[_0x228f('0x58')]===0x1)_0xadb0e6(null);return db[_0x228f('0x59')]['findAll']({'where':{'sectionId':_0x1c8be4['id']},'raw':!![]})[_0x228f('0x2b')](function(_0x49d9c5){var _0x1c3cee=_[_0x228f('0x31')](_0x49d9c5,function(_0x4faa3c){return qs[_0x228f('0x5a')](_0x4faa3c,['id',_0x228f('0x50'),_0x228f('0x51'),_0x228f('0x5b')]);});_0xadb0e6(_0x1c3cee);})[_0x228f('0x47')](function(_0x651060){_0x56d70f(_0x651060);});})[_0x228f('0x2b')](function(_0x1b6039){var _0x379e03=qs[_0x228f('0x5a')](_0x1c8be4,['id',_0x228f('0x50'),'updatedAt']);_0x379e03[_0x228f('0x5c')]=_0x2dddf0['id'];if(_0x1b6039)_0x379e03[_0x228f('0x5d')]=_0x1b6039;return _0x379e03;})[_0x228f('0x2b')](function(_0x3be1f3){return db[_0x228f('0x55')]['create'](_0x3be1f3,{'include':[{'model':db['UserProfileResource'],'as':_0x228f('0x5d')}],'raw':!![],'transaction':_0x2ed88e});});})['then'](function(){return _0x2dddf0;});}});});});}})[_0x228f('0x2b')](respondWithResult(_0xa538ce,0xc9))['catch'](handleError(_0xa538ce,null));};exports[_0x228f('0x5e')]=function(_0x903a47,_0x53a6a5){if(_0x903a47[_0x228f('0x4e')]['id']){delete _0x903a47[_0x228f('0x4e')]['id'];}return db[_0x228f('0x43')][_0x228f('0x4c')]({'where':{'id':_0x903a47['params']['id']}})[_0x228f('0x2b')](handleEntityNotFound(_0x53a6a5,null))[_0x228f('0x2b')](saveUpdates(_0x903a47[_0x228f('0x4e')],null))[_0x228f('0x2b')](respondWithResult(_0x53a6a5,null))[_0x228f('0x47')](handleError(_0x53a6a5,null));};exports[_0x228f('0x5f')]=function(_0xf5639c,_0x3691cc){return db['UserProfile'][_0x228f('0x4c')]({'where':{'id':_0xf5639c[_0x228f('0x56')]['id']}})[_0x228f('0x2b')](handleEntityNotFound(_0x3691cc,null))[_0x228f('0x2b')](removeEntity(_0x3691cc,null))[_0x228f('0x47')](handleError(_0x3691cc,null));};exports['describe']=function(_0x1dbd3c,_0x528a96){return db[_0x228f('0x43')][_0x228f('0x60')]()['then'](respondWithResult(_0x528a96,null))[_0x228f('0x47')](handleError(_0x528a96,null));};exports[_0x228f('0x61')]=function(_0x260e70,_0x5eb9ed){var _0x3e7b01=_0x260e70[_0x228f('0x4e')];return db[_0x228f('0x43')][_0x228f('0x4c')]({'where':{'id':_0x260e70[_0x228f('0x56')]['id']}})['then'](handleEntityNotFound(_0x5eb9ed,null))[_0x228f('0x2b')](function(_0x187f84){if(_0x187f84){return db['sequelize']['transaction'](function(_0x3f88a4){return db[_0x228f('0x55')][_0x228f('0x5f')]({'where':{'userProfileId':_0x260e70[_0x228f('0x56')]['id'],'sectionId':_[_0x228f('0x31')](_0x3e7b01,function(_0x1162ca){return _0x1162ca[_0x228f('0x5b')];})},'transaction':_0x3f88a4})[_0x228f('0x2b')](function(){var _0x56244e=_[_0x228f('0x31')](_0x3e7b01,function(_0x47dcfc){_0x47dcfc[_0x228f('0x5c')]=_0x260e70[_0x228f('0x56')]['id'];return _0x47dcfc;});var _0xa4f39e=[];return BPromise[_0x228f('0x57')](_0x56244e,function(_0x3e52b3){return db[_0x228f('0x55')][_0x228f('0x4d')](_0x3e52b3,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x3f88a4})[_0x228f('0x2b')](function(_0x3f9a87){_0xa4f39e[_0x228f('0x62')](_0x3f9a87[_0x228f('0x4f')]({'plain':!![]}));});})[_0x228f('0x2b')](function(){return _0xa4f39e;});});});}})[_0x228f('0x2b')](function(_0x51f4b7){return _0x51f4b7;})[_0x228f('0x2b')](respondWithResult(_0x5eb9ed,null))[_0x228f('0x47')](handleError(_0x5eb9ed,null));};exports[_0x228f('0x63')]=function(_0x178144,_0x3fa413){var _0x1e2a72;return db[_0x228f('0x43')][_0x228f('0x4c')]({'where':{'id':_0x178144[_0x228f('0x56')]['id']},'attributes':['id','name']})[_0x228f('0x2b')](handleEntityNotFound(_0x3fa413,null))[_0x228f('0x2b')](function(_0x47fe2b){if(_0x47fe2b){_0x1e2a72=_0x47fe2b;return db[_0x228f('0x55')][_0x228f('0x5f')]({'where':{'userProfileId':_0x178144['params']['id'],'sectionId':_0x178144['query']['ids']}});}})[_0x228f('0x2b')](function(){return _0x1e2a72;})['then'](respondWithStatusCode(_0x3fa413,null))[_0x228f('0x47')](handleError(_0x3fa413,null));};exports['getSections']=function(_0x256617,_0x234b40){var _0x5c1a7e=[];var _0x27ffdd=[];return db[_0x228f('0x55')][_0x228f('0x45')]({'where':{'userProfileId':_0x256617[_0x228f('0x56')]['id']},'raw':!![]})[_0x228f('0x2b')](function(_0x523b90){_0x5c1a7e=_[_0x228f('0x64')](_0x523b90,function(_0xa477fe){return _0xa477fe[_0x228f('0x65')]===0x1||_[_0x228f('0x66')]([0x3eb,0x709],_0xa477fe[_0x228f('0x5b')]);});if(!_[_0x228f('0x67')](_0x5c1a7e)){return _[_0x228f('0x31')](_0x5c1a7e,function(_0x14af50){return _0x14af50[_0x228f('0x5b')];});}else{return;}})['then'](function(_0x74fe35){if(_0x74fe35)_0x27ffdd=_0x74fe35;if(_[_0x228f('0x66')](_0x27ffdd,0x64)){var _0x4a49c4=_['find'](_0x5c1a7e,{'sectionId':0x64});return hasDefaultDashboard(_0x4a49c4)['then'](function(_0x5c0359){return _[_0x228f('0x31')](_0x5c1a7e,function(_0x5e3a6e){if(_0x5e3a6e[_0x228f('0x5b')]===0x64){_0x5e3a6e[_0x228f('0x68')]=_0x5c0359;}return _0x5e3a6e;});});}else{return;}})['then'](function(_0x1e24fd){if(_0x1e24fd)_0x5c1a7e=_0x1e24fd;if(_[_0x228f('0x66')](_0x27ffdd,0x3eb)){var _0x588741=_[_0x228f('0x4c')](_0x5c1a7e,{'sectionId':0x3eb});return getCustomDashboards(_0x588741)[_0x228f('0x2b')](function(_0x344dab){return _[_0x228f('0x31')](_0x5c1a7e,function(_0x5b29d3){if(_0x588741[_0x228f('0x65')]){if(_0x5b29d3[_0x228f('0x5b')]===0x3eb){_0x5b29d3[_0x228f('0x68')]=_0x344dab;}}else{if(_0x5b29d3[_0x228f('0x5b')]===0x64){_0x5b29d3[_0x228f('0x68')]=_0x344dab;}}return _0x5b29d3;});});}else{return;}})[_0x228f('0x2b')](function(_0x2c3a62){if(_0x2c3a62)_0x5c1a7e=_0x2c3a62;if(_[_0x228f('0x66')](_0x27ffdd,0x709)){var _0x2a98a1=_['find'](_0x5c1a7e,{'sectionId':0x709});return getPlugins(_0x2a98a1)[_0x228f('0x2b')](function(_0x3e45d5){if(_0x2a98a1[_0x228f('0x65')]){return _[_0x228f('0x31')](_0x5c1a7e,function(_0x280ff5){if(_0x280ff5['sectionId']===0x709){_0x280ff5['subsections']=_0x3e45d5;}return _0x280ff5;});}else{var _0x31d88f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3e45d5};var _0x54f8f8=_[_0x228f('0x31')](_0x5c1a7e);_0x54f8f8['push'](_0x31d88f);return _0x54f8f8;}});}else{return;}})[_0x228f('0x2b')](function(_0x5ba669){if(_0x5ba669)_0x5c1a7e=_0x5ba669;return _[_0x228f('0x64')](_0x5c1a7e,[_0x228f('0x65'),0x1]);})[_0x228f('0x2b')](respondWithResult(_0x234b40,null))[_0x228f('0x47')](handleError(_0x234b40,null));};function hasDefaultDashboard(_0xca55ab){var _0x21bb92=[0x65];return new BPromise(function(_0xabfc69,_0x2fc1f7){try{if(_0xca55ab[_0x228f('0x58')]){_0xabfc69(_0x21bb92);}else{return db[_0x228f('0x59')][_0x228f('0x69')]({'where':{'sectionId':_0xca55ab['id']},'raw':!![]})[_0x228f('0x2b')](function(_0x186f00){_0x186f00?_0xabfc69(_0x21bb92):_0xabfc69();});}}catch(_0x301377){_0x2fc1f7(_0x301377);}});}function getCustomDashboards(_0x3ea6ca){var _0x3ca8fb=[];return new BPromise(function(_0x5babee,_0x2c27f7){try{if(_0x3ea6ca[_0x228f('0x58')]){return db[_0x228f('0x6a')]['findAll']({'raw':!![]})[_0x228f('0x2b')](function(_0x56e618){_0x56e618['forEach'](function(_0x4dc8ad){_0x3ca8fb[_0x228f('0x62')](_0x4dc8ad['id']+0x1869f);});_0x5babee(_0x3ca8fb);});}else{return db['UserProfileResource'][_0x228f('0x45')]({'where':{'sectionId':_0x3ea6ca['id']},'raw':!![]})[_0x228f('0x2b')](function(_0x4c02cb){_0x4c02cb[_0x228f('0x6b')](function(_0x3afb8e){_0x3ca8fb['push'](_0x3afb8e[_0x228f('0x6c')]+0x1869f);});_0x5babee(_0x3ca8fb);});}}catch(_0x620f5a){_0x2c27f7(_0x620f5a);}});}function getPlugins(_0x54d239){var _0x534b73=[];return new BPromise(function(_0x2dfcee,_0x1ab5b1){try{if(_0x54d239[_0x228f('0x58')]){return db[_0x228f('0x6d')]['findAll']({'raw':!![]})[_0x228f('0x2b')](function(_0x19000c){_0x19000c['forEach'](function(_0x191bd5){_0x534b73[_0x228f('0x62')](_0x191bd5['id']+0x15b38);});_0x2dfcee(_0x534b73);});}else{return db[_0x228f('0x59')][_0x228f('0x45')]({'where':{'sectionId':_0x54d239['id']},'raw':!![]})[_0x228f('0x2b')](function(_0x30157c){_0x30157c[_0x228f('0x6b')](function(_0x25809c){_0x534b73['push'](_0x25809c[_0x228f('0x6c')]+0x15b38);});_0x2dfcee(_0x534b73);});}}catch(_0x597271){_0x1ab5b1(_0x597271);}});}exports['addResources']=function(_0x47eba6,_0x5ac69a){return db[_0x228f('0x43')][_0x228f('0x4c')]({'where':{'id':_0x47eba6[_0x228f('0x56')]['id']}})[_0x228f('0x2b')](handleEntityNotFound(_0x5ac69a,null))[_0x228f('0x2b')](function(_0x252d24){if(_0x252d24){return db[_0x228f('0x53')]['transaction'](function(_0x1a97f7){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x47eba6['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x2d2fd7){if(_0x2d2fd7){return db['UserProfileSection'][_0x228f('0x5f')]({'where':{'userProfileId':_0x47eba6[_0x228f('0x56')]['id'],'id':_[_0x228f('0x31')](_0x2d2fd7,function(_0x29da9b){return _0x29da9b['id'];})},'transaction':_0x1a97f7});}})['then'](function(_0x3302cf){var _0x1e681a=_[_0x228f('0x31')](_0x47eba6[_0x228f('0x4e')],function(_0x1f3275){_0x1f3275[_0x228f('0x5c')]=_0x47eba6[_0x228f('0x56')]['id'];return _0x1f3275;});return db[_0x228f('0x55')][_0x228f('0x6e')](_0x1e681a,{'raw':!![],'transaction':_0x1a97f7});})[_0x228f('0x2b')](function(_0xea3156){var _0x59b7ae=_['filter'](_['map'](_0xea3156,function(_0x16b42c){return _0x16b42c[_0x228f('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x59b7ae){return db[_0x228f('0x55')][_0x228f('0x45')]({'where':{'userProfileId':_0x47eba6[_0x228f('0x56')]['id'],'sectionId':_[_0x228f('0x31')](_0x59b7ae,function(_0x163c43){return _0x163c43[_0x228f('0x5b')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x228f('0x2b')](function(_0x46bf00){var _0x433c1f=_[_0x228f('0x31')](_0x47eba6[_0x228f('0x4e')],function(_0x11b7ce){_0x11b7ce[_0x228f('0x5c')]=_0x47eba6[_0x228f('0x56')]['id'];return _0x11b7ce;});return db[_0x228f('0x59')]['bulkCreate'](_0x433c1f,{'raw':!![],'transaction':_0x1a97f7});});}})[_0x228f('0x47')](handleError(_0x5ac69a,null));});}})[_0x228f('0x2b')](function(_0xecea94){var _0x588d16=_['map'](_0xecea94,function(_0x211902){return _0x211902['get']({'plain':!![]});});})[_0x228f('0x2b')](respondWithResult(_0x5ac69a,null))[_0x228f('0x47')](handleError(_0x5ac69a,null));};exports[_0x228f('0x6f')]=function(_0xaad86d,_0x590b79,_0x2344f4){return db[_0x228f('0x43')][_0x228f('0x4c')]({'where':{'id':_0xaad86d[_0x228f('0x56')]['id']}})['then'](handleEntityNotFound(_0x590b79,null))['then'](function(_0x2e8338){if(_0x2e8338){return _0x2e8338['removeResources'](_0xaad86d[_0x228f('0x36')]['ids']);}})['then'](respondWithStatusCode(_0x590b79,null))['catch'](handleError(_0x590b79,null));};exports[_0x228f('0x70')]=function(_0x4865e5,_0x3d20c9){var _0x3067d3={};if(!_0x4865e5[_0x228f('0x36')][_0x228f('0x71')])throw new Error(_0x228f('0x72'));if(!_0x4865e5[_0x228f('0x36')][_0x228f('0x3c')](_0x228f('0x3d'))){_0x3067d3[_0x228f('0x24')]=qs[_0x228f('0x24')](_0x4865e5[_0x228f('0x36')][_0x228f('0x24')]);_0x3067d3[_0x228f('0x23')]=qs[_0x228f('0x23')](_0x4865e5[_0x228f('0x36')][_0x228f('0x23')]);}return db[_0x228f('0x43')]['find']({'where':{'id':_0x4865e5[_0x228f('0x56')]['id']}})[_0x228f('0x2b')](function(_0x553895){if(!_0x553895)throw new Error(_0x228f('0x73')+_0x4865e5[_0x228f('0x56')]['id']);return db[_0x228f('0x43')][_0x228f('0x70')](_0x4865e5);})['then'](respondWithFilteredResult(_0x3d20c9,_0x3067d3))[_0x228f('0x47')](handleError(_0x3d20c9,null));};
\ No newline at end of file
+var _0xdb28=['each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','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','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','VIRTUAL','options','UserProfile','includeAll','include','findAll','rows','catch','show','params','find','create','body','clone','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','UserProfileSection'];(function(_0x4d8789,_0x3fdff1){var _0x404e41=function(_0x33d5a6){while(--_0x33d5a6){_0x4d8789['push'](_0x4d8789['shift']());}};_0x404e41(++_0x3fdff1);}(_0xdb28,0x106));var _0x8db2=function(_0x439a6,_0x150444){_0x439a6=_0x439a6-0x0;var _0x3229cf=_0xdb28[_0x439a6];return _0x3229cf;};'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'];config[_0x8db2('0x19')]=_[_0x8db2('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8db2('0x1b'))(new Redis(config[_0x8db2('0x19')]));require(_0x8db2('0x1c'))[_0x8db2('0x1d')](socket);function respondWithStatusCode(_0x227355,_0xfa285b){_0xfa285b=_0xfa285b||0xcc;return function(_0x2f177a){if(_0x2f177a){return _0x227355[_0x8db2('0x1e')](_0xfa285b);}return _0x227355[_0x8db2('0x1f')](_0xfa285b)[_0x8db2('0x20')]();};}function respondWithResult(_0x5489a9,_0x13b0f5){_0x13b0f5=_0x13b0f5||0xc8;return function(_0x24da1b){if(_0x24da1b){return _0x5489a9['status'](_0x13b0f5)[_0x8db2('0x21')](_0x24da1b);}};}function respondWithFilteredResult(_0x44957d,_0x21db8c){return function(_0x3fddc2){if(_0x3fddc2){var _0x2efd06=typeof _0x21db8c[_0x8db2('0x22')]==='undefined'&&typeof _0x21db8c['limit']===_0x8db2('0x23');var _0x104e33=_0x3fddc2[_0x8db2('0x24')];var _0x1b64e4=_0x2efd06?0x0:_0x21db8c['offset'];var _0x431d60=_0x2efd06?_0x3fddc2[_0x8db2('0x24')]:_0x21db8c[_0x8db2('0x22')]+_0x21db8c[_0x8db2('0x25')];var _0x3dbe8e;if(_0x431d60>=_0x104e33){_0x431d60=_0x104e33;_0x3dbe8e=0xc8;}else{_0x3dbe8e=0xce;}_0x44957d['status'](_0x3dbe8e);return _0x44957d[_0x8db2('0x26')](_0x8db2('0x27'),_0x1b64e4+'-'+_0x431d60+'/'+_0x104e33)[_0x8db2('0x21')](_0x3fddc2);}return null;};}function patchUpdates(_0x125be2){return function(_0x2260d8){try{jsonpatch[_0x8db2('0x28')](_0x2260d8,_0x125be2,!![]);}catch(_0x796ec1){return BPromise['reject'](_0x796ec1);}return _0x2260d8[_0x8db2('0x29')]();};}function saveUpdates(_0x4f6516,_0x5725f0){return function(_0x52a9ca){if(_0x52a9ca){return _0x52a9ca['update'](_0x4f6516)[_0x8db2('0x2a')](function(_0x29b5cd){return _0x29b5cd;});}return null;};}function removeEntity(_0x3be281,_0x2baed0){return function(_0x145328){if(_0x145328){return _0x145328[_0x8db2('0x2b')]()['then'](function(){_0x3be281[_0x8db2('0x1f')](0xcc)[_0x8db2('0x20')]();});}};}function handleEntityNotFound(_0x430dd5,_0x8b7cec){return function(_0x483aee){if(!_0x483aee){_0x430dd5[_0x8db2('0x1e')](0x194);}return _0x483aee;};}function handleError(_0x11f398,_0x241baf){_0x241baf=_0x241baf||0x1f4;return function(_0x1687ed){logger[_0x8db2('0x2c')](_0x1687ed[_0x8db2('0x2d')]);if(_0x1687ed[_0x8db2('0x2e')]){delete _0x1687ed[_0x8db2('0x2e')];}_0x11f398[_0x8db2('0x1f')](_0x241baf)['send'](_0x1687ed);};}exports[_0x8db2('0x2f')]=function(_0x50b28d,_0x59cb77){var _0x302188={},_0x25ed2c={},_0xcc8a66={'count':0x0,'rows':[]};var _0x49b2b3=_[_0x8db2('0x30')](db['UserProfile'][_0x8db2('0x31')],function(_0x2b653b){return{'name':_0x2b653b[_0x8db2('0x32')],'type':_0x2b653b['type']['key']};});_0x25ed2c[_0x8db2('0x33')]=_[_0x8db2('0x30')](_0x49b2b3,'name');_0x25ed2c['query']=_[_0x8db2('0x34')](_0x50b28d[_0x8db2('0x35')]);_0x25ed2c[_0x8db2('0x36')]=_[_0x8db2('0x37')](_0x25ed2c[_0x8db2('0x33')],_0x25ed2c[_0x8db2('0x35')]);_0x302188[_0x8db2('0x38')]=_[_0x8db2('0x37')](_0x25ed2c[_0x8db2('0x33')],qs[_0x8db2('0x39')](_0x50b28d['query'][_0x8db2('0x39')]));_0x302188[_0x8db2('0x38')]=_0x302188['attributes'][_0x8db2('0x3a')]?_0x302188[_0x8db2('0x38')]:_0x25ed2c['model'];if(!_0x50b28d['query'][_0x8db2('0x3b')]('nolimit')){_0x302188[_0x8db2('0x25')]=qs[_0x8db2('0x25')](_0x50b28d[_0x8db2('0x35')][_0x8db2('0x25')]);_0x302188['offset']=qs[_0x8db2('0x22')](_0x50b28d['query'][_0x8db2('0x22')]);}_0x302188[_0x8db2('0x3c')]=qs[_0x8db2('0x3d')](_0x50b28d[_0x8db2('0x35')]['sort']);_0x302188['where']=qs[_0x8db2('0x36')](_[_0x8db2('0x3e')](_0x50b28d['query'],_0x25ed2c[_0x8db2('0x36')]),_0x49b2b3);if(_0x50b28d[_0x8db2('0x35')][_0x8db2('0x3f')]){_0x302188['where']=_[_0x8db2('0x40')](_0x302188[_0x8db2('0x41')],{'$or':_[_0x8db2('0x30')](_0x49b2b3,function(_0x279e74){if(_0x279e74[_0x8db2('0x42')]!==_0x8db2('0x43')){var _0x380046={};_0x380046[_0x279e74[_0x8db2('0x2e')]]={'$like':'%'+_0x50b28d[_0x8db2('0x35')][_0x8db2('0x3f')]+'%'};return _0x380046;}})});}_0x302188=_[_0x8db2('0x40')]({},_0x302188,_0x50b28d[_0x8db2('0x44')]);var _0x1d9025={'where':_0x302188['where']};return db[_0x8db2('0x45')][_0x8db2('0x24')](_0x1d9025)['then'](function(_0x49a7ae){_0xcc8a66[_0x8db2('0x24')]=_0x49a7ae;if(_0x50b28d['query'][_0x8db2('0x46')]){_0x302188[_0x8db2('0x47')]=[{'all':!![]}];}return db[_0x8db2('0x45')][_0x8db2('0x48')](_0x302188);})[_0x8db2('0x2a')](function(_0x30d606){_0xcc8a66[_0x8db2('0x49')]=_0x30d606;return _0xcc8a66;})['then'](respondWithFilteredResult(_0x59cb77,_0x302188))[_0x8db2('0x4a')](handleError(_0x59cb77,null));};exports[_0x8db2('0x4b')]=function(_0x40c69e,_0x4a0b56){var _0x482b26={'raw':![],'where':{'id':_0x40c69e[_0x8db2('0x4c')]['id']}},_0x424c27={};_0x424c27[_0x8db2('0x33')]=_[_0x8db2('0x34')](db['UserProfile'][_0x8db2('0x31')]);_0x424c27['query']=_[_0x8db2('0x34')](_0x40c69e[_0x8db2('0x35')]);_0x424c27[_0x8db2('0x36')]=_['intersection'](_0x424c27['model'],_0x424c27[_0x8db2('0x35')]);_0x482b26['attributes']=_[_0x8db2('0x37')](_0x424c27[_0x8db2('0x33')],qs[_0x8db2('0x39')](_0x40c69e[_0x8db2('0x35')][_0x8db2('0x39')]));_0x482b26[_0x8db2('0x38')]=_0x482b26[_0x8db2('0x38')][_0x8db2('0x3a')]?_0x482b26[_0x8db2('0x38')]:_0x424c27[_0x8db2('0x33')];if(_0x40c69e[_0x8db2('0x35')][_0x8db2('0x46')]){_0x482b26['include']=[{'all':!![]}];}_0x482b26=_[_0x8db2('0x40')]({},_0x482b26,_0x40c69e[_0x8db2('0x44')]);return db[_0x8db2('0x45')][_0x8db2('0x4d')](_0x482b26)['then'](handleEntityNotFound(_0x4a0b56,null))['then'](respondWithResult(_0x4a0b56,null))[_0x8db2('0x4a')](handleError(_0x4a0b56,null));};exports[_0x8db2('0x4e')]=function(_0x164020,_0x4c66e5){return db['UserProfile']['create'](_0x164020[_0x8db2('0x4f')],{})[_0x8db2('0x2a')](respondWithResult(_0x4c66e5,0xc9))[_0x8db2('0x4a')](handleError(_0x4c66e5,null));};exports[_0x8db2('0x50')]=function(_0xaab731,_0x4195ef){var _0x2fa118={'where':{'id':_0xaab731['params']['id']}},_0x511718={};_0x511718[_0x8db2('0x33')]=_[_0x8db2('0x34')](db[_0x8db2('0x45')][_0x8db2('0x31')]);_0x2fa118[_0x8db2('0x38')]=_[_0x8db2('0x37')](_0x511718[_0x8db2('0x33')],qs[_0x8db2('0x39')](_0xaab731[_0x8db2('0x35')][_0x8db2('0x39')]));_0x2fa118[_0x8db2('0x38')]=_0x2fa118[_0x8db2('0x38')][_0x8db2('0x3a')]?_0x2fa118[_0x8db2('0x38')]:_0x511718[_0x8db2('0x33')];if(_0xaab731['query'][_0x8db2('0x46')]){_0x2fa118[_0x8db2('0x47')]=[{'all':!![]}];}_0x2fa118=_['merge']({},_0x2fa118,_0xaab731[_0x8db2('0x44')]);return db[_0x8db2('0x45')][_0x8db2('0x4d')](_0x2fa118)['then'](handleEntityNotFound(_0x4195ef,null))[_0x8db2('0x2a')](function(_0x27acd2){if(_0x27acd2){var _0x1872fa=_0x27acd2[_0x8db2('0x51')]({'plain':!![]});_0x1872fa=qs[_0x8db2('0x52')](_0x1872fa,['id','createdAt',_0x8db2('0x53'),_0x8db2('0x54')]);_0xaab731[_0x8db2('0x4f')]=_['omit'](_0xaab731[_0x8db2('0x4f')],['id',_0x8db2('0x55'),_0x8db2('0x53')]);return db[_0x8db2('0x56')][_0x8db2('0x57')](function(_0x16d897){return db[_0x8db2('0x45')]['create'](_[_0x8db2('0x40')](_0x1872fa,_0xaab731[_0x8db2('0x4f')]),{'include':_0xaab731['query'][_0x8db2('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x16d897})[_0x8db2('0x2a')](function(_0x533e41){var _0x107bbe=_0x533e41[_0x8db2('0x51')]({'plain':!![]});return db[_0x8db2('0x58')][_0x8db2('0x48')]({'where':{'userProfileId':_0xaab731[_0x8db2('0x4c')]['id']},'raw':!![]})[_0x8db2('0x2a')](function(_0x10f267){if(_0x10f267){return BPromise[_0x8db2('0x59')](_0x10f267,function(_0x120ef2){return new BPromise(function(_0x173a5e,_0x12fd12){if(_0x120ef2[_0x8db2('0x5a')]===null||_0x120ef2[_0x8db2('0x5a')]===0x1)_0x173a5e(null);return db[_0x8db2('0x5b')][_0x8db2('0x48')]({'where':{'sectionId':_0x120ef2['id']},'raw':!![]})[_0x8db2('0x2a')](function(_0x4a20a7){var _0xe0c3e=_[_0x8db2('0x30')](_0x4a20a7,function(_0x44118a){return qs[_0x8db2('0x52')](_0x44118a,['id',_0x8db2('0x55'),'updatedAt',_0x8db2('0x5c')]);});_0x173a5e(_0xe0c3e);})[_0x8db2('0x4a')](function(_0x3ab670){_0x12fd12(_0x3ab670);});})[_0x8db2('0x2a')](function(_0x2ad70f){var _0x348da8=qs[_0x8db2('0x52')](_0x120ef2,['id',_0x8db2('0x55'),_0x8db2('0x53')]);_0x348da8[_0x8db2('0x5d')]=_0x107bbe['id'];if(_0x2ad70f)_0x348da8[_0x8db2('0x5e')]=_0x2ad70f;return _0x348da8;})[_0x8db2('0x2a')](function(_0x170a72){return db[_0x8db2('0x58')][_0x8db2('0x4e')](_0x170a72,{'include':[{'model':db[_0x8db2('0x5b')],'as':_0x8db2('0x5e')}],'raw':!![],'transaction':_0x16d897});});})[_0x8db2('0x2a')](function(){return _0x107bbe;});}});});});}})['then'](respondWithResult(_0x4195ef,0xc9))[_0x8db2('0x4a')](handleError(_0x4195ef,null));};exports['update']=function(_0x364176,_0x570c53){if(_0x364176[_0x8db2('0x4f')]['id']){delete _0x364176[_0x8db2('0x4f')]['id'];}return db[_0x8db2('0x45')][_0x8db2('0x4d')]({'where':{'id':_0x364176[_0x8db2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x570c53,null))['then'](saveUpdates(_0x364176[_0x8db2('0x4f')],null))[_0x8db2('0x2a')](respondWithResult(_0x570c53,null))[_0x8db2('0x4a')](handleError(_0x570c53,null));};exports[_0x8db2('0x2b')]=function(_0x20b49c,_0x1f28d2){return db[_0x8db2('0x45')][_0x8db2('0x4d')]({'where':{'id':_0x20b49c['params']['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0x1f28d2,null))[_0x8db2('0x2a')](removeEntity(_0x1f28d2,null))[_0x8db2('0x4a')](handleError(_0x1f28d2,null));};exports[_0x8db2('0x5f')]=function(_0x250150,_0x382c75){return db[_0x8db2('0x45')][_0x8db2('0x5f')]()['then'](respondWithResult(_0x382c75,null))['catch'](handleError(_0x382c75,null));};exports[_0x8db2('0x60')]=function(_0x2f8beb,_0x1d2dfc){var _0x27f4cd=_0x2f8beb[_0x8db2('0x4f')];return db['UserProfile']['find']({'where':{'id':_0x2f8beb[_0x8db2('0x4c')]['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0x1d2dfc,null))['then'](function(_0xa698bd){if(_0xa698bd){return db[_0x8db2('0x56')][_0x8db2('0x57')](function(_0x5093e8){return db[_0x8db2('0x58')][_0x8db2('0x2b')]({'where':{'userProfileId':_0x2f8beb[_0x8db2('0x4c')]['id'],'sectionId':_['map'](_0x27f4cd,function(_0x3ff023){return _0x3ff023[_0x8db2('0x5c')];})},'transaction':_0x5093e8})[_0x8db2('0x2a')](function(){var _0x98f91b=_[_0x8db2('0x30')](_0x27f4cd,function(_0x5923b3){_0x5923b3[_0x8db2('0x5d')]=_0x2f8beb[_0x8db2('0x4c')]['id'];return _0x5923b3;});var _0x150439=[];return BPromise['each'](_0x98f91b,function(_0x59e740){return db[_0x8db2('0x58')][_0x8db2('0x4e')](_0x59e740,{'include':[{'model':db['UserProfileResource'],'as':_0x8db2('0x5e')}],'raw':!![],'transaction':_0x5093e8})[_0x8db2('0x2a')](function(_0x199687){_0x150439[_0x8db2('0x61')](_0x199687[_0x8db2('0x51')]({'plain':!![]}));});})[_0x8db2('0x2a')](function(){return _0x150439;});});});}})[_0x8db2('0x2a')](function(_0x3349f1){return _0x3349f1;})[_0x8db2('0x2a')](respondWithResult(_0x1d2dfc,null))[_0x8db2('0x4a')](handleError(_0x1d2dfc,null));};exports[_0x8db2('0x62')]=function(_0x3e1478,_0x24a52d){var _0x5f2aa6;return db[_0x8db2('0x45')]['find']({'where':{'id':_0x3e1478[_0x8db2('0x4c')]['id']},'attributes':['id',_0x8db2('0x2e')]})['then'](handleEntityNotFound(_0x24a52d,null))[_0x8db2('0x2a')](function(_0x2fa89d){if(_0x2fa89d){_0x5f2aa6=_0x2fa89d;return db['UserProfileSection'][_0x8db2('0x2b')]({'where':{'userProfileId':_0x3e1478[_0x8db2('0x4c')]['id'],'sectionId':_0x3e1478[_0x8db2('0x35')][_0x8db2('0x63')]}});}})[_0x8db2('0x2a')](function(){return _0x5f2aa6;})[_0x8db2('0x2a')](respondWithStatusCode(_0x24a52d,null))[_0x8db2('0x4a')](handleError(_0x24a52d,null));};exports[_0x8db2('0x64')]=function(_0x1afd36,_0x5dd92b){var _0x4f9fbd=[];var _0x198c3b=[];return db['UserProfileSection'][_0x8db2('0x48')]({'where':{'userProfileId':_0x1afd36[_0x8db2('0x4c')]['id']},'raw':!![]})[_0x8db2('0x2a')](function(_0x58479c){_0x4f9fbd=_[_0x8db2('0x3f')](_0x58479c,function(_0x9675c1){return _0x9675c1[_0x8db2('0x65')]===0x1||_['includes']([0x3eb,0x709],_0x9675c1[_0x8db2('0x5c')]);});if(!_[_0x8db2('0x66')](_0x4f9fbd)){return _[_0x8db2('0x30')](_0x4f9fbd,function(_0x432413){return _0x432413['sectionId'];});}else{return;}})[_0x8db2('0x2a')](function(_0x5f61b8){if(_0x5f61b8)_0x198c3b=_0x5f61b8;if(_[_0x8db2('0x67')](_0x198c3b,0x64)){var _0x1edb1a=_[_0x8db2('0x4d')](_0x4f9fbd,{'sectionId':0x64});return hasDefaultDashboard(_0x1edb1a)[_0x8db2('0x2a')](function(_0x1aadfb){return _[_0x8db2('0x30')](_0x4f9fbd,function(_0x358f48){if(_0x358f48[_0x8db2('0x5c')]===0x64){_0x358f48[_0x8db2('0x68')]=_0x1aadfb;}return _0x358f48;});});}else{return;}})['then'](function(_0x2450fb){if(_0x2450fb)_0x4f9fbd=_0x2450fb;if(_[_0x8db2('0x67')](_0x198c3b,0x3eb)){var _0x377fb4=_['find'](_0x4f9fbd,{'sectionId':0x3eb});return getCustomDashboards(_0x377fb4)['then'](function(_0x556666){return _[_0x8db2('0x30')](_0x4f9fbd,function(_0xdba223){if(_0x377fb4[_0x8db2('0x65')]){if(_0xdba223[_0x8db2('0x5c')]===0x3eb){_0xdba223[_0x8db2('0x68')]=_0x556666;}}else{if(_0xdba223[_0x8db2('0x5c')]===0x64){_0xdba223[_0x8db2('0x68')]=_0x556666;}}return _0xdba223;});});}else{return;}})[_0x8db2('0x2a')](function(_0x3b1929){if(_0x3b1929)_0x4f9fbd=_0x3b1929;if(_[_0x8db2('0x67')](_0x198c3b,0x709)){var _0x46eb80=_['find'](_0x4f9fbd,{'sectionId':0x709});return getPlugins(_0x46eb80)[_0x8db2('0x2a')](function(_0xa2e293){if(_0x46eb80[_0x8db2('0x65')]){return _[_0x8db2('0x30')](_0x4f9fbd,function(_0x49341c){if(_0x49341c['sectionId']===0x709){_0x49341c[_0x8db2('0x68')]=_0xa2e293;}return _0x49341c;});}else{var _0x3c3f3e={'sectionId':0x76c,'enabled':0x1,'subsections':_0xa2e293};var _0x4a89e7=_[_0x8db2('0x30')](_0x4f9fbd);_0x4a89e7[_0x8db2('0x61')](_0x3c3f3e);return _0x4a89e7;}});}else{return;}})[_0x8db2('0x2a')](function(_0x5f2ece){if(_0x5f2ece)_0x4f9fbd=_0x5f2ece;return _['filter'](_0x4f9fbd,['enabled',0x1]);})[_0x8db2('0x2a')](respondWithResult(_0x5dd92b,null))[_0x8db2('0x4a')](handleError(_0x5dd92b,null));};function hasDefaultDashboard(_0x281e48){var _0x3dc3d4=[0x65];return new BPromise(function(_0x192c02,_0x4e8aac){try{if(_0x281e48[_0x8db2('0x5a')]){_0x192c02(_0x3dc3d4);}else{return db['UserProfileResource'][_0x8db2('0x69')]({'where':{'sectionId':_0x281e48['id']},'raw':!![]})[_0x8db2('0x2a')](function(_0xa083b1){_0xa083b1?_0x192c02(_0x3dc3d4):_0x192c02();});}}catch(_0x18d1eb){_0x4e8aac(_0x18d1eb);}});}function getCustomDashboards(_0x3f3040){var _0x5d5380=[];return new BPromise(function(_0x4e0834,_0x45cce8){try{if(_0x3f3040['autoAssociation']){return db[_0x8db2('0x6a')][_0x8db2('0x48')]({'raw':!![]})[_0x8db2('0x2a')](function(_0x1e7bc2){_0x1e7bc2[_0x8db2('0x6b')](function(_0x456d5e){_0x5d5380['push'](_0x456d5e['id']+0x1869f);});_0x4e0834(_0x5d5380);});}else{return db[_0x8db2('0x5b')][_0x8db2('0x48')]({'where':{'sectionId':_0x3f3040['id']},'raw':!![]})[_0x8db2('0x2a')](function(_0x549725){_0x549725[_0x8db2('0x6b')](function(_0x34804e){_0x5d5380['push'](_0x34804e[_0x8db2('0x6c')]+0x1869f);});_0x4e0834(_0x5d5380);});}}catch(_0x7cb97d){_0x45cce8(_0x7cb97d);}});}function getPlugins(_0x11fabf){var _0x15307d=[];return new BPromise(function(_0x105aa6,_0x32e8a3){try{if(_0x11fabf[_0x8db2('0x5a')]){return db[_0x8db2('0x6d')][_0x8db2('0x48')]({'raw':!![]})['then'](function(_0x44c0cc){_0x44c0cc[_0x8db2('0x6b')](function(_0x1c37b7){_0x15307d[_0x8db2('0x61')](_0x1c37b7['id']+0x15b38);});_0x105aa6(_0x15307d);});}else{return db[_0x8db2('0x5b')][_0x8db2('0x48')]({'where':{'sectionId':_0x11fabf['id']},'raw':!![]})[_0x8db2('0x2a')](function(_0x95cf3){_0x95cf3[_0x8db2('0x6b')](function(_0x39633b){_0x15307d['push'](_0x39633b[_0x8db2('0x6c')]+0x15b38);});_0x105aa6(_0x15307d);});}}catch(_0x7e4bf){_0x32e8a3(_0x7e4bf);}});}exports[_0x8db2('0x6e')]=function(_0x1587e8,_0x5d371b){return db[_0x8db2('0x45')][_0x8db2('0x4d')]({'where':{'id':_0x1587e8[_0x8db2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5d371b,null))['then'](function(_0x1fdeee){if(_0x1fdeee){return db[_0x8db2('0x56')][_0x8db2('0x57')](function(_0xc83913){return db['UserProfileSection'][_0x8db2('0x48')]({'where':{'userProfileId':_0x1587e8[_0x8db2('0x4c')]['id']},'attributes':['id'],'raw':!![]})[_0x8db2('0x2a')](function(_0x3d298e){if(_0x3d298e){return db['UserProfileSection'][_0x8db2('0x2b')]({'where':{'userProfileId':_0x1587e8[_0x8db2('0x4c')]['id'],'id':_[_0x8db2('0x30')](_0x3d298e,function(_0x5121be){return _0x5121be['id'];})},'transaction':_0xc83913});}})['then'](function(_0x54a645){var _0x1ba097=_[_0x8db2('0x30')](_0x1587e8[_0x8db2('0x4f')],function(_0x4ef212){_0x4ef212['userProfileId']=_0x1587e8['params']['id'];return _0x4ef212;});return db[_0x8db2('0x58')][_0x8db2('0x6f')](_0x1ba097,{'raw':!![],'transaction':_0xc83913});})[_0x8db2('0x2a')](function(_0x39f08f){var _0x2cb15d=_[_0x8db2('0x3f')](_['map'](_0x39f08f,function(_0x2942eb){return _0x2942eb['get']({'plain':!![]});}),{'includeAll':![]});if(_0x2cb15d){return db[_0x8db2('0x58')][_0x8db2('0x48')]({'where':{'userProfileId':_0x1587e8[_0x8db2('0x4c')]['id'],'sectionId':_[_0x8db2('0x30')](_0x2cb15d,function(_0x26d3ff){return _0x26d3ff['sectionId'];})},'attributes':['id',_0x8db2('0x5c')],'raw':!![]})[_0x8db2('0x2a')](function(_0x54d36d){var _0x28beec=_[_0x8db2('0x30')](_0x1587e8[_0x8db2('0x4f')],function(_0x1c184c){_0x1c184c['userProfileId']=_0x1587e8[_0x8db2('0x4c')]['id'];return _0x1c184c;});return db['UserProfileResource']['bulkCreate'](_0x28beec,{'raw':!![],'transaction':_0xc83913});});}})[_0x8db2('0x4a')](handleError(_0x5d371b,null));});}})[_0x8db2('0x2a')](function(_0x9b563c){var _0x256f16=_[_0x8db2('0x30')](_0x9b563c,function(_0x46254a){return _0x46254a[_0x8db2('0x51')]({'plain':!![]});});})['then'](respondWithResult(_0x5d371b,null))[_0x8db2('0x4a')](handleError(_0x5d371b,null));};exports['removeResources']=function(_0x4bbf03,_0x2f473e,_0x4ced3e){return db['UserProfile'][_0x8db2('0x4d')]({'where':{'id':_0x4bbf03[_0x8db2('0x4c')]['id']}})[_0x8db2('0x2a')](handleEntityNotFound(_0x2f473e,null))['then'](function(_0x211460){if(_0x211460){return _0x211460[_0x8db2('0x70')](_0x4bbf03[_0x8db2('0x35')]['ids']);}})[_0x8db2('0x2a')](respondWithStatusCode(_0x2f473e,null))[_0x8db2('0x4a')](handleError(_0x2f473e,null));};exports[_0x8db2('0x71')]=function(_0x7ff636,_0x248280){var _0x63bfc2={};if(!_0x7ff636[_0x8db2('0x35')][_0x8db2('0x72')])throw new Error('Missing\x20section\x20parameter');if(!_0x7ff636[_0x8db2('0x35')][_0x8db2('0x3b')](_0x8db2('0x73'))){_0x63bfc2[_0x8db2('0x25')]=qs[_0x8db2('0x25')](_0x7ff636[_0x8db2('0x35')][_0x8db2('0x25')]);_0x63bfc2[_0x8db2('0x22')]=qs[_0x8db2('0x22')](_0x7ff636[_0x8db2('0x35')][_0x8db2('0x22')]);}return db['UserProfile'][_0x8db2('0x4d')]({'where':{'id':_0x7ff636[_0x8db2('0x4c')]['id']}})[_0x8db2('0x2a')](function(_0x58063b){if(!_0x58063b)throw new Error(_0x8db2('0x74')+_0x7ff636[_0x8db2('0x4c')]['id']);return db[_0x8db2('0x45')]['getResources'](_0x7ff636);})['then'](respondWithFilteredResult(_0x248280,_0x63bfc2))[_0x8db2('0x4a')](handleError(_0x248280,null));};
\ No newline at end of file
index bb55956..9080b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32f4=['update','remove','emit','exports','events','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x5de992,_0x1fafdd){var _0x1ba6fc=function(_0x2137e4){while(--_0x2137e4){_0x5de992['push'](_0x5de992['shift']());}};_0x1ba6fc(++_0x1fafdd);}(_0x32f4,0x154));var _0x432f=function(_0x2b484d,_0x491666){_0x2b484d=_0x2b484d-0x0;var _0x202c24=_0x32f4[_0x2b484d];return _0x202c24;};'use strict';var EventEmitter=require(_0x432f('0x0'));var UserProfile=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x432f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x432f('0x4'),'afterDestroy':_0x432f('0x5')};function emitEvent(_0x51a71a){return function(_0x354293,_0x1eabac,_0x344a29){UserProfileEvents[_0x432f('0x6')](_0x51a71a+':'+_0x354293['id'],_0x354293);UserProfileEvents[_0x432f('0x6')](_0x51a71a,_0x354293);_0x344a29(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x432f('0x7')]=UserProfileEvents;
\ No newline at end of file
+var _0x8506=['update','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x4ed593,_0x3a933b){var _0x1cb74c=function(_0x51a516){while(--_0x51a516){_0x4ed593['push'](_0x4ed593['shift']());}};_0x1cb74c(++_0x3a933b);}(_0x8506,0xe8));var _0x6850=function(_0x3b962c,_0xb0332f){_0x3b962c=_0x3b962c-0x0;var _0x47122a=_0x8506[_0x3b962c];return _0x47122a;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x6850('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6850('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6850('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2e0f9d){return function(_0x204a8a,_0x321eff,_0x5e9ff2){UserProfileEvents[_0x6850('0x3')](_0x2e0f9d+':'+_0x204a8a['id'],_0x204a8a);UserProfileEvents[_0x6850('0x3')](_0x2e0f9d,_0x204a8a);_0x5e9ff2(null);};}for(var e in events){if(events[_0x6850('0x4')](e)){var event=events[e];UserProfile[_0x6850('0x5')](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
index 07cdfba..8a598ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd117=['pick','VIRTUAL','foreignKey','forEach','merge','options','includeAll','reportType','default','reportId','custom','count','rows','include','Tags','tag','color','openTabs','chat','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','findAll','associatedResources','map','field','model','then','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','odbc','parentSections','SquareProjects','projects','JscriptyProject','CmContact','Lists','lists','CmList','CmCompany','globalcustomfields','chatqueues','chatwebsites','ChatWebsite','inboundroutes','internalroutes','outboundroutes','contexts','VoiceMail','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','Users','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','CannedAnswer','dispositions','Dashboard','Interval','pauses','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort'];(function(_0x50ee83,_0x106751){var _0x3099ea=function(_0x1d38a4){while(--_0x1d38a4){_0x50ee83['push'](_0x50ee83['shift']());}};_0x3099ea(++_0x106751);}(_0xd117,0x182));var _0x7d11=function(_0x580d0e,_0x1e5f43){_0x580d0e=_0x580d0e-0x0;var _0xb51111=_0xd117[_0x580d0e];return _0xb51111;};'use strict';var _=require(_0x7d11('0x0'));var attributes=require(_0x7d11('0x1'));var qs=require(_0x7d11('0x2'));var squel=require(_0x7d11('0x3'));module[_0x7d11('0x4')]=function(_0x26e0f0){var _0x306ae4=_0x26e0f0[_0x7d11('0x5')];function _0x3c07be(_0x31fcb0,_0x589c51){return new Promise(function(_0x2689c6,_0x27d7e8){if(!_0x589c51)return _0x2689c6(null);var _0x40c3c4=_0x589c51[_0x7d11('0x6')]?{[_0x589c51[_0x7d11('0x6')]['field']]:_0x589c51[_0x7d11('0x6')][_0x7d11('0x7')]}:undefined;return _0x306ae4[_0x31fcb0][_0x7d11('0x8')]({'where':_0x40c3c4,'raw':!![]})['then'](function(_0x305eef){_0x589c51[_0x7d11('0x9')]=_[_0x7d11('0xa')](_0x305eef,'id');_0x2689c6(_0x589c51);})['catch'](function(_0x37047f){_0x27d7e8(_0x37047f);});});}function _0x48b0f1(_0x58a6fd,_0xb15984){return new Promise(function(_0x5c6d5d,_0x4a8668){var _0xc52a95=_0x58a6fd['filter']?{[_0x58a6fd[_0x7d11('0x6')][_0x7d11('0xb')]]:_0x58a6fd['filter'][_0x7d11('0x7')]}:undefined;return _0x306ae4[_0x58a6fd[_0x7d11('0xc')]]['findAll']({'where':_0xc52a95,'raw':!![]})[_0x7d11('0xd')](function(_0x16949d){_0xb15984[_0x7d11('0x9')]=_[_0x7d11('0xa')](_0x16949d,function(_0x417e2d){return _0x417e2d[_0x7d11('0xe')];});_0x5c6d5d(_0xb15984);})[_0x7d11('0xf')](function(_0xb1669e){_0x4a8668(_0xb1669e);});});}function _0x4aa795(_0x1db0df,_0x12c2ff,_0x169733){if(!_0x12c2ff)return Promise[_0x7d11('0x10')](null);return new Promise(function(_0x45f916,_0x528fdc){return _0x306ae4[_0x7d11('0x11')][_0x7d11('0x8')]({'where':{'sectionId':_0x12c2ff['id']},'raw':!![]})['then'](function(_0x5459df){if(_0x1db0df[_0x7d11('0xb')]&&_0x1db0df['field']!=='id'){_0x12c2ff[_0x7d11('0x9')]=_['map'](_0x5459df,function(_0xbe0a79){return _0xbe0a79[_0x1db0df[_0x7d11('0xb')]];});}else{if(_0x169733===_0x7d11('0x12')){_0x12c2ff[_0x7d11('0x9')]=_[_0x7d11('0xa')](_0x5459df,function(_0x117bb9){return{'id':_0x117bb9[_0x7d11('0x13')],'type':_0x117bb9[_0x7d11('0x14')]};});}else{_0x12c2ff['associatedResources']=_[_0x7d11('0xa')](_0x5459df,function(_0x4a34f4){return _0x4a34f4['resourceId'];});}}_0x45f916(_0x12c2ff);})['catch'](function(_0x27a818){_0x528fdc(_0x27a818);});});}function _0x3545dc(_0x44476c,_0x1a7853){var _0x355d14={'parentSections':[]};switch(_0x44476c[_0x7d11('0x15')]()){case _0x7d11('0x16'):_0x355d14[_0x7d11('0x17')]='SquareProject';break;case _0x7d11('0x18'):_0x355d14['childModel']='SquareOdbc';break;case'squarerecordings':_0x355d14[_0x7d11('0x17')]='SquareRecording';_0x355d14[_0x7d11('0x19')]=[{'name':_0x7d11('0x1a'),'field':_0x7d11('0xe'),'foreignKey':'projectName'}];break;case _0x7d11('0x1b'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x1c');break;case'contacts':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x1d');_0x355d14[_0x7d11('0x19')]=[{'name':_0x7d11('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x7d11('0x1f'):_0x355d14['childModel']=_0x7d11('0x20');break;case'companies':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x21');break;case _0x7d11('0x22'):_0x355d14['childModel']='CmCustomField';break;case _0x7d11('0x23'):_0x355d14[_0x7d11('0x17')]='ChatQueue';break;case _0x7d11('0x24'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x25');break;case'faxqueues':_0x355d14[_0x7d11('0x17')]='FaxQueue';break;case'faxaccounts':_0x355d14[_0x7d11('0x17')]='FaxAccount';break;case _0x7d11('0x26'):case _0x7d11('0x27'):case _0x7d11('0x28'):_0x355d14[_0x7d11('0x17')]='VoiceExtension';break;case _0x7d11('0x29'):_0x355d14[_0x7d11('0x17')]='VoiceContext';break;case'voicemails':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x2a');break;case'voicerecordings':_0x355d14[_0x7d11('0x17')]='VoiceRecording';_0x355d14['parentSections']=[{'name':_0x7d11('0x2b'),'field':'name','foreignKey':'membername','model':_0x7d11('0x2c'),'filter':{'field':_0x7d11('0x2d'),'value':[_0x7d11('0x2e')]}},{'name':_0x7d11('0x2f'),'field':_0x7d11('0xe'),'foreignKey':_0x7d11('0x30'),'model':_0x7d11('0x2c'),'filter':{'field':_0x7d11('0x2d'),'value':[_0x7d11('0x31')]}},{'name':_0x7d11('0x32'),'field':_0x7d11('0xe'),'foreignKey':_0x7d11('0x33'),'model':'VoiceQueue','filter':{'field':_0x7d11('0x14'),'value':['inbound']}},{'name':_0x7d11('0x34'),'field':_0x7d11('0xe'),'foreignKey':_0x7d11('0x33'),'model':_0x7d11('0x35'),'filter':{'field':'type','value':[_0x7d11('0x36')]}}];break;case _0x7d11('0x37'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x38');break;case'chanspies':_0x355d14[_0x7d11('0x17')]='VoiceChanSpy';break;case _0x7d11('0x39'):_0x355d14['childModel']=_0x7d11('0x3a');break;case _0x7d11('0x3b'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x3c');break;case'mailqueues':_0x355d14['childModel']=_0x7d11('0x3d');break;case _0x7d11('0x3e'):_0x355d14['childModel']=_0x7d11('0x3f');break;case _0x7d11('0x40'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x41');break;case _0x7d11('0x42'):_0x355d14[_0x7d11('0x17')]='OpenchannelQueue';break;case _0x7d11('0x43'):_0x355d14['childModel']=_0x7d11('0x44');break;case _0x7d11('0x45'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x46');break;case _0x7d11('0x47'):_0x355d14[_0x7d11('0x17')]='SmsAccount';break;case'whatsappqueues':_0x355d14['childModel']=_0x7d11('0x48');break;case _0x7d11('0x49'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x4a');break;case _0x7d11('0x4b'):_0x355d14['childModel']=_0x7d11('0x4c');break;case _0x7d11('0x4d'):case'queuecampaigns':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x35');if(_0x1a7853){_0x355d14[_0x7d11('0x19')]=[{'name':'VoiceQueues'},{'name':_0x7d11('0x34')}];}break;case _0x7d11('0x4e'):case _0x7d11('0x4f'):case'telephones':_0x355d14[_0x7d11('0x17')]='User';if(_0x1a7853){_0x355d14[_0x7d11('0x19')]=[{'name':_0x7d11('0x50'),'filter':{'field':_0x7d11('0x2d'),'value':[_0x7d11('0x51'),_0x7d11('0x52')]},'ignore':!![]},{'name':_0x7d11('0x2b')},{'name':_0x7d11('0x2f')}];}break;case _0x7d11('0x53'):_0x355d14[_0x7d11('0x17')]='ZendeskAccount';break;case'salesforceaccounts':_0x355d14['childModel']=_0x7d11('0x54');break;case _0x7d11('0x55'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x56');break;case _0x7d11('0x57'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x58');break;case _0x7d11('0x59'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x5a');break;case _0x7d11('0x5b'):_0x355d14[_0x7d11('0x17')]='ZohoAccount';break;case _0x7d11('0x5c'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x2c');break;case'cannedanswers':_0x355d14['childModel']=_0x7d11('0x5d');break;case _0x7d11('0x5e'):_0x355d14[_0x7d11('0x17')]='Disposition';break;case'customdashboards':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x5f');break;case'intervals':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x60');break;case _0x7d11('0x61'):_0x355d14[_0x7d11('0x17')]='Pause';break;case _0x7d11('0x62'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x63');break;case'sounds':_0x355d14['childModel']=_0x7d11('0x64');break;case _0x7d11('0x65'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x66');break;case _0x7d11('0x67'):_0x355d14['childModel']=_0x7d11('0x68');break;case _0x7d11('0x69'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x6a');break;case'trunks':_0x355d14['childModel']=_0x7d11('0x6b');break;case _0x7d11('0x6c'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x6d');break;case _0x7d11('0x6e'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x6f');break;case _0x7d11('0x70'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x12');_0x355d14['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x7d11('0x71'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x72');break;}return _0x355d14;}function _0x5508cf(_0x45918d,_0x222375){var _0x3b1762=_0x45918d[_0x7d11('0x73')](0x0)[_0x7d11('0x74')]()+_0x45918d[_0x7d11('0x75')](0x1);var _0x505573={'type':_0x306ae4[_0x7d11('0x76')][_0x7d11('0x77')][_0x7d11('0x78')],'raw':!![]};return new Promise(function(_0x4c072b,_0x5e5ac3){var _0x481a64=squel['select']()[_0x7d11('0xb')]('ui.'+_0x3b1762+'InteractionId','id')['field'](_0x7d11('0x79'))[_0x7d11('0x7a')](_0x7d11('0x7b')+_0x45918d+_0x7d11('0x7c'),'ui')[_0x7d11('0x7d')](_0x7d11('0x7e'),_0x222375['id']);return _0x306ae4['sequelize'][_0x7d11('0x7f')](_0x481a64['toString'](),_0x505573)[_0x7d11('0xd')](function(_0x49f904){_0x222375[_0x3b1762+_0x7d11('0x80')]=_0x49f904;_0x4c072b(_0x49f904);})[_0x7d11('0xf')](function(_0x4ce8f2){_0x5e5ac3(_0x4ce8f2);});});}return _0x26e0f0[_0x7d11('0x81')](_0x7d11('0x82'),attributes,{'tableName':_0x7d11('0x83'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x8201e3){var _0x5581bb={'raw':![],'where':{}};var _0x5afdd5={};var _0xf1a6ab={'count':0x0,'rows':[]};var _0x23b502=_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x84')];var _0x458362=_0x8201e3['query'][_0x7d11('0x85')]||![];var _0x5ad800=_0x3545dc(_0x23b502,_0x458362);if(!_0x5ad800[_0x7d11('0x17')])throw new Error(_0x7d11('0x86')+_0x23b502+'\x27');var _0x3008a6=[{'name':_0x23b502}];if(!_[_0x7d11('0x87')](_0x5ad800['parentSections']))_0x3008a6=_0x5ad800[_0x7d11('0x19')];var _0x5246ca=[];for(var _0x2258dc=0x0;_0x2258dc<_0x3008a6[_0x7d11('0x88')];_0x2258dc++){_0x5246ca[_0x7d11('0x89')](_0x306ae4[_0x7d11('0x8a')][_0x7d11('0x8b')]({'where':{'userProfileId':_0x8201e3[_0x7d11('0x8c')]['id'],'name':_0x3008a6[_0x2258dc][_0x7d11('0xe')]},'raw':!![]}));}return Promise[_0x7d11('0x8d')](_0x5246ca)[_0x7d11('0xd')](function(_0x3f8512){var _0x45cf67=_[_0x7d11('0x6')](_0x3f8512,function(_0x346250){return _0x346250?_0x346250:undefined;});var _0xbda04d=_['filter'](_0x3008a6,[_0x7d11('0x8e'),!![]]);var _0x489121=_[_0x7d11('0x87')](_0x45cf67)&&_['isEmpty'](_0xbda04d)?null:_[_0x7d11('0x8f')](_0xbda04d,_0x45cf67);if(!_0x489121)return null;var _0x181294=[];for(var _0x362030=0x0;_0x362030<_0x489121[_0x7d11('0x88')];_0x362030++){var _0x4aac67=_['find'](_0x3008a6,function(_0x1351ee){return _0x489121[_0x362030]?_0x1351ee[_0x7d11('0xe')]===_0x489121[_0x362030][_0x7d11('0xe')]:null;});if(_0x4aac67){if(_0x489121[_0x362030]['ignore']){_0x181294[_0x7d11('0x89')](_0x3c07be(_0x5ad800[_0x7d11('0x17')],_0x489121[_0x362030]));}else{if(!_0x489121[_0x362030][_0x7d11('0x90')]){_0x181294[_0x7d11('0x89')](_0x4aa795(_0x4aac67,_0x489121[_0x362030],_0x5ad800[_0x7d11('0x17')]));}else{if(_0x4aac67[_0x7d11('0xc')]){_0x181294['push'](_0x48b0f1(_0x4aac67,_0x489121[_0x362030]));}}}}}return Promise[_0x7d11('0x8d')](_0x181294);})['then'](function(_0x1fd598){var _0x4c88c6=_0x1fd598;var _0x48f52c=null;if(_0x4c88c6){_0x48f52c=_0x4c88c6[_0x7d11('0x88')]===0x1?_0x4c88c6[0x0]:null;}if(!_0x48f52c&&!_0x4c88c6)return _0xf1a6ab;var _0x235658=_0x306ae4[_0x5ad800[_0x7d11('0x17')]][_0x7d11('0x91')];_0x5afdd5[_0x7d11('0xc')]=_[_0x7d11('0x92')](_0x235658);_0x5afdd5[_0x7d11('0x7f')]=_[_0x7d11('0x92')](_0x8201e3[_0x7d11('0x7f')]);_0x5afdd5[_0x7d11('0x93')]=_[_0x7d11('0x94')](_0x5afdd5['model'],_0x5afdd5[_0x7d11('0x7f')]);_0x5581bb['attributes']=_[_0x7d11('0x94')](_0x5afdd5[_0x7d11('0xc')],qs[_0x7d11('0x95')](_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x95')]));_0x5581bb[_0x7d11('0x96')]=_0x5581bb[_0x7d11('0x96')]['length']?_0x5581bb['attributes']:_0x5afdd5[_0x7d11('0xc')];if(!_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x97')](_0x7d11('0x98'))){_0x5581bb[_0x7d11('0x99')]=qs['limit'](_0x8201e3[_0x7d11('0x7f')]['limit']);_0x5581bb[_0x7d11('0x9a')]=qs[_0x7d11('0x9a')](_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x9a')]);}_0x5581bb[_0x7d11('0x9b')]=qs[_0x7d11('0x9c')](_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x9c')]);_0x5581bb['where']=qs['filters'](_[_0x7d11('0x9d')](_0x8201e3[_0x7d11('0x7f')],_0x5afdd5[_0x7d11('0x93')]));if(_0x8201e3['query']['filter']){_0x5581bb[_0x7d11('0x7d')]=_['merge'](_0x5581bb[_0x7d11('0x7d')],{'$or':_[_0x7d11('0xa')](_0x235658,function(_0x269ab6){if(_0x269ab6[_0x7d11('0x14')]['key']!==_0x7d11('0x9e')){var _0x3b2c9e={};_0x3b2c9e[_0x269ab6[_0x7d11('0xb')]]={'$like':'%'+_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x6')]+'%'};return _0x3b2c9e;}})});}var _0xb9099d=[];var _0x3e83e0=null;var _0x1b719a={};if(_0x48f52c){_0x3e83e0=_['find'](_0x3008a6,[_0x7d11('0xe'),_0x48f52c[_0x7d11('0xe')]]);if(_0x3e83e0[_0x7d11('0xb')]){_0x1b719a={};if(_0x5ad800[_0x7d11('0x17')]===_0x7d11('0x12')){_0x1b719a[_0x3e83e0['foreignKey']]=_[_0x7d11('0xa')](_0x48f52c[_0x7d11('0x9')],'id');}else{_0x1b719a[_0x3e83e0[_0x7d11('0x9f')]]=_0x48f52c[_0x7d11('0x9')];}_0xb9099d[_0x7d11('0x89')](_0x1b719a);}else{_0x5581bb['where']['id']=_0x48f52c['associatedResources'];}}else{for(var _0x58d114=0x0;_0x58d114<_0x4c88c6[_0x7d11('0x88')];_0x58d114++){_0x3e83e0=_['find'](_0x3008a6,[_0x7d11('0xe'),_0x4c88c6[_0x58d114]['name']]);if(_0x3e83e0['field']){_0x1b719a={};_0x1b719a[_0x3e83e0[_0x7d11('0x9f')]]=_0x4c88c6[_0x58d114][_0x7d11('0x9')];_0xb9099d[_0x7d11('0x89')](_0x1b719a);}else{if(!_0x5581bb[_0x7d11('0x7d')]['id'])_0x5581bb[_0x7d11('0x7d')]['id']=[];_0x4c88c6[_0x58d114][_0x7d11('0x9')][_0x7d11('0xa0')](function(_0x45d970){_0x5581bb[_0x7d11('0x7d')]['id'][_0x7d11('0x89')](_0x45d970);});}}}if(!_['isEmpty'](_0xb9099d)){_0x5581bb[_0x7d11('0x7d')]=_[_0x7d11('0xa1')](_0x5581bb['where'],{'$and':{'$or':_0xb9099d}});}_0x5581bb=_[_0x7d11('0xa1')]({},_0x5581bb,_0x8201e3[_0x7d11('0xa2')]);if(_0x48f52c&&!_0x48f52c[_0x7d11('0x90')]&&_0x5ad800[_0x7d11('0x17')]==='AnalyticExtractedReport'){if(_0x8201e3['query'][_0x7d11('0xa3')]){_0x5581bb['include']=[{'all':!![]}];}return _0x306ae4[_0x5ad800[_0x7d11('0x17')]][_0x7d11('0x8')](_0x5581bb)[_0x7d11('0xd')](function(_0x13ccd5){var _0x1565d9=[];_0x13ccd5[_0x7d11('0xa0')](function(_0x238486){var _0x596228;switch(_0x238486[_0x7d11('0xa4')]){case _0x7d11('0xa5'):_0x596228=_[_0x7d11('0x8b')](_0x48f52c[_0x7d11('0x9')],function(_0x5bb85d){return _0x5bb85d['id']===_0x238486[_0x7d11('0xa6')]&&_0x5bb85d[_0x7d11('0x14')]==='DefaultReports';});break;case _0x7d11('0xa7'):_0x596228=_[_0x7d11('0x8b')](_0x48f52c[_0x7d11('0x9')],function(_0x512086){return _0x512086['id']===_0x238486[_0x7d11('0xa6')]&&_0x512086[_0x7d11('0x14')]==='CustomReports';});break;}if(_0x596228)_0x1565d9[_0x7d11('0x89')](_0x238486);});_0xf1a6ab[_0x7d11('0xa8')]=_0x1565d9['length'];_0xf1a6ab[_0x7d11('0xa9')]=_0x1565d9;return _0xf1a6ab;});}else{return _0x306ae4[_0x5ad800['childModel']]['count']({'where':_0x5581bb['where']})['then'](function(_0x526e65){_0xf1a6ab[_0x7d11('0xa8')]=_0x526e65;if(_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xa3')]){if(_0x5ad800[_0x7d11('0x17')]===_0x7d11('0x1d')){_0x5581bb[_0x7d11('0xaa')]=[{'model':_0x306ae4[_0x7d11('0x66')],'as':_0x7d11('0xab'),'attributes':['id',_0x7d11('0xe'),'color'],'required':_0x8201e3['query'][_0x7d11('0xac')]?!![]:![]},{'model':_0x306ae4[_0x7d11('0x66')],'as':'ThroughTags','attributes':['id','name',_0x7d11('0xad')],'through':_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xac')]?{'attributes':[],'where':{'TagId':_0x8201e3[_0x7d11('0x7f')]['tag']||undefined}}:{},'required':_0x8201e3['query']['tag']?!![]:![]}];}else{_0x5581bb[_0x7d11('0xaa')]=[{'all':!![]}];}}return _0x306ae4[_0x5ad800[_0x7d11('0x17')]][_0x7d11('0x8')](_0x5581bb);})['then'](function(_0x3ce304){_0xf1a6ab[_0x7d11('0xa9')]=_0x3ce304;if(_0x23b502==='Agents'&&_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xae')]==='true'){var _0x5e5faf=[];for(var _0xe23940=0x0;_0xe23940<_0xf1a6ab[_0x7d11('0xa9')]['length'];_0xe23940++){_0x5e5faf['push'](_0x5508cf(_0x7d11('0xaf'),_0xf1a6ab[_0x7d11('0xa9')][_0xe23940][_0x7d11('0xb0')]));_0x5e5faf[_0x7d11('0x89')](_0x5508cf('sms',_0xf1a6ab[_0x7d11('0xa9')][_0xe23940][_0x7d11('0xb0')]));_0x5e5faf[_0x7d11('0x89')](_0x5508cf(_0x7d11('0xb1'),_0xf1a6ab['rows'][_0xe23940][_0x7d11('0xb0')]));_0x5e5faf[_0x7d11('0x89')](_0x5508cf(_0x7d11('0xb2'),_0xf1a6ab['rows'][_0xe23940][_0x7d11('0xb0')]));_0x5e5faf['push'](_0x5508cf(_0x7d11('0xb3'),_0xf1a6ab['rows'][_0xe23940][_0x7d11('0xb0')]));_0x5e5faf[_0x7d11('0x89')](_0x5508cf(_0x7d11('0xb4'),_0xf1a6ab[_0x7d11('0xa9')][_0xe23940][_0x7d11('0xb0')]));}return Promise[_0x7d11('0x8d')](_0x5e5faf)['then'](function(){return _0xf1a6ab;});}return _0xf1a6ab;});}});}}});};
\ No newline at end of file
+var _0xb091=['map','catch','model','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','SquareProject','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','CmList','CmCompany','globalcustomfields','CmCustomField','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','user','zendeskaccounts','ZendeskAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','CannedAnswer','Disposition','Dashboard','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','select','ui.','InteractionId','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','section','mergeResources','Invalid\x20section\x20\x27','length','UserProfileSection','find','ignore','isEmpty','union','push','autoAssociation','all','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','default','DefaultReports','custom','CustomReports','count','rows','include','Tag','Tags','color','tag','ThroughTags','openTabs','true','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','field','value','findAll','then','associatedResources'];(function(_0x13843f,_0x50422d){var _0x1063ae=function(_0x12fd6b){while(--_0x12fd6b){_0x13843f['push'](_0x13843f['shift']());}};_0x1063ae(++_0x50422d);}(_0xb091,0x16e));var _0x1b09=function(_0x268715,_0x51ad7d){_0x268715=_0x268715-0x0;var _0x1394d7=_0xb091[_0x268715];return _0x1394d7;};'use strict';var _=require('lodash');var attributes=require(_0x1b09('0x0'));var qs=require(_0x1b09('0x1'));var squel=require(_0x1b09('0x2'));module[_0x1b09('0x3')]=function(_0x56c107){var _0xa6ef49=_0x56c107['models'];function _0x5aa3b0(_0x295863,_0x24d22c){return new Promise(function(_0x4e252c,_0xda8caa){if(!_0x24d22c)return _0x4e252c(null);var _0x5fa348=_0x24d22c[_0x1b09('0x4')]?{[_0x24d22c['filter'][_0x1b09('0x5')]]:_0x24d22c[_0x1b09('0x4')][_0x1b09('0x6')]}:undefined;return _0xa6ef49[_0x295863][_0x1b09('0x7')]({'where':_0x5fa348,'raw':!![]})[_0x1b09('0x8')](function(_0x3362e4){_0x24d22c[_0x1b09('0x9')]=_[_0x1b09('0xa')](_0x3362e4,'id');_0x4e252c(_0x24d22c);})[_0x1b09('0xb')](function(_0x36aa1b){_0xda8caa(_0x36aa1b);});});}function _0x14dac6(_0x5f31ac,_0x40082a){return new Promise(function(_0x894b73,_0x5690cb){var _0x4c28c4=_0x5f31ac[_0x1b09('0x4')]?{[_0x5f31ac[_0x1b09('0x4')][_0x1b09('0x5')]]:_0x5f31ac[_0x1b09('0x4')][_0x1b09('0x6')]}:undefined;return _0xa6ef49[_0x5f31ac[_0x1b09('0xc')]][_0x1b09('0x7')]({'where':_0x4c28c4,'raw':!![]})['then'](function(_0x37fdb2){_0x40082a['associatedResources']=_[_0x1b09('0xa')](_0x37fdb2,function(_0x27a731){return _0x27a731[_0x1b09('0xd')];});_0x894b73(_0x40082a);})[_0x1b09('0xb')](function(_0x10b7eb){_0x5690cb(_0x10b7eb);});});}function _0x1dc96b(_0x64689a,_0x33129b,_0x1196b2){if(!_0x33129b)return Promise[_0x1b09('0xe')](null);return new Promise(function(_0x311158,_0x231ef6){return _0xa6ef49[_0x1b09('0xf')]['findAll']({'where':{'sectionId':_0x33129b['id']},'raw':!![]})[_0x1b09('0x8')](function(_0x1c1ef9){if(_0x64689a['field']&&_0x64689a['field']!=='id'){_0x33129b[_0x1b09('0x9')]=_['map'](_0x1c1ef9,function(_0x267b5e){return _0x267b5e[_0x64689a['field']];});}else{if(_0x1196b2===_0x1b09('0x10')){_0x33129b[_0x1b09('0x9')]=_[_0x1b09('0xa')](_0x1c1ef9,function(_0x1e8f97){return{'id':_0x1e8f97[_0x1b09('0x11')],'type':_0x1e8f97[_0x1b09('0x12')]};});}else{_0x33129b[_0x1b09('0x9')]=_[_0x1b09('0xa')](_0x1c1ef9,function(_0x48b803){return _0x48b803['resourceId'];});}}_0x311158(_0x33129b);})[_0x1b09('0xb')](function(_0x41c786){_0x231ef6(_0x41c786);});});}function _0x4ce7dc(_0x3c0496,_0x11d0d5){var _0x6e132c={'parentSections':[]};switch(_0x3c0496[_0x1b09('0x13')]()){case'squareprojects':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x15');break;case'odbc':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x16');break;case'squarerecordings':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x17');_0x6e132c[_0x1b09('0x18')]=[{'name':_0x1b09('0x19'),'field':'name','foreignKey':_0x1b09('0x1a')}];break;case _0x1b09('0x1b'):_0x6e132c['childModel']=_0x1b09('0x1c');break;case _0x1b09('0x1d'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x1e');_0x6e132c[_0x1b09('0x18')]=[{'name':_0x1b09('0x1f'),'field':'id','foreignKey':_0x1b09('0x20')}];break;case'lists':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x21');break;case'companies':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x22');break;case _0x1b09('0x23'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x24');break;case'chatqueues':_0x6e132c[_0x1b09('0x14')]='ChatQueue';break;case _0x1b09('0x25'):_0x6e132c['childModel']=_0x1b09('0x26');break;case _0x1b09('0x27'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x28');break;case _0x1b09('0x29'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x2a');break;case _0x1b09('0x2b'):case _0x1b09('0x2c'):case _0x1b09('0x2d'):_0x6e132c['childModel']=_0x1b09('0x2e');break;case _0x1b09('0x2f'):_0x6e132c[_0x1b09('0x14')]='VoiceContext';break;case _0x1b09('0x30'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x31');break;case _0x1b09('0x32'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x33');_0x6e132c[_0x1b09('0x18')]=[{'name':_0x1b09('0x34'),'field':'name','foreignKey':_0x1b09('0x35'),'model':'User','filter':{'field':_0x1b09('0x36'),'value':['agent']}},{'name':_0x1b09('0x37'),'field':_0x1b09('0xd'),'foreignKey':_0x1b09('0x35'),'model':_0x1b09('0x38'),'filter':{'field':_0x1b09('0x36'),'value':[_0x1b09('0x39')]}},{'name':_0x1b09('0x3a'),'field':_0x1b09('0xd'),'foreignKey':_0x1b09('0x3b'),'model':_0x1b09('0x3c'),'filter':{'field':_0x1b09('0x12'),'value':[_0x1b09('0x3d')]}},{'name':_0x1b09('0x3e'),'field':'name','foreignKey':'queue','model':_0x1b09('0x3c'),'filter':{'field':_0x1b09('0x12'),'value':[_0x1b09('0x3f')]}}];break;case _0x1b09('0x40'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x41');break;case _0x1b09('0x42'):_0x6e132c[_0x1b09('0x14')]='VoiceChanSpy';break;case'voiceprefixes':_0x6e132c[_0x1b09('0x14')]='VoicePrefix';break;case _0x1b09('0x43'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x44');break;case'mailqueues':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x45');break;case _0x1b09('0x46'):_0x6e132c['childModel']=_0x1b09('0x47');break;case _0x1b09('0x48'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x49');break;case'openchannelqueues':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x4a');break;case'openchannelaccounts':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x4b');break;case'smsqueues':_0x6e132c['childModel']='SmsQueue';break;case'smsaccounts':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x4c');break;case _0x1b09('0x4d'):_0x6e132c['childModel']=_0x1b09('0x4e');break;case _0x1b09('0x4f'):_0x6e132c['childModel']=_0x1b09('0x50');break;case _0x1b09('0x51'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x52');break;case _0x1b09('0x53'):case _0x1b09('0x54'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x3c');if(_0x11d0d5){_0x6e132c[_0x1b09('0x18')]=[{'name':_0x1b09('0x3a')},{'name':'QueueCampaigns'}];}break;case _0x1b09('0x55'):case _0x1b09('0x56'):case _0x1b09('0x57'):_0x6e132c['childModel']=_0x1b09('0x38');if(_0x11d0d5){_0x6e132c['parentSections']=[{'name':_0x1b09('0x58'),'filter':{'field':_0x1b09('0x36'),'value':['admin',_0x1b09('0x59')]},'ignore':!![]},{'name':_0x1b09('0x34')},{'name':_0x1b09('0x37')}];}break;case _0x1b09('0x5a'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x5b');break;case'salesforceaccounts':_0x6e132c[_0x1b09('0x14')]='SalesforceAccount';break;case _0x1b09('0x5c'):_0x6e132c['childModel']='FreshdeskAccount';break;case _0x1b09('0x5d'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x5e');break;case _0x1b09('0x5f'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x60');break;case _0x1b09('0x61'):_0x6e132c[_0x1b09('0x14')]='ZohoAccount';break;case _0x1b09('0x62'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x38');break;case'cannedanswers':_0x6e132c['childModel']=_0x1b09('0x63');break;case'dispositions':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x64');break;case'customdashboards':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x65');break;case'intervals':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x66');break;case _0x1b09('0x67'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x68');break;case'scheduler':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x69');break;case _0x1b09('0x6a'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x6b');break;case _0x1b09('0x6c'):_0x6e132c[_0x1b09('0x14')]='Tag';break;case'templates':_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x6d');break;case _0x1b09('0x6e'):_0x6e132c['childModel']=_0x1b09('0x6f');break;case _0x1b09('0x70'):_0x6e132c[_0x1b09('0x14')]='Trunk';break;case _0x1b09('0x71'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x72');break;case _0x1b09('0x73'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x74');break;case _0x1b09('0x75'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x10');_0x6e132c[_0x1b09('0x18')]=[{'name':_0x1b09('0x76'),'field':'id','foreignKey':_0x1b09('0x77')}];break;case _0x1b09('0x78'):_0x6e132c[_0x1b09('0x14')]=_0x1b09('0x79');break;}return _0x6e132c;}function _0x4ca41c(_0x5766cb,_0x2cc31e){var _0x54efba=_0x5766cb[_0x1b09('0x7a')](0x0)[_0x1b09('0x7b')]()+_0x5766cb[_0x1b09('0x7c')](0x1);var _0x5b284f={'type':_0xa6ef49['Sequelize'][_0x1b09('0x7d')][_0x1b09('0x7e')],'raw':!![]};return new Promise(function(_0x5ad730,_0xbaf193){var _0x2f2388=squel[_0x1b09('0x7f')]()[_0x1b09('0x5')](_0x1b09('0x80')+_0x54efba+_0x1b09('0x81'),'id')[_0x1b09('0x5')]('ui.createdAt')[_0x1b09('0x82')]('user_has_'+_0x5766cb+_0x1b09('0x83'),'ui')[_0x1b09('0x84')](_0x1b09('0x85'),_0x2cc31e['id']);return _0xa6ef49[_0x1b09('0x86')][_0x1b09('0x87')](_0x2f2388[_0x1b09('0x88')](),_0x5b284f)[_0x1b09('0x8')](function(_0x44ffc1){_0x2cc31e[_0x54efba+_0x1b09('0x89')]=_0x44ffc1;_0x5ad730(_0x44ffc1);})[_0x1b09('0xb')](function(_0x391790){_0xbaf193(_0x391790);});});}return _0x56c107[_0x1b09('0x8a')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x14f94b){var _0x314411={'raw':![],'where':{}};var _0x7e199d={};var _0x4c3068={'count':0x0,'rows':[]};var _0x42fa10=_0x14f94b[_0x1b09('0x87')][_0x1b09('0x8b')];var _0x57bec1=_0x14f94b[_0x1b09('0x87')][_0x1b09('0x8c')]||![];var _0x187a11=_0x4ce7dc(_0x42fa10,_0x57bec1);if(!_0x187a11['childModel'])throw new Error(_0x1b09('0x8d')+_0x42fa10+'\x27');var _0x54c7c6=[{'name':_0x42fa10}];if(!_['isEmpty'](_0x187a11[_0x1b09('0x18')]))_0x54c7c6=_0x187a11[_0x1b09('0x18')];var _0x10e809=[];for(var _0x527f4e=0x0;_0x527f4e<_0x54c7c6[_0x1b09('0x8e')];_0x527f4e++){_0x10e809['push'](_0xa6ef49[_0x1b09('0x8f')][_0x1b09('0x90')]({'where':{'userProfileId':_0x14f94b['params']['id'],'name':_0x54c7c6[_0x527f4e][_0x1b09('0xd')]},'raw':!![]}));}return Promise['all'](_0x10e809)[_0x1b09('0x8')](function(_0x2a537d){var _0x52b5cf=_[_0x1b09('0x4')](_0x2a537d,function(_0x597a68){return _0x597a68?_0x597a68:undefined;});var _0x2472b4=_[_0x1b09('0x4')](_0x54c7c6,[_0x1b09('0x91'),!![]]);var _0x1a357d=_[_0x1b09('0x92')](_0x52b5cf)&&_['isEmpty'](_0x2472b4)?null:_[_0x1b09('0x93')](_0x2472b4,_0x52b5cf);if(!_0x1a357d)return null;var _0x150b7e=[];for(var _0x410138=0x0;_0x410138<_0x1a357d['length'];_0x410138++){var _0x701d0e=_[_0x1b09('0x90')](_0x54c7c6,function(_0x29cf4e){return _0x1a357d[_0x410138]?_0x29cf4e[_0x1b09('0xd')]===_0x1a357d[_0x410138][_0x1b09('0xd')]:null;});if(_0x701d0e){if(_0x1a357d[_0x410138]['ignore']){_0x150b7e[_0x1b09('0x94')](_0x5aa3b0(_0x187a11['childModel'],_0x1a357d[_0x410138]));}else{if(!_0x1a357d[_0x410138][_0x1b09('0x95')]){_0x150b7e[_0x1b09('0x94')](_0x1dc96b(_0x701d0e,_0x1a357d[_0x410138],_0x187a11[_0x1b09('0x14')]));}else{if(_0x701d0e[_0x1b09('0xc')]){_0x150b7e[_0x1b09('0x94')](_0x14dac6(_0x701d0e,_0x1a357d[_0x410138]));}}}}}return Promise[_0x1b09('0x96')](_0x150b7e);})[_0x1b09('0x8')](function(_0x3db691){var _0x4e74de=_0x3db691;var _0xdcd93e=null;if(_0x4e74de){_0xdcd93e=_0x4e74de[_0x1b09('0x8e')]===0x1?_0x4e74de[0x0]:null;}if(!_0xdcd93e&&!_0x4e74de)return _0x4c3068;var _0x58c56e=_0xa6ef49[_0x187a11[_0x1b09('0x14')]][_0x1b09('0x97')];_0x7e199d[_0x1b09('0xc')]=_[_0x1b09('0x98')](_0x58c56e);_0x7e199d[_0x1b09('0x87')]=_[_0x1b09('0x98')](_0x14f94b[_0x1b09('0x87')]);_0x7e199d[_0x1b09('0x99')]=_[_0x1b09('0x9a')](_0x7e199d['model'],_0x7e199d[_0x1b09('0x87')]);_0x314411[_0x1b09('0x9b')]=_[_0x1b09('0x9a')](_0x7e199d[_0x1b09('0xc')],qs[_0x1b09('0x9c')](_0x14f94b['query'][_0x1b09('0x9c')]));_0x314411[_0x1b09('0x9b')]=_0x314411['attributes'][_0x1b09('0x8e')]?_0x314411['attributes']:_0x7e199d[_0x1b09('0xc')];if(!_0x14f94b[_0x1b09('0x87')][_0x1b09('0x9d')]('nolimit')){_0x314411['limit']=qs['limit'](_0x14f94b[_0x1b09('0x87')][_0x1b09('0x9e')]);_0x314411[_0x1b09('0x9f')]=qs[_0x1b09('0x9f')](_0x14f94b[_0x1b09('0x87')][_0x1b09('0x9f')]);}_0x314411[_0x1b09('0xa0')]=qs[_0x1b09('0xa1')](_0x14f94b[_0x1b09('0x87')][_0x1b09('0xa1')]);_0x314411[_0x1b09('0x84')]=qs[_0x1b09('0x99')](_['pick'](_0x14f94b['query'],_0x7e199d[_0x1b09('0x99')]));if(_0x14f94b[_0x1b09('0x87')][_0x1b09('0x4')]){_0x314411[_0x1b09('0x84')]=_[_0x1b09('0xa2')](_0x314411[_0x1b09('0x84')],{'$or':_[_0x1b09('0xa')](_0x58c56e,function(_0x52f219){if(_0x52f219[_0x1b09('0x12')][_0x1b09('0xa3')]!==_0x1b09('0xa4')){var _0x4f777b={};_0x4f777b[_0x52f219[_0x1b09('0x5')]]={'$like':'%'+_0x14f94b[_0x1b09('0x87')][_0x1b09('0x4')]+'%'};return _0x4f777b;}})});}var _0x1de91c=[];var _0x2d95b1=null;var _0x4ae2a6={};if(_0xdcd93e){_0x2d95b1=_['find'](_0x54c7c6,[_0x1b09('0xd'),_0xdcd93e[_0x1b09('0xd')]]);if(_0x2d95b1['field']){_0x4ae2a6={};if(_0x187a11[_0x1b09('0x14')]==='AnalyticExtractedReport'){_0x4ae2a6[_0x2d95b1[_0x1b09('0xa5')]]=_[_0x1b09('0xa')](_0xdcd93e[_0x1b09('0x9')],'id');}else{_0x4ae2a6[_0x2d95b1['foreignKey']]=_0xdcd93e[_0x1b09('0x9')];}_0x1de91c['push'](_0x4ae2a6);}else{_0x314411['where']['id']=_0xdcd93e[_0x1b09('0x9')];}}else{for(var _0x4a9d0e=0x0;_0x4a9d0e<_0x4e74de['length'];_0x4a9d0e++){_0x2d95b1=_['find'](_0x54c7c6,[_0x1b09('0xd'),_0x4e74de[_0x4a9d0e][_0x1b09('0xd')]]);if(_0x2d95b1[_0x1b09('0x5')]){_0x4ae2a6={};_0x4ae2a6[_0x2d95b1[_0x1b09('0xa5')]]=_0x4e74de[_0x4a9d0e]['associatedResources'];_0x1de91c[_0x1b09('0x94')](_0x4ae2a6);}else{if(!_0x314411[_0x1b09('0x84')]['id'])_0x314411[_0x1b09('0x84')]['id']=[];_0x4e74de[_0x4a9d0e][_0x1b09('0x9')][_0x1b09('0xa6')](function(_0x4e1562){_0x314411[_0x1b09('0x84')]['id'][_0x1b09('0x94')](_0x4e1562);});}}}if(!_[_0x1b09('0x92')](_0x1de91c)){_0x314411[_0x1b09('0x84')]=_['merge'](_0x314411['where'],{'$and':{'$or':_0x1de91c}});}_0x314411=_['merge']({},_0x314411,_0x14f94b[_0x1b09('0xa7')]);if(_0xdcd93e&&!_0xdcd93e[_0x1b09('0x95')]&&_0x187a11[_0x1b09('0x14')]===_0x1b09('0x10')){if(_0x14f94b[_0x1b09('0x87')][_0x1b09('0xa8')]){_0x314411['include']=[{'all':!![]}];}return _0xa6ef49[_0x187a11[_0x1b09('0x14')]][_0x1b09('0x7')](_0x314411)['then'](function(_0x56be94){var _0x356d3a=[];_0x56be94[_0x1b09('0xa6')](function(_0x145a82){var _0x49a600;switch(_0x145a82['reportType']){case _0x1b09('0xa9'):_0x49a600=_['find'](_0xdcd93e[_0x1b09('0x9')],function(_0x52c640){return _0x52c640['id']===_0x145a82['reportId']&&_0x52c640[_0x1b09('0x12')]===_0x1b09('0xaa');});break;case _0x1b09('0xab'):_0x49a600=_['find'](_0xdcd93e[_0x1b09('0x9')],function(_0x29aeaf){return _0x29aeaf['id']===_0x145a82[_0x1b09('0x77')]&&_0x29aeaf[_0x1b09('0x12')]===_0x1b09('0xac');});break;}if(_0x49a600)_0x356d3a[_0x1b09('0x94')](_0x145a82);});_0x4c3068[_0x1b09('0xad')]=_0x356d3a['length'];_0x4c3068[_0x1b09('0xae')]=_0x356d3a;return _0x4c3068;});}else{return _0xa6ef49[_0x187a11['childModel']][_0x1b09('0xad')]({'where':_0x314411[_0x1b09('0x84')]})['then'](function(_0x20b050){_0x4c3068[_0x1b09('0xad')]=_0x20b050;if(_0x14f94b['query']['includeAll']){if(_0x187a11[_0x1b09('0x14')]===_0x1b09('0x1e')){_0x314411[_0x1b09('0xaf')]=[{'model':_0xa6ef49[_0x1b09('0xb0')],'as':_0x1b09('0xb1'),'attributes':['id',_0x1b09('0xd'),_0x1b09('0xb2')],'required':_0x14f94b[_0x1b09('0x87')][_0x1b09('0xb3')]?!![]:![]},{'model':_0xa6ef49[_0x1b09('0xb0')],'as':_0x1b09('0xb4'),'attributes':['id',_0x1b09('0xd'),_0x1b09('0xb2')],'through':_0x14f94b['query'][_0x1b09('0xb3')]?{'attributes':[],'where':{'TagId':_0x14f94b[_0x1b09('0x87')][_0x1b09('0xb3')]||undefined}}:{},'required':_0x14f94b[_0x1b09('0x87')][_0x1b09('0xb3')]?!![]:![]}];}else{_0x314411[_0x1b09('0xaf')]=[{'all':!![]}];}}return _0xa6ef49[_0x187a11[_0x1b09('0x14')]][_0x1b09('0x7')](_0x314411);})[_0x1b09('0x8')](function(_0x3c6ebe){_0x4c3068[_0x1b09('0xae')]=_0x3c6ebe;if(_0x42fa10===_0x1b09('0x34')&&_0x14f94b[_0x1b09('0x87')][_0x1b09('0xb5')]===_0x1b09('0xb6')){var _0x2ab5e5=[];for(var _0x590266=0x0;_0x590266<_0x4c3068['rows']['length'];_0x590266++){_0x2ab5e5['push'](_0x4ca41c('chat',_0x4c3068[_0x1b09('0xae')][_0x590266][_0x1b09('0xb7')]));_0x2ab5e5['push'](_0x4ca41c('sms',_0x4c3068[_0x1b09('0xae')][_0x590266][_0x1b09('0xb7')]));_0x2ab5e5[_0x1b09('0x94')](_0x4ca41c(_0x1b09('0xb8'),_0x4c3068[_0x1b09('0xae')][_0x590266][_0x1b09('0xb7')]));_0x2ab5e5[_0x1b09('0x94')](_0x4ca41c(_0x1b09('0xb9'),_0x4c3068[_0x1b09('0xae')][_0x590266]['dataValues']));_0x2ab5e5[_0x1b09('0x94')](_0x4ca41c(_0x1b09('0xba'),_0x4c3068[_0x1b09('0xae')][_0x590266]['dataValues']));_0x2ab5e5[_0x1b09('0x94')](_0x4ca41c(_0x1b09('0xbb'),_0x4c3068[_0x1b09('0xae')][_0x590266][_0x1b09('0xb7')]));}return Promise[_0x1b09('0x96')](_0x2ab5e5)[_0x1b09('0x8')](function(){return _0x4c3068;});}return _0x4c3068;});}});}}});};
\ No newline at end of file
index e82fc42..2f91560 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7de=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','request'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xb7de,0xc7));var _0xeb7d=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xb7de[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xeb7d('0x0'));var util=require(_0xeb7d('0x1'));var moment=require(_0xeb7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xeb7d('0x3'));var fs=require('fs');var Redis=require(_0xeb7d('0x4'));var db=require(_0xeb7d('0x5'))['db'];var utils=require(_0xeb7d('0x6'));var logger=require(_0xeb7d('0x7'))('rpc');var config=require(_0xeb7d('0x8'));var jayson=require(_0xeb7d('0x9'));var client=jayson[_0xeb7d('0xa')][_0xeb7d('0xb')]({'port':0x232a});config[_0xeb7d('0xc')]=_['defaults'](config['redis'],{'host':_0xeb7d('0xd'),'port':0x18eb});var socket=require(_0xeb7d('0xe'))(new Redis(config[_0xeb7d('0xc')]));require(_0xeb7d('0xf'))['register'](socket);function respondWithRpcPromise(_0x38cf68,_0x185f3b,_0x65e85a){return new BPromise(function(_0x568d8c,_0x492804){return client[_0xeb7d('0x10')](_0x38cf68,_0x65e85a)['then'](function(_0x1aa13a){logger[_0xeb7d('0x11')](_0xeb7d('0x12'),_0x185f3b,_0xeb7d('0x13'));logger[_0xeb7d('0x14')](_0xeb7d('0x15'),_0x185f3b,'request\x20sent',JSON[_0xeb7d('0x16')](_0x1aa13a));if(_0x1aa13a[_0xeb7d('0x17')]){if(_0x1aa13a[_0xeb7d('0x17')][_0xeb7d('0x18')]===0x1f4){logger[_0xeb7d('0x17')]('UserProfile,\x20%s,\x20%s',_0x185f3b,_0x1aa13a[_0xeb7d('0x17')]['message']);return _0x492804(_0x1aa13a[_0xeb7d('0x17')][_0xeb7d('0x19')]);}logger[_0xeb7d('0x17')]('UserProfile,\x20%s,\x20%s',_0x185f3b,_0x1aa13a['error'][_0xeb7d('0x19')]);return _0x568d8c(_0x1aa13a[_0xeb7d('0x17')]['message']);}else{logger['info'](_0xeb7d('0x12'),_0x185f3b,_0xeb7d('0x13'));_0x568d8c(_0x1aa13a['result'][_0xeb7d('0x19')]);}})[_0xeb7d('0x1a')](function(_0x32fb0b){logger[_0xeb7d('0x17')](_0xeb7d('0x12'),_0x185f3b,_0x32fb0b);_0x492804(_0x32fb0b);});});}
\ No newline at end of file
+var _0xb46f=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3ab17b,_0x45d585){var _0x3a12f0=function(_0x11fc2f){while(--_0x11fc2f){_0x3ab17b['push'](_0x3ab17b['shift']());}};_0x3a12f0(++_0x45d585);}(_0xb46f,0xb6));var _0xfb46=function(_0x1c37cb,_0x214f8e){_0x1c37cb=_0x1c37cb-0x0;var _0x2c221e=_0xb46f[_0x1c37cb];return _0x2c221e;};'use strict';var _=require(_0xfb46('0x0'));var util=require(_0xfb46('0x1'));var moment=require('moment');var BPromise=require(_0xfb46('0x2'));var rs=require(_0xfb46('0x3'));var fs=require('fs');var Redis=require(_0xfb46('0x4'));var db=require(_0xfb46('0x5'))['db'];var utils=require(_0xfb46('0x6'));var logger=require('../../config/logger')(_0xfb46('0x7'));var config=require('../../config/environment');var jayson=require(_0xfb46('0x8'));var client=jayson[_0xfb46('0x9')][_0xfb46('0xa')]({'port':0x232a});config[_0xfb46('0xb')]=_[_0xfb46('0xc')](config['redis'],{'host':_0xfb46('0xd'),'port':0x18eb});var socket=require(_0xfb46('0xe'))(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x4bbb0b,_0xf1ce3c,_0x483ef3){return new BPromise(function(_0x7e738e,_0x145e60){return client[_0xfb46('0xf')](_0x4bbb0b,_0x483ef3)[_0xfb46('0x10')](function(_0x1225d3){logger[_0xfb46('0x11')](_0xfb46('0x12'),_0xf1ce3c,_0xfb46('0x13'));logger[_0xfb46('0x14')](_0xfb46('0x15'),_0xf1ce3c,'request\x20sent',JSON['stringify'](_0x1225d3));if(_0x1225d3[_0xfb46('0x16')]){if(_0x1225d3['error'][_0xfb46('0x17')]===0x1f4){logger[_0xfb46('0x16')]('UserProfile,\x20%s,\x20%s',_0xf1ce3c,_0x1225d3[_0xfb46('0x16')][_0xfb46('0x18')]);return _0x145e60(_0x1225d3[_0xfb46('0x16')][_0xfb46('0x18')]);}logger['error'](_0xfb46('0x12'),_0xf1ce3c,_0x1225d3[_0xfb46('0x16')][_0xfb46('0x18')]);return _0x7e738e(_0x1225d3['error'][_0xfb46('0x18')]);}else{logger[_0xfb46('0x11')]('UserProfile,\x20%s,\x20%s',_0xf1ce3c,'request\x20sent');_0x7e738e(_0x1225d3[_0xfb46('0x19')][_0xfb46('0x18')]);}})[_0xfb46('0x1a')](function(_0xde1136){logger[_0xfb46('0x16')](_0xfb46('0x12'),_0xf1ce3c,_0xde1136);_0x145e60(_0xde1136);});});}
\ No newline at end of file
index f014b50..9e7df07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3673=['./userProfile.events','save','removeListener','register','length','userProfile:'];(function(_0x242c8d,_0x4bf74d){var _0x1fd9f2=function(_0x2c74af){while(--_0x2c74af){_0x242c8d['push'](_0x242c8d['shift']());}};_0x1fd9f2(++_0x4bf74d);}(_0x3673,0xb4));var _0x3367=function(_0x53c256,_0x382a24){_0x53c256=_0x53c256-0x0;var _0x25feb6=_0x3673[_0x53c256];return _0x25feb6;};'use strict';var UserProfileEvents=require(_0x3367('0x0'));var events=[_0x3367('0x1'),'remove','update'];function createListener(_0x59c5a6,_0xafb4a8){return function(_0x47fe31){_0xafb4a8['emit'](_0x59c5a6,_0x47fe31);};}function removeListener(_0x12a4d3,_0x244385){return function(){UserProfileEvents[_0x3367('0x2')](_0x12a4d3,_0x244385);};}exports[_0x3367('0x3')]=function(_0x1ea45b){for(var _0x553efb=0x0,_0x43d73a=events[_0x3367('0x4')];_0x553efb<_0x43d73a;_0x553efb++){var _0xf7e208=events[_0x553efb];var _0x3e37e3=createListener(_0x3367('0x5')+_0xf7e208,_0x1ea45b);UserProfileEvents['on'](_0xf7e208,_0x3e37e3);}};
\ No newline at end of file
+var _0xaab2=['userProfile:','./userProfile.events','remove','update','removeListener','length'];(function(_0x209a38,_0x477d6b){var _0x42671e=function(_0x49b559){while(--_0x49b559){_0x209a38['push'](_0x209a38['shift']());}};_0x42671e(++_0x477d6b);}(_0xaab2,0x19f));var _0x2aab=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xaab2[_0x3ff085];return _0x2b68c3;};'use strict';var UserProfileEvents=require(_0x2aab('0x0'));var events=['save',_0x2aab('0x1'),_0x2aab('0x2')];function createListener(_0x61e4ee,_0x14eb11){return function(_0x266112){_0x14eb11['emit'](_0x61e4ee,_0x266112);};}function removeListener(_0x24a532,_0x576ead){return function(){UserProfileEvents[_0x2aab('0x3')](_0x24a532,_0x576ead);};}exports['register']=function(_0x5f4bc5){for(var _0x2c071b=0x0,_0xbc8df3=events[_0x2aab('0x4')];_0x2c071b<_0xbc8df3;_0x2c071b++){var _0xe216f3=events[_0x2c071b];var _0x1bb64a=createListener(_0x2aab('0x5')+_0xe216f3,_0x5f4bc5);UserProfileEvents['on'](_0xe216f3,_0x1bb64a);}};
\ No newline at end of file
index 058d696..444f1ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bd5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','index','isAuthenticated','describe','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4900e7,_0x3b3f2a){var _0x35803d=function(_0x1c4046){while(--_0x1c4046){_0x4900e7['push'](_0x4900e7['shift']());}};_0x35803d(++_0x3b3f2a);}(_0x0bd5,0x84));var _0x50bd=function(_0x273f05,_0x1c5c8f){_0x273f05=_0x273f05-0x0;var _0xcff0bf=_0x0bd5[_0x273f05];return _0xcff0bf;};'use strict';var multer=require(_0x50bd('0x0'));var util=require(_0x50bd('0x1'));var path=require(_0x50bd('0x2'));var timeout=require(_0x50bd('0x3'));var express=require(_0x50bd('0x4'));var router=express[_0x50bd('0x5')]();var fs_extra=require(_0x50bd('0x6'));var auth=require(_0x50bd('0x7'));var interaction=require(_0x50bd('0x8'));var config=require(_0x50bd('0x9'));var controller=require(_0x50bd('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x50bd('0xb')]);router['get']('/describe',auth[_0x50bd('0xc')](),controller[_0x50bd('0xd')]);router[_0x50bd('0xe')](_0x50bd('0xf'),auth[_0x50bd('0xc')](),controller[_0x50bd('0x10')]);router['post']('/',auth[_0x50bd('0xc')](),controller[_0x50bd('0x11')]);router[_0x50bd('0x12')]('/:id',auth[_0x50bd('0xc')](),controller[_0x50bd('0x13')]);router[_0x50bd('0x14')](_0x50bd('0xf'),auth[_0x50bd('0xc')](),controller[_0x50bd('0x15')]);module[_0x50bd('0x16')]=router;
\ No newline at end of file
+var _0x489b=['index','isAuthenticated','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get'];(function(_0xbfe53a,_0xb0bf59){var _0x52a601=function(_0x12d426){while(--_0x12d426){_0xbfe53a['push'](_0xbfe53a['shift']());}};_0x52a601(++_0xb0bf59);}(_0x489b,0x184));var _0xb489=function(_0x264d6b,_0x3be060){_0x264d6b=_0x264d6b-0x0;var _0x1ac37e=_0x489b[_0x264d6b];return _0x1ac37e;};'use strict';var multer=require(_0xb489('0x0'));var util=require(_0xb489('0x1'));var path=require(_0xb489('0x2'));var timeout=require('connect-timeout');var express=require(_0xb489('0x3'));var router=express[_0xb489('0x4')]();var fs_extra=require(_0xb489('0x5'));var auth=require(_0xb489('0x6'));var interaction=require(_0xb489('0x7'));var config=require(_0xb489('0x8'));var controller=require(_0xb489('0x9'));router[_0xb489('0xa')]('/',auth['isAuthenticated'](),controller[_0xb489('0xb')]);router[_0xb489('0xa')]('/describe',auth[_0xb489('0xc')](),controller[_0xb489('0xd')]);router[_0xb489('0xa')](_0xb489('0xe'),auth[_0xb489('0xc')](),controller[_0xb489('0xf')]);router[_0xb489('0x10')]('/',auth[_0xb489('0xc')](),controller['create']);router[_0xb489('0x11')](_0xb489('0xe'),auth[_0xb489('0xc')](),controller[_0xb489('0x12')]);router['delete'](_0xb489('0xe'),auth[_0xb489('0xc')](),controller[_0xb489('0x13')]);module[_0xb489('0x14')]=router;
\ No newline at end of file
index 1f622e5..a938198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7052=['sequelize','exports','STRING','INTEGER'];(function(_0x57fa65,_0x3488ff){var _0x448ed8=function(_0x1de73b){while(--_0x1de73b){_0x57fa65['push'](_0x57fa65['shift']());}};_0x448ed8(++_0x3488ff);}(_0x7052,0xdc));var _0x2705=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0x7052[_0x3f3f06];return _0x140feb;};'use strict';var Sequelize=require(_0x2705('0x0'));module[_0x2705('0x1')]={'name':{'type':Sequelize[_0x2705('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x2705('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x2705('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x9423=['STRING','INTEGER','sequelize','exports'];(function(_0x171d25,_0x19a732){var _0x443cae=function(_0x7fef32){while(--_0x7fef32){_0x171d25['push'](_0x171d25['shift']());}};_0x443cae(++_0x19a732);}(_0x9423,0xca));var _0x3942=function(_0x13c247,_0x1376b1){_0x13c247=_0x13c247-0x0;var _0x4801d3=_0x9423[_0x13c247];return _0x4801d3;};'use strict';var Sequelize=require(_0x3942('0x0'));module[_0x3942('0x1')]={'name':{'type':Sequelize[_0x3942('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x3942('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x3942('0x2')],'allowNull':![]}};
\ No newline at end of file
index ce2bb70..c6fbe03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','UserProfileResource','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body','describe','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x2890ad,_0x197305){var _0x173d28=function(_0x567789){while(--_0x567789){_0x2890ad['push'](_0x2890ad['shift']());}};_0x173d28(++_0x197305);}(_0xb016,0x159));var _0x6b01=function(_0x4c62d2,_0x112684){_0x4c62d2=_0x4c62d2-0x0;var _0x57fc15=_0xb016[_0x4c62d2];return _0x57fc15;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['UserProfileResource'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};exports[_0x6b01('0x45')]=function(_0x13ab4f,_0x5617d7){return db[_0x6b01('0x29')][_0x6b01('0x45')]()[_0x6b01('0x21')](respondWithResult(_0x5617d7,null))[_0x6b01('0x40')](handleError(_0x5617d7,null));};
\ No newline at end of file
+var _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x375325,_0x57a850){var _0x228f57=function(_0x2ad744){while(--_0x2ad744){_0x375325['push'](_0x375325['shift']());}};_0x228f57(++_0x57a850);}(_0x430c,0x1a1));var _0xc430=function(_0x322522,_0x4db288){_0x322522=_0x322522-0x0;var _0x293bcf=_0x430c[_0x322522];return _0x293bcf;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,null));};
\ No newline at end of file
index 9fcbca0..bbf1296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3492=['rimraf','./userProfileResource.attributes','exports','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment'];(function(_0x57425e,_0x6eaae8){var _0xb7bb71=function(_0x3b5daf){while(--_0x3b5daf){_0x57425e['push'](_0x57425e['shift']());}};_0xb7bb71(++_0x6eaae8);}(_0x3492,0xff));var _0x2349=function(_0x53ebdb,_0x5e2120){_0x53ebdb=_0x53ebdb-0x0;var _0x2a3619=_0x3492[_0x53ebdb];return _0x2a3619;};'use strict';var _=require(_0x2349('0x0'));var util=require(_0x2349('0x1'));var logger=require(_0x2349('0x2'))(_0x2349('0x3'));var moment=require(_0x2349('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2349('0x5'));var config=require('../../config/environment');var attributes=require(_0x2349('0x6'));module[_0x2349('0x7')]=function(_0x52de69,_0x40056f){return _0x52de69['define']('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x2349('0x8'),'fields':['resourceId',_0x2349('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f61=['bluebird','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','api','moment'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x6f61,0x1dc));var _0x16f6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f61[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x16f6('0x0'));var logger=require(_0x16f6('0x1'))(_0x16f6('0x2'));var moment=require(_0x16f6('0x3'));var BPromise=require(_0x16f6('0x4'));var rp=require(_0x16f6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16f6('0x6'));var config=require(_0x16f6('0x7'));var attributes=require(_0x16f6('0x8'));module['exports']=function(_0x436c20,_0x4795de){return _0x436c20[_0x16f6('0x9')](_0x16f6('0xa'),attributes,{'tableName':_0x16f6('0xb'),'paranoid':![],'indexes':[{'name':_0x16f6('0xc'),'fields':[_0x16f6('0xd'),_0x16f6('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 42be74e..1e9f52d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0407=['rpc','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x217b49,_0x32a478){var _0x10f295=function(_0x34a2fb){while(--_0x34a2fb){_0x217b49['push'](_0x217b49['shift']());}};_0x10f295(++_0x32a478);}(_0x0407,0xd5));var _0x7040=function(_0x3818c0,_0x542521){_0x3818c0=_0x3818c0-0x0;var _0x55ec33=_0x0407[_0x3818c0];return _0x55ec33;};'use strict';var _=require('lodash');var util=require(_0x7040('0x0'));var moment=require(_0x7040('0x1'));var BPromise=require(_0x7040('0x2'));var rs=require(_0x7040('0x3'));var fs=require('fs');var Redis=require(_0x7040('0x4'));var db=require(_0x7040('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7040('0x6'))(_0x7040('0x7'));var config=require('../../config/environment');var jayson=require(_0x7040('0x8'));var client=jayson[_0x7040('0x9')][_0x7040('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ff7ac,_0x4353f5,_0x20bb16){return new BPromise(function(_0x59dfb9,_0x2729de){return client[_0x7040('0xb')](_0x4ff7ac,_0x20bb16)[_0x7040('0xc')](function(_0x57c96f){logger['info'](_0x7040('0xd'),_0x4353f5,_0x7040('0xe'));logger[_0x7040('0xf')](_0x7040('0x10'),_0x4353f5,_0x7040('0xe'),JSON[_0x7040('0x11')](_0x57c96f));if(_0x57c96f[_0x7040('0x12')]){if(_0x57c96f[_0x7040('0x12')][_0x7040('0x13')]===0x1f4){logger[_0x7040('0x12')](_0x7040('0xd'),_0x4353f5,_0x57c96f[_0x7040('0x12')][_0x7040('0x14')]);return _0x2729de(_0x57c96f['error'][_0x7040('0x14')]);}logger[_0x7040('0x12')](_0x7040('0xd'),_0x4353f5,_0x57c96f[_0x7040('0x12')][_0x7040('0x14')]);return _0x59dfb9(_0x57c96f[_0x7040('0x12')][_0x7040('0x14')]);}else{logger['info'](_0x7040('0xd'),_0x4353f5,_0x7040('0xe'));_0x59dfb9(_0x57c96f[_0x7040('0x15')][_0x7040('0x14')]);}})['catch'](function(_0x3f07e6){logger[_0x7040('0x12')](_0x7040('0xd'),_0x4353f5,_0x3f07e6);_0x2729de(_0x3f07e6);});});}
\ No newline at end of file
+var _0x5717=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x213b9b,_0x147c18){var _0x2fadd7=function(_0x1c68f6){while(--_0x1c68f6){_0x213b9b['push'](_0x213b9b['shift']());}};_0x2fadd7(++_0x147c18);}(_0x5717,0x140));var _0x7571=function(_0x6a99d0,_0x12d1b2){_0x6a99d0=_0x6a99d0-0x0;var _0x30e75e=_0x5717[_0x6a99d0];return _0x30e75e;};'use strict';var _=require(_0x7571('0x0'));var util=require(_0x7571('0x1'));var moment=require(_0x7571('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7571('0x3'));var db=require(_0x7571('0x4'))['db'];var utils=require(_0x7571('0x5'));var logger=require('../../config/logger')(_0x7571('0x6'));var config=require(_0x7571('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7571('0x8')][_0x7571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3431a0,_0x545749,_0xccbae1){return new BPromise(function(_0x19f787,_0x49c33a){return client[_0x7571('0xa')](_0x3431a0,_0xccbae1)[_0x7571('0xb')](function(_0x1c1052){logger[_0x7571('0xc')](_0x7571('0xd'),_0x545749,_0x7571('0xe'));logger[_0x7571('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x545749,'request\x20sent',JSON[_0x7571('0x10')](_0x1c1052));if(_0x1c1052[_0x7571('0x11')]){if(_0x1c1052[_0x7571('0x11')][_0x7571('0x12')]===0x1f4){logger[_0x7571('0x11')](_0x7571('0xd'),_0x545749,_0x1c1052['error'][_0x7571('0x13')]);return _0x49c33a(_0x1c1052[_0x7571('0x11')][_0x7571('0x13')]);}logger[_0x7571('0x11')](_0x7571('0xd'),_0x545749,_0x1c1052['error']['message']);return _0x19f787(_0x1c1052[_0x7571('0x11')][_0x7571('0x13')]);}else{logger[_0x7571('0xc')](_0x7571('0xd'),_0x545749,'request\x20sent');_0x19f787(_0x1c1052['result'][_0x7571('0x13')]);}})['catch'](function(_0x5f1747){logger['error'](_0x7571('0xd'),_0x545749,_0x5f1747);_0x49c33a(_0x5f1747);});});}
\ No newline at end of file
index f1c805b..5d0a4d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe96c=['show','post','create','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x357702,_0x203968){var _0x4dd94a=function(_0x11bc16){while(--_0x11bc16){_0x357702['push'](_0x357702['shift']());}};_0x4dd94a(++_0x203968);}(_0xe96c,0xa7));var _0xce96=function(_0x1102ce,_0x2b69e4){_0x1102ce=_0x1102ce-0x0;var _0x44cf27=_0xe96c[_0x1102ce];return _0x44cf27;};'use strict';var multer=require(_0xce96('0x0'));var util=require(_0xce96('0x1'));var path=require('path');var timeout=require(_0xce96('0x2'));var express=require(_0xce96('0x3'));var router=express[_0xce96('0x4')]();var fs_extra=require(_0xce96('0x5'));var auth=require(_0xce96('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xce96('0x7'));router['get']('/',auth[_0xce96('0x8')](),controller[_0xce96('0x9')]);router[_0xce96('0xa')](_0xce96('0xb'),auth[_0xce96('0x8')](),controller[_0xce96('0xc')]);router[_0xce96('0xa')]('/:id',auth[_0xce96('0x8')](),controller[_0xce96('0xd')]);router[_0xce96('0xe')]('/',auth[_0xce96('0x8')](),controller[_0xce96('0xf')]);router['put'](_0xce96('0x10'),auth[_0xce96('0x8')](),controller[_0xce96('0x11')]);router['delete'](_0xce96('0x10'),auth[_0xce96('0x8')](),controller[_0xce96('0x12')]);module[_0xce96('0x13')]=router;
\ No newline at end of file
+var _0xddc5=['isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xddc5,0x1ed));var _0x5ddc=function(_0x7545f8,_0x32ab10){_0x7545f8=_0x7545f8-0x0;var _0x361cc6=_0xddc5[_0x7545f8];return _0x361cc6;};'use strict';var multer=require('multer');var util=require(_0x5ddc('0x0'));var path=require(_0x5ddc('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ddc('0x2'));var router=express[_0x5ddc('0x3')]();var fs_extra=require(_0x5ddc('0x4'));var auth=require(_0x5ddc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5ddc('0x6'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x5ddc('0x7')](),controller[_0x5ddc('0x8')]);router[_0x5ddc('0x9')](_0x5ddc('0xa'),auth[_0x5ddc('0x7')](),controller[_0x5ddc('0xb')]);router[_0x5ddc('0x9')](_0x5ddc('0xc'),auth[_0x5ddc('0x7')](),controller[_0x5ddc('0xd')]);router[_0x5ddc('0xe')]('/',auth[_0x5ddc('0x7')](),controller[_0x5ddc('0xf')]);router[_0x5ddc('0x10')]('/:id',auth[_0x5ddc('0x7')](),controller[_0x5ddc('0x11')]);router[_0x5ddc('0x12')](_0x5ddc('0xc'),auth[_0x5ddc('0x7')](),controller[_0x5ddc('0x13')]);module['exports']=router;
\ No newline at end of file
index f78203d..3ad97f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1775=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING'];(function(_0x4e4885,_0x3d2784){var _0x46ed7c=function(_0x57add0){while(--_0x57add0){_0x4e4885['push'](_0x4e4885['shift']());}};_0x46ed7c(++_0x3d2784);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x5177('0x0')]={'name':{'type':Sequelize[_0x5177('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x5177('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x5177('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x5177('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x5177('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x5177('0x1')],'set':function(_0x2027bf){this[_0x5177('0x4')](_0x5177('0x5'),_0x2027bf?_0x2027bf[_0x5177('0x6')](''):[]);},'get':function(){return this[_0x5177('0x7')](_0x5177('0x5'))?this[_0x5177('0x7')](_0x5177('0x5'))[_0x5177('0x8')](''):[];}}};
\ No newline at end of file
+var _0x4024=['crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','getDataValue'];(function(_0x45de72,_0x3f2819){var _0x475f0f=function(_0x5dd360){while(--_0x5dd360){_0x45de72['push'](_0x45de72['shift']());}};_0x475f0f(++_0x3f2819);}(_0x4024,0x89));var _0x4402=function(_0x4eecb8,_0x29f16f){_0x4eecb8=_0x4eecb8-0x0;var _0xbd6967=_0x4024[_0x4eecb8];return _0xbd6967;};'use strict';var Sequelize=require(_0x4402('0x0'));module[_0x4402('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4402('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4402('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4402('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x950c82){this[_0x4402('0x5')]('crudPermissions',_0x950c82?_0x950c82['join'](''):[]);},'get':function(){return this[_0x4402('0x6')](_0x4402('0x7'))?this[_0x4402('0x6')]('crudPermissions')[_0x4402('0x8')](''):[];}}};
\ No newline at end of file
index 5a2f32d..c38bde9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bda=['path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','UserProfileSection','rawAttributes','fieldName','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','bluebird','mustache','util'];(function(_0x4d7dfa,_0x240260){var _0x9636f1=function(_0x2f771a){while(--_0x2f771a){_0x4d7dfa['push'](_0x4d7dfa['shift']());}};_0x9636f1(++_0x240260);}(_0x6bda,0xcd));var _0xa6bd=function(_0x310646,_0x4e78d4){_0x310646=_0x310646-0x0;var _0x20b853=_0x6bda[_0x310646];return _0x20b853;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa6bd('0x0'));var jsonpatch=require(_0xa6bd('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa6bd('0x2'));var Mustache=require(_0xa6bd('0x3'));var util=require(_0xa6bd('0x4'));var path=require(_0xa6bd('0x5'));var sox=require(_0xa6bd('0x6'));var csv=require('to-csv');var ejs=require(_0xa6bd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6bd('0x8'));var squel=require('squel');var crypto=require(_0xa6bd('0x9'));var jsforce=require(_0xa6bd('0xa'));var deskjs=require(_0xa6bd('0xb'));var toCsv=require(_0xa6bd('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa6bd('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6bd('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6bd('0xf'))(_0xa6bd('0x10'));var utils=require('../../config/utils');var config=require(_0xa6bd('0x11'));var licenseUtil=require(_0xa6bd('0x12'));var db=require(_0xa6bd('0x13'))['db'];function respondWithStatusCode(_0x25e34b,_0x3080d5){_0x3080d5=_0x3080d5||0xcc;return function(_0x51530c){if(_0x51530c){return _0x25e34b[_0xa6bd('0x14')](_0x3080d5);}return _0x25e34b[_0xa6bd('0x15')](_0x3080d5)[_0xa6bd('0x16')]();};}function respondWithResult(_0x35f852,_0x6e8fa4){_0x6e8fa4=_0x6e8fa4||0xc8;return function(_0x14d2ed){if(_0x14d2ed){return _0x35f852[_0xa6bd('0x15')](_0x6e8fa4)[_0xa6bd('0x17')](_0x14d2ed);}};}function respondWithFilteredResult(_0x2f8805,_0x57468d){return function(_0xdc835f){if(_0xdc835f){var _0x261039=typeof _0x57468d[_0xa6bd('0x18')]==='undefined'&&typeof _0x57468d[_0xa6bd('0x19')]==='undefined';var _0x4db287=_0xdc835f[_0xa6bd('0x1a')];var _0x171c3b=_0x261039?0x0:_0x57468d[_0xa6bd('0x18')];var _0x4680f7=_0x261039?_0xdc835f['count']:_0x57468d['offset']+_0x57468d[_0xa6bd('0x19')];var _0x3a997e;if(_0x4680f7>=_0x4db287){_0x4680f7=_0x4db287;_0x3a997e=0xc8;}else{_0x3a997e=0xce;}_0x2f8805[_0xa6bd('0x15')](_0x3a997e);return _0x2f8805[_0xa6bd('0x1b')](_0xa6bd('0x1c'),_0x171c3b+'-'+_0x4680f7+'/'+_0x4db287)[_0xa6bd('0x17')](_0xdc835f);}return null;};}function patchUpdates(_0x3e5e90){return function(_0x8ea426){try{jsonpatch[_0xa6bd('0x1d')](_0x8ea426,_0x3e5e90,!![]);}catch(_0x19471a){return BPromise[_0xa6bd('0x1e')](_0x19471a);}return _0x8ea426[_0xa6bd('0x1f')]();};}function saveUpdates(_0x1ddd1a,_0x15a3e8){return function(_0x2e1c78){if(_0x2e1c78){return _0x2e1c78[_0xa6bd('0x20')](_0x1ddd1a)['then'](function(_0x25c628){return _0x25c628;});}return null;};}function removeEntity(_0x59554a,_0x17f9c8){return function(_0x111263){if(_0x111263){return _0x111263[_0xa6bd('0x21')]()[_0xa6bd('0x22')](function(){_0x59554a[_0xa6bd('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x417152,_0x2af5d5){return function(_0xcc7004){if(!_0xcc7004){_0x417152['sendStatus'](0x194);}return _0xcc7004;};}function handleError(_0x1c0453,_0x3904c0){_0x3904c0=_0x3904c0||0x1f4;return function(_0x5228bd){logger[_0xa6bd('0x23')](_0x5228bd['stack']);if(_0x5228bd['name']){delete _0x5228bd[_0xa6bd('0x24')];}_0x1c0453[_0xa6bd('0x15')](_0x3904c0)[_0xa6bd('0x25')](_0x5228bd);};}exports[_0xa6bd('0x26')]=function(_0x6696e1,_0x5641da){var _0x4e976f={},_0x244641={},_0x58e93a={'count':0x0,'rows':[]};var _0x1f5f69=_['map'](db[_0xa6bd('0x27')][_0xa6bd('0x28')],function(_0x2407d3){return{'name':_0x2407d3[_0xa6bd('0x29')],'type':_0x2407d3['type']['key']};});_0x244641[_0xa6bd('0x2a')]=_[_0xa6bd('0x2b')](_0x1f5f69,_0xa6bd('0x24'));_0x244641['query']=_['keys'](_0x6696e1[_0xa6bd('0x2c')]);_0x244641[_0xa6bd('0x2d')]=_['intersection'](_0x244641[_0xa6bd('0x2a')],_0x244641[_0xa6bd('0x2c')]);_0x4e976f[_0xa6bd('0x2e')]=_[_0xa6bd('0x2f')](_0x244641[_0xa6bd('0x2a')],qs[_0xa6bd('0x30')](_0x6696e1[_0xa6bd('0x2c')][_0xa6bd('0x30')]));_0x4e976f[_0xa6bd('0x2e')]=_0x4e976f[_0xa6bd('0x2e')][_0xa6bd('0x31')]?_0x4e976f[_0xa6bd('0x2e')]:_0x244641[_0xa6bd('0x2a')];if(!_0x6696e1[_0xa6bd('0x2c')][_0xa6bd('0x32')](_0xa6bd('0x33'))){_0x4e976f[_0xa6bd('0x19')]=qs[_0xa6bd('0x19')](_0x6696e1[_0xa6bd('0x2c')][_0xa6bd('0x19')]);_0x4e976f['offset']=qs[_0xa6bd('0x18')](_0x6696e1[_0xa6bd('0x2c')]['offset']);}_0x4e976f[_0xa6bd('0x34')]=qs[_0xa6bd('0x35')](_0x6696e1[_0xa6bd('0x2c')][_0xa6bd('0x35')]);_0x4e976f['where']=qs[_0xa6bd('0x2d')](_[_0xa6bd('0x36')](_0x6696e1[_0xa6bd('0x2c')],_0x244641[_0xa6bd('0x2d')]),_0x1f5f69);if(_0x6696e1['query'][_0xa6bd('0x37')]){_0x4e976f['where']=_[_0xa6bd('0x38')](_0x4e976f[_0xa6bd('0x39')],{'$or':_[_0xa6bd('0x2b')](_0x1f5f69,function(_0x4fd34b){if(_0x4fd34b[_0xa6bd('0x3a')]!=='VIRTUAL'){var _0x817c48={};_0x817c48[_0x4fd34b[_0xa6bd('0x24')]]={'$like':'%'+_0x6696e1[_0xa6bd('0x2c')]['filter']+'%'};return _0x817c48;}})});}_0x4e976f=_[_0xa6bd('0x38')]({},_0x4e976f,_0x6696e1[_0xa6bd('0x3b')]);var _0x35a980={'where':_0x4e976f[_0xa6bd('0x39')]};return db[_0xa6bd('0x27')][_0xa6bd('0x1a')](_0x35a980)[_0xa6bd('0x22')](function(_0x3fc3b3){_0x58e93a[_0xa6bd('0x1a')]=_0x3fc3b3;if(_0x6696e1[_0xa6bd('0x2c')]['includeAll']){_0x4e976f['include']=[{'all':!![]}];}return db[_0xa6bd('0x27')]['findAll'](_0x4e976f);})[_0xa6bd('0x22')](function(_0x26887d){_0x58e93a['rows']=_0x26887d;return _0x58e93a;})[_0xa6bd('0x22')](respondWithFilteredResult(_0x5641da,_0x4e976f))[_0xa6bd('0x3c')](handleError(_0x5641da,null));};exports[_0xa6bd('0x3d')]=function(_0x103366,_0x54d083){var _0x5778b3={'raw':![],'where':{'id':_0x103366[_0xa6bd('0x3e')]['id']}},_0x478cbd={};_0x478cbd[_0xa6bd('0x2a')]=_[_0xa6bd('0x3f')](db[_0xa6bd('0x27')][_0xa6bd('0x28')]);_0x478cbd[_0xa6bd('0x2c')]=_[_0xa6bd('0x3f')](_0x103366[_0xa6bd('0x2c')]);_0x478cbd['filters']=_[_0xa6bd('0x2f')](_0x478cbd[_0xa6bd('0x2a')],_0x478cbd[_0xa6bd('0x2c')]);_0x5778b3[_0xa6bd('0x2e')]=_[_0xa6bd('0x2f')](_0x478cbd['model'],qs['fields'](_0x103366[_0xa6bd('0x2c')]['fields']));_0x5778b3['attributes']=_0x5778b3[_0xa6bd('0x2e')][_0xa6bd('0x31')]?_0x5778b3[_0xa6bd('0x2e')]:_0x478cbd[_0xa6bd('0x2a')];if(_0x103366[_0xa6bd('0x2c')][_0xa6bd('0x40')]){_0x5778b3[_0xa6bd('0x41')]=[{'all':!![]}];}_0x5778b3=_[_0xa6bd('0x38')]({},_0x5778b3,_0x103366['options']);return db[_0xa6bd('0x27')]['find'](_0x5778b3)['then'](handleEntityNotFound(_0x54d083,null))['then'](respondWithResult(_0x54d083,null))[_0xa6bd('0x3c')](handleError(_0x54d083,null));};exports['create']=function(_0x213216,_0x69c492){return db['UserProfileSection'][_0xa6bd('0x42')](_0x213216[_0xa6bd('0x43')],{})[_0xa6bd('0x22')](respondWithResult(_0x69c492,0xc9))[_0xa6bd('0x3c')](handleError(_0x69c492,null));};exports[_0xa6bd('0x20')]=function(_0x49f69b,_0x2d6394){if(_0x49f69b[_0xa6bd('0x43')]['id']){delete _0x49f69b[_0xa6bd('0x43')]['id'];}return db[_0xa6bd('0x27')]['find']({'where':{'id':_0x49f69b['params']['id']}})[_0xa6bd('0x22')](handleEntityNotFound(_0x2d6394,null))['then'](saveUpdates(_0x49f69b[_0xa6bd('0x43')],null))['then'](respondWithResult(_0x2d6394,null))['catch'](handleError(_0x2d6394,null));};exports[_0xa6bd('0x21')]=function(_0x5bf4d5,_0x58465a){return db[_0xa6bd('0x27')][_0xa6bd('0x44')]({'where':{'id':_0x5bf4d5[_0xa6bd('0x3e')]['id']}})[_0xa6bd('0x22')](handleEntityNotFound(_0x58465a,null))['then'](removeEntity(_0x58465a,null))[_0xa6bd('0x3c')](handleError(_0x58465a,null));};exports[_0xa6bd('0x45')]=function(_0x161304,_0x4f37dc){return db[_0xa6bd('0x27')]['describe']()[_0xa6bd('0x22')](respondWithResult(_0x4f37dc,null))['catch'](handleError(_0x4f37dc,null));};
\ No newline at end of file
+var _0x98d6=['fieldName','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','show','keys','length','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','index','UserProfileSection','rawAttributes'];(function(_0x47df54,_0x1aeb61){var _0x261b87=function(_0x54bc77){while(--_0x54bc77){_0x47df54['push'](_0x47df54['shift']());}};_0x261b87(++_0x1aeb61);}(_0x98d6,0x1dd));var _0x698d=function(_0x475c88,_0x21d865){_0x475c88=_0x475c88-0x0;var _0x37dd6b=_0x98d6[_0x475c88];return _0x37dd6b;};'use strict';var emlformat=require(_0x698d('0x0'));var rimraf=require(_0x698d('0x1'));var zipdir=require(_0x698d('0x2'));var jsonpatch=require(_0x698d('0x3'));var rp=require(_0x698d('0x4'));var moment=require(_0x698d('0x5'));var BPromise=require(_0x698d('0x6'));var Mustache=require('mustache');var util=require(_0x698d('0x7'));var path=require(_0x698d('0x8'));var sox=require(_0x698d('0x9'));var csv=require(_0x698d('0xa'));var ejs=require(_0x698d('0xb'));var fs=require('fs');var fs_extra=require(_0x698d('0xc'));var _=require(_0x698d('0xd'));var squel=require(_0x698d('0xe'));var crypto=require(_0x698d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x698d('0x10'));var toCsv=require(_0x698d('0xa'));var querystring=require(_0x698d('0x11'));var Papa=require(_0x698d('0x12'));var Redis=require(_0x698d('0x13'));var authService=require(_0x698d('0x14'));var qs=require(_0x698d('0x15'));var as=require(_0x698d('0x16'));var hardwareService=require(_0x698d('0x17'));var logger=require(_0x698d('0x18'))(_0x698d('0x19'));var utils=require(_0x698d('0x1a'));var config=require(_0x698d('0x1b'));var licenseUtil=require(_0x698d('0x1c'));var db=require(_0x698d('0x1d'))['db'];function respondWithStatusCode(_0x4698f2,_0x2fbb33){_0x2fbb33=_0x2fbb33||0xcc;return function(_0x12958e){if(_0x12958e){return _0x4698f2['sendStatus'](_0x2fbb33);}return _0x4698f2[_0x698d('0x1e')](_0x2fbb33)['end']();};}function respondWithResult(_0x5317e1,_0x137df3){_0x137df3=_0x137df3||0xc8;return function(_0x3dd781){if(_0x3dd781){return _0x5317e1['status'](_0x137df3)[_0x698d('0x1f')](_0x3dd781);}};}function respondWithFilteredResult(_0x1ebf54,_0x9a7beb){return function(_0x4ab8f7){if(_0x4ab8f7){var _0x8c6be1=typeof _0x9a7beb['offset']===_0x698d('0x20')&&typeof _0x9a7beb[_0x698d('0x21')]==='undefined';var _0x4801b2=_0x4ab8f7[_0x698d('0x22')];var _0x3f4da8=_0x8c6be1?0x0:_0x9a7beb[_0x698d('0x23')];var _0xcbccd6=_0x8c6be1?_0x4ab8f7[_0x698d('0x22')]:_0x9a7beb['offset']+_0x9a7beb[_0x698d('0x21')];var _0x49209a;if(_0xcbccd6>=_0x4801b2){_0xcbccd6=_0x4801b2;_0x49209a=0xc8;}else{_0x49209a=0xce;}_0x1ebf54[_0x698d('0x1e')](_0x49209a);return _0x1ebf54['set']('Content-Range',_0x3f4da8+'-'+_0xcbccd6+'/'+_0x4801b2)[_0x698d('0x1f')](_0x4ab8f7);}return null;};}function patchUpdates(_0x2e3ae7){return function(_0x51b526){try{jsonpatch[_0x698d('0x24')](_0x51b526,_0x2e3ae7,!![]);}catch(_0xb9d6ce){return BPromise[_0x698d('0x25')](_0xb9d6ce);}return _0x51b526[_0x698d('0x26')]();};}function saveUpdates(_0x11189d,_0x8a263c){return function(_0x870708){if(_0x870708){return _0x870708[_0x698d('0x27')](_0x11189d)[_0x698d('0x28')](function(_0x2d31c3){return _0x2d31c3;});}return null;};}function removeEntity(_0x2ea2e5,_0x29fe75){return function(_0x54a3e8){if(_0x54a3e8){return _0x54a3e8[_0x698d('0x29')]()[_0x698d('0x28')](function(){_0x2ea2e5[_0x698d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57cf43,_0x269ba7){return function(_0x2ff738){if(!_0x2ff738){_0x57cf43['sendStatus'](0x194);}return _0x2ff738;};}function handleError(_0x196f2c,_0x53937e){_0x53937e=_0x53937e||0x1f4;return function(_0x4f649f){logger[_0x698d('0x2a')](_0x4f649f[_0x698d('0x2b')]);if(_0x4f649f[_0x698d('0x2c')]){delete _0x4f649f[_0x698d('0x2c')];}_0x196f2c['status'](_0x53937e)['send'](_0x4f649f);};}exports[_0x698d('0x2d')]=function(_0x3cafe3,_0x4b9711){var _0x1f4772={},_0x465dc4={},_0x37da0e={'count':0x0,'rows':[]};var _0x52fe03=_['map'](db[_0x698d('0x2e')][_0x698d('0x2f')],function(_0x2c412e){return{'name':_0x2c412e[_0x698d('0x30')],'type':_0x2c412e['type']['key']};});_0x465dc4['model']=_[_0x698d('0x31')](_0x52fe03,_0x698d('0x2c'));_0x465dc4[_0x698d('0x32')]=_['keys'](_0x3cafe3[_0x698d('0x32')]);_0x465dc4[_0x698d('0x33')]=_[_0x698d('0x34')](_0x465dc4[_0x698d('0x35')],_0x465dc4['query']);_0x1f4772['attributes']=_[_0x698d('0x34')](_0x465dc4[_0x698d('0x35')],qs['fields'](_0x3cafe3['query'][_0x698d('0x36')]));_0x1f4772['attributes']=_0x1f4772[_0x698d('0x37')]['length']?_0x1f4772[_0x698d('0x37')]:_0x465dc4[_0x698d('0x35')];if(!_0x3cafe3[_0x698d('0x32')][_0x698d('0x38')](_0x698d('0x39'))){_0x1f4772[_0x698d('0x21')]=qs[_0x698d('0x21')](_0x3cafe3[_0x698d('0x32')]['limit']);_0x1f4772['offset']=qs['offset'](_0x3cafe3[_0x698d('0x32')][_0x698d('0x23')]);}_0x1f4772[_0x698d('0x3a')]=qs['sort'](_0x3cafe3[_0x698d('0x32')][_0x698d('0x3b')]);_0x1f4772[_0x698d('0x3c')]=qs[_0x698d('0x33')](_['pick'](_0x3cafe3[_0x698d('0x32')],_0x465dc4['filters']),_0x52fe03);if(_0x3cafe3[_0x698d('0x32')][_0x698d('0x3d')]){_0x1f4772[_0x698d('0x3c')]=_[_0x698d('0x3e')](_0x1f4772[_0x698d('0x3c')],{'$or':_[_0x698d('0x31')](_0x52fe03,function(_0x5bdd86){if(_0x5bdd86['type']!=='VIRTUAL'){var _0x2adbae={};_0x2adbae[_0x5bdd86[_0x698d('0x2c')]]={'$like':'%'+_0x3cafe3['query'][_0x698d('0x3d')]+'%'};return _0x2adbae;}})});}_0x1f4772=_['merge']({},_0x1f4772,_0x3cafe3[_0x698d('0x3f')]);var _0x35448b={'where':_0x1f4772['where']};return db[_0x698d('0x2e')]['count'](_0x35448b)[_0x698d('0x28')](function(_0x5a3bd5){_0x37da0e['count']=_0x5a3bd5;if(_0x3cafe3['query'][_0x698d('0x40')]){_0x1f4772[_0x698d('0x41')]=[{'all':!![]}];}return db[_0x698d('0x2e')]['findAll'](_0x1f4772);})['then'](function(_0x11254a){_0x37da0e['rows']=_0x11254a;return _0x37da0e;})[_0x698d('0x28')](respondWithFilteredResult(_0x4b9711,_0x1f4772))['catch'](handleError(_0x4b9711,null));};exports[_0x698d('0x42')]=function(_0x4ad98d,_0x2fcad1){var _0x278b36={'raw':![],'where':{'id':_0x4ad98d['params']['id']}},_0x27a535={};_0x27a535[_0x698d('0x35')]=_[_0x698d('0x43')](db[_0x698d('0x2e')][_0x698d('0x2f')]);_0x27a535['query']=_[_0x698d('0x43')](_0x4ad98d[_0x698d('0x32')]);_0x27a535['filters']=_[_0x698d('0x34')](_0x27a535[_0x698d('0x35')],_0x27a535[_0x698d('0x32')]);_0x278b36['attributes']=_[_0x698d('0x34')](_0x27a535[_0x698d('0x35')],qs[_0x698d('0x36')](_0x4ad98d[_0x698d('0x32')][_0x698d('0x36')]));_0x278b36['attributes']=_0x278b36[_0x698d('0x37')][_0x698d('0x44')]?_0x278b36[_0x698d('0x37')]:_0x27a535[_0x698d('0x35')];if(_0x4ad98d['query'][_0x698d('0x40')]){_0x278b36[_0x698d('0x41')]=[{'all':!![]}];}_0x278b36=_[_0x698d('0x3e')]({},_0x278b36,_0x4ad98d[_0x698d('0x3f')]);return db['UserProfileSection'][_0x698d('0x45')](_0x278b36)[_0x698d('0x28')](handleEntityNotFound(_0x2fcad1,null))[_0x698d('0x28')](respondWithResult(_0x2fcad1,null))['catch'](handleError(_0x2fcad1,null));};exports[_0x698d('0x46')]=function(_0x143632,_0x48b27d){return db[_0x698d('0x2e')][_0x698d('0x46')](_0x143632[_0x698d('0x47')],{})[_0x698d('0x28')](respondWithResult(_0x48b27d,0xc9))[_0x698d('0x48')](handleError(_0x48b27d,null));};exports[_0x698d('0x27')]=function(_0xe530c3,_0x1a51d0){if(_0xe530c3[_0x698d('0x47')]['id']){delete _0xe530c3[_0x698d('0x47')]['id'];}return db['UserProfileSection'][_0x698d('0x45')]({'where':{'id':_0xe530c3[_0x698d('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a51d0,null))['then'](saveUpdates(_0xe530c3['body'],null))[_0x698d('0x28')](respondWithResult(_0x1a51d0,null))[_0x698d('0x48')](handleError(_0x1a51d0,null));};exports[_0x698d('0x29')]=function(_0x4f7a30,_0x5e5f0e){return db['UserProfileSection'][_0x698d('0x45')]({'where':{'id':_0x4f7a30[_0x698d('0x49')]['id']}})[_0x698d('0x28')](handleEntityNotFound(_0x5e5f0e,null))[_0x698d('0x28')](removeEntity(_0x5e5f0e,null))[_0x698d('0x48')](handleError(_0x5e5f0e,null));};exports[_0x698d('0x4a')]=function(_0x2ac7f0,_0x22f038){return db[_0x698d('0x2e')]['describe']()[_0x698d('0x28')](respondWithResult(_0x22f038,null))[_0x698d('0x48')](handleError(_0x22f038,null));};
\ No newline at end of file
index 6e7c592..ef608eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52b8=['define','user_profile_has_sections','compositeIndex','sectionId','lodash','util','moment','request-promise','path','rimraf','./userProfileSection.attributes','exports'];(function(_0x561f4c,_0x1d434d){var _0x3c45f3=function(_0x56e6da){while(--_0x56e6da){_0x561f4c['push'](_0x561f4c['shift']());}};_0x3c45f3(++_0x1d434d);}(_0x52b8,0xb8));var _0x852b=function(_0x58eaa1,_0x24c3da){_0x58eaa1=_0x58eaa1-0x0;var _0x479959=_0x52b8[_0x58eaa1];return _0x479959;};'use strict';var _=require(_0x852b('0x0'));var util=require(_0x852b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x852b('0x2'));var BPromise=require('bluebird');var rp=require(_0x852b('0x3'));var fs=require('fs');var path=require(_0x852b('0x4'));var rimraf=require(_0x852b('0x5'));var config=require('../../config/environment');var attributes=require(_0x852b('0x6'));module[_0x852b('0x7')]=function(_0x1471f8,_0x5a43a3){return _0x1471f8[_0x852b('0x8')]('UserProfileSection',attributes,{'tableName':_0x852b('0x9'),'paranoid':![],'indexes':[{'name':_0x852b('0xa'),'fields':[_0x852b('0xb'),'userProfileId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb236=['rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','sectionId','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x84f4b3,_0x2777c9){var _0x287195=function(_0x385e65){while(--_0x385e65){_0x84f4b3['push'](_0x84f4b3['shift']());}};_0x287195(++_0x2777c9);}(_0xb236,0x149));var _0x6b23=function(_0x229ae8,_0x2da754){_0x229ae8=_0x229ae8-0x0;var _0x434ca3=_0xb236[_0x229ae8];return _0x434ca3;};'use strict';var _=require(_0x6b23('0x0'));var util=require(_0x6b23('0x1'));var logger=require(_0x6b23('0x2'))(_0x6b23('0x3'));var moment=require('moment');var BPromise=require(_0x6b23('0x4'));var rp=require(_0x6b23('0x5'));var fs=require('fs');var path=require(_0x6b23('0x6'));var rimraf=require(_0x6b23('0x7'));var config=require(_0x6b23('0x8'));var attributes=require(_0x6b23('0x9'));module[_0x6b23('0xa')]=function(_0x52f30f,_0x2d4ec8){return _0x52f30f['define'](_0x6b23('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x6b23('0xc'),_0x6b23('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 20123f1..294c7a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b96=['http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5d6558,_0xde8f23){var _0x5dc870=function(_0x355ecf){while(--_0x355ecf){_0x5d6558['push'](_0x5d6558['shift']());}};_0x5dc870(++_0xde8f23);}(_0x9b96,0x183));var _0x69b9=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x9b96[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x69b9('0x0'));var BPromise=require('bluebird');var rs=require(_0x69b9('0x1'));var fs=require('fs');var Redis=require(_0x69b9('0x2'));var db=require(_0x69b9('0x3'))['db'];var utils=require(_0x69b9('0x4'));var logger=require(_0x69b9('0x5'))(_0x69b9('0x6'));var config=require(_0x69b9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x69b9('0x8')][_0x69b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ec0ef,_0x26fae1,_0x4d71bf){return new BPromise(function(_0x17252c,_0x48460e){return client[_0x69b9('0xa')](_0x3ec0ef,_0x4d71bf)[_0x69b9('0xb')](function(_0x3a0c64){logger[_0x69b9('0xc')](_0x69b9('0xd'),_0x26fae1,'request\x20sent');logger[_0x69b9('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x26fae1,_0x69b9('0xf'),JSON[_0x69b9('0x10')](_0x3a0c64));if(_0x3a0c64[_0x69b9('0x11')]){if(_0x3a0c64[_0x69b9('0x11')][_0x69b9('0x12')]===0x1f4){logger[_0x69b9('0x11')](_0x69b9('0xd'),_0x26fae1,_0x3a0c64[_0x69b9('0x11')][_0x69b9('0x13')]);return _0x48460e(_0x3a0c64['error'][_0x69b9('0x13')]);}logger['error'](_0x69b9('0xd'),_0x26fae1,_0x3a0c64[_0x69b9('0x11')][_0x69b9('0x13')]);return _0x17252c(_0x3a0c64[_0x69b9('0x11')][_0x69b9('0x13')]);}else{logger[_0x69b9('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x26fae1,'request\x20sent');_0x17252c(_0x3a0c64[_0x69b9('0x14')][_0x69b9('0x13')]);}})[_0x69b9('0x15')](function(_0x4ce928){logger[_0x69b9('0x11')](_0x69b9('0xd'),_0x26fae1,_0x4ce928);_0x48460e(_0x4ce928);});});}
\ No newline at end of file
+var _0x3251=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4db96c,_0x249101){var _0x2b9ba1=function(_0x27503a){while(--_0x27503a){_0x4db96c['push'](_0x4db96c['shift']());}};_0x2b9ba1(++_0x249101);}(_0x3251,0x194));var _0x1325=function(_0x599fa4,_0x36a365){_0x599fa4=_0x599fa4-0x0;var _0x342fd3=_0x3251[_0x599fa4];return _0x342fd3;};'use strict';var _=require(_0x1325('0x0'));var util=require(_0x1325('0x1'));var moment=require(_0x1325('0x2'));var BPromise=require(_0x1325('0x3'));var rs=require(_0x1325('0x4'));var fs=require('fs');var Redis=require(_0x1325('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1325('0x6'));var logger=require(_0x1325('0x7'))(_0x1325('0x8'));var config=require(_0x1325('0x9'));var jayson=require(_0x1325('0xa'));var client=jayson[_0x1325('0xb')][_0x1325('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x111349,_0x2db3ba,_0x26d36f){return new BPromise(function(_0x20d942,_0x2db898){return client[_0x1325('0xd')](_0x111349,_0x26d36f)[_0x1325('0xe')](function(_0x119ea7){logger[_0x1325('0xf')](_0x1325('0x10'),_0x2db3ba,_0x1325('0x11'));logger[_0x1325('0x12')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2db3ba,_0x1325('0x11'),JSON[_0x1325('0x13')](_0x119ea7));if(_0x119ea7[_0x1325('0x14')]){if(_0x119ea7[_0x1325('0x14')][_0x1325('0x15')]===0x1f4){logger['error'](_0x1325('0x10'),_0x2db3ba,_0x119ea7['error'][_0x1325('0x16')]);return _0x2db898(_0x119ea7[_0x1325('0x14')][_0x1325('0x16')]);}logger['error'](_0x1325('0x10'),_0x2db3ba,_0x119ea7['error'][_0x1325('0x16')]);return _0x20d942(_0x119ea7[_0x1325('0x14')][_0x1325('0x16')]);}else{logger[_0x1325('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x2db3ba,_0x1325('0x11'));_0x20d942(_0x119ea7[_0x1325('0x17')]['message']);}})[_0x1325('0x18')](function(_0x36e113){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x2db3ba,_0x36e113);_0x2db898(_0x36e113);});});}
\ No newline at end of file
index 29d5fc2..9ef6221 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4537be,_0x12bca1){var _0x5299f6=function(_0x3663d9){while(--_0x3663d9){_0x4537be['push'](_0x4537be['shift']());}};_0x5299f6(++_0x12bca1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xcb91[_0xbf8ebe];return _0x1e25e8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x232eb7,_0x199b07){var _0xd7fb8=function(_0x149ed6){while(--_0x149ed6){_0x232eb7['push'](_0x232eb7['shift']());}};_0xd7fb8(++_0x199b07);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 ecf1047..3e5f3cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb03b=['INTEGER','sequelize'];(function(_0x250b77,_0x4321a8){var _0x46520e=function(_0xd9556e){while(--_0xd9556e){_0x250b77['push'](_0x250b77['shift']());}};_0x46520e(++_0x4321a8);}(_0xb03b,0xc7));var _0xbb03=function(_0x37ca46,_0x3f22dc){_0x37ca46=_0x37ca46-0x0;var _0xf23751=_0xb03b[_0x37ca46];return _0xf23751;};'use strict';var Sequelize=require(_0xbb03('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb03('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd61d=['exports','INTEGER'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xd61d,0x100));var _0xdd61=function(_0xa8c98c,_0x578a90){_0xa8c98c=_0xa8c98c-0x0;var _0x5429bc=_0xd61d[_0xa8c98c];return _0x5429bc;};'use strict';var Sequelize=require('sequelize');module[_0xdd61('0x0')]={'penalty':{'type':Sequelize[_0xdd61('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index ef38b26..6a594fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2aa3=['user_has_sms_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue'];(function(_0x4ace51,_0x4cff0d){var _0x27b4ed=function(_0x2145cd){while(--_0x2145cd){_0x4ace51['push'](_0x4ace51['shift']());}};_0x27b4ed(++_0x4cff0d);}(_0x2aa3,0x83));var _0x32aa=function(_0x37e43a,_0x580268){_0x37e43a=_0x37e43a-0x0;var _0x1115d1=_0x2aa3[_0x37e43a];return _0x1115d1;};'use strict';var _=require(_0x32aa('0x0'));var util=require(_0x32aa('0x1'));var logger=require(_0x32aa('0x2'))(_0x32aa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x32aa('0x4'));var fs=require('fs');var path=require(_0x32aa('0x5'));var rimraf=require(_0x32aa('0x6'));var config=require(_0x32aa('0x7'));var attributes=require(_0x32aa('0x8'));module[_0x32aa('0x9')]=function(_0x53ab98,_0x17346a){return _0x53ab98[_0x32aa('0xa')](_0x32aa('0xb'),attributes,{'tableName':_0x32aa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x83d0=['./userSmsQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x551d29,_0xdd3d87){var _0x8d0cd5=function(_0x46e1c2){while(--_0x46e1c2){_0x551d29['push'](_0x551d29['shift']());}};_0x8d0cd5(++_0xdd3d87);}(_0x83d0,0xb7));var _0x083d=function(_0x86e726,_0xe52d7d){_0x86e726=_0x86e726-0x0;var _0x240311=_0x83d0[_0x86e726];return _0x240311;};'use strict';var _=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var logger=require(_0x083d('0x2'))(_0x083d('0x3'));var moment=require(_0x083d('0x4'));var BPromise=require(_0x083d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x083d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x083d('0x7'));module[_0x083d('0x8')]=function(_0x3c4b8c,_0x2e75e8){return _0x3c4b8c[_0x083d('0x9')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1cd20cd..04e2d5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42fe=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x124298,_0x542004){var _0x35ac24=function(_0x49afe8){while(--_0x49afe8){_0x124298['push'](_0x124298['shift']());}};_0x35ac24(++_0x542004);}(_0x42fe,0x12b));var _0xe42f=function(_0x602739,_0x12fc9d){_0x602739=_0x602739-0x0;var _0x584ef7=_0x42fe[_0x602739];return _0x584ef7;};'use strict';var _=require(_0xe42f('0x0'));var util=require(_0xe42f('0x1'));var moment=require('moment');var BPromise=require(_0xe42f('0x2'));var rs=require(_0xe42f('0x3'));var fs=require('fs');var Redis=require(_0xe42f('0x4'));var db=require(_0xe42f('0x5'))['db'];var utils=require(_0xe42f('0x6'));var logger=require('../../config/logger')(_0xe42f('0x7'));var config=require(_0xe42f('0x8'));var jayson=require(_0xe42f('0x9'));var client=jayson[_0xe42f('0xa')][_0xe42f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5adcea,_0x31aa16,_0x55229f){return new BPromise(function(_0x35ca09,_0x17d549){return client[_0xe42f('0xc')](_0x5adcea,_0x55229f)[_0xe42f('0xd')](function(_0x4a70d6){logger[_0xe42f('0xe')](_0xe42f('0xf'),_0x31aa16,_0xe42f('0x10'));logger[_0xe42f('0x11')](_0xe42f('0x12'),_0x31aa16,_0xe42f('0x10'),JSON[_0xe42f('0x13')](_0x4a70d6));if(_0x4a70d6[_0xe42f('0x14')]){if(_0x4a70d6['error'][_0xe42f('0x15')]===0x1f4){logger[_0xe42f('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x31aa16,_0x4a70d6[_0xe42f('0x14')][_0xe42f('0x16')]);return _0x17d549(_0x4a70d6[_0xe42f('0x14')][_0xe42f('0x16')]);}logger[_0xe42f('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x31aa16,_0x4a70d6['error'][_0xe42f('0x16')]);return _0x35ca09(_0x4a70d6[_0xe42f('0x14')][_0xe42f('0x16')]);}else{logger[_0xe42f('0xe')](_0xe42f('0xf'),_0x31aa16,_0xe42f('0x10'));_0x35ca09(_0x4a70d6[_0xe42f('0x17')][_0xe42f('0x16')]);}})[_0xe42f('0x18')](function(_0x5eb844){logger[_0xe42f('0x14')](_0xe42f('0xf'),_0x31aa16,_0x5eb844);_0x17d549(_0x5eb844);});});}
\ No newline at end of file
+var _0x447a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x4f7122,_0x34faa8){var _0x35216b=function(_0x272b35){while(--_0x272b35){_0x4f7122['push'](_0x4f7122['shift']());}};_0x35216b(++_0x34faa8);}(_0x447a,0x179));var _0xa447=function(_0x5ceb6f,_0x28522e){_0x5ceb6f=_0x5ceb6f-0x0;var _0x5aa54f=_0x447a[_0x5ceb6f];return _0x5aa54f;};'use strict';var _=require(_0xa447('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa447('0x1'));var db=require(_0xa447('0x2'))['db'];var utils=require(_0xa447('0x3'));var logger=require(_0xa447('0x4'))(_0xa447('0x5'));var config=require(_0xa447('0x6'));var jayson=require(_0xa447('0x7'));var client=jayson[_0xa447('0x8')][_0xa447('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50a90e,_0x131e06,_0x4946eb){return new BPromise(function(_0x8493ff,_0x38b210){return client[_0xa447('0xa')](_0x50a90e,_0x4946eb)[_0xa447('0xb')](function(_0x31bdfb){logger[_0xa447('0xc')](_0xa447('0xd'),_0x131e06,_0xa447('0xe'));logger[_0xa447('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x131e06,_0xa447('0xe'),JSON[_0xa447('0x10')](_0x31bdfb));if(_0x31bdfb[_0xa447('0x11')]){if(_0x31bdfb[_0xa447('0x11')][_0xa447('0x12')]===0x1f4){logger[_0xa447('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x131e06,_0x31bdfb[_0xa447('0x11')][_0xa447('0x13')]);return _0x38b210(_0x31bdfb[_0xa447('0x11')][_0xa447('0x13')]);}logger[_0xa447('0x11')](_0xa447('0xd'),_0x131e06,_0x31bdfb['error'][_0xa447('0x13')]);return _0x8493ff(_0x31bdfb[_0xa447('0x11')][_0xa447('0x13')]);}else{logger[_0xa447('0xc')](_0xa447('0xd'),_0x131e06,_0xa447('0xe'));_0x8493ff(_0x31bdfb['result'][_0xa447('0x13')]);}})[_0xa447('0x14')](function(_0x32c0f7){logger[_0xa447('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x131e06,_0x32c0f7);_0x38b210(_0x32c0f7);});});}
\ No newline at end of file
index 7fa874e..01855bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8d2=['sequelize','INTEGER'];(function(_0x185690,_0x298dd0){var _0x6a6c55=function(_0x31654b){while(--_0x31654b){_0x185690['push'](_0x185690['shift']());}};_0x6a6c55(++_0x298dd0);}(_0xa8d2,0x7e));var _0x2a8d=function(_0x5c4085,_0x593737){_0x5c4085=_0x5c4085-0x0;var _0x182528=_0xa8d2[_0x5c4085];return _0x182528;};'use strict';var Sequelize=require(_0x2a8d('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x2a8d('0x1')]}};
\ No newline at end of file
+var _0x05e5=['INTEGER','sequelize','exports'];(function(_0x5735fe,_0x4d5f25){var _0x2e63b5=function(_0x4fd90c){while(--_0x4fd90c){_0x5735fe['push'](_0x5735fe['shift']());}};_0x2e63b5(++_0x4d5f25);}(_0x05e5,0x1cc));var _0x505e=function(_0x308ca4,_0x57770b){_0x308ca4=_0x308ca4-0x0;var _0x4086a9=_0x05e5[_0x308ca4];return _0x4086a9;};'use strict';var Sequelize=require(_0x505e('0x0'));module[_0x505e('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x505e('0x2')]}};
\ No newline at end of file
index a0acf89..2e75f69 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(_0x5b4bf6,_0x37902a){var _0x2100ee=function(_0x4eb7ee){while(--_0x4eb7ee){_0x5b4bf6['push'](_0x5b4bf6['shift']());}};_0x2100ee(++_0x37902a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x20c91c,_0x4222ed){var _0x273bd6=function(_0xe335f9){while(--_0xe335f9){_0x20c91c['push'](_0x20c91c['shift']());}};_0x273bd6(++_0x4222ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 52d1139..869b9ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x252d5c,_0x4f38b2){var _0x27ca8f=function(_0x41f260){while(--_0x41f260){_0x252d5c['push'](_0x252d5c['shift']());}};_0x27ca8f(++_0x4f38b2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3bfdde,_0x306be4){_0x3bfdde=_0x3bfdde-0x0;var _0x3f752a=_0xcb91[_0x3bfdde];return _0x3f752a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x558dad,_0x1a9b5a){var _0x1921ea=function(_0x2d44d6){while(--_0x2d44d6){_0x558dad['push'](_0x558dad['shift']());}};_0x1921ea(++_0x1a9b5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 81ab353..53aa9d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc44c=['exports','sequelize'];(function(_0x30271b,_0x32c297){var _0x116ab1=function(_0x11bd83){while(--_0x11bd83){_0x30271b['push'](_0x30271b['shift']());}};_0x116ab1(++_0x32c297);}(_0xc44c,0x107));var _0xcc44=function(_0x1a5bf3,_0x36051f){_0x1a5bf3=_0x1a5bf3-0x0;var _0x437fbd=_0xc44c[_0x1a5bf3];return _0x437fbd;};'use strict';var Sequelize=require(_0xcc44('0x0'));module[_0xcc44('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4166=['exports','sequelize'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0x4166,0x91));var _0x6416=function(_0x3db907,_0xa158bb){_0x3db907=_0x3db907-0x0;var _0x42818b=_0x4166[_0x3db907];return _0x42818b;};'use strict';var Sequelize=require(_0x6416('0x0'));module[_0x6416('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index f20a22b..7db2875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bc9=['moment','bluebird','request-promise','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','../../config/logger','api'];(function(_0x543884,_0x568d8f){var _0x45ee3c=function(_0x3caa80){while(--_0x3caa80){_0x543884['push'](_0x543884['shift']());}};_0x45ee3c(++_0x568d8f);}(_0x0bc9,0x130));var _0x90bc=function(_0x5cbfb2,_0x340bdf){_0x5cbfb2=_0x5cbfb2-0x0;var _0x564d0f=_0x0bc9[_0x5cbfb2];return _0x564d0f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90bc('0x0'))(_0x90bc('0x1'));var moment=require(_0x90bc('0x2'));var BPromise=require(_0x90bc('0x3'));var rp=require(_0x90bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x90bc('0x5'));module['exports']=function(_0x1aa986,_0xbc563f){return _0x1aa986[_0x90bc('0x6')](_0x90bc('0x7'),attributes,{'tableName':_0x90bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc56a=['request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api','bluebird'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc56a,0x14b));var _0xac56=function(_0x1f9889,_0x2f10e8){_0x1f9889=_0x1f9889-0x0;var _0x318fa8=_0xc56a[_0x1f9889];return _0x318fa8;};'use strict';var _=require(_0xac56('0x0'));var util=require(_0xac56('0x1'));var logger=require(_0xac56('0x2'))(_0xac56('0x3'));var moment=require('moment');var BPromise=require(_0xac56('0x4'));var rp=require(_0xac56('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac56('0x6'));var config=require(_0xac56('0x7'));var attributes=require(_0xac56('0x8'));module[_0xac56('0x9')]=function(_0x92d787,_0x3fcf15){return _0x92d787[_0xac56('0xa')](_0xac56('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 527c3c0..71c46db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42aa=['result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x41614f,_0x215189){var _0x432d1b=function(_0xf1ded4){while(--_0xf1ded4){_0x41614f['push'](_0x41614f['shift']());}};_0x432d1b(++_0x215189);}(_0x42aa,0x13c));var _0xa42a=function(_0xa0c4c3,_0x5305bb){_0xa0c4c3=_0xa0c4c3-0x0;var _0x2d6114=_0x42aa[_0xa0c4c3];return _0x2d6114;};'use strict';var _=require(_0xa42a('0x0'));var util=require('util');var moment=require(_0xa42a('0x1'));var BPromise=require('bluebird');var rs=require(_0xa42a('0x2'));var fs=require('fs');var Redis=require(_0xa42a('0x3'));var db=require(_0xa42a('0x4'))['db'];var utils=require(_0xa42a('0x5'));var logger=require(_0xa42a('0x6'))(_0xa42a('0x7'));var config=require(_0xa42a('0x8'));var jayson=require(_0xa42a('0x9'));var client=jayson['client'][_0xa42a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d8610,_0x3c8de3,_0x22f904){return new BPromise(function(_0x32243b,_0x3663aa){return client[_0xa42a('0xb')](_0x3d8610,_0x22f904)['then'](function(_0x548c4c){logger[_0xa42a('0xc')](_0xa42a('0xd'),_0x3c8de3,_0xa42a('0xe'));logger[_0xa42a('0xf')](_0xa42a('0x10'),_0x3c8de3,_0xa42a('0xe'),JSON['stringify'](_0x548c4c));if(_0x548c4c['error']){if(_0x548c4c[_0xa42a('0x11')][_0xa42a('0x12')]===0x1f4){logger[_0xa42a('0x11')](_0xa42a('0xd'),_0x3c8de3,_0x548c4c[_0xa42a('0x11')][_0xa42a('0x13')]);return _0x3663aa(_0x548c4c[_0xa42a('0x11')][_0xa42a('0x13')]);}logger[_0xa42a('0x11')](_0xa42a('0xd'),_0x3c8de3,_0x548c4c[_0xa42a('0x11')]['message']);return _0x32243b(_0x548c4c[_0xa42a('0x11')]['message']);}else{logger[_0xa42a('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x3c8de3,_0xa42a('0xe'));_0x32243b(_0x548c4c[_0xa42a('0x14')][_0xa42a('0x13')]);}})['catch'](function(_0x4b66a5){logger[_0xa42a('0x11')](_0xa42a('0xd'),_0x3c8de3,_0x4b66a5);_0x3663aa(_0x4b66a5);});});}
\ No newline at end of file
+var _0x48dd=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x18c9c8,_0x579eef){var _0x5641e6=function(_0x554535){while(--_0x554535){_0x18c9c8['push'](_0x18c9c8['shift']());}};_0x5641e6(++_0x579eef);}(_0x48dd,0xea));var _0xd48d=function(_0xa3f4f4,_0x24840e){_0xa3f4f4=_0xa3f4f4-0x0;var _0x34d058=_0x48dd[_0xa3f4f4];return _0x34d058;};'use strict';var _=require(_0xd48d('0x0'));var util=require(_0xd48d('0x1'));var moment=require(_0xd48d('0x2'));var BPromise=require(_0xd48d('0x3'));var rs=require(_0xd48d('0x4'));var fs=require('fs');var Redis=require(_0xd48d('0x5'));var db=require(_0xd48d('0x6'))['db'];var utils=require(_0xd48d('0x7'));var logger=require(_0xd48d('0x8'))(_0xd48d('0x9'));var config=require(_0xd48d('0xa'));var jayson=require(_0xd48d('0xb'));var client=jayson[_0xd48d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3234b6,_0x3212db,_0x573c9a){return new BPromise(function(_0x25fe8f,_0x4e93d4){return client[_0xd48d('0xd')](_0x3234b6,_0x573c9a)[_0xd48d('0xe')](function(_0x367d1e){logger['info'](_0xd48d('0xf'),_0x3212db,_0xd48d('0x10'));logger[_0xd48d('0x11')](_0xd48d('0x12'),_0x3212db,'request\x20sent',JSON[_0xd48d('0x13')](_0x367d1e));if(_0x367d1e['error']){if(_0x367d1e[_0xd48d('0x14')][_0xd48d('0x15')]===0x1f4){logger[_0xd48d('0x14')](_0xd48d('0xf'),_0x3212db,_0x367d1e[_0xd48d('0x14')]['message']);return _0x4e93d4(_0x367d1e[_0xd48d('0x14')]['message']);}logger[_0xd48d('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x3212db,_0x367d1e[_0xd48d('0x14')]['message']);return _0x25fe8f(_0x367d1e[_0xd48d('0x14')][_0xd48d('0x16')]);}else{logger['info'](_0xd48d('0xf'),_0x3212db,_0xd48d('0x10'));_0x25fe8f(_0x367d1e['result'][_0xd48d('0x16')]);}})[_0xd48d('0x17')](function(_0x5ae2a9){logger[_0xd48d('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x3212db,_0x5ae2a9);_0x4e93d4(_0x5ae2a9);});});}
\ No newline at end of file
index 2ac292e..d235035 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(_0x245efb,_0x2c636b){var _0x59ee7b=function(_0x3953f8){while(--_0x3953f8){_0x245efb['push'](_0x245efb['shift']());}};_0x59ee7b(++_0x2c636b);}(_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(_0x81b7e,_0x41ad0b){var _0x3277c6=function(_0x4cb512){while(--_0x4cb512){_0x81b7e['push'](_0x81b7e['shift']());}};_0x3277c6(++_0x41ad0b);}(_0xedd9,0xfc));var _0x9edd=function(_0x57d817,_0xb0231c){_0x57d817=_0x57d817-0x0;var _0x53959c=_0xedd9[_0x57d817];return _0x53959c;};'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 9f6ec8e..2d9ad82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd86a=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0x17273d,_0x4b47f3){var _0x3eff96=function(_0x413f62){while(--_0x413f62){_0x17273d['push'](_0x17273d['shift']());}};_0x3eff96(++_0x4b47f3);}(_0xd86a,0xf3));var _0xad86=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0xd86a[_0x3ff685];return _0x2046c9;};'use strict';var Sequelize=require(_0xad86('0x0'));module[_0xad86('0x1')]={'uniqueid':{'type':Sequelize[_0xad86('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xad86('0x3')},'UserId':{'type':Sequelize[_0xad86('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xad86('0x3')},'VoiceQueueId':{'type':Sequelize[_0xad86('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xad86('0x4')],'allowNull':![],'unique':_0xad86('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xad86('0x2')](0xb),'defaultValue':0x0,'comment':_0xad86('0x3')}};
\ No newline at end of file
+var _0x93f9=['Required\x20by\x20Asterisk','INTEGER','queue_interface','sequelize','STRING'];(function(_0x2db532,_0x471525){var _0x25042d=function(_0x3db15d){while(--_0x3db15d){_0x2db532['push'](_0x2db532['shift']());}};_0x25042d(++_0x471525);}(_0x93f9,0x1b6));var _0x993f=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x93f9[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x993f('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x993f('0x1')],'allowNull':![],'comment':_0x993f('0x2')},'UserId':{'type':Sequelize[_0x993f('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x993f('0x4'),'comment':_0x993f('0x2')},'VoiceQueueId':{'type':Sequelize[_0x993f('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0x993f('0x1')],'allowNull':![],'unique':_0x993f('0x4'),'comment':_0x993f('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x993f('0x2')},'paused':{'type':Sequelize[_0x993f('0x3')](0xb),'defaultValue':0x0,'comment':_0x993f('0x2')}};
\ No newline at end of file
index 71fb014..24503c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0b1=['hasOwnProperty','exports','../../mysqldb','UserVoiceQueueRt','save','update','emit'];(function(_0x718053,_0x6631eb){var _0x20fabb=function(_0x3a90bd){while(--_0x3a90bd){_0x718053['push'](_0x718053['shift']());}};_0x20fabb(++_0x6631eb);}(_0xc0b1,0x10c));var _0x1c0b=function(_0x229a9d,_0x4d3229){_0x229a9d=_0x229a9d-0x0;var _0x5bd600=_0xc0b1[_0x229a9d];return _0x5bd600;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x1c0b('0x0'))['db'][_0x1c0b('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1c0b('0x2'),'afterUpdate':_0x1c0b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3f3636){return function(_0x3c3dd9,_0x4528be,_0x503447){UserVoiceQueueRtEvents[_0x1c0b('0x4')](_0x3f3636+':'+_0x3c3dd9['id'],_0x3c3dd9);UserVoiceQueueRtEvents['emit'](_0x3f3636,_0x3c3dd9);_0x503447(null);};}for(var e in events){if(events[_0x1c0b('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x1c0b('0x6')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x385d=['../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','remove','hasOwnProperty','hook','exports'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x385d,0x68));var _0xd385=function(_0x43de9c,_0x42f8f9){_0x43de9c=_0x43de9c-0x0;var _0x2ce54a=_0x385d[_0x43de9c];return _0x2ce54a;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xd385('0x0'))['db'][_0xd385('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd385('0x2')](0x0);var events={'afterCreate':_0xd385('0x3'),'afterUpdate':'update','afterDestroy':_0xd385('0x4')};function emitEvent(_0x2a9d15){return function(_0x2904b7,_0x290233,_0xa1d4fe){UserVoiceQueueRtEvents['emit'](_0x2a9d15+':'+_0x2904b7['id'],_0x2904b7);UserVoiceQueueRtEvents['emit'](_0x2a9d15,_0x2904b7);_0xa1d4fe(null);};}for(var e in events){if(events[_0xd385('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xd385('0x6')](e,emitEvent(event));}}module[_0xd385('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 9e30311..d093545 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb355=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x270f00,_0x112b40){var _0x5d9b8c=function(_0x4acc82){while(--_0x4acc82){_0x270f00['push'](_0x270f00['shift']());}};_0x5d9b8c(++_0x112b40);}(_0xb355,0x64));var _0x5b35=function(_0x32a395,_0x3ab5f8){_0x32a395=_0x32a395-0x0;var _0x2ac0f1=_0xb355[_0x32a395];return _0x2ac0f1;};'use strict';var _=require(_0x5b35('0x0'));var util=require(_0x5b35('0x1'));var logger=require('../../config/logger')(_0x5b35('0x2'));var moment=require(_0x5b35('0x3'));var BPromise=require(_0x5b35('0x4'));var rp=require(_0x5b35('0x5'));var fs=require('fs');var path=require(_0x5b35('0x6'));var rimraf=require(_0x5b35('0x7'));var config=require(_0x5b35('0x8'));var attributes=require(_0x5b35('0x9'));module[_0x5b35('0xa')]=function(_0x5e839f,_0xe1a2f5){return _0x5e839f[_0x5b35('0xb')](_0x5b35('0xc'),attributes,{'tableName':_0x5b35('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb7f=['request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment','bluebird'];(function(_0x103ce6,_0xfd6c0){var _0x38e1d9=function(_0x4201a2){while(--_0x4201a2){_0x103ce6['push'](_0x103ce6['shift']());}};_0x38e1d9(++_0xfd6c0);}(_0xfb7f,0x15a));var _0xffb7=function(_0x505018,_0x1f16f0){_0x505018=_0x505018-0x0;var _0x2d844b=_0xfb7f[_0x505018];return _0x2d844b;};'use strict';var _=require(_0xffb7('0x0'));var util=require(_0xffb7('0x1'));var logger=require('../../config/logger')(_0xffb7('0x2'));var moment=require(_0xffb7('0x3'));var BPromise=require(_0xffb7('0x4'));var rp=require(_0xffb7('0x5'));var fs=require('fs');var path=require(_0xffb7('0x6'));var rimraf=require(_0xffb7('0x7'));var config=require(_0xffb7('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xffb7('0x9')]=function(_0x49ec5c,_0x21ad0b){return _0x49ec5c[_0xffb7('0xa')](_0xffb7('0xb'),attributes,{'tableName':_0xffb7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 55b7095..737e38f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eed=['error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x2eed,0x7b));var _0xd2ee=function(_0x55384f,_0x4d9e4f){_0x55384f=_0x55384f-0x0;var _0x50106e=_0x2eed[_0x55384f];return _0x50106e;};'use strict';var _=require(_0xd2ee('0x0'));var util=require(_0xd2ee('0x1'));var moment=require(_0xd2ee('0x2'));var BPromise=require(_0xd2ee('0x3'));var rs=require(_0xd2ee('0x4'));var fs=require('fs');var Redis=require(_0xd2ee('0x5'));var db=require(_0xd2ee('0x6'))['db'];var utils=require(_0xd2ee('0x7'));var logger=require(_0xd2ee('0x8'))('rpc');var config=require(_0xd2ee('0x9'));var jayson=require(_0xd2ee('0xa'));var client=jayson[_0xd2ee('0xb')][_0xd2ee('0xc')]({'port':0x232a});config[_0xd2ee('0xd')]=_[_0xd2ee('0xe')](config[_0xd2ee('0xd')],{'host':_0xd2ee('0xf'),'port':0x18eb});var socket=require(_0xd2ee('0x10'))(new Redis(config['redis']));require(_0xd2ee('0x11'))[_0xd2ee('0x12')](socket);function respondWithRpcPromise(_0x3840c7,_0x46786f,_0x2f0538){return new BPromise(function(_0x19e2e0,_0x52059e){return client['request'](_0x3840c7,_0x2f0538)[_0xd2ee('0x13')](function(_0x478919){logger[_0xd2ee('0x14')](_0xd2ee('0x15'),_0x46786f,'request\x20sent');logger[_0xd2ee('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x46786f,_0xd2ee('0x17'),JSON[_0xd2ee('0x18')](_0x478919));if(_0x478919[_0xd2ee('0x19')]){if(_0x478919[_0xd2ee('0x19')][_0xd2ee('0x1a')]===0x1f4){logger[_0xd2ee('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x46786f,_0x478919[_0xd2ee('0x19')][_0xd2ee('0x1b')]);return _0x52059e(_0x478919['error']['message']);}logger[_0xd2ee('0x19')](_0xd2ee('0x15'),_0x46786f,_0x478919[_0xd2ee('0x19')][_0xd2ee('0x1b')]);return _0x19e2e0(_0x478919[_0xd2ee('0x19')][_0xd2ee('0x1b')]);}else{logger['info'](_0xd2ee('0x15'),_0x46786f,_0xd2ee('0x17'));_0x19e2e0(_0x478919['result'][_0xd2ee('0x1b')]);}})[_0xd2ee('0x1c')](function(_0x2da272){logger['error'](_0xd2ee('0x15'),_0x46786f,_0x2da272);_0x52059e(_0x2da272);});});}exports[_0xd2ee('0x1d')]=function(_0x1dc670){var _0x30cfb5=this;return new Promise(function(_0x160980,_0xc00339){return db[_0xd2ee('0x1e')]['findAll']({'raw':_0x1dc670[_0xd2ee('0x1f')]?_0x1dc670[_0xd2ee('0x1f')][_0xd2ee('0x20')]===undefined?!![]:![]:!![],'where':_0x1dc670[_0xd2ee('0x1f')]?_0x1dc670[_0xd2ee('0x1f')][_0xd2ee('0x21')]||null:null,'attributes':[[db[_0xd2ee('0x22')]['fn'](_0xd2ee('0x23'),db['sequelize']['fn']('IF',db[_0xd2ee('0x22')][_0xd2ee('0x24')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xd2ee('0x13')](function(_0x2a4138){logger[_0xd2ee('0x14')]('GetVoiceQueueRtPauses',_0x1dc670);logger[_0xd2ee('0x16')]('GetVoiceQueueRtPauses',_0x1dc670,JSON['stringify'](_0x2a4138));_0x160980(_0x2a4138);})[_0xd2ee('0x1c')](function(_0x245047){logger[_0xd2ee('0x19')](_0xd2ee('0x1d'),_0x245047[_0xd2ee('0x1b')],_0x1dc670);_0xc00339(_0x30cfb5[_0xd2ee('0x19')](0x1f4,_0x245047[_0xd2ee('0x1b')]));});});};
\ No newline at end of file
+var _0x1727=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','moment'];(function(_0x24d7fb,_0x387210){var _0x657015=function(_0x1a7f5b){while(--_0x1a7f5b){_0x24d7fb['push'](_0x24d7fb['shift']());}};_0x657015(++_0x387210);}(_0x1727,0x124));var _0x7172=function(_0x34075f,_0x23082a){_0x34075f=_0x34075f-0x0;var _0x33a011=_0x1727[_0x34075f];return _0x33a011;};'use strict';var _=require('lodash');var util=require(_0x7172('0x0'));var moment=require(_0x7172('0x1'));var BPromise=require(_0x7172('0x2'));var rs=require(_0x7172('0x3'));var fs=require('fs');var Redis=require(_0x7172('0x4'));var db=require(_0x7172('0x5'))['db'];var utils=require(_0x7172('0x6'));var logger=require('../../config/logger')(_0x7172('0x7'));var config=require(_0x7172('0x8'));var jayson=require(_0x7172('0x9'));var client=jayson[_0x7172('0xa')][_0x7172('0xb')]({'port':0x232a});config[_0x7172('0xc')]=_[_0x7172('0xd')](config['redis'],{'host':_0x7172('0xe'),'port':0x18eb});var socket=require(_0x7172('0xf'))(new Redis(config[_0x7172('0xc')]));require(_0x7172('0x10'))[_0x7172('0x11')](socket);function respondWithRpcPromise(_0x8c3397,_0xdfe35c,_0x60b257){return new BPromise(function(_0x3827c9,_0x31ef33){return client[_0x7172('0x12')](_0x8c3397,_0x60b257)[_0x7172('0x13')](function(_0x85ed65){logger[_0x7172('0x14')](_0x7172('0x15'),_0xdfe35c,_0x7172('0x16'));logger[_0x7172('0x17')](_0x7172('0x18'),_0xdfe35c,_0x7172('0x16'),JSON[_0x7172('0x19')](_0x85ed65));if(_0x85ed65[_0x7172('0x1a')]){if(_0x85ed65['error'][_0x7172('0x1b')]===0x1f4){logger[_0x7172('0x1a')](_0x7172('0x15'),_0xdfe35c,_0x85ed65[_0x7172('0x1a')][_0x7172('0x1c')]);return _0x31ef33(_0x85ed65['error']['message']);}logger[_0x7172('0x1a')](_0x7172('0x15'),_0xdfe35c,_0x85ed65[_0x7172('0x1a')][_0x7172('0x1c')]);return _0x3827c9(_0x85ed65['error'][_0x7172('0x1c')]);}else{logger['info'](_0x7172('0x15'),_0xdfe35c,'request\x20sent');_0x3827c9(_0x85ed65[_0x7172('0x1d')][_0x7172('0x1c')]);}})[_0x7172('0x1e')](function(_0x3c3543){logger[_0x7172('0x1a')](_0x7172('0x15'),_0xdfe35c,_0x3c3543);_0x31ef33(_0x3c3543);});});}exports[_0x7172('0x1f')]=function(_0x54df98){var _0x3254cd=this;return new Promise(function(_0x2e3def,_0x22ebab){return db[_0x7172('0x20')][_0x7172('0x21')]({'raw':_0x54df98['options']?_0x54df98[_0x7172('0x22')][_0x7172('0x23')]===undefined?!![]:![]:!![],'where':_0x54df98[_0x7172('0x22')]?_0x54df98[_0x7172('0x22')][_0x7172('0x24')]||null:null,'attributes':[[db[_0x7172('0x25')]['fn'](_0x7172('0x26'),db['sequelize']['fn']('IF',db[_0x7172('0x25')][_0x7172('0x27')](_0x7172('0x28')))),_0x7172('0x29')]]})['then'](function(_0x374d7c){logger[_0x7172('0x14')](_0x7172('0x1f'),_0x54df98);logger[_0x7172('0x17')](_0x7172('0x1f'),_0x54df98,JSON[_0x7172('0x19')](_0x374d7c));_0x2e3def(_0x374d7c);})['catch'](function(_0x273455){logger[_0x7172('0x1a')](_0x7172('0x1f'),_0x273455['message'],_0x54df98);_0x22ebab(_0x3254cd[_0x7172('0x1a')](0x1f4,_0x273455[_0x7172('0x1c')]));});});};
\ No newline at end of file
index 228656a..1fd9c91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x029b=['emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update'];(function(_0x1adbc0,_0x5b8530){var _0x4fc45e=function(_0x190790){while(--_0x190790){_0x1adbc0['push'](_0x1adbc0['shift']());}};_0x4fc45e(++_0x5b8530);}(_0x029b,0x66));var _0xb029=function(_0x32e25b,_0x244711){_0x32e25b=_0x32e25b-0x0;var _0x248764=_0x029b[_0x32e25b];return _0x248764;};'use strict';var UserVoiceQueueRtEvents=require(_0xb029('0x0'));var events=[_0xb029('0x1'),'remove',_0xb029('0x2')];function createListener(_0x2e71f6,_0x4e6bbd){return function(_0x41cdc7){_0x4e6bbd[_0xb029('0x3')](_0x2e71f6,_0x41cdc7);};}function removeListener(_0x5933af,_0x58cdef){return function(){UserVoiceQueueRtEvents[_0xb029('0x4')](_0x5933af,_0x58cdef);};}exports[_0xb029('0x5')]=function(_0x7836f0){for(var _0x448fc5=0x0,_0x15871f=events['length'];_0x448fc5<_0x15871f;_0x448fc5++){var _0x38e856=events[_0x448fc5];var _0x48b3d0=createListener(_0xb029('0x6')+_0x38e856,_0x7836f0);UserVoiceQueueRtEvents['on'](_0x38e856,_0x48b3d0);}};
\ No newline at end of file
+var _0xac4f=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','emit','removeListener'];(function(_0x33d1bc,_0x53dd34){var _0xac2330=function(_0x3fc8ce){while(--_0x3fc8ce){_0x33d1bc['push'](_0x33d1bc['shift']());}};_0xac2330(++_0x53dd34);}(_0xac4f,0x122));var _0xfac4=function(_0x5497d3,_0x193adf){_0x5497d3=_0x5497d3-0x0;var _0x42f1ef=_0xac4f[_0x5497d3];return _0x42f1ef;};'use strict';var UserVoiceQueueRtEvents=require(_0xfac4('0x0'));var events=['save',_0xfac4('0x1'),'update'];function createListener(_0x26a9cf,_0x47b474){return function(_0x5c32a3){_0x47b474[_0xfac4('0x2')](_0x26a9cf,_0x5c32a3);};}function removeListener(_0x37c6ba,_0x58060d){return function(){UserVoiceQueueRtEvents[_0xfac4('0x3')](_0x37c6ba,_0x58060d);};}exports[_0xfac4('0x4')]=function(_0x1aae1c){for(var _0x48f014=0x0,_0x342b8c=events[_0xfac4('0x5')];_0x48f014<_0x342b8c;_0x48f014++){var _0xdd64ea=events[_0x48f014];var _0x2ad59f=createListener(_0xfac4('0x6')+_0xdd64ea,_0x1aae1c);UserVoiceQueueRtEvents['on'](_0xdd64ea,_0x2ad59f);}};
\ No newline at end of file
index 8b5661c..adac753 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(_0x264f48,_0x2c82d8){var _0xb99167=function(_0x4a6be7){while(--_0x4a6be7){_0x264f48['push'](_0x264f48['shift']());}};_0xb99167(++_0x2c82d8);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5cabfd,_0x5dea47){var _0x4bc06c=function(_0x4a2fea){while(--_0x4a2fea){_0x5cabfd['push'](_0x5cabfd['shift']());}};_0x4bc06c(++_0x5dea47);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'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 234fff5..fe516e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e1=['sequelize','INTEGER'];(function(_0x1268db,_0x4163b7){var _0x48a55d=function(_0x3c23eb){while(--_0x3c23eb){_0x1268db['push'](_0x1268db['shift']());}};_0x48a55d(++_0x4163b7);}(_0x25e1,0x146));var _0x125e=function(_0x2ddd9d,_0x3eef84){_0x2ddd9d=_0x2ddd9d-0x0;var _0x2fb5fa=_0x25e1[_0x2ddd9d];return _0x2fb5fa;};'use strict';var Sequelize=require(_0x125e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x125e('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x220b=['INTEGER','exports'];(function(_0x8475c9,_0x12cbc4){var _0x31d6ae=function(_0x4fb857){while(--_0x4fb857){_0x8475c9['push'](_0x8475c9['shift']());}};_0x31d6ae(++_0x12cbc4);}(_0x220b,0x1b7));var _0xb220=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x220b[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require('sequelize');module[_0xb220('0x0')]={'penalty':{'type':Sequelize[_0xb220('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index e3414b0..7ae17d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x735c=['UserWhatsappQueue','user_has_whatsapp_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define'];(function(_0x1fb4a0,_0x48a602){var _0x1094e7=function(_0x25fcd5){while(--_0x25fcd5){_0x1fb4a0['push'](_0x1fb4a0['shift']());}};_0x1094e7(++_0x48a602);}(_0x735c,0xf2));var _0xc735=function(_0x4f6172,_0x5daca2){_0x4f6172=_0x4f6172-0x0;var _0x1252c1=_0x735c[_0x4f6172];return _0x1252c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc735('0x0'))(_0xc735('0x1'));var moment=require(_0xc735('0x2'));var BPromise=require(_0xc735('0x3'));var rp=require(_0xc735('0x4'));var fs=require('fs');var path=require(_0xc735('0x5'));var rimraf=require(_0xc735('0x6'));var config=require('../../config/environment');var attributes=require(_0xc735('0x7'));module[_0xc735('0x8')]=function(_0x25db41,_0x478704){return _0x25db41[_0xc735('0x9')](_0xc735('0xa'),attributes,{'tableName':_0xc735('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf9d0=['path','rimraf','./userWhatsappQueue.attributes','exports','util','../../config/logger','api','bluebird','request-promise'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0xf9d0,0x9d));var _0x0f9d=function(_0x67053a,_0x53ea36){_0x67053a=_0x67053a-0x0;var _0x59e4fd=_0xf9d0[_0x67053a];return _0x59e4fd;};'use strict';var _=require('lodash');var util=require(_0x0f9d('0x0'));var logger=require(_0x0f9d('0x1'))(_0x0f9d('0x2'));var moment=require('moment');var BPromise=require(_0x0f9d('0x3'));var rp=require(_0x0f9d('0x4'));var fs=require('fs');var path=require(_0x0f9d('0x5'));var rimraf=require(_0x0f9d('0x6'));var config=require('../../config/environment');var attributes=require(_0x0f9d('0x7'));module[_0x0f9d('0x8')]=function(_0x7dd5fc,_0x335eb8){return _0x7dd5fc['define']('UserWhatsappQueue',attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 64e3136..0a300c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf589=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UserWhatsappQueue,\x20%s,\x20%s','lodash','util'];(function(_0x3d2774,_0x5033ac){var _0x1fe347=function(_0x4d443c){while(--_0x4d443c){_0x3d2774['push'](_0x3d2774['shift']());}};_0x1fe347(++_0x5033ac);}(_0xf589,0x178));var _0x9f58=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf589[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x9f58('0x0'));var util=require(_0x9f58('0x1'));var moment=require('moment');var BPromise=require(_0x9f58('0x2'));var rs=require(_0x9f58('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f58('0x4'))['db'];var utils=require(_0x9f58('0x5'));var logger=require(_0x9f58('0x6'))(_0x9f58('0x7'));var config=require(_0x9f58('0x8'));var jayson=require(_0x9f58('0x9'));var client=jayson['client'][_0x9f58('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22c983,_0x14bd9c,_0x2e997a){return new BPromise(function(_0x28cb92,_0x545013){return client['request'](_0x22c983,_0x2e997a)['then'](function(_0x37bd17){logger[_0x9f58('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x14bd9c,_0x9f58('0xc'));logger[_0x9f58('0xd')](_0x9f58('0xe'),_0x14bd9c,'request\x20sent',JSON[_0x9f58('0xf')](_0x37bd17));if(_0x37bd17['error']){if(_0x37bd17['error']['code']===0x1f4){logger[_0x9f58('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x14bd9c,_0x37bd17[_0x9f58('0x10')][_0x9f58('0x11')]);return _0x545013(_0x37bd17[_0x9f58('0x10')][_0x9f58('0x11')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x14bd9c,_0x37bd17[_0x9f58('0x10')][_0x9f58('0x11')]);return _0x28cb92(_0x37bd17['error'][_0x9f58('0x11')]);}else{logger[_0x9f58('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x14bd9c,_0x9f58('0xc'));_0x28cb92(_0x37bd17[_0x9f58('0x12')][_0x9f58('0x11')]);}})[_0x9f58('0x13')](function(_0x1d2d5c){logger[_0x9f58('0x10')](_0x9f58('0x14'),_0x14bd9c,_0x1d2d5c);_0x545013(_0x1d2d5c);});});}
\ No newline at end of file
+var _0xc778=['then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserWhatsappQueue,\x20%s,\x20%s','catch','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0xb0abb8,_0x270ab1){var _0x110ec9=function(_0x32d827){while(--_0x32d827){_0xb0abb8['push'](_0xb0abb8['shift']());}};_0x110ec9(++_0x270ab1);}(_0xc778,0x1eb));var _0x8c77=function(_0x141f92,_0x883839){_0x141f92=_0x141f92-0x0;var _0x1fa27d=_0xc778[_0x141f92];return _0x1fa27d;};'use strict';var _=require('lodash');var util=require(_0x8c77('0x0'));var moment=require('moment');var BPromise=require(_0x8c77('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8c77('0x2'));var logger=require(_0x8c77('0x3'))(_0x8c77('0x4'));var config=require(_0x8c77('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8c77('0x6')][_0x8c77('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x27dc1d,_0x38c67e,_0x2b3348){return new BPromise(function(_0x48b312,_0x2a4ce8){return client[_0x8c77('0x8')](_0x27dc1d,_0x2b3348)[_0x8c77('0x9')](function(_0x5619c4){logger[_0x8c77('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x38c67e,_0x8c77('0xb'));logger[_0x8c77('0xc')](_0x8c77('0xd'),_0x38c67e,_0x8c77('0xb'),JSON[_0x8c77('0xe')](_0x5619c4));if(_0x5619c4['error']){if(_0x5619c4[_0x8c77('0xf')][_0x8c77('0x10')]===0x1f4){logger[_0x8c77('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x38c67e,_0x5619c4[_0x8c77('0xf')][_0x8c77('0x11')]);return _0x2a4ce8(_0x5619c4[_0x8c77('0xf')][_0x8c77('0x11')]);}logger['error'](_0x8c77('0x12'),_0x38c67e,_0x5619c4[_0x8c77('0xf')][_0x8c77('0x11')]);return _0x48b312(_0x5619c4[_0x8c77('0xf')][_0x8c77('0x11')]);}else{logger[_0x8c77('0xa')](_0x8c77('0x12'),_0x38c67e,_0x8c77('0xb'));_0x48b312(_0x5619c4['result'][_0x8c77('0x11')]);}})[_0x8c77('0x13')](function(_0x1dc2fd){logger[_0x8c77('0xf')](_0x8c77('0x12'),_0x38c67e,_0x1dc2fd);_0x2a4ce8(_0x1dc2fd);});});}
\ No newline at end of file
index 064bdc9..567f993 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e6=['put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','show','create'];(function(_0x55a86c,_0x162c7c){var _0x46cd68=function(_0x3ad0b6){while(--_0x3ad0b6){_0x55a86c['push'](_0x55a86c['shift']());}};_0x46cd68(++_0x162c7c);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0xb4e6[_0x54c9dd];return _0x855156;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var fs_extra=require(_0x6b4e('0x5'));var auth=require(_0x6b4e('0x6'));var interaction=require(_0x6b4e('0x7'));var config=require('../../config/environment');var controller=require(_0x6b4e('0x8'));router[_0x6b4e('0x9')]('/',auth[_0x6b4e('0xa')](),controller['index']);router[_0x6b4e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b4e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0xd')](_0x6b4e('0xe'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xf')]);router[_0x6b4e('0x10')](_0x6b4e('0xe'),auth['isAuthenticated'](),controller[_0x6b4e('0x11')]);module[_0x6b4e('0x12')]=router;
\ No newline at end of file
+var _0x1cc7=['exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','post','create','put','destroy'];(function(_0x3d67e6,_0x1563f2){var _0x1f3adf=function(_0x1b8200){while(--_0x1b8200){_0x3d67e6['push'](_0x3d67e6['shift']());}};_0x1f3adf(++_0x1563f2);}(_0x1cc7,0x15a));var _0x71cc=function(_0x5336f6,_0x5ef817){_0x5336f6=_0x5336f6-0x0;var _0x511f53=_0x1cc7[_0x5336f6];return _0x511f53;};'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('./variable.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),auth[_0x71cc('0x6')](),controller[_0x71cc('0x9')]);router[_0x71cc('0xa')]('/',auth['isAuthenticated'](),controller[_0x71cc('0xb')]);router[_0x71cc('0xc')](_0x71cc('0x8'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x71cc('0x6')](),controller[_0x71cc('0xd')]);module[_0x71cc('0xe')]=router;
\ No newline at end of file
index a9d41db..042f61c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61b5=['name','STRING','sequelize','exports'];(function(_0x1fd10b,_0x438e45){var _0x9e2b0c=function(_0x17c821){while(--_0x17c821){_0x1fd10b['push'](_0x1fd10b['shift']());}};_0x9e2b0c(++_0x438e45);}(_0x61b5,0x1ca));var _0x561b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x61b5[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x561b('0x0'));module[_0x561b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x561b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x561b('0x3')]}};
\ No newline at end of file
+var _0x6f36=['STRING','name','exports'];(function(_0x368726,_0x4a651d){var _0x3fc2e7=function(_0x484a0b){while(--_0x484a0b){_0x368726['push'](_0x368726['shift']());}};_0x3fc2e7(++_0x4a651d);}(_0x6f36,0x149));var _0x66f3=function(_0x5a1e02,_0x528b29){_0x5a1e02=_0x5a1e02-0x0;var _0x453332=_0x6f36[_0x5a1e02];return _0x453332;};'use strict';var Sequelize=require('sequelize');module[_0x66f3('0x0')]={'name':{'type':Sequelize[_0x66f3('0x1')],'unique':_0x66f3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x66f3('0x1')]}};
\ No newline at end of file
index 04c22bd..b9e586f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc159=['options','where','includeAll','include','findAll','rows','catch','Variable','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','update','params','eml-format','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','set','Content-Range','apply','save','then','get','Variables','UserProfileResource','destroy','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge'];(function(_0x397e6d,_0x134d97){var _0x177b16=function(_0x44417a){while(--_0x44417a){_0x397e6d['push'](_0x397e6d['shift']());}};_0x177b16(++_0x134d97);}(_0xc159,0x160));var _0x9c15=function(_0x10244a,_0x3e96f4){_0x10244a=_0x10244a-0x0;var _0x4daacd=_0xc159[_0x10244a];return _0x4daacd;};'use strict';var emlformat=require(_0x9c15('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9c15('0x1'));var moment=require(_0x9c15('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9c15('0x3'));var path=require(_0x9c15('0x4'));var sox=require(_0x9c15('0x5'));var csv=require(_0x9c15('0x6'));var ejs=require(_0x9c15('0x7'));var fs=require('fs');var fs_extra=require(_0x9c15('0x8'));var _=require(_0x9c15('0x9'));var squel=require(_0x9c15('0xa'));var crypto=require('crypto');var jsforce=require(_0x9c15('0xb'));var deskjs=require(_0x9c15('0xc'));var toCsv=require(_0x9c15('0x6'));var querystring=require(_0x9c15('0xd'));var Papa=require(_0x9c15('0xe'));var Redis=require(_0x9c15('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9c15('0x10'));var as=require(_0x9c15('0x11'));var hardwareService=require(_0x9c15('0x12'));var logger=require(_0x9c15('0x13'))(_0x9c15('0x14'));var utils=require(_0x9c15('0x15'));var config=require(_0x9c15('0x16'));var licenseUtil=require(_0x9c15('0x17'));var db=require(_0x9c15('0x18'))['db'];function respondWithStatusCode(_0x1f1ba4,_0x17e114){_0x17e114=_0x17e114||0xcc;return function(_0x247c25){if(_0x247c25){return _0x1f1ba4[_0x9c15('0x19')](_0x17e114);}return _0x1f1ba4[_0x9c15('0x1a')](_0x17e114)[_0x9c15('0x1b')]();};}function respondWithResult(_0x15f049,_0x372fe2){_0x372fe2=_0x372fe2||0xc8;return function(_0x54f065){if(_0x54f065){return _0x15f049['status'](_0x372fe2)[_0x9c15('0x1c')](_0x54f065);}};}function respondWithFilteredResult(_0x234f43,_0x386b22){return function(_0x183401){if(_0x183401){var _0x50af06=typeof _0x386b22['offset']==='undefined'&&typeof _0x386b22[_0x9c15('0x1d')]==='undefined';var _0x16a014=_0x183401[_0x9c15('0x1e')];var _0x4803e6=_0x50af06?0x0:_0x386b22['offset'];var _0x2ccfc8=_0x50af06?_0x183401[_0x9c15('0x1e')]:_0x386b22['offset']+_0x386b22[_0x9c15('0x1d')];var _0x2352cd;if(_0x2ccfc8>=_0x16a014){_0x2ccfc8=_0x16a014;_0x2352cd=0xc8;}else{_0x2352cd=0xce;}_0x234f43['status'](_0x2352cd);return _0x234f43[_0x9c15('0x1f')](_0x9c15('0x20'),_0x4803e6+'-'+_0x2ccfc8+'/'+_0x16a014)['json'](_0x183401);}return null;};}function patchUpdates(_0x43ab8b){return function(_0x341757){try{jsonpatch[_0x9c15('0x21')](_0x341757,_0x43ab8b,!![]);}catch(_0x38a154){return BPromise['reject'](_0x38a154);}return _0x341757[_0x9c15('0x22')]();};}function saveUpdates(_0x563882,_0x44779a){return function(_0x299188){if(_0x299188){return _0x299188['update'](_0x563882)[_0x9c15('0x23')](function(_0x464d0d){return _0x464d0d;});}return null;};}function removeEntity(_0x53ea07,_0x3d1c6b){return function(_0x5393ca){if(_0x5393ca){return _0x5393ca['destroy']()['then'](function(){var _0x5834b2=_0x5393ca[_0x9c15('0x24')]({'plain':!![]});var _0x42c6d2=_0x9c15('0x25');return db[_0x9c15('0x26')][_0x9c15('0x27')]({'where':{'type':_0x42c6d2,'resourceId':_0x5834b2['id']}})['then'](function(){return _0x5393ca;});})[_0x9c15('0x23')](function(){_0x53ea07['status'](0xcc)[_0x9c15('0x1b')]();});}};}function handleEntityNotFound(_0x1ccd7b,_0x56d259){return function(_0x6d0336){if(!_0x6d0336){_0x1ccd7b[_0x9c15('0x19')](0x194);}return _0x6d0336;};}function handleError(_0x23595c,_0x2912da){_0x2912da=_0x2912da||0x1f4;return function(_0x5c74ef){logger['error'](_0x5c74ef[_0x9c15('0x28')]);if(_0x5c74ef[_0x9c15('0x29')]){delete _0x5c74ef[_0x9c15('0x29')];}_0x23595c[_0x9c15('0x1a')](_0x2912da)[_0x9c15('0x2a')](_0x5c74ef);};}exports['index']=function(_0x81459c,_0x1c7017){var _0x11aa87={},_0x3438cf={},_0xa614ef={'count':0x0,'rows':[]};var _0x1f0fac=_['map'](db['Variable'][_0x9c15('0x2b')],function(_0x58bcae){return{'name':_0x58bcae[_0x9c15('0x2c')],'type':_0x58bcae['type'][_0x9c15('0x2d')]};});_0x3438cf[_0x9c15('0x2e')]=_[_0x9c15('0x2f')](_0x1f0fac,_0x9c15('0x29'));_0x3438cf[_0x9c15('0x30')]=_[_0x9c15('0x31')](_0x81459c[_0x9c15('0x30')]);_0x3438cf[_0x9c15('0x32')]=_[_0x9c15('0x33')](_0x3438cf[_0x9c15('0x2e')],_0x3438cf[_0x9c15('0x30')]);_0x11aa87['attributes']=_['intersection'](_0x3438cf[_0x9c15('0x2e')],qs[_0x9c15('0x34')](_0x81459c[_0x9c15('0x30')][_0x9c15('0x34')]));_0x11aa87[_0x9c15('0x35')]=_0x11aa87['attributes'][_0x9c15('0x36')]?_0x11aa87[_0x9c15('0x35')]:_0x3438cf[_0x9c15('0x2e')];if(!_0x81459c['query'][_0x9c15('0x37')](_0x9c15('0x38'))){_0x11aa87[_0x9c15('0x1d')]=qs[_0x9c15('0x1d')](_0x81459c[_0x9c15('0x30')][_0x9c15('0x1d')]);_0x11aa87[_0x9c15('0x39')]=qs[_0x9c15('0x39')](_0x81459c['query'][_0x9c15('0x39')]);}_0x11aa87[_0x9c15('0x3a')]=qs['sort'](_0x81459c[_0x9c15('0x30')][_0x9c15('0x3b')]);_0x11aa87['where']=qs['filters'](_[_0x9c15('0x3c')](_0x81459c['query'],_0x3438cf[_0x9c15('0x32')]),_0x1f0fac);if(_0x81459c[_0x9c15('0x30')][_0x9c15('0x3d')]){_0x11aa87['where']=_[_0x9c15('0x3e')](_0x11aa87['where'],{'$or':_[_0x9c15('0x2f')](_0x1f0fac,function(_0x4224d1){if(_0x4224d1['type']!=='VIRTUAL'){var _0x59856c={};_0x59856c[_0x4224d1['name']]={'$like':'%'+_0x81459c['query'][_0x9c15('0x3d')]+'%'};return _0x59856c;}})});}_0x11aa87=_[_0x9c15('0x3e')]({},_0x11aa87,_0x81459c[_0x9c15('0x3f')]);var _0x5940fc={'where':_0x11aa87[_0x9c15('0x40')]};return db['Variable'][_0x9c15('0x1e')](_0x5940fc)[_0x9c15('0x23')](function(_0x266119){_0xa614ef[_0x9c15('0x1e')]=_0x266119;if(_0x81459c[_0x9c15('0x30')][_0x9c15('0x41')]){_0x11aa87[_0x9c15('0x42')]=[{'all':!![]}];}return db['Variable'][_0x9c15('0x43')](_0x11aa87);})[_0x9c15('0x23')](function(_0xedb167){_0xa614ef[_0x9c15('0x44')]=_0xedb167;return _0xa614ef;})['then'](respondWithFilteredResult(_0x1c7017,_0x11aa87))[_0x9c15('0x45')](handleError(_0x1c7017,null));};exports['show']=function(_0x45d367,_0x13822b){var _0x286292={'raw':!![],'where':{'id':_0x45d367['params']['id']}},_0x369bf8={};_0x369bf8[_0x9c15('0x2e')]=_['keys'](db[_0x9c15('0x46')]['rawAttributes']);_0x369bf8[_0x9c15('0x30')]=_['keys'](_0x45d367[_0x9c15('0x30')]);_0x369bf8[_0x9c15('0x32')]=_[_0x9c15('0x33')](_0x369bf8['model'],_0x369bf8[_0x9c15('0x30')]);_0x286292[_0x9c15('0x35')]=_[_0x9c15('0x33')](_0x369bf8[_0x9c15('0x2e')],qs[_0x9c15('0x34')](_0x45d367[_0x9c15('0x30')][_0x9c15('0x34')]));_0x286292[_0x9c15('0x35')]=_0x286292[_0x9c15('0x35')][_0x9c15('0x36')]?_0x286292[_0x9c15('0x35')]:_0x369bf8[_0x9c15('0x2e')];if(_0x45d367[_0x9c15('0x30')][_0x9c15('0x41')]){_0x286292[_0x9c15('0x42')]=[{'all':!![]}];}_0x286292=_[_0x9c15('0x3e')]({},_0x286292,_0x45d367['options']);return db[_0x9c15('0x46')][_0x9c15('0x47')](_0x286292)['then'](handleEntityNotFound(_0x13822b,null))[_0x9c15('0x23')](respondWithResult(_0x13822b,null))[_0x9c15('0x45')](handleError(_0x13822b,null));};exports[_0x9c15('0x48')]=function(_0x492776,_0x4c4764){return db[_0x9c15('0x46')][_0x9c15('0x48')](_0x492776[_0x9c15('0x49')],{})[_0x9c15('0x23')](function(_0x1a26f5){var _0x5604b4=_0x492776[_0x9c15('0x4a')][_0x9c15('0x24')]({'plain':!![]});if(!_0x5604b4)throw new Error(_0x9c15('0x4b'));if(_0x5604b4[_0x9c15('0x4c')]==='user'){var _0x20bff5=_0x1a26f5['get']({'plain':!![]});var _0x10e6e2=_0x9c15('0x25');return db[_0x9c15('0x4d')][_0x9c15('0x47')]({'where':{'name':_0x10e6e2,'userProfileId':_0x5604b4[_0x9c15('0x4e')]},'raw':!![]})[_0x9c15('0x23')](function(_0x56a260){if(_0x56a260&&_0x56a260[_0x9c15('0x4f')]===0x0){return db['UserProfileResource'][_0x9c15('0x48')]({'name':_0x20bff5['name'],'resourceId':_0x20bff5['id'],'type':_0x56a260[_0x9c15('0x29')],'sectionId':_0x56a260['id']},{})[_0x9c15('0x23')](function(){return _0x1a26f5;});}else{return _0x1a26f5;}})[_0x9c15('0x45')](function(_0x35ae0a){logger[_0x9c15('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35ae0a);throw _0x35ae0a;});}return _0x1a26f5;})[_0x9c15('0x23')](respondWithResult(_0x4c4764,0xc9))[_0x9c15('0x45')](handleError(_0x4c4764,null));};exports[_0x9c15('0x51')]=function(_0x160d12,_0x5eccc7){if(_0x160d12[_0x9c15('0x49')]['id']){delete _0x160d12['body']['id'];}return db[_0x9c15('0x46')][_0x9c15('0x47')]({'where':{'id':_0x160d12[_0x9c15('0x52')]['id']}})['then'](handleEntityNotFound(_0x5eccc7,null))[_0x9c15('0x23')](saveUpdates(_0x160d12['body'],null))['then'](respondWithResult(_0x5eccc7,null))[_0x9c15('0x45')](handleError(_0x5eccc7,null));};exports[_0x9c15('0x27')]=function(_0x29c657,_0x3e4ace){return db[_0x9c15('0x46')]['find']({'where':{'id':_0x29c657[_0x9c15('0x52')]['id']}})[_0x9c15('0x23')](handleEntityNotFound(_0x3e4ace,null))[_0x9c15('0x23')](removeEntity(_0x3e4ace,null))['catch'](handleError(_0x3e4ace,null));};
\ No newline at end of file
+var _0x5c9e=['ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','name','send','index','map','Variable','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x5c9e,0x138));var _0xe5c9=function(_0x18e513,_0x5a6706){_0x18e513=_0x18e513-0x0;var _0x3961e3=_0x5c9e[_0x18e513];return _0x3961e3;};'use strict';var emlformat=require(_0xe5c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5c9('0x2'));var moment=require(_0xe5c9('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe5c9('0x4'));var path=require(_0xe5c9('0x5'));var sox=require(_0xe5c9('0x6'));var csv=require(_0xe5c9('0x7'));var ejs=require(_0xe5c9('0x8'));var fs=require('fs');var fs_extra=require(_0xe5c9('0x9'));var _=require(_0xe5c9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe5c9('0xb'));var toCsv=require(_0xe5c9('0x7'));var querystring=require(_0xe5c9('0xc'));var Papa=require(_0xe5c9('0xd'));var Redis=require(_0xe5c9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe5c9('0xf'));var as=require(_0xe5c9('0x10'));var hardwareService=require(_0xe5c9('0x11'));var logger=require('../../config/logger')(_0xe5c9('0x12'));var utils=require(_0xe5c9('0x13'));var config=require(_0xe5c9('0x14'));var licenseUtil=require(_0xe5c9('0x15'));var db=require(_0xe5c9('0x16'))['db'];function respondWithStatusCode(_0x41618f,_0x88fc0f){_0x88fc0f=_0x88fc0f||0xcc;return function(_0x252bb2){if(_0x252bb2){return _0x41618f[_0xe5c9('0x17')](_0x88fc0f);}return _0x41618f[_0xe5c9('0x18')](_0x88fc0f)[_0xe5c9('0x19')]();};}function respondWithResult(_0xb0d317,_0x3b86ff){_0x3b86ff=_0x3b86ff||0xc8;return function(_0x1666de){if(_0x1666de){return _0xb0d317[_0xe5c9('0x18')](_0x3b86ff)[_0xe5c9('0x1a')](_0x1666de);}};}function respondWithFilteredResult(_0x4d93e6,_0x44b04f){return function(_0x6c0fbd){if(_0x6c0fbd){var _0xfaf687=typeof _0x44b04f['offset']===_0xe5c9('0x1b')&&typeof _0x44b04f[_0xe5c9('0x1c')]===_0xe5c9('0x1b');var _0x3e845e=_0x6c0fbd[_0xe5c9('0x1d')];var _0x23775a=_0xfaf687?0x0:_0x44b04f[_0xe5c9('0x1e')];var _0x24549a=_0xfaf687?_0x6c0fbd[_0xe5c9('0x1d')]:_0x44b04f[_0xe5c9('0x1e')]+_0x44b04f[_0xe5c9('0x1c')];var _0x1d6bc1;if(_0x24549a>=_0x3e845e){_0x24549a=_0x3e845e;_0x1d6bc1=0xc8;}else{_0x1d6bc1=0xce;}_0x4d93e6['status'](_0x1d6bc1);return _0x4d93e6['set'](_0xe5c9('0x1f'),_0x23775a+'-'+_0x24549a+'/'+_0x3e845e)[_0xe5c9('0x1a')](_0x6c0fbd);}return null;};}function patchUpdates(_0x3d822a){return function(_0x58dc59){try{jsonpatch[_0xe5c9('0x20')](_0x58dc59,_0x3d822a,!![]);}catch(_0xa075c){return BPromise[_0xe5c9('0x21')](_0xa075c);}return _0x58dc59[_0xe5c9('0x22')]();};}function saveUpdates(_0x2ccc85,_0x338d0e){return function(_0x37d407){if(_0x37d407){return _0x37d407['update'](_0x2ccc85)[_0xe5c9('0x23')](function(_0x28fd4d){return _0x28fd4d;});}return null;};}function removeEntity(_0x2537ff,_0x481146){return function(_0x2e53e4){if(_0x2e53e4){return _0x2e53e4[_0xe5c9('0x24')]()[_0xe5c9('0x23')](function(){var _0x8f520f=_0x2e53e4[_0xe5c9('0x25')]({'plain':!![]});var _0x1d7506='Variables';return db[_0xe5c9('0x26')][_0xe5c9('0x24')]({'where':{'type':_0x1d7506,'resourceId':_0x8f520f['id']}})[_0xe5c9('0x23')](function(){return _0x2e53e4;});})[_0xe5c9('0x23')](function(){_0x2537ff['status'](0xcc)[_0xe5c9('0x19')]();});}};}function handleEntityNotFound(_0x111e0d,_0x3f596f){return function(_0x327427){if(!_0x327427){_0x111e0d[_0xe5c9('0x17')](0x194);}return _0x327427;};}function handleError(_0x1ee61c,_0x5c9d9b){_0x5c9d9b=_0x5c9d9b||0x1f4;return function(_0x1f32f5){logger[_0xe5c9('0x27')](_0x1f32f5['stack']);if(_0x1f32f5[_0xe5c9('0x28')]){delete _0x1f32f5[_0xe5c9('0x28')];}_0x1ee61c[_0xe5c9('0x18')](_0x5c9d9b)[_0xe5c9('0x29')](_0x1f32f5);};}exports[_0xe5c9('0x2a')]=function(_0x2bf577,_0x241c60){var _0x5767bd={},_0x2e48e4={},_0x3bca50={'count':0x0,'rows':[]};var _0x434415=_[_0xe5c9('0x2b')](db[_0xe5c9('0x2c')][_0xe5c9('0x2d')],function(_0x28bee2){return{'name':_0x28bee2[_0xe5c9('0x2e')],'type':_0x28bee2['type'][_0xe5c9('0x2f')]};});_0x2e48e4[_0xe5c9('0x30')]=_[_0xe5c9('0x2b')](_0x434415,_0xe5c9('0x28'));_0x2e48e4[_0xe5c9('0x31')]=_[_0xe5c9('0x32')](_0x2bf577[_0xe5c9('0x31')]);_0x2e48e4[_0xe5c9('0x33')]=_[_0xe5c9('0x34')](_0x2e48e4['model'],_0x2e48e4[_0xe5c9('0x31')]);_0x5767bd[_0xe5c9('0x35')]=_[_0xe5c9('0x34')](_0x2e48e4[_0xe5c9('0x30')],qs[_0xe5c9('0x36')](_0x2bf577[_0xe5c9('0x31')]['fields']));_0x5767bd[_0xe5c9('0x35')]=_0x5767bd[_0xe5c9('0x35')]['length']?_0x5767bd[_0xe5c9('0x35')]:_0x2e48e4[_0xe5c9('0x30')];if(!_0x2bf577[_0xe5c9('0x31')]['hasOwnProperty'](_0xe5c9('0x37'))){_0x5767bd[_0xe5c9('0x1c')]=qs[_0xe5c9('0x1c')](_0x2bf577[_0xe5c9('0x31')][_0xe5c9('0x1c')]);_0x5767bd[_0xe5c9('0x1e')]=qs[_0xe5c9('0x1e')](_0x2bf577[_0xe5c9('0x31')][_0xe5c9('0x1e')]);}_0x5767bd[_0xe5c9('0x38')]=qs[_0xe5c9('0x39')](_0x2bf577[_0xe5c9('0x31')][_0xe5c9('0x39')]);_0x5767bd['where']=qs[_0xe5c9('0x33')](_['pick'](_0x2bf577[_0xe5c9('0x31')],_0x2e48e4['filters']),_0x434415);if(_0x2bf577[_0xe5c9('0x31')][_0xe5c9('0x3a')]){_0x5767bd[_0xe5c9('0x3b')]=_[_0xe5c9('0x3c')](_0x5767bd[_0xe5c9('0x3b')],{'$or':_['map'](_0x434415,function(_0x196fec){if(_0x196fec['type']!==_0xe5c9('0x3d')){var _0xda80aa={};_0xda80aa[_0x196fec[_0xe5c9('0x28')]]={'$like':'%'+_0x2bf577[_0xe5c9('0x31')]['filter']+'%'};return _0xda80aa;}})});}_0x5767bd=_[_0xe5c9('0x3c')]({},_0x5767bd,_0x2bf577['options']);var _0x2ce770={'where':_0x5767bd[_0xe5c9('0x3b')]};return db['Variable'][_0xe5c9('0x1d')](_0x2ce770)[_0xe5c9('0x23')](function(_0x18a374){_0x3bca50[_0xe5c9('0x1d')]=_0x18a374;if(_0x2bf577[_0xe5c9('0x31')][_0xe5c9('0x3e')]){_0x5767bd[_0xe5c9('0x3f')]=[{'all':!![]}];}return db[_0xe5c9('0x2c')]['findAll'](_0x5767bd);})[_0xe5c9('0x23')](function(_0x2ed100){_0x3bca50[_0xe5c9('0x40')]=_0x2ed100;return _0x3bca50;})[_0xe5c9('0x23')](respondWithFilteredResult(_0x241c60,_0x5767bd))[_0xe5c9('0x41')](handleError(_0x241c60,null));};exports['show']=function(_0x600166,_0x190352){var _0x15b502={'raw':!![],'where':{'id':_0x600166['params']['id']}},_0x2c8c56={};_0x2c8c56['model']=_['keys'](db['Variable'][_0xe5c9('0x2d')]);_0x2c8c56['query']=_[_0xe5c9('0x32')](_0x600166['query']);_0x2c8c56[_0xe5c9('0x33')]=_[_0xe5c9('0x34')](_0x2c8c56[_0xe5c9('0x30')],_0x2c8c56[_0xe5c9('0x31')]);_0x15b502[_0xe5c9('0x35')]=_[_0xe5c9('0x34')](_0x2c8c56[_0xe5c9('0x30')],qs[_0xe5c9('0x36')](_0x600166['query'][_0xe5c9('0x36')]));_0x15b502[_0xe5c9('0x35')]=_0x15b502['attributes'][_0xe5c9('0x42')]?_0x15b502[_0xe5c9('0x35')]:_0x2c8c56[_0xe5c9('0x30')];if(_0x600166[_0xe5c9('0x31')][_0xe5c9('0x3e')]){_0x15b502[_0xe5c9('0x3f')]=[{'all':!![]}];}_0x15b502=_[_0xe5c9('0x3c')]({},_0x15b502,_0x600166[_0xe5c9('0x43')]);return db[_0xe5c9('0x2c')][_0xe5c9('0x44')](_0x15b502)[_0xe5c9('0x23')](handleEntityNotFound(_0x190352,null))['then'](respondWithResult(_0x190352,null))[_0xe5c9('0x41')](handleError(_0x190352,null));};exports[_0xe5c9('0x45')]=function(_0x2965ad,_0x4d79f4){return db[_0xe5c9('0x2c')][_0xe5c9('0x45')](_0x2965ad[_0xe5c9('0x46')],{})[_0xe5c9('0x23')](function(_0xde96bd){var _0x14cd23=_0x2965ad[_0xe5c9('0x47')][_0xe5c9('0x25')]({'plain':!![]});if(!_0x14cd23)throw new Error(_0xe5c9('0x48'));if(_0x14cd23[_0xe5c9('0x49')]==='user'){var _0x2f8a53=_0xde96bd[_0xe5c9('0x25')]({'plain':!![]});var _0x344260=_0xe5c9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x344260,'userProfileId':_0x14cd23[_0xe5c9('0x4b')]},'raw':!![]})[_0xe5c9('0x23')](function(_0x401c90){if(_0x401c90&&_0x401c90[_0xe5c9('0x4c')]===0x0){return db[_0xe5c9('0x26')][_0xe5c9('0x45')]({'name':_0x2f8a53[_0xe5c9('0x28')],'resourceId':_0x2f8a53['id'],'type':_0x401c90['name'],'sectionId':_0x401c90['id']},{})[_0xe5c9('0x23')](function(){return _0xde96bd;});}else{return _0xde96bd;}})[_0xe5c9('0x41')](function(_0x1e6efa){logger['error'](_0xe5c9('0x4d'),_0x1e6efa);throw _0x1e6efa;});}return _0xde96bd;})[_0xe5c9('0x23')](respondWithResult(_0x4d79f4,0xc9))['catch'](handleError(_0x4d79f4,null));};exports[_0xe5c9('0x4e')]=function(_0x358055,_0x42474a){if(_0x358055['body']['id']){delete _0x358055[_0xe5c9('0x46')]['id'];}return db[_0xe5c9('0x2c')]['find']({'where':{'id':_0x358055[_0xe5c9('0x4f')]['id']}})[_0xe5c9('0x23')](handleEntityNotFound(_0x42474a,null))['then'](saveUpdates(_0x358055[_0xe5c9('0x46')],null))['then'](respondWithResult(_0x42474a,null))[_0xe5c9('0x41')](handleError(_0x42474a,null));};exports[_0xe5c9('0x24')]=function(_0x137a51,_0xac4c3){return db[_0xe5c9('0x2c')]['find']({'where':{'id':_0x137a51[_0xe5c9('0x4f')]['id']}})[_0xe5c9('0x23')](handleEntityNotFound(_0xac4c3,null))[_0xe5c9('0x23')](removeEntity(_0xac4c3,null))['catch'](handleError(_0xac4c3,null));};
\ No newline at end of file
index d2cc1aa..a56d94d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6ed=['rimraf','./variable.attributes','exports','Variable','util','api','moment','bluebird'];(function(_0x410783,_0x43d8a7){var _0x2d546e=function(_0x403197){while(--_0x403197){_0x410783['push'](_0x410783['shift']());}};_0x2d546e(++_0x43d8a7);}(_0xb6ed,0xbc));var _0xdb6e=function(_0x21d7b6,_0x32eb92){_0x21d7b6=_0x21d7b6-0x0;var _0x51a0ac=_0xb6ed[_0x21d7b6];return _0x51a0ac;};'use strict';var _=require('lodash');var util=require(_0xdb6e('0x0'));var logger=require('../../config/logger')(_0xdb6e('0x1'));var moment=require(_0xdb6e('0x2'));var BPromise=require(_0xdb6e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdb6e('0x4'));var config=require('../../config/environment');var attributes=require(_0xdb6e('0x5'));module[_0xdb6e('0x6')]=function(_0x7e17e6,_0x3ff7d0){return _0x7e17e6['define'](_0xdb6e('0x7'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87ac=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x87ac,0x19f));var _0xc87a=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x87ac[_0x258fb0];return _0x4d1afe;};'use strict';var _=require('lodash');var util=require(_0xc87a('0x0'));var logger=require(_0xc87a('0x1'))(_0xc87a('0x2'));var moment=require(_0xc87a('0x3'));var BPromise=require(_0xc87a('0x4'));var rp=require(_0xc87a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc87a('0x6'));var config=require(_0xc87a('0x7'));var attributes=require(_0xc87a('0x8'));module[_0xc87a('0x9')]=function(_0x4df848,_0x29f7dc){return _0x4df848[_0xc87a('0xa')](_0xc87a('0xb'),attributes,{'tableName':_0xc87a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8663344..f07abc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x27d2d7,_0xb4641){var _0x2533a6=function(_0x11939e){while(--_0x11939e){_0x27d2d7['push'](_0x27d2d7['shift']());}};_0x2533a6(++_0xb4641);}(_0xabce,0x103));var _0xeabc=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xabce[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});};
\ No newline at end of file
+var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x4a30b7,_0x3dabc8){var _0xe48f3c=function(_0x391568){while(--_0x391568){_0x4a30b7['push'](_0x4a30b7['shift']());}};_0xe48f3c(++_0x3dabc8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x5fc3[_0x54d4a8];return _0x3b321b;};'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')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\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']('Variable,\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);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});};
\ No newline at end of file
index d8c9697..b391481 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d5e=['pull','/restart','restart','express','Router','./version.controller','get','canUpdate','fetch','/reset','isAuthenticated','reset','/pull'];(function(_0x394813,_0x3fcf6b){var _0x4606bd=function(_0x50c579){while(--_0x50c579){_0x394813['push'](_0x394813['shift']());}};_0x4606bd(++_0x3fcf6b);}(_0x1d5e,0x196));var _0xe1d5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1d5e[_0x42cae2];return _0x5f256f;};'use strict';var express=require(_0xe1d5('0x0'));var router=express[_0xe1d5('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xe1d5('0x2'));router[_0xe1d5('0x3')]('/',controller['index']);router[_0xe1d5('0x3')]('/fetch',auth['isAuthenticated'](),auth[_0xe1d5('0x4')](),controller[_0xe1d5('0x5')]);router[_0xe1d5('0x3')](_0xe1d5('0x6'),auth[_0xe1d5('0x7')](),auth[_0xe1d5('0x4')](),controller[_0xe1d5('0x8')]);router[_0xe1d5('0x3')](_0xe1d5('0x9'),auth[_0xe1d5('0x7')](),auth[_0xe1d5('0x4')](),controller[_0xe1d5('0xa')]);router[_0xe1d5('0x3')](_0xe1d5('0xb'),auth[_0xe1d5('0x7')](),controller[_0xe1d5('0xc')]);router[_0xe1d5('0x3')]('/migrations',controller['migrations']);module['exports']=router;
\ No newline at end of file
+var _0xa16e=['index','/fetch','canUpdate','fetch','/reset','isAuthenticated','reset','/pull','restart','migrations','exports','express','Router','../../components/auth/service','./version.controller','get'];(function(_0x3886ec,_0xf9cd38){var _0x56a14d=function(_0x4e994b){while(--_0x4e994b){_0x3886ec['push'](_0x3886ec['shift']());}};_0x56a14d(++_0xf9cd38);}(_0xa16e,0x13b));var _0xea16=function(_0x261d9e,_0x4f0942){_0x261d9e=_0x261d9e-0x0;var _0x3f8a2c=_0xa16e[_0x261d9e];return _0x3f8a2c;};'use strict';var express=require(_0xea16('0x0'));var router=express[_0xea16('0x1')]();var auth=require(_0xea16('0x2'));var controller=require(_0xea16('0x3'));router[_0xea16('0x4')]('/',controller[_0xea16('0x5')]);router[_0xea16('0x4')](_0xea16('0x6'),auth['isAuthenticated'](),auth[_0xea16('0x7')](),controller[_0xea16('0x8')]);router['get'](_0xea16('0x9'),auth[_0xea16('0xa')](),auth[_0xea16('0x7')](),controller[_0xea16('0xb')]);router[_0xea16('0x4')](_0xea16('0xc'),auth['isAuthenticated'](),auth['canUpdate'](),controller['pull']);router[_0xea16('0x4')]('/restart',auth[_0xea16('0xa')](),controller[_0xea16('0xd')]);router[_0xea16('0x4')]('/migrations',controller[_0xea16('0xe')]);module[_0xea16('0xf')]=router;
\ No newline at end of file
index ce996e7..ab0526e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b03=['pull','npm\x20install\x20--production','info','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','root','server','migrations','length','replace','push','sort','sequelize','Migration','getQueryInterface','constructor','join','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','index','exports','query','latest','tags','2.0.0','status','json','fetch','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x3b03,0x167));var _0x33b0=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x3b03[_0x2cfb58];return _0xd99951;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0x33b0('0x0'));var pkginfo=require(_0x33b0('0x1'))(module,_0x33b0('0x2'));var compareVersions=require(_0x33b0('0x3'));var exec=require(_0x33b0('0x4'))['exec'];var db=require(_0x33b0('0x5'))['db'];var config=require(_0x33b0('0x6'));var pm2=require(_0x33b0('0x7'));var logger=require('../../config/logger')(_0x33b0('0x8'));var git=require('simple-git')(config['root']);exports[_0x33b0('0x9')]=function(_0x52a669,_0x4e7538){var _0x333335={'current':module[_0x33b0('0xa')]['version'],'phonebar':0x2};if(_0x52a669[_0x33b0('0xb')]&&_0x52a669[_0x33b0('0xb')][_0x33b0('0xc')]){return git['fetch']()[_0x33b0('0xd')](function(_0x5a2237,_0x3d7289){_0x333335[_0x33b0('0xc')]=(_0x5a2237?module[_0x33b0('0xa')][_0x33b0('0x2')]:_0x3d7289[_0x33b0('0xc')])||_0x33b0('0xe');return _0x4e7538[_0x33b0('0xf')](0xc8)[_0x33b0('0x10')](_0x333335);});}else{return _0x4e7538[_0x33b0('0xf')](0xc8)[_0x33b0('0x10')](_0x333335);}};exports['fetch']=function(_0x23e1b6,_0x44c1f5){return git[_0x33b0('0x11')]([_0x33b0('0x12'),_0x33b0('0x13')],function(_0x2c5fe4){if(_0x2c5fe4){logger[_0x33b0('0x14')](_0x2c5fe4);return _0x44c1f5[_0x33b0('0xf')](0x1f4)[_0x33b0('0x10')](_0x2c5fe4);}logger['info'](_0x33b0('0x15'));return _0x44c1f5[_0x33b0('0xf')](0xc8)[_0x33b0('0x10')]({'output':_0x33b0('0x16')});});};exports[_0x33b0('0x17')]=function(_0x5cdb4b,_0x2f5785){return git[_0x33b0('0x17')](['--hard','FETCH_HEAD'],function(_0x462cd2){if(_0x462cd2){logger[_0x33b0('0x14')](_0x462cd2);return _0x2f5785[_0x33b0('0xf')](0x1f4)[_0x33b0('0x10')](_0x462cd2);}logger['info'](_0x33b0('0x18'));return _0x2f5785[_0x33b0('0xf')](0xc8)['json']({'output':_0x33b0('0x19')});});};exports[_0x33b0('0x1a')]=function(_0x38f0e1,_0x2248dd){exec(_0x33b0('0x1b'),function(_0x1dc44c,_0x465813,_0xc74c41){logger[_0x33b0('0x1c')](_0x465813);logger[_0x33b0('0x1c')](_0xc74c41);if(_0x1dc44c){logger[_0x33b0('0x14')](_0x1dc44c);return _0x2248dd[_0x33b0('0xf')](0x1f4)[_0x33b0('0x10')](_0x1dc44c);}return _0x2248dd['status'](0xc8)['json']({'output':_0x465813});});};exports[_0x33b0('0x1d')]=function(_0x6e0681,_0x45c467){return pm2[_0x33b0('0x1d')](_0x33b0('0x1e'))[_0x33b0('0x1f')](function(_0x224756){logger[_0x33b0('0x1c')](_0x33b0('0x20'),_0x224756);return _0x45c467[_0x33b0('0xf')](0xc8)[_0x33b0('0x10')]({'output':_0x33b0('0x21')});})[_0x33b0('0x22')](function(_0x4c504c){logger[_0x33b0('0x14')](_0x4c504c);return _0x45c467[_0x33b0('0xf')](0x1f4)[_0x33b0('0x10')](_0x4c504c);});};exports['migrations']=function(_0x3d6d60,_0x3beb0f){var _0x19b5cb=fs[_0x33b0('0x23')](path['join'](config[_0x33b0('0x24')],_0x33b0('0x25'),_0x33b0('0x26')));var _0x3a4124=[];for(var _0x10dca6=0x0;_0x10dca6<_0x19b5cb[_0x33b0('0x27')];_0x10dca6++){var _0x1cd09a=_0x19b5cb[_0x10dca6][_0x33b0('0x28')]('.js','');if(compareVersions(module['exports'][_0x33b0('0x2')],_0x1cd09a)===-0x1){_0x3a4124[_0x33b0('0x29')](_0x1cd09a);}}if(_0x3a4124['length']){var _0x5d63cc=_0x3a4124[_0x33b0('0x2a')](compareVersions);var _0x4524ea=new Umzug({'storage':_0x33b0('0x2b'),'storageOptions':{'model':db[_0x33b0('0x2c')],'modelName':_0x33b0('0x2c'),'columnName':_0x33b0('0x2')},'migrations':{'params':[db[_0x33b0('0x2b')][_0x33b0('0x2d')](),db['sequelize'][_0x33b0('0x2e')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x33b0('0x2f')](config[_0x33b0('0x24')],_0x33b0('0x25'),_0x33b0('0x26')),'pattern':/\.js$/}});_0x4524ea['up']({'migrations':_[_0x33b0('0x30')](_0x5d63cc,function(_0x157fbb){return _0x157fbb+_0x33b0('0x31');})})[_0x33b0('0x1f')](function(){return _0x3beb0f['status'](0xc8)[_0x33b0('0x10')]({'output':_0x33b0('0x32')+module[_0x33b0('0xa')][_0x33b0('0x2')]+_0x33b0('0x33')+_[_0x33b0('0x34')](_0x5d63cc),'migrations':_[_0x33b0('0x2f')](_0x5d63cc)});})[_0x33b0('0x22')](function(_0x20a806){if(_0x20a806 instanceof db[_0x33b0('0x2b')][_0x33b0('0x35')]){return _0x3beb0f[_0x33b0('0xf')](0xc8)[_0x33b0('0x10')]({'output':_0x33b0('0x36')});}else{return _0x3beb0f[_0x33b0('0xf')](0x1f4)['json'](_0x20a806);}});}else{return _0x3beb0f[_0x33b0('0xf')](0xc8)[_0x33b0('0x10')]({'output':_0x33b0('0x36')});}};
\ No newline at end of file
+var _0x8572=['query','latest','tags','2.0.0','status','json','fetch','origin','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','catch','migrations','readdirSync','join','server','length','replace','.js','push','sort','Migration','getQueryInterface','sequelize','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','root','index','exports'];(function(_0x48694f,_0x44690e){var _0x28aeb0=function(_0x205204){while(--_0x205204){_0x48694f['push'](_0x48694f['shift']());}};_0x28aeb0(++_0x44690e);}(_0x8572,0x165));var _0x2857=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x8572[_0x381589];return _0x2a075d;};'use strict';var Umzug=require(_0x2857('0x0'));var path=require(_0x2857('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x2857('0x2'))(module,_0x2857('0x3'));var compareVersions=require(_0x2857('0x4'));var exec=require(_0x2857('0x5'))[_0x2857('0x6')];var db=require(_0x2857('0x7'))['db'];var config=require(_0x2857('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x2857('0x9'))(_0x2857('0xa'));var git=require('simple-git')(config[_0x2857('0xb')]);exports[_0x2857('0xc')]=function(_0x5bb43d,_0x54706d){var _0x4316f2={'current':module[_0x2857('0xd')]['version'],'phonebar':0x2};if(_0x5bb43d[_0x2857('0xe')]&&_0x5bb43d[_0x2857('0xe')][_0x2857('0xf')]){return git['fetch']()[_0x2857('0x10')](function(_0x98313a,_0x4169e6){_0x4316f2[_0x2857('0xf')]=(_0x98313a?module['exports'][_0x2857('0x3')]:_0x4169e6[_0x2857('0xf')])||_0x2857('0x11');return _0x54706d[_0x2857('0x12')](0xc8)[_0x2857('0x13')](_0x4316f2);});}else{return _0x54706d['status'](0xc8)[_0x2857('0x13')](_0x4316f2);}};exports[_0x2857('0x14')]=function(_0x52df7c,_0x35e700){return git[_0x2857('0x14')]([_0x2857('0x15'),'master'],function(_0x3a6c33){if(_0x3a6c33){logger['error'](_0x3a6c33);return _0x35e700[_0x2857('0x12')](0x1f4)[_0x2857('0x13')](_0x3a6c33);}logger[_0x2857('0x16')]('git\x20fetch');return _0x35e700[_0x2857('0x12')](0xc8)[_0x2857('0x13')]({'output':_0x2857('0x17')});});};exports[_0x2857('0x18')]=function(_0x58b3f3,_0x2eae99){return git[_0x2857('0x18')]([_0x2857('0x19'),_0x2857('0x1a')],function(_0x34a252){if(_0x34a252){logger[_0x2857('0x1b')](_0x34a252);return _0x2eae99['status'](0x1f4)['json'](_0x34a252);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2eae99[_0x2857('0x12')](0xc8)[_0x2857('0x13')]({'output':_0x2857('0x1c')});});};exports[_0x2857('0x1d')]=function(_0x5ab452,_0x4798e9){exec(_0x2857('0x1e'),function(_0x1121ef,_0x19f154,_0x59491e){logger[_0x2857('0x16')](_0x19f154);logger['info'](_0x59491e);if(_0x1121ef){logger[_0x2857('0x1b')](_0x1121ef);return _0x4798e9[_0x2857('0x12')](0x1f4)[_0x2857('0x13')](_0x1121ef);}return _0x4798e9['status'](0xc8)[_0x2857('0x13')]({'output':_0x19f154});});};exports['restart']=function(_0x442f54,_0x5a4fe2){return pm2[_0x2857('0x1f')](_0x2857('0x20'))[_0x2857('0x21')](function(_0x387815){logger[_0x2857('0x16')]('pm2\x20restart\x20motion\x20%s',_0x387815);return _0x5a4fe2[_0x2857('0x12')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x2857('0x22')](function(_0x5f1b25){logger['error'](_0x5f1b25);return _0x5a4fe2[_0x2857('0x12')](0x1f4)[_0x2857('0x13')](_0x5f1b25);});};exports[_0x2857('0x23')]=function(_0x558e97,_0x575a33){var _0x1082e=fs[_0x2857('0x24')](path[_0x2857('0x25')](config[_0x2857('0xb')],_0x2857('0x26'),_0x2857('0x23')));var _0x2999ec=[];for(var _0x443f56=0x0;_0x443f56<_0x1082e[_0x2857('0x27')];_0x443f56++){var _0x1162c9=_0x1082e[_0x443f56][_0x2857('0x28')](_0x2857('0x29'),'');if(compareVersions(module[_0x2857('0xd')][_0x2857('0x3')],_0x1162c9)===-0x1){_0x2999ec[_0x2857('0x2a')](_0x1162c9);}}if(_0x2999ec[_0x2857('0x27')]){var _0x17fc7b=_0x2999ec[_0x2857('0x2b')](compareVersions);var _0x19ac28=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x2857('0x2c')],'modelName':_0x2857('0x2c'),'columnName':_0x2857('0x3')},'migrations':{'params':[db['sequelize'][_0x2857('0x2d')](),db[_0x2857('0x2e')]['constructor'],function(){throw new Error(_0x2857('0x2f'));}],'path':path[_0x2857('0x25')](config[_0x2857('0xb')],_0x2857('0x26'),_0x2857('0x23')),'pattern':/\.js$/}});_0x19ac28['up']({'migrations':_[_0x2857('0x30')](_0x17fc7b,function(_0x111489){return _0x111489+_0x2857('0x29');})})[_0x2857('0x21')](function(){return _0x575a33[_0x2857('0x12')](0xc8)[_0x2857('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x2857('0xd')][_0x2857('0x3')]+_0x2857('0x31')+_[_0x2857('0x32')](_0x17fc7b),'migrations':_[_0x2857('0x25')](_0x17fc7b)});})[_0x2857('0x22')](function(_0x333c4a){if(_0x333c4a instanceof db[_0x2857('0x2e')][_0x2857('0x33')]){return _0x575a33[_0x2857('0x12')](0xc8)[_0x2857('0x13')]({'output':_0x2857('0x34')});}else{return _0x575a33[_0x2857('0x12')](0x1f4)[_0x2857('0x13')](_0x333c4a);}});}else{return _0x575a33[_0x2857('0x12')](0xc8)[_0x2857('0x13')]({'output':_0x2857('0x34')});}};
\ No newline at end of file
index cf71cc4..84eecc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ab0=['get','describe','isAuthenticated','show','create','put','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller'];(function(_0xb65ffb,_0x2cc0af){var _0x58f55c=function(_0x24ba56){while(--_0x24ba56){_0xb65ffb['push'](_0xb65ffb['shift']());}};_0x58f55c(++_0x2cc0af);}(_0x8ab0,0x13b));var _0x08ab=function(_0x3735e6,_0x2b9e72){_0x3735e6=_0x3735e6-0x0;var _0x46ea0e=_0x8ab0[_0x3735e6];return _0x46ea0e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x08ab('0x0'));var timeout=require(_0x08ab('0x1'));var express=require(_0x08ab('0x2'));var router=express[_0x08ab('0x3')]();var fs_extra=require(_0x08ab('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x08ab('0x5'));var config=require(_0x08ab('0x6'));var controller=require(_0x08ab('0x7'));router[_0x08ab('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x08ab('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x08ab('0x9')]);router[_0x08ab('0x8')]('/:id',auth[_0x08ab('0xa')](),controller[_0x08ab('0xb')]);router['post']('/',auth[_0x08ab('0xa')](),controller[_0x08ab('0xc')]);router[_0x08ab('0xd')]('/:id',auth[_0x08ab('0xa')](),controller['update']);router['delete'](_0x08ab('0xe'),auth[_0x08ab('0xa')](),controller[_0x08ab('0xf')]);module[_0x08ab('0x10')]=router;
\ No newline at end of file
+var _0x5ed7=['show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x369cf2,_0x47e28c){var _0x5c7d3e=function(_0x4143d9){while(--_0x4143d9){_0x369cf2['push'](_0x369cf2['shift']());}};_0x5c7d3e(++_0x47e28c);}(_0x5ed7,0x15c));var _0x75ed=function(_0x28321c,_0x3f51aa){_0x28321c=_0x28321c-0x0;var _0x4742f4=_0x5ed7[_0x28321c];return _0x4742f4;};'use strict';var multer=require(_0x75ed('0x0'));var util=require('util');var path=require(_0x75ed('0x1'));var timeout=require(_0x75ed('0x2'));var express=require(_0x75ed('0x3'));var router=express[_0x75ed('0x4')]();var fs_extra=require(_0x75ed('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x75ed('0x6'));var controller=require(_0x75ed('0x7'));router[_0x75ed('0x8')]('/',auth[_0x75ed('0x9')](),controller[_0x75ed('0xa')]);router[_0x75ed('0x8')](_0x75ed('0xb'),auth[_0x75ed('0x9')](),controller['describe']);router[_0x75ed('0x8')](_0x75ed('0xc'),auth['isAuthenticated'](),controller[_0x75ed('0xd')]);router[_0x75ed('0xe')]('/',auth[_0x75ed('0x9')](),controller['create']);router[_0x75ed('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75ed('0x10')]);router[_0x75ed('0x11')](_0x75ed('0xc'),auth[_0x75ed('0x9')](),controller[_0x75ed('0x12')]);module['exports']=router;
\ No newline at end of file
index a84a25e..56c5e61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79e2=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x2fab7a,_0x259020){var _0x51b07f=function(_0x1dfeaf){while(--_0x1dfeaf){_0x2fab7a['push'](_0x2fab7a['shift']());}};_0x51b07f(++_0x259020);}(_0x79e2,0x1c3));var _0x279e=function(_0x541060,_0x336a59){_0x541060=_0x541060-0x0;var _0x1fdc4e=_0x79e2[_0x541060];return _0x1fdc4e;};'use strict';var Sequelize=require(_0x279e('0x0'));module['exports']={'type':{'type':Sequelize[_0x279e('0x1')]},'uniqueid':{'type':Sequelize[_0x279e('0x1')]},'calleridnum':{'type':Sequelize[_0x279e('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x279e('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x279e('0x1')]},'agentcalledAt':{'type':Sequelize[_0x279e('0x2')]},'agentconnectAt':{'type':Sequelize[_0x279e('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x279e('0x2')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x279e('0x3')]},'agentcomplete':{'type':Sequelize[_0x279e('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x279e('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x279e('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x279e('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x279e('0x3')]},'reason':{'type':Sequelize[_0x279e('0x1')]},'lastevent':{'type':Sequelize[_0x279e('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x279e('0x3')]},'channelstatedesc':{'type':Sequelize[_0x279e('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x279e('0x1')]},'language':{'type':Sequelize[_0x279e('0x1')]},'accountcode':{'type':Sequelize[_0x279e('0x1')]},'context':{'type':Sequelize[_0x279e('0x1')]},'exten':{'type':Sequelize[_0x279e('0x1')]},'priority':{'type':Sequelize[_0x279e('0x1')]},'destchannel':{'type':Sequelize[_0x279e('0x1')]},'destchannelstate':{'type':Sequelize[_0x279e('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x279e('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x279e('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x279e('0x1')]},'destlanguage':{'type':Sequelize[_0x279e('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x279e('0x1')]},'destexten':{'type':Sequelize[_0x279e('0x1')]},'destpriority':{'type':Sequelize[_0x279e('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x279e('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x279e('0x1')]},'transfer':{'type':Sequelize[_0x279e('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x279e('0x1')],'comment':_0x279e('0x5')},'transferexten':{'type':Sequelize[_0x279e('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x279e('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4c99=['sequelize','STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x4c99,0x1ec));var _0x94c9=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x4c99[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x94c9('0x0'));module['exports']={'type':{'type':Sequelize[_0x94c9('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x94c9('0x1')]},'interface':{'type':Sequelize[_0x94c9('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x94c9('0x2')]},'agentconnectAt':{'type':Sequelize[_0x94c9('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x94c9('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x94c9('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x94c9('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x94c9('0x4')]},'agentacw':{'type':Sequelize[_0x94c9('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x94c9('0x4')]},'reason':{'type':Sequelize[_0x94c9('0x1')]},'lastevent':{'type':Sequelize[_0x94c9('0x1')]},'channel':{'type':Sequelize[_0x94c9('0x1')]},'channelstate':{'type':Sequelize[_0x94c9('0x4')]},'channelstatedesc':{'type':Sequelize[_0x94c9('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x94c9('0x1')]},'language':{'type':Sequelize[_0x94c9('0x1')]},'accountcode':{'type':Sequelize[_0x94c9('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x94c9('0x1')]},'priority':{'type':Sequelize[_0x94c9('0x1')]},'destchannel':{'type':Sequelize[_0x94c9('0x1')]},'destchannelstate':{'type':Sequelize[_0x94c9('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x94c9('0x1')]},'destcalleridnum':{'type':Sequelize[_0x94c9('0x1')]},'destcalleridname':{'type':Sequelize[_0x94c9('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x94c9('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x94c9('0x1')]},'destexten':{'type':Sequelize[_0x94c9('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x94c9('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x94c9('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x94c9('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x94c9('0x5')},'transferexten':{'type':Sequelize[_0x94c9('0x1')]},'transferuniqueid':{'type':Sequelize[_0x94c9('0x1')]},'agententerreason':{'type':Sequelize[_0x94c9('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index f438094..eaf3f4f 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(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 45c1ddf..7185b46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b19=['uniqueid','destuniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','report_agent'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0x4b19,0x195));var _0x94b1=function(_0x28b1b6,_0x20e269){_0x28b1b6=_0x28b1b6-0x0;var _0x266507=_0x4b19[_0x28b1b6];return _0x266507;};'use strict';var _=require(_0x94b1('0x0'));var util=require('util');var logger=require(_0x94b1('0x1'))(_0x94b1('0x2'));var moment=require(_0x94b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x94b1('0x4'));var fs=require('fs');var path=require(_0x94b1('0x5'));var rimraf=require(_0x94b1('0x6'));var config=require('../../config/environment');var attributes=require(_0x94b1('0x7'));module[_0x94b1('0x8')]=function(_0x52d6c1,_0x24df76){return _0x52d6c1[_0x94b1('0x9')]('VoiceAgentReport',attributes,{'tableName':_0x94b1('0xa'),'paranoid':![],'indexes':[{'fields':[_0x94b1('0xb'),_0x94b1('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x31c2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceAgentReport.attributes','exports','VoiceAgentReport','uniqueid','destuniqueid'];(function(_0x3f8eb9,_0x549802){var _0x5e4ba2=function(_0x1e3e10){while(--_0x1e3e10){_0x3f8eb9['push'](_0x3f8eb9['shift']());}};_0x5e4ba2(++_0x549802);}(_0x31c2,0x1e1));var _0x231c=function(_0x2b6550,_0x99a72b){_0x2b6550=_0x2b6550-0x0;var _0x54e0be=_0x31c2[_0x2b6550];return _0x54e0be;};'use strict';var _=require(_0x231c('0x0'));var util=require(_0x231c('0x1'));var logger=require(_0x231c('0x2'))(_0x231c('0x3'));var moment=require(_0x231c('0x4'));var BPromise=require(_0x231c('0x5'));var rp=require(_0x231c('0x6'));var fs=require('fs');var path=require(_0x231c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x231c('0x8'));module[_0x231c('0x9')]=function(_0x1f3f7d,_0x219c3f){return _0x1f3f7d['define'](_0x231c('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x231c('0xb'),_0x231c('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 2b280b9..b0f7a45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb607=['update','where','attributes','limit','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceAgentReport,\x20%s,\x20%s','result','catch','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','VoiceAgentReport'];(function(_0x2ecb67,_0x8ec62d){var _0x168079=function(_0x56c365){while(--_0x56c365){_0x2ecb67['push'](_0x2ecb67['shift']());}};_0x168079(++_0x8ec62d);}(_0xb607,0x64));var _0x7b60=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xb607[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require(_0x7b60('0x0'));var moment=require('moment');var BPromise=require(_0x7b60('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b60('0x2'))['db'];var utils=require(_0x7b60('0x3'));var logger=require(_0x7b60('0x4'))(_0x7b60('0x5'));var config=require(_0x7b60('0x6'));var jayson=require(_0x7b60('0x7'));var client=jayson[_0x7b60('0x8')][_0x7b60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1956e,_0x39b7c2,_0x56d950){return new BPromise(function(_0x128653,_0x1210a7){return client['request'](_0x1956e,_0x56d950)[_0x7b60('0xa')](function(_0x556224){logger[_0x7b60('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x39b7c2,_0x7b60('0xc'));logger[_0x7b60('0xd')](_0x7b60('0xe'),_0x39b7c2,_0x7b60('0xc'),JSON[_0x7b60('0xf')](_0x556224));if(_0x556224[_0x7b60('0x10')]){if(_0x556224['error']['code']===0x1f4){logger[_0x7b60('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x39b7c2,_0x556224['error']['message']);return _0x1210a7(_0x556224['error'][_0x7b60('0x11')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x39b7c2,_0x556224[_0x7b60('0x10')]['message']);return _0x128653(_0x556224[_0x7b60('0x10')][_0x7b60('0x11')]);}else{logger[_0x7b60('0xb')](_0x7b60('0x12'),_0x39b7c2,'request\x20sent');_0x128653(_0x556224[_0x7b60('0x13')][_0x7b60('0x11')]);}})[_0x7b60('0x14')](function(_0x244690){logger['error'](_0x7b60('0x12'),_0x39b7c2,_0x244690);_0x1210a7(_0x244690);});});}exports['CreateVoiceAgentReport']=function(_0xd2996){var _0xca81c0=this;return new Promise(function(_0x5e229c,_0x4c01d9){return db['VoiceAgentReport'][_0x7b60('0x15')](_0xd2996[_0x7b60('0x16')],{'raw':_0xd2996[_0x7b60('0x17')]?_0xd2996[_0x7b60('0x17')][_0x7b60('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x33f5e8){logger['info'](_0x7b60('0x19'),_0xd2996);logger[_0x7b60('0xd')](_0x7b60('0x19'),_0xd2996,JSON[_0x7b60('0xf')](_0x33f5e8));_0x5e229c(_0x33f5e8);})['catch'](function(_0x40e6a5){logger['error'](_0x7b60('0x19'),_0x40e6a5[_0x7b60('0x11')],_0xd2996);_0x4c01d9(_0xca81c0[_0x7b60('0x10')](0x1f4,_0x40e6a5[_0x7b60('0x11')]));});});};exports[_0x7b60('0x1a')]=function(_0x485bfa){var _0xe00599=this;return new Promise(function(_0xd9dae2,_0x372b7d){return db[_0x7b60('0x1b')][_0x7b60('0x1c')](_0x485bfa[_0x7b60('0x16')],{'raw':_0x485bfa[_0x7b60('0x17')]?_0x485bfa[_0x7b60('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x485bfa['options']?_0x485bfa['options'][_0x7b60('0x1d')]||null:null,'attributes':_0x485bfa[_0x7b60('0x17')]?_0x485bfa[_0x7b60('0x17')][_0x7b60('0x1e')]||null:null,'limit':_0x485bfa[_0x7b60('0x17')]?_0x485bfa['options'][_0x7b60('0x1f')]||null:null})[_0x7b60('0xa')](function(_0x31e54b){logger[_0x7b60('0xb')]('UpdateVoiceAgentReport',_0x485bfa);logger[_0x7b60('0xd')](_0x7b60('0x1a'),_0x485bfa,JSON[_0x7b60('0xf')](_0x31e54b));_0xd9dae2(_0x31e54b);})[_0x7b60('0x14')](function(_0x1cebef){logger[_0x7b60('0x10')](_0x7b60('0x1a'),_0x1cebef[_0x7b60('0x11')],_0x485bfa);_0x372b7d(_0xe00599[_0x7b60('0x10')](0x1f4,_0x1cebef[_0x7b60('0x11')]));});});};
\ No newline at end of file
+var _0x3c19=['info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceAgentReport','options','raw','catch','UpdateVoiceAgentReport','VoiceAgentReport','body','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3c19,0x152));var _0x93c1=function(_0x31f1f0,_0x5d95dd){_0x31f1f0=_0x31f1f0-0x0;var _0x3ab901=_0x3c19[_0x31f1f0];return _0x3ab901;};'use strict';var _=require(_0x93c1('0x0'));var util=require(_0x93c1('0x1'));var moment=require(_0x93c1('0x2'));var BPromise=require(_0x93c1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93c1('0x4'));var db=require(_0x93c1('0x5'))['db'];var utils=require(_0x93c1('0x6'));var logger=require(_0x93c1('0x7'))(_0x93c1('0x8'));var config=require('../../config/environment');var jayson=require(_0x93c1('0x9'));var client=jayson[_0x93c1('0xa')][_0x93c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d6bd4,_0x21fa6d,_0x257108){return new BPromise(function(_0x31a901,_0x35e701){return client[_0x93c1('0xc')](_0x4d6bd4,_0x257108)[_0x93c1('0xd')](function(_0x5d80cc){logger[_0x93c1('0xe')](_0x93c1('0xf'),_0x21fa6d,_0x93c1('0x10'));logger[_0x93c1('0x11')](_0x93c1('0x12'),_0x21fa6d,'request\x20sent',JSON[_0x93c1('0x13')](_0x5d80cc));if(_0x5d80cc[_0x93c1('0x14')]){if(_0x5d80cc['error']['code']===0x1f4){logger[_0x93c1('0x14')](_0x93c1('0xf'),_0x21fa6d,_0x5d80cc[_0x93c1('0x14')]['message']);return _0x35e701(_0x5d80cc[_0x93c1('0x14')][_0x93c1('0x15')]);}logger[_0x93c1('0x14')]('VoiceAgentReport,\x20%s,\x20%s',_0x21fa6d,_0x5d80cc[_0x93c1('0x14')][_0x93c1('0x15')]);return _0x31a901(_0x5d80cc['error'][_0x93c1('0x15')]);}else{logger[_0x93c1('0xe')](_0x93c1('0xf'),_0x21fa6d,_0x93c1('0x10'));_0x31a901(_0x5d80cc[_0x93c1('0x16')][_0x93c1('0x15')]);}})['catch'](function(_0x56dc71){logger['error'](_0x93c1('0xf'),_0x21fa6d,_0x56dc71);_0x35e701(_0x56dc71);});});}exports[_0x93c1('0x17')]=function(_0x1bb360){var _0x49b26c=this;return new Promise(function(_0xf8e98e,_0x20a423){return db['VoiceAgentReport']['create'](_0x1bb360['body'],{'raw':_0x1bb360[_0x93c1('0x18')]?_0x1bb360['options'][_0x93c1('0x19')]===undefined?!![]:![]:!![]})[_0x93c1('0xd')](function(_0x4aad7c){logger[_0x93c1('0xe')](_0x93c1('0x17'),_0x1bb360);logger[_0x93c1('0x11')]('CreateVoiceAgentReport',_0x1bb360,JSON['stringify'](_0x4aad7c));_0xf8e98e(_0x4aad7c);})[_0x93c1('0x1a')](function(_0xa1eef7){logger[_0x93c1('0x14')](_0x93c1('0x17'),_0xa1eef7['message'],_0x1bb360);_0x20a423(_0x49b26c[_0x93c1('0x14')](0x1f4,_0xa1eef7[_0x93c1('0x15')]));});});};exports[_0x93c1('0x1b')]=function(_0x47ef70){var _0x316525=this;return new Promise(function(_0x11c87a,_0x414582){return db[_0x93c1('0x1c')]['update'](_0x47ef70[_0x93c1('0x1d')],{'raw':_0x47ef70[_0x93c1('0x18')]?_0x47ef70['options'][_0x93c1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47ef70['options']?_0x47ef70['options']['where']||null:null,'attributes':_0x47ef70[_0x93c1('0x18')]?_0x47ef70[_0x93c1('0x18')][_0x93c1('0x1e')]||null:null,'limit':_0x47ef70[_0x93c1('0x18')]?_0x47ef70[_0x93c1('0x18')][_0x93c1('0x1f')]||null:null})[_0x93c1('0xd')](function(_0x385383){logger[_0x93c1('0xe')](_0x93c1('0x1b'),_0x47ef70);logger[_0x93c1('0x11')]('UpdateVoiceAgentReport',_0x47ef70,JSON[_0x93c1('0x13')](_0x385383));_0x11c87a(_0x385383);})[_0x93c1('0x1a')](function(_0x34fc29){logger['error'](_0x93c1('0x1b'),_0x34fc29[_0x93c1('0x15')],_0x47ef70);_0x414582(_0x316525[_0x93c1('0x14')](0x1f4,_0x34fc29[_0x93c1('0x15')]));});});};
\ No newline at end of file
index 9045ac3..0bf36b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44e8=['show','post','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x50d0fd,_0x3bed18){var _0x2498d7=function(_0x6ef74f){while(--_0x6ef74f){_0x50d0fd['push'](_0x50d0fd['shift']());}};_0x2498d7(++_0x3bed18);}(_0x44e8,0xd7));var _0x844e=function(_0x4ed4cc,_0x3b0594){_0x4ed4cc=_0x4ed4cc-0x0;var _0x580d71=_0x44e8[_0x4ed4cc];return _0x580d71;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x844e('0x1'));var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var fs_extra=require(_0x844e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require(_0x844e('0x7'));router[_0x844e('0x8')]('/',auth['isAuthenticated'](),controller[_0x844e('0x9')]);router[_0x844e('0x8')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['describe']);router[_0x844e('0x8')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0xd')]);router[_0x844e('0xe')]('/',auth[_0x844e('0xb')](),controller['create']);router[_0x844e('0xf')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0x10')]);router[_0x844e('0x11')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller['destroy']);module[_0x844e('0x12')]=router;
\ No newline at end of file
+var _0x3eea=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5b14e4,_0x3431a3){var _0x2da5fa=function(_0x4440ff){while(--_0x4440ff){_0x5b14e4['push'](_0x5b14e4['shift']());}};_0x2da5fa(++_0x3431a3);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x1a1dfb,_0x37e774){_0x1a1dfb=_0x1a1dfb-0x0;var _0x19ad49=_0x3eea[_0x1a1dfb];return _0x19ad49;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['get'](_0xa3ee('0xe'),auth['isAuthenticated'](),controller[_0xa3ee('0xf')]);router['post']('/',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x10')]);router[_0xa3ee('0x11')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x12')]);router['delete']('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x13')]);module[_0xa3ee('0x14')]=router;
\ No newline at end of file
index a788b2f..6eaefd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0ef=['STRING','ENUM','inbound','internal','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x158dd7,_0x1f5f90){var _0x1772ba=function(_0x20cbf1){while(--_0x20cbf1){_0x158dd7['push'](_0x158dd7['shift']());}};_0x1772ba(++_0x1f5f90);}(_0xc0ef,0xee));var _0xfc0e=function(_0x2e92cd,_0x284773){_0x2e92cd=_0x2e92cd-0x0;var _0x586283=_0xc0ef[_0x2e92cd];return _0x586283;};'use strict';var Sequelize=require(_0xfc0e('0x0'));module[_0xfc0e('0x1')]={'uniqueid':{'type':Sequelize[_0xfc0e('0x2')]},'type':{'type':Sequelize[_0xfc0e('0x3')](_0xfc0e('0x4'),_0xfc0e('0x5'),'outbound',_0xfc0e('0x6'),_0xfc0e('0x7'),_0xfc0e('0x8'))},'tag':{'type':Sequelize[_0xfc0e('0x2')]},'accountcode':{'type':Sequelize[_0xfc0e('0x2')]},'source':{'type':Sequelize[_0xfc0e('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xfc0e('0x2')]},'callerid':{'type':Sequelize[_0xfc0e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xfc0e('0x2')]},'lastapplication':{'type':Sequelize[_0xfc0e('0x2')]},'lastdata':{'type':Sequelize[_0xfc0e('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xfc0e('0xa')]},'answertime':{'type':Sequelize[_0xfc0e('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xfc0e('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xfc0e('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfc0e('0x2')]},'amaflags':{'type':Sequelize[_0xfc0e('0x2')]},'userfield':{'type':Sequelize[_0xfc0e('0x2')]},'userDisposition':{'type':Sequelize[_0xfc0e('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xfc0e('0xb')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5d44=['STRING','ENUM','inbound','internal','outbound','outbound-fax','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x268277,_0x675e3d){var _0x39a84f=function(_0x510905){while(--_0x510905){_0x268277['push'](_0x268277['shift']());}};_0x39a84f(++_0x675e3d);}(_0x5d44,0x6c));var _0x45d4=function(_0x2c86f,_0x369e06){_0x2c86f=_0x2c86f-0x0;var _0x108b9a=_0x5d44[_0x2c86f];return _0x108b9a;};'use strict';var Sequelize=require(_0x45d4('0x0'));module[_0x45d4('0x1')]={'uniqueid':{'type':Sequelize[_0x45d4('0x2')]},'type':{'type':Sequelize[_0x45d4('0x3')](_0x45d4('0x4'),_0x45d4('0x5'),_0x45d4('0x6'),'inbound-fax',_0x45d4('0x7'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x45d4('0x2')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x45d4('0x2')]},'channel':{'type':Sequelize[_0x45d4('0x2')]},'destinationchannel':{'type':Sequelize[_0x45d4('0x2')]},'lastapplication':{'type':Sequelize[_0x45d4('0x2')]},'lastdata':{'type':Sequelize[_0x45d4('0x8')]},'starttime':{'type':Sequelize[_0x45d4('0x9')]},'systemanswertime':{'type':Sequelize[_0x45d4('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x45d4('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x45d4('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x45d4('0x2')]},'amaflags':{'type':Sequelize[_0x45d4('0x2')]},'userfield':{'type':Sequelize[_0x45d4('0x2')]},'userDisposition':{'type':Sequelize[_0x45d4('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x45d4('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x45d4('0x2')]},'note':{'type':Sequelize[_0x45d4('0x2')]},'prefix':{'type':Sequelize[_0x45d4('0x2')]},'routeid':{'type':Sequelize[_0x45d4('0xa')]},'sipcallid':{'type':Sequelize[_0x45d4('0x2')]}};
\ No newline at end of file
index 373b7c4..798ad66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x421e36,_0x18776e){var _0x20b3e3=function(_0x767de4){while(--_0x767de4){_0x421e36['push'](_0x421e36['shift']());}};_0x20b3e3(++_0x18776e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3e4720,_0x42638f){_0x3e4720=_0x3e4720-0x0;var _0x4c7364=_0x5f2f[_0x3e4720];return _0x4c7364;};'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')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));};
\ No newline at end of file
+var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x43d701,_0x4bb2e9){var _0x2ec4c6=function(_0x4d9765){while(--_0x4d9765){_0x43d701['push'](_0x43d701['shift']());}};_0x2ec4c6(++_0x4bb2e9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x6fd4dd,_0x350997){_0x6fd4dd=_0x6fd4dd-0x0;var _0x462dcf=_0x5f2f[_0x6fd4dd];return _0x462dcf;};'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')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));};
\ No newline at end of file
index e0521b1..f064a01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0047=['bluebird','request-promise','path','rimraf','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','api'];(function(_0x978359,_0x5755b9){var _0x4c1f55=function(_0x3564a5){while(--_0x3564a5){_0x978359['push'](_0x978359['shift']());}};_0x4c1f55(++_0x5755b9);}(_0x0047,0x69));var _0x7004=function(_0x459a0a,_0x25c46f){_0x459a0a=_0x459a0a-0x0;var _0x4ab46c=_0x0047[_0x459a0a];return _0x4ab46c;};'use strict';var _=require(_0x7004('0x0'));var util=require(_0x7004('0x1'));var logger=require('../../config/logger')(_0x7004('0x2'));var moment=require('moment');var BPromise=require(_0x7004('0x3'));var rp=require(_0x7004('0x4'));var fs=require('fs');var path=require(_0x7004('0x5'));var rimraf=require(_0x7004('0x6'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x7004('0x7')]=function(_0xe3c16f,_0xc29200){return _0xe3c16f[_0x7004('0x8')](_0x7004('0x9'),attributes,{'tableName':_0x7004('0xa'),'paranoid':![],'indexes':[{'fields':[_0x7004('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe57a=['../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xe57a,0x19c));var _0xae57=function(_0x27c2b3,_0x2e034e){_0x27c2b3=_0x27c2b3-0x0;var _0x37ad8c=_0xe57a[_0x27c2b3];return _0x37ad8c;};'use strict';var _=require(_0xae57('0x0'));var util=require(_0xae57('0x1'));var logger=require(_0xae57('0x2'))(_0xae57('0x3'));var moment=require(_0xae57('0x4'));var BPromise=require(_0xae57('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae57('0x6'));var rimraf=require(_0xae57('0x7'));var config=require(_0xae57('0x8'));var attributes=require(_0xae57('0x9'));module[_0xae57('0xa')]=function(_0x29087c,_0x5c7a7e){return _0x29087c['define'](_0xae57('0xb'),attributes,{'tableName':_0xae57('0xc'),'paranoid':![],'indexes':[{'fields':[_0xae57('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 6eba283..d85c19c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaf0=['model','catch','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceCallReport,\x20%s,\x20%s','result','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','include','map'];(function(_0x43a177,_0x52fd01){var _0x3cfd4a=function(_0x3f9cf6){while(--_0x3f9cf6){_0x43a177['push'](_0x43a177['shift']());}};_0x3cfd4a(++_0x52fd01);}(_0xcaf0,0x77));var _0x0caf=function(_0x56e718,_0xd25942){_0x56e718=_0x56e718-0x0;var _0x55f85e=_0xcaf0[_0x56e718];return _0x55f85e;};'use strict';var _=require(_0x0caf('0x0'));var util=require(_0x0caf('0x1'));var moment=require('moment');var BPromise=require(_0x0caf('0x2'));var rs=require(_0x0caf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0caf('0x4'))['db'];var utils=require(_0x0caf('0x5'));var logger=require(_0x0caf('0x6'))(_0x0caf('0x7'));var config=require(_0x0caf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0caf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd18358,_0x518e92,_0x171daa){return new BPromise(function(_0x58311a,_0x404b99){return client[_0x0caf('0xa')](_0xd18358,_0x171daa)[_0x0caf('0xb')](function(_0x196a2c){logger[_0x0caf('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x518e92,_0x0caf('0xd'));logger[_0x0caf('0xe')](_0x0caf('0xf'),_0x518e92,_0x0caf('0xd'),JSON[_0x0caf('0x10')](_0x196a2c));if(_0x196a2c[_0x0caf('0x11')]){if(_0x196a2c['error']['code']===0x1f4){logger[_0x0caf('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x518e92,_0x196a2c[_0x0caf('0x11')][_0x0caf('0x12')]);return _0x404b99(_0x196a2c['error']['message']);}logger[_0x0caf('0x11')](_0x0caf('0x13'),_0x518e92,_0x196a2c[_0x0caf('0x11')]['message']);return _0x58311a(_0x196a2c[_0x0caf('0x11')][_0x0caf('0x12')]);}else{logger[_0x0caf('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x518e92,_0x0caf('0xd'));_0x58311a(_0x196a2c[_0x0caf('0x14')][_0x0caf('0x12')]);}})['catch'](function(_0x51a12c){logger[_0x0caf('0x11')](_0x0caf('0x13'),_0x518e92,_0x51a12c);_0x404b99(_0x51a12c);});});}exports[_0x0caf('0x15')]=function(_0x3b3962){var _0x4e5091=this;return new Promise(function(_0x5cee3b,_0x4c0cca){return db[_0x0caf('0x16')][_0x0caf('0x17')]({'raw':_0x3b3962['options']?_0x3b3962[_0x0caf('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3b3962[_0x0caf('0x18')]?_0x3b3962[_0x0caf('0x18')][_0x0caf('0x19')]||null:null,'attributes':_0x3b3962[_0x0caf('0x18')]?_0x3b3962[_0x0caf('0x18')][_0x0caf('0x1a')]||null:null,'limit':_0x3b3962[_0x0caf('0x18')]?_0x3b3962[_0x0caf('0x18')]['limit']||null:null,'include':_0x3b3962[_0x0caf('0x18')]?_0x3b3962[_0x0caf('0x18')][_0x0caf('0x1b')]?_[_0x0caf('0x1c')](_0x3b3962['options'][_0x0caf('0x1b')],function(_0x460e72){return{'model':db[_0x460e72[_0x0caf('0x1d')]],'as':_0x460e72['as'],'attributes':_0x460e72[_0x0caf('0x1a')],'include':_0x460e72[_0x0caf('0x1b')]?_[_0x0caf('0x1c')](_0x460e72[_0x0caf('0x1b')],function(_0x5e50eb){return{'model':db[_0x5e50eb['model']],'as':_0x5e50eb['as'],'attributes':_0x5e50eb['attributes'],'include':_0x5e50eb[_0x0caf('0x1b')]?_[_0x0caf('0x1c')](_0x5e50eb[_0x0caf('0x1b')],function(_0x8a0b6f){return{'model':db[_0x8a0b6f[_0x0caf('0x1d')]],'as':_0x8a0b6f['as'],'attributes':_0x8a0b6f[_0x0caf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0caf('0xb')](function(_0x4c8112){logger[_0x0caf('0xc')](_0x0caf('0x15'),_0x3b3962);logger[_0x0caf('0xe')](_0x0caf('0x15'),_0x3b3962,JSON['stringify'](_0x4c8112));_0x5cee3b(_0x4c8112);})[_0x0caf('0x1e')](function(_0x3e9563){logger[_0x0caf('0x11')]('GetVoiceCallReport',_0x3e9563[_0x0caf('0x12')],_0x3b3962);_0x4c0cca(_0x4e5091[_0x0caf('0x11')](0x1f4,_0x3e9563[_0x0caf('0x12')]));});});};exports[_0x0caf('0x1f')]=function(_0x493107){var _0x1431f5=this;return new Promise(function(_0xd938e8,_0x311d25){return db['VoiceCallReport'][_0x0caf('0x20')](_0x493107[_0x0caf('0x21')],{'raw':_0x493107[_0x0caf('0x18')]?_0x493107[_0x0caf('0x18')][_0x0caf('0x22')]===undefined?!![]:![]:!![]})[_0x0caf('0xb')](function(_0x45fbd5){logger[_0x0caf('0xc')](_0x0caf('0x1f'),_0x493107);logger[_0x0caf('0xe')]('CreateVoiceCallReport',_0x493107,JSON[_0x0caf('0x10')](_0x45fbd5));_0xd938e8(_0x45fbd5);})['catch'](function(_0x1f3c57){logger[_0x0caf('0x11')](_0x0caf('0x1f'),_0x1f3c57[_0x0caf('0x12')],_0x493107);_0x311d25(_0x1431f5[_0x0caf('0x11')](0x1f4,_0x1f3c57[_0x0caf('0x12')]));});});};exports[_0x0caf('0x23')]=function(_0x331b44){var _0x37b947=this;return new Promise(function(_0x174742,_0x184598){return db[_0x0caf('0x16')][_0x0caf('0x24')](_0x331b44['body'],{'raw':_0x331b44[_0x0caf('0x18')]?_0x331b44[_0x0caf('0x18')][_0x0caf('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x331b44[_0x0caf('0x18')]?_0x331b44['options'][_0x0caf('0x19')]||null:null,'attributes':_0x331b44[_0x0caf('0x18')]?_0x331b44[_0x0caf('0x18')][_0x0caf('0x1a')]||null:null,'limit':_0x331b44[_0x0caf('0x18')]?_0x331b44[_0x0caf('0x18')]['limit']||null:null})[_0x0caf('0xb')](function(_0x477794){logger['info']('UpdateVoiceCallReport',_0x331b44);logger['debug'](_0x0caf('0x23'),_0x331b44,JSON[_0x0caf('0x10')](_0x477794));_0x174742(_0x477794);})[_0x0caf('0x1e')](function(_0x5c06e3){logger['error'](_0x0caf('0x23'),_0x5c06e3['message'],_0x331b44);_0x184598(_0x37b947[_0x0caf('0x11')](0x1f4,_0x5c06e3[_0x0caf('0x12')]));});});};
\ No newline at end of file
+var _0x0bbd=['VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceCallReport','findAll','options','raw','where','limit','include','map','model','attributes','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x30094d,_0x39778a){var _0x4b9438=function(_0x2cdb0f){while(--_0x2cdb0f){_0x30094d['push'](_0x30094d['shift']());}};_0x4b9438(++_0x39778a);}(_0x0bbd,0x103));var _0xd0bb=function(_0x352580,_0x40db47){_0x352580=_0x352580-0x0;var _0x459385=_0x0bbd[_0x352580];return _0x459385;};'use strict';var _=require(_0xd0bb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd0bb('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0bb('0x2'))['db'];var utils=require(_0xd0bb('0x3'));var logger=require(_0xd0bb('0x4'))('rpc');var config=require(_0xd0bb('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd0bb('0x6')][_0xd0bb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a2c7c,_0x281551,_0xf7ef68){return new BPromise(function(_0x3f2837,_0x6f2ce4){return client['request'](_0x4a2c7c,_0xf7ef68)[_0xd0bb('0x8')](function(_0x242e9f){logger[_0xd0bb('0x9')](_0xd0bb('0xa'),_0x281551,_0xd0bb('0xb'));logger[_0xd0bb('0xc')](_0xd0bb('0xd'),_0x281551,_0xd0bb('0xb'),JSON[_0xd0bb('0xe')](_0x242e9f));if(_0x242e9f[_0xd0bb('0xf')]){if(_0x242e9f[_0xd0bb('0xf')]['code']===0x1f4){logger[_0xd0bb('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x281551,_0x242e9f[_0xd0bb('0xf')]['message']);return _0x6f2ce4(_0x242e9f['error'][_0xd0bb('0x10')]);}logger['error'](_0xd0bb('0xa'),_0x281551,_0x242e9f[_0xd0bb('0xf')][_0xd0bb('0x10')]);return _0x3f2837(_0x242e9f[_0xd0bb('0xf')][_0xd0bb('0x10')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x281551,_0xd0bb('0xb'));_0x3f2837(_0x242e9f[_0xd0bb('0x11')][_0xd0bb('0x10')]);}})[_0xd0bb('0x12')](function(_0xb2c4fd){logger['error'](_0xd0bb('0xa'),_0x281551,_0xb2c4fd);_0x6f2ce4(_0xb2c4fd);});});}exports['GetVoiceCallReport']=function(_0x4cea4d){var _0x1b3a21=this;return new Promise(function(_0x180ed6,_0x2fab9b){return db[_0xd0bb('0x13')][_0xd0bb('0x14')]({'raw':_0x4cea4d[_0xd0bb('0x15')]?_0x4cea4d[_0xd0bb('0x15')][_0xd0bb('0x16')]===undefined?!![]:![]:!![],'where':_0x4cea4d[_0xd0bb('0x15')]?_0x4cea4d['options'][_0xd0bb('0x17')]||null:null,'attributes':_0x4cea4d[_0xd0bb('0x15')]?_0x4cea4d[_0xd0bb('0x15')]['attributes']||null:null,'limit':_0x4cea4d[_0xd0bb('0x15')]?_0x4cea4d[_0xd0bb('0x15')][_0xd0bb('0x18')]||null:null,'include':_0x4cea4d[_0xd0bb('0x15')]?_0x4cea4d[_0xd0bb('0x15')][_0xd0bb('0x19')]?_[_0xd0bb('0x1a')](_0x4cea4d[_0xd0bb('0x15')][_0xd0bb('0x19')],function(_0x22857b){return{'model':db[_0x22857b[_0xd0bb('0x1b')]],'as':_0x22857b['as'],'attributes':_0x22857b['attributes'],'include':_0x22857b['include']?_['map'](_0x22857b[_0xd0bb('0x19')],function(_0x5f5ece){return{'model':db[_0x5f5ece[_0xd0bb('0x1b')]],'as':_0x5f5ece['as'],'attributes':_0x5f5ece[_0xd0bb('0x1c')],'include':_0x5f5ece[_0xd0bb('0x19')]?_[_0xd0bb('0x1a')](_0x5f5ece[_0xd0bb('0x19')],function(_0x439f7f){return{'model':db[_0x439f7f[_0xd0bb('0x1b')]],'as':_0x439f7f['as'],'attributes':_0x439f7f['attributes']};}):[]};}):[]};}):[]:[]})[_0xd0bb('0x8')](function(_0x329d8c){logger[_0xd0bb('0x9')](_0xd0bb('0x1d'),_0x4cea4d);logger['debug'](_0xd0bb('0x1d'),_0x4cea4d,JSON['stringify'](_0x329d8c));_0x180ed6(_0x329d8c);})['catch'](function(_0x55281c){logger[_0xd0bb('0xf')](_0xd0bb('0x1d'),_0x55281c['message'],_0x4cea4d);_0x2fab9b(_0x1b3a21[_0xd0bb('0xf')](0x1f4,_0x55281c[_0xd0bb('0x10')]));});});};exports[_0xd0bb('0x1e')]=function(_0x165020){var _0x185e3c=this;return new Promise(function(_0x45b6e1,_0x1b0613){return db[_0xd0bb('0x13')][_0xd0bb('0x1f')](_0x165020[_0xd0bb('0x20')],{'raw':_0x165020[_0xd0bb('0x15')]?_0x165020[_0xd0bb('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xd0bb('0x8')](function(_0xcc1c11){logger[_0xd0bb('0x9')](_0xd0bb('0x1e'),_0x165020);logger['debug'](_0xd0bb('0x1e'),_0x165020,JSON[_0xd0bb('0xe')](_0xcc1c11));_0x45b6e1(_0xcc1c11);})[_0xd0bb('0x12')](function(_0x598b27){logger[_0xd0bb('0xf')](_0xd0bb('0x1e'),_0x598b27[_0xd0bb('0x10')],_0x165020);_0x1b0613(_0x185e3c['error'](0x1f4,_0x598b27['message']));});});};exports[_0xd0bb('0x21')]=function(_0x23db6e){var _0x47885d=this;return new Promise(function(_0x5f25b8,_0x5047da){return db[_0xd0bb('0x13')]['update'](_0x23db6e[_0xd0bb('0x20')],{'raw':_0x23db6e['options']?_0x23db6e[_0xd0bb('0x15')][_0xd0bb('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23db6e['options']?_0x23db6e[_0xd0bb('0x15')][_0xd0bb('0x17')]||null:null,'attributes':_0x23db6e['options']?_0x23db6e[_0xd0bb('0x15')][_0xd0bb('0x1c')]||null:null,'limit':_0x23db6e[_0xd0bb('0x15')]?_0x23db6e[_0xd0bb('0x15')]['limit']||null:null})[_0xd0bb('0x8')](function(_0x2f0d77){logger[_0xd0bb('0x9')](_0xd0bb('0x21'),_0x23db6e);logger[_0xd0bb('0xc')](_0xd0bb('0x21'),_0x23db6e,JSON[_0xd0bb('0xe')](_0x2f0d77));_0x5f25b8(_0x2f0d77);})[_0xd0bb('0x12')](function(_0x4c962b){logger[_0xd0bb('0xf')]('UpdateVoiceCallReport',_0x4c962b[_0xd0bb('0x10')],_0x23db6e);_0x5047da(_0x47885d[_0xd0bb('0xf')](0x1f4,_0x4c962b[_0xd0bb('0x10')]));});});};
\ No newline at end of file
index 93ab63f..7093405 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16b3=['create','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','post','isAuthenticated'];(function(_0x2e86a1,_0xf86577){var _0x1a065c=function(_0x1dc4d7){while(--_0x1dc4d7){_0x2e86a1['push'](_0x2e86a1['shift']());}};_0x1a065c(++_0xf86577);}(_0x16b3,0x15a));var _0x316b=function(_0x5e1a9e,_0x279be0){_0x5e1a9e=_0x5e1a9e-0x0;var _0x34d835=_0x16b3[_0x5e1a9e];return _0x34d835;};'use strict';var multer=require(_0x316b('0x0'));var util=require('util');var path=require(_0x316b('0x1'));var timeout=require(_0x316b('0x2'));var express=require('express');var router=express[_0x316b('0x3')]();var fs_extra=require(_0x316b('0x4'));var auth=require(_0x316b('0x5'));var interaction=require(_0x316b('0x6'));var config=require(_0x316b('0x7'));var controller=require(_0x316b('0x8'));router[_0x316b('0x9')]('/',auth['isAuthenticated'](),controller[_0x316b('0xa')]);router[_0x316b('0x9')](_0x316b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x316b('0xc')]('/',auth[_0x316b('0xd')](),controller[_0x316b('0xe')]);router['put'](_0x316b('0xb'),auth[_0x316b('0xd')](),controller[_0x316b('0xf')]);router[_0x316b('0x10')](_0x316b('0xb'),auth[_0x316b('0xd')](),controller['destroy']);module[_0x316b('0x11')]=router;
\ No newline at end of file
+var _0x2a02=['../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x2509cf,_0x2159dd){var _0xf9f111=function(_0x2d0530){while(--_0x2d0530){_0x2509cf['push'](_0x2509cf['shift']());}};_0xf9f111(++_0x2159dd);}(_0x2a02,0x1c5));var _0x22a0=function(_0x954b3a,_0x10a7c1){_0x954b3a=_0x954b3a-0x0;var _0x3a313e=_0x2a02[_0x954b3a];return _0x3a313e;};'use strict';var multer=require(_0x22a0('0x0'));var util=require(_0x22a0('0x1'));var path=require(_0x22a0('0x2'));var timeout=require(_0x22a0('0x3'));var express=require(_0x22a0('0x4'));var router=express['Router']();var fs_extra=require(_0x22a0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22a0('0x6'));var config=require('../../config/environment');var controller=require(_0x22a0('0x7'));router[_0x22a0('0x8')]('/',auth[_0x22a0('0x9')](),controller['index']);router['get'](_0x22a0('0xa'),auth['isAuthenticated'](),controller[_0x22a0('0xb')]);router[_0x22a0('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x22a0('0xd')]('/:id',auth[_0x22a0('0x9')](),controller[_0x22a0('0xe')]);router['delete']('/:id',auth[_0x22a0('0x9')](),controller[_0x22a0('0xf')]);module[_0x22a0('0x10')]=router;
\ No newline at end of file
index 8656ba1..b63c2de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ebf=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','options','getDataValue'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x6ebf,0xca));var _0xf6eb=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x6ebf[_0x1e6659];return _0x4d16e4;};'use strict';var Sequelize=require(_0xf6eb('0x0'));module[_0xf6eb('0x1')]={'name':{'type':Sequelize[_0xf6eb('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xf6eb('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xf6eb('0x2')],'set':function(_0x13bab0){this[_0xf6eb('0x4')]('options',_0x13bab0?_0x13bab0[_0xf6eb('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xf6eb('0x6'))?this[_0xf6eb('0x7')](_0xf6eb('0x6'))[_0xf6eb('0x8')](''):[];}},'auth':{'type':Sequelize[_0xf6eb('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xf6eb('0x2')]},'record':{'type':Sequelize[_0xf6eb('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf6eb('0x2')]},'description':{'type':Sequelize[_0xf6eb('0x2')]}};
\ No newline at end of file
+var _0xf278=['BOOLEAN','exports','name','STRING','options','join','getDataValue'];(function(_0x30842f,_0x17838d){var _0x4e93e9=function(_0x22ce26){while(--_0x22ce26){_0x30842f['push'](_0x30842f['shift']());}};_0x4e93e9(++_0x17838d);}(_0xf278,0xef));var _0x8f27=function(_0x252834,_0x55f763){_0x252834=_0x252834-0x0;var _0x58c864=_0xf278[_0x252834];return _0x58c864;};'use strict';var Sequelize=require('sequelize');module[_0x8f27('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x8f27('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0x8f27('0x2')],'set':function(_0xc3e569){this['setDataValue'](_0x8f27('0x3'),_0xc3e569?_0xc3e569[_0x8f27('0x4')](''):[]);},'get':function(){return this[_0x8f27('0x5')](_0x8f27('0x3'))?this[_0x8f27('0x5')](_0x8f27('0x3'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x8f27('0x2')]},'record':{'type':Sequelize[_0x8f27('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x8f27('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0df0590..8f9e6ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f59=['model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','index','map','VoiceChanSpy','type'];(function(_0x4b3a9a,_0x424acd){var _0x290293=function(_0x3176b2){while(--_0x3176b2){_0x4b3a9a['push'](_0x4b3a9a['shift']());}};_0x290293(++_0x424acd);}(_0x3f59,0x1b0));var _0x93f5=function(_0x390858,_0x3536cf){_0x390858=_0x390858-0x0;var _0x39b23b=_0x3f59[_0x390858];return _0x39b23b;};'use strict';var emlformat=require(_0x93f5('0x0'));var rimraf=require(_0x93f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93f5('0x2'));var rp=require(_0x93f5('0x3'));var moment=require(_0x93f5('0x4'));var BPromise=require(_0x93f5('0x5'));var Mustache=require(_0x93f5('0x6'));var util=require(_0x93f5('0x7'));var path=require(_0x93f5('0x8'));var sox=require(_0x93f5('0x9'));var csv=require(_0x93f5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93f5('0xb'));var squel=require(_0x93f5('0xc'));var crypto=require(_0x93f5('0xd'));var jsforce=require(_0x93f5('0xe'));var deskjs=require(_0x93f5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x93f5('0x10'));var qs=require(_0x93f5('0x11'));var as=require(_0x93f5('0x12'));var hardwareService=require(_0x93f5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x93f5('0x14'));var config=require(_0x93f5('0x15'));var licenseUtil=require(_0x93f5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x789645,_0x4ea7b4){_0x4ea7b4=_0x4ea7b4||0xcc;return function(_0x3e7e84){if(_0x3e7e84){return _0x789645[_0x93f5('0x17')](_0x4ea7b4);}return _0x789645[_0x93f5('0x18')](_0x4ea7b4)[_0x93f5('0x19')]();};}function respondWithResult(_0x3d85da,_0x45a275){_0x45a275=_0x45a275||0xc8;return function(_0x5d6001){if(_0x5d6001){return _0x3d85da[_0x93f5('0x18')](_0x45a275)[_0x93f5('0x1a')](_0x5d6001);}};}function respondWithFilteredResult(_0xe145df,_0x2ab5ce){return function(_0x316fb2){if(_0x316fb2){var _0x22bcd7=typeof _0x2ab5ce[_0x93f5('0x1b')]===_0x93f5('0x1c')&&typeof _0x2ab5ce[_0x93f5('0x1d')]===_0x93f5('0x1c');var _0x46a05d=_0x316fb2[_0x93f5('0x1e')];var _0x4df4ec=_0x22bcd7?0x0:_0x2ab5ce[_0x93f5('0x1b')];var _0x3180f2=_0x22bcd7?_0x316fb2[_0x93f5('0x1e')]:_0x2ab5ce[_0x93f5('0x1b')]+_0x2ab5ce[_0x93f5('0x1d')];var _0x569c0c;if(_0x3180f2>=_0x46a05d){_0x3180f2=_0x46a05d;_0x569c0c=0xc8;}else{_0x569c0c=0xce;}_0xe145df[_0x93f5('0x18')](_0x569c0c);return _0xe145df[_0x93f5('0x1f')](_0x93f5('0x20'),_0x4df4ec+'-'+_0x3180f2+'/'+_0x46a05d)[_0x93f5('0x1a')](_0x316fb2);}return null;};}function patchUpdates(_0x3fc4ab){return function(_0xb44720){try{jsonpatch[_0x93f5('0x21')](_0xb44720,_0x3fc4ab,!![]);}catch(_0x257aa8){return BPromise[_0x93f5('0x22')](_0x257aa8);}return _0xb44720[_0x93f5('0x23')]();};}function saveUpdates(_0x2ef296,_0xb59065){return function(_0x330869){if(_0x330869){return _0x330869['update'](_0x2ef296)[_0x93f5('0x24')](function(_0x27bde4){return _0x27bde4;});}return null;};}function removeEntity(_0x34f8ce,_0x3ffe51){return function(_0x365afd){if(_0x365afd){return _0x365afd[_0x93f5('0x25')]()['then'](function(){var _0x10fb86=_0x365afd[_0x93f5('0x26')]({'plain':!![]});var _0x54955f=_0x93f5('0x27');return db[_0x93f5('0x28')]['destroy']({'where':{'type':_0x54955f,'resourceId':_0x10fb86['id']}})['then'](function(){return _0x365afd;});})[_0x93f5('0x24')](function(){_0x34f8ce[_0x93f5('0x18')](0xcc)[_0x93f5('0x19')]();});}};}function handleEntityNotFound(_0x2dd1a2,_0x5d71d4){return function(_0x2bc6d1){if(!_0x2bc6d1){_0x2dd1a2['sendStatus'](0x194);}return _0x2bc6d1;};}function handleError(_0x46f209,_0x34398d){_0x34398d=_0x34398d||0x1f4;return function(_0x56d867){logger[_0x93f5('0x29')](_0x56d867[_0x93f5('0x2a')]);if(_0x56d867[_0x93f5('0x2b')]){delete _0x56d867['name'];}_0x46f209[_0x93f5('0x18')](_0x34398d)['send'](_0x56d867);};}exports[_0x93f5('0x2c')]=function(_0x5c2ede,_0x448b5a){var _0x2484bc={},_0x4a7784={},_0x1ce4ba={'count':0x0,'rows':[]};var _0x1c0dcd=_[_0x93f5('0x2d')](db[_0x93f5('0x2e')]['rawAttributes'],function(_0x4438c3){return{'name':_0x4438c3['fieldName'],'type':_0x4438c3[_0x93f5('0x2f')]['key']};});_0x4a7784[_0x93f5('0x30')]=_[_0x93f5('0x2d')](_0x1c0dcd,_0x93f5('0x2b'));_0x4a7784[_0x93f5('0x31')]=_['keys'](_0x5c2ede[_0x93f5('0x31')]);_0x4a7784[_0x93f5('0x32')]=_[_0x93f5('0x33')](_0x4a7784[_0x93f5('0x30')],_0x4a7784['query']);_0x2484bc[_0x93f5('0x34')]=_['intersection'](_0x4a7784[_0x93f5('0x30')],qs[_0x93f5('0x35')](_0x5c2ede[_0x93f5('0x31')][_0x93f5('0x35')]));_0x2484bc['attributes']=_0x2484bc[_0x93f5('0x34')]['length']?_0x2484bc[_0x93f5('0x34')]:_0x4a7784['model'];if(!_0x5c2ede['query'][_0x93f5('0x36')](_0x93f5('0x37'))){_0x2484bc[_0x93f5('0x1d')]=qs['limit'](_0x5c2ede[_0x93f5('0x31')][_0x93f5('0x1d')]);_0x2484bc['offset']=qs[_0x93f5('0x1b')](_0x5c2ede['query'][_0x93f5('0x1b')]);}_0x2484bc['order']=qs[_0x93f5('0x38')](_0x5c2ede[_0x93f5('0x31')][_0x93f5('0x38')]);_0x2484bc[_0x93f5('0x39')]=qs[_0x93f5('0x32')](_['pick'](_0x5c2ede[_0x93f5('0x31')],_0x4a7784[_0x93f5('0x32')]),_0x1c0dcd);if(_0x5c2ede[_0x93f5('0x31')][_0x93f5('0x3a')]){_0x2484bc[_0x93f5('0x39')]=_[_0x93f5('0x3b')](_0x2484bc['where'],{'$or':_[_0x93f5('0x2d')](_0x1c0dcd,function(_0x458661){if(_0x458661[_0x93f5('0x2f')]!==_0x93f5('0x3c')){var _0x20b873={};_0x20b873[_0x458661[_0x93f5('0x2b')]]={'$like':'%'+_0x5c2ede['query'][_0x93f5('0x3a')]+'%'};return _0x20b873;}})});}_0x2484bc=_['merge']({},_0x2484bc,_0x5c2ede[_0x93f5('0x3d')]);var _0x286de9={'where':_0x2484bc['where']};return db[_0x93f5('0x2e')][_0x93f5('0x1e')](_0x286de9)[_0x93f5('0x24')](function(_0x136e51){_0x1ce4ba['count']=_0x136e51;if(_0x5c2ede[_0x93f5('0x31')]['includeAll']){_0x2484bc[_0x93f5('0x3e')]=[{'all':!![]}];}return db[_0x93f5('0x2e')][_0x93f5('0x3f')](_0x2484bc);})[_0x93f5('0x24')](function(_0xd4d915){_0x1ce4ba[_0x93f5('0x40')]=_0xd4d915;return _0x1ce4ba;})[_0x93f5('0x24')](respondWithFilteredResult(_0x448b5a,_0x2484bc))['catch'](handleError(_0x448b5a,null));};exports[_0x93f5('0x41')]=function(_0x33184b,_0x1b7bd9){var _0x191168={'raw':![],'where':{'id':_0x33184b[_0x93f5('0x42')]['id']}},_0x108c82={};_0x108c82[_0x93f5('0x30')]=_[_0x93f5('0x43')](db['VoiceChanSpy']['rawAttributes']);_0x108c82[_0x93f5('0x31')]=_['keys'](_0x33184b[_0x93f5('0x31')]);_0x108c82['filters']=_[_0x93f5('0x33')](_0x108c82[_0x93f5('0x30')],_0x108c82['query']);_0x191168['attributes']=_[_0x93f5('0x33')](_0x108c82['model'],qs[_0x93f5('0x35')](_0x33184b[_0x93f5('0x31')]['fields']));_0x191168[_0x93f5('0x34')]=_0x191168[_0x93f5('0x34')][_0x93f5('0x44')]?_0x191168[_0x93f5('0x34')]:_0x108c82['model'];if(_0x33184b[_0x93f5('0x31')]['includeAll']){_0x191168[_0x93f5('0x3e')]=[{'all':!![]}];}_0x191168=_[_0x93f5('0x3b')]({},_0x191168,_0x33184b['options']);return db['VoiceChanSpy'][_0x93f5('0x45')](_0x191168)[_0x93f5('0x24')](handleEntityNotFound(_0x1b7bd9,null))['then'](respondWithResult(_0x1b7bd9,null))[_0x93f5('0x46')](handleError(_0x1b7bd9,null));};exports[_0x93f5('0x47')]=function(_0xad4687,_0x576500){return db['VoiceChanSpy'][_0x93f5('0x47')](_0xad4687[_0x93f5('0x48')],{})['then'](function(_0xbc49c2){var _0x5e3d60=_0xad4687[_0x93f5('0x49')][_0x93f5('0x26')]({'plain':!![]});if(!_0x5e3d60)throw new Error(_0x93f5('0x4a'));if(_0x5e3d60[_0x93f5('0x4b')]===_0x93f5('0x49')){var _0x2e5524=_0xbc49c2[_0x93f5('0x26')]({'plain':!![]});var _0x14e053=_0x93f5('0x27');return db[_0x93f5('0x4c')][_0x93f5('0x45')]({'where':{'name':_0x14e053,'userProfileId':_0x5e3d60[_0x93f5('0x4d')]},'raw':!![]})[_0x93f5('0x24')](function(_0x172781){if(_0x172781&&_0x172781[_0x93f5('0x4e')]===0x0){return db[_0x93f5('0x28')][_0x93f5('0x47')]({'name':_0x2e5524[_0x93f5('0x2b')],'resourceId':_0x2e5524['id'],'type':_0x172781[_0x93f5('0x2b')],'sectionId':_0x172781['id']},{})['then'](function(){return _0xbc49c2;});}else{return _0xbc49c2;}})[_0x93f5('0x46')](function(_0x4c0810){logger['error'](_0x93f5('0x4f'),_0x4c0810);throw _0x4c0810;});}return _0xbc49c2;})['then'](respondWithResult(_0x576500,0xc9))[_0x93f5('0x46')](handleError(_0x576500,null));};exports['update']=function(_0x4366d7,_0xe506a2){if(_0x4366d7['body']['id']){delete _0x4366d7['body']['id'];}return db[_0x93f5('0x2e')]['find']({'where':{'id':_0x4366d7[_0x93f5('0x42')]['id']}})[_0x93f5('0x24')](handleEntityNotFound(_0xe506a2,null))[_0x93f5('0x24')](saveUpdates(_0x4366d7['body'],null))['then'](respondWithResult(_0xe506a2,null))[_0x93f5('0x46')](handleError(_0xe506a2,null));};exports['destroy']=function(_0x4c6bbf,_0x4c6383){return db['VoiceChanSpy'][_0x93f5('0x45')]({'where':{'id':_0x4c6bbf[_0x93f5('0x42')]['id']}})[_0x93f5('0x24')](handleEntityNotFound(_0x4c6383,null))[_0x93f5('0x24')](removeEntity(_0x4c6383,null))['catch'](handleError(_0x4c6383,null));};
\ No newline at end of file
+var _0x2a41=['filter','includeAll','include','findAll','rows','catch','show','params','options','find','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','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','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','ChanSpies','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0x2a41,0x126));var _0x12a4=function(_0xf73390,_0x14c109){_0xf73390=_0xf73390-0x0;var _0x4b212f=_0x2a41[_0xf73390];return _0x4b212f;};'use strict';var emlformat=require(_0x12a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12a4('0x1'));var jsonpatch=require(_0x12a4('0x2'));var rp=require(_0x12a4('0x3'));var moment=require(_0x12a4('0x4'));var BPromise=require(_0x12a4('0x5'));var Mustache=require(_0x12a4('0x6'));var util=require(_0x12a4('0x7'));var path=require(_0x12a4('0x8'));var sox=require(_0x12a4('0x9'));var csv=require('to-csv');var ejs=require(_0x12a4('0xa'));var fs=require('fs');var fs_extra=require(_0x12a4('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12a4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x12a4('0xd'));var toCsv=require(_0x12a4('0xe'));var querystring=require(_0x12a4('0xf'));var Papa=require(_0x12a4('0x10'));var Redis=require(_0x12a4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x12a4('0x12'));var as=require(_0x12a4('0x13'));var hardwareService=require(_0x12a4('0x14'));var logger=require(_0x12a4('0x15'))(_0x12a4('0x16'));var utils=require(_0x12a4('0x17'));var config=require(_0x12a4('0x18'));var licenseUtil=require(_0x12a4('0x19'));var db=require(_0x12a4('0x1a'))['db'];function respondWithStatusCode(_0x197554,_0x28059a){_0x28059a=_0x28059a||0xcc;return function(_0x2c939e){if(_0x2c939e){return _0x197554['sendStatus'](_0x28059a);}return _0x197554[_0x12a4('0x1b')](_0x28059a)[_0x12a4('0x1c')]();};}function respondWithResult(_0x1af5f8,_0x22cfde){_0x22cfde=_0x22cfde||0xc8;return function(_0x2b6e72){if(_0x2b6e72){return _0x1af5f8['status'](_0x22cfde)['json'](_0x2b6e72);}};}function respondWithFilteredResult(_0x257d27,_0x2ccfce){return function(_0x2428ba){if(_0x2428ba){var _0x1cce66=typeof _0x2ccfce['offset']===_0x12a4('0x1d')&&typeof _0x2ccfce[_0x12a4('0x1e')]===_0x12a4('0x1d');var _0x25d54f=_0x2428ba[_0x12a4('0x1f')];var _0xe274e1=_0x1cce66?0x0:_0x2ccfce['offset'];var _0x1a6bbe=_0x1cce66?_0x2428ba[_0x12a4('0x1f')]:_0x2ccfce[_0x12a4('0x20')]+_0x2ccfce['limit'];var _0x569763;if(_0x1a6bbe>=_0x25d54f){_0x1a6bbe=_0x25d54f;_0x569763=0xc8;}else{_0x569763=0xce;}_0x257d27[_0x12a4('0x1b')](_0x569763);return _0x257d27[_0x12a4('0x21')](_0x12a4('0x22'),_0xe274e1+'-'+_0x1a6bbe+'/'+_0x25d54f)[_0x12a4('0x23')](_0x2428ba);}return null;};}function patchUpdates(_0x1a35d3){return function(_0x5c92e8){try{jsonpatch[_0x12a4('0x24')](_0x5c92e8,_0x1a35d3,!![]);}catch(_0x5617d6){return BPromise[_0x12a4('0x25')](_0x5617d6);}return _0x5c92e8[_0x12a4('0x26')]();};}function saveUpdates(_0x40bf8e,_0x475939){return function(_0x17a4cc){if(_0x17a4cc){return _0x17a4cc['update'](_0x40bf8e)[_0x12a4('0x27')](function(_0x188930){return _0x188930;});}return null;};}function removeEntity(_0x35e966,_0x1c4255){return function(_0x499b22){if(_0x499b22){return _0x499b22[_0x12a4('0x28')]()[_0x12a4('0x27')](function(){var _0x376a74=_0x499b22['get']({'plain':!![]});var _0x395749=_0x12a4('0x29');return db['UserProfileResource'][_0x12a4('0x28')]({'where':{'type':_0x395749,'resourceId':_0x376a74['id']}})[_0x12a4('0x27')](function(){return _0x499b22;});})['then'](function(){_0x35e966['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41e832,_0x6ac80c){return function(_0x3314da){if(!_0x3314da){_0x41e832[_0x12a4('0x2a')](0x194);}return _0x3314da;};}function handleError(_0x4843f8,_0x443c90){_0x443c90=_0x443c90||0x1f4;return function(_0x56c3da){logger[_0x12a4('0x2b')](_0x56c3da[_0x12a4('0x2c')]);if(_0x56c3da[_0x12a4('0x2d')]){delete _0x56c3da[_0x12a4('0x2d')];}_0x4843f8['status'](_0x443c90)[_0x12a4('0x2e')](_0x56c3da);};}exports[_0x12a4('0x2f')]=function(_0x4e38f7,_0x283668){var _0x4cff97={},_0x36edf3={},_0x2de4d5={'count':0x0,'rows':[]};var _0x534ab5=_[_0x12a4('0x30')](db[_0x12a4('0x31')][_0x12a4('0x32')],function(_0x5ce983){return{'name':_0x5ce983[_0x12a4('0x33')],'type':_0x5ce983['type'][_0x12a4('0x34')]};});_0x36edf3[_0x12a4('0x35')]=_[_0x12a4('0x30')](_0x534ab5,_0x12a4('0x2d'));_0x36edf3[_0x12a4('0x36')]=_[_0x12a4('0x37')](_0x4e38f7['query']);_0x36edf3[_0x12a4('0x38')]=_[_0x12a4('0x39')](_0x36edf3[_0x12a4('0x35')],_0x36edf3['query']);_0x4cff97['attributes']=_[_0x12a4('0x39')](_0x36edf3['model'],qs[_0x12a4('0x3a')](_0x4e38f7[_0x12a4('0x36')]['fields']));_0x4cff97[_0x12a4('0x3b')]=_0x4cff97[_0x12a4('0x3b')][_0x12a4('0x3c')]?_0x4cff97[_0x12a4('0x3b')]:_0x36edf3['model'];if(!_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x3d')](_0x12a4('0x3e'))){_0x4cff97[_0x12a4('0x1e')]=qs[_0x12a4('0x1e')](_0x4e38f7['query']['limit']);_0x4cff97[_0x12a4('0x20')]=qs['offset'](_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x20')]);}_0x4cff97[_0x12a4('0x3f')]=qs[_0x12a4('0x40')](_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x40')]);_0x4cff97[_0x12a4('0x41')]=qs[_0x12a4('0x38')](_[_0x12a4('0x42')](_0x4e38f7[_0x12a4('0x36')],_0x36edf3['filters']),_0x534ab5);if(_0x4e38f7['query']['filter']){_0x4cff97[_0x12a4('0x41')]=_[_0x12a4('0x43')](_0x4cff97['where'],{'$or':_[_0x12a4('0x30')](_0x534ab5,function(_0x1841c){if(_0x1841c[_0x12a4('0x44')]!==_0x12a4('0x45')){var _0x146713={};_0x146713[_0x1841c[_0x12a4('0x2d')]]={'$like':'%'+_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x46')]+'%'};return _0x146713;}})});}_0x4cff97=_[_0x12a4('0x43')]({},_0x4cff97,_0x4e38f7['options']);var _0x9f6fa8={'where':_0x4cff97['where']};return db[_0x12a4('0x31')][_0x12a4('0x1f')](_0x9f6fa8)[_0x12a4('0x27')](function(_0x2826fb){_0x2de4d5[_0x12a4('0x1f')]=_0x2826fb;if(_0x4e38f7['query'][_0x12a4('0x47')]){_0x4cff97[_0x12a4('0x48')]=[{'all':!![]}];}return db[_0x12a4('0x31')][_0x12a4('0x49')](_0x4cff97);})[_0x12a4('0x27')](function(_0xf2751e){_0x2de4d5[_0x12a4('0x4a')]=_0xf2751e;return _0x2de4d5;})['then'](respondWithFilteredResult(_0x283668,_0x4cff97))[_0x12a4('0x4b')](handleError(_0x283668,null));};exports[_0x12a4('0x4c')]=function(_0x44c499,_0x2745b7){var _0x33143b={'raw':![],'where':{'id':_0x44c499[_0x12a4('0x4d')]['id']}},_0x331605={};_0x331605[_0x12a4('0x35')]=_[_0x12a4('0x37')](db[_0x12a4('0x31')][_0x12a4('0x32')]);_0x331605['query']=_[_0x12a4('0x37')](_0x44c499[_0x12a4('0x36')]);_0x331605[_0x12a4('0x38')]=_['intersection'](_0x331605['model'],_0x331605[_0x12a4('0x36')]);_0x33143b[_0x12a4('0x3b')]=_[_0x12a4('0x39')](_0x331605['model'],qs[_0x12a4('0x3a')](_0x44c499[_0x12a4('0x36')][_0x12a4('0x3a')]));_0x33143b[_0x12a4('0x3b')]=_0x33143b['attributes']['length']?_0x33143b['attributes']:_0x331605['model'];if(_0x44c499[_0x12a4('0x36')][_0x12a4('0x47')]){_0x33143b[_0x12a4('0x48')]=[{'all':!![]}];}_0x33143b=_[_0x12a4('0x43')]({},_0x33143b,_0x44c499[_0x12a4('0x4e')]);return db['VoiceChanSpy'][_0x12a4('0x4f')](_0x33143b)[_0x12a4('0x27')](handleEntityNotFound(_0x2745b7,null))[_0x12a4('0x27')](respondWithResult(_0x2745b7,null))['catch'](handleError(_0x2745b7,null));};exports['create']=function(_0x41516b,_0x11ef07){return db['VoiceChanSpy']['create'](_0x41516b['body'],{})[_0x12a4('0x27')](function(_0x3ad94c){var _0x417ad5=_0x41516b['user'][_0x12a4('0x50')]({'plain':!![]});if(!_0x417ad5)throw new Error(_0x12a4('0x51'));if(_0x417ad5['role']===_0x12a4('0x52')){var _0x10f12e=_0x3ad94c[_0x12a4('0x50')]({'plain':!![]});var _0x2688c5=_0x12a4('0x29');return db[_0x12a4('0x53')]['find']({'where':{'name':_0x2688c5,'userProfileId':_0x417ad5[_0x12a4('0x54')]},'raw':!![]})['then'](function(_0x33a817){if(_0x33a817&&_0x33a817[_0x12a4('0x55')]===0x0){return db[_0x12a4('0x56')][_0x12a4('0x57')]({'name':_0x10f12e[_0x12a4('0x2d')],'resourceId':_0x10f12e['id'],'type':_0x33a817[_0x12a4('0x2d')],'sectionId':_0x33a817['id']},{})[_0x12a4('0x27')](function(){return _0x3ad94c;});}else{return _0x3ad94c;}})['catch'](function(_0xc5669b){logger[_0x12a4('0x2b')](_0x12a4('0x58'),_0xc5669b);throw _0xc5669b;});}return _0x3ad94c;})[_0x12a4('0x27')](respondWithResult(_0x11ef07,0xc9))[_0x12a4('0x4b')](handleError(_0x11ef07,null));};exports[_0x12a4('0x59')]=function(_0x2e2e07,_0x3521cb){if(_0x2e2e07[_0x12a4('0x5a')]['id']){delete _0x2e2e07[_0x12a4('0x5a')]['id'];}return db[_0x12a4('0x31')][_0x12a4('0x4f')]({'where':{'id':_0x2e2e07[_0x12a4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3521cb,null))[_0x12a4('0x27')](saveUpdates(_0x2e2e07[_0x12a4('0x5a')],null))[_0x12a4('0x27')](respondWithResult(_0x3521cb,null))[_0x12a4('0x4b')](handleError(_0x3521cb,null));};exports['destroy']=function(_0x2c95a8,_0x5720cf){return db[_0x12a4('0x31')][_0x12a4('0x4f')]({'where':{'id':_0x2c95a8[_0x12a4('0x4d')]['id']}})[_0x12a4('0x27')](handleEntityNotFound(_0x5720cf,null))[_0x12a4('0x27')](removeEntity(_0x5720cf,null))[_0x12a4('0x4b')](handleError(_0x5720cf,null));};
\ No newline at end of file
index 41ffc95..48d82d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35a3=['./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','record','concat','internal','User','catch','define','VoiceChanSpy','then','length','VoiceExtension','destroy','lodash','util','bluebird'];(function(_0x9e05d1,_0x3cef4a){var _0x4f7e97=function(_0x402f40){while(--_0x402f40){_0x9e05d1['push'](_0x9e05d1['shift']());}};_0x4f7e97(++_0x3cef4a);}(_0x35a3,0x151));var _0x335a=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x35a3[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x335a('0x0'));var util=require(_0x335a('0x1'));var BPromise=require(_0x335a('0x2'));var attributes=require(_0x335a('0x3'));var getUserApplications=function(_0x22d20a,_0x5ad0cb,_0xaf9905){var _0x37d5a8=0x1;var _0xefa808=[];var _0x52a9c6={'context':_0x5ad0cb[_0x335a('0x4')]||'from-sip','exten':util[_0x335a('0x5')](_0x335a('0x6'),_0x22d20a[_0x335a('0x7')],_0xaf9905),'type':_0x335a('0x8'),'isApp':![],'ChanSpyId':_0x22d20a['id'],'UserId':_0x5ad0cb['id']};_0xefa808[_0x335a('0x9')](_[_0x335a('0xa')]({'app':'Set','appdata':util[_0x335a('0x5')](_0x335a('0xb'),_0x335a('0xc')),'priority':_0x37d5a8++},_0x52a9c6));if(_0x22d20a['record']){_0xefa808['push'](_[_0x335a('0xa')]({'app':_0x335a('0xd'),'appdata':util[_0x335a('0x5')](_0x335a('0xe'),_0x22d20a[_0x335a('0xf')]),'priority':_0x37d5a8++},_0x52a9c6));}if(_0x22d20a[_0x335a('0x10')]){_0xefa808[_0x335a('0x9')](_[_0x335a('0xa')]({'app':_0x335a('0x11'),'appdata':_0x22d20a['password'],'priority':_0x37d5a8++},_0x52a9c6));}_0xefa808[_0x335a('0x9')](_[_0x335a('0xa')]({'app':_0x335a('0x12'),'appdata':util[_0x335a('0x5')](_0x335a('0x13'),_0x5ad0cb[_0x335a('0x14')],_0x22d20a[_0x335a('0x15')]?_0x22d20a[_0x335a('0x15')][_0x335a('0x16')](''):''),'priority':_0x37d5a8++},_0x52a9c6));if(_0x22d20a[_0x335a('0x17')]){_0xefa808[_0x335a('0x9')](_['merge']({'app':'StopMixMonitor','priority':_0x37d5a8++},_0x52a9c6));}return _0xefa808;};var getChanSpyApplications=function(_0x510e5e,_0x13fe4e){var _0x4a7cb8=[];for(var _0x5a7d3c=0x0,_0x40b39e=0x1;_0x5a7d3c<_0x13fe4e['length'];_0x5a7d3c++,_0x40b39e=0x1){_0x4a7cb8=_0x4a7cb8[_0x335a('0x18')](getUserApplications(_0x510e5e,_0x13fe4e[_0x5a7d3c],_0x13fe4e[_0x5a7d3c]['internal']));if(_0x13fe4e[_0x5a7d3c][_0x335a('0x19')]!=_0x13fe4e[_0x5a7d3c]['name']){_0x4a7cb8=_0x4a7cb8[_0x335a('0x18')](getUserApplications(_0x510e5e,_0x13fe4e[_0x5a7d3c],_0x13fe4e[_0x5a7d3c][_0x335a('0x14')]));}}return _0x4a7cb8;};var getChanSpyPromise=function(_0x40fa22,_0x32e373){return new BPromise(function(_0x4f99d4,_0x574055){return _0x40fa22[_0x335a('0x1a')]['findAll']({'attributes':['id',_0x335a('0x14'),_0x335a('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x40051c){if(_0x40051c){return _0x4f99d4(getChanSpyApplications(_0x32e373,_0x40051c));}return _0x4f99d4([]);})[_0x335a('0x1b')](function(_0x3ac596){_0x574055(_0x3ac596);});});};module['exports']=function(_0x2f037d,_0x3d542e){var _0x21ae01=_0x2f037d['models'];return _0x2f037d[_0x335a('0x1c')](_0x335a('0x1d'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x123301,_0x24350a,_0xb65547){return getChanSpyPromise(_0x21ae01,_0x123301)[_0x335a('0x1e')](function(_0xb6c458){if(_0xb6c458&&_0xb6c458[_0x335a('0x1f')]){return _0x21ae01[_0x335a('0x20')]['bulkCreate'](_0xb6c458);}})[_0x335a('0x1e')](function(){_0xb65547();})[_0x335a('0x1b')](function(_0x33a508){_0xb65547(_0x33a508);});},'afterUpdate':function(_0x586053,_0x554672,_0x5a8c88){return _0x21ae01[_0x335a('0x20')][_0x335a('0x21')]({'where':{'ChanSpyId':_0x586053['id']}})[_0x335a('0x1e')](function(){return getChanSpyPromise(_0x21ae01,_0x586053);})[_0x335a('0x1e')](function(_0xf96cfc){if(_0xf96cfc&&_0xf96cfc[_0x335a('0x1f')]){return _0x21ae01[_0x335a('0x20')]['bulkCreate'](_0xf96cfc);}})[_0x335a('0x1e')](function(){_0x5a8c88();})['catch'](function(_0x211b49){_0x5a8c88(_0x211b49);});},'afterDestroy':function(_0x11c686,_0x38fc9f,_0x56bcff){return _0x21ae01[_0x335a('0x20')]['destroy']({'where':{'ChanSpyId':_0x11c686['id']}})[_0x335a('0x1e')](function(){_0x56bcff();})['catch'](function(_0x43251a){_0x56bcff(_0x43251a);});}}});};
\ No newline at end of file
+var _0x93e2=['options','join','StopMixMonitor','length','concat','internal','name','User','then','catch','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s'];(function(_0x56b886,_0x1ff474){var _0x164baf=function(_0x575d09){while(--_0x575d09){_0x56b886['push'](_0x56b886['shift']());}};_0x164baf(++_0x1ff474);}(_0x93e2,0x83));var _0x293e=function(_0x5850a9,_0x242f9f){_0x5850a9=_0x5850a9-0x0;var _0x2d05e7=_0x93e2[_0x5850a9];return _0x2d05e7;};'use strict';var _=require(_0x293e('0x0'));var util=require(_0x293e('0x1'));var BPromise=require(_0x293e('0x2'));var attributes=require(_0x293e('0x3'));var getUserApplications=function(_0x3a17f8,_0x25b204,_0x3d07c4){var _0x1bf000=0x1;var _0x449138=[];var _0x3f7ac6={'context':_0x25b204[_0x293e('0x4')]||'from-sip','exten':util[_0x293e('0x5')](_0x293e('0x6'),_0x3a17f8[_0x293e('0x7')],_0x3d07c4),'type':_0x293e('0x8'),'isApp':![],'ChanSpyId':_0x3a17f8['id'],'UserId':_0x25b204['id']};_0x449138[_0x293e('0x9')](_['merge']({'app':'Set','appdata':util[_0x293e('0x5')](_0x293e('0xa'),_0x293e('0xb')),'priority':_0x1bf000++},_0x3f7ac6));if(_0x3a17f8[_0x293e('0xc')]){_0x449138[_0x293e('0x9')](_[_0x293e('0xd')]({'app':_0x293e('0xe'),'appdata':util[_0x293e('0x5')](_0x293e('0xf'),_0x3a17f8[_0x293e('0x10')]),'priority':_0x1bf000++},_0x3f7ac6));}if(_0x3a17f8[_0x293e('0x11')]){_0x449138[_0x293e('0x9')](_[_0x293e('0xd')]({'app':'Authenticate','appdata':_0x3a17f8[_0x293e('0x12')],'priority':_0x1bf000++},_0x3f7ac6));}_0x449138['push'](_['merge']({'app':_0x293e('0x13'),'appdata':util[_0x293e('0x5')](_0x293e('0x14'),_0x25b204['name'],_0x3a17f8[_0x293e('0x15')]?_0x3a17f8['options'][_0x293e('0x16')](''):''),'priority':_0x1bf000++},_0x3f7ac6));if(_0x3a17f8[_0x293e('0xc')]){_0x449138[_0x293e('0x9')](_[_0x293e('0xd')]({'app':_0x293e('0x17'),'priority':_0x1bf000++},_0x3f7ac6));}return _0x449138;};var getChanSpyApplications=function(_0x2c8fe5,_0xb2e275){var _0x2d4cff=[];for(var _0x2a72ac=0x0,_0x1befca=0x1;_0x2a72ac<_0xb2e275[_0x293e('0x18')];_0x2a72ac++,_0x1befca=0x1){_0x2d4cff=_0x2d4cff[_0x293e('0x19')](getUserApplications(_0x2c8fe5,_0xb2e275[_0x2a72ac],_0xb2e275[_0x2a72ac][_0x293e('0x1a')]));if(_0xb2e275[_0x2a72ac]['internal']!=_0xb2e275[_0x2a72ac][_0x293e('0x1b')]){_0x2d4cff=_0x2d4cff['concat'](getUserApplications(_0x2c8fe5,_0xb2e275[_0x2a72ac],_0xb2e275[_0x2a72ac][_0x293e('0x1b')]));}}return _0x2d4cff;};var getChanSpyPromise=function(_0x5911fe,_0x399361){return new BPromise(function(_0x1a05c4,_0x50f367){return _0x5911fe[_0x293e('0x1c')]['findAll']({'attributes':['id',_0x293e('0x1b'),_0x293e('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x293e('0x1d')](function(_0x5cf6ad){if(_0x5cf6ad){return _0x1a05c4(getChanSpyApplications(_0x399361,_0x5cf6ad));}return _0x1a05c4([]);})[_0x293e('0x1e')](function(_0x5476bf){_0x50f367(_0x5476bf);});});};module['exports']=function(_0x33987b,_0x498e2e){var _0x1b4959=_0x33987b[_0x293e('0x1f')];return _0x33987b[_0x293e('0x20')](_0x293e('0x21'),attributes,{'tableName':_0x293e('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xcaafd6,_0x2bf749,_0x1ab5e9){return getChanSpyPromise(_0x1b4959,_0xcaafd6)[_0x293e('0x1d')](function(_0x2ffa0d){if(_0x2ffa0d&&_0x2ffa0d[_0x293e('0x18')]){return _0x1b4959['VoiceExtension'][_0x293e('0x23')](_0x2ffa0d);}})[_0x293e('0x1d')](function(){_0x1ab5e9();})[_0x293e('0x1e')](function(_0x22bd62){_0x1ab5e9(_0x22bd62);});},'afterUpdate':function(_0x2c82e4,_0x2a1774,_0x52134d){return _0x1b4959[_0x293e('0x24')]['destroy']({'where':{'ChanSpyId':_0x2c82e4['id']}})[_0x293e('0x1d')](function(){return getChanSpyPromise(_0x1b4959,_0x2c82e4);})[_0x293e('0x1d')](function(_0x1e3767){if(_0x1e3767&&_0x1e3767[_0x293e('0x18')]){return _0x1b4959[_0x293e('0x24')][_0x293e('0x23')](_0x1e3767);}})['then'](function(){_0x52134d();})[_0x293e('0x1e')](function(_0x3f4aec){_0x52134d(_0x3f4aec);});},'afterDestroy':function(_0x690f,_0x5bd3bd,_0x1d196){return _0x1b4959[_0x293e('0x24')][_0x293e('0x25')]({'where':{'ChanSpyId':_0x690f['id']}})[_0x293e('0x1d')](function(){_0x1d196();})[_0x293e('0x1e')](function(_0x2aca75){_0x1d196(_0x2aca75);});}}});};
\ No newline at end of file
index 03ad31a..003cb8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d1=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x20b063,_0x470c4b){var _0x21e7cc=function(_0x3c0f9a){while(--_0x3c0f9a){_0x20b063['push'](_0x20b063['shift']());}};_0x21e7cc(++_0x470c4b);}(_0xd3d1,0x172));var _0x1d3d=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd3d1[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d3d('0x2'));var fs=require('fs');var Redis=require(_0x1d3d('0x3'));var db=require(_0x1d3d('0x4'))['db'];var utils=require(_0x1d3d('0x5'));var logger=require(_0x1d3d('0x6'))(_0x1d3d('0x7'));var config=require(_0x1d3d('0x8'));var jayson=require(_0x1d3d('0x9'));var client=jayson[_0x1d3d('0xa')][_0x1d3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3831ce,_0xb1b3c6,_0xe10bca){return new BPromise(function(_0x2c377c,_0xbea61e){return client[_0x1d3d('0xc')](_0x3831ce,_0xe10bca)[_0x1d3d('0xd')](function(_0x510a37){logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0xb1b3c6,_0x1d3d('0x10'));logger[_0x1d3d('0x11')](_0x1d3d('0x12'),_0xb1b3c6,_0x1d3d('0x10'),JSON[_0x1d3d('0x13')](_0x510a37));if(_0x510a37[_0x1d3d('0x14')]){if(_0x510a37[_0x1d3d('0x14')][_0x1d3d('0x15')]===0x1f4){logger[_0x1d3d('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0xb1b3c6,_0x510a37[_0x1d3d('0x14')][_0x1d3d('0x16')]);return _0xbea61e(_0x510a37['error']['message']);}logger[_0x1d3d('0x14')](_0x1d3d('0xf'),_0xb1b3c6,_0x510a37[_0x1d3d('0x14')]['message']);return _0x2c377c(_0x510a37[_0x1d3d('0x14')]['message']);}else{logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0xb1b3c6,_0x1d3d('0x10'));_0x2c377c(_0x510a37[_0x1d3d('0x17')][_0x1d3d('0x16')]);}})[_0x1d3d('0x18')](function(_0x3dcb67){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0xb1b3c6,_0x3dcb67);_0xbea61e(_0x3dcb67);});});}
\ No newline at end of file
+var _0xb921=['info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x39ff0c,_0x2069c7){var _0x5c4ca6=function(_0xa4ffba){while(--_0xa4ffba){_0x39ff0c['push'](_0x39ff0c['shift']());}};_0x5c4ca6(++_0x2069c7);}(_0xb921,0x16a));var _0x1b92=function(_0x44db50,_0x5ecc02){_0x44db50=_0x44db50-0x0;var _0x2647ff=_0xb921[_0x44db50];return _0x2647ff;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var moment=require(_0x1b92('0x2'));var BPromise=require(_0x1b92('0x3'));var rs=require(_0x1b92('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b92('0x5'));var logger=require(_0x1b92('0x6'))(_0x1b92('0x7'));var config=require(_0x1b92('0x8'));var jayson=require(_0x1b92('0x9'));var client=jayson[_0x1b92('0xa')][_0x1b92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8a6282,_0x7973df,_0x352406){return new BPromise(function(_0x1545f9,_0x64a3ed){return client[_0x1b92('0xc')](_0x8a6282,_0x352406)[_0x1b92('0xd')](function(_0x4567ab){logger['info'](_0x1b92('0xe'),_0x7973df,_0x1b92('0xf'));logger[_0x1b92('0x10')](_0x1b92('0x11'),_0x7973df,_0x1b92('0xf'),JSON[_0x1b92('0x12')](_0x4567ab));if(_0x4567ab[_0x1b92('0x13')]){if(_0x4567ab['error'][_0x1b92('0x14')]===0x1f4){logger[_0x1b92('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x7973df,_0x4567ab[_0x1b92('0x13')][_0x1b92('0x15')]);return _0x64a3ed(_0x4567ab[_0x1b92('0x13')][_0x1b92('0x15')]);}logger[_0x1b92('0x13')](_0x1b92('0xe'),_0x7973df,_0x4567ab[_0x1b92('0x13')]['message']);return _0x1545f9(_0x4567ab[_0x1b92('0x13')]['message']);}else{logger[_0x1b92('0x16')]('VoiceChanSpy,\x20%s,\x20%s',_0x7973df,_0x1b92('0xf'));_0x1545f9(_0x4567ab['result'][_0x1b92('0x15')]);}})[_0x1b92('0x17')](function(_0x688aef){logger['error'](_0x1b92('0xe'),_0x7973df,_0x688aef);_0x64a3ed(_0x688aef);});});}
\ No newline at end of file
index 81ae3dd..ba5ab8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x018c=['../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x6903f9,_0x3c7405){var _0x19296f=function(_0x14149c){while(--_0x14149c){_0x6903f9['push'](_0x6903f9['shift']());}};_0x19296f(++_0x3c7405);}(_0x018c,0x126));var _0xc018=function(_0x3fd8c1,_0x35585e){_0x3fd8c1=_0x3fd8c1-0x0;var _0x45a03f=_0x018c[_0x3fd8c1];return _0x45a03f;};'use strict';var multer=require(_0xc018('0x0'));var util=require(_0xc018('0x1'));var path=require('path');var timeout=require(_0xc018('0x2'));var express=require(_0xc018('0x3'));var router=express[_0xc018('0x4')]();var fs_extra=require(_0xc018('0x5'));var auth=require(_0xc018('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc018('0x7'));var controller=require(_0xc018('0x8'));router[_0xc018('0x9')]('/',auth[_0xc018('0xa')](),controller[_0xc018('0xb')]);router[_0xc018('0x9')](_0xc018('0xc'),auth[_0xc018('0xa')](),controller['show']);router[_0xc018('0xd')]('/',auth[_0xc018('0xa')](),controller[_0xc018('0xe')]);router[_0xc018('0xf')](_0xc018('0xc'),auth[_0xc018('0xa')](),controller[_0xc018('0x10')]);router[_0xc018('0x11')](_0xc018('0xc'),auth['isAuthenticated'](),controller[_0xc018('0x12')]);module[_0xc018('0x13')]=router;
\ No newline at end of file
+var _0x4128=['delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x32cab0,_0x4ebbe1){var _0x227126=function(_0xc4a952){while(--_0xc4a952){_0x32cab0['push'](_0x32cab0['shift']());}};_0x227126(++_0x4ebbe1);}(_0x4128,0x1e9));var _0x8412=function(_0x110a85,_0x232e21){_0x110a85=_0x110a85-0x0;var _0x25520d=_0x4128[_0x110a85];return _0x25520d;};'use strict';var multer=require('multer');var util=require(_0x8412('0x0'));var path=require('path');var timeout=require(_0x8412('0x1'));var express=require(_0x8412('0x2'));var router=express['Router']();var fs_extra=require(_0x8412('0x3'));var auth=require(_0x8412('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8412('0x5'));var controller=require('./voiceContext.controller');router[_0x8412('0x6')]('/',auth[_0x8412('0x7')](),controller[_0x8412('0x8')]);router['get'](_0x8412('0x9'),auth[_0x8412('0x7')](),controller[_0x8412('0xa')]);router[_0x8412('0xb')]('/',auth[_0x8412('0x7')](),controller[_0x8412('0xc')]);router[_0x8412('0xd')](_0x8412('0x9'),auth[_0x8412('0x7')](),controller[_0x8412('0xe')]);router[_0x8412('0xf')](_0x8412('0x9'),auth['isAuthenticated'](),controller[_0x8412('0x10')]);module[_0x8412('0x11')]=router;
\ No newline at end of file
index b3d5c89..f343941 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe247=['BOOLEAN','sequelize','exports','name'];(function(_0x364af1,_0x341aee){var _0x3eac1a=function(_0x12e851){while(--_0x12e851){_0x364af1['push'](_0x364af1['shift']());}};_0x3eac1a(++_0x341aee);}(_0xe247,0x151));var _0x7e24=function(_0x586379,_0x414f6e){_0x586379=_0x586379-0x0;var _0x26c245=_0xe247[_0x586379];return _0x26c245;};'use strict';var Sequelize=require(_0x7e24('0x0'));module[_0x7e24('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7e24('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7e24('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2cfa=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x3a2562,_0x2acdef){var _0x59eb58=function(_0x1b5e69){while(--_0x1b5e69){_0x3a2562['push'](_0x3a2562['shift']());}};_0x59eb58(++_0x2acdef);}(_0x2cfa,0x182));var _0xa2cf=function(_0x3cd4df,_0x756389){_0x3cd4df=_0x3cd4df-0x0;var _0x54a719=_0x2cfa[_0x3cd4df];return _0x54a719;};'use strict';var Sequelize=require(_0xa2cf('0x0'));module[_0xa2cf('0x1')]={'name':{'type':Sequelize[_0xa2cf('0x2')],'unique':_0xa2cf('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa2cf('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 7306c4a..b684c83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20f6=['sort','filters','filter','where','map','type','VIRTUAL','merge','options','includeAll','include','VoiceContext','findAll','rows','show','intersection','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','http','request','then','info','request\x20sent','debug','stringify','code','error','VoiceContext,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','count','set','Content-Range','save','update','get','UserProfileResource','destroy','name','send','index','rawAttributes','fieldName','key','model','query','attributes','fields','length','hasOwnProperty','limit','order'];(function(_0x287f12,_0xc8fa2d){var _0x30834e=function(_0x4d7d25){while(--_0x4d7d25){_0x287f12['push'](_0x287f12['shift']());}};_0x30834e(++_0xc8fa2d);}(_0x20f6,0x145));var _0x620f=function(_0x55bcaf,_0x219a21){_0x55bcaf=_0x55bcaf-0x0;var _0x4c0f43=_0x20f6[_0x55bcaf];return _0x4c0f43;};'use strict';var emlformat=require(_0x620f('0x0'));var rimraf=require(_0x620f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x620f('0x2'));var rp=require(_0x620f('0x3'));var moment=require('moment');var BPromise=require(_0x620f('0x4'));var Mustache=require(_0x620f('0x5'));var util=require(_0x620f('0x6'));var path=require(_0x620f('0x7'));var sox=require('sox');var csv=require(_0x620f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x620f('0x9'));var squel=require(_0x620f('0xa'));var crypto=require(_0x620f('0xb'));var jsforce=require(_0x620f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x620f('0x8'));var querystring=require(_0x620f('0xd'));var Papa=require('papaparse');var Redis=require(_0x620f('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x620f('0xf'));var hardwareService=require(_0x620f('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x620f('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x620f('0x12'));var db=require(_0x620f('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x620f('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x4c4084,_0x44b80f,_0x328782,_0x1269dc){return new BPromise(function(_0x5374c9,_0x39792a){var _0x19e485=_0x1269dc||client;return _0x19e485[_0x620f('0x15')](_0x4c4084,_0x328782)[_0x620f('0x16')](function(_0x42d80f){logger[_0x620f('0x17')]('VoiceContext,\x20%s,\x20%s',_0x44b80f,_0x620f('0x18'));logger[_0x620f('0x19')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x44b80f,_0x620f('0x18'),JSON[_0x620f('0x1a')](_0x42d80f));if(_0x42d80f['error']){if(_0x42d80f['error'][_0x620f('0x1b')]===0x1f4){logger[_0x620f('0x1c')](_0x620f('0x1d'),_0x44b80f,_0x42d80f[_0x620f('0x1c')]['message']);return _0x39792a(_0x42d80f[_0x620f('0x1c')][_0x620f('0x1e')]);}logger['error'](_0x620f('0x1d'),_0x44b80f,_0x42d80f[_0x620f('0x1c')][_0x620f('0x1e')]);return _0x5374c9(_0x42d80f['error'][_0x620f('0x1e')]);}else{logger['info'](_0x620f('0x1d'),_0x44b80f,_0x620f('0x18'));_0x5374c9(_0x42d80f['result'][_0x620f('0x1e')]);}})[_0x620f('0x1f')](function(_0x2f80aa){logger[_0x620f('0x1c')](_0x620f('0x1d'),_0x44b80f,_0x2f80aa);_0x39792a(_0x2f80aa);});});}function respondWithStatusCode(_0x2b6c60,_0x107819){_0x107819=_0x107819||0xcc;return function(_0x1d7c8f){if(_0x1d7c8f){return _0x2b6c60[_0x620f('0x20')](_0x107819);}return _0x2b6c60[_0x620f('0x21')](_0x107819)[_0x620f('0x22')]();};}function respondWithResult(_0x4391fd,_0x3c2ec3){_0x3c2ec3=_0x3c2ec3||0xc8;return function(_0x41e693){if(_0x41e693){return _0x4391fd[_0x620f('0x21')](_0x3c2ec3)[_0x620f('0x23')](_0x41e693);}};}function respondWithFilteredResult(_0x4b9e81,_0x2e5590){return function(_0x432c92){if(_0x432c92){var _0x240d0d=typeof _0x2e5590[_0x620f('0x24')]==='undefined'&&typeof _0x2e5590['limit']==='undefined';var _0x4e4083=_0x432c92[_0x620f('0x25')];var _0x2ac8a3=_0x240d0d?0x0:_0x2e5590[_0x620f('0x24')];var _0x4b4c32=_0x240d0d?_0x432c92[_0x620f('0x25')]:_0x2e5590[_0x620f('0x24')]+_0x2e5590['limit'];var _0x3be330;if(_0x4b4c32>=_0x4e4083){_0x4b4c32=_0x4e4083;_0x3be330=0xc8;}else{_0x3be330=0xce;}_0x4b9e81[_0x620f('0x21')](_0x3be330);return _0x4b9e81[_0x620f('0x26')](_0x620f('0x27'),_0x2ac8a3+'-'+_0x4b4c32+'/'+_0x4e4083)[_0x620f('0x23')](_0x432c92);}return null;};}function patchUpdates(_0x4a4890){return function(_0x24db9f){try{jsonpatch['apply'](_0x24db9f,_0x4a4890,!![]);}catch(_0x6ac4b4){return BPromise['reject'](_0x6ac4b4);}return _0x24db9f[_0x620f('0x28')]();};}function saveUpdates(_0x142d30,_0x21f94f){return function(_0xc41e65){if(_0xc41e65){return _0xc41e65[_0x620f('0x29')](_0x142d30)[_0x620f('0x16')](function(_0x22ad08){return _0x22ad08;});}return null;};}function removeEntity(_0xfc6604,_0x3a5069){return function(_0x258bb4){if(_0x258bb4){return _0x258bb4['destroy']()[_0x620f('0x16')](function(){var _0x75950c=_0x258bb4[_0x620f('0x2a')]({'plain':!![]});var _0x297300='Contexts';return db[_0x620f('0x2b')][_0x620f('0x2c')]({'where':{'type':_0x297300,'resourceId':_0x75950c['id']}})[_0x620f('0x16')](function(){return _0x258bb4;});})[_0x620f('0x16')](function(){_0xfc6604[_0x620f('0x21')](0xcc)[_0x620f('0x22')]();});}};}function handleEntityNotFound(_0x3e9b57,_0x1ae1f2){return function(_0x46eeab){if(!_0x46eeab){_0x3e9b57[_0x620f('0x20')](0x194);}return _0x46eeab;};}function handleError(_0x12b6cc,_0x1d73f9){_0x1d73f9=_0x1d73f9||0x1f4;return function(_0x23d17e){logger[_0x620f('0x1c')](_0x23d17e['stack']);if(_0x23d17e[_0x620f('0x2d')]){delete _0x23d17e['name'];}_0x12b6cc[_0x620f('0x21')](_0x1d73f9)[_0x620f('0x2e')](_0x23d17e);};}exports[_0x620f('0x2f')]=function(_0x24daa0,_0xc5e102){var _0x4b8d32={},_0x15152a={},_0x3d44b5={'count':0x0,'rows':[]};var _0x4cc869=_['map'](db['VoiceContext'][_0x620f('0x30')],function(_0x526c5f){return{'name':_0x526c5f[_0x620f('0x31')],'type':_0x526c5f['type'][_0x620f('0x32')]};});_0x15152a[_0x620f('0x33')]=_['map'](_0x4cc869,'name');_0x15152a['query']=_['keys'](_0x24daa0[_0x620f('0x34')]);_0x15152a['filters']=_['intersection'](_0x15152a['model'],_0x15152a[_0x620f('0x34')]);_0x4b8d32[_0x620f('0x35')]=_['intersection'](_0x15152a[_0x620f('0x33')],qs[_0x620f('0x36')](_0x24daa0[_0x620f('0x34')][_0x620f('0x36')]));_0x4b8d32[_0x620f('0x35')]=_0x4b8d32[_0x620f('0x35')][_0x620f('0x37')]?_0x4b8d32[_0x620f('0x35')]:_0x15152a[_0x620f('0x33')];if(!_0x24daa0[_0x620f('0x34')][_0x620f('0x38')]('nolimit')){_0x4b8d32['limit']=qs['limit'](_0x24daa0[_0x620f('0x34')][_0x620f('0x39')]);_0x4b8d32[_0x620f('0x24')]=qs[_0x620f('0x24')](_0x24daa0['query'][_0x620f('0x24')]);}_0x4b8d32[_0x620f('0x3a')]=qs['sort'](_0x24daa0[_0x620f('0x34')][_0x620f('0x3b')]);_0x4b8d32['where']=qs[_0x620f('0x3c')](_['pick'](_0x24daa0['query'],_0x15152a[_0x620f('0x3c')]),_0x4cc869);if(_0x24daa0[_0x620f('0x34')][_0x620f('0x3d')]){_0x4b8d32['where']=_['merge'](_0x4b8d32[_0x620f('0x3e')],{'$or':_[_0x620f('0x3f')](_0x4cc869,function(_0x20c858){if(_0x20c858[_0x620f('0x40')]!==_0x620f('0x41')){var _0x46d1f7={};_0x46d1f7[_0x20c858[_0x620f('0x2d')]]={'$like':'%'+_0x24daa0[_0x620f('0x34')][_0x620f('0x3d')]+'%'};return _0x46d1f7;}})});}_0x4b8d32=_[_0x620f('0x42')]({},_0x4b8d32,_0x24daa0[_0x620f('0x43')]);var _0x4f8b72={'where':_0x4b8d32['where']};return db['VoiceContext']['count'](_0x4f8b72)[_0x620f('0x16')](function(_0x4767e3){_0x3d44b5[_0x620f('0x25')]=_0x4767e3;if(_0x24daa0[_0x620f('0x34')][_0x620f('0x44')]){_0x4b8d32[_0x620f('0x45')]=[{'all':!![]}];}return db[_0x620f('0x46')][_0x620f('0x47')](_0x4b8d32);})[_0x620f('0x16')](function(_0x3ff763){_0x3d44b5[_0x620f('0x48')]=_0x3ff763;return _0x3d44b5;})[_0x620f('0x16')](respondWithFilteredResult(_0xc5e102,_0x4b8d32))['catch'](handleError(_0xc5e102,null));};exports[_0x620f('0x49')]=function(_0x26db34,_0x55b997){var _0x368c47={'raw':![],'where':{'id':_0x26db34['params']['id']}},_0x74867a={};_0x74867a[_0x620f('0x33')]=_['keys'](db[_0x620f('0x46')]['rawAttributes']);_0x74867a[_0x620f('0x34')]=_['keys'](_0x26db34[_0x620f('0x34')]);_0x74867a[_0x620f('0x3c')]=_[_0x620f('0x4a')](_0x74867a[_0x620f('0x33')],_0x74867a[_0x620f('0x34')]);_0x368c47[_0x620f('0x35')]=_[_0x620f('0x4a')](_0x74867a['model'],qs[_0x620f('0x36')](_0x26db34[_0x620f('0x34')][_0x620f('0x36')]));_0x368c47[_0x620f('0x35')]=_0x368c47[_0x620f('0x35')][_0x620f('0x37')]?_0x368c47[_0x620f('0x35')]:_0x74867a[_0x620f('0x33')];if(_0x26db34[_0x620f('0x34')][_0x620f('0x44')]){_0x368c47[_0x620f('0x45')]=[{'all':!![]}];}_0x368c47=_[_0x620f('0x42')]({},_0x368c47,_0x26db34['options']);return db[_0x620f('0x46')][_0x620f('0x4b')](_0x368c47)[_0x620f('0x16')](handleEntityNotFound(_0x55b997,null))[_0x620f('0x16')](respondWithResult(_0x55b997,null))[_0x620f('0x1f')](handleError(_0x55b997,null));};exports[_0x620f('0x4c')]=function(_0x3c1c47,_0x822ead,_0x5d82b3){var _0x163191;return db[_0x620f('0x46')]['create'](_0x3c1c47[_0x620f('0x4d')],{'raw':!![]})[_0x620f('0x16')](function(_0x2a7ec5){_0x163191=_0x2a7ec5;return db[_0x620f('0x46')][_0x620f('0x47')]({'raw':!![]});})[_0x620f('0x16')](function(_0x130fe7){var _0x2cdca0=fs[_0x620f('0x4e')](path[_0x620f('0x4f')](config[_0x620f('0x50')],_0x620f('0x51')),_0x620f('0x52'));var _0xa8f2a7=ejs[_0x620f('0x53')](_0x2cdca0,{'contexts':_0x130fe7||[]});fs[_0x620f('0x54')](_0x620f('0x55'),_0xa8f2a7);})[_0x620f('0x16')](function(){return respondWithRpcPromise(_0x620f('0x56'),_0x620f('0x4c'),{'module':_0x620f('0x57')});})['then'](function(){var _0x5ae8c4=_0x3c1c47[_0x620f('0x58')][_0x620f('0x2a')]({'plain':!![]});if(!_0x5ae8c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ae8c4[_0x620f('0x59')]===_0x620f('0x58')){var _0x2319cf=_0x163191[_0x620f('0x2a')]({'plain':!![]});return db[_0x620f('0x5a')][_0x620f('0x4b')]({'where':{'name':_0x620f('0x5b'),'userProfileId':_0x5ae8c4[_0x620f('0x5c')]},'raw':!![]})[_0x620f('0x16')](function(_0x347feb){if(_0x347feb&&_0x347feb[_0x620f('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x2319cf[_0x620f('0x2d')],'resourceId':_0x2319cf['id'],'type':_0x347feb['name'],'sectionId':_0x347feb['id']},{})[_0x620f('0x16')](function(){return _0x163191;});}else{return _0x163191;}})['catch'](function(_0x4ab92e){logger['error'](_0x620f('0x5e'),_0x4ab92e);throw _0x4ab92e;});}return _0x163191;})['then'](respondWithResult(_0x822ead,0xc9))['catch'](handleError(_0x822ead,null));};exports[_0x620f('0x29')]=function(_0x2cefa3,_0x15b37c,_0x3a444b){var _0x22ca26;return db[_0x620f('0x46')]['find']({'where':{'id':_0x2cefa3['params']['id']}})[_0x620f('0x16')](handleEntityNotFound(_0x15b37c,null))[_0x620f('0x16')](saveUpdates(_0x2cefa3[_0x620f('0x4d')],null))[_0x620f('0x16')](function(_0x519c4b){if(_0x519c4b){_0x22ca26=_0x519c4b;return db[_0x620f('0x46')][_0x620f('0x47')]({'raw':!![]});}})[_0x620f('0x16')](function(_0x31d635){var _0x1bb190=fs[_0x620f('0x4e')](path[_0x620f('0x4f')](config[_0x620f('0x50')],_0x620f('0x51')),'utf8');var _0x40a4d5=ejs[_0x620f('0x53')](_0x1bb190,{'contexts':_0x31d635||[]});fs[_0x620f('0x54')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x40a4d5);})[_0x620f('0x16')](function(){return respondWithRpcPromise('Reload',_0x620f('0x29'),{'module':_0x620f('0x57')});})[_0x620f('0x16')](function(){return _0x22ca26;})[_0x620f('0x16')](respondWithResult(_0x15b37c,null))[_0x620f('0x1f')](handleError(_0x15b37c,null));};exports[_0x620f('0x2c')]=function(_0x19e168,_0x10ff82,_0x4e7f53){var _0x48fd8b;return db[_0x620f('0x46')][_0x620f('0x4b')]({'where':{'id':_0x19e168[_0x620f('0x5f')]['id']}})[_0x620f('0x16')](handleEntityNotFound(_0x10ff82,null))[_0x620f('0x16')](removeEntity(_0x10ff82,null))[_0x620f('0x16')](function(){return db[_0x620f('0x46')]['findAll']({'raw':!![]});})['then'](function(_0x7fe03){var _0x8d0a7f=fs[_0x620f('0x4e')](path['join'](config[_0x620f('0x50')],'server/files/templates/context.ejs'),'utf8');var _0x5861b2=ejs[_0x620f('0x53')](_0x8d0a7f,{'contexts':_0x7fe03});fs['writeFileSync'](_0x620f('0x55'),_0x5861b2);return respondWithRpcPromise(_0x620f('0x56'),'destroy',{'module':_0x620f('0x57')});})['catch'](handleError(_0x10ff82,null));};
\ No newline at end of file
+var _0xc6ab=['VoiceContext','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','reject','update','then','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map'];(function(_0x1da12e,_0x35845d){var _0x1d9cee=function(_0x49c9cf){while(--_0x49c9cf){_0x1da12e['push'](_0x1da12e['shift']());}};_0x1d9cee(++_0x35845d);}(_0xc6ab,0x96));var _0xbc6a=function(_0x560f1a,_0x13b0d4){_0x560f1a=_0x560f1a-0x0;var _0x550e56=_0xc6ab[_0x560f1a];return _0x550e56;};'use strict';var emlformat=require(_0xbc6a('0x0'));var rimraf=require(_0xbc6a('0x1'));var zipdir=require(_0xbc6a('0x2'));var jsonpatch=require(_0xbc6a('0x3'));var rp=require(_0xbc6a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbc6a('0x5'));var util=require(_0xbc6a('0x6'));var path=require(_0xbc6a('0x7'));var sox=require(_0xbc6a('0x8'));var csv=require(_0xbc6a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc6a('0xa'));var _=require(_0xbc6a('0xb'));var squel=require(_0xbc6a('0xc'));var crypto=require(_0xbc6a('0xd'));var jsforce=require(_0xbc6a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbc6a('0xf'));var Papa=require(_0xbc6a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbc6a('0x11'));var as=require(_0xbc6a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc6a('0x13'))(_0xbc6a('0x14'));var utils=require(_0xbc6a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbc6a('0x16'));var db=require(_0xbc6a('0x17'))['db'];var jayson=require(_0xbc6a('0x18'));var client=jayson[_0xbc6a('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a38b2,_0x4bff9c,_0x94a247,_0x19d0c0){return new BPromise(function(_0x48d94a,_0x353a92){var _0x517377=_0x19d0c0||client;return _0x517377[_0xbc6a('0x1a')](_0x5a38b2,_0x94a247)['then'](function(_0x2c0fdf){logger[_0xbc6a('0x1b')](_0xbc6a('0x1c'),_0x4bff9c,_0xbc6a('0x1d'));logger[_0xbc6a('0x1e')](_0xbc6a('0x1f'),_0x4bff9c,_0xbc6a('0x1d'),JSON['stringify'](_0x2c0fdf));if(_0x2c0fdf['error']){if(_0x2c0fdf[_0xbc6a('0x20')][_0xbc6a('0x21')]===0x1f4){logger[_0xbc6a('0x20')](_0xbc6a('0x1c'),_0x4bff9c,_0x2c0fdf[_0xbc6a('0x20')][_0xbc6a('0x22')]);return _0x353a92(_0x2c0fdf[_0xbc6a('0x20')][_0xbc6a('0x22')]);}logger[_0xbc6a('0x20')](_0xbc6a('0x1c'),_0x4bff9c,_0x2c0fdf[_0xbc6a('0x20')][_0xbc6a('0x22')]);return _0x48d94a(_0x2c0fdf[_0xbc6a('0x20')]['message']);}else{logger[_0xbc6a('0x1b')]('VoiceContext,\x20%s,\x20%s',_0x4bff9c,'request\x20sent');_0x48d94a(_0x2c0fdf[_0xbc6a('0x23')]['message']);}})[_0xbc6a('0x24')](function(_0x4b108d){logger[_0xbc6a('0x20')]('VoiceContext,\x20%s,\x20%s',_0x4bff9c,_0x4b108d);_0x353a92(_0x4b108d);});});}function respondWithStatusCode(_0xeaa12d,_0x1f0144){_0x1f0144=_0x1f0144||0xcc;return function(_0x23f6e8){if(_0x23f6e8){return _0xeaa12d[_0xbc6a('0x25')](_0x1f0144);}return _0xeaa12d[_0xbc6a('0x26')](_0x1f0144)[_0xbc6a('0x27')]();};}function respondWithResult(_0x3d1cbd,_0x2e9bad){_0x2e9bad=_0x2e9bad||0xc8;return function(_0x3b52ac){if(_0x3b52ac){return _0x3d1cbd[_0xbc6a('0x26')](_0x2e9bad)['json'](_0x3b52ac);}};}function respondWithFilteredResult(_0x10927e,_0x433376){return function(_0x25c90b){if(_0x25c90b){var _0x10d725=typeof _0x433376[_0xbc6a('0x28')]==='undefined'&&typeof _0x433376[_0xbc6a('0x29')]===_0xbc6a('0x2a');var _0x3e1cc2=_0x25c90b[_0xbc6a('0x2b')];var _0x4356c1=_0x10d725?0x0:_0x433376[_0xbc6a('0x28')];var _0x7902e8=_0x10d725?_0x25c90b[_0xbc6a('0x2b')]:_0x433376[_0xbc6a('0x28')]+_0x433376['limit'];var _0x11e841;if(_0x7902e8>=_0x3e1cc2){_0x7902e8=_0x3e1cc2;_0x11e841=0xc8;}else{_0x11e841=0xce;}_0x10927e['status'](_0x11e841);return _0x10927e['set']('Content-Range',_0x4356c1+'-'+_0x7902e8+'/'+_0x3e1cc2)['json'](_0x25c90b);}return null;};}function patchUpdates(_0x50e809){return function(_0x54ad91){try{jsonpatch['apply'](_0x54ad91,_0x50e809,!![]);}catch(_0x1950e8){return BPromise[_0xbc6a('0x2c')](_0x1950e8);}return _0x54ad91['save']();};}function saveUpdates(_0x3954a4,_0x2e8a55){return function(_0x355ad9){if(_0x355ad9){return _0x355ad9[_0xbc6a('0x2d')](_0x3954a4)[_0xbc6a('0x2e')](function(_0x2507a4){return _0x2507a4;});}return null;};}function removeEntity(_0x2caef9,_0x82f720){return function(_0xe6accf){if(_0xe6accf){return _0xe6accf[_0xbc6a('0x2f')]()[_0xbc6a('0x2e')](function(){var _0x363b5f=_0xe6accf[_0xbc6a('0x30')]({'plain':!![]});var _0xc620a=_0xbc6a('0x31');return db[_0xbc6a('0x32')][_0xbc6a('0x2f')]({'where':{'type':_0xc620a,'resourceId':_0x363b5f['id']}})[_0xbc6a('0x2e')](function(){return _0xe6accf;});})['then'](function(){_0x2caef9[_0xbc6a('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x531eb1,_0x12cf31){return function(_0x197581){if(!_0x197581){_0x531eb1['sendStatus'](0x194);}return _0x197581;};}function handleError(_0x5345c9,_0x370c7a){_0x370c7a=_0x370c7a||0x1f4;return function(_0x2c314b){logger[_0xbc6a('0x20')](_0x2c314b[_0xbc6a('0x33')]);if(_0x2c314b[_0xbc6a('0x34')]){delete _0x2c314b[_0xbc6a('0x34')];}_0x5345c9[_0xbc6a('0x26')](_0x370c7a)[_0xbc6a('0x35')](_0x2c314b);};}exports[_0xbc6a('0x36')]=function(_0x241654,_0x394dc6){var _0x4ab65b={},_0x1ccddb={},_0xa3743c={'count':0x0,'rows':[]};var _0x471edb=_[_0xbc6a('0x37')](db[_0xbc6a('0x38')][_0xbc6a('0x39')],function(_0x4c6c53){return{'name':_0x4c6c53[_0xbc6a('0x3a')],'type':_0x4c6c53[_0xbc6a('0x3b')]['key']};});_0x1ccddb[_0xbc6a('0x3c')]=_[_0xbc6a('0x37')](_0x471edb,_0xbc6a('0x34'));_0x1ccddb[_0xbc6a('0x3d')]=_[_0xbc6a('0x3e')](_0x241654[_0xbc6a('0x3d')]);_0x1ccddb[_0xbc6a('0x3f')]=_['intersection'](_0x1ccddb['model'],_0x1ccddb['query']);_0x4ab65b['attributes']=_[_0xbc6a('0x40')](_0x1ccddb[_0xbc6a('0x3c')],qs[_0xbc6a('0x41')](_0x241654['query'][_0xbc6a('0x41')]));_0x4ab65b[_0xbc6a('0x42')]=_0x4ab65b['attributes'][_0xbc6a('0x43')]?_0x4ab65b['attributes']:_0x1ccddb[_0xbc6a('0x3c')];if(!_0x241654[_0xbc6a('0x3d')][_0xbc6a('0x44')](_0xbc6a('0x45'))){_0x4ab65b[_0xbc6a('0x29')]=qs['limit'](_0x241654[_0xbc6a('0x3d')]['limit']);_0x4ab65b[_0xbc6a('0x28')]=qs[_0xbc6a('0x28')](_0x241654[_0xbc6a('0x3d')][_0xbc6a('0x28')]);}_0x4ab65b[_0xbc6a('0x46')]=qs[_0xbc6a('0x47')](_0x241654[_0xbc6a('0x3d')][_0xbc6a('0x47')]);_0x4ab65b[_0xbc6a('0x48')]=qs[_0xbc6a('0x3f')](_[_0xbc6a('0x49')](_0x241654[_0xbc6a('0x3d')],_0x1ccddb['filters']),_0x471edb);if(_0x241654[_0xbc6a('0x3d')][_0xbc6a('0x4a')]){_0x4ab65b['where']=_[_0xbc6a('0x4b')](_0x4ab65b[_0xbc6a('0x48')],{'$or':_[_0xbc6a('0x37')](_0x471edb,function(_0x5c0dbd){if(_0x5c0dbd['type']!==_0xbc6a('0x4c')){var _0x276aa5={};_0x276aa5[_0x5c0dbd[_0xbc6a('0x34')]]={'$like':'%'+_0x241654[_0xbc6a('0x3d')][_0xbc6a('0x4a')]+'%'};return _0x276aa5;}})});}_0x4ab65b=_[_0xbc6a('0x4b')]({},_0x4ab65b,_0x241654[_0xbc6a('0x4d')]);var _0x574d73={'where':_0x4ab65b[_0xbc6a('0x48')]};return db[_0xbc6a('0x38')]['count'](_0x574d73)[_0xbc6a('0x2e')](function(_0x1cd5c3){_0xa3743c[_0xbc6a('0x2b')]=_0x1cd5c3;if(_0x241654[_0xbc6a('0x3d')][_0xbc6a('0x4e')]){_0x4ab65b['include']=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x4ab65b);})[_0xbc6a('0x2e')](function(_0x5dea12){_0xa3743c[_0xbc6a('0x4f')]=_0x5dea12;return _0xa3743c;})[_0xbc6a('0x2e')](respondWithFilteredResult(_0x394dc6,_0x4ab65b))['catch'](handleError(_0x394dc6,null));};exports[_0xbc6a('0x50')]=function(_0x12f20b,_0xe5b334){var _0x19b2de={'raw':![],'where':{'id':_0x12f20b[_0xbc6a('0x51')]['id']}},_0x26164a={};_0x26164a['model']=_[_0xbc6a('0x3e')](db[_0xbc6a('0x38')][_0xbc6a('0x39')]);_0x26164a[_0xbc6a('0x3d')]=_[_0xbc6a('0x3e')](_0x12f20b['query']);_0x26164a[_0xbc6a('0x3f')]=_[_0xbc6a('0x40')](_0x26164a[_0xbc6a('0x3c')],_0x26164a['query']);_0x19b2de['attributes']=_[_0xbc6a('0x40')](_0x26164a[_0xbc6a('0x3c')],qs[_0xbc6a('0x41')](_0x12f20b['query']['fields']));_0x19b2de[_0xbc6a('0x42')]=_0x19b2de['attributes']['length']?_0x19b2de[_0xbc6a('0x42')]:_0x26164a[_0xbc6a('0x3c')];if(_0x12f20b['query']['includeAll']){_0x19b2de[_0xbc6a('0x52')]=[{'all':!![]}];}_0x19b2de=_['merge']({},_0x19b2de,_0x12f20b[_0xbc6a('0x4d')]);return db[_0xbc6a('0x38')][_0xbc6a('0x53')](_0x19b2de)[_0xbc6a('0x2e')](handleEntityNotFound(_0xe5b334,null))[_0xbc6a('0x2e')](respondWithResult(_0xe5b334,null))['catch'](handleError(_0xe5b334,null));};exports[_0xbc6a('0x54')]=function(_0x545470,_0x569844,_0xb25551){var _0x3b87f4;return db[_0xbc6a('0x38')][_0xbc6a('0x54')](_0x545470[_0xbc6a('0x55')],{'raw':!![]})[_0xbc6a('0x2e')](function(_0x8a6723){_0x3b87f4=_0x8a6723;return db[_0xbc6a('0x38')][_0xbc6a('0x56')]({'raw':!![]});})[_0xbc6a('0x2e')](function(_0x3f094b){var _0x1510a5=fs[_0xbc6a('0x57')](path[_0xbc6a('0x58')](config[_0xbc6a('0x59')],_0xbc6a('0x5a')),_0xbc6a('0x5b'));var _0x16d9cc=ejs[_0xbc6a('0x5c')](_0x1510a5,{'contexts':_0x3f094b||[]});fs[_0xbc6a('0x5d')](_0xbc6a('0x5e'),_0x16d9cc);})[_0xbc6a('0x2e')](function(){return respondWithRpcPromise(_0xbc6a('0x5f'),_0xbc6a('0x54'),{'module':'chan_sip.so'});})[_0xbc6a('0x2e')](function(){var _0x5b99b5=_0x545470[_0xbc6a('0x60')][_0xbc6a('0x30')]({'plain':!![]});if(!_0x5b99b5)throw new Error(_0xbc6a('0x61'));if(_0x5b99b5[_0xbc6a('0x62')]===_0xbc6a('0x60')){var _0x193baf=_0x3b87f4[_0xbc6a('0x30')]({'plain':!![]});return db[_0xbc6a('0x63')][_0xbc6a('0x53')]({'where':{'name':_0xbc6a('0x31'),'userProfileId':_0x5b99b5['userProfileId']},'raw':!![]})['then'](function(_0x565156){if(_0x565156&&_0x565156[_0xbc6a('0x64')]===0x0){return db['UserProfileResource'][_0xbc6a('0x54')]({'name':_0x193baf['name'],'resourceId':_0x193baf['id'],'type':_0x565156[_0xbc6a('0x34')],'sectionId':_0x565156['id']},{})['then'](function(){return _0x3b87f4;});}else{return _0x3b87f4;}})['catch'](function(_0x55063a){logger[_0xbc6a('0x20')](_0xbc6a('0x65'),_0x55063a);throw _0x55063a;});}return _0x3b87f4;})['then'](respondWithResult(_0x569844,0xc9))[_0xbc6a('0x24')](handleError(_0x569844,null));};exports[_0xbc6a('0x2d')]=function(_0x459758,_0x23dfc3,_0x5075a7){var _0x35ce50;return db[_0xbc6a('0x38')][_0xbc6a('0x53')]({'where':{'id':_0x459758[_0xbc6a('0x51')]['id']}})[_0xbc6a('0x2e')](handleEntityNotFound(_0x23dfc3,null))[_0xbc6a('0x2e')](saveUpdates(_0x459758[_0xbc6a('0x55')],null))[_0xbc6a('0x2e')](function(_0x3321a0){if(_0x3321a0){_0x35ce50=_0x3321a0;return db[_0xbc6a('0x38')][_0xbc6a('0x56')]({'raw':!![]});}})[_0xbc6a('0x2e')](function(_0x4a6bd4){var _0x531ae2=fs[_0xbc6a('0x57')](path['join'](config['root'],_0xbc6a('0x5a')),'utf8');var _0x3da196=ejs[_0xbc6a('0x5c')](_0x531ae2,{'contexts':_0x4a6bd4||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x3da196);})[_0xbc6a('0x2e')](function(){return respondWithRpcPromise(_0xbc6a('0x5f'),_0xbc6a('0x2d'),{'module':_0xbc6a('0x66')});})['then'](function(){return _0x35ce50;})[_0xbc6a('0x2e')](respondWithResult(_0x23dfc3,null))[_0xbc6a('0x24')](handleError(_0x23dfc3,null));};exports['destroy']=function(_0x270866,_0x558388,_0x2e9d21){var _0x59d832;return db[_0xbc6a('0x38')][_0xbc6a('0x53')]({'where':{'id':_0x270866[_0xbc6a('0x51')]['id']}})[_0xbc6a('0x2e')](handleEntityNotFound(_0x558388,null))[_0xbc6a('0x2e')](removeEntity(_0x558388,null))[_0xbc6a('0x2e')](function(){return db[_0xbc6a('0x38')][_0xbc6a('0x56')]({'raw':!![]});})['then'](function(_0x1e1dfd){var _0x3a65ab=fs[_0xbc6a('0x57')](path[_0xbc6a('0x58')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x51267a=ejs[_0xbc6a('0x5c')](_0x3a65ab,{'contexts':_0x1e1dfd});fs[_0xbc6a('0x5d')](_0xbc6a('0x5e'),_0x51267a);return respondWithRpcPromise(_0xbc6a('0x5f'),_0xbc6a('0x2f'),{'module':_0xbc6a('0x66')});})['catch'](handleError(_0x558388,null));};
\ No newline at end of file
index 414abb8..7325314 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed91=['VoiceContext','voice_contexts','util','moment','request-promise','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x202ee2,_0x3963ba){var _0x29a801=function(_0x84eed7){while(--_0x84eed7){_0x202ee2['push'](_0x202ee2['shift']());}};_0x29a801(++_0x3963ba);}(_0xed91,0x185));var _0x1ed9=function(_0x465a1e,_0x9931f){_0x465a1e=_0x465a1e-0x0;var _0x1e111d=_0xed91[_0x465a1e];return _0x1e111d;};'use strict';var _=require('lodash');var util=require(_0x1ed9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x1ed9('0x1'));var BPromise=require('bluebird');var rp=require(_0x1ed9('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1ed9('0x3'));var attributes=require(_0x1ed9('0x4'));module[_0x1ed9('0x5')]=function(_0x3c77ff,_0x3206de){return _0x3c77ff[_0x1ed9('0x6')](_0x1ed9('0x7'),attributes,{'tableName':_0x1ed9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x979a=['define','VoiceContext','voice_contexts','util','api','request-promise','path','rimraf','./voiceContext.attributes','exports'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x979a,0x139));var _0xa979=function(_0x5bc18d,_0x4a1372){_0x5bc18d=_0x5bc18d-0x0;var _0x32a08e=_0x979a[_0x5bc18d];return _0x32a08e;};'use strict';var _=require('lodash');var util=require(_0xa979('0x0'));var logger=require('../../config/logger')(_0xa979('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa979('0x2'));var fs=require('fs');var path=require(_0xa979('0x3'));var rimraf=require(_0xa979('0x4'));var config=require('../../config/environment');var attributes=require(_0xa979('0x5'));module[_0xa979('0x6')]=function(_0x55b517,_0x20c3a6){return _0x55b517[_0xa979('0x7')](_0xa979('0x8'),attributes,{'tableName':_0xa979('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6a7ccf6..b20ce00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x1fbcfd,_0x4f8007){var _0x3c9910=function(_0x586ccc){while(--_0x586ccc){_0x1fbcfd['push'](_0x1fbcfd['shift']());}};_0x3c9910(++_0x4f8007);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x191051,_0x4f86ff){_0x191051=_0x191051-0x0;var _0x5e9f64=_0xf4f4[_0x191051];return _0x5e9f64;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var moment=require('moment');var BPromise=require(_0x4f4f('0x2'));var rs=require(_0x4f4f('0x3'));var fs=require('fs');var Redis=require(_0x4f4f('0x4'));var db=require(_0x4f4f('0x5'))['db'];var utils=require(_0x4f4f('0x6'));var logger=require('../../config/logger')(_0x4f4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f4f('0x8'));var client=jayson[_0x4f4f('0x9')][_0x4f4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ff75a,_0x3c4877,_0x249f8a){return new BPromise(function(_0x2faba9,_0x3768d7){return client['request'](_0x1ff75a,_0x249f8a)[_0x4f4f('0xb')](function(_0x38d110){logger[_0x4f4f('0xc')](_0x4f4f('0xd'),_0x3c4877,_0x4f4f('0xe'));logger[_0x4f4f('0xf')](_0x4f4f('0x10'),_0x3c4877,_0x4f4f('0xe'),JSON['stringify'](_0x38d110));if(_0x38d110['error']){if(_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x12')]===0x1f4){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x3768d7(_0x38d110['error'][_0x4f4f('0x13')]);}logger['error'](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x2faba9(_0x38d110[_0x4f4f('0x11')]['message']);}else{logger[_0x4f4f('0xc')]('VoiceContext,\x20%s,\x20%s',_0x3c4877,'request\x20sent');_0x2faba9(_0x38d110['result'][_0x4f4f('0x13')]);}})[_0x4f4f('0x14')](function(_0x2d21ed){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x2d21ed);_0x3768d7(_0x2d21ed);});});}
\ No newline at end of file
+var _0x36ee=['jayson/promise','client','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x36b3c7,_0x4a3d10){var _0x24fde4=function(_0x38b5c8){while(--_0x38b5c8){_0x36b3c7['push'](_0x36b3c7['shift']());}};_0x24fde4(++_0x4a3d10);}(_0x36ee,0xe8));var _0xe36e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x36ee[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('VoiceContext,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('VoiceContext,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});}
\ No newline at end of file
index 69bb0c0..2ebca8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6ca=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','show','post','isAuthenticated','create'];(function(_0x631aa1,_0x2f7d83){var _0x319a1b=function(_0x3f34eb){while(--_0x3f34eb){_0x631aa1['push'](_0x631aa1['shift']());}};_0x319a1b(++_0x2f7d83);}(_0xe6ca,0x1a7));var _0xae6c=function(_0x414de2,_0x5b4841){_0x414de2=_0x414de2-0x0;var _0x5958b1=_0xe6ca[_0x414de2];return _0x5958b1;};'use strict';var multer=require(_0xae6c('0x0'));var util=require(_0xae6c('0x1'));var path=require(_0xae6c('0x2'));var timeout=require('connect-timeout');var express=require(_0xae6c('0x3'));var router=express[_0xae6c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae6c('0x5'));var interaction=require(_0xae6c('0x6'));var config=require(_0xae6c('0x7'));var controller=require('./voiceDialReport.controller');router[_0xae6c('0x8')]('/',auth['isAuthenticated'](),controller[_0xae6c('0x9')]);router[_0xae6c('0x8')](_0xae6c('0xa'),auth['isAuthenticated'](),controller[_0xae6c('0xb')]);router[_0xae6c('0x8')](_0xae6c('0xc'),auth['isAuthenticated'](),controller[_0xae6c('0xd')]);router[_0xae6c('0xe')]('/',auth[_0xae6c('0xf')](),controller[_0xae6c('0x10')]);router[_0xae6c('0x11')](_0xae6c('0xc'),auth['isAuthenticated'](),controller[_0xae6c('0x12')]);router[_0xae6c('0x13')](_0xae6c('0xc'),auth[_0xae6c('0xf')](),controller[_0xae6c('0x14')]);module[_0xae6c('0x15')]=router;
\ No newline at end of file
+var _0xa181=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','post','put','update','delete','exports'];(function(_0x23f978,_0x56e411){var _0x1f7131=function(_0x52b400){while(--_0x52b400){_0x23f978['push'](_0x23f978['shift']());}};_0x1f7131(++_0x56e411);}(_0xa181,0x10a));var _0x1a18=function(_0x4ba1f4,_0x5c4f7c){_0x4ba1f4=_0x4ba1f4-0x0;var _0x11b560=_0xa181[_0x4ba1f4];return _0x11b560;};'use strict';var multer=require(_0x1a18('0x0'));var util=require(_0x1a18('0x1'));var path=require(_0x1a18('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a18('0x3'));var router=express[_0x1a18('0x4')]();var fs_extra=require(_0x1a18('0x5'));var auth=require(_0x1a18('0x6'));var interaction=require(_0x1a18('0x7'));var config=require(_0x1a18('0x8'));var controller=require('./voiceDialReport.controller');router[_0x1a18('0x9')]('/',auth['isAuthenticated'](),controller[_0x1a18('0xa')]);router[_0x1a18('0x9')](_0x1a18('0xb'),auth[_0x1a18('0xc')](),controller['describe']);router[_0x1a18('0x9')](_0x1a18('0xd'),auth[_0x1a18('0xc')](),controller['show']);router[_0x1a18('0xe')]('/',auth[_0x1a18('0xc')](),controller['create']);router[_0x1a18('0xf')](_0x1a18('0xd'),auth[_0x1a18('0xc')](),controller[_0x1a18('0x10')]);router[_0x1a18('0x11')]('/:id',auth[_0x1a18('0xc')](),controller['destroy']);module[_0x1a18('0x12')]=router;
\ No newline at end of file
index 4ba185f..7a46604 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x16d501,_0x7fe1ec){var _0x22ae69=function(_0x24f5b3){while(--_0x24f5b3){_0x16d501['push'](_0x16d501['shift']());}};_0x22ae69(++_0x7fe1ec);}(_0xe5b3,0x133));var _0x3e5b=function(_0x13188a,_0x2f635f){_0x13188a=_0x13188a-0x0;var _0x2f5716=_0xe5b3[_0x13188a];return _0x2f5716;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xd6d6=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x419c4a,_0x5d525d){var _0x4dae37=function(_0x95e7cd){while(--_0x95e7cd){_0x419c4a['push'](_0x419c4a['shift']());}};_0x4dae37(++_0x5d525d);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x11c150,_0x42836b){_0x11c150=_0x11c150-0x0;var _0x4331de=_0xd6d6[_0x11c150];return _0x4331de;};'use strict';var Sequelize=require(_0x6d6d('0x0'));module[_0x6d6d('0x1')]={'privilege':{'type':Sequelize[_0x6d6d('0x2')]},'channel':{'type':Sequelize[_0x6d6d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6d6d('0x2')]},'calleridnum':{'type':Sequelize[_0x6d6d('0x2')]},'calleridname':{'type':Sequelize[_0x6d6d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6d6d('0x2')]},'connectedlinename':{'type':Sequelize[_0x6d6d('0x2')]},'language':{'type':Sequelize[_0x6d6d('0x2')]},'accountcode':{'type':Sequelize[_0x6d6d('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6d6d('0x2')]},'priority':{'type':Sequelize[_0x6d6d('0x3')]},'uniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'linkedid':{'type':Sequelize[_0x6d6d('0x2')]},'destchannel':{'type':Sequelize[_0x6d6d('0x2')]},'destchannelstate':{'type':Sequelize[_0x6d6d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6d6d('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x6d6d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6d6d('0x2')]},'destlanguage':{'type':Sequelize[_0x6d6d('0x2')]},'destaccountcode':{'type':Sequelize[_0x6d6d('0x2')]},'destcontext':{'type':Sequelize[_0x6d6d('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6d6d('0x3')]},'destuniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x6d6d('0x2')]},'starttime':{'type':Sequelize[_0x6d6d('0x4')]},'answertime':{'type':Sequelize[_0x6d6d('0x4')]},'endtime':{'type':Sequelize[_0x6d6d('0x4')]},'lastevent':{'type':Sequelize[_0x6d6d('0x2')],'comment':_0x6d6d('0x5')},'routeId':{'type':Sequelize[_0x6d6d('0x3')]},'duration':{'type':Sequelize[_0x6d6d('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x6d6d('0x3')]}};
\ No newline at end of file
index 045a716..8d064b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c1b=['fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceDialReport','count','includeAll','include','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','status','end','json','limit','undefined','offset','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','rawAttributes'];(function(_0x5b8d58,_0x1f18e7){var _0x34e8ed=function(_0x4e1776){while(--_0x4e1776){_0x5b8d58['push'](_0x5b8d58['shift']());}};_0x34e8ed(++_0x1f18e7);}(_0x7c1b,0x6c));var _0xb7c1=function(_0xb70ff6,_0xeb655f){_0xb70ff6=_0xb70ff6-0x0;var _0x252a95=_0x7c1b[_0xb70ff6];return _0x252a95;};'use strict';var emlformat=require(_0xb7c1('0x0'));var rimraf=require(_0xb7c1('0x1'));var zipdir=require(_0xb7c1('0x2'));var jsonpatch=require(_0xb7c1('0x3'));var rp=require(_0xb7c1('0x4'));var moment=require(_0xb7c1('0x5'));var BPromise=require(_0xb7c1('0x6'));var Mustache=require(_0xb7c1('0x7'));var util=require(_0xb7c1('0x8'));var path=require(_0xb7c1('0x9'));var sox=require(_0xb7c1('0xa'));var csv=require('to-csv');var ejs=require(_0xb7c1('0xb'));var fs=require('fs');var fs_extra=require(_0xb7c1('0xc'));var _=require(_0xb7c1('0xd'));var squel=require(_0xb7c1('0xe'));var crypto=require(_0xb7c1('0xf'));var jsforce=require(_0xb7c1('0x10'));var deskjs=require(_0xb7c1('0x11'));var toCsv=require(_0xb7c1('0x12'));var querystring=require(_0xb7c1('0x13'));var Papa=require('papaparse');var Redis=require(_0xb7c1('0x14'));var authService=require(_0xb7c1('0x15'));var qs=require(_0xb7c1('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7c1('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb7c1('0x18'));var licenseUtil=require(_0xb7c1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4eaf23,_0x81b47c){_0x81b47c=_0x81b47c||0xcc;return function(_0x31ec7b){if(_0x31ec7b){return _0x4eaf23['sendStatus'](_0x81b47c);}return _0x4eaf23[_0xb7c1('0x1a')](_0x81b47c)[_0xb7c1('0x1b')]();};}function respondWithResult(_0x536531,_0x498802){_0x498802=_0x498802||0xc8;return function(_0x113562){if(_0x113562){return _0x536531[_0xb7c1('0x1a')](_0x498802)[_0xb7c1('0x1c')](_0x113562);}};}function respondWithFilteredResult(_0x4c50df,_0xf3397e){return function(_0x77523c){if(_0x77523c){var _0x254ae7=typeof _0xf3397e['offset']==='undefined'&&typeof _0xf3397e[_0xb7c1('0x1d')]===_0xb7c1('0x1e');var _0x3b3b01=_0x77523c['count'];var _0x1084fa=_0x254ae7?0x0:_0xf3397e['offset'];var _0x3c98b8=_0x254ae7?_0x77523c['count']:_0xf3397e[_0xb7c1('0x1f')]+_0xf3397e[_0xb7c1('0x1d')];var _0x2c7fba;if(_0x3c98b8>=_0x3b3b01){_0x3c98b8=_0x3b3b01;_0x2c7fba=0xc8;}else{_0x2c7fba=0xce;}_0x4c50df[_0xb7c1('0x1a')](_0x2c7fba);return _0x4c50df[_0xb7c1('0x20')](_0xb7c1('0x21'),_0x1084fa+'-'+_0x3c98b8+'/'+_0x3b3b01)[_0xb7c1('0x1c')](_0x77523c);}return null;};}function patchUpdates(_0x2a2657){return function(_0x243be2){try{jsonpatch['apply'](_0x243be2,_0x2a2657,!![]);}catch(_0xa2693c){return BPromise['reject'](_0xa2693c);}return _0x243be2[_0xb7c1('0x22')]();};}function saveUpdates(_0x590536,_0x4212b4){return function(_0x1cbaee){if(_0x1cbaee){return _0x1cbaee[_0xb7c1('0x23')](_0x590536)[_0xb7c1('0x24')](function(_0x5dd801){return _0x5dd801;});}return null;};}function removeEntity(_0x405d57,_0x120cde){return function(_0x2e301f){if(_0x2e301f){return _0x2e301f[_0xb7c1('0x25')]()[_0xb7c1('0x24')](function(){_0x405d57['status'](0xcc)[_0xb7c1('0x1b')]();});}};}function handleEntityNotFound(_0x3d6db6,_0xc8ffb9){return function(_0x142a35){if(!_0x142a35){_0x3d6db6['sendStatus'](0x194);}return _0x142a35;};}function handleError(_0x59c4ae,_0x1f9187){_0x1f9187=_0x1f9187||0x1f4;return function(_0x1e092){logger[_0xb7c1('0x26')](_0x1e092[_0xb7c1('0x27')]);if(_0x1e092[_0xb7c1('0x28')]){delete _0x1e092['name'];}_0x59c4ae[_0xb7c1('0x1a')](_0x1f9187)['send'](_0x1e092);};}exports[_0xb7c1('0x29')]=function(_0x26a7c0,_0x5b70bc){var _0x207aae={},_0xd082dc={},_0xca492a={'count':0x0,'rows':[]};var _0x55df5a=_[_0xb7c1('0x2a')](db['VoiceDialReport'][_0xb7c1('0x2b')],function(_0x4611a9){return{'name':_0x4611a9[_0xb7c1('0x2c')],'type':_0x4611a9['type'][_0xb7c1('0x2d')]};});_0xd082dc['model']=_[_0xb7c1('0x2a')](_0x55df5a,_0xb7c1('0x28'));_0xd082dc[_0xb7c1('0x2e')]=_[_0xb7c1('0x2f')](_0x26a7c0[_0xb7c1('0x2e')]);_0xd082dc[_0xb7c1('0x30')]=_[_0xb7c1('0x31')](_0xd082dc[_0xb7c1('0x32')],_0xd082dc[_0xb7c1('0x2e')]);_0x207aae[_0xb7c1('0x33')]=_[_0xb7c1('0x31')](_0xd082dc[_0xb7c1('0x32')],qs[_0xb7c1('0x34')](_0x26a7c0[_0xb7c1('0x2e')][_0xb7c1('0x34')]));_0x207aae[_0xb7c1('0x33')]=_0x207aae[_0xb7c1('0x33')]['length']?_0x207aae[_0xb7c1('0x33')]:_0xd082dc['model'];if(!_0x26a7c0['query'][_0xb7c1('0x35')](_0xb7c1('0x36'))){_0x207aae['limit']=qs[_0xb7c1('0x1d')](_0x26a7c0[_0xb7c1('0x2e')]['limit']);_0x207aae[_0xb7c1('0x1f')]=qs[_0xb7c1('0x1f')](_0x26a7c0['query']['offset']);}_0x207aae[_0xb7c1('0x37')]=qs[_0xb7c1('0x38')](_0x26a7c0[_0xb7c1('0x2e')][_0xb7c1('0x38')]);_0x207aae[_0xb7c1('0x39')]=qs[_0xb7c1('0x30')](_[_0xb7c1('0x3a')](_0x26a7c0[_0xb7c1('0x2e')],_0xd082dc['filters']),_0x55df5a);if(_0x26a7c0[_0xb7c1('0x2e')][_0xb7c1('0x3b')]){_0x207aae['where']=_[_0xb7c1('0x3c')](_0x207aae[_0xb7c1('0x39')],{'$or':_[_0xb7c1('0x2a')](_0x55df5a,function(_0x4225a7){if(_0x4225a7[_0xb7c1('0x3d')]!==_0xb7c1('0x3e')){var _0x40017d={};_0x40017d[_0x4225a7[_0xb7c1('0x28')]]={'$like':'%'+_0x26a7c0['query'][_0xb7c1('0x3b')]+'%'};return _0x40017d;}})});}_0x207aae=_[_0xb7c1('0x3c')]({},_0x207aae,_0x26a7c0[_0xb7c1('0x3f')]);var _0x420422={'where':_0x207aae['where']};return db[_0xb7c1('0x40')][_0xb7c1('0x41')](_0x420422)[_0xb7c1('0x24')](function(_0x4475dc){_0xca492a[_0xb7c1('0x41')]=_0x4475dc;if(_0x26a7c0['query'][_0xb7c1('0x42')]){_0x207aae[_0xb7c1('0x43')]=[{'all':!![]}];}return db[_0xb7c1('0x40')]['findAll'](_0x207aae);})[_0xb7c1('0x24')](function(_0x296493){_0xca492a['rows']=_0x296493;return _0xca492a;})[_0xb7c1('0x24')](respondWithFilteredResult(_0x5b70bc,_0x207aae))[_0xb7c1('0x44')](handleError(_0x5b70bc,null));};exports[_0xb7c1('0x45')]=function(_0x2e149d,_0x26af6a){var _0x598d07={'raw':!![],'where':{'id':_0x2e149d[_0xb7c1('0x46')]['id']}},_0x3a58a9={};_0x3a58a9[_0xb7c1('0x32')]=_[_0xb7c1('0x2f')](db[_0xb7c1('0x40')]['rawAttributes']);_0x3a58a9[_0xb7c1('0x2e')]=_[_0xb7c1('0x2f')](_0x2e149d[_0xb7c1('0x2e')]);_0x3a58a9['filters']=_[_0xb7c1('0x31')](_0x3a58a9[_0xb7c1('0x32')],_0x3a58a9[_0xb7c1('0x2e')]);_0x598d07[_0xb7c1('0x33')]=_[_0xb7c1('0x31')](_0x3a58a9[_0xb7c1('0x32')],qs[_0xb7c1('0x34')](_0x2e149d[_0xb7c1('0x2e')][_0xb7c1('0x34')]));_0x598d07[_0xb7c1('0x33')]=_0x598d07['attributes'][_0xb7c1('0x47')]?_0x598d07[_0xb7c1('0x33')]:_0x3a58a9[_0xb7c1('0x32')];if(_0x2e149d[_0xb7c1('0x2e')][_0xb7c1('0x42')]){_0x598d07[_0xb7c1('0x43')]=[{'all':!![]}];}_0x598d07=_[_0xb7c1('0x3c')]({},_0x598d07,_0x2e149d[_0xb7c1('0x3f')]);return db[_0xb7c1('0x40')][_0xb7c1('0x48')](_0x598d07)[_0xb7c1('0x24')](handleEntityNotFound(_0x26af6a,null))[_0xb7c1('0x24')](respondWithResult(_0x26af6a,null))[_0xb7c1('0x44')](handleError(_0x26af6a,null));};exports['create']=function(_0x27546d,_0x422e66){return db[_0xb7c1('0x40')][_0xb7c1('0x49')](_0x27546d['body'],{})[_0xb7c1('0x24')](respondWithResult(_0x422e66,0xc9))[_0xb7c1('0x44')](handleError(_0x422e66,null));};exports['update']=function(_0x109c48,_0xcaac07){if(_0x109c48['body']['id']){delete _0x109c48['body']['id'];}return db['VoiceDialReport'][_0xb7c1('0x48')]({'where':{'id':_0x109c48[_0xb7c1('0x46')]['id']}})[_0xb7c1('0x24')](handleEntityNotFound(_0xcaac07,null))[_0xb7c1('0x24')](saveUpdates(_0x109c48[_0xb7c1('0x4a')],null))[_0xb7c1('0x24')](respondWithResult(_0xcaac07,null))[_0xb7c1('0x44')](handleError(_0xcaac07,null));};exports['destroy']=function(_0xb61a29,_0x8e2077){return db[_0xb7c1('0x40')][_0xb7c1('0x48')]({'where':{'id':_0xb61a29[_0xb7c1('0x46')]['id']}})[_0xb7c1('0x24')](handleEntityNotFound(_0x8e2077,null))[_0xb7c1('0x24')](removeEntity(_0x8e2077,null))[_0xb7c1('0x44')](handleError(_0x8e2077,null));};exports[_0xb7c1('0x4b')]=function(_0xe554f6,_0x5462f2){return db[_0xb7c1('0x40')]['describe']()['then'](respondWithResult(_0x5462f2,null))[_0xb7c1('0x44')](handleError(_0x5462f2,null));};
\ No newline at end of file
+var _0xf319=['fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','keys','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf319,0x131));var _0x9f31=function(_0x2016ae,_0x3e8473){_0x2016ae=_0x2016ae-0x0;var _0x2e0367=_0xf319[_0x2016ae];return _0x2e0367;};'use strict';var emlformat=require(_0x9f31('0x0'));var rimraf=require(_0x9f31('0x1'));var zipdir=require(_0x9f31('0x2'));var jsonpatch=require(_0x9f31('0x3'));var rp=require(_0x9f31('0x4'));var moment=require(_0x9f31('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f31('0x6'));var util=require(_0x9f31('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9f31('0x8'));var ejs=require(_0x9f31('0x9'));var fs=require('fs');var fs_extra=require(_0x9f31('0xa'));var _=require(_0x9f31('0xb'));var squel=require('squel');var crypto=require(_0x9f31('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f31('0xd'));var toCsv=require(_0x9f31('0x8'));var querystring=require(_0x9f31('0xe'));var Papa=require('papaparse');var Redis=require(_0x9f31('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9f31('0x10'));var as=require(_0x9f31('0x11'));var hardwareService=require(_0x9f31('0x12'));var logger=require(_0x9f31('0x13'))(_0x9f31('0x14'));var utils=require(_0x9f31('0x15'));var config=require(_0x9f31('0x16'));var licenseUtil=require(_0x9f31('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x444d95,_0x1bc456){_0x1bc456=_0x1bc456||0xcc;return function(_0x340965){if(_0x340965){return _0x444d95[_0x9f31('0x18')](_0x1bc456);}return _0x444d95[_0x9f31('0x19')](_0x1bc456)[_0x9f31('0x1a')]();};}function respondWithResult(_0x56b850,_0x22df4b){_0x22df4b=_0x22df4b||0xc8;return function(_0x5ad0ab){if(_0x5ad0ab){return _0x56b850['status'](_0x22df4b)[_0x9f31('0x1b')](_0x5ad0ab);}};}function respondWithFilteredResult(_0x2a2480,_0x220526){return function(_0x55eec5){if(_0x55eec5){var _0x2e735c=typeof _0x220526[_0x9f31('0x1c')]==='undefined'&&typeof _0x220526['limit']===_0x9f31('0x1d');var _0x17dfc9=_0x55eec5[_0x9f31('0x1e')];var _0x1bb50e=_0x2e735c?0x0:_0x220526['offset'];var _0x507629=_0x2e735c?_0x55eec5[_0x9f31('0x1e')]:_0x220526[_0x9f31('0x1c')]+_0x220526[_0x9f31('0x1f')];var _0x2807f3;if(_0x507629>=_0x17dfc9){_0x507629=_0x17dfc9;_0x2807f3=0xc8;}else{_0x2807f3=0xce;}_0x2a2480[_0x9f31('0x19')](_0x2807f3);return _0x2a2480[_0x9f31('0x20')](_0x9f31('0x21'),_0x1bb50e+'-'+_0x507629+'/'+_0x17dfc9)[_0x9f31('0x1b')](_0x55eec5);}return null;};}function patchUpdates(_0x107678){return function(_0x3dab2a){try{jsonpatch[_0x9f31('0x22')](_0x3dab2a,_0x107678,!![]);}catch(_0x5ddd78){return BPromise[_0x9f31('0x23')](_0x5ddd78);}return _0x3dab2a['save']();};}function saveUpdates(_0x361052,_0x94a6d1){return function(_0x4d9d8c){if(_0x4d9d8c){return _0x4d9d8c[_0x9f31('0x24')](_0x361052)[_0x9f31('0x25')](function(_0x3e1114){return _0x3e1114;});}return null;};}function removeEntity(_0x467fd6,_0x50b660){return function(_0x455867){if(_0x455867){return _0x455867[_0x9f31('0x26')]()['then'](function(){_0x467fd6[_0x9f31('0x19')](0xcc)[_0x9f31('0x1a')]();});}};}function handleEntityNotFound(_0x582278,_0x46eb11){return function(_0x46e45a){if(!_0x46e45a){_0x582278[_0x9f31('0x18')](0x194);}return _0x46e45a;};}function handleError(_0x3ee3d2,_0x565a84){_0x565a84=_0x565a84||0x1f4;return function(_0x198478){logger[_0x9f31('0x27')](_0x198478[_0x9f31('0x28')]);if(_0x198478[_0x9f31('0x29')]){delete _0x198478[_0x9f31('0x29')];}_0x3ee3d2['status'](_0x565a84)[_0x9f31('0x2a')](_0x198478);};}exports[_0x9f31('0x2b')]=function(_0x39e31d,_0xa523e9){var _0x4f7ccc={},_0x28414a={},_0xc0b75f={'count':0x0,'rows':[]};var _0x576220=_[_0x9f31('0x2c')](db[_0x9f31('0x2d')][_0x9f31('0x2e')],function(_0x4c85dd){return{'name':_0x4c85dd[_0x9f31('0x2f')],'type':_0x4c85dd[_0x9f31('0x30')][_0x9f31('0x31')]};});_0x28414a[_0x9f31('0x32')]=_[_0x9f31('0x2c')](_0x576220,'name');_0x28414a[_0x9f31('0x33')]=_['keys'](_0x39e31d['query']);_0x28414a[_0x9f31('0x34')]=_[_0x9f31('0x35')](_0x28414a[_0x9f31('0x32')],_0x28414a[_0x9f31('0x33')]);_0x4f7ccc['attributes']=_['intersection'](_0x28414a['model'],qs['fields'](_0x39e31d['query'][_0x9f31('0x36')]));_0x4f7ccc[_0x9f31('0x37')]=_0x4f7ccc[_0x9f31('0x37')][_0x9f31('0x38')]?_0x4f7ccc['attributes']:_0x28414a['model'];if(!_0x39e31d['query'][_0x9f31('0x39')](_0x9f31('0x3a'))){_0x4f7ccc[_0x9f31('0x1f')]=qs[_0x9f31('0x1f')](_0x39e31d['query'][_0x9f31('0x1f')]);_0x4f7ccc[_0x9f31('0x1c')]=qs['offset'](_0x39e31d[_0x9f31('0x33')][_0x9f31('0x1c')]);}_0x4f7ccc[_0x9f31('0x3b')]=qs[_0x9f31('0x3c')](_0x39e31d['query'][_0x9f31('0x3c')]);_0x4f7ccc['where']=qs[_0x9f31('0x34')](_['pick'](_0x39e31d['query'],_0x28414a[_0x9f31('0x34')]),_0x576220);if(_0x39e31d[_0x9f31('0x33')]['filter']){_0x4f7ccc[_0x9f31('0x3d')]=_['merge'](_0x4f7ccc['where'],{'$or':_['map'](_0x576220,function(_0x217802){if(_0x217802[_0x9f31('0x30')]!==_0x9f31('0x3e')){var _0x30f8ce={};_0x30f8ce[_0x217802[_0x9f31('0x29')]]={'$like':'%'+_0x39e31d[_0x9f31('0x33')][_0x9f31('0x3f')]+'%'};return _0x30f8ce;}})});}_0x4f7ccc=_[_0x9f31('0x40')]({},_0x4f7ccc,_0x39e31d[_0x9f31('0x41')]);var _0x5da9ad={'where':_0x4f7ccc['where']};return db[_0x9f31('0x2d')][_0x9f31('0x1e')](_0x5da9ad)[_0x9f31('0x25')](function(_0x4fa133){_0xc0b75f['count']=_0x4fa133;if(_0x39e31d[_0x9f31('0x33')][_0x9f31('0x42')]){_0x4f7ccc[_0x9f31('0x43')]=[{'all':!![]}];}return db[_0x9f31('0x2d')][_0x9f31('0x44')](_0x4f7ccc);})['then'](function(_0x44508a){_0xc0b75f[_0x9f31('0x45')]=_0x44508a;return _0xc0b75f;})[_0x9f31('0x25')](respondWithFilteredResult(_0xa523e9,_0x4f7ccc))['catch'](handleError(_0xa523e9,null));};exports['show']=function(_0x3e493a,_0x57f40f){var _0x3aab16={'raw':!![],'where':{'id':_0x3e493a['params']['id']}},_0x57c8e1={};_0x57c8e1[_0x9f31('0x32')]=_['keys'](db[_0x9f31('0x2d')]['rawAttributes']);_0x57c8e1[_0x9f31('0x33')]=_[_0x9f31('0x46')](_0x3e493a[_0x9f31('0x33')]);_0x57c8e1['filters']=_[_0x9f31('0x35')](_0x57c8e1[_0x9f31('0x32')],_0x57c8e1[_0x9f31('0x33')]);_0x3aab16[_0x9f31('0x37')]=_[_0x9f31('0x35')](_0x57c8e1['model'],qs['fields'](_0x3e493a['query'][_0x9f31('0x36')]));_0x3aab16[_0x9f31('0x37')]=_0x3aab16['attributes'][_0x9f31('0x38')]?_0x3aab16[_0x9f31('0x37')]:_0x57c8e1[_0x9f31('0x32')];if(_0x3e493a['query'][_0x9f31('0x42')]){_0x3aab16[_0x9f31('0x43')]=[{'all':!![]}];}_0x3aab16=_[_0x9f31('0x40')]({},_0x3aab16,_0x3e493a[_0x9f31('0x41')]);return db[_0x9f31('0x2d')][_0x9f31('0x47')](_0x3aab16)['then'](handleEntityNotFound(_0x57f40f,null))['then'](respondWithResult(_0x57f40f,null))['catch'](handleError(_0x57f40f,null));};exports[_0x9f31('0x48')]=function(_0x18eb5e,_0x5260ed){return db[_0x9f31('0x2d')][_0x9f31('0x48')](_0x18eb5e['body'],{})[_0x9f31('0x25')](respondWithResult(_0x5260ed,0xc9))[_0x9f31('0x49')](handleError(_0x5260ed,null));};exports['update']=function(_0x18ff4b,_0x4b3087){if(_0x18ff4b['body']['id']){delete _0x18ff4b[_0x9f31('0x4a')]['id'];}return db[_0x9f31('0x2d')]['find']({'where':{'id':_0x18ff4b[_0x9f31('0x4b')]['id']}})[_0x9f31('0x25')](handleEntityNotFound(_0x4b3087,null))[_0x9f31('0x25')](saveUpdates(_0x18ff4b[_0x9f31('0x4a')],null))[_0x9f31('0x25')](respondWithResult(_0x4b3087,null))[_0x9f31('0x49')](handleError(_0x4b3087,null));};exports['destroy']=function(_0x40d8bf,_0xbb1a98){return db[_0x9f31('0x2d')][_0x9f31('0x47')]({'where':{'id':_0x40d8bf[_0x9f31('0x4b')]['id']}})[_0x9f31('0x25')](handleEntityNotFound(_0xbb1a98,null))[_0x9f31('0x25')](removeEntity(_0xbb1a98,null))[_0x9f31('0x49')](handleError(_0xbb1a98,null));};exports['describe']=function(_0x457b2e,_0x520a24){return db[_0x9f31('0x2d')][_0x9f31('0x4c')]()[_0x9f31('0x25')](respondWithResult(_0x520a24,null))[_0x9f31('0x49')](handleError(_0x520a24,null));};
\ No newline at end of file
index 9120aa6..7764eb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x968b=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x30594b,_0x4df259){var _0x37fcf8=function(_0x53a6ac){while(--_0x53a6ac){_0x30594b['push'](_0x30594b['shift']());}};_0x37fcf8(++_0x4df259);}(_0x968b,0x8f));var _0xb968=function(_0x4f9ae8,_0x1e0972){_0x4f9ae8=_0x4f9ae8-0x0;var _0x5cb56e=_0x968b[_0x4f9ae8];return _0x5cb56e;};'use strict';var _=require(_0xb968('0x0'));var util=require(_0xb968('0x1'));var logger=require(_0xb968('0x2'))(_0xb968('0x3'));var moment=require('moment');var BPromise=require(_0xb968('0x4'));var rp=require(_0xb968('0x5'));var fs=require('fs');var path=require(_0xb968('0x6'));var rimraf=require(_0xb968('0x7'));var config=require(_0xb968('0x8'));var attributes=require(_0xb968('0x9'));module[_0xb968('0xa')]=function(_0x482e8d,_0x4c0d59){return _0x482e8d[_0xb968('0xb')](_0xb968('0xc'),attributes,{'tableName':_0xb968('0xd'),'paranoid':![],'indexes':[{'fields':[_0xb968('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4c4e=['report_dial','uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./voiceDialReport.attributes','define','VoiceDialReport'];(function(_0x9c329c,_0x37a818){var _0x33f88b=function(_0x49b14d){while(--_0x49b14d){_0x9c329c['push'](_0x9c329c['shift']());}};_0x33f88b(++_0x37a818);}(_0x4c4e,0x152));var _0xe4c4=function(_0x39aa20,_0x3b2195){_0x39aa20=_0x39aa20-0x0;var _0x3f0758=_0x4c4e[_0x39aa20];return _0x3f0758;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var logger=require(_0xe4c4('0x1'))(_0xe4c4('0x2'));var moment=require(_0xe4c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4c4('0x4'));var fs=require('fs');var path=require(_0xe4c4('0x5'));var rimraf=require(_0xe4c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xe4c4('0x7'));module['exports']=function(_0x177732,_0x1a12a6){return _0x177732[_0xe4c4('0x8')](_0xe4c4('0x9'),attributes,{'tableName':_0xe4c4('0xa'),'paranoid':![],'indexes':[{'fields':[_0xe4c4('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 392692d..db1e276 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04e4=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','options','raw','then','CreateVoiceDialReport','UpdateVoiceDialReport','update','body','where','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x561ea6,_0xbd1340){var _0x3b6e00=function(_0x495c8a){while(--_0x495c8a){_0x561ea6['push'](_0x561ea6['shift']());}};_0x3b6e00(++_0xbd1340);}(_0x04e4,0xd3));var _0x404e=function(_0x333041,_0x3b430a){_0x333041=_0x333041-0x0;var _0x32e8f2=_0x04e4[_0x333041];return _0x32e8f2;};'use strict';var _=require(_0x404e('0x0'));var util=require(_0x404e('0x1'));var moment=require(_0x404e('0x2'));var BPromise=require(_0x404e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x404e('0x4'));var db=require(_0x404e('0x5'))['db'];var utils=require(_0x404e('0x6'));var logger=require(_0x404e('0x7'))(_0x404e('0x8'));var config=require('../../config/environment');var jayson=require(_0x404e('0x9'));var client=jayson[_0x404e('0xa')][_0x404e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b45ad,_0x2aa2c1,_0x536f4e){return new BPromise(function(_0x33f5f1,_0x4ede59){return client[_0x404e('0xc')](_0x3b45ad,_0x536f4e)['then'](function(_0x45d360){logger[_0x404e('0xd')](_0x404e('0xe'),_0x2aa2c1,'request\x20sent');logger[_0x404e('0xf')](_0x404e('0x10'),_0x2aa2c1,'request\x20sent',JSON[_0x404e('0x11')](_0x45d360));if(_0x45d360[_0x404e('0x12')]){if(_0x45d360[_0x404e('0x12')][_0x404e('0x13')]===0x1f4){logger[_0x404e('0x12')](_0x404e('0xe'),_0x2aa2c1,_0x45d360['error'][_0x404e('0x14')]);return _0x4ede59(_0x45d360[_0x404e('0x12')][_0x404e('0x14')]);}logger['error'](_0x404e('0xe'),_0x2aa2c1,_0x45d360[_0x404e('0x12')][_0x404e('0x14')]);return _0x33f5f1(_0x45d360[_0x404e('0x12')]['message']);}else{logger[_0x404e('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x2aa2c1,_0x404e('0x15'));_0x33f5f1(_0x45d360[_0x404e('0x16')][_0x404e('0x14')]);}})['catch'](function(_0x4b48eb){logger[_0x404e('0x12')](_0x404e('0xe'),_0x2aa2c1,_0x4b48eb);_0x4ede59(_0x4b48eb);});});}exports['CreateVoiceDialReport']=function(_0x79df69){var _0x316e49=this;return new Promise(function(_0x16d4b5,_0x13e5f2){return db['VoiceDialReport']['create'](_0x79df69['body'],{'raw':_0x79df69['options']?_0x79df69[_0x404e('0x17')][_0x404e('0x18')]===undefined?!![]:![]:!![]})[_0x404e('0x19')](function(_0x21f224){logger[_0x404e('0xd')](_0x404e('0x1a'),_0x79df69);logger[_0x404e('0xf')]('CreateVoiceDialReport',_0x79df69,JSON['stringify'](_0x21f224));_0x16d4b5(_0x21f224);})['catch'](function(_0x561720){logger[_0x404e('0x12')](_0x404e('0x1a'),_0x561720[_0x404e('0x14')],_0x79df69);_0x13e5f2(_0x316e49[_0x404e('0x12')](0x1f4,_0x561720[_0x404e('0x14')]));});});};exports[_0x404e('0x1b')]=function(_0x2ab670){var _0x4e5b94=this;return new Promise(function(_0x3ecf9c,_0x4d58da){return db['VoiceDialReport'][_0x404e('0x1c')](_0x2ab670[_0x404e('0x1d')],{'raw':_0x2ab670[_0x404e('0x17')]?_0x2ab670[_0x404e('0x17')][_0x404e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab670[_0x404e('0x17')]?_0x2ab670[_0x404e('0x17')][_0x404e('0x1e')]||null:null,'attributes':_0x2ab670[_0x404e('0x17')]?_0x2ab670[_0x404e('0x17')]['attributes']||null:null,'limit':_0x2ab670[_0x404e('0x17')]?_0x2ab670[_0x404e('0x17')]['limit']||null:null})[_0x404e('0x19')](function(_0x3debaa){logger['info'](_0x404e('0x1b'),_0x2ab670);logger[_0x404e('0xf')]('UpdateVoiceDialReport',_0x2ab670,JSON[_0x404e('0x11')](_0x3debaa));_0x3ecf9c(_0x3debaa);})['catch'](function(_0xa3e50d){logger[_0x404e('0x12')](_0x404e('0x1b'),_0xa3e50d[_0x404e('0x14')],_0x2ab670);_0x4d58da(_0x4e5b94[_0x404e('0x12')](0x1f4,_0xa3e50d['message']));});});};
\ No newline at end of file
+var _0xeae9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','VoiceDialReport','update','limit','lodash','moment'];(function(_0x3802fe,_0x29897d){var _0x4dfd9b=function(_0xe19a34){while(--_0xe19a34){_0x3802fe['push'](_0x3802fe['shift']());}};_0x4dfd9b(++_0x29897d);}(_0xeae9,0x106));var _0x9eae=function(_0x58a667,_0x6132d3){_0x58a667=_0x58a667-0x0;var _0x5c849a=_0xeae9[_0x58a667];return _0x5c849a;};'use strict';var _=require(_0x9eae('0x0'));var util=require('util');var moment=require(_0x9eae('0x1'));var BPromise=require(_0x9eae('0x2'));var rs=require(_0x9eae('0x3'));var fs=require('fs');var Redis=require(_0x9eae('0x4'));var db=require(_0x9eae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9eae('0x6'))('rpc');var config=require(_0x9eae('0x7'));var jayson=require(_0x9eae('0x8'));var client=jayson[_0x9eae('0x9')][_0x9eae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x158d18,_0x468efe,_0x19319c){return new BPromise(function(_0x1fda36,_0x1d5d6b){return client[_0x9eae('0xb')](_0x158d18,_0x19319c)[_0x9eae('0xc')](function(_0x1112e7){logger[_0x9eae('0xd')](_0x9eae('0xe'),_0x468efe,_0x9eae('0xf'));logger[_0x9eae('0x10')](_0x9eae('0x11'),_0x468efe,_0x9eae('0xf'),JSON[_0x9eae('0x12')](_0x1112e7));if(_0x1112e7[_0x9eae('0x13')]){if(_0x1112e7['error'][_0x9eae('0x14')]===0x1f4){logger[_0x9eae('0x13')](_0x9eae('0xe'),_0x468efe,_0x1112e7[_0x9eae('0x13')][_0x9eae('0x15')]);return _0x1d5d6b(_0x1112e7[_0x9eae('0x13')][_0x9eae('0x15')]);}logger[_0x9eae('0x13')](_0x9eae('0xe'),_0x468efe,_0x1112e7[_0x9eae('0x13')][_0x9eae('0x15')]);return _0x1fda36(_0x1112e7[_0x9eae('0x13')][_0x9eae('0x15')]);}else{logger[_0x9eae('0xd')](_0x9eae('0xe'),_0x468efe,_0x9eae('0xf'));_0x1fda36(_0x1112e7[_0x9eae('0x16')][_0x9eae('0x15')]);}})[_0x9eae('0x17')](function(_0x11c85c){logger[_0x9eae('0x13')](_0x9eae('0xe'),_0x468efe,_0x11c85c);_0x1d5d6b(_0x11c85c);});});}exports[_0x9eae('0x18')]=function(_0x2e9f61){var _0x1f4b88=this;return new Promise(function(_0x39f7ea,_0x1e545f){return db['VoiceDialReport'][_0x9eae('0x19')](_0x2e9f61[_0x9eae('0x1a')],{'raw':_0x2e9f61['options']?_0x2e9f61[_0x9eae('0x1b')][_0x9eae('0x1c')]===undefined?!![]:![]:!![]})[_0x9eae('0xc')](function(_0x573aa0){logger[_0x9eae('0xd')](_0x9eae('0x18'),_0x2e9f61);logger[_0x9eae('0x10')]('CreateVoiceDialReport',_0x2e9f61,JSON[_0x9eae('0x12')](_0x573aa0));_0x39f7ea(_0x573aa0);})[_0x9eae('0x17')](function(_0x5226c3){logger[_0x9eae('0x13')](_0x9eae('0x18'),_0x5226c3['message'],_0x2e9f61);_0x1e545f(_0x1f4b88[_0x9eae('0x13')](0x1f4,_0x5226c3[_0x9eae('0x15')]));});});};exports[_0x9eae('0x1d')]=function(_0x4ddeda){var _0x3ba236=this;return new Promise(function(_0x5c313f,_0x1b9270){return db[_0x9eae('0x1e')][_0x9eae('0x1f')](_0x4ddeda['body'],{'raw':_0x4ddeda[_0x9eae('0x1b')]?_0x4ddeda[_0x9eae('0x1b')][_0x9eae('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ddeda[_0x9eae('0x1b')]?_0x4ddeda[_0x9eae('0x1b')]['where']||null:null,'attributes':_0x4ddeda[_0x9eae('0x1b')]?_0x4ddeda[_0x9eae('0x1b')]['attributes']||null:null,'limit':_0x4ddeda[_0x9eae('0x1b')]?_0x4ddeda[_0x9eae('0x1b')][_0x9eae('0x20')]||null:null})[_0x9eae('0xc')](function(_0xfd405){logger[_0x9eae('0xd')](_0x9eae('0x1d'),_0x4ddeda);logger[_0x9eae('0x10')](_0x9eae('0x1d'),_0x4ddeda,JSON['stringify'](_0xfd405));_0x5c313f(_0xfd405);})[_0x9eae('0x17')](function(_0x5313cf){logger[_0x9eae('0x13')]('UpdateVoiceDialReport',_0x5313cf[_0x9eae('0x15')],_0x4ddeda);_0x1b9270(_0x3ba236[_0x9eae('0x13')](0x1f4,_0x5313cf[_0x9eae('0x15')]));});});};
\ No newline at end of file
index f8db973..744379c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5335=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','index','get','/:id','post','isAuthenticated','create','/:id/applications','addApplications','put','update'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x5335,0x167));var _0x5533=function(_0x16e10d,_0x3fd7bc){_0x16e10d=_0x16e10d-0x0;var _0x5a855e=_0x5335[_0x16e10d];return _0x5a855e;};'use strict';var multer=require('multer');var util=require(_0x5533('0x0'));var path=require(_0x5533('0x1'));var timeout=require(_0x5533('0x2'));var express=require(_0x5533('0x3'));var router=express['Router']();var fs_extra=require(_0x5533('0x4'));var auth=require(_0x5533('0x5'));var interaction=require(_0x5533('0x6'));var config=require(_0x5533('0x7'));var controller=require(_0x5533('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5533('0x9')]);router[_0x5533('0xa')](_0x5533('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5533('0xc')]('/',auth[_0x5533('0xd')](),controller[_0x5533('0xe')]);router[_0x5533('0xc')](_0x5533('0xf'),auth['isAuthenticated'](),controller[_0x5533('0x10')]);router[_0x5533('0x11')](_0x5533('0xb'),auth[_0x5533('0xd')](),controller[_0x5533('0x12')]);router['delete'](_0x5533('0xb'),auth[_0x5533('0xd')](),controller[_0x5533('0x13')]);module[_0x5533('0x14')]=router;
\ No newline at end of file
+var _0xc211=['post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2b0074,_0x42d50b){var _0x25b012=function(_0x53d3b9){while(--_0x53d3b9){_0x2b0074['push'](_0x2b0074['shift']());}};_0x25b012(++_0x42d50b);}(_0xc211,0x1d5));var _0x1c21=function(_0x30207e,_0x15f889){_0x30207e=_0x30207e-0x0;var _0x3de19f=_0xc211[_0x30207e];return _0x3de19f;};'use strict';var multer=require(_0x1c21('0x0'));var util=require(_0x1c21('0x1'));var path=require(_0x1c21('0x2'));var timeout=require(_0x1c21('0x3'));var express=require(_0x1c21('0x4'));var router=express[_0x1c21('0x5')]();var fs_extra=require(_0x1c21('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1c21('0x7'));var config=require(_0x1c21('0x8'));var controller=require('./voiceExtension.controller');router[_0x1c21('0x9')]('/',auth[_0x1c21('0xa')](),controller[_0x1c21('0xb')]);router[_0x1c21('0x9')](_0x1c21('0xc'),auth[_0x1c21('0xa')](),controller[_0x1c21('0xd')]);router[_0x1c21('0xe')]('/',auth[_0x1c21('0xa')](),controller[_0x1c21('0xf')]);router[_0x1c21('0xe')](_0x1c21('0x10'),auth['isAuthenticated'](),controller[_0x1c21('0x11')]);router[_0x1c21('0x12')](_0x1c21('0xc'),auth[_0x1c21('0xa')](),controller[_0x1c21('0x13')]);router[_0x1c21('0x14')](_0x1c21('0xc'),auth[_0x1c21('0xa')](),controller[_0x1c21('0x15')]);module[_0x1c21('0x16')]=router;
\ No newline at end of file
index 2bedc0e..ecbdeba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7d0=['outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax'];(function(_0x2e8eb0,_0x1443d6){var _0xbad924=function(_0x1f2525){while(--_0x1f2525){_0x2e8eb0['push'](_0x2e8eb0['shift']());}};_0xbad924(++_0x1443d6);}(_0xf7d0,0x194));var _0x0f7d=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0xf7d0[_0x5dbb84];return _0x1d6eae;};'use strict';var Sequelize=require(_0x0f7d('0x0'));module[_0x0f7d('0x1')]={'context':{'type':Sequelize[_0x0f7d('0x2')],'allowNull':![],'unique':_0x0f7d('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x0f7d('0x2')],'allowNull':![],'unique':_0x0f7d('0x3')},'priority':{'type':Sequelize[_0x0f7d('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x0f7d('0x3')},'tag':{'type':Sequelize[_0x0f7d('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0f7d('0x2')],'allowNull':![],'defaultValue':_0x0f7d('0x4')},'appdata':{'type':Sequelize[_0x0f7d('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0f7d('0x5')](_0x0f7d('0x6'),_0x0f7d('0x7'),_0x0f7d('0x8'),_0x0f7d('0x9'),_0x0f7d('0xa'),_0x0f7d('0xb'),_0x0f7d('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0x0f7d('0x2')]},'interval':{'type':Sequelize[_0x0f7d('0x2')],'allowNull':![],'defaultValue':_0x0f7d('0xd')},'IntervalId':{'type':Sequelize[_0x0f7d('0xe')]},'isApp':{'type':Sequelize[_0x0f7d('0xf')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0f7d('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0f7d('0xe')]},'recordingFormat':{'type':Sequelize[_0x0f7d('0x2')],'defaultValue':_0x0f7d('0x10')},'answer':{'type':Sequelize[_0x0f7d('0xf')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4d32fa){return this['getDataValue'](_0x0f7d('0x11'));}},'alias':{'type':Sequelize[_0x0f7d('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x88c1=['wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN'];(function(_0x4e99af,_0x1f30fa){var _0x26c4d0=function(_0x468b44){while(--_0x468b44){_0x4e99af['push'](_0x4e99af['shift']());}};_0x26c4d0(++_0x1f30fa);}(_0x88c1,0x18a));var _0x188c=function(_0xab68d7,_0x2c55c0){_0xab68d7=_0xab68d7-0x0;var _0x3f7154=_0x88c1[_0xab68d7];return _0x3f7154;};'use strict';var Sequelize=require(_0x188c('0x0'));module[_0x188c('0x1')]={'context':{'type':Sequelize[_0x188c('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x188c('0x2')],'allowNull':![],'unique':_0x188c('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x188c('0x3')},'tag':{'type':Sequelize[_0x188c('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x188c('0x2')],'allowNull':![],'defaultValue':_0x188c('0x4')},'appdata':{'type':Sequelize[_0x188c('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x188c('0x5')](_0x188c('0x6'),_0x188c('0x7'),'internal',_0x188c('0x8'),'outbound-fax',_0x188c('0x9'),_0x188c('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x188c('0x2')]},'interval':{'type':Sequelize[_0x188c('0x2')],'allowNull':![],'defaultValue':_0x188c('0xb')},'IntervalId':{'type':Sequelize[_0x188c('0xc')]},'isApp':{'type':Sequelize[_0x188c('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x188c('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x188c('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0x188c('0xe')},'answer':{'type':Sequelize[_0x188c('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x188c('0xf')],'get':function(_0x1efc6e){return this['getDataValue'](_0x188c('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 717ee28..3677dd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb11e=['options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','destroy','find','create','startsWith','body','exten','concat','user','role','inbound','InternalRoutes','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','findOne','VoiceExtensionId','isApp','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','findAndCountAll','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','sendStatus','status','end','json','undefined','limit','count','offset','then','get','InboundRoutes','OutboundRoutes','outbound','filter','value','name','UserProfileResource','error','stack','send','map','VoiceExtension','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge'];(function(_0x736250,_0x124212){var _0x5db611=function(_0x3f5973){while(--_0x3f5973){_0x736250['push'](_0x736250['shift']());}};_0x5db611(++_0x124212);}(_0xb11e,0x7d));var _0xeb11=function(_0x1b581f,_0x32b72c){_0x1b581f=_0x1b581f-0x0;var _0x48d142=_0xb11e[_0x1b581f];return _0x48d142;};'use strict';var _=require(_0xeb11('0x0'));var Redis=require(_0xeb11('0x1'));var qs=require(_0xeb11('0x2'));var logger=require(_0xeb11('0x3'))(_0xeb11('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xeb11('0x5')]=_[_0xeb11('0x6')](config[_0xeb11('0x5')],{'host':_0xeb11('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeb11('0x5')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x203d78,_0x4994a2){_0x4994a2=_0x4994a2||0xcc;return function(_0x5e5648){if(_0x5e5648){return _0x203d78[_0xeb11('0x8')](_0x4994a2);}return _0x203d78[_0xeb11('0x9')](_0x4994a2)[_0xeb11('0xa')]();};}function respondWithResult(_0x4841d3,_0x35ce4c){_0x35ce4c=_0x35ce4c||0xc8;return function(_0x2e3052){if(_0x2e3052){return _0x4841d3[_0xeb11('0x9')](_0x35ce4c)[_0xeb11('0xb')](_0x2e3052);}};}function respondWithFilteredResult(_0x45f272,_0x29fe6d){return function(_0x3183c3){if(_0x3183c3){var _0x5041d2=typeof _0x29fe6d['offset']===_0xeb11('0xc')&&typeof _0x29fe6d[_0xeb11('0xd')]===_0xeb11('0xc');var _0x517962=_0x3183c3[_0xeb11('0xe')];var _0x5d65d5=_0x5041d2?0x0:_0x29fe6d[_0xeb11('0xf')];var _0x54cbb0=_0x5041d2?_0x3183c3['count']:_0x29fe6d[_0xeb11('0xf')]+_0x29fe6d[_0xeb11('0xd')];var _0x28f010;if(_0x54cbb0>=_0x517962){_0x54cbb0=_0x517962;_0x28f010=0xc8;}else{_0x28f010=0xce;}_0x45f272[_0xeb11('0x9')](_0x28f010);return _0x45f272['set']('Content-Range',_0x5d65d5+'-'+_0x54cbb0+'/'+_0x517962)[_0xeb11('0xb')](_0x3183c3);}return null;};}function removeEntity(_0xd1a9bf){return function(_0x86eab3){if(_0x86eab3){return _0x86eab3['destroy']()[_0xeb11('0x10')](function(){var _0x5152f4=_0x86eab3[_0xeb11('0x11')]({'plain':!![]});var _0x286756=[{'name':_0xeb11('0x12'),'value':'inbound','ignore':![]},{'name':_0xeb11('0x13'),'value':_0xeb11('0x14'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x1906db=_(_0x286756)[_0xeb11('0x15')]('ignore')['map'](_0xeb11('0x16'))[_0xeb11('0x16')]();if(_['includes'](_0x1906db,_0x5152f4['type'])){return;}var _0x17af28=_['find'](_0x286756,['value',_0x5152f4['type']])[_0xeb11('0x17')];return db[_0xeb11('0x18')]['destroy']({'where':{'type':_0x17af28,'resourceId':_0x5152f4['id']}})[_0xeb11('0x10')](function(){return _0x86eab3;});})[_0xeb11('0x10')](function(){_0xd1a9bf['status'](0xcc)[_0xeb11('0xa')]();});}};}function handleEntityNotFound(_0x3b2e1a){return function(_0x4870dd){if(!_0x4870dd){_0x3b2e1a['sendStatus'](0x194);}return _0x4870dd;};}function handleError(_0x640c79,_0x4c2d23){_0x4c2d23=_0x4c2d23||0x1f4;return function(_0x5b97b5){logger[_0xeb11('0x19')](_0x5b97b5[_0xeb11('0x1a')]);if(_0x5b97b5[_0xeb11('0x17')]){delete _0x5b97b5['name'];}_0x640c79['status'](_0x4c2d23)[_0xeb11('0x1b')](_0x5b97b5);};}exports['index']=function(_0x39c0da,_0x45eeba){var _0x377abf={},_0x34c525={},_0x289121={'count':0x0,'rows':[]};var _0x4a0501=_[_0xeb11('0x1c')](db[_0xeb11('0x1d')]['rawAttributes'],function(_0x104561){return{'name':_0x104561['fieldName'],'type':_0x104561[_0xeb11('0x1e')][_0xeb11('0x1f')]};});_0x34c525[_0xeb11('0x20')]=_[_0xeb11('0x1c')](_0x4a0501,_0xeb11('0x17'));_0x34c525[_0xeb11('0x21')]=_[_0xeb11('0x22')](_0x39c0da[_0xeb11('0x21')]);_0x34c525[_0xeb11('0x23')]=_['intersection'](_0x34c525[_0xeb11('0x20')],_0x34c525['query']);_0x377abf[_0xeb11('0x24')]=_[_0xeb11('0x25')](_0x34c525[_0xeb11('0x20')],qs['fields'](_0x39c0da['query'][_0xeb11('0x26')]));_0x377abf[_0xeb11('0x24')]=_0x377abf[_0xeb11('0x24')][_0xeb11('0x27')]?_0x377abf['attributes']:_0x34c525[_0xeb11('0x20')];if(!_0x39c0da[_0xeb11('0x21')][_0xeb11('0x28')]('nolimit')){_0x377abf[_0xeb11('0xd')]=qs['limit'](_0x39c0da[_0xeb11('0x21')]['limit']);_0x377abf[_0xeb11('0xf')]=qs[_0xeb11('0xf')](_0x39c0da[_0xeb11('0x21')][_0xeb11('0xf')]);}_0x377abf[_0xeb11('0x29')]=qs[_0xeb11('0x2a')](_0x39c0da[_0xeb11('0x21')]['sort']);_0x377abf[_0xeb11('0x2b')]=qs['filters'](_[_0xeb11('0x2c')](_0x39c0da['query'],_0x34c525[_0xeb11('0x23')]),_0x4a0501);if(_0x39c0da[_0xeb11('0x21')][_0xeb11('0x15')]){_0x377abf[_0xeb11('0x2b')]=_['merge'](_0x377abf[_0xeb11('0x2b')],{'$or':_[_0xeb11('0x1c')](_0x4a0501,function(_0x1cadf1){if(_0x1cadf1[_0xeb11('0x1e')]!==_0xeb11('0x2d')){var _0x5ba5b6={};_0x5ba5b6[_0x1cadf1[_0xeb11('0x17')]]={'$like':'%'+_0x39c0da[_0xeb11('0x21')][_0xeb11('0x15')]+'%'};return _0x5ba5b6;}})});}_0x377abf=_[_0xeb11('0x2e')]({},_0x377abf,_0x39c0da[_0xeb11('0x2f')]);var _0x25bc1a={'where':_0x377abf[_0xeb11('0x2b')]};return db[_0xeb11('0x1d')][_0xeb11('0xe')](_0x25bc1a)['then'](function(_0x16637b){_0x289121['count']=_0x16637b;if(_0x39c0da[_0xeb11('0x21')][_0xeb11('0x30')]){_0x377abf['include']=[{'all':!![]}];}return db['VoiceExtension'][_0xeb11('0x31')](_0x377abf);})[_0xeb11('0x10')](function(_0x471b9f){_0x289121[_0xeb11('0x32')]=_0x471b9f;return _0x289121;})['then'](respondWithFilteredResult(_0x45eeba,_0x377abf))[_0xeb11('0x33')](handleError(_0x45eeba,null));};exports[_0xeb11('0x34')]=function(_0x2fc175,_0xffa000){var _0x5898fa={'raw':![],'where':{'id':_0x2fc175[_0xeb11('0x35')]['id']}},_0x4c3cb1={};_0x4c3cb1['model']=_[_0xeb11('0x22')](db[_0xeb11('0x1d')][_0xeb11('0x36')]);_0x4c3cb1[_0xeb11('0x21')]=_[_0xeb11('0x22')](_0x2fc175[_0xeb11('0x21')]);_0x4c3cb1['filters']=_['intersection'](_0x4c3cb1[_0xeb11('0x20')],_0x4c3cb1[_0xeb11('0x21')]);_0x5898fa[_0xeb11('0x24')]=_['intersection'](_0x4c3cb1[_0xeb11('0x20')],qs[_0xeb11('0x26')](_0x2fc175[_0xeb11('0x21')][_0xeb11('0x26')]));_0x5898fa[_0xeb11('0x24')]=_0x5898fa['attributes']['length']?_0x5898fa[_0xeb11('0x24')]:_0x4c3cb1['model'];if(_0x2fc175[_0xeb11('0x21')][_0xeb11('0x30')]){_0x5898fa[_0xeb11('0x37')]=[{'all':!![]}];}_0x5898fa=_[_0xeb11('0x2e')]({},_0x5898fa,_0x2fc175[_0xeb11('0x2f')]);return db[_0xeb11('0x1d')]['find'](_0x5898fa)[_0xeb11('0x10')](handleEntityNotFound(_0xffa000,null))[_0xeb11('0x10')](respondWithResult(_0xffa000,null))[_0xeb11('0x33')](handleError(_0xffa000,null));};exports[_0xeb11('0x38')]=function(_0x26f7cd,_0x51f87a){return db[_0xeb11('0x1d')][_0xeb11('0x39')]({'where':{'id':_0x26f7cd['params']['id']}})[_0xeb11('0x10')](handleEntityNotFound(_0x51f87a,null))[_0xeb11('0x10')](removeEntity(_0x51f87a,null))[_0xeb11('0x33')](handleError(_0x51f87a,null));};exports[_0xeb11('0x3a')]=function(_0x1ec1f7,_0x5d0efe){if(_0x1ec1f7['body'][_0xeb11('0x1e')]==='outbound'&&!_[_0xeb11('0x3b')](_0x1ec1f7[_0xeb11('0x3c')][_0xeb11('0x3d')],'_')){_0x1ec1f7[_0xeb11('0x3c')]['exten']='_'[_0xeb11('0x3e')](_0x1ec1f7[_0xeb11('0x3c')][_0xeb11('0x3d')]);}return db[_0xeb11('0x1d')][_0xeb11('0x3a')](_0x1ec1f7['body'],{'raw':![]})['then'](function(_0x5999fa){var _0x315f87=_0x1ec1f7[_0xeb11('0x3f')]['get']({'plain':!![]});if(!_0x315f87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x315f87[_0xeb11('0x40')]==='user'){var _0x146e2a=_0x5999fa[_0xeb11('0x11')]({'plain':!![]});var _0x362909=[{'name':_0xeb11('0x12'),'value':_0xeb11('0x41')},{'name':_0xeb11('0x13'),'value':_0xeb11('0x14')},{'name':_0xeb11('0x42'),'value':_0xeb11('0x43')}];var _0x270c74=_[_0xeb11('0x39')](_0x362909,[_0xeb11('0x16'),_0x146e2a[_0xeb11('0x1e')]])[_0xeb11('0x17')];return db[_0xeb11('0x44')][_0xeb11('0x39')]({'where':{'name':_0x270c74,'userProfileId':_0x315f87[_0xeb11('0x45')]},'raw':!![]})[_0xeb11('0x10')](function(_0x4941cc){if(_0x4941cc&&_0x4941cc[_0xeb11('0x46')]===0x0){return db[_0xeb11('0x18')][_0xeb11('0x3a')]({'name':_0x146e2a['name'],'resourceId':_0x146e2a['id'],'type':_0x4941cc[_0xeb11('0x17')],'sectionId':_0x4941cc['id']},{})[_0xeb11('0x10')](function(){return _0x5999fa;});}else{return _0x5999fa;}})[_0xeb11('0x33')](function(_0x1bda30){logger['error'](_0xeb11('0x47'),_0x1bda30);throw _0x1bda30;});}return _0x5999fa;})[_0xeb11('0x10')](respondWithResult(_0x5d0efe,0xc9))[_0xeb11('0x33')](handleError(_0x5d0efe,null));};exports['update']=function(_0x53531c,_0x3d2532){if(_0x53531c[_0xeb11('0x3c')]['id']){delete _0x53531c[_0xeb11('0x3c')]['id'];}return db['VoiceExtension'][_0xeb11('0x39')]({'where':{'id':_0x53531c[_0xeb11('0x35')]['id']}})[_0xeb11('0x10')](handleEntityNotFound(_0x3d2532,null))['then'](function(_0x3045c6){if(_0x3045c6){return db[_0xeb11('0x1d')][_0xeb11('0x48')](_[_0xeb11('0x2c')](_0x53531c['body'],[_0xeb11('0x3d'),_0xeb11('0x49'),_0xeb11('0x4a'),_0xeb11('0x4b'),_0xeb11('0x4c'),_0xeb11('0x4d'),_0xeb11('0x4e')]),{'where':{'context':_0x3045c6[_0xeb11('0x49')],'exten':_0x3045c6[_0xeb11('0x3d')]},'individualHooks':!![]})['then'](function(_0x9902cc){return _0x9902cc;});}return null;})[_0xeb11('0x10')](respondWithStatusCode(_0x3d2532,null))[_0xeb11('0x33')](handleError(_0x3d2532,null));};exports['addApplications']=function(_0x54dd61,_0x54df8c){return db[_0xeb11('0x1d')][_0xeb11('0x4f')]({'where':{'id':_0x54dd61[_0xeb11('0x35')]['id']}})[_0xeb11('0x10')](function(_0x1a77ae){if(_0x1a77ae){return db['sequelize']['transaction'](function(_0x4cd93c){return db['VoiceExtension'][_0xeb11('0x38')]({'where':{'VoiceExtensionId':_0x54dd61[_0xeb11('0x35')]['id']},'transaction':_0x4cd93c})[_0xeb11('0x10')](function(){var _0x1358c3=_['map'](_0x54dd61['body'],function(_0x4e56c6){_0x4e56c6[_0xeb11('0x50')]=_0x54dd61[_0xeb11('0x35')]['id'];_0x4e56c6[_0xeb11('0x51')]=!![];return _0x4e56c6;});return _0x1a77ae[_0xeb11('0x52')](_0x1358c3);})['then'](function(_0x40c3c1){console[_0xeb11('0x53')](_0xeb11('0x54'),_0x40c3c1);return db[_0xeb11('0x1d')]['bulkCreate'](_0x40c3c1,{'transaction':_0x4cd93c});});})['then'](function(){return db[_0xeb11('0x1d')][_0xeb11('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x54dd61[_0xeb11('0x35')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})['then'](respondWithResult(_0x54df8c,null))[_0xeb11('0x33')](handleError(_0x54df8c,null));};
\ No newline at end of file
+var _0x4f0c=['update','context','description','recordingFormat','cutdigits','mandatoryDisposition','findOne','transaction','isApp','createRouting','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','lodash','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','inbound','outbound','internal','filter','ignore','value','includes','type','name','UserProfileResource','then','send','index','map','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','startsWith','exten','concat','user','role','InboundRoutes','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x504cf9,_0x308e5c){var _0x2e889b=function(_0xb0091c){while(--_0xb0091c){_0x504cf9['push'](_0x504cf9['shift']());}};_0x2e889b(++_0x308e5c);}(_0x4f0c,0x117));var _0xc4f0=function(_0x2a614e,_0x418b0a){_0x2a614e=_0x2a614e-0x0;var _0x30c94c=_0x4f0c[_0x2a614e];return _0x30c94c;};'use strict';var _=require(_0xc4f0('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc4f0('0x1'))(_0xc4f0('0x2'));var config=require(_0xc4f0('0x3'));var db=require(_0xc4f0('0x4'))['db'];config[_0xc4f0('0x5')]=_[_0xc4f0('0x6')](config[_0xc4f0('0x5')],{'host':_0xc4f0('0x7'),'port':0x18eb});var socket=require(_0xc4f0('0x8'))(new Redis(config[_0xc4f0('0x5')]));require(_0xc4f0('0x9'))[_0xc4f0('0xa')](socket);function respondWithStatusCode(_0x4eedbf,_0x4a0a2a){_0x4a0a2a=_0x4a0a2a||0xcc;return function(_0x37405f){if(_0x37405f){return _0x4eedbf[_0xc4f0('0xb')](_0x4a0a2a);}return _0x4eedbf['status'](_0x4a0a2a)[_0xc4f0('0xc')]();};}function respondWithResult(_0x20aba0,_0xb8a2f4){_0xb8a2f4=_0xb8a2f4||0xc8;return function(_0xd7e8c9){if(_0xd7e8c9){return _0x20aba0[_0xc4f0('0xd')](_0xb8a2f4)[_0xc4f0('0xe')](_0xd7e8c9);}};}function respondWithFilteredResult(_0x207389,_0x3fe3d5){return function(_0x1fb66f){if(_0x1fb66f){var _0x2ecd9b=typeof _0x3fe3d5[_0xc4f0('0xf')]===_0xc4f0('0x10')&&typeof _0x3fe3d5[_0xc4f0('0x11')]===_0xc4f0('0x10');var _0x56ffe6=_0x1fb66f['count'];var _0x3fa7bf=_0x2ecd9b?0x0:_0x3fe3d5[_0xc4f0('0xf')];var _0x5212fc=_0x2ecd9b?_0x1fb66f[_0xc4f0('0x12')]:_0x3fe3d5['offset']+_0x3fe3d5[_0xc4f0('0x11')];var _0x444ec8;if(_0x5212fc>=_0x56ffe6){_0x5212fc=_0x56ffe6;_0x444ec8=0xc8;}else{_0x444ec8=0xce;}_0x207389[_0xc4f0('0xd')](_0x444ec8);return _0x207389[_0xc4f0('0x13')](_0xc4f0('0x14'),_0x3fa7bf+'-'+_0x5212fc+'/'+_0x56ffe6)[_0xc4f0('0xe')](_0x1fb66f);}return null;};}function removeEntity(_0x262bd6){return function(_0x347f03){if(_0x347f03){return _0x347f03[_0xc4f0('0x15')]()['then'](function(){var _0x43722d=_0x347f03[_0xc4f0('0x16')]({'plain':!![]});var _0x5c75a2=[{'name':'InboundRoutes','value':_0xc4f0('0x17'),'ignore':![]},{'name':'OutboundRoutes','value':_0xc4f0('0x18'),'ignore':![]},{'name':'InternalRoutes','value':_0xc4f0('0x19'),'ignore':![]}];var _0x51a2cc=_(_0x5c75a2)[_0xc4f0('0x1a')](_0xc4f0('0x1b'))['map'](_0xc4f0('0x1c'))[_0xc4f0('0x1c')]();if(_[_0xc4f0('0x1d')](_0x51a2cc,_0x43722d[_0xc4f0('0x1e')])){return;}var _0x450de6=_['find'](_0x5c75a2,[_0xc4f0('0x1c'),_0x43722d[_0xc4f0('0x1e')]])[_0xc4f0('0x1f')];return db[_0xc4f0('0x20')][_0xc4f0('0x15')]({'where':{'type':_0x450de6,'resourceId':_0x43722d['id']}})[_0xc4f0('0x21')](function(){return _0x347f03;});})['then'](function(){_0x262bd6[_0xc4f0('0xd')](0xcc)[_0xc4f0('0xc')]();});}};}function handleEntityNotFound(_0x3d1ad1){return function(_0x59733c){if(!_0x59733c){_0x3d1ad1[_0xc4f0('0xb')](0x194);}return _0x59733c;};}function handleError(_0x2a89df,_0x1a0059){_0x1a0059=_0x1a0059||0x1f4;return function(_0x1964ae){logger['error'](_0x1964ae['stack']);if(_0x1964ae['name']){delete _0x1964ae['name'];}_0x2a89df[_0xc4f0('0xd')](_0x1a0059)[_0xc4f0('0x22')](_0x1964ae);};}exports[_0xc4f0('0x23')]=function(_0x4a221c,_0x5109a3){var _0x3859ff={},_0x6511a7={},_0x5f2403={'count':0x0,'rows':[]};var _0x1920b3=_[_0xc4f0('0x24')](db[_0xc4f0('0x25')][_0xc4f0('0x26')],function(_0xd38238){return{'name':_0xd38238[_0xc4f0('0x27')],'type':_0xd38238['type'][_0xc4f0('0x28')]};});_0x6511a7[_0xc4f0('0x29')]=_[_0xc4f0('0x24')](_0x1920b3,_0xc4f0('0x1f'));_0x6511a7[_0xc4f0('0x2a')]=_[_0xc4f0('0x2b')](_0x4a221c[_0xc4f0('0x2a')]);_0x6511a7[_0xc4f0('0x2c')]=_[_0xc4f0('0x2d')](_0x6511a7[_0xc4f0('0x29')],_0x6511a7['query']);_0x3859ff[_0xc4f0('0x2e')]=_[_0xc4f0('0x2d')](_0x6511a7[_0xc4f0('0x29')],qs[_0xc4f0('0x2f')](_0x4a221c[_0xc4f0('0x2a')][_0xc4f0('0x2f')]));_0x3859ff[_0xc4f0('0x2e')]=_0x3859ff[_0xc4f0('0x2e')][_0xc4f0('0x30')]?_0x3859ff[_0xc4f0('0x2e')]:_0x6511a7['model'];if(!_0x4a221c['query']['hasOwnProperty'](_0xc4f0('0x31'))){_0x3859ff['limit']=qs['limit'](_0x4a221c[_0xc4f0('0x2a')][_0xc4f0('0x11')]);_0x3859ff[_0xc4f0('0xf')]=qs[_0xc4f0('0xf')](_0x4a221c[_0xc4f0('0x2a')]['offset']);}_0x3859ff[_0xc4f0('0x32')]=qs[_0xc4f0('0x33')](_0x4a221c[_0xc4f0('0x2a')][_0xc4f0('0x33')]);_0x3859ff[_0xc4f0('0x34')]=qs[_0xc4f0('0x2c')](_[_0xc4f0('0x35')](_0x4a221c[_0xc4f0('0x2a')],_0x6511a7[_0xc4f0('0x2c')]),_0x1920b3);if(_0x4a221c[_0xc4f0('0x2a')][_0xc4f0('0x1a')]){_0x3859ff[_0xc4f0('0x34')]=_[_0xc4f0('0x36')](_0x3859ff[_0xc4f0('0x34')],{'$or':_[_0xc4f0('0x24')](_0x1920b3,function(_0x3f58e5){if(_0x3f58e5['type']!=='VIRTUAL'){var _0x5629a9={};_0x5629a9[_0x3f58e5[_0xc4f0('0x1f')]]={'$like':'%'+_0x4a221c[_0xc4f0('0x2a')][_0xc4f0('0x1a')]+'%'};return _0x5629a9;}})});}_0x3859ff=_[_0xc4f0('0x36')]({},_0x3859ff,_0x4a221c['options']);var _0x2e24c2={'where':_0x3859ff[_0xc4f0('0x34')]};return db[_0xc4f0('0x25')][_0xc4f0('0x12')](_0x2e24c2)[_0xc4f0('0x21')](function(_0x18590e){_0x5f2403[_0xc4f0('0x12')]=_0x18590e;if(_0x4a221c['query'][_0xc4f0('0x37')]){_0x3859ff[_0xc4f0('0x38')]=[{'all':!![]}];}return db[_0xc4f0('0x25')][_0xc4f0('0x39')](_0x3859ff);})[_0xc4f0('0x21')](function(_0x545376){_0x5f2403['rows']=_0x545376;return _0x5f2403;})['then'](respondWithFilteredResult(_0x5109a3,_0x3859ff))[_0xc4f0('0x3a')](handleError(_0x5109a3,null));};exports[_0xc4f0('0x3b')]=function(_0x4896e5,_0xf5bb79){var _0x5461d9={'raw':![],'where':{'id':_0x4896e5[_0xc4f0('0x3c')]['id']}},_0x17f820={};_0x17f820[_0xc4f0('0x29')]=_[_0xc4f0('0x2b')](db['VoiceExtension']['rawAttributes']);_0x17f820['query']=_[_0xc4f0('0x2b')](_0x4896e5[_0xc4f0('0x2a')]);_0x17f820[_0xc4f0('0x2c')]=_[_0xc4f0('0x2d')](_0x17f820['model'],_0x17f820[_0xc4f0('0x2a')]);_0x5461d9['attributes']=_[_0xc4f0('0x2d')](_0x17f820[_0xc4f0('0x29')],qs[_0xc4f0('0x2f')](_0x4896e5[_0xc4f0('0x2a')][_0xc4f0('0x2f')]));_0x5461d9['attributes']=_0x5461d9[_0xc4f0('0x2e')][_0xc4f0('0x30')]?_0x5461d9['attributes']:_0x17f820[_0xc4f0('0x29')];if(_0x4896e5[_0xc4f0('0x2a')][_0xc4f0('0x37')]){_0x5461d9[_0xc4f0('0x38')]=[{'all':!![]}];}_0x5461d9=_['merge']({},_0x5461d9,_0x4896e5[_0xc4f0('0x3d')]);return db[_0xc4f0('0x25')]['find'](_0x5461d9)['then'](handleEntityNotFound(_0xf5bb79,null))['then'](respondWithResult(_0xf5bb79,null))[_0xc4f0('0x3a')](handleError(_0xf5bb79,null));};exports[_0xc4f0('0x15')]=function(_0x57d1f9,_0x16a4f2){return db[_0xc4f0('0x25')][_0xc4f0('0x3e')]({'where':{'id':_0x57d1f9[_0xc4f0('0x3c')]['id']}})[_0xc4f0('0x21')](handleEntityNotFound(_0x16a4f2,null))['then'](removeEntity(_0x16a4f2,null))[_0xc4f0('0x3a')](handleError(_0x16a4f2,null));};exports[_0xc4f0('0x3f')]=function(_0x5e8ca1,_0x48037c){if(_0x5e8ca1[_0xc4f0('0x40')]['type']===_0xc4f0('0x18')&&!_[_0xc4f0('0x41')](_0x5e8ca1['body']['exten'],'_')){_0x5e8ca1[_0xc4f0('0x40')][_0xc4f0('0x42')]='_'[_0xc4f0('0x43')](_0x5e8ca1[_0xc4f0('0x40')][_0xc4f0('0x42')]);}return db[_0xc4f0('0x25')][_0xc4f0('0x3f')](_0x5e8ca1['body'],{'raw':![]})['then'](function(_0xb06711){var _0x9c451=_0x5e8ca1[_0xc4f0('0x44')][_0xc4f0('0x16')]({'plain':!![]});if(!_0x9c451)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9c451[_0xc4f0('0x45')]==='user'){var _0x18fab5=_0xb06711[_0xc4f0('0x16')]({'plain':!![]});var _0x13bd14=[{'name':_0xc4f0('0x46'),'value':'inbound'},{'name':_0xc4f0('0x47'),'value':'outbound'},{'name':'InternalRoutes','value':'internal'}];var _0x152429=_[_0xc4f0('0x3e')](_0x13bd14,[_0xc4f0('0x1c'),_0x18fab5[_0xc4f0('0x1e')]])[_0xc4f0('0x1f')];return db[_0xc4f0('0x48')][_0xc4f0('0x3e')]({'where':{'name':_0x152429,'userProfileId':_0x9c451[_0xc4f0('0x49')]},'raw':!![]})[_0xc4f0('0x21')](function(_0x557079){if(_0x557079&&_0x557079[_0xc4f0('0x4a')]===0x0){return db['UserProfileResource'][_0xc4f0('0x3f')]({'name':_0x18fab5[_0xc4f0('0x1f')],'resourceId':_0x18fab5['id'],'type':_0x557079['name'],'sectionId':_0x557079['id']},{})[_0xc4f0('0x21')](function(){return _0xb06711;});}else{return _0xb06711;}})['catch'](function(_0x5cb49c){logger[_0xc4f0('0x4b')](_0xc4f0('0x4c'),_0x5cb49c);throw _0x5cb49c;});}return _0xb06711;})[_0xc4f0('0x21')](respondWithResult(_0x48037c,0xc9))[_0xc4f0('0x3a')](handleError(_0x48037c,null));};exports[_0xc4f0('0x4d')]=function(_0x1d4e6b,_0x437de5){if(_0x1d4e6b['body']['id']){delete _0x1d4e6b['body']['id'];}return db['VoiceExtension'][_0xc4f0('0x3e')]({'where':{'id':_0x1d4e6b[_0xc4f0('0x3c')]['id']}})[_0xc4f0('0x21')](handleEntityNotFound(_0x437de5,null))[_0xc4f0('0x21')](function(_0x140307){if(_0x140307){return db['VoiceExtension'][_0xc4f0('0x4d')](_['pick'](_0x1d4e6b[_0xc4f0('0x40')],[_0xc4f0('0x42'),_0xc4f0('0x4e'),_0xc4f0('0x4f'),_0xc4f0('0x50'),_0xc4f0('0x51'),_0xc4f0('0x52'),'alias']),{'where':{'context':_0x140307[_0xc4f0('0x4e')],'exten':_0x140307[_0xc4f0('0x42')]},'individualHooks':!![]})[_0xc4f0('0x21')](function(_0x5881b4){return _0x5881b4;});}return null;})['then'](respondWithStatusCode(_0x437de5,null))[_0xc4f0('0x3a')](handleError(_0x437de5,null));};exports['addApplications']=function(_0x819264,_0x26b5dc){return db['VoiceExtension'][_0xc4f0('0x53')]({'where':{'id':_0x819264['params']['id']}})[_0xc4f0('0x21')](function(_0x3d3aa2){if(_0x3d3aa2){return db['sequelize'][_0xc4f0('0x54')](function(_0x12d50b){return db[_0xc4f0('0x25')]['destroy']({'where':{'VoiceExtensionId':_0x819264[_0xc4f0('0x3c')]['id']},'transaction':_0x12d50b})[_0xc4f0('0x21')](function(){var _0x26db28=_[_0xc4f0('0x24')](_0x819264[_0xc4f0('0x40')],function(_0x1dd6ce){_0x1dd6ce['VoiceExtensionId']=_0x819264[_0xc4f0('0x3c')]['id'];_0x1dd6ce[_0xc4f0('0x55')]=!![];return _0x1dd6ce;});return _0x3d3aa2[_0xc4f0('0x56')](_0x26db28);})[_0xc4f0('0x21')](function(_0xbad734){console['log'](_0xc4f0('0x57'),_0xbad734);return db[_0xc4f0('0x25')][_0xc4f0('0x58')](_0xbad734,{'transaction':_0x12d50b});});})['then'](function(){return db[_0xc4f0('0x25')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x819264[_0xc4f0('0x3c')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xc4f0('0x21')](respondWithResult(_0x26b5dc,null))[_0xc4f0('0x3a')](handleError(_0x26b5dc,null));};
\ No newline at end of file
index fda71c0..a82d030 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef3c=['hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xef3c,0x18f));var _0xcef3=function(_0x43694b,_0x266eaf){_0x43694b=_0x43694b-0x0;var _0x26063b=_0xef3c[_0x43694b];return _0x26063b;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xcef3('0x0'))['db'][_0xcef3('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xcef3('0x2')](0x0);var events={'afterCreate':_0xcef3('0x3'),'afterUpdate':'update','afterDestroy':_0xcef3('0x4')};function emitEvent(_0x37b888){return function(_0x34b39b,_0x3ffecc,_0x5b9de9){VoiceExtensionEvents['emit'](_0x37b888+':'+_0x34b39b['id'],_0x34b39b);VoiceExtensionEvents[_0xcef3('0x5')](_0x37b888,_0x34b39b);_0x5b9de9(null);};}for(var e in events){if(events[_0xcef3('0x6')](e)){var event=events[e];VoiceExtension[_0xcef3('0x7')](e,emitEvent(event));}}module[_0xcef3('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x1f51=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','VoiceExtension'];(function(_0x59e9ed,_0x8f2730){var _0x2c2736=function(_0x260684){while(--_0x260684){_0x59e9ed['push'](_0x59e9ed['shift']());}};_0x2c2736(++_0x8f2730);}(_0x1f51,0x1de));var _0x11f5=function(_0x3c4f93,_0x24be5c){_0x3c4f93=_0x3c4f93-0x0;var _0x56d097=_0x1f51[_0x3c4f93];return _0x56d097;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x11f5('0x0'))['db'][_0x11f5('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x11f5('0x2'),'afterUpdate':_0x11f5('0x3'),'afterDestroy':_0x11f5('0x4')};function emitEvent(_0x19947a){return function(_0x1e892e,_0x368355,_0x323526){VoiceExtensionEvents[_0x11f5('0x5')](_0x19947a+':'+_0x1e892e['id'],_0x1e892e);VoiceExtensionEvents[_0x11f5('0x5')](_0x19947a,_0x1e892e);_0x323526(null);};}for(var e in events){if(events[_0x11f5('0x6')](e)){var event=events[e];VoiceExtension[_0x11f5('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index 7d0b9c8..08e90af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92e0=['define','VoiceExtension','voice_extensions','get','lodash','exports','models','type','Set','context','exten','CDR(routeAlias)=','alias','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','url','length','name','trunk','param','split','phone','prefix','SIP','join','options','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','priority','last','concat','catch'];(function(_0x2a4095,_0x13f4f0){var _0x52eeab=function(_0x3950dd){while(--_0x3950dd){_0x2a4095['push'](_0x2a4095['shift']());}};_0x52eeab(++_0x13f4f0);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x092e('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x092e('0x1')]=function(_0xfd835f){var _0x2e3997=_0xfd835f[_0x092e('0x2')];function _0x10ccfe(_0xadc488){var _0x3756db=0x2;var _0x416760=[{'type':_0xadc488[_0x092e('0x3')],'app':_0x092e('0x4'),'appdata':'CDR(type)='+_0xadc488['type'],'context':_0xadc488[_0x092e('0x5')],'exten':_0xadc488[_0x092e('0x6')],'priority':_0x3756db++,'VoiceExtensionId':_0xadc488['id']},{'type':_0xadc488[_0x092e('0x3')],'app':_0xadc488['alias']?_0x092e('0x4'):'NoOp','appdata':_0xadc488['alias']?_0x092e('0x7')+_0xadc488[_0x092e('0x8')]:'No\x20alias\x20set','context':_0xadc488[_0x092e('0x5')],'exten':_0xadc488['exten'],'priority':_0x3756db++,'VoiceExtensionId':_0xadc488['id']}];if(_0xadc488['type']===_0x092e('0x9')){_0x416760['push']({'type':_0x092e('0x9'),'app':'Set','appdata':'CDR(routeid)='+_0xadc488['id'],'context':_0xadc488[_0x092e('0x5')],'exten':_0xadc488['exten'],'priority':_0x3756db++,'VoiceExtensionId':_0xadc488['id']});}_0x416760[_0x092e('0xa')]({'type':_0xadc488[_0x092e('0x3')],'app':_0x092e('0x4'),'appdata':_0x092e('0xb'),'context':_0xadc488[_0x092e('0x5')],'exten':_0xadc488['exten'],'priority':_0x3756db++,'VoiceExtensionId':_0xadc488['id']},{'type':_0xadc488['type'],'app':_0x092e('0x4'),'appdata':_0x092e('0xc'),'context':_0xadc488['context'],'exten':_0xadc488[_0x092e('0x6')],'priority':_0x3756db++,'VoiceExtensionId':_0xadc488['id']},{'type':_0xadc488[_0x092e('0x3')],'app':_0x092e('0x4'),'appdata':_0x092e('0xd'),'context':_0xadc488['context'],'exten':_0xadc488[_0x092e('0x6')],'priority':_0x3756db++,'VoiceExtensionId':_0xadc488['id']});return _0x416760;}function _0x13bdf1(_0x5c39d7){var _0x49f5c1=0x2;var _0x3a4aff=[{'type':_0x092e('0xe'),'app':_0x092e('0x4'),'appdata':_0x092e('0xf'),'context':_0x5c39d7[_0x092e('0x5')],'exten':_0x5c39d7['exten'],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']},{'type':_0x092e('0xe'),'app':_0x5c39d7[_0x092e('0x8')]?'Set':_0x092e('0x10'),'appdata':_0x5c39d7['alias']?_0x092e('0x7')+_0x5c39d7['alias']:'No\x20alias\x20set','context':_0x5c39d7['context'],'exten':_0x5c39d7[_0x092e('0x6')],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']},{'type':_0x092e('0xe'),'app':'Set','appdata':'CDR(destination)='+(_0x5c39d7[_0x092e('0x11')]?_0x092e('0x12')+_0x5c39d7[_0x092e('0x11')]+'}':_0x092e('0x13')),'context':_0x5c39d7[_0x092e('0x5')],'exten':_0x5c39d7['exten'],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']},{'type':'outbound','app':'Set','appdata':_0x092e('0x14')+_0x5c39d7['id'],'context':_0x5c39d7[_0x092e('0x5')],'exten':_0x5c39d7['exten'],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']},{'type':_0x092e('0xe'),'app':_0x092e('0x15'),'appdata':_0x092e('0x16')+(_0x49f5c1+0x2)+'):Goto('+(_0x49f5c1+0x1)+')','context':_0x5c39d7[_0x092e('0x5')],'exten':_0x5c39d7[_0x092e('0x6')],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']},{'type':_0x092e('0xe'),'app':'Set','appdata':_0x5c39d7[_0x092e('0x11')]?_0x092e('0x17')+_0x5c39d7[_0x092e('0x11')]+'}':_0x092e('0x18'),'context':_0x5c39d7['context'],'exten':_0x5c39d7[_0x092e('0x6')],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']},{'type':_0x092e('0xe'),'app':'Set','appdata':_0x092e('0xb'),'context':_0x5c39d7[_0x092e('0x5')],'exten':_0x5c39d7[_0x092e('0x6')],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']},{'type':_0x092e('0xe'),'app':_0x092e('0x4'),'appdata':_0x092e('0xc'),'context':_0x5c39d7[_0x092e('0x5')],'exten':_0x5c39d7[_0x092e('0x6')],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']},{'type':'outbound','app':_0x092e('0x4'),'appdata':_0x092e('0xd'),'context':_0x5c39d7[_0x092e('0x5')],'exten':_0x5c39d7[_0x092e('0x6')],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']},{'type':_0x092e('0xe'),'app':_0x092e('0x4'),'appdata':_0x092e('0x19')+_0x5c39d7['id'],'context':_0x5c39d7[_0x092e('0x5')],'exten':_0x5c39d7[_0x092e('0x6')],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']}];if(_0x5c39d7[_0x092e('0x1a')]('recordingFormat')&&_0x5c39d7[_0x092e('0x1b')]!=='none'){_0x3a4aff[_0x092e('0xa')]({'type':_0x092e('0xe'),'app':_0x092e('0x4'),'appdata':_0x092e('0x1c'),'context':_0x5c39d7[_0x092e('0x5')],'exten':_0x5c39d7[_0x092e('0x6')],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']},{'type':_0x092e('0xe'),'app':_0x092e('0x4'),'appdata':_0x092e('0x1d')+_0x5c39d7['recordingFormat']||_0x092e('0x1e'),'context':_0x5c39d7[_0x092e('0x5')],'exten':_0x5c39d7[_0x092e('0x6')],'priority':_0x49f5c1++,'VoiceExtensionId':_0x5c39d7['id']});}return _0x3a4aff;}function _0x541628(_0x1a6144,_0x222531){var _0x1335b5=[{'name':'trunk','param':0x0},{'name':_0x092e('0x1f'),'param':0x1},{'name':'options','param':0x2},{'name':_0x092e('0x20'),'param':0x3}];var _0x4eec2d={};var _0x1488a4=_0x222531['split'](',');var _0xdd1c14=[];for(var _0x4d0609=0x0;_0x4d0609<_0x1335b5[_0x092e('0x21')];_0x4d0609++){switch(_0x1335b5[_0x4d0609][_0x092e('0x22')]){case _0x092e('0x23'):_0x4eec2d[_0x092e('0x23')]=_0x1488a4[_0x1335b5[_0x4d0609][_0x092e('0x24')]][_0x092e('0x25')]('/')[0x1];_0x4eec2d[_0x092e('0x26')]=_0x1488a4[_0x1335b5[_0x4d0609][_0x092e('0x24')]][_0x092e('0x25')]('/')[0x2];_0x4eec2d[_0x092e('0x27')]=_0x4eec2d[_0x092e('0x26')]?_0x4eec2d['phone'][_0x092e('0x25')]('$')[0x0]:undefined;_0x4eec2d[_0x092e('0x26')]=_0x1a6144[_0x092e('0x11')]?(_0x4eec2d[_0x092e('0x27')]||'')+_0x092e('0x12')+_0x1a6144['cutdigits']+'}':(_0x4eec2d[_0x092e('0x27')]||'')+_0x092e('0x13');_0xdd1c14[_0x1335b5[_0x4d0609]['param']]=[_0x092e('0x28'),_0x4eec2d['trunk'],_0x4eec2d[_0x092e('0x26')]][_0x092e('0x29')]('/');break;case _0x092e('0x2a'):_0x4eec2d['options']=_0x1488a4[_0x1335b5[_0x4d0609][_0x092e('0x24')]];if(_0x1a6144[_0x092e('0x1b')]!==_0x092e('0x2b')){if(_0x4eec2d['options'][_0x092e('0x2c')](_0x092e('0x2d'))<0x0){_0x4eec2d[_0x092e('0x2a')]+=_0x092e('0x2d');}}else{_0x4eec2d[_0x092e('0x2a')]=_0x4eec2d['options'][_0x092e('0x2e')](_0x092e('0x2d'),'');}_0xdd1c14[_0x1335b5[_0x4d0609]['param']]=_0x4eec2d[_0x092e('0x2a')];break;default:_0xdd1c14[_0x1335b5[_0x4d0609][_0x092e('0x24')]]=_0x1488a4[_0x1335b5[_0x4d0609]['param']];}}return _0xdd1c14[_0x092e('0x29')](',');}function _0x343a43(_0x2b5bdd,_0x123e3b,_0x18425c){return new Promise(function(_0x370ba5,_0x479e91){var _0x2709fc=[];if(_[_0x092e('0x2f')](_0x123e3b))return _0x370ba5(_0x2709fc);_0x2e3997[_0x092e('0x30')][_0x092e('0x31')]({'attributes':['id',_0x092e('0x32'),_0x092e('0x33')],'raw':!![]})[_0x092e('0x34')](function(_0x12f5fb){for(var _0x489900=0x0,_0x54eaa4=0x0;_0x489900<_0x123e3b['length'];_0x489900++,_0x54eaa4=0x0){var _0x319d4b=_0x123e3b[_0x489900];var _0x4bbe70=[];var _0x9e1bf5=[];delete _0x319d4b['id'];if(_0x319d4b['interval']!==_0x092e('0x35')){_0x319d4b[_0x092e('0x36')]=[_0x319d4b[_0x092e('0x32')]];}else{_0x319d4b[_0x092e('0x36')]=_0x319d4b[_0x092e('0x33')]?_['map'](_[_0x092e('0x37')](_0x12f5fb,{'IntervalId':_0x319d4b[_0x092e('0x33')]}),_0x092e('0x32')):[];}_0x319d4b[_0x092e('0x5')]=_0x2b5bdd[_0x092e('0x5')];_0x319d4b[_0x092e('0x6')]=_0x2b5bdd[_0x092e('0x6')];if(_0x319d4b[_0x092e('0x3')])_0x319d4b[_0x092e('0x3')]=_0x319d4b[_0x092e('0x3')][_0x092e('0x38')]();if(_0x2b5bdd['type']===_0x092e('0xe')){if(_0x319d4b['hasOwnProperty'](_0x092e('0x39'))&&_0x319d4b['tag']&&_0x319d4b[_0x092e('0x39')]!=='--'){_0x4bbe70[_0x092e('0xa')]({'type':_0x319d4b[_0x092e('0x3')][_0x092e('0x38')](),'app':_0x092e('0x4'),'appdata':_0x092e('0x3a')+_0x319d4b[_0x092e('0x39')],'context':_0x2b5bdd[_0x092e('0x5')],'exten':_0x2b5bdd[_0x092e('0x6')],'priority':_0x319d4b[_0x092e('0x36')][_0x092e('0x21')]+_0x18425c+_0x54eaa4++,'VoiceExtensionId':_0x2b5bdd['id']});}_0x4bbe70['push']({'type':_0x319d4b[_0x092e('0x3')][_0x092e('0x38')](),'app':_0x092e('0x15'),'appdata':_0x092e('0x3b')+(_0x319d4b['callerID']?_0x092e('0x3c')+_0x319d4b[_0x092e('0x3d')]+')':_0x092e('0x3e')),'context':_0x2b5bdd[_0x092e('0x5')],'exten':_0x2b5bdd['exten'],'priority':_0x319d4b[_0x092e('0x36')][_0x092e('0x21')]+_0x18425c+_0x54eaa4++,'VoiceExtensionId':_0x2b5bdd['id']});}else{if(_0x319d4b[_0x092e('0x1a')](_0x092e('0x3f'))){if([_0x092e('0x40'),_0x092e('0x41')][_0x092e('0x42')](_0x319d4b[_0x092e('0x43')][_0x092e('0x38')]())&&_0x319d4b[_0x092e('0x44')]!==_0x092e('0x45')){if(_0x319d4b[_0x092e('0x3f')]){_0x4bbe70['push']({'type':_0x319d4b[_0x092e('0x3')][_0x092e('0x38')](),'app':_0x092e('0x15'),'appdata':_0x092e('0x46'),'context':_0x2b5bdd[_0x092e('0x5')],'exten':_0x2b5bdd[_0x092e('0x6')],'priority':_0x319d4b[_0x092e('0x36')][_0x092e('0x21')]+_0x18425c+_0x54eaa4++,'VoiceExtensionId':_0x2b5bdd['id']});_0x4bbe70[_0x092e('0xa')]({'type':_0x319d4b[_0x092e('0x3')]['toLowerCase'](),'app':_0x092e('0x4'),'appdata':_0x092e('0x47'),'context':_0x2b5bdd[_0x092e('0x5')],'exten':_0x2b5bdd[_0x092e('0x6')],'priority':_0x319d4b[_0x092e('0x36')]['length']+_0x18425c+_0x54eaa4++,'VoiceExtensionId':_0x2b5bdd['id']});}else{_0x4bbe70[_0x092e('0xa')]({'type':_0x319d4b[_0x092e('0x3')][_0x092e('0x38')](),'app':_0x092e('0x15'),'appdata':_0x092e('0x48'),'context':_0x2b5bdd[_0x092e('0x5')],'exten':_0x2b5bdd[_0x092e('0x6')],'priority':_0x319d4b[_0x092e('0x36')][_0x092e('0x21')]+_0x18425c+_0x54eaa4++,'VoiceExtensionId':_0x2b5bdd['id']});_0x4bbe70[_0x092e('0xa')]({'type':_0x319d4b[_0x092e('0x3')][_0x092e('0x38')](),'app':_0x092e('0x4'),'appdata':_0x092e('0x49'),'context':_0x2b5bdd[_0x092e('0x5')],'exten':_0x2b5bdd[_0x092e('0x6')],'priority':_0x319d4b[_0x092e('0x36')]['length']+_0x18425c+_0x54eaa4++,'VoiceExtensionId':_0x2b5bdd['id']});}}}}for(var _0x12f5a8=0x0;_0x12f5a8<_0x319d4b[_0x092e('0x36')][_0x092e('0x21')];_0x12f5a8++){var _0x1eb763=_0x18425c+_0x319d4b[_0x092e('0x36')][_0x092e('0x21')];var _0x3b87ae=_0x12f5a8===_0x319d4b[_0x092e('0x36')][_0x092e('0x21')]-0x1?_0x18425c+_0x4bbe70[_0x092e('0x21')]+_0x9e1bf5[_0x092e('0x21')]+0x2:_0x18425c+_0x12f5a8+0x1;_0x4bbe70['splice'](_0x12f5a8,0x0,{'type':_0x2b5bdd[_0x092e('0x3')],'app':_0x092e('0x4a'),'appdata':_0x319d4b['intervals'][_0x12f5a8]+'?'+_0x2b5bdd[_0x092e('0x5')]+_0x092e('0x4b')+_0x1eb763+':'+_0x2b5bdd[_0x092e('0x5')]+_0x092e('0x4b')+_0x3b87ae,'exten':_0x2b5bdd[_0x092e('0x6')],'context':_0x2b5bdd['context'],'priority':_0x18425c+_0x12f5a8,'VoiceExtensionId':_0x2b5bdd['id']});}if(_0x319d4b[_0x092e('0x44')]==='outboundDial')_0x319d4b['appdata']=_0x541628(_0x2b5bdd,_0x319d4b['appdata']);_0x319d4b[_0x092e('0x4c')]=_0x4bbe70[_0x092e('0x21')]?_[_0x092e('0x4d')](_0x4bbe70)[_0x092e('0x4c')]+0x1:_0x18425c;_0x2709fc=_[_0x092e('0x4e')](_0x2709fc,_0x4bbe70,[_0x319d4b],_0x9e1bf5);_0x18425c=_[_0x092e('0x4d')](_0x2709fc)['priority']+0x1;}return _0x370ba5(_0x2709fc);})[_0x092e('0x4f')](function(_0x53399f){_0x479e91(_0x53399f);});});}return _0xfd835f[_0x092e('0x50')](_0x092e('0x51'),attributes,{'tableName':_0x092e('0x52'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2732a6){var _0xa15f7b=this[_0x092e('0x53')]({'plain':!![]});var _0x1c292b=_0xa15f7b[_0x092e('0x3')]==='outbound'?_0x13bdf1(_0xa15f7b):_0x10ccfe(_0xa15f7b);return _0x343a43(_0xa15f7b,_0x2732a6,_[_0x092e('0x4d')](_0x1c292b)[_0x092e('0x4c')]+0x1)[_0x092e('0x34')](function(_0x3fd4c8){var _0x1af177=_[_0x092e('0x4e')](_0x1c292b,_0x3fd4c8);_0x1af177[_0x092e('0xa')]({'type':_0xa15f7b[_0x092e('0x3')],'app':'Hangup','exten':_0xa15f7b[_0x092e('0x6')],'context':_0xa15f7b[_0x092e('0x5')],'priority':_['last'](_0x1af177)[_0x092e('0x4c')]+0x1,'VoiceExtensionId':_0xa15f7b['id']});return _0x1af177;});}}});};
\ No newline at end of file
+var _0x7c09=['toLowerCase','tag','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','outboundDial','appdata','priority','concat','last','catch','define','./voiceExtension.attributes','exports','models','type','context','exten','alias','Set','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','name','param','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','replace','findAll','then','interval','*,*,*,*','intervals','IntervalId','map','filter'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x7c09,0x102));var _0x97c0=function(_0x4a3f23,_0x4db9ed){_0x4a3f23=_0x4a3f23-0x0;var _0x1c63a5=_0x7c09[_0x4a3f23];return _0x1c63a5;};'use strict';var _=require('lodash');var attributes=require(_0x97c0('0x0'));module[_0x97c0('0x1')]=function(_0x53ad71){var _0xfbf689=_0x53ad71[_0x97c0('0x2')];function _0x2d04b9(_0x214897){var _0x12eb6d=0x2;var _0x99bf54=[{'type':_0x214897[_0x97c0('0x3')],'app':'Set','appdata':'CDR(type)='+_0x214897['type'],'context':_0x214897[_0x97c0('0x4')],'exten':_0x214897[_0x97c0('0x5')],'priority':_0x12eb6d++,'VoiceExtensionId':_0x214897['id']},{'type':_0x214897[_0x97c0('0x3')],'app':_0x214897[_0x97c0('0x6')]?_0x97c0('0x7'):'NoOp','appdata':_0x214897[_0x97c0('0x6')]?'CDR(routeAlias)='+_0x214897[_0x97c0('0x6')]:_0x97c0('0x8'),'context':_0x214897['context'],'exten':_0x214897['exten'],'priority':_0x12eb6d++,'VoiceExtensionId':_0x214897['id']}];if(_0x214897[_0x97c0('0x3')]===_0x97c0('0x9')){_0x99bf54[_0x97c0('0xa')]({'type':_0x97c0('0x9'),'app':_0x97c0('0x7'),'appdata':_0x97c0('0xb')+_0x214897['id'],'context':_0x214897[_0x97c0('0x4')],'exten':_0x214897[_0x97c0('0x5')],'priority':_0x12eb6d++,'VoiceExtensionId':_0x214897['id']});}_0x99bf54[_0x97c0('0xa')]({'type':_0x214897[_0x97c0('0x3')],'app':_0x97c0('0x7'),'appdata':_0x97c0('0xc'),'context':_0x214897[_0x97c0('0x4')],'exten':_0x214897['exten'],'priority':_0x12eb6d++,'VoiceExtensionId':_0x214897['id']},{'type':_0x214897[_0x97c0('0x3')],'app':_0x97c0('0x7'),'appdata':_0x97c0('0xd'),'context':_0x214897['context'],'exten':_0x214897[_0x97c0('0x5')],'priority':_0x12eb6d++,'VoiceExtensionId':_0x214897['id']},{'type':_0x214897[_0x97c0('0x3')],'app':_0x97c0('0x7'),'appdata':_0x97c0('0xe'),'context':_0x214897[_0x97c0('0x4')],'exten':_0x214897[_0x97c0('0x5')],'priority':_0x12eb6d++,'VoiceExtensionId':_0x214897['id']});return _0x99bf54;}function _0x49c0d9(_0x16fea6){var _0x3ae7c4=0x2;var _0x51180e=[{'type':_0x97c0('0xf'),'app':_0x97c0('0x7'),'appdata':_0x97c0('0x10'),'context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6[_0x97c0('0x5')],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']},{'type':_0x97c0('0xf'),'app':_0x16fea6[_0x97c0('0x6')]?_0x97c0('0x7'):_0x97c0('0x11'),'appdata':_0x16fea6[_0x97c0('0x6')]?'CDR(routeAlias)='+_0x16fea6['alias']:_0x97c0('0x8'),'context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6[_0x97c0('0x5')],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']},{'type':'outbound','app':_0x97c0('0x7'),'appdata':_0x97c0('0x12')+(_0x16fea6[_0x97c0('0x13')]?_0x97c0('0x14')+_0x16fea6[_0x97c0('0x13')]+'}':_0x97c0('0x15')),'context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6['exten'],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']},{'type':_0x97c0('0xf'),'app':_0x97c0('0x7'),'appdata':_0x97c0('0xb')+_0x16fea6['id'],'context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6['exten'],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']},{'type':_0x97c0('0xf'),'app':_0x97c0('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3ae7c4+0x2)+_0x97c0('0x17')+(_0x3ae7c4+0x1)+')','context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6[_0x97c0('0x5')],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']},{'type':'outbound','app':'Set','appdata':_0x16fea6['cutdigits']?_0x97c0('0x18')+_0x16fea6[_0x97c0('0x13')]+'}':_0x97c0('0x19'),'context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6[_0x97c0('0x5')],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']},{'type':_0x97c0('0xf'),'app':'Set','appdata':_0x97c0('0xc'),'context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6[_0x97c0('0x5')],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']},{'type':'outbound','app':_0x97c0('0x7'),'appdata':_0x97c0('0xd'),'context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6[_0x97c0('0x5')],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']},{'type':_0x97c0('0xf'),'app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6[_0x97c0('0x5')],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']},{'type':_0x97c0('0xf'),'app':'Set','appdata':_0x97c0('0x1a')+_0x16fea6['id'],'context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6['exten'],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']}];if(_0x16fea6[_0x97c0('0x1b')](_0x97c0('0x1c'))&&_0x16fea6[_0x97c0('0x1c')]!==_0x97c0('0x1d')){_0x51180e[_0x97c0('0xa')]({'type':_0x97c0('0xf'),'app':_0x97c0('0x7'),'appdata':_0x97c0('0x1e'),'context':_0x16fea6[_0x97c0('0x4')],'exten':_0x16fea6[_0x97c0('0x5')],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']},{'type':_0x97c0('0xf'),'app':_0x97c0('0x7'),'appdata':_0x97c0('0x1f')+_0x16fea6[_0x97c0('0x1c')]||_0x97c0('0x20'),'context':_0x16fea6['context'],'exten':_0x16fea6[_0x97c0('0x5')],'priority':_0x3ae7c4++,'VoiceExtensionId':_0x16fea6['id']});}return _0x51180e;}function _0x1548b6(_0x2b7f9a,_0x30db7a){var _0x325eb9=[{'name':_0x97c0('0x21'),'param':0x0},{'name':_0x97c0('0x22'),'param':0x1},{'name':_0x97c0('0x23'),'param':0x2},{'name':'url','param':0x3}];var _0xd72d47={};var _0x4bf42a=_0x30db7a[_0x97c0('0x24')](',');var _0x20291=[];for(var _0xc4c795=0x0;_0xc4c795<_0x325eb9[_0x97c0('0x25')];_0xc4c795++){switch(_0x325eb9[_0xc4c795][_0x97c0('0x26')]){case _0x97c0('0x21'):_0xd72d47[_0x97c0('0x21')]=_0x4bf42a[_0x325eb9[_0xc4c795][_0x97c0('0x27')]][_0x97c0('0x24')]('/')[0x1];_0xd72d47[_0x97c0('0x28')]=_0x4bf42a[_0x325eb9[_0xc4c795][_0x97c0('0x27')]]['split']('/')[0x2];_0xd72d47[_0x97c0('0x29')]=_0xd72d47[_0x97c0('0x28')]?_0xd72d47['phone'][_0x97c0('0x24')]('$')[0x0]:undefined;_0xd72d47[_0x97c0('0x28')]=_0x2b7f9a[_0x97c0('0x13')]?(_0xd72d47[_0x97c0('0x29')]||'')+'${EXTEN:'+_0x2b7f9a[_0x97c0('0x13')]+'}':(_0xd72d47['prefix']||'')+_0x97c0('0x15');_0x20291[_0x325eb9[_0xc4c795][_0x97c0('0x27')]]=['SIP',_0xd72d47[_0x97c0('0x21')],_0xd72d47[_0x97c0('0x28')]][_0x97c0('0x2a')]('/');break;case _0x97c0('0x23'):_0xd72d47[_0x97c0('0x23')]=_0x4bf42a[_0x325eb9[_0xc4c795][_0x97c0('0x27')]];if(_0x2b7f9a[_0x97c0('0x1c')]!==_0x97c0('0x1d')){if(_0xd72d47[_0x97c0('0x23')][_0x97c0('0x2b')](_0x97c0('0x2c'))<0x0){_0xd72d47[_0x97c0('0x23')]+=_0x97c0('0x2c');}}else{_0xd72d47['options']=_0xd72d47[_0x97c0('0x23')][_0x97c0('0x2d')](_0x97c0('0x2c'),'');}_0x20291[_0x325eb9[_0xc4c795][_0x97c0('0x27')]]=_0xd72d47[_0x97c0('0x23')];break;default:_0x20291[_0x325eb9[_0xc4c795][_0x97c0('0x27')]]=_0x4bf42a[_0x325eb9[_0xc4c795][_0x97c0('0x27')]];}}return _0x20291['join'](',');}function _0x51a0f5(_0x10ee7b,_0x3785a8,_0x2d625b){return new Promise(function(_0x16ff4e,_0x13549f){var _0x5556e8=[];if(_['isEmpty'](_0x3785a8))return _0x16ff4e(_0x5556e8);_0xfbf689['Interval'][_0x97c0('0x2e')]({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x97c0('0x2f')](function(_0x2d3604){for(var _0x6959dc=0x0,_0x15e427=0x0;_0x6959dc<_0x3785a8[_0x97c0('0x25')];_0x6959dc++,_0x15e427=0x0){var _0x483656=_0x3785a8[_0x6959dc];var _0xc2059f=[];var _0x16f0fb=[];delete _0x483656['id'];if(_0x483656[_0x97c0('0x30')]!==_0x97c0('0x31')){_0x483656[_0x97c0('0x32')]=[_0x483656[_0x97c0('0x30')]];}else{_0x483656[_0x97c0('0x32')]=_0x483656[_0x97c0('0x33')]?_[_0x97c0('0x34')](_[_0x97c0('0x35')](_0x2d3604,{'IntervalId':_0x483656['IntervalId']}),_0x97c0('0x30')):[];}_0x483656[_0x97c0('0x4')]=_0x10ee7b[_0x97c0('0x4')];_0x483656[_0x97c0('0x5')]=_0x10ee7b['exten'];if(_0x483656['type'])_0x483656[_0x97c0('0x3')]=_0x483656[_0x97c0('0x3')][_0x97c0('0x36')]();if(_0x10ee7b['type']===_0x97c0('0xf')){if(_0x483656[_0x97c0('0x1b')](_0x97c0('0x37'))&&_0x483656[_0x97c0('0x37')]&&_0x483656[_0x97c0('0x37')]!=='--'){_0xc2059f['push']({'type':_0x483656[_0x97c0('0x3')][_0x97c0('0x36')](),'app':_0x97c0('0x7'),'appdata':'CDR(tag)='+_0x483656['tag'],'context':_0x10ee7b[_0x97c0('0x4')],'exten':_0x10ee7b['exten'],'priority':_0x483656['intervals'][_0x97c0('0x25')]+_0x2d625b+_0x15e427++,'VoiceExtensionId':_0x10ee7b['id']});}_0xc2059f[_0x97c0('0xa')]({'type':_0x483656[_0x97c0('0x3')]['toLowerCase'](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x483656[_0x97c0('0x38')]?_0x97c0('0x39')+_0x483656[_0x97c0('0x38')]+')':_0x97c0('0x3a')),'context':_0x10ee7b[_0x97c0('0x4')],'exten':_0x10ee7b[_0x97c0('0x5')],'priority':_0x483656[_0x97c0('0x32')]['length']+_0x2d625b+_0x15e427++,'VoiceExtensionId':_0x10ee7b['id']});}else{if(_0x483656[_0x97c0('0x1b')](_0x97c0('0x3b'))){if([_0x97c0('0x3c'),_0x97c0('0x3d')][_0x97c0('0x3e')](_0x483656[_0x97c0('0x3f')]['toLowerCase']())&&_0x483656[_0x97c0('0x40')]!==_0x97c0('0x41')){if(_0x483656['answer']){_0xc2059f[_0x97c0('0xa')]({'type':_0x483656[_0x97c0('0x3')][_0x97c0('0x36')](),'app':_0x97c0('0x16'),'appdata':_0x97c0('0x42'),'context':_0x10ee7b[_0x97c0('0x4')],'exten':_0x10ee7b[_0x97c0('0x5')],'priority':_0x483656['intervals'][_0x97c0('0x25')]+_0x2d625b+_0x15e427++,'VoiceExtensionId':_0x10ee7b['id']});_0xc2059f[_0x97c0('0xa')]({'type':_0x483656[_0x97c0('0x3')][_0x97c0('0x36')](),'app':_0x97c0('0x7'),'appdata':_0x97c0('0x43'),'context':_0x10ee7b[_0x97c0('0x4')],'exten':_0x10ee7b[_0x97c0('0x5')],'priority':_0x483656[_0x97c0('0x32')][_0x97c0('0x25')]+_0x2d625b+_0x15e427++,'VoiceExtensionId':_0x10ee7b['id']});}else{_0xc2059f[_0x97c0('0xa')]({'type':_0x483656[_0x97c0('0x3')][_0x97c0('0x36')](),'app':'ExecIf','appdata':_0x97c0('0x44'),'context':_0x10ee7b[_0x97c0('0x4')],'exten':_0x10ee7b[_0x97c0('0x5')],'priority':_0x483656[_0x97c0('0x32')][_0x97c0('0x25')]+_0x2d625b+_0x15e427++,'VoiceExtensionId':_0x10ee7b['id']});_0xc2059f[_0x97c0('0xa')]({'type':_0x483656['type'][_0x97c0('0x36')](),'app':_0x97c0('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x10ee7b[_0x97c0('0x4')],'exten':_0x10ee7b[_0x97c0('0x5')],'priority':_0x483656[_0x97c0('0x32')]['length']+_0x2d625b+_0x15e427++,'VoiceExtensionId':_0x10ee7b['id']});}}}}for(var _0x829ca8=0x0;_0x829ca8<_0x483656['intervals'][_0x97c0('0x25')];_0x829ca8++){var _0x36fede=_0x2d625b+_0x483656[_0x97c0('0x32')][_0x97c0('0x25')];var _0x3c5150=_0x829ca8===_0x483656[_0x97c0('0x32')][_0x97c0('0x25')]-0x1?_0x2d625b+_0xc2059f[_0x97c0('0x25')]+_0x16f0fb[_0x97c0('0x25')]+0x2:_0x2d625b+_0x829ca8+0x1;_0xc2059f[_0x97c0('0x45')](_0x829ca8,0x0,{'type':_0x10ee7b[_0x97c0('0x3')],'app':'GotoIfTime','appdata':_0x483656[_0x97c0('0x32')][_0x829ca8]+'?'+_0x10ee7b[_0x97c0('0x4')]+_0x97c0('0x46')+_0x36fede+':'+_0x10ee7b[_0x97c0('0x4')]+',${EXTEN},'+_0x3c5150,'exten':_0x10ee7b[_0x97c0('0x5')],'context':_0x10ee7b[_0x97c0('0x4')],'priority':_0x2d625b+_0x829ca8,'VoiceExtensionId':_0x10ee7b['id']});}if(_0x483656[_0x97c0('0x40')]===_0x97c0('0x47'))_0x483656['appdata']=_0x1548b6(_0x10ee7b,_0x483656[_0x97c0('0x48')]);_0x483656[_0x97c0('0x49')]=_0xc2059f[_0x97c0('0x25')]?_['last'](_0xc2059f)[_0x97c0('0x49')]+0x1:_0x2d625b;_0x5556e8=_[_0x97c0('0x4a')](_0x5556e8,_0xc2059f,[_0x483656],_0x16f0fb);_0x2d625b=_[_0x97c0('0x4b')](_0x5556e8)[_0x97c0('0x49')]+0x1;}return _0x16ff4e(_0x5556e8);})[_0x97c0('0x4c')](function(_0x1838c9){_0x13549f(_0x1838c9);});});}return _0x53ad71[_0x97c0('0x4d')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xeb4eb3){var _0x396b68=this['get']({'plain':!![]});var _0x366a01=_0x396b68['type']==='outbound'?_0x49c0d9(_0x396b68):_0x2d04b9(_0x396b68);return _0x51a0f5(_0x396b68,_0xeb4eb3,_[_0x97c0('0x4b')](_0x366a01)['priority']+0x1)[_0x97c0('0x2f')](function(_0x41b122){var _0x56be23=_['concat'](_0x366a01,_0x41b122);_0x56be23['push']({'type':_0x396b68[_0x97c0('0x3')],'app':'Hangup','exten':_0x396b68[_0x97c0('0x5')],'context':_0x396b68[_0x97c0('0x4')],'priority':_[_0x97c0('0x4b')](_0x56be23)[_0x97c0('0x49')]+0x1,'VoiceExtensionId':_0x396b68['id']});return _0x56be23;});}}});};
\ No newline at end of file
index 2639358..99ecdb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c24=['../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','info','VoiceExtension,\x20%s,\x20%s','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','findAll','options','raw','limit','map','include','model','attributes','then','GetVoiceExtension','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20241e,_0x189bc0){var _0x17e8a8=function(_0x58814f){while(--_0x58814f){_0x20241e['push'](_0x20241e['shift']());}};_0x17e8a8(++_0x189bc0);}(_0x2c24,0x1e6));var _0x42c2=function(_0x53dde1,_0x48f998){_0x53dde1=_0x53dde1-0x0;var _0x224ace=_0x2c24[_0x53dde1];return _0x224ace;};'use strict';var _=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var moment=require(_0x42c2('0x2'));var BPromise=require(_0x42c2('0x3'));var rs=require(_0x42c2('0x4'));var fs=require('fs');var Redis=require(_0x42c2('0x5'));var db=require(_0x42c2('0x6'))['db'];var utils=require(_0x42c2('0x7'));var logger=require(_0x42c2('0x8'))('rpc');var config=require(_0x42c2('0x9'));var jayson=require(_0x42c2('0xa'));var client=jayson['client'][_0x42c2('0xb')]({'port':0x232a});config[_0x42c2('0xc')]=_[_0x42c2('0xd')](config[_0x42c2('0xc')],{'host':_0x42c2('0xe'),'port':0x18eb});var socket=require(_0x42c2('0xf'))(new Redis(config[_0x42c2('0xc')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x25575d,_0x371e53,_0x234dbf){return new BPromise(function(_0x5d7f5e,_0x112088){return client[_0x42c2('0x10')](_0x25575d,_0x234dbf)['then'](function(_0x5da4aa){logger[_0x42c2('0x11')](_0x42c2('0x12'),_0x371e53,'request\x20sent');logger['debug'](_0x42c2('0x13'),_0x371e53,_0x42c2('0x14'),JSON['stringify'](_0x5da4aa));if(_0x5da4aa[_0x42c2('0x15')]){if(_0x5da4aa[_0x42c2('0x15')][_0x42c2('0x16')]===0x1f4){logger[_0x42c2('0x15')](_0x42c2('0x12'),_0x371e53,_0x5da4aa[_0x42c2('0x15')][_0x42c2('0x17')]);return _0x112088(_0x5da4aa[_0x42c2('0x15')][_0x42c2('0x17')]);}logger[_0x42c2('0x15')](_0x42c2('0x12'),_0x371e53,_0x5da4aa[_0x42c2('0x15')]['message']);return _0x5d7f5e(_0x5da4aa[_0x42c2('0x15')][_0x42c2('0x17')]);}else{logger['info'](_0x42c2('0x12'),_0x371e53,'request\x20sent');_0x5d7f5e(_0x5da4aa[_0x42c2('0x18')][_0x42c2('0x17')]);}})['catch'](function(_0x3b6eab){logger[_0x42c2('0x15')](_0x42c2('0x12'),_0x371e53,_0x3b6eab);_0x112088(_0x3b6eab);});});}exports['GetVoiceExtension']=function(_0x52933e){var _0x3a90ad=this;return new Promise(function(_0x1788a0,_0x23c4ee){return db['VoiceExtension'][_0x42c2('0x19')]({'raw':_0x52933e['options']?_0x52933e[_0x42c2('0x1a')][_0x42c2('0x1b')]===undefined?!![]:![]:!![],'where':_0x52933e[_0x42c2('0x1a')]?_0x52933e[_0x42c2('0x1a')]['where']||null:null,'attributes':_0x52933e['options']?_0x52933e[_0x42c2('0x1a')]['attributes']||null:null,'limit':_0x52933e['options']?_0x52933e[_0x42c2('0x1a')][_0x42c2('0x1c')]||null:null,'include':_0x52933e[_0x42c2('0x1a')]?_0x52933e['options']['include']?_[_0x42c2('0x1d')](_0x52933e[_0x42c2('0x1a')][_0x42c2('0x1e')],function(_0x3cf10c){return{'model':db[_0x3cf10c[_0x42c2('0x1f')]],'as':_0x3cf10c['as'],'attributes':_0x3cf10c[_0x42c2('0x20')],'include':_0x3cf10c[_0x42c2('0x1e')]?_['map'](_0x3cf10c[_0x42c2('0x1e')],function(_0x11dd63){return{'model':db[_0x11dd63[_0x42c2('0x1f')]],'as':_0x11dd63['as'],'attributes':_0x11dd63[_0x42c2('0x20')],'include':_0x11dd63[_0x42c2('0x1e')]?_[_0x42c2('0x1d')](_0x11dd63[_0x42c2('0x1e')],function(_0xcd7a05){return{'model':db[_0xcd7a05[_0x42c2('0x1f')]],'as':_0xcd7a05['as'],'attributes':_0xcd7a05['attributes']};}):[]};}):[]};}):[]:[]})[_0x42c2('0x21')](function(_0x416308){logger[_0x42c2('0x11')](_0x42c2('0x22'),_0x52933e);logger[_0x42c2('0x23')](_0x42c2('0x22'),_0x52933e,JSON[_0x42c2('0x24')](_0x416308));_0x1788a0(_0x416308);})[_0x42c2('0x25')](function(_0x399cc1){logger[_0x42c2('0x15')](_0x42c2('0x22'),_0x399cc1[_0x42c2('0x17')],_0x52933e);_0x23c4ee(_0x3a90ad['error'](0x1f4,_0x399cc1[_0x42c2('0x17')]));});});};
\ No newline at end of file
+var _0xd8af=['redis','defaults','localhost','./voiceExtension.socket','register','request','then','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','VoiceExtension,\x20%s,\x20%s','message','info','request\x20sent','result','catch','GetVoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x23efe8,_0x69b604){var _0x394b38=function(_0x2b2d18){while(--_0x2b2d18){_0x23efe8['push'](_0x23efe8['shift']());}};_0x394b38(++_0x69b604);}(_0xd8af,0x18d));var _0xfd8a=function(_0x1bbfd9,_0xb51959){_0x1bbfd9=_0x1bbfd9-0x0;var _0x5333a7=_0xd8af[_0x1bbfd9];return _0x5333a7;};'use strict';var _=require(_0xfd8a('0x0'));var util=require(_0xfd8a('0x1'));var moment=require(_0xfd8a('0x2'));var BPromise=require(_0xfd8a('0x3'));var rs=require(_0xfd8a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd8a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd8a('0x6'))(_0xfd8a('0x7'));var config=require(_0xfd8a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd8a('0x9')]['http']({'port':0x232a});config[_0xfd8a('0xa')]=_[_0xfd8a('0xb')](config[_0xfd8a('0xa')],{'host':_0xfd8a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd8a('0xa')]));require(_0xfd8a('0xd'))[_0xfd8a('0xe')](socket);function respondWithRpcPromise(_0x25cab2,_0x203e62,_0xc2a4c7){return new BPromise(function(_0x5cc95e,_0x57a1a4){return client[_0xfd8a('0xf')](_0x25cab2,_0xc2a4c7)[_0xfd8a('0x10')](function(_0x456b2e){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x203e62,'request\x20sent');logger[_0xfd8a('0x11')](_0xfd8a('0x12'),_0x203e62,'request\x20sent',JSON['stringify'](_0x456b2e));if(_0x456b2e[_0xfd8a('0x13')]){if(_0x456b2e[_0xfd8a('0x13')][_0xfd8a('0x14')]===0x1f4){logger[_0xfd8a('0x13')](_0xfd8a('0x15'),_0x203e62,_0x456b2e[_0xfd8a('0x13')][_0xfd8a('0x16')]);return _0x57a1a4(_0x456b2e[_0xfd8a('0x13')][_0xfd8a('0x16')]);}logger[_0xfd8a('0x13')](_0xfd8a('0x15'),_0x203e62,_0x456b2e[_0xfd8a('0x13')][_0xfd8a('0x16')]);return _0x5cc95e(_0x456b2e[_0xfd8a('0x13')][_0xfd8a('0x16')]);}else{logger[_0xfd8a('0x17')](_0xfd8a('0x15'),_0x203e62,_0xfd8a('0x18'));_0x5cc95e(_0x456b2e[_0xfd8a('0x19')][_0xfd8a('0x16')]);}})[_0xfd8a('0x1a')](function(_0x19e7ed){logger[_0xfd8a('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x203e62,_0x19e7ed);_0x57a1a4(_0x19e7ed);});});}exports[_0xfd8a('0x1b')]=function(_0x9eade2){var _0x29c8e5=this;return new Promise(function(_0x53eb71,_0x34ff05){return db['VoiceExtension'][_0xfd8a('0x1c')]({'raw':_0x9eade2['options']?_0x9eade2[_0xfd8a('0x1d')][_0xfd8a('0x1e')]===undefined?!![]:![]:!![],'where':_0x9eade2[_0xfd8a('0x1d')]?_0x9eade2[_0xfd8a('0x1d')][_0xfd8a('0x1f')]||null:null,'attributes':_0x9eade2[_0xfd8a('0x1d')]?_0x9eade2[_0xfd8a('0x1d')]['attributes']||null:null,'limit':_0x9eade2[_0xfd8a('0x1d')]?_0x9eade2[_0xfd8a('0x1d')][_0xfd8a('0x20')]||null:null,'include':_0x9eade2[_0xfd8a('0x1d')]?_0x9eade2[_0xfd8a('0x1d')][_0xfd8a('0x21')]?_[_0xfd8a('0x22')](_0x9eade2[_0xfd8a('0x1d')][_0xfd8a('0x21')],function(_0x5e101e){return{'model':db[_0x5e101e[_0xfd8a('0x23')]],'as':_0x5e101e['as'],'attributes':_0x5e101e['attributes'],'include':_0x5e101e[_0xfd8a('0x21')]?_[_0xfd8a('0x22')](_0x5e101e[_0xfd8a('0x21')],function(_0x25d5d4){return{'model':db[_0x25d5d4[_0xfd8a('0x23')]],'as':_0x25d5d4['as'],'attributes':_0x25d5d4[_0xfd8a('0x24')],'include':_0x25d5d4[_0xfd8a('0x21')]?_[_0xfd8a('0x22')](_0x25d5d4[_0xfd8a('0x21')],function(_0x4a5926){return{'model':db[_0x4a5926[_0xfd8a('0x23')]],'as':_0x4a5926['as'],'attributes':_0x4a5926[_0xfd8a('0x24')]};}):[]};}):[]};}):[]:[]})[_0xfd8a('0x10')](function(_0x556db1){logger[_0xfd8a('0x17')](_0xfd8a('0x1b'),_0x9eade2);logger[_0xfd8a('0x11')](_0xfd8a('0x1b'),_0x9eade2,JSON['stringify'](_0x556db1));_0x53eb71(_0x556db1);})['catch'](function(_0x592e7c){logger[_0xfd8a('0x13')](_0xfd8a('0x1b'),_0x592e7c[_0xfd8a('0x16')],_0x9eade2);_0x34ff05(_0x29c8e5['error'](0x1f4,_0x592e7c[_0xfd8a('0x16')]));});});};
\ No newline at end of file
index 0a2746e..0b2b15d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x32a7da,_0x1dca6b){var _0x5cda96=function(_0x37cc24){while(--_0x37cc24){_0x32a7da['push'](_0x32a7da['shift']());}};_0x5cda96(++_0x1dca6b);}(_0x5fab,0x177));var _0xb5fa=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0x5fab[_0x296809];return _0x18c0d3;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}};
\ No newline at end of file
+var _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x36266a,_0x3d4bf8){var _0x17a395=function(_0x2b0ef2){while(--_0x2b0ef2){_0x36266a['push'](_0x36266a['shift']());}};_0x17a395(++_0x3d4bf8);}(_0x5fab,0x177));var _0xb5fa=function(_0x4814a7,_0x1a084d){_0x4814a7=_0x4814a7-0x0;var _0x406700=_0x5fab[_0x4814a7];return _0x406700;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}};
\ No newline at end of file
index 54d383b..30b38d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['../../config/environment','get','index','/:id','isAuthenticated','getMessages','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x318299,_0x4e1f32){var _0x50f736=function(_0x146042){while(--_0x146042){_0x318299['push'](_0x318299['shift']());}};_0x50f736(++_0x4e1f32);}(_0x1a37,0xb4));var _0x71a3=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x1a37[_0x5a79e2];return _0x266c45;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var fs_extra=require(_0x71a3('0x6'));var auth=require(_0x71a3('0x7'));var interaction=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var controller=require('./voiceMail.controller');router[_0x71a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x71a3('0xb')]);router[_0x71a3('0xa')](_0x71a3('0xc'),auth[_0x71a3('0xd')](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x71a3('0xe')]);router[_0x71a3('0xf')]('/',auth[_0x71a3('0xd')](),controller[_0x71a3('0x10')]);router[_0x71a3('0x11')](_0x71a3('0xc'),auth[_0x71a3('0xd')](),controller[_0x71a3('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x71a3('0x13')]);module[_0x71a3('0x14')]=router;
\ No newline at end of file
+var _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','/:id','isAuthenticated','show','/:id/messages','getMessages','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x1c6d71,_0x47568c){var _0x24b1a5=function(_0x101994){while(--_0x101994){_0x1c6d71['push'](_0x1c6d71['shift']());}};_0x24b1a5(++_0x47568c);}(_0x2ef3,0xba));var _0x32ef=function(_0x46398c,_0x44d656){_0x46398c=_0x46398c-0x0;var _0x1989af=_0x2ef3[_0x46398c];return _0x1989af;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router;
\ No newline at end of file
index 3b9746a..ec515f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bdf=['string','trim','central','ENUM','yes','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','contest_mailbox','setDataValue','email'];(function(_0x5fb13e,_0x488f7f){var _0x530159=function(_0x196aa8){while(--_0x196aa8){_0x5fb13e['push'](_0x5fb13e['shift']());}};_0x530159(++_0x488f7f);}(_0x6bdf,0x145));var _0xf6bd=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x6bdf[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require(_0xf6bd('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xf6bd('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0xf6bd('0x2')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xf6bd('0x2')},'password':{'type':Sequelize[_0xf6bd('0x1')]},'fullname':{'type':Sequelize[_0xf6bd('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x274073){this[_0xf6bd('0x3')](_0xf6bd('0x4'),typeof _0x274073===_0xf6bd('0x5')&&_0x274073['trim']()?_0x274073[_0xf6bd('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xf6bd('0x1')],'defaultValue':_0xf6bd('0x7')},'attach':{'type':Sequelize[_0xf6bd('0x8')](_0xf6bd('0x9'),'no'),'defaultValue':_0xf6bd('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xf6bd('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xf6bd('0x1')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf6bd('0x8')](_0xf6bd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf6bd('0x8')](_0xf6bd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xf6bd('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf6bd('0x8')](_0xf6bd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf6bd('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf6bd('0x8')](_0xf6bd('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xf6bd('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf6bd('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xf6bd('0x8')](_0xf6bd('0x9'),'no'),'defaultValue':_0xf6bd('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xf6bd('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xf6bd('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf6bd('0xa')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf6bd('0xb')](_0xf6bd('0xc'))+_0xf6bd('0xd')+this[_0xf6bd('0xb')](_0xf6bd('0xe'));}}};
\ No newline at end of file
+var _0xb20c=['getDataValue','fullname','\x20-\x20','mailbox','STRING','from-voicemail','email','string','trim','central','yes','ENUM','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x17c938,_0x557096){var _0x2d22b2=function(_0x5efcfd){while(--_0x5efcfd){_0x17c938['push'](_0x17c938['shift']());}};_0x2d22b2(++_0x557096);}(_0xb20c,0x199));var _0xcb20=function(_0x55d4c6,_0x4e5ac9){_0x55d4c6=_0x55d4c6-0x0;var _0x3d6e06=_0xb20c[_0x55d4c6];return _0x3d6e06;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0xcb20('0x0')]},'context':{'type':Sequelize[_0xcb20('0x0')],'defaultValue':_0xcb20('0x1'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0xcb20('0x0')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xcb20('0x0')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xcb20('0x0')],'validate':{'isEmail':!![]},'set':function(_0x52ce47){this['setDataValue'](_0xcb20('0x2'),typeof _0x52ce47===_0xcb20('0x3')&&_0x52ce47[_0xcb20('0x4')]()?_0x52ce47[_0xcb20('0x4')]():null);}},'pager':{'type':Sequelize[_0xcb20('0x0')]},'tz':{'type':Sequelize[_0xcb20('0x0')],'defaultValue':_0xcb20('0x5')},'attach':{'type':Sequelize['ENUM'](_0xcb20('0x6'),'no'),'defaultValue':_0xcb20('0x6'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xcb20('0x6'),'no'),'defaultValue':_0xcb20('0x6'),'allowNull':![]},'dialout':{'type':Sequelize[_0xcb20('0x0')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xcb20('0x7')](_0xcb20('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xcb20('0x7')](_0xcb20('0x6'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xcb20('0x7')](_0xcb20('0x6'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xcb20('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xcb20('0x7')](_0xcb20('0x6'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xcb20('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xcb20('0x7')](_0xcb20('0x6'),'no'),'defaultValue':_0xcb20('0x6'),'allowNull':![]},'forcename':{'type':Sequelize[_0xcb20('0x7')](_0xcb20('0x6'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xcb20('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xcb20('0x6'),'no'),'defaultValue':_0xcb20('0x6'),'allowNull':![]},'stamp':{'type':_0xcb20('0x8')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xcb20('0x0')]},'maxsecs':{'type':Sequelize[_0xcb20('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xcb20('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xcb20('0xa')],'get':function(){return this[_0xcb20('0xb')](_0xcb20('0xc'))+_0xcb20('0xd')+this[_0xcb20('0xb')](_0xcb20('0xe'));}}};
\ No newline at end of file
index 793d284..aff4d60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','include','catch','show','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','VoiceMailMessage','nolimit','filter','mailbox','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','get','Voicemails','end','error','name','send','index','map','VoiceMail'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xb688,0xcf));var _0x8b68=function(_0x8c47ba,_0x2ee783){_0x8c47ba=_0x8c47ba-0x0;var _0x422b3d=_0xb688[_0x8c47ba];return _0x422b3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b68('0x0'));var zipdir=require(_0x8b68('0x1'));var jsonpatch=require(_0x8b68('0x2'));var rp=require(_0x8b68('0x3'));var moment=require(_0x8b68('0x4'));var BPromise=require(_0x8b68('0x5'));var Mustache=require('mustache');var util=require(_0x8b68('0x6'));var path=require(_0x8b68('0x7'));var sox=require(_0x8b68('0x8'));var csv=require(_0x8b68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b68('0xa'));var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0x9'));var querystring=require(_0x8b68('0xf'));var Papa=require(_0x8b68('0x10'));var Redis=require(_0x8b68('0x11'));var authService=require(_0x8b68('0x12'));var qs=require(_0x8b68('0x13'));var as=require(_0x8b68('0x14'));var hardwareService=require(_0x8b68('0x15'));var logger=require(_0x8b68('0x16'))('api');var utils=require(_0x8b68('0x17'));var config=require(_0x8b68('0x18'));var licenseUtil=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];function respondWithStatusCode(_0x1965cf,_0x2f3af4){_0x2f3af4=_0x2f3af4||0xcc;return function(_0xaa8725){if(_0xaa8725){return _0x1965cf[_0x8b68('0x1b')](_0x2f3af4);}return _0x1965cf[_0x8b68('0x1c')](_0x2f3af4)['end']();};}function respondWithResult(_0xb2df35,_0x509033){_0x509033=_0x509033||0xc8;return function(_0x5e3c66){if(_0x5e3c66){return _0xb2df35[_0x8b68('0x1c')](_0x509033)[_0x8b68('0x1d')](_0x5e3c66);}};}function respondWithFilteredResult(_0x27d717,_0x5d3468){return function(_0x5c8d0e){if(_0x5c8d0e){var _0x23bd52=typeof _0x5d3468['offset']===_0x8b68('0x1e')&&typeof _0x5d3468[_0x8b68('0x1f')]===_0x8b68('0x1e');var _0x10c9c6=_0x5c8d0e['count'];var _0xd17693=_0x23bd52?0x0:_0x5d3468[_0x8b68('0x20')];var _0x4a68c7=_0x23bd52?_0x5c8d0e[_0x8b68('0x21')]:_0x5d3468[_0x8b68('0x20')]+_0x5d3468[_0x8b68('0x1f')];var _0x17f321;if(_0x4a68c7>=_0x10c9c6){_0x4a68c7=_0x10c9c6;_0x17f321=0xc8;}else{_0x17f321=0xce;}_0x27d717[_0x8b68('0x1c')](_0x17f321);return _0x27d717['set'](_0x8b68('0x22'),_0xd17693+'-'+_0x4a68c7+'/'+_0x10c9c6)[_0x8b68('0x1d')](_0x5c8d0e);}return null;};}function patchUpdates(_0x59e9b1){return function(_0x1a9788){try{jsonpatch[_0x8b68('0x23')](_0x1a9788,_0x59e9b1,!![]);}catch(_0x1dbc1d){return BPromise['reject'](_0x1dbc1d);}return _0x1a9788['save']();};}function saveUpdates(_0x23edc1,_0x59cb26){return function(_0x332202){if(_0x332202){return _0x332202[_0x8b68('0x24')](_0x23edc1)[_0x8b68('0x25')](function(_0x21ecca){return _0x21ecca;});}return null;};}function removeEntity(_0x32ddc5,_0x173524){return function(_0x59bb8a){if(_0x59bb8a){return _0x59bb8a[_0x8b68('0x26')]()[_0x8b68('0x25')](function(){var _0x4ca77d=_0x59bb8a[_0x8b68('0x27')]({'plain':!![]});var _0x3cf8d2=_0x8b68('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3cf8d2,'resourceId':_0x4ca77d['id']}})['then'](function(){return _0x59bb8a;});})[_0x8b68('0x25')](function(){_0x32ddc5[_0x8b68('0x1c')](0xcc)[_0x8b68('0x29')]();});}};}function handleEntityNotFound(_0x583476,_0x3311c7){return function(_0x53aaa2){if(!_0x53aaa2){_0x583476['sendStatus'](0x194);}return _0x53aaa2;};}function handleError(_0x3865ea,_0x59b3ce){_0x59b3ce=_0x59b3ce||0x1f4;return function(_0x26cad7){logger[_0x8b68('0x2a')](_0x26cad7['stack']);if(_0x26cad7['name']){delete _0x26cad7[_0x8b68('0x2b')];}_0x3865ea[_0x8b68('0x1c')](_0x59b3ce)[_0x8b68('0x2c')](_0x26cad7);};}exports[_0x8b68('0x2d')]=function(_0x210926,_0x2ad2df){var _0x460c37={},_0x5b7ed1={},_0x3b6d1b={'count':0x0,'rows':[]};var _0x50a1e9=_[_0x8b68('0x2e')](db[_0x8b68('0x2f')]['rawAttributes'],function(_0x216aa6){return{'name':_0x216aa6[_0x8b68('0x30')],'type':_0x216aa6[_0x8b68('0x31')]['key']};});_0x5b7ed1['model']=_[_0x8b68('0x2e')](_0x50a1e9,_0x8b68('0x2b'));_0x5b7ed1[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x210926[_0x8b68('0x32')]);_0x5b7ed1[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x5b7ed1[_0x8b68('0x36')],_0x5b7ed1[_0x8b68('0x32')]);_0x460c37[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x5b7ed1[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x210926[_0x8b68('0x32')][_0x8b68('0x38')]));_0x460c37[_0x8b68('0x37')]=_0x460c37[_0x8b68('0x37')][_0x8b68('0x39')]?_0x460c37[_0x8b68('0x37')]:_0x5b7ed1[_0x8b68('0x36')];if(!_0x210926[_0x8b68('0x32')][_0x8b68('0x3a')]('nolimit')){_0x460c37['limit']=qs[_0x8b68('0x1f')](_0x210926[_0x8b68('0x32')][_0x8b68('0x1f')]);_0x460c37[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x210926[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x460c37[_0x8b68('0x3b')]=qs['sort'](_0x210926[_0x8b68('0x32')][_0x8b68('0x3c')]);_0x460c37[_0x8b68('0x3d')]=qs[_0x8b68('0x34')](_[_0x8b68('0x3e')](_0x210926[_0x8b68('0x32')],_0x5b7ed1[_0x8b68('0x34')]),_0x50a1e9);if(_0x210926[_0x8b68('0x32')]['filter']){_0x460c37[_0x8b68('0x3d')]=_[_0x8b68('0x3f')](_0x460c37[_0x8b68('0x3d')],{'$or':_[_0x8b68('0x2e')](_0x50a1e9,function(_0x3ecc60){if(_0x3ecc60[_0x8b68('0x31')]!==_0x8b68('0x40')){var _0x50a9c6={};_0x50a9c6[_0x3ecc60[_0x8b68('0x2b')]]={'$like':'%'+_0x210926[_0x8b68('0x32')]['filter']+'%'};return _0x50a9c6;}})});}_0x460c37=_[_0x8b68('0x3f')]({},_0x460c37,_0x210926[_0x8b68('0x41')]);var _0x50b2f1={'where':_0x460c37['where']};return db['VoiceMail']['count'](_0x50b2f1)[_0x8b68('0x25')](function(_0x23d24a){_0x3b6d1b['count']=_0x23d24a;if(_0x210926[_0x8b68('0x32')]['includeAll']){_0x460c37[_0x8b68('0x42')]=[{'all':!![]}];}return db[_0x8b68('0x2f')]['findAll'](_0x460c37);})[_0x8b68('0x25')](function(_0x5ae345){_0x3b6d1b['rows']=_0x5ae345;return _0x3b6d1b;})['then'](respondWithFilteredResult(_0x2ad2df,_0x460c37))[_0x8b68('0x43')](handleError(_0x2ad2df,null));};exports[_0x8b68('0x44')]=function(_0x3ba80e,_0xa70f60){var _0x50e425={'raw':!![],'where':{'id':_0x3ba80e['params']['id']}},_0x20162a={};_0x20162a[_0x8b68('0x36')]=_[_0x8b68('0x33')](db['VoiceMail'][_0x8b68('0x45')]);_0x20162a[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3ba80e[_0x8b68('0x32')]);_0x20162a['filters']=_[_0x8b68('0x35')](_0x20162a[_0x8b68('0x36')],_0x20162a[_0x8b68('0x32')]);_0x50e425[_0x8b68('0x37')]=_[_0x8b68('0x35')](_0x20162a[_0x8b68('0x36')],qs[_0x8b68('0x38')](_0x3ba80e[_0x8b68('0x32')][_0x8b68('0x38')]));_0x50e425[_0x8b68('0x37')]=_0x50e425[_0x8b68('0x37')][_0x8b68('0x39')]?_0x50e425[_0x8b68('0x37')]:_0x20162a[_0x8b68('0x36')];if(_0x3ba80e[_0x8b68('0x32')][_0x8b68('0x46')]){_0x50e425['include']=[{'all':!![]}];}_0x50e425=_[_0x8b68('0x3f')]({},_0x50e425,_0x3ba80e[_0x8b68('0x41')]);return db['VoiceMail'][_0x8b68('0x47')](_0x50e425)['then'](handleEntityNotFound(_0xa70f60,null))['then'](respondWithResult(_0xa70f60,null))['catch'](handleError(_0xa70f60,null));};exports[_0x8b68('0x48')]=function(_0x35874b,_0x34047c){return db[_0x8b68('0x2f')]['create'](_0x35874b['body'],{})[_0x8b68('0x25')](function(_0x163fd5){var _0x1e900f=_0x35874b['user'][_0x8b68('0x27')]({'plain':!![]});if(!_0x1e900f)throw new Error(_0x8b68('0x49'));if(_0x1e900f['role']===_0x8b68('0x4a')){var _0xacac82=_0x163fd5['get']({'plain':!![]});var _0x18a9ae=_0x8b68('0x28');return db['UserProfileSection'][_0x8b68('0x47')]({'where':{'name':_0x18a9ae,'userProfileId':_0x1e900f[_0x8b68('0x4b')]},'raw':!![]})['then'](function(_0x543d74){if(_0x543d74&&_0x543d74['autoAssociation']===0x0){return db[_0x8b68('0x4c')][_0x8b68('0x48')]({'name':_0xacac82[_0x8b68('0x2b')],'resourceId':_0xacac82['id'],'type':_0x543d74[_0x8b68('0x2b')],'sectionId':_0x543d74['id']},{})['then'](function(){return _0x163fd5;});}else{return _0x163fd5;}})['catch'](function(_0x4492fd){logger[_0x8b68('0x2a')](_0x8b68('0x4d'),_0x4492fd);throw _0x4492fd;});}return _0x163fd5;})['then'](respondWithResult(_0x34047c,0xc9))[_0x8b68('0x43')](handleError(_0x34047c,null));};exports[_0x8b68('0x24')]=function(_0x3f9d34,_0x4dda69){if(_0x3f9d34[_0x8b68('0x4e')]['id']){delete _0x3f9d34['body']['id'];}return db[_0x8b68('0x2f')][_0x8b68('0x47')]({'where':{'id':_0x3f9d34['params']['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x4dda69,null))[_0x8b68('0x25')](saveUpdates(_0x3f9d34[_0x8b68('0x4e')],null))[_0x8b68('0x25')](respondWithResult(_0x4dda69,null))[_0x8b68('0x43')](handleError(_0x4dda69,null));};exports['destroy']=function(_0x241166,_0x3f3e43){return db[_0x8b68('0x2f')][_0x8b68('0x47')]({'where':{'id':_0x241166[_0x8b68('0x4f')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x3f3e43,null))[_0x8b68('0x25')](removeEntity(_0x3f3e43,null))[_0x8b68('0x43')](handleError(_0x3f3e43,null));};exports['getMessages']=function(_0x3f423e,_0x1a85da,_0x1e8694){return db[_0x8b68('0x2f')][_0x8b68('0x50')]({'where':{'id':_0x3f423e[_0x8b68('0x4f')]['id']}})[_0x8b68('0x25')](handleEntityNotFound(_0x1a85da,null))[_0x8b68('0x25')](function(_0x6d63cb){var _0x271dbe;var _0x368c86={},_0x42871e={};_0x42871e[_0x8b68('0x36')]=_[_0x8b68('0x33')](db[_0x8b68('0x51')][_0x8b68('0x45')]);_0x42871e[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3f423e[_0x8b68('0x32')]);_0x42871e[_0x8b68('0x34')]=_['intersection'](_0x42871e[_0x8b68('0x36')],_0x42871e['query']);_0x368c86['attributes']=_[_0x8b68('0x35')](_0x42871e['model'],qs[_0x8b68('0x38')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x38')]));_0x368c86['attributes']=_0x368c86[_0x8b68('0x37')][_0x8b68('0x39')]?_0x368c86[_0x8b68('0x37')]:_0x42871e[_0x8b68('0x36')];if(!_0x3f423e[_0x8b68('0x32')][_0x8b68('0x3a')](_0x8b68('0x52'))){_0x368c86['limit']=qs['limit'](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x1f')]);_0x368c86[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x20')]);}_0x368c86[_0x8b68('0x3b')]=qs[_0x8b68('0x3c')](_0x3f423e[_0x8b68('0x32')][_0x8b68('0x3c')]);_0x368c86[_0x8b68('0x3d')]=qs[_0x8b68('0x34')](_[_0x8b68('0x3e')](_0x3f423e[_0x8b68('0x32')],_0x42871e[_0x8b68('0x34')]));if(_0x3f423e[_0x8b68('0x32')][_0x8b68('0x53')]){_0x368c86[_0x8b68('0x3d')]=_['merge'](_0x368c86['where'],{'$or':_[_0x8b68('0x2e')](_0x368c86[_0x8b68('0x37')],function(_0x5bd581){var _0x48d57a={};_0x48d57a[_0x5bd581]={'$like':'%'+_0x3f423e['query'][_0x8b68('0x53')]+'%'};return _0x48d57a;})});}_0x368c86[_0x8b68('0x3d')]=_[_0x8b68('0x3f')](_0x368c86[_0x8b68('0x3d')],{'mailboxuser':_0x6d63cb[_0x8b68('0x54')]});_0x368c86=_['merge']({},_0x368c86,_0x3f423e[_0x8b68('0x41')]);return db[_0x8b68('0x51')]['findAndCountAll'](_0x368c86)[_0x8b68('0x25')](respondWithFilteredResult(_0x1a85da,_0x368c86));})['catch'](handleError(_0x1a85da,null));};
\ No newline at end of file
+var _0x84a0=['UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','update','destroy','then','get','Voicemails','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x84a0,0x66));var _0x084a=function(_0x12db6a,_0x327366){_0x12db6a=_0x12db6a-0x0;var _0x7dd50=_0x84a0[_0x12db6a];return _0x7dd50;};'use strict';var emlformat=require(_0x084a('0x0'));var rimraf=require(_0x084a('0x1'));var zipdir=require(_0x084a('0x2'));var jsonpatch=require(_0x084a('0x3'));var rp=require('request-promise');var moment=require(_0x084a('0x4'));var BPromise=require(_0x084a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x084a('0x6'));var sox=require(_0x084a('0x7'));var csv=require('to-csv');var ejs=require(_0x084a('0x8'));var fs=require('fs');var fs_extra=require(_0x084a('0x9'));var _=require(_0x084a('0xa'));var squel=require(_0x084a('0xb'));var crypto=require(_0x084a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x084a('0xd'));var toCsv=require(_0x084a('0xe'));var querystring=require(_0x084a('0xf'));var Papa=require(_0x084a('0x10'));var Redis=require(_0x084a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x084a('0x12'));var hardwareService=require(_0x084a('0x13'));var logger=require(_0x084a('0x14'))(_0x084a('0x15'));var utils=require(_0x084a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x084a('0x17'))['db'];function respondWithStatusCode(_0x3ca72f,_0xec90a5){_0xec90a5=_0xec90a5||0xcc;return function(_0x9245b1){if(_0x9245b1){return _0x3ca72f[_0x084a('0x18')](_0xec90a5);}return _0x3ca72f[_0x084a('0x19')](_0xec90a5)[_0x084a('0x1a')]();};}function respondWithResult(_0x3a76d1,_0x5aef40){_0x5aef40=_0x5aef40||0xc8;return function(_0x4277c9){if(_0x4277c9){return _0x3a76d1['status'](_0x5aef40)[_0x084a('0x1b')](_0x4277c9);}};}function respondWithFilteredResult(_0x3ccaca,_0x366624){return function(_0x2d35b8){if(_0x2d35b8){var _0xd20527=typeof _0x366624['offset']===_0x084a('0x1c')&&typeof _0x366624['limit']===_0x084a('0x1c');var _0x355b45=_0x2d35b8['count'];var _0xf2c333=_0xd20527?0x0:_0x366624[_0x084a('0x1d')];var _0x4134b9=_0xd20527?_0x2d35b8[_0x084a('0x1e')]:_0x366624[_0x084a('0x1d')]+_0x366624[_0x084a('0x1f')];var _0x447a19;if(_0x4134b9>=_0x355b45){_0x4134b9=_0x355b45;_0x447a19=0xc8;}else{_0x447a19=0xce;}_0x3ccaca[_0x084a('0x19')](_0x447a19);return _0x3ccaca[_0x084a('0x20')](_0x084a('0x21'),_0xf2c333+'-'+_0x4134b9+'/'+_0x355b45)[_0x084a('0x1b')](_0x2d35b8);}return null;};}function patchUpdates(_0x279e25){return function(_0x116328){try{jsonpatch[_0x084a('0x22')](_0x116328,_0x279e25,!![]);}catch(_0xf0dd98){return BPromise['reject'](_0xf0dd98);}return _0x116328[_0x084a('0x23')]();};}function saveUpdates(_0x1ad257,_0x41a90f){return function(_0x2d62bf){if(_0x2d62bf){return _0x2d62bf[_0x084a('0x24')](_0x1ad257)['then'](function(_0x755c24){return _0x755c24;});}return null;};}function removeEntity(_0x288e9e,_0x6346a5){return function(_0x1f2c9f){if(_0x1f2c9f){return _0x1f2c9f[_0x084a('0x25')]()[_0x084a('0x26')](function(){var _0x5be167=_0x1f2c9f[_0x084a('0x27')]({'plain':!![]});var _0x2af138=_0x084a('0x28');return db['UserProfileResource'][_0x084a('0x25')]({'where':{'type':_0x2af138,'resourceId':_0x5be167['id']}})[_0x084a('0x26')](function(){return _0x1f2c9f;});})[_0x084a('0x26')](function(){_0x288e9e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4874fe,_0x52227a){return function(_0x33b88f){if(!_0x33b88f){_0x4874fe['sendStatus'](0x194);}return _0x33b88f;};}function handleError(_0x5bea78,_0x51c9f4){_0x51c9f4=_0x51c9f4||0x1f4;return function(_0x3b8176){logger[_0x084a('0x29')](_0x3b8176[_0x084a('0x2a')]);if(_0x3b8176[_0x084a('0x2b')]){delete _0x3b8176[_0x084a('0x2b')];}_0x5bea78[_0x084a('0x19')](_0x51c9f4)[_0x084a('0x2c')](_0x3b8176);};}exports[_0x084a('0x2d')]=function(_0x5e6ea8,_0x2ed3cd){var _0x3b2b38={},_0x501a16={},_0xe1980b={'count':0x0,'rows':[]};var _0x24bcf5=_[_0x084a('0x2e')](db[_0x084a('0x2f')][_0x084a('0x30')],function(_0x202602){return{'name':_0x202602[_0x084a('0x31')],'type':_0x202602[_0x084a('0x32')][_0x084a('0x33')]};});_0x501a16[_0x084a('0x34')]=_[_0x084a('0x2e')](_0x24bcf5,_0x084a('0x2b'));_0x501a16[_0x084a('0x35')]=_['keys'](_0x5e6ea8['query']);_0x501a16[_0x084a('0x36')]=_[_0x084a('0x37')](_0x501a16[_0x084a('0x34')],_0x501a16[_0x084a('0x35')]);_0x3b2b38[_0x084a('0x38')]=_['intersection'](_0x501a16[_0x084a('0x34')],qs[_0x084a('0x39')](_0x5e6ea8[_0x084a('0x35')]['fields']));_0x3b2b38[_0x084a('0x38')]=_0x3b2b38[_0x084a('0x38')][_0x084a('0x3a')]?_0x3b2b38['attributes']:_0x501a16['model'];if(!_0x5e6ea8['query'][_0x084a('0x3b')](_0x084a('0x3c'))){_0x3b2b38[_0x084a('0x1f')]=qs['limit'](_0x5e6ea8[_0x084a('0x35')][_0x084a('0x1f')]);_0x3b2b38[_0x084a('0x1d')]=qs[_0x084a('0x1d')](_0x5e6ea8[_0x084a('0x35')][_0x084a('0x1d')]);}_0x3b2b38[_0x084a('0x3d')]=qs[_0x084a('0x3e')](_0x5e6ea8[_0x084a('0x35')][_0x084a('0x3e')]);_0x3b2b38[_0x084a('0x3f')]=qs[_0x084a('0x36')](_[_0x084a('0x40')](_0x5e6ea8[_0x084a('0x35')],_0x501a16[_0x084a('0x36')]),_0x24bcf5);if(_0x5e6ea8['query'][_0x084a('0x41')]){_0x3b2b38[_0x084a('0x3f')]=_[_0x084a('0x42')](_0x3b2b38[_0x084a('0x3f')],{'$or':_[_0x084a('0x2e')](_0x24bcf5,function(_0x22862b){if(_0x22862b[_0x084a('0x32')]!==_0x084a('0x43')){var _0x13dc4c={};_0x13dc4c[_0x22862b['name']]={'$like':'%'+_0x5e6ea8[_0x084a('0x35')][_0x084a('0x41')]+'%'};return _0x13dc4c;}})});}_0x3b2b38=_[_0x084a('0x42')]({},_0x3b2b38,_0x5e6ea8[_0x084a('0x44')]);var _0x256008={'where':_0x3b2b38[_0x084a('0x3f')]};return db['VoiceMail'][_0x084a('0x1e')](_0x256008)[_0x084a('0x26')](function(_0x55c5f4){_0xe1980b[_0x084a('0x1e')]=_0x55c5f4;if(_0x5e6ea8[_0x084a('0x35')][_0x084a('0x45')]){_0x3b2b38['include']=[{'all':!![]}];}return db[_0x084a('0x2f')][_0x084a('0x46')](_0x3b2b38);})['then'](function(_0x3e2b92){_0xe1980b[_0x084a('0x47')]=_0x3e2b92;return _0xe1980b;})['then'](respondWithFilteredResult(_0x2ed3cd,_0x3b2b38))['catch'](handleError(_0x2ed3cd,null));};exports[_0x084a('0x48')]=function(_0x17a8d4,_0x3726bd){var _0xec2713={'raw':!![],'where':{'id':_0x17a8d4[_0x084a('0x49')]['id']}},_0x1e2a2d={};_0x1e2a2d[_0x084a('0x34')]=_[_0x084a('0x4a')](db[_0x084a('0x2f')][_0x084a('0x30')]);_0x1e2a2d[_0x084a('0x35')]=_['keys'](_0x17a8d4['query']);_0x1e2a2d[_0x084a('0x36')]=_[_0x084a('0x37')](_0x1e2a2d[_0x084a('0x34')],_0x1e2a2d['query']);_0xec2713[_0x084a('0x38')]=_[_0x084a('0x37')](_0x1e2a2d[_0x084a('0x34')],qs[_0x084a('0x39')](_0x17a8d4[_0x084a('0x35')]['fields']));_0xec2713[_0x084a('0x38')]=_0xec2713['attributes'][_0x084a('0x3a')]?_0xec2713[_0x084a('0x38')]:_0x1e2a2d[_0x084a('0x34')];if(_0x17a8d4['query']['includeAll']){_0xec2713[_0x084a('0x4b')]=[{'all':!![]}];}_0xec2713=_[_0x084a('0x42')]({},_0xec2713,_0x17a8d4['options']);return db[_0x084a('0x2f')][_0x084a('0x4c')](_0xec2713)[_0x084a('0x26')](handleEntityNotFound(_0x3726bd,null))[_0x084a('0x26')](respondWithResult(_0x3726bd,null))['catch'](handleError(_0x3726bd,null));};exports[_0x084a('0x4d')]=function(_0x865368,_0x31677b){return db[_0x084a('0x2f')]['create'](_0x865368[_0x084a('0x4e')],{})[_0x084a('0x26')](function(_0x411fa9){var _0x2d3d01=_0x865368['user']['get']({'plain':!![]});if(!_0x2d3d01)throw new Error(_0x084a('0x4f'));if(_0x2d3d01[_0x084a('0x50')]===_0x084a('0x51')){var _0x264f09=_0x411fa9[_0x084a('0x27')]({'plain':!![]});var _0x3b2df4=_0x084a('0x28');return db[_0x084a('0x52')][_0x084a('0x4c')]({'where':{'name':_0x3b2df4,'userProfileId':_0x2d3d01[_0x084a('0x53')]},'raw':!![]})[_0x084a('0x26')](function(_0x98769c){if(_0x98769c&&_0x98769c['autoAssociation']===0x0){return db[_0x084a('0x54')][_0x084a('0x4d')]({'name':_0x264f09[_0x084a('0x2b')],'resourceId':_0x264f09['id'],'type':_0x98769c[_0x084a('0x2b')],'sectionId':_0x98769c['id']},{})[_0x084a('0x26')](function(){return _0x411fa9;});}else{return _0x411fa9;}})[_0x084a('0x55')](function(_0xa5362){logger['error'](_0x084a('0x56'),_0xa5362);throw _0xa5362;});}return _0x411fa9;})[_0x084a('0x26')](respondWithResult(_0x31677b,0xc9))[_0x084a('0x55')](handleError(_0x31677b,null));};exports['update']=function(_0x54ca1f,_0x424cd1){if(_0x54ca1f['body']['id']){delete _0x54ca1f[_0x084a('0x4e')]['id'];}return db[_0x084a('0x2f')]['find']({'where':{'id':_0x54ca1f[_0x084a('0x49')]['id']}})['then'](handleEntityNotFound(_0x424cd1,null))['then'](saveUpdates(_0x54ca1f[_0x084a('0x4e')],null))[_0x084a('0x26')](respondWithResult(_0x424cd1,null))[_0x084a('0x55')](handleError(_0x424cd1,null));};exports[_0x084a('0x25')]=function(_0x2a8056,_0x57d397){return db[_0x084a('0x2f')]['find']({'where':{'id':_0x2a8056[_0x084a('0x49')]['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x57d397,null))[_0x084a('0x26')](removeEntity(_0x57d397,null))['catch'](handleError(_0x57d397,null));};exports[_0x084a('0x57')]=function(_0x339088,_0x12db87,_0x9246dd){return db['VoiceMail'][_0x084a('0x58')]({'where':{'id':_0x339088['params']['id']}})[_0x084a('0x26')](handleEntityNotFound(_0x12db87,null))[_0x084a('0x26')](function(_0x21a18a){var _0x4cc344;var _0x589e38={},_0xd37003={};_0xd37003[_0x084a('0x34')]=_['keys'](db[_0x084a('0x59')]['rawAttributes']);_0xd37003['query']=_[_0x084a('0x4a')](_0x339088[_0x084a('0x35')]);_0xd37003[_0x084a('0x36')]=_[_0x084a('0x37')](_0xd37003[_0x084a('0x34')],_0xd37003[_0x084a('0x35')]);_0x589e38[_0x084a('0x38')]=_[_0x084a('0x37')](_0xd37003[_0x084a('0x34')],qs['fields'](_0x339088[_0x084a('0x35')][_0x084a('0x39')]));_0x589e38[_0x084a('0x38')]=_0x589e38['attributes'][_0x084a('0x3a')]?_0x589e38[_0x084a('0x38')]:_0xd37003['model'];if(!_0x339088[_0x084a('0x35')]['hasOwnProperty']('nolimit')){_0x589e38[_0x084a('0x1f')]=qs['limit'](_0x339088['query'][_0x084a('0x1f')]);_0x589e38[_0x084a('0x1d')]=qs[_0x084a('0x1d')](_0x339088['query'][_0x084a('0x1d')]);}_0x589e38[_0x084a('0x3d')]=qs[_0x084a('0x3e')](_0x339088[_0x084a('0x35')][_0x084a('0x3e')]);_0x589e38[_0x084a('0x3f')]=qs[_0x084a('0x36')](_['pick'](_0x339088['query'],_0xd37003[_0x084a('0x36')]));if(_0x339088[_0x084a('0x35')]['filter']){_0x589e38[_0x084a('0x3f')]=_[_0x084a('0x42')](_0x589e38[_0x084a('0x3f')],{'$or':_[_0x084a('0x2e')](_0x589e38['attributes'],function(_0x21dd85){var _0x3fa52e={};_0x3fa52e[_0x21dd85]={'$like':'%'+_0x339088[_0x084a('0x35')]['filter']+'%'};return _0x3fa52e;})});}_0x589e38['where']=_[_0x084a('0x42')](_0x589e38[_0x084a('0x3f')],{'mailboxuser':_0x21a18a[_0x084a('0x5a')]});_0x589e38=_[_0x084a('0x42')]({},_0x589e38,_0x339088[_0x084a('0x44')]);return db[_0x084a('0x59')][_0x084a('0x5b')](_0x589e38)['then'](respondWithFilteredResult(_0x12db87,_0x589e38));})[_0x084a('0x55')](handleError(_0x12db87,null));};
\ No newline at end of file
index 0751cd7..315f14b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeab5=['define','VoiceMail','voice_voicemail','mailbox_context','context','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x3f5c49,_0x19e9ab){var _0x35599d=function(_0xa97e06){while(--_0xa97e06){_0x3f5c49['push'](_0x3f5c49['shift']());}};_0x35599d(++_0x19e9ab);}(_0xeab5,0x139));var _0x5eab=function(_0x37bc4a,_0x3d0e65){_0x37bc4a=_0x37bc4a-0x0;var _0x4f075f=_0xeab5[_0x37bc4a];return _0x4f075f;};'use strict';var _=require('lodash');var util=require(_0x5eab('0x0'));var logger=require(_0x5eab('0x1'))(_0x5eab('0x2'));var moment=require(_0x5eab('0x3'));var BPromise=require(_0x5eab('0x4'));var rp=require(_0x5eab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5eab('0x6'));var config=require(_0x5eab('0x7'));var attributes=require(_0x5eab('0x8'));module['exports']=function(_0x2b5b73,_0x2a62bb){return _0x2b5b73[_0x5eab('0x9')](_0x5eab('0xa'),attributes,{'tableName':_0x5eab('0xb'),'paranoid':![],'indexes':[{'name':_0x5eab('0xc'),'fields':['mailbox',_0x5eab('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x970e=['../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x182d6e,_0x373aaf){var _0x250f67=function(_0x36b2fe){while(--_0x36b2fe){_0x182d6e['push'](_0x182d6e['shift']());}};_0x250f67(++_0x373aaf);}(_0x970e,0x6a));var _0xe970=function(_0x5f0a9a,_0x48b799){_0x5f0a9a=_0x5f0a9a-0x0;var _0x437ed7=_0x970e[_0x5f0a9a];return _0x437ed7;};'use strict';var _=require(_0xe970('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe970('0x1'));var moment=require(_0xe970('0x2'));var BPromise=require(_0xe970('0x3'));var rp=require(_0xe970('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe970('0x5'));var config=require(_0xe970('0x6'));var attributes=require(_0xe970('0x7'));module['exports']=function(_0x4c7699,_0x56117f){return _0x4c7699[_0xe970('0x8')](_0xe970('0x9'),attributes,{'tableName':_0xe970('0xa'),'paranoid':![],'indexes':[{'name':_0xe970('0xb'),'fields':[_0xe970('0xc'),_0xe970('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index a92508f..94f0587 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c3e=['moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','VoiceMail,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8c3e,0xe2));var _0xe8c3=function(_0xe480f0,_0x4c0dc1){_0xe480f0=_0xe480f0-0x0;var _0x57b198=_0x8c3e[_0xe480f0];return _0x57b198;};'use strict';var _=require(_0xe8c3('0x0'));var util=require(_0xe8c3('0x1'));var moment=require(_0xe8c3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8c3('0x3'))['db'];var utils=require(_0xe8c3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe8c3('0x5'));var jayson=require(_0xe8c3('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43e954,_0x45293b,_0x52d3d1){return new BPromise(function(_0xaa4cb4,_0x4de6ff){return client[_0xe8c3('0x7')](_0x43e954,_0x52d3d1)[_0xe8c3('0x8')](function(_0x4f3a7c){logger[_0xe8c3('0x9')]('VoiceMail,\x20%s,\x20%s',_0x45293b,'request\x20sent');logger[_0xe8c3('0xa')](_0xe8c3('0xb'),_0x45293b,_0xe8c3('0xc'),JSON['stringify'](_0x4f3a7c));if(_0x4f3a7c['error']){if(_0x4f3a7c[_0xe8c3('0xd')][_0xe8c3('0xe')]===0x1f4){logger[_0xe8c3('0xd')]('VoiceMail,\x20%s,\x20%s',_0x45293b,_0x4f3a7c[_0xe8c3('0xd')][_0xe8c3('0xf')]);return _0x4de6ff(_0x4f3a7c['error'][_0xe8c3('0xf')]);}logger[_0xe8c3('0xd')](_0xe8c3('0x10'),_0x45293b,_0x4f3a7c[_0xe8c3('0xd')][_0xe8c3('0xf')]);return _0xaa4cb4(_0x4f3a7c[_0xe8c3('0xd')][_0xe8c3('0xf')]);}else{logger['info'](_0xe8c3('0x10'),_0x45293b,'request\x20sent');_0xaa4cb4(_0x4f3a7c[_0xe8c3('0x11')][_0xe8c3('0xf')]);}})[_0xe8c3('0x12')](function(_0x295b5f){logger[_0xe8c3('0xd')](_0xe8c3('0x10'),_0x45293b,_0x295b5f);_0x4de6ff(_0x295b5f);});});}
\ No newline at end of file
+var _0xc225=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xae1737,_0x57ede3){var _0x43ca22=function(_0x5d8fd1){while(--_0x5d8fd1){_0xae1737['push'](_0xae1737['shift']());}};_0x43ca22(++_0x57ede3);}(_0xc225,0x15e));var _0x5c22=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc225[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x5c22('0x0'));var util=require('util');var moment=require(_0x5c22('0x1'));var BPromise=require(_0x5c22('0x2'));var rs=require(_0x5c22('0x3'));var fs=require('fs');var Redis=require(_0x5c22('0x4'));var db=require(_0x5c22('0x5'))['db'];var utils=require(_0x5c22('0x6'));var logger=require('../../config/logger')(_0x5c22('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5c22('0x8')][_0x5c22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17481f,_0x2d43fa,_0x2ed5d1){return new BPromise(function(_0x1ec3ff,_0x50e378){return client[_0x5c22('0xa')](_0x17481f,_0x2ed5d1)[_0x5c22('0xb')](function(_0x45392f){logger[_0x5c22('0xc')](_0x5c22('0xd'),_0x2d43fa,_0x5c22('0xe'));logger[_0x5c22('0xf')](_0x5c22('0x10'),_0x2d43fa,_0x5c22('0xe'),JSON[_0x5c22('0x11')](_0x45392f));if(_0x45392f['error']){if(_0x45392f[_0x5c22('0x12')][_0x5c22('0x13')]===0x1f4){logger['error'](_0x5c22('0xd'),_0x2d43fa,_0x45392f[_0x5c22('0x12')][_0x5c22('0x14')]);return _0x50e378(_0x45392f['error'][_0x5c22('0x14')]);}logger[_0x5c22('0x12')](_0x5c22('0xd'),_0x2d43fa,_0x45392f[_0x5c22('0x12')][_0x5c22('0x14')]);return _0x1ec3ff(_0x45392f['error'][_0x5c22('0x14')]);}else{logger[_0x5c22('0xc')](_0x5c22('0xd'),_0x2d43fa,_0x5c22('0xe'));_0x1ec3ff(_0x45392f[_0x5c22('0x15')]['message']);}})[_0x5c22('0x16')](function(_0x1e339b){logger[_0x5c22('0x12')](_0x5c22('0xd'),_0x2d43fa,_0x1e339b);_0x50e378(_0x1e339b);});});}
\ No newline at end of file
index 2d136cc..e49a710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42e5=['post','create','put','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x413832,_0xf21300){var _0x585b62=function(_0x227c30){while(--_0x227c30){_0x413832['push'](_0x413832['shift']());}};_0x585b62(++_0xf21300);}(_0x42e5,0x1a8));var _0x542e=function(_0x4bfbda,_0x332198){_0x4bfbda=_0x4bfbda-0x0;var _0x3811c8=_0x42e5[_0x4bfbda];return _0x3811c8;};'use strict';var multer=require(_0x542e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x542e('0x1'));var express=require('express');var router=express[_0x542e('0x2')]();var fs_extra=require(_0x542e('0x3'));var auth=require(_0x542e('0x4'));var interaction=require(_0x542e('0x5'));var config=require('../../config/environment');var controller=require(_0x542e('0x6'));router[_0x542e('0x7')]('/',auth[_0x542e('0x8')](),controller[_0x542e('0x9')]);router[_0x542e('0x7')](_0x542e('0xa'),auth[_0x542e('0x8')](),controller[_0x542e('0xb')]);router[_0x542e('0x7')](_0x542e('0xc'),auth[_0x542e('0x8')](),controller['download']);router[_0x542e('0xd')]('/',auth['isAuthenticated'](),controller[_0x542e('0xe')]);router[_0x542e('0xf')](_0x542e('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x542e('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x542e('0x11')]);module[_0x542e('0x12')]=router;
\ No newline at end of file
+var _0x1e2c=['update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put'];(function(_0xc1b7ab,_0x3f2649){var _0x4f858d=function(_0x179283){while(--_0x179283){_0xc1b7ab['push'](_0xc1b7ab['shift']());}};_0x4f858d(++_0x3f2649);}(_0x1e2c,0x17e));var _0xc1e2=function(_0x2882ec,_0x4075c2){_0x2882ec=_0x2882ec-0x0;var _0x50da5e=_0x1e2c[_0x2882ec];return _0x50da5e;};'use strict';var multer=require(_0xc1e2('0x0'));var util=require(_0xc1e2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc1e2('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc1e2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc1e2('0x4'));var controller=require(_0xc1e2('0x5'));router[_0xc1e2('0x6')]('/',auth[_0xc1e2('0x7')](),controller[_0xc1e2('0x8')]);router[_0xc1e2('0x6')](_0xc1e2('0x9'),auth[_0xc1e2('0x7')](),controller['show']);router[_0xc1e2('0x6')](_0xc1e2('0xa'),auth['isAuthenticated'](),controller[_0xc1e2('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc1e2('0xc')]);router[_0xc1e2('0xd')](_0xc1e2('0x9'),auth[_0xc1e2('0x7')](),controller[_0xc1e2('0xe')]);router[_0xc1e2('0xf')](_0xc1e2('0x9'),auth[_0xc1e2('0x7')](),controller[_0xc1e2('0x10')]);module[_0xc1e2('0x11')]=router;
\ No newline at end of file
index 52bbe6d..538dafd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c5b=['INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','getDataValue'];(function(_0x548d2d,_0x5485a5){var _0x39743d=function(_0x53f08a){while(--_0x53f08a){_0x548d2d['push'](_0x548d2d['shift']());}};_0x39743d(++_0x5485a5);}(_0x0c5b,0x1b6));var _0xb0c5=function(_0x474e3d,_0x5cf4e9){_0x474e3d=_0x474e3d-0x0;var _0x153416=_0x0c5b[_0x474e3d];return _0x153416;};'use strict';var Sequelize=require(_0xb0c5('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5cfa61){return this[_0xb0c5('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xb0c5('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb0c5('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xb0c5('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xb0c5('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb0c5('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xb0c5('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xb0c5('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb0c5('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xb0c5('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xb0c5('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb0c5('0x3')],'defaultValue':''},'stamp':{'type':_0xb0c5('0x5'),'defaultValue':Sequelize[_0xb0c5('0x6')](_0xb0c5('0x7'))}};
\ No newline at end of file
+var _0x1243=['STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue'];(function(_0x1b88a0,_0x5dbb4a){var _0x2533f6=function(_0x30ecbd){while(--_0x30ecbd){_0x1b88a0['push'](_0x1b88a0['shift']());}};_0x2533f6(++_0x5dbb4a);}(_0x1243,0x8d));var _0x3124=function(_0x1b8fcc,_0x4167d9){_0x1b8fcc=_0x1b8fcc-0x0;var _0x5eb893=_0x1243[_0x1b8fcc];return _0x5eb893;};'use strict';var Sequelize=require(_0x3124('0x0'));module['exports']={'name':{'type':Sequelize[_0x3124('0x1')],'get':function(_0x37388f){return this[_0x3124('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x3124('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3124('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3124('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3124('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x3124('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3124('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3124('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x3124('0x4')](_0x3124('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3124('0x3')],'defaultValue':''},'stamp':{'type':_0x3124('0x6'),'defaultValue':Sequelize[_0x3124('0x7')](_0x3124('0x8'))}};
\ No newline at end of file
index 4d24d77..efe11af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32b9=['update','then','destroy','sendStatus','error','stack','name','send','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','params','length','include','find','create','body','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','.wav\x22','eml-format','zip-dir','request-promise','bluebird','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x476105,_0x33e7ad){var _0x5ca15b=function(_0x3edcf0){while(--_0x3edcf0){_0x476105['push'](_0x476105['shift']());}};_0x5ca15b(++_0x33e7ad);}(_0x32b9,0x136));var _0x932b=function(_0x3631bc,_0x5ceb3f){_0x3631bc=_0x3631bc-0x0;var _0x57e0b8=_0x32b9[_0x3631bc];return _0x57e0b8;};'use strict';var emlformat=require(_0x932b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x932b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x932b('0x2'));var moment=require('moment');var BPromise=require(_0x932b('0x3'));var Mustache=require(_0x932b('0x4'));var util=require(_0x932b('0x5'));var path=require(_0x932b('0x6'));var sox=require(_0x932b('0x7'));var csv=require(_0x932b('0x8'));var ejs=require(_0x932b('0x9'));var fs=require('fs');var fs_extra=require(_0x932b('0xa'));var _=require(_0x932b('0xb'));var squel=require('squel');var crypto=require(_0x932b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x932b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x932b('0xe'));var Papa=require(_0x932b('0xf'));var Redis=require(_0x932b('0x10'));var authService=require(_0x932b('0x11'));var qs=require(_0x932b('0x12'));var as=require(_0x932b('0x13'));var hardwareService=require(_0x932b('0x14'));var logger=require('../../config/logger')(_0x932b('0x15'));var utils=require(_0x932b('0x16'));var config=require(_0x932b('0x17'));var licenseUtil=require(_0x932b('0x18'));var db=require(_0x932b('0x19'))['db'];function respondWithStatusCode(_0x4f02e3,_0x596066){_0x596066=_0x596066||0xcc;return function(_0x3d27e5){if(_0x3d27e5){return _0x4f02e3['sendStatus'](_0x596066);}return _0x4f02e3[_0x932b('0x1a')](_0x596066)[_0x932b('0x1b')]();};}function respondWithResult(_0x487f24,_0x51bc73){_0x51bc73=_0x51bc73||0xc8;return function(_0x3a29a9){if(_0x3a29a9){return _0x487f24[_0x932b('0x1a')](_0x51bc73)[_0x932b('0x1c')](_0x3a29a9);}};}function respondWithFilteredResult(_0x4e48ae,_0x2286b6){return function(_0x24edba){if(_0x24edba){var _0x429b24=typeof _0x2286b6[_0x932b('0x1d')]===_0x932b('0x1e')&&typeof _0x2286b6[_0x932b('0x1f')]===_0x932b('0x1e');var _0xe3c6cd=_0x24edba[_0x932b('0x20')];var _0x149f30=_0x429b24?0x0:_0x2286b6['offset'];var _0x160670=_0x429b24?_0x24edba['count']:_0x2286b6[_0x932b('0x1d')]+_0x2286b6[_0x932b('0x1f')];var _0x473ee2;if(_0x160670>=_0xe3c6cd){_0x160670=_0xe3c6cd;_0x473ee2=0xc8;}else{_0x473ee2=0xce;}_0x4e48ae[_0x932b('0x1a')](_0x473ee2);return _0x4e48ae[_0x932b('0x21')](_0x932b('0x22'),_0x149f30+'-'+_0x160670+'/'+_0xe3c6cd)[_0x932b('0x1c')](_0x24edba);}return null;};}function patchUpdates(_0x1a1097){return function(_0x5375d4){try{jsonpatch[_0x932b('0x23')](_0x5375d4,_0x1a1097,!![]);}catch(_0x3e7322){return BPromise[_0x932b('0x24')](_0x3e7322);}return _0x5375d4[_0x932b('0x25')]();};}function saveUpdates(_0x385497,_0x3fadca){return function(_0x560fb8){if(_0x560fb8){return _0x560fb8[_0x932b('0x26')](_0x385497)[_0x932b('0x27')](function(_0x51654b){return _0x51654b;});}return null;};}function removeEntity(_0xd5d7f3,_0x3db3d0){return function(_0x5b737e){if(_0x5b737e){return _0x5b737e[_0x932b('0x28')]()[_0x932b('0x27')](function(){_0xd5d7f3[_0x932b('0x1a')](0xcc)[_0x932b('0x1b')]();});}};}function handleEntityNotFound(_0x57e1ca,_0xbd0b0c){return function(_0x3938b4){if(!_0x3938b4){_0x57e1ca[_0x932b('0x29')](0x194);}return _0x3938b4;};}function handleError(_0x1a1067,_0x4fe747){_0x4fe747=_0x4fe747||0x1f4;return function(_0x471580){logger[_0x932b('0x2a')](_0x471580[_0x932b('0x2b')]);if(_0x471580[_0x932b('0x2c')]){delete _0x471580['name'];}_0x1a1067['status'](_0x4fe747)[_0x932b('0x2d')](_0x471580);};}exports['index']=function(_0x11b07e,_0x1a0f51){var _0xa08ffa={},_0x4e1344={},_0x38f24f={'count':0x0,'rows':[]};var _0x270b3d=_[_0x932b('0x2e')](db[_0x932b('0x2f')][_0x932b('0x30')],function(_0x13a359){return{'name':_0x13a359[_0x932b('0x31')],'type':_0x13a359[_0x932b('0x32')][_0x932b('0x33')]};});_0x4e1344[_0x932b('0x34')]=_[_0x932b('0x35')](_['map'](_0x270b3d,_0x932b('0x2c')),[_0x932b('0x2c')]);_0x4e1344[_0x932b('0x36')]=_[_0x932b('0x37')](_0x11b07e[_0x932b('0x36')]);_0x4e1344['filters']=_[_0x932b('0x38')](_0x4e1344[_0x932b('0x34')],_0x4e1344['query']);_0xa08ffa['attributes']=_[_0x932b('0x38')](_0x4e1344[_0x932b('0x34')],qs['fields'](_0x11b07e[_0x932b('0x36')][_0x932b('0x39')]));_0xa08ffa['attributes']=_0xa08ffa[_0x932b('0x3a')]['length']?_0xa08ffa['attributes']:_0x4e1344[_0x932b('0x34')];if(!_0x11b07e[_0x932b('0x36')][_0x932b('0x3b')](_0x932b('0x3c'))){_0xa08ffa['limit']=qs[_0x932b('0x1f')](_0x11b07e[_0x932b('0x36')][_0x932b('0x1f')]);_0xa08ffa[_0x932b('0x1d')]=qs[_0x932b('0x1d')](_0x11b07e[_0x932b('0x36')][_0x932b('0x1d')]);}_0xa08ffa[_0x932b('0x3d')]=qs['sort'](_0x11b07e[_0x932b('0x36')][_0x932b('0x3e')]);_0xa08ffa[_0x932b('0x3f')]=qs[_0x932b('0x40')](_[_0x932b('0x41')](_0x11b07e[_0x932b('0x36')],_0x4e1344[_0x932b('0x40')]),_0x270b3d);if(_0x11b07e['query'][_0x932b('0x42')]){_0xa08ffa[_0x932b('0x3f')]=_[_0x932b('0x43')](_0xa08ffa['where'],{'$or':_[_0x932b('0x2e')](_0x270b3d,function(_0x2eb0f2){if(_0x2eb0f2[_0x932b('0x32')]!=='VIRTUAL'){var _0x591491={};_0x591491[_0x2eb0f2[_0x932b('0x2c')]]={'$like':'%'+_0x11b07e[_0x932b('0x36')][_0x932b('0x42')]+'%'};return _0x591491;}})});}_0xa08ffa=_[_0x932b('0x43')]({},_0xa08ffa,_0x11b07e[_0x932b('0x44')]);var _0x367049={'where':_0xa08ffa[_0x932b('0x3f')]};return db[_0x932b('0x2f')][_0x932b('0x20')](_0x367049)[_0x932b('0x27')](function(_0x132a54){_0x38f24f[_0x932b('0x20')]=_0x132a54;if(_0x11b07e['query'][_0x932b('0x45')]){_0xa08ffa['include']=[{'all':!![]}];}return db[_0x932b('0x2f')][_0x932b('0x46')](_0xa08ffa);})['then'](function(_0x1efe07){_0x38f24f[_0x932b('0x47')]=_0x1efe07;return _0x38f24f;})[_0x932b('0x27')](respondWithFilteredResult(_0x1a0f51,_0xa08ffa))[_0x932b('0x48')](handleError(_0x1a0f51,null));};exports['show']=function(_0x22c452,_0xefa354){var _0xc1ca89={'raw':!![],'where':{'id':_0x22c452[_0x932b('0x49')]['id']}},_0x578762={};_0x578762[_0x932b('0x34')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x578762[_0x932b('0x36')]=_[_0x932b('0x37')](_0x22c452[_0x932b('0x36')]);_0x578762['filters']=_[_0x932b('0x38')](_0x578762[_0x932b('0x34')],_0x578762[_0x932b('0x36')]);_0xc1ca89[_0x932b('0x3a')]=_[_0x932b('0x38')](_0x578762[_0x932b('0x34')],qs['fields'](_0x22c452[_0x932b('0x36')][_0x932b('0x39')]));_0xc1ca89['attributes']=_0xc1ca89['attributes'][_0x932b('0x4a')]?_0xc1ca89[_0x932b('0x3a')]:_0x578762[_0x932b('0x34')];if(_0x22c452[_0x932b('0x36')]['includeAll']){_0xc1ca89[_0x932b('0x4b')]=[{'all':!![]}];}_0xc1ca89=_['merge']({},_0xc1ca89,_0x22c452[_0x932b('0x44')]);return db['VoiceMailMessage'][_0x932b('0x4c')](_0xc1ca89)[_0x932b('0x27')](handleEntityNotFound(_0xefa354,null))['then'](respondWithResult(_0xefa354,null))['catch'](handleError(_0xefa354,null));};exports[_0x932b('0x4d')]=function(_0x16adfd,_0x19f77c){return db['VoiceMailMessage'][_0x932b('0x4d')](_0x16adfd['body'],{})[_0x932b('0x27')](respondWithResult(_0x19f77c,0xc9))[_0x932b('0x48')](handleError(_0x19f77c,null));};exports[_0x932b('0x26')]=function(_0x1eb1e4,_0x1d5169){if(_0x1eb1e4['body']['id']){delete _0x1eb1e4[_0x932b('0x4e')]['id'];}return db[_0x932b('0x2f')][_0x932b('0x4c')]({'where':{'id':_0x1eb1e4['params']['id']}})[_0x932b('0x27')](handleEntityNotFound(_0x1d5169,null))['then'](saveUpdates(_0x1eb1e4['body'],null))[_0x932b('0x27')](respondWithResult(_0x1d5169,null))[_0x932b('0x48')](handleError(_0x1d5169,null));};exports[_0x932b('0x28')]=function(_0x499c4a,_0x4b4d95){return db[_0x932b('0x2f')]['find']({'where':{'id':_0x499c4a['params']['id']}})[_0x932b('0x27')](handleEntityNotFound(_0x4b4d95,null))[_0x932b('0x27')](removeEntity(_0x4b4d95,null))['catch'](handleError(_0x4b4d95,null));};exports['download']=function(_0x41879d,_0x30aa74,_0xe11b84){return db['VoiceMailMessage'][_0x932b('0x4c')]({'where':{'id':_0x41879d['params']['id']},'attributes':['id',_0x932b('0x4f'),_0x932b('0x50')]})[_0x932b('0x27')](handleEntityNotFound(_0x30aa74,null))[_0x932b('0x27')](function(_0x3c33ca){if(_0x3c33ca){if(!_0x3c33ca[_0x932b('0x4f')]){throw new db[(_0x932b('0x51'))][(_0x932b('0x52'))](_0x932b('0x53'));}var _0x28be5c={'Content-Type':_0x932b('0x54'),'Content-Disposition':_0x932b('0x55')};if(_0x3c33ca['msg_id']){_0x28be5c['Content-Disposition']='attachment;\x20filename=\x22'+_0x3c33ca[_0x932b('0x50')]+_0x932b('0x56');}_0x30aa74[_0x932b('0x21')](_0x28be5c);return _0x30aa74[_0x932b('0x2d')](new Buffer(_0x3c33ca[_0x932b('0x4f')]));}})[_0x932b('0x48')](handleError(_0x30aa74,null));};
\ No newline at end of file
+var _0x03a7=['create','body','destroy','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','apply','save','then','stack','name','send','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','includeAll','include','rows','catch','show','params','keys','merge','options','find'];(function(_0x391dea,_0x2fd252){var _0x5e8a8f=function(_0x21da48){while(--_0x21da48){_0x391dea['push'](_0x391dea['shift']());}};_0x5e8a8f(++_0x2fd252);}(_0x03a7,0x1a0));var _0x703a=function(_0x460139,_0x1d8d65){_0x460139=_0x460139-0x0;var _0x3b1c27=_0x03a7[_0x460139];return _0x3b1c27;};'use strict';var emlformat=require(_0x703a('0x0'));var rimraf=require(_0x703a('0x1'));var zipdir=require(_0x703a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x703a('0x3'));var moment=require(_0x703a('0x4'));var BPromise=require(_0x703a('0x5'));var Mustache=require(_0x703a('0x6'));var util=require(_0x703a('0x7'));var path=require('path');var sox=require(_0x703a('0x8'));var csv=require('to-csv');var ejs=require(_0x703a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x703a('0xa'));var squel=require(_0x703a('0xb'));var crypto=require('crypto');var jsforce=require(_0x703a('0xc'));var deskjs=require(_0x703a('0xd'));var toCsv=require(_0x703a('0xe'));var querystring=require(_0x703a('0xf'));var Papa=require(_0x703a('0x10'));var Redis=require(_0x703a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x703a('0x12'));var as=require(_0x703a('0x13'));var hardwareService=require(_0x703a('0x14'));var logger=require(_0x703a('0x15'))(_0x703a('0x16'));var utils=require(_0x703a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x703a('0x18'));var db=require(_0x703a('0x19'))['db'];function respondWithStatusCode(_0x3de8b0,_0x2af14f){_0x2af14f=_0x2af14f||0xcc;return function(_0x4aa350){if(_0x4aa350){return _0x3de8b0[_0x703a('0x1a')](_0x2af14f);}return _0x3de8b0['status'](_0x2af14f)[_0x703a('0x1b')]();};}function respondWithResult(_0x1ec48c,_0x4d02da){_0x4d02da=_0x4d02da||0xc8;return function(_0x446aea){if(_0x446aea){return _0x1ec48c[_0x703a('0x1c')](_0x4d02da)[_0x703a('0x1d')](_0x446aea);}};}function respondWithFilteredResult(_0x56c73d,_0x354e56){return function(_0x1ebc86){if(_0x1ebc86){var _0x479dc4=typeof _0x354e56[_0x703a('0x1e')]==='undefined'&&typeof _0x354e56[_0x703a('0x1f')]==='undefined';var _0x5f42a1=_0x1ebc86[_0x703a('0x20')];var _0x123cae=_0x479dc4?0x0:_0x354e56[_0x703a('0x1e')];var _0x273b9b=_0x479dc4?_0x1ebc86[_0x703a('0x20')]:_0x354e56[_0x703a('0x1e')]+_0x354e56['limit'];var _0x168406;if(_0x273b9b>=_0x5f42a1){_0x273b9b=_0x5f42a1;_0x168406=0xc8;}else{_0x168406=0xce;}_0x56c73d[_0x703a('0x1c')](_0x168406);return _0x56c73d[_0x703a('0x21')]('Content-Range',_0x123cae+'-'+_0x273b9b+'/'+_0x5f42a1)[_0x703a('0x1d')](_0x1ebc86);}return null;};}function patchUpdates(_0x4d3080){return function(_0x2538b9){try{jsonpatch[_0x703a('0x22')](_0x2538b9,_0x4d3080,!![]);}catch(_0x122939){return BPromise['reject'](_0x122939);}return _0x2538b9[_0x703a('0x23')]();};}function saveUpdates(_0x4790e8,_0xa35f02){return function(_0x19cd73){if(_0x19cd73){return _0x19cd73['update'](_0x4790e8)[_0x703a('0x24')](function(_0x6e93d3){return _0x6e93d3;});}return null;};}function removeEntity(_0x987d8c,_0x3b9795){return function(_0x15b576){if(_0x15b576){return _0x15b576['destroy']()['then'](function(){_0x987d8c[_0x703a('0x1c')](0xcc)[_0x703a('0x1b')]();});}};}function handleEntityNotFound(_0x1a504c,_0x4803e0){return function(_0x2692ff){if(!_0x2692ff){_0x1a504c[_0x703a('0x1a')](0x194);}return _0x2692ff;};}function handleError(_0x200708,_0x4a63c4){_0x4a63c4=_0x4a63c4||0x1f4;return function(_0x4e25b7){logger['error'](_0x4e25b7[_0x703a('0x25')]);if(_0x4e25b7[_0x703a('0x26')]){delete _0x4e25b7[_0x703a('0x26')];}_0x200708[_0x703a('0x1c')](_0x4a63c4)[_0x703a('0x27')](_0x4e25b7);};}exports['index']=function(_0x3420be,_0x2df217){var _0x5b14d7={},_0x1a7208={},_0x336fe0={'count':0x0,'rows':[]};var _0x5bd207=_[_0x703a('0x28')](db[_0x703a('0x29')][_0x703a('0x2a')],function(_0x19c68f){return{'name':_0x19c68f[_0x703a('0x2b')],'type':_0x19c68f['type'][_0x703a('0x2c')]};});_0x1a7208[_0x703a('0x2d')]=_[_0x703a('0x2e')](_['map'](_0x5bd207,_0x703a('0x26')),[_0x703a('0x26')]);_0x1a7208['query']=_['keys'](_0x3420be[_0x703a('0x2f')]);_0x1a7208[_0x703a('0x30')]=_['intersection'](_0x1a7208[_0x703a('0x2d')],_0x1a7208[_0x703a('0x2f')]);_0x5b14d7[_0x703a('0x31')]=_[_0x703a('0x32')](_0x1a7208[_0x703a('0x2d')],qs[_0x703a('0x33')](_0x3420be['query'][_0x703a('0x33')]));_0x5b14d7['attributes']=_0x5b14d7[_0x703a('0x31')][_0x703a('0x34')]?_0x5b14d7[_0x703a('0x31')]:_0x1a7208[_0x703a('0x2d')];if(!_0x3420be['query'][_0x703a('0x35')](_0x703a('0x36'))){_0x5b14d7[_0x703a('0x1f')]=qs[_0x703a('0x1f')](_0x3420be[_0x703a('0x2f')][_0x703a('0x1f')]);_0x5b14d7[_0x703a('0x1e')]=qs['offset'](_0x3420be[_0x703a('0x2f')][_0x703a('0x1e')]);}_0x5b14d7[_0x703a('0x37')]=qs[_0x703a('0x38')](_0x3420be[_0x703a('0x2f')][_0x703a('0x38')]);_0x5b14d7[_0x703a('0x39')]=qs['filters'](_['pick'](_0x3420be[_0x703a('0x2f')],_0x1a7208['filters']),_0x5bd207);if(_0x3420be[_0x703a('0x2f')][_0x703a('0x3a')]){_0x5b14d7['where']=_['merge'](_0x5b14d7['where'],{'$or':_[_0x703a('0x28')](_0x5bd207,function(_0x18d286){if(_0x18d286[_0x703a('0x3b')]!=='VIRTUAL'){var _0x5ade41={};_0x5ade41[_0x18d286[_0x703a('0x26')]]={'$like':'%'+_0x3420be[_0x703a('0x2f')]['filter']+'%'};return _0x5ade41;}})});}_0x5b14d7=_['merge']({},_0x5b14d7,_0x3420be['options']);var _0x300ead={'where':_0x5b14d7['where']};return db['VoiceMailMessage'][_0x703a('0x20')](_0x300ead)[_0x703a('0x24')](function(_0x4f7106){_0x336fe0[_0x703a('0x20')]=_0x4f7106;if(_0x3420be[_0x703a('0x2f')][_0x703a('0x3c')]){_0x5b14d7[_0x703a('0x3d')]=[{'all':!![]}];}return db[_0x703a('0x29')]['findAll'](_0x5b14d7);})[_0x703a('0x24')](function(_0x30871d){_0x336fe0[_0x703a('0x3e')]=_0x30871d;return _0x336fe0;})[_0x703a('0x24')](respondWithFilteredResult(_0x2df217,_0x5b14d7))[_0x703a('0x3f')](handleError(_0x2df217,null));};exports[_0x703a('0x40')]=function(_0xbea126,_0x55b05f){var _0x1e8c16={'raw':!![],'where':{'id':_0xbea126[_0x703a('0x41')]['id']}},_0x450546={};_0x450546[_0x703a('0x2d')]=_[_0x703a('0x42')](db['VoiceMailMessage'][_0x703a('0x2a')]);_0x450546[_0x703a('0x2f')]=_['keys'](_0xbea126[_0x703a('0x2f')]);_0x450546[_0x703a('0x30')]=_[_0x703a('0x32')](_0x450546[_0x703a('0x2d')],_0x450546['query']);_0x1e8c16[_0x703a('0x31')]=_[_0x703a('0x32')](_0x450546[_0x703a('0x2d')],qs[_0x703a('0x33')](_0xbea126['query'][_0x703a('0x33')]));_0x1e8c16[_0x703a('0x31')]=_0x1e8c16['attributes'][_0x703a('0x34')]?_0x1e8c16[_0x703a('0x31')]:_0x450546['model'];if(_0xbea126[_0x703a('0x2f')][_0x703a('0x3c')]){_0x1e8c16['include']=[{'all':!![]}];}_0x1e8c16=_[_0x703a('0x43')]({},_0x1e8c16,_0xbea126[_0x703a('0x44')]);return db[_0x703a('0x29')][_0x703a('0x45')](_0x1e8c16)[_0x703a('0x24')](handleEntityNotFound(_0x55b05f,null))[_0x703a('0x24')](respondWithResult(_0x55b05f,null))[_0x703a('0x3f')](handleError(_0x55b05f,null));};exports[_0x703a('0x46')]=function(_0x5d6a35,_0x51a9f1){return db[_0x703a('0x29')][_0x703a('0x46')](_0x5d6a35[_0x703a('0x47')],{})[_0x703a('0x24')](respondWithResult(_0x51a9f1,0xc9))[_0x703a('0x3f')](handleError(_0x51a9f1,null));};exports['update']=function(_0x124a7a,_0x12c149){if(_0x124a7a[_0x703a('0x47')]['id']){delete _0x124a7a[_0x703a('0x47')]['id'];}return db[_0x703a('0x29')][_0x703a('0x45')]({'where':{'id':_0x124a7a[_0x703a('0x41')]['id']}})[_0x703a('0x24')](handleEntityNotFound(_0x12c149,null))[_0x703a('0x24')](saveUpdates(_0x124a7a[_0x703a('0x47')],null))[_0x703a('0x24')](respondWithResult(_0x12c149,null))[_0x703a('0x3f')](handleError(_0x12c149,null));};exports[_0x703a('0x48')]=function(_0x457091,_0x43699d){return db[_0x703a('0x29')]['find']({'where':{'id':_0x457091[_0x703a('0x41')]['id']}})[_0x703a('0x24')](handleEntityNotFound(_0x43699d,null))[_0x703a('0x24')](removeEntity(_0x43699d,null))[_0x703a('0x3f')](handleError(_0x43699d,null));};exports['download']=function(_0x51a387,_0x16f620,_0x432199){return db[_0x703a('0x29')]['find']({'where':{'id':_0x51a387[_0x703a('0x41')]['id']},'attributes':['id','recording',_0x703a('0x49')]})['then'](handleEntityNotFound(_0x16f620,null))[_0x703a('0x24')](function(_0x40cd1){if(_0x40cd1){if(!_0x40cd1[_0x703a('0x4a')]){throw new db[(_0x703a('0x4b'))][(_0x703a('0x4c'))](_0x703a('0x4d'));}var _0x528da2={'Content-Type':_0x703a('0x4e'),'Content-Disposition':_0x703a('0x4f')};if(_0x40cd1[_0x703a('0x49')]){_0x528da2['Content-Disposition']='attachment;\x20filename=\x22'+_0x40cd1[_0x703a('0x49')]+_0x703a('0x50');}_0x16f620[_0x703a('0x21')](_0x528da2);return _0x16f620[_0x703a('0x27')](new Buffer(_0x40cd1[_0x703a('0x4a')]));}})['catch'](handleError(_0x16f620,null));};
\ No newline at end of file
index d5ac438..626413c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf74b=['api','moment','bluebird','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger'];(function(_0x4172ff,_0x2e2140){var _0x1bcf38=function(_0x30faa8){while(--_0x30faa8){_0x4172ff['push'](_0x4172ff['shift']());}};_0x1bcf38(++_0x2e2140);}(_0xf74b,0x115));var _0xbf74=function(_0x3e546e,_0x34b108){_0x3e546e=_0x3e546e-0x0;var _0x2dbd7b=_0xf74b[_0x3e546e];return _0x2dbd7b;};'use strict';var _=require(_0xbf74('0x0'));var util=require(_0xbf74('0x1'));var logger=require(_0xbf74('0x2'))(_0xbf74('0x3'));var moment=require(_0xbf74('0x4'));var BPromise=require(_0xbf74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf74('0x6'));var rimraf=require('rimraf');var config=require(_0xbf74('0x7'));var attributes=require(_0xbf74('0x8'));module[_0xbf74('0x9')]=function(_0x485624,_0x475af8){return _0x485624[_0xbf74('0xa')](_0xbf74('0xb'),attributes,{'tableName':_0xbf74('0xc'),'paranoid':![],'indexes':[{'name':_0xbf74('0xd'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
+var _0xee73=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x2ac1ca,_0x5cc564){var _0x5f26ac=function(_0x40babc){while(--_0x40babc){_0x2ac1ca['push'](_0x2ac1ca['shift']());}};_0x5f26ac(++_0x5cc564);}(_0xee73,0x179));var _0x3ee7=function(_0x1cb128,_0x2770eb){_0x1cb128=_0x1cb128-0x0;var _0x4843e2=_0xee73[_0x1cb128];return _0x4843e2;};'use strict';var _=require(_0x3ee7('0x0'));var util=require(_0x3ee7('0x1'));var logger=require(_0x3ee7('0x2'))(_0x3ee7('0x3'));var moment=require(_0x3ee7('0x4'));var BPromise=require('bluebird');var rp=require(_0x3ee7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ee7('0x6'));var config=require(_0x3ee7('0x7'));var attributes=require(_0x3ee7('0x8'));module['exports']=function(_0x333ef9,_0x2d21a5){return _0x333ef9[_0x3ee7('0x9')](_0x3ee7('0xa'),attributes,{'tableName':_0x3ee7('0xb'),'paranoid':![],'indexes':[{'name':_0x3ee7('0xc'),'fields':[_0x3ee7('0xc')]}],'timestamps':![]});};
\ No newline at end of file
index 9232219..b04b550 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd6d=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xdd6d,0x8d));var _0xddd6=function(_0x171e67,_0x715926){_0x171e67=_0x171e67-0x0;var _0x57e295=_0xdd6d[_0x171e67];return _0x57e295;};'use strict';var _=require(_0xddd6('0x0'));var util=require(_0xddd6('0x1'));var moment=require(_0xddd6('0x2'));var BPromise=require(_0xddd6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xddd6('0x4'));var logger=require(_0xddd6('0x5'))(_0xddd6('0x6'));var config=require(_0xddd6('0x7'));var jayson=require(_0xddd6('0x8'));var client=jayson[_0xddd6('0x9')][_0xddd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x190266,_0x1fb6e7,_0x444658){return new BPromise(function(_0x516f75,_0x14fb89){return client[_0xddd6('0xb')](_0x190266,_0x444658)['then'](function(_0x5df2ca){logger[_0xddd6('0xc')](_0xddd6('0xd'),_0x1fb6e7,_0xddd6('0xe'));logger[_0xddd6('0xf')](_0xddd6('0x10'),_0x1fb6e7,_0xddd6('0xe'),JSON[_0xddd6('0x11')](_0x5df2ca));if(_0x5df2ca[_0xddd6('0x12')]){if(_0x5df2ca[_0xddd6('0x12')]['code']===0x1f4){logger[_0xddd6('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x1fb6e7,_0x5df2ca['error'][_0xddd6('0x13')]);return _0x14fb89(_0x5df2ca[_0xddd6('0x12')][_0xddd6('0x13')]);}logger[_0xddd6('0x12')](_0xddd6('0xd'),_0x1fb6e7,_0x5df2ca['error'][_0xddd6('0x13')]);return _0x516f75(_0x5df2ca[_0xddd6('0x12')][_0xddd6('0x13')]);}else{logger['info'](_0xddd6('0xd'),_0x1fb6e7,_0xddd6('0xe'));_0x516f75(_0x5df2ca[_0xddd6('0x14')][_0xddd6('0x13')]);}})[_0xddd6('0x15')](function(_0x4e2e56){logger[_0xddd6('0x12')](_0xddd6('0xd'),_0x1fb6e7,_0x4e2e56);_0x14fb89(_0x4e2e56);});});}
\ No newline at end of file
+var _0x277c=['client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x20da04,_0x43f0ab){var _0x2f15ad=function(_0x3e51bf){while(--_0x3e51bf){_0x20da04['push'](_0x20da04['shift']());}};_0x2f15ad(++_0x43f0ab);}(_0x277c,0xbd));var _0xc277=function(_0x1240f9,_0x5a877a){_0x1240f9=_0x1240f9-0x0;var _0x46372f=_0x277c[_0x1240f9];return _0x46372f;};'use strict';var _=require(_0xc277('0x0'));var util=require(_0xc277('0x1'));var moment=require(_0xc277('0x2'));var BPromise=require(_0xc277('0x3'));var rs=require(_0xc277('0x4'));var fs=require('fs');var Redis=require(_0xc277('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc277('0x6'));var config=require(_0xc277('0x7'));var jayson=require(_0xc277('0x8'));var client=jayson[_0xc277('0x9')][_0xc277('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x217064,_0x43ade0,_0x5b43f9){return new BPromise(function(_0x2863a7,_0x2d0756){return client[_0xc277('0xb')](_0x217064,_0x5b43f9)[_0xc277('0xc')](function(_0x497e9d){logger[_0xc277('0xd')](_0xc277('0xe'),_0x43ade0,_0xc277('0xf'));logger[_0xc277('0x10')](_0xc277('0x11'),_0x43ade0,'request\x20sent',JSON['stringify'](_0x497e9d));if(_0x497e9d[_0xc277('0x12')]){if(_0x497e9d[_0xc277('0x12')][_0xc277('0x13')]===0x1f4){logger[_0xc277('0x12')](_0xc277('0xe'),_0x43ade0,_0x497e9d[_0xc277('0x12')][_0xc277('0x14')]);return _0x2d0756(_0x497e9d[_0xc277('0x12')][_0xc277('0x14')]);}logger[_0xc277('0x12')](_0xc277('0xe'),_0x43ade0,_0x497e9d[_0xc277('0x12')][_0xc277('0x14')]);return _0x2863a7(_0x497e9d[_0xc277('0x12')]['message']);}else{logger[_0xc277('0xd')](_0xc277('0xe'),_0x43ade0,_0xc277('0xf'));_0x2863a7(_0x497e9d[_0xc277('0x15')][_0xc277('0x14')]);}})['catch'](function(_0x418cef){logger[_0xc277('0x12')](_0xc277('0xe'),_0x43ade0,_0x418cef);_0x2d0756(_0x418cef);});});}
\ No newline at end of file
index 98208d3..4b5ba37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff9=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','show','getSounds','post','/:id/sounds','put','update','delete','destroy','/:id/sounds/:id2'];(function(_0x1ed8c1,_0x195854){var _0x272092=function(_0x1a6def){while(--_0x1a6def){_0x1ed8c1['push'](_0x1ed8c1['shift']());}};_0x272092(++_0x195854);}(_0xfff9,0x161));var _0x9fff=function(_0x3cb6fa,_0x516f15){_0x3cb6fa=_0x3cb6fa-0x0;var _0x4d786e=_0xfff9[_0x3cb6fa];return _0x4d786e;};'use strict';var multer=require(_0x9fff('0x0'));var util=require(_0x9fff('0x1'));var path=require('path');var timeout=require(_0x9fff('0x2'));var express=require(_0x9fff('0x3'));var router=express['Router']();var fs_extra=require(_0x9fff('0x4'));var auth=require(_0x9fff('0x5'));var interaction=require(_0x9fff('0x6'));var config=require('../../config/environment');var controller=require(_0x9fff('0x7'));router[_0x9fff('0x8')]('/',auth['isAuthenticated'](),controller[_0x9fff('0x9')]);router[_0x9fff('0x8')](_0x9fff('0xa'),auth[_0x9fff('0xb')](),controller[_0x9fff('0xc')]);router[_0x9fff('0x8')]('/:id/sounds',auth[_0x9fff('0xb')](),controller[_0x9fff('0xd')]);router[_0x9fff('0xe')]('/',auth[_0x9fff('0xb')](),controller['create']);router['post'](_0x9fff('0xf'),auth[_0x9fff('0xb')](),controller['addSound']);router[_0x9fff('0x10')]('/:id',auth[_0x9fff('0xb')](),controller[_0x9fff('0x11')]);router[_0x9fff('0x12')](_0x9fff('0xa'),auth[_0x9fff('0xb')](),controller[_0x9fff('0x13')]);router[_0x9fff('0x12')](_0x9fff('0x14'),auth['isAuthenticated'](),controller['removeSound']);module[_0x9fff('0x15')]=router;
\ No newline at end of file
+var _0x9eba=['update','delete','destroy','removeSound','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','show','/:id/sounds','getSounds','create','addSound','put','/:id'];(function(_0xe42dc5,_0x2aaa5e){var _0x5d7dbf=function(_0x43ae81){while(--_0x43ae81){_0xe42dc5['push'](_0xe42dc5['shift']());}};_0x5d7dbf(++_0x2aaa5e);}(_0x9eba,0x9b));var _0xa9eb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9eba[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xa9eb('0x0'));var util=require('util');var path=require(_0xa9eb('0x1'));var timeout=require(_0xa9eb('0x2'));var express=require(_0xa9eb('0x3'));var router=express[_0xa9eb('0x4')]();var fs_extra=require(_0xa9eb('0x5'));var auth=require(_0xa9eb('0x6'));var interaction=require(_0xa9eb('0x7'));var config=require(_0xa9eb('0x8'));var controller=require(_0xa9eb('0x9'));router['get']('/',auth[_0xa9eb('0xa')](),controller[_0xa9eb('0xb')]);router[_0xa9eb('0xc')]('/:id',auth[_0xa9eb('0xa')](),controller[_0xa9eb('0xd')]);router[_0xa9eb('0xc')](_0xa9eb('0xe'),auth['isAuthenticated'](),controller[_0xa9eb('0xf')]);router['post']('/',auth[_0xa9eb('0xa')](),controller[_0xa9eb('0x10')]);router['post'](_0xa9eb('0xe'),auth[_0xa9eb('0xa')](),controller[_0xa9eb('0x11')]);router[_0xa9eb('0x12')](_0xa9eb('0x13'),auth[_0xa9eb('0xa')](),controller[_0xa9eb('0x14')]);router[_0xa9eb('0x15')]('/:id',auth[_0xa9eb('0xa')](),controller[_0xa9eb('0x16')]);router[_0xa9eb('0x15')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0xa9eb('0x17')]);module[_0xa9eb('0x18')]=router;
\ No newline at end of file
index ac03cf4..5646732 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91fa=['sequelize','exports','name','ENUM','custom','mp3nb','quietmp3nb','mp3','STRING','TIMESTAMP','BOOLEAN'];(function(_0x19e974,_0x274146){var _0x3f1a92=function(_0x3803d6){while(--_0x3803d6){_0x19e974['push'](_0x19e974['shift']());}};_0x3f1a92(++_0x274146);}(_0x91fa,0xa5));var _0xa91f=function(_0x393db8,_0x3e1157){_0x393db8=_0x393db8-0x0;var _0x4295cc=_0x91fa[_0x393db8];return _0x4295cc;};'use strict';var Sequelize=require(_0xa91f('0x0'));module[_0xa91f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa91f('0x2')},'mode':{'type':Sequelize[_0xa91f('0x3')](_0xa91f('0x4'),'files',_0xa91f('0x5'),_0xa91f('0x6'),'quietmp3',_0xa91f('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xa91f('0x8')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xa91f('0x8')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xa91f('0x8')],'allowNull':!![]},'stamp':{'type':_0xa91f('0x9')},'defaultEntry':{'type':Sequelize[_0xa91f('0xa')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1e35=['alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','ENUM','custom','files','mp3nb','quietmp3nb','mp3','STRING'];(function(_0x32e1d5,_0x34463b){var _0x37df37=function(_0x546a35){while(--_0x546a35){_0x32e1d5['push'](_0x32e1d5['shift']());}};_0x37df37(++_0x34463b);}(_0x1e35,0x189));var _0x51e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e35[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x51e3('0x0'));module[_0x51e3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x51e3('0x2')},'mode':{'type':Sequelize[_0x51e3('0x3')](_0x51e3('0x4'),_0x51e3('0x5'),_0x51e3('0x6'),_0x51e3('0x7'),'quietmp3',_0x51e3('0x8')),'allowNull':!![],'defaultValue':_0x51e3('0x5')},'directory':{'type':Sequelize[_0x51e3('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0x51e3('0x9')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x51e3('0x9')],'allowNull':!![],'defaultValue':_0x51e3('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x51e3('0xb')},'defaultEntry':{'type':Sequelize[_0x51e3('0xc')],'defaultValue':0x0}};
\ No newline at end of file
index 48af46b..3011d6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbea8=['json','offset','limit','undefined','set','Content-Range','apply','reject','update','then','destroy','get','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','count','includeAll','include','rows','show','params','options','find','catch','body','create','transaction','mode','files','directory','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','createdAt','join','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','removeSound','findOne','id2','getSounds','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end'];(function(_0x269c23,_0x289264){var _0x184ecd=function(_0x32756b){while(--_0x32756b){_0x269c23['push'](_0x269c23['shift']());}};_0x184ecd(++_0x289264);}(_0xbea8,0x140));var _0x8bea=function(_0x4a1ec0,_0x26287b){_0x4a1ec0=_0x4a1ec0-0x0;var _0x49ab91=_0xbea8[_0x4a1ec0];return _0x49ab91;};'use strict';var emlformat=require(_0x8bea('0x0'));var rimraf=require(_0x8bea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8bea('0x2'));var rp=require('request-promise');var moment=require(_0x8bea('0x3'));var BPromise=require(_0x8bea('0x4'));var Mustache=require(_0x8bea('0x5'));var util=require(_0x8bea('0x6'));var path=require(_0x8bea('0x7'));var sox=require(_0x8bea('0x8'));var csv=require(_0x8bea('0x9'));var ejs=require(_0x8bea('0xa'));var fs=require('fs');var fs_extra=require(_0x8bea('0xb'));var _=require(_0x8bea('0xc'));var squel=require('squel');var crypto=require(_0x8bea('0xd'));var jsforce=require(_0x8bea('0xe'));var deskjs=require(_0x8bea('0xf'));var toCsv=require(_0x8bea('0x9'));var querystring=require(_0x8bea('0x10'));var Papa=require(_0x8bea('0x11'));var Redis=require(_0x8bea('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8bea('0x13'));var as=require(_0x8bea('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bea('0x15'))(_0x8bea('0x16'));var utils=require(_0x8bea('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8bea('0x18'))['db'];function respondWithStatusCode(_0x574fa2,_0x282665){_0x282665=_0x282665||0xcc;return function(_0x455c4c){if(_0x455c4c){return _0x574fa2[_0x8bea('0x19')](_0x282665);}return _0x574fa2[_0x8bea('0x1a')](_0x282665)[_0x8bea('0x1b')]();};}function respondWithResult(_0x48664f,_0x115b6f){_0x115b6f=_0x115b6f||0xc8;return function(_0x3e3eb9){if(_0x3e3eb9){return _0x48664f[_0x8bea('0x1a')](_0x115b6f)[_0x8bea('0x1c')](_0x3e3eb9);}};}function respondWithFilteredResult(_0x253547,_0xf11a3){return function(_0x9bf0b4){if(_0x9bf0b4){var _0x87c8df=typeof _0xf11a3[_0x8bea('0x1d')]==='undefined'&&typeof _0xf11a3[_0x8bea('0x1e')]===_0x8bea('0x1f');var _0x199f76=_0x9bf0b4['count'];var _0x5cb6b8=_0x87c8df?0x0:_0xf11a3[_0x8bea('0x1d')];var _0x3fa35b=_0x87c8df?_0x9bf0b4['count']:_0xf11a3[_0x8bea('0x1d')]+_0xf11a3[_0x8bea('0x1e')];var _0xa7eff5;if(_0x3fa35b>=_0x199f76){_0x3fa35b=_0x199f76;_0xa7eff5=0xc8;}else{_0xa7eff5=0xce;}_0x253547[_0x8bea('0x1a')](_0xa7eff5);return _0x253547[_0x8bea('0x20')](_0x8bea('0x21'),_0x5cb6b8+'-'+_0x3fa35b+'/'+_0x199f76)[_0x8bea('0x1c')](_0x9bf0b4);}return null;};}function patchUpdates(_0x2ed86f){return function(_0x4bf43b){try{jsonpatch[_0x8bea('0x22')](_0x4bf43b,_0x2ed86f,!![]);}catch(_0x37dfbe){return BPromise[_0x8bea('0x23')](_0x37dfbe);}return _0x4bf43b['save']();};}function saveUpdates(_0x49695f,_0xc813bf){return function(_0x393eed){if(_0x393eed){return _0x393eed[_0x8bea('0x24')](_0x49695f)[_0x8bea('0x25')](function(_0x22a9d4){return _0x22a9d4;});}return null;};}function removeEntity(_0x4310b2,_0xf56ae2){return function(_0x2e251b){if(_0x2e251b){return _0x2e251b[_0x8bea('0x26')]()['then'](function(){var _0x1dafcb=_0x2e251b[_0x8bea('0x27')]({'plain':!![]});var _0x2a87d6='MusicOnHolds';return db['UserProfileResource'][_0x8bea('0x26')]({'where':{'type':_0x2a87d6,'resourceId':_0x1dafcb['id']}})['then'](function(){return _0x2e251b;});})[_0x8bea('0x25')](function(){_0x4310b2[_0x8bea('0x1a')](0xcc)[_0x8bea('0x1b')]();});}};}function handleEntityNotFound(_0x560401,_0xda906d){return function(_0x3728dd){if(!_0x3728dd){_0x560401['sendStatus'](0x194);}return _0x3728dd;};}function handleError(_0x4aad8a,_0x5d4a38){_0x5d4a38=_0x5d4a38||0x1f4;return function(_0x1abfde){logger['error'](_0x1abfde[_0x8bea('0x28')]);if(_0x1abfde[_0x8bea('0x29')]){delete _0x1abfde[_0x8bea('0x29')];}_0x4aad8a[_0x8bea('0x1a')](_0x5d4a38)[_0x8bea('0x2a')](_0x1abfde);};}exports[_0x8bea('0x2b')]=function(_0x409e9d,_0x2daecb){var _0x13f538={},_0x6992a0={},_0x3d1b7a={'count':0x0,'rows':[]};var _0x4fdefb=_['map'](db[_0x8bea('0x2c')][_0x8bea('0x2d')],function(_0xe118e){return{'name':_0xe118e[_0x8bea('0x2e')],'type':_0xe118e['type'][_0x8bea('0x2f')]};});_0x6992a0[_0x8bea('0x30')]=_[_0x8bea('0x31')](_0x4fdefb,_0x8bea('0x29'));_0x6992a0[_0x8bea('0x32')]=_[_0x8bea('0x33')](_0x409e9d[_0x8bea('0x32')]);_0x6992a0['filters']=_[_0x8bea('0x34')](_0x6992a0[_0x8bea('0x30')],_0x6992a0['query']);_0x13f538['attributes']=_['intersection'](_0x6992a0[_0x8bea('0x30')],qs[_0x8bea('0x35')](_0x409e9d[_0x8bea('0x32')][_0x8bea('0x35')]));_0x13f538['attributes']=_0x13f538[_0x8bea('0x36')][_0x8bea('0x37')]?_0x13f538['attributes']:_0x6992a0[_0x8bea('0x30')];if(!_0x409e9d[_0x8bea('0x32')][_0x8bea('0x38')](_0x8bea('0x39'))){_0x13f538[_0x8bea('0x1e')]=qs[_0x8bea('0x1e')](_0x409e9d[_0x8bea('0x32')][_0x8bea('0x1e')]);_0x13f538[_0x8bea('0x1d')]=qs[_0x8bea('0x1d')](_0x409e9d['query'][_0x8bea('0x1d')]);}_0x13f538[_0x8bea('0x3a')]=qs[_0x8bea('0x3b')](_0x409e9d[_0x8bea('0x32')][_0x8bea('0x3b')]);delete _0x409e9d[_0x8bea('0x32')][_0x8bea('0x3b')];_0x13f538[_0x8bea('0x3c')]=qs[_0x8bea('0x3d')](_[_0x8bea('0x3e')](_0x409e9d['query'],_0x6992a0[_0x8bea('0x3d')]),_0x4fdefb);if(_0x409e9d[_0x8bea('0x32')][_0x8bea('0x3f')]){_0x13f538[_0x8bea('0x3c')]=_[_0x8bea('0x40')](_0x13f538['where'],{'$or':_[_0x8bea('0x31')](_0x4fdefb,function(_0x37ec3b){if(_0x37ec3b[_0x8bea('0x41')]!=='VIRTUAL'){var _0x3e2755={};_0x3e2755[_0x37ec3b[_0x8bea('0x29')]]={'$like':'%'+_0x409e9d[_0x8bea('0x32')][_0x8bea('0x3f')]+'%'};return _0x3e2755;}})});}_0x13f538=_[_0x8bea('0x40')]({},_0x13f538,_0x409e9d['options']);var _0x4a2100={'where':_0x13f538[_0x8bea('0x3c')]};return db[_0x8bea('0x2c')][_0x8bea('0x42')](_0x4a2100)[_0x8bea('0x25')](function(_0x32239d){_0x3d1b7a[_0x8bea('0x42')]=_0x32239d;if(_0x409e9d[_0x8bea('0x32')][_0x8bea('0x43')]){_0x13f538[_0x8bea('0x44')]=[{'all':!![]}];}return db[_0x8bea('0x2c')]['findAll'](_0x13f538);})['then'](function(_0x4090c9){_0x3d1b7a[_0x8bea('0x45')]=_0x4090c9;return _0x3d1b7a;})[_0x8bea('0x25')](respondWithFilteredResult(_0x2daecb,_0x13f538))['catch'](handleError(_0x2daecb,null));};exports[_0x8bea('0x46')]=function(_0x45e953,_0x5f1e40){var _0x1707a9={'raw':![],'where':{'id':_0x45e953[_0x8bea('0x47')]['id']}},_0x29b219={};_0x29b219['model']=_[_0x8bea('0x33')](db[_0x8bea('0x2c')][_0x8bea('0x2d')]);_0x29b219['query']=_[_0x8bea('0x33')](_0x45e953['query']);_0x29b219[_0x8bea('0x3d')]=_[_0x8bea('0x34')](_0x29b219['model'],_0x29b219[_0x8bea('0x32')]);_0x1707a9['attributes']=_['intersection'](_0x29b219[_0x8bea('0x30')],qs[_0x8bea('0x35')](_0x45e953['query']['fields']));_0x1707a9['attributes']=_0x1707a9[_0x8bea('0x36')][_0x8bea('0x37')]?_0x1707a9[_0x8bea('0x36')]:_0x29b219[_0x8bea('0x30')];if(_0x45e953[_0x8bea('0x32')]['includeAll']){_0x1707a9[_0x8bea('0x44')]=[{'all':!![]}];}_0x1707a9=_[_0x8bea('0x40')]({},_0x1707a9,_0x45e953[_0x8bea('0x48')]);return db['VoiceMusicOnHold'][_0x8bea('0x49')](_0x1707a9)[_0x8bea('0x25')](handleEntityNotFound(_0x5f1e40,null))[_0x8bea('0x25')](respondWithResult(_0x5f1e40,null))[_0x8bea('0x4a')](handleError(_0x5f1e40,null));};exports[_0x8bea('0x24')]=function(_0x1f5393,_0x2e4be3){if(_0x1f5393[_0x8bea('0x4b')]['id']){delete _0x1f5393[_0x8bea('0x4b')]['id'];}return db[_0x8bea('0x2c')][_0x8bea('0x49')]({'where':{'id':_0x1f5393[_0x8bea('0x47')]['id']}})[_0x8bea('0x25')](handleEntityNotFound(_0x2e4be3,null))[_0x8bea('0x25')](saveUpdates(_0x1f5393[_0x8bea('0x4b')],null))[_0x8bea('0x25')](respondWithResult(_0x2e4be3,null))[_0x8bea('0x4a')](handleError(_0x2e4be3,null));};exports[_0x8bea('0x4c')]=function(_0x504f32,_0x2b2edf,_0x4405e6){return db['sequelize'][_0x8bea('0x4d')](function(_0x464481){if(_0x504f32[_0x8bea('0x4b')][_0x8bea('0x4e')]===_0x8bea('0x4f')){_0x504f32[_0x8bea('0x4b')][_0x8bea('0x50')]=path['join'](config[_0x8bea('0x51')],_0x8bea('0x52'),_0x504f32[_0x8bea('0x4b')][_0x8bea('0x29')]);}return db[_0x8bea('0x2c')][_0x8bea('0x4c')](_0x504f32[_0x8bea('0x4b')],{'transaction':_0x464481})['then'](function(_0x4ff3e8){if(_0x504f32[_0x8bea('0x4b')][_0x8bea('0x4e')]===_0x8bea('0x4f')){fs[_0x8bea('0x53')](_0x4ff3e8[_0x8bea('0x50')],parseInt(_0x8bea('0x54'),0x8));}var _0x1b7ef6=_0x504f32[_0x8bea('0x55')][_0x8bea('0x27')]({'plain':!![]});if(!_0x1b7ef6)throw new Error(_0x8bea('0x56'));if(_0x1b7ef6[_0x8bea('0x57')]===_0x8bea('0x55')){var _0x418bf9=_0x4ff3e8[_0x8bea('0x27')]({'plain':!![]});return db[_0x8bea('0x58')][_0x8bea('0x49')]({'where':{'name':_0x8bea('0x59'),'userProfileId':_0x1b7ef6[_0x8bea('0x5a')]},'raw':!![]})[_0x8bea('0x25')](function(_0x2f44f0){if(_0x2f44f0&&_0x2f44f0[_0x8bea('0x5b')]===0x0){return db[_0x8bea('0x5c')][_0x8bea('0x4c')]({'name':_0x418bf9[_0x8bea('0x29')],'resourceId':_0x418bf9['id'],'type':_0x2f44f0[_0x8bea('0x29')],'sectionId':_0x2f44f0['id']},{})[_0x8bea('0x25')](function(){return _0x4ff3e8;});}else{return _0x4ff3e8;}})['catch'](function(_0x1e54f5){logger[_0x8bea('0x5d')](_0x8bea('0x5e'),_0x1e54f5);});}return _0x4ff3e8;});})[_0x8bea('0x25')](respondWithResult(_0x2b2edf,0xc9))[_0x8bea('0x4a')](handleError(_0x2b2edf,null));};exports['destroy']=function(_0x462755,_0x32f6bc,_0xd8c420){var _0x56591b;return db['VoiceMusicOnHold'][_0x8bea('0x49')]({'where':{'id':_0x462755[_0x8bea('0x47')]['id']}})[_0x8bea('0x25')](function(_0x461e9e){if(_0x461e9e){return db[_0x8bea('0x5f')][_0x8bea('0x4d')](function(_0x59cce5){return _0x461e9e[_0x8bea('0x26')]({'transaction':_0x59cce5,'raw':!![]})[_0x8bea('0x25')](function(_0x4ecdc8){if(_0x4ecdc8[_0x8bea('0x50')]){fs[_0x8bea('0x60')](_0x4ecdc8[_0x8bea('0x50')])['forEach'](function(_0x100c85){fs['unlinkSync'](path['join'](_0x4ecdc8['directory'],_0x100c85));});fs[_0x8bea('0x61')](_0x4ecdc8[_0x8bea('0x50')]);}return _0x4ecdc8;});})['catch'](function(_0x159f24){throw new db[(_0x8bea('0x62'))][(_0x8bea('0x63'))](_0x159f24[_0x8bea('0x64')]);});}})[_0x8bea('0x25')](handleEntityNotFound(_0x32f6bc,null))[_0x8bea('0x25')](removeEntity(_0x32f6bc,null))['catch'](handleError(_0x32f6bc,null));};exports[_0x8bea('0x65')]=function(_0x18a49b,_0x3bf4c9,_0x1096f3){return db['sequelize'][_0x8bea('0x4d')](function(_0x2a2915){var _0x5b803e;return db[_0x8bea('0x2c')][_0x8bea('0x49')]({'where':{'id':_0x18a49b[_0x8bea('0x47')]['id']}})[_0x8bea('0x25')](function(_0x3a86a7){if(_0x3a86a7){_0x5b803e=_0x3a86a7;return _0x3a86a7[_0x8bea('0x65')](_0x18a49b[_0x8bea('0x4b')]['id'],{'transaction':_0x2a2915});}})[_0x8bea('0x25')](function(_0x38d2c9){if(_0x38d2c9){return db[_0x8bea('0x66')]['findOne']({'where':{'id':_0x18a49b[_0x8bea('0x4b')]['id']},'attributes':['id',_0x8bea('0x29'),_0x8bea('0x67'),'converted_format',_0x8bea('0x68')],'raw':!![]});}})[_0x8bea('0x25')](function(_0x128ea9){if(_0x128ea9){var _0x111c90=path[_0x8bea('0x69')](config[_0x8bea('0x51')],_0x8bea('0x6a'),util[_0x8bea('0x6b')](_0x8bea('0x6c'),path[_0x8bea('0x6d')](_0x128ea9[_0x8bea('0x67')],path[_0x8bea('0x6e')](_0x128ea9[_0x8bea('0x67')])),_0x128ea9[_0x8bea('0x6f')]));var _0x4a3e8c=path['join'](config[_0x8bea('0x51')],_0x8bea('0x52'),_0x5b803e[_0x8bea('0x29')],util[_0x8bea('0x6b')]('%s.%s',_0x128ea9[_0x8bea('0x29')],_0x128ea9['converted_format']));fs['symlinkSync'](_0x111c90,_0x4a3e8c);return _0x128ea9;}})[_0x8bea('0x4a')](function(_0x59e947){throw new db[(_0x8bea('0x62'))]['ValidationError'](_0x59e947[_0x8bea('0x64')]);});})[_0x8bea('0x25')](handleEntityNotFound(_0x3bf4c9,null))['then'](respondWithResult(_0x3bf4c9,0xc9))[_0x8bea('0x4a')](handleError(_0x3bf4c9,null));};exports[_0x8bea('0x70')]=function(_0xe8c85d,_0x1f7c63,_0x7d96e8){return db[_0x8bea('0x5f')]['transaction'](function(_0x3315b1){var _0x190c47;return db[_0x8bea('0x2c')][_0x8bea('0x71')]({'where':{'id':_0xe8c85d['params']['id']}})['then'](handleEntityNotFound(_0x1f7c63,null))[_0x8bea('0x25')](function(_0x5e03fc){if(_0x5e03fc){_0x190c47=_0x5e03fc;return _0x5e03fc[_0x8bea('0x70')](_0xe8c85d[_0x8bea('0x47')][_0x8bea('0x72')]);}})[_0x8bea('0x25')](function(_0x39e0cf){if(_0x39e0cf){return db[_0x8bea('0x66')][_0x8bea('0x71')]({'where':{'id':_0xe8c85d[_0x8bea('0x47')][_0x8bea('0x72')]},'attributes':['id','name',_0x8bea('0x67'),_0x8bea('0x6f'),_0x8bea('0x68')],'raw':!![]});}})['then'](function(_0x3f8a1b){if(_0x3f8a1b){fs['unlinkSync'](path[_0x8bea('0x69')](_0x190c47[_0x8bea('0x50')],util[_0x8bea('0x6b')](_0x8bea('0x6c'),_0x3f8a1b[_0x8bea('0x29')],_0x3f8a1b[_0x8bea('0x6f')])));return _0x3f8a1b;}})['catch'](function(_0x281d6e){throw new db[(_0x8bea('0x62'))]['ValidationError'](_0x281d6e[_0x8bea('0x64')]);});})['then'](handleEntityNotFound(_0x1f7c63,null))[_0x8bea('0x25')](respondWithStatusCode(_0x1f7c63,0xcc))[_0x8bea('0x4a')](handleError(_0x1f7c63,null));};exports['getSounds']=function(_0x59f31e,_0x3ce3b1,_0x3aa87b){var _0x44bd76={};var _0x2c9be5={};var _0x28a423;var _0x50aee9;return db[_0x8bea('0x2c')]['findOne']({'where':{'id':_0x59f31e['params']['id']}})['then'](handleEntityNotFound(_0x3ce3b1,null))[_0x8bea('0x25')](function(_0x550655){if(_0x550655){_0x28a423=_0x550655;_0x2c9be5[_0x8bea('0x30')]=_['keys'](db[_0x8bea('0x66')]['rawAttributes']);_0x2c9be5[_0x8bea('0x32')]=_[_0x8bea('0x33')](_0x59f31e['query']);_0x2c9be5['filters']=_[_0x8bea('0x34')](_0x2c9be5[_0x8bea('0x30')],_0x2c9be5['query']);_0x44bd76[_0x8bea('0x36')]=_[_0x8bea('0x34')](_0x2c9be5[_0x8bea('0x30')],qs['fields'](_0x59f31e['query'][_0x8bea('0x35')]));_0x44bd76[_0x8bea('0x36')]=_0x44bd76['attributes']['length']?_0x44bd76['attributes']:_0x2c9be5[_0x8bea('0x30')];_0x44bd76[_0x8bea('0x3a')]=qs[_0x8bea('0x3b')](_0x59f31e[_0x8bea('0x32')]['sort']);_0x44bd76['where']=qs[_0x8bea('0x3d')](_[_0x8bea('0x3e')](_0x59f31e['query'],_0x2c9be5[_0x8bea('0x3d')]));if(_0x59f31e[_0x8bea('0x32')][_0x8bea('0x3f')]){_0x44bd76[_0x8bea('0x3c')]=_[_0x8bea('0x40')](_0x44bd76['where'],{'$or':_['map'](_0x44bd76['attributes'],function(_0x3e6d48){var _0xcdf003={};_0xcdf003[_0x3e6d48]={'$like':'%'+_0x59f31e[_0x8bea('0x32')]['filter']+'%'};return _0xcdf003;})});}_0x44bd76=_[_0x8bea('0x40')]({},_0x44bd76,_0x59f31e['options']);return _0x28a423[_0x8bea('0x73')](_0x44bd76);}})['then'](function(_0x196240){if(_0x196240){_0x50aee9=_0x196240[_0x8bea('0x37')];if(!_0x59f31e[_0x8bea('0x32')][_0x8bea('0x38')](_0x8bea('0x39'))){_0x44bd76[_0x8bea('0x1e')]=qs[_0x8bea('0x1e')](_0x59f31e[_0x8bea('0x32')][_0x8bea('0x1e')]);_0x44bd76[_0x8bea('0x1d')]=qs['offset'](_0x59f31e['query'][_0x8bea('0x1d')]);}return _0x28a423[_0x8bea('0x73')](_0x44bd76);}})['then'](function(_0x49b97f){if(_0x49b97f){return _0x49b97f?{'count':_0x50aee9,'rows':_0x49b97f}:null;}})[_0x8bea('0x25')](respondWithResult(_0x3ce3b1,null))[_0x8bea('0x4a')](handleError(_0x3ce3b1,null));};
\ No newline at end of file
+var _0x124d=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','VoiceMusicOnHold','includeAll','include','findAll','rows','catch','params','options','find','body','create','sequelize','transaction','directory','join','root','mode','files','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','forEach','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','basename','extname','server/files/moh','%s.%s','symlinkSync','removeSound','id2','getSounds','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','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','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x124d,0x179));var _0xd124=function(_0x30437d,_0x420c50){_0x30437d=_0x30437d-0x0;var _0x58b55f=_0x124d[_0x30437d];return _0x58b55f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd124('0x0'));var zipdir=require(_0xd124('0x1'));var jsonpatch=require(_0xd124('0x2'));var rp=require(_0xd124('0x3'));var moment=require(_0xd124('0x4'));var BPromise=require(_0xd124('0x5'));var Mustache=require(_0xd124('0x6'));var util=require(_0xd124('0x7'));var path=require(_0xd124('0x8'));var sox=require('sox');var csv=require(_0xd124('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd124('0xa'));var _=require('lodash');var squel=require(_0xd124('0xb'));var crypto=require(_0xd124('0xc'));var jsforce=require(_0xd124('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd124('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd124('0xe'));var authService=require(_0xd124('0xf'));var qs=require(_0xd124('0x10'));var as=require(_0xd124('0x11'));var hardwareService=require(_0xd124('0x12'));var logger=require('../../config/logger')(_0xd124('0x13'));var utils=require(_0xd124('0x14'));var config=require(_0xd124('0x15'));var licenseUtil=require(_0xd124('0x16'));var db=require(_0xd124('0x17'))['db'];function respondWithStatusCode(_0x4bf58e,_0x2618f7){_0x2618f7=_0x2618f7||0xcc;return function(_0x168e91){if(_0x168e91){return _0x4bf58e[_0xd124('0x18')](_0x2618f7);}return _0x4bf58e[_0xd124('0x19')](_0x2618f7)[_0xd124('0x1a')]();};}function respondWithResult(_0x16393e,_0x16dfd6){_0x16dfd6=_0x16dfd6||0xc8;return function(_0x5b9287){if(_0x5b9287){return _0x16393e[_0xd124('0x19')](_0x16dfd6)['json'](_0x5b9287);}};}function respondWithFilteredResult(_0x2b6996,_0xca82a0){return function(_0x217a45){if(_0x217a45){var _0x1ff750=typeof _0xca82a0[_0xd124('0x1b')]===_0xd124('0x1c')&&typeof _0xca82a0['limit']===_0xd124('0x1c');var _0x4946d8=_0x217a45[_0xd124('0x1d')];var _0x3eefb2=_0x1ff750?0x0:_0xca82a0[_0xd124('0x1b')];var _0x19e231=_0x1ff750?_0x217a45[_0xd124('0x1d')]:_0xca82a0['offset']+_0xca82a0[_0xd124('0x1e')];var _0x5ca1ea;if(_0x19e231>=_0x4946d8){_0x19e231=_0x4946d8;_0x5ca1ea=0xc8;}else{_0x5ca1ea=0xce;}_0x2b6996[_0xd124('0x19')](_0x5ca1ea);return _0x2b6996['set'](_0xd124('0x1f'),_0x3eefb2+'-'+_0x19e231+'/'+_0x4946d8)[_0xd124('0x20')](_0x217a45);}return null;};}function patchUpdates(_0x2b6f17){return function(_0x373b81){try{jsonpatch[_0xd124('0x21')](_0x373b81,_0x2b6f17,!![]);}catch(_0x9710a7){return BPromise[_0xd124('0x22')](_0x9710a7);}return _0x373b81[_0xd124('0x23')]();};}function saveUpdates(_0x1b8a9f,_0xe7dda6){return function(_0x2e3587){if(_0x2e3587){return _0x2e3587[_0xd124('0x24')](_0x1b8a9f)[_0xd124('0x25')](function(_0x1ab5bd){return _0x1ab5bd;});}return null;};}function removeEntity(_0x509f40,_0x2ced10){return function(_0x1b16f9){if(_0x1b16f9){return _0x1b16f9[_0xd124('0x26')]()[_0xd124('0x25')](function(){var _0x4a517a=_0x1b16f9[_0xd124('0x27')]({'plain':!![]});var _0x24acfc=_0xd124('0x28');return db[_0xd124('0x29')][_0xd124('0x26')]({'where':{'type':_0x24acfc,'resourceId':_0x4a517a['id']}})[_0xd124('0x25')](function(){return _0x1b16f9;});})['then'](function(){_0x509f40['status'](0xcc)[_0xd124('0x1a')]();});}};}function handleEntityNotFound(_0x334cab,_0x387051){return function(_0x3dc80b){if(!_0x3dc80b){_0x334cab[_0xd124('0x18')](0x194);}return _0x3dc80b;};}function handleError(_0x30dd35,_0x20ab54){_0x20ab54=_0x20ab54||0x1f4;return function(_0x247a22){logger['error'](_0x247a22[_0xd124('0x2a')]);if(_0x247a22[_0xd124('0x2b')]){delete _0x247a22[_0xd124('0x2b')];}_0x30dd35['status'](_0x20ab54)['send'](_0x247a22);};}exports[_0xd124('0x2c')]=function(_0x20e8a9,_0x4f3daa){var _0x5bccb0={},_0x5355bb={},_0x4945da={'count':0x0,'rows':[]};var _0x16ce37=_['map'](db['VoiceMusicOnHold'][_0xd124('0x2d')],function(_0x338529){return{'name':_0x338529['fieldName'],'type':_0x338529[_0xd124('0x2e')][_0xd124('0x2f')]};});_0x5355bb[_0xd124('0x30')]=_[_0xd124('0x31')](_0x16ce37,_0xd124('0x2b'));_0x5355bb[_0xd124('0x32')]=_[_0xd124('0x33')](_0x20e8a9[_0xd124('0x32')]);_0x5355bb[_0xd124('0x34')]=_['intersection'](_0x5355bb[_0xd124('0x30')],_0x5355bb[_0xd124('0x32')]);_0x5bccb0[_0xd124('0x35')]=_[_0xd124('0x36')](_0x5355bb['model'],qs[_0xd124('0x37')](_0x20e8a9['query']['fields']));_0x5bccb0[_0xd124('0x35')]=_0x5bccb0['attributes'][_0xd124('0x38')]?_0x5bccb0['attributes']:_0x5355bb[_0xd124('0x30')];if(!_0x20e8a9[_0xd124('0x32')][_0xd124('0x39')](_0xd124('0x3a'))){_0x5bccb0['limit']=qs['limit'](_0x20e8a9[_0xd124('0x32')][_0xd124('0x1e')]);_0x5bccb0[_0xd124('0x1b')]=qs[_0xd124('0x1b')](_0x20e8a9[_0xd124('0x32')]['offset']);}_0x5bccb0[_0xd124('0x3b')]=qs['sort'](_0x20e8a9['query'][_0xd124('0x3c')]);delete _0x20e8a9[_0xd124('0x32')]['sort'];_0x5bccb0[_0xd124('0x3d')]=qs[_0xd124('0x34')](_[_0xd124('0x3e')](_0x20e8a9[_0xd124('0x32')],_0x5355bb[_0xd124('0x34')]),_0x16ce37);if(_0x20e8a9[_0xd124('0x32')]['filter']){_0x5bccb0[_0xd124('0x3d')]=_[_0xd124('0x3f')](_0x5bccb0[_0xd124('0x3d')],{'$or':_[_0xd124('0x31')](_0x16ce37,function(_0x1b7087){if(_0x1b7087[_0xd124('0x2e')]!==_0xd124('0x40')){var _0xeaaaca={};_0xeaaaca[_0x1b7087[_0xd124('0x2b')]]={'$like':'%'+_0x20e8a9[_0xd124('0x32')][_0xd124('0x41')]+'%'};return _0xeaaaca;}})});}_0x5bccb0=_[_0xd124('0x3f')]({},_0x5bccb0,_0x20e8a9['options']);var _0x3c121f={'where':_0x5bccb0[_0xd124('0x3d')]};return db[_0xd124('0x42')][_0xd124('0x1d')](_0x3c121f)[_0xd124('0x25')](function(_0x205ee8){_0x4945da[_0xd124('0x1d')]=_0x205ee8;if(_0x20e8a9[_0xd124('0x32')][_0xd124('0x43')]){_0x5bccb0[_0xd124('0x44')]=[{'all':!![]}];}return db[_0xd124('0x42')][_0xd124('0x45')](_0x5bccb0);})['then'](function(_0x253cdb){_0x4945da[_0xd124('0x46')]=_0x253cdb;return _0x4945da;})[_0xd124('0x25')](respondWithFilteredResult(_0x4f3daa,_0x5bccb0))[_0xd124('0x47')](handleError(_0x4f3daa,null));};exports['show']=function(_0x30d9fc,_0x50fd49){var _0x31b549={'raw':![],'where':{'id':_0x30d9fc[_0xd124('0x48')]['id']}},_0xbcf158={};_0xbcf158['model']=_[_0xd124('0x33')](db[_0xd124('0x42')][_0xd124('0x2d')]);_0xbcf158['query']=_[_0xd124('0x33')](_0x30d9fc[_0xd124('0x32')]);_0xbcf158['filters']=_['intersection'](_0xbcf158['model'],_0xbcf158[_0xd124('0x32')]);_0x31b549['attributes']=_['intersection'](_0xbcf158['model'],qs['fields'](_0x30d9fc[_0xd124('0x32')][_0xd124('0x37')]));_0x31b549[_0xd124('0x35')]=_0x31b549[_0xd124('0x35')]['length']?_0x31b549[_0xd124('0x35')]:_0xbcf158[_0xd124('0x30')];if(_0x30d9fc[_0xd124('0x32')][_0xd124('0x43')]){_0x31b549[_0xd124('0x44')]=[{'all':!![]}];}_0x31b549=_[_0xd124('0x3f')]({},_0x31b549,_0x30d9fc[_0xd124('0x49')]);return db['VoiceMusicOnHold'][_0xd124('0x4a')](_0x31b549)[_0xd124('0x25')](handleEntityNotFound(_0x50fd49,null))['then'](respondWithResult(_0x50fd49,null))['catch'](handleError(_0x50fd49,null));};exports[_0xd124('0x24')]=function(_0x48ff1c,_0x3d3093){if(_0x48ff1c[_0xd124('0x4b')]['id']){delete _0x48ff1c['body']['id'];}return db['VoiceMusicOnHold'][_0xd124('0x4a')]({'where':{'id':_0x48ff1c['params']['id']}})[_0xd124('0x25')](handleEntityNotFound(_0x3d3093,null))[_0xd124('0x25')](saveUpdates(_0x48ff1c['body'],null))['then'](respondWithResult(_0x3d3093,null))[_0xd124('0x47')](handleError(_0x3d3093,null));};exports[_0xd124('0x4c')]=function(_0x43de9c,_0x176e11,_0x23a5cf){return db[_0xd124('0x4d')][_0xd124('0x4e')](function(_0x185b0d){if(_0x43de9c['body']['mode']==='files'){_0x43de9c[_0xd124('0x4b')][_0xd124('0x4f')]=path[_0xd124('0x50')](config[_0xd124('0x51')],'server/files/moh',_0x43de9c[_0xd124('0x4b')]['name']);}return db[_0xd124('0x42')][_0xd124('0x4c')](_0x43de9c[_0xd124('0x4b')],{'transaction':_0x185b0d})[_0xd124('0x25')](function(_0x383ff7){if(_0x43de9c[_0xd124('0x4b')][_0xd124('0x52')]===_0xd124('0x53')){fs[_0xd124('0x54')](_0x383ff7[_0xd124('0x4f')],parseInt(_0xd124('0x55'),0x8));}var _0x5580cc=_0x43de9c['user'][_0xd124('0x27')]({'plain':!![]});if(!_0x5580cc)throw new Error(_0xd124('0x56'));if(_0x5580cc[_0xd124('0x57')]==='user'){var _0x399246=_0x383ff7[_0xd124('0x27')]({'plain':!![]});return db['UserProfileSection'][_0xd124('0x4a')]({'where':{'name':'MusicOnHolds','userProfileId':_0x5580cc['userProfileId']},'raw':!![]})[_0xd124('0x25')](function(_0x3b7ddd){if(_0x3b7ddd&&_0x3b7ddd[_0xd124('0x58')]===0x0){return db[_0xd124('0x29')][_0xd124('0x4c')]({'name':_0x399246[_0xd124('0x2b')],'resourceId':_0x399246['id'],'type':_0x3b7ddd[_0xd124('0x2b')],'sectionId':_0x3b7ddd['id']},{})[_0xd124('0x25')](function(){return _0x383ff7;});}else{return _0x383ff7;}})['catch'](function(_0x2efb34){logger[_0xd124('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2efb34);});}return _0x383ff7;});})[_0xd124('0x25')](respondWithResult(_0x176e11,0xc9))[_0xd124('0x47')](handleError(_0x176e11,null));};exports[_0xd124('0x26')]=function(_0x37fbb8,_0x17f83b,_0x37984c){var _0x5c10e0;return db[_0xd124('0x42')][_0xd124('0x4a')]({'where':{'id':_0x37fbb8[_0xd124('0x48')]['id']}})[_0xd124('0x25')](function(_0x1b7ec){if(_0x1b7ec){return db[_0xd124('0x4d')][_0xd124('0x4e')](function(_0x3a83c1){return _0x1b7ec[_0xd124('0x26')]({'transaction':_0x3a83c1,'raw':!![]})[_0xd124('0x25')](function(_0x4c39f7){if(_0x4c39f7[_0xd124('0x4f')]){fs['readdirSync'](_0x4c39f7[_0xd124('0x4f')])[_0xd124('0x5a')](function(_0x133e6d){fs['unlinkSync'](path[_0xd124('0x50')](_0x4c39f7[_0xd124('0x4f')],_0x133e6d));});fs['rmdirSync'](_0x4c39f7[_0xd124('0x4f')]);}return _0x4c39f7;});})[_0xd124('0x47')](function(_0x38d035){throw new db[(_0xd124('0x5b'))][(_0xd124('0x5c'))](_0x38d035[_0xd124('0x5d')]);});}})['then'](handleEntityNotFound(_0x17f83b,null))['then'](removeEntity(_0x17f83b,null))[_0xd124('0x47')](handleError(_0x17f83b,null));};exports[_0xd124('0x5e')]=function(_0x4fc4e1,_0x338194,_0xc49b11){return db['sequelize'][_0xd124('0x4e')](function(_0x4a85d1){var _0x37aaa0;return db[_0xd124('0x42')]['find']({'where':{'id':_0x4fc4e1[_0xd124('0x48')]['id']}})[_0xd124('0x25')](function(_0x2062a4){if(_0x2062a4){_0x37aaa0=_0x2062a4;return _0x2062a4[_0xd124('0x5e')](_0x4fc4e1[_0xd124('0x4b')]['id'],{'transaction':_0x4a85d1});}})[_0xd124('0x25')](function(_0x37ea3d){if(_0x37ea3d){return db[_0xd124('0x5f')][_0xd124('0x60')]({'where':{'id':_0x4fc4e1[_0xd124('0x4b')]['id']},'attributes':['id','name',_0xd124('0x61'),_0xd124('0x62'),_0xd124('0x63')],'raw':!![]});}})[_0xd124('0x25')](function(_0x5c257d){if(_0x5c257d){var _0x21da34=path[_0xd124('0x50')](config[_0xd124('0x51')],'server/files/sounds/converted',util['format']('%s.%s',path[_0xd124('0x64')](_0x5c257d['save_name'],path[_0xd124('0x65')](_0x5c257d['save_name'])),_0x5c257d[_0xd124('0x62')]));var _0x1050f3=path['join'](config[_0xd124('0x51')],_0xd124('0x66'),_0x37aaa0['name'],util['format'](_0xd124('0x67'),_0x5c257d['name'],_0x5c257d[_0xd124('0x62')]));fs[_0xd124('0x68')](_0x21da34,_0x1050f3);return _0x5c257d;}})['catch'](function(_0xa2710f){throw new db[(_0xd124('0x5b'))][(_0xd124('0x5c'))](_0xa2710f[_0xd124('0x5d')]);});})[_0xd124('0x25')](handleEntityNotFound(_0x338194,null))[_0xd124('0x25')](respondWithResult(_0x338194,0xc9))['catch'](handleError(_0x338194,null));};exports[_0xd124('0x69')]=function(_0x5671fe,_0x30dec1,_0x245554){return db['sequelize'][_0xd124('0x4e')](function(_0x365bae){var _0x1e1b7c;return db['VoiceMusicOnHold'][_0xd124('0x60')]({'where':{'id':_0x5671fe[_0xd124('0x48')]['id']}})[_0xd124('0x25')](handleEntityNotFound(_0x30dec1,null))[_0xd124('0x25')](function(_0x51720d){if(_0x51720d){_0x1e1b7c=_0x51720d;return _0x51720d['removeSound'](_0x5671fe['params'][_0xd124('0x6a')]);}})[_0xd124('0x25')](function(_0x168fb9){if(_0x168fb9){return db[_0xd124('0x5f')][_0xd124('0x60')]({'where':{'id':_0x5671fe[_0xd124('0x48')][_0xd124('0x6a')]},'attributes':['id',_0xd124('0x2b'),_0xd124('0x61'),_0xd124('0x62'),'createdAt'],'raw':!![]});}})[_0xd124('0x25')](function(_0x2f1b93){if(_0x2f1b93){fs['unlinkSync'](path[_0xd124('0x50')](_0x1e1b7c[_0xd124('0x4f')],util['format']('%s.%s',_0x2f1b93[_0xd124('0x2b')],_0x2f1b93['converted_format'])));return _0x2f1b93;}})['catch'](function(_0x1ed756){throw new db[(_0xd124('0x5b'))][(_0xd124('0x5c'))](_0x1ed756[_0xd124('0x5d')]);});})[_0xd124('0x25')](handleEntityNotFound(_0x30dec1,null))[_0xd124('0x25')](respondWithStatusCode(_0x30dec1,0xcc))[_0xd124('0x47')](handleError(_0x30dec1,null));};exports['getSounds']=function(_0x4bf383,_0x4b8297,_0x2ebd2c){var _0x16312b={};var _0x46f9ab={};var _0x3cc60b;var _0x267611;return db['VoiceMusicOnHold'][_0xd124('0x60')]({'where':{'id':_0x4bf383[_0xd124('0x48')]['id']}})[_0xd124('0x25')](handleEntityNotFound(_0x4b8297,null))[_0xd124('0x25')](function(_0x100d03){if(_0x100d03){_0x3cc60b=_0x100d03;_0x46f9ab[_0xd124('0x30')]=_[_0xd124('0x33')](db['Sound'][_0xd124('0x2d')]);_0x46f9ab[_0xd124('0x32')]=_[_0xd124('0x33')](_0x4bf383[_0xd124('0x32')]);_0x46f9ab[_0xd124('0x34')]=_['intersection'](_0x46f9ab[_0xd124('0x30')],_0x46f9ab['query']);_0x16312b[_0xd124('0x35')]=_[_0xd124('0x36')](_0x46f9ab[_0xd124('0x30')],qs['fields'](_0x4bf383[_0xd124('0x32')][_0xd124('0x37')]));_0x16312b[_0xd124('0x35')]=_0x16312b['attributes'][_0xd124('0x38')]?_0x16312b[_0xd124('0x35')]:_0x46f9ab[_0xd124('0x30')];_0x16312b[_0xd124('0x3b')]=qs[_0xd124('0x3c')](_0x4bf383[_0xd124('0x32')][_0xd124('0x3c')]);_0x16312b[_0xd124('0x3d')]=qs[_0xd124('0x34')](_['pick'](_0x4bf383[_0xd124('0x32')],_0x46f9ab[_0xd124('0x34')]));if(_0x4bf383[_0xd124('0x32')]['filter']){_0x16312b['where']=_[_0xd124('0x3f')](_0x16312b[_0xd124('0x3d')],{'$or':_[_0xd124('0x31')](_0x16312b[_0xd124('0x35')],function(_0x2e0cf0){var _0x76234b={};_0x76234b[_0x2e0cf0]={'$like':'%'+_0x4bf383[_0xd124('0x32')][_0xd124('0x41')]+'%'};return _0x76234b;})});}_0x16312b=_[_0xd124('0x3f')]({},_0x16312b,_0x4bf383[_0xd124('0x49')]);return _0x3cc60b[_0xd124('0x6b')](_0x16312b);}})['then'](function(_0xfbe0a6){if(_0xfbe0a6){_0x267611=_0xfbe0a6['length'];if(!_0x4bf383['query'][_0xd124('0x39')]('nolimit')){_0x16312b['limit']=qs[_0xd124('0x1e')](_0x4bf383[_0xd124('0x32')][_0xd124('0x1e')]);_0x16312b['offset']=qs[_0xd124('0x1b')](_0x4bf383[_0xd124('0x32')]['offset']);}return _0x3cc60b['getSounds'](_0x16312b);}})['then'](function(_0x1d506d){if(_0x1d506d){return _0x1d506d?{'count':_0x267611,'rows':_0x1d506d}:null;}})[_0xd124('0x25')](respondWithResult(_0x4b8297,null))[_0xd124('0x47')](handleError(_0x4b8297,null));};
\ No newline at end of file
index 4bd5347..e6e982a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24c5=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4605ee,_0x479fce){var _0x165f3f=function(_0x48afbe){while(--_0x48afbe){_0x4605ee['push'](_0x4605ee['shift']());}};_0x165f3f(++_0x479fce);}(_0x24c5,0x163));var _0x524c=function(_0x11aa9f,_0x29bfec){_0x11aa9f=_0x11aa9f-0x0;var _0x3d59f4=_0x24c5[_0x11aa9f];return _0x3d59f4;};'use strict';var _=require('lodash');var util=require(_0x524c('0x0'));var logger=require(_0x524c('0x1'))(_0x524c('0x2'));var moment=require('moment');var BPromise=require(_0x524c('0x3'));var rp=require(_0x524c('0x4'));var fs=require('fs');var path=require(_0x524c('0x5'));var rimraf=require(_0x524c('0x6'));var config=require(_0x524c('0x7'));var attributes=require(_0x524c('0x8'));module[_0x524c('0x9')]=function(_0x19245d,_0x452778){return _0x19245d[_0x524c('0xa')](_0x524c('0xb'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9463=['exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x1d5daa,_0x452e80){var _0x5d14b1=function(_0x2ae76d){while(--_0x2ae76d){_0x1d5daa['push'](_0x1d5daa['shift']());}};_0x5d14b1(++_0x452e80);}(_0x9463,0x1ee));var _0x3946=function(_0x2b1929,_0x3f1626){_0x2b1929=_0x2b1929-0x0;var _0x4e8479=_0x9463[_0x2b1929];return _0x4e8479;};'use strict';var _=require(_0x3946('0x0'));var util=require('util');var logger=require(_0x3946('0x1'))(_0x3946('0x2'));var moment=require(_0x3946('0x3'));var BPromise=require(_0x3946('0x4'));var rp=require(_0x3946('0x5'));var fs=require('fs');var path=require(_0x3946('0x6'));var rimraf=require(_0x3946('0x7'));var config=require(_0x3946('0x8'));var attributes=require(_0x3946('0x9'));module[_0x3946('0xa')]=function(_0x5c1f9b,_0x4d76ce){return _0x5c1f9b[_0x3946('0xb')](_0x3946('0xc'),attributes,{'tableName':_0x3946('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6ed465b..a7a7bfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xfc9733,_0x216af0){var _0x390505=function(_0x33dfa1){while(--_0x33dfa1){_0xfc9733['push'](_0xfc9733['shift']());}};_0x390505(++_0x216af0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5b3c4b,_0x43c1f3){var _0x35da1c=function(_0x1b3e60){while(--_0x1b3e60){_0x5b3c4b['push'](_0x5b3c4b['shift']());}};_0x35da1c(++_0x43c1f3);}(_0x70e0,0x17b));var _0x070e=function(_0x236177,_0x268124){_0x236177=_0x236177-0x0;var _0x501749=_0x70e0[_0x236177];return _0x501749;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
index e7b14b3..070d131 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3212=['/describe','describe','/:id','isAuthenticated','show','/:id/teams','getTeams','create','post','addTeams','put','update','delete','destroy','/:id/users','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index'];(function(_0x11a704,_0x3fec49){var _0x4149c5=function(_0x403e18){while(--_0x403e18){_0x11a704['push'](_0x11a704['shift']());}};_0x4149c5(++_0x3fec49);}(_0x3212,0x6f));var _0x2321=function(_0xa73072,_0x34ac87){_0xa73072=_0xa73072-0x0;var _0x3c82fb=_0x3212[_0xa73072];return _0x3c82fb;};'use strict';var multer=require(_0x2321('0x0'));var util=require(_0x2321('0x1'));var path=require(_0x2321('0x2'));var timeout=require(_0x2321('0x3'));var express=require(_0x2321('0x4'));var router=express[_0x2321('0x5')]();var fs_extra=require(_0x2321('0x6'));var auth=require(_0x2321('0x7'));var interaction=require(_0x2321('0x8'));var config=require(_0x2321('0x9'));var controller=require(_0x2321('0xa'));router[_0x2321('0xb')]('/',auth['isAuthenticated'](),controller[_0x2321('0xc')]);router[_0x2321('0xb')](_0x2321('0xd'),auth['isAuthenticated'](),controller[_0x2321('0xe')]);router[_0x2321('0xb')](_0x2321('0xf'),auth[_0x2321('0x10')](),controller[_0x2321('0x11')]);router[_0x2321('0xb')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x2321('0x12'),auth[_0x2321('0x10')](),controller[_0x2321('0x13')]);router['post']('/',auth[_0x2321('0x10')](),controller[_0x2321('0x14')]);router['post']('/:id/users',auth[_0x2321('0x10')](),controller['addAgents']);router[_0x2321('0x15')](_0x2321('0x12'),auth['isAuthenticated'](),controller[_0x2321('0x16')]);router[_0x2321('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x2321('0x18')]);router[_0x2321('0x19')](_0x2321('0xf'),auth['isAuthenticated'](),controller[_0x2321('0x1a')]);router[_0x2321('0x19')](_0x2321('0x1b'),auth[_0x2321('0x10')](),controller[_0x2321('0x1c')]);router[_0x2321('0x19')]('/:id/teams',auth[_0x2321('0x10')](),controller[_0x2321('0x1d')]);module[_0x2321('0x1e')]=router;
\ No newline at end of file
+var _0xdcc4=['describe','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','/:id','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','/describe','isAuthenticated'];(function(_0x2b439e,_0x21ce5e){var _0x189dd0=function(_0x416471){while(--_0x416471){_0x2b439e['push'](_0x2b439e['shift']());}};_0x189dd0(++_0x21ce5e);}(_0xdcc4,0xea));var _0x4dcc=function(_0x58bed8,_0x30fa95){_0x58bed8=_0x58bed8-0x0;var _0xe5b9dd=_0xdcc4[_0x58bed8];return _0xe5b9dd;};'use strict';var multer=require(_0x4dcc('0x0'));var util=require(_0x4dcc('0x1'));var path=require(_0x4dcc('0x2'));var timeout=require(_0x4dcc('0x3'));var express=require(_0x4dcc('0x4'));var router=express['Router']();var fs_extra=require(_0x4dcc('0x5'));var auth=require(_0x4dcc('0x6'));var interaction=require(_0x4dcc('0x7'));var config=require(_0x4dcc('0x8'));var controller=require(_0x4dcc('0x9'));router[_0x4dcc('0xa')]('/',auth['isAuthenticated'](),controller[_0x4dcc('0xb')]);router['get'](_0x4dcc('0xc'),auth[_0x4dcc('0xd')](),controller[_0x4dcc('0xe')]);router[_0x4dcc('0xa')]('/:id',auth[_0x4dcc('0xd')](),controller[_0x4dcc('0xf')]);router[_0x4dcc('0xa')](_0x4dcc('0x10'),auth[_0x4dcc('0xd')](),controller[_0x4dcc('0x11')]);router[_0x4dcc('0xa')](_0x4dcc('0x12'),auth['isAuthenticated'](),controller[_0x4dcc('0x13')]);router[_0x4dcc('0x14')]('/',auth['isAuthenticated'](),controller[_0x4dcc('0x15')]);router[_0x4dcc('0x14')]('/:id/users',auth[_0x4dcc('0xd')](),controller[_0x4dcc('0x16')]);router[_0x4dcc('0x14')](_0x4dcc('0x12'),auth[_0x4dcc('0xd')](),controller[_0x4dcc('0x17')]);router[_0x4dcc('0x18')](_0x4dcc('0x19'),auth['isAuthenticated'](),controller['update']);router[_0x4dcc('0x1a')](_0x4dcc('0x19'),auth[_0x4dcc('0xd')](),controller[_0x4dcc('0x1b')]);router[_0x4dcc('0x1a')]('/:id/users',auth[_0x4dcc('0xd')](),controller[_0x4dcc('0x1c')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x4dcc('0x1d')]);module[_0x4dcc('0x1e')]=router;
\ No newline at end of file
index 1615fb4..ecef627 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0be=['system-','getDataValue','INTEGER','STRING','name','VIRTUAL'];(function(_0x3c424f,_0x1c61c2){var _0x3fee82=function(_0xc78512){while(--_0xc78512){_0x3c424f['push'](_0x3c424f['shift']());}};_0x3fee82(++_0x1c61c2);}(_0xc0be,0xbd));var _0xec0b=function(_0xf74dff,_0x4f6d9e){_0xf74dff=_0xf74dff-0x0;var _0x4c8a27=_0xc0be[_0xf74dff];return _0x4c8a27;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xec0b('0x0')],'allowNull':![],'unique':_0xec0b('0x1')},'prefix':{'type':Sequelize[_0xec0b('0x2')],'get':function(_0xe8f6e4){return _0xec0b('0x3')+this[_0xec0b('0x4')](_0xec0b('0x1'))+'-';}},'description':{'type':Sequelize[_0xec0b('0x0')]},'callerIdAll':{'type':Sequelize[_0xec0b('0x0')]},'VoiceExtensionId':{'type':Sequelize[_0xec0b('0x5')]}};
\ No newline at end of file
+var _0x2e46=['VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x56039b,_0x3de8d8){var _0xc90792=function(_0x300c35){while(--_0x300c35){_0x56039b['push'](_0x56039b['shift']());}};_0xc90792(++_0x3de8d8);}(_0x2e46,0x1cc));var _0x62e4=function(_0x2aaa0a,_0x36f63a){_0x2aaa0a=_0x2aaa0a-0x0;var _0x326d4b=_0x2e46[_0x2aaa0a];return _0x326d4b;};'use strict';var Sequelize=require(_0x62e4('0x0'));module[_0x62e4('0x1')]={'name':{'type':Sequelize[_0x62e4('0x2')],'allowNull':![],'unique':_0x62e4('0x3')},'prefix':{'type':Sequelize[_0x62e4('0x4')],'get':function(_0x420713){return _0x62e4('0x5')+this[_0x62e4('0x6')](_0x62e4('0x3'))+'-';}},'description':{'type':Sequelize[_0x62e4('0x2')]},'callerIdAll':{'type':Sequelize[_0x62e4('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x62e4('0x7')]}};
\ No newline at end of file
index bf47813..12d1543 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a5=['merge','VIRTUAL','options','includeAll','include','VoicePrefix','findAll','rows','catch','show','params','rawAttributes','keys','find','describe','create','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','context','from-sip','exten','app','appdata','prefix','NoOp','VoicePrefixId','VoiceExtension','bulkCreate','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','charAt','system-','transaction','findById','addAgents','ids','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','field','tq.TeamId','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','sendStatus','error','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter'];(function(_0x1f245a,_0x4790c7){var _0x2a96d6=function(_0x3aa779){while(--_0x3aa779){_0x1f245a['push'](_0x1f245a['shift']());}};_0x2a96d6(++_0x4790c7);}(_0x63a5,0x18e));var _0x563a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x63a5[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];config[_0x563a('0x19')]=_[_0x563a('0x1a')](config[_0x563a('0x19')],{'host':_0x563a('0x1b'),'port':0x18eb});var socket=require(_0x563a('0x1c'))(new Redis(config[_0x563a('0x19')]));require('./voicePrefix.socket')[_0x563a('0x1d')](socket);function respondWithStatusCode(_0x3045ac,_0x8c3727){_0x8c3727=_0x8c3727||0xcc;return function(_0x26987f){if(_0x26987f){return _0x3045ac['sendStatus'](_0x8c3727);}return _0x3045ac['status'](_0x8c3727)[_0x563a('0x1e')]();};}function respondWithResult(_0x2ad667,_0x5b291f){_0x5b291f=_0x5b291f||0xc8;return function(_0x2ade24){if(_0x2ade24){return _0x2ad667[_0x563a('0x1f')](_0x5b291f)[_0x563a('0x20')](_0x2ade24);}};}function respondWithFilteredResult(_0x9c2f77,_0x4f947d){return function(_0x598693){if(_0x598693){var _0xe3d2bd=typeof _0x4f947d[_0x563a('0x21')]===_0x563a('0x22')&&typeof _0x4f947d['limit']==='undefined';var _0x52b99a=_0x598693['count'];var _0x40916a=_0xe3d2bd?0x0:_0x4f947d[_0x563a('0x21')];var _0x26061f=_0xe3d2bd?_0x598693[_0x563a('0x23')]:_0x4f947d['offset']+_0x4f947d['limit'];var _0x3930f0;if(_0x26061f>=_0x52b99a){_0x26061f=_0x52b99a;_0x3930f0=0xc8;}else{_0x3930f0=0xce;}_0x9c2f77[_0x563a('0x1f')](_0x3930f0);return _0x9c2f77[_0x563a('0x24')](_0x563a('0x25'),_0x40916a+'-'+_0x26061f+'/'+_0x52b99a)[_0x563a('0x20')](_0x598693);}return null;};}function patchUpdates(_0x2dc7e2){return function(_0x44b460){try{jsonpatch[_0x563a('0x26')](_0x44b460,_0x2dc7e2,!![]);}catch(_0x506491){return BPromise[_0x563a('0x27')](_0x506491);}return _0x44b460['save']();};}function saveUpdates(_0x44e2c1,_0xd3e0ae){return function(_0x3a36a4){if(_0x3a36a4){return _0x3a36a4[_0x563a('0x28')](_0x44e2c1)[_0x563a('0x29')](function(_0x1682ee){return _0x1682ee;});}return null;};}function removeEntity(_0x3642b3,_0x173990){return function(_0x4de4c3){if(_0x4de4c3){return _0x4de4c3[_0x563a('0x2a')]()[_0x563a('0x29')](function(){var _0x2311f2=_0x4de4c3[_0x563a('0x2b')]({'plain':!![]});var _0xce8165=_0x563a('0x2c');return db[_0x563a('0x2d')][_0x563a('0x2a')]({'where':{'type':_0xce8165,'resourceId':_0x2311f2['id']}})[_0x563a('0x29')](function(){return _0x4de4c3;});})[_0x563a('0x29')](function(){_0x3642b3[_0x563a('0x1f')](0xcc)[_0x563a('0x1e')]();});}};}function handleEntityNotFound(_0x1bdfb0,_0x7696c2){return function(_0x579cb5){if(!_0x579cb5){_0x1bdfb0[_0x563a('0x2e')](0x194);}return _0x579cb5;};}function handleError(_0x3c16d0,_0x2257e1){_0x2257e1=_0x2257e1||0x1f4;return function(_0x4aaa3d){logger[_0x563a('0x2f')](_0x4aaa3d[_0x563a('0x30')]);if(_0x4aaa3d[_0x563a('0x31')]){delete _0x4aaa3d[_0x563a('0x31')];}_0x3c16d0[_0x563a('0x1f')](_0x2257e1)[_0x563a('0x32')](_0x4aaa3d);};}exports[_0x563a('0x33')]=function(_0x4a2d28,_0x2418ae){var _0x24ec9d={},_0x4259f6={},_0x2ea6c2={'count':0x0,'rows':[]};var _0x1a77b8=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x4e5c46){return{'name':_0x4e5c46[_0x563a('0x34')],'type':_0x4e5c46[_0x563a('0x35')][_0x563a('0x36')]};});_0x4259f6[_0x563a('0x37')]=_[_0x563a('0x38')](_0x1a77b8,_0x563a('0x31'));_0x4259f6['query']=_['keys'](_0x4a2d28[_0x563a('0x39')]);_0x4259f6[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x4259f6[_0x563a('0x37')],_0x4259f6[_0x563a('0x39')]);_0x24ec9d[_0x563a('0x3c')]=_[_0x563a('0x3b')](_0x4259f6[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x4a2d28[_0x563a('0x39')][_0x563a('0x3d')]));_0x24ec9d[_0x563a('0x3c')]=_0x24ec9d[_0x563a('0x3c')][_0x563a('0x3e')]?_0x24ec9d[_0x563a('0x3c')]:_0x4259f6[_0x563a('0x37')];if(!_0x4a2d28['query'][_0x563a('0x3f')](_0x563a('0x40'))){_0x24ec9d[_0x563a('0x41')]=qs['limit'](_0x4a2d28[_0x563a('0x39')]['limit']);_0x24ec9d[_0x563a('0x21')]=qs[_0x563a('0x21')](_0x4a2d28['query']['offset']);}_0x24ec9d[_0x563a('0x42')]=qs['sort'](_0x4a2d28[_0x563a('0x39')][_0x563a('0x43')]);_0x24ec9d[_0x563a('0x44')]=qs[_0x563a('0x3a')](_['pick'](_0x4a2d28['query'],_0x4259f6[_0x563a('0x3a')]),_0x1a77b8);if(_0x4a2d28['query'][_0x563a('0x45')]){_0x24ec9d[_0x563a('0x44')]=_[_0x563a('0x46')](_0x24ec9d[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x1a77b8,function(_0x38fab5){if(_0x38fab5[_0x563a('0x35')]!==_0x563a('0x47')){var _0x4c71df={};_0x4c71df[_0x38fab5[_0x563a('0x31')]]={'$like':'%'+_0x4a2d28['query'][_0x563a('0x45')]+'%'};return _0x4c71df;}})});}_0x24ec9d=_[_0x563a('0x46')]({},_0x24ec9d,_0x4a2d28[_0x563a('0x48')]);var _0x2d3800={'where':_0x24ec9d['where']};return db['VoicePrefix']['count'](_0x2d3800)[_0x563a('0x29')](function(_0x1255da){_0x2ea6c2[_0x563a('0x23')]=_0x1255da;if(_0x4a2d28[_0x563a('0x39')][_0x563a('0x49')]){_0x24ec9d[_0x563a('0x4a')]=[{'all':!![]}];}return db[_0x563a('0x4b')][_0x563a('0x4c')](_0x24ec9d);})[_0x563a('0x29')](function(_0x433353){_0x2ea6c2[_0x563a('0x4d')]=_0x433353;return _0x2ea6c2;})[_0x563a('0x29')](respondWithFilteredResult(_0x2418ae,_0x24ec9d))[_0x563a('0x4e')](handleError(_0x2418ae,null));};exports[_0x563a('0x4f')]=function(_0x144e15,_0x456d27){var _0x4643c4={'raw':![],'where':{'id':_0x144e15[_0x563a('0x50')]['id']}},_0x21bafb={};_0x21bafb['model']=_['keys'](db[_0x563a('0x4b')][_0x563a('0x51')]);_0x21bafb[_0x563a('0x39')]=_[_0x563a('0x52')](_0x144e15[_0x563a('0x39')]);_0x21bafb[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x21bafb[_0x563a('0x37')],_0x21bafb['query']);_0x4643c4['attributes']=_[_0x563a('0x3b')](_0x21bafb[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x144e15[_0x563a('0x39')][_0x563a('0x3d')]));_0x4643c4[_0x563a('0x3c')]=_0x4643c4[_0x563a('0x3c')][_0x563a('0x3e')]?_0x4643c4['attributes']:_0x21bafb[_0x563a('0x37')];if(_0x144e15[_0x563a('0x39')]['includeAll']){_0x4643c4[_0x563a('0x4a')]=[{'all':!![]}];}_0x4643c4=_['merge']({},_0x4643c4,_0x144e15[_0x563a('0x48')]);return db[_0x563a('0x4b')][_0x563a('0x53')](_0x4643c4)['then'](handleEntityNotFound(_0x456d27,null))[_0x563a('0x29')](respondWithResult(_0x456d27,null))[_0x563a('0x4e')](handleError(_0x456d27,null));};exports[_0x563a('0x2a')]=function(_0x39c104,_0x6fe8a9){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x39c104[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x6fe8a9,null))[_0x563a('0x29')](removeEntity(_0x6fe8a9,null))[_0x563a('0x4e')](handleError(_0x6fe8a9,null));};exports[_0x563a('0x54')]=function(_0x406d4a,_0x497469){return db['VoicePrefix'][_0x563a('0x54')]()[_0x563a('0x29')](respondWithResult(_0x497469,null))[_0x563a('0x4e')](handleError(_0x497469,null));};exports['create']=function(_0x5ae08f,_0x13530f){var _0x1fc4d2;return db['sequelize']['transaction'](function(_0x51e142){return db[_0x563a('0x4b')][_0x563a('0x55')](_0x5ae08f[_0x563a('0x56')],{'transaction':_0x51e142})[_0x563a('0x29')](function(_0x8d3997){_0x1fc4d2=_0x8d3997[_0x563a('0x2b')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x1fc4d2[_0x563a('0x57')]},'raw':!![]})['then'](function(_0x4453b2){return createVoicePrefixExtensions(_0x1fc4d2,_0x4453b2,_0x51e142);});});})[_0x563a('0x29')](function(){var _0x3e993e=_0x5ae08f[_0x563a('0x58')][_0x563a('0x2b')]({'plain':!![]});if(!_0x3e993e)throw new Error(_0x563a('0x59'));if(_0x3e993e[_0x563a('0x5a')]==='user'){var _0x22cc91=_0x1fc4d2;return db[_0x563a('0x5b')]['find']({'where':{'name':_0x563a('0x2c'),'userProfileId':_0x3e993e[_0x563a('0x5c')]},'raw':!![]})[_0x563a('0x29')](function(_0x2afa8c){if(_0x2afa8c&&_0x2afa8c[_0x563a('0x5d')]===0x0){return db[_0x563a('0x2d')][_0x563a('0x55')]({'name':_0x22cc91[_0x563a('0x31')],'resourceId':_0x22cc91['id'],'type':_0x2afa8c[_0x563a('0x31')],'sectionId':_0x2afa8c['id']},{})[_0x563a('0x29')](function(){return _0x1fc4d2;});}else{return _0x1fc4d2;}})['catch'](function(_0x1926f1){logger[_0x563a('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1926f1);throw _0x1926f1;});}return _0x1fc4d2;})['then'](respondWithResult(_0x13530f,null))[_0x563a('0x4e')](handleError(_0x13530f,null));};function Extension(_0x709bfd,_0x579d61,_0x19edc3,_0x59e371){this[_0x563a('0x5e')]=_0x563a('0x5f');this[_0x563a('0x60')]=_0x709bfd;this[_0x563a('0x61')]=_0x19edc3;this[_0x563a('0x35')]='system';this['description']='Voice\x20Prefix\x20Extension';this['priority']=_0x579d61;this[_0x563a('0x62')]=_0x59e371;}function createVoicePrefixExtensions(_0x5141d5,_0x111444,_0x496b6a){return new BPromise(function(_0x2a82cf,_0x3f2750){var _0xbe3343=new Extension(formatPrefixName(_0x5141d5[_0x563a('0x63')]),0x1,_0x563a('0x64'),'Voice\x20Prefix');_0xbe3343[_0x563a('0x65')]=_0x5141d5['id'];return db['VoiceExtension']['create'](_0xbe3343,{'transaction':_0x496b6a})[_0x563a('0x29')](function(_0x3b7993){var _0x409f3c=_0x3b7993[_0x563a('0x2b')]({'plain':!![]});var _0x1c8ad7=_['map'](addVoicePrefixExtensions(_0x5141d5,_0x111444),function(_0x10eb03){_0x10eb03[_0x563a('0x57')]=_0x409f3c['id'];_0x10eb03[_0x563a('0x65')]=_0x5141d5['id'];return _0x10eb03;});return db[_0x563a('0x66')][_0x563a('0x67')](_0x1c8ad7,{'transaction':_0x496b6a})['then'](function(_0xac578c){if(!_0xac578c){return _0x3f2750('Extensions\x20creation\x20failed');}else{return _0x2a82cf(_0xac578c);}})[_0x563a('0x4e')](function(_0x201c9d){return _0x3f2750(_0x201c9d);});});;});};function addVoicePrefixExtensions(_0x47d6cd,_0x34dd59){var _0x30bf2b=[];var _0x18a26b=formatPrefixName(_0x47d6cd[_0x563a('0x63')]);_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x2,_0x563a('0x69'),_0x563a('0x6a')+_0x47d6cd[_0x563a('0x31')]));if(_0x47d6cd['callerIdAll']){_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x3,_0x563a('0x69'),_0x563a('0x6b')+_0x47d6cd[_0x563a('0x6c')]));}else{_0x30bf2b[_0x563a('0x68')](new Extension(_0x18a26b,0x3,_0x563a('0x64'),_0x563a('0x6d')));}_0x30bf2b['push'](new Extension(_0x18a26b,0x4,_0x563a('0x6e'),_0x34dd59['context']+','+'${EXTEN:'+(0x8+_0x47d6cd['name'][_0x563a('0x3e')])+'}'+','+0x1));return _0x30bf2b;}function formatPrefixName(_0x4e4e60){var _0x529587='_';for(var _0x30d775=0x0;_0x30d775<_0x4e4e60[_0x563a('0x3e')];_0x30d775++){if(_0x4e4e60[_0x563a('0x6f')](_0x30d775)=='-'){_0x529587+=_0x4e4e60[_0x563a('0x6f')](_0x30d775);}else{_0x529587+='['+_0x4e4e60[_0x563a('0x6f')](_0x30d775)+']';}}_0x529587+='.';return _0x529587;}exports['update']=function(_0x4814b3,_0x4c9ad7,_0x39b8f8){var _0x8b2e10=_0x4814b3[_0x563a('0x56')];_0x8b2e10[_0x563a('0x63')]=_0x563a('0x70')+_0x8b2e10[_0x563a('0x31')]+'-';return db['sequelize'][_0x563a('0x71')](function(_0x43b2f1){return db['VoicePrefix'][_0x563a('0x28')](_0x8b2e10,{'where':{'id':_0x8b2e10['id']},'transaction':_0x43b2f1})[_0x563a('0x29')](function(){return db[_0x563a('0x66')]['destroy']({'where':{'VoicePrefixId':_0x8b2e10['id']},'transaction':_0x43b2f1})[_0x563a('0x29')](function(){return db[_0x563a('0x66')][_0x563a('0x53')]({'where':{'id':_0x8b2e10[_0x563a('0x57')]},'raw':!![]})['then'](function(_0x229690){return createVoicePrefixExtensions(_0x8b2e10,_0x229690,_0x43b2f1);});});});})[_0x563a('0x29')](function(){return db[_0x563a('0x4b')][_0x563a('0x72')](_0x8b2e10['id']);})[_0x563a('0x29')](respondWithResult(_0x4c9ad7,null))['catch'](handleError(_0x4c9ad7,null));};exports['addAgents']=function(_0x4346fe,_0x598a91,_0x46beba){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x4346fe[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x598a91,null))[_0x563a('0x29')](function(_0x3f66be){if(_0x3f66be){return _0x3f66be[_0x563a('0x73')](_0x4346fe[_0x563a('0x56')][_0x563a('0x74')],_['omit'](_0x4346fe[_0x563a('0x56')],['ids','id'])||{})[_0x563a('0x75')](function(_0x441933){for(var _0x54c512=0x0;_0x54c512<_0x4346fe[_0x563a('0x56')]['ids'][_0x563a('0x3e')];_0x54c512+=0x1){socket[_0x563a('0x76')]('userVoicePrefix:save',{'UserId':Number(_0x4346fe[_0x563a('0x56')][_0x563a('0x74')][_0x54c512]),'VoicePrefixId':Number(_0x4346fe[_0x563a('0x50')]['id'])});}return _0x441933;});}})[_0x563a('0x29')](respondWithResult(_0x598a91,null))['catch'](handleError(_0x598a91,null));};exports[_0x563a('0x77')]=function(_0x31faef,_0x17000b,_0x3cdfc1){return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x31faef[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x17000b,null))[_0x563a('0x29')](function(_0x238ae4){if(_0x238ae4){return _0x238ae4['removeAgents'](_0x31faef[_0x563a('0x39')][_0x563a('0x74')])[_0x563a('0x29')](function(){if(_['isArray'](_0x31faef[_0x563a('0x39')][_0x563a('0x74')])){for(var _0x3dc800=0x0;_0x3dc800<_0x31faef[_0x563a('0x39')][_0x563a('0x74')][_0x563a('0x3e')];_0x3dc800+=0x1){socket[_0x563a('0x76')](_0x563a('0x78'),{'UserId':Number(_0x31faef[_0x563a('0x39')][_0x563a('0x74')][_0x3dc800]),'VoicePrefixId':Number(_0x31faef[_0x563a('0x50')]['id'])});}}else{socket[_0x563a('0x76')](_0x563a('0x78'),{'UserId':Number(_0x31faef['query'][_0x563a('0x74')]),'VoicePrefixId':Number(_0x31faef[_0x563a('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x17000b,null))[_0x563a('0x4e')](handleError(_0x17000b,null));};exports[_0x563a('0x79')]=function(_0x1ecca5,_0x162ab6,_0xf3ed04){var _0x44cbb4={};var _0x3a00b8={};var _0x9b753b;var _0x41898f;return db['VoicePrefix'][_0x563a('0x7a')]({'where':{'id':_0x1ecca5[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x162ab6,null))[_0x563a('0x29')](function(_0x4c5547){if(_0x4c5547){_0x9b753b=_0x4c5547;_0x3a00b8['model']=_['keys'](db[_0x563a('0x7b')][_0x563a('0x51')]);_0x3a00b8[_0x563a('0x39')]=_[_0x563a('0x52')](_0x1ecca5[_0x563a('0x39')]);_0x3a00b8[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x3a00b8[_0x563a('0x37')],_0x3a00b8[_0x563a('0x39')]);_0x44cbb4[_0x563a('0x3c')]=_['intersection'](_0x3a00b8[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x3d')]));_0x44cbb4[_0x563a('0x3c')]=_0x44cbb4[_0x563a('0x3c')][_0x563a('0x3e')]?_0x44cbb4[_0x563a('0x3c')]:_0x3a00b8[_0x563a('0x37')];_0x44cbb4[_0x563a('0x42')]=qs[_0x563a('0x43')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x43')]);_0x44cbb4['where']=qs[_0x563a('0x3a')](_[_0x563a('0x7c')](_0x1ecca5[_0x563a('0x39')],_0x3a00b8[_0x563a('0x3a')]));if(_0x1ecca5[_0x563a('0x39')][_0x563a('0x45')]){_0x44cbb4[_0x563a('0x44')]=_['merge'](_0x44cbb4[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x44cbb4[_0x563a('0x3c')],function(_0x562120){var _0x1e3b8c={};_0x1e3b8c[_0x562120]={'$like':'%'+_0x1ecca5[_0x563a('0x39')][_0x563a('0x45')]+'%'};return _0x1e3b8c;})});}_0x44cbb4=_[_0x563a('0x46')]({},_0x44cbb4,_0x1ecca5[_0x563a('0x48')]);return _0x9b753b[_0x563a('0x79')](_0x44cbb4);}})['then'](function(_0x2d46f5){if(_0x2d46f5){_0x41898f=_0x2d46f5[_0x563a('0x3e')];if(!_0x1ecca5[_0x563a('0x39')][_0x563a('0x3f')](_0x563a('0x40'))){_0x44cbb4['limit']=qs[_0x563a('0x41')](_0x1ecca5[_0x563a('0x39')][_0x563a('0x41')]);_0x44cbb4[_0x563a('0x21')]=qs['offset'](_0x1ecca5[_0x563a('0x39')][_0x563a('0x21')]);}return _0x9b753b['getAgents'](_0x44cbb4);}})['then'](function(_0x458a21){if(_0x458a21){return _0x458a21?{'count':_0x41898f,'rows':_0x458a21}:null;}})[_0x563a('0x29')](respondWithResult(_0x162ab6,null))[_0x563a('0x4e')](handleError(_0x162ab6,null));};exports[_0x563a('0x7d')]=function(_0x241361,_0x31a58e,_0x1e324a){var _0x38857b={};var _0x43b6a2={};var _0x2385eb;var _0x36fe22;return db['VoicePrefix'][_0x563a('0x7a')]({'where':{'id':_0x241361[_0x563a('0x50')]['id']}})[_0x563a('0x29')](handleEntityNotFound(_0x31a58e,null))['then'](function(_0x1dc77d){if(_0x1dc77d){_0x2385eb=_0x1dc77d;_0x43b6a2[_0x563a('0x37')]=_['keys'](db[_0x563a('0x7e')][_0x563a('0x51')]);_0x43b6a2[_0x563a('0x39')]=_[_0x563a('0x52')](_0x241361[_0x563a('0x39')]);_0x43b6a2[_0x563a('0x3a')]=_[_0x563a('0x3b')](_0x43b6a2[_0x563a('0x37')],_0x43b6a2['query']);_0x38857b[_0x563a('0x3c')]=_[_0x563a('0x3b')](_0x43b6a2[_0x563a('0x37')],qs[_0x563a('0x3d')](_0x241361[_0x563a('0x39')]['fields']));_0x38857b[_0x563a('0x3c')]=_0x38857b['attributes']['length']?_0x38857b[_0x563a('0x3c')]:_0x43b6a2[_0x563a('0x37')];_0x38857b[_0x563a('0x42')]=qs[_0x563a('0x43')](_0x241361['query'][_0x563a('0x43')]);_0x38857b[_0x563a('0x44')]=qs['filters'](_[_0x563a('0x7c')](_0x241361['query'],_0x43b6a2[_0x563a('0x3a')]));if(_0x241361[_0x563a('0x39')][_0x563a('0x45')]){_0x38857b[_0x563a('0x44')]=_[_0x563a('0x46')](_0x38857b[_0x563a('0x44')],{'$or':_[_0x563a('0x38')](_0x38857b[_0x563a('0x3c')],function(_0x372e43){var _0x484953={};_0x484953[_0x372e43]={'$like':'%'+_0x241361[_0x563a('0x39')]['filter']+'%'};return _0x484953;})});}_0x38857b=_['merge']({},_0x38857b,_0x241361[_0x563a('0x48')]);return _0x2385eb[_0x563a('0x7d')](_0x38857b);}})['then'](function(_0x44859c){if(_0x44859c){_0x36fe22=_0x44859c[_0x563a('0x3e')];if(!_0x241361[_0x563a('0x39')][_0x563a('0x3f')](_0x563a('0x40'))){_0x38857b[_0x563a('0x41')]=qs[_0x563a('0x41')](_0x241361[_0x563a('0x39')]['limit']);_0x38857b[_0x563a('0x21')]=qs[_0x563a('0x21')](_0x241361['query'][_0x563a('0x21')]);}return _0x2385eb[_0x563a('0x7d')](_0x38857b);}})['then'](function(_0x38601a){if(_0x38601a){return _0x38601a?{'count':_0x36fe22,'rows':_0x38601a}:null;}})[_0x563a('0x29')](respondWithResult(_0x31a58e,null))[_0x563a('0x4e')](handleError(_0x31a58e,null));};exports['addTeams']=function(_0x10c81e,_0x4928de,_0x95bb77){var _0x33d74b=_0x10c81e[_0x563a('0x56')]['ids'];var _0x2d9810;return db['Team'][_0x563a('0x4c')]({'where':{'id':_0x33d74b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x563a('0x7f'),'attributes':['id',_0x563a('0x31'),_0x563a('0x80'),_0x563a('0x81'),_0x563a('0x82')],'raw':!![]}]})[_0x563a('0x29')](function(_0x2d2cb9){if(_0x2d2cb9){_0x2d9810=_0x2d2cb9;var _0x2c4b52=_[_0x563a('0x83')](_0x2d2cb9,function(_0x5c8df5){var _0x579601=_0x5c8df5[_0x563a('0x2b')]({'plain':!![]});return _0x579601[_0x563a('0x7f')];});return db['VoicePrefix'][_0x563a('0x53')]({'where':{'id':_0x10c81e[_0x563a('0x50')]['id']}})[_0x563a('0x29')](function(_0x1ebdd0){return db[_0x563a('0x84')][_0x563a('0x71')](function(_0x2a3bdd){return _0x1ebdd0['addTeams'](_0x33d74b,{'transaction':_0x2a3bdd})[_0x563a('0x29')](function(){return BPromise[_0x563a('0x85')](_0x2d9810,function(_0x28bbe5){return db[_0x563a('0x86')]['upsert']({'TeamId':_0x28bbe5['id'],'VoicePrefixId':_0x10c81e[_0x563a('0x50')]['id']},{'transaction':_0x2a3bdd});});})[_0x563a('0x29')](function(){return BPromise[_0x563a('0x85')](_0x2c4b52,function(_0x150fd6){return db[_0x563a('0x87')][_0x563a('0x88')]({'where':{'UserId':_0x150fd6['id'],'VoicePrefixId':_0x10c81e[_0x563a('0x50')]['id']},'transaction':_0x2a3bdd});});})[_0x563a('0x29')](function(){_0x2c4b52[_0x563a('0x89')](function(_0x3f78b7){socket[_0x563a('0x76')](_0x563a('0x8a'),{'UserId':_0x3f78b7['id'],'VoicePrefixId':_0x1ebdd0['id']});});});});});}})[_0x563a('0x29')](respondWithStatusCode(_0x4928de,null))[_0x563a('0x4e')](handleError(_0x4928de,null));};exports[_0x563a('0x8b')]=function(_0x115188,_0x713637,_0x12bb1b){return db[_0x563a('0x7e')][_0x563a('0x4c')]({'where':{'id':_0x115188[_0x563a('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x563a('0x7b')],'as':_0x563a('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x563a('0x29')](handleEntityNotFound(_0x713637,null))[_0x563a('0x29')](function(_0xb9cbc9){var _0x42831f=_[_0x563a('0x38')](_0xb9cbc9,'id');var _0x5385e0=[];var _0x1d0ed4=[];var _0x14bc9e=squel[_0x563a('0x8c')]();_0x14bc9e[_0x563a('0x8d')](_0x563a('0x8e'))['from'](_0x563a('0x8f'),'tq')['join'](_0x563a('0x90'),'ut',_0x563a('0x91'))[_0x563a('0x44')]('VoicePrefixId\x20=\x20?',_0x115188[_0x563a('0x50')]['id']);for(var _0x25e5d1=0x0;_0x25e5d1<_0xb9cbc9[_0x563a('0x3e')];_0x25e5d1+=0x1){let _0x5ba698=_0xb9cbc9[_0x25e5d1];for(var _0x2dadc1=0x0;_0x2dadc1<_0x5ba698[_0x563a('0x7f')]['length'];_0x2dadc1+=0x1){let _0x55f64e=_0x5ba698[_0x563a('0x7f')][_0x2dadc1];var _0x41d0df=_0x14bc9e['clone']();_0x41d0df['where'](_0x563a('0x92'),_0x55f64e['id']);_0x1d0ed4['push'](db[_0x563a('0x84')][_0x563a('0x39')](_0x41d0df[_0x563a('0x93')](),{'type':db[_0x563a('0x84')][_0x563a('0x94')][_0x563a('0x95')]})[_0x563a('0x29')](function(_0xc24817){if(_0xc24817[_0x563a('0x3e')]===0x1){return _0x55f64e['id'];}else{var _0xd04cd=_[_0x563a('0x96')](_['map'](_0xc24817,'TeamId'),function(_0x571a84){return _[_0x563a('0x97')](_0x42831f,_0x571a84);});if(_0xd04cd){return _0x55f64e['id'];}}}));}}return BPromise[_0x563a('0x98')](_0x1d0ed4)[_0x563a('0x29')](function(_0x5244e5){_0x5385e0=_(_0x5385e0)['union'](_0x5244e5)[_0x563a('0x99')]()[_0x563a('0x9a')]();return db[_0x563a('0x4b')][_0x563a('0x53')]({'where':{'id':_0x115188[_0x563a('0x50')]['id']}})[_0x563a('0x29')](function(_0x23e33f){return db['sequelize'][_0x563a('0x71')](function(_0x25049d){return _0x23e33f[_0x563a('0x8b')](_0x115188[_0x563a('0x39')][_0x563a('0x74')],{'transaction':_0x25049d})[_0x563a('0x29')](function(){if(!_[_0x563a('0x9b')](_0x5385e0)){return _0x23e33f[_0x563a('0x77')](_0x5385e0,{'transaction':_0x25049d});}})[_0x563a('0x29')](function(){_0x5385e0[_0x563a('0x89')](function(_0x482d21){socket[_0x563a('0x76')]('userVoicePrefix:remove',{'UserId':_0x482d21,'VoicePrefixId':_0x23e33f['id']});});});});});});})[_0x563a('0x29')](respondWithStatusCode(_0x713637,null))[_0x563a('0x4e')](handleError(_0x713637,null));};
\ No newline at end of file
+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(_0x1fd783,_0x355007){var _0x57097c=function(_0xd39307){while(--_0xd39307){_0x1fd783['push'](_0x1fd783['shift']());}};_0x57097c(++_0x355007);}(_0x583c,0x12b));var _0xc583=function(_0x4e9274,_0x49576e){_0x4e9274=_0x4e9274-0x0;var _0x8b474c=_0x583c[_0x4e9274];return _0x8b474c;};'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
index 0fb6e6a..527f1a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x283d=['VoicePrefix','setMaxListeners','save','remove','emit','hasOwnProperty','events'];(function(_0x2438a7,_0x4a7e33){var _0x49a623=function(_0x9c063e){while(--_0x9c063e){_0x2438a7['push'](_0x2438a7['shift']());}};_0x49a623(++_0x4a7e33);}(_0x283d,0x1b8));var _0xd283=function(_0x51878b,_0x37e0a4){_0x51878b=_0x51878b-0x0;var _0x786d8d=_0x283d[_0x51878b];return _0x786d8d;};'use strict';var EventEmitter=require(_0xd283('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0xd283('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd283('0x2')](0x0);var events={'afterCreate':_0xd283('0x3'),'afterUpdate':'update','afterDestroy':_0xd283('0x4')};function emitEvent(_0xff95bb){return function(_0x5c771f,_0x5a6e02,_0x133fc4){VoicePrefixEvents[_0xd283('0x5')](_0xff95bb+':'+_0x5c771f['id'],_0x5c771f);VoicePrefixEvents[_0xd283('0x5')](_0xff95bb,_0x5c771f);_0x133fc4(null);};}for(var e in events){if(events[_0xd283('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
+var _0x05ab=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x5d4047,_0x311d45){var _0xccbaae=function(_0x3a126c){while(--_0x3a126c){_0x5d4047['push'](_0x5d4047['shift']());}};_0xccbaae(++_0x311d45);}(_0x05ab,0xeb));var _0xb05a=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x05ab[_0x543084];return _0x306a57;};'use strict';var EventEmitter=require(_0xb05a('0x0'));var VoicePrefix=require(_0xb05a('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xb05a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb05a('0x3'),'afterDestroy':_0xb05a('0x4')};function emitEvent(_0x3a1e7b){return function(_0xa8e7d5,_0x30fe63,_0x16ee41){VoicePrefixEvents[_0xb05a('0x5')](_0x3a1e7b+':'+_0xa8e7d5['id'],_0xa8e7d5);VoicePrefixEvents[_0xb05a('0x5')](_0x3a1e7b,_0xa8e7d5);_0x16ee41(null);};}for(var e in events){if(events[_0xb05a('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xb05a('0x7')]=VoicePrefixEvents;
\ No newline at end of file
index 98f9829..b8d0134 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4eb1=['voice_prefixes','lodash','util','../../config/logger','api','request-promise','path','./voicePrefix.attributes','exports','VoicePrefix'];(function(_0x5dfd47,_0x4cbbbe){var _0x59e18d=function(_0x33e160){while(--_0x33e160){_0x5dfd47['push'](_0x5dfd47['shift']());}};_0x59e18d(++_0x4cbbbe);}(_0x4eb1,0x10f));var _0x14eb=function(_0x367b85,_0x36d113){_0x367b85=_0x367b85-0x0;var _0x51fd0a=_0x4eb1[_0x367b85];return _0x51fd0a;};'use strict';var _=require(_0x14eb('0x0'));var util=require(_0x14eb('0x1'));var logger=require(_0x14eb('0x2'))(_0x14eb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x14eb('0x4'));var fs=require('fs');var path=require(_0x14eb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x14eb('0x6'));module[_0x14eb('0x7')]=function(_0x2e471e,_0x50bf0f){return _0x2e471e['define'](_0x14eb('0x8'),attributes,{'tableName':_0x14eb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3da=['./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x917c75,_0x5cdb22){var _0xb603f1=function(_0x141196){while(--_0x141196){_0x917c75['push'](_0x917c75['shift']());}};_0xb603f1(++_0x5cdb22);}(_0xf3da,0xae));var _0xaf3d=function(_0x195fbd,_0x25fce0){_0x195fbd=_0x195fbd-0x0;var _0x4c7f40=_0xf3da[_0x195fbd];return _0x4c7f40;};'use strict';var _=require(_0xaf3d('0x0'));var util=require('util');var logger=require(_0xaf3d('0x1'))(_0xaf3d('0x2'));var moment=require('moment');var BPromise=require(_0xaf3d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf3d('0x4'));var rimraf=require(_0xaf3d('0x5'));var config=require('../../config/environment');var attributes=require(_0xaf3d('0x6'));module[_0xaf3d('0x7')]=function(_0x184322,_0xcaa82b){return _0x184322['define'](_0xaf3d('0x8'),attributes,{'tableName':_0xaf3d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aa98be1..d8d5e38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dc0=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','request','then','info','VoicePrefix,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x32c57d,_0x4b455a){var _0x353d7f=function(_0x15b980){while(--_0x15b980){_0x32c57d['push'](_0x32c57d['shift']());}};_0x353d7f(++_0x4b455a);}(_0x6dc0,0xb6));var _0x06dc=function(_0x1213f2,_0x1a44f8){_0x1213f2=_0x1213f2-0x0;var _0x6e370f=_0x6dc0[_0x1213f2];return _0x6e370f;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var moment=require(_0x06dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x06dc('0x3'));var fs=require('fs');var Redis=require(_0x06dc('0x4'));var db=require(_0x06dc('0x5'))['db'];var utils=require(_0x06dc('0x6'));var logger=require('../../config/logger')(_0x06dc('0x7'));var config=require(_0x06dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x06dc('0x9')]['http']({'port':0x232a});config[_0x06dc('0xa')]=_[_0x06dc('0xb')](config[_0x06dc('0xa')],{'host':_0x06dc('0xc'),'port':0x18eb});var socket=require(_0x06dc('0xd'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x128ea7,_0x1f2041,_0x4ec0aa){return new BPromise(function(_0x45693d,_0x1e7abd){return client[_0x06dc('0xe')](_0x128ea7,_0x4ec0aa)[_0x06dc('0xf')](function(_0x4fa7fc){logger[_0x06dc('0x10')](_0x06dc('0x11'),_0x1f2041,'request\x20sent');logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x1f2041,'request\x20sent',JSON[_0x06dc('0x12')](_0x4fa7fc));if(_0x4fa7fc['error']){if(_0x4fa7fc['error']['code']===0x1f4){logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0x4fa7fc[_0x06dc('0x13')]['message']);return _0x1e7abd(_0x4fa7fc[_0x06dc('0x13')][_0x06dc('0x14')]);}logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0x4fa7fc['error'][_0x06dc('0x14')]);return _0x45693d(_0x4fa7fc[_0x06dc('0x13')][_0x06dc('0x14')]);}else{logger[_0x06dc('0x10')](_0x06dc('0x11'),_0x1f2041,'request\x20sent');_0x45693d(_0x4fa7fc[_0x06dc('0x15')][_0x06dc('0x14')]);}})[_0x06dc('0x16')](function(_0xc658ea){logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0xc658ea);_0x1e7abd(_0xc658ea);});});}
\ No newline at end of file
+var _0x649f=['request','then','info','VoicePrefix,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register'];(function(_0x40393b,_0x387c81){var _0x42dc4e=function(_0x3d87ec){while(--_0x3d87ec){_0x40393b['push'](_0x40393b['shift']());}};_0x42dc4e(++_0x387c81);}(_0x649f,0x93));var _0xf649=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x649f[_0xd09668];return _0x68726;};'use strict';var _=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var moment=require(_0xf649('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf649('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf649('0x4'));var logger=require(_0xf649('0x5'))(_0xf649('0x6'));var config=require(_0xf649('0x7'));var jayson=require(_0xf649('0x8'));var client=jayson[_0xf649('0x9')][_0xf649('0xa')]({'port':0x232a});config[_0xf649('0xb')]=_['defaults'](config['redis'],{'host':_0xf649('0xc'),'port':0x18eb});var socket=require(_0xf649('0xd'))(new Redis(config[_0xf649('0xb')]));require('./voicePrefix.socket')[_0xf649('0xe')](socket);function respondWithRpcPromise(_0x2a278c,_0x38d583,_0x4061a2){return new BPromise(function(_0x5abb8f,_0x7f5eda){return client[_0xf649('0xf')](_0x2a278c,_0x4061a2)[_0xf649('0x10')](function(_0xe5a71c){logger[_0xf649('0x11')](_0xf649('0x12'),_0x38d583,'request\x20sent');logger[_0xf649('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x38d583,'request\x20sent',JSON[_0xf649('0x14')](_0xe5a71c));if(_0xe5a71c[_0xf649('0x15')]){if(_0xe5a71c[_0xf649('0x15')][_0xf649('0x16')]===0x1f4){logger[_0xf649('0x15')](_0xf649('0x12'),_0x38d583,_0xe5a71c[_0xf649('0x15')][_0xf649('0x17')]);return _0x7f5eda(_0xe5a71c['error'][_0xf649('0x17')]);}logger[_0xf649('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x38d583,_0xe5a71c[_0xf649('0x15')][_0xf649('0x17')]);return _0x5abb8f(_0xe5a71c[_0xf649('0x15')]['message']);}else{logger['info'](_0xf649('0x12'),_0x38d583,_0xf649('0x18'));_0x5abb8f(_0xe5a71c[_0xf649('0x19')][_0xf649('0x17')]);}})[_0xf649('0x1a')](function(_0x2d956d){logger[_0xf649('0x15')](_0xf649('0x12'),_0x38d583,_0x2d956d);_0x7f5eda(_0x2d956d);});});}
\ No newline at end of file
index a6ed912..a13cb98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fdc=['update','emit','removeListener','register','length','voicePrefix:','save'];(function(_0x53e29e,_0x17c540){var _0x54c118=function(_0x45b1bf){while(--_0x45b1bf){_0x53e29e['push'](_0x53e29e['shift']());}};_0x54c118(++_0x17c540);}(_0x4fdc,0x84));var _0xc4fd=function(_0x5dfd94,_0x28ebfa){_0x5dfd94=_0x5dfd94-0x0;var _0x5693e1=_0x4fdc[_0x5dfd94];return _0x5693e1;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xc4fd('0x0'),'remove',_0xc4fd('0x1')];function createListener(_0x19b8cd,_0x49fd20){return function(_0x4db5c0){_0x49fd20[_0xc4fd('0x2')](_0x19b8cd,_0x4db5c0);};}function removeListener(_0x2dee59,_0x363bd1){return function(){VoicePrefixEvents[_0xc4fd('0x3')](_0x2dee59,_0x363bd1);};}exports[_0xc4fd('0x4')]=function(_0x2547d5){for(var _0x3157b2=0x0,_0x57502f=events[_0xc4fd('0x5')];_0x3157b2<_0x57502f;_0x3157b2++){var _0x355b9f=events[_0x3157b2];var _0x4962d7=createListener(_0xc4fd('0x6')+_0x355b9f,_0x2547d5);VoicePrefixEvents['on'](_0x355b9f,_0x4962d7);}};
\ No newline at end of file
+var _0x1ae3=['update','removeListener','register','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0x1ae3,0x139));var _0x31ae=function(_0x56566d,_0x470d71){_0x56566d=_0x56566d-0x0;var _0x15aa22=_0x1ae3[_0x56566d];return _0x15aa22;};'use strict';var VoicePrefixEvents=require(_0x31ae('0x0'));var events=[_0x31ae('0x1'),'remove',_0x31ae('0x2')];function createListener(_0x3ba253,_0x21cada){return function(_0x293580){_0x21cada['emit'](_0x3ba253,_0x293580);};}function removeListener(_0x16eaa4,_0xf41e21){return function(){VoicePrefixEvents[_0x31ae('0x3')](_0x16eaa4,_0xf41e21);};}exports[_0x31ae('0x4')]=function(_0xe1202b){for(var _0x3f2e91=0x0,_0x3500b4=events[_0x31ae('0x5')];_0x3f2e91<_0x3500b4;_0x3f2e91++){var _0x43773f=events[_0x3f2e91];var _0x1d2071=createListener(_0x31ae('0x6')+_0x43773f,_0xe1202b);VoicePrefixEvents['on'](_0x43773f,_0x1d2071);}};
\ No newline at end of file
index 2276b7f..f3d6bfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67dd=['removeTeams','removeAgents','/:id/lists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','addLists','update','delete'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x67dd,0xfb));var _0xd67d=function(_0x5533ce,_0x8d8b81){_0x5533ce=_0x5533ce-0x0;var _0x38a351=_0x67dd[_0x5533ce];return _0x38a351;};'use strict';var multer=require(_0xd67d('0x0'));var util=require(_0xd67d('0x1'));var path=require(_0xd67d('0x2'));var timeout=require(_0xd67d('0x3'));var express=require('express');var router=express[_0xd67d('0x4')]();var fs_extra=require(_0xd67d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd67d('0x6'));var config=require('../../config/environment');var controller=require(_0xd67d('0x7'));router[_0xd67d('0x8')]('/',auth[_0xd67d('0x9')](),controller[_0xd67d('0xa')]);router[_0xd67d('0x8')](_0xd67d('0xb'),auth[_0xd67d('0x9')](),controller[_0xd67d('0xc')]);router['get'](_0xd67d('0xd'),auth['isAuthenticated'](),controller[_0xd67d('0xe')]);router[_0xd67d('0x8')]('/:id/hopper_histories',auth[_0xd67d('0x9')](),controller[_0xd67d('0xf')]);router[_0xd67d('0x8')]('/:id/hopper_finals',auth[_0xd67d('0x9')](),controller[_0xd67d('0x10')]);router[_0xd67d('0x8')](_0xd67d('0x11'),auth[_0xd67d('0x9')](),controller[_0xd67d('0x12')]);router['get']('/:id/teams',auth[_0xd67d('0x9')](),controller[_0xd67d('0x13')]);router['get'](_0xd67d('0x14'),auth[_0xd67d('0x9')](),controller[_0xd67d('0x15')]);router[_0xd67d('0x8')](_0xd67d('0x16'),auth[_0xd67d('0x9')](),controller[_0xd67d('0x17')]);router[_0xd67d('0x8')]('/:id/lists',auth[_0xd67d('0x9')](),controller[_0xd67d('0x18')]);router['get'](_0xd67d('0x19'),auth[_0xd67d('0x9')](),controller[_0xd67d('0x1a')]);router[_0xd67d('0x1b')]('/',auth[_0xd67d('0x9')](),controller[_0xd67d('0x1c')]);router['post'](_0xd67d('0x1d'),auth[_0xd67d('0x9')](),controller[_0xd67d('0x1e')]);router[_0xd67d('0x1b')](_0xd67d('0x1f'),auth[_0xd67d('0x9')](),controller[_0xd67d('0x20')]);router[_0xd67d('0x1b')](_0xd67d('0x14'),auth['isAuthenticated'](),controller['addAgents']);router[_0xd67d('0x1b')]('/:id/lists',auth[_0xd67d('0x9')](),controller[_0xd67d('0x21')]);router[_0xd67d('0x1b')](_0xd67d('0x19'),auth[_0xd67d('0x9')](),controller['addBlackLists']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd67d('0x22')]);router['delete'](_0xd67d('0xb'),auth[_0xd67d('0x9')](),controller['destroy']);router[_0xd67d('0x23')](_0xd67d('0x1f'),auth[_0xd67d('0x9')](),controller[_0xd67d('0x24')]);router['delete'](_0xd67d('0x14'),auth['isAuthenticated'](),controller[_0xd67d('0x25')]);router[_0xd67d('0x23')](_0xd67d('0x26'),auth[_0xd67d('0x9')](),controller['removeLists']);router[_0xd67d('0x23')](_0xd67d('0x19'),auth[_0xd67d('0x9')](),controller[_0xd67d('0x27')]);module[_0xd67d('0x28')]=router;
\ No newline at end of file
+var _0xcad7=['index','/:id','isAuthenticated','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','/:id/teams','addTeams','addAgents','addLists','addBlackLists','put','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./voiceQueue.controller','get'];(function(_0x4d085f,_0x3c7393){var _0x1ae582=function(_0x2fffce){while(--_0x2fffce){_0x4d085f['push'](_0x4d085f['shift']());}};_0x1ae582(++_0x3c7393);}(_0xcad7,0x141));var _0x7cad=function(_0x152999,_0x1dd83b){_0x152999=_0x152999-0x0;var _0x32ef67=_0xcad7[_0x152999];return _0x32ef67;};'use strict';var multer=require(_0x7cad('0x0'));var util=require('util');var path=require(_0x7cad('0x1'));var timeout=require(_0x7cad('0x2'));var express=require('express');var router=express[_0x7cad('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7cad('0x4'));var config=require('../../config/environment');var controller=require(_0x7cad('0x5'));router[_0x7cad('0x6')]('/',auth['isAuthenticated'](),controller[_0x7cad('0x7')]);router[_0x7cad('0x6')](_0x7cad('0x8'),auth[_0x7cad('0x9')](),controller['show']);router['get'](_0x7cad('0xa'),auth[_0x7cad('0x9')](),controller['getHoppers']);router['get'](_0x7cad('0xb'),auth['isAuthenticated'](),controller[_0x7cad('0xc')]);router[_0x7cad('0x6')]('/:id/hopper_finals',auth[_0x7cad('0x9')](),controller[_0x7cad('0xd')]);router[_0x7cad('0x6')](_0x7cad('0xe'),auth['isAuthenticated'](),controller[_0x7cad('0xf')]);router[_0x7cad('0x6')]('/:id/teams',auth[_0x7cad('0x9')](),controller[_0x7cad('0x10')]);router['get'](_0x7cad('0x11'),auth[_0x7cad('0x9')](),controller['getAgents']);router[_0x7cad('0x6')](_0x7cad('0x12'),auth[_0x7cad('0x9')](),controller[_0x7cad('0x13')]);router[_0x7cad('0x6')](_0x7cad('0x14'),auth[_0x7cad('0x9')](),controller[_0x7cad('0x15')]);router[_0x7cad('0x6')](_0x7cad('0x16'),auth[_0x7cad('0x9')](),controller[_0x7cad('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7cad('0x18')]);router[_0x7cad('0x19')](_0x7cad('0x1a'),auth['isAuthenticated'](),controller[_0x7cad('0x1b')]);router[_0x7cad('0x19')](_0x7cad('0x1c'),auth[_0x7cad('0x9')](),controller[_0x7cad('0x1d')]);router['post'](_0x7cad('0x11'),auth[_0x7cad('0x9')](),controller[_0x7cad('0x1e')]);router['post']('/:id/lists',auth[_0x7cad('0x9')](),controller[_0x7cad('0x1f')]);router[_0x7cad('0x19')](_0x7cad('0x16'),auth['isAuthenticated'](),controller[_0x7cad('0x20')]);router[_0x7cad('0x21')](_0x7cad('0x8'),auth[_0x7cad('0x9')](),controller[_0x7cad('0x22')]);router['delete']('/:id',auth[_0x7cad('0x9')](),controller['destroy']);router[_0x7cad('0x23')](_0x7cad('0x1c'),auth[_0x7cad('0x9')](),controller[_0x7cad('0x24')]);router[_0x7cad('0x23')](_0x7cad('0x11'),auth[_0x7cad('0x9')](),controller[_0x7cad('0x25')]);router[_0x7cad('0x23')]('/:id/lists',auth[_0x7cad('0x9')](),controller[_0x7cad('0x26')]);router[_0x7cad('0x23')](_0x7cad('0x16'),auth[_0x7cad('0x9')](),controller[_0x7cad('0x27')]);module[_0x7cad('0x28')]=router;
\ No newline at end of file
index 8dda931..356cfee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea31=['#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','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\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','type','booked','roundrobin','progressive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','setDataValue','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','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)','always','never','onlyIfOpen'];(function(_0x5ee252,_0x28ece6){var _0x3eeb19=function(_0x9ba6e1){while(--_0x9ba6e1){_0x5ee252['push'](_0x5ee252['shift']());}};_0x3eeb19(++_0x28ece6);}(_0xea31,0x6b));var _0x1ea3=function(_0x27e372,_0x143fcc){_0x27e372=_0x27e372-0x0;var _0x39f8df=_0xea31[_0x27e372];return _0x39f8df;};'use strict';var Sequelize=require(_0x1ea3('0x0'));module['exports']={'name':{'type':Sequelize[_0x1ea3('0x1')],'allowNull':![],'unique':_0x1ea3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x4'),_0x1ea3('0x5')),'allowNull':![],'defaultValue':_0x1ea3('0x4')},'musiconhold':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1ea3('0x3')]('rr',_0x1ea3('0x6'),_0x1ea3('0x7'),_0x1ea3('0x8'),'random',_0x1ea3('0x9'),_0x1ea3('0xa'),_0x1ea3('0xb'),_0x1ea3('0xc')),'allowNull':![],'defaultValue':_0x1ea3('0x6'),'set':function(_0x2ff19a){this['setDataValue'](_0x1ea3('0xd'),_0x2ff19a?_0x2ff19a:_0x1ea3('0x9'));},'get':function(){var _0x3ad43b=this[_0x1ea3('0xe')](_0x1ea3('0xf'));var _0x3cecd8=this[_0x1ea3('0xe')]('dialMethod');var _0x1c662f=this['getDataValue'](_0x1ea3('0xd'));if(_0x3ad43b===_0x1ea3('0x4')){return _0x1c662f;}if(_0x3cecd8===_0x1ea3('0x10')&&_0x1c662f==='rrmemory'||_0x3cecd8===_0x1ea3('0x10')&&_0x1c662f===_0x1ea3('0x11')){return _0x1c662f;}if(_0x3cecd8===_0x1ea3('0x12')||_0x3cecd8==='predictive'||_0x3cecd8===_0x1ea3('0x13')){return _0x1c662f;}return null;}},'servicelevel':{'type':Sequelize[_0x1ea3('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1ea3('0x14')](0xb)},'timeout':{'type':Sequelize[_0x1ea3('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1ea3('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1ea3('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x1ea3('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x15'),'no'),'defaultValue':_0x1ea3('0x15')},'autopause':{'type':Sequelize[_0x1ea3('0x3')]('yes','no',_0x1ea3('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1ea3('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x1ea3('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1ea3('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x1ea3('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x1ea3('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1ea3('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x1ea3('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1ea3('0x3')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x1ea3('0x3')]('yes','no',_0x1ea3('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x1ea3('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1ea3('0x1')]},'queue_youarenext':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1ea3('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1ea3('0x1')]},'queue_quantity1':{'type':Sequelize[_0x1ea3('0x1')]},'queue_quantity2':{'type':Sequelize[_0x1ea3('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x1ea3('0x1')]},'queue_less_than':{'type':Sequelize[_0x1ea3('0x1')]},'periodic_announce':{'type':Sequelize[_0x1ea3('0x18')],'set':function(_0x425457){this['setDataValue'](_0x1ea3('0x19'),_0x425457?_0x425457[_0x1ea3('0x1a')](','):[]);},'get':function(){return this[_0x1ea3('0xe')](_0x1ea3('0x19'))?this[_0x1ea3('0xe')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':_0x1ea3('0x15'),'set':function(_0x5d510a){this[_0x1ea3('0x1b')](_0x1ea3('0x1c'),_0x5d510a?_0x5d510a['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x1ea3('0x1c'))?this[_0x1ea3('0xe')](_0x1ea3('0x1c'))[_0x1ea3('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':'no','set':function(_0x330611){this[_0x1ea3('0x1b')](_0x1ea3('0x1e'),_0x330611?_0x330611[_0x1ea3('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x1ea3('0x1e'))?this[_0x1ea3('0xe')](_0x1ea3('0x1e'))[_0x1ea3('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1ea3('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1ea3('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1ea3('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x1ea3('0x1f')],'defaultValue':0x0,'set':function(_0x5578c1){this['setDataValue'](_0x1ea3('0x20'),_0x5578c1);if(_0x5578c1){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0x1ea3('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1ea3('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1ea3('0x1f')],'defaultValue':0x0,'comment':_0x1ea3('0x22')},'dialMethod':{'type':Sequelize[_0x1ea3('0x3')]('preview',_0x1ea3('0x12'),'power',_0x1ea3('0x23'),_0x1ea3('0x10')),'defaultValue':'progressive','comment':_0x1ea3('0x24')},'dialLimitChannel':{'type':Sequelize[_0x1ea3('0x14')](0x4)[_0x1ea3('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1ea3('0x26')},'dialLimitQueue':{'type':Sequelize[_0x1ea3('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1ea3('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x1ea3('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x1ea3('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x29'),_0x1ea3('0x2a')),'defaultValue':_0x1ea3('0x2a'),'comment':_0x1ea3('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1ea3('0x2c')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1ea3('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x1ea3('0x14')](0x3)[_0x1ea3('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1ea3('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1ea3('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1ea3('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ea3('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x1ea3('0x2f'),'comment':_0x1ea3('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x1ea3('0x14')](0x3)[_0x1ea3('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ea3('0x31')},'dialQueueProject':{'type':Sequelize[_0x1ea3('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1ea3('0x14')](0x3)[_0x1ea3('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ea3('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1ea3('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ea3('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x1ea3('0x14')](0x3)[_0x1ea3('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ea3('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1ea3('0x14')](0x5)[_0x1ea3('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ea3('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1ea3('0x14')](0x3)[_0x1ea3('0x25')],'defaultValue':0x3,'comment':_0x1ea3('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1ea3('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ea3('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1ea3('0x14')](0x3)[_0x1ea3('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x1ea3('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x38'),_0x1ea3('0x39'),_0x1ea3('0x3a')),'defaultValue':_0x1ea3('0x38')},'dialAMDActive':{'type':Sequelize[_0x1ea3('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1ea3('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x1ea3('0x14')](0x9)[_0x1ea3('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1ea3('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1ea3('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1ea3('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1ea3('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1ea3('0x3e')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1ea3('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1ea3('0x14')](0x9)[_0x1ea3('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1ea3('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1ea3('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1ea3('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1ea3('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1ea3('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1ea3('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x1ea3('0x14')](0x5)[_0x1ea3('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1ea3('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x1ea3('0x1f')],'defaultValue':0x0,'comment':_0x1ea3('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1ea3('0x3')](_0x1ea3('0x46'),_0x1ea3('0x47')),'defaultValue':_0x1ea3('0x46')},'dialQueueProject2':{'type':Sequelize[_0x1ea3('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1ea3('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1ea3('0x14')](0x3)[_0x1ea3('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x1ea3('0x14')](0x3)[_0x1ea3('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1ea3('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1ea3('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ea3('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x1ea3('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ea3('0x4a')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1ea3('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ea3('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1ea3('0x14')](0x3)[_0x1ea3('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ea3('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1ea3('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ea3('0x4d')},'dialMachineMaxRetry':{'type':Sequelize[_0x1ea3('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1ea3('0x14')](0x5)[_0x1ea3('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1ea3('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1ea3('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1ea3('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1ea3('0x14')](0x5)[_0x1ea3('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1ea3('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1ea3('0x50'),'set':function(_0x3fde66){if(!_0x3fde66)this[_0x1ea3('0x1b')](_0x1ea3('0x51'),null);this['setDataValue'](_0x1ea3('0x52'),_0x3fde66);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1ea3('0x14')](0x3)[_0x1ea3('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x1ea3('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0xcd3a=['dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','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','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','random','rrmemory','linear','rrordered','setDataValue','getDataValue','type','strategy','booked','progressive','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','power','predictive','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xcd3a,0xcf));var _0xacd3=function(_0x49203f,_0x418d5c){_0x49203f=_0x49203f-0x0;var _0x4cf22d=_0xcd3a[_0x49203f];return _0x4cf22d;};'use strict';var Sequelize=require(_0xacd3('0x0'));module[_0xacd3('0x1')]={'name':{'type':Sequelize[_0xacd3('0x2')],'allowNull':![],'unique':_0xacd3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x5'),_0xacd3('0x6')),'allowNull':![],'defaultValue':_0xacd3('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xacd3('0x7')},'announce':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xacd3('0x4')]('rr',_0xacd3('0x8'),'leastrecent','fewestcalls',_0xacd3('0x9'),_0xacd3('0xa'),_0xacd3('0xb'),'wrandom',_0xacd3('0xc')),'allowNull':![],'defaultValue':_0xacd3('0x8'),'set':function(_0x26056f){this[_0xacd3('0xd')]('strategy',_0x26056f?_0x26056f:_0xacd3('0xa'));},'get':function(){var _0x5c85b5=this[_0xacd3('0xe')](_0xacd3('0xf'));var _0x2d3279=this[_0xacd3('0xe')]('dialMethod');var _0x397f6d=this[_0xacd3('0xe')](_0xacd3('0x10'));if(_0x5c85b5==='inbound'){return _0x397f6d;}if(_0x2d3279==='booked'&&_0x397f6d===_0xacd3('0xa')||_0x2d3279===_0xacd3('0x11')&&_0x397f6d==='roundrobin'){return _0x397f6d;}if(_0x2d3279===_0xacd3('0x12')||_0x2d3279==='predictive'||_0x2d3279==='power'){return _0x397f6d;}return null;}},'servicelevel':{'type':Sequelize[_0xacd3('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xacd3('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xacd3('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xacd3('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xacd3('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xacd3('0x4')]('yes','no'),'defaultValue':_0xacd3('0x14')},'autopause':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x14'),'no',_0xacd3('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xacd3('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xacd3('0x4')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xacd3('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xacd3('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xacd3('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xacd3('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xacd3('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x14'),'no'),'defaultValue':_0xacd3('0x14')},'announce_holdtime':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x14'),'no',_0xacd3('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xacd3('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xacd3('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xacd3('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xacd3('0x2')]},'queue_quantity1':{'type':Sequelize[_0xacd3('0x2')]},'queue_quantity2':{'type':Sequelize[_0xacd3('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xacd3('0x2')]},'periodic_announce':{'type':Sequelize[_0xacd3('0x17')],'set':function(_0x5bc911){this[_0xacd3('0xd')](_0xacd3('0x18'),_0x5bc911?_0x5bc911[_0xacd3('0x19')](','):[]);},'get':function(){return this[_0xacd3('0xe')](_0xacd3('0x18'))?this[_0xacd3('0xe')](_0xacd3('0x18'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':_0xacd3('0x14'),'set':function(_0x48073a){this[_0xacd3('0xd')]('joinempty',_0x48073a?_0x48073a[_0xacd3('0x19')](','):undefined);},'get':function(){return this[_0xacd3('0xe')](_0xacd3('0x1a'))?this[_0xacd3('0xe')]('joinempty')[_0xacd3('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':'no','set':function(_0xd453cf){this[_0xacd3('0xd')](_0xacd3('0x1c'),_0xd453cf?_0xd453cf['join'](','):undefined);},'get':function(){return this[_0xacd3('0xe')](_0xacd3('0x1c'))?this[_0xacd3('0xe')](_0xacd3('0x1c'))[_0xacd3('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xacd3('0x4')](_0xacd3('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xacd3('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xacd3('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xacd3('0x2')]},'description':{'type':Sequelize[_0xacd3('0x2')]},'acw':{'type':Sequelize[_0xacd3('0x1d')],'defaultValue':0x0,'set':function(_0x1a938a){this[_0xacd3('0xd')]('acw',_0x1a938a);if(_0x1a938a){if(this[_0xacd3('0xe')](_0xacd3('0x1e'))<0x2){this[_0xacd3('0xd')](_0xacd3('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xacd3('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xacd3('0x1f')},'dialMethod':{'type':Sequelize[_0xacd3('0x4')]('preview','progressive',_0xacd3('0x20'),_0xacd3('0x21'),'booked'),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xacd3('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xacd3('0x22')},'dialLimitQueue':{'type':Sequelize[_0xacd3('0x13')](0x4)[_0xacd3('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xacd3('0x24')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xacd3('0x25')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xacd3('0x26'),_0xacd3('0x27')),'defaultValue':_0xacd3('0x27'),'comment':_0xacd3('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xacd3('0x24')](0x2)[_0xacd3('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xacd3('0x29')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xacd3('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0xacd3('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xacd3('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xacd3('0x13')](0x3)[_0xacd3('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':_0xacd3('0x2b'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xacd3('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xacd3('0x2c')},'dialQueueProject':{'type':Sequelize[_0xacd3('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xacd3('0x13')](0x3)[_0xacd3('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xacd3('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xacd3('0x13')](0x5)[_0xacd3('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xacd3('0x2e')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xacd3('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xacd3('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xacd3('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xacd3('0x13')](0x3)[_0xacd3('0x23')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xacd3('0x13')](0x5)[_0xacd3('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xacd3('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0xacd3('0x13')](0x3)[_0xacd3('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xacd3('0x32')},'dialTimezone':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xacd3('0x33')},'dialPrefix':{'type':Sequelize[_0xacd3('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xacd3('0x34'),_0xacd3('0x35'),_0xacd3('0x36')),'defaultValue':_0xacd3('0x34')},'dialAMDActive':{'type':Sequelize[_0xacd3('0x1d')],'defaultValue':0x0,'comment':_0xacd3('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0xacd3('0x13')](0x9)[_0xacd3('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xacd3('0x38')},'dialAMDGreeting':{'type':Sequelize[_0xacd3('0x13')](0x9)[_0xacd3('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xacd3('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xacd3('0x13')](0x9)[_0xacd3('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xacd3('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xacd3('0x13')](0x9)[_0xacd3('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xacd3('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0xacd3('0x13')](0x9)[_0xacd3('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xacd3('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xacd3('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xacd3('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xacd3('0x13')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xacd3('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xacd3('0x13')](0x5)[_0xacd3('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xacd3('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xacd3('0x13')](0x9)[_0xacd3('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xacd3('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0xacd3('0x13')](0x5)[_0xacd3('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xacd3('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0xacd3('0x4')]('DESC',_0xacd3('0x42')),'defaultValue':_0xacd3('0x43')},'dialQueueProject2':{'type':Sequelize[_0xacd3('0x2')],'comment':_0xacd3('0x44')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xacd3('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xacd3('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xacd3('0x13')](0x3)[_0xacd3('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xacd3('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xacd3('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xacd3('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xacd3('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xacd3('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xacd3('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0xacd3('0x13')](0x3)[_0xacd3('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xacd3('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0xacd3('0x13')](0x5)[_0xacd3('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xacd3('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xacd3('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xacd3('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xacd3('0x13')](0x5)[_0xacd3('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xacd3('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0xacd3('0x13')](0x3)[_0xacd3('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xacd3('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0xacd3('0x13')](0x5)[_0xacd3('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xacd3('0x13')](0x3)[_0xacd3('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xacd3('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xacd3('0x13')](0x5)[_0xacd3('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xacd3('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xacd3('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0xacd3('0x1d')],'defaultValue':![],'comment':_0xacd3('0x50'),'set':function(_0x4b7a63){if(!_0x4b7a63)this[_0xacd3('0xd')]('mandatoryDispositionPauseId',null);this[_0xacd3('0xd')](_0xacd3('0x51'),_0x4b7a63);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xacd3('0x13')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xacd3('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index 91495b3..fcd8bcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5555=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','name','UserProfileResource','error','stack','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','length','nolimit','sort','where','VIRTUAL','merge','options','VoiceQueue','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','autoAssociation','getHoppers','findOne','hasOwnProperty','order','pick','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','Agents','online','interface','penalty','sequelize','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','forEach','userVoiceQueue:save','removeTeams','User','field','tq.TeamId','team_has_voice_queues','user_has_teams','VoiceQueueId\x20=\x20?','clone','push','SELECT','ids','isEmpty','emit','userVoiceQueue:remove','addAgents','spread','all','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ListId','select','phone','NOW()','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','cm_hopper','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x19c753,_0x2c4ba2){var _0x5a6d72=function(_0x3add3b){while(--_0x3add3b){_0x19c753['push'](_0x19c753['shift']());}};_0x5a6d72(++_0x2c4ba2);}(_0x5555,0x155));var _0x5555=function(_0x5ba0db,_0x52f832){_0x5ba0db=_0x5ba0db-0x0;var _0x332855=_0x5555[_0x5ba0db];return _0x332855;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5555('0x0'));var zipdir=require(_0x5555('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5555('0x2'));var BPromise=require(_0x5555('0x3'));var Mustache=require(_0x5555('0x4'));var util=require(_0x5555('0x5'));var path=require(_0x5555('0x6'));var sox=require(_0x5555('0x7'));var csv=require('to-csv');var ejs=require(_0x5555('0x8'));var fs=require('fs');var fs_extra=require(_0x5555('0x9'));var _=require(_0x5555('0xa'));var squel=require(_0x5555('0xb'));var crypto=require(_0x5555('0xc'));var jsforce=require(_0x5555('0xd'));var deskjs=require(_0x5555('0xe'));var toCsv=require(_0x5555('0xf'));var querystring=require(_0x5555('0x10'));var Papa=require('papaparse');var Redis=require(_0x5555('0x11'));var authService=require(_0x5555('0x12'));var qs=require(_0x5555('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5555('0x14'));var logger=require(_0x5555('0x15'))(_0x5555('0x16'));var utils=require(_0x5555('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5555('0x18'))['db'];config[_0x5555('0x19')]=_['defaults'](config[_0x5555('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x5555('0x1a'))(new Redis(config['redis']));require(_0x5555('0x1b'))['register'](socket);function respondWithStatusCode(_0x7d79e0,_0x3a0c20){_0x3a0c20=_0x3a0c20||0xcc;return function(_0x52ed0e){if(_0x52ed0e){return _0x7d79e0[_0x5555('0x1c')](_0x3a0c20);}return _0x7d79e0[_0x5555('0x1d')](_0x3a0c20)['end']();};}function respondWithResult(_0x1b09da,_0x3118ab){_0x3118ab=_0x3118ab||0xc8;return function(_0x53a6f1){if(_0x53a6f1){return _0x1b09da[_0x5555('0x1d')](_0x3118ab)[_0x5555('0x1e')](_0x53a6f1);}};}function respondWithFilteredResult(_0x2b9cd2,_0x5b2243){return function(_0x4607b1){if(_0x4607b1){var _0x35aa38=typeof _0x5b2243[_0x5555('0x1f')]===_0x5555('0x20')&&typeof _0x5b2243[_0x5555('0x21')]==='undefined';var _0x43d9f1=_0x4607b1[_0x5555('0x22')];var _0x757c12=_0x35aa38?0x0:_0x5b2243[_0x5555('0x1f')];var _0x260c40=_0x35aa38?_0x4607b1[_0x5555('0x22')]:_0x5b2243[_0x5555('0x1f')]+_0x5b2243[_0x5555('0x21')];var _0x3d377a;if(_0x260c40>=_0x43d9f1){_0x260c40=_0x43d9f1;_0x3d377a=0xc8;}else{_0x3d377a=0xce;}_0x2b9cd2[_0x5555('0x1d')](_0x3d377a);return _0x2b9cd2[_0x5555('0x23')](_0x5555('0x24'),_0x757c12+'-'+_0x260c40+'/'+_0x43d9f1)[_0x5555('0x1e')](_0x4607b1);}return null;};}function patchUpdates(_0xea9c50){return function(_0x273c9c){try{jsonpatch[_0x5555('0x25')](_0x273c9c,_0xea9c50,!![]);}catch(_0x493eae){return BPromise[_0x5555('0x26')](_0x493eae);}return _0x273c9c[_0x5555('0x27')]();};}function saveUpdates(_0x1a076f,_0x2d11cf){return function(_0x57eb4d){if(_0x57eb4d){return _0x57eb4d[_0x5555('0x28')](_0x1a076f)[_0x5555('0x29')](function(_0x3452a3){return _0x3452a3;});}return null;};}function removeEntity(_0x59e1be,_0x45eb11){return function(_0x4f76ee){if(_0x4f76ee){return _0x4f76ee[_0x5555('0x2a')]()[_0x5555('0x29')](function(){var _0x24bb97=_0x4f76ee[_0x5555('0x2b')]({'plain':!![]});var _0x7e62b4=[{'name':_0x5555('0x2c'),'value':_0x5555('0x2d'),'ignore':![]},{'name':_0x5555('0x2e'),'value':_0x5555('0x2f'),'ignore':![]}];var _0xc8d670=_(_0x7e62b4)[_0x5555('0x30')](_0x5555('0x31'))['map'](_0x5555('0x32'))[_0x5555('0x32')]();if(_[_0x5555('0x33')](_0xc8d670,_0x24bb97[_0x5555('0x34')])){return;}var _0x4eea77=_['find'](_0x7e62b4,[_0x5555('0x32'),_0x24bb97['type']])[_0x5555('0x35')];return db[_0x5555('0x36')]['destroy']({'where':{'type':_0x4eea77,'resourceId':_0x24bb97['id']}})[_0x5555('0x29')](function(){return _0x4f76ee;});})[_0x5555('0x29')](function(){_0x59e1be[_0x5555('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30858c,_0xecd56f){return function(_0x386ec4){if(!_0x386ec4){_0x30858c[_0x5555('0x1c')](0x194);}return _0x386ec4;};}function handleError(_0x278920,_0x24d755){_0x24d755=_0x24d755||0x1f4;return function(_0x590167){logger[_0x5555('0x37')](_0x590167[_0x5555('0x38')]);if(_0x590167[_0x5555('0x35')]){delete _0x590167['name'];}_0x278920[_0x5555('0x1d')](_0x24d755)[_0x5555('0x39')](_0x590167);};}exports[_0x5555('0x3a')]=function(_0x3c0798,_0x2dcaa7){var _0x1af4dd={},_0x1ebcc2={},_0x49164b={'count':0x0,'rows':[]};var _0x10bff3=_[_0x5555('0x3b')](db['VoiceQueue'][_0x5555('0x3c')],function(_0x5644ab){return{'name':_0x5644ab[_0x5555('0x3d')],'type':_0x5644ab['type']['key']};});_0x1ebcc2['model']=_[_0x5555('0x3b')](_0x10bff3,_0x5555('0x35'));_0x1ebcc2[_0x5555('0x3e')]=_[_0x5555('0x3f')](_0x3c0798[_0x5555('0x3e')]);_0x1ebcc2[_0x5555('0x40')]=_[_0x5555('0x41')](_0x1ebcc2['model'],_0x1ebcc2[_0x5555('0x3e')]);_0x1af4dd[_0x5555('0x42')]=_['intersection'](_0x1ebcc2[_0x5555('0x43')],qs[_0x5555('0x44')](_0x3c0798[_0x5555('0x3e')][_0x5555('0x44')]));_0x1af4dd[_0x5555('0x42')]=_0x1af4dd['attributes'][_0x5555('0x45')]?_0x1af4dd[_0x5555('0x42')]:_0x1ebcc2[_0x5555('0x43')];if(!_0x3c0798[_0x5555('0x3e')]['hasOwnProperty'](_0x5555('0x46'))){_0x1af4dd['limit']=qs[_0x5555('0x21')](_0x3c0798[_0x5555('0x3e')][_0x5555('0x21')]);_0x1af4dd['offset']=qs[_0x5555('0x1f')](_0x3c0798[_0x5555('0x3e')][_0x5555('0x1f')]);}_0x1af4dd['order']=qs[_0x5555('0x47')](_0x3c0798[_0x5555('0x3e')][_0x5555('0x47')]);_0x1af4dd[_0x5555('0x48')]=qs['filters'](_['pick'](_0x3c0798[_0x5555('0x3e')],_0x1ebcc2[_0x5555('0x40')]),_0x10bff3);if(_0x3c0798[_0x5555('0x3e')]['filter']){_0x1af4dd['where']=_['merge'](_0x1af4dd['where'],{'$or':_[_0x5555('0x3b')](_0x10bff3,function(_0x30c710){if(_0x30c710[_0x5555('0x34')]!==_0x5555('0x49')){var _0x111ba0={};_0x111ba0[_0x30c710['name']]={'$like':'%'+_0x3c0798[_0x5555('0x3e')]['filter']+'%'};return _0x111ba0;}})});}_0x1af4dd=_[_0x5555('0x4a')]({},_0x1af4dd,_0x3c0798[_0x5555('0x4b')]);var _0x205e2e={'where':_0x1af4dd[_0x5555('0x48')]};return db[_0x5555('0x4c')]['count'](_0x205e2e)[_0x5555('0x29')](function(_0x3ef39a){_0x49164b[_0x5555('0x22')]=_0x3ef39a;if(_0x3c0798['query'][_0x5555('0x4d')]){_0x1af4dd[_0x5555('0x4e')]=[{'all':!![]}];}return db[_0x5555('0x4c')][_0x5555('0x4f')](_0x1af4dd);})[_0x5555('0x29')](function(_0x7815f3){_0x49164b[_0x5555('0x50')]=_0x7815f3;return _0x49164b;})['then'](respondWithFilteredResult(_0x2dcaa7,_0x1af4dd))[_0x5555('0x51')](handleError(_0x2dcaa7,null));};exports['show']=function(_0x2374d6,_0x4774ed){var _0x1d0456={'raw':![],'where':{'id':_0x2374d6[_0x5555('0x52')]['id']}},_0x5dcf4f={};_0x5dcf4f[_0x5555('0x43')]=_[_0x5555('0x3f')](db['VoiceQueue'][_0x5555('0x3c')]);_0x5dcf4f[_0x5555('0x3e')]=_[_0x5555('0x3f')](_0x2374d6[_0x5555('0x3e')]);_0x5dcf4f[_0x5555('0x40')]=_[_0x5555('0x41')](_0x5dcf4f[_0x5555('0x43')],_0x5dcf4f[_0x5555('0x3e')]);_0x1d0456[_0x5555('0x42')]=_[_0x5555('0x41')](_0x5dcf4f[_0x5555('0x43')],qs[_0x5555('0x44')](_0x2374d6['query']['fields']));_0x1d0456[_0x5555('0x42')]=_0x1d0456[_0x5555('0x42')][_0x5555('0x45')]?_0x1d0456[_0x5555('0x42')]:_0x5dcf4f[_0x5555('0x43')];if(_0x2374d6[_0x5555('0x3e')]['includeAll']){_0x1d0456[_0x5555('0x4e')]=[{'all':!![]}];}_0x1d0456=_[_0x5555('0x4a')]({},_0x1d0456,_0x2374d6['options']);return db[_0x5555('0x4c')][_0x5555('0x53')](_0x1d0456)[_0x5555('0x29')](handleEntityNotFound(_0x4774ed,null))[_0x5555('0x29')](respondWithResult(_0x4774ed,null))[_0x5555('0x51')](handleError(_0x4774ed,null));};exports[_0x5555('0x54')]=function(_0x419d26,_0x2f7cae){return db[_0x5555('0x4c')]['create'](_0x419d26[_0x5555('0x55')],{})[_0x5555('0x29')](function(_0xfa45cb){var _0x4d990c=_0x419d26[_0x5555('0x56')][_0x5555('0x2b')]({'plain':!![]});if(!_0x4d990c)throw new Error(_0x5555('0x57'));if(_0x4d990c[_0x5555('0x58')]==='user'){var _0x1704a8=_0xfa45cb['get']({'plain':!![]});var _0x2d8ab5=[{'name':_0x5555('0x2c'),'value':_0x5555('0x2d')},{'name':_0x5555('0x2e'),'value':_0x5555('0x2f')}];var _0x166762=_[_0x5555('0x53')](_0x2d8ab5,[_0x5555('0x32'),_0x1704a8[_0x5555('0x34')]])['name'];return db[_0x5555('0x59')][_0x5555('0x53')]({'where':{'name':_0x166762,'userProfileId':_0x4d990c[_0x5555('0x5a')]},'raw':!![]})[_0x5555('0x29')](function(_0x172843){if(_0x172843&&_0x172843['autoAssociation']===0x0){return db[_0x5555('0x36')][_0x5555('0x54')]({'name':_0x1704a8['name'],'resourceId':_0x1704a8['id'],'type':_0x172843['name'],'sectionId':_0x172843['id']},{})[_0x5555('0x29')](function(){return _0xfa45cb;});}else{return _0xfa45cb;}})[_0x5555('0x51')](function(_0x1f25a7){logger[_0x5555('0x37')](_0x5555('0x5b'),_0x1f25a7);throw _0x1f25a7;});}return _0xfa45cb;})[_0x5555('0x29')](respondWithResult(_0x2f7cae,0xc9))['catch'](handleError(_0x2f7cae,null));};exports['clone']=function(_0x436469,_0x2093a2){var _0x464d16={'where':{'id':_0x436469[_0x5555('0x52')]['id']}},_0x579d72={};_0x579d72[_0x5555('0x43')]=_['keys'](db[_0x5555('0x4c')]['rawAttributes']);_0x464d16[_0x5555('0x42')]=_[_0x5555('0x41')](_0x579d72['model'],qs['fields'](_0x436469[_0x5555('0x3e')][_0x5555('0x44')]));_0x464d16[_0x5555('0x42')]=_0x464d16[_0x5555('0x42')][_0x5555('0x45')]?_0x464d16[_0x5555('0x42')]:_0x579d72[_0x5555('0x43')];if(_0x436469['query'][_0x5555('0x4d')]){_0x464d16['include']=[{'all':!![]}];}_0x464d16=_[_0x5555('0x4a')]({},_0x464d16,_0x436469['options']);return db['VoiceQueue'][_0x5555('0x53')](_0x464d16)[_0x5555('0x29')](handleEntityNotFound(_0x2093a2,null))[_0x5555('0x29')](function(_0x42f54a){if(_0x42f54a){var _0x55cfe7=_0x42f54a[_0x5555('0x2b')]({'plain':!![]});_0x55cfe7=qs[_0x5555('0x5c')](_0x55cfe7,['id',_0x5555('0x5d'),_0x5555('0x5e')]);_0x436469[_0x5555('0x55')]=_[_0x5555('0x5c')](_0x436469[_0x5555('0x55')],['id','createdAt','updatedAt']);return db[_0x5555('0x4c')][_0x5555('0x54')](_[_0x5555('0x4a')](_0x55cfe7,_0x436469['body']),{'include':_0x436469[_0x5555('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0x5555('0x29')](function(_0xa93eee){var _0x1b3d2b=_0x436469[_0x5555('0x56')]['get']({'plain':!![]});if(!_0x1b3d2b)throw new Error(_0x5555('0x57'));if(_0x1b3d2b['role']===_0x5555('0x56')){var _0x5951b4=_0xa93eee['get']({'plain':!![]});var _0x103801=[{'name':_0x5555('0x2c'),'value':_0x5555('0x2d')},{'name':_0x5555('0x2e'),'value':_0x5555('0x2f')}];var _0x1d2b6d=_[_0x5555('0x53')](_0x103801,[_0x5555('0x32'),_0x5951b4[_0x5555('0x34')]])[_0x5555('0x35')];return db['UserProfileSection']['find']({'where':{'name':_0x1d2b6d,'userProfileId':_0x1b3d2b[_0x5555('0x5a')]},'raw':!![]})[_0x5555('0x29')](function(_0x175607){if(_0x175607&&_0x175607[_0x5555('0x5f')]===0x0){return db[_0x5555('0x36')][_0x5555('0x54')]({'name':_0x5951b4['name'],'resourceId':_0x5951b4['id'],'type':_0x175607[_0x5555('0x35')],'sectionId':_0x175607['id']},{})[_0x5555('0x29')](function(){return _0xa93eee;});}else{return _0xa93eee;}})[_0x5555('0x51')](function(_0x15a5f2){logger['error'](_0x5555('0x5b'),_0x15a5f2);throw _0x15a5f2;});}return _0xa93eee;});}})['then'](respondWithResult(_0x2093a2,0xc9))[_0x5555('0x51')](handleError(_0x2093a2,null));};exports[_0x5555('0x28')]=function(_0x8cf7fa,_0x23ffa2){if(_0x8cf7fa['body']['id']){delete _0x8cf7fa['body']['id'];}return db[_0x5555('0x4c')][_0x5555('0x53')]({'where':{'id':_0x8cf7fa['params']['id']}})['then'](handleEntityNotFound(_0x23ffa2,null))[_0x5555('0x29')](saveUpdates(_0x8cf7fa[_0x5555('0x55')],null))[_0x5555('0x29')](respondWithResult(_0x23ffa2,null))[_0x5555('0x51')](handleError(_0x23ffa2,null));};exports[_0x5555('0x2a')]=function(_0x1334e8,_0x189bf5){return db['VoiceQueue'][_0x5555('0x53')]({'where':{'id':_0x1334e8[_0x5555('0x52')]['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x189bf5,null))[_0x5555('0x29')](removeEntity(_0x189bf5,null))[_0x5555('0x51')](handleError(_0x189bf5,null));};exports[_0x5555('0x60')]=function(_0x9dc938,_0x1a4198,_0x4ff9e4){var _0x18178a={'raw':![],'where':{}};var _0x1a0d22={};var _0x2a6e68={'count':0x0,'rows':[]};return db[_0x5555('0x4c')][_0x5555('0x61')]({'where':{'id':_0x9dc938[_0x5555('0x52')]['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x1a4198,null))['then'](function(_0x59cd37){if(_0x59cd37){_0x1a0d22[_0x5555('0x43')]=_[_0x5555('0x3f')](db['CmHopper']['rawAttributes']);_0x1a0d22['query']=_[_0x5555('0x3f')](_0x9dc938[_0x5555('0x3e')]);_0x1a0d22['filters']=_[_0x5555('0x41')](_0x1a0d22['model'],_0x1a0d22[_0x5555('0x3e')]);_0x18178a[_0x5555('0x42')]=_['intersection'](_0x1a0d22['model'],qs['fields'](_0x9dc938[_0x5555('0x3e')][_0x5555('0x44')]));_0x18178a[_0x5555('0x42')]=_0x18178a[_0x5555('0x42')][_0x5555('0x45')]?_0x18178a[_0x5555('0x42')]:_0x1a0d22[_0x5555('0x43')];if(!_0x9dc938[_0x5555('0x3e')][_0x5555('0x62')](_0x5555('0x46'))){_0x18178a[_0x5555('0x21')]=qs[_0x5555('0x21')](_0x9dc938['query'][_0x5555('0x21')]);_0x18178a[_0x5555('0x1f')]=qs[_0x5555('0x1f')](_0x9dc938[_0x5555('0x3e')][_0x5555('0x1f')]);}_0x18178a[_0x5555('0x63')]=qs['sort'](_0x9dc938[_0x5555('0x3e')][_0x5555('0x47')]);_0x18178a[_0x5555('0x48')]=qs[_0x5555('0x40')](_[_0x5555('0x64')](_0x9dc938['query'],_0x1a0d22['filters']));_0x18178a[_0x5555('0x48')][_0x5555('0x65')]=_0x59cd37['id'];if(_0x9dc938[_0x5555('0x3e')][_0x5555('0x30')]){_0x18178a['where']=_[_0x5555('0x4a')](_0x18178a['where'],{'$or':_['map'](_0x18178a[_0x5555('0x42')],function(_0x2355fe){var _0x1ce28f={};_0x1ce28f[_0x2355fe]={'$like':'%'+_0x9dc938[_0x5555('0x3e')][_0x5555('0x30')]+'%'};return _0x1ce28f;})});}_0x18178a=_[_0x5555('0x4a')]({},_0x18178a,_0x9dc938[_0x5555('0x4b')]);return db[_0x5555('0x66')][_0x5555('0x22')]({'where':_0x18178a[_0x5555('0x48')]})[_0x5555('0x29')](function(_0x1e16ff){_0x2a6e68[_0x5555('0x22')]=_0x1e16ff;if(_0x9dc938['query'][_0x5555('0x4d')]){_0x18178a[_0x5555('0x4e')]=[{'all':!![]}];}return db[_0x5555('0x66')][_0x5555('0x4f')](_0x18178a);})[_0x5555('0x29')](function(_0x12e80d){_0x2a6e68[_0x5555('0x50')]=_0x12e80d;return _0x2a6e68;});}})[_0x5555('0x29')](respondWithFilteredResult(_0x1a4198,_0x18178a))[_0x5555('0x51')](handleError(_0x1a4198,null));};exports[_0x5555('0x67')]=function(_0x3cb461,_0x4e9093,_0x395b69){var _0x106882={'raw':!![],'where':{}};var _0x3aabb4={};var _0x2a2586={'count':0x0,'rows':[]};return db[_0x5555('0x4c')][_0x5555('0x61')]({'where':{'id':_0x3cb461['params']['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x4e9093,null))[_0x5555('0x29')](function(_0x5ba7d1){if(_0x5ba7d1){_0x3aabb4['model']=_[_0x5555('0x3f')](db[_0x5555('0x68')]['rawAttributes']);_0x3aabb4[_0x5555('0x3e')]=_[_0x5555('0x3f')](_0x3cb461[_0x5555('0x3e')]);_0x3aabb4[_0x5555('0x40')]=_[_0x5555('0x41')](_0x3aabb4['model'],_0x3aabb4[_0x5555('0x3e')]);_0x106882[_0x5555('0x42')]=_[_0x5555('0x41')](_0x3aabb4[_0x5555('0x43')],qs['fields'](_0x3cb461[_0x5555('0x3e')][_0x5555('0x44')]));_0x106882[_0x5555('0x42')]=_0x106882['attributes'][_0x5555('0x45')]?_0x106882[_0x5555('0x42')]:_0x3aabb4[_0x5555('0x43')];if(!_0x3cb461[_0x5555('0x3e')]['hasOwnProperty'](_0x5555('0x46'))){_0x106882[_0x5555('0x21')]=qs['limit'](_0x3cb461[_0x5555('0x3e')][_0x5555('0x21')]);_0x106882[_0x5555('0x1f')]=qs[_0x5555('0x1f')](_0x3cb461[_0x5555('0x3e')][_0x5555('0x1f')]);}_0x106882['order']=qs[_0x5555('0x47')](_0x3cb461[_0x5555('0x3e')][_0x5555('0x47')]);_0x106882[_0x5555('0x48')]=qs[_0x5555('0x40')](_['pick'](_0x3cb461[_0x5555('0x3e')],_0x3aabb4['filters']));_0x106882[_0x5555('0x48')][_0x5555('0x65')]=_0x5ba7d1['id'];if(_0x3cb461[_0x5555('0x3e')][_0x5555('0x30')]){_0x106882[_0x5555('0x48')]=_['merge'](_0x106882[_0x5555('0x48')],{'$or':_['map'](_0x106882[_0x5555('0x42')],function(_0xc3cd3b){var _0x2f4c2f={};_0x2f4c2f[_0xc3cd3b]={'$like':'%'+_0x3cb461[_0x5555('0x3e')][_0x5555('0x30')]+'%'};return _0x2f4c2f;})});}_0x106882=_[_0x5555('0x4a')]({},_0x106882,_0x3cb461['options']);return db[_0x5555('0x68')]['count']({'where':_0x106882[_0x5555('0x48')]})[_0x5555('0x29')](function(_0x27d534){_0x2a2586[_0x5555('0x22')]=_0x27d534;if(_0x3cb461[_0x5555('0x3e')][_0x5555('0x4d')]){_0x106882[_0x5555('0x4e')]=[{'all':!![]}];}return db[_0x5555('0x68')][_0x5555('0x4f')](_0x106882);})[_0x5555('0x29')](function(_0x28717e){_0x2a2586['rows']=_0x28717e;return _0x2a2586;});}})[_0x5555('0x29')](respondWithFilteredResult(_0x4e9093,_0x106882))[_0x5555('0x51')](handleError(_0x4e9093,null));};exports['getHopperFinals']=function(_0x504c56,_0x537648,_0x43c462){var _0x2f54e7={'raw':!![],'where':{}};var _0x2f9fab={};var _0x333f1f={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x504c56[_0x5555('0x52')]['id']}})['then'](handleEntityNotFound(_0x537648,null))[_0x5555('0x29')](function(_0x297676){if(_0x297676){_0x2f9fab[_0x5555('0x43')]=_[_0x5555('0x3f')](db['CmHopperFinal'][_0x5555('0x3c')]);_0x2f9fab[_0x5555('0x3e')]=_[_0x5555('0x3f')](_0x504c56['query']);_0x2f9fab[_0x5555('0x40')]=_[_0x5555('0x41')](_0x2f9fab[_0x5555('0x43')],_0x2f9fab[_0x5555('0x3e')]);_0x2f54e7[_0x5555('0x42')]=_[_0x5555('0x41')](_0x2f9fab[_0x5555('0x43')],qs[_0x5555('0x44')](_0x504c56['query'][_0x5555('0x44')]));_0x2f54e7[_0x5555('0x42')]=_0x2f54e7[_0x5555('0x42')][_0x5555('0x45')]?_0x2f54e7[_0x5555('0x42')]:_0x2f9fab[_0x5555('0x43')];if(!_0x504c56[_0x5555('0x3e')]['hasOwnProperty']('nolimit')){_0x2f54e7[_0x5555('0x21')]=qs[_0x5555('0x21')](_0x504c56[_0x5555('0x3e')][_0x5555('0x21')]);_0x2f54e7[_0x5555('0x1f')]=qs[_0x5555('0x1f')](_0x504c56[_0x5555('0x3e')]['offset']);}_0x2f54e7[_0x5555('0x63')]=qs[_0x5555('0x47')](_0x504c56['query']['sort']);_0x2f54e7[_0x5555('0x48')]=qs['filters'](_[_0x5555('0x64')](_0x504c56['query'],_0x2f9fab[_0x5555('0x40')]));_0x2f54e7[_0x5555('0x48')]['VoiceQueueId']=_0x297676['id'];if(_0x504c56[_0x5555('0x3e')][_0x5555('0x30')]){_0x2f54e7[_0x5555('0x48')]=_[_0x5555('0x4a')](_0x2f54e7[_0x5555('0x48')],{'$or':_[_0x5555('0x3b')](_0x2f54e7[_0x5555('0x42')],function(_0x4622f4){var _0xd047f7={};_0xd047f7[_0x4622f4]={'$like':'%'+_0x504c56[_0x5555('0x3e')][_0x5555('0x30')]+'%'};return _0xd047f7;})});}_0x2f54e7=_[_0x5555('0x4a')]({},_0x2f54e7,_0x504c56[_0x5555('0x4b')]);return db[_0x5555('0x69')][_0x5555('0x22')]({'where':_0x2f54e7[_0x5555('0x48')]})['then'](function(_0x32ded4){_0x333f1f['count']=_0x32ded4;if(_0x504c56[_0x5555('0x3e')][_0x5555('0x4d')]){_0x2f54e7['include']=[{'all':!![]}];}return db[_0x5555('0x69')][_0x5555('0x4f')](_0x2f54e7);})[_0x5555('0x29')](function(_0x5494c5){_0x333f1f['rows']=_0x5494c5;return _0x333f1f;});}})['then'](respondWithFilteredResult(_0x537648,_0x2f54e7))[_0x5555('0x51')](handleError(_0x537648,null));};exports[_0x5555('0x6a')]=function(_0x482f4e,_0x4a90c8,_0x1821d6){var _0x4f6e51={'raw':!![],'where':{}};var _0x3e5dc3={};var _0x4978ce={'count':0x0,'rows':[]};return db[_0x5555('0x4c')][_0x5555('0x61')]({'where':{'id':_0x482f4e[_0x5555('0x52')]['id']}})['then'](handleEntityNotFound(_0x4a90c8,null))['then'](function(_0x4d08f1){if(_0x4d08f1){_0x3e5dc3[_0x5555('0x43')]=_[_0x5555('0x3f')](db['CmHopperBlack'][_0x5555('0x3c')]);_0x3e5dc3[_0x5555('0x3e')]=_[_0x5555('0x3f')](_0x482f4e[_0x5555('0x3e')]);_0x3e5dc3[_0x5555('0x40')]=_['intersection'](_0x3e5dc3[_0x5555('0x43')],_0x3e5dc3[_0x5555('0x3e')]);_0x4f6e51[_0x5555('0x42')]=_[_0x5555('0x41')](_0x3e5dc3[_0x5555('0x43')],qs[_0x5555('0x44')](_0x482f4e[_0x5555('0x3e')][_0x5555('0x44')]));_0x4f6e51[_0x5555('0x42')]=_0x4f6e51[_0x5555('0x42')][_0x5555('0x45')]?_0x4f6e51['attributes']:_0x3e5dc3[_0x5555('0x43')];if(!_0x482f4e['query'][_0x5555('0x62')]('nolimit')){_0x4f6e51[_0x5555('0x21')]=qs[_0x5555('0x21')](_0x482f4e[_0x5555('0x3e')]['limit']);_0x4f6e51[_0x5555('0x1f')]=qs[_0x5555('0x1f')](_0x482f4e[_0x5555('0x3e')]['offset']);}_0x4f6e51[_0x5555('0x63')]=qs[_0x5555('0x47')](_0x482f4e[_0x5555('0x3e')]['sort']);_0x4f6e51['where']=qs[_0x5555('0x40')](_['pick'](_0x482f4e[_0x5555('0x3e')],_0x3e5dc3['filters']));_0x4f6e51[_0x5555('0x48')]['VoiceQueueId']=_0x4d08f1['id'];if(_0x482f4e[_0x5555('0x3e')][_0x5555('0x30')]){_0x4f6e51[_0x5555('0x48')]=_[_0x5555('0x4a')](_0x4f6e51[_0x5555('0x48')],{'$or':_['map'](_0x4f6e51[_0x5555('0x42')],function(_0x1bad07){var _0x41af2d={};_0x41af2d[_0x1bad07]={'$like':'%'+_0x482f4e[_0x5555('0x3e')][_0x5555('0x30')]+'%'};return _0x41af2d;})});}_0x4f6e51=_[_0x5555('0x4a')]({},_0x4f6e51,_0x482f4e[_0x5555('0x4b')]);return db[_0x5555('0x6b')]['count']({'where':_0x4f6e51[_0x5555('0x48')]})[_0x5555('0x29')](function(_0x1b7717){_0x4978ce['count']=_0x1b7717;if(_0x482f4e['query'][_0x5555('0x4d')]){_0x4f6e51['include']=[{'all':!![]}];}return db[_0x5555('0x6b')][_0x5555('0x4f')](_0x4f6e51);})[_0x5555('0x29')](function(_0x5e5f87){_0x4978ce['rows']=_0x5e5f87;return _0x4978ce;});}})[_0x5555('0x29')](respondWithFilteredResult(_0x4a90c8,_0x4f6e51))[_0x5555('0x51')](handleError(_0x4a90c8,null));};exports[_0x5555('0x6c')]=function(_0x29d427,_0x34d3e8,_0x2800ee){var _0x2c985e={};var _0x5adb6f={};var _0x59e817;var _0x225c06;return db[_0x5555('0x4c')][_0x5555('0x61')]({'where':{'id':_0x29d427[_0x5555('0x52')]['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x34d3e8,null))[_0x5555('0x29')](function(_0xc12e4e){if(_0xc12e4e){_0x59e817=_0xc12e4e;_0x5adb6f[_0x5555('0x43')]=_[_0x5555('0x3f')](db['Team']['rawAttributes']);_0x5adb6f['query']=_[_0x5555('0x3f')](_0x29d427['query']);_0x5adb6f['filters']=_[_0x5555('0x41')](_0x5adb6f[_0x5555('0x43')],_0x5adb6f[_0x5555('0x3e')]);_0x2c985e['attributes']=_[_0x5555('0x41')](_0x5adb6f[_0x5555('0x43')],qs[_0x5555('0x44')](_0x29d427[_0x5555('0x3e')][_0x5555('0x44')]));_0x2c985e[_0x5555('0x42')]=_0x2c985e[_0x5555('0x42')][_0x5555('0x45')]?_0x2c985e['attributes']:_0x5adb6f[_0x5555('0x43')];_0x2c985e[_0x5555('0x63')]=qs[_0x5555('0x47')](_0x29d427[_0x5555('0x3e')][_0x5555('0x47')]);_0x2c985e[_0x5555('0x48')]=qs[_0x5555('0x40')](_['pick'](_0x29d427[_0x5555('0x3e')],_0x5adb6f['filters']));if(_0x29d427[_0x5555('0x3e')][_0x5555('0x30')]){_0x2c985e[_0x5555('0x48')]=_['merge'](_0x2c985e[_0x5555('0x48')],{'$or':_['map'](_0x2c985e[_0x5555('0x42')],function(_0xc93457){var _0x5914c6={};_0x5914c6[_0xc93457]={'$like':'%'+_0x29d427[_0x5555('0x3e')][_0x5555('0x30')]+'%'};return _0x5914c6;})});}_0x2c985e=_['merge']({},_0x2c985e,_0x29d427[_0x5555('0x4b')]);return _0x59e817[_0x5555('0x6c')](_0x2c985e);}})[_0x5555('0x29')](function(_0x5dab42){if(_0x5dab42){_0x225c06=_0x5dab42[_0x5555('0x45')];if(!_0x29d427[_0x5555('0x3e')][_0x5555('0x62')](_0x5555('0x46'))){_0x2c985e['limit']=qs[_0x5555('0x21')](_0x29d427[_0x5555('0x3e')]['limit']);_0x2c985e['offset']=qs['offset'](_0x29d427['query']['offset']);}return _0x59e817[_0x5555('0x6c')](_0x2c985e);}})[_0x5555('0x29')](function(_0xf8973c){if(_0xf8973c){return _0xf8973c?{'count':_0x225c06,'rows':_0xf8973c}:null;}})[_0x5555('0x29')](respondWithResult(_0x34d3e8,null))[_0x5555('0x51')](handleError(_0x34d3e8,null));};exports[_0x5555('0x6d')]=function(_0xde3f62,_0x3c7d84,_0x4593a1){var _0x136ccb=_0xde3f62[_0x5555('0x55')]['teams'];var _0x4baba8=_['map'](_0x136ccb,'id');return db[_0x5555('0x6e')]['findAll']({'where':{'id':_0x4baba8},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5555('0x6f'),'attributes':['id',_0x5555('0x35'),_0x5555('0x70'),'voicePause',_0x5555('0x71')],'raw':!![]}]})[_0x5555('0x29')](function(_0x26246c){if(_0x26246c){var _0xd1601b=_['flatMap'](_0x26246c,function(_0x51394e){var _0x50056f=_0x51394e['get']({'plain':!![]});_0x50056f[_0x5555('0x6f')]['forEach'](function(_0xa6eb32){_0xa6eb32[_0x5555('0x72')]=_['find'](_0x136ccb,{'id':_0x50056f['id']})[_0x5555('0x72')];});return _0x50056f[_0x5555('0x6f')];});return db[_0x5555('0x4c')]['find']({'where':{'id':_0xde3f62['params']['id']}})['then'](function(_0x489b77){return db[_0x5555('0x73')]['transaction'](function(_0x8e407){return _0x489b77[_0x5555('0x6d')](_0x4baba8,{'transaction':_0x8e407})['then'](function(){return BPromise['each'](_0x136ccb,function(_0x26a31d){return db[_0x5555('0x74')][_0x5555('0x75')]({'TeamId':_0x26a31d['id'],'VoiceQueueId':_0xde3f62[_0x5555('0x52')]['id'],'penalty':_0x26a31d[_0x5555('0x72')]},{'transaction':_0x8e407});});})[_0x5555('0x29')](function(){return BPromise[_0x5555('0x76')](_0xd1601b,function(_0x4460c2){return db[_0x5555('0x77')][_0x5555('0x78')]({'where':{'UserId':_0x4460c2['id'],'VoiceQueueId':_0xde3f62['params']['id']},'defaults':{'penalty':_0x4460c2[_0x5555('0x72')]},'transaction':_0x8e407});});})[_0x5555('0x29')](function(){return BPromise[_0x5555('0x76')](_['filter'](_0xd1601b,{'online':!![]}),function(_0x8a4f9a){return db[_0x5555('0x79')]['upsert']({'membername':_0x8a4f9a[_0x5555('0x35')],'UserId':_0x8a4f9a['id'],'queue_name':_0x489b77[_0x5555('0x35')],'VoiceQueueId':_0x489b77['id'],'interface':_[_0x5555('0x7a')](_0x8a4f9a[_0x5555('0x71')])?util[_0x5555('0x7b')](_0x5555('0x7c'),_0x8a4f9a['name']):_0x8a4f9a[_0x5555('0x71')],'paused':_0x8a4f9a[_0x5555('0x7d')]||![],'penalty':_0x8a4f9a[_0x5555('0x72')]},{'transaction':_0x8e407});});})[_0x5555('0x29')](function(){_0xd1601b[_0x5555('0x7e')](function(_0x4f35bd){socket['emit'](_0x5555('0x7f'),{'UserId':_0x4f35bd['id'],'VoiceQueueId':_0x489b77['id']});});});});});}})[_0x5555('0x29')](respondWithStatusCode(_0x3c7d84,null))['catch'](handleError(_0x3c7d84,null));};exports[_0x5555('0x80')]=function(_0x346d31,_0x127a8b,_0x410679){return db['Team'][_0x5555('0x4f')]({'where':{'id':_0x346d31[_0x5555('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5555('0x81')],'as':_0x5555('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x5555('0x29')](handleEntityNotFound(_0x127a8b,null))[_0x5555('0x29')](function(_0x295a33){var _0x50235d=_[_0x5555('0x3b')](_0x295a33,'id');var _0x2d3486=[];var _0xca2882=[];var _0x4f93b7=squel['select']();_0x4f93b7[_0x5555('0x82')](_0x5555('0x83'))['from'](_0x5555('0x84'),'tq')['join'](_0x5555('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5555('0x48')](_0x5555('0x86'),_0x346d31[_0x5555('0x52')]['id']);for(var _0x35a39f=0x0;_0x35a39f<_0x295a33[_0x5555('0x45')];_0x35a39f+=0x1){let _0x436167=_0x295a33[_0x35a39f];for(var _0x4c2fe7=0x0;_0x4c2fe7<_0x436167[_0x5555('0x6f')][_0x5555('0x45')];_0x4c2fe7+=0x1){let _0x25e466=_0x436167[_0x5555('0x6f')][_0x4c2fe7];var _0x33db12=_0x4f93b7[_0x5555('0x87')]();_0x33db12[_0x5555('0x48')]('ut.UserId\x20=\x20?',_0x25e466['id']);_0xca2882[_0x5555('0x88')](db['sequelize']['query'](_0x33db12['toString'](),{'type':db['sequelize']['QueryTypes'][_0x5555('0x89')]})[_0x5555('0x29')](function(_0x51fcd0){if(_0x51fcd0[_0x5555('0x45')]===0x1){return _0x25e466['id'];}else{var _0x56f418=_['every'](_[_0x5555('0x3b')](_0x51fcd0,'TeamId'),function(_0x395124){return _['includes'](_0x50235d,_0x395124);});if(_0x56f418){return _0x25e466['id'];}}}));}}return BPromise['all'](_0xca2882)[_0x5555('0x29')](function(_0x316837){_0x2d3486=_(_0x2d3486)['union'](_0x316837)['compact']()[_0x5555('0x32')]();return db[_0x5555('0x4c')][_0x5555('0x53')]({'where':{'id':_0x346d31['params']['id']}})[_0x5555('0x29')](function(_0x4ed6e3){return db[_0x5555('0x73')]['transaction'](function(_0x51fbb3){return _0x4ed6e3[_0x5555('0x80')](_0x346d31[_0x5555('0x3e')][_0x5555('0x8a')],{'transaction':_0x51fbb3})['then'](function(){if(!_[_0x5555('0x8b')](_0x2d3486)){return _0x4ed6e3['removeAgents'](_0x2d3486,{'transaction':_0x51fbb3})[_0x5555('0x29')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x346d31[_0x5555('0x52')]['id'],'UserId':_0x2d3486},'transaction':_0x51fbb3});});}})[_0x5555('0x29')](function(){_0x2d3486[_0x5555('0x7e')](function(_0x5df029){socket[_0x5555('0x8c')](_0x5555('0x8d'),{'UserId':_0x5df029,'VoiceQueueId':_0x4ed6e3['id']});});});});});});})[_0x5555('0x29')](respondWithStatusCode(_0x127a8b,null))[_0x5555('0x51')](handleError(_0x127a8b,null));};exports[_0x5555('0x8e')]=function(_0x2d4829,_0x5ea459,_0x5b815f){var _0x2278a5,_0x4d1638;return db['VoiceQueue'][_0x5555('0x53')]({'where':{'id':_0x2d4829[_0x5555('0x52')]['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x5ea459,null))[_0x5555('0x29')](function(_0x8933b9){if(_0x8933b9){_0x4d1638=_0x8933b9;return _0x8933b9[_0x5555('0x8e')](_0x2d4829[_0x5555('0x55')]['ids'],_[_0x5555('0x5c')](_0x2d4829['body'],[_0x5555('0x8a'),'id'])||{})[_0x5555('0x8f')](function(_0x5cca29){for(var _0x3c93f1=0x0;_0x3c93f1<_0x2d4829[_0x5555('0x55')]['ids'][_0x5555('0x45')];_0x3c93f1+=0x1){socket['emit'](_0x5555('0x7f'),{'UserId':Number(_0x2d4829[_0x5555('0x55')]['ids'][_0x3c93f1]),'VoiceQueueId':Number(_0x2d4829[_0x5555('0x52')]['id'])});}return _0x5cca29;});}})[_0x5555('0x29')](function(_0x1611d0){_0x2278a5=_0x1611d0||[];if(_0x4d1638){return db['User'][_0x5555('0x4f')]({'where':{'id':_0x2d4829[_0x5555('0x55')][_0x5555('0x8a')]},'attributes':['id',_0x5555('0x35'),_0x5555('0x70'),_0x5555('0x7d'),_0x5555('0x71')],'raw':!![]});}})[_0x5555('0x29')](function(_0x54222c){if(!_[_0x5555('0x8b')](_0x54222c)){var _0x3d063a=[];for(var _0xf7cdd3=0x0;_0xf7cdd3<_0x54222c[_0x5555('0x45')];_0xf7cdd3++){if(_0x54222c[_0xf7cdd3][_0x5555('0x70')]){_0x3d063a[_0x5555('0x88')](db[_0x5555('0x79')][_0x5555('0x75')]({'membername':_0x54222c[_0xf7cdd3]['name'],'UserId':_0x54222c[_0xf7cdd3]['id'],'queue_name':_0x4d1638['name'],'VoiceQueueId':_0x4d1638['id'],'interface':_['isNil'](_0x54222c[_0xf7cdd3]['interface'])?util['format'](_0x5555('0x7c'),_0x54222c[_0xf7cdd3][_0x5555('0x35')]):_0x54222c[_0xf7cdd3][_0x5555('0x71')],'paused':_0x54222c[_0xf7cdd3][_0x5555('0x7d')]||![],'penalty':_0x2d4829[_0x5555('0x55')][_0x5555('0x72')]||0x0}));}}return BPromise[_0x5555('0x90')](_0x3d063a);}})['then'](function(){return _0x2278a5;})[_0x5555('0x29')](respondWithResult(_0x5ea459,null))[_0x5555('0x51')](handleError(_0x5ea459,null));};exports[_0x5555('0x91')]=function(_0xa37ed,_0x48e102,_0x2793c4){return db['VoiceQueue'][_0x5555('0x53')]({'where':{'id':_0xa37ed[_0x5555('0x52')]['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x48e102,null))[_0x5555('0x29')](function(_0x1313dd){if(_0x1313dd){return _0x1313dd['removeAgents'](_0xa37ed[_0x5555('0x3e')][_0x5555('0x8a')])[_0x5555('0x29')](function(){if(_[_0x5555('0x92')](_0xa37ed[_0x5555('0x3e')][_0x5555('0x8a')])){for(var _0x442d01=0x0;_0x442d01<_0xa37ed['query']['ids'][_0x5555('0x45')];_0x442d01+=0x1){socket[_0x5555('0x8c')](_0x5555('0x8d'),{'UserId':Number(_0xa37ed[_0x5555('0x3e')]['ids'][_0x442d01]),'VoiceQueueId':Number(_0xa37ed[_0x5555('0x52')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0xa37ed[_0x5555('0x3e')][_0x5555('0x8a')]),'VoiceQueueId':Number(_0xa37ed['params']['id'])});}});}})[_0x5555('0x29')](function(_0x5daf0a){return db[_0x5555('0x79')][_0x5555('0x2a')]({'where':{'VoiceQueueId':_0xa37ed[_0x5555('0x52')]['id'],'UserId':_0xa37ed[_0x5555('0x3e')][_0x5555('0x8a')]}})['then'](function(){return _0x5daf0a;});})[_0x5555('0x29')](respondWithStatusCode(_0x48e102,null))[_0x5555('0x51')](handleError(_0x48e102,null));};exports[_0x5555('0x93')]=function(_0x35b368,_0x243c1f,_0x4fd971){var _0x5594f7={};var _0x1f8613={};var _0x503787;var _0x27847f;return db[_0x5555('0x4c')][_0x5555('0x61')]({'where':{'id':_0x35b368[_0x5555('0x52')]['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x243c1f,null))[_0x5555('0x29')](function(_0x218d3b){if(_0x218d3b){_0x503787=_0x218d3b;_0x1f8613[_0x5555('0x43')]=_[_0x5555('0x3f')](db[_0x5555('0x81')]['rawAttributes']);_0x1f8613[_0x5555('0x3e')]=_[_0x5555('0x3f')](_0x35b368[_0x5555('0x3e')]);_0x1f8613['filters']=_[_0x5555('0x41')](_0x1f8613['model'],_0x1f8613[_0x5555('0x3e')]);_0x5594f7[_0x5555('0x42')]=_[_0x5555('0x41')](_0x1f8613[_0x5555('0x43')],qs[_0x5555('0x44')](_0x35b368['query'][_0x5555('0x44')]));_0x5594f7[_0x5555('0x42')]=_0x5594f7[_0x5555('0x42')][_0x5555('0x45')]?_0x5594f7['attributes']:_0x1f8613[_0x5555('0x43')];_0x5594f7[_0x5555('0x63')]=qs['sort'](_0x35b368['query'][_0x5555('0x47')]);_0x5594f7[_0x5555('0x48')]=qs['filters'](_[_0x5555('0x64')](_0x35b368[_0x5555('0x3e')],_0x1f8613[_0x5555('0x40')]));if(_0x35b368[_0x5555('0x3e')][_0x5555('0x30')]){_0x5594f7[_0x5555('0x48')]=_['merge'](_0x5594f7[_0x5555('0x48')],{'$or':_[_0x5555('0x3b')](_0x5594f7[_0x5555('0x42')],function(_0x59b029){var _0x50fa64={};_0x50fa64[_0x59b029]={'$like':'%'+_0x35b368[_0x5555('0x3e')]['filter']+'%'};return _0x50fa64;})});}_0x5594f7=_['merge']({},_0x5594f7,_0x35b368[_0x5555('0x4b')]);return _0x503787[_0x5555('0x93')](_0x5594f7);}})[_0x5555('0x29')](function(_0x4bf8e4){if(_0x4bf8e4){_0x27847f=_0x4bf8e4[_0x5555('0x45')];if(!_0x35b368[_0x5555('0x3e')][_0x5555('0x62')](_0x5555('0x46'))){_0x5594f7[_0x5555('0x21')]=qs[_0x5555('0x21')](_0x35b368[_0x5555('0x3e')]['limit']);_0x5594f7[_0x5555('0x1f')]=qs[_0x5555('0x1f')](_0x35b368['query']['offset']);}return _0x503787['getAgents'](_0x5594f7);}})['then'](function(_0x2054b5){if(_0x2054b5){return _0x2054b5?{'count':_0x27847f,'rows':_0x2054b5}:null;}})[_0x5555('0x29')](respondWithResult(_0x243c1f,null))[_0x5555('0x51')](handleError(_0x243c1f,null));};exports[_0x5555('0x94')]=function(_0x39ec9d,_0x4965e6,_0x2a6dc4){var _0x58ccd4={};var _0x1103da={};var _0x52cee9;var _0x160ea7;return db[_0x5555('0x4c')][_0x5555('0x61')]({'where':{'id':_0x39ec9d['params']['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x4965e6,null))['then'](function(_0x2dd376){if(_0x2dd376){_0x52cee9=_0x2dd376;_0x1103da[_0x5555('0x43')]=_[_0x5555('0x3f')](db['UserVoiceQueueRt'][_0x5555('0x3c')]);_0x1103da[_0x5555('0x3e')]=_['keys'](_0x39ec9d[_0x5555('0x3e')]);_0x1103da[_0x5555('0x40')]=_[_0x5555('0x41')](_0x1103da[_0x5555('0x43')],_0x1103da['query']);_0x58ccd4[_0x5555('0x42')]=_['intersection'](_0x1103da[_0x5555('0x43')],qs[_0x5555('0x44')](_0x39ec9d[_0x5555('0x3e')][_0x5555('0x44')]));_0x58ccd4[_0x5555('0x42')]=_0x58ccd4['attributes'][_0x5555('0x45')]?_0x58ccd4[_0x5555('0x42')]:_0x1103da[_0x5555('0x43')];_0x58ccd4[_0x5555('0x63')]=qs[_0x5555('0x47')](_0x39ec9d[_0x5555('0x3e')][_0x5555('0x47')]);_0x58ccd4[_0x5555('0x48')]=qs['filters'](_[_0x5555('0x64')](_0x39ec9d[_0x5555('0x3e')],_0x1103da[_0x5555('0x40')]));if(_0x39ec9d['query'][_0x5555('0x30')]){_0x58ccd4[_0x5555('0x48')]=_[_0x5555('0x4a')](_0x58ccd4[_0x5555('0x48')],{'$or':_['map'](_0x58ccd4[_0x5555('0x42')],function(_0x57d382){var _0x2fb232={};_0x2fb232[_0x57d382]={'$like':'%'+_0x39ec9d[_0x5555('0x3e')][_0x5555('0x30')]+'%'};return _0x2fb232;})});}_0x58ccd4=_[_0x5555('0x4a')]({},_0x58ccd4,_0x39ec9d['options']);return _0x52cee9[_0x5555('0x94')](_0x58ccd4);}})['then'](function(_0x1df446){if(_0x1df446){_0x160ea7=_0x1df446[_0x5555('0x45')];if(!_0x39ec9d['query'][_0x5555('0x62')](_0x5555('0x46'))){_0x58ccd4[_0x5555('0x21')]=qs[_0x5555('0x21')](_0x39ec9d['query']['limit']);_0x58ccd4[_0x5555('0x1f')]=qs[_0x5555('0x1f')](_0x39ec9d['query'][_0x5555('0x1f')]);}return _0x52cee9[_0x5555('0x94')](_0x58ccd4);}})[_0x5555('0x29')](function(_0x1a43ce){return _0x1a43ce?{'count':_0x160ea7,'rows':_0x1a43ce}:null;})['then'](respondWithResult(_0x4965e6,null))['catch'](handleError(_0x4965e6,null));};exports[_0x5555('0x95')]=function(_0x28dbde,_0x89aad4,_0x34f6ec){var _0x3213fb={};var _0x14b493={};var _0x441148;var _0xe8913f;return db[_0x5555('0x4c')][_0x5555('0x61')]({'where':{'id':_0x28dbde[_0x5555('0x52')]['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x89aad4,null))['then'](function(_0x41275f){if(_0x41275f){_0x441148=_0x41275f;_0x14b493['model']=_[_0x5555('0x3f')](db[_0x5555('0x96')][_0x5555('0x3c')]);_0x14b493[_0x5555('0x3e')]=_[_0x5555('0x3f')](_0x28dbde[_0x5555('0x3e')]);_0x14b493[_0x5555('0x40')]=_[_0x5555('0x41')](_0x14b493['model'],_0x14b493[_0x5555('0x3e')]);_0x3213fb[_0x5555('0x42')]=_[_0x5555('0x41')](_0x14b493[_0x5555('0x43')],qs[_0x5555('0x44')](_0x28dbde[_0x5555('0x3e')][_0x5555('0x44')]));_0x3213fb['attributes']=_0x3213fb[_0x5555('0x42')][_0x5555('0x45')]?_0x3213fb[_0x5555('0x42')]:_0x14b493['model'];_0x3213fb[_0x5555('0x63')]=qs['sort'](_0x28dbde['query']['sort']);_0x3213fb[_0x5555('0x48')]=qs[_0x5555('0x40')](_[_0x5555('0x64')](_0x28dbde['query'],_0x14b493['filters']));if(_0x28dbde[_0x5555('0x3e')][_0x5555('0x30')]){_0x3213fb[_0x5555('0x48')]=_[_0x5555('0x4a')](_0x3213fb[_0x5555('0x48')],{'$or':_[_0x5555('0x3b')](_0x3213fb['attributes'],function(_0x21b293){var _0x3d45ff={};_0x3d45ff[_0x21b293]={'$like':'%'+_0x28dbde[_0x5555('0x3e')][_0x5555('0x30')]+'%'};return _0x3d45ff;})});}_0x3213fb=_['merge']({},_0x3213fb,_0x28dbde[_0x5555('0x4b')]);return _0x441148[_0x5555('0x95')](_0x3213fb);}})[_0x5555('0x29')](function(_0x47fa87){if(_0x47fa87){_0xe8913f=_0x47fa87[_0x5555('0x45')];if(!_0x28dbde['query'][_0x5555('0x62')](_0x5555('0x46'))){_0x3213fb[_0x5555('0x21')]=qs['limit'](_0x28dbde['query'][_0x5555('0x21')]);_0x3213fb[_0x5555('0x1f')]=qs[_0x5555('0x1f')](_0x28dbde[_0x5555('0x3e')]['offset']);}return _0x441148[_0x5555('0x95')](_0x3213fb);}})[_0x5555('0x29')](function(_0x5e270f){if(_0x5e270f){return _0x5e270f?{'count':_0xe8913f,'rows':_0x5e270f}:null;}})[_0x5555('0x29')](respondWithResult(_0x89aad4,null))[_0x5555('0x51')](handleError(_0x89aad4,null));};exports[_0x5555('0x97')]=function(_0x395a72,_0x11f8f6,_0x4c8db8){var _0x355110,_0xf6aa07;return db['VoiceQueue'][_0x5555('0x53')]({'where':{'id':_0x395a72[_0x5555('0x52')]['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x11f8f6,null))[_0x5555('0x29')](function(_0x477994){if(_0x477994){_0xf6aa07=_0x477994;return _0x477994[_0x5555('0x97')](_0x395a72[_0x5555('0x55')][_0x5555('0x8a')],_[_0x5555('0x5c')](_0x395a72[_0x5555('0x55')],[_0x5555('0x8a'),'id'])||{});}return null;})[_0x5555('0x8f')](function(_0x4f4304){var _0x52544c;_0x355110=_0x4f4304||[];var _0x2386d2=[];if(_0x4f4304){for(var _0x3dd796=0x0;_0x3dd796<_0x4f4304[_0x5555('0x45')];_0x3dd796+=0x1){var _0x593973=_0x4f4304[_0x3dd796][_0x5555('0x2b')]({'plain':!![]});_0xf6aa07[_0x5555('0x98')]=_0x395a72[_0x5555('0x55')][_0x5555('0x98')]?_0x395a72[_0x5555('0x55')][_0x5555('0x98')]:_0xf6aa07['dialCheckDuplicateType'];switch(_0xf6aa07[_0x5555('0x98')]){case _0x5555('0x99'):_0x52544c=squel[_0x5555('0x9a')]()[_0x5555('0x9b')]('cm_hopper')[_0x5555('0x9c')](['phone',_0x5555('0x9d'),'ContactId',_0x5555('0x9e'),_0x5555('0x65'),_0x5555('0x5d'),_0x5555('0x5e')],squel[_0x5555('0x9f')]()[_0x5555('0x82')]('phone',_0x5555('0xa0'))[_0x5555('0x82')](_0x5555('0xa1'),_0x5555('0x9d'))[_0x5555('0x82')]('id',_0x5555('0xa2'))[_0x5555('0x82')](_0x593973['CmListId'][_0x5555('0xa3')](),'ListId')['field'](_0x395a72[_0x5555('0x52')]['id'][_0x5555('0xa3')](),_0x5555('0x65'))['field'](_0x5555('0xa1'),_0x5555('0x5d'))[_0x5555('0x82')](_0x5555('0xa1'),_0x5555('0x5e'))['from'](_0x5555('0xa4'))[_0x5555('0x48')](_0x5555('0xa5'))['where'](_0x5555('0xa6'),_0x593973[_0x5555('0xa7')][_0x5555('0xa3')]())[_0x5555('0x48')](_0x5555('0xa8'))[_0x5555('0x48')](_0x5555('0xa9'),squel['select']()[_0x5555('0x82')](_0x5555('0xaa'))[_0x5555('0xab')](_0x5555('0xac'))[_0x5555('0x48')](_0x5555('0x86'),_0x395a72[_0x5555('0x52')]['id'][_0x5555('0xa3')]()))[_0x5555('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5555('0x9f')]()[_0x5555('0x82')]('COALESCE(phone,\x27\x27)')[_0x5555('0xab')]('cm_hopper')['where'](_0x5555('0x86'),_0x395a72['params']['id'][_0x5555('0xa3')]())))[_0x5555('0xa3')]();break;case'onlyIfOpen':_0x52544c=squel[_0x5555('0x9a')]()[_0x5555('0x9b')](_0x5555('0xad'))['fromQuery']([_0x5555('0xa0'),_0x5555('0x9d'),'ContactId',_0x5555('0x9e'),_0x5555('0x65'),'createdAt','updatedAt'],squel[_0x5555('0x9f')]()[_0x5555('0x82')](_0x5555('0xa0'),_0x5555('0xa0'))[_0x5555('0x82')](_0x5555('0xa1'),_0x5555('0x9d'))[_0x5555('0x82')]('id',_0x5555('0xa2'))[_0x5555('0x82')](_0x593973[_0x5555('0xa7')][_0x5555('0xa3')](),_0x5555('0x9e'))[_0x5555('0x82')](_0x395a72[_0x5555('0x52')]['id'][_0x5555('0xa3')](),'VoiceQueueId')[_0x5555('0x82')]('NOW()','createdAt')['field'](_0x5555('0xa1'),'updatedAt')['from'](_0x5555('0xa4'))['where'](_0x5555('0xa5'))[_0x5555('0x48')](_0x5555('0xa6'),_0x593973[_0x5555('0xa7')]['toString']())[_0x5555('0x48')](_0x5555('0xa8'))[_0x5555('0x48')](_0x5555('0xa9'),squel[_0x5555('0x9f')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x5555('0xad'))['where'](_0x5555('0x86'),_0x395a72['params']['id'][_0x5555('0xa3')]())))[_0x5555('0xa3')]();break;default:_0x52544c=squel[_0x5555('0x9a')]()['into'](_0x5555('0xad'))[_0x5555('0x9c')](['phone',_0x5555('0x9d'),_0x5555('0xa2'),_0x5555('0x9e'),_0x5555('0x65'),'createdAt',_0x5555('0x5e')],squel['select']()[_0x5555('0x82')](_0x5555('0xa0'),_0x5555('0xa0'))[_0x5555('0x82')](_0x5555('0xa1'),_0x5555('0x9d'))[_0x5555('0x82')]('id','ContactId')[_0x5555('0x82')](_0x593973[_0x5555('0xa7')][_0x5555('0xa3')](),'ListId')[_0x5555('0x82')](_0x395a72[_0x5555('0x52')]['id'][_0x5555('0xa3')](),'VoiceQueueId')[_0x5555('0x82')](_0x5555('0xa1'),_0x5555('0x5d'))[_0x5555('0x82')](_0x5555('0xa1'),'updatedAt')['from'](_0x5555('0xa4'))['where'](_0x5555('0xa5'))[_0x5555('0x48')]('ListId\x20=\x20?',_0x593973['CmListId']['toString']())['where'](_0x5555('0xa8')))[_0x5555('0xa3')]();}_0x2386d2[_0x5555('0x88')](db[_0x5555('0x73')][_0x5555('0x3e')](_0x52544c));}return BPromise[_0x5555('0x90')](_0x2386d2);}})[_0x5555('0x29')](function(){return _0x355110;})['then'](respondWithResult(_0x11f8f6,null))[_0x5555('0x51')](handleError(_0x11f8f6,null));};exports[_0x5555('0xae')]=function(_0x22f6f1,_0x563396,_0x2c8adb){return db['VoiceQueue'][_0x5555('0x53')]({'where':{'id':_0x22f6f1[_0x5555('0x52')]['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x563396,null))[_0x5555('0x29')](function(_0xf4228c){if(_0xf4228c){return _0xf4228c[_0x5555('0xae')](_0x22f6f1['query'][_0x5555('0x8a')]);}})[_0x5555('0x29')](function(_0x1b0ace){if(_0x1b0ace){return db['CmHopper'][_0x5555('0x2a')]({'where':{'ListId':_0x22f6f1[_0x5555('0x3e')][_0x5555('0x8a')],'VoiceQueueId':_0x22f6f1[_0x5555('0x52')]['id']}})[_0x5555('0x29')](function(){return _0x1b0ace;});}})[_0x5555('0x29')](respondWithStatusCode(_0x563396,null))[_0x5555('0x51')](handleError(_0x563396,null));};exports['getBlackLists']=function(_0xbbec23,_0x57911a,_0xa57fb1){var _0x1f0958={};var _0x45ca08={};var _0x1cb9bc;var _0x5c75e8;return db[_0x5555('0x4c')][_0x5555('0x61')]({'where':{'id':_0xbbec23['params']['id']}})['then'](handleEntityNotFound(_0x57911a,null))[_0x5555('0x29')](function(_0x1a2750){if(_0x1a2750){_0x1cb9bc=_0x1a2750;_0x45ca08[_0x5555('0x43')]=_['keys'](db['CmList'][_0x5555('0x3c')]);_0x45ca08[_0x5555('0x3e')]=_[_0x5555('0x3f')](_0xbbec23[_0x5555('0x3e')]);_0x45ca08[_0x5555('0x40')]=_[_0x5555('0x41')](_0x45ca08[_0x5555('0x43')],_0x45ca08[_0x5555('0x3e')]);_0x1f0958[_0x5555('0x42')]=_['intersection'](_0x45ca08['model'],qs[_0x5555('0x44')](_0xbbec23['query']['fields']));_0x1f0958['attributes']=_0x1f0958['attributes']['length']?_0x1f0958[_0x5555('0x42')]:_0x45ca08[_0x5555('0x43')];_0x1f0958[_0x5555('0x63')]=qs[_0x5555('0x47')](_0xbbec23[_0x5555('0x3e')][_0x5555('0x47')]);_0x1f0958[_0x5555('0x48')]=qs['filters'](_[_0x5555('0x64')](_0xbbec23[_0x5555('0x3e')],_0x45ca08[_0x5555('0x40')]));if(_0xbbec23[_0x5555('0x3e')]['filter']){_0x1f0958[_0x5555('0x48')]=_[_0x5555('0x4a')](_0x1f0958[_0x5555('0x48')],{'$or':_[_0x5555('0x3b')](_0x1f0958['attributes'],function(_0x4a7e5f){var _0x3ee099={};_0x3ee099[_0x4a7e5f]={'$like':'%'+_0xbbec23[_0x5555('0x3e')][_0x5555('0x30')]+'%'};return _0x3ee099;})});}_0x1f0958=_[_0x5555('0x4a')]({},_0x1f0958,_0xbbec23[_0x5555('0x4b')]);return _0x1cb9bc['getBlackLists'](_0x1f0958);}})[_0x5555('0x29')](function(_0x4112f9){if(_0x4112f9){_0x5c75e8=_0x4112f9['length'];if(!_0xbbec23['query']['hasOwnProperty'](_0x5555('0x46'))){_0x1f0958['limit']=qs[_0x5555('0x21')](_0xbbec23[_0x5555('0x3e')][_0x5555('0x21')]);_0x1f0958[_0x5555('0x1f')]=qs[_0x5555('0x1f')](_0xbbec23['query'][_0x5555('0x1f')]);}return _0x1cb9bc[_0x5555('0xaf')](_0x1f0958);}})[_0x5555('0x29')](function(_0x5c04d0){if(_0x5c04d0){return _0x5c04d0?{'count':_0x5c75e8,'rows':_0x5c04d0}:null;}})['then'](respondWithResult(_0x57911a,null))[_0x5555('0x51')](handleError(_0x57911a,null));};exports['addBlackLists']=function(_0x23a179,_0x4180f9,_0x471560){var _0x1215c2,_0xe6d46d;return db[_0x5555('0x4c')][_0x5555('0x53')]({'where':{'id':_0x23a179[_0x5555('0x52')]['id']}})['then'](handleEntityNotFound(_0x4180f9,null))[_0x5555('0x29')](function(_0x1bfcdb){if(_0x1bfcdb){_0xe6d46d=_0x1bfcdb;return _0x1bfcdb[_0x5555('0xb0')](_0x23a179[_0x5555('0x55')][_0x5555('0x8a')],_[_0x5555('0x5c')](_0x23a179['body'],[_0x5555('0x8a'),'id'])||{});}return null;})[_0x5555('0x8f')](function(_0x56dab0){var _0x586e2d;_0x1215c2=_0x56dab0||[];var _0x2679d0=[];if(_0x56dab0){for(var _0x5a6821=0x0;_0x5a6821<_0x56dab0[_0x5555('0x45')];_0x5a6821+=0x1){var _0x4b13b3=_0x56dab0[_0x5a6821][_0x5555('0x2b')]({'plain':!![]});_0x586e2d=squel[_0x5555('0x9a')]()['into'](_0x5555('0xb1'))['fromQuery']([_0x5555('0xa0'),_0x5555('0xa2'),_0x5555('0x9e'),'VoiceQueueId',_0x5555('0x5d'),'updatedAt'],squel[_0x5555('0x9f')]()[_0x5555('0x82')](_0x5555('0xa0'),_0x5555('0xa0'))[_0x5555('0x82')]('id',_0x5555('0xa2'))[_0x5555('0x82')](_0x4b13b3[_0x5555('0xa7')][_0x5555('0xa3')](),_0x5555('0x9e'))[_0x5555('0x82')](_0x23a179[_0x5555('0x52')]['id'][_0x5555('0xa3')](),_0x5555('0x65'))[_0x5555('0x82')](_0x5555('0xa1'),_0x5555('0x5d'))[_0x5555('0x82')]('NOW()','updatedAt')['from'](_0x5555('0xa4'))[_0x5555('0x48')](_0x5555('0xa5'))[_0x5555('0x48')](_0x5555('0xa6'),_0x4b13b3['CmListId'][_0x5555('0xa3')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5555('0xa3')]();_0x2679d0['push'](db[_0x5555('0x73')]['query'](_0x586e2d));}return BPromise[_0x5555('0x90')](_0x2679d0);}})['then'](function(){return _0x1215c2;})[_0x5555('0x29')](respondWithResult(_0x4180f9,null))[_0x5555('0x51')](handleError(_0x4180f9,null));};exports[_0x5555('0xb2')]=function(_0x47e2da,_0x356eda,_0x51cc99){return db[_0x5555('0x4c')][_0x5555('0x53')]({'where':{'id':_0x47e2da[_0x5555('0x52')]['id']}})[_0x5555('0x29')](handleEntityNotFound(_0x356eda,null))[_0x5555('0x29')](function(_0x1c1c3d){if(_0x1c1c3d){return _0x1c1c3d[_0x5555('0xb2')](_0x47e2da[_0x5555('0x3e')]['ids']);}})[_0x5555('0x29')](function(_0x18847f){if(_0x18847f){return db[_0x5555('0x6b')][_0x5555('0x2a')]({'where':{'ListId':_0x47e2da[_0x5555('0x3e')][_0x5555('0x8a')],'VoiceQueueId':_0x47e2da[_0x5555('0x52')]['id']}})[_0x5555('0x29')](function(){return _0x18847f;});}})['then'](respondWithStatusCode(_0x356eda,null))[_0x5555('0x51')](handleError(_0x356eda,null));};
\ No newline at end of file
+var _0xfce4=['limit','count','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','find','UserProfileResource','error','stack','name','send','index','map','VoiceQueue','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','autoAssociation','getHoppers','findOne','nolimit','VoiceQueueId','CmHopper','findAll','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','teams','Team','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueueRt','format','SIP/%s','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','transaction','ids','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','userVoiceQueue:save','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','VoiceQueueId\x20=\x20?','onlyIfOpen','getBlackLists','addBlackLists','cm_hopper_black','rimraf','zip-dir','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined'];(function(_0x5a9a25,_0x5b7765){var _0x29dcb3=function(_0x383933){while(--_0x383933){_0x5a9a25['push'](_0x5a9a25['shift']());}};_0x29dcb3(++_0x5b7765);}(_0xfce4,0x14d));var _0x4fce=function(_0x22a91c,_0x5ce13f){_0x22a91c=_0x22a91c-0x0;var _0x733c2f=_0xfce4[_0x22a91c];return _0x733c2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4fce('0x0'));var zipdir=require(_0x4fce('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4fce('0x2'));var BPromise=require(_0x4fce('0x3'));var Mustache=require(_0x4fce('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4fce('0x5'));var ejs=require(_0x4fce('0x6'));var fs=require('fs');var fs_extra=require(_0x4fce('0x7'));var _=require(_0x4fce('0x8'));var squel=require('squel');var crypto=require(_0x4fce('0x9'));var jsforce=require(_0x4fce('0xa'));var deskjs=require(_0x4fce('0xb'));var toCsv=require(_0x4fce('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4fce('0xc'));var authService=require(_0x4fce('0xd'));var qs=require(_0x4fce('0xe'));var as=require(_0x4fce('0xf'));var hardwareService=require(_0x4fce('0x10'));var logger=require(_0x4fce('0x11'))(_0x4fce('0x12'));var utils=require(_0x4fce('0x13'));var config=require(_0x4fce('0x14'));var licenseUtil=require(_0x4fce('0x15'));var db=require(_0x4fce('0x16'))['db'];config['redis']=_[_0x4fce('0x17')](config[_0x4fce('0x18')],{'host':_0x4fce('0x19'),'port':0x18eb});var socket=require(_0x4fce('0x1a'))(new Redis(config[_0x4fce('0x18')]));require(_0x4fce('0x1b'))[_0x4fce('0x1c')](socket);function respondWithStatusCode(_0x4436d2,_0x40331e){_0x40331e=_0x40331e||0xcc;return function(_0x23c21c){if(_0x23c21c){return _0x4436d2[_0x4fce('0x1d')](_0x40331e);}return _0x4436d2[_0x4fce('0x1e')](_0x40331e)[_0x4fce('0x1f')]();};}function respondWithResult(_0x122e49,_0x1208e5){_0x1208e5=_0x1208e5||0xc8;return function(_0x2faf99){if(_0x2faf99){return _0x122e49[_0x4fce('0x1e')](_0x1208e5)[_0x4fce('0x20')](_0x2faf99);}};}function respondWithFilteredResult(_0x287ccd,_0x19003e){return function(_0x5323da){if(_0x5323da){var _0x4a036c=typeof _0x19003e[_0x4fce('0x21')]===_0x4fce('0x22')&&typeof _0x19003e[_0x4fce('0x23')]===_0x4fce('0x22');var _0x56e864=_0x5323da[_0x4fce('0x24')];var _0x33c4b0=_0x4a036c?0x0:_0x19003e[_0x4fce('0x21')];var _0x2760d0=_0x4a036c?_0x5323da[_0x4fce('0x24')]:_0x19003e[_0x4fce('0x21')]+_0x19003e[_0x4fce('0x23')];var _0x154094;if(_0x2760d0>=_0x56e864){_0x2760d0=_0x56e864;_0x154094=0xc8;}else{_0x154094=0xce;}_0x287ccd[_0x4fce('0x1e')](_0x154094);return _0x287ccd['set'](_0x4fce('0x25'),_0x33c4b0+'-'+_0x2760d0+'/'+_0x56e864)[_0x4fce('0x20')](_0x5323da);}return null;};}function patchUpdates(_0x4d5132){return function(_0x2b7ccb){try{jsonpatch[_0x4fce('0x26')](_0x2b7ccb,_0x4d5132,!![]);}catch(_0xf7e94d){return BPromise[_0x4fce('0x27')](_0xf7e94d);}return _0x2b7ccb[_0x4fce('0x28')]();};}function saveUpdates(_0x3cafd0,_0x50c5ca){return function(_0x24f09e){if(_0x24f09e){return _0x24f09e[_0x4fce('0x29')](_0x3cafd0)[_0x4fce('0x2a')](function(_0x48446e){return _0x48446e;});}return null;};}function removeEntity(_0x49c80c,_0x27d66f){return function(_0x31d1a9){if(_0x31d1a9){return _0x31d1a9[_0x4fce('0x2b')]()[_0x4fce('0x2a')](function(){var _0x873df=_0x31d1a9[_0x4fce('0x2c')]({'plain':!![]});var _0x7fc6be=[{'name':_0x4fce('0x2d'),'value':_0x4fce('0x2e'),'ignore':![]},{'name':_0x4fce('0x2f'),'value':_0x4fce('0x30'),'ignore':![]}];var _0x1e6e16=_(_0x7fc6be)[_0x4fce('0x31')](_0x4fce('0x32'))['map'](_0x4fce('0x33'))[_0x4fce('0x33')]();if(_[_0x4fce('0x34')](_0x1e6e16,_0x873df[_0x4fce('0x35')])){return;}var _0x1d91a5=_[_0x4fce('0x36')](_0x7fc6be,[_0x4fce('0x33'),_0x873df[_0x4fce('0x35')]])['name'];return db[_0x4fce('0x37')][_0x4fce('0x2b')]({'where':{'type':_0x1d91a5,'resourceId':_0x873df['id']}})[_0x4fce('0x2a')](function(){return _0x31d1a9;});})['then'](function(){_0x49c80c[_0x4fce('0x1e')](0xcc)[_0x4fce('0x1f')]();});}};}function handleEntityNotFound(_0x543235,_0x1f9718){return function(_0xd99b3a){if(!_0xd99b3a){_0x543235[_0x4fce('0x1d')](0x194);}return _0xd99b3a;};}function handleError(_0xeb8a3,_0x5caf94){_0x5caf94=_0x5caf94||0x1f4;return function(_0x4b0f01){logger[_0x4fce('0x38')](_0x4b0f01[_0x4fce('0x39')]);if(_0x4b0f01['name']){delete _0x4b0f01[_0x4fce('0x3a')];}_0xeb8a3[_0x4fce('0x1e')](_0x5caf94)[_0x4fce('0x3b')](_0x4b0f01);};}exports[_0x4fce('0x3c')]=function(_0x5ad250,_0x51d9d1){var _0x1337e4={},_0x1dd361={},_0x25ffaa={'count':0x0,'rows':[]};var _0x3475fd=_[_0x4fce('0x3d')](db[_0x4fce('0x3e')]['rawAttributes'],function(_0x3e50d5){return{'name':_0x3e50d5[_0x4fce('0x3f')],'type':_0x3e50d5[_0x4fce('0x35')][_0x4fce('0x40')]};});_0x1dd361[_0x4fce('0x41')]=_[_0x4fce('0x3d')](_0x3475fd,'name');_0x1dd361[_0x4fce('0x42')]=_[_0x4fce('0x43')](_0x5ad250[_0x4fce('0x42')]);_0x1dd361[_0x4fce('0x44')]=_[_0x4fce('0x45')](_0x1dd361[_0x4fce('0x41')],_0x1dd361[_0x4fce('0x42')]);_0x1337e4[_0x4fce('0x46')]=_[_0x4fce('0x45')](_0x1dd361[_0x4fce('0x41')],qs['fields'](_0x5ad250['query']['fields']));_0x1337e4['attributes']=_0x1337e4[_0x4fce('0x46')][_0x4fce('0x47')]?_0x1337e4[_0x4fce('0x46')]:_0x1dd361[_0x4fce('0x41')];if(!_0x5ad250[_0x4fce('0x42')][_0x4fce('0x48')]('nolimit')){_0x1337e4[_0x4fce('0x23')]=qs['limit'](_0x5ad250['query']['limit']);_0x1337e4[_0x4fce('0x21')]=qs['offset'](_0x5ad250['query'][_0x4fce('0x21')]);}_0x1337e4[_0x4fce('0x49')]=qs[_0x4fce('0x4a')](_0x5ad250[_0x4fce('0x42')]['sort']);_0x1337e4[_0x4fce('0x4b')]=qs[_0x4fce('0x44')](_[_0x4fce('0x4c')](_0x5ad250['query'],_0x1dd361[_0x4fce('0x44')]),_0x3475fd);if(_0x5ad250['query'][_0x4fce('0x31')]){_0x1337e4[_0x4fce('0x4b')]=_[_0x4fce('0x4d')](_0x1337e4[_0x4fce('0x4b')],{'$or':_[_0x4fce('0x3d')](_0x3475fd,function(_0x143972){if(_0x143972['type']!==_0x4fce('0x4e')){var _0x58e3e5={};_0x58e3e5[_0x143972[_0x4fce('0x3a')]]={'$like':'%'+_0x5ad250[_0x4fce('0x42')]['filter']+'%'};return _0x58e3e5;}})});}_0x1337e4=_[_0x4fce('0x4d')]({},_0x1337e4,_0x5ad250[_0x4fce('0x4f')]);var _0x38cb7f={'where':_0x1337e4[_0x4fce('0x4b')]};return db[_0x4fce('0x3e')][_0x4fce('0x24')](_0x38cb7f)[_0x4fce('0x2a')](function(_0x4baaf8){_0x25ffaa['count']=_0x4baaf8;if(_0x5ad250[_0x4fce('0x42')][_0x4fce('0x50')]){_0x1337e4[_0x4fce('0x51')]=[{'all':!![]}];}return db[_0x4fce('0x3e')]['findAll'](_0x1337e4);})[_0x4fce('0x2a')](function(_0xf27252){_0x25ffaa[_0x4fce('0x52')]=_0xf27252;return _0x25ffaa;})[_0x4fce('0x2a')](respondWithFilteredResult(_0x51d9d1,_0x1337e4))[_0x4fce('0x53')](handleError(_0x51d9d1,null));};exports[_0x4fce('0x54')]=function(_0x28ac80,_0x22632e){var _0x459b6b={'raw':![],'where':{'id':_0x28ac80[_0x4fce('0x55')]['id']}},_0x28a349={};_0x28a349[_0x4fce('0x41')]=_[_0x4fce('0x43')](db[_0x4fce('0x3e')]['rawAttributes']);_0x28a349[_0x4fce('0x42')]=_[_0x4fce('0x43')](_0x28ac80[_0x4fce('0x42')]);_0x28a349['filters']=_['intersection'](_0x28a349['model'],_0x28a349[_0x4fce('0x42')]);_0x459b6b['attributes']=_[_0x4fce('0x45')](_0x28a349[_0x4fce('0x41')],qs['fields'](_0x28ac80[_0x4fce('0x42')][_0x4fce('0x56')]));_0x459b6b['attributes']=_0x459b6b[_0x4fce('0x46')][_0x4fce('0x47')]?_0x459b6b[_0x4fce('0x46')]:_0x28a349[_0x4fce('0x41')];if(_0x28ac80[_0x4fce('0x42')][_0x4fce('0x50')]){_0x459b6b[_0x4fce('0x51')]=[{'all':!![]}];}_0x459b6b=_[_0x4fce('0x4d')]({},_0x459b6b,_0x28ac80['options']);return db['VoiceQueue'][_0x4fce('0x36')](_0x459b6b)[_0x4fce('0x2a')](handleEntityNotFound(_0x22632e,null))[_0x4fce('0x2a')](respondWithResult(_0x22632e,null))[_0x4fce('0x53')](handleError(_0x22632e,null));};exports[_0x4fce('0x57')]=function(_0xa808b0,_0x5842e4){return db[_0x4fce('0x3e')][_0x4fce('0x57')](_0xa808b0[_0x4fce('0x58')],{})[_0x4fce('0x2a')](function(_0x2dfb32){var _0xae45bd=_0xa808b0['user'][_0x4fce('0x2c')]({'plain':!![]});if(!_0xae45bd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xae45bd[_0x4fce('0x59')]===_0x4fce('0x5a')){var _0x2119c6=_0x2dfb32[_0x4fce('0x2c')]({'plain':!![]});var _0x32c8b5=[{'name':_0x4fce('0x2d'),'value':'inbound'},{'name':_0x4fce('0x2f'),'value':_0x4fce('0x30')}];var _0x275867=_[_0x4fce('0x36')](_0x32c8b5,[_0x4fce('0x33'),_0x2119c6[_0x4fce('0x35')]])[_0x4fce('0x3a')];return db[_0x4fce('0x5b')][_0x4fce('0x36')]({'where':{'name':_0x275867,'userProfileId':_0xae45bd[_0x4fce('0x5c')]},'raw':!![]})[_0x4fce('0x2a')](function(_0x206308){if(_0x206308&&_0x206308['autoAssociation']===0x0){return db[_0x4fce('0x37')]['create']({'name':_0x2119c6[_0x4fce('0x3a')],'resourceId':_0x2119c6['id'],'type':_0x206308['name'],'sectionId':_0x206308['id']},{})[_0x4fce('0x2a')](function(){return _0x2dfb32;});}else{return _0x2dfb32;}})[_0x4fce('0x53')](function(_0x1b2862){logger[_0x4fce('0x38')](_0x4fce('0x5d'),_0x1b2862);throw _0x1b2862;});}return _0x2dfb32;})[_0x4fce('0x2a')](respondWithResult(_0x5842e4,0xc9))[_0x4fce('0x53')](handleError(_0x5842e4,null));};exports[_0x4fce('0x5e')]=function(_0x1bd544,_0x5e512e){var _0x2bcedb={'where':{'id':_0x1bd544[_0x4fce('0x55')]['id']}},_0x28d852={};_0x28d852['model']=_[_0x4fce('0x43')](db[_0x4fce('0x3e')][_0x4fce('0x5f')]);_0x2bcedb[_0x4fce('0x46')]=_['intersection'](_0x28d852[_0x4fce('0x41')],qs[_0x4fce('0x56')](_0x1bd544[_0x4fce('0x42')][_0x4fce('0x56')]));_0x2bcedb['attributes']=_0x2bcedb['attributes'][_0x4fce('0x47')]?_0x2bcedb['attributes']:_0x28d852[_0x4fce('0x41')];if(_0x1bd544[_0x4fce('0x42')][_0x4fce('0x50')]){_0x2bcedb[_0x4fce('0x51')]=[{'all':!![]}];}_0x2bcedb=_[_0x4fce('0x4d')]({},_0x2bcedb,_0x1bd544[_0x4fce('0x4f')]);return db[_0x4fce('0x3e')][_0x4fce('0x36')](_0x2bcedb)[_0x4fce('0x2a')](handleEntityNotFound(_0x5e512e,null))[_0x4fce('0x2a')](function(_0x16ad5a){if(_0x16ad5a){var _0x49579b=_0x16ad5a[_0x4fce('0x2c')]({'plain':!![]});_0x49579b=qs[_0x4fce('0x60')](_0x49579b,['id',_0x4fce('0x61'),_0x4fce('0x62')]);_0x1bd544['body']=_['omit'](_0x1bd544[_0x4fce('0x58')],['id',_0x4fce('0x61'),_0x4fce('0x62')]);return db[_0x4fce('0x3e')][_0x4fce('0x57')](_[_0x4fce('0x4d')](_0x49579b,_0x1bd544[_0x4fce('0x58')]),{'include':_0x1bd544[_0x4fce('0x42')][_0x4fce('0x50')]?[{'all':!![]}]:undefined})[_0x4fce('0x2a')](function(_0x291f4b){var _0x625c13=_0x1bd544['user'][_0x4fce('0x2c')]({'plain':!![]});if(!_0x625c13)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x625c13[_0x4fce('0x59')]===_0x4fce('0x5a')){var _0xfe0a9c=_0x291f4b[_0x4fce('0x2c')]({'plain':!![]});var _0x107a81=[{'name':_0x4fce('0x2d'),'value':_0x4fce('0x2e')},{'name':_0x4fce('0x2f'),'value':_0x4fce('0x30')}];var _0x143e45=_[_0x4fce('0x36')](_0x107a81,[_0x4fce('0x33'),_0xfe0a9c[_0x4fce('0x35')]])[_0x4fce('0x3a')];return db[_0x4fce('0x5b')][_0x4fce('0x36')]({'where':{'name':_0x143e45,'userProfileId':_0x625c13['userProfileId']},'raw':!![]})[_0x4fce('0x2a')](function(_0x14607d){if(_0x14607d&&_0x14607d[_0x4fce('0x63')]===0x0){return db[_0x4fce('0x37')][_0x4fce('0x57')]({'name':_0xfe0a9c[_0x4fce('0x3a')],'resourceId':_0xfe0a9c['id'],'type':_0x14607d[_0x4fce('0x3a')],'sectionId':_0x14607d['id']},{})['then'](function(){return _0x291f4b;});}else{return _0x291f4b;}})[_0x4fce('0x53')](function(_0x133b90){logger[_0x4fce('0x38')](_0x4fce('0x5d'),_0x133b90);throw _0x133b90;});}return _0x291f4b;});}})['then'](respondWithResult(_0x5e512e,0xc9))[_0x4fce('0x53')](handleError(_0x5e512e,null));};exports['update']=function(_0x1b145c,_0x545bad){if(_0x1b145c['body']['id']){delete _0x1b145c['body']['id'];}return db['VoiceQueue'][_0x4fce('0x36')]({'where':{'id':_0x1b145c[_0x4fce('0x55')]['id']}})[_0x4fce('0x2a')](handleEntityNotFound(_0x545bad,null))[_0x4fce('0x2a')](saveUpdates(_0x1b145c['body'],null))[_0x4fce('0x2a')](respondWithResult(_0x545bad,null))[_0x4fce('0x53')](handleError(_0x545bad,null));};exports[_0x4fce('0x2b')]=function(_0x521bac,_0x59ab58){return db['VoiceQueue']['find']({'where':{'id':_0x521bac[_0x4fce('0x55')]['id']}})[_0x4fce('0x2a')](handleEntityNotFound(_0x59ab58,null))['then'](removeEntity(_0x59ab58,null))['catch'](handleError(_0x59ab58,null));};exports[_0x4fce('0x64')]=function(_0x47f2ef,_0x5d2323,_0x1e025d){var _0x187c3={'raw':![],'where':{}};var _0x1087ce={};var _0x30e4ef={'count':0x0,'rows':[]};return db[_0x4fce('0x3e')][_0x4fce('0x65')]({'where':{'id':_0x47f2ef[_0x4fce('0x55')]['id']}})['then'](handleEntityNotFound(_0x5d2323,null))[_0x4fce('0x2a')](function(_0x2ce419){if(_0x2ce419){_0x1087ce['model']=_[_0x4fce('0x43')](db['CmHopper'][_0x4fce('0x5f')]);_0x1087ce['query']=_[_0x4fce('0x43')](_0x47f2ef['query']);_0x1087ce[_0x4fce('0x44')]=_[_0x4fce('0x45')](_0x1087ce[_0x4fce('0x41')],_0x1087ce[_0x4fce('0x42')]);_0x187c3[_0x4fce('0x46')]=_[_0x4fce('0x45')](_0x1087ce['model'],qs[_0x4fce('0x56')](_0x47f2ef[_0x4fce('0x42')][_0x4fce('0x56')]));_0x187c3['attributes']=_0x187c3[_0x4fce('0x46')]['length']?_0x187c3[_0x4fce('0x46')]:_0x1087ce[_0x4fce('0x41')];if(!_0x47f2ef[_0x4fce('0x42')]['hasOwnProperty'](_0x4fce('0x66'))){_0x187c3[_0x4fce('0x23')]=qs[_0x4fce('0x23')](_0x47f2ef[_0x4fce('0x42')][_0x4fce('0x23')]);_0x187c3[_0x4fce('0x21')]=qs[_0x4fce('0x21')](_0x47f2ef[_0x4fce('0x42')][_0x4fce('0x21')]);}_0x187c3[_0x4fce('0x49')]=qs[_0x4fce('0x4a')](_0x47f2ef['query'][_0x4fce('0x4a')]);_0x187c3[_0x4fce('0x4b')]=qs[_0x4fce('0x44')](_['pick'](_0x47f2ef[_0x4fce('0x42')],_0x1087ce['filters']));_0x187c3[_0x4fce('0x4b')][_0x4fce('0x67')]=_0x2ce419['id'];if(_0x47f2ef[_0x4fce('0x42')][_0x4fce('0x31')]){_0x187c3[_0x4fce('0x4b')]=_[_0x4fce('0x4d')](_0x187c3['where'],{'$or':_[_0x4fce('0x3d')](_0x187c3[_0x4fce('0x46')],function(_0x2282d4){var _0x40194a={};_0x40194a[_0x2282d4]={'$like':'%'+_0x47f2ef[_0x4fce('0x42')]['filter']+'%'};return _0x40194a;})});}_0x187c3=_[_0x4fce('0x4d')]({},_0x187c3,_0x47f2ef['options']);return db[_0x4fce('0x68')][_0x4fce('0x24')]({'where':_0x187c3[_0x4fce('0x4b')]})[_0x4fce('0x2a')](function(_0x5c5fc6){_0x30e4ef[_0x4fce('0x24')]=_0x5c5fc6;if(_0x47f2ef[_0x4fce('0x42')]['includeAll']){_0x187c3[_0x4fce('0x51')]=[{'all':!![]}];}return db['CmHopper'][_0x4fce('0x69')](_0x187c3);})['then'](function(_0x382799){_0x30e4ef['rows']=_0x382799;return _0x30e4ef;});}})[_0x4fce('0x2a')](respondWithFilteredResult(_0x5d2323,_0x187c3))['catch'](handleError(_0x5d2323,null));};exports['getHopperHistories']=function(_0x2d6924,_0x58b815,_0xc7a347){var _0x5936cd={'raw':!![],'where':{}};var _0x5405b8={};var _0x28571e={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x2d6924['params']['id']}})['then'](handleEntityNotFound(_0x58b815,null))[_0x4fce('0x2a')](function(_0x4da96c){if(_0x4da96c){_0x5405b8[_0x4fce('0x41')]=_[_0x4fce('0x43')](db[_0x4fce('0x6a')][_0x4fce('0x5f')]);_0x5405b8['query']=_[_0x4fce('0x43')](_0x2d6924['query']);_0x5405b8[_0x4fce('0x44')]=_[_0x4fce('0x45')](_0x5405b8['model'],_0x5405b8[_0x4fce('0x42')]);_0x5936cd[_0x4fce('0x46')]=_['intersection'](_0x5405b8[_0x4fce('0x41')],qs[_0x4fce('0x56')](_0x2d6924['query'][_0x4fce('0x56')]));_0x5936cd[_0x4fce('0x46')]=_0x5936cd[_0x4fce('0x46')]['length']?_0x5936cd[_0x4fce('0x46')]:_0x5405b8['model'];if(!_0x2d6924[_0x4fce('0x42')][_0x4fce('0x48')](_0x4fce('0x66'))){_0x5936cd[_0x4fce('0x23')]=qs['limit'](_0x2d6924['query']['limit']);_0x5936cd['offset']=qs['offset'](_0x2d6924[_0x4fce('0x42')][_0x4fce('0x21')]);}_0x5936cd[_0x4fce('0x49')]=qs[_0x4fce('0x4a')](_0x2d6924[_0x4fce('0x42')]['sort']);_0x5936cd[_0x4fce('0x4b')]=qs[_0x4fce('0x44')](_[_0x4fce('0x4c')](_0x2d6924[_0x4fce('0x42')],_0x5405b8['filters']));_0x5936cd[_0x4fce('0x4b')]['VoiceQueueId']=_0x4da96c['id'];if(_0x2d6924[_0x4fce('0x42')][_0x4fce('0x31')]){_0x5936cd['where']=_['merge'](_0x5936cd[_0x4fce('0x4b')],{'$or':_['map'](_0x5936cd['attributes'],function(_0xbe8438){var _0x38498d={};_0x38498d[_0xbe8438]={'$like':'%'+_0x2d6924[_0x4fce('0x42')][_0x4fce('0x31')]+'%'};return _0x38498d;})});}_0x5936cd=_['merge']({},_0x5936cd,_0x2d6924['options']);return db[_0x4fce('0x6a')]['count']({'where':_0x5936cd['where']})[_0x4fce('0x2a')](function(_0x30287e){_0x28571e[_0x4fce('0x24')]=_0x30287e;if(_0x2d6924['query'][_0x4fce('0x50')]){_0x5936cd['include']=[{'all':!![]}];}return db[_0x4fce('0x6a')][_0x4fce('0x69')](_0x5936cd);})[_0x4fce('0x2a')](function(_0x13e73d){_0x28571e[_0x4fce('0x52')]=_0x13e73d;return _0x28571e;});}})[_0x4fce('0x2a')](respondWithFilteredResult(_0x58b815,_0x5936cd))['catch'](handleError(_0x58b815,null));};exports[_0x4fce('0x6b')]=function(_0x5cddb6,_0x2d0f88,_0x3e5772){var _0x3d7739={'raw':!![],'where':{}};var _0x5d9fba={};var _0x52b64f={'count':0x0,'rows':[]};return db[_0x4fce('0x3e')]['findOne']({'where':{'id':_0x5cddb6[_0x4fce('0x55')]['id']}})['then'](handleEntityNotFound(_0x2d0f88,null))['then'](function(_0xb2c192){if(_0xb2c192){_0x5d9fba[_0x4fce('0x41')]=_[_0x4fce('0x43')](db['CmHopperFinal'][_0x4fce('0x5f')]);_0x5d9fba[_0x4fce('0x42')]=_[_0x4fce('0x43')](_0x5cddb6['query']);_0x5d9fba[_0x4fce('0x44')]=_[_0x4fce('0x45')](_0x5d9fba[_0x4fce('0x41')],_0x5d9fba[_0x4fce('0x42')]);_0x3d7739['attributes']=_[_0x4fce('0x45')](_0x5d9fba[_0x4fce('0x41')],qs[_0x4fce('0x56')](_0x5cddb6[_0x4fce('0x42')][_0x4fce('0x56')]));_0x3d7739[_0x4fce('0x46')]=_0x3d7739[_0x4fce('0x46')][_0x4fce('0x47')]?_0x3d7739[_0x4fce('0x46')]:_0x5d9fba[_0x4fce('0x41')];if(!_0x5cddb6[_0x4fce('0x42')][_0x4fce('0x48')](_0x4fce('0x66'))){_0x3d7739['limit']=qs[_0x4fce('0x23')](_0x5cddb6['query'][_0x4fce('0x23')]);_0x3d7739['offset']=qs[_0x4fce('0x21')](_0x5cddb6[_0x4fce('0x42')][_0x4fce('0x21')]);}_0x3d7739[_0x4fce('0x49')]=qs[_0x4fce('0x4a')](_0x5cddb6[_0x4fce('0x42')][_0x4fce('0x4a')]);_0x3d7739['where']=qs[_0x4fce('0x44')](_[_0x4fce('0x4c')](_0x5cddb6[_0x4fce('0x42')],_0x5d9fba[_0x4fce('0x44')]));_0x3d7739[_0x4fce('0x4b')][_0x4fce('0x67')]=_0xb2c192['id'];if(_0x5cddb6[_0x4fce('0x42')][_0x4fce('0x31')]){_0x3d7739['where']=_['merge'](_0x3d7739[_0x4fce('0x4b')],{'$or':_[_0x4fce('0x3d')](_0x3d7739[_0x4fce('0x46')],function(_0x2e1f2e){var _0x2ee45c={};_0x2ee45c[_0x2e1f2e]={'$like':'%'+_0x5cddb6[_0x4fce('0x42')]['filter']+'%'};return _0x2ee45c;})});}_0x3d7739=_[_0x4fce('0x4d')]({},_0x3d7739,_0x5cddb6[_0x4fce('0x4f')]);return db[_0x4fce('0x6c')][_0x4fce('0x24')]({'where':_0x3d7739['where']})['then'](function(_0x2472a1){_0x52b64f[_0x4fce('0x24')]=_0x2472a1;if(_0x5cddb6['query']['includeAll']){_0x3d7739[_0x4fce('0x51')]=[{'all':!![]}];}return db[_0x4fce('0x6c')][_0x4fce('0x69')](_0x3d7739);})['then'](function(_0x55fb8d){_0x52b64f[_0x4fce('0x52')]=_0x55fb8d;return _0x52b64f;});}})[_0x4fce('0x2a')](respondWithFilteredResult(_0x2d0f88,_0x3d7739))[_0x4fce('0x53')](handleError(_0x2d0f88,null));};exports[_0x4fce('0x6d')]=function(_0x312caf,_0x5065e4,_0x22badb){var _0x145f90={'raw':!![],'where':{}};var _0x4c377e={};var _0x2770ab={'count':0x0,'rows':[]};return db[_0x4fce('0x3e')][_0x4fce('0x65')]({'where':{'id':_0x312caf[_0x4fce('0x55')]['id']}})['then'](handleEntityNotFound(_0x5065e4,null))['then'](function(_0x17d7ef){if(_0x17d7ef){_0x4c377e[_0x4fce('0x41')]=_['keys'](db[_0x4fce('0x6e')]['rawAttributes']);_0x4c377e[_0x4fce('0x42')]=_[_0x4fce('0x43')](_0x312caf[_0x4fce('0x42')]);_0x4c377e[_0x4fce('0x44')]=_[_0x4fce('0x45')](_0x4c377e['model'],_0x4c377e[_0x4fce('0x42')]);_0x145f90['attributes']=_[_0x4fce('0x45')](_0x4c377e[_0x4fce('0x41')],qs[_0x4fce('0x56')](_0x312caf['query'][_0x4fce('0x56')]));_0x145f90[_0x4fce('0x46')]=_0x145f90[_0x4fce('0x46')][_0x4fce('0x47')]?_0x145f90['attributes']:_0x4c377e[_0x4fce('0x41')];if(!_0x312caf[_0x4fce('0x42')]['hasOwnProperty']('nolimit')){_0x145f90[_0x4fce('0x23')]=qs[_0x4fce('0x23')](_0x312caf['query']['limit']);_0x145f90[_0x4fce('0x21')]=qs[_0x4fce('0x21')](_0x312caf[_0x4fce('0x42')]['offset']);}_0x145f90[_0x4fce('0x49')]=qs['sort'](_0x312caf['query'][_0x4fce('0x4a')]);_0x145f90[_0x4fce('0x4b')]=qs[_0x4fce('0x44')](_['pick'](_0x312caf[_0x4fce('0x42')],_0x4c377e['filters']));_0x145f90[_0x4fce('0x4b')][_0x4fce('0x67')]=_0x17d7ef['id'];if(_0x312caf['query'][_0x4fce('0x31')]){_0x145f90[_0x4fce('0x4b')]=_[_0x4fce('0x4d')](_0x145f90['where'],{'$or':_[_0x4fce('0x3d')](_0x145f90[_0x4fce('0x46')],function(_0x1a2158){var _0x4759f0={};_0x4759f0[_0x1a2158]={'$like':'%'+_0x312caf[_0x4fce('0x42')][_0x4fce('0x31')]+'%'};return _0x4759f0;})});}_0x145f90=_[_0x4fce('0x4d')]({},_0x145f90,_0x312caf[_0x4fce('0x4f')]);return db['CmHopperBlack'][_0x4fce('0x24')]({'where':_0x145f90[_0x4fce('0x4b')]})[_0x4fce('0x2a')](function(_0x35ede8){_0x2770ab[_0x4fce('0x24')]=_0x35ede8;if(_0x312caf[_0x4fce('0x42')]['includeAll']){_0x145f90['include']=[{'all':!![]}];}return db[_0x4fce('0x6e')][_0x4fce('0x69')](_0x145f90);})[_0x4fce('0x2a')](function(_0x2d5735){_0x2770ab[_0x4fce('0x52')]=_0x2d5735;return _0x2770ab;});}})[_0x4fce('0x2a')](respondWithFilteredResult(_0x5065e4,_0x145f90))[_0x4fce('0x53')](handleError(_0x5065e4,null));};exports[_0x4fce('0x6f')]=function(_0x44c1c9,_0x2b1008,_0x59a052){var _0x467e70={};var _0x3b8a5d={};var _0x5e3e62;var _0x2dafcf;return db[_0x4fce('0x3e')][_0x4fce('0x65')]({'where':{'id':_0x44c1c9[_0x4fce('0x55')]['id']}})[_0x4fce('0x2a')](handleEntityNotFound(_0x2b1008,null))[_0x4fce('0x2a')](function(_0x5b0cf4){if(_0x5b0cf4){_0x5e3e62=_0x5b0cf4;_0x3b8a5d['model']=_['keys'](db['Team']['rawAttributes']);_0x3b8a5d[_0x4fce('0x42')]=_['keys'](_0x44c1c9['query']);_0x3b8a5d['filters']=_[_0x4fce('0x45')](_0x3b8a5d['model'],_0x3b8a5d[_0x4fce('0x42')]);_0x467e70[_0x4fce('0x46')]=_[_0x4fce('0x45')](_0x3b8a5d[_0x4fce('0x41')],qs[_0x4fce('0x56')](_0x44c1c9[_0x4fce('0x42')][_0x4fce('0x56')]));_0x467e70['attributes']=_0x467e70[_0x4fce('0x46')]['length']?_0x467e70[_0x4fce('0x46')]:_0x3b8a5d[_0x4fce('0x41')];_0x467e70['order']=qs[_0x4fce('0x4a')](_0x44c1c9[_0x4fce('0x42')][_0x4fce('0x4a')]);_0x467e70['where']=qs[_0x4fce('0x44')](_[_0x4fce('0x4c')](_0x44c1c9[_0x4fce('0x42')],_0x3b8a5d['filters']));if(_0x44c1c9[_0x4fce('0x42')][_0x4fce('0x31')]){_0x467e70['where']=_[_0x4fce('0x4d')](_0x467e70[_0x4fce('0x4b')],{'$or':_[_0x4fce('0x3d')](_0x467e70[_0x4fce('0x46')],function(_0x5eff91){var _0x3ba239={};_0x3ba239[_0x5eff91]={'$like':'%'+_0x44c1c9['query'][_0x4fce('0x31')]+'%'};return _0x3ba239;})});}_0x467e70=_[_0x4fce('0x4d')]({},_0x467e70,_0x44c1c9[_0x4fce('0x4f')]);return _0x5e3e62[_0x4fce('0x6f')](_0x467e70);}})[_0x4fce('0x2a')](function(_0x229d4a){if(_0x229d4a){_0x2dafcf=_0x229d4a[_0x4fce('0x47')];if(!_0x44c1c9[_0x4fce('0x42')][_0x4fce('0x48')]('nolimit')){_0x467e70[_0x4fce('0x23')]=qs['limit'](_0x44c1c9['query'][_0x4fce('0x23')]);_0x467e70[_0x4fce('0x21')]=qs[_0x4fce('0x21')](_0x44c1c9[_0x4fce('0x42')][_0x4fce('0x21')]);}return _0x5e3e62[_0x4fce('0x6f')](_0x467e70);}})[_0x4fce('0x2a')](function(_0x279871){if(_0x279871){return _0x279871?{'count':_0x2dafcf,'rows':_0x279871}:null;}})[_0x4fce('0x2a')](respondWithResult(_0x2b1008,null))[_0x4fce('0x53')](handleError(_0x2b1008,null));};exports['addTeams']=function(_0x29fbcf,_0x133816,_0x4a7069){var _0x1a31a9=_0x29fbcf['body'][_0x4fce('0x70')];var _0x2f9ad5=_['map'](_0x1a31a9,'id');return db[_0x4fce('0x71')][_0x4fce('0x69')]({'where':{'id':_0x2f9ad5},'attributes':['id'],'include':[{'model':db[_0x4fce('0x72')],'as':_0x4fce('0x73'),'attributes':['id',_0x4fce('0x3a'),_0x4fce('0x74'),_0x4fce('0x75'),_0x4fce('0x76')],'raw':!![]}]})['then'](function(_0xb096a0){if(_0xb096a0){var _0x25971c=_['flatMap'](_0xb096a0,function(_0x5e709f){var _0x1ee8f3=_0x5e709f[_0x4fce('0x2c')]({'plain':!![]});_0x1ee8f3[_0x4fce('0x73')][_0x4fce('0x77')](function(_0x109280){_0x109280[_0x4fce('0x78')]=_[_0x4fce('0x36')](_0x1a31a9,{'id':_0x1ee8f3['id']})[_0x4fce('0x78')];});return _0x1ee8f3[_0x4fce('0x73')];});return db[_0x4fce('0x3e')][_0x4fce('0x36')]({'where':{'id':_0x29fbcf['params']['id']}})[_0x4fce('0x2a')](function(_0x455561){return db[_0x4fce('0x79')]['transaction'](function(_0x1ae513){return _0x455561[_0x4fce('0x7a')](_0x2f9ad5,{'transaction':_0x1ae513})[_0x4fce('0x2a')](function(){return BPromise[_0x4fce('0x7b')](_0x1a31a9,function(_0x1cc073){return db[_0x4fce('0x7c')][_0x4fce('0x7d')]({'TeamId':_0x1cc073['id'],'VoiceQueueId':_0x29fbcf[_0x4fce('0x55')]['id'],'penalty':_0x1cc073[_0x4fce('0x78')]},{'transaction':_0x1ae513});});})[_0x4fce('0x2a')](function(){return BPromise['each'](_0x25971c,function(_0x507e7b){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x507e7b['id'],'VoiceQueueId':_0x29fbcf['params']['id']},'defaults':{'penalty':_0x507e7b[_0x4fce('0x78')]},'transaction':_0x1ae513});});})['then'](function(){return BPromise[_0x4fce('0x7b')](_['filter'](_0x25971c,{'online':!![]}),function(_0x26f3f1){return db[_0x4fce('0x7e')][_0x4fce('0x7d')]({'membername':_0x26f3f1[_0x4fce('0x3a')],'UserId':_0x26f3f1['id'],'queue_name':_0x455561[_0x4fce('0x3a')],'VoiceQueueId':_0x455561['id'],'interface':_['isNil'](_0x26f3f1[_0x4fce('0x76')])?util[_0x4fce('0x7f')](_0x4fce('0x80'),_0x26f3f1[_0x4fce('0x3a')]):_0x26f3f1[_0x4fce('0x76')],'paused':_0x26f3f1[_0x4fce('0x75')]||![],'penalty':_0x26f3f1[_0x4fce('0x78')]},{'transaction':_0x1ae513});});})['then'](function(){_0x25971c[_0x4fce('0x77')](function(_0x27e178){socket['emit']('userVoiceQueue:save',{'UserId':_0x27e178['id'],'VoiceQueueId':_0x455561['id']});});});});});}})[_0x4fce('0x2a')](respondWithStatusCode(_0x133816,null))['catch'](handleError(_0x133816,null));};exports[_0x4fce('0x81')]=function(_0xfc889d,_0x15fae4,_0x2047fa){return db['Team'][_0x4fce('0x69')]({'where':{'id':_0xfc889d[_0x4fce('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4fce('0x72')],'as':_0x4fce('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x15fae4,null))['then'](function(_0x557683){var _0x10c21f=_[_0x4fce('0x3d')](_0x557683,'id');var _0x2da4bd=[];var _0x16275b=[];var _0x3cf79d=squel['select']();_0x3cf79d[_0x4fce('0x82')](_0x4fce('0x83'))[_0x4fce('0x84')]('team_has_voice_queues','tq')[_0x4fce('0x85')](_0x4fce('0x86'),'ut',_0x4fce('0x87'))[_0x4fce('0x4b')]('VoiceQueueId\x20=\x20?',_0xfc889d['params']['id']);for(var _0x58534d=0x0;_0x58534d<_0x557683[_0x4fce('0x47')];_0x58534d+=0x1){let _0x34170c=_0x557683[_0x58534d];for(var _0x86cc1f=0x0;_0x86cc1f<_0x34170c[_0x4fce('0x73')][_0x4fce('0x47')];_0x86cc1f+=0x1){let _0x3aa470=_0x34170c[_0x4fce('0x73')][_0x86cc1f];var _0x11d33b=_0x3cf79d[_0x4fce('0x5e')]();_0x11d33b[_0x4fce('0x4b')](_0x4fce('0x88'),_0x3aa470['id']);_0x16275b[_0x4fce('0x89')](db['sequelize'][_0x4fce('0x42')](_0x11d33b[_0x4fce('0x8a')](),{'type':db[_0x4fce('0x79')][_0x4fce('0x8b')][_0x4fce('0x8c')]})['then'](function(_0x4b4b3b){if(_0x4b4b3b[_0x4fce('0x47')]===0x1){return _0x3aa470['id'];}else{var _0x2f51cb=_[_0x4fce('0x8d')](_['map'](_0x4b4b3b,_0x4fce('0x8e')),function(_0x1f7609){return _[_0x4fce('0x34')](_0x10c21f,_0x1f7609);});if(_0x2f51cb){return _0x3aa470['id'];}}}));}}return BPromise[_0x4fce('0x8f')](_0x16275b)['then'](function(_0x176731){_0x2da4bd=_(_0x2da4bd)['union'](_0x176731)[_0x4fce('0x90')]()[_0x4fce('0x33')]();return db[_0x4fce('0x3e')][_0x4fce('0x36')]({'where':{'id':_0xfc889d['params']['id']}})[_0x4fce('0x2a')](function(_0x9ae6ef){return db[_0x4fce('0x79')][_0x4fce('0x91')](function(_0x5250cf){return _0x9ae6ef['removeTeams'](_0xfc889d[_0x4fce('0x42')][_0x4fce('0x92')],{'transaction':_0x5250cf})[_0x4fce('0x2a')](function(){if(!_[_0x4fce('0x93')](_0x2da4bd)){return _0x9ae6ef[_0x4fce('0x94')](_0x2da4bd,{'transaction':_0x5250cf})[_0x4fce('0x2a')](function(){return db[_0x4fce('0x7e')][_0x4fce('0x2b')]({'where':{'VoiceQueueId':_0xfc889d[_0x4fce('0x55')]['id'],'UserId':_0x2da4bd},'transaction':_0x5250cf});});}})['then'](function(){_0x2da4bd[_0x4fce('0x77')](function(_0x66659c){socket[_0x4fce('0x95')](_0x4fce('0x96'),{'UserId':_0x66659c,'VoiceQueueId':_0x9ae6ef['id']});});});});});});})[_0x4fce('0x2a')](respondWithStatusCode(_0x15fae4,null))[_0x4fce('0x53')](handleError(_0x15fae4,null));};exports[_0x4fce('0x97')]=function(_0x2bbfe2,_0x38bf9c,_0x48284c){var _0x5d0abc,_0x262216;return db['VoiceQueue'][_0x4fce('0x36')]({'where':{'id':_0x2bbfe2[_0x4fce('0x55')]['id']}})['then'](handleEntityNotFound(_0x38bf9c,null))[_0x4fce('0x2a')](function(_0x297545){if(_0x297545){_0x262216=_0x297545;return _0x297545[_0x4fce('0x97')](_0x2bbfe2[_0x4fce('0x58')][_0x4fce('0x92')],_['omit'](_0x2bbfe2['body'],[_0x4fce('0x92'),'id'])||{})['spread'](function(_0x39bde5){for(var _0xdfe258=0x0;_0xdfe258<_0x2bbfe2['body']['ids'][_0x4fce('0x47')];_0xdfe258+=0x1){socket[_0x4fce('0x95')](_0x4fce('0x98'),{'UserId':Number(_0x2bbfe2[_0x4fce('0x58')][_0x4fce('0x92')][_0xdfe258]),'VoiceQueueId':Number(_0x2bbfe2[_0x4fce('0x55')]['id'])});}return _0x39bde5;});}})[_0x4fce('0x2a')](function(_0x28d91f){_0x5d0abc=_0x28d91f||[];if(_0x262216){return db[_0x4fce('0x72')][_0x4fce('0x69')]({'where':{'id':_0x2bbfe2[_0x4fce('0x58')][_0x4fce('0x92')]},'attributes':['id','name',_0x4fce('0x74'),_0x4fce('0x75'),_0x4fce('0x76')],'raw':!![]});}})['then'](function(_0x25c19a){if(!_['isEmpty'](_0x25c19a)){var _0x4656d6=[];for(var _0x135da7=0x0;_0x135da7<_0x25c19a['length'];_0x135da7++){if(_0x25c19a[_0x135da7][_0x4fce('0x74')]){_0x4656d6[_0x4fce('0x89')](db[_0x4fce('0x7e')]['upsert']({'membername':_0x25c19a[_0x135da7][_0x4fce('0x3a')],'UserId':_0x25c19a[_0x135da7]['id'],'queue_name':_0x262216[_0x4fce('0x3a')],'VoiceQueueId':_0x262216['id'],'interface':_['isNil'](_0x25c19a[_0x135da7][_0x4fce('0x76')])?util[_0x4fce('0x7f')]('SIP/%s',_0x25c19a[_0x135da7][_0x4fce('0x3a')]):_0x25c19a[_0x135da7][_0x4fce('0x76')],'paused':_0x25c19a[_0x135da7]['voicePause']||![],'penalty':_0x2bbfe2['body'][_0x4fce('0x78')]||0x0}));}}return BPromise[_0x4fce('0x8f')](_0x4656d6);}})[_0x4fce('0x2a')](function(){return _0x5d0abc;})[_0x4fce('0x2a')](respondWithResult(_0x38bf9c,null))[_0x4fce('0x53')](handleError(_0x38bf9c,null));};exports['removeAgents']=function(_0x97b0d0,_0x334033,_0x5a58ca){return db['VoiceQueue'][_0x4fce('0x36')]({'where':{'id':_0x97b0d0[_0x4fce('0x55')]['id']}})['then'](handleEntityNotFound(_0x334033,null))[_0x4fce('0x2a')](function(_0x18851a){if(_0x18851a){return _0x18851a['removeAgents'](_0x97b0d0[_0x4fce('0x42')]['ids'])[_0x4fce('0x2a')](function(){if(_['isArray'](_0x97b0d0[_0x4fce('0x42')][_0x4fce('0x92')])){for(var _0x3c8c6b=0x0;_0x3c8c6b<_0x97b0d0[_0x4fce('0x42')][_0x4fce('0x92')]['length'];_0x3c8c6b+=0x1){socket[_0x4fce('0x95')](_0x4fce('0x96'),{'UserId':Number(_0x97b0d0[_0x4fce('0x42')]['ids'][_0x3c8c6b]),'VoiceQueueId':Number(_0x97b0d0[_0x4fce('0x55')]['id'])});}}else{socket[_0x4fce('0x95')](_0x4fce('0x96'),{'UserId':Number(_0x97b0d0[_0x4fce('0x42')]['ids']),'VoiceQueueId':Number(_0x97b0d0[_0x4fce('0x55')]['id'])});}});}})[_0x4fce('0x2a')](function(_0x59e0d1){return db[_0x4fce('0x7e')][_0x4fce('0x2b')]({'where':{'VoiceQueueId':_0x97b0d0[_0x4fce('0x55')]['id'],'UserId':_0x97b0d0[_0x4fce('0x42')][_0x4fce('0x92')]}})['then'](function(){return _0x59e0d1;});})[_0x4fce('0x2a')](respondWithStatusCode(_0x334033,null))[_0x4fce('0x53')](handleError(_0x334033,null));};exports['getAgents']=function(_0x1d6100,_0x3c13e0,_0x307e99){var _0x465fd2={};var _0x24e532={};var _0x5b1bcc;var _0x3324b5;return db[_0x4fce('0x3e')]['findOne']({'where':{'id':_0x1d6100['params']['id']}})[_0x4fce('0x2a')](handleEntityNotFound(_0x3c13e0,null))['then'](function(_0x5212fa){if(_0x5212fa){_0x5b1bcc=_0x5212fa;_0x24e532[_0x4fce('0x41')]=_[_0x4fce('0x43')](db[_0x4fce('0x72')]['rawAttributes']);_0x24e532[_0x4fce('0x42')]=_[_0x4fce('0x43')](_0x1d6100[_0x4fce('0x42')]);_0x24e532[_0x4fce('0x44')]=_['intersection'](_0x24e532[_0x4fce('0x41')],_0x24e532[_0x4fce('0x42')]);_0x465fd2[_0x4fce('0x46')]=_[_0x4fce('0x45')](_0x24e532[_0x4fce('0x41')],qs[_0x4fce('0x56')](_0x1d6100[_0x4fce('0x42')][_0x4fce('0x56')]));_0x465fd2['attributes']=_0x465fd2[_0x4fce('0x46')]['length']?_0x465fd2['attributes']:_0x24e532['model'];_0x465fd2[_0x4fce('0x49')]=qs[_0x4fce('0x4a')](_0x1d6100[_0x4fce('0x42')][_0x4fce('0x4a')]);_0x465fd2[_0x4fce('0x4b')]=qs[_0x4fce('0x44')](_[_0x4fce('0x4c')](_0x1d6100[_0x4fce('0x42')],_0x24e532['filters']));if(_0x1d6100[_0x4fce('0x42')][_0x4fce('0x31')]){_0x465fd2['where']=_['merge'](_0x465fd2[_0x4fce('0x4b')],{'$or':_[_0x4fce('0x3d')](_0x465fd2[_0x4fce('0x46')],function(_0x15788f){var _0x366861={};_0x366861[_0x15788f]={'$like':'%'+_0x1d6100['query'][_0x4fce('0x31')]+'%'};return _0x366861;})});}_0x465fd2=_[_0x4fce('0x4d')]({},_0x465fd2,_0x1d6100[_0x4fce('0x4f')]);return _0x5b1bcc['getAgents'](_0x465fd2);}})[_0x4fce('0x2a')](function(_0x2de288){if(_0x2de288){_0x3324b5=_0x2de288[_0x4fce('0x47')];if(!_0x1d6100['query']['hasOwnProperty'](_0x4fce('0x66'))){_0x465fd2['limit']=qs[_0x4fce('0x23')](_0x1d6100[_0x4fce('0x42')][_0x4fce('0x23')]);_0x465fd2['offset']=qs[_0x4fce('0x21')](_0x1d6100[_0x4fce('0x42')][_0x4fce('0x21')]);}return _0x5b1bcc[_0x4fce('0x99')](_0x465fd2);}})[_0x4fce('0x2a')](function(_0x393b30){if(_0x393b30){return _0x393b30?{'count':_0x3324b5,'rows':_0x393b30}:null;}})[_0x4fce('0x2a')](respondWithResult(_0x3c13e0,null))[_0x4fce('0x53')](handleError(_0x3c13e0,null));};exports[_0x4fce('0x9a')]=function(_0x4f6eb3,_0x2825e8,_0x4ae106){var _0x3c559b={};var _0x9defd8={};var _0x34db31;var _0x5b53c2;return db[_0x4fce('0x3e')][_0x4fce('0x65')]({'where':{'id':_0x4f6eb3[_0x4fce('0x55')]['id']}})[_0x4fce('0x2a')](handleEntityNotFound(_0x2825e8,null))['then'](function(_0x3500fc){if(_0x3500fc){_0x34db31=_0x3500fc;_0x9defd8['model']=_[_0x4fce('0x43')](db[_0x4fce('0x7e')]['rawAttributes']);_0x9defd8[_0x4fce('0x42')]=_[_0x4fce('0x43')](_0x4f6eb3['query']);_0x9defd8['filters']=_[_0x4fce('0x45')](_0x9defd8[_0x4fce('0x41')],_0x9defd8[_0x4fce('0x42')]);_0x3c559b['attributes']=_[_0x4fce('0x45')](_0x9defd8[_0x4fce('0x41')],qs['fields'](_0x4f6eb3['query'][_0x4fce('0x56')]));_0x3c559b['attributes']=_0x3c559b[_0x4fce('0x46')][_0x4fce('0x47')]?_0x3c559b[_0x4fce('0x46')]:_0x9defd8[_0x4fce('0x41')];_0x3c559b[_0x4fce('0x49')]=qs[_0x4fce('0x4a')](_0x4f6eb3[_0x4fce('0x42')][_0x4fce('0x4a')]);_0x3c559b[_0x4fce('0x4b')]=qs[_0x4fce('0x44')](_[_0x4fce('0x4c')](_0x4f6eb3['query'],_0x9defd8['filters']));if(_0x4f6eb3[_0x4fce('0x42')]['filter']){_0x3c559b['where']=_[_0x4fce('0x4d')](_0x3c559b[_0x4fce('0x4b')],{'$or':_[_0x4fce('0x3d')](_0x3c559b[_0x4fce('0x46')],function(_0x4feb0f){var _0x4dd33b={};_0x4dd33b[_0x4feb0f]={'$like':'%'+_0x4f6eb3[_0x4fce('0x42')]['filter']+'%'};return _0x4dd33b;})});}_0x3c559b=_[_0x4fce('0x4d')]({},_0x3c559b,_0x4f6eb3[_0x4fce('0x4f')]);return _0x34db31[_0x4fce('0x9a')](_0x3c559b);}})[_0x4fce('0x2a')](function(_0x452be0){if(_0x452be0){_0x5b53c2=_0x452be0[_0x4fce('0x47')];if(!_0x4f6eb3[_0x4fce('0x42')][_0x4fce('0x48')]('nolimit')){_0x3c559b[_0x4fce('0x23')]=qs[_0x4fce('0x23')](_0x4f6eb3[_0x4fce('0x42')]['limit']);_0x3c559b[_0x4fce('0x21')]=qs[_0x4fce('0x21')](_0x4f6eb3[_0x4fce('0x42')][_0x4fce('0x21')]);}return _0x34db31[_0x4fce('0x9a')](_0x3c559b);}})[_0x4fce('0x2a')](function(_0x37c098){return _0x37c098?{'count':_0x5b53c2,'rows':_0x37c098}:null;})['then'](respondWithResult(_0x2825e8,null))[_0x4fce('0x53')](handleError(_0x2825e8,null));};exports[_0x4fce('0x9b')]=function(_0x2e3d8e,_0x2f23bf,_0x37e9e9){var _0x115b2b={};var _0x525096={};var _0x8b0ef9;var _0x3ce340;return db[_0x4fce('0x3e')][_0x4fce('0x65')]({'where':{'id':_0x2e3d8e['params']['id']}})[_0x4fce('0x2a')](handleEntityNotFound(_0x2f23bf,null))[_0x4fce('0x2a')](function(_0x592fa3){if(_0x592fa3){_0x8b0ef9=_0x592fa3;_0x525096[_0x4fce('0x41')]=_[_0x4fce('0x43')](db[_0x4fce('0x9c')][_0x4fce('0x5f')]);_0x525096[_0x4fce('0x42')]=_[_0x4fce('0x43')](_0x2e3d8e[_0x4fce('0x42')]);_0x525096['filters']=_[_0x4fce('0x45')](_0x525096[_0x4fce('0x41')],_0x525096[_0x4fce('0x42')]);_0x115b2b[_0x4fce('0x46')]=_[_0x4fce('0x45')](_0x525096[_0x4fce('0x41')],qs[_0x4fce('0x56')](_0x2e3d8e[_0x4fce('0x42')][_0x4fce('0x56')]));_0x115b2b[_0x4fce('0x46')]=_0x115b2b[_0x4fce('0x46')][_0x4fce('0x47')]?_0x115b2b[_0x4fce('0x46')]:_0x525096[_0x4fce('0x41')];_0x115b2b[_0x4fce('0x49')]=qs[_0x4fce('0x4a')](_0x2e3d8e[_0x4fce('0x42')][_0x4fce('0x4a')]);_0x115b2b[_0x4fce('0x4b')]=qs['filters'](_['pick'](_0x2e3d8e[_0x4fce('0x42')],_0x525096[_0x4fce('0x44')]));if(_0x2e3d8e[_0x4fce('0x42')][_0x4fce('0x31')]){_0x115b2b[_0x4fce('0x4b')]=_[_0x4fce('0x4d')](_0x115b2b['where'],{'$or':_[_0x4fce('0x3d')](_0x115b2b[_0x4fce('0x46')],function(_0x466efa){var _0x1383e3={};_0x1383e3[_0x466efa]={'$like':'%'+_0x2e3d8e[_0x4fce('0x42')][_0x4fce('0x31')]+'%'};return _0x1383e3;})});}_0x115b2b=_[_0x4fce('0x4d')]({},_0x115b2b,_0x2e3d8e[_0x4fce('0x4f')]);return _0x8b0ef9['getLists'](_0x115b2b);}})[_0x4fce('0x2a')](function(_0x7edae7){if(_0x7edae7){_0x3ce340=_0x7edae7['length'];if(!_0x2e3d8e[_0x4fce('0x42')]['hasOwnProperty'](_0x4fce('0x66'))){_0x115b2b[_0x4fce('0x23')]=qs[_0x4fce('0x23')](_0x2e3d8e['query'][_0x4fce('0x23')]);_0x115b2b['offset']=qs[_0x4fce('0x21')](_0x2e3d8e['query'][_0x4fce('0x21')]);}return _0x8b0ef9[_0x4fce('0x9b')](_0x115b2b);}})[_0x4fce('0x2a')](function(_0xb58cd8){if(_0xb58cd8){return _0xb58cd8?{'count':_0x3ce340,'rows':_0xb58cd8}:null;}})[_0x4fce('0x2a')](respondWithResult(_0x2f23bf,null))[_0x4fce('0x53')](handleError(_0x2f23bf,null));};exports[_0x4fce('0x9d')]=function(_0x3b08f3,_0x1a24d,_0x60d1b5){var _0x9d3e9,_0xdf03ae;return db[_0x4fce('0x3e')][_0x4fce('0x36')]({'where':{'id':_0x3b08f3[_0x4fce('0x55')]['id']}})[_0x4fce('0x2a')](handleEntityNotFound(_0x1a24d,null))[_0x4fce('0x2a')](function(_0x5c6c01){if(_0x5c6c01){_0xdf03ae=_0x5c6c01;return _0x5c6c01[_0x4fce('0x9d')](_0x3b08f3[_0x4fce('0x58')]['ids'],_[_0x4fce('0x60')](_0x3b08f3[_0x4fce('0x58')],[_0x4fce('0x92'),'id'])||{});}return null;})[_0x4fce('0x9e')](function(_0x3f4ad0){var _0x71e4a9;_0x9d3e9=_0x3f4ad0||[];var _0xcf84=[];if(_0x3f4ad0){for(var _0x296768=0x0;_0x296768<_0x3f4ad0[_0x4fce('0x47')];_0x296768+=0x1){var _0x44ca9b=_0x3f4ad0[_0x296768][_0x4fce('0x2c')]({'plain':!![]});_0xdf03ae['dialCheckDuplicateType']=_0x3b08f3[_0x4fce('0x58')][_0x4fce('0x9f')]?_0x3b08f3['body'][_0x4fce('0x9f')]:_0xdf03ae[_0x4fce('0x9f')];switch(_0xdf03ae[_0x4fce('0x9f')]){case _0x4fce('0xa0'):_0x71e4a9=squel[_0x4fce('0xa1')]()[_0x4fce('0xa2')]('cm_hopper')[_0x4fce('0xa3')]([_0x4fce('0xa4'),_0x4fce('0xa5'),_0x4fce('0xa6'),_0x4fce('0xa7'),_0x4fce('0x67'),_0x4fce('0x61'),_0x4fce('0x62')],squel[_0x4fce('0xa8')]()[_0x4fce('0x82')](_0x4fce('0xa4'),_0x4fce('0xa4'))[_0x4fce('0x82')](_0x4fce('0xa9'),_0x4fce('0xa5'))['field']('id',_0x4fce('0xa6'))[_0x4fce('0x82')](_0x44ca9b[_0x4fce('0xaa')]['toString'](),_0x4fce('0xa7'))[_0x4fce('0x82')](_0x3b08f3[_0x4fce('0x55')]['id'][_0x4fce('0x8a')](),_0x4fce('0x67'))[_0x4fce('0x82')](_0x4fce('0xa9'),_0x4fce('0x61'))[_0x4fce('0x82')]('NOW()',_0x4fce('0x62'))[_0x4fce('0x84')](_0x4fce('0xab'))[_0x4fce('0x4b')](_0x4fce('0xac'))[_0x4fce('0x4b')](_0x4fce('0xad'),_0x44ca9b[_0x4fce('0xaa')]['toString']())['where'](_0x4fce('0xae'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x4fce('0xa8')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x4fce('0x84')](_0x4fce('0xaf'))[_0x4fce('0x4b')]('VoiceQueueId\x20=\x20?',_0x3b08f3[_0x4fce('0x55')]['id']['toString']()))['where'](_0x4fce('0xb0'),squel[_0x4fce('0xa8')]()[_0x4fce('0x82')](_0x4fce('0xb1'))[_0x4fce('0x84')](_0x4fce('0xb2'))['where'](_0x4fce('0xb3'),_0x3b08f3[_0x4fce('0x55')]['id'][_0x4fce('0x8a')]())))[_0x4fce('0x8a')]();break;case _0x4fce('0xb4'):_0x71e4a9=squel[_0x4fce('0xa1')]()[_0x4fce('0xa2')](_0x4fce('0xb2'))['fromQuery']([_0x4fce('0xa4'),'scheduledAt',_0x4fce('0xa6'),'ListId','VoiceQueueId',_0x4fce('0x61'),_0x4fce('0x62')],squel['select']()[_0x4fce('0x82')](_0x4fce('0xa4'),_0x4fce('0xa4'))[_0x4fce('0x82')](_0x4fce('0xa9'),'scheduledAt')[_0x4fce('0x82')]('id',_0x4fce('0xa6'))[_0x4fce('0x82')](_0x44ca9b[_0x4fce('0xaa')]['toString'](),_0x4fce('0xa7'))[_0x4fce('0x82')](_0x3b08f3[_0x4fce('0x55')]['id'][_0x4fce('0x8a')](),'VoiceQueueId')[_0x4fce('0x82')]('NOW()','createdAt')[_0x4fce('0x82')](_0x4fce('0xa9'),_0x4fce('0x62'))['from'](_0x4fce('0xab'))[_0x4fce('0x4b')](_0x4fce('0xac'))[_0x4fce('0x4b')](_0x4fce('0xad'),_0x44ca9b[_0x4fce('0xaa')][_0x4fce('0x8a')]())[_0x4fce('0x4b')]('phone\x20IS\x20NOT\x20NULL')[_0x4fce('0x4b')](_0x4fce('0xb0'),squel['select']()['field'](_0x4fce('0xb1'))[_0x4fce('0x84')]('cm_hopper')[_0x4fce('0x4b')](_0x4fce('0xb3'),_0x3b08f3['params']['id'][_0x4fce('0x8a')]())))[_0x4fce('0x8a')]();break;default:_0x71e4a9=squel[_0x4fce('0xa1')]()[_0x4fce('0xa2')](_0x4fce('0xb2'))[_0x4fce('0xa3')]([_0x4fce('0xa4'),_0x4fce('0xa5'),_0x4fce('0xa6'),_0x4fce('0xa7'),'VoiceQueueId',_0x4fce('0x61'),_0x4fce('0x62')],squel[_0x4fce('0xa8')]()[_0x4fce('0x82')](_0x4fce('0xa4'),_0x4fce('0xa4'))[_0x4fce('0x82')]('NOW()',_0x4fce('0xa5'))['field']('id',_0x4fce('0xa6'))[_0x4fce('0x82')](_0x44ca9b['CmListId'][_0x4fce('0x8a')](),_0x4fce('0xa7'))[_0x4fce('0x82')](_0x3b08f3[_0x4fce('0x55')]['id'][_0x4fce('0x8a')](),'VoiceQueueId')[_0x4fce('0x82')](_0x4fce('0xa9'),_0x4fce('0x61'))[_0x4fce('0x82')](_0x4fce('0xa9'),_0x4fce('0x62'))[_0x4fce('0x84')]('cm_contacts')[_0x4fce('0x4b')]('deletedAt\x20IS\x20NULL')[_0x4fce('0x4b')](_0x4fce('0xad'),_0x44ca9b['CmListId'][_0x4fce('0x8a')]())[_0x4fce('0x4b')](_0x4fce('0xae')))['toString']();}_0xcf84['push'](db[_0x4fce('0x79')][_0x4fce('0x42')](_0x71e4a9));}return BPromise[_0x4fce('0x8f')](_0xcf84);}})[_0x4fce('0x2a')](function(){return _0x9d3e9;})['then'](respondWithResult(_0x1a24d,null))['catch'](handleError(_0x1a24d,null));};exports['removeLists']=function(_0xdd88,_0x2d8db7,_0x2a9f76){return db['VoiceQueue'][_0x4fce('0x36')]({'where':{'id':_0xdd88[_0x4fce('0x55')]['id']}})['then'](handleEntityNotFound(_0x2d8db7,null))['then'](function(_0x232a52){if(_0x232a52){return _0x232a52['removeLists'](_0xdd88[_0x4fce('0x42')][_0x4fce('0x92')]);}})[_0x4fce('0x2a')](function(_0x1a662d){if(_0x1a662d){return db['CmHopper'][_0x4fce('0x2b')]({'where':{'ListId':_0xdd88[_0x4fce('0x42')]['ids'],'VoiceQueueId':_0xdd88['params']['id']}})[_0x4fce('0x2a')](function(){return _0x1a662d;});}})[_0x4fce('0x2a')](respondWithStatusCode(_0x2d8db7,null))[_0x4fce('0x53')](handleError(_0x2d8db7,null));};exports['getBlackLists']=function(_0x18e238,_0x56e89c,_0x5e6e70){var _0x2b4fbd={};var _0x2ed253={};var _0x37738d;var _0x185f7a;return db['VoiceQueue'][_0x4fce('0x65')]({'where':{'id':_0x18e238[_0x4fce('0x55')]['id']}})['then'](handleEntityNotFound(_0x56e89c,null))[_0x4fce('0x2a')](function(_0x2d9740){if(_0x2d9740){_0x37738d=_0x2d9740;_0x2ed253[_0x4fce('0x41')]=_['keys'](db[_0x4fce('0x9c')][_0x4fce('0x5f')]);_0x2ed253[_0x4fce('0x42')]=_[_0x4fce('0x43')](_0x18e238[_0x4fce('0x42')]);_0x2ed253[_0x4fce('0x44')]=_[_0x4fce('0x45')](_0x2ed253[_0x4fce('0x41')],_0x2ed253[_0x4fce('0x42')]);_0x2b4fbd[_0x4fce('0x46')]=_[_0x4fce('0x45')](_0x2ed253[_0x4fce('0x41')],qs[_0x4fce('0x56')](_0x18e238['query']['fields']));_0x2b4fbd['attributes']=_0x2b4fbd['attributes']['length']?_0x2b4fbd[_0x4fce('0x46')]:_0x2ed253[_0x4fce('0x41')];_0x2b4fbd[_0x4fce('0x49')]=qs[_0x4fce('0x4a')](_0x18e238['query'][_0x4fce('0x4a')]);_0x2b4fbd[_0x4fce('0x4b')]=qs[_0x4fce('0x44')](_[_0x4fce('0x4c')](_0x18e238[_0x4fce('0x42')],_0x2ed253['filters']));if(_0x18e238[_0x4fce('0x42')]['filter']){_0x2b4fbd[_0x4fce('0x4b')]=_[_0x4fce('0x4d')](_0x2b4fbd[_0x4fce('0x4b')],{'$or':_[_0x4fce('0x3d')](_0x2b4fbd['attributes'],function(_0x567230){var _0x4a99d1={};_0x4a99d1[_0x567230]={'$like':'%'+_0x18e238[_0x4fce('0x42')]['filter']+'%'};return _0x4a99d1;})});}_0x2b4fbd=_['merge']({},_0x2b4fbd,_0x18e238[_0x4fce('0x4f')]);return _0x37738d[_0x4fce('0xb5')](_0x2b4fbd);}})[_0x4fce('0x2a')](function(_0x16159f){if(_0x16159f){_0x185f7a=_0x16159f[_0x4fce('0x47')];if(!_0x18e238[_0x4fce('0x42')]['hasOwnProperty'](_0x4fce('0x66'))){_0x2b4fbd[_0x4fce('0x23')]=qs[_0x4fce('0x23')](_0x18e238[_0x4fce('0x42')][_0x4fce('0x23')]);_0x2b4fbd['offset']=qs[_0x4fce('0x21')](_0x18e238[_0x4fce('0x42')][_0x4fce('0x21')]);}return _0x37738d[_0x4fce('0xb5')](_0x2b4fbd);}})['then'](function(_0x35be04){if(_0x35be04){return _0x35be04?{'count':_0x185f7a,'rows':_0x35be04}:null;}})[_0x4fce('0x2a')](respondWithResult(_0x56e89c,null))['catch'](handleError(_0x56e89c,null));};exports[_0x4fce('0xb6')]=function(_0x54f74c,_0x275e43,_0x152f8a){var _0x4ed721,_0x5d0955;return db[_0x4fce('0x3e')][_0x4fce('0x36')]({'where':{'id':_0x54f74c[_0x4fce('0x55')]['id']}})['then'](handleEntityNotFound(_0x275e43,null))[_0x4fce('0x2a')](function(_0x3ecd70){if(_0x3ecd70){_0x5d0955=_0x3ecd70;return _0x3ecd70[_0x4fce('0xb6')](_0x54f74c[_0x4fce('0x58')][_0x4fce('0x92')],_[_0x4fce('0x60')](_0x54f74c[_0x4fce('0x58')],['ids','id'])||{});}return null;})[_0x4fce('0x9e')](function(_0x41c91a){var _0x6c3f11;_0x4ed721=_0x41c91a||[];var _0x31b782=[];if(_0x41c91a){for(var _0x5813b1=0x0;_0x5813b1<_0x41c91a[_0x4fce('0x47')];_0x5813b1+=0x1){var _0x26affd=_0x41c91a[_0x5813b1][_0x4fce('0x2c')]({'plain':!![]});_0x6c3f11=squel[_0x4fce('0xa1')]()[_0x4fce('0xa2')](_0x4fce('0xb7'))[_0x4fce('0xa3')]([_0x4fce('0xa4'),_0x4fce('0xa6'),_0x4fce('0xa7'),'VoiceQueueId',_0x4fce('0x61'),_0x4fce('0x62')],squel[_0x4fce('0xa8')]()[_0x4fce('0x82')]('phone',_0x4fce('0xa4'))[_0x4fce('0x82')]('id',_0x4fce('0xa6'))['field'](_0x26affd['CmListId'][_0x4fce('0x8a')](),_0x4fce('0xa7'))['field'](_0x54f74c[_0x4fce('0x55')]['id']['toString'](),'VoiceQueueId')[_0x4fce('0x82')](_0x4fce('0xa9'),_0x4fce('0x61'))[_0x4fce('0x82')]('NOW()',_0x4fce('0x62'))[_0x4fce('0x84')](_0x4fce('0xab'))[_0x4fce('0x4b')](_0x4fce('0xac'))[_0x4fce('0x4b')]('ListId\x20=\x20?',_0x26affd[_0x4fce('0xaa')][_0x4fce('0x8a')]())[_0x4fce('0x4b')](_0x4fce('0xae')))[_0x4fce('0x8a')]();_0x31b782[_0x4fce('0x89')](db[_0x4fce('0x79')]['query'](_0x6c3f11));}return BPromise['all'](_0x31b782);}})[_0x4fce('0x2a')](function(){return _0x4ed721;})[_0x4fce('0x2a')](respondWithResult(_0x275e43,null))[_0x4fce('0x53')](handleError(_0x275e43,null));};exports['removeBlackLists']=function(_0x36badf,_0x4abf17,_0xc2f49d){return db['VoiceQueue'][_0x4fce('0x36')]({'where':{'id':_0x36badf[_0x4fce('0x55')]['id']}})[_0x4fce('0x2a')](handleEntityNotFound(_0x4abf17,null))[_0x4fce('0x2a')](function(_0x391d37){if(_0x391d37){return _0x391d37['removeBlackLists'](_0x36badf[_0x4fce('0x42')][_0x4fce('0x92')]);}})[_0x4fce('0x2a')](function(_0x15103a){if(_0x15103a){return db[_0x4fce('0x6e')][_0x4fce('0x2b')]({'where':{'ListId':_0x36badf[_0x4fce('0x42')][_0x4fce('0x92')],'VoiceQueueId':_0x36badf[_0x4fce('0x55')]['id']}})[_0x4fce('0x2a')](function(){return _0x15103a;});}})['then'](respondWithStatusCode(_0x4abf17,null))[_0x4fce('0x53')](handleError(_0x4abf17,null));};
\ No newline at end of file
index 4b48504..abf3d5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cc4=['save','update','remove','emit','hasOwnProperty','hook','exports','VoiceQueue','setMaxListeners'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7cc4,0x193));var _0x47cc=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x7cc4[_0x5783f4];return _0x28e380;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x47cc('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x47cc('0x1')](0x0);var events={'afterCreate':_0x47cc('0x2'),'afterUpdate':_0x47cc('0x3'),'afterDestroy':_0x47cc('0x4')};function emitEvent(_0x226464){return function(_0x3b4f48,_0x476549,_0x5b556d){VoiceQueueEvents[_0x47cc('0x5')](_0x226464+':'+_0x3b4f48['id'],_0x3b4f48);VoiceQueueEvents[_0x47cc('0x5')](_0x226464,_0x3b4f48);_0x5b556d(null);};}for(var e in events){if(events[_0x47cc('0x6')](e)){var event=events[e];VoiceQueue[_0x47cc('0x7')](e,emitEvent(event));}}module[_0x47cc('0x8')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xe504=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','save'];(function(_0x4080dd,_0x5b595d){var _0x4ecf85=function(_0x5d281a){while(--_0x5d281a){_0x4080dd['push'](_0x4080dd['shift']());}};_0x4ecf85(++_0x5b595d);}(_0xe504,0x9c));var _0x4e50=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe504[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x4e50('0x0'));var VoiceQueue=require(_0x4e50('0x1'))['db'][_0x4e50('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4e50('0x3'),'afterUpdate':_0x4e50('0x4'),'afterDestroy':_0x4e50('0x5')};function emitEvent(_0x4407dc){return function(_0x466fb6,_0x24a2c5,_0x4e4318){VoiceQueueEvents['emit'](_0x4407dc+':'+_0x466fb6['id'],_0x466fb6);VoiceQueueEvents[_0x4e50('0x6')](_0x4407dc,_0x466fb6);_0x4e4318(null);};}for(var e in events){if(events[_0x4e50('0x7')](e)){var event=events[e];VoiceQueue[_0x4e50('0x8')](e,emitEvent(event));}}module[_0x4e50('0x9')]=VoiceQueueEvents;
\ No newline at end of file
index 1fd8425..54dab21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0xb12353,_0x59d405){var _0x4b9050=function(_0xe1e8d5){while(--_0xe1e8d5){_0xb12353['push'](_0xb12353['shift']());}};_0x4b9050(++_0x59d405);}(_0xedd9,0xfc));var _0x9edd=function(_0x573f68,_0x53b746){_0x573f68=_0x573f68-0x0;var _0x25e8e6=_0xedd9[_0x573f68];return _0x25e8e6;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x70e0,0x17b));var _0x070e=function(_0x404f1d,_0x4655eb){_0x404f1d=_0x404f1d-0x0;var _0x15603c=_0x70e0[_0x404f1d];return _0x15603c;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c49194f..9ca57f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00c6=['register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','include','map','model','stringify','catch','find','where','ShowVoiceQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0xbae274,_0x1f093a){var _0x6331ab=function(_0xecc923){while(--_0xecc923){_0xbae274['push'](_0xbae274['shift']());}};_0x6331ab(++_0x1f093a);}(_0x00c6,0x6d));var _0x600c=function(_0x4b11f8,_0x5c5028){_0x4b11f8=_0x4b11f8-0x0;var _0x299123=_0x00c6[_0x4b11f8];return _0x299123;};'use strict';var _=require(_0x600c('0x0'));var util=require(_0x600c('0x1'));var moment=require(_0x600c('0x2'));var BPromise=require(_0x600c('0x3'));var rs=require(_0x600c('0x4'));var fs=require('fs');var Redis=require(_0x600c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x600c('0x6'));var logger=require('../../config/logger')(_0x600c('0x7'));var config=require(_0x600c('0x8'));var jayson=require(_0x600c('0x9'));var client=jayson[_0x600c('0xa')]['http']({'port':0x232a});config[_0x600c('0xb')]=_[_0x600c('0xc')](config[_0x600c('0xb')],{'host':_0x600c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x600c('0xb')]));require('./voiceQueue.socket')[_0x600c('0xe')](socket);function respondWithRpcPromise(_0x12950e,_0x216b6b,_0x337b95){return new BPromise(function(_0x1b342a,_0x1ac9c0){return client[_0x600c('0xf')](_0x12950e,_0x337b95)[_0x600c('0x10')](function(_0x4954b1){logger[_0x600c('0x11')](_0x600c('0x12'),_0x216b6b,_0x600c('0x13'));logger[_0x600c('0x14')](_0x600c('0x15'),_0x216b6b,_0x600c('0x13'),JSON['stringify'](_0x4954b1));if(_0x4954b1[_0x600c('0x16')]){if(_0x4954b1['error'][_0x600c('0x17')]===0x1f4){logger[_0x600c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x216b6b,_0x4954b1[_0x600c('0x16')][_0x600c('0x18')]);return _0x1ac9c0(_0x4954b1[_0x600c('0x16')][_0x600c('0x18')]);}logger[_0x600c('0x16')](_0x600c('0x12'),_0x216b6b,_0x4954b1['error'][_0x600c('0x18')]);return _0x1b342a(_0x4954b1[_0x600c('0x16')]['message']);}else{logger[_0x600c('0x11')](_0x600c('0x12'),_0x216b6b,_0x600c('0x13'));_0x1b342a(_0x4954b1[_0x600c('0x19')][_0x600c('0x18')]);}})['catch'](function(_0x24dde1){logger[_0x600c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x216b6b,_0x24dde1);_0x1ac9c0(_0x24dde1);});});}exports[_0x600c('0x1a')]=function(_0x16a993){var _0x398787=this;return new Promise(function(_0x4842c7,_0x28e703){return db[_0x600c('0x1b')][_0x600c('0x1c')]({'raw':_0x16a993[_0x600c('0x1d')]?_0x16a993[_0x600c('0x1d')][_0x600c('0x1e')]===undefined?!![]:![]:!![],'where':_0x16a993[_0x600c('0x1d')]?_0x16a993[_0x600c('0x1d')]['where']||null:null,'attributes':_0x16a993[_0x600c('0x1d')]?_0x16a993[_0x600c('0x1d')][_0x600c('0x1f')]||null:null,'limit':_0x16a993[_0x600c('0x1d')]?_0x16a993[_0x600c('0x1d')][_0x600c('0x20')]||null:null,'include':_0x16a993[_0x600c('0x1d')]?_0x16a993[_0x600c('0x1d')][_0x600c('0x21')]?_[_0x600c('0x22')](_0x16a993[_0x600c('0x1d')][_0x600c('0x21')],function(_0x427d51){return{'model':db[_0x427d51[_0x600c('0x23')]],'as':_0x427d51['as'],'attributes':_0x427d51[_0x600c('0x1f')],'include':_0x427d51[_0x600c('0x21')]?_[_0x600c('0x22')](_0x427d51['include'],function(_0x54bae0){return{'model':db[_0x54bae0['model']],'as':_0x54bae0['as'],'attributes':_0x54bae0[_0x600c('0x1f')],'include':_0x54bae0['include']?_['map'](_0x54bae0[_0x600c('0x21')],function(_0x592c22){return{'model':db[_0x592c22[_0x600c('0x23')]],'as':_0x592c22['as'],'attributes':_0x592c22['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xa6ae50){logger['info']('GetVoiceQueue',_0x16a993);logger[_0x600c('0x14')](_0x600c('0x1a'),_0x16a993,JSON[_0x600c('0x24')](_0xa6ae50));_0x4842c7(_0xa6ae50);})[_0x600c('0x25')](function(_0x53e00d){logger[_0x600c('0x16')](_0x600c('0x1a'),_0x53e00d[_0x600c('0x18')],_0x16a993);_0x28e703(_0x398787[_0x600c('0x16')](0x1f4,_0x53e00d[_0x600c('0x18')]));});});};exports['ShowVoiceQueue']=function(_0xc5b8ef){var _0x2feac0=this;return new Promise(function(_0x3ebe11,_0x48647a){return db[_0x600c('0x1b')][_0x600c('0x26')]({'raw':_0xc5b8ef[_0x600c('0x1d')]?_0xc5b8ef[_0x600c('0x1d')][_0x600c('0x1e')]===undefined?!![]:![]:!![],'where':_0xc5b8ef[_0x600c('0x1d')]?_0xc5b8ef[_0x600c('0x1d')][_0x600c('0x27')]||null:null,'attributes':_0xc5b8ef[_0x600c('0x1d')]?_0xc5b8ef[_0x600c('0x1d')][_0x600c('0x1f')]||null:null,'include':_0xc5b8ef[_0x600c('0x1d')]?_0xc5b8ef['options'][_0x600c('0x21')]?_['map'](_0xc5b8ef[_0x600c('0x1d')][_0x600c('0x21')],function(_0x5a2229){return{'model':db[_0x5a2229['model']],'as':_0x5a2229['as'],'attributes':_0x5a2229[_0x600c('0x1f')],'include':_0x5a2229['include']?_[_0x600c('0x22')](_0x5a2229[_0x600c('0x21')],function(_0x5801a3){return{'model':db[_0x5801a3[_0x600c('0x23')]],'as':_0x5801a3['as'],'attributes':_0x5801a3[_0x600c('0x1f')],'include':_0x5801a3['include']?_[_0x600c('0x22')](_0x5801a3[_0x600c('0x21')],function(_0x4b663c){return{'model':db[_0x4b663c[_0x600c('0x23')]],'as':_0x4b663c['as'],'attributes':_0x4b663c[_0x600c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x175c15){logger[_0x600c('0x11')](_0x600c('0x28'),_0xc5b8ef);logger[_0x600c('0x14')]('ShowVoiceQueue',_0xc5b8ef,JSON['stringify'](_0x175c15));_0x3ebe11(_0x175c15);})[_0x600c('0x25')](function(_0x5a73fa){logger[_0x600c('0x16')](_0x600c('0x28'),_0x5a73fa[_0x600c('0x18')],_0xc5b8ef);_0x48647a(_0x2feac0[_0x600c('0x16')](0x1f4,_0x5a73fa['message']));});});};
\ No newline at end of file
+var _0x30f2=['VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','limit','include','model','map','find','raw','ShowVoiceQueue','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','redis','defaults','./voiceQueue.socket','register','then','info'];(function(_0x418803,_0x2f8e13){var _0x43850a=function(_0x42b3e9){while(--_0x42b3e9){_0x418803['push'](_0x418803['shift']());}};_0x43850a(++_0x2f8e13);}(_0x30f2,0xf5));var _0x230f=function(_0xdba3a,_0x460d06){_0xdba3a=_0xdba3a-0x0;var _0x52556b=_0x30f2[_0xdba3a];return _0x52556b;};'use strict';var _=require(_0x230f('0x0'));var util=require(_0x230f('0x1'));var moment=require('moment');var BPromise=require(_0x230f('0x2'));var rs=require(_0x230f('0x3'));var fs=require('fs');var Redis=require(_0x230f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x230f('0x5'));var logger=require(_0x230f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x230f('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x230f('0x8')]=_[_0x230f('0x9')](config[_0x230f('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x230f('0x8')]));require(_0x230f('0xa'))[_0x230f('0xb')](socket);function respondWithRpcPromise(_0x5eae0b,_0x285eee,_0x61b804){return new BPromise(function(_0x363392,_0x856abd){return client['request'](_0x5eae0b,_0x61b804)[_0x230f('0xc')](function(_0xbdc072){logger[_0x230f('0xd')](_0x230f('0xe'),_0x285eee,_0x230f('0xf'));logger['debug'](_0x230f('0x10'),_0x285eee,'request\x20sent',JSON[_0x230f('0x11')](_0xbdc072));if(_0xbdc072[_0x230f('0x12')]){if(_0xbdc072[_0x230f('0x12')][_0x230f('0x13')]===0x1f4){logger[_0x230f('0x12')](_0x230f('0xe'),_0x285eee,_0xbdc072['error']['message']);return _0x856abd(_0xbdc072[_0x230f('0x12')][_0x230f('0x14')]);}logger[_0x230f('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x285eee,_0xbdc072[_0x230f('0x12')][_0x230f('0x14')]);return _0x363392(_0xbdc072[_0x230f('0x12')]['message']);}else{logger[_0x230f('0xd')]('VoiceQueue,\x20%s,\x20%s',_0x285eee,_0x230f('0xf'));_0x363392(_0xbdc072[_0x230f('0x15')][_0x230f('0x14')]);}})[_0x230f('0x16')](function(_0x482653){logger[_0x230f('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x285eee,_0x482653);_0x856abd(_0x482653);});});}exports[_0x230f('0x17')]=function(_0x555440){var _0x653860=this;return new Promise(function(_0x481946,_0x4ad545){return db[_0x230f('0x18')][_0x230f('0x19')]({'raw':_0x555440['options']?_0x555440[_0x230f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x555440['options']?_0x555440[_0x230f('0x1a')][_0x230f('0x1b')]||null:null,'attributes':_0x555440[_0x230f('0x1a')]?_0x555440['options'][_0x230f('0x1c')]||null:null,'limit':_0x555440[_0x230f('0x1a')]?_0x555440[_0x230f('0x1a')][_0x230f('0x1d')]||null:null,'include':_0x555440[_0x230f('0x1a')]?_0x555440[_0x230f('0x1a')][_0x230f('0x1e')]?_['map'](_0x555440[_0x230f('0x1a')][_0x230f('0x1e')],function(_0x19d1aa){return{'model':db[_0x19d1aa[_0x230f('0x1f')]],'as':_0x19d1aa['as'],'attributes':_0x19d1aa[_0x230f('0x1c')],'include':_0x19d1aa['include']?_['map'](_0x19d1aa[_0x230f('0x1e')],function(_0x14e6da){return{'model':db[_0x14e6da[_0x230f('0x1f')]],'as':_0x14e6da['as'],'attributes':_0x14e6da['attributes'],'include':_0x14e6da[_0x230f('0x1e')]?_[_0x230f('0x20')](_0x14e6da[_0x230f('0x1e')],function(_0x333bbe){return{'model':db[_0x333bbe['model']],'as':_0x333bbe['as'],'attributes':_0x333bbe[_0x230f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x230f('0xc')](function(_0x5ec145){logger[_0x230f('0xd')]('GetVoiceQueue',_0x555440);logger['debug']('GetVoiceQueue',_0x555440,JSON[_0x230f('0x11')](_0x5ec145));_0x481946(_0x5ec145);})['catch'](function(_0x329cab){logger[_0x230f('0x12')](_0x230f('0x17'),_0x329cab[_0x230f('0x14')],_0x555440);_0x4ad545(_0x653860[_0x230f('0x12')](0x1f4,_0x329cab[_0x230f('0x14')]));});});};exports['ShowVoiceQueue']=function(_0x39ace0){var _0x13bd00=this;return new Promise(function(_0x4a7d50,_0x598d96){return db[_0x230f('0x18')][_0x230f('0x21')]({'raw':_0x39ace0[_0x230f('0x1a')]?_0x39ace0[_0x230f('0x1a')][_0x230f('0x22')]===undefined?!![]:![]:!![],'where':_0x39ace0[_0x230f('0x1a')]?_0x39ace0[_0x230f('0x1a')][_0x230f('0x1b')]||null:null,'attributes':_0x39ace0[_0x230f('0x1a')]?_0x39ace0[_0x230f('0x1a')][_0x230f('0x1c')]||null:null,'include':_0x39ace0['options']?_0x39ace0[_0x230f('0x1a')]['include']?_[_0x230f('0x20')](_0x39ace0['options']['include'],function(_0x293fd1){return{'model':db[_0x293fd1['model']],'as':_0x293fd1['as'],'attributes':_0x293fd1[_0x230f('0x1c')],'include':_0x293fd1[_0x230f('0x1e')]?_['map'](_0x293fd1[_0x230f('0x1e')],function(_0x3bb954){return{'model':db[_0x3bb954[_0x230f('0x1f')]],'as':_0x3bb954['as'],'attributes':_0x3bb954[_0x230f('0x1c')],'include':_0x3bb954[_0x230f('0x1e')]?_[_0x230f('0x20')](_0x3bb954['include'],function(_0x3a7e4c){return{'model':db[_0x3a7e4c[_0x230f('0x1f')]],'as':_0x3a7e4c['as'],'attributes':_0x3a7e4c[_0x230f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x230f('0xc')](function(_0x2a135d){logger[_0x230f('0xd')](_0x230f('0x23'),_0x39ace0);logger[_0x230f('0x24')](_0x230f('0x23'),_0x39ace0,JSON[_0x230f('0x11')](_0x2a135d));_0x4a7d50(_0x2a135d);})[_0x230f('0x16')](function(_0x9635){logger[_0x230f('0x12')](_0x230f('0x23'),_0x9635[_0x230f('0x14')],_0x39ace0);_0x598d96(_0x13bd00[_0x230f('0x12')](0x1f4,_0x9635[_0x230f('0x14')]));});});};
\ No newline at end of file
index 43f7a53..14fd0fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f52=['./voiceQueue.events','save','remove','emit','removeListener','register','length','voiceQueue:'];(function(_0x551d3b,_0x35c2cb){var _0x3a7250=function(_0x159ff3){while(--_0x159ff3){_0x551d3b['push'](_0x551d3b['shift']());}};_0x3a7250(++_0x35c2cb);}(_0x4f52,0xd0));var _0x24f5=function(_0x5f103e,_0x2825e6){_0x5f103e=_0x5f103e-0x0;var _0x431325=_0x4f52[_0x5f103e];return _0x431325;};'use strict';var VoiceQueueEvents=require(_0x24f5('0x0'));var events=[_0x24f5('0x1'),_0x24f5('0x2'),'update'];function createListener(_0x2dd4e2,_0xdfc1f8){return function(_0x180b32){_0xdfc1f8[_0x24f5('0x3')](_0x2dd4e2,_0x180b32);};}function removeListener(_0x457b5b,_0x45ebe8){return function(){VoiceQueueEvents[_0x24f5('0x4')](_0x457b5b,_0x45ebe8);};}exports[_0x24f5('0x5')]=function(_0x521ebe){for(var _0x1c35a8=0x0,_0x280608=events[_0x24f5('0x6')];_0x1c35a8<_0x280608;_0x1c35a8++){var _0x3484fc=events[_0x1c35a8];var _0x2cbe75=createListener(_0x24f5('0x7')+_0x3484fc,_0x521ebe);VoiceQueueEvents['on'](_0x3484fc,_0x2cbe75);}};
\ No newline at end of file
+var _0xe8c1=['save','remove','update','length','voiceQueue:'];(function(_0x46c0f7,_0x4a14f6){var _0x2a3dbd=function(_0xce8100){while(--_0xce8100){_0x46c0f7['push'](_0x46c0f7['shift']());}};_0x2a3dbd(++_0x4a14f6);}(_0xe8c1,0x69));var _0x1e8c=function(_0x57474e,_0x4178b8){_0x57474e=_0x57474e-0x0;var _0xfaae8c=_0xe8c1[_0x57474e];return _0xfaae8c;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x1e8c('0x0'),_0x1e8c('0x1'),_0x1e8c('0x2')];function createListener(_0x143c8b,_0xb0c12d){return function(_0x28d3b8){_0xb0c12d['emit'](_0x143c8b,_0x28d3b8);};}function removeListener(_0x2501b3,_0x3d1611){return function(){VoiceQueueEvents['removeListener'](_0x2501b3,_0x3d1611);};}exports['register']=function(_0x215dd3){for(var _0x51bc9b=0x0,_0x5518bd=events[_0x1e8c('0x3')];_0x51bc9b<_0x5518bd;_0x51bc9b++){var _0x29ac7a=events[_0x51bc9b];var _0x1745f0=createListener(_0x1e8c('0x4')+_0x29ac7a,_0x215dd3);VoiceQueueEvents['on'](_0x29ac7a,_0x1745f0);}};
\ No newline at end of file
index 5247a25..4c78464 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f1a=['./voiceQueueReport.controller','get','isAuthenticated','index','describe','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x4d82ca,_0xff3dbd){var _0xfb956c=function(_0x1f6c77){while(--_0x1f6c77){_0x4d82ca['push'](_0x4d82ca['shift']());}};_0xfb956c(++_0xff3dbd);}(_0x7f1a,0x1f2));var _0xa7f1=function(_0x3badf4,_0x1d6d4f){_0x3badf4=_0x3badf4-0x0;var _0x51c675=_0x7f1a[_0x3badf4];return _0x51c675;};'use strict';var multer=require(_0xa7f1('0x0'));var util=require(_0xa7f1('0x1'));var path=require(_0xa7f1('0x2'));var timeout=require(_0xa7f1('0x3'));var express=require(_0xa7f1('0x4'));var router=express[_0xa7f1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa7f1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa7f1('0x7'));var controller=require(_0xa7f1('0x8'));router[_0xa7f1('0x9')]('/',auth[_0xa7f1('0xa')](),controller[_0xa7f1('0xb')]);router['get']('/describe',auth[_0xa7f1('0xa')](),controller[_0xa7f1('0xc')]);router[_0xa7f1('0x9')]('/index',auth[_0xa7f1('0xa')](),controller[_0xa7f1('0xd')]);router[_0xa7f1('0x9')](_0xa7f1('0xe'),auth['isAuthenticated'](),controller[_0xa7f1('0xf')]);router[_0xa7f1('0x10')]('/',auth[_0xa7f1('0xa')](),controller[_0xa7f1('0x11')]);router[_0xa7f1('0x12')]('/:id',auth[_0xa7f1('0xa')](),controller[_0xa7f1('0x13')]);router[_0xa7f1('0x14')](_0xa7f1('0xe'),auth[_0xa7f1('0xa')](),controller[_0xa7f1('0x15')]);module[_0xa7f1('0x16')]=router;
\ No newline at end of file
+var _0x9ee5=['../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2308db,_0x2e95c9){var _0x38d5de=function(_0x553804){while(--_0x553804){_0x2308db['push'](_0x2308db['shift']());}};_0x38d5de(++_0x2e95c9);}(_0x9ee5,0x188));var _0x59ee=function(_0x3e3e6f,_0x2ee863){_0x3e3e6f=_0x3e3e6f-0x0;var _0x191cec=_0x9ee5[_0x3e3e6f];return _0x191cec;};'use strict';var multer=require(_0x59ee('0x0'));var util=require(_0x59ee('0x1'));var path=require(_0x59ee('0x2'));var timeout=require(_0x59ee('0x3'));var express=require('express');var router=express[_0x59ee('0x4')]();var fs_extra=require(_0x59ee('0x5'));var auth=require(_0x59ee('0x6'));var interaction=require(_0x59ee('0x7'));var config=require('../../config/environment');var controller=require(_0x59ee('0x8'));router[_0x59ee('0x9')]('/',auth[_0x59ee('0xa')](),controller[_0x59ee('0xb')]);router[_0x59ee('0x9')](_0x59ee('0xc'),auth['isAuthenticated'](),controller[_0x59ee('0xd')]);router[_0x59ee('0x9')](_0x59ee('0xe'),auth[_0x59ee('0xa')](),controller[_0x59ee('0xf')]);router[_0x59ee('0x9')](_0x59ee('0x10'),auth[_0x59ee('0xa')](),controller[_0x59ee('0x11')]);router['post']('/',auth[_0x59ee('0xa')](),controller['create']);router['put'](_0x59ee('0x10'),auth[_0x59ee('0xa')](),controller['update']);router[_0x59ee('0x12')]('/:id',auth[_0x59ee('0xa')](),controller[_0x59ee('0x13')]);module[_0x59ee('0x14')]=router;
\ No newline at end of file
index 3b83d32..f28ead9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6243=['queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','seconds','setDataValue'];(function(_0x2f873d,_0x2fbe2a){var _0x38aefd=function(_0x382563){while(--_0x382563){_0x2f873d['push'](_0x2f873d['shift']());}};_0x38aefd(++_0x2fbe2a);}(_0x6243,0x19a));var _0x3624=function(_0x1fbcf4,_0x6141d5){_0x1fbcf4=_0x1fbcf4-0x0;var _0x317de7=_0x6243[_0x1fbcf4];return _0x317de7;};'use strict';var Sequelize=require(_0x3624('0x0'));var moment=require(_0x3624('0x1'));module[_0x3624('0x2')]={'type':{'type':Sequelize[_0x3624('0x3')]},'uniqueid':{'type':Sequelize[_0x3624('0x3')]},'calleridnum':{'type':Sequelize[_0x3624('0x3')]},'calleridname':{'type':Sequelize[_0x3624('0x3')]},'queue':{'type':Sequelize[_0x3624('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x3624('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x3624('0x4')],'set':function(_0x4fa913){var _0x436e21=moment(_0x4fa913);var _0xf197a9=moment(this[_0x3624('0x5')](_0x3624('0x6')))[_0x3624('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x54a05e=_0x436e21['diff'](_0xf197a9,_0x3624('0x8'));this[_0x3624('0x9')](_0x3624('0xa'),_0x4fa913);this[_0x3624('0x9')](_0x3624('0xb'),_0x54a05e||null);}},'position':{'type':Sequelize[_0x3624('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x3624('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3624('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x3624('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3624('0x4')]},'queuecallerexit':{'type':Sequelize[_0x3624('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3624('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x3624('0xc')]},'channel':{'type':Sequelize[_0x3624('0x3')]},'connectedlinenum':{'type':Sequelize[_0x3624('0x3')]},'connectedlinename':{'type':Sequelize[_0x3624('0x3')]},'accountcode':{'type':Sequelize[_0x3624('0x3')]},'context':{'type':Sequelize[_0x3624('0x3')]},'exten':{'type':Sequelize[_0x3624('0x3')]},'priority':{'type':Sequelize[_0x3624('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x3624('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3624('0x3')],'comment':_0x3624('0xe')},'transferexten':{'type':Sequelize[_0x3624('0x3')]},'transferuniqueid':{'type':Sequelize[_0x3624('0x3')]},'disposition':{'type':Sequelize[_0x3624('0x3')]},'secondDisposition':{'type':Sequelize[_0x3624('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3624('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x3624('0xc')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe3c5=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x22d1ef,_0x4a5152){var _0x47c5a3=function(_0x9a2c48){while(--_0x9a2c48){_0x22d1ef['push'](_0x22d1ef['shift']());}};_0x47c5a3(++_0x4a5152);}(_0xe3c5,0x10c));var _0x5e3c=function(_0x598b6f,_0x55690f){_0x598b6f=_0x598b6f-0x0;var _0x40959f=_0xe3c5[_0x598b6f];return _0x40959f;};'use strict';var Sequelize=require(_0x5e3c('0x0'));var moment=require('moment');module[_0x5e3c('0x1')]={'type':{'type':Sequelize[_0x5e3c('0x2')]},'uniqueid':{'type':Sequelize[_0x5e3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5e3c('0x2')]},'queue':{'type':Sequelize[_0x5e3c('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x5e3c('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x5e3c('0x3')],'set':function(_0xa1c596){var _0x4c0c65=moment(_0xa1c596);var _0x386028=moment(this['getDataValue']('queuecallerjoinAt'))[_0x5e3c('0x4')](_0x5e3c('0x5'));var _0x4d80f4=_0x4c0c65['diff'](_0x386028,_0x5e3c('0x6'));this[_0x5e3c('0x7')](_0x5e3c('0x8'),_0xa1c596);this[_0x5e3c('0x7')](_0x5e3c('0x9'),_0x4d80f4||null);}},'position':{'type':Sequelize[_0x5e3c('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x5e3c('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x5e3c('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x5e3c('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x5e3c('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5e3c('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x5e3c('0x2')],'comment':_0x5e3c('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5e3c('0x2')]},'connectedlinename':{'type':Sequelize[_0x5e3c('0x2')]},'accountcode':{'type':Sequelize[_0x5e3c('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5e3c('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5e3c('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x5e3c('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5e3c('0x2')],'comment':_0x5e3c('0xd')},'transferexten':{'type':Sequelize[_0x5e3c('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5e3c('0x2')]},'secondDisposition':{'type':Sequelize[_0x5e3c('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x5e3c('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index c41856d..21e4db6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84dd=['lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','name','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','fields','find','create','body','params','pick','getVoiceQueuesReport','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x84dd,0x185));var _0xd84d=function(_0x163628,_0x5570b3){_0x163628=_0x163628-0x0;var _0x3c2efa=_0x84dd[_0x163628];return _0x3c2efa;};'use strict';var emlformat=require(_0xd84d('0x0'));var rimraf=require(_0xd84d('0x1'));var zipdir=require(_0xd84d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd84d('0x3'));var moment=require('moment');var BPromise=require(_0xd84d('0x4'));var Mustache=require(_0xd84d('0x5'));var util=require(_0xd84d('0x6'));var path=require(_0xd84d('0x7'));var sox=require(_0xd84d('0x8'));var csv=require('to-csv');var ejs=require(_0xd84d('0x9'));var fs=require('fs');var fs_extra=require(_0xd84d('0xa'));var _=require(_0xd84d('0xb'));var squel=require(_0xd84d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd84d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd84d('0xe'));var Papa=require(_0xd84d('0xf'));var Redis=require(_0xd84d('0x10'));var authService=require(_0xd84d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd84d('0x12'));var logger=require(_0xd84d('0x13'))('api');var utils=require(_0xd84d('0x14'));var config=require(_0xd84d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd84d('0x16'))['db'];config[_0xd84d('0x17')]=_[_0xd84d('0x18')](config[_0xd84d('0x17')],{'host':_0xd84d('0x19'),'port':0x18eb});var socket=require(_0xd84d('0x1a'))(new Redis(config['redis']));require(_0xd84d('0x1b'))[_0xd84d('0x1c')](socket);function respondWithStatusCode(_0x1b19bd,_0x1d6d1c){_0x1d6d1c=_0x1d6d1c||0xcc;return function(_0x219c78){if(_0x219c78){return _0x1b19bd['sendStatus'](_0x1d6d1c);}return _0x1b19bd[_0xd84d('0x1d')](_0x1d6d1c)['end']();};}function respondWithResult(_0x33649b,_0x59fd10){_0x59fd10=_0x59fd10||0xc8;return function(_0x18cc9b){if(_0x18cc9b){return _0x33649b[_0xd84d('0x1d')](_0x59fd10)[_0xd84d('0x1e')](_0x18cc9b);}};}function respondWithFilteredResult(_0x2717d4,_0x2f4eb9){return function(_0x58181c){if(_0x58181c){var _0x8cab30=typeof _0x2f4eb9[_0xd84d('0x1f')]===_0xd84d('0x20')&&typeof _0x2f4eb9[_0xd84d('0x21')]===_0xd84d('0x20');var _0x1675fc=_0x58181c['count'];var _0x24efa0=_0x8cab30?0x0:_0x2f4eb9[_0xd84d('0x1f')];var _0x18f7f8=_0x8cab30?_0x58181c['count']:_0x2f4eb9[_0xd84d('0x1f')]+_0x2f4eb9[_0xd84d('0x21')];var _0x423048;if(_0x18f7f8>=_0x1675fc){_0x18f7f8=_0x1675fc;_0x423048=0xc8;}else{_0x423048=0xce;}_0x2717d4[_0xd84d('0x1d')](_0x423048);return _0x2717d4[_0xd84d('0x22')](_0xd84d('0x23'),_0x24efa0+'-'+_0x18f7f8+'/'+_0x1675fc)['json'](_0x58181c);}return null;};}function patchUpdates(_0x32fd01){return function(_0x52aadb){try{jsonpatch[_0xd84d('0x24')](_0x52aadb,_0x32fd01,!![]);}catch(_0x190915){return BPromise[_0xd84d('0x25')](_0x190915);}return _0x52aadb['save']();};}function saveUpdates(_0x57f850,_0x4ee9fc){return function(_0x3c3d9d){if(_0x3c3d9d){return _0x3c3d9d[_0xd84d('0x26')](_0x57f850)[_0xd84d('0x27')](function(_0x37adc1){return _0x37adc1;});}return null;};}function removeEntity(_0x344ee1,_0x280881){return function(_0x2ccfe8){if(_0x2ccfe8){return _0x2ccfe8[_0xd84d('0x28')]()[_0xd84d('0x27')](function(){_0x344ee1[_0xd84d('0x1d')](0xcc)[_0xd84d('0x29')]();});}};}function handleEntityNotFound(_0x118b6e,_0x49d142){return function(_0x5bd69f){if(!_0x5bd69f){_0x118b6e[_0xd84d('0x2a')](0x194);}return _0x5bd69f;};}function handleError(_0x33e27b,_0x2be134){_0x2be134=_0x2be134||0x1f4;return function(_0x362776){logger[_0xd84d('0x2b')](_0x362776['stack']);if(_0x362776[_0xd84d('0x2c')]){delete _0x362776[_0xd84d('0x2c')];}_0x33e27b[_0xd84d('0x1d')](_0x2be134)['send'](_0x362776);};}exports['index']=function(_0x41bbeb,_0x163fe2){var _0x11686a={},_0x201edc={},_0x406639={'count':0x0,'rows':[]};var _0x79bb69=_[_0xd84d('0x2d')](db[_0xd84d('0x2e')][_0xd84d('0x2f')],function(_0x2f5e34){return{'name':_0x2f5e34[_0xd84d('0x30')],'type':_0x2f5e34[_0xd84d('0x31')][_0xd84d('0x32')]};});_0x201edc[_0xd84d('0x33')]=_[_0xd84d('0x2d')](_0x79bb69,'name');_0x201edc[_0xd84d('0x34')]=_[_0xd84d('0x35')](_0x41bbeb[_0xd84d('0x34')]);_0x201edc[_0xd84d('0x36')]=_['intersection'](_0x201edc['model'],_0x201edc[_0xd84d('0x34')]);_0x11686a[_0xd84d('0x37')]=_[_0xd84d('0x38')](_0x201edc[_0xd84d('0x33')],qs['fields'](_0x41bbeb[_0xd84d('0x34')]['fields']));_0x11686a[_0xd84d('0x37')]=_0x11686a[_0xd84d('0x37')][_0xd84d('0x39')]?_0x11686a[_0xd84d('0x37')]:_0x201edc[_0xd84d('0x33')];if(!_0x41bbeb[_0xd84d('0x34')][_0xd84d('0x3a')](_0xd84d('0x3b'))){_0x11686a[_0xd84d('0x21')]=qs['limit'](_0x41bbeb[_0xd84d('0x34')][_0xd84d('0x21')]);_0x11686a[_0xd84d('0x1f')]=qs[_0xd84d('0x1f')](_0x41bbeb[_0xd84d('0x34')][_0xd84d('0x1f')]);}_0x11686a[_0xd84d('0x3c')]=qs[_0xd84d('0x3d')](_0x41bbeb[_0xd84d('0x34')][_0xd84d('0x3d')]);_0x11686a['where']=qs[_0xd84d('0x36')](_['pick'](_0x41bbeb[_0xd84d('0x34')],_0x201edc[_0xd84d('0x36')]),_0x79bb69);if(_0x41bbeb[_0xd84d('0x34')]['filter']){_0x11686a[_0xd84d('0x3e')]=_[_0xd84d('0x3f')](_0x11686a['where'],{'$or':_['map'](_0x79bb69,function(_0x3217e1){if(_0x3217e1[_0xd84d('0x31')]!==_0xd84d('0x40')){var _0x49d251={};_0x49d251[_0x3217e1[_0xd84d('0x2c')]]={'$like':'%'+_0x41bbeb[_0xd84d('0x34')][_0xd84d('0x41')]+'%'};return _0x49d251;}})});}_0x11686a=_[_0xd84d('0x3f')]({},_0x11686a,_0x41bbeb['options']);var _0x4387b8={'where':_0x11686a[_0xd84d('0x3e')]};return db[_0xd84d('0x2e')][_0xd84d('0x42')](_0x4387b8)[_0xd84d('0x27')](function(_0xc936c0){_0x406639[_0xd84d('0x42')]=_0xc936c0;if(_0x41bbeb['query'][_0xd84d('0x43')]){_0x11686a[_0xd84d('0x44')]=[{'all':!![]}];}return db[_0xd84d('0x2e')][_0xd84d('0x45')](_0x11686a);})[_0xd84d('0x27')](function(_0x1c2a36){_0x406639[_0xd84d('0x46')]=_0x1c2a36;return _0x406639;})[_0xd84d('0x27')](respondWithFilteredResult(_0x163fe2,_0x11686a))[_0xd84d('0x47')](handleError(_0x163fe2,null));};exports[_0xd84d('0x48')]=function(_0x52c6df,_0x1dff06){var _0x308567={'raw':![],'where':{'id':_0x52c6df['params']['id']}},_0x4cba88={};_0x4cba88[_0xd84d('0x33')]=_[_0xd84d('0x35')](db['VoiceQueueReport'][_0xd84d('0x2f')]);_0x4cba88[_0xd84d('0x34')]=_[_0xd84d('0x35')](_0x52c6df[_0xd84d('0x34')]);_0x4cba88['filters']=_[_0xd84d('0x38')](_0x4cba88[_0xd84d('0x33')],_0x4cba88['query']);_0x308567['attributes']=_['intersection'](_0x4cba88[_0xd84d('0x33')],qs[_0xd84d('0x49')](_0x52c6df[_0xd84d('0x34')][_0xd84d('0x49')]));_0x308567[_0xd84d('0x37')]=_0x308567[_0xd84d('0x37')][_0xd84d('0x39')]?_0x308567[_0xd84d('0x37')]:_0x4cba88[_0xd84d('0x33')];if(_0x52c6df[_0xd84d('0x34')][_0xd84d('0x43')]){_0x308567[_0xd84d('0x44')]=[{'all':!![]}];}_0x308567=_[_0xd84d('0x3f')]({},_0x308567,_0x52c6df['options']);return db[_0xd84d('0x2e')][_0xd84d('0x4a')](_0x308567)[_0xd84d('0x27')](handleEntityNotFound(_0x1dff06,null))[_0xd84d('0x27')](respondWithResult(_0x1dff06,null))[_0xd84d('0x47')](handleError(_0x1dff06,null));};exports[_0xd84d('0x4b')]=function(_0x250a30,_0x5ccd15){return db[_0xd84d('0x2e')][_0xd84d('0x4b')](_0x250a30['body'],{})[_0xd84d('0x27')](respondWithResult(_0x5ccd15,0xc9))[_0xd84d('0x47')](handleError(_0x5ccd15,null));};exports[_0xd84d('0x26')]=function(_0x36af8b,_0x1b1802){if(_0x36af8b[_0xd84d('0x4c')]['id']){delete _0x36af8b[_0xd84d('0x4c')]['id'];}return db[_0xd84d('0x2e')][_0xd84d('0x4a')]({'where':{'id':_0x36af8b['params']['id']}})[_0xd84d('0x27')](handleEntityNotFound(_0x1b1802,null))[_0xd84d('0x27')](saveUpdates(_0x36af8b['body'],null))[_0xd84d('0x27')](respondWithResult(_0x1b1802,null))[_0xd84d('0x47')](handleError(_0x1b1802,null));};exports['destroy']=function(_0x8a3bdc,_0x22907e){return db[_0xd84d('0x2e')]['find']({'where':{'id':_0x8a3bdc[_0xd84d('0x4d')]['id']}})[_0xd84d('0x27')](handleEntityNotFound(_0x22907e,null))['then'](removeEntity(_0x22907e,null))[_0xd84d('0x47')](handleError(_0x22907e,null));};exports['describe']=function(_0x14a562,_0x556c4b){return db['VoiceQueueReport']['describe']()[_0xd84d('0x27')](respondWithResult(_0x556c4b,null))[_0xd84d('0x47')](handleError(_0x556c4b,null));};exports['getVoiceQueuesReport']=function(_0x734645,_0x487cab){var _0x41e1cb={},_0x2d002b={},_0x59099f={'count':0x0,'rows':[]};_0x2d002b[_0xd84d('0x33')]=_[_0xd84d('0x35')](db['VoiceQueueReport'][_0xd84d('0x2f')]);_0x2d002b['query']=_[_0xd84d('0x35')](_0x734645[_0xd84d('0x34')]);_0x2d002b[_0xd84d('0x36')]=_['intersection'](_0x2d002b[_0xd84d('0x33')],_0x2d002b[_0xd84d('0x34')]);_0x41e1cb[_0xd84d('0x37')]=_['intersection'](_0x2d002b[_0xd84d('0x33')],qs[_0xd84d('0x49')](_0x734645[_0xd84d('0x34')]['fields']));_0x41e1cb['attributes']=_0x41e1cb['attributes'][_0xd84d('0x39')]?_0x41e1cb['attributes']:_0x2d002b[_0xd84d('0x33')];if(!_0x734645[_0xd84d('0x34')][_0xd84d('0x3a')]('nolimit')){_0x41e1cb[_0xd84d('0x21')]=qs[_0xd84d('0x21')](_0x734645[_0xd84d('0x34')][_0xd84d('0x21')]);_0x41e1cb[_0xd84d('0x1f')]=qs[_0xd84d('0x1f')](_0x734645[_0xd84d('0x34')][_0xd84d('0x1f')]);}_0x41e1cb['order']=qs['sort'](_0x734645[_0xd84d('0x34')][_0xd84d('0x3d')]);_0x41e1cb[_0xd84d('0x3e')]=qs['filters'](_[_0xd84d('0x4e')](_0x734645[_0xd84d('0x34')],_0x2d002b[_0xd84d('0x36')]));if(_0x734645[_0xd84d('0x34')][_0xd84d('0x41')]){_0x41e1cb[_0xd84d('0x3e')]=_[_0xd84d('0x3f')](_0x41e1cb[_0xd84d('0x3e')],{'$or':_['map'](_0x41e1cb[_0xd84d('0x37')],function(_0x1cd1f4){var _0x2849c3={};_0x2849c3[_0x1cd1f4]={'$like':'%'+_0x734645['query'][_0xd84d('0x41')]+'%'};return _0x2849c3;})});}_0x41e1cb=_['merge']({},_0x41e1cb,_0x734645['options']);var _0x46207a={'where':_0x41e1cb[_0xd84d('0x3e')]};return db[_0xd84d('0x2e')][_0xd84d('0x42')](_0x46207a)[_0xd84d('0x27')](function(_0x520363){_0x59099f[_0xd84d('0x42')]=_0x520363;if(_0x734645[_0xd84d('0x34')]['includeAll']){_0x41e1cb[_0xd84d('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xd84d('0x45')](_0x41e1cb);})[_0xd84d('0x27')](function(_0xbb0d9b){_0x59099f[_0xd84d('0x46')]=_0xbb0d9b;return _0x59099f;})[_0xd84d('0x27')](respondWithFilteredResult(_0x487cab,_0x41e1cb,_0xd84d('0x4f')))[_0xd84d('0x47')](handleError(_0x487cab,null,_0xd84d('0x4f')));};
\ No newline at end of file
+var _0x7ace=['limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','index','VoiceQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','findAll','catch','show','params','include','find','create','body','describe','options','rows','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','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','localhost','socket.io-emitter','register','status','end','offset','undefined'];(function(_0x593c6a,_0x1dba67){var _0x34d37d=function(_0x31f02d){while(--_0x31f02d){_0x593c6a['push'](_0x593c6a['shift']());}};_0x34d37d(++_0x1dba67);}(_0x7ace,0xd9));var _0xe7ac=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x7ace[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0xe7ac('0x0'));var rimraf=require(_0xe7ac('0x1'));var zipdir=require(_0xe7ac('0x2'));var jsonpatch=require(_0xe7ac('0x3'));var rp=require(_0xe7ac('0x4'));var moment=require(_0xe7ac('0x5'));var BPromise=require(_0xe7ac('0x6'));var Mustache=require(_0xe7ac('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe7ac('0x8'));var csv=require('to-csv');var ejs=require(_0xe7ac('0x9'));var fs=require('fs');var fs_extra=require(_0xe7ac('0xa'));var _=require(_0xe7ac('0xb'));var squel=require(_0xe7ac('0xc'));var crypto=require(_0xe7ac('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe7ac('0xe'));var toCsv=require(_0xe7ac('0xf'));var querystring=require(_0xe7ac('0x10'));var Papa=require('papaparse');var Redis=require(_0xe7ac('0x11'));var authService=require(_0xe7ac('0x12'));var qs=require(_0xe7ac('0x13'));var as=require(_0xe7ac('0x14'));var hardwareService=require(_0xe7ac('0x15'));var logger=require(_0xe7ac('0x16'))(_0xe7ac('0x17'));var utils=require(_0xe7ac('0x18'));var config=require(_0xe7ac('0x19'));var licenseUtil=require(_0xe7ac('0x1a'));var db=require(_0xe7ac('0x1b'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xe7ac('0x1c'),'port':0x18eb});var socket=require(_0xe7ac('0x1d'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0xe7ac('0x1e')](socket);function respondWithStatusCode(_0x24e334,_0x1a46f4){_0x1a46f4=_0x1a46f4||0xcc;return function(_0xf93f20){if(_0xf93f20){return _0x24e334['sendStatus'](_0x1a46f4);}return _0x24e334[_0xe7ac('0x1f')](_0x1a46f4)[_0xe7ac('0x20')]();};}function respondWithResult(_0x46b795,_0xa7cab4){_0xa7cab4=_0xa7cab4||0xc8;return function(_0x237e1f){if(_0x237e1f){return _0x46b795['status'](_0xa7cab4)['json'](_0x237e1f);}};}function respondWithFilteredResult(_0x3c8530,_0x2973a8){return function(_0x18f52b){if(_0x18f52b){var _0x426c95=typeof _0x2973a8[_0xe7ac('0x21')]===_0xe7ac('0x22')&&typeof _0x2973a8[_0xe7ac('0x23')]===_0xe7ac('0x22');var _0x3729e8=_0x18f52b[_0xe7ac('0x24')];var _0x8c8dcd=_0x426c95?0x0:_0x2973a8[_0xe7ac('0x21')];var _0x34e0fe=_0x426c95?_0x18f52b[_0xe7ac('0x24')]:_0x2973a8['offset']+_0x2973a8[_0xe7ac('0x23')];var _0x257cdf;if(_0x34e0fe>=_0x3729e8){_0x34e0fe=_0x3729e8;_0x257cdf=0xc8;}else{_0x257cdf=0xce;}_0x3c8530[_0xe7ac('0x1f')](_0x257cdf);return _0x3c8530[_0xe7ac('0x25')](_0xe7ac('0x26'),_0x8c8dcd+'-'+_0x34e0fe+'/'+_0x3729e8)['json'](_0x18f52b);}return null;};}function patchUpdates(_0x460e08){return function(_0x2903d2){try{jsonpatch['apply'](_0x2903d2,_0x460e08,!![]);}catch(_0x279003){return BPromise[_0xe7ac('0x27')](_0x279003);}return _0x2903d2[_0xe7ac('0x28')]();};}function saveUpdates(_0x328e1f,_0x1113bc){return function(_0x5dc57a){if(_0x5dc57a){return _0x5dc57a[_0xe7ac('0x29')](_0x328e1f)[_0xe7ac('0x2a')](function(_0x4f50b6){return _0x4f50b6;});}return null;};}function removeEntity(_0x437442,_0x581abd){return function(_0x44f2ba){if(_0x44f2ba){return _0x44f2ba[_0xe7ac('0x2b')]()[_0xe7ac('0x2a')](function(){_0x437442[_0xe7ac('0x1f')](0xcc)[_0xe7ac('0x20')]();});}};}function handleEntityNotFound(_0x2e024b,_0x4e2d49){return function(_0xac521b){if(!_0xac521b){_0x2e024b[_0xe7ac('0x2c')](0x194);}return _0xac521b;};}function handleError(_0x396efb,_0x4eb81f){_0x4eb81f=_0x4eb81f||0x1f4;return function(_0x206417){logger['error'](_0x206417[_0xe7ac('0x2d')]);if(_0x206417[_0xe7ac('0x2e')]){delete _0x206417[_0xe7ac('0x2e')];}_0x396efb[_0xe7ac('0x1f')](_0x4eb81f)['send'](_0x206417);};}exports[_0xe7ac('0x2f')]=function(_0x4bf47f,_0x3dc4e5){var _0x52b877={},_0x2d9691={},_0xd4268c={'count':0x0,'rows':[]};var _0x55f17e=_['map'](db[_0xe7ac('0x30')][_0xe7ac('0x31')],function(_0x259e57){return{'name':_0x259e57[_0xe7ac('0x32')],'type':_0x259e57['type'][_0xe7ac('0x33')]};});_0x2d9691[_0xe7ac('0x34')]=_[_0xe7ac('0x35')](_0x55f17e,_0xe7ac('0x2e'));_0x2d9691[_0xe7ac('0x36')]=_[_0xe7ac('0x37')](_0x4bf47f[_0xe7ac('0x36')]);_0x2d9691[_0xe7ac('0x38')]=_[_0xe7ac('0x39')](_0x2d9691['model'],_0x2d9691[_0xe7ac('0x36')]);_0x52b877['attributes']=_[_0xe7ac('0x39')](_0x2d9691['model'],qs[_0xe7ac('0x3a')](_0x4bf47f[_0xe7ac('0x36')][_0xe7ac('0x3a')]));_0x52b877[_0xe7ac('0x3b')]=_0x52b877[_0xe7ac('0x3b')][_0xe7ac('0x3c')]?_0x52b877['attributes']:_0x2d9691['model'];if(!_0x4bf47f[_0xe7ac('0x36')][_0xe7ac('0x3d')](_0xe7ac('0x3e'))){_0x52b877[_0xe7ac('0x23')]=qs[_0xe7ac('0x23')](_0x4bf47f[_0xe7ac('0x36')][_0xe7ac('0x23')]);_0x52b877[_0xe7ac('0x21')]=qs[_0xe7ac('0x21')](_0x4bf47f[_0xe7ac('0x36')]['offset']);}_0x52b877[_0xe7ac('0x3f')]=qs[_0xe7ac('0x40')](_0x4bf47f[_0xe7ac('0x36')][_0xe7ac('0x40')]);_0x52b877['where']=qs['filters'](_[_0xe7ac('0x41')](_0x4bf47f['query'],_0x2d9691[_0xe7ac('0x38')]),_0x55f17e);if(_0x4bf47f[_0xe7ac('0x36')][_0xe7ac('0x42')]){_0x52b877[_0xe7ac('0x43')]=_[_0xe7ac('0x44')](_0x52b877[_0xe7ac('0x43')],{'$or':_[_0xe7ac('0x35')](_0x55f17e,function(_0x30d68e){if(_0x30d68e[_0xe7ac('0x45')]!==_0xe7ac('0x46')){var _0x1b5b2d={};_0x1b5b2d[_0x30d68e['name']]={'$like':'%'+_0x4bf47f[_0xe7ac('0x36')]['filter']+'%'};return _0x1b5b2d;}})});}_0x52b877=_[_0xe7ac('0x44')]({},_0x52b877,_0x4bf47f['options']);var _0x42ff64={'where':_0x52b877[_0xe7ac('0x43')]};return db['VoiceQueueReport'][_0xe7ac('0x24')](_0x42ff64)[_0xe7ac('0x2a')](function(_0x1623dd){_0xd4268c[_0xe7ac('0x24')]=_0x1623dd;if(_0x4bf47f[_0xe7ac('0x36')][_0xe7ac('0x47')]){_0x52b877['include']=[{'all':!![]}];}return db[_0xe7ac('0x30')][_0xe7ac('0x48')](_0x52b877);})[_0xe7ac('0x2a')](function(_0x367d9f){_0xd4268c['rows']=_0x367d9f;return _0xd4268c;})[_0xe7ac('0x2a')](respondWithFilteredResult(_0x3dc4e5,_0x52b877))[_0xe7ac('0x49')](handleError(_0x3dc4e5,null));};exports[_0xe7ac('0x4a')]=function(_0x36bca1,_0x293cc5){var _0x4b0c79={'raw':![],'where':{'id':_0x36bca1[_0xe7ac('0x4b')]['id']}},_0x51d6ba={};_0x51d6ba[_0xe7ac('0x34')]=_['keys'](db[_0xe7ac('0x30')][_0xe7ac('0x31')]);_0x51d6ba['query']=_['keys'](_0x36bca1[_0xe7ac('0x36')]);_0x51d6ba[_0xe7ac('0x38')]=_[_0xe7ac('0x39')](_0x51d6ba[_0xe7ac('0x34')],_0x51d6ba[_0xe7ac('0x36')]);_0x4b0c79[_0xe7ac('0x3b')]=_[_0xe7ac('0x39')](_0x51d6ba[_0xe7ac('0x34')],qs['fields'](_0x36bca1[_0xe7ac('0x36')][_0xe7ac('0x3a')]));_0x4b0c79['attributes']=_0x4b0c79[_0xe7ac('0x3b')][_0xe7ac('0x3c')]?_0x4b0c79[_0xe7ac('0x3b')]:_0x51d6ba[_0xe7ac('0x34')];if(_0x36bca1[_0xe7ac('0x36')][_0xe7ac('0x47')]){_0x4b0c79[_0xe7ac('0x4c')]=[{'all':!![]}];}_0x4b0c79=_[_0xe7ac('0x44')]({},_0x4b0c79,_0x36bca1['options']);return db['VoiceQueueReport'][_0xe7ac('0x4d')](_0x4b0c79)[_0xe7ac('0x2a')](handleEntityNotFound(_0x293cc5,null))[_0xe7ac('0x2a')](respondWithResult(_0x293cc5,null))[_0xe7ac('0x49')](handleError(_0x293cc5,null));};exports[_0xe7ac('0x4e')]=function(_0x54a1af,_0x4d3ffb){return db[_0xe7ac('0x30')][_0xe7ac('0x4e')](_0x54a1af[_0xe7ac('0x4f')],{})[_0xe7ac('0x2a')](respondWithResult(_0x4d3ffb,0xc9))[_0xe7ac('0x49')](handleError(_0x4d3ffb,null));};exports[_0xe7ac('0x29')]=function(_0x15e554,_0x1115f6){if(_0x15e554[_0xe7ac('0x4f')]['id']){delete _0x15e554[_0xe7ac('0x4f')]['id'];}return db[_0xe7ac('0x30')][_0xe7ac('0x4d')]({'where':{'id':_0x15e554[_0xe7ac('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1115f6,null))['then'](saveUpdates(_0x15e554[_0xe7ac('0x4f')],null))['then'](respondWithResult(_0x1115f6,null))[_0xe7ac('0x49')](handleError(_0x1115f6,null));};exports[_0xe7ac('0x2b')]=function(_0x2db081,_0x544c1d){return db[_0xe7ac('0x30')][_0xe7ac('0x4d')]({'where':{'id':_0x2db081[_0xe7ac('0x4b')]['id']}})[_0xe7ac('0x2a')](handleEntityNotFound(_0x544c1d,null))[_0xe7ac('0x2a')](removeEntity(_0x544c1d,null))['catch'](handleError(_0x544c1d,null));};exports['describe']=function(_0xd77200,_0x3c8a9e){return db[_0xe7ac('0x30')][_0xe7ac('0x50')]()[_0xe7ac('0x2a')](respondWithResult(_0x3c8a9e,null))['catch'](handleError(_0x3c8a9e,null));};exports['getVoiceQueuesReport']=function(_0x158e91,_0x450b7f){var _0x1cc610={},_0x5a3aa4={},_0xbad5f9={'count':0x0,'rows':[]};_0x5a3aa4[_0xe7ac('0x34')]=_[_0xe7ac('0x37')](db[_0xe7ac('0x30')][_0xe7ac('0x31')]);_0x5a3aa4['query']=_[_0xe7ac('0x37')](_0x158e91[_0xe7ac('0x36')]);_0x5a3aa4[_0xe7ac('0x38')]=_[_0xe7ac('0x39')](_0x5a3aa4[_0xe7ac('0x34')],_0x5a3aa4[_0xe7ac('0x36')]);_0x1cc610[_0xe7ac('0x3b')]=_[_0xe7ac('0x39')](_0x5a3aa4[_0xe7ac('0x34')],qs['fields'](_0x158e91[_0xe7ac('0x36')]['fields']));_0x1cc610['attributes']=_0x1cc610[_0xe7ac('0x3b')][_0xe7ac('0x3c')]?_0x1cc610[_0xe7ac('0x3b')]:_0x5a3aa4[_0xe7ac('0x34')];if(!_0x158e91[_0xe7ac('0x36')][_0xe7ac('0x3d')](_0xe7ac('0x3e'))){_0x1cc610[_0xe7ac('0x23')]=qs[_0xe7ac('0x23')](_0x158e91[_0xe7ac('0x36')][_0xe7ac('0x23')]);_0x1cc610[_0xe7ac('0x21')]=qs[_0xe7ac('0x21')](_0x158e91[_0xe7ac('0x36')][_0xe7ac('0x21')]);}_0x1cc610['order']=qs[_0xe7ac('0x40')](_0x158e91['query'][_0xe7ac('0x40')]);_0x1cc610['where']=qs[_0xe7ac('0x38')](_[_0xe7ac('0x41')](_0x158e91[_0xe7ac('0x36')],_0x5a3aa4[_0xe7ac('0x38')]));if(_0x158e91[_0xe7ac('0x36')][_0xe7ac('0x42')]){_0x1cc610[_0xe7ac('0x43')]=_[_0xe7ac('0x44')](_0x1cc610[_0xe7ac('0x43')],{'$or':_[_0xe7ac('0x35')](_0x1cc610[_0xe7ac('0x3b')],function(_0x6af93a){var _0x4f6ae5={};_0x4f6ae5[_0x6af93a]={'$like':'%'+_0x158e91[_0xe7ac('0x36')][_0xe7ac('0x42')]+'%'};return _0x4f6ae5;})});}_0x1cc610=_[_0xe7ac('0x44')]({},_0x1cc610,_0x158e91[_0xe7ac('0x51')]);var _0x1f8743={'where':_0x1cc610[_0xe7ac('0x43')]};return db[_0xe7ac('0x30')][_0xe7ac('0x24')](_0x1f8743)[_0xe7ac('0x2a')](function(_0x14c1ef){_0xbad5f9[_0xe7ac('0x24')]=_0x14c1ef;if(_0x158e91['query'][_0xe7ac('0x47')]){_0x1cc610[_0xe7ac('0x4c')]=[{'all':!![]}];}return db[_0xe7ac('0x30')][_0xe7ac('0x48')](_0x1cc610);})['then'](function(_0x4f9b42){_0xbad5f9[_0xe7ac('0x52')]=_0x4f9b42;return _0xbad5f9;})[_0xe7ac('0x2a')](respondWithFilteredResult(_0x450b7f,_0x1cc610,_0xe7ac('0x53')))[_0xe7ac('0x49')](handleError(_0x450b7f,null,'getVoiceQueuesReport'));};
\ No newline at end of file
index eb1905c..eebe225 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3197=['update','remove','emit','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x4cbcae,_0x23037f){var _0x4127d9=function(_0xed4461){while(--_0xed4461){_0x4cbcae['push'](_0x4cbcae['shift']());}};_0x4127d9(++_0x23037f);}(_0x3197,0xeb));var _0x7319=function(_0x46b729,_0x11ec51){_0x46b729=_0x46b729-0x0;var _0x42388e=_0x3197[_0x46b729];return _0x42388e;};'use strict';var EventEmitter=require(_0x7319('0x0'));var VoiceQueueReport=require(_0x7319('0x1'))['db'][_0x7319('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7319('0x3')](0x0);var events={'afterCreate':_0x7319('0x4'),'afterUpdate':_0x7319('0x5'),'afterDestroy':_0x7319('0x6')};function emitEvent(_0x3f93a3){return function(_0x48ea13,_0xe90558,_0x4ec04b){VoiceQueueReportEvents[_0x7319('0x7')](_0x3f93a3+':'+_0x48ea13['id'],_0x48ea13);VoiceQueueReportEvents[_0x7319('0x7')](_0x3f93a3,_0x48ea13);_0x4ec04b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x9ac5=['emit','hasOwnProperty','events','../../mysqldb','VoiceQueueReport','setMaxListeners','update'];(function(_0x402ed9,_0x41a018){var _0x4d1e0e=function(_0x297ffd){while(--_0x297ffd){_0x402ed9['push'](_0x402ed9['shift']());}};_0x4d1e0e(++_0x41a018);}(_0x9ac5,0x17c));var _0x59ac=function(_0x3c8033,_0x18ad41){_0x3c8033=_0x3c8033-0x0;var _0x35f8f3=_0x9ac5[_0x3c8033];return _0x35f8f3;};'use strict';var EventEmitter=require(_0x59ac('0x0'));var VoiceQueueReport=require(_0x59ac('0x1'))['db'][_0x59ac('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x59ac('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x59ac('0x4'),'afterDestroy':'remove'};function emitEvent(_0xd7c7e){return function(_0x4d9c24,_0xdf0ef8,_0x8d7bc1){VoiceQueueReportEvents['emit'](_0xd7c7e+':'+_0x4d9c24['id'],_0x4d9c24);VoiceQueueReportEvents[_0x59ac('0x5')](_0xd7c7e,_0x4d9c24);_0x8d7bc1(null);};}for(var e in events){if(events[_0x59ac('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
index 77bafda..f87662a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5180=['uniqueid','calleridnum','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./voiceQueueReport.attributes','define'];(function(_0x18a5c0,_0x514506){var _0x1d720d=function(_0x49dad9){while(--_0x49dad9){_0x18a5c0['push'](_0x18a5c0['shift']());}};_0x1d720d(++_0x514506);}(_0x5180,0x199));var _0x0518=function(_0x318dda,_0x1aa800){_0x318dda=_0x318dda-0x0;var _0x3f97ca=_0x5180[_0x318dda];return _0x3f97ca;};'use strict';var _=require(_0x0518('0x0'));var util=require(_0x0518('0x1'));var logger=require(_0x0518('0x2'))(_0x0518('0x3'));var moment=require('moment');var BPromise=require(_0x0518('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0518('0x5'));var config=require(_0x0518('0x6'));var attributes=require(_0x0518('0x7'));module['exports']=function(_0x5581a1,_0x3d782b){return _0x5581a1[_0x0518('0x8')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x0518('0x9')]},{'fields':[_0x0518('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6ba4=['./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x6ba4,0x11e));var _0x46ba=function(_0x541905,_0xce30d5){_0x541905=_0x541905-0x0;var _0x194210=_0x6ba4[_0x541905];return _0x194210;};'use strict';var _=require('lodash');var util=require(_0x46ba('0x0'));var logger=require(_0x46ba('0x1'))('api');var moment=require(_0x46ba('0x2'));var BPromise=require(_0x46ba('0x3'));var rp=require(_0x46ba('0x4'));var fs=require('fs');var path=require(_0x46ba('0x5'));var rimraf=require(_0x46ba('0x6'));var config=require(_0x46ba('0x7'));var attributes=require(_0x46ba('0x8'));module['exports']=function(_0x216f80,_0x13449f){return _0x216f80[_0x46ba('0x9')](_0x46ba('0xa'),attributes,{'tableName':_0x46ba('0xb'),'paranoid':![],'indexes':[{'fields':[_0x46ba('0xc')]},{'fields':[_0x46ba('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index ca633c9..9147f8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72e6=['stringify','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','where','attributes','limit','map','include','model','then'];(function(_0xd4b0c2,_0x290459){var _0x4411ae=function(_0x45b14){while(--_0x45b14){_0xd4b0c2['push'](_0xd4b0c2['shift']());}};_0x4411ae(++_0x290459);}(_0x72e6,0xde));var _0x672e=function(_0x38c71b,_0x4a1429){_0x38c71b=_0x38c71b-0x0;var _0x137f9e=_0x72e6[_0x38c71b];return _0x137f9e;};'use strict';var _=require('lodash');var util=require(_0x672e('0x0'));var moment=require('moment');var BPromise=require(_0x672e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x672e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x672e('0x3'));var logger=require('../../config/logger')(_0x672e('0x4'));var config=require(_0x672e('0x5'));var jayson=require(_0x672e('0x6'));var client=jayson[_0x672e('0x7')][_0x672e('0x8')]({'port':0x232a});config[_0x672e('0x9')]=_[_0x672e('0xa')](config[_0x672e('0x9')],{'host':_0x672e('0xb'),'port':0x18eb});var socket=require(_0x672e('0xc'))(new Redis(config[_0x672e('0x9')]));require(_0x672e('0xd'))['register'](socket);function respondWithRpcPromise(_0x2a9741,_0x21857e,_0x38237b){return new BPromise(function(_0x5cd5c5,_0xe599e0){return client[_0x672e('0xe')](_0x2a9741,_0x38237b)['then'](function(_0x2b461a){logger[_0x672e('0xf')]('VoiceQueueReport,\x20%s,\x20%s',_0x21857e,_0x672e('0x10'));logger[_0x672e('0x11')](_0x672e('0x12'),_0x21857e,_0x672e('0x10'),JSON['stringify'](_0x2b461a));if(_0x2b461a[_0x672e('0x13')]){if(_0x2b461a[_0x672e('0x13')][_0x672e('0x14')]===0x1f4){logger[_0x672e('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x21857e,_0x2b461a['error'][_0x672e('0x15')]);return _0xe599e0(_0x2b461a[_0x672e('0x13')]['message']);}logger[_0x672e('0x13')](_0x672e('0x16'),_0x21857e,_0x2b461a[_0x672e('0x13')]['message']);return _0x5cd5c5(_0x2b461a[_0x672e('0x13')]['message']);}else{logger['info'](_0x672e('0x16'),_0x21857e,_0x672e('0x10'));_0x5cd5c5(_0x2b461a[_0x672e('0x17')]['message']);}})['catch'](function(_0x21dee5){logger[_0x672e('0x13')](_0x672e('0x16'),_0x21857e,_0x21dee5);_0xe599e0(_0x21dee5);});});}exports[_0x672e('0x18')]=function(_0x348bbc){var _0x165cb9=this;return new Promise(function(_0x159a30,_0x3aefea){return db[_0x672e('0x19')][_0x672e('0x1a')]({'raw':_0x348bbc['options']?_0x348bbc['options'][_0x672e('0x1b')]===undefined?!![]:![]:!![],'where':_0x348bbc[_0x672e('0x1c')]?_0x348bbc[_0x672e('0x1c')][_0x672e('0x1d')]||null:null,'attributes':_0x348bbc[_0x672e('0x1c')]?_0x348bbc[_0x672e('0x1c')][_0x672e('0x1e')]||null:null,'limit':_0x348bbc['options']?_0x348bbc[_0x672e('0x1c')][_0x672e('0x1f')]||null:null,'include':_0x348bbc[_0x672e('0x1c')]?_0x348bbc['options']['include']?_[_0x672e('0x20')](_0x348bbc['options'][_0x672e('0x21')],function(_0x58ab73){return{'model':db[_0x58ab73[_0x672e('0x22')]],'as':_0x58ab73['as'],'attributes':_0x58ab73[_0x672e('0x1e')],'include':_0x58ab73['include']?_[_0x672e('0x20')](_0x58ab73[_0x672e('0x21')],function(_0x3125fc){return{'model':db[_0x3125fc['model']],'as':_0x3125fc['as'],'attributes':_0x3125fc['attributes'],'include':_0x3125fc[_0x672e('0x21')]?_[_0x672e('0x20')](_0x3125fc[_0x672e('0x21')],function(_0xc8b55d){return{'model':db[_0xc8b55d[_0x672e('0x22')]],'as':_0xc8b55d['as'],'attributes':_0xc8b55d[_0x672e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x672e('0x23')](function(_0x472edf){logger[_0x672e('0xf')](_0x672e('0x18'),_0x348bbc);logger[_0x672e('0x11')](_0x672e('0x18'),_0x348bbc,JSON[_0x672e('0x24')](_0x472edf));_0x159a30(_0x472edf);})[_0x672e('0x25')](function(_0x15e71a){logger[_0x672e('0x13')](_0x672e('0x18'),_0x15e71a[_0x672e('0x15')],_0x348bbc);_0x3aefea(_0x165cb9[_0x672e('0x13')](0x1f4,_0x15e71a['message']));});});};exports[_0x672e('0x26')]=function(_0x21c60f){var _0x3287f0=this;return new Promise(function(_0x283d45,_0x4428a9){return db['VoiceQueueReport'][_0x672e('0x27')](_0x21c60f[_0x672e('0x28')],{'raw':_0x21c60f[_0x672e('0x1c')]?_0x21c60f[_0x672e('0x1c')][_0x672e('0x1b')]===undefined?!![]:![]:!![]})[_0x672e('0x23')](function(_0x5900a7){logger[_0x672e('0xf')]('CreateVoiceQueueReport',_0x21c60f);logger[_0x672e('0x11')](_0x672e('0x26'),_0x21c60f,JSON[_0x672e('0x24')](_0x5900a7));_0x283d45(_0x5900a7);})['catch'](function(_0x261aaf){logger[_0x672e('0x13')]('CreateVoiceQueueReport',_0x261aaf[_0x672e('0x15')],_0x21c60f);_0x4428a9(_0x3287f0[_0x672e('0x13')](0x1f4,_0x261aaf[_0x672e('0x15')]));});});};exports[_0x672e('0x29')]=function(_0x579328){var _0x270460=this;return new Promise(function(_0x16ecea,_0x57ceaa){return db['VoiceQueueReport'][_0x672e('0x2a')](_0x579328[_0x672e('0x28')],{'raw':_0x579328[_0x672e('0x1c')]?_0x579328[_0x672e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x579328[_0x672e('0x1c')]?_0x579328[_0x672e('0x1c')][_0x672e('0x1d')]||null:null,'attributes':_0x579328[_0x672e('0x1c')]?_0x579328['options']['attributes']||null:null,'limit':_0x579328['options']?_0x579328[_0x672e('0x1c')][_0x672e('0x1f')]||null:null})[_0x672e('0x23')](function(_0xf58bb2){logger[_0x672e('0xf')]('UpdateVoiceQueueReport',_0x579328);logger[_0x672e('0x11')](_0x672e('0x29'),_0x579328,JSON[_0x672e('0x24')](_0xf58bb2));_0x16ecea(_0xf58bb2);})['catch'](function(_0x2fdbf1){logger[_0x672e('0x13')]('UpdateVoiceQueueReport',_0x2fdbf1[_0x672e('0x15')],_0x579328);_0x57ceaa(_0x270460[_0x672e('0x13')](0x1f4,_0x2fdbf1['message']));});});};
\ No newline at end of file
+var _0x7f02=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','request\x20sent','debug','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','VoiceQueueReport','options','raw','attributes','include','map','model','then','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','stringify','UpdateVoiceQueueReport','update','where','limit','lodash'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x7f02,0xb7));var _0x27f0=function(_0x2022bd,_0x244d49){_0x2022bd=_0x2022bd-0x0;var _0x16520a=_0x7f02[_0x2022bd];return _0x16520a;};'use strict';var _=require(_0x27f0('0x0'));var util=require(_0x27f0('0x1'));var moment=require(_0x27f0('0x2'));var BPromise=require(_0x27f0('0x3'));var rs=require(_0x27f0('0x4'));var fs=require('fs');var Redis=require(_0x27f0('0x5'));var db=require(_0x27f0('0x6'))['db'];var utils=require(_0x27f0('0x7'));var logger=require(_0x27f0('0x8'))(_0x27f0('0x9'));var config=require(_0x27f0('0xa'));var jayson=require(_0x27f0('0xb'));var client=jayson[_0x27f0('0xc')][_0x27f0('0xd')]({'port':0x232a});config[_0x27f0('0xe')]=_[_0x27f0('0xf')](config[_0x27f0('0xe')],{'host':_0x27f0('0x10'),'port':0x18eb});var socket=require(_0x27f0('0x11'))(new Redis(config[_0x27f0('0xe')]));require(_0x27f0('0x12'))[_0x27f0('0x13')](socket);function respondWithRpcPromise(_0x74fd09,_0x204d0f,_0x1dee2a){return new BPromise(function(_0x13bb4e,_0x57c7bf){return client[_0x27f0('0x14')](_0x74fd09,_0x1dee2a)['then'](function(_0x5723e8){logger[_0x27f0('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x204d0f,_0x27f0('0x16'));logger[_0x27f0('0x17')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x204d0f,_0x27f0('0x16'),JSON['stringify'](_0x5723e8));if(_0x5723e8[_0x27f0('0x18')]){if(_0x5723e8['error'][_0x27f0('0x19')]===0x1f4){logger['error'](_0x27f0('0x1a'),_0x204d0f,_0x5723e8[_0x27f0('0x18')]['message']);return _0x57c7bf(_0x5723e8['error']['message']);}logger[_0x27f0('0x18')](_0x27f0('0x1a'),_0x204d0f,_0x5723e8['error']['message']);return _0x13bb4e(_0x5723e8['error'][_0x27f0('0x1b')]);}else{logger[_0x27f0('0x15')](_0x27f0('0x1a'),_0x204d0f,_0x27f0('0x16'));_0x13bb4e(_0x5723e8[_0x27f0('0x1c')][_0x27f0('0x1b')]);}})['catch'](function(_0x325de4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x204d0f,_0x325de4);_0x57c7bf(_0x325de4);});});}exports['GetVoiceQueueReport']=function(_0x40d204){var _0x33107e=this;return new Promise(function(_0x3d3c38,_0x1a3e3c){return db[_0x27f0('0x1d')]['findAll']({'raw':_0x40d204['options']?_0x40d204[_0x27f0('0x1e')][_0x27f0('0x1f')]===undefined?!![]:![]:!![],'where':_0x40d204[_0x27f0('0x1e')]?_0x40d204[_0x27f0('0x1e')]['where']||null:null,'attributes':_0x40d204[_0x27f0('0x1e')]?_0x40d204[_0x27f0('0x1e')][_0x27f0('0x20')]||null:null,'limit':_0x40d204[_0x27f0('0x1e')]?_0x40d204['options']['limit']||null:null,'include':_0x40d204[_0x27f0('0x1e')]?_0x40d204[_0x27f0('0x1e')][_0x27f0('0x21')]?_[_0x27f0('0x22')](_0x40d204['options'][_0x27f0('0x21')],function(_0x4ccc6b){return{'model':db[_0x4ccc6b[_0x27f0('0x23')]],'as':_0x4ccc6b['as'],'attributes':_0x4ccc6b[_0x27f0('0x20')],'include':_0x4ccc6b['include']?_[_0x27f0('0x22')](_0x4ccc6b[_0x27f0('0x21')],function(_0x59e68f){return{'model':db[_0x59e68f['model']],'as':_0x59e68f['as'],'attributes':_0x59e68f[_0x27f0('0x20')],'include':_0x59e68f[_0x27f0('0x21')]?_[_0x27f0('0x22')](_0x59e68f[_0x27f0('0x21')],function(_0x1d6d31){return{'model':db[_0x1d6d31[_0x27f0('0x23')]],'as':_0x1d6d31['as'],'attributes':_0x1d6d31[_0x27f0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x27f0('0x24')](function(_0x325493){logger[_0x27f0('0x15')](_0x27f0('0x25'),_0x40d204);logger[_0x27f0('0x17')]('GetVoiceQueueReport',_0x40d204,JSON['stringify'](_0x325493));_0x3d3c38(_0x325493);})[_0x27f0('0x26')](function(_0x971820){logger['error'](_0x27f0('0x25'),_0x971820['message'],_0x40d204);_0x1a3e3c(_0x33107e[_0x27f0('0x18')](0x1f4,_0x971820[_0x27f0('0x1b')]));});});};exports[_0x27f0('0x27')]=function(_0x158108){var _0x511f20=this;return new Promise(function(_0x4fc33d,_0xeae6cf){return db[_0x27f0('0x1d')][_0x27f0('0x28')](_0x158108['body'],{'raw':_0x158108['options']?_0x158108[_0x27f0('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x27f0('0x24')](function(_0x1e6eaa){logger[_0x27f0('0x15')](_0x27f0('0x27'),_0x158108);logger['debug'](_0x27f0('0x27'),_0x158108,JSON[_0x27f0('0x29')](_0x1e6eaa));_0x4fc33d(_0x1e6eaa);})[_0x27f0('0x26')](function(_0x146943){logger['error'](_0x27f0('0x27'),_0x146943[_0x27f0('0x1b')],_0x158108);_0xeae6cf(_0x511f20[_0x27f0('0x18')](0x1f4,_0x146943[_0x27f0('0x1b')]));});});};exports[_0x27f0('0x2a')]=function(_0x2d7df7){var _0x3a6c2e=this;return new Promise(function(_0x1f0fbc,_0xf319bf){return db[_0x27f0('0x1d')][_0x27f0('0x2b')](_0x2d7df7['body'],{'raw':_0x2d7df7[_0x27f0('0x1e')]?_0x2d7df7[_0x27f0('0x1e')][_0x27f0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d7df7[_0x27f0('0x1e')]?_0x2d7df7[_0x27f0('0x1e')][_0x27f0('0x2c')]||null:null,'attributes':_0x2d7df7[_0x27f0('0x1e')]?_0x2d7df7[_0x27f0('0x1e')][_0x27f0('0x20')]||null:null,'limit':_0x2d7df7[_0x27f0('0x1e')]?_0x2d7df7[_0x27f0('0x1e')][_0x27f0('0x2d')]||null:null})['then'](function(_0x4eacaa){logger[_0x27f0('0x15')]('UpdateVoiceQueueReport',_0x2d7df7);logger[_0x27f0('0x17')]('UpdateVoiceQueueReport',_0x2d7df7,JSON[_0x27f0('0x29')](_0x4eacaa));_0x1f0fbc(_0x4eacaa);})['catch'](function(_0x5280b6){logger[_0x27f0('0x18')](_0x27f0('0x2a'),_0x5280b6[_0x27f0('0x1b')],_0x2d7df7);_0xf319bf(_0x3a6c2e['error'](0x1f4,_0x5280b6[_0x27f0('0x1b')]));});});};
\ No newline at end of file
index e552b59..caa22f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd73c=['emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x4a38c5,_0x4ac108){var _0x29bbf7=function(_0x43211f){while(--_0x43211f){_0x4a38c5['push'](_0x4a38c5['shift']());}};_0x29bbf7(++_0x4ac108);}(_0xd73c,0x134));var _0xcd73=function(_0x358c78,_0x492f91){_0x358c78=_0x358c78-0x0;var _0x3aa507=_0xd73c[_0x358c78];return _0x3aa507;};'use strict';var VoiceQueueReportEvents=require(_0xcd73('0x0'));var events=[_0xcd73('0x1'),_0xcd73('0x2'),_0xcd73('0x3')];function createListener(_0x35dfc5,_0x9bc586){return function(_0x279930){_0x9bc586[_0xcd73('0x4')](_0x35dfc5,_0x279930);};}function removeListener(_0x1ecde9,_0x3ae6af){return function(){VoiceQueueReportEvents[_0xcd73('0x5')](_0x1ecde9,_0x3ae6af);};}exports[_0xcd73('0x6')]=function(_0x81598){for(var _0x470da9=0x0,_0x2b77e5=events['length'];_0x470da9<_0x2b77e5;_0x470da9++){var _0x1fb937=events[_0x470da9];var _0x452a5a=createListener(_0xcd73('0x7')+_0x1fb937,_0x81598);VoiceQueueReportEvents['on'](_0x1fb937,_0x452a5a);}};
\ No newline at end of file
+var _0x0ab2=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','removeListener','register'];(function(_0x3ba5d5,_0x550b1a){var _0x408418=function(_0x3263a5){while(--_0x3263a5){_0x3ba5d5['push'](_0x3ba5d5['shift']());}};_0x408418(++_0x550b1a);}(_0x0ab2,0x9a));var _0x20ab=function(_0x212dad,_0xb862ef){_0x212dad=_0x212dad-0x0;var _0x4fea3f=_0x0ab2[_0x212dad];return _0x4fea3f;};'use strict';var VoiceQueueReportEvents=require(_0x20ab('0x0'));var events=[_0x20ab('0x1'),_0x20ab('0x2'),_0x20ab('0x3')];function createListener(_0x217637,_0x1520c9){return function(_0x4cc8cc){_0x1520c9['emit'](_0x217637,_0x4cc8cc);};}function removeListener(_0x435fc9,_0x2c4d43){return function(){VoiceQueueReportEvents[_0x20ab('0x4')](_0x435fc9,_0x2c4d43);};}exports[_0x20ab('0x5')]=function(_0x35fdb5){for(var _0x362d27=0x0,_0x16d3fc=events[_0x20ab('0x6')];_0x362d27<_0x16d3fc;_0x362d27++){var _0x458cd9=events[_0x362d27];var _0x547349=createListener(_0x20ab('0x7')+_0x458cd9,_0x35fdb5);VoiceQueueReportEvents['on'](_0x458cd9,_0x547349);}};
\ No newline at end of file
index efa8356..3c07db4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x29558b,_0x50a611){var _0x1b1ed6=function(_0x2e9b8f){while(--_0x2e9b8f){_0x29558b['push'](_0x29558b['shift']());}};_0x1b1ed6(++_0x50a611);}(_0x351f,0xd6));var _0xf351=function(_0x1b1020,_0x5d5879){_0x1b1020=_0x1b1020-0x0;var _0x360a91=_0x351f[_0x1b1020];return _0x360a91;};'use strict';var multer=require(_0xf351('0x0'));var util=require(_0xf351('0x1'));var path=require(_0xf351('0x2'));var timeout=require(_0xf351('0x3'));var express=require('express');var router=express[_0xf351('0x4')]();var fs_extra=require(_0xf351('0x5'));var auth=require(_0xf351('0x6'));var interaction=require(_0xf351('0x7'));var config=require(_0xf351('0x8'));var controller=require(_0xf351('0x9'));router['get']('/',auth[_0xf351('0xa')](),controller[_0xf351('0xb')]);router[_0xf351('0xc')](_0xf351('0xd'),auth[_0xf351('0xa')](),controller['show']);router[_0xf351('0xe')]('/',auth[_0xf351('0xa')](),controller['create']);router[_0xf351('0xf')](_0xf351('0xd'),auth[_0xf351('0xa')](),controller[_0xf351('0x10')]);router[_0xf351('0x11')](_0xf351('0xd'),auth[_0xf351('0xa')](),controller[_0xf351('0x12')]);module[_0xf351('0x13')]=router;
\ No newline at end of file
+var _0xa540=['show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x4dd57e,_0x522a83){var _0x4aba35=function(_0x33473a){while(--_0x33473a){_0x4dd57e['push'](_0x4dd57e['shift']());}};_0x4aba35(++_0x522a83);}(_0xa540,0xd3));var _0x0a54=function(_0x34bd34,_0x1444f7){_0x34bd34=_0x34bd34-0x0;var _0x4e36d6=_0xa540[_0x34bd34];return _0x4e36d6;};'use strict';var multer=require(_0x0a54('0x0'));var util=require('util');var path=require(_0x0a54('0x1'));var timeout=require(_0x0a54('0x2'));var express=require(_0x0a54('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0a54('0x4'));var config=require(_0x0a54('0x5'));var controller=require('./voiceQueuesLog.controller');router[_0x0a54('0x6')]('/',auth[_0x0a54('0x7')](),controller[_0x0a54('0x8')]);router[_0x0a54('0x6')](_0x0a54('0x9'),auth['isAuthenticated'](),controller[_0x0a54('0xa')]);router[_0x0a54('0xb')]('/',auth['isAuthenticated'](),controller[_0x0a54('0xc')]);router['put'](_0x0a54('0x9'),auth[_0x0a54('0x7')](),controller[_0x0a54('0xd')]);router[_0x0a54('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0a54('0xf')]);module[_0x0a54('0x10')]=router;
\ No newline at end of file
index cce9352..7ba8e48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5fe=['STRING','format','sequelize','exports'];(function(_0x544ec1,_0x2814eb){var _0x31e735=function(_0x45f226){while(--_0x45f226){_0x544ec1['push'](_0x544ec1['shift']());}};_0x31e735(++_0x2814eb);}(_0xc5fe,0x152));var _0xec5f=function(_0x5b3c90,_0x45b28c){_0x5b3c90=_0x5b3c90-0x0;var _0xd1ae5e=_0xc5fe[_0x5b3c90];return _0xd1ae5e;};'use strict';var Sequelize=require(_0xec5f('0x0'));var moment=require('moment');module[_0xec5f('0x1')]={'time':{'type':Sequelize[_0xec5f('0x2')]},'callid':{'type':Sequelize[_0xec5f('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xec5f('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xec5f('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xec5f('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xec5f('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xec5f('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xec5f('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xec5f('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xec5f('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xec5f('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
+var _0xf5cd=['moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x3c45b6,_0x490e59){var _0x51421c=function(_0xed3c82){while(--_0xed3c82){_0x3c45b6['push'](_0x3c45b6['shift']());}};_0x51421c(++_0x490e59);}(_0xf5cd,0x1bf));var _0xdf5c=function(_0x197135,_0x2a74c0){_0x197135=_0x197135-0x0;var _0x30b19d=_0xf5cd[_0x197135];return _0x30b19d;};'use strict';var Sequelize=require(_0xdf5c('0x0'));var moment=require(_0xdf5c('0x1'));module[_0xdf5c('0x2')]={'time':{'type':Sequelize[_0xdf5c('0x3')]},'callid':{'type':Sequelize[_0xdf5c('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xdf5c('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xdf5c('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xdf5c('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xdf5c('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xdf5c('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xdf5c('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xdf5c('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xdf5c('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xdf5c('0x4')],'allowNull':![],'defaultValue':moment()[_0xdf5c('0x5')](_0xdf5c('0x6'))}};
\ No newline at end of file
index 6f62df8..fd6e4da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb880=['limit','count','set','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','VoiceQueuesLog','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x534599,_0x2f670f){var _0x53c88d=function(_0x31af7c){while(--_0x31af7c){_0x534599['push'](_0x534599['shift']());}};_0x53c88d(++_0x2f670f);}(_0xb880,0x17a));var _0x0b88=function(_0x229402,_0x2e964b){_0x229402=_0x229402-0x0;var _0x57221c=_0xb880[_0x229402];return _0x57221c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0b88('0x0'));var rp=require(_0x0b88('0x1'));var moment=require(_0x0b88('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0b88('0x3'));var util=require(_0x0b88('0x4'));var path=require('path');var sox=require(_0x0b88('0x5'));var csv=require(_0x0b88('0x6'));var ejs=require(_0x0b88('0x7'));var fs=require('fs');var fs_extra=require(_0x0b88('0x8'));var _=require('lodash');var squel=require(_0x0b88('0x9'));var crypto=require('crypto');var jsforce=require(_0x0b88('0xa'));var deskjs=require(_0x0b88('0xb'));var toCsv=require(_0x0b88('0x6'));var querystring=require(_0x0b88('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0b88('0xd'));var qs=require(_0x0b88('0xe'));var as=require(_0x0b88('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0b88('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0b88('0x11'));var db=require(_0x0b88('0x12'))['db'];function respondWithStatusCode(_0x2c44b5,_0x38da5e){_0x38da5e=_0x38da5e||0xcc;return function(_0x4cd803){if(_0x4cd803){return _0x2c44b5['sendStatus'](_0x38da5e);}return _0x2c44b5[_0x0b88('0x13')](_0x38da5e)[_0x0b88('0x14')]();};}function respondWithResult(_0x3728bc,_0x52fc9b){_0x52fc9b=_0x52fc9b||0xc8;return function(_0x1825ef){if(_0x1825ef){return _0x3728bc['status'](_0x52fc9b)[_0x0b88('0x15')](_0x1825ef);}};}function respondWithFilteredResult(_0x1cb6be,_0x2f98db){return function(_0x24096f){if(_0x24096f){var _0x420099=typeof _0x2f98db[_0x0b88('0x16')]===_0x0b88('0x17')&&typeof _0x2f98db[_0x0b88('0x18')]===_0x0b88('0x17');var _0x14cf3b=_0x24096f[_0x0b88('0x19')];var _0x16917b=_0x420099?0x0:_0x2f98db[_0x0b88('0x16')];var _0x1e3003=_0x420099?_0x24096f[_0x0b88('0x19')]:_0x2f98db[_0x0b88('0x16')]+_0x2f98db[_0x0b88('0x18')];var _0x53b3c6;if(_0x1e3003>=_0x14cf3b){_0x1e3003=_0x14cf3b;_0x53b3c6=0xc8;}else{_0x53b3c6=0xce;}_0x1cb6be['status'](_0x53b3c6);return _0x1cb6be[_0x0b88('0x1a')]('Content-Range',_0x16917b+'-'+_0x1e3003+'/'+_0x14cf3b)[_0x0b88('0x15')](_0x24096f);}return null;};}function patchUpdates(_0x3d08ea){return function(_0x5dd0ba){try{jsonpatch['apply'](_0x5dd0ba,_0x3d08ea,!![]);}catch(_0x2b8593){return BPromise[_0x0b88('0x1b')](_0x2b8593);}return _0x5dd0ba[_0x0b88('0x1c')]();};}function saveUpdates(_0x1165cb,_0x593a0e){return function(_0x339690){if(_0x339690){return _0x339690[_0x0b88('0x1d')](_0x1165cb)[_0x0b88('0x1e')](function(_0xb76198){return _0xb76198;});}return null;};}function removeEntity(_0x5774ea,_0x552d19){return function(_0x1eab89){if(_0x1eab89){return _0x1eab89[_0x0b88('0x1f')]()[_0x0b88('0x1e')](function(){_0x5774ea['status'](0xcc)[_0x0b88('0x14')]();});}};}function handleEntityNotFound(_0x38c646,_0x4bd2f5){return function(_0x4c225f){if(!_0x4c225f){_0x38c646[_0x0b88('0x20')](0x194);}return _0x4c225f;};}function handleError(_0x504a26,_0x59d30d){_0x59d30d=_0x59d30d||0x1f4;return function(_0x417817){logger[_0x0b88('0x21')](_0x417817['stack']);if(_0x417817[_0x0b88('0x22')]){delete _0x417817[_0x0b88('0x22')];}_0x504a26[_0x0b88('0x13')](_0x59d30d)[_0x0b88('0x23')](_0x417817);};}exports[_0x0b88('0x24')]=function(_0x14670a,_0x29635e){var _0x467aef={},_0x1a030a={},_0x67eb98={'count':0x0,'rows':[]};var _0x23be5c=_[_0x0b88('0x25')](db[_0x0b88('0x26')][_0x0b88('0x27')],function(_0x275e6c){return{'name':_0x275e6c['fieldName'],'type':_0x275e6c['type'][_0x0b88('0x28')]};});_0x1a030a[_0x0b88('0x29')]=_[_0x0b88('0x25')](_0x23be5c,_0x0b88('0x22'));_0x1a030a['query']=_['keys'](_0x14670a[_0x0b88('0x2a')]);_0x1a030a[_0x0b88('0x2b')]=_[_0x0b88('0x2c')](_0x1a030a[_0x0b88('0x29')],_0x1a030a[_0x0b88('0x2a')]);_0x467aef[_0x0b88('0x2d')]=_[_0x0b88('0x2c')](_0x1a030a['model'],qs[_0x0b88('0x2e')](_0x14670a[_0x0b88('0x2a')][_0x0b88('0x2e')]));_0x467aef[_0x0b88('0x2d')]=_0x467aef[_0x0b88('0x2d')][_0x0b88('0x2f')]?_0x467aef['attributes']:_0x1a030a['model'];if(!_0x14670a[_0x0b88('0x2a')][_0x0b88('0x30')]('nolimit')){_0x467aef['limit']=qs['limit'](_0x14670a[_0x0b88('0x2a')]['limit']);_0x467aef[_0x0b88('0x16')]=qs[_0x0b88('0x16')](_0x14670a[_0x0b88('0x2a')][_0x0b88('0x16')]);}_0x467aef['order']=qs[_0x0b88('0x31')](_0x14670a[_0x0b88('0x2a')]['sort']);_0x467aef[_0x0b88('0x32')]=qs[_0x0b88('0x2b')](_['pick'](_0x14670a[_0x0b88('0x2a')],_0x1a030a[_0x0b88('0x2b')]),_0x23be5c);if(_0x14670a[_0x0b88('0x2a')][_0x0b88('0x33')]){_0x467aef[_0x0b88('0x32')]=_[_0x0b88('0x34')](_0x467aef[_0x0b88('0x32')],{'$or':_[_0x0b88('0x25')](_0x23be5c,function(_0x32e127){if(_0x32e127[_0x0b88('0x35')]!==_0x0b88('0x36')){var _0x4cb5d3={};_0x4cb5d3[_0x32e127[_0x0b88('0x22')]]={'$like':'%'+_0x14670a[_0x0b88('0x2a')]['filter']+'%'};return _0x4cb5d3;}})});}_0x467aef=_[_0x0b88('0x34')]({},_0x467aef,_0x14670a[_0x0b88('0x37')]);var _0xc04ed4={'where':_0x467aef[_0x0b88('0x32')]};return db[_0x0b88('0x26')][_0x0b88('0x19')](_0xc04ed4)['then'](function(_0x763905){_0x67eb98[_0x0b88('0x19')]=_0x763905;if(_0x14670a[_0x0b88('0x2a')]['includeAll']){_0x467aef[_0x0b88('0x38')]=[{'all':!![]}];}return db[_0x0b88('0x26')][_0x0b88('0x39')](_0x467aef);})[_0x0b88('0x1e')](function(_0x3b3983){_0x67eb98[_0x0b88('0x3a')]=_0x3b3983;return _0x67eb98;})[_0x0b88('0x1e')](respondWithFilteredResult(_0x29635e,_0x467aef))[_0x0b88('0x3b')](handleError(_0x29635e,null));};exports[_0x0b88('0x3c')]=function(_0x4ac977,_0x34665a){var _0x421261={'raw':!![],'where':{'id':_0x4ac977[_0x0b88('0x3d')]['id']}},_0x4971ab={};_0x4971ab[_0x0b88('0x29')]=_['keys'](db[_0x0b88('0x26')][_0x0b88('0x27')]);_0x4971ab[_0x0b88('0x2a')]=_[_0x0b88('0x3e')](_0x4ac977[_0x0b88('0x2a')]);_0x4971ab[_0x0b88('0x2b')]=_[_0x0b88('0x2c')](_0x4971ab[_0x0b88('0x29')],_0x4971ab[_0x0b88('0x2a')]);_0x421261['attributes']=_[_0x0b88('0x2c')](_0x4971ab[_0x0b88('0x29')],qs[_0x0b88('0x2e')](_0x4ac977[_0x0b88('0x2a')]['fields']));_0x421261[_0x0b88('0x2d')]=_0x421261[_0x0b88('0x2d')][_0x0b88('0x2f')]?_0x421261[_0x0b88('0x2d')]:_0x4971ab['model'];if(_0x4ac977[_0x0b88('0x2a')][_0x0b88('0x3f')]){_0x421261[_0x0b88('0x38')]=[{'all':!![]}];}_0x421261=_[_0x0b88('0x34')]({},_0x421261,_0x4ac977[_0x0b88('0x37')]);return db[_0x0b88('0x26')]['find'](_0x421261)[_0x0b88('0x1e')](handleEntityNotFound(_0x34665a,null))['then'](respondWithResult(_0x34665a,null))[_0x0b88('0x3b')](handleError(_0x34665a,null));};exports[_0x0b88('0x40')]=function(_0x2f61e3,_0x56198a){return db['VoiceQueuesLog'][_0x0b88('0x40')](_0x2f61e3[_0x0b88('0x41')],{})['then'](respondWithResult(_0x56198a,0xc9))[_0x0b88('0x3b')](handleError(_0x56198a,null));};exports[_0x0b88('0x1d')]=function(_0x3b1e85,_0x9785d7){if(_0x3b1e85[_0x0b88('0x41')]['id']){delete _0x3b1e85[_0x0b88('0x41')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x3b1e85[_0x0b88('0x3d')]['id']}})[_0x0b88('0x1e')](handleEntityNotFound(_0x9785d7,null))[_0x0b88('0x1e')](saveUpdates(_0x3b1e85[_0x0b88('0x41')],null))['then'](respondWithResult(_0x9785d7,null))[_0x0b88('0x3b')](handleError(_0x9785d7,null));};exports[_0x0b88('0x1f')]=function(_0x29c6a2,_0x5f244d){return db['VoiceQueuesLog'][_0x0b88('0x42')]({'where':{'id':_0x29c6a2[_0x0b88('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5f244d,null))[_0x0b88('0x1e')](removeEntity(_0x5f244d,null))[_0x0b88('0x3b')](handleError(_0x5f244d,null));};
\ No newline at end of file
+var _0x98c0=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','include','create','body','find','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','model'];(function(_0xefda00,_0x56c889){var _0x40c43f=function(_0x30aeba){while(--_0x30aeba){_0xefda00['push'](_0xefda00['shift']());}};_0x40c43f(++_0x56c889);}(_0x98c0,0x1d3));var _0x098c=function(_0x33dfa9,_0x1440e8){_0x33dfa9=_0x33dfa9-0x0;var _0x4ec57d=_0x98c0[_0x33dfa9];return _0x4ec57d;};'use strict';var emlformat=require(_0x098c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x098c('0x1'));var jsonpatch=require(_0x098c('0x2'));var rp=require(_0x098c('0x3'));var moment=require('moment');var BPromise=require(_0x098c('0x4'));var Mustache=require(_0x098c('0x5'));var util=require('util');var path=require(_0x098c('0x6'));var sox=require(_0x098c('0x7'));var csv=require(_0x098c('0x8'));var ejs=require(_0x098c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x098c('0xa'));var squel=require(_0x098c('0xb'));var crypto=require('crypto');var jsforce=require(_0x098c('0xc'));var deskjs=require(_0x098c('0xd'));var toCsv=require(_0x098c('0x8'));var querystring=require(_0x098c('0xe'));var Papa=require(_0x098c('0xf'));var Redis=require(_0x098c('0x10'));var authService=require(_0x098c('0x11'));var qs=require(_0x098c('0x12'));var as=require(_0x098c('0x13'));var hardwareService=require(_0x098c('0x14'));var logger=require(_0x098c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x098c('0x16'));var licenseUtil=require(_0x098c('0x17'));var db=require(_0x098c('0x18'))['db'];function respondWithStatusCode(_0x6ef5e8,_0x2b0b92){_0x2b0b92=_0x2b0b92||0xcc;return function(_0x39bef6){if(_0x39bef6){return _0x6ef5e8[_0x098c('0x19')](_0x2b0b92);}return _0x6ef5e8[_0x098c('0x1a')](_0x2b0b92)[_0x098c('0x1b')]();};}function respondWithResult(_0x8f158d,_0x411d2c){_0x411d2c=_0x411d2c||0xc8;return function(_0x4a8f0c){if(_0x4a8f0c){return _0x8f158d[_0x098c('0x1a')](_0x411d2c)[_0x098c('0x1c')](_0x4a8f0c);}};}function respondWithFilteredResult(_0x3974da,_0x4afa36){return function(_0x2c2897){if(_0x2c2897){var _0x4bc04c=typeof _0x4afa36[_0x098c('0x1d')]===_0x098c('0x1e')&&typeof _0x4afa36[_0x098c('0x1f')]==='undefined';var _0x165aa1=_0x2c2897[_0x098c('0x20')];var _0x242749=_0x4bc04c?0x0:_0x4afa36[_0x098c('0x1d')];var _0x4c18bd=_0x4bc04c?_0x2c2897[_0x098c('0x20')]:_0x4afa36[_0x098c('0x1d')]+_0x4afa36[_0x098c('0x1f')];var _0x1ce6af;if(_0x4c18bd>=_0x165aa1){_0x4c18bd=_0x165aa1;_0x1ce6af=0xc8;}else{_0x1ce6af=0xce;}_0x3974da[_0x098c('0x1a')](_0x1ce6af);return _0x3974da['set'](_0x098c('0x21'),_0x242749+'-'+_0x4c18bd+'/'+_0x165aa1)[_0x098c('0x1c')](_0x2c2897);}return null;};}function patchUpdates(_0x87dec7){return function(_0x974ac7){try{jsonpatch[_0x098c('0x22')](_0x974ac7,_0x87dec7,!![]);}catch(_0x2c0a93){return BPromise[_0x098c('0x23')](_0x2c0a93);}return _0x974ac7[_0x098c('0x24')]();};}function saveUpdates(_0x419c7d,_0x26db4d){return function(_0x2292c5){if(_0x2292c5){return _0x2292c5[_0x098c('0x25')](_0x419c7d)['then'](function(_0x33d3b3){return _0x33d3b3;});}return null;};}function removeEntity(_0x508a69,_0x1147e3){return function(_0x29abdb){if(_0x29abdb){return _0x29abdb[_0x098c('0x26')]()[_0x098c('0x27')](function(){_0x508a69[_0x098c('0x1a')](0xcc)[_0x098c('0x1b')]();});}};}function handleEntityNotFound(_0x2f9e32,_0x4b1ed3){return function(_0x3d81b5){if(!_0x3d81b5){_0x2f9e32[_0x098c('0x19')](0x194);}return _0x3d81b5;};}function handleError(_0x419d16,_0x41bfe2){_0x41bfe2=_0x41bfe2||0x1f4;return function(_0x1c2588){logger[_0x098c('0x28')](_0x1c2588[_0x098c('0x29')]);if(_0x1c2588['name']){delete _0x1c2588[_0x098c('0x2a')];}_0x419d16[_0x098c('0x1a')](_0x41bfe2)[_0x098c('0x2b')](_0x1c2588);};}exports[_0x098c('0x2c')]=function(_0x58363b,_0x2eac07){var _0x1b9f72={},_0x3b519f={},_0x15fdcb={'count':0x0,'rows':[]};var _0x425396=_[_0x098c('0x2d')](db[_0x098c('0x2e')][_0x098c('0x2f')],function(_0x3c4bd1){return{'name':_0x3c4bd1['fieldName'],'type':_0x3c4bd1[_0x098c('0x30')][_0x098c('0x31')]};});_0x3b519f[_0x098c('0x32')]=_['map'](_0x425396,_0x098c('0x2a'));_0x3b519f[_0x098c('0x33')]=_[_0x098c('0x34')](_0x58363b[_0x098c('0x33')]);_0x3b519f[_0x098c('0x35')]=_['intersection'](_0x3b519f[_0x098c('0x32')],_0x3b519f[_0x098c('0x33')]);_0x1b9f72[_0x098c('0x36')]=_[_0x098c('0x37')](_0x3b519f[_0x098c('0x32')],qs[_0x098c('0x38')](_0x58363b[_0x098c('0x33')][_0x098c('0x38')]));_0x1b9f72['attributes']=_0x1b9f72[_0x098c('0x36')]['length']?_0x1b9f72[_0x098c('0x36')]:_0x3b519f['model'];if(!_0x58363b[_0x098c('0x33')][_0x098c('0x39')]('nolimit')){_0x1b9f72['limit']=qs['limit'](_0x58363b[_0x098c('0x33')][_0x098c('0x1f')]);_0x1b9f72[_0x098c('0x1d')]=qs[_0x098c('0x1d')](_0x58363b['query'][_0x098c('0x1d')]);}_0x1b9f72[_0x098c('0x3a')]=qs[_0x098c('0x3b')](_0x58363b[_0x098c('0x33')][_0x098c('0x3b')]);_0x1b9f72[_0x098c('0x3c')]=qs[_0x098c('0x35')](_['pick'](_0x58363b[_0x098c('0x33')],_0x3b519f[_0x098c('0x35')]),_0x425396);if(_0x58363b[_0x098c('0x33')]['filter']){_0x1b9f72['where']=_[_0x098c('0x3d')](_0x1b9f72['where'],{'$or':_['map'](_0x425396,function(_0x47bf47){if(_0x47bf47['type']!==_0x098c('0x3e')){var _0x3b98bc={};_0x3b98bc[_0x47bf47[_0x098c('0x2a')]]={'$like':'%'+_0x58363b[_0x098c('0x33')][_0x098c('0x3f')]+'%'};return _0x3b98bc;}})});}_0x1b9f72=_['merge']({},_0x1b9f72,_0x58363b[_0x098c('0x40')]);var _0xf2efc8={'where':_0x1b9f72[_0x098c('0x3c')]};return db[_0x098c('0x2e')][_0x098c('0x20')](_0xf2efc8)[_0x098c('0x27')](function(_0x527572){_0x15fdcb[_0x098c('0x20')]=_0x527572;if(_0x58363b[_0x098c('0x33')][_0x098c('0x41')]){_0x1b9f72['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x098c('0x42')](_0x1b9f72);})[_0x098c('0x27')](function(_0x6dd23){_0x15fdcb['rows']=_0x6dd23;return _0x15fdcb;})['then'](respondWithFilteredResult(_0x2eac07,_0x1b9f72))['catch'](handleError(_0x2eac07,null));};exports[_0x098c('0x43')]=function(_0x585ba8,_0x5e43c7){var _0x6607bf={'raw':!![],'where':{'id':_0x585ba8[_0x098c('0x44')]['id']}},_0x29854a={};_0x29854a[_0x098c('0x32')]=_[_0x098c('0x34')](db[_0x098c('0x2e')]['rawAttributes']);_0x29854a['query']=_[_0x098c('0x34')](_0x585ba8[_0x098c('0x33')]);_0x29854a['filters']=_[_0x098c('0x37')](_0x29854a[_0x098c('0x32')],_0x29854a[_0x098c('0x33')]);_0x6607bf[_0x098c('0x36')]=_[_0x098c('0x37')](_0x29854a[_0x098c('0x32')],qs[_0x098c('0x38')](_0x585ba8[_0x098c('0x33')][_0x098c('0x38')]));_0x6607bf[_0x098c('0x36')]=_0x6607bf[_0x098c('0x36')]['length']?_0x6607bf[_0x098c('0x36')]:_0x29854a[_0x098c('0x32')];if(_0x585ba8['query'][_0x098c('0x41')]){_0x6607bf[_0x098c('0x45')]=[{'all':!![]}];}_0x6607bf=_['merge']({},_0x6607bf,_0x585ba8[_0x098c('0x40')]);return db['VoiceQueuesLog']['find'](_0x6607bf)[_0x098c('0x27')](handleEntityNotFound(_0x5e43c7,null))[_0x098c('0x27')](respondWithResult(_0x5e43c7,null))['catch'](handleError(_0x5e43c7,null));};exports[_0x098c('0x46')]=function(_0x1ac6b2,_0xd5dd7b){return db[_0x098c('0x2e')]['create'](_0x1ac6b2[_0x098c('0x47')],{})[_0x098c('0x27')](respondWithResult(_0xd5dd7b,0xc9))['catch'](handleError(_0xd5dd7b,null));};exports[_0x098c('0x25')]=function(_0x1e60d1,_0x127e03){if(_0x1e60d1[_0x098c('0x47')]['id']){delete _0x1e60d1[_0x098c('0x47')]['id'];}return db['VoiceQueuesLog'][_0x098c('0x48')]({'where':{'id':_0x1e60d1['params']['id']}})[_0x098c('0x27')](handleEntityNotFound(_0x127e03,null))[_0x098c('0x27')](saveUpdates(_0x1e60d1[_0x098c('0x47')],null))['then'](respondWithResult(_0x127e03,null))[_0x098c('0x49')](handleError(_0x127e03,null));};exports[_0x098c('0x26')]=function(_0x46e996,_0x1eff48){return db['VoiceQueuesLog'][_0x098c('0x48')]({'where':{'id':_0x46e996['params']['id']}})[_0x098c('0x27')](handleEntityNotFound(_0x1eff48,null))['then'](removeEntity(_0x1eff48,null))[_0x098c('0x49')](handleError(_0x1eff48,null));};
\ No newline at end of file
index 8d17228..676c660 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc951=['event_dtm','event','dtm','util','../../config/logger','api','moment','request-promise','path','exports','define','VoiceQueuesLog','voice_queues_log'];(function(_0x367fa2,_0x1722da){var _0x3c9bd4=function(_0x3cf721){while(--_0x3cf721){_0x367fa2['push'](_0x367fa2['shift']());}};_0x3c9bd4(++_0x1722da);}(_0xc951,0x1a3));var _0x1c95=function(_0x3da106,_0x2b6f38){_0x3da106=_0x3da106-0x0;var _0x21a55c=_0xc951[_0x3da106];return _0x21a55c;};'use strict';var _=require('lodash');var util=require(_0x1c95('0x0'));var logger=require(_0x1c95('0x1'))(_0x1c95('0x2'));var moment=require(_0x1c95('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c95('0x4'));var fs=require('fs');var path=require(_0x1c95('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0x1c95('0x6')]=function(_0x1c2648,_0x4cc66b){return _0x1c2648[_0x1c95('0x7')](_0x1c95('0x8'),attributes,{'tableName':_0x1c95('0x9'),'paranoid':![],'indexes':[{'name':_0x1c95('0xa'),'fields':[_0x1c95('0xb'),_0x1c95('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x2b44=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','../../config/logger','api','moment','bluebird'];(function(_0x35c17c,_0x4842e6){var _0x3fc781=function(_0x809d1a){while(--_0x809d1a){_0x35c17c['push'](_0x35c17c['shift']());}};_0x3fc781(++_0x4842e6);}(_0x2b44,0x1d7));var _0x42b4=function(_0x2756fb,_0x3044fc){_0x2756fb=_0x2756fb-0x0;var _0x2bb604=_0x2b44[_0x2756fb];return _0x2bb604;};'use strict';var _=require(_0x42b4('0x0'));var util=require('util');var logger=require(_0x42b4('0x1'))(_0x42b4('0x2'));var moment=require(_0x42b4('0x3'));var BPromise=require(_0x42b4('0x4'));var rp=require(_0x42b4('0x5'));var fs=require('fs');var path=require(_0x42b4('0x6'));var rimraf=require(_0x42b4('0x7'));var config=require(_0x42b4('0x8'));var attributes=require(_0x42b4('0x9'));module[_0x42b4('0xa')]=function(_0x4e31d7,_0x28a60a){return _0x4e31d7[_0x42b4('0xb')](_0x42b4('0xc'),attributes,{'tableName':_0x42b4('0xd'),'paranoid':![],'indexes':[{'name':_0x42b4('0xe'),'fields':[_0x42b4('0xf'),_0x42b4('0x10')]}],'timestamps':![]});};
\ No newline at end of file
index 9ec6ae8..64c8ade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdeb=['stringify','error','message','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0xbdeb,0x6f));var _0xbbde=function(_0x11d947,_0xcbf4d8){_0x11d947=_0x11d947-0x0;var _0x47929e=_0xbdeb[_0x11d947];return _0x47929e;};'use strict';var _=require('lodash');var util=require(_0xbbde('0x0'));var moment=require('moment');var BPromise=require(_0xbbde('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbde('0x2'));var db=require(_0xbbde('0x3'))['db'];var utils=require(_0xbbde('0x4'));var logger=require(_0xbbde('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbbde('0x6'));var client=jayson[_0xbbde('0x7')][_0xbbde('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a8482,_0x5e6273,_0x49966c){return new BPromise(function(_0x3215c9,_0x17df59){return client['request'](_0x1a8482,_0x49966c)[_0xbbde('0x9')](function(_0xec50fa){logger[_0xbbde('0xa')](_0xbbde('0xb'),_0x5e6273,_0xbbde('0xc'));logger[_0xbbde('0xd')](_0xbbde('0xe'),_0x5e6273,_0xbbde('0xc'),JSON[_0xbbde('0xf')](_0xec50fa));if(_0xec50fa[_0xbbde('0x10')]){if(_0xec50fa['error']['code']===0x1f4){logger[_0xbbde('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5e6273,_0xec50fa[_0xbbde('0x10')]['message']);return _0x17df59(_0xec50fa[_0xbbde('0x10')][_0xbbde('0x11')]);}logger[_0xbbde('0x10')](_0xbbde('0xb'),_0x5e6273,_0xec50fa[_0xbbde('0x10')][_0xbbde('0x11')]);return _0x3215c9(_0xec50fa[_0xbbde('0x10')]['message']);}else{logger[_0xbbde('0xa')](_0xbbde('0xb'),_0x5e6273,'request\x20sent');_0x3215c9(_0xec50fa['result'][_0xbbde('0x11')]);}})['catch'](function(_0x88e8a5){logger['error'](_0xbbde('0xb'),_0x5e6273,_0x88e8a5);_0x17df59(_0x88e8a5);});});}
\ No newline at end of file
+var _0x1123=['moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x360840,_0x2041f3){var _0x343de6=function(_0x1e26aa){while(--_0x1e26aa){_0x360840['push'](_0x360840['shift']());}};_0x343de6(++_0x2041f3);}(_0x1123,0x118));var _0x3112=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1123[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3112('0x0'));var BPromise=require('bluebird');var rs=require(_0x3112('0x1'));var fs=require('fs');var Redis=require(_0x3112('0x2'));var db=require(_0x3112('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3112('0x4'));var config=require(_0x3112('0x5'));var jayson=require(_0x3112('0x6'));var client=jayson[_0x3112('0x7')][_0x3112('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e2b5c,_0x3bee38,_0x3f7ae4){return new BPromise(function(_0x3cd83c,_0x4849f9){return client[_0x3112('0x9')](_0x3e2b5c,_0x3f7ae4)[_0x3112('0xa')](function(_0x39b75b){logger[_0x3112('0xb')](_0x3112('0xc'),_0x3bee38,_0x3112('0xd'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x3bee38,_0x3112('0xd'),JSON[_0x3112('0xe')](_0x39b75b));if(_0x39b75b[_0x3112('0xf')]){if(_0x39b75b[_0x3112('0xf')][_0x3112('0x10')]===0x1f4){logger['error'](_0x3112('0xc'),_0x3bee38,_0x39b75b['error']['message']);return _0x4849f9(_0x39b75b[_0x3112('0xf')][_0x3112('0x11')]);}logger[_0x3112('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3bee38,_0x39b75b['error'][_0x3112('0x11')]);return _0x3cd83c(_0x39b75b['error'][_0x3112('0x11')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x3bee38,_0x3112('0xd'));_0x3cd83c(_0x39b75b[_0x3112('0x12')]['message']);}})[_0x3112('0x13')](function(_0x3f5cfd){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x3bee38,_0x3f5cfd);_0x4849f9(_0x3f5cfd);});});}
\ No newline at end of file
index f29d1a0..cc85100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b79=['../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','/:id/downloads','downloads','create','post','/:id/transcribe','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x5b79,0x1e7));var _0x95b7=function(_0x3e1a10,_0x6aeaf2){_0x3e1a10=_0x3e1a10-0x0;var _0x2fb8ee=_0x5b79[_0x3e1a10];return _0x2fb8ee;};'use strict';var multer=require(_0x95b7('0x0'));var util=require(_0x95b7('0x1'));var path=require('path');var timeout=require(_0x95b7('0x2'));var express=require(_0x95b7('0x3'));var router=express[_0x95b7('0x4')]();var fs_extra=require(_0x95b7('0x5'));var auth=require(_0x95b7('0x6'));var interaction=require(_0x95b7('0x7'));var config=require(_0x95b7('0x8'));var controller=require(_0x95b7('0x9'));router[_0x95b7('0xa')]('/',auth[_0x95b7('0xb')](),controller[_0x95b7('0xc')]);router['get'](_0x95b7('0xd'),auth[_0x95b7('0xb')](),controller[_0x95b7('0xe')]);router[_0x95b7('0xa')](_0x95b7('0xf'),auth[_0x95b7('0xb')](),controller['show']);router[_0x95b7('0xa')](_0x95b7('0x10'),auth[_0x95b7('0xb')](),controller[_0x95b7('0x11')]);router[_0x95b7('0xa')](_0x95b7('0x12'),controller[_0x95b7('0x13')]);router[_0x95b7('0xa')]('/:id/transcribe',auth['isAuthenticated'](),controller['downloadTranscribe']);router['post']('/',auth[_0x95b7('0xb')](),controller[_0x95b7('0x14')]);router[_0x95b7('0x15')](_0x95b7('0x16'),auth['isAuthenticated'](),controller['runTranscribe']);router[_0x95b7('0x17')](_0x95b7('0xf'),auth[_0x95b7('0xb')](),controller[_0x95b7('0x18')]);router['delete'](_0x95b7('0xf'),auth[_0x95b7('0xb')](),controller[_0x95b7('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x3959=['/:id/transcribe','runTranscribe','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','create','post'];(function(_0x1325b5,_0x20c67e){var _0x49e29c=function(_0x142646){while(--_0x142646){_0x1325b5['push'](_0x1325b5['shift']());}};_0x49e29c(++_0x20c67e);}(_0x3959,0x190));var _0x9395=function(_0x1d3b81,_0x3acf80){_0x1d3b81=_0x1d3b81-0x0;var _0x1a615c=_0x3959[_0x1d3b81];return _0x1a615c;};'use strict';var multer=require(_0x9395('0x0'));var util=require('util');var path=require(_0x9395('0x1'));var timeout=require(_0x9395('0x2'));var express=require(_0x9395('0x3'));var router=express[_0x9395('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9395('0x5'));var interaction=require(_0x9395('0x6'));var config=require(_0x9395('0x7'));var controller=require('./voiceRecording.controller');router[_0x9395('0x8')]('/',auth[_0x9395('0x9')](),controller[_0x9395('0xa')]);router[_0x9395('0x8')]('/describe',auth[_0x9395('0x9')](),controller[_0x9395('0xb')]);router[_0x9395('0x8')]('/:id',auth[_0x9395('0x9')](),controller[_0x9395('0xc')]);router[_0x9395('0x8')](_0x9395('0xd'),auth[_0x9395('0x9')](),controller[_0x9395('0xe')]);router[_0x9395('0x8')](_0x9395('0xf'),controller[_0x9395('0x10')]);router[_0x9395('0x8')]('/:id/transcribe',auth[_0x9395('0x9')](),controller[_0x9395('0x11')]);router['post']('/',auth[_0x9395('0x9')](),controller[_0x9395('0x12')]);router[_0x9395('0x13')](_0x9395('0x14'),auth['isAuthenticated'](),controller[_0x9395('0x15')]);router[_0x9395('0x16')](_0x9395('0x17'),auth[_0x9395('0x9')](),controller[_0x9395('0x18')]);router[_0x9395('0x19')](_0x9395('0x17'),auth[_0x9395('0x9')](),controller[_0x9395('0x1a')]);module[_0x9395('0x1b')]=router;
\ No newline at end of file
index e74be86..997df99 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(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 f773373..37aad38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3f3=['fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','merge','VoiceRecording','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','uniqueid','value','%s.cypher','secrets','recording','existsSync','Sequelize','filename','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','../../components/encryptor','sequelize','MD5','col','token','$and','push','decryptFile','ValidationError','extname','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','transcribeName','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','findOne','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','Content-Range','apply','save','update','then','sendStatus','error','name','send','index','rawAttributes','type','key','model','differenceBy','map','format','query','keys','attributes','intersection'];(function(_0x2aee30,_0x5465df){var _0x1f3407=function(_0x33d351){while(--_0x33d351){_0x2aee30['push'](_0x2aee30['shift']());}};_0x1f3407(++_0x5465df);}(_0xc3f3,0x19b));var _0x3c3f=function(_0x5a9a76,_0x28086a){_0x5a9a76=_0x5a9a76-0x0;var _0x28c3b5=_0xc3f3[_0x5a9a76];return _0x28c3b5;};'use strict';var emlformat=require(_0x3c3f('0x0'));var rimraf=require(_0x3c3f('0x1'));var zipdir=require(_0x3c3f('0x2'));var jsonpatch=require(_0x3c3f('0x3'));var rp=require(_0x3c3f('0x4'));var moment=require(_0x3c3f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3c3f('0x6'));var util=require('util');var path=require(_0x3c3f('0x7'));var sox=require(_0x3c3f('0x8'));var csv=require(_0x3c3f('0x9'));var ejs=require(_0x3c3f('0xa'));var fs=require('fs');var fs_extra=require(_0x3c3f('0xb'));var _=require(_0x3c3f('0xc'));var squel=require(_0x3c3f('0xd'));var crypto=require(_0x3c3f('0xe'));var jsforce=require(_0x3c3f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3c3f('0x9'));var querystring=require(_0x3c3f('0x10'));var Papa=require(_0x3c3f('0x11'));var AWS=require(_0x3c3f('0x12'));var uuidv4=require(_0x3c3f('0x13'));var Redis=require(_0x3c3f('0x14'));var authService=require(_0x3c3f('0x15'));var qs=require(_0x3c3f('0x16'));var as=require(_0x3c3f('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c3f('0x18'))('api');var utils=require(_0x3c3f('0x19'));var config=require(_0x3c3f('0x1a'));var licenseUtil=require(_0x3c3f('0x1b'));var db=require(_0x3c3f('0x1c'))['db'];function respondWithStatusCode(_0x5828aa,_0x1a107a){_0x1a107a=_0x1a107a||0xcc;return function(_0x36ea09){if(_0x36ea09){return _0x5828aa['sendStatus'](_0x1a107a);}return _0x5828aa['status'](_0x1a107a)[_0x3c3f('0x1d')]();};}function respondWithResult(_0x15bc1c,_0x153621){_0x153621=_0x153621||0xc8;return function(_0x5f0820){if(_0x5f0820){return _0x15bc1c[_0x3c3f('0x1e')](_0x153621)[_0x3c3f('0x1f')](_0x5f0820);}};}function respondWithFilteredResult(_0x3ada80,_0x5406fb){return function(_0x384bbc){if(_0x384bbc){var _0x216544=typeof _0x5406fb['offset']===_0x3c3f('0x20')&&typeof _0x5406fb['limit']===_0x3c3f('0x20');var _0x592eb7=_0x384bbc[_0x3c3f('0x21')];var _0x13b44c=_0x216544?0x0:_0x5406fb[_0x3c3f('0x22')];var _0x484b78=_0x216544?_0x384bbc[_0x3c3f('0x21')]:_0x5406fb[_0x3c3f('0x22')]+_0x5406fb[_0x3c3f('0x23')];var _0x53867d;if(_0x484b78>=_0x592eb7){_0x484b78=_0x592eb7;_0x53867d=0xc8;}else{_0x53867d=0xce;}_0x3ada80['status'](_0x53867d);return _0x3ada80['set'](_0x3c3f('0x24'),_0x13b44c+'-'+_0x484b78+'/'+_0x592eb7)['json'](_0x384bbc);}return null;};}function patchUpdates(_0x50ac2d){return function(_0x1c6492){try{jsonpatch[_0x3c3f('0x25')](_0x1c6492,_0x50ac2d,!![]);}catch(_0x63aceb){return BPromise['reject'](_0x63aceb);}return _0x1c6492[_0x3c3f('0x26')]();};}function saveUpdates(_0x30f059,_0x5d5756){return function(_0x1eceff){if(_0x1eceff){return _0x1eceff[_0x3c3f('0x27')](_0x30f059)[_0x3c3f('0x28')](function(_0x4d8ea6){return _0x4d8ea6;});}return null;};}function removeEntity(_0x14c65b,_0x515a0a){return function(_0xffc75d){if(_0xffc75d){return _0xffc75d['destroy']()[_0x3c3f('0x28')](function(){_0x14c65b[_0x3c3f('0x1e')](0xcc)[_0x3c3f('0x1d')]();});}};}function handleEntityNotFound(_0x778a16,_0x50570a){return function(_0x56eccd){if(!_0x56eccd){_0x778a16[_0x3c3f('0x29')](0x194);}return _0x56eccd;};}function handleError(_0x54c139,_0x55e794){_0x55e794=_0x55e794||0x1f4;return function(_0x4c027a){logger[_0x3c3f('0x2a')](_0x4c027a['stack']);if(_0x4c027a['name']){delete _0x4c027a[_0x3c3f('0x2b')];}_0x54c139[_0x3c3f('0x1e')](_0x55e794)[_0x3c3f('0x2c')](_0x4c027a);};}exports[_0x3c3f('0x2d')]=function(_0x159592,_0x597078){var _0x5e9957={},_0x2f3378={},_0x991fbe={'count':0x0,'rows':[]};var _0x8f129c=_['map'](db['VoiceRecording'][_0x3c3f('0x2e')],function(_0x520127){return{'name':_0x520127['fieldName'],'type':_0x520127[_0x3c3f('0x2f')][_0x3c3f('0x30')]};});_0x2f3378[_0x3c3f('0x31')]=_[_0x3c3f('0x32')](_[_0x3c3f('0x33')](_0x8f129c,_0x3c3f('0x2b')),[_0x3c3f('0x34')]);_0x2f3378[_0x3c3f('0x35')]=_[_0x3c3f('0x36')](_0x159592[_0x3c3f('0x35')]);_0x2f3378['filters']=_['intersection'](_0x2f3378[_0x3c3f('0x31')],_0x2f3378['query']);_0x5e9957[_0x3c3f('0x37')]=_[_0x3c3f('0x38')](_0x2f3378['model'],qs[_0x3c3f('0x39')](_0x159592[_0x3c3f('0x35')]['fields']));_0x5e9957[_0x3c3f('0x37')]=_0x5e9957[_0x3c3f('0x37')][_0x3c3f('0x3a')]?_0x5e9957['attributes']:_0x2f3378['model'];if(!_0x159592[_0x3c3f('0x35')][_0x3c3f('0x3b')]('nolimit')){_0x5e9957[_0x3c3f('0x23')]=qs[_0x3c3f('0x23')](_0x159592[_0x3c3f('0x35')][_0x3c3f('0x23')]);_0x5e9957[_0x3c3f('0x22')]=qs[_0x3c3f('0x22')](_0x159592[_0x3c3f('0x35')][_0x3c3f('0x22')]);}_0x5e9957[_0x3c3f('0x3c')]=qs[_0x3c3f('0x3d')](_0x159592['query']['sort']);_0x5e9957[_0x3c3f('0x3e')]=qs['filters'](_['pick'](_0x159592[_0x3c3f('0x35')],_0x2f3378[_0x3c3f('0x3f')]),_0x8f129c);if(_0x159592[_0x3c3f('0x35')]['filter']){_0x5e9957[_0x3c3f('0x3e')]=_['merge'](_0x5e9957[_0x3c3f('0x3e')],{'$or':_[_0x3c3f('0x33')](_0x8f129c,function(_0x403c7d){if(_0x403c7d[_0x3c3f('0x2f')]!==_0x3c3f('0x40')){var _0x10c210={};_0x10c210[_0x403c7d[_0x3c3f('0x2b')]]={'$like':'%'+_0x159592[_0x3c3f('0x35')]['filter']+'%'};return _0x10c210;}})});}_0x5e9957=_[_0x3c3f('0x41')]({},_0x5e9957,_0x159592['options']);var _0xcbcd51={'where':_0x5e9957[_0x3c3f('0x3e')]};return db[_0x3c3f('0x42')][_0x3c3f('0x21')](_0xcbcd51)[_0x3c3f('0x28')](function(_0x43f051){_0x991fbe[_0x3c3f('0x21')]=_0x43f051;if(_0x159592[_0x3c3f('0x35')][_0x3c3f('0x43')]){_0x5e9957[_0x3c3f('0x44')]=[{'all':!![]}];}return db['VoiceRecording'][_0x3c3f('0x45')](_0x5e9957);})[_0x3c3f('0x28')](function(_0x40df84){_0x991fbe[_0x3c3f('0x46')]=_0x40df84;return _0x991fbe;})[_0x3c3f('0x28')](respondWithFilteredResult(_0x597078,_0x5e9957))[_0x3c3f('0x47')](handleError(_0x597078,null));};exports[_0x3c3f('0x48')]=function(_0x1e7bbf,_0xb0d46b){var _0x51690d={'raw':![],'where':{'id':_0x1e7bbf[_0x3c3f('0x49')]['id']}},_0x1d31f6={};_0x1d31f6[_0x3c3f('0x31')]=_[_0x3c3f('0x36')](db[_0x3c3f('0x42')]['rawAttributes']);_0x1d31f6[_0x3c3f('0x35')]=_[_0x3c3f('0x36')](_0x1e7bbf['query']);_0x1d31f6['filters']=_[_0x3c3f('0x38')](_0x1d31f6[_0x3c3f('0x31')],_0x1d31f6[_0x3c3f('0x35')]);_0x51690d[_0x3c3f('0x37')]=_[_0x3c3f('0x38')](_0x1d31f6[_0x3c3f('0x31')],qs[_0x3c3f('0x39')](_0x1e7bbf['query']['fields']));_0x51690d['attributes']=_0x51690d['attributes'][_0x3c3f('0x3a')]?_0x51690d[_0x3c3f('0x37')]:_0x1d31f6['model'];if(_0x1e7bbf[_0x3c3f('0x35')][_0x3c3f('0x43')]){_0x51690d[_0x3c3f('0x44')]=[{'all':!![]}];}_0x51690d=_[_0x3c3f('0x41')]({},_0x51690d,_0x1e7bbf['options']);return db[_0x3c3f('0x42')]['find'](_0x51690d)['then'](handleEntityNotFound(_0xb0d46b,null))['then'](respondWithResult(_0xb0d46b,null))[_0x3c3f('0x47')](handleError(_0xb0d46b,null));};exports[_0x3c3f('0x4a')]=function(_0x3e4a82,_0x35e304){return db[_0x3c3f('0x42')][_0x3c3f('0x4a')](_0x3e4a82[_0x3c3f('0x4b')],{})['then'](respondWithResult(_0x35e304,0xc9))[_0x3c3f('0x47')](handleError(_0x35e304,null));};exports[_0x3c3f('0x27')]=function(_0x5a9741,_0x4eddce){if(_0x5a9741['body']['id']){delete _0x5a9741['body']['id'];}return db['VoiceRecording'][_0x3c3f('0x4c')]({'where':{'id':_0x5a9741[_0x3c3f('0x49')]['id']}})[_0x3c3f('0x28')](handleEntityNotFound(_0x4eddce,null))[_0x3c3f('0x28')](saveUpdates(_0x5a9741['body'],null))[_0x3c3f('0x28')](respondWithResult(_0x4eddce,null))['catch'](handleError(_0x4eddce,null));};exports[_0x3c3f('0x4d')]=function(_0x363ac6,_0x124958){return db[_0x3c3f('0x42')][_0x3c3f('0x4d')]()['then'](respondWithResult(_0x124958,null))[_0x3c3f('0x47')](handleError(_0x124958,null));};exports['download']=function(_0xaf1478,_0x2ede24,_0x2b2727){var _0x69854c=require('../../components/encryptor');var _0x27ee27=![];var _0x4939c9={};if(_0xaf1478[_0x3c3f('0x35')][_0x3c3f('0x2f')]&&_0xaf1478[_0x3c3f('0x35')][_0x3c3f('0x2f')]===_0x3c3f('0x4e')){_0x4939c9[_0x3c3f('0x4e')]=_0xaf1478['params']['id'];}else{_0x4939c9['id']=_0xaf1478[_0x3c3f('0x49')]['id'];}return db[_0x3c3f('0x42')][_0x3c3f('0x4c')]({'where':_0x4939c9,'attributes':['id','value'],'raw':!![]})[_0x3c3f('0x28')](handleEntityNotFound(_0x2ede24,null))[_0x3c3f('0x28')](function(_0x36e575){if(_0x36e575){var _0x224b37=_0x36e575[_0x3c3f('0x4f')];var _0x354247=util['format'](_0x3c3f('0x50'),_0x224b37);if(fs['existsSync'](_0x354247)){_0x27ee27=!![];return _0x69854c['decryptFile'](_0x354247,_0x224b37,config[_0x3c3f('0x51')][_0x3c3f('0x52')])['then'](function(){return _0x36e575;});}return _0x36e575;}})[_0x3c3f('0x28')](function(_0x237c7c){if(_0x237c7c){var _0x5c521c=_0x237c7c[_0x3c3f('0x4f')];if(!fs[_0x3c3f('0x53')](_0x5c521c)){throw new db[(_0x3c3f('0x54'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x237c7c[_0x3c3f('0x55')]){return _0x2ede24['download'](_0x5c521c,_0x237c7c[_0x3c3f('0x55')]+path['extname'](_0x5c521c),function(){if(_0x27ee27){fs['unlink'](_0x5c521c);}});}else{return _0x2ede24['download'](_0x5c521c,function(_0x3ac896){if(_0x27ee27){fs[_0x3c3f('0x56')](_0x5c521c);}});}}})[_0x3c3f('0x47')](function(_0x134952){if(_0x134952[_0x3c3f('0x57')]===_0x3c3f('0x58')){_0x2ede24[_0x3c3f('0x1e')](0x194)['send'](_0x3c3f('0x59'));}else{return handleError(_0x2ede24,null);}});};exports['downloads']=function(_0x423624,_0x2ac1a3,_0x494ea1){var _0x241c96=require(_0x3c3f('0x5a'));var _0x204d4e=![];var _0x80f0b={'$and':[db[_0x3c3f('0x5b')]['where'](db['sequelize']['fn'](_0x3c3f('0x5c'),db[_0x3c3f('0x5b')][_0x3c3f('0x5d')](_0x3c3f('0x4e'))),_0x423624['query'][_0x3c3f('0x5e')])]};if(_0x423624[_0x3c3f('0x35')][_0x3c3f('0x2f')]&&_0x423624[_0x3c3f('0x35')][_0x3c3f('0x2f')]==='uniqueid'){_0x80f0b[_0x3c3f('0x5f')][_0x3c3f('0x60')]({'uniqueid':_0x423624[_0x3c3f('0x49')]['id']});}else{_0x80f0b['$and']['push']({'id':_0x423624[_0x3c3f('0x49')]['id']});}return db[_0x3c3f('0x42')][_0x3c3f('0x4c')]({'where':_0x80f0b,'attributes':['id','value'],'raw':!![]})[_0x3c3f('0x28')](handleEntityNotFound(_0x2ac1a3,null))[_0x3c3f('0x28')](function(_0x100e95){if(_0x100e95){var _0x3d7a6f=util['format'](_0x3c3f('0x50'),_0x100e95[_0x3c3f('0x4f')]);if(fs[_0x3c3f('0x53')](_0x3d7a6f)){_0x204d4e=!![];return _0x241c96[_0x3c3f('0x61')](_0x3d7a6f,_0x100e95[_0x3c3f('0x4f')],config[_0x3c3f('0x51')]['recording'])[_0x3c3f('0x28')](function(){return _0x100e95;});}return _0x100e95;}})['then'](function(_0x5beae4){if(_0x5beae4){if(!fs[_0x3c3f('0x53')](_0x5beae4[_0x3c3f('0x4f')])){throw new db[(_0x3c3f('0x54'))][(_0x3c3f('0x62'))](_0x3c3f('0x58'));}if(_0x5beae4['filename']){return _0x2ac1a3['download'](_0x5beae4[_0x3c3f('0x4f')],_0x5beae4[_0x3c3f('0x55')]+path[_0x3c3f('0x63')](_0x5beae4[_0x3c3f('0x4f')]),function(){if(_0x204d4e){fs[_0x3c3f('0x56')](_0x5beae4[_0x3c3f('0x4f')]);}});}else{return _0x2ac1a3['download'](_0x5beae4[_0x3c3f('0x4f')],function(_0x5060dd){if(_0x204d4e){fs[_0x3c3f('0x56')](_0x5beae4[_0x3c3f('0x4f')]);}});}}})[_0x3c3f('0x47')](handleError(_0x2ac1a3,null));};exports[_0x3c3f('0x64')]=function(_0x4ed2cc,_0x363b55){return db[_0x3c3f('0x42')][_0x3c3f('0x4c')]({'where':{'id':_0x4ed2cc[_0x3c3f('0x49')]['id']}})[_0x3c3f('0x28')](function(_0x460170){if(_[_0x3c3f('0x65')](_0x460170)){throw new ReferenceError(_0x3c3f('0x66'));}return _0x460170;})[_0x3c3f('0x28')](function(_0x4a9a71){var _0x59762e=_0x4a9a71[_0x3c3f('0x4f')];logger[_0x3c3f('0x67')](_0x3c3f('0x68'),_0x59762e);if(!_['isNil'](_0x4a9a71[_0x3c3f('0x4f')])&&fs[_0x3c3f('0x53')](_0x59762e)){logger['info'](_0x3c3f('0x69')+_0x59762e+_0x3c3f('0x6a'));fs[_0x3c3f('0x6b')](_0x59762e);}_0x59762e=_0x59762e+_0x3c3f('0x6c');if(!_[_0x3c3f('0x65')](_0x4a9a71[_0x3c3f('0x4f')])&&fs[_0x3c3f('0x53')](_0x59762e)){logger[_0x3c3f('0x67')](_0x3c3f('0x69')+_0x59762e+_0x3c3f('0x6a'));fs[_0x3c3f('0x6b')](_0x59762e);}return _0x4a9a71;})[_0x3c3f('0x28')](function(_0x453433){if(!_0x453433)throw new InternalError();return _0x453433[_0x3c3f('0x64')]();})['then'](function(){_0x363b55['status'](0xcc)['end']();})[_0x3c3f('0x47')](handleError(_0x363b55,null));};function getBucketslist(_0x420158,_0x262cba,_0x58389a){return new Promise(function(_0x5e4a21,_0x3b9cfd){var _0x2ba6c0=new AWS['S3']({'accessKeyId':_0x262cba,'secretAccessKey':_0x420158,'region':_0x58389a});_0x2ba6c0[_0x3c3f('0x6d')]({},function(_0x3a3a3d,_0x11f447){if(_0x3a3a3d){return _0x3b9cfd(_0x3a3a3d);}else{return _0x5e4a21(_0x11f447);}});});}function createBucket(_0x2fcb5b,_0x4ed7a9,_0x17a36d,_0x571e86){return new Promise(function(_0x4f1795,_0x519bcf){var _0x40ecc3=new AWS['S3']({'accessKeyId':_0x4ed7a9,'secretAccessKey':_0x2fcb5b,'region':_0x17a36d});_0x40ecc3[_0x3c3f('0x6e')]({'Bucket':_0x571e86},function(_0x4cd1cf,_0x21aff4){if(_0x4cd1cf){return _0x519bcf(_0x4cd1cf);}else{return _0x4f1795(_0x21aff4);}});});}function uploadFile(_0x2f5cf6,_0x1922b8,_0xd3c4f1,_0x549202,_0x363dbb,_0x4a82bd){return new Promise(function(_0x529742,_0x561e24){var _0x1c5c56=new AWS['S3']({'accessKeyId':_0x1922b8,'secretAccessKey':_0x2f5cf6,'region':_0xd3c4f1});_0x1c5c56[_0x3c3f('0x6f')]({'Bucket':_0x549202,'Key':_0x363dbb,'Body':_0x4a82bd},function(_0x5d2815,_0x3e10b4){if(_0x5d2815){return _0x561e24(_0x5d2815);}else{return _0x529742(_0x3e10b4);}});});}function startTranscribe(_0x59af03,_0x50545f,_0xd06d0f,_0x10defd,_0x332a16,_0x3e54d4){return new Promise(function(_0x2bd740,_0x577fbc){var _0xe1fef5=new AWS['TranscribeService']({'accessKeyId':_0x50545f,'secretAccessKey':_0x59af03,'region':_0xd06d0f});_0xe1fef5[_0x3c3f('0x70')]({'TranscriptionJobName':_0x10defd,'LanguageCode':_0x332a16,'Media':{'MediaFileUri':_0x3e54d4}},function(_0xf67149,_0x525c20){if(_0xf67149){return _0x577fbc(_0xf67149);}else{return _0x2bd740(_0x525c20);}});});}function transcribe(_0x351f2f,_0x5b7b47,_0x52881a,_0x4c0da8,_0x470d8f,_0x59981c,_0x1a8b9c){return new Promise(function(_0x50544b,_0x324be2){var _0x5f23ef={};logger[_0x3c3f('0x67')](util[_0x3c3f('0x34')](_0x3c3f('0x71'),_0x351f2f,_0x470d8f));return uploadFile(_0x5b7b47,_0x52881a,_0x4c0da8,_0x470d8f,path[_0x3c3f('0x72')](_0x59981c),fs[_0x3c3f('0x73')](_0x59981c))[_0x3c3f('0x28')](function(_0x5adca2){logger[_0x3c3f('0x67')](util['format'](_0x3c3f('0x74'),_0x351f2f,_0x470d8f,_0x5adca2['Location']));_0x5f23ef[_0x3c3f('0x75')]=_0x5adca2[_0x3c3f('0x76')];_0x5f23ef[_0x3c3f('0x77')]=_0x5adca2['Location'];logger[_0x3c3f('0x67')](util[_0x3c3f('0x34')](_0x3c3f('0x78'),_0x351f2f));return startTranscribe(_0x5b7b47,_0x52881a,_0x4c0da8,uuidv4(),_0x1a8b9c,_0x5adca2[_0x3c3f('0x79')]);})['then'](function(_0x2b3580){logger[_0x3c3f('0x67')](util[_0x3c3f('0x34')](_0x3c3f('0x7a'),_0x351f2f,_0x2b3580['TranscriptionJob']['TranscriptionJobName']));_0x5f23ef[_0x3c3f('0x7b')]=_0x2b3580[_0x3c3f('0x7c')][_0x3c3f('0x7d')];_0x5f23ef[_0x3c3f('0x7e')]=_0x2b3580[_0x3c3f('0x7c')][_0x3c3f('0x7f')];return _0x50544b(_0x5f23ef);})[_0x3c3f('0x47')](function(_0x5bc557){return _0x324be2(_0x5bc557);});});}exports['runTranscribe']=function(_0x238a36,_0x29667e,_0x73c2a4){var _0xa1a0b4;var _0x46d70e;var _0xc93d00;var _0x209c24=require('../../components/encryptor');return db['VoiceRecording']['findOne']({'where':{'id':_0x238a36[_0x3c3f('0x49')]['id']}})[_0x3c3f('0x28')](function(_0x433421){if(_0x433421){var _0x6145d9=util['format'](_0x3c3f('0x50'),_0x433421[_0x3c3f('0x4f')]);if(fs[_0x3c3f('0x53')](_0x6145d9)){cypher=!![];return _0x209c24[_0x3c3f('0x61')](_0x6145d9,_0x433421[_0x3c3f('0x4f')],config[_0x3c3f('0x51')][_0x3c3f('0x52')])['then'](function(){return _0x433421;});}return _0x433421;}})[_0x3c3f('0x28')](function(_0x44c1c2){if(!_0x44c1c2){throw new db['Sequelize'][(_0x3c3f('0x62'))]('Voice\x20Recording\x20not\x20found');}_0x46d70e=_0x44c1c2;return db['Setting'][_0x3c3f('0x80')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x29667e,null))[_0x3c3f('0x28')](function(_0x17a2d9){if(_0x17a2d9){_0xa1a0b4=_0x17a2d9;if(!_0xa1a0b4[_0x3c3f('0x81')]||!_0xa1a0b4[_0x3c3f('0x82')]||!_0xa1a0b4[_0x3c3f('0x83')]||!_0xa1a0b4[_0x3c3f('0x84')]||!_0xa1a0b4['bucket']){throw new db[(_0x3c3f('0x54'))][(_0x3c3f('0x62'))](_0x3c3f('0x85'));}if(_0x238a36[_0x3c3f('0x4b')][_0x3c3f('0x86')]&&(!_0xa1a0b4[_0x3c3f('0x87')]||!_0xa1a0b4[_0x3c3f('0x88')]||!_0xa1a0b4[_0x3c3f('0x89')]||!_0xa1a0b4[_0x3c3f('0x84')]||!_0xa1a0b4['bucket'])){throw new db[(_0x3c3f('0x54'))][(_0x3c3f('0x62'))](_0x3c3f('0x8a'));}return db[_0x3c3f('0x8b')][_0x3c3f('0x80')]({'where':{'id':_0xa1a0b4['transcribeAccountId']}});}})[_0x3c3f('0x28')](function(_0x304c76){if(!_0x304c76){throw new db[(_0x3c3f('0x54'))][(_0x3c3f('0x62'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x304c76[_0x3c3f('0x8c')]||!_0x304c76[_0x3c3f('0x8d')]){throw new db[(_0x3c3f('0x54'))][(_0x3c3f('0x62'))](_0x3c3f('0x8e'));}_0xc93d00=_0x304c76;return getBucketslist(_0xc93d00[_0x3c3f('0x8c')],_0xc93d00[_0x3c3f('0x8d')],_0xa1a0b4[_0x3c3f('0x83')]);})[_0x3c3f('0x28')](function(_0x310bd4){if(_0x310bd4&&_0x310bd4[_0x3c3f('0x8f')]){var _0x4a8bac=_['find'](_0x310bd4[_0x3c3f('0x8f')],function(_0x89f290){return _0x89f290['Name']===_0xa1a0b4[_0x3c3f('0x75')];});if(!_0x4a8bac){logger[_0x3c3f('0x67')](util[_0x3c3f('0x34')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x238a36[_0x3c3f('0x49')]['id'],_0xa1a0b4[_0x3c3f('0x75')]));return createBucket(_0xc93d00[_0x3c3f('0x8c')],_0xc93d00[_0x3c3f('0x8d')],_0xa1a0b4['transcribeRegion'],_0xa1a0b4['bucket']);}logger[_0x3c3f('0x67')](util[_0x3c3f('0x34')](_0x3c3f('0x90'),_0x238a36['params']['id'],_0xa1a0b4[_0x3c3f('0x75')]));return;}})[_0x3c3f('0x28')](function(_0x10ad73){if(_0x46d70e[_0x3c3f('0x7e')]===_0x3c3f('0x91')){return transcribe(_0x238a36['params']['id'],_0xc93d00[_0x3c3f('0x8c')],_0xc93d00['data2'],_0xa1a0b4[_0x3c3f('0x83')],_0xa1a0b4['bucket'],_0x46d70e[_0x3c3f('0x4f')],_0xa1a0b4[_0x3c3f('0x84')]);}else{logger[_0x3c3f('0x67')](util['format'](_0x3c3f('0x92'),_0x238a36[_0x3c3f('0x49')]['id']));return{'transcribeStatus':_0x3c3f('0x93')};}})[_0x3c3f('0x28')](function(_0x517a8f){if(_0x517a8f){_0x517a8f['tempSentiment']=_0x238a36[_0x3c3f('0x4b')]['runSentiment'];return _0x46d70e[_0x3c3f('0x94')](_0x517a8f);}})['then'](respondWithResult(_0x29667e,null))[_0x3c3f('0x47')](handleError(_0x29667e,null));};function writeFile(_0x53898f,_0x1b5c3b){return new Promise(function(_0x451b17,_0x28ed6b){fs[_0x3c3f('0x95')](_0x1b5c3b,_0x53898f,function(_0x3927bd,_0x113cc7){if(_0x3927bd){return _0x28ed6b(_0x3927bd);}else{return _0x451b17(_0x113cc7);}});});}exports[_0x3c3f('0x96')]=function(_0x2dd83d,_0x5de054,_0x213ba0){return db['VoiceRecording'][_0x3c3f('0x80')]({'where':{'id':_0x2dd83d['params']['id']}})[_0x3c3f('0x28')](handleEntityNotFound(_0x5de054))[_0x3c3f('0x28')](function(_0x2605b7){if(_0x2605b7&&_0x2605b7[_0x3c3f('0x97')]){var _0xfa1700=_0x2605b7[_0x3c3f('0x97')];var _0x494639=config[_0x3c3f('0x98')]+_0x3c3f('0x99')+_0x2605b7['id']+_0x3c3f('0x9a');if(fs[_0x3c3f('0x53')](_0x494639)){return _0x494639;}return writeFile(_0xfa1700,_0x494639)[_0x3c3f('0x28')](function(){return _0x494639;});}else{throw new db[(_0x3c3f('0x54'))][(_0x3c3f('0x62'))]('Transcript\x20not\x20available');}})[_0x3c3f('0x28')](function(_0x29eea7){return _0x5de054[_0x3c3f('0x9b')](_0x29eea7);})[_0x3c3f('0x47')](handleError(_0x5de054));};
\ No newline at end of file
+var _0x56aa=['fieldName','type','key','model','differenceBy','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','rows','catch','params','includeAll','include','options','find','create','body','describe','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','filename','unlink','message','downloads','sequelize','col','token','push','$and','decryptFile','extname','Entity\x20not\x20found','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','root','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','offset','limit','set','apply','update','destroy','then','end','error','stack','name','send','VoiceRecording','rawAttributes'];(function(_0x6b82e2,_0x3e8a17){var _0x30376e=function(_0x420aaa){while(--_0x420aaa){_0x6b82e2['push'](_0x6b82e2['shift']());}};_0x30376e(++_0x3e8a17);}(_0x56aa,0x105));var _0xa56a=function(_0xe33285,_0x7f474){_0xe33285=_0xe33285-0x0;var _0x31ca6b=_0x56aa[_0xe33285];return _0x31ca6b;};'use strict';var emlformat=require(_0xa56a('0x0'));var rimraf=require(_0xa56a('0x1'));var zipdir=require(_0xa56a('0x2'));var jsonpatch=require(_0xa56a('0x3'));var rp=require(_0xa56a('0x4'));var moment=require(_0xa56a('0x5'));var BPromise=require(_0xa56a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa56a('0x7'));var csv=require('to-csv');var ejs=require(_0xa56a('0x8'));var fs=require('fs');var fs_extra=require(_0xa56a('0x9'));var _=require(_0xa56a('0xa'));var squel=require(_0xa56a('0xb'));var crypto=require(_0xa56a('0xc'));var jsforce=require(_0xa56a('0xd'));var deskjs=require(_0xa56a('0xe'));var toCsv=require(_0xa56a('0xf'));var querystring=require(_0xa56a('0x10'));var Papa=require(_0xa56a('0x11'));var AWS=require(_0xa56a('0x12'));var uuidv4=require(_0xa56a('0x13'));var Redis=require(_0xa56a('0x14'));var authService=require(_0xa56a('0x15'));var qs=require(_0xa56a('0x16'));var as=require(_0xa56a('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa56a('0x18'))(_0xa56a('0x19'));var utils=require('../../config/utils');var config=require(_0xa56a('0x1a'));var licenseUtil=require(_0xa56a('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aa6d9,_0x2e35d2){_0x2e35d2=_0x2e35d2||0xcc;return function(_0x5462da){if(_0x5462da){return _0x5aa6d9[_0xa56a('0x1c')](_0x2e35d2);}return _0x5aa6d9['status'](_0x2e35d2)['end']();};}function respondWithResult(_0x14068e,_0x3ce95c){_0x3ce95c=_0x3ce95c||0xc8;return function(_0x46d60b){if(_0x46d60b){return _0x14068e[_0xa56a('0x1d')](_0x3ce95c)[_0xa56a('0x1e')](_0x46d60b);}};}function respondWithFilteredResult(_0x2df37a,_0xe2932d){return function(_0xa1d565){if(_0xa1d565){var _0x2f1e01=typeof _0xe2932d['offset']==='undefined'&&typeof _0xe2932d['limit']===_0xa56a('0x1f');var _0x32a070=_0xa1d565[_0xa56a('0x20')];var _0x1aa4f6=_0x2f1e01?0x0:_0xe2932d[_0xa56a('0x21')];var _0x54e235=_0x2f1e01?_0xa1d565[_0xa56a('0x20')]:_0xe2932d[_0xa56a('0x21')]+_0xe2932d[_0xa56a('0x22')];var _0x25a5b3;if(_0x54e235>=_0x32a070){_0x54e235=_0x32a070;_0x25a5b3=0xc8;}else{_0x25a5b3=0xce;}_0x2df37a['status'](_0x25a5b3);return _0x2df37a[_0xa56a('0x23')]('Content-Range',_0x1aa4f6+'-'+_0x54e235+'/'+_0x32a070)[_0xa56a('0x1e')](_0xa1d565);}return null;};}function patchUpdates(_0x2cdf64){return function(_0x10a3c5){try{jsonpatch[_0xa56a('0x24')](_0x10a3c5,_0x2cdf64,!![]);}catch(_0x293daa){return BPromise['reject'](_0x293daa);}return _0x10a3c5['save']();};}function saveUpdates(_0x508876,_0x133b8f){return function(_0x23cf4d){if(_0x23cf4d){return _0x23cf4d[_0xa56a('0x25')](_0x508876)['then'](function(_0x4512e7){return _0x4512e7;});}return null;};}function removeEntity(_0x222da2,_0x54b904){return function(_0x348a98){if(_0x348a98){return _0x348a98[_0xa56a('0x26')]()[_0xa56a('0x27')](function(){_0x222da2[_0xa56a('0x1d')](0xcc)[_0xa56a('0x28')]();});}};}function handleEntityNotFound(_0x38992a,_0x306e3d){return function(_0x3b9665){if(!_0x3b9665){_0x38992a[_0xa56a('0x1c')](0x194);}return _0x3b9665;};}function handleError(_0x1d6551,_0x5099c2){_0x5099c2=_0x5099c2||0x1f4;return function(_0x197a34){logger[_0xa56a('0x29')](_0x197a34[_0xa56a('0x2a')]);if(_0x197a34[_0xa56a('0x2b')]){delete _0x197a34[_0xa56a('0x2b')];}_0x1d6551[_0xa56a('0x1d')](_0x5099c2)[_0xa56a('0x2c')](_0x197a34);};}exports['index']=function(_0x194297,_0x419edc){var _0x3ae1ed={},_0x53c221={},_0x211477={'count':0x0,'rows':[]};var _0xa5895=_['map'](db[_0xa56a('0x2d')][_0xa56a('0x2e')],function(_0x44a5da){return{'name':_0x44a5da[_0xa56a('0x2f')],'type':_0x44a5da[_0xa56a('0x30')][_0xa56a('0x31')]};});_0x53c221[_0xa56a('0x32')]=_[_0xa56a('0x33')](_[_0xa56a('0x34')](_0xa5895,'name'),['format']);_0x53c221[_0xa56a('0x35')]=_[_0xa56a('0x36')](_0x194297['query']);_0x53c221[_0xa56a('0x37')]=_['intersection'](_0x53c221[_0xa56a('0x32')],_0x53c221[_0xa56a('0x35')]);_0x3ae1ed[_0xa56a('0x38')]=_['intersection'](_0x53c221['model'],qs[_0xa56a('0x39')](_0x194297[_0xa56a('0x35')][_0xa56a('0x39')]));_0x3ae1ed[_0xa56a('0x38')]=_0x3ae1ed[_0xa56a('0x38')][_0xa56a('0x3a')]?_0x3ae1ed[_0xa56a('0x38')]:_0x53c221[_0xa56a('0x32')];if(!_0x194297['query']['hasOwnProperty'](_0xa56a('0x3b'))){_0x3ae1ed[_0xa56a('0x22')]=qs[_0xa56a('0x22')](_0x194297[_0xa56a('0x35')][_0xa56a('0x22')]);_0x3ae1ed[_0xa56a('0x21')]=qs[_0xa56a('0x21')](_0x194297[_0xa56a('0x35')][_0xa56a('0x21')]);}_0x3ae1ed[_0xa56a('0x3c')]=qs[_0xa56a('0x3d')](_0x194297[_0xa56a('0x35')][_0xa56a('0x3d')]);_0x3ae1ed['where']=qs[_0xa56a('0x37')](_[_0xa56a('0x3e')](_0x194297[_0xa56a('0x35')],_0x53c221[_0xa56a('0x37')]),_0xa5895);if(_0x194297[_0xa56a('0x35')][_0xa56a('0x3f')]){_0x3ae1ed[_0xa56a('0x40')]=_[_0xa56a('0x41')](_0x3ae1ed[_0xa56a('0x40')],{'$or':_[_0xa56a('0x34')](_0xa5895,function(_0x3f48da){if(_0x3f48da[_0xa56a('0x30')]!=='VIRTUAL'){var _0x427cef={};_0x427cef[_0x3f48da[_0xa56a('0x2b')]]={'$like':'%'+_0x194297[_0xa56a('0x35')][_0xa56a('0x3f')]+'%'};return _0x427cef;}})});}_0x3ae1ed=_[_0xa56a('0x41')]({},_0x3ae1ed,_0x194297['options']);var _0xfb80b9={'where':_0x3ae1ed[_0xa56a('0x40')]};return db['VoiceRecording'][_0xa56a('0x20')](_0xfb80b9)[_0xa56a('0x27')](function(_0x5a50f1){_0x211477[_0xa56a('0x20')]=_0x5a50f1;if(_0x194297[_0xa56a('0x35')]['includeAll']){_0x3ae1ed['include']=[{'all':!![]}];}return db[_0xa56a('0x2d')]['findAll'](_0x3ae1ed);})['then'](function(_0x2b4733){_0x211477[_0xa56a('0x42')]=_0x2b4733;return _0x211477;})[_0xa56a('0x27')](respondWithFilteredResult(_0x419edc,_0x3ae1ed))[_0xa56a('0x43')](handleError(_0x419edc,null));};exports['show']=function(_0x55b41d,_0x5c367f){var _0x1881ed={'raw':![],'where':{'id':_0x55b41d[_0xa56a('0x44')]['id']}},_0x361095={};_0x361095[_0xa56a('0x32')]=_[_0xa56a('0x36')](db[_0xa56a('0x2d')][_0xa56a('0x2e')]);_0x361095[_0xa56a('0x35')]=_[_0xa56a('0x36')](_0x55b41d[_0xa56a('0x35')]);_0x361095[_0xa56a('0x37')]=_['intersection'](_0x361095[_0xa56a('0x32')],_0x361095[_0xa56a('0x35')]);_0x1881ed[_0xa56a('0x38')]=_['intersection'](_0x361095['model'],qs['fields'](_0x55b41d[_0xa56a('0x35')][_0xa56a('0x39')]));_0x1881ed[_0xa56a('0x38')]=_0x1881ed[_0xa56a('0x38')][_0xa56a('0x3a')]?_0x1881ed['attributes']:_0x361095[_0xa56a('0x32')];if(_0x55b41d['query'][_0xa56a('0x45')]){_0x1881ed[_0xa56a('0x46')]=[{'all':!![]}];}_0x1881ed=_[_0xa56a('0x41')]({},_0x1881ed,_0x55b41d[_0xa56a('0x47')]);return db[_0xa56a('0x2d')][_0xa56a('0x48')](_0x1881ed)[_0xa56a('0x27')](handleEntityNotFound(_0x5c367f,null))['then'](respondWithResult(_0x5c367f,null))[_0xa56a('0x43')](handleError(_0x5c367f,null));};exports[_0xa56a('0x49')]=function(_0x4efb19,_0x4fd642){return db[_0xa56a('0x2d')]['create'](_0x4efb19[_0xa56a('0x4a')],{})[_0xa56a('0x27')](respondWithResult(_0x4fd642,0xc9))['catch'](handleError(_0x4fd642,null));};exports[_0xa56a('0x25')]=function(_0x5c9290,_0x848b52){if(_0x5c9290[_0xa56a('0x4a')]['id']){delete _0x5c9290[_0xa56a('0x4a')]['id'];}return db[_0xa56a('0x2d')][_0xa56a('0x48')]({'where':{'id':_0x5c9290[_0xa56a('0x44')]['id']}})[_0xa56a('0x27')](handleEntityNotFound(_0x848b52,null))[_0xa56a('0x27')](saveUpdates(_0x5c9290['body'],null))[_0xa56a('0x27')](respondWithResult(_0x848b52,null))[_0xa56a('0x43')](handleError(_0x848b52,null));};exports[_0xa56a('0x4b')]=function(_0x628013,_0x1af76d){return db['VoiceRecording'][_0xa56a('0x4b')]()[_0xa56a('0x27')](respondWithResult(_0x1af76d,null))[_0xa56a('0x43')](handleError(_0x1af76d,null));};exports['download']=function(_0x4410e2,_0x1b2c46,_0x3ac177){var _0x29218d=require(_0xa56a('0x4c'));var _0x1a08ce=![];var _0x2c4e56={};if(_0x4410e2['query']['type']&&_0x4410e2[_0xa56a('0x35')][_0xa56a('0x30')]==='uniqueid'){_0x2c4e56[_0xa56a('0x4d')]=_0x4410e2[_0xa56a('0x44')]['id'];}else{_0x2c4e56['id']=_0x4410e2[_0xa56a('0x44')]['id'];}return db[_0xa56a('0x2d')]['find']({'where':_0x2c4e56,'attributes':['id','value'],'raw':!![]})[_0xa56a('0x27')](handleEntityNotFound(_0x1b2c46,null))[_0xa56a('0x27')](function(_0x4a846e){if(_0x4a846e){var _0x5c40ea=_0x4a846e[_0xa56a('0x4e')];var _0x13f0f1=util[_0xa56a('0x4f')](_0xa56a('0x50'),_0x5c40ea);if(fs[_0xa56a('0x51')](_0x13f0f1)){_0x1a08ce=!![];return _0x29218d['decryptFile'](_0x13f0f1,_0x5c40ea,config[_0xa56a('0x52')][_0xa56a('0x53')])[_0xa56a('0x27')](function(){return _0x4a846e;});}return _0x4a846e;}})[_0xa56a('0x27')](function(_0x1b3f7b){if(_0x1b3f7b){var _0x4ea8f3=_0x1b3f7b[_0xa56a('0x4e')];if(!fs[_0xa56a('0x51')](_0x4ea8f3)){throw new db[(_0xa56a('0x54'))][(_0xa56a('0x55'))](_0xa56a('0x56'));}if(_0x1b3f7b['filename']){return _0x1b2c46[_0xa56a('0x57')](_0x4ea8f3,_0x1b3f7b[_0xa56a('0x58')]+path['extname'](_0x4ea8f3),function(){if(_0x1a08ce){fs[_0xa56a('0x59')](_0x4ea8f3);}});}else{return _0x1b2c46['download'](_0x4ea8f3,function(_0x1472cb){if(_0x1a08ce){fs[_0xa56a('0x59')](_0x4ea8f3);}});}}})['catch'](function(_0x160544){if(_0x160544[_0xa56a('0x5a')]===_0xa56a('0x56')){_0x1b2c46[_0xa56a('0x1d')](0x194)[_0xa56a('0x2c')]('Not\x20found');}else{return handleError(_0x1b2c46,null);}});};exports[_0xa56a('0x5b')]=function(_0x34ce5e,_0x1cb29c,_0xa9def1){var _0x546728=require(_0xa56a('0x4c'));var _0x33e803=![];var _0x399c12={'$and':[db[_0xa56a('0x5c')][_0xa56a('0x40')](db[_0xa56a('0x5c')]['fn']('MD5',db['sequelize'][_0xa56a('0x5d')](_0xa56a('0x4d'))),_0x34ce5e[_0xa56a('0x35')][_0xa56a('0x5e')])]};if(_0x34ce5e[_0xa56a('0x35')]['type']&&_0x34ce5e[_0xa56a('0x35')][_0xa56a('0x30')]==='uniqueid'){_0x399c12['$and'][_0xa56a('0x5f')]({'uniqueid':_0x34ce5e[_0xa56a('0x44')]['id']});}else{_0x399c12[_0xa56a('0x60')]['push']({'id':_0x34ce5e[_0xa56a('0x44')]['id']});}return db[_0xa56a('0x2d')]['find']({'where':_0x399c12,'attributes':['id',_0xa56a('0x4e')],'raw':!![]})[_0xa56a('0x27')](handleEntityNotFound(_0x1cb29c,null))[_0xa56a('0x27')](function(_0x51766c){if(_0x51766c){var _0xf82520=util[_0xa56a('0x4f')]('%s.cypher',_0x51766c['value']);if(fs[_0xa56a('0x51')](_0xf82520)){_0x33e803=!![];return _0x546728[_0xa56a('0x61')](_0xf82520,_0x51766c[_0xa56a('0x4e')],config['secrets'][_0xa56a('0x53')])[_0xa56a('0x27')](function(){return _0x51766c;});}return _0x51766c;}})[_0xa56a('0x27')](function(_0x41f213){if(_0x41f213){if(!fs['existsSync'](_0x41f213['value'])){throw new db[(_0xa56a('0x54'))][(_0xa56a('0x55'))](_0xa56a('0x56'));}if(_0x41f213['filename']){return _0x1cb29c[_0xa56a('0x57')](_0x41f213[_0xa56a('0x4e')],_0x41f213['filename']+path[_0xa56a('0x62')](_0x41f213['value']),function(){if(_0x33e803){fs[_0xa56a('0x59')](_0x41f213['value']);}});}else{return _0x1cb29c['download'](_0x41f213[_0xa56a('0x4e')],function(_0x1122fd){if(_0x33e803){fs[_0xa56a('0x59')](_0x41f213[_0xa56a('0x4e')]);}});}}})[_0xa56a('0x43')](handleError(_0x1cb29c,null));};exports['destroy']=function(_0x46def7,_0x1b0155){return db[_0xa56a('0x2d')][_0xa56a('0x48')]({'where':{'id':_0x46def7['params']['id']}})['then'](function(_0x421b4c){if(_['isNil'](_0x421b4c)){throw new ReferenceError(_0xa56a('0x63'));}return _0x421b4c;})[_0xa56a('0x27')](function(_0xfb8dd2){var _0x147b6e=_0xfb8dd2['value'];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x147b6e);if(!_[_0xa56a('0x64')](_0xfb8dd2[_0xa56a('0x4e')])&&fs['existsSync'](_0x147b6e)){logger[_0xa56a('0x65')]('File:\x20\x22'+_0x147b6e+_0xa56a('0x66'));fs[_0xa56a('0x67')](_0x147b6e);}_0x147b6e=_0x147b6e+_0xa56a('0x68');if(!_[_0xa56a('0x64')](_0xfb8dd2[_0xa56a('0x4e')])&&fs[_0xa56a('0x51')](_0x147b6e)){logger[_0xa56a('0x65')](_0xa56a('0x69')+_0x147b6e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x147b6e);}return _0xfb8dd2;})[_0xa56a('0x27')](function(_0x550a57){if(!_0x550a57)throw new InternalError();return _0x550a57[_0xa56a('0x26')]();})['then'](function(){_0x1b0155[_0xa56a('0x1d')](0xcc)['end']();})[_0xa56a('0x43')](handleError(_0x1b0155,null));};function getBucketslist(_0x290b0d,_0x27c214,_0x1ac34d){return new Promise(function(_0x3942f3,_0x35375c){var _0xe424a3=new AWS['S3']({'accessKeyId':_0x27c214,'secretAccessKey':_0x290b0d,'region':_0x1ac34d});_0xe424a3[_0xa56a('0x6a')]({},function(_0x4c42b6,_0x573283){if(_0x4c42b6){return _0x35375c(_0x4c42b6);}else{return _0x3942f3(_0x573283);}});});}function createBucket(_0x3c2e73,_0xd44f24,_0x54a642,_0x181ac7){return new Promise(function(_0x5b6c49,_0x3ebd3f){var _0x33c326=new AWS['S3']({'accessKeyId':_0xd44f24,'secretAccessKey':_0x3c2e73,'region':_0x54a642});_0x33c326[_0xa56a('0x6b')]({'Bucket':_0x181ac7},function(_0x39b1f5,_0x29522c){if(_0x39b1f5){return _0x3ebd3f(_0x39b1f5);}else{return _0x5b6c49(_0x29522c);}});});}function uploadFile(_0x2d1b08,_0x368a99,_0x54f860,_0x506573,_0x10e968,_0x2a617e){return new Promise(function(_0x58a48c,_0x2bc52c){var _0x57c5c4=new AWS['S3']({'accessKeyId':_0x368a99,'secretAccessKey':_0x2d1b08,'region':_0x54f860});_0x57c5c4[_0xa56a('0x6c')]({'Bucket':_0x506573,'Key':_0x10e968,'Body':_0x2a617e},function(_0x18ee5c,_0x3a4d28){if(_0x18ee5c){return _0x2bc52c(_0x18ee5c);}else{return _0x58a48c(_0x3a4d28);}});});}function startTranscribe(_0x522107,_0x3a559c,_0x160707,_0x39f214,_0x3194f8,_0xf896fa){return new Promise(function(_0x4a664c,_0x9fcb7f){var _0x32c9fd=new AWS[(_0xa56a('0x6d'))]({'accessKeyId':_0x3a559c,'secretAccessKey':_0x522107,'region':_0x160707});_0x32c9fd[_0xa56a('0x6e')]({'TranscriptionJobName':_0x39f214,'LanguageCode':_0x3194f8,'Media':{'MediaFileUri':_0xf896fa}},function(_0x5cdc16,_0x28730f){if(_0x5cdc16){return _0x9fcb7f(_0x5cdc16);}else{return _0x4a664c(_0x28730f);}});});}function transcribe(_0x268b83,_0x3b7606,_0x33f342,_0x514638,_0x1708ac,_0xba28b3,_0x2ccf9e){return new Promise(function(_0x3fd408,_0x3b4f1a){var _0x3184e4={};logger[_0xa56a('0x65')](util[_0xa56a('0x4f')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x268b83,_0x1708ac));return uploadFile(_0x3b7606,_0x33f342,_0x514638,_0x1708ac,path[_0xa56a('0x6f')](_0xba28b3),fs['readFileSync'](_0xba28b3))[_0xa56a('0x27')](function(_0x660ca){logger[_0xa56a('0x65')](util['format'](_0xa56a('0x70'),_0x268b83,_0x1708ac,_0x660ca[_0xa56a('0x71')]));_0x3184e4['bucket']=_0x660ca['Bucket'];_0x3184e4[_0xa56a('0x72')]=_0x660ca[_0xa56a('0x71')];logger[_0xa56a('0x65')](util['format'](_0xa56a('0x73'),_0x268b83));return startTranscribe(_0x3b7606,_0x33f342,_0x514638,uuidv4(),_0x2ccf9e,_0x660ca[_0xa56a('0x71')]);})['then'](function(_0x489f84){logger[_0xa56a('0x65')](util[_0xa56a('0x4f')](_0xa56a('0x74'),_0x268b83,_0x489f84[_0xa56a('0x75')][_0xa56a('0x76')]));_0x3184e4[_0xa56a('0x77')]=_0x489f84['TranscriptionJob'][_0xa56a('0x76')];_0x3184e4[_0xa56a('0x78')]=_0x489f84[_0xa56a('0x75')][_0xa56a('0x79')];return _0x3fd408(_0x3184e4);})[_0xa56a('0x43')](function(_0x6ac200){return _0x3b4f1a(_0x6ac200);});});}exports[_0xa56a('0x7a')]=function(_0x1e7a7d,_0x501ba4,_0x4bc51a){var _0x5a7398;var _0x41d342;var _0xe5bfce;var _0x306af5=require(_0xa56a('0x4c'));return db[_0xa56a('0x2d')][_0xa56a('0x7b')]({'where':{'id':_0x1e7a7d[_0xa56a('0x44')]['id']}})[_0xa56a('0x27')](function(_0x3fa7cc){if(_0x3fa7cc){var _0x23c13b=util[_0xa56a('0x4f')](_0xa56a('0x50'),_0x3fa7cc[_0xa56a('0x4e')]);if(fs['existsSync'](_0x23c13b)){cypher=!![];return _0x306af5[_0xa56a('0x61')](_0x23c13b,_0x3fa7cc[_0xa56a('0x4e')],config[_0xa56a('0x52')]['recording'])['then'](function(){return _0x3fa7cc;});}return _0x3fa7cc;}})['then'](function(_0x2ef5ea){if(!_0x2ef5ea){throw new db['Sequelize'][(_0xa56a('0x55'))](_0xa56a('0x7c'));}_0x41d342=_0x2ef5ea;return db[_0xa56a('0x7d')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x501ba4,null))[_0xa56a('0x27')](function(_0x2b47f5){if(_0x2b47f5){_0x5a7398=_0x2b47f5;if(!_0x5a7398[_0xa56a('0x7e')]||!_0x5a7398['transcribeAccountId']||!_0x5a7398[_0xa56a('0x7f')]||!_0x5a7398['language']||!_0x5a7398[_0xa56a('0x80')]){throw new db['Sequelize'][(_0xa56a('0x55'))](_0xa56a('0x81'));}if(_0x1e7a7d[_0xa56a('0x4a')][_0xa56a('0x82')]&&(!_0x5a7398[_0xa56a('0x83')]||!_0x5a7398[_0xa56a('0x84')]||!_0x5a7398[_0xa56a('0x85')]||!_0x5a7398['language']||!_0x5a7398[_0xa56a('0x80')])){throw new db['Sequelize'][(_0xa56a('0x55'))](_0xa56a('0x86'));}return db[_0xa56a('0x87')][_0xa56a('0x7b')]({'where':{'id':_0x5a7398[_0xa56a('0x88')]}});}})[_0xa56a('0x27')](function(_0x5aa82e){if(!_0x5aa82e){throw new db[(_0xa56a('0x54'))][(_0xa56a('0x55'))](_0xa56a('0x89'));}if(!_0x5aa82e[_0xa56a('0x8a')]||!_0x5aa82e[_0xa56a('0x8b')]){throw new db[(_0xa56a('0x54'))]['ValidationError'](_0xa56a('0x8c'));}_0xe5bfce=_0x5aa82e;return getBucketslist(_0xe5bfce[_0xa56a('0x8a')],_0xe5bfce[_0xa56a('0x8b')],_0x5a7398[_0xa56a('0x7f')]);})['then'](function(_0x1ecb73){if(_0x1ecb73&&_0x1ecb73[_0xa56a('0x8d')]){var _0x23ed5d=_[_0xa56a('0x48')](_0x1ecb73['Buckets'],function(_0x10ca2c){return _0x10ca2c[_0xa56a('0x8e')]===_0x5a7398[_0xa56a('0x80')];});if(!_0x23ed5d){logger[_0xa56a('0x65')](util[_0xa56a('0x4f')](_0xa56a('0x8f'),_0x1e7a7d['params']['id'],_0x5a7398['bucket']));return createBucket(_0xe5bfce[_0xa56a('0x8a')],_0xe5bfce[_0xa56a('0x8b')],_0x5a7398[_0xa56a('0x7f')],_0x5a7398[_0xa56a('0x80')]);}logger[_0xa56a('0x65')](util[_0xa56a('0x4f')](_0xa56a('0x90'),_0x1e7a7d['params']['id'],_0x5a7398[_0xa56a('0x80')]));return;}})['then'](function(_0x5de221){if(_0x41d342['transcribeStatus']===_0xa56a('0x91')){return transcribe(_0x1e7a7d[_0xa56a('0x44')]['id'],_0xe5bfce[_0xa56a('0x8a')],_0xe5bfce['data2'],_0x5a7398[_0xa56a('0x7f')],_0x5a7398[_0xa56a('0x80')],_0x41d342[_0xa56a('0x4e')],_0x5a7398['language']);}else{logger['info'](util['format'](_0xa56a('0x92'),_0x1e7a7d[_0xa56a('0x44')]['id']));return{'transcribeStatus':_0xa56a('0x93')};}})[_0xa56a('0x27')](function(_0x53aa48){if(_0x53aa48){_0x53aa48[_0xa56a('0x94')]=_0x1e7a7d[_0xa56a('0x4a')][_0xa56a('0x82')];return _0x41d342['updateAttributes'](_0x53aa48);}})['then'](respondWithResult(_0x501ba4,null))[_0xa56a('0x43')](handleError(_0x501ba4,null));};function writeFile(_0x4bd6ea,_0x46c6c1){return new Promise(function(_0x3e6dee,_0x591a16){fs[_0xa56a('0x95')](_0x46c6c1,_0x4bd6ea,function(_0x49e075,_0x49b616){if(_0x49e075){return _0x591a16(_0x49e075);}else{return _0x3e6dee(_0x49b616);}});});}exports[_0xa56a('0x96')]=function(_0x74b8d5,_0x4d54ba,_0x362ce1){return db['VoiceRecording'][_0xa56a('0x7b')]({'where':{'id':_0x74b8d5['params']['id']}})['then'](handleEntityNotFound(_0x4d54ba))[_0xa56a('0x27')](function(_0x5838d8){if(_0x5838d8&&_0x5838d8[_0xa56a('0x97')]){var _0x8c81f1=_0x5838d8[_0xa56a('0x97')];var _0x1fa570=config[_0xa56a('0x98')]+'/server/files/transcribes/transcribe_'+_0x5838d8['id']+_0xa56a('0x99');if(fs[_0xa56a('0x51')](_0x1fa570)){return _0x1fa570;}return writeFile(_0x8c81f1,_0x1fa570)[_0xa56a('0x27')](function(){return _0x1fa570;});}else{throw new db[(_0xa56a('0x54'))]['ValidationError']('Transcript\x20not\x20available');}})[_0xa56a('0x27')](function(_0x32515d){return _0x4d54ba['download'](_0x32515d);})[_0xa56a('0x43')](handleError(_0x4d54ba));};
\ No newline at end of file
index abba616..a2a03c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8163=['define','VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./voiceRecording.attributes'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0x8163,0x1d8));var _0x3816=function(_0x2a1be8,_0x25189b){_0x2a1be8=_0x2a1be8-0x0;var _0x2e382c=_0x8163[_0x2a1be8];return _0x2e382c;};'use strict';var _=require(_0x3816('0x0'));var util=require(_0x3816('0x1'));var logger=require(_0x3816('0x2'))(_0x3816('0x3'));var moment=require(_0x3816('0x4'));var BPromise=require(_0x3816('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3816('0x6'));var rimraf=require(_0x3816('0x7'));var config=require('../../config/environment');var attributes=require(_0x3816('0x8'));module['exports']=function(_0xa3070b,_0x14575e){return _0xa3070b[_0x3816('0x9')](_0x3816('0xa'),attributes,{'tableName':_0x3816('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3816('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x02a0=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash'];(function(_0xb2110f,_0x5da82b){var _0x4aeac4=function(_0x1c95d6){while(--_0x1c95d6){_0xb2110f['push'](_0xb2110f['shift']());}};_0x4aeac4(++_0x5da82b);}(_0x02a0,0x86));var _0x002a=function(_0x58c923,_0x24c1cf){_0x58c923=_0x58c923-0x0;var _0x51caaf=_0x02a0[_0x58c923];return _0x51caaf;};'use strict';var _=require(_0x002a('0x0'));var util=require(_0x002a('0x1'));var logger=require(_0x002a('0x2'))(_0x002a('0x3'));var moment=require(_0x002a('0x4'));var BPromise=require(_0x002a('0x5'));var rp=require(_0x002a('0x6'));var fs=require('fs');var path=require(_0x002a('0x7'));var rimraf=require(_0x002a('0x8'));var config=require('../../config/environment');var attributes=require(_0x002a('0x9'));module[_0x002a('0xa')]=function(_0x1140c0,_0x50b6d8){return _0x1140c0[_0x002a('0xb')](_0x002a('0xc'),attributes,{'tableName':_0x002a('0xd'),'paranoid':![],'indexes':[{'name':_0x002a('0xe'),'fields':[_0x002a('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index d0a3c67..1bdbc99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd824=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','then','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash'];(function(_0x5e53ab,_0x2765a6){var _0x2424ce=function(_0x934f1d){while(--_0x934f1d){_0x5e53ab['push'](_0x5e53ab['shift']());}};_0x2424ce(++_0x2765a6);}(_0xd824,0xc2));var _0x4d82=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd824[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('VoiceRecording,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});}exports[_0x4d82('0x12')]=function(_0x258c59){var _0x217b72=this;return new Promise(function(_0x2f2127,_0x5ef783){return db[_0x4d82('0x13')][_0x4d82('0x14')](_0x258c59[_0x4d82('0x15')],{'raw':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x18')]||null:null,'attributes':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')]['attributes']||null:null,'limit':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')]['limit']||null:null})[_0x4d82('0x19')](function(_0x41f194){logger[_0x4d82('0xa')](_0x4d82('0x12'),_0x258c59);logger[_0x4d82('0x1a')](_0x4d82('0x12'),_0x258c59,JSON[_0x4d82('0xe')](_0x41f194));_0x2f2127(_0x41f194);})[_0x4d82('0x11')](function(_0x12feab){logger[_0x4d82('0xf')](_0x4d82('0x12'),_0x12feab[_0x4d82('0x10')],_0x258c59);_0x5ef783(_0x217b72[_0x4d82('0xf')](0x1f4,_0x12feab[_0x4d82('0x10')]));});});};exports[_0x4d82('0x1b')]=function(_0x4af6da){var _0x5e0b03=this;return new Promise(function(_0x3dcb0f,_0x2548de){var _0x2a0572=require(_0x4d82('0x1c'));var _0x5cbd7e;return db[_0x4d82('0x1d')][_0x4d82('0x1e')]({'attributes':['id',_0x4d82('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x4d82('0x19')](function(_0x5ce98b){_0x5cbd7e=_0x5ce98b;return db[_0x4d82('0x13')]['create'](_0x4af6da['body']);})['then'](function(_0x52533b){if(_0x5cbd7e[_0x4d82('0x1f')]&&fs[_0x4d82('0x20')](_0x52533b[_0x4d82('0x21')])){var _0x52e320=util[_0x4d82('0x22')](_0x4d82('0x23'),_0x52533b['value']);return _0x2a0572['encryptFile'](_0x52533b[_0x4d82('0x21')],_0x52e320,config[_0x4d82('0x24')][_0x4d82('0x25')])[_0x4d82('0x19')](function(){fs['unlink'](_0x52533b[_0x4d82('0x21')]);logger['info'](_0x4d82('0x26'));return _0x52533b;});}return _0x52533b;})[_0x4d82('0x19')](function(_0x4a2a45){logger['info'](_0x4d82('0x1b'),_0x4af6da);logger[_0x4d82('0x1a')](_0x4d82('0x1b'),_0x4af6da,JSON[_0x4d82('0xe')](_0x4a2a45));_0x3dcb0f(_0x4a2a45);})[_0x4d82('0x11')](function(_0x420b28){logger[_0x4d82('0xf')](_0x4d82('0x1b'),_0x420b28[_0x4d82('0x10')],_0x4af6da);_0x2548de(_0x5e0b03[_0x4d82('0xf')](0x1f4,_0x420b28['message']));});});};
\ No newline at end of file
+var _0x32b6=['jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','info','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','limit','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x32b6,0x1d1));var _0x632b=function(_0x3779b6,_0x338934){_0x3779b6=_0x3779b6-0x0;var _0x3c0578=_0x32b6[_0x3779b6];return _0x3c0578;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')](_0x3bb27f[_0x632b('0x18')],{'raw':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')]['where']||null:null,'attributes':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')]['attributes']||null:null,'limit':_0x3bb27f[_0x632b('0x19')]?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1b')]||null:null})['then'](function(_0x10fc32){logger[_0x632b('0x14')]('UpdateVoiceRecording',_0x3bb27f);logger[_0x632b('0xd')](_0x632b('0x15'),_0x3bb27f,JSON[_0x632b('0xf')](_0x10fc32));_0x51c894(_0x10fc32);})[_0x632b('0x1c')](function(_0x45d017){logger[_0x632b('0x10')]('UpdateVoiceRecording',_0x45d017['message'],_0x3bb27f);_0x2f3e88(_0x28c472[_0x632b('0x10')](0x1f4,_0x45d017['message']));});});};exports[_0x632b('0x1d')]=function(_0x954fa0){var _0x5d6855=this;return new Promise(function(_0x273e89,_0x3f4eab){var _0x29d9aa=require(_0x632b('0x1e'));var _0x4728a8;return db[_0x632b('0x1f')][_0x632b('0x20')]({'attributes':['id',_0x632b('0x21')],'where':{'id':0x1},'raw':!![]})[_0x632b('0xc')](function(_0x4f8410){_0x4728a8=_0x4f8410;return db[_0x632b('0x16')][_0x632b('0x22')](_0x954fa0[_0x632b('0x18')]);})[_0x632b('0xc')](function(_0x17a5ba){if(_0x4728a8[_0x632b('0x21')]&&fs[_0x632b('0x23')](_0x17a5ba[_0x632b('0x24')])){var _0x1ace1b=util[_0x632b('0x25')](_0x632b('0x26'),_0x17a5ba[_0x632b('0x24')]);return _0x29d9aa[_0x632b('0x27')](_0x17a5ba[_0x632b('0x24')],_0x1ace1b,config[_0x632b('0x28')][_0x632b('0x29')])[_0x632b('0xc')](function(){fs[_0x632b('0x2a')](_0x17a5ba[_0x632b('0x24')]);logger[_0x632b('0x14')]('CreateVoiceRecording\x20file\x20encrypted');return _0x17a5ba;});}return _0x17a5ba;})[_0x632b('0xc')](function(_0x4401dc){logger[_0x632b('0x14')](_0x632b('0x1d'),_0x954fa0);logger['debug'](_0x632b('0x1d'),_0x954fa0,JSON['stringify'](_0x4401dc));_0x273e89(_0x4401dc);})[_0x632b('0x1c')](function(_0x15b22d){logger['error'](_0x632b('0x1d'),_0x15b22d[_0x632b('0x13')],_0x954fa0);_0x3f4eab(_0x5d6855[_0x632b('0x10')](0x1f4,_0x15b22d[_0x632b('0x13')]));});});};
\ No newline at end of file
index 360583e..f6e163a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c02=['get','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index'];(function(_0x16e0f5,_0x4ec0f3){var _0x4839d5=function(_0x296b8f){while(--_0x296b8f){_0x16e0f5['push'](_0x16e0f5['shift']());}};_0x4839d5(++_0x4ec0f3);}(_0x7c02,0x101));var _0x27c0=function(_0x431db6,_0x39e17b){_0x431db6=_0x431db6-0x0;var _0x34674e=_0x7c02[_0x431db6];return _0x34674e;};'use strict';var multer=require('multer');var util=require(_0x27c0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x27c0('0x1')]();var fs_extra=require(_0x27c0('0x2'));var auth=require(_0x27c0('0x3'));var interaction=require(_0x27c0('0x4'));var config=require(_0x27c0('0x5'));var controller=require(_0x27c0('0x6'));router['get']('/',auth[_0x27c0('0x7')](),controller[_0x27c0('0x8')]);router[_0x27c0('0x9')](_0x27c0('0xa'),auth[_0x27c0('0x7')](),controller[_0x27c0('0xb')]);router[_0x27c0('0x9')](_0x27c0('0xc'),auth[_0x27c0('0x7')](),controller[_0x27c0('0xd')]);router['post']('/',auth[_0x27c0('0x7')](),controller[_0x27c0('0xe')]);router[_0x27c0('0xf')](_0x27c0('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x27c0('0x10')]('/:id',auth[_0x27c0('0x7')](),controller[_0x27c0('0x11')]);module[_0x27c0('0x12')]=router;
\ No newline at end of file
+var _0xa98f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','util','express'];(function(_0x54d3e4,_0x87a633){var _0x3bc348=function(_0x13298f){while(--_0x13298f){_0x54d3e4['push'](_0x54d3e4['shift']());}};_0x3bc348(++_0x87a633);}(_0xa98f,0x12e));var _0xfa98=function(_0x54b8e9,_0x55a1e3){_0x54b8e9=_0x54b8e9-0x0;var _0x26fbbf=_0xa98f[_0x54b8e9];return _0x26fbbf;};'use strict';var multer=require('multer');var util=require(_0xfa98('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfa98('0x1'));var router=express['Router']();var fs_extra=require(_0xfa98('0x2'));var auth=require(_0xfa98('0x3'));var interaction=require(_0xfa98('0x4'));var config=require(_0xfa98('0x5'));var controller=require(_0xfa98('0x6'));router[_0xfa98('0x7')]('/',auth[_0xfa98('0x8')](),controller[_0xfa98('0x9')]);router[_0xfa98('0x7')](_0xfa98('0xa'),auth[_0xfa98('0x8')](),controller[_0xfa98('0xb')]);router[_0xfa98('0x7')](_0xfa98('0xc'),auth[_0xfa98('0x8')](),controller[_0xfa98('0xd')]);router[_0xfa98('0xe')]('/',auth[_0xfa98('0x8')](),controller[_0xfa98('0xf')]);router['put'](_0xfa98('0xc'),auth['isAuthenticated'](),controller[_0xfa98('0x10')]);router[_0xfa98('0x11')](_0xfa98('0xc'),auth[_0xfa98('0x8')](),controller['destroy']);module[_0xfa98('0x12')]=router;
\ No newline at end of file
index a43e0f5..4e1e40c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2855=['ENUM','Yes','sequelize','moment','exports','blind','STRING'];(function(_0x57e1ab,_0x4d8553){var _0x5bde0e=function(_0x466a5a){while(--_0x466a5a){_0x57e1ab['push'](_0x57e1ab['shift']());}};_0x5bde0e(++_0x4d8553);}(_0x2855,0x10c));var _0x5285=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x2855[_0x31cb5f];return _0x586042;};'use strict';var Sequelize=require(_0x5285('0x0'));var moment=require(_0x5285('0x1'));module[_0x5285('0x2')]={'type':{'type':Sequelize['ENUM'](_0x5285('0x3'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x5285('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x5285('0x4')]},'transferercalleridname':{'type':Sequelize[_0x5285('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x5285('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x5285('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x5285('0x4')]},'transfererexten':{'type':Sequelize[_0x5285('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x5285('0x4')]},'transfereechannel':{'type':Sequelize[_0x5285('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x5285('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x5285('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x5285('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5285('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x5285('0x4')]},'transfereeexten':{'type':Sequelize[_0x5285('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x5285('0x4')]},'isexternal':{'type':Sequelize[_0x5285('0x5')](_0x5285('0x6'),'No')},'context':{'type':Sequelize[_0x5285('0x4')]},'extension':{'type':Sequelize[_0x5285('0x4')]}};
\ No newline at end of file
+var _0xcbe3=['Yes','exports','ENUM','blind','attended','STRING'];(function(_0x1f8202,_0x328442){var _0x1ab1dd=function(_0x207450){while(--_0x207450){_0x1f8202['push'](_0x1f8202['shift']());}};_0x1ab1dd(++_0x328442);}(_0xcbe3,0xaf));var _0x3cbe=function(_0x56b53d,_0x29e0c4){_0x56b53d=_0x56b53d-0x0;var _0x40d95a=_0xcbe3[_0x56b53d];return _0x40d95a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x3cbe('0x0')]={'type':{'type':Sequelize[_0x3cbe('0x1')](_0x3cbe('0x2'),_0x3cbe('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x3cbe('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x3cbe('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x3cbe('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x3cbe('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x3cbe('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x3cbe('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x3cbe('0x4')]},'transfereechannel':{'type':Sequelize[_0x3cbe('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x3cbe('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x3cbe('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x3cbe('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x3cbe('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x3cbe('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x3cbe('0x4')]}};
\ No newline at end of file
index 4059a21..631898c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d89=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','end','json','offset','limit','count','status','set','reject','save','destroy','then','sendStatus','error','stack','name','VoiceTransferReport','key','model','map','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','type','VIRTUAL','merge','includeAll','findAll','rows','show','rawAttributes','keys','length','include','options','catch','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x211141,_0x3aad9b){var _0x51d2c4=function(_0x488e3a){while(--_0x488e3a){_0x211141['push'](_0x211141['shift']());}};_0x51d2c4(++_0x3aad9b);}(_0x5d89,0x193));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x95d8('0x0'));var rimraf=require(_0x95d8('0x1'));var zipdir=require(_0x95d8('0x2'));var jsonpatch=require(_0x95d8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x95d8('0x4'));var Mustache=require(_0x95d8('0x5'));var util=require(_0x95d8('0x6'));var path=require(_0x95d8('0x7'));var sox=require(_0x95d8('0x8'));var csv=require(_0x95d8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95d8('0xa'));var _=require(_0x95d8('0xb'));var squel=require(_0x95d8('0xc'));var crypto=require('crypto');var jsforce=require(_0x95d8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x95d8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x95d8('0xe'));var authService=require(_0x95d8('0xf'));var qs=require(_0x95d8('0x10'));var as=require(_0x95d8('0x11'));var hardwareService=require(_0x95d8('0x12'));var logger=require(_0x95d8('0x13'))('api');var utils=require(_0x95d8('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x95d8('0x15'))['db'];function respondWithStatusCode(_0x11aab5,_0x7df8b7){_0x7df8b7=_0x7df8b7||0xcc;return function(_0x845579){if(_0x845579){return _0x11aab5['sendStatus'](_0x7df8b7);}return _0x11aab5['status'](_0x7df8b7)[_0x95d8('0x16')]();};}function respondWithResult(_0x1d834e,_0x270414){_0x270414=_0x270414||0xc8;return function(_0x3bb00b){if(_0x3bb00b){return _0x1d834e['status'](_0x270414)[_0x95d8('0x17')](_0x3bb00b);}};}function respondWithFilteredResult(_0x451e93,_0x43aa18){return function(_0x34836c){if(_0x34836c){var _0x49cbd7=typeof _0x43aa18[_0x95d8('0x18')]==='undefined'&&typeof _0x43aa18[_0x95d8('0x19')]==='undefined';var _0x1b2b34=_0x34836c[_0x95d8('0x1a')];var _0x4be8ee=_0x49cbd7?0x0:_0x43aa18['offset'];var _0x4b4361=_0x49cbd7?_0x34836c['count']:_0x43aa18[_0x95d8('0x18')]+_0x43aa18[_0x95d8('0x19')];var _0x4f7d57;if(_0x4b4361>=_0x1b2b34){_0x4b4361=_0x1b2b34;_0x4f7d57=0xc8;}else{_0x4f7d57=0xce;}_0x451e93[_0x95d8('0x1b')](_0x4f7d57);return _0x451e93[_0x95d8('0x1c')]('Content-Range',_0x4be8ee+'-'+_0x4b4361+'/'+_0x1b2b34)[_0x95d8('0x17')](_0x34836c);}return null;};}function patchUpdates(_0x4108cb){return function(_0x35b730){try{jsonpatch['apply'](_0x35b730,_0x4108cb,!![]);}catch(_0x50800d){return BPromise[_0x95d8('0x1d')](_0x50800d);}return _0x35b730[_0x95d8('0x1e')]();};}function saveUpdates(_0x4fb5f2,_0x33256d){return function(_0x32490a){if(_0x32490a){return _0x32490a['update'](_0x4fb5f2)['then'](function(_0x1bd677){return _0x1bd677;});}return null;};}function removeEntity(_0x4c263a,_0x103f59){return function(_0x1a6f43){if(_0x1a6f43){return _0x1a6f43[_0x95d8('0x1f')]()[_0x95d8('0x20')](function(){_0x4c263a[_0x95d8('0x1b')](0xcc)[_0x95d8('0x16')]();});}};}function handleEntityNotFound(_0x2e150f,_0x3ada08){return function(_0x31c258){if(!_0x31c258){_0x2e150f[_0x95d8('0x21')](0x194);}return _0x31c258;};}function handleError(_0x3641ee,_0x373367){_0x373367=_0x373367||0x1f4;return function(_0x5cbcf4){logger[_0x95d8('0x22')](_0x5cbcf4[_0x95d8('0x23')]);if(_0x5cbcf4[_0x95d8('0x24')]){delete _0x5cbcf4[_0x95d8('0x24')];}_0x3641ee[_0x95d8('0x1b')](_0x373367)['send'](_0x5cbcf4);};}exports['index']=function(_0x468a39,_0x598187){var _0x3b534d={},_0x5d7dbc={},_0x51eff9={'count':0x0,'rows':[]};var _0x13ccaf=_['map'](db[_0x95d8('0x25')]['rawAttributes'],function(_0x373f4a){return{'name':_0x373f4a['fieldName'],'type':_0x373f4a['type'][_0x95d8('0x26')]};});_0x5d7dbc[_0x95d8('0x27')]=_[_0x95d8('0x28')](_0x13ccaf,'name');_0x5d7dbc[_0x95d8('0x29')]=_['keys'](_0x468a39['query']);_0x5d7dbc[_0x95d8('0x2a')]=_[_0x95d8('0x2b')](_0x5d7dbc[_0x95d8('0x27')],_0x5d7dbc[_0x95d8('0x29')]);_0x3b534d['attributes']=_[_0x95d8('0x2b')](_0x5d7dbc['model'],qs[_0x95d8('0x2c')](_0x468a39['query']['fields']));_0x3b534d['attributes']=_0x3b534d[_0x95d8('0x2d')]['length']?_0x3b534d['attributes']:_0x5d7dbc[_0x95d8('0x27')];if(!_0x468a39[_0x95d8('0x29')]['hasOwnProperty'](_0x95d8('0x2e'))){_0x3b534d[_0x95d8('0x19')]=qs[_0x95d8('0x19')](_0x468a39[_0x95d8('0x29')][_0x95d8('0x19')]);_0x3b534d[_0x95d8('0x18')]=qs[_0x95d8('0x18')](_0x468a39['query']['offset']);}_0x3b534d[_0x95d8('0x2f')]=qs[_0x95d8('0x30')](_0x468a39['query']['sort']);_0x3b534d[_0x95d8('0x31')]=qs['filters'](_['pick'](_0x468a39['query'],_0x5d7dbc[_0x95d8('0x2a')]),_0x13ccaf);if(_0x468a39[_0x95d8('0x29')][_0x95d8('0x32')]){_0x3b534d['where']=_['merge'](_0x3b534d[_0x95d8('0x31')],{'$or':_['map'](_0x13ccaf,function(_0x2d0075){if(_0x2d0075[_0x95d8('0x33')]!==_0x95d8('0x34')){var _0x3a0ed0={};_0x3a0ed0[_0x2d0075['name']]={'$like':'%'+_0x468a39[_0x95d8('0x29')][_0x95d8('0x32')]+'%'};return _0x3a0ed0;}})});}_0x3b534d=_[_0x95d8('0x35')]({},_0x3b534d,_0x468a39['options']);var _0x244ff7={'where':_0x3b534d[_0x95d8('0x31')]};return db[_0x95d8('0x25')][_0x95d8('0x1a')](_0x244ff7)[_0x95d8('0x20')](function(_0x585017){_0x51eff9[_0x95d8('0x1a')]=_0x585017;if(_0x468a39[_0x95d8('0x29')][_0x95d8('0x36')]){_0x3b534d['include']=[{'all':!![]}];}return db[_0x95d8('0x25')][_0x95d8('0x37')](_0x3b534d);})[_0x95d8('0x20')](function(_0x1d472f){_0x51eff9[_0x95d8('0x38')]=_0x1d472f;return _0x51eff9;})[_0x95d8('0x20')](respondWithFilteredResult(_0x598187,_0x3b534d))['catch'](handleError(_0x598187,null));};exports[_0x95d8('0x39')]=function(_0x3b9ab2,_0x2b8fab){var _0x2f8f57={'raw':!![],'where':{'id':_0x3b9ab2['params']['id']}},_0x4d052f={};_0x4d052f[_0x95d8('0x27')]=_['keys'](db[_0x95d8('0x25')][_0x95d8('0x3a')]);_0x4d052f[_0x95d8('0x29')]=_[_0x95d8('0x3b')](_0x3b9ab2[_0x95d8('0x29')]);_0x4d052f[_0x95d8('0x2a')]=_['intersection'](_0x4d052f['model'],_0x4d052f[_0x95d8('0x29')]);_0x2f8f57[_0x95d8('0x2d')]=_[_0x95d8('0x2b')](_0x4d052f[_0x95d8('0x27')],qs[_0x95d8('0x2c')](_0x3b9ab2[_0x95d8('0x29')][_0x95d8('0x2c')]));_0x2f8f57['attributes']=_0x2f8f57[_0x95d8('0x2d')][_0x95d8('0x3c')]?_0x2f8f57[_0x95d8('0x2d')]:_0x4d052f[_0x95d8('0x27')];if(_0x3b9ab2[_0x95d8('0x29')][_0x95d8('0x36')]){_0x2f8f57[_0x95d8('0x3d')]=[{'all':!![]}];}_0x2f8f57=_['merge']({},_0x2f8f57,_0x3b9ab2[_0x95d8('0x3e')]);return db[_0x95d8('0x25')]['find'](_0x2f8f57)['then'](handleEntityNotFound(_0x2b8fab,null))[_0x95d8('0x20')](respondWithResult(_0x2b8fab,null))[_0x95d8('0x3f')](handleError(_0x2b8fab,null));};exports[_0x95d8('0x40')]=function(_0x55c6f5,_0x424340){return db[_0x95d8('0x25')]['create'](_0x55c6f5[_0x95d8('0x41')],{})[_0x95d8('0x20')](respondWithResult(_0x424340,0xc9))[_0x95d8('0x3f')](handleError(_0x424340,null));};exports[_0x95d8('0x42')]=function(_0x8f3dad,_0x2c2538){if(_0x8f3dad[_0x95d8('0x41')]['id']){delete _0x8f3dad[_0x95d8('0x41')]['id'];}return db[_0x95d8('0x25')][_0x95d8('0x43')]({'where':{'id':_0x8f3dad[_0x95d8('0x44')]['id']}})[_0x95d8('0x20')](handleEntityNotFound(_0x2c2538,null))['then'](saveUpdates(_0x8f3dad[_0x95d8('0x41')],null))[_0x95d8('0x20')](respondWithResult(_0x2c2538,null))[_0x95d8('0x3f')](handleError(_0x2c2538,null));};exports['destroy']=function(_0x2f8daf,_0x2b1297){return db[_0x95d8('0x25')][_0x95d8('0x43')]({'where':{'id':_0x2f8daf[_0x95d8('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b1297,null))[_0x95d8('0x20')](removeEntity(_0x2b1297,null))['catch'](handleError(_0x2b1297,null));};exports[_0x95d8('0x45')]=function(_0x1c086a,_0x421499){return db[_0x95d8('0x25')][_0x95d8('0x45')]()[_0x95d8('0x20')](respondWithResult(_0x421499,null))['catch'](handleError(_0x421499,null));};
\ No newline at end of file
+var _0xf437=['count','limit','json','apply','reject','update','then','destroy','end','error','stack','name','send','VoiceTransferReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','rawAttributes','find','create','body','catch','params','describe','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf437,0x1d8));var _0x7f43=function(_0x1fe559,_0x25fba7){_0x1fe559=_0x1fe559-0x0;var _0xb5b18c=_0xf437[_0x1fe559];return _0xb5b18c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f43('0x0'));var zipdir=require(_0x7f43('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7f43('0x2'));var BPromise=require(_0x7f43('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7f43('0x4'));var sox=require(_0x7f43('0x5'));var csv=require(_0x7f43('0x6'));var ejs=require(_0x7f43('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f43('0x8'));var squel=require(_0x7f43('0x9'));var crypto=require(_0x7f43('0xa'));var jsforce=require(_0x7f43('0xb'));var deskjs=require(_0x7f43('0xc'));var toCsv=require(_0x7f43('0x6'));var querystring=require('querystring');var Papa=require(_0x7f43('0xd'));var Redis=require(_0x7f43('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7f43('0xf'));var as=require(_0x7f43('0x10'));var hardwareService=require(_0x7f43('0x11'));var logger=require(_0x7f43('0x12'))('api');var utils=require(_0x7f43('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7f43('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x257160,_0x3ad0bf){_0x3ad0bf=_0x3ad0bf||0xcc;return function(_0xb53ad2){if(_0xb53ad2){return _0x257160[_0x7f43('0x15')](_0x3ad0bf);}return _0x257160[_0x7f43('0x16')](_0x3ad0bf)['end']();};}function respondWithResult(_0x27fcdd,_0x1f756d){_0x1f756d=_0x1f756d||0xc8;return function(_0x127e86){if(_0x127e86){return _0x27fcdd[_0x7f43('0x16')](_0x1f756d)['json'](_0x127e86);}};}function respondWithFilteredResult(_0x5f184f,_0x23ff81){return function(_0x5be3fd){if(_0x5be3fd){var _0x418c7b=typeof _0x23ff81[_0x7f43('0x17')]===_0x7f43('0x18')&&typeof _0x23ff81['limit']==='undefined';var _0x2a1bde=_0x5be3fd[_0x7f43('0x19')];var _0x47ba21=_0x418c7b?0x0:_0x23ff81[_0x7f43('0x17')];var _0x52f7b4=_0x418c7b?_0x5be3fd[_0x7f43('0x19')]:_0x23ff81[_0x7f43('0x17')]+_0x23ff81[_0x7f43('0x1a')];var _0x3a41d7;if(_0x52f7b4>=_0x2a1bde){_0x52f7b4=_0x2a1bde;_0x3a41d7=0xc8;}else{_0x3a41d7=0xce;}_0x5f184f[_0x7f43('0x16')](_0x3a41d7);return _0x5f184f['set']('Content-Range',_0x47ba21+'-'+_0x52f7b4+'/'+_0x2a1bde)[_0x7f43('0x1b')](_0x5be3fd);}return null;};}function patchUpdates(_0x4ff16b){return function(_0xd4259a){try{jsonpatch[_0x7f43('0x1c')](_0xd4259a,_0x4ff16b,!![]);}catch(_0x2d1000){return BPromise[_0x7f43('0x1d')](_0x2d1000);}return _0xd4259a['save']();};}function saveUpdates(_0x1c5728,_0x445af8){return function(_0x22bb68){if(_0x22bb68){return _0x22bb68[_0x7f43('0x1e')](_0x1c5728)[_0x7f43('0x1f')](function(_0x4c2630){return _0x4c2630;});}return null;};}function removeEntity(_0x5185f3,_0x4abeb1){return function(_0x259ca0){if(_0x259ca0){return _0x259ca0[_0x7f43('0x20')]()[_0x7f43('0x1f')](function(){_0x5185f3[_0x7f43('0x16')](0xcc)[_0x7f43('0x21')]();});}};}function handleEntityNotFound(_0x4bc708,_0x3bcbe3){return function(_0x3a229a){if(!_0x3a229a){_0x4bc708[_0x7f43('0x15')](0x194);}return _0x3a229a;};}function handleError(_0x2b7c9c,_0x218004){_0x218004=_0x218004||0x1f4;return function(_0x2ab825){logger[_0x7f43('0x22')](_0x2ab825[_0x7f43('0x23')]);if(_0x2ab825[_0x7f43('0x24')]){delete _0x2ab825[_0x7f43('0x24')];}_0x2b7c9c[_0x7f43('0x16')](_0x218004)[_0x7f43('0x25')](_0x2ab825);};}exports['index']=function(_0x2d4fff,_0x5018d3){var _0x284b5f={},_0x307776={},_0x5e1de1={'count':0x0,'rows':[]};var _0x2aeedb=_['map'](db[_0x7f43('0x26')]['rawAttributes'],function(_0xc09532){return{'name':_0xc09532[_0x7f43('0x27')],'type':_0xc09532[_0x7f43('0x28')][_0x7f43('0x29')]};});_0x307776[_0x7f43('0x2a')]=_[_0x7f43('0x2b')](_0x2aeedb,'name');_0x307776[_0x7f43('0x2c')]=_[_0x7f43('0x2d')](_0x2d4fff[_0x7f43('0x2c')]);_0x307776[_0x7f43('0x2e')]=_[_0x7f43('0x2f')](_0x307776['model'],_0x307776[_0x7f43('0x2c')]);_0x284b5f[_0x7f43('0x30')]=_[_0x7f43('0x2f')](_0x307776[_0x7f43('0x2a')],qs[_0x7f43('0x31')](_0x2d4fff[_0x7f43('0x2c')][_0x7f43('0x31')]));_0x284b5f[_0x7f43('0x30')]=_0x284b5f['attributes'][_0x7f43('0x32')]?_0x284b5f[_0x7f43('0x30')]:_0x307776[_0x7f43('0x2a')];if(!_0x2d4fff[_0x7f43('0x2c')][_0x7f43('0x33')](_0x7f43('0x34'))){_0x284b5f[_0x7f43('0x1a')]=qs[_0x7f43('0x1a')](_0x2d4fff['query'][_0x7f43('0x1a')]);_0x284b5f['offset']=qs[_0x7f43('0x17')](_0x2d4fff[_0x7f43('0x2c')]['offset']);}_0x284b5f['order']=qs['sort'](_0x2d4fff['query'][_0x7f43('0x35')]);_0x284b5f[_0x7f43('0x36')]=qs[_0x7f43('0x2e')](_[_0x7f43('0x37')](_0x2d4fff[_0x7f43('0x2c')],_0x307776[_0x7f43('0x2e')]),_0x2aeedb);if(_0x2d4fff[_0x7f43('0x2c')][_0x7f43('0x38')]){_0x284b5f[_0x7f43('0x36')]=_[_0x7f43('0x39')](_0x284b5f[_0x7f43('0x36')],{'$or':_[_0x7f43('0x2b')](_0x2aeedb,function(_0x3a0854){if(_0x3a0854[_0x7f43('0x28')]!==_0x7f43('0x3a')){var _0x3c74ff={};_0x3c74ff[_0x3a0854[_0x7f43('0x24')]]={'$like':'%'+_0x2d4fff['query'][_0x7f43('0x38')]+'%'};return _0x3c74ff;}})});}_0x284b5f=_['merge']({},_0x284b5f,_0x2d4fff[_0x7f43('0x3b')]);var _0x2eda66={'where':_0x284b5f['where']};return db[_0x7f43('0x26')][_0x7f43('0x19')](_0x2eda66)[_0x7f43('0x1f')](function(_0x331af9){_0x5e1de1[_0x7f43('0x19')]=_0x331af9;if(_0x2d4fff['query'][_0x7f43('0x3c')]){_0x284b5f[_0x7f43('0x3d')]=[{'all':!![]}];}return db[_0x7f43('0x26')][_0x7f43('0x3e')](_0x284b5f);})[_0x7f43('0x1f')](function(_0x22e547){_0x5e1de1['rows']=_0x22e547;return _0x5e1de1;})[_0x7f43('0x1f')](respondWithFilteredResult(_0x5018d3,_0x284b5f))['catch'](handleError(_0x5018d3,null));};exports[_0x7f43('0x3f')]=function(_0x2fe055,_0x11cc62){var _0x5c539d={'raw':!![],'where':{'id':_0x2fe055['params']['id']}},_0x3d717f={};_0x3d717f[_0x7f43('0x2a')]=_[_0x7f43('0x2d')](db[_0x7f43('0x26')][_0x7f43('0x40')]);_0x3d717f[_0x7f43('0x2c')]=_[_0x7f43('0x2d')](_0x2fe055[_0x7f43('0x2c')]);_0x3d717f[_0x7f43('0x2e')]=_[_0x7f43('0x2f')](_0x3d717f['model'],_0x3d717f['query']);_0x5c539d['attributes']=_[_0x7f43('0x2f')](_0x3d717f[_0x7f43('0x2a')],qs[_0x7f43('0x31')](_0x2fe055[_0x7f43('0x2c')][_0x7f43('0x31')]));_0x5c539d[_0x7f43('0x30')]=_0x5c539d[_0x7f43('0x30')][_0x7f43('0x32')]?_0x5c539d[_0x7f43('0x30')]:_0x3d717f[_0x7f43('0x2a')];if(_0x2fe055[_0x7f43('0x2c')]['includeAll']){_0x5c539d[_0x7f43('0x3d')]=[{'all':!![]}];}_0x5c539d=_[_0x7f43('0x39')]({},_0x5c539d,_0x2fe055[_0x7f43('0x3b')]);return db['VoiceTransferReport'][_0x7f43('0x41')](_0x5c539d)[_0x7f43('0x1f')](handleEntityNotFound(_0x11cc62,null))[_0x7f43('0x1f')](respondWithResult(_0x11cc62,null))['catch'](handleError(_0x11cc62,null));};exports[_0x7f43('0x42')]=function(_0x36f17c,_0xc9e556){return db[_0x7f43('0x26')]['create'](_0x36f17c[_0x7f43('0x43')],{})[_0x7f43('0x1f')](respondWithResult(_0xc9e556,0xc9))[_0x7f43('0x44')](handleError(_0xc9e556,null));};exports[_0x7f43('0x1e')]=function(_0x41a53b,_0x1e0a8c){if(_0x41a53b['body']['id']){delete _0x41a53b[_0x7f43('0x43')]['id'];}return db[_0x7f43('0x26')][_0x7f43('0x41')]({'where':{'id':_0x41a53b[_0x7f43('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e0a8c,null))['then'](saveUpdates(_0x41a53b[_0x7f43('0x43')],null))['then'](respondWithResult(_0x1e0a8c,null))[_0x7f43('0x44')](handleError(_0x1e0a8c,null));};exports[_0x7f43('0x20')]=function(_0x1b72c3,_0x5a0203){return db[_0x7f43('0x26')]['find']({'where':{'id':_0x1b72c3[_0x7f43('0x45')]['id']}})[_0x7f43('0x1f')](handleEntityNotFound(_0x5a0203,null))['then'](removeEntity(_0x5a0203,null))['catch'](handleError(_0x5a0203,null));};exports[_0x7f43('0x46')]=function(_0x4ac7c8,_0xb54238){return db[_0x7f43('0x26')][_0x7f43('0x46')]()['then'](respondWithResult(_0xb54238,null))[_0x7f43('0x44')](handleError(_0xb54238,null));};
\ No newline at end of file
index 609a2ec..e683133 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d8c=['moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','api'];(function(_0x45c48f,_0x4aa891){var _0xaf5037=function(_0x3e3c1f){while(--_0x3e3c1f){_0x45c48f['push'](_0x45c48f['shift']());}};_0xaf5037(++_0x4aa891);}(_0x5d8c,0x1c5));var _0xc5d8=function(_0x1d5eac,_0x3bde6b){_0x1d5eac=_0x1d5eac-0x0;var _0x590554=_0x5d8c[_0x1d5eac];return _0x590554;};'use strict';var _=require(_0xc5d8('0x0'));var util=require(_0xc5d8('0x1'));var logger=require('../../config/logger')(_0xc5d8('0x2'));var moment=require(_0xc5d8('0x3'));var BPromise=require(_0xc5d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5d8('0x5'));var rimraf=require(_0xc5d8('0x6'));var config=require(_0xc5d8('0x7'));var attributes=require(_0xc5d8('0x8'));module[_0xc5d8('0x9')]=function(_0x1005bb,_0xdd54c0){return _0x1005bb[_0xc5d8('0xa')]('VoiceTransferReport',attributes,{'tableName':_0xc5d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x962f=['request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment'];(function(_0x1258ac,_0x9f8430){var _0x5d71dc=function(_0x2b92d0){while(--_0x2b92d0){_0x1258ac['push'](_0x1258ac['shift']());}};_0x5d71dc(++_0x9f8430);}(_0x962f,0xbe));var _0xf962=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x962f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf962('0x0'));var util=require(_0xf962('0x1'));var logger=require(_0xf962('0x2'))(_0xf962('0x3'));var moment=require(_0xf962('0x4'));var BPromise=require('bluebird');var rp=require(_0xf962('0x5'));var fs=require('fs');var path=require(_0xf962('0x6'));var rimraf=require(_0xf962('0x7'));var config=require(_0xf962('0x8'));var attributes=require(_0xf962('0x9'));module[_0xf962('0xa')]=function(_0x3cfcff,_0x350411){return _0x3cfcff['define'](_0xf962('0xb'),attributes,{'tableName':_0xf962('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e50bc42..510f6e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9057=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','raw','stringify','lodash','util','moment','bluebird'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x9057,0xcc));var _0x7905=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0x9057[_0x10c51f];return _0x56a0cd;};'use strict';var _=require(_0x7905('0x0'));var util=require(_0x7905('0x1'));var moment=require(_0x7905('0x2'));var BPromise=require(_0x7905('0x3'));var rs=require(_0x7905('0x4'));var fs=require('fs');var Redis=require(_0x7905('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7905('0x6'));var logger=require(_0x7905('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7905('0x8'));var client=jayson['client'][_0x7905('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c861f,_0x10813c,_0xd79d1e){return new BPromise(function(_0x225204,_0x5f46d8){return client[_0x7905('0xa')](_0x1c861f,_0xd79d1e)[_0x7905('0xb')](function(_0x304007){logger[_0x7905('0xc')](_0x7905('0xd'),_0x10813c,'request\x20sent');logger[_0x7905('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x10813c,_0x7905('0xf'),JSON['stringify'](_0x304007));if(_0x304007[_0x7905('0x10')]){if(_0x304007[_0x7905('0x10')][_0x7905('0x11')]===0x1f4){logger[_0x7905('0x10')](_0x7905('0xd'),_0x10813c,_0x304007[_0x7905('0x10')]['message']);return _0x5f46d8(_0x304007[_0x7905('0x10')]['message']);}logger[_0x7905('0x10')](_0x7905('0xd'),_0x10813c,_0x304007['error'][_0x7905('0x12')]);return _0x225204(_0x304007['error']['message']);}else{logger[_0x7905('0xc')](_0x7905('0xd'),_0x10813c,_0x7905('0xf'));_0x225204(_0x304007[_0x7905('0x13')]['message']);}})['catch'](function(_0x46de0a){logger[_0x7905('0x10')](_0x7905('0xd'),_0x10813c,_0x46de0a);_0x5f46d8(_0x46de0a);});});}exports[_0x7905('0x14')]=function(_0x32bef2){var _0x324cb2=this;return new Promise(function(_0x59667f,_0x12d547){return db[_0x7905('0x15')][_0x7905('0x16')](_0x32bef2[_0x7905('0x17')],{'raw':_0x32bef2['options']?_0x32bef2['options'][_0x7905('0x18')]===undefined?!![]:![]:!![]})[_0x7905('0xb')](function(_0x198ccc){logger[_0x7905('0xc')](_0x7905('0x14'),_0x32bef2);logger[_0x7905('0xe')](_0x7905('0x14'),_0x32bef2,JSON[_0x7905('0x19')](_0x198ccc));_0x59667f(_0x198ccc);})['catch'](function(_0x3463b5){logger[_0x7905('0x10')]('CreateVoiceTransferReport',_0x3463b5[_0x7905('0x12')],_0x32bef2);_0x12d547(_0x324cb2[_0x7905('0x10')](0x1f4,_0x3463b5[_0x7905('0x12')]));});});};
\ No newline at end of file
+var _0x9c5f=['CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x450c9f,_0xe1efc){var _0x30d803=function(_0x120f72){while(--_0x120f72){_0x450c9f['push'](_0x450c9f['shift']());}};_0x30d803(++_0xe1efc);}(_0x9c5f,0x11f));var _0xf9c5=function(_0x23488b,_0x3e64e2){_0x23488b=_0x23488b-0x0;var _0x351058=_0x9c5f[_0x23488b];return _0x351058;};'use strict';var _=require(_0xf9c5('0x0'));var util=require(_0xf9c5('0x1'));var moment=require(_0xf9c5('0x2'));var BPromise=require(_0xf9c5('0x3'));var rs=require(_0xf9c5('0x4'));var fs=require('fs');var Redis=require(_0xf9c5('0x5'));var db=require(_0xf9c5('0x6'))['db'];var utils=require(_0xf9c5('0x7'));var logger=require(_0xf9c5('0x8'))('rpc');var config=require(_0xf9c5('0x9'));var jayson=require(_0xf9c5('0xa'));var client=jayson[_0xf9c5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26aae1,_0x5e0bce,_0x3feb2b){return new BPromise(function(_0x2fae38,_0x2464a2){return client[_0xf9c5('0xc')](_0x26aae1,_0x3feb2b)['then'](function(_0x4a10f2){logger[_0xf9c5('0xd')](_0xf9c5('0xe'),_0x5e0bce,'request\x20sent');logger[_0xf9c5('0xf')](_0xf9c5('0x10'),_0x5e0bce,_0xf9c5('0x11'),JSON[_0xf9c5('0x12')](_0x4a10f2));if(_0x4a10f2[_0xf9c5('0x13')]){if(_0x4a10f2[_0xf9c5('0x13')][_0xf9c5('0x14')]===0x1f4){logger[_0xf9c5('0x13')](_0xf9c5('0xe'),_0x5e0bce,_0x4a10f2['error'][_0xf9c5('0x15')]);return _0x2464a2(_0x4a10f2['error'][_0xf9c5('0x15')]);}logger[_0xf9c5('0x13')](_0xf9c5('0xe'),_0x5e0bce,_0x4a10f2[_0xf9c5('0x13')][_0xf9c5('0x15')]);return _0x2fae38(_0x4a10f2[_0xf9c5('0x13')][_0xf9c5('0x15')]);}else{logger[_0xf9c5('0xd')](_0xf9c5('0xe'),_0x5e0bce,_0xf9c5('0x11'));_0x2fae38(_0x4a10f2[_0xf9c5('0x16')]['message']);}})['catch'](function(_0x540761){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x5e0bce,_0x540761);_0x2464a2(_0x540761);});});}exports[_0xf9c5('0x17')]=function(_0x104a68){var _0x23f574=this;return new Promise(function(_0x4ce7b6,_0x111864){return db[_0xf9c5('0x18')][_0xf9c5('0x19')](_0x104a68[_0xf9c5('0x1a')],{'raw':_0x104a68[_0xf9c5('0x1b')]?_0x104a68[_0xf9c5('0x1b')][_0xf9c5('0x1c')]===undefined?!![]:![]:!![]})[_0xf9c5('0x1d')](function(_0x5550ab){logger[_0xf9c5('0xd')](_0xf9c5('0x17'),_0x104a68);logger['debug'](_0xf9c5('0x17'),_0x104a68,JSON[_0xf9c5('0x12')](_0x5550ab));_0x4ce7b6(_0x5550ab);})[_0xf9c5('0x1e')](function(_0x1f1d17){logger['error'](_0xf9c5('0x17'),_0x1f1d17[_0xf9c5('0x15')],_0x104a68);_0x111864(_0x23f574['error'](0x1f4,_0x1f1d17['message']));});});};
\ No newline at end of file
index 4aadca6..49f6a27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x695f=['./webbar.controller','post','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','unhold','/transfer','exports','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x695f,0xbf));var _0xf695=function(_0x285ec4,_0x5167d5){_0x285ec4=_0x285ec4-0x0;var _0x49dd6a=_0x695f[_0x285ec4];return _0x49dd6a;};'use strict';var express=require('express');var router=express[_0xf695('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xf695('0x1'));router[_0xf695('0x2')]('/originate',auth[_0xf695('0x3')](),auth[_0xf695('0x4')](),controller[_0xf695('0x5')]);router['post'](_0xf695('0x6'),auth[_0xf695('0x3')](),auth[_0xf695('0x4')](),controller[_0xf695('0x7')]);router[_0xf695('0x2')](_0xf695('0x8'),auth[_0xf695('0x3')](),auth[_0xf695('0x4')](),controller[_0xf695('0x9')]);router[_0xf695('0x2')](_0xf695('0xa'),auth[_0xf695('0x3')](),auth[_0xf695('0x4')](),controller[_0xf695('0xb')]);router[_0xf695('0x2')](_0xf695('0xc'),auth[_0xf695('0x3')](),auth[_0xf695('0x4')](),controller[_0xf695('0xd')]);router[_0xf695('0x2')]('/calls',auth[_0xf695('0x3')](),auth[_0xf695('0x4')](),controller['calls']);router[_0xf695('0x2')](_0xf695('0xe'),auth[_0xf695('0x3')](),auth['canUpdate'](),controller['transfer']);module[_0xf695('0xf')]=router;
\ No newline at end of file
+var _0x6c80=['exports','express','Router','../../components/auth/service','./webbar.controller','/originate','canUpdate','originate','post','isAuthenticated','/answer','answer','hold','/unhold','/calls','calls','/transfer','transfer'];(function(_0x38f126,_0x374a30){var _0x4cf023=function(_0x53a3c7){while(--_0x53a3c7){_0x38f126['push'](_0x38f126['shift']());}};_0x4cf023(++_0x374a30);}(_0x6c80,0x145));var _0x06c8=function(_0x5aa1d3,_0x1c0010){_0x5aa1d3=_0x5aa1d3-0x0;var _0x1859cf=_0x6c80[_0x5aa1d3];return _0x1859cf;};'use strict';var express=require(_0x06c8('0x0'));var router=express[_0x06c8('0x1')]();var auth=require(_0x06c8('0x2'));var controller=require(_0x06c8('0x3'));router['post'](_0x06c8('0x4'),auth['isAuthenticated'](),auth[_0x06c8('0x5')](),controller[_0x06c8('0x6')]);router[_0x06c8('0x7')]('/hangup',auth[_0x06c8('0x8')](),auth['canUpdate'](),controller['hangup']);router['post'](_0x06c8('0x9'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x06c8('0xa')]);router[_0x06c8('0x7')]('/hold',auth[_0x06c8('0x8')](),auth['canUpdate'](),controller[_0x06c8('0xb')]);router[_0x06c8('0x7')](_0x06c8('0xc'),auth[_0x06c8('0x8')](),auth['canUpdate'](),controller['unhold']);router['post'](_0x06c8('0xd'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x06c8('0xe')]);router[_0x06c8('0x7')](_0x06c8('0xf'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x06c8('0x10')]);module[_0x06c8('0x11')]=router;
\ No newline at end of file
index 0ea1dec..fc9defb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ba=['webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','entityFound:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','calls','calls\x20fired:','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','webbar:transfer','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','transferNumber\x20is\x20required','info','log','error','stack','name','status','send','request','code','message','result','catch','VoiceChannels','all','then','filter','rows','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callbackUrl','format','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','user:%s'];(function(_0x1e0b23,_0x447f13){var _0x9e049c=function(_0x41f9e3){while(--_0x41f9e3){_0x1e0b23['push'](_0x1e0b23['shift']());}};_0x9e049c(++_0x447f13);}(_0x17ba,0xab));var _0xa17b=function(_0x2d9495,_0x321d72){_0x2d9495=_0x2d9495-0x0;var _0x3c68e2=_0x17ba[_0x2d9495];return _0x3c68e2;};'use strict';var path=require(_0xa17b('0x0'));var fs=require('fs');var _=require(_0xa17b('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xa17b('0x2'));var util=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var jayson=require(_0xa17b('0x5'));var amiClient=jayson[_0xa17b('0x6')][_0xa17b('0x7')]({'port':0x232a});var logger=require(_0xa17b('0x8'))(_0xa17b('0x9'));var Redis=require(_0xa17b('0xa'));config[_0xa17b('0xb')]=_[_0xa17b('0xc')](config[_0xa17b('0xb')],{'host':_0xa17b('0xd'),'port':0x18eb});var io=require(_0xa17b('0xe'))(new Redis(config[_0xa17b('0xb')]));var Schema=require(_0xa17b('0xf'));var originateValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]},'callNumber':{'type':_0xa17b('0x12'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xa17b('0x12')},'callbackUrl':{'type':_0xa17b('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]},'sessionId':{'type':_0xa17b('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]},'sessionId':{'type':_0xa17b('0x12'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xa17b('0x12'),'required':[!![],_0xa17b('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa17b('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xa17b('0x10'),'required':[!![],_0xa17b('0x11')]}});function emit(_0x1c0578,_0x1f8141,_0x4870fb){logger[_0xa17b('0x14')](_0x1c0578,_0x1f8141,JSON['stringify'](_0x4870fb));io['to'](_0x1c0578)['emit'](_0x1f8141,_0x4870fb);}function handleError(_0x47d80b){return function(_0x36f985){console[_0xa17b('0x15')]('handleError:',_0x36f985,_0x36f985 instanceof RangeError);logger[_0xa17b('0x16')](_0x36f985[_0xa17b('0x17')]);if(_0x36f985 instanceof RangeError){if(_0x36f985[_0xa17b('0x18')]){delete _0x36f985[_0xa17b('0x18')];}_0x47d80b[_0xa17b('0x19')](0x194)[_0xa17b('0x1a')](_0x36f985);}else{if(_0x36f985[_0xa17b('0x18')]){delete _0x36f985['name'];}_0x47d80b[_0xa17b('0x19')](0x1f4)[_0xa17b('0x1a')](_0x36f985);}};}function checkError(){return function(_0x45bd0c){if(!_0x45bd0c){throw new RangeError('NotFound');}return _0x45bd0c;};}function respondWithRpcPromise(_0x44f7bc,_0x1a6471){return new BPromise(function(_0x24d305,_0xbbbb62){var _0x3c7ec2=amiClient;return _0x3c7ec2[_0xa17b('0x1b')](_0x44f7bc,_0x1a6471)['then'](function(_0x3df11f){if(_0x3df11f['error']){if(_0x3df11f[_0xa17b('0x16')][_0xa17b('0x1c')]===0x1f4){return _0xbbbb62(_0x3df11f['error']['message']);}return _0x24d305(_0x3df11f[_0xa17b('0x16')][_0xa17b('0x1d')]);}else{_0x24d305(_0x3df11f[_0xa17b('0x1e')]);}})[_0xa17b('0x1f')](function(_0x3c32a5){_0xbbbb62(_0x3c32a5);});});}function getAgent(_0x3a64f5){return db['User']['findOne']({'where':{'id':_0x3a64f5,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x2b1708,_0x5ef356){return new BPromise(function(_0x295e67,_0x4ff3f8){var _0x14671b=respondWithRpcPromise(_0xa17b('0x20'));var _0x32cad9=getAgent(_0x2b1708);Promise[_0xa17b('0x21')]([_0x14671b,_0x32cad9])[_0xa17b('0x22')](function(_0x3ccdb8){var _0x2fbbe8=_0x3ccdb8[0x0];var _0x366b47=_0x3ccdb8[0x1];var _0x43b1f5=_[_0xa17b('0x23')](_0x2fbbe8[_0xa17b('0x24')],function(_0x573585){return _0x573585['UserId']==_0x366b47['id']&&_0x573585['sessionId']==_0x5ef356;});if(_0x43b1f5[_0xa17b('0x25')]==0x1){_0x295e67(_0x366b47);}else{_0x4ff3f8(new RangeError(_0xa17b('0x26')+_0x5ef356+_0xa17b('0x27')));}});});}exports[_0xa17b('0x28')]=function(_0x16dd1f,_0x156409){logger[_0xa17b('0x14')](_0xa17b('0x29'),_0x16dd1f['body']);var _0x1e33bf=originateValidation['validate'](_0x16dd1f[_0xa17b('0x2a')]);if(_0x1e33bf[_0xa17b('0x25')]>0x0){return _0x156409[_0xa17b('0x19')](0x190)[_0xa17b('0x2b')](_0x1e33bf);}var _0x4ec38d=_0x16dd1f[_0xa17b('0x2a')]['userId'];var _0x3031b5=_0x16dd1f[_0xa17b('0x2a')][_0xa17b('0x2c')];var _0x12d8af=_0x16dd1f[_0xa17b('0x2a')]['callerId'];var _0x2db32a=_0x16dd1f['body'][_0xa17b('0x2d')];return getAgent(_0x4ec38d)['then'](function(_0x449faa){logger[_0xa17b('0x14')]('entityFound:',_0x449faa[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')]('user:%s',_0x449faa[_0xa17b('0x18')]),_0xa17b('0x2f'),{'callNumber':_0x3031b5,'callerId':_0x12d8af,'callbackUrl':_0x2db32a});return _0x156409[_0xa17b('0x19')](0xc8)[_0xa17b('0x2b')]({'error':![],'message':_0xa17b('0x30')});})['catch'](handleError(_0x156409));};exports[_0xa17b('0x31')]=function(_0x506488,_0x26786d){logger['info'](_0xa17b('0x32'),_0x506488['body']);var _0x1e457e=hangupValidation['validate'](_0x506488[_0xa17b('0x2a')]);if(_0x1e457e['length']>0x0){return _0x26786d[_0xa17b('0x19')](0x190)[_0xa17b('0x2b')](_0x1e457e);}var _0x5bfb5=_0x506488[_0xa17b('0x2a')][_0xa17b('0x33')];var _0xdd429f=_0x506488[_0xa17b('0x2a')][_0xa17b('0x34')];return getAgent(_0x5bfb5)['then'](function(_0x468c92){logger[_0xa17b('0x14')]('entityFound:',_0x468c92[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')](_0xa17b('0x35'),_0x468c92[_0xa17b('0x18')]),_0xa17b('0x36'),{'sessionId':_0xdd429f});return _0x26786d[_0xa17b('0x19')](0xc8)['json']({'error':![],'message':_0xa17b('0x37')});})[_0xa17b('0x1f')](handleError(_0x26786d));};exports[_0xa17b('0x38')]=function(_0x5ec459,_0x54b65c){logger['info'](_0xa17b('0x39'),_0x5ec459[_0xa17b('0x2a')]);var _0x3c2788=answerValidation[_0xa17b('0xf')](_0x5ec459[_0xa17b('0x2a')]);if(_0x3c2788[_0xa17b('0x25')]>0x0){return _0x54b65c[_0xa17b('0x19')](0x190)[_0xa17b('0x2b')](_0x3c2788);}var _0x1704ba=_0x5ec459[_0xa17b('0x2a')][_0xa17b('0x33')];var _0x1267de=_0x5ec459['body'][_0xa17b('0x34')];return getAgent(_0x1704ba)[_0xa17b('0x22')](function(_0x384c12){logger[_0xa17b('0x14')](_0xa17b('0x3a'),_0x384c12[_0xa17b('0x18')]);emit(util['format'](_0xa17b('0x35'),_0x384c12[_0xa17b('0x18')]),_0xa17b('0x3b'),{'sessionId':_0x1267de});return _0x54b65c[_0xa17b('0x19')](0xc8)[_0xa17b('0x2b')]({'error':![],'message':'answer\x20executed!'});})[_0xa17b('0x1f')](handleError(_0x54b65c));};exports[_0xa17b('0x3c')]=function(_0x2b4831,_0x1dc0f7){logger['info'](_0xa17b('0x3d'),_0x2b4831[_0xa17b('0x2a')]);var _0x421470=holdValidation[_0xa17b('0xf')](_0x2b4831[_0xa17b('0x2a')]);if(_0x421470[_0xa17b('0x25')]>0x0){return _0x1dc0f7[_0xa17b('0x19')](0x190)['json'](_0x421470);}var _0x43b5d5=_0x2b4831[_0xa17b('0x2a')]['userId'];var _0xb4b4d=_0x2b4831[_0xa17b('0x2a')][_0xa17b('0x34')];return getAgent(_0x43b5d5)['then'](function(_0x187237){logger[_0xa17b('0x14')]('entityFound:',_0x187237[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')]('user:%s',_0x187237[_0xa17b('0x18')]),_0xa17b('0x3e'),{'sessionId':_0xb4b4d});return _0x1dc0f7['status'](0xc8)[_0xa17b('0x2b')]({'error':![],'message':_0xa17b('0x3f')});})[_0xa17b('0x1f')](handleError(_0x1dc0f7));};exports[_0xa17b('0x40')]=function(_0x2f4a2c,_0x133823){logger[_0xa17b('0x14')]('unhold\x20fired:',_0x2f4a2c[_0xa17b('0x2a')]);var _0x3ff07a=unholdValidation[_0xa17b('0xf')](_0x2f4a2c[_0xa17b('0x2a')]);if(_0x3ff07a[_0xa17b('0x25')]>0x0){return _0x133823[_0xa17b('0x19')](0x190)[_0xa17b('0x2b')](_0x3ff07a);}var _0x100d14=_0x2f4a2c[_0xa17b('0x2a')][_0xa17b('0x33')];var _0x1e4b67=_0x2f4a2c[_0xa17b('0x2a')][_0xa17b('0x34')];return getAgent(_0x100d14)['then'](function(_0x4c62a3){logger[_0xa17b('0x14')](_0xa17b('0x3a'),_0x4c62a3[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')](_0xa17b('0x35'),_0x4c62a3[_0xa17b('0x18')]),_0xa17b('0x41'),{'sessionId':_0x1e4b67});return _0x133823[_0xa17b('0x19')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0xa17b('0x1f')](handleError(_0x133823));};exports[_0xa17b('0x42')]=function(_0x55b0e4,_0x568f27){logger['info'](_0xa17b('0x43'),_0x568f27[_0xa17b('0x2a')]);var _0x3aeae5=callsValidation[_0xa17b('0xf')](_0x55b0e4[_0xa17b('0x2a')]);if(_0x3aeae5[_0xa17b('0x25')]>0x0){return _0x568f27['status'](0x190)['json'](_0x3aeae5);}var _0x555529=_0x55b0e4['body']['userId'];var _0x2a62e4=respondWithRpcPromise(_0xa17b('0x20'));var _0x20fe4a=getAgent(_0x555529);return Promise[_0xa17b('0x21')]([_0x2a62e4,_0x20fe4a])[_0xa17b('0x22')](function(_0x273671){var _0x3270a0=_0x273671[0x0];var _0x55b98a=_0x273671[0x1];var _0x3e739a=_[_0xa17b('0x23')](_0x3270a0[_0xa17b('0x24')],function(_0x2d744d){return _0x2d744d[_0xa17b('0x44')]==_0x55b98a['id'];});return _0x568f27[_0xa17b('0x19')](0xc8)[_0xa17b('0x2b')]({'count':_0x3e739a[_0xa17b('0x25')],'rows':_0x3e739a});})[_0xa17b('0x1f')](handleError(_0x568f27));};exports[_0xa17b('0x45')]=function(_0x3d9a89,_0xef6b2e){logger['info'](_0xa17b('0x46'),_0x3d9a89['body']);var _0x3de0d8=conferenceValidation[_0xa17b('0xf')](_0x3d9a89[_0xa17b('0x2a')]);if(_0x3de0d8[_0xa17b('0x25')]>0x0){return _0xef6b2e['status'](0x190)[_0xa17b('0x2b')](_0x3de0d8);}var _0x57a1d9=_0x3d9a89[_0xa17b('0x2a')]['userId'];return getAgent(_0x57a1d9)['then'](function(_0x299c83){logger[_0xa17b('0x14')]('entityFound:',_0x299c83[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')]('user:%s',_0x299c83['name']),_0xa17b('0x47'));return _0xef6b2e[_0xa17b('0x19')](0xc8)['json']({'error':![],'message':_0xa17b('0x48')});})[_0xa17b('0x1f')](handleError(_0xef6b2e));};exports['transfer']=function(_0x27ba7a,_0x3ad933){logger[_0xa17b('0x14')](_0xa17b('0x49'),_0x27ba7a[_0xa17b('0x2a')]);var _0x521468=transferValidation[_0xa17b('0xf')](_0x27ba7a[_0xa17b('0x2a')]);if(_0x521468[_0xa17b('0x25')]>0x0){return _0x3ad933[_0xa17b('0x19')](0x190)[_0xa17b('0x2b')](_0x521468);}var _0x2e65b1=_0x27ba7a[_0xa17b('0x2a')][_0xa17b('0x33')];var _0x3fb393=_0x27ba7a[_0xa17b('0x2a')]['sessionId'];var _0x36ae46=_0x27ba7a[_0xa17b('0x2a')]['transferNumber'];return getAgent(_0x2e65b1)['then'](function(_0x14dbba){logger[_0xa17b('0x14')](_0xa17b('0x3a'),_0x14dbba[_0xa17b('0x18')]);emit(util[_0xa17b('0x2e')]('user:%s',_0x14dbba[_0xa17b('0x18')]),_0xa17b('0x4a'),{'sessionId':_0x3fb393,'transferNumber':_0x36ae46});return _0x3ad933[_0xa17b('0x19')](0xc8)[_0xa17b('0x2b')]({'error':![],'message':'transfer\x20executed!'});})[_0xa17b('0x1f')](handleError(_0x3ad933));};
\ No newline at end of file
+var _0x6f7a=['findOne','agent','then','VoiceChannels','all','filter','rows','UserId','length','sessionId\x20','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','sessionId','format','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','NotFound','code','catch','User'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1b1e9d,_0x5230d2){_0x1b1e9d=_0x1b1e9d-0x0;var _0x1d8f98=_0x6f7a[_0x1b1e9d];return _0x1d8f98;};'use strict';var path=require(_0xa6f7('0x0'));var fs=require('fs');var _=require(_0xa6f7('0x1'));var db=require(_0xa6f7('0x2'))['db'];var config=require(_0xa6f7('0x3'));var util=require('util');var BPromise=require(_0xa6f7('0x4'));var jayson=require(_0xa6f7('0x5'));var amiClient=jayson[_0xa6f7('0x6')][_0xa6f7('0x7')]({'port':0x232a});var logger=require(_0xa6f7('0x8'))(_0xa6f7('0x9'));var Redis=require(_0xa6f7('0xa'));config[_0xa6f7('0xb')]=_[_0xa6f7('0xc')](config[_0xa6f7('0xb')],{'host':_0xa6f7('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0xa6f7('0xe'));var originateValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'callNumber':{'type':_0xa6f7('0x11'),'required':[!![],_0xa6f7('0x12')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa6f7('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':_0xa6f7('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xa6f7('0x11'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':_0xa6f7('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]}});function emit(_0x6efd38,_0x47e664,_0xdb37e2){logger[_0xa6f7('0x13')](_0x6efd38,_0x47e664,JSON[_0xa6f7('0x14')](_0xdb37e2));io['to'](_0x6efd38)[_0xa6f7('0x15')](_0x47e664,_0xdb37e2);}function handleError(_0x5681d5){return function(_0x4a8827){console[_0xa6f7('0x16')]('handleError:',_0x4a8827,_0x4a8827 instanceof RangeError);logger[_0xa6f7('0x17')](_0x4a8827[_0xa6f7('0x18')]);if(_0x4a8827 instanceof RangeError){if(_0x4a8827['name']){delete _0x4a8827[_0xa6f7('0x19')];}_0x5681d5[_0xa6f7('0x1a')](0x194)[_0xa6f7('0x1b')](_0x4a8827);}else{if(_0x4a8827[_0xa6f7('0x19')]){delete _0x4a8827[_0xa6f7('0x19')];}_0x5681d5[_0xa6f7('0x1a')](0x1f4)['send'](_0x4a8827);}};}function checkError(){return function(_0x3c0c55){if(!_0x3c0c55){throw new RangeError(_0xa6f7('0x1c'));}return _0x3c0c55;};}function respondWithRpcPromise(_0x58b6a1,_0x5d1159){return new BPromise(function(_0x5ddc8d,_0x1de6c9){var _0x119950=amiClient;return _0x119950['request'](_0x58b6a1,_0x5d1159)['then'](function(_0x50e2be){if(_0x50e2be[_0xa6f7('0x17')]){if(_0x50e2be[_0xa6f7('0x17')][_0xa6f7('0x1d')]===0x1f4){return _0x1de6c9(_0x50e2be['error']['message']);}return _0x5ddc8d(_0x50e2be[_0xa6f7('0x17')]['message']);}else{_0x5ddc8d(_0x50e2be['result']);}})[_0xa6f7('0x1e')](function(_0x5efdce){_0x1de6c9(_0x5efdce);});});}function getAgent(_0x35847e){return db[_0xa6f7('0x1f')][_0xa6f7('0x20')]({'where':{'id':_0x35847e,'role':_0xa6f7('0x21')}})[_0xa6f7('0x22')](checkError());}function getAgentCheckSession(_0x4b8d2b,_0x51db47){return new BPromise(function(_0x1c419b,_0x2ad0d9){var _0x55d45a=respondWithRpcPromise(_0xa6f7('0x23'));var _0x27babb=getAgent(_0x4b8d2b);Promise[_0xa6f7('0x24')]([_0x55d45a,_0x27babb])[_0xa6f7('0x22')](function(_0x224f5a){var _0x10bf77=_0x224f5a[0x0];var _0x353de8=_0x224f5a[0x1];var _0x54f72c=_[_0xa6f7('0x25')](_0x10bf77[_0xa6f7('0x26')],function(_0x40b0f8){return _0x40b0f8[_0xa6f7('0x27')]==_0x353de8['id']&&_0x40b0f8['sessionId']==_0x51db47;});if(_0x54f72c[_0xa6f7('0x28')]==0x1){_0x1c419b(_0x353de8);}else{_0x2ad0d9(new RangeError(_0xa6f7('0x29')+_0x51db47+'\x20not\x20found!'));}});});}exports[_0xa6f7('0x2a')]=function(_0x34d571,_0x4d79d8){logger['info'](_0xa6f7('0x2b'),_0x34d571[_0xa6f7('0x2c')]);var _0x2b33d=originateValidation[_0xa6f7('0xe')](_0x34d571[_0xa6f7('0x2c')]);if(_0x2b33d['length']>0x0){return _0x4d79d8['status'](0x190)[_0xa6f7('0x2d')](_0x2b33d);}var _0x4c2acd=_0x34d571[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0xfa0fb6=_0x34d571[_0xa6f7('0x2c')][_0xa6f7('0x2f')];var _0xbdfc5a=_0x34d571['body'][_0xa6f7('0x30')];var _0xb1a7f8=_0x34d571[_0xa6f7('0x2c')]['callbackUrl'];return getAgent(_0x4c2acd)[_0xa6f7('0x22')](function(_0x5ab03d){logger[_0xa6f7('0x13')](_0xa6f7('0x31'),_0x5ab03d[_0xa6f7('0x19')]);emit(util['format'](_0xa6f7('0x32'),_0x5ab03d[_0xa6f7('0x19')]),_0xa6f7('0x33'),{'callNumber':_0xfa0fb6,'callerId':_0xbdfc5a,'callbackUrl':_0xb1a7f8});return _0x4d79d8[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x34')});})['catch'](handleError(_0x4d79d8));};exports[_0xa6f7('0x35')]=function(_0xd930e8,_0xc25a1b){logger[_0xa6f7('0x13')](_0xa6f7('0x36'),_0xd930e8[_0xa6f7('0x2c')]);var _0x45acdd=hangupValidation[_0xa6f7('0xe')](_0xd930e8['body']);if(_0x45acdd[_0xa6f7('0x28')]>0x0){return _0xc25a1b[_0xa6f7('0x1a')](0x190)[_0xa6f7('0x2d')](_0x45acdd);}var _0x518088=_0xd930e8[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0x589d94=_0xd930e8[_0xa6f7('0x2c')][_0xa6f7('0x37')];return getAgent(_0x518088)[_0xa6f7('0x22')](function(_0x14d532){logger[_0xa6f7('0x13')]('entityFound:',_0x14d532[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x14d532[_0xa6f7('0x19')]),_0xa6f7('0x39'),{'sessionId':_0x589d94});return _0xc25a1b[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x3a')});})['catch'](handleError(_0xc25a1b));};exports['answer']=function(_0x12f7b5,_0x3e1535){logger[_0xa6f7('0x13')](_0xa6f7('0x3b'),_0x12f7b5[_0xa6f7('0x2c')]);var _0x387714=answerValidation[_0xa6f7('0xe')](_0x12f7b5[_0xa6f7('0x2c')]);if(_0x387714[_0xa6f7('0x28')]>0x0){return _0x3e1535[_0xa6f7('0x1a')](0x190)['json'](_0x387714);}var _0x41917c=_0x12f7b5[_0xa6f7('0x2c')]['userId'];var _0x22d500=_0x12f7b5[_0xa6f7('0x2c')][_0xa6f7('0x37')];return getAgent(_0x41917c)[_0xa6f7('0x22')](function(_0x51de13){logger[_0xa6f7('0x13')]('entityFound:',_0x51de13['name']);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x51de13[_0xa6f7('0x19')]),_0xa6f7('0x3c'),{'sessionId':_0x22d500});return _0x3e1535[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x3d')});})['catch'](handleError(_0x3e1535));};exports[_0xa6f7('0x3e')]=function(_0x40dbe6,_0x55cb70){logger[_0xa6f7('0x13')](_0xa6f7('0x3f'),_0x40dbe6[_0xa6f7('0x2c')]);var _0x5cc89c=holdValidation[_0xa6f7('0xe')](_0x40dbe6['body']);if(_0x5cc89c[_0xa6f7('0x28')]>0x0){return _0x55cb70[_0xa6f7('0x1a')](0x190)[_0xa6f7('0x2d')](_0x5cc89c);}var _0x5f3c84=_0x40dbe6['body'][_0xa6f7('0x2e')];var _0x5928e4=_0x40dbe6[_0xa6f7('0x2c')]['sessionId'];return getAgent(_0x5f3c84)['then'](function(_0x1e7089){logger[_0xa6f7('0x13')](_0xa6f7('0x31'),_0x1e7089[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x1e7089['name']),_0xa6f7('0x40'),{'sessionId':_0x5928e4});return _0x55cb70[_0xa6f7('0x1a')](0xc8)['json']({'error':![],'message':_0xa6f7('0x41')});})['catch'](handleError(_0x55cb70));};exports[_0xa6f7('0x42')]=function(_0x59091a,_0x488efc){logger[_0xa6f7('0x13')](_0xa6f7('0x43'),_0x59091a[_0xa6f7('0x2c')]);var _0x2b3de2=unholdValidation[_0xa6f7('0xe')](_0x59091a['body']);if(_0x2b3de2[_0xa6f7('0x28')]>0x0){return _0x488efc[_0xa6f7('0x1a')](0x190)['json'](_0x2b3de2);}var _0x4b83f6=_0x59091a['body'][_0xa6f7('0x2e')];var _0x1c2099=_0x59091a[_0xa6f7('0x2c')]['sessionId'];return getAgent(_0x4b83f6)[_0xa6f7('0x22')](function(_0x5dab05){logger[_0xa6f7('0x13')](_0xa6f7('0x31'),_0x5dab05[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x5dab05['name']),'webbar:unhold',{'sessionId':_0x1c2099});return _0x488efc[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x44')});})[_0xa6f7('0x1e')](handleError(_0x488efc));};exports['calls']=function(_0x9d901e,_0x2105dd){logger[_0xa6f7('0x13')](_0xa6f7('0x45'),_0x2105dd[_0xa6f7('0x2c')]);var _0x39538e=callsValidation['validate'](_0x9d901e[_0xa6f7('0x2c')]);if(_0x39538e[_0xa6f7('0x28')]>0x0){return _0x2105dd[_0xa6f7('0x1a')](0x190)['json'](_0x39538e);}var _0xb049d7=_0x9d901e[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0x4496f1=respondWithRpcPromise('VoiceChannels');var _0x4ec005=getAgent(_0xb049d7);return Promise[_0xa6f7('0x24')]([_0x4496f1,_0x4ec005])[_0xa6f7('0x22')](function(_0x1103c6){var _0x52e647=_0x1103c6[0x0];var _0x301327=_0x1103c6[0x1];var _0x269249=_[_0xa6f7('0x25')](_0x52e647['rows'],function(_0x169bbe){return _0x169bbe[_0xa6f7('0x27')]==_0x301327['id'];});return _0x2105dd[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'count':_0x269249[_0xa6f7('0x28')],'rows':_0x269249});})[_0xa6f7('0x1e')](handleError(_0x2105dd));};exports[_0xa6f7('0x46')]=function(_0x3bc870,_0x444177){logger[_0xa6f7('0x13')](_0xa6f7('0x47'),_0x3bc870['body']);var _0x224e33=conferenceValidation['validate'](_0x3bc870[_0xa6f7('0x2c')]);if(_0x224e33['length']>0x0){return _0x444177[_0xa6f7('0x1a')](0x190)[_0xa6f7('0x2d')](_0x224e33);}var _0x5a158f=_0x3bc870[_0xa6f7('0x2c')][_0xa6f7('0x2e')];return getAgent(_0x5a158f)[_0xa6f7('0x22')](function(_0x501503){logger[_0xa6f7('0x13')]('entityFound:',_0x501503[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')]('user:%s',_0x501503[_0xa6f7('0x19')]),'webbar:conference');return _0x444177[_0xa6f7('0x1a')](0xc8)['json']({'error':![],'message':_0xa6f7('0x48')});})[_0xa6f7('0x1e')](handleError(_0x444177));};exports[_0xa6f7('0x49')]=function(_0xca47c2,_0x315939){logger[_0xa6f7('0x13')](_0xa6f7('0x4a'),_0xca47c2[_0xa6f7('0x2c')]);var _0x153635=transferValidation[_0xa6f7('0xe')](_0xca47c2[_0xa6f7('0x2c')]);if(_0x153635[_0xa6f7('0x28')]>0x0){return _0x315939['status'](0x190)[_0xa6f7('0x2d')](_0x153635);}var _0x3c0c6e=_0xca47c2[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0x154c78=_0xca47c2[_0xa6f7('0x2c')][_0xa6f7('0x37')];var _0x3a5700=_0xca47c2['body'][_0xa6f7('0x4b')];return getAgent(_0x3c0c6e)[_0xa6f7('0x22')](function(_0x9c102f){logger['info'](_0xa6f7('0x31'),_0x9c102f[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x9c102f[_0xa6f7('0x19')]),_0xa6f7('0x4c'),{'sessionId':_0x154c78,'transferNumber':_0x3a5700});return _0x315939[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x315939));};
\ No newline at end of file
index f71e263..4f56714 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','put','update','delete','destroy','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get'];(function(_0x1e76fd,_0x25167d){var _0x2e7572=function(_0xd5e4eb){while(--_0xd5e4eb){_0x1e76fd['push'](_0x1e76fd['shift']());}};_0x2e7572(++_0x25167d);}(_0x524e,0x15e));var _0xe524=function(_0x349b0a,_0x4546ab){_0x349b0a=_0x349b0a-0x0;var _0x1ba963=_0x524e[_0x349b0a];return _0x1ba963;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x9')](_0xe524('0x10'),auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x9')](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x9')](_0xe524('0x14'),auth[_0xe524('0xe')](),controller['getAgents']);router['get'](_0xe524('0x15'),auth[_0xe524('0xe')](),controller[_0xe524('0x16')]);router[_0xe524('0x17')]('/',auth[_0xe524('0xe')](),controller['create']);router[_0xe524('0x17')]('/:id/dispositions',auth[_0xe524('0xe')](),controller[_0xe524('0x18')]);router['post'](_0xe524('0x12'),auth['isAuthenticated'](),controller[_0xe524('0x19')]);router['post'](_0xe524('0x14'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xe524('0x15'),auth['isAuthenticated'](),controller[_0xe524('0x1a')]);router[_0xe524('0x17')](_0xe524('0x1b'),controller[_0xe524('0x1c')]);router['post'](_0xe524('0x1d'),auth[_0xe524('0xe')](),controller['send']);router[_0xe524('0x1e')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x1f')]);router[_0xe524('0x20')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x21')]);router[_0xe524('0x20')]('/:id/dispositions',auth[_0xe524('0xe')](),controller['removeDispositions']);router['delete'](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x22')]);router[_0xe524('0x20')]('/:id/users',auth[_0xe524('0xe')](),controller['removeAgents']);module[_0xe524('0x23')]=router;
\ No newline at end of file
+var _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0x1f3208,_0x365413){var _0x18dd26=function(_0x27c5f9){while(--_0x27c5f9){_0x1f3208['push'](_0x1f3208['shift']());}};_0x18dd26(++_0x365413);}(_0xda2d,0x102));var _0xdda2=function(_0x10daf7,_0xef4299){_0x10daf7=_0x10daf7-0x0;var _0xf0a6c1=_0xda2d[_0x10daf7];return _0xf0a6c1;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router;
\ No newline at end of file
index 2a18620..338f0f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d8d=['exports','STRING','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring'];(function(_0x27314d,_0x33c0f2){var _0x30a648=function(_0x21e50b){while(--_0x21e50b){_0x27314d['push'](_0x27314d['shift']());}};_0x30a648(++_0x33c0f2);}(_0x3d8d,0xe0));var _0xd3d8=function(_0x541a6c,_0x2e4bf9){_0x541a6c=_0x541a6c-0x0;var _0x3d559d=_0x3d8d[_0x541a6c];return _0x3d559d;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd3d8('0x0'));module[_0xd3d8('0x1')]={'name':{'type':Sequelize[_0xd3d8('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xd3d8('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xd3d8('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xd3d8('0x2')],'defaultValue':function(){return rs[_0xd3d8('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd3d8('0x4')](_0xd3d8('0x5'))},'accountSid':{'type':Sequelize[_0xd3d8('0x2')]},'authToken':{'type':Sequelize[_0xd3d8('0x2')]},'notificationTemplate':{'type':Sequelize[_0xd3d8('0x6')],'defaultValue':function(){return _0xd3d8('0x7');}},'notificationSound':{'type':Sequelize[_0xd3d8('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xd3d8('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd3d8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd3d8('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd3d8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd3d8('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd3d8('0x9')],'comment':_0xd3d8('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd3d8('0xb'),'set':function(_0x4e2938){if(!_0x4e2938){this[_0xd3d8('0xc')](_0xd3d8('0xd'),null);}this['setDataValue'](_0xd3d8('0xe'),_0x4e2938);}},'description':{'type':Sequelize[_0xd3d8('0x2')]}};
\ No newline at end of file
+var _0x7d11=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x264048,_0x2e8c03){var _0x148a98=function(_0x2d06f2){while(--_0x2d06f2){_0x264048['push'](_0x264048['shift']());}};_0x148a98(++_0x2e8c03);}(_0x7d11,0x1c3));var _0x17d1=function(_0xf5d242,_0x36c2f5){_0xf5d242=_0xf5d242-0x0;var _0x1c49f9=_0x7d11[_0xf5d242];return _0x1c49f9;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x17d1('0x0'));module[_0x17d1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x17d1('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x17d1('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x17d1('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x17d1('0x3')],'defaultValue':function(){return rs[_0x17d1('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x17d1('0x5')](_0x17d1('0x6'))},'accountSid':{'type':Sequelize[_0x17d1('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x17d1('0x7')],'defaultValue':function(){return _0x17d1('0x8');}},'notificationSound':{'type':Sequelize[_0x17d1('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x17d1('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x17d1('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x17d1('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x17d1('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x17d1('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x17d1('0xa')],'comment':_0x17d1('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x17d1('0x9')],'defaultValue':![],'comment':_0x17d1('0xc'),'set':function(_0x2497af){if(!_0x2497af){this[_0x17d1('0xd')](_0x17d1('0xe'),null);}this['setDataValue'](_0x17d1('0xf'),_0x2497af);}},'description':{'type':Sequelize[_0x17d1('0x3')]}};
\ No newline at end of file
index e907986..fd6cd82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf86=['twilio','from','From','whatsapp:','MessageSid','isNil','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','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','*,*,*,*','messageId','ContactId','AttachmentId','UserId','unshift','Start','receiveMessage','entity\x20found','stringify','set','json','to\x20is\x20mandatory','List','out','WhatsappMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','client','http','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','sendStatus','status','end','offset','count','limit','Content-Range','apply','reject','update','destroy','then','get','WhatsappAccounts','UserProfileResource','name','send','Pause','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','WhatsappAccount','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','Disposition','getDispositions','pick','WhatsappAccountId','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','User','sequelize','transaction','WhatsappApplication','bulkCreate','getApplications','notify','whatsapp','Applications','account','applications','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile'];(function(_0x3c3ed1,_0x419d11){var _0x1f052f=function(_0x583c2d){while(--_0x583c2d){_0x3c3ed1['push'](_0x3c3ed1['shift']());}};_0x1f052f(++_0x419d11);}(_0xcf86,0xe0));var _0x6cf8=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xcf86[_0x2f3848];return _0x102668;};'use strict';var emlformat=require(_0x6cf8('0x0'));var rimraf=require(_0x6cf8('0x1'));var zipdir=require(_0x6cf8('0x2'));var jsonpatch=require(_0x6cf8('0x3'));var rp=require('request-promise');var moment=require(_0x6cf8('0x4'));var BPromise=require(_0x6cf8('0x5'));var Mustache=require(_0x6cf8('0x6'));var util=require(_0x6cf8('0x7'));var path=require(_0x6cf8('0x8'));var sox=require(_0x6cf8('0x9'));var csv=require(_0x6cf8('0xa'));var ejs=require(_0x6cf8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cf8('0xc'));var squel=require(_0x6cf8('0xd'));var crypto=require(_0x6cf8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6cf8('0xf'));var toCsv=require(_0x6cf8('0xa'));var querystring=require(_0x6cf8('0x10'));var Papa=require(_0x6cf8('0x11'));var Redis=require(_0x6cf8('0x12'));var authService=require(_0x6cf8('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf8('0x14'));var logger=require(_0x6cf8('0x15'))(_0x6cf8('0x16'));var utils=require(_0x6cf8('0x17'));var config=require(_0x6cf8('0x18'));var licenseUtil=require(_0x6cf8('0x19'));var db=require('../../mysqldb')['db'];config[_0x6cf8('0x1a')]=_[_0x6cf8('0x1b')](config['redis'],{'host':_0x6cf8('0x1c'),'port':0x18eb});var socket=require(_0x6cf8('0x1d'))(new Redis(config[_0x6cf8('0x1a')]));require(_0x6cf8('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x6cf8('0x1f')][_0x6cf8('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x592950,_0x22b33c,_0x5de82c,_0x4f5e9a){return new BPromise(function(_0x55c1c7,_0x56fa2c){var _0x5722d4=_0x4f5e9a||client;return _0x5722d4['request'](_0x592950,_0x5de82c)['then'](function(_0x5213fc){logger['info'](_0x6cf8('0x21'),_0x22b33c,_0x6cf8('0x22'));logger[_0x6cf8('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x22b33c,_0x6cf8('0x22'),JSON['stringify'](_0x5213fc));if(_0x5213fc[_0x6cf8('0x24')]){if(_0x5213fc[_0x6cf8('0x24')][_0x6cf8('0x25')]===0x1f4){logger[_0x6cf8('0x24')](_0x6cf8('0x21'),_0x22b33c,_0x5213fc[_0x6cf8('0x24')][_0x6cf8('0x26')]);return _0x56fa2c(_0x5213fc[_0x6cf8('0x24')]['message']);}logger['error'](_0x6cf8('0x21'),_0x22b33c,_0x5213fc[_0x6cf8('0x24')]['message']);return _0x55c1c7(_0x5213fc[_0x6cf8('0x24')][_0x6cf8('0x26')]);}else{logger[_0x6cf8('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x22b33c,_0x6cf8('0x22'));_0x55c1c7(_0x5213fc[_0x6cf8('0x28')][_0x6cf8('0x26')]);}})['catch'](function(_0x16b307){logger[_0x6cf8('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x22b33c,_0x16b307);_0x56fa2c(_0x16b307);});});}function respondWithStatusCode(_0x434690,_0x5ef5c0){_0x5ef5c0=_0x5ef5c0||0xcc;return function(_0xfa753e){if(_0xfa753e){return _0x434690[_0x6cf8('0x29')](_0x5ef5c0);}return _0x434690[_0x6cf8('0x2a')](_0x5ef5c0)[_0x6cf8('0x2b')]();};}function respondWithResult(_0x4d40d8,_0x3eee6e){_0x3eee6e=_0x3eee6e||0xc8;return function(_0x4d3163){if(_0x4d3163){return _0x4d40d8[_0x6cf8('0x2a')](_0x3eee6e)['json'](_0x4d3163);}};}function respondWithFilteredResult(_0x259162,_0xff861c){return function(_0x303540){if(_0x303540){var _0x5648b4=typeof _0xff861c[_0x6cf8('0x2c')]==='undefined'&&typeof _0xff861c['limit']==='undefined';var _0x17bca9=_0x303540[_0x6cf8('0x2d')];var _0x3701b0=_0x5648b4?0x0:_0xff861c[_0x6cf8('0x2c')];var _0x27ca78=_0x5648b4?_0x303540[_0x6cf8('0x2d')]:_0xff861c['offset']+_0xff861c[_0x6cf8('0x2e')];var _0x132c13;if(_0x27ca78>=_0x17bca9){_0x27ca78=_0x17bca9;_0x132c13=0xc8;}else{_0x132c13=0xce;}_0x259162[_0x6cf8('0x2a')](_0x132c13);return _0x259162['set'](_0x6cf8('0x2f'),_0x3701b0+'-'+_0x27ca78+'/'+_0x17bca9)['json'](_0x303540);}return null;};}function patchUpdates(_0x21922b){return function(_0x3dbcfa){try{jsonpatch[_0x6cf8('0x30')](_0x3dbcfa,_0x21922b,!![]);}catch(_0x2c20bf){return BPromise[_0x6cf8('0x31')](_0x2c20bf);}return _0x3dbcfa['save']();};}function saveUpdates(_0x2484c6,_0xf1373e){return function(_0x1edc5f){if(_0x1edc5f){return _0x1edc5f[_0x6cf8('0x32')](_0x2484c6)['then'](function(_0x56e549){return _0x56e549;});}return null;};}function removeEntity(_0xf22607,_0x117d49){return function(_0x5b356a){if(_0x5b356a){return _0x5b356a[_0x6cf8('0x33')]()[_0x6cf8('0x34')](function(){var _0x1de5fb=_0x5b356a[_0x6cf8('0x35')]({'plain':!![]});var _0x5bf9e7=_0x6cf8('0x36');return db[_0x6cf8('0x37')][_0x6cf8('0x33')]({'where':{'type':_0x5bf9e7,'resourceId':_0x1de5fb['id']}})['then'](function(){return _0x5b356a;});})[_0x6cf8('0x34')](function(){_0xf22607[_0x6cf8('0x2a')](0xcc)[_0x6cf8('0x2b')]();});}};}function handleEntityNotFound(_0x1d5f14,_0x3d49ca){return function(_0x46ca1c){if(!_0x46ca1c){_0x1d5f14[_0x6cf8('0x29')](0x194);}return _0x46ca1c;};}function handleError(_0x45429e,_0x545f71){_0x545f71=_0x545f71||0x1f4;return function(_0x47be5e){logger[_0x6cf8('0x24')](_0x47be5e['stack']);if(_0x47be5e[_0x6cf8('0x38')]){delete _0x47be5e[_0x6cf8('0x38')];}_0x45429e[_0x6cf8('0x2a')](_0x545f71)[_0x6cf8('0x39')](_0x47be5e);};}exports['index']=function(_0x285169,_0x544de0){var _0x3bd16d={'include':[{'model':db[_0x6cf8('0x3a')],'as':'mandatoryDispositionPause'}]},_0xed7542={},_0x53e1b5={'count':0x0,'rows':[]};var _0x217601=_[_0x6cf8('0x3b')](db['WhatsappAccount']['rawAttributes'],function(_0xf852a2){return{'name':_0xf852a2[_0x6cf8('0x3c')],'type':_0xf852a2[_0x6cf8('0x3d')][_0x6cf8('0x3e')]};});_0xed7542[_0x6cf8('0x3f')]=_[_0x6cf8('0x3b')](_0x217601,_0x6cf8('0x38'));_0xed7542[_0x6cf8('0x40')]=_[_0x6cf8('0x41')](_0x285169[_0x6cf8('0x40')]);_0xed7542['filters']=_[_0x6cf8('0x42')](_0xed7542['model'],_0xed7542['query']);_0x3bd16d[_0x6cf8('0x43')]=_[_0x6cf8('0x42')](_0xed7542['model'],qs[_0x6cf8('0x44')](_0x285169['query'][_0x6cf8('0x44')]));_0x3bd16d[_0x6cf8('0x43')]=_0x3bd16d['attributes']['length']?_0x3bd16d[_0x6cf8('0x43')]:_0xed7542[_0x6cf8('0x3f')];if(!_0x285169['query'][_0x6cf8('0x45')](_0x6cf8('0x46'))){_0x3bd16d[_0x6cf8('0x2e')]=qs[_0x6cf8('0x2e')](_0x285169[_0x6cf8('0x40')][_0x6cf8('0x2e')]);_0x3bd16d[_0x6cf8('0x2c')]=qs[_0x6cf8('0x2c')](_0x285169[_0x6cf8('0x40')][_0x6cf8('0x2c')]);}_0x3bd16d[_0x6cf8('0x47')]=qs[_0x6cf8('0x48')](_0x285169[_0x6cf8('0x40')]['sort']);_0x3bd16d[_0x6cf8('0x49')]=qs[_0x6cf8('0x4a')](_['pick'](_0x285169['query'],_0xed7542[_0x6cf8('0x4a')]),_0x217601);if(_0x285169[_0x6cf8('0x40')][_0x6cf8('0x4b')]){_0x3bd16d['where']=_[_0x6cf8('0x4c')](_0x3bd16d['where'],{'$or':_[_0x6cf8('0x3b')](_0x217601,function(_0x139c7d){if(_0x139c7d['type']!==_0x6cf8('0x4d')){var _0x24114d={};_0x24114d[_0x139c7d[_0x6cf8('0x38')]]={'$like':'%'+_0x285169['query'][_0x6cf8('0x4b')]+'%'};return _0x24114d;}})});}_0x3bd16d=_['merge']({},_0x3bd16d,_0x285169[_0x6cf8('0x4e')]);var _0x16aa16={'where':_0x3bd16d[_0x6cf8('0x49')]};return db[_0x6cf8('0x4f')]['count'](_0x16aa16)[_0x6cf8('0x34')](function(_0x233d7c){_0x53e1b5[_0x6cf8('0x2d')]=_0x233d7c;if(_0x285169[_0x6cf8('0x40')][_0x6cf8('0x50')]){_0x3bd16d[_0x6cf8('0x51')]=[{'all':!![]}];}return db[_0x6cf8('0x4f')][_0x6cf8('0x52')](_0x3bd16d);})[_0x6cf8('0x34')](function(_0x6a194b){_0x53e1b5[_0x6cf8('0x53')]=_0x6a194b;return _0x53e1b5;})['then'](respondWithFilteredResult(_0x544de0,_0x3bd16d))[_0x6cf8('0x54')](handleError(_0x544de0,null));};exports[_0x6cf8('0x55')]=function(_0x5ec4b2,_0x3e0e00){var _0x4777d0={'raw':![],'where':{'id':_0x5ec4b2[_0x6cf8('0x56')]['id']},'include':[{'model':db[_0x6cf8('0x3a')],'as':'mandatoryDispositionPause'}]},_0x4b5c99={};_0x4b5c99[_0x6cf8('0x3f')]=_[_0x6cf8('0x41')](db[_0x6cf8('0x4f')][_0x6cf8('0x57')]);_0x4b5c99[_0x6cf8('0x40')]=_[_0x6cf8('0x41')](_0x5ec4b2['query']);_0x4b5c99[_0x6cf8('0x4a')]=_['intersection'](_0x4b5c99[_0x6cf8('0x3f')],_0x4b5c99[_0x6cf8('0x40')]);_0x4777d0[_0x6cf8('0x43')]=_[_0x6cf8('0x42')](_0x4b5c99[_0x6cf8('0x3f')],qs[_0x6cf8('0x44')](_0x5ec4b2['query']['fields']));_0x4777d0['attributes']=_0x4777d0[_0x6cf8('0x43')][_0x6cf8('0x58')]?_0x4777d0[_0x6cf8('0x43')]:_0x4b5c99[_0x6cf8('0x3f')];if(_0x5ec4b2[_0x6cf8('0x40')][_0x6cf8('0x50')]){_0x4777d0[_0x6cf8('0x51')]=[{'all':!![]}];}_0x4777d0=_[_0x6cf8('0x4c')]({},_0x4777d0,_0x5ec4b2[_0x6cf8('0x4e')]);return db[_0x6cf8('0x4f')]['find'](_0x4777d0)[_0x6cf8('0x34')](handleEntityNotFound(_0x3e0e00,null))[_0x6cf8('0x34')](respondWithResult(_0x3e0e00,null))['catch'](handleError(_0x3e0e00,null));};exports[_0x6cf8('0x59')]=function(_0x2e2e7e,_0x129ff7){return db[_0x6cf8('0x4f')][_0x6cf8('0x59')](_0x2e2e7e[_0x6cf8('0x5a')],{})[_0x6cf8('0x34')](function(_0x55a85e){var _0x1c864c=_0x2e2e7e['user'][_0x6cf8('0x35')]({'plain':!![]});if(!_0x1c864c)throw new Error(_0x6cf8('0x5b'));if(_0x1c864c[_0x6cf8('0x5c')]===_0x6cf8('0x5d')){var _0x290cb4=_0x55a85e[_0x6cf8('0x35')]({'plain':!![]});var _0x21a93e='WhatsappAccounts';return db[_0x6cf8('0x5e')][_0x6cf8('0x5f')]({'where':{'name':_0x21a93e,'userProfileId':_0x1c864c['userProfileId']},'raw':!![]})[_0x6cf8('0x34')](function(_0x22d696){if(_0x22d696&&_0x22d696[_0x6cf8('0x60')]===0x0){return db[_0x6cf8('0x37')][_0x6cf8('0x59')]({'name':_0x290cb4[_0x6cf8('0x38')],'resourceId':_0x290cb4['id'],'type':_0x22d696[_0x6cf8('0x38')],'sectionId':_0x22d696['id']},{})[_0x6cf8('0x34')](function(){return _0x55a85e;});}else{return _0x55a85e;}})[_0x6cf8('0x54')](function(_0x4b396d){logger['error'](_0x6cf8('0x61'),_0x4b396d);throw _0x4b396d;});}return _0x55a85e;})['then'](respondWithResult(_0x129ff7,0xc9))[_0x6cf8('0x54')](handleError(_0x129ff7,null));};exports['update']=function(_0x561cf4,_0x12101b){if(_0x561cf4[_0x6cf8('0x5a')]['id']){delete _0x561cf4['body']['id'];}return db[_0x6cf8('0x4f')][_0x6cf8('0x5f')]({'where':{'id':_0x561cf4[_0x6cf8('0x56')]['id']},'include':[{'model':db[_0x6cf8('0x3a')],'as':_0x6cf8('0x62')}]})[_0x6cf8('0x34')](handleEntityNotFound(_0x12101b,null))['then'](saveUpdates(_0x561cf4[_0x6cf8('0x5a')],null))['then'](respondWithResult(_0x12101b,null))[_0x6cf8('0x54')](handleError(_0x12101b,null));};exports[_0x6cf8('0x33')]=function(_0x445710,_0x412bbe){return db[_0x6cf8('0x4f')][_0x6cf8('0x5f')]({'where':{'id':_0x445710[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0x412bbe,null))[_0x6cf8('0x34')](removeEntity(_0x412bbe,null))[_0x6cf8('0x54')](handleError(_0x412bbe,null));};exports[_0x6cf8('0x63')]=function(_0x2b0325,_0x7ab40a){return db['WhatsappAccount']['describe']()['then'](respondWithResult(_0x7ab40a,null))[_0x6cf8('0x54')](handleError(_0x7ab40a,null));};exports['addDisposition']=function(_0x3c2140,_0x563332,_0x49e577){if(_0x3c2140['body']['id']){delete _0x3c2140[_0x6cf8('0x5a')]['id'];}return db[_0x6cf8('0x4f')]['find']({'where':{'id':_0x3c2140[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0x563332,null))[_0x6cf8('0x34')](function(_0x28cc9a){if(_0x28cc9a){_0x3c2140[_0x6cf8('0x5a')]['WhatsappAccountId']=_0x28cc9a['id'];return db[_0x6cf8('0x64')][_0x6cf8('0x59')](_0x3c2140['body']);}})['then'](respondWithResult(_0x563332,null))[_0x6cf8('0x54')](handleError(_0x563332,null));};exports[_0x6cf8('0x65')]=function(_0x52fab9,_0x485871,_0x37f791){var _0x281b65={'raw':![],'where':{}};var _0x4b8f8d={};var _0x3649d2={'count':0x0,'rows':[]};return db[_0x6cf8('0x4f')]['findOne']({'where':{'id':_0x52fab9[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0x485871,null))['then'](function(_0x40dfe7){if(_0x40dfe7){_0x4b8f8d['model']=_[_0x6cf8('0x41')](db['Disposition'][_0x6cf8('0x57')]);_0x4b8f8d[_0x6cf8('0x40')]=_['keys'](_0x52fab9[_0x6cf8('0x40')]);_0x4b8f8d['filters']=_[_0x6cf8('0x42')](_0x4b8f8d['model'],_0x4b8f8d[_0x6cf8('0x40')]);_0x281b65[_0x6cf8('0x43')]=_[_0x6cf8('0x42')](_0x4b8f8d[_0x6cf8('0x3f')],qs['fields'](_0x52fab9[_0x6cf8('0x40')][_0x6cf8('0x44')]));_0x281b65['attributes']=_0x281b65[_0x6cf8('0x43')][_0x6cf8('0x58')]?_0x281b65[_0x6cf8('0x43')]:_0x4b8f8d['model'];if(!_0x52fab9[_0x6cf8('0x40')]['hasOwnProperty'](_0x6cf8('0x46'))){_0x281b65[_0x6cf8('0x2e')]=qs[_0x6cf8('0x2e')](_0x52fab9[_0x6cf8('0x40')][_0x6cf8('0x2e')]);_0x281b65[_0x6cf8('0x2c')]=qs[_0x6cf8('0x2c')](_0x52fab9['query'][_0x6cf8('0x2c')]);}_0x281b65[_0x6cf8('0x47')]=qs[_0x6cf8('0x48')](_0x52fab9[_0x6cf8('0x40')][_0x6cf8('0x48')]);_0x281b65[_0x6cf8('0x49')]=qs[_0x6cf8('0x4a')](_[_0x6cf8('0x66')](_0x52fab9[_0x6cf8('0x40')],_0x4b8f8d[_0x6cf8('0x4a')]));_0x281b65[_0x6cf8('0x49')][_0x6cf8('0x67')]=_0x40dfe7['id'];if(_0x52fab9[_0x6cf8('0x40')][_0x6cf8('0x4b')]){_0x281b65[_0x6cf8('0x49')]=_['merge'](_0x281b65[_0x6cf8('0x49')],{'$or':_[_0x6cf8('0x3b')](_0x281b65['attributes'],function(_0x47b11a){var _0x538e41={};_0x538e41[_0x47b11a]={'$like':'%'+_0x52fab9[_0x6cf8('0x40')]['filter']+'%'};return _0x538e41;})});}_0x281b65=_['merge']({},_0x281b65,_0x52fab9[_0x6cf8('0x4e')]);return db[_0x6cf8('0x64')][_0x6cf8('0x2d')]({'where':_0x281b65['where']})['then'](function(_0x4d2417){_0x3649d2[_0x6cf8('0x2d')]=_0x4d2417;if(_0x52fab9[_0x6cf8('0x40')]['includeAll']){_0x281b65['include']=[{'all':!![]}];}return db[_0x6cf8('0x64')][_0x6cf8('0x52')](_0x281b65);})[_0x6cf8('0x34')](function(_0x1ae3e5){_0x3649d2[_0x6cf8('0x53')]=_0x1ae3e5;return _0x3649d2;});}})[_0x6cf8('0x34')](respondWithFilteredResult(_0x485871,_0x281b65))[_0x6cf8('0x54')](handleError(_0x485871,null));};exports[_0x6cf8('0x68')]=function(_0x37d4fd,_0x3facd5,_0x353c45){return db['WhatsappAccount']['find']({'where':{'id':_0x37d4fd[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0x3facd5,null))[_0x6cf8('0x34')](function(_0x25cfc1){if(_0x25cfc1){return _0x25cfc1[_0x6cf8('0x68')](_0x37d4fd[_0x6cf8('0x40')][_0x6cf8('0x69')]);}})[_0x6cf8('0x34')](respondWithStatusCode(_0x3facd5,null))[_0x6cf8('0x54')](handleError(_0x3facd5,null));};exports[_0x6cf8('0x6a')]=function(_0x5b2aa4,_0x48d60e,_0x55957e){if(_0x5b2aa4['body']['id']){delete _0x5b2aa4[_0x6cf8('0x5a')]['id'];}return db[_0x6cf8('0x4f')]['find']({'where':{'id':_0x5b2aa4[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0x48d60e,null))['then'](function(_0x3c4d72){if(_0x3c4d72){_0x5b2aa4[_0x6cf8('0x5a')][_0x6cf8('0x67')]=_0x3c4d72['id'];return db['CannedAnswer']['create'](_0x5b2aa4[_0x6cf8('0x5a')]);}})[_0x6cf8('0x34')](respondWithResult(_0x48d60e,null))[_0x6cf8('0x54')](handleError(_0x48d60e,null));};exports[_0x6cf8('0x6b')]=function(_0x51787d,_0x5663d8,_0x370057){var _0x5d820b={'raw':![],'where':{}};var _0x2641c9={};var _0x3fc355={'count':0x0,'rows':[]};return db[_0x6cf8('0x4f')][_0x6cf8('0x6c')]({'where':{'id':_0x51787d[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0x5663d8,null))['then'](function(_0x294dbe){if(_0x294dbe){_0x2641c9['model']=_['keys'](db[_0x6cf8('0x6d')][_0x6cf8('0x57')]);_0x2641c9[_0x6cf8('0x40')]=_[_0x6cf8('0x41')](_0x51787d[_0x6cf8('0x40')]);_0x2641c9[_0x6cf8('0x4a')]=_['intersection'](_0x2641c9[_0x6cf8('0x3f')],_0x2641c9['query']);_0x5d820b[_0x6cf8('0x43')]=_['intersection'](_0x2641c9[_0x6cf8('0x3f')],qs['fields'](_0x51787d[_0x6cf8('0x40')][_0x6cf8('0x44')]));_0x5d820b[_0x6cf8('0x43')]=_0x5d820b[_0x6cf8('0x43')]['length']?_0x5d820b[_0x6cf8('0x43')]:_0x2641c9[_0x6cf8('0x3f')];if(!_0x51787d['query'][_0x6cf8('0x45')](_0x6cf8('0x46'))){_0x5d820b['limit']=qs['limit'](_0x51787d['query']['limit']);_0x5d820b[_0x6cf8('0x2c')]=qs[_0x6cf8('0x2c')](_0x51787d[_0x6cf8('0x40')][_0x6cf8('0x2c')]);}_0x5d820b[_0x6cf8('0x47')]=qs[_0x6cf8('0x48')](_0x51787d['query'][_0x6cf8('0x48')]);_0x5d820b[_0x6cf8('0x49')]=qs[_0x6cf8('0x4a')](_[_0x6cf8('0x66')](_0x51787d[_0x6cf8('0x40')],_0x2641c9['filters']));_0x5d820b[_0x6cf8('0x49')]['WhatsappAccountId']=_0x294dbe['id'];if(_0x51787d[_0x6cf8('0x40')][_0x6cf8('0x4b')]){_0x5d820b['where']=_[_0x6cf8('0x4c')](_0x5d820b[_0x6cf8('0x49')],{'$or':_['map'](_0x5d820b[_0x6cf8('0x43')],function(_0x1e22ca){var _0x389669={};_0x389669[_0x1e22ca]={'$like':'%'+_0x51787d[_0x6cf8('0x40')][_0x6cf8('0x4b')]+'%'};return _0x389669;})});}_0x5d820b=_[_0x6cf8('0x4c')]({},_0x5d820b,_0x51787d[_0x6cf8('0x4e')]);return db[_0x6cf8('0x6d')][_0x6cf8('0x2d')]({'where':_0x5d820b[_0x6cf8('0x49')]})[_0x6cf8('0x34')](function(_0x38f4da){_0x3fc355[_0x6cf8('0x2d')]=_0x38f4da;if(_0x51787d[_0x6cf8('0x40')][_0x6cf8('0x50')]){_0x5d820b['include']=[{'all':!![]}];}return db[_0x6cf8('0x6d')]['findAll'](_0x5d820b);})['then'](function(_0x64e2c2){_0x3fc355[_0x6cf8('0x53')]=_0x64e2c2;return _0x3fc355;});}})[_0x6cf8('0x34')](respondWithFilteredResult(_0x5663d8,_0x5d820b))[_0x6cf8('0x54')](handleError(_0x5663d8,null));};exports[_0x6cf8('0x6e')]=function(_0x506960,_0x3f55e0,_0x17e80c){return db[_0x6cf8('0x4f')][_0x6cf8('0x5f')]({'where':{'id':_0x506960['params']['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0x3f55e0,null))['then'](function(_0x13f689){if(_0x13f689){return _0x13f689[_0x6cf8('0x6e')](_0x506960['query'][_0x6cf8('0x69')]);}})[_0x6cf8('0x34')](respondWithStatusCode(_0x3f55e0,null))[_0x6cf8('0x54')](handleError(_0x3f55e0,null));};exports[_0x6cf8('0x6f')]=function(_0xccfee,_0x25622c,_0x3adc5f){return db['WhatsappAccount'][_0x6cf8('0x5f')]({'where':{'id':_0xccfee[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0x25622c,null))['then'](function(_0x22712e){if(_0x22712e){return _0x22712e[_0x6cf8('0x6f')](_0xccfee[_0x6cf8('0x5a')][_0x6cf8('0x69')],_[_0x6cf8('0x70')](_0xccfee['body'],[_0x6cf8('0x69'),'id'])||{})[_0x6cf8('0x71')](function(_0x4611f4){for(var _0x5767c1=0x0;_0x5767c1<_0xccfee['body'][_0x6cf8('0x69')][_0x6cf8('0x58')];_0x5767c1+=0x1){socket[_0x6cf8('0x72')]('userWhatsappAccount:save',{'UserId':Number(_0xccfee[_0x6cf8('0x5a')][_0x6cf8('0x69')][_0x5767c1]),'WhatsappAccountId':Number(_0xccfee['params']['id'])});}return _0x4611f4;});}})[_0x6cf8('0x34')](respondWithResult(_0x25622c,null))[_0x6cf8('0x54')](handleError(_0x25622c,null));};exports['removeAgents']=function(_0x3a068c,_0x3a00d8,_0x48f34e){return db[_0x6cf8('0x4f')][_0x6cf8('0x5f')]({'where':{'id':_0x3a068c[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0x3a00d8,null))[_0x6cf8('0x34')](function(_0x3a0b9c){if(_0x3a0b9c){return _0x3a0b9c[_0x6cf8('0x73')](_0x3a068c[_0x6cf8('0x40')][_0x6cf8('0x69')])[_0x6cf8('0x34')](function(){if(_[_0x6cf8('0x74')](_0x3a068c[_0x6cf8('0x40')]['ids'])){for(var _0x586014=0x0;_0x586014<_0x3a068c[_0x6cf8('0x40')][_0x6cf8('0x69')]['length'];_0x586014+=0x1){socket[_0x6cf8('0x72')](_0x6cf8('0x75'),{'UserId':Number(_0x3a068c[_0x6cf8('0x40')][_0x6cf8('0x69')][_0x586014]),'WhatsappAccountId':Number(_0x3a068c[_0x6cf8('0x56')]['id'])});}}else{socket['emit'](_0x6cf8('0x75'),{'UserId':Number(_0x3a068c[_0x6cf8('0x40')][_0x6cf8('0x69')]),'WhatsappAccountId':Number(_0x3a068c[_0x6cf8('0x56')]['id'])});}});}})[_0x6cf8('0x34')](respondWithStatusCode(_0x3a00d8,null))[_0x6cf8('0x54')](handleError(_0x3a00d8,null));};exports['getAgents']=function(_0x2105fe,_0xea2493,_0x431c3b){var _0x6b2b84={};var _0x5712bb={};var _0x2b1252;var _0x4a9e76;return db['WhatsappAccount'][_0x6cf8('0x6c')]({'where':{'id':_0x2105fe[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0xea2493,null))[_0x6cf8('0x34')](function(_0x2e524b){if(_0x2e524b){_0x2b1252=_0x2e524b;_0x5712bb['model']=_['keys'](db[_0x6cf8('0x76')][_0x6cf8('0x57')]);_0x5712bb[_0x6cf8('0x40')]=_[_0x6cf8('0x41')](_0x2105fe['query']);_0x5712bb[_0x6cf8('0x4a')]=_[_0x6cf8('0x42')](_0x5712bb[_0x6cf8('0x3f')],_0x5712bb[_0x6cf8('0x40')]);_0x6b2b84['attributes']=_[_0x6cf8('0x42')](_0x5712bb[_0x6cf8('0x3f')],qs[_0x6cf8('0x44')](_0x2105fe[_0x6cf8('0x40')][_0x6cf8('0x44')]));_0x6b2b84[_0x6cf8('0x43')]=_0x6b2b84[_0x6cf8('0x43')][_0x6cf8('0x58')]?_0x6b2b84[_0x6cf8('0x43')]:_0x5712bb['model'];_0x6b2b84[_0x6cf8('0x47')]=qs[_0x6cf8('0x48')](_0x2105fe[_0x6cf8('0x40')][_0x6cf8('0x48')]);_0x6b2b84[_0x6cf8('0x49')]=qs['filters'](_[_0x6cf8('0x66')](_0x2105fe['query'],_0x5712bb[_0x6cf8('0x4a')]));if(_0x2105fe[_0x6cf8('0x40')][_0x6cf8('0x4b')]){_0x6b2b84[_0x6cf8('0x49')]=_[_0x6cf8('0x4c')](_0x6b2b84[_0x6cf8('0x49')],{'$or':_[_0x6cf8('0x3b')](_0x6b2b84[_0x6cf8('0x43')],function(_0x2a19cf){var _0x48fb96={};_0x48fb96[_0x2a19cf]={'$like':'%'+_0x2105fe[_0x6cf8('0x40')][_0x6cf8('0x4b')]+'%'};return _0x48fb96;})});}_0x6b2b84=_['merge']({},_0x6b2b84,_0x2105fe[_0x6cf8('0x4e')]);return _0x2b1252['getAgents'](_0x6b2b84);}})['then'](function(_0x522299){if(_0x522299){_0x4a9e76=_0x522299[_0x6cf8('0x58')];if(!_0x2105fe[_0x6cf8('0x40')]['hasOwnProperty'](_0x6cf8('0x46'))){_0x6b2b84['limit']=qs[_0x6cf8('0x2e')](_0x2105fe['query']['limit']);_0x6b2b84[_0x6cf8('0x2c')]=qs[_0x6cf8('0x2c')](_0x2105fe[_0x6cf8('0x40')][_0x6cf8('0x2c')]);}return _0x2b1252['getAgents'](_0x6b2b84);}})[_0x6cf8('0x34')](function(_0x3a344f){if(_0x3a344f){return _0x3a344f?{'count':_0x4a9e76,'rows':_0x3a344f}:null;}})[_0x6cf8('0x34')](respondWithResult(_0xea2493,null))[_0x6cf8('0x54')](handleError(_0xea2493,null));};exports['addApplications']=function(_0x36ae9c,_0x4c4836,_0x3e1852){return db[_0x6cf8('0x4f')][_0x6cf8('0x6c')]({'where':{'id':_0x36ae9c[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0x4c4836,null))['then'](function(_0x198616){if(_0x198616){return db[_0x6cf8('0x77')][_0x6cf8('0x78')](function(_0x4bc32f){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x36ae9c[_0x6cf8('0x56')]['id']},'transaction':_0x4bc32f})['then'](function(_0x150ce2){var _0x5706be=_[_0x6cf8('0x3b')](_0x36ae9c[_0x6cf8('0x5a')],function(_0x578e19){_0x578e19[_0x6cf8('0x67')]=_0x36ae9c[_0x6cf8('0x56')]['id'];return _0x578e19;});return db[_0x6cf8('0x79')][_0x6cf8('0x7a')](_0x5706be,{'transaction':_0x4bc32f});});})[_0x6cf8('0x34')](function(){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x36ae9c[_0x6cf8('0x56')]['id']},'order':'priority'});});}})[_0x6cf8('0x34')](respondWithResult(_0x4c4836,null))['catch'](handleError(_0x4c4836,null));};exports[_0x6cf8('0x7b')]=function(_0x471c5d,_0xdfb722,_0x16c04f){var _0x57541b={};var _0x31e1e6={};var _0x179122;var _0x44f0f9;return db[_0x6cf8('0x4f')][_0x6cf8('0x6c')]({'where':{'id':_0x471c5d[_0x6cf8('0x56')]['id']}})[_0x6cf8('0x34')](handleEntityNotFound(_0xdfb722,null))[_0x6cf8('0x34')](function(_0x1d88b1){if(_0x1d88b1){_0x179122=_0x1d88b1;_0x31e1e6[_0x6cf8('0x3f')]=_['keys'](db['WhatsappApplication'][_0x6cf8('0x57')]);_0x31e1e6[_0x6cf8('0x40')]=_[_0x6cf8('0x41')](_0x471c5d['query']);_0x31e1e6['filters']=_[_0x6cf8('0x42')](_0x31e1e6[_0x6cf8('0x3f')],_0x31e1e6[_0x6cf8('0x40')]);_0x57541b[_0x6cf8('0x43')]=_[_0x6cf8('0x42')](_0x31e1e6[_0x6cf8('0x3f')],qs[_0x6cf8('0x44')](_0x471c5d[_0x6cf8('0x40')][_0x6cf8('0x44')]));_0x57541b['attributes']=_0x57541b[_0x6cf8('0x43')][_0x6cf8('0x58')]?_0x57541b[_0x6cf8('0x43')]:_0x31e1e6['model'];_0x57541b[_0x6cf8('0x47')]=qs['sort'](_0x471c5d[_0x6cf8('0x40')][_0x6cf8('0x48')]);_0x57541b[_0x6cf8('0x49')]=qs[_0x6cf8('0x4a')](_[_0x6cf8('0x66')](_0x471c5d[_0x6cf8('0x40')],_0x31e1e6[_0x6cf8('0x4a')]));if(_0x471c5d[_0x6cf8('0x40')][_0x6cf8('0x4b')]){_0x57541b[_0x6cf8('0x49')]=_['merge'](_0x57541b[_0x6cf8('0x49')],{'$or':_['map'](_0x57541b[_0x6cf8('0x43')],function(_0x25b0b5){var _0x122b5b={};_0x122b5b[_0x25b0b5]={'$like':'%'+_0x471c5d['query'][_0x6cf8('0x4b')]+'%'};return _0x122b5b;})});}_0x57541b=_[_0x6cf8('0x4c')]({},_0x57541b,_0x471c5d['options']);return _0x179122[_0x6cf8('0x7b')](_0x57541b);}})[_0x6cf8('0x34')](function(_0x1148af){if(_0x1148af){_0x44f0f9=_0x1148af[_0x6cf8('0x58')];if(!_0x471c5d[_0x6cf8('0x40')][_0x6cf8('0x45')](_0x6cf8('0x46'))){_0x57541b[_0x6cf8('0x2e')]=qs['limit'](_0x471c5d[_0x6cf8('0x40')][_0x6cf8('0x2e')]);_0x57541b[_0x6cf8('0x2c')]=qs[_0x6cf8('0x2c')](_0x471c5d[_0x6cf8('0x40')][_0x6cf8('0x2c')]);}return _0x179122[_0x6cf8('0x7b')](_0x57541b);}})[_0x6cf8('0x34')](function(_0x18ad1c){if(_0x18ad1c){return _0x18ad1c?{'count':_0x44f0f9,'rows':_0x18ad1c}:null;}})[_0x6cf8('0x34')](respondWithResult(_0xdfb722,null))['catch'](handleError(_0xdfb722,null));};exports[_0x6cf8('0x7c')]=function(_0x293fa0,_0x414485,_0x39cb3b){var _0x4f0897={'channel':_0x6cf8('0x7d')};var _0x38ee3a=[];var _0x2995dc=[];var _0x2d0740={};return db[_0x6cf8('0x4f')][_0x6cf8('0x5f')]({'where':{'id':_0x293fa0['params']['id']},'include':[{'model':db[_0x6cf8('0x79')],'as':_0x6cf8('0x7e')}]})[_0x6cf8('0x34')](handleEntityNotFound(_0x414485,null))[_0x6cf8('0x34')](function(_0x28fde0){_0x4f0897[_0x6cf8('0x7f')]=_0x28fde0;_0x4f0897[_0x6cf8('0x80')]=_['orderBy'](_0x28fde0[_0x6cf8('0x7e')],[_0x6cf8('0x81')],[_0x6cf8('0x82')]);if(_0x4f0897[_0x6cf8('0x7f')][_0x6cf8('0x7e')]){delete _0x4f0897[_0x6cf8('0x7f')]['Applications'];}return db['CmContact'][_0x6cf8('0x63')]();})['then'](function(_0x106986){if(!_0x106986){throw new db[(_0x6cf8('0x83'))][(_0x6cf8('0x84'))](_0x6cf8('0x85'));}_0x38ee3a=_[_0x6cf8('0x86')](_[_0x6cf8('0x41')](_0x106986),[_0x6cf8('0x87'),_0x6cf8('0x88')]);_0x2995dc=_[_0x6cf8('0x86')](_[_0x6cf8('0x41')](_0x106986),[_0x6cf8('0x87'),'updatedAt',_0x6cf8('0x89'),_0x6cf8('0x8a')]);_0x4f0897['body']={'mapKey':_0x6cf8('0x8b')};if(_0x4f0897['account'][_0x6cf8('0x3d')]&&_0x4f0897['account'][_0x6cf8('0x3d')]===_0x6cf8('0x8c')){_0x4f0897[_0x6cf8('0x5a')][_0x6cf8('0x8d')]=_0x293fa0[_0x6cf8('0x5a')][_0x6cf8('0x8e')]['replace'](_0x6cf8('0x8f'),'');_0x4f0897[_0x6cf8('0x5a')][_0x6cf8('0x5a')]=_0x293fa0[_0x6cf8('0x5a')]['Body'];_0x4f0897['body']['messageId']=_0x293fa0[_0x6cf8('0x5a')][_0x6cf8('0x90')];}if(_0x4f0897['body']['id']){delete _0x4f0897[_0x6cf8('0x5a')]['id'];}if(_[_0x6cf8('0x91')](_0x4f0897[_0x6cf8('0x5a')][_0x6cf8('0x8d')])){throw new db[(_0x6cf8('0x83'))][(_0x6cf8('0x84'))](_0x6cf8('0x92'));}if(_['isNil'](_0x4f0897['body'][_0x6cf8('0x5a')])||_0x4f0897[_0x6cf8('0x5a')][_0x6cf8('0x5a')]===''){throw new db['Sequelize']['ValidationError'](_0x6cf8('0x93'));}if(_[_0x6cf8('0x91')](_0x4f0897[_0x6cf8('0x5a')][_0x6cf8('0x94')])){throw new db['Sequelize'][(_0x6cf8('0x84'))](_0x6cf8('0x95')+_0x2995dc);}if(!_[_0x6cf8('0x96')](_0x2995dc,_0x4f0897[_0x6cf8('0x5a')]['mapKey'])){throw new db[(_0x6cf8('0x83'))]['ValidationError'](_0x6cf8('0x97')+_0x2995dc);}_0x2d0740[_0x4f0897['body']['mapKey']]=_0x4f0897[_0x6cf8('0x5a')][_0x6cf8('0x8d')];return db[_0x6cf8('0x98')][_0x6cf8('0x5f')]({'where':{'id':_0x4f0897['account'][_0x6cf8('0x8a')]},'include':[{'model':db[_0x6cf8('0x99')],'as':_0x6cf8('0x9a'),'where':_0x2d0740,'limit':0x1,'order':[[_0x6cf8('0x88'),_0x6cf8('0x9b')]]}]});})[_0x6cf8('0x34')](handleEntityNotFound(_0x414485,null))[_0x6cf8('0x34')](function(_0x45420e){if(_0x45420e){_0x4f0897[_0x6cf8('0x9c')]=_[_0x6cf8('0x70')](_0x45420e,[_0x6cf8('0x9a')]);if(_0x45420e[_0x6cf8('0x9a')][_0x6cf8('0x58')]){return _0x45420e[_0x6cf8('0x9a')][0x0];}var _0x491ffd=_[_0x6cf8('0x1b')](_0x4f0897[_0x6cf8('0x5a')],{'firstName':_0x4f0897[_0x6cf8('0x5a')]['from'],'ListId':_0x45420e['id']});_0x491ffd[_0x4f0897[_0x6cf8('0x5a')][_0x6cf8('0x94')]]=_0x4f0897[_0x6cf8('0x5a')][_0x6cf8('0x8d')];return db['CmContact'][_0x6cf8('0x59')](_0x491ffd,{'fields':_0x38ee3a,'raw':!![]});}})[_0x6cf8('0x34')](handleEntityNotFound(_0x414485,null))['then'](function(_0x977725){if(_0x977725){_0x4f0897[_0x6cf8('0x9d')]=_0x977725;var _0x19f03e={'ContactId':_0x977725['id'],'phone':_0x4f0897['body']['from'],'WhatsappAccountId':_0x293fa0[_0x6cf8('0x56')]['id']};var _0x39487c={'ContactId':_0x977725['id'],'WhatsappAccountId':_0x293fa0['params']['id'],'closed':![]};return db[_0x6cf8('0x9e')][_0x6cf8('0x5f')]({'where':_0x39487c})[_0x6cf8('0x34')](function(_0x57cf1f){if(_0x57cf1f){return[_0x57cf1f,![]];}return db[_0x6cf8('0x9e')]['create'](_0x19f03e)[_0x6cf8('0x34')](function(_0x15f86b){return[_0x15f86b,!![]];});});}})[_0x6cf8('0x71')](function(_0x685de9,_0x2be53e){_0x4f0897[_0x6cf8('0x9f')]=_0x685de9[_0x6cf8('0x35')]({'plain':!![]});_0x4f0897[_0x6cf8('0x9f')][_0x6cf8('0xa0')]=![];if(_0x2be53e){if(_0x4f0897[_0x6cf8('0x7f')][_0x6cf8('0xa1')]){_0x4f0897[_0x6cf8('0x80')][_0x6cf8('0xa2')]({'id':0x0,'priority':_0x4f0897[_0x6cf8('0x80')][_0x6cf8('0x58')]+0x1,'app':_0x6cf8('0xa3'),'appdata':'unmanaged','interval':_0x6cf8('0xa4')});}_0x4f0897[_0x6cf8('0x9f')][_0x6cf8('0xa0')]=!![];}return db['WhatsappMessage'][_0x6cf8('0x59')]({'phone':_0x4f0897['body'][_0x6cf8('0x8d')],'messageId':_0x4f0897['body'][_0x6cf8('0xa5')],'body':_0x4f0897[_0x6cf8('0x5a')]['body'],'WhatsappAccountId':_0x293fa0['params']['id'],'WhatsappInteractionId':_0x685de9['id'],'direction':'in','ContactId':_0x685de9[_0x6cf8('0xa6')],'AttachmentId':_0x4f0897[_0x6cf8('0x5a')][_0x6cf8('0xa7')]});})[_0x6cf8('0x34')](function(_0x3edef1){_0x4f0897[_0x6cf8('0x26')]=_0x3edef1;if(_0x4f0897[_0x6cf8('0x9f')]['UserId']){return db[_0x6cf8('0x76')]['find']({'attributes':['id','name'],'where':{'id':_0x4f0897[_0x6cf8('0x9f')][_0x6cf8('0xa8')]}})[_0x6cf8('0x34')](function(_0x3f7058){if(_0x3f7058){_0x4f0897[_0x6cf8('0x80')][_0x6cf8('0xa9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3f7058[_0x6cf8('0x38')]+','+(_0x4f0897['account']['waitForTheAssignedAgent']||0xa),'interval':_0x6cf8('0xa4')});}return respondWithRpcPromise(_0x6cf8('0xaa'),'startRouting',_0x4f0897);});}return respondWithRpcPromise(_0x6cf8('0xaa'),'startRouting',_0x4f0897);})[_0x6cf8('0x34')](function(_0x5a2cf9){if(_0x5a2cf9){var _0x3183ad=0xc8;var _0x51cc63=_0x6cf8('0xab');logger[_0x6cf8('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x51cc63,_0x3183ad,_0x6cf8('0xac'));logger[_0x6cf8('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x51cc63,_0x3183ad,_0x6cf8('0xac'),JSON[_0x6cf8('0xad')](_0x5a2cf9));if(_0x4f0897[_0x6cf8('0x7f')][_0x6cf8('0x3d')]==='twilio'){return _0x414485[_0x6cf8('0x2a')](_0x3183ad)[_0x6cf8('0xae')]('Content-Type','text/xml')['send']('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x414485[_0x6cf8('0x2a')](_0x3183ad)[_0x6cf8('0xaf')](_0x5a2cf9);}}})[_0x6cf8('0x54')](handleError(_0x414485,null));};exports['send']=function(_0x5e869b,_0x1d4f75,_0x2ac0b9){var _0x13af25,_0x1f3ef6,_0x34fd9e;if(_['isNil'](_0x5e869b[_0x6cf8('0x5a')]['body'])||_0x5e869b[_0x6cf8('0x5a')][_0x6cf8('0x5a')]===''){throw new db[(_0x6cf8('0x83'))]['ValidationError'](_0x6cf8('0x93'));}if(_[_0x6cf8('0x91')](_0x5e869b[_0x6cf8('0x5a')]['to'])){throw new db['Sequelize']['ValidationError'](_0x6cf8('0xb0'));}_0x13af25=_0x5e869b[_0x6cf8('0x5a')]['to'];return db[_0x6cf8('0x4f')][_0x6cf8('0x5f')]({'where':{'id':_0x5e869b[_0x6cf8('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x13af25},'limit':0x1,'order':[['updatedAt',_0x6cf8('0x9b')]]}]}]})[_0x6cf8('0x34')](handleEntityNotFound(_0x1d4f75,null))['then'](function(_0x74d556){if(_0x74d556&&_0x74d556[_0x6cf8('0xb1')]){_0x1f3ef6=_0x74d556['get']({'plain':!![]});if(_0x1f3ef6[_0x6cf8('0xb1')]&&_0x1f3ef6[_0x6cf8('0xb1')][_0x6cf8('0x9a')][_0x6cf8('0x58')]){return _0x1f3ef6[_0x6cf8('0xb1')]['Contacts'][0x0];}return db[_0x6cf8('0x99')][_0x6cf8('0x59')](_[_0x6cf8('0x1b')](_0x5e869b[_0x6cf8('0x5a')],{'firstName':_0x13af25,'mobile':_0x13af25,'phone':_0x13af25,'ListId':_0x1f3ef6[_0x6cf8('0x8a')]}));}})[_0x6cf8('0x34')](handleEntityNotFound(_0x1d4f75,null))[_0x6cf8('0x34')](function(_0x403d01){if(_0x403d01){_0x34fd9e=_0x403d01;return db[_0x6cf8('0x9e')][_0x6cf8('0x5f')]({'where':{'ContactId':_0x34fd9e['id'],'closed':![],'WhatsappAccountId':_0x1f3ef6['id']}})[_0x6cf8('0x34')](function(_0x982167){if(_0x982167){return[_0x982167,![]];}return db[_0x6cf8('0x9e')]['create']({'UserId':_0x5e869b[_0x6cf8('0x5d')]['id'],'ContactId':_0x34fd9e['id'],'WhatsappAccountId':_0x1f3ef6['id'],'phone':_0x13af25,'firstMsgDirection':_0x6cf8('0xb2'),'Messages':[_[_0x6cf8('0x4c')](_0x5e869b[_0x6cf8('0x5a')],{'read':![],'body':_0x5e869b[_0x6cf8('0x5a')][_0x6cf8('0x5a')],'phone':_0x13af25,'WhatsappAccountId':_0x1f3ef6['id'],'UserId':_0x5e869b[_0x6cf8('0x5d')]['id'],'ContactId':_0x34fd9e['id']})]},{'include':[{'model':db[_0x6cf8('0xb3')],'as':_0x6cf8('0xb4')}]})['then'](function(_0x6acf20){return[_0x6acf20,!![]];});});}})[_0x6cf8('0x71')](function(_0x5c1c3b,_0x23d3aa){if(_0x23d3aa){return _0x5c1c3b;}return db['WhatsappMessage'][_0x6cf8('0x59')](_['merge'](_0x5e869b[_0x6cf8('0x5a')],{'read':![],'body':_0x5e869b['body'][_0x6cf8('0x5a')],'phone':_0x13af25,'WhatsappAccountId':_0x1f3ef6['id'],'WhatsappInteractionId':_0x5c1c3b['id'],'UserId':_0x5e869b[_0x6cf8('0x5d')]['id'],'ContactId':_0x34fd9e['id']}))[_0x6cf8('0x34')](function(_0x10ba07){_0x5c1c3b['dataValues'][_0x6cf8('0xb4')]=[];_0x5c1c3b['dataValues']['Messages'][_0x6cf8('0xa2')](_0x10ba07[_0x6cf8('0xb5')]);return _0x5c1c3b;});})[_0x6cf8('0x34')](respondWithResult(_0x1d4f75,null))[_0x6cf8('0x54')](handleError(_0x1d4f75,null));};
\ No newline at end of file
+var _0x4cc4=['Disposition','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','omit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','emit','getAgents','addApplications','WhatsappApplication','bulkCreate','findAndCountAll','priority','whatsapp','Applications','account','applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','replace','Body','MessageSid','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','defaults','WhatsappInteraction','spread','interaction','created','autoclose','close','unmanaged','WhatsappMessage','messageId','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','out','dataValues','Messages','push','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','get','destroy','end','stack','name','send','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','show','params','length','create','user','role','WhatsappAccounts','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','WhatsappAccountId','findOne'];(function(_0x5ea442,_0x10108f){var _0x3bdff8=function(_0x2722c8){while(--_0x2722c8){_0x5ea442['push'](_0x5ea442['shift']());}};_0x3bdff8(++_0x10108f);}(_0x4cc4,0x1d0));var _0x44cc=function(_0x430ca5,_0x26ba00){_0x430ca5=_0x430ca5-0x0;var _0x4b6de=_0x4cc4[_0x430ca5];return _0x4b6de;};'use strict';var emlformat=require(_0x44cc('0x0'));var rimraf=require(_0x44cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44cc('0x2'));var moment=require(_0x44cc('0x3'));var BPromise=require(_0x44cc('0x4'));var Mustache=require(_0x44cc('0x5'));var util=require(_0x44cc('0x6'));var path=require(_0x44cc('0x7'));var sox=require(_0x44cc('0x8'));var csv=require(_0x44cc('0x9'));var ejs=require(_0x44cc('0xa'));var fs=require('fs');var fs_extra=require(_0x44cc('0xb'));var _=require(_0x44cc('0xc'));var squel=require('squel');var crypto=require(_0x44cc('0xd'));var jsforce=require(_0x44cc('0xe'));var deskjs=require(_0x44cc('0xf'));var toCsv=require(_0x44cc('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x44cc('0x10'));var authService=require(_0x44cc('0x11'));var qs=require(_0x44cc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44cc('0x13'));var logger=require(_0x44cc('0x14'))(_0x44cc('0x15'));var utils=require(_0x44cc('0x16'));var config=require(_0x44cc('0x17'));var licenseUtil=require(_0x44cc('0x18'));var db=require(_0x44cc('0x19'))['db'];config[_0x44cc('0x1a')]=_['defaults'](config[_0x44cc('0x1a')],{'host':_0x44cc('0x1b'),'port':0x18eb});var socket=require(_0x44cc('0x1c'))(new Redis(config[_0x44cc('0x1a')]));require(_0x44cc('0x1d'))[_0x44cc('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x44cc('0x1f')][_0x44cc('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x2932d3,_0x51e82c,_0x11cb24,_0x2e1c66){return new BPromise(function(_0x40cf8a,_0x23e388){var _0x16e09c=_0x2e1c66||client;return _0x16e09c[_0x44cc('0x21')](_0x2932d3,_0x11cb24)['then'](function(_0x575346){logger[_0x44cc('0x22')](_0x44cc('0x23'),_0x51e82c,_0x44cc('0x24'));logger['debug'](_0x44cc('0x25'),_0x51e82c,_0x44cc('0x24'),JSON['stringify'](_0x575346));if(_0x575346[_0x44cc('0x26')]){if(_0x575346['error'][_0x44cc('0x27')]===0x1f4){logger['error'](_0x44cc('0x23'),_0x51e82c,_0x575346[_0x44cc('0x26')][_0x44cc('0x28')]);return _0x23e388(_0x575346['error'][_0x44cc('0x28')]);}logger[_0x44cc('0x26')](_0x44cc('0x23'),_0x51e82c,_0x575346['error'][_0x44cc('0x28')]);return _0x40cf8a(_0x575346['error'][_0x44cc('0x28')]);}else{logger['info'](_0x44cc('0x23'),_0x51e82c,'request\x20sent');_0x40cf8a(_0x575346[_0x44cc('0x29')][_0x44cc('0x28')]);}})[_0x44cc('0x2a')](function(_0x1d9176){logger[_0x44cc('0x26')](_0x44cc('0x23'),_0x51e82c,_0x1d9176);_0x23e388(_0x1d9176);});});}function respondWithStatusCode(_0x3cc8f6,_0x404f4d){_0x404f4d=_0x404f4d||0xcc;return function(_0xff2d5e){if(_0xff2d5e){return _0x3cc8f6[_0x44cc('0x2b')](_0x404f4d);}return _0x3cc8f6[_0x44cc('0x2c')](_0x404f4d)['end']();};}function respondWithResult(_0x2caaba,_0x5f4311){_0x5f4311=_0x5f4311||0xc8;return function(_0x227a93){if(_0x227a93){return _0x2caaba[_0x44cc('0x2c')](_0x5f4311)['json'](_0x227a93);}};}function respondWithFilteredResult(_0x5041b7,_0x1053e7){return function(_0x3f9d56){if(_0x3f9d56){var _0xd4d3e2=typeof _0x1053e7['offset']===_0x44cc('0x2d')&&typeof _0x1053e7[_0x44cc('0x2e')]===_0x44cc('0x2d');var _0x2e45c4=_0x3f9d56[_0x44cc('0x2f')];var _0x362ab1=_0xd4d3e2?0x0:_0x1053e7['offset'];var _0x1a35da=_0xd4d3e2?_0x3f9d56[_0x44cc('0x2f')]:_0x1053e7[_0x44cc('0x30')]+_0x1053e7[_0x44cc('0x2e')];var _0x45fdc3;if(_0x1a35da>=_0x2e45c4){_0x1a35da=_0x2e45c4;_0x45fdc3=0xc8;}else{_0x45fdc3=0xce;}_0x5041b7['status'](_0x45fdc3);return _0x5041b7[_0x44cc('0x31')](_0x44cc('0x32'),_0x362ab1+'-'+_0x1a35da+'/'+_0x2e45c4)[_0x44cc('0x33')](_0x3f9d56);}return null;};}function patchUpdates(_0x4a4c6a){return function(_0x1d459e){try{jsonpatch['apply'](_0x1d459e,_0x4a4c6a,!![]);}catch(_0x338a1a){return BPromise[_0x44cc('0x34')](_0x338a1a);}return _0x1d459e[_0x44cc('0x35')]();};}function saveUpdates(_0x3084b0,_0x350057){return function(_0x4d196b){if(_0x4d196b){return _0x4d196b[_0x44cc('0x36')](_0x3084b0)[_0x44cc('0x37')](function(_0x22ff66){return _0x22ff66;});}return null;};}function removeEntity(_0xae6de5,_0xc79919){return function(_0x2007bb){if(_0x2007bb){return _0x2007bb['destroy']()[_0x44cc('0x37')](function(){var _0x51926e=_0x2007bb[_0x44cc('0x38')]({'plain':!![]});var _0x3c5496='WhatsappAccounts';return db['UserProfileResource'][_0x44cc('0x39')]({'where':{'type':_0x3c5496,'resourceId':_0x51926e['id']}})[_0x44cc('0x37')](function(){return _0x2007bb;});})['then'](function(){_0xae6de5['status'](0xcc)[_0x44cc('0x3a')]();});}};}function handleEntityNotFound(_0x317d76,_0x4841ce){return function(_0x26a04b){if(!_0x26a04b){_0x317d76[_0x44cc('0x2b')](0x194);}return _0x26a04b;};}function handleError(_0x4bda34,_0x534a00){_0x534a00=_0x534a00||0x1f4;return function(_0x4ed7ca){logger['error'](_0x4ed7ca[_0x44cc('0x3b')]);if(_0x4ed7ca[_0x44cc('0x3c')]){delete _0x4ed7ca[_0x44cc('0x3c')];}_0x4bda34[_0x44cc('0x2c')](_0x534a00)[_0x44cc('0x3d')](_0x4ed7ca);};}exports['index']=function(_0x4a742f,_0x2a78c7){var _0x45bff3={'include':[{'model':db[_0x44cc('0x3e')],'as':_0x44cc('0x3f')}]},_0x3c56ef={},_0x50dc6c={'count':0x0,'rows':[]};var _0x5af443=_['map'](db[_0x44cc('0x40')][_0x44cc('0x41')],function(_0x539b28){return{'name':_0x539b28[_0x44cc('0x42')],'type':_0x539b28['type'][_0x44cc('0x43')]};});_0x3c56ef[_0x44cc('0x44')]=_['map'](_0x5af443,_0x44cc('0x3c'));_0x3c56ef[_0x44cc('0x45')]=_[_0x44cc('0x46')](_0x4a742f[_0x44cc('0x45')]);_0x3c56ef[_0x44cc('0x47')]=_['intersection'](_0x3c56ef['model'],_0x3c56ef[_0x44cc('0x45')]);_0x45bff3[_0x44cc('0x48')]=_[_0x44cc('0x49')](_0x3c56ef['model'],qs['fields'](_0x4a742f[_0x44cc('0x45')][_0x44cc('0x4a')]));_0x45bff3[_0x44cc('0x48')]=_0x45bff3[_0x44cc('0x48')]['length']?_0x45bff3[_0x44cc('0x48')]:_0x3c56ef[_0x44cc('0x44')];if(!_0x4a742f[_0x44cc('0x45')][_0x44cc('0x4b')]('nolimit')){_0x45bff3[_0x44cc('0x2e')]=qs['limit'](_0x4a742f[_0x44cc('0x45')][_0x44cc('0x2e')]);_0x45bff3[_0x44cc('0x30')]=qs['offset'](_0x4a742f[_0x44cc('0x45')][_0x44cc('0x30')]);}_0x45bff3[_0x44cc('0x4c')]=qs[_0x44cc('0x4d')](_0x4a742f[_0x44cc('0x45')][_0x44cc('0x4d')]);_0x45bff3[_0x44cc('0x4e')]=qs[_0x44cc('0x47')](_[_0x44cc('0x4f')](_0x4a742f['query'],_0x3c56ef[_0x44cc('0x47')]),_0x5af443);if(_0x4a742f['query'][_0x44cc('0x50')]){_0x45bff3[_0x44cc('0x4e')]=_[_0x44cc('0x51')](_0x45bff3['where'],{'$or':_[_0x44cc('0x52')](_0x5af443,function(_0x483241){if(_0x483241[_0x44cc('0x53')]!==_0x44cc('0x54')){var _0xd4d8c8={};_0xd4d8c8[_0x483241['name']]={'$like':'%'+_0x4a742f[_0x44cc('0x45')][_0x44cc('0x50')]+'%'};return _0xd4d8c8;}})});}_0x45bff3=_[_0x44cc('0x51')]({},_0x45bff3,_0x4a742f[_0x44cc('0x55')]);var _0x13585={'where':_0x45bff3[_0x44cc('0x4e')]};return db['WhatsappAccount'][_0x44cc('0x2f')](_0x13585)['then'](function(_0x4340e0){_0x50dc6c['count']=_0x4340e0;if(_0x4a742f[_0x44cc('0x45')][_0x44cc('0x56')]){_0x45bff3[_0x44cc('0x57')]=[{'all':!![]}];}return db[_0x44cc('0x40')]['findAll'](_0x45bff3);})[_0x44cc('0x37')](function(_0x4d89d9){_0x50dc6c['rows']=_0x4d89d9;return _0x50dc6c;})[_0x44cc('0x37')](respondWithFilteredResult(_0x2a78c7,_0x45bff3))[_0x44cc('0x2a')](handleError(_0x2a78c7,null));};exports[_0x44cc('0x58')]=function(_0xf71c3b,_0x250c15){var _0x27fb64={'raw':![],'where':{'id':_0xf71c3b[_0x44cc('0x59')]['id']},'include':[{'model':db[_0x44cc('0x3e')],'as':_0x44cc('0x3f')}]},_0x4c6fa1={};_0x4c6fa1[_0x44cc('0x44')]=_[_0x44cc('0x46')](db['WhatsappAccount'][_0x44cc('0x41')]);_0x4c6fa1[_0x44cc('0x45')]=_[_0x44cc('0x46')](_0xf71c3b[_0x44cc('0x45')]);_0x4c6fa1[_0x44cc('0x47')]=_['intersection'](_0x4c6fa1[_0x44cc('0x44')],_0x4c6fa1[_0x44cc('0x45')]);_0x27fb64['attributes']=_[_0x44cc('0x49')](_0x4c6fa1['model'],qs[_0x44cc('0x4a')](_0xf71c3b[_0x44cc('0x45')][_0x44cc('0x4a')]));_0x27fb64[_0x44cc('0x48')]=_0x27fb64['attributes'][_0x44cc('0x5a')]?_0x27fb64['attributes']:_0x4c6fa1[_0x44cc('0x44')];if(_0xf71c3b[_0x44cc('0x45')][_0x44cc('0x56')]){_0x27fb64['include']=[{'all':!![]}];}_0x27fb64=_[_0x44cc('0x51')]({},_0x27fb64,_0xf71c3b[_0x44cc('0x55')]);return db[_0x44cc('0x40')]['find'](_0x27fb64)[_0x44cc('0x37')](handleEntityNotFound(_0x250c15,null))[_0x44cc('0x37')](respondWithResult(_0x250c15,null))[_0x44cc('0x2a')](handleError(_0x250c15,null));};exports[_0x44cc('0x5b')]=function(_0x3d3705,_0x44d731){return db['WhatsappAccount'][_0x44cc('0x5b')](_0x3d3705['body'],{})[_0x44cc('0x37')](function(_0x1a480c){var _0x15c3ba=_0x3d3705[_0x44cc('0x5c')][_0x44cc('0x38')]({'plain':!![]});if(!_0x15c3ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c3ba[_0x44cc('0x5d')]===_0x44cc('0x5c')){var _0x37f90e=_0x1a480c[_0x44cc('0x38')]({'plain':!![]});var _0x48d268=_0x44cc('0x5e');return db[_0x44cc('0x5f')][_0x44cc('0x60')]({'where':{'name':_0x48d268,'userProfileId':_0x15c3ba[_0x44cc('0x61')]},'raw':!![]})['then'](function(_0x15fd33){if(_0x15fd33&&_0x15fd33['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x37f90e[_0x44cc('0x3c')],'resourceId':_0x37f90e['id'],'type':_0x15fd33[_0x44cc('0x3c')],'sectionId':_0x15fd33['id']},{})[_0x44cc('0x37')](function(){return _0x1a480c;});}else{return _0x1a480c;}})['catch'](function(_0x23c5ab){logger[_0x44cc('0x26')](_0x44cc('0x62'),_0x23c5ab);throw _0x23c5ab;});}return _0x1a480c;})[_0x44cc('0x37')](respondWithResult(_0x44d731,0xc9))['catch'](handleError(_0x44d731,null));};exports[_0x44cc('0x36')]=function(_0x69f0cc,_0x4daea8){if(_0x69f0cc['body']['id']){delete _0x69f0cc[_0x44cc('0x63')]['id'];}return db[_0x44cc('0x40')][_0x44cc('0x60')]({'where':{'id':_0x69f0cc['params']['id']},'include':[{'model':db[_0x44cc('0x3e')],'as':_0x44cc('0x3f')}]})['then'](handleEntityNotFound(_0x4daea8,null))[_0x44cc('0x37')](saveUpdates(_0x69f0cc[_0x44cc('0x63')],null))['then'](respondWithResult(_0x4daea8,null))[_0x44cc('0x2a')](handleError(_0x4daea8,null));};exports[_0x44cc('0x39')]=function(_0x5e879a,_0x4efc2){return db[_0x44cc('0x40')][_0x44cc('0x60')]({'where':{'id':_0x5e879a[_0x44cc('0x59')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x4efc2,null))[_0x44cc('0x37')](removeEntity(_0x4efc2,null))[_0x44cc('0x2a')](handleError(_0x4efc2,null));};exports[_0x44cc('0x64')]=function(_0x5bcd01,_0x1f880e){return db[_0x44cc('0x40')][_0x44cc('0x64')]()[_0x44cc('0x37')](respondWithResult(_0x1f880e,null))[_0x44cc('0x2a')](handleError(_0x1f880e,null));};exports['addDisposition']=function(_0xa1e085,_0x53c064,_0x3a2040){if(_0xa1e085[_0x44cc('0x63')]['id']){delete _0xa1e085[_0x44cc('0x63')]['id'];}return db[_0x44cc('0x40')]['find']({'where':{'id':_0xa1e085[_0x44cc('0x59')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x53c064,null))['then'](function(_0x9acc98){if(_0x9acc98){_0xa1e085[_0x44cc('0x63')][_0x44cc('0x65')]=_0x9acc98['id'];return db['Disposition'][_0x44cc('0x5b')](_0xa1e085[_0x44cc('0x63')]);}})[_0x44cc('0x37')](respondWithResult(_0x53c064,null))[_0x44cc('0x2a')](handleError(_0x53c064,null));};exports['getDispositions']=function(_0x34295f,_0x51206f,_0x1d8bd5){var _0x3b9f66={'raw':![],'where':{}};var _0x142590={};var _0x42ee47={'count':0x0,'rows':[]};return db[_0x44cc('0x40')][_0x44cc('0x66')]({'where':{'id':_0x34295f[_0x44cc('0x59')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x51206f,null))['then'](function(_0x16eabb){if(_0x16eabb){_0x142590['model']=_[_0x44cc('0x46')](db[_0x44cc('0x67')][_0x44cc('0x41')]);_0x142590[_0x44cc('0x45')]=_['keys'](_0x34295f[_0x44cc('0x45')]);_0x142590[_0x44cc('0x47')]=_[_0x44cc('0x49')](_0x142590[_0x44cc('0x44')],_0x142590[_0x44cc('0x45')]);_0x3b9f66[_0x44cc('0x48')]=_['intersection'](_0x142590[_0x44cc('0x44')],qs[_0x44cc('0x4a')](_0x34295f['query']['fields']));_0x3b9f66[_0x44cc('0x48')]=_0x3b9f66[_0x44cc('0x48')][_0x44cc('0x5a')]?_0x3b9f66[_0x44cc('0x48')]:_0x142590[_0x44cc('0x44')];if(!_0x34295f[_0x44cc('0x45')][_0x44cc('0x4b')]('nolimit')){_0x3b9f66[_0x44cc('0x2e')]=qs[_0x44cc('0x2e')](_0x34295f[_0x44cc('0x45')][_0x44cc('0x2e')]);_0x3b9f66['offset']=qs['offset'](_0x34295f[_0x44cc('0x45')][_0x44cc('0x30')]);}_0x3b9f66[_0x44cc('0x4c')]=qs[_0x44cc('0x4d')](_0x34295f[_0x44cc('0x45')][_0x44cc('0x4d')]);_0x3b9f66[_0x44cc('0x4e')]=qs['filters'](_[_0x44cc('0x4f')](_0x34295f[_0x44cc('0x45')],_0x142590['filters']));_0x3b9f66['where'][_0x44cc('0x65')]=_0x16eabb['id'];if(_0x34295f[_0x44cc('0x45')][_0x44cc('0x50')]){_0x3b9f66[_0x44cc('0x4e')]=_['merge'](_0x3b9f66[_0x44cc('0x4e')],{'$or':_[_0x44cc('0x52')](_0x3b9f66['attributes'],function(_0x587870){var _0x1dcf0f={};_0x1dcf0f[_0x587870]={'$like':'%'+_0x34295f['query'][_0x44cc('0x50')]+'%'};return _0x1dcf0f;})});}_0x3b9f66=_[_0x44cc('0x51')]({},_0x3b9f66,_0x34295f[_0x44cc('0x55')]);return db['Disposition']['count']({'where':_0x3b9f66[_0x44cc('0x4e')]})[_0x44cc('0x37')](function(_0x3ff159){_0x42ee47['count']=_0x3ff159;if(_0x34295f[_0x44cc('0x45')][_0x44cc('0x56')]){_0x3b9f66[_0x44cc('0x57')]=[{'all':!![]}];}return db[_0x44cc('0x67')][_0x44cc('0x68')](_0x3b9f66);})[_0x44cc('0x37')](function(_0x3eab21){_0x42ee47[_0x44cc('0x69')]=_0x3eab21;return _0x42ee47;});}})[_0x44cc('0x37')](respondWithFilteredResult(_0x51206f,_0x3b9f66))[_0x44cc('0x2a')](handleError(_0x51206f,null));};exports[_0x44cc('0x6a')]=function(_0x4320a6,_0x28ddf9,_0x5aaa88){return db[_0x44cc('0x40')][_0x44cc('0x60')]({'where':{'id':_0x4320a6[_0x44cc('0x59')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x28ddf9,null))[_0x44cc('0x37')](function(_0x342190){if(_0x342190){return _0x342190[_0x44cc('0x6a')](_0x4320a6['query'][_0x44cc('0x6b')]);}})['then'](respondWithStatusCode(_0x28ddf9,null))[_0x44cc('0x2a')](handleError(_0x28ddf9,null));};exports[_0x44cc('0x6c')]=function(_0xd02ead,_0x2ce902,_0x45209f){if(_0xd02ead[_0x44cc('0x63')]['id']){delete _0xd02ead[_0x44cc('0x63')]['id'];}return db['WhatsappAccount'][_0x44cc('0x60')]({'where':{'id':_0xd02ead['params']['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x2ce902,null))['then'](function(_0x16a858){if(_0x16a858){_0xd02ead['body'][_0x44cc('0x65')]=_0x16a858['id'];return db[_0x44cc('0x6d')][_0x44cc('0x5b')](_0xd02ead[_0x44cc('0x63')]);}})[_0x44cc('0x37')](respondWithResult(_0x2ce902,null))[_0x44cc('0x2a')](handleError(_0x2ce902,null));};exports[_0x44cc('0x6e')]=function(_0x5b945c,_0x477584,_0x64118b){var _0x1de04f={'raw':![],'where':{}};var _0xfd92c5={};var _0x182a04={'count':0x0,'rows':[]};return db[_0x44cc('0x40')][_0x44cc('0x66')]({'where':{'id':_0x5b945c[_0x44cc('0x59')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x477584,null))[_0x44cc('0x37')](function(_0x4f26f4){if(_0x4f26f4){_0xfd92c5[_0x44cc('0x44')]=_['keys'](db[_0x44cc('0x6d')][_0x44cc('0x41')]);_0xfd92c5['query']=_[_0x44cc('0x46')](_0x5b945c[_0x44cc('0x45')]);_0xfd92c5[_0x44cc('0x47')]=_[_0x44cc('0x49')](_0xfd92c5[_0x44cc('0x44')],_0xfd92c5['query']);_0x1de04f[_0x44cc('0x48')]=_['intersection'](_0xfd92c5[_0x44cc('0x44')],qs['fields'](_0x5b945c[_0x44cc('0x45')][_0x44cc('0x4a')]));_0x1de04f[_0x44cc('0x48')]=_0x1de04f[_0x44cc('0x48')][_0x44cc('0x5a')]?_0x1de04f['attributes']:_0xfd92c5[_0x44cc('0x44')];if(!_0x5b945c[_0x44cc('0x45')][_0x44cc('0x4b')](_0x44cc('0x6f'))){_0x1de04f['limit']=qs[_0x44cc('0x2e')](_0x5b945c[_0x44cc('0x45')][_0x44cc('0x2e')]);_0x1de04f[_0x44cc('0x30')]=qs[_0x44cc('0x30')](_0x5b945c[_0x44cc('0x45')]['offset']);}_0x1de04f[_0x44cc('0x4c')]=qs[_0x44cc('0x4d')](_0x5b945c['query'][_0x44cc('0x4d')]);_0x1de04f[_0x44cc('0x4e')]=qs[_0x44cc('0x47')](_['pick'](_0x5b945c[_0x44cc('0x45')],_0xfd92c5[_0x44cc('0x47')]));_0x1de04f['where'][_0x44cc('0x65')]=_0x4f26f4['id'];if(_0x5b945c[_0x44cc('0x45')][_0x44cc('0x50')]){_0x1de04f[_0x44cc('0x4e')]=_['merge'](_0x1de04f[_0x44cc('0x4e')],{'$or':_[_0x44cc('0x52')](_0x1de04f[_0x44cc('0x48')],function(_0x2f5d5b){var _0x303c9a={};_0x303c9a[_0x2f5d5b]={'$like':'%'+_0x5b945c[_0x44cc('0x45')]['filter']+'%'};return _0x303c9a;})});}_0x1de04f=_['merge']({},_0x1de04f,_0x5b945c['options']);return db[_0x44cc('0x6d')][_0x44cc('0x2f')]({'where':_0x1de04f['where']})[_0x44cc('0x37')](function(_0x5d9bb8){_0x182a04['count']=_0x5d9bb8;if(_0x5b945c[_0x44cc('0x45')]['includeAll']){_0x1de04f['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x44cc('0x68')](_0x1de04f);})[_0x44cc('0x37')](function(_0x34d079){_0x182a04['rows']=_0x34d079;return _0x182a04;});}})[_0x44cc('0x37')](respondWithFilteredResult(_0x477584,_0x1de04f))[_0x44cc('0x2a')](handleError(_0x477584,null));};exports[_0x44cc('0x70')]=function(_0x31f6e6,_0x33c1cb,_0x2c8ae1){return db[_0x44cc('0x40')][_0x44cc('0x60')]({'where':{'id':_0x31f6e6[_0x44cc('0x59')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x33c1cb,null))[_0x44cc('0x37')](function(_0x1f8dbc){if(_0x1f8dbc){return _0x1f8dbc[_0x44cc('0x70')](_0x31f6e6[_0x44cc('0x45')]['ids']);}})[_0x44cc('0x37')](respondWithStatusCode(_0x33c1cb,null))['catch'](handleError(_0x33c1cb,null));};exports['addAgents']=function(_0x1e1130,_0xaa0e3e,_0x4ad2b8){return db[_0x44cc('0x40')]['find']({'where':{'id':_0x1e1130[_0x44cc('0x59')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0xaa0e3e,null))['then'](function(_0x21f105){if(_0x21f105){return _0x21f105['addAgents'](_0x1e1130[_0x44cc('0x63')]['ids'],_[_0x44cc('0x71')](_0x1e1130[_0x44cc('0x63')],['ids','id'])||{})['spread'](function(_0x5e2bb0){for(var _0x295dc2=0x0;_0x295dc2<_0x1e1130[_0x44cc('0x63')]['ids'][_0x44cc('0x5a')];_0x295dc2+=0x1){socket['emit'](_0x44cc('0x72'),{'UserId':Number(_0x1e1130[_0x44cc('0x63')][_0x44cc('0x6b')][_0x295dc2]),'WhatsappAccountId':Number(_0x1e1130[_0x44cc('0x59')]['id'])});}return _0x5e2bb0;});}})[_0x44cc('0x37')](respondWithResult(_0xaa0e3e,null))[_0x44cc('0x2a')](handleError(_0xaa0e3e,null));};exports[_0x44cc('0x73')]=function(_0x495adf,_0x43110d,_0x160c55){return db[_0x44cc('0x40')]['find']({'where':{'id':_0x495adf['params']['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x43110d,null))[_0x44cc('0x37')](function(_0x1b250f){if(_0x1b250f){return _0x1b250f[_0x44cc('0x73')](_0x495adf[_0x44cc('0x45')]['ids'])[_0x44cc('0x37')](function(){if(_[_0x44cc('0x74')](_0x495adf[_0x44cc('0x45')]['ids'])){for(var _0x2c52d8=0x0;_0x2c52d8<_0x495adf[_0x44cc('0x45')][_0x44cc('0x6b')][_0x44cc('0x5a')];_0x2c52d8+=0x1){socket['emit'](_0x44cc('0x75'),{'UserId':Number(_0x495adf[_0x44cc('0x45')]['ids'][_0x2c52d8]),'WhatsappAccountId':Number(_0x495adf[_0x44cc('0x59')]['id'])});}}else{socket[_0x44cc('0x76')](_0x44cc('0x75'),{'UserId':Number(_0x495adf[_0x44cc('0x45')][_0x44cc('0x6b')]),'WhatsappAccountId':Number(_0x495adf[_0x44cc('0x59')]['id'])});}});}})[_0x44cc('0x37')](respondWithStatusCode(_0x43110d,null))['catch'](handleError(_0x43110d,null));};exports[_0x44cc('0x77')]=function(_0x529eca,_0x1b58f8,_0x84f7d4){var _0x43e799={};var _0x6f717f={};var _0x106a39;var _0x5d3ddc;return db['WhatsappAccount'][_0x44cc('0x66')]({'where':{'id':_0x529eca['params']['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x1b58f8,null))[_0x44cc('0x37')](function(_0x32db09){if(_0x32db09){_0x106a39=_0x32db09;_0x6f717f['model']=_[_0x44cc('0x46')](db['User'][_0x44cc('0x41')]);_0x6f717f[_0x44cc('0x45')]=_[_0x44cc('0x46')](_0x529eca[_0x44cc('0x45')]);_0x6f717f[_0x44cc('0x47')]=_[_0x44cc('0x49')](_0x6f717f[_0x44cc('0x44')],_0x6f717f[_0x44cc('0x45')]);_0x43e799[_0x44cc('0x48')]=_[_0x44cc('0x49')](_0x6f717f[_0x44cc('0x44')],qs['fields'](_0x529eca[_0x44cc('0x45')][_0x44cc('0x4a')]));_0x43e799['attributes']=_0x43e799['attributes']['length']?_0x43e799[_0x44cc('0x48')]:_0x6f717f[_0x44cc('0x44')];_0x43e799[_0x44cc('0x4c')]=qs[_0x44cc('0x4d')](_0x529eca[_0x44cc('0x45')][_0x44cc('0x4d')]);_0x43e799['where']=qs['filters'](_[_0x44cc('0x4f')](_0x529eca[_0x44cc('0x45')],_0x6f717f[_0x44cc('0x47')]));if(_0x529eca[_0x44cc('0x45')]['filter']){_0x43e799[_0x44cc('0x4e')]=_[_0x44cc('0x51')](_0x43e799[_0x44cc('0x4e')],{'$or':_[_0x44cc('0x52')](_0x43e799[_0x44cc('0x48')],function(_0x216168){var _0x3e48d1={};_0x3e48d1[_0x216168]={'$like':'%'+_0x529eca[_0x44cc('0x45')][_0x44cc('0x50')]+'%'};return _0x3e48d1;})});}_0x43e799=_[_0x44cc('0x51')]({},_0x43e799,_0x529eca[_0x44cc('0x55')]);return _0x106a39[_0x44cc('0x77')](_0x43e799);}})['then'](function(_0x12b912){if(_0x12b912){_0x5d3ddc=_0x12b912[_0x44cc('0x5a')];if(!_0x529eca[_0x44cc('0x45')][_0x44cc('0x4b')]('nolimit')){_0x43e799[_0x44cc('0x2e')]=qs[_0x44cc('0x2e')](_0x529eca[_0x44cc('0x45')][_0x44cc('0x2e')]);_0x43e799[_0x44cc('0x30')]=qs['offset'](_0x529eca[_0x44cc('0x45')][_0x44cc('0x30')]);}return _0x106a39[_0x44cc('0x77')](_0x43e799);}})[_0x44cc('0x37')](function(_0x4adb5e){if(_0x4adb5e){return _0x4adb5e?{'count':_0x5d3ddc,'rows':_0x4adb5e}:null;}})['then'](respondWithResult(_0x1b58f8,null))[_0x44cc('0x2a')](handleError(_0x1b58f8,null));};exports[_0x44cc('0x78')]=function(_0x151190,_0x458481,_0x45a61c){return db[_0x44cc('0x40')][_0x44cc('0x66')]({'where':{'id':_0x151190[_0x44cc('0x59')]['id']}})[_0x44cc('0x37')](handleEntityNotFound(_0x458481,null))[_0x44cc('0x37')](function(_0x8bec69){if(_0x8bec69){return db['sequelize']['transaction'](function(_0x1cb299){return db[_0x44cc('0x79')][_0x44cc('0x39')]({'where':{'WhatsappAccountId':_0x151190[_0x44cc('0x59')]['id']},'transaction':_0x1cb299})[_0x44cc('0x37')](function(_0x1b8db3){var _0x505fe3=_[_0x44cc('0x52')](_0x151190[_0x44cc('0x63')],function(_0x37c5a9){_0x37c5a9[_0x44cc('0x65')]=_0x151190['params']['id'];return _0x37c5a9;});return db[_0x44cc('0x79')][_0x44cc('0x7a')](_0x505fe3,{'transaction':_0x1cb299});});})[_0x44cc('0x37')](function(){return db['WhatsappApplication'][_0x44cc('0x7b')]({'where':{'WhatsappAccountId':_0x151190[_0x44cc('0x59')]['id']},'order':_0x44cc('0x7c')});});}})[_0x44cc('0x37')](respondWithResult(_0x458481,null))[_0x44cc('0x2a')](handleError(_0x458481,null));};exports['getApplications']=function(_0x3037cb,_0x5cf8fa,_0x4523a1){var _0x51f912={};var _0xa0baa5={};var _0x11f211;var _0x1f6dc5;return db[_0x44cc('0x40')][_0x44cc('0x66')]({'where':{'id':_0x3037cb['params']['id']}})['then'](handleEntityNotFound(_0x5cf8fa,null))['then'](function(_0x1286f0){if(_0x1286f0){_0x11f211=_0x1286f0;_0xa0baa5['model']=_[_0x44cc('0x46')](db['WhatsappApplication']['rawAttributes']);_0xa0baa5[_0x44cc('0x45')]=_[_0x44cc('0x46')](_0x3037cb[_0x44cc('0x45')]);_0xa0baa5[_0x44cc('0x47')]=_[_0x44cc('0x49')](_0xa0baa5[_0x44cc('0x44')],_0xa0baa5['query']);_0x51f912['attributes']=_['intersection'](_0xa0baa5[_0x44cc('0x44')],qs['fields'](_0x3037cb[_0x44cc('0x45')][_0x44cc('0x4a')]));_0x51f912['attributes']=_0x51f912[_0x44cc('0x48')][_0x44cc('0x5a')]?_0x51f912[_0x44cc('0x48')]:_0xa0baa5[_0x44cc('0x44')];_0x51f912[_0x44cc('0x4c')]=qs[_0x44cc('0x4d')](_0x3037cb['query'][_0x44cc('0x4d')]);_0x51f912['where']=qs[_0x44cc('0x47')](_[_0x44cc('0x4f')](_0x3037cb[_0x44cc('0x45')],_0xa0baa5[_0x44cc('0x47')]));if(_0x3037cb[_0x44cc('0x45')][_0x44cc('0x50')]){_0x51f912[_0x44cc('0x4e')]=_[_0x44cc('0x51')](_0x51f912[_0x44cc('0x4e')],{'$or':_[_0x44cc('0x52')](_0x51f912[_0x44cc('0x48')],function(_0x3946fc){var _0xc56974={};_0xc56974[_0x3946fc]={'$like':'%'+_0x3037cb['query'][_0x44cc('0x50')]+'%'};return _0xc56974;})});}_0x51f912=_[_0x44cc('0x51')]({},_0x51f912,_0x3037cb[_0x44cc('0x55')]);return _0x11f211['getApplications'](_0x51f912);}})[_0x44cc('0x37')](function(_0xa3358e){if(_0xa3358e){_0x1f6dc5=_0xa3358e['length'];if(!_0x3037cb[_0x44cc('0x45')][_0x44cc('0x4b')]('nolimit')){_0x51f912[_0x44cc('0x2e')]=qs[_0x44cc('0x2e')](_0x3037cb['query'][_0x44cc('0x2e')]);_0x51f912[_0x44cc('0x30')]=qs[_0x44cc('0x30')](_0x3037cb[_0x44cc('0x45')]['offset']);}return _0x11f211['getApplications'](_0x51f912);}})[_0x44cc('0x37')](function(_0x5f53d8){if(_0x5f53d8){return _0x5f53d8?{'count':_0x1f6dc5,'rows':_0x5f53d8}:null;}})[_0x44cc('0x37')](respondWithResult(_0x5cf8fa,null))['catch'](handleError(_0x5cf8fa,null));};exports['notify']=function(_0x23039d,_0x567aec,_0x27a58a){var _0x87c888={'channel':_0x44cc('0x7d')};var _0x5fad8=[];var _0x21f033=[];var _0x21fd90={};return db[_0x44cc('0x40')][_0x44cc('0x60')]({'where':{'id':_0x23039d[_0x44cc('0x59')]['id']},'include':[{'model':db[_0x44cc('0x79')],'as':_0x44cc('0x7e')}]})[_0x44cc('0x37')](handleEntityNotFound(_0x567aec,null))[_0x44cc('0x37')](function(_0x50be24){_0x87c888[_0x44cc('0x7f')]=_0x50be24;_0x87c888[_0x44cc('0x80')]=_['orderBy'](_0x50be24[_0x44cc('0x7e')],[_0x44cc('0x7c')],[_0x44cc('0x81')]);if(_0x87c888[_0x44cc('0x7f')][_0x44cc('0x7e')]){delete _0x87c888[_0x44cc('0x7f')][_0x44cc('0x7e')];}return db[_0x44cc('0x82')][_0x44cc('0x64')]();})[_0x44cc('0x37')](function(_0x37b7e6){if(!_0x37b7e6){throw new db[(_0x44cc('0x83'))]['ValidationError'](_0x44cc('0x84'));}_0x5fad8=_[_0x44cc('0x85')](_[_0x44cc('0x46')](_0x37b7e6),[_0x44cc('0x86'),_0x44cc('0x87')]);_0x21f033=_[_0x44cc('0x85')](_[_0x44cc('0x46')](_0x37b7e6),[_0x44cc('0x86'),_0x44cc('0x87'),_0x44cc('0x88'),'ListId']);_0x87c888[_0x44cc('0x63')]={'mapKey':_0x44cc('0x89')};if(_0x87c888[_0x44cc('0x7f')][_0x44cc('0x53')]&&_0x87c888[_0x44cc('0x7f')][_0x44cc('0x53')]===_0x44cc('0x8a')){_0x87c888['body'][_0x44cc('0x8b')]=_0x23039d[_0x44cc('0x63')][_0x44cc('0x8c')][_0x44cc('0x8d')]('whatsapp:','');_0x87c888[_0x44cc('0x63')][_0x44cc('0x63')]=_0x23039d[_0x44cc('0x63')][_0x44cc('0x8e')];_0x87c888[_0x44cc('0x63')]['messageId']=_0x23039d['body'][_0x44cc('0x8f')];}if(_0x87c888[_0x44cc('0x63')]['id']){delete _0x87c888[_0x44cc('0x63')]['id'];}if(_['isNil'](_0x87c888['body'][_0x44cc('0x8b')])){throw new db['Sequelize'][(_0x44cc('0x90'))](_0x44cc('0x91'));}if(_['isNil'](_0x87c888[_0x44cc('0x63')][_0x44cc('0x63')])||_0x87c888[_0x44cc('0x63')][_0x44cc('0x63')]===''){throw new db[(_0x44cc('0x83'))][(_0x44cc('0x90'))](_0x44cc('0x92'));}if(_[_0x44cc('0x93')](_0x87c888['body'][_0x44cc('0x94')])){throw new db[(_0x44cc('0x83'))][(_0x44cc('0x90'))](_0x44cc('0x95')+_0x21f033);}if(!_[_0x44cc('0x96')](_0x21f033,_0x87c888[_0x44cc('0x63')][_0x44cc('0x94')])){throw new db[(_0x44cc('0x83'))][(_0x44cc('0x90'))](_0x44cc('0x97')+_0x21f033);}_0x21fd90[_0x87c888[_0x44cc('0x63')][_0x44cc('0x94')]]=_0x87c888[_0x44cc('0x63')]['from'];return db[_0x44cc('0x98')]['find']({'where':{'id':_0x87c888['account'][_0x44cc('0x99')]},'include':[{'model':db['CmContact'],'as':_0x44cc('0x9a'),'where':_0x21fd90,'limit':0x1,'order':[[_0x44cc('0x87'),_0x44cc('0x9b')]]}]});})[_0x44cc('0x37')](handleEntityNotFound(_0x567aec,null))[_0x44cc('0x37')](function(_0x45027b){if(_0x45027b){_0x87c888[_0x44cc('0x9c')]=_[_0x44cc('0x71')](_0x45027b,[_0x44cc('0x9a')]);if(_0x45027b['Contacts'][_0x44cc('0x5a')]){return _0x45027b['Contacts'][0x0];}var _0x4cfc99=_[_0x44cc('0x9d')](_0x87c888[_0x44cc('0x63')],{'firstName':_0x87c888[_0x44cc('0x63')][_0x44cc('0x8b')],'ListId':_0x45027b['id']});_0x4cfc99[_0x87c888['body']['mapKey']]=_0x87c888[_0x44cc('0x63')]['from'];return db[_0x44cc('0x82')][_0x44cc('0x5b')](_0x4cfc99,{'fields':_0x5fad8,'raw':!![]});}})[_0x44cc('0x37')](handleEntityNotFound(_0x567aec,null))[_0x44cc('0x37')](function(_0x16f0ff){if(_0x16f0ff){_0x87c888['contact']=_0x16f0ff;var _0x5af29a={'ContactId':_0x16f0ff['id'],'phone':_0x87c888[_0x44cc('0x63')][_0x44cc('0x8b')],'WhatsappAccountId':_0x23039d['params']['id']};var _0x34812c={'ContactId':_0x16f0ff['id'],'WhatsappAccountId':_0x23039d[_0x44cc('0x59')]['id'],'closed':![]};return db[_0x44cc('0x9e')][_0x44cc('0x60')]({'where':_0x34812c})[_0x44cc('0x37')](function(_0x4da63f){if(_0x4da63f){return[_0x4da63f,![]];}return db[_0x44cc('0x9e')][_0x44cc('0x5b')](_0x5af29a)['then'](function(_0x20f6a8){return[_0x20f6a8,!![]];});});}})[_0x44cc('0x9f')](function(_0x21cd55,_0x25290e){_0x87c888[_0x44cc('0xa0')]=_0x21cd55[_0x44cc('0x38')]({'plain':!![]});_0x87c888[_0x44cc('0xa0')][_0x44cc('0xa1')]=![];if(_0x25290e){if(_0x87c888[_0x44cc('0x7f')][_0x44cc('0xa2')]){_0x87c888[_0x44cc('0x80')]['push']({'id':0x0,'priority':_0x87c888[_0x44cc('0x80')][_0x44cc('0x5a')]+0x1,'app':_0x44cc('0xa3'),'appdata':_0x44cc('0xa4'),'interval':'*,*,*,*'});}_0x87c888[_0x44cc('0xa0')]['created']=!![];}return db[_0x44cc('0xa5')]['create']({'phone':_0x87c888[_0x44cc('0x63')][_0x44cc('0x8b')],'messageId':_0x87c888[_0x44cc('0x63')][_0x44cc('0xa6')],'body':_0x87c888['body'][_0x44cc('0x63')],'WhatsappAccountId':_0x23039d[_0x44cc('0x59')]['id'],'WhatsappInteractionId':_0x21cd55['id'],'direction':'in','ContactId':_0x21cd55[_0x44cc('0xa7')],'AttachmentId':_0x87c888[_0x44cc('0x63')]['AttachmentId']});})[_0x44cc('0x37')](function(_0x3c6f81){_0x87c888[_0x44cc('0x28')]=_0x3c6f81;if(_0x87c888[_0x44cc('0xa0')][_0x44cc('0xa8')]){return db[_0x44cc('0xa9')][_0x44cc('0x60')]({'attributes':['id',_0x44cc('0x3c')],'where':{'id':_0x87c888[_0x44cc('0xa0')][_0x44cc('0xa8')]}})['then'](function(_0x3180d2){if(_0x3180d2){_0x87c888['applications'][_0x44cc('0xaa')]({'id':0x0,'priority':0x0,'app':_0x44cc('0xab'),'appdata':_0x3180d2['name']+','+(_0x87c888[_0x44cc('0x7f')][_0x44cc('0xac')]||0xa),'interval':_0x44cc('0xad')});}return respondWithRpcPromise(_0x44cc('0xae'),_0x44cc('0xaf'),_0x87c888);});}return respondWithRpcPromise(_0x44cc('0xae'),_0x44cc('0xaf'),_0x87c888);})['then'](function(_0x2dc4e6){if(_0x2dc4e6){var _0x3885eb=0xc8;var _0x34168d=_0x44cc('0xb0');logger[_0x44cc('0x22')](_0x44cc('0x25'),_0x34168d,_0x3885eb,_0x44cc('0xb1'));logger['debug'](_0x44cc('0xb2'),_0x34168d,_0x3885eb,_0x44cc('0xb1'),JSON[_0x44cc('0xb3')](_0x2dc4e6));if(_0x87c888[_0x44cc('0x7f')]['type']===_0x44cc('0x8a')){return _0x567aec[_0x44cc('0x2c')](_0x3885eb)[_0x44cc('0x31')](_0x44cc('0xb4'),_0x44cc('0xb5'))[_0x44cc('0x3d')](_0x44cc('0xb6'));}else{return _0x567aec[_0x44cc('0x2c')](_0x3885eb)['json'](_0x2dc4e6);}}})[_0x44cc('0x2a')](handleError(_0x567aec,null));};exports[_0x44cc('0x3d')]=function(_0x3329e0,_0x4304a7,_0x79da41){var _0x8313ca,_0x52ac30,_0x2b16e6;if(_[_0x44cc('0x93')](_0x3329e0['body'][_0x44cc('0x63')])||_0x3329e0[_0x44cc('0x63')][_0x44cc('0x63')]===''){throw new db[(_0x44cc('0x83'))][(_0x44cc('0x90'))](_0x44cc('0x92'));}if(_[_0x44cc('0x93')](_0x3329e0[_0x44cc('0x63')]['to'])){throw new db[(_0x44cc('0x83'))]['ValidationError'](_0x44cc('0xb7'));}_0x8313ca=_0x3329e0[_0x44cc('0x63')]['to'];return db[_0x44cc('0x40')][_0x44cc('0x60')]({'where':{'id':_0x3329e0[_0x44cc('0x59')]['id']},'include':[{'model':db[_0x44cc('0x98')],'as':_0x44cc('0xb8'),'include':[{'model':db[_0x44cc('0x82')],'as':'Contacts','where':{'mobile':_0x8313ca},'limit':0x1,'order':[[_0x44cc('0x87'),'DESC']]}]}]})[_0x44cc('0x37')](handleEntityNotFound(_0x4304a7,null))[_0x44cc('0x37')](function(_0x1a4ca8){if(_0x1a4ca8&&_0x1a4ca8[_0x44cc('0xb8')]){_0x52ac30=_0x1a4ca8[_0x44cc('0x38')]({'plain':!![]});if(_0x52ac30[_0x44cc('0xb8')]&&_0x52ac30[_0x44cc('0xb8')][_0x44cc('0x9a')]['length']){return _0x52ac30[_0x44cc('0xb8')]['Contacts'][0x0];}return db[_0x44cc('0x82')][_0x44cc('0x5b')](_[_0x44cc('0x9d')](_0x3329e0['body'],{'firstName':_0x8313ca,'mobile':_0x8313ca,'phone':_0x8313ca,'ListId':_0x52ac30[_0x44cc('0x99')]}));}})[_0x44cc('0x37')](handleEntityNotFound(_0x4304a7,null))[_0x44cc('0x37')](function(_0x512779){if(_0x512779){_0x2b16e6=_0x512779;return db[_0x44cc('0x9e')][_0x44cc('0x60')]({'where':{'ContactId':_0x2b16e6['id'],'closed':![],'WhatsappAccountId':_0x52ac30['id']}})[_0x44cc('0x37')](function(_0xf6ccfb){if(_0xf6ccfb){return[_0xf6ccfb,![]];}return db[_0x44cc('0x9e')][_0x44cc('0x5b')]({'UserId':_0x3329e0[_0x44cc('0x5c')]['id'],'ContactId':_0x2b16e6['id'],'WhatsappAccountId':_0x52ac30['id'],'phone':_0x8313ca,'firstMsgDirection':_0x44cc('0xb9'),'Messages':[_['merge'](_0x3329e0[_0x44cc('0x63')],{'read':![],'body':_0x3329e0[_0x44cc('0x63')][_0x44cc('0x63')],'phone':_0x8313ca,'WhatsappAccountId':_0x52ac30['id'],'UserId':_0x3329e0[_0x44cc('0x5c')]['id'],'ContactId':_0x2b16e6['id']})]},{'include':[{'model':db[_0x44cc('0xa5')],'as':'Messages'}]})['then'](function(_0x5df0a1){return[_0x5df0a1,!![]];});});}})['spread'](function(_0x3327b3,_0x18b866){if(_0x18b866){return _0x3327b3;}return db[_0x44cc('0xa5')]['create'](_[_0x44cc('0x51')](_0x3329e0[_0x44cc('0x63')],{'read':![],'body':_0x3329e0['body'][_0x44cc('0x63')],'phone':_0x8313ca,'WhatsappAccountId':_0x52ac30['id'],'WhatsappInteractionId':_0x3327b3['id'],'UserId':_0x3329e0['user']['id'],'ContactId':_0x2b16e6['id']}))[_0x44cc('0x37')](function(_0x357aee){_0x3327b3[_0x44cc('0xba')][_0x44cc('0xbb')]=[];_0x3327b3['dataValues'][_0x44cc('0xbb')][_0x44cc('0xbc')](_0x357aee[_0x44cc('0xba')]);return _0x3327b3;});})[_0x44cc('0x37')](respondWithResult(_0x4304a7,null))[_0x44cc('0x2a')](handleError(_0x4304a7,null));};
\ No newline at end of file
index 263d225..bc89cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d68=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5d68,0xfd));var _0x85d6=function(_0x3506f8,_0x21d03a){_0x3506f8=_0x3506f8-0x0;var _0x607384=_0x5d68[_0x3506f8];return _0x607384;};'use strict';var EventEmitter=require(_0x85d6('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x85d6('0x1')](0x0);var events={'afterCreate':_0x85d6('0x2'),'afterUpdate':_0x85d6('0x3'),'afterDestroy':_0x85d6('0x4')};function emitEvent(_0xa9de1b){return function(_0x4c5dcf,_0x57a59f,_0x3e0e62){WhatsappAccountEvents['emit'](_0xa9de1b+':'+_0x4c5dcf['id'],_0x4c5dcf);WhatsappAccountEvents[_0x85d6('0x5')](_0xa9de1b,_0x4c5dcf);_0x3e0e62(null);};}for(var e in events){if(events[_0x85d6('0x6')](e)){var event=events[e];WhatsappAccount[_0x85d6('0x7')](e,emitEvent(event));}}module[_0x85d6('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x3647=['save','remove','emit','hasOwnProperty','hook','WhatsappAccount'];(function(_0x5bad52,_0x2960d5){var _0x25d763=function(_0xd03293){while(--_0xd03293){_0x5bad52['push'](_0x5bad52['shift']());}};_0x25d763(++_0x2960d5);}(_0x3647,0x1b5));var _0x7364=function(_0x564e0e,_0x16ba16){_0x564e0e=_0x564e0e-0x0;var _0x1f96c1=_0x3647[_0x564e0e];return _0x1f96c1;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x7364('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7364('0x1'),'afterUpdate':'update','afterDestroy':_0x7364('0x2')};function emitEvent(_0x38e470){return function(_0x4077cb,_0x6b00df,_0x373322){WhatsappAccountEvents[_0x7364('0x3')](_0x38e470+':'+_0x4077cb['id'],_0x4077cb);WhatsappAccountEvents[_0x7364('0x3')](_0x38e470,_0x4077cb);_0x373322(null);};}for(var e in events){if(events[_0x7364('0x4')](e)){var event=events[e];WhatsappAccount[_0x7364('0x5')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
index 846ce51..4b6f3e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe320=['lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','WhatsappAccount','whatsapp_accounts'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xe320,0x8c));var _0x0e32=function(_0x3c3755,_0xa08779){_0x3c3755=_0x3c3755-0x0;var _0x5dffb4=_0xe320[_0x3c3755];return _0x5dffb4;};'use strict';var _=require(_0x0e32('0x0'));var util=require(_0x0e32('0x1'));var logger=require('../../config/logger')(_0x0e32('0x2'));var moment=require('moment');var BPromise=require(_0x0e32('0x3'));var rp=require(_0x0e32('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e32('0x5'));var config=require(_0x0e32('0x6'));var attributes=require(_0x0e32('0x7'));module['exports']=function(_0x33d6a0,_0x51ac3b){return _0x33d6a0['define'](_0x0e32('0x8'),attributes,{'tableName':_0x0e32('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9752=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','whatsapp_accounts','lodash'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x9752,0x12b));var _0x2975=function(_0x3f53a4,_0x172345){_0x3f53a4=_0x3f53a4-0x0;var _0x3bb9e7=_0x9752[_0x3f53a4];return _0x3bb9e7;};'use strict';var _=require(_0x2975('0x0'));var util=require('util');var logger=require(_0x2975('0x1'))(_0x2975('0x2'));var moment=require(_0x2975('0x3'));var BPromise=require(_0x2975('0x4'));var rp=require(_0x2975('0x5'));var fs=require('fs');var path=require(_0x2975('0x6'));var rimraf=require(_0x2975('0x7'));var config=require(_0x2975('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0x2975('0x9')]=function(_0x54d5b3,_0x5177b4){return _0x54d5b3[_0x2975('0xa')]('WhatsappAccount',attributes,{'tableName':_0x2975('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bbc2e9b..8a61b08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2883=['stringify','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4493ed,_0x5c43f6){var _0x3479f0=function(_0x194e44){while(--_0x194e44){_0x4493ed['push'](_0x4493ed['shift']());}};_0x3479f0(++_0x5c43f6);}(_0x2883,0xfd));var _0x3288=function(_0x79a3c6,_0x52092a){_0x79a3c6=_0x79a3c6-0x0;var _0xbe3ce9=_0x2883[_0x79a3c6];return _0xbe3ce9;};'use strict';var _=require(_0x3288('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3288('0x1'));var rs=require(_0x3288('0x2'));var fs=require('fs');var Redis=require(_0x3288('0x3'));var db=require(_0x3288('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3288('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3288('0x6'));var client=jayson['client'][_0x3288('0x7')]({'port':0x232a});config[_0x3288('0x8')]=_[_0x3288('0x9')](config[_0x3288('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3288('0x8')]));require(_0x3288('0xa'))[_0x3288('0xb')](socket);function respondWithRpcPromise(_0x3af9a2,_0x4db44c,_0x2b8828){return new BPromise(function(_0x38eb0f,_0x5036f7){return client[_0x3288('0xc')](_0x3af9a2,_0x2b8828)[_0x3288('0xd')](function(_0x19d286){logger[_0x3288('0xe')](_0x3288('0xf'),_0x4db44c,_0x3288('0x10'));logger[_0x3288('0x11')](_0x3288('0x12'),_0x4db44c,_0x3288('0x10'),JSON[_0x3288('0x13')](_0x19d286));if(_0x19d286[_0x3288('0x14')]){if(_0x19d286[_0x3288('0x14')][_0x3288('0x15')]===0x1f4){logger[_0x3288('0x14')](_0x3288('0xf'),_0x4db44c,_0x19d286[_0x3288('0x14')]['message']);return _0x5036f7(_0x19d286[_0x3288('0x14')][_0x3288('0x16')]);}logger[_0x3288('0x14')](_0x3288('0xf'),_0x4db44c,_0x19d286[_0x3288('0x14')][_0x3288('0x16')]);return _0x38eb0f(_0x19d286['error'][_0x3288('0x16')]);}else{logger['info'](_0x3288('0xf'),_0x4db44c,_0x3288('0x10'));_0x38eb0f(_0x19d286[_0x3288('0x17')]['message']);}})['catch'](function(_0x27f7a8){logger[_0x3288('0x14')]('WhatsappAccount,\x20%s,\x20%s',_0x4db44c,_0x27f7a8);_0x5036f7(_0x27f7a8);});});}exports[_0x3288('0x18')]=function(_0x47aced){var _0x406ff4=this;return new Promise(function(_0x39f6bb,_0x23c956){return db[_0x3288('0x19')][_0x3288('0x1a')]({'raw':_0x47aced['options']?_0x47aced[_0x3288('0x1b')][_0x3288('0x1c')]===undefined?!![]:![]:!![],'where':_0x47aced[_0x3288('0x1b')]?_0x47aced[_0x3288('0x1b')][_0x3288('0x1d')]||null:null,'attributes':_0x47aced[_0x3288('0x1b')]?_0x47aced[_0x3288('0x1b')][_0x3288('0x1e')]||null:null,'include':_0x47aced[_0x3288('0x1b')]?_0x47aced[_0x3288('0x1b')][_0x3288('0x1f')]?_[_0x3288('0x20')](_0x47aced[_0x3288('0x1b')]['include'],function(_0x1afbee){return{'model':db[_0x1afbee[_0x3288('0x21')]],'as':_0x1afbee['as'],'attributes':_0x1afbee[_0x3288('0x1e')],'include':_0x1afbee[_0x3288('0x1f')]?_[_0x3288('0x20')](_0x1afbee[_0x3288('0x1f')],function(_0x1568cc){return{'model':db[_0x1568cc[_0x3288('0x21')]],'as':_0x1568cc['as'],'attributes':_0x1568cc[_0x3288('0x1e')],'include':_0x1568cc[_0x3288('0x1f')]?_[_0x3288('0x20')](_0x1568cc['include'],function(_0x4d241f){return{'model':db[_0x4d241f[_0x3288('0x21')]],'as':_0x4d241f['as'],'attributes':_0x4d241f[_0x3288('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29c5c5){logger[_0x3288('0xe')](_0x3288('0x18'),_0x47aced);logger[_0x3288('0x11')](_0x3288('0x18'),_0x47aced,JSON[_0x3288('0x13')](_0x29c5c5));_0x39f6bb(_0x29c5c5);})['catch'](function(_0x42665b){logger[_0x3288('0x14')](_0x3288('0x18'),_0x42665b['message'],_0x47aced);_0x23c956(_0x406ff4[_0x3288('0x14')](0x1f4,_0x42665b['message']));});});};
\ No newline at end of file
+var _0x2fa6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowWhatsappAccount','find','raw','options','where','attributes','include','model','map','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x255f96,_0x3ebd88){var _0x20ffe6=function(_0x1b3415){while(--_0x1b3415){_0x255f96['push'](_0x255f96['shift']());}};_0x20ffe6(++_0x3ebd88);}(_0x2fa6,0x1e9));var _0x62fa=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x2fa6[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x62fa('0x0'));var util=require(_0x62fa('0x1'));var moment=require(_0x62fa('0x2'));var BPromise=require(_0x62fa('0x3'));var rs=require(_0x62fa('0x4'));var fs=require('fs');var Redis=require(_0x62fa('0x5'));var db=require(_0x62fa('0x6'))['db'];var utils=require(_0x62fa('0x7'));var logger=require(_0x62fa('0x8'))(_0x62fa('0x9'));var config=require(_0x62fa('0xa'));var jayson=require(_0x62fa('0xb'));var client=jayson[_0x62fa('0xc')][_0x62fa('0xd')]({'port':0x232a});config['redis']=_['defaults'](config[_0x62fa('0xe')],{'host':_0x62fa('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62fa('0xe')]));require(_0x62fa('0x10'))[_0x62fa('0x11')](socket);function respondWithRpcPromise(_0x4de58b,_0x4874d7,_0x165074){return new BPromise(function(_0x16dc63,_0x47dcfd){return client[_0x62fa('0x12')](_0x4de58b,_0x165074)[_0x62fa('0x13')](function(_0x1150f9){logger['info'](_0x62fa('0x14'),_0x4874d7,'request\x20sent');logger['debug'](_0x62fa('0x15'),_0x4874d7,'request\x20sent',JSON[_0x62fa('0x16')](_0x1150f9));if(_0x1150f9[_0x62fa('0x17')]){if(_0x1150f9[_0x62fa('0x17')][_0x62fa('0x18')]===0x1f4){logger[_0x62fa('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x4874d7,_0x1150f9[_0x62fa('0x17')][_0x62fa('0x19')]);return _0x47dcfd(_0x1150f9[_0x62fa('0x17')][_0x62fa('0x19')]);}logger[_0x62fa('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x4874d7,_0x1150f9[_0x62fa('0x17')]['message']);return _0x16dc63(_0x1150f9['error']['message']);}else{logger[_0x62fa('0x1a')](_0x62fa('0x14'),_0x4874d7,'request\x20sent');_0x16dc63(_0x1150f9['result'][_0x62fa('0x19')]);}})[_0x62fa('0x1b')](function(_0x8cc592){logger[_0x62fa('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x4874d7,_0x8cc592);_0x47dcfd(_0x8cc592);});});}exports[_0x62fa('0x1c')]=function(_0x37e8ad){var _0x276f6f=this;return new Promise(function(_0x534e04,_0x565e71){return db['WhatsappAccount'][_0x62fa('0x1d')]({'raw':_0x37e8ad['options']?_0x37e8ad['options'][_0x62fa('0x1e')]===undefined?!![]:![]:!![],'where':_0x37e8ad[_0x62fa('0x1f')]?_0x37e8ad[_0x62fa('0x1f')][_0x62fa('0x20')]||null:null,'attributes':_0x37e8ad['options']?_0x37e8ad['options'][_0x62fa('0x21')]||null:null,'include':_0x37e8ad['options']?_0x37e8ad[_0x62fa('0x1f')][_0x62fa('0x22')]?_['map'](_0x37e8ad['options'][_0x62fa('0x22')],function(_0x3e7e1c){return{'model':db[_0x3e7e1c[_0x62fa('0x23')]],'as':_0x3e7e1c['as'],'attributes':_0x3e7e1c[_0x62fa('0x21')],'include':_0x3e7e1c['include']?_[_0x62fa('0x24')](_0x3e7e1c[_0x62fa('0x22')],function(_0x276a02){return{'model':db[_0x276a02[_0x62fa('0x23')]],'as':_0x276a02['as'],'attributes':_0x276a02[_0x62fa('0x21')],'include':_0x276a02[_0x62fa('0x22')]?_[_0x62fa('0x24')](_0x276a02[_0x62fa('0x22')],function(_0x3e7dad){return{'model':db[_0x3e7dad[_0x62fa('0x23')]],'as':_0x3e7dad['as'],'attributes':_0x3e7dad[_0x62fa('0x21')]};}):[]};}):[]};}):[]:[]})[_0x62fa('0x13')](function(_0x1b2408){logger[_0x62fa('0x1a')]('ShowWhatsappAccount',_0x37e8ad);logger[_0x62fa('0x25')]('ShowWhatsappAccount',_0x37e8ad,JSON[_0x62fa('0x16')](_0x1b2408));_0x534e04(_0x1b2408);})[_0x62fa('0x1b')](function(_0x1e97cf){logger['error']('ShowWhatsappAccount',_0x1e97cf[_0x62fa('0x19')],_0x37e8ad);_0x565e71(_0x276f6f[_0x62fa('0x17')](0x1f4,_0x1e97cf[_0x62fa('0x19')]));});});};
\ No newline at end of file
index 00a5346..e00a0fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7645=['whatsappAccount:','save','remove','emit','removeListener','register','length'];(function(_0x4b4c61,_0x4859ee){var _0x171cd8=function(_0x140f34){while(--_0x140f34){_0x4b4c61['push'](_0x4b4c61['shift']());}};_0x171cd8(++_0x4859ee);}(_0x7645,0x86));var _0x5764=function(_0x295696,_0x5910eb){_0x295696=_0x295696-0x0;var _0x30e7db=_0x7645[_0x295696];return _0x30e7db;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x5764('0x0'),_0x5764('0x1'),'update'];function createListener(_0x155d1a,_0x53d90e){return function(_0x124115){_0x53d90e[_0x5764('0x2')](_0x155d1a,_0x124115);};}function removeListener(_0x1f86cf,_0x17a07d){return function(){WhatsappAccountEvents[_0x5764('0x3')](_0x1f86cf,_0x17a07d);};}exports[_0x5764('0x4')]=function(_0xc6356f){for(var _0x5e3f7b=0x0,_0xa58c31=events[_0x5764('0x5')];_0x5e3f7b<_0xa58c31;_0x5e3f7b++){var _0x34cdec=events[_0x5e3f7b];var _0x1a261c=createListener(_0x5764('0x6')+_0x34cdec,_0xc6356f);WhatsappAccountEvents['on'](_0x34cdec,_0x1a261c);}};
\ No newline at end of file
+var _0xd0ec=['remove','length','whatsappAccount:','save'];(function(_0x3a9caf,_0x4e606c){var _0x40ad39=function(_0x38dfea){while(--_0x38dfea){_0x3a9caf['push'](_0x3a9caf['shift']());}};_0x40ad39(++_0x4e606c);}(_0xd0ec,0x107));var _0xcd0e=function(_0x1dc565,_0x3f53d9){_0x1dc565=_0x1dc565-0x0;var _0x2f1336=_0xd0ec[_0x1dc565];return _0x2f1336;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xcd0e('0x0'),_0xcd0e('0x1'),'update'];function createListener(_0x2f2c18,_0x457b39){return function(_0x1729e6){_0x457b39['emit'](_0x2f2c18,_0x1729e6);};}function removeListener(_0x49ae98,_0x51e9d3){return function(){WhatsappAccountEvents['removeListener'](_0x49ae98,_0x51e9d3);};}exports['register']=function(_0x21f731){for(var _0x4ddf40=0x0,_0x195f6e=events[_0xcd0e('0x2')];_0x4ddf40<_0x195f6e;_0x4ddf40++){var _0x4bbca3=events[_0x4ddf40];var _0x4cd284=createListener(_0xcd0e('0x3')+_0x4bbca3,_0x21f731);WhatsappAccountEvents['on'](_0x4bbca3,_0x4cd284);}};
\ No newline at end of file
index 8b3ec18..8c57904 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8e8=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','isAuthenticated','show'];(function(_0x371e58,_0x588085){var _0x592124=function(_0x5da2a9){while(--_0x5da2a9){_0x371e58['push'](_0x371e58['shift']());}};_0x592124(++_0x588085);}(_0xf8e8,0xf8));var _0x8f8e=function(_0x1e2e1e,_0xe1710d){_0x1e2e1e=_0x1e2e1e-0x0;var _0x9dc99=_0xf8e8[_0x1e2e1e];return _0x9dc99;};'use strict';var multer=require(_0x8f8e('0x0'));var util=require(_0x8f8e('0x1'));var path=require(_0x8f8e('0x2'));var timeout=require(_0x8f8e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8f8e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8f8e('0x5'));var config=require(_0x8f8e('0x6'));var controller=require(_0x8f8e('0x7'));router[_0x8f8e('0x8')]('/',auth['isAuthenticated'](),controller[_0x8f8e('0x9')]);router[_0x8f8e('0x8')]('/:id',auth[_0x8f8e('0xa')](),controller[_0x8f8e('0xb')]);router[_0x8f8e('0xc')]('/',auth[_0x8f8e('0xa')](),controller[_0x8f8e('0xd')]);router[_0x8f8e('0xe')](_0x8f8e('0xf'),auth[_0x8f8e('0xa')](),controller[_0x8f8e('0x10')]);router[_0x8f8e('0x11')](_0x8f8e('0xf'),auth[_0x8f8e('0xa')](),controller[_0x8f8e('0x12')]);module[_0x8f8e('0x13')]=router;
\ No newline at end of file
+var _0xdc6a=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','post','create'];(function(_0xb0f919,_0x18611f){var _0x48959b=function(_0x1cecce){while(--_0x1cecce){_0xb0f919['push'](_0xb0f919['shift']());}};_0x48959b(++_0x18611f);}(_0xdc6a,0x16c));var _0xadc6=function(_0x3b65a5,_0x15c225){_0x3b65a5=_0x3b65a5-0x0;var _0x5768e2=_0xdc6a[_0x3b65a5];return _0x5768e2;};'use strict';var multer=require(_0xadc6('0x0'));var util=require(_0xadc6('0x1'));var path=require(_0xadc6('0x2'));var timeout=require(_0xadc6('0x3'));var express=require(_0xadc6('0x4'));var router=express[_0xadc6('0x5')]();var fs_extra=require(_0xadc6('0x6'));var auth=require(_0xadc6('0x7'));var interaction=require(_0xadc6('0x8'));var config=require(_0xadc6('0x9'));var controller=require('./whatsappApplication.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xadc6('0xa')]);router[_0xadc6('0xb')](_0xadc6('0xc'),auth[_0xadc6('0xd')](),controller['show']);router[_0xadc6('0xe')]('/',auth[_0xadc6('0xd')](),controller[_0xadc6('0xf')]);router[_0xadc6('0x10')]('/:id',auth[_0xadc6('0xd')](),controller['update']);router[_0xadc6('0x11')](_0xadc6('0xc'),auth[_0xadc6('0xd')](),controller[_0xadc6('0x12')]);module[_0xadc6('0x13')]=router;
\ No newline at end of file
index 3d3896c..4452b8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdc3=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xfdc3,0x164));var _0x3fdc=function(_0x300e9d,_0x121c69){_0x300e9d=_0x300e9d-0x0;var _0x30e34d=_0xfdc3[_0x300e9d];return _0x30e34d;};'use strict';var Sequelize=require(_0x3fdc('0x0'));module[_0x3fdc('0x1')]={'priority':{'type':Sequelize[_0x3fdc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3fdc('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3fdc('0x4')]()},'description':{'type':Sequelize[_0x3fdc('0x3')]},'interval':{'type':Sequelize[_0x3fdc('0x3')],'defaultValue':_0x3fdc('0x5')}};
\ No newline at end of file
+var _0x527c=['exports','INTEGER','STRING','TEXT'];(function(_0x1ff4f3,_0x3b8a9c){var _0x5eeef2=function(_0x3d11a9){while(--_0x3d11a9){_0x1ff4f3['push'](_0x1ff4f3['shift']());}};_0x5eeef2(++_0x3b8a9c);}(_0x527c,0x14c));var _0xc527=function(_0x3ca44a,_0x4bc76d){_0x3ca44a=_0x3ca44a-0x0;var _0x362653=_0x527c[_0x3ca44a];return _0x362653;};'use strict';var Sequelize=require('sequelize');module[_0xc527('0x0')]={'priority':{'type':Sequelize[_0xc527('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc527('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc527('0x3')]()},'description':{'type':Sequelize[_0xc527('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index ac29811..4d27eb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x056b=['send','WhatsappApplication','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','catch','create','body','rimraf','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','stack','name'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0x056b,0xb6));var _0xb056=function(_0x57cbfb,_0x2de760){_0x57cbfb=_0x57cbfb-0x0;var _0x4cb933=_0x056b[_0x57cbfb];return _0x4cb933;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb056('0x0'));var zipdir=require(_0xb056('0x1'));var jsonpatch=require(_0xb056('0x2'));var rp=require(_0xb056('0x3'));var moment=require(_0xb056('0x4'));var BPromise=require(_0xb056('0x5'));var Mustache=require(_0xb056('0x6'));var util=require(_0xb056('0x7'));var path=require(_0xb056('0x8'));var sox=require(_0xb056('0x9'));var csv=require(_0xb056('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb056('0xb'));var _=require(_0xb056('0xc'));var squel=require(_0xb056('0xd'));var crypto=require(_0xb056('0xe'));var jsforce=require(_0xb056('0xf'));var deskjs=require(_0xb056('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb056('0x11'));var Redis=require(_0xb056('0x12'));var authService=require(_0xb056('0x13'));var qs=require(_0xb056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb056('0x15'));var logger=require('../../config/logger')(_0xb056('0x16'));var utils=require(_0xb056('0x17'));var config=require(_0xb056('0x18'));var licenseUtil=require(_0xb056('0x19'));var db=require(_0xb056('0x1a'))['db'];function respondWithStatusCode(_0x5d8306,_0x49c5ec){_0x49c5ec=_0x49c5ec||0xcc;return function(_0xf3e80f){if(_0xf3e80f){return _0x5d8306[_0xb056('0x1b')](_0x49c5ec);}return _0x5d8306['status'](_0x49c5ec)[_0xb056('0x1c')]();};}function respondWithResult(_0x34611b,_0xf1c2e9){_0xf1c2e9=_0xf1c2e9||0xc8;return function(_0x1197e5){if(_0x1197e5){return _0x34611b[_0xb056('0x1d')](_0xf1c2e9)[_0xb056('0x1e')](_0x1197e5);}};}function respondWithFilteredResult(_0x179e49,_0x4b838e){return function(_0x162146){if(_0x162146){var _0x43565e=typeof _0x4b838e[_0xb056('0x1f')]===_0xb056('0x20')&&typeof _0x4b838e['limit']===_0xb056('0x20');var _0x4e501a=_0x162146[_0xb056('0x21')];var _0x311eb9=_0x43565e?0x0:_0x4b838e['offset'];var _0x29c77e=_0x43565e?_0x162146['count']:_0x4b838e[_0xb056('0x1f')]+_0x4b838e[_0xb056('0x22')];var _0x5e4bd9;if(_0x29c77e>=_0x4e501a){_0x29c77e=_0x4e501a;_0x5e4bd9=0xc8;}else{_0x5e4bd9=0xce;}_0x179e49[_0xb056('0x1d')](_0x5e4bd9);return _0x179e49['set'](_0xb056('0x23'),_0x311eb9+'-'+_0x29c77e+'/'+_0x4e501a)[_0xb056('0x1e')](_0x162146);}return null;};}function patchUpdates(_0x457b54){return function(_0x33dd35){try{jsonpatch['apply'](_0x33dd35,_0x457b54,!![]);}catch(_0x1db585){return BPromise['reject'](_0x1db585);}return _0x33dd35[_0xb056('0x24')]();};}function saveUpdates(_0x5dea90,_0x324ce6){return function(_0x40ac2d){if(_0x40ac2d){return _0x40ac2d[_0xb056('0x25')](_0x5dea90)[_0xb056('0x26')](function(_0x36e539){return _0x36e539;});}return null;};}function removeEntity(_0x4bb6c0,_0x4e66c3){return function(_0x1016da){if(_0x1016da){return _0x1016da[_0xb056('0x27')]()[_0xb056('0x26')](function(){_0x4bb6c0[_0xb056('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a14f,_0x10b9b3){return function(_0x5c39db){if(!_0x5c39db){_0x44a14f[_0xb056('0x1b')](0x194);}return _0x5c39db;};}function handleError(_0x265782,_0x2ae873){_0x2ae873=_0x2ae873||0x1f4;return function(_0x1d2c66){logger[_0xb056('0x28')](_0x1d2c66[_0xb056('0x29')]);if(_0x1d2c66[_0xb056('0x2a')]){delete _0x1d2c66[_0xb056('0x2a')];}_0x265782['status'](_0x2ae873)[_0xb056('0x2b')](_0x1d2c66);};}exports['index']=function(_0x3d83d3,_0x9c6f4a){var _0x294874={},_0x488185={},_0xd53267={'count':0x0,'rows':[]};var _0x264569=_['map'](db[_0xb056('0x2c')][_0xb056('0x2d')],function(_0x329eaa){return{'name':_0x329eaa[_0xb056('0x2e')],'type':_0x329eaa[_0xb056('0x2f')]['key']};});_0x488185[_0xb056('0x30')]=_[_0xb056('0x31')](_0x264569,_0xb056('0x2a'));_0x488185[_0xb056('0x32')]=_[_0xb056('0x33')](_0x3d83d3['query']);_0x488185[_0xb056('0x34')]=_[_0xb056('0x35')](_0x488185[_0xb056('0x30')],_0x488185[_0xb056('0x32')]);_0x294874[_0xb056('0x36')]=_[_0xb056('0x35')](_0x488185[_0xb056('0x30')],qs[_0xb056('0x37')](_0x3d83d3['query'][_0xb056('0x37')]));_0x294874['attributes']=_0x294874[_0xb056('0x36')]['length']?_0x294874['attributes']:_0x488185[_0xb056('0x30')];if(!_0x3d83d3[_0xb056('0x32')][_0xb056('0x38')](_0xb056('0x39'))){_0x294874[_0xb056('0x22')]=qs[_0xb056('0x22')](_0x3d83d3[_0xb056('0x32')]['limit']);_0x294874[_0xb056('0x1f')]=qs[_0xb056('0x1f')](_0x3d83d3['query']['offset']);}_0x294874[_0xb056('0x3a')]=qs[_0xb056('0x3b')](_0x3d83d3[_0xb056('0x32')]['sort']);_0x294874[_0xb056('0x3c')]=qs[_0xb056('0x34')](_[_0xb056('0x3d')](_0x3d83d3[_0xb056('0x32')],_0x488185[_0xb056('0x34')]),_0x264569);if(_0x3d83d3[_0xb056('0x32')][_0xb056('0x3e')]){_0x294874[_0xb056('0x3c')]=_[_0xb056('0x3f')](_0x294874[_0xb056('0x3c')],{'$or':_[_0xb056('0x31')](_0x264569,function(_0x1afc7f){if(_0x1afc7f['type']!==_0xb056('0x40')){var _0x4acc94={};_0x4acc94[_0x1afc7f[_0xb056('0x2a')]]={'$like':'%'+_0x3d83d3[_0xb056('0x32')][_0xb056('0x3e')]+'%'};return _0x4acc94;}})});}_0x294874=_[_0xb056('0x3f')]({},_0x294874,_0x3d83d3[_0xb056('0x41')]);var _0x661784={'where':_0x294874[_0xb056('0x3c')]};return db[_0xb056('0x2c')]['count'](_0x661784)[_0xb056('0x26')](function(_0x21a34b){_0xd53267[_0xb056('0x21')]=_0x21a34b;if(_0x3d83d3[_0xb056('0x32')][_0xb056('0x42')]){_0x294874['include']=[{'all':!![]}];}return db[_0xb056('0x2c')][_0xb056('0x43')](_0x294874);})[_0xb056('0x26')](function(_0x216f72){_0xd53267[_0xb056('0x44')]=_0x216f72;return _0xd53267;})[_0xb056('0x26')](respondWithFilteredResult(_0x9c6f4a,_0x294874))['catch'](handleError(_0x9c6f4a,null));};exports[_0xb056('0x45')]=function(_0x5040f6,_0x3bcc3d){var _0xc729f3={'raw':!![],'where':{'id':_0x5040f6[_0xb056('0x46')]['id']}},_0x21d98e={};_0x21d98e[_0xb056('0x30')]=_[_0xb056('0x33')](db[_0xb056('0x2c')][_0xb056('0x2d')]);_0x21d98e[_0xb056('0x32')]=_[_0xb056('0x33')](_0x5040f6['query']);_0x21d98e[_0xb056('0x34')]=_[_0xb056('0x35')](_0x21d98e[_0xb056('0x30')],_0x21d98e['query']);_0xc729f3[_0xb056('0x36')]=_[_0xb056('0x35')](_0x21d98e['model'],qs['fields'](_0x5040f6[_0xb056('0x32')][_0xb056('0x37')]));_0xc729f3[_0xb056('0x36')]=_0xc729f3[_0xb056('0x36')]['length']?_0xc729f3['attributes']:_0x21d98e['model'];if(_0x5040f6['query']['includeAll']){_0xc729f3['include']=[{'all':!![]}];}_0xc729f3=_[_0xb056('0x3f')]({},_0xc729f3,_0x5040f6['options']);return db[_0xb056('0x2c')][_0xb056('0x47')](_0xc729f3)[_0xb056('0x26')](handleEntityNotFound(_0x3bcc3d,null))[_0xb056('0x26')](respondWithResult(_0x3bcc3d,null))[_0xb056('0x48')](handleError(_0x3bcc3d,null));};exports[_0xb056('0x49')]=function(_0x45b4aa,_0x1d3f86){return db['WhatsappApplication'][_0xb056('0x49')](_0x45b4aa[_0xb056('0x4a')],{})['then'](respondWithResult(_0x1d3f86,0xc9))[_0xb056('0x48')](handleError(_0x1d3f86,null));};exports[_0xb056('0x25')]=function(_0xe40439,_0x2f2d22){if(_0xe40439[_0xb056('0x4a')]['id']){delete _0xe40439[_0xb056('0x4a')]['id'];}return db['WhatsappApplication'][_0xb056('0x47')]({'where':{'id':_0xe40439['params']['id']}})[_0xb056('0x26')](handleEntityNotFound(_0x2f2d22,null))[_0xb056('0x26')](saveUpdates(_0xe40439[_0xb056('0x4a')],null))[_0xb056('0x26')](respondWithResult(_0x2f2d22,null))[_0xb056('0x48')](handleError(_0x2f2d22,null));};exports[_0xb056('0x27')]=function(_0x2b6733,_0x25bb16){return db['WhatsappApplication'][_0xb056('0x47')]({'where':{'id':_0x2b6733[_0xb056('0x46')]['id']}})[_0xb056('0x26')](handleEntityNotFound(_0x25bb16,null))[_0xb056('0x26')](removeEntity(_0x25bb16,null))[_0xb056('0x48')](handleError(_0x25bb16,null));};
\ No newline at end of file
+var _0x1921=['WhatsappApplication','includeAll','include','findAll','rows','catch','show','length','options','create','body','find','destroy','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','set','reject','update','then','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x312666,_0x107df1){var _0x1a38a4=function(_0x41b89e){while(--_0x41b89e){_0x312666['push'](_0x312666['shift']());}};_0x1a38a4(++_0x107df1);}(_0x1921,0xf2));var _0x1192=function(_0x9274aa,_0x1e531b){_0x9274aa=_0x9274aa-0x0;var _0x3f605c=_0x1921[_0x9274aa];return _0x3f605c;};'use strict';var emlformat=require(_0x1192('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1192('0x1'));var jsonpatch=require(_0x1192('0x2'));var rp=require(_0x1192('0x3'));var moment=require(_0x1192('0x4'));var BPromise=require(_0x1192('0x5'));var Mustache=require(_0x1192('0x6'));var util=require(_0x1192('0x7'));var path=require(_0x1192('0x8'));var sox=require(_0x1192('0x9'));var csv=require(_0x1192('0xa'));var ejs=require(_0x1192('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1192('0xc'));var crypto=require(_0x1192('0xd'));var jsforce=require(_0x1192('0xe'));var deskjs=require(_0x1192('0xf'));var toCsv=require(_0x1192('0xa'));var querystring=require(_0x1192('0x10'));var Papa=require(_0x1192('0x11'));var Redis=require(_0x1192('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1192('0x13'));var hardwareService=require(_0x1192('0x14'));var logger=require(_0x1192('0x15'))(_0x1192('0x16'));var utils=require(_0x1192('0x17'));var config=require(_0x1192('0x18'));var licenseUtil=require(_0x1192('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33b997,_0x594596){_0x594596=_0x594596||0xcc;return function(_0x3b7ba7){if(_0x3b7ba7){return _0x33b997[_0x1192('0x1a')](_0x594596);}return _0x33b997['status'](_0x594596)[_0x1192('0x1b')]();};}function respondWithResult(_0x1e5fcc,_0x406b97){_0x406b97=_0x406b97||0xc8;return function(_0x4c17d3){if(_0x4c17d3){return _0x1e5fcc[_0x1192('0x1c')](_0x406b97)[_0x1192('0x1d')](_0x4c17d3);}};}function respondWithFilteredResult(_0x55755b,_0x2021f2){return function(_0x3397d1){if(_0x3397d1){var _0x2a162b=typeof _0x2021f2['offset']===_0x1192('0x1e')&&typeof _0x2021f2['limit']===_0x1192('0x1e');var _0x4757bb=_0x3397d1[_0x1192('0x1f')];var _0x13a5ca=_0x2a162b?0x0:_0x2021f2[_0x1192('0x20')];var _0x24c2e1=_0x2a162b?_0x3397d1['count']:_0x2021f2['offset']+_0x2021f2[_0x1192('0x21')];var _0x1b46e2;if(_0x24c2e1>=_0x4757bb){_0x24c2e1=_0x4757bb;_0x1b46e2=0xc8;}else{_0x1b46e2=0xce;}_0x55755b[_0x1192('0x1c')](_0x1b46e2);return _0x55755b[_0x1192('0x22')]('Content-Range',_0x13a5ca+'-'+_0x24c2e1+'/'+_0x4757bb)[_0x1192('0x1d')](_0x3397d1);}return null;};}function patchUpdates(_0x2da521){return function(_0x141c9b){try{jsonpatch['apply'](_0x141c9b,_0x2da521,!![]);}catch(_0x1cfcd6){return BPromise[_0x1192('0x23')](_0x1cfcd6);}return _0x141c9b['save']();};}function saveUpdates(_0x40bee5,_0x22f4c8){return function(_0x402e64){if(_0x402e64){return _0x402e64[_0x1192('0x24')](_0x40bee5)['then'](function(_0x4ad6b4){return _0x4ad6b4;});}return null;};}function removeEntity(_0x406c87,_0x5a7774){return function(_0x3cc973){if(_0x3cc973){return _0x3cc973['destroy']()[_0x1192('0x25')](function(){_0x406c87['status'](0xcc)[_0x1192('0x1b')]();});}};}function handleEntityNotFound(_0x18e4cc,_0x572d29){return function(_0x40bdb5){if(!_0x40bdb5){_0x18e4cc[_0x1192('0x1a')](0x194);}return _0x40bdb5;};}function handleError(_0x1e198c,_0x148c22){_0x148c22=_0x148c22||0x1f4;return function(_0x288ac6){logger[_0x1192('0x26')](_0x288ac6['stack']);if(_0x288ac6[_0x1192('0x27')]){delete _0x288ac6[_0x1192('0x27')];}_0x1e198c[_0x1192('0x1c')](_0x148c22)[_0x1192('0x28')](_0x288ac6);};}exports[_0x1192('0x29')]=function(_0x3a0736,_0x469fcd){var _0x2c7c9b={},_0x3d2c78={},_0x3c2d80={'count':0x0,'rows':[]};var _0x51e8bd=_[_0x1192('0x2a')](db['WhatsappApplication']['rawAttributes'],function(_0x7218dc){return{'name':_0x7218dc[_0x1192('0x2b')],'type':_0x7218dc[_0x1192('0x2c')][_0x1192('0x2d')]};});_0x3d2c78[_0x1192('0x2e')]=_[_0x1192('0x2a')](_0x51e8bd,_0x1192('0x27'));_0x3d2c78[_0x1192('0x2f')]=_[_0x1192('0x30')](_0x3a0736[_0x1192('0x2f')]);_0x3d2c78[_0x1192('0x31')]=_[_0x1192('0x32')](_0x3d2c78[_0x1192('0x2e')],_0x3d2c78[_0x1192('0x2f')]);_0x2c7c9b[_0x1192('0x33')]=_[_0x1192('0x32')](_0x3d2c78[_0x1192('0x2e')],qs[_0x1192('0x34')](_0x3a0736[_0x1192('0x2f')][_0x1192('0x34')]));_0x2c7c9b[_0x1192('0x33')]=_0x2c7c9b['attributes']['length']?_0x2c7c9b['attributes']:_0x3d2c78[_0x1192('0x2e')];if(!_0x3a0736[_0x1192('0x2f')][_0x1192('0x35')](_0x1192('0x36'))){_0x2c7c9b['limit']=qs[_0x1192('0x21')](_0x3a0736[_0x1192('0x2f')][_0x1192('0x21')]);_0x2c7c9b[_0x1192('0x20')]=qs[_0x1192('0x20')](_0x3a0736[_0x1192('0x2f')][_0x1192('0x20')]);}_0x2c7c9b[_0x1192('0x37')]=qs['sort'](_0x3a0736['query'][_0x1192('0x38')]);_0x2c7c9b[_0x1192('0x39')]=qs[_0x1192('0x31')](_[_0x1192('0x3a')](_0x3a0736[_0x1192('0x2f')],_0x3d2c78[_0x1192('0x31')]),_0x51e8bd);if(_0x3a0736['query'][_0x1192('0x3b')]){_0x2c7c9b[_0x1192('0x39')]=_[_0x1192('0x3c')](_0x2c7c9b[_0x1192('0x39')],{'$or':_[_0x1192('0x2a')](_0x51e8bd,function(_0x40ca5a){if(_0x40ca5a['type']!==_0x1192('0x3d')){var _0x3229f7={};_0x3229f7[_0x40ca5a['name']]={'$like':'%'+_0x3a0736[_0x1192('0x2f')][_0x1192('0x3b')]+'%'};return _0x3229f7;}})});}_0x2c7c9b=_[_0x1192('0x3c')]({},_0x2c7c9b,_0x3a0736['options']);var _0x57f4d2={'where':_0x2c7c9b['where']};return db[_0x1192('0x3e')][_0x1192('0x1f')](_0x57f4d2)['then'](function(_0x2974a1){_0x3c2d80[_0x1192('0x1f')]=_0x2974a1;if(_0x3a0736[_0x1192('0x2f')][_0x1192('0x3f')]){_0x2c7c9b[_0x1192('0x40')]=[{'all':!![]}];}return db[_0x1192('0x3e')][_0x1192('0x41')](_0x2c7c9b);})[_0x1192('0x25')](function(_0x1c4198){_0x3c2d80[_0x1192('0x42')]=_0x1c4198;return _0x3c2d80;})[_0x1192('0x25')](respondWithFilteredResult(_0x469fcd,_0x2c7c9b))[_0x1192('0x43')](handleError(_0x469fcd,null));};exports[_0x1192('0x44')]=function(_0xbae0b2,_0x17cc55){var _0x290a87={'raw':!![],'where':{'id':_0xbae0b2['params']['id']}},_0x553896={};_0x553896[_0x1192('0x2e')]=_[_0x1192('0x30')](db[_0x1192('0x3e')]['rawAttributes']);_0x553896[_0x1192('0x2f')]=_[_0x1192('0x30')](_0xbae0b2[_0x1192('0x2f')]);_0x553896['filters']=_[_0x1192('0x32')](_0x553896[_0x1192('0x2e')],_0x553896['query']);_0x290a87[_0x1192('0x33')]=_[_0x1192('0x32')](_0x553896[_0x1192('0x2e')],qs['fields'](_0xbae0b2[_0x1192('0x2f')][_0x1192('0x34')]));_0x290a87[_0x1192('0x33')]=_0x290a87[_0x1192('0x33')][_0x1192('0x45')]?_0x290a87['attributes']:_0x553896['model'];if(_0xbae0b2[_0x1192('0x2f')]['includeAll']){_0x290a87[_0x1192('0x40')]=[{'all':!![]}];}_0x290a87=_[_0x1192('0x3c')]({},_0x290a87,_0xbae0b2[_0x1192('0x46')]);return db[_0x1192('0x3e')]['find'](_0x290a87)[_0x1192('0x25')](handleEntityNotFound(_0x17cc55,null))[_0x1192('0x25')](respondWithResult(_0x17cc55,null))[_0x1192('0x43')](handleError(_0x17cc55,null));};exports[_0x1192('0x47')]=function(_0x2ecd11,_0x144149){return db[_0x1192('0x3e')]['create'](_0x2ecd11[_0x1192('0x48')],{})[_0x1192('0x25')](respondWithResult(_0x144149,0xc9))['catch'](handleError(_0x144149,null));};exports[_0x1192('0x24')]=function(_0x2ad1cf,_0x2822f8){if(_0x2ad1cf[_0x1192('0x48')]['id']){delete _0x2ad1cf[_0x1192('0x48')]['id'];}return db[_0x1192('0x3e')][_0x1192('0x49')]({'where':{'id':_0x2ad1cf['params']['id']}})[_0x1192('0x25')](handleEntityNotFound(_0x2822f8,null))[_0x1192('0x25')](saveUpdates(_0x2ad1cf[_0x1192('0x48')],null))['then'](respondWithResult(_0x2822f8,null))[_0x1192('0x43')](handleError(_0x2822f8,null));};exports[_0x1192('0x4a')]=function(_0xcdda33,_0x5b735c){return db['WhatsappApplication']['find']({'where':{'id':_0xcdda33[_0x1192('0x4b')]['id']}})[_0x1192('0x25')](handleEntityNotFound(_0x5b735c,null))[_0x1192('0x25')](removeEntity(_0x5b735c,null))['catch'](handleError(_0x5b735c,null));};
\ No newline at end of file
index 7934989..a3bdc43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae1c=['WhatsappApplication','whatsapp_applications','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define'];(function(_0x2660ef,_0x4e441c){var _0x409c59=function(_0x581508){while(--_0x581508){_0x2660ef['push'](_0x2660ef['shift']());}};_0x409c59(++_0x4e441c);}(_0xae1c,0xff));var _0xcae1=function(_0x5ec695,_0x398929){_0x5ec695=_0x5ec695-0x0;var _0xf7916f=_0xae1c[_0x5ec695];return _0xf7916f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcae1('0x0'));var BPromise=require(_0xcae1('0x1'));var rp=require(_0xcae1('0x2'));var fs=require('fs');var path=require(_0xcae1('0x3'));var rimraf=require(_0xcae1('0x4'));var config=require(_0xcae1('0x5'));var attributes=require(_0xcae1('0x6'));module[_0xcae1('0x7')]=function(_0x3513e5,_0x40fcec){return _0x3513e5[_0xcae1('0x8')](_0xcae1('0x9'),attributes,{'tableName':_0xcae1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x72a2=['define','WhatsappApplication','whatsapp_applications','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x5ed57c,_0x596ae8){var _0x5efa44=function(_0x20822b){while(--_0x20822b){_0x5ed57c['push'](_0x5ed57c['shift']());}};_0x5efa44(++_0x596ae8);}(_0x72a2,0x161));var _0x272a=function(_0x10285f,_0x741a4){_0x10285f=_0x10285f-0x0;var _0x575688=_0x72a2[_0x10285f];return _0x575688;};'use strict';var _=require('lodash');var util=require(_0x272a('0x0'));var logger=require(_0x272a('0x1'))(_0x272a('0x2'));var moment=require(_0x272a('0x3'));var BPromise=require(_0x272a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x272a('0x5'));var rimraf=require('rimraf');var config=require(_0x272a('0x6'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x4f628a,_0x2ba5db){return _0x4f628a[_0x272a('0x7')](_0x272a('0x8'),attributes,{'tableName':_0x272a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 87b9f83..1be57a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x477ddf,_0x3c6b6c){var _0x365dd5=function(_0x27a0b3){while(--_0x27a0b3){_0x477ddf['push'](_0x477ddf['shift']());}};_0x365dd5(++_0x3c6b6c);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4a2af0,_0x1a6c86){_0x4a2af0=_0x4a2af0-0x0;var _0x409579=_0x8d0e[_0x4a2af0];return _0x409579;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});}
\ No newline at end of file
+var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','WhatsappApplication,\x20%s,\x20%s','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x1cf137,_0x21716f){var _0x2881db=function(_0x5d565f){while(--_0x5d565f){_0x1cf137['push'](_0x1cf137['shift']());}};_0x2881db(++_0x21716f);}(_0x9f62,0x154));var _0x29f6=function(_0x1b2877,_0x285aae){_0x1b2877=_0x1b2877-0x0;var _0x378f12=_0x9f62[_0x1b2877];return _0x378f12;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272876,_0x9a43fe,_0x2ba602){return new BPromise(function(_0x416c6c,_0x5e9945){return client['request'](_0x272876,_0x2ba602)['then'](function(_0x549f64){logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,'request\x20sent');logger['debug'](_0x29f6('0xb'),_0x9a43fe,_0x29f6('0xc'),JSON['stringify'](_0x549f64));if(_0x549f64[_0x29f6('0xd')]){if(_0x549f64[_0x29f6('0xd')]['code']===0x1f4){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x9a43fe,_0x549f64['error'][_0x29f6('0xe')]);return _0x5e9945(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}logger[_0x29f6('0xd')](_0x29f6('0xa'),_0x9a43fe,_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);return _0x416c6c(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}else{logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,_0x29f6('0xc'));_0x416c6c(_0x549f64[_0x29f6('0xf')][_0x29f6('0xe')]);}})[_0x29f6('0x10')](function(_0x14dd56){logger[_0x29f6('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x9a43fe,_0x14dd56);_0x5e9945(_0x14dd56);});});}
\ No newline at end of file
index 693752c..e013ebe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x446c=['describe','get','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x24497d,_0x480367){var _0x5d8cd9=function(_0x4b28ff){while(--_0x4b28ff){_0x24497d['push'](_0x24497d['shift']());}};_0x5d8cd9(++_0x480367);}(_0x446c,0x156));var _0xc446=function(_0x31e584,_0x4d9f7f){_0x31e584=_0x31e584-0x0;var _0x5686d0=_0x446c[_0x31e584];return _0x5686d0;};'use strict';var multer=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var path=require(_0xc446('0x2'));var timeout=require(_0xc446('0x3'));var express=require('express');var router=express[_0xc446('0x4')]();var fs_extra=require(_0xc446('0x5'));var auth=require(_0xc446('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc446('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xc446('0x8')](),controller[_0xc446('0x9')]);router['get']('/describe',auth[_0xc446('0x8')](),controller[_0xc446('0xa')]);router[_0xc446('0xb')](_0xc446('0xc'),auth[_0xc446('0x8')](),controller['show']);router[_0xc446('0xb')](_0xc446('0xd'),auth[_0xc446('0x8')](),controller[_0xc446('0xe')]);router['get'](_0xc446('0xf'),auth[_0xc446('0x8')](),controller[_0xc446('0x10')]);router[_0xc446('0x11')]('/',auth[_0xc446('0x8')](),controller[_0xc446('0x12')]);router[_0xc446('0x11')](_0xc446('0xd'),auth[_0xc446('0x8')](),controller[_0xc446('0x13')]);router[_0xc446('0x11')](_0xc446('0x14'),auth[_0xc446('0x8')](),interaction[_0xc446('0x15')](_0xc446('0x16'),_0xc446('0x17')),controller[_0xc446('0x18')]);router[_0xc446('0x19')](_0xc446('0xc'),auth['isAuthenticated'](),interaction[_0xc446('0x15')](_0xc446('0x16'),_0xc446('0x1a')),controller[_0xc446('0x1b')]);router[_0xc446('0x1c')](_0xc446('0xc'),auth[_0xc446('0x8')](),interaction[_0xc446('0x15')](_0xc446('0x16'),_0xc446('0x1d')),controller['destroy']);router[_0xc446('0x1c')](_0xc446('0x14'),auth['isAuthenticated'](),controller[_0xc446('0x1e')]);module[_0xc446('0x1f')]=router;
\ No newline at end of file
+var _0x1623=['Router','fs-extra','../../components/auth/service','./whatsappInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','show','getMessages','/:id/download','download','post','create','/:id/tags','whatsapp','whatsappinteraction:addtags','addTags','tracked','whatsappinteraction:update','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0xe5742c,_0x11503e){var _0x3db329=function(_0x2afb66){while(--_0x2afb66){_0xe5742c['push'](_0xe5742c['shift']());}};_0x3db329(++_0x11503e);}(_0x1623,0xab));var _0x3162=function(_0x3e6169,_0x6b6b5c){_0x3e6169=_0x3e6169-0x0;var _0x23c868=_0x1623[_0x3e6169];return _0x23c868;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0x3162('0xe')]);router[_0x3162('0xb')](_0x3162('0xf'),auth[_0x3162('0x7')](),controller[_0x3162('0x10')]);router[_0x3162('0x11')]('/',auth[_0x3162('0x7')](),controller[_0x3162('0x12')]);router[_0x3162('0x11')]('/:id/messages',auth[_0x3162('0x7')](),controller['addMessage']);router[_0x3162('0x11')](_0x3162('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x3162('0x14'),_0x3162('0x15')),controller[_0x3162('0x16')]);router['put'](_0x3162('0xc'),auth[_0x3162('0x7')](),interaction[_0x3162('0x17')]('whatsapp',_0x3162('0x18')),controller[_0x3162('0x19')]);router[_0x3162('0x1a')](_0x3162('0xc'),auth[_0x3162('0x7')](),interaction[_0x3162('0x17')](_0x3162('0x14'),'whatsappinteraction:destroy'),controller[_0x3162('0x1b')]);router[_0x3162('0x1a')](_0x3162('0x13'),auth[_0x3162('0x7')](),controller['removeTags']);module[_0x3162('0x1c')]=router;
\ No newline at end of file
index 8509129..713a2c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9879=['sequelize','moment','exports','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x46aaaa,_0x3af897){var _0x26d04e=function(_0x4373ba){while(--_0x4373ba){_0x46aaaa['push'](_0x46aaaa['shift']());}};_0x26d04e(++_0x3af897);}(_0x9879,0x98));var _0x9987=function(_0x5299f3,_0x48c4a1){_0x5299f3=_0x5299f3-0x0;var _0x48c78a=_0x9879[_0x5299f3];return _0x48c78a;};'use strict';var Sequelize=require(_0x9987('0x0'));var moment=require(_0x9987('0x1'));module[_0x9987('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9987('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9987('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9987('0x4')]},'note':{'type':Sequelize[_0x9987('0x4')]},'phone':{'type':Sequelize[_0x9987('0x4')]},'read1stAt':{'type':Sequelize[_0x9987('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9987('0x5')]('in',_0x9987('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9987('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9987('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x56da=['out','sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x1ccdd2,_0x45f481){var _0x3fa950=function(_0x2cb5a5){while(--_0x2cb5a5){_0x1ccdd2['push'](_0x1ccdd2['shift']());}};_0x3fa950(++_0x45f481);}(_0x56da,0x119));var _0xa56d=function(_0x54da5b,_0x12fd71){_0x54da5b=_0x54da5b-0x0;var _0x285d3b=_0x56da[_0x54da5b];return _0x285d3b;};'use strict';var Sequelize=require(_0xa56d('0x0'));var moment=require('moment');module[_0xa56d('0x1')]={'closed':{'type':Sequelize[_0xa56d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa56d('0x3')]},'secondDisposition':{'type':Sequelize[_0xa56d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa56d('0x3')]},'note':{'type':Sequelize[_0xa56d('0x3')]},'phone':{'type':Sequelize[_0xa56d('0x3')]},'read1stAt':{'type':Sequelize[_0xa56d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xa56d('0x5')]('in',_0xa56d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa56d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xa56d('0x5')]('in',_0xa56d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index a2c2ac4..835ae9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66e5=['map','WhatsappInteraction','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','color','from','select','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','i.WhatsappAccountId\x20IN\x20?','concat','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','having','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','isEmpty','i.WhatsappAccountId\x20IS\x20NULL','WhatsappAccountId','toString','sequelize','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','c.firstName','Contact.firstName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','merge','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','WhatsappInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','whatsappInteractionTags:save','removeTags','download','root','server','files','join','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.ejs','.pdf','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','end','sendStatus','name','send','Users','fullname','TagIds','split','Tags','push','catch','index'];(function(_0x20e4a7,_0x44787f){var _0x5108e3=function(_0x24cb05){while(--_0x24cb05){_0x20e4a7['push'](_0x20e4a7['shift']());}};_0x5108e3(++_0x44787f);}(_0x66e5,0x1a2));var _0x566e=function(_0x3fa933,_0x190a6d){_0x3fa933=_0x3fa933-0x0;var _0x52846d=_0x66e5[_0x3fa933];return _0x52846d;};'use strict';var emlformat=require(_0x566e('0x0'));var rimraf=require(_0x566e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x566e('0x2'));var rp=require('request-promise');var moment=require(_0x566e('0x3'));var BPromise=require(_0x566e('0x4'));var Mustache=require(_0x566e('0x5'));var util=require(_0x566e('0x6'));var path=require(_0x566e('0x7'));var sox=require('sox');var csv=require(_0x566e('0x8'));var ejs=require(_0x566e('0x9'));var fs=require('fs');var fs_extra=require(_0x566e('0xa'));var _=require(_0x566e('0xb'));var squel=require(_0x566e('0xc'));var crypto=require(_0x566e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x566e('0xe'));var toCsv=require(_0x566e('0x8'));var querystring=require(_0x566e('0xf'));var Papa=require('papaparse');var Redis=require(_0x566e('0x10'));var authService=require(_0x566e('0x11'));var qs=require(_0x566e('0x12'));var as=require(_0x566e('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x566e('0x14'));var utils=require(_0x566e('0x15'));var config=require(_0x566e('0x16'));var licenseUtil=require(_0x566e('0x17'));var db=require(_0x566e('0x18'))['db'];config[_0x566e('0x19')]=_['defaults'](config['redis'],{'host':_0x566e('0x1a'),'port':0x18eb});var socket=require(_0x566e('0x1b'))(new Redis(config[_0x566e('0x19')]));require('./whatsappInteraction.socket')[_0x566e('0x1c')](socket);function respondWithStatusCode(_0x2a44e8,_0x50300c){_0x50300c=_0x50300c||0xcc;return function(_0x141f07){if(_0x141f07){return _0x2a44e8['sendStatus'](_0x50300c);}return _0x2a44e8[_0x566e('0x1d')](_0x50300c)['end']();};}function respondWithResult(_0x3ae804,_0xdb7230){_0xdb7230=_0xdb7230||0xc8;return function(_0x35ebcb){if(_0x35ebcb){return _0x3ae804[_0x566e('0x1d')](_0xdb7230)[_0x566e('0x1e')](_0x35ebcb);}};}function respondWithFilteredResult(_0x53323a,_0x214496){return function(_0x177a2b){if(_0x177a2b){var _0x1290cc=typeof _0x214496[_0x566e('0x1f')]===_0x566e('0x20')&&typeof _0x214496[_0x566e('0x21')]==='undefined';var _0x34f0ed=_0x177a2b[_0x566e('0x22')];var _0x38d936=_0x1290cc?0x0:_0x214496['offset'];var _0x17ae78=_0x1290cc?_0x177a2b[_0x566e('0x22')]:_0x214496[_0x566e('0x1f')]+_0x214496[_0x566e('0x21')];var _0x47074e;if(_0x17ae78>=_0x34f0ed){_0x17ae78=_0x34f0ed;_0x47074e=0xc8;}else{_0x47074e=0xce;}_0x53323a[_0x566e('0x1d')](_0x47074e);return _0x53323a['set'](_0x566e('0x23'),_0x38d936+'-'+_0x17ae78+'/'+_0x34f0ed)[_0x566e('0x1e')](_0x177a2b);}return null;};}function patchUpdates(_0xc2122f){return function(_0x556c2d){try{jsonpatch['apply'](_0x556c2d,_0xc2122f,!![]);}catch(_0x1fea0b){return BPromise['reject'](_0x1fea0b);}return _0x556c2d[_0x566e('0x24')]();};}function saveUpdates(_0x316f69,_0x36a9ea){return function(_0x4c731f){if(_0x4c731f){return _0x4c731f[_0x566e('0x25')](_0x316f69)['then'](function(_0xcf1888){return _0xcf1888;});}return null;};}function removeEntity(_0x4d4200,_0x46b72c){return function(_0x347ce1){if(_0x347ce1){return _0x347ce1[_0x566e('0x26')]()[_0x566e('0x27')](function(){_0x4d4200[_0x566e('0x1d')](0xcc)[_0x566e('0x28')]();});}};}function handleEntityNotFound(_0x29c8bb,_0x20605b){return function(_0x1546f2){if(!_0x1546f2){_0x29c8bb[_0x566e('0x29')](0x194);}return _0x1546f2;};}function handleError(_0x56f93e,_0x31e4ea){_0x31e4ea=_0x31e4ea||0x1f4;return function(_0x523dc4){logger['error'](_0x523dc4['stack']);if(_0x523dc4[_0x566e('0x2a')]){delete _0x523dc4[_0x566e('0x2a')];}_0x56f93e['status'](_0x31e4ea)[_0x566e('0x2b')](_0x523dc4);};}function getInteractionUsers(_0x5935fc,_0xda9961){return new BPromise(function(_0x1fd4ea,_0x453f5e){try{if(_0xda9961[_0x5935fc['id']]){_0x5935fc[_0x566e('0x2c')]=_['map'](_0xda9961[_0x5935fc['id']],function(_0x17072c){return{'id':_0x17072c['id'],'fullname':_0x17072c[_0x566e('0x2d')]};});}}catch(_0x13782d){_0x453f5e(_0x13782d);}_0x1fd4ea(_0x5935fc);});}function getInteractionTags(_0x2df0c5,_0x8da128){return new BPromise(function(_0x4b75a2,_0x4048f3){try{if(_0x2df0c5[_0x566e('0x2e')]){_0x2df0c5['Tags']=[];_0x2df0c5[_0x566e('0x2e')][_0x566e('0x2f')](',')['forEach'](function(_0x4b9c40){_0x2df0c5[_0x566e('0x30')][_0x566e('0x31')](_0x8da128[_0x4b9c40]);});}delete _0x2df0c5[_0x566e('0x2e')];}catch(_0x27844f){_0x4048f3(_0x27844f);}_0x4b75a2(_0x2df0c5);});}function updateWhatsappInteraction(_0x5e7f78,_0x166d95,_0x416b3a){return new BPromise(function(_0x420139,_0x449ffa){return getInteractionUsers(_0x5e7f78,_0x416b3a)['then'](function(_0xffeda5){return getInteractionTags(_0xffeda5,_0x166d95);})[_0x566e('0x27')](function(_0x43c1fb){_0x420139(_0x43c1fb);})[_0x566e('0x32')](function(_0x15ee39){_0x449ffa(_0x15ee39);});});}exports[_0x566e('0x33')]=function(_0x3b7b12,_0x150ffc){var _0x3d676e={},_0x1389ce={},_0x57f3c3={'count':0x0,'rows':[]};var _0x55f7a9=_[_0x566e('0x34')](db[_0x566e('0x35')][_0x566e('0x36')],function(_0x5eae25){return{'name':_0x5eae25[_0x566e('0x37')],'type':_0x5eae25[_0x566e('0x38')]['key']};});_0x1389ce['model']=_[_0x566e('0x34')](_0x55f7a9,_0x566e('0x2a'));_0x1389ce[_0x566e('0x39')]=_['keys'](_0x3b7b12[_0x566e('0x39')]);_0x1389ce[_0x566e('0x3a')]=_[_0x566e('0x3b')](_0x1389ce[_0x566e('0x3c')],_0x1389ce[_0x566e('0x39')]);_0x3d676e[_0x566e('0x3d')]=_[_0x566e('0x3b')](_0x1389ce[_0x566e('0x3c')],qs[_0x566e('0x3e')](_0x3b7b12['query'][_0x566e('0x3e')]));_0x3d676e['attributes']=_0x3d676e[_0x566e('0x3d')][_0x566e('0x3f')]?_0x3d676e[_0x566e('0x3d')]:_0x1389ce[_0x566e('0x3c')];if(!_0x3b7b12['query'][_0x566e('0x40')](_0x566e('0x41'))){_0x3d676e[_0x566e('0x21')]=qs[_0x566e('0x21')](_0x3b7b12['query']['limit']);_0x3d676e[_0x566e('0x1f')]=qs[_0x566e('0x1f')](_0x3b7b12[_0x566e('0x39')]['offset']);}_0x3d676e['order']=qs['sort'](_0x3b7b12[_0x566e('0x39')][_0x566e('0x42')]);_0x3d676e[_0x566e('0x43')]=qs[_0x566e('0x3a')](_[_0x566e('0x44')](_0x3b7b12[_0x566e('0x39')],_0x1389ce[_0x566e('0x3a')]),_0x55f7a9);var _0x1b9f4c=[];var _0x2069d2=squel['select']()['field']('id')[_0x566e('0x45')](_0x566e('0x2a'))['field'](_0x566e('0x46'))[_0x566e('0x47')]('tools_tags');var _0x1deac8=squel[_0x566e('0x48')]()[_0x566e('0x45')]('u.id')[_0x566e('0x45')]('u.fullname')[_0x566e('0x45')]('ui.WhatsappInteractionId')[_0x566e('0x47')]('user_has_whatsapp_interactions','ui')['left_join'](_0x566e('0x49'),'u',_0x566e('0x4a'));var _0x44d76c=squel[_0x566e('0x48')]()[_0x566e('0x47')](_0x566e('0x4b'),'i')['left_join']('cm_contacts','c',_0x566e('0x4c'))[_0x566e('0x4d')](_0x566e('0x49'),'o',_0x566e('0x4e'))[_0x566e('0x4d')](_0x566e('0x4f'),'a',_0x566e('0x50'))[_0x566e('0x4d')](_0x566e('0x51'),'me',_0x566e('0x52'))[_0x566e('0x4d')](_0x566e('0x53'),'it',_0x566e('0x54'))[_0x566e('0x4d')](_0x566e('0x55'),'t',_0x566e('0x56'));var _0x4e2bea=squel[_0x566e('0x57')]();var _0x1ad6c0=[];var _0x47577e=squel[_0x566e('0x57')]();var _0x28f8c2;if(_0x3b7b12[_0x566e('0x39')]['search']){_0x28f8c2=as['parseSearch'](_0x3b7b12[_0x566e('0x39')][_0x566e('0x58')]);var _0x29ab83=_0x28f8c2[_0x566e('0x59')];for(var _0x1ca2a0=0x0;_0x1ca2a0<_0x28f8c2[_0x566e('0x5a')][_0x566e('0x3f')];_0x1ca2a0++){var _0x3c1e71=_0x28f8c2[_0x566e('0x5a')][_0x1ca2a0];var _0xb8ef53='i';var _0x259dfe=_[_0x566e('0x5b')](_0x55f7a9,[_0x566e('0x2a'),_0x3c1e71[_0x566e('0x45')]]);if(!_0x259dfe){switch(_0x3c1e71[_0x566e('0x45')]){case _0x566e('0x5c'):if(_0x3c1e71[_0x566e('0x5d')]==0x1){_0x44d76c['having']('`'+_0x3c1e71[_0x566e('0x45')]+_0x566e('0x5e'));}else{_0x44d76c['having']('`'+_0x3c1e71[_0x566e('0x45')]+_0x566e('0x5f'));}break;case _0x566e('0x60'):if(_0x3c1e71[_0x566e('0x61')]==='$substring'){if(_0x3c1e71[_0x566e('0x5d')]['split']('\x20')[_0x566e('0x3f')]>0x1){_0x4e2bea[_0x29ab83]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x3c1e71['value']),null);}else{var _0x1f0c62='%'+_0x3c1e71['value']+'%';_0x4e2bea[_0x29ab83](_0x566e('0x62'),_0x1f0c62,_0x1f0c62,_0x1f0c62);}}else{_0x259dfe=_[_0x566e('0x5b')](_0x55f7a9,[_0x566e('0x2a'),_0x566e('0x63')]);_0x3c1e71['field']=_0x566e('0x63');_0x3198f6=as[_0x566e('0x64')](_0xb8ef53,_0x259dfe[_0x566e('0x38')],_0x3c1e71);_0x4e2bea[_0x29ab83](_0x3198f6[_0x566e('0x65')],_0x3198f6[_0x566e('0x5d')][_0x566e('0x66')],_0x3198f6[_0x566e('0x5d')][_0x566e('0x28')]);}break;case _0x566e('0x67'):var _0x3ec4d7=_0x3c1e71[_0x566e('0x5d')]['split'](',')[_0x566e('0x34')](function(_0x2aa1ff){return Number(_0x2aa1ff);});_0x3ec4d7[_0x566e('0x68')](function(_0x58dfcb){_0x47577e['or'](_0x566e('0x69'),'%,'+_0x58dfcb+',%');});_0x1ad6c0=_[_0x566e('0x6a')](_0x1ad6c0,_0x3ec4d7);break;case _0x566e('0x6b'):if(_0x3c1e71[_0x566e('0x61')]===_0x566e('0x6c')){_0x4e2bea[_0x29ab83](_0x566e('0x6d'),'%'+_0x3c1e71[_0x566e('0x5d')]+'%',null);}else{_0x259dfe=_['find'](_0x55f7a9,[_0x566e('0x2a'),_0x566e('0x6e')]);_0x3c1e71[_0x566e('0x45')]=_0x566e('0x6e');_0x3198f6=as['buildExpression'](_0xb8ef53,_0x259dfe[_0x566e('0x38')],_0x3c1e71);_0x4e2bea[_0x29ab83](_0x3198f6[_0x566e('0x65')],_0x3198f6[_0x566e('0x5d')][_0x566e('0x66')],_0x3198f6['value'][_0x566e('0x28')]);}break;case _0x566e('0x6f'):_0x3198f6=as[_0x566e('0x64')]('me',null,_0x3c1e71);_0x4e2bea[_0x29ab83](_0x3198f6[_0x566e('0x65')],_0x3198f6[_0x566e('0x5d')][_0x566e('0x66')],_0x3198f6['value'][_0x566e('0x28')]);break;}}else{var _0x3198f6=as[_0x566e('0x64')](_0xb8ef53,_0x259dfe['type'],_0x3c1e71);_0x4e2bea[_0x29ab83](_0x3198f6[_0x566e('0x65')],_0x3198f6['value']['start'],_0x3198f6[_0x566e('0x5d')][_0x566e('0x28')]);}}}else{var _0x3c4af6=_(_0x3b7b12[_0x566e('0x39')])[_0x566e('0x70')]()[_0x566e('0x34')](function(_0x405f7e){return _[_0x566e('0x71')](_0x55f7a9,[_0x566e('0x2a'),_0x405f7e])?_0x405f7e:undefined;})[_0x566e('0x72')]()[_0x566e('0x5d')]();if(!_['isEmpty'](_0x3c4af6)){_0x3c4af6['forEach'](function(_0x12ef81){if(_0x12ef81==='WhatsappAccountId'){_0x44d76c['where'](_0x566e('0x73'),[][_0x566e('0x74')](_0x3b7b12[_0x566e('0x39')][_0x12ef81]));}else if(_0x12ef81==='createdAt'){var _0x2dbb40=JSON[_0x566e('0x75')](_0x3b7b12[_0x566e('0x39')][_0x12ef81])[_0x566e('0x76')];var _0xa859cf=JSON['parse'](_0x3b7b12['query'][_0x12ef81])['$lte'];_0x44d76c[_0x566e('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2dbb40,_0xa859cf);}else{if(_0x3b7b12[_0x566e('0x39')][_0x12ef81]===_0x566e('0x77')){_0x44d76c[_0x566e('0x43')]('i.'+_0x12ef81+_0x566e('0x78'));}else{_0x44d76c[_0x566e('0x43')]('i.'+_0x12ef81+_0x566e('0x79'),_0x3b7b12[_0x566e('0x39')][_0x12ef81]);}}});}if(_0x3b7b12[_0x566e('0x39')]['read']){if(_0x3b7b12[_0x566e('0x39')]['read']==0x1){_0x44d76c[_0x566e('0x7a')]('`unreadMessages`\x20=\x200');}else{_0x44d76c[_0x566e('0x7a')](_0x566e('0x7b'));}}if(_0x3b7b12[_0x566e('0x39')][_0x566e('0x7c')]){_0x1ad6c0=_['isArray'](_0x3b7b12[_0x566e('0x39')]['tag'])?_0x3b7b12[_0x566e('0x39')]['tag']:new Array(_0x3b7b12[_0x566e('0x39')][_0x566e('0x7c')]);_0x1ad6c0['forEach'](function(_0x537dff){_0x47577e['or'](_0x566e('0x69'),'%,'+_0x537dff+',%');});}if(_0x3b7b12[_0x566e('0x39')][_0x566e('0x7d')]){var _0x525d93=_0x3b7b12['query'][_0x566e('0x7d')][_0x566e('0x7e')]('\x5c','\x5c\x5c')[_0x566e('0x7e')](/'/g,'\x27\x27');if(qs[_0x566e('0x7f')](_0x525d93)){_0x4e2bea['or'](_0x566e('0x80'),_0x525d93+'%')['or'](_0x566e('0x81'),_0x525d93+'%');}else{_0x4e2bea['or'](_0x566e('0x82'),qs['getFullTextValue'](_0x525d93))['or'](_0x566e('0x83'),_0x525d93+'%');}}}_0x44d76c[_0x566e('0x43')](_0x4e2bea);_0x44d76c[_0x566e('0x84')](_0x566e('0x85'));var _0x4fa4f6={'type':db['Sequelize'][_0x566e('0x86')][_0x566e('0x87')],'raw':!![]};var _0x573e1c=_0x44d76c['clone']();_0x573e1c[_0x566e('0x45')](_0x566e('0x85'));_0x573e1c['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x566e('0x5c'));if(_0x3d676e[_0x566e('0x88')]){_0x3d676e['order'][_0x566e('0x68')](function(_0x30eae2){var _0x19f2a7=_0x30eae2[0x0]===_0x566e('0x89')?_0x30eae2[0x0]:'i.'+_0x30eae2[0x0];_0x44d76c[_0x566e('0x88')](_0x19f2a7,_0x30eae2[0x1]===_0x566e('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x1ad6c0)){_0x44d76c[_0x566e('0x7a')](_0x47577e);_0x573e1c[_0x566e('0x43')](_0x566e('0x8b'),_0x1ad6c0);}BPromise[_0x566e('0x8c')]()['then'](function(){if(!_0x28f8c2){if(_0x3b7b12[_0x566e('0x39')]['WhatsappAccountId'])return;_0x573e1c[_0x566e('0x43')](_0x566e('0x8d'));_0x44d76c[_0x566e('0x43')](_0x566e('0x8d'));return;}if(_0x3b7b12['user'][_0x566e('0x8e')]!==_0x566e('0x8f'))return;return _0x3b7b12[_0x566e('0x90')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x566e('0x27')](function(_0x7b4e1a){if(_[_0x566e('0x91')](_0x7b4e1a)){_0x573e1c[_0x566e('0x43')](_0x566e('0x92'));_0x44d76c['where']('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x573e1c[_0x566e('0x43')](_0x566e('0x73'),_[_0x566e('0x34')](_0x7b4e1a,'id'));_0x44d76c[_0x566e('0x43')](_0x566e('0x73'),_['map'](_0x7b4e1a,'id'));}});})['then'](function(){if(_0x3b7b12[_0x566e('0x90')]['role']===_0x566e('0x8f')&&!_0x28f8c2&&!_0x3b7b12[_0x566e('0x39')][_0x566e('0x93')])return[];return db['sequelize'][_0x566e('0x39')](_0x573e1c[_0x566e('0x94')](),_0x4fa4f6);})[_0x566e('0x27')](function(_0x349284){_0x57f3c3[_0x566e('0x22')]=_0x349284[_0x566e('0x3f')];if(_0x57f3c3['count']===0x0)return[];return db[_0x566e('0x95')][_0x566e('0x39')](_0x2069d2[_0x566e('0x94')](),_0x4fa4f6)['then'](function(_0x98794b){_0x1b9f4c=_[_0x566e('0x96')](_0x98794b,'id');_0x4fa4f6=_['merge'](_0x4fa4f6,{'model':db[_0x566e('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3b7b12['query'][_0x566e('0x3e')]){_0x3d676e['attributes'][_0x566e('0x68')](function(_0x173e7d){_0x44d76c[_0x566e('0x45')]('i.'+_0x173e7d);});}else{_0x44d76c[_0x566e('0x45')](_0x566e('0x97'),_0x566e('0x5c'));_0x44d76c['field'](_0x566e('0x98'),_0x566e('0x99'));_0x44d76c[_0x566e('0x45')]('a.mandatoryDisposition',_0x566e('0x9a'));_0x44d76c[_0x566e('0x45')](_0x566e('0x9b'),'contactName');_0x44d76c['field']('i.*');_0x44d76c[_0x566e('0x45')](_0x566e('0x9c'),_0x566e('0x9d'));_0x44d76c['field']('c.lastName','Contact.lastName');_0x44d76c[_0x566e('0x45')]('c.email',_0x566e('0x9e'));_0x44d76c[_0x566e('0x45')](_0x566e('0x9f'),_0x566e('0xa0'));_0x44d76c[_0x566e('0x45')](_0x566e('0xa1'),_0x566e('0xa2'));_0x44d76c[_0x566e('0x45')](_0x566e('0xa3'),_0x566e('0xa4'));_0x44d76c[_0x566e('0x45')](_0x566e('0xa5'),_0x566e('0xa6'));_0x44d76c[_0x566e('0x45')](_0x566e('0xa7'),'Owner.internal');_0x44d76c[_0x566e('0x45')](_0x566e('0xa8'),'TagIds');}if(_0x3d676e[_0x566e('0x21')])_0x44d76c[_0x566e('0x21')](_0x3d676e[_0x566e('0x21')]);if(_0x3d676e[_0x566e('0x1f')])_0x44d76c[_0x566e('0x1f')](_0x3d676e[_0x566e('0x1f')]);return db[_0x566e('0x95')][_0x566e('0x39')](_0x44d76c[_0x566e('0x94')](),_0x4fa4f6);})[_0x566e('0x27')](function(_0x59b61b){if(_0x59b61b[_0x566e('0x3f')]>0x0)_0x1deac8[_0x566e('0x43')](_0x566e('0xa9'),_[_0x566e('0x34')](_0x59b61b,'id'));return db[_0x566e('0x95')][_0x566e('0x39')](_0x1deac8[_0x566e('0x94')](),_0x4fa4f6)['then'](function(_0x57b6fe){var _0x3df5cb=_[_0x566e('0xaa')](_0x57b6fe,'WhatsappInteractionId');var _0xbc137e=[];_0x59b61b[_0x566e('0x68')](function(_0x4c7cd5){_0xbc137e[_0x566e('0x31')](updateWhatsappInteraction(_0x4c7cd5,_0x1b9f4c,_0x3df5cb));});return BPromise[_0x566e('0xab')](_0xbc137e);});});})[_0x566e('0x27')](function(_0x40abc0){_0x57f3c3[_0x566e('0xac')]=_0x40abc0;return _0x57f3c3;})[_0x566e('0x27')](respondWithFilteredResult(_0x150ffc,_0x3d676e))[_0x566e('0x32')](handleError(_0x150ffc,null));};exports[_0x566e('0xad')]=function(_0x4ff032,_0x2fda9c){var _0x43f177={'raw':![],'where':{'id':_0x4ff032[_0x566e('0xae')]['id']}},_0x23ce51={};_0x23ce51[_0x566e('0x3c')]=_[_0x566e('0x70')](db[_0x566e('0x35')][_0x566e('0x36')]);_0x23ce51[_0x566e('0x39')]=_[_0x566e('0x70')](_0x4ff032[_0x566e('0x39')]);_0x23ce51[_0x566e('0x3a')]=_[_0x566e('0x3b')](_0x23ce51[_0x566e('0x3c')],_0x23ce51[_0x566e('0x39')]);_0x43f177[_0x566e('0x3d')]=_[_0x566e('0x3b')](_0x23ce51[_0x566e('0x3c')],qs[_0x566e('0x3e')](_0x4ff032[_0x566e('0x39')]['fields']));_0x43f177[_0x566e('0x3d')]=_0x43f177[_0x566e('0x3d')][_0x566e('0x3f')]?_0x43f177[_0x566e('0x3d')]:_0x23ce51[_0x566e('0x3c')];if(_0x4ff032[_0x566e('0x39')][_0x566e('0xaf')]){_0x43f177[_0x566e('0xb0')]=[{'all':!![]}];}_0x43f177=_[_0x566e('0xb1')]({},_0x43f177,_0x4ff032[_0x566e('0xb2')]);return db[_0x566e('0x35')][_0x566e('0x5b')](_0x43f177)[_0x566e('0x27')](handleEntityNotFound(_0x2fda9c,null))[_0x566e('0x27')](respondWithResult(_0x2fda9c,null))[_0x566e('0x32')](handleError(_0x2fda9c,null));};exports['create']=function(_0x486423,_0x1e09fd){return db['WhatsappInteraction'][_0x566e('0xb3')](_0x486423[_0x566e('0x6f')],{})[_0x566e('0x27')](respondWithResult(_0x1e09fd,0xc9))[_0x566e('0x32')](handleError(_0x1e09fd,null));};exports[_0x566e('0x25')]=function(_0x26e1cc,_0x5193b6){if(_0x26e1cc[_0x566e('0x6f')]['id']){delete _0x26e1cc[_0x566e('0x6f')]['id'];}return db[_0x566e('0x35')][_0x566e('0x5b')]({'where':{'id':_0x26e1cc[_0x566e('0xae')]['id']}})[_0x566e('0x27')](handleEntityNotFound(_0x5193b6,null))[_0x566e('0x27')](saveUpdates(_0x26e1cc[_0x566e('0x6f')],null))[_0x566e('0x27')](respondWithResult(_0x5193b6,null))[_0x566e('0x32')](handleError(_0x5193b6,null));};exports[_0x566e('0x26')]=function(_0x38965f,_0x5891b5){return db[_0x566e('0x35')][_0x566e('0x5b')]({'where':{'id':_0x38965f[_0x566e('0xae')]['id']}})[_0x566e('0x27')](handleEntityNotFound(_0x5891b5,null))[_0x566e('0x27')](removeEntity(_0x5891b5,null))['catch'](handleError(_0x5891b5,null));};exports['describe']=function(_0x3f7ade,_0x569d2a){return db[_0x566e('0x35')][_0x566e('0xb4')]()[_0x566e('0x27')](respondWithResult(_0x569d2a,null))[_0x566e('0x32')](handleError(_0x569d2a,null));};exports[_0x566e('0xb5')]=function(_0x34181e,_0x2db283,_0x376f1a){return db[_0x566e('0xb6')][_0x566e('0x5b')]({'where':{'id':_0x34181e[_0x566e('0xae')]['id']}})[_0x566e('0x27')](handleEntityNotFound(_0x2db283,null))[_0x566e('0x27')](function(_0x7b5c74){if(_0x7b5c74){return _0x7b5c74['addMessage'](_0x34181e[_0x566e('0x6f')][_0x566e('0xb7')],_[_0x566e('0xb8')](_0x34181e['body'],[_0x566e('0xb7'),'id'])||{});}})[_0x566e('0x27')](respondWithResult(_0x2db283,null))[_0x566e('0x32')](handleError(_0x2db283,null));};exports[_0x566e('0xb9')]=function(_0x449657,_0x2578f0,_0x1fb05f){var _0x587052={'raw':![],'where':{}};var _0x5bd01c={};var _0x2e35c2={'count':0x0,'rows':[]};return db[_0x566e('0x35')][_0x566e('0xba')]({'where':{'id':_0x449657[_0x566e('0xae')]['id']}})['then'](handleEntityNotFound(_0x2578f0,null))[_0x566e('0x27')](function(_0x5b8865){if(_0x5b8865){_0x5bd01c['model']=_[_0x566e('0x70')](db['WhatsappMessage'][_0x566e('0x36')]);_0x5bd01c[_0x566e('0x39')]=_[_0x566e('0x70')](_0x449657[_0x566e('0x39')]);_0x5bd01c['filters']=_[_0x566e('0x3b')](_0x5bd01c[_0x566e('0x3c')],_0x5bd01c[_0x566e('0x39')]);_0x587052[_0x566e('0x3d')]=_['intersection'](_0x5bd01c[_0x566e('0x3c')],qs[_0x566e('0x3e')](_0x449657[_0x566e('0x39')]['fields']));_0x587052[_0x566e('0x3d')]=_0x587052[_0x566e('0x3d')][_0x566e('0x3f')]?_0x587052[_0x566e('0x3d')]:_0x5bd01c[_0x566e('0x3c')];if(!_0x449657['query']['hasOwnProperty']('nolimit')){_0x587052['limit']=qs[_0x566e('0x21')](_0x449657[_0x566e('0x39')]['limit']);_0x587052[_0x566e('0x1f')]=qs[_0x566e('0x1f')](_0x449657[_0x566e('0x39')][_0x566e('0x1f')]);}_0x587052[_0x566e('0x88')]=qs[_0x566e('0x42')](_0x449657[_0x566e('0x39')][_0x566e('0x42')]);_0x587052[_0x566e('0x43')]=qs[_0x566e('0x3a')](_[_0x566e('0x44')](_0x449657['query'],_0x5bd01c[_0x566e('0x3a')]));_0x587052[_0x566e('0x43')][_0x566e('0xbb')]=_0x5b8865['id'];if(_0x449657[_0x566e('0x39')][_0x566e('0x7d')]){_0x587052[_0x566e('0x43')]=_[_0x566e('0xb1')](_0x587052['where'],{'$or':_['map'](_0x587052[_0x566e('0x3d')],function(_0x3d805b){var _0x27bd87={};_0x27bd87[_0x3d805b]={'$like':'%'+_0x449657[_0x566e('0x39')][_0x566e('0x7d')]+'%'};return _0x27bd87;})});}if(_0x449657['query']['$gte']){var _0x114185=_0x449657[_0x566e('0x39')][_0x566e('0x76')][_0x566e('0x2f')](',');var _0xc3b52e={};_0xc3b52e[_0x114185[0x0]]={'$gte':moment(_0x114185[0x1])['format'](_0x566e('0xbc'))};_0x587052[_0x566e('0x43')]=_[_0x566e('0xb1')](_0x587052[_0x566e('0x43')],_0xc3b52e);}_0x587052=_[_0x566e('0xb1')]({},_0x587052,_0x449657[_0x566e('0xb2')]);return db[_0x566e('0xb6')]['count']({'where':_0x587052[_0x566e('0x43')]})[_0x566e('0x27')](function(_0x26abbe){_0x2e35c2['count']=_0x26abbe;if(_0x449657[_0x566e('0x39')][_0x566e('0xaf')]){_0x587052[_0x566e('0xb0')]=[{'all':!![]}];}return db[_0x566e('0xb6')][_0x566e('0xbd')](_0x587052);})['then'](function(_0xc15e52){_0x2e35c2[_0x566e('0xac')]=_0xc15e52;return _0x2e35c2;});}})[_0x566e('0x27')](respondWithFilteredResult(_0x2578f0,_0x587052))[_0x566e('0x32')](handleError(_0x2578f0,null));};exports[_0x566e('0xbe')]=function(_0x455746,_0x5a8fc3,_0x5d7310){return db[_0x566e('0x35')]['find']({'where':{'id':_0x455746['params']['id']}})[_0x566e('0x27')](handleEntityNotFound(_0x5a8fc3,null))[_0x566e('0x27')](function(_0x449ecc){if(_0x449ecc){return _0x449ecc[_0x566e('0xbf')](_0x455746[_0x566e('0x6f')][_0x566e('0xb7')],_[_0x566e('0xb8')](_0x455746[_0x566e('0x6f')],[_0x566e('0xb7'),'id'])||{})[_0x566e('0xc0')](function(){return db[_0x566e('0x67')][_0x566e('0xbd')]({'attributes':['id',_0x566e('0x2a'),'color'],'where':{'id':_0x455746['body']['ids']}});})['then'](function(_0x9199c0){socket['emit'](_0x566e('0xc1'),{'id':Number(_0x455746[_0x566e('0xae')]['id']),'tags':_0x9199c0||[]});return{'id':Number(_0x455746[_0x566e('0xae')]['id']),'tags':_0x9199c0||[]};});}})[_0x566e('0x27')](respondWithResult(_0x5a8fc3,null))[_0x566e('0x32')](handleError(_0x5a8fc3,null));};exports[_0x566e('0xc2')]=function(_0x56076b,_0x1dfb7d,_0x448e72){return db['WhatsappInteraction'][_0x566e('0x5b')]({'where':{'id':_0x56076b[_0x566e('0xae')]['id']}})['then'](handleEntityNotFound(_0x1dfb7d,null))['then'](function(_0x5f25fb){if(_0x5f25fb){return _0x5f25fb[_0x566e('0xc2')](_0x56076b[_0x566e('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x1dfb7d,null))[_0x566e('0x32')](handleError(_0x1dfb7d,null));};exports[_0x566e('0xc3')]=function(_0x5730da,_0x1267ba){var _0x3ef23f=moment()['unix']()['toString']();var _0x5216f8=path['join'](config[_0x566e('0xc4')],_0x566e('0xc5'),_0x566e('0xc6'),'tmp');var _0x5e7dae=path[_0x566e('0xc7')](config[_0x566e('0xc4')],_0x566e('0xc5'),_0x566e('0xc6'),_0x566e('0xc8'));var _0xf7184d=path[_0x566e('0xc7')](_0x5216f8,_0x3ef23f);var _0x353da1=util[_0x566e('0xc9')](_0x566e('0xca'),_0x5730da[_0x566e('0xae')]['id'],_0x3ef23f);var _0x45b009=path[_0x566e('0xc7')](_0x5216f8,_0x353da1);var _0x4fc216=[];_0x4fc216[_0x566e('0x31')]({'model':db['User'],'as':'User','attributes':['id',_0x566e('0x2d')],'raw':!![]});_0x4fc216['push']({'model':db[_0x566e('0xcb')],'as':'Contact','attributes':['id',_0x566e('0xcc'),_0x566e('0xcd')],'raw':!![]});if(_0x5730da['query'][_0x566e('0xc8')]){_0x4fc216['push']({'model':db[_0x566e('0xce')],'as':_0x566e('0xce'),'raw':!![]});}var _0x40e8ad=[{'model':db[_0x566e('0xb6')],'as':_0x566e('0xcf'),'attributes':['id',_0x566e('0x6f'),_0x566e('0xd0'),_0x566e('0xd1'),_0x566e('0xd2'),_0x566e('0xd3')],'include':_0x4fc216}];_0x40e8ad[_0x566e('0x31')]({'model':db[_0x566e('0xd4')],'as':_0x566e('0xd5'),'attributes':['id',_0x566e('0x2a')]});_0x40e8ad[_0x566e('0x31')]({'model':db[_0x566e('0x6b')],'as':_0x566e('0xd6'),'attributes':['id',_0x566e('0x2d')]});return db[_0x566e('0x35')][_0x566e('0x5b')]({'where':{'id':_0x5730da[_0x566e('0xae')]['id']},'include':_0x40e8ad})[_0x566e('0x27')](handleEntityNotFound(_0x1267ba,null))[_0x566e('0x27')](function(_0x2af092){if(_0x2af092){var _0x3e2b7e=_0x2af092[_0x566e('0xd7')]({'plain':!![]});fs[_0x566e('0xd8')](_0xf7184d);var _0x9a5705={'channel':_0x566e('0xd9'),'account':_0x3e2b7e[_0x566e('0xd5')]['name'],'agent':_0x3e2b7e[_0x566e('0xd6')]?_0x3e2b7e['Owner'][_0x566e('0x2d')]:_0x566e('0xda'),'createdAt':moment(_0x3e2b7e['createdAt'])[_0x566e('0xc9')](_0x566e('0xbc'))['toString'](),'closedAt':_0x3e2b7e[_0x566e('0xdb')]?moment(_0x3e2b7e[_0x566e('0xdc')])[_0x566e('0xc9')](_0x566e('0xbc'))['toString']():'','disposition':_0x3e2b7e[_0x566e('0xdd')],'messages':_(_0x3e2b7e[_0x566e('0xcf')])[_0x566e('0x7d')]({'secret':![]})[_0x566e('0x34')](function(_0x5b9345){if(_0x5b9345[_0x566e('0xce')]){var _0x3223c5=path[_0x566e('0xc7')](_0x5e7dae,_0x5b9345[_0x566e('0xce')][_0x566e('0xde')]);if(fs[_0x566e('0xdf')](_0x3223c5)){fs[_0x566e('0xe0')](_0x3223c5)[_0x566e('0xe1')](fs['createWriteStream'](path['join'](_0xf7184d,_0x5b9345[_0x566e('0xce')][_0x566e('0xde')])));}}return{'date':moment(_0x5b9345['createdAt'])[_0x566e('0xc9')](_0x566e('0xbc'))[_0x566e('0x94')](),'sender':_0x5b9345[_0x566e('0xd1')]===_0x566e('0xe2')?_0x5b9345[_0x566e('0x6b')]?_0x5b9345[_0x566e('0x6b')][_0x566e('0x2d')]:_0x566e('0xe3'):_0x5b9345[_0x566e('0x60')][_0x566e('0xcc')]+(_0x5b9345['Contact'][_0x566e('0xcd')]?'\x20'+_0x5b9345[_0x566e('0x60')][_0x566e('0xcd')]:''),'body':_0x5b9345['Attachment']?_0x5b9345[_0x566e('0xce')][_0x566e('0xde')]:_0x5b9345[_0x566e('0x6f')],'direction':_0x5b9345[_0x566e('0xd1')]===_0x566e('0xe2')?'A':'C','secret':_0x5b9345[_0x566e('0xd2')],'read':_0x5b9345[_0x566e('0xd3')],'attachment':_0x5b9345[_0x566e('0xce')]};})['value']()};return ejs[_0x566e('0xe4')](path[_0x566e('0xc7')](config[_0x566e('0xc4')],_0x566e('0xc5'),_0x566e('0xe5'),_0x566e('0xe6')),{'interaction':_0x9a5705})[_0x566e('0x27')](function(_0x2b50d0){var _0x120da0=path[_0x566e('0xc7')](_0xf7184d,'transcript-'+_0x3e2b7e['id']+'-'+_0x3ef23f+_0x566e('0xe7'));var _0x51de8a={'path':_0x120da0,'channel':_0x566e('0xd9'),'interactionId':_0x3e2b7e['id']};return pdf['createPdfFromHTML'](_0x2b50d0,_0x51de8a);})[_0x566e('0x27')](function(){return new BPromise(function(_0x2279ab,_0xce85e){zipdir(_0xf7184d,{'saveTo':_0x45b009},function(_0x145a7c,_0x2cf3d1){if(_0x145a7c)return _0xce85e(_0x145a7c);return _0x2279ab(_0x2cf3d1);});})['then'](function(){return new BPromise(function(_0x951bbb,_0x5216c8){rimraf(_0xf7184d,function(_0x11c747){if(_0x11c747)_0x5216c8(_0x11c747);return _0x951bbb();});});})[_0x566e('0x27')](function(){return _0x1267ba[_0x566e('0xc3')](_0x45b009,_0x353da1,function(_0x2c705f){if(_0x2c705f){console[_0x566e('0xe8')](_0x566e('0xe9'),_0x2c705f);}else{fs[_0x566e('0xea')](_0x45b009);}});});});}else{return _0x1267ba['sendStatus'](0xc8);}})['catch'](handleError(_0x1267ba,null));};
\ No newline at end of file
+var _0xfdcb=['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','params','includeAll','options','create','describe','WhatsappMessage','addMessage','ids','omit','getMessages','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','spread','emit','whatsappInteractionTags:save','removeTags','join','root','server','files','tmp','attachments','CmContact','firstName','lastName','Attachment','Messages','secret','WhatsappAccount','Account','Owner','Whatsapp','N.A.','closed','closedAt','disposition','basename','existsSync','pipe','createWriteStream','direction','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','Users','map','fullname','TagIds','Tags','push','index','WhatsappInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','select','field','color','from','tools_tags','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','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','start','Tag','forEach','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xfdcb,0x134));var _0xbfdc=function(_0x85fbb2,_0x55d447){_0x85fbb2=_0x85fbb2-0x0;var _0x2c94e5=_0xfdcb[_0x85fbb2];return _0x2c94e5;};'use strict';var emlformat=require(_0xbfdc('0x0'));var rimraf=require(_0xbfdc('0x1'));var zipdir=require(_0xbfdc('0x2'));var jsonpatch=require(_0xbfdc('0x3'));var rp=require(_0xbfdc('0x4'));var moment=require(_0xbfdc('0x5'));var BPromise=require(_0xbfdc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbfdc('0x7'));var sox=require(_0xbfdc('0x8'));var csv=require(_0xbfdc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfdc('0xa'));var _=require(_0xbfdc('0xb'));var squel=require(_0xbfdc('0xc'));var crypto=require(_0xbfdc('0xd'));var jsforce=require(_0xbfdc('0xe'));var deskjs=require(_0xbfdc('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbfdc('0x10'));var Papa=require(_0xbfdc('0x11'));var Redis=require(_0xbfdc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbfdc('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfdc('0x14'))(_0xbfdc('0x15'));var utils=require(_0xbfdc('0x16'));var config=require(_0xbfdc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbfdc('0x18'))['db'];config['redis']=_[_0xbfdc('0x19')](config[_0xbfdc('0x1a')],{'host':_0xbfdc('0x1b'),'port':0x18eb});var socket=require(_0xbfdc('0x1c'))(new Redis(config[_0xbfdc('0x1a')]));require(_0xbfdc('0x1d'))[_0xbfdc('0x1e')](socket);function respondWithStatusCode(_0xd36279,_0x3c41e3){_0x3c41e3=_0x3c41e3||0xcc;return function(_0x569cc8){if(_0x569cc8){return _0xd36279['sendStatus'](_0x3c41e3);}return _0xd36279[_0xbfdc('0x1f')](_0x3c41e3)[_0xbfdc('0x20')]();};}function respondWithResult(_0x3753a2,_0x477a65){_0x477a65=_0x477a65||0xc8;return function(_0x15884d){if(_0x15884d){return _0x3753a2[_0xbfdc('0x1f')](_0x477a65)[_0xbfdc('0x21')](_0x15884d);}};}function respondWithFilteredResult(_0x1a6fd4,_0x437269){return function(_0x4e4457){if(_0x4e4457){var _0x527fd7=typeof _0x437269['offset']===_0xbfdc('0x22')&&typeof _0x437269['limit']==='undefined';var _0x16432b=_0x4e4457[_0xbfdc('0x23')];var _0x448a18=_0x527fd7?0x0:_0x437269[_0xbfdc('0x24')];var _0x31d8e9=_0x527fd7?_0x4e4457[_0xbfdc('0x23')]:_0x437269[_0xbfdc('0x24')]+_0x437269[_0xbfdc('0x25')];var _0x18af5c;if(_0x31d8e9>=_0x16432b){_0x31d8e9=_0x16432b;_0x18af5c=0xc8;}else{_0x18af5c=0xce;}_0x1a6fd4['status'](_0x18af5c);return _0x1a6fd4['set'](_0xbfdc('0x26'),_0x448a18+'-'+_0x31d8e9+'/'+_0x16432b)[_0xbfdc('0x21')](_0x4e4457);}return null;};}function patchUpdates(_0x1c7e2b){return function(_0x392365){try{jsonpatch[_0xbfdc('0x27')](_0x392365,_0x1c7e2b,!![]);}catch(_0x55df8a){return BPromise[_0xbfdc('0x28')](_0x55df8a);}return _0x392365[_0xbfdc('0x29')]();};}function saveUpdates(_0x42b60d,_0x136e6f){return function(_0x2b3471){if(_0x2b3471){return _0x2b3471[_0xbfdc('0x2a')](_0x42b60d)['then'](function(_0x3c10ee){return _0x3c10ee;});}return null;};}function removeEntity(_0x46049a,_0x11a7c1){return function(_0x1738f5){if(_0x1738f5){return _0x1738f5[_0xbfdc('0x2b')]()[_0xbfdc('0x2c')](function(){_0x46049a['status'](0xcc)[_0xbfdc('0x20')]();});}};}function handleEntityNotFound(_0x148f0b,_0x5dc655){return function(_0x52ed67){if(!_0x52ed67){_0x148f0b[_0xbfdc('0x2d')](0x194);}return _0x52ed67;};}function handleError(_0x2a4490,_0x104c44){_0x104c44=_0x104c44||0x1f4;return function(_0x596dd7){logger['error'](_0x596dd7[_0xbfdc('0x2e')]);if(_0x596dd7[_0xbfdc('0x2f')]){delete _0x596dd7['name'];}_0x2a4490[_0xbfdc('0x1f')](_0x104c44)[_0xbfdc('0x30')](_0x596dd7);};}function getInteractionUsers(_0x5c337b,_0x2a76bf){return new BPromise(function(_0xffcebf,_0x5729b1){try{if(_0x2a76bf[_0x5c337b['id']]){_0x5c337b[_0xbfdc('0x31')]=_[_0xbfdc('0x32')](_0x2a76bf[_0x5c337b['id']],function(_0x1ad4ca){return{'id':_0x1ad4ca['id'],'fullname':_0x1ad4ca[_0xbfdc('0x33')]};});}}catch(_0x7880d3){_0x5729b1(_0x7880d3);}_0xffcebf(_0x5c337b);});}function getInteractionTags(_0x3faf10,_0x21f8f7){return new BPromise(function(_0x66cb3e,_0x5cb773){try{if(_0x3faf10[_0xbfdc('0x34')]){_0x3faf10['Tags']=[];_0x3faf10[_0xbfdc('0x34')]['split'](',')['forEach'](function(_0x88e147){_0x3faf10[_0xbfdc('0x35')][_0xbfdc('0x36')](_0x21f8f7[_0x88e147]);});}delete _0x3faf10['TagIds'];}catch(_0x5c56ca){_0x5cb773(_0x5c56ca);}_0x66cb3e(_0x3faf10);});}function updateWhatsappInteraction(_0x491fa1,_0x379de5,_0x201828){return new BPromise(function(_0xfc5abf,_0x63127b){return getInteractionUsers(_0x491fa1,_0x201828)[_0xbfdc('0x2c')](function(_0x61ad98){return getInteractionTags(_0x61ad98,_0x379de5);})[_0xbfdc('0x2c')](function(_0x26b248){_0xfc5abf(_0x26b248);})['catch'](function(_0x509cd7){_0x63127b(_0x509cd7);});});}exports[_0xbfdc('0x37')]=function(_0x54e4e8,_0x174db6){var _0x4bc766={},_0x22a443={},_0x2f8af3={'count':0x0,'rows':[]};var _0x1f4169=_[_0xbfdc('0x32')](db[_0xbfdc('0x38')][_0xbfdc('0x39')],function(_0x326984){return{'name':_0x326984['fieldName'],'type':_0x326984[_0xbfdc('0x3a')][_0xbfdc('0x3b')]};});_0x22a443[_0xbfdc('0x3c')]=_[_0xbfdc('0x32')](_0x1f4169,_0xbfdc('0x2f'));_0x22a443[_0xbfdc('0x3d')]=_[_0xbfdc('0x3e')](_0x54e4e8['query']);_0x22a443['filters']=_[_0xbfdc('0x3f')](_0x22a443['model'],_0x22a443[_0xbfdc('0x3d')]);_0x4bc766[_0xbfdc('0x40')]=_[_0xbfdc('0x3f')](_0x22a443[_0xbfdc('0x3c')],qs[_0xbfdc('0x41')](_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x41')]));_0x4bc766[_0xbfdc('0x40')]=_0x4bc766['attributes']['length']?_0x4bc766[_0xbfdc('0x40')]:_0x22a443[_0xbfdc('0x3c')];if(!_0x54e4e8[_0xbfdc('0x3d')]['hasOwnProperty'](_0xbfdc('0x42'))){_0x4bc766['limit']=qs[_0xbfdc('0x25')](_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x25')]);_0x4bc766['offset']=qs[_0xbfdc('0x24')](_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x24')]);}_0x4bc766['order']=qs[_0xbfdc('0x43')](_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x43')]);_0x4bc766[_0xbfdc('0x44')]=qs[_0xbfdc('0x45')](_[_0xbfdc('0x46')](_0x54e4e8[_0xbfdc('0x3d')],_0x22a443[_0xbfdc('0x45')]),_0x1f4169);var _0x54d2b3=[];var _0x7ccbb3=squel[_0xbfdc('0x47')]()[_0xbfdc('0x48')]('id')[_0xbfdc('0x48')](_0xbfdc('0x2f'))['field'](_0xbfdc('0x49'))[_0xbfdc('0x4a')](_0xbfdc('0x4b'));var _0x12caab=squel[_0xbfdc('0x47')]()[_0xbfdc('0x48')]('u.id')[_0xbfdc('0x48')]('u.fullname')['field']('ui.WhatsappInteractionId')[_0xbfdc('0x4a')]('user_has_whatsapp_interactions','ui')[_0xbfdc('0x4c')](_0xbfdc('0x4d'),'u',_0xbfdc('0x4e'));var _0x38941f=squel['select']()[_0xbfdc('0x4a')](_0xbfdc('0x4f'),'i')[_0xbfdc('0x4c')](_0xbfdc('0x50'),'c',_0xbfdc('0x51'))['left_join'](_0xbfdc('0x4d'),'o',_0xbfdc('0x52'))[_0xbfdc('0x4c')]('whatsapp_accounts','a','a.id\x20=\x20i.WhatsappAccountId')['left_join'](_0xbfdc('0x53'),'me',_0xbfdc('0x54'))[_0xbfdc('0x4c')](_0xbfdc('0x55'),'it',_0xbfdc('0x56'))[_0xbfdc('0x4c')](_0xbfdc('0x4b'),'t',_0xbfdc('0x57'));var _0x2e6b1f=squel['expr']();var _0x44aeb9=[];var _0x3b7437=squel['expr']();var _0x4b8653;if(_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x58')]){_0x4b8653=as[_0xbfdc('0x59')](_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x58')]);var _0x3fb712=_0x4b8653[_0xbfdc('0x5a')];for(var _0x178eb1=0x0;_0x178eb1<_0x4b8653[_0xbfdc('0x5b')][_0xbfdc('0x5c')];_0x178eb1++){var _0x486123=_0x4b8653['conditions'][_0x178eb1];var _0x194218='i';var _0x19e2da=_['find'](_0x1f4169,[_0xbfdc('0x2f'),_0x486123[_0xbfdc('0x48')]]);if(!_0x19e2da){switch(_0x486123[_0xbfdc('0x48')]){case _0xbfdc('0x5d'):if(_0x486123[_0xbfdc('0x5e')]==0x1){_0x38941f['having']('`'+_0x486123[_0xbfdc('0x48')]+_0xbfdc('0x5f'));}else{_0x38941f[_0xbfdc('0x60')]('`'+_0x486123[_0xbfdc('0x48')]+_0xbfdc('0x61'));}break;case _0xbfdc('0x62'):if(_0x486123[_0xbfdc('0x63')]==='$substring'){if(_0x486123['value'][_0xbfdc('0x64')]('\x20')[_0xbfdc('0x5c')]>0x1){_0x2e6b1f[_0x3fb712](_0xbfdc('0x65'),qs[_0xbfdc('0x66')](_0x486123['value']),null);}else{var _0x3faa3a='%'+_0x486123[_0xbfdc('0x5e')]+'%';_0x2e6b1f[_0x3fb712](_0xbfdc('0x67'),_0x3faa3a,_0x3faa3a,_0x3faa3a);}}else{_0x19e2da=_[_0xbfdc('0x68')](_0x1f4169,[_0xbfdc('0x2f'),_0xbfdc('0x69')]);_0x486123[_0xbfdc('0x48')]=_0xbfdc('0x69');_0x217db7=as['buildExpression'](_0x194218,_0x19e2da[_0xbfdc('0x3a')],_0x486123);_0x2e6b1f[_0x3fb712](_0x217db7['text'],_0x217db7[_0xbfdc('0x5e')][_0xbfdc('0x6a')],_0x217db7[_0xbfdc('0x5e')]['end']);}break;case _0xbfdc('0x6b'):var _0x1f1112=_0x486123['value'][_0xbfdc('0x64')](',')[_0xbfdc('0x32')](function(_0x3e712d){return Number(_0x3e712d);});_0x1f1112[_0xbfdc('0x6c')](function(_0x4e8d01){_0x3b7437['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4e8d01+',%');});_0x44aeb9=_[_0xbfdc('0x6d')](_0x44aeb9,_0x1f1112);break;case _0xbfdc('0x6e'):if(_0x486123['operator']===_0xbfdc('0x6f')){_0x2e6b1f[_0x3fb712](_0xbfdc('0x70'),'%'+_0x486123['value']+'%',null);}else{_0x19e2da=_[_0xbfdc('0x68')](_0x1f4169,[_0xbfdc('0x2f'),_0xbfdc('0x71')]);_0x486123[_0xbfdc('0x48')]=_0xbfdc('0x71');_0x217db7=as['buildExpression'](_0x194218,_0x19e2da[_0xbfdc('0x3a')],_0x486123);_0x2e6b1f[_0x3fb712](_0x217db7[_0xbfdc('0x72')],_0x217db7[_0xbfdc('0x5e')][_0xbfdc('0x6a')],_0x217db7['value'][_0xbfdc('0x20')]);}break;case _0xbfdc('0x73'):_0x217db7=as['buildExpression']('me',null,_0x486123);_0x2e6b1f[_0x3fb712](_0x217db7[_0xbfdc('0x72')],_0x217db7[_0xbfdc('0x5e')][_0xbfdc('0x6a')],_0x217db7['value'][_0xbfdc('0x20')]);break;}}else{var _0x217db7=as['buildExpression'](_0x194218,_0x19e2da[_0xbfdc('0x3a')],_0x486123);_0x2e6b1f[_0x3fb712](_0x217db7[_0xbfdc('0x72')],_0x217db7['value']['start'],_0x217db7[_0xbfdc('0x5e')][_0xbfdc('0x20')]);}}}else{var _0x279155=_(_0x54e4e8[_0xbfdc('0x3d')])[_0xbfdc('0x3e')]()[_0xbfdc('0x32')](function(_0x27d925){return _[_0xbfdc('0x74')](_0x1f4169,['name',_0x27d925])?_0x27d925:undefined;})[_0xbfdc('0x75')]()[_0xbfdc('0x5e')]();if(!_[_0xbfdc('0x76')](_0x279155)){_0x279155[_0xbfdc('0x6c')](function(_0xa44fc6){if(_0xa44fc6===_0xbfdc('0x77')){_0x38941f['where'](_0xbfdc('0x78'),[][_0xbfdc('0x79')](_0x54e4e8[_0xbfdc('0x3d')][_0xa44fc6]));}else if(_0xa44fc6===_0xbfdc('0x7a')){var _0x3d4baf=JSON[_0xbfdc('0x7b')](_0x54e4e8[_0xbfdc('0x3d')][_0xa44fc6])[_0xbfdc('0x7c')];var _0x1556ed=JSON['parse'](_0x54e4e8[_0xbfdc('0x3d')][_0xa44fc6])[_0xbfdc('0x7d')];_0x38941f[_0xbfdc('0x44')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3d4baf,_0x1556ed);}else{if(_0x54e4e8[_0xbfdc('0x3d')][_0xa44fc6]===_0xbfdc('0x7e')){_0x38941f[_0xbfdc('0x44')]('i.'+_0xa44fc6+'\x20IS\x20NULL');}else{_0x38941f[_0xbfdc('0x44')]('i.'+_0xa44fc6+_0xbfdc('0x7f'),_0x54e4e8['query'][_0xa44fc6]);}}});}if(_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x80')]){if(_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x80')]==0x1){_0x38941f['having']('`unreadMessages`\x20=\x200');}else{_0x38941f['having'](_0xbfdc('0x81'));}}if(_0x54e4e8['query'][_0xbfdc('0x82')]){_0x44aeb9=_[_0xbfdc('0x83')](_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x82')])?_0x54e4e8['query'][_0xbfdc('0x82')]:new Array(_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x82')]);_0x44aeb9['forEach'](function(_0x58019b){_0x3b7437['or'](_0xbfdc('0x84'),'%,'+_0x58019b+',%');});}if(_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x85')]){var _0x166bc2=_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x85')][_0xbfdc('0x86')]('\x5c','\x5c\x5c')[_0xbfdc('0x86')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x166bc2)){_0x2e6b1f['or'](_0xbfdc('0x87'),_0x166bc2+'%')['or']('i.phone\x20LIKE\x20?',_0x166bc2+'%');}else{_0x2e6b1f['or'](_0xbfdc('0x88'),qs[_0xbfdc('0x66')](_0x166bc2))['or'](_0xbfdc('0x89'),_0x166bc2+'%');}}}_0x38941f[_0xbfdc('0x44')](_0x2e6b1f);_0x38941f[_0xbfdc('0x8a')]('i.id');var _0x3dccaa={'type':db[_0xbfdc('0x8b')]['QueryTypes']['SELECT'],'raw':!![]};var _0x490e32=_0x38941f['clone']();_0x490e32[_0xbfdc('0x48')](_0xbfdc('0x8c'));_0x490e32[_0xbfdc('0x48')](_0xbfdc('0x8d'),_0xbfdc('0x5d'));if(_0x4bc766[_0xbfdc('0x8e')]){_0x4bc766['order'][_0xbfdc('0x6c')](function(_0x1e09b5){var _0x274962=_0x1e09b5[0x0]==='contactName'?_0x1e09b5[0x0]:'i.'+_0x1e09b5[0x0];_0x38941f['order'](_0x274962,_0x1e09b5[0x1]===_0xbfdc('0x8f')?![]:!![]);});}if(!_[_0xbfdc('0x76')](_0x44aeb9)){_0x38941f[_0xbfdc('0x60')](_0x3b7437);_0x490e32[_0xbfdc('0x44')]('t.id\x20IN\x20?',_0x44aeb9);}BPromise[_0xbfdc('0x90')]()[_0xbfdc('0x2c')](function(){if(!_0x4b8653){if(_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x77')])return;_0x490e32[_0xbfdc('0x44')](_0xbfdc('0x91'));_0x38941f[_0xbfdc('0x44')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x54e4e8[_0xbfdc('0x92')][_0xbfdc('0x93')]!==_0xbfdc('0x94'))return;return _0x54e4e8[_0xbfdc('0x92')][_0xbfdc('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x223311){if(_['isEmpty'](_0x223311)){_0x490e32['where'](_0xbfdc('0x96'));_0x38941f[_0xbfdc('0x44')](_0xbfdc('0x96'));}else{_0x490e32[_0xbfdc('0x44')]('i.WhatsappAccountId\x20IN\x20?',_[_0xbfdc('0x32')](_0x223311,'id'));_0x38941f['where']('i.WhatsappAccountId\x20IN\x20?',_[_0xbfdc('0x32')](_0x223311,'id'));}});})[_0xbfdc('0x2c')](function(){if(_0x54e4e8[_0xbfdc('0x92')]['role']==='agent'&&!_0x4b8653&&!_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x77')])return[];return db[_0xbfdc('0x97')][_0xbfdc('0x3d')](_0x490e32['toString'](),_0x3dccaa);})[_0xbfdc('0x2c')](function(_0x126b72){_0x2f8af3['count']=_0x126b72['length'];if(_0x2f8af3['count']===0x0)return[];return db[_0xbfdc('0x97')][_0xbfdc('0x3d')](_0x7ccbb3[_0xbfdc('0x98')](),_0x3dccaa)[_0xbfdc('0x2c')](function(_0x1dbe3f){_0x54d2b3=_[_0xbfdc('0x99')](_0x1dbe3f,'id');_0x3dccaa=_[_0xbfdc('0x9a')](_0x3dccaa,{'model':db[_0xbfdc('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x54e4e8[_0xbfdc('0x3d')][_0xbfdc('0x41')]){_0x4bc766[_0xbfdc('0x40')]['forEach'](function(_0x161791){_0x38941f['field']('i.'+_0x161791);});}else{_0x38941f[_0xbfdc('0x48')](_0xbfdc('0x8d'),_0xbfdc('0x5d'));_0x38941f[_0xbfdc('0x48')](_0xbfdc('0x9b'),_0xbfdc('0x9c'));_0x38941f[_0xbfdc('0x48')](_0xbfdc('0x9d'),_0xbfdc('0x9e'));_0x38941f[_0xbfdc('0x48')](_0xbfdc('0x9f'),_0xbfdc('0xa0'));_0x38941f[_0xbfdc('0x48')]('i.*');_0x38941f[_0xbfdc('0x48')](_0xbfdc('0xa1'),_0xbfdc('0xa2'));_0x38941f[_0xbfdc('0x48')](_0xbfdc('0xa3'),_0xbfdc('0xa4'));_0x38941f[_0xbfdc('0x48')]('c.email',_0xbfdc('0xa5'));_0x38941f[_0xbfdc('0x48')](_0xbfdc('0xa6'),'Contact.phone');_0x38941f[_0xbfdc('0x48')](_0xbfdc('0xa7'),'Contact.mobile');_0x38941f['field'](_0xbfdc('0xa8'),_0xbfdc('0xa9'));_0x38941f[_0xbfdc('0x48')](_0xbfdc('0xaa'),_0xbfdc('0xab'));_0x38941f[_0xbfdc('0x48')](_0xbfdc('0xac'),_0xbfdc('0xad'));_0x38941f[_0xbfdc('0x48')](_0xbfdc('0xae'),_0xbfdc('0x34'));}if(_0x4bc766[_0xbfdc('0x25')])_0x38941f['limit'](_0x4bc766[_0xbfdc('0x25')]);if(_0x4bc766['offset'])_0x38941f[_0xbfdc('0x24')](_0x4bc766[_0xbfdc('0x24')]);return db['sequelize'][_0xbfdc('0x3d')](_0x38941f[_0xbfdc('0x98')](),_0x3dccaa);})[_0xbfdc('0x2c')](function(_0xc6f2af){if(_0xc6f2af[_0xbfdc('0x5c')]>0x0)_0x12caab[_0xbfdc('0x44')](_0xbfdc('0xaf'),_[_0xbfdc('0x32')](_0xc6f2af,'id'));return db[_0xbfdc('0x97')][_0xbfdc('0x3d')](_0x12caab[_0xbfdc('0x98')](),_0x3dccaa)[_0xbfdc('0x2c')](function(_0x31b3d5){var _0x1e7115=_[_0xbfdc('0xb0')](_0x31b3d5,_0xbfdc('0xb1'));var _0x25b922=[];_0xc6f2af[_0xbfdc('0x6c')](function(_0xd4bc70){_0x25b922['push'](updateWhatsappInteraction(_0xd4bc70,_0x54d2b3,_0x1e7115));});return BPromise[_0xbfdc('0xb2')](_0x25b922);});});})[_0xbfdc('0x2c')](function(_0x25b71e){_0x2f8af3[_0xbfdc('0xb3')]=_0x25b71e;return _0x2f8af3;})[_0xbfdc('0x2c')](respondWithFilteredResult(_0x174db6,_0x4bc766))[_0xbfdc('0xb4')](handleError(_0x174db6,null));};exports[_0xbfdc('0xb5')]=function(_0x407a26,_0x4f2809){var _0x57b7c6={'raw':![],'where':{'id':_0x407a26[_0xbfdc('0xb6')]['id']}},_0x3e5747={};_0x3e5747[_0xbfdc('0x3c')]=_[_0xbfdc('0x3e')](db[_0xbfdc('0x38')][_0xbfdc('0x39')]);_0x3e5747['query']=_[_0xbfdc('0x3e')](_0x407a26[_0xbfdc('0x3d')]);_0x3e5747[_0xbfdc('0x45')]=_[_0xbfdc('0x3f')](_0x3e5747[_0xbfdc('0x3c')],_0x3e5747[_0xbfdc('0x3d')]);_0x57b7c6['attributes']=_[_0xbfdc('0x3f')](_0x3e5747[_0xbfdc('0x3c')],qs[_0xbfdc('0x41')](_0x407a26[_0xbfdc('0x3d')]['fields']));_0x57b7c6[_0xbfdc('0x40')]=_0x57b7c6['attributes'][_0xbfdc('0x5c')]?_0x57b7c6[_0xbfdc('0x40')]:_0x3e5747[_0xbfdc('0x3c')];if(_0x407a26['query'][_0xbfdc('0xb7')]){_0x57b7c6['include']=[{'all':!![]}];}_0x57b7c6=_['merge']({},_0x57b7c6,_0x407a26[_0xbfdc('0xb8')]);return db['WhatsappInteraction']['find'](_0x57b7c6)['then'](handleEntityNotFound(_0x4f2809,null))[_0xbfdc('0x2c')](respondWithResult(_0x4f2809,null))[_0xbfdc('0xb4')](handleError(_0x4f2809,null));};exports[_0xbfdc('0xb9')]=function(_0x18e900,_0x62cda7){return db['WhatsappInteraction']['create'](_0x18e900[_0xbfdc('0x73')],{})[_0xbfdc('0x2c')](respondWithResult(_0x62cda7,0xc9))[_0xbfdc('0xb4')](handleError(_0x62cda7,null));};exports[_0xbfdc('0x2a')]=function(_0x572bc1,_0x1e0b5d){if(_0x572bc1[_0xbfdc('0x73')]['id']){delete _0x572bc1['body']['id'];}return db[_0xbfdc('0x38')][_0xbfdc('0x68')]({'where':{'id':_0x572bc1['params']['id']}})[_0xbfdc('0x2c')](handleEntityNotFound(_0x1e0b5d,null))['then'](saveUpdates(_0x572bc1['body'],null))[_0xbfdc('0x2c')](respondWithResult(_0x1e0b5d,null))[_0xbfdc('0xb4')](handleError(_0x1e0b5d,null));};exports[_0xbfdc('0x2b')]=function(_0x29255e,_0x29d76c){return db['WhatsappInteraction']['find']({'where':{'id':_0x29255e[_0xbfdc('0xb6')]['id']}})['then'](handleEntityNotFound(_0x29d76c,null))[_0xbfdc('0x2c')](removeEntity(_0x29d76c,null))[_0xbfdc('0xb4')](handleError(_0x29d76c,null));};exports['describe']=function(_0x6d4c8b,_0x18a8fe){return db['WhatsappInteraction'][_0xbfdc('0xba')]()[_0xbfdc('0x2c')](respondWithResult(_0x18a8fe,null))['catch'](handleError(_0x18a8fe,null));};exports['addMessage']=function(_0x4946ce,_0xa9b73f,_0x4ce3bd){return db[_0xbfdc('0xbb')][_0xbfdc('0x68')]({'where':{'id':_0x4946ce[_0xbfdc('0xb6')]['id']}})[_0xbfdc('0x2c')](handleEntityNotFound(_0xa9b73f,null))[_0xbfdc('0x2c')](function(_0x373757){if(_0x373757){return _0x373757[_0xbfdc('0xbc')](_0x4946ce[_0xbfdc('0x73')][_0xbfdc('0xbd')],_[_0xbfdc('0xbe')](_0x4946ce[_0xbfdc('0x73')],[_0xbfdc('0xbd'),'id'])||{});}})[_0xbfdc('0x2c')](respondWithResult(_0xa9b73f,null))[_0xbfdc('0xb4')](handleError(_0xa9b73f,null));};exports[_0xbfdc('0xbf')]=function(_0x3570e8,_0x3b7072,_0x39561a){var _0x3f1b42={'raw':![],'where':{}};var _0x3ce0e8={};var _0x1400c3={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x3570e8['params']['id']}})['then'](handleEntityNotFound(_0x3b7072,null))[_0xbfdc('0x2c')](function(_0x567be2){if(_0x567be2){_0x3ce0e8[_0xbfdc('0x3c')]=_[_0xbfdc('0x3e')](db['WhatsappMessage'][_0xbfdc('0x39')]);_0x3ce0e8[_0xbfdc('0x3d')]=_[_0xbfdc('0x3e')](_0x3570e8[_0xbfdc('0x3d')]);_0x3ce0e8[_0xbfdc('0x45')]=_['intersection'](_0x3ce0e8[_0xbfdc('0x3c')],_0x3ce0e8[_0xbfdc('0x3d')]);_0x3f1b42[_0xbfdc('0x40')]=_['intersection'](_0x3ce0e8['model'],qs[_0xbfdc('0x41')](_0x3570e8[_0xbfdc('0x3d')][_0xbfdc('0x41')]));_0x3f1b42[_0xbfdc('0x40')]=_0x3f1b42[_0xbfdc('0x40')][_0xbfdc('0x5c')]?_0x3f1b42[_0xbfdc('0x40')]:_0x3ce0e8[_0xbfdc('0x3c')];if(!_0x3570e8[_0xbfdc('0x3d')][_0xbfdc('0xc0')](_0xbfdc('0x42'))){_0x3f1b42[_0xbfdc('0x25')]=qs[_0xbfdc('0x25')](_0x3570e8[_0xbfdc('0x3d')][_0xbfdc('0x25')]);_0x3f1b42[_0xbfdc('0x24')]=qs[_0xbfdc('0x24')](_0x3570e8[_0xbfdc('0x3d')][_0xbfdc('0x24')]);}_0x3f1b42[_0xbfdc('0x8e')]=qs[_0xbfdc('0x43')](_0x3570e8[_0xbfdc('0x3d')]['sort']);_0x3f1b42[_0xbfdc('0x44')]=qs[_0xbfdc('0x45')](_[_0xbfdc('0x46')](_0x3570e8[_0xbfdc('0x3d')],_0x3ce0e8[_0xbfdc('0x45')]));_0x3f1b42[_0xbfdc('0x44')][_0xbfdc('0xb1')]=_0x567be2['id'];if(_0x3570e8['query']['filter']){_0x3f1b42[_0xbfdc('0x44')]=_[_0xbfdc('0x9a')](_0x3f1b42[_0xbfdc('0x44')],{'$or':_[_0xbfdc('0x32')](_0x3f1b42[_0xbfdc('0x40')],function(_0x79897b){var _0x37a498={};_0x37a498[_0x79897b]={'$like':'%'+_0x3570e8[_0xbfdc('0x3d')][_0xbfdc('0x85')]+'%'};return _0x37a498;})});}if(_0x3570e8[_0xbfdc('0x3d')][_0xbfdc('0x7c')]){var _0x16ae29=_0x3570e8[_0xbfdc('0x3d')][_0xbfdc('0x7c')][_0xbfdc('0x64')](',');var _0x45581f={};_0x45581f[_0x16ae29[0x0]]={'$gte':moment(_0x16ae29[0x1])[_0xbfdc('0xc1')](_0xbfdc('0xc2'))};_0x3f1b42[_0xbfdc('0x44')]=_[_0xbfdc('0x9a')](_0x3f1b42[_0xbfdc('0x44')],_0x45581f);}_0x3f1b42=_['merge']({},_0x3f1b42,_0x3570e8['options']);return db[_0xbfdc('0xbb')]['count']({'where':_0x3f1b42[_0xbfdc('0x44')]})['then'](function(_0x18d9af){_0x1400c3[_0xbfdc('0x23')]=_0x18d9af;if(_0x3570e8['query']['includeAll']){_0x3f1b42[_0xbfdc('0xc3')]=[{'all':!![]}];}return db[_0xbfdc('0xbb')][_0xbfdc('0xc4')](_0x3f1b42);})[_0xbfdc('0x2c')](function(_0x57f9bf){_0x1400c3[_0xbfdc('0xb3')]=_0x57f9bf;return _0x1400c3;});}})[_0xbfdc('0x2c')](respondWithFilteredResult(_0x3b7072,_0x3f1b42))[_0xbfdc('0xb4')](handleError(_0x3b7072,null));};exports['addTags']=function(_0x88e389,_0x8e8837,_0x59ba89){return db[_0xbfdc('0x38')][_0xbfdc('0x68')]({'where':{'id':_0x88e389[_0xbfdc('0xb6')]['id']}})['then'](handleEntityNotFound(_0x8e8837,null))['then'](function(_0x2eba31){if(_0x2eba31){return _0x2eba31[_0xbfdc('0xc5')](_0x88e389['body'][_0xbfdc('0xbd')],_[_0xbfdc('0xbe')](_0x88e389[_0xbfdc('0x73')],[_0xbfdc('0xbd'),'id'])||{})[_0xbfdc('0xc6')](function(){return db['Tag'][_0xbfdc('0xc4')]({'attributes':['id',_0xbfdc('0x2f'),_0xbfdc('0x49')],'where':{'id':_0x88e389[_0xbfdc('0x73')][_0xbfdc('0xbd')]}});})['then'](function(_0x4a6d1e){socket[_0xbfdc('0xc7')](_0xbfdc('0xc8'),{'id':Number(_0x88e389[_0xbfdc('0xb6')]['id']),'tags':_0x4a6d1e||[]});return{'id':Number(_0x88e389[_0xbfdc('0xb6')]['id']),'tags':_0x4a6d1e||[]};});}})[_0xbfdc('0x2c')](respondWithResult(_0x8e8837,null))[_0xbfdc('0xb4')](handleError(_0x8e8837,null));};exports['removeTags']=function(_0x226265,_0x4b8078,_0x1fe774){return db['WhatsappInteraction']['find']({'where':{'id':_0x226265[_0xbfdc('0xb6')]['id']}})['then'](handleEntityNotFound(_0x4b8078,null))['then'](function(_0x8d2453){if(_0x8d2453){return _0x8d2453[_0xbfdc('0xc9')](_0x226265[_0xbfdc('0x3d')][_0xbfdc('0xbd')]);}})[_0xbfdc('0x2c')](respondWithStatusCode(_0x4b8078,null))[_0xbfdc('0xb4')](handleError(_0x4b8078,null));};exports['download']=function(_0x2a305b,_0x2c702c){var _0x11eacf=moment()['unix']()[_0xbfdc('0x98')]();var _0x261ba5=path[_0xbfdc('0xca')](config[_0xbfdc('0xcb')],_0xbfdc('0xcc'),_0xbfdc('0xcd'),_0xbfdc('0xce'));var _0x129f38=path[_0xbfdc('0xca')](config['root'],_0xbfdc('0xcc'),_0xbfdc('0xcd'),_0xbfdc('0xcf'));var _0x3ae841=path[_0xbfdc('0xca')](_0x261ba5,_0x11eacf);var _0xe67275=util['format']('transcript-%d-%s.zip',_0x2a305b[_0xbfdc('0xb6')]['id'],_0x11eacf);var _0xf499e=path['join'](_0x261ba5,_0xe67275);var _0x221d7e=[];_0x221d7e[_0xbfdc('0x36')]({'model':db[_0xbfdc('0x6e')],'as':_0xbfdc('0x6e'),'attributes':['id',_0xbfdc('0x33')],'raw':!![]});_0x221d7e[_0xbfdc('0x36')]({'model':db[_0xbfdc('0xd0')],'as':_0xbfdc('0x62'),'attributes':['id',_0xbfdc('0xd1'),_0xbfdc('0xd2')],'raw':!![]});if(_0x2a305b[_0xbfdc('0x3d')]['attachments']){_0x221d7e['push']({'model':db[_0xbfdc('0xd3')],'as':_0xbfdc('0xd3'),'raw':!![]});}var _0xcc40fa=[{'model':db[_0xbfdc('0xbb')],'as':_0xbfdc('0xd4'),'attributes':['id',_0xbfdc('0x73'),_0xbfdc('0x7a'),'direction',_0xbfdc('0xd5'),_0xbfdc('0x80')],'include':_0x221d7e}];_0xcc40fa[_0xbfdc('0x36')]({'model':db[_0xbfdc('0xd6')],'as':_0xbfdc('0xd7'),'attributes':['id',_0xbfdc('0x2f')]});_0xcc40fa[_0xbfdc('0x36')]({'model':db[_0xbfdc('0x6e')],'as':_0xbfdc('0xd8'),'attributes':['id',_0xbfdc('0x33')]});return db[_0xbfdc('0x38')]['find']({'where':{'id':_0x2a305b[_0xbfdc('0xb6')]['id']},'include':_0xcc40fa})['then'](handleEntityNotFound(_0x2c702c,null))['then'](function(_0xf2fa26){if(_0xf2fa26){var _0x4e626d=_0xf2fa26['get']({'plain':!![]});fs['mkdirSync'](_0x3ae841);var _0x423cb0={'channel':_0xbfdc('0xd9'),'account':_0x4e626d[_0xbfdc('0xd7')]['name'],'agent':_0x4e626d[_0xbfdc('0xd8')]?_0x4e626d['Owner'][_0xbfdc('0x33')]:_0xbfdc('0xda'),'createdAt':moment(_0x4e626d[_0xbfdc('0x7a')])[_0xbfdc('0xc1')](_0xbfdc('0xc2'))[_0xbfdc('0x98')](),'closedAt':_0x4e626d[_0xbfdc('0xdb')]?moment(_0x4e626d[_0xbfdc('0xdc')])[_0xbfdc('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0xbfdc('0x98')]():'','disposition':_0x4e626d[_0xbfdc('0xdd')],'messages':_(_0x4e626d['Messages'])[_0xbfdc('0x85')]({'secret':![]})[_0xbfdc('0x32')](function(_0xc34882){if(_0xc34882[_0xbfdc('0xd3')]){var _0x1b038c=path[_0xbfdc('0xca')](_0x129f38,_0xc34882[_0xbfdc('0xd3')][_0xbfdc('0xde')]);if(fs[_0xbfdc('0xdf')](_0x1b038c)){fs['createReadStream'](_0x1b038c)[_0xbfdc('0xe0')](fs[_0xbfdc('0xe1')](path['join'](_0x3ae841,_0xc34882[_0xbfdc('0xd3')][_0xbfdc('0xde')])));}}return{'date':moment(_0xc34882[_0xbfdc('0x7a')])[_0xbfdc('0xc1')](_0xbfdc('0xc2'))[_0xbfdc('0x98')](),'sender':_0xc34882[_0xbfdc('0xe2')]===_0xbfdc('0xe3')?_0xc34882[_0xbfdc('0x6e')]?_0xc34882[_0xbfdc('0x6e')][_0xbfdc('0x33')]:_0xbfdc('0xe4'):_0xc34882[_0xbfdc('0x62')][_0xbfdc('0xd1')]+(_0xc34882[_0xbfdc('0x62')][_0xbfdc('0xd2')]?'\x20'+_0xc34882['Contact'][_0xbfdc('0xd2')]:''),'body':_0xc34882[_0xbfdc('0xd3')]?_0xc34882['Attachment'][_0xbfdc('0xde')]:_0xc34882['body'],'direction':_0xc34882[_0xbfdc('0xe2')]===_0xbfdc('0xe3')?'A':'C','secret':_0xc34882[_0xbfdc('0xd5')],'read':_0xc34882[_0xbfdc('0x80')],'attachment':_0xc34882['Attachment']};})[_0xbfdc('0x5e')]()};return ejs[_0xbfdc('0xe5')](path[_0xbfdc('0xca')](config[_0xbfdc('0xcb')],'server',_0xbfdc('0xe6'),_0xbfdc('0xe7')),{'interaction':_0x423cb0})[_0xbfdc('0x2c')](function(_0x9bd42){var _0x5d402b=path['join'](_0x3ae841,_0xbfdc('0xe8')+_0x4e626d['id']+'-'+_0x11eacf+_0xbfdc('0xe9'));var _0x16235e={'path':_0x5d402b,'channel':_0xbfdc('0xd9'),'interactionId':_0x4e626d['id']};return pdf[_0xbfdc('0xea')](_0x9bd42,_0x16235e);})[_0xbfdc('0x2c')](function(){return new BPromise(function(_0x73585a,_0x598ed0){zipdir(_0x3ae841,{'saveTo':_0xf499e},function(_0x989126,_0x4d11b7){if(_0x989126)return _0x598ed0(_0x989126);return _0x73585a(_0x4d11b7);});})['then'](function(){return new BPromise(function(_0x4d705e,_0x2588d1){rimraf(_0x3ae841,function(_0xeb3c57){if(_0xeb3c57)_0x2588d1(_0xeb3c57);return _0x4d705e();});});})[_0xbfdc('0x2c')](function(){return _0x2c702c[_0xbfdc('0xeb')](_0xf499e,_0xe67275,function(_0x1a65c9){if(_0x1a65c9){console[_0xbfdc('0xec')](_0xbfdc('0xed'),_0x1a65c9);}else{fs['unlinkSync'](_0xf499e);}});});});}else{return _0x2c702c[_0xbfdc('0x2d')](0xc8);}})[_0xbfdc('0xb4')](handleError(_0x2c702c,null));};
\ No newline at end of file
index 1cb4059..073c318 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4198=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x408341,_0xdff4e3){var _0x2aa6d7=function(_0x216053){while(--_0x216053){_0x408341['push'](_0x408341['shift']());}};_0x2aa6d7(++_0xdff4e3);}(_0x4198,0x69));var _0x8419=function(_0x4e145b,_0x4747ea){_0x4e145b=_0x4e145b-0x0;var _0x5ede16=_0x4198[_0x4e145b];return _0x5ede16;};'use strict';var EventEmitter=require(_0x8419('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x8419('0x1')];var WhatsappMessage=require(_0x8419('0x2'))['db'][_0x8419('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x8419('0x4')](0x0);var events={'afterCreate':_0x8419('0x5'),'afterUpdate':_0x8419('0x6'),'afterDestroy':_0x8419('0x7')};function emitEvent(_0xc19396){return function(_0x41d9fb,_0x2a3822,_0x502e00){_0x41d9fb[_0x8419('0x8')]({'attributes':['id'],'raw':!![]})[_0x8419('0x9')](function(_0x107b48){_0x41d9fb[_0x8419('0xa')](_0x8419('0xb'),_0x107b48[_0x8419('0xc')](function(_0x22a6a3){return{'id':_0x22a6a3['id']};}));return WhatsappMessage[_0x8419('0xd')]({'where':{'WhatsappInteractionId':_0x41d9fb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8419('0x9')](function(_0x1b3dfe){_0x41d9fb[_0x8419('0xa')](_0x8419('0xe'),_0x1b3dfe[_0x8419('0xf')]);WhatsappInteractionEvents[_0x8419('0x10')](_0xc19396+':'+_0x41d9fb['id'],_0x41d9fb);WhatsappInteractionEvents[_0x8419('0x10')](_0xc19396,_0x41d9fb);_0x502e00(null);})['catch'](_0x502e00(null));};}for(var e in events){if(events[_0x8419('0x11')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x8419('0x12')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xa900=['hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','getUsers','setDataValue','Users','findAll','then','length','emit','catch','hasOwnProperty'];(function(_0x48eedf,_0x1a57ef){var _0x45ea5f=function(_0x437c3e){while(--_0x437c3e){_0x48eedf['push'](_0x48eedf['shift']());}};_0x45ea5f(++_0x1a57ef);}(_0xa900,0x101));var _0x0a90=function(_0x253b73,_0x55c2be){_0x253b73=_0x253b73-0x0;var _0x2483d5=_0xa900[_0x253b73];return _0x2483d5;};'use strict';var EventEmitter=require(_0x0a90('0x0'));var WhatsappInteraction=require(_0x0a90('0x1'))['db'][_0x0a90('0x2')];var WhatsappMessage=require(_0x0a90('0x1'))['db'][_0x0a90('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x0a90('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a90('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4f5b00){return function(_0x38f42c,_0x6cbb24,_0x461b32){_0x38f42c[_0x0a90('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3909ac){_0x38f42c[_0x0a90('0x7')](_0x0a90('0x8'),_0x3909ac['map'](function(_0x29c836){return{'id':_0x29c836['id']};}));return WhatsappMessage[_0x0a90('0x9')]({'where':{'WhatsappInteractionId':_0x38f42c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0a90('0xa')](function(_0x580275){_0x38f42c[_0x0a90('0x7')]('unreadMessages',_0x580275[_0x0a90('0xb')]);WhatsappInteractionEvents[_0x0a90('0xc')](_0x4f5b00+':'+_0x38f42c['id'],_0x38f42c);WhatsappInteractionEvents['emit'](_0x4f5b00,_0x38f42c);_0x461b32(null);})[_0x0a90('0xd')](_0x461b32(null));};}for(var e in events){if(events[_0x0a90('0xe')](e)){var event=events[e];WhatsappInteraction[_0x0a90('0xf')](e,emitEvent(event));}}module[_0x0a90('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
index 9cd8bb2..4c5d53f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76e0=['path','../../config/environment','./whatsappInteraction.attributes','exports','whatsapp_interactions','YYYY-MM-DD\x20HH:mm:ss','moment','request-promise'];(function(_0x4cdbb2,_0x7c8b5a){var _0x2f6dba=function(_0x21ac2d){while(--_0x21ac2d){_0x4cdbb2['push'](_0x4cdbb2['shift']());}};_0x2f6dba(++_0x7c8b5a);}(_0x76e0,0x6e));var _0x076e=function(_0x54533c,_0x1f19a3){_0x54533c=_0x54533c-0x0;var _0x104df0=_0x76e0[_0x54533c];return _0x104df0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x076e('0x0'));var BPromise=require('bluebird');var rp=require(_0x076e('0x1'));var fs=require('fs');var path=require(_0x076e('0x2'));var rimraf=require('rimraf');var config=require(_0x076e('0x3'));var attributes=require(_0x076e('0x4'));module[_0x076e('0x5')]=function(_0x617416,_0x70551c){return _0x617416['define']('WhatsappInteraction',attributes,{'tableName':_0x076e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15f58c,_0x422b00,_0x58fc4d){if(_0x15f58c['changed']('closed')){_0x15f58c['closedAt']=moment()['format'](_0x076e('0x7'));}_0x58fc4d(null,_0x15f58c);}}});};
\ No newline at end of file
+var _0x0ef0=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0ef0,0xdb));var _0x00ef=function(_0x11b19b,_0x213234){_0x11b19b=_0x11b19b-0x0;var _0x1daac1=_0x0ef0[_0x11b19b];return _0x1daac1;};'use strict';var _=require(_0x00ef('0x0'));var util=require(_0x00ef('0x1'));var logger=require(_0x00ef('0x2'))(_0x00ef('0x3'));var moment=require('moment');var BPromise=require(_0x00ef('0x4'));var rp=require(_0x00ef('0x5'));var fs=require('fs');var path=require(_0x00ef('0x6'));var rimraf=require('rimraf');var config=require(_0x00ef('0x7'));var attributes=require(_0x00ef('0x8'));module['exports']=function(_0x4b6fd0,_0x28fa2a){return _0x4b6fd0[_0x00ef('0x9')](_0x00ef('0xa'),attributes,{'tableName':_0x00ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45fcac,_0x12aed,_0x51e65a){if(_0x45fcac[_0x00ef('0xc')](_0x00ef('0xd'))){_0x45fcac[_0x00ef('0xe')]=moment()[_0x00ef('0xf')](_0x00ef('0x10'));}_0x51e65a(null,_0x45fcac);}}});};
\ No newline at end of file
index 81ea5aa..d3458cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3c1=['UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags','omit','body','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x281c76,_0x1341fd){var _0x34aec1=function(_0x2d9fbd){while(--_0x2d9fbd){_0x281c76['push'](_0x281c76['shift']());}};_0x34aec1(++_0x1341fd);}(_0xc3c1,0x1d2));var _0x1c3c=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc3c1[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x1c3c('0x0'));var util=require('util');var moment=require(_0x1c3c('0x1'));var BPromise=require(_0x1c3c('0x2'));var rs=require(_0x1c3c('0x3'));var fs=require('fs');var Redis=require(_0x1c3c('0x4'));var db=require(_0x1c3c('0x5'))['db'];var utils=require(_0x1c3c('0x6'));var logger=require(_0x1c3c('0x7'))(_0x1c3c('0x8'));var config=require(_0x1c3c('0x9'));var jayson=require(_0x1c3c('0xa'));var client=jayson['client'][_0x1c3c('0xb')]({'port':0x232a});config[_0x1c3c('0xc')]=_[_0x1c3c('0xd')](config[_0x1c3c('0xc')],{'host':_0x1c3c('0xe'),'port':0x18eb});var socket=require(_0x1c3c('0xf'))(new Redis(config[_0x1c3c('0xc')]));require(_0x1c3c('0x10'))['register'](socket);function respondWithRpcPromise(_0x22ac4f,_0x4c2e01,_0x44fd5b){return new BPromise(function(_0x1ddc82,_0x37bc58){return client[_0x1c3c('0x11')](_0x22ac4f,_0x44fd5b)[_0x1c3c('0x12')](function(_0x5c33eb){logger[_0x1c3c('0x13')](_0x1c3c('0x14'),_0x4c2e01,_0x1c3c('0x15'));logger[_0x1c3c('0x16')](_0x1c3c('0x17'),_0x4c2e01,_0x1c3c('0x15'),JSON[_0x1c3c('0x18')](_0x5c33eb));if(_0x5c33eb[_0x1c3c('0x19')]){if(_0x5c33eb[_0x1c3c('0x19')]['code']===0x1f4){logger[_0x1c3c('0x19')](_0x1c3c('0x14'),_0x4c2e01,_0x5c33eb[_0x1c3c('0x19')][_0x1c3c('0x1a')]);return _0x37bc58(_0x5c33eb[_0x1c3c('0x19')][_0x1c3c('0x1a')]);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x4c2e01,_0x5c33eb['error'][_0x1c3c('0x1a')]);return _0x1ddc82(_0x5c33eb[_0x1c3c('0x19')][_0x1c3c('0x1a')]);}else{logger['info'](_0x1c3c('0x14'),_0x4c2e01,_0x1c3c('0x15'));_0x1ddc82(_0x5c33eb[_0x1c3c('0x1b')][_0x1c3c('0x1a')]);}})[_0x1c3c('0x1c')](function(_0x731155){logger[_0x1c3c('0x19')](_0x1c3c('0x14'),_0x4c2e01,_0x731155);_0x37bc58(_0x731155);});});}exports[_0x1c3c('0x1d')]=function(_0x4e7255){var _0x345bb5=this;return new Promise(function(_0x9dd028,_0x4e8683){return db[_0x1c3c('0x1e')][_0x1c3c('0x1f')](_0x4e7255['body'],{'raw':_0x4e7255[_0x1c3c('0x20')]?_0x4e7255['options'][_0x1c3c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e7255[_0x1c3c('0x20')]?_0x4e7255['options'][_0x1c3c('0x22')]||null:null,'attributes':_0x4e7255[_0x1c3c('0x20')]?_0x4e7255[_0x1c3c('0x20')][_0x1c3c('0x23')]||null:null,'limit':_0x4e7255[_0x1c3c('0x20')]?_0x4e7255['options'][_0x1c3c('0x24')]||null:null})['then'](function(_0x16c3c1){logger['info']('UpdateWhatsappInteraction',_0x4e7255);logger[_0x1c3c('0x16')](_0x1c3c('0x1d'),_0x4e7255,JSON[_0x1c3c('0x18')](_0x16c3c1));_0x9dd028(_0x16c3c1);})[_0x1c3c('0x1c')](function(_0x52a845){logger[_0x1c3c('0x19')]('UpdateWhatsappInteraction',_0x52a845[_0x1c3c('0x1a')],_0x4e7255);_0x4e8683(_0x345bb5['error'](0x1f4,_0x52a845[_0x1c3c('0x1a')]));});});};exports[_0x1c3c('0x25')]=function(_0x4ab125){return new Promise(function(_0x446671,_0x46956e){return db[_0x1c3c('0x1e')][_0x1c3c('0x26')]({'where':_0x4ab125[_0x1c3c('0x20')]?_0x4ab125[_0x1c3c('0x20')][_0x1c3c('0x22')]||null:null})[_0x1c3c('0x12')](function(_0x2671b8){if(_0x2671b8){return _0x2671b8[_0x1c3c('0x27')](_0x4ab125['body']['ids'],_[_0x1c3c('0x28')](_0x4ab125[_0x1c3c('0x29')],[_0x1c3c('0x2a'),'id'])||{});}})[_0x1c3c('0x2b')](function(_0x4e0213){logger[_0x1c3c('0x13')]('AddTags',_0x4ab125);logger[_0x1c3c('0x16')](_0x1c3c('0x2c'),_0x4ab125,JSON[_0x1c3c('0x18')](_0x4e0213));_0x446671(_0x4e0213);})[_0x1c3c('0x1c')](function(_0x3ea571){logger[_0x1c3c('0x19')](_0x1c3c('0x2c'),_0x3ea571['message'],_0x4ab125);_0x46956e(_this[_0x1c3c('0x19')](0x1f4,_0x3ea571[_0x1c3c('0x1a')]));});});};
\ No newline at end of file
+var _0xe78b=['defaults','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateWhatsappInteraction','update','body','options','where','attributes','limit','AddTagsToWhatsappInteraction','WhatsappInteraction','find','ids','omit','spread','AddTags','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','redis'];(function(_0xc33f0a,_0x1c1b16){var _0x33b096=function(_0x15221d){while(--_0x15221d){_0xc33f0a['push'](_0xc33f0a['shift']());}};_0x33b096(++_0x1c1b16);}(_0xe78b,0x1f2));var _0xbe78=function(_0x3cc411,_0x53a261){_0x3cc411=_0x3cc411-0x0;var _0x27bd2e=_0xe78b[_0x3cc411];return _0x27bd2e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbe78('0x0'));var BPromise=require(_0xbe78('0x1'));var rs=require(_0xbe78('0x2'));var fs=require('fs');var Redis=require(_0xbe78('0x3'));var db=require(_0xbe78('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbe78('0x5'));var client=jayson[_0xbe78('0x6')][_0xbe78('0x7')]({'port':0x232a});config[_0xbe78('0x8')]=_[_0xbe78('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbe78('0xa'))(new Redis(config[_0xbe78('0x8')]));require('./whatsappInteraction.socket')[_0xbe78('0xb')](socket);function respondWithRpcPromise(_0x4d288f,_0x1760b7,_0x58960e){return new BPromise(function(_0x3ad6b4,_0x2be8aa){return client[_0xbe78('0xc')](_0x4d288f,_0x58960e)[_0xbe78('0xd')](function(_0x352f86){logger[_0xbe78('0xe')](_0xbe78('0xf'),_0x1760b7,'request\x20sent');logger[_0xbe78('0x10')](_0xbe78('0x11'),_0x1760b7,_0xbe78('0x12'),JSON[_0xbe78('0x13')](_0x352f86));if(_0x352f86[_0xbe78('0x14')]){if(_0x352f86['error'][_0xbe78('0x15')]===0x1f4){logger['error'](_0xbe78('0xf'),_0x1760b7,_0x352f86[_0xbe78('0x14')][_0xbe78('0x16')]);return _0x2be8aa(_0x352f86[_0xbe78('0x14')]['message']);}logger[_0xbe78('0x14')](_0xbe78('0xf'),_0x1760b7,_0x352f86['error']['message']);return _0x3ad6b4(_0x352f86[_0xbe78('0x14')][_0xbe78('0x16')]);}else{logger[_0xbe78('0xe')]('WhatsappInteraction,\x20%s,\x20%s',_0x1760b7,_0xbe78('0x12'));_0x3ad6b4(_0x352f86[_0xbe78('0x17')][_0xbe78('0x16')]);}})['catch'](function(_0x33dcbe){logger[_0xbe78('0x14')](_0xbe78('0xf'),_0x1760b7,_0x33dcbe);_0x2be8aa(_0x33dcbe);});});}exports[_0xbe78('0x18')]=function(_0x33e579){var _0x24280f=this;return new Promise(function(_0x2b0418,_0x1f30d5){return db['WhatsappInteraction'][_0xbe78('0x19')](_0x33e579[_0xbe78('0x1a')],{'raw':_0x33e579['options']?_0x33e579['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33e579[_0xbe78('0x1b')]?_0x33e579['options'][_0xbe78('0x1c')]||null:null,'attributes':_0x33e579[_0xbe78('0x1b')]?_0x33e579[_0xbe78('0x1b')][_0xbe78('0x1d')]||null:null,'limit':_0x33e579[_0xbe78('0x1b')]?_0x33e579[_0xbe78('0x1b')][_0xbe78('0x1e')]||null:null})[_0xbe78('0xd')](function(_0x2d60a0){logger[_0xbe78('0xe')]('UpdateWhatsappInteraction',_0x33e579);logger[_0xbe78('0x10')](_0xbe78('0x18'),_0x33e579,JSON[_0xbe78('0x13')](_0x2d60a0));_0x2b0418(_0x2d60a0);})['catch'](function(_0x9afeb){logger[_0xbe78('0x14')]('UpdateWhatsappInteraction',_0x9afeb[_0xbe78('0x16')],_0x33e579);_0x1f30d5(_0x24280f['error'](0x1f4,_0x9afeb[_0xbe78('0x16')]));});});};exports[_0xbe78('0x1f')]=function(_0x2beb6f){return new Promise(function(_0x2b3c3f,_0x1d3b25){return db[_0xbe78('0x20')][_0xbe78('0x21')]({'where':_0x2beb6f[_0xbe78('0x1b')]?_0x2beb6f[_0xbe78('0x1b')][_0xbe78('0x1c')]||null:null})[_0xbe78('0xd')](function(_0x47eff8){if(_0x47eff8){return _0x47eff8['addTags'](_0x2beb6f[_0xbe78('0x1a')][_0xbe78('0x22')],_[_0xbe78('0x23')](_0x2beb6f[_0xbe78('0x1a')],[_0xbe78('0x22'),'id'])||{});}})[_0xbe78('0x24')](function(_0x1107be){logger[_0xbe78('0xe')]('AddTags',_0x2beb6f);logger['debug'](_0xbe78('0x25'),_0x2beb6f,JSON[_0xbe78('0x13')](_0x1107be));_0x2b3c3f(_0x1107be);})[_0xbe78('0x26')](function(_0x21abc7){logger[_0xbe78('0x14')]('AddTags',_0x21abc7[_0xbe78('0x16')],_0x2beb6f);_0x1d3b25(_this[_0xbe78('0x14')](0x1f4,_0x21abc7['message']));});});};
\ No newline at end of file
index 7297e4c..4a8524f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8adf=['./whatsappInteraction.events','emit','removeListener','register','whatsappInteraction:'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0x8adf,0x19a));var _0xf8ad=function(_0x19692a,_0x3699ec){_0x19692a=_0x19692a-0x0;var _0x4f9a10=_0x8adf[_0x19692a];return _0x4f9a10;};'use strict';var WhatsappInteractionEvents=require(_0xf8ad('0x0'));var events=['save','remove','update'];function createListener(_0x56569d,_0x6784ea){return function(_0x174856){_0x6784ea[_0xf8ad('0x1')](_0x56569d,_0x174856);};}function removeListener(_0x1b3a0e,_0x385683){return function(){WhatsappInteractionEvents[_0xf8ad('0x2')](_0x1b3a0e,_0x385683);};}exports[_0xf8ad('0x3')]=function(_0x4434e4){for(var _0x4180c4=0x0,_0x58f3c2=events['length'];_0x4180c4<_0x58f3c2;_0x4180c4++){var _0x348d86=events[_0x4180c4];var _0x12594b=createListener(_0xf8ad('0x4')+_0x348d86,_0x4434e4);WhatsappInteractionEvents['on'](_0x348d86,_0x12594b);}};
\ No newline at end of file
+var _0x60ff=['length','whatsappInteraction:','save','remove','update','removeListener','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x60ff,0x16e));var _0xf60f=function(_0x3ae09f,_0x290b5e){_0x3ae09f=_0x3ae09f-0x0;var _0x574f92=_0x60ff[_0x3ae09f];return _0x574f92;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xf60f('0x0'),_0xf60f('0x1'),_0xf60f('0x2')];function createListener(_0x399c43,_0x2d9ead){return function(_0x13386b){_0x2d9ead['emit'](_0x399c43,_0x13386b);};}function removeListener(_0x483419,_0x24b849){return function(){WhatsappInteractionEvents[_0xf60f('0x3')](_0x483419,_0x24b849);};}exports[_0xf60f('0x4')]=function(_0x166259){for(var _0x3ebf7e=0x0,_0x2368e7=events[_0xf60f('0x5')];_0x3ebf7e<_0x2368e7;_0x3ebf7e++){var _0x4ff9ec=events[_0x3ebf7e];var _0xdcec14=createListener(_0xf60f('0x6')+_0x4ff9ec,_0x166259);WhatsappInteractionEvents['on'](_0x4ff9ec,_0xdcec14);}};
\ No newline at end of file
index 0670829..1758388 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44c3=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout'];(function(_0x21f705,_0x4c3bfb){var _0x26c1b1=function(_0x3cae9c){while(--_0x3cae9c){_0x21f705['push'](_0x21f705['shift']());}};_0x26c1b1(++_0x4c3bfb);}(_0x44c3,0x132));var _0x344c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x44c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x344c('0x0'));var util=require(_0x344c('0x1'));var path=require(_0x344c('0x2'));var timeout=require(_0x344c('0x3'));var express=require(_0x344c('0x4'));var router=express[_0x344c('0x5')]();var fs_extra=require(_0x344c('0x6'));var auth=require(_0x344c('0x7'));var interaction=require(_0x344c('0x8'));var config=require(_0x344c('0x9'));var controller=require(_0x344c('0xa'));router[_0x344c('0xb')]('/',auth['isAuthenticated'](),controller[_0x344c('0xc')]);router[_0x344c('0xb')](_0x344c('0xd'),auth[_0x344c('0xe')](),controller[_0x344c('0xf')]);router[_0x344c('0xb')](_0x344c('0x10'),auth['isAuthenticated'](),controller['show']);router[_0x344c('0x11')]('/',auth[_0x344c('0xe')](),interaction[_0x344c('0x12')](_0x344c('0x13'),_0x344c('0x14')),controller[_0x344c('0x15')]);router[_0x344c('0x11')](_0x344c('0x16'),controller['status']);router[_0x344c('0x17')]('/:id',auth[_0x344c('0xe')](),controller[_0x344c('0x18')]);router['put'](_0x344c('0x19'),auth[_0x344c('0xe')](),controller[_0x344c('0x1a')]);router[_0x344c('0x17')](_0x344c('0x1b'),auth[_0x344c('0xe')](),controller[_0x344c('0x1c')]);router[_0x344c('0x1d')]('/:id',auth[_0x344c('0xe')](),controller['destroy']);module[_0x344c('0x1e')]=router;
\ No newline at end of file
+var _0x41bb=['/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','create','/:id/status','status','put','update'];(function(_0x73c275,_0x255dd5){var _0x5b5ee5=function(_0x3cc92f){while(--_0x3cc92f){_0x73c275['push'](_0x73c275['shift']());}};_0x5b5ee5(++_0x255dd5);}(_0x41bb,0x132));var _0xb41b=function(_0x1208b1,_0x283d6d){_0x1208b1=_0x1208b1-0x0;var _0x458200=_0x41bb[_0x1208b1];return _0x458200;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require(_0xb41b('0x2'));var timeout=require(_0xb41b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb41b('0x4'));var auth=require(_0xb41b('0x5'));var interaction=require(_0xb41b('0x6'));var config=require(_0xb41b('0x7'));var controller=require(_0xb41b('0x8'));router[_0xb41b('0x9')]('/',auth[_0xb41b('0xa')](),controller[_0xb41b('0xb')]);router['get'](_0xb41b('0xc'),auth[_0xb41b('0xa')](),controller[_0xb41b('0xd')]);router[_0xb41b('0x9')](_0xb41b('0xe'),auth[_0xb41b('0xa')](),controller[_0xb41b('0xf')]);router[_0xb41b('0x10')]('/',auth['isAuthenticated'](),interaction[_0xb41b('0x11')](_0xb41b('0x12'),'whatsappmessage:create'),controller[_0xb41b('0x13')]);router['post'](_0xb41b('0x14'),controller[_0xb41b('0x15')]);router[_0xb41b('0x16')]('/:id',auth[_0xb41b('0xa')](),controller[_0xb41b('0x17')]);router[_0xb41b('0x16')](_0xb41b('0x18'),auth['isAuthenticated'](),controller[_0xb41b('0x19')]);router[_0xb41b('0x16')](_0xb41b('0x1a'),auth[_0xb41b('0xa')](),controller[_0xb41b('0x1b')]);router[_0xb41b('0x1c')](_0xb41b('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xb41b('0x1d')]=router;
\ No newline at end of file
index 17dbe7d..48153a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x240e=['TEXT','ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x144ff5,_0x3d57c5){var _0x20899f=function(_0x467406){while(--_0x467406){_0x144ff5['push'](_0x144ff5['shift']());}};_0x20899f(++_0x3d57c5);}(_0x240e,0x176));var _0xe240=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x240e[_0x298ed3];return _0x5aad28;};'use strict';var Sequelize=require(_0xe240('0x0'));module[_0xe240('0x1')]={'body':{'type':Sequelize[_0xe240('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe240('0x3')]('in','out'),'defaultValue':_0xe240('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe240('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xe240('0x6')]},'secret':{'type':Sequelize[_0xe240('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe240('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x9e58=['ENUM','out','STRING','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x5071e3,_0x92802d){var _0x5e89a8=function(_0xc3a48e){while(--_0xc3a48e){_0x5071e3['push'](_0x5071e3['shift']());}};_0x5e89a8(++_0x92802d);}(_0x9e58,0xec));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x89e5('0x0')]={'body':{'type':Sequelize[_0x89e5('0x1')](_0x89e5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x89e5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x89e5('0x4')]('in',_0x89e5('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x89e5('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x89e5('0x7')]},'secret':{'type':Sequelize[_0x89e5('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x89e5('0x6')]},'providerResponse':{'type':Sequelize[_0x89e5('0x1')]}};
\ No newline at end of file
index 91bcbbb..a8ed65a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67f8=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','stack','name','send','index','map','WhatsappMessage','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','whatsapp-interactions','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','update','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','WhatsappInteraction','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x275048,_0x3fad40){var _0x41bdaf=function(_0x50a005){while(--_0x50a005){_0x275048['push'](_0x275048['shift']());}};_0x41bdaf(++_0x3fad40);}(_0x67f8,0x105));var _0x867f=function(_0x55c1f0,_0x4f574f){_0x55c1f0=_0x55c1f0-0x0;var _0x1530fa=_0x67f8[_0x55c1f0];return _0x1530fa;};'use strict';var emlformat=require(_0x867f('0x0'));var rimraf=require(_0x867f('0x1'));var zipdir=require(_0x867f('0x2'));var jsonpatch=require(_0x867f('0x3'));var rp=require('request-promise');var moment=require(_0x867f('0x4'));var BPromise=require(_0x867f('0x5'));var Mustache=require('mustache');var util=require(_0x867f('0x6'));var path=require('path');var sox=require(_0x867f('0x7'));var csv=require(_0x867f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x867f('0x9'));var _=require(_0x867f('0xa'));var squel=require(_0x867f('0xb'));var crypto=require(_0x867f('0xc'));var jsforce=require(_0x867f('0xd'));var deskjs=require(_0x867f('0xe'));var toCsv=require(_0x867f('0x8'));var querystring=require(_0x867f('0xf'));var Papa=require(_0x867f('0x10'));var Redis=require('ioredis');var authService=require(_0x867f('0x11'));var qs=require(_0x867f('0x12'));var as=require(_0x867f('0x13'));var hardwareService=require(_0x867f('0x14'));var logger=require(_0x867f('0x15'))('api');var utils=require(_0x867f('0x16'));var config=require(_0x867f('0x17'));var licenseUtil=require(_0x867f('0x18'));var db=require(_0x867f('0x19'))['db'];config['redis']=_[_0x867f('0x1a')](config[_0x867f('0x1b')],{'host':_0x867f('0x1c'),'port':0x18eb});var socket=require(_0x867f('0x1d'))(new Redis(config['redis']));require(_0x867f('0x1e'))[_0x867f('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x867f('0x20')][_0x867f('0x21')]({'port':0x232c});var client9002=jayson[_0x867f('0x20')][_0x867f('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1463dc,_0x16a2e4,_0x516fa5,_0x16a400){return new BPromise(function(_0x327e6b,_0x498bd7){var _0x2ef593=_0x16a400||client;return _0x2ef593['request'](_0x1463dc,_0x516fa5)[_0x867f('0x22')](function(_0x27261e){logger['info'](_0x867f('0x23'),_0x16a2e4,_0x867f('0x24'));logger['debug'](_0x867f('0x25'),_0x16a2e4,_0x867f('0x24'),JSON[_0x867f('0x26')](_0x27261e));if(_0x27261e[_0x867f('0x27')]){if(_0x27261e[_0x867f('0x27')][_0x867f('0x28')]===0x1f4){logger[_0x867f('0x27')](_0x867f('0x23'),_0x16a2e4,_0x27261e[_0x867f('0x27')][_0x867f('0x29')]);return _0x498bd7(_0x27261e['error'][_0x867f('0x29')]);}logger['error'](_0x867f('0x23'),_0x16a2e4,_0x27261e[_0x867f('0x27')]['message']);return _0x327e6b(_0x27261e[_0x867f('0x27')][_0x867f('0x29')]);}else{logger[_0x867f('0x2a')](_0x867f('0x23'),_0x16a2e4,_0x867f('0x24'));_0x327e6b(_0x27261e[_0x867f('0x2b')][_0x867f('0x29')]);}})[_0x867f('0x2c')](function(_0x502557){logger[_0x867f('0x27')](_0x867f('0x23'),_0x16a2e4,_0x502557);_0x498bd7(_0x502557);});});}function respondWithStatusCode(_0x2ffe39,_0x3610e4){_0x3610e4=_0x3610e4||0xcc;return function(_0x3fd9d4){if(_0x3fd9d4){return _0x2ffe39[_0x867f('0x2d')](_0x3610e4);}return _0x2ffe39[_0x867f('0x2e')](_0x3610e4)[_0x867f('0x2f')]();};}function respondWithResult(_0x1c08ca,_0x491e30){_0x491e30=_0x491e30||0xc8;return function(_0x12b6ae){if(_0x12b6ae){return _0x1c08ca[_0x867f('0x2e')](_0x491e30)[_0x867f('0x30')](_0x12b6ae);}};}function respondWithFilteredResult(_0x2d03fd,_0x5a826e){return function(_0x45a2bc){if(_0x45a2bc){var _0x296c86=typeof _0x5a826e[_0x867f('0x31')]===_0x867f('0x32')&&typeof _0x5a826e[_0x867f('0x33')]===_0x867f('0x32');var _0x5927ea=_0x45a2bc[_0x867f('0x34')];var _0x151f5b=_0x296c86?0x0:_0x5a826e[_0x867f('0x31')];var _0x57d09c=_0x296c86?_0x45a2bc[_0x867f('0x34')]:_0x5a826e[_0x867f('0x31')]+_0x5a826e[_0x867f('0x33')];var _0x4ce6ed;if(_0x57d09c>=_0x5927ea){_0x57d09c=_0x5927ea;_0x4ce6ed=0xc8;}else{_0x4ce6ed=0xce;}_0x2d03fd['status'](_0x4ce6ed);return _0x2d03fd['set'](_0x867f('0x35'),_0x151f5b+'-'+_0x57d09c+'/'+_0x5927ea)[_0x867f('0x30')](_0x45a2bc);}return null;};}function patchUpdates(_0x35131b){return function(_0x6b0993){try{jsonpatch[_0x867f('0x36')](_0x6b0993,_0x35131b,!![]);}catch(_0x2f5bc6){return BPromise[_0x867f('0x37')](_0x2f5bc6);}return _0x6b0993[_0x867f('0x38')]();};}function saveUpdates(_0x598b86,_0x34c6f0){return function(_0x590a03){if(_0x590a03){return _0x590a03['update'](_0x598b86)['then'](function(_0x2b1fbd){return _0x2b1fbd;});}return null;};}function removeEntity(_0xf7b7bc,_0x3cf3c9){return function(_0x23ecb0){if(_0x23ecb0){return _0x23ecb0['destroy']()[_0x867f('0x22')](function(){_0xf7b7bc[_0x867f('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x464313,_0x4e115d){return function(_0x5a8b5a){if(!_0x5a8b5a){_0x464313[_0x867f('0x2d')](0x194);}return _0x5a8b5a;};}function handleError(_0x124ae7,_0x460d5b){_0x460d5b=_0x460d5b||0x1f4;return function(_0x489852){logger[_0x867f('0x27')](_0x489852[_0x867f('0x39')]);if(_0x489852[_0x867f('0x3a')]){delete _0x489852[_0x867f('0x3a')];}_0x124ae7['status'](_0x460d5b)[_0x867f('0x3b')](_0x489852);};}exports[_0x867f('0x3c')]=function(_0x53b9c5,_0x5758a9){var _0x5d287a={},_0x4510d1={},_0x4d7a5e={'count':0x0,'rows':[]};var _0x4518e7=_[_0x867f('0x3d')](db[_0x867f('0x3e')]['rawAttributes'],function(_0x36cd63){return{'name':_0x36cd63['fieldName'],'type':_0x36cd63[_0x867f('0x3f')][_0x867f('0x40')]};});_0x4510d1['model']=_[_0x867f('0x3d')](_0x4518e7,_0x867f('0x3a'));_0x4510d1[_0x867f('0x41')]=_[_0x867f('0x42')](_0x53b9c5[_0x867f('0x41')]);_0x4510d1[_0x867f('0x43')]=_[_0x867f('0x44')](_0x4510d1['model'],_0x4510d1[_0x867f('0x41')]);_0x5d287a[_0x867f('0x45')]=_['intersection'](_0x4510d1[_0x867f('0x46')],qs[_0x867f('0x47')](_0x53b9c5[_0x867f('0x41')][_0x867f('0x47')]));_0x5d287a['attributes']=_0x5d287a[_0x867f('0x45')][_0x867f('0x48')]?_0x5d287a[_0x867f('0x45')]:_0x4510d1['model'];if(!_0x53b9c5[_0x867f('0x41')][_0x867f('0x49')]('nolimit')){_0x5d287a[_0x867f('0x33')]=qs[_0x867f('0x33')](_0x53b9c5['query'][_0x867f('0x33')]);_0x5d287a[_0x867f('0x31')]=qs['offset'](_0x53b9c5[_0x867f('0x41')][_0x867f('0x31')]);}_0x5d287a[_0x867f('0x4a')]=qs[_0x867f('0x4b')](_0x53b9c5[_0x867f('0x41')][_0x867f('0x4b')]);_0x5d287a[_0x867f('0x4c')]=qs[_0x867f('0x43')](_[_0x867f('0x4d')](_0x53b9c5[_0x867f('0x41')],_0x4510d1[_0x867f('0x43')]),_0x4518e7);if(_0x53b9c5[_0x867f('0x41')][_0x867f('0x4e')]){_0x5d287a[_0x867f('0x4c')]=_[_0x867f('0x4f')](_0x5d287a[_0x867f('0x4c')],{'$or':_['map'](_0x4518e7,function(_0x79561f){if(_0x79561f['type']!==_0x867f('0x50')){var _0x319fb7={};_0x319fb7[_0x79561f[_0x867f('0x3a')]]={'$like':'%'+_0x53b9c5['query'][_0x867f('0x4e')]+'%'};return _0x319fb7;}})});}_0x5d287a=_[_0x867f('0x4f')]({},_0x5d287a,_0x53b9c5[_0x867f('0x51')]);var _0x1503a7={'where':_0x5d287a['where']};return db[_0x867f('0x3e')][_0x867f('0x34')](_0x1503a7)[_0x867f('0x22')](function(_0x3e3cd2){_0x4d7a5e[_0x867f('0x34')]=_0x3e3cd2;if(_0x53b9c5[_0x867f('0x41')][_0x867f('0x52')]){_0x5d287a[_0x867f('0x53')]=[{'all':!![]}];}return db[_0x867f('0x3e')][_0x867f('0x54')](_0x5d287a);})['then'](function(_0x396d6a){_0x4d7a5e[_0x867f('0x55')]=_0x396d6a;return _0x4d7a5e;})[_0x867f('0x22')](respondWithFilteredResult(_0x5758a9,_0x5d287a))['catch'](handleError(_0x5758a9,null));};exports[_0x867f('0x56')]=function(_0x2ff00f,_0x2d7a80){var _0x2f58f4={'raw':!![],'where':{'id':_0x2ff00f[_0x867f('0x57')]['id']}},_0x223cd1={};_0x223cd1[_0x867f('0x46')]=_[_0x867f('0x42')](db['WhatsappMessage']['rawAttributes']);_0x223cd1['query']=_[_0x867f('0x42')](_0x2ff00f[_0x867f('0x41')]);_0x223cd1[_0x867f('0x43')]=_['intersection'](_0x223cd1[_0x867f('0x46')],_0x223cd1[_0x867f('0x41')]);_0x2f58f4['attributes']=_[_0x867f('0x44')](_0x223cd1[_0x867f('0x46')],qs[_0x867f('0x47')](_0x2ff00f[_0x867f('0x41')][_0x867f('0x47')]));_0x2f58f4[_0x867f('0x45')]=_0x2f58f4['attributes'][_0x867f('0x48')]?_0x2f58f4[_0x867f('0x45')]:_0x223cd1[_0x867f('0x46')];if(_0x2ff00f[_0x867f('0x41')][_0x867f('0x52')]){_0x2f58f4[_0x867f('0x53')]=[{'all':!![]}];}_0x2f58f4=_['merge']({},_0x2f58f4,_0x2ff00f['options']);return db[_0x867f('0x3e')][_0x867f('0x58')](_0x2f58f4)[_0x867f('0x22')](handleEntityNotFound(_0x2d7a80,null))[_0x867f('0x22')](respondWithResult(_0x2d7a80,null))[_0x867f('0x2c')](handleError(_0x2d7a80,null));};exports[_0x867f('0x59')]=function(_0x4f7baf,_0x4d4345){return db[_0x867f('0x3e')][_0x867f('0x59')](_0x4f7baf[_0x867f('0x5a')],{})['then'](respondWithResult(_0x4d4345,0xc9))[_0x867f('0x2c')](handleError(_0x4d4345,null));};exports['update']=function(_0x509d47,_0x26fc91){if(_0x509d47['body']['id']){delete _0x509d47[_0x867f('0x5a')]['id'];}return db[_0x867f('0x3e')][_0x867f('0x58')]({'where':{'id':_0x509d47['params']['id']}})[_0x867f('0x22')](handleEntityNotFound(_0x26fc91,null))[_0x867f('0x22')](saveUpdates(_0x509d47[_0x867f('0x5a')],null))['then'](respondWithResult(_0x26fc91,null))[_0x867f('0x2c')](handleError(_0x26fc91,null));};exports[_0x867f('0x5b')]=function(_0x1caf20,_0x2fcc61){return db[_0x867f('0x3e')]['find']({'where':{'id':_0x1caf20[_0x867f('0x57')]['id']}})['then'](handleEntityNotFound(_0x2fcc61,null))[_0x867f('0x22')](removeEntity(_0x2fcc61,null))['catch'](handleError(_0x2fcc61,null));};exports['describe']=function(_0x233876,_0x495c3b){return db['WhatsappMessage'][_0x867f('0x5c')]()['then'](respondWithResult(_0x495c3b,null))[_0x867f('0x2c')](handleError(_0x495c3b,null));};var interaction_log=require('../../config/logger')(_0x867f('0x5d'));exports['accept']=function(_0x4b8b95,_0x1f59f3,_0x14795b){var _0x2f7b08={'agent':{},'channel':_0x867f('0x5e')};if(_0x4b8b95[_0x867f('0x5a')]['id']){delete _0x4b8b95['body']['id'];}_0x4b8b95[_0x867f('0x5a')][_0x867f('0x5f')]=!![];_0x4b8b95[_0x867f('0x5a')][_0x867f('0x60')]=moment()['format'](_0x867f('0x61'));_0x4b8b95[_0x867f('0x5a')][_0x867f('0x62')]=_0x4b8b95[_0x867f('0x5a')][_0x867f('0x62')]||_0x4b8b95[_0x867f('0x63')]['id'];_0x2f7b08[_0x867f('0x64')]['id']=_0x4b8b95['body'][_0x867f('0x62')];return db[_0x867f('0x3e')][_0x867f('0x58')]({'where':{'id':_0x4b8b95['params']['id'],'UserId':null}})[_0x867f('0x22')](handleEntityNotFound(_0x1f59f3,null))['then'](saveUpdates(_0x4b8b95[_0x867f('0x5a')],null))['then'](function(_0x2bd530){if(_0x2bd530){_0x2f7b08[_0x867f('0x29')]=_0x2bd530[_0x867f('0x65')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x2bd530['WhatsappInteractionId']}});}return null;})[_0x867f('0x22')](handleEntityNotFound(_0x1f59f3,null))[_0x867f('0x22')](function(_0x213fab){if(_0x213fab){return _0x213fab[_0x867f('0x66')]({'UserId':_0x4b8b95[_0x867f('0x5a')][_0x867f('0x62')],'read1stAt':_['isNil'](_0x213fab[_0x867f('0x67')])?moment()[_0x867f('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x34ce96){if(_0x34ce96){_0x2f7b08['interaction']=_0x34ce96[_0x867f('0x65')]({'plain':!![]});interaction_log['info'](_0x867f('0x69'),_0x4b8b95[_0x867f('0x63')]['id'],_0x4b8b95[_0x867f('0x63')][_0x867f('0x3a')],_0x4b8b95[_0x867f('0x63')][_0x867f('0x6a')],_0x2f7b08[_0x867f('0x6b')]['id'],_0x4b8b95['body']?JSON[_0x867f('0x26')](_0x4b8b95[_0x867f('0x5a')]):'null');return respondWithRpcPromise(_0x867f('0x6c'),'acceptMessage',_0x2f7b08);}return null;})[_0x867f('0x22')](function(_0x544d84){var _0xd4bab9=_0x867f('0x6d')+_0x544d84[_0x867f('0x29')]['ContactId'];return db[_0x867f('0x6e')][_0x867f('0x41')](_0xd4bab9,{'type':db[_0x867f('0x6f')][_0x867f('0x70')][_0x867f('0x71')],'raw':!![]})[_0x867f('0x22')](function(_0x1580dc){return _0x1580dc;});})[_0x867f('0x22')](function(_0x3e2c8c){if(_0x3e2c8c){_0x2f7b08[_0x867f('0x29')]['contact']=_0x3e2c8c[0x0];if(!_0x4b8b95[_0x867f('0x5a')][_0x867f('0x62')])return;return db[_0x867f('0x72')][_0x867f('0x58')]({'where':{'id':_0x4b8b95[_0x867f('0x5a')][_0x867f('0x62')],'role':_0x867f('0x64')},'attributes':['id',_0x867f('0x3a'),_0x867f('0x73'),_0x867f('0x74'),'internal'],'raw':!![]});}return null;})[_0x867f('0x22')](function(_0x169c94){if(!_0x169c94)return null;_0x2f7b08['message']['agent']=_0x169c94;return _0x2f7b08;})[_0x867f('0x22')](function(_0x3c68c9){if(_0x3c68c9){if(_0x4b8b95[_0x867f('0x5a')]['manual']){_0x2f7b08[_0x867f('0x29')][_0x867f('0x75')]=util[_0x867f('0x68')](_0x867f('0x76'),_0x4b8b95[_0x867f('0x63')]['name']);_0x2f7b08[_0x867f('0x29')][_0x867f('0x77')]=_0x2f7b08[_0x867f('0x77')];_0x2f7b08[_0x867f('0x29')][_0x867f('0x78')]=_0x2f7b08[_0x867f('0x77')];_0x2f7b08[_0x867f('0x29')][_0x867f('0x79')]=_0x867f('0x7a');return respondWithRpcPromise(_0x867f('0x7b'),_0x867f('0x7b'),{'event':_0x867f('0x7c'),'message':_0x2f7b08[_0x867f('0x29')]},client9002)['then'](function(){return _0x2f7b08;});}return _0x2f7b08;}return null;})[_0x867f('0x22')](respondWithResult(_0x1f59f3,null))[_0x867f('0x2c')](handleError(_0x1f59f3,null));};var interaction_log=require(_0x867f('0x15'))(_0x867f('0x5d'));exports['reject']=function(_0x4e86b0,_0x19e30d,_0x2a9bcf){var _0x174bb2={'agent':{},'channel':_0x867f('0x5e')};if(_0x4e86b0[_0x867f('0x5a')]['id']){delete _0x4e86b0[_0x867f('0x5a')]['id'];}_0x4e86b0[_0x867f('0x5a')][_0x867f('0x62')]=_0x4e86b0[_0x867f('0x5a')][_0x867f('0x62')]||_0x4e86b0['user']['id'];_0x174bb2['agent']['id']=_0x4e86b0['body']['UserId'];return db['WhatsappMessage'][_0x867f('0x58')]({'where':{'id':_0x4e86b0['params']['id'],'UserId':null}})[_0x867f('0x22')](handleEntityNotFound(_0x19e30d,null))['then'](function(_0x9b8062){if(_0x9b8062){_0x174bb2[_0x867f('0x29')]=_0x9b8062[_0x867f('0x65')]({'plain':!![]});return db[_0x867f('0x7d')][_0x867f('0x58')]({'where':{'id':_0x9b8062[_0x867f('0x7e')]}});}return null;})[_0x867f('0x22')](handleEntityNotFound(_0x19e30d,null))[_0x867f('0x22')](function(_0x20ecf3){if(_0x20ecf3){_0x174bb2[_0x867f('0x6b')]=_0x20ecf3[_0x867f('0x65')]({'plain':!![]});interaction_log['info'](_0x867f('0x7f'),_0x4e86b0[_0x867f('0x63')]['id'],_0x4e86b0[_0x867f('0x63')][_0x867f('0x3a')],_0x4e86b0[_0x867f('0x63')][_0x867f('0x6a')],_0x174bb2[_0x867f('0x6b')]['id'],_0x4e86b0['body']?JSON[_0x867f('0x26')](_0x4e86b0[_0x867f('0x5a')]):_0x867f('0x80'));return respondWithRpcPromise(_0x867f('0x81'),_0x867f('0x82'),_0x174bb2);}return null;})[_0x867f('0x22')](function(_0x1f81b6){var _0x28b864=_0x867f('0x6d')+_0x1f81b6[_0x867f('0x29')][_0x867f('0x83')];return db[_0x867f('0x6e')][_0x867f('0x41')](_0x28b864,{'type':db[_0x867f('0x6f')][_0x867f('0x70')][_0x867f('0x71')],'raw':!![]})['then'](function(_0x439422){return _0x439422;});})['then'](function(_0xea7b70){if(_0xea7b70){_0x174bb2['message']['contact']=_0xea7b70[0x0];if(!_0x4e86b0[_0x867f('0x5a')][_0x867f('0x62')])return;return db[_0x867f('0x72')]['find']({'where':{'id':_0x4e86b0[_0x867f('0x5a')]['UserId'],'role':_0x867f('0x64')},'attributes':['id',_0x867f('0x3a'),'fullname',_0x867f('0x74'),_0x867f('0x84')],'raw':!![]});}return null;})['then'](function(_0x8a1eaa){if(!_0x8a1eaa)return null;_0x174bb2[_0x867f('0x29')][_0x867f('0x64')]=_0x8a1eaa;return _0x174bb2;})['then'](function(_0x56131f){if(_0x56131f){_0x56131f[_0x867f('0x29')][_0x867f('0x75')]=util['format']('SIP/%s',_0x4e86b0[_0x867f('0x63')][_0x867f('0x3a')]);_0x56131f[_0x867f('0x29')][_0x867f('0x77')]=_0x174bb2[_0x867f('0x77')];_0x56131f['message'][_0x867f('0x78')]=_0x174bb2[_0x867f('0x77')];_0x56131f[_0x867f('0x29')][_0x867f('0x79')]='reject';respondWithRpcPromise(_0x867f('0x7b'),_0x867f('0x7b'),{'event':_0x867f('0x85'),'message':_0x56131f[_0x867f('0x29')]},client9002);return _0x174bb2;}return null;})['then'](respondWithResult(_0x19e30d,null))['catch'](handleError(_0x19e30d,null));};exports['status']=function(_0xe2a933,_0x6509fb,_0x1c0872){if(_0xe2a933[_0x867f('0x5a')]['id']){delete _0xe2a933['body']['id'];}var _0x358f76;return db['WhatsappMessage'][_0x867f('0x58')]({'where':{'id':_0xe2a933[_0x867f('0x57')]['id']}})[_0x867f('0x22')](handleEntityNotFound(_0x6509fb,null))[_0x867f('0x22')](function(_0x1529e1){if(_0x1529e1){_0x358f76=_0x1529e1;return db[_0x867f('0x86')][_0x867f('0x58')]({'where':{'id':_0x1529e1[_0x867f('0x87')]}});}})[_0x867f('0x22')](handleEntityNotFound(_0x6509fb,null))[_0x867f('0x22')](function(_0x325b26){if(_0x325b26){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x325b26[_0x867f('0x3f')],util[_0x867f('0x88')](_0xe2a933[_0x867f('0x5a')],{'showHidden':![],'depth':null}));switch(_0x325b26[_0x867f('0x3f')]){case _0x867f('0x89'):if(_0xe2a933['body']['MessageSid']&&_0xe2a933[_0x867f('0x5a')][_0x867f('0x8a')]===_0x358f76['messageId']&&_0xe2a933['body'][_0x867f('0x8b')]&&_0xe2a933['body'][_0x867f('0x8b')]===_0x867f('0x5f')){return _0x358f76[_0x867f('0x66')]({'read':!![]});}else{logger[_0x867f('0x27')](_0x867f('0x8c'),_0x867f('0x2e'),_0x867f('0x89'),util[_0x867f('0x88')](_0xe2a933['body'],{'showHidden':![],'depth':null}));}break;}return _0x358f76;}})[_0x867f('0x22')](respondWithResult(_0x6509fb,null))[_0x867f('0x2c')](handleError(_0x6509fb,null));};
\ No newline at end of file
+var _0xc780=['fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','length','include','catch','create','body','find','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','email','interface','SIP/%s','channel','event','accept','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','sequelize','fullname','internal','motionChannel','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0x2260f1,_0x1a9aec){var _0x458a43=function(_0x223739){while(--_0x223739){_0x2260f1['push'](_0x2260f1['shift']());}};_0x458a43(++_0x1a9aec);}(_0xc780,0x1f3));var _0x0c78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc780[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0c78('0x0'));var rimraf=require(_0x0c78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c78('0x2'));var rp=require(_0x0c78('0x3'));var moment=require(_0x0c78('0x4'));var BPromise=require(_0x0c78('0x5'));var Mustache=require(_0x0c78('0x6'));var util=require(_0x0c78('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0c78('0x8'));var ejs=require(_0x0c78('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0c78('0xa'));var jsforce=require(_0x0c78('0xb'));var deskjs=require(_0x0c78('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0c78('0xd'));var Redis=require(_0x0c78('0xe'));var authService=require(_0x0c78('0xf'));var qs=require(_0x0c78('0x10'));var as=require(_0x0c78('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c78('0x12'))(_0x0c78('0x13'));var utils=require(_0x0c78('0x14'));var config=require(_0x0c78('0x15'));var licenseUtil=require(_0x0c78('0x16'));var db=require('../../mysqldb')['db'];config[_0x0c78('0x17')]=_[_0x0c78('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0c78('0x19'))(new Redis(config[_0x0c78('0x17')]));require(_0x0c78('0x1a'))['register'](socket);var jayson=require(_0x0c78('0x1b'));var client=jayson[_0x0c78('0x1c')][_0x0c78('0x1d')]({'port':0x232c});var client9002=jayson[_0x0c78('0x1c')][_0x0c78('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4dfe78,_0x27789b,_0x52fba0,_0x2185c2){return new BPromise(function(_0x5512bc,_0x10976e){var _0x5a93d9=_0x2185c2||client;return _0x5a93d9[_0x0c78('0x1e')](_0x4dfe78,_0x52fba0)['then'](function(_0x16cf20){logger[_0x0c78('0x1f')](_0x0c78('0x20'),_0x27789b,_0x0c78('0x21'));logger['debug'](_0x0c78('0x22'),_0x27789b,_0x0c78('0x21'),JSON[_0x0c78('0x23')](_0x16cf20));if(_0x16cf20['error']){if(_0x16cf20[_0x0c78('0x24')][_0x0c78('0x25')]===0x1f4){logger[_0x0c78('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x27789b,_0x16cf20[_0x0c78('0x24')][_0x0c78('0x26')]);return _0x10976e(_0x16cf20[_0x0c78('0x24')]['message']);}logger[_0x0c78('0x24')](_0x0c78('0x20'),_0x27789b,_0x16cf20[_0x0c78('0x24')][_0x0c78('0x26')]);return _0x5512bc(_0x16cf20[_0x0c78('0x24')]['message']);}else{logger['info'](_0x0c78('0x20'),_0x27789b,_0x0c78('0x21'));_0x5512bc(_0x16cf20[_0x0c78('0x27')]['message']);}})['catch'](function(_0x54eb8f){logger['error'](_0x0c78('0x20'),_0x27789b,_0x54eb8f);_0x10976e(_0x54eb8f);});});}function respondWithStatusCode(_0x4ddd21,_0x1bde73){_0x1bde73=_0x1bde73||0xcc;return function(_0x599262){if(_0x599262){return _0x4ddd21[_0x0c78('0x28')](_0x1bde73);}return _0x4ddd21[_0x0c78('0x29')](_0x1bde73)[_0x0c78('0x2a')]();};}function respondWithResult(_0x284af7,_0x27fc55){_0x27fc55=_0x27fc55||0xc8;return function(_0x2e06e7){if(_0x2e06e7){return _0x284af7[_0x0c78('0x29')](_0x27fc55)[_0x0c78('0x2b')](_0x2e06e7);}};}function respondWithFilteredResult(_0x1e80be,_0x548aec){return function(_0x21682f){if(_0x21682f){var _0x4e7e1e=typeof _0x548aec[_0x0c78('0x2c')]===_0x0c78('0x2d')&&typeof _0x548aec[_0x0c78('0x2e')]===_0x0c78('0x2d');var _0x1b0ca5=_0x21682f[_0x0c78('0x2f')];var _0x44392b=_0x4e7e1e?0x0:_0x548aec[_0x0c78('0x2c')];var _0x12bcb1=_0x4e7e1e?_0x21682f[_0x0c78('0x2f')]:_0x548aec['offset']+_0x548aec[_0x0c78('0x2e')];var _0x3a13d5;if(_0x12bcb1>=_0x1b0ca5){_0x12bcb1=_0x1b0ca5;_0x3a13d5=0xc8;}else{_0x3a13d5=0xce;}_0x1e80be[_0x0c78('0x29')](_0x3a13d5);return _0x1e80be[_0x0c78('0x30')](_0x0c78('0x31'),_0x44392b+'-'+_0x12bcb1+'/'+_0x1b0ca5)[_0x0c78('0x2b')](_0x21682f);}return null;};}function patchUpdates(_0x18ab96){return function(_0x573ef1){try{jsonpatch['apply'](_0x573ef1,_0x18ab96,!![]);}catch(_0x33cc26){return BPromise[_0x0c78('0x32')](_0x33cc26);}return _0x573ef1[_0x0c78('0x33')]();};}function saveUpdates(_0x52ad7d,_0x1c28cb){return function(_0x4c058e){if(_0x4c058e){return _0x4c058e[_0x0c78('0x34')](_0x52ad7d)[_0x0c78('0x35')](function(_0x4bb521){return _0x4bb521;});}return null;};}function removeEntity(_0x171feb,_0x22e574){return function(_0x4df9cd){if(_0x4df9cd){return _0x4df9cd['destroy']()[_0x0c78('0x35')](function(){_0x171feb[_0x0c78('0x29')](0xcc)[_0x0c78('0x2a')]();});}};}function handleEntityNotFound(_0x821af8,_0x5c432b){return function(_0x48ba84){if(!_0x48ba84){_0x821af8[_0x0c78('0x28')](0x194);}return _0x48ba84;};}function handleError(_0x45fe96,_0x5968c0){_0x5968c0=_0x5968c0||0x1f4;return function(_0x10df0c){logger[_0x0c78('0x24')](_0x10df0c[_0x0c78('0x36')]);if(_0x10df0c[_0x0c78('0x37')]){delete _0x10df0c[_0x0c78('0x37')];}_0x45fe96['status'](_0x5968c0)[_0x0c78('0x38')](_0x10df0c);};}exports[_0x0c78('0x39')]=function(_0x51e146,_0x4da999){var _0x10229e={},_0xcac7a7={},_0x45fd2b={'count':0x0,'rows':[]};var _0x53a90c=_[_0x0c78('0x3a')](db[_0x0c78('0x3b')][_0x0c78('0x3c')],function(_0x472e70){return{'name':_0x472e70[_0x0c78('0x3d')],'type':_0x472e70[_0x0c78('0x3e')][_0x0c78('0x3f')]};});_0xcac7a7[_0x0c78('0x40')]=_[_0x0c78('0x3a')](_0x53a90c,_0x0c78('0x37'));_0xcac7a7['query']=_['keys'](_0x51e146[_0x0c78('0x41')]);_0xcac7a7[_0x0c78('0x42')]=_[_0x0c78('0x43')](_0xcac7a7[_0x0c78('0x40')],_0xcac7a7[_0x0c78('0x41')]);_0x10229e[_0x0c78('0x44')]=_[_0x0c78('0x43')](_0xcac7a7[_0x0c78('0x40')],qs[_0x0c78('0x45')](_0x51e146[_0x0c78('0x41')][_0x0c78('0x45')]));_0x10229e['attributes']=_0x10229e[_0x0c78('0x44')]['length']?_0x10229e['attributes']:_0xcac7a7[_0x0c78('0x40')];if(!_0x51e146[_0x0c78('0x41')]['hasOwnProperty'](_0x0c78('0x46'))){_0x10229e[_0x0c78('0x2e')]=qs[_0x0c78('0x2e')](_0x51e146[_0x0c78('0x41')][_0x0c78('0x2e')]);_0x10229e[_0x0c78('0x2c')]=qs['offset'](_0x51e146[_0x0c78('0x41')][_0x0c78('0x2c')]);}_0x10229e[_0x0c78('0x47')]=qs[_0x0c78('0x48')](_0x51e146[_0x0c78('0x41')][_0x0c78('0x48')]);_0x10229e[_0x0c78('0x49')]=qs['filters'](_[_0x0c78('0x4a')](_0x51e146[_0x0c78('0x41')],_0xcac7a7[_0x0c78('0x42')]),_0x53a90c);if(_0x51e146[_0x0c78('0x41')][_0x0c78('0x4b')]){_0x10229e[_0x0c78('0x49')]=_[_0x0c78('0x4c')](_0x10229e[_0x0c78('0x49')],{'$or':_[_0x0c78('0x3a')](_0x53a90c,function(_0x88afe9){if(_0x88afe9['type']!==_0x0c78('0x4d')){var _0x481794={};_0x481794[_0x88afe9[_0x0c78('0x37')]]={'$like':'%'+_0x51e146[_0x0c78('0x41')][_0x0c78('0x4b')]+'%'};return _0x481794;}})});}_0x10229e=_[_0x0c78('0x4c')]({},_0x10229e,_0x51e146[_0x0c78('0x4e')]);var _0x48d3aa={'where':_0x10229e[_0x0c78('0x49')]};return db[_0x0c78('0x3b')][_0x0c78('0x2f')](_0x48d3aa)[_0x0c78('0x35')](function(_0x3ba982){_0x45fd2b[_0x0c78('0x2f')]=_0x3ba982;if(_0x51e146['query'][_0x0c78('0x4f')]){_0x10229e['include']=[{'all':!![]}];}return db[_0x0c78('0x3b')][_0x0c78('0x50')](_0x10229e);})[_0x0c78('0x35')](function(_0x4bd22c){_0x45fd2b[_0x0c78('0x51')]=_0x4bd22c;return _0x45fd2b;})[_0x0c78('0x35')](respondWithFilteredResult(_0x4da999,_0x10229e))['catch'](handleError(_0x4da999,null));};exports[_0x0c78('0x52')]=function(_0xa9ccc9,_0x355097){var _0x5e5936={'raw':!![],'where':{'id':_0xa9ccc9[_0x0c78('0x53')]['id']}},_0x16a253={};_0x16a253[_0x0c78('0x40')]=_[_0x0c78('0x54')](db[_0x0c78('0x3b')][_0x0c78('0x3c')]);_0x16a253[_0x0c78('0x41')]=_['keys'](_0xa9ccc9[_0x0c78('0x41')]);_0x16a253[_0x0c78('0x42')]=_[_0x0c78('0x43')](_0x16a253[_0x0c78('0x40')],_0x16a253[_0x0c78('0x41')]);_0x5e5936[_0x0c78('0x44')]=_[_0x0c78('0x43')](_0x16a253['model'],qs[_0x0c78('0x45')](_0xa9ccc9[_0x0c78('0x41')][_0x0c78('0x45')]));_0x5e5936[_0x0c78('0x44')]=_0x5e5936[_0x0c78('0x44')][_0x0c78('0x55')]?_0x5e5936[_0x0c78('0x44')]:_0x16a253['model'];if(_0xa9ccc9[_0x0c78('0x41')][_0x0c78('0x4f')]){_0x5e5936[_0x0c78('0x56')]=[{'all':!![]}];}_0x5e5936=_[_0x0c78('0x4c')]({},_0x5e5936,_0xa9ccc9[_0x0c78('0x4e')]);return db[_0x0c78('0x3b')]['find'](_0x5e5936)[_0x0c78('0x35')](handleEntityNotFound(_0x355097,null))['then'](respondWithResult(_0x355097,null))[_0x0c78('0x57')](handleError(_0x355097,null));};exports['create']=function(_0x152ab6,_0x3b8500){return db[_0x0c78('0x3b')][_0x0c78('0x58')](_0x152ab6[_0x0c78('0x59')],{})[_0x0c78('0x35')](respondWithResult(_0x3b8500,0xc9))[_0x0c78('0x57')](handleError(_0x3b8500,null));};exports['update']=function(_0x3f9bb2,_0xf509b9){if(_0x3f9bb2[_0x0c78('0x59')]['id']){delete _0x3f9bb2[_0x0c78('0x59')]['id'];}return db[_0x0c78('0x3b')][_0x0c78('0x5a')]({'where':{'id':_0x3f9bb2[_0x0c78('0x53')]['id']}})['then'](handleEntityNotFound(_0xf509b9,null))[_0x0c78('0x35')](saveUpdates(_0x3f9bb2[_0x0c78('0x59')],null))[_0x0c78('0x35')](respondWithResult(_0xf509b9,null))['catch'](handleError(_0xf509b9,null));};exports['destroy']=function(_0x4ff483,_0x44ccda){return db['WhatsappMessage'][_0x0c78('0x5a')]({'where':{'id':_0x4ff483[_0x0c78('0x53')]['id']}})['then'](handleEntityNotFound(_0x44ccda,null))[_0x0c78('0x35')](removeEntity(_0x44ccda,null))[_0x0c78('0x57')](handleError(_0x44ccda,null));};exports[_0x0c78('0x5b')]=function(_0xf45e9d,_0xc2c7a2){return db['WhatsappMessage'][_0x0c78('0x5b')]()[_0x0c78('0x35')](respondWithResult(_0xc2c7a2,null))[_0x0c78('0x57')](handleError(_0xc2c7a2,null));};var interaction_log=require(_0x0c78('0x12'))(_0x0c78('0x5c'));exports['accept']=function(_0x262267,_0x106060,_0x1bcac3){var _0x17d6ce={'agent':{},'channel':_0x0c78('0x5d')};if(_0x262267[_0x0c78('0x59')]['id']){delete _0x262267['body']['id'];}_0x262267[_0x0c78('0x59')][_0x0c78('0x5e')]=!![];_0x262267[_0x0c78('0x59')][_0x0c78('0x5f')]=moment()[_0x0c78('0x60')](_0x0c78('0x61'));_0x262267[_0x0c78('0x59')][_0x0c78('0x62')]=_0x262267[_0x0c78('0x59')][_0x0c78('0x62')]||_0x262267[_0x0c78('0x63')]['id'];_0x17d6ce[_0x0c78('0x64')]['id']=_0x262267[_0x0c78('0x59')][_0x0c78('0x62')];return db[_0x0c78('0x3b')]['find']({'where':{'id':_0x262267[_0x0c78('0x53')]['id'],'UserId':null}})[_0x0c78('0x35')](handleEntityNotFound(_0x106060,null))['then'](saveUpdates(_0x262267[_0x0c78('0x59')],null))[_0x0c78('0x35')](function(_0x6c40bc){if(_0x6c40bc){_0x17d6ce[_0x0c78('0x26')]=_0x6c40bc[_0x0c78('0x65')]({'plain':!![]});return db[_0x0c78('0x66')][_0x0c78('0x5a')]({'where':{'id':_0x6c40bc[_0x0c78('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x106060,null))[_0x0c78('0x35')](function(_0x286ecb){if(_0x286ecb){return _0x286ecb[_0x0c78('0x34')]({'UserId':_0x262267['body'][_0x0c78('0x62')],'read1stAt':_[_0x0c78('0x68')](_0x286ecb[_0x0c78('0x69')])?moment()[_0x0c78('0x60')](_0x0c78('0x61')):undefined});}return null;})['then'](function(_0x16306e){if(_0x16306e){_0x17d6ce[_0x0c78('0x6a')]=_0x16306e[_0x0c78('0x65')]({'plain':!![]});interaction_log[_0x0c78('0x1f')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x262267[_0x0c78('0x63')]['id'],_0x262267[_0x0c78('0x63')][_0x0c78('0x37')],_0x262267[_0x0c78('0x63')][_0x0c78('0x6b')],_0x17d6ce[_0x0c78('0x6a')]['id'],_0x262267[_0x0c78('0x59')]?JSON[_0x0c78('0x23')](_0x262267[_0x0c78('0x59')]):_0x0c78('0x6c'));return respondWithRpcPromise(_0x0c78('0x6d'),_0x0c78('0x6e'),_0x17d6ce);}return null;})[_0x0c78('0x35')](function(_0x5795d6){var _0x39838e=_0x0c78('0x6f')+_0x5795d6['message']['ContactId'];return db['sequelize'][_0x0c78('0x41')](_0x39838e,{'type':db[_0x0c78('0x70')][_0x0c78('0x71')][_0x0c78('0x72')],'raw':!![]})[_0x0c78('0x35')](function(_0x4ec3f2){return _0x4ec3f2;});})[_0x0c78('0x35')](function(_0xcdf7da){if(_0xcdf7da){_0x17d6ce[_0x0c78('0x26')][_0x0c78('0x73')]=_0xcdf7da[0x0];if(!_0x262267['body'][_0x0c78('0x62')])return;return db[_0x0c78('0x74')][_0x0c78('0x5a')]({'where':{'id':_0x262267[_0x0c78('0x59')][_0x0c78('0x62')],'role':_0x0c78('0x64')},'attributes':['id',_0x0c78('0x37'),'fullname',_0x0c78('0x75'),'internal'],'raw':!![]});}return null;})[_0x0c78('0x35')](function(_0x1015f6){if(!_0x1015f6)return null;_0x17d6ce[_0x0c78('0x26')][_0x0c78('0x64')]=_0x1015f6;return _0x17d6ce;})[_0x0c78('0x35')](function(_0x217244){if(_0x217244){if(_0x262267[_0x0c78('0x59')]['manual']){_0x17d6ce[_0x0c78('0x26')][_0x0c78('0x76')]=util['format'](_0x0c78('0x77'),_0x262267[_0x0c78('0x63')][_0x0c78('0x37')]);_0x17d6ce[_0x0c78('0x26')][_0x0c78('0x78')]=_0x17d6ce['channel'];_0x17d6ce[_0x0c78('0x26')]['motionChannel']=_0x17d6ce[_0x0c78('0x78')];_0x17d6ce[_0x0c78('0x26')][_0x0c78('0x79')]=_0x0c78('0x7a');return respondWithRpcPromise(_0x0c78('0x7b'),'EventManager',{'event':'acceptmessage','message':_0x17d6ce[_0x0c78('0x26')]},client9002)['then'](function(){return _0x17d6ce;});}return _0x17d6ce;}return null;})[_0x0c78('0x35')](respondWithResult(_0x106060,null))[_0x0c78('0x57')](handleError(_0x106060,null));};var interaction_log=require(_0x0c78('0x12'))('whatsapp-interactions');exports['reject']=function(_0x2a3849,_0x178aff,_0x1f8cc2){var _0x38d11b={'agent':{},'channel':_0x0c78('0x5d')};if(_0x2a3849['body']['id']){delete _0x2a3849[_0x0c78('0x59')]['id'];}_0x2a3849[_0x0c78('0x59')][_0x0c78('0x62')]=_0x2a3849[_0x0c78('0x59')][_0x0c78('0x62')]||_0x2a3849[_0x0c78('0x63')]['id'];_0x38d11b['agent']['id']=_0x2a3849['body']['UserId'];return db[_0x0c78('0x3b')][_0x0c78('0x5a')]({'where':{'id':_0x2a3849['params']['id'],'UserId':null}})[_0x0c78('0x35')](handleEntityNotFound(_0x178aff,null))[_0x0c78('0x35')](function(_0xb89360){if(_0xb89360){_0x38d11b['message']=_0xb89360[_0x0c78('0x65')]({'plain':!![]});return db[_0x0c78('0x66')][_0x0c78('0x5a')]({'where':{'id':_0xb89360[_0x0c78('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x178aff,null))[_0x0c78('0x35')](function(_0x4b8caa){if(_0x4b8caa){_0x38d11b[_0x0c78('0x6a')]=_0x4b8caa[_0x0c78('0x65')]({'plain':!![]});interaction_log[_0x0c78('0x1f')](_0x0c78('0x7c'),_0x2a3849[_0x0c78('0x63')]['id'],_0x2a3849['user'][_0x0c78('0x37')],_0x2a3849['user'][_0x0c78('0x6b')],_0x38d11b[_0x0c78('0x6a')]['id'],_0x2a3849[_0x0c78('0x59')]?JSON[_0x0c78('0x23')](_0x2a3849['body']):_0x0c78('0x6c'));return respondWithRpcPromise(_0x0c78('0x7d'),'rejectMessage',_0x38d11b);}return null;})['then'](function(_0x7cb55c){var _0x3ebb9b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x7cb55c['message'][_0x0c78('0x7e')];return db[_0x0c78('0x7f')][_0x0c78('0x41')](_0x3ebb9b,{'type':db[_0x0c78('0x70')][_0x0c78('0x71')][_0x0c78('0x72')],'raw':!![]})[_0x0c78('0x35')](function(_0x3157ac){return _0x3157ac;});})['then'](function(_0x498925){if(_0x498925){_0x38d11b['message'][_0x0c78('0x73')]=_0x498925[0x0];if(!_0x2a3849[_0x0c78('0x59')][_0x0c78('0x62')])return;return db[_0x0c78('0x74')][_0x0c78('0x5a')]({'where':{'id':_0x2a3849[_0x0c78('0x59')][_0x0c78('0x62')],'role':_0x0c78('0x64')},'attributes':['id',_0x0c78('0x37'),_0x0c78('0x80'),_0x0c78('0x75'),_0x0c78('0x81')],'raw':!![]});}return null;})['then'](function(_0x385f92){if(!_0x385f92)return null;_0x38d11b['message'][_0x0c78('0x64')]=_0x385f92;return _0x38d11b;})[_0x0c78('0x35')](function(_0x1cf865){if(_0x1cf865){_0x1cf865[_0x0c78('0x26')][_0x0c78('0x76')]=util[_0x0c78('0x60')]('SIP/%s',_0x2a3849[_0x0c78('0x63')][_0x0c78('0x37')]);_0x1cf865[_0x0c78('0x26')]['channel']=_0x38d11b[_0x0c78('0x78')];_0x1cf865[_0x0c78('0x26')][_0x0c78('0x82')]=_0x38d11b[_0x0c78('0x78')];_0x1cf865[_0x0c78('0x26')]['event']=_0x0c78('0x32');respondWithRpcPromise(_0x0c78('0x7b'),_0x0c78('0x7b'),{'event':_0x0c78('0x83'),'message':_0x1cf865[_0x0c78('0x26')]},client9002);return _0x38d11b;}return null;})[_0x0c78('0x35')](respondWithResult(_0x178aff,null))[_0x0c78('0x57')](handleError(_0x178aff,null));};exports['status']=function(_0x50b2ef,_0x3b6652,_0x300bcc){if(_0x50b2ef[_0x0c78('0x59')]['id']){delete _0x50b2ef[_0x0c78('0x59')]['id'];}var _0x20c2a4;return db[_0x0c78('0x3b')]['find']({'where':{'id':_0x50b2ef[_0x0c78('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b6652,null))['then'](function(_0x2d73ba){if(_0x2d73ba){_0x20c2a4=_0x2d73ba;return db['WhatsappAccount']['find']({'where':{'id':_0x2d73ba[_0x0c78('0x84')]}});}})[_0x0c78('0x35')](handleEntityNotFound(_0x3b6652,null))[_0x0c78('0x35')](function(_0x2243ab){if(_0x2243ab){logger[_0x0c78('0x85')](_0x0c78('0x86'),'status',_0x0c78('0x87'),_0x2243ab[_0x0c78('0x3e')],util['inspect'](_0x50b2ef[_0x0c78('0x59')],{'showHidden':![],'depth':null}));switch(_0x2243ab['type']){case _0x0c78('0x88'):if(_0x50b2ef[_0x0c78('0x59')][_0x0c78('0x89')]&&_0x50b2ef[_0x0c78('0x59')][_0x0c78('0x89')]===_0x20c2a4[_0x0c78('0x8a')]&&_0x50b2ef[_0x0c78('0x59')][_0x0c78('0x8b')]&&_0x50b2ef[_0x0c78('0x59')][_0x0c78('0x8b')]===_0x0c78('0x5e')){return _0x20c2a4[_0x0c78('0x34')]({'read':!![]});}else{logger['error'](_0x0c78('0x8c'),_0x0c78('0x29'),_0x0c78('0x88'),util[_0x0c78('0x8d')](_0x50b2ef[_0x0c78('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x20c2a4;}})[_0x0c78('0x35')](respondWithResult(_0x3b6652,null))[_0x0c78('0x57')](handleError(_0x3b6652,null));};
\ No newline at end of file
index 19ed779..7c4299f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7794=['save','remove','hasOwnProperty','hook','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x7794,0x7b));var _0x4779=function(_0x1cfd87,_0x5dcd45){_0x1cfd87=_0x1cfd87-0x0;var _0x3583ed=_0x7794[_0x1cfd87];return _0x3583ed;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x4779('0x0'))['db'][_0x4779('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4779('0x2')](0x0);var events={'afterCreate':_0x4779('0x3'),'afterUpdate':'update','afterDestroy':_0x4779('0x4')};function emitEvent(_0x1e9fdc){return function(_0x4d3b05,_0x40e5f9,_0x54dc7f){WhatsappMessageEvents['emit'](_0x1e9fdc+':'+_0x4d3b05['id'],_0x4d3b05);WhatsappMessageEvents['emit'](_0x1e9fdc,_0x4d3b05);_0x54dc7f(null);};}for(var e in events){if(events[_0x4779('0x5')](e)){var event=events[e];WhatsappMessage[_0x4779('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0xed3c=['WhatsappMessage','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x5911fb,_0x4360fe){var _0x442ac2=function(_0xff9fce){while(--_0xff9fce){_0x5911fb['push'](_0x5911fb['shift']());}};_0x442ac2(++_0x4360fe);}(_0xed3c,0x1a6));var _0xced3=function(_0x3451ba,_0x4dd59b){_0x3451ba=_0x3451ba-0x0;var _0x558479=_0xed3c[_0x3451ba];return _0x558479;};'use strict';var EventEmitter=require(_0xced3('0x0'));var WhatsappMessage=require(_0xced3('0x1'))['db'][_0xced3('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xced3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xced3('0x4'),'afterDestroy':_0xced3('0x5')};function emitEvent(_0x14488e){return function(_0x5f03e0,_0x51e500,_0x3d3aa0){WhatsappMessageEvents[_0xced3('0x6')](_0x14488e+':'+_0x5f03e0['id'],_0x5f03e0);WhatsappMessageEvents[_0xced3('0x6')](_0x14488e,_0x5f03e0);_0x3d3aa0(null);};}for(var e in events){if(events[_0xced3('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
index e1b5ae9..d2ee952 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85f1=['direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get'];(function(_0x532294,_0x17da1a){var _0x379a15=function(_0x21aa85){while(--_0x21aa85){_0x532294['push'](_0x532294['shift']());}};_0x379a15(++_0x17da1a);}(_0x85f1,0x8f));var _0x185f=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x85f1[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0x185f('0x0'));var util=require(_0x185f('0x1'));var logger=require(_0x185f('0x2'))(_0x185f('0x3'));var moment=require(_0x185f('0x4'));var BPromise=require(_0x185f('0x5'));var rp=require(_0x185f('0x6'));var fs=require('fs');var path=require(_0x185f('0x7'));var rimraf=require(_0x185f('0x8'));var config=require(_0x185f('0x9'));var attributes=require(_0x185f('0xa'));module['exports']=function(_0x56a2b9,_0x30ee35){return _0x56a2b9['define'](_0x185f('0xb'),attributes,{'tableName':_0x185f('0xc'),'paranoid':![],'indexes':[{'name':_0x185f('0xd'),'fields':[_0x185f('0xd')]},{'name':_0x185f('0xe'),'fields':[_0x185f('0xf')],'type':_0x185f('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4494b6,_0x1f197e,_0x1ec2bf){var _0x3c0442=_0x56a2b9[_0x185f('0x11')];var _0x434ea7=_0x4494b6[_0x185f('0x12')]({'plain':!![]});if(_0x434ea7[_0x185f('0x13')][_0x185f('0x14')]()==='in'||_0x434ea7[_0x185f('0x13')][_0x185f('0x14')]()===_0x185f('0x15')&&!_0x434ea7[_0x185f('0x16')]&&!_[_0x185f('0x17')](_0x434ea7[_0x185f('0x18')])){_0x3c0442[_0x185f('0x19')][_0x185f('0x1a')]({'where':{'id':_0x434ea7[_0x185f('0x1b')]}})[_0x185f('0x1c')](function(_0x2b3042){if(_0x2b3042){_0x2b3042[_0x185f('0x1d')]({'lastMsgAt':_0x434ea7[_0x185f('0x1e')],'lastMsgDirection':_0x434ea7[_0x185f('0x13')][_0x185f('0x14')]()});}})[_0x185f('0x1f')](function(_0x1cc53b){console[_0x185f('0x20')](_0x1cc53b);});}if(_0x434ea7[_0x185f('0x13')]==='out'&&!_0x434ea7[_0x185f('0x16')]){var _0x5753b4;_0x3c0442[_0x185f('0x21')][_0x185f('0x22')]({'where':{'id':_0x434ea7[_0x185f('0x23')]},'raw':!![]})['then'](function(_0x1ccc5b){_0x5753b4=_0x1ccc5b;if(_0x5753b4&&_0x5753b4[_0x185f('0x24')]){switch(_0x5753b4[_0x185f('0x24')]){case _0x185f('0x25'):var _0x16f514=require(_0x185f('0x25'));if(_0x5753b4[_0x185f('0x26')]&&_0x5753b4[_0x185f('0x27')]&&_0x5753b4[_0x185f('0x28')]){var _0x4f1f65=new _0x16f514(_0x5753b4[_0x185f('0x26')],_0x5753b4[_0x185f('0x27')]);_0x4f1f65[_0x185f('0x29')][_0x185f('0x2a')]({'body':_0x434ea7[_0x185f('0xf')],'to':_0x185f('0x2b')+_0x434ea7['phone'],'from':'whatsapp:'+_0x5753b4['phone'],'statusCallback':_0x5753b4[_0x185f('0x2c')]+'/api/whatsapp/messages/'+_0x434ea7['id']+_0x185f('0x2d')+_0x5753b4[_0x185f('0x2e')]})[_0x185f('0x1c')](function(_0x227195){if(_0x227195[_0x185f('0x2f')]){return _0x4494b6[_0x185f('0x1d')]({'messageId':_0x227195['sid']});}})[_0x185f('0x1f')](function(_0x2ff7d5){logger[_0x185f('0x20')](_0x185f('0x30'),_0x185f('0x31'),_0x185f('0x25'),util[_0x185f('0x32')](_0x2ff7d5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x185f('0x30'),'afterCreate',_0x185f('0x25'),_0x185f('0x33'));}break;}}})[_0x185f('0x34')](function(){_0x1ec2bf();});}else{_0x1ec2bf();}}},'charset':'utf8mb4','collate':_0x185f('0x35')});};
\ No newline at end of file
+var _0x528e=['isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','find','then','type','twilio','accountSid','authToken','phone','messages','body','whatsapp:','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','lodash','util','request-promise','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','FULLTEXT','models','toLowerCase','direction','out','secret'];(function(_0x4c31d9,_0x1706d4){var _0x544efa=function(_0x54598f){while(--_0x54598f){_0x4c31d9['push'](_0x4c31d9['shift']());}};_0x544efa(++_0x1706d4);}(_0x528e,0x157));var _0xe528=function(_0x4711d1,_0x54848a){_0x4711d1=_0x4711d1-0x0;var _0x347cbf=_0x528e[_0x4711d1];return _0x347cbf;};'use strict';var _=require(_0xe528('0x0'));var util=require(_0xe528('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe528('0x2'));var fs=require('fs');var path=require(_0xe528('0x3'));var rimraf=require(_0xe528('0x4'));var config=require('../../config/environment');var attributes=require(_0xe528('0x5'));module[_0xe528('0x6')]=function(_0x299b6f,_0x33866f){return _0x299b6f[_0xe528('0x7')](_0xe528('0x8'),attributes,{'tableName':_0xe528('0x9'),'paranoid':![],'indexes':[{'name':_0xe528('0xa'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0xe528('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38cfad,_0x1fed42,_0x344582){var _0x2216a6=_0x299b6f[_0xe528('0xc')];var _0x2d92a0=_0x38cfad['get']({'plain':!![]});if(_0x2d92a0['direction'][_0xe528('0xd')]()==='in'||_0x2d92a0[_0xe528('0xe')][_0xe528('0xd')]()===_0xe528('0xf')&&!_0x2d92a0[_0xe528('0x10')]&&!_[_0xe528('0x11')](_0x2d92a0[_0xe528('0x12')])){_0x2216a6[_0xe528('0x13')][_0xe528('0x14')]({'where':{'id':_0x2d92a0[_0xe528('0x15')]}})['then'](function(_0x4f6963){if(_0x4f6963){_0x4f6963[_0xe528('0x16')]({'lastMsgAt':_0x2d92a0[_0xe528('0x17')],'lastMsgDirection':_0x2d92a0[_0xe528('0xe')][_0xe528('0xd')]()});}})[_0xe528('0x18')](function(_0x5182e5){console[_0xe528('0x19')](_0x5182e5);});}if(_0x2d92a0[_0xe528('0xe')]===_0xe528('0xf')&&!_0x2d92a0[_0xe528('0x10')]){var _0x158cf3;_0x2216a6[_0xe528('0x1a')][_0xe528('0x1b')]({'where':{'id':_0x2d92a0['WhatsappAccountId']},'raw':!![]})[_0xe528('0x1c')](function(_0x360628){_0x158cf3=_0x360628;if(_0x158cf3&&_0x158cf3[_0xe528('0x1d')]){switch(_0x158cf3[_0xe528('0x1d')]){case'twilio':var _0x3e423a=require(_0xe528('0x1e'));if(_0x158cf3[_0xe528('0x1f')]&&_0x158cf3[_0xe528('0x20')]&&_0x158cf3[_0xe528('0x21')]){var _0x37ea6e=new _0x3e423a(_0x158cf3[_0xe528('0x1f')],_0x158cf3[_0xe528('0x20')]);_0x37ea6e[_0xe528('0x22')]['create']({'body':_0x2d92a0[_0xe528('0x23')],'to':_0xe528('0x24')+_0x2d92a0[_0xe528('0x21')],'from':_0xe528('0x24')+_0x158cf3[_0xe528('0x21')],'statusCallback':_0x158cf3[_0xe528('0x25')]+_0xe528('0x26')+_0x2d92a0['id']+'/status?token='+_0x158cf3[_0xe528('0x27')]})[_0xe528('0x1c')](function(_0x2ccf5f){if(_0x2ccf5f[_0xe528('0x28')]){return _0x38cfad[_0xe528('0x16')]({'messageId':_0x2ccf5f[_0xe528('0x28')]});}})[_0xe528('0x18')](function(_0x332167){logger['error'](_0xe528('0x29'),_0xe528('0x2a'),'twilio',util['inspect'](_0x332167,{'showHidden':![],'depth':null}));});}else{logger[_0xe528('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xe528('0x2a'),_0xe528('0x1e'),_0xe528('0x2b'));}break;}}})[_0xe528('0x2c')](function(){_0x344582();});}else{_0x344582();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 4897d3c..6a6a78e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c6f=['error','code','message','result','CreateWhatsappMessage','create','body','options','info','stringify','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s'];(function(_0x1ea729,_0x3552bb){var _0x3576c4=function(_0xb12275){while(--_0xb12275){_0x1ea729['push'](_0x1ea729['shift']());}};_0x3576c4(++_0x3552bb);}(_0x4c6f,0x16a));var _0xf4c6=function(_0x1af1e1,_0x37bc24){_0x1af1e1=_0x1af1e1-0x0;var _0x5f3450=_0x4c6f[_0x1af1e1];return _0x5f3450;};'use strict';var _=require(_0xf4c6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4c6('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf4c6('0x2'))(_0xf4c6('0x3'));var config=require(_0xf4c6('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xf4c6('0x5')][_0xf4c6('0x6')]({'port':0x232a});config['redis']=_[_0xf4c6('0x7')](config[_0xf4c6('0x8')],{'host':_0xf4c6('0x9'),'port':0x18eb});var socket=require(_0xf4c6('0xa'))(new Redis(config[_0xf4c6('0x8')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x61fb02,_0x18bf00,_0x289326){return new BPromise(function(_0x3c189c,_0x3668e2){return client['request'](_0x61fb02,_0x289326)[_0xf4c6('0xb')](function(_0x16767f){logger['info'](_0xf4c6('0xc'),_0x18bf00,_0xf4c6('0xd'));logger[_0xf4c6('0xe')](_0xf4c6('0xf'),_0x18bf00,'request\x20sent',JSON['stringify'](_0x16767f));if(_0x16767f[_0xf4c6('0x10')]){if(_0x16767f[_0xf4c6('0x10')][_0xf4c6('0x11')]===0x1f4){logger[_0xf4c6('0x10')](_0xf4c6('0xc'),_0x18bf00,_0x16767f[_0xf4c6('0x10')][_0xf4c6('0x12')]);return _0x3668e2(_0x16767f[_0xf4c6('0x10')][_0xf4c6('0x12')]);}logger['error'](_0xf4c6('0xc'),_0x18bf00,_0x16767f['error'][_0xf4c6('0x12')]);return _0x3c189c(_0x16767f['error'][_0xf4c6('0x12')]);}else{logger['info'](_0xf4c6('0xc'),_0x18bf00,'request\x20sent');_0x3c189c(_0x16767f[_0xf4c6('0x13')][_0xf4c6('0x12')]);}})['catch'](function(_0x549884){logger[_0xf4c6('0x10')](_0xf4c6('0xc'),_0x18bf00,_0x549884);_0x3668e2(_0x549884);});});}exports[_0xf4c6('0x14')]=function(_0x2cd11b){var _0x2d368b=this;return new Promise(function(_0x49455a,_0x2d325c){return db['WhatsappMessage'][_0xf4c6('0x15')](_0x2cd11b[_0xf4c6('0x16')],{'raw':_0x2cd11b[_0xf4c6('0x17')]?_0x2cd11b['options']['raw']===undefined?!![]:![]:!![]})[_0xf4c6('0xb')](function(_0x32e192){logger[_0xf4c6('0x18')](_0xf4c6('0x14'),_0x2cd11b);logger[_0xf4c6('0xe')](_0xf4c6('0x14'),_0x2cd11b,JSON[_0xf4c6('0x19')](_0x32e192));_0x49455a(_0x32e192);})[_0xf4c6('0x1a')](function(_0x45ac25){logger[_0xf4c6('0x10')](_0xf4c6('0x14'),_0x45ac25[_0xf4c6('0x12')],_0x2cd11b);_0x2d325c(_0x2d368b[_0xf4c6('0x10')](0x1f4,_0x45ac25[_0xf4c6('0x12')]));});});};
\ No newline at end of file
+var _0x6a1c=['rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateWhatsappMessage','create','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6a1c,0x119));var _0xc6a1=function(_0x1ce478,_0x8cec8){_0x1ce478=_0x1ce478-0x0;var _0xccc7f0=_0x6a1c[_0x1ce478];return _0xccc7f0;};'use strict';var _=require(_0xc6a1('0x0'));var util=require(_0xc6a1('0x1'));var moment=require('moment');var BPromise=require(_0xc6a1('0x2'));var rs=require(_0xc6a1('0x3'));var fs=require('fs');var Redis=require(_0xc6a1('0x4'));var db=require(_0xc6a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6a1('0x6'))(_0xc6a1('0x7'));var config=require(_0xc6a1('0x8'));var jayson=require(_0xc6a1('0x9'));var client=jayson[_0xc6a1('0xa')][_0xc6a1('0xb')]({'port':0x232a});config['redis']=_[_0xc6a1('0xc')](config['redis'],{'host':_0xc6a1('0xd'),'port':0x18eb});var socket=require(_0xc6a1('0xe'))(new Redis(config[_0xc6a1('0xf')]));require(_0xc6a1('0x10'))[_0xc6a1('0x11')](socket);function respondWithRpcPromise(_0x342bbb,_0x30b27d,_0x1f644c){return new BPromise(function(_0x56b12f,_0x342ee1){return client[_0xc6a1('0x12')](_0x342bbb,_0x1f644c)[_0xc6a1('0x13')](function(_0xcc1734){logger[_0xc6a1('0x14')](_0xc6a1('0x15'),_0x30b27d,_0xc6a1('0x16'));logger[_0xc6a1('0x17')](_0xc6a1('0x18'),_0x30b27d,_0xc6a1('0x16'),JSON[_0xc6a1('0x19')](_0xcc1734));if(_0xcc1734['error']){if(_0xcc1734['error']['code']===0x1f4){logger[_0xc6a1('0x1a')](_0xc6a1('0x15'),_0x30b27d,_0xcc1734['error'][_0xc6a1('0x1b')]);return _0x342ee1(_0xcc1734['error'][_0xc6a1('0x1b')]);}logger[_0xc6a1('0x1a')]('WhatsappMessage,\x20%s,\x20%s',_0x30b27d,_0xcc1734[_0xc6a1('0x1a')][_0xc6a1('0x1b')]);return _0x56b12f(_0xcc1734[_0xc6a1('0x1a')][_0xc6a1('0x1b')]);}else{logger['info'](_0xc6a1('0x15'),_0x30b27d,_0xc6a1('0x16'));_0x56b12f(_0xcc1734['result'][_0xc6a1('0x1b')]);}})[_0xc6a1('0x1c')](function(_0x1627d3){logger['error'](_0xc6a1('0x15'),_0x30b27d,_0x1627d3);_0x342ee1(_0x1627d3);});});}exports[_0xc6a1('0x1d')]=function(_0x3e0099){var _0x373e21=this;return new Promise(function(_0x5d60df,_0x583165){return db['WhatsappMessage'][_0xc6a1('0x1e')](_0x3e0099['body'],{'raw':_0x3e0099['options']?_0x3e0099['options'][_0xc6a1('0x1f')]===undefined?!![]:![]:!![]})[_0xc6a1('0x13')](function(_0x1e2618){logger[_0xc6a1('0x14')](_0xc6a1('0x1d'),_0x3e0099);logger[_0xc6a1('0x17')](_0xc6a1('0x1d'),_0x3e0099,JSON[_0xc6a1('0x19')](_0x1e2618));_0x5d60df(_0x1e2618);})[_0xc6a1('0x1c')](function(_0x1c5a42){logger[_0xc6a1('0x1a')]('CreateWhatsappMessage',_0x1c5a42[_0xc6a1('0x1b')],_0x3e0099);_0x583165(_0x373e21['error'](0x1f4,_0x1c5a42['message']));});});};
\ No newline at end of file
index 71162fc..c577689 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba03=['./whatsappMessage.events','update','emit','register'];(function(_0x388c67,_0x3157b9){var _0x917ac0=function(_0x57de0d){while(--_0x57de0d){_0x388c67['push'](_0x388c67['shift']());}};_0x917ac0(++_0x3157b9);}(_0xba03,0x68));var _0x3ba0=function(_0x167729,_0x28fc39){_0x167729=_0x167729-0x0;var _0x4b0686=_0xba03[_0x167729];return _0x4b0686;};'use strict';var WhatsappMessageEvents=require(_0x3ba0('0x0'));var events=['save','remove',_0x3ba0('0x1')];function createListener(_0x4a4651,_0x2c1fac){return function(_0x2b172d){_0x2c1fac[_0x3ba0('0x2')](_0x4a4651,_0x2b172d);};}function removeListener(_0x45bdfb,_0x3e32c6){return function(){WhatsappMessageEvents['removeListener'](_0x45bdfb,_0x3e32c6);};}exports[_0x3ba0('0x3')]=function(_0x5e16fb){for(var _0x1cfa56=0x0,_0x543270=events['length'];_0x1cfa56<_0x543270;_0x1cfa56++){var _0xc37df=events[_0x1cfa56];var _0x3ce5fc=createListener('whatsappMessage:'+_0xc37df,_0x5e16fb);WhatsappMessageEvents['on'](_0xc37df,_0x3ce5fc);}};
\ No newline at end of file
+var _0xc997=['whatsappMessage:','./whatsappMessage.events','update','emit','length'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xc997,0x187));var _0x7c99=function(_0x3bf233,_0x18c281){_0x3bf233=_0x3bf233-0x0;var _0x5f4ba7=_0xc997[_0x3bf233];return _0x5f4ba7;};'use strict';var WhatsappMessageEvents=require(_0x7c99('0x0'));var events=['save','remove',_0x7c99('0x1')];function createListener(_0x187efe,_0x523533){return function(_0x508f6e){_0x523533[_0x7c99('0x2')](_0x187efe,_0x508f6e);};}function removeListener(_0x1fa481,_0x40539c){return function(){WhatsappMessageEvents['removeListener'](_0x1fa481,_0x40539c);};}exports['register']=function(_0x531c5a){for(var _0x4303be=0x0,_0x42e454=events[_0x7c99('0x3')];_0x4303be<_0x42e454;_0x4303be++){var _0x1495ec=events[_0x4303be];var _0x5d888d=createListener(_0x7c99('0x4')+_0x1495ec,_0x531c5a);WhatsappMessageEvents['on'](_0x1495ec,_0x5d888d);}};
\ No newline at end of file
index 0c2f38a..af7e7e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf03e=['show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','destroy','delete','removeAgents','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','/:id'];(function(_0x40d5c8,_0x411c6e){var _0x5f294f=function(_0x573d2b){while(--_0x573d2b){_0x40d5c8['push'](_0x40d5c8['shift']());}};_0x5f294f(++_0x411c6e);}(_0xf03e,0x17d));var _0xef03=function(_0x365653,_0x284663){_0x365653=_0x365653-0x0;var _0x93cd8b=_0xf03e[_0x365653];return _0x93cd8b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xef03('0x0'));var timeout=require(_0xef03('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xef03('0x2'));var auth=require(_0xef03('0x3'));var interaction=require(_0xef03('0x4'));var config=require(_0xef03('0x5'));var controller=require(_0xef03('0x6'));router[_0xef03('0x7')]('/',auth[_0xef03('0x8')](),controller['index']);router[_0xef03('0x7')](_0xef03('0x9'),auth[_0xef03('0x8')](),controller['describe']);router[_0xef03('0x7')](_0xef03('0xa'),auth[_0xef03('0x8')](),controller[_0xef03('0xb')]);router[_0xef03('0x7')](_0xef03('0xc'),auth[_0xef03('0x8')](),controller[_0xef03('0xd')]);router[_0xef03('0x7')](_0xef03('0xe'),auth[_0xef03('0x8')](),controller[_0xef03('0xf')]);router[_0xef03('0x7')](_0xef03('0x10'),auth[_0xef03('0x8')](),controller[_0xef03('0x11')]);router['post']('/',auth[_0xef03('0x8')](),controller[_0xef03('0x12')]);router[_0xef03('0x13')](_0xef03('0xe'),auth[_0xef03('0x8')](),controller[_0xef03('0x14')]);router[_0xef03('0x13')](_0xef03('0x10'),auth[_0xef03('0x8')](),controller[_0xef03('0x15')]);router[_0xef03('0x16')](_0xef03('0xa'),auth[_0xef03('0x8')](),controller[_0xef03('0x17')]);router['delete'](_0xef03('0xa'),auth[_0xef03('0x8')](),controller[_0xef03('0x18')]);router[_0xef03('0x19')](_0xef03('0xe'),auth[_0xef03('0x8')](),controller['removeTeams']);router[_0xef03('0x19')](_0xef03('0x10'),auth['isAuthenticated'](),controller[_0xef03('0x1a')]);module[_0xef03('0x1b')]=router;
\ No newline at end of file
+var _0x6c0c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout'];(function(_0x45bca1,_0x5c32d3){var _0xd4cac2=function(_0x28d439){while(--_0x28d439){_0x45bca1['push'](_0x45bca1['shift']());}};_0xd4cac2(++_0x5c32d3);}(_0x6c0c,0x11f));var _0xc6c0=function(_0x21de5f,_0x9d6f92){_0x21de5f=_0x21de5f-0x0;var _0x5136b2=_0x6c0c[_0x21de5f];return _0x5136b2;};'use strict';var multer=require(_0xc6c0('0x0'));var util=require('util');var path=require(_0xc6c0('0x1'));var timeout=require(_0xc6c0('0x2'));var express=require('express');var router=express[_0xc6c0('0x3')]();var fs_extra=require(_0xc6c0('0x4'));var auth=require(_0xc6c0('0x5'));var interaction=require(_0xc6c0('0x6'));var config=require(_0xc6c0('0x7'));var controller=require(_0xc6c0('0x8'));router['get']('/',auth[_0xc6c0('0x9')](),controller[_0xc6c0('0xa')]);router[_0xc6c0('0xb')](_0xc6c0('0xc'),auth[_0xc6c0('0x9')](),controller[_0xc6c0('0xd')]);router['get'](_0xc6c0('0xe'),auth[_0xc6c0('0x9')](),controller[_0xc6c0('0xf')]);router[_0xc6c0('0xb')]('/:id/members',auth[_0xc6c0('0x9')](),controller[_0xc6c0('0x10')]);router[_0xc6c0('0xb')](_0xc6c0('0x11'),auth['isAuthenticated'](),controller[_0xc6c0('0x12')]);router[_0xc6c0('0xb')](_0xc6c0('0x13'),auth[_0xc6c0('0x9')](),controller[_0xc6c0('0x14')]);router[_0xc6c0('0x15')]('/',auth[_0xc6c0('0x9')](),controller['create']);router['post'](_0xc6c0('0x11'),auth['isAuthenticated'](),controller['addTeams']);router[_0xc6c0('0x15')](_0xc6c0('0x13'),auth[_0xc6c0('0x9')](),controller['addAgents']);router[_0xc6c0('0x16')](_0xc6c0('0xe'),auth[_0xc6c0('0x9')](),controller[_0xc6c0('0x17')]);router['delete'](_0xc6c0('0xe'),auth['isAuthenticated'](),controller[_0xc6c0('0x18')]);router[_0xc6c0('0x19')](_0xc6c0('0x11'),auth[_0xc6c0('0x9')](),controller[_0xc6c0('0x1a')]);router[_0xc6c0('0x19')](_0xc6c0('0x13'),auth[_0xc6c0('0x9')](),controller[_0xc6c0('0x1b')]);module[_0xc6c0('0x1c')]=router;
\ No newline at end of file
index 8e4ab31..324ddb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f6a=['sequelize','name','INTEGER','ENUM','rrmemory','roundrobin','STRING'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x1f9c6b,_0x3ac5d4){_0x1f9c6b=_0x1f9c6b-0x0;var _0xb6963c=_0x5f6a[_0x1f9c6b];return _0xb6963c;};'use strict';var Sequelize=require(_0xa5f6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa5f6('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xa5f6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa5f6('0x3')](_0xa5f6('0x4'),'beepall',_0xa5f6('0x5'))},'description':{'type':Sequelize[_0xa5f6('0x6')]}};
\ No newline at end of file
+var _0x79d8=['STRING','name','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x381bfd,_0x20c82a){var _0x4a14ab=function(_0xee6164){while(--_0xee6164){_0x381bfd['push'](_0x381bfd['shift']());}};_0x4a14ab(++_0x20c82a);}(_0x79d8,0x67));var _0x879d=function(_0x2b649c,_0x4fda46){_0x2b649c=_0x2b649c-0x0;var _0x2dc4bd=_0x79d8[_0x2b649c];return _0x2dc4bd;};'use strict';var Sequelize=require(_0x879d('0x0'));module[_0x879d('0x1')]={'name':{'type':Sequelize[_0x879d('0x2')],'unique':_0x879d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x879d('0x4')](_0x879d('0x5'),'beepall',_0x879d('0x6'))},'description':{'type':Sequelize[_0x879d('0x2')]}};
\ No newline at end of file
index 8ec44de..989efb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x121f=['limit','count','status','set','apply','reject','save','update','destroy','then','get','WhatsappQueues','UserProfileResource','name','index','map','WhatsappQueue','fieldName','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','catch','show','params','filters','fields','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','findAll','User','UserId','agent','whatsappPause','updatedAt','createdAt','rows','format','getTeams','Team','rawAttributes','options','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','emit','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','path','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','redis','./whatsappQueue.socket','sendStatus','offset','undefined'];(function(_0x31e982,_0x521c6a){var _0x3efb59=function(_0x9a5416){while(--_0x9a5416){_0x31e982['push'](_0x31e982['shift']());}};_0x3efb59(++_0x521c6a);}(_0x121f,0x6e));var _0xf121=function(_0x1269c6,_0x1c8942){_0x1269c6=_0x1269c6-0x0;var _0x4868c7=_0x121f[_0x1269c6];return _0x4868c7;};'use strict';var emlformat=require(_0xf121('0x0'));var rimraf=require(_0xf121('0x1'));var zipdir=require(_0xf121('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf121('0x3'));var moment=require('moment');var BPromise=require(_0xf121('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf121('0x5'));var sox=require('sox');var csv=require(_0xf121('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf121('0x7'));var _=require(_0xf121('0x8'));var squel=require(_0xf121('0x9'));var crypto=require(_0xf121('0xa'));var jsforce=require(_0xf121('0xb'));var deskjs=require(_0xf121('0xc'));var toCsv=require(_0xf121('0x6'));var querystring=require(_0xf121('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf121('0xe'));var qs=require(_0xf121('0xf'));var as=require(_0xf121('0x10'));var hardwareService=require(_0xf121('0x11'));var logger=require('../../config/logger')(_0xf121('0x12'));var utils=require(_0xf121('0x13'));var config=require(_0xf121('0x14'));var licenseUtil=require(_0xf121('0x15'));var db=require(_0xf121('0x16'))['db'];config[_0xf121('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf121('0x17')]));require(_0xf121('0x18'))['register'](socket);function respondWithStatusCode(_0xbc2cf7,_0x1af071){_0x1af071=_0x1af071||0xcc;return function(_0xef3140){if(_0xef3140){return _0xbc2cf7[_0xf121('0x19')](_0x1af071);}return _0xbc2cf7['status'](_0x1af071)['end']();};}function respondWithResult(_0x16073b,_0x6da32d){_0x6da32d=_0x6da32d||0xc8;return function(_0x52cd5f){if(_0x52cd5f){return _0x16073b['status'](_0x6da32d)['json'](_0x52cd5f);}};}function respondWithFilteredResult(_0x2257c3,_0x140a2c){return function(_0x2d111a){if(_0x2d111a){var _0x56fcb1=typeof _0x140a2c[_0xf121('0x1a')]===_0xf121('0x1b')&&typeof _0x140a2c[_0xf121('0x1c')]===_0xf121('0x1b');var _0x1824f3=_0x2d111a[_0xf121('0x1d')];var _0x49f855=_0x56fcb1?0x0:_0x140a2c[_0xf121('0x1a')];var _0x4bdf67=_0x56fcb1?_0x2d111a['count']:_0x140a2c[_0xf121('0x1a')]+_0x140a2c[_0xf121('0x1c')];var _0x26cc1b;if(_0x4bdf67>=_0x1824f3){_0x4bdf67=_0x1824f3;_0x26cc1b=0xc8;}else{_0x26cc1b=0xce;}_0x2257c3[_0xf121('0x1e')](_0x26cc1b);return _0x2257c3[_0xf121('0x1f')]('Content-Range',_0x49f855+'-'+_0x4bdf67+'/'+_0x1824f3)['json'](_0x2d111a);}return null;};}function patchUpdates(_0x4bbfbb){return function(_0x2fda41){try{jsonpatch[_0xf121('0x20')](_0x2fda41,_0x4bbfbb,!![]);}catch(_0x4d501d){return BPromise[_0xf121('0x21')](_0x4d501d);}return _0x2fda41[_0xf121('0x22')]();};}function saveUpdates(_0x49cf5c,_0x18a270){return function(_0x150998){if(_0x150998){return _0x150998[_0xf121('0x23')](_0x49cf5c)['then'](function(_0x2bcce4){return _0x2bcce4;});}return null;};}function removeEntity(_0x1105c4,_0x528c1e){return function(_0xdbffad){if(_0xdbffad){return _0xdbffad[_0xf121('0x24')]()[_0xf121('0x25')](function(){var _0xc86b18=_0xdbffad[_0xf121('0x26')]({'plain':!![]});var _0xb93580=_0xf121('0x27');return db[_0xf121('0x28')][_0xf121('0x24')]({'where':{'type':_0xb93580,'resourceId':_0xc86b18['id']}})[_0xf121('0x25')](function(){return _0xdbffad;});})[_0xf121('0x25')](function(){_0x1105c4[_0xf121('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5943d4,_0x456a44){return function(_0x119fbf){if(!_0x119fbf){_0x5943d4['sendStatus'](0x194);}return _0x119fbf;};}function handleError(_0x9fa161,_0x52b5b1){_0x52b5b1=_0x52b5b1||0x1f4;return function(_0x2e6844){logger['error'](_0x2e6844['stack']);if(_0x2e6844[_0xf121('0x29')]){delete _0x2e6844[_0xf121('0x29')];}_0x9fa161[_0xf121('0x1e')](_0x52b5b1)['send'](_0x2e6844);};}exports[_0xf121('0x2a')]=function(_0x51bcdb,_0x221fdb){var _0x5a4dee={},_0x3cd9ee={},_0xbba9d5={'count':0x0,'rows':[]};var _0x275cfb=_[_0xf121('0x2b')](db[_0xf121('0x2c')]['rawAttributes'],function(_0x58b1ce){return{'name':_0x58b1ce[_0xf121('0x2d')],'type':_0x58b1ce['type'][_0xf121('0x2e')]};});_0x3cd9ee[_0xf121('0x2f')]=_['map'](_0x275cfb,_0xf121('0x29'));_0x3cd9ee[_0xf121('0x30')]=_[_0xf121('0x31')](_0x51bcdb[_0xf121('0x30')]);_0x3cd9ee['filters']=_[_0xf121('0x32')](_0x3cd9ee[_0xf121('0x2f')],_0x3cd9ee[_0xf121('0x30')]);_0x5a4dee[_0xf121('0x33')]=_[_0xf121('0x32')](_0x3cd9ee['model'],qs['fields'](_0x51bcdb[_0xf121('0x30')]['fields']));_0x5a4dee[_0xf121('0x33')]=_0x5a4dee['attributes'][_0xf121('0x34')]?_0x5a4dee[_0xf121('0x33')]:_0x3cd9ee['model'];if(!_0x51bcdb[_0xf121('0x30')]['hasOwnProperty'](_0xf121('0x35'))){_0x5a4dee['limit']=qs[_0xf121('0x1c')](_0x51bcdb[_0xf121('0x30')]['limit']);_0x5a4dee[_0xf121('0x1a')]=qs[_0xf121('0x1a')](_0x51bcdb[_0xf121('0x30')][_0xf121('0x1a')]);}_0x5a4dee[_0xf121('0x36')]=qs[_0xf121('0x37')](_0x51bcdb[_0xf121('0x30')][_0xf121('0x37')]);_0x5a4dee[_0xf121('0x38')]=qs['filters'](_[_0xf121('0x39')](_0x51bcdb['query'],_0x3cd9ee['filters']),_0x275cfb);if(_0x51bcdb[_0xf121('0x30')][_0xf121('0x3a')]){_0x5a4dee['where']=_[_0xf121('0x3b')](_0x5a4dee[_0xf121('0x38')],{'$or':_[_0xf121('0x2b')](_0x275cfb,function(_0x452e61){if(_0x452e61[_0xf121('0x3c')]!==_0xf121('0x3d')){var _0x3bdbbe={};_0x3bdbbe[_0x452e61[_0xf121('0x29')]]={'$like':'%'+_0x51bcdb['query'][_0xf121('0x3a')]+'%'};return _0x3bdbbe;}})});}_0x5a4dee=_[_0xf121('0x3b')]({},_0x5a4dee,_0x51bcdb['options']);var _0x5ee3ba={'where':_0x5a4dee[_0xf121('0x38')]};return db[_0xf121('0x2c')]['count'](_0x5ee3ba)['then'](function(_0x2dc16b){_0xbba9d5[_0xf121('0x1d')]=_0x2dc16b;if(_0x51bcdb[_0xf121('0x30')][_0xf121('0x3e')]){_0x5a4dee['include']=[{'all':!![]}];}return db[_0xf121('0x2c')]['findAll'](_0x5a4dee);})['then'](function(_0x48e8b8){_0xbba9d5['rows']=_0x48e8b8;return _0xbba9d5;})[_0xf121('0x25')](respondWithFilteredResult(_0x221fdb,_0x5a4dee))[_0xf121('0x3f')](handleError(_0x221fdb,null));};exports[_0xf121('0x40')]=function(_0x42eeac,_0x3d9d77){var _0x33ddf4={'raw':!![],'where':{'id':_0x42eeac[_0xf121('0x41')]['id']}},_0x2f44a1={};_0x2f44a1[_0xf121('0x2f')]=_[_0xf121('0x31')](db['WhatsappQueue']['rawAttributes']);_0x2f44a1[_0xf121('0x30')]=_[_0xf121('0x31')](_0x42eeac[_0xf121('0x30')]);_0x2f44a1[_0xf121('0x42')]=_[_0xf121('0x32')](_0x2f44a1['model'],_0x2f44a1[_0xf121('0x30')]);_0x33ddf4['attributes']=_[_0xf121('0x32')](_0x2f44a1[_0xf121('0x2f')],qs[_0xf121('0x43')](_0x42eeac['query']['fields']));_0x33ddf4[_0xf121('0x33')]=_0x33ddf4[_0xf121('0x33')]['length']?_0x33ddf4['attributes']:_0x2f44a1[_0xf121('0x2f')];if(_0x42eeac[_0xf121('0x30')][_0xf121('0x3e')]){_0x33ddf4[_0xf121('0x44')]=[{'all':!![]}];}_0x33ddf4=_[_0xf121('0x3b')]({},_0x33ddf4,_0x42eeac['options']);return db[_0xf121('0x2c')][_0xf121('0x45')](_0x33ddf4)[_0xf121('0x25')](handleEntityNotFound(_0x3d9d77,null))['then'](respondWithResult(_0x3d9d77,null))[_0xf121('0x3f')](handleError(_0x3d9d77,null));};exports[_0xf121('0x46')]=function(_0x484ea7,_0x273311){return db['WhatsappQueue'][_0xf121('0x46')](_0x484ea7['body'],{})[_0xf121('0x25')](function(_0x5512dd){var _0x11ae33=_0x484ea7[_0xf121('0x47')][_0xf121('0x26')]({'plain':!![]});if(!_0x11ae33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11ae33[_0xf121('0x48')]===_0xf121('0x47')){var _0x42f008=_0x5512dd[_0xf121('0x26')]({'plain':!![]});var _0x5e726b=_0xf121('0x27');return db[_0xf121('0x49')]['find']({'where':{'name':_0x5e726b,'userProfileId':_0x11ae33[_0xf121('0x4a')]},'raw':!![]})[_0xf121('0x25')](function(_0x505673){if(_0x505673&&_0x505673[_0xf121('0x4b')]===0x0){return db[_0xf121('0x28')][_0xf121('0x46')]({'name':_0x42f008['name'],'resourceId':_0x42f008['id'],'type':_0x505673[_0xf121('0x29')],'sectionId':_0x505673['id']},{})[_0xf121('0x25')](function(){return _0x5512dd;});}else{return _0x5512dd;}})['catch'](function(_0x22f08f){logger[_0xf121('0x4c')](_0xf121('0x4d'),_0x22f08f);throw _0x22f08f;});}return _0x5512dd;})[_0xf121('0x25')](respondWithResult(_0x273311,0xc9))[_0xf121('0x3f')](handleError(_0x273311,null));};exports['update']=function(_0x16c4bc,_0xb52e){if(_0x16c4bc[_0xf121('0x4e')]['id']){delete _0x16c4bc[_0xf121('0x4e')]['id'];}return db[_0xf121('0x2c')][_0xf121('0x45')]({'where':{'id':_0x16c4bc[_0xf121('0x41')]['id']}})[_0xf121('0x25')](handleEntityNotFound(_0xb52e,null))[_0xf121('0x25')](saveUpdates(_0x16c4bc[_0xf121('0x4e')],null))[_0xf121('0x25')](respondWithResult(_0xb52e,null))[_0xf121('0x3f')](handleError(_0xb52e,null));};exports[_0xf121('0x24')]=function(_0x1e9d30,_0x3656b7){return db['WhatsappQueue'][_0xf121('0x45')]({'where':{'id':_0x1e9d30[_0xf121('0x41')]['id']}})[_0xf121('0x25')](handleEntityNotFound(_0x3656b7,null))[_0xf121('0x25')](removeEntity(_0x3656b7,null))[_0xf121('0x3f')](handleError(_0x3656b7,null));};exports[_0xf121('0x4f')]=function(_0x548863,_0x12cbe2){return db[_0xf121('0x2c')][_0xf121('0x4f')]()[_0xf121('0x25')](respondWithResult(_0x12cbe2,null))[_0xf121('0x3f')](handleError(_0x12cbe2,null));};exports[_0xf121('0x50')]=function(_0x128852,_0x21114,_0xf5fa4b){var _0x3c2fa3={'raw':!![],'where':{}},_0x6f6919={},_0x2409c2;return db['WhatsappQueue'][_0xf121('0x51')]({'where':{'id':_0x128852[_0xf121('0x41')]['id']}})[_0xf121('0x25')](handleEntityNotFound(_0x21114,null))['then'](function(_0xd7b271){if(_0xd7b271){_0x2409c2=_0xd7b271[_0xf121('0x26')]({'plain':!![]});_0x6f6919[_0xf121('0x2f')]=_['keys'](db[_0xf121('0x52')]['rawAttributes']);_0x6f6919['query']=_[_0xf121('0x31')](_0x128852['query']);_0x6f6919[_0xf121('0x42')]=_[_0xf121('0x32')](_0x6f6919[_0xf121('0x2f')],_0x6f6919[_0xf121('0x30')]);_0x3c2fa3[_0xf121('0x33')]=_[_0xf121('0x32')](_0x6f6919[_0xf121('0x2f')],qs[_0xf121('0x43')](_0x128852[_0xf121('0x30')][_0xf121('0x43')]));_0x3c2fa3[_0xf121('0x33')]=_0x3c2fa3[_0xf121('0x33')][_0xf121('0x34')]?_0x3c2fa3[_0xf121('0x33')]:_0x6f6919[_0xf121('0x2f')];if(!_0x128852[_0xf121('0x30')][_0xf121('0x53')](_0xf121('0x35'))){_0x3c2fa3['limit']=qs[_0xf121('0x1c')](_0x128852['query']['limit']);_0x3c2fa3[_0xf121('0x1a')]=qs[_0xf121('0x1a')](_0x128852[_0xf121('0x30')]['offset']);}_0x3c2fa3[_0xf121('0x36')]=qs[_0xf121('0x37')](_0x128852['query']['sort']);_0x3c2fa3['where']=qs[_0xf121('0x42')](_[_0xf121('0x39')](_0x128852[_0xf121('0x30')],_0x6f6919[_0xf121('0x42')]));_0x3c2fa3['where'][_0xf121('0x54')]=_0xd7b271['id'];if(_0x128852[_0xf121('0x30')]['filter']){_0x3c2fa3[_0xf121('0x38')]=_[_0xf121('0x3b')](_0x3c2fa3[_0xf121('0x38')],{'$or':_['map'](_0x3c2fa3['attributes'],function(_0x55722d){var _0x3b3862={};_0x3b3862[_0x55722d]={'$like':'%'+_0x128852['query'][_0xf121('0x3a')]+'%'};return _0x3b3862;})});}_0x3c2fa3=_[_0xf121('0x3b')]({},_0x3c2fa3,_0x128852['options']);return db[_0xf121('0x52')][_0xf121('0x55')](_0x3c2fa3);}})['then'](function(_0x38bb46){if(_0x38bb46){return db[_0xf121('0x56')]['findAndCountAll']({'where':{'id':_[_0xf121('0x2b')](_0x38bb46,_0xf121('0x57')),'role':_0xf121('0x58')},'attributes':['id','name',_0xf121('0x59'),_0xf121('0x5a'),_0xf121('0x5b')]});}})[_0xf121('0x25')](function(_0x534dc2){if(_0x534dc2){return{'count':_0x534dc2[_0xf121('0x1d')],'rows':_['map'](_0x534dc2[_0xf121('0x5c')],function(_0x5b7d4f){return{'membername':_0x5b7d4f['name'],'UserId':_0x5b7d4f['id'],'queue_name':_0x2409c2[_0xf121('0x29')],'WhatsappQueueId':_0x2409c2['id'],'interface':util[_0xf121('0x5d')]('%s/%s','SIP',_0x5b7d4f[_0xf121('0x29')]),'penalty':0x0,'paused':_0x5b7d4f[_0xf121('0x59')],'createdAt':_0x5b7d4f[_0xf121('0x5b')],'updatedAt':_0x5b7d4f[_0xf121('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf121('0x25')](respondWithFilteredResult(_0x21114,_0x3c2fa3))[_0xf121('0x3f')](handleError(_0x21114,null));};exports[_0xf121('0x5e')]=function(_0x3c0b27,_0x218194,_0x1f8f7d){var _0x4c8de2={};var _0x4e6d1f={};var _0x4a7e98;var _0x56d122;return db['WhatsappQueue'][_0xf121('0x51')]({'where':{'id':_0x3c0b27[_0xf121('0x41')]['id']}})[_0xf121('0x25')](handleEntityNotFound(_0x218194,null))[_0xf121('0x25')](function(_0xb01b8a){if(_0xb01b8a){_0x4a7e98=_0xb01b8a;_0x4e6d1f[_0xf121('0x2f')]=_['keys'](db[_0xf121('0x5f')][_0xf121('0x60')]);_0x4e6d1f[_0xf121('0x30')]=_['keys'](_0x3c0b27[_0xf121('0x30')]);_0x4e6d1f[_0xf121('0x42')]=_['intersection'](_0x4e6d1f['model'],_0x4e6d1f[_0xf121('0x30')]);_0x4c8de2[_0xf121('0x33')]=_['intersection'](_0x4e6d1f[_0xf121('0x2f')],qs[_0xf121('0x43')](_0x3c0b27[_0xf121('0x30')][_0xf121('0x43')]));_0x4c8de2[_0xf121('0x33')]=_0x4c8de2[_0xf121('0x33')][_0xf121('0x34')]?_0x4c8de2[_0xf121('0x33')]:_0x4e6d1f[_0xf121('0x2f')];_0x4c8de2[_0xf121('0x36')]=qs[_0xf121('0x37')](_0x3c0b27[_0xf121('0x30')]['sort']);_0x4c8de2[_0xf121('0x38')]=qs[_0xf121('0x42')](_[_0xf121('0x39')](_0x3c0b27[_0xf121('0x30')],_0x4e6d1f[_0xf121('0x42')]));if(_0x3c0b27[_0xf121('0x30')]['filter']){_0x4c8de2[_0xf121('0x38')]=_[_0xf121('0x3b')](_0x4c8de2[_0xf121('0x38')],{'$or':_[_0xf121('0x2b')](_0x4c8de2['attributes'],function(_0x2ca91c){var _0x52e7a2={};_0x52e7a2[_0x2ca91c]={'$like':'%'+_0x3c0b27[_0xf121('0x30')][_0xf121('0x3a')]+'%'};return _0x52e7a2;})});}_0x4c8de2=_[_0xf121('0x3b')]({},_0x4c8de2,_0x3c0b27[_0xf121('0x61')]);return _0x4a7e98['getTeams'](_0x4c8de2);}})[_0xf121('0x25')](function(_0x52ff70){if(_0x52ff70){_0x56d122=_0x52ff70[_0xf121('0x34')];if(!_0x3c0b27['query'][_0xf121('0x53')](_0xf121('0x35'))){_0x4c8de2[_0xf121('0x1c')]=qs['limit'](_0x3c0b27['query'][_0xf121('0x1c')]);_0x4c8de2[_0xf121('0x1a')]=qs[_0xf121('0x1a')](_0x3c0b27[_0xf121('0x30')][_0xf121('0x1a')]);}return _0x4a7e98[_0xf121('0x5e')](_0x4c8de2);}})[_0xf121('0x25')](function(_0x27e170){if(_0x27e170){return _0x27e170?{'count':_0x56d122,'rows':_0x27e170}:null;}})[_0xf121('0x25')](respondWithResult(_0x218194,null))[_0xf121('0x3f')](handleError(_0x218194,null));};exports[_0xf121('0x62')]=function(_0x5f23d4,_0x360be0,_0x4a8d4c){var _0x3783e2=_0x5f23d4[_0xf121('0x4e')][_0xf121('0x63')];return db[_0xf121('0x5f')][_0xf121('0x55')]({'where':{'id':_0x3783e2},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf121('0x64'),'attributes':['id','name','online',_0xf121('0x65'),_0xf121('0x66')],'raw':!![]}]})['then'](function(_0x26a7a8){if(_0x26a7a8){var _0x17d569=_[_0xf121('0x67')](_0x26a7a8,function(_0x4b7ed7){var _0x465b3c=_0x4b7ed7[_0xf121('0x26')]({'plain':!![]});return _0x465b3c['Agents'];});return db[_0xf121('0x2c')][_0xf121('0x45')]({'where':{'id':_0x5f23d4[_0xf121('0x41')]['id']}})['then'](function(_0x45a802){return db[_0xf121('0x68')][_0xf121('0x69')](function(_0x41bc56){return _0x45a802[_0xf121('0x62')](_0x3783e2,{'transaction':_0x41bc56})[_0xf121('0x25')](function(){return BPromise[_0xf121('0x6a')](_0x17d569,function(_0x31d989){return db[_0xf121('0x52')][_0xf121('0x6b')]({'where':{'UserId':_0x31d989['id'],'WhatsappQueueId':_0x5f23d4[_0xf121('0x41')]['id']},'transaction':_0x41bc56});});})[_0xf121('0x25')](function(){_0x17d569[_0xf121('0x6c')](function(_0x33d10e){socket['emit'](_0xf121('0x6d'),{'UserId':_0x33d10e['id'],'WhatsappQueueId':_0x45a802['id']});});});});});}})['then'](respondWithStatusCode(_0x360be0,null))[_0xf121('0x3f')](handleError(_0x360be0,null));};exports[_0xf121('0x6e')]=function(_0x2e6acb,_0x2b46e7,_0x25d447){return db['Team'][_0xf121('0x55')]({'where':{'id':_0x2e6acb[_0xf121('0x30')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf121('0x64'),'attributes':['id'],'raw':!![]}]})[_0xf121('0x25')](handleEntityNotFound(_0x2b46e7,null))[_0xf121('0x25')](function(_0x30268c){var _0xd5ae90=_[_0xf121('0x2b')](_0x30268c,'id');var _0x44141e=[];var _0x32d2ff=[];var _0x78b9d4=squel['select']();_0x78b9d4[_0xf121('0x6f')](_0xf121('0x70'))[_0xf121('0x71')](_0xf121('0x72'),'tq')[_0xf121('0x73')](_0xf121('0x74'),'ut',_0xf121('0x75'))[_0xf121('0x38')]('WhatsappQueueId\x20=\x20?',_0x2e6acb[_0xf121('0x41')]['id']);for(var _0x5ee1d1=0x0;_0x5ee1d1<_0x30268c[_0xf121('0x34')];_0x5ee1d1+=0x1){let _0x828492=_0x30268c[_0x5ee1d1];for(var _0x2d6307=0x0;_0x2d6307<_0x828492[_0xf121('0x64')][_0xf121('0x34')];_0x2d6307+=0x1){let _0x3798aa=_0x828492[_0xf121('0x64')][_0x2d6307];var _0x30dd12=_0x78b9d4[_0xf121('0x76')]();_0x30dd12['where'](_0xf121('0x77'),_0x3798aa['id']);_0x32d2ff[_0xf121('0x78')](db[_0xf121('0x68')]['query'](_0x30dd12[_0xf121('0x79')](),{'type':db[_0xf121('0x68')][_0xf121('0x7a')]['SELECT']})['then'](function(_0x3b269a){if(_0x3b269a[_0xf121('0x34')]===0x1){return _0x3798aa['id'];}else{var _0x5b2a06=_[_0xf121('0x7b')](_[_0xf121('0x2b')](_0x3b269a,_0xf121('0x7c')),function(_0x577505){return _[_0xf121('0x7d')](_0xd5ae90,_0x577505);});if(_0x5b2a06){return _0x3798aa['id'];}}}));}}return BPromise[_0xf121('0x7e')](_0x32d2ff)['then'](function(_0x116e43){_0x44141e=_(_0x44141e)[_0xf121('0x7f')](_0x116e43)[_0xf121('0x80')]()['value']();return db[_0xf121('0x2c')]['find']({'where':{'id':_0x2e6acb[_0xf121('0x41')]['id']}})[_0xf121('0x25')](function(_0x57cae5){return db[_0xf121('0x68')][_0xf121('0x69')](function(_0x2cc12a){return _0x57cae5[_0xf121('0x6e')](_0x2e6acb[_0xf121('0x30')][_0xf121('0x63')],{'transaction':_0x2cc12a})['then'](function(){if(!_[_0xf121('0x81')](_0x44141e)){return _0x57cae5[_0xf121('0x82')](_0x44141e,{'transaction':_0x2cc12a});}})[_0xf121('0x25')](function(){_0x44141e[_0xf121('0x6c')](function(_0x214519){socket[_0xf121('0x83')](_0xf121('0x84'),{'UserId':_0x214519,'WhatsappQueueId':_0x57cae5['id']});});});});});});})[_0xf121('0x25')](respondWithStatusCode(_0x2b46e7,null))[_0xf121('0x3f')](handleError(_0x2b46e7,null));};exports['addAgents']=function(_0x27e235,_0x30306a,_0xe4b44b){return db['WhatsappQueue'][_0xf121('0x45')]({'where':{'id':_0x27e235[_0xf121('0x41')]['id']}})[_0xf121('0x25')](handleEntityNotFound(_0x30306a,null))['then'](function(_0x3e3791){if(_0x3e3791){return _0x3e3791[_0xf121('0x85')](_0x27e235[_0xf121('0x4e')][_0xf121('0x63')],_[_0xf121('0x86')](_0x27e235[_0xf121('0x4e')],[_0xf121('0x63'),'id'])||{})[_0xf121('0x87')](function(_0x2dbd13){for(var _0x483b08=0x0;_0x483b08<_0x27e235['body']['ids']['length'];_0x483b08+=0x1){socket[_0xf121('0x83')](_0xf121('0x6d'),{'UserId':Number(_0x27e235[_0xf121('0x4e')][_0xf121('0x63')][_0x483b08]),'WhatsappQueueId':Number(_0x27e235[_0xf121('0x41')]['id'])});}return _0x2dbd13;});}})[_0xf121('0x25')](respondWithResult(_0x30306a,null))[_0xf121('0x3f')](handleError(_0x30306a,null));};exports['removeAgents']=function(_0x4ec6d4,_0x18e8c4,_0x2dbd7c){return db[_0xf121('0x2c')][_0xf121('0x45')]({'where':{'id':_0x4ec6d4[_0xf121('0x41')]['id']}})[_0xf121('0x25')](handleEntityNotFound(_0x18e8c4,null))['then'](function(_0x52338c){if(_0x52338c){return _0x52338c[_0xf121('0x82')](_0x4ec6d4['query'][_0xf121('0x63')])[_0xf121('0x25')](function(){if(_[_0xf121('0x88')](_0x4ec6d4[_0xf121('0x30')][_0xf121('0x63')])){for(var _0x407ccc=0x0;_0x407ccc<_0x4ec6d4['query'][_0xf121('0x63')][_0xf121('0x34')];_0x407ccc+=0x1){socket[_0xf121('0x83')](_0xf121('0x84'),{'UserId':Number(_0x4ec6d4['query'][_0xf121('0x63')][_0x407ccc]),'WhatsappQueueId':Number(_0x4ec6d4[_0xf121('0x41')]['id'])});}}else{socket[_0xf121('0x83')](_0xf121('0x84'),{'UserId':Number(_0x4ec6d4['query']['ids']),'WhatsappQueueId':Number(_0x4ec6d4['params']['id'])});}});}})[_0xf121('0x25')](respondWithStatusCode(_0x18e8c4,null))[_0xf121('0x3f')](handleError(_0x18e8c4,null));};exports[_0xf121('0x89')]=function(_0x40425a,_0x4230af,_0x548207){var _0x544819={};var _0x86248a={};var _0x9c5d86;var _0x4f7ba8;return db[_0xf121('0x2c')][_0xf121('0x51')]({'where':{'id':_0x40425a[_0xf121('0x41')]['id']}})[_0xf121('0x25')](handleEntityNotFound(_0x4230af,null))['then'](function(_0x19c7b7){if(_0x19c7b7){_0x9c5d86=_0x19c7b7;_0x86248a[_0xf121('0x2f')]=_[_0xf121('0x31')](db[_0xf121('0x56')]['rawAttributes']);_0x86248a['query']=_[_0xf121('0x31')](_0x40425a['query']);_0x86248a[_0xf121('0x42')]=_[_0xf121('0x32')](_0x86248a[_0xf121('0x2f')],_0x86248a['query']);_0x544819[_0xf121('0x33')]=_[_0xf121('0x32')](_0x86248a[_0xf121('0x2f')],qs[_0xf121('0x43')](_0x40425a['query'][_0xf121('0x43')]));_0x544819['attributes']=_0x544819[_0xf121('0x33')][_0xf121('0x34')]?_0x544819['attributes']:_0x86248a['model'];_0x544819[_0xf121('0x36')]=qs['sort'](_0x40425a[_0xf121('0x30')][_0xf121('0x37')]);_0x544819[_0xf121('0x38')]=qs[_0xf121('0x42')](_[_0xf121('0x39')](_0x40425a['query'],_0x86248a[_0xf121('0x42')]));if(_0x40425a[_0xf121('0x30')][_0xf121('0x3a')]){_0x544819[_0xf121('0x38')]=_['merge'](_0x544819[_0xf121('0x38')],{'$or':_[_0xf121('0x2b')](_0x544819['attributes'],function(_0x46fb67){var _0x24f505={};_0x24f505[_0x46fb67]={'$like':'%'+_0x40425a[_0xf121('0x30')][_0xf121('0x3a')]+'%'};return _0x24f505;})});}_0x544819=_[_0xf121('0x3b')]({},_0x544819,_0x40425a[_0xf121('0x61')]);return _0x9c5d86['getAgents'](_0x544819);}})['then'](function(_0x1f06da){if(_0x1f06da){_0x4f7ba8=_0x1f06da[_0xf121('0x34')];if(!_0x40425a[_0xf121('0x30')]['hasOwnProperty'](_0xf121('0x35'))){_0x544819['limit']=qs[_0xf121('0x1c')](_0x40425a['query'][_0xf121('0x1c')]);_0x544819[_0xf121('0x1a')]=qs[_0xf121('0x1a')](_0x40425a['query'][_0xf121('0x1a')]);}return _0x9c5d86[_0xf121('0x89')](_0x544819);}})['then'](function(_0x5c646e){if(_0x5c646e){return _0x5c646e?{'count':_0x4f7ba8,'rows':_0x5c646e}:null;}})[_0xf121('0x25')](respondWithResult(_0x4230af,null))['catch'](handleError(_0x4230af,null));};
\ No newline at end of file
+var _0x82b2=['then','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','order','WhatsappQueueId','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','ids','Team','Agents','voicePause','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','all','union','compact','value','removeTeams','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update'];(function(_0x59663a,_0x28e2c2){var _0xdf6a30=function(_0x13af34){while(--_0x13af34){_0x59663a['push'](_0x59663a['shift']());}};_0xdf6a30(++_0x28e2c2);}(_0x82b2,0x17a));var _0x282b=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x82b2[_0x75f869];return _0x10af8b;};'use strict';var emlformat=require(_0x282b('0x0'));var rimraf=require(_0x282b('0x1'));var zipdir=require(_0x282b('0x2'));var jsonpatch=require(_0x282b('0x3'));var rp=require(_0x282b('0x4'));var moment=require(_0x282b('0x5'));var BPromise=require(_0x282b('0x6'));var Mustache=require(_0x282b('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x282b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x282b('0x9'));var _=require(_0x282b('0xa'));var squel=require(_0x282b('0xb'));var crypto=require(_0x282b('0xc'));var jsforce=require(_0x282b('0xd'));var deskjs=require(_0x282b('0xe'));var toCsv=require(_0x282b('0x8'));var querystring=require('querystring');var Papa=require(_0x282b('0xf'));var Redis=require(_0x282b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x282b('0x11'));var as=require(_0x282b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x282b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x282b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x282b('0x15')]=_[_0x282b('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x282b('0x17'))(new Redis(config[_0x282b('0x15')]));require(_0x282b('0x18'))[_0x282b('0x19')](socket);function respondWithStatusCode(_0x3ee7aa,_0x512690){_0x512690=_0x512690||0xcc;return function(_0x3f8c8d){if(_0x3f8c8d){return _0x3ee7aa[_0x282b('0x1a')](_0x512690);}return _0x3ee7aa[_0x282b('0x1b')](_0x512690)[_0x282b('0x1c')]();};}function respondWithResult(_0x46f654,_0x5b2d2f){_0x5b2d2f=_0x5b2d2f||0xc8;return function(_0x493376){if(_0x493376){return _0x46f654[_0x282b('0x1b')](_0x5b2d2f)['json'](_0x493376);}};}function respondWithFilteredResult(_0x1d436d,_0x1105e6){return function(_0x4f7a0d){if(_0x4f7a0d){var _0x1581ef=typeof _0x1105e6[_0x282b('0x1d')]===_0x282b('0x1e')&&typeof _0x1105e6['limit']==='undefined';var _0x27683c=_0x4f7a0d[_0x282b('0x1f')];var _0x445ba8=_0x1581ef?0x0:_0x1105e6['offset'];var _0x2296a3=_0x1581ef?_0x4f7a0d['count']:_0x1105e6[_0x282b('0x1d')]+_0x1105e6[_0x282b('0x20')];var _0x820e54;if(_0x2296a3>=_0x27683c){_0x2296a3=_0x27683c;_0x820e54=0xc8;}else{_0x820e54=0xce;}_0x1d436d[_0x282b('0x1b')](_0x820e54);return _0x1d436d[_0x282b('0x21')](_0x282b('0x22'),_0x445ba8+'-'+_0x2296a3+'/'+_0x27683c)[_0x282b('0x23')](_0x4f7a0d);}return null;};}function patchUpdates(_0x5226cd){return function(_0x3e6f30){try{jsonpatch['apply'](_0x3e6f30,_0x5226cd,!![]);}catch(_0xbf52f){return BPromise[_0x282b('0x24')](_0xbf52f);}return _0x3e6f30[_0x282b('0x25')]();};}function saveUpdates(_0x4e50e7,_0x4e5557){return function(_0x2a3e72){if(_0x2a3e72){return _0x2a3e72[_0x282b('0x26')](_0x4e50e7)['then'](function(_0x222547){return _0x222547;});}return null;};}function removeEntity(_0x10a58a,_0x341b0a){return function(_0x4145bf){if(_0x4145bf){return _0x4145bf['destroy']()[_0x282b('0x27')](function(){var _0x15e3a0=_0x4145bf[_0x282b('0x28')]({'plain':!![]});var _0x17c7a6=_0x282b('0x29');return db[_0x282b('0x2a')]['destroy']({'where':{'type':_0x17c7a6,'resourceId':_0x15e3a0['id']}})[_0x282b('0x27')](function(){return _0x4145bf;});})['then'](function(){_0x10a58a[_0x282b('0x1b')](0xcc)[_0x282b('0x1c')]();});}};}function handleEntityNotFound(_0x3a5dfc,_0xa39f59){return function(_0x3df5e4){if(!_0x3df5e4){_0x3a5dfc[_0x282b('0x1a')](0x194);}return _0x3df5e4;};}function handleError(_0x45b37e,_0x33952e){_0x33952e=_0x33952e||0x1f4;return function(_0xae4e95){logger[_0x282b('0x2b')](_0xae4e95[_0x282b('0x2c')]);if(_0xae4e95[_0x282b('0x2d')]){delete _0xae4e95[_0x282b('0x2d')];}_0x45b37e[_0x282b('0x1b')](_0x33952e)[_0x282b('0x2e')](_0xae4e95);};}exports[_0x282b('0x2f')]=function(_0x4ffde4,_0x59d21c){var _0x2c38b1={},_0x218d7d={},_0x2b6657={'count':0x0,'rows':[]};var _0x23d00d=_[_0x282b('0x30')](db[_0x282b('0x31')][_0x282b('0x32')],function(_0x2cf3a2){return{'name':_0x2cf3a2[_0x282b('0x33')],'type':_0x2cf3a2['type'][_0x282b('0x34')]};});_0x218d7d['model']=_[_0x282b('0x30')](_0x23d00d,_0x282b('0x2d'));_0x218d7d[_0x282b('0x35')]=_[_0x282b('0x36')](_0x4ffde4[_0x282b('0x35')]);_0x218d7d[_0x282b('0x37')]=_[_0x282b('0x38')](_0x218d7d[_0x282b('0x39')],_0x218d7d['query']);_0x2c38b1[_0x282b('0x3a')]=_['intersection'](_0x218d7d[_0x282b('0x39')],qs[_0x282b('0x3b')](_0x4ffde4[_0x282b('0x35')][_0x282b('0x3b')]));_0x2c38b1['attributes']=_0x2c38b1['attributes'][_0x282b('0x3c')]?_0x2c38b1[_0x282b('0x3a')]:_0x218d7d['model'];if(!_0x4ffde4[_0x282b('0x35')]['hasOwnProperty'](_0x282b('0x3d'))){_0x2c38b1['limit']=qs[_0x282b('0x20')](_0x4ffde4[_0x282b('0x35')][_0x282b('0x20')]);_0x2c38b1[_0x282b('0x1d')]=qs['offset'](_0x4ffde4[_0x282b('0x35')][_0x282b('0x1d')]);}_0x2c38b1['order']=qs[_0x282b('0x3e')](_0x4ffde4['query'][_0x282b('0x3e')]);_0x2c38b1[_0x282b('0x3f')]=qs[_0x282b('0x37')](_[_0x282b('0x40')](_0x4ffde4[_0x282b('0x35')],_0x218d7d[_0x282b('0x37')]),_0x23d00d);if(_0x4ffde4[_0x282b('0x35')][_0x282b('0x41')]){_0x2c38b1[_0x282b('0x3f')]=_['merge'](_0x2c38b1[_0x282b('0x3f')],{'$or':_[_0x282b('0x30')](_0x23d00d,function(_0x2bf74a){if(_0x2bf74a['type']!=='VIRTUAL'){var _0x584942={};_0x584942[_0x2bf74a[_0x282b('0x2d')]]={'$like':'%'+_0x4ffde4[_0x282b('0x35')][_0x282b('0x41')]+'%'};return _0x584942;}})});}_0x2c38b1=_[_0x282b('0x42')]({},_0x2c38b1,_0x4ffde4['options']);var _0x4150a1={'where':_0x2c38b1[_0x282b('0x3f')]};return db[_0x282b('0x31')][_0x282b('0x1f')](_0x4150a1)[_0x282b('0x27')](function(_0x28b6fe){_0x2b6657[_0x282b('0x1f')]=_0x28b6fe;if(_0x4ffde4[_0x282b('0x35')][_0x282b('0x43')]){_0x2c38b1['include']=[{'all':!![]}];}return db[_0x282b('0x31')][_0x282b('0x44')](_0x2c38b1);})['then'](function(_0x4106ff){_0x2b6657[_0x282b('0x45')]=_0x4106ff;return _0x2b6657;})[_0x282b('0x27')](respondWithFilteredResult(_0x59d21c,_0x2c38b1))[_0x282b('0x46')](handleError(_0x59d21c,null));};exports[_0x282b('0x47')]=function(_0x3f6ca6,_0x3b2272){var _0x51ad1a={'raw':!![],'where':{'id':_0x3f6ca6[_0x282b('0x48')]['id']}},_0x54ba49={};_0x54ba49['model']=_['keys'](db['WhatsappQueue'][_0x282b('0x32')]);_0x54ba49[_0x282b('0x35')]=_[_0x282b('0x36')](_0x3f6ca6[_0x282b('0x35')]);_0x54ba49[_0x282b('0x37')]=_['intersection'](_0x54ba49['model'],_0x54ba49[_0x282b('0x35')]);_0x51ad1a[_0x282b('0x3a')]=_['intersection'](_0x54ba49[_0x282b('0x39')],qs[_0x282b('0x3b')](_0x3f6ca6['query'][_0x282b('0x3b')]));_0x51ad1a[_0x282b('0x3a')]=_0x51ad1a[_0x282b('0x3a')]['length']?_0x51ad1a[_0x282b('0x3a')]:_0x54ba49['model'];if(_0x3f6ca6[_0x282b('0x35')]['includeAll']){_0x51ad1a['include']=[{'all':!![]}];}_0x51ad1a=_[_0x282b('0x42')]({},_0x51ad1a,_0x3f6ca6[_0x282b('0x49')]);return db[_0x282b('0x31')][_0x282b('0x4a')](_0x51ad1a)['then'](handleEntityNotFound(_0x3b2272,null))[_0x282b('0x27')](respondWithResult(_0x3b2272,null))[_0x282b('0x46')](handleError(_0x3b2272,null));};exports['create']=function(_0x40a0e8,_0x267ed1){return db[_0x282b('0x31')][_0x282b('0x4b')](_0x40a0e8[_0x282b('0x4c')],{})[_0x282b('0x27')](function(_0x34dde6){var _0x1dbf86=_0x40a0e8[_0x282b('0x4d')][_0x282b('0x28')]({'plain':!![]});if(!_0x1dbf86)throw new Error(_0x282b('0x4e'));if(_0x1dbf86['role']===_0x282b('0x4d')){var _0x5d5081=_0x34dde6['get']({'plain':!![]});var _0x3caf28=_0x282b('0x29');return db[_0x282b('0x4f')]['find']({'where':{'name':_0x3caf28,'userProfileId':_0x1dbf86['userProfileId']},'raw':!![]})['then'](function(_0xbeba39){if(_0xbeba39&&_0xbeba39[_0x282b('0x50')]===0x0){return db[_0x282b('0x2a')][_0x282b('0x4b')]({'name':_0x5d5081['name'],'resourceId':_0x5d5081['id'],'type':_0xbeba39['name'],'sectionId':_0xbeba39['id']},{})[_0x282b('0x27')](function(){return _0x34dde6;});}else{return _0x34dde6;}})[_0x282b('0x46')](function(_0x2ca2c2){logger[_0x282b('0x2b')](_0x282b('0x51'),_0x2ca2c2);throw _0x2ca2c2;});}return _0x34dde6;})['then'](respondWithResult(_0x267ed1,0xc9))[_0x282b('0x46')](handleError(_0x267ed1,null));};exports['update']=function(_0x2b679b,_0x4d5332){if(_0x2b679b['body']['id']){delete _0x2b679b[_0x282b('0x4c')]['id'];}return db[_0x282b('0x31')][_0x282b('0x4a')]({'where':{'id':_0x2b679b['params']['id']}})[_0x282b('0x27')](handleEntityNotFound(_0x4d5332,null))[_0x282b('0x27')](saveUpdates(_0x2b679b[_0x282b('0x4c')],null))['then'](respondWithResult(_0x4d5332,null))[_0x282b('0x46')](handleError(_0x4d5332,null));};exports[_0x282b('0x52')]=function(_0x3c17e1,_0x32c22d){return db[_0x282b('0x31')][_0x282b('0x4a')]({'where':{'id':_0x3c17e1[_0x282b('0x48')]['id']}})[_0x282b('0x27')](handleEntityNotFound(_0x32c22d,null))[_0x282b('0x27')](removeEntity(_0x32c22d,null))[_0x282b('0x46')](handleError(_0x32c22d,null));};exports['describe']=function(_0x326d9b,_0x37b6b8){return db[_0x282b('0x31')][_0x282b('0x53')]()['then'](respondWithResult(_0x37b6b8,null))[_0x282b('0x46')](handleError(_0x37b6b8,null));};exports[_0x282b('0x54')]=function(_0xf77e25,_0x23a9bb,_0x225aa5){var _0x536f47={'raw':!![],'where':{}},_0x4e9c48={},_0x247bd1;return db[_0x282b('0x31')][_0x282b('0x55')]({'where':{'id':_0xf77e25['params']['id']}})[_0x282b('0x27')](handleEntityNotFound(_0x23a9bb,null))[_0x282b('0x27')](function(_0x4931c7){if(_0x4931c7){_0x247bd1=_0x4931c7['get']({'plain':!![]});_0x4e9c48[_0x282b('0x39')]=_['keys'](db[_0x282b('0x56')][_0x282b('0x32')]);_0x4e9c48[_0x282b('0x35')]=_[_0x282b('0x36')](_0xf77e25[_0x282b('0x35')]);_0x4e9c48[_0x282b('0x37')]=_['intersection'](_0x4e9c48['model'],_0x4e9c48[_0x282b('0x35')]);_0x536f47[_0x282b('0x3a')]=_[_0x282b('0x38')](_0x4e9c48['model'],qs[_0x282b('0x3b')](_0xf77e25[_0x282b('0x35')][_0x282b('0x3b')]));_0x536f47['attributes']=_0x536f47[_0x282b('0x3a')][_0x282b('0x3c')]?_0x536f47[_0x282b('0x3a')]:_0x4e9c48['model'];if(!_0xf77e25[_0x282b('0x35')][_0x282b('0x57')]('nolimit')){_0x536f47[_0x282b('0x20')]=qs[_0x282b('0x20')](_0xf77e25['query'][_0x282b('0x20')]);_0x536f47['offset']=qs[_0x282b('0x1d')](_0xf77e25[_0x282b('0x35')]['offset']);}_0x536f47[_0x282b('0x58')]=qs[_0x282b('0x3e')](_0xf77e25[_0x282b('0x35')][_0x282b('0x3e')]);_0x536f47['where']=qs[_0x282b('0x37')](_['pick'](_0xf77e25['query'],_0x4e9c48['filters']));_0x536f47['where'][_0x282b('0x59')]=_0x4931c7['id'];if(_0xf77e25[_0x282b('0x35')][_0x282b('0x41')]){_0x536f47['where']=_[_0x282b('0x42')](_0x536f47[_0x282b('0x3f')],{'$or':_[_0x282b('0x30')](_0x536f47[_0x282b('0x3a')],function(_0xb56163){var _0x34af29={};_0x34af29[_0xb56163]={'$like':'%'+_0xf77e25[_0x282b('0x35')][_0x282b('0x41')]+'%'};return _0x34af29;})});}_0x536f47=_['merge']({},_0x536f47,_0xf77e25[_0x282b('0x49')]);return db[_0x282b('0x56')]['findAll'](_0x536f47);}})[_0x282b('0x27')](function(_0x5127b1){if(_0x5127b1){return db[_0x282b('0x5a')][_0x282b('0x5b')]({'where':{'id':_[_0x282b('0x30')](_0x5127b1,'UserId'),'role':_0x282b('0x5c')},'attributes':['id','name',_0x282b('0x5d'),_0x282b('0x5e'),_0x282b('0x5f')]});}})[_0x282b('0x27')](function(_0x4a8b49){if(_0x4a8b49){return{'count':_0x4a8b49['count'],'rows':_[_0x282b('0x30')](_0x4a8b49[_0x282b('0x45')],function(_0x1e46c2){return{'membername':_0x1e46c2[_0x282b('0x2d')],'UserId':_0x1e46c2['id'],'queue_name':_0x247bd1[_0x282b('0x2d')],'WhatsappQueueId':_0x247bd1['id'],'interface':util[_0x282b('0x60')](_0x282b('0x61'),'SIP',_0x1e46c2[_0x282b('0x2d')]),'penalty':0x0,'paused':_0x1e46c2['whatsappPause'],'createdAt':_0x1e46c2[_0x282b('0x5f')],'updatedAt':_0x1e46c2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x282b('0x27')](respondWithFilteredResult(_0x23a9bb,_0x536f47))[_0x282b('0x46')](handleError(_0x23a9bb,null));};exports[_0x282b('0x62')]=function(_0xcc1864,_0x1d92f7,_0x5e914c){var _0x230d90={};var _0xf35934={};var _0xd1bc73;var _0x95470b;return db[_0x282b('0x31')][_0x282b('0x55')]({'where':{'id':_0xcc1864[_0x282b('0x48')]['id']}})[_0x282b('0x27')](handleEntityNotFound(_0x1d92f7,null))[_0x282b('0x27')](function(_0xe2ed1d){if(_0xe2ed1d){_0xd1bc73=_0xe2ed1d;_0xf35934[_0x282b('0x39')]=_['keys'](db['Team']['rawAttributes']);_0xf35934[_0x282b('0x35')]=_[_0x282b('0x36')](_0xcc1864[_0x282b('0x35')]);_0xf35934[_0x282b('0x37')]=_['intersection'](_0xf35934['model'],_0xf35934[_0x282b('0x35')]);_0x230d90[_0x282b('0x3a')]=_['intersection'](_0xf35934['model'],qs['fields'](_0xcc1864['query'][_0x282b('0x3b')]));_0x230d90['attributes']=_0x230d90[_0x282b('0x3a')][_0x282b('0x3c')]?_0x230d90[_0x282b('0x3a')]:_0xf35934[_0x282b('0x39')];_0x230d90[_0x282b('0x58')]=qs[_0x282b('0x3e')](_0xcc1864[_0x282b('0x35')][_0x282b('0x3e')]);_0x230d90[_0x282b('0x3f')]=qs[_0x282b('0x37')](_['pick'](_0xcc1864[_0x282b('0x35')],_0xf35934[_0x282b('0x37')]));if(_0xcc1864[_0x282b('0x35')][_0x282b('0x41')]){_0x230d90[_0x282b('0x3f')]=_['merge'](_0x230d90[_0x282b('0x3f')],{'$or':_[_0x282b('0x30')](_0x230d90[_0x282b('0x3a')],function(_0x496fef){var _0x29aaee={};_0x29aaee[_0x496fef]={'$like':'%'+_0xcc1864[_0x282b('0x35')][_0x282b('0x41')]+'%'};return _0x29aaee;})});}_0x230d90=_[_0x282b('0x42')]({},_0x230d90,_0xcc1864[_0x282b('0x49')]);return _0xd1bc73[_0x282b('0x62')](_0x230d90);}})['then'](function(_0x14076d){if(_0x14076d){_0x95470b=_0x14076d[_0x282b('0x3c')];if(!_0xcc1864[_0x282b('0x35')][_0x282b('0x57')]('nolimit')){_0x230d90[_0x282b('0x20')]=qs[_0x282b('0x20')](_0xcc1864['query']['limit']);_0x230d90[_0x282b('0x1d')]=qs['offset'](_0xcc1864['query'][_0x282b('0x1d')]);}return _0xd1bc73[_0x282b('0x62')](_0x230d90);}})[_0x282b('0x27')](function(_0x7650a7){if(_0x7650a7){return _0x7650a7?{'count':_0x95470b,'rows':_0x7650a7}:null;}})[_0x282b('0x27')](respondWithResult(_0x1d92f7,null))[_0x282b('0x46')](handleError(_0x1d92f7,null));};exports['addTeams']=function(_0x393881,_0x469fd2,_0x1e619e){var _0x4474b2=_0x393881[_0x282b('0x4c')][_0x282b('0x63')];return db[_0x282b('0x64')][_0x282b('0x44')]({'where':{'id':_0x4474b2},'attributes':['id'],'include':[{'model':db['User'],'as':_0x282b('0x65'),'attributes':['id','name','online',_0x282b('0x66'),'interface'],'raw':!![]}]})['then'](function(_0x19ea0c){if(_0x19ea0c){var _0x2d2921=_[_0x282b('0x67')](_0x19ea0c,function(_0x3ae9c5){var _0x125a9d=_0x3ae9c5[_0x282b('0x28')]({'plain':!![]});return _0x125a9d[_0x282b('0x65')];});return db[_0x282b('0x31')][_0x282b('0x4a')]({'where':{'id':_0x393881[_0x282b('0x48')]['id']}})['then'](function(_0x1ec859){return db['sequelize'][_0x282b('0x68')](function(_0x40abbc){return _0x1ec859[_0x282b('0x69')](_0x4474b2,{'transaction':_0x40abbc})[_0x282b('0x27')](function(){return BPromise[_0x282b('0x6a')](_0x2d2921,function(_0x2db9f3){return db[_0x282b('0x56')][_0x282b('0x6b')]({'where':{'UserId':_0x2db9f3['id'],'WhatsappQueueId':_0x393881[_0x282b('0x48')]['id']},'transaction':_0x40abbc});});})['then'](function(){_0x2d2921[_0x282b('0x6c')](function(_0x994628){socket[_0x282b('0x6d')](_0x282b('0x6e'),{'UserId':_0x994628['id'],'WhatsappQueueId':_0x1ec859['id']});});});});});}})[_0x282b('0x27')](respondWithStatusCode(_0x469fd2,null))[_0x282b('0x46')](handleError(_0x469fd2,null));};exports['removeTeams']=function(_0x31806c,_0x26b51c,_0x57ea48){return db[_0x282b('0x64')][_0x282b('0x44')]({'where':{'id':_0x31806c[_0x282b('0x35')][_0x282b('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x282b('0x65'),'attributes':['id'],'raw':!![]}]})[_0x282b('0x27')](handleEntityNotFound(_0x26b51c,null))[_0x282b('0x27')](function(_0x18bfa4){var _0x48c943=_[_0x282b('0x30')](_0x18bfa4,'id');var _0xe238e4=[];var _0xa3ba65=[];var _0x1e58af=squel[_0x282b('0x6f')]();_0x1e58af[_0x282b('0x70')](_0x282b('0x71'))[_0x282b('0x72')](_0x282b('0x73'),'tq')['join'](_0x282b('0x74'),'ut',_0x282b('0x75'))[_0x282b('0x3f')](_0x282b('0x76'),_0x31806c[_0x282b('0x48')]['id']);for(var _0x136596=0x0;_0x136596<_0x18bfa4['length'];_0x136596+=0x1){let _0x4acacc=_0x18bfa4[_0x136596];for(var _0x412bfb=0x0;_0x412bfb<_0x4acacc[_0x282b('0x65')][_0x282b('0x3c')];_0x412bfb+=0x1){let _0x4ab8bb=_0x4acacc[_0x282b('0x65')][_0x412bfb];var _0x26b8c1=_0x1e58af[_0x282b('0x77')]();_0x26b8c1[_0x282b('0x3f')](_0x282b('0x78'),_0x4ab8bb['id']);_0xa3ba65[_0x282b('0x79')](db[_0x282b('0x7a')][_0x282b('0x35')](_0x26b8c1[_0x282b('0x7b')](),{'type':db['sequelize']['QueryTypes'][_0x282b('0x7c')]})[_0x282b('0x27')](function(_0x4757ba){if(_0x4757ba[_0x282b('0x3c')]===0x1){return _0x4ab8bb['id'];}else{var _0x18fcd9=_[_0x282b('0x7d')](_[_0x282b('0x30')](_0x4757ba,'TeamId'),function(_0x3ed2ec){return _['includes'](_0x48c943,_0x3ed2ec);});if(_0x18fcd9){return _0x4ab8bb['id'];}}}));}}return BPromise[_0x282b('0x7e')](_0xa3ba65)[_0x282b('0x27')](function(_0x2ac686){_0xe238e4=_(_0xe238e4)[_0x282b('0x7f')](_0x2ac686)[_0x282b('0x80')]()[_0x282b('0x81')]();return db['WhatsappQueue'][_0x282b('0x4a')]({'where':{'id':_0x31806c[_0x282b('0x48')]['id']}})[_0x282b('0x27')](function(_0x25a64c){return db[_0x282b('0x7a')]['transaction'](function(_0x1ac5fa){return _0x25a64c[_0x282b('0x82')](_0x31806c['query']['ids'],{'transaction':_0x1ac5fa})[_0x282b('0x27')](function(){if(!_[_0x282b('0x83')](_0xe238e4)){return _0x25a64c['removeAgents'](_0xe238e4,{'transaction':_0x1ac5fa});}})['then'](function(){_0xe238e4['forEach'](function(_0x255485){socket['emit'](_0x282b('0x84'),{'UserId':_0x255485,'WhatsappQueueId':_0x25a64c['id']});});});});});});})[_0x282b('0x27')](respondWithStatusCode(_0x26b51c,null))['catch'](handleError(_0x26b51c,null));};exports[_0x282b('0x85')]=function(_0x44c0b6,_0x21de62,_0x84d66){return db[_0x282b('0x31')][_0x282b('0x4a')]({'where':{'id':_0x44c0b6[_0x282b('0x48')]['id']}})['then'](handleEntityNotFound(_0x21de62,null))['then'](function(_0x57a72f){if(_0x57a72f){return _0x57a72f['addAgents'](_0x44c0b6[_0x282b('0x4c')][_0x282b('0x63')],_[_0x282b('0x86')](_0x44c0b6['body'],[_0x282b('0x63'),'id'])||{})[_0x282b('0x87')](function(_0x4c1a1d){for(var _0x3a0b9f=0x0;_0x3a0b9f<_0x44c0b6[_0x282b('0x4c')][_0x282b('0x63')][_0x282b('0x3c')];_0x3a0b9f+=0x1){socket[_0x282b('0x6d')](_0x282b('0x6e'),{'UserId':Number(_0x44c0b6['body']['ids'][_0x3a0b9f]),'WhatsappQueueId':Number(_0x44c0b6[_0x282b('0x48')]['id'])});}return _0x4c1a1d;});}})[_0x282b('0x27')](respondWithResult(_0x21de62,null))[_0x282b('0x46')](handleError(_0x21de62,null));};exports[_0x282b('0x88')]=function(_0x26f5be,_0x460b27,_0xe41fe7){return db[_0x282b('0x31')][_0x282b('0x4a')]({'where':{'id':_0x26f5be[_0x282b('0x48')]['id']}})[_0x282b('0x27')](handleEntityNotFound(_0x460b27,null))['then'](function(_0x3bdd37){if(_0x3bdd37){return _0x3bdd37[_0x282b('0x88')](_0x26f5be[_0x282b('0x35')][_0x282b('0x63')])[_0x282b('0x27')](function(){if(_[_0x282b('0x89')](_0x26f5be['query'][_0x282b('0x63')])){for(var _0x2a7e55=0x0;_0x2a7e55<_0x26f5be[_0x282b('0x35')][_0x282b('0x63')][_0x282b('0x3c')];_0x2a7e55+=0x1){socket['emit'](_0x282b('0x84'),{'UserId':Number(_0x26f5be[_0x282b('0x35')][_0x282b('0x63')][_0x2a7e55]),'WhatsappQueueId':Number(_0x26f5be[_0x282b('0x48')]['id'])});}}else{socket['emit'](_0x282b('0x84'),{'UserId':Number(_0x26f5be['query'][_0x282b('0x63')]),'WhatsappQueueId':Number(_0x26f5be[_0x282b('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x460b27,null))[_0x282b('0x46')](handleError(_0x460b27,null));};exports[_0x282b('0x8a')]=function(_0x5af8ec,_0x53f927,_0x2c097e){var _0x1300c7={};var _0x499d82={};var _0x509631;var _0x3631a6;return db[_0x282b('0x31')][_0x282b('0x55')]({'where':{'id':_0x5af8ec['params']['id']}})[_0x282b('0x27')](handleEntityNotFound(_0x53f927,null))[_0x282b('0x27')](function(_0x14f793){if(_0x14f793){_0x509631=_0x14f793;_0x499d82[_0x282b('0x39')]=_['keys'](db[_0x282b('0x5a')][_0x282b('0x32')]);_0x499d82[_0x282b('0x35')]=_[_0x282b('0x36')](_0x5af8ec[_0x282b('0x35')]);_0x499d82['filters']=_['intersection'](_0x499d82['model'],_0x499d82[_0x282b('0x35')]);_0x1300c7[_0x282b('0x3a')]=_[_0x282b('0x38')](_0x499d82['model'],qs['fields'](_0x5af8ec[_0x282b('0x35')][_0x282b('0x3b')]));_0x1300c7[_0x282b('0x3a')]=_0x1300c7[_0x282b('0x3a')][_0x282b('0x3c')]?_0x1300c7['attributes']:_0x499d82[_0x282b('0x39')];_0x1300c7['order']=qs[_0x282b('0x3e')](_0x5af8ec[_0x282b('0x35')][_0x282b('0x3e')]);_0x1300c7[_0x282b('0x3f')]=qs['filters'](_[_0x282b('0x40')](_0x5af8ec[_0x282b('0x35')],_0x499d82['filters']));if(_0x5af8ec[_0x282b('0x35')][_0x282b('0x41')]){_0x1300c7[_0x282b('0x3f')]=_[_0x282b('0x42')](_0x1300c7[_0x282b('0x3f')],{'$or':_['map'](_0x1300c7[_0x282b('0x3a')],function(_0x5a6d8e){var _0xb44494={};_0xb44494[_0x5a6d8e]={'$like':'%'+_0x5af8ec[_0x282b('0x35')]['filter']+'%'};return _0xb44494;})});}_0x1300c7=_['merge']({},_0x1300c7,_0x5af8ec[_0x282b('0x49')]);return _0x509631[_0x282b('0x8a')](_0x1300c7);}})[_0x282b('0x27')](function(_0x4a6e8c){if(_0x4a6e8c){_0x3631a6=_0x4a6e8c['length'];if(!_0x5af8ec[_0x282b('0x35')][_0x282b('0x57')](_0x282b('0x3d'))){_0x1300c7[_0x282b('0x20')]=qs[_0x282b('0x20')](_0x5af8ec[_0x282b('0x35')]['limit']);_0x1300c7[_0x282b('0x1d')]=qs['offset'](_0x5af8ec[_0x282b('0x35')][_0x282b('0x1d')]);}return _0x509631['getAgents'](_0x1300c7);}})[_0x282b('0x27')](function(_0x2e2c3e){if(_0x2e2c3e){return _0x2e2c3e?{'count':_0x3631a6,'rows':_0x2e2c3e}:null;}})[_0x282b('0x27')](respondWithResult(_0x53f927,null))[_0x282b('0x46')](handleError(_0x53f927,null));};
\ No newline at end of file
index 9eb8cb2..021da6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6977=['hasOwnProperty','exports','events','setMaxListeners','save','remove','emit'];(function(_0x53cf14,_0x29e073){var _0x3e5981=function(_0x4a9ab3){while(--_0x4a9ab3){_0x53cf14['push'](_0x53cf14['shift']());}};_0x3e5981(++_0x29e073);}(_0x6977,0x16e));var _0x7697=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x6977[_0x4cf98e];return _0x1623ac;};'use strict';var EventEmitter=require(_0x7697('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x7697('0x1')](0x0);var events={'afterCreate':_0x7697('0x2'),'afterUpdate':'update','afterDestroy':_0x7697('0x3')};function emitEvent(_0x1b3183){return function(_0x4447b1,_0x455f85,_0x56dec6){WhatsappQueueEvents[_0x7697('0x4')](_0x1b3183+':'+_0x4447b1['id'],_0x4447b1);WhatsappQueueEvents[_0x7697('0x4')](_0x1b3183,_0x4447b1);_0x56dec6(null);};}for(var e in events){if(events[_0x7697('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x7697('0x6')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0xe0f8=['../../mysqldb','setMaxListeners','remove','emit','hook','exports'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0xe0f8,0x8a));var _0x8e0f=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xe0f8[_0x1da527];return _0x40fc7c;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x8e0f('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x8e0f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8e0f('0x2')};function emitEvent(_0x1234a7){return function(_0x32aeaf,_0x52b77d,_0x4a650e){WhatsappQueueEvents[_0x8e0f('0x3')](_0x1234a7+':'+_0x32aeaf['id'],_0x32aeaf);WhatsappQueueEvents[_0x8e0f('0x3')](_0x1234a7,_0x32aeaf);_0x4a650e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x8e0f('0x4')](e,emitEvent(event));}}module[_0x8e0f('0x5')]=WhatsappQueueEvents;
\ No newline at end of file
index 90785cc..823b86c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35b0=['api','path','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger'];(function(_0x5d72c8,_0x85e2e1){var _0x3abc9e=function(_0x1311b){while(--_0x1311b){_0x5d72c8['push'](_0x5d72c8['shift']());}};_0x3abc9e(++_0x85e2e1);}(_0x35b0,0x8e));var _0x035b=function(_0x2474a1,_0x40962c){_0x2474a1=_0x2474a1-0x0;var _0x1225f0=_0x35b0[_0x2474a1];return _0x1225f0;};'use strict';var _=require(_0x035b('0x0'));var util=require('util');var logger=require(_0x035b('0x1'))(_0x035b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x035b('0x3'));var rimraf=require('rimraf');var config=require(_0x035b('0x4'));var attributes=require(_0x035b('0x5'));module['exports']=function(_0x167777,_0x4c37b6){return _0x167777[_0x035b('0x6')](_0x035b('0x7'),attributes,{'tableName':_0x035b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x705a=['whatsapp_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue'];(function(_0x34d5ea,_0x49f591){var _0x8bd9c4=function(_0x2a120e){while(--_0x2a120e){_0x34d5ea['push'](_0x34d5ea['shift']());}};_0x8bd9c4(++_0x49f591);}(_0x705a,0x145));var _0xa705=function(_0x15cf88,_0x3ef7e4){_0x15cf88=_0x15cf88-0x0;var _0x4b3bd9=_0x705a[_0x15cf88];return _0x4b3bd9;};'use strict';var _=require('lodash');var util=require(_0xa705('0x0'));var logger=require(_0xa705('0x1'))(_0xa705('0x2'));var moment=require(_0xa705('0x3'));var BPromise=require('bluebird');var rp=require(_0xa705('0x4'));var fs=require('fs');var path=require(_0xa705('0x5'));var rimraf=require(_0xa705('0x6'));var config=require(_0xa705('0x7'));var attributes=require(_0xa705('0x8'));module[_0xa705('0x9')]=function(_0x5668d0,_0x1417e1){return _0x5668d0['define'](_0xa705('0xa'),attributes,{'tableName':_0xa705('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d741531..5aad641 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd26=['rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','then','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','map','include','model','find','ShowWhatsappQueue','lodash','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x43b595,_0x1caad0){var _0x227b1e=function(_0x4dd401){while(--_0x4dd401){_0x43b595['push'](_0x43b595['shift']());}};_0x227b1e(++_0x1caad0);}(_0xcd26,0x6a));var _0x6cd2=function(_0x5b311b,_0x3e0280){_0x5b311b=_0x5b311b-0x0;var _0x4fa0de=_0xcd26[_0x5b311b];return _0x4fa0de;};'use strict';var _=require(_0x6cd2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6cd2('0x1'));var rs=require(_0x6cd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6cd2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6cd2('0x4'))(_0x6cd2('0x5'));var config=require(_0x6cd2('0x6'));var jayson=require(_0x6cd2('0x7'));var client=jayson['client'][_0x6cd2('0x8')]({'port':0x232a});config[_0x6cd2('0x9')]=_[_0x6cd2('0xa')](config[_0x6cd2('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x6cd2('0xb'))(new Redis(config[_0x6cd2('0x9')]));require('./whatsappQueue.socket')[_0x6cd2('0xc')](socket);function respondWithRpcPromise(_0x4cb270,_0x436fd3,_0xeebe40){return new BPromise(function(_0x312d22,_0x5d5f04){return client['request'](_0x4cb270,_0xeebe40)[_0x6cd2('0xd')](function(_0x1e6f9d){logger['info'](_0x6cd2('0xe'),_0x436fd3,'request\x20sent');logger[_0x6cd2('0xf')](_0x6cd2('0x10'),_0x436fd3,'request\x20sent',JSON[_0x6cd2('0x11')](_0x1e6f9d));if(_0x1e6f9d[_0x6cd2('0x12')]){if(_0x1e6f9d[_0x6cd2('0x12')][_0x6cd2('0x13')]===0x1f4){logger[_0x6cd2('0x12')](_0x6cd2('0xe'),_0x436fd3,_0x1e6f9d['error']['message']);return _0x5d5f04(_0x1e6f9d['error']['message']);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x436fd3,_0x1e6f9d[_0x6cd2('0x12')][_0x6cd2('0x14')]);return _0x312d22(_0x1e6f9d[_0x6cd2('0x12')][_0x6cd2('0x14')]);}else{logger[_0x6cd2('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x436fd3,_0x6cd2('0x16'));_0x312d22(_0x1e6f9d[_0x6cd2('0x17')][_0x6cd2('0x14')]);}})[_0x6cd2('0x18')](function(_0x2b818d){logger[_0x6cd2('0x12')](_0x6cd2('0xe'),_0x436fd3,_0x2b818d);_0x5d5f04(_0x2b818d);});});}exports[_0x6cd2('0x19')]=function(_0x26e386){var _0x289f06=this;return new Promise(function(_0x14f7b,_0x34664a){return db[_0x6cd2('0x1a')][_0x6cd2('0x1b')]({'raw':_0x26e386['options']?_0x26e386[_0x6cd2('0x1c')][_0x6cd2('0x1d')]===undefined?!![]:![]:!![],'where':_0x26e386['options']?_0x26e386['options'][_0x6cd2('0x1e')]||null:null,'attributes':_0x26e386[_0x6cd2('0x1c')]?_0x26e386[_0x6cd2('0x1c')][_0x6cd2('0x1f')]||null:null,'limit':_0x26e386[_0x6cd2('0x1c')]?_0x26e386[_0x6cd2('0x1c')]['limit']||null:null,'include':_0x26e386[_0x6cd2('0x1c')]?_0x26e386['options']['include']?_[_0x6cd2('0x20')](_0x26e386[_0x6cd2('0x1c')]['include'],function(_0x3465e2){return{'model':db[_0x3465e2['model']],'as':_0x3465e2['as'],'attributes':_0x3465e2[_0x6cd2('0x1f')],'include':_0x3465e2['include']?_[_0x6cd2('0x20')](_0x3465e2[_0x6cd2('0x21')],function(_0xbe65fa){return{'model':db[_0xbe65fa[_0x6cd2('0x22')]],'as':_0xbe65fa['as'],'attributes':_0xbe65fa[_0x6cd2('0x1f')],'include':_0xbe65fa[_0x6cd2('0x21')]?_[_0x6cd2('0x20')](_0xbe65fa[_0x6cd2('0x21')],function(_0x37e503){return{'model':db[_0x37e503['model']],'as':_0x37e503['as'],'attributes':_0x37e503[_0x6cd2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6cd2('0xd')](function(_0x4ebb17){logger['info'](_0x6cd2('0x19'),_0x26e386);logger[_0x6cd2('0xf')](_0x6cd2('0x19'),_0x26e386,JSON[_0x6cd2('0x11')](_0x4ebb17));_0x14f7b(_0x4ebb17);})['catch'](function(_0x1d50a2){logger[_0x6cd2('0x12')](_0x6cd2('0x19'),_0x1d50a2['message'],_0x26e386);_0x34664a(_0x289f06[_0x6cd2('0x12')](0x1f4,_0x1d50a2[_0x6cd2('0x14')]));});});};exports['ShowWhatsappQueue']=function(_0x70d890){var _0x12fdc4=this;return new Promise(function(_0x4f3cad,_0x2ed953){return db[_0x6cd2('0x1a')][_0x6cd2('0x23')]({'raw':_0x70d890[_0x6cd2('0x1c')]?_0x70d890['options']['raw']===undefined?!![]:![]:!![],'where':_0x70d890[_0x6cd2('0x1c')]?_0x70d890[_0x6cd2('0x1c')][_0x6cd2('0x1e')]||null:null,'attributes':_0x70d890['options']?_0x70d890[_0x6cd2('0x1c')][_0x6cd2('0x1f')]||null:null,'include':_0x70d890[_0x6cd2('0x1c')]?_0x70d890[_0x6cd2('0x1c')][_0x6cd2('0x21')]?_['map'](_0x70d890[_0x6cd2('0x1c')]['include'],function(_0x2d61ba){return{'model':db[_0x2d61ba[_0x6cd2('0x22')]],'as':_0x2d61ba['as'],'attributes':_0x2d61ba[_0x6cd2('0x1f')],'include':_0x2d61ba[_0x6cd2('0x21')]?_[_0x6cd2('0x20')](_0x2d61ba[_0x6cd2('0x21')],function(_0x38fc90){return{'model':db[_0x38fc90[_0x6cd2('0x22')]],'as':_0x38fc90['as'],'attributes':_0x38fc90[_0x6cd2('0x1f')],'include':_0x38fc90[_0x6cd2('0x21')]?_['map'](_0x38fc90['include'],function(_0xdd0867){return{'model':db[_0xdd0867[_0x6cd2('0x22')]],'as':_0xdd0867['as'],'attributes':_0xdd0867[_0x6cd2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6cd2('0xd')](function(_0x574875){logger[_0x6cd2('0x15')](_0x6cd2('0x24'),_0x70d890);logger[_0x6cd2('0xf')](_0x6cd2('0x24'),_0x70d890,JSON[_0x6cd2('0x11')](_0x574875));_0x4f3cad(_0x574875);})['catch'](function(_0x212faf){logger['error'](_0x6cd2('0x24'),_0x212faf['message'],_0x70d890);_0x2ed953(_0x12fdc4['error'](0x1f4,_0x212faf['message']));});});};
\ No newline at end of file
+var _0x04cb=['GetWhatsappQueue','ShowWhatsappQueue','WhatsappQueue','find','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','options','raw','where','attributes','limit','include','map','model','then','debug'];(function(_0x581f2d,_0x23cbee){var _0x1b3f0c=function(_0x3e8bca){while(--_0x3e8bca){_0x581f2d['push'](_0x581f2d['shift']());}};_0x1b3f0c(++_0x23cbee);}(_0x04cb,0x1b4));var _0xb04c=function(_0x4d9260,_0x2858b4){_0x4d9260=_0x4d9260-0x0;var _0x4a3629=_0x04cb[_0x4d9260];return _0x4a3629;};'use strict';var _=require('lodash');var util=require(_0xb04c('0x0'));var moment=require(_0xb04c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb04c('0x2'));var db=require(_0xb04c('0x3'))['db'];var utils=require(_0xb04c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb04c('0x5'));var jayson=require(_0xb04c('0x6'));var client=jayson[_0xb04c('0x7')]['http']({'port':0x232a});config[_0xb04c('0x8')]=_[_0xb04c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb04c('0xa'))(new Redis(config[_0xb04c('0x8')]));require(_0xb04c('0xb'))[_0xb04c('0xc')](socket);function respondWithRpcPromise(_0x3505f1,_0x2221b9,_0x52cca4){return new BPromise(function(_0x622e91,_0x1971e5){return client['request'](_0x3505f1,_0x52cca4)['then'](function(_0x571105){logger['info'](_0xb04c('0xd'),_0x2221b9,'request\x20sent');logger['debug'](_0xb04c('0xe'),_0x2221b9,'request\x20sent',JSON[_0xb04c('0xf')](_0x571105));if(_0x571105[_0xb04c('0x10')]){if(_0x571105[_0xb04c('0x10')][_0xb04c('0x11')]===0x1f4){logger[_0xb04c('0x10')](_0xb04c('0xd'),_0x2221b9,_0x571105[_0xb04c('0x10')]['message']);return _0x1971e5(_0x571105[_0xb04c('0x10')][_0xb04c('0x12')]);}logger[_0xb04c('0x10')](_0xb04c('0xd'),_0x2221b9,_0x571105[_0xb04c('0x10')][_0xb04c('0x12')]);return _0x622e91(_0x571105[_0xb04c('0x10')][_0xb04c('0x12')]);}else{logger[_0xb04c('0x13')](_0xb04c('0xd'),_0x2221b9,_0xb04c('0x14'));_0x622e91(_0x571105['result'][_0xb04c('0x12')]);}})[_0xb04c('0x15')](function(_0x173ed6){logger[_0xb04c('0x10')](_0xb04c('0xd'),_0x2221b9,_0x173ed6);_0x1971e5(_0x173ed6);});});}exports['GetWhatsappQueue']=function(_0x2b969a){var _0x531e87=this;return new Promise(function(_0x16837a,_0x26552c){return db['WhatsappQueue']['findAll']({'raw':_0x2b969a[_0xb04c('0x16')]?_0x2b969a[_0xb04c('0x16')][_0xb04c('0x17')]===undefined?!![]:![]:!![],'where':_0x2b969a[_0xb04c('0x16')]?_0x2b969a[_0xb04c('0x16')][_0xb04c('0x18')]||null:null,'attributes':_0x2b969a[_0xb04c('0x16')]?_0x2b969a[_0xb04c('0x16')][_0xb04c('0x19')]||null:null,'limit':_0x2b969a[_0xb04c('0x16')]?_0x2b969a[_0xb04c('0x16')][_0xb04c('0x1a')]||null:null,'include':_0x2b969a[_0xb04c('0x16')]?_0x2b969a[_0xb04c('0x16')][_0xb04c('0x1b')]?_[_0xb04c('0x1c')](_0x2b969a['options'][_0xb04c('0x1b')],function(_0x55cc49){return{'model':db[_0x55cc49[_0xb04c('0x1d')]],'as':_0x55cc49['as'],'attributes':_0x55cc49[_0xb04c('0x19')],'include':_0x55cc49[_0xb04c('0x1b')]?_[_0xb04c('0x1c')](_0x55cc49[_0xb04c('0x1b')],function(_0x5455f1){return{'model':db[_0x5455f1['model']],'as':_0x5455f1['as'],'attributes':_0x5455f1[_0xb04c('0x19')],'include':_0x5455f1[_0xb04c('0x1b')]?_[_0xb04c('0x1c')](_0x5455f1[_0xb04c('0x1b')],function(_0x1e6c37){return{'model':db[_0x1e6c37[_0xb04c('0x1d')]],'as':_0x1e6c37['as'],'attributes':_0x1e6c37[_0xb04c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb04c('0x1e')](function(_0x23eef1){logger['info']('GetWhatsappQueue',_0x2b969a);logger[_0xb04c('0x1f')](_0xb04c('0x20'),_0x2b969a,JSON[_0xb04c('0xf')](_0x23eef1));_0x16837a(_0x23eef1);})[_0xb04c('0x15')](function(_0x1161f5){logger[_0xb04c('0x10')](_0xb04c('0x20'),_0x1161f5[_0xb04c('0x12')],_0x2b969a);_0x26552c(_0x531e87[_0xb04c('0x10')](0x1f4,_0x1161f5[_0xb04c('0x12')]));});});};exports[_0xb04c('0x21')]=function(_0x1a1837){var _0xca39f1=this;return new Promise(function(_0x1ffcda,_0x59017b){return db[_0xb04c('0x22')][_0xb04c('0x23')]({'raw':_0x1a1837[_0xb04c('0x16')]?_0x1a1837[_0xb04c('0x16')][_0xb04c('0x17')]===undefined?!![]:![]:!![],'where':_0x1a1837[_0xb04c('0x16')]?_0x1a1837[_0xb04c('0x16')][_0xb04c('0x18')]||null:null,'attributes':_0x1a1837[_0xb04c('0x16')]?_0x1a1837[_0xb04c('0x16')]['attributes']||null:null,'include':_0x1a1837[_0xb04c('0x16')]?_0x1a1837['options'][_0xb04c('0x1b')]?_[_0xb04c('0x1c')](_0x1a1837[_0xb04c('0x16')][_0xb04c('0x1b')],function(_0x4068e9){return{'model':db[_0x4068e9['model']],'as':_0x4068e9['as'],'attributes':_0x4068e9['attributes'],'include':_0x4068e9[_0xb04c('0x1b')]?_[_0xb04c('0x1c')](_0x4068e9[_0xb04c('0x1b')],function(_0x348b38){return{'model':db[_0x348b38['model']],'as':_0x348b38['as'],'attributes':_0x348b38[_0xb04c('0x19')],'include':_0x348b38['include']?_[_0xb04c('0x1c')](_0x348b38[_0xb04c('0x1b')],function(_0x56fa2b){return{'model':db[_0x56fa2b[_0xb04c('0x1d')]],'as':_0x56fa2b['as'],'attributes':_0x56fa2b[_0xb04c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb04c('0x1e')](function(_0x107879){logger['info'](_0xb04c('0x21'),_0x1a1837);logger[_0xb04c('0x1f')](_0xb04c('0x21'),_0x1a1837,JSON['stringify'](_0x107879));_0x1ffcda(_0x107879);})[_0xb04c('0x15')](function(_0x599eef){logger[_0xb04c('0x10')](_0xb04c('0x21'),_0x599eef[_0xb04c('0x12')],_0x1a1837);_0x59017b(_0xca39f1['error'](0x1f4,_0x599eef[_0xb04c('0x12')]));});});};
\ No newline at end of file
index 3b39ba7..60c6de4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f38=['whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','length'];(function(_0x2ef776,_0x3144c9){var _0x25f991=function(_0x2476d4){while(--_0x2476d4){_0x2ef776['push'](_0x2ef776['shift']());}};_0x25f991(++_0x3144c9);}(_0x4f38,0x94));var _0x84f3=function(_0x4da91c,_0x10029d){_0x4da91c=_0x4da91c-0x0;var _0x55d71b=_0x4f38[_0x4da91c];return _0x55d71b;};'use strict';var WhatsappQueueEvents=require(_0x84f3('0x0'));var events=[_0x84f3('0x1'),_0x84f3('0x2'),_0x84f3('0x3')];function createListener(_0x38d647,_0x45948c){return function(_0x5512d8){_0x45948c[_0x84f3('0x4')](_0x38d647,_0x5512d8);};}function removeListener(_0x5dd513,_0xe202a1){return function(){WhatsappQueueEvents['removeListener'](_0x5dd513,_0xe202a1);};}exports['register']=function(_0x4163da){for(var _0x2a28b2=0x0,_0x35f43f=events[_0x84f3('0x5')];_0x2a28b2<_0x35f43f;_0x2a28b2++){var _0x3562db=events[_0x2a28b2];var _0x16a772=createListener(_0x84f3('0x6')+_0x3562db,_0x4163da);WhatsappQueueEvents['on'](_0x3562db,_0x16a772);}};
\ No newline at end of file
+var _0xafb0=['./whatsappQueue.events','save','remove','update','emit','register','length','whatsappQueue:'];(function(_0x45ad09,_0x36b97d){var _0x4a4909=function(_0x35d743){while(--_0x35d743){_0x45ad09['push'](_0x45ad09['shift']());}};_0x4a4909(++_0x36b97d);}(_0xafb0,0x118));var _0x0afb=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xafb0[_0x409353];return _0x4f4b59;};'use strict';var WhatsappQueueEvents=require(_0x0afb('0x0'));var events=[_0x0afb('0x1'),_0x0afb('0x2'),_0x0afb('0x3')];function createListener(_0x5b8166,_0x2c0857){return function(_0x1ecca2){_0x2c0857[_0x0afb('0x4')](_0x5b8166,_0x1ecca2);};}function removeListener(_0x124b1e,_0x3e5b9f){return function(){WhatsappQueueEvents['removeListener'](_0x124b1e,_0x3e5b9f);};}exports[_0x0afb('0x5')]=function(_0x1d284f){for(var _0x10be7b=0x0,_0x15a812=events[_0x0afb('0x6')];_0x10be7b<_0x15a812;_0x10be7b++){var _0xdf2869=events[_0x10be7b];var _0x2ad329=createListener(_0x0afb('0x7')+_0xdf2869,_0x1d284f);WhatsappQueueEvents['on'](_0xdf2869,_0x2ad329);}};
\ No newline at end of file
index 386e8fe..0bb55fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x367c=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','put','update','/:id','destroy','exports','multer','path'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0x367c,0x1c0));var _0xc367=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x367c[_0x511bd1];return _0x4c48ec;};'use strict';var multer=require(_0xc367('0x0'));var util=require('util');var path=require(_0xc367('0x1'));var timeout=require(_0xc367('0x2'));var express=require(_0xc367('0x3'));var router=express[_0xc367('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc367('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc367('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0xc367('0x7')]('/',auth[_0xc367('0x8')](),controller['index']);router[_0xc367('0x7')](_0xc367('0x9'),auth[_0xc367('0x8')](),controller[_0xc367('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc367('0xb')]);router[_0xc367('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc367('0xd')]('/:id',auth[_0xc367('0x8')](),controller[_0xc367('0xe')]);router['delete'](_0xc367('0xf'),auth[_0xc367('0x8')](),controller[_0xc367('0x10')]);module[_0xc367('0x11')]=router;
\ No newline at end of file
+var _0x2dfb=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','update','delete','destroy','exports'];(function(_0x56ce7d,_0x57d050){var _0x72a880=function(_0x3179a2){while(--_0x3179a2){_0x56ce7d['push'](_0x56ce7d['shift']());}};_0x72a880(++_0x57d050);}(_0x2dfb,0x10e));var _0xb2df=function(_0x5dc699,_0x16a3fb){_0x5dc699=_0x5dc699-0x0;var _0x1b3b50=_0x2dfb[_0x5dc699];return _0x1b3b50;};'use strict';var multer=require(_0xb2df('0x0'));var util=require(_0xb2df('0x1'));var path=require('path');var timeout=require(_0xb2df('0x2'));var express=require('express');var router=express[_0xb2df('0x3')]();var fs_extra=require(_0xb2df('0x4'));var auth=require(_0xb2df('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb2df('0x6'));router['get']('/',auth[_0xb2df('0x7')](),controller[_0xb2df('0x8')]);router[_0xb2df('0x9')](_0xb2df('0xa'),auth[_0xb2df('0x7')](),controller[_0xb2df('0xb')]);router[_0xb2df('0x9')](_0xb2df('0xc'),auth[_0xb2df('0x7')](),controller['show']);router[_0xb2df('0xd')]('/',auth[_0xb2df('0x7')](),controller['create']);router['put'](_0xb2df('0xc'),auth[_0xb2df('0x7')](),controller[_0xb2df('0xe')]);router[_0xb2df('0xf')](_0xb2df('0xc'),auth[_0xb2df('0x7')](),controller[_0xb2df('0x10')]);module[_0xb2df('0x11')]=router;
\ No newline at end of file
index 9606d0d..db3a395 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x19e1c5,_0x2c81d1){var _0x29d48d=function(_0x385e42){while(--_0x385e42){_0x19e1c5['push'](_0x19e1c5['shift']());}};_0x29d48d(++_0x2c81d1);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x3f4e15,_0x1d5373){var _0x4dee98=function(_0x2662a5){while(--_0x2662a5){_0x3f4e15['push'](_0x3f4e15['shift']());}};_0x4dee98(++_0x1d5373);}(_0x7a54,0x106));var _0x47a5=function(_0x3f25e6,_0x5b8afc){_0x3f25e6=_0x3f25e6-0x0;var _0x18031f=_0x7a54[_0x3f25e6];return _0x18031f;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
index ab112af..42cdf30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','params','keys','find','catch','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x53aa27,_0x1ad0cc){var _0x65361c=function(_0x6d239f){while(--_0x6d239f){_0x53aa27['push'](_0x53aa27['shift']());}};_0x65361c(++_0x1ad0cc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={},_0x292205={},_0x254fc8={'count':0x0,'rows':[]};var _0x5aba96=_['map'](db[_0x3071('0x2d')][_0x3071('0x2e')],function(_0x6ddf96){return{'name':_0x6ddf96[_0x3071('0x2f')],'type':_0x6ddf96[_0x3071('0x30')][_0x3071('0x31')]};});_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x5aba96,'name');_0x292205['query']=_['keys'](_0x177b5f[_0x3071('0x34')]);_0x292205[_0x3071('0x35')]=_['intersection'](_0x292205[_0x3071('0x32')],_0x292205[_0x3071('0x34')]);_0x32f1b4[_0x3071('0x36')]=_[_0x3071('0x37')](_0x292205['model'],qs[_0x3071('0x38')](_0x177b5f[_0x3071('0x34')][_0x3071('0x38')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x39')]?_0x32f1b4[_0x3071('0x36')]:_0x292205[_0x3071('0x32')];if(!_0x177b5f['query'][_0x3071('0x3a')]('nolimit')){_0x32f1b4['limit']=qs[_0x3071('0x20')](_0x177b5f[_0x3071('0x34')]['limit']);_0x32f1b4[_0x3071('0x1e')]=qs[_0x3071('0x1e')](_0x177b5f[_0x3071('0x34')][_0x3071('0x1e')]);}_0x32f1b4[_0x3071('0x3b')]=qs[_0x3071('0x3c')](_0x177b5f['query'][_0x3071('0x3c')]);_0x32f1b4[_0x3071('0x3d')]=qs['filters'](_[_0x3071('0x3e')](_0x177b5f['query'],_0x292205[_0x3071('0x35')]),_0x5aba96);if(_0x177b5f[_0x3071('0x34')]['filter']){_0x32f1b4['where']=_[_0x3071('0x3f')](_0x32f1b4[_0x3071('0x3d')],{'$or':_[_0x3071('0x33')](_0x5aba96,function(_0x55afa6){if(_0x55afa6[_0x3071('0x30')]!=='VIRTUAL'){var _0x1ac90a={};_0x1ac90a[_0x55afa6['name']]={'$like':'%'+_0x177b5f[_0x3071('0x34')][_0x3071('0x40')]+'%'};return _0x1ac90a;}})});}_0x32f1b4=_[_0x3071('0x3f')]({},_0x32f1b4,_0x177b5f[_0x3071('0x41')]);var _0x30ab68={'where':_0x32f1b4['where']};return db['WhatsappQueueReport'][_0x3071('0x21')](_0x30ab68)[_0x3071('0x27')](function(_0x1455be){_0x254fc8[_0x3071('0x21')]=_0x1455be;if(_0x177b5f['query'][_0x3071('0x42')]){_0x32f1b4[_0x3071('0x43')]=[{'all':!![]}];}return db[_0x3071('0x2d')][_0x3071('0x44')](_0x32f1b4);})[_0x3071('0x27')](function(_0xb9a4b8){_0x254fc8['rows']=_0xb9a4b8;return _0x254fc8;})[_0x3071('0x27')](respondWithFilteredResult(_0x3921a1,_0x32f1b4))['catch'](handleError(_0x3921a1,null));};exports['show']=function(_0x4dc9d1,_0x47ceaf){var _0x2992e6={'raw':!![],'where':{'id':_0x4dc9d1[_0x3071('0x45')]['id']}},_0x1be8b6={};_0x1be8b6[_0x3071('0x32')]=_[_0x3071('0x46')](db[_0x3071('0x2d')][_0x3071('0x2e')]);_0x1be8b6[_0x3071('0x34')]=_['keys'](_0x4dc9d1[_0x3071('0x34')]);_0x1be8b6[_0x3071('0x35')]=_[_0x3071('0x37')](_0x1be8b6[_0x3071('0x32')],_0x1be8b6[_0x3071('0x34')]);_0x2992e6['attributes']=_['intersection'](_0x1be8b6[_0x3071('0x32')],qs[_0x3071('0x38')](_0x4dc9d1[_0x3071('0x34')][_0x3071('0x38')]));_0x2992e6[_0x3071('0x36')]=_0x2992e6['attributes'][_0x3071('0x39')]?_0x2992e6['attributes']:_0x1be8b6[_0x3071('0x32')];if(_0x4dc9d1['query']['includeAll']){_0x2992e6[_0x3071('0x43')]=[{'all':!![]}];}_0x2992e6=_['merge']({},_0x2992e6,_0x4dc9d1[_0x3071('0x41')]);return db['WhatsappQueueReport'][_0x3071('0x47')](_0x2992e6)[_0x3071('0x27')](handleEntityNotFound(_0x47ceaf,null))[_0x3071('0x27')](respondWithResult(_0x47ceaf,null))[_0x3071('0x48')](handleError(_0x47ceaf,null));};exports['create']=function(_0x2d70bf,_0x575c12){return db[_0x3071('0x2d')]['create'](_0x2d70bf[_0x3071('0x49')],{})[_0x3071('0x27')](respondWithResult(_0x575c12,0xc9))['catch'](handleError(_0x575c12,null));};exports[_0x3071('0x26')]=function(_0x117e73,_0x224a70){if(_0x117e73[_0x3071('0x49')]['id']){delete _0x117e73[_0x3071('0x49')]['id'];}return db[_0x3071('0x2d')][_0x3071('0x47')]({'where':{'id':_0x117e73['params']['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x224a70,null))[_0x3071('0x27')](saveUpdates(_0x117e73[_0x3071('0x49')],null))[_0x3071('0x27')](respondWithResult(_0x224a70,null))['catch'](handleError(_0x224a70,null));};exports[_0x3071('0x28')]=function(_0x2aea37,_0x1b832e){return db[_0x3071('0x2d')][_0x3071('0x47')]({'where':{'id':_0x2aea37[_0x3071('0x45')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0x1b832e,null))[_0x3071('0x27')](removeEntity(_0x1b832e,null))[_0x3071('0x48')](handleError(_0x1b832e,null));};exports[_0x3071('0x4a')]=function(_0x4371e7,_0x111115){return db[_0x3071('0x2d')][_0x3071('0x4a')]()[_0x3071('0x27')](respondWithResult(_0x111115,null))[_0x3071('0x48')](handleError(_0x111115,null));};
\ No newline at end of file
+var _0xbc9d=['index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','map','type','merge','options','WhatsappQueueReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','stack','name','send'];(function(_0x7ab7b,_0x15d717){var _0x4e8fca=function(_0x5d384e){while(--_0x5d384e){_0x7ab7b['push'](_0x7ab7b['shift']());}};_0x4e8fca(++_0x15d717);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x5e4053,_0x26f5c2){_0x5e4053=_0x5e4053-0x0;var _0x307c8b=_0xbc9d[_0x5e4053];return _0x307c8b;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];function respondWithStatusCode(_0x103d54,_0x48bc83){_0x48bc83=_0x48bc83||0xcc;return function(_0x567e71){if(_0x567e71){return _0x103d54[_0xdbc9('0x19')](_0x48bc83);}return _0x103d54[_0xdbc9('0x1a')](_0x48bc83)[_0xdbc9('0x1b')]();};}function respondWithResult(_0x436e50,_0x53495d){_0x53495d=_0x53495d||0xc8;return function(_0x4a9dcb){if(_0x4a9dcb){return _0x436e50[_0xdbc9('0x1a')](_0x53495d)[_0xdbc9('0x1c')](_0x4a9dcb);}};}function respondWithFilteredResult(_0x3a8a7b,_0x4c7b4f){return function(_0x1b4616){if(_0x1b4616){var _0x1abee8=typeof _0x4c7b4f['offset']===_0xdbc9('0x1d')&&typeof _0x4c7b4f[_0xdbc9('0x1e')]===_0xdbc9('0x1d');var _0x14e655=_0x1b4616[_0xdbc9('0x1f')];var _0x33f1bd=_0x1abee8?0x0:_0x4c7b4f[_0xdbc9('0x20')];var _0xc2ddd2=_0x1abee8?_0x1b4616[_0xdbc9('0x1f')]:_0x4c7b4f[_0xdbc9('0x20')]+_0x4c7b4f['limit'];var _0x1ca5fd;if(_0xc2ddd2>=_0x14e655){_0xc2ddd2=_0x14e655;_0x1ca5fd=0xc8;}else{_0x1ca5fd=0xce;}_0x3a8a7b['status'](_0x1ca5fd);return _0x3a8a7b[_0xdbc9('0x21')](_0xdbc9('0x22'),_0x33f1bd+'-'+_0xc2ddd2+'/'+_0x14e655)['json'](_0x1b4616);}return null;};}function patchUpdates(_0x4408e9){return function(_0x5367dc){try{jsonpatch['apply'](_0x5367dc,_0x4408e9,!![]);}catch(_0x4ab00d){return BPromise['reject'](_0x4ab00d);}return _0x5367dc[_0xdbc9('0x23')]();};}function saveUpdates(_0x2011a2,_0x570ad9){return function(_0x16dcf7){if(_0x16dcf7){return _0x16dcf7[_0xdbc9('0x24')](_0x2011a2)['then'](function(_0x1bc073){return _0x1bc073;});}return null;};}function removeEntity(_0x6b788,_0x1b1c0d){return function(_0x119230){if(_0x119230){return _0x119230[_0xdbc9('0x25')]()[_0xdbc9('0x26')](function(){_0x6b788[_0xdbc9('0x1a')](0xcc)[_0xdbc9('0x1b')]();});}};}function handleEntityNotFound(_0x3c8c1d,_0x4a868b){return function(_0x550bef){if(!_0x550bef){_0x3c8c1d[_0xdbc9('0x19')](0x194);}return _0x550bef;};}function handleError(_0x446ab9,_0x1053ca){_0x1053ca=_0x1053ca||0x1f4;return function(_0x24fdec){logger['error'](_0x24fdec[_0xdbc9('0x27')]);if(_0x24fdec[_0xdbc9('0x28')]){delete _0x24fdec['name'];}_0x446ab9['status'](_0x1053ca)[_0xdbc9('0x29')](_0x24fdec);};}exports[_0xdbc9('0x2a')]=function(_0x473430,_0x59bfd2){var _0x13a432={},_0x539e57={},_0x561f8e={'count':0x0,'rows':[]};var _0x210a40=_['map'](db['WhatsappQueueReport'][_0xdbc9('0x2b')],function(_0x20eb4f){return{'name':_0x20eb4f[_0xdbc9('0x2c')],'type':_0x20eb4f['type'][_0xdbc9('0x2d')]};});_0x539e57[_0xdbc9('0x2e')]=_['map'](_0x210a40,'name');_0x539e57[_0xdbc9('0x2f')]=_[_0xdbc9('0x30')](_0x473430[_0xdbc9('0x2f')]);_0x539e57[_0xdbc9('0x31')]=_[_0xdbc9('0x32')](_0x539e57[_0xdbc9('0x2e')],_0x539e57[_0xdbc9('0x2f')]);_0x13a432['attributes']=_[_0xdbc9('0x32')](_0x539e57[_0xdbc9('0x2e')],qs[_0xdbc9('0x33')](_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x33')]));_0x13a432[_0xdbc9('0x34')]=_0x13a432['attributes'][_0xdbc9('0x35')]?_0x13a432['attributes']:_0x539e57['model'];if(!_0x473430['query']['hasOwnProperty']('nolimit')){_0x13a432[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x473430[_0xdbc9('0x2f')]['limit']);_0x13a432[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x20')]);}_0x13a432[_0xdbc9('0x36')]=qs[_0xdbc9('0x37')](_0x473430['query'][_0xdbc9('0x37')]);_0x13a432[_0xdbc9('0x38')]=qs[_0xdbc9('0x31')](_['pick'](_0x473430[_0xdbc9('0x2f')],_0x539e57[_0xdbc9('0x31')]),_0x210a40);if(_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x39')]){_0x13a432['where']=_['merge'](_0x13a432[_0xdbc9('0x38')],{'$or':_[_0xdbc9('0x3a')](_0x210a40,function(_0x136392){if(_0x136392[_0xdbc9('0x3b')]!=='VIRTUAL'){var _0x1b651f={};_0x1b651f[_0x136392[_0xdbc9('0x28')]]={'$like':'%'+_0x473430[_0xdbc9('0x2f')]['filter']+'%'};return _0x1b651f;}})});}_0x13a432=_[_0xdbc9('0x3c')]({},_0x13a432,_0x473430[_0xdbc9('0x3d')]);var _0x444219={'where':_0x13a432['where']};return db[_0xdbc9('0x3e')][_0xdbc9('0x1f')](_0x444219)['then'](function(_0x5173c2){_0x561f8e[_0xdbc9('0x1f')]=_0x5173c2;if(_0x473430[_0xdbc9('0x2f')][_0xdbc9('0x3f')]){_0x13a432[_0xdbc9('0x40')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0xdbc9('0x41')](_0x13a432);})[_0xdbc9('0x26')](function(_0x577725){_0x561f8e[_0xdbc9('0x42')]=_0x577725;return _0x561f8e;})[_0xdbc9('0x26')](respondWithFilteredResult(_0x59bfd2,_0x13a432))['catch'](handleError(_0x59bfd2,null));};exports[_0xdbc9('0x43')]=function(_0x72dee3,_0x2adb23){var _0x3415c3={'raw':!![],'where':{'id':_0x72dee3[_0xdbc9('0x44')]['id']}},_0x3ed4de={};_0x3ed4de[_0xdbc9('0x2e')]=_['keys'](db['WhatsappQueueReport'][_0xdbc9('0x2b')]);_0x3ed4de[_0xdbc9('0x2f')]=_[_0xdbc9('0x30')](_0x72dee3[_0xdbc9('0x2f')]);_0x3ed4de[_0xdbc9('0x31')]=_[_0xdbc9('0x32')](_0x3ed4de[_0xdbc9('0x2e')],_0x3ed4de[_0xdbc9('0x2f')]);_0x3415c3[_0xdbc9('0x34')]=_[_0xdbc9('0x32')](_0x3ed4de[_0xdbc9('0x2e')],qs['fields'](_0x72dee3['query'][_0xdbc9('0x33')]));_0x3415c3[_0xdbc9('0x34')]=_0x3415c3[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0x3415c3[_0xdbc9('0x34')]:_0x3ed4de[_0xdbc9('0x2e')];if(_0x72dee3[_0xdbc9('0x2f')][_0xdbc9('0x3f')]){_0x3415c3['include']=[{'all':!![]}];}_0x3415c3=_['merge']({},_0x3415c3,_0x72dee3[_0xdbc9('0x3d')]);return db[_0xdbc9('0x3e')][_0xdbc9('0x45')](_0x3415c3)[_0xdbc9('0x26')](handleEntityNotFound(_0x2adb23,null))[_0xdbc9('0x26')](respondWithResult(_0x2adb23,null))[_0xdbc9('0x46')](handleError(_0x2adb23,null));};exports[_0xdbc9('0x47')]=function(_0x2ea096,_0x43e3ec){return db['WhatsappQueueReport'][_0xdbc9('0x47')](_0x2ea096[_0xdbc9('0x48')],{})['then'](respondWithResult(_0x43e3ec,0xc9))['catch'](handleError(_0x43e3ec,null));};exports[_0xdbc9('0x24')]=function(_0xc3db3c,_0x133a13){if(_0xc3db3c['body']['id']){delete _0xc3db3c[_0xdbc9('0x48')]['id'];}return db[_0xdbc9('0x3e')][_0xdbc9('0x45')]({'where':{'id':_0xc3db3c[_0xdbc9('0x44')]['id']}})['then'](handleEntityNotFound(_0x133a13,null))[_0xdbc9('0x26')](saveUpdates(_0xc3db3c[_0xdbc9('0x48')],null))[_0xdbc9('0x26')](respondWithResult(_0x133a13,null))[_0xdbc9('0x46')](handleError(_0x133a13,null));};exports['destroy']=function(_0x3e89f5,_0x36c70e){return db[_0xdbc9('0x3e')][_0xdbc9('0x45')]({'where':{'id':_0x3e89f5[_0xdbc9('0x44')]['id']}})[_0xdbc9('0x26')](handleEntityNotFound(_0x36c70e,null))[_0xdbc9('0x26')](removeEntity(_0x36c70e,null))[_0xdbc9('0x46')](handleError(_0x36c70e,null));};exports['describe']=function(_0x1c6e6e,_0x4d09e1){return db[_0xdbc9('0x3e')][_0xdbc9('0x49')]()['then'](respondWithResult(_0x4d09e1,null))['catch'](handleError(_0x4d09e1,null));};
\ No newline at end of file
index f4c7ddb..952c15b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51ff=['./whatsappQueueReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x51ff,0x18a));var _0xf51f=function(_0x51ea69,_0x501676){_0x51ea69=_0x51ea69-0x0;var _0x49db84=_0x51ff[_0x51ea69];return _0x49db84;};'use strict';var _=require(_0xf51f('0x0'));var util=require(_0xf51f('0x1'));var logger=require(_0xf51f('0x2'))('api');var moment=require(_0xf51f('0x3'));var BPromise=require(_0xf51f('0x4'));var rp=require(_0xf51f('0x5'));var fs=require('fs');var path=require(_0xf51f('0x6'));var rimraf=require(_0xf51f('0x7'));var config=require(_0xf51f('0x8'));var attributes=require(_0xf51f('0x9'));module[_0xf51f('0xa')]=function(_0x1925ee,_0x570268){return _0x1925ee[_0xf51f('0xb')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xf51f('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8cdc=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x289ac3,_0x4b3235){var _0x22d11c=function(_0x5d783e){while(--_0x5d783e){_0x289ac3['push'](_0x289ac3['shift']());}};_0x22d11c(++_0x4b3235);}(_0x8cdc,0x8c));var _0xc8cd=function(_0x427f38,_0x34f332){_0x427f38=_0x427f38-0x0;var _0x2f39d7=_0x8cdc[_0x427f38];return _0x2f39d7;};'use strict';var _=require(_0xc8cd('0x0'));var util=require(_0xc8cd('0x1'));var logger=require(_0xc8cd('0x2'))(_0xc8cd('0x3'));var moment=require(_0xc8cd('0x4'));var BPromise=require(_0xc8cd('0x5'));var rp=require(_0xc8cd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8cd('0x7'));var config=require(_0xc8cd('0x8'));var attributes=require(_0xc8cd('0x9'));module[_0xc8cd('0xa')]=function(_0x39c948,_0x3c8bf6){return _0x39c948[_0xc8cd('0xb')](_0xc8cd('0xc'),attributes,{'tableName':_0xc8cd('0xd'),'paranoid':![],'indexes':[{'name':_0xc8cd('0xe'),'fields':[_0xc8cd('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 6897207..2b64e0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c19=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','debug','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x2ceb31,_0x40ecf1){var _0x168859=function(_0x3de469){while(--_0x3de469){_0x2ceb31['push'](_0x2ceb31['shift']());}};_0x168859(++_0x40ecf1);}(_0x9c19,0xfb));var _0x99c1=function(_0x5bd103,_0x3b8037){_0x5bd103=_0x5bd103-0x0;var _0xc33b64=_0x9c19[_0x5bd103];return _0xc33b64;};'use strict';var _=require('lodash');var util=require(_0x99c1('0x0'));var moment=require(_0x99c1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99c1('0x2'));var db=require(_0x99c1('0x3'))['db'];var utils=require(_0x99c1('0x4'));var logger=require('../../config/logger')(_0x99c1('0x5'));var config=require(_0x99c1('0x6'));var jayson=require(_0x99c1('0x7'));var client=jayson['client'][_0x99c1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x27f70c,_0x548da5,_0x30ff7d){return new BPromise(function(_0x50f352,_0x49947f){return client[_0x99c1('0x9')](_0x27f70c,_0x30ff7d)[_0x99c1('0xa')](function(_0x1db6f3){logger[_0x99c1('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x548da5,_0x99c1('0xc'));logger['debug'](_0x99c1('0xd'),_0x548da5,'request\x20sent',JSON[_0x99c1('0xe')](_0x1db6f3));if(_0x1db6f3[_0x99c1('0xf')]){if(_0x1db6f3['error'][_0x99c1('0x10')]===0x1f4){logger[_0x99c1('0xf')](_0x99c1('0x11'),_0x548da5,_0x1db6f3['error'][_0x99c1('0x12')]);return _0x49947f(_0x1db6f3['error'][_0x99c1('0x12')]);}logger[_0x99c1('0xf')](_0x99c1('0x11'),_0x548da5,_0x1db6f3[_0x99c1('0xf')]['message']);return _0x50f352(_0x1db6f3['error'][_0x99c1('0x12')]);}else{logger[_0x99c1('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x548da5,'request\x20sent');_0x50f352(_0x1db6f3[_0x99c1('0x13')][_0x99c1('0x12')]);}})[_0x99c1('0x14')](function(_0x1a43e1){logger[_0x99c1('0xf')](_0x99c1('0x11'),_0x548da5,_0x1a43e1);_0x49947f(_0x1a43e1);});});}exports[_0x99c1('0x15')]=function(_0x2fab34){var _0x2183a3=this;return new Promise(function(_0x4f6df0,_0x38067d){return db[_0x99c1('0x16')][_0x99c1('0x17')](_0x2fab34[_0x99c1('0x18')],{'raw':_0x2fab34[_0x99c1('0x19')]?_0x2fab34[_0x99c1('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x99c1('0xa')](function(_0x3c045d){logger[_0x99c1('0xb')](_0x99c1('0x15'),_0x2fab34);logger[_0x99c1('0x1a')](_0x99c1('0x15'),_0x2fab34,JSON[_0x99c1('0xe')](_0x3c045d));_0x4f6df0(_0x3c045d);})['catch'](function(_0x323b19){logger[_0x99c1('0xf')](_0x99c1('0x15'),_0x323b19[_0x99c1('0x12')],_0x2fab34);_0x38067d(_0x2183a3[_0x99c1('0xf')](0x1f4,_0x323b19[_0x99c1('0x12')]));});});};exports[_0x99c1('0x1b')]=function(_0x4c4484){var _0x220972=this;return new Promise(function(_0x382637,_0x36b50b){return db[_0x99c1('0x16')][_0x99c1('0x1c')](_0x4c4484['body'],{'raw':_0x4c4484[_0x99c1('0x19')]?_0x4c4484['options'][_0x99c1('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c4484['options']?_0x4c4484[_0x99c1('0x19')][_0x99c1('0x1e')]||null:null,'attributes':_0x4c4484[_0x99c1('0x19')]?_0x4c4484[_0x99c1('0x19')][_0x99c1('0x1f')]||null:null,'limit':_0x4c4484[_0x99c1('0x19')]?_0x4c4484[_0x99c1('0x19')][_0x99c1('0x20')]||null:null})[_0x99c1('0xa')](function(_0x58ee8a){logger[_0x99c1('0xb')](_0x99c1('0x1b'),_0x4c4484);logger[_0x99c1('0x1a')](_0x99c1('0x1b'),_0x4c4484,JSON[_0x99c1('0xe')](_0x58ee8a));_0x382637(_0x58ee8a);})[_0x99c1('0x14')](function(_0x114cc5){logger[_0x99c1('0xf')](_0x99c1('0x1b'),_0x114cc5[_0x99c1('0x12')],_0x4c4484);_0x36b50b(_0x220972['error'](0x1f4,_0x114cc5[_0x99c1('0x12')]));});});};
\ No newline at end of file
+var _0xc1e8=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','CreateWhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','attributes','limit','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x45a0f9,_0x1d1dd9){var _0xe5741a=function(_0x20ef9b){while(--_0x20ef9b){_0x45a0f9['push'](_0x45a0f9['shift']());}};_0xe5741a(++_0x1d1dd9);}(_0xc1e8,0x146));var _0x8c1e=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0xc1e8[_0x318840];return _0x223da4;};'use strict';var _=require(_0x8c1e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8c1e('0x1'));var rs=require(_0x8c1e('0x2'));var fs=require('fs');var Redis=require(_0x8c1e('0x3'));var db=require(_0x8c1e('0x4'))['db'];var utils=require(_0x8c1e('0x5'));var logger=require(_0x8c1e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8c1e('0x7'));var client=jayson[_0x8c1e('0x8')][_0x8c1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x179ccd,_0x890acc,_0x3933d8){return new BPromise(function(_0x8836df,_0x3e05c7){return client[_0x8c1e('0xa')](_0x179ccd,_0x3933d8)[_0x8c1e('0xb')](function(_0x357c00){logger[_0x8c1e('0xc')](_0x8c1e('0xd'),_0x890acc,'request\x20sent');logger[_0x8c1e('0xe')](_0x8c1e('0xf'),_0x890acc,'request\x20sent',JSON[_0x8c1e('0x10')](_0x357c00));if(_0x357c00[_0x8c1e('0x11')]){if(_0x357c00[_0x8c1e('0x11')]['code']===0x1f4){logger[_0x8c1e('0x11')](_0x8c1e('0xd'),_0x890acc,_0x357c00['error'][_0x8c1e('0x12')]);return _0x3e05c7(_0x357c00[_0x8c1e('0x11')]['message']);}logger[_0x8c1e('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x890acc,_0x357c00[_0x8c1e('0x11')]['message']);return _0x8836df(_0x357c00[_0x8c1e('0x11')][_0x8c1e('0x12')]);}else{logger[_0x8c1e('0xc')](_0x8c1e('0xd'),_0x890acc,_0x8c1e('0x13'));_0x8836df(_0x357c00[_0x8c1e('0x14')][_0x8c1e('0x12')]);}})['catch'](function(_0x4efe6a){logger[_0x8c1e('0x11')](_0x8c1e('0xd'),_0x890acc,_0x4efe6a);_0x3e05c7(_0x4efe6a);});});}exports[_0x8c1e('0x15')]=function(_0x29cbad){var _0x2a0087=this;return new Promise(function(_0x7c044a,_0x22a267){return db['WhatsappQueueReport'][_0x8c1e('0x16')](_0x29cbad[_0x8c1e('0x17')],{'raw':_0x29cbad[_0x8c1e('0x18')]?_0x29cbad[_0x8c1e('0x18')][_0x8c1e('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4adb26){logger[_0x8c1e('0xc')]('CreateWhatsappQueueReport',_0x29cbad);logger[_0x8c1e('0xe')]('CreateWhatsappQueueReport',_0x29cbad,JSON[_0x8c1e('0x10')](_0x4adb26));_0x7c044a(_0x4adb26);})['catch'](function(_0x1a9aed){logger[_0x8c1e('0x11')]('CreateWhatsappQueueReport',_0x1a9aed[_0x8c1e('0x12')],_0x29cbad);_0x22a267(_0x2a0087[_0x8c1e('0x11')](0x1f4,_0x1a9aed[_0x8c1e('0x12')]));});});};exports[_0x8c1e('0x1a')]=function(_0x5712b0){var _0x468ede=this;return new Promise(function(_0x22ee9e,_0x2205dc){return db[_0x8c1e('0x1b')][_0x8c1e('0x1c')](_0x5712b0[_0x8c1e('0x17')],{'raw':_0x5712b0[_0x8c1e('0x18')]?_0x5712b0['options'][_0x8c1e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5712b0[_0x8c1e('0x18')]?_0x5712b0[_0x8c1e('0x18')][_0x8c1e('0x1d')]||null:null,'attributes':_0x5712b0[_0x8c1e('0x18')]?_0x5712b0[_0x8c1e('0x18')][_0x8c1e('0x1e')]||null:null,'limit':_0x5712b0[_0x8c1e('0x18')]?_0x5712b0[_0x8c1e('0x18')][_0x8c1e('0x1f')]||null:null})['then'](function(_0x182a97){logger[_0x8c1e('0xc')]('UpdateWhatsappQueueReport',_0x5712b0);logger[_0x8c1e('0xe')](_0x8c1e('0x1a'),_0x5712b0,JSON[_0x8c1e('0x10')](_0x182a97));_0x22ee9e(_0x182a97);})[_0x8c1e('0x20')](function(_0x2ec64a){logger['error'](_0x8c1e('0x1a'),_0x2ec64a['message'],_0x5712b0);_0x2205dc(_0x468ede['error'](0x1f4,_0x2ec64a['message']));});});};
\ No newline at end of file
index 599d393..46f582d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4218=['create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/:id','show','post'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x4218,0x17f));var _0x8421=function(_0xe00d22,_0x98bc6){_0xe00d22=_0xe00d22-0x0;var _0x377df4=_0x4218[_0xe00d22];return _0x377df4;};'use strict';var multer=require(_0x8421('0x0'));var util=require('util');var path=require(_0x8421('0x1'));var timeout=require(_0x8421('0x2'));var express=require(_0x8421('0x3'));var router=express[_0x8421('0x4')]();var fs_extra=require(_0x8421('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8421('0x6'));var config=require(_0x8421('0x7'));var controller=require('./whatsappTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8421('0x8')]);router['get'](_0x8421('0x9'),auth[_0x8421('0xa')](),controller[_0x8421('0xb')]);router[_0x8421('0xc')](_0x8421('0xd'),auth[_0x8421('0xa')](),controller[_0x8421('0xe')]);router[_0x8421('0xf')]('/',auth[_0x8421('0xa')](),controller[_0x8421('0x10')]);router[_0x8421('0x11')](_0x8421('0xd'),auth[_0x8421('0xa')](),controller[_0x8421('0x12')]);router[_0x8421('0x13')](_0x8421('0xd'),auth[_0x8421('0xa')](),controller[_0x8421('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x9afc=['isAuthenticated','/:id','post','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','index','/describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9afc,0x17c));var _0xc9af=function(_0x157d23,_0x4027b9){_0x157d23=_0x157d23-0x0;var _0x5b93cc=_0x9afc[_0x157d23];return _0x5b93cc;};'use strict';var multer=require(_0xc9af('0x0'));var util=require(_0xc9af('0x1'));var path=require('path');var timeout=require(_0xc9af('0x2'));var express=require(_0xc9af('0x3'));var router=express[_0xc9af('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc9af('0x5'));var interaction=require(_0xc9af('0x6'));var config=require('../../config/environment');var controller=require(_0xc9af('0x7'));router[_0xc9af('0x8')]('/',auth['isAuthenticated'](),controller[_0xc9af('0x9')]);router[_0xc9af('0x8')](_0xc9af('0xa'),auth[_0xc9af('0xb')](),controller['describe']);router[_0xc9af('0x8')](_0xc9af('0xc'),auth[_0xc9af('0xb')](),controller['show']);router[_0xc9af('0xd')]('/',auth[_0xc9af('0xb')](),controller['create']);router['put'](_0xc9af('0xc'),auth[_0xc9af('0xb')](),controller['update']);router[_0xc9af('0xe')](_0xc9af('0xc'),auth[_0xc9af('0xb')](),controller[_0xc9af('0xf')]);module[_0xc9af('0x10')]=router;
\ No newline at end of file
index 84f1818..19b5bf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7708=['exports','ENUM','sequelize'];(function(_0x1da151,_0x294fd0){var _0x48c695=function(_0x3f57b5){while(--_0x3f57b5){_0x1da151['push'](_0x1da151['shift']());}};_0x48c695(++_0x294fd0);}(_0x7708,0x188));var _0x8770=function(_0x1e1020,_0xd64a27){_0x1e1020=_0x1e1020-0x0;var _0x464719=_0x7708[_0x1e1020];return _0x464719;};'use strict';var Sequelize=require(_0x8770('0x0'));module[_0x8770('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8770('0x2')]('account','agent','queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xb077=['queue','DATE','sequelize','ENUM','agent'];(function(_0xf91cd1,_0x11b824){var _0x198a7f=function(_0x24a098){while(--_0x24a098){_0xf91cd1['push'](_0xf91cd1['shift']());}};_0x198a7f(++_0x11b824);}(_0xb077,0x7a));var _0x7b07=function(_0x283e4d,_0x1e68dc){_0x283e4d=_0x283e4d-0x0;var _0x194fa9=_0xb077[_0x283e4d];return _0x194fa9;};'use strict';var Sequelize=require(_0x7b07('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7b07('0x1')]('account',_0x7b07('0x2'),_0x7b07('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7b07('0x4')]}};
\ No newline at end of file
index bbb82b3..b2c74b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8ea=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','WhatsappTransferReport','includeAll','include','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys'];(function(_0x175723,_0x705f03){var _0x57648e=function(_0x4fd902){while(--_0x4fd902){_0x175723['push'](_0x175723['shift']());}};_0x57648e(++_0x705f03);}(_0xa8ea,0xfb));var _0xaa8e=function(_0x30ebe5,_0x136f6d){_0x30ebe5=_0x30ebe5-0x0;var _0x241883=_0xa8ea[_0x30ebe5];return _0x241883;};'use strict';var emlformat=require(_0xaa8e('0x0'));var rimraf=require(_0xaa8e('0x1'));var zipdir=require(_0xaa8e('0x2'));var jsonpatch=require(_0xaa8e('0x3'));var rp=require('request-promise');var moment=require(_0xaa8e('0x4'));var BPromise=require(_0xaa8e('0x5'));var Mustache=require(_0xaa8e('0x6'));var util=require(_0xaa8e('0x7'));var path=require(_0xaa8e('0x8'));var sox=require(_0xaa8e('0x9'));var csv=require(_0xaa8e('0xa'));var ejs=require(_0xaa8e('0xb'));var fs=require('fs');var fs_extra=require(_0xaa8e('0xc'));var _=require(_0xaa8e('0xd'));var squel=require('squel');var crypto=require(_0xaa8e('0xe'));var jsforce=require(_0xaa8e('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaa8e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xaa8e('0x11'));var as=require(_0xaa8e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa8e('0x13'));var utils=require(_0xaa8e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xaa8e('0x15'));var db=require(_0xaa8e('0x16'))['db'];function respondWithStatusCode(_0x2f947c,_0x452738){_0x452738=_0x452738||0xcc;return function(_0xc80d99){if(_0xc80d99){return _0x2f947c[_0xaa8e('0x17')](_0x452738);}return _0x2f947c['status'](_0x452738)['end']();};}function respondWithResult(_0x33ff08,_0x3b25ec){_0x3b25ec=_0x3b25ec||0xc8;return function(_0x4d6620){if(_0x4d6620){return _0x33ff08[_0xaa8e('0x18')](_0x3b25ec)[_0xaa8e('0x19')](_0x4d6620);}};}function respondWithFilteredResult(_0x5ee3ec,_0x593f44){return function(_0xbee306){if(_0xbee306){var _0x36684b=typeof _0x593f44[_0xaa8e('0x1a')]===_0xaa8e('0x1b')&&typeof _0x593f44[_0xaa8e('0x1c')]==='undefined';var _0x25250d=_0xbee306[_0xaa8e('0x1d')];var _0x140d5b=_0x36684b?0x0:_0x593f44[_0xaa8e('0x1a')];var _0x5ed916=_0x36684b?_0xbee306[_0xaa8e('0x1d')]:_0x593f44[_0xaa8e('0x1a')]+_0x593f44[_0xaa8e('0x1c')];var _0x5e7224;if(_0x5ed916>=_0x25250d){_0x5ed916=_0x25250d;_0x5e7224=0xc8;}else{_0x5e7224=0xce;}_0x5ee3ec[_0xaa8e('0x18')](_0x5e7224);return _0x5ee3ec[_0xaa8e('0x1e')](_0xaa8e('0x1f'),_0x140d5b+'-'+_0x5ed916+'/'+_0x25250d)[_0xaa8e('0x19')](_0xbee306);}return null;};}function patchUpdates(_0x47b0cb){return function(_0x2e3548){try{jsonpatch[_0xaa8e('0x20')](_0x2e3548,_0x47b0cb,!![]);}catch(_0x1a27e0){return BPromise[_0xaa8e('0x21')](_0x1a27e0);}return _0x2e3548[_0xaa8e('0x22')]();};}function saveUpdates(_0x1e4fb1,_0x53f705){return function(_0x2d9daa){if(_0x2d9daa){return _0x2d9daa[_0xaa8e('0x23')](_0x1e4fb1)[_0xaa8e('0x24')](function(_0x514c54){return _0x514c54;});}return null;};}function removeEntity(_0x125c87,_0x5751d2){return function(_0x18eda5){if(_0x18eda5){return _0x18eda5[_0xaa8e('0x25')]()[_0xaa8e('0x24')](function(){_0x125c87['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be553,_0x463373){return function(_0x5744a1){if(!_0x5744a1){_0x4be553[_0xaa8e('0x17')](0x194);}return _0x5744a1;};}function handleError(_0x5ad2c2,_0x29b6c5){_0x29b6c5=_0x29b6c5||0x1f4;return function(_0x41d4a8){logger['error'](_0x41d4a8[_0xaa8e('0x26')]);if(_0x41d4a8[_0xaa8e('0x27')]){delete _0x41d4a8['name'];}_0x5ad2c2[_0xaa8e('0x18')](_0x29b6c5)[_0xaa8e('0x28')](_0x41d4a8);};}exports[_0xaa8e('0x29')]=function(_0x1fd431,_0x5ad46c){var _0x306d9a={},_0x541d77={},_0x5dd930={'count':0x0,'rows':[]};var _0x3e3da2=_[_0xaa8e('0x2a')](db['WhatsappTransferReport'][_0xaa8e('0x2b')],function(_0x4324b8){return{'name':_0x4324b8[_0xaa8e('0x2c')],'type':_0x4324b8[_0xaa8e('0x2d')][_0xaa8e('0x2e')]};});_0x541d77[_0xaa8e('0x2f')]=_[_0xaa8e('0x2a')](_0x3e3da2,_0xaa8e('0x27'));_0x541d77['query']=_[_0xaa8e('0x30')](_0x1fd431[_0xaa8e('0x31')]);_0x541d77[_0xaa8e('0x32')]=_[_0xaa8e('0x33')](_0x541d77[_0xaa8e('0x2f')],_0x541d77[_0xaa8e('0x31')]);_0x306d9a[_0xaa8e('0x34')]=_[_0xaa8e('0x33')](_0x541d77[_0xaa8e('0x2f')],qs[_0xaa8e('0x35')](_0x1fd431['query'][_0xaa8e('0x35')]));_0x306d9a[_0xaa8e('0x34')]=_0x306d9a[_0xaa8e('0x34')][_0xaa8e('0x36')]?_0x306d9a[_0xaa8e('0x34')]:_0x541d77[_0xaa8e('0x2f')];if(!_0x1fd431[_0xaa8e('0x31')][_0xaa8e('0x37')](_0xaa8e('0x38'))){_0x306d9a[_0xaa8e('0x1c')]=qs[_0xaa8e('0x1c')](_0x1fd431[_0xaa8e('0x31')][_0xaa8e('0x1c')]);_0x306d9a[_0xaa8e('0x1a')]=qs['offset'](_0x1fd431[_0xaa8e('0x31')]['offset']);}_0x306d9a['order']=qs[_0xaa8e('0x39')](_0x1fd431[_0xaa8e('0x31')]['sort']);_0x306d9a[_0xaa8e('0x3a')]=qs['filters'](_[_0xaa8e('0x3b')](_0x1fd431[_0xaa8e('0x31')],_0x541d77[_0xaa8e('0x32')]),_0x3e3da2);if(_0x1fd431[_0xaa8e('0x31')][_0xaa8e('0x3c')]){_0x306d9a[_0xaa8e('0x3a')]=_['merge'](_0x306d9a['where'],{'$or':_[_0xaa8e('0x2a')](_0x3e3da2,function(_0x319c15){if(_0x319c15[_0xaa8e('0x2d')]!==_0xaa8e('0x3d')){var _0x34431b={};_0x34431b[_0x319c15[_0xaa8e('0x27')]]={'$like':'%'+_0x1fd431[_0xaa8e('0x31')][_0xaa8e('0x3c')]+'%'};return _0x34431b;}})});}_0x306d9a=_['merge']({},_0x306d9a,_0x1fd431[_0xaa8e('0x3e')]);var _0x1fb9cd={'where':_0x306d9a[_0xaa8e('0x3a')]};return db[_0xaa8e('0x3f')][_0xaa8e('0x1d')](_0x1fb9cd)[_0xaa8e('0x24')](function(_0x3a28c9){_0x5dd930[_0xaa8e('0x1d')]=_0x3a28c9;if(_0x1fd431[_0xaa8e('0x31')][_0xaa8e('0x40')]){_0x306d9a[_0xaa8e('0x41')]=[{'all':!![]}];}return db[_0xaa8e('0x3f')]['findAll'](_0x306d9a);})[_0xaa8e('0x24')](function(_0x34525d){_0x5dd930[_0xaa8e('0x42')]=_0x34525d;return _0x5dd930;})[_0xaa8e('0x24')](respondWithFilteredResult(_0x5ad46c,_0x306d9a))[_0xaa8e('0x43')](handleError(_0x5ad46c,null));};exports[_0xaa8e('0x44')]=function(_0xa0de07,_0x1ebcf1){var _0x2795d2={'raw':!![],'where':{'id':_0xa0de07[_0xaa8e('0x45')]['id']}},_0x4999ef={};_0x4999ef[_0xaa8e('0x2f')]=_[_0xaa8e('0x30')](db[_0xaa8e('0x3f')][_0xaa8e('0x2b')]);_0x4999ef['query']=_[_0xaa8e('0x30')](_0xa0de07[_0xaa8e('0x31')]);_0x4999ef[_0xaa8e('0x32')]=_[_0xaa8e('0x33')](_0x4999ef[_0xaa8e('0x2f')],_0x4999ef[_0xaa8e('0x31')]);_0x2795d2[_0xaa8e('0x34')]=_[_0xaa8e('0x33')](_0x4999ef[_0xaa8e('0x2f')],qs[_0xaa8e('0x35')](_0xa0de07[_0xaa8e('0x31')][_0xaa8e('0x35')]));_0x2795d2[_0xaa8e('0x34')]=_0x2795d2[_0xaa8e('0x34')][_0xaa8e('0x36')]?_0x2795d2[_0xaa8e('0x34')]:_0x4999ef['model'];if(_0xa0de07[_0xaa8e('0x31')][_0xaa8e('0x40')]){_0x2795d2[_0xaa8e('0x41')]=[{'all':!![]}];}_0x2795d2=_[_0xaa8e('0x46')]({},_0x2795d2,_0xa0de07['options']);return db[_0xaa8e('0x3f')][_0xaa8e('0x47')](_0x2795d2)[_0xaa8e('0x24')](handleEntityNotFound(_0x1ebcf1,null))[_0xaa8e('0x24')](respondWithResult(_0x1ebcf1,null))['catch'](handleError(_0x1ebcf1,null));};exports[_0xaa8e('0x48')]=function(_0x3e20ad,_0x26e918){return db[_0xaa8e('0x3f')]['create'](_0x3e20ad['body'],{})['then'](respondWithResult(_0x26e918,0xc9))[_0xaa8e('0x43')](handleError(_0x26e918,null));};exports[_0xaa8e('0x23')]=function(_0x403d58,_0x216d41){if(_0x403d58['body']['id']){delete _0x403d58[_0xaa8e('0x49')]['id'];}return db[_0xaa8e('0x3f')][_0xaa8e('0x47')]({'where':{'id':_0x403d58[_0xaa8e('0x45')]['id']}})[_0xaa8e('0x24')](handleEntityNotFound(_0x216d41,null))[_0xaa8e('0x24')](saveUpdates(_0x403d58[_0xaa8e('0x49')],null))[_0xaa8e('0x24')](respondWithResult(_0x216d41,null))[_0xaa8e('0x43')](handleError(_0x216d41,null));};exports['destroy']=function(_0x22b157,_0x309c09){return db[_0xaa8e('0x3f')]['find']({'where':{'id':_0x22b157[_0xaa8e('0x45')]['id']}})['then'](handleEntityNotFound(_0x309c09,null))[_0xaa8e('0x24')](removeEntity(_0x309c09,null))[_0xaa8e('0x43')](handleError(_0x309c09,null));};exports['describe']=function(_0x309b97,_0xd18c9d){return db[_0xaa8e('0x3f')][_0xaa8e('0x4a')]()[_0xaa8e('0x24')](respondWithResult(_0xd18c9d,null))[_0xaa8e('0x43')](handleError(_0xd18c9d,null));};
\ No newline at end of file
+var _0x8ff9=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','then','includeAll','include','findAll','show','params','length','options','find','create','body','catch','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','end','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x55f4b5,_0x99af){_0x55f4b5=_0x55f4b5-0x0;var _0x268bab=_0x8ff9[_0x55f4b5];return _0x268bab;};'use strict';var emlformat=require(_0x98ff('0x0'));var rimraf=require(_0x98ff('0x1'));var zipdir=require(_0x98ff('0x2'));var jsonpatch=require(_0x98ff('0x3'));var rp=require(_0x98ff('0x4'));var moment=require(_0x98ff('0x5'));var BPromise=require(_0x98ff('0x6'));var Mustache=require(_0x98ff('0x7'));var util=require(_0x98ff('0x8'));var path=require(_0x98ff('0x9'));var sox=require(_0x98ff('0xa'));var csv=require('to-csv');var ejs=require(_0x98ff('0xb'));var fs=require('fs');var fs_extra=require(_0x98ff('0xc'));var _=require(_0x98ff('0xd'));var squel=require(_0x98ff('0xe'));var crypto=require(_0x98ff('0xf'));var jsforce=require(_0x98ff('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x98ff('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x98ff('0x12'));var authService=require(_0x98ff('0x13'));var qs=require(_0x98ff('0x14'));var as=require(_0x98ff('0x15'));var hardwareService=require(_0x98ff('0x16'));var logger=require('../../config/logger')(_0x98ff('0x17'));var utils=require('../../config/utils');var config=require(_0x98ff('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc547f8,_0x1529cf){_0x1529cf=_0x1529cf||0xcc;return function(_0x24a64e){if(_0x24a64e){return _0xc547f8['sendStatus'](_0x1529cf);}return _0xc547f8[_0x98ff('0x19')](_0x1529cf)['end']();};}function respondWithResult(_0x7af35,_0x373e14){_0x373e14=_0x373e14||0xc8;return function(_0x2c4e4d){if(_0x2c4e4d){return _0x7af35[_0x98ff('0x19')](_0x373e14)[_0x98ff('0x1a')](_0x2c4e4d);}};}function respondWithFilteredResult(_0x2ebc89,_0x4c319c){return function(_0x3573a4){if(_0x3573a4){var _0x196f27=typeof _0x4c319c[_0x98ff('0x1b')]===_0x98ff('0x1c')&&typeof _0x4c319c[_0x98ff('0x1d')]===_0x98ff('0x1c');var _0x1f3044=_0x3573a4[_0x98ff('0x1e')];var _0x268121=_0x196f27?0x0:_0x4c319c[_0x98ff('0x1b')];var _0x91e31c=_0x196f27?_0x3573a4[_0x98ff('0x1e')]:_0x4c319c[_0x98ff('0x1b')]+_0x4c319c[_0x98ff('0x1d')];var _0x4c235b;if(_0x91e31c>=_0x1f3044){_0x91e31c=_0x1f3044;_0x4c235b=0xc8;}else{_0x4c235b=0xce;}_0x2ebc89[_0x98ff('0x19')](_0x4c235b);return _0x2ebc89[_0x98ff('0x1f')](_0x98ff('0x20'),_0x268121+'-'+_0x91e31c+'/'+_0x1f3044)[_0x98ff('0x1a')](_0x3573a4);}return null;};}function patchUpdates(_0x41b840){return function(_0x26e589){try{jsonpatch[_0x98ff('0x21')](_0x26e589,_0x41b840,!![]);}catch(_0x3a6c52){return BPromise[_0x98ff('0x22')](_0x3a6c52);}return _0x26e589[_0x98ff('0x23')]();};}function saveUpdates(_0xf0f062,_0x2b21be){return function(_0x2fdbc2){if(_0x2fdbc2){return _0x2fdbc2['update'](_0xf0f062)['then'](function(_0x4c6ddc){return _0x4c6ddc;});}return null;};}function removeEntity(_0x27a070,_0x3ee01b){return function(_0x547fab){if(_0x547fab){return _0x547fab[_0x98ff('0x24')]()['then'](function(){_0x27a070[_0x98ff('0x19')](0xcc)[_0x98ff('0x25')]();});}};}function handleEntityNotFound(_0x308efd,_0x2b3ee9){return function(_0x4003de){if(!_0x4003de){_0x308efd['sendStatus'](0x194);}return _0x4003de;};}function handleError(_0x577ca7,_0xf53ff7){_0xf53ff7=_0xf53ff7||0x1f4;return function(_0x1a4ebd){logger[_0x98ff('0x26')](_0x1a4ebd[_0x98ff('0x27')]);if(_0x1a4ebd[_0x98ff('0x28')]){delete _0x1a4ebd[_0x98ff('0x28')];}_0x577ca7[_0x98ff('0x19')](_0xf53ff7)[_0x98ff('0x29')](_0x1a4ebd);};}exports[_0x98ff('0x2a')]=function(_0x25a658,_0x4b6e9c){var _0x43e12c={},_0x256823={},_0x19df47={'count':0x0,'rows':[]};var _0x45d045=_[_0x98ff('0x2b')](db[_0x98ff('0x2c')][_0x98ff('0x2d')],function(_0x41c093){return{'name':_0x41c093[_0x98ff('0x2e')],'type':_0x41c093[_0x98ff('0x2f')][_0x98ff('0x30')]};});_0x256823[_0x98ff('0x31')]=_[_0x98ff('0x2b')](_0x45d045,_0x98ff('0x28'));_0x256823[_0x98ff('0x32')]=_[_0x98ff('0x33')](_0x25a658[_0x98ff('0x32')]);_0x256823[_0x98ff('0x34')]=_[_0x98ff('0x35')](_0x256823[_0x98ff('0x31')],_0x256823[_0x98ff('0x32')]);_0x43e12c['attributes']=_[_0x98ff('0x35')](_0x256823[_0x98ff('0x31')],qs[_0x98ff('0x36')](_0x25a658[_0x98ff('0x32')][_0x98ff('0x36')]));_0x43e12c['attributes']=_0x43e12c[_0x98ff('0x37')]['length']?_0x43e12c[_0x98ff('0x37')]:_0x256823[_0x98ff('0x31')];if(!_0x25a658[_0x98ff('0x32')][_0x98ff('0x38')](_0x98ff('0x39'))){_0x43e12c[_0x98ff('0x1d')]=qs[_0x98ff('0x1d')](_0x25a658[_0x98ff('0x32')][_0x98ff('0x1d')]);_0x43e12c[_0x98ff('0x1b')]=qs['offset'](_0x25a658[_0x98ff('0x32')][_0x98ff('0x1b')]);}_0x43e12c[_0x98ff('0x3a')]=qs[_0x98ff('0x3b')](_0x25a658[_0x98ff('0x32')][_0x98ff('0x3b')]);_0x43e12c[_0x98ff('0x3c')]=qs[_0x98ff('0x34')](_['pick'](_0x25a658[_0x98ff('0x32')],_0x256823['filters']),_0x45d045);if(_0x25a658[_0x98ff('0x32')][_0x98ff('0x3d')]){_0x43e12c[_0x98ff('0x3c')]=_[_0x98ff('0x3e')](_0x43e12c[_0x98ff('0x3c')],{'$or':_['map'](_0x45d045,function(_0x543762){if(_0x543762[_0x98ff('0x2f')]!==_0x98ff('0x3f')){var _0x1f08c7={};_0x1f08c7[_0x543762[_0x98ff('0x28')]]={'$like':'%'+_0x25a658[_0x98ff('0x32')][_0x98ff('0x3d')]+'%'};return _0x1f08c7;}})});}_0x43e12c=_[_0x98ff('0x3e')]({},_0x43e12c,_0x25a658['options']);var _0x263e85={'where':_0x43e12c[_0x98ff('0x3c')]};return db[_0x98ff('0x2c')][_0x98ff('0x1e')](_0x263e85)[_0x98ff('0x40')](function(_0x676d0b){_0x19df47[_0x98ff('0x1e')]=_0x676d0b;if(_0x25a658['query'][_0x98ff('0x41')]){_0x43e12c[_0x98ff('0x42')]=[{'all':!![]}];}return db[_0x98ff('0x2c')][_0x98ff('0x43')](_0x43e12c);})[_0x98ff('0x40')](function(_0x5d8c45){_0x19df47['rows']=_0x5d8c45;return _0x19df47;})[_0x98ff('0x40')](respondWithFilteredResult(_0x4b6e9c,_0x43e12c))['catch'](handleError(_0x4b6e9c,null));};exports[_0x98ff('0x44')]=function(_0x3914e6,_0x3fe271){var _0x11d4e7={'raw':!![],'where':{'id':_0x3914e6[_0x98ff('0x45')]['id']}},_0x4208f5={};_0x4208f5['model']=_['keys'](db[_0x98ff('0x2c')]['rawAttributes']);_0x4208f5[_0x98ff('0x32')]=_[_0x98ff('0x33')](_0x3914e6[_0x98ff('0x32')]);_0x4208f5[_0x98ff('0x34')]=_[_0x98ff('0x35')](_0x4208f5[_0x98ff('0x31')],_0x4208f5['query']);_0x11d4e7[_0x98ff('0x37')]=_[_0x98ff('0x35')](_0x4208f5[_0x98ff('0x31')],qs['fields'](_0x3914e6[_0x98ff('0x32')][_0x98ff('0x36')]));_0x11d4e7[_0x98ff('0x37')]=_0x11d4e7[_0x98ff('0x37')][_0x98ff('0x46')]?_0x11d4e7[_0x98ff('0x37')]:_0x4208f5[_0x98ff('0x31')];if(_0x3914e6[_0x98ff('0x32')][_0x98ff('0x41')]){_0x11d4e7[_0x98ff('0x42')]=[{'all':!![]}];}_0x11d4e7=_[_0x98ff('0x3e')]({},_0x11d4e7,_0x3914e6[_0x98ff('0x47')]);return db[_0x98ff('0x2c')][_0x98ff('0x48')](_0x11d4e7)[_0x98ff('0x40')](handleEntityNotFound(_0x3fe271,null))[_0x98ff('0x40')](respondWithResult(_0x3fe271,null))['catch'](handleError(_0x3fe271,null));};exports['create']=function(_0x30aa8b,_0x4c2b0e){return db[_0x98ff('0x2c')][_0x98ff('0x49')](_0x30aa8b[_0x98ff('0x4a')],{})[_0x98ff('0x40')](respondWithResult(_0x4c2b0e,0xc9))[_0x98ff('0x4b')](handleError(_0x4c2b0e,null));};exports[_0x98ff('0x4c')]=function(_0x4596f5,_0x3eb900){if(_0x4596f5[_0x98ff('0x4a')]['id']){delete _0x4596f5['body']['id'];}return db[_0x98ff('0x2c')]['find']({'where':{'id':_0x4596f5[_0x98ff('0x45')]['id']}})[_0x98ff('0x40')](handleEntityNotFound(_0x3eb900,null))['then'](saveUpdates(_0x4596f5[_0x98ff('0x4a')],null))[_0x98ff('0x40')](respondWithResult(_0x3eb900,null))['catch'](handleError(_0x3eb900,null));};exports[_0x98ff('0x24')]=function(_0xe7c8e4,_0x4dd9f5){return db[_0x98ff('0x2c')][_0x98ff('0x48')]({'where':{'id':_0xe7c8e4[_0x98ff('0x45')]['id']}})[_0x98ff('0x40')](handleEntityNotFound(_0x4dd9f5,null))[_0x98ff('0x40')](removeEntity(_0x4dd9f5,null))[_0x98ff('0x4b')](handleError(_0x4dd9f5,null));};exports['describe']=function(_0x42f8b7,_0x41d3ad){return db[_0x98ff('0x2c')][_0x98ff('0x4d')]()[_0x98ff('0x40')](respondWithResult(_0x41d3ad,null))[_0x98ff('0x4b')](handleError(_0x41d3ad,null));};
\ No newline at end of file
index 513578f..0aa2423 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1cf=['report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xd1cf,0x18a));var _0xfd1c=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0xd1cf[_0x2eb3db];return _0x358f33;};'use strict';var _=require(_0xfd1c('0x0'));var util=require('util');var logger=require(_0xfd1c('0x1'))(_0xfd1c('0x2'));var moment=require(_0xfd1c('0x3'));var BPromise=require(_0xfd1c('0x4'));var rp=require(_0xfd1c('0x5'));var fs=require('fs');var path=require(_0xfd1c('0x6'));var rimraf=require(_0xfd1c('0x7'));var config=require(_0xfd1c('0x8'));var attributes=require('./whatsappTransferReport.attributes');module[_0xfd1c('0x9')]=function(_0x39e6d3,_0x49977d){return _0x39e6d3[_0xfd1c('0xa')](_0xfd1c('0xb'),attributes,{'tableName':_0xfd1c('0xc'),'paranoid':![],'indexes':[{'name':_0xfd1c('0xd'),'fields':[_0xfd1c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e6d=['report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport'];(function(_0x4eb517,_0x385479){var _0x30e9ed=function(_0x1825ef){while(--_0x1825ef){_0x4eb517['push'](_0x4eb517['shift']());}};_0x30e9ed(++_0x385479);}(_0x6e6d,0xce));var _0xd6e6=function(_0x41cb3d,_0x485153){_0x41cb3d=_0x41cb3d-0x0;var _0x78bf6f=_0x6e6d[_0x41cb3d];return _0x78bf6f;};'use strict';var _=require(_0xd6e6('0x0'));var util=require(_0xd6e6('0x1'));var logger=require(_0xd6e6('0x2'))('api');var moment=require(_0xd6e6('0x3'));var BPromise=require(_0xd6e6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd6e6('0x5'));var attributes=require(_0xd6e6('0x6'));module[_0xd6e6('0x7')]=function(_0x508764,_0x368818){return _0x508764[_0xd6e6('0x8')](_0xd6e6('0x9'),attributes,{'tableName':_0xd6e6('0xa'),'paranoid':![],'indexes':[{'name':_0xd6e6('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 02f7a8b..4367cdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91ec=['code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c415e,_0x52c4f4){var _0x3afd60=function(_0x22e3b7){while(--_0x22e3b7){_0x4c415e['push'](_0x4c415e['shift']());}};_0x3afd60(++_0x52c4f4);}(_0x91ec,0xf6));var _0xc91e=function(_0x283fed,_0x5b21dd){_0x283fed=_0x283fed-0x0;var _0x257eb5=_0x91ec[_0x283fed];return _0x257eb5;};'use strict';var _=require(_0xc91e('0x0'));var util=require(_0xc91e('0x1'));var moment=require('moment');var BPromise=require(_0xc91e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc91e('0x3'))['db'];var utils=require(_0xc91e('0x4'));var logger=require(_0xc91e('0x5'))(_0xc91e('0x6'));var config=require(_0xc91e('0x7'));var jayson=require(_0xc91e('0x8'));var client=jayson['client'][_0xc91e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15cd01,_0x397478,_0x1a7f70){return new BPromise(function(_0x17cdff,_0xbc21b3){return client[_0xc91e('0xa')](_0x15cd01,_0x1a7f70)['then'](function(_0x505dc2){logger[_0xc91e('0xb')](_0xc91e('0xc'),_0x397478,_0xc91e('0xd'));logger[_0xc91e('0xe')](_0xc91e('0xf'),_0x397478,_0xc91e('0xd'),JSON[_0xc91e('0x10')](_0x505dc2));if(_0x505dc2['error']){if(_0x505dc2[_0xc91e('0x11')][_0xc91e('0x12')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x397478,_0x505dc2[_0xc91e('0x11')][_0xc91e('0x13')]);return _0xbc21b3(_0x505dc2[_0xc91e('0x11')][_0xc91e('0x13')]);}logger[_0xc91e('0x11')](_0xc91e('0xc'),_0x397478,_0x505dc2['error'][_0xc91e('0x13')]);return _0x17cdff(_0x505dc2[_0xc91e('0x11')]['message']);}else{logger[_0xc91e('0xb')](_0xc91e('0xc'),_0x397478,_0xc91e('0xd'));_0x17cdff(_0x505dc2[_0xc91e('0x14')][_0xc91e('0x13')]);}})[_0xc91e('0x15')](function(_0x24bd1d){logger[_0xc91e('0x11')](_0xc91e('0xc'),_0x397478,_0x24bd1d);_0xbc21b3(_0x24bd1d);});});}
\ No newline at end of file
+var _0x55eb=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4b48e5,_0xc3c425){var _0x210b17=function(_0x43ccc1){while(--_0x43ccc1){_0x4b48e5['push'](_0x4b48e5['shift']());}};_0x210b17(++_0xc3c425);}(_0x55eb,0x73));var _0xb55e=function(_0x548c67,_0x1549a5){_0x548c67=_0x548c67-0x0;var _0x35fdad=_0x55eb[_0x548c67];return _0x35fdad;};'use strict';var _=require(_0xb55e('0x0'));var util=require(_0xb55e('0x1'));var moment=require(_0xb55e('0x2'));var BPromise=require(_0xb55e('0x3'));var rs=require(_0xb55e('0x4'));var fs=require('fs');var Redis=require(_0xb55e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb55e('0x6'));var logger=require(_0xb55e('0x7'))('rpc');var config=require(_0xb55e('0x8'));var jayson=require(_0xb55e('0x9'));var client=jayson[_0xb55e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4615ee,_0x198cbe,_0x16d3eb){return new BPromise(function(_0x304001,_0x476c0f){return client['request'](_0x4615ee,_0x16d3eb)[_0xb55e('0xb')](function(_0x2b30f4){logger[_0xb55e('0xc')](_0xb55e('0xd'),_0x198cbe,_0xb55e('0xe'));logger[_0xb55e('0xf')](_0xb55e('0x10'),_0x198cbe,'request\x20sent',JSON[_0xb55e('0x11')](_0x2b30f4));if(_0x2b30f4[_0xb55e('0x12')]){if(_0x2b30f4[_0xb55e('0x12')][_0xb55e('0x13')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x198cbe,_0x2b30f4[_0xb55e('0x12')][_0xb55e('0x14')]);return _0x476c0f(_0x2b30f4[_0xb55e('0x12')][_0xb55e('0x14')]);}logger[_0xb55e('0x12')](_0xb55e('0xd'),_0x198cbe,_0x2b30f4[_0xb55e('0x12')][_0xb55e('0x14')]);return _0x304001(_0x2b30f4[_0xb55e('0x12')][_0xb55e('0x14')]);}else{logger[_0xb55e('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x198cbe,'request\x20sent');_0x304001(_0x2b30f4[_0xb55e('0x15')]['message']);}})['catch'](function(_0x1f3717){logger[_0xb55e('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x198cbe,_0x1f3717);_0x476c0f(_0x1f3717);});});}
\ No newline at end of file
index 53f658a..379e69b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb3b=['lodash','./mysqldb','./rpc','./config/environment','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','then','start','Online\x20apps:','filter','online','join','Offline\x20apps:','map','name','None','seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s'];(function(_0xc28702,_0x145b87){var _0x3b6e9e=function(_0xfac0c1){while(--_0xfac0c1){_0xc28702['push'](_0xc28702['shift']());}};_0x3b6e9e(++_0x145b87);}(_0xfb3b,0x10e));var _0xbfb3=function(_0x2c60de,_0x116e97){_0x2c60de=_0x2c60de-0x0;var _0x11a034=_0xfb3b[_0x2c60de];return _0x11a034;};'use strict';var _=require(_0xbfb3('0x0'));var mysqldb=require(_0xbfb3('0x1'));var rpc=require(_0xbfb3('0x2'));var config=require(_0xbfb3('0x3'));var logger=require('./config/logger')('app');var pm2=require(_0xbfb3('0x4'));var pm2Config=require(_0xbfb3('0x5'));var schedule=require(_0xbfb3('0x6'));var chat=require(_0xbfb3('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xbfb3('0x8'));function main(){return mysqldb['db'][_0xbfb3('0x9')][_0xbfb3('0xa')]()[_0xbfb3('0xb')](function(){return rpc['listen']();})[_0xbfb3('0xb')](function(_0x34c3b2){logger['info'](_0x34c3b2);return chat[_0xbfb3('0xc')]();})[_0xbfb3('0xb')](function(){return whatsapp[_0xbfb3('0xc')]();})[_0xbfb3('0xb')](function(){return schedule[_0xbfb3('0xc')]();})[_0xbfb3('0xb')](function(){return transcribe[_0xbfb3('0xc')]();})['then'](function(_0x4c348d){logger['info'](_0x4c348d);return pm2[_0xbfb3('0xc')](pm2Config);})[_0xbfb3('0xb')](function(_0x24e313){logger['info'](_0xbfb3('0xd'),_['map'](_[_0xbfb3('0xe')](_0x24e313,{'status':_0xbfb3('0xf')}),'name')[_0xbfb3('0x10')]());logger['info'](_0xbfb3('0x11'),_[_0xbfb3('0x12')](_[_0xbfb3('0xe')](_0x24e313,function(_0x801b0d){return _0x801b0d['status']!==_0xbfb3('0xf');}),_0xbfb3('0x13'))[_0xbfb3('0x10')]()||_0xbfb3('0x14'));config[_0xbfb3('0x15')]&&require('./config/seedDB')[_0xbfb3('0x16')]();require(_0xbfb3('0x17'))[_0xbfb3('0x16')]();})[_0xbfb3('0x18')](function(_0x24348a){logger[_0xbfb3('0x19')](_0xbfb3('0x1a'),_0x24348a);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0xffc2=['seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','filter','online','name','join','Offline\x20apps:','map','None'];(function(_0x5c7e53,_0x174ce5){var _0x1c9af9=function(_0x38895d){while(--_0x38895d){_0x5c7e53['push'](_0x5c7e53['shift']());}};_0x1c9af9(++_0x174ce5);}(_0xffc2,0x11e));var _0x2ffc=function(_0x38dcff,_0x5f249d){_0x38dcff=_0x38dcff-0x0;var _0x6cb881=_0xffc2[_0x38dcff];return _0x6cb881;};'use strict';var _=require('lodash');var mysqldb=require(_0x2ffc('0x0'));var rpc=require('./rpc');var config=require(_0x2ffc('0x1'));var logger=require(_0x2ffc('0x2'))('app');var pm2=require(_0x2ffc('0x3'));var pm2Config=require(_0x2ffc('0x4'));var schedule=require(_0x2ffc('0x5'));var chat=require(_0x2ffc('0x6'));var whatsapp=require(_0x2ffc('0x7'));var transcribe=require(_0x2ffc('0x8'));function main(){return mysqldb['db'][_0x2ffc('0x9')][_0x2ffc('0xa')]()[_0x2ffc('0xb')](function(){return rpc[_0x2ffc('0xc')]();})[_0x2ffc('0xb')](function(_0x494ed5){logger[_0x2ffc('0xd')](_0x494ed5);return chat[_0x2ffc('0xe')]();})[_0x2ffc('0xb')](function(){return whatsapp[_0x2ffc('0xe')]();})[_0x2ffc('0xb')](function(){return schedule['start']();})[_0x2ffc('0xb')](function(){return transcribe[_0x2ffc('0xe')]();})[_0x2ffc('0xb')](function(_0x4e803c){logger['info'](_0x4e803c);return pm2[_0x2ffc('0xe')](pm2Config);})[_0x2ffc('0xb')](function(_0x1d3a83){logger[_0x2ffc('0xd')]('Online\x20apps:',_['map'](_[_0x2ffc('0xf')](_0x1d3a83,{'status':_0x2ffc('0x10')}),_0x2ffc('0x11'))[_0x2ffc('0x12')]());logger[_0x2ffc('0xd')](_0x2ffc('0x13'),_[_0x2ffc('0x14')](_[_0x2ffc('0xf')](_0x1d3a83,function(_0x1ca7c8){return _0x1ca7c8['status']!=='online';}),_0x2ffc('0x11'))[_0x2ffc('0x12')]()||_0x2ffc('0x15'));config[_0x2ffc('0x16')]&&require('./config/seedDB')[_0x2ffc('0x17')]();require('./config/license')[_0x2ffc('0x17')]();})[_0x2ffc('0x18')](function(_0x45554c){logger[_0x2ffc('0x19')](_0x2ffc('0x1a'),_0x45554c);process[_0x2ffc('0x1b')](0x1);});}main();
\ No newline at end of file
index 499d435..f43d059 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x307d=['Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','unshift','encryptString','join','promisify','sign','payload','options','verify','secrets','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','session','role','name','internal','email','userpic','permissions','md5secret','voicePause','mailPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadOmnichannelInteractions','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','then','unmanaged','json','disposition','Unmanaged.','Forbidden.','catch','authorization','Basic','User','find','authenticate','pass','status','Wrong\x20credentials.','startsWith','Bearer'];(function(_0x1a31e8,_0x5387bc){var _0x3adc72=function(_0x1997a3){while(--_0x1997a3){_0x1a31e8['push'](_0x1a31e8['shift']());}};_0x3adc72(++_0x5387bc);}(_0x307d,0xb8));var _0xd307=function(_0x45e4bd,_0x5cb57d){_0x45e4bd=_0x45e4bd-0x0;var _0x51a666=_0x307d[_0x45e4bd];return _0x51a666;};'use strict';var db=require(_0xd307('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xd307('0x1'));var licenseUtil=require(_0xd307('0x2'));var encryptor=require(_0xd307('0x3'));var _=require(_0xd307('0x4'));var jwt=require(_0xd307('0x5'));var expressJwt=require('express-jwt');var compose=require(_0xd307('0x6'));var basicAuth=require(_0xd307('0x7'));var crypto=require(_0xd307('0x8'));var BPromise=require(_0xd307('0x9'));var util=require(_0xd307('0xa'));var moment=require(_0xd307('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0xd307('0xc')]});var userAttributes=['id',_0xd307('0xd'),'fullname',_0xd307('0xe'),_0xd307('0xf'),_0xd307('0x10'),_0xd307('0x11'),_0xd307('0x12'),_0xd307('0x13'),_0xd307('0x14'),'chatPause',_0xd307('0x15'),'faxPause','smsPause',_0xd307('0x16'),_0xd307('0x17'),_0xd307('0x18'),'lastLoginAt',_0xd307('0x19'),_0xd307('0x1a'),_0xd307('0x1b'),_0xd307('0x1c'),'alias',_0xd307('0x1d'),_0xd307('0x1e'),_0xd307('0x1f'),'phoneBarEnableRecording',_0xd307('0x20'),'phoneBarEnableSettings',_0xd307('0x21'),_0xd307('0x22'),_0xd307('0x23'),'phoneBarRemoteControlPort',_0xd307('0x24'),_0xd307('0x25'),_0xd307('0x26'),_0xd307('0x27'),'settingsEnabled',_0xd307('0x28'),'downloadVoiceRecordings',_0xd307('0x29'),'downloadAttachments'];exports['isChatInteractionAuthorized']=function(){return this[_0xd307('0x2a')](!![])[_0xd307('0x2b')](function(_0x507e52,_0x1a6d82,_0x550a4c){if(_0x507e52[_0xd307('0x2c')]){_0x550a4c();}else{return db[_0xd307('0x2d')][_0xd307('0x2e')]({'where':{'id':_0x507e52[_0xd307('0x2f')]['id']},'attributes':['id',_0xd307('0x30'),'disposition'],'raw':!![]})[_0xd307('0x31')](function(_0x5534a3){if(_0x5534a3&&_0x5534a3['closed']){return _0x1a6d82['status'](_0x5534a3['disposition']===_0xd307('0x32')?0x195:0x193)[_0xd307('0x33')]({'message':_0x5534a3[_0xd307('0x34')]===_0xd307('0x32')?_0xd307('0x35'):_0xd307('0x36')});}else{_0x550a4c();}})[_0xd307('0x37')](function(_0x18b075){_0x550a4c(_0x18b075);});}});};exports[_0xd307('0x2a')]=function isAuthenticated(_0xac3bf9){return compose()['use'](function(_0x3eab86,_0x24a6c8,_0x18161d){var _0x31e3af;if(_0x3eab86['headers'][_0xd307('0x38')]){if(_['startsWith'](_0x3eab86['headers'][_0xd307('0x38')],_0xd307('0x39'))){var _0x111ae9=basicAuth(_0x3eab86);db[_0xd307('0x3a')][_0xd307('0x3b')]({'where':{'name':_0x111ae9['name']}})[_0xd307('0x31')](function(_0x18c1cc){if(!_0x18c1cc||!_0x18c1cc[_0xd307('0x3c')](_0x111ae9[_0xd307('0x3d')])){return _0x24a6c8[_0xd307('0x3e')](0x191)[_0xd307('0x33')]({'message':_0xd307('0x3f')});}_0x3eab86['user']={'id':_0x18c1cc['id']};_0x18161d();})[_0xd307('0x37')](function(_0x55cb8d){_0x18161d(_0x55cb8d);});}else if(_[_0xd307('0x40')](_0x3eab86['headers'][_0xd307('0x38')],_0xd307('0x41'))){validateJwt(_0x3eab86,_0x24a6c8,_0x18161d);}else{if(_0xac3bf9){_0x18161d();}else{return _0x24a6c8['status'](0x193)[_0xd307('0x33')]({'message':_0xd307('0x42')});}}}else if(_0x3eab86[_0xd307('0x43')][_0xd307('0x44')]){try{var _0x5ee918={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xd307('0x45')]()};verifyJwt(_0x3eab86['query'][_0xd307('0x44')],_0x5ee918)['then'](function(_0x39a096){return db[_0xd307('0x3a')][_0xd307('0x3b')]({'where':{'id':_0x39a096[_0xd307('0x46')]}})[_0xd307('0x31')](function(_0x127232){_0x31e3af=_0x127232;return db[_0xd307('0x47')][_0xd307('0x2e')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd307('0x48')],'raw':!![]});})[_0xd307('0x31')](function(_0xe53e06){if(!_0x31e3af||!_[_0xd307('0x49')](_0x31e3af['apiKeyNonce'],_0x39a096[_0xd307('0x4a')])){return _0x24a6c8[_0xd307('0x3e')](0x191)[_0xd307('0x33')]({'message':_0xd307('0x4b')});}if(_0x31e3af[_0xd307('0x4c')]){return _0x24a6c8['status'](0x191)[_0xd307('0x33')]({'message':_0xd307('0x4d')});}if(_0x31e3af['blocked']){if(_0xe53e06[_0xd307('0x48')]>0x0){if(moment(_0x31e3af[_0xd307('0x4e')])[_0xd307('0x4f')](_0xe53e06['blockDuration'],'minutes')>moment()){return _0x24a6c8[_0xd307('0x3e')](0x191)[_0xd307('0x33')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x24a6c8[_0xd307('0x3e')](0x191)[_0xd307('0x33')]({'message':_0xd307('0x4d')});}}_0x3eab86[_0xd307('0x2c')]={'id':_0x31e3af['id']};_0x18161d();});})[_0xd307('0x37')](function(){return _0x24a6c8['status'](0x191)[_0xd307('0x33')]({'message':_0xd307('0x4d')});});}catch(_0x442e56){_0x18161d(_0x442e56);}}else if(_0xac3bf9){_0x18161d();}else{return _0x24a6c8[_0xd307('0x3e')](0x193)[_0xd307('0x33')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0x7605d8,_0x5175e8,_0x2af1e6){if(_0x7605d8[_0xd307('0x2c')]){db[_0xd307('0x3a')][_0xd307('0x3b')]({'where':{'id':_0x7605d8[_0xd307('0x2c')]['id']},'attributes':userAttributes})['then'](function(_0x38c7ed){if(!_0x38c7ed){return _0x5175e8[_0xd307('0x3e')](0x194)[_0xd307('0x33')]({'message':'User\x20not\x20found.'});}_0x7605d8[_0xd307('0x2c')]=_0x38c7ed;_0x2af1e6();})[_0xd307('0x37')](function(_0x9d936d){_0x2af1e6(_0x9d936d);});}else if(_0xac3bf9){_0x2af1e6();}else{return _0x5175e8['status'](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xd307('0x50')]=function canUpdate(){return compose()['use'](function(_0xc277d8,_0x39409f,_0x46a8bd){return licenseUtil[_0xd307('0x51')]()[_0xd307('0x31')](function(_0x123fca){if(_0x123fca[_0xd307('0x52')]){_0x46a8bd();}else{return _0x39409f['status'](0x193)['json']({'message':_0xd307('0x53')});}})['catch'](function(_0x446a82){_0x46a8bd(_0x446a82);});});};exports[_0xd307('0x54')]=function(_0x17b579,_0x45e401,_0x1a998c){_0x17b579['isMiddleware']=!![];return _0x1a998c();};exports[_0xd307('0x55')]=function signToken(_0x222e13){return signJwt(_0x222e13);};exports[_0xd307('0x56')]=function(_0x4f07da,_0x2b7fea){if(!_0x4f07da[_0xd307('0x2c')]){return _0x2b7fea[_0xd307('0x3e')](0x194)['json']({'message':_0xd307('0x57')});}var _0x4159b6={'payload':{'id':_0x4f07da['user']['id'],'role':_0x4f07da[_0xd307('0x2c')][_0xd307('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4159b6)[_0xd307('0x31')](function(_0x4af7aa){_0x2b7fea[_0xd307('0x58')](_0xd307('0x59'),_0x4af7aa);_0x2b7fea[_0xd307('0x5a')](_0xd307('0x5b'));})[_0xd307('0x37')](function(_0x3d482d){return _0x2b7fea[_0xd307('0x3e')](0x1f4)[_0xd307('0x5c')](_0x3d482d);});};exports[_0xd307('0x5d')]=function(_0x74ec06){if(_['isNil'](_0x74ec06[_0xd307('0x5e')])||_[_0xd307('0x5f')](_0x74ec06[_0xd307('0x60')])){return null;}else{return createJwt(_0x74ec06);}};exports[_0xd307('0x61')]=function(_0x1cde5e){_0x1cde5e['apiKeyNonce']=generateNonce();_0x1cde5e['apiKeyIat']=generateIssuedAt();return createJwt(_0x1cde5e);};exports[_0xd307('0x62')]=function(_0x33b4ee,_0x473030){var _0x252eef=_0x33b4ee[_0xd307('0x43')]['apikey'];if(_0x252eef){var _0x2a1c88={'nonce':_0x473030['apiKeyNonce'],'iat':_0x473030[_0xd307('0x60')],'audience':hardwareConf[_0xd307('0x45')](),'issuer':hardwareConf[_0xd307('0x45')]()};return verifyJwt(_0x252eef,_0x2a1c88)[_0xd307('0x31')](function(){return generateApiKey(_0x473030);});}else{throw{'message':_0xd307('0x63')};}};exports['validatePasswordPattern']=function(_0x2ee541){var _0x3f6791=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3f6791[_0xd307('0x64')](_0x2ee541))throw new db[(_0xd307('0x65'))][(_0xd307('0x66'))](_0xd307('0x67'));return;};exports['validatePasswordHistory']=function(_0x50ab53,_0x1c6a58,_0x5aa85c){var _0x556b0d=encryptor[_0xd307('0x68')](_0x1c6a58)[_0xd307('0x69')](',');for(var _0x253ad8=0x0;_0x253ad8<_0x5aa85c;_0x253ad8++){if(!_0x556b0d[_0x253ad8])break;if(_0x50ab53['toLowerCase']()===_0x556b0d[_0x253ad8]['toLowerCase']()){var _0x5d1cbf=util['format'](_0xd307('0x6a'),_0x5aa85c);if(_0x5aa85c===0x1){_0x5d1cbf=_0xd307('0x6b');}throw new db[(_0xd307('0x65'))][(_0xd307('0x66'))](_0x5d1cbf);}}return;};exports[_0xd307('0x6c')]=function(_0x2d4693,_0x3393ff){var _0x53253e=_0x3393ff?encryptor[_0xd307('0x68')](_0x3393ff)['split'](','):[];if(_0x53253e['length']===0x5){_0x53253e[_0xd307('0x6d')](-0x1,0x1);}_0x53253e[_0xd307('0x6e')](_0x2d4693);return encryptor[_0xd307('0x6f')](_0x53253e[_0xd307('0x70')](','));};function signJwt(_0x5f4d05){var _0x5e3f8a=BPromise[_0xd307('0x71')](jwt[_0xd307('0x72')],{'context':jwt});var _0x27c54f=_0x5f4d05['secret']||config['secrets']['session'];return new BPromise(function(_0x28391b,_0x5da54e){_0x5e3f8a(_0x5f4d05[_0xd307('0x73')],_0x27c54f,_0x5f4d05[_0xd307('0x74')])[_0xd307('0x31')](function(_0x440d5a){_0x28391b(_0x440d5a);})[_0xd307('0x37')](function(_0x5a2358){_0x5da54e(_0x5a2358);});});}function verifyJwt(_0x11b488,_0x5f0bfb,_0x4d3e92){var _0x16e71e=BPromise[_0xd307('0x71')](jwt[_0xd307('0x75')],{'context':jwt});var _0x16efc4=_0x4d3e92||config[_0xd307('0x76')]['session'];return new BPromise(function(_0x26227e,_0x14db88){_0x16e71e(_0x11b488,_0x16efc4,_0x5f0bfb)[_0xd307('0x31')](function(_0x25569f){_0x26227e(_0x25569f);})[_0xd307('0x37')](function(_0x5d8466){_0x14db88(_0x5d8466);});});}function generateNonce(){return crypto[_0xd307('0x77')](0x10)[_0xd307('0x78')](_0xd307('0x79'));}function generateIssuedAt(){return Math[_0xd307('0x7a')](Date[_0xd307('0x7b')]()/0x3e8)['toString']();}function createJwt(_0x553256){var _0x296c6d={'payload':{'iat':_0x553256['apiKeyIat'],'nonce':_0x553256[_0xd307('0x5e')]},'options':{'algorithm':_0xd307('0x7c'),'subject':_0x553256['id']['toString'](),'issuer':hardwareConf[_0xd307('0x45')](),'audience':hardwareConf[_0xd307('0x45')]()}};return signJwt(_0x296c6d)[_0xd307('0x31')](function(_0x1b4c0b){return{'iat':_0x553256[_0xd307('0x60')],'nonce':_0x553256[_0xd307('0x5e')],'token':_0x1b4c0b};});}
\ No newline at end of file
+var _0x2660=['toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash','express-jwt','composable-middleware','crypto','bluebird','util','moment','role','fullname','internal','email','userpic','md5secret','chatPause','mailPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','ChatInteraction','disposition','then','closed','unmanaged','json','Unmanaged.','Forbidden.','catch','use','headers','authorization','Basic','User','name','authenticate','pass','status','startsWith','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','find','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','user','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','promisify','sign','secret','secrets','session','payload','options'];(function(_0x121dcc,_0x6e4906){var _0x76bdd6=function(_0x4e96f3){while(--_0x4e96f3){_0x121dcc['push'](_0x121dcc['shift']());}};_0x76bdd6(++_0x6e4906);}(_0x2660,0x187));var _0x0266=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x2660[_0x13187a];return _0x65b85f;};'use strict';var db=require(_0x0266('0x0'))['db'];var config=require(_0x0266('0x1'));var hardwareConf=require(_0x0266('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x0266('0x3'));var _=require(_0x0266('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x0266('0x5'));var compose=require(_0x0266('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x0266('0x7'));var BPromise=require(_0x0266('0x8'));var util=require(_0x0266('0x9'));var moment=require(_0x0266('0xa'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0x0266('0xb'),_0x0266('0xc'),'name',_0x0266('0xd'),_0x0266('0xe'),_0x0266('0xf'),'permissions',_0x0266('0x10'),'voicePause',_0x0266('0x11'),_0x0266('0x12'),'faxPause','smsPause','openchannelPause','pauseType',_0x0266('0x13'),_0x0266('0x14'),_0x0266('0x15'),_0x0266('0x16'),_0x0266('0x17'),_0x0266('0x18'),'alias',_0x0266('0x19'),_0x0266('0x1a'),_0x0266('0x1b'),_0x0266('0x1c'),_0x0266('0x1d'),_0x0266('0x1e'),_0x0266('0x1f'),_0x0266('0x20'),'phoneBarRemoteControl',_0x0266('0x21'),'hotdesk',_0x0266('0x22'),_0x0266('0x23'),_0x0266('0x24'),_0x0266('0x25'),_0x0266('0x26'),'downloadVoiceRecordings',_0x0266('0x27'),'downloadAttachments'];exports[_0x0266('0x28')]=function(){return this[_0x0266('0x29')](!![])['use'](function(_0x585afe,_0x2d7dc9,_0x593aba){if(_0x585afe['user']){_0x593aba();}else{return db[_0x0266('0x2a')]['findOne']({'where':{'id':_0x585afe['params']['id']},'attributes':['id','closed',_0x0266('0x2b')],'raw':!![]})[_0x0266('0x2c')](function(_0x318b48){if(_0x318b48&&_0x318b48[_0x0266('0x2d')]){return _0x2d7dc9['status'](_0x318b48[_0x0266('0x2b')]===_0x0266('0x2e')?0x195:0x193)[_0x0266('0x2f')]({'message':_0x318b48[_0x0266('0x2b')]==='unmanaged'?_0x0266('0x30'):_0x0266('0x31')});}else{_0x593aba();}})[_0x0266('0x32')](function(_0x32387e){_0x593aba(_0x32387e);});}});};exports['isAuthenticated']=function isAuthenticated(_0x313d4a){return compose()[_0x0266('0x33')](function(_0x261469,_0x27988f,_0xcf3e6e){var _0x11bc8c;if(_0x261469[_0x0266('0x34')][_0x0266('0x35')]){if(_['startsWith'](_0x261469[_0x0266('0x34')][_0x0266('0x35')],_0x0266('0x36'))){var _0x5a7335=basicAuth(_0x261469);db[_0x0266('0x37')]['find']({'where':{'name':_0x5a7335[_0x0266('0x38')]}})[_0x0266('0x2c')](function(_0x2f77a6){if(!_0x2f77a6||!_0x2f77a6[_0x0266('0x39')](_0x5a7335[_0x0266('0x3a')])){return _0x27988f[_0x0266('0x3b')](0x191)[_0x0266('0x2f')]({'message':'Wrong\x20credentials.'});}_0x261469['user']={'id':_0x2f77a6['id']};_0xcf3e6e();})[_0x0266('0x32')](function(_0x566b16){_0xcf3e6e(_0x566b16);});}else if(_[_0x0266('0x3c')](_0x261469[_0x0266('0x34')][_0x0266('0x35')],_0x0266('0x3d'))){validateJwt(_0x261469,_0x27988f,_0xcf3e6e);}else{if(_0x313d4a){_0xcf3e6e();}else{return _0x27988f[_0x0266('0x3b')](0x193)[_0x0266('0x2f')]({'message':_0x0266('0x3e')});}}}else if(_0x261469[_0x0266('0x3f')][_0x0266('0x40')]){try{var _0x225428={'audience':hardwareConf[_0x0266('0x41')](),'issuer':hardwareConf[_0x0266('0x41')]()};verifyJwt(_0x261469[_0x0266('0x3f')][_0x0266('0x40')],_0x225428)['then'](function(_0x581822){return db['User'][_0x0266('0x42')]({'where':{'id':_0x581822[_0x0266('0x43')]}})[_0x0266('0x2c')](function(_0x3138ac){_0x11bc8c=_0x3138ac;return db[_0x0266('0x44')][_0x0266('0x45')]({'where':{'id':0x1},'attributes':[_0x0266('0x46'),_0x0266('0x47')],'raw':!![]});})[_0x0266('0x2c')](function(_0x4783b2){if(!_0x11bc8c||!_[_0x0266('0x48')](_0x11bc8c[_0x0266('0x49')],_0x581822[_0x0266('0x4a')])){return _0x27988f[_0x0266('0x3b')](0x191)[_0x0266('0x2f')]({'message':_0x0266('0x4b')});}if(_0x11bc8c[_0x0266('0x4c')]){return _0x27988f[_0x0266('0x3b')](0x191)[_0x0266('0x2f')]({'message':_0x0266('0x4d')});}if(_0x11bc8c[_0x0266('0x4e')]){if(_0x4783b2[_0x0266('0x47')]>0x0){if(moment(_0x11bc8c[_0x0266('0x4f')])[_0x0266('0x50')](_0x4783b2['blockDuration'],_0x0266('0x51'))>moment()){return _0x27988f['status'](0x191)[_0x0266('0x2f')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x27988f[_0x0266('0x3b')](0x191)[_0x0266('0x2f')]({'message':_0x0266('0x4d')});}}_0x261469['user']={'id':_0x11bc8c['id']};_0xcf3e6e();});})[_0x0266('0x32')](function(){return _0x27988f[_0x0266('0x3b')](0x191)[_0x0266('0x2f')]({'message':_0x0266('0x4d')});});}catch(_0x5295e6){_0xcf3e6e(_0x5295e6);}}else if(_0x313d4a){_0xcf3e6e();}else{return _0x27988f['status'](0x193)[_0x0266('0x2f')]({'message':_0x0266('0x3e')});}})[_0x0266('0x33')](function(_0x3b7408,_0x3d060b,_0x1caf7c){if(_0x3b7408[_0x0266('0x52')]){db[_0x0266('0x37')][_0x0266('0x42')]({'where':{'id':_0x3b7408[_0x0266('0x52')]['id']},'attributes':userAttributes})[_0x0266('0x2c')](function(_0x32cd60){if(!_0x32cd60){return _0x3d060b[_0x0266('0x3b')](0x194)[_0x0266('0x2f')]({'message':_0x0266('0x53')});}_0x3b7408[_0x0266('0x52')]=_0x32cd60;_0x1caf7c();})[_0x0266('0x32')](function(_0x1b27b6){_0x1caf7c(_0x1b27b6);});}else if(_0x313d4a){_0x1caf7c();}else{return _0x3d060b[_0x0266('0x3b')](0x194)[_0x0266('0x2f')]({'message':_0x0266('0x54')});}});};exports[_0x0266('0x55')]=function canUpdate(){return compose()[_0x0266('0x33')](function(_0x366dcf,_0x1a1701,_0x359ca1){return licenseUtil[_0x0266('0x56')]()['then'](function(_0x32852f){if(_0x32852f['update']){_0x359ca1();}else{return _0x1a1701['status'](0x193)[_0x0266('0x2f')]({'message':_0x0266('0x57')});}})[_0x0266('0x32')](function(_0x2b4da9){_0x359ca1(_0x2b4da9);});});};exports[_0x0266('0x58')]=function(_0x5a7c0b,_0x3c9ca1,_0x1b7d6f){_0x5a7c0b[_0x0266('0x58')]=!![];return _0x1b7d6f();};exports['signToken']=function signToken(_0x436830){return signJwt(_0x436830);};exports[_0x0266('0x59')]=function(_0x4fb2ab,_0x560172){if(!_0x4fb2ab[_0x0266('0x52')]){return _0x560172[_0x0266('0x3b')](0x194)[_0x0266('0x2f')]({'message':_0x0266('0x5a')});}var _0x1d20b5={'payload':{'id':_0x4fb2ab[_0x0266('0x52')]['id'],'role':_0x4fb2ab[_0x0266('0x52')][_0x0266('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x1d20b5)['then'](function(_0x2a8b28){_0x560172[_0x0266('0x5b')](_0x0266('0x5c'),_0x2a8b28);_0x560172[_0x0266('0x5d')](_0x0266('0x5e'));})[_0x0266('0x32')](function(_0x217c9f){return _0x560172[_0x0266('0x3b')](0x1f4)[_0x0266('0x5f')](_0x217c9f);});};exports[_0x0266('0x60')]=function(_0x1a1ce2){if(_['isNil'](_0x1a1ce2[_0x0266('0x49')])||_[_0x0266('0x61')](_0x1a1ce2[_0x0266('0x62')])){return null;}else{return createJwt(_0x1a1ce2);}};exports[_0x0266('0x63')]=function(_0xdd2d84){_0xdd2d84[_0x0266('0x49')]=generateNonce();_0xdd2d84[_0x0266('0x62')]=generateIssuedAt();return createJwt(_0xdd2d84);};exports[_0x0266('0x64')]=function(_0x3be342,_0xb63539){var _0x3e6e66=_0x3be342['query'][_0x0266('0x40')];if(_0x3e6e66){var _0x5dd59d={'nonce':_0xb63539[_0x0266('0x49')],'iat':_0xb63539[_0x0266('0x62')],'audience':hardwareConf[_0x0266('0x41')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x3e6e66,_0x5dd59d)[_0x0266('0x2c')](function(){return generateApiKey(_0xb63539);});}else{throw{'message':_0x0266('0x65')};}};exports[_0x0266('0x66')]=function(_0x93f19d){var _0x55ad7a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x55ad7a[_0x0266('0x67')](_0x93f19d))throw new db[(_0x0266('0x68'))][(_0x0266('0x69'))](_0x0266('0x6a'));return;};exports[_0x0266('0x6b')]=function(_0x3d32dd,_0x1cfd35,_0x2401e8){var _0x3a567f=encryptor[_0x0266('0x6c')](_0x1cfd35)[_0x0266('0x6d')](',');for(var _0x55072a=0x0;_0x55072a<_0x2401e8;_0x55072a++){if(!_0x3a567f[_0x55072a])break;if(_0x3d32dd[_0x0266('0x6e')]()===_0x3a567f[_0x55072a][_0x0266('0x6e')]()){var _0x416e2b=util[_0x0266('0x6f')](_0x0266('0x70'),_0x2401e8);if(_0x2401e8===0x1){_0x416e2b=_0x0266('0x71');}throw new db[(_0x0266('0x68'))][(_0x0266('0x69'))](_0x416e2b);}}return;};exports[_0x0266('0x72')]=function(_0x56b8c3,_0x43ae48){var _0x3ef97e=_0x43ae48?encryptor[_0x0266('0x6c')](_0x43ae48)['split'](','):[];if(_0x3ef97e[_0x0266('0x73')]===0x5){_0x3ef97e['splice'](-0x1,0x1);}_0x3ef97e[_0x0266('0x74')](_0x56b8c3);return encryptor[_0x0266('0x75')](_0x3ef97e['join'](','));};function signJwt(_0x1937a5){var _0x41198c=BPromise[_0x0266('0x76')](jwt[_0x0266('0x77')],{'context':jwt});var _0x494c90=_0x1937a5[_0x0266('0x78')]||config[_0x0266('0x79')][_0x0266('0x7a')];return new BPromise(function(_0x350467,_0x313df4){_0x41198c(_0x1937a5[_0x0266('0x7b')],_0x494c90,_0x1937a5[_0x0266('0x7c')])[_0x0266('0x2c')](function(_0x56d069){_0x350467(_0x56d069);})[_0x0266('0x32')](function(_0x5ac391){_0x313df4(_0x5ac391);});});}function verifyJwt(_0x284d7f,_0x15b5a8,_0x455a5b){var _0x4cf4e5=BPromise[_0x0266('0x76')](jwt['verify'],{'context':jwt});var _0x6fa05a=_0x455a5b||config[_0x0266('0x79')]['session'];return new BPromise(function(_0x9204d3,_0x18c115){_0x4cf4e5(_0x284d7f,_0x6fa05a,_0x15b5a8)['then'](function(_0x40e82e){_0x9204d3(_0x40e82e);})[_0x0266('0x32')](function(_0x167a18){_0x18c115(_0x167a18);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x0266('0x7d')](_0x0266('0x7e'));}function generateIssuedAt(){return Math[_0x0266('0x7f')](Date['now']()/0x3e8)[_0x0266('0x7d')]();}function createJwt(_0x3efab8){var _0x5a535d={'payload':{'iat':_0x3efab8[_0x0266('0x62')],'nonce':_0x3efab8[_0x0266('0x49')]},'options':{'algorithm':_0x0266('0x80'),'subject':_0x3efab8['id'][_0x0266('0x7d')](),'issuer':hardwareConf[_0x0266('0x41')](),'audience':hardwareConf[_0x0266('0x41')]()}};return signJwt(_0x5a535d)[_0x0266('0x2c')](function(_0x835d58){return{'iat':_0x3efab8[_0x0266('0x62')],'nonce':_0x3efab8['apiKeyNonce'],'token':_0x835d58};});}
\ No newline at end of file
index 58dc993..c10d1f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82d8=['../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','write','final','unlink','decryptFile','createDecipher','end','encryptString','utf8','base64','crypto','bluebird','lodash'];(function(_0x4f5449,_0x160389){var _0x305bf8=function(_0x38f08a){while(--_0x38f08a){_0x4f5449['push'](_0x4f5449['shift']());}};_0x305bf8(++_0x160389);}(_0x82d8,0xa7));var _0x882d=function(_0xdcde4c,_0x519572){_0xdcde4c=_0xdcde4c-0x0;var _0x3d47ec=_0x82d8[_0xdcde4c];return _0x3d47ec;};'use strict';var crypto=require(_0x882d('0x0'));var fs=require('fs');var BPromise=require(_0x882d('0x1'));var _=require(_0x882d('0x2'));var config=require(_0x882d('0x3'));var logger=require(_0x882d('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x882d('0x5')][_0x882d('0x6')],'algorithm':_0x882d('0x7')};const fileOptions={'algorithm':_0x882d('0x8')};if(config['encrypt']&&config[_0x882d('0x9')][_0x882d('0xa')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x882d('0xa')]);if(isSupported){fileOptions[_0x882d('0xa')]=config[_0x882d('0x9')][_0x882d('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x882d('0xb')](',\x20');logger[_0x882d('0xc')](config[_0x882d('0x9')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x52919c){return AES_SUPPORTED_RX[_0x882d('0xd')](_0x52919c);}function getSupportedCiphers(){return crypto[_0x882d('0xe')]()[_0x882d('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0xbab482){return getSupportedCiphers()[_0x882d('0x10')](_0xbab482)>-0x1;}function combineOptions(_0x2f2193){var _0x3f3f16={};for(var _0x14edf0 in fileOptions){if(fileOptions[_0x882d('0x11')](_0x14edf0)){_0x3f3f16[_0x14edf0]=fileOptions[_0x14edf0];}}if(_0x2f2193){for(var _0x2e22a9 in _0x2f2193){if(_0x2f2193[_0x882d('0x11')](_0x2e22a9)){_0x3f3f16[_0x2e22a9]=_0x2f2193[_0x2e22a9];}}}return _0x3f3f16;}exports[_0x882d('0x12')]=function(_0x29e122,_0x23fbbe,_0x35ad15,_0x24fc43){return new BPromise(function(_0x4aedaa,_0xeaf076){_0x24fc43=combineOptions(_0x24fc43);var _0x55fd80=new Buffer(_0x35ad15);var _0x4c7b88=fs[_0x882d('0x13')](_0x29e122);var _0x24f0f2=fs[_0x882d('0x14')](_0x23fbbe);var _0x38c921=crypto[_0x882d('0x15')](_0x24fc43[_0x882d('0xa')],_0x55fd80);_0x4c7b88['on'](_0x882d('0x16'),function(_0x569071){var _0x4dcc74=new Buffer(_0x38c921[_0x882d('0x17')](_0x569071),_0x882d('0x18'));_0x24f0f2[_0x882d('0x19')](_0x4dcc74);});_0x4c7b88['on']('end',function(){try{var _0x253b05=new Buffer(_0x38c921[_0x882d('0x1a')](_0x882d('0x18')),_0x882d('0x18'));_0x24f0f2[_0x882d('0x19')](_0x253b05);_0x24f0f2['end']();_0x24f0f2['on']('close',function(){return _0x4aedaa(_0x23fbbe);});}catch(_0x2eec84){fs[_0x882d('0x1b')](_0x23fbbe);return _0xeaf076(_0x2eec84);}});});};exports[_0x882d('0x1c')]=function(_0xe44ffd,_0x1511dd,_0x1ada9a,_0x5cc06c){return new BPromise(function(_0x2b2b8d,_0x57f532){_0x5cc06c=combineOptions(_0x5cc06c);var _0x10ea6c=new Buffer(_0x1ada9a);var _0x2c2b45=fs['createReadStream'](_0xe44ffd);var _0x16e621=fs[_0x882d('0x14')](_0x1511dd);var _0x2687a9=crypto[_0x882d('0x1d')](_0x5cc06c[_0x882d('0xa')],_0x10ea6c);_0x2c2b45['on'](_0x882d('0x16'),function(_0x89f904){var _0x1d0147=new Buffer(_0x2687a9[_0x882d('0x17')](_0x89f904),'binary');_0x16e621['write'](_0x1d0147);});_0x2c2b45['on'](_0x882d('0x1e'),function(){try{var _0x495c06=new Buffer(_0x2687a9[_0x882d('0x1a')]('binary'),_0x882d('0x18'));_0x16e621[_0x882d('0x19')](_0x495c06);_0x16e621['end']();_0x16e621['on']('close',function(){return _0x2b2b8d(_0x1511dd);});}catch(_0x1ce7c6){fs[_0x882d('0x1b')](_0x1511dd);return _0x57f532(_0x1ce7c6);}});});};exports[_0x882d('0x1f')]=function(_0x3090be,_0xd632fe,_0x41d80f){var _0x175136=_0x41d80f||stringOptions[_0x882d('0xa')];var _0x150c51=_0xd632fe||stringOptions['secret'];var _0x476a85=crypto[_0x882d('0x15')](_0x175136,_0x150c51);var _0x28a418=_0x476a85[_0x882d('0x17')](_0x3090be,_0x882d('0x20'),_0x882d('0x21'));_0x28a418+=_0x476a85[_0x882d('0x1a')]('base64');return _0x28a418;};exports['decryptString']=function(_0x3a9071,_0xd0e30d,_0x590ed8){var _0x4e1fa6=_0x590ed8||stringOptions[_0x882d('0xa')];var _0x501a87=_0xd0e30d||stringOptions['secret'];var _0x4e9ad9=crypto['createDecipher'](_0x4e1fa6,_0x501a87);var _0x411ff2=_0x4e9ad9[_0x882d('0x17')](_0x3a9071,_0x882d('0x21'),'utf8');_0x411ff2+=_0x4e9ad9[_0x882d('0x1a')](_0x882d('0x20'));return _0x411ff2;};
\ No newline at end of file
+var _0x6dbc=['utf8','base64','secret','crypto','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','end','final','write','close'];(function(_0xf6e93,_0x4b8e2d){var _0x3d088d=function(_0x5b5e88){while(--_0x5b5e88){_0xf6e93['push'](_0xf6e93['shift']());}};_0x3d088d(++_0x4b8e2d);}(_0x6dbc,0x123));var _0xc6db=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x6dbc[_0x1d9aa0];return _0x226868;};'use strict';var crypto=require(_0xc6db('0x0'));var fs=require('fs');var BPromise=require(_0xc6db('0x1'));var _=require(_0xc6db('0x2'));var config=require('../../config/environment');var logger=require(_0xc6db('0x3'))(_0xc6db('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc6db('0x5')][_0xc6db('0x6')],'algorithm':_0xc6db('0x7')};const fileOptions={'algorithm':_0xc6db('0x8')};if(config[_0xc6db('0x9')]&&config[_0xc6db('0x9')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions[_0xc6db('0xa')]=config[_0xc6db('0x9')][_0xc6db('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc6db('0xb')](',\x20');logger[_0xc6db('0xc')](config['encrypt'][_0xc6db('0xa')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x57022d){return AES_SUPPORTED_RX[_0xc6db('0xd')](_0x57022d);}function getSupportedCiphers(){return crypto[_0xc6db('0xe')]()[_0xc6db('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x213fd3){return getSupportedCiphers()[_0xc6db('0x10')](_0x213fd3)>-0x1;}function combineOptions(_0x2e72c4){var _0xf41d40={};for(var _0x35853e in fileOptions){if(fileOptions[_0xc6db('0x11')](_0x35853e)){_0xf41d40[_0x35853e]=fileOptions[_0x35853e];}}if(_0x2e72c4){for(var _0x505267 in _0x2e72c4){if(_0x2e72c4[_0xc6db('0x11')](_0x505267)){_0xf41d40[_0x505267]=_0x2e72c4[_0x505267];}}}return _0xf41d40;}exports[_0xc6db('0x12')]=function(_0x2fdff2,_0x208512,_0x14683a,_0x5cd5b1){return new BPromise(function(_0x5a99e7,_0xb4ed40){_0x5cd5b1=combineOptions(_0x5cd5b1);var _0x239978=new Buffer(_0x14683a);var _0x5d3c8b=fs[_0xc6db('0x13')](_0x2fdff2);var _0x3850cc=fs[_0xc6db('0x14')](_0x208512);var _0x4d0d81=crypto[_0xc6db('0x15')](_0x5cd5b1[_0xc6db('0xa')],_0x239978);_0x5d3c8b['on'](_0xc6db('0x16'),function(_0x387d18){var _0x3b5205=new Buffer(_0x4d0d81[_0xc6db('0x17')](_0x387d18),_0xc6db('0x18'));_0x3850cc['write'](_0x3b5205);});_0x5d3c8b['on'](_0xc6db('0x19'),function(){try{var _0x3bf1a0=new Buffer(_0x4d0d81[_0xc6db('0x1a')](_0xc6db('0x18')),_0xc6db('0x18'));_0x3850cc[_0xc6db('0x1b')](_0x3bf1a0);_0x3850cc[_0xc6db('0x19')]();_0x3850cc['on']('close',function(){return _0x5a99e7(_0x208512);});}catch(_0x2f72af){fs['unlink'](_0x208512);return _0xb4ed40(_0x2f72af);}});});};exports['decryptFile']=function(_0x57f185,_0x2f8428,_0x33214d,_0x2fa023){return new BPromise(function(_0x4d6f06,_0x3f494f){_0x2fa023=combineOptions(_0x2fa023);var _0x4fd539=new Buffer(_0x33214d);var _0x4ca748=fs['createReadStream'](_0x57f185);var _0x454bfc=fs[_0xc6db('0x14')](_0x2f8428);var _0x2c53ce=crypto['createDecipher'](_0x2fa023['algorithm'],_0x4fd539);_0x4ca748['on'](_0xc6db('0x16'),function(_0x35bba3){var _0x45d0ba=new Buffer(_0x2c53ce[_0xc6db('0x17')](_0x35bba3),_0xc6db('0x18'));_0x454bfc[_0xc6db('0x1b')](_0x45d0ba);});_0x4ca748['on'](_0xc6db('0x19'),function(){try{var _0x2272d4=new Buffer(_0x2c53ce[_0xc6db('0x1a')](_0xc6db('0x18')),_0xc6db('0x18'));_0x454bfc[_0xc6db('0x1b')](_0x2272d4);_0x454bfc[_0xc6db('0x19')]();_0x454bfc['on'](_0xc6db('0x1c'),function(){return _0x4d6f06(_0x2f8428);});}catch(_0x5d3eb3){fs['unlink'](_0x2f8428);return _0x3f494f(_0x5d3eb3);}});});};exports['encryptString']=function(_0x2f2017,_0x2fa300,_0x439505){var _0x2318ad=_0x439505||stringOptions[_0xc6db('0xa')];var _0x1f1257=_0x2fa300||stringOptions['secret'];var _0xab8670=crypto[_0xc6db('0x15')](_0x2318ad,_0x1f1257);var _0x1caf8b=_0xab8670['update'](_0x2f2017,_0xc6db('0x1d'),_0xc6db('0x1e'));_0x1caf8b+=_0xab8670['final'](_0xc6db('0x1e'));return _0x1caf8b;};exports['decryptString']=function(_0x3b3291,_0x53fefd,_0x1c5c56){var _0x3b72df=_0x1c5c56||stringOptions[_0xc6db('0xa')];var _0x5ed0c0=_0x53fefd||stringOptions[_0xc6db('0x1f')];var _0x42abbb=crypto['createDecipher'](_0x3b72df,_0x5ed0c0);var _0xe28329=_0x42abbb[_0xc6db('0x17')](_0x3b3291,_0xc6db('0x1e'),'utf8');_0xe28329+=_0x42abbb[_0xc6db('0x1a')](_0xc6db('0x1d'));return _0xe28329;};
\ No newline at end of file
index 131c85f..14c67c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa51d=['split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting'];(function(_0x4cafb1,_0x2954df){var _0x5d0869=function(_0x43667a){while(--_0x43667a){_0x4cafb1['push'](_0x4cafb1['shift']());}};_0x5d0869(++_0x2954df);}(_0xa51d,0xb8));var _0xda51=function(_0x4f04e8,_0x5e3c43){_0x4f04e8=_0x4f04e8-0x0;var _0x20c11d=_0xa51d[_0x4f04e8];return _0x20c11d;};'use strict';var util=require(_0xda51('0x0'));var path=require(_0xda51('0x1'));var _=require(_0xda51('0x2'));var csv=require(_0xda51('0x3'));var fs=require('fs');var BPromise=require(_0xda51('0x4'));var zipdir=require(_0xda51('0x5'));var rimraf=require(_0xda51('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xda51('0x7'))['dbH'];var logger=require(_0xda51('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xda51('0x9')][0x2]);var QUERY=process[_0xda51('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x26f63d,_0x11d901){var _0x5a3694={'status':_0x26f63d};var _0x147f62={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x11d901){_0x5a3694[_0xda51('0xa')]=_0x11d901;}return db['AnalyticExtractedReport'][_0xda51('0xb')](_0x5a3694,_0x147f62);}function main(){var _0x413f21=0x1388;var _0x48eaff;logger[_0xda51('0xc')](util[_0xda51('0xd')](_0xda51('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xda51('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xda51('0x10'),_0xda51('0x11')]})[_0xda51('0x12')](function(_0x399328){if(_0x399328){_0x48eaff=_0x399328;_0x413f21=_0x48eaff[_0xda51('0x11')]||0x1388;}})[_0xda51('0x12')](function(){return dbH[_0xda51('0x13')][_0xda51('0x14')](util[_0xda51('0xd')](_0xda51('0x15'),QUERY),{'type':dbH[_0xda51('0x13')][_0xda51('0x16')]['SELECT']});})[_0xda51('0x12')](function(_0x3253e8){if(!_0x3253e8[0x0][_0xda51('0x17')]){return analyticExtractedReport('Empty');}var _0x296334=[];var _0x60da85=0x0;if(_0x48eaff['split']){if(_0x3253e8&&_0x3253e8[_0xda51('0x18')]){var _0x7c3830=_[_0xda51('0x19')](_0x3253e8[0x0][_0xda51('0x17')]/_0x413f21);var _0x594070=Number['isInteger'](_0x3253e8[0x0][_0xda51('0x17')]/_0x413f21)?_0x3253e8[0x0][_0xda51('0x17')]%_0x413f21:0x0;_0x7c3830[_0xda51('0x1a')](function(_0x12c1f5){if(_0x12c1f5>0x0){_0x60da85+=_0x413f21;}_0x296334[_0xda51('0x1b')](dbH[_0xda51('0x13')][_0xda51('0x14')](util['format'](_0xda51('0x1c'),QUERY,_0x413f21,_0x60da85),{'type':dbH[_0xda51('0x13')][_0xda51('0x16')][_0xda51('0x1d')]}));});if(_0x594070>0x0){_0x60da85+=_0x413f21;_0x296334['push'](dbH[_0xda51('0x13')]['query'](util[_0xda51('0xd')](_0xda51('0x1c'),QUERY,_0x594070,_0x60da85),{'type':dbH[_0xda51('0x13')]['QueryTypes'][_0xda51('0x1d')]}));}}}else{_0x296334[_0xda51('0x1b')](dbH[_0xda51('0x13')]['query'](QUERY,{'type':dbH['sequelize'][_0xda51('0x16')][_0xda51('0x1d')]}));}var _0x5ea03c=path[_0xda51('0x1e')](PATH);var _0x3826d7=path[_0xda51('0x1f')](PATH,_0xda51('0x20'));var _0x5e9eed=_0x48eaff['split']&&_0x296334[_0xda51('0x18')]>0x1;var _0x3d861c=[];if(!fs[_0xda51('0x21')](path['join'](_0x5ea03c,_0x3826d7))&&_0x5e9eed){fs[_0xda51('0x22')](path[_0xda51('0x23')](_0x5ea03c,_0x3826d7));}return BPromise[_0xda51('0x24')](_0x296334,function(_0x4356be){_0x3d861c[_0xda51('0x1b')](_0x4356be);})['then'](function(){for(var _0x2b1c03=0x0;_0x2b1c03<_0x3d861c[_0xda51('0x18')];_0x2b1c03+=0x1){var _0x22e6c1;var _0x4543b9=_0x3d861c[_0x2b1c03];if(_0x5e9eed){_0x22e6c1=path['join'](_0x5ea03c,_0x3826d7,util['format'](_0xda51('0x25'),_0x3826d7,_0x2b1c03,_0xda51('0x26')));}else{_0x22e6c1=path[_0xda51('0x23')](_0x5ea03c,util['format'](_0xda51('0x27'),_0x3826d7,'csv'));}fs[_0xda51('0x28')](_0x22e6c1,csv(_0x4543b9));}})['then'](function(){if(_0x5e9eed){return new Promise(function(_0x30a097){zipdir(path[_0xda51('0x23')](_0x5ea03c,_0x3826d7),{'saveTo':path[_0xda51('0x23')](_0x5ea03c,util[_0xda51('0xd')](_0xda51('0x27'),_0x3826d7,_0xda51('0x29')))},function(_0x3da249,_0x1a0811){rimraf(path[_0xda51('0x23')](_0x5ea03c,_0x3826d7),function(){});_0x30a097(_0xda51('0x2a'));});});}})[_0xda51('0x12')](function(){logger['info'](util[_0xda51('0xd')](_0xda51('0x2b'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xda51('0x2c'),_0x5e9eed?util[_0xda51('0xd')](_0xda51('0x27'),_0x3826d7,_0x5e9eed?_0xda51('0x29'):'csv'):null);});})[_0xda51('0x2d')](function(_0x166cb3){logger[_0xda51('0xc')](util[_0xda51('0xd')](_0xda51('0x2e'),EXTRACTED_REPORT_ID,'CSV'),util[_0xda51('0x2f')](_0x166cb3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xda51('0x30'));})[_0xda51('0x31')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xa68c=['isInteger','forEach','push','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','each','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT','num','length'];(function(_0x4053a2,_0x109564){var _0x1b95de=function(_0x51fb16){while(--_0x51fb16){_0x4053a2['push'](_0x4053a2['shift']());}};_0x1b95de(++_0x109564);}(_0xa68c,0x74));var _0xca68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa68c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var path=require(_0xca68('0x0'));var _=require(_0xca68('0x1'));var csv=require(_0xca68('0x2'));var fs=require('fs');var BPromise=require(_0xca68('0x3'));var zipdir=require(_0xca68('0x4'));var rimraf=require(_0xca68('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xca68('0x6'))[_0xca68('0x7')];var logger=require(_0xca68('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xca68('0x9')][0x2]);var QUERY=process[_0xca68('0x9')][0x3];var PATH=process[_0xca68('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3d2371,_0x3a612e){var _0x254c78={'status':_0x3d2371};var _0x3182da={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a612e){_0x254c78[_0xca68('0xa')]=_0x3a612e;}return db['AnalyticExtractedReport'][_0xca68('0xb')](_0x254c78,_0x3182da);}function main(){var _0x4144a7=0x1388;var _0x3ad5aa;logger[_0xca68('0xc')](util[_0xca68('0xd')](_0xca68('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xca68('0xf')][_0xca68('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xca68('0x11'),_0xca68('0x12')]})[_0xca68('0x13')](function(_0x519098){if(_0x519098){_0x3ad5aa=_0x519098;_0x4144a7=_0x3ad5aa[_0xca68('0x12')]||0x1388;}})['then'](function(){return dbH[_0xca68('0x14')][_0xca68('0x15')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xca68('0x14')]['QueryTypes'][_0xca68('0x16')]});})[_0xca68('0x13')](function(_0x2cc2be){if(!_0x2cc2be[0x0][_0xca68('0x17')]){return analyticExtractedReport('Empty');}var _0x9dcce6=[];var _0x1050a2=0x0;if(_0x3ad5aa['split']){if(_0x2cc2be&&_0x2cc2be[_0xca68('0x18')]){var _0x2ff660=_['range'](_0x2cc2be[0x0][_0xca68('0x17')]/_0x4144a7);var _0x169424=Number[_0xca68('0x19')](_0x2cc2be[0x0][_0xca68('0x17')]/_0x4144a7)?_0x2cc2be[0x0]['num']%_0x4144a7:0x0;_0x2ff660[_0xca68('0x1a')](function(_0x3fa470){if(_0x3fa470>0x0){_0x1050a2+=_0x4144a7;}_0x9dcce6[_0xca68('0x1b')](dbH[_0xca68('0x14')][_0xca68('0x15')](util[_0xca68('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4144a7,_0x1050a2),{'type':dbH[_0xca68('0x14')][_0xca68('0x1c')][_0xca68('0x16')]}));});if(_0x169424>0x0){_0x1050a2+=_0x4144a7;_0x9dcce6[_0xca68('0x1b')](dbH[_0xca68('0x14')][_0xca68('0x15')](util[_0xca68('0xd')](_0xca68('0x1d'),QUERY,_0x169424,_0x1050a2),{'type':dbH[_0xca68('0x14')][_0xca68('0x1c')][_0xca68('0x16')]}));}}}else{_0x9dcce6[_0xca68('0x1b')](dbH[_0xca68('0x14')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xca68('0x16')]}));}var _0x39c2d7=path[_0xca68('0x1e')](PATH);var _0x448a26=path[_0xca68('0x1f')](PATH,_0xca68('0x20'));var _0x4a683c=_0x3ad5aa['split']&&_0x9dcce6[_0xca68('0x18')]>0x1;var _0x7c9345=[];if(!fs[_0xca68('0x21')](path[_0xca68('0x22')](_0x39c2d7,_0x448a26))&&_0x4a683c){fs['mkdirSync'](path['join'](_0x39c2d7,_0x448a26));}return BPromise[_0xca68('0x23')](_0x9dcce6,function(_0x36fa56){_0x7c9345[_0xca68('0x1b')](_0x36fa56);})['then'](function(){for(var _0x424755=0x0;_0x424755<_0x7c9345[_0xca68('0x18')];_0x424755+=0x1){var _0x156d79;var _0x3052c7=_0x7c9345[_0x424755];if(_0x4a683c){_0x156d79=path[_0xca68('0x22')](_0x39c2d7,_0x448a26,util[_0xca68('0xd')]('%s%d.%s',_0x448a26,_0x424755,_0xca68('0x24')));}else{_0x156d79=path[_0xca68('0x22')](_0x39c2d7,util['format'](_0xca68('0x25'),_0x448a26,_0xca68('0x24')));}fs[_0xca68('0x26')](_0x156d79,csv(_0x3052c7));}})[_0xca68('0x13')](function(){if(_0x4a683c){return new Promise(function(_0x35641d){zipdir(path[_0xca68('0x22')](_0x39c2d7,_0x448a26),{'saveTo':path['join'](_0x39c2d7,util[_0xca68('0xd')]('%s.%s',_0x448a26,'zip'))},function(_0x407f07,_0x364c9f){rimraf(path[_0xca68('0x22')](_0x39c2d7,_0x448a26),function(){});_0x35641d(_0xca68('0x27'));});});}})['then'](function(){logger[_0xca68('0xc')](util['format'](_0xca68('0x28'),EXTRACTED_REPORT_ID,_0xca68('0x29')));return analyticExtractedReport('Completed',_0x4a683c?util['format']('%s.%s',_0x448a26,_0x4a683c?_0xca68('0x2a'):'csv'):null);});})[_0xca68('0x2b')](function(_0x1e791c){logger[_0xca68('0xc')](util[_0xca68('0xd')](_0xca68('0x2c'),EXTRACTED_REPORT_ID,_0xca68('0x29')),util[_0xca68('0x2d')](_0x1e791c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xca68('0x2e')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 989ecf3..6a2dc91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec83=['join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%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','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','finish','error','end','createPdfFromHTML','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','toString','value','fill','length','body','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','push','header','before','margin','landscape','\x20/\x20','Arial','black','right','num','Setting','split','splitSizePdf','then','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.pdf','existsSync','mkdirSync'];(function(_0x46f4a0,_0x2ddea5){var _0x1ac9a7=function(_0x4876ef){while(--_0x4876ef){_0x46f4a0['push'](_0x46f4a0['shift']());}};_0x1ac9a7(++_0x2ddea5);}(_0xec83,0x81));var _0x3ec8=function(_0x44606e,_0x2bf244){_0x44606e=_0x44606e-0x0;var _0xe68388=_0xec83[_0x44606e];return _0xe68388;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x3ec8('0x0'));var path=require(_0x3ec8('0x1'));var moment=require(_0x3ec8('0x2'));var htmlToPdfmake=require(_0x3ec8('0x3'));var PdfPrinter=require(_0x3ec8('0x4'));var zipdir=require(_0x3ec8('0x5'));var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0x3ec8('0x6')];var window=new JSDOM('')[_0x3ec8('0x7')];var BPromise=require('bluebird');var db=require(_0x3ec8('0x8'))['db'];var dbH=require(_0x3ec8('0x8'))[_0x3ec8('0x9')];var logger=require(_0x3ec8('0xa'))(_0x3ec8('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x3ec8('0xc')][0x5];var FORMAT=_0x3ec8('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x26e36d,_0x55eb21){var _0x3d40d1={'status':_0x26e36d};var _0x38a296={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x55eb21){_0x3d40d1[_0x3ec8('0xe')]=_0x55eb21;}return db[_0x3ec8('0xf')]['update'](_0x3d40d1,_0x38a296);}function getHeaders(_0x9725bc){return _[_0x3ec8('0x10')](_0x9725bc,function(_0x3b2511){return{'text':_0x3b2511,'style':_0x3ec8('0x11')};});}function getRows(_0x16938e,_0x40bfcc){return _[_0x3ec8('0x10')](_0x40bfcc,function(_0x3f23dc){return _(_0x3f23dc)['pick'](_0x16938e)[_0x3ec8('0x10')](function(_0x47db0a){return _0x47db0a?_[_0x3ec8('0x12')](_0x47db0a):'';})[_0x3ec8('0x13')]();});}function createTable(_0x309fa8,_0x25d205){var _0x2cb083={'widths':_[_0x3ec8('0x14')](Array(_0x309fa8[_0x3ec8('0x15')]),0x91),'heights':function(_0x3f1c6e){return _0x3f1c6e===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5d0e2f=getHeaders(_0x309fa8);_0x2cb083['body']['push'](_0x5d0e2f);var _0x1ebe1f=getRows(_0x309fa8,_0x25d205);_0x2cb083['body']=_0x2cb083[_0x3ec8('0x16')][_0x3ec8('0x17')](_0x1ebe1f);return _0x2cb083;}function createTables(_0x17ae32){var _0x42f282=[];var _0x1f2877=_['chunk'](Object[_0x3ec8('0x18')](_0x17ae32[0x0]),0x5);_0x1f2877[_0x3ec8('0x19')](function(_0x32ee1d){_0x42f282['push'](createTable(_0x32ee1d,_0x17ae32));});return _0x42f282;}function getPDFDocDefinition(_0xd61b31){var _0x2cb3b7=util[_0x3ec8('0x1a')](_0x3ec8('0x1b'),NAME,EXTRACTED_REPORT[_0x3ec8('0x1c')],moment(EXTRACTED_REPORT[_0x3ec8('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x3ec8('0x1a')](FORMAT));var _0x572a6f=[];for(var _0x402c52=0x0;_0x402c52<_0xd61b31[_0x3ec8('0x15')];_0x402c52++){var _0x27d84a=[];if(_0x402c52===0x0){_0x27d84a[_0x3ec8('0x1e')]({'text':_0x2cb3b7,'style':_0x3ec8('0x1f')});}var _0x3ecec7={'table':_0xd61b31[_0x402c52]};if(_0x402c52>0x0){_0x3ecec7['pageBreak']=_0x3ec8('0x20');_0x3ecec7[_0x3ec8('0x21')]=[0x0,0x46,0x0,0x0];}_0x27d84a['push'](_0x3ecec7);_0x572a6f['push'](_0x27d84a);}return{'pageSize':'A4','pageOrientation':_0x3ec8('0x22'),'content':_0x572a6f,'footer':function(_0x2f140f,_0x20f070){return{'text':_0x2f140f[_0x3ec8('0x12')]()+_0x3ec8('0x23')+_0x20f070,'style':'footer'};},'defaultStyle':{'font':_0x3ec8('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3ec8('0x25')},'footer':{'alignment':_0x3ec8('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1c651f){var _0x425eb2=0x1388;var _0x65da52;if(!_0x1c651f[0x0][_0x3ec8('0x27')]){return analyticExtractedReport('Empty');}return db[_0x3ec8('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3ec8('0x29'),_0x3ec8('0x2a')]})[_0x3ec8('0x2b')](function(_0x34b11a){if(_0x34b11a){_0x65da52=_0x34b11a;_0x425eb2=_0x65da52[_0x3ec8('0x2a')]||0x3e8;}})['then'](function(){var _0x373b81=[];var _0x337be1=0x0;if(_0x65da52['split']){if(_0x1c651f&&_0x1c651f['length']){var _0x427b4a=_['range'](_0x1c651f[0x0]['num']/_0x425eb2);var _0x259a6b=Number[_0x3ec8('0x2c')](_0x1c651f[0x0][_0x3ec8('0x27')]/_0x425eb2)?_0x1c651f[0x0][_0x3ec8('0x27')]%_0x425eb2:0x0;_0x427b4a[_0x3ec8('0x19')](function(_0xed6d6){if(_0xed6d6>0x0){_0x337be1+=_0x425eb2;}_0x373b81[_0x3ec8('0x1e')](dbH[_0x3ec8('0x2d')][_0x3ec8('0x2e')](util['format'](_0x3ec8('0x2f'),QUERY,_0x425eb2,_0x337be1),{'type':dbH['sequelize']['QueryTypes'][_0x3ec8('0x30')]}));});if(_0x259a6b>0x0){_0x337be1+=_0x425eb2;_0x373b81[_0x3ec8('0x1e')](dbH[_0x3ec8('0x2d')][_0x3ec8('0x2e')](util[_0x3ec8('0x1a')](_0x3ec8('0x2f'),QUERY,_0x259a6b,_0x337be1),{'type':dbH[_0x3ec8('0x2d')][_0x3ec8('0x31')][_0x3ec8('0x30')]}));}}}else{_0x373b81[_0x3ec8('0x1e')](dbH[_0x3ec8('0x2d')][_0x3ec8('0x2e')](QUERY,{'type':dbH[_0x3ec8('0x2d')][_0x3ec8('0x31')][_0x3ec8('0x30')]}));}var _0x55ba75=path[_0x3ec8('0x32')](PATH);var _0x2e4b8a=path[_0x3ec8('0x33')](PATH,_0x3ec8('0x34'));var _0x19e430=_0x65da52['split']&&_0x373b81['length']>0x1;var _0x7b5b26=[];if(!fs[_0x3ec8('0x35')](path['join'](_0x55ba75,_0x2e4b8a))&&_0x19e430){fs[_0x3ec8('0x36')](path[_0x3ec8('0x37')](_0x55ba75,_0x2e4b8a));}return BPromise[_0x3ec8('0x38')](_0x373b81,function(_0x23c3f6){_0x7b5b26[_0x3ec8('0x1e')](_0x23c3f6);})[_0x3ec8('0x2b')](function(){var _0x188d84=[];for(var _0x12c308=0x0;_0x12c308<_0x7b5b26['length'];_0x12c308+=0x1){var _0x1d4844=_0x7b5b26[_0x12c308];var _0x2f7491=createTables(_[_0x3ec8('0x39')](_0x1d4844));var _0x272077;var _0x93e304=getPDFDocDefinition(_0x2f7491);var _0x49d5f1=getPDFPrinter();var _0x3c8154=_0x49d5f1[_0x3ec8('0x3a')](_0x93e304);if(_0x19e430){_0x272077=path[_0x3ec8('0x37')](_0x55ba75,_0x2e4b8a,util[_0x3ec8('0x1a')](_0x3ec8('0x3b'),_0x2e4b8a,_0x12c308,_0x3ec8('0x3c')));}else{_0x272077=path[_0x3ec8('0x37')](_0x55ba75,util[_0x3ec8('0x1a')](_0x3ec8('0x3d'),_0x2e4b8a,_0x3ec8('0x3c')));}_0x188d84[_0x3ec8('0x1e')](writePDFDocument(_0x3c8154,_0x272077));}return Promise['all'](_0x188d84);})[_0x3ec8('0x2b')](function(){if(_0x19e430){return new Promise(function(_0x4c9a78){zipdir(path['join'](_0x55ba75,_0x2e4b8a),{'saveTo':path[_0x3ec8('0x37')](_0x55ba75,util[_0x3ec8('0x1a')](_0x3ec8('0x3d'),_0x2e4b8a,_0x3ec8('0x3e')))},function(){rimraf(path['join'](_0x55ba75,_0x2e4b8a),function(){});_0x4c9a78(_0x3ec8('0x3f'));});});}})[_0x3ec8('0x2b')](function(){if(!_0x19e430)return;rimraf(path[_0x3ec8('0x37')](_0x55ba75,_0x2e4b8a),function(){});})[_0x3ec8('0x2b')](function(){logger[_0x3ec8('0x40')](util[_0x3ec8('0x1a')](_0x3ec8('0x41'),EXTRACTED_REPORT_ID,_0x3ec8('0x42')));return analyticExtractedReport(_0x3ec8('0x43'),_0x19e430?util['format']('%s.%s',_0x2e4b8a,_0x19e430?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3ec8('0x40')](util[_0x3ec8('0x1a')](_0x3ec8('0x44'),EXTRACTED_REPORT_ID,_0x3ec8('0x42')));return db['AnalyticExtractedReport'][_0x3ec8('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3ec8('0x2b')](function(_0x2b1137){EXTRACTED_REPORT=_0x2b1137;return dbH[_0x3ec8('0x2d')][_0x3ec8('0x2e')](util['format'](_0x3ec8('0x46'),QUERY),{'type':dbH[_0x3ec8('0x2d')][_0x3ec8('0x31')][_0x3ec8('0x30')]});})['then'](extractReport)[_0x3ec8('0x47')](function(_0x444d5f){logger['info'](util['format'](_0x3ec8('0x48'),EXTRACTED_REPORT_ID,_0x3ec8('0x42')),util[_0x3ec8('0x49')](_0x444d5f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3ec8('0x4a'));})[_0x3ec8('0x4b')](function(){process[_0x3ec8('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5208dd=new PdfPrinter({'Arial':{'normal':__dirname+_0x3ec8('0x4d'),'bold':__dirname+_0x3ec8('0x4e'),'italics':__dirname+_0x3ec8('0x4f'),'bolditalics':__dirname+_0x3ec8('0x50')}});return _0x5208dd;}function getPDFDocDefinitionFromHTML(_0x5a5ef6,_0x57ff15){var _0x324982=util['format'](_0x3ec8('0x51'),_0x57ff15[_0x3ec8('0x52')],_0x57ff15[_0x3ec8('0x53')]);var _0x3f0b38=moment()[_0x3ec8('0x1a')](_0x3ec8('0x54'))[_0x3ec8('0x12')]();var _0x4b50b8=htmlToPdfmake(_0x5a5ef6,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4b50b8],'defaultStyle':{'font':_0x3ec8('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3ec8('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3ec8('0x55')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x3ec8('0x1f')}];},'footer':function(_0x50b0fc,_0x25a57d){return[{'text':util[_0x3ec8('0x1a')](_0x3ec8('0x56'),_0x324982,_0x50b0fc,_0x25a57d,_0x3f0b38),'style':_0x3ec8('0x57')}];}};}function writePDFDocument(_0x363917,_0x11c945){return new Promise(function(_0x4a56b9,_0x360df0){var _0x3a8a4f=_0x363917['pipe'](fs['createWriteStream'](_0x11c945));_0x3a8a4f['on'](_0x3ec8('0x58'),function(){_0x4a56b9(_0x3ec8('0x58'));});_0x3a8a4f['on'](_0x3ec8('0x59'),function(_0x8aa6a){_0x360df0(_0x8aa6a);});_0x363917[_0x3ec8('0x5a')]();});}exports[_0x3ec8('0x5b')]=function(_0x4aa6b,_0xb45ba4){var _0x23d607=getPDFPrinter();var _0x526866=getPDFDocDefinitionFromHTML(_0x4aa6b,_0xb45ba4);var _0x26b592=_0x23d607[_0x3ec8('0x3a')](_0x526866);return writePDFDocument(_0x26b592,_0xb45ba4[_0x3ec8('0x1')])[_0x3ec8('0x47')](function(_0x28b731){throw _0x28b731;});};
\ No newline at end of file
+var _0xd038=['argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','toString','value','fill','auto','body','push','concat','keys','forEach','format','endDate','length','header','pageBreak','landscape','\x20/\x20','footer','Empty','find','splitSizePdf','then','split','range','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','mkdirSync','join','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','channel','YYYY-MM-DD','Arial','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','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH'];(function(_0x12812b,_0x3ef535){var _0x662186=function(_0x448d49){while(--_0x448d49){_0x12812b['push'](_0x12812b['shift']());}};_0x662186(++_0x3ef535);}(_0xd038,0x148));var _0x8d03=function(_0x249d99,_0x16b584){_0x249d99=_0x249d99-0x0;var _0x5bfb05=_0xd038[_0x249d99];return _0x5bfb05;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x8d03('0x0'));var path=require(_0x8d03('0x1'));var moment=require(_0x8d03('0x2'));var htmlToPdfmake=require(_0x8d03('0x3'));var PdfPrinter=require(_0x8d03('0x4'));var zipdir=require(_0x8d03('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x8d03('0x6'))[_0x8d03('0x7')];var window=new JSDOM('')[_0x8d03('0x8')];var BPromise=require(_0x8d03('0x9'));var db=require(_0x8d03('0xa'))['db'];var dbH=require(_0x8d03('0xa'))[_0x8d03('0xb')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8d03('0xc')][0x3];var PATH=process[_0x8d03('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x8d03('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x25f7d1,_0x2aee5f){var _0x200213={'status':_0x25f7d1};var _0x37f293={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2aee5f){_0x200213[_0x8d03('0xe')]=_0x2aee5f;}return db['AnalyticExtractedReport'][_0x8d03('0xf')](_0x200213,_0x37f293);}function getHeaders(_0x33db14){return _[_0x8d03('0x10')](_0x33db14,function(_0x397165){return{'text':_0x397165,'style':_0x8d03('0x11')};});}function getRows(_0x29909e,_0x583a1d){return _[_0x8d03('0x10')](_0x583a1d,function(_0x2e09f6){return _(_0x2e09f6)[_0x8d03('0x12')](_0x29909e)['map'](function(_0x6a5153){return _0x6a5153?_[_0x8d03('0x13')](_0x6a5153):'';})[_0x8d03('0x14')]();});}function createTable(_0x45b32a,_0x5e1c15){var _0xc46b41={'widths':_[_0x8d03('0x15')](Array(_0x45b32a['length']),0x91),'heights':function(_0x359fe5){return _0x359fe5===0x0?_0x8d03('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x9806ca=getHeaders(_0x45b32a);_0xc46b41[_0x8d03('0x17')][_0x8d03('0x18')](_0x9806ca);var _0x25306e=getRows(_0x45b32a,_0x5e1c15);_0xc46b41['body']=_0xc46b41[_0x8d03('0x17')][_0x8d03('0x19')](_0x25306e);return _0xc46b41;}function createTables(_0x1004e1){var _0x135aa1=[];var _0x5e8ab9=_['chunk'](Object[_0x8d03('0x1a')](_0x1004e1[0x0]),0x5);_0x5e8ab9[_0x8d03('0x1b')](function(_0x1f372){_0x135aa1[_0x8d03('0x18')](createTable(_0x1f372,_0x1004e1));});return _0x135aa1;}function getPDFDocDefinition(_0x3f31ae){var _0x2bcdbe=util[_0x8d03('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x8d03('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x8d03('0x1d')])[_0x8d03('0x1c')](FORMAT));var _0x5baf6c=[];for(var _0x177310=0x0;_0x177310<_0x3f31ae[_0x8d03('0x1e')];_0x177310++){var _0x5e3646=[];if(_0x177310===0x0){_0x5e3646[_0x8d03('0x18')]({'text':_0x2bcdbe,'style':_0x8d03('0x1f')});}var _0x2dd9bf={'table':_0x3f31ae[_0x177310]};if(_0x177310>0x0){_0x2dd9bf[_0x8d03('0x20')]='before';_0x2dd9bf['margin']=[0x0,0x46,0x0,0x0];}_0x5e3646[_0x8d03('0x18')](_0x2dd9bf);_0x5baf6c[_0x8d03('0x18')](_0x5e3646);}return{'pageSize':'A4','pageOrientation':_0x8d03('0x21'),'content':_0x5baf6c,'footer':function(_0x3b360d,_0x4995ce){return{'text':_0x3b360d[_0x8d03('0x13')]()+_0x8d03('0x22')+_0x4995ce,'style':_0x8d03('0x23')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3091a6){var _0x42abd2=0x1388;var _0xa48491;if(!_0x3091a6[0x0]['num']){return analyticExtractedReport(_0x8d03('0x24'));}return db['Setting'][_0x8d03('0x25')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8d03('0x26')]})[_0x8d03('0x27')](function(_0x42aae9){if(_0x42aae9){_0xa48491=_0x42aae9;_0x42abd2=_0xa48491[_0x8d03('0x26')]||0x3e8;}})[_0x8d03('0x27')](function(){var _0x473363=[];var _0x18db6a=0x0;if(_0xa48491[_0x8d03('0x28')]){if(_0x3091a6&&_0x3091a6[_0x8d03('0x1e')]){var _0x3c8720=_[_0x8d03('0x29')](_0x3091a6[0x0][_0x8d03('0x2a')]/_0x42abd2);var _0x56c468=Number['isInteger'](_0x3091a6[0x0]['num']/_0x42abd2)?_0x3091a6[0x0][_0x8d03('0x2a')]%_0x42abd2:0x0;_0x3c8720[_0x8d03('0x1b')](function(_0x353f4c){if(_0x353f4c>0x0){_0x18db6a+=_0x42abd2;}_0x473363[_0x8d03('0x18')](dbH[_0x8d03('0x2b')][_0x8d03('0x2c')](util[_0x8d03('0x1c')](_0x8d03('0x2d'),QUERY,_0x42abd2,_0x18db6a),{'type':dbH[_0x8d03('0x2b')][_0x8d03('0x2e')]['SELECT']}));});if(_0x56c468>0x0){_0x18db6a+=_0x42abd2;_0x473363['push'](dbH[_0x8d03('0x2b')][_0x8d03('0x2c')](util[_0x8d03('0x1c')](_0x8d03('0x2d'),QUERY,_0x56c468,_0x18db6a),{'type':dbH['sequelize'][_0x8d03('0x2e')][_0x8d03('0x2f')]}));}}}else{_0x473363[_0x8d03('0x18')](dbH['sequelize'][_0x8d03('0x2c')](QUERY,{'type':dbH[_0x8d03('0x2b')][_0x8d03('0x2e')]['SELECT']}));}var _0x2e481a=path[_0x8d03('0x30')](PATH);var _0x163cf3=path[_0x8d03('0x31')](PATH,'.pdf');var _0x4d5dc7=_0xa48491[_0x8d03('0x28')]&&_0x473363[_0x8d03('0x1e')]>0x1;var _0x135800=[];if(!fs['existsSync'](path['join'](_0x2e481a,_0x163cf3))&&_0x4d5dc7){fs[_0x8d03('0x32')](path[_0x8d03('0x33')](_0x2e481a,_0x163cf3));}return BPromise['each'](_0x473363,function(_0x535480){_0x135800[_0x8d03('0x18')](_0x535480);})[_0x8d03('0x27')](function(){var _0x47b35c=[];for(var _0x2212af=0x0;_0x2212af<_0x135800[_0x8d03('0x1e')];_0x2212af+=0x1){var _0x50a0e4=_0x135800[_0x2212af];var _0x52c589=createTables(_['flatten'](_0x50a0e4));var _0x305ba8;var _0x1e77f3=getPDFDocDefinition(_0x52c589);var _0x41ff17=getPDFPrinter();var _0x21c919=_0x41ff17[_0x8d03('0x34')](_0x1e77f3);if(_0x4d5dc7){_0x305ba8=path['join'](_0x2e481a,_0x163cf3,util[_0x8d03('0x1c')](_0x8d03('0x35'),_0x163cf3,_0x2212af,_0x8d03('0x36')));}else{_0x305ba8=path[_0x8d03('0x33')](_0x2e481a,util[_0x8d03('0x1c')](_0x8d03('0x37'),_0x163cf3,_0x8d03('0x36')));}_0x47b35c[_0x8d03('0x18')](writePDFDocument(_0x21c919,_0x305ba8));}return Promise[_0x8d03('0x38')](_0x47b35c);})[_0x8d03('0x27')](function(){if(_0x4d5dc7){return new Promise(function(_0x41e001){zipdir(path[_0x8d03('0x33')](_0x2e481a,_0x163cf3),{'saveTo':path['join'](_0x2e481a,util[_0x8d03('0x1c')](_0x8d03('0x37'),_0x163cf3,'zip'))},function(){rimraf(path[_0x8d03('0x33')](_0x2e481a,_0x163cf3),function(){});_0x41e001(_0x8d03('0x39'));});});}})[_0x8d03('0x27')](function(){if(!_0x4d5dc7)return;rimraf(path['join'](_0x2e481a,_0x163cf3),function(){});})['then'](function(){logger['info'](util[_0x8d03('0x1c')](_0x8d03('0x3a'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x8d03('0x3b'),_0x4d5dc7?util[_0x8d03('0x1c')](_0x8d03('0x37'),_0x163cf3,_0x4d5dc7?'zip':_0x8d03('0x36')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8d03('0x3c')](util[_0x8d03('0x1c')](_0x8d03('0x3d'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x8d03('0x3e')][_0x8d03('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4c2bf6){EXTRACTED_REPORT=_0x4c2bf6;return dbH[_0x8d03('0x2b')][_0x8d03('0x2c')](util[_0x8d03('0x1c')](_0x8d03('0x40'),QUERY),{'type':dbH[_0x8d03('0x2b')]['QueryTypes']['SELECT']});})[_0x8d03('0x27')](extractReport)[_0x8d03('0x41')](function(_0x32d5ef){logger[_0x8d03('0x3c')](util[_0x8d03('0x1c')](_0x8d03('0x42'),EXTRACTED_REPORT_ID,_0x8d03('0x43')),util[_0x8d03('0x44')](_0x32d5ef,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8d03('0x45'));})[_0x8d03('0x46')](function(){process[_0x8d03('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x177021=new PdfPrinter({'Arial':{'normal':__dirname+_0x8d03('0x48'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x8d03('0x49')}});return _0x177021;}function getPDFDocDefinitionFromHTML(_0x59a06b,_0x4562cb){var _0x3963ec=util[_0x8d03('0x1c')]('%s\x20#%d',_0x4562cb[_0x8d03('0x4a')],_0x4562cb['interactionId']);var _0x5664de=moment()[_0x8d03('0x1c')](_0x8d03('0x4b'))[_0x8d03('0x13')]();var _0x412c8f=htmlToPdfmake(_0x59a06b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x412c8f],'defaultStyle':{'font':_0x8d03('0x4c')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x8d03('0x4d'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8d03('0x4d'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x8d03('0x4d')}},'header':function(){return[{'text':_0x8d03('0x4e'),'style':_0x8d03('0x1f')}];},'footer':function(_0x3cbd33,_0x475db9){return[{'text':util[_0x8d03('0x1c')](_0x8d03('0x4f'),_0x3963ec,_0x3cbd33,_0x475db9,_0x5664de),'style':_0x8d03('0x23')}];}};}function writePDFDocument(_0x2e3111,_0xd1ef42){return new Promise(function(_0x5575ff,_0x21a6b7){var _0x3a4c63=_0x2e3111[_0x8d03('0x50')](fs[_0x8d03('0x51')](_0xd1ef42));_0x3a4c63['on'](_0x8d03('0x52'),function(){_0x5575ff('finish');});_0x3a4c63['on'](_0x8d03('0x53'),function(_0x270935){_0x21a6b7(_0x270935);});_0x2e3111[_0x8d03('0x54')]();});}exports['createPdfFromHTML']=function(_0x4f7e7d,_0xe71089){var _0x5ecdee=getPDFPrinter();var _0xa1f96b=getPDFDocDefinitionFromHTML(_0x4f7e7d,_0xe71089);var _0x1a29ef=_0x5ecdee[_0x8d03('0x34')](_0xa1f96b);return writePDFDocument(_0x1a29ef,_0xe71089['path'])[_0x8d03('0x41')](function(_0x23a38d){throw _0x23a38d;});};
\ No newline at end of file
index 67a8fc0..147f46e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd10f=['../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','existsSync','join','each','%s%d.%s','writeFileSync','binary','%s.%s','zip','zip\x20finished','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','json2xls','bluebird','rimraf'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0xd10f,0x198));var _0xfd10=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd10f[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0xfd10('0x0'));var path=require(_0xfd10('0x1'));var _=require(_0xfd10('0x2'));var fs=require('fs');var json2xls=require(_0xfd10('0x3'));var BPromise=require(_0xfd10('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0xfd10('0x5'));var db=require(_0xfd10('0x6'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xfd10('0x7'))(_0xfd10('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xfd10('0x9')][0x2]);var QUERY=process[_0xfd10('0x9')][0x3];var PATH=process[_0xfd10('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x10db32,_0xef584f){var _0x3ed592={'status':_0x10db32};var _0x509cd6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xef584f){_0x3ed592[_0xfd10('0xa')]=_0xef584f;}return db[_0xfd10('0xb')]['update'](_0x3ed592,_0x509cd6);}function main(){var _0x21d643=0x1388;var _0x389df3;logger[_0xfd10('0xc')](util[_0xfd10('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0xfd10('0xe')][_0xfd10('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xfd10('0x10')]})[_0xfd10('0x11')](function(_0x456752){if(_0x456752){_0x389df3=_0x456752;_0x21d643=_0x389df3[_0xfd10('0x10')]||0x1388;}})[_0xfd10('0x11')](function(){return dbH[_0xfd10('0x12')][_0xfd10('0x13')](util[_0xfd10('0xd')](_0xfd10('0x14'),QUERY),{'type':dbH[_0xfd10('0x12')][_0xfd10('0x15')][_0xfd10('0x16')]});})[_0xfd10('0x11')](function(_0x21dc0a){if(!_0x21dc0a[0x0][_0xfd10('0x17')]){return analyticExtractedReport(_0xfd10('0x18'));}var _0x1dcd95=[];var _0x14a97d=0x0;if(_0x389df3[_0xfd10('0x19')]){if(_0x21dc0a&&_0x21dc0a[_0xfd10('0x1a')]){var _0xde87a3=_[_0xfd10('0x1b')](_0x21dc0a[0x0][_0xfd10('0x17')]/_0x21d643);var _0x4ffe07=Number[_0xfd10('0x1c')](_0x21dc0a[0x0]['num']/_0x21d643)?_0x21dc0a[0x0][_0xfd10('0x17')]%_0x21d643:0x0;_0xde87a3['forEach'](function(_0x440fe3){if(_0x440fe3>0x0){_0x14a97d+=_0x21d643;}_0x1dcd95[_0xfd10('0x1d')](dbH[_0xfd10('0x12')][_0xfd10('0x13')](util['format'](_0xfd10('0x1e'),QUERY,_0x21d643,_0x14a97d),{'type':dbH[_0xfd10('0x12')]['QueryTypes'][_0xfd10('0x16')]}));});if(_0x4ffe07>0x0){_0x14a97d+=_0x21d643;_0x1dcd95[_0xfd10('0x1d')](dbH['sequelize'][_0xfd10('0x13')](util[_0xfd10('0xd')](_0xfd10('0x1e'),QUERY,_0x4ffe07,_0x14a97d),{'type':dbH['sequelize'][_0xfd10('0x15')][_0xfd10('0x16')]}));}}}else{_0x1dcd95[_0xfd10('0x1d')](dbH['sequelize'][_0xfd10('0x13')](QUERY,{'type':dbH['sequelize'][_0xfd10('0x15')]['SELECT']}));}var _0x59af0c=path['dirname'](PATH);var _0x31b470=path[_0xfd10('0x1f')](PATH,'.xlsx');var _0x3cc74f=_0x389df3[_0xfd10('0x19')]&&_0x1dcd95[_0xfd10('0x1a')]>0x1;var _0x1152c9=[];if(!fs[_0xfd10('0x20')](path[_0xfd10('0x21')](_0x59af0c,_0x31b470))&&_0x3cc74f){fs['mkdirSync'](path[_0xfd10('0x21')](_0x59af0c,_0x31b470));}return BPromise[_0xfd10('0x22')](_0x1dcd95,function(_0x881ace){_0x1152c9['push'](_0x881ace);})[_0xfd10('0x11')](function(){for(var _0x127980=0x0;_0x127980<_0x1152c9[_0xfd10('0x1a')];_0x127980+=0x1){var _0x42c62f;var _0x597f4b=_0x1152c9[_0x127980];if(_0x3cc74f){_0x42c62f=path['join'](_0x59af0c,_0x31b470,util[_0xfd10('0xd')](_0xfd10('0x23'),_0x31b470,_0x127980,'xlsx'));}else{_0x42c62f=path[_0xfd10('0x21')](_0x59af0c,util[_0xfd10('0xd')]('%s.%s',_0x31b470,'xlsx'));}fs[_0xfd10('0x24')](_0x42c62f,json2xls(_0x597f4b),_0xfd10('0x25'));}})[_0xfd10('0x11')](function(){if(_0x3cc74f){return new Promise(function(_0x270886){zipdir(path[_0xfd10('0x21')](_0x59af0c,_0x31b470),{'saveTo':path['join'](_0x59af0c,util[_0xfd10('0xd')](_0xfd10('0x26'),_0x31b470,_0xfd10('0x27')))},function(_0x228149,_0x405674){rimraf(path[_0xfd10('0x21')](_0x59af0c,_0x31b470),function(){});_0x270886(_0xfd10('0x28'));});});}})['then'](function(){logger['info'](util[_0xfd10('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xfd10('0x29')));return analyticExtractedReport('Completed',_0x3cc74f?util[_0xfd10('0xd')](_0xfd10('0x26'),_0x31b470,_0x3cc74f?_0xfd10('0x27'):'xlsx'):null);});})[_0xfd10('0x2a')](function(_0x2e7e49){logger[_0xfd10('0xc')](util[_0xfd10('0xd')](_0xfd10('0x2b'),EXTRACTED_REPORT_ID,_0xfd10('0x29')),util[_0xfd10('0x2c')](_0x2e7e49,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xfd10('0x2d'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xf712=['util','path','lodash','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','num','length','range','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','existsSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf712,0x195));var _0x2f71=function(_0x2a8ec0,_0x74a1f4){_0x2a8ec0=_0x2a8ec0-0x0;var _0x3b3b3e=_0xf712[_0x2a8ec0];return _0x3b3b3e;};'use strict';var util=require(_0x2f71('0x0'));var path=require(_0x2f71('0x1'));var _=require(_0x2f71('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x2f71('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2f71('0x4'))[_0x2f71('0x5')];var logger=require(_0x2f71('0x6'))(_0x2f71('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x2f71('0x8')][0x2]);var QUERY=process[_0x2f71('0x8')][0x3];var PATH=process[_0x2f71('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b1b50,_0x137c28){var _0x14b257={'status':_0x5b1b50};var _0x40b204={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x137c28){_0x14b257['savename']=_0x137c28;}return db['AnalyticExtractedReport'][_0x2f71('0x9')](_0x14b257,_0x40b204);}function main(){var _0x4e406b=0x1388;var _0x515179;logger[_0x2f71('0xa')](util[_0x2f71('0xb')](_0x2f71('0xc'),EXTRACTED_REPORT_ID,_0x2f71('0xd')));return db[_0x2f71('0xe')][_0x2f71('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2f71('0x10'),_0x2f71('0x11')]})[_0x2f71('0x12')](function(_0x4308b7){if(_0x4308b7){_0x515179=_0x4308b7;_0x4e406b=_0x515179[_0x2f71('0x11')]||0x1388;}})['then'](function(){return dbH[_0x2f71('0x13')][_0x2f71('0x14')](util[_0x2f71('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x2f71('0x15')]['SELECT']});})[_0x2f71('0x12')](function(_0x2016e2){if(!_0x2016e2[0x0][_0x2f71('0x16')]){return analyticExtractedReport('Empty');}var _0x16501e=[];var _0xef4f35=0x0;if(_0x515179[_0x2f71('0x10')]){if(_0x2016e2&&_0x2016e2[_0x2f71('0x17')]){var _0x4abcf4=_[_0x2f71('0x18')](_0x2016e2[0x0][_0x2f71('0x16')]/_0x4e406b);var _0x44609e=Number['isInteger'](_0x2016e2[0x0]['num']/_0x4e406b)?_0x2016e2[0x0][_0x2f71('0x16')]%_0x4e406b:0x0;_0x4abcf4['forEach'](function(_0x56bcad){if(_0x56bcad>0x0){_0xef4f35+=_0x4e406b;}_0x16501e[_0x2f71('0x19')](dbH['sequelize'][_0x2f71('0x14')](util[_0x2f71('0xb')](_0x2f71('0x1a'),QUERY,_0x4e406b,_0xef4f35),{'type':dbH['sequelize'][_0x2f71('0x15')][_0x2f71('0x1b')]}));});if(_0x44609e>0x0){_0xef4f35+=_0x4e406b;_0x16501e['push'](dbH[_0x2f71('0x13')]['query'](util[_0x2f71('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x44609e,_0xef4f35),{'type':dbH[_0x2f71('0x13')][_0x2f71('0x15')][_0x2f71('0x1b')]}));}}}else{_0x16501e[_0x2f71('0x19')](dbH[_0x2f71('0x13')][_0x2f71('0x14')](QUERY,{'type':dbH[_0x2f71('0x13')][_0x2f71('0x15')][_0x2f71('0x1b')]}));}var _0x4f5e65=path[_0x2f71('0x1c')](PATH);var _0x431fd9=path[_0x2f71('0x1d')](PATH,'.xlsx');var _0x2ef86c=_0x515179['split']&&_0x16501e[_0x2f71('0x17')]>0x1;var _0x5822aa=[];if(!fs[_0x2f71('0x1e')](path[_0x2f71('0x1f')](_0x4f5e65,_0x431fd9))&&_0x2ef86c){fs['mkdirSync'](path['join'](_0x4f5e65,_0x431fd9));}return BPromise[_0x2f71('0x20')](_0x16501e,function(_0xe44121){_0x5822aa[_0x2f71('0x19')](_0xe44121);})['then'](function(){for(var _0x30db7f=0x0;_0x30db7f<_0x5822aa[_0x2f71('0x17')];_0x30db7f+=0x1){var _0x66c791;var _0x18dc65=_0x5822aa[_0x30db7f];if(_0x2ef86c){_0x66c791=path['join'](_0x4f5e65,_0x431fd9,util[_0x2f71('0xb')](_0x2f71('0x21'),_0x431fd9,_0x30db7f,_0x2f71('0x22')));}else{_0x66c791=path['join'](_0x4f5e65,util['format'](_0x2f71('0x23'),_0x431fd9,'xlsx'));}fs[_0x2f71('0x24')](_0x66c791,json2xls(_0x18dc65),_0x2f71('0x25'));}})[_0x2f71('0x12')](function(){if(_0x2ef86c){return new Promise(function(_0x5d3171){zipdir(path[_0x2f71('0x1f')](_0x4f5e65,_0x431fd9),{'saveTo':path[_0x2f71('0x1f')](_0x4f5e65,util['format']('%s.%s',_0x431fd9,_0x2f71('0x26')))},function(_0xde9ec0,_0x5787dd){rimraf(path[_0x2f71('0x1f')](_0x4f5e65,_0x431fd9),function(){});_0x5d3171('zip\x20finished');});});}})[_0x2f71('0x12')](function(){logger['info'](util['format'](_0x2f71('0x27'),EXTRACTED_REPORT_ID,_0x2f71('0xd')));return analyticExtractedReport(_0x2f71('0x28'),_0x2ef86c?util[_0x2f71('0xb')](_0x2f71('0x23'),_0x431fd9,_0x2ef86c?'zip':_0x2f71('0x22')):null);});})['catch'](function(_0x4deaed){logger['info'](util[_0x2f71('0xb')](_0x2f71('0x29'),EXTRACTED_REPORT_ID,_0x2f71('0xd')),util[_0x2f71('0x2a')](_0x4deaed,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x2f71('0x2b')](function(){process[_0x2f71('0x2c')](EXIT_CODE);});}main();
\ No newline at end of file
index d98f28a..754c1d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2538=['extensions','find','type','CDR(type)=%s','VoiceExtensionId','inbound','push','Set','CDR(routeid)=','outbound','CDR(destination)=','extension','cutdigits','${EXTEN:','${EXTEN}','context','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','destroy','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','priority'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x2538,0xc0));var _0x8253=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0x2538[_0x609988];return _0x159984;};'use strict';var _=require(_0x8253('0x0'));var util=require(_0x8253('0x1'));function rewrite(_0x492f97,_0x81cd78){var _0x599865=this;return _0x492f97[_0x8253('0x2')][_0x8253('0x3')][_0x8253('0x4')]({'raw':!![]})['then'](function(_0x9f9370){_0x599865['intervals']=_0x9f9370;return _0x492f97[_0x8253('0x2')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x81cd78['IntervalId']},'raw':!![]});})[_0x8253('0x5')](function(_0x15e2b8){return _0x492f97['models'][_0x8253('0x6')][_0x8253('0x4')]({'where':{'exten':{'$in':_[_0x8253('0x7')](_[_0x8253('0x8')](_0x15e2b8,_0x8253('0x9')))}},'order':[{'raw':_0x8253('0xa')}],'raw':!![]});})[_0x8253('0x5')](function(_0x1bf78d){var _0x1c9953=_[_0x8253('0xb')](_0x1bf78d,{'priority':'1'});var _0x7fca33=_[_0x8253('0xb')](_0x1bf78d,{'isApp':0x1});var _0x4ec794=_[_0x8253('0xc')](_0x7fca33,_0x8253('0x9'));var _0x4efd4a=['queue',_0x8253('0xd')];var _0x469207=[];var _0x38d40c=[];for(var _0x391197 in _0x4ec794){if(_0x4ec794['hasOwnProperty'](_0x391197)){_0x599865[_0x8253('0xe')]=0x2;_0x599865[_0x8253('0xf')]=[];_0x599865['extension']=_[_0x8253('0x10')](_0x1c9953,{'exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')]});_0x599865[_0x8253('0xf')]['push']({'type':_0x4ec794[_0x391197][0x0][_0x8253('0x11')],'app':'Set','appdata':util['format'](_0x8253('0x12'),_0x4ec794[_0x391197][0x0][_0x8253('0x11')]),'context':_0x4ec794[_0x391197][0x0]['context'],'exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')],'priority':_0x599865['priority']++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});if(_0x4ec794[_0x391197][0x0][_0x8253('0x11')]===_0x8253('0x14')){_0x599865[_0x8253('0xf')][_0x8253('0x15')]({'type':_0x4ec794[_0x391197][0x0][_0x8253('0x11')],'app':_0x8253('0x16'),'appdata':_0x8253('0x17')+_0x4ec794[_0x391197][0x0]['VoiceExtensionId'],'context':_0x4ec794[_0x391197][0x0]['context'],'exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')],'priority':_0x599865[_0x8253('0xe')]++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});}else if(_0x4ec794[_0x391197][0x0]['type']===_0x8253('0x18')){if(_0x599865['extension']){_0x599865[_0x8253('0xf')][_0x8253('0x15')]({'type':_0x4ec794[_0x391197][0x0][_0x8253('0x11')],'app':_0x8253('0x16'),'appdata':_0x8253('0x19')+(_0x599865[_0x8253('0x1a')][_0x8253('0x1b')]?_0x8253('0x1c')+_0x599865[_0x8253('0x1a')][_0x8253('0x1b')]+'}':_0x8253('0x1d')),'context':_0x4ec794[_0x391197][0x0][_0x8253('0x1e')],'exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')],'priority':_0x599865[_0x8253('0xe')]++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});}_0x599865[_0x8253('0xf')][_0x8253('0x15')]({'type':_0x4ec794[_0x391197][0x0][_0x8253('0x11')],'app':_0x8253('0x16'),'appdata':_0x8253('0x17')+_0x4ec794[_0x391197][0x0]['VoiceExtensionId'],'context':_0x4ec794[_0x391197][0x0]['context'],'exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')],'priority':_0x599865['priority']++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});var _0x3d9adc=_0x599865[_0x8253('0xe')]++;_0x599865[_0x8253('0xf')]['push']({'type':_0x4ec794[_0x391197][0x0]['type'],'app':'ExecIf','appdata':_0x8253('0x1f')+(_0x3d9adc+0x2)+_0x8253('0x20')+(_0x3d9adc+0x1)+')','context':_0x4ec794[_0x391197][0x0][_0x8253('0x1e')],'exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')],'priority':_0x3d9adc,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});if(_0x599865[_0x8253('0x1a')]){_0x599865['extensions'][_0x8253('0x15')]({'type':_0x4ec794[_0x391197][0x0][_0x8253('0x11')],'app':'Set','appdata':_0x599865['extension'][_0x8253('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x599865['extension'][_0x8253('0x1b')]+'}':_0x8253('0x21'),'context':_0x4ec794[_0x391197][0x0]['context'],'exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')],'priority':_0x599865['priority']++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});}_0x599865[_0x8253('0xf')][_0x8253('0x15')]({'type':_0x4ec794[_0x391197][0x0][_0x8253('0x11')],'app':'Set','appdata':_0x8253('0x22')+_0x4ec794[_0x391197][0x0][_0x8253('0x13')],'context':_0x4ec794[_0x391197][0x0]['context'],'exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')],'priority':_0x599865['priority']++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});if(_0x599865[_0x8253('0x1a')]&&_0x599865[_0x8253('0x1a')][_0x8253('0x23')]('recordingFormat')&&_0x599865['extension'][_0x8253('0x24')]!==_0x8253('0x25')){_0x599865[_0x8253('0xf')][_0x8253('0x15')]({'type':_0x4ec794[_0x391197][0x0][_0x8253('0x11')],'app':_0x8253('0x16'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4ec794[_0x391197][0x0][_0x8253('0x1e')],'exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')],'priority':_0x599865['priority']++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});_0x599865[_0x8253('0xf')][_0x8253('0x15')]({'type':_0x4ec794[_0x391197][0x0]['type'],'app':_0x8253('0x16'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x599865['extension'][_0x8253('0x24')]||_0x8253('0x26'),'context':_0x4ec794[_0x391197][0x0]['context'],'exten':_0x4ec794[_0x391197][0x0]['exten'],'priority':_0x599865[_0x8253('0xe')]++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});}}_0x599865['extensions'][_0x8253('0x15')]({'type':_0x4ec794[_0x391197][0x0]['type'],'app':'Set','appdata':_0x8253('0x27'),'context':_0x4ec794[_0x391197][0x0][_0x8253('0x1e')],'exten':_0x4ec794[_0x391197][0x0]['exten'],'priority':_0x599865[_0x8253('0xe')]++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});_0x599865[_0x8253('0xf')]['push']({'type':_0x4ec794[_0x391197][0x0][_0x8253('0x11')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4ec794[_0x391197][0x0][_0x8253('0x1e')],'exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')],'priority':_0x599865[_0x8253('0xe')]++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});_0x599865[_0x8253('0xf')]['push']({'type':_0x4ec794[_0x391197][0x0][_0x8253('0x11')],'app':'Set','appdata':_0x8253('0x28'),'context':_0x4ec794[_0x391197][0x0][_0x8253('0x1e')],'exten':_0x4ec794[_0x391197][0x0]['exten'],'priority':_0x599865[_0x8253('0xe')]++,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});for(var _0x3f7f8a=0x0,_0x355c76=0x0;_0x3f7f8a<_0x4ec794[_0x391197][_0x8253('0x29')];_0x3f7f8a+=0x1,_0x355c76=0x0){var _0x40270d=_0x4ec794[_0x391197][_0x3f7f8a];if(_0x40270d['type']){_0x40270d[_0x8253('0x11')]=_0x40270d['type'][_0x8253('0x2a')]();}var _0x635496=[];var _0x30b82c=[];delete _0x40270d['id'];delete _0x40270d['createdAt'];delete _0x40270d[_0x8253('0x2b')];var _0x4ada1a=_0x40270d[_0x8253('0x2c')]!==_0x8253('0x2d')?[_0x40270d[_0x8253('0x2c')]]:_0x40270d[_0x8253('0x2e')]?_[_0x8253('0x8')](_[_0x8253('0xb')](_0x599865['intervals'],{'IntervalId':_0x40270d[_0x8253('0x2e')]}),_0x8253('0x2c')):[];if(_0x40270d[_0x8253('0x23')](_0x8253('0x2f'))){if(_0x40270d[_0x8253('0x2f')]&&_0x40270d[_0x8253('0x2f')]!=='--'){_0x635496['push']({'type':_0x40270d['type'],'app':_0x8253('0x16'),'appdata':_0x8253('0x30')+_0x40270d[_0x8253('0x2f')],'context':_0x40270d[_0x8253('0x1e')],'exten':_0x40270d[_0x8253('0x9')],'priority':_0x4ada1a[_0x8253('0x29')]+_0x599865['priority']+_0x355c76++,'VoiceExtensionId':_0x40270d[_0x8253('0x13')]});}}if(_0x40270d['type']===_0x8253('0x18')&&_0x40270d[_0x8253('0x23')]('callerID')){if(_0x40270d['callerID']){_0x635496[_0x8253('0x15')]({'type':_0x40270d[_0x8253('0x11')],'app':_0x8253('0x31'),'appdata':_0x8253('0x32')+_0x40270d[_0x8253('0x33')]+')','context':_0x40270d['context'],'exten':_0x40270d[_0x8253('0x9')],'priority':_0x4ada1a[_0x8253('0x29')]+_0x599865[_0x8253('0xe')]+_0x355c76++,'VoiceExtensionId':_0x40270d[_0x8253('0x13')]});}else{_0x635496[_0x8253('0x15')]({'type':_0x40270d[_0x8253('0x11')],'app':_0x8253('0x31'),'appdata':_0x8253('0x34'),'context':_0x40270d[_0x8253('0x1e')],'exten':_0x40270d['exten'],'priority':_0x4ada1a[_0x8253('0x29')]+_0x599865[_0x8253('0xe')]+_0x355c76++,'VoiceExtensionId':_0x40270d[_0x8253('0x13')]});}}if(_0x40270d[_0x8253('0x23')]('answer')){if(_0x4efd4a[_0x8253('0x35')](_0x40270d[_0x8253('0x36')][_0x8253('0x2a')]())>=0x0&&_0x40270d[_0x8253('0x37')]!=='custom'){if(_0x40270d[_0x8253('0x38')]){_0x635496['push']({'type':_0x40270d[_0x8253('0x11')],'app':_0x8253('0x31'),'appdata':_0x8253('0x39'),'context':_0x40270d[_0x8253('0x1e')],'exten':_0x40270d['exten'],'priority':_0x4ada1a[_0x8253('0x29')]+_0x599865[_0x8253('0xe')]+_0x355c76++,'VoiceExtensionId':_0x40270d[_0x8253('0x13')]});_0x635496['push']({'type':_0x40270d['type'],'app':_0x8253('0x16'),'appdata':_0x8253('0x3a'),'context':_0x40270d[_0x8253('0x1e')],'exten':_0x40270d[_0x8253('0x9')],'priority':_0x4ada1a['length']+_0x599865['priority']+_0x355c76++,'VoiceExtensionId':_0x40270d[_0x8253('0x13')]});}else{_0x635496[_0x8253('0x15')]({'type':_0x40270d['type'],'app':'ExecIf','appdata':_0x8253('0x3b'),'context':_0x40270d['context'],'exten':_0x40270d[_0x8253('0x9')],'priority':_0x4ada1a[_0x8253('0x29')]+_0x599865[_0x8253('0xe')]+_0x355c76++,'VoiceExtensionId':_0x40270d[_0x8253('0x13')]});_0x635496[_0x8253('0x15')]({'type':_0x40270d[_0x8253('0x11')],'app':_0x8253('0x16'),'appdata':_0x8253('0x3c'),'context':_0x40270d[_0x8253('0x1e')],'exten':_0x40270d[_0x8253('0x9')],'priority':_0x4ada1a['length']+_0x599865[_0x8253('0xe')]+_0x355c76++,'VoiceExtensionId':_0x40270d['VoiceExtensionId']});}}}for(var _0x42dae2=0x0;_0x42dae2<_0x4ada1a['length'];_0x42dae2+=0x1){var _0x4290b=_0x599865[_0x8253('0xe')]+_0x4ada1a[_0x8253('0x29')];var _0x25e2e1=_0x42dae2===_0x4ada1a[_0x8253('0x29')]-0x1?_0x599865['priority']+_0x635496[_0x8253('0x29')]+_0x30b82c[_0x8253('0x29')]+0x2:_0x599865[_0x8253('0xe')]+_0x42dae2+0x1;_0x635496[_0x8253('0x3d')](_0x42dae2,0x0,{'type':_0x40270d[_0x8253('0x11')],'app':_0x8253('0x3e'),'appdata':_0x4ada1a[_0x42dae2]+'?'+_0x40270d[_0x8253('0x1e')]+_0x8253('0x3f')+_0x4290b+':'+_0x40270d[_0x8253('0x1e')]+_0x8253('0x3f')+_0x25e2e1,'exten':_0x40270d[_0x8253('0x9')],'context':_0x40270d[_0x8253('0x1e')],'priority':_0x599865[_0x8253('0xe')]+_0x42dae2,'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});}_0x40270d[_0x8253('0xe')]=_0x635496[_0x8253('0x29')]?_[_0x8253('0x40')](_0x635496)[_0x8253('0xe')]+0x1:_0x599865[_0x8253('0xe')];_0x599865[_0x8253('0xe')]=(_0x30b82c[_0x8253('0x29')]?_[_0x8253('0x40')](_0x30b82c)['priority']:_0x40270d[_0x8253('0xe')])+0x1;_0x599865[_0x8253('0xf')]=_[_0x8253('0x41')](_0x599865[_0x8253('0xf')],_0x635496,[_0x40270d],_0x30b82c);}_0x599865[_0x8253('0xf')]['push']({'type':_0x4ec794[_0x391197][0x0][_0x8253('0x11')],'app':'Hangup','exten':_0x4ec794[_0x391197][0x0][_0x8253('0x9')],'context':_0x4ec794[_0x391197][0x0][_0x8253('0x1e')],'priority':_0x599865[_0x8253('0xe')],'VoiceExtensionId':_0x4ec794[_0x391197][0x0][_0x8253('0x13')]});_0x469207['push'](_0x4ec794[_0x391197][0x0][_0x8253('0x13')]);_0x38d40c=_[_0x8253('0x41')](_0x38d40c,_0x599865[_0x8253('0xf')]);}}return _0x492f97['transaction'](function(_0x271cb6){return _0x492f97[_0x8253('0x2')][_0x8253('0x6')][_0x8253('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x469207}},'transaction':_0x271cb6})[_0x8253('0x5')](function(_0x237b35){return _0x492f97[_0x8253('0x2')][_0x8253('0x6')]['bulkCreate'](_['sortBy'](_0x38d40c,'priority'),{'transaction':_0x271cb6});});});})['catch'](function(_0x31b8f6){console[_0x8253('0x43')](_0x31b8f6);});}exports[_0x8253('0x44')]=rewrite;
\ No newline at end of file
+var _0x4aa6=['extensions','extension','find','push','type','Set','format','priority','VoiceExtensionId','inbound','context','outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','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','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','Hangup','concat','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x4aa6,0x135));var _0x64aa=function(_0x4b9da0,_0xd5fb11){_0x4b9da0=_0x4b9da0-0x0;var _0x34a6fc=_0x4aa6[_0x4b9da0];return _0x34a6fc;};'use strict';var _=require(_0x64aa('0x0'));var util=require(_0x64aa('0x1'));function rewrite(_0x5680a7,_0x2c2b9c){var _0x1575b8=this;return _0x5680a7[_0x64aa('0x2')][_0x64aa('0x3')][_0x64aa('0x4')]({'raw':!![]})[_0x64aa('0x5')](function(_0x4f268c){_0x1575b8[_0x64aa('0x6')]=_0x4f268c;return _0x5680a7[_0x64aa('0x2')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x2c2b9c[_0x64aa('0x7')]},'raw':!![]});})[_0x64aa('0x5')](function(_0x4e0dcd){return _0x5680a7[_0x64aa('0x2')][_0x64aa('0x8')][_0x64aa('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x64aa('0x9')](_0x4e0dcd,_0x64aa('0xa')))}},'order':[{'raw':_0x64aa('0xb')}],'raw':!![]});})[_0x64aa('0x5')](function(_0x41a33b){var _0x4f3b7d=_['filter'](_0x41a33b,{'priority':'1'});var _0x447322=_[_0x64aa('0xc')](_0x41a33b,{'isApp':0x1});var _0x20d918=_[_0x64aa('0xd')](_0x447322,_0x64aa('0xa'));var _0x1b24af=[_0x64aa('0xe'),'playback'];var _0x3b66a6=[];var _0x3bec42=[];for(var _0x588f78 in _0x20d918){if(_0x20d918[_0x64aa('0xf')](_0x588f78)){_0x1575b8['priority']=0x2;_0x1575b8[_0x64aa('0x10')]=[];_0x1575b8[_0x64aa('0x11')]=_[_0x64aa('0x12')](_0x4f3b7d,{'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')]});_0x1575b8[_0x64aa('0x10')][_0x64aa('0x13')]({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':_0x64aa('0x15'),'appdata':util[_0x64aa('0x16')]('CDR(type)=%s',_0x20d918[_0x588f78][0x0][_0x64aa('0x14')]),'context':_0x20d918[_0x588f78][0x0]['context'],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x1575b8[_0x64aa('0x17')]++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});if(_0x20d918[_0x588f78][0x0][_0x64aa('0x14')]===_0x64aa('0x19')){_0x1575b8[_0x64aa('0x10')]['push']({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':'Set','appdata':'CDR(routeid)='+_0x20d918[_0x588f78][0x0][_0x64aa('0x18')],'context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x1575b8[_0x64aa('0x17')]++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});}else if(_0x20d918[_0x588f78][0x0][_0x64aa('0x14')]===_0x64aa('0x1b')){if(_0x1575b8[_0x64aa('0x11')]){_0x1575b8[_0x64aa('0x10')][_0x64aa('0x13')]({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':_0x64aa('0x15'),'appdata':_0x64aa('0x1c')+(_0x1575b8['extension'][_0x64aa('0x1d')]?_0x64aa('0x1e')+_0x1575b8['extension'][_0x64aa('0x1d')]+'}':'${EXTEN}'),'context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x1575b8[_0x64aa('0x17')]++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});}_0x1575b8[_0x64aa('0x10')][_0x64aa('0x13')]({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':_0x64aa('0x15'),'appdata':_0x64aa('0x1f')+_0x20d918[_0x588f78][0x0][_0x64aa('0x18')],'context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x1575b8[_0x64aa('0x17')]++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});var _0x2786ae=_0x1575b8[_0x64aa('0x17')]++;_0x1575b8[_0x64aa('0x10')][_0x64aa('0x13')]({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':_0x64aa('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2786ae+0x2)+'):Goto('+(_0x2786ae+0x1)+')','context':_0x20d918[_0x588f78][0x0]['context'],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x2786ae,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});if(_0x1575b8['extension']){_0x1575b8[_0x64aa('0x10')][_0x64aa('0x13')]({'type':_0x20d918[_0x588f78][0x0]['type'],'app':_0x64aa('0x15'),'appdata':_0x1575b8[_0x64aa('0x11')][_0x64aa('0x1d')]?'CDR(prefix)=${EXTEN:0:'+_0x1575b8[_0x64aa('0x11')][_0x64aa('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x1575b8[_0x64aa('0x17')]++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0]['VoiceExtensionId']});}_0x1575b8[_0x64aa('0x10')]['push']({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':'Set','appdata':'outboundrouteid='+_0x20d918[_0x588f78][0x0]['VoiceExtensionId'],'context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x1575b8[_0x64aa('0x17')]++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});if(_0x1575b8[_0x64aa('0x11')]&&_0x1575b8[_0x64aa('0x11')][_0x64aa('0xf')](_0x64aa('0x21'))&&_0x1575b8[_0x64aa('0x11')][_0x64aa('0x21')]!=='none'){_0x1575b8[_0x64aa('0x10')][_0x64aa('0x13')]({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':'Set','appdata':_0x64aa('0x22'),'context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'exten':_0x20d918[_0x588f78][0x0]['exten'],'priority':_0x1575b8[_0x64aa('0x17')]++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});_0x1575b8['extensions'][_0x64aa('0x13')]({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':_0x64aa('0x15'),'appdata':_0x64aa('0x23')+_0x1575b8[_0x64aa('0x11')][_0x64aa('0x21')]||_0x64aa('0x24'),'context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x1575b8[_0x64aa('0x17')]++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});}}_0x1575b8[_0x64aa('0x10')][_0x64aa('0x13')]({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':'Set','appdata':_0x64aa('0x25'),'context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x1575b8[_0x64aa('0x17')]++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});_0x1575b8[_0x64aa('0x10')]['push']({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x1575b8[_0x64aa('0x17')]++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});_0x1575b8['extensions'][_0x64aa('0x13')]({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':'Set','appdata':_0x64aa('0x26'),'context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'priority':_0x1575b8['priority']++,'VoiceExtensionId':_0x20d918[_0x588f78][0x0]['VoiceExtensionId']});for(var _0x2a166e=0x0,_0x319060=0x0;_0x2a166e<_0x20d918[_0x588f78][_0x64aa('0x27')];_0x2a166e+=0x1,_0x319060=0x0){var _0x3c385f=_0x20d918[_0x588f78][_0x2a166e];if(_0x3c385f[_0x64aa('0x14')]){_0x3c385f['type']=_0x3c385f[_0x64aa('0x14')][_0x64aa('0x28')]();}var _0x349add=[];var _0x153c25=[];delete _0x3c385f['id'];delete _0x3c385f[_0x64aa('0x29')];delete _0x3c385f[_0x64aa('0x2a')];var _0x35fee8=_0x3c385f[_0x64aa('0x2b')]!=='*,*,*,*'?[_0x3c385f['interval']]:_0x3c385f[_0x64aa('0x7')]?_[_0x64aa('0x9')](_[_0x64aa('0xc')](_0x1575b8[_0x64aa('0x6')],{'IntervalId':_0x3c385f['IntervalId']}),'interval'):[];if(_0x3c385f[_0x64aa('0xf')](_0x64aa('0x2c'))){if(_0x3c385f[_0x64aa('0x2c')]&&_0x3c385f['tag']!=='--'){_0x349add[_0x64aa('0x13')]({'type':_0x3c385f[_0x64aa('0x14')],'app':'Set','appdata':'CDR(tag)='+_0x3c385f['tag'],'context':_0x3c385f[_0x64aa('0x1a')],'exten':_0x3c385f[_0x64aa('0xa')],'priority':_0x35fee8[_0x64aa('0x27')]+_0x1575b8[_0x64aa('0x17')]+_0x319060++,'VoiceExtensionId':_0x3c385f[_0x64aa('0x18')]});}}if(_0x3c385f[_0x64aa('0x14')]===_0x64aa('0x1b')&&_0x3c385f[_0x64aa('0xf')](_0x64aa('0x2d'))){if(_0x3c385f['callerID']){_0x349add[_0x64aa('0x13')]({'type':_0x3c385f[_0x64aa('0x14')],'app':'ExecIf','appdata':_0x64aa('0x2e')+_0x3c385f['callerID']+')','context':_0x3c385f[_0x64aa('0x1a')],'exten':_0x3c385f[_0x64aa('0xa')],'priority':_0x35fee8[_0x64aa('0x27')]+_0x1575b8[_0x64aa('0x17')]+_0x319060++,'VoiceExtensionId':_0x3c385f['VoiceExtensionId']});}else{_0x349add['push']({'type':_0x3c385f[_0x64aa('0x14')],'app':_0x64aa('0x20'),'appdata':_0x64aa('0x2f'),'context':_0x3c385f[_0x64aa('0x1a')],'exten':_0x3c385f[_0x64aa('0xa')],'priority':_0x35fee8[_0x64aa('0x27')]+_0x1575b8[_0x64aa('0x17')]+_0x319060++,'VoiceExtensionId':_0x3c385f[_0x64aa('0x18')]});}}if(_0x3c385f[_0x64aa('0xf')](_0x64aa('0x30'))){if(_0x1b24af['indexOf'](_0x3c385f[_0x64aa('0x31')][_0x64aa('0x28')]())>=0x0&&_0x3c385f[_0x64aa('0x32')]!==_0x64aa('0x33')){if(_0x3c385f['answer']){_0x349add[_0x64aa('0x13')]({'type':_0x3c385f[_0x64aa('0x14')],'app':_0x64aa('0x20'),'appdata':_0x64aa('0x34'),'context':_0x3c385f[_0x64aa('0x1a')],'exten':_0x3c385f['exten'],'priority':_0x35fee8[_0x64aa('0x27')]+_0x1575b8[_0x64aa('0x17')]+_0x319060++,'VoiceExtensionId':_0x3c385f[_0x64aa('0x18')]});_0x349add[_0x64aa('0x13')]({'type':_0x3c385f[_0x64aa('0x14')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x3c385f[_0x64aa('0x1a')],'exten':_0x3c385f['exten'],'priority':_0x35fee8['length']+_0x1575b8[_0x64aa('0x17')]+_0x319060++,'VoiceExtensionId':_0x3c385f[_0x64aa('0x18')]});}else{_0x349add[_0x64aa('0x13')]({'type':_0x3c385f[_0x64aa('0x14')],'app':'ExecIf','appdata':_0x64aa('0x35'),'context':_0x3c385f[_0x64aa('0x1a')],'exten':_0x3c385f[_0x64aa('0xa')],'priority':_0x35fee8[_0x64aa('0x27')]+_0x1575b8[_0x64aa('0x17')]+_0x319060++,'VoiceExtensionId':_0x3c385f[_0x64aa('0x18')]});_0x349add[_0x64aa('0x13')]({'type':_0x3c385f['type'],'app':_0x64aa('0x15'),'appdata':_0x64aa('0x36'),'context':_0x3c385f[_0x64aa('0x1a')],'exten':_0x3c385f[_0x64aa('0xa')],'priority':_0x35fee8['length']+_0x1575b8[_0x64aa('0x17')]+_0x319060++,'VoiceExtensionId':_0x3c385f[_0x64aa('0x18')]});}}}for(var _0x1166a9=0x0;_0x1166a9<_0x35fee8[_0x64aa('0x27')];_0x1166a9+=0x1){var _0x178f28=_0x1575b8['priority']+_0x35fee8['length'];var _0x51ebef=_0x1166a9===_0x35fee8[_0x64aa('0x27')]-0x1?_0x1575b8[_0x64aa('0x17')]+_0x349add['length']+_0x153c25[_0x64aa('0x27')]+0x2:_0x1575b8[_0x64aa('0x17')]+_0x1166a9+0x1;_0x349add['splice'](_0x1166a9,0x0,{'type':_0x3c385f[_0x64aa('0x14')],'app':'GotoIfTime','appdata':_0x35fee8[_0x1166a9]+'?'+_0x3c385f['context']+_0x64aa('0x37')+_0x178f28+':'+_0x3c385f[_0x64aa('0x1a')]+_0x64aa('0x37')+_0x51ebef,'exten':_0x3c385f[_0x64aa('0xa')],'context':_0x3c385f[_0x64aa('0x1a')],'priority':_0x1575b8['priority']+_0x1166a9,'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});}_0x3c385f[_0x64aa('0x17')]=_0x349add[_0x64aa('0x27')]?_['last'](_0x349add)['priority']+0x1:_0x1575b8[_0x64aa('0x17')];_0x1575b8[_0x64aa('0x17')]=(_0x153c25['length']?_[_0x64aa('0x38')](_0x153c25)[_0x64aa('0x17')]:_0x3c385f['priority'])+0x1;_0x1575b8[_0x64aa('0x10')]=_['concat'](_0x1575b8[_0x64aa('0x10')],_0x349add,[_0x3c385f],_0x153c25);}_0x1575b8['extensions']['push']({'type':_0x20d918[_0x588f78][0x0][_0x64aa('0x14')],'app':_0x64aa('0x39'),'exten':_0x20d918[_0x588f78][0x0][_0x64aa('0xa')],'context':_0x20d918[_0x588f78][0x0][_0x64aa('0x1a')],'priority':_0x1575b8[_0x64aa('0x17')],'VoiceExtensionId':_0x20d918[_0x588f78][0x0][_0x64aa('0x18')]});_0x3b66a6[_0x64aa('0x13')](_0x20d918[_0x588f78][0x0]['VoiceExtensionId']);_0x3bec42=_[_0x64aa('0x3a')](_0x3bec42,_0x1575b8[_0x64aa('0x10')]);}}return _0x5680a7[_0x64aa('0x3b')](function(_0x5d1352){return _0x5680a7['models']['VoiceExtension'][_0x64aa('0x3c')]({'where':{'VoiceExtensionId':{'$in':_0x3b66a6}},'transaction':_0x5d1352})[_0x64aa('0x5')](function(_0x26eb24){return _0x5680a7[_0x64aa('0x2')][_0x64aa('0x8')]['bulkCreate'](_[_0x64aa('0x3d')](_0x3bec42,_0x64aa('0x17')),{'transaction':_0x5d1352});});});})[_0x64aa('0x3e')](function(_0x4f5105){console[_0x64aa('0x3f')](_0x4f5105);});}exports[_0x64aa('0x40')]=rewrite;
\ No newline at end of file
index 4899b6c..35d3396 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e22=['always','push','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','ioredis','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','Missing\x20filepath\x20parameter!','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','CmContact','create','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get'];(function(_0x5d23c8,_0x5c46dc){var _0x509479=function(_0xfc77cd){while(--_0xfc77cd){_0x5d23c8['push'](_0x5d23c8['shift']());}};_0x509479(++_0x5c46dc);}(_0x5e22,0xfa));var _0x25e2=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x5e22[_0x5cb1af];return _0x8d7940;};'use strict';var BPromise=require(_0x25e2('0x0'));var util=require(_0x25e2('0x1'));var _=require(_0x25e2('0x2'));var fs=require('fs');var squel=require(_0x25e2('0x3'));var Papa=require('papaparse');var Redis=require(_0x25e2('0x4'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x25e2('0x5'))(_0x25e2('0x6'));config[_0x25e2('0x7')]=_[_0x25e2('0x8')](config[_0x25e2('0x7')],{'host':_0x25e2('0x9'),'port':0x18eb});var socket=require(_0x25e2('0xa'))(new Redis(config['redis']));require(_0x25e2('0xb'))['register'](socket);try{if(!process[_0x25e2('0xc')][0x2]||process['argv'][0x2]==='undefined'||process['argv'][0x2]==='null'){throw new Error(_0x25e2('0xd'));}var FILEPATH=process[_0x25e2('0xc')][0x2];if(!process[_0x25e2('0xc')][0x3]||process[_0x25e2('0xc')][0x3]===_0x25e2('0xe')||process[_0x25e2('0xc')][0x3]===_0x25e2('0xf')||!process[_0x25e2('0xc')][0x4]||process['argv'][0x4]===_0x25e2('0xe')||process[_0x25e2('0xc')][0x4]==='null'){throw new Error(_0x25e2('0x10'));}var FIELDS=_[_0x25e2('0x11')](process[_0x25e2('0xc')][0x3][_0x25e2('0x12')](','),process[_0x25e2('0xc')][0x4][_0x25e2('0x12')](','));if(!process['argv'][0x5]||process[_0x25e2('0xc')][0x5]===_0x25e2('0xe')||process['argv'][0x5]===_0x25e2('0xf')){throw new Error(_0x25e2('0x13'));}var LISTID=process[_0x25e2('0xc')][0x5];var COMPANYID=process[_0x25e2('0xc')][0x6]&&process[_0x25e2('0xc')][0x6]!==_0x25e2('0xe')&&process[_0x25e2('0xc')][0x6]!==_0x25e2('0xf')?process[_0x25e2('0xc')][0x6]:null;var DUPLICATES=process[_0x25e2('0xc')][0x7]&&process[_0x25e2('0xc')][0x7]!==_0x25e2('0xe')&&process['argv'][0x7]!=='null'?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x25e2('0xc')][0x8]===_0x25e2('0xe')||process['argv'][0x8]===_0x25e2('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x25e2('0xc')][0x8];}catch(_0x255ca1){logger[_0x25e2('0x14')](_0x255ca1);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(_0x58b3ba,_0x2c3b10,_0x3e11b4,_0x19e089){var _0x2fedc9={'message':_0x2c3b10};_0x2fedc9[_0x58b3ba]=!![];if(_0x3e11b4){_0x2fedc9[_0x25e2('0x15')]=_0x3e11b4;}if(_0x19e089){_0x2fedc9['index']=_0x19e089;}return _0x2fedc9;}function isEmail(_0x2aac60){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))*$/[_0x25e2('0x16')](_0x2aac60);}function checkRow(_0x1c9d62,_0x780d15,_0x4c323c){return new BPromise(function(_0x29aede,_0x13c2bf){if(_[_0x25e2('0x17')](_0x1c9d62)){return _0x13c2bf(handleCheckRowError(_0x25e2('0x14'),_0x25e2('0x18'),null,_0x4c323c));}if(_0x1c9d62[_0x25e2('0x19')]&&_0x1c9d62[_0x25e2('0x19')]['length']){var _0x2f7445=_[_0x25e2('0x1a')](_0x1c9d62[_0x25e2('0x19')],_0x25e2('0x1b'))[_0x25e2('0x1c')](';');return _0x13c2bf(handleCheckRowError('error',_0x2f7445,null,_0x4c323c));}var _0x5411d6={};for(var _0x1e51ae in FIELDS){if(FIELDS['hasOwnProperty'](_0x1e51ae)&&FIELDS[_0x1e51ae]){_0x5411d6[_0x1e51ae]=_0x1c9d62[_0x25e2('0x1d')][0x0][FIELDS[_0x1e51ae]]||_0x1c9d62[_0x25e2('0x1d')][0x0]['\ufeff'+FIELDS[_0x1e51ae]];}}if(!_0x5411d6[_0x25e2('0x1e')]){return _0x13c2bf(handleCheckRowError('error',_0x25e2('0x1f'),null,_0x4c323c));}if(!_0x5411d6[_0x25e2('0x20')]){return _0x13c2bf(handleCheckRowError(_0x25e2('0x14'),_0x25e2('0x21'),null,_0x4c323c));}if(_0x5411d6['birthDate']){var _0xfe885=moment(_0x5411d6[_0x25e2('0x22')],_0x25e2('0x23'));if(!_0xfe885['isValid']()){return _0x13c2bf(handleCheckRowError(_0x25e2('0x14'),_0x25e2('0x24'),null,_0x4c323c));}}if(_0x5411d6[_0x25e2('0x25')]){if(!isEmail(_0x5411d6[_0x25e2('0x25')])){return _0x13c2bf(handleCheckRowError(_0x25e2('0x14'),_0x25e2('0x26'),null,_0x4c323c));}}_0x5411d6[_0x25e2('0x27')]=LISTID;_0x5411d6[_0x25e2('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x780d15){var _0x467050={};for(var _0x1d6a6=0x0,_0x1bd90f=DUPLICATES[_0x25e2('0x29')];_0x1d6a6<_0x1bd90f;_0x1d6a6+=0x1){_0x467050[DUPLICATES[_0x1d6a6]]=_0x5411d6[DUPLICATES[_0x1d6a6]];}var _0x7cdee5=_[_0x25e2('0x2a')](_0x780d15,_0x467050);if(_0x7cdee5){return _0x13c2bf(handleCheckRowError(_0x25e2('0x2b'),'Duplicate\x20Contact',_0x7cdee5,_0x4c323c));}}return db[_0x25e2('0x2c')][_0x25e2('0x2d')](_0x5411d6,{'raw':!![],'hooks':![],'fields':_[_0x25e2('0x2e')](_0x5411d6)})[_0x25e2('0x2f')](function(_0x337761){if(DUPLICATES&&DUPLICATES['length']&&_0x780d15){_0x780d15['push'](_[_0x25e2('0x30')](_0x5411d6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x337761['id'];return _0x29aede();})[_0x25e2('0x31')](function(_0x3c1037){return _0x13c2bf(handleCheckRowError('error',_0x25e2('0x32')+(_0x3c1037[_0x25e2('0x1b')]||JSON['stringify'](_0x3c1037)),null,_0x4c323c));});});}function checkHopper(){function _0x50f47e(){return function(_0x247844){logger[_0x25e2('0x14')]('cmContact',_0x25e2('0x33'),util[_0x25e2('0x34')](_0x247844,{'showHidden':![],'depth':null}));};}var _0x481887=function(_0x52e5ea,_0x1d9741){var _0x59c5fb=squel[_0x25e2('0x35')]()[_0x25e2('0x36')](_0x25e2('0x37'))[_0x25e2('0x38')](['phone',_0x25e2('0x39'),_0x25e2('0x3a'),_0x25e2('0x27'),_0x1d9741,_0x25e2('0x3b'),_0x25e2('0x3c')],squel[_0x25e2('0x3d')]()['field'](_0x25e2('0x20'),'phone')[_0x25e2('0x3e')](_0x25e2('0x3f'),_0x25e2('0x39'))[_0x25e2('0x3e')]('id',_0x25e2('0x3a'))[_0x25e2('0x3e')](LISTID[_0x25e2('0x40')](),_0x25e2('0x27'))[_0x25e2('0x3e')](_0x52e5ea['id'][_0x25e2('0x40')](),_0x1d9741)[_0x25e2('0x3e')](_0x25e2('0x3f'),_0x25e2('0x3b'))[_0x25e2('0x3e')]('NOW()',_0x25e2('0x3c'))[_0x25e2('0x41')](_0x25e2('0x42'))[_0x25e2('0x43')](_0x25e2('0x44'))['where'](_0x25e2('0x45'),LISTID[_0x25e2('0x40')]())[_0x25e2('0x43')](_0x25e2('0x46'))[_0x25e2('0x43')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x25e2('0x3e')](_0x25e2('0x20'))[_0x25e2('0x41')](_0x25e2('0x37'))[_0x25e2('0x43')](_0x1d9741+_0x25e2('0x47'),_0x52e5ea['id'][_0x25e2('0x40')]())))['toString']();return _0x59c5fb;};var _0x2853d5=function(_0x43155f,_0x17422f){var _0x2c7779=squel[_0x25e2('0x35')]()[_0x25e2('0x36')]('cm_hopper')[_0x25e2('0x38')]([_0x25e2('0x20'),'scheduledAt','ContactId',_0x25e2('0x27'),_0x17422f,_0x25e2('0x3b'),'updatedAt'],squel[_0x25e2('0x3d')]()[_0x25e2('0x3e')]('phone','phone')['field']('NOW()',_0x25e2('0x39'))[_0x25e2('0x3e')]('id',_0x25e2('0x3a'))['field'](LISTID[_0x25e2('0x40')](),_0x25e2('0x27'))[_0x25e2('0x3e')](_0x43155f['id']['toString'](),_0x17422f)['field']('NOW()',_0x25e2('0x3b'))['field'](_0x25e2('0x3f'),_0x25e2('0x3c'))['from']('cm_contacts')[_0x25e2('0x43')](_0x25e2('0x44'))['where'](_0x25e2('0x45'),LISTID['toString']())[_0x25e2('0x43')](_0x25e2('0x48'),squel[_0x25e2('0x49')](hopperContacts))[_0x25e2('0x43')](_0x25e2('0x46'))[_0x25e2('0x43')](_0x25e2('0x4a'),squel['select']()[_0x25e2('0x3e')](_0x25e2('0x4b'))[_0x25e2('0x41')]('cm_hopper_final')['where'](_0x17422f+_0x25e2('0x47'),_0x43155f['id']['toString']()))['where'](_0x25e2('0x4a'),squel['select']()[_0x25e2('0x3e')](_0x25e2('0x20'))[_0x25e2('0x41')](_0x25e2('0x37'))[_0x25e2('0x43')](_0x17422f+'\x20=\x20?',_0x43155f['id']['toString']())))[_0x25e2('0x40')]();return _0x2c7779;};function _0x5781c1(_0x1d4e57,_0x4e2075){var _0x356962=squel['insert']()['into'](_0x25e2('0x37'))['fromQuery']([_0x25e2('0x20'),_0x25e2('0x39'),_0x25e2('0x3a'),_0x25e2('0x27'),_0x4e2075,'createdAt','updatedAt'],squel[_0x25e2('0x3d')]()[_0x25e2('0x3e')](_0x25e2('0x20'),_0x25e2('0x20'))['field']('NOW()',_0x25e2('0x39'))[_0x25e2('0x3e')]('id',_0x25e2('0x3a'))[_0x25e2('0x3e')](LISTID[_0x25e2('0x40')](),_0x25e2('0x27'))[_0x25e2('0x3e')](_0x1d4e57['id'][_0x25e2('0x40')](),_0x4e2075)[_0x25e2('0x3e')]('NOW()',_0x25e2('0x3b'))[_0x25e2('0x3e')](_0x25e2('0x3f'),_0x25e2('0x3c'))[_0x25e2('0x41')]('cm_contacts')[_0x25e2('0x43')](_0x25e2('0x44'))[_0x25e2('0x43')]('ListId\x20=\x20?',LISTID[_0x25e2('0x40')]())[_0x25e2('0x43')]('id\x20IN\x20?',squel[_0x25e2('0x49')](hopperContacts))['where'](_0x25e2('0x46')))[_0x25e2('0x40')]();return _0x356962;}function _0x2e0020(_0x295526,_0x23639b){var _0x45da74=squel[_0x25e2('0x35')]()['into'](_0x25e2('0x4c'))[_0x25e2('0x38')](['phone',_0x25e2('0x3a'),_0x25e2('0x27'),_0x23639b,_0x25e2('0x3b'),_0x25e2('0x3c')],squel[_0x25e2('0x3d')]()[_0x25e2('0x3e')]('phone',_0x25e2('0x20'))[_0x25e2('0x3e')]('id',_0x25e2('0x3a'))['field'](LISTID['toString'](),_0x25e2('0x27'))[_0x25e2('0x3e')](_0x295526['id'][_0x25e2('0x40')](),_0x23639b)['field'](_0x25e2('0x3f'),_0x25e2('0x3b'))['field'](_0x25e2('0x3f'),'updatedAt')[_0x25e2('0x41')](_0x25e2('0x42'))[_0x25e2('0x43')](_0x25e2('0x44'))[_0x25e2('0x43')](_0x25e2('0x45'),LISTID[_0x25e2('0x40')]())[_0x25e2('0x43')](_0x25e2('0x48'),squel[_0x25e2('0x49')](hopperContacts))[_0x25e2('0x43')](_0x25e2('0x46')))[_0x25e2('0x40')]();return _0x45da74;}return db[_0x25e2('0x4d')][_0x25e2('0x4e')]({'where':{'type':_0x25e2('0x4f')},'attributes':['id',_0x25e2('0x50')],'include':[{'model':db['CmList'],'as':_0x25e2('0x51'),'where':{'id':LISTID}}]})[_0x25e2('0x2f')](function(_0x48eee4){var _0x18e8ec=[];if(_0x48eee4){var _0x2478f3;for(var _0x45ad69=0x0,_0x485b16;_0x45ad69<_0x48eee4['length'];_0x45ad69+=0x1){_0x485b16=_0x48eee4[_0x45ad69][_0x25e2('0x52')]({'plain':!![]});switch(_0x485b16[_0x25e2('0x50')]){case _0x25e2('0x53'):_0x18e8ec[_0x25e2('0x54')](db['sequelize'][_0x25e2('0x55')](_0x2853d5(_0x485b16,_0x25e2('0x56')))[_0x25e2('0x2f')](function(){})[_0x25e2('0x31')](_0x50f47e()));break;case _0x25e2('0x57'):_0x18e8ec[_0x25e2('0x54')](db[_0x25e2('0x58')][_0x25e2('0x55')](_0x481887(_0x485b16,_0x25e2('0x56')))[_0x25e2('0x2f')](function(){})[_0x25e2('0x31')](_0x50f47e()));break;default:_0x18e8ec[_0x25e2('0x54')](db['sequelize']['query'](_0x5781c1(_0x485b16,_0x25e2('0x56')))[_0x25e2('0x2f')](function(){})[_0x25e2('0x31')](_0x50f47e()));}}}return _0x18e8ec;})[_0x25e2('0x59')]()[_0x25e2('0x2f')](function(){return db[_0x25e2('0x4d')][_0x25e2('0x4e')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x25e2('0x5a'),'where':{'id':LISTID}}]})[_0x25e2('0x2f')](function(_0x2323bd){var _0x40a3f2=[];if(_0x2323bd){var _0x398060;for(var _0x3c263c=0x0,_0x51721e;_0x3c263c<_0x2323bd[_0x25e2('0x29')];_0x3c263c+=0x1){_0x51721e=_0x2323bd[_0x3c263c]['get']({'plain':!![]});_0x40a3f2[_0x25e2('0x54')](db[_0x25e2('0x58')][_0x25e2('0x55')](_0x2e0020(_0x51721e,_0x25e2('0x56')))[_0x25e2('0x2f')](function(){})[_0x25e2('0x31')](_0x50f47e()));}}return _0x40a3f2;})[_0x25e2('0x59')]();})[_0x25e2('0x2f')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x25e2('0x50')],'include':[{'model':db['CmList'],'as':_0x25e2('0x51'),'where':{'id':LISTID}}]})[_0x25e2('0x2f')](function(_0xa1d4ee){var _0x39f179=[];if(_0xa1d4ee){for(var _0x5cb40b=0x0,_0x5956e8;_0x5cb40b<_0xa1d4ee['length'];_0x5cb40b+=0x1){_0x5956e8=_0xa1d4ee[_0x5cb40b][_0x25e2('0x52')]({'plain':!![]});switch(_0x5956e8[_0x25e2('0x50')]){case _0x25e2('0x53'):_0x39f179[_0x25e2('0x54')](db[_0x25e2('0x58')][_0x25e2('0x55')](_0x2853d5(_0x5956e8,_0x25e2('0x5b')))[_0x25e2('0x2f')](function(){})[_0x25e2('0x31')](_0x50f47e()));break;case _0x25e2('0x57'):_0x39f179[_0x25e2('0x54')](db[_0x25e2('0x58')][_0x25e2('0x55')](_0x481887(_0x5956e8,_0x25e2('0x5b')))['then'](function(){})[_0x25e2('0x31')](_0x50f47e()));break;default:_0x39f179[_0x25e2('0x54')](db[_0x25e2('0x58')][_0x25e2('0x55')](_0x5781c1(_0x5956e8,'CampaignId'))[_0x25e2('0x2f')](function(){})[_0x25e2('0x31')](_0x50f47e()));}}}return _0x39f179;})[_0x25e2('0x59')]();})['then'](function(){return db[_0x25e2('0x5c')][_0x25e2('0x4e')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x25e2('0x2f')](function(_0x1b654c){var _0x2aa4d2=[];if(_0x1b654c){for(var _0x4b3d91=0x0,_0xd3549d;_0x4b3d91<_0x1b654c[_0x25e2('0x29')];_0x4b3d91+=0x1){_0xd3549d=_0x1b654c[_0x4b3d91]['get']({'plain':!![]});_0x2aa4d2[_0x25e2('0x54')](db[_0x25e2('0x58')][_0x25e2('0x55')](_0x2e0020(_0xd3549d,_0x25e2('0x5b')))['then'](function(){})[_0x25e2('0x31')](_0x50f47e()));}}return _0x2aa4d2;})[_0x25e2('0x59')]();})[_0x25e2('0x31')](function(_0x418bc5){logger['error'](_0x25e2('0x5d'),_0x25e2('0x5e'),_0x418bc5[_0x25e2('0x1b')]);});}var processPromises=function(_0xf60146){return BPromise[_0x25e2('0x59')](promises)[_0x25e2('0x2f')](function(_0x298eb2){})[_0x25e2('0x31')](function(_0x2cd0da){logger[_0x25e2('0x14')](_0x25e2('0x5f'),JSON[_0x25e2('0x60')](_0x2cd0da));})[_0x25e2('0x61')](function(){socket[_0x25e2('0x62')](_0x25e2('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xf60146){return _0xf60146[_0x25e2('0x64')]();}});};var endCsv=function(){return BPromise[_0x25e2('0x65')]()[_0x25e2('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0x25e2('0x2f')](function(){socket[_0x25e2('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x25e2('0x66')](FILEPATH);}catch(_0x3a1812){logger['error'](_0x25e2('0x67'),JSON[_0x25e2('0x60')](_0x3a1812));}finally{process[_0x25e2('0x68')](0x0);}});};process['on'](_0x25e2('0x69'),function(){logger['info'](_0x25e2('0x6a'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x25e2('0x2c')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x25e2('0x2f')](function(_0x5a7c3e){var _0x5fcb99=fs[_0x25e2('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x5fcb99,{'header':!![],'skipEmptyLines':!![],'step':function(_0x39cbe0,_0x2c2075){total+=0x1;var _0x15b47b=total;promises[_0x25e2('0x54')](checkRow(_0x39cbe0,_0x5a7c3e,_0x15b47b)['then'](function(){success+=0x1;})[_0x25e2('0x31')](function(_0x60cd8b){if(_0x60cd8b[_0x25e2('0x14')]){errors+=0x1;delete _0x60cd8b[_0x25e2('0x14')];}else if(_0x60cd8b[_0x25e2('0x2b')]){duplicates+=0x1;delete _0x60cd8b['duplicate'];}rows['push'](_0x60cd8b);}));if(total%0xc8===0x0){_0x2c2075['pause']();return processPromises(_0x2c2075);}},'complete':function(){return processPromises()[_0x25e2('0x2f')](function(){logger[_0x25e2('0x6c')](_0x25e2('0x6d'));endCsv();});},'error':function(_0x3cf207,_0x112dae){logger[_0x25e2('0x6c')](_0x25e2('0x6e'),JSON[_0x25e2('0x60')](_0x3cf207));endCsv();}});})[_0x25e2('0x31')](function(_0x4128a6){logger[_0x25e2('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x4128a6));});}main();
\ No newline at end of file
+var _0x6713=['toString','NOW()','createdAt','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','cm_contacts','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','onlyIfOpen','VoiceQueueId','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','contact:csv_','resolve','emit','unlinkSync','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','pause','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','contact','isNil','errors','length','map','message','join','hasOwnProperty','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field'];(function(_0x4969fa,_0x139af4){var _0x1e5037=function(_0x1eae67){while(--_0x1eae67){_0x4969fa['push'](_0x4969fa['shift']());}};_0x1e5037(++_0x139af4);}(_0x6713,0x98));var _0x3671=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x6713[_0x172133];return _0x2460e5;};'use strict';var BPromise=require(_0x3671('0x0'));var util=require(_0x3671('0x1'));var _=require(_0x3671('0x2'));var fs=require('fs');var squel=require(_0x3671('0x3'));var Papa=require(_0x3671('0x4'));var Redis=require('ioredis');var db=require(_0x3671('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x3671('0x6'))(_0x3671('0x7'));config[_0x3671('0x8')]=_[_0x3671('0x9')](config[_0x3671('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x3671('0xa'))(new Redis(config[_0x3671('0x8')]));require(_0x3671('0xb'))[_0x3671('0xc')](socket);try{if(!process[_0x3671('0xd')][0x2]||process['argv'][0x2]===_0x3671('0xe')||process[_0x3671('0xd')][0x2]===_0x3671('0xf')){throw new Error(_0x3671('0x10'));}var FILEPATH=process['argv'][0x2];if(!process[_0x3671('0xd')][0x3]||process[_0x3671('0xd')][0x3]===_0x3671('0xe')||process[_0x3671('0xd')][0x3]===_0x3671('0xf')||!process[_0x3671('0xd')][0x4]||process[_0x3671('0xd')][0x4]===_0x3671('0xe')||process['argv'][0x4]===_0x3671('0xf')){throw new Error(_0x3671('0x11'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0x3671('0x12')](','),process['argv'][0x4][_0x3671('0x12')](','));if(!process[_0x3671('0xd')][0x5]||process[_0x3671('0xd')][0x5]===_0x3671('0xe')||process[_0x3671('0xd')][0x5]===_0x3671('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x3671('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x3671('0xd')][0x6]!==_0x3671('0xe')&&process['argv'][0x6]!=='null'?process[_0x3671('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x3671('0xe')&&process['argv'][0x7]!==_0x3671('0xf')?process['argv'][0x7]:null;if(!process[_0x3671('0xd')][0x8]||process[_0x3671('0xd')][0x8]===_0x3671('0xe')||process[_0x3671('0xd')][0x8]==='null'){throw new Error(_0x3671('0x13'));}var SOCKET_TIMESTAMP=process[_0x3671('0xd')][0x8];}catch(_0x25a74a){logger[_0x3671('0x14')](_0x25a74a);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(_0x20c961,_0x63bb69,_0x3631d5,_0x2f4298){var _0xb59258={'message':_0x63bb69};_0xb59258[_0x20c961]=!![];if(_0x3631d5){_0xb59258[_0x3671('0x15')]=_0x3631d5;}if(_0x2f4298){_0xb59258['index']=_0x2f4298;}return _0xb59258;}function isEmail(_0x11eeeb){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'](_0x11eeeb);}function checkRow(_0x5c82da,_0x1eb89c,_0x4861f1){return new BPromise(function(_0x2583a7,_0x48c188){if(_[_0x3671('0x16')](_0x5c82da)){return _0x48c188(handleCheckRowError(_0x3671('0x14'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4861f1));}if(_0x5c82da['errors']&&_0x5c82da[_0x3671('0x17')][_0x3671('0x18')]){var _0x563fc2=_[_0x3671('0x19')](_0x5c82da[_0x3671('0x17')],_0x3671('0x1a'))[_0x3671('0x1b')](';');return _0x48c188(handleCheckRowError(_0x3671('0x14'),_0x563fc2,null,_0x4861f1));}var _0x29ddc4={};for(var _0x335302 in FIELDS){if(FIELDS[_0x3671('0x1c')](_0x335302)&&FIELDS[_0x335302]){_0x29ddc4[_0x335302]=_0x5c82da['data'][0x0][FIELDS[_0x335302]]||_0x5c82da['data'][0x0]['\ufeff'+FIELDS[_0x335302]];}}if(!_0x29ddc4[_0x3671('0x1d')]){return _0x48c188(handleCheckRowError(_0x3671('0x14'),_0x3671('0x1e'),null,_0x4861f1));}if(!_0x29ddc4[_0x3671('0x1f')]){return _0x48c188(handleCheckRowError(_0x3671('0x14'),_0x3671('0x20'),null,_0x4861f1));}if(_0x29ddc4[_0x3671('0x21')]){var _0x6fb4fc=moment(_0x29ddc4[_0x3671('0x21')],_0x3671('0x22'));if(!_0x6fb4fc[_0x3671('0x23')]()){return _0x48c188(handleCheckRowError('error',_0x3671('0x24'),null,_0x4861f1));}}if(_0x29ddc4[_0x3671('0x25')]){if(!isEmail(_0x29ddc4[_0x3671('0x25')])){return _0x48c188(handleCheckRowError(_0x3671('0x14'),_0x3671('0x26'),null,_0x4861f1));}}_0x29ddc4[_0x3671('0x27')]=LISTID;_0x29ddc4[_0x3671('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3671('0x18')]&&_0x1eb89c){var _0x3a22b0={};for(var _0x5b36aa=0x0,_0x1591b0=DUPLICATES[_0x3671('0x18')];_0x5b36aa<_0x1591b0;_0x5b36aa+=0x1){_0x3a22b0[DUPLICATES[_0x5b36aa]]=_0x29ddc4[DUPLICATES[_0x5b36aa]];}var _0x358f93=_[_0x3671('0x29')](_0x1eb89c,_0x3a22b0);if(_0x358f93){return _0x48c188(handleCheckRowError(_0x3671('0x2a'),'Duplicate\x20Contact',_0x358f93,_0x4861f1));}}return db[_0x3671('0x2b')][_0x3671('0x2c')](_0x29ddc4,{'raw':!![],'hooks':![],'fields':_[_0x3671('0x2d')](_0x29ddc4)})[_0x3671('0x2e')](function(_0x25f286){if(DUPLICATES&&DUPLICATES[_0x3671('0x18')]&&_0x1eb89c){_0x1eb89c[_0x3671('0x2f')](_[_0x3671('0x30')](_0x29ddc4,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x25f286['id'];return _0x2583a7();})[_0x3671('0x31')](function(_0x464a88){return _0x48c188(handleCheckRowError('error',_0x3671('0x32')+(_0x464a88['message']||JSON['stringify'](_0x464a88)),null,_0x4861f1));});});}function checkHopper(){function _0x4bfcbd(){return function(_0x417cf4){logger[_0x3671('0x14')]('cmContact',_0x3671('0x33'),util[_0x3671('0x34')](_0x417cf4,{'showHidden':![],'depth':null}));};}var _0x11e723=function(_0x3e5273,_0x34459e){var _0x504151=squel[_0x3671('0x35')]()[_0x3671('0x36')](_0x3671('0x37'))[_0x3671('0x38')]([_0x3671('0x1f'),_0x3671('0x39'),_0x3671('0x3a'),'ListId',_0x34459e,'createdAt',_0x3671('0x3b')],squel[_0x3671('0x3c')]()[_0x3671('0x3d')](_0x3671('0x1f'),_0x3671('0x1f'))['field']('NOW()',_0x3671('0x39'))[_0x3671('0x3d')]('id','ContactId')[_0x3671('0x3d')](LISTID['toString'](),_0x3671('0x27'))[_0x3671('0x3d')](_0x3e5273['id'][_0x3671('0x3e')](),_0x34459e)[_0x3671('0x3d')](_0x3671('0x3f'),_0x3671('0x40'))['field'](_0x3671('0x3f'),_0x3671('0x3b'))[_0x3671('0x41')]('cm_contacts')[_0x3671('0x42')](_0x3671('0x43'))['where'](_0x3671('0x44'),LISTID[_0x3671('0x3e')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x3671('0x42')](_0x3671('0x45'),squel[_0x3671('0x3c')]()[_0x3671('0x3d')](_0x3671('0x1f'))[_0x3671('0x41')](_0x3671('0x37'))['where'](_0x34459e+_0x3671('0x46'),_0x3e5273['id'][_0x3671('0x3e')]())))[_0x3671('0x3e')]();return _0x504151;};var _0x262154=function(_0x3d448e,_0x12862a){var _0x204c0d=squel[_0x3671('0x35')]()['into'](_0x3671('0x37'))[_0x3671('0x38')]([_0x3671('0x1f'),_0x3671('0x39'),_0x3671('0x3a'),_0x3671('0x27'),_0x12862a,_0x3671('0x40'),_0x3671('0x3b')],squel['select']()[_0x3671('0x3d')]('phone',_0x3671('0x1f'))[_0x3671('0x3d')](_0x3671('0x3f'),'scheduledAt')[_0x3671('0x3d')]('id','ContactId')[_0x3671('0x3d')](LISTID[_0x3671('0x3e')](),_0x3671('0x27'))[_0x3671('0x3d')](_0x3d448e['id'][_0x3671('0x3e')](),_0x12862a)[_0x3671('0x3d')](_0x3671('0x3f'),'createdAt')[_0x3671('0x3d')](_0x3671('0x3f'),_0x3671('0x3b'))[_0x3671('0x41')]('cm_contacts')[_0x3671('0x42')]('deletedAt\x20IS\x20NULL')[_0x3671('0x42')](_0x3671('0x44'),LISTID['toString']())['where'](_0x3671('0x47'),squel[_0x3671('0x48')](hopperContacts))[_0x3671('0x42')](_0x3671('0x49'))['where'](_0x3671('0x45'),squel['select']()[_0x3671('0x3d')](_0x3671('0x4a'))[_0x3671('0x41')](_0x3671('0x4b'))[_0x3671('0x42')](_0x12862a+_0x3671('0x46'),_0x3d448e['id']['toString']()))[_0x3671('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3671('0x3c')]()[_0x3671('0x3d')](_0x3671('0x1f'))['from'](_0x3671('0x37'))[_0x3671('0x42')](_0x12862a+_0x3671('0x46'),_0x3d448e['id'][_0x3671('0x3e')]())))['toString']();return _0x204c0d;};function _0x390c88(_0x261f50,_0x4d3bab){var _0x27f71f=squel[_0x3671('0x35')]()['into'](_0x3671('0x37'))[_0x3671('0x38')]([_0x3671('0x1f'),_0x3671('0x39'),_0x3671('0x3a'),_0x3671('0x27'),_0x4d3bab,'createdAt',_0x3671('0x3b')],squel[_0x3671('0x3c')]()['field'](_0x3671('0x1f'),_0x3671('0x1f'))[_0x3671('0x3d')](_0x3671('0x3f'),_0x3671('0x39'))[_0x3671('0x3d')]('id',_0x3671('0x3a'))[_0x3671('0x3d')](LISTID[_0x3671('0x3e')](),_0x3671('0x27'))[_0x3671('0x3d')](_0x261f50['id'][_0x3671('0x3e')](),_0x4d3bab)['field'](_0x3671('0x3f'),'createdAt')[_0x3671('0x3d')](_0x3671('0x3f'),_0x3671('0x3b'))[_0x3671('0x41')]('cm_contacts')['where'](_0x3671('0x43'))[_0x3671('0x42')]('ListId\x20=\x20?',LISTID[_0x3671('0x3e')]())[_0x3671('0x42')]('id\x20IN\x20?',squel[_0x3671('0x48')](hopperContacts))[_0x3671('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x3671('0x3e')]();return _0x27f71f;}function _0x555cc2(_0x5f1b23,_0x9cb10c){var _0x57357e=squel[_0x3671('0x35')]()['into']('cm_hopper_black')[_0x3671('0x38')]([_0x3671('0x1f'),_0x3671('0x3a'),'ListId',_0x9cb10c,'createdAt',_0x3671('0x3b')],squel[_0x3671('0x3c')]()[_0x3671('0x3d')](_0x3671('0x1f'),_0x3671('0x1f'))[_0x3671('0x3d')]('id',_0x3671('0x3a'))[_0x3671('0x3d')](LISTID[_0x3671('0x3e')](),_0x3671('0x27'))[_0x3671('0x3d')](_0x5f1b23['id'][_0x3671('0x3e')](),_0x9cb10c)[_0x3671('0x3d')]('NOW()',_0x3671('0x40'))[_0x3671('0x3d')](_0x3671('0x3f'),'updatedAt')[_0x3671('0x41')](_0x3671('0x4c'))[_0x3671('0x42')](_0x3671('0x43'))[_0x3671('0x42')](_0x3671('0x44'),LISTID[_0x3671('0x3e')]())[_0x3671('0x42')](_0x3671('0x47'),squel['str'](hopperContacts))[_0x3671('0x42')](_0x3671('0x49')))['toString']();return _0x57357e;}return db[_0x3671('0x4d')][_0x3671('0x4e')]({'where':{'type':'outbound'},'attributes':['id',_0x3671('0x4f')],'include':[{'model':db[_0x3671('0x50')],'as':_0x3671('0x51'),'where':{'id':LISTID}}]})[_0x3671('0x2e')](function(_0x2fcee6){var _0x40e0f6=[];if(_0x2fcee6){var _0x19764f;for(var _0xe61b4=0x0,_0x158f9b;_0xe61b4<_0x2fcee6[_0x3671('0x18')];_0xe61b4+=0x1){_0x158f9b=_0x2fcee6[_0xe61b4][_0x3671('0x52')]({'plain':!![]});switch(_0x158f9b[_0x3671('0x4f')]){case _0x3671('0x53'):_0x40e0f6[_0x3671('0x2f')](db[_0x3671('0x54')][_0x3671('0x55')](_0x262154(_0x158f9b,'VoiceQueueId'))[_0x3671('0x2e')](function(){})[_0x3671('0x31')](_0x4bfcbd()));break;case _0x3671('0x56'):_0x40e0f6[_0x3671('0x2f')](db['sequelize'][_0x3671('0x55')](_0x11e723(_0x158f9b,'VoiceQueueId'))[_0x3671('0x2e')](function(){})['catch'](_0x4bfcbd()));break;default:_0x40e0f6[_0x3671('0x2f')](db[_0x3671('0x54')][_0x3671('0x55')](_0x390c88(_0x158f9b,_0x3671('0x57')))[_0x3671('0x2e')](function(){})['catch'](_0x4bfcbd()));}}}return _0x40e0f6;})[_0x3671('0x58')]()[_0x3671('0x2e')](function(){return db['VoiceQueue'][_0x3671('0x4e')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x3671('0x50')],'as':_0x3671('0x59'),'where':{'id':LISTID}}]})[_0x3671('0x2e')](function(_0x5dd740){var _0x38b89a=[];if(_0x5dd740){var _0x29b38c;for(var _0x5b3f9e=0x0,_0x2fb8a1;_0x5b3f9e<_0x5dd740[_0x3671('0x18')];_0x5b3f9e+=0x1){_0x2fb8a1=_0x5dd740[_0x5b3f9e][_0x3671('0x52')]({'plain':!![]});_0x38b89a[_0x3671('0x2f')](db['sequelize'][_0x3671('0x55')](_0x555cc2(_0x2fb8a1,_0x3671('0x57')))[_0x3671('0x2e')](function(){})['catch'](_0x4bfcbd()));}}return _0x38b89a;})[_0x3671('0x58')]();})['then'](function(){return db[_0x3671('0x5a')][_0x3671('0x4e')]({'attributes':['id',_0x3671('0x4f')],'include':[{'model':db['CmList'],'as':_0x3671('0x51'),'where':{'id':LISTID}}]})[_0x3671('0x2e')](function(_0x9a104e){var _0x27585f=[];if(_0x9a104e){for(var _0xfb5f50=0x0,_0x3ea4ae;_0xfb5f50<_0x9a104e[_0x3671('0x18')];_0xfb5f50+=0x1){_0x3ea4ae=_0x9a104e[_0xfb5f50][_0x3671('0x52')]({'plain':!![]});switch(_0x3ea4ae[_0x3671('0x4f')]){case _0x3671('0x53'):_0x27585f['push'](db[_0x3671('0x54')][_0x3671('0x55')](_0x262154(_0x3ea4ae,'CampaignId'))[_0x3671('0x2e')](function(){})[_0x3671('0x31')](_0x4bfcbd()));break;case _0x3671('0x56'):_0x27585f[_0x3671('0x2f')](db[_0x3671('0x54')][_0x3671('0x55')](_0x11e723(_0x3ea4ae,_0x3671('0x5b')))['then'](function(){})[_0x3671('0x31')](_0x4bfcbd()));break;default:_0x27585f[_0x3671('0x2f')](db['sequelize'][_0x3671('0x55')](_0x390c88(_0x3ea4ae,_0x3671('0x5b')))['then'](function(){})[_0x3671('0x31')](_0x4bfcbd()));}}}return _0x27585f;})[_0x3671('0x58')]();})[_0x3671('0x2e')](function(){return db['Campaign'][_0x3671('0x4e')]({'attributes':['id'],'include':[{'model':db[_0x3671('0x50')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3671('0x2e')](function(_0x2e7c8e){var _0x1065d3=[];if(_0x2e7c8e){for(var _0x55639b=0x0,_0x525984;_0x55639b<_0x2e7c8e[_0x3671('0x18')];_0x55639b+=0x1){_0x525984=_0x2e7c8e[_0x55639b][_0x3671('0x52')]({'plain':!![]});_0x1065d3[_0x3671('0x2f')](db[_0x3671('0x54')][_0x3671('0x55')](_0x555cc2(_0x525984,_0x3671('0x5b')))[_0x3671('0x2e')](function(){})[_0x3671('0x31')](_0x4bfcbd()));}}return _0x1065d3;})[_0x3671('0x58')]();})[_0x3671('0x31')](function(_0x337d61){logger[_0x3671('0x14')](_0x3671('0x5c'),_0x3671('0x5d'),_0x337d61[_0x3671('0x1a')]);});}var processPromises=function(_0x9b1ac6){return BPromise[_0x3671('0x58')](promises)[_0x3671('0x2e')](function(_0x4388b8){})['catch'](function(_0x1df68e){logger['error'](_0x3671('0x5e'),JSON[_0x3671('0x5f')](_0x1df68e));})['finally'](function(){socket['emit'](_0x3671('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x9b1ac6){return _0x9b1ac6['resume']();}});};var endCsv=function(){return BPromise[_0x3671('0x61')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3671('0x62')](_0x3671('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3671('0x63')](FILEPATH);}catch(_0x3cbb91){logger[_0x3671('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x3671('0x5f')](_0x3cbb91));}finally{process[_0x3671('0x64')](0x0);}});};process['on'](_0x3671('0x65'),function(){logger[_0x3671('0x66')](_0x3671('0x67'));endCsv();});function main(){return BPromise[_0x3671('0x61')]()[_0x3671('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3671('0x12')](',');return db[_0x3671('0x2b')][_0x3671('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x2c11b3){var _0x2020ac=fs[_0x3671('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2020ac,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3e2fb1,_0x10e304){total+=0x1;var _0x9f08cc=total;promises['push'](checkRow(_0x3e2fb1,_0x2c11b3,_0x9f08cc)[_0x3671('0x2e')](function(){success+=0x1;})['catch'](function(_0x3f0930){if(_0x3f0930[_0x3671('0x14')]){errors+=0x1;delete _0x3f0930[_0x3671('0x14')];}else if(_0x3f0930[_0x3671('0x2a')]){duplicates+=0x1;delete _0x3f0930[_0x3671('0x2a')];}rows[_0x3671('0x2f')](_0x3f0930);}));if(total%0xc8===0x0){_0x10e304[_0x3671('0x69')]();return processPromises(_0x10e304);}},'complete':function(){return processPromises()[_0x3671('0x2e')](function(){logger[_0x3671('0x66')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x52d134,_0x2870ca){logger[_0x3671('0x66')]('CSV\x20parse\x20error',JSON[_0x3671('0x5f')](_0x52d134));endCsv();}});})[_0x3671('0x31')](function(_0x2d1d5c){logger[_0x3671('0x14')](_0x3671('0x6a'),JSON[_0x3671('0x5f')](_0x2d1d5c));});}main();
\ No newline at end of file
index f6e7b6a..c7f2d3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ee2=['No\x20agent\x20available','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.UserId','insert','cm_hopper','scheduledat','ContactId','createdAt','updatedAt','priority','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','fromQuery','cm_contacts','.CmListId','ListId\x20=\x20?','\x20=\x20?','toString','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','exit','errors','code','message','info','sequelize','query','spread','catch','error','stringify','send','socket_timestamp','root','server/files/tmp','.csv','writeFileSync','parse','createReadStream','data','length','rows','trim','replace','YYYY-MM-DD\x20HH:mm:ss','push','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','firstName','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','campaigns_has_cm_blacklists','each','affectedRows','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory'];(function(_0x410dcc,_0xca2172){var _0x3e799a=function(_0x8289e6){while(--_0x8289e6){_0x410dcc['push'](_0x410dcc['shift']());}};_0x3e799a(++_0xca2172);}(_0x7ee2,0xfc));var _0x27ee=function(_0x320b78,_0x57db4b){_0x320b78=_0x320b78-0x0;var _0x355eb9=_0x7ee2[_0x320b78];return _0x355eb9;};'use strict';var fs=require('fs');var path=require(_0x27ee('0x0'));var _=require(_0x27ee('0x1'));var Papa=require('papaparse');var util=require(_0x27ee('0x2'));var BPromise=require(_0x27ee('0x3'));var moment=require(_0x27ee('0x4'));var squel=require(_0x27ee('0x5'));var Redis=require(_0x27ee('0x6'));var db=require(_0x27ee('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x27ee('0x8'))(_0x27ee('0x9'));config['redis']=_[_0x27ee('0xa')](config[_0x27ee('0xb')],{'host':_0x27ee('0xc'),'port':0x18eb});var socket=require(_0x27ee('0xd'))(new Redis(config[_0x27ee('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x27ee('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x577ee2){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))*$/[_0x27ee('0xf')](_0x577ee2);}function selectNotIn(_0x4f14b0,_0x1e6ea3,_0x217e03,_0x2c085e,_0x2c91d9){return squel[_0x27ee('0x10')]()[_0x27ee('0x11')](_0x27ee('0x12'))[_0x27ee('0x13')](_0x2c085e)['join'](_0x1e6ea3,null,_0x1e6ea3+_0x27ee('0x14')+_0x2c085e+'.'+_0x217e03)[_0x27ee('0x15')](_0x2c085e+'.'+_0x217e03+_0x27ee('0x16')+_0x4f14b0+'.'+_0x217e03)[_0x27ee('0x15')](_0x1e6ea3+_0x27ee('0x17')+_0x2c91d9[_0x27ee('0x18')]()+')');}function insertCmHopper(_0x41bc56,_0x10a8eb,_0x572c0e,_0xb65a34,_0x58a28c){var _0x47fa1d=[_0x27ee('0x19'),_0x27ee('0x1a'),'cm_contacts.id','cm_contacts.ListId',_0x10a8eb+'.'+_0xb65a34,_0x27ee('0x1b'),'cm_contacts.updatedAt','cm_contacts.priority',_0x27ee('0x1c'),'\x22'+_0x58a28c+'\x22'];return squel[_0x27ee('0x1d')]()['into'](_0x27ee('0x1e'))['fromQuery']([_0x27ee('0x12'),_0x27ee('0x1f'),_0x27ee('0x20'),'ListId',_0xb65a34,_0x27ee('0x21'),_0x27ee('0x22'),_0x27ee('0x23'),'UserId','recallme'],squel['select']()[_0x27ee('0x24')](_0x47fa1d)[_0x27ee('0x13')](_0x10a8eb)['join']('cm_contacts',null,_0x27ee('0x25')+_0x10a8eb+'.CmListId')[_0x27ee('0x18')](_0x572c0e,null,_0x572c0e+_0x27ee('0x14')+_0x10a8eb+'.'+_0xb65a34)[_0x27ee('0x15')](_0x10a8eb+_0x27ee('0x26'),_0x41bc56)[_0x27ee('0x15')](_0x27ee('0x27'),NOW)[_0x27ee('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x10a8eb,_0x572c0e,_0xb65a34,_0x27ee('0x1e'),[_0x27ee('0x28'),'\x22onlyIfOpen\x22']))[_0x27ee('0x15')](_0x27ee('0x29'),selectNotIn(_0x10a8eb,_0x572c0e,_0xb65a34,_0x27ee('0x1e'),[_0x27ee('0x28')])))['toString']();}function insertCmHopperBlack(_0x2e96d4,_0xb03894,_0x22f049,_0x581397){var _0x1b2bc9=['cm_contacts.phone','cm_contacts.id',_0x27ee('0x2a'),_0xb03894+'.'+_0x581397,_0x27ee('0x1b'),_0x27ee('0x2b')];return squel[_0x27ee('0x1d')]()['into'](_0x27ee('0x2c'))[_0x27ee('0x2d')]([_0x27ee('0x12'),_0x27ee('0x20'),'ListId',_0x581397,_0x27ee('0x21'),_0x27ee('0x22')],squel[_0x27ee('0x10')]()[_0x27ee('0x24')](_0x1b2bc9)['from'](_0xb03894)['join'](_0x27ee('0x2e'),null,_0x27ee('0x25')+_0xb03894+_0x27ee('0x2f'))[_0x27ee('0x18')](_0x22f049,null,_0x22f049+'.id\x20=\x20'+_0xb03894+'.'+_0x581397)['where'](_0xb03894+_0x27ee('0x26'),_0x2e96d4)[_0x27ee('0x15')](_0x27ee('0x27'),NOW)['where'](_0x27ee('0x29'),squel['select']()['field'](_0x27ee('0x12'))[_0x27ee('0x13')](_0x27ee('0x2c'))[_0x27ee('0x15')](_0x27ee('0x30'),_0x2e96d4)[_0x27ee('0x15')](_0x581397+_0x27ee('0x31'),_0xb03894+'.'+_0x581397)))[_0x27ee('0x32')]();}function insertCmContact(_0x4d5a3c,_0x39b586,_0x284c3d,_0x501bdd){var _0x24feba=_['concat'](_[_0x27ee('0x33')](_0x501bdd),[_0x27ee('0x34'),_0x27ee('0x35'),_0x27ee('0x21'),_0x27ee('0x22')]);return squel['insert']()['into'](_0x27ee('0x2e'))[_0x27ee('0x2d')](_0x24feba,squel[_0x27ee('0x10')]()[_0x27ee('0x24')](_0x24feba)[_0x27ee('0x13')](_0x39b586)[_0x27ee('0x15')]('('+_0x284c3d[_0x27ee('0x18')](',')+_0x27ee('0x36'),squel['select']()[_0x27ee('0x24')](_0x284c3d)[_0x27ee('0x13')](_0x27ee('0x2e'))[_0x27ee('0x15')](_0x27ee('0x30'),_0x4d5a3c)[_0x27ee('0x15')](_0x27ee('0x37')))[_0x27ee('0x15')](_0x27ee('0x38'),squel[_0x27ee('0x10')]()[_0x27ee('0x11')]('MIN(id)',_0x27ee('0x39'))[_0x27ee('0x13')](_0x39b586)[_0x27ee('0x3a')](_0x284c3d[_0x27ee('0x18')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x517de6){logger['error'](_0x517de6['message']);process[_0x27ee('0x3b')](0x1);}function handleError(_0x14fe0e,_0x14459){stats[_0x27ee('0x3c')]['push']({'name':_0x14459[_0x27ee('0x3d')],'message':_0x14459[_0x27ee('0x3e')],'row':_0x14fe0e});}function handleQuery(_0x49b178){logger[_0x27ee('0x3f')](_0x49b178);return db[_0x27ee('0x40')][_0x27ee('0x41')](_0x49b178)[_0x27ee('0x42')](function(_0x882172){results['push'](_0x882172);})[_0x27ee('0x43')](function(_0x4a6e51){logger[_0x27ee('0x44')](_0x4a6e51['message']);});}function main(_0x3b8d14,_0x43be05,_0x2dd1b9,_0x25a1fc){logger[_0x27ee('0x3f')]('main',_0x3b8d14,JSON[_0x27ee('0x45')](_0x43be05));process[_0x27ee('0x46')]('start');var _0x5568cc=_0x43be05['binding'];var _0x34e5e7=_0x43be05[_0x27ee('0x47')];var _0x24948a=path['join'](config[_0x27ee('0x48')],_0x27ee('0x49'),_0x34e5e7+_0x27ee('0x4a'));var _0x163b18=_[_0x27ee('0x33')](_0x5568cc)[_0x27ee('0x18')]();logger[_0x27ee('0x3f')]('header',_0x163b18);fs[_0x27ee('0x4b')](_0x24948a,_0x163b18+'\x0a');Papa[_0x27ee('0x4c')](fs[_0x27ee('0x4d')](_0x3b8d14),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4a4018,_0x246d27){try{for(var _0x18c9ba=0x0,_0xd1c9c8=[];_0x18c9ba<_0x4a4018[_0x27ee('0x4e')][_0x27ee('0x4f')];_0x18c9ba++){stats[_0x27ee('0x50')]+=0x1;if(_0x4a4018['errors'][_0x18c9ba]){handleError(_0x4a4018[_0x27ee('0x4e')][_0x18c9ba],_0x4a4018[_0x27ee('0x3c')][_0x18c9ba]);}else{var _0x5d81d6=[];for(var _0x5f448b in _0x5568cc){if(_0x5568cc['hasOwnProperty'](_0x5f448b)){if(_0x4a4018[_0x27ee('0x4e')][_0x18c9ba][_0x5568cc[_0x5f448b]]){var _0xcc38ee=_[_0x27ee('0x51')](_0x4a4018[_0x27ee('0x4e')][_0x18c9ba][_0x5568cc[_0x5f448b]][_0x27ee('0x52')](/"/g,'\x27'));switch(_0x5f448b){case'scheduledat':var _0x542d15=moment(_0xcc38ee,_0x27ee('0x53'),!![]);if(_0x542d15['isValid']()){_0xd1c9c8[_0x27ee('0x54')]('\x22'+_0xcc38ee+'\x22');}else{_0x5d81d6['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x27ee('0x23'):var _0x4317b1=parseInt(_0xcc38ee);_0xcc38ee=_[_0x27ee('0x55')](_0x4317b1)||_0x4317b1<0x0||_0x4317b1>0x4?_0x25a1fc?0x3:0x2:_0x4317b1;_0xd1c9c8[_0x27ee('0x54')]('\x22'+_0xcc38ee+'\x22');break;case _0x27ee('0x56'):var _0x2775fe=parseInt(_0xcc38ee);if(_[_0x27ee('0x57')](_0x2775fe)&&_[_0x27ee('0x58')](_0x2dd1b9,_0x2775fe)){_0xd1c9c8[_0x27ee('0x54')]('\x22'+_0x2775fe+'\x22');}else{_0x5d81d6[_0x27ee('0x54')](_0x27ee('0x59'));}break;case'email':if(isEmail(_0xcc38ee)){_0xd1c9c8['push']('\x22'+_0xcc38ee+'\x22');}else{_0x5d81d6[_0x27ee('0x54')](_0x27ee('0x5a'));}break;case _0x27ee('0x5b'):var _0x5de373=moment(_0xcc38ee,'YYYY-MM-DD',!![]);if(_0x5de373['isValid']()){_0xd1c9c8['push']('\x22'+_0xcc38ee+'\x22');}else{_0x5d81d6[_0x27ee('0x54')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0xd1c9c8[_0x27ee('0x54')]('\x22'+_0xcc38ee+'\x22');}}else{switch(_0x5f448b){case _0x27ee('0x5c'):case _0x27ee('0x12'):_0x5d81d6[_0x27ee('0x54')](_0x5f448b+'\x20not\x20specified');break;default:_0xd1c9c8[_0x27ee('0x54')]('\x22\x22');}}}}if(_0x5d81d6[_0x27ee('0x4f')]){handleError(_0x4a4018[_0x27ee('0x4e')][_0x18c9ba],{'code':_0x27ee('0x5d'),'message':_0x5d81d6['join']()});}else{fs[_0x27ee('0x5e')](_0x24948a,_0xd1c9c8['join']()+'\x0a');}_0xd1c9c8=[];}if(!(stats['rows']%0xc8)){socket[_0x27ee('0x5f')](_0x27ee('0x60')+_0x34e5e7,stats);stats[_0x27ee('0x3c')]=[];}}if(stopped){logger[_0x27ee('0x3f')](_0x27ee('0x61'));_0x246d27[_0x27ee('0x62')]();}}catch(_0x372ff9){handleError(_0x4a4018['data'][_0x18c9ba],{'code':_0x27ee('0x63'),'message':_0x372ff9[_0x27ee('0x3e')]});logger[_0x27ee('0x44')](_0x27ee('0x64'),_0x372ff9[_0x27ee('0x3e')]);}},'complete':function(){try{var _0x504174=[];var _0x312022=_0x27ee('0x2e');if(_0x43be05[_0x27ee('0x65')]&&_0x43be05[_0x27ee('0x65')]['length']){_0x312022=_0x27ee('0x66')+_0x34e5e7;_0x504174[_0x27ee('0x54')](_0x27ee('0x67')+_0x312022+_0x27ee('0x68'));}var _0x325806=util[_0x27ee('0xe')](_0x27ee('0x69'),_0x24948a,_0x312022,_0x163b18,_0x43be05[_0x27ee('0x34')],_0x43be05[_0x27ee('0x35')]||null,NOW,NOW);if(_[_0x27ee('0x6a')](_0x5568cc[_0x27ee('0x1f')])){_0x325806+=',\x20scheduledAt\x20=\x20NOW()';}_0x504174['push'](_0x325806);if(_0x43be05[_0x27ee('0x65')]&&_0x43be05[_0x27ee('0x65')][_0x27ee('0x4f')]){_0x504174[_0x27ee('0x54')](insertCmContact(_0x43be05[_0x27ee('0x34')],_0x312022,_0x43be05[_0x27ee('0x65')],_0x5568cc));_0x504174[_0x27ee('0x54')]('DROP\x20TABLE\x20'+_0x312022+';');}_0x504174[_0x27ee('0x54')](insertCmHopper(_0x43be05[_0x27ee('0x34')],'voice_queues_has_cm_lists','voice_queues',_0x27ee('0x6b'),_0x25a1fc));_0x504174['push'](insertCmHopperBlack(_0x43be05['ListId'],_0x27ee('0x6c'),'voice_queues',_0x27ee('0x6b')));_0x504174[_0x27ee('0x54')](insertCmHopper(_0x43be05[_0x27ee('0x34')],'campaigns_has_cm_lists',_0x27ee('0x6d'),'CampaignId',_0x25a1fc));_0x504174['push'](insertCmHopperBlack(_0x43be05[_0x27ee('0x34')],_0x27ee('0x6e'),_0x27ee('0x6d'),'CampaignId'));BPromise[_0x27ee('0x6f')](_0x504174,handleQuery)['then'](function(_0x5767a9){stats['finish']=!![];stats[_0x27ee('0x70')]=_0x43be05[_0x27ee('0x65')]&&_0x43be05['duplicates'][_0x27ee('0x4f')]?results[0x2]['affectedRows']:results[0x0][_0x27ee('0x70')];socket['emit'](_0x27ee('0x60')+_0x34e5e7,stats);fs['unlink'](_0x3b8d14);fs['unlink'](_0x24948a);process['exit'](0x0);})[_0x27ee('0x43')](function(_0x573158){logger[_0x27ee('0x44')](_0x573158[_0x27ee('0x3e')]);process[_0x27ee('0x3b')](0x1);});}catch(_0x294b46){logger[_0x27ee('0x44')](_0x27ee('0x71'),_0x294b46[_0x27ee('0x3e')]);process[_0x27ee('0x3b')](0x1);}},'error':function(_0x1fb4f7,_0x3ad80e,_0x2b7616,_0x3821b9){throw new Error(_0x3821b9);}});}function validate(){if(process[_0x27ee('0x72')]&&process['argv'][_0x27ee('0x4f')]<0x4){throw new Error(_0x27ee('0x73'));}var _0x449814=path['join'](config[_0x27ee('0x48')],_0x27ee('0x49'),process[_0x27ee('0x72')][0x2]);if(!fs[_0x27ee('0x74')](_0x449814)){throw new Error(_0x27ee('0x75'));}var _0x32ac72={};try{_0x32ac72=JSON[_0x27ee('0x4c')](process[_0x27ee('0x72')][0x3]);if(!_0x32ac72[_0x27ee('0x76')]){throw new Error(_0x27ee('0x77'));}if(!_0x32ac72[_0x27ee('0x76')][_0x27ee('0x12')]){throw new Error(_0x27ee('0x78'));}if(!_0x32ac72[_0x27ee('0x76')][_0x27ee('0x5c')]){throw new Error('firstName\x20is\x20mandatory');}var _0x4b90b3=0x0;if(_0x32ac72[_0x27ee('0x76')][_0x27ee('0x56')]){_0x4b90b3=0x1;}if(!_0x32ac72[_0x27ee('0x34')]){throw new Error(_0x27ee('0x79'));}}catch(_0x4d73a7){throw new Error(_0x27ee('0x7a'));}var _0x1600ed=[];try{_0x1600ed=_['map'](JSON[_0x27ee('0x4c')](process[_0x27ee('0x72')][0x4]),'id');}catch(_0x476434){logger['info'](_0x27ee('0x7b'));}main(_0x449814,_0x32ac72,_0x1600ed,_0x4b90b3);}validate();process['on']('SIGINT',handleStop);process['on'](_0x27ee('0x7c'),handleUncaughtException);
\ No newline at end of file
+var _0xa5f4=['campaigns_has_cm_blacklists','CampaignId','then','finish','affectedRows','unlink','error','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','fromQuery','ContactId','ListId','updatedAt','priority','UserId','recallme','fields','from','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_hopper','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id','into','cm_hopper_black','createdAt','select','cm_contacts','.CmListId','field','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit','errors','push','code','sequelize','spread','catch','stringify','send','start','binding','root','server/files/tmp','.csv','header','writeFileSync','parse','data','length','rows','hasOwnProperty','replace','scheduledat','isValid','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','abort','step','duplicates','cm_contacts_','format','isNil','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns'];(function(_0x41cd93,_0x382eb8){var _0x58a7f8=function(_0x19e25f){while(--_0x19e25f){_0x41cd93['push'](_0x41cd93['shift']());}};_0x58a7f8(++_0x382eb8);}(_0xa5f4,0x94));var _0x4a5f=function(_0x4c8657,_0x3b82f2){_0x4c8657=_0x4c8657-0x0;var _0x4a526e=_0xa5f4[_0x4c8657];return _0x4a526e;};'use strict';var fs=require('fs');var path=require(_0x4a5f('0x0'));var _=require(_0x4a5f('0x1'));var Papa=require(_0x4a5f('0x2'));var util=require('util');var BPromise=require(_0x4a5f('0x3'));var moment=require(_0x4a5f('0x4'));var squel=require(_0x4a5f('0x5'));var Redis=require(_0x4a5f('0x6'));var db=require(_0x4a5f('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x4a5f('0x8'))('import');config[_0x4a5f('0x9')]=_[_0x4a5f('0xa')](config[_0x4a5f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a5f('0xb'))(new Redis(config[_0x4a5f('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x4a5f('0xc'));function isEmail(_0x5aaf16){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))*$/[_0x4a5f('0xd')](_0x5aaf16);}function selectNotIn(_0x565585,_0x41a4ae,_0x596ef9,_0x409bdf,_0x31a931){return squel['select']()['field'](_0x4a5f('0xe'))['from'](_0x409bdf)[_0x4a5f('0xf')](_0x41a4ae,null,_0x41a4ae+_0x4a5f('0x10')+_0x409bdf+'.'+_0x596ef9)[_0x4a5f('0x11')](_0x409bdf+'.'+_0x596ef9+_0x4a5f('0x12')+_0x565585+'.'+_0x596ef9)[_0x4a5f('0x11')](_0x41a4ae+_0x4a5f('0x13')+_0x31a931['join']()+')');}function insertCmHopper(_0x1c29b6,_0x248237,_0xbe79a6,_0x24a7d8,_0x43c8ce){var _0x527310=[_0x4a5f('0x14'),_0x4a5f('0x15'),'cm_contacts.id',_0x4a5f('0x16'),_0x248237+'.'+_0x24a7d8,_0x4a5f('0x17'),_0x4a5f('0x18'),_0x4a5f('0x19'),_0x4a5f('0x1a'),'\x22'+_0x43c8ce+'\x22'];return squel[_0x4a5f('0x1b')]()['into']('cm_hopper')[_0x4a5f('0x1c')]([_0x4a5f('0xe'),'scheduledat',_0x4a5f('0x1d'),_0x4a5f('0x1e'),_0x24a7d8,'createdAt',_0x4a5f('0x1f'),_0x4a5f('0x20'),_0x4a5f('0x21'),_0x4a5f('0x22')],squel['select']()[_0x4a5f('0x23')](_0x527310)[_0x4a5f('0x24')](_0x248237)[_0x4a5f('0xf')]('cm_contacts',null,_0x4a5f('0x25')+_0x248237+'.CmListId')[_0x4a5f('0xf')](_0xbe79a6,null,_0xbe79a6+'.id\x20=\x20'+_0x248237+'.'+_0x24a7d8)[_0x4a5f('0x11')](_0x248237+_0x4a5f('0x26'),_0x1c29b6)[_0x4a5f('0x11')](_0x4a5f('0x27'),NOW)[_0x4a5f('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x248237,_0xbe79a6,_0x24a7d8,_0x4a5f('0x28'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x4a5f('0x11')](_0x4a5f('0x29'),selectNotIn(_0x248237,_0xbe79a6,_0x24a7d8,'cm_hopper',[_0x4a5f('0x2a')])))[_0x4a5f('0x2b')]();}function insertCmHopperBlack(_0x1e2b0c,_0x7d9878,_0x46ee8e,_0x36088f){var _0x333ee3=[_0x4a5f('0x14'),_0x4a5f('0x2c'),'cm_contacts.ListId',_0x7d9878+'.'+_0x36088f,'cm_contacts.createdAt',_0x4a5f('0x18')];return squel[_0x4a5f('0x1b')]()[_0x4a5f('0x2d')](_0x4a5f('0x2e'))[_0x4a5f('0x1c')]([_0x4a5f('0xe'),_0x4a5f('0x1d'),_0x4a5f('0x1e'),_0x36088f,_0x4a5f('0x2f'),_0x4a5f('0x1f')],squel[_0x4a5f('0x30')]()[_0x4a5f('0x23')](_0x333ee3)[_0x4a5f('0x24')](_0x7d9878)['join'](_0x4a5f('0x31'),null,_0x4a5f('0x25')+_0x7d9878+_0x4a5f('0x32'))['join'](_0x46ee8e,null,_0x46ee8e+_0x4a5f('0x10')+_0x7d9878+'.'+_0x36088f)[_0x4a5f('0x11')](_0x7d9878+_0x4a5f('0x26'),_0x1e2b0c)[_0x4a5f('0x11')](_0x4a5f('0x27'),NOW)[_0x4a5f('0x11')](_0x4a5f('0x29'),squel[_0x4a5f('0x30')]()[_0x4a5f('0x33')](_0x4a5f('0xe'))[_0x4a5f('0x24')](_0x4a5f('0x2e'))['where'](_0x4a5f('0x34'),_0x1e2b0c)['where'](_0x36088f+_0x4a5f('0x35'),_0x7d9878+'.'+_0x36088f)))[_0x4a5f('0x2b')]();}function insertCmContact(_0x56b406,_0x45f8e8,_0x13e619,_0x48752d){var _0x9875a9=_[_0x4a5f('0x36')](_[_0x4a5f('0x37')](_0x48752d),[_0x4a5f('0x1e'),_0x4a5f('0x38'),'createdAt',_0x4a5f('0x1f')]);return squel[_0x4a5f('0x1b')]()[_0x4a5f('0x2d')](_0x4a5f('0x31'))[_0x4a5f('0x1c')](_0x9875a9,squel[_0x4a5f('0x30')]()['fields'](_0x9875a9)[_0x4a5f('0x24')](_0x45f8e8)[_0x4a5f('0x11')]('('+_0x13e619[_0x4a5f('0xf')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x4a5f('0x23')](_0x13e619)[_0x4a5f('0x24')]('cm_contacts')[_0x4a5f('0x11')](_0x4a5f('0x34'),_0x56b406)[_0x4a5f('0x11')]('deletedAt\x20IS\x20NULL'))[_0x4a5f('0x11')](_0x4a5f('0x39'),squel[_0x4a5f('0x30')]()[_0x4a5f('0x33')](_0x4a5f('0x3a'),_0x4a5f('0x3b'))[_0x4a5f('0x24')](_0x45f8e8)[_0x4a5f('0x3c')](_0x13e619[_0x4a5f('0xf')](','))))[_0x4a5f('0x2b')]();}function handleStop(){logger[_0x4a5f('0x3d')](_0x4a5f('0x3e'));stopped=!![];}function handleUncaughtException(_0x1f012a){logger['error'](_0x1f012a[_0x4a5f('0x3f')]);process[_0x4a5f('0x40')](0x1);}function handleError(_0x31814d,_0x1dc171){stats[_0x4a5f('0x41')][_0x4a5f('0x42')]({'name':_0x1dc171[_0x4a5f('0x43')],'message':_0x1dc171[_0x4a5f('0x3f')],'row':_0x31814d});}function handleQuery(_0x1916da){logger[_0x4a5f('0x3d')](_0x1916da);return db[_0x4a5f('0x44')]['query'](_0x1916da)[_0x4a5f('0x45')](function(_0x436ed){results['push'](_0x436ed);})[_0x4a5f('0x46')](function(_0x48ea11){logger['error'](_0x48ea11['message']);});}function main(_0x523744,_0x977457,_0xd6a2c9,_0x2ce3e0){logger[_0x4a5f('0x3d')]('main',_0x523744,JSON[_0x4a5f('0x47')](_0x977457));process[_0x4a5f('0x48')](_0x4a5f('0x49'));var _0x5b6c8c=_0x977457[_0x4a5f('0x4a')];var _0x3caef6=_0x977457['socket_timestamp'];var _0x1cf2e2=path[_0x4a5f('0xf')](config[_0x4a5f('0x4b')],_0x4a5f('0x4c'),_0x3caef6+_0x4a5f('0x4d'));var _0x4a6b57=_[_0x4a5f('0x37')](_0x5b6c8c)['join']();logger['info'](_0x4a5f('0x4e'),_0x4a6b57);fs[_0x4a5f('0x4f')](_0x1cf2e2,_0x4a6b57+'\x0a');Papa[_0x4a5f('0x50')](fs['createReadStream'](_0x523744),{'header':!![],'skipEmptyLines':!![],'step':function(_0x10b656,_0x53ce49){try{for(var _0x451c92=0x0,_0x5e60ee=[];_0x451c92<_0x10b656[_0x4a5f('0x51')][_0x4a5f('0x52')];_0x451c92++){stats[_0x4a5f('0x53')]+=0x1;if(_0x10b656[_0x4a5f('0x41')][_0x451c92]){handleError(_0x10b656[_0x4a5f('0x51')][_0x451c92],_0x10b656[_0x4a5f('0x41')][_0x451c92]);}else{var _0x514134=[];for(var _0x2d5ca4 in _0x5b6c8c){if(_0x5b6c8c[_0x4a5f('0x54')](_0x2d5ca4)){if(_0x10b656[_0x4a5f('0x51')][_0x451c92][_0x5b6c8c[_0x2d5ca4]]){var _0x2389e5=_['trim'](_0x10b656[_0x4a5f('0x51')][_0x451c92][_0x5b6c8c[_0x2d5ca4]][_0x4a5f('0x55')](/"/g,'\x27'));switch(_0x2d5ca4){case _0x4a5f('0x56'):var _0x3775ff=moment(_0x2389e5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3775ff[_0x4a5f('0x57')]()){_0x5e60ee['push']('\x22'+_0x2389e5+'\x22');}else{_0x514134[_0x4a5f('0x42')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x4a5f('0x20'):var _0x1b96f0=parseInt(_0x2389e5);_0x2389e5=_[_0x4a5f('0x58')](_0x1b96f0)||_0x1b96f0<0x0||_0x1b96f0>0x4?_0x2ce3e0?0x3:0x2:_0x1b96f0;_0x5e60ee['push']('\x22'+_0x2389e5+'\x22');break;case'UserId':var _0x26196d=parseInt(_0x2389e5);if(_[_0x4a5f('0x59')](_0x26196d)&&_[_0x4a5f('0x5a')](_0xd6a2c9,_0x26196d)){_0x5e60ee[_0x4a5f('0x42')]('\x22'+_0x26196d+'\x22');}else{_0x514134[_0x4a5f('0x42')]('agent\x20not\x20exists');}break;case _0x4a5f('0x5b'):if(isEmail(_0x2389e5)){_0x5e60ee[_0x4a5f('0x42')]('\x22'+_0x2389e5+'\x22');}else{_0x514134['push'](_0x4a5f('0x5c'));}break;case _0x4a5f('0x5d'):var _0x528fe9=moment(_0x2389e5,_0x4a5f('0x5e'),!![]);if(_0x528fe9[_0x4a5f('0x57')]()){_0x5e60ee[_0x4a5f('0x42')]('\x22'+_0x2389e5+'\x22');}else{_0x514134[_0x4a5f('0x42')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x5e60ee[_0x4a5f('0x42')]('\x22'+_0x2389e5+'\x22');}}else{switch(_0x2d5ca4){case _0x4a5f('0x5f'):case _0x4a5f('0xe'):_0x514134[_0x4a5f('0x42')](_0x2d5ca4+_0x4a5f('0x60'));break;default:_0x5e60ee[_0x4a5f('0x42')]('\x22\x22');}}}}if(_0x514134[_0x4a5f('0x52')]){handleError(_0x10b656[_0x4a5f('0x51')][_0x451c92],{'code':_0x4a5f('0x61'),'message':_0x514134[_0x4a5f('0xf')]()});}else{fs[_0x4a5f('0x62')](_0x1cf2e2,_0x5e60ee[_0x4a5f('0xf')]()+'\x0a');}_0x5e60ee=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x4a5f('0x63')+_0x3caef6,stats);stats['errors']=[];}}if(stopped){logger['info']('Abort\x20parser');_0x53ce49[_0x4a5f('0x64')]();}}catch(_0x38316d){handleError(_0x10b656[_0x4a5f('0x51')][_0x451c92],{'code':'SystemError','message':_0x38316d[_0x4a5f('0x3f')]});logger['error'](_0x4a5f('0x65'),_0x38316d['message']);}},'complete':function(){try{var _0x23d82f=[];var _0xe6e2b7=_0x4a5f('0x31');if(_0x977457[_0x4a5f('0x66')]&&_0x977457[_0x4a5f('0x66')][_0x4a5f('0x52')]){_0xe6e2b7=_0x4a5f('0x67')+_0x3caef6;_0x23d82f[_0x4a5f('0x42')]('CREATE\x20TABLE\x20'+_0xe6e2b7+'\x20LIKE\x20cm_contacts;');}var _0x373d47=util[_0x4a5f('0x68')]('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',_0x1cf2e2,_0xe6e2b7,_0x4a6b57,_0x977457[_0x4a5f('0x1e')],_0x977457['CompanyId']||null,NOW,NOW);if(_[_0x4a5f('0x69')](_0x5b6c8c[_0x4a5f('0x56')])){_0x373d47+=',\x20scheduledAt\x20=\x20NOW()';}_0x23d82f[_0x4a5f('0x42')](_0x373d47);if(_0x977457[_0x4a5f('0x66')]&&_0x977457[_0x4a5f('0x66')][_0x4a5f('0x52')]){_0x23d82f[_0x4a5f('0x42')](insertCmContact(_0x977457[_0x4a5f('0x1e')],_0xe6e2b7,_0x977457[_0x4a5f('0x66')],_0x5b6c8c));_0x23d82f[_0x4a5f('0x42')](_0x4a5f('0x6a')+_0xe6e2b7+';');}_0x23d82f[_0x4a5f('0x42')](insertCmHopper(_0x977457['ListId'],'voice_queues_has_cm_lists',_0x4a5f('0x6b'),_0x4a5f('0x6c'),_0x2ce3e0));_0x23d82f['push'](insertCmHopperBlack(_0x977457[_0x4a5f('0x1e')],_0x4a5f('0x6d'),_0x4a5f('0x6b'),_0x4a5f('0x6c')));_0x23d82f['push'](insertCmHopper(_0x977457['ListId'],_0x4a5f('0x6e'),_0x4a5f('0x6f'),'CampaignId',_0x2ce3e0));_0x23d82f[_0x4a5f('0x42')](insertCmHopperBlack(_0x977457['ListId'],_0x4a5f('0x70'),_0x4a5f('0x6f'),_0x4a5f('0x71')));BPromise['each'](_0x23d82f,handleQuery)[_0x4a5f('0x72')](function(_0x1bf042){stats[_0x4a5f('0x73')]=!![];stats[_0x4a5f('0x74')]=_0x977457[_0x4a5f('0x66')]&&_0x977457[_0x4a5f('0x66')][_0x4a5f('0x52')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket['emit'](_0x4a5f('0x63')+_0x3caef6,stats);fs[_0x4a5f('0x75')](_0x523744);fs[_0x4a5f('0x75')](_0x1cf2e2);process['exit'](0x0);})[_0x4a5f('0x46')](function(_0x13bbb2){logger['error'](_0x13bbb2[_0x4a5f('0x3f')]);process[_0x4a5f('0x40')](0x1);});}catch(_0x45d4c9){logger[_0x4a5f('0x76')](_0x4a5f('0x77'),_0x45d4c9[_0x4a5f('0x3f')]);process[_0x4a5f('0x40')](0x1);}},'error':function(_0x18ba55,_0x10deb2,_0x8dee93,_0x19bf49){throw new Error(_0x19bf49);}});}function validate(){if(process[_0x4a5f('0x78')]&&process[_0x4a5f('0x78')][_0x4a5f('0x52')]<0x4){throw new Error(_0x4a5f('0x79'));}var _0x30e892=path[_0x4a5f('0xf')](config[_0x4a5f('0x4b')],_0x4a5f('0x4c'),process['argv'][0x2]);if(!fs[_0x4a5f('0x7a')](_0x30e892)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x41af05={};try{_0x41af05=JSON[_0x4a5f('0x50')](process[_0x4a5f('0x78')][0x3]);if(!_0x41af05[_0x4a5f('0x4a')]){throw new Error(_0x4a5f('0x7b'));}if(!_0x41af05[_0x4a5f('0x4a')][_0x4a5f('0xe')]){throw new Error(_0x4a5f('0x7c'));}if(!_0x41af05[_0x4a5f('0x4a')][_0x4a5f('0x5f')]){throw new Error(_0x4a5f('0x7d'));}var _0x5b6a52=0x0;if(_0x41af05['binding']['UserId']){_0x5b6a52=0x1;}if(!_0x41af05[_0x4a5f('0x1e')]){throw new Error(_0x4a5f('0x7e'));}}catch(_0x45e57a){throw new Error(_0x4a5f('0x7f'));}var _0x4823a9=[];try{_0x4823a9=_[_0x4a5f('0x80')](JSON[_0x4a5f('0x50')](process[_0x4a5f('0x78')][0x4]),'id');}catch(_0x3a6445){logger['info']('No\x20agent\x20available');}main(_0x30e892,_0x41af05,_0x4823a9,_0x5b6a52);}validate();process['on'](_0x4a5f('0x81'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index 69bb28c..4bf979b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e16=['[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','destcalleridnum','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','destexten','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','outbound','Called\x20Number','membername','uniqueid','starttime','Answer\x20Time','answertime','duration','Billable\x20Time','billableseconds','string'];(function(_0x5aa25d,_0xe97624){var _0x2e745f=function(_0x51232a){while(--_0x51232a){_0x5aa25d['push'](_0x5aa25d['shift']());}};_0x2e745f(++_0xe97624);}(_0x3e16,0xef));var _0x63e1=function(_0x764970,_0x1c7f1e){_0x764970=_0x764970-0x0;var _0x28458f=_0x3e16[_0x764970];return _0x28458f;};'use strict';exports['getSubjects']=function(_0x4f4802,_0x274346){var _0x10b552=[{'type':_0x63e1('0x0'),'content':_0x63e1('0x1'),'variableName':null}];switch(_0x4f4802[_0x63e1('0x2')]()){case _0x63e1('0x3'):switch(_0x274346[_0x63e1('0x2')]()){case'inbound':_0x10b552[_0x63e1('0x4')]({'type':_0x63e1('0x5'),'content':'','variableName':_0x63e1('0x6')});_0x10b552['push']({'type':_0x63e1('0x5'),'content':'','variableName':_0x63e1('0x7')});break;case'outbound':_0x10b552['push']({'type':_0x63e1('0x0'),'content':'Outbound\x20Call','variableName':null});_0x10b552[_0x63e1('0x4')]({'type':_0x63e1('0x5'),'content':'','variableName':_0x63e1('0x8')});break;}}return _0x10b552;};exports[_0x63e1('0x9')]=function(_0x582d91,_0x42a83a){var _0xe4cd5a=[];switch(_0x582d91['toLowerCase']()){case _0x63e1('0x3'):switch(_0x42a83a['toLowerCase']()){case _0x63e1('0xa'):_0xe4cd5a=[{'type':_0x63e1('0x0'),'content':_0x63e1('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0x63e1('0xc'),'content':'','key':_0x63e1('0xd'),'keyType':_0x63e1('0x5'),'variableName':_0x63e1('0x7')},{'type':_0x63e1('0xc'),'content':'','key':_0x63e1('0xe'),'keyType':_0x63e1('0x5'),'variableName':_0x63e1('0xf')},{'type':'keyValue','content':'','key':'Call\x20To','keyType':_0x63e1('0x5'),'variableName':_0x63e1('0x10')},{'type':_0x63e1('0xc'),'content':'','key':'Queue','keyType':_0x63e1('0x5'),'variableName':_0x63e1('0x6')},{'type':_0x63e1('0xc'),'content':'','key':_0x63e1('0x11'),'keyType':_0x63e1('0x5'),'variableName':'uniqueid'},{'type':_0x63e1('0xc'),'content':'','key':_0x63e1('0x12'),'keyType':_0x63e1('0x5'),'variableName':_0x63e1('0x13')},{'type':_0x63e1('0x0'),'content':_0x63e1('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x63e1('0xc'),'content':'','key':_0x63e1('0x15'),'keyType':_0x63e1('0x5'),'variableName':_0x63e1('0x16')},{'type':'keyValue','content':'','key':_0x63e1('0x17'),'keyType':_0x63e1('0x5'),'variableName':'destcalleridnum'},{'type':_0x63e1('0x0'),'content':_0x63e1('0x18'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0x63e1('0x5'),'variableName':_0x63e1('0x13')},{'type':_0x63e1('0xc'),'content':'','key':'Agent\x20Connect','keyType':_0x63e1('0x5'),'variableName':_0x63e1('0x19')},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':_0x63e1('0x5'),'variableName':_0x63e1('0x1a')},{'type':'keyValue','content':'','key':_0x63e1('0x1b'),'keyType':_0x63e1('0x5'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':_0x63e1('0x1c'),'keyType':_0x63e1('0x5'),'variableName':_0x63e1('0x1d')}];break;case _0x63e1('0x1e'):_0xe4cd5a=[{'type':_0x63e1('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x63e1('0xc'),'content':'','key':_0x63e1('0x1f'),'keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0x63e1('0xc'),'content':'','key':'Member\x20Name','keyType':_0x63e1('0x5'),'keyContent':'','variableName':_0x63e1('0x20')},{'type':_0x63e1('0xc'),'content':'','key':_0x63e1('0x11'),'keyType':_0x63e1('0x5'),'keyContent':'','variableName':_0x63e1('0x21')},{'type':_0x63e1('0xc'),'content':'','key':_0x63e1('0x12'),'keyType':'variable','keyContent':'','variableName':_0x63e1('0x22')},{'type':_0x63e1('0x0'),'content':_0x63e1('0x18')},{'type':_0x63e1('0xc'),'content':'','key':_0x63e1('0x23'),'keyType':_0x63e1('0x5'),'keyContent':'','variableName':_0x63e1('0x24')},{'type':'keyValue','content':'','key':'Complete\x20Time','keyType':_0x63e1('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0x63e1('0xc'),'content':'','key':'Duration','keyType':_0x63e1('0x5'),'keyContent':'','variableName':_0x63e1('0x25')},{'type':'keyValue','content':'','key':_0x63e1('0x26'),'keyType':'variable','keyContent':'','variableName':_0x63e1('0x27')}];break;}}return _0xe4cd5a;};
\ No newline at end of file
+var _0xee5e=['calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','destexten','queue','UniqueId','uniqueid','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xee5e,0x1bc));var _0xeee5=function(_0x567f14,_0x1fce0d){_0x567f14=_0x567f14-0x0;var _0x3c587f=_0xee5e[_0x567f14];return _0x3c587f;};'use strict';exports['getSubjects']=function(_0x3d341b,_0x41e8ae){var _0x169791=[{'type':_0xeee5('0x0'),'content':_0xeee5('0x1'),'variableName':null}];switch(_0x3d341b[_0xeee5('0x2')]()){case'voice':switch(_0x41e8ae[_0xeee5('0x2')]()){case _0xeee5('0x3'):_0x169791[_0xeee5('0x4')]({'type':_0xeee5('0x5'),'content':'','variableName':'queue'});_0x169791[_0xeee5('0x4')]({'type':'variable','content':'','variableName':_0xeee5('0x6')});break;case'outbound':_0x169791[_0xeee5('0x4')]({'type':_0xeee5('0x0'),'content':_0xeee5('0x7'),'variableName':null});_0x169791[_0xeee5('0x4')]({'type':_0xeee5('0x5'),'content':'','variableName':_0xeee5('0x8')});break;}}return _0x169791;};exports[_0xeee5('0x9')]=function(_0x56e59a,_0x56bfb9){var _0x5c37f6=[];switch(_0x56e59a[_0xeee5('0x2')]()){case _0xeee5('0xa'):switch(_0x56bfb9[_0xeee5('0x2')]()){case _0xeee5('0x3'):_0x5c37f6=[{'type':_0xeee5('0x0'),'content':_0xeee5('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0xd'),'keyType':'variable','variableName':_0xeee5('0x6')},{'type':'keyValue','content':'','key':_0xeee5('0xe'),'keyType':_0xeee5('0x5'),'variableName':_0xeee5('0xf')},{'type':_0xeee5('0xc'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0xeee5('0x10')},{'type':'keyValue','content':'','key':'Queue','keyType':_0xeee5('0x5'),'variableName':_0xeee5('0x11')},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x12'),'keyType':_0xeee5('0x5'),'variableName':_0xeee5('0x13')},{'type':_0xeee5('0xc'),'content':'','key':'Date','keyType':_0xeee5('0x5'),'variableName':_0xeee5('0x14')},{'type':_0xeee5('0x0'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xeee5('0x15'),'keyType':_0xeee5('0x5'),'variableName':_0xeee5('0x16')},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x17'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0xeee5('0x0'),'content':_0xeee5('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x19'),'keyType':_0xeee5('0x5'),'variableName':_0xeee5('0x14')},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x1a'),'keyType':'variable','variableName':_0xeee5('0x1b')},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x1c'),'keyType':_0xeee5('0x5'),'variableName':_0xeee5('0x1d')},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x1e'),'keyType':'variable','variableName':_0xeee5('0x1f')},{'type':'keyValue','content':'','key':_0xeee5('0x20'),'keyType':_0xeee5('0x5'),'variableName':_0xeee5('0x21')}];break;case'outbound':_0x5c37f6=[{'type':_0xeee5('0x0'),'content':_0xeee5('0xb'),'variableName':null},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x22'),'keyType':_0xeee5('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x23'),'keyType':_0xeee5('0x5'),'keyContent':'','variableName':'membername'},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x12'),'keyType':_0xeee5('0x5'),'keyContent':'','variableName':_0xeee5('0x13')},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x24'),'keyType':_0xeee5('0x5'),'keyContent':'','variableName':_0xeee5('0x25')},{'type':'string','content':'***\x20Time\x20Info\x20***'},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x26'),'keyType':'variable','keyContent':'','variableName':_0xeee5('0x27')},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x28'),'keyType':_0xeee5('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x29'),'keyType':'variable','keyContent':'','variableName':_0xeee5('0x2a')},{'type':_0xeee5('0xc'),'content':'','key':_0xeee5('0x2b'),'keyType':_0xeee5('0x5'),'keyContent':'','variableName':_0xeee5('0x2c')}];break;}}return _0x5c37f6;};
\ No newline at end of file
index 3655af6..8d1c3b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7884=['body','phone','fax','mobile','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','findOne','then','update','error','tracked','user','clone'];(function(_0x5e7733,_0x2ce554){var _0x6adcc7=function(_0x373937){while(--_0x373937){_0x5e7733['push'](_0x5e7733['shift']());}};_0x6adcc7(++_0x2ce554);}(_0x7884,0xac));var _0x4788=function(_0x1714b2,_0x5b728){_0x1714b2=_0x1714b2-0x0;var _0x510d01=_0x7884[_0x1714b2];return _0x510d01;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x4788('0x0'))(_0x4788('0x1')),'mail':require(_0x4788('0x0'))(_0x4788('0x2')),'fax':require(_0x4788('0x0'))(_0x4788('0x3')),'sms':require('../../config/logger')(_0x4788('0x4')),'chat':require(_0x4788('0x0'))('chat-interactions'),'whatsapp':require(_0x4788('0x0'))('whatsapp-interactions')};function getInteractionId(_0x3ba04f,_0x3c2306,_0x4d00ec){if(_0x3ba04f&&_0x3ba04f[_[_0x4788('0x5')](_0x4d00ec)+'InteractionId']){return _0x3ba04f[_[_0x4788('0x5')](_0x4d00ec)+_0x4788('0x6')];}else if(_0x3ba04f&&_0x3ba04f['id']){return _0x3ba04f['id'];}else if(_0x3c2306&&_0x3c2306['id']){return _0x3c2306['id'];}else{return _0x4788('0x7');}}function log(_0x1d7c57,_0x4013cd,_0x19538b,_0x592258,_0x3cfb57,_0x3ffa7f){loggers[_0x3cfb57['toLowerCase']()][_0x1d7c57](_0x4788('0x8'),_0x3ffa7f[_0x4788('0x9')](),_0x4013cd?_0x4013cd['id']:null,_0x4013cd?_0x4013cd['name']:null,_0x4013cd?_0x4013cd[_0x4788('0xa')]:null,getInteractionId(_0x19538b,_0x592258,_0x3cfb57),_0x19538b?JSON[_0x4788('0xb')](_0x19538b):_0x4788('0xc'));}function updateUser(_0x481052,_0x577128,_0x3adb16,_0xb278fc,_0x40625d){db[_[_0x4788('0x5')](_0xb278fc)+'Interaction'][_0x4788('0xd')]({'where':{'id':getInteractionId(_0x577128,_0x3adb16,_0xb278fc)}})[_0x4788('0xe')](function(_0x4dc431){if(_0x4dc431){return _0x4dc431[_0x4788('0xf')]({'UserId':_0x481052?_0x481052['id']:null});}})[_0x4788('0xe')](function(_0x31b93f){if(_0x31b93f){log('info',_0x481052,_0x577128,_0x3adb16,_0xb278fc,_0x40625d);}})['catch'](function(){log(_0x4788('0x10'),_0x481052,_0x577128,_0x3adb16,_0xb278fc,_0x40625d);});}exports[_0x4788('0x11')]=function(_0x403f95,_0x3e888b){return function(_0xb47262,_0xf1b416,_0x35a3ec){var _0x501270=_0xb47262[_0x4788('0x12')];var _0x1ec177={};var _0x1affe6=_0xb47262['query'];if(_0x1ec177){_0x1ec177=_[_0x4788('0x13')](_0xb47262[_0x4788('0x14')]);_0x1ec177=_['omit'](_0x1ec177,[_0x4788('0x14'),'html',_0x4788('0x15'),_0x4788('0x16'),_0x4788('0x17')]);}updateUser(_0x501270,_0x1ec177,_0x1affe6,_0x403f95,_0x3e888b);_0x35a3ec(null);};};
\ No newline at end of file
+var _0xced9=['InteractionId','upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','update','info','catch','error','tracked','user','clone','body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger','fax-interactions'];(function(_0x5498ea,_0x47969c){var _0x50d8e0=function(_0x1c59ae){while(--_0x1c59ae){_0x5498ea['push'](_0x5498ea['shift']());}};_0x50d8e0(++_0x47969c);}(_0xced9,0xc4));var _0x9ced=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xced9[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x9ced('0x0'));var db=require(_0x9ced('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x9ced('0x2'))('mail-interactions'),'fax':require(_0x9ced('0x2'))(_0x9ced('0x3')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x9ced('0x2'))('chat-interactions'),'whatsapp':require(_0x9ced('0x2'))('whatsapp-interactions')};function getInteractionId(_0x466a75,_0x35e328,_0x20ae8b){if(_0x466a75&&_0x466a75[_['upperFirst'](_0x20ae8b)+_0x9ced('0x4')]){return _0x466a75[_[_0x9ced('0x5')](_0x20ae8b)+_0x9ced('0x4')];}else if(_0x466a75&&_0x466a75['id']){return _0x466a75['id'];}else if(_0x35e328&&_0x35e328['id']){return _0x35e328['id'];}else{return _0x9ced('0x6');}}function log(_0x25cbee,_0x3aa252,_0xbde60c,_0x540d35,_0x1c4c67,_0x50979a){loggers[_0x1c4c67[_0x9ced('0x7')]()][_0x25cbee](_0x9ced('0x8'),_0x50979a['toUpperCase'](),_0x3aa252?_0x3aa252['id']:null,_0x3aa252?_0x3aa252[_0x9ced('0x9')]:null,_0x3aa252?_0x3aa252[_0x9ced('0xa')]:null,getInteractionId(_0xbde60c,_0x540d35,_0x1c4c67),_0xbde60c?JSON[_0x9ced('0xb')](_0xbde60c):_0x9ced('0xc'));}function updateUser(_0x38b1dd,_0xcba9ec,_0xc95940,_0x3d502c,_0x1e56e0){db[_[_0x9ced('0x5')](_0x3d502c)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0xcba9ec,_0xc95940,_0x3d502c)}})['then'](function(_0x10b618){if(_0x10b618){return _0x10b618[_0x9ced('0xd')]({'UserId':_0x38b1dd?_0x38b1dd['id']:null});}})['then'](function(_0x3acf86){if(_0x3acf86){log(_0x9ced('0xe'),_0x38b1dd,_0xcba9ec,_0xc95940,_0x3d502c,_0x1e56e0);}})[_0x9ced('0xf')](function(){log(_0x9ced('0x10'),_0x38b1dd,_0xcba9ec,_0xc95940,_0x3d502c,_0x1e56e0);});}exports[_0x9ced('0x11')]=function(_0x5f3964,_0x573dac){return function(_0xfd24a5,_0x199867,_0x53047c){var _0x2d5393=_0xfd24a5[_0x9ced('0x12')];var _0x125529={};var _0x17bf73=_0xfd24a5['query'];if(_0x125529){_0x125529=_[_0x9ced('0x13')](_0xfd24a5[_0x9ced('0x14')]);_0x125529=_[_0x9ced('0x15')](_0x125529,[_0x9ced('0x14'),_0x9ced('0x16'),_0x9ced('0x17'),_0x9ced('0x18'),'mobile']);}updateUser(_0x2d5393,_0x125529,_0x17bf73,_0x5f3964,_0x573dac);_0x53047c(null);};};
\ No newline at end of file
index b99cea9..1c5c357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf33=['update','utf8','final','parse','hasOwnProperty','use','findOne','then','count','json','catch','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','aes-256-ctr'];(function(_0x96988a,_0x43e539){var _0x3f6ad9=function(_0x292e73){while(--_0x292e73){_0x96988a['push'](_0x96988a['shift']());}};_0x3f6ad9(++_0x43e539);}(_0xdf33,0x151));var _0x3df3=function(_0x50678a,_0x28f61a){_0x50678a=_0x50678a-0x0;var _0x5a319a=_0xdf33[_0x50678a];return _0x5a319a;};'use strict';var crypto=require(_0x3df3('0x0'));var util=require(_0x3df3('0x1'));var compose=require(_0x3df3('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x3df3('0x3'));function getValueFromLicense(_0x2595c9,_0xd2b52){if(_0x2595c9&&_0xd2b52){if(_0xd2b52[_0x3df3('0x4')]&&_0xd2b52[_0x3df3('0x5')]){var _0x4e53dc=_0xd2b52['data1'];var _0x2bca13=_0xd2b52[_0x3df3('0x5')];var _0x11bd0b=_0x4e53dc[_0x3df3('0x6')]('-')[0x4];var _0x41c67f=_0x4e53dc[_0x3df3('0x6')]('-')[0x0];var _0x47401d=crypto['createDecipher'](_0x3df3('0x7'),util['format']('%s:%s:%s',_0x11bd0b,_0x4e53dc,_0x41c67f));var _0x41b0b5=_0x47401d[_0x3df3('0x8')](_0x2bca13,'base64',_0x3df3('0x9'));_0x41b0b5+=_0x47401d[_0x3df3('0xa')](_0x3df3('0x9'));var _0x5c08fb=JSON[_0x3df3('0xb')](_0x41b0b5);return _0x5c08fb[_0x3df3('0xc')](_0x2595c9)?_0x5c08fb[_0x2595c9]:null;}}return null;}function isLimit(_0x3602c0,_0x4e7221,_0x149d09,_0x189441){var _0x41bdd5=_0x4e7221;return compose()[_0x3df3('0xd')](function(_0x890318,_0x9b8e0,_0x198293){return db['License'][_0x3df3('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x3df3('0xf')](function(_0x5ee264){var _0x365e3a=getValueFromLicense(_0x3602c0,_0x5ee264);return _0x365e3a?_0x365e3a:_0x41bdd5;})['then'](function(_0x5208fd){_0x41bdd5=_0x5208fd;return _0x149d09[_0x3df3('0x10')](_0x189441);})[_0x3df3('0xf')](function(_0x186d61){if(_0x186d61>=_0x41bdd5){return _0x9b8e0['status'](0x193)[_0x3df3('0x11')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x3602c0)});}_0x198293();})[_0x3df3('0x12')](function(_0x5b18a3){_0x198293(_0x5b18a3);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x3df3('0x13')],{'where':{'$or':[{'role':_0x3df3('0x14')},{'role':_0x3df3('0x15')}]}});}exports[_0x3df3('0x16')]=isUserLimit;
\ No newline at end of file
+var _0x7631=['catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','parse','use','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0xd3096c,_0x14c2b1){var _0x7c9368=function(_0x487b40){while(--_0x487b40){_0xd3096c['push'](_0xd3096c['shift']());}};_0x7c9368(++_0x14c2b1);}(_0x7631,0x164));var _0x1763=function(_0x20718f,_0x3734c8){_0x20718f=_0x20718f-0x0;var _0x472856=_0x7631[_0x20718f];return _0x472856;};'use strict';var crypto=require(_0x1763('0x0'));var util=require(_0x1763('0x1'));var compose=require(_0x1763('0x2'));var db=require(_0x1763('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x4f25ae,_0x3def2b){if(_0x4f25ae&&_0x3def2b){if(_0x3def2b['data1']&&_0x3def2b[_0x1763('0x4')]){var _0x3968f7=_0x3def2b['data1'];var _0x54cd1b=_0x3def2b[_0x1763('0x4')];var _0x8e37a6=_0x3968f7['split']('-')[0x4];var _0x12c5d8=_0x3968f7[_0x1763('0x5')]('-')[0x0];var _0x3729f7=crypto[_0x1763('0x6')]('aes-256-ctr',util[_0x1763('0x7')](_0x1763('0x8'),_0x8e37a6,_0x3968f7,_0x12c5d8));var _0x1cd8c0=_0x3729f7[_0x1763('0x9')](_0x54cd1b,_0x1763('0xa'),_0x1763('0xb'));_0x1cd8c0+=_0x3729f7['final'](_0x1763('0xb'));var _0x524d3a=JSON[_0x1763('0xc')](_0x1cd8c0);return _0x524d3a['hasOwnProperty'](_0x4f25ae)?_0x524d3a[_0x4f25ae]:null;}}return null;}function isLimit(_0x45cddb,_0x327138,_0x3f77c8,_0x7048a4){var _0x479a43=_0x327138;return compose()[_0x1763('0xd')](function(_0x5cb38d,_0x3949fa,_0x544c7a){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x1763('0xe')](function(_0x207f69){var _0x181407=getValueFromLicense(_0x45cddb,_0x207f69);return _0x181407?_0x181407:_0x479a43;})['then'](function(_0x177188){_0x479a43=_0x177188;return _0x3f77c8[_0x1763('0xf')](_0x7048a4);})[_0x1763('0xe')](function(_0x1cd05d){if(_0x1cd05d>=_0x479a43){return _0x3949fa[_0x1763('0x10')](0x193)[_0x1763('0x11')]({'message':util[_0x1763('0x7')](_0x1763('0x12'),_0x45cddb)});}_0x544c7a();})[_0x1763('0x13')](function(_0x4e2851){_0x544c7a(_0x4e2851);});});}function isUserLimit(){return isLimit(_0x1763('0x14'),0x1,db[_0x1763('0x15')],{'where':{'$or':[{'role':_0x1763('0x16')},{'role':_0x1763('0x17')}]}});}exports[_0x1763('0x18')]=isUserLimit;
\ No newline at end of file
index e3f9c05..b4ba7bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc4a=['DATE','operator','$eq','$between','value','includes','$gt','$lte','add','YYYY-MM-DD','castTo','field','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','conditions','push'];(function(_0xd60cb,_0x25496e){var _0x47eecd=function(_0x19c183){while(--_0x19c183){_0xd60cb['push'](_0xd60cb['shift']());}};_0x47eecd(++_0x25496e);}(_0xfc4a,0x1ae));var _0xafc4=function(_0x2f57c8,_0x4b9987){_0x2f57c8=_0x2f57c8-0x0;var _0x4b7310=_0xfc4a[_0x2f57c8];return _0x4b7310;};'use strict';var _=require(_0xafc4('0x0'));var moment=require('moment');exports[_0xafc4('0x1')]=function(_0x1963ea){var _0x2d7d5b={'conditions':[]};_0x2d7d5b[_0xafc4('0x2')]=_[_0xafc4('0x3')](_0x1963ea,_0xafc4('0x4'))?'or':_0xafc4('0x5');var _0x95d25=_0x1963ea[_0xafc4('0x6')](_0xafc4('0x7'),'')[_0xafc4('0x6')]('[$or]','')[_0xafc4('0x8')]('||');for(var _0xcdbbe2=0x0;_0xcdbbe2<_0x95d25[_0xafc4('0x9')];_0xcdbbe2++){var _0x1d3419=_0x95d25[_0xcdbbe2][_0xafc4('0x8')](':=');var _0x472b8c=_0x1d3419[0x0];var _0x190737=_0x1d3419[_0xafc4('0xa')](0x1);_0x190737[_0xafc4('0xb')](function(_0x544071){var _0x5d20a9=_0x544071[_0xafc4('0x8')]('[')[_0xafc4('0xc')]();var _0x42e98b=_0x544071[_0xafc4('0xd')](/\[(.*?)\]/g);_0x42e98b['forEach'](function(_0x1ecbef){var _0x370ad5=_0x1ecbef[_0xafc4('0x8')]('[')[_0xafc4('0xe')](function(_0x57010e){return _0x57010e[_0xafc4('0xf')](']')>-0x1;})['map'](function(_0x1d69cb){return _0x1d69cb[_0xafc4('0x8')](']')[0x0];})[0x0];_0x2d7d5b[_0xafc4('0x10')][_0xafc4('0x11')]({'field':_0x472b8c,'operator':_0x5d20a9,'value':_0x370ad5});});});}return _0x2d7d5b;};exports['buildExpression']=function(_0x24d1de,_0x20d5f3,_0x2c24cf){var _0x9fcc65={};if(_0x20d5f3===_0xafc4('0x12')){if(_0x2c24cf[_0xafc4('0x13')]===_0xafc4('0x14')){_0x2c24cf[_0xafc4('0x13')]=_0xafc4('0x15');_0x2c24cf[_0xafc4('0x16')]+=','+_0x2c24cf[_0xafc4('0x16')];}else if(_[_0xafc4('0x17')]([_0xafc4('0x18'),_0xafc4('0x19')],_0x2c24cf[_0xafc4('0x13')])){_0x2c24cf[_0xafc4('0x16')]=moment(_0x2c24cf[_0xafc4('0x16')])[_0xafc4('0x1a')](0x1,'days')['format'](_0xafc4('0x1b'));}}if(_0x2c24cf[_0xafc4('0x1c')]){_0x20d5f3=_0x2c24cf[_0xafc4('0x1c')];_0x9fcc65['text']='CAST('+_0x24d1de+'.'+_0x2c24cf[_0xafc4('0x1d')]+'\x20AS\x20'+_0x2c24cf['castTo']+')\x20'+parseOperator(_0x2c24cf[_0xafc4('0x13')]);}else{_0x9fcc65[_0xafc4('0x1e')]=_0x24d1de+'.'+_0x2c24cf[_0xafc4('0x1d')]+'\x20'+parseOperator(_0x2c24cf[_0xafc4('0x13')]);}if(_['includes']([_0xafc4('0x1f'),_0xafc4('0x20')],_0x2c24cf[_0xafc4('0x13')]))_0x9fcc65[_0xafc4('0x1e')]='('+_0x9fcc65[_0xafc4('0x1e')]+_0xafc4('0x21')+_0x24d1de+'.'+_0x2c24cf[_0xafc4('0x1d')]+_0xafc4('0x22');_0x9fcc65[_0xafc4('0x16')]=parseValue(_0x20d5f3,_0x2c24cf['operator'],_0x2c24cf[_0xafc4('0x16')]);return _0x9fcc65;};function parseOperator(_0x236f3d){var _0x12aab5;switch(_0x236f3d){case _0xafc4('0x23'):_0x12aab5=_0xafc4('0x24');break;case _0xafc4('0x20'):_0x12aab5=_0xafc4('0x25');break;case _0xafc4('0x14'):_0x12aab5=_0xafc4('0x26');break;case _0xafc4('0x1f'):_0x12aab5=_0xafc4('0x27');break;case _0xafc4('0x28'):case _0xafc4('0x29'):case _0xafc4('0x2a'):_0x12aab5=_0xafc4('0x2b');break;case _0xafc4('0x2c'):_0x12aab5=_0xafc4('0x2d');break;case _0xafc4('0x18'):_0x12aab5=_0xafc4('0x2e');break;case _0xafc4('0x19'):_0x12aab5=_0xafc4('0x2f');break;case _0xafc4('0x30'):_0x12aab5='>=\x20?';break;case _0xafc4('0x15'):_0x12aab5=_0xafc4('0x31');break;}return _0x12aab5;}function parseValue(_0xea2563,_0x342fb0,_0x6fa7f){var _0x12872a={'start':undefined,'end':undefined};switch(_0x342fb0){case _0xafc4('0x23'):case'$notIn':_0x12872a[_0xafc4('0x32')]=_0x6fa7f[_0xafc4('0x8')](',');break;case _0xafc4('0x28'):_0x12872a[_0xafc4('0x32')]='%'+_0x6fa7f+'%';break;case'$startsWith':_0x12872a['start']=_0x6fa7f+'%';break;case _0xafc4('0x2a'):_0x12872a[_0xafc4('0x32')]='%'+_0x6fa7f;break;case _0xafc4('0x15'):var _0x5f1e24=_0x6fa7f[_0xafc4('0x8')](',');var _0x6fa7f=_0x5f1e24[_0xafc4('0xc')]();var _0x8388b7=_0x5f1e24[_0xafc4('0x33')]();if(_0xea2563===_0xafc4('0x12')){_0x6fa7f=moment(_0x6fa7f)[_0xafc4('0x34')](0x0,!![])['format']();_0x8388b7=moment(_0x8388b7)[_0xafc4('0x34')](0x0,!![])['add'](0x17,_0xafc4('0x35'))[_0xafc4('0x1a')](0x3b,_0xafc4('0x36'))[_0xafc4('0x1a')](0x3b,_0xafc4('0x37'))['format']();}_0x12872a={'start':_0x6fa7f,'end':_0x8388b7};break;default:_0x12872a[_0xafc4('0x32')]=_0x6fa7f;break;}return _0x12872a;}
\ No newline at end of file
+var _0x0584=['\x20OR\x20','\x20IS\x20NULL)','IN\x20?','=\x20?','$ne','<>\x20?','$substring','LIKE\x20?','$lt','<\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','pop','utcOffset','hours','seconds','lodash','parseSearch','sqlOperator','and','replace','[$or]','split','length','slice','shift','match','forEach','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','includes','$gt','add','days','format','YYYY-MM-DD','CAST(','field','$notIn','text'];(function(_0x586a6d,_0x7bd37c){var _0x486435=function(_0x1f8010){while(--_0x1f8010){_0x586a6d['push'](_0x586a6d['shift']());}};_0x486435(++_0x7bd37c);}(_0x0584,0x159));var _0x4058=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x0584[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x4058('0x0'));var moment=require('moment');exports[_0x4058('0x1')]=function(_0x3ade17){var _0x5492e3={'conditions':[]};_0x5492e3[_0x4058('0x2')]=_['startsWith'](_0x3ade17,'[$or]')?'or':_0x4058('0x3');var _0x1eb82d=_0x3ade17[_0x4058('0x4')]('[$and]','')[_0x4058('0x4')](_0x4058('0x5'),'')[_0x4058('0x6')]('||');for(var _0x456e70=0x0;_0x456e70<_0x1eb82d[_0x4058('0x7')];_0x456e70++){var _0x24baca=_0x1eb82d[_0x456e70][_0x4058('0x6')](':=');var _0x43e38a=_0x24baca[0x0];var _0x4a3bcc=_0x24baca[_0x4058('0x8')](0x1);_0x4a3bcc['forEach'](function(_0x3701e5){var _0x187f3a=_0x3701e5[_0x4058('0x6')]('[')[_0x4058('0x9')]();var _0x416b97=_0x3701e5[_0x4058('0xa')](/\[(.*?)\]/g);_0x416b97[_0x4058('0xb')](function(_0x1b0074){var _0x5ab31d=_0x1b0074[_0x4058('0x6')]('[')[_0x4058('0xc')](function(_0x719a33){return _0x719a33[_0x4058('0xd')](']')>-0x1;})[_0x4058('0xe')](function(_0x49a975){return _0x49a975[_0x4058('0x6')](']')[0x0];})[0x0];_0x5492e3[_0x4058('0xf')][_0x4058('0x10')]({'field':_0x43e38a,'operator':_0x187f3a,'value':_0x5ab31d});});});}return _0x5492e3;};exports[_0x4058('0x11')]=function(_0x1c195e,_0x136a79,_0x236a33){var _0x10afbb={};if(_0x136a79===_0x4058('0x12')){if(_0x236a33[_0x4058('0x13')]===_0x4058('0x14')){_0x236a33[_0x4058('0x13')]=_0x4058('0x15');_0x236a33[_0x4058('0x16')]+=','+_0x236a33['value'];}else if(_[_0x4058('0x17')]([_0x4058('0x18'),'$lte'],_0x236a33['operator'])){_0x236a33[_0x4058('0x16')]=moment(_0x236a33[_0x4058('0x16')])[_0x4058('0x19')](0x1,_0x4058('0x1a'))[_0x4058('0x1b')](_0x4058('0x1c'));}}if(_0x236a33['castTo']){_0x136a79=_0x236a33['castTo'];_0x10afbb['text']=_0x4058('0x1d')+_0x1c195e+'.'+_0x236a33[_0x4058('0x1e')]+'\x20AS\x20'+_0x236a33['castTo']+')\x20'+parseOperator(_0x236a33[_0x4058('0x13')]);}else{_0x10afbb['text']=_0x1c195e+'.'+_0x236a33[_0x4058('0x1e')]+'\x20'+parseOperator(_0x236a33[_0x4058('0x13')]);}if(_[_0x4058('0x17')](['$ne',_0x4058('0x1f')],_0x236a33[_0x4058('0x13')]))_0x10afbb[_0x4058('0x20')]='('+_0x10afbb['text']+_0x4058('0x21')+_0x1c195e+'.'+_0x236a33[_0x4058('0x1e')]+_0x4058('0x22');_0x10afbb[_0x4058('0x16')]=parseValue(_0x136a79,_0x236a33[_0x4058('0x13')],_0x236a33[_0x4058('0x16')]);return _0x10afbb;};function parseOperator(_0x3f466d){var _0x119b45;switch(_0x3f466d){case'$in':_0x119b45=_0x4058('0x23');break;case _0x4058('0x1f'):_0x119b45='NOT\x20IN\x20?';break;case _0x4058('0x14'):_0x119b45=_0x4058('0x24');break;case _0x4058('0x25'):_0x119b45=_0x4058('0x26');break;case _0x4058('0x27'):case'$startsWith':case'$endsWith':_0x119b45=_0x4058('0x28');break;case _0x4058('0x29'):_0x119b45=_0x4058('0x2a');break;case'$gt':_0x119b45='>\x20?';break;case _0x4058('0x2b'):_0x119b45=_0x4058('0x2c');break;case _0x4058('0x2d'):_0x119b45=_0x4058('0x2e');break;case _0x4058('0x15'):_0x119b45=_0x4058('0x2f');break;}return _0x119b45;}function parseValue(_0x17f29e,_0x3a13f8,_0x4392c1){var _0x1a1c65={'start':undefined,'end':undefined};switch(_0x3a13f8){case _0x4058('0x30'):case _0x4058('0x1f'):_0x1a1c65['start']=_0x4392c1['split'](',');break;case _0x4058('0x27'):_0x1a1c65[_0x4058('0x31')]='%'+_0x4392c1+'%';break;case'$startsWith':_0x1a1c65['start']=_0x4392c1+'%';break;case'$endsWith':_0x1a1c65[_0x4058('0x31')]='%'+_0x4392c1;break;case'$between':var _0x4280f3=_0x4392c1[_0x4058('0x6')](',');var _0x4392c1=_0x4280f3[_0x4058('0x9')]();var _0x24f92e=_0x4280f3[_0x4058('0x32')]();if(_0x17f29e===_0x4058('0x12')){_0x4392c1=moment(_0x4392c1)[_0x4058('0x33')](0x0,!![])[_0x4058('0x1b')]();_0x24f92e=moment(_0x24f92e)[_0x4058('0x33')](0x0,!![])[_0x4058('0x19')](0x17,_0x4058('0x34'))[_0x4058('0x19')](0x3b,'minutes')[_0x4058('0x19')](0x3b,_0x4058('0x35'))[_0x4058('0x1b')]();}_0x1a1c65={'start':_0x4392c1,'end':_0x24f92e};break;default:_0x1a1c65[_0x4058('0x31')]=_0x4392c1;break;}return _0x1a1c65;}
\ No newline at end of file
index d32cc05..1b8111b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x945e=['omit','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','includes','push','join','getOptions','query','$id','intersection','attributes','model','fields','nolimit','order','where','pick','filters','filter','VIRTUAL','lower','options','lodash','sequelize','moment','parse','keys','split','isEmpty','forOwn','find','type','DATE','$gte','format','utc','$lte','YYYY-MM-DD','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','unsigned','substr','DESC','col','ASC','length'];(function(_0x95388c,_0x4d7cfc){var _0x4070f6=function(_0x3d58db){while(--_0x3d58db){_0x95388c['push'](_0x95388c['shift']());}};_0x4070f6(++_0x4d7cfc);}(_0x945e,0x14e));var _0xe945=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x945e[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0xe945('0x0'));var sequelize=require(_0xe945('0x1'));var moment=require(_0xe945('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x212a11){var _0x43a2a9=['ne'];try{var _0x2de4d1=JSON[_0xe945('0x3')](_0x212a11);var _0x4431a9=Object[_0xe945('0x4')](_0x2de4d1)[0x0];return _0x43a2a9['includes'](_0x4431a9);}catch(_0x378c5a){return![];}}function getOperatorValue(_0x4ec144){var _0x1ce413=JSON[_0xe945('0x3')](_0x4ec144);var _0x7aba83=Object[_0xe945('0x4')](_0x1ce413)[0x0];var _0x45b044=_0x1ce413[_0x7aba83];return{['$'+_0x7aba83]:_0x45b044};}exports['fields']=function(_0x23c820){var _0x3119f9=null;if(_0x23c820){_0x3119f9=_0x23c820[_0xe945('0x5')](',');}return _0x3119f9;};exports['filters']=function(_0x2f5726,_0x36468e){var _0x2e0821={};if(!_[_0xe945('0x6')](_0x2f5726)){_[_0xe945('0x7')](_0x2f5726,function(_0x5ce548,_0x1ad040){try{if(_0x36468e){var _0x483f2b=_[_0xe945('0x8')](_0x36468e,{'name':_0x1ad040})||{};if(hasSequelizeOperator(_0x5ce548)){_0x2e0821[_0x1ad040]=getOperatorValue(_0x5ce548);}else if(_0x483f2b[_0xe945('0x9')]===_0xe945('0xa')&&_['isPlainObject'](_0x5ce548)){var _0xfcebb9=JSON['parse'](_0x5ce548);var _0x561301={'$gte':moment(moment(_0xfcebb9[_0xe945('0xb')])[_0xe945('0xc')]('YYYY-MM-DD'))[_0xe945('0xd')]()[_0xe945('0xc')](),'$lte':moment(moment(_0xfcebb9[_0xe945('0xe')])[_0xe945('0xc')](_0xe945('0xf')))['utc']()['subtract'](0x1,'s')[_0xe945('0xc')]()};_0x2e0821[_0x1ad040]=_0x561301;}else if(_0x483f2b[_0xe945('0x10')]===_0xe945('0x11')){_0x2e0821[_0x1ad040]=_0x5ce548;}else{_0x2e0821[_0x1ad040]=_[_0xe945('0x12')](_0x5ce548)?_0x5ce548:JSON[_0xe945('0x3')](_0x5ce548);}}else{_0x2e0821[_0x1ad040]=_['isArray'](_0x5ce548)?_0x5ce548:JSON['parse'](_0x5ce548);}}catch(_0x17d8ed){_0x2e0821[_0x1ad040]=_0x5ce548[_0xe945('0x5')](',');}});}return _0x2e0821;};exports[_0xe945('0x13')]=function(_0x55f04e){_0x55f04e=parseInt(_0x55f04e,0xa);if(!_0x55f04e||_0x55f04e<0x0){_0x55f04e=LIMIT_VALUE;}return _0x55f04e;};exports[_0xe945('0x14')]=function(_0x2ca7d6){_0x2ca7d6=parseInt(_0x2ca7d6,0xa);if(!_0x2ca7d6||_0x2ca7d6<0x0){_0x2ca7d6=0x0;}return _0x2ca7d6;};exports[_0xe945('0x15')]=function(_0x55a9ff){var _0x2f8b5d,_0x129eb0=null;if(_0x55a9ff){_0x2f8b5d=_0x55a9ff[_0xe945('0x5')](',');_0x129eb0=_[_0xe945('0x16')](_0x2f8b5d,function(_0x2b6c23){if(_0x2b6c23[_0xe945('0x17')]('-')===0x0){return[_0x2b6c23===_0xe945('0x18')?sequelize[_0xe945('0x19')](sequelize['col'](_0xe945('0x18')),_0xe945('0x1a')):_0x2b6c23[_0xe945('0x1b')](0x1),_0xe945('0x1c')];}else{return[_0x2b6c23===_0xe945('0x18')?sequelize[_0xe945('0x19')](sequelize[_0xe945('0x1d')]('priority'),_0xe945('0x1a')):_0x2b6c23,_0xe945('0x1e')];}});}return _0x129eb0;};exports['omit']=function(_0x5e8377,_0x21fad9){if(_[_0xe945('0x6')](_0x5e8377)){return _0x5e8377;}if(_[_0xe945('0x12')](_0x5e8377)){for(var _0x38b2f3=0x0;_0x38b2f3<_0x5e8377[_0xe945('0x1f')];_0x38b2f3+=0x1){_0x5e8377[_0x38b2f3]=this[_0xe945('0x20')](_0x5e8377[_0x38b2f3],_0x21fad9);}return _0x5e8377;}if(!_[_0xe945('0x21')](_0x5e8377)){return _0x5e8377;}if(_[_0xe945('0x22')](_0x21fad9)){_0x21fad9=[_0x21fad9];}if(!_[_0xe945('0x12')](_0x21fad9)){return _0x5e8377;}for(var _0x3e7da3=0x0;_0x3e7da3<_0x21fad9[_0xe945('0x1f')];_0x3e7da3+=0x1){_['unset'](_0x5e8377,_0x21fad9[_0x3e7da3]);}for(var _0x20fc83 in _0x5e8377){if(_0x5e8377[_0xe945('0x23')](_0x20fc83)){_0x5e8377[_0x20fc83]=this[_0xe945('0x20')](_0x5e8377[_0x20fc83],_0x21fad9);}}return _0x5e8377;};exports[_0xe945('0x24')]=function(_0x942d5){return _0x942d5[_0xe945('0x25')](RegExp(_0xe945('0x26')))?!![]:![];};exports['isEmail']=function(_0x1d1622){return _0x1d1622[_0xe945('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xe945('0x27')]=function(_0x453c1c){var _0x337e5f=[];_0x453c1c[_0xe945('0x5')](/[ ,]+/)[_0xe945('0x28')](function(_0x4aa1e2){_0x4aa1e2=_0x4aa1e2[_0xe945('0x29')](/([^:]")"+/g,'$1');_0x4aa1e2='+'+_0x4aa1e2+'*';if(_0x4aa1e2[_0xe945('0x2a')]('@'))_0x4aa1e2='\x22'+_0x4aa1e2+'\x22';_0x337e5f[_0xe945('0x2b')](_0x4aa1e2);});return _0x337e5f[_0xe945('0x2c')]('\x20');};exports[_0xe945('0x2d')]=function(_0x5164bc,_0x473b79,_0x180a85){var _0x6126e2={},_0x190659={};if(_0x473b79[_0xe945('0x2e')][_0xe945('0x2f')]){_0x473b79[_0xe945('0x2e')]['id']=_0x473b79[_0xe945('0x2e')][_0xe945('0x2f')];delete _0x473b79[_0xe945('0x2e')][_0xe945('0x2f')];}_0x6126e2['model']=_[_0xe945('0x16')](_0x5164bc,_0xe945('0x10'));_0x6126e2[_0xe945('0x2e')]=_['keys'](_0x473b79['query']);_0x6126e2['filters']=_[_0xe945('0x30')](_0x6126e2['model'],_0x6126e2[_0xe945('0x2e')]);_0x190659[_0xe945('0x31')]=_[_0xe945('0x30')](_0x6126e2[_0xe945('0x32')],this[_0xe945('0x33')](_0x473b79[_0xe945('0x2e')][_0xe945('0x33')]));_0x190659[_0xe945('0x31')]=_0x190659['attributes'][_0xe945('0x1f')]?_0x190659[_0xe945('0x31')]:_0x6126e2[_0xe945('0x32')];if(!_0x473b79[_0xe945('0x2e')]['hasOwnProperty'](_0xe945('0x34'))){_0x190659['limit']=this[_0xe945('0x13')](_0x473b79[_0xe945('0x2e')]['limit']);_0x190659[_0xe945('0x14')]=this[_0xe945('0x14')](_0x473b79[_0xe945('0x2e')][_0xe945('0x14')]);}_0x190659[_0xe945('0x35')]=this['sort'](_0x473b79[_0xe945('0x2e')]['sort']);_0x190659[_0xe945('0x36')]=this['filters'](_[_0xe945('0x37')](_0x473b79['query'],_0x6126e2[_0xe945('0x38')]),_0x5164bc);if(_0x473b79[_0xe945('0x2e')][_0xe945('0x39')]){_0x190659[_0xe945('0x36')]=_['merge'](_0x190659['where'],{'$or':_[_0xe945('0x16')](_0x5164bc,function(_0x49d1e1){if(_0x49d1e1[_0xe945('0x9')]!==_0xe945('0x3a')){if(_0x180a85){return sequelize[_0xe945('0x36')](sequelize['fn'](_0xe945('0x3b'),sequelize[_0xe945('0x1d')](_0x49d1e1[_0xe945('0x10')])),{'$like':sequelize['fn'](_0xe945('0x3b'),'%'+_0x473b79['query'][_0xe945('0x39')]+'%')});}else{var _0x486609={};_0x486609[_0x49d1e1[_0xe945('0x10')]]={'$like':'%'+_0x473b79['query']['filter']+'%'};return _0x486609;}}})});}_0x190659=_['merge']({},_0x190659,_0x473b79[_0xe945('0x3c')]);return _0x190659;};
\ No newline at end of file
+var _0x0cd1=['omit','isObject','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','forEach','replace','push','query','$id','model','intersection','attributes','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','lower','options','sequelize','moment','parse','includes','fields','split','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','map','indexOf','priority','cast','col','unsigned','DESC','ASC','length'];(function(_0x3b81eb,_0x175f32){var _0x149491=function(_0x454753){while(--_0x454753){_0x3b81eb['push'](_0x3b81eb['shift']());}};_0x149491(++_0x175f32);}(_0x0cd1,0x131));var _0x10cd=function(_0x770f7,_0x3af003){_0x770f7=_0x770f7-0x0;var _0xe797c6=_0x0cd1[_0x770f7];return _0xe797c6;};'use strict';var _=require('lodash');var sequelize=require(_0x10cd('0x0'));var moment=require(_0x10cd('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x297bde){var _0x4dfbf0=['ne'];try{var _0x539cfb=JSON[_0x10cd('0x2')](_0x297bde);var _0x38abcb=Object['keys'](_0x539cfb)[0x0];return _0x4dfbf0[_0x10cd('0x3')](_0x38abcb);}catch(_0x4df1ea){return![];}}function getOperatorValue(_0xde2e54){var _0x50e5ac=JSON[_0x10cd('0x2')](_0xde2e54);var _0x5417d5=Object['keys'](_0x50e5ac)[0x0];var _0x4acf54=_0x50e5ac[_0x5417d5];return{['$'+_0x5417d5]:_0x4acf54};}exports[_0x10cd('0x4')]=function(_0x1ce78e){var _0x25fb58=null;if(_0x1ce78e){_0x25fb58=_0x1ce78e[_0x10cd('0x5')](',');}return _0x25fb58;};exports[_0x10cd('0x6')]=function(_0x287a15,_0x4e53b8){var _0x1d4293={};if(!_[_0x10cd('0x7')](_0x287a15)){_[_0x10cd('0x8')](_0x287a15,function(_0x2fa216,_0x46254f){try{if(_0x4e53b8){var _0x17de52=_['find'](_0x4e53b8,{'name':_0x46254f})||{};if(hasSequelizeOperator(_0x2fa216)){_0x1d4293[_0x46254f]=getOperatorValue(_0x2fa216);}else if(_0x17de52[_0x10cd('0x9')]===_0x10cd('0xa')&&_[_0x10cd('0xb')](_0x2fa216)){var _0x450e8b=JSON[_0x10cd('0x2')](_0x2fa216);var _0x56f606={'$gte':moment(moment(_0x450e8b[_0x10cd('0xc')])[_0x10cd('0xd')](_0x10cd('0xe')))[_0x10cd('0xf')]()[_0x10cd('0xd')](),'$lte':moment(moment(_0x450e8b[_0x10cd('0x10')])[_0x10cd('0xd')]('YYYY-MM-DD'))['utc']()[_0x10cd('0x11')](0x1,'s')['format']()};_0x1d4293[_0x46254f]=_0x56f606;}else if(_0x17de52[_0x10cd('0x12')]===_0x10cd('0x13')){_0x1d4293[_0x46254f]=_0x2fa216;}else{_0x1d4293[_0x46254f]=_[_0x10cd('0x14')](_0x2fa216)?_0x2fa216:JSON['parse'](_0x2fa216);}}else{_0x1d4293[_0x46254f]=_[_0x10cd('0x14')](_0x2fa216)?_0x2fa216:JSON['parse'](_0x2fa216);}}catch(_0x540403){_0x1d4293[_0x46254f]=_0x2fa216[_0x10cd('0x5')](',');}});}return _0x1d4293;};exports['limit']=function(_0x17cbac){_0x17cbac=parseInt(_0x17cbac,0xa);if(!_0x17cbac||_0x17cbac<0x0){_0x17cbac=LIMIT_VALUE;}return _0x17cbac;};exports[_0x10cd('0x15')]=function(_0x543aa4){_0x543aa4=parseInt(_0x543aa4,0xa);if(!_0x543aa4||_0x543aa4<0x0){_0x543aa4=0x0;}return _0x543aa4;};exports['sort']=function(_0x10093f){var _0x2a19b8,_0x35254c=null;if(_0x10093f){_0x2a19b8=_0x10093f['split'](',');_0x35254c=_[_0x10cd('0x16')](_0x2a19b8,function(_0xcdc04b){if(_0xcdc04b[_0x10cd('0x17')]('-')===0x0){return[_0xcdc04b===_0x10cd('0x18')?sequelize[_0x10cd('0x19')](sequelize[_0x10cd('0x1a')]('priority'),_0x10cd('0x1b')):_0xcdc04b['substr'](0x1),_0x10cd('0x1c')];}else{return[_0xcdc04b===_0x10cd('0x18')?sequelize['cast'](sequelize[_0x10cd('0x1a')]('priority'),_0x10cd('0x1b')):_0xcdc04b,_0x10cd('0x1d')];}});}return _0x35254c;};exports['omit']=function(_0x19f6b9,_0x30e9dc){if(_[_0x10cd('0x7')](_0x19f6b9)){return _0x19f6b9;}if(_[_0x10cd('0x14')](_0x19f6b9)){for(var _0x3500f9=0x0;_0x3500f9<_0x19f6b9[_0x10cd('0x1e')];_0x3500f9+=0x1){_0x19f6b9[_0x3500f9]=this[_0x10cd('0x1f')](_0x19f6b9[_0x3500f9],_0x30e9dc);}return _0x19f6b9;}if(!_[_0x10cd('0x20')](_0x19f6b9)){return _0x19f6b9;}if(_['isString'](_0x30e9dc)){_0x30e9dc=[_0x30e9dc];}if(!_[_0x10cd('0x14')](_0x30e9dc)){return _0x19f6b9;}for(var _0x48844d=0x0;_0x48844d<_0x30e9dc[_0x10cd('0x1e')];_0x48844d+=0x1){_[_0x10cd('0x21')](_0x19f6b9,_0x30e9dc[_0x48844d]);}for(var _0x2c9b96 in _0x19f6b9){if(_0x19f6b9[_0x10cd('0x22')](_0x2c9b96)){_0x19f6b9[_0x2c9b96]=this['omit'](_0x19f6b9[_0x2c9b96],_0x30e9dc);}}return _0x19f6b9;};exports[_0x10cd('0x23')]=function(_0x1cc67a){return _0x1cc67a['match'](RegExp(_0x10cd('0x24')))?!![]:![];};exports[_0x10cd('0x25')]=function(_0x960727){return _0x960727['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0xdfd984){var _0x3665c3=[];_0xdfd984['split'](/[ ,]+/)[_0x10cd('0x26')](function(_0x236f7b){_0x236f7b=_0x236f7b[_0x10cd('0x27')](/([^:]")"+/g,'$1');_0x236f7b='+'+_0x236f7b+'*';if(_0x236f7b[_0x10cd('0x3')]('@'))_0x236f7b='\x22'+_0x236f7b+'\x22';_0x3665c3[_0x10cd('0x28')](_0x236f7b);});return _0x3665c3['join']('\x20');};exports['getOptions']=function(_0x2862df,_0x464e90,_0x3a7cb2){var _0x5f443a={},_0x1ed82e={};if(_0x464e90[_0x10cd('0x29')]['$id']){_0x464e90['query']['id']=_0x464e90[_0x10cd('0x29')][_0x10cd('0x2a')];delete _0x464e90[_0x10cd('0x29')]['$id'];}_0x5f443a[_0x10cd('0x2b')]=_[_0x10cd('0x16')](_0x2862df,_0x10cd('0x12'));_0x5f443a['query']=_['keys'](_0x464e90['query']);_0x5f443a[_0x10cd('0x6')]=_[_0x10cd('0x2c')](_0x5f443a[_0x10cd('0x2b')],_0x5f443a[_0x10cd('0x29')]);_0x1ed82e[_0x10cd('0x2d')]=_[_0x10cd('0x2c')](_0x5f443a[_0x10cd('0x2b')],this[_0x10cd('0x4')](_0x464e90[_0x10cd('0x29')][_0x10cd('0x4')]));_0x1ed82e[_0x10cd('0x2d')]=_0x1ed82e[_0x10cd('0x2d')][_0x10cd('0x1e')]?_0x1ed82e[_0x10cd('0x2d')]:_0x5f443a[_0x10cd('0x2b')];if(!_0x464e90[_0x10cd('0x29')][_0x10cd('0x22')](_0x10cd('0x2e'))){_0x1ed82e[_0x10cd('0x2f')]=this['limit'](_0x464e90[_0x10cd('0x29')]['limit']);_0x1ed82e[_0x10cd('0x15')]=this[_0x10cd('0x15')](_0x464e90[_0x10cd('0x29')][_0x10cd('0x15')]);}_0x1ed82e['order']=this['sort'](_0x464e90[_0x10cd('0x29')][_0x10cd('0x30')]);_0x1ed82e[_0x10cd('0x31')]=this[_0x10cd('0x6')](_[_0x10cd('0x32')](_0x464e90['query'],_0x5f443a[_0x10cd('0x6')]),_0x2862df);if(_0x464e90['query'][_0x10cd('0x33')]){_0x1ed82e[_0x10cd('0x31')]=_[_0x10cd('0x34')](_0x1ed82e[_0x10cd('0x31')],{'$or':_[_0x10cd('0x16')](_0x2862df,function(_0x14468f){if(_0x14468f[_0x10cd('0x9')]!==_0x10cd('0x35')){if(_0x3a7cb2){return sequelize[_0x10cd('0x31')](sequelize['fn']('lower',sequelize[_0x10cd('0x1a')](_0x14468f[_0x10cd('0x12')])),{'$like':sequelize['fn'](_0x10cd('0x36'),'%'+_0x464e90[_0x10cd('0x29')][_0x10cd('0x33')]+'%')});}else{var _0x2360f6={};_0x2360f6[_0x14468f['name']]={'$like':'%'+_0x464e90['query'][_0x10cd('0x33')]+'%'};return _0x2360f6;}}})});}_0x1ed82e=_['merge']({},_0x1ed82e,_0x464e90[_0x10cd('0x37')]);return _0x1ed82e;};
\ No newline at end of file
index 26abf7d..bee9ec9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b4e=['appPath','join','root','test','client','use','set','toISOString','split','/server/views','engine','html','ejs','50mb','json','express','serve-favicon','method-override','cookie-parser','errorhandler','passport','./environment','../mysqldb','default','get','env'];(function(_0x2cef64,_0x3f1cd6){var _0x143e39=function(_0x381c6f){while(--_0x381c6f){_0x2cef64['push'](_0x2cef64['shift']());}};_0x143e39(++_0x3f1cd6);}(_0x8b4e,0xc5));var _0xe8b4=function(_0x2942c3,_0x2871ce){_0x2942c3=_0x2942c3-0x0;var _0x1d4859=_0x8b4e[_0x2942c3];return _0x1d4859;};'use strict';var express=require(_0xe8b4('0x0'));var favicon=require(_0xe8b4('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0xe8b4('0x2'));var cookieParser=require(_0xe8b4('0x3'));var errorHandler=require(_0xe8b4('0x4'));var path=require('path');var passport=require(_0xe8b4('0x5'));var cors=require('cors');var moment=require('moment');var config=require(_0xe8b4('0x6'));var db=require(_0xe8b4('0x7'))['db'];exports[_0xe8b4('0x8')]=function(_0x3a0f7f){var _0x5f2b4a=_0x3a0f7f[_0xe8b4('0x9')](_0xe8b4('0xa'));if(_0x5f2b4a==='production'){_0x3a0f7f['set'](_0xe8b4('0xb'),path[_0xe8b4('0xc')](config[_0xe8b4('0xd')],'public'));}if(_0x5f2b4a==='development'||_0x5f2b4a===_0xe8b4('0xe')){_0x3a0f7f['set'](_0xe8b4('0xb'),path[_0xe8b4('0xc')](config[_0xe8b4('0xd')],_0xe8b4('0xf')));_0x3a0f7f[_0xe8b4('0x10')](errorHandler());}_0x3a0f7f[_0xe8b4('0x11')]('json\x20replacer',function(_0x42e6b8,_0x4022fc){if(this[_0x42e6b8]instanceof Date){_0x4022fc=this[_0x42e6b8][_0xe8b4('0x12')]()[_0xe8b4('0x13')]('.')[0x0]+'Z';}return _0x4022fc;});_0x3a0f7f['use'](express['static'](_0x3a0f7f['get'](_0xe8b4('0xb'))));_0x3a0f7f[_0xe8b4('0x11')]('views',config[_0xe8b4('0xd')]+_0xe8b4('0x14'));_0x3a0f7f[_0xe8b4('0x15')](_0xe8b4('0x16'),require(_0xe8b4('0x17'))['renderFile']);_0x3a0f7f[_0xe8b4('0x11')]('view\x20engine',_0xe8b4('0x16'));_0x3a0f7f[_0xe8b4('0x10')](bodyParser['urlencoded']({'limit':_0xe8b4('0x18'),'extended':!![]}));_0x3a0f7f[_0xe8b4('0x10')](bodyParser[_0xe8b4('0x19')]({'limit':_0xe8b4('0x18')}));_0x3a0f7f['use'](cors());_0x3a0f7f['use'](methodOverride());_0x3a0f7f[_0xe8b4('0x10')](cookieParser());_0x3a0f7f[_0xe8b4('0x10')](passport['initialize']());};
\ No newline at end of file
+var _0x7f43=['get','appPath','/server/views','engine','ejs','renderFile','html','50mb','json','initialize','express','serve-favicon','body-parser','method-override','path','passport','cors','./environment','default','env','production','join','root','development','test','set','client','use','json\x20replacer','toISOString','split'];(function(_0x15c37c,_0x37eef3){var _0x4600b0=function(_0x302a5a){while(--_0x302a5a){_0x15c37c['push'](_0x15c37c['shift']());}};_0x4600b0(++_0x37eef3);}(_0x7f43,0x121));var _0x37f4=function(_0x325b8c,_0x295272){_0x325b8c=_0x325b8c-0x0;var _0x40cf8b=_0x7f43[_0x325b8c];return _0x40cf8b;};'use strict';var express=require(_0x37f4('0x0'));var favicon=require(_0x37f4('0x1'));var bodyParser=require(_0x37f4('0x2'));var methodOverride=require(_0x37f4('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require('errorhandler');var path=require(_0x37f4('0x4'));var passport=require(_0x37f4('0x5'));var cors=require(_0x37f4('0x6'));var moment=require('moment');var config=require(_0x37f4('0x7'));var db=require('../mysqldb')['db'];exports[_0x37f4('0x8')]=function(_0x3b9a1c){var _0x3efb35=_0x3b9a1c['get'](_0x37f4('0x9'));if(_0x3efb35===_0x37f4('0xa')){_0x3b9a1c['set']('appPath',path[_0x37f4('0xb')](config[_0x37f4('0xc')],'public'));}if(_0x3efb35===_0x37f4('0xd')||_0x3efb35===_0x37f4('0xe')){_0x3b9a1c[_0x37f4('0xf')]('appPath',path[_0x37f4('0xb')](config[_0x37f4('0xc')],_0x37f4('0x10')));_0x3b9a1c[_0x37f4('0x11')](errorHandler());}_0x3b9a1c[_0x37f4('0xf')](_0x37f4('0x12'),function(_0x5b008e,_0x401694){if(this[_0x5b008e]instanceof Date){_0x401694=this[_0x5b008e][_0x37f4('0x13')]()[_0x37f4('0x14')]('.')[0x0]+'Z';}return _0x401694;});_0x3b9a1c['use'](express['static'](_0x3b9a1c[_0x37f4('0x15')](_0x37f4('0x16'))));_0x3b9a1c[_0x37f4('0xf')]('views',config[_0x37f4('0xc')]+_0x37f4('0x17'));_0x3b9a1c[_0x37f4('0x18')]('html',require(_0x37f4('0x19'))[_0x37f4('0x1a')]);_0x3b9a1c[_0x37f4('0xf')]('view\x20engine',_0x37f4('0x1b'));_0x3b9a1c[_0x37f4('0x11')](bodyParser['urlencoded']({'limit':_0x37f4('0x1c'),'extended':!![]}));_0x3b9a1c[_0x37f4('0x11')](bodyParser[_0x37f4('0x1d')]({'limit':_0x37f4('0x1c')}));_0x3b9a1c[_0x37f4('0x11')](cors());_0x3b9a1c[_0x37f4('0x11')](methodOverride());_0x3b9a1c[_0x37f4('0x11')](cookieParser());_0x3b9a1c['use'](passport[_0x37f4('0x1e')]());};
\ No newline at end of file
index 5873534..0eea298 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc76b=['filter','family','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','join','md5','digest','hex','getUuid','platform','licenseToken','test','win32','utf8','replace','hostname','macAddress','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xc76b,0x118));var _0xbc76=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc76b[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xbc76('0x0'));var os=require('os');var crypto=require(_0xbc76('0x1'));var machine=require(_0xbc76('0x2'));var exec=require(_0xbc76('0x3'))[_0xbc76('0x4')];var config=require(_0xbc76('0x5'));function getInterfaces(){var _0x66cbf6=[];var _0x32a74b=os[_0xbc76('0x6')]();var _0x2beeec=_[_0xbc76('0x7')](_['keys'](_0x32a74b));for(var _0x3b55c2=0x0;_0x3b55c2<_0x2beeec['length'];_0x3b55c2++){var _0x466f13=_0x32a74b[_0x2beeec[_0x3b55c2]][_0xbc76('0x8')](function(_0x4cae45){return _0x4cae45[_0xbc76('0x9')]===_0xbc76('0xa')&&_0x4cae45[_0xbc76('0xb')]===![];});_0x66cbf6=_0x66cbf6['concat'](_0x466f13);}return _0x66cbf6;}function getFirstInterface(){var _0x5220d5=_[_0xbc76('0xc')](getInterfaces());return{'macAddress':_0x5220d5&&_0x5220d5[_0xbc76('0xd')]?_0x5220d5[_0xbc76('0xd')]:_0xbc76('0xe'),'ipAddress':_0x5220d5&&_0x5220d5['address']?_0x5220d5[_0xbc76('0xf')]:_0xbc76('0x10')};}exports[_0xbc76('0x11')]=getFirstInterface;function getCPUhash(){var _0x501fb4=_[_0xbc76('0x7')](os['cpus']()[_0xbc76('0x12')](function(_0x300f31){return _0x300f31[_0xbc76('0x13')];}))[_0xbc76('0x14')](':');return crypto['createHash'](_0xbc76('0x15'))['update'](_0x501fb4)[_0xbc76('0x16')](_0xbc76('0x17'));}exports[_0xbc76('0x18')]=function(){var _0x2e6060=os[_0xbc76('0x19')]();var _0x591de9=/[0-9a-f-]{36}/;if(config[_0xbc76('0x1a')]&&_0x591de9[_0xbc76('0x1b')](config[_0xbc76('0x1a')])){return config[_0xbc76('0x1a')];}else if(_0x2e6060===_0xbc76('0x1c')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xbc76('0x1d')})[_0xbc76('0x1e')]('\x0d\x0a','');}else{var _0x5b99c9=getFirstInterface();var _0x5df6f8=getCPUhash();var _0x27b662=_0x5df6f8+'|'+os[_0xbc76('0x1f')]()+'|'+_0x5b99c9[_0xbc76('0x20')]+'|'+_0x5b99c9[_0xbc76('0x21')];var _0x3b3b16=crypto[_0xbc76('0x22')](_0xbc76('0x15'))['update'](_0x27b662)[_0xbc76('0x16')](_0xbc76('0x17'));return _0x3b3b16[_0xbc76('0x23')](0x0,0x8)+'-'+_0x3b3b16[_0xbc76('0x23')](0x8,0xc)+'-'+_0x3b3b16[_0xbc76('0x23')](0xc,0x10)+'-'+_0x3b3b16[_0xbc76('0x23')](0x10,0x14)+'-'+_0x3b3b16[_0xbc76('0x23')](0x14);}};
\ No newline at end of file
+var _0xab19=['update','digest','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5'];(function(_0x445317,_0x10ecd0){var _0x39bca6=function(_0x559624){while(--_0x559624){_0x445317['push'](_0x445317['shift']());}};_0x39bca6(++_0x10ecd0);}(_0xab19,0x117));var _0x9ab1=function(_0x4212d8,_0x4d6025){_0x4212d8=_0x4212d8-0x0;var _0x1d5f6d=_0xab19[_0x4212d8];return _0x1d5f6d;};'use strict';var _=require(_0x9ab1('0x0'));var os=require('os');var crypto=require(_0x9ab1('0x1'));var machine=require(_0x9ab1('0x2'));var exec=require(_0x9ab1('0x3'))[_0x9ab1('0x4')];var config=require(_0x9ab1('0x5'));function getInterfaces(){var _0x13401d=[];var _0x5eb4ef=os[_0x9ab1('0x6')]();var _0x51d93c=_[_0x9ab1('0x7')](_[_0x9ab1('0x8')](_0x5eb4ef));for(var _0x308b9=0x0;_0x308b9<_0x51d93c['length'];_0x308b9++){var _0x27394b=_0x5eb4ef[_0x51d93c[_0x308b9]][_0x9ab1('0x9')](function(_0x45a559){return _0x45a559[_0x9ab1('0xa')]===_0x9ab1('0xb')&&_0x45a559[_0x9ab1('0xc')]===![];});_0x13401d=_0x13401d[_0x9ab1('0xd')](_0x27394b);}return _0x13401d;}function getFirstInterface(){var _0x4736cf=_['head'](getInterfaces());return{'macAddress':_0x4736cf&&_0x4736cf[_0x9ab1('0xe')]?_0x4736cf[_0x9ab1('0xe')]:_0x9ab1('0xf'),'ipAddress':_0x4736cf&&_0x4736cf[_0x9ab1('0x10')]?_0x4736cf['address']:_0x9ab1('0x11')};}exports[_0x9ab1('0x12')]=getFirstInterface;function getCPUhash(){var _0x1c54ca=_[_0x9ab1('0x7')](os[_0x9ab1('0x13')]()[_0x9ab1('0x14')](function(_0x418365){return _0x418365[_0x9ab1('0x15')];}))[_0x9ab1('0x16')](':');return crypto[_0x9ab1('0x17')](_0x9ab1('0x18'))[_0x9ab1('0x19')](_0x1c54ca)[_0x9ab1('0x1a')]('hex');}exports[_0x9ab1('0x1b')]=function(){var _0x751149=os['platform']();var _0x568206=/[0-9a-f-]{36}/;if(config[_0x9ab1('0x1c')]&&_0x568206[_0x9ab1('0x1d')](config[_0x9ab1('0x1c')])){return config[_0x9ab1('0x1c')];}else if(_0x751149===_0x9ab1('0x1e')){return exec(_0x9ab1('0x1f'),{'encoding':_0x9ab1('0x20')})['replace']('\x0d\x0a','');}else{var _0x3d9de6=getFirstInterface();var _0x3f997c=getCPUhash();var _0x206a0b=_0x3f997c+'|'+os[_0x9ab1('0x21')]()+'|'+_0x3d9de6[_0x9ab1('0x22')]+'|'+_0x3d9de6[_0x9ab1('0x23')];var _0x4e1ab6=crypto[_0x9ab1('0x17')](_0x9ab1('0x18'))[_0x9ab1('0x19')](_0x206a0b)[_0x9ab1('0x1a')](_0x9ab1('0x24'));return _0x4e1ab6[_0x9ab1('0x25')](0x0,0x8)+'-'+_0x4e1ab6[_0x9ab1('0x25')](0x8,0xc)+'-'+_0x4e1ab6['substring'](0xc,0x10)+'-'+_0x4e1ab6[_0x9ab1('0x25')](0x10,0x14)+'-'+_0x4e1ab6[_0x9ab1('0x25')](0x14);}};
\ No newline at end of file
index 6f03ed7..68ebade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd72f=['data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','then','catch','get'];(function(_0x17d9ba,_0x4d980c){var _0x46185d=function(_0x1dce47){while(--_0x1dce47){_0x17d9ba['push'](_0x17d9ba['shift']());}};_0x46185d(++_0x4d980c);}(_0xd72f,0x8f));var _0xfd72=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xd72f[_0x311c35];return _0x5cc50c;};'use strict';var util=require(_0xfd72('0x0'));var moment=require('moment');var rp=require(_0xfd72('0x1'));var BPromise=require(_0xfd72('0x2'));var pkginfo=require('pkginfo')(module,_0xfd72('0x3'));var db=require(_0xfd72('0x4'))['db'];var encryptor=require(_0xfd72('0x5'));var hardware=require(_0xfd72('0x6'));var logger=require(_0xfd72('0x7'))(_0xfd72('0x8'));var HOST=_0xfd72('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4f8de9){return new BPromise(function(_0x4d2d1a,_0x93093a){var _0x5298ff=util[_0xfd72('0xa')](_0xfd72('0xb'),HOST,_0x4f8de9,module[_0xfd72('0xc')][_0xfd72('0x3')]);if(oldToken){_0x5298ff=util[_0xfd72('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x4f8de9,module[_0xfd72('0xc')][_0xfd72('0x3')],oldToken);}var _0x1aaf96={'uri':_0x5298ff,'method':_0xfd72('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x1aaf96)[_0xfd72('0xe')](function(_0x390b57){_0x4d2d1a(_0x390b57);})[_0xfd72('0xf')](function(_0x11699b){_0x93093a(_0x11699b);});});}function manageLicense(_0x43f336,_0x45b43a){var _0x4f16cd=_0x45b43a[_0xfd72('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x4f16cd[_0xfd72('0x11')]!==_0x43f336&&!_0x4f16cd[_0xfd72('0x12')]){oldToken=_0x4f16cd[_0xfd72('0x11')];}httpRequest(_0x43f336)[_0xfd72('0xe')](function(_0x4e2cbd){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4e2cbd['active']){isOldTokenSent=![];if(!_0x4f16cd[_0xfd72('0x8')]&&_0x4f16cd[_0xfd72('0x8')]!=_0x4e2cbd[_0xfd72('0x8')]||_0x4f16cd['license']&&_0x4f16cd[_0xfd72('0x12')]){logger[_0xfd72('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4f16cd[_0xfd72('0x8')]&&!_0x4f16cd[_0xfd72('0x12')]&&_0x4f16cd[_0xfd72('0x8')]!=_0x4e2cbd[_0xfd72('0x8')]){logger['info'](_0xfd72('0x14'));}if(_0x4f16cd[_0xfd72('0x8')]&&!_0x4f16cd[_0xfd72('0x12')]&&_0x4f16cd['license']==_0x4e2cbd['license']){return _0x45b43a;}return _0x45b43a[_0xfd72('0x15')]({'data1':_0x43f336,'data2':null,'license':_0x4e2cbd[_0xfd72('0x8')]});}else{if(_0x4e2cbd[_0xfd72('0x8')]||_0x4f16cd['license']){if(!_0x4f16cd[_0xfd72('0x12')]){if(_0x4f16cd[_0xfd72('0x11')]==_0x43f336){GRAY_PERIOD_REASON='Disabled';logger[_0xfd72('0x13')](_0xfd72('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xfd72('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4f16cd[_0xfd72('0x11')],_0x43f336);}logger[_0xfd72('0x13')](_0xfd72('0x17'),GRAY_PERIOD_REASON[_0xfd72('0x18')](),moment()['format'](_0xfd72('0x19')));return _0x45b43a[_0xfd72('0x15')]({'data2':encryptor[_0xfd72('0x1a')](moment()[_0xfd72('0xa')](_0xfd72('0x19')))});}else{if(moment()[_0xfd72('0x1b')](encryptor[_0xfd72('0x1c')](_0x4f16cd[_0xfd72('0x12')]),_0xfd72('0x1d'))>DAYS){logger[_0xfd72('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0xfd72('0xa')](_0xfd72('0x19')));isOldTokenSent=![];return _0x45b43a[_0xfd72('0x15')]({'data1':_0x43f336,'data2':null,'license':null});}}}else{if(_0x4f16cd['data1']!=_0x43f336){logger[_0xfd72('0x13')](_0xfd72('0x1e'),_0x4f16cd['data1'],_0x43f336);return _0x45b43a[_0xfd72('0x15')]({'data1':_0x43f336,'data2':null,'license':null});}}}return _0x45b43a;})[_0xfd72('0xe')](function(_0x8ed13a){_0x45b43a=_0x8ed13a;})[_0xfd72('0xf')](function(_0xc1dfcc){logger[_0xfd72('0x1f')](_0xc1dfcc[_0xfd72('0x20')]);})[_0xfd72('0x21')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x45b43a);},TIME);});}function defaultLicense(){var _0x292ee1=hardware[_0xfd72('0x22')]();if(_0x292ee1){return db[_0xfd72('0x23')][_0xfd72('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x292ee1}})[_0xfd72('0x25')](function(_0x28d082,_0x14fd2b){logger['info'](_0xfd72('0x26'),_0x292ee1);manageLicense(_0x292ee1,_0x28d082);})[_0xfd72('0xf')](function(_0x40b25c){logger[_0xfd72('0x1f')](_0x40b25c[_0xfd72('0x20')]);});}}exports[_0xfd72('0x27')]=defaultLicense;
\ No newline at end of file
+var _0xea2a=['request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','then','catch','data1','data2','active','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment'];(function(_0x58d188,_0xa06a1f){var _0x1fc4a6=function(_0x2ee653){while(--_0x2ee653){_0x58d188['push'](_0x58d188['shift']());}};_0x1fc4a6(++_0xa06a1f);}(_0xea2a,0x7d));var _0xaea2=function(_0x3759fa,_0x4a1baa){_0x3759fa=_0x3759fa-0x0;var _0x4e512e=_0xea2a[_0x3759fa];return _0x4e512e;};'use strict';var util=require('util');var moment=require(_0xaea2('0x0'));var rp=require(_0xaea2('0x1'));var BPromise=require(_0xaea2('0x2'));var pkginfo=require(_0xaea2('0x3'))(module,_0xaea2('0x4'));var db=require(_0xaea2('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xaea2('0x6'));var logger=require(_0xaea2('0x7'))('license');var HOST=_0xaea2('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xb3a25d){return new BPromise(function(_0x44327d,_0x33480d){var _0x5ce72=util[_0xaea2('0x9')](_0xaea2('0xa'),HOST,_0xb3a25d,module['exports'][_0xaea2('0x4')]);if(oldToken){_0x5ce72=util[_0xaea2('0x9')](_0xaea2('0xb'),HOST,_0xb3a25d,module[_0xaea2('0xc')]['version'],oldToken);}var _0x4cad4b={'uri':_0x5ce72,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4cad4b)[_0xaea2('0xd')](function(_0x1dc529){_0x44327d(_0x1dc529);})[_0xaea2('0xe')](function(_0x5c0aa5){_0x33480d(_0x5c0aa5);});});}function manageLicense(_0x48f433,_0x3fdcce){var _0x2fc019=_0x3fdcce['get']({'plain':!![]});if(!isOldTokenSent&&_0x2fc019[_0xaea2('0xf')]!==_0x48f433&&!_0x2fc019[_0xaea2('0x10')]){oldToken=_0x2fc019['data1'];}httpRequest(_0x48f433)[_0xaea2('0xd')](function(_0x3e1baa){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3e1baa[_0xaea2('0x11')]){isOldTokenSent=![];if(!_0x2fc019[_0xaea2('0x12')]&&_0x2fc019[_0xaea2('0x12')]!=_0x3e1baa[_0xaea2('0x12')]||_0x2fc019[_0xaea2('0x12')]&&_0x2fc019[_0xaea2('0x10')]){logger['info'](_0xaea2('0x13'));}if(_0x2fc019[_0xaea2('0x12')]&&!_0x2fc019[_0xaea2('0x10')]&&_0x2fc019['license']!=_0x3e1baa['license']){logger[_0xaea2('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2fc019[_0xaea2('0x12')]&&!_0x2fc019[_0xaea2('0x10')]&&_0x2fc019[_0xaea2('0x12')]==_0x3e1baa[_0xaea2('0x12')]){return _0x3fdcce;}return _0x3fdcce[_0xaea2('0x15')]({'data1':_0x48f433,'data2':null,'license':_0x3e1baa[_0xaea2('0x12')]});}else{if(_0x3e1baa['license']||_0x2fc019[_0xaea2('0x12')]){if(!_0x2fc019[_0xaea2('0x10')]){if(_0x2fc019['data1']==_0x48f433){GRAY_PERIOD_REASON=_0xaea2('0x16');logger['info'](_0xaea2('0x17'));}else{GRAY_PERIOD_REASON=_0xaea2('0x18');logger[_0xaea2('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2fc019[_0xaea2('0xf')],_0x48f433);}logger[_0xaea2('0x14')](_0xaea2('0x19'),GRAY_PERIOD_REASON[_0xaea2('0x1a')](),moment()[_0xaea2('0x9')](_0xaea2('0x1b')));return _0x3fdcce[_0xaea2('0x15')]({'data2':encryptor[_0xaea2('0x1c')](moment()[_0xaea2('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xaea2('0x1d')](encryptor[_0xaea2('0x1e')](_0x2fc019[_0xaea2('0x10')]),_0xaea2('0x1f'))>DAYS){logger[_0xaea2('0x14')](_0xaea2('0x20'),moment()[_0xaea2('0x9')](_0xaea2('0x1b')));isOldTokenSent=![];return _0x3fdcce['update']({'data1':_0x48f433,'data2':null,'license':null});}}}else{if(_0x2fc019['data1']!=_0x48f433){logger[_0xaea2('0x14')](_0xaea2('0x21'),_0x2fc019[_0xaea2('0xf')],_0x48f433);return _0x3fdcce['update']({'data1':_0x48f433,'data2':null,'license':null});}}}return _0x3fdcce;})[_0xaea2('0xd')](function(_0x4d82fb){_0x3fdcce=_0x4d82fb;})[_0xaea2('0xe')](function(_0xbfb47b){logger[_0xaea2('0x22')](_0xbfb47b[_0xaea2('0x23')]);})[_0xaea2('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0xaea2('0x25')](),_0x3fdcce);},TIME);});}function defaultLicense(){var _0x20de51=hardware[_0xaea2('0x25')]();if(_0x20de51){return db[_0xaea2('0x26')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x20de51}})[_0xaea2('0x27')](function(_0x222919,_0x46f3b8){logger[_0xaea2('0x14')](_0xaea2('0x28'),_0x20de51);manageLicense(_0x20de51,_0x222919);})['catch'](function(_0x58730a){logger[_0xaea2('0x22')](_0x58730a[_0xaea2('0x23')]);});}}exports[_0xaea2('0x29')]=defaultLicense;
\ No newline at end of file
index cdafe92..8e0185f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f2a=['User','findAll','role','sequelize','COUNT','admin','user','pick','telephone','License\x20limit\x20reached\x20for\x20telephones','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','message'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0x1f2a,0x1a8));var _0xa1f2=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x1f2a[_0x12a554];return _0x244ba0;};'use strict';var util=require(_0xa1f2('0x0'));var _=require('lodash');var moment=require(_0xa1f2('0x1'));var BPromise=require(_0xa1f2('0x2'));var hardware=require(_0xa1f2('0x3'));var encryptor=require(_0xa1f2('0x4'));var db=require(_0xa1f2('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa1f2('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xa1f2('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa1f2('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xa1f2('0x8'),'machineUuid':hardware[_0xa1f2('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2b10d2){return new BPromise(function(_0x460eca,_0x350241){return db[_0xa1f2('0xa')][_0xa1f2('0xb')](_[_0xa1f2('0xc')](_0x2b10d2,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xf27788){return checkLicense(_0xf27788,null);})[_0xa1f2('0xd')](function(_0x5e638c){_0x460eca(_0x5e638c);return;})[_0xa1f2('0xe')](function(_0x585f5d){_0x350241(_0x585f5d);});});}function checkLicense(_0xbfa356,_0x114ac9){if(!_0xbfa356){demoLicense[_0xa1f2('0xf')]=_0xbfa356[_0xa1f2('0x10')];return demoLicense;}try{var _0x34fb2f=_0x114ac9||_0xbfa356[_0xa1f2('0x11')];if(_[_0xa1f2('0x12')](_0x34fb2f)){throw new Error(_0xa1f2('0x13'));}var _0x381a41=_0xbfa356[_0xa1f2('0x10')];var _0x2e38d3=_0xbfa356[_0xa1f2('0x14')];var _0x567e6c=_0x381a41[_0xa1f2('0x15')]('-')[0x4];var _0x19f93c=_0x381a41[_0xa1f2('0x15')]('-')[0x0];var _0x4ce954=encryptor[_0xa1f2('0x16')](_0x34fb2f,util[_0xa1f2('0x17')](_0xa1f2('0x18'),_0x567e6c,_0x381a41,_0x19f93c));var _0x3c8dd1=JSON[_0xa1f2('0x19')](_0x4ce954);_0x3c8dd1[_0xa1f2('0x1a')]=![];_0x3c8dd1[_0xa1f2('0xf')]=_0x381a41;_0x3c8dd1[_0xa1f2('0x1b')]=hardware[_0xa1f2('0x9')]();if(_0x2e38d3){var _0x1fabf6=encryptor['decryptString'](_0x2e38d3);_0x3c8dd1[_0xa1f2('0x1c')]=_0x1fabf6;_0x3c8dd1[_0xa1f2('0x1d')]=moment(_0x1fabf6)[_0xa1f2('0x1e')](0x7,_0xa1f2('0x1f'))[_0xa1f2('0x17')]();_0x3c8dd1[_0xa1f2('0x20')]=_0x3c8dd1['uuid']!=_0x3c8dd1[_0xa1f2('0x1b')]?_0xa1f2('0x21'):_0xa1f2('0x22');}return _0x3c8dd1;}catch(_0x41bb55){breakingLicense[_0xa1f2('0xf')]=_0xbfa356[_0xa1f2('0x10')];breakingLicense[_0xa1f2('0x23')]=_0x41bb55['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x438f11,_0x53d778){getLicense()[_0xa1f2('0xd')](function(_0x55c2de){return db[_0xa1f2('0x24')][_0xa1f2('0x25')]({'attributes':[_0xa1f2('0x26'),[db[_0xa1f2('0x27')]['fn'](_0xa1f2('0x28'),db[_0xa1f2('0x27')]['col'](_0xa1f2('0x26'))),'count']],'group':'role','where':{'role':{'$or':[_0xa1f2('0x29'),_0xa1f2('0x2a'),'telephone']}},'raw':!![]})[_0xa1f2('0xd')](function(_0x10e7c3){var _0x4ead53={'user':_0x55c2de['users']||0x0,'telephone':_0x55c2de['telephones']||0x0};_0x10e7c3['forEach'](function(_0x541c20){var _0x3e685a=_0x541c20[_0xa1f2('0x26')]===_0xa1f2('0x29')?_0xa1f2('0x2a'):_0x541c20[_0xa1f2('0x26')];_0x4ead53[_0x3e685a]-=_0x541c20['count'];if(_0x4ead53[_0x3e685a]<0x0)_0x4ead53[_0x3e685a]=0x0;});_0x438f11(_0x4ead53);return;});})[_0xa1f2('0xe')](function(_0x23e793){_0x53d778(_0x23e793);});});}function checkUserLimits(_0x485fd3){return new BPromise(function(_0x527fb5,_0x2a5514){getLimits()[_0xa1f2('0xd')](function(_0x1bcb21){var _0x369e3a=_[_0xa1f2('0x2b')](_['countBy'](_0x485fd3,'role'),[_0xa1f2('0x29'),_0xa1f2('0x2a'),_0xa1f2('0x2c')]);var _0x3b5f1c=(_0x369e3a['admin']||0x0)+(_0x369e3a['user']||0x0);var _0x2cd3f8=_0x369e3a[_0xa1f2('0x2c')]||0x0;if(_0x3b5f1c>_0x1bcb21[_0xa1f2('0x2a')])return _0x2a5514('License\x20limit\x20reached\x20for\x20users');if(_0x2cd3f8>_0x1bcb21[_0xa1f2('0x2c')])return _0x2a5514(_0xa1f2('0x2d'));return _0x527fb5();})['catch'](function(_0x3c2f44){_0x2a5514(_0x3c2f44);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xa77f=['machineUuid','changed','disabled','message','User','findAll','role','sequelize','COUNT','count','user','telephone','telephones','forEach','admin','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../mysqldb','Demo\x20license','getUuid','Breaking\x20license','License','find','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','format','%s:%s:%s','demo','decryptString','gray','deadline','add','days','grayReason'];(function(_0x3a7c01,_0x124350){var _0x456b4c=function(_0x210c0b){while(--_0x210c0b){_0x3a7c01['push'](_0x3a7c01['shift']());}};_0x456b4c(++_0x124350);}(_0xa77f,0xfe));var _0xfa77=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa77f[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0xfa77('0x0'));var _=require(_0xfa77('0x1'));var moment=require(_0xfa77('0x2'));var BPromise=require(_0xfa77('0x3'));var hardware=require(_0xfa77('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0xfa77('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xfa77('0x6'),'machineUuid':hardware[_0xfa77('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xfa77('0x8'),'machineUuid':hardware[_0xfa77('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x326c2b){return new BPromise(function(_0x360f51,_0x130649){return db[_0xfa77('0x9')][_0xfa77('0xa')](_['defaults'](_0x326c2b,{'raw':!![],'where':{'id':0x1}}))[_0xfa77('0xb')](function(_0x5322b){return checkLicense(_0x5322b,null);})[_0xfa77('0xb')](function(_0x3dc501){_0x360f51(_0x3dc501);return;})[_0xfa77('0xc')](function(_0xe44fe6){_0x130649(_0xe44fe6);});});}function checkLicense(_0x20b3c0,_0x374dee){if(!_0x20b3c0){demoLicense[_0xfa77('0xd')]=_0x20b3c0['data1'];return demoLicense;}try{var _0x3452c3=_0x374dee||_0x20b3c0[_0xfa77('0xe')];if(_[_0xfa77('0xf')](_0x3452c3)){throw new Error(_0xfa77('0x10'));}var _0x144124=_0x20b3c0[_0xfa77('0x11')];var _0x5ccf03=_0x20b3c0['data2'];var _0x3b7d6b=_0x144124[_0xfa77('0x12')]('-')[0x4];var _0x2f86cd=_0x144124['split']('-')[0x0];var _0x3ac1cd=encryptor['decryptString'](_0x3452c3,util[_0xfa77('0x13')](_0xfa77('0x14'),_0x3b7d6b,_0x144124,_0x2f86cd));var _0x1b640f=JSON['parse'](_0x3ac1cd);_0x1b640f[_0xfa77('0x15')]=![];_0x1b640f[_0xfa77('0xd')]=_0x144124;_0x1b640f['machineUuid']=hardware[_0xfa77('0x7')]();if(_0x5ccf03){var _0x3a7a1b=encryptor[_0xfa77('0x16')](_0x5ccf03);_0x1b640f[_0xfa77('0x17')]=_0x3a7a1b;_0x1b640f[_0xfa77('0x18')]=moment(_0x3a7a1b)[_0xfa77('0x19')](0x7,_0xfa77('0x1a'))[_0xfa77('0x13')]();_0x1b640f[_0xfa77('0x1b')]=_0x1b640f[_0xfa77('0xd')]!=_0x1b640f[_0xfa77('0x1c')]?_0xfa77('0x1d'):_0xfa77('0x1e');}return _0x1b640f;}catch(_0xc2f5d7){breakingLicense['uuid']=_0x20b3c0[_0xfa77('0x11')];breakingLicense[_0xfa77('0x1f')]=_0xc2f5d7[_0xfa77('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x17cdc7,_0x8f460e){getLicense()[_0xfa77('0xb')](function(_0x2ecfa6){return db[_0xfa77('0x20')][_0xfa77('0x21')]({'attributes':[_0xfa77('0x22'),[db[_0xfa77('0x23')]['fn'](_0xfa77('0x24'),db[_0xfa77('0x23')]['col'](_0xfa77('0x22'))),_0xfa77('0x25')]],'group':'role','where':{'role':{'$or':['admin',_0xfa77('0x26'),_0xfa77('0x27')]}},'raw':!![]})[_0xfa77('0xb')](function(_0x199ae0){var _0x17a9d4={'user':_0x2ecfa6['users']||0x0,'telephone':_0x2ecfa6[_0xfa77('0x28')]||0x0};_0x199ae0[_0xfa77('0x29')](function(_0x4758b5){var _0x57cc55=_0x4758b5[_0xfa77('0x22')]===_0xfa77('0x2a')?_0xfa77('0x26'):_0x4758b5[_0xfa77('0x22')];_0x17a9d4[_0x57cc55]-=_0x4758b5[_0xfa77('0x25')];if(_0x17a9d4[_0x57cc55]<0x0)_0x17a9d4[_0x57cc55]=0x0;});_0x17cdc7(_0x17a9d4);return;});})[_0xfa77('0xc')](function(_0x16f131){_0x8f460e(_0x16f131);});});}function checkUserLimits(_0x129615){return new BPromise(function(_0x531c05,_0x4cc665){getLimits()[_0xfa77('0xb')](function(_0x23181a){var _0x210680=_['pick'](_[_0xfa77('0x2b')](_0x129615,_0xfa77('0x22')),['admin','user','telephone']);var _0x4f8629=(_0x210680[_0xfa77('0x2a')]||0x0)+(_0x210680['user']||0x0);var _0x32bc94=_0x210680['telephone']||0x0;if(_0x4f8629>_0x23181a[_0xfa77('0x26')])return _0x4cc665(_0xfa77('0x2c'));if(_0x32bc94>_0x23181a[_0xfa77('0x27')])return _0x4cc665(_0xfa77('0x2d'));return _0x531c05();})['catch'](function(_0x4427a5){_0x4cc665(_0x4427a5);});});}module[_0xfa77('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 28a449e..e381b33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea28=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x4a52a0,_0x34152f){var _0x4884d5=function(_0x51ece7){while(--_0x51ece7){_0x4a52a0['push'](_0x4a52a0['shift']());}};_0x4884d5(++_0x34152f);}(_0xea28,0x13a));var _0x8ea2=function(_0x241ee0,_0x3c0978){_0x241ee0=_0x241ee0-0x0;var _0x36c81b=_0xea28[_0x241ee0];return _0x36c81b;};'use strict';module[_0x8ea2('0x0')]={'DOMAIN':_0x8ea2('0x1'),'SESSION_SECRET':_0x8ea2('0x2'),'GOOGLE_ID':_0x8ea2('0x3'),'GOOGLE_SECRET':_0x8ea2('0x4'),'DEBUG':''};
\ No newline at end of file
+var _0xb10b=['app-id','secret','exports','myappanuglar-secret'];(function(_0x2d4f8f,_0x5c4472){var _0x30ee36=function(_0x50e5cd){while(--_0x50e5cd){_0x2d4f8f['push'](_0x2d4f8f['shift']());}};_0x30ee36(++_0x5c4472);}(_0xb10b,0x12a));var _0xbb10=function(_0x147e9f,_0x57b3cb){_0x147e9f=_0x147e9f-0x0;var _0x321585=_0xb10b[_0x147e9f];return _0x321585;};'use strict';module[_0xbb10('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xbb10('0x1'),'GOOGLE_ID':_0xbb10('0x2'),'GOOGLE_SECRET':_0xbb10('0x3'),'DEBUG':''};
\ No newline at end of file
index c5b0c37..1c4526a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19c3=['join','log','xcally','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','%s-%s','error','info','Console','env','debugLevel','winston','util','path','INFO'];(function(_0x749614,_0x9c4b56){var _0x4cacdf=function(_0x2b6bcc){while(--_0x2b6bcc){_0x749614['push'](_0x749614['shift']());}};_0x4cacdf(++_0x9c4b56);}(_0x19c3,0x79));var _0x319c=function(_0x521d51,_0x3fcdf9){_0x521d51=_0x521d51-0x0;var _0x4e6e5a=_0x19c3[_0x521d51];return _0x4e6e5a;};'use strict';var moment=require('moment');var winston=require(_0x319c('0x0'));var util=require(_0x319c('0x1'));var path=require(_0x319c('0x2'));var debugLevel=_0x319c('0x3');function filename(_0x1ef010,_0x2a566e){return path[_0x319c('0x4')]('/var',_0x319c('0x5'),_0x319c('0x6'),util[_0x319c('0x7')](_0x319c('0x8'),_0x1ef010,_0x2a566e));}function formatter(_0x4e1d4d,_0x4a5e89){_0x4a5e89['message']=_0x4a5e89[_0x319c('0x9')][_0x319c('0xa')](/@@{/g,'{{{')[_0x319c('0xa')](/}@@/g,_0x319c('0xb'))[_0x319c('0xa')](/@{/g,'{{')[_0x319c('0xa')](/}@/g,'}}');return util[_0x319c('0x7')](_0x319c('0xc'),moment()['format'](_0x319c('0xd')),_0x4a5e89[_0x319c('0xe')][_0x319c('0xf')](),_0x4e1d4d,_0x4a5e89['message']);}module[_0x319c('0x10')]=function(_0x16b3b4){return new winston[(_0x319c('0x11'))]({'transports':[new winston[(_0x319c('0x12'))]['File']({'name':util[_0x319c('0x7')](_0x319c('0x13'),_0x16b3b4,_0x319c('0x14')),'filename':filename(_0x16b3b4,_0x319c('0x14')),'level':_0x319c('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x13bf59){return formatter(_0x16b3b4,_0x13bf59);}}),new winston[(_0x319c('0x12'))]['File']({'name':util[_0x319c('0x7')](_0x319c('0x13'),_0x16b3b4,'info'),'filename':filename(_0x16b3b4,_0x319c('0x15')),'level':_0x319c('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3fd75f){return formatter(_0x16b3b4,_0x3fd75f);}}),new winston[(_0x319c('0x12'))][(_0x319c('0x16'))]({'level':process[_0x319c('0x17')][_0x319c('0x18')]||debugLevel,'json':![],'formatter':function(_0x3fdfd0){return formatter(_0x16b3b4,_0x3fdfd0);}})]});};
\ No newline at end of file
+var _0xf72a=['winston','util','path','/var','log','format','%s-%s.log','message','replace','{{{','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','transports','File','%s-%s','error','info','Console','env','debugLevel'];(function(_0x28fe94,_0x120b9b){var _0x3560da=function(_0x4d4e25){while(--_0x4d4e25){_0x28fe94['push'](_0x28fe94['shift']());}};_0x3560da(++_0x120b9b);}(_0xf72a,0x168));var _0xaf72=function(_0x51a4bb,_0x1516b5){_0x51a4bb=_0x51a4bb-0x0;var _0x1a888b=_0xf72a[_0x51a4bb];return _0x1a888b;};'use strict';var moment=require('moment');var winston=require(_0xaf72('0x0'));var util=require(_0xaf72('0x1'));var path=require(_0xaf72('0x2'));var debugLevel='INFO';function filename(_0x4534d4,_0x2bd780){return path['join'](_0xaf72('0x3'),_0xaf72('0x4'),'xcally',util[_0xaf72('0x5')](_0xaf72('0x6'),_0x4534d4,_0x2bd780));}function formatter(_0x2eb54e,_0x5beab0){_0x5beab0[_0xaf72('0x7')]=_0x5beab0[_0xaf72('0x7')][_0xaf72('0x8')](/@@{/g,_0xaf72('0x9'))[_0xaf72('0x8')](/}@@/g,'}}}')[_0xaf72('0x8')](/@{/g,'{{')[_0xaf72('0x8')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xaf72('0x5')](_0xaf72('0xa')),_0x5beab0['level'][_0xaf72('0xb')](),_0x2eb54e,_0x5beab0[_0xaf72('0x7')]);}module['exports']=function(_0x28951f){return new winston['Logger']({'transports':[new winston[(_0xaf72('0xc'))][(_0xaf72('0xd'))]({'name':util['format'](_0xaf72('0xe'),_0x28951f,_0xaf72('0xf')),'filename':filename(_0x28951f,_0xaf72('0xf')),'level':_0xaf72('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x549dca){return formatter(_0x28951f,_0x549dca);}}),new winston[(_0xaf72('0xc'))][(_0xaf72('0xd'))]({'name':util[_0xaf72('0x5')]('%s-%s',_0x28951f,_0xaf72('0x10')),'filename':filename(_0x28951f,_0xaf72('0x10')),'level':_0xaf72('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x45278a){return formatter(_0x28951f,_0x45278a);}}),new winston['transports'][(_0xaf72('0x11'))]({'level':process[_0xaf72('0x12')][_0xaf72('0x13')]||debugLevel,'json':![],'formatter':function(_0x371daf){return formatter(_0x28951f,_0x371daf);}})]});};
\ No newline at end of file
index e52662d..526c864 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15c6=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','path','join','../../services/express/index.js','ami'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x15c6,0x1a9));var _0x615c=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x15c6[_0x235f49];return _0x551139;};'use strict';var path=require(_0x615c('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x615c('0x1')](__dirname,_0x615c('0x2'))},{'name':_0x615c('0x3'),'script':path[_0x615c('0x1')](__dirname,_0x615c('0x4'))},{'name':_0x615c('0x5'),'script':path[_0x615c('0x1')](__dirname,_0x615c('0x6'))},{'name':_0x615c('0x7'),'script':path[_0x615c('0x1')](__dirname,_0x615c('0x8'))},{'name':'routing','script':path[_0x615c('0x1')](__dirname,_0x615c('0x9'))},{'name':_0x615c('0xa'),'script':path['join'](__dirname,'../../services/xdr/index.js')}]};module['exports']=config;
\ No newline at end of file
+var _0x1798=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express','join','../../services/express/index.js','ami'];(function(_0x3b7ace,_0x32be6e){var _0x113c7c=function(_0x5486d8){while(--_0x5486d8){_0x3b7ace['push'](_0x3b7ace['shift']());}};_0x113c7c(++_0x32be6e);}(_0x1798,0x6b));var _0x8179=function(_0x17ce99,_0x3147c8){_0x17ce99=_0x17ce99-0x0;var _0x1f9bca=_0x1798[_0x17ce99];return _0x1f9bca;};'use strict';var path=require(_0x8179('0x0'));var os=require('os');var config={'apps':[{'name':_0x8179('0x1'),'script':path[_0x8179('0x2')](__dirname,_0x8179('0x3'))},{'name':_0x8179('0x4'),'script':path[_0x8179('0x2')](__dirname,_0x8179('0x5'))},{'name':_0x8179('0x6'),'script':path[_0x8179('0x2')](__dirname,_0x8179('0x7'))},{'name':_0x8179('0x8'),'script':path[_0x8179('0x2')](__dirname,_0x8179('0x9'))},{'name':_0x8179('0xa'),'script':path['join'](__dirname,_0x8179('0xb'))},{'name':_0x8179('0xc'),'script':path[_0x8179('0x2')](__dirname,_0x8179('0xd'))}]};module['exports']=config;
\ No newline at end of file
index a37a137..d5fc852 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5e9=['delete','dump','saved','pm2','bluebird','./config','connect','disconnect','stop','then','restart','list','describe'];(function(_0x470d51,_0x5ed4a2){var _0x4ff668=function(_0x3367a4){while(--_0x3367a4){_0x470d51['push'](_0x470d51['shift']());}};_0x4ff668(++_0x5ed4a2);}(_0xe5e9,0x17c));var _0x9e5e=function(_0x4ccbe2,_0x11eacf){_0x4ccbe2=_0x4ccbe2-0x0;var _0x134525=_0xe5e9[_0x4ccbe2];return _0x134525;};'use strict';var pm2=require(_0x9e5e('0x0'));var BPromise=require(_0x9e5e('0x1'));var config=require(_0x9e5e('0x2'));function connect(){return new BPromise(function(_0x3c7cc2,_0x144780){return pm2[_0x9e5e('0x3')](function(_0x12e8ee){if(_0x12e8ee){return _0x144780(_0x12e8ee);}return _0x3c7cc2('connected');});});};exports['start']=function(_0x212510){return connect()['then'](function(){return new BPromise(function(_0x2353fa,_0x26ed70){return pm2['start'](_0x212510,function(_0x2c71c6,_0x7f77ce){if(_0x2c71c6){return _0x26ed70(_0x2c71c6);}pm2[_0x9e5e('0x4')]();return _0x2353fa(_0x7f77ce);});});});};exports[_0x9e5e('0x5')]=function(_0x52f669){return connect()[_0x9e5e('0x6')](function(){return new BPromise(function(_0x25bcd0,_0x505ab7){return pm2[_0x9e5e('0x5')](_0x52f669,function(_0x445a1d,_0xbf45aa){if(_0x445a1d){return _0x505ab7(_0x445a1d);}pm2[_0x9e5e('0x4')]();return _0x25bcd0(_0xbf45aa);});});});};exports['restart']=function(_0x11d702){return connect()[_0x9e5e('0x6')](function(){return new BPromise(function(_0xf0f556,_0x1871dd){return pm2[_0x9e5e('0x7')](_0x11d702,function(_0x31836c,_0x18798e){if(_0x31836c){return _0x1871dd(_0x31836c);}pm2['disconnect']();return _0xf0f556(_0x18798e);});});});};exports[_0x9e5e('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5005fb,_0x153fdc){return pm2[_0x9e5e('0x8')](function(_0x1d91aa,_0x2f92da){if(_0x1d91aa){return _0x153fdc(_0x1d91aa);}pm2['disconnect']();return _0x5005fb(_0x2f92da);});});});};exports[_0x9e5e('0x9')]=function(_0x4b39ab){return connect()[_0x9e5e('0x6')](function(){return new BPromise(function(_0x49007c,_0x2e2122){return pm2[_0x9e5e('0x9')](_0x4b39ab,function(_0x52b324,_0x4e6d5f){if(_0x52b324){return _0x2e2122(_0x52b324);}pm2[_0x9e5e('0x4')]();return _0x49007c(_0x4e6d5f);});});});};exports[_0x9e5e('0xa')]=function(_0x531fc6){return connect()['then'](function(){return new BPromise(function(_0x11ed49,_0x2e8d91){return pm2[_0x9e5e('0xa')](_0x531fc6,function(_0x286dcc,_0x897efd){if(_0x286dcc){return _0x2e8d91(_0x286dcc);}pm2[_0x9e5e('0x4')]();return _0x11ed49(_0x897efd);});});});};exports[_0x9e5e('0xb')]=function(){return connect()[_0x9e5e('0x6')](function(){return new BPromise(function(_0x259847,_0x4ffdce){return pm2[_0x9e5e('0xb')](function(_0x3f29cf){if(_0x3f29cf){return _0x4ffdce(_0x3f29cf);}return _0x259847(_0x9e5e('0xc'));});});});};
\ No newline at end of file
+var _0x8ce9=['list','describe','delete','dump','saved','pm2','bluebird','./config','connected','start','disconnect','then','restart'];(function(_0xe998b6,_0x36cdca){var _0xd4a0d6=function(_0x18f1e3){while(--_0x18f1e3){_0xe998b6['push'](_0xe998b6['shift']());}};_0xd4a0d6(++_0x36cdca);}(_0x8ce9,0x198));var _0x98ce=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x8ce9[_0x4e676e];return _0x336a3c;};'use strict';var pm2=require(_0x98ce('0x0'));var BPromise=require(_0x98ce('0x1'));var config=require(_0x98ce('0x2'));function connect(){return new BPromise(function(_0x1c8826,_0x32328f){return pm2['connect'](function(_0x42ca79){if(_0x42ca79){return _0x32328f(_0x42ca79);}return _0x1c8826(_0x98ce('0x3'));});});};exports[_0x98ce('0x4')]=function(_0x50e10c){return connect()['then'](function(){return new BPromise(function(_0x21bb67,_0x481f50){return pm2[_0x98ce('0x4')](_0x50e10c,function(_0x313b49,_0x7de090){if(_0x313b49){return _0x481f50(_0x313b49);}pm2[_0x98ce('0x5')]();return _0x21bb67(_0x7de090);});});});};exports['stop']=function(_0x5c0f44){return connect()[_0x98ce('0x6')](function(){return new BPromise(function(_0x2c5982,_0x9f418){return pm2['stop'](_0x5c0f44,function(_0x55c4b1,_0x51830f){if(_0x55c4b1){return _0x9f418(_0x55c4b1);}pm2[_0x98ce('0x5')]();return _0x2c5982(_0x51830f);});});});};exports[_0x98ce('0x7')]=function(_0x3a7e87){return connect()[_0x98ce('0x6')](function(){return new BPromise(function(_0x3abe61,_0x3fd157){return pm2[_0x98ce('0x7')](_0x3a7e87,function(_0x512d96,_0x400445){if(_0x512d96){return _0x3fd157(_0x512d96);}pm2[_0x98ce('0x5')]();return _0x3abe61(_0x400445);});});});};exports[_0x98ce('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x276a0c,_0x3db311){return pm2[_0x98ce('0x8')](function(_0x46687b,_0xc3abfe){if(_0x46687b){return _0x3db311(_0x46687b);}pm2['disconnect']();return _0x276a0c(_0xc3abfe);});});});};exports[_0x98ce('0x9')]=function(_0x24670d){return connect()[_0x98ce('0x6')](function(){return new BPromise(function(_0x2efe0e,_0x619ef1){return pm2['describe'](_0x24670d,function(_0x3796c6,_0xcd3e9f){if(_0x3796c6){return _0x619ef1(_0x3796c6);}pm2[_0x98ce('0x5')]();return _0x2efe0e(_0xcd3e9f);});});});};exports[_0x98ce('0xa')]=function(_0x58be7f){return connect()[_0x98ce('0x6')](function(){return new BPromise(function(_0x39f0b6,_0x257ab7){return pm2[_0x98ce('0xa')](_0x58be7f,function(_0x1c13b6,_0x199cbe){if(_0x1c13b6){return _0x257ab7(_0x1c13b6);}pm2[_0x98ce('0x5')]();return _0x39f0b6(_0x199cbe);});});});};exports[_0x98ce('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1424e6,_0x1348b4){return pm2['dump'](function(_0x35eb25){if(_0x35eb25){return _0x1348b4(_0x35eb25);}return _0x1424e6(_0x98ce('0xc'));});});});};
\ No newline at end of file
index 745e024..e465fce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde6e=['redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','error','start','moment','util','../../config/environment','../../mysqldb','../logger','schedule'];(function(_0x2f9fdb,_0x2aef10){var _0x525bc8=function(_0x32a68c){while(--_0x32a68c){_0x2f9fdb['push'](_0x2f9fdb['shift']());}};_0x525bc8(++_0x2aef10);}(_0xde6e,0x1da));var _0xede6=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xde6e[_0x2cfb58];return _0xd99951;};'use strict';var _=require('lodash');var moment=require(_0xede6('0x0'));var Redis=require('ioredis');var util=require(_0xede6('0x1'));var config=require(_0xede6('0x2'));var db=require(_0xede6('0x3'))['db'];var logger=require(_0xede6('0x4'))(_0xede6('0x5'));config[_0xede6('0x6')]=_[_0xede6('0x7')](config[_0xede6('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xede6('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x1d7f5b=0x0;var _0x67d9f1=[];return db[_0xede6('0x9')][_0xede6('0xa')]({'raw':!![],'attributes':['id',_0xede6('0xb')],'where':{'id':0x1}})[_0xede6('0xc')](function(_0x14ff05){_0x1d7f5b=_0x14ff05[_0xede6('0xb')];if(_0x1d7f5b){return db[_0xede6('0xd')][_0xede6('0xe')]({'raw':!![],'attributes':['id',_0xede6('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x14ff05[_0xede6('0xb')],_0xede6('0x10'))}}});}else{return[];}})[_0xede6('0xc')](function(_0x22733c){if(_0x22733c&&_0x22733c['length']){_0x67d9f1=_['map'](_0x22733c||[],'id');logger[_0xede6('0x11')](_0xede6('0x12'),_0x67d9f1[_0xede6('0x13')]());return db[_0xede6('0xd')][_0xede6('0x14')]({'closeReason':_0xede6('0x15'),'disposition':_0xede6('0x16'),'closed':!![],'closedAt':moment()[_0xede6('0x17')](_0xede6('0x18'))},{'where':{'id':_0x67d9f1}});}})['then'](function(){if(_0x67d9f1&&_0x67d9f1[_0xede6('0x19')]){logger[_0xede6('0x11')](_0xede6('0x1a'),_0x67d9f1[_0xede6('0x13')]());for(var _0x2947ac=0x0;_0x2947ac<_0x67d9f1[_0xede6('0x19')];_0x2947ac++){io[_0xede6('0x1b')]('chatInteraction:update',{'id':_0x67d9f1[_0x2947ac],'closed':!![]});}}})['catch'](function(_0x3464ea){logger[_0xede6('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x3464ea?util['inspect'](_0x3464ea,{'showHidden':![],'depth':null}):'');});}exports[_0xede6('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x1ae9=['util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis'];(function(_0x4ec2b0,_0x4d69b5){var _0xd978d9=function(_0x60a102){while(--_0x60a102){_0x4ec2b0['push'](_0x4ec2b0['shift']());}};_0xd978d9(++_0x4d69b5);}(_0x1ae9,0x81));var _0x91ae=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x1ae9[_0x308213];return _0x2e1619;};'use strict';var _=require(_0x91ae('0x0'));var moment=require(_0x91ae('0x1'));var Redis=require(_0x91ae('0x2'));var util=require(_0x91ae('0x3'));var config=require('../../config/environment');var db=require(_0x91ae('0x4'))['db'];var logger=require(_0x91ae('0x5'))(_0x91ae('0x6'));config[_0x91ae('0x7')]=_[_0x91ae('0x8')](config[_0x91ae('0x7')],{'host':_0x91ae('0x9'),'port':0x18eb});var io=require(_0x91ae('0xa'))(new Redis(config[_0x91ae('0x7')]));function closeInteractions(){var _0x562578=0x0;var _0x2041dc=[];return db[_0x91ae('0xb')][_0x91ae('0xc')]({'raw':!![],'attributes':['id',_0x91ae('0xd')],'where':{'id':0x1}})[_0x91ae('0xe')](function(_0x5d3c64){_0x562578=_0x5d3c64['chatTimeout'];if(_0x562578){return db[_0x91ae('0xf')][_0x91ae('0x10')]({'raw':!![],'attributes':['id',_0x91ae('0x11')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x91ae('0x12')](_0x5d3c64[_0x91ae('0xd')],'minutes')}}});}else{return[];}})[_0x91ae('0xe')](function(_0x2bdd24){if(_0x2bdd24&&_0x2bdd24[_0x91ae('0x13')]){_0x2041dc=_[_0x91ae('0x14')](_0x2bdd24||[],'id');logger[_0x91ae('0x15')](_0x91ae('0x16'),_0x2041dc['join']());return db['ChatInteraction'][_0x91ae('0x17')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x91ae('0x18')](_0x91ae('0x19'))},{'where':{'id':_0x2041dc}});}})[_0x91ae('0xe')](function(){if(_0x2041dc&&_0x2041dc[_0x91ae('0x13')]){logger['info'](_0x91ae('0x1a'),_0x2041dc[_0x91ae('0x1b')]());for(var _0x4f8162=0x0;_0x4f8162<_0x2041dc['length'];_0x4f8162++){io[_0x91ae('0x1c')](_0x91ae('0x1d'),{'id':_0x2041dc[_0x4f8162],'closed':!![]});}}})[_0x91ae('0x1e')](function(_0x3fe5af){logger['error'](_0x91ae('0x1f'),_0x3fe5af?util[_0x91ae('0x20')](_0x3fe5af,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index f08047e..b6d395f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9608=['subtractNumber\x20null\x20or\x20undefined','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','then','CustomReportId','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','toString','keyBy','difference','intersection','exists','stop','deleteJob','delete\x20cron','length','index','my\x20id','resolve','run\x20job','cron','active','endAt','start','add\x20cron','isBetween','startAt','update\x20cron','run','util','path','lodash','moment','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','subtractNumber','../../files/reports','%s.%s','basename','savename','extname','join','status','Sent','message','attachments','text','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','error\x20mail','stringify','email\x20sent','catch','error','isNil'];(function(_0x2125e9,_0x21d8c0){var _0x499201=function(_0x49b9ca){while(--_0x49b9ca){_0x2125e9['push'](_0x2125e9['shift']());}};_0x499201(++_0x21d8c0);}(_0x9608,0x18a));var _0x8960=function(_0x5a511f,_0x417b90){_0x5a511f=_0x5a511f-0x0;var _0x430327=_0x9608[_0x5a511f];return _0x430327;};'use strict';var fs=require('fs');var util=require(_0x8960('0x0'));var path=require(_0x8960('0x1'));var _=require(_0x8960('0x2'));var moment=require(_0x8960('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x8960('0x4'));var BPromise=require('bluebird');var logger=require(_0x8960('0x5'))(_0x8960('0x6'));var db=require(_0x8960('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x8960('0x8'));var client=jayson[_0x8960('0x9')][_0x8960('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2028af,_0x2aebf2){return function(){logger['info'](_0x8960('0xb'),_0x2028af[_0x8960('0xc')]);var _0x1481ef=!![];var _0x2b97db={'tls':{'rejectUnauthorized':![]}};if(_0x2028af[_0x8960('0xd')][_0x8960('0xe')]['service']){_0x2b97db[_0x8960('0xf')]=_0x2028af[_0x8960('0xd')][_0x8960('0xe')][_0x8960('0xf')];}else{_0x2b97db[_0x8960('0x10')]=_0x2028af['MailAccount'][_0x8960('0xe')][_0x8960('0x10')];_0x2b97db[_0x8960('0x11')]=_0x2028af[_0x8960('0xd')]['Smtp'][_0x8960('0x11')];_0x2b97db[_0x8960('0x12')]=_0x2028af['MailAccount'][_0x8960('0xe')]['secure'];}if(_0x2028af[_0x8960('0xd')][_0x8960('0xe')][_0x8960('0x13')]){_0x2b97db[_0x8960('0x14')]={'user':_0x2028af['MailAccount'][_0x8960('0xe')][_0x8960('0x15')],'pass':_0x2028af['MailAccount'][_0x8960('0xe')][_0x8960('0x16')]};}var _0x147665={'account':_0x2b97db,'message':{'from':util[_0x8960('0x17')](_0x8960('0x18'),_0x2028af[_0x8960('0xd')][_0x8960('0x19')],_0x2028af['MailAccount'][_0x8960('0xc')]||_0x2028af[_0x8960('0xd')]['Smtp'][_0x8960('0x15')]),'to':_0x2028af[_0x8960('0xc')],'cc':_0x2028af['cc'],'bcc':_0x2028af[_0x8960('0x1a')],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x2aebf2[_0x8960('0x19')],_0x2028af[_0x8960('0x1b')],_0x2028af['subtractUnit'])}};var _0x19f13c=path['join'](__dirname,_0x8960('0x1c'));var _0x462bb7=_0x2aebf2['savename'];var _0x2aca88=util[_0x8960('0x17')](_0x8960('0x1d'),path[_0x8960('0x1e')](_0x2aebf2[_0x8960('0x1f')],path[_0x8960('0x20')](_0x2aebf2[_0x8960('0x1f')])),'zip');var _0x5008b1=path[_0x8960('0x21')](_0x19f13c,_0x462bb7);var _0x3cc53f=path[_0x8960('0x21')](_0x19f13c,_0x2aca88);if(fs['existsSync'](_0x5008b1)){_0x2aebf2[_0x8960('0x22')]=_0x8960('0x23');_0x147665[_0x8960('0x24')][_0x8960('0x25')]=[{'filename':_0x462bb7,'path':_0x5008b1}];_0x147665[_0x8960('0x24')][_0x8960('0x26')]=util[_0x8960('0x17')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON['stringify'](_0x2aebf2,null,0x2));}else if(fs[_0x8960('0x27')](_0x3cc53f)){_0x2aebf2[_0x8960('0x22')]=_0x8960('0x23');_0x147665[_0x8960('0x24')][_0x8960('0x25')]=[{'filename':_0x2aca88,'path':_0x3cc53f}];}else{_0x147665[_0x8960('0x24')][_0x8960('0x26')]=_0x8960('0x28');if(!_0x2028af[_0x8960('0x29')]){_0x1481ef=![];logger[_0x8960('0x2a')](_0x8960('0x2b'));}}if(_0x1481ef){return client['request'](_0x8960('0x2c'),_0x147665)['then'](function(_0x1738f6){if(_0x1738f6['error']){return logger['error'](_0x8960('0x2d'),JSON[_0x8960('0x2e')](_0x1738f6));}return logger[_0x8960('0x2a')](_0x8960('0x2f'));})[_0x8960('0x30')](function(_0x3c181c){return logger[_0x8960('0x31')]('error\x20mail',JSON[_0x8960('0x2e')](_0x3c181c));});}};}function handleError(){return function(_0x20bdba){return logger['error'](JSON[_0x8960('0x2e')](_0x20bdba));};}function handleResult(_0x27f1bd){return function(_0x414b90){logger[_0x8960('0x2a')]('data',JSON[_0x8960('0x2e')](_0x414b90));if(_0x27f1bd[_0x8960('0xd')]&&_0x27f1bd[_0x8960('0xd')][_0x8960('0xe')]&&!_[_0x8960('0x32')](_0x27f1bd[_0x8960('0xc')])){setTimeout(handleSendEmail(_0x27f1bd,_0x414b90),0x3c*0x3e8);}};}function handleJob(_0x42cd37){return function(){try{if(_['isNil'](_0x42cd37[_0x8960('0x1b')])){return logger[_0x8960('0x2a')](_0x8960('0x33'));}if(_['isNil'](_0x42cd37[_0x8960('0x34')])){return logger[_0x8960('0x2a')]('subtractUnit\x20null\x20or\x20undefined');}var _0x59fe69={'startDate':moment()['subtract'](_0x42cd37['subtractNumber'],_0x42cd37[_0x8960('0x34')])[_0x8960('0x17')](_0x8960('0x35')),'endDate':moment()[_0x8960('0x17')](_0x8960('0x35')),'type':_0x8960('0x36'),'output':_0x42cd37[_0x8960('0x37')],'name':_0x42cd37[_0x8960('0x19')]};if(!_[_0x8960('0x32')](_0x42cd37[_0x8960('0x38')])){logger[_0x8960('0x2a')](_0x8960('0x39'),_0x42cd37[_0x8960('0x38')]);return analyticDefaultReportController['runReport']({'id':_0x42cd37['DefaultReportId']},_0x59fe69)[_0x8960('0x3a')](handleResult(_0x42cd37))[_0x8960('0x30')](handleError());}if(!_[_0x8960('0x32')](_0x42cd37[_0x8960('0x3b')])){logger[_0x8960('0x2a')]('exec\x20custom\x20report\x20id:%s',_0x42cd37[_0x8960('0x3b')]);return analyticCustomReportController[_0x8960('0x3c')]({'id':_0x42cd37[_0x8960('0x3b')]},_0x59fe69)[_0x8960('0x3a')](handleResult(_0x42cd37))[_0x8960('0x30')](handleError());}}catch(_0xabb1ab){logger[_0x8960('0x31')](JSON[_0x8960('0x2e')](_0xabb1ab));}return logger[_0x8960('0x2a')](_0x8960('0x3d'));};}function getJobs(_0x154ae3){var _0x547975={};if(_0x154ae3){_0x547975['id']=_0x154ae3;}return db[_0x8960('0x3e')][_0x8960('0x3f')]({'where':_0x547975,'include':[{'model':db[_0x8960('0xd')],'attributes':['id','name','email'],'include':[{'model':db[_0x8960('0x40')],'as':_0x8960('0xe')}]}]})[_0x8960('0x3a')](function(_0x3b7e5d){var _0x311d5a=_[_0x8960('0x41')](manager['jobs']);var _0x52a279=_[_0x8960('0x42')](_0x3b7e5d,function(_0x577cf2){return _0x577cf2['id'][_0x8960('0x43')]();});var _0x2a74fb=_[_0x8960('0x44')](_0x3b7e5d,function(_0x2496c6){return _0x2496c6['id'][_0x8960('0x43')]();});var _0xc869fe=_0x154ae3?_0x52a279:_[_0x8960('0x45')](_0x52a279,_0x311d5a);var _0x195845=_[_0x8960('0x46')](_0x52a279,_0x311d5a);var _0x24dcb2=_[_0x8960('0x45')](_0x311d5a,_0x52a279);var _0xd4e6d0;var _0xa7be40;for(_0xd4e6d0=0x0;_0xd4e6d0<_0x24dcb2['length']&&!_0x154ae3;_0xd4e6d0+=0x1){_0xa7be40=_0x24dcb2[_0xd4e6d0][_0x8960('0x43')]();if(manager[_0x8960('0x47')](_0xa7be40)){manager[_0x8960('0x48')](_0xa7be40);manager[_0x8960('0x49')](_0xa7be40);logger[_0x8960('0x2a')](_0x8960('0x4a'),_0xa7be40);}}logger['info']('toRun',JSON[_0x8960('0x2e')](_0xc869fe));for(_0xd4e6d0=0x0;_0xd4e6d0<_0xc869fe[_0x8960('0x4b')];_0xd4e6d0+=0x1){_0xa7be40=_0xc869fe[_0xd4e6d0][_0x8960('0x43')]();logger[_0x8960('0x2a')](_0x8960('0x4c'),_0xa7be40);if(_0x154ae3){logger[_0x8960('0x2a')](_0x8960('0x4d'),_0x154ae3);logger['info'](JSON[_0x8960('0x2e')](_0x2a74fb[_0xa7be40]));BPromise[_0x8960('0x4e')]()[_0x8960('0x3a')](handleJob(_0x2a74fb[_0xa7be40]));logger[_0x8960('0x2a')](_0x8960('0x4f'),_0x2a74fb[_0xa7be40][_0x8960('0x19')],_0x2a74fb[_0xa7be40]['cron']);}else if(_0x2a74fb[_0xa7be40][_0x8960('0x50')]&&_0x2a74fb[_0xa7be40][_0x8960('0x51')]&&moment()['isBetween'](_0x2a74fb[_0xa7be40]['startAt'],_0x2a74fb[_0xa7be40][_0x8960('0x52')])){manager['add'](_0xa7be40,_0x2a74fb[_0xa7be40]['cron'],handleJob(_0x2a74fb[_0xa7be40]));manager[_0x8960('0x53')](_0xa7be40);logger['info'](_0x8960('0x54'),_0x2a74fb[_0xa7be40][_0x8960('0x19')],_0x2a74fb[_0xa7be40][_0x8960('0x50')]);}else if(manager[_0x8960('0x47')](_0xa7be40)){manager[_0x8960('0x48')](_0xa7be40);manager[_0x8960('0x49')](_0xa7be40);logger[_0x8960('0x2a')]('stop\x20cron',_0x2a74fb[_0xa7be40]['name'],_0x2a74fb[_0xa7be40][_0x8960('0x50')]);}}for(_0xd4e6d0=0x0,_0xa7be40;_0xd4e6d0<_0x195845['length']&&!_0x154ae3;_0xd4e6d0+=0x1){_0xa7be40=_0x195845[_0xd4e6d0]['toString']();if(manager[_0x8960('0x47')](_0xa7be40)){if(_0x2a74fb[_0xa7be40][_0x8960('0x50')]&&_0x2a74fb[_0xa7be40]['active']&&moment()[_0x8960('0x55')](_0x2a74fb[_0xa7be40][_0x8960('0x56')],_0x2a74fb[_0xa7be40]['endAt'])){manager['update'](_0xa7be40,_0x2a74fb[_0xa7be40][_0x8960('0x50')],handleJob(_0x2a74fb[_0xa7be40]));logger[_0x8960('0x2a')](_0x8960('0x57'),_0x2a74fb[_0xa7be40][_0x8960('0x19')],_0x2a74fb[_0xa7be40][_0x8960('0x50')]);}else{manager[_0x8960('0x48')](_0xa7be40);manager[_0x8960('0x49')](_0xa7be40);logger[_0x8960('0x2a')]('stop\x20cron',_0x2a74fb[_0xa7be40]['name'],_0x2a74fb[_0xa7be40][_0x8960('0x50')]);}}}})[_0x8960('0x30')](function(_0x8c96ea){logger['error'](JSON[_0x8960('0x2e')](_0x8c96ea));});}exports[_0x8960('0x58')]=function(_0x5f0793){return getJobs(_0x5f0793);};exports[_0x8960('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x4ea7=['email','MailAccount','Smtp','service','host','port','secure','auth','user','format','\x22%s\x22\x20<%s>','bcc','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','zip','join','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','toRun','index','resolve','cron','isBetween','add','add\x20cron','exists','stop\x20cron','active','startAt','endAt','update','start','util','lodash','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller'];(function(_0x295fe9,_0x345828){var _0x3b80df=function(_0x85b4dc){while(--_0x85b4dc){_0x295fe9['push'](_0x295fe9['shift']());}};_0x3b80df(++_0x345828);}(_0x4ea7,0xa5));var _0x74ea=function(_0x3df332,_0x2d6e49){_0x3df332=_0x3df332-0x0;var _0x479e13=_0x4ea7[_0x3df332];return _0x479e13;};'use strict';var fs=require('fs');var util=require(_0x74ea('0x0'));var path=require('path');var _=require(_0x74ea('0x1'));var moment=require('moment');var CronJobManager=require(_0x74ea('0x2'));var jayson=require(_0x74ea('0x3'));var BPromise=require(_0x74ea('0x4'));var logger=require(_0x74ea('0x5'))('schedule');var db=require(_0x74ea('0x6'))['db'];var analyticCustomReportController=require(_0x74ea('0x7'));var analyticDefaultReportController=require(_0x74ea('0x8'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x412564,_0x5af6bd){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x412564[_0x74ea('0x9')]);var _0x15e75d=!![];var _0x24db56={'tls':{'rejectUnauthorized':![]}};if(_0x412564[_0x74ea('0xa')]['Smtp']['service']){_0x24db56['service']=_0x412564['MailAccount'][_0x74ea('0xb')][_0x74ea('0xc')];}else{_0x24db56['host']=_0x412564['MailAccount'][_0x74ea('0xb')][_0x74ea('0xd')];_0x24db56['port']=_0x412564[_0x74ea('0xa')][_0x74ea('0xb')][_0x74ea('0xe')];_0x24db56[_0x74ea('0xf')]=_0x412564[_0x74ea('0xa')][_0x74ea('0xb')]['secure'];}if(_0x412564['MailAccount'][_0x74ea('0xb')]['authentication']){_0x24db56[_0x74ea('0x10')]={'user':_0x412564[_0x74ea('0xa')][_0x74ea('0xb')][_0x74ea('0x11')],'pass':_0x412564[_0x74ea('0xa')][_0x74ea('0xb')]['pass']};}var _0x15b8fc={'account':_0x24db56,'message':{'from':util[_0x74ea('0x12')](_0x74ea('0x13'),_0x412564[_0x74ea('0xa')]['name'],_0x412564['MailAccount']['email']||_0x412564[_0x74ea('0xa')][_0x74ea('0xb')][_0x74ea('0x11')]),'to':_0x412564[_0x74ea('0x9')],'cc':_0x412564['cc'],'bcc':_0x412564[_0x74ea('0x14')],'subject':util[_0x74ea('0x12')](_0x74ea('0x15'),_0x5af6bd[_0x74ea('0x16')],_0x412564[_0x74ea('0x17')],_0x412564[_0x74ea('0x18')])}};var _0x158cf5=path['join'](__dirname,_0x74ea('0x19'));var _0x230d14=_0x5af6bd[_0x74ea('0x1a')];var _0x316959=util[_0x74ea('0x12')](_0x74ea('0x1b'),path[_0x74ea('0x1c')](_0x5af6bd['savename'],path['extname'](_0x5af6bd[_0x74ea('0x1a')])),_0x74ea('0x1d'));var _0x74849e=path[_0x74ea('0x1e')](_0x158cf5,_0x230d14);var _0x4bf1f4=path[_0x74ea('0x1e')](_0x158cf5,_0x316959);if(fs[_0x74ea('0x1f')](_0x74849e)){_0x5af6bd['status']=_0x74ea('0x20');_0x15b8fc[_0x74ea('0x21')][_0x74ea('0x22')]=[{'filename':_0x230d14,'path':_0x74849e}];_0x15b8fc[_0x74ea('0x21')][_0x74ea('0x23')]=util[_0x74ea('0x12')](_0x74ea('0x24'),JSON[_0x74ea('0x25')](_0x5af6bd,null,0x2));}else if(fs[_0x74ea('0x1f')](_0x4bf1f4)){_0x5af6bd['status']=_0x74ea('0x20');_0x15b8fc[_0x74ea('0x21')][_0x74ea('0x22')]=[{'filename':_0x316959,'path':_0x4bf1f4}];}else{_0x15b8fc[_0x74ea('0x21')][_0x74ea('0x23')]=_0x74ea('0x26');if(!_0x412564[_0x74ea('0x27')]){_0x15e75d=![];logger[_0x74ea('0x28')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x15e75d){return client[_0x74ea('0x29')](_0x74ea('0x2a'),_0x15b8fc)[_0x74ea('0x2b')](function(_0x2f4edc){if(_0x2f4edc[_0x74ea('0x2c')]){return logger[_0x74ea('0x2c')](_0x74ea('0x2d'),JSON['stringify'](_0x2f4edc));}return logger['info'](_0x74ea('0x2e'));})[_0x74ea('0x2f')](function(_0x54496b){return logger[_0x74ea('0x2c')](_0x74ea('0x2d'),JSON[_0x74ea('0x25')](_0x54496b));});}};}function handleError(){return function(_0x28732d){return logger[_0x74ea('0x2c')](JSON[_0x74ea('0x25')](_0x28732d));};}function handleResult(_0x5f0b68){return function(_0x3577f7){logger[_0x74ea('0x28')](_0x74ea('0x30'),JSON[_0x74ea('0x25')](_0x3577f7));if(_0x5f0b68[_0x74ea('0xa')]&&_0x5f0b68[_0x74ea('0xa')]['Smtp']&&!_['isNil'](_0x5f0b68[_0x74ea('0x9')])){setTimeout(handleSendEmail(_0x5f0b68,_0x3577f7),0x3c*0x3e8);}};}function handleJob(_0x549255){return function(){try{if(_[_0x74ea('0x31')](_0x549255[_0x74ea('0x17')])){return logger[_0x74ea('0x28')](_0x74ea('0x32'));}if(_[_0x74ea('0x31')](_0x549255[_0x74ea('0x18')])){return logger[_0x74ea('0x28')](_0x74ea('0x33'));}var _0x4c2896={'startDate':moment()[_0x74ea('0x34')](_0x549255['subtractNumber'],_0x549255[_0x74ea('0x18')])[_0x74ea('0x12')](_0x74ea('0x35')),'endDate':moment()['format'](_0x74ea('0x35')),'type':'scheduled','output':_0x549255[_0x74ea('0x36')],'name':_0x549255[_0x74ea('0x16')]};if(!_[_0x74ea('0x31')](_0x549255[_0x74ea('0x37')])){logger[_0x74ea('0x28')]('exec\x20defaul\x20report\x20id:%s',_0x549255[_0x74ea('0x37')]);return analyticDefaultReportController['runReport']({'id':_0x549255[_0x74ea('0x37')]},_0x4c2896)['then'](handleResult(_0x549255))[_0x74ea('0x2f')](handleError());}if(!_[_0x74ea('0x31')](_0x549255[_0x74ea('0x38')])){logger[_0x74ea('0x28')](_0x74ea('0x39'),_0x549255['CustomReportId']);return analyticCustomReportController[_0x74ea('0x3a')]({'id':_0x549255[_0x74ea('0x38')]},_0x4c2896)['then'](handleResult(_0x549255))['catch'](handleError());}}catch(_0x52ed64){logger[_0x74ea('0x2c')](JSON[_0x74ea('0x25')](_0x52ed64));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x32b472){var _0x31bfda={};if(_0x32b472){_0x31bfda['id']=_0x32b472;}return db[_0x74ea('0x3b')][_0x74ea('0x3c')]({'where':_0x31bfda,'include':[{'model':db[_0x74ea('0xa')],'attributes':['id',_0x74ea('0x16'),_0x74ea('0x9')],'include':[{'model':db[_0x74ea('0x3d')],'as':'Smtp'}]}]})[_0x74ea('0x2b')](function(_0x41c766){var _0x3edc74=_[_0x74ea('0x3e')](manager[_0x74ea('0x3f')]);var _0x31ae75=_[_0x74ea('0x40')](_0x41c766,function(_0x3e4fe1){return _0x3e4fe1['id'][_0x74ea('0x41')]();});var _0x5350c1=_[_0x74ea('0x42')](_0x41c766,function(_0x50582b){return _0x50582b['id'][_0x74ea('0x41')]();});var _0x2e3bc2=_0x32b472?_0x31ae75:_[_0x74ea('0x43')](_0x31ae75,_0x3edc74);var _0x28df0d=_[_0x74ea('0x44')](_0x31ae75,_0x3edc74);var _0x43cc2a=_[_0x74ea('0x43')](_0x3edc74,_0x31ae75);var _0x42856a;var _0x35d21c;for(_0x42856a=0x0;_0x42856a<_0x43cc2a[_0x74ea('0x45')]&&!_0x32b472;_0x42856a+=0x1){_0x35d21c=_0x43cc2a[_0x42856a]['toString']();if(manager['exists'](_0x35d21c)){manager[_0x74ea('0x46')](_0x35d21c);manager[_0x74ea('0x47')](_0x35d21c);logger[_0x74ea('0x28')](_0x74ea('0x48'),_0x35d21c);}}logger[_0x74ea('0x28')](_0x74ea('0x49'),JSON[_0x74ea('0x25')](_0x2e3bc2));for(_0x42856a=0x0;_0x42856a<_0x2e3bc2[_0x74ea('0x45')];_0x42856a+=0x1){_0x35d21c=_0x2e3bc2[_0x42856a][_0x74ea('0x41')]();logger[_0x74ea('0x28')](_0x74ea('0x4a'),_0x35d21c);if(_0x32b472){logger[_0x74ea('0x28')]('my\x20id',_0x32b472);logger[_0x74ea('0x28')](JSON[_0x74ea('0x25')](_0x5350c1[_0x35d21c]));BPromise[_0x74ea('0x4b')]()[_0x74ea('0x2b')](handleJob(_0x5350c1[_0x35d21c]));logger[_0x74ea('0x28')]('run\x20job',_0x5350c1[_0x35d21c][_0x74ea('0x16')],_0x5350c1[_0x35d21c][_0x74ea('0x4c')]);}else if(_0x5350c1[_0x35d21c]['cron']&&_0x5350c1[_0x35d21c]['active']&&moment()[_0x74ea('0x4d')](_0x5350c1[_0x35d21c]['startAt'],_0x5350c1[_0x35d21c]['endAt'])){manager[_0x74ea('0x4e')](_0x35d21c,_0x5350c1[_0x35d21c][_0x74ea('0x4c')],handleJob(_0x5350c1[_0x35d21c]));manager['start'](_0x35d21c);logger[_0x74ea('0x28')](_0x74ea('0x4f'),_0x5350c1[_0x35d21c][_0x74ea('0x16')],_0x5350c1[_0x35d21c][_0x74ea('0x4c')]);}else if(manager[_0x74ea('0x50')](_0x35d21c)){manager['stop'](_0x35d21c);manager[_0x74ea('0x47')](_0x35d21c);logger[_0x74ea('0x28')](_0x74ea('0x51'),_0x5350c1[_0x35d21c]['name'],_0x5350c1[_0x35d21c][_0x74ea('0x4c')]);}}for(_0x42856a=0x0,_0x35d21c;_0x42856a<_0x28df0d[_0x74ea('0x45')]&&!_0x32b472;_0x42856a+=0x1){_0x35d21c=_0x28df0d[_0x42856a][_0x74ea('0x41')]();if(manager[_0x74ea('0x50')](_0x35d21c)){if(_0x5350c1[_0x35d21c][_0x74ea('0x4c')]&&_0x5350c1[_0x35d21c][_0x74ea('0x52')]&&moment()[_0x74ea('0x4d')](_0x5350c1[_0x35d21c][_0x74ea('0x53')],_0x5350c1[_0x35d21c][_0x74ea('0x54')])){manager[_0x74ea('0x55')](_0x35d21c,_0x5350c1[_0x35d21c][_0x74ea('0x4c')],handleJob(_0x5350c1[_0x35d21c]));logger[_0x74ea('0x28')]('update\x20cron',_0x5350c1[_0x35d21c][_0x74ea('0x16')],_0x5350c1[_0x35d21c]['cron']);}else{manager['stop'](_0x35d21c);manager[_0x74ea('0x47')](_0x35d21c);logger[_0x74ea('0x28')](_0x74ea('0x51'),_0x5350c1[_0x35d21c][_0x74ea('0x16')],_0x5350c1[_0x35d21c][_0x74ea('0x4c')]);}}}})[_0x74ea('0x2f')](function(_0xd90c5f){logger[_0x74ea('0x2c')](JSON[_0x74ea('0x25')](_0xd90c5f));});}exports['run']=function(_0x3021a5){return getJobs(_0x3021a5);};exports[_0x74ea('0x56')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 14b95cc..081e9b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb4=['length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','Sentiment','catch','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','transcribeAccountId','push','all','SequelizeValidationError','error','start','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts'];(function(_0x9c142c,_0x53ba27){var _0x38c8be=function(_0x1bd97d){while(--_0x1bd97d){_0x9c142c['push'](_0x9c142c['shift']());}};_0x38c8be(++_0x53ba27);}(_0x0bb4,0x77));var _0x40bb=function(_0x2ff94d,_0x2ade09){_0x2ff94d=_0x2ff94d-0x0;var _0x2dd510=_0x0bb4[_0x2ff94d];return _0x2dd510;};var _=require(_0x40bb('0x0'));var AWS=require(_0x40bb('0x1'));var rp=require('request-promise');var util=require(_0x40bb('0x2'));var BPromise=require(_0x40bb('0x3'));var db=require(_0x40bb('0x4'))['db'];var logger=require(_0x40bb('0x5'))('transcribe');function getTranscriptionJob(_0x10646e,_0x54fef0,_0x266cf4,_0x57a115){return new Promise(function(_0xa8c628,_0xe75667){var _0x4d15f6=new AWS[(_0x40bb('0x6'))]({'accessKeyId':_0x54fef0,'secretAccessKey':_0x10646e,'region':_0x266cf4});_0x4d15f6[_0x40bb('0x7')]({'TranscriptionJobName':_0x57a115},function(_0x50d70f,_0x1dc35d){if(_0x50d70f){return _0xe75667(_0x50d70f);}else{return _0xa8c628(_0x1dc35d);}});});}function sentiment(_0x5d98d0,_0x3e8ef4,_0x3bc5c5,_0x1ee54b,_0x35095d){return new Promise(function(_0x44c1b5,_0x3ee596){var _0x3a86c3=new AWS[(_0x40bb('0x8'))]({'accessKeyId':_0x3e8ef4,'secretAccessKey':_0x5d98d0,'region':_0x3bc5c5});_0x3a86c3[_0x40bb('0x9')]({'Text':_0x1ee54b,'LanguageCode':_0x35095d[_0x40bb('0xa')](0x0,0x2)},function(_0x23bac7,_0x774cef){if(_0x23bac7){return _0x3ee596(_0x23bac7);}else{return _0x44c1b5(_0x774cef);}});});}function checkTranscribeJob(_0x1505a9,_0x344b09,_0x436966){var _0x2a3ae5;return new BPromise(function(_0x713bae,_0x4c98ae){logger['info'](util[_0x40bb('0xb')](_0x40bb('0xc'),_0x1505a9['id'],_0x1505a9[_0x40bb('0xd')]));return getTranscriptionJob(_0x436966[_0x40bb('0xe')],_0x436966[_0x40bb('0xf')],_0x344b09[_0x40bb('0x10')],_0x1505a9[_0x40bb('0xd')])[_0x40bb('0x11')](function(_0x4a177c){logger[_0x40bb('0x12')](util[_0x40bb('0xb')](_0x40bb('0x13'),_0x1505a9['id'],_0x1505a9[_0x40bb('0xd')],_0x4a177c[_0x40bb('0x14')]['TranscriptionJobStatus']));if(!_0x1505a9[_0x40bb('0x15')]){switch(_0x4a177c[_0x40bb('0x14')][_0x40bb('0x16')]){case _0x40bb('0x17'):var _0x77e2d2={'transcribeStatus':_0x4a177c[_0x40bb('0x14')][_0x40bb('0x16')],'fileUri':_0x4a177c['TranscriptionJob'][_0x40bb('0x18')][_0x40bb('0x19')]};logger[_0x40bb('0x12')](util[_0x40bb('0xb')](_0x40bb('0x1a'),_0x1505a9['id']));return rp({'uri':_0x4a177c[_0x40bb('0x14')][_0x40bb('0x18')][_0x40bb('0x19')],'json':!![]})[_0x40bb('0x11')](function(_0x1f0ac7){logger[_0x40bb('0x12')](util[_0x40bb('0xb')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x1505a9['id']));if(_0x1f0ac7&&_0x1f0ac7[_0x40bb('0x1b')]&&_0x1f0ac7[_0x40bb('0x1b')][_0x40bb('0x1c')]&&_0x1f0ac7[_0x40bb('0x1b')][_0x40bb('0x1c')][_0x40bb('0x1d')]){_0x77e2d2[_0x40bb('0x15')]='';for(var _0x2a0278=0x0;_0x2a0278<_0x1f0ac7[_0x40bb('0x1b')][_0x40bb('0x1c')][_0x40bb('0x1d')];_0x2a0278++){_0x77e2d2['fileText']+=_0x1f0ac7['results'][_0x40bb('0x1c')][_0x2a0278][_0x40bb('0x1e')]+'';}}return _0x1505a9[_0x40bb('0x1f')](_0x77e2d2);})['then'](function(){logger[_0x40bb('0x12')](util[_0x40bb('0xb')](_0x40bb('0x20'),_0x1505a9['id']));if(!_0x1505a9[_0x40bb('0x21')]){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x24'));}if(!_0x344b09[_0x40bb('0x25')]||!_0x344b09[_0x40bb('0x26')]||!_0x344b09['sentimentRegion']||!_0x344b09[_0x40bb('0x27')]||!_0x344b09[_0x40bb('0x28')]){throw new db['Sequelize'][(_0x40bb('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x77e2d2[_0x40bb('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x344b09['sentimentAccountId']===_0x436966['id']){return _0x436966;}else{return db[_0x40bb('0x29')][_0x40bb('0x2a')]({'where':{'id':_settings[_0x40bb('0x26')]}});}})['then'](function(_0x1ce1fe){if(!_0x1ce1fe){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1ce1fe[_0x40bb('0xe')]||!_0x1ce1fe[_0x40bb('0xf')]){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x2b'));}_0x2a3ae5=_0x1ce1fe;logger[_0x40bb('0x12')](util[_0x40bb('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1505a9['id']));return sentiment(_0x2a3ae5['data1'],_0x2a3ae5[_0x40bb('0xf')],_0x344b09['sentimentRegion'],_0x77e2d2[_0x40bb('0x15')],_0x344b09[_0x40bb('0x27')]);})[_0x40bb('0x11')](function(_0x52f5f1){logger[_0x40bb('0x12')](util['format'](_0x40bb('0x2c'),_0x1505a9['id']));return _0x1505a9[_0x40bb('0x1f')]({'sentiment':_0x52f5f1['Sentiment'],'sPositive':_0x52f5f1[_0x40bb('0x2d')][_0x40bb('0x2e')],'sNegative':_0x52f5f1['SentimentScore'][_0x40bb('0x2f')],'sMixed':_0x52f5f1[_0x40bb('0x2d')][_0x40bb('0x30')],'sNeutral':_0x52f5f1['SentimentScore'][_0x40bb('0x31')]});})[_0x40bb('0x11')](function(){logger['info'](util['format'](_0x40bb('0x20'),_0x1505a9['id']));_0x713bae();});case'FAILED':return _0x1505a9[_0x40bb('0x1f')]({'transcribeStatus':_0x40bb('0x32'),'failureReason':_0x4a177c[_0x40bb('0x14')][_0x40bb('0x33')]})['then'](function(){logger['info'](util['format'](_0x40bb('0x20'),_0x1505a9['id']));_0x713bae();});default:logger[_0x40bb('0x12')](util['format'](_0x40bb('0x34'),_0x1505a9['id']));break;}}else{return BPromise[_0x40bb('0x35')]()[_0x40bb('0x11')](function(){if(!_0x1505a9[_0x40bb('0x21')]){throw new db['Sequelize'][(_0x40bb('0x23'))](_0x40bb('0x24'));}if(!_0x344b09[_0x40bb('0x25')]||!_0x344b09[_0x40bb('0x26')]||!_0x344b09[_0x40bb('0x36')]||!_0x344b09['language']||!_0x344b09['bucket']){throw new db['Sequelize'][(_0x40bb('0x23'))](_0x40bb('0x37'));}if(!_0x1505a9['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x344b09[_0x40bb('0x26')]===_0x436966['id']){return _0x436966;}else{return db[_0x40bb('0x29')][_0x40bb('0x2a')]({'where':{'id':_settings[_0x40bb('0x26')]}});}})[_0x40bb('0x11')](function(_0x194728){if(!_0x194728){throw new db['Sequelize'][(_0x40bb('0x23'))](_0x40bb('0x38'));}if(!_0x194728['data1']||!_0x194728['data2']){throw new db['Sequelize']['ValidationError'](_0x40bb('0x2b'));}_0x2a3ae5=_0x194728;logger[_0x40bb('0x12')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1505a9['id']));return sentiment(_0x2a3ae5[_0x40bb('0xe')],_0x2a3ae5[_0x40bb('0xf')],_0x344b09[_0x40bb('0x36')],_0x1505a9['fileText'],_0x344b09['language']);})[_0x40bb('0x11')](function(_0x21fdbe){logger[_0x40bb('0x12')](util['format'](_0x40bb('0x2c'),_0x1505a9['id']));return _0x1505a9[_0x40bb('0x1f')]({'sentiment':_0x21fdbe[_0x40bb('0x39')],'sPositive':_0x21fdbe[_0x40bb('0x2d')]['Positive'],'sNegative':_0x21fdbe[_0x40bb('0x2d')][_0x40bb('0x2f')],'sMixed':_0x21fdbe[_0x40bb('0x2d')][_0x40bb('0x30')],'sNeutral':_0x21fdbe['SentimentScore'][_0x40bb('0x31')],'transcribeStatus':_0x40bb('0x17')});})[_0x40bb('0x11')](function(){logger['info'](util[_0x40bb('0xb')](_0x40bb('0x20'),_0x1505a9['id']));_0x713bae();});}})[_0x40bb('0x3a')](function(_0x138a72){if(_0x138a72){if(!_0x138a72[_0x40bb('0x3b')]||_0x138a72[_0x40bb('0x3b')]!=='SequelizeValidationError'){logger['error'](util[_0x40bb('0xb')](_0x40bb('0x3c'),_0x1505a9['id']),util[_0x40bb('0x3d')](_0x138a72,{'showHidden':![],'depth':null}));}}_0x713bae();});});}function checkTranscribe(){var _0x577c05;var _0x21c211;var _0x3302ea;return db[_0x40bb('0x3e')][_0x40bb('0x3f')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x5ae6f7){if(!_0x5ae6f7||!_0x5ae6f7['length']){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x40'));}_0x577c05=_0x5ae6f7;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x40bb('0x11')](function(_0x757421){if(!_0x757421){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x41'));}_0x21c211=_0x757421;if(!_0x21c211[_0x40bb('0x42')]||!_0x21c211['transcribeAccountId']||!_0x21c211[_0x40bb('0x10')]||!_0x21c211[_0x40bb('0x27')]||!_0x21c211['bucket']){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x43'));}return db[_0x40bb('0x29')][_0x40bb('0x2a')]({'where':{'id':_0x21c211[_0x40bb('0x44')]}});})['then'](function(_0x42e8f7){if(!_0x42e8f7){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x38'));}if(!_0x42e8f7['data1']||!_0x42e8f7[_0x40bb('0xf')]){throw new db[(_0x40bb('0x22'))][(_0x40bb('0x23'))](_0x40bb('0x2b'));}_0x3302ea=_0x42e8f7;var _0x5eca2d=[];_0x577c05['forEach'](function(_0x3c6821){_0x5eca2d[_0x40bb('0x45')](checkTranscribeJob(_0x3c6821,_0x21c211,_0x3302ea));});return BPromise[_0x40bb('0x46')](_0x5eca2d);})[_0x40bb('0x3a')](function(_0x307bf0){if(_0x307bf0){if(!_0x307bf0[_0x40bb('0x3b')]||_0x307bf0['name']!==_0x40bb('0x47')){logger[_0x40bb('0x48')](util[_0x40bb('0x3d')](_0x307bf0,{'showHidden':![],'depth':null}));}}});}exports[_0x40bb('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x1e7b=['Positive','Negative','Mixed','Neutral','FAILED','findOne','Cloud\x20Provider\x20not\x20available','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','transcribeAccountId','bucket','Transcribe\x20not\x20configured','CloudProvider','forEach','push','all','catch','error','start','lodash','aws-sdk','util','bluebird','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x1c12bd,_0x348360){_0x1c12bd=_0x1c12bd-0x0;var _0x1de620=_0x1e7b[_0x1c12bd];return _0x1de620;};var _=require(_0xb1e7('0x0'));var AWS=require(_0xb1e7('0x1'));var rp=require('request-promise');var util=require(_0xb1e7('0x2'));var BPromise=require(_0xb1e7('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xb1e7('0x4'))(_0xb1e7('0x5'));function getTranscriptionJob(_0x41ab3e,_0x2222eb,_0x4d6501,_0x1b473f){return new Promise(function(_0x2f733c,_0x3bc43b){var _0x35c43c=new AWS[(_0xb1e7('0x6'))]({'accessKeyId':_0x2222eb,'secretAccessKey':_0x41ab3e,'region':_0x4d6501});_0x35c43c['getTranscriptionJob']({'TranscriptionJobName':_0x1b473f},function(_0x161376,_0xca6a82){if(_0x161376){return _0x3bc43b(_0x161376);}else{return _0x2f733c(_0xca6a82);}});});}function sentiment(_0xf189f8,_0x1e20f8,_0x53bcee,_0x1c27e8,_0x842e0a){return new Promise(function(_0x400ad9,_0x13af76){var _0x2521e9=new AWS[(_0xb1e7('0x7'))]({'accessKeyId':_0x1e20f8,'secretAccessKey':_0xf189f8,'region':_0x53bcee});_0x2521e9[_0xb1e7('0x8')]({'Text':_0x1c27e8,'LanguageCode':_0x842e0a[_0xb1e7('0x9')](0x0,0x2)},function(_0x363557,_0xa10fa6){if(_0x363557){return _0x13af76(_0x363557);}else{return _0x400ad9(_0xa10fa6);}});});}function checkTranscribeJob(_0x5db797,_0x5894c2,_0x28c5bb){var _0x1e943d;return new BPromise(function(_0x299714,_0x4b157d){logger[_0xb1e7('0xa')](util[_0xb1e7('0xb')](_0xb1e7('0xc'),_0x5db797['id'],_0x5db797['transcribeName']));return getTranscriptionJob(_0x28c5bb[_0xb1e7('0xd')],_0x28c5bb[_0xb1e7('0xe')],_0x5894c2[_0xb1e7('0xf')],_0x5db797['transcribeName'])[_0xb1e7('0x10')](function(_0x2f677d){logger[_0xb1e7('0xa')](util[_0xb1e7('0xb')](_0xb1e7('0x11'),_0x5db797['id'],_0x5db797[_0xb1e7('0x12')],_0x2f677d[_0xb1e7('0x13')][_0xb1e7('0x14')]));if(!_0x5db797[_0xb1e7('0x15')]){switch(_0x2f677d[_0xb1e7('0x13')][_0xb1e7('0x14')]){case _0xb1e7('0x16'):var _0xa1ddc={'transcribeStatus':_0x2f677d[_0xb1e7('0x13')][_0xb1e7('0x14')],'fileUri':_0x2f677d['TranscriptionJob'][_0xb1e7('0x17')][_0xb1e7('0x18')]};logger['info'](util[_0xb1e7('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x5db797['id']));return rp({'uri':_0x2f677d[_0xb1e7('0x13')][_0xb1e7('0x17')][_0xb1e7('0x18')],'json':!![]})[_0xb1e7('0x10')](function(_0x310b1b){logger[_0xb1e7('0xa')](util['format'](_0xb1e7('0x19'),_0x5db797['id']));if(_0x310b1b&&_0x310b1b[_0xb1e7('0x1a')]&&_0x310b1b['results']['transcripts']&&_0x310b1b[_0xb1e7('0x1a')][_0xb1e7('0x1b')][_0xb1e7('0x1c')]){_0xa1ddc['fileText']='';for(var _0x1265d9=0x0;_0x1265d9<_0x310b1b[_0xb1e7('0x1a')][_0xb1e7('0x1b')][_0xb1e7('0x1c')];_0x1265d9++){_0xa1ddc['fileText']+=_0x310b1b['results'][_0xb1e7('0x1b')][_0x1265d9]['transcript']+'';}}return _0x5db797[_0xb1e7('0x1d')](_0xa1ddc);})[_0xb1e7('0x10')](function(){logger[_0xb1e7('0xa')](util[_0xb1e7('0xb')](_0xb1e7('0x1e'),_0x5db797['id']));if(!_0x5db797[_0xb1e7('0x1f')]){throw new db[(_0xb1e7('0x20'))][(_0xb1e7('0x21'))](_0xb1e7('0x22'));}if(!_0x5894c2[_0xb1e7('0x23')]||!_0x5894c2[_0xb1e7('0x24')]||!_0x5894c2[_0xb1e7('0x25')]||!_0x5894c2[_0xb1e7('0x26')]||!_0x5894c2['bucket']){throw new db[(_0xb1e7('0x20'))][(_0xb1e7('0x21'))](_0xb1e7('0x27'));}if(!_0xa1ddc[_0xb1e7('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x5894c2[_0xb1e7('0x24')]===_0x28c5bb['id']){return _0x28c5bb;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0xb1e7('0x24')]}});}})[_0xb1e7('0x10')](function(_0x3d0c48){if(!_0x3d0c48){throw new db[(_0xb1e7('0x20'))][(_0xb1e7('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3d0c48['data1']||!_0x3d0c48['data2']){throw new db[(_0xb1e7('0x20'))][(_0xb1e7('0x21'))](_0xb1e7('0x28'));}_0x1e943d=_0x3d0c48;logger[_0xb1e7('0xa')](util[_0xb1e7('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5db797['id']));return sentiment(_0x1e943d[_0xb1e7('0xd')],_0x1e943d[_0xb1e7('0xe')],_0x5894c2[_0xb1e7('0x25')],_0xa1ddc[_0xb1e7('0x15')],_0x5894c2[_0xb1e7('0x26')]);})['then'](function(_0x4bc23a){logger[_0xb1e7('0xa')](util[_0xb1e7('0xb')](_0xb1e7('0x29'),_0x5db797['id']));return _0x5db797['update']({'sentiment':_0x4bc23a[_0xb1e7('0x2a')],'sPositive':_0x4bc23a[_0xb1e7('0x2b')][_0xb1e7('0x2c')],'sNegative':_0x4bc23a[_0xb1e7('0x2b')][_0xb1e7('0x2d')],'sMixed':_0x4bc23a['SentimentScore'][_0xb1e7('0x2e')],'sNeutral':_0x4bc23a[_0xb1e7('0x2b')][_0xb1e7('0x2f')]});})[_0xb1e7('0x10')](function(){logger[_0xb1e7('0xa')](util[_0xb1e7('0xb')](_0xb1e7('0x1e'),_0x5db797['id']));_0x299714();});case _0xb1e7('0x30'):return _0x5db797['update']({'transcribeStatus':_0xb1e7('0x30'),'failureReason':_0x2f677d[_0xb1e7('0x13')]['FailureReason']})[_0xb1e7('0x10')](function(){logger[_0xb1e7('0xa')](util[_0xb1e7('0xb')](_0xb1e7('0x1e'),_0x5db797['id']));_0x299714();});default:logger[_0xb1e7('0xa')](util[_0xb1e7('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x5db797['id']));break;}}else{return BPromise['resolve']()[_0xb1e7('0x10')](function(){if(!_0x5db797[_0xb1e7('0x1f')]){throw new db['Sequelize'][(_0xb1e7('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5894c2[_0xb1e7('0x23')]||!_0x5894c2[_0xb1e7('0x24')]||!_0x5894c2['sentimentRegion']||!_0x5894c2[_0xb1e7('0x26')]||!_0x5894c2['bucket']){throw new db[(_0xb1e7('0x20'))][(_0xb1e7('0x21'))](_0xb1e7('0x27'));}if(!_0x5db797['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x5894c2[_0xb1e7('0x24')]===_0x28c5bb['id']){return _0x28c5bb;}else{return db['CloudProvider'][_0xb1e7('0x31')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x53987c){if(!_0x53987c){throw new db[(_0xb1e7('0x20'))][(_0xb1e7('0x21'))](_0xb1e7('0x32'));}if(!_0x53987c[_0xb1e7('0xd')]||!_0x53987c['data2']){throw new db[(_0xb1e7('0x20'))][(_0xb1e7('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x1e943d=_0x53987c;logger['info'](util[_0xb1e7('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5db797['id']));return sentiment(_0x1e943d['data1'],_0x1e943d[_0xb1e7('0xe')],_0x5894c2[_0xb1e7('0x25')],_0x5db797[_0xb1e7('0x15')],_0x5894c2[_0xb1e7('0x26')]);})[_0xb1e7('0x10')](function(_0x3d6862){logger[_0xb1e7('0xa')](util['format'](_0xb1e7('0x29'),_0x5db797['id']));return _0x5db797[_0xb1e7('0x1d')]({'sentiment':_0x3d6862[_0xb1e7('0x2a')],'sPositive':_0x3d6862[_0xb1e7('0x2b')][_0xb1e7('0x2c')],'sNegative':_0x3d6862[_0xb1e7('0x2b')][_0xb1e7('0x2d')],'sMixed':_0x3d6862[_0xb1e7('0x2b')][_0xb1e7('0x2e')],'sNeutral':_0x3d6862[_0xb1e7('0x2b')]['Neutral'],'transcribeStatus':_0xb1e7('0x16')});})['then'](function(){logger[_0xb1e7('0xa')](util[_0xb1e7('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5db797['id']));_0x299714();});}})['catch'](function(_0x4c043f){if(_0x4c043f){if(!_0x4c043f[_0xb1e7('0x33')]||_0x4c043f['name']!==_0xb1e7('0x34')){logger['error'](util[_0xb1e7('0xb')](_0xb1e7('0x35'),_0x5db797['id']),util[_0xb1e7('0x36')](_0x4c043f,{'showHidden':![],'depth':null}));}}_0x299714();});});}function checkTranscribe(){var _0x9fc86d;var _0x387b57;var _0x24a1de;return db[_0xb1e7('0x37')][_0xb1e7('0x38')]({'where':{'transcribeStatus':_0xb1e7('0x39')}})[_0xb1e7('0x10')](function(_0x296e2c){if(!_0x296e2c||!_0x296e2c[_0xb1e7('0x1c')]){throw new db[(_0xb1e7('0x20'))][(_0xb1e7('0x21'))](_0xb1e7('0x3a'));}_0x9fc86d=_0x296e2c;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](function(_0x371511){if(!_0x371511){throw new db[(_0xb1e7('0x20'))][(_0xb1e7('0x21'))]('Settings\x20not\x20available');}_0x387b57=_0x371511;if(!_0x387b57['transcribe']||!_0x387b57[_0xb1e7('0x3b')]||!_0x387b57[_0xb1e7('0xf')]||!_0x387b57[_0xb1e7('0x26')]||!_0x387b57[_0xb1e7('0x3c')]){throw new db[(_0xb1e7('0x20'))]['ValidationError'](_0xb1e7('0x3d'));}return db[_0xb1e7('0x3e')]['findOne']({'where':{'id':_0x387b57[_0xb1e7('0x3b')]}});})[_0xb1e7('0x10')](function(_0x39f200){if(!_0x39f200){throw new db['Sequelize'][(_0xb1e7('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x39f200[_0xb1e7('0xd')]||!_0x39f200[_0xb1e7('0xe')]){throw new db[(_0xb1e7('0x20'))][(_0xb1e7('0x21'))](_0xb1e7('0x28'));}_0x24a1de=_0x39f200;var _0x15c136=[];_0x9fc86d[_0xb1e7('0x3f')](function(_0x2eb7cc){_0x15c136[_0xb1e7('0x40')](checkTranscribeJob(_0x2eb7cc,_0x387b57,_0x24a1de));});return BPromise[_0xb1e7('0x41')](_0x15c136);})[_0xb1e7('0x42')](function(_0x368227){if(_0x368227){if(!_0x368227['name']||_0x368227['name']!==_0xb1e7('0x34')){logger[_0xb1e7('0x43')](util[_0xb1e7('0x36')](_0x368227,{'showHidden':![],'depth':null}));}}});}exports[_0xb1e7('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 3de51cf..a29a769 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c43=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','catch','error','start','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x2c43,0xfa));var _0x32c4=function(_0x1373b9,_0x3b09a6){_0x1373b9=_0x1373b9-0x0;var _0x51a846=_0x2c43[_0x1373b9];return _0x51a846;};'use strict';var _=require('lodash');var moment=require(_0x32c4('0x0'));var Redis=require('ioredis');var util=require(_0x32c4('0x1'));var config=require(_0x32c4('0x2'));var db=require(_0x32c4('0x3'))['db'];var logger=require(_0x32c4('0x4'))(_0x32c4('0x5'));config[_0x32c4('0x6')]=_[_0x32c4('0x7')](config[_0x32c4('0x6')],{'host':_0x32c4('0x8'),'port':0x18eb});var io=require(_0x32c4('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x17b3ba=[];return db[_0x32c4('0xa')][_0x32c4('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x32c4('0xc')](0x18,_0x32c4('0xd'))}}})[_0x32c4('0xe')](function(_0x57eebf){if(_0x57eebf&&_0x57eebf[_0x32c4('0xf')]){_0x17b3ba=_['map'](_0x57eebf||[],'id');logger[_0x32c4('0x10')](_0x32c4('0x11'),_0x17b3ba[_0x32c4('0x12')]());return db[_0x32c4('0xa')]['update']({'closeReason':_0x32c4('0x13'),'disposition':_0x32c4('0x14'),'closed':!![],'closedAt':moment()[_0x32c4('0x15')](_0x32c4('0x16'))},{'where':{'id':_0x17b3ba}});}})[_0x32c4('0xe')](function(){if(_0x17b3ba&&_0x17b3ba[_0x32c4('0xf')]){logger['info'](_0x32c4('0x17'),_0x17b3ba[_0x32c4('0x12')]());for(var _0x3349e4=0x0;_0x3349e4<_0x17b3ba[_0x32c4('0xf')];_0x3349e4++){io['emit']('whatsappInteraction:update',{'id':_0x17b3ba[_0x3349e4],'closed':!![]});}}})[_0x32c4('0x18')](function(_0x2f9f8b){logger[_0x32c4('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x2f9f8b?util['inspect'](_0x2f9f8b,{'showHidden':![],'depth':null}):'');});}exports[_0x32c4('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x0295=['redis','defaults','localhost','socket.io-emitter','subtract','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','util','../logger','schedule'];(function(_0x5b9a30,_0x557073){var _0x132a89=function(_0x2a1023){while(--_0x2a1023){_0x5b9a30['push'](_0x5b9a30['shift']());}};_0x132a89(++_0x557073);}(_0x0295,0x1f0));var _0x5029=function(_0x512126,_0x8db5c2){_0x512126=_0x512126-0x0;var _0x19cbe4=_0x0295[_0x512126];return _0x19cbe4;};'use strict';var _=require(_0x5029('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x5029('0x1'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x5029('0x2'))(_0x5029('0x3'));config[_0x5029('0x4')]=_[_0x5029('0x5')](config[_0x5029('0x4')],{'host':_0x5029('0x6'),'port':0x18eb});var io=require(_0x5029('0x7'))(new Redis(config[_0x5029('0x4')]));function closeInteractions(){var _0x5b3cd=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x5029('0x8')](0x18,'hours')}}})[_0x5029('0x9')](function(_0x5bccfc){if(_0x5bccfc&&_0x5bccfc[_0x5029('0xa')]){_0x5b3cd=_['map'](_0x5bccfc||[],'id');logger[_0x5029('0xb')](_0x5029('0xc'),_0x5b3cd[_0x5029('0xd')]());return db['WhatsappInteraction'][_0x5029('0xe')]({'closeReason':_0x5029('0xf'),'disposition':_0x5029('0x10'),'closed':!![],'closedAt':moment()['format'](_0x5029('0x11'))},{'where':{'id':_0x5b3cd}});}})[_0x5029('0x9')](function(){if(_0x5b3cd&&_0x5b3cd['length']){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x5b3cd['join']());for(var _0x2484ac=0x0;_0x2484ac<_0x5b3cd[_0x5029('0xa')];_0x2484ac++){io[_0x5029('0x12')](_0x5029('0x13'),{'id':_0x5b3cd[_0x2484ac],'closed':!![]});}}})[_0x5029('0x14')](function(_0x11c24b){logger[_0x5029('0x15')](_0x5029('0x16'),_0x11c24b?util[_0x5029('0x17')](_0x11c24b,{'showHidden':![],'depth':null}):'');});}exports[_0x5029('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index f77eb98..93475bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d5e=['hopper1','contacts2','hopper2','catch','util','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now','destroy','then','CmContact','bulkCreate','finished\x20populating','contacts1','CmHopper','log'];(function(_0x4e52f1,_0x1f3bb0){var _0x1031b0=function(_0x263974){while(--_0x263974){_0x4e52f1['push'](_0x4e52f1['shift']());}};_0x1031b0(++_0x1f3bb0);}(_0x9d5e,0x89));var _0xe9d5=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x9d5e[_0x215dc8];return _0x583ea3;};'use strict';var util=require(_0xe9d5('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xe9d5('0x1')+i,'lastName':_0xe9d5('0x2')+i,'phone':0xf879fb460+i,'email':_0xe9d5('0x3')+i+_0xe9d5('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe9d5('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xe9d5('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe9d5('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe9d5('0x5')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xe9d5('0x2')+i,'phone':0xf879fb460+i,'email':_0xe9d5('0x3')+i+_0xe9d5('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe9d5('0x5')]({'id':i,'active':![],'scheduledat':Date[_0xe9d5('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe9d5('0x6')](),'updatedAt':Date[_0xe9d5('0x6')]()});}db['CmContact'][_0xe9d5('0x7')]({'where':{}})[_0xe9d5('0x8')](function(){return db[_0xe9d5('0x9')][_0xe9d5('0xa')](contacts);})[_0xe9d5('0x8')](function(){console['log'](_0xe9d5('0xb'),_0xe9d5('0xc'));return db['CmHopper'][_0xe9d5('0x7')]({'where':{}});})['then'](function(){return db[_0xe9d5('0xd')]['bulkCreate'](hopper);})[_0xe9d5('0x8')](function(){console[_0xe9d5('0xe')](_0xe9d5('0xb'),_0xe9d5('0xf'));return db[_0xe9d5('0x9')]['bulkCreate'](contacts2);})[_0xe9d5('0x8')](function(){console[_0xe9d5('0xe')](_0xe9d5('0xb'),_0xe9d5('0x10'));return db['CmHopper']['bulkCreate'](hopper2);})[_0xe9d5('0x8')](function(){console[_0xe9d5('0xe')](_0xe9d5('0xb'),_0xe9d5('0x11'));})[_0xe9d5('0x12')](function(_0x21b055){console[_0xe9d5('0xe')](_0x21b055);});
\ No newline at end of file
+var _0x4233=['@xcally.com','destroy','then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo','now','innocenzo.biondo'];(function(_0x1da778,_0x193fbd){var _0x2aba0d=function(_0x1933ce){while(--_0x1933ce){_0x1da778['push'](_0x1da778['shift']());}};_0x2aba0d(++_0x193fbd);}(_0x4233,0x65));var _0x3423=function(_0x1771ed,_0x7a5a8b){_0x1771ed=_0x1771ed-0x0;var _0x1b6a97=_0x4233[_0x1771ed];return _0x1b6a97;};'use strict';var util=require(_0x3423('0x0'));var db=require(_0x3423('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3423('0x2')]({'id':i,'firstName':_0x3423('0x3')+i,'lastName':_0x3423('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3423('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x3423('0x5')](),'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[_0x3423('0x2')]({'id':i,'firstName':_0x3423('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x3423('0x6')+i+_0x3423('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3423('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x3423('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3423('0x5')](),'updatedAt':Date['now']()});}db['CmContact'][_0x3423('0x8')]({'where':{}})[_0x3423('0x9')](function(){return db['CmContact'][_0x3423('0xa')](contacts);})[_0x3423('0x9')](function(){console[_0x3423('0xb')]('finished\x20populating',_0x3423('0xc'));return db[_0x3423('0xd')][_0x3423('0x8')]({'where':{}});})[_0x3423('0x9')](function(){return db[_0x3423('0xd')]['bulkCreate'](hopper);})[_0x3423('0x9')](function(){console['log'](_0x3423('0xe'),_0x3423('0xf'));return db['CmContact'][_0x3423('0xa')](contacts2);})[_0x3423('0x9')](function(){console[_0x3423('0xb')](_0x3423('0xe'),_0x3423('0x10'));return db[_0x3423('0xd')]['bulkCreate'](hopper2);})[_0x3423('0x9')](function(){console[_0x3423('0xb')](_0x3423('0xe'),'hopper2');})[_0x3423('0x11')](function(_0x51e2b3){console[_0x3423('0xb')](_0x51e2b3);});
\ No newline at end of file
index 1bce7d7..cb56c2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dba=['util','../mysqldb','push','format','%s%s','agent','friend','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log'];(function(_0x38f5c0,_0x57b250){var _0x54f13a=function(_0x4a322b){while(--_0x4a322b){_0x38f5c0['push'](_0x38f5c0['shift']());}};_0x54f13a(++_0x57b250);}(_0x1dba,0xdd));var _0xa1db=function(_0x53108e,_0x4c5f3f){_0x53108e=_0x53108e-0x0;var _0x3ea1ff=_0x1dba[_0x53108e];return _0x3ea1ff;};'use strict';var util=require(_0xa1db('0x0'));var db=require(_0xa1db('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa1db('0x2')]({'name':util[_0xa1db('0x3')](_0xa1db('0x4'),'agent',i),'fullname':util[_0xa1db('0x3')](_0xa1db('0x4'),_0xa1db('0x5'),i),'email':util['format']('%s%s@xcally.com',_0xa1db('0x5'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0xa1db('0x6'),'transport':['udp','ws',_0xa1db('0x7')],'disallow':[_0xa1db('0x8')],'allow':['ulaw'],'defaultuser':util['format']('%s%s',_0xa1db('0x5'),i),'encryption':_0xa1db('0x9'),'avpf':_0xa1db('0x9'),'force_avp':_0xa1db('0x9'),'icesupport':_0xa1db('0x9'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xa1db('0xa'),'dtlsprivatekey':_0xa1db('0xb'),'dtlssetup':_0xa1db('0xc'),'callerid':util[_0xa1db('0x3')](_0xa1db('0xd'),util[_0xa1db('0x3')]('%s%s',_0xa1db('0x5'),i),0xfa0+i)});}db[_0xa1db('0xe')][_0xa1db('0xf')](users)['then'](function(){console[_0xa1db('0x10')]('add\x20user');})['catch'](function(_0x2dfcfc){console[_0xa1db('0x10')](_0x2dfcfc);});
\ No newline at end of file
+var _0xf40a=['push','format','%s%s','agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','log','util'];(function(_0x5497b9,_0x4217fd){var _0x1ec0cc=function(_0xd0cc8d){while(--_0xd0cc8d){_0x5497b9['push'](_0x5497b9['shift']());}};_0x1ec0cc(++_0x4217fd);}(_0xf40a,0x175));var _0xaf40=function(_0x1f4e6c,_0x13768e){_0x1f4e6c=_0x1f4e6c-0x0;var _0x2d92f6=_0xf40a[_0x1f4e6c];return _0x2d92f6;};'use strict';var util=require(_0xaf40('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xaf40('0x1')]({'name':util[_0xaf40('0x2')](_0xaf40('0x3'),'agent',i),'fullname':util[_0xaf40('0x2')](_0xaf40('0x3'),_0xaf40('0x4'),i),'email':util[_0xaf40('0x2')]('%s%s@xcally.com',_0xaf40('0x4'),i),'role':'agent','password':_0xaf40('0x5'),'internal':0xfa0+i,'type':_0xaf40('0x6'),'transport':[_0xaf40('0x7'),'ws',_0xaf40('0x8')],'disallow':[_0xaf40('0x9')],'allow':[_0xaf40('0xa')],'defaultuser':util[_0xaf40('0x2')]('%s%s',_0xaf40('0x4'),i),'encryption':_0xaf40('0xb'),'avpf':_0xaf40('0xb'),'force_avp':_0xaf40('0xb'),'icesupport':_0xaf40('0xb'),'dtlsenable':_0xaf40('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xaf40('0xc'),'dtlssetup':_0xaf40('0xd'),'callerid':util[_0xaf40('0x2')](_0xaf40('0xe'),util[_0xaf40('0x2')](_0xaf40('0x3'),_0xaf40('0x4'),i),0xfa0+i)});}db['User'][_0xaf40('0xf')](users)['then'](function(){console[_0xaf40('0x10')]('add\x20user');})['catch'](function(_0x428e4a){console[_0xaf40('0x10')](_0x428e4a);});
\ No newline at end of file
index 2355913..0f992d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde1a=['handshake','ChatInteraction','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','ChatQueues','OpenchannelQueues','IvrCampaigns','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','emit','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','default','connection','address','request','remoteAddress','connectedAt','log','nsp','disconnect','DISCONNECTED','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','where','Campaign','length','format','user:%s','query','find','role','userProfileId'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xde1a,0xfd));var _0xade1=function(_0x561f9b,_0x3a2fc0){_0x561f9b=_0x561f9b-0x0;var _0x172cfd=_0xde1a[_0x561f9b];return _0x172cfd;};'use strict';var _=require('lodash');var util=require(_0xade1('0x0'));var BPromise=require(_0xade1('0x1'));var db=require(_0xade1('0x2'))['db'];var config=require(_0xade1('0x3'));var queryQueues={'attributes':['id',_0xade1('0x4')],'include':[{'as':_0xade1('0x5'),'model':db[_0xade1('0x6')],'attributes':['id',_0xade1('0x4'),'role'],'raw':!![],'where':{'role':_0xade1('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xade1('0x4')],'where':{'role':_0xade1('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xade1('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xade1('0x4')],'where':{'role':_0xade1('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xade1('0x9')],'where':{'type':_0xade1('0xa')}};function getAssociatedResources(_0x1bb12a,_0x364a46,_0x120f47){return db[_0xade1('0xb')][_0xade1('0xc')]({'where':{'name':_0x1bb12a,'userProfileId':_0x364a46},'raw':!![]})[_0xade1('0xd')](function(_0x5add3c){if(_0x5add3c){if(_0x5add3c[_0xade1('0xe')]){switch(_0x1bb12a){case _0xade1('0xf'):case'ChatQueues':case _0xade1('0x10'):case _0xade1('0x11'):case _0xade1('0x12'):case'OpenchannelQueues':case _0xade1('0x13'):return db[_0x120f47][_0xade1('0x14')](queryQueues);case _0xade1('0x15'):return db[_0x120f47][_0xade1('0x14')](queryTelephones);case _0xade1('0x16'):return db[_0x120f47][_0xade1('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x120f47][_0xade1('0x14')](queryCampaigns);}}else{return db[_0xade1('0x17')][_0xade1('0x14')]({'attributes':[_0xade1('0x18')],'where':{'sectionId':_0x5add3c['id']},'raw':!![]})[_0xade1('0xd')](function(_0x5bd472){if(_0x5bd472){var _0x44c001={'where':{'id':_[_0xade1('0x19')](_0x5bd472,_0xade1('0x18'))},'raw':!![]};switch(_0x120f47){case _0xade1('0x6'):_0x44c001[_0xade1('0x1a')]['role']=_0xade1('0x8');break;case _0xade1('0x1b'):_0x44c001[_0xade1('0x1a')][_0xade1('0x9')]=_0xade1('0xa');break;}return db[_0x120f47][_0xade1('0x14')](_0x44c001);}else{return[];}});}}else{return[];}})[_0xade1('0xd')](function(_0x43f559){return _0x43f559;});}function joinOrLeaveQueues(_0x16f23a,_0x2c3acc,_0x1d7c21,_0x12ea91){_0x16f23a[_0x2c3acc](util['format']('%s:queue:%s',_0x1d7c21,_0x12ea91[_0xade1('0x4')]));if(_0x12ea91[_0xade1('0x5')]){for(var _0x321ea7=0x0;_0x321ea7<_0x12ea91[_0xade1('0x5')][_0xade1('0x1c')];_0x321ea7+=0x1){_0x16f23a[_0x2c3acc](util[_0xade1('0x1d')](_0xade1('0x1e'),_0x12ea91[_0xade1('0x5')][_0x321ea7][_0xade1('0x4')]));}}}function joinOrLeave(_0x180d98,_0x446bde,_0x4ab3ac){var _0x6260d3;if(_0x180d98['handshake'][_0xade1('0x1f')]['id']){db['User'][_0xade1('0x20')]({'attributes':['id',_0xade1('0x4'),_0xade1('0x21'),_0xade1('0x22')],'where':{'id':_0x180d98[_0xade1('0x23')][_0xade1('0x1f')]['id']},'include':[{'model':db[_0xade1('0x24')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xade1('0x25')],'as':_0xade1('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xade1('0x27')],'as':_0xade1('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xade1('0x29')],'as':_0xade1('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xade1('0xd')](function(_0x51d9e7){if(_0x51d9e7){_0x6260d3=_0x51d9e7;_0x180d98[_0x446bde](util[_0xade1('0x1d')](_0xade1('0x1e'),_0x51d9e7['name']));var _0x512ca9=[];switch(_0x51d9e7['role']){case _0xade1('0x2b'):_0x180d98[_0x446bde](_0xade1('0x2c'));_0x180d98[_0x446bde](_0xade1('0x2d'));if(queryQueues[_0xade1('0x2e')](_0xade1('0x2f'))){delete queryQueues[_0xade1('0x2f')];}_0x512ca9[_0xade1('0x30')](db[_0xade1('0x31')][_0xade1('0x14')](queryQueues));_0x512ca9['push'](db[_0xade1('0x32')][_0xade1('0x14')](queryQueues));_0x512ca9[_0xade1('0x30')](db['FaxQueue'][_0xade1('0x14')](queryQueues));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x33')]['findAll'](queryQueues));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x34')][_0xade1('0x14')](queryQueues));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x35')]['findAll'](queryQueues));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x36')][_0xade1('0x14')](queryQueues));_0x512ca9['push'](db[_0xade1('0x6')][_0xade1('0x14')](queryTelephones));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x37')][_0xade1('0x14')](queryTrunks));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x1b')][_0xade1('0x14')](queryCampaigns));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x6')][_0xade1('0x14')](queryAgents));break;case _0xade1('0x38'):_0x180d98[_0x446bde]('voice:inbound');_0x180d98[_0x446bde]('voice:outbound');_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0xf'),_0x51d9e7[_0xade1('0x22')],_0xade1('0x31')));_0x512ca9['push'](getAssociatedResources(_0xade1('0x39'),_0x51d9e7['userProfileId'],'ChatQueue'));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x10'),_0x51d9e7[_0xade1('0x22')],'FaxQueue'));_0x512ca9[_0xade1('0x30')](getAssociatedResources('SmsQueues',_0x51d9e7[_0xade1('0x22')],_0xade1('0x33')));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x12'),_0x51d9e7['userProfileId'],'MailQueue'));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x3a'),_0x51d9e7[_0xade1('0x22')],_0xade1('0x35')));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x13'),_0x51d9e7['userProfileId'],'WhatsappQueue'));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x15'),_0x51d9e7[_0xade1('0x22')],_0xade1('0x6')));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x16'),_0x51d9e7[_0xade1('0x22')],_0xade1('0x37')));_0x512ca9[_0xade1('0x30')](getAssociatedResources(_0xade1('0x3b'),_0x51d9e7[_0xade1('0x22')],_0xade1('0x1b')));_0x512ca9[_0xade1('0x30')](db[_0xade1('0x6')][_0xade1('0x14')](queryAgents));break;case _0xade1('0x7'):_0x180d98[_0x446bde]('voice:inbound');_0x180d98[_0x446bde](_0xade1('0x2d'));_0x512ca9['push'](_0x51d9e7[_0xade1('0x3c')]({'attributes':['id',_0xade1('0x4')]}));_0x512ca9[_0xade1('0x30')](_0x51d9e7['getChatQueues']({'attributes':['id','name']}));_0x512ca9[_0xade1('0x30')](_0x51d9e7[_0xade1('0x3d')]({'attributes':['id','name']}));_0x512ca9[_0xade1('0x30')](_0x51d9e7[_0xade1('0x3e')]({'attributes':['id','name']}));_0x512ca9[_0xade1('0x30')](_0x51d9e7[_0xade1('0x3f')]({'attributes':['id',_0xade1('0x4')]}));_0x512ca9['push'](_0x51d9e7[_0xade1('0x40')]({'attributes':['id','name']}));_0x512ca9[_0xade1('0x30')](_0x51d9e7[_0xade1('0x41')]({'attributes':['id',_0xade1('0x4')]}));break;}return BPromise[_0xade1('0x42')](_0x512ca9);}})[_0xade1('0xd')](function(_0x38198b){if(_0x38198b&&_0x38198b[_0xade1('0x1c')]){for(var _0x59b090=0x0;_0x59b090<_0x38198b[_0xade1('0x1c')];_0x59b090+=0x1){for(var _0x255fca=0x0;_0x255fca<_0x38198b[_0x59b090]['length'];_0x255fca+=0x1){switch(_0x59b090){case 0x0:joinOrLeaveQueues(_0x180d98,_0x446bde,'voice',_0x38198b[_0x59b090][_0x255fca]);break;case 0x1:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x43'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x2:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x44'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x3:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x45'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x4:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x46'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x5:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x47'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x6:joinOrLeaveQueues(_0x180d98,_0x446bde,_0xade1('0x48'),_0x38198b[_0x59b090][_0x255fca]);break;case 0x7:if(_0x6260d3[_0xade1('0x21')]!==_0xade1('0x7'))_0x180d98[_0x446bde](util[_0xade1('0x1d')]('telephone:%s',_0x38198b[_0x59b090][_0x255fca]['name']));break;case 0x8:if(_0x6260d3[_0xade1('0x21')]!==_0xade1('0x7'))_0x180d98[_0x446bde](util[_0xade1('0x1d')](_0xade1('0x49'),_0x38198b[_0x59b090][_0x255fca][_0xade1('0x4')]));break;case 0x9:if(_0x6260d3['role']!=='agent')_0x180d98[_0x446bde](util[_0xade1('0x1d')](_0xade1('0x4a'),_0x38198b[_0x59b090][_0x255fca][_0xade1('0x9')],_0x38198b[_0x59b090][_0x255fca][_0xade1('0x4')]));break;case 0xa:_0x180d98[_0x446bde](util['format'](_0xade1('0x1e'),_0x38198b[_0x59b090][_0x255fca][_0xade1('0x4')]));break;}}}}})[_0xade1('0xd')](function(){if(_0x446bde===_0xade1('0x4b')){var _0x495bf3=_['map'](_0x6260d3['ChatInteractions'],'id');return _0x6260d3['removeChatInteractions'](_0x495bf3)['then'](function(){for(var _0x4fc6d5=0x0;_0x4fc6d5<_0x495bf3[_0xade1('0x1c')];_0x4fc6d5+=0x1){_0x4ab3ac[_0xade1('0x4c')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x495bf3[_0x4fc6d5]),'UserId':Number(_0x6260d3['id'])});}});}})['then'](function(){if(_0x446bde===_0xade1('0x4b')){var _0x486f7a=_[_0xade1('0x19')](_0x6260d3[_0xade1('0x26')],'id');return _0x6260d3['removeMailInteractions'](_0x486f7a)[_0xade1('0xd')](function(){for(var _0x2a4a67=0x0;_0x2a4a67<_0x486f7a[_0xade1('0x1c')];_0x2a4a67+=0x1){_0x4ab3ac['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x486f7a[_0x2a4a67]),'UserId':Number(_0x6260d3['id'])});}});}})[_0xade1('0xd')](function(){if(_0x446bde==='leave'){var _0x363751=_[_0xade1('0x19')](_0x6260d3[_0xade1('0x4d')],'id');return _0x6260d3[_0xade1('0x4e')](_0x363751)[_0xade1('0xd')](function(){for(var _0x2b03da=0x0;_0x2b03da<_0x363751[_0xade1('0x1c')];_0x2b03da+=0x1){_0x4ab3ac['emit'](_0xade1('0x4f'),{'FaxInteractionId':Number(_0x363751[_0x2b03da]),'UserId':Number(_0x6260d3['id'])});}});}})[_0xade1('0xd')](function(){if(_0x446bde==='leave'){var _0x4b0997=_[_0xade1('0x19')](_0x6260d3[_0xade1('0x28')],'id');return _0x6260d3[_0xade1('0x50')](_0x4b0997)['then'](function(){for(var _0x3543ff=0x0;_0x3543ff<_0x4b0997[_0xade1('0x1c')];_0x3543ff+=0x1){_0x4ab3ac[_0xade1('0x4c')](_0xade1('0x51'),{'SmsInteractionId':Number(_0x4b0997[_0x3543ff]),'UserId':Number(_0x6260d3['id'])});}});}})[_0xade1('0xd')](function(){if(_0x446bde===_0xade1('0x4b')){var _0x415aed=_['map'](_0x6260d3['OpenchannelInteractions'],'id');return _0x6260d3[_0xade1('0x52')](_0x415aed)[_0xade1('0xd')](function(){for(var _0x2aa0cc=0x0;_0x2aa0cc<_0x415aed[_0xade1('0x1c')];_0x2aa0cc+=0x1){_0x4ab3ac[_0xade1('0x4c')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x415aed[_0x2aa0cc]),'UserId':Number(_0x6260d3['id'])});}});}})['then'](function(){if(_0x446bde===_0xade1('0x4b')){var _0x27430a=_['map'](_0x6260d3['WhatsappInteractions'],'id');return _0x6260d3[_0xade1('0x53')](_0x27430a)['then'](function(){for(var _0x2a35be=0x0;_0x2a35be<_0x27430a[_0xade1('0x1c')];_0x2a35be+=0x1){_0x4ab3ac[_0xade1('0x4c')](_0xade1('0x54'),{'WhatsappInteractionId':Number(_0x27430a[_0x2a35be]),'UserId':Number(_0x6260d3['id'])});}});}})[_0xade1('0x55')](function(_0x4c4a28){_0x180d98['log'](_0x4c4a28);});}}function onDisconnect(_0x2b2c42,_0x52900b){joinOrLeave(_0x2b2c42,_0xade1('0x4b'),_0x52900b);}function onConnect(_0x24efca){joinOrLeave(_0x24efca,'join');}exports[_0xade1('0x56')]=function(_0x3fdf23){_0x3fdf23['on'](_0xade1('0x57'),function(_0x590ed1){_0x590ed1['setMaxListeners'](0x0);_0x590ed1[_0xade1('0x58')]=_0x590ed1[_0xade1('0x59')][_0xade1('0x57')][_0xade1('0x5a')]+':'+_0x590ed1[_0xade1('0x59')][_0xade1('0x57')]['remotePort'];_0x590ed1[_0xade1('0x5b')]=new Date();_0x590ed1['log']=function(_0x338c39){console[_0xade1('0x5c')]('SocketIO\x20'+_0x590ed1[_0xade1('0x5d')]['name']+'['+_0x590ed1['address']+']',_0x338c39);};_0x590ed1['on'](_0xade1('0x5e'),function(){onDisconnect(_0x590ed1,_0x3fdf23);_0x590ed1[_0xade1('0x5c')](_0xade1('0x5f'));});onConnect(_0x590ed1);_0x590ed1[_0xade1('0x5c')]('CONNECTED');});};
\ No newline at end of file
+var _0xf08c=['autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','resourceId','map','telephone','Campaign','type','ivr','format','user:%s','handshake','find','role','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueue','FaxQueue','Trunks','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','setMaxListeners','request','remoteAddress','remotePort','SocketIO\x20','nsp','address','DISCONNECTED','lodash','util','bluebird','./environment','name','Agents','User','agent','UserProfileSection','findOne','then'];(function(_0x1c58a2,_0x2634c3){var _0x205496=function(_0x1f0e02){while(--_0x1f0e02){_0x1c58a2['push'](_0x1c58a2['shift']());}};_0x205496(++_0x2634c3);}(_0xf08c,0xb5));var _0xcf08=function(_0x335d8c,_0x13d18e){_0x335d8c=_0x335d8c-0x0;var _0x66f908=_0xf08c[_0x335d8c];return _0x66f908;};'use strict';var _=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var BPromise=require(_0xcf08('0x2'));var db=require('../mysqldb')['db'];var config=require(_0xcf08('0x3'));var queryQueues={'attributes':['id',_0xcf08('0x4')],'include':[{'as':_0xcf08('0x5'),'model':db[_0xcf08('0x6')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0xcf08('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xcf08('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xcf08('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xcf08('0x4')],'where':{'role':_0xcf08('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xcf08('0x4'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x312188,_0x57cad4,_0x1ab45d){return db[_0xcf08('0x8')][_0xcf08('0x9')]({'where':{'name':_0x312188,'userProfileId':_0x57cad4},'raw':!![]})[_0xcf08('0xa')](function(_0x5aae0b){if(_0x5aae0b){if(_0x5aae0b[_0xcf08('0xb')]){switch(_0x312188){case _0xcf08('0xc'):case _0xcf08('0xd'):case _0xcf08('0xe'):case _0xcf08('0xf'):case _0xcf08('0x10'):case _0xcf08('0x11'):case _0xcf08('0x12'):return db[_0x1ab45d][_0xcf08('0x13')](queryQueues);case _0xcf08('0x14'):return db[_0x1ab45d][_0xcf08('0x13')](queryTelephones);case'Trunks':return db[_0x1ab45d]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x1ab45d][_0xcf08('0x13')](queryCampaigns);}}else{return db[_0xcf08('0x15')]['findAll']({'attributes':[_0xcf08('0x16')],'where':{'sectionId':_0x5aae0b['id']},'raw':!![]})[_0xcf08('0xa')](function(_0x8c9d32){if(_0x8c9d32){var _0x2b0135={'where':{'id':_[_0xcf08('0x17')](_0x8c9d32,'resourceId')},'raw':!![]};switch(_0x1ab45d){case _0xcf08('0x6'):_0x2b0135['where']['role']=_0xcf08('0x18');break;case _0xcf08('0x19'):_0x2b0135['where'][_0xcf08('0x1a')]=_0xcf08('0x1b');break;}return db[_0x1ab45d][_0xcf08('0x13')](_0x2b0135);}else{return[];}});}}else{return[];}})[_0xcf08('0xa')](function(_0x2450c9){return _0x2450c9;});}function joinOrLeaveQueues(_0x3b9a4b,_0x5f03e1,_0x386fe3,_0x2f9899){_0x3b9a4b[_0x5f03e1](util[_0xcf08('0x1c')]('%s:queue:%s',_0x386fe3,_0x2f9899[_0xcf08('0x4')]));if(_0x2f9899['Agents']){for(var _0x633937=0x0;_0x633937<_0x2f9899[_0xcf08('0x5')]['length'];_0x633937+=0x1){_0x3b9a4b[_0x5f03e1](util[_0xcf08('0x1c')](_0xcf08('0x1d'),_0x2f9899[_0xcf08('0x5')][_0x633937][_0xcf08('0x4')]));}}}function joinOrLeave(_0x4dd1f0,_0x31aceb,_0x208f1d){var _0x52968a;if(_0x4dd1f0[_0xcf08('0x1e')]['query']['id']){db[_0xcf08('0x6')][_0xcf08('0x1f')]({'attributes':['id','name',_0xcf08('0x20'),_0xcf08('0x21')],'where':{'id':_0x4dd1f0[_0xcf08('0x1e')][_0xcf08('0x22')]['id']},'include':[{'model':db[_0xcf08('0x23')],'as':_0xcf08('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xcf08('0x25')],'as':_0xcf08('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xcf08('0x27')],'as':_0xcf08('0x28'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xcf08('0x29')],'as':_0xcf08('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xcf08('0x2b'),'attributes':['id'],'raw':!![]}]})[_0xcf08('0xa')](function(_0x347835){if(_0x347835){_0x52968a=_0x347835;_0x4dd1f0[_0x31aceb](util[_0xcf08('0x1c')](_0xcf08('0x1d'),_0x347835[_0xcf08('0x4')]));var _0x5753f7=[];switch(_0x347835[_0xcf08('0x20')]){case _0xcf08('0x2c'):_0x4dd1f0[_0x31aceb](_0xcf08('0x2d'));_0x4dd1f0[_0x31aceb](_0xcf08('0x2e'));if(queryQueues[_0xcf08('0x2f')](_0xcf08('0x30'))){delete queryQueues[_0xcf08('0x30')];}_0x5753f7[_0xcf08('0x31')](db['VoiceQueue'][_0xcf08('0x13')](queryQueues));_0x5753f7['push'](db['ChatQueue'][_0xcf08('0x13')](queryQueues));_0x5753f7['push'](db['FaxQueue']['findAll'](queryQueues));_0x5753f7[_0xcf08('0x31')](db[_0xcf08('0x32')][_0xcf08('0x13')](queryQueues));_0x5753f7['push'](db['MailQueue'][_0xcf08('0x13')](queryQueues));_0x5753f7[_0xcf08('0x31')](db[_0xcf08('0x33')][_0xcf08('0x13')](queryQueues));_0x5753f7[_0xcf08('0x31')](db[_0xcf08('0x34')][_0xcf08('0x13')](queryQueues));_0x5753f7['push'](db[_0xcf08('0x6')]['findAll'](queryTelephones));_0x5753f7[_0xcf08('0x31')](db[_0xcf08('0x35')]['findAll'](queryTrunks));_0x5753f7[_0xcf08('0x31')](db[_0xcf08('0x19')][_0xcf08('0x13')](queryCampaigns));_0x5753f7['push'](db['User'][_0xcf08('0x13')](queryAgents));break;case _0xcf08('0x36'):_0x4dd1f0[_0x31aceb](_0xcf08('0x2d'));_0x4dd1f0[_0x31aceb](_0xcf08('0x2e'));_0x5753f7[_0xcf08('0x31')](getAssociatedResources(_0xcf08('0xc'),_0x347835[_0xcf08('0x21')],_0xcf08('0x37')));_0x5753f7[_0xcf08('0x31')](getAssociatedResources(_0xcf08('0xd'),_0x347835['userProfileId'],'ChatQueue'));_0x5753f7[_0xcf08('0x31')](getAssociatedResources(_0xcf08('0xe'),_0x347835[_0xcf08('0x21')],_0xcf08('0x38')));_0x5753f7[_0xcf08('0x31')](getAssociatedResources(_0xcf08('0xf'),_0x347835[_0xcf08('0x21')],_0xcf08('0x32')));_0x5753f7['push'](getAssociatedResources(_0xcf08('0x10'),_0x347835[_0xcf08('0x21')],'MailQueue'));_0x5753f7[_0xcf08('0x31')](getAssociatedResources('OpenchannelQueues',_0x347835[_0xcf08('0x21')],_0xcf08('0x33')));_0x5753f7[_0xcf08('0x31')](getAssociatedResources(_0xcf08('0x12'),_0x347835[_0xcf08('0x21')],_0xcf08('0x34')));_0x5753f7[_0xcf08('0x31')](getAssociatedResources(_0xcf08('0x14'),_0x347835['userProfileId'],_0xcf08('0x6')));_0x5753f7[_0xcf08('0x31')](getAssociatedResources(_0xcf08('0x39'),_0x347835['userProfileId'],'Trunk'));_0x5753f7[_0xcf08('0x31')](getAssociatedResources(_0xcf08('0x3a'),_0x347835[_0xcf08('0x21')],_0xcf08('0x19')));_0x5753f7['push'](db[_0xcf08('0x6')]['findAll'](queryAgents));break;case _0xcf08('0x7'):_0x4dd1f0[_0x31aceb](_0xcf08('0x2d'));_0x4dd1f0[_0x31aceb](_0xcf08('0x2e'));_0x5753f7['push'](_0x347835[_0xcf08('0x3b')]({'attributes':['id',_0xcf08('0x4')]}));_0x5753f7[_0xcf08('0x31')](_0x347835[_0xcf08('0x3c')]({'attributes':['id',_0xcf08('0x4')]}));_0x5753f7[_0xcf08('0x31')](_0x347835[_0xcf08('0x3d')]({'attributes':['id',_0xcf08('0x4')]}));_0x5753f7[_0xcf08('0x31')](_0x347835['getSmsQueues']({'attributes':['id',_0xcf08('0x4')]}));_0x5753f7[_0xcf08('0x31')](_0x347835[_0xcf08('0x3e')]({'attributes':['id',_0xcf08('0x4')]}));_0x5753f7[_0xcf08('0x31')](_0x347835['getOpenchannelQueues']({'attributes':['id',_0xcf08('0x4')]}));_0x5753f7[_0xcf08('0x31')](_0x347835[_0xcf08('0x3f')]({'attributes':['id',_0xcf08('0x4')]}));break;}return BPromise[_0xcf08('0x40')](_0x5753f7);}})[_0xcf08('0xa')](function(_0x3ebdfd){if(_0x3ebdfd&&_0x3ebdfd[_0xcf08('0x41')]){for(var _0x1e8551=0x0;_0x1e8551<_0x3ebdfd[_0xcf08('0x41')];_0x1e8551+=0x1){for(var _0x1eb437=0x0;_0x1eb437<_0x3ebdfd[_0x1e8551][_0xcf08('0x41')];_0x1eb437+=0x1){switch(_0x1e8551){case 0x0:joinOrLeaveQueues(_0x4dd1f0,_0x31aceb,_0xcf08('0x42'),_0x3ebdfd[_0x1e8551][_0x1eb437]);break;case 0x1:joinOrLeaveQueues(_0x4dd1f0,_0x31aceb,_0xcf08('0x43'),_0x3ebdfd[_0x1e8551][_0x1eb437]);break;case 0x2:joinOrLeaveQueues(_0x4dd1f0,_0x31aceb,_0xcf08('0x44'),_0x3ebdfd[_0x1e8551][_0x1eb437]);break;case 0x3:joinOrLeaveQueues(_0x4dd1f0,_0x31aceb,_0xcf08('0x45'),_0x3ebdfd[_0x1e8551][_0x1eb437]);break;case 0x4:joinOrLeaveQueues(_0x4dd1f0,_0x31aceb,_0xcf08('0x46'),_0x3ebdfd[_0x1e8551][_0x1eb437]);break;case 0x5:joinOrLeaveQueues(_0x4dd1f0,_0x31aceb,_0xcf08('0x47'),_0x3ebdfd[_0x1e8551][_0x1eb437]);break;case 0x6:joinOrLeaveQueues(_0x4dd1f0,_0x31aceb,_0xcf08('0x48'),_0x3ebdfd[_0x1e8551][_0x1eb437]);break;case 0x7:if(_0x52968a['role']!=='agent')_0x4dd1f0[_0x31aceb](util[_0xcf08('0x1c')](_0xcf08('0x49'),_0x3ebdfd[_0x1e8551][_0x1eb437][_0xcf08('0x4')]));break;case 0x8:if(_0x52968a[_0xcf08('0x20')]!==_0xcf08('0x7'))_0x4dd1f0[_0x31aceb](util[_0xcf08('0x1c')]('trunk:%s',_0x3ebdfd[_0x1e8551][_0x1eb437][_0xcf08('0x4')]));break;case 0x9:if(_0x52968a[_0xcf08('0x20')]!==_0xcf08('0x7'))_0x4dd1f0[_0x31aceb](util[_0xcf08('0x1c')](_0xcf08('0x4a'),_0x3ebdfd[_0x1e8551][_0x1eb437][_0xcf08('0x1a')],_0x3ebdfd[_0x1e8551][_0x1eb437]['name']));break;case 0xa:_0x4dd1f0[_0x31aceb](util[_0xcf08('0x1c')](_0xcf08('0x1d'),_0x3ebdfd[_0x1e8551][_0x1eb437][_0xcf08('0x4')]));break;}}}}})['then'](function(){if(_0x31aceb===_0xcf08('0x4b')){var _0x2b7633=_[_0xcf08('0x17')](_0x52968a[_0xcf08('0x24')],'id');return _0x52968a[_0xcf08('0x4c')](_0x2b7633)[_0xcf08('0xa')](function(){for(var _0x524273=0x0;_0x524273<_0x2b7633[_0xcf08('0x41')];_0x524273+=0x1){_0x208f1d[_0xcf08('0x4d')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2b7633[_0x524273]),'UserId':Number(_0x52968a['id'])});}});}})[_0xcf08('0xa')](function(){if(_0x31aceb===_0xcf08('0x4b')){var _0x46d9af=_['map'](_0x52968a['MailInteractions'],'id');return _0x52968a[_0xcf08('0x4e')](_0x46d9af)[_0xcf08('0xa')](function(){for(var _0xc059dd=0x0;_0xc059dd<_0x46d9af[_0xcf08('0x41')];_0xc059dd+=0x1){_0x208f1d[_0xcf08('0x4d')](_0xcf08('0x4f'),{'MailInteractionId':Number(_0x46d9af[_0xc059dd]),'UserId':Number(_0x52968a['id'])});}});}})[_0xcf08('0xa')](function(){if(_0x31aceb===_0xcf08('0x4b')){var _0x387567=_[_0xcf08('0x17')](_0x52968a['FaxInteractions'],'id');return _0x52968a['removeFaxInteractions'](_0x387567)[_0xcf08('0xa')](function(){for(var _0x531673=0x0;_0x531673<_0x387567[_0xcf08('0x41')];_0x531673+=0x1){_0x208f1d[_0xcf08('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x387567[_0x531673]),'UserId':Number(_0x52968a['id'])});}});}})[_0xcf08('0xa')](function(){if(_0x31aceb===_0xcf08('0x4b')){var _0x59e80a=_[_0xcf08('0x17')](_0x52968a['SmsInteractions'],'id');return _0x52968a[_0xcf08('0x50')](_0x59e80a)['then'](function(){for(var _0x4c7bc6=0x0;_0x4c7bc6<_0x59e80a[_0xcf08('0x41')];_0x4c7bc6+=0x1){_0x208f1d['emit'](_0xcf08('0x51'),{'SmsInteractionId':Number(_0x59e80a[_0x4c7bc6]),'UserId':Number(_0x52968a['id'])});}});}})[_0xcf08('0xa')](function(){if(_0x31aceb===_0xcf08('0x4b')){var _0x36f27b=_['map'](_0x52968a[_0xcf08('0x2a')],'id');return _0x52968a['removeOpenchannelInteractions'](_0x36f27b)[_0xcf08('0xa')](function(){for(var _0x537bce=0x0;_0x537bce<_0x36f27b['length'];_0x537bce+=0x1){_0x208f1d['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x36f27b[_0x537bce]),'UserId':Number(_0x52968a['id'])});}});}})[_0xcf08('0xa')](function(){if(_0x31aceb==='leave'){var _0x41a665=_[_0xcf08('0x17')](_0x52968a[_0xcf08('0x2b')],'id');return _0x52968a[_0xcf08('0x52')](_0x41a665)[_0xcf08('0xa')](function(){for(var _0x2fa18f=0x0;_0x2fa18f<_0x41a665[_0xcf08('0x41')];_0x2fa18f+=0x1){_0x208f1d[_0xcf08('0x4d')](_0xcf08('0x53'),{'WhatsappInteractionId':Number(_0x41a665[_0x2fa18f]),'UserId':Number(_0x52968a['id'])});}});}})[_0xcf08('0x54')](function(_0x2cd636){_0x4dd1f0[_0xcf08('0x55')](_0x2cd636);});}}function onDisconnect(_0x1f3c7d,_0x3b86b0){joinOrLeave(_0x1f3c7d,'leave',_0x3b86b0);}function onConnect(_0x3b3e18){joinOrLeave(_0x3b3e18,_0xcf08('0x56'));}exports['default']=function(_0x640a7){_0x640a7['on'](_0xcf08('0x57'),function(_0x2fcf5c){_0x2fcf5c[_0xcf08('0x58')](0x0);_0x2fcf5c['address']=_0x2fcf5c[_0xcf08('0x59')][_0xcf08('0x57')][_0xcf08('0x5a')]+':'+_0x2fcf5c['request'][_0xcf08('0x57')][_0xcf08('0x5b')];_0x2fcf5c['connectedAt']=new Date();_0x2fcf5c[_0xcf08('0x55')]=function(_0x853439){console['log'](_0xcf08('0x5c')+_0x2fcf5c[_0xcf08('0x5d')][_0xcf08('0x4')]+'['+_0x2fcf5c[_0xcf08('0x5e')]+']',_0x853439);};_0x2fcf5c['on']('disconnect',function(){onDisconnect(_0x2fcf5c,_0x640a7);_0x2fcf5c['log'](_0xcf08('0x5f'));});onConnect(_0x2fcf5c);_0x2fcf5c['log']('CONNECTED');});};
\ No newline at end of file
index 627aa46..3dd5c9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d9d=['email','internal','interface','format','name','agent','incomingmessage','catch','outgoingmessage','closed','changed','substatus','SIP/%s','length','hasOwnProperty','model','hook','condition','util','jayson/promise','../logger','triggers','lodash','client','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','closedinteraction','FaxMessage','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s','get','channel','motionChannel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','contact','User','find','UserId','fullname'];(function(_0x3397f2,_0x1b23a4){var _0xa818b1=function(_0x73aac9){while(--_0x73aac9){_0x3397f2['push'](_0x3397f2['shift']());}};_0xa818b1(++_0x1b23a4);}(_0x5d9d,0x9e));var _0xd5d9=function(_0x36099e,_0x1678ad){_0x36099e=_0x36099e-0x0;var _0x34b51a=_0x5d9d[_0x36099e];return _0x34b51a;};'use strict';var util=require(_0xd5d9('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd5d9('0x1'));var logger=require(_0xd5d9('0x2'))(_0xd5d9('0x3'));var _=require(_0xd5d9('0x4'));var client=jayson[_0xd5d9('0x5')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xd5d9('0x6'),'event':_0xd5d9('0x7'),'condition':_0xd5d9('0x8'),'callback':afterCreate},{'channel':_0xd5d9('0x9'),'model':_0xd5d9('0x6'),'event':_0xd5d9('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd5d9('0x9'),'model':_0xd5d9('0xb'),'event':'afterCreate','condition':_0xd5d9('0xc'),'callback':afterCreateMessage},{'channel':_0xd5d9('0xd'),'model':_0xd5d9('0xe'),'event':_0xd5d9('0x7'),'condition':_0xd5d9('0x8'),'callback':afterCreate},{'channel':_0xd5d9('0xd'),'model':'SmsInteraction','event':_0xd5d9('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0xd5d9('0xf'),'event':_0xd5d9('0x7'),'condition':_0xd5d9('0xc'),'callback':afterCreateMessage},{'channel':_0xd5d9('0x10'),'model':_0xd5d9('0x11'),'event':_0xd5d9('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xd5d9('0x10'),'model':'WhatsappInteraction','event':_0xd5d9('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd5d9('0x10'),'model':_0xd5d9('0x12'),'event':'afterCreate','condition':_0xd5d9('0xc'),'callback':afterCreateMessage},{'channel':_0xd5d9('0x13'),'model':'FaxInteraction','event':'afterCreate','condition':_0xd5d9('0x8'),'callback':afterCreate},{'channel':_0xd5d9('0x13'),'model':_0xd5d9('0x14'),'event':_0xd5d9('0xa'),'condition':_0xd5d9('0x15'),'callback':afterUpdate},{'channel':_0xd5d9('0x13'),'model':_0xd5d9('0x16'),'event':'afterCreate','condition':_0xd5d9('0xc'),'callback':afterCreateMessage},{'channel':_0xd5d9('0x17'),'model':'MailInteraction','event':_0xd5d9('0x7'),'condition':_0xd5d9('0x8'),'callback':afterCreate},{'channel':_0xd5d9('0x17'),'model':'MailInteraction','event':_0xd5d9('0xa'),'condition':_0xd5d9('0x15'),'callback':afterUpdate},{'channel':_0xd5d9('0x17'),'model':_0xd5d9('0x18'),'event':_0xd5d9('0x7'),'condition':_0xd5d9('0xc'),'callback':afterCreateMessage},{'channel':_0xd5d9('0x19'),'model':_0xd5d9('0x1a'),'event':'afterCreate','condition':_0xd5d9('0x8'),'callback':afterCreate},{'channel':_0xd5d9('0x19'),'model':'OpenchannelInteraction','event':_0xd5d9('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd5d9('0x19'),'model':_0xd5d9('0x1b'),'event':_0xd5d9('0x7'),'condition':_0xd5d9('0xc'),'callback':afterCreateMessage}];function request(_0x5b4857){return client[_0xd5d9('0x1c')](_0xd5d9('0x1d'),_0x5b4857)[_0xd5d9('0x1e')](function(_0x112048){logger[_0xd5d9('0x1f')]('Trigger,\x20%s',_0xd5d9('0x1d'),_0x112048);if(_0x112048['error']){if(_0x112048[_0xd5d9('0x20')][_0xd5d9('0x21')]===0x1f4){logger[_0xd5d9('0x20')](_0xd5d9('0x22'),_0xd5d9('0x1d'),_0x112048[_0xd5d9('0x20')]);}}})['catch'](function(_0x45587a){logger[_0xd5d9('0x20')]('Trigger,\x20%s',_0xd5d9('0x1d'),_0x45587a);});}function afterCreateMessage(_0x349841,_0x2206f1){return function(_0x1feaee,_0x1e5fc0){_0x1feaee=_0x1feaee[_0xd5d9('0x23')]({'plain':!![]});_0x1feaee[_0xd5d9('0x24')]=_0x349841;_0x1feaee[_0xd5d9('0x25')]=_0x349841;_0x1feaee[_0xd5d9('0x26')]=_0x1feaee[_0xd5d9('0x27')];var _0x48ce77=_0xd5d9('0x28')+_0x1feaee[_0xd5d9('0x29')];return db[_0xd5d9('0x2a')][_0xd5d9('0x2b')](_0x48ce77,{'type':db[_0xd5d9('0x2c')][_0xd5d9('0x2d')][_0xd5d9('0x2e')],'raw':!![]})['then'](function(_0x21bf34){return _0x21bf34;})['then'](function(_0x4f5bc2){if(_0x4f5bc2){_0x1feaee[_0xd5d9('0x2f')]=_0x4f5bc2[0x0];}if(_0x1feaee['UserId']){return db[_0xd5d9('0x30')][_0xd5d9('0x31')]({'where':{'id':_0x1feaee[_0xd5d9('0x32')]},'attributes':['id','name',_0xd5d9('0x33'),_0xd5d9('0x34'),_0xd5d9('0x35')],'raw':!![]})[_0xd5d9('0x1e')](function(_0x420f5c){_0x1feaee[_0xd5d9('0x36')]=util[_0xd5d9('0x37')]('SIP/%s',_0x420f5c[_0xd5d9('0x38')]);_0x1feaee['channel']=_0x349841;_0x1feaee[_0xd5d9('0x39')]=_0x420f5c;return request({'event':_0xd5d9('0x3a'),'message':_0x1feaee});})[_0xd5d9('0x3b')](function(_0x4e1b2e){console[_0xd5d9('0x20')](_0x4e1b2e);});}else{return request({'event':_0xd5d9('0x3c'),'message':_0x1feaee});}});};}function afterCreate(_0x492f89,_0x3d5da7){return function(_0x40854c,_0x1ff474){_0x40854c=_0x40854c[_0xd5d9('0x23')]({'plain':!![]});_0x40854c['channel']=_0x492f89;_0x40854c['motionChannel']=_0x492f89;_0x40854c[_0xd5d9('0x26')]='opened';var _0x284128=_0xd5d9('0x28')+_0x40854c[_0xd5d9('0x29')];return db[_0xd5d9('0x2a')][_0xd5d9('0x2b')](_0x284128,{'type':db[_0xd5d9('0x2c')][_0xd5d9('0x2d')]['SELECT'],'raw':!![]})['then'](function(_0x371fa1){return _0x371fa1;})[_0xd5d9('0x1e')](function(_0x208cf6){if(_0x208cf6){_0x40854c[_0xd5d9('0x2f')]=_0x208cf6[0x0];}return request({'event':_0x3d5da7,'message':_0x40854c});});};}function afterUpdate(_0x1833a2){return function(_0x1d7154){var _0x144871=_0x1d7154['changed']('closed')&&_0x1d7154[_0xd5d9('0x3d')];var _0x1c8ae7=_0x1d7154[_0xd5d9('0x3e')]('substatus');if(_0x144871||_0x1c8ae7){var _0x51515b=_0x144871?_0xd5d9('0x15'):_0xd5d9('0x3f');var _0x2f1ffd=_0x1d7154[_0xd5d9('0x23')]({'plain':!![]});_0x2f1ffd['channel']=_0x1833a2;_0x2f1ffd[_0xd5d9('0x25')]=_0x1833a2;_0x2f1ffd[_0xd5d9('0x26')]=_0x144871?_0xd5d9('0x3d'):_0xd5d9('0x3f');var _0x5f00b9=_0xd5d9('0x28')+_0x2f1ffd[_0xd5d9('0x29')];return db['sequelize'][_0xd5d9('0x2b')](_0x5f00b9,{'type':db[_0xd5d9('0x2c')][_0xd5d9('0x2d')]['SELECT'],'raw':!![]})[_0xd5d9('0x1e')](function(_0x12243d){if(_0x12243d){_0x2f1ffd[_0xd5d9('0x2f')]=_0x12243d[0x0];}if(_0x2f1ffd[_0xd5d9('0x32')]){return db['User'][_0xd5d9('0x31')]({'where':{'id':_0x2f1ffd['UserId']},'attributes':['id',_0xd5d9('0x38'),_0xd5d9('0x33'),_0xd5d9('0x34'),_0xd5d9('0x35')],'raw':!![]})[_0xd5d9('0x1e')](function(_0x1c3818){_0x2f1ffd['interface']=util[_0xd5d9('0x37')](_0xd5d9('0x40'),_0x1c3818['name']);_0x2f1ffd[_0xd5d9('0x39')]=_0x1c3818;return request({'event':_0x51515b,'message':_0x2f1ffd});})[_0xd5d9('0x3b')](function(_0x384b6a){console['error'](_0x384b6a);});}else{return request({'event':_0x51515b,'message':_0x2f1ffd});}});}};}exports['default']=function(){for(var _0x16acc0=0x0;_0x16acc0<triggers[_0xd5d9('0x41')];_0x16acc0+=0x1){if(db[_0xd5d9('0x42')](triggers[_0x16acc0][_0xd5d9('0x43')])){db[triggers[_0x16acc0][_0xd5d9('0x43')]][_0xd5d9('0x44')](triggers[_0x16acc0][_0xd5d9('0x26')],triggers[_0x16acc0]['callback'](triggers[_0x16acc0][_0xd5d9('0x24')]['toLowerCase'](),triggers[_0x16acc0][_0xd5d9('0x45')]));}}};
\ No newline at end of file
+var _0x46a2=['contact','UserId','User','find','name','fullname','internal','interface','format','SIP/%s','incomingmessage','outgoingmessage','get','sequelize','changed','closed','substatus','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','agent','default','length','model','hook','callback','condition','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','catch','channel','motionChannel','direction','ContactId','Sequelize','QueryTypes','SELECT'];(function(_0x59ba34,_0x353bde){var _0x4c88a8=function(_0x18cef0){while(--_0x18cef0){_0x59ba34['push'](_0x59ba34['shift']());}};_0x4c88a8(++_0x353bde);}(_0x46a2,0x19b));var _0x246a=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x46a2[_0x313df3];return _0x241d59;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require(_0x246a('0x0'))(_0x246a('0x1'));var _=require('lodash');var client=jayson[_0x246a('0x2')][_0x246a('0x3')]({'port':0x232a});var triggers=[{'channel':_0x246a('0x4'),'model':_0x246a('0x5'),'event':_0x246a('0x6'),'condition':_0x246a('0x7'),'callback':afterCreate},{'channel':_0x246a('0x4'),'model':_0x246a('0x5'),'event':_0x246a('0x8'),'condition':_0x246a('0x9'),'callback':afterUpdate},{'channel':_0x246a('0x4'),'model':_0x246a('0xa'),'event':_0x246a('0x6'),'condition':_0x246a('0xb'),'callback':afterCreateMessage},{'channel':'Sms','model':'SmsInteraction','event':'afterCreate','condition':_0x246a('0x7'),'callback':afterCreate},{'channel':_0x246a('0xc'),'model':_0x246a('0xd'),'event':'afterUpdate','condition':_0x246a('0x9'),'callback':afterUpdate},{'channel':_0x246a('0xc'),'model':_0x246a('0xe'),'event':_0x246a('0x6'),'condition':_0x246a('0xb'),'callback':afterCreateMessage},{'channel':_0x246a('0xf'),'model':'WhatsappInteraction','event':'afterCreate','condition':_0x246a('0x7'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x246a('0xf'),'model':'WhatsappMessage','event':_0x246a('0x6'),'condition':_0x246a('0xb'),'callback':afterCreateMessage},{'channel':_0x246a('0x10'),'model':_0x246a('0x11'),'event':_0x246a('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x246a('0x10'),'model':_0x246a('0x11'),'event':'afterUpdate','condition':_0x246a('0x9'),'callback':afterUpdate},{'channel':_0x246a('0x10'),'model':'FaxMessage','event':'afterCreate','condition':_0x246a('0xb'),'callback':afterCreateMessage},{'channel':_0x246a('0x12'),'model':_0x246a('0x13'),'event':_0x246a('0x6'),'condition':_0x246a('0x7'),'callback':afterCreate},{'channel':_0x246a('0x12'),'model':_0x246a('0x13'),'event':_0x246a('0x8'),'condition':_0x246a('0x9'),'callback':afterUpdate},{'channel':_0x246a('0x12'),'model':_0x246a('0x14'),'event':_0x246a('0x6'),'condition':_0x246a('0xb'),'callback':afterCreateMessage},{'channel':_0x246a('0x15'),'model':_0x246a('0x16'),'event':'afterCreate','condition':_0x246a('0x7'),'callback':afterCreate},{'channel':'Openchannel','model':_0x246a('0x16'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0x246a('0x17'),'event':_0x246a('0x6'),'condition':_0x246a('0xb'),'callback':afterCreateMessage}];function request(_0xc0e152){return client['request'](_0x246a('0x18'),_0xc0e152)[_0x246a('0x19')](function(_0x3e551a){logger[_0x246a('0x1a')](_0x246a('0x1b'),_0x246a('0x18'),_0x3e551a);if(_0x3e551a['error']){if(_0x3e551a[_0x246a('0x1c')]['code']===0x1f4){logger[_0x246a('0x1c')](_0x246a('0x1b'),_0x246a('0x18'),_0x3e551a[_0x246a('0x1c')]);}}})[_0x246a('0x1d')](function(_0x4aec5f){logger[_0x246a('0x1c')](_0x246a('0x1b'),_0x246a('0x18'),_0x4aec5f);});}function afterCreateMessage(_0x213a8d,_0x1c1983){return function(_0x4dfc66,_0x43f724){_0x4dfc66=_0x4dfc66['get']({'plain':!![]});_0x4dfc66[_0x246a('0x1e')]=_0x213a8d;_0x4dfc66[_0x246a('0x1f')]=_0x213a8d;_0x4dfc66['event']=_0x4dfc66[_0x246a('0x20')];var _0x278a13='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4dfc66[_0x246a('0x21')];return db['sequelize']['query'](_0x278a13,{'type':db[_0x246a('0x22')][_0x246a('0x23')][_0x246a('0x24')],'raw':!![]})[_0x246a('0x19')](function(_0x2d5f73){return _0x2d5f73;})[_0x246a('0x19')](function(_0x52beda){if(_0x52beda){_0x4dfc66[_0x246a('0x25')]=_0x52beda[0x0];}if(_0x4dfc66[_0x246a('0x26')]){return db[_0x246a('0x27')][_0x246a('0x28')]({'where':{'id':_0x4dfc66[_0x246a('0x26')]},'attributes':['id',_0x246a('0x29'),_0x246a('0x2a'),'email',_0x246a('0x2b')],'raw':!![]})['then'](function(_0x2770fb){_0x4dfc66[_0x246a('0x2c')]=util[_0x246a('0x2d')](_0x246a('0x2e'),_0x2770fb['name']);_0x4dfc66[_0x246a('0x1e')]=_0x213a8d;_0x4dfc66['agent']=_0x2770fb;return request({'event':_0x246a('0x2f'),'message':_0x4dfc66});})['catch'](function(_0x1e3602){console[_0x246a('0x1c')](_0x1e3602);});}else{return request({'event':_0x246a('0x30'),'message':_0x4dfc66});}});};}function afterCreate(_0xc15f51,_0x183272){return function(_0x1b2339,_0x52e748){_0x1b2339=_0x1b2339[_0x246a('0x31')]({'plain':!![]});_0x1b2339[_0x246a('0x1e')]=_0xc15f51;_0x1b2339['motionChannel']=_0xc15f51;_0x1b2339['event']='opened';var _0x426a04='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1b2339['ContactId'];return db[_0x246a('0x32')]['query'](_0x426a04,{'type':db[_0x246a('0x22')]['QueryTypes'][_0x246a('0x24')],'raw':!![]})[_0x246a('0x19')](function(_0x40a93d){return _0x40a93d;})[_0x246a('0x19')](function(_0x1b0ab1){if(_0x1b0ab1){_0x1b2339[_0x246a('0x25')]=_0x1b0ab1[0x0];}return request({'event':_0x183272,'message':_0x1b2339});});};}function afterUpdate(_0x4b4e9e){return function(_0x1ca48b){var _0x7446e6=_0x1ca48b[_0x246a('0x33')]('closed')&&_0x1ca48b[_0x246a('0x34')];var _0x5720cc=_0x1ca48b[_0x246a('0x33')](_0x246a('0x35'));if(_0x7446e6||_0x5720cc){var _0xc48fe3=_0x7446e6?_0x246a('0x9'):_0x246a('0x35');var _0x37bd14=_0x1ca48b[_0x246a('0x31')]({'plain':!![]});_0x37bd14[_0x246a('0x1e')]=_0x4b4e9e;_0x37bd14[_0x246a('0x1f')]=_0x4b4e9e;_0x37bd14[_0x246a('0x36')]=_0x7446e6?'closed':_0x246a('0x35');var _0x44cc7f=_0x246a('0x37')+_0x37bd14['ContactId'];return db[_0x246a('0x32')]['query'](_0x44cc7f,{'type':db[_0x246a('0x22')][_0x246a('0x23')][_0x246a('0x24')],'raw':!![]})[_0x246a('0x19')](function(_0x3673d7){if(_0x3673d7){_0x37bd14['contact']=_0x3673d7[0x0];}if(_0x37bd14['UserId']){return db['User'][_0x246a('0x28')]({'where':{'id':_0x37bd14[_0x246a('0x26')]},'attributes':['id',_0x246a('0x29'),_0x246a('0x2a'),_0x246a('0x38'),_0x246a('0x2b')],'raw':!![]})[_0x246a('0x19')](function(_0x24c70a){_0x37bd14[_0x246a('0x2c')]=util[_0x246a('0x2d')]('SIP/%s',_0x24c70a[_0x246a('0x29')]);_0x37bd14[_0x246a('0x39')]=_0x24c70a;return request({'event':_0xc48fe3,'message':_0x37bd14});})[_0x246a('0x1d')](function(_0x179912){console[_0x246a('0x1c')](_0x179912);});}else{return request({'event':_0xc48fe3,'message':_0x37bd14});}});}};}exports[_0x246a('0x3a')]=function(){for(var _0x198189=0x0;_0x198189<triggers[_0x246a('0x3b')];_0x198189+=0x1){if(db['hasOwnProperty'](triggers[_0x198189]['model'])){db[triggers[_0x198189][_0x246a('0x3c')]][_0x246a('0x3d')](triggers[_0x198189][_0x246a('0x36')],triggers[_0x198189][_0x246a('0x3e')](triggers[_0x198189][_0x246a('0x1e')]['toLowerCase'](),triggers[_0x198189][_0x246a('0x3f')]));}}};
\ No newline at end of file
index 2dafdb4..e1b90fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14c9=['includes','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','count','then','agents','catch','../mysqldb','voice','mail','chat','sms','whatsapp','isValidChannel'];(function(_0x28dda5,_0x115002){var _0x935c9c=function(_0x50d76c){while(--_0x50d76c){_0x28dda5['push'](_0x28dda5['shift']());}};_0x935c9c(++_0x115002);}(_0x14c9,0x119));var _0x914c=function(_0x10ad74,_0x2ec44d){_0x10ad74=_0x10ad74-0x0;var _0x126944=_0x14c9[_0x10ad74];return _0x126944;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0x914c('0x0'))['db'];var util=require('./license/util');var channels=[_0x914c('0x1'),_0x914c('0x2'),_0x914c('0x3'),'fax',_0x914c('0x4'),_0x914c('0x5'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0x914c('0x6')]=function(_0x1b11c9){_0x1b11c9=_0x1b11c9['toLowerCase']();return _[_0x914c('0x7')](channels,_0x1b11c9);};exports['clearBlockUser']=function(_0x1fa26f,_0xd5440c,_0x4d331c,_0x360a2e){var _0x267ace={'loginAttempts':_0xd5440c,'blocked':_0x4d331c};if(!_[_0x914c('0x8')](_0x360a2e)){_0x267ace[_0x914c('0x9')]=_0x360a2e;}return _0x1fa26f[_0x914c('0xa')](_0x267ace);};exports[_0x914c('0xb')]=function(_0x482329){return new BPromise(function(_0x5d43c6,_0x1e4859){var _0x4869f7=0x0;if(_0x482329[_0x914c('0xc')]!==_0x914c('0xd')){_0x5d43c6(_0x482329);}db['User'][_0x914c('0xe')]({'where':{'role':_0x914c('0xd'),'online':!![],'id':{'$ne':_0x482329['id']}}})['then'](function(_0x22b621){_0x4869f7=_0x22b621;return util['getLicense']();})[_0x914c('0xf')](function(_0x7c8128){if(_0x7c8128&&_0x7c8128[_0x914c('0x10')]&&_0x4869f7>=_0x7c8128[_0x914c('0x10')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x5d43c6(_0x482329);})[_0x914c('0x11')](function(_0x1d8fd2){_0x1e4859(_0x1d8fd2);});});};
\ No newline at end of file
+var _0x1658=['openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','updateAttributes','role','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','./license/util','voice','fax','sms','whatsapp'];(function(_0x4064ca,_0x431f94){var _0x150a3c=function(_0xe90d83){while(--_0xe90d83){_0x4064ca['push'](_0x4064ca['shift']());}};_0x150a3c(++_0x431f94);}(_0x1658,0xe9));var _0x8165=function(_0x551967,_0x17e70b){_0x551967=_0x551967-0x0;var _0x1fdd1f=_0x1658[_0x551967];return _0x1fdd1f;};'use strict';var _=require(_0x8165('0x0'));var BPromise=require(_0x8165('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x8165('0x2'));var channels=[_0x8165('0x3'),'mail','chat',_0x8165('0x4'),_0x8165('0x5'),_0x8165('0x6'),_0x8165('0x7')];exports[_0x8165('0x8')]=function(){return channels;};exports[_0x8165('0x9')]=function(_0x443965){_0x443965=_0x443965[_0x8165('0xa')]();return _[_0x8165('0xb')](channels,_0x443965);};exports[_0x8165('0xc')]=function(_0x23d7ef,_0x40c645,_0x1b220a,_0xb75ce5){var _0x3cc825={'loginAttempts':_0x40c645,'blocked':_0x1b220a};if(!_[_0x8165('0xd')](_0xb75ce5)){_0x3cc825['blockedAt']=_0xb75ce5;}return _0x23d7ef[_0x8165('0xe')](_0x3cc825);};exports['getLicense']=function(_0x38ec10){return new BPromise(function(_0x3e2fc3,_0x3b2c61){var _0x584060=0x0;if(_0x38ec10[_0x8165('0xf')]!==_0x8165('0x10')){_0x3e2fc3(_0x38ec10);}db[_0x8165('0x11')][_0x8165('0x12')]({'where':{'role':_0x8165('0x10'),'online':!![],'id':{'$ne':_0x38ec10['id']}}})[_0x8165('0x13')](function(_0x5e8370){_0x584060=_0x5e8370;return util[_0x8165('0x14')]();})[_0x8165('0x13')](function(_0x138cac){if(_0x138cac&&_0x138cac['agents']&&_0x584060>=_0x138cac[_0x8165('0x15')]){throw Error(_0x8165('0x16'));}_0x3e2fc3(_0x38ec10);})[_0x8165('0x17')](function(_0x465fce){_0x3b2c61(_0x465fce);});});};
\ No newline at end of file
index eb7fa79..0b48667 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x100a=['json','exports','404','status','render'];(function(_0x19c606,_0x5694c7){var _0x1e7173=function(_0x403d66){while(--_0x403d66){_0x19c606['push'](_0x19c606['shift']());}};_0x1e7173(++_0x5694c7);}(_0x100a,0x97));var _0xa100=function(_0x46813e,_0x2c74f6){_0x46813e=_0x46813e-0x0;var _0x437e08=_0x100a[_0x46813e];return _0x437e08;};'use strict';module[_0xa100('0x0')][0x194]=function pageNotFound(_0x584b89,_0x2c88ed){var _0x136199=_0xa100('0x1');var _0x709ac7=0x194;var _0x43e7fa={'status':_0x709ac7};_0x2c88ed[_0xa100('0x2')](_0x43e7fa[_0xa100('0x2')]);_0x2c88ed[_0xa100('0x3')](_0x136199,{},function(_0x46203a,_0x54a5bb){if(_0x46203a){return _0x2c88ed[_0xa100('0x2')](_0x43e7fa['status'])[_0xa100('0x4')](_0x43e7fa);}_0x2c88ed['send'](_0x54a5bb);});};
\ No newline at end of file
+var _0x885b=['render','exports','status'];(function(_0x3fad02,_0x6bc90a){var _0x2790ec=function(_0x5ca70c){while(--_0x5ca70c){_0x3fad02['push'](_0x3fad02['shift']());}};_0x2790ec(++_0x6bc90a);}(_0x885b,0x73));var _0xb885=function(_0x45462b,_0x36d82d){_0x45462b=_0x45462b-0x0;var _0x404aef=_0x885b[_0x45462b];return _0x404aef;};'use strict';module[_0xb885('0x0')][0x194]=function pageNotFound(_0x1d2938,_0x211f44){var _0x1a44fa='404';var _0x4376ea=0x194;var _0x52e908={'status':_0x4376ea};_0x211f44['status'](_0x52e908[_0xb885('0x1')]);_0x211f44[_0xb885('0x2')](_0x1a44fa,{},function(_0x5eb2ba,_0x533d0b){if(_0x5eb2ba){return _0x211f44[_0xb885('0x1')](_0x52e908[_0xb885('0x1')])['json'](_0x52e908);}_0x211f44['send'](_0x533d0b);});};
\ No newline at end of file
index 6899009..7cac1e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['OpenchannelQueues','UserOpenchannelQueue','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sounds','Members','CmHopper','Hoppers','VoiceQueueId','HopperHistories','TrunkId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','Contact','MailServerIn','MailAccountId','Imap','Smtp','Dispositions','MailApplication','List','Template','TemplateId','MailInteractionId','Account','ContactId','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Items','FaxAccountId','Interactions','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','Attachment','AttachmentId','team_has_fax_queues','SmsAccountId','Owner','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','Answers','ProactiveActions','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','CmCompany','CompanyId','JscriptySessions','Company','cm_contact_has_tags','Campaign','OwnerId','CmHopperBlack','CampaignId','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','Extensions','FaxApplications','SmsApplications','AnalyticCustomReport','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','DefaultReportId','MetricId','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','SugarcrmConfiguration','Configurations','DeskField','int_desk_configuration_has_tags','ZendeskAccount','int_zendesk_configuration_has_tags','Description','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','FreshsalesField','FromId','SessionId','JscriptyAnswerReport','ProjectId','TeamVoiceQueue','team_has_mail_queues','team_has_chat_queues','FaxQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TeamVoicePrefix','HopperBlacks','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','Queues','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','jstz','determine','xcall','127.0.0.1','mysql','name','utf8','sequelizeHistory','defaultsDeep','motion2','xC@LL1234','utf8mb4','utf8_general_ci','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','../api/voiceContext/voiceContext.model','VoiceExtension','import','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../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','VtigerField','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyQuestionReport','JscriptySessionReport','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../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/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','UserChatQueue','FaxQueue','SmsQueues'];(function(_0x3773a6,_0x355b95){var _0xfd2398=function(_0x824bcd){while(--_0x824bcd){_0x3773a6['push'](_0x3773a6['shift']());}};_0xfd2398(++_0x355b95);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var config=require(_0xc6e6('0x0'));var Sequelize=require(_0xc6e6('0x1'));var _=require('lodash');var jstz=require(_0xc6e6('0x2'));var timezone=jstz[_0xc6e6('0x3')]();config['sequelize']=_['defaultsDeep'](config[_0xc6e6('0x1')],{'database':'motion2','username':_0xc6e6('0x4'),'password':'xC@LL1234','options':{'host':_0xc6e6('0x5'),'port':0xcea,'dialect':_0xc6e6('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xc6e6('0x7')](),'define':{'charset':_0xc6e6('0x8'),'collate':'utf8_general_ci'}}});config[_0xc6e6('0x9')]=_[_0xc6e6('0xa')](config['sequelizeHistory'],{'database':_0xc6e6('0xb'),'username':'xcall','password':_0xc6e6('0xc'),'options':{'host':_0xc6e6('0x5'),'port':0xcea,'dialect':_0xc6e6('0x6'),'dialectOptions':{'charset':_0xc6e6('0xd')},'logging':![],'timezone':timezone[_0xc6e6('0x7')](),'define':{'charset':_0xc6e6('0x8'),'collate':_0xc6e6('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc6e6('0x1')][_0xc6e6('0xf')],config['sequelize'][_0xc6e6('0x10')],config['sequelize'][_0xc6e6('0x11')],config[_0xc6e6('0x1')][_0xc6e6('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc6e6('0x9')]['database'],config[_0xc6e6('0x9')][_0xc6e6('0x10')],config[_0xc6e6('0x9')][_0xc6e6('0x11')],config[_0xc6e6('0x9')]['options'])};db[_0xc6e6('0x13')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x14'));db[_0xc6e6('0x15')]=db[_0xc6e6('0x1')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x16'));db[_0xc6e6('0x17')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x19'));db[_0xc6e6('0x1a')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x1b'));db[_0xc6e6('0x1c')]=db['sequelize'][_0xc6e6('0x18')]('../api/voiceQueue/voiceQueue.model');db[_0xc6e6('0x1d')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x1e'));db['ScreenRecording']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x1f'));db[_0xc6e6('0x20')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x21'));db['VoiceMailMessage']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x22'));db[_0xc6e6('0x23')]=db['sequelize'][_0xc6e6('0x18')]('../api/voiceCallReport/voiceCallReport.model');db[_0xc6e6('0x24')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x25'));db[_0xc6e6('0x26')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xc6e6('0x27')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x28'));db['MemberReport']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x29'));db[_0xc6e6('0x2a')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x2b'));db[_0xc6e6('0x2c')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x2d'));db[_0xc6e6('0x2e')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x2f'));db[_0xc6e6('0x30')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x31'));db['UserChatQueue']=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x32'));db[_0xc6e6('0x33')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/userFaxQueue/userFaxQueue.model');db[_0xc6e6('0x34')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/userSmsQueue/userSmsQueue.model');db['UserOpenchannelQueue']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x35'));db[_0xc6e6('0x36')]=db['sequelize']['import'](_0xc6e6('0x37'));db['MailServerIn']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x38'));db[_0xc6e6('0x39')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x3a'));db[_0xc6e6('0x3b')]=db['sequelize']['import'](_0xc6e6('0x3c'));db[_0xc6e6('0x3d')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/mailSubstatus/mailSubstatus.model');db[_0xc6e6('0x3e')]=db[_0xc6e6('0x1')]['import']('../api/mailInteraction/mailInteraction.model');db[_0xc6e6('0x3f')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x40'));db['MailApplication']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x41'));db['MailQueueReport']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x42'));db[_0xc6e6('0x43')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x44'));db[_0xc6e6('0x45')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x46'));db[_0xc6e6('0x47')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/faxAccount/faxAccount.model');db[_0xc6e6('0x48')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x49'));db['FaxInteraction']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x4a'));db[_0xc6e6('0x4b')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x4c'));db['FaxQueue']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x4d'));db[_0xc6e6('0x4e')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x4f'));db[_0xc6e6('0x50')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/smsAccount/smsAccount.model');db[_0xc6e6('0x51')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/smsApplication/smsApplication.model');db[_0xc6e6('0x52')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x53'));db[_0xc6e6('0x54')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x55'));db[_0xc6e6('0x56')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x57'));db[_0xc6e6('0x58')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x59'));db['OpenchannelApplication']=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize']['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0xc6e6('0x5a')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x5b'));db[_0xc6e6('0x5c')]=db['sequelize']['import'](_0xc6e6('0x5d'));db[_0xc6e6('0x5e')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/chatWebsite/chatWebsite.model');db[_0xc6e6('0x5f')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x60'));db[_0xc6e6('0x61')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x62'));db[_0xc6e6('0x63')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x64'));db[_0xc6e6('0x65')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/chatMessage/chatMessage.model');db[_0xc6e6('0x66')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x67'));db[_0xc6e6('0x68')]=db['sequelize']['import']('../api/chatQueue/chatQueue.model');db[_0xc6e6('0x69')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x6a'));db[_0xc6e6('0x6b')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x6c'));db['CmCompany']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x6d'));db['CmContact']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x6e'));db['CmHopper']=db['sequelize'][_0xc6e6('0x18')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x6f'));db[_0xc6e6('0x70')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x71'));db[_0xc6e6('0x72')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x73'));db[_0xc6e6('0x74')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x75'));db[_0xc6e6('0x76')]=db[_0xc6e6('0x1')]['import']('../api/cmCustomField/cmCustomField.model');db[_0xc6e6('0x77')]=db['sequelize']['import'](_0xc6e6('0x78'));db[_0xc6e6('0x79')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x7a'));db[_0xc6e6('0x7b')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x7c'));db[_0xc6e6('0x7d')]=db[_0xc6e6('0x1')]['import']('../api/disposition/disposition.model');db[_0xc6e6('0x7e')]=db['sequelize']['import'](_0xc6e6('0x7f'));db[_0xc6e6('0x80')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x81'));db[_0xc6e6('0x82')]=db['sequelize']['import'](_0xc6e6('0x83'));db[_0xc6e6('0x84')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x85'));db[_0xc6e6('0x86')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x87'));db[_0xc6e6('0x88')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/schedule/schedule.model');db[_0xc6e6('0x89')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x8a'));db[_0xc6e6('0x8b')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x8c'));db['Template']=db[_0xc6e6('0x1')]['import']('../api/template/template.model');db[_0xc6e6('0x8d')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x8e'));db[_0xc6e6('0x8f')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/variable/variable.model');db[_0xc6e6('0x90')]=db['sequelize']['import'](_0xc6e6('0x91'));db[_0xc6e6('0x92')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x93'));db['AnalyticCustomReport']=db['sequelize'][_0xc6e6('0x18')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xc6e6('0x94')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x95'));db['AnalyticExtractedReport']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x96'));db[_0xc6e6('0x97')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0x98'));db[_0xc6e6('0x99')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x9a'));db[_0xc6e6('0x9b')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x9c'));db[_0xc6e6('0x9d')]=db[_0xc6e6('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xc6e6('0x9e')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0x9f'));db[_0xc6e6('0xa0')]=db['sequelize']['import'](_0xc6e6('0xa1'));db['SugarcrmConfiguration']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xa2'));db[_0xc6e6('0xa3')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xa4'));db[_0xc6e6('0xa5')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xa6'));db[_0xc6e6('0xa7')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xa8'));db['DeskField']=db['sequelize']['import'](_0xc6e6('0xa9'));db[_0xc6e6('0xaa')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xab'));db[_0xc6e6('0xac')]=db['sequelize'][_0xc6e6('0x18')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xc6e6('0xad')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xae'));db[_0xc6e6('0xaf')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xb0'));db[_0xc6e6('0xb1')]=db['sequelize']['import'](_0xc6e6('0xb2'));db[_0xc6e6('0xb3')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xb4'));db['FreshdeskConfiguration']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xb5'));db['FreshdeskField']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xb6'));db[_0xc6e6('0xb7')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xb8'));db[_0xc6e6('0xb9')]=db[_0xc6e6('0x1')]['import']('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xc6e6('0xba')]=db[_0xc6e6('0x1')]['import']('../api/intVtigerField/intVtigerField.model');db[_0xc6e6('0xbb')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xc6e6('0xbc')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xbd'));db[_0xc6e6('0xbe')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xbf'));db[_0xc6e6('0xc0')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xc6e6('0xc1')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xc6e6('0xc2')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xc3'));db[_0xc6e6('0xc4')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xc5'));db[_0xc6e6('0xc6')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xc7'));db['FreshsalesField']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xc8'));db[_0xc6e6('0x90')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0x91'));db[_0xc6e6('0xc9')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/network/network.model');db[_0xc6e6('0xca')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xcb'));db[_0xc6e6('0xcc')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xc6e6('0xcd')]=db[_0xc6e6('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xc6e6('0xce')]=db[_0xc6e6('0x1')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xc6e6('0xcf')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/smsQueueReport/smsQueueReport.model');db[_0xc6e6('0xd0')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xd1'));db[_0xc6e6('0xd2')]=db[_0xc6e6('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0xc6e6('0xd3')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xd4'));db[_0xc6e6('0xd5')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xd6'));db[_0xc6e6('0xd7')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xd8'));db['SquareRecording']=db['sequelize']['import'](_0xc6e6('0xd9'));db['SquareMessage']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xda'));db['Team']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xdb'));db[_0xc6e6('0xdc')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xdd'));db['Campaign']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xde'));db[_0xc6e6('0xdf')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/migration/migration.model');db['Attachment']=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/attachment/attachment.model');db['Plugin']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xe0'));db[_0xc6e6('0xe1')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xe2'));db['ChatTransferReport']=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xe3'));db[_0xc6e6('0xe4')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xe5'));db[_0xc6e6('0xe6')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xe7'));db[_0xc6e6('0xe8')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xe9'));db[_0xc6e6('0xea')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xeb'));db[_0xc6e6('0xec')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xed'));db[_0xc6e6('0xee')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xef'));db[_0xc6e6('0xf0')]=db[_0xc6e6('0x1')]['import'](_0xc6e6('0xf1'));db[_0xc6e6('0xf2')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xf3'));db[_0xc6e6('0xf4')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/userNotification/userNotification.model');db[_0xc6e6('0xf5')]=db[_0xc6e6('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0xc6e6('0xf6')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')]('../api/whatsappApplication/whatsappApplication.model');db[_0xc6e6('0xf7')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xf8'));db[_0xc6e6('0xf9')]=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xfa'));db['WhatsappQueueReport']=db[_0xc6e6('0x1')][_0xc6e6('0x18')](_0xc6e6('0xfb'));db[_0xc6e6('0xfc')]=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xfd'));db['WhatsappQueue']=db['sequelize'][_0xc6e6('0x18')]('../api/whatsappQueue/whatsappQueue.model');db[_0xc6e6('0xfe')]=db['sequelize'][_0xc6e6('0x18')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db['sequelize'][_0xc6e6('0x18')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db['sequelize'][_0xc6e6('0x18')](_0xc6e6('0xff'));db[_0xc6e6('0x100')]=db['sequelize']['import'](_0xc6e6('0x101'));db[_0xc6e6('0x13')][_0xc6e6('0x102')](db[_0xc6e6('0x20')],{'as':_0xc6e6('0x20'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db['VoiceRecording'],{'as':_0xc6e6('0x106'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db[_0xc6e6('0x2e')],{'as':_0xc6e6('0x107'),'foreignKey':'UserId'});db['User'][_0xc6e6('0x105')](db[_0xc6e6('0x17')],{'as':'Extensions','onDelete':_0xc6e6('0x103'),'hooks':!![]});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db['CmHopperFinal'],{'as':_0xc6e6('0x108'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db[_0xc6e6('0x72')],{'as':_0xc6e6('0x109'),'foreignKey':'UserId'});db['User']['hasMany'](db['ReportAgentPreview'],{'as':_0xc6e6('0x74'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db[_0xc6e6('0x10a')],{'as':_0xc6e6('0x10b'),'foreignKey':_0xc6e6('0x104')});db['User'][_0xc6e6('0x105')](db[_0xc6e6('0x63')],{'as':_0xc6e6('0x10c'),'foreignKey':'UserId'});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db[_0xc6e6('0x52')],{'as':_0xc6e6('0x10d'),'foreignKey':'UserId'});db[_0xc6e6('0x13')]['hasMany'](db[_0xc6e6('0x10e')],{'as':_0xc6e6('0x10f'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')][_0xc6e6('0x105')](db['MailInteraction'],{'as':_0xc6e6('0x110'),'foreignKey':_0xc6e6('0x104')});db['User'][_0xc6e6('0x105')](db[_0xc6e6('0xf7')],{'as':'WhatsappInteractions','foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x13')]['hasMany'](db[_0xc6e6('0xf4')],{'as':_0xc6e6('0x111'),'foreignKey':_0xc6e6('0x112')});db[_0xc6e6('0x13')][_0xc6e6('0x113')](db[_0xc6e6('0xee')],{'as':_0xc6e6('0xee'),'foreignKey':_0xc6e6('0x114')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x69')],{'as':_0xc6e6('0x116'),'through':_0xc6e6('0x117')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x119'),'through':_0xc6e6('0x11a')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x11b'),'through':_0xc6e6('0x11c')});db['User'][_0xc6e6('0x115')](db[_0xc6e6('0x11d')],{'through':_0xc6e6('0x11e')});db[_0xc6e6('0x13')]['belongsToMany'](db['MailInteraction'],{'as':_0xc6e6('0x110'),'through':_0xc6e6('0x11f')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x63')],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x10e')],{'as':_0xc6e6('0x10f'),'through':_0xc6e6('0x120')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db['SmsInteraction'],{'as':_0xc6e6('0x10d'),'through':_0xc6e6('0x121')});db[_0xc6e6('0x13')]['belongsToMany'](db[_0xc6e6('0x10a')],{'as':_0xc6e6('0x10b'),'through':_0xc6e6('0x122')});db[_0xc6e6('0x13')]['belongsToMany'](db[_0xc6e6('0xf7')],{'as':'WhatsappInteractions','through':_0xc6e6('0x123')});db[_0xc6e6('0x13')]['belongsToMany'](db['VoiceQueue'],{'as':_0xc6e6('0x124'),'through':'UserVoiceQueue','required':![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0xec')],{'as':_0xc6e6('0x125'),'through':_0xc6e6('0x100'),'required':![]});db[_0xc6e6('0x13')]['belongsToMany'](db['MailQueue'],{'as':_0xc6e6('0x126'),'through':_0xc6e6('0x127'),'required':![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x68')],{'as':_0xc6e6('0x128'),'through':_0xc6e6('0x129'),'required':![],'hooks':!![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x12a')],{'as':'FaxQueues','through':_0xc6e6('0x33'),'required':![]});db['User'][_0xc6e6('0x115')](db[_0xc6e6('0x56')],{'as':_0xc6e6('0x12b'),'through':_0xc6e6('0x34'),'required':![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x5c')],{'as':_0xc6e6('0x12c'),'through':_0xc6e6('0x12d'),'required':![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x12e')],{'as':_0xc6e6('0x12f'),'through':_0xc6e6('0x36'),'required':![]});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0xea')],{'through':_0xc6e6('0x11c')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x5e')],{'as':_0xc6e6('0x130'),'through':_0xc6e6('0x131')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x47')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db['User'][_0xc6e6('0x115')](db[_0xc6e6('0x132')],{'as':_0xc6e6('0x133'),'through':_0xc6e6('0x134')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0x58')],{'as':_0xc6e6('0x135'),'through':_0xc6e6('0x136')});db[_0xc6e6('0x13')]['belongsToMany'](db['SmsAccount'],{'as':_0xc6e6('0x137'),'through':_0xc6e6('0x138')});db[_0xc6e6('0x13')][_0xc6e6('0x115')](db[_0xc6e6('0xf5')],{'as':'WhatsappAccounts','through':_0xc6e6('0x139')});db['User']['belongsToMany'](db['SquareProject'],{'as':_0xc6e6('0x13a'),'through':_0xc6e6('0x13b')});db[_0xc6e6('0x15')][_0xc6e6('0x105')](db[_0xc6e6('0x17')],{'as':_0xc6e6('0x13c'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x13d')});db[_0xc6e6('0x13e')]['hasMany'](db[_0xc6e6('0x17')],{'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x17')]['hasMany'](db[_0xc6e6('0x17')],{'as':_0xc6e6('0x13f'),'onDelete':'cascade'});db[_0xc6e6('0x1a')][_0xc6e6('0x115')](db[_0xc6e6('0x89')],{'as':_0xc6e6('0x140'),'through':'moh_has_sounds'});db['VoiceQueue'][_0xc6e6('0x105')](db[_0xc6e6('0x2e')],{'as':_0xc6e6('0x141'),'foreignKey':'VoiceQueueId'});db[_0xc6e6('0x1c')][_0xc6e6('0x105')](db[_0xc6e6('0x142')],{'as':_0xc6e6('0x143'),'foreignKey':_0xc6e6('0x144')});db['VoiceQueue'][_0xc6e6('0x105')](db[_0xc6e6('0x70')],{'as':_0xc6e6('0x108'),'foreignKey':_0xc6e6('0x144')});db[_0xc6e6('0x1c')][_0xc6e6('0x105')](db[_0xc6e6('0x72')],{'as':_0xc6e6('0x145'),'foreignKey':'VoiceQueueId'});db[_0xc6e6('0x1c')][_0xc6e6('0x105')](db['ReportAgentPreview'],{'as':_0xc6e6('0x74'),'foreignKey':'VoiceQueueId'});db[_0xc6e6('0x1c')][_0xc6e6('0x105')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xc6e6('0x144')});db['VoiceQueue']['hasMany'](db[_0xc6e6('0xce')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xc6e6('0x1c')][_0xc6e6('0x113')](db[_0xc6e6('0x2a')],{'as':'Trunk','foreignKey':_0xc6e6('0x146')});db[_0xc6e6('0x1c')]['belongsTo'](db[_0xc6e6('0x2a')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xc6e6('0x1c')][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'as':_0xc6e6('0x80'),'foreignKey':_0xc6e6('0x147')});db['VoiceQueue']['belongsTo'](db['Pause'],{'as':_0xc6e6('0x148'),'foreignKey':_0xc6e6('0x149')});db[_0xc6e6('0x1c')]['belongsToMany'](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x11b'),'through':_0xc6e6('0x14a')});db['VoiceQueue'][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x30')});db[_0xc6e6('0x1c')][_0xc6e6('0x115')](db['Team'],{'as':_0xc6e6('0x14c'),'through':'TeamVoiceQueue'});db['VoiceQueue'][_0xc6e6('0x115')](db['CmList'],{'as':_0xc6e6('0x14d'),'through':_0xc6e6('0x14e')});db[_0xc6e6('0x1d')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x13'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x14f')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x13'),'foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x20')][_0xc6e6('0x105')](db[_0xc6e6('0x150')],{'as':_0xc6e6('0x151'),'onDelete':_0xc6e6('0x103'),'foreignKey':'mailboxuser','sourceKey':_0xc6e6('0x152')});db['VoiceMailMessage'][_0xc6e6('0x113')](db['VoiceMail'],{'foreignKey':_0xc6e6('0x153'),'targetKey':'mailbox'});db[_0xc6e6('0x23')][_0xc6e6('0x105')](db[_0xc6e6('0x27')],{'as':_0xc6e6('0x154'),'foreignKey':_0xc6e6('0x155'),'constraints':![]});db[_0xc6e6('0x23')][_0xc6e6('0x105')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0xc6e6('0x23')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':'User','foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x23')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':'ContactId'});db[_0xc6e6('0x157')][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'as':_0xc6e6('0x132'),'foreignKey':_0xc6e6('0x158')});db['MailServerOut'][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'as':_0xc6e6('0x132'),'foreignKey':'MailAccountId'});db[_0xc6e6('0x132')][_0xc6e6('0x102')](db[_0xc6e6('0x157')],{'as':_0xc6e6('0x159'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x132')][_0xc6e6('0x102')](db['MailServerOut'],{'as':_0xc6e6('0x15a'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x132')][_0xc6e6('0x105')](db['Disposition'],{'as':_0xc6e6('0x15b'),'foreignKey':'MailAccountId','onDelete':'cascade'});db['MailAccount'][_0xc6e6('0x105')](db[_0xc6e6('0x7b')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0xc6e6('0x132')][_0xc6e6('0x105')](db['MailMessage'],{'as':'Messages','foreignKey':_0xc6e6('0x158')});db[_0xc6e6('0x132')][_0xc6e6('0x105')](db['MailInteraction'],{'as':'Interactions'});db['MailAccount'][_0xc6e6('0x105')](db[_0xc6e6('0x15c')],{'as':'Applications'});db[_0xc6e6('0x132')]['belongsTo'](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':'ListId'});db[_0xc6e6('0x132')][_0xc6e6('0x113')](db[_0xc6e6('0x15e')],{'as':_0xc6e6('0x15e'),'foreignKey':_0xc6e6('0x15f')});db['MailAccount'][_0xc6e6('0x113')](db['Pause'],{'as':_0xc6e6('0x148'),'foreignKey':_0xc6e6('0x149')});db[_0xc6e6('0x132')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x134')});db[_0xc6e6('0x3b')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x127')});db[_0xc6e6('0x3b')]['belongsToMany'](db[_0xc6e6('0x11d')],{'through':'team_has_mail_queues','as':'Teams'});db[_0xc6e6('0x3e')][_0xc6e6('0x105')](db[_0xc6e6('0x3f')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xc6e6('0x160')});db[_0xc6e6('0x3e')][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'as':_0xc6e6('0x161'),'foreignKey':'MailAccountId'});db[_0xc6e6('0x3e')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x3e')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':'Owner','foreignKey':'UserId'});db[_0xc6e6('0x3e')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x163'),'as':_0xc6e6('0x164')});db[_0xc6e6('0x3e')]['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xc6e6('0x165')});db[_0xc6e6('0x3e')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x166'),'through':_0xc6e6('0x11f'),'foreignKey':_0xc6e6('0x160')});db[_0xc6e6('0x3f')][_0xc6e6('0x105')](db['Attachment'],{'as':_0xc6e6('0x167'),'onDelete':'cascade'});db[_0xc6e6('0x3f')]['belongsTo'](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x13')});db[_0xc6e6('0x3f')][_0xc6e6('0x113')](db['CmContact'],{'onDelete':'cascade','as':_0xc6e6('0x156')});db[_0xc6e6('0x3f')][_0xc6e6('0x113')](db['MailInteraction'],{'as':_0xc6e6('0x168'),'foreignKey':'MailInteractionId'});db[_0xc6e6('0x3f')]['belongsTo'](db[_0xc6e6('0x132')],{'as':'Account','foreignKey':_0xc6e6('0x158')});db['MailMessage'][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{'as':_0xc6e6('0x5e'),'foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x3f')]['belongsTo'](db[_0xc6e6('0x66')],{'as':_0xc6e6('0x66'),'foreignKey':_0xc6e6('0x16a')});db['MailApplication'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x16b')});db['MailApplication'][_0xc6e6('0x113')](db['MailQueue'],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x15c')]['belongsTo'](db[_0xc6e6('0x132')],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x15c')][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'onDelete':'restrict','foreignKey':_0xc6e6('0x147')});db[_0xc6e6('0x15c')][_0xc6e6('0x113')](db['Tag'],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x16c')});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db['MailAccount'],{});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db['CmContact'],{'as':_0xc6e6('0x156'),'foreignKey':'ContactId'});db['MailQueueReport'][_0xc6e6('0x113')](db['MailInteraction'],{});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db['MailMessage'],{});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{});db[_0xc6e6('0x16d')][_0xc6e6('0x113')](db['MailQueue'],{});db[_0xc6e6('0x43')]['hasMany'](db[_0xc6e6('0x45')],{'as':_0xc6e6('0x16f'),'onDelete':_0xc6e6('0x103')});db['FaxAccount']['hasMany'](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':_0xc6e6('0x170'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x47')]['hasMany'](db[_0xc6e6('0x7b')],{'as':'Answers','foreignKey':_0xc6e6('0x170')});db[_0xc6e6('0x47')][_0xc6e6('0x105')](db['FaxInteraction'],{'as':_0xc6e6('0x171')});db[_0xc6e6('0x47')][_0xc6e6('0x105')](db[_0xc6e6('0x48')],{'as':_0xc6e6('0x13f')});db[_0xc6e6('0x47')][_0xc6e6('0x105')](db['VoiceExtension'],{'as':_0xc6e6('0x172'),'onDelete':'cascade'});db[_0xc6e6('0x47')][_0xc6e6('0x105')](db['FaxMessage'],{'as':_0xc6e6('0x151')});db[_0xc6e6('0x47')][_0xc6e6('0x113')](db[_0xc6e6('0x2a')],{'as':_0xc6e6('0x2a')});db[_0xc6e6('0x47')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0x47')]['belongsTo'](db[_0xc6e6('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0xc6e6('0x149')});db[_0xc6e6('0x47')][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x173')});db['FaxApplication'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x48')][_0xc6e6('0x113')](db[_0xc6e6('0x12a')],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x48')][_0xc6e6('0x113')](db['FaxAccount'],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x48')]['belongsTo'](db[_0xc6e6('0x8b')],{'onDelete':'restrict','foreignKey':_0xc6e6('0x16c')});db[_0xc6e6('0x10e')][_0xc6e6('0x105')](db[_0xc6e6('0x4b')],{'as':'Messages','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x174')});db[_0xc6e6('0x10e')][_0xc6e6('0x113')](db[_0xc6e6('0x47')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x170')});db['FaxInteraction'][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x10e')]['belongsTo'](db[_0xc6e6('0x13')],{'as':'Owner','foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x10e')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x175'),'as':_0xc6e6('0x164')});db[_0xc6e6('0x10e')][_0xc6e6('0x115')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0xc6e6('0x165')});db[_0xc6e6('0x10e')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':'Users','through':_0xc6e6('0x120'),'foreignKey':_0xc6e6('0x174')});db[_0xc6e6('0x4b')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x103'),'as':'User'});db[_0xc6e6('0x4b')]['belongsTo'](db['FaxInteraction'],{'as':_0xc6e6('0x168'),'foreignKey':_0xc6e6('0x174')});db[_0xc6e6('0x4b')]['belongsTo'](db[_0xc6e6('0x118')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x156')});db[_0xc6e6('0x4b')][_0xc6e6('0x113')](db[_0xc6e6('0x176')],{'as':_0xc6e6('0x176'),'foreignKey':_0xc6e6('0x177')});db['FaxMessage'][_0xc6e6('0x113')](db[_0xc6e6('0x47')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xc6e6('0x12a')][_0xc6e6('0x115')](db['User'],{'as':'Agents','through':'UserFaxQueue'});db[_0xc6e6('0x12a')][_0xc6e6('0x115')](db['Team'],{'through':_0xc6e6('0x178'),'as':'Teams'});db['FaxQueueReport'][_0xc6e6('0x113')](db['FaxAccount'],{});db[_0xc6e6('0x4e')][_0xc6e6('0x113')](db['CmList'],{'as':'List','foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0x4e')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x4e')][_0xc6e6('0x113')](db['FaxInteraction'],{});db[_0xc6e6('0x4e')][_0xc6e6('0x113')](db[_0xc6e6('0x4b')],{});db['FaxQueueReport'][_0xc6e6('0x113')](db['User'],{});db[_0xc6e6('0x4e')][_0xc6e6('0x113')](db[_0xc6e6('0x12a')],{});db[_0xc6e6('0x50')][_0xc6e6('0x105')](db['Disposition'],{'as':_0xc6e6('0x15b'),'foreignKey':'SmsAccountId','onDelete':_0xc6e6('0x103')});db['SmsAccount'][_0xc6e6('0x105')](db[_0xc6e6('0x7b')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0xc6e6('0x50')][_0xc6e6('0x105')](db[_0xc6e6('0x54')],{'as':'Messages','foreignKey':_0xc6e6('0x179')});db[_0xc6e6('0x50')][_0xc6e6('0x105')](db[_0xc6e6('0x52')],{'as':'Interactions'});db['SmsAccount'][_0xc6e6('0x105')](db[_0xc6e6('0x51')],{'as':_0xc6e6('0x13f')});db[_0xc6e6('0x50')][_0xc6e6('0x113')](db['CmList'],{'as':_0xc6e6('0x15d'),'foreignKey':'ListId'});db[_0xc6e6('0x50')][_0xc6e6('0x113')](db[_0xc6e6('0x82')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xc6e6('0x50')][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x138')});db[_0xc6e6('0x51')]['belongsTo'](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x51')][_0xc6e6('0x113')](db[_0xc6e6('0x56')],{'onDelete':'restrict'});db[_0xc6e6('0x51')][_0xc6e6('0x113')](db[_0xc6e6('0x50')],{'onDelete':'restrict'});db['SmsApplication'][_0xc6e6('0x113')](db['Interval'],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x147')});db[_0xc6e6('0x51')][_0xc6e6('0x113')](db[_0xc6e6('0x8b')],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x16c')});db[_0xc6e6('0x52')]['hasMany'](db[_0xc6e6('0x54')],{'as':_0xc6e6('0x151'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0xc6e6('0x52')][_0xc6e6('0x113')](db[_0xc6e6('0x50')],{'as':_0xc6e6('0x161'),'foreignKey':'SmsAccountId'});db[_0xc6e6('0x52')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':'Contact','foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x52')]['belongsTo'](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x17a'),'foreignKey':'UserId'});db[_0xc6e6('0x52')][_0xc6e6('0x115')](db['Tag'],{'through':_0xc6e6('0x17b'),'as':_0xc6e6('0x164')});db[_0xc6e6('0x52')]['belongsToMany'](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x17b'),'as':_0xc6e6('0x165')});db[_0xc6e6('0x52')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':'Users','through':_0xc6e6('0x121'),'foreignKey':_0xc6e6('0x17c')});db[_0xc6e6('0x54')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x13')});db[_0xc6e6('0x54')][_0xc6e6('0x113')](db['CmContact'],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x156')});db['SmsMessage']['belongsTo'](db[_0xc6e6('0x52')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x168'),'foreignKey':'SmsInteractionId'});db[_0xc6e6('0x54')][_0xc6e6('0x113')](db['SmsAccount'],{'as':_0xc6e6('0x161'),'foreignKey':'SmsAccountId'});db[_0xc6e6('0x56')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x34'),'foreignKey':_0xc6e6('0x17d')});db['SmsQueue']['belongsToMany'](db[_0xc6e6('0x11d')],{'through':_0xc6e6('0x17e'),'as':'Teams'});db[_0xc6e6('0x58')][_0xc6e6('0x105')](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':_0xc6e6('0x17f'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x58')][_0xc6e6('0x105')](db[_0xc6e6('0x7b')],{'as':'Answers','foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x58')]['hasMany'](db[_0xc6e6('0x10a')],{'as':_0xc6e6('0x171'),'foreignKey':_0xc6e6('0x17f')});db['OpenchannelAccount']['hasMany'](db[_0xc6e6('0x5a')],{'as':_0xc6e6('0x151'),'foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x58')]['hasMany'](db[_0xc6e6('0x180')],{'as':'Applications','foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x58')]['belongsTo'](db['CmList'],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db['OpenchannelAccount'][_0xc6e6('0x113')](db['Pause'],{'as':_0xc6e6('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc6e6('0x58')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':'Agents','through':_0xc6e6('0x136')});db[_0xc6e6('0x180')][_0xc6e6('0x113')](db['User'],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x180')][_0xc6e6('0x113')](db[_0xc6e6('0x5c')],{'onDelete':_0xc6e6('0x16b'),'foreignKey':'OpenchannelQueueId'});db[_0xc6e6('0x180')][_0xc6e6('0x113')](db['OpenchannelAccount'],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x180')][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x147')});db[_0xc6e6('0x180')][_0xc6e6('0x113')](db['Tag'],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x16c')});db[_0xc6e6('0x10a')][_0xc6e6('0x105')](db[_0xc6e6('0x5a')],{'as':_0xc6e6('0x151'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x181')});db[_0xc6e6('0x10a')][_0xc6e6('0x113')](db[_0xc6e6('0x58')],{'as':'Account','foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x10a')][_0xc6e6('0x113')](db['CmContact'],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x10a')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':'Owner','foreignKey':_0xc6e6('0x104')});db[_0xc6e6('0x10a')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x182'),'as':_0xc6e6('0x164')});db[_0xc6e6('0x10a')]['belongsToMany'](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x182'),'as':'ThroughTags'});db[_0xc6e6('0x10a')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x166'),'through':_0xc6e6('0x122'),'foreignKey':_0xc6e6('0x181')});db[_0xc6e6('0x5a')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x13')});db['OpenchannelMessage']['belongsTo'](db[_0xc6e6('0x118')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x156')});db['OpenchannelMessage'][_0xc6e6('0x113')](db[_0xc6e6('0x10a')],{'onDelete':'cascade','as':_0xc6e6('0x168'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0xc6e6('0x113')](db[_0xc6e6('0x176')],{'as':'Attachment','foreignKey':_0xc6e6('0x177')});db[_0xc6e6('0x5a')]['belongsTo'](db['OpenchannelAccount'],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x17f')});db[_0xc6e6('0x5c')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x12d'),'foreignKey':_0xc6e6('0x183')});db['OpenchannelQueue'][_0xc6e6('0x115')](db[_0xc6e6('0x11d')],{'through':'team_has_openchannel_queues','as':_0xc6e6('0x14c')});db[_0xc6e6('0x5e')][_0xc6e6('0x105')](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':_0xc6e6('0x169'),'onDelete':'cascade'});db[_0xc6e6('0x5e')][_0xc6e6('0x105')](db['CannedAnswer'],{'as':_0xc6e6('0x184'),'foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x5e')][_0xc6e6('0x105')](db[_0xc6e6('0x6b')],{'as':_0xc6e6('0x185')});db['ChatWebsite'][_0xc6e6('0x105')](db[_0xc6e6('0x63')],{'as':_0xc6e6('0x171')});db[_0xc6e6('0x5e')][_0xc6e6('0x105')](db[_0xc6e6('0x61')],{'as':_0xc6e6('0x13f')});db[_0xc6e6('0x5e')][_0xc6e6('0x105')](db[_0xc6e6('0x65')],{'as':_0xc6e6('0x151')});db['ChatWebsite'][_0xc6e6('0x113')](db['CmList'],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db['ChatWebsite'][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'as':_0xc6e6('0x80'),'foreignKey':_0xc6e6('0x147')});db[_0xc6e6('0x5e')][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'as':_0xc6e6('0x132'),'foreignKey':_0xc6e6('0x158')});db[_0xc6e6('0x5e')][_0xc6e6('0x113')](db['Pause'],{'as':_0xc6e6('0x148'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc6e6('0x5e')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x131')});db['OpenchannelQueueReport'][_0xc6e6('0x113')](db[_0xc6e6('0x58')],{});db[_0xc6e6('0x5f')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':'ListId'});db[_0xc6e6('0x5f')][_0xc6e6('0x113')](db['CmContact'],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db['OpenchannelQueueReport'][_0xc6e6('0x113')](db[_0xc6e6('0x10a')],{});db['OpenchannelQueueReport'][_0xc6e6('0x113')](db[_0xc6e6('0x5a')],{});db[_0xc6e6('0x5f')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{});db[_0xc6e6('0x5f')][_0xc6e6('0x113')](db[_0xc6e6('0x5c')],{});db['ChatApplication'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x186'),'foreignKey':'UserId','onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xc6e6('0x68')],{'as':_0xc6e6('0x187'),'foreignKey':_0xc6e6('0x188'),'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x61')][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{'as':'Website','foreignKey':_0xc6e6('0x169'),'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x61')][_0xc6e6('0x113')](db[_0xc6e6('0x8b')],{'onDelete':_0xc6e6('0x16b'),'foreignKey':_0xc6e6('0x16c')});db[_0xc6e6('0x63')][_0xc6e6('0x105')](db['ChatMessage'],{'as':'Messages','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x189')});db[_0xc6e6('0x63')][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x63')][_0xc6e6('0x113')](db['CmContact'],{'as':'Contact','foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x63')]['belongsTo'](db[_0xc6e6('0x13')],{'as':'Owner','foreignKey':_0xc6e6('0x104')});db['ChatInteraction'][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x18a'),'as':_0xc6e6('0x164')});db[_0xc6e6('0x63')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':'chat_interaction_has_tags','as':_0xc6e6('0x165')});db[_0xc6e6('0x63')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x166'),'through':_0xc6e6('0x18b'),'foreignKey':_0xc6e6('0x189')});db['ChatMessage'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x13')});db[_0xc6e6('0x65')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x65')]['belongsTo'](db[_0xc6e6('0x63')],{'onDelete':_0xc6e6('0x103'),'as':_0xc6e6('0x168'),'foreignKey':_0xc6e6('0x189')});db[_0xc6e6('0x65')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0xc6e6('0x177')});db['ChatMessage']['belongsTo'](db[_0xc6e6('0x5e')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x66')][_0xc6e6('0x105')](db[_0xc6e6('0x176')],{'as':_0xc6e6('0x167'),'foreignKey':_0xc6e6('0x16a'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db[_0xc6e6('0x66')]['belongsTo'](db[_0xc6e6('0x118')],{'onDelete':_0xc6e6('0x103'),'as':'Contact','foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x66')][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{'as':'Account','foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x68')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':'Agents','through':_0xc6e6('0x129'),'hooks':!![]});db[_0xc6e6('0x68')]['belongsToMany'](db[_0xc6e6('0x11d')],{'through':'team_has_chat_queues','as':_0xc6e6('0x14c')});db['ChatGroup']['hasMany'](db[_0xc6e6('0xcc')],{'as':_0xc6e6('0x151'),'foreignKey':'ChatGroupId','onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x69')][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x141'),'through':_0xc6e6('0x117')});db[_0xc6e6('0x6b')]['belongsTo'](db[_0xc6e6('0x5e')],{'as':'Website','foreignKey':_0xc6e6('0x169')});db[_0xc6e6('0x18c')]['hasMany'](db[_0xc6e6('0x118')],{'as':'Contacts','foreignKey':_0xc6e6('0x18d')});db[_0xc6e6('0x118')]['hasMany'](db[_0xc6e6('0x142')],{'as':_0xc6e6('0x143'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x118')]['hasMany'](db[_0xc6e6('0x70')],{'as':_0xc6e6('0x108'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db[_0xc6e6('0x74')],{'as':_0xc6e6('0x74'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db['JscriptySessionReport'],{'as':_0xc6e6('0x18e'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db[_0xc6e6('0x10a')],{'as':_0xc6e6('0x10b'),'foreignKey':_0xc6e6('0x162'),'onDelete':_0xc6e6('0x16b')});db['CmContact'][_0xc6e6('0x105')](db[_0xc6e6('0x63')],{'as':_0xc6e6('0x10c'),'foreignKey':_0xc6e6('0x162'),'onDelete':'restrict'});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db['SmsInteraction'],{'as':_0xc6e6('0x10d'),'foreignKey':_0xc6e6('0x162'),'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x118')][_0xc6e6('0x105')](db[_0xc6e6('0x10e')],{'as':'FaxInteractions','foreignKey':_0xc6e6('0x162'),'onDelete':'restrict'});db[_0xc6e6('0x118')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xc6e6('0x162'),'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x118')][_0xc6e6('0x113')](db[_0xc6e6('0x18c')],{'as':_0xc6e6('0x18f'),'foreignKey':_0xc6e6('0x18d')});db[_0xc6e6('0x118')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':'List','foreignKey':'ListId','onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x118')]['belongsToMany'](db[_0xc6e6('0x13')],{'as':'Users','through':_0xc6e6('0x11a')});db[_0xc6e6('0x118')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xc6e6('0x118')]['belongsToMany'](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x190'),'as':_0xc6e6('0x165')});db[_0xc6e6('0x142')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0xc6e6('0x142')][_0xc6e6('0x113')](db['CmList'],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e'),'onDelete':'cascade'});db[_0xc6e6('0x142')]['belongsTo'](db[_0xc6e6('0x13')],{'as':'Agent','foreignKey':_0xc6e6('0x104')});db['CmHopper'][_0xc6e6('0x113')](db[_0xc6e6('0x1c')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0xc6e6('0x103')});db['CmHopper']['belongsTo'](db['Campaign'],{'as':_0xc6e6('0x191'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0xc6e6('0x142')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x17a'),'foreignKey':_0xc6e6('0x192')});db[_0xc6e6('0x193')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x193')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x193')][_0xc6e6('0x113')](db[_0xc6e6('0x1c')],{'as':'Queue','foreignKey':_0xc6e6('0x144'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x193')][_0xc6e6('0x113')](db[_0xc6e6('0x191')],{'as':_0xc6e6('0x191'),'foreignKey':_0xc6e6('0x194'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x79')][_0xc6e6('0x105')](db[_0xc6e6('0x7e')],{'as':{'plural':'All','singular':_0xc6e6('0x195')},'foreignKey':'AutomationAllId','onDelete':_0xc6e6('0x103'),'hooks':!![]});db['Automation'][_0xc6e6('0x105')](db[_0xc6e6('0x7e')],{'as':{'plural':_0xc6e6('0x196'),'singular':_0xc6e6('0x197')},'foreignKey':_0xc6e6('0x198'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db[_0xc6e6('0x79')][_0xc6e6('0x105')](db['Action'],{'as':_0xc6e6('0x199'),'foreignKey':_0xc6e6('0x19a'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db['Disposition'][_0xc6e6('0x105')](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':'ParentId','onDelete':_0xc6e6('0x103')});db[_0xc6e6('0x80')][_0xc6e6('0x105')](db['Interval'],{'as':'Intervals','foreignKey':_0xc6e6('0x147'),'onDelete':_0xc6e6('0x103'),'hooks':!![],'required':![]});db[_0xc6e6('0x80')][_0xc6e6('0x105')](db[_0xc6e6('0x17')],{'as':_0xc6e6('0x19b'),'foreignKey':_0xc6e6('0x147'),'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0x80')][_0xc6e6('0x105')](db[_0xc6e6('0x15c')],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0xc6e6('0x80')][_0xc6e6('0x105')](db[_0xc6e6('0x61')],{'as':'ChatApplications','foreignKey':_0xc6e6('0x147')});db[_0xc6e6('0x80')][_0xc6e6('0x105')](db['FaxApplication'],{'as':_0xc6e6('0x19c'),'foreignKey':_0xc6e6('0x147')});db['Interval'][_0xc6e6('0x105')](db[_0xc6e6('0x51')],{'as':_0xc6e6('0x19d'),'foreignKey':_0xc6e6('0x147')});db['Schedule']['belongsTo'](db[_0xc6e6('0x132')],{});db[_0xc6e6('0x88')][_0xc6e6('0x113')](db[_0xc6e6('0x94')],{'foreignKey':'DefaultReportId'});db[_0xc6e6('0x88')][_0xc6e6('0x113')](db[_0xc6e6('0x19e')],{'foreignKey':_0xc6e6('0x19f')});db['Sound'][_0xc6e6('0x115')](db[_0xc6e6('0x1a')],{'as':_0xc6e6('0x1a0'),'through':_0xc6e6('0x1a1'),'onDelete':_0xc6e6('0x16b')});db['Tag']['belongsToMany'](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0xc6e6('0x8b')][_0xc6e6('0x115')](db[_0xc6e6('0x63')],{'through':_0xc6e6('0x18a')});db[_0xc6e6('0x8b')][_0xc6e6('0x115')](db[_0xc6e6('0x3e')],{'through':_0xc6e6('0x163')});db[_0xc6e6('0x8b')]['belongsToMany'](db['SmsInteraction'],{'through':_0xc6e6('0x17b')});db[_0xc6e6('0x8b')]['belongsToMany'](db[_0xc6e6('0x10e')],{'through':'fax_interaction_has_tags'});db['Tag'][_0xc6e6('0x115')](db[_0xc6e6('0x10a')],{'through':'openchannel_interaction_has_tags'});db[_0xc6e6('0x8b')]['belongsToMany'](db[_0xc6e6('0xf7')],{'through':_0xc6e6('0x1a2')});db['Trigger'][_0xc6e6('0x105')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0xc6e6('0x1a3')},'foreignKey':_0xc6e6('0x1a4'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db[_0xc6e6('0x8d')]['hasMany'](db['Condition'],{'as':{'plural':_0xc6e6('0x1a5'),'singular':_0xc6e6('0x1a6')},'foreignKey':_0xc6e6('0x1a7'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db['Trigger'][_0xc6e6('0x105')](db[_0xc6e6('0x77')],{'as':_0xc6e6('0x199'),'foreignKey':_0xc6e6('0x1a8'),'onDelete':_0xc6e6('0x103'),'hooks':!![]});db[_0xc6e6('0x19e')][_0xc6e6('0x105')](db[_0xc6e6('0x99')],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x19f'),'hooks':!![]});db[_0xc6e6('0x94')][_0xc6e6('0x105')](db[_0xc6e6('0x99')],{'as':_0xc6e6('0x1a9'),'onDelete':'cascade','foreignKey':_0xc6e6('0x1aa')});db[_0xc6e6('0x97')][_0xc6e6('0x105')](db[_0xc6e6('0x99')],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ab')});db[_0xc6e6('0x99')][_0xc6e6('0x113')](db[_0xc6e6('0x97')],{'foreignKey':'MetricId'});db[_0xc6e6('0x9b')][_0xc6e6('0x105')](db['SalesforceConfiguration'],{'as':'Configurations','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db['SalesforceConfiguration'][_0xc6e6('0x105')](db['SalesforceField'],{'as':_0xc6e6('0x1ad'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0x9d')]['hasMany'](db['SalesforceField'],{'as':_0xc6e6('0x1af'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x9d')][_0xc6e6('0x105')](db['SalesforceField'],{'as':'Fields','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0x9d')]['belongsTo'](db[_0xc6e6('0x9b')],{'as':'Account','foreignKey':'AccountId'});db[_0xc6e6('0x9e')][_0xc6e6('0x105')](db[_0xc6e6('0x9e')],{'as':_0xc6e6('0x1b2'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0x9e')][_0xc6e6('0x105')](db[_0xc6e6('0x9e')],{'as':'Description','foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x9e')][_0xc6e6('0x105')](db[_0xc6e6('0x9e')],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0x9e')]['belongsTo'](db[_0xc6e6('0x8f')],{'as':'Variable','foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0xa0')][_0xc6e6('0x105')](db[_0xc6e6('0x1b5')],{'as':_0xc6e6('0x1b6'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db['SugarcrmConfiguration'][_0xc6e6('0x105')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ae')});db['SugarcrmConfiguration']['hasMany'](db[_0xc6e6('0xa3')],{'as':'Descriptions','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x1b5')][_0xc6e6('0x105')](db['SugarcrmField'],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':'FieldId'});db[_0xc6e6('0x1b5')][_0xc6e6('0x113')](db[_0xc6e6('0xa0')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db['SugarcrmField']['hasMany'](db[_0xc6e6('0xa3')],{'as':_0xc6e6('0x1b2'),'foreignKey':_0xc6e6('0x1ae')});db['SugarcrmField'][_0xc6e6('0x105')](db['SugarcrmField'],{'as':'Description','foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xa3')][_0xc6e6('0x105')](db[_0xc6e6('0xa3')],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xa3')][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0xa5')]['hasMany'](db[_0xc6e6('0xa7')],{'as':_0xc6e6('0x1b6'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db['DeskConfiguration'][_0xc6e6('0x105')](db['DeskField'],{'as':'Subjects','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xa7')][_0xc6e6('0x105')](db[_0xc6e6('0x1b7')],{'as':_0xc6e6('0x1af'),'onDelete':_0xc6e6('0x103'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0x1b7')],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xa7')]['belongsTo'](db[_0xc6e6('0xa5')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xa7')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x1b8')});db[_0xc6e6('0x1b7')][_0xc6e6('0x105')](db[_0xc6e6('0x1b7')],{'as':'Subject','foreignKey':_0xc6e6('0x1ae')});db['DeskField']['hasMany'](db[_0xc6e6('0x1b7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xc6e6('0x1b7')][_0xc6e6('0x105')](db[_0xc6e6('0x1b7')],{'as':_0xc6e6('0x1b3'),'foreignKey':'FieldId'});db[_0xc6e6('0x1b7')][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':'VariableId'});db['ZohoAccount'][_0xc6e6('0x105')](db[_0xc6e6('0xac')],{'as':_0xc6e6('0x1b6'),'onDelete':'cascade','foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xac')][_0xc6e6('0x105')](db[_0xc6e6('0xad')],{'as':_0xc6e6('0x1ad'),'onDelete':_0xc6e6('0x103'),'foreignKey':'SubjectId'});db[_0xc6e6('0xac')][_0xc6e6('0x105')](db[_0xc6e6('0xad')],{'as':_0xc6e6('0x1af'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xac')][_0xc6e6('0x105')](db[_0xc6e6('0xad')],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':'FieldId'});db[_0xc6e6('0xac')][_0xc6e6('0x113')](db[_0xc6e6('0xaa')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xad')]['hasMany'](db[_0xc6e6('0xad')],{'as':'Subject','foreignKey':'SubjectId'});db['ZohoField'][_0xc6e6('0x105')](db[_0xc6e6('0xad')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xc6e6('0xad')][_0xc6e6('0x105')](db[_0xc6e6('0xad')],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xad')][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0x1b9')][_0xc6e6('0x105')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xaf')][_0xc6e6('0x105')](db[_0xc6e6('0xb1')],{'as':_0xc6e6('0x1ad'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xaf')][_0xc6e6('0x105')](db[_0xc6e6('0xb1')],{'as':'Descriptions','foreignKey':_0xc6e6('0x1b0')});db['ZendeskConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0xb1')],{'as':'Fields','foreignKey':'FieldId'});db[_0xc6e6('0xaf')]['belongsTo'](db[_0xc6e6('0x1b9')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xaf')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x1ba')});db[_0xc6e6('0xb1')][_0xc6e6('0x105')](db['ZendeskField'],{'as':'Subject','foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xb1')][_0xc6e6('0x105')](db[_0xc6e6('0xb1')],{'as':_0xc6e6('0x1bb'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xb1')]['hasMany'](db[_0xc6e6('0xb1')],{'as':'Field','foreignKey':_0xc6e6('0x1b1')});db['ZendeskField'][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':_0xc6e6('0x1b4')});db['FreshdeskAccount'][_0xc6e6('0x105')](db[_0xc6e6('0x1bc')],{'as':_0xc6e6('0x1b6'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xc6e6('0x1bc')][_0xc6e6('0x105')](db[_0xc6e6('0x1bd')],{'as':_0xc6e6('0x1ad'),'onDelete':_0xc6e6('0x103'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0x1bd')],{'as':_0xc6e6('0x1af'),'onDelete':'cascade','foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x1bc')][_0xc6e6('0x105')](db[_0xc6e6('0x1bd')],{'as':_0xc6e6('0x1a9'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0x1bc')][_0xc6e6('0x113')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0x1bc')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x1be')});db[_0xc6e6('0x1bd')][_0xc6e6('0x105')](db[_0xc6e6('0x1bd')],{'as':_0xc6e6('0x1b2'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0x1bd')][_0xc6e6('0x105')](db['FreshdeskField'],{'as':_0xc6e6('0x1bb'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x1bd')][_0xc6e6('0x105')](db['FreshdeskField'],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0x1bd')][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0xb7')][_0xc6e6('0x105')](db[_0xc6e6('0xb9')],{'as':_0xc6e6('0x1b6'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db['VtigerConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':_0xc6e6('0x1ad'),'foreignKey':_0xc6e6('0x1ae')});db['VtigerConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':_0xc6e6('0x1af'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xb9')][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':'Fields','foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xb9')][_0xc6e6('0x113')](db[_0xc6e6('0xb7')],{'as':'Account','foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xba')][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':_0xc6e6('0x1b2'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xba')][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':'Description','foreignKey':_0xc6e6('0x1b0')});db['VtigerField'][_0xc6e6('0x105')](db[_0xc6e6('0xba')],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xba')]['belongsTo'](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':'VariableId'});db[_0xc6e6('0xbb')][_0xc6e6('0x105')](db[_0xc6e6('0xbc')],{'as':'Configurations','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xbc')][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':_0xc6e6('0x1ad'),'foreignKey':_0xc6e6('0x1ae')});db['ServicenowConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':'Fields','foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xbc')][_0xc6e6('0x113')](db[_0xc6e6('0xbb')],{'as':_0xc6e6('0x161'),'foreignKey':'AccountId'});db['ServicenowField'][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':'Subject','foreignKey':_0xc6e6('0x1ae')});db['ServicenowField'][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':_0xc6e6('0x1bb'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xbe')][_0xc6e6('0x105')](db[_0xc6e6('0xbe')],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db['ServicenowField'][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':'VariableId'});db[_0xc6e6('0xc0')][_0xc6e6('0x105')](db[_0xc6e6('0xc1')],{'as':_0xc6e6('0x1b6'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db['Dynamics365Configuration'][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':_0xc6e6('0x1ad'),'onDelete':'cascade','foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xc1')][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':_0xc6e6('0x1af'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xc1')][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':'Fields','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0xc1')]['belongsTo'](db['Dynamics365Account'],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xc2')][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':'Subject','foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xc2')][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':'Description','foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xc2')][_0xc6e6('0x105')](db[_0xc6e6('0xc2')],{'as':'Field','foreignKey':_0xc6e6('0x1b1')});db['Dynamics365Field'][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':_0xc6e6('0x8f'),'foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0xc4')][_0xc6e6('0x105')](db[_0xc6e6('0xc6')],{'as':'Configurations','onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0xc6')][_0xc6e6('0x105')](db[_0xc6e6('0x1bf')],{'as':_0xc6e6('0x1ad'),'foreignKey':_0xc6e6('0x1ae')});db[_0xc6e6('0xc6')]['hasMany'](db[_0xc6e6('0x1bf')],{'as':_0xc6e6('0x1af'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0xc6')][_0xc6e6('0x105')](db[_0xc6e6('0x1bf')],{'as':_0xc6e6('0x1a9'),'foreignKey':_0xc6e6('0x1b1')});db['FreshsalesConfiguration'][_0xc6e6('0x113')](db[_0xc6e6('0xc4')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1ac')});db[_0xc6e6('0x1bf')][_0xc6e6('0x105')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0xc6e6('0x1ae')});db['FreshsalesField'][_0xc6e6('0x105')](db[_0xc6e6('0x1bf')],{'as':_0xc6e6('0x1bb'),'foreignKey':_0xc6e6('0x1b0')});db[_0xc6e6('0x1bf')][_0xc6e6('0x105')](db['FreshsalesField'],{'as':_0xc6e6('0x1b3'),'foreignKey':_0xc6e6('0x1b1')});db[_0xc6e6('0x1bf')][_0xc6e6('0x113')](db[_0xc6e6('0x8f')],{'as':'Variable','foreignKey':_0xc6e6('0x1b4')});db[_0xc6e6('0xca')][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{});db[_0xc6e6('0xca')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':'ListId'});db[_0xc6e6('0xca')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0xca')][_0xc6e6('0x113')](db['ChatInteraction'],{});db[_0xc6e6('0xca')][_0xc6e6('0x113')](db['ChatMessage'],{});db[_0xc6e6('0xca')]['belongsTo'](db['User'],{});db['ChatQueueReport']['belongsTo'](db[_0xc6e6('0x68')],{});db[_0xc6e6('0xcc')][_0xc6e6('0x113')](db['User'],{'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x1c0')});db[_0xc6e6('0xcc')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'onDelete':_0xc6e6('0x103'),'foreignKey':'ToId'});db['JscriptySessionReport'][_0xc6e6('0x105')](db[_0xc6e6('0xcd')],{'foreignKey':_0xc6e6('0x1c1'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0xce')][_0xc6e6('0x105')](db[_0xc6e6('0x1c2')],{'foreignKey':_0xc6e6('0x1c1'),'onDelete':_0xc6e6('0x103')});db['SmsQueueReport']['belongsTo'](db[_0xc6e6('0x50')],{});db[_0xc6e6('0xcf')][_0xc6e6('0x113')](db['CmList'],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xcf')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0xcf')][_0xc6e6('0x113')](db[_0xc6e6('0x52')],{});db[_0xc6e6('0xcf')][_0xc6e6('0x113')](db[_0xc6e6('0x54')],{});db['SmsQueueReport'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{});db[_0xc6e6('0xcf')][_0xc6e6('0x113')](db[_0xc6e6('0x56')],{});db[_0xc6e6('0xd3')][_0xc6e6('0x105')](db[_0xc6e6('0xce')],{'foreignKey':_0xc6e6('0x1c3')});db['JscriptyProject']['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db['SquareProject']['belongsToMany'](db['User'],{'as':_0xc6e6('0x166'),'through':'user_has_square_projects'});db[_0xc6e6('0x11d')]['belongsToMany'](db[_0xc6e6('0x13')],{'as':'Agents','through':_0xc6e6('0x11e')});db[_0xc6e6('0x11d')]['belongsToMany'](db[_0xc6e6('0x1c')],{'through':_0xc6e6('0x1c4'),'as':_0xc6e6('0x124')});db[_0xc6e6('0x11d')][_0xc6e6('0x115')](db[_0xc6e6('0x3b')],{'through':_0xc6e6('0x1c5'),'as':_0xc6e6('0x126')});db[_0xc6e6('0x11d')]['belongsToMany'](db[_0xc6e6('0x68')],{'through':_0xc6e6('0x1c6'),'as':'ChatQueues'});db[_0xc6e6('0x11d')][_0xc6e6('0x115')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0xc6e6('0x1c7')});db['Team'][_0xc6e6('0x115')](db['SmsQueue'],{'through':_0xc6e6('0x17e'),'as':_0xc6e6('0x12b')});db['Team']['belongsToMany'](db[_0xc6e6('0x5c')],{'through':_0xc6e6('0x1c8'),'as':_0xc6e6('0x12c')});db[_0xc6e6('0x11d')][_0xc6e6('0x115')](db[_0xc6e6('0x12e')],{'through':_0xc6e6('0x1c9'),'as':_0xc6e6('0x12f')});db[_0xc6e6('0x11d')][_0xc6e6('0x115')](db[_0xc6e6('0xec')],{'through':_0xc6e6('0x1ca'),'as':_0xc6e6('0x125')});db[_0xc6e6('0x191')][_0xc6e6('0x105')](db[_0xc6e6('0x142')],{'as':'Hoppers','foreignKey':_0xc6e6('0x194')});db[_0xc6e6('0x191')][_0xc6e6('0x105')](db[_0xc6e6('0x70')],{'as':_0xc6e6('0x108'),'foreignKey':_0xc6e6('0x194')});db[_0xc6e6('0x191')][_0xc6e6('0x105')](db['CmHopperHistory'],{'as':_0xc6e6('0x145'),'foreignKey':_0xc6e6('0x194')});db[_0xc6e6('0x191')]['hasMany'](db[_0xc6e6('0x193')],{'as':_0xc6e6('0x1cb'),'foreignKey':_0xc6e6('0x194')});db[_0xc6e6('0x191')]['belongsTo'](db['Trunk'],{'as':'Trunk','foreignKey':_0xc6e6('0x146')});db[_0xc6e6('0x191')]['belongsTo'](db['Trunk'],{'as':_0xc6e6('0x1cc'),'foreignKey':_0xc6e6('0x1cd')});db[_0xc6e6('0x191')][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'as':_0xc6e6('0x80'),'foreignKey':_0xc6e6('0x147')});db['Campaign'][_0xc6e6('0x113')](db[_0xc6e6('0xd7')],{'as':'SquareProject','foreignKey':_0xc6e6('0x1ce')});db[_0xc6e6('0x191')][_0xc6e6('0x115')](db['CmList'],{'as':'Lists','through':_0xc6e6('0x1cf')});db[_0xc6e6('0x191')]['belongsToMany'](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x14d'),'through':'campaigns_has_cm_blacklists'});db['Attachment'][_0xc6e6('0x113')](db[_0xc6e6('0x66')],{'as':_0xc6e6('0x66'),'foreignKey':_0xc6e6('0x16a')});db['MailTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x3f')],{});db[_0xc6e6('0xe1')][_0xc6e6('0x113')](db[_0xc6e6('0x3e')],{});db['MailTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'foreignKey':_0xc6e6('0x1d0'),'as':_0xc6e6('0x1d1')});db[_0xc6e6('0xe1')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':'FromUserId','as':_0xc6e6('0x1d2')});db['MailTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1d3'),'as':_0xc6e6('0x1d4')});db[_0xc6e6('0xe1')][_0xc6e6('0x113')](db[_0xc6e6('0x3b')],{'foreignKey':_0xc6e6('0x1d5'),'as':_0xc6e6('0x1d6')});db['MailTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x132')],{'foreignKey':_0xc6e6('0x1d7'),'as':_0xc6e6('0x1d8')});db[_0xc6e6('0x1d9')][_0xc6e6('0x113')](db[_0xc6e6('0x65')],{});db[_0xc6e6('0x1d9')][_0xc6e6('0x113')](db[_0xc6e6('0x63')],{});db[_0xc6e6('0x1d9')][_0xc6e6('0x113')](db[_0xc6e6('0x5e')],{'foreignKey':_0xc6e6('0x1da'),'as':_0xc6e6('0x1d1')});db['ChatTransferReport']['belongsTo'](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1db'),'as':_0xc6e6('0x1d2')});db[_0xc6e6('0x1d9')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1d3'),'as':_0xc6e6('0x1d4')});db['ChatTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x68')],{'foreignKey':_0xc6e6('0x1dc'),'as':'ToQueue'});db[_0xc6e6('0x1d9')]['belongsTo'](db[_0xc6e6('0x5e')],{'foreignKey':_0xc6e6('0x1dd'),'as':_0xc6e6('0x1d8')});db[_0xc6e6('0xe4')][_0xc6e6('0x113')](db[_0xc6e6('0x4b')],{});db[_0xc6e6('0xe4')][_0xc6e6('0x113')](db[_0xc6e6('0x10e')],{});db['FaxTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x47')],{'foreignKey':_0xc6e6('0x1de'),'as':'FromAccount'});db['FaxTransferReport']['belongsTo'](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1db'),'as':_0xc6e6('0x1d2')});db[_0xc6e6('0xe4')]['belongsTo'](db['User'],{'foreignKey':_0xc6e6('0x1d3'),'as':_0xc6e6('0x1d4')});db[_0xc6e6('0xe4')][_0xc6e6('0x113')](db['FaxQueue'],{'foreignKey':_0xc6e6('0x1df'),'as':_0xc6e6('0x1d6')});db[_0xc6e6('0xe4')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0xc6e6('0x1e0'),'as':_0xc6e6('0x1d8')});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db[_0xc6e6('0x5a')],{});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db[_0xc6e6('0x10a')],{});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db[_0xc6e6('0x58')],{'foreignKey':_0xc6e6('0x1e1'),'as':_0xc6e6('0x1d1')});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1db'),'as':_0xc6e6('0x1d2')});db[_0xc6e6('0xe6')]['belongsTo'](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1d3'),'as':_0xc6e6('0x1d4')});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db[_0xc6e6('0x5c')],{'foreignKey':_0xc6e6('0x1e2'),'as':_0xc6e6('0x1d6')});db[_0xc6e6('0xe6')][_0xc6e6('0x113')](db['OpenchannelAccount'],{'foreignKey':_0xc6e6('0x1e3'),'as':_0xc6e6('0x1d8')});db[_0xc6e6('0xe8')]['belongsTo'](db[_0xc6e6('0x54')],{});db['SmsTransferReport'][_0xc6e6('0x113')](db['SmsInteraction'],{});db[_0xc6e6('0xe8')][_0xc6e6('0x113')](db[_0xc6e6('0x50')],{'foreignKey':'FromSmsAccountId','as':_0xc6e6('0x1d1')});db['SmsTransferReport'][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1db'),'as':_0xc6e6('0x1d2')});db[_0xc6e6('0xe8')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1d3'),'as':'ToAgent'});db[_0xc6e6('0xe8')][_0xc6e6('0x113')](db[_0xc6e6('0x56')],{'foreignKey':_0xc6e6('0x1e4'),'as':_0xc6e6('0x1d6')});db['SmsTransferReport'][_0xc6e6('0x113')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0xc6e6('0x1d8')});db[_0xc6e6('0xea')]['hasMany'](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xc6e6('0xea')]['hasMany'](db[_0xc6e6('0x76')],{'as':'CustomFields','foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xea')]['hasMany'](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x119'),'onDelete':_0xc6e6('0x103'),'foreignKey':_0xc6e6('0x16e')});db['CmList'][_0xc6e6('0x105')](db['CmHopperFinal'],{'as':_0xc6e6('0x108'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xea')][_0xc6e6('0x105')](db[_0xc6e6('0x72')],{'as':_0xc6e6('0x109'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xea')][_0xc6e6('0x105')](db['ReportAgentPreview'],{'as':_0xc6e6('0x74'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xea')][_0xc6e6('0x115')](db['VoiceQueue'],{'as':_0xc6e6('0x1e5'),'through':_0xc6e6('0x14a')});db[_0xc6e6('0xea')][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x11c')});db[_0xc6e6('0xec')][_0xc6e6('0x105')](db[_0xc6e6('0x17')],{'as':'Extensions','onDelete':_0xc6e6('0x103')});db['VoicePrefix'][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x14b'),'through':'UserVoicePrefix'});db[_0xc6e6('0xec')][_0xc6e6('0x115')](db[_0xc6e6('0x11d')],{'through':'TeamVoicePrefix','as':_0xc6e6('0x14c')});db[_0xc6e6('0xee')][_0xc6e6('0x105')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x166'),'foreignKey':_0xc6e6('0x114')});db[_0xc6e6('0xee')]['hasMany'](db[_0xc6e6('0xf0')],{'as':_0xc6e6('0x1e6'),'foreignKey':_0xc6e6('0x114'),'onDelete':_0xc6e6('0x103')});db[_0xc6e6('0xf0')]['hasMany'](db[_0xc6e6('0xf2')],{'as':'Resources','foreignKey':_0xc6e6('0x1e7'),'onDelete':'cascade'});db['WhatsappAccount']['hasMany'](db[_0xc6e6('0x7d')],{'as':_0xc6e6('0x15b'),'foreignKey':'WhatsappAccountId','onDelete':_0xc6e6('0x103')});db[_0xc6e6('0xf5')][_0xc6e6('0x105')](db[_0xc6e6('0x7b')],{'as':_0xc6e6('0x184'),'foreignKey':'WhatsappAccountId'});db[_0xc6e6('0xf5')][_0xc6e6('0x105')](db['WhatsappMessage'],{'as':_0xc6e6('0x151'),'foreignKey':'WhatsappAccountId'});db[_0xc6e6('0xf5')][_0xc6e6('0x105')](db[_0xc6e6('0xf7')],{'as':_0xc6e6('0x171')});db['WhatsappAccount'][_0xc6e6('0x105')](db[_0xc6e6('0xf6')],{'as':_0xc6e6('0x13f')});db[_0xc6e6('0xf5')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0xf5')][_0xc6e6('0x113')](db['Pause'],{'as':_0xc6e6('0x148'),'foreignKey':_0xc6e6('0x149')});db[_0xc6e6('0xf5')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':'user_has_whatsapp_accounts'});db[_0xc6e6('0xf6')][_0xc6e6('0x113')](db['User'],{'onDelete':'restrict'});db[_0xc6e6('0xf6')][_0xc6e6('0x113')](db['WhatsappQueue'],{'onDelete':_0xc6e6('0x16b')});db[_0xc6e6('0xf6')][_0xc6e6('0x113')](db['WhatsappAccount'],{'onDelete':_0xc6e6('0x16b')});db['WhatsappApplication'][_0xc6e6('0x113')](db[_0xc6e6('0x80')],{'onDelete':_0xc6e6('0x16b'),'foreignKey':'IntervalId'});db[_0xc6e6('0xf6')][_0xc6e6('0x113')](db[_0xc6e6('0x8b')],{'onDelete':'restrict','foreignKey':'TagId'});db['WhatsappInteraction']['hasMany'](db[_0xc6e6('0xf9')],{'as':_0xc6e6('0x151'),'onDelete':_0xc6e6('0x103'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction']['belongsTo'](db[_0xc6e6('0xf5')],{'as':_0xc6e6('0x161'),'foreignKey':_0xc6e6('0x1e8')});db['WhatsappInteraction']['belongsTo'](db[_0xc6e6('0x118')],{'as':'Contact','foreignKey':'ContactId'});db[_0xc6e6('0xf7')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x17a'),'foreignKey':'UserId'});db[_0xc6e6('0xf7')]['belongsToMany'](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x1a2'),'as':'Tags'});db[_0xc6e6('0xf7')][_0xc6e6('0x115')](db[_0xc6e6('0x8b')],{'through':_0xc6e6('0x1a2'),'as':_0xc6e6('0x165')});db[_0xc6e6('0xf7')][_0xc6e6('0x115')](db['User'],{'as':_0xc6e6('0x166'),'through':'user_has_whatsapp_interactions','foreignKey':_0xc6e6('0x1e9')});db[_0xc6e6('0xf9')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'as':'User'});db[_0xc6e6('0xf9')]['belongsTo'](db[_0xc6e6('0x118')],{'onDelete':'cascade','as':_0xc6e6('0x156')});db[_0xc6e6('0xf9')][_0xc6e6('0x113')](db[_0xc6e6('0xf7')],{'onDelete':'cascade','as':_0xc6e6('0x168'),'foreignKey':_0xc6e6('0x1e9')});db[_0xc6e6('0xf9')][_0xc6e6('0x113')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xc6e6('0x1e8')});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db[_0xc6e6('0xf5')],{});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db[_0xc6e6('0xea')],{'as':_0xc6e6('0x15d'),'foreignKey':_0xc6e6('0x16e')});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db[_0xc6e6('0x118')],{'as':_0xc6e6('0x156'),'foreignKey':_0xc6e6('0x162')});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db[_0xc6e6('0xf7')],{});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db['WhatsappQueue'],{});db[_0xc6e6('0x1ea')][_0xc6e6('0x113')](db[_0xc6e6('0xf9')],{});db[_0xc6e6('0x1ea')]['belongsTo'](db[_0xc6e6('0x13')],{});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0xf9')],{});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0xf7')],{});db[_0xc6e6('0xfc')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xc6e6('0x1eb'),'as':_0xc6e6('0x1d1')});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0xf5')],{'foreignKey':'ToWhatsappAccountId','as':_0xc6e6('0x1d8')});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0x12e')],{'foreignKey':_0xc6e6('0x1ec'),'as':'ToQueue'});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1db'),'as':_0xc6e6('0x1d2')});db[_0xc6e6('0xfc')][_0xc6e6('0x113')](db[_0xc6e6('0x13')],{'foreignKey':_0xc6e6('0x1d3'),'as':_0xc6e6('0x1d4')});db[_0xc6e6('0x12e')][_0xc6e6('0x115')](db[_0xc6e6('0x13')],{'as':_0xc6e6('0x14b'),'through':_0xc6e6('0x36'),'foreignKey':_0xc6e6('0x1ed')});db[_0xc6e6('0x12e')]['belongsToMany'](db['Team'],{'through':_0xc6e6('0x1c9'),'as':_0xc6e6('0x14c')});module[_0xc6e6('0x1ee')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x91a7=['UserVoicePrefix','hasOne','cascade','UserId','User','hasMany','Recordings','VoiceQueuesRt','Extensions','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','cm_user_has_contacts','Lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','MailQueue','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkBackup','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceRecording','VoiceMailMessage','Messages','mailbox','mailboxuser','uniqueid','VoiceAgentReport','Contact','MailAccountId','MailServerOut','Dispositions','Answers','Interactions','List','ListId','team_has_mail_queues','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','DashboardItem','Items','FaxAccountId','Exntensions','user_has_fax_accounts','fax_interaction_has_tags','ThroughTags','FaxInteractionId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','SmsInteractionId','sms_interaction_has_tags','Tags','user_has_sms_interactions','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','OpenchannelQueueReport','Agent','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','AttachmentId','team_has_chat_queues','ChatGroupId','Website','CompanyId','Company','cm_contact_has_tags','Queue','Campaign','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','SmsApplications','Schedule','AnalyticDefaultReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','DefaultReportId','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Field','VariableId','ZohoAccount','ZohoConfiguration','ZohoField','Descriptions','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FreshsalesAccount','FreshsalesConfiguration','ChatQueueReport','FromId','ToId','SessionId','ProjectId','VoicePrefixes','TrunkId','TrunkBackupId','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','Contacts','HopperHistory','Queues','UserProfileSection','Resources','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','sequelize','lodash','jstz','xC@LL1234','127.0.0.1','utf8mb4','utf8','utf8_general_ci','defaultsDeep','sequelizeHistory','motion2','xcall','mysql','database','username','options','password','../api/user/user.model','VoiceChanSpy','import','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','SmsAccount','SmsInteraction','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','ChatApplication','../api/chatApplication/chatApplication.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','AnalyticMetric','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../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/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix'];(function(_0x5458ff,_0x57b69d){var _0x2da83a=function(_0x2c827e){while(--_0x2c827e){_0x5458ff['push'](_0x5458ff['shift']());}};_0x2da83a(++_0x57b69d);}(_0x91a7,0xe7));var _0x791a=function(_0x21ad00,_0x1b0486){_0x21ad00=_0x21ad00-0x0;var _0x1b99ea=_0x91a7[_0x21ad00];return _0x1b99ea;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x791a('0x0'));var _=require(_0x791a('0x1'));var jstz=require(_0x791a('0x2'));var timezone=jstz['determine']();config[_0x791a('0x0')]=_['defaultsDeep'](config[_0x791a('0x0')],{'database':'motion2','username':'xcall','password':_0x791a('0x3'),'options':{'host':_0x791a('0x4'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x791a('0x5')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x791a('0x6'),'collate':_0x791a('0x7')}}});config['sequelizeHistory']=_[_0x791a('0x8')](config[_0x791a('0x9')],{'database':_0x791a('0xa'),'username':_0x791a('0xb'),'password':_0x791a('0x3'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x791a('0xc'),'dialectOptions':{'charset':_0x791a('0x5')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x791a('0x6'),'collate':_0x791a('0x7')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x791a('0x0')][_0x791a('0xd')],config[_0x791a('0x0')][_0x791a('0xe')],config['sequelize']['password'],config[_0x791a('0x0')][_0x791a('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x791a('0xd')],config[_0x791a('0x9')]['username'],config[_0x791a('0x9')][_0x791a('0x10')],config[_0x791a('0x9')][_0x791a('0xf')])};db['User']=db[_0x791a('0x0')]['import'](_0x791a('0x11'));db[_0x791a('0x12')]=db['sequelize'][_0x791a('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x791a('0x14')]=db['sequelize']['import']('../api/voiceContext/voiceContext.model');db[_0x791a('0x15')]=db['sequelize']['import'](_0x791a('0x16'));db[_0x791a('0x17')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x791a('0x18')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x19'));db['VoiceRecording']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x1a'));db[_0x791a('0x1b')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x1c'));db[_0x791a('0x1d')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x1e'));db['VoiceMailMessage']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x1f'));db[_0x791a('0x20')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x21'));db['VoiceDialReport']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x22'));db['VoiceAgentReport']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x23'));db[_0x791a('0x24')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x25'));db[_0x791a('0x26')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x27'));db[_0x791a('0x28')]=db['sequelize'][_0x791a('0x13')]('../api/trunk/trunk.model');db[_0x791a('0x29')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x2a'));db[_0x791a('0x2b')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x791a('0x2c')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x2d'));db[_0x791a('0x2e')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x2f'));db[_0x791a('0x30')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0x791a('0x31')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x32'));db[_0x791a('0x33')]=db['sequelize'][_0x791a('0x13')]('../api/userSmsQueue/userSmsQueue.model');db[_0x791a('0x34')]=db['sequelize']['import'](_0x791a('0x35'));db[_0x791a('0x36')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x37'));db[_0x791a('0x38')]=db[_0x791a('0x0')]['import'](_0x791a('0x39'));db['MailServerOut']=db[_0x791a('0x0')]['import'](_0x791a('0x3a'));db[_0x791a('0x3b')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x3c'));db['MailQueue']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x3d'));db[_0x791a('0x3e')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x3f'));db[_0x791a('0x40')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x791a('0x41')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/mailMessage/mailMessage.model');db[_0x791a('0x42')]=db['sequelize']['import']('../api/mailApplication/mailApplication.model');db[_0x791a('0x43')]=db[_0x791a('0x0')]['import'](_0x791a('0x44'));db[_0x791a('0x45')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0x791a('0x13')](_0x791a('0x46'));db['FaxAccount']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x47'));db[_0x791a('0x48')]=db['sequelize'][_0x791a('0x13')]('../api/faxApplication/faxApplication.model');db[_0x791a('0x49')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x4a'));db[_0x791a('0x4b')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x4c'));db[_0x791a('0x4d')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/faxQueue/faxQueue.model');db[_0x791a('0x4e')]=db[_0x791a('0x0')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x791a('0x4f')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0x791a('0x0')][_0x791a('0x13')]('../api/smsApplication/smsApplication.model');db[_0x791a('0x50')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x51'));db[_0x791a('0x52')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x53'));db[_0x791a('0x54')]=db[_0x791a('0x0')]['import'](_0x791a('0x55'));db[_0x791a('0x56')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x57'));db[_0x791a('0x58')]=db[_0x791a('0x0')]['import'](_0x791a('0x59'));db[_0x791a('0x5a')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x5b'));db['OpenchannelQueue']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x5c'));db[_0x791a('0x5d')]=db[_0x791a('0x0')]['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x791a('0x0')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x791a('0x5e')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x5f'));db['ChatInteraction']=db['sequelize'][_0x791a('0x13')]('../api/chatInteraction/chatInteraction.model');db[_0x791a('0x60')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/chatMessage/chatMessage.model');db[_0x791a('0x61')]=db[_0x791a('0x0')]['import'](_0x791a('0x62'));db[_0x791a('0x63')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x64'));db[_0x791a('0x65')]=db['sequelize']['import'](_0x791a('0x66'));db['ChatProactiveAction']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x67'));db[_0x791a('0x68')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x69'));db['CmContact']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x6a'));db[_0x791a('0x6b')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x6c'));db['CmHopperBlack']=db[_0x791a('0x0')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x791a('0x6d')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x6e'));db[_0x791a('0x6f')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x70'));db[_0x791a('0x71')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x72'));db[_0x791a('0x73')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x74'));db[_0x791a('0x75')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x76'));db['Automation']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x77'));db[_0x791a('0x78')]=db[_0x791a('0x0')]['import'](_0x791a('0x79'));db[_0x791a('0x7a')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/disposition/disposition.model');db[_0x791a('0x7b')]=db['sequelize']['import']('../api/condition/condition.model');db['Interval']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x7c'));db[_0x791a('0x7d')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x7e'));db['Cdr']=db['sequelize'][_0x791a('0x13')](_0x791a('0x7f'));db['VoiceQueuesLog']=db['sequelize'][_0x791a('0x13')](_0x791a('0x80'));db['Schedule']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x81'));db[_0x791a('0x82')]=db['sequelize']['import'](_0x791a('0x83'));db[_0x791a('0x84')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x85'));db[_0x791a('0x86')]=db[_0x791a('0x0')]['import'](_0x791a('0x87'));db[_0x791a('0x88')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x89'));db[_0x791a('0x8a')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/variable/variable.model');db['Integration']=db['sequelize'][_0x791a('0x13')](_0x791a('0x8b'));db[_0x791a('0x8c')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x8d'));db[_0x791a('0x8e')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x8f'));db['AnalyticDefaultReport']=db[_0x791a('0x0')][_0x791a('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x791a('0x90')]=db[_0x791a('0x0')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x791a('0x91')]=db[_0x791a('0x0')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x791a('0x92')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x791a('0x93')]=db['sequelize'][_0x791a('0x13')](_0x791a('0x94'));db[_0x791a('0x95')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x96'));db['SalesforceConfiguration']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x97'));db[_0x791a('0x98')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x99'));db[_0x791a('0x9a')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x9b'));db[_0x791a('0x9c')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0x9d'));db[_0x791a('0x9e')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x791a('0x9f')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xa0'));db[_0x791a('0xa1')]=db['sequelize'][_0x791a('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x791a('0xa2')]=db['sequelize'][_0x791a('0x13')](_0x791a('0xa3'));db['ZohoAccount']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xa4'));db['ZohoConfiguration']=db[_0x791a('0x0')]['import'](_0x791a('0xa5'));db['ZohoField']=db['sequelize']['import'](_0x791a('0xa6'));db[_0x791a('0xa7')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x791a('0xa8')]=db[_0x791a('0x0')]['import'](_0x791a('0xa9'));db[_0x791a('0xaa')]=db[_0x791a('0x0')]['import']('../api/intZendeskField/intZendeskField.model');db[_0x791a('0xab')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xac'));db[_0x791a('0xad')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xae'));db['FreshdeskField']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xaf'));db[_0x791a('0xb0')]=db['sequelize']['import'](_0x791a('0xb1'));db[_0x791a('0xb2')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xb3'));db[_0x791a('0xb4')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xb5'));db[_0x791a('0xb6')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xb7'));db['ServicenowConfiguration']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xb8'));db[_0x791a('0xb9')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xba'));db[_0x791a('0xbb')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x791a('0xbc')]=db[_0x791a('0x0')]['import'](_0x791a('0xbd'));db[_0x791a('0xbe')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xbf'));db['FreshsalesAccount']=db['sequelize'][_0x791a('0x13')](_0x791a('0xc0'));db['FreshsalesConfiguration']=db['sequelize'][_0x791a('0x13')](_0x791a('0xc1'));db[_0x791a('0xc2')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xc3'));db[_0x791a('0xc4')]=db[_0x791a('0x0')]['import']('../api/integration/integration.model');db['Network']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xc5'));db['ChatQueueReport']=db['sequelize'][_0x791a('0x13')](_0x791a('0xc6'));db[_0x791a('0xc7')]=db[_0x791a('0x0')]['import'](_0x791a('0xc8'));db[_0x791a('0xc9')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xca'));db[_0x791a('0xcb')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xcc'));db[_0x791a('0xcd')]=db[_0x791a('0x0')]['import'](_0x791a('0xce'));db[_0x791a('0xcf')]=db[_0x791a('0x0')]['import']('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xd0'));db[_0x791a('0xd1')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0x791a('0xd2')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0x791a('0xd3')]=db[_0x791a('0x0')]['import'](_0x791a('0xd4'));db['SquareOdbc']=db[_0x791a('0x0')]['import'](_0x791a('0xd5'));db['SquareProject']=db['sequelize']['import']('../api/squareProject/squareProject.model');db[_0x791a('0xd6')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/squareRecording/squareRecording.model');db[_0x791a('0xd7')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xd8'));db[_0x791a('0xd9')]=db['sequelize']['import'](_0x791a('0xda'));db[_0x791a('0xdb')]=db[_0x791a('0x0')]['import'](_0x791a('0xdc'));db['Campaign']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xdd'));db['Migration']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xde'));db['Attachment']=db['sequelize'][_0x791a('0x13')](_0x791a('0xdf'));db[_0x791a('0xe0')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/plugin/plugin.model');db['MailTransferReport']=db['sequelize']['import'](_0x791a('0xe1'));db['ChatTransferReport']=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xe2'));db[_0x791a('0xe3')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xe4'));db[_0x791a('0xe5')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xe6'));db['SmsTransferReport']=db[_0x791a('0x0')][_0x791a('0x13')]('../api/smsTransferReport/smsTransferReport.model');db[_0x791a('0xe7')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/cmList/cmList.model');db[_0x791a('0xe8')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0x791a('0xe9')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xea'));db['UserProfileSection']=db['sequelize']['import']('../api/userProfileSection/userProfileSection.model');db[_0x791a('0xeb')]=db[_0x791a('0x0')]['import'](_0x791a('0xec'));db[_0x791a('0xed')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xee'));db[_0x791a('0xef')]=db[_0x791a('0x0')]['import'](_0x791a('0xf0'));db[_0x791a('0xf1')]=db['sequelize'][_0x791a('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x791a('0xf2')]=db[_0x791a('0x0')][_0x791a('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x791a('0xf3')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xf4'));db[_0x791a('0xf5')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xf6'));db[_0x791a('0xf7')]=db[_0x791a('0x0')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x791a('0xf8')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xf9'));db[_0x791a('0xfa')]=db['sequelize']['import'](_0x791a('0xfb'));db[_0x791a('0xfc')]=db[_0x791a('0x0')][_0x791a('0x13')](_0x791a('0xfd'));db[_0x791a('0xfe')]=db['sequelize'][_0x791a('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x791a('0xff')]=db['sequelize'][_0x791a('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db['User'][_0x791a('0x100')](db[_0x791a('0x1d')],{'as':_0x791a('0x1d'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x103')][_0x791a('0x104')](db['VoiceRecording'],{'as':_0x791a('0x105'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x103')][_0x791a('0x104')](db[_0x791a('0x2b')],{'as':_0x791a('0x106'),'foreignKey':'UserId'});db[_0x791a('0x103')]['hasMany'](db['VoiceExtension'],{'as':_0x791a('0x107'),'onDelete':'cascade','hooks':!![]});db[_0x791a('0x103')]['hasMany'](db[_0x791a('0x6d')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x791a('0x103')][_0x791a('0x104')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x791a('0x103')][_0x791a('0x104')](db[_0x791a('0x71')],{'as':_0x791a('0x71'),'foreignKey':_0x791a('0x102')});db['User']['hasMany'](db[_0x791a('0x58')],{'as':_0x791a('0x108'),'foreignKey':'UserId'});db[_0x791a('0x103')]['hasMany'](db[_0x791a('0x109')],{'as':_0x791a('0x10a'),'foreignKey':'UserId'});db[_0x791a('0x103')][_0x791a('0x104')](db[_0x791a('0x50')],{'as':_0x791a('0x10b'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x103')][_0x791a('0x104')](db['FaxInteraction'],{'as':_0x791a('0x10c'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x103')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x791a('0x102')});db[_0x791a('0x103')][_0x791a('0x104')](db[_0x791a('0xf2')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db['User'][_0x791a('0x104')](db[_0x791a('0xed')],{'as':_0x791a('0x10d'),'foreignKey':'SenderId'});db[_0x791a('0x103')][_0x791a('0x10e')](db[_0x791a('0xe9')],{'as':'UserProfile','foreignKey':_0x791a('0x10f')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x65')],{'as':_0x791a('0x111'),'through':_0x791a('0x112')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x113')],{'as':'Contacts','through':_0x791a('0x114')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xe7')],{'as':_0x791a('0x115'),'through':'cm_user_has_lists'});db[_0x791a('0x103')][_0x791a('0x110')](db['Team'],{'through':_0x791a('0x116')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x40')],{'as':_0x791a('0x117'),'through':_0x791a('0x118')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x109')],{'as':_0x791a('0x10a'),'through':_0x791a('0x119')});db[_0x791a('0x103')][_0x791a('0x110')](db['FaxInteraction'],{'as':_0x791a('0x10c'),'through':_0x791a('0x11a')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x50')],{'as':_0x791a('0x10b'),'through':'user_has_sms_interactions'});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x58')],{'as':_0x791a('0x108'),'through':_0x791a('0x11b')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xf2')],{'as':_0x791a('0x11c'),'through':_0x791a('0x11d')});db['User'][_0x791a('0x110')](db[_0x791a('0x18')],{'as':_0x791a('0x11e'),'through':'UserVoiceQueue','required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xe8')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x11f')],{'as':_0x791a('0x120'),'through':_0x791a('0x30'),'required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x63')],{'as':_0x791a('0x121'),'through':_0x791a('0x2e'),'required':![],'hooks':!![]});db[_0x791a('0x103')]['belongsToMany'](db[_0x791a('0x4d')],{'as':_0x791a('0x122'),'through':_0x791a('0x31'),'required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x52')],{'as':_0x791a('0x123'),'through':_0x791a('0x33'),'required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x124')],{'as':_0x791a('0x125'),'through':_0x791a('0x34'),'required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xf8')],{'as':_0x791a('0x126'),'through':'UserWhatsappQueue','required':![]});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xe7')],{'through':_0x791a('0x127')});db[_0x791a('0x103')]['belongsToMany'](db[_0x791a('0x5d')],{'as':_0x791a('0x128'),'through':_0x791a('0x129')});db['User']['belongsToMany'](db[_0x791a('0x12a')],{'as':_0x791a('0x12b'),'through':'user_has_fax_accounts'});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x3b')],{'as':_0x791a('0x12c'),'through':_0x791a('0x12d')});db['User']['belongsToMany'](db[_0x791a('0x54')],{'as':_0x791a('0x12e'),'through':_0x791a('0x12f')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x4f')],{'as':_0x791a('0x130'),'through':_0x791a('0x131')});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0xef')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x791a('0x103')][_0x791a('0x110')](db[_0x791a('0x132')],{'as':_0x791a('0x133'),'through':_0x791a('0x134')});db['VoiceChanSpy'][_0x791a('0x104')](db[_0x791a('0x15')],{'as':_0x791a('0x135'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x136')});db[_0x791a('0x14')][_0x791a('0x104')](db['VoiceExtension'],{'onDelete':_0x791a('0x101')});db[_0x791a('0x15')][_0x791a('0x104')](db[_0x791a('0x15')],{'as':_0x791a('0x137'),'onDelete':'cascade'});db['VoiceMusicOnHold']['belongsToMany'](db[_0x791a('0x82')],{'as':_0x791a('0x138'),'through':_0x791a('0x139')});db[_0x791a('0x18')][_0x791a('0x104')](db['UserVoiceQueueRt'],{'as':_0x791a('0x13a'),'foreignKey':_0x791a('0x13b')});db['VoiceQueue'][_0x791a('0x104')](db['CmHopper'],{'as':'Hoppers','foreignKey':'VoiceQueueId'});db[_0x791a('0x18')][_0x791a('0x104')](db[_0x791a('0x6d')],{'as':_0x791a('0x13c'),'foreignKey':_0x791a('0x13b')});db[_0x791a('0x18')][_0x791a('0x104')](db[_0x791a('0x6f')],{'as':_0x791a('0x13d'),'foreignKey':_0x791a('0x13b')});db['VoiceQueue'][_0x791a('0x104')](db[_0x791a('0x71')],{'as':_0x791a('0x71'),'foreignKey':'VoiceQueueId'});db[_0x791a('0x18')][_0x791a('0x104')](db[_0x791a('0x13e')],{'as':_0x791a('0x13f'),'foreignKey':'VoiceQueueId'});db[_0x791a('0x18')][_0x791a('0x104')](db['JscriptySessionReport'],{'as':_0x791a('0x140'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x791a('0x10e')](db[_0x791a('0x28')],{'as':_0x791a('0x28'),'foreignKey':'TrunkId'});db['VoiceQueue'][_0x791a('0x10e')](db[_0x791a('0x28')],{'as':_0x791a('0x141'),'foreignKey':'TrunkBackupId'});db[_0x791a('0x18')][_0x791a('0x10e')](db[_0x791a('0x142')],{'as':'Interval','foreignKey':_0x791a('0x143')});db[_0x791a('0x18')][_0x791a('0x10e')](db['Pause'],{'as':_0x791a('0x144'),'foreignKey':_0x791a('0x145')});db[_0x791a('0x18')][_0x791a('0x110')](db[_0x791a('0xe7')],{'as':_0x791a('0x115'),'through':_0x791a('0x146')});db[_0x791a('0x18')]['belongsToMany'](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x2c')});db['VoiceQueue'][_0x791a('0x110')](db['Team'],{'as':_0x791a('0x148'),'through':_0x791a('0xfc')});db[_0x791a('0x18')][_0x791a('0x110')](db['CmList'],{'as':_0x791a('0x149'),'through':_0x791a('0x14a')});db[_0x791a('0x14b')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x103'),'foreignKey':_0x791a('0x102')});db['ScreenRecording'][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x103'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x1d')][_0x791a('0x104')](db[_0x791a('0x14c')],{'as':_0x791a('0x14d'),'onDelete':_0x791a('0x101'),'foreignKey':'mailboxuser','sourceKey':_0x791a('0x14e')});db[_0x791a('0x14c')][_0x791a('0x10e')](db['VoiceMail'],{'foreignKey':_0x791a('0x14f'),'targetKey':_0x791a('0x14e')});db[_0x791a('0x20')][_0x791a('0x104')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x791a('0x150'),'constraints':![]});db[_0x791a('0x20')][_0x791a('0x104')](db[_0x791a('0x151')],{'as':'AgentReports','foreignKey':_0x791a('0x150'),'constraints':![]});db[_0x791a('0x20')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x103'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x20')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':'ContactId'});db[_0x791a('0x38')][_0x791a('0x10e')](db[_0x791a('0x3b')],{'as':'MailAccount','foreignKey':_0x791a('0x153')});db[_0x791a('0x154')][_0x791a('0x10e')](db[_0x791a('0x3b')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x791a('0x3b')][_0x791a('0x100')](db[_0x791a('0x38')],{'as':'Imap','onDelete':'cascade'});db[_0x791a('0x3b')][_0x791a('0x100')](db[_0x791a('0x154')],{'as':'Smtp','onDelete':_0x791a('0x101')});db[_0x791a('0x3b')][_0x791a('0x104')](db['Disposition'],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x153'),'onDelete':'cascade'});db[_0x791a('0x3b')][_0x791a('0x104')](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':_0x791a('0x153')});db[_0x791a('0x3b')]['hasMany'](db[_0x791a('0x41')],{'as':_0x791a('0x14d'),'foreignKey':_0x791a('0x153')});db['MailAccount'][_0x791a('0x104')](db[_0x791a('0x40')],{'as':_0x791a('0x157')});db['MailAccount']['hasMany'](db['MailApplication'],{'as':_0x791a('0x137')});db[_0x791a('0x3b')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db[_0x791a('0x3b')]['belongsTo'](db[_0x791a('0x86')],{'as':_0x791a('0x86'),'foreignKey':'TemplateId'});db['MailAccount'][_0x791a('0x10e')](db[_0x791a('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x791a('0x3b')][_0x791a('0x110')](db['User'],{'as':_0x791a('0x147'),'through':_0x791a('0x12d')});db['MailQueue'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x30')});db[_0x791a('0x11f')][_0x791a('0x110')](db[_0x791a('0xd9')],{'through':_0x791a('0x15a'),'as':_0x791a('0x148')});db[_0x791a('0x40')][_0x791a('0x104')](db[_0x791a('0x41')],{'as':_0x791a('0x14d'),'onDelete':'cascade','foreignKey':_0x791a('0x15b')});db[_0x791a('0x40')][_0x791a('0x10e')](db['MailAccount'],{'as':_0x791a('0x15c'),'foreignKey':'MailAccountId'});db[_0x791a('0x40')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x40')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x15e'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x40')][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x15f'),'as':'Tags'});db['MailInteraction']['belongsToMany'](db[_0x791a('0x84')],{'through':_0x791a('0x15f'),'as':'ThroughTags'});db['MailInteraction'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x160'),'through':_0x791a('0x118'),'foreignKey':_0x791a('0x15b')});db[_0x791a('0x41')]['hasMany'](db[_0x791a('0x161')],{'as':_0x791a('0x162'),'onDelete':_0x791a('0x101')});db['MailMessage'][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x103')});db[_0x791a('0x41')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x152')});db['MailMessage']['belongsTo'](db[_0x791a('0x40')],{'as':_0x791a('0x163'),'foreignKey':_0x791a('0x15b')});db[_0x791a('0x41')][_0x791a('0x10e')](db['MailAccount'],{'as':_0x791a('0x15c'),'foreignKey':'MailAccountId'});db[_0x791a('0x41')][_0x791a('0x10e')](db[_0x791a('0x5d')],{'as':_0x791a('0x5d'),'foreignKey':_0x791a('0x164')});db[_0x791a('0x41')]['belongsTo'](db[_0x791a('0x61')],{'as':_0x791a('0x61'),'foreignKey':_0x791a('0x165')});db[_0x791a('0x42')]['belongsTo'](db[_0x791a('0x103')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x42')][_0x791a('0x10e')](db[_0x791a('0x11f')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x42')][_0x791a('0x10e')](db[_0x791a('0x3b')],{'onDelete':_0x791a('0x166')});db['MailApplication'][_0x791a('0x10e')](db['Interval'],{'onDelete':_0x791a('0x166'),'foreignKey':'IntervalId'});db[_0x791a('0x42')][_0x791a('0x10e')](db[_0x791a('0x84')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x167')});db[_0x791a('0x43')][_0x791a('0x10e')](db[_0x791a('0x3b')],{});db[_0x791a('0x43')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':'ListId'});db[_0x791a('0x43')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':'ContactId'});db[_0x791a('0x43')][_0x791a('0x10e')](db['MailInteraction'],{});db['MailQueueReport'][_0x791a('0x10e')](db[_0x791a('0x41')],{});db[_0x791a('0x43')]['belongsTo'](db[_0x791a('0x103')],{});db[_0x791a('0x43')][_0x791a('0x10e')](db[_0x791a('0x11f')],{});db[_0x791a('0x45')][_0x791a('0x104')](db[_0x791a('0x168')],{'as':_0x791a('0x169'),'onDelete':_0x791a('0x101')});db[_0x791a('0x12a')][_0x791a('0x104')](db[_0x791a('0x7a')],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x16a'),'onDelete':'cascade'});db[_0x791a('0x12a')][_0x791a('0x104')](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':'FaxAccountId'});db[_0x791a('0x12a')]['hasMany'](db[_0x791a('0x49')],{'as':_0x791a('0x157')});db['FaxAccount'][_0x791a('0x104')](db['FaxApplication'],{'as':'Applications'});db[_0x791a('0x12a')][_0x791a('0x104')](db['VoiceExtension'],{'as':_0x791a('0x16b'),'onDelete':_0x791a('0x101')});db[_0x791a('0x12a')]['hasMany'](db[_0x791a('0x4b')],{'as':_0x791a('0x14d')});db[_0x791a('0x12a')]['belongsTo'](db[_0x791a('0x28')],{'as':_0x791a('0x28')});db[_0x791a('0x12a')]['belongsTo'](db['CmList'],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db[_0x791a('0x12a')]['belongsTo'](db['Pause'],{'as':_0x791a('0x144'),'foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x16c')});db[_0x791a('0x48')][_0x791a('0x10e')](db[_0x791a('0x103')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x48')][_0x791a('0x10e')](db[_0x791a('0x4d')],{'onDelete':_0x791a('0x166')});db['FaxApplication'][_0x791a('0x10e')](db['FaxAccount'],{'onDelete':_0x791a('0x166')});db['FaxApplication'][_0x791a('0x10e')](db[_0x791a('0x84')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x167')});db[_0x791a('0x49')][_0x791a('0x104')](db[_0x791a('0x4b')],{'as':'Messages','onDelete':_0x791a('0x101'),'foreignKey':'FaxInteractionId'});db[_0x791a('0x49')][_0x791a('0x10e')](db[_0x791a('0x12a')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x16a')});db[_0x791a('0x49')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':'ContactId'});db[_0x791a('0x49')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x15e'),'foreignKey':'UserId'});db['FaxInteraction']['belongsToMany'](db[_0x791a('0x84')],{'through':_0x791a('0x16d'),'as':'Tags'});db[_0x791a('0x49')][_0x791a('0x110')](db['Tag'],{'through':_0x791a('0x16d'),'as':_0x791a('0x16e')});db[_0x791a('0x49')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':'Users','through':_0x791a('0x11a'),'foreignKey':_0x791a('0x16f')});db[_0x791a('0x4b')][_0x791a('0x10e')](db['User'],{'onDelete':_0x791a('0x101'),'as':'User'});db[_0x791a('0x4b')][_0x791a('0x10e')](db[_0x791a('0x49')],{'as':_0x791a('0x163'),'foreignKey':_0x791a('0x16f')});db[_0x791a('0x4b')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':_0x791a('0x101'),'as':'Contact'});db[_0x791a('0x4b')][_0x791a('0x10e')](db[_0x791a('0x161')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x791a('0x4b')]['belongsTo'](db[_0x791a('0x12a')],{'as':'Account','foreignKey':_0x791a('0x16a')});db[_0x791a('0x4d')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':'UserFaxQueue'});db[_0x791a('0x4d')][_0x791a('0x110')](db[_0x791a('0xd9')],{'through':_0x791a('0x170'),'as':_0x791a('0x148')});db[_0x791a('0x4e')]['belongsTo'](db[_0x791a('0x12a')],{});db[_0x791a('0x4e')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':'ListId'});db[_0x791a('0x4e')][_0x791a('0x10e')](db['CmContact'],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x4e')][_0x791a('0x10e')](db[_0x791a('0x49')],{});db[_0x791a('0x4e')][_0x791a('0x10e')](db[_0x791a('0x4b')],{});db[_0x791a('0x4e')][_0x791a('0x10e')](db['User'],{});db['FaxQueueReport'][_0x791a('0x10e')](db['FaxQueue'],{});db[_0x791a('0x4f')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x791a('0x171'),'onDelete':_0x791a('0x101')});db[_0x791a('0x4f')][_0x791a('0x104')](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':'SmsAccountId'});db[_0x791a('0x4f')][_0x791a('0x104')](db[_0x791a('0x172')],{'as':'Messages','foreignKey':_0x791a('0x171')});db['SmsAccount']['hasMany'](db[_0x791a('0x50')],{'as':_0x791a('0x157')});db[_0x791a('0x4f')][_0x791a('0x104')](db['SmsApplication'],{'as':_0x791a('0x137')});db[_0x791a('0x4f')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':'List','foreignKey':_0x791a('0x159')});db[_0x791a('0x4f')][_0x791a('0x10e')](db['Pause'],{'as':_0x791a('0x144'),'foreignKey':_0x791a('0x145')});db[_0x791a('0x4f')]['belongsToMany'](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x131')});db[_0x791a('0x173')][_0x791a('0x10e')](db[_0x791a('0x103')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x173')][_0x791a('0x10e')](db[_0x791a('0x52')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x173')][_0x791a('0x10e')](db[_0x791a('0x4f')],{'onDelete':_0x791a('0x166')});db['SmsApplication'][_0x791a('0x10e')](db['Interval'],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x143')});db[_0x791a('0x173')][_0x791a('0x10e')](db[_0x791a('0x84')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x791a('0x50')][_0x791a('0x104')](db[_0x791a('0x172')],{'as':_0x791a('0x14d'),'onDelete':'cascade','foreignKey':_0x791a('0x174')});db['SmsInteraction'][_0x791a('0x10e')](db[_0x791a('0x4f')],{'as':_0x791a('0x15c'),'foreignKey':'SmsAccountId'});db['SmsInteraction']['belongsTo'](db[_0x791a('0x113')],{'as':'Contact','foreignKey':_0x791a('0x15d')});db[_0x791a('0x50')][_0x791a('0x10e')](db['User'],{'as':'Owner','foreignKey':_0x791a('0x102')});db[_0x791a('0x50')][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x175'),'as':_0x791a('0x176')});db[_0x791a('0x50')]['belongsToMany'](db[_0x791a('0x84')],{'through':'sms_interaction_has_tags','as':_0x791a('0x16e')});db[_0x791a('0x50')][_0x791a('0x110')](db['User'],{'as':_0x791a('0x160'),'through':_0x791a('0x177'),'foreignKey':_0x791a('0x174')});db[_0x791a('0x172')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':'User'});db[_0x791a('0x172')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':_0x791a('0x101'),'as':'Contact'});db[_0x791a('0x172')][_0x791a('0x10e')](db[_0x791a('0x50')],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x163'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x791a('0x10e')](db[_0x791a('0x4f')],{'as':_0x791a('0x15c'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x791a('0x52')][_0x791a('0x110')](db['Team'],{'through':'team_has_sms_queues','as':'Teams'});db['OpenchannelAccount']['hasMany'](db[_0x791a('0x7a')],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x178'),'onDelete':_0x791a('0x101')});db[_0x791a('0x54')][_0x791a('0x104')](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x791a('0x104')](db[_0x791a('0x58')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0x791a('0x54')]['hasMany'](db[_0x791a('0x5a')],{'as':_0x791a('0x14d'),'foreignKey':_0x791a('0x178')});db[_0x791a('0x54')][_0x791a('0x104')](db[_0x791a('0x56')],{'as':'Applications','foreignKey':_0x791a('0x178')});db[_0x791a('0x54')][_0x791a('0x10e')](db['CmList'],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db[_0x791a('0x54')][_0x791a('0x10e')](db[_0x791a('0x7d')],{'as':_0x791a('0x144'),'foreignKey':_0x791a('0x145')});db['OpenchannelAccount'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x12f')});db[_0x791a('0x56')]['belongsTo'](db[_0x791a('0x103')],{'onDelete':_0x791a('0x166')});db[_0x791a('0x56')][_0x791a('0x10e')](db[_0x791a('0x124')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x179')});db['OpenchannelApplication'][_0x791a('0x10e')](db[_0x791a('0x54')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x178')});db[_0x791a('0x56')][_0x791a('0x10e')](db[_0x791a('0x142')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x143')});db[_0x791a('0x56')][_0x791a('0x10e')](db[_0x791a('0x84')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x167')});db[_0x791a('0x58')]['hasMany'](db['OpenchannelMessage'],{'as':_0x791a('0x14d'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x17a')});db[_0x791a('0x58')][_0x791a('0x10e')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x791a('0x178')});db[_0x791a('0x58')]['belongsTo'](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db['OpenchannelInteraction']['belongsTo'](db[_0x791a('0x103')],{'as':_0x791a('0x15e'),'foreignKey':_0x791a('0x102')});db['OpenchannelInteraction'][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x17b'),'as':_0x791a('0x176')});db[_0x791a('0x58')][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x17b'),'as':_0x791a('0x16e')});db[_0x791a('0x58')]['belongsToMany'](db['User'],{'as':'Users','through':_0x791a('0x11b'),'foreignKey':_0x791a('0x17a')});db['OpenchannelMessage']['belongsTo'](db['User'],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x103')});db[_0x791a('0x5a')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x152')});db[_0x791a('0x5a')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x163'),'foreignKey':_0x791a('0x17a')});db[_0x791a('0x5a')][_0x791a('0x10e')](db[_0x791a('0x161')],{'as':_0x791a('0x161'),'foreignKey':'AttachmentId'});db[_0x791a('0x5a')][_0x791a('0x10e')](db[_0x791a('0x54')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x178')});db['OpenchannelQueue'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x34'),'foreignKey':_0x791a('0x179')});db[_0x791a('0x124')][_0x791a('0x110')](db[_0x791a('0xd9')],{'through':_0x791a('0x17c'),'as':_0x791a('0x148')});db[_0x791a('0x5d')][_0x791a('0x104')](db[_0x791a('0x7a')],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x164'),'onDelete':_0x791a('0x101')});db[_0x791a('0x5d')]['hasMany'](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':_0x791a('0x164')});db['ChatWebsite'][_0x791a('0x104')](db[_0x791a('0x17d')],{'as':'ProactiveActions'});db[_0x791a('0x5d')][_0x791a('0x104')](db[_0x791a('0x109')],{'as':_0x791a('0x157')});db[_0x791a('0x5d')][_0x791a('0x104')](db[_0x791a('0x5e')],{'as':_0x791a('0x137')});db[_0x791a('0x5d')]['hasMany'](db[_0x791a('0x60')],{'as':_0x791a('0x14d')});db['ChatWebsite'][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db['ChatWebsite'][_0x791a('0x10e')](db['Interval'],{'as':_0x791a('0x142'),'foreignKey':'IntervalId'});db[_0x791a('0x5d')][_0x791a('0x10e')](db[_0x791a('0x3b')],{'as':_0x791a('0x3b'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0x791a('0x10e')](db['Pause'],{'as':_0x791a('0x144'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x791a('0x5d')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x129')});db['OpenchannelQueueReport']['belongsTo'](db[_0x791a('0x54')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':'ListId'});db[_0x791a('0x17e')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x17e')][_0x791a('0x10e')](db['OpenchannelInteraction'],{});db[_0x791a('0x17e')][_0x791a('0x10e')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0x791a('0x10e')](db['User'],{});db[_0x791a('0x17e')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x791a('0x5e')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x17f'),'foreignKey':_0x791a('0x102'),'onDelete':'restrict'});db[_0x791a('0x5e')][_0x791a('0x10e')](db[_0x791a('0x63')],{'as':'Queue','foreignKey':_0x791a('0x180'),'onDelete':'restrict'});db[_0x791a('0x5e')][_0x791a('0x10e')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x791a('0x164'),'onDelete':_0x791a('0x166')});db[_0x791a('0x5e')][_0x791a('0x10e')](db[_0x791a('0x84')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x167')});db[_0x791a('0x109')][_0x791a('0x104')](db[_0x791a('0x60')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x791a('0x181')});db[_0x791a('0x109')][_0x791a('0x10e')](db[_0x791a('0x5d')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x164')});db[_0x791a('0x109')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x109')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x15e'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x109')][_0x791a('0x110')](db['Tag'],{'through':_0x791a('0x182'),'as':_0x791a('0x176')});db[_0x791a('0x109')]['belongsToMany'](db[_0x791a('0x84')],{'through':_0x791a('0x182'),'as':_0x791a('0x16e')});db[_0x791a('0x109')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x160'),'through':'user_has_chat_interactions','foreignKey':_0x791a('0x181')});db[_0x791a('0x60')][_0x791a('0x10e')](db['User'],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x103')});db[_0x791a('0x60')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x791a('0x15d')});db[_0x791a('0x60')][_0x791a('0x10e')](db[_0x791a('0x109')],{'onDelete':_0x791a('0x101'),'as':'Interaction','foreignKey':_0x791a('0x181')});db[_0x791a('0x60')][_0x791a('0x10e')](db['Attachment'],{'as':_0x791a('0x161'),'foreignKey':_0x791a('0x183')});db['ChatMessage'][_0x791a('0x10e')](db['ChatWebsite'],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x164')});db['ChatOfflineMessage']['hasMany'](db[_0x791a('0x161')],{'as':'Attachments','foreignKey':_0x791a('0x165'),'onDelete':_0x791a('0x101'),'hooks':!![]});db['ChatOfflineMessage'][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x791a('0x15d')});db[_0x791a('0x61')][_0x791a('0x10e')](db[_0x791a('0x5d')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x791a('0x63')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x2e'),'hooks':!![]});db[_0x791a('0x63')][_0x791a('0x110')](db[_0x791a('0xd9')],{'through':_0x791a('0x184'),'as':_0x791a('0x148')});db[_0x791a('0x65')][_0x791a('0x104')](db[_0x791a('0xc7')],{'as':_0x791a('0x14d'),'foreignKey':_0x791a('0x185'),'onDelete':_0x791a('0x101')});db[_0x791a('0x65')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x13a'),'through':_0x791a('0x112')});db[_0x791a('0x17d')][_0x791a('0x10e')](db[_0x791a('0x5d')],{'as':_0x791a('0x186'),'foreignKey':_0x791a('0x164')});db[_0x791a('0x68')][_0x791a('0x104')](db['CmContact'],{'as':'Contacts','foreignKey':_0x791a('0x187')});db[_0x791a('0x113')]['hasMany'](db[_0x791a('0x6b')],{'as':'Hoppers','foreignKey':_0x791a('0x15d')});db[_0x791a('0x113')]['hasMany'](db[_0x791a('0x6d')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0x791a('0x113')][_0x791a('0x104')](db[_0x791a('0x6f')],{'as':_0x791a('0x13d'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x113')][_0x791a('0x104')](db[_0x791a('0x71')],{'as':_0x791a('0x71'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x113')]['hasMany'](db[_0x791a('0xcd')],{'as':_0x791a('0x140'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x113')][_0x791a('0x104')](db[_0x791a('0x58')],{'as':_0x791a('0x108'),'foreignKey':'ContactId','onDelete':_0x791a('0x166')});db[_0x791a('0x113')]['hasMany'](db['ChatInteraction'],{'as':_0x791a('0x10a'),'foreignKey':_0x791a('0x15d'),'onDelete':'restrict'});db[_0x791a('0x113')][_0x791a('0x104')](db[_0x791a('0x50')],{'as':_0x791a('0x10b'),'foreignKey':_0x791a('0x15d'),'onDelete':_0x791a('0x166')});db['CmContact'][_0x791a('0x104')](db[_0x791a('0x49')],{'as':'FaxInteractions','foreignKey':_0x791a('0x15d'),'onDelete':_0x791a('0x166')});db[_0x791a('0x113')][_0x791a('0x104')](db['MailInteraction'],{'as':_0x791a('0x117'),'foreignKey':'ContactId','onDelete':_0x791a('0x166')});db[_0x791a('0x113')]['belongsTo'](db[_0x791a('0x68')],{'as':_0x791a('0x188'),'foreignKey':_0x791a('0x187')});db[_0x791a('0x113')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':'List','foreignKey':'ListId','onDelete':_0x791a('0x101')});db[_0x791a('0x113')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x160'),'through':'cm_user_has_contacts'});db[_0x791a('0x113')]['belongsToMany'](db[_0x791a('0x84')],{'as':'Tags','through':_0x791a('0x189')});db[_0x791a('0x113')][_0x791a('0x110')](db['Tag'],{'through':_0x791a('0x189'),'as':_0x791a('0x16e')});db[_0x791a('0x6b')]['belongsTo'](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d'),'onDelete':_0x791a('0x101')});db[_0x791a('0x6b')][_0x791a('0x10e')](db['CmList'],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159'),'onDelete':_0x791a('0x101')});db['CmHopper'][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x17f'),'foreignKey':_0x791a('0x102')});db[_0x791a('0x6b')][_0x791a('0x10e')](db['VoiceQueue'],{'as':_0x791a('0x18a'),'foreignKey':_0x791a('0x13b'),'onDelete':_0x791a('0x101')});db[_0x791a('0x6b')]['belongsTo'](db[_0x791a('0x18b')],{'as':_0x791a('0x18b'),'foreignKey':_0x791a('0x18c'),'onDelete':_0x791a('0x101')});db['CmHopper'][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':'Owner','foreignKey':_0x791a('0x18d')});db[_0x791a('0x13e')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d'),'onDelete':_0x791a('0x101')});db[_0x791a('0x13e')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159'),'onDelete':_0x791a('0x101')});db[_0x791a('0x13e')][_0x791a('0x10e')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0x791a('0x13b'),'onDelete':_0x791a('0x101')});db[_0x791a('0x13e')]['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':_0x791a('0x18c'),'onDelete':'cascade'});db[_0x791a('0x18e')][_0x791a('0x104')](db[_0x791a('0x7b')],{'as':{'plural':_0x791a('0x18f'),'singular':_0x791a('0x190')},'foreignKey':_0x791a('0x191'),'onDelete':_0x791a('0x101'),'hooks':!![]});db[_0x791a('0x18e')][_0x791a('0x104')](db[_0x791a('0x7b')],{'as':{'plural':'Any','singular':_0x791a('0x192')},'foreignKey':_0x791a('0x193'),'onDelete':_0x791a('0x101'),'hooks':!![]});db['Automation'][_0x791a('0x104')](db[_0x791a('0x75')],{'as':_0x791a('0x194'),'foreignKey':_0x791a('0x195'),'onDelete':_0x791a('0x101'),'hooks':!![]});db[_0x791a('0x7a')][_0x791a('0x104')](db[_0x791a('0x7a')],{'as':'Dispositions','foreignKey':_0x791a('0x196'),'onDelete':_0x791a('0x101')});db[_0x791a('0x142')][_0x791a('0x104')](db[_0x791a('0x142')],{'as':_0x791a('0x197'),'foreignKey':'IntervalId','onDelete':_0x791a('0x101'),'hooks':!![],'required':![]});db[_0x791a('0x142')][_0x791a('0x104')](db[_0x791a('0x15')],{'as':_0x791a('0x107'),'foreignKey':'IntervalId','onDelete':_0x791a('0x166')});db[_0x791a('0x142')][_0x791a('0x104')](db[_0x791a('0x42')],{'as':_0x791a('0x198'),'foreignKey':_0x791a('0x143')});db['Interval']['hasMany'](db[_0x791a('0x5e')],{'as':_0x791a('0x199'),'foreignKey':_0x791a('0x143')});db[_0x791a('0x142')][_0x791a('0x104')](db[_0x791a('0x48')],{'as':'FaxApplications','foreignKey':_0x791a('0x143')});db[_0x791a('0x142')][_0x791a('0x104')](db['SmsApplication'],{'as':_0x791a('0x19a'),'foreignKey':_0x791a('0x143')});db[_0x791a('0x19b')][_0x791a('0x10e')](db[_0x791a('0x3b')],{});db['Schedule'][_0x791a('0x10e')](db[_0x791a('0x19c')],{'foreignKey':'DefaultReportId'});db['Schedule']['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x791a('0x19d')});db[_0x791a('0x82')][_0x791a('0x110')](db[_0x791a('0x17')],{'as':_0x791a('0x19e'),'through':'moh_has_sounds','onDelete':_0x791a('0x166')});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0x113')],{'through':'cm_contact_has_tags'});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0x109')],{'through':_0x791a('0x182')});db[_0x791a('0x84')][_0x791a('0x110')](db['MailInteraction'],{'through':_0x791a('0x15f')});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0x50')],{'through':_0x791a('0x175')});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0x49')],{'through':_0x791a('0x16d')});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0x58')],{'through':_0x791a('0x17b')});db[_0x791a('0x84')][_0x791a('0x110')](db[_0x791a('0xf2')],{'through':_0x791a('0x19f')});db['Trigger'][_0x791a('0x104')](db[_0x791a('0x7b')],{'as':{'plural':_0x791a('0x1a0'),'singular':_0x791a('0x1a1')},'foreignKey':_0x791a('0x1a2'),'onDelete':_0x791a('0x101'),'hooks':!![]});db['Trigger'][_0x791a('0x104')](db[_0x791a('0x7b')],{'as':{'plural':_0x791a('0x1a3'),'singular':_0x791a('0x1a4')},'foreignKey':_0x791a('0x1a5'),'onDelete':_0x791a('0x101'),'hooks':!![]});db[_0x791a('0x88')]['hasMany'](db[_0x791a('0x75')],{'as':'Actions','foreignKey':_0x791a('0x1a6'),'onDelete':'cascade','hooks':!![]});db[_0x791a('0x8e')][_0x791a('0x104')](db[_0x791a('0x92')],{'as':'Fields','onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x19d'),'hooks':!![]});db['AnalyticDefaultReport'][_0x791a('0x104')](db[_0x791a('0x92')],{'as':_0x791a('0x1a7'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1a8')});db[_0x791a('0x91')][_0x791a('0x104')](db['AnalyticFieldReport'],{'as':_0x791a('0x1a7'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1a9')});db['AnalyticFieldReport']['belongsTo'](db[_0x791a('0x91')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0x791a('0x104')](db[_0x791a('0x1aa')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ac')});db['SalesforceConfiguration'][_0x791a('0x104')](db[_0x791a('0x98')],{'as':_0x791a('0x1ad'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0x1aa')][_0x791a('0x104')](db[_0x791a('0x98')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x791a('0x1af')});db['SalesforceConfiguration'][_0x791a('0x104')](db['SalesforceField'],{'as':_0x791a('0x1a7'),'onDelete':'cascade','foreignKey':_0x791a('0x1b0')});db[_0x791a('0x1aa')][_0x791a('0x10e')](db['SalesforceAccount'],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0x98')][_0x791a('0x104')](db[_0x791a('0x98')],{'as':_0x791a('0x1b1'),'foreignKey':'SubjectId'});db[_0x791a('0x98')][_0x791a('0x104')](db[_0x791a('0x98')],{'as':_0x791a('0x1b2'),'foreignKey':'DescriptionId'});db[_0x791a('0x98')][_0x791a('0x104')](db[_0x791a('0x98')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db['SalesforceField'][_0x791a('0x10e')](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0x9a')][_0x791a('0x104')](db[_0x791a('0x9c')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0x9c')][_0x791a('0x104')](db[_0x791a('0x9e')],{'as':'Subjects','onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0x9c')]['hasMany'](db[_0x791a('0x9e')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x791a('0x1af')});db[_0x791a('0x9c')][_0x791a('0x104')](db[_0x791a('0x9e')],{'as':_0x791a('0x1a7'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1b0')});db['SugarcrmConfiguration'][_0x791a('0x10e')](db['SugarcrmAccount'],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0x9e')][_0x791a('0x104')](db['SugarcrmField'],{'as':_0x791a('0x1b1'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0x9e')][_0x791a('0x104')](db['SugarcrmField'],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0x9e')][_0x791a('0x104')](db[_0x791a('0x9e')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db['SugarcrmField']['belongsTo'](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':'VariableId'});db[_0x791a('0x9f')]['hasMany'](db['DeskConfiguration'],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ac')});db['DeskConfiguration'][_0x791a('0x104')](db[_0x791a('0xa2')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x791a('0x1ae')});db[_0x791a('0xa1')]['hasMany'](db[_0x791a('0xa2')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x791a('0xa1')][_0x791a('0x104')](db[_0x791a('0xa2')],{'as':_0x791a('0x1a7'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0xa1')][_0x791a('0x10e')](db[_0x791a('0x9f')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0xa1')][_0x791a('0x110')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0x791a('0x104')](db[_0x791a('0xa2')],{'as':'Subject','foreignKey':_0x791a('0x1ae')});db[_0x791a('0xa2')][_0x791a('0x104')](db['DeskField'],{'as':'Description','foreignKey':_0x791a('0x1af')});db[_0x791a('0xa2')][_0x791a('0x104')](db[_0x791a('0xa2')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0xa2')][_0x791a('0x10e')](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0x1b5')][_0x791a('0x104')](db[_0x791a('0x1b6')],{'as':_0x791a('0x1ab'),'onDelete':'cascade','foreignKey':_0x791a('0x1ac')});db[_0x791a('0x1b6')][_0x791a('0x104')](db['ZohoField'],{'as':_0x791a('0x1ad'),'onDelete':'cascade','foreignKey':_0x791a('0x1ae')});db[_0x791a('0x1b6')][_0x791a('0x104')](db[_0x791a('0x1b7')],{'as':_0x791a('0x1b8'),'onDelete':_0x791a('0x101'),'foreignKey':'DescriptionId'});db[_0x791a('0x1b6')][_0x791a('0x104')](db[_0x791a('0x1b7')],{'as':_0x791a('0x1a7'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0x1b6')][_0x791a('0x10e')](db[_0x791a('0x1b5')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0x1b7')][_0x791a('0x104')](db[_0x791a('0x1b7')],{'as':'Subject','foreignKey':_0x791a('0x1ae')});db[_0x791a('0x1b7')][_0x791a('0x104')](db[_0x791a('0x1b7')],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db['ZohoField'][_0x791a('0x104')](db[_0x791a('0x1b7')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0x1b7')]['belongsTo'](db[_0x791a('0x8a')],{'as':'Variable','foreignKey':'VariableId'});db['ZendeskAccount'][_0x791a('0x104')](db[_0x791a('0xa8')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':'AccountId'});db[_0x791a('0xa8')][_0x791a('0x104')](db[_0x791a('0xaa')],{'as':_0x791a('0x1ad'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0xa8')][_0x791a('0x104')](db[_0x791a('0xaa')],{'as':_0x791a('0x1b8'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0xa8')][_0x791a('0x104')](db[_0x791a('0xaa')],{'as':_0x791a('0x1a7'),'foreignKey':_0x791a('0x1b0')});db['ZendeskConfiguration'][_0x791a('0x10e')](db[_0x791a('0xa7')],{'as':'Account','foreignKey':'AccountId'});db[_0x791a('0xa8')][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x1b9')});db[_0x791a('0xaa')]['hasMany'](db[_0x791a('0xaa')],{'as':_0x791a('0x1b1'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0xaa')][_0x791a('0x104')](db[_0x791a('0xaa')],{'as':_0x791a('0x1b2'),'foreignKey':'DescriptionId'});db[_0x791a('0xaa')][_0x791a('0x104')](db[_0x791a('0xaa')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db['ZendeskField'][_0x791a('0x10e')](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0xab')][_0x791a('0x104')](db['FreshdeskConfiguration'],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0xad')][_0x791a('0x104')](db['FreshdeskField'],{'as':_0x791a('0x1ad'),'onDelete':_0x791a('0x101'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x791a('0x104')](db[_0x791a('0x1ba')],{'as':'Descriptions','onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0xad')][_0x791a('0x104')](db[_0x791a('0x1ba')],{'as':_0x791a('0x1a7'),'onDelete':'cascade','foreignKey':_0x791a('0x1b0')});db[_0x791a('0xad')]['belongsTo'](db[_0x791a('0xab')],{'as':_0x791a('0x15c'),'foreignKey':'AccountId'});db[_0x791a('0xad')][_0x791a('0x110')](db[_0x791a('0x84')],{'through':_0x791a('0x1bb')});db[_0x791a('0x1ba')][_0x791a('0x104')](db[_0x791a('0x1ba')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x791a('0x1ba')][_0x791a('0x104')](db[_0x791a('0x1ba')],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0x1ba')][_0x791a('0x104')](db['FreshdeskField'],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0x1ba')]['belongsTo'](db[_0x791a('0x8a')],{'as':'Variable','foreignKey':'VariableId'});db[_0x791a('0xb0')][_0x791a('0x104')](db['VtigerConfiguration'],{'as':_0x791a('0x1ab'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x791a('0xb2')]['hasMany'](db[_0x791a('0xb4')],{'as':_0x791a('0x1ad'),'foreignKey':'SubjectId'});db[_0x791a('0xb2')][_0x791a('0x104')](db[_0x791a('0xb4')],{'as':_0x791a('0x1b8'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0xb2')][_0x791a('0x104')](db[_0x791a('0xb4')],{'as':_0x791a('0x1a7'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0xb2')][_0x791a('0x10e')](db[_0x791a('0xb0')],{'as':'Account','foreignKey':'AccountId'});db[_0x791a('0xb4')][_0x791a('0x104')](db[_0x791a('0xb4')],{'as':_0x791a('0x1b1'),'foreignKey':'SubjectId'});db[_0x791a('0xb4')][_0x791a('0x104')](db[_0x791a('0xb4')],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0xb4')][_0x791a('0x104')](db[_0x791a('0xb4')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0xb4')]['belongsTo'](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0xb6')][_0x791a('0x104')](db[_0x791a('0x1bc')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x791a('0x104')](db[_0x791a('0xb9')],{'as':'Subjects','foreignKey':_0x791a('0x1ae')});db['ServicenowConfiguration']['hasMany'](db[_0x791a('0xb9')],{'as':_0x791a('0x1b8'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0x1bc')]['hasMany'](db[_0x791a('0xb9')],{'as':_0x791a('0x1a7'),'foreignKey':'FieldId'});db[_0x791a('0x1bc')][_0x791a('0x10e')](db[_0x791a('0xb6')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0xb9')][_0x791a('0x104')](db[_0x791a('0xb9')],{'as':_0x791a('0x1b1'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0xb9')][_0x791a('0x104')](db[_0x791a('0xb9')],{'as':_0x791a('0x1b2'),'foreignKey':'DescriptionId'});db[_0x791a('0xb9')][_0x791a('0x104')](db[_0x791a('0xb9')],{'as':_0x791a('0x1b3'),'foreignKey':'FieldId'});db['ServicenowField']['belongsTo'](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0xbb')][_0x791a('0x104')](db[_0x791a('0xbc')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ac')});db['Dynamics365Configuration'][_0x791a('0x104')](db[_0x791a('0xbe')],{'as':_0x791a('0x1ad'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1ae')});db[_0x791a('0xbc')][_0x791a('0x104')](db[_0x791a('0xbe')],{'as':_0x791a('0x1b8'),'onDelete':_0x791a('0x101'),'foreignKey':'DescriptionId'});db[_0x791a('0xbc')][_0x791a('0x104')](db[_0x791a('0xbe')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x791a('0x1b0')});db[_0x791a('0xbc')]['belongsTo'](db[_0x791a('0xbb')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0xbe')]['hasMany'](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x791a('0x1ae')});db['Dynamics365Field']['hasMany'](db[_0x791a('0xbe')],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db['Dynamics365Field'][_0x791a('0x104')](db[_0x791a('0xbe')],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0xbe')][_0x791a('0x10e')](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0x1bd')][_0x791a('0x104')](db[_0x791a('0x1be')],{'as':_0x791a('0x1ab'),'onDelete':_0x791a('0x101'),'foreignKey':'AccountId'});db[_0x791a('0x1be')][_0x791a('0x104')](db[_0x791a('0xc2')],{'as':_0x791a('0x1ad'),'foreignKey':_0x791a('0x1ae')});db['FreshsalesConfiguration'][_0x791a('0x104')](db[_0x791a('0xc2')],{'as':_0x791a('0x1b8'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0x1be')][_0x791a('0x104')](db[_0x791a('0xc2')],{'as':_0x791a('0x1a7'),'foreignKey':_0x791a('0x1b0')});db[_0x791a('0x1be')][_0x791a('0x10e')](db[_0x791a('0x1bd')],{'as':_0x791a('0x15c'),'foreignKey':_0x791a('0x1ac')});db[_0x791a('0xc2')][_0x791a('0x104')](db['FreshsalesField'],{'as':_0x791a('0x1b1'),'foreignKey':'SubjectId'});db[_0x791a('0xc2')][_0x791a('0x104')](db['FreshsalesField'],{'as':_0x791a('0x1b2'),'foreignKey':_0x791a('0x1af')});db[_0x791a('0xc2')][_0x791a('0x104')](db['FreshsalesField'],{'as':_0x791a('0x1b3'),'foreignKey':_0x791a('0x1b0')});db['FreshsalesField'][_0x791a('0x10e')](db[_0x791a('0x8a')],{'as':_0x791a('0x8a'),'foreignKey':_0x791a('0x1b4')});db[_0x791a('0x1bf')][_0x791a('0x10e')](db['ChatWebsite'],{});db[_0x791a('0x1bf')]['belongsTo'](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':'ListId'});db[_0x791a('0x1bf')][_0x791a('0x10e')](db['CmContact'],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0x1bf')]['belongsTo'](db[_0x791a('0x109')],{});db[_0x791a('0x1bf')][_0x791a('0x10e')](db['ChatMessage'],{});db[_0x791a('0x1bf')][_0x791a('0x10e')](db[_0x791a('0x103')],{});db['ChatQueueReport']['belongsTo'](db[_0x791a('0x63')],{});db[_0x791a('0xc7')]['belongsTo'](db['User'],{'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1c0')});db[_0x791a('0xc7')]['belongsTo'](db['User'],{'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x1c1')});db['JscriptySessionReport'][_0x791a('0x104')](db['JscriptyQuestionReport'],{'foreignKey':_0x791a('0x1c2'),'onDelete':_0x791a('0x101')});db[_0x791a('0xcd')][_0x791a('0x104')](db[_0x791a('0xc9')],{'foreignKey':_0x791a('0x1c2'),'onDelete':'cascade'});db['SmsQueueReport'][_0x791a('0x10e')](db[_0x791a('0x4f')],{});db[_0x791a('0xcf')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db[_0x791a('0xcf')][_0x791a('0x10e')](db['CmContact'],{'as':_0x791a('0x152'),'foreignKey':'ContactId'});db[_0x791a('0xcf')][_0x791a('0x10e')](db[_0x791a('0x50')],{});db[_0x791a('0xcf')]['belongsTo'](db['SmsMessage'],{});db[_0x791a('0xcf')][_0x791a('0x10e')](db[_0x791a('0x103')],{});db[_0x791a('0xcf')][_0x791a('0x10e')](db[_0x791a('0x52')],{});db['JscriptyProject']['hasMany'](db[_0x791a('0xcd')],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0x791a('0xcb')],{'foreignKey':_0x791a('0x1c3')});db[_0x791a('0xd2')]['hasMany'](db[_0x791a('0xc9')],{'foreignKey':_0x791a('0x1c3')});db[_0x791a('0x132')]['belongsToMany'](db['User'],{'as':_0x791a('0x160'),'through':'user_has_square_projects'});db[_0x791a('0xd9')]['belongsToMany'](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':'user_has_teams'});db[_0x791a('0xd9')][_0x791a('0x110')](db[_0x791a('0x18')],{'through':_0x791a('0xfc'),'as':_0x791a('0x11e')});db[_0x791a('0xd9')][_0x791a('0x110')](db[_0x791a('0x11f')],{'through':_0x791a('0x15a'),'as':_0x791a('0x120')});db['Team'][_0x791a('0x110')](db[_0x791a('0x63')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0x791a('0xd9')]['belongsToMany'](db[_0x791a('0x4d')],{'through':_0x791a('0x170'),'as':_0x791a('0x122')});db['Team']['belongsToMany'](db[_0x791a('0x52')],{'through':'team_has_sms_queues','as':_0x791a('0x123')});db[_0x791a('0xd9')][_0x791a('0x110')](db[_0x791a('0x124')],{'through':_0x791a('0x17c'),'as':_0x791a('0x125')});db[_0x791a('0xd9')][_0x791a('0x110')](db[_0x791a('0xf8')],{'through':'team_has_whatsapp_queues','as':_0x791a('0x126')});db[_0x791a('0xd9')]['belongsToMany'](db[_0x791a('0xe8')],{'through':_0x791a('0xfe'),'as':_0x791a('0x1c4')});db[_0x791a('0x18b')]['hasMany'](db[_0x791a('0x6b')],{'as':'Hoppers','foreignKey':_0x791a('0x18c')});db[_0x791a('0x18b')][_0x791a('0x104')](db['CmHopperFinal'],{'as':_0x791a('0x13c'),'foreignKey':_0x791a('0x18c')});db[_0x791a('0x18b')][_0x791a('0x104')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x791a('0x18c')});db[_0x791a('0x18b')][_0x791a('0x104')](db['CmHopperBlack'],{'as':_0x791a('0x13f'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db[_0x791a('0x28')],{'as':_0x791a('0x28'),'foreignKey':_0x791a('0x1c5')});db['Campaign'][_0x791a('0x10e')](db[_0x791a('0x28')],{'as':_0x791a('0x141'),'foreignKey':_0x791a('0x1c6')});db[_0x791a('0x18b')][_0x791a('0x10e')](db[_0x791a('0x142')],{'as':'Interval','foreignKey':_0x791a('0x143')});db[_0x791a('0x18b')][_0x791a('0x10e')](db[_0x791a('0x132')],{'as':_0x791a('0x132'),'foreignKey':'SquareProjectId'});db[_0x791a('0x18b')][_0x791a('0x110')](db[_0x791a('0xe7')],{'as':_0x791a('0x115'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x791a('0x110')](db[_0x791a('0xe7')],{'as':_0x791a('0x149'),'through':'campaigns_has_cm_blacklists'});db[_0x791a('0x161')][_0x791a('0x10e')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x791a('0x165')});db[_0x791a('0x1c7')][_0x791a('0x10e')](db[_0x791a('0x41')],{});db[_0x791a('0x1c7')][_0x791a('0x10e')](db['MailInteraction'],{});db[_0x791a('0x1c7')][_0x791a('0x10e')](db[_0x791a('0x3b')],{'foreignKey':_0x791a('0x1c8'),'as':_0x791a('0x1c9')});db[_0x791a('0x1c7')][_0x791a('0x10e')](db['User'],{'foreignKey':_0x791a('0x1ca'),'as':_0x791a('0x1cb')});db[_0x791a('0x1c7')][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':_0x791a('0x1cc'),'as':_0x791a('0x1cd')});db[_0x791a('0x1c7')]['belongsTo'](db[_0x791a('0x11f')],{'foreignKey':_0x791a('0x1ce'),'as':_0x791a('0x1cf')});db['MailTransferReport'][_0x791a('0x10e')](db[_0x791a('0x3b')],{'foreignKey':'ToMailAccountId','as':_0x791a('0x1d0')});db[_0x791a('0x1d1')]['belongsTo'](db[_0x791a('0x60')],{});db[_0x791a('0x1d1')][_0x791a('0x10e')](db[_0x791a('0x109')],{});db['ChatTransferReport'][_0x791a('0x10e')](db[_0x791a('0x5d')],{'foreignKey':'FromChatWebsiteId','as':_0x791a('0x1c9')});db[_0x791a('0x1d1')][_0x791a('0x10e')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x791a('0x1d1')][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':'ToUserId','as':_0x791a('0x1cd')});db[_0x791a('0x1d1')][_0x791a('0x10e')](db[_0x791a('0x63')],{'foreignKey':'ToChatQueueId','as':_0x791a('0x1cf')});db[_0x791a('0x1d1')][_0x791a('0x10e')](db['ChatWebsite'],{'foreignKey':_0x791a('0x1d2'),'as':_0x791a('0x1d0')});db[_0x791a('0xe3')][_0x791a('0x10e')](db[_0x791a('0x4b')],{});db[_0x791a('0xe3')][_0x791a('0x10e')](db[_0x791a('0x49')],{});db['FaxTransferReport'][_0x791a('0x10e')](db[_0x791a('0x12a')],{'foreignKey':'FromFaxAccountId','as':_0x791a('0x1c9')});db['FaxTransferReport'][_0x791a('0x10e')](db['User'],{'foreignKey':_0x791a('0x1ca'),'as':_0x791a('0x1cb')});db['FaxTransferReport'][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':_0x791a('0x1cc'),'as':'ToAgent'});db['FaxTransferReport']['belongsTo'](db[_0x791a('0x4d')],{'foreignKey':_0x791a('0x1d3'),'as':_0x791a('0x1cf')});db[_0x791a('0xe3')][_0x791a('0x10e')](db[_0x791a('0x12a')],{'foreignKey':_0x791a('0x1d4'),'as':'ToAccount'});db[_0x791a('0xe5')][_0x791a('0x10e')](db[_0x791a('0x5a')],{});db['OpenchannelTransferReport'][_0x791a('0x10e')](db[_0x791a('0x58')],{});db[_0x791a('0xe5')][_0x791a('0x10e')](db['OpenchannelAccount'],{'foreignKey':_0x791a('0x1d5'),'as':_0x791a('0x1c9')});db['OpenchannelTransferReport'][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':_0x791a('0x1ca'),'as':'FromAgent'});db[_0x791a('0xe5')][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':'ToUserId','as':_0x791a('0x1cd')});db[_0x791a('0xe5')][_0x791a('0x10e')](db[_0x791a('0x124')],{'foreignKey':_0x791a('0x1d6'),'as':'ToQueue'});db[_0x791a('0xe5')][_0x791a('0x10e')](db['OpenchannelAccount'],{'foreignKey':_0x791a('0x1d7'),'as':_0x791a('0x1d0')});db['SmsTransferReport'][_0x791a('0x10e')](db[_0x791a('0x172')],{});db[_0x791a('0x1d8')][_0x791a('0x10e')](db['SmsInteraction'],{});db[_0x791a('0x1d8')][_0x791a('0x10e')](db[_0x791a('0x4f')],{'foreignKey':_0x791a('0x1d9'),'as':_0x791a('0x1c9')});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x791a('0x1d8')][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':'ToUserId','as':_0x791a('0x1cd')});db[_0x791a('0x1d8')][_0x791a('0x10e')](db['SmsQueue'],{'foreignKey':_0x791a('0x1da'),'as':'ToQueue'});db[_0x791a('0x1d8')][_0x791a('0x10e')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0x791a('0x1d0')});db[_0x791a('0xe7')][_0x791a('0x104')](db['Disposition'],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x159'),'onDelete':'cascade'});db['CmList'][_0x791a('0x104')](db[_0x791a('0x73')],{'as':'CustomFields','foreignKey':_0x791a('0x159')});db['CmList']['hasMany'](db[_0x791a('0x113')],{'as':_0x791a('0x1db'),'onDelete':_0x791a('0x101'),'foreignKey':_0x791a('0x159')});db[_0x791a('0xe7')]['hasMany'](db[_0x791a('0x6d')],{'as':_0x791a('0x13c'),'foreignKey':'ListId'});db[_0x791a('0xe7')][_0x791a('0x104')](db['CmHopperHistory'],{'as':_0x791a('0x1dc'),'foreignKey':_0x791a('0x159')});db[_0x791a('0xe7')][_0x791a('0x104')](db[_0x791a('0x71')],{'as':'ReportAgentPreview','foreignKey':_0x791a('0x159')});db['CmList']['belongsToMany'](db['VoiceQueue'],{'as':_0x791a('0x1dd'),'through':_0x791a('0x146')});db[_0x791a('0xe7')]['belongsToMany'](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x127')});db[_0x791a('0xe8')][_0x791a('0x104')](db[_0x791a('0x15')],{'as':_0x791a('0x107'),'onDelete':_0x791a('0x101')});db[_0x791a('0xe8')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0xff')});db[_0x791a('0xe8')][_0x791a('0x110')](db['Team'],{'through':_0x791a('0xfe'),'as':_0x791a('0x148')});db['UserProfile']['hasMany'](db[_0x791a('0x103')],{'as':_0x791a('0x160'),'foreignKey':'userProfileId'});db[_0x791a('0xe9')][_0x791a('0x104')](db[_0x791a('0x1de')],{'as':'UserProfileSections','foreignKey':_0x791a('0x10f'),'onDelete':_0x791a('0x101')});db['UserProfileSection'][_0x791a('0x104')](db[_0x791a('0xeb')],{'as':_0x791a('0x1df'),'foreignKey':'sectionId','onDelete':_0x791a('0x101')});db['WhatsappAccount'][_0x791a('0x104')](db[_0x791a('0x7a')],{'as':_0x791a('0x155'),'foreignKey':_0x791a('0x1e0'),'onDelete':_0x791a('0x101')});db[_0x791a('0xef')][_0x791a('0x104')](db[_0x791a('0x78')],{'as':_0x791a('0x156'),'foreignKey':_0x791a('0x1e0')});db[_0x791a('0xef')][_0x791a('0x104')](db[_0x791a('0xf3')],{'as':'Messages','foreignKey':_0x791a('0x1e0')});db[_0x791a('0xef')][_0x791a('0x104')](db[_0x791a('0xf2')],{'as':_0x791a('0x157')});db[_0x791a('0xef')][_0x791a('0x104')](db[_0x791a('0xf1')],{'as':_0x791a('0x137')});db[_0x791a('0xef')][_0x791a('0x10e')](db['CmList'],{'as':_0x791a('0x158'),'foreignKey':_0x791a('0x159')});db[_0x791a('0xef')][_0x791a('0x10e')](db[_0x791a('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x791a('0xef')][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x1e1')});db[_0x791a('0xf1')]['belongsTo'](db[_0x791a('0x103')],{'onDelete':_0x791a('0x166')});db[_0x791a('0xf1')]['belongsTo'](db[_0x791a('0xf8')],{'onDelete':'restrict'});db[_0x791a('0xf1')]['belongsTo'](db[_0x791a('0xef')],{'onDelete':_0x791a('0x166')});db[_0x791a('0xf1')][_0x791a('0x10e')](db[_0x791a('0x142')],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x143')});db['WhatsappApplication']['belongsTo'](db['Tag'],{'onDelete':_0x791a('0x166'),'foreignKey':_0x791a('0x167')});db[_0x791a('0xf2')][_0x791a('0x104')](db[_0x791a('0xf3')],{'as':_0x791a('0x14d'),'onDelete':_0x791a('0x101'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x791a('0x10e')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x791a('0xf2')][_0x791a('0x10e')](db[_0x791a('0x113')],{'as':_0x791a('0x152'),'foreignKey':'ContactId'});db[_0x791a('0xf2')][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x15e'),'foreignKey':_0x791a('0x102')});db[_0x791a('0xf2')][_0x791a('0x110')](db['Tag'],{'through':_0x791a('0x19f'),'as':_0x791a('0x176')});db[_0x791a('0xf2')]['belongsToMany'](db[_0x791a('0x84')],{'through':_0x791a('0x19f'),'as':_0x791a('0x16e')});db[_0x791a('0xf2')][_0x791a('0x110')](db['User'],{'as':_0x791a('0x160'),'through':_0x791a('0x11d'),'foreignKey':_0x791a('0x1e2')});db['WhatsappMessage'][_0x791a('0x10e')](db[_0x791a('0x103')],{'as':_0x791a('0x103')});db[_0x791a('0xf3')][_0x791a('0x10e')](db[_0x791a('0x113')],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x152')});db[_0x791a('0xf3')]['belongsTo'](db[_0x791a('0xf2')],{'onDelete':_0x791a('0x101'),'as':_0x791a('0x163'),'foreignKey':_0x791a('0x1e2')});db['WhatsappMessage']['belongsTo'](db[_0x791a('0xef')],{'as':'Account','foreignKey':_0x791a('0x1e0')});db['WhatsappQueueReport'][_0x791a('0x10e')](db[_0x791a('0xef')],{});db[_0x791a('0xf5')][_0x791a('0x10e')](db[_0x791a('0xe7')],{'as':'List','foreignKey':'ListId'});db['WhatsappQueueReport'][_0x791a('0x10e')](db['CmContact'],{'as':_0x791a('0x152'),'foreignKey':_0x791a('0x15d')});db[_0x791a('0xf5')][_0x791a('0x10e')](db[_0x791a('0xf2')],{});db['WhatsappQueueReport'][_0x791a('0x10e')](db[_0x791a('0xf8')],{});db[_0x791a('0xf5')][_0x791a('0x10e')](db['WhatsappMessage'],{});db[_0x791a('0xf5')][_0x791a('0x10e')](db[_0x791a('0x103')],{});db[_0x791a('0xf7')][_0x791a('0x10e')](db['WhatsappMessage'],{});db['WhatsappTransferReport']['belongsTo'](db[_0x791a('0xf2')],{});db['WhatsappTransferReport'][_0x791a('0x10e')](db[_0x791a('0xef')],{'foreignKey':_0x791a('0x1e3'),'as':'FromAccount'});db[_0x791a('0xf7')]['belongsTo'](db[_0x791a('0xef')],{'foreignKey':_0x791a('0x1e4'),'as':'ToAccount'});db[_0x791a('0xf7')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0x791a('0x1cf')});db[_0x791a('0xf7')]['belongsTo'](db[_0x791a('0x103')],{'foreignKey':_0x791a('0x1ca'),'as':_0x791a('0x1cb')});db[_0x791a('0xf7')][_0x791a('0x10e')](db[_0x791a('0x103')],{'foreignKey':_0x791a('0x1cc'),'as':_0x791a('0x1cd')});db['WhatsappQueue'][_0x791a('0x110')](db[_0x791a('0x103')],{'as':_0x791a('0x147'),'through':_0x791a('0x36'),'foreignKey':_0x791a('0x1e5')});db['WhatsappQueue'][_0x791a('0x110')](db[_0x791a('0xd9')],{'through':'team_has_whatsapp_queues','as':_0x791a('0x148')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
index d9934e3..de85aaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dff=['./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','static','root','/apidoc','/www','join','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','apiKey','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','accountSid','localstationid','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','lodash','express','express-winston','util','./errors','./config/logger','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','method','x-forwarded-for','headers','connection','remoteAddress','statusCode','responseTime','user','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','url','role','other','agent_id','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./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/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations'];(function(_0x3438cf,_0x73b174){var _0x278698=function(_0xbba932){while(--_0xbba932){_0x3438cf['push'](_0x3438cf['shift']());}};_0x278698(++_0x73b174);}(_0x7dff,0x93));var _0xf7df=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x7dff[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0xf7df('0x0'));var path=require('path');var express=require(_0xf7df('0x1'));var ewinston=require(_0xf7df('0x2'));var util=require(_0xf7df('0x3'));var errors=require(_0xf7df('0x4'));var config=require('./config/environment');var logger=require(_0xf7df('0x5'))('api');var authLogger=require(_0xf7df('0x5'))('auth');exports[_0xf7df('0x6')]=function(_0x217d8d){_0x217d8d[_0xf7df('0x7')](ewinston[_0xf7df('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x480ebf,_0xbeb501){var _0xf5883d=_0xf7df('0x9');if(!_[_0xf7df('0xa')](_0x480ebf[_0xf7df('0xb')])){_0xf5883d+=_0xf7df('0xc');var _0x46b7ca=_0x480ebf[_0xf7df('0xb')];maskSensitiveData(_0x46b7ca);}return util['format'](_0xf5883d,_0x480ebf[_0xf7df('0xd')],_0x480ebf['headers'][_0xf7df('0xe')]?_0x480ebf[_0xf7df('0xf')][_0xf7df('0xe')]:_0x480ebf[_0xf7df('0x10')][_0xf7df('0x11')]||_0x480ebf['ip'],_0x480ebf['url'],_0xbeb501[_0xf7df('0x12')],_0xbeb501[_0xf7df('0x13')],_0x480ebf[_0xf7df('0x14')]?_0x480ebf[_0xf7df('0x14')]['id']:null,_0x480ebf[_0xf7df('0x14')]?_0x480ebf[_0xf7df('0x14')][_0xf7df('0x15')]:null,_0x480ebf[_0xf7df('0x14')]?_0x480ebf[_0xf7df('0x14')]['role']:null,_0x46b7ca?util[_0xf7df('0x16')](_0x46b7ca,![],null):'');}}));_0x217d8d['use'](ewinston[_0xf7df('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xe0b211,_0x1eeb11){var _0x4d489a=_0xf7df('0x17');if(_0xe0b211[_0xf7df('0xb')]&&_0xe0b211[_0xf7df('0xb')][_0xf7df('0x18')]&&_0xe0b211[_0xf7df('0xb')]['agent_id']){_0x4d489a=_0xf7df('0x19');}return util[_0xf7df('0x1a')](_0x4d489a,_0xe0b211[_0xf7df('0xd')],_0xe0b211[_0xf7df('0xf')][_0xf7df('0xe')]?_0xe0b211['headers']['x-forwarded-for']:_0xe0b211[_0xf7df('0x10')][_0xf7df('0x11')]||_0xe0b211['ip'],_0xe0b211[_0xf7df('0x1b')],_0x1eeb11[_0xf7df('0x12')],_0x1eeb11['responseTime'],_0xe0b211[_0xf7df('0x14')]?_0xe0b211[_0xf7df('0x14')]['id']:null,_0xe0b211[_0xf7df('0x14')]?_0xe0b211[_0xf7df('0x14')][_0xf7df('0x15')]:null,_0xe0b211[_0xf7df('0x14')]?_0xe0b211['user'][_0xf7df('0x1c')]:null,_0xe0b211['body']&&_0xe0b211[_0xf7df('0xb')][_0xf7df('0x18')]?_0xe0b211[_0xf7df('0xb')][_0xf7df('0x18')]:_0xf7df('0x1d'),_0xe0b211[_0xf7df('0xb')]&&_0xe0b211[_0xf7df('0xb')]['agent_id']?_0xe0b211['body'][_0xf7df('0x1e')]:'',_0xe0b211[_0xf7df('0xb')]&&_0xe0b211['body'][_0xf7df('0x1f')]?_0xe0b211['body'][_0xf7df('0x1f')]:'');},'ignoreRoute':function(_0x311e2f){var _0x4c7765=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4c7765[_0xf7df('0x20')](_0x311e2f[_0xf7df('0x1b')]);}}));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x21'),require(_0xf7df('0x22')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x23'),require(_0xf7df('0x24')));_0x217d8d[_0xf7df('0x7')]('/api/voice/contexts',require('./api/voiceContext'));_0x217d8d[_0xf7df('0x7')]('/api/voice/extensions',require(_0xf7df('0x25')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x26'),require(_0xf7df('0x27')));_0x217d8d['use'](_0xf7df('0x28'),require(_0xf7df('0x29')));_0x217d8d['use'](_0xf7df('0x2a'),require('./api/voiceRecording'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x2b'),require(_0xf7df('0x2c')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x2d'),require(_0xf7df('0x2e')));_0x217d8d['use'](_0xf7df('0x2f'),require(_0xf7df('0x30')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x31'),require(_0xf7df('0x32')));_0x217d8d[_0xf7df('0x7')]('/api/voice/dials/reports',require(_0xf7df('0x33')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x34'),require(_0xf7df('0x35')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x36'),require(_0xf7df('0x37')));_0x217d8d['use'](_0xf7df('0x38'),require(_0xf7df('0x39')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x3a'),require('./api/trunk'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x3b'),require(_0xf7df('0x3c')));_0x217d8d['use'](_0xf7df('0x3d'),require(_0xf7df('0x3e')));_0x217d8d['use'](_0xf7df('0x3f'),require('./api/mailAccount'));_0x217d8d['use']('/api/mail/queues',require('./api/mailQueue'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x40'),require(_0xf7df('0x41')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x42'),require(_0xf7df('0x43')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x44'),require(_0xf7df('0x45')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x46'),require(_0xf7df('0x47')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x48'),require(_0xf7df('0x49')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x4a'),require(_0xf7df('0x4b')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x4c'),require(_0xf7df('0x4d')));_0x217d8d[_0xf7df('0x7')]('/api/fax/accounts',require(_0xf7df('0x4e')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x4f'),require(_0xf7df('0x50')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x51'),require(_0xf7df('0x52')));_0x217d8d['use'](_0xf7df('0x53'),require(_0xf7df('0x54')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x55'),require('./api/faxQueue'));_0x217d8d['use'](_0xf7df('0x56'),require(_0xf7df('0x57')));_0x217d8d['use'](_0xf7df('0x58'),require(_0xf7df('0x59')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x5a'),require(_0xf7df('0x5b')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x5c'),require(_0xf7df('0x5d')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x5e'),require('./api/smsMessage'));_0x217d8d[_0xf7df('0x7')]('/api/sms/queues',require(_0xf7df('0x5f')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x60'),require(_0xf7df('0x61')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x62'),require(_0xf7df('0x63')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x64'),require(_0xf7df('0x65')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x66'),require(_0xf7df('0x67')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x68'),require('./api/openchannelQueue'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x69'),require('./api/chatWebsite'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x6a'),require(_0xf7df('0x6b')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x6c'),require('./api/chatApplication'));_0x217d8d[_0xf7df('0x7')]('/api/chat/interactions',require(_0xf7df('0x6d')));_0x217d8d[_0xf7df('0x7')]('/api/chat/messages',require('./api/chatMessage'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x6e'),require(_0xf7df('0x6f')));_0x217d8d['use'](_0xf7df('0x70'),require(_0xf7df('0x71')));_0x217d8d[_0xf7df('0x7')]('/api/chat/groups',require('./api/chatGroup'));_0x217d8d['use'](_0xf7df('0x72'),require(_0xf7df('0x73')));_0x217d8d['use'](_0xf7df('0x74'),require('./api/cmCompany'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x75'),require('./api/cmContact'));_0x217d8d[_0xf7df('0x7')]('/api/cm/hopper',require(_0xf7df('0x76')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x77'),require('./api/cmHopperBlack'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x78'),require(_0xf7df('0x79')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x7a'),require(_0xf7df('0x7b')));_0x217d8d['use'](_0xf7df('0x7c'),require('./api/cmCustomField'));_0x217d8d[_0xf7df('0x7')]('/api/actions',require(_0xf7df('0x7d')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x7e'),require(_0xf7df('0x7f')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x80'),require(_0xf7df('0x81')));_0x217d8d['use']('/api/dispositions',require('./api/disposition'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x82'),require(_0xf7df('0x83')));_0x217d8d['use'](_0xf7df('0x84'),require('./api/interval'));_0x217d8d['use'](_0xf7df('0x85'),require(_0xf7df('0x86')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x87'),require(_0xf7df('0x88')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x89'),require(_0xf7df('0x8a')));_0x217d8d[_0xf7df('0x7')]('/api/schedules',require(_0xf7df('0x8b')));_0x217d8d['use'](_0xf7df('0x8c'),require(_0xf7df('0x8d')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x8e'),require(_0xf7df('0x8f')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x90'),require(_0xf7df('0x91')));_0x217d8d['use']('/api/triggers',require(_0xf7df('0x92')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x93'),require(_0xf7df('0x94')));_0x217d8d['use'](_0xf7df('0x95'),require('./api/integration'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x96'),require(_0xf7df('0x97')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x98'),require('./api/analyticCustomReport'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x99'),require(_0xf7df('0x9a')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x9b'),require(_0xf7df('0x9c')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x9d'),require('./api/analyticMetric'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x9e'),require(_0xf7df('0x9f')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xa0'),require(_0xf7df('0xa1')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xa2'),require('./api/intSalesforceAccount'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xa3'),require('./api/intSalesforceConfiguration'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xa4'),require(_0xf7df('0xa5')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xa6'),require(_0xf7df('0xa7')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xa8'),require(_0xf7df('0xa9')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xaa'),require(_0xf7df('0xab')));_0x217d8d['use'](_0xf7df('0xac'),require(_0xf7df('0xad')));_0x217d8d[_0xf7df('0x7')]('/api/integrations/desk/configurations',require(_0xf7df('0xae')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xaf'),require(_0xf7df('0xb0')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xb1'),require(_0xf7df('0xb2')));_0x217d8d[_0xf7df('0x7')]('/api/integrations/zoho/configurations',require(_0xf7df('0xb3')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xb4'),require(_0xf7df('0xb5')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xb6'),require(_0xf7df('0xb7')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xb8'),require(_0xf7df('0xb9')));_0x217d8d['use'](_0xf7df('0xba'),require(_0xf7df('0xbb')));_0x217d8d['use']('/api/integrations/freshdesk/accounts',require(_0xf7df('0xbc')));_0x217d8d[_0xf7df('0x7')]('/api/integrations/freshdesk/configurations',require(_0xf7df('0xbd')));_0x217d8d[_0xf7df('0x7')]('/api/integrations/freshdesk/fields',require(_0xf7df('0xbe')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xbf'),require(_0xf7df('0xc0')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xc1'),require(_0xf7df('0xc2')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xc3'),require(_0xf7df('0xc4')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xc5'),require(_0xf7df('0xc6')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xc7'),require(_0xf7df('0xc8')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xc9'),require(_0xf7df('0xca')));_0x217d8d[_0xf7df('0x7')]('/api/integrations/dynamics365/accounts',require(_0xf7df('0xcb')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xcc'),require(_0xf7df('0xcd')));_0x217d8d['use'](_0xf7df('0xce'),require(_0xf7df('0xcf')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xd0'),require(_0xf7df('0xd1')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xd2'),require(_0xf7df('0xd3')));_0x217d8d['use'](_0xf7df('0xd4'),require(_0xf7df('0xd5')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xd6'),require(_0xf7df('0xd7')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xd8'),require(_0xf7df('0xd9')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xda'),require(_0xf7df('0xdb')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xdc'),require('./api/jscriptyAnswerReport'));_0x217d8d['use'](_0xf7df('0xdd'),require(_0xf7df('0xde')));_0x217d8d[_0xf7df('0x7')]('/api/jscripty/sessions/reports',require(_0xf7df('0xdf')));_0x217d8d[_0xf7df('0x7')]('/api/sms/reports/queue',require(_0xf7df('0xe0')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xe1'),require(_0xf7df('0xe2')));_0x217d8d['use'](_0xf7df('0xe3'),require(_0xf7df('0xe4')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xe5'),require(_0xf7df('0xe6')));_0x217d8d['use'](_0xf7df('0xe7'),require(_0xf7df('0xe8')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xe9'),require(_0xf7df('0xea')));_0x217d8d['use'](_0xf7df('0xeb'),require('./api/squareProject'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xec'),require(_0xf7df('0xed')));_0x217d8d['use'](_0xf7df('0xee'),require(_0xf7df('0xef')));_0x217d8d[_0xf7df('0x7')]('/api/teams',require(_0xf7df('0xf0')));_0x217d8d[_0xf7df('0x7')]('/api/license',require(_0xf7df('0xf1')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xf2'),require(_0xf7df('0xf3')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xf4'),require(_0xf7df('0xf5')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xf6'),require(_0xf7df('0xf7')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xf8'),require(_0xf7df('0xf9')));_0x217d8d['use'](_0xf7df('0xfa'),require('./api/mailTransferReport'));_0x217d8d[_0xf7df('0x7')]('/api/chat/reports/transfer',require(_0xf7df('0xfb')));_0x217d8d[_0xf7df('0x7')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x217d8d['use'](_0xf7df('0xfc'),require(_0xf7df('0xfd')));_0x217d8d[_0xf7df('0x7')]('/api/sms/reports/transfer',require(_0xf7df('0xfe')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0xff'),require(_0xf7df('0x100')));_0x217d8d['use']('/api/voice/prefixes',require(_0xf7df('0x101')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x102'),require('./api/userProfile'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x103'),require(_0xf7df('0x104')));_0x217d8d['use'](_0xf7df('0x105'),require(_0xf7df('0x106')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x107'),require(_0xf7df('0x108')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x109'),require(_0xf7df('0x10a')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x10b'),require('./api/whatsappApplication'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x10c'),require(_0xf7df('0x10d')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x10e'),require('./api/whatsappMessage'));_0x217d8d['use'](_0xf7df('0x10f'),require(_0xf7df('0x110')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x111'),require(_0xf7df('0x112')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x113'),require(_0xf7df('0x114')));_0x217d8d['use'](_0xf7df('0x115'),require(_0xf7df('0x116')));_0x217d8d['use']('/api/realtime',require('./api/realtime'));_0x217d8d['use'](_0xf7df('0x117'),require(_0xf7df('0x118')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x119'),require(_0xf7df('0x11a')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x11b'),require(_0xf7df('0x11c')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x11d'),require(_0xf7df('0x11e')));_0x217d8d[_0xf7df('0x7')]('/api/version',require('./api/version'));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x11f'),require(_0xf7df('0x120')));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x121'),require(_0xf7df('0x122')));_0x217d8d[_0xf7df('0x7')]('/api/webbar',require(_0xf7df('0x123')));_0x217d8d[_0xf7df('0x7')]('/apidoc',express[_0xf7df('0x124')](path['join'](config[_0xf7df('0x125')],_0xf7df('0x126'))));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x127'),express['static'](path[_0xf7df('0x128')](config[_0xf7df('0x125')],_0xf7df('0x127'))));_0x217d8d[_0xf7df('0x7')]('/demo',express['static'](path[_0xf7df('0x128')](config[_0xf7df('0x125')],'/demo')));_0x217d8d[_0xf7df('0x7')]('/snippet',express['static'](path[_0xf7df('0x128')](config['root'],_0xf7df('0x129'),_0xf7df('0x12a'))));_0x217d8d[_0xf7df('0x7')](_0xf7df('0x12b'),express['static'](path[_0xf7df('0x128')](config[_0xf7df('0x125')],_0xf7df('0x12c'))));_0x217d8d[_0xf7df('0x12d')](_0xf7df('0x12e'))[_0xf7df('0x12f')](errors[0x194]);_0x217d8d[_0xf7df('0x12d')]('/*')[_0xf7df('0x12f')](function(_0x3e9291,_0x102625){_0x102625[_0xf7df('0x130')](path[_0xf7df('0x131')](_0x217d8d['get'](_0xf7df('0x132'))+_0xf7df('0x133')));});};var sensitiveFields=[_0xf7df('0x134'),'password','newPassword',_0xf7df('0x135'),'firstName',_0xf7df('0x136'),_0xf7df('0x137'),_0xf7df('0x138'),_0xf7df('0x139'),_0xf7df('0x13a'),_0xf7df('0x13b'),_0xf7df('0x13c'),_0xf7df('0x13d'),_0xf7df('0x13e'),_0xf7df('0x13f'),_0xf7df('0x140'),_0xf7df('0x141'),'token','channelSecret',_0xf7df('0x142'),_0xf7df('0x143'),_0xf7df('0x144'),_0xf7df('0x145'),_0xf7df('0x146'),'membername',_0xf7df('0x147'),_0xf7df('0x148'),_0xf7df('0x149'),_0xf7df('0x14a'),_0xf7df('0x14b'),_0xf7df('0x14c'),_0xf7df('0x14d'),_0xf7df('0x14e'),'key',_0xf7df('0x14'),'pass',_0xf7df('0x14f'),_0xf7df('0x150'),'dsn',_0xf7df('0x151'),_0xf7df('0x152'),_0xf7df('0x153')];function maskSensitiveData(_0x355462){var _0x5ceb6c=/(?!^)[\s\S](?!$)/g;if(!_[_0xf7df('0x154')](_0x355462))return;for(var _0x28c828 in _0x355462){if(_[_0xf7df('0x155')](_0x355462[_0x28c828])){for(var _0x4cee1e=0x0;_0x4cee1e<_0x355462[_0x28c828][_0xf7df('0x156')];_0x4cee1e++){maskSensitiveData(_0x355462[_0x28c828][_0x4cee1e]);}}else if(_['isPlainObject'](_0x355462[_0x28c828])){maskSensitiveData(_0x355462[_0x28c828]);}else if(_[_0xf7df('0x157')](_0x355462[_0x28c828])){_0x355462[_0x28c828]=_0x355462[_0x28c828][_0xf7df('0x158')](/{{{/g,_0xf7df('0x159'))[_0xf7df('0x158')](/}}}/g,_0xf7df('0x15a'))[_0xf7df('0x158')](/{{/g,'@{')[_0xf7df('0x158')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x28c828)){_0x355462[_0x28c828]=_0x355462[_0x28c828][_0xf7df('0x158')](_0x5ceb6c,'*');}}}}
\ No newline at end of file
+var _0x57fb=['./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','/api/realtime','./api/realtime','/api/auth/local','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','secret','registry','oldPassword','isPlainObject','length','isString','replace','@@{','includes','lodash','path','express','express-winston','util','./config/environment','./config/logger','auth','use','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','user','role','%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)','responseTime','name','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./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/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer'];(function(_0x456d39,_0x418801){var _0x5ad1e0=function(_0x4e2dd9){while(--_0x4e2dd9){_0x456d39['push'](_0x456d39['shift']());}};_0x5ad1e0(++_0x418801);}(_0x57fb,0x1a9));var _0xb57f=function(_0x264554,_0x41dd17){_0x264554=_0x264554-0x0;var _0x353c14=_0x57fb[_0x264554];return _0x353c14;};'use strict';var _=require(_0xb57f('0x0'));var path=require(_0xb57f('0x1'));var express=require(_0xb57f('0x2'));var ewinston=require(_0xb57f('0x3'));var util=require(_0xb57f('0x4'));var errors=require('./errors');var config=require(_0xb57f('0x5'));var logger=require('./config/logger')('api');var authLogger=require(_0xb57f('0x6'))(_0xb57f('0x7'));exports['default']=function(_0x31662c){_0x31662c[_0xb57f('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3be56e,_0xeea53f){var _0x29c1bc='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xb57f('0x9')](_0x3be56e[_0xb57f('0xa')])){_0x29c1bc+=_0xb57f('0xb');var _0x5246b5=_0x3be56e[_0xb57f('0xa')];maskSensitiveData(_0x5246b5);}return util[_0xb57f('0xc')](_0x29c1bc,_0x3be56e['method'],_0x3be56e[_0xb57f('0xd')][_0xb57f('0xe')]?_0x3be56e[_0xb57f('0xd')][_0xb57f('0xe')]:_0x3be56e[_0xb57f('0xf')][_0xb57f('0x10')]||_0x3be56e['ip'],_0x3be56e[_0xb57f('0x11')],_0xeea53f[_0xb57f('0x12')],_0xeea53f['responseTime'],_0x3be56e[_0xb57f('0x13')]?_0x3be56e[_0xb57f('0x13')]['id']:null,_0x3be56e[_0xb57f('0x13')]?_0x3be56e[_0xb57f('0x13')]['name']:null,_0x3be56e[_0xb57f('0x13')]?_0x3be56e[_0xb57f('0x13')][_0xb57f('0x14')]:null,_0x5246b5?util['inspect'](_0x5246b5,![],null):'');}}));_0x31662c[_0xb57f('0x8')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x6adff4,_0xa2cef0){var _0x478673=_0xb57f('0x15');if(_0x6adff4[_0xb57f('0xa')]&&_0x6adff4['body'][_0xb57f('0x16')]&&_0x6adff4[_0xb57f('0xa')][_0xb57f('0x17')]){_0x478673=_0xb57f('0x18');}return util['format'](_0x478673,_0x6adff4['method'],_0x6adff4[_0xb57f('0xd')][_0xb57f('0xe')]?_0x6adff4['headers'][_0xb57f('0xe')]:_0x6adff4[_0xb57f('0xf')][_0xb57f('0x10')]||_0x6adff4['ip'],_0x6adff4['url'],_0xa2cef0['statusCode'],_0xa2cef0[_0xb57f('0x19')],_0x6adff4['user']?_0x6adff4[_0xb57f('0x13')]['id']:null,_0x6adff4['user']?_0x6adff4[_0xb57f('0x13')][_0xb57f('0x1a')]:null,_0x6adff4[_0xb57f('0x13')]?_0x6adff4['user']['role']:null,_0x6adff4[_0xb57f('0xa')]&&_0x6adff4[_0xb57f('0xa')][_0xb57f('0x16')]?_0x6adff4[_0xb57f('0xa')][_0xb57f('0x16')]:'other',_0x6adff4[_0xb57f('0xa')]&&_0x6adff4['body'][_0xb57f('0x17')]?_0x6adff4['body'][_0xb57f('0x17')]:'',_0x6adff4[_0xb57f('0xa')]&&_0x6adff4[_0xb57f('0xa')][_0xb57f('0x1b')]?_0x6adff4['body'][_0xb57f('0x1b')]:'');},'ignoreRoute':function(_0x151470){var _0x20a9d0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x20a9d0[_0xb57f('0x1c')](_0x151470['url']);}}));_0x31662c[_0xb57f('0x8')](_0xb57f('0x1d'),require(_0xb57f('0x1e')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x1f'),require(_0xb57f('0x20')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x21'),require(_0xb57f('0x22')));_0x31662c[_0xb57f('0x8')]('/api/voice/extensions',require(_0xb57f('0x23')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x24'),require('./api/voiceMusicOnHold'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x25'),require(_0xb57f('0x26')));_0x31662c['use'](_0xb57f('0x27'),require(_0xb57f('0x28')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x29'),require(_0xb57f('0x2a')));_0x31662c['use']('/api/voice/mails',require(_0xb57f('0x2b')));_0x31662c['use']('/api/voice/mails/messages',require(_0xb57f('0x2c')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x2d'),require(_0xb57f('0x2e')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x2f'),require(_0xb57f('0x30')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x31'),require('./api/voiceAgentReport'));_0x31662c['use'](_0xb57f('0x32'),require(_0xb57f('0x33')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x34'),require(_0xb57f('0x35')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x36'),require(_0xb57f('0x37')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x38'),require(_0xb57f('0x39')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x3a'),require(_0xb57f('0x3b')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x3c'),require(_0xb57f('0x3d')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x3e'),require('./api/mailQueue'));_0x31662c[_0xb57f('0x8')]('/api/mail/substatuses',require(_0xb57f('0x3f')));_0x31662c['use'](_0xb57f('0x40'),require(_0xb57f('0x41')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x42'),require(_0xb57f('0x43')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x44'),require(_0xb57f('0x45')));_0x31662c[_0xb57f('0x8')]('/api/mail/reports/queue',require(_0xb57f('0x46')));_0x31662c['use'](_0xb57f('0x47'),require(_0xb57f('0x48')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x49'),require(_0xb57f('0x4a')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x4b'),require(_0xb57f('0x4c')));_0x31662c[_0xb57f('0x8')]('/api/fax/applications',require(_0xb57f('0x4d')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x4e'),require(_0xb57f('0x4f')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x50'),require(_0xb57f('0x51')));_0x31662c['use'](_0xb57f('0x52'),require(_0xb57f('0x53')));_0x31662c['use']('/api/fax/reports/queue',require(_0xb57f('0x54')));_0x31662c['use'](_0xb57f('0x55'),require(_0xb57f('0x56')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x57'),require(_0xb57f('0x58')));_0x31662c['use'](_0xb57f('0x59'),require(_0xb57f('0x5a')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x5b'),require(_0xb57f('0x5c')));_0x31662c[_0xb57f('0x8')]('/api/sms/queues',require(_0xb57f('0x5d')));_0x31662c['use'](_0xb57f('0x5e'),require('./api/openchannelAccount'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x5f'),require('./api/openchannelApplication'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x60'),require(_0xb57f('0x61')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x62'),require(_0xb57f('0x63')));_0x31662c['use']('/api/openchannel/queues',require(_0xb57f('0x64')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x65'),require(_0xb57f('0x66')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x67'),require(_0xb57f('0x68')));_0x31662c[_0xb57f('0x8')]('/api/chat/applications',require(_0xb57f('0x69')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x6a'),require(_0xb57f('0x6b')));_0x31662c[_0xb57f('0x8')]('/api/chat/messages',require('./api/chatMessage'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x6c'),require(_0xb57f('0x6d')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x6e'),require('./api/chatQueue'));_0x31662c['use'](_0xb57f('0x6f'),require(_0xb57f('0x70')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x71'),require(_0xb57f('0x72')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x73'),require(_0xb57f('0x74')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x75'),require('./api/cmContact'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x76'),require(_0xb57f('0x77')));_0x31662c['use'](_0xb57f('0x78'),require('./api/cmHopperBlack'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x79'),require(_0xb57f('0x7a')));_0x31662c['use'](_0xb57f('0x7b'),require('./api/cmHopperHistory'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x7c'),require(_0xb57f('0x7d')));_0x31662c[_0xb57f('0x8')]('/api/actions',require('./api/action'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x7e'),require('./api/automation'));_0x31662c[_0xb57f('0x8')]('/api/canned_answers',require(_0xb57f('0x7f')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x80'),require(_0xb57f('0x81')));_0x31662c[_0xb57f('0x8')]('/api/conditions',require(_0xb57f('0x82')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x83'),require(_0xb57f('0x84')));_0x31662c['use'](_0xb57f('0x85'),require(_0xb57f('0x86')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x87'),require('./api/cdr'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x88'),require('./api/voiceQueuesLog'));_0x31662c['use']('/api/schedules',require('./api/schedule'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x89'),require(_0xb57f('0x8a')));_0x31662c['use'](_0xb57f('0x8b'),require(_0xb57f('0x8c')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x8d'),require(_0xb57f('0x8e')));_0x31662c[_0xb57f('0x8')]('/api/triggers',require(_0xb57f('0x8f')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x90'),require(_0xb57f('0x91')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x92'),require(_0xb57f('0x93')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x94'),require(_0xb57f('0x95')));_0x31662c[_0xb57f('0x8')]('/api/analytics/custom_reports',require(_0xb57f('0x96')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x97'),require(_0xb57f('0x98')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x99'),require(_0xb57f('0x9a')));_0x31662c['use']('/api/analytics/metrics',require('./api/analyticMetric'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x9b'),require(_0xb57f('0x9c')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x9d'),require(_0xb57f('0x9e')));_0x31662c['use'](_0xb57f('0x9f'),require(_0xb57f('0xa0')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xa1'),require(_0xb57f('0xa2')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xa3'),require('./api/intSalesforceField'));_0x31662c[_0xb57f('0x8')](_0xb57f('0xa4'),require(_0xb57f('0xa5')));_0x31662c[_0xb57f('0x8')]('/api/integrations/sugarcrm/configurations',require(_0xb57f('0xa6')));_0x31662c['use'](_0xb57f('0xa7'),require(_0xb57f('0xa8')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xa9'),require(_0xb57f('0xaa')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xab'),require('./api/intDeskConfiguration'));_0x31662c[_0xb57f('0x8')](_0xb57f('0xac'),require(_0xb57f('0xad')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xae'),require(_0xb57f('0xaf')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xb0'),require(_0xb57f('0xb1')));_0x31662c['use'](_0xb57f('0xb2'),require(_0xb57f('0xb3')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xb4'),require(_0xb57f('0xb5')));_0x31662c['use'](_0xb57f('0xb6'),require('./api/intZendeskConfiguration'));_0x31662c[_0xb57f('0x8')](_0xb57f('0xb7'),require(_0xb57f('0xb8')));_0x31662c[_0xb57f('0x8')]('/api/integrations/freshdesk/accounts',require(_0xb57f('0xb9')));_0x31662c['use'](_0xb57f('0xba'),require(_0xb57f('0xbb')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xbc'),require('./api/intFreshdeskField'));_0x31662c['use']('/api/integrations/vtiger/accounts',require(_0xb57f('0xbd')));_0x31662c['use']('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x31662c['use'](_0xb57f('0xbe'),require(_0xb57f('0xbf')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xc0'),require('./api/intServicenowAccount'));_0x31662c[_0xb57f('0x8')](_0xb57f('0xc1'),require(_0xb57f('0xc2')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xc3'),require(_0xb57f('0xc4')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xc5'),require(_0xb57f('0xc6')));_0x31662c[_0xb57f('0x8')]('/api/integrations/dynamics365/configurations',require(_0xb57f('0xc7')));_0x31662c[_0xb57f('0x8')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x31662c[_0xb57f('0x8')](_0xb57f('0xc8'),require('./api/intFreshsalesAccount'));_0x31662c[_0xb57f('0x8')](_0xb57f('0xc9'),require(_0xb57f('0xca')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xcb'),require(_0xb57f('0xcc')));_0x31662c[_0xb57f('0x8')]('/api/networks',require(_0xb57f('0xcd')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xce'),require(_0xb57f('0xcf')));_0x31662c['use'](_0xb57f('0xd0'),require(_0xb57f('0xd1')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xd2'),require(_0xb57f('0xd3')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xd4'),require(_0xb57f('0xd5')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xd6'),require(_0xb57f('0xd7')));_0x31662c[_0xb57f('0x8')]('/api/sms/reports/queue',require(_0xb57f('0xd8')));_0x31662c[_0xb57f('0x8')]('/api/square/reports',require(_0xb57f('0xd9')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xda'),require(_0xb57f('0xdb')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xdc'),require(_0xb57f('0xdd')));_0x31662c['use'](_0xb57f('0xde'),require(_0xb57f('0xdf')));_0x31662c[_0xb57f('0x8')]('/api/square/odbc',require(_0xb57f('0xe0')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xe1'),require(_0xb57f('0xe2')));_0x31662c[_0xb57f('0x8')]('/api/square/recordings',require(_0xb57f('0xe3')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xe4'),require(_0xb57f('0xe5')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xe6'),require(_0xb57f('0xe7')));_0x31662c[_0xb57f('0x8')]('/api/license',require('./api/license'));_0x31662c[_0xb57f('0x8')](_0xb57f('0xe8'),require(_0xb57f('0xe9')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xea'),require(_0xb57f('0xeb')));_0x31662c[_0xb57f('0x8')]('/api/attachments',require(_0xb57f('0xec')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xed'),require(_0xb57f('0xee')));_0x31662c[_0xb57f('0x8')]('/api/mail/reports/transfer',require(_0xb57f('0xef')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xf0'),require('./api/chatTransferReport'));_0x31662c[_0xb57f('0x8')](_0xb57f('0xf1'),require('./api/faxTransferReport'));_0x31662c['use'](_0xb57f('0xf2'),require(_0xb57f('0xf3')));_0x31662c['use'](_0xb57f('0xf4'),require('./api/smsTransferReport'));_0x31662c['use'](_0xb57f('0xf5'),require(_0xb57f('0xf6')));_0x31662c['use'](_0xb57f('0xf7'),require('./api/voicePrefix'));_0x31662c['use'](_0xb57f('0xf8'),require(_0xb57f('0xf9')));_0x31662c['use'](_0xb57f('0xfa'),require('./api/userProfileSection'));_0x31662c[_0xb57f('0x8')](_0xb57f('0xfb'),require(_0xb57f('0xfc')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xfd'),require(_0xb57f('0xfe')));_0x31662c[_0xb57f('0x8')](_0xb57f('0xff'),require(_0xb57f('0x100')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x101'),require(_0xb57f('0x102')));_0x31662c[_0xb57f('0x8')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x103'),require(_0xb57f('0x104')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x105'),require(_0xb57f('0x106')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x107'),require(_0xb57f('0x108')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x109'),require('./api/whatsappQueue'));_0x31662c['use'](_0xb57f('0x10a'),require('./api/cloudProvider'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x10b'),require(_0xb57f('0x10c')));_0x31662c['use'](_0xb57f('0x10d'),require('./api/authLocal'));_0x31662c[_0xb57f('0x8')]('/api/auth/google',require(_0xb57f('0x10e')));_0x31662c['use'](_0xb57f('0x10f'),require('./api/jira'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x110'),require(_0xb57f('0x111')));_0x31662c[_0xb57f('0x8')]('/api/version',require(_0xb57f('0x112')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x113'),require('./api/system'));_0x31662c[_0xb57f('0x8')](_0xb57f('0x114'),require(_0xb57f('0x115')));_0x31662c[_0xb57f('0x8')](_0xb57f('0x116'),require('./api/webbar'));_0x31662c['use'](_0xb57f('0x117'),express[_0xb57f('0x118')](path[_0xb57f('0x119')](config[_0xb57f('0x11a')],_0xb57f('0x117'))));_0x31662c[_0xb57f('0x8')](_0xb57f('0x11b'),express[_0xb57f('0x118')](path[_0xb57f('0x119')](config['root'],_0xb57f('0x11b'))));_0x31662c[_0xb57f('0x8')](_0xb57f('0x11c'),express[_0xb57f('0x118')](path['join'](config[_0xb57f('0x11a')],_0xb57f('0x11c'))));_0x31662c['use'](_0xb57f('0x11d'),express['static'](path['join'](config[_0xb57f('0x11a')],_0xb57f('0x11e'),_0xb57f('0x11f'))));_0x31662c[_0xb57f('0x8')](_0xb57f('0x120'),express[_0xb57f('0x118')](path[_0xb57f('0x119')](config[_0xb57f('0x11a')],_0xb57f('0x121'))));_0x31662c[_0xb57f('0x122')](_0xb57f('0x123'))[_0xb57f('0x124')](errors[0x194]);_0x31662c[_0xb57f('0x122')]('/*')[_0xb57f('0x124')](function(_0x4a5e8a,_0x5d507b){_0x5d507b[_0xb57f('0x125')](path[_0xb57f('0x126')](_0x31662c[_0xb57f('0x124')](_0xb57f('0x127'))+'/index.html'));});};var sensitiveFields=[_0xb57f('0x128'),_0xb57f('0x129'),_0xb57f('0x12a'),_0xb57f('0x12b'),_0xb57f('0x12c'),_0xb57f('0x12d'),_0xb57f('0x12e'),_0xb57f('0x12f'),_0xb57f('0x130'),'fax','email',_0xb57f('0x131'),_0xb57f('0x132'),'securityToken',_0xb57f('0x133'),_0xb57f('0x134'),_0xb57f('0x135'),'token',_0xb57f('0x136'),_0xb57f('0x137'),_0xb57f('0x138'),'authToken',_0xb57f('0x139'),_0xb57f('0x13a'),_0xb57f('0x13b'),_0xb57f('0x13c'),_0xb57f('0x13d'),'exten',_0xb57f('0x13e'),'clientEmail',_0xb57f('0x13f'),_0xb57f('0x140'),_0xb57f('0x141'),_0xb57f('0x142'),_0xb57f('0x13'),_0xb57f('0x143'),_0xb57f('0x144'),'localstationid','dsn',_0xb57f('0x145'),_0xb57f('0x146'),_0xb57f('0x147')];function maskSensitiveData(_0x28fac3){var _0x1a46be=/(?!^)[\s\S](?!$)/g;if(!_[_0xb57f('0x148')](_0x28fac3))return;for(var _0x3da7b5 in _0x28fac3){if(_['isArray'](_0x28fac3[_0x3da7b5])){for(var _0x17a5d1=0x0;_0x17a5d1<_0x28fac3[_0x3da7b5][_0xb57f('0x149')];_0x17a5d1++){maskSensitiveData(_0x28fac3[_0x3da7b5][_0x17a5d1]);}}else if(_[_0xb57f('0x148')](_0x28fac3[_0x3da7b5])){maskSensitiveData(_0x28fac3[_0x3da7b5]);}else if(_[_0xb57f('0x14a')](_0x28fac3[_0x3da7b5])){_0x28fac3[_0x3da7b5]=_0x28fac3[_0x3da7b5][_0xb57f('0x14b')](/{{{/g,_0xb57f('0x14c'))['replace'](/}}}/g,'}@@')[_0xb57f('0x14b')](/{{/g,'@{')[_0xb57f('0x14b')](/}}/g,'}@');if(_[_0xb57f('0x14d')](sensitiveFields,_0x3da7b5)){_0x28fac3[_0x3da7b5]=_0x28fac3[_0x3da7b5][_0xb57f('0x14b')](_0x1a46be,'*');}}}}
\ No newline at end of file
index b52f149..eb180d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90a3=['../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.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','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash'];(function(_0x581336,_0x1432c7){var _0x2b5e2d=function(_0x53eb53){while(--_0x53eb53){_0x581336['push'](_0x581336['shift']());}};_0x2b5e2d(++_0x1432c7);}(_0x90a3,0xde));var _0x390a=function(_0x3d7af5,_0x308d72){_0x3d7af5=_0x3d7af5-0x0;var _0x11b446=_0x90a3[_0x3d7af5];return _0x11b446;};'use strict';var jayson=require(_0x390a('0x0'));var BPromise=require(_0x390a('0x1'));var _=require(_0x390a('0x2'));var config=require(_0x390a('0x3'));exports[_0x390a('0x4')]=function(){return new BPromise(function(_0x2445bb,_0x437aba){var _0x4af377={};_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x6')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x7')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x8')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x9')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0xa')));_0x4af377=_['merge'](_0x4af377,require(_0x390a('0xb')));_0x4af377=_['merge'](_0x4af377,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0xc')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0xd')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0xe')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0xf')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x10')));_0x4af377=_['merge'](_0x4af377,require(_0x390a('0x11')));_0x4af377=_['merge'](_0x4af377,require(_0x390a('0x12')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x13')));_0x4af377=_['merge'](_0x4af377,require(_0x390a('0x14')));_0x4af377=_['merge'](_0x4af377,require(_0x390a('0x15')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/mailApplication/mailApplication.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x16')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/faxAccount/faxAccount.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/faxApplication/faxApplication.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x17')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x18')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x19')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x1a')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x1b')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x1c')));_0x4af377=_['merge'](_0x4af377,require(_0x390a('0x1d')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x1e')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x1f')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x20')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x4af377=_['merge'](_0x4af377,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x21')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x22')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x23')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x24')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/cmContact/cmContact.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x25')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x26')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x27')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x28')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x29')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x2a')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x2b')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/template/template.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/trigger/trigger.rpc'));_0x4af377=_['merge'](_0x4af377,require(_0x390a('0x2c')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x2d')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x4af377=_['merge'](_0x4af377,require(_0x390a('0x2e')));_0x4af377=_['merge'](_0x4af377,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x2f')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x30')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x31')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x32')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x33')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x34')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x35')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x36')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x37')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x38')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require('../api/squareProject/squareProject.rpc'));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x39')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x3a')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x3b')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x3c')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x3d')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x3e')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x3f')));_0x4af377=_['merge'](_0x4af377,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x4af377=_['merge'](_0x4af377,require(_0x390a('0x40')));_0x4af377=_[_0x390a('0x5')](_0x4af377,require(_0x390a('0x41')));var _0x292306=jayson[_0x390a('0x42')](_0x4af377)['http']();var _0x1584a7=config[_0x390a('0x43')][_0x390a('0x44')]||config[_0x390a('0x44')]+0x1;var _0x3223dd=config[_0x390a('0x43')]['ip']||_0x390a('0x45');_0x292306['on']('error',function(_0x510036){return _0x437aba(_0x510036);});_0x292306['listen'](_0x1584a7,_0x3223dd,function(){console[_0x390a('0x46')](_0x390a('0x47'),_0x3223dd,_0x1584a7);require(_0x390a('0x48'))[_0x390a('0x49')]();return _0x2445bb(_0x390a('0x4a')+_0x3223dd+':'+_0x1584a7);});});};
\ No newline at end of file
+var _0x56d8=['../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','listen','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc'];(function(_0x3fd864,_0x4a1108){var _0x1f0621=function(_0x546d23){while(--_0x546d23){_0x3fd864['push'](_0x3fd864['shift']());}};_0x1f0621(++_0x4a1108);}(_0x56d8,0x7c));var _0x856d=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x56d8[_0x278e3c];return _0x3e2d9b;};'use strict';var jayson=require(_0x856d('0x0'));var BPromise=require('bluebird');var _=require(_0x856d('0x1'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x4b0217,_0xceb191){var _0x42c8ca={};_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x3')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x4')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x5')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x6')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x7')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x8')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x9')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0xa')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0xb')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0xc')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0xd')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0xe')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0xf')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x10')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/mailQueue/mailQueue.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x11')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x12')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x13')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x14')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x15')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x16')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x17')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x18')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x19')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x1a')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x1b')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x1c')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/smsMessage/smsMessage.rpc'));_0x42c8ca=_['merge'](_0x42c8ca,require('../api/smsQueue/smsQueue.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x1d')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x1e')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x1f')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x20')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x21')));_0x42c8ca=_['merge'](_0x42c8ca,require('../api/chatInteraction/chatInteraction.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x22')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x23')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x24')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x25')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x26')));_0x42c8ca=_['merge'](_0x42c8ca,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x27')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x28')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x29')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x2a')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/template/template.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x2b')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/variable/variable.rpc'));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x2c')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x2d')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x2e')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x2f')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x30')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x31')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x32')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x33')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x34')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x35')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/squareReport/squareReport.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x36')));_0x42c8ca=_['merge'](_0x42c8ca,require('../api/squareOdbc/squareOdbc.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x37')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/squareRecording/squareRecording.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x38')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x39')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/attachment/attachment.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/plugin/plugin.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x3a')));_0x42c8ca=_['merge'](_0x42c8ca,require(_0x856d('0x3b')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x3c')));_0x42c8ca=_[_0x856d('0x2')](_0x42c8ca,require(_0x856d('0x3d')));var _0x229810=jayson[_0x856d('0x3e')](_0x42c8ca)['http']();var _0x68b6b3=config[_0x856d('0x3f')][_0x856d('0x40')]||config[_0x856d('0x40')]+0x1;var _0x47826c=config[_0x856d('0x3f')]['ip']||_0x856d('0x41');_0x229810['on'](_0x856d('0x42'),function(_0x358823){return _0xceb191(_0x358823);});_0x229810[_0x856d('0x43')](_0x68b6b3,_0x47826c,function(){console[_0x856d('0x44')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x47826c,_0x68b6b3);require(_0x856d('0x45'))[_0x856d('0x46')]();return _0x4b0217(_0x856d('0x47')+_0x47826c+':'+_0x68b6b3);});});};
\ No newline at end of file
index 2594fc8..eb6dd9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18d4=['match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','prototype','sendRequest','sync','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','label','util','lodash','events','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','function','no\x20code','replace','indexOf','startsWith','split','length'];(function(_0x21a60f,_0x3e109d){var _0x3de97b=function(_0x2d16ba){while(--_0x2d16ba){_0x21a60f['push'](_0x21a60f['shift']());}};_0x3de97b(++_0x3e109d);}(_0x18d4,0x19e));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x418d('0x0'));var _=require(_0x418d('0x1'));var EventEmitter=require(_0x418d('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x418d('0x3'));function AGIChannel(_0x2608e5){var _0x3c987b=this,_0x34f728=new AGIReply(),_0x406a55=![],_0x7468c9={};EventEmitter[_0x418d('0x4')](_0x3c987b);_0x2608e5[_0x418d('0x5')](_0x418d('0x6'));_0x2608e5[_0x418d('0x7')](0x8*0x3c*0x3c*0x3e8);_0x34f728[_0x418d('0x5')](_0x418d('0x6'));_0x34f728['on'](_0x418d('0x8'),function(_0x152235){for(var _0xf39286 in _0x152235){_0x3c987b[_0xf39286]=_0x152235[_0xf39286];}_0x3c987b[_0x418d('0x9')](_0x418d('0xa'));});_0x34f728['on'](_0x418d('0xb'),function(_0x36d694){if(_0x36d694[_0x418d('0xc')]()==_0x418d('0xd')){_0x3c987b['emit'](_0x418d('0xd'));return;}if(_0x36d694[_0x418d('0xe')](0x0,0xb)==_0x418d('0xf')){_0x406a55=!![];}if(_0x406a55){_0x7468c9['rx']+=_0x36d694+'\x0a';if(_0x36d694[_0x418d('0x10')]('520\x20End\x20of\x20proper')!=-0x1){_0x406a55=![];}}else{_0x7468c9['rx']=_0x36d694;}if(_0x406a55){return;}if(typeof _0x7468c9['cb']==_0x418d('0x11')){var _0x4ad8bd=_0x7468c9['rx'][_0x418d('0xe')](0x0,0x3),_0x27e0af=null,_0x378c61=null;_0x4ad8bd=parseInt(_0x4ad8bd);if(isNaN(_0x4ad8bd)){_0x7468c9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x418d('0x12')});return;}if(_0x4ad8bd!=0xc8){_0x7468c9['cb'](null,{'code':_0x4ad8bd,'result':-0x1,'extra':'KO'});return;}_0x27e0af=_0x7468c9['rx'][_0x418d('0xe')](0x4)[_0x418d('0x13')]('result=','');if(_0x27e0af[_0x418d('0x14')]('\x20')!=-0x1){_0x27e0af=_0x27e0af['substr'](0x0,_0x27e0af[_0x418d('0x14')]('\x20'));}if(_[_0x418d('0x15')](_0x27e0af,'-1')){_0x27e0af=parseInt(_0x27e0af);}_0x378c61=_0x7468c9['rx'][_0x418d('0x16')]('\x20');if(_0x378c61[_0x418d('0x17')]==0x3){_0x378c61=_0x378c61[0x2][_0x418d('0xe')](0x1,_0x378c61[0x2][_0x418d('0x17')]-0x1);}else if(_0x378c61['length']>0x3){var _0xa13f6=/\((.+)\)/;var _0xb4de=_0x7468c9['rx'][_0x418d('0x18')](_0xa13f6);if(_0xb4de){_0x378c61=_0xb4de[0x1];}else{_0x378c61=null;}}else{_0x378c61=null;}_0x7468c9['cb'](null,{'code':_0x4ad8bd,'result':_0x27e0af,'extra':_0x378c61});}});_0x2608e5['on'](_0x418d('0x19'),function(_0x2455a9){_0x3c987b[_0x418d('0x9')](_0x418d('0x19'),new AGIError(_0x418d('0x1a'),_0x2455a9[_0x418d('0x1b')]));});_0x2608e5['on'](_0x418d('0x1c'),function(){_0x3c987b[_0x418d('0x9')]('close',new AGIError(_0x418d('0x1d')));});_0x2608e5['on'](_0x418d('0x1e'),function(){_0x3c987b[_0x418d('0x9')](_0x418d('0x1e'),new AGIError(_0x418d('0x1f')));_0x2608e5['destroy']();});_0x2608e5['pipe'](_0x34f728);this[_0x418d('0x20')]=function(_0x5d57f8,_0x3ef79e){var _0x5d57f8=_0x5d57f8||'',_0x3ef79e=typeof _0x3ef79e==_0x418d('0x11')?_0x3ef79e:new Function();_0x7468c9={'tx':_0x5d57f8,'rx':'','cb':_0x3ef79e};_0x2608e5['write'](_0x5d57f8+'\x0a');},this['close']=function(){_0x2608e5['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x418d('0x21')][_0x418d('0x22')]=function(_0x5c81c0){return this[_0x418d('0x20')][_0x418d('0x23')](this,_0x5c81c0);};AGIChannel[_0x418d('0x21')]['answer']=function(){return this[_0x418d('0x22')]('ANSWER');};AGIChannel[_0x418d('0x21')][_0x418d('0x24')]=function(_0x1b6687,_0x31f83d,_0x1b84e3){_0x1b6687=_0x1b6687===undefined?_0x418d('0x25'):_0x1b6687;_0x31f83d=_0x31f83d===undefined?'5':_0x31f83d;_0x1b84e3=_0x1b84e3===undefined?'1':_0x1b84e3;return this[_0x418d('0x22')](util[_0x418d('0x26')](_0x418d('0x27'),_0x1b6687,_0x31f83d*0x3e8,_0x1b84e3));};AGIChannel[_0x418d('0x21')][_0x418d('0x28')]=function(_0x1b2c6c){_0x1b2c6c=_0x1b2c6c||_0x418d('0x29');return this['sendRequest'](util['format'](_0x418d('0x2a'),_0x1b2c6c));};AGIChannel[_0x418d('0x21')]['exec']=function(_0x40254f,_0x5276ee){if(_['isArray'](_0x5276ee)){return this[_0x418d('0x22')](util['format'](_0x418d('0x2b'),_0x40254f,_0x5276ee['join'](',')));}return this[_0x418d('0x22')](util[_0x418d('0x26')](_0x418d('0x2b'),_0x40254f,_0x5276ee));};AGIChannel[_0x418d('0x21')][_0x418d('0x2c')]=function(_0x3c079b){return this[_0x418d('0x22')](util[_0x418d('0x26')](_0x418d('0x2d'),_0x3c079b));};AGIChannel[_0x418d('0x21')]['setExtension']=function(_0x2a79ed){return this[_0x418d('0x22')](util[_0x418d('0x26')]('SET\x20EXTENSION\x20%s',_0x2a79ed));};AGIChannel['prototype'][_0x418d('0x2e')]=function(_0x5d397c){return this['sendRequest'](util[_0x418d('0x26')](_0x418d('0x2f'),_0x5d397c));};AGIChannel['prototype']['hangup']=function(){return this[_0x418d('0x22')](_0x418d('0x30'));};AGIChannel['prototype'][_0x418d('0x31')]=function(_0x3bc513,_0x2bd12b){var _0x3fd4f6=_[_0x418d('0x32')](_0x2bd12b)||_['isNumber'](_0x2bd12b)?_0x2bd12b['toString']():_0x2bd12b;return this[_0x418d('0x22')](util[_0x418d('0x26')](_0x418d('0x33'),_0x3bc513,_0x3fd4f6?_0x3fd4f6['toString']()[_0x418d('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x30b804,_0x219fa8){return this['sendRequest'](util['format'](_0x418d('0x34'),_0x30b804,_0x219fa8));};AGIChannel['prototype'][_0x418d('0x35')]=function(_0x5b8004,_0x4ee506){return this[_0x418d('0x22')](util[_0x418d('0x26')](_0x418d('0x36'),_0x5b8004,_0x4ee506));};AGIChannel[_0x418d('0x21')][_0x418d('0x37')]=function(_0x4ff937,_0xff59c5){return this[_0x418d('0x22')](util['format'](_0x418d('0x38'),_0x4ff937,_0xff59c5));};AGIChannel[_0x418d('0x21')]['continueAt']=function(_0x540ddd,_0x16885b,_0x94f1a9){_0x16885b=_0x16885b||this[_0x418d('0x39')];_0x94f1a9=_0x94f1a9||0x1;this[_0x418d('0x2c')](_0x540ddd);this[_0x418d('0x3a')](_0x16885b);this[_0x418d('0x2e')](_0x94f1a9);return this[_0x418d('0x28')](util[_0x418d('0x26')](_0x418d('0x3b'),_0x540ddd,_0x16885b,_0x94f1a9));};AGIChannel['prototype'][_0x418d('0x3c')]=function(_0x3ae7ee){return this[_0x418d('0x22')](util['format'](_0x418d('0x3d'),_0x3ae7ee));};AGIChannel[_0x418d('0x21')][_0x418d('0x3e')]=function(_0x2372cd,_0x12d630,_0x4536f6,_0x189e1a,_0x421866,_0x2387d3){_0x12d630=_0x12d630||_0x418d('0x3f');_0x4536f6=_0x4536f6||'';_0x189e1a=_0x189e1a===undefined?-0x1:_0x189e1a==='-1'?-0x1:_0x189e1a*0x3e8;_0x421866=_0x421866===undefined?'':'s='+_0x421866;_0x2387d3=_0x2387d3?_0x418d('0x40'):'';return this[_0x418d('0x22')](util['format'](_0x418d('0x41'),_0x2372cd,_0x12d630,_0x4536f6,_0x189e1a,_0x2387d3,_0x421866));};AGIChannel[_0x418d('0x21')]['streamFile']=function(_0xbbbdff,_0x14c20f){_0x14c20f=_0x14c20f||'';return this[_0x418d('0x22')](util[_0x418d('0x26')](_0x418d('0x42'),_0xbbbdff,_0x14c20f));};AGIChannel[_0x418d('0x21')][_0x418d('0x43')]=function(_0x22a7a7){return this[_0x418d('0x44')](_0x418d('0x45'),_0x22a7a7);};AGIChannel[_0x418d('0x21')][_0x418d('0x46')]=function(_0x5ac5b3){return this['exec'](_0x418d('0x47'),_0x5ac5b3);};AGIChannel[_0x418d('0x21')][_0x418d('0x19')]=function(_0x407da4,_0x11863b){this[_0x418d('0x28')](util[_0x418d('0x26')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x407da4['id'],_0x407da4[_0x418d('0x48')],_0x11863b));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0x8e4f=['GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','function','write','inherits','prototype','sendRequest','answer','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension'];(function(_0x50c9ae,_0x33331d){var _0x4e0a6f=function(_0x12b8ee){while(--_0x12b8ee){_0x50c9ae['push'](_0x50c9ae['shift']());}};_0x4e0a6f(++_0x33331d);}(_0x8e4f,0xa9));var _0xf8e4=function(_0x11239b,_0xdfd2b0){_0x11239b=_0x11239b-0x0;var _0x1d51c4=_0x8e4f[_0x11239b];return _0x1d51c4;};'use strict';var util=require(_0xf8e4('0x0'));var _=require(_0xf8e4('0x1'));var EventEmitter=require(_0xf8e4('0x2'))['EventEmitter'];var AGIReply=require(_0xf8e4('0x3'));var AGIError=require(_0xf8e4('0x4'));function AGIChannel(_0x24d3c7){var _0x2ed37f=this,_0x536229=new AGIReply(),_0x80e4b0=![],_0x22a647={};EventEmitter[_0xf8e4('0x5')](_0x2ed37f);_0x24d3c7[_0xf8e4('0x6')](_0xf8e4('0x7'));_0x24d3c7[_0xf8e4('0x8')](0x8*0x3c*0x3c*0x3e8);_0x536229[_0xf8e4('0x6')](_0xf8e4('0x7'));_0x536229['on']('headers',function(_0x2d89a9){for(var _0xa4cbc9 in _0x2d89a9){_0x2ed37f[_0xa4cbc9]=_0x2d89a9[_0xa4cbc9];}_0x2ed37f[_0xf8e4('0x9')](_0xf8e4('0xa'));});_0x536229['on']('line',function(_0x387d7a){if(_0x387d7a[_0xf8e4('0xb')]()==_0xf8e4('0xc')){_0x2ed37f[_0xf8e4('0x9')](_0xf8e4('0xc'));return;}if(_0x387d7a[_0xf8e4('0xd')](0x0,0xb)=='520-Invalid'){_0x80e4b0=!![];}if(_0x80e4b0){_0x22a647['rx']+=_0x387d7a+'\x0a';if(_0x387d7a[_0xf8e4('0xe')](_0xf8e4('0xf'))!=-0x1){_0x80e4b0=![];}}else{_0x22a647['rx']=_0x387d7a;}if(_0x80e4b0){return;}if(typeof _0x22a647['cb']=='function'){var _0x30b16b=_0x22a647['rx'][_0xf8e4('0xd')](0x0,0x3),_0x2a5ca0=null,_0x3d9a52=null;_0x30b16b=parseInt(_0x30b16b);if(isNaN(_0x30b16b)){_0x22a647['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf8e4('0x10')});return;}if(_0x30b16b!=0xc8){_0x22a647['cb'](null,{'code':_0x30b16b,'result':-0x1,'extra':'KO'});return;}_0x2a5ca0=_0x22a647['rx'][_0xf8e4('0xd')](0x4)[_0xf8e4('0x11')](_0xf8e4('0x12'),'');if(_0x2a5ca0[_0xf8e4('0x13')]('\x20')!=-0x1){_0x2a5ca0=_0x2a5ca0[_0xf8e4('0x14')](0x0,_0x2a5ca0[_0xf8e4('0x13')]('\x20'));}if(_[_0xf8e4('0x15')](_0x2a5ca0,'-1')){_0x2a5ca0=parseInt(_0x2a5ca0);}_0x3d9a52=_0x22a647['rx'][_0xf8e4('0x16')]('\x20');if(_0x3d9a52['length']==0x3){_0x3d9a52=_0x3d9a52[0x2]['substring'](0x1,_0x3d9a52[0x2]['length']-0x1);}else if(_0x3d9a52[_0xf8e4('0x17')]>0x3){var _0xbcf106=/\((.+)\)/;var _0xb73593=_0x22a647['rx']['match'](_0xbcf106);if(_0xb73593){_0x3d9a52=_0xb73593[0x1];}else{_0x3d9a52=null;}}else{_0x3d9a52=null;}_0x22a647['cb'](null,{'code':_0x30b16b,'result':_0x2a5ca0,'extra':_0x3d9a52});}});_0x24d3c7['on'](_0xf8e4('0x18'),function(_0x4991b4){_0x2ed37f[_0xf8e4('0x9')]('error',new AGIError(_0xf8e4('0x19'),_0x4991b4['code']));});_0x24d3c7['on'](_0xf8e4('0x1a'),function(){_0x2ed37f[_0xf8e4('0x9')](_0xf8e4('0x1a'),new AGIError(_0xf8e4('0x1b')));});_0x24d3c7['on'](_0xf8e4('0x1c'),function(){_0x2ed37f[_0xf8e4('0x9')]('timeout',new AGIError(_0xf8e4('0x1d')));_0x24d3c7[_0xf8e4('0x1e')]();});_0x24d3c7['pipe'](_0x536229);this[_0xf8e4('0x1f')]=function(_0x437c9b,_0x352f0f){var _0x437c9b=_0x437c9b||'',_0x352f0f=typeof _0x352f0f==_0xf8e4('0x20')?_0x352f0f:new Function();_0x22a647={'tx':_0x437c9b,'rx':'','cb':_0x352f0f};_0x24d3c7[_0xf8e4('0x21')](_0x437c9b+'\x0a');},this[_0xf8e4('0x1a')]=function(){_0x24d3c7[_0xf8e4('0x1e')]();};}util[_0xf8e4('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x24')]=function(_0x1434ce){return this['command']['sync'](this,_0x1434ce);};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x25')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0xf8e4('0x23')]['getData']=function(_0x1784c4,_0x5cd0e5,_0x53f68d){_0x1784c4=_0x1784c4===undefined?'beep':_0x1784c4;_0x5cd0e5=_0x5cd0e5===undefined?'5':_0x5cd0e5;_0x53f68d=_0x53f68d===undefined?'1':_0x53f68d;return this[_0xf8e4('0x24')](util[_0xf8e4('0x26')](_0xf8e4('0x27'),_0x1784c4,_0x5cd0e5*0x3e8,_0x53f68d));};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x28')]=function(_0x1532ef){_0x1532ef=_0x1532ef||_0xf8e4('0x29');return this[_0xf8e4('0x24')](util['format'](_0xf8e4('0x2a'),_0x1532ef));};AGIChannel['prototype']['exec']=function(_0x2aa6b,_0x214aaa){if(_[_0xf8e4('0x2b')](_0x214aaa)){return this['sendRequest'](util[_0xf8e4('0x26')](_0xf8e4('0x2c'),_0x2aa6b,_0x214aaa['join'](',')));}return this[_0xf8e4('0x24')](util[_0xf8e4('0x26')](_0xf8e4('0x2c'),_0x2aa6b,_0x214aaa));};AGIChannel['prototype'][_0xf8e4('0x2d')]=function(_0x4da5c4){return this[_0xf8e4('0x24')](util[_0xf8e4('0x26')](_0xf8e4('0x2e'),_0x4da5c4));};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x2f')]=function(_0x3dcccb){return this[_0xf8e4('0x24')](util[_0xf8e4('0x26')](_0xf8e4('0x30'),_0x3dcccb));};AGIChannel['prototype'][_0xf8e4('0x31')]=function(_0xdb4dbb){return this[_0xf8e4('0x24')](util[_0xf8e4('0x26')](_0xf8e4('0x32'),_0xdb4dbb));};AGIChannel['prototype'][_0xf8e4('0xc')]=function(){return this[_0xf8e4('0x24')](_0xf8e4('0x33'));};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x34')]=function(_0x364065,_0x11c60e){var _0x28cb1a=_[_0xf8e4('0x35')](_0x11c60e)||_[_0xf8e4('0x36')](_0x11c60e)?_0x11c60e['toString']():_0x11c60e;return this[_0xf8e4('0x24')](util[_0xf8e4('0x26')](_0xf8e4('0x37'),_0x364065,_0x28cb1a?_0x28cb1a[_0xf8e4('0x38')]()[_0xf8e4('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x39')]=function(_0x14fb39,_0xf8af35){return this[_0xf8e4('0x24')](util[_0xf8e4('0x26')](_0xf8e4('0x3a'),_0x14fb39,_0xf8af35));};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x3b')]=function(_0x5aeb36,_0x513aba){return this['sendRequest'](util[_0xf8e4('0x26')](_0xf8e4('0x3c'),_0x5aeb36,_0x513aba));};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x3d')]=function(_0x2d0e8a,_0x3ee515){return this[_0xf8e4('0x24')](util[_0xf8e4('0x26')](_0xf8e4('0x3e'),_0x2d0e8a,_0x3ee515));};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x3f')]=function(_0xf025a3,_0x3bb805,_0x3daed3){_0x3bb805=_0x3bb805||this[_0xf8e4('0x40')];_0x3daed3=_0x3daed3||0x1;this['setContext'](_0xf025a3);this[_0xf8e4('0x2f')](_0x3bb805);this[_0xf8e4('0x31')](_0x3daed3);return this[_0xf8e4('0x28')](util[_0xf8e4('0x26')](_0xf8e4('0x41'),_0xf025a3,_0x3bb805,_0x3daed3));};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x42')]=function(_0x2b6aad){return this[_0xf8e4('0x24')](util[_0xf8e4('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x2b6aad));};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x43')]=function(_0x3cc4c4,_0x2d33a5,_0x3c24b8,_0x52d44a,_0x130d4e,_0x4f6edf){_0x2d33a5=_0x2d33a5||_0xf8e4('0x44');_0x3c24b8=_0x3c24b8||'';_0x52d44a=_0x52d44a===undefined?-0x1:_0x52d44a==='-1'?-0x1:_0x52d44a*0x3e8;_0x130d4e=_0x130d4e===undefined?'':'s='+_0x130d4e;_0x4f6edf=_0x4f6edf?_0xf8e4('0x45'):'';return this['sendRequest'](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3cc4c4,_0x2d33a5,_0x3c24b8,_0x52d44a,_0x4f6edf,_0x130d4e));};AGIChannel[_0xf8e4('0x23')]['streamFile']=function(_0x58f510,_0x1f9833){_0x1f9833=_0x1f9833||'';return this['sendRequest'](util[_0xf8e4('0x26')](_0xf8e4('0x46'),_0x58f510,_0x1f9833));};AGIChannel[_0xf8e4('0x23')]['agi']=function(_0x3e2308){return this[_0xf8e4('0x47')](_0xf8e4('0x48'),_0x3e2308);};AGIChannel[_0xf8e4('0x23')][_0xf8e4('0x49')]=function(_0x4d97f7){return this[_0xf8e4('0x47')](_0xf8e4('0x4a'),_0x4d97f7);};AGIChannel['prototype'][_0xf8e4('0x18')]=function(_0x28b00d,_0x14e4eb){this[_0xf8e4('0x28')](util[_0xf8e4('0x26')](_0xf8e4('0x4b'),_0x28b00d['id'],_0x28b00d[_0xf8e4('0x4c')],_0x14e4eb));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf8e4('0x4d')]=AGIChannel;
\ No newline at end of file
index 5151577..c3da493 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dbc=['push','format','apply','message','name','exports','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x153c9a,_0x1a7d62){var _0x5cf635=function(_0x53602c){while(--_0x53602c){_0x153c9a['push'](_0x153c9a['shift']());}};_0x5cf635(++_0x1a7d62);}(_0x8dbc,0x124));var _0xc8db=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x8dbc[_0xae7c2f];return _0x5d7001;};'use strict';var util=require(_0xc8db('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xc8db('0x1'),'E_AGI_SERVER_CLOSE':_0xc8db('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xc8db('0x3'),'E_AGI_SOCKET_TIMEOUT':_0xc8db('0x4'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc8db('0x5'),'E_AGI_IVR_ENTRY':_0xc8db('0x6')};function AGIError(_0x4d01fd){var _0x4d01fd=_0x4d01fd||null,_0x2e7cf4=_0x2e7cf4||[],_0xc78964=0x1,_0x273eda='';if(!error[_0x4d01fd]){_0x4d01fd='E_AGI_UNDEFINED';}_0x2e7cf4['push'](error[_0x4d01fd]);while(arguments[_0xc78964]){_0x2e7cf4[_0xc8db('0x7')](arguments[_0xc78964]);_0xc78964++;}_0x273eda=util[_0xc8db('0x8')][_0xc8db('0x9')](util,_0x2e7cf4);this[_0xc8db('0xa')]=_0x273eda;this[_0xc8db('0xb')]=_0x4d01fd;}module[_0xc8db('0xc')]=AGIError;
\ No newline at end of file
+var _0x33d7=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','E_AGI_UNDEFINED','push','apply','message'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x33d7,0x1c2));var _0x733d=function(_0x10d19c,_0x299cf4){_0x10d19c=_0x10d19c-0x0;var _0x1a6581=_0x33d7[_0x10d19c];return _0x1a6581;};'use strict';var util=require(_0x733d('0x0'));var error={'E_AGI_UNDEFINED':_0x733d('0x1'),'E_AGI_ARGUMENT_PORT':_0x733d('0x2'),'E_AGI_SERVER_ERROR':_0x733d('0x3'),'E_AGI_SERVER_CLOSE':_0x733d('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x733d('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x733d('0x6'),'E_AGI_SOCKET_ERROR':_0x733d('0x7'),'E_AGI_SOCKET_CLOSE':_0x733d('0x8'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x733d('0x9'),'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(_0xcae14c){var _0xcae14c=_0xcae14c||null,_0x5beb76=_0x5beb76||[],_0x427428=0x1,_0x222697='';if(!error[_0xcae14c]){_0xcae14c=_0x733d('0xa');}_0x5beb76[_0x733d('0xb')](error[_0xcae14c]);while(arguments[_0x427428]){_0x5beb76[_0x733d('0xb')](arguments[_0x427428]);_0x427428++;}_0x222697=util['format'][_0x733d('0xc')](util,_0x5beb76);this[_0x733d('0xd')]=_0x222697;this[_0x733d('0xe')]=_0xcae14c;}module[_0x733d('0xf')]=AGIError;
\ No newline at end of file
index 2ad96b9..527f1fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x894f=['push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','vswitch','default','target','invalid','agicommand','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','lodash','../../../config/logger','menu','getdigits','vertices','edges','numberOfEdges','prototype','addEdge'];(function(_0x15b0e1,_0x2fdd67){var _0x268588=function(_0x4289c2){while(--_0x4289c2){_0x15b0e1['push'](_0x15b0e1['shift']());}};_0x268588(++_0x2fdd67);}(_0x894f,0xbb));var _0xf894=function(_0x219523,_0x56e545){_0x219523=_0x219523-0x0;var _0xf295f0=_0x894f[_0x219523];return _0xf295f0;};'use strict';var _=require(_0xf894('0x0'));var logger=require(_0xf894('0x1'))('agi');var verticesWithRetry=[_0xf894('0x2'),_0xf894('0x3'),'getsecretdigits'];var Graph=function(){this[_0xf894('0x4')]={};this[_0xf894('0x5')]={};this[_0xf894('0x6')]=0x0;};Graph[_0xf894('0x7')]['addVertex']=function(_0x239dda){this[_0xf894('0x4')][_0x239dda['id']]=_0x239dda;this[_0xf894('0x5')][_0x239dda['id']]=[];};Graph[_0xf894('0x7')][_0xf894('0x8')]=function(_0x2fda19,_0x45fdcc,_0x52d981){this[_0xf894('0x5')][_0x2fda19][_0xf894('0x9')]({'target':_0x45fdcc,'condition':_0x52d981});this['numberOfEdges']+=0x1;};Graph[_0xf894('0x7')][_0xf894('0xa')]=function(){return _['size'](this['vertices']);};Graph[_0xf894('0x7')][_0xf894('0xb')]=function(){return this[_0xf894('0x6')];};Graph[_0xf894('0x7')][_0xf894('0xc')]=function(_0x1b5901){return this[_0xf894('0x4')][_0x1b5901];};Graph['prototype'][_0xf894('0xd')]=function(_0x1a31f8,_0x4d7706){if(!this['vertices'][_0x1a31f8]){return logger[_0xf894('0xe')](_0xf894('0xf'));}var _0x3f7b68=_0x4d7706(this[_0xf894('0x4')][_0x1a31f8]);if(!_0x3f7b68){return logger[_0xf894('0xe')]('stop\x20traverse');}if(this['edges'][_0x1a31f8][_0xf894('0x10')]===0x0){return logger[_0xf894('0xe')](_0xf894('0x11'));}for(var _0x74db37=0x0,_0x2ce129=[],_0x1c700d=![];_0x74db37<this[_0xf894('0x5')][_0x1a31f8]['length'];_0x74db37+=0x1){if(this[_0xf894('0x5')][_0x1a31f8][_0x74db37][_0xf894('0x12')]){_0x2ce129=this['edges'][_0x1a31f8][_0x74db37][_0xf894('0x12')][_0xf894('0x13')](',');for(var _0x5396ff=0x0;_0x5396ff<_0x2ce129[_0xf894('0x10')];_0x5396ff+=0x1){if(this[_0xf894('0x4')][_0x1a31f8]['agicommand']===_0xf894('0x14')&&_0x2ce129[_0x5396ff]==='-'){_0x1c700d=this[_0xf894('0x5')][_0x1a31f8][_0x74db37]['target'];logger['info'](_0xf894('0x15'),_0x2ce129[_0x5396ff],this[_0xf894('0x5')][_0x1a31f8][_0x74db37][_0xf894('0x16')]);}else if(this[_0xf894('0x4')][_0x1a31f8]['agicommand']==='menu'&&_0x2ce129[_0x5396ff]==='i'){_0x1c700d=this['edges'][_0x1a31f8][_0x74db37][_0xf894('0x16')];logger[_0xf894('0xe')](_0xf894('0x17'),_0x2ce129[_0x5396ff],this[_0xf894('0x5')][_0x1a31f8][_0x74db37][_0xf894('0x16')]);}if(_0x2ce129[_0x5396ff]===_0x3f7b68){return this[_0xf894('0xd')](this[_0xf894('0x5')][_0x1a31f8][_0x74db37][_0xf894('0x16')],_0x4d7706);}}}else{return this['traverseBFS'](this[_0xf894('0x5')][_0x1a31f8][_0x74db37][_0xf894('0x16')],_0x4d7706);}}if(_0x2ce129[_0xf894('0x10')]){if(this[_0xf894('0x4')][_0x1a31f8][_0xf894('0x18')]===_0xf894('0x14')){if(_0x1c700d){return this[_0xf894('0xd')](_0x1c700d,_0x4d7706);}return logger[_0xf894('0xe')](_0xf894('0x19'));}else if(_[_0xf894('0x1a')](verticesWithRetry,this[_0xf894('0x4')][_0x1a31f8][_0xf894('0x18')])){if(_0x3f7b68==='-'){return logger['info']('max\x20retry\x20reach');}if(_0x1c700d&&_0x3f7b68!=='t'){return this['traverseBFS'](_0x1c700d,_0x4d7706);}return this[_0xf894('0xd')](_0x1a31f8,_0x4d7706);}return logger['info'](_0xf894('0x1b'));}};module['exports']=Graph;
\ No newline at end of file
+var _0x1899=['agicommand','includes','max\x20retry\x20reach','exports','lodash','agi','menu','getdigits','getsecretdigits','edges','numberOfEdges','prototype','addVertex','vertices','addEdge','push','size','getVertex','info','stop\x20traverse','length','condition','split','vswitch','target','default','traverseBFS'];(function(_0x7e856b,_0x39d86c){var _0x4f6841=function(_0x49151f){while(--_0x49151f){_0x7e856b['push'](_0x7e856b['shift']());}};_0x4f6841(++_0x39d86c);}(_0x1899,0x148));var _0x9189=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x1899[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x9189('0x0'));var logger=require('../../../config/logger')(_0x9189('0x1'));var verticesWithRetry=[_0x9189('0x2'),_0x9189('0x3'),_0x9189('0x4')];var Graph=function(){this['vertices']={};this[_0x9189('0x5')]={};this[_0x9189('0x6')]=0x0;};Graph[_0x9189('0x7')][_0x9189('0x8')]=function(_0x1244b2){this[_0x9189('0x9')][_0x1244b2['id']]=_0x1244b2;this[_0x9189('0x5')][_0x1244b2['id']]=[];};Graph['prototype'][_0x9189('0xa')]=function(_0x239f3e,_0x358e32,_0x152773){this[_0x9189('0x5')][_0x239f3e][_0x9189('0xb')]({'target':_0x358e32,'condition':_0x152773});this[_0x9189('0x6')]+=0x1;};Graph[_0x9189('0x7')][_0x9189('0xc')]=function(){return _[_0x9189('0xc')](this['vertices']);};Graph[_0x9189('0x7')]['relations']=function(){return this[_0x9189('0x6')];};Graph[_0x9189('0x7')][_0x9189('0xd')]=function(_0x685420){return this[_0x9189('0x9')][_0x685420];};Graph[_0x9189('0x7')]['traverseBFS']=function(_0x3939f3,_0x5ad7fa){if(!this[_0x9189('0x9')][_0x3939f3]){return logger[_0x9189('0xe')]('no\x20vertex\x20found');}var _0x5e9f83=_0x5ad7fa(this[_0x9189('0x9')][_0x3939f3]);if(!_0x5e9f83){return logger[_0x9189('0xe')](_0x9189('0xf'));}if(this[_0x9189('0x5')][_0x3939f3]['length']===0x0){return logger[_0x9189('0xe')]('no\x20edge/s\x20available');}for(var _0x1ff9fe=0x0,_0x42d6cc=[],_0x3a0981=![];_0x1ff9fe<this[_0x9189('0x5')][_0x3939f3][_0x9189('0x10')];_0x1ff9fe+=0x1){if(this[_0x9189('0x5')][_0x3939f3][_0x1ff9fe]['condition']){_0x42d6cc=this[_0x9189('0x5')][_0x3939f3][_0x1ff9fe][_0x9189('0x11')][_0x9189('0x12')](',');for(var _0x37cbe7=0x0;_0x37cbe7<_0x42d6cc[_0x9189('0x10')];_0x37cbe7+=0x1){if(this[_0x9189('0x9')][_0x3939f3]['agicommand']===_0x9189('0x13')&&_0x42d6cc[_0x37cbe7]==='-'){_0x3a0981=this['edges'][_0x3939f3][_0x1ff9fe][_0x9189('0x14')];logger['info'](_0x9189('0x15'),_0x42d6cc[_0x37cbe7],this['edges'][_0x3939f3][_0x1ff9fe][_0x9189('0x14')]);}else if(this[_0x9189('0x9')][_0x3939f3]['agicommand']===_0x9189('0x2')&&_0x42d6cc[_0x37cbe7]==='i'){_0x3a0981=this[_0x9189('0x5')][_0x3939f3][_0x1ff9fe][_0x9189('0x14')];logger[_0x9189('0xe')]('invalid',_0x42d6cc[_0x37cbe7],this[_0x9189('0x5')][_0x3939f3][_0x1ff9fe][_0x9189('0x14')]);}if(_0x42d6cc[_0x37cbe7]===_0x5e9f83){return this['traverseBFS'](this[_0x9189('0x5')][_0x3939f3][_0x1ff9fe]['target'],_0x5ad7fa);}}}else{return this[_0x9189('0x16')](this[_0x9189('0x5')][_0x3939f3][_0x1ff9fe][_0x9189('0x14')],_0x5ad7fa);}}if(_0x42d6cc['length']){if(this[_0x9189('0x9')][_0x3939f3][_0x9189('0x17')]===_0x9189('0x13')){if(_0x3a0981){return this[_0x9189('0x16')](_0x3a0981,_0x5ad7fa);}return logger[_0x9189('0xe')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0x9189('0x18')](verticesWithRetry,this[_0x9189('0x9')][_0x3939f3][_0x9189('0x17')])){if(_0x5e9f83==='-'){return logger['info'](_0x9189('0x19'));}if(_0x3a0981&&_0x5e9f83!=='t'){return this[_0x9189('0x16')](_0x3a0981,_0x5ad7fa);}return this[_0x9189('0x16')](_0x3939f3,_0x5ad7fa);}return logger[_0x9189('0xe')]('condition\x20not\x20found');}};module[_0x9189('0x1a')]=Graph;
\ No newline at end of file
index 8172723..9d7e183 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeeb=['then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','evtHangup','hangup','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','result','response','isUndefined','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','toString','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','util','../../config/environment','../../config/logger','../../config/license/util','./graph','./vertices','defaults','agi','127.0.0.1','error','stack','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','format','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','getSquareProject'];(function(_0x3a89f1,_0x5d81c4){var _0x6a46f5=function(_0xa3d99a){while(--_0xa3d99a){_0x3a89f1['push'](_0x3a89f1['shift']());}};_0x6a46f5(++_0x5d81c4);}(_0xbeeb,0x191));var _0xbbee=function(_0x4ac8e3,_0x38904f){_0x4ac8e3=_0x4ac8e3-0x0;var _0x1690c2=_0xbeeb[_0x4ac8e3];return _0x1690c2;};'use strict';var parser=require(_0xbbee('0x0'));var _=require(_0xbbee('0x1'));var syncho=require(_0xbbee('0x2'));var util=require(_0xbbee('0x3'));var moment=require('moment');var config=require(_0xbbee('0x4'));var logger=require(_0xbbee('0x5'))('agi');var utilLicense=require(_0xbbee('0x6'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0xbbee('0x7'));var Vertices=require(_0xbbee('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0xbbee('0x9')](config[_0xbbee('0xa')],{'ip':_0xbbee('0xb'),'port':0x11dd});function connectionHandler(_0x48e9cc){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x48e9cc);agiHandler(_0x48e9cc);}catch(_0x12a952){logger[_0xbbee('0xc')](_0x12a952[_0xbbee('0xd')]);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xbbee('0xa')][_0xbbee('0xe')]);logger[_0xbbee('0xf')](util['format'](_0xbbee('0x10'),config[_0xbbee('0xa')]['ip'],config['agi']['port']));}function errorHandler(_0x19ff6c){if(_0x19ff6c&&_0x19ff6c[_0xbbee('0x11')]&&_0x19ff6c[_0xbbee('0x12')]){logger[_0xbbee('0xc')](util[_0xbbee('0x13')](_0xbbee('0x14'),_0x19ff6c['name'],_0x19ff6c['message']));}else{logger[_0xbbee('0xc')](util['format'](_0xbbee('0x15'),_0x19ff6c[_0xbbee('0xd')]));}}function closeHandler(){logger[_0xbbee('0xf')](util[_0xbbee('0x13')](_0xbbee('0x16'),this['arg_1'],this[_0xbbee('0x17')],this['callerid'],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x19e5b3){logger[_0xbbee('0xc')](_0x19e5b3[_0xbbee('0xd')]);}}function timeoutHandler(){logger[_0xbbee('0xf')](util[_0xbbee('0x13')](_0xbbee('0x18'),this[_0xbbee('0x19')],this[_0xbbee('0x17')],this[_0xbbee('0x1a')],this[_0xbbee('0x1b')],this[_0xbbee('0x1c')]));}function hangupHandler(){logger[_0xbbee('0xf')](util['format'](_0xbbee('0x1d'),this[_0xbbee('0x19')],this[_0xbbee('0x17')],this[_0xbbee('0x1a')],this[_0xbbee('0x1b')],this[_0xbbee('0x1c')]));this['evtHangup']=!![];}function getRoot(_0x4677b2){return parser[_0xbbee('0x1e')](_0x4677b2,{'object':!![]})[_0xbbee('0x1f')]['root'];}function addVertex(_0x55fa99,_0x421688,_0x35c261){_0x421688[_0xbbee('0x20')]=_0x35c261;if(_0x421688[_0xbbee('0x21')](_0xbbee('0x22'))){_0x421688[_0xbbee('0x23')]=parseInt(_0x421688[_0xbbee('0x22')],0xa);}_0x55fa99[_0xbbee('0x24')](_[_0xbbee('0x25')](_0x421688,_0xbbee('0x26')));}function initGraph(_0x2b9916,_0x25e7f2){var _0x47db52=new Graph();for(var _0x4d9950 in _0x2b9916){if(_0x2b9916[_0xbbee('0x21')](_0x4d9950)){if(_['isArray'](_0x2b9916[_0x4d9950])){for(var _0x337658=0x0;_0x337658<_0x2b9916[_0x4d9950][_0xbbee('0x27')];_0x337658+=0x1){addVertex(_0x47db52,_0x2b9916[_0x4d9950][_0x337658],_0x4d9950);}}else{addVertex(_0x47db52,_0x2b9916[_0x4d9950],_0x4d9950);}}}for(var _0x333d81=0x0;_0x333d81<_0x25e7f2[_0xbbee('0x27')];_0x333d81+=0x1){if(_0x25e7f2[_0x333d81][_0xbbee('0x28')]&&_0x25e7f2[_0x333d81][_0xbbee('0x29')]){_0x47db52[_0xbbee('0x2a')](_0x25e7f2[_0x333d81]['source'],_0x25e7f2[_0x333d81][_0xbbee('0x29')],_0x25e7f2[_0x333d81]['value']);}}return _0x47db52;}function getSquareProject(_0x57bfbd,_0x18b5aa){rpc[_0xbbee('0x2b')](_0x57bfbd)[_0xbbee('0x2c')](function(_0x1700b7){_0x18b5aa(null,_0x1700b7);})[_0xbbee('0x2d')](function(_0x57b56c){_0x18b5aa(null,_0x57b56c);});}function createSquareReport(_0x160592,_0x4cef5d){rpc[_0xbbee('0x2e')](_0x160592)[_0xbbee('0x2c')](function(_0x5f08fc){if(_0x4cef5d){_0x4cef5d(null,_0x5f08fc);}})['catch'](function(_0xb10609){if(_0x4cef5d){_0x4cef5d(null,_0xb10609);}});}function setChannelVariables(_0x1dd514){for(var _0x176e0c in _0x1dd514){if(_0x1dd514[_0xbbee('0x21')](_0x176e0c)){if(_0x176e0c[_0xbbee('0x2f')](_0xbbee('0x30'))===0x0){_0x1dd514[_0x176e0c[_0xbbee('0x31')](0x4)]=_0x1dd514[_0x176e0c];delete _0x1dd514[_0x176e0c];}}}}function getLogFromObject(_0x5ef93f){return util[_0xbbee('0x32')](_0x5ef93f,{'showHidden':![],'depth':null});}function agiHandler(_0x6daae6){var _0x418ccf,_0x54d80b,_0x31a5da,_0x42ce97,_0x7043fa;logger[_0xbbee('0x33')](_0xbbee('0x34'),JSON[_0xbbee('0x35')](_0x6daae6,null,0x2));logger[_0xbbee('0xf')](util[_0xbbee('0x13')](_0xbbee('0x36'),_0x6daae6[_0xbbee('0x19')],_0x6daae6[_0xbbee('0x17')],_0x6daae6[_0xbbee('0x1a')],_0x6daae6[_0xbbee('0x1b')],_0x6daae6[_0xbbee('0x1c')]));_0x6daae6['on']('error',errorHandler);_0x6daae6['on'](_0xbbee('0x37'),closeHandler);_0x6daae6['on']('timeout',timeoutHandler);_0x6daae6[_0xbbee('0x38')]=![];_0x6daae6['on'](_0xbbee('0x39'),hangupHandler);var _0x2f6a3a=getSquareProject['sync'](null,_0x6daae6[_0xbbee('0x19')]);if(_0x2f6a3a){if(_0x2f6a3a[_0xbbee('0x3a')]){_0x418ccf=getRoot(_0x2f6a3a[_0xbbee('0x3a')]);if(_0x418ccf&&_0x418ccf[_0xbbee('0x3b')]){logger['debug'](_0xbbee('0x3c'),JSON['stringify'](_0x418ccf,null,0x2));_0x6daae6[_0xbbee('0x3d')]=moment()[_0xbbee('0x13')](_0xbbee('0x3e'));_0x54d80b=initGraph(_[_0xbbee('0x25')](_0x418ccf,_0xbbee('0x26')),_0x418ccf[_0xbbee('0x26')]);_0x31a5da=new Vertices(_0x6daae6,rpc,mailRpc);logger[_0xbbee('0xf')](util['format'](_0xbbee('0x3f'),_0x6daae6[_0xbbee('0x19')],_0x6daae6[_0xbbee('0x17')],_0x6daae6[_0xbbee('0x1a')],_0x6daae6[_0xbbee('0x1b')],_0x6daae6[_0xbbee('0x1c')]));_0x54d80b[_0xbbee('0x40')](_0x418ccf[_0xbbee('0x3b')]['id'],function(_0x3dacc1){try{_0x3dacc1=_0x31a5da[_0xbbee('0x41')](_0x3dacc1);logger[_0xbbee('0x33')]('vertex',JSON[_0xbbee('0x35')](_0x3dacc1,null,0x2));if(_0x3dacc1[_0xbbee('0x20')]===_0xbbee('0x42')){logger[_0xbbee('0xf')](_0xbbee('0x43'));_0x6daae6['context']=_0x3dacc1[_0xbbee('0x44')]||_0x6daae6['context'];_0x6daae6[_0xbbee('0x45')]=_0x3dacc1[_0xbbee('0x45')];_0x6daae6[_0xbbee('0x46')]=_0x3dacc1[_0xbbee('0x46')]?_0x3dacc1['priority']-0x1:0x1;return null;}else if(_0x3dacc1&&_0x31a5da[_0x3dacc1['agicommand']]){_0x7043fa=_0x31a5da[_0x3dacc1['agicommand']](_0x3dacc1);logger[_0xbbee('0xf')]('response',JSON['stringify'](_0x7043fa,null,0x2));if(_0x7043fa&&_0x7043fa['code']===AGI_CODE_SUCCESS&&_0x7043fa[_0xbbee('0x47')]!==AGI_RESULT_ERROR&&!_0x6daae6['evtHangup']){logger[_0xbbee('0x33')](_0xbbee('0x48'),getLogFromObject(_0x7043fa));return _[_0xbbee('0x49')](_0x7043fa['result'])?null:_0x7043fa['result']['toString']();}else{logger[_0xbbee('0xc')](_0xbbee('0x48'),getLogFromObject(_0x7043fa));return null;}}else{logger[_0xbbee('0xc')](_0xbbee('0x4a'));return null;}}catch(_0x42edfc){logger[_0xbbee('0xc')](_0x42edfc[_0xbbee('0xd')]);return null;}});if(_0x418ccf[_0xbbee('0x4b')]){logger['info'](util[_0xbbee('0x13')](_0xbbee('0x4c'),_0x6daae6[_0xbbee('0x19')],_0x6daae6[_0xbbee('0x17')],_0x6daae6[_0xbbee('0x1a')],_0x6daae6[_0xbbee('0x1b')],_0x6daae6[_0xbbee('0x1c')]));_0x54d80b['traverseBFS'](_0x418ccf[_0xbbee('0x4b')]['id'],function(_0x44af62){try{_0x44af62=_0x31a5da[_0xbbee('0x41')](_0x44af62);logger[_0xbbee('0x33')](_0xbbee('0x4d'),JSON[_0xbbee('0x35')](_0x44af62,null,0x2));if(_0x44af62&&_0x31a5da[_0x44af62[_0xbbee('0x20')]]){_0x7043fa=_0x31a5da[_0x44af62['agicommand']](_0x44af62);if(_0x7043fa){logger[_0xbbee('0x33')](_0xbbee('0x48'),getLogFromObject(_0x7043fa));return _[_0xbbee('0x49')](_0x7043fa[_0xbbee('0x47')])?null:_0x7043fa[_0xbbee('0x47')][_0xbbee('0x4e')]();}else{logger[_0xbbee('0xc')](_0xbbee('0x48'),getLogFromObject(_0x7043fa));return null;}}else{logger[_0xbbee('0xc')](_0xbbee('0x4a'));return null;}}catch(_0x1b1a4b){logger[_0xbbee('0xc')](_0x1b1a4b[_0xbbee('0xd')]);return null;}});}logger[_0xbbee('0xf')](util[_0xbbee('0x13')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x6daae6[_0xbbee('0x19')],_0x6daae6['calleridname'],_0x6daae6['callerid'],_0x6daae6['dnid'],_0x6daae6[_0xbbee('0x1c')]));logger[_0xbbee('0xf')](util[_0xbbee('0x13')](_0xbbee('0x4f'),_0x6daae6['context'],_0x6daae6[_0xbbee('0x45')],parseInt(_0x6daae6['priority'],0xa)+0x1));_0x6daae6['continueAt'](_0x6daae6['context'],_0x6daae6[_0xbbee('0x45')],parseInt(_0x6daae6[_0xbbee('0x46')],0xa)+0x1);_0x6daae6['close']();}}else{logger[_0xbbee('0xc')](util[_0xbbee('0x13')](_0xbbee('0x50'),_0x6daae6[_0xbbee('0x19')]));_0x6daae6[_0xbbee('0x51')](_0x6daae6[_0xbbee('0x44')],_0x6daae6[_0xbbee('0x45')],parseInt(_0x6daae6[_0xbbee('0x46')],0xa)+0x1);_0x6daae6[_0xbbee('0x37')]();}}else{logger['error'](util[_0xbbee('0x13')](_0xbbee('0x52'),_0x6daae6['arg_1']));_0x6daae6[_0xbbee('0x51')](_0x6daae6[_0xbbee('0x44')],_0x6daae6['extension'],parseInt(_0x6daae6[_0xbbee('0x46')],0xa)+0x1);_0x6daae6[_0xbbee('0x37')]();}}function main(){var _0x5b876d;return utilLicense[_0xbbee('0x53')]()[_0xbbee('0x2c')](function(_0x21153f){if(_0x21153f){if(_0x21153f['voice']){if(_0x21153f[_0xbbee('0x54')]&&_0x21153f[_0xbbee('0x54')]>0x0){logger[_0xbbee('0xf')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x21153f['callysquare']));_0x5b876d=_0x21153f['callysquare'];}else{logger[_0xbbee('0xf')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xbbee('0xf')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x5b876d=-0x1;}}})[_0xbbee('0x2d')](function(_0x54a9f3){logger[_0xbbee('0xc')](_0xbbee('0x55'),_0x54a9f3['stack']);})[_0xbbee('0x4b')](function(){var _0x3af020=require(_0xbbee('0x56'))(config['agi'][_0xbbee('0xe')],config['agi']['ip'],_0x5b876d);_0x3af020['on'](_0xbbee('0xc'),errorHandler);_0x3af020['on'](_0xbbee('0x57'),listeningHandler);_0x3af020['on'](_0xbbee('0x58'),connectionHandler);_0x3af020['on']('close',closeHandler);});}main();
\ No newline at end of file
+var _0xaaf8=['log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','production','start','debug','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','isUndefined','toString','response','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','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','close','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','lodash','syncho','util','moment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','nextTick','error','stack'];(function(_0x187928,_0x9317c5){var _0x15bf45=function(_0xd0593e){while(--_0xd0593e){_0x187928['push'](_0x187928['shift']());}};_0x15bf45(++_0x9317c5);}(_0xaaf8,0x1c7));var _0x8aaf=function(_0x38fea3,_0x4601cf){_0x38fea3=_0x38fea3-0x0;var _0x5de2d5=_0xaaf8[_0x38fea3];return _0x5de2d5;};'use strict';var parser=require('xml2json');var _=require(_0x8aaf('0x0'));var syncho=require(_0x8aaf('0x1'));var util=require(_0x8aaf('0x2'));var moment=require(_0x8aaf('0x3'));var config=require('../../config/environment');var logger=require(_0x8aaf('0x4'))(_0x8aaf('0x5'));var utilLicense=require(_0x8aaf('0x6'));var rpc=require(_0x8aaf('0x7'));var mailRpc=require(_0x8aaf('0x8'));var Graph=require(_0x8aaf('0x9'));var Vertices=require(_0x8aaf('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8aaf('0x5')]=_[_0x8aaf('0xb')](config[_0x8aaf('0x5')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x46c9fe){process[_0x8aaf('0xc')](function(){syncho(function(){try{setChannelVariables(_0x46c9fe);agiHandler(_0x46c9fe);}catch(_0x3cb5eb){logger[_0x8aaf('0xd')](_0x3cb5eb[_0x8aaf('0xe')]);}});});}function listeningHandler(){console[_0x8aaf('0xf')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x8aaf('0x5')][_0x8aaf('0x10')]);logger[_0x8aaf('0x11')](util[_0x8aaf('0x12')](_0x8aaf('0x13'),config['agi']['ip'],config[_0x8aaf('0x5')][_0x8aaf('0x10')]));}function errorHandler(_0x334b15){if(_0x334b15&&_0x334b15[_0x8aaf('0x14')]&&_0x334b15[_0x8aaf('0x15')]){logger[_0x8aaf('0xd')](util[_0x8aaf('0x12')]('[%s]\x20%s',_0x334b15['name'],_0x334b15[_0x8aaf('0x15')]));}else{logger[_0x8aaf('0xd')](util['format'](_0x8aaf('0x16'),_0x334b15[_0x8aaf('0xe')]));}}function closeHandler(){logger[_0x8aaf('0x11')](util[_0x8aaf('0x12')](_0x8aaf('0x17'),this[_0x8aaf('0x18')],this[_0x8aaf('0x19')],this[_0x8aaf('0x1a')],this[_0x8aaf('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0xc9db3f){logger[_0x8aaf('0xd')](_0xc9db3f['stack']);}}function timeoutHandler(){logger[_0x8aaf('0x11')](util[_0x8aaf('0x12')](_0x8aaf('0x1c'),this[_0x8aaf('0x18')],this['calleridname'],this['callerid'],this[_0x8aaf('0x1b')],this[_0x8aaf('0x1d')]));}function hangupHandler(){logger[_0x8aaf('0x11')](util[_0x8aaf('0x12')](_0x8aaf('0x1e'),this[_0x8aaf('0x18')],this[_0x8aaf('0x19')],this[_0x8aaf('0x1a')],this[_0x8aaf('0x1b')],this['uniqueid']));this[_0x8aaf('0x1f')]=!![];}function getRoot(_0x24c860){return parser['toJson'](_0x24c860,{'object':!![]})[_0x8aaf('0x20')][_0x8aaf('0x21')];}function addVertex(_0x2d147b,_0x1c4bdc,_0x4f840a){_0x1c4bdc[_0x8aaf('0x22')]=_0x4f840a;if(_0x1c4bdc[_0x8aaf('0x23')](_0x8aaf('0x24'))){_0x1c4bdc[_0x8aaf('0x25')]=parseInt(_0x1c4bdc[_0x8aaf('0x24')],0xa);}_0x2d147b[_0x8aaf('0x26')](_[_0x8aaf('0x27')](_0x1c4bdc,_0x8aaf('0x28')));}function initGraph(_0x1e037e,_0xcb11e9){var _0x5d2782=new Graph();for(var _0x4c4a3e in _0x1e037e){if(_0x1e037e[_0x8aaf('0x23')](_0x4c4a3e)){if(_[_0x8aaf('0x29')](_0x1e037e[_0x4c4a3e])){for(var _0x37ec1d=0x0;_0x37ec1d<_0x1e037e[_0x4c4a3e][_0x8aaf('0x2a')];_0x37ec1d+=0x1){addVertex(_0x5d2782,_0x1e037e[_0x4c4a3e][_0x37ec1d],_0x4c4a3e);}}else{addVertex(_0x5d2782,_0x1e037e[_0x4c4a3e],_0x4c4a3e);}}}for(var _0x5ae823=0x0;_0x5ae823<_0xcb11e9[_0x8aaf('0x2a')];_0x5ae823+=0x1){if(_0xcb11e9[_0x5ae823][_0x8aaf('0x2b')]&&_0xcb11e9[_0x5ae823][_0x8aaf('0x2c')]){_0x5d2782[_0x8aaf('0x2d')](_0xcb11e9[_0x5ae823][_0x8aaf('0x2b')],_0xcb11e9[_0x5ae823][_0x8aaf('0x2c')],_0xcb11e9[_0x5ae823][_0x8aaf('0x2e')]);}}return _0x5d2782;}function getSquareProject(_0x3e7e18,_0x129146){rpc[_0x8aaf('0x2f')](_0x3e7e18)[_0x8aaf('0x30')](function(_0x219f84){_0x129146(null,_0x219f84);})[_0x8aaf('0x31')](function(_0x3e8fdb){_0x129146(null,_0x3e8fdb);});}function createSquareReport(_0x56b3fb,_0x5ca54a){rpc[_0x8aaf('0x32')](_0x56b3fb)[_0x8aaf('0x30')](function(_0x440239){if(_0x5ca54a){_0x5ca54a(null,_0x440239);}})[_0x8aaf('0x31')](function(_0x311d30){if(_0x5ca54a){_0x5ca54a(null,_0x311d30);}});}function setChannelVariables(_0x12565d){for(var _0x2418b3 in _0x12565d){if(_0x12565d['hasOwnProperty'](_0x2418b3)){if(_0x2418b3[_0x8aaf('0x33')](_0x8aaf('0x34'))===0x0){_0x12565d[_0x2418b3['substring'](0x4)]=_0x12565d[_0x2418b3];delete _0x12565d[_0x2418b3];}}}}function getLogFromObject(_0x5cc4b4){return util['inspect'](_0x5cc4b4,{'showHidden':![],'depth':null});}function agiHandler(_0x4b4539){var _0x148f5a,_0x31f7e6,_0x29fb58,_0xed6f59,_0x44d9d3;logger['debug'](_0x8aaf('0x35'),JSON[_0x8aaf('0x36')](_0x4b4539,null,0x2));logger['info'](util[_0x8aaf('0x12')](_0x8aaf('0x37'),_0x4b4539[_0x8aaf('0x18')],_0x4b4539[_0x8aaf('0x19')],_0x4b4539[_0x8aaf('0x1a')],_0x4b4539[_0x8aaf('0x1b')],_0x4b4539[_0x8aaf('0x1d')]));_0x4b4539['on'](_0x8aaf('0xd'),errorHandler);_0x4b4539['on']('close',closeHandler);_0x4b4539['on']('timeout',timeoutHandler);_0x4b4539[_0x8aaf('0x1f')]=![];_0x4b4539['on'](_0x8aaf('0x38'),hangupHandler);var _0x3ee125=getSquareProject[_0x8aaf('0x39')](null,_0x4b4539[_0x8aaf('0x18')]);if(_0x3ee125){if(_0x3ee125[_0x8aaf('0x3a')]){_0x148f5a=getRoot(_0x3ee125['production']);if(_0x148f5a&&_0x148f5a[_0x8aaf('0x3b')]){logger[_0x8aaf('0x3c')](_0x8aaf('0x21'),JSON[_0x8aaf('0x36')](_0x148f5a,null,0x2));_0x4b4539['joinAt']=moment()[_0x8aaf('0x12')](_0x8aaf('0x3d'));_0x31f7e6=initGraph(_[_0x8aaf('0x27')](_0x148f5a,'mxCell'),_0x148f5a[_0x8aaf('0x28')]);_0x29fb58=new Vertices(_0x4b4539,rpc,mailRpc);logger[_0x8aaf('0x11')](util[_0x8aaf('0x12')](_0x8aaf('0x3e'),_0x4b4539[_0x8aaf('0x18')],_0x4b4539[_0x8aaf('0x19')],_0x4b4539[_0x8aaf('0x1a')],_0x4b4539['dnid'],_0x4b4539[_0x8aaf('0x1d')]));_0x31f7e6[_0x8aaf('0x3f')](_0x148f5a[_0x8aaf('0x3b')]['id'],function(_0x18a733){try{_0x18a733=_0x29fb58['clear'](_0x18a733);logger[_0x8aaf('0x3c')](_0x8aaf('0x40'),JSON['stringify'](_0x18a733,null,0x2));if(_0x18a733[_0x8aaf('0x22')]===_0x8aaf('0x41')){logger[_0x8aaf('0x11')](_0x8aaf('0x42'));_0x4b4539[_0x8aaf('0x43')]=_0x18a733['context']||_0x4b4539[_0x8aaf('0x43')];_0x4b4539[_0x8aaf('0x44')]=_0x18a733['extension'];_0x4b4539[_0x8aaf('0x45')]=_0x18a733['priority']?_0x18a733['priority']-0x1:0x1;return null;}else if(_0x18a733&&_0x29fb58[_0x18a733[_0x8aaf('0x22')]]){_0x44d9d3=_0x29fb58[_0x18a733[_0x8aaf('0x22')]](_0x18a733);logger[_0x8aaf('0x11')]('response',JSON[_0x8aaf('0x36')](_0x44d9d3,null,0x2));if(_0x44d9d3&&_0x44d9d3[_0x8aaf('0x46')]===AGI_CODE_SUCCESS&&_0x44d9d3[_0x8aaf('0x47')]!==AGI_RESULT_ERROR&&!_0x4b4539[_0x8aaf('0x1f')]){logger[_0x8aaf('0x3c')]('response',getLogFromObject(_0x44d9d3));return _[_0x8aaf('0x48')](_0x44d9d3[_0x8aaf('0x47')])?null:_0x44d9d3[_0x8aaf('0x47')][_0x8aaf('0x49')]();}else{logger[_0x8aaf('0xd')](_0x8aaf('0x4a'),getLogFromObject(_0x44d9d3));return null;}}else{logger[_0x8aaf('0xd')](_0x8aaf('0x4b'));return null;}}catch(_0x257892){logger[_0x8aaf('0xd')](_0x257892['stack']);return null;}});if(_0x148f5a[_0x8aaf('0x4c')]){logger[_0x8aaf('0x11')](util[_0x8aaf('0x12')](_0x8aaf('0x4d'),_0x4b4539['arg_1'],_0x4b4539[_0x8aaf('0x19')],_0x4b4539[_0x8aaf('0x1a')],_0x4b4539[_0x8aaf('0x1b')],_0x4b4539[_0x8aaf('0x1d')]));_0x31f7e6[_0x8aaf('0x3f')](_0x148f5a[_0x8aaf('0x4c')]['id'],function(_0x4b2d11){try{_0x4b2d11=_0x29fb58[_0x8aaf('0x4e')](_0x4b2d11);logger[_0x8aaf('0x3c')](_0x8aaf('0x40'),JSON['stringify'](_0x4b2d11,null,0x2));if(_0x4b2d11&&_0x29fb58[_0x4b2d11[_0x8aaf('0x22')]]){_0x44d9d3=_0x29fb58[_0x4b2d11[_0x8aaf('0x22')]](_0x4b2d11);if(_0x44d9d3){logger[_0x8aaf('0x3c')](_0x8aaf('0x4a'),getLogFromObject(_0x44d9d3));return _[_0x8aaf('0x48')](_0x44d9d3['result'])?null:_0x44d9d3[_0x8aaf('0x47')]['toString']();}else{logger[_0x8aaf('0xd')](_0x8aaf('0x4a'),getLogFromObject(_0x44d9d3));return null;}}else{logger[_0x8aaf('0xd')](_0x8aaf('0x4b'));return null;}}catch(_0x5c3876){logger[_0x8aaf('0xd')](_0x5c3876[_0x8aaf('0xe')]);return null;}});}logger['info'](util[_0x8aaf('0x12')](_0x8aaf('0x4f'),_0x4b4539[_0x8aaf('0x18')],_0x4b4539['calleridname'],_0x4b4539[_0x8aaf('0x1a')],_0x4b4539[_0x8aaf('0x1b')],_0x4b4539[_0x8aaf('0x1d')]));logger[_0x8aaf('0x11')](util['format'](_0x8aaf('0x50'),_0x4b4539['context'],_0x4b4539[_0x8aaf('0x44')],parseInt(_0x4b4539[_0x8aaf('0x45')],0xa)+0x1));_0x4b4539[_0x8aaf('0x51')](_0x4b4539[_0x8aaf('0x43')],_0x4b4539[_0x8aaf('0x44')],parseInt(_0x4b4539[_0x8aaf('0x45')],0xa)+0x1);_0x4b4539[_0x8aaf('0x52')]();}}else{logger[_0x8aaf('0xd')](util[_0x8aaf('0x12')](_0x8aaf('0x53'),_0x4b4539[_0x8aaf('0x18')]));_0x4b4539[_0x8aaf('0x51')](_0x4b4539['context'],_0x4b4539[_0x8aaf('0x44')],parseInt(_0x4b4539[_0x8aaf('0x45')],0xa)+0x1);_0x4b4539['close']();}}else{logger[_0x8aaf('0xd')](util['format']('Project\x20%s\x20not\x20found',_0x4b4539['arg_1']));_0x4b4539[_0x8aaf('0x51')](_0x4b4539[_0x8aaf('0x43')],_0x4b4539[_0x8aaf('0x44')],parseInt(_0x4b4539['priority'],0xa)+0x1);_0x4b4539[_0x8aaf('0x52')]();}}function main(){var _0x2337a0;return utilLicense[_0x8aaf('0x54')]()[_0x8aaf('0x30')](function(_0x5148d4){if(_0x5148d4){if(_0x5148d4[_0x8aaf('0x55')]){if(_0x5148d4[_0x8aaf('0x56')]&&_0x5148d4[_0x8aaf('0x56')]>0x0){logger[_0x8aaf('0x11')](util[_0x8aaf('0x12')](_0x8aaf('0x57'),_0x5148d4[_0x8aaf('0x56')]));_0x2337a0=_0x5148d4['callysquare'];}else{logger['info'](_0x8aaf('0x58'));}}else{logger[_0x8aaf('0x11')](_0x8aaf('0x59'));_0x2337a0=-0x1;}}})[_0x8aaf('0x31')](function(_0x50643c){logger[_0x8aaf('0xd')](_0x8aaf('0x5a'),_0x50643c['stack']);})[_0x8aaf('0x4c')](function(){var _0x1124d2=require(_0x8aaf('0x5b'))(config['agi']['port'],config[_0x8aaf('0x5')]['ip'],_0x2337a0);_0x1124d2['on'](_0x8aaf('0xd'),errorHandler);_0x1124d2['on'](_0x8aaf('0x5c'),listeningHandler);_0x1124d2['on'](_0x8aaf('0x5d'),connectionHandler);_0x1124d2['on'](_0x8aaf('0x52'),closeHandler);});}main();
\ No newline at end of file
index 6dfd855..8edef4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x458e=['client','http','then','error','message','result','catch','bluebird','jayson/promise'];(function(_0x95a3b2,_0x57692d){var _0x2004f6=function(_0x37f8ef){while(--_0x37f8ef){_0x95a3b2['push'](_0x95a3b2['shift']());}};_0x2004f6(++_0x57692d);}(_0x458e,0x1c9));var _0xe458=function(_0x1d26d7,_0x48af54){_0x1d26d7=_0x1d26d7-0x0;var _0x9308ad=_0x458e[_0x1d26d7];return _0x9308ad;};'use strict';var BPromise=require(_0xe458('0x0'));var jayson=require(_0xe458('0x1'));var client=jayson[_0xe458('0x2')][_0xe458('0x3')]({'port':0x232b});function request(_0x4fdd86,_0x357ebd){return new BPromise(function(_0x26d80a,_0x2aca35){return client['request'](_0x4fdd86,_0x357ebd)[_0xe458('0x4')](function(_0x4870e5){if(_0x4870e5['error']){return _0x2aca35(_0x4870e5[_0xe458('0x5')][_0xe458('0x6')]);}else{return _0x26d80a(_0x4870e5[_0xe458('0x7')]);}})[_0xe458('0x8')](function(_0x2fa185){return _0x2aca35(_0x2fa185);});});}exports['sendMailMessage']=function(_0x3880d5,_0x4c52de){return request('SendMail',{'account':_0x3880d5,'message':_0x4c52de});};
\ No newline at end of file
+var _0x9f40=['SendMail','http','request','error','result','catch'];(function(_0x1798c3,_0x876ed6){var _0x4c406e=function(_0x3f16b3){while(--_0x3f16b3){_0x1798c3['push'](_0x1798c3['shift']());}};_0x4c406e(++_0x876ed6);}(_0x9f40,0xd3));var _0x09f4=function(_0x4d7f42,_0x4acc3e){_0x4d7f42=_0x4d7f42-0x0;var _0x58c0ac=_0x9f40[_0x4d7f42];return _0x58c0ac;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson['client'][_0x09f4('0x0')]({'port':0x232b});function request(_0x28a191,_0x52ddc9){return new BPromise(function(_0x4e3bb7,_0x43a3c3){return client[_0x09f4('0x1')](_0x28a191,_0x52ddc9)['then'](function(_0x1f3409){if(_0x1f3409[_0x09f4('0x2')]){return _0x43a3c3(_0x1f3409[_0x09f4('0x2')]['message']);}else{return _0x4e3bb7(_0x1f3409[_0x09f4('0x3')]);}})[_0x09f4('0x4')](function(_0x476a2a){return _0x43a3c3(_0x476a2a);});});}exports['sendMailMessage']=function(_0x5630a0,_0x14e09c){return request(_0x09f4('0x5'),{'account':_0x5630a0,'message':_0x14e09c});};
\ No newline at end of file
index 781e345..4f82e6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a59=['prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform','_localBuffer','_inBody','inherits'];(function(_0x30e6a3,_0x2d8599){var _0x50fad5=function(_0x1a8028){while(--_0x1a8028){_0x30e6a3['push'](_0x30e6a3['shift']());}};_0x50fad5(++_0x2d8599);}(_0x6a59,0x1d6));var _0x96a5=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x6a59[_0x4b73a2];return _0x383c66;};'use strict';var util=require(_0x96a5('0x0'));var Transform=require('stream')[_0x96a5('0x1')];function AGIReply(_0x2026d8){Transform['call'](this,_0x2026d8);this[_0x96a5('0x2')]='';this[_0x96a5('0x3')]=![];}util[_0x96a5('0x4')](AGIReply,Transform);AGIReply[_0x96a5('0x5')][_0x96a5('0x6')]=function(_0x3c55a0,_0x1ece7a,_0x503d4f){var _0xdc370e='\x0a',_0x400594=['\x0a\x0a',_0x96a5('0x7')],_0x49edab=-0x1,_0x2989b8=-0x1,_0x277a8c='',_0x15a3b0=0x0,_0x280c1d='',_0x36a6d8='';this[_0x96a5('0x2')]+=_0x3c55a0[_0x96a5('0x8')]();_0x280c1d=this[_0x96a5('0x2')];if(!this[_0x96a5('0x3')]){_0x15a3b0=0x0;while(_0x400594[_0x15a3b0]){while((_0x2989b8=_0x280c1d[_0x96a5('0x9')](_0x400594[_0x15a3b0]))!=-0x1){_0x277a8c=_0x400594[_0x15a3b0];_0x36a6d8=_0x280c1d[_0x96a5('0xa')](0x0,_0x2989b8);_0x280c1d=_0x280c1d[_0x96a5('0xa')](_0x2989b8+_0x277a8c['length']);var _0x5a9212=_0x36a6d8[_0x96a5('0xb')](_0xdc370e),_0x5343b1=0x0,_0x4e5e57={},_0xdd0974='',_0x34008f='',_0x24aa05=-0x1;while(_0x5a9212[_0x5343b1]){_0x24aa05=_0x5a9212[_0x5343b1]['indexOf'](':');if(_0x24aa05!=-0x1){_0xdd0974=_0x5a9212[_0x5343b1]['slice'](0x0,_0x24aa05)[_0x96a5('0xc')]();_0x34008f=_0x5a9212[_0x5343b1][_0x96a5('0xd')](_0x24aa05+0x1)[_0x96a5('0xc')]();if(_0xdd0974[_0x96a5('0xe')]>0x0){_0x4e5e57[_0xdd0974]=_0x34008f;}}else{}_0x5343b1++;}this[_0x96a5('0xf')](_0x96a5('0x10'),_0x4e5e57);this[_0x96a5('0x3')]=!![];}_0x15a3b0++;}this[_0x96a5('0x2')]=_0x280c1d;}else{while((_0x49edab=_0x280c1d['indexOf'](_0xdc370e))!=-0x1){_0x36a6d8=_0x280c1d[_0x96a5('0xa')](0x0,_0x49edab);this['emit'](_0x96a5('0x11'),_0x36a6d8);_0x280c1d=_0x280c1d['substring'](_0x49edab+_0xdc370e['length']);}this[_0x96a5('0x2')]=_0x280c1d;}_0x503d4f();};module[_0x96a5('0x12')]=AGIReply;
\ No newline at end of file
+var _0x46d1=['util','stream','Transform','call','_localBuffer','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','length','slice','trim','emit','headers','substring','line','exports'];(function(_0xa1b5c9,_0x5e4df0){var _0x1e536d=function(_0x30a341){while(--_0x30a341){_0xa1b5c9['push'](_0xa1b5c9['shift']());}};_0x1e536d(++_0x5e4df0);}(_0x46d1,0xbe));var _0x146d=function(_0x1d9995,_0x3120c5){_0x1d9995=_0x1d9995-0x0;var _0x43636c=_0x46d1[_0x1d9995];return _0x43636c;};'use strict';var util=require(_0x146d('0x0'));var Transform=require(_0x146d('0x1'))[_0x146d('0x2')];function AGIReply(_0x178604){Transform[_0x146d('0x3')](this,_0x178604);this[_0x146d('0x4')]='';this[_0x146d('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x146d('0x6')][_0x146d('0x7')]=function(_0x60b620,_0x4c888c,_0x3a122d){var _0x5aa0d8='\x0a',_0x88a7fe=['\x0a\x0a',_0x146d('0x8')],_0x33a71c=-0x1,_0x37e0ca=-0x1,_0x4b67f2='',_0x27d7da=0x0,_0x58b4dd='',_0x3f16ed='';this[_0x146d('0x4')]+=_0x60b620[_0x146d('0x9')]();_0x58b4dd=this[_0x146d('0x4')];if(!this[_0x146d('0x5')]){_0x27d7da=0x0;while(_0x88a7fe[_0x27d7da]){while((_0x37e0ca=_0x58b4dd[_0x146d('0xa')](_0x88a7fe[_0x27d7da]))!=-0x1){_0x4b67f2=_0x88a7fe[_0x27d7da];_0x3f16ed=_0x58b4dd['substring'](0x0,_0x37e0ca);_0x58b4dd=_0x58b4dd['substring'](_0x37e0ca+_0x4b67f2[_0x146d('0xb')]);var _0x3d54b3=_0x3f16ed['split'](_0x5aa0d8),_0x1abffe=0x0,_0x359a3f={},_0x218c14='',_0x49acf5='',_0x5ad02d=-0x1;while(_0x3d54b3[_0x1abffe]){_0x5ad02d=_0x3d54b3[_0x1abffe]['indexOf'](':');if(_0x5ad02d!=-0x1){_0x218c14=_0x3d54b3[_0x1abffe][_0x146d('0xc')](0x0,_0x5ad02d)[_0x146d('0xd')]();_0x49acf5=_0x3d54b3[_0x1abffe]['slice'](_0x5ad02d+0x1)[_0x146d('0xd')]();if(_0x218c14[_0x146d('0xb')]>0x0){_0x359a3f[_0x218c14]=_0x49acf5;}}else{}_0x1abffe++;}this[_0x146d('0xe')](_0x146d('0xf'),_0x359a3f);this[_0x146d('0x5')]=!![];}_0x27d7da++;}this[_0x146d('0x4')]=_0x58b4dd;}else{while((_0x33a71c=_0x58b4dd[_0x146d('0xa')](_0x5aa0d8))!=-0x1){_0x3f16ed=_0x58b4dd[_0x146d('0x10')](0x0,_0x33a71c);this[_0x146d('0xe')](_0x146d('0x11'),_0x3f16ed);_0x58b4dd=_0x58b4dd[_0x146d('0x10')](_0x33a71c+_0x5aa0d8['length']);}this[_0x146d('0x4')]=_0x58b4dd;}_0x3a122d();};module[_0x146d('0x12')]=AGIReply;
\ No newline at end of file
index 6593180..625f438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3f6=['ShowCmHopper','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','catch','getSquareProject','production','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact'];(function(_0x16384c,_0x1f2911){var _0x4ba90d=function(_0x571499){while(--_0x571499){_0x16384c['push'](_0x16384c['shift']());}};_0x4ba90d(++_0x1f2911);}(_0xa3f6,0xb5));var _0x6a3f=function(_0x525375,_0x53e2fd){_0x525375=_0x525375-0x0;var _0x37b263=_0xa3f6[_0x525375];return _0x37b263;};'use strict';var BPromise=require(_0x6a3f('0x0'));var moment=require(_0x6a3f('0x1'));var _=require(_0x6a3f('0x2'));var util=require(_0x6a3f('0x3'));var jayson=require(_0x6a3f('0x4'));var client=jayson[_0x6a3f('0x5')][_0x6a3f('0x6')]({'port':0x2329});function request(_0x204337,_0xb54b76){return new BPromise(function(_0x149b46,_0x42a502){return client['request'](_0x204337,_0xb54b76)[_0x6a3f('0x7')](function(_0x11d46f){if(_0x11d46f[_0x6a3f('0x8')]){return _0x42a502(_0x11d46f['error']['message']);}else{return _0x149b46(_0x11d46f['result']);}})[_0x6a3f('0x9')](function(_0x364288){return _0x42a502(_0x364288);});});}exports[_0x6a3f('0xa')]=function(_0x2968c0){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2968c0},'attributes':[_0x6a3f('0xb')]}});};exports['getMailAccountById']=function(_0x20e785){return request(_0x6a3f('0xc'),{'options':{'raw':![],'where':{'id':_0x20e785},'include':[{'model':_0x6a3f('0xd'),'as':_0x6a3f('0xe')}],'attributes':['id',_0x6a3f('0xf'),_0x6a3f('0x10')]}});};exports[_0x6a3f('0x11')]=function(_0x405aed){return request(_0x6a3f('0x12'),{'options':{'where':{'id':_0x405aed},'attributes':[_0x6a3f('0xf')]}});};exports[_0x6a3f('0x13')]=function(_0x26e248){return request(_0x6a3f('0x14'),{'options':{'where':{'id':_0x26e248},'attributes':['name']}});};exports[_0x6a3f('0x15')]=function(_0x156bb5){return request('ShowVariable',{'options':{'where':{'id':_0x156bb5},'attributes':[_0x6a3f('0xf')]}});};exports[_0x6a3f('0x16')]=function(_0x507509){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x507509},'attributes':[_0x6a3f('0x17')]}});};exports[_0x6a3f('0x18')]=function(_0x3f127a){return request(_0x6a3f('0x19'),{'options':{'where':{'id':_0x3f127a},'attributes':[_0x6a3f('0xf')]}});};exports['getTrunkById']=function(_0x51f43e){return request(_0x6a3f('0x1a'),{'options':{'where':{'id':_0x51f43e},'attributes':[_0x6a3f('0xf')]}});};exports[_0x6a3f('0x1b')]=function(_0x5675f6){return request(_0x6a3f('0x1c'),{'options':{'where':{'id':_0x5675f6},'attributes':[_0x6a3f('0x1d')]}});};exports['getIntervalById']=function(_0x11a02e){return request(_0x6a3f('0x1e'),{'options':{'raw':![],'where':{'id':_0x11a02e},'include':[{'model':_0x6a3f('0x1f'),'as':_0x6a3f('0x20')}]}});};exports[_0x6a3f('0x21')]=function(_0x4e2458){return request(_0x6a3f('0x22'),{'options':{'where':{'id':_0x4e2458},'attributes':['id',_0x6a3f('0xf')]}});};exports[_0x6a3f('0x23')]=function(_0x4127db){return request(_0x6a3f('0x24'),{'body':_0x4127db});};exports[_0x6a3f('0x25')]=function(_0x42c144){return request(_0x6a3f('0x26'),{'body':_0x42c144});};exports[_0x6a3f('0x27')]=function(_0x24356c){return request(_0x6a3f('0x28'),{'body':_['merge'](_0x24356c,{'project_name':_0x24356c['arg_1'],'prev_project_name':_0x24356c['arg_2']||'','is_subproject':_0x24356c[_0x6a3f('0x29')]?!![]:![],'leaveAt':moment()[_0x6a3f('0x2a')](_0x6a3f('0x2b'))})});};exports['createSquareRecording']=function(_0x437604){return request(_0x6a3f('0x2c'),{'body':_0x437604});};exports[_0x6a3f('0x2d')]=function(_0x4fdfa8){return request('CreateSquareMessage',{'body':_0x4fdfa8});};exports[_0x6a3f('0x2e')]=function(_0x5afd3f){return request(_0x6a3f('0x2f'),{'options':{'raw':![],'where':{'phone':_0x5afd3f['phone'],'ListId':_0x5afd3f[_0x6a3f('0x30')]}}})['then'](function(_0x5d21c2){if(_0x5d21c2){return _0x5d21c2;}return request(_0x6a3f('0x31'),{'body':_0x5afd3f});});};exports[_0x6a3f('0x32')]=function(_0x34335e){return request('ShowPause',{'options':{'where':{'id':_0x34335e},'attributes':[_0x6a3f('0xf')]}});};exports[_0x6a3f('0x33')]=function(_0x193bbb,_0x3d001c){return request(_0x6a3f('0x34'),{'body':{'interface':_0x3d001c},'options':{'where':_0x193bbb}});};exports['agentPause']=function(_0x17bdb0,_0x15ea87,_0x486000){return request(_0x6a3f('0x35'),{'body':{'type':_0x15ea87,'uniqueid':_0x486000},'options':{'where':_0x17bdb0}});};exports[_0x6a3f('0x36')]=function(_0x231e90){return request(_0x6a3f('0x37'),{'body':{},'options':{'where':_0x231e90}});};exports['agentLogout']=function(_0x5b6086){return request(_0x6a3f('0x38'),{'body':{},'options':{'where':_0x5b6086}});};
\ No newline at end of file
+var _0xceea=['createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact','getPauseById','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','then','message','result','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x52e018,_0x16c718){var _0x285b23=function(_0x36fb25){while(--_0x36fb25){_0x52e018['push'](_0x52e018['shift']());}};_0x285b23(++_0x16c718);}(_0xceea,0x1ab));var _0xacee=function(_0x9dca01,_0x1f41d7){_0x9dca01=_0x9dca01-0x0;var _0x59487a=_0xceea[_0x9dca01];return _0x59487a;};'use strict';var BPromise=require(_0xacee('0x0'));var moment=require(_0xacee('0x1'));var _=require(_0xacee('0x2'));var util=require(_0xacee('0x3'));var jayson=require(_0xacee('0x4'));var client=jayson[_0xacee('0x5')][_0xacee('0x6')]({'port':0x2329});function request(_0x4952a9,_0x3d23fd){return new BPromise(function(_0x16865e,_0xec6e98){return client['request'](_0x4952a9,_0x3d23fd)[_0xacee('0x7')](function(_0x4b7b3c){if(_0x4b7b3c['error']){return _0xec6e98(_0x4b7b3c['error'][_0xacee('0x8')]);}else{return _0x16865e(_0x4b7b3c[_0xacee('0x9')]);}})[_0xacee('0xa')](function(_0x5b95de){return _0xec6e98(_0x5b95de);});});}exports['getSquareProject']=function(_0x65cb90){return request(_0xacee('0xb'),{'options':{'raw':![],'where':{'name':_0x65cb90},'attributes':[_0xacee('0xc')]}});};exports[_0xacee('0xd')]=function(_0x33a493){return request(_0xacee('0xe'),{'options':{'raw':![],'where':{'id':_0x33a493},'include':[{'model':_0xacee('0xf'),'as':'Smtp'}],'attributes':['id',_0xacee('0x10'),_0xacee('0x11')]}});};exports[_0xacee('0x12')]=function(_0x42a02d){return request('ShowSquareProject',{'options':{'where':{'id':_0x42a02d},'attributes':[_0xacee('0x10')]}});};exports[_0xacee('0x13')]=function(_0x2f6a28){return request(_0xacee('0x14'),{'options':{'where':{'id':_0x2f6a28},'attributes':[_0xacee('0x10')]}});};exports[_0xacee('0x15')]=function(_0x47743a){return request('ShowVariable',{'options':{'where':{'id':_0x47743a},'attributes':[_0xacee('0x10')]}});};exports[_0xacee('0x16')]=function(_0x44616e){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x44616e},'attributes':[_0xacee('0x17')]}});};exports[_0xacee('0x18')]=function(_0x28c276){return request(_0xacee('0x19'),{'options':{'where':{'id':_0x28c276},'attributes':['name']}});};exports[_0xacee('0x1a')]=function(_0x52e992){return request(_0xacee('0x1b'),{'options':{'where':{'id':_0x52e992},'attributes':[_0xacee('0x10')]}});};exports[_0xacee('0x1c')]=function(_0x2b65d2){return request(_0xacee('0x1d'),{'options':{'where':{'id':_0x2b65d2},'attributes':[_0xacee('0x1e')]}});};exports[_0xacee('0x1f')]=function(_0x1e2981){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1e2981},'include':[{'model':_0xacee('0x20'),'as':'Intervals'}]}});};exports[_0xacee('0x21')]=function(_0x317b3c){return request(_0xacee('0x22'),{'options':{'where':{'id':_0x317b3c},'attributes':['id',_0xacee('0x10')]}});};exports[_0xacee('0x23')]=function(_0x26a22d){return request(_0xacee('0x24'),{'body':_0x26a22d});};exports[_0xacee('0x25')]=function(_0x22d8f8){return request('CreateSquareDetailsReport',{'body':_0x22d8f8});};exports[_0xacee('0x26')]=function(_0xea2cbf){return request(_0xacee('0x27'),{'body':_[_0xacee('0x28')](_0xea2cbf,{'project_name':_0xea2cbf[_0xacee('0x29')],'prev_project_name':_0xea2cbf[_0xacee('0x2a')]||'','is_subproject':_0xea2cbf[_0xacee('0x2a')]?!![]:![],'leaveAt':moment()[_0xacee('0x2b')](_0xacee('0x2c'))})});};exports[_0xacee('0x2d')]=function(_0x193223){return request(_0xacee('0x2e'),{'body':_0x193223});};exports[_0xacee('0x2f')]=function(_0x1fd2ed){return request(_0xacee('0x30'),{'body':_0x1fd2ed});};exports[_0xacee('0x31')]=function(_0x20c8d0){return request(_0xacee('0x32'),{'options':{'raw':![],'where':{'phone':_0x20c8d0['phone'],'ListId':_0x20c8d0['ListId']}}})['then'](function(_0x362f87){if(_0x362f87){return _0x362f87;}return request(_0xacee('0x33'),{'body':_0x20c8d0});});};exports[_0xacee('0x34')]=function(_0x16d75b){return request('ShowPause',{'options':{'where':{'id':_0x16d75b},'attributes':[_0xacee('0x10')]}});};exports['agentLogin']=function(_0x15332b,_0xd2e6ed){return request(_0xacee('0x35'),{'body':{'interface':_0xd2e6ed},'options':{'where':_0x15332b}});};exports[_0xacee('0x36')]=function(_0x42d83f,_0x35e27e,_0x55a86d){return request(_0xacee('0x37'),{'body':{'type':_0x35e27e,'uniqueid':_0x55a86d},'options':{'where':_0x42d83f}});};exports[_0xacee('0x38')]=function(_0x4e4497){return request('UnpauseUser',{'body':{},'options':{'where':_0x4e4497}});};exports[_0xacee('0x39')]=function(_0x4cd522){return request(_0xacee('0x3a'),{'body':{},'options':{'where':_0x4cd522}});};
\ No newline at end of file
index 644fbf5..ee89994 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6b0=['./lex','./polly'];(function(_0x174ac2,_0xa91d82){var _0x28ca76=function(_0xba7291){while(--_0xba7291){_0x174ac2['push'](_0x174ac2['shift']());}};_0x28ca76(++_0xa91d82);}(_0xa6b0,0xaf));var _0x0a6b=function(_0xa12552,_0x6382ce){_0xa12552=_0xa12552-0x0;var _0x2da4c5=_0xa6b0[_0xa12552];return _0x2da4c5;};var polly=require(_0x0a6b('0x0'));var lex=require(_0x0a6b('0x1'));module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0xea1c=['exports'];(function(_0x48cb8e,_0x2dd8f9){var _0x20517a=function(_0x2a95d0){while(--_0x2a95d0){_0x48cb8e['push'](_0x48cb8e['shift']());}};_0x20517a(++_0x2dd8f9);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};var polly=require('./polly');var lex=require('./lex');module[_0xcea1('0x0')]={'polly':polly,'lex':lex};
\ No newline at end of file
index d0c9987..e8fd1f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa571=['exports','./lib/api'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xa571,0x107));var _0x1a57=function(_0x1598ce,_0x7c1263){_0x1598ce=_0x1598ce-0x0;var _0x2cc8f6=_0xa571[_0x1598ce];return _0x2cc8f6;};'use strict';var lex=require(_0x1a57('0x0'));module[_0x1a57('0x1')]=function(_0x206f1b,_0x1067d9,_0x48485e,_0x1a071f,_0x2eebaa,_0x4d5f7a){return lex(_0x206f1b,_0x1067d9,_0x48485e,_0x1a071f,_0x2eebaa,_0x4d5f7a);};
\ No newline at end of file
+var _0xe605=['./lib/api','exports'];(function(_0x3ba94c,_0x48b551){var _0x5dc03c=function(_0x22cf12){while(--_0x22cf12){_0x3ba94c['push'](_0x3ba94c['shift']());}};_0x5dc03c(++_0x48b551);}(_0xe605,0x92));var _0x5e60=function(_0x5787ba,_0x49a683){_0x5787ba=_0x5787ba-0x0;var _0x2edd5d=_0xe605[_0x5787ba];return _0x2edd5d;};'use strict';var lex=require(_0x5e60('0x0'));module[_0x5e60('0x1')]=function(_0x5deab2,_0x36add0,_0x455efd,_0x342132,_0x1133f0,_0x4007b3){return lex(_0x5deab2,_0x36add0,_0x455efd,_0x342132,_0x1133f0,_0x4007b3);};
\ No newline at end of file
index f9b5244..0346194 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x429445,_0x274554){var _0x822ac8=function(_0x364448){while(--_0x364448){_0x429445['push'](_0x429445['shift']());}};_0x822ac8(++_0x274554);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x2c1eae,_0x24a74f){var _0x1d3494=function(_0x53aeae){while(--_0x53aeae){_0x2c1eae['push'](_0x2c1eae['shift']());}};_0x1d3494(++_0x24a74f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
index af74051..1ccb138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d65=['./lib/api','exports'];(function(_0x3f89b4,_0x1c3a0f){var _0x358553=function(_0x3d8e46){while(--_0x3d8e46){_0x3f89b4['push'](_0x3f89b4['shift']());}};_0x358553(++_0x1c3a0f);}(_0x8d65,0x78));var _0x58d6=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x8d65[_0x4baae2];return _0x1a2285;};'use strict';var polly=require(_0x58d6('0x0'));module[_0x58d6('0x1')]=function(_0x3135a0,_0x5f57cb,_0x1c1647,_0x586c62,_0x18c369,_0x22df4a,_0x34f726){return polly(_0x3135a0,_0x5f57cb,_0x1c1647,_0x586c62,_0x18c369,_0x22df4a,_0x34f726);};
\ No newline at end of file
+var _0x86d0=['exports'];(function(_0x1833be,_0x2faba3){var _0x3edaf4=function(_0x37eb9b){while(--_0x37eb9b){_0x1833be['push'](_0x1833be['shift']());}};_0x3edaf4(++_0x2faba3);}(_0x86d0,0x6e));var _0x086d=function(_0x2703cf,_0x526b31){_0x2703cf=_0x2703cf-0x0;var _0x28f18a=_0x86d0[_0x2703cf];return _0x28f18a;};'use strict';var polly=require('./lib/api');module[_0x086d('0x0')]=function(_0x250c0b,_0x4f3c48,_0x3b5f9c,_0x2ab4c2,_0x22511c,_0x5f4da9,_0x139865){return polly(_0x250c0b,_0x4f3c48,_0x3b5f9c,_0x2ab4c2,_0x22511c,_0x5f4da9,_0x139865);};
\ No newline at end of file
index 00d340d..8721e74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa984=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk','AudioStream'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa984,0x1a9));var _0x4a98=function(_0x488681,_0x2b0715){_0x488681=_0x488681-0x0;var _0x4b0804=_0xa984[_0x488681];return _0x4b0804;};'use strict';var fs=require('fs');var path=require(_0x4a98('0x0'));var BPromise=require(_0x4a98('0x1'));var rs=require('randomstring');var AWS=require(_0x4a98('0x2'));function pollyResult(_0x569007,_0x328144,_0x237cc8){return new BPromise(function(_0x50447c,_0x4bc523){_0x569007['synthesizeSpeech'](_0x328144,function(_0x116ddc,_0xa40696){if(_0x116ddc){_0x4bc523(_0x116ddc);}else if(_0xa40696){if(_0xa40696[_0x4a98('0x3')]instanceof Buffer){fs[_0x4a98('0x4')](_0x237cc8,_0xa40696['AudioStream'],function(_0x4314d8){if(_0x4314d8){_0x4bc523(_0x4314d8);}else{_0x50447c();}});}else{_0x4bc523(new Error(_0x4a98('0x5')));}}else{_0x4bc523(new Error(_0x4a98('0x6')));}});});}module[_0x4a98('0x7')]=function(_0x178507,_0xcfffbb,_0x1ab6f7,_0x571b49,_0x520090,_0x5b0284,_0x406327){var _0x23c8bf=new AWS[(_0x4a98('0x8'))]({'accessKeyId':_0x178507,'secretAccessKey':_0xcfffbb,'region':_0x1ab6f7});var _0x2a27cf={'Text':_0x520090,'TextType':_0x5b0284||_0x4a98('0x9'),'OutputFormat':_0x4a98('0xa'),'VoiceId':_0x571b49};return pollyResult(_0x23c8bf,_0x2a27cf,_0x406327);};
\ No newline at end of file
+var _0x52e3=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring','synthesizeSpeech'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x52e3,0x11e));var _0x352e=function(_0x491048,_0xb771b1){_0x491048=_0x491048-0x0;var _0x3f229f=_0x52e3[_0x491048];return _0x3f229f;};'use strict';var fs=require('fs');var path=require(_0x352e('0x0'));var BPromise=require(_0x352e('0x1'));var rs=require(_0x352e('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x3a9760,_0x35d78a,_0x21684b){return new BPromise(function(_0x4d850b,_0x5aecd6){_0x3a9760[_0x352e('0x3')](_0x35d78a,function(_0x2c58ec,_0x142846){if(_0x2c58ec){_0x5aecd6(_0x2c58ec);}else if(_0x142846){if(_0x142846[_0x352e('0x4')]instanceof Buffer){fs[_0x352e('0x5')](_0x21684b,_0x142846[_0x352e('0x4')],function(_0x37e5fe){if(_0x37e5fe){_0x5aecd6(_0x37e5fe);}else{_0x4d850b();}});}else{_0x5aecd6(new Error(_0x352e('0x6')));}}else{_0x5aecd6(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x352e('0x7')]=function(_0x3eeb91,_0x48d49a,_0xbcafc,_0xa2c1b1,_0xf32c68,_0x236457,_0x31967b){var _0x3c5754=new AWS['Polly']({'accessKeyId':_0x3eeb91,'secretAccessKey':_0x48d49a,'region':_0xbcafc});var _0x2decef={'Text':_0xf32c68,'TextType':_0x236457||_0x352e('0x8'),'OutputFormat':_0x352e('0x9'),'VoiceId':_0xa2c1b1};return pollyResult(_0x3c5754,_0x2decef,_0x31967b);};
\ No newline at end of file
index c70f4bb..5d2f312 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc110=['./lib/api'];(function(_0x3f1824,_0x2b871a){var _0x26ccb0=function(_0x3b2466){while(--_0x3b2466){_0x3f1824['push'](_0x3f1824['shift']());}};_0x26ccb0(++_0x2b871a);}(_0xc110,0xc2));var _0x0c11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc110[_0x3dd15e];return _0x231fd0;};'use strict';var asr=require(_0x0c11('0x0'));module['exports']=function(_0x1e3d0f,_0x1eb5b6,_0x3d38f4,_0x4c6cbf){return asr(_0x1e3d0f,_0x1eb5b6,_0x3d38f4);};
\ No newline at end of file
+'use strict';var asr=require('./lib/api');module['exports']=function(_0x3a9f2b,_0x471b95,_0x371465,_0x4319f1){return asr(_0x3a9f2b,_0x471b95,_0x371465);};
\ No newline at end of file
index 96789a1..6421da9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc577=['length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','8000','url','exports'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0xc577,0x172));var _0x7c57=function(_0x3af480,_0x455eff){_0x3af480=_0x3af480-0x0;var _0x3f317a=_0xc577[_0x3af480];return _0x3f317a;};'use strict';var url=require(_0x7c57('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x7c57('0x1')]=function(_0x35af09,_0xe9a500,_0x2a2415){return new BPromise(function(_0x3abdb2,_0x304922){var _0x2ea08b;if(typeof _0x35af09!=='string'||_0x35af09[_0x7c57('0x2')]===0x0){return _0x304922(_0x7c57('0x3'));}if(typeof _0xe9a500!==_0x7c57('0x4')||_0xe9a500[_0x7c57('0x2')]===0x0){return _0x304922(_0x7c57('0x5'));}if(typeof _0x2a2415!=='undefined'&&(typeof _0x2a2415!=='string'||_0x2a2415['length']===0x0)){return _0x304922(_0x7c57('0x6'));}try{_0x2ea08b=fs['readFileSync'](_0x35af09)[_0x7c57('0x7')](_0x7c57('0x8'));}catch(_0x11dd41){return _0x304922(_0x11dd41);}return _0x3abdb2({'method':_0x7c57('0x9'),'uri':host+'/v1/speech:recognize?key='+_0xe9a500,'body':{'config':{'encoding':_0x7c57('0xa'),'sampleRateHertz':_0x7c57('0xb'),'languageCode':_0x2a2415},'audio':{'content':_0x2ea08b}},'json':!![]});});};
\ No newline at end of file
+var _0xb332=['readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','lang\x20should\x20be\x20a\x20string'];(function(_0x36592c,_0x4bec92){var _0x487ec6=function(_0x66c153){while(--_0x66c153){_0x36592c['push'](_0x36592c['shift']());}};_0x487ec6(++_0x4bec92);}(_0xb332,0xd9));var _0x2b33=function(_0x5f746f,_0x5b05ab){_0x5f746f=_0x5f746f-0x0;var _0x198d15=_0xb332[_0x5f746f];return _0x198d15;};'use strict';var url=require(_0x2b33('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x2b33('0x1');module[_0x2b33('0x2')]=function(_0x5ee720,_0xf8c6a7,_0x548a70){return new BPromise(function(_0x1fe6b1,_0x4c6634){var _0x34b111;if(typeof _0x5ee720!=='string'||_0x5ee720[_0x2b33('0x3')]===0x0){return _0x4c6634(_0x2b33('0x4'));}if(typeof _0xf8c6a7!==_0x2b33('0x5')||_0xf8c6a7[_0x2b33('0x3')]===0x0){return _0x4c6634('key\x20should\x20be\x20a\x20string');}if(typeof _0x548a70!=='undefined'&&(typeof _0x548a70!==_0x2b33('0x5')||_0x548a70['length']===0x0)){return _0x4c6634(_0x2b33('0x6'));}try{_0x34b111=fs[_0x2b33('0x7')](_0x5ee720)[_0x2b33('0x8')](_0x2b33('0x9'));}catch(_0x5834bb){return _0x4c6634(_0x5834bb);}return _0x1fe6b1({'method':_0x2b33('0xa'),'uri':host+_0x2b33('0xb')+_0xf8c6a7,'body':{'config':{'encoding':_0x2b33('0xc'),'sampleRateHertz':_0x2b33('0xd'),'languageCode':_0x548a70},'audio':{'content':_0x34b111}},'json':!![]});});};
\ No newline at end of file
index a7c8a6b..03b579d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64cb=['./asr','exports'];(function(_0x113313,_0x1a7acd){var _0x56659e=function(_0x3e5b1f){while(--_0x3e5b1f){_0x113313['push'](_0x113313['shift']());}};_0x56659e(++_0x1a7acd);}(_0x64cb,0x112));var _0xb64c=function(_0x26ec1c,_0x274d1b){_0x26ec1c=_0x26ec1c-0x0;var _0x3759c0=_0x64cb[_0x26ec1c];return _0x3759c0;};var asr=require(_0xb64c('0x0'));module[_0xb64c('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xf3c4=['exports','./asr'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf3c4,0x12b));var _0x4f3c=function(_0x420bff,_0x53bda1){_0x420bff=_0x420bff-0x0;var _0x1b6cbb=_0xf3c4[_0x420bff];return _0x1b6cbb;};var asr=require(_0x4f3c('0x0'));module[_0x4f3c('0x1')]={'asr':asr};
\ No newline at end of file
index d91abe5..0119667 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcabf=['error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','finish\x20download\x20file','close','unlink','download\x20error','end','https:','transcode','wav','error\x20convert','info','start','.wav','writeFileSync','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','MP3','POST','resolve','tmp','generate','.mp3','from','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','data','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','base64','goggleTTS\x20path','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','replace','sessionPath','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','text','channelData','CustomAction','CustomActionData','AudioFromTts','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','google-tts-api','parse','util','./aws','./sestek','./tilde','../../../config/logger','agi','protocol','host','WHAT_EVER','get','statusCode'];(function(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0xcabf,0x17f));var _0xfcab=function(_0x141fe6,_0x14afb5){_0x141fe6=_0x141fe6-0x0;var _0x23d79c=_0xcabf[_0x141fe6];return _0x23d79c;};'use strict';var apiai=require(_0xfcab('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xfcab('0x1'));var fs=require('fs');var http=require(_0xfcab('0x2'));var https=require(_0xfcab('0x3'));var md5=require(_0xfcab('0x4'));var path=require(_0xfcab('0x5'));var querystring=require(_0xfcab('0x6'));var rp=require(_0xfcab('0x7'));var rs=require(_0xfcab('0x8'));var sox=require('sox');var tts=require(_0xfcab('0x9'));var urlParse=require('url')[_0xfcab('0xa')];var util=require(_0xfcab('0xb'));var aws=require(_0xfcab('0xc'));var google=require('./google');var sestek=require(_0xfcab('0xd'));var tilde=require(_0xfcab('0xe'));var logger=require(_0xfcab('0xf'))(_0xfcab('0x10'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x5ee58f,_0x41c815){return new BPromise(function(_0x6d0ccb,_0x1fd307){var _0x479a27=urlParse(_0x5ee58f);var _0x5f553c=_0x479a27[_0xfcab('0x11')]==='https:'?https:http;var _0x352cd9={'host':_0x479a27[_0xfcab('0x12')],'path':_0x479a27[_0xfcab('0x5')],'headers':{'user-agent':_0xfcab('0x13')}};_0x5f553c[_0xfcab('0x14')](_0x352cd9,function(_0x2ef957){if(_0x2ef957[_0xfcab('0x15')]!==0xc8){logger[_0xfcab('0x16')](_0xfcab('0x17')+_0x5ee58f+'\x20failed,\x20status\x20code\x20=\x20'+_0x2ef957[_0xfcab('0x15')]+'\x20('+_0x2ef957[_0xfcab('0x18')]+')');_0x1fd307(new Error(_0xfcab('0x17')+_0x5ee58f+_0xfcab('0x19')+_0x2ef957[_0xfcab('0x15')]+'\x20('+_0x2ef957[_0xfcab('0x18')]+')'));return;}var _0x48d14b=fs['createWriteStream'](_0x41c815);_0x48d14b['on'](_0xfcab('0x1a'),function(){logger['info'](_0xfcab('0x1b'));_0x48d14b[_0xfcab('0x1c')](_0x6d0ccb);});_0x48d14b['on']('error',function(_0x3e631f){fs[_0xfcab('0x1d')](_0x41c815);logger['error'](_0xfcab('0x1e'),_0x3e631f);_0x1fd307(_0x3e631f);});_0x2ef957['pipe'](_0x48d14b);})['on'](_0xfcab('0x16'),function(_0x1f3803){logger[_0xfcab('0x16')](_0x1f3803);_0x1fd307(_0x1f3803);})[_0xfcab('0x1f')]();});}function uploadFile(_0x1c15ab){return new BPromise(function(_0x5a8f06,_0x105f8b){var _0x395cdb=urlParse(_0x1c15ab);var _0x14e964=_0x395cdb[_0xfcab('0x11')]===_0xfcab('0x20')?https:http;var _0x482982={'host':_0x395cdb[_0xfcab('0x12')],'path':_0x395cdb[_0xfcab('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x14e964[_0xfcab('0x14')](_0x482982,function(_0x24a4d2){if(_0x24a4d2['statusCode']!==0xc8){_0x105f8b(new Error('request\x20to\x20'+_0x1c15ab+'\x20failed,\x20status\x20code\x20=\x20'+_0x24a4d2[_0xfcab('0x15')]+'\x20('+_0x24a4d2[_0xfcab('0x18')]+')'));return;}var _0x6b2613='';_0x24a4d2['on']('data',function(_0x1eb82a){_0x6b2613+=_0x1eb82a;});_0x24a4d2['on']('end',function(){_0x5a8f06(_0x6b2613);});})['on'](_0xfcab('0x16'),function(_0xee6ab3){_0x105f8b(_0xee6ab3);})[_0xfcab('0x1f')]();});}function convertFile(_0x4a0484,_0x3d3120){return new BPromise(function(_0x27bf2f,_0xcf9691){var _0x3ab63f=sox[_0xfcab('0x21')](_0x4a0484,_0x3d3120,{'sampleRate':0x1f40,'format':_0xfcab('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3ab63f['on']('error',function(_0x2622d4){logger[_0xfcab('0x16')](_0xfcab('0x23'),_0x2622d4);_0xcf9691(_0x2622d4);});_0x3ab63f['on'](_0xfcab('0x1f'),function(){logger[_0xfcab('0x24')]('finish\x20to\x20convert');_0x27bf2f();});_0x3ab63f[_0xfcab('0x25')]();});}function base64Decode(_0x16dc0e,_0x507444){var _0x46ef61=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xfcab('0x26'));fs[_0xfcab('0x27')](_0x46ef61,_0x16dc0e,'base64');return convertFile(_0x46ef61,_0x507444)[_0xfcab('0x28')](function(){try{fs[_0xfcab('0x1d')](_0x46ef61);fs[_0xfcab('0x29')](_0x507444,_0xfcab('0x2a'));}catch(_0x5e6b1e){logger[_0xfcab('0x16')](_0x5e6b1e);}return _0x507444[_0xfcab('0x2b')]('.')[0x0];});}function base64Encode(_0x18fd10){var _0xf18816=fs[_0xfcab('0x2c')](_0x18fd10);return new Buffer(_0xf18816)[_0xfcab('0x2d')]('base64');}exports[_0xfcab('0x2e')]=function(_0x3f1606,_0x1090df,_0x31dee9,_0xaf7261,_0xdbc70e,_0x54eb96){var _0x51af64,_0x594343;var _0x2abe8f=_0xfcab('0x2f');var _0x184dc8='?key='+_0x3f1606;var _0x5f5513={};if(_0x1090df===_0xfcab('0x30')){_0x5f5513[_0xfcab('0x31')]={'ssml':_0x31dee9};}else{_0x5f5513[_0xfcab('0x31')]={'text':_0x31dee9};};_0x5f5513[_0xfcab('0x32')]={'languageCode':_0xaf7261,'ssmlGender':_0xdbc70e};_0x5f5513['audioConfig']={'audioEncoding':_0xfcab('0x33'),'sampleRateHertz':0x1f40};var _0x1619a6={'url':_0x2abe8f+'text:synthesize'+_0x184dc8,'method':_0xfcab('0x34'),'json':!![],'body':_0x5f5513};return rp(_0x1619a6)[_0xfcab('0x28')](function(_0x49f6cd){return new BPromise(function(_0x56c439,_0xb1e1d6){_0x51af64=path[_0xfcab('0x35')](__dirname,_0xfcab('0x36'),rs[_0xfcab('0x37')](0x4)+_0xfcab('0x38'));var _0x3ff77b=Buffer[_0xfcab('0x39')](_0x49f6cd['audioContent'],'base64');return fs['writeFile'](_0x51af64,_0x3ff77b,function(_0x7fe898){_0xb1e1d6(_0x7fe898);},function(_0x488d9f){fs[_0xfcab('0x29')](_0x51af64,'777');_0x56c439(_0x488d9f);});});})[_0xfcab('0x28')](function(_0x41ee85){_0x594343=path[_0xfcab('0x35')](__dirname,_0xfcab('0x36'),rs[_0xfcab('0x37')](0x4)+'.wav');return convertFile(_0x51af64,_0x594343);})[_0xfcab('0x28')](function(){try{fs[_0xfcab('0x1d')](_0x51af64);fs['chmodSync'](_0x594343,_0xfcab('0x2a'));}catch(_0x2a66a9){logger[_0xfcab('0x16')](_0x2a66a9);}logger['info'](_0xfcab('0x3a'),_0x594343[_0xfcab('0x2b')]('.')[0x0]);return _0x594343['split']('.')[0x0];});};exports[_0xfcab('0x3b')]=function(_0x57388d,_0x1db2bd){var _0x103c0b=_0xfcab('0x3c');var _0x4a20f2,_0x4c8349;var _0x5a01b0;var _0x56fe25={'encoding':_0xfcab('0x3d'),'method':'POST','timeout':0x2710,'url':_0x103c0b,'headers':{'Content-Type':_0xfcab('0x3e')},'body':'f.req='+encodeURIComponent(JSON[_0xfcab('0x3f')]([[['jQ1olc',JSON['stringify']([_0x57388d,_0x1db2bd||'en',![],_0xfcab('0x40')]),null,_0xfcab('0x41')]]]))};return rp(_0x56fe25)['then'](function(_0x14cd63){try{_0x5a01b0=eval(_0x14cd63[_0xfcab('0x42')](0x5))[0x0][0x2];}catch(_0x2b3cde){throw new Error(_0xfcab('0x43')+_0x14cd63[_0xfcab('0x44')]);}if(!_0x5a01b0){if(_0x57388d['length']>0xc8){throw new Error(_0xfcab('0x45'));}else{throw new Error(_0xfcab('0x46')+_0x1db2bd+_0xfcab('0x47'));}}try{_0x5a01b0=eval(_0x5a01b0)[0x0];}catch(_0x1ee1f2){throw new Error(_0xfcab('0x43')+res['data']);}const _0x4377c3=_0x5a01b0;_0x4a20f2=path[_0xfcab('0x35')](__dirname,_0xfcab('0x36'),rs[_0xfcab('0x37')](0x4)+_0xfcab('0x38'));fs[_0xfcab('0x27')](_0x4a20f2,_0x5a01b0,{'encoding':_0xfcab('0x48')});_0x4c8349=path[_0xfcab('0x35')](__dirname,'tmp',rs[_0xfcab('0x37')](0x4)+'.wav');return convertFile(_0x4a20f2,_0x4c8349);})[_0xfcab('0x28')](function(){try{fs[_0xfcab('0x1d')](_0x4a20f2);fs['chmodSync'](_0x4c8349,_0xfcab('0x2a'));}catch(_0xb08365){logger[_0xfcab('0x16')](_0xb08365);}logger[_0xfcab('0x24')](_0xfcab('0x49'),_0x4c8349[_0xfcab('0x2b')]('.')[0x0]);return _0x4c8349[_0xfcab('0x2b')]('.')[0x0];});};exports['googleASR']=function(_0x29c919,_0x5b136b,_0x176df1){return google['asr'](_0x29c919,_0x5b136b,_0x176df1)[_0xfcab('0x28')](function(_0x1988f4){logger[_0xfcab('0x24')](_0x1988f4['uri']);return rp(_0x1988f4);})[_0xfcab('0x28')](function(_0x2f4e27){var _0x1b5d2d='';var _0x54ce49=0x0;try{fs[_0xfcab('0x1d')](_0x29c919);}catch(_0x40e59d){logger[_0xfcab('0x16')](_0x40e59d);}if(_0x2f4e27&&_0x2f4e27[_0xfcab('0x4a')]){_0x1b5d2d=_0x2f4e27['results'][_0xfcab('0x4b')](function(_0x4abe1d){return _0x4abe1d&&_0x4abe1d['alternatives'][0x0]&&_0x4abe1d[_0xfcab('0x4c')][0x0][_0xfcab('0x4d')]?_0x4abe1d['alternatives'][0x0][_0xfcab('0x4d')]:'';})[_0xfcab('0x4e')]('\x0a');_0x54ce49=_0x2f4e27[_0xfcab('0x4a')][_0xfcab('0x4b')](function(_0x50bc02){return _0x50bc02&&_0x50bc02['alternatives'][0x0]&&_0x50bc02[_0xfcab('0x4c')][0x0][_0xfcab('0x4f')]?_0x50bc02[_0xfcab('0x4c')][0x0]['confidence']:0x0;})[_0xfcab('0x4e')]('\x0a');}logger['info'](_0xfcab('0x50'),_0x1b5d2d);logger[_0xfcab('0x24')]('googleASR\x20confidence',_0x54ce49);return{'transcript':_0x1b5d2d,'confidence':_0x54ce49};})[_0xfcab('0x51')](function(_0x11e799){logger[_0xfcab('0x16')]('[%s]\x20%s:%s',_0x11e799[_0xfcab('0x15')],_0x11e799[_0xfcab('0x52')],_0x11e799[_0xfcab('0x53')]);});};exports[_0xfcab('0x54')]=function(_0x6c2711,_0x1dce7f,_0x2ae4fa,_0x14a2f2){var _0x4b5316=apiai(_0x1dce7f,{'language':_0x14a2f2||'en'});return _0x4b5316[_0xfcab('0x55')](_0x2ae4fa,{'sessionId':md5(_0x6c2711)})[_0xfcab('0x28')](function(_0x3ddb3d){logger['info'](JSON['stringify'](_0x3ddb3d));return{'source':_0x3ddb3d[_0xfcab('0x56')][_0xfcab('0x57')],'resolvedQuery':_0x3ddb3d[_0xfcab('0x56')][_0xfcab('0x58')],'action':_0x3ddb3d[_0xfcab('0x56')][_0xfcab('0x59')],'actionIncomplete':_0x3ddb3d[_0xfcab('0x56')][_0xfcab('0x5a')],'speech':_0x3ddb3d['result'][_0xfcab('0x5b')][_0xfcab('0x5c')],'score':_0x3ddb3d['result'][_0xfcab('0x5d')],'statusCode':_0x3ddb3d[_0xfcab('0x5e')]['code'],'endConversation':_0x3ddb3d[_0xfcab('0x56')][_0xfcab('0x5f')][_0xfcab('0x60')]||![],'isFallbackIntent':_0x3ddb3d['result'][_0xfcab('0x5f')][_0xfcab('0x61')]};});};exports['googleDialogflowV2']=function(_0x33433e,_0x51c17a,_0x599643,_0x14e20b,_0x39304c,_0x412fba){var _0x4e5591=_0x14e20b[_0xfcab('0x62')](/\\n/g,'\x0a');var _0x4fc316={'credentials':{'private_key':_0x4e5591,'client_email':_0x599643}};var _0x53411c=new dialogflow['SessionsClient'](_0x4fc316);var _0x25b56a=_0x53411c[_0xfcab('0x63')](_0x51c17a,md5(_0x33433e));var _0x442aa3={'session':_0x25b56a,'queryInput':{'text':{'text':_0x39304c,'languageCode':_0x412fba}}};return _0x53411c['detectIntent'](_0x442aa3)[_0xfcab('0x28')](function(_0x173d5a){if(_0x173d5a&&_0x173d5a[_0xfcab('0x64')]){logger[_0xfcab('0x24')](_0xfcab('0x65'),JSON[_0xfcab('0x3f')](_0x173d5a));var _0xdbd419=_0x173d5a[0x0];if(_0xdbd419){var _0x137868={'action':_0xdbd419[_0xfcab('0x66')][_0xfcab('0x59')],'allRequiredParamsPresent':_0xdbd419[_0xfcab('0x66')][_0xfcab('0x67')],'endConversation':_0xdbd419[_0xfcab('0x66')][_0xfcab('0x68')]&&_0xdbd419[_0xfcab('0x66')]['diagnosticInfo'][_0xfcab('0x69')]?_0xdbd419[_0xfcab('0x66')]['diagnosticInfo'][_0xfcab('0x69')][_0xfcab('0x6a')][_0xfcab('0x6b')]:![],'fulfillmentText':_0xdbd419['queryResult'][_0xfcab('0x6c')],'intentName':_0xdbd419[_0xfcab('0x66')]['intent']['name'],'intentDisplayName':_0xdbd419[_0xfcab('0x66')][_0xfcab('0x6d')]['displayName'],'isFallbackIntent':_0xdbd419[_0xfcab('0x66')][_0xfcab('0x6d')][_0xfcab('0x6e')],'languageCode':_0xdbd419['queryResult'][_0xfcab('0x6f')],'queryText':_0xdbd419['queryResult'][_0xfcab('0x70')],'responseId':_0xdbd419[_0xfcab('0x71')],'score':_0xdbd419['queryResult'][_0xfcab('0x72')],'speech':_0xdbd419[_0xfcab('0x66')]['fulfillmentText'],'providerResponse':JSON[_0xfcab('0x3f')](_0x173d5a)};return _0x137868;}}});};exports[_0xfcab('0x73')]=function(_0x3e31dd,_0x2a7369,_0x2e4b3d,_0x5019ec){return tilde[_0xfcab('0x74')](_0x3e31dd,_0x2a7369,_0x2e4b3d,_0x5019ec)['then'](function(_0x5a9134){try{fs[_0xfcab('0x1d')](_0x3e31dd);}catch(_0x5b522e){logger['error'](_0x5b522e);}logger['info'](_0xfcab('0x75'),_0x5a9134[_0xfcab('0x4d')]);logger[_0xfcab('0x24')](_0xfcab('0x76'),_0x5a9134['confidence']);return _0x5a9134;});};exports[_0xfcab('0x77')]=function(_0x10f75a,_0x2c582d,_0x4f37b3,_0x4dc14d,_0xa3f16,_0x22b5fb){var _0x145c55=path[_0xfcab('0x35')](__dirname,_0xfcab('0x36'),rs[_0xfcab('0x37')](0x4)+'.mp3');var _0x173ba;return aws[_0xfcab('0x78')](_0x10f75a,_0x2c582d,_0x4f37b3,_0x4dc14d,_0xa3f16,_0x22b5fb,_0x145c55)[_0xfcab('0x28')](function(){_0x173ba=path['resolve'](__dirname,_0xfcab('0x36'),rs[_0xfcab('0x37')](0x4)+_0xfcab('0x26'));return convertFile(_0x145c55,_0x173ba);})[_0xfcab('0x28')](function(){try{fs[_0xfcab('0x1d')](_0x145c55);fs[_0xfcab('0x29')](_0x173ba,_0xfcab('0x2a'));}catch(_0x20e373){logger[_0xfcab('0x16')](_0x20e373);}return _0x173ba[_0xfcab('0x2b')]('.')[0x0];});};exports[_0xfcab('0x79')]=function(_0x5c3b2f,_0x42832b,_0x22f7f6,_0xde4876,_0xba88d4,_0xcf0d90){return aws[_0xfcab('0x7a')](_0x5c3b2f,_0x42832b,_0x22f7f6,_0xde4876,_0xba88d4,_0xcf0d90)['then'](function(_0x58d3f4){logger['info'](JSON[_0xfcab('0x3f')](_0x58d3f4));return _0x58d3f4;});};exports[_0xfcab('0x7b')]=function(_0x51f6bd,_0x34e26f,_0x184fb7,_0x26c518){var _0x43378a=util['format'](_0xfcab('0x7c'),ISPEECH_API,_0x51f6bd,encodeURIComponent(_0x34e26f),_0x184fb7,_0x26c518);var _0x23f368=path['resolve'](__dirname,_0xfcab('0x36'),rs[_0xfcab('0x37')](0x4)+_0xfcab('0x38'));var _0x2d4aba;return downloadFile(_0x43378a,_0x23f368)[_0xfcab('0x28')](function(){_0x2d4aba=path[_0xfcab('0x35')](__dirname,'tmp',rs[_0xfcab('0x37')](0x4)+'.wav');return convertFile(_0x23f368,_0x2d4aba);})[_0xfcab('0x28')](function(){try{fs[_0xfcab('0x1d')](_0x23f368);fs['chmodSync'](_0x2d4aba,_0xfcab('0x2a'));}catch(_0x2d54a7){logger['error'](_0x2d54a7);}return _0x2d4aba[_0xfcab('0x2b')]('.')[0x0];});};exports[_0xfcab('0x7d')]=function(_0x1cf990,_0x27ea14,_0x49c92f,_0x40ab80){var _0x17d18d=util[_0xfcab('0x7e')](_0xfcab('0x7f'),ISPEECH_API,_0x27ea14,_0x49c92f,base64Encode(_0x1cf990),_0x40ab80?util['format'](_0xfcab('0x80'),encodeURIComponent(_0x40ab80)):'freeform=3');return uploadFile(_0x17d18d)[_0xfcab('0x28')](function(_0x4bc9c3){return querystring['parse'](_0x4bc9c3);});};exports['sestekNDA']=function(_0x3e6aef,_0x1dd11c){return sestek['nda'](_0x3e6aef,_0x1dd11c)['then'](function(_0xc40fa8){logger[_0xfcab('0x24')](JSON['stringify'](_0xc40fa8));var _0x3f45c5={'speech':_0xc40fa8[_0xfcab('0x81')],'action':_0xc40fa8[_0xfcab('0x82')]?_0xc40fa8[_0xfcab('0x82')][_0xfcab('0x83')]:undefined,'actiondata':_0xc40fa8['channelData']?_0xc40fa8[_0xfcab('0x82')][_0xfcab('0x84')]:undefined};if(_0xc40fa8['channelData']&&_0xc40fa8[_0xfcab('0x82')][_0xfcab('0x85')]){return base64Decode(_0xc40fa8['channelData'][_0xfcab('0x85')]['Data'],path[_0xfcab('0x35')](__dirname,'tmp',rs[_0xfcab('0x37')](0x4)+'.wav'))['then'](function(_0xf11ca9){_0x3f45c5['audiofile']=_0xf11ca9;return _0x3f45c5;});}return _0x3f45c5;});};exports[_0xfcab('0x86')]=function(){return __dirname;};
\ No newline at end of file
+var _0x689d=['uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','textRequest','result','source','action','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','bluebird','http','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','./aws','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','statusCode','error','request\x20to\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','unlink','download\x20error','pipe','protocol','get','\x20failed,\x20status\x20code\x20=\x20','data','end','wav','finish\x20to\x20convert','resolve','tmp','.wav','base64','then','chmodSync','777','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','generate','.mp3','writeFile','split','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','goggleTTS\x20path','googleASR','asr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x689d,0xc1));var _0xd689=function(_0x590649,_0x28f93d){_0x590649=_0x590649-0x0;var _0x4e1806=_0x689d[_0x590649];return _0x4e1806;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xd689('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xd689('0x1'));var https=require(_0xd689('0x2'));var md5=require(_0xd689('0x3'));var path=require('path');var querystring=require(_0xd689('0x4'));var rp=require(_0xd689('0x5'));var rs=require(_0xd689('0x6'));var sox=require(_0xd689('0x7'));var tts=require(_0xd689('0x8'));var urlParse=require(_0xd689('0x9'))[_0xd689('0xa')];var util=require('util');var aws=require(_0xd689('0xb'));var google=require('./google');var sestek=require(_0xd689('0xc'));var tilde=require(_0xd689('0xd'));var logger=require(_0xd689('0xe'))(_0xd689('0xf'));var ISPEECH_API=_0xd689('0x10');function downloadFile(_0xe5b41b,_0x5d11d2){return new BPromise(function(_0x2fedf2,_0x32462b){var _0x1281c=urlParse(_0xe5b41b);var _0x3541ff=_0x1281c['protocol']===_0xd689('0x11')?https:http;var _0x4c93d5={'host':_0x1281c[_0xd689('0x12')],'path':_0x1281c['path'],'headers':{'user-agent':_0xd689('0x13')}};_0x3541ff['get'](_0x4c93d5,function(_0x342415){if(_0x342415[_0xd689('0x14')]!==0xc8){logger[_0xd689('0x15')](_0xd689('0x16')+_0xe5b41b+'\x20failed,\x20status\x20code\x20=\x20'+_0x342415[_0xd689('0x14')]+'\x20('+_0x342415[_0xd689('0x17')]+')');_0x32462b(new Error(_0xd689('0x16')+_0xe5b41b+'\x20failed,\x20status\x20code\x20=\x20'+_0x342415['statusCode']+'\x20('+_0x342415[_0xd689('0x17')]+')'));return;}var _0x3c14a9=fs[_0xd689('0x18')](_0x5d11d2);_0x3c14a9['on']('finish',function(){logger[_0xd689('0x19')](_0xd689('0x1a'));_0x3c14a9['close'](_0x2fedf2);});_0x3c14a9['on'](_0xd689('0x15'),function(_0x1b620c){fs[_0xd689('0x1b')](_0x5d11d2);logger[_0xd689('0x15')](_0xd689('0x1c'),_0x1b620c);_0x32462b(_0x1b620c);});_0x342415[_0xd689('0x1d')](_0x3c14a9);})['on'](_0xd689('0x15'),function(_0x3d21c6){logger['error'](_0x3d21c6);_0x32462b(_0x3d21c6);})['end']();});}function uploadFile(_0x4c2a33){return new BPromise(function(_0x41a642,_0x5a6dba){var _0x13ffcd=urlParse(_0x4c2a33);var _0x2bcc02=_0x13ffcd[_0xd689('0x1e')]==='https:'?https:http;var _0x17fe1c={'host':_0x13ffcd[_0xd689('0x12')],'path':_0x13ffcd['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x2bcc02[_0xd689('0x1f')](_0x17fe1c,function(_0x36d2c2){if(_0x36d2c2['statusCode']!==0xc8){_0x5a6dba(new Error('request\x20to\x20'+_0x4c2a33+_0xd689('0x20')+_0x36d2c2[_0xd689('0x14')]+'\x20('+_0x36d2c2[_0xd689('0x17')]+')'));return;}var _0x34a211='';_0x36d2c2['on'](_0xd689('0x21'),function(_0x433a43){_0x34a211+=_0x433a43;});_0x36d2c2['on'](_0xd689('0x22'),function(){_0x41a642(_0x34a211);});})['on'](_0xd689('0x15'),function(_0x216ee7){_0x5a6dba(_0x216ee7);})[_0xd689('0x22')]();});}function convertFile(_0x5653ea,_0x39a95e){return new BPromise(function(_0x1b97b3,_0x38b7e8){var _0x2bb5d6=sox['transcode'](_0x5653ea,_0x39a95e,{'sampleRate':0x1f40,'format':_0xd689('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2bb5d6['on'](_0xd689('0x15'),function(_0x544e34){logger[_0xd689('0x15')]('error\x20convert',_0x544e34);_0x38b7e8(_0x544e34);});_0x2bb5d6['on'](_0xd689('0x22'),function(){logger[_0xd689('0x19')](_0xd689('0x24'));_0x1b97b3();});_0x2bb5d6['start']();});}function base64Decode(_0x414cff,_0x3062a1){var _0x210d85=path[_0xd689('0x25')](__dirname,_0xd689('0x26'),rs['generate'](0x4)+_0xd689('0x27'));fs['writeFileSync'](_0x210d85,_0x414cff,_0xd689('0x28'));return convertFile(_0x210d85,_0x3062a1)[_0xd689('0x29')](function(){try{fs['unlink'](_0x210d85);fs[_0xd689('0x2a')](_0x3062a1,_0xd689('0x2b'));}catch(_0x25264f){logger['error'](_0x25264f);}return _0x3062a1['split']('.')[0x0];});}function base64Encode(_0x475429){var _0x178d63=fs[_0xd689('0x2c')](_0x475429);return new Buffer(_0x178d63)['toString'](_0xd689('0x28'));}exports[_0xd689('0x2d')]=function(_0x251cce,_0x31d347,_0x215811,_0x458699,_0x2de3a6,_0x483149){var _0xbeffef,_0x21c52e;var _0xac5bea=_0xd689('0x2e');var _0x130e64=_0xd689('0x2f')+_0x251cce;var _0x34e1c7={};if(_0x31d347===_0xd689('0x30')){_0x34e1c7['input']={'ssml':_0x215811};}else{_0x34e1c7[_0xd689('0x31')]={'text':_0x215811};};_0x34e1c7['voice']={'languageCode':_0x458699,'ssmlGender':_0x2de3a6};_0x34e1c7[_0xd689('0x32')]={'audioEncoding':_0xd689('0x33'),'sampleRateHertz':0x1f40};var _0xd36531={'url':_0xac5bea+_0xd689('0x34')+_0x130e64,'method':_0xd689('0x35'),'json':!![],'body':_0x34e1c7};return rp(_0xd36531)[_0xd689('0x29')](function(_0x3c46ad){return new BPromise(function(_0x551762,_0x572214){_0xbeffef=path[_0xd689('0x25')](__dirname,_0xd689('0x26'),rs[_0xd689('0x36')](0x4)+_0xd689('0x37'));var _0xa9e40e=Buffer['from'](_0x3c46ad['audioContent'],'base64');return fs[_0xd689('0x38')](_0xbeffef,_0xa9e40e,function(_0x5850f3){_0x572214(_0x5850f3);},function(_0x500ed9){fs[_0xd689('0x2a')](_0xbeffef,'777');_0x551762(_0x500ed9);});});})[_0xd689('0x29')](function(_0x3d9b45){_0x21c52e=path['resolve'](__dirname,_0xd689('0x26'),rs[_0xd689('0x36')](0x4)+_0xd689('0x27'));return convertFile(_0xbeffef,_0x21c52e);})[_0xd689('0x29')](function(){try{fs[_0xd689('0x1b')](_0xbeffef);fs['chmodSync'](_0x21c52e,_0xd689('0x2b'));}catch(_0x319c36){logger[_0xd689('0x15')](_0x319c36);}logger['info']('googleCloudTTS\x20path',_0x21c52e[_0xd689('0x39')]('.')[0x0]);return _0x21c52e[_0xd689('0x39')]('.')[0x0];});};exports['googleTTS']=function(_0x4aabb7,_0x219a08){var _0x15e877=_0xd689('0x3a');var _0x49218f,_0x3ccceb;var _0x3cca74;var _0x61020a={'encoding':_0xd689('0x3b'),'method':_0xd689('0x35'),'timeout':0x2710,'url':_0x15e877,'headers':{'Content-Type':_0xd689('0x3c')},'body':_0xd689('0x3d')+encodeURIComponent(JSON[_0xd689('0x3e')]([[[_0xd689('0x3f'),JSON['stringify']([_0x4aabb7,_0x219a08||'en',![],_0xd689('0x40')]),null,_0xd689('0x41')]]]))};return rp(_0x61020a)[_0xd689('0x29')](function(_0x1cf9ef){try{_0x3cca74=eval(_0x1cf9ef[_0xd689('0x42')](0x5))[0x0][0x2];}catch(_0x5b8156){throw new Error(_0xd689('0x43')+_0x1cf9ef[_0xd689('0x21')]);}if(!_0x3cca74){if(_0x4aabb7[_0xd689('0x44')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xd689('0x45')+_0x219a08+'\x22\x20might\x20not\x20exist');}}try{_0x3cca74=eval(_0x3cca74)[0x0];}catch(_0x140d2d){throw new Error(_0xd689('0x43')+res[_0xd689('0x21')]);}const _0x32404a=_0x3cca74;_0x49218f=path[_0xd689('0x25')](__dirname,_0xd689('0x26'),rs['generate'](0x4)+_0xd689('0x37'));fs['writeFileSync'](_0x49218f,_0x3cca74,{'encoding':_0xd689('0x28')});_0x3ccceb=path[_0xd689('0x25')](__dirname,_0xd689('0x26'),rs[_0xd689('0x36')](0x4)+_0xd689('0x27'));return convertFile(_0x49218f,_0x3ccceb);})[_0xd689('0x29')](function(){try{fs[_0xd689('0x1b')](_0x49218f);fs[_0xd689('0x2a')](_0x3ccceb,_0xd689('0x2b'));}catch(_0xec63e2){logger[_0xd689('0x15')](_0xec63e2);}logger[_0xd689('0x19')](_0xd689('0x46'),_0x3ccceb['split']('.')[0x0]);return _0x3ccceb['split']('.')[0x0];});};exports[_0xd689('0x47')]=function(_0x4bd0b3,_0x551c8d,_0x12d7c2){return google[_0xd689('0x48')](_0x4bd0b3,_0x551c8d,_0x12d7c2)['then'](function(_0x2dd2f0){logger['info'](_0x2dd2f0[_0xd689('0x49')]);return rp(_0x2dd2f0);})['then'](function(_0x45b988){var _0x739dd2='';var _0x698e7f=0x0;try{fs[_0xd689('0x1b')](_0x4bd0b3);}catch(_0x26e483){logger[_0xd689('0x15')](_0x26e483);}if(_0x45b988&&_0x45b988[_0xd689('0x4a')]){_0x739dd2=_0x45b988['results'][_0xd689('0x4b')](function(_0x57b9d2){return _0x57b9d2&&_0x57b9d2[_0xd689('0x4c')][0x0]&&_0x57b9d2[_0xd689('0x4c')][0x0][_0xd689('0x4d')]?_0x57b9d2[_0xd689('0x4c')][0x0][_0xd689('0x4d')]:'';})[_0xd689('0x4e')]('\x0a');_0x698e7f=_0x45b988['results'][_0xd689('0x4b')](function(_0x56367a){return _0x56367a&&_0x56367a[_0xd689('0x4c')][0x0]&&_0x56367a[_0xd689('0x4c')][0x0][_0xd689('0x4f')]?_0x56367a['alternatives'][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0xd689('0x19')](_0xd689('0x50'),_0x739dd2);logger[_0xd689('0x19')](_0xd689('0x51'),_0x698e7f);return{'transcript':_0x739dd2,'confidence':_0x698e7f};})[_0xd689('0x52')](function(_0x5788a1){logger[_0xd689('0x15')]('[%s]\x20%s:%s',_0x5788a1['statusCode'],_0x5788a1['name'],_0x5788a1[_0xd689('0x53')]);});};exports['googleDialogflow']=function(_0xc8d650,_0x5e6650,_0x1f070d,_0x483bdd){var _0x20a59f=apiai(_0x5e6650,{'language':_0x483bdd||'en'});return _0x20a59f[_0xd689('0x54')](_0x1f070d,{'sessionId':md5(_0xc8d650)})['then'](function(_0x136455){logger[_0xd689('0x19')](JSON[_0xd689('0x3e')](_0x136455));return{'source':_0x136455[_0xd689('0x55')][_0xd689('0x56')],'resolvedQuery':_0x136455[_0xd689('0x55')]['resolvedQuery'],'action':_0x136455[_0xd689('0x55')][_0xd689('0x57')],'actionIncomplete':_0x136455[_0xd689('0x55')]['actionIncomplete'],'speech':_0x136455[_0xd689('0x55')][_0xd689('0x58')][_0xd689('0x59')],'score':_0x136455[_0xd689('0x55')][_0xd689('0x5a')],'statusCode':_0x136455[_0xd689('0x5b')][_0xd689('0x5c')],'endConversation':_0x136455['result'][_0xd689('0x5d')][_0xd689('0x5e')]||![],'isFallbackIntent':_0x136455['result'][_0xd689('0x5d')][_0xd689('0x5f')]};});};exports[_0xd689('0x60')]=function(_0x206458,_0xd750cc,_0x3f3063,_0x162841,_0x23e09c,_0x55f2f2){var _0x42a734=_0x162841[_0xd689('0x61')](/\\n/g,'\x0a');var _0x3d7797={'credentials':{'private_key':_0x42a734,'client_email':_0x3f3063}};var _0x378c38=new dialogflow[(_0xd689('0x62'))](_0x3d7797);var _0x256720=_0x378c38[_0xd689('0x63')](_0xd750cc,md5(_0x206458));var _0x58f47e={'session':_0x256720,'queryInput':{'text':{'text':_0x23e09c,'languageCode':_0x55f2f2}}};return _0x378c38['detectIntent'](_0x58f47e)[_0xd689('0x29')](function(_0x32b337){if(_0x32b337&&_0x32b337[_0xd689('0x44')]){logger['info'](_0xd689('0x64'),JSON[_0xd689('0x3e')](_0x32b337));var _0x9777fe=_0x32b337[0x0];if(_0x9777fe){var _0x194f17={'action':_0x9777fe['queryResult']['action'],'allRequiredParamsPresent':_0x9777fe[_0xd689('0x65')][_0xd689('0x66')],'endConversation':_0x9777fe[_0xd689('0x65')][_0xd689('0x67')]&&_0x9777fe[_0xd689('0x65')][_0xd689('0x67')][_0xd689('0x68')]?_0x9777fe['queryResult']['diagnosticInfo'][_0xd689('0x68')][_0xd689('0x69')][_0xd689('0x6a')]:![],'fulfillmentText':_0x9777fe[_0xd689('0x65')][_0xd689('0x6b')],'intentName':_0x9777fe['queryResult'][_0xd689('0x6c')][_0xd689('0x6d')],'intentDisplayName':_0x9777fe[_0xd689('0x65')]['intent']['displayName'],'isFallbackIntent':_0x9777fe['queryResult'][_0xd689('0x6c')]['isFallback'],'languageCode':_0x9777fe[_0xd689('0x65')][_0xd689('0x6e')],'queryText':_0x9777fe[_0xd689('0x65')]['queryText'],'responseId':_0x9777fe[_0xd689('0x6f')],'score':_0x9777fe[_0xd689('0x65')][_0xd689('0x70')],'speech':_0x9777fe[_0xd689('0x65')][_0xd689('0x6b')],'providerResponse':JSON[_0xd689('0x3e')](_0x32b337)};return _0x194f17;}}});};exports[_0xd689('0x71')]=function(_0x47103a,_0x397196,_0xa26527,_0x27d4c5){return tilde[_0xd689('0x48')](_0x47103a,_0x397196,_0xa26527,_0x27d4c5)[_0xd689('0x29')](function(_0x12aedb){try{fs[_0xd689('0x1b')](_0x47103a);}catch(_0x2de178){logger['error'](_0x2de178);}logger['info'](_0xd689('0x72'),_0x12aedb['transcript']);logger[_0xd689('0x19')](_0xd689('0x73'),_0x12aedb[_0xd689('0x4f')]);return _0x12aedb;});};exports[_0xd689('0x74')]=function(_0xdd1338,_0x3bc55e,_0x444c9d,_0x4f354d,_0x31e258,_0x5c2aa8){var _0x3489cf=path[_0xd689('0x25')](__dirname,_0xd689('0x26'),rs[_0xd689('0x36')](0x4)+'.mp3');var _0x36b26;return aws[_0xd689('0x75')](_0xdd1338,_0x3bc55e,_0x444c9d,_0x4f354d,_0x31e258,_0x5c2aa8,_0x3489cf)['then'](function(){_0x36b26=path['resolve'](__dirname,'tmp',rs[_0xd689('0x36')](0x4)+_0xd689('0x27'));return convertFile(_0x3489cf,_0x36b26);})['then'](function(){try{fs[_0xd689('0x1b')](_0x3489cf);fs[_0xd689('0x2a')](_0x36b26,_0xd689('0x2b'));}catch(_0x4e2028){logger[_0xd689('0x15')](_0x4e2028);}return _0x36b26[_0xd689('0x39')]('.')[0x0];});};exports[_0xd689('0x76')]=function(_0x528b98,_0x42033e,_0x46d2c1,_0x23c4ca,_0x3eaae7,_0x38827e){return aws[_0xd689('0x77')](_0x528b98,_0x42033e,_0x46d2c1,_0x23c4ca,_0x3eaae7,_0x38827e)[_0xd689('0x29')](function(_0xd8906a){logger['info'](JSON[_0xd689('0x3e')](_0xd8906a));return _0xd8906a;});};exports[_0xd689('0x78')]=function(_0xd75c29,_0xf4397f,_0x457d36,_0x359601){var _0x7306c1=util['format'](_0xd689('0x79'),ISPEECH_API,_0xd75c29,encodeURIComponent(_0xf4397f),_0x457d36,_0x359601);var _0x1265b2=path[_0xd689('0x25')](__dirname,_0xd689('0x26'),rs['generate'](0x4)+'.mp3');var _0x5e7c3e;return downloadFile(_0x7306c1,_0x1265b2)[_0xd689('0x29')](function(){_0x5e7c3e=path[_0xd689('0x25')](__dirname,_0xd689('0x26'),rs[_0xd689('0x36')](0x4)+_0xd689('0x27'));return convertFile(_0x1265b2,_0x5e7c3e);})[_0xd689('0x29')](function(){try{fs[_0xd689('0x1b')](_0x1265b2);fs['chmodSync'](_0x5e7c3e,_0xd689('0x2b'));}catch(_0x55c54d){logger['error'](_0x55c54d);}return _0x5e7c3e[_0xd689('0x39')]('.')[0x0];});};exports[_0xd689('0x7a')]=function(_0x4f315d,_0x52becf,_0xe4e6a0,_0x39de96){var _0x983eb0=util[_0xd689('0x7b')](_0xd689('0x7c'),ISPEECH_API,_0x52becf,_0xe4e6a0,base64Encode(_0x4f315d),_0x39de96?util[_0xd689('0x7b')](_0xd689('0x7d'),encodeURIComponent(_0x39de96)):'freeform=3');return uploadFile(_0x983eb0)['then'](function(_0x28ca67){return querystring[_0xd689('0xa')](_0x28ca67);});};exports['sestekNDA']=function(_0x53f324,_0x195cb1){return sestek[_0xd689('0x7e')](_0x53f324,_0x195cb1)['then'](function(_0x44b9bf){logger[_0xd689('0x19')](JSON[_0xd689('0x3e')](_0x44b9bf));var _0x23682f={'speech':_0x44b9bf[_0xd689('0x7f')],'action':_0x44b9bf[_0xd689('0x80')]?_0x44b9bf['channelData'][_0xd689('0x81')]:undefined,'actiondata':_0x44b9bf[_0xd689('0x80')]?_0x44b9bf[_0xd689('0x80')][_0xd689('0x82')]:undefined};if(_0x44b9bf['channelData']&&_0x44b9bf['channelData'][_0xd689('0x83')]){return base64Decode(_0x44b9bf[_0xd689('0x80')]['AudioFromTts'][_0xd689('0x84')],path['resolve'](__dirname,_0xd689('0x26'),rs[_0xd689('0x36')](0x4)+_0xd689('0x27')))[_0xd689('0x29')](function(_0x160b08){_0x23682f['audiofile']=_0x160b08;return _0x23682f;});}return _0x23682f;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
index addc381..857a3ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa80f=['exports','./nda'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa80f,0x1eb));var _0xfa80=function(_0x3d5e72,_0x3ab167){_0x3d5e72=_0x3d5e72-0x0;var _0x2230e4=_0xa80f[_0x3d5e72];return _0x2230e4;};var nda=require(_0xfa80('0x0'));module[_0xfa80('0x1')]={'nda':nda};
\ No newline at end of file
+var _0xd095=['exports'];(function(_0x137919,_0xf80a96){var _0x270511=function(_0x20502a){while(--_0x20502a){_0x137919['push'](_0x137919['shift']());}};_0x270511(++_0xf80a96);}(_0xd095,0x131));var _0x5d09=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xd095[_0x24f31b];return _0x488401;};var nda=require('./nda');module[_0x5d09('0x0')]={'nda':nda};
\ No newline at end of file
index 7ca45db..0c94ca4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76bc=['../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url'];(function(_0x1954aa,_0x37be7c){var _0x475466=function(_0x4bf4a7){while(--_0x4bf4a7){_0x1954aa['push'](_0x1954aa['shift']());}};_0x475466(++_0x37be7c);}(_0x76bc,0x17f));var _0xc76b=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x76bc[_0x4c1ec2];return _0x3f6f1c;};'use strict';var rp=require(_0xc76b('0x0'));var url=require(_0xc76b('0x1'));var logger=require(_0xc76b('0x2'))(_0xc76b('0x3'));module[_0xc76b('0x4')]=function(_0x5a265d,_0x5ce5d4){var _0x28fb54={'method':_0xc76b('0x5'),'uri':url[_0xc76b('0x6')](_0x5ce5d4[_0xc76b('0x7')],_0xc76b('0x8')),'form':{'grant_type':_0xc76b('0x9'),'username':_0x5ce5d4[_0xc76b('0xa')],'password':_0x5ce5d4[_0xc76b('0x9')]},'json':!![]};return rp(_0x28fb54)[_0xc76b('0xb')](function(_0x1cb174){var _0x235ff3={'method':_0xc76b('0x5'),'uri':url[_0xc76b('0x6')](_0x5ce5d4[_0xc76b('0xc')],_0xc76b('0xd')),'body':{'type':_0x5ce5d4[_0xc76b('0xe')]||'message','channelId':_0xc76b('0xf'),'conversation':{'id':_0x5a265d[_0xc76b('0x10')]},'from':{'id':_0x5a265d[_0xc76b('0x11')],'name':_0x5a265d[_0xc76b('0x12')]},'recipient':{'id':_0x5a265d[_0xc76b('0x13')],'name':_0x5a265d[_0xc76b('0x14')]},'text':_0x5ce5d4['text'],'channelData':{}},'headers':{'Authorization':_0xc76b('0x15')+_0x1cb174[_0xc76b('0x16')]},'json':!![]};if(_0x5ce5d4[_0xc76b('0x17')]){_0x235ff3[_0xc76b('0x18')][_0xc76b('0x19')][_0xc76b('0x1a')]=_0x5ce5d4[_0xc76b('0x17')];}if(_0x5ce5d4['ndagenerate_audio']=='1'){_0x235ff3['body'][_0xc76b('0x19')][_0xc76b('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc76b('0x1c')};}if(_0x5ce5d4[_0xc76b('0x1d')]){_0x235ff3[_0xc76b('0x18')]['channelData'][_0xc76b('0x1e')]=_0x5ce5d4[_0xc76b('0x1d')];if(_0x5ce5d4[_0xc76b('0x1f')]){_0x235ff3['body']['channelData'][_0xc76b('0x20')]=_0x5ce5d4[_0xc76b('0x1f')];}}logger[_0xc76b('0x21')](JSON[_0xc76b('0x22')](_0x235ff3));return rp(_0x235ff3);});};
\ No newline at end of file
+var _0x6364=['username','then','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','../../../../../config/logger','agi','exports','POST','resolve','/token','password'];(function(_0x53db91,_0x29a9c0){var _0x5ccf61=function(_0x264a69){while(--_0x264a69){_0x53db91['push'](_0x53db91['shift']());}};_0x5ccf61(++_0x29a9c0);}(_0x6364,0x8f));var _0x4636=function(_0x6012fa,_0x435b37){_0x6012fa=_0x6012fa-0x0;var _0x420326=_0x6364[_0x6012fa];return _0x420326;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x4636('0x0'))(_0x4636('0x1'));module[_0x4636('0x2')]=function(_0x17b25f,_0x3a02f9){var _0xfa8c2a={'method':_0x4636('0x3'),'uri':url[_0x4636('0x4')](_0x3a02f9['ndauth_url'],_0x4636('0x5')),'form':{'grant_type':_0x4636('0x6'),'username':_0x3a02f9[_0x4636('0x7')],'password':_0x3a02f9[_0x4636('0x6')]},'json':!![]};return rp(_0xfa8c2a)[_0x4636('0x8')](function(_0x4e662e){var _0xd364dc={'method':_0x4636('0x3'),'uri':url[_0x4636('0x4')](_0x3a02f9[_0x4636('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x3a02f9[_0x4636('0xa')]||_0x4636('0xb'),'channelId':_0x4636('0xc'),'conversation':{'id':_0x17b25f[_0x4636('0xd')]},'from':{'id':_0x17b25f[_0x4636('0xe')],'name':_0x17b25f['calleridname']},'recipient':{'id':_0x17b25f[_0x4636('0xf')],'name':_0x17b25f[_0x4636('0x10')]},'text':_0x3a02f9[_0x4636('0x11')],'channelData':{}},'headers':{'Authorization':_0x4636('0x12')+_0x4e662e['access_token']},'json':!![]};if(_0x3a02f9[_0x4636('0x13')]){_0xd364dc[_0x4636('0x14')][_0x4636('0x15')][_0x4636('0x16')]=_0x3a02f9[_0x4636('0x13')];}if(_0x3a02f9['ndagenerate_audio']=='1'){_0xd364dc['body'][_0x4636('0x15')][_0x4636('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4636('0x18')};}if(_0x3a02f9[_0x4636('0x19')]){_0xd364dc['body'][_0x4636('0x15')][_0x4636('0x1a')]=_0x3a02f9[_0x4636('0x19')];if(_0x3a02f9[_0x4636('0x1b')]){_0xd364dc[_0x4636('0x14')][_0x4636('0x15')]['CustomActionData']=_0x3a02f9[_0x4636('0x1b')];}}logger[_0x4636('0x1c')](JSON[_0x4636('0x1d')](_0xd364dc));return rp(_0xd364dc);});};
\ No newline at end of file
index 03be845..2db7aed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61f8=['exports','./lib/api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x61f8,0x83));var _0x861f=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x61f8[_0x4b73a2];return _0x383c66;};'use strict';var asr=require(_0x861f('0x0'));module[_0x861f('0x1')]=function(_0x36f27f,_0xe19b27,_0x323b93,_0x1d6ff9){return asr(_0x36f27f,_0xe19b27,_0x323b93,_0x1d6ff9);};
\ No newline at end of file
+var _0xa775=['./lib/api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa775,0xf6));var _0x5a77=function(_0x1527d2,_0x4333e5){_0x1527d2=_0x1527d2-0x0;var _0x2ee170=_0xa775[_0x1527d2];return _0x2ee170;};'use strict';var asr=require(_0x5a77('0x0'));module['exports']=function(_0x9d8215,_0x570abb,_0x4ab93f,_0x1815b2){return asr(_0x9d8215,_0x570abb,_0x4ab93f,_0x1815b2);};
\ No newline at end of file
index eba4fa8..d506bef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01c8=['Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','moment','../../../../../../config/logger','agi','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','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','hypotheses','Success.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0x01c8,0x107));var _0x801c=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x01c8[_0x2bf141];return _0x48277b;};'use strict';var BPromise=require(_0x801c('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x801c('0x1'));var crypto=require('crypto');var logger=require(_0x801c('0x2'))(_0x801c('0x3'));module[_0x801c('0x4')]=function(_0x157c0b,_0x231435,_0x1300ed,_0x22b4d3){return new BPromise(function(_0x5d27fa,_0x11ca47){logger['info']('Tilde\x20URI',_0x22b4d3||_0x801c('0x5'));var _0x1b1968=new WebSocket(_0x22b4d3||_0x801c('0x5'),{'perMessageDeflate':![]});var _0x544972='';var _0x140233='0';var _0x45b210='1';var _0x4fea9d=_0x801c('0x6');function _0x36cc35(_0x54ad53){var _0x397773=crypto[_0x801c('0x7')]('sha1');_0x397773[_0x801c('0x8')](_0x54ad53);return _0x397773[_0x801c('0x9')](_0x801c('0xa'));}function _0x36d665(){try{logger[_0x801c('0xb')](_0x801c('0xc'));var _0x4b5b39=moment()[_0x801c('0xd')]();var _0x46cc7b=_0x36cc35(_0x4b5b39+_0x231435+_0x1300ed);_0x1b1968[_0x801c('0xe')](JSON[_0x801c('0xf')]({'appID':_0x231435,'timestamp':_0x4b5b39,'appKey':_0x46cc7b}));var _0x14e91e=fs[_0x801c('0x10')](_0x157c0b);_0x14e91e['on'](_0x801c('0x11'),function(_0x4b307a){_0x1b1968[_0x801c('0xe')](_0x4b307a);});_0x14e91e['on'](_0x801c('0x12'),function(){_0x1b1968['send'](_0x801c('0x13'));});}catch(_0x20c652){logger[_0x801c('0x14')](_0x801c('0x15'),JSON[_0x801c('0xf')](_0x20c652));_0x1b1968[_0x801c('0x16')]();}}function _0x58d127(_0x52263e){try{if(_0x52263e){var _0x55207c=JSON['parse'](_0x52263e);switch(_0x55207c[_0x801c('0x17')]){case 0x0:if(_0x55207c['result']){if(_0x55207c[_0x801c('0x18')][_0x801c('0x19')]){logger[_0x801c('0xb')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x55207c[_0x801c('0x18')][_0x801c('0x1a')]));_0x544972=_0x55207c['result']['hypotheses'][0x0]['transcript'];_0x140233=_0x55207c[_0x801c('0x18')][_0x801c('0x1a')][0x0]['likelihood'];_0x45b210='0';_0x4fea9d=_0x801c('0x1b');_0x1b1968['terminate']();}}break;case 0x1:logger['info'](_0x801c('0x6'));_0x45b210='1';_0x4fea9d='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x45b210='2';_0x4fea9d='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x801c('0xb')](_0x801c('0x1c'));_0x45b210='9';_0x4fea9d=_0x801c('0x1c');break;case 0xa:logger[_0x801c('0xb')](_0x801c('0x1d'));_0x45b210='10';_0x4fea9d='Authentication\x20failed.';break;case 0xb:logger['info'](_0x801c('0x1e'));_0x45b210='11';_0x4fea9d=_0x801c('0x1e');}}}catch(_0x32f906){logger[_0x801c('0x14')](_0x801c('0x1f'),JSON['stringify'](_0x32f906));_0x1b1968[_0x801c('0x16')]();}}function _0x281919(){logger[_0x801c('0xb')](_0x801c('0x20'));_0x5d27fa({'transcript':_0x544972,'confidence':_0x140233,'status':_0x45b210,'status_message':_0x4fea9d});}function _0x26b572(_0x258a89){logger[_0x801c('0x14')](_0x801c('0x21'));if(!_[_0x801c('0x22')](_0x258a89)){logger[_0x801c('0x14')](_['isObject'](_0x258a89)?JSON[_0x801c('0xf')](_0x258a89):_0x258a89);}}_0x1b1968['on'](_0x801c('0x23'),_0x36d665);_0x1b1968['on'](_0x801c('0x24'),_0x58d127);_0x1b1968['on'](_0x801c('0x12'),_0x281919);_0x1b1968['on']('error',_0x26b572);});};
\ No newline at end of file
+var _0x47c1=['close','error','Tilde\x20ASR\x20send\x20error','stringify','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','isNil','isObject','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','data'];(function(_0x39a120,_0x2c6a24){var _0x39e9ad=function(_0x1e789e){while(--_0x1e789e){_0x39a120['push'](_0x39a120['shift']());}};_0x39e9ad(++_0x2c6a24);}(_0x47c1,0x1c2));var _0x147c=function(_0xf1b947,_0x8fed91){_0xf1b947=_0xf1b947-0x0;var _0x50bb78=_0x47c1[_0xf1b947];return _0x50bb78;};'use strict';var BPromise=require(_0x147c('0x0'));var _=require(_0x147c('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x147c('0x2'));var logger=require(_0x147c('0x3'))(_0x147c('0x4'));module[_0x147c('0x5')]=function(_0x36eb07,_0x2c763d,_0x5b3fc4,_0x53ed6b){return new BPromise(function(_0x379352,_0x4055cf){logger['info'](_0x147c('0x6'),_0x53ed6b||_0x147c('0x7'));var _0x23cabe=new WebSocket(_0x53ed6b||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x425b6b='';var _0x4b2e4e='0';var _0xa5b949='1';var _0xc9e4ad=_0x147c('0x8');function _0x15bf0c(_0x63429f){var _0x3585c4=crypto[_0x147c('0x9')]('sha1');_0x3585c4[_0x147c('0xa')](_0x63429f);return _0x3585c4[_0x147c('0xb')](_0x147c('0xc'));}function _0xf22e5f(){try{logger[_0x147c('0xd')](_0x147c('0xe'));var _0x214128=moment()[_0x147c('0xf')]();var _0x51c911=_0x15bf0c(_0x214128+_0x2c763d+_0x5b3fc4);_0x23cabe[_0x147c('0x10')](JSON['stringify']({'appID':_0x2c763d,'timestamp':_0x214128,'appKey':_0x51c911}));var _0x1549a2=fs['createReadStream'](_0x36eb07);_0x1549a2['on'](_0x147c('0x11'),function(_0x2cc760){_0x23cabe[_0x147c('0x10')](_0x2cc760);});_0x1549a2['on'](_0x147c('0x12'),function(){_0x23cabe[_0x147c('0x10')]('EOS');});}catch(_0x229344){logger[_0x147c('0x13')](_0x147c('0x14'),JSON[_0x147c('0x15')](_0x229344));_0x23cabe[_0x147c('0x16')]();}}function _0x3cb98(_0x3468d8){try{if(_0x3468d8){var _0x1d6439=JSON[_0x147c('0x17')](_0x3468d8);switch(_0x1d6439['status']){case 0x0:if(_0x1d6439[_0x147c('0x18')]){if(_0x1d6439[_0x147c('0x18')][_0x147c('0x19')]){logger[_0x147c('0xd')](_0x147c('0x1a'),JSON['stringify'](_0x1d6439[_0x147c('0x18')][_0x147c('0x1b')]));_0x425b6b=_0x1d6439[_0x147c('0x18')][_0x147c('0x1b')][0x0]['transcript'];_0x4b2e4e=_0x1d6439[_0x147c('0x18')]['hypotheses'][0x0][_0x147c('0x1c')];_0xa5b949='0';_0xc9e4ad=_0x147c('0x1d');_0x23cabe[_0x147c('0x16')]();}}break;case 0x1:logger[_0x147c('0xd')](_0x147c('0x8'));_0xa5b949='1';_0xc9e4ad=_0x147c('0x8');break;case 0x2:logger['info'](_0x147c('0x1e'));_0xa5b949='2';_0xc9e4ad=_0x147c('0x1e');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0xa5b949='9';_0xc9e4ad=_0x147c('0x1f');break;case 0xa:logger['info']('Authentication\x20failed.');_0xa5b949='10';_0xc9e4ad=_0x147c('0x20');break;case 0xb:logger[_0x147c('0xd')](_0x147c('0x21'));_0xa5b949='11';_0xc9e4ad=_0x147c('0x21');}}}catch(_0x4ab279){logger[_0x147c('0x13')](_0x147c('0x22'),JSON[_0x147c('0x15')](_0x4ab279));_0x23cabe[_0x147c('0x16')]();}}function _0x3727f0(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x379352({'transcript':_0x425b6b,'confidence':_0x4b2e4e,'status':_0xa5b949,'status_message':_0xc9e4ad});}function _0x565506(_0x316fd0){logger['error'](_0x147c('0x23'));if(!_[_0x147c('0x24')](_0x316fd0)){logger[_0x147c('0x13')](_[_0x147c('0x25')](_0x316fd0)?JSON[_0x147c('0x15')](_0x316fd0):_0x316fd0);}}_0x23cabe['on']('open',_0xf22e5f);_0x23cabe['on'](_0x147c('0x26'),_0x3cb98);_0x23cabe['on'](_0x147c('0x12'),_0x3727f0);_0x23cabe['on'](_0x147c('0x13'),_0x565506);});};
\ No newline at end of file
index 10cb4be..a0153ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var asr=require('./asr');module['exports']={'asr':asr};
\ No newline at end of file
+var _0x8a35=['exports'];(function(_0x239c5d,_0x3057f4){var _0xca38c3=function(_0x1c1aef){while(--_0x1c1aef){_0x239c5d['push'](_0x239c5d['shift']());}};_0xca38c3(++_0x3057f4);}(_0x8a35,0x1ee));var _0x58a3=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x8a35[_0x8c43de];return _0xa6591b;};var asr=require('./asr');module[_0x58a3('0x0')]={'asr':asr};
\ No newline at end of file
index 410bbae..6252222 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1702=['destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','events','EventEmitter','./error','./channel','127.0.0.1','call','error','createServer','listen','listening','emit','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x1702,0x1bf));var _0x2170=function(_0x11978a,_0x43e233){_0x11978a=_0x11978a-0x0;var _0x3f8ae3=_0x1702[_0x11978a];return _0x3f8ae3;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x2170('0x0'))[_0x2170('0x1')];var AGIError=require(_0x2170('0x2'));var AGIChannel=require(_0x2170('0x3'));var AGIServer=function(_0x1357f8,_0x501966,_0x1bdea7){var _0x535a77=this,_0x1357f8=_0x1357f8||0x11dd,_0x501966=_0x501966||_0x2170('0x4'),_0x29a12a=null,_0x587514=0x0;EventEmitter[_0x2170('0x5')](_0x535a77);function _0x6ce431(){if(!_0x1357f8){_0x535a77['emit'](_0x2170('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x29a12a=net[_0x2170('0x7')]();_0x29a12a[_0x2170('0x8')](_0x1357f8,_0x501966);_0x29a12a['on'](_0x2170('0x9'),function(){_0x535a77[_0x2170('0xa')]('listening');});_0x29a12a['on']('connection',function(_0x258761){_0x29a12a['getConnections'](function(_0x3be3c4,_0x25d7d7){if(_0x3be3c4){_0x535a77['emit'](_0x2170('0x6'),new AGIError(_0x2170('0xb'),_0x3be3c4));}else if(_0x1bdea7&&_0x1bdea7<0x0){_0x535a77[_0x2170('0xa')]('error',new AGIError(_0x2170('0xc')));_0x258761[_0x2170('0xd')]();}else if(_0x1bdea7&&_0x1bdea7>0x0&&_0x1bdea7<_0x25d7d7){_0x587514+=0x1;_0x535a77[_0x2170('0xa')]('error',new AGIError(_0x2170('0xe'),_0x587514));_0x258761['destroy']();}else{var _0x9ed3e5=new AGIChannel(_0x258761);_0x9ed3e5['on'](_0x2170('0xf'),function(){_0x535a77['emit'](_0x2170('0x10'),_0x9ed3e5);});}});});_0x29a12a['on'](_0x2170('0x6'),function(_0x3c14c5){_0x535a77['emit'](_0x2170('0x6'),new AGIError(_0x2170('0xb'),_0x3c14c5[_0x2170('0x11')]));});_0x29a12a['on'](_0x2170('0x12'),function(){_0x535a77[_0x2170('0xa')](_0x2170('0x12'),new AGIError(_0x2170('0x13')));});}process[_0x2170('0x14')](function(){_0x6ce431();});};util[_0x2170('0x15')](AGIServer,EventEmitter);module[_0x2170('0x16')]=function(_0x310a5e,_0x47c8fc,_0x43ab8f){return new AGIServer(_0x310a5e,_0x47c8fc,_0x43ab8f);};
\ No newline at end of file
+var _0xde31=['E_AGI_SERVER_CLOSE','nextTick','inherits','exports','net','./error','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','E_AGI_SERVER_ERROR','code'];(function(_0x26a515,_0x12b0d3){var _0x1f0d77=function(_0x27cdbb){while(--_0x27cdbb){_0x26a515['push'](_0x26a515['shift']());}};_0x1f0d77(++_0x12b0d3);}(_0xde31,0x15a));var _0x1de3=function(_0x2bfe52,_0x43946e){_0x2bfe52=_0x2bfe52-0x0;var _0x1cf649=_0xde31[_0x2bfe52];return _0x1cf649;};'use strict';var util=require('util');var net=require(_0x1de3('0x0'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0x1de3('0x1'));var AGIChannel=require('./channel');var AGIServer=function(_0x98cfdb,_0x306b18,_0x5c9d1c){var _0xde1a40=this,_0x98cfdb=_0x98cfdb||0x11dd,_0x306b18=_0x306b18||_0x1de3('0x2'),_0x1f6b36=null,_0x3cfaf2=0x0;EventEmitter['call'](_0xde1a40);function _0x181d25(){if(!_0x98cfdb){_0xde1a40[_0x1de3('0x3')](_0x1de3('0x4'),new AGIError(_0x1de3('0x5')));return![];}_0x1f6b36=net['createServer']();_0x1f6b36[_0x1de3('0x6')](_0x98cfdb,_0x306b18);_0x1f6b36['on']('listening',function(){_0xde1a40[_0x1de3('0x3')](_0x1de3('0x7'));});_0x1f6b36['on'](_0x1de3('0x8'),function(_0x39d7bb){_0x1f6b36[_0x1de3('0x9')](function(_0x1902d2,_0xdce1ff){if(_0x1902d2){_0xde1a40[_0x1de3('0x3')](_0x1de3('0x4'),new AGIError('E_AGI_SERVER_ERROR',_0x1902d2));}else if(_0x5c9d1c&&_0x5c9d1c<0x0){_0xde1a40['emit'](_0x1de3('0x4'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x39d7bb[_0x1de3('0xa')]();}else if(_0x5c9d1c&&_0x5c9d1c>0x0&&_0x5c9d1c<_0xdce1ff){_0x3cfaf2+=0x1;_0xde1a40[_0x1de3('0x3')](_0x1de3('0x4'),new AGIError(_0x1de3('0xb'),_0x3cfaf2));_0x39d7bb[_0x1de3('0xa')]();}else{var _0x3d4aaf=new AGIChannel(_0x39d7bb);_0x3d4aaf['on']('ready',function(){_0xde1a40['emit'](_0x1de3('0x8'),_0x3d4aaf);});}});});_0x1f6b36['on']('error',function(_0x2e26ed){_0xde1a40[_0x1de3('0x3')](_0x1de3('0x4'),new AGIError(_0x1de3('0xc'),_0x2e26ed[_0x1de3('0xd')]));});_0x1f6b36['on']('close',function(){_0xde1a40[_0x1de3('0x3')]('close',new AGIError(_0x1de3('0xe')));});}process[_0x1de3('0xf')](function(){_0x181d25();});};util[_0x1de3('0x10')](AGIServer,EventEmitter);module[_0x1de3('0x11')]=function(_0x169bbf,_0x3828b0,_0x5b2b58){return new AGIServer(_0x169bbf,_0x3828b0,_0x5b2b58);};
\ No newline at end of file
index 50fe534..94820d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x164b=['stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','awsLex','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','replaceObjectAllVariables','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','sync','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','no\x20list\x20selected','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','setVariable','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','Trying\x20aws\x20Polly\x20%s','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','wav','tilde\x20%s\x20file\x20created','context','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','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','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','getSound','digit','output','no\x20find\x20by\x20configured','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','bcc','service','host','port','secure','authentication','auth','user','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','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','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','util','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','./scripts','rawHeaders','menu','getdigits','channel','rpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','google_cloud_tts_text_type','text','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','number','timeout','includes','PUT','toUpperCase','body','rawBody','parse','headers','computedVariables','uri','render'];(function(_0x2073eb,_0x5dd4fc){var _0x27fea4=function(_0x5979b1){while(--_0x5979b1){_0x2073eb['push'](_0x2073eb['shift']());}};_0x27fea4(++_0x5dd4fc);}(_0x164b,0x157));var _0xb164=function(_0x9c45cf,_0x80fefb){_0x9c45cf=_0x9c45cf-0x0;var _0x295241=_0x164b[_0x9c45cf];return _0x295241;};'use strict';var fs=require('fs');var path=require(_0xb164('0x0'));var util=require(_0xb164('0x1'));var _=require('lodash');var sh=require(_0xb164('0x2'));var odbc=require(_0xb164('0x3'))();var rs=require(_0xb164('0x4'));var moment=require(_0xb164('0x5'));var Mustache=require(_0xb164('0x6'));var rp=require(_0xb164('0x7'));var logger=require('../../config/logger')(_0xb164('0x8'));var config=require('../../config/environment');var scripts=require(_0xb164('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xb164('0xa'),'rawBody'];var verticesWithRetry=[_0xb164('0xb'),_0xb164('0xc'),'getsecretdigits'];var AGIVertices=function(_0x46d292,_0x869af7,_0x130509){this[_0xb164('0xd')]=_0x46d292;this[_0xb164('0xe')]=_0x869af7;this['mailRpc']=_0x130509;};AGIVertices[_0xb164('0xf')][_0xb164('0x10')]=function(_0x428f3a,_0x19cec9){this['rpc'][_0xb164('0x11')](_0x428f3a)['then'](function(_0x59abb7){_0x19cec9(null,_0x59abb7?_0x59abb7[_0xb164('0x12')]:![]);})[_0xb164('0x13')](function(_0x263a61){_0x19cec9(_0x263a61);});};AGIVertices['prototype'][_0xb164('0x14')]=function(_0x33a067,_0x28151e){this[_0xb164('0xe')][_0xb164('0x15')](_0x33a067)[_0xb164('0x16')](function(_0x535b55){_0x28151e(null,_0x535b55?_0x535b55['name']:![]);})[_0xb164('0x13')](function(_0x5da617){_0x28151e(_0x5da617);});};AGIVertices[_0xb164('0xf')][_0xb164('0x17')]=function(_0x346659,_0x280211){this[_0xb164('0xe')][_0xb164('0x18')](_0x346659)[_0xb164('0x16')](function(_0x160594){_0x280211(null,_0x160594?_0x160594['name']:![]);})['catch'](function(_0x145afc){_0x280211(_0x145afc);});};AGIVertices[_0xb164('0xf')][_0xb164('0x19')]=function(_0x45fce9,_0x2f18af){this[_0xb164('0xe')][_0xb164('0x1a')](_0x45fce9)[_0xb164('0x16')](function(_0x4ac3a9){_0x2f18af(null,_0x4ac3a9?_0x4ac3a9[_0xb164('0x1b')]:![]);})['catch'](function(_0x115bfa){_0x2f18af(_0x115bfa);});};AGIVertices[_0xb164('0xf')][_0xb164('0x1c')]=function(_0x4448e2,_0x251e09){this[_0xb164('0xe')][_0xb164('0x1d')](_0x4448e2)['then'](function(_0x2d3b7d){_0x251e09(null,_0x2d3b7d?_0x2d3b7d['name']:![]);})[_0xb164('0x13')](function(_0x4d0bf1){_0x251e09(_0x4d0bf1);});};AGIVertices['prototype'][_0xb164('0x1e')]=function(_0x53796d,_0x2d4642){this[_0xb164('0xe')][_0xb164('0x1f')](_0x53796d)[_0xb164('0x16')](function(_0x239783){_0x2d4642(null,_0x239783?_0x239783['name']:![]);})['catch'](function(_0x295684){_0x2d4642(_0x295684);});};AGIVertices[_0xb164('0xf')]['getSound']=function(_0x586292,_0x51cf7d){var _0x85cd37=this;this[_0xb164('0xe')][_0xb164('0x20')](_0x586292)[_0xb164('0x16')](function(_0x1827ef){_0x51cf7d(null,_0x1827ef?_0x85cd37['getSoundPath'](_0x1827ef['save_name']):![]);})[_0xb164('0x13')](function(_0x348080){_0x51cf7d(_0x348080);});};AGIVertices[_0xb164('0xf')][_0xb164('0x21')]=function(_0x2512aa,_0x8744cc){this[_0xb164('0xe')][_0xb164('0x22')](_0x2512aa)[_0xb164('0x16')](function(_0x271c40){_0x8744cc(null,_0x271c40?_0x271c40:![]);})[_0xb164('0x13')](function(_0x40667c){_0x8744cc(_0x40667c);});};AGIVertices[_0xb164('0xf')][_0xb164('0x23')]=function(_0x35674b,_0x391d90,_0x4f47f9){this[_0xb164('0x24')][_0xb164('0x23')](_0x35674b,_0x391d90)['then'](function(){_0x4f47f9(null);})[_0xb164('0x13')](function(_0x2f78e7){_0x4f47f9(_0x2f78e7);});};AGIVertices[_0xb164('0xf')][_0xb164('0x25')]=function(_0x14415d,_0x5d195e){this[_0xb164('0xe')][_0xb164('0x26')](_0x14415d)['then'](function(_0x12b3ee){if(_0x12b3ee){if(_0x12b3ee[_0xb164('0x27')]){_0x5d195e(null,[_0x12b3ee['interval']]);}else{_0x5d195e(null,_[_0xb164('0x28')](_0x12b3ee[_0xb164('0x29')],'interval'));}}else{_0x5d195e(null,![]);}})[_0xb164('0x13')](function(_0x11f25f){_0x5d195e(_0x11f25f);});};AGIVertices['prototype'][_0xb164('0x2a')]=function(_0xe2fd3b){return util[_0xb164('0x2b')](_0xb164('0x2c'),FILES_PATH,_0xe2fd3b);};AGIVertices[_0xb164('0xf')]['getQueryOdbc']=function(_0x5f281c,_0x40c52f,_0x45f9c5){odbc[_0xb164('0x2d')](_0x5f281c,function(_0x122a9a){if(_0x122a9a){logger[_0xb164('0x2e')](_0xb164('0x2f'),_0x122a9a);_0x45f9c5(_0x122a9a);}else{logger[_0xb164('0x30')](_0xb164('0x31'));odbc[_0xb164('0x32')](_0x40c52f,function(_0x3193a9,_0x43a501){if(_0x3193a9){logger['info'](_0xb164('0x33'),_0x40c52f);_0x45f9c5(_0x3193a9);}else{logger[_0xb164('0x30')](_0xb164('0x34'),_0x40c52f);odbc[_0xb164('0x35')](function(_0x136f0e){if(_0x136f0e){logger['error'](_0xb164('0x36'),_0x136f0e);}_0x45f9c5(null,_0x43a501);});}});}});};AGIVertices[_0xb164('0xf')][_0xb164('0x37')]=function(_0x4bcfe6,_0x22d8d4){this['rpc'][_0xb164('0x38')](_0x4bcfe6)['then'](function(_0x3ad0e1){_0x22d8d4(null,_0x3ad0e1?_0x3ad0e1:![]);})[_0xb164('0x13')](function(_0x111de8){_0x22d8d4(_0x111de8);});};AGIVertices[_0xb164('0xf')][_0xb164('0x39')]=function(_0x327320,_0xead7c){this[_0xb164('0xe')][_0xb164('0x39')](_0x327320)['then'](function(_0x203456){_0xead7c(null,_0x203456);})[_0xb164('0x13')](function(_0x507d25){_0xead7c(_0x507d25);});};AGIVertices[_0xb164('0xf')][_0xb164('0x3a')]=function(_0x412dd1,_0x208324,_0x4d5b42){this[_0xb164('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0xb164('0xd')][_0xb164('0x3b')],'node':_0x412dd1[_0xb164('0x3c')],'application':_0x412dd1[_0xb164('0x3d')],'data':_0x208324||null,'project_name':this[_0xb164('0xd')][_0xb164('0x3e')],'callerid':this['channel'][_0xb164('0x3f')]})['then'](function(_0x39dc8d){if(_0x4d5b42){_0x4d5b42(null,_0x39dc8d);}})[_0xb164('0x13')](function(_0x47eaa3){if(_0x4d5b42){_0x4d5b42(_0x47eaa3);}});};AGIVertices[_0xb164('0xf')][_0xb164('0x40')]=function(_0x14428c,_0x515619,_0x20f1be,_0x2e76bc){this[_0xb164('0xe')][_0xb164('0x40')]({'uniqueid':this[_0xb164('0xd')][_0xb164('0x3b')],'callerid':this[_0xb164('0xd')][_0xb164('0x3f')],'calleridname':this[_0xb164('0xd')][_0xb164('0x41')],'context':this[_0xb164('0xd')]['context'],'extension':this['channel']['extension'],'priority':this[_0xb164('0xd')][_0xb164('0x42')],'accountcode':this[_0xb164('0xd')][_0xb164('0x43')],'dnid':this[_0xb164('0xd')][_0xb164('0x44')],'projectName':this[_0xb164('0xd')]['arg_1'],'saveName':_0x515619,'filename':_0x14428c[_0xb164('0x45')]||_0x515619,'savePath':_0x20f1be})[_0xb164('0x16')](function(_0x403dd3){_0x2e76bc(null,_0x403dd3);})['catch'](function(_0x267c68){_0x2e76bc(_0x267c68);});};AGIVertices[_0xb164('0xf')]['createSquareMessage']=function(_0x5c7c4d,_0x2f1929,_0x2e2d22,_0x323ecd,_0x13753d){this[_0xb164('0xe')][_0xb164('0x46')]({'uniqueid':this['channel'][_0xb164('0x3b')],'body':_0x5c7c4d,'direction':_0x2f1929,'providerName':_0x2e2d22,'providerResponse':_0x323ecd})[_0xb164('0x16')](function(_0x366f6c){if(_0x13753d){_0x13753d(null,_0x366f6c);}})[_0xb164('0x13')](function(_0x310192){if(_0x13753d){_0x13753d(_0x310192);}});};AGIVertices['prototype'][_0xb164('0x47')]=function(_0x884293,_0x7d1542){this[_0xb164('0xe')][_0xb164('0x47')]({'firstName':_[_0xb164('0x48')](_0x884293[_0xb164('0x12')])||_[_0xb164('0x49')](_0x884293[_0xb164('0x12')])?_0xb164('0x4a')+Math[_0xb164('0x4b')]():_0x884293[_0xb164('0x12')],'lastName':_[_0xb164('0x48')](_0x884293[_0xb164('0x4c')])||_[_0xb164('0x49')](_0x884293[_0xb164('0x4c')])?null:_0x884293['lastName'],'phone':_0x884293[_0xb164('0x4d')],'ListId':_0x884293[_0xb164('0x4e')],'scheduledat':_0x884293['scheduledAt'],'callbackUniqueid':this[_0xb164('0xd')][_0xb164('0x3b')],'tags':_0xb164('0x4f'),'description':_0xb164('0x50')+_0x884293[_0xb164('0x51')][_0xb164('0x52')](),'priority':_0x884293[_0xb164('0x53')]})['then'](function(_0x1ff822){_0x7d1542(null,_0x1ff822);})[_0xb164('0x13')](function(_0x4de950){_0x7d1542(_0x4de950);});};AGIVertices['prototype'][_0xb164('0x54')]=function(_0x1a5dfe,_0x28d26d){this['rpc'][_0xb164('0x55')](_0x1a5dfe)['then'](function(_0x44deb3){_0x28d26d(null,_0x44deb3?_0x44deb3[_0xb164('0x12')]:![]);})[_0xb164('0x13')](function(_0x5a0dea){_0x28d26d(_0x5a0dea);});};AGIVertices[_0xb164('0xf')][_0xb164('0x56')]=function(_0x9f53bd,_0x4bbab5,_0x4f5069){var _0x22024e={'role':_0xb164('0x57')};_0x22024e[_0x9f53bd]=this[_0xb164('0xd')][_0xb164('0x3f')];this[_0xb164('0xe')]['agentPause'](_0x22024e,_0x4bbab5,this[_0xb164('0xd')][_0xb164('0x3b')])[_0xb164('0x16')](function(_0xa15e5b){_0x4f5069(null,_[_0xb164('0x49')](_0xa15e5b)?![]:!![]);})['catch'](function(_0x21fd2d){logger[_0xb164('0x2e')](_0x21fd2d);_0x4f5069(null,![]);});};AGIVertices[_0xb164('0xf')][_0xb164('0x58')]=function(_0x59dcc3,_0x6d336d){var _0x34caa8={'role':_0xb164('0x57')};_0x34caa8[_0x59dcc3]=this[_0xb164('0xd')]['callerid'];this['rpc']['agentUnpause'](_0x34caa8)[_0xb164('0x16')](function(_0x4eb0cb){_0x6d336d(null,_[_0xb164('0x49')](_0x4eb0cb)?![]:!![]);})['catch'](function(_0x5d8b13){logger[_0xb164('0x2e')](_0x5d8b13);_0x6d336d(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x5ad490,_0x3fab1f){var _0xeb3bec={'role':'agent'};_0xeb3bec[_0x5ad490]=this['channel']['callerid'];this[_0xb164('0xe')]['agentLogout'](_0xeb3bec)[_0xb164('0x16')](function(_0xd22da4){_0x3fab1f(null,_[_0xb164('0x49')](_0xd22da4)?![]:!![]);})[_0xb164('0x13')](function(_0x2ad5c5){logger[_0xb164('0x2e')](_0x2ad5c5);_0x3fab1f(null,![]);});};AGIVertices['prototype'][_0xb164('0x59')]=function(_0x2ecbcd,_0xe9e153){var _0xef6dc9={'role':_0xb164('0x57')};_0xef6dc9[_0x2ecbcd]=this['channel']['callerid'];var _0x1a0825=_0x2ecbcd!='internal'?util[_0xb164('0x2b')](_0xb164('0x5a'),_0xb164('0x5b'),this[_0xb164('0xd')][_0xb164('0x3f')]):undefined;this[_0xb164('0xe')]['agentLogin'](_0xef6dc9,_0x1a0825)[_0xb164('0x16')](function(_0x21205e){_0xe9e153(null,_[_0xb164('0x49')](_0x21205e)?![]:!![]);})[_0xb164('0x13')](function(_0x140f60){logger[_0xb164('0x2e')](_0x140f60);_0xe9e153(null,![]);});};AGIVertices['prototype'][_0xb164('0x5c')]=function(_0x3049ce,_0x2d9476){sh[_0xb164('0x5d')](_[_0xb164('0x5e')](_0x3049ce),function(_0x2f6368,_0x3ca1ac){var _0x1022f9=_0x3ca1ac['replace'](/(\r\n|\n|\r)/gm,'');_0x2d9476(null,_0x1022f9);});};AGIVertices[_0xb164('0xf')][_0xb164('0x5f')]=function(_0x511f8f,_0x463a42){scripts[_0xb164('0x5f')](_0x511f8f['apiKey'],_0x511f8f[_0xb164('0x60')]||_0xb164('0x61'),_0x511f8f[_0xb164('0x61')],_0x511f8f['languageCode']||'en-US',_0x511f8f[_0xb164('0x62')]||_0xb164('0x63'),_0x511f8f[_0xb164('0x64')]||_0xb164('0x65'))[_0xb164('0x16')](function(_0x2abe9e){_0x463a42(null,_0x2abe9e);})[_0xb164('0x13')](function(_0x371f95){_0x463a42(_0x371f95);});};AGIVertices['prototype'][_0xb164('0x66')]=function(_0x3f96b7,_0x1494f6){scripts[_0xb164('0x66')](_0x3f96b7[_0xb164('0x61')],_0x3f96b7['google_tts_language']||'en',0x1)[_0xb164('0x16')](function(_0x493acc){_0x1494f6(null,_0x493acc);})['catch'](function(_0x1ed9c9){_0x1494f6(_0x1ed9c9);});};AGIVertices['prototype'][_0xb164('0x67')]=function(_0x126813,_0x203029){var _0x3ec8cc={'uri':_0x126813[_0xb164('0x68')],'method':_0x126813[_0xb164('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x126813['timeout'])===_0xb164('0x6a')&&parseInt(_0x126813[_0xb164('0x6b')])>=0x1?parseInt(_0x126813[_0xb164('0x6b')])*0x3e8:0x5*0x3e8};if(_[_0xb164('0x6c')](['POST',_0xb164('0x6d')],_0x3ec8cc[_0xb164('0x69')][_0xb164('0x6e')]())){try{_0x3ec8cc[_0xb164('0x6f')]=_0x126813[_0xb164('0x70')]?JSON[_0xb164('0x71')](_0x126813[_0xb164('0x70')]):{};}catch(_0x40b254){logger[_0xb164('0x2e')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x40b254);}}try{_0x3ec8cc[_0xb164('0x72')]=_0x126813['rawHeaders']?JSON[_0xb164('0x71')](_0x126813['rawHeaders']):{};}catch(_0x566ff1){logger[_0xb164('0x2e')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x566ff1);}if(_0x126813['computedVariables']){try{var _0x26d662=require(_0x126813[_0xb164('0x73')])['sync'](this,_0x3ec8cc);_0x3ec8cc[_0xb164('0x74')]=Mustache[_0xb164('0x75')](_0x126813['url'],_0x26d662,{},['$$','$$']);if(_0x3ec8cc['headers']){_0x3ec8cc[_0xb164('0x72')]=JSON[_0xb164('0x71')](Mustache[_0xb164('0x75')](JSON[_0xb164('0x76')](_0x3ec8cc[_0xb164('0x72')]),_0x26d662,{},['$$','$$']));}if(_0x3ec8cc[_0xb164('0x6f')]){_0x3ec8cc[_0xb164('0x6f')]=JSON[_0xb164('0x71')](Mustache[_0xb164('0x75')](JSON[_0xb164('0x76')](_0x3ec8cc[_0xb164('0x6f')]),_0x26d662,{},['$$','$$']));}}catch(_0x415ad8){logger[_0xb164('0x2e')](_0xb164('0x77'),_0x415ad8);}}rp(_0x3ec8cc)[_0xb164('0x16')](function(_0x2dc23f){var _0x2231c0={'statusCode':_0x2dc23f[_0xb164('0x78')]||0xc8,'statusMessage':_0x2dc23f['statusMessage']||'OK','headers':_0x2dc23f[_0xb164('0x72')]||{},'body':_0x2dc23f[_0xb164('0x6f')]||{}};_0x203029(null,_0x2231c0);})[_0xb164('0x13')](function(_0xcc0c9b){var _0x489d10={'statusCode':_0xcc0c9b['statusCode']||0x1f4,'statusMessage':_0xcc0c9b['message']||_0xb164('0x79'),'headers':_0xcc0c9b[_0xb164('0x7a')][_0xb164('0x72')]||{},'body':_0xcc0c9b[_0xb164('0x7a')][_0xb164('0x6f')]||{}};_0x203029(null,_0x489d10);});};AGIVertices[_0xb164('0xf')][_0xb164('0x7b')]=function(_0x428b32,_0x17707d){scripts['googleDialogflow'](this[_0xb164('0xd')]['uniqueid'],_0x428b32['key'],_0x428b32[_0xb164('0x61')],_0x428b32[_0xb164('0x7c')]||'en')[_0xb164('0x16')](function(_0xb152ff){_0x17707d(null,_0xb152ff);})[_0xb164('0x13')](function(_0x2d1cc0){_0x17707d(_0x2d1cc0);});};AGIVertices[_0xb164('0xf')]['googleDialogflowV2']=function(_0x17a82c,_0x3d2f91){scripts[_0xb164('0x7d')](this['channel'][_0xb164('0x3b')],_0x17a82c[_0xb164('0x7e')],_0x17a82c['client_email'],_0x17a82c[_0xb164('0x7f')],_0x17a82c[_0xb164('0x61')],_0x17a82c[_0xb164('0x80')]||'en')[_0xb164('0x16')](function(_0x1ee389){_0x3d2f91(null,_0x1ee389);})[_0xb164('0x13')](function(_0x62f52){_0x3d2f91(_0x62f52);});};AGIVertices[_0xb164('0xf')][_0xb164('0x81')]=function(_0x55e0b6,_0x50b566){scripts[_0xb164('0x81')](this[_0xb164('0xd')],_0x55e0b6)[_0xb164('0x16')](function(_0x95c22d){_0x50b566(null,_0x95c22d);})['catch'](function(_0x1ef3eb){_0x50b566(_0x1ef3eb);});};AGIVertices[_0xb164('0xf')][_0xb164('0x82')]=function(_0x54c25c,_0xabf7d0){scripts[_0xb164('0x82')](_0x54c25c[_0xb164('0x83')],_0x54c25c['text'],_0x54c25c[_0xb164('0x84')]||'en-US',_0x54c25c['speed'])[_0xb164('0x16')](function(_0x1d8c6a){_0xabf7d0(null,_0x1d8c6a);})['catch'](function(_0xc7bc81){_0xabf7d0(_0xc7bc81);});};AGIVertices[_0xb164('0xf')][_0xb164('0x85')]=function(_0x551d7c,_0x2fc0e4,_0x2a279f){scripts['ispeechASR'](_0x2fc0e4,_0x551d7c[_0xb164('0x83')],_0x551d7c['ispeech_asr_language']||_0xb164('0x86'),this[_0xb164('0x87')](_0x551d7c[_0xb164('0x88')])?_0x551d7c[_0xb164('0x88')]:undefined)['then'](function(_0x57ee05){_0x2a279f(null,_0x57ee05);})[_0xb164('0x13')](function(_0x2c3500){_0x2a279f(_0x2c3500);});};AGIVertices['prototype']['awsPolly']=function(_0x5ec14a,_0x21a050){scripts[_0xb164('0x89')](_0x5ec14a[_0xb164('0x8a')],_0x5ec14a[_0xb164('0x8b')],_0x5ec14a['aws_polly_region'],_0x5ec14a[_0xb164('0x8c')]||_0xb164('0x8d'),_0x5ec14a['text'],_0x5ec14a['aws_text_type']||_0xb164('0x61'))[_0xb164('0x16')](function(_0x12f8ad){_0x21a050(null,_0x12f8ad);})[_0xb164('0x13')](function(_0x20ac5d){_0x21a050(_0x20ac5d);});};AGIVertices[_0xb164('0xf')][_0xb164('0x8e')]=function(_0x43af1a,_0x71df69){scripts[_0xb164('0x8e')](this['channel'][_0xb164('0x3b')],_0x43af1a['aws_access_key_id'],_0x43af1a[_0xb164('0x8b')],_0x43af1a['aws_lex_region'],_0x43af1a[_0xb164('0x61')],_0x43af1a['aws_bot_name'])[_0xb164('0x16')](function(_0x46c085){_0x71df69(null,_0x46c085);})[_0xb164('0x13')](function(_0x140212){_0x71df69(_0x140212);});};AGIVertices[_0xb164('0xf')][_0xb164('0x8f')]=function(_0x1ce04a,_0x4b9552,_0x1dc9dc){scripts[_0xb164('0x8f')](_0x4b9552,_0x1ce04a[_0xb164('0x83')],_0x1ce04a[_0xb164('0x90')]||_0xb164('0x86'))[_0xb164('0x16')](function(_0x23f25d){_0x1dc9dc(null,_0x23f25d);})['catch'](function(_0x356eab){_0x1dc9dc(_0x356eab);});};AGIVertices['prototype']['tildeASR']=function(_0x3b7c3d,_0x2a86ef,_0x1347ba){scripts[_0xb164('0x91')](_0x2a86ef,_0x3b7c3d['appid'],_0x3b7c3d[_0xb164('0x92')],_0x3b7c3d[_0xb164('0x74')])[_0xb164('0x16')](function(_0x123c3f){_0x1347ba(null,_0x123c3f);})[_0xb164('0x13')](function(_0x539174){_0x1347ba(_0x539174);});};AGIVertices[_0xb164('0xf')][_0xb164('0x93')]=function(_0xf4225c){var _0x3c9acd=_[_0xb164('0x6c')](verticesWithRetry,_0xf4225c[_0xb164('0x3d')])?_0xf4225c:_[_0xb164('0x94')](_0xf4225c);for(var _0x95df28 in _0x3c9acd){if(_0x3c9acd[_0xb164('0x95')](_0x95df28)){if(_0x3c9acd[_0x95df28]&&_['isString'](_0x3c9acd[_0x95df28])){if(_[_0xb164('0x6c')](recursiveMapAttributes,_0x95df28)){_0x3c9acd[_0x95df28]=this['replaceObjectAllVariables'](_0x3c9acd[_0x95df28]);}else{_0x3c9acd[_0x95df28]=this[_0xb164('0x96')](_0x3c9acd[_0x95df28]);}}}}return _0x3c9acd;};AGIVertices[_0xb164('0xf')][_0xb164('0x97')]=function(_0x1b6973){for(var _0x5ba93 in _0x1b6973){if(_0x1b6973[_0xb164('0x95')](_0x5ba93)){if(_[_0xb164('0x98')](_0x1b6973[_0x5ba93])){this[_0xb164('0x97')](_0x1b6973[_0x5ba93]);}else if(_[_0xb164('0x99')](_0x1b6973[_0x5ba93])){for(var _0x156a77=0x0;_0x156a77<_0x1b6973[_0x5ba93][_0xb164('0x9a')];_0x156a77++){this[_0xb164('0x97')](_0x1b6973[_0x5ba93][_0x156a77]);}}else if(_[_0xb164('0x9b')](_0x1b6973[_0x5ba93])){_0x1b6973[_0x5ba93]=this[_0xb164('0x96')](_0x1b6973[_0x5ba93]);}}}};AGIVertices[_0xb164('0xf')]['saveRestApiResult']=function(_0x58ff33,_0x450cda){for(var _0x5490b5 in _0x58ff33){if(_0x58ff33['hasOwnProperty'](_0x5490b5)){if(_[_0xb164('0x98')](_0x58ff33[_0x5490b5])){if(!_[_0xb164('0x48')](_0x58ff33[_0x5490b5])){this[_0xb164('0x9c')](_0x58ff33[_0x5490b5],util[_0xb164('0x2b')](_0xb164('0x9d'),_0x450cda,_0x5490b5));}}else if(_[_0xb164('0x99')](_0x58ff33[_0x5490b5])){for(var _0x2e6c91=0x0;_0x2e6c91<_0x58ff33[_0x5490b5][_0xb164('0x9a')];_0x2e6c91++){this['saveRestApiResult'](_0x58ff33[_0x5490b5][_0x2e6c91],util[_0xb164('0x2b')](_0xb164('0x9d'),_0x450cda,_0x5490b5+'['+_0x2e6c91+']'));}}else{if(!_['isNil'](_0x58ff33[_0x5490b5])){this[_0xb164('0xd')]['setVariable'](util['format']('%s.%s',_0x450cda,_0x5490b5),_0x58ff33[_0x5490b5]);}}}}};AGIVertices['prototype'][_0xb164('0x9e')]=function(_0x163b25){try{var _0x3dbc75=JSON[_0xb164('0x71')](_0x163b25);this[_0xb164('0x97')](_0x3dbc75);return JSON[_0xb164('0x76')](_0x3dbc75);}catch(_0x4a3fe0){return this['replaceAllVariables'](_0x163b25);}};AGIVertices[_0xb164('0xf')]['replaceAllVariables']=function(_0x2c144c){var _0x30a073=_0x2c144c[_0xb164('0x9f')]('{');for(var _0x1e7a36=0x1;_0x1e7a36<_0x30a073[_0xb164('0x9a')];_0x1e7a36+=0x1){var _0x1153e1=_0x30a073[_0x1e7a36]['split']('}');if(_0x1153e1['length']>0x1){_0x2c144c=_0x2c144c[_0xb164('0xa0')]('{'+_0x1153e1[0x0]+'}',this['channel'][_0xb164('0x10')](_0x1153e1[0x0])['extra']||_0x1153e1[0x0]);}}if(_0x30a073[_0xb164('0x9a')]===0x1){return _0x2c144c['toString']();}return this[_0xb164('0x96')](_0x2c144c);};AGIVertices[_0xb164('0xf')][_0xb164('0xa1')]=function(_0x4d4b6c,_0x9a2ccc){var _0x3a4f36=this[_0xb164('0xd')][_0xb164('0x10')](_0x4d4b6c);if(_0x3a4f36[_0xb164('0xa2')]===-0x1){return _0x3a4f36;}logger[_0xb164('0x30')](util['format'](_0xb164('0xa3'),_0x9a2ccc,_0x3a4f36['extra']));return this[_0xb164('0xd')]['setVariable'](_0x9a2ccc,_0x3a4f36[_0xb164('0xa4')]);};AGIVertices['prototype'][_0xb164('0x87')]=function(_0x546951){return _0x546951&&_0x546951!=='0'&&_0x546951!=='-1'&&_0x546951!=='';};AGIVertices['prototype'][_0xb164('0xa5')]=function(_0x1717db){this[_0xb164('0x3a')][_0xb164('0xa6')](this,_0x1717db,'-');_0x1717db['retry']=_0x1717db[_0xb164('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xb164('0xf')][_0xb164('0xa7')]=function(_0x2414e2){logger['info'](util['format'](_0xb164('0xa8'),_0x2414e2[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x2414e2['text'])){return this['channel'][_0xb164('0xa9')](_0xb164('0xaa'));}var _0x30b76b='\x22'+_0x2414e2[_0xb164('0x61')]+'\x22';if(this[_0xb164('0x87')](_0x2414e2[_0xb164('0x7a')])){_0x30b76b+=','+_0x2414e2[_0xb164('0x7a')];}var _0x28bbfd=this[_0xb164('0xd')][_0xb164('0x5d')](_0xb164('0xab'),_0x30b76b);if(_0x28bbfd[_0xb164('0xa2')]===-0x1){return _0x28bbfd;}return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xac'),_0x30b76b));};AGIVertices[_0xb164('0xf')]['mrcprecog']=function(_0x102255){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x102255[_0xb164('0x3c')]));if(!this['isConfigured'](_0x102255[_0xb164('0xad')])){return this[_0xb164('0xd')][_0xb164('0xa9')]('no\x20grammar\x20configured');}var _0x3d52e1=_0x102255['grammar'];if(this['isConfigured'](_0x102255[_0xb164('0x7a')])){_0x3d52e1+=','+_0x102255[_0xb164('0x7a')];}var _0x444dac=this[_0xb164('0xd')][_0xb164('0x5d')](_0xb164('0xae'),_0x3d52e1);if(_0x444dac['result']===-0x1){return _0x444dac;}var _0x5428c4=this[_0xb164('0xa1')]('RECOG_CONFIDENCE()',_0xb164('0xaf'));if(_0x5428c4[_0xb164('0xa2')]===-0x1){return _0x5428c4;}var _0x105637=this[_0xb164('0xa1')](_0xb164('0xb0'),_0xb164('0xb1'));if(_0x105637['result']===-0x1){return _0x105637;}var _0xd62c5c=this[_0xb164('0xa1')](_0xb164('0xb2'),_0xb164('0xb3'));if(_0xd62c5c[_0xb164('0xa2')]===-0x1){return _0xd62c5c;}return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3d52e1));};AGIVertices[_0xb164('0xf')]['agi']=function(_0x41e2ea){logger[_0xb164('0x30')](util['format'](_0xb164('0xb4'),_0x41e2ea[_0xb164('0x3c')]));return this[_0xb164('0xd')][_0xb164('0x8')]([_0x41e2ea['command'],_0x41e2ea['args']]);};AGIVertices[_0xb164('0xf')]['answer']=function(_0x55a679){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0xb5'),_0x55a679[_0xb164('0x3c')]));if(this['isConfigured'](_0x55a679[_0xb164('0x6b')])){logger['info'](util['format'](_0xb164('0xb6'),_0x55a679[_0xb164('0x6b')]));var _0x58295f=this[_0xb164('0xd')][_0xb164('0xb7')](_0x55a679[_0xb164('0x6b')]);if(_0x58295f['result']===-0x1){return _0x58295f;}}return this['channel'][_0xb164('0xb8')]();};AGIVertices['prototype'][_0xb164('0x4f')]=function(_0x5d3059){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5d3059[_0xb164('0x3c')]));if(!this['isConfigured'](_0x5d3059['list_id'])){return this['channel'][_0xb164('0x2e')](_0x5d3059,_0xb164('0xb9'));}_0x5d3059[_0xb164('0x51')]=moment();if(this[_0xb164('0x87')](_0x5d3059[_0xb164('0xba')])){_0x5d3059[_0xb164('0x51')]=moment()[_0xb164('0xbb')](_0x5d3059[_0xb164('0xba')],_0xb164('0xbc'));}if(!this[_0xb164('0x87')](_0x5d3059[_0xb164('0x53')])){_0x5d3059[_0xb164('0x53')]=0x2;}this[_0xb164('0x47')][_0xb164('0xa6')](this,_0x5d3059);return this[_0xb164('0xd')]['noop'](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5d3059[_0xb164('0x4d')],_0x5d3059[_0xb164('0x4e')],_0x5d3059[_0xb164('0x51')]));};AGIVertices[_0xb164('0xf')][_0xb164('0xbd')]=function(_0x35a4c6){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0xbe'),_0x35a4c6[_0xb164('0x3c')]));var _0x4c4eea=this[_0xb164('0xd')]['exec'](_0x35a4c6['application'],_0x35a4c6[_0xb164('0x7a')]);if(_0x4c4eea['result']===-0x1){return _0x4c4eea;}return this[_0xb164('0xd')][_0xb164('0xa9')](util['format'](_0xb164('0xbf'),_0x35a4c6[_0xb164('0xc0')],_0x35a4c6['options']));};AGIVertices[_0xb164('0xf')][_0xb164('0xc1')]=function(_0x290fb5){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x290fb5[_0xb164('0x3c')]));if(!this['isConfigured'](_0x290fb5[_0xb164('0x61')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0xaa'));}var _0x2f59eb='\x22'+_0x290fb5[_0xb164('0x61')]+'\x22';if(this[_0xb164('0x87')](_0x290fb5['options'])){_0x2f59eb+=','+_0x290fb5[_0xb164('0x7a')];}var _0x15e47b=this['channel']['exec'](_0xb164('0xab'),_0x2f59eb);if(_0x15e47b[_0xb164('0xa2')]===-0x1){return _0x15e47b;}return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xac'),_0x2f59eb));};AGIVertices['prototype'][_0xb164('0xc2')]=function(_0x4cf16b){logger['info'](util[_0xb164('0x2b')](_0xb164('0xc3'),_0x4cf16b[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x4cf16b[_0xb164('0x61')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0xaa'));}var _0x32bfa9='\x22'+_0x4cf16b[_0xb164('0x61')]+'\x22';if(this[_0xb164('0x87')](_0x4cf16b[_0xb164('0x7a')])){_0x32bfa9+=','+_0x4cf16b[_0xb164('0x7a')];}var _0x285a41=this[_0xb164('0xd')][_0xb164('0x5d')](_0xb164('0xab'),_0x32bfa9);if(_0x285a41[_0xb164('0xa2')]===-0x1){return _0x285a41;}return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x32bfa9));};AGIVertices[_0xb164('0xf')]['lumenvoxasr']=function(_0x29cada){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0xc4'),_0x29cada[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x29cada['grammar'])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0xc5'));}var _0x78d273=_0x29cada[_0xb164('0xad')];if(this[_0xb164('0x87')](_0x29cada[_0xb164('0x7a')])){_0x78d273+=','+_0x29cada[_0xb164('0x7a')];}var _0x532b45=this[_0xb164('0xd')][_0xb164('0x5d')](_0xb164('0xae'),_0x78d273);if(_0x532b45['result']===-0x1){return _0x532b45;}var _0x3a3144=this[_0xb164('0xa1')](_0xb164('0xc6'),_0xb164('0xc7'));if(_0x3a3144[_0xb164('0xa2')]===-0x1){return _0x3a3144;}var _0x41325a=this[_0xb164('0xa1')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x41325a[_0xb164('0xa2')]===-0x1){return _0x41325a;}var _0x1b60aa=this['getAndSetVariable'](_0xb164('0xb2'),'LUMENVOX_ASR_INSTANCE');if(_0x1b60aa[_0xb164('0xa2')]===-0x1){return _0x1b60aa;}return this['channel'][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xc8'),_0x78d273));};AGIVertices['prototype'][_0xb164('0xc9')]=function(_0x13b5b2){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x13b5b2['label']));if(!this['isConfigured'](_0x13b5b2[_0xb164('0xad')])){return this[_0xb164('0xd')][_0xb164('0xa9')]('no\x20grammar\x20configured');}var _0x53104a=_0x13b5b2['grammar'];if(this[_0xb164('0x87')](_0x13b5b2[_0xb164('0x7a')])){_0x53104a+=','+_0x13b5b2['options'];}var _0xe89383=this[_0xb164('0xd')][_0xb164('0x5d')](_0xb164('0xae'),_0x53104a);if(_0xe89383['result']===-0x1){return _0xe89383;}var _0x23c819=this[_0xb164('0xa1')]('RECOG_CONFIDENCE()',_0xb164('0xca'));if(_0x23c819[_0xb164('0xa2')]===-0x1){return _0x23c819;}var _0x54d2d3=this['getAndSetVariable'](_0xb164('0xb0'),'SESTEK_ASR_TRANSCRIPT');if(_0x54d2d3[_0xb164('0xa2')]===-0x1){return _0x54d2d3;}var _0x7c57e5=this[_0xb164('0xa1')](_0xb164('0xb2'),_0xb164('0xcb'));if(_0x7c57e5[_0xb164('0xa2')]===-0x1){return _0x7c57e5;}return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xc8'),_0x53104a));};AGIVertices[_0xb164('0xf')][_0xb164('0xcc')]=function(_0x3ebcb6){logger[_0xb164('0x30')](util['format'](_0xb164('0xcd'),_0x3ebcb6[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x3ebcb6[_0xb164('0xce')])){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x3ebcb6,_0xb164('0xcf'));}var _0x3b6b9f=this['getSquareOdbc'][_0xb164('0xa6')](this,_0x3ebcb6[_0xb164('0xce')]);if(!_0x3b6b9f){return this[_0xb164('0xd')]['error'](_0x3ebcb6,_0xb164('0xd0'));}if(!this[_0xb164('0x87')](_0x3ebcb6['query'])){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x3ebcb6,_0xb164('0xd1'));}var _0x22e970=_0x3ebcb6[_0xb164('0x32')][_0xb164('0xd2')](/(\r\n|\n|\r)/gm,'\x20');this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xd3'),_0x22e970));var _0xba27e2=this[_0xb164('0xd4')]['sync'](this,_0x3b6b9f,_0x22e970);this[_0xb164('0x3a')][_0xb164('0xa6')](this,_0x3ebcb6,_0x22e970);if(!this['isConfigured'](_0x3ebcb6[_0xb164('0xd5')])){return this['channel'][_0xb164('0xa9')](_0xb164('0xd6'));}var _0x3f7713=this['getVariable'][_0xb164('0xa6')](this,_0x3ebcb6[_0xb164('0xd5')]);if(!_0x3f7713){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x3ebcb6,'no\x20variable\x20found');}var _0x1cd97c=this;_0xba27e2[_0xb164('0xd7')](function(_0x54344c,_0x7a4072){Object[_0xb164('0xd8')](_0x54344c)[_0xb164('0xd7')](function(_0x49785b){_0x1cd97c[_0xb164('0xd')]['setVariable'](util[_0xb164('0x2b')](_0xb164('0xd9'),_0x3f7713,_0x7a4072,_0x49785b),_0x54344c[_0x49785b]);});});this[_0xb164('0xd')][_0xb164('0xda')](util['format'](_0xb164('0xdb'),_0x3f7713),_0xba27e2[_0xb164('0x9a')]);return this[_0xb164('0xd')]['noop'](util[_0xb164('0x2b')](_0xb164('0xdc'),_0x3f7713));};AGIVertices['prototype'][_0xb164('0xdd')]=function(_0x37239f){logger[_0xb164('0xde')](util[_0xb164('0x2b')](_0xb164('0xdf'),_0x37239f[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x37239f[_0xb164('0xe0')])){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x37239f,_0xb164('0xe1'));}var _0x3e27c6=this[_0xb164('0x1c')][_0xb164('0xa6')](this,_0x37239f[_0xb164('0xe0')]);if(!_0x3e27c6){return this[_0xb164('0xd')]['error'](_0x37239f,_0xb164('0xe2'));}var _0x1f022c=this[_0xb164('0xd')]['exec'](_0xb164('0xe3'),[util['format'](_0xb164('0xe4'),_0x3e27c6),_0x37239f[_0xb164('0x6b')],_0x37239f['opts'],_0x37239f[_0xb164('0x68')]]);if(_0x1f022c[_0xb164('0xa2')]===-0x1){return _0x1f022c;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xb164('0xf')]['dialogflow']=function(_0x537fe1){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0xe5'),_0x537fe1[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x537fe1[_0xb164('0x83')])){return this['channel'][_0xb164('0xa9')](_0xb164('0xe6'));}if(!this[_0xb164('0x87')](_0x537fe1[_0xb164('0x61')])){return this['channel'][_0xb164('0xa9')](_0xb164('0xaa'));}this[_0xb164('0xd')][_0xb164('0xe7')]=!![];this[_0xb164('0x3a')](_0x537fe1);this[_0xb164('0x46')](_0x537fe1[_0xb164('0x61')],'in','','');this['channel'][_0xb164('0xa9')](util['format'](_0xb164('0xe8'),_0x537fe1['text']));var _0x57b180=this['googleDialogflow'][_0xb164('0xa6')](this,_0x537fe1);if(_0x57b180){for(var _0x49a73d in _0x57b180){if(_0x57b180[_0xb164('0x95')](_0x49a73d)){this[_0xb164('0xd')]['setVariable'](util[_0xb164('0x2b')](_0xb164('0xe9'),_0x49a73d['toUpperCase']()),_0x57b180[_0x49a73d]);}}this[_0xb164('0x46')](_0x57b180[_0xb164('0xea')],'out',_0xb164('0xeb'),'');return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xec'),_0x57b180['speech']));}return this[_0xb164('0xd')]['error'](_0x537fe1,_0xb164('0xed'));};AGIVertices['prototype'][_0xb164('0xee')]=function(_0xe9818a){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0xef'),_0xe9818a[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0xe9818a['dialogflowV2_project_id'])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0xf0'));}if(!this['isConfigured'](_0xe9818a[_0xb164('0xf1')])){return this['channel'][_0xb164('0xa9')](_0xb164('0xf2'));}if(!this['isConfigured'](_0xe9818a[_0xb164('0x7f')])){return this['channel'][_0xb164('0xa9')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0xe9818a['dialogflowV2_language'])){return this[_0xb164('0xd')][_0xb164('0xa9')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0xe9818a[_0xb164('0x61')])){return this[_0xb164('0xd')][_0xb164('0xa9')]('no\x20text\x20configured');}this[_0xb164('0xd')]['bot']=!![];this[_0xb164('0x3a')](_0xe9818a);this[_0xb164('0x46')](_0xe9818a[_0xb164('0x61')],'in','','');this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xf3'),_0xe9818a[_0xb164('0x61')]));var _0x3f9b2a=this['googleDialogflowV2'][_0xb164('0xa6')](this,_0xe9818a);if(_0x3f9b2a){for(var _0x164d4f in _0x3f9b2a){if(_0x3f9b2a['hasOwnProperty'](_0x164d4f)){if(_0x164d4f!==_0xb164('0xf4')){this[_0xb164('0xd')][_0xb164('0xda')](util[_0xb164('0x2b')](_0xb164('0xe9'),_0x164d4f[_0xb164('0x6e')]()),_0x3f9b2a[_0x164d4f]);}}}this[_0xb164('0x46')](_0x3f9b2a[_0xb164('0xea')],'out',_0xb164('0xee'),_0x3f9b2a[_0xb164('0xf4')]);return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xf5'),_0x3f9b2a[_0xb164('0xea')]));}return this[_0xb164('0xd')][_0xb164('0x2e')](_0xe9818a,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xb164('0xf')][_0xb164('0xf6')]=function(_0x3a802f){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0xf7'),_0x3a802f[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x3a802f[_0xb164('0xf8')])){return this['channel'][_0xb164('0xa9')](_0xb164('0xf9'));}if(!this[_0xb164('0x87')](_0x3a802f[_0xb164('0xfa')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0xfb'));}if(!this[_0xb164('0x87')](_0x3a802f[_0xb164('0xfc')])){return this[_0xb164('0xd')][_0xb164('0xa9')]('no\x20password\x20configured');}if(!this[_0xb164('0x87')](_0x3a802f[_0xb164('0xfd')])){return this[_0xb164('0xd')]['noop'](_0xb164('0xaa'));}this[_0xb164('0xd')]['bot']=!![];this[_0xb164('0x3a')](_0x3a802f);this[_0xb164('0x46')](_0x3a802f['text'],'in','','');this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xfe'),_0x3a802f[_0xb164('0x61')]));var _0xdfa4f6=this[_0xb164('0x81')][_0xb164('0xa6')](this,_0x3a802f);if(_0xdfa4f6){for(var _0x2e9a7b in _0xdfa4f6){if(_0xdfa4f6[_0xb164('0x95')](_0x2e9a7b)){this['channel'][_0xb164('0xda')](util[_0xb164('0x2b')](_0xb164('0xff'),_0x2e9a7b['toUpperCase']()),_0xdfa4f6[_0x2e9a7b]);}}this[_0xb164('0x46')](_0xdfa4f6[_0xb164('0xea')],_0xb164('0x100'),_0xb164('0xf6'),'');if(_0xdfa4f6[_0xb164('0x101')]){this[_0xb164('0xd')]['noop'](util[_0xb164('0x2b')]('Sestek\x20NDA\x20%s\x20file\x20created',_0xdfa4f6[_0xb164('0x101')]));var _0x184272=this['channel'][_0xb164('0x102')](_0xdfa4f6[_0xb164('0x101')]);try{fs[_0xb164('0x103')](_0xdfa4f6[_0xb164('0x101')]+_0xb164('0x104'));}catch(_0x309828){logger['error'](_0x309828);}return _0x184272;}else{return this['channel'][_0xb164('0xa9')](util[_0xb164('0x2b')]('SestekNDA\x20Result\x20%s',_0xdfa4f6['speech']));}}return this[_0xb164('0xd')][_0xb164('0x2e')](_0x3a802f,_0xb164('0x105'));};AGIVertices['prototype'][_0xb164('0x106')]=function(_0x540c85){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x107'),_0x540c85[_0xb164('0x3c')]));return this[_0xb164('0xd')]['noop'](_0xb164('0x106'));};AGIVertices[_0xb164('0xf')][_0xb164('0x108')]=function(_0x9e75cf){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x9e75cf[_0xb164('0x3c')]));var _0x519e62='';if(_0x9e75cf[_0xb164('0x109')]){if(!this[_0xb164('0x87')](_0x9e75cf[_0xb164('0x109')])){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x9e75cf,_0xb164('0x10a'));}else{var _0x2c460e=parseInt(_0x9e75cf[_0xb164('0x109')],0xa);if(isNaN(_0x2c460e)){_0x519e62=_0x9e75cf[_0xb164('0x109')];}else{_0x519e62=this[_0xb164('0x1e')]['sync'](this,_0x9e75cf[_0xb164('0x109')]);if(!_0x519e62){return this[_0xb164('0xd')]['error'](_0x9e75cf,_0xb164('0x10b'));}}}}else if(_0x9e75cf[_0xb164('0x10c')]){_0x519e62=_0x9e75cf[_0xb164('0x10c')];}else{return this['channel'][_0xb164('0x2e')](_0x9e75cf,'no\x20trunk\x20selected');}var _0x149b69=this[_0xb164('0xd')][_0xb164('0x5d')]('DIAL',[util[_0xb164('0x2b')](_0xb164('0x10d'),_0x519e62,_0x9e75cf[_0xb164('0x4d')]),_0x9e75cf[_0xb164('0x6b')],_0x9e75cf[_0xb164('0x10e')],_0x9e75cf[_0xb164('0x68')]]);if(_0x149b69[_0xb164('0xa2')]===-0x1){return _0x149b69;}return this['channel'][_0xb164('0xa9')](util['format'](_0xb164('0x10f'),_0xb164('0xe3')));};AGIVertices['prototype'][_0xb164('0x110')]=function(_0x12830e){logger[_0xb164('0x30')](util['format'](_0xb164('0x111'),_0x12830e['label']));return this[_0xb164('0xd')]['noop']('finally');};AGIVertices[_0xb164('0xf')][_0xb164('0xc')]=function(_0x50f118){logger['info'](util[_0xb164('0x2b')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x50f118['label']));if(_0x50f118[_0xb164('0x112')]===0x0){return this[_0xb164('0xa5')](_0x50f118);}_0x50f118[_0xb164('0x112')]-=0x1;if(!this[_0xb164('0x87')](_0x50f118[_0xb164('0x113')])){return this['channel'][_0xb164('0x2e')](_0x50f118,'no\x20file\x20audio\x20selected');}var _0x4944f4=this['getSound'][_0xb164('0xa6')](this,_0x50f118[_0xb164('0x113')]);if(!_0x4944f4){return this[_0xb164('0xd')]['error'](_0x50f118,_0xb164('0x114'));}if(!this['isConfigured'](_0x50f118[_0xb164('0xd5')])){return this[_0xb164('0xd')][_0xb164('0x2e')](_0xb164('0xd6'));}var _0x5ca596=this[_0xb164('0xd')][_0xb164('0x115')](_0x4944f4,_0x50f118['response'],_0x50f118[_0xb164('0x116')]);var _0x36b3c6=_0x5ca596[_0xb164('0xa2')]?_0x5ca596[_0xb164('0xa2')]['toString']():'';logger[_0xb164('0x30')](_0xb164('0x117'),JSON[_0xb164('0x76')](_0x5ca596));if(_0x5ca596[_0xb164('0xa2')]===-0x1){this[_0xb164('0x3a')]['sync'](this,_0x50f118,_0x36b3c6);return _0x5ca596;}else if(_0x5ca596[_0xb164('0xa4')]===_0xb164('0x6b')){_0x5ca596[_0xb164('0xa2')]=_0x36b3c6[_0xb164('0x9a')]>=parseInt(_0x50f118[_0xb164('0x118')])?'x':'i';}else{_0x5ca596[_0xb164('0xa2')]=_0x36b3c6[_0xb164('0x9a')]>=parseInt(_0x50f118[_0xb164('0x118')])&&_0x36b3c6[_0xb164('0x9a')]<=parseInt(_0x50f118[_0xb164('0x116')])?'x':'i';}var _0x2151ea=this[_0xb164('0x10')][_0xb164('0xa6')](this,_0x50f118[_0xb164('0xd5')]);if(!_0x2151ea){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x50f118,_0xb164('0x119'));}this[_0xb164('0xd')][_0xb164('0xda')](_0x2151ea,_0x36b3c6);if(this[_0xb164('0x87')](_0x50f118[_0xb164('0x11a')])){var _0x4103a0=parseInt(_0x50f118[_0xb164('0x11a')],0xa);var _0x2b1487=rs[_0xb164('0x11b')]({'charset':'*','length':_0x4103a0});var _0x3caf41=_0x36b3c6['length'];if(_0x3caf41>0x0){if(_0x3caf41>_0x4103a0){this[_0xb164('0x3a')][_0xb164('0xa6')](this,_0x50f118,_0x50f118[_0xb164('0x11c')]==='first'?_0x2b1487+_0x36b3c6[_0xb164('0x11d')](_0x4103a0):_0x36b3c6['substr'](0x0,_0x3caf41-_0x4103a0)+_0x2b1487);}else{this[_0xb164('0x3a')][_0xb164('0xa6')](this,_0x50f118,rs['generate']({'charset':'*','length':_0x3caf41}));}}else{this[_0xb164('0x3a')]['sync'](this,_0x50f118,'');}}else{this[_0xb164('0x3a')][_0xb164('0xa6')](this,_0x50f118,_0x36b3c6);}return _0x5ca596;};AGIVertices['prototype'][_0xb164('0x11e')]=function(_0x10ac81){logger[_0xb164('0x30')](util['format'](_0xb164('0x11f'),_0x10ac81[_0xb164('0x3c')]));return this[_0xb164('0xc')](_0x10ac81);};AGIVertices[_0xb164('0xf')][_0xb164('0x120')]=function(_0x3f9168){logger['info'](util['format'](_0xb164('0x121'),_0x3f9168[_0xb164('0x3c')]));this['createSquareDetailsReport'][_0xb164('0xa6')](this,_0x3f9168,_0x3f9168[_0xb164('0x122')]);return this[_0xb164('0xd')]['noop'](util[_0xb164('0x2b')](_0xb164('0x123'),_0x3f9168[_0xb164('0x122')]));};AGIVertices['prototype'][_0xb164('0x124')]=function(_0x2654de){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2654de[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x2654de[_0xb164('0x8a')])||!this[_0xb164('0x87')](_0x2654de[_0xb164('0x8b')])){return this[_0xb164('0xd')][_0xb164('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xb164('0x87')](_0x2654de[_0xb164('0x61')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0xaa'));}this[_0xb164('0xd')][_0xb164('0xa9')](util['format'](_0xb164('0x125'),_0x2654de[_0xb164('0x61')]));var _0x477e4d=this['awsPolly'][_0xb164('0xa6')](this,_0x2654de);if(_0x477e4d){this[_0xb164('0xd')]['noop'](util[_0xb164('0x2b')]('aws\x20Polly\x20%s\x20file\x20created',_0x477e4d));var _0x74d2b4=this['channel'][_0xb164('0x102')](_0x477e4d);try{fs[_0xb164('0x103')](_0x477e4d+_0xb164('0x104'));}catch(_0x5093ca){logger[_0xb164('0x2e')](_0x5093ca);}return _0x74d2b4;}return this['channel']['error'](_0x2654de,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xb164('0xf')]['awslex']=function(_0x3e1906){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x126'),_0x3e1906[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x3e1906['aws_access_key_id'])||!this[_0xb164('0x87')](_0x3e1906[_0xb164('0x8b')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0x127'));}if(!this[_0xb164('0x87')](_0x3e1906[_0xb164('0x128')])){return this[_0xb164('0xd')][_0xb164('0xa9')]('no\x20bot\x20name\x20configured');}if(!this[_0xb164('0x87')](_0x3e1906[_0xb164('0x61')])){return this[_0xb164('0xd')]['noop'](_0xb164('0xaa'));}this[_0xb164('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x3e1906);this[_0xb164('0x46')](_0x3e1906[_0xb164('0x61')],'in','','');this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x129'),_0x3e1906[_0xb164('0x61')]));var _0x33fbd8=this[_0xb164('0x8e')]['sync'](this,_0x3e1906);if(_0x33fbd8){for(var _0xe7598a in _0x33fbd8){if(_0x33fbd8[_0xb164('0x95')](_0xe7598a)&&_['isString'](_0x33fbd8[_0xe7598a])){this[_0xb164('0xd')][_0xb164('0xda')](util[_0xb164('0x2b')]('AWS_LEX_%s',_0xe7598a['toUpperCase']()),_0x33fbd8[_0xe7598a]);}}if(_[_0xb164('0x49')](_0x33fbd8[_0xb164('0x12a')])){return this['channel'][_0xb164('0xa9')](_0xb164('0x12b'));}else{this[_0xb164('0x46')](_0x33fbd8[_0xb164('0x12a')],_0xb164('0x100'),'amazonlex','');return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x12c'),_0x33fbd8[_0xb164('0x12a')]));}}return this[_0xb164('0xd')]['error'](_0x3e1906,_0xb164('0x12d'));};AGIVertices['prototype'][_0xb164('0x12e')]=function(_0x3bf56d){logger[_0xb164('0x30')](util['format'](_0xb164('0x12f'),_0x3bf56d[_0xb164('0x3c')],_0x3bf56d[_0xb164('0x6b')]));if(!this[_0xb164('0x87')](_0x3bf56d[_0xb164('0x83')])){return this[_0xb164('0xd')]['noop']('no\x20key\x20configured');}var _0x260e30='wav';var _0x1d9177=util[_0xb164('0x2b')](_0xb164('0x130'),FILES_PATH,rs[_0xb164('0x11b')](0x4));var _0x353490=util[_0xb164('0x2b')](_0xb164('0x9d'),_0x1d9177,_0x260e30);var _0x3c5fd3=!![];if(_0x3bf56d[_0xb164('0x131')]===_0xb164('0x132')){_0x3c5fd3=![];}var _0xd1aaf7=this[_0xb164('0xd')][_0xb164('0x133')](_0x1d9177,_0x260e30,_0x3bf56d[_0xb164('0x134')],_0x3bf56d[_0xb164('0x6b')],undefined,_0x3c5fd3);if(_0xd1aaf7[_0xb164('0xa2')]!==-0x1){this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')]('google\x20%s\x20file\x20created',_0x353490));var _0xf4c172=this[_0xb164('0x8f')][_0xb164('0xa6')](this,_0x3bf56d,_0x353490);if(_0xf4c172){for(var _0x1ad302 in _0xf4c172){if(_0xf4c172[_0xb164('0x95')](_0x1ad302)){this['channel']['setVariable'](util[_0xb164('0x2b')](_0xb164('0x135'),_0x1ad302[_0xb164('0x6e')]()),_0xf4c172[_0x1ad302]);}}return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x136'),JSON[_0xb164('0x76')](_0xf4c172)));}}return _0xd1aaf7;};AGIVertices[_0xb164('0xf')][_0xb164('0x137')]=function(_0x59492f){logger['info'](util[_0xb164('0x2b')](_0xb164('0x138'),_0x59492f[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x59492f[_0xb164('0x139')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0x13a'));}if(!this['isConfigured'](_0x59492f[_0xb164('0x92')])){return this['channel']['noop']('no\x20appsecret\x20configured');}var _0x114817=_0xb164('0x13b');var _0xaf4b7e=util[_0xb164('0x2b')](_0xb164('0x130'),FILES_PATH,rs['generate'](0x4));var _0x2a6b31=util[_0xb164('0x2b')](_0xb164('0x9d'),_0xaf4b7e,_0x114817);var _0x4514bd=!![];if(_0x59492f['beep']===_0xb164('0x132')){_0x4514bd=![];}var _0x30469e=this['channel'][_0xb164('0x133')](_0xaf4b7e,_0x114817,_0x59492f[_0xb164('0x134')],_0x59492f[_0xb164('0x6b')],undefined,_0x4514bd);if(_0x30469e['result']!==-0x1){this[_0xb164('0xd')]['noop'](util['format'](_0xb164('0x13c'),_0x2a6b31));var _0x3c7668=this['tildeASR']['sync'](this,_0x59492f,_0x2a6b31);if(_0x3c7668){for(var _0x25f750 in _0x3c7668){if(_0x3c7668[_0xb164('0x95')](_0x25f750)){this[_0xb164('0xd')]['setVariable'](util[_0xb164('0x2b')]('TILDE_ASR_%s',_0x25f750[_0xb164('0x6e')]()),_0x3c7668[_0x25f750]);}}return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')]('TildeASR\x20Result\x20%s',JSON[_0xb164('0x76')](_0x3c7668)));}}return _0x30469e;};AGIVertices[_0xb164('0xf')]['gotoc']=function(_0x1b4185){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x1b4185[_0xb164('0x3c')]));return this[_0xb164('0xd')]['continueAt'](_0x1b4185[_0xb164('0x13d')],_0x1b4185[_0xb164('0x13e')],_0x1b4185[_0xb164('0x42')]);};AGIVertices[_0xb164('0xf')][_0xb164('0x13f')]=function(_0x499ca3){logger['info'](util['format'](_0xb164('0x140'),_0x499ca3['label']));if(!this[_0xb164('0x87')](_0x499ca3[_0xb164('0x141')])){return this['channel'][_0xb164('0x2e')](_0x499ca3,_0xb164('0x142'));}try{var _0x6144e8=eval(_0x499ca3[_0xb164('0x141')])?_0xb164('0x143'):_0xb164('0x144');this[_0xb164('0xd')][_0xb164('0xa9')](util['format'](_0xb164('0x145'),_0x499ca3[_0xb164('0x141')],_0x6144e8));return{'code':0xc8,'result':_0x6144e8};}catch(_0x4022fe){return{'code':0xc8,'result':_0xb164('0x144')};}};AGIVertices[_0xb164('0xf')][_0xb164('0x146')]=function(_0x1c10d9){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x147'),_0x1c10d9['label']));if(!this[_0xb164('0x87')](_0x1c10d9[_0xb164('0x148')])){return this[_0xb164('0xd')]['error'](_0x1c10d9,_0xb164('0x149'));}var _0x4fc102=this[_0xb164('0x25')]['sync'](this,_0x1c10d9[_0xb164('0x148')]);if(!_0x4fc102){return this['channel'][_0xb164('0x2e')](_0x1c10d9,'no\x20intervals\x20found');}for(var _0x27ade8=0x0;_0x27ade8<_0x4fc102[_0xb164('0x9a')];_0x27ade8+=0x1){var _0x391736=this['channel'][_0xb164('0x10')](util[_0xb164('0x2b')](_0xb164('0x14a'),_0x4fc102[_0x27ade8]));if(_0x391736[_0xb164('0xa2')]===-0x1){return _0x391736;}logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x14b'),_0x4fc102[_0x27ade8],_0x391736['extra']));if(_0x391736['extra']===_0xb164('0x143')){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x14b'),_0x4fc102[_0x27ade8],'true'));this[_0xb164('0xd')][_0xb164('0xa9')](util['format']('IFTIME\x20%s\x20%s',_0x4fc102[_0x27ade8],_0xb164('0x143')));return{'code':0xc8,'result':_0xb164('0x143')};}else{logger[_0xb164('0x30')](util[_0xb164('0x2b')]('IFTIME\x20%s\x20%s',_0x4fc102[_0x27ade8],_0xb164('0x144')));this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x14b'),_0x4fc102[_0x27ade8],_0xb164('0x144')));}}return{'code':0xc8,'result':_0xb164('0x144')};};AGIVertices[_0xb164('0xf')][_0xb164('0x14c')]=function(_0x1a6e1e){logger[_0xb164('0x30')](util['format'](_0xb164('0x14d'),_0x1a6e1e['label']));return this['channel'][_0xb164('0x14c')]();};AGIVertices[_0xb164('0xf')]['ispeechasr']=function(_0x2a0f76){logger['info'](util['format'](_0xb164('0x14e'),_0x2a0f76[_0xb164('0x3c')]));if(!this['isConfigured'](_0x2a0f76[_0xb164('0x83')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0xe6'));}var _0x1cabc8='wav';var _0x584989=util[_0xb164('0x2b')](_0xb164('0x130'),FILES_PATH,rs[_0xb164('0x11b')](0x4));var _0xaca5bc=util[_0xb164('0x2b')](_0xb164('0x9d'),_0x584989,_0x1cabc8);var _0x5db1d5=!![];if(_0x2a0f76['beep']===_0xb164('0x132')){_0x5db1d5=![];}var _0x485a72=this[_0xb164('0xd')]['recordFile'](_0x584989,_0x1cabc8,_0x2a0f76[_0xb164('0x134')],_0x2a0f76[_0xb164('0x6b')],undefined,_0x5db1d5);if(_0x485a72[_0xb164('0xa2')]!==-0x1){this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x14f'),_0xaca5bc));var _0x3d6830=this[_0xb164('0x85')]['sync'](this,_0x2a0f76,_0xaca5bc);if(_0x3d6830){for(var _0x6c36ae in _0x3d6830){if(_0x3d6830[_0xb164('0x95')](_0x6c36ae)){this[_0xb164('0xd')][_0xb164('0xda')](util[_0xb164('0x2b')](_0xb164('0x150'),_0x6c36ae[_0xb164('0x6e')]()),_0x3d6830[_0x6c36ae]);}}return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x151'),JSON[_0xb164('0x76')](_0x3d6830)));}}return _0x485a72;};AGIVertices[_0xb164('0xf')][_0xb164('0x152')]=function(_0x3f224b){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x153'),_0x3f224b[_0xb164('0x3c')]));if(!this['isConfigured'](_0x3f224b[_0xb164('0x83')])){return this[_0xb164('0xd')]['noop'](_0xb164('0xe6'));}if(!this[_0xb164('0x87')](_0x3f224b['text'])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0xaa'));}this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x154'),_0x3f224b[_0xb164('0x61')]));var _0x15c18b=this[_0xb164('0x82')][_0xb164('0xa6')](this,_0x3f224b);if(_0x15c18b){this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x14f'),_0x15c18b));var _0x568417=this['channel'][_0xb164('0x102')](_0x15c18b,_0x3f224b[_0xb164('0x134')]);try{fs[_0xb164('0x103')](_0x15c18b+'.wav');}catch(_0x52b2ee){logger[_0xb164('0x2e')](_0x52b2ee);}return _0x568417;}return this[_0xb164('0xd')][_0xb164('0x2e')](_0x3f224b,_0xb164('0x155'));};AGIVertices['prototype'][_0xb164('0x156')]=function(_0x4cd072){logger[_0xb164('0x30')](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x4cd072[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x4cd072[_0xb164('0x157')])){return this[_0xb164('0xd')]['error'](_0x4cd072,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0xb164('0x158'),this[_0xb164('0xd')]['callerid'],_0x4cd072[_0xb164('0x157')]));var _0x54c6cd=this[_0xb164('0x59')][_0xb164('0xa6')](this,_0x4cd072[_0xb164('0x157')]);if(_0x54c6cd){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb164('0xd')]['callerid'],_0x4cd072['findBy']));this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x159'),this[_0xb164('0xd')][_0xb164('0x3f')],_0x4cd072[_0xb164('0x157')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xb164('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xb164('0xd')][_0xb164('0x3f')],_0x4cd072[_0xb164('0x157')]));this['channel'][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x15a'),this[_0xb164('0xd')][_0xb164('0x3f')],_0x4cd072[_0xb164('0x157')]));return{'code':0xc8,'result':_0xb164('0x15b')};}};AGIVertices[_0xb164('0xf')][_0xb164('0x15c')]=function(_0x397045){logger['info'](util['format'](_0xb164('0x15d'),_0x397045[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x397045[_0xb164('0x157')])){return this['channel'][_0xb164('0x2e')](_0x397045,'no\x20find\x20by\x20configured');}logger[_0xb164('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xb164('0xd')]['callerid'],_0x397045[_0xb164('0x157')]));var _0xb50a62=this[_0xb164('0x15e')][_0xb164('0xa6')](this,_0x397045[_0xb164('0x157')]);if(_0xb50a62){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb164('0xd')]['callerid'],_0x397045[_0xb164('0x157')]));this['channel'][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x159'),this[_0xb164('0xd')][_0xb164('0x3f')],_0x397045[_0xb164('0x157')]));return{'code':0xc8,'result':_0xb164('0x15f')};}else{logger[_0xb164('0x30')](util['format'](_0xb164('0x15a'),this[_0xb164('0xd')][_0xb164('0x3f')],_0x397045[_0xb164('0x157')]));this[_0xb164('0xd')]['noop'](util[_0xb164('0x2b')](_0xb164('0x15a'),this[_0xb164('0xd')]['callerid'],_0x397045[_0xb164('0x157')]));return{'code':0xc8,'result':_0xb164('0x15b')};}};AGIVertices[_0xb164('0xf')]['math']=function(_0x533636){logger[_0xb164('0x30')](util['format'](_0xb164('0x160'),_0x533636[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x533636[_0xb164('0x161')])){return this[_0xb164('0xd')]['error'](_0x533636,'no\x20operation\x20configured');}this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')]('math\x20%s',_0x533636['operation']));var _0x2743f3=eval(_0x533636[_0xb164('0x161')]);if(!this[_0xb164('0x87')](_0x533636[_0xb164('0xd5')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0xd6'));}var _0x4f029e=this[_0xb164('0x10')][_0xb164('0xa6')](this,_0x533636[_0xb164('0xd5')]);if(!_0x4f029e){return this['channel'][_0xb164('0x2e')](_0x533636,_0xb164('0x119'));}if(_[_0xb164('0x99')](_0x2743f3)){var _0x369857=this;_0x2743f3[_0xb164('0xd7')](function(_0x23d0b2,_0x9146d){_0x369857[_0xb164('0xd')][_0xb164('0xda')](util[_0xb164('0x2b')](_0xb164('0x162'),_0x4f029e,_0x9146d),_0x23d0b2);});return this['channel'][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x163'),_0x4f029e));}else{return this[_0xb164('0xd')]['setVariable'](_0x4f029e,_0x2743f3);}};AGIVertices[_0xb164('0xf')][_0xb164('0xb')]=function(_0x5c5f33){logger['info'](util[_0xb164('0x2b')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x5c5f33['label']));if(_0x5c5f33[_0xb164('0x112')]===0x0){return this[_0xb164('0xa5')](_0x5c5f33);}_0x5c5f33[_0xb164('0x112')]-=0x1;if(!this[_0xb164('0x87')](_0x5c5f33[_0xb164('0x113')])){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x5c5f33,_0xb164('0x164'));}var _0x455579=this[_0xb164('0x165')][_0xb164('0xa6')](this,_0x5c5f33[_0xb164('0x113')]);if(!_0x455579){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x5c5f33,'no\x20file\x20audio\x20found');}var _0x482071=this['channel'][_0xb164('0x115')](_0x455579,_0x5c5f33['response'],_0x5c5f33[_0xb164('0x166')]);var _0x280cad=_0x482071[_0xb164('0xa2')];if(_0x482071[_0xb164('0xa2')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x5c5f33,'-1');return _0x482071;}else if(_0x482071['extra']===_0xb164('0x6b')){_0x482071[_0xb164('0xa2')]=_0x482071['result']['length']>0x0?_0x482071[_0xb164('0xa2')]:'t';}else if(_[_0xb164('0x48')](_0x482071[_0xb164('0xa2')])){_0x482071['result']='#';_0x280cad='#';}if(!this[_0xb164('0x87')](_0x5c5f33[_0xb164('0xd5')])){this[_0xb164('0xd')]['noop'](_0xb164('0xd6'));}else{var _0x272104=this[_0xb164('0x10')][_0xb164('0xa6')](this,_0x5c5f33[_0xb164('0xd5')]);if(!_0x272104){return this[_0xb164('0xd')]['error'](_0x5c5f33,_0xb164('0x119'));}this['channel'][_0xb164('0xda')](_0x272104,_0x280cad);}this[_0xb164('0x3a')][_0xb164('0xa6')](this,_0x5c5f33,_0x280cad);return _0x482071;};AGIVertices[_0xb164('0xf')][_0xb164('0xa9')]=function(_0xa265bd){logger['info'](util[_0xb164('0x2b')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0xa265bd[_0xb164('0x3c')]));return this[_0xb164('0xd')][_0xb164('0xa9')](_0xa265bd[_0xb164('0x167')]||_0xa265bd[_0xb164('0x3c')]);};AGIVertices[_0xb164('0xf')]['pause']=function(_0x3591a8){logger['info'](util[_0xb164('0x2b')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x3591a8[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x3591a8[_0xb164('0x157')])){return this[_0xb164('0xd')]['error'](_0x3591a8,_0xb164('0x168'));}logger[_0xb164('0x30')](util['format'](_0xb164('0x158'),this['channel'][_0xb164('0x3f')],_0x3591a8[_0xb164('0x157')]));var _0x35b004=this[_0xb164('0x54')][_0xb164('0xa6')](this,_0x3591a8[_0xb164('0x169')]);var _0x18d7a7=this['agentPause'][_0xb164('0xa6')](this,_0x3591a8[_0xb164('0x157')],_0x35b004);if(_0x18d7a7){logger['info'](util[_0xb164('0x2b')](_0xb164('0x159'),this[_0xb164('0xd')][_0xb164('0x3f')],_0x3591a8[_0xb164('0x157')]));this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x159'),this[_0xb164('0xd')][_0xb164('0x3f')],_0x3591a8[_0xb164('0x157')]));return{'code':0xc8,'result':_0xb164('0x15f')};}else{logger['info'](util[_0xb164('0x2b')](_0xb164('0x15a'),this[_0xb164('0xd')][_0xb164('0x3f')],_0x3591a8['findBy']));this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb164('0xd')][_0xb164('0x3f')],_0x3591a8[_0xb164('0x157')]));return{'code':0xc8,'result':_0xb164('0x15b')};}};AGIVertices[_0xb164('0xf')]['playback']=function(_0x30aa8e){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x16a'),_0x30aa8e['label']));if(!this[_0xb164('0x87')](_0x30aa8e[_0xb164('0x113')])){return this['channel']['error'](_0x30aa8e,_0xb164('0x164'));}var _0x23bfba=this[_0xb164('0x165')][_0xb164('0xa6')](this,_0x30aa8e[_0xb164('0x113')]);if(!_0x23bfba){return this[_0xb164('0xd')]['error'](_0x30aa8e,_0xb164('0x114'));}var _0x470b1d=this['channel'][_0xb164('0x5d')]('PLAYBACK',[_0x23bfba,_0x30aa8e['opts']]);if(_0x470b1d[_0xb164('0xa2')]===-0x1){return _0x470b1d;}return this[_0xb164('0xd')]['noop'](util[_0xb164('0x2b')](_0xb164('0xbf'),_0xb164('0x16b'),_0x23bfba));};AGIVertices[_0xb164('0xf')][_0xb164('0x16c')]=function(_0x241689){logger[_0xb164('0x30')](util['format'](_0xb164('0x16d'),_0x241689[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x241689[_0xb164('0x16e')])){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x241689,_0xb164('0x16f'));}var _0x1e14e0='';var _0x38bba2=parseInt(_0x241689[_0xb164('0x16e')],0xa);if(isNaN(_0x38bba2)){_0x1e14e0=_0x241689[_0xb164('0x16e')];}else{_0x1e14e0=this[_0xb164('0x14')][_0xb164('0xa6')](this,_0x241689[_0xb164('0x16e')]);if(!_0x1e14e0){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x241689,_0xb164('0x170'));}}var _0x59b8ee='';if(this[_0xb164('0x87')](_0x241689[_0xb164('0x113')])){var _0x174893=this[_0xb164('0x165')][_0xb164('0xa6')](this,_0x241689['file_id']);if(_0x174893){_0x59b8ee=_0x174893;}}this['createSquareDetailsReport'][_0xb164('0xa6')](this,_0x241689,_0x1e14e0);if(_0x241689['opts']['indexOf']('x')<0x0){_0x241689['opts']+='x';}if(_0x241689[_0xb164('0x10e')]['indexOf']('X')<0x0){_0x241689[_0xb164('0x10e')]+='X';}this[_0xb164('0xd')][_0xb164('0xda')](_0xb164('0x171'),_0x1e14e0?_0x1e14e0[_0xb164('0x172')]():'');var _0xcb8075=this[_0xb164('0xd')][_0xb164('0x5d')](_0xb164('0x173'),[_0x1e14e0,_0x241689[_0xb164('0x10e')],_0x241689['url'],_0x59b8ee,_0x241689['timeout'],_0x241689[_0xb164('0x8')],_0x241689[_0xb164('0x174')],_0x241689[_0xb164('0x175')],'',_0x241689[_0xb164('0x176')]]);if(_0xcb8075[_0xb164('0xa2')]===-0x1){return _0xcb8075;}return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')]('Executed\x20command\x20%s\x20%s',_0xb164('0x173'),_0x1e14e0));};AGIVertices[_0xb164('0xf')][_0xb164('0x177')]=function(_0x5b7fc3){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x178'),_0x5b7fc3[_0xb164('0x3c')]));var _0x1f7a26=_0x5b7fc3['recordingFormat']||_0xb164('0x13b');var _0x53c573=util[_0xb164('0x2b')](_0xb164('0x179'),this[_0xb164('0xd')][_0xb164('0x3b')],rs[_0xb164('0x11b')](0x5));var _0x568414=util['format'](_0xb164('0x17a'),FILES_PATH,_0x53c573,_0x1f7a26);var _0x10960b=util[_0xb164('0x2b')](_0xb164('0x130'),FILES_PATH,_0x53c573);this['createSquareRecording'][_0xb164('0xa6')](this,_0x5b7fc3,_0x53c573,_0x568414);this[_0xb164('0xd')][_0xb164('0xda')](_0xb164('0x17b'),_0x53c573);logger[_0xb164('0x30')](_0xb164('0x17c'),_0x10960b,_0x1f7a26,_0x5b7fc3['escape_digits'],_0x5b7fc3['timeout']);return this[_0xb164('0xd')][_0xb164('0x133')](_0x10960b,_0x1f7a26,_0x5b7fc3[_0xb164('0x17d')],_0x5b7fc3[_0xb164('0x6b')],undefined,!![]);};AGIVertices['prototype'][_0xb164('0x17e')]=function(_0x4cef9e){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x17f'),_0x4cef9e['label']));if(!this[_0xb164('0x87')](_0x4cef9e[_0xb164('0x68')])){return this[_0xb164('0xd')][_0xb164('0xa9')]('no\x20url\x20configured');}var _0x611fd9=this[_0xb164('0x67')][_0xb164('0xa6')](this,_0x4cef9e);logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x180'),util[_0xb164('0x181')](_0x611fd9,{'showHidden':![],'depth':null})));if(!this[_0xb164('0x87')](_0x4cef9e[_0xb164('0xd5')])){return this[_0xb164('0xd')]['noop'](_0xb164('0x182'));}var _0x2d5fbd=this['getVariable'][_0xb164('0xa6')](this,_0x4cef9e[_0xb164('0xd5')]);if(!_0x2d5fbd){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x4cef9e,_0xb164('0x119'));}this[_0xb164('0xd')][_0xb164('0xda')](util['format'](_0xb164('0x183'),_0x2d5fbd),_0x611fd9[_0xb164('0x78')]?_0x611fd9['statusCode']:_0xb164('0x184'));this[_0xb164('0xd')]['setVariable'](util[_0xb164('0x2b')]('%s_STATUS_MESSAGE',_0x2d5fbd),_0x611fd9[_0xb164('0x185')]?_0x611fd9[_0xb164('0x185')]:'OK');if(_0x611fd9[_0xb164('0x6f')]){try{this['saveRestApiResult'](_0x611fd9['body'],_0x2d5fbd);}catch(_0x2a5599){logger['error'](util[_0xb164('0x2b')](_0xb164('0x186'),_0x2d5fbd));}}return this['channel'][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xdc'),_0x2d5fbd));};AGIVertices['prototype'][_0xb164('0x187')]=function(_0x55c528){logger['info'](util[_0xb164('0x2b')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x55c528[_0xb164('0x3c')]));return this['channel'][_0xb164('0x188')](_0x55c528[_0xb164('0x189')][_0xb164('0xd2')](/\s+/g,''),_0x55c528[_0xb164('0x17d')]);};AGIVertices[_0xb164('0xf')][_0xb164('0x18a')]=function(_0x4323df){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x18b'),_0x4323df['label']));return this[_0xb164('0xd')]['sayNumber'](_0x4323df[_0xb164('0x6a')]['replace'](/\s+/g,''),_0x4323df[_0xb164('0x17d')]);};AGIVertices[_0xb164('0xf')][_0xb164('0x18c')]=function(_0x23548a){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x23548a[_0xb164('0x3c')]));return this[_0xb164('0xd')][_0xb164('0x18d')](_0x23548a[_0xb164('0x61')],_0x23548a['escape_digits']);};AGIVertices['prototype']['sendMail']=function(_0x468723){logger[_0xb164('0x30')](util['format'](_0xb164('0x18e'),_0x468723[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x468723[_0xb164('0x18f')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0x190'));}var _0x40eca7=this['getMailAccount']['sync'](this,_0x468723[_0xb164('0x18f')]);if(!_0x40eca7||!_0x40eca7[_0xb164('0x191')]){return this[_0xb164('0xd')]['error'](_0x468723,_0xb164('0x192'));}var _0x442e65={'from':util['format']('\x22%s\x22\x20<%s>',_0x40eca7['name'],_0x40eca7[_0xb164('0x193')]||_0x40eca7['Smtp']['user']),'to':_0x468723['to']||'','cc':_0x468723['cc']||'','bcc':_0x468723[_0xb164('0x194')]||'','subject':_0x468723['subject'],'html':_0x468723[_0xb164('0x61')],'text':_0x468723['text']};var _0xbe386f={'tls':{'rejectUnauthorized':![]}};if(_0x40eca7[_0xb164('0x191')][_0xb164('0x195')]){_0xbe386f[_0xb164('0x195')]=_0x40eca7[_0xb164('0x191')]['service'];}else{_0xbe386f[_0xb164('0x196')]=_0x40eca7['Smtp'][_0xb164('0x196')];_0xbe386f[_0xb164('0x197')]=_0x40eca7[_0xb164('0x191')][_0xb164('0x197')];_0xbe386f['secure']=_0x40eca7[_0xb164('0x191')][_0xb164('0x198')];}if(_0x40eca7[_0xb164('0x191')][_0xb164('0x199')]){_0xbe386f[_0xb164('0x19a')]={'user':_0x40eca7['Smtp'][_0xb164('0x19b')],'pass':_0x40eca7[_0xb164('0x191')][_0xb164('0x19c')]};}if(this['isConfigured'](_0x468723[_0xb164('0x19d')])){}logger[_0xb164('0xde')](_0xb164('0x19e'),JSON['stringify'](_0x442e65));this[_0xb164('0x3a')][_0xb164('0xa6')](this,_0x468723,_0x468723[_0xb164('0x18f')]);this['channel'][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x19f'),_0x40eca7[_0xb164('0x12')]));this[_0xb164('0x23')][_0xb164('0xa6')](this,_0xbe386f,_0x442e65);return this[_0xb164('0xd')][_0xb164('0xa9')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xb164('0xf')]['sendFax']=function(_0x5c1cd2){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x1a0'),_0x5c1cd2[_0xb164('0x3c')]));return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0x1a1'));};AGIVertices[_0xb164('0xf')][_0xb164('0x1a2')]=function(_0x24d9ff){logger['info'](util['format'](_0xb164('0x1a3'),_0x24d9ff[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x24d9ff[_0xb164('0x1a4')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0x1a5'));}var _0x535139=this['getSmsAccount'][_0xb164('0xa6')](this,_0x24d9ff[_0xb164('0x1a4')]);if(!_0x535139){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x24d9ff,_0xb164('0x1a6'));}var _0x45d816={'body':_0x24d9ff[_0xb164('0x1a7')],'phone':_0x24d9ff['to']||'','SmsAccountId':_0x535139['id']};logger[_0xb164('0xde')](_0xb164('0x1a8'),JSON[_0xb164('0x76')](_0x45d816));this['createSquareDetailsReport'][_0xb164('0xa6')](this,_0x24d9ff,_0x24d9ff[_0xb164('0x1a4')]);this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x1a9'),_0x535139[_0xb164('0x12')]));this[_0xb164('0x39')][_0xb164('0xa6')](this,_0x45d816);return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0x1aa'));};AGIVertices[_0xb164('0xf')][_0xb164('0x1ab')]=function(_0x57300b){logger['info'](util[_0xb164('0x2b')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x57300b['label']));if(!this[_0xb164('0x87')](_0x57300b[_0xb164('0xd5')])){return this['channel'][_0xb164('0x2e')](_0x57300b,'no\x20variable\x20selected');}var _0x497af9=this[_0xb164('0x10')][_0xb164('0xa6')](this,_0x57300b[_0xb164('0xd5')]);if(!_0x497af9){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x57300b,_0xb164('0x119'));}return this[_0xb164('0xd')][_0xb164('0xda')](_0x497af9,_0x57300b[_0xb164('0x1ac')]);};AGIVertices['prototype'][_0xb164('0x1ad')]=function(_0x8f2a1d){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x1ae'),_0x8f2a1d[_0xb164('0x3c')]));this[_0xb164('0xd')]['noop']('START\x20CALLY\x20SQUARE');if(_0x8f2a1d[_0xb164('0xb8')]===_0xb164('0x1af')){this['channel'][_0xb164('0xa9')]('Answer');return this[_0xb164('0xd')]['answer']();}return this[_0xb164('0xd')]['noop']('Skipped\x20Answer');};AGIVertices['prototype'][_0xb164('0x1b0')]=function(_0x2b682f){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x1b1'),_0x2b682f[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x2b682f[_0xb164('0x1b2')])){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x2b682f,_0xb164('0x1b3'));}var _0x3e496f=this['getSquareProject'][_0xb164('0xa6')](this,_0x2b682f[_0xb164('0x1b2')]);if(!this[_0xb164('0x87')](_0x3e496f)){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x2b682f,util[_0xb164('0x2b')](_0xb164('0x1b4'),_0x2b682f[_0xb164('0x1b2')]));}if(_0x3e496f===this[_0xb164('0xd')]['arg_1']){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x2b682f,_0xb164('0x1b5'));}this[_0xb164('0x3a')][_0xb164('0xa6')](this,_0x2b682f,_0x3e496f);var _0x50e5f6=this[_0xb164('0xd')][_0xb164('0x5d')](_0xb164('0x1b6'),util[_0xb164('0x2b')](_0xb164('0x1b7'),config['agi'][_0xb164('0x196')]||_0xb164('0x1b8'),_0x3e496f,this['channel'][_0xb164('0x3e')]));if(_0x50e5f6[_0xb164('0xa2')]===-0x1){return _0x50e5f6;}return this[_0xb164('0xd')][_0xb164('0xa9')](util['format'](_0xb164('0xbf'),'AGI',_0x3e496f));};AGIVertices[_0xb164('0xf')]['system']=function(_0x1d22ec){logger['info'](util[_0xb164('0x2b')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1d22ec[_0xb164('0x3c')]));var _0x404154=this['shellCommand']['sync'](this,_0x1d22ec[_0xb164('0x1b9')]);this[_0xb164('0x3a')][_0xb164('0xa6')](this,_0x1d22ec,_0x1d22ec[_0xb164('0x1b9')]);if(this[_0xb164('0x87')](_0x1d22ec[_0xb164('0xd5')])){var _0x4126fc=this['getVariable'][_0xb164('0xa6')](this,_0x1d22ec[_0xb164('0xd5')]);if(_0x4126fc){this[_0xb164('0xd')][_0xb164('0xda')](_0x4126fc,_0x404154);return this['channel'][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x1ba'),_0x1d22ec['command'],_0x4126fc));}}return this[_0xb164('0xd')]['noop'](util[_0xb164('0x2b')](_0xb164('0x1bb'),_0x1d22ec['command']));};AGIVertices['prototype'][_0xb164('0x1bc')]=function(_0x4aea78){logger[_0xb164('0x30')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x4aea78['label']));_0x4aea78['text']=_0x4aea78['text'][_0xb164('0xd2')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4aea78[_0xb164('0x1bd')])){return this['channel'][_0xb164('0xa9')](_0xb164('0x1be'));}if(!this[_0xb164('0x87')](_0x4aea78[_0xb164('0x61')])){return this[_0xb164('0xd')][_0xb164('0xa9')]('no\x20text\x20configured');}this['channel']['noop'](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x4aea78[_0xb164('0x61')]));var _0x158b1d=this[_0xb164('0x5f')][_0xb164('0xa6')](this,_0x4aea78);if(_0x158b1d){this['channel'][_0xb164('0xa9')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x158b1d));var _0x475ba9=this['channel'][_0xb164('0x102')](_0x158b1d);try{fs[_0xb164('0x103')](_0x158b1d+_0xb164('0x104'));}catch(_0x398c9d){logger['error'](_0x398c9d);}return _0x475ba9;}return this[_0xb164('0xd')][_0xb164('0x2e')](_0x4aea78,_0xb164('0x1bf'));};AGIVertices[_0xb164('0xf')]['tts']=function(_0x4570c6){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x1c0'),_0x4570c6[_0xb164('0x3c')]));_0x4570c6[_0xb164('0x61')]=_0x4570c6[_0xb164('0x61')][_0xb164('0xd2')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xb164('0x87')](_0x4570c6[_0xb164('0x61')])){return this[_0xb164('0xd')][_0xb164('0xa9')](_0xb164('0xaa'));}this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')]('Trying\x20Google\x20TTS\x20%s',_0x4570c6[_0xb164('0x61')]));var _0xb1bd4d=this[_0xb164('0x66')]['sync'](this,_0x4570c6);if(_0xb1bd4d){this[_0xb164('0xd')][_0xb164('0xa9')](util['format'](_0xb164('0x1c1'),_0xb1bd4d));var _0x1d994f=this[_0xb164('0xd')]['streamFile'](_0xb1bd4d);try{fs['unlink'](_0xb1bd4d+_0xb164('0x104'));}catch(_0x291165){logger[_0xb164('0x2e')](_0x291165);}return _0x1d994f;}return this[_0xb164('0xd')][_0xb164('0x2e')](_0x4570c6,_0xb164('0x1c2'));};AGIVertices[_0xb164('0xf')]['unpause']=function(_0x1fb3b1){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x1c3'),_0x1fb3b1[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0x1fb3b1['findBy'])){return this[_0xb164('0xd')][_0xb164('0x2e')](_0x1fb3b1,_0xb164('0x168'));}logger[_0xb164('0x30')](util['format'](_0xb164('0x158'),this['channel'][_0xb164('0x3f')],_0x1fb3b1['findBy']));var _0x378a51=this[_0xb164('0x58')][_0xb164('0xa6')](this,_0x1fb3b1[_0xb164('0x157')]);if(_0x378a51){logger[_0xb164('0x30')](util[_0xb164('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xb164('0xd')][_0xb164('0x3f')],_0x1fb3b1[_0xb164('0x157')]));this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x159'),this['channel'][_0xb164('0x3f')],_0x1fb3b1[_0xb164('0x157')]));return{'code':0xc8,'result':_0xb164('0x15f')};}else{logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x15a'),this[_0xb164('0xd')][_0xb164('0x3f')],_0x1fb3b1[_0xb164('0x157')]));this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0x15a'),this[_0xb164('0xd')]['callerid'],_0x1fb3b1[_0xb164('0x157')]));return{'code':0xc8,'result':_0xb164('0x15b')};}};AGIVertices[_0xb164('0xf')][_0xb164('0x1c4')]=function(_0x1d8c44){logger[_0xb164('0x30')](util[_0xb164('0x2b')](_0xb164('0x1c5'),_0x1d8c44[_0xb164('0x3c')]));var _0x365702=this[_0xb164('0xd')][_0xb164('0x5d')](_0xb164('0x1c6'),[_0x1d8c44[_0xb164('0x1c7')],_0x1d8c44[_0xb164('0x7a')]]);if(_0x365702[_0xb164('0xa2')]===-0x1){return _0x365702;}return this[_0xb164('0xd')][_0xb164('0xa9')](util[_0xb164('0x2b')](_0xb164('0xbf'),'VOICEMAIL',_0x1d8c44[_0xb164('0x1c7')]));};AGIVertices['prototype'][_0xb164('0x1c8')]=function(_0xec0357){logger['info'](util[_0xb164('0x2b')](_0xb164('0x1c9'),_0xec0357[_0xb164('0x3c')]));if(!this[_0xb164('0x87')](_0xec0357['variable_id'])){return this[_0xb164('0xd')][_0xb164('0x2e')](_0xec0357,_0xb164('0x1ca'));}var _0x512f89=this['getVariable'][_0xb164('0xa6')](this,_0xec0357[_0xb164('0xd5')]);if(!_0x512f89){return this[_0xb164('0xd')][_0xb164('0x2e')](_0xec0357,_0xb164('0x119'));}var _0x607418=this['channel'][_0xb164('0x10')](_0x512f89);return{'code':0xc8,'result':_0x607418[_0xb164('0xa4')]?_0x607418[_0xb164('0xa4')]:'-'};};String[_0xb164('0xf')][_0xb164('0xa0')]=function(_0x14033c,_0x3f7943){return this[_0xb164('0x9f')](_0x14033c)[_0xb164('0x1cb')](_0x3f7943);};module[_0xb164('0x1cc')]=AGIVertices;
\ No newline at end of file
+var _0xcbff=['isNil','callback_','random','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','en-US','ssmlGender','audioEncoding','MP3','googleTTS','text','google_tts_language','restAPI','timeout','number','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','getVariable','extra','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','minutes','createCmContact','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','password','no\x20password\x20configured','SESTEK_NDA_%s','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','%s/recordings/%s','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','recordFile','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','wav','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','PLAYBACK','queue','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','statusMessage','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','escape_digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','secure','authentication','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','streamFile','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','name','catch','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','isEmpty'];(function(_0xfdd445,_0x247a83){var _0x50d5df=function(_0x43ca05){while(--_0x43ca05){_0xfdd445['push'](_0xfdd445['shift']());}};_0x50d5df(++_0x247a83);}(_0xcbff,0x188));var _0xfcbf=function(_0x532745,_0x1a16d6){_0x532745=_0x532745-0x0;var _0x37a301=_0xcbff[_0x532745];return _0x37a301;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xfcbf('0x0'));var _=require('lodash');var sh=require(_0xfcbf('0x1'));var odbc=require(_0xfcbf('0x2'))();var rs=require(_0xfcbf('0x3'));var moment=require(_0xfcbf('0x4'));var Mustache=require('mustache');var rp=require(_0xfcbf('0x5'));var logger=require(_0xfcbf('0x6'))(_0xfcbf('0x7'));var config=require('../../config/environment');var scripts=require(_0xfcbf('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xfcbf('0x9'),_0xfcbf('0xa')];var verticesWithRetry=[_0xfcbf('0xb'),_0xfcbf('0xc'),_0xfcbf('0xd')];var AGIVertices=function(_0x3ce490,_0x5eb01c,_0x11244e){this[_0xfcbf('0xe')]=_0x3ce490;this[_0xfcbf('0xf')]=_0x5eb01c;this[_0xfcbf('0x10')]=_0x11244e;};AGIVertices[_0xfcbf('0x11')]['getVariable']=function(_0x41b5e2,_0x5430bd){this[_0xfcbf('0xf')][_0xfcbf('0x12')](_0x41b5e2)['then'](function(_0x4f47c8){_0x5430bd(null,_0x4f47c8?_0x4f47c8[_0xfcbf('0x13')]:![]);})[_0xfcbf('0x14')](function(_0x47fba0){_0x5430bd(_0x47fba0);});};AGIVertices[_0xfcbf('0x11')]['getVoiceQueue']=function(_0xfe5f0f,_0x3efeec){this[_0xfcbf('0xf')][_0xfcbf('0x15')](_0xfe5f0f)[_0xfcbf('0x16')](function(_0x49a718){_0x3efeec(null,_0x49a718?_0x49a718['name']:![]);})[_0xfcbf('0x14')](function(_0x571b55){_0x3efeec(_0x571b55);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x17')]=function(_0x5d7c37,_0x50bbc9){this[_0xfcbf('0xf')][_0xfcbf('0x18')](_0x5d7c37)[_0xfcbf('0x16')](function(_0x2f352c){_0x50bbc9(null,_0x2f352c?_0x2f352c[_0xfcbf('0x13')]:![]);})[_0xfcbf('0x14')](function(_0x81799f){_0x50bbc9(_0x81799f);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x19')]=function(_0x2ac456,_0x427a60){this[_0xfcbf('0xf')][_0xfcbf('0x1a')](_0x2ac456)[_0xfcbf('0x16')](function(_0x4070e9){_0x427a60(null,_0x4070e9?_0x4070e9[_0xfcbf('0x1b')]:![]);})[_0xfcbf('0x14')](function(_0x48eeb4){_0x427a60(_0x48eeb4);});};AGIVertices['prototype'][_0xfcbf('0x1c')]=function(_0x21d34e,_0x3b3408){this[_0xfcbf('0xf')][_0xfcbf('0x1d')](_0x21d34e)[_0xfcbf('0x16')](function(_0x4d8ca6){_0x3b3408(null,_0x4d8ca6?_0x4d8ca6[_0xfcbf('0x13')]:![]);})[_0xfcbf('0x14')](function(_0x2628d2){_0x3b3408(_0x2628d2);});};AGIVertices[_0xfcbf('0x11')]['getTrunk']=function(_0x3864ac,_0x4e43b1){this['rpc'][_0xfcbf('0x1e')](_0x3864ac)[_0xfcbf('0x16')](function(_0x2dd114){_0x4e43b1(null,_0x2dd114?_0x2dd114[_0xfcbf('0x13')]:![]);})[_0xfcbf('0x14')](function(_0x5c6aa3){_0x4e43b1(_0x5c6aa3);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x1f')]=function(_0x76f94d,_0x21d754){var _0x510147=this;this[_0xfcbf('0xf')]['getSoundById'](_0x76f94d)[_0xfcbf('0x16')](function(_0x5a0c65){_0x21d754(null,_0x5a0c65?_0x510147[_0xfcbf('0x20')](_0x5a0c65[_0xfcbf('0x21')]):![]);})[_0xfcbf('0x14')](function(_0x4d1247){_0x21d754(_0x4d1247);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x22')]=function(_0x19773a,_0x4f72c4){this[_0xfcbf('0xf')][_0xfcbf('0x23')](_0x19773a)[_0xfcbf('0x16')](function(_0x13df30){_0x4f72c4(null,_0x13df30?_0x13df30:![]);})['catch'](function(_0x3a9468){_0x4f72c4(_0x3a9468);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x24')]=function(_0x148b55,_0x318e92,_0x1a2002){this[_0xfcbf('0x10')][_0xfcbf('0x24')](_0x148b55,_0x318e92)[_0xfcbf('0x16')](function(){_0x1a2002(null);})['catch'](function(_0x4e6db5){_0x1a2002(_0x4e6db5);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x25')]=function(_0x3fa51c,_0x324a98){this[_0xfcbf('0xf')][_0xfcbf('0x26')](_0x3fa51c)[_0xfcbf('0x16')](function(_0x134e88){if(_0x134e88){if(_0x134e88[_0xfcbf('0x27')]){_0x324a98(null,[_0x134e88['interval']]);}else{_0x324a98(null,_[_0xfcbf('0x28')](_0x134e88[_0xfcbf('0x29')],_0xfcbf('0x2a')));}}else{_0x324a98(null,![]);}})[_0xfcbf('0x14')](function(_0x36a378){_0x324a98(_0x36a378);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x20')]=function(_0x371256){return util[_0xfcbf('0x2b')]('%s/sounds/converted/%s',FILES_PATH,_0x371256);};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x2c')]=function(_0x3e7c13,_0x483e3b,_0xadbdf){odbc[_0xfcbf('0x2d')](_0x3e7c13,function(_0x2087bf){if(_0x2087bf){logger[_0xfcbf('0x2e')](_0xfcbf('0x2f'),_0x2087bf);_0xadbdf(_0x2087bf);}else{logger[_0xfcbf('0x30')](_0xfcbf('0x31'));odbc['query'](_0x483e3b,function(_0x3c6bf2,_0x51ab0c){if(_0x3c6bf2){logger['info'](_0xfcbf('0x32'),_0x483e3b);_0xadbdf(_0x3c6bf2);}else{logger[_0xfcbf('0x30')](_0xfcbf('0x33'),_0x483e3b);odbc['close'](function(_0x1b59cc){if(_0x1b59cc){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1b59cc);}_0xadbdf(null,_0x51ab0c);});}});}});};AGIVertices['prototype'][_0xfcbf('0x34')]=function(_0x35893b,_0x245187){this[_0xfcbf('0xf')][_0xfcbf('0x35')](_0x35893b)[_0xfcbf('0x16')](function(_0x203a70){_0x245187(null,_0x203a70?_0x203a70:![]);})['catch'](function(_0x4de3f8){_0x245187(_0x4de3f8);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x36')]=function(_0x10352d,_0x154593){this[_0xfcbf('0xf')][_0xfcbf('0x36')](_0x10352d)[_0xfcbf('0x16')](function(_0x36b5fd){_0x154593(null,_0x36b5fd);})['catch'](function(_0x1947f){_0x154593(_0x1947f);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x37')]=function(_0xcfb7e3,_0x5b8935,_0x52aee2){this[_0xfcbf('0xf')]['createSquareDetailsReport']({'uniqueid':this[_0xfcbf('0xe')][_0xfcbf('0x38')],'node':_0xcfb7e3[_0xfcbf('0x39')],'application':_0xcfb7e3[_0xfcbf('0x3a')],'data':_0x5b8935||null,'project_name':this[_0xfcbf('0xe')][_0xfcbf('0x3b')],'callerid':this[_0xfcbf('0xe')][_0xfcbf('0x3c')]})[_0xfcbf('0x16')](function(_0x2500d3){if(_0x52aee2){_0x52aee2(null,_0x2500d3);}})['catch'](function(_0x3ee33e){if(_0x52aee2){_0x52aee2(_0x3ee33e);}});};AGIVertices['prototype'][_0xfcbf('0x3d')]=function(_0x4c0cc1,_0x5c29b9,_0x4f8f78,_0x146630){this[_0xfcbf('0xf')][_0xfcbf('0x3d')]({'uniqueid':this[_0xfcbf('0xe')]['uniqueid'],'callerid':this[_0xfcbf('0xe')][_0xfcbf('0x3c')],'calleridname':this[_0xfcbf('0xe')][_0xfcbf('0x3e')],'context':this[_0xfcbf('0xe')]['context'],'extension':this[_0xfcbf('0xe')][_0xfcbf('0x3f')],'priority':this[_0xfcbf('0xe')][_0xfcbf('0x40')],'accountcode':this[_0xfcbf('0xe')][_0xfcbf('0x41')],'dnid':this[_0xfcbf('0xe')][_0xfcbf('0x42')],'projectName':this['channel'][_0xfcbf('0x3b')],'saveName':_0x5c29b9,'filename':_0x4c0cc1[_0xfcbf('0x43')]||_0x5c29b9,'savePath':_0x4f8f78})[_0xfcbf('0x16')](function(_0x142136){_0x146630(null,_0x142136);})['catch'](function(_0x51eee8){_0x146630(_0x51eee8);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x44')]=function(_0x11b337,_0x31c88d,_0x2ae050,_0x14c6fa,_0x347964){this[_0xfcbf('0xf')]['createSquareMessage']({'uniqueid':this[_0xfcbf('0xe')][_0xfcbf('0x38')],'body':_0x11b337,'direction':_0x31c88d,'providerName':_0x2ae050,'providerResponse':_0x14c6fa})[_0xfcbf('0x16')](function(_0x554757){if(_0x347964){_0x347964(null,_0x554757);}})[_0xfcbf('0x14')](function(_0x1f5bc1){if(_0x347964){_0x347964(_0x1f5bc1);}});};AGIVertices[_0xfcbf('0x11')]['createCmContact']=function(_0x1a629c,_0x5221dd){this[_0xfcbf('0xf')]['createCmContact']({'firstName':_[_0xfcbf('0x45')](_0x1a629c[_0xfcbf('0x13')])||_[_0xfcbf('0x46')](_0x1a629c[_0xfcbf('0x13')])?_0xfcbf('0x47')+Math[_0xfcbf('0x48')]():_0x1a629c['name'],'lastName':_[_0xfcbf('0x45')](_0x1a629c[_0xfcbf('0x49')])||_[_0xfcbf('0x46')](_0x1a629c[_0xfcbf('0x49')])?null:_0x1a629c[_0xfcbf('0x49')],'phone':_0x1a629c['phone'],'ListId':_0x1a629c[_0xfcbf('0x4a')],'scheduledat':_0x1a629c[_0xfcbf('0x4b')],'callbackUniqueid':this['channel'][_0xfcbf('0x38')],'tags':_0xfcbf('0x4c'),'description':_0xfcbf('0x4d')+_0x1a629c[_0xfcbf('0x4b')][_0xfcbf('0x4e')](),'priority':_0x1a629c[_0xfcbf('0x4f')]})[_0xfcbf('0x16')](function(_0x55d331){_0x5221dd(null,_0x55d331);})['catch'](function(_0x4517d3){_0x5221dd(_0x4517d3);});};AGIVertices['prototype'][_0xfcbf('0x50')]=function(_0x14bc75,_0x2e8266){this['rpc'][_0xfcbf('0x51')](_0x14bc75)[_0xfcbf('0x16')](function(_0x12ecd3){_0x2e8266(null,_0x12ecd3?_0x12ecd3[_0xfcbf('0x13')]:![]);})[_0xfcbf('0x14')](function(_0x54f2f8){_0x2e8266(_0x54f2f8);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x52')]=function(_0x1dc972,_0x295cb5,_0x362e0f){var _0x232099={'role':_0xfcbf('0x53')};_0x232099[_0x1dc972]=this[_0xfcbf('0xe')][_0xfcbf('0x3c')];this['rpc'][_0xfcbf('0x52')](_0x232099,_0x295cb5,this['channel'][_0xfcbf('0x38')])[_0xfcbf('0x16')](function(_0x4eb819){_0x362e0f(null,_[_0xfcbf('0x46')](_0x4eb819)?![]:!![]);})[_0xfcbf('0x14')](function(_0xd489c9){logger[_0xfcbf('0x2e')](_0xd489c9);_0x362e0f(null,![]);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x54')]=function(_0x586f40,_0x37928e){var _0x158b40={'role':_0xfcbf('0x53')};_0x158b40[_0x586f40]=this['channel']['callerid'];this[_0xfcbf('0xf')][_0xfcbf('0x54')](_0x158b40)[_0xfcbf('0x16')](function(_0x56cc8f){_0x37928e(null,_[_0xfcbf('0x46')](_0x56cc8f)?![]:!![]);})[_0xfcbf('0x14')](function(_0x1ecbda){logger[_0xfcbf('0x2e')](_0x1ecbda);_0x37928e(null,![]);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x55')]=function(_0xff477f,_0x279941){var _0x33807={'role':_0xfcbf('0x53')};_0x33807[_0xff477f]=this['channel'][_0xfcbf('0x3c')];this[_0xfcbf('0xf')][_0xfcbf('0x55')](_0x33807)[_0xfcbf('0x16')](function(_0x11e8fd){_0x279941(null,_[_0xfcbf('0x46')](_0x11e8fd)?![]:!![]);})['catch'](function(_0x42412d){logger[_0xfcbf('0x2e')](_0x42412d);_0x279941(null,![]);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x56')]=function(_0xae85c6,_0x590045){var _0x1e8636={'role':_0xfcbf('0x53')};_0x1e8636[_0xae85c6]=this['channel'][_0xfcbf('0x3c')];var _0x11e498=_0xae85c6!=_0xfcbf('0x57')?util['format']('%s/%s@from-sip/n',_0xfcbf('0x58'),this['channel'][_0xfcbf('0x3c')]):undefined;this[_0xfcbf('0xf')]['agentLogin'](_0x1e8636,_0x11e498)[_0xfcbf('0x16')](function(_0x570abc){_0x590045(null,_['isNil'](_0x570abc)?![]:!![]);})['catch'](function(_0x1299c5){logger['error'](_0x1299c5);_0x590045(null,![]);});};AGIVertices['prototype'][_0xfcbf('0x59')]=function(_0x4850d4,_0x820690){sh[_0xfcbf('0x5a')](_['trim'](_0x4850d4),function(_0x30d294,_0x8b0f87){var _0x12fa21=_0x8b0f87[_0xfcbf('0x5b')](/(\r\n|\n|\r)/gm,'');_0x820690(null,_0x12fa21);});};AGIVertices['prototype'][_0xfcbf('0x5c')]=function(_0x5e5a5a,_0x1a68d6){scripts['googleCloudTTS'](_0x5e5a5a[_0xfcbf('0x5d')],_0x5e5a5a[_0xfcbf('0x5e')]||'text',_0x5e5a5a['text'],_0x5e5a5a['languageCode']||_0xfcbf('0x5f'),_0x5e5a5a[_0xfcbf('0x60')]||'MALE',_0x5e5a5a[_0xfcbf('0x61')]||_0xfcbf('0x62'))[_0xfcbf('0x16')](function(_0x5dabca){_0x1a68d6(null,_0x5dabca);})['catch'](function(_0x178ab3){_0x1a68d6(_0x178ab3);});};AGIVertices['prototype'][_0xfcbf('0x63')]=function(_0x5d3421,_0x4c0d07){scripts[_0xfcbf('0x63')](_0x5d3421[_0xfcbf('0x64')],_0x5d3421[_0xfcbf('0x65')]||'en',0x1)['then'](function(_0x4b4090){_0x4c0d07(null,_0x4b4090);})[_0xfcbf('0x14')](function(_0x1931a2){_0x4c0d07(_0x1931a2);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x66')]=function(_0x551503,_0x994378){var _0xbcb920={'uri':_0x551503['url'],'method':_0x551503['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x551503[_0xfcbf('0x67')])===_0xfcbf('0x68')&&parseInt(_0x551503[_0xfcbf('0x67')])>=0x1?parseInt(_0x551503[_0xfcbf('0x67')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xfcbf('0x69'),_0xfcbf('0x6a')],_0xbcb920['method'][_0xfcbf('0x6b')]())){try{_0xbcb920[_0xfcbf('0x6c')]=_0x551503[_0xfcbf('0xa')]?JSON[_0xfcbf('0x6d')](_0x551503[_0xfcbf('0xa')]):{};}catch(_0x383365){logger[_0xfcbf('0x2e')](_0xfcbf('0x6e'),_0x383365);}}try{_0xbcb920['headers']=_0x551503[_0xfcbf('0x9')]?JSON[_0xfcbf('0x6d')](_0x551503[_0xfcbf('0x9')]):{};}catch(_0x160457){logger[_0xfcbf('0x2e')](_0xfcbf('0x6f'),_0x160457);}if(_0x551503[_0xfcbf('0x70')]){try{var _0x23f4d5=require(_0x551503['computedVariables'])['sync'](this,_0xbcb920);_0xbcb920[_0xfcbf('0x71')]=Mustache[_0xfcbf('0x72')](_0x551503[_0xfcbf('0x73')],_0x23f4d5,{},['$$','$$']);if(_0xbcb920[_0xfcbf('0x74')]){_0xbcb920[_0xfcbf('0x74')]=JSON[_0xfcbf('0x6d')](Mustache[_0xfcbf('0x72')](JSON[_0xfcbf('0x75')](_0xbcb920[_0xfcbf('0x74')]),_0x23f4d5,{},['$$','$$']));}if(_0xbcb920[_0xfcbf('0x6c')]){_0xbcb920[_0xfcbf('0x6c')]=JSON[_0xfcbf('0x6d')](Mustache[_0xfcbf('0x72')](JSON[_0xfcbf('0x75')](_0xbcb920[_0xfcbf('0x6c')]),_0x23f4d5,{},['$$','$$']));}}catch(_0x2f755a){logger[_0xfcbf('0x2e')](_0xfcbf('0x76'),_0x2f755a);}}rp(_0xbcb920)[_0xfcbf('0x16')](function(_0x11cb4c){var _0x32462c={'statusCode':_0x11cb4c[_0xfcbf('0x77')]||0xc8,'statusMessage':_0x11cb4c['statusMessage']||'OK','headers':_0x11cb4c[_0xfcbf('0x74')]||{},'body':_0x11cb4c[_0xfcbf('0x6c')]||{}};_0x994378(null,_0x32462c);})[_0xfcbf('0x14')](function(_0x2a7e6d){var _0x357ee5={'statusCode':_0x2a7e6d[_0xfcbf('0x77')]||0x1f4,'statusMessage':_0x2a7e6d[_0xfcbf('0x78')]||_0xfcbf('0x79'),'headers':_0x2a7e6d[_0xfcbf('0x7a')][_0xfcbf('0x74')]||{},'body':_0x2a7e6d[_0xfcbf('0x7a')][_0xfcbf('0x6c')]||{}};_0x994378(null,_0x357ee5);});};AGIVertices['prototype'][_0xfcbf('0x7b')]=function(_0xc49ee1,_0x1ef158){scripts[_0xfcbf('0x7b')](this['channel'][_0xfcbf('0x38')],_0xc49ee1[_0xfcbf('0x7c')],_0xc49ee1[_0xfcbf('0x64')],_0xc49ee1[_0xfcbf('0x7d')]||'en')[_0xfcbf('0x16')](function(_0x562e09){_0x1ef158(null,_0x562e09);})[_0xfcbf('0x14')](function(_0xc6337){_0x1ef158(_0xc6337);});};AGIVertices['prototype'][_0xfcbf('0x7e')]=function(_0x19acb0,_0x32ec72){scripts['googleDialogflowV2'](this[_0xfcbf('0xe')][_0xfcbf('0x38')],_0x19acb0[_0xfcbf('0x7f')],_0x19acb0[_0xfcbf('0x80')],_0x19acb0[_0xfcbf('0x81')],_0x19acb0[_0xfcbf('0x64')],_0x19acb0[_0xfcbf('0x82')]||'en')[_0xfcbf('0x16')](function(_0xcae3c3){_0x32ec72(null,_0xcae3c3);})[_0xfcbf('0x14')](function(_0x2dea20){_0x32ec72(_0x2dea20);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x83')]=function(_0x1d96a7,_0x5d9e2f){scripts[_0xfcbf('0x83')](this[_0xfcbf('0xe')],_0x1d96a7)[_0xfcbf('0x16')](function(_0x3c7502){_0x5d9e2f(null,_0x3c7502);})['catch'](function(_0x296767){_0x5d9e2f(_0x296767);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x84')]=function(_0x3ff243,_0x33bdcb){scripts['ispeechTTS'](_0x3ff243['key'],_0x3ff243[_0xfcbf('0x64')],_0x3ff243[_0xfcbf('0x85')]||_0xfcbf('0x5f'),_0x3ff243[_0xfcbf('0x86')])[_0xfcbf('0x16')](function(_0x5b8536){_0x33bdcb(null,_0x5b8536);})[_0xfcbf('0x14')](function(_0x3656ee){_0x33bdcb(_0x3656ee);});};AGIVertices['prototype'][_0xfcbf('0x87')]=function(_0x45dd8e,_0x1a16cb,_0xaf82ea){scripts[_0xfcbf('0x87')](_0x1a16cb,_0x45dd8e[_0xfcbf('0x7c')],_0x45dd8e[_0xfcbf('0x88')]||_0xfcbf('0x5f'),this[_0xfcbf('0x89')](_0x45dd8e[_0xfcbf('0x8a')])?_0x45dd8e[_0xfcbf('0x8a')]:undefined)['then'](function(_0x28498a){_0xaf82ea(null,_0x28498a);})[_0xfcbf('0x14')](function(_0x3af3ec){_0xaf82ea(_0x3af3ec);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x8b')]=function(_0xf9402c,_0x3f0b50){scripts[_0xfcbf('0x8b')](_0xf9402c[_0xfcbf('0x8c')],_0xf9402c[_0xfcbf('0x8d')],_0xf9402c['aws_polly_region'],_0xf9402c[_0xfcbf('0x8e')]||'Amy',_0xf9402c[_0xfcbf('0x64')],_0xf9402c['aws_text_type']||_0xfcbf('0x64'))[_0xfcbf('0x16')](function(_0x1872ce){_0x3f0b50(null,_0x1872ce);})['catch'](function(_0x70ff3){_0x3f0b50(_0x70ff3);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x8f')]=function(_0x9a2b36,_0x540c59){scripts[_0xfcbf('0x8f')](this[_0xfcbf('0xe')][_0xfcbf('0x38')],_0x9a2b36[_0xfcbf('0x8c')],_0x9a2b36[_0xfcbf('0x8d')],_0x9a2b36[_0xfcbf('0x90')],_0x9a2b36[_0xfcbf('0x64')],_0x9a2b36['aws_bot_name'])[_0xfcbf('0x16')](function(_0x47a618){_0x540c59(null,_0x47a618);})[_0xfcbf('0x14')](function(_0xb9846e){_0x540c59(_0xb9846e);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x91')]=function(_0x2ea66f,_0xf0d556,_0xb53825){scripts[_0xfcbf('0x91')](_0xf0d556,_0x2ea66f[_0xfcbf('0x7c')],_0x2ea66f[_0xfcbf('0x92')]||'en-US')[_0xfcbf('0x16')](function(_0x23f1d9){_0xb53825(null,_0x23f1d9);})['catch'](function(_0x1a13b2){_0xb53825(_0x1a13b2);});};AGIVertices[_0xfcbf('0x11')]['tildeASR']=function(_0x25955e,_0x34d310,_0x5b0013){scripts[_0xfcbf('0x93')](_0x34d310,_0x25955e[_0xfcbf('0x94')],_0x25955e[_0xfcbf('0x95')],_0x25955e[_0xfcbf('0x71')])[_0xfcbf('0x16')](function(_0x5f3fd5){_0x5b0013(null,_0x5f3fd5);})[_0xfcbf('0x14')](function(_0x544b1d){_0x5b0013(_0x544b1d);});};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x96')]=function(_0x12297d){var _0x5a3c65=_[_0xfcbf('0x97')](verticesWithRetry,_0x12297d['agicommand'])?_0x12297d:_[_0xfcbf('0x98')](_0x12297d);for(var _0x22f583 in _0x5a3c65){if(_0x5a3c65[_0xfcbf('0x99')](_0x22f583)){if(_0x5a3c65[_0x22f583]&&_[_0xfcbf('0x9a')](_0x5a3c65[_0x22f583])){if(_[_0xfcbf('0x97')](recursiveMapAttributes,_0x22f583)){_0x5a3c65[_0x22f583]=this['replaceObjectAllVariables'](_0x5a3c65[_0x22f583]);}else{_0x5a3c65[_0x22f583]=this[_0xfcbf('0x9b')](_0x5a3c65[_0x22f583]);}}}}return _0x5a3c65;};AGIVertices[_0xfcbf('0x11')]['recursiveNodeIndex']=function(_0x171092){for(var _0x23100a in _0x171092){if(_0x171092['hasOwnProperty'](_0x23100a)){if(_[_0xfcbf('0x9c')](_0x171092[_0x23100a])){this[_0xfcbf('0x9d')](_0x171092[_0x23100a]);}else if(_['isArray'](_0x171092[_0x23100a])){for(var _0x3267c5=0x0;_0x3267c5<_0x171092[_0x23100a][_0xfcbf('0x9e')];_0x3267c5++){this[_0xfcbf('0x9d')](_0x171092[_0x23100a][_0x3267c5]);}}else if(_['isString'](_0x171092[_0x23100a])){_0x171092[_0x23100a]=this[_0xfcbf('0x9b')](_0x171092[_0x23100a]);}}}};AGIVertices[_0xfcbf('0x11')]['saveRestApiResult']=function(_0x582b95,_0xcc41f8){for(var _0x545783 in _0x582b95){if(_0x582b95[_0xfcbf('0x99')](_0x545783)){if(_['isPlainObject'](_0x582b95[_0x545783])){if(!_[_0xfcbf('0x45')](_0x582b95[_0x545783])){this[_0xfcbf('0x9f')](_0x582b95[_0x545783],util[_0xfcbf('0x2b')](_0xfcbf('0xa0'),_0xcc41f8,_0x545783));}}else if(_[_0xfcbf('0xa1')](_0x582b95[_0x545783])){for(var _0x916a8c=0x0;_0x916a8c<_0x582b95[_0x545783][_0xfcbf('0x9e')];_0x916a8c++){this[_0xfcbf('0x9f')](_0x582b95[_0x545783][_0x916a8c],util['format'](_0xfcbf('0xa0'),_0xcc41f8,_0x545783+'['+_0x916a8c+']'));}}else{if(!_[_0xfcbf('0x46')](_0x582b95[_0x545783])){this['channel'][_0xfcbf('0xa2')](util[_0xfcbf('0x2b')](_0xfcbf('0xa0'),_0xcc41f8,_0x545783),_0x582b95[_0x545783]);}}}}};AGIVertices[_0xfcbf('0x11')]['replaceObjectAllVariables']=function(_0x5ed1b1){try{var _0x4c55af=JSON[_0xfcbf('0x6d')](_0x5ed1b1);this[_0xfcbf('0x9d')](_0x4c55af);return JSON[_0xfcbf('0x75')](_0x4c55af);}catch(_0x564f06){return this[_0xfcbf('0x9b')](_0x5ed1b1);}};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x9b')]=function(_0x1c5d85){var _0x485745=_0x1c5d85[_0xfcbf('0xa3')]('{');for(var _0x45a858=0x1;_0x45a858<_0x485745['length'];_0x45a858+=0x1){var _0x55d5fc=_0x485745[_0x45a858][_0xfcbf('0xa3')]('}');if(_0x55d5fc[_0xfcbf('0x9e')]>0x1){_0x1c5d85=_0x1c5d85[_0xfcbf('0xa4')]('{'+_0x55d5fc[0x0]+'}',this[_0xfcbf('0xe')][_0xfcbf('0xa5')](_0x55d5fc[0x0])[_0xfcbf('0xa6')]||_0x55d5fc[0x0]);}}if(_0x485745['length']===0x1){return _0x1c5d85[_0xfcbf('0x4e')]();}return this[_0xfcbf('0x9b')](_0x1c5d85);};AGIVertices['prototype']['getAndSetVariable']=function(_0xf06858,_0x27bb22){var _0xd9fc01=this['channel']['getVariable'](_0xf06858);if(_0xd9fc01['result']===-0x1){return _0xd9fc01;}logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0xa7'),_0x27bb22,_0xd9fc01[_0xfcbf('0xa6')]));return this[_0xfcbf('0xe')][_0xfcbf('0xa2')](_0x27bb22,_0xd9fc01[_0xfcbf('0xa6')]);};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x89')]=function(_0x2b6e9e){return _0x2b6e9e&&_0x2b6e9e!=='0'&&_0x2b6e9e!=='-1'&&_0x2b6e9e!=='';};AGIVertices['prototype'][_0xfcbf('0xa8')]=function(_0x28929c){this[_0xfcbf('0x37')]['sync'](this,_0x28929c,'-');_0x28929c[_0xfcbf('0xa9')]=_0x28929c[_0xfcbf('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0xaa')]=function(_0x306f03){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0xab'),_0x306f03[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x306f03[_0xfcbf('0x64')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0xad'));}var _0x18268d='\x22'+_0x306f03[_0xfcbf('0x64')]+'\x22';if(this['isConfigured'](_0x306f03[_0xfcbf('0x7a')])){_0x18268d+=','+_0x306f03[_0xfcbf('0x7a')];}var _0x25aa1a=this[_0xfcbf('0xe')]['exec'](_0xfcbf('0xae'),_0x18268d);if(_0x25aa1a[_0xfcbf('0xaf')]===-0x1){return _0x25aa1a;}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0xb0'),_0x18268d));};AGIVertices['prototype'][_0xfcbf('0xb1')]=function(_0x53ac9e){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0xb2'),_0x53ac9e[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x53ac9e[_0xfcbf('0xb3')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0xb4'));}var _0x1e191a=_0x53ac9e[_0xfcbf('0xb3')];if(this[_0xfcbf('0x89')](_0x53ac9e[_0xfcbf('0x7a')])){_0x1e191a+=','+_0x53ac9e[_0xfcbf('0x7a')];}var _0x424d93=this[_0xfcbf('0xe')][_0xfcbf('0x5a')](_0xfcbf('0xb5'),_0x1e191a);if(_0x424d93[_0xfcbf('0xaf')]===-0x1){return _0x424d93;}var _0x161c0a=this[_0xfcbf('0xb6')]('RECOG_CONFIDENCE()',_0xfcbf('0xb7'));if(_0x161c0a[_0xfcbf('0xaf')]===-0x1){return _0x161c0a;}var _0x26d529=this['getAndSetVariable'](_0xfcbf('0xb8'),'MRCP_RECOG_TRANSCRIPT');if(_0x26d529[_0xfcbf('0xaf')]===-0x1){return _0x26d529;}var _0x225930=this[_0xfcbf('0xb6')](_0xfcbf('0xb9'),_0xfcbf('0xba'));if(_0x225930['result']===-0x1){return _0x225930;}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1e191a));};AGIVertices[_0xfcbf('0x11')]['agi']=function(_0x29657d){logger[_0xfcbf('0x30')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x29657d['label']));return this[_0xfcbf('0xe')]['agi']([_0x29657d[_0xfcbf('0xbb')],_0x29657d[_0xfcbf('0xbc')]]);};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0xbd')]=function(_0xbba2c){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0xbba2c[_0xfcbf('0x39')]));if(this[_0xfcbf('0x89')](_0xbba2c[_0xfcbf('0x67')])){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0xbe'),_0xbba2c[_0xfcbf('0x67')]));var _0x486734=this[_0xfcbf('0xe')][_0xfcbf('0xbf')](_0xbba2c[_0xfcbf('0x67')]);if(_0x486734[_0xfcbf('0xaf')]===-0x1){return _0x486734;}}return this['channel'][_0xfcbf('0xbd')]();};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x4c')]=function(_0x4b909d){logger['info'](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x4b909d['label']));if(!this['isConfigured'](_0x4b909d['list_id'])){return this[_0xfcbf('0xe')]['error'](_0x4b909d,_0xfcbf('0xc0'));}_0x4b909d['scheduledAt']=moment();if(this[_0xfcbf('0x89')](_0x4b909d[_0xfcbf('0xc1')])){_0x4b909d[_0xfcbf('0x4b')]=moment()['add'](_0x4b909d[_0xfcbf('0xc1')],_0xfcbf('0xc2'));}if(!this['isConfigured'](_0x4b909d[_0xfcbf('0x4f')])){_0x4b909d[_0xfcbf('0x4f')]=0x2;}this[_0xfcbf('0xc3')][_0xfcbf('0xc4')](this,_0x4b909d);return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0xc5'),_0x4b909d[_0xfcbf('0xc6')],_0x4b909d[_0xfcbf('0x4a')],_0x4b909d[_0xfcbf('0x4b')]));};AGIVertices['prototype'][_0xfcbf('0xc7')]=function(_0x4ff1a2){logger[_0xfcbf('0x30')](util['format'](_0xfcbf('0xc8'),_0x4ff1a2[_0xfcbf('0x39')]));var _0xbe89d0=this[_0xfcbf('0xe')][_0xfcbf('0x5a')](_0x4ff1a2[_0xfcbf('0xc9')],_0x4ff1a2[_0xfcbf('0x7a')]);if(_0xbe89d0['result']===-0x1){return _0xbe89d0;}return this[_0xfcbf('0xe')]['noop'](util[_0xfcbf('0x2b')](_0xfcbf('0xca'),_0x4ff1a2[_0xfcbf('0xc9')],_0x4ff1a2['options']));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0xcb')]=function(_0x10faff){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0xcc'),_0x10faff['label']));if(!this[_0xfcbf('0x89')](_0x10faff[_0xfcbf('0x64')])){return this[_0xfcbf('0xe')]['noop']('no\x20text\x20configured');}var _0x4f8817='\x22'+_0x10faff[_0xfcbf('0x64')]+'\x22';if(this[_0xfcbf('0x89')](_0x10faff['options'])){_0x4f8817+=','+_0x10faff[_0xfcbf('0x7a')];}var _0x34fc4b=this[_0xfcbf('0xe')][_0xfcbf('0x5a')](_0xfcbf('0xae'),_0x4f8817);if(_0x34fc4b[_0xfcbf('0xaf')]===-0x1){return _0x34fc4b;}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0xb0'),_0x4f8817));};AGIVertices['prototype'][_0xfcbf('0xcd')]=function(_0x2e35ab){logger[_0xfcbf('0x30')](util['format'](_0xfcbf('0xce'),_0x2e35ab[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x2e35ab[_0xfcbf('0x64')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20text\x20configured');}var _0x380d29='\x22'+_0x2e35ab[_0xfcbf('0x64')]+'\x22';if(this[_0xfcbf('0x89')](_0x2e35ab['options'])){_0x380d29+=','+_0x2e35ab[_0xfcbf('0x7a')];}var _0x109717=this[_0xfcbf('0xe')][_0xfcbf('0x5a')](_0xfcbf('0xae'),_0x380d29);if(_0x109717['result']===-0x1){return _0x109717;}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')]('Executed\x20command\x20MRCPSynth\x20%s',_0x380d29));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0xcf')]=function(_0x9b2091){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x9b2091[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x9b2091['grammar'])){return this[_0xfcbf('0xe')]['noop'](_0xfcbf('0xb4'));}var _0xbc322e=_0x9b2091[_0xfcbf('0xb3')];if(this[_0xfcbf('0x89')](_0x9b2091[_0xfcbf('0x7a')])){_0xbc322e+=','+_0x9b2091[_0xfcbf('0x7a')];}var _0x13e030=this[_0xfcbf('0xe')][_0xfcbf('0x5a')](_0xfcbf('0xb5'),_0xbc322e);if(_0x13e030[_0xfcbf('0xaf')]===-0x1){return _0x13e030;}var _0x3e0fd7=this[_0xfcbf('0xb6')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x3e0fd7[_0xfcbf('0xaf')]===-0x1){return _0x3e0fd7;}var _0x425fb6=this[_0xfcbf('0xb6')]('RECOG_INPUT()',_0xfcbf('0xd0'));if(_0x425fb6[_0xfcbf('0xaf')]===-0x1){return _0x425fb6;}var _0x126f55=this[_0xfcbf('0xb6')](_0xfcbf('0xb9'),_0xfcbf('0xd1'));if(_0x126f55[_0xfcbf('0xaf')]===-0x1){return _0x126f55;}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0xd2'),_0xbc322e));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0xd3')]=function(_0x487a20){logger['info'](util['format'](_0xfcbf('0xd4'),_0x487a20['label']));if(!this[_0xfcbf('0x89')](_0x487a20['grammar'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0xb4'));}var _0x4e7b64=_0x487a20['grammar'];if(this['isConfigured'](_0x487a20['options'])){_0x4e7b64+=','+_0x487a20[_0xfcbf('0x7a')];}var _0x3317ea=this['channel'][_0xfcbf('0x5a')]('MRCPRecog',_0x4e7b64);if(_0x3317ea[_0xfcbf('0xaf')]===-0x1){return _0x3317ea;}var _0x4cc998=this[_0xfcbf('0xb6')](_0xfcbf('0xd5'),_0xfcbf('0xd6'));if(_0x4cc998[_0xfcbf('0xaf')]===-0x1){return _0x4cc998;}var _0x107a3d=this[_0xfcbf('0xb6')](_0xfcbf('0xb8'),_0xfcbf('0xd7'));if(_0x107a3d[_0xfcbf('0xaf')]===-0x1){return _0x107a3d;}var _0x364e88=this[_0xfcbf('0xb6')]('RECOG_INSTANCE()',_0xfcbf('0xd8'));if(_0x364e88['result']===-0x1){return _0x364e88;}return this['channel'][_0xfcbf('0xac')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x4e7b64));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0xd9')]=function(_0x3f5c04){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0xda'),_0x3f5c04['label']));if(!this[_0xfcbf('0x89')](_0x3f5c04[_0xfcbf('0xdb')])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x3f5c04,'no\x20database\x20selected');}var _0x485112=this['getSquareOdbc']['sync'](this,_0x3f5c04['odbc_id']);if(!_0x485112){return this[_0xfcbf('0xe')]['error'](_0x3f5c04,_0xfcbf('0xdc'));}if(!this[_0xfcbf('0x89')](_0x3f5c04['query'])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x3f5c04,_0xfcbf('0xdd'));}var _0x27dc7d=_0x3f5c04[_0xfcbf('0xde')][_0xfcbf('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0xfcbf('0xe')][_0xfcbf('0xac')](util['format'](_0xfcbf('0xdf'),_0x27dc7d));var _0x43adc9=this[_0xfcbf('0x2c')]['sync'](this,_0x485112,_0x27dc7d);this['createSquareDetailsReport'][_0xfcbf('0xc4')](this,_0x3f5c04,_0x27dc7d);if(!this[_0xfcbf('0x89')](_0x3f5c04[_0xfcbf('0xe0')])){return this[_0xfcbf('0xe')]['noop'](_0xfcbf('0xe1'));}var _0x2c2102=this[_0xfcbf('0xa5')][_0xfcbf('0xc4')](this,_0x3f5c04['variable_id']);if(!_0x2c2102){return this['channel'][_0xfcbf('0x2e')](_0x3f5c04,_0xfcbf('0xe2'));}var _0x4d8270=this;_0x43adc9[_0xfcbf('0xe3')](function(_0x5b934b,_0x348731){Object['keys'](_0x5b934b)[_0xfcbf('0xe3')](function(_0x282a3b){_0x4d8270[_0xfcbf('0xe')][_0xfcbf('0xa2')](util[_0xfcbf('0x2b')](_0xfcbf('0xe4'),_0x2c2102,_0x348731,_0x282a3b),_0x5b934b[_0x282a3b]);});});this[_0xfcbf('0xe')][_0xfcbf('0xa2')](util[_0xfcbf('0x2b')](_0xfcbf('0xe5'),_0x2c2102),_0x43adc9[_0xfcbf('0x9e')]);return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util['format'](_0xfcbf('0xe6'),_0x2c2102));};AGIVertices['prototype'][_0xfcbf('0xe7')]=function(_0x4f1f9c){logger[_0xfcbf('0xe8')](util['format'](_0xfcbf('0xe9'),_0x4f1f9c[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x4f1f9c[_0xfcbf('0xea')])){return this['channel'][_0xfcbf('0x2e')](_0x4f1f9c,_0xfcbf('0xeb'));}var _0x3a4595=this[_0xfcbf('0x1c')][_0xfcbf('0xc4')](this,_0x4f1f9c[_0xfcbf('0xea')]);if(!_0x3a4595){return this[_0xfcbf('0xe')]['error'](_0x4f1f9c,_0xfcbf('0xec'));}var _0x2279d9=this[_0xfcbf('0xe')][_0xfcbf('0x5a')](_0xfcbf('0xed'),[util[_0xfcbf('0x2b')](_0xfcbf('0xee'),_0x3a4595),_0x4f1f9c[_0xfcbf('0x67')],_0x4f1f9c[_0xfcbf('0xef')],_0x4f1f9c['url']]);if(_0x2279d9[_0xfcbf('0xaf')]===-0x1){return _0x2279d9;}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0xf0'),_0xfcbf('0xed')));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0xf1')]=function(_0x40e382){logger[_0xfcbf('0x30')](util['format'](_0xfcbf('0xf2'),_0x40e382[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x40e382[_0xfcbf('0x7c')])){return this['channel'][_0xfcbf('0xac')]('no\x20key\x20configured');}if(!this[_0xfcbf('0x89')](_0x40e382[_0xfcbf('0x64')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0xad'));}this[_0xfcbf('0xe')][_0xfcbf('0xf3')]=!![];this[_0xfcbf('0x37')](_0x40e382);this[_0xfcbf('0x44')](_0x40e382['text'],'in','','');this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0xf4'),_0x40e382[_0xfcbf('0x64')]));var _0x2e1434=this[_0xfcbf('0x7b')]['sync'](this,_0x40e382);if(_0x2e1434){for(var _0x12437e in _0x2e1434){if(_0x2e1434[_0xfcbf('0x99')](_0x12437e)){this[_0xfcbf('0xe')][_0xfcbf('0xa2')](util[_0xfcbf('0x2b')](_0xfcbf('0xf5'),_0x12437e[_0xfcbf('0x6b')]()),_0x2e1434[_0x12437e]);}}this['createSquareMessage'](_0x2e1434[_0xfcbf('0xf6')],_0xfcbf('0xf7'),_0xfcbf('0xf1'),'');return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util['format'](_0xfcbf('0xf8'),_0x2e1434[_0xfcbf('0xf6')]));}return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x40e382,_0xfcbf('0xf9'));};AGIVertices[_0xfcbf('0x11')]['dialogflowV2']=function(_0x3d41ba){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0xfa'),_0x3d41ba[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x3d41ba['dialogflowV2_project_id'])){return this[_0xfcbf('0xe')]['noop'](_0xfcbf('0xfb'));}if(!this[_0xfcbf('0x89')](_0x3d41ba[_0xfcbf('0x80')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0xfc'));}if(!this['isConfigured'](_0x3d41ba[_0xfcbf('0x81')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20private_key\x20configured');}if(!this[_0xfcbf('0x89')](_0x3d41ba[_0xfcbf('0x82')])){return this['channel'][_0xfcbf('0xac')](_0xfcbf('0xfd'));}if(!this[_0xfcbf('0x89')](_0x3d41ba[_0xfcbf('0x64')])){return this['channel'][_0xfcbf('0xac')](_0xfcbf('0xad'));}this[_0xfcbf('0xe')][_0xfcbf('0xf3')]=!![];this[_0xfcbf('0x37')](_0x3d41ba);this[_0xfcbf('0x44')](_0x3d41ba[_0xfcbf('0x64')],'in','','');this['channel']['noop'](util[_0xfcbf('0x2b')]('Trying\x20DialogflowV2:\x20%s',_0x3d41ba[_0xfcbf('0x64')]));var _0x1beb9d=this[_0xfcbf('0x7e')][_0xfcbf('0xc4')](this,_0x3d41ba);if(_0x1beb9d){for(var _0xf7f00e in _0x1beb9d){if(_0x1beb9d['hasOwnProperty'](_0xf7f00e)){if(_0xf7f00e!==_0xfcbf('0xfe')){this['channel'][_0xfcbf('0xa2')](util['format']('DIALOGFLOW_%s',_0xf7f00e['toUpperCase']()),_0x1beb9d[_0xf7f00e]);}}}this[_0xfcbf('0x44')](_0x1beb9d[_0xfcbf('0xf6')],_0xfcbf('0xf7'),'dialogflowV2',_0x1beb9d['providerResponse']);return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util['format'](_0xfcbf('0xff'),_0x1beb9d['speech']));}return this['channel'][_0xfcbf('0x2e')](_0x3d41ba,_0xfcbf('0x100'));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x101')]=function(_0x47959f){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x102'),_0x47959f[_0xfcbf('0x39')]));if(!this['isConfigured'](_0x47959f[_0xfcbf('0x103')])){return this[_0xfcbf('0xe')]['noop']('no\x20ndauth\x20url\x20configured');}if(!this[_0xfcbf('0x89')](_0x47959f[_0xfcbf('0x104')])){return this[_0xfcbf('0xe')]['noop']('no\x20username\x20configured');}if(!this[_0xfcbf('0x89')](_0x47959f[_0xfcbf('0x105')])){return this[_0xfcbf('0xe')]['noop'](_0xfcbf('0x106'));}if(!this[_0xfcbf('0x89')](_0x47959f['ndassistant_url'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20text\x20configured');}this[_0xfcbf('0xe')]['bot']=!![];this[_0xfcbf('0x37')](_0x47959f);this[_0xfcbf('0x44')](_0x47959f['text'],'in','','');this['channel'][_0xfcbf('0xac')](util[_0xfcbf('0x2b')]('Trying\x20SestekNDA:\x20%s',_0x47959f[_0xfcbf('0x64')]));var _0x24ab06=this[_0xfcbf('0x83')]['sync'](this,_0x47959f);if(_0x24ab06){for(var _0x4a4c3e in _0x24ab06){if(_0x24ab06[_0xfcbf('0x99')](_0x4a4c3e)){this[_0xfcbf('0xe')][_0xfcbf('0xa2')](util[_0xfcbf('0x2b')](_0xfcbf('0x107'),_0x4a4c3e[_0xfcbf('0x6b')]()),_0x24ab06[_0x4a4c3e]);}}this['createSquareMessage'](_0x24ab06[_0xfcbf('0xf6')],'out',_0xfcbf('0x101'),'');if(_0x24ab06[_0xfcbf('0x108')]){this[_0xfcbf('0xe')]['noop'](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x24ab06[_0xfcbf('0x108')]));var _0x4035db=this['channel']['streamFile'](_0x24ab06['audiofile']);try{fs[_0xfcbf('0x109')](_0x24ab06['audiofile']+_0xfcbf('0x10a'));}catch(_0x1c9fb9){logger[_0xfcbf('0x2e')](_0x1c9fb9);}return _0x4035db;}else{return this['channel']['noop'](util[_0xfcbf('0x2b')](_0xfcbf('0x10b'),_0x24ab06[_0xfcbf('0xf6')]));}}return this['channel'][_0xfcbf('0x2e')](_0x47959f,_0xfcbf('0x10c'));};AGIVertices['prototype'][_0xfcbf('0x10d')]=function(_0x3cf29b){logger[_0xfcbf('0x30')](util['format'](_0xfcbf('0x10e'),_0x3cf29b['label']));return this[_0xfcbf('0xe')]['noop'](_0xfcbf('0x10d'));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x10f')]=function(_0x2b14a9){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x110'),_0x2b14a9['label']));var _0x45a3ed='';if(_0x2b14a9[_0xfcbf('0x111')]){if(!this['isConfigured'](_0x2b14a9[_0xfcbf('0x111')])){return this['channel'][_0xfcbf('0x2e')](_0x2b14a9,_0xfcbf('0x112'));}else{var _0xbd8916=parseInt(_0x2b14a9['trunk_id'],0xa);if(isNaN(_0xbd8916)){_0x45a3ed=_0x2b14a9[_0xfcbf('0x111')];}else{_0x45a3ed=this[_0xfcbf('0x113')][_0xfcbf('0xc4')](this,_0x2b14a9[_0xfcbf('0x111')]);if(!_0x45a3ed){return this['channel'][_0xfcbf('0x2e')](_0x2b14a9,_0xfcbf('0x114'));}}}}else if(_0x2b14a9['trunk_name']){_0x45a3ed=_0x2b14a9[_0xfcbf('0x115')];}else{return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x2b14a9,_0xfcbf('0x112'));}var _0x39e593=this['channel'][_0xfcbf('0x5a')](_0xfcbf('0xed'),[util['format']('SIP/%s/%s',_0x45a3ed,_0x2b14a9['phone']),_0x2b14a9[_0xfcbf('0x67')],_0x2b14a9['opts'],_0x2b14a9['url']]);if(_0x39e593[_0xfcbf('0xaf')]===-0x1){return _0x39e593;}return this['channel'][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0xf0'),_0xfcbf('0xed')));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x116')]=function(_0xd976e9){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x117'),_0xd976e9[_0xfcbf('0x39')]));return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x116'));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0xc')]=function(_0x330860){logger['info'](util[_0xfcbf('0x2b')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x330860['label']));if(_0x330860[_0xfcbf('0xa9')]===0x0){return this['maxRetry'](_0x330860);}_0x330860['retry']-=0x1;if(!this[_0xfcbf('0x89')](_0x330860[_0xfcbf('0x118')])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x330860,_0xfcbf('0x119'));}var _0x5314ce=this[_0xfcbf('0x1f')][_0xfcbf('0xc4')](this,_0x330860[_0xfcbf('0x118')]);if(!_0x5314ce){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x330860,_0xfcbf('0x11a'));}if(!this[_0xfcbf('0x89')](_0x330860[_0xfcbf('0xe0')])){return this['channel'][_0xfcbf('0x2e')](_0xfcbf('0xe1'));}var _0x1545a1=this[_0xfcbf('0xe')][_0xfcbf('0x11b')](_0x5314ce,_0x330860[_0xfcbf('0x11c')],_0x330860[_0xfcbf('0x11d')]);var _0x3379f3=_0x1545a1[_0xfcbf('0xaf')]?_0x1545a1[_0xfcbf('0xaf')][_0xfcbf('0x4e')]():'';logger[_0xfcbf('0x30')](_0xfcbf('0x11e'),JSON['stringify'](_0x1545a1));if(_0x1545a1[_0xfcbf('0xaf')]===-0x1){this[_0xfcbf('0x37')][_0xfcbf('0xc4')](this,_0x330860,_0x3379f3);return _0x1545a1;}else if(_0x1545a1[_0xfcbf('0xa6')]===_0xfcbf('0x67')){_0x1545a1[_0xfcbf('0xaf')]=_0x3379f3[_0xfcbf('0x9e')]>=parseInt(_0x330860[_0xfcbf('0x11f')])?'x':'i';}else{_0x1545a1[_0xfcbf('0xaf')]=_0x3379f3[_0xfcbf('0x9e')]>=parseInt(_0x330860[_0xfcbf('0x11f')])&&_0x3379f3[_0xfcbf('0x9e')]<=parseInt(_0x330860[_0xfcbf('0x11d')])?'x':'i';}var _0xae167=this[_0xfcbf('0xa5')][_0xfcbf('0xc4')](this,_0x330860['variable_id']);if(!_0xae167){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x330860,_0xfcbf('0xe2'));}this[_0xfcbf('0xe')]['setVariable'](_0xae167,_0x3379f3);if(this[_0xfcbf('0x89')](_0x330860[_0xfcbf('0x120')])){var _0x230e5a=parseInt(_0x330860[_0xfcbf('0x120')],0xa);var _0x4cab9f=rs[_0xfcbf('0x121')]({'charset':'*','length':_0x230e5a});var _0x29472e=_0x3379f3[_0xfcbf('0x9e')];if(_0x29472e>0x0){if(_0x29472e>_0x230e5a){this[_0xfcbf('0x37')][_0xfcbf('0xc4')](this,_0x330860,_0x330860[_0xfcbf('0x122')]==='first'?_0x4cab9f+_0x3379f3[_0xfcbf('0x123')](_0x230e5a):_0x3379f3[_0xfcbf('0x123')](0x0,_0x29472e-_0x230e5a)+_0x4cab9f);}else{this[_0xfcbf('0x37')]['sync'](this,_0x330860,rs['generate']({'charset':'*','length':_0x29472e}));}}else{this['createSquareDetailsReport'][_0xfcbf('0xc4')](this,_0x330860,'');}}else{this[_0xfcbf('0x37')][_0xfcbf('0xc4')](this,_0x330860,_0x3379f3);}return _0x1545a1;};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0xd')]=function(_0x1ff6cf){logger[_0xfcbf('0x30')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x1ff6cf[_0xfcbf('0x39')]));return this['getdigits'](_0x1ff6cf);};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x124')]=function(_0x18383b){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x125'),_0x18383b[_0xfcbf('0x39')]));this[_0xfcbf('0x37')][_0xfcbf('0xc4')](this,_0x18383b,_0x18383b['goalname']);return this[_0xfcbf('0xe')]['noop'](util['format']('GOAL\x20%s',_0x18383b['goalname']));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x126')]=function(_0x16518d){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x127'),_0x16518d[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x16518d[_0xfcbf('0x8c')])||!this[_0xfcbf('0x89')](_0x16518d['aws_secret_access_key'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x128'));}if(!this['isConfigured'](_0x16518d['text'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20text\x20configured');}this[_0xfcbf('0xe')][_0xfcbf('0xac')](util['format'](_0xfcbf('0x129'),_0x16518d['text']));var _0x12cd1e=this[_0xfcbf('0x8b')][_0xfcbf('0xc4')](this,_0x16518d);if(_0x12cd1e){this[_0xfcbf('0xe')]['noop'](util[_0xfcbf('0x2b')](_0xfcbf('0x12a'),_0x12cd1e));var _0x4919e4=this['channel']['streamFile'](_0x12cd1e);try{fs['unlink'](_0x12cd1e+_0xfcbf('0x10a'));}catch(_0x4ee2b3){logger[_0xfcbf('0x2e')](_0x4ee2b3);}return _0x4919e4;}return this['channel'][_0xfcbf('0x2e')](_0x16518d,_0xfcbf('0x12b'));};AGIVertices['prototype'][_0xfcbf('0x12c')]=function(_0x55d995){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x12d'),_0x55d995[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x55d995[_0xfcbf('0x8c')])||!this[_0xfcbf('0x89')](_0x55d995['aws_secret_access_key'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x55d995[_0xfcbf('0x12e')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20bot\x20name\x20configured');}if(!this[_0xfcbf('0x89')](_0x55d995[_0xfcbf('0x64')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20text\x20configured');}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x55d995);this[_0xfcbf('0x44')](_0x55d995['text'],'in','','');this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x12f'),_0x55d995['text']));var _0x128c08=this[_0xfcbf('0x8f')]['sync'](this,_0x55d995);if(_0x128c08){for(var _0x86028f in _0x128c08){if(_0x128c08[_0xfcbf('0x99')](_0x86028f)&&_['isString'](_0x128c08[_0x86028f])){this['channel'][_0xfcbf('0xa2')](util[_0xfcbf('0x2b')](_0xfcbf('0x130'),_0x86028f['toUpperCase']()),_0x128c08[_0x86028f]);}}if(_['isNil'](_0x128c08['message'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x131'));}else{this[_0xfcbf('0x44')](_0x128c08[_0xfcbf('0x78')],'out','amazonlex','');return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x128c08[_0xfcbf('0x78')]));}}return this[_0xfcbf('0xe')]['error'](_0x55d995,_0xfcbf('0x132'));};AGIVertices[_0xfcbf('0x11')]['googleasr']=function(_0x5ad8a5){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x133'),_0x5ad8a5[_0xfcbf('0x39')],_0x5ad8a5[_0xfcbf('0x67')]));if(!this[_0xfcbf('0x89')](_0x5ad8a5['key'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x134'));}var _0x36520c='wav';var _0x2e3219=util[_0xfcbf('0x2b')](_0xfcbf('0x135'),FILES_PATH,rs[_0xfcbf('0x121')](0x4));var _0x3eac7a=util['format'](_0xfcbf('0xa0'),_0x2e3219,_0x36520c);var _0x2176b0=!![];if(_0x5ad8a5['beep']===_0xfcbf('0x136')){_0x2176b0=![];}var _0x8b2f8b=this[_0xfcbf('0xe')]['recordFile'](_0x2e3219,_0x36520c,_0x5ad8a5['intKey'],_0x5ad8a5[_0xfcbf('0x67')],undefined,_0x2176b0);if(_0x8b2f8b[_0xfcbf('0xaf')]!==-0x1){this['channel'][_0xfcbf('0xac')](util['format'](_0xfcbf('0x137'),_0x3eac7a));var _0x553dbc=this['googleASR']['sync'](this,_0x5ad8a5,_0x3eac7a);if(_0x553dbc){for(var _0x40f34e in _0x553dbc){if(_0x553dbc[_0xfcbf('0x99')](_0x40f34e)){this[_0xfcbf('0xe')][_0xfcbf('0xa2')](util[_0xfcbf('0x2b')](_0xfcbf('0x138'),_0x40f34e[_0xfcbf('0x6b')]()),_0x553dbc[_0x40f34e]);}}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x139'),JSON['stringify'](_0x553dbc)));}}return _0x8b2f8b;};AGIVertices['prototype']['tildeasr']=function(_0x26bd80){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x13a'),_0x26bd80[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x26bd80[_0xfcbf('0x94')])){return this[_0xfcbf('0xe')]['noop'](_0xfcbf('0x13b'));}if(!this['isConfigured'](_0x26bd80['appsecret'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x13c'));}var _0x2f84f9='wav';var _0x53f4d6=util[_0xfcbf('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0xfcbf('0x121')](0x4));var _0x81aae9=util['format'](_0xfcbf('0xa0'),_0x53f4d6,_0x2f84f9);var _0x58901f=!![];if(_0x26bd80[_0xfcbf('0x13d')]===_0xfcbf('0x136')){_0x58901f=![];}var _0x273f19=this['channel'][_0xfcbf('0x13e')](_0x53f4d6,_0x2f84f9,_0x26bd80[_0xfcbf('0x13f')],_0x26bd80[_0xfcbf('0x67')],undefined,_0x58901f);if(_0x273f19[_0xfcbf('0xaf')]!==-0x1){this[_0xfcbf('0xe')]['noop'](util[_0xfcbf('0x2b')](_0xfcbf('0x140'),_0x81aae9));var _0x38a156=this[_0xfcbf('0x93')][_0xfcbf('0xc4')](this,_0x26bd80,_0x81aae9);if(_0x38a156){for(var _0x38066d in _0x38a156){if(_0x38a156[_0xfcbf('0x99')](_0x38066d)){this['channel']['setVariable'](util[_0xfcbf('0x2b')]('TILDE_ASR_%s',_0x38066d[_0xfcbf('0x6b')]()),_0x38a156[_0x38066d]);}}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x141'),JSON[_0xfcbf('0x75')](_0x38a156)));}}return _0x273f19;};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x142')]=function(_0x3275d0){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x143'),_0x3275d0['label']));return this[_0xfcbf('0xe')][_0xfcbf('0x144')](_0x3275d0[_0xfcbf('0x145')],_0x3275d0[_0xfcbf('0x3f')],_0x3275d0[_0xfcbf('0x40')]);};AGIVertices[_0xfcbf('0x11')]['gotoif']=function(_0x313a99){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x146'),_0x313a99[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x313a99[_0xfcbf('0x147')])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x313a99,_0xfcbf('0x148'));}try{var _0x399d5a=eval(_0x313a99['condition'])?'true':_0xfcbf('0x149');this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x14a'),_0x313a99['condition'],_0x399d5a));return{'code':0xc8,'result':_0x399d5a};}catch(_0x101e86){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x1b16d6){logger[_0xfcbf('0x30')](util['format'](_0xfcbf('0x14b'),_0x1b16d6[_0xfcbf('0x39')]));if(!this['isConfigured'](_0x1b16d6[_0xfcbf('0x14c')])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x1b16d6,_0xfcbf('0x14d'));}var _0x1d7921=this['getIntervals']['sync'](this,_0x1b16d6[_0xfcbf('0x14c')]);if(!_0x1d7921){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x1b16d6,_0xfcbf('0x14e'));}for(var _0x48539c=0x0;_0x48539c<_0x1d7921['length'];_0x48539c+=0x1){var _0x422bfd=this['channel'][_0xfcbf('0xa5')](util[_0xfcbf('0x2b')](_0xfcbf('0x14f'),_0x1d7921[_0x48539c]));if(_0x422bfd[_0xfcbf('0xaf')]===-0x1){return _0x422bfd;}logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x150'),_0x1d7921[_0x48539c],_0x422bfd[_0xfcbf('0xa6')]));if(_0x422bfd[_0xfcbf('0xa6')]===_0xfcbf('0x151')){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x150'),_0x1d7921[_0x48539c],_0xfcbf('0x151')));this[_0xfcbf('0xe')]['noop'](util[_0xfcbf('0x2b')](_0xfcbf('0x150'),_0x1d7921[_0x48539c],_0xfcbf('0x151')));return{'code':0xc8,'result':'true'};}else{logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x150'),_0x1d7921[_0x48539c],_0xfcbf('0x149')));this[_0xfcbf('0xe')]['noop'](util[_0xfcbf('0x2b')](_0xfcbf('0x150'),_0x1d7921[_0x48539c],_0xfcbf('0x149')));}}return{'code':0xc8,'result':_0xfcbf('0x149')};};AGIVertices[_0xfcbf('0x11')]['hangup']=function(_0x2ae77e){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x2ae77e['label']));return this[_0xfcbf('0xe')][_0xfcbf('0x152')]();};AGIVertices[_0xfcbf('0x11')]['ispeechasr']=function(_0x4fe0ad){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x153'),_0x4fe0ad[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x4fe0ad[_0xfcbf('0x7c')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20key\x20configured');}var _0x4fd58b=_0xfcbf('0x154');var _0x208410=util[_0xfcbf('0x2b')](_0xfcbf('0x135'),FILES_PATH,rs[_0xfcbf('0x121')](0x4));var _0x55745f=util['format']('%s.%s',_0x208410,_0x4fd58b);var _0x4cca00=!![];if(_0x4fe0ad[_0xfcbf('0x13d')]==='NOBEEP'){_0x4cca00=![];}var _0x1eac17=this[_0xfcbf('0xe')][_0xfcbf('0x13e')](_0x208410,_0x4fd58b,_0x4fe0ad[_0xfcbf('0x13f')],_0x4fe0ad[_0xfcbf('0x67')],undefined,_0x4cca00);if(_0x1eac17[_0xfcbf('0xaf')]!==-0x1){this['channel'][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x155'),_0x55745f));var _0x5e7e8a=this[_0xfcbf('0x87')]['sync'](this,_0x4fe0ad,_0x55745f);if(_0x5e7e8a){for(var _0x5ed3fa in _0x5e7e8a){if(_0x5e7e8a[_0xfcbf('0x99')](_0x5ed3fa)){this[_0xfcbf('0xe')][_0xfcbf('0xa2')](util[_0xfcbf('0x2b')]('ISPEECH_ASR_%s',_0x5ed3fa['toUpperCase']()),_0x5e7e8a[_0x5ed3fa]);}}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util['format'](_0xfcbf('0x156'),JSON['stringify'](_0x5e7e8a)));}}return _0x1eac17;};AGIVertices['prototype'][_0xfcbf('0x157')]=function(_0x2847b0){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x158'),_0x2847b0[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x2847b0['key'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x134'));}if(!this[_0xfcbf('0x89')](_0x2847b0[_0xfcbf('0x64')])){return this[_0xfcbf('0xe')]['noop']('no\x20text\x20configured');}this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')]('Trying\x20ispeech\x20TTS\x20%s',_0x2847b0[_0xfcbf('0x64')]));var _0x5004e2=this[_0xfcbf('0x84')][_0xfcbf('0xc4')](this,_0x2847b0);if(_0x5004e2){this['channel'][_0xfcbf('0xac')](util[_0xfcbf('0x2b')]('ispeech\x20%s\x20file\x20created',_0x5004e2));var _0x38c34a=this['channel']['streamFile'](_0x5004e2,_0x2847b0[_0xfcbf('0x13f')]);try{fs[_0xfcbf('0x109')](_0x5004e2+_0xfcbf('0x10a'));}catch(_0x761571){logger['error'](_0x761571);}return _0x38c34a;}return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x2847b0,_0xfcbf('0x159'));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x15a')]=function(_0x5a8f08){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x15b'),_0x5a8f08[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x5a8f08[_0xfcbf('0x15c')])){return this['channel'][_0xfcbf('0x2e')](_0x5a8f08,_0xfcbf('0x15d'));}logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x15e'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0x5a8f08[_0xfcbf('0x15c')]));var _0x2fcd5f=this[_0xfcbf('0x56')][_0xfcbf('0xc4')](this,_0x5a8f08[_0xfcbf('0x15c')]);if(_0x2fcd5f){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x15f'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0x5a8f08[_0xfcbf('0x15c')]));this[_0xfcbf('0xe')]['noop'](util[_0xfcbf('0x2b')](_0xfcbf('0x15f'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0x5a8f08[_0xfcbf('0x15c')]));return{'code':0xc8,'result':'success'};}else{logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x160'),this[_0xfcbf('0xe')]['callerid'],_0x5a8f08[_0xfcbf('0x15c')]));this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x160'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0x5a8f08[_0xfcbf('0x15c')]));return{'code':0xc8,'result':_0xfcbf('0x161')};}};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x162')]=function(_0x297a68){logger['info'](util[_0xfcbf('0x2b')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x297a68[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x297a68[_0xfcbf('0x15c')])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x297a68,_0xfcbf('0x15d'));}logger[_0xfcbf('0x30')](util['format'](_0xfcbf('0x15e'),this[_0xfcbf('0xe')]['callerid'],_0x297a68['findBy']));var _0x1a3da8=this['agentLogout'][_0xfcbf('0xc4')](this,_0x297a68[_0xfcbf('0x15c')]);if(_0x1a3da8){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x15f'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0x297a68[_0xfcbf('0x15c')]));this['channel']['noop'](util['format'](_0xfcbf('0x15f'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0x297a68[_0xfcbf('0x15c')]));return{'code':0xc8,'result':_0xfcbf('0x163')};}else{logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xfcbf('0x3c')],_0x297a68[_0xfcbf('0x15c')]));this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xfcbf('0x3c')],_0x297a68['findBy']));return{'code':0xc8,'result':_0xfcbf('0x161')};}};AGIVertices[_0xfcbf('0x11')]['math']=function(_0x4f6588){logger[_0xfcbf('0x30')](util['format'](_0xfcbf('0x164'),_0x4f6588['label']));if(!this[_0xfcbf('0x89')](_0x4f6588[_0xfcbf('0x165')])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x4f6588,_0xfcbf('0x166'));}this['channel'][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x167'),_0x4f6588[_0xfcbf('0x165')]));var _0x2bfdb2=eval(_0x4f6588[_0xfcbf('0x165')]);if(!this[_0xfcbf('0x89')](_0x4f6588[_0xfcbf('0xe0')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x573d2e=this[_0xfcbf('0xa5')][_0xfcbf('0xc4')](this,_0x4f6588[_0xfcbf('0xe0')]);if(!_0x573d2e){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x4f6588,_0xfcbf('0xe2'));}if(_[_0xfcbf('0xa1')](_0x2bfdb2)){var _0x52a562=this;_0x2bfdb2[_0xfcbf('0xe3')](function(_0x5b2a18,_0x5a809d){_0x52a562[_0xfcbf('0xe')][_0xfcbf('0xa2')](util[_0xfcbf('0x2b')](_0xfcbf('0x168'),_0x573d2e,_0x5a809d),_0x5b2a18);});return this[_0xfcbf('0xe')]['noop'](util[_0xfcbf('0x2b')](_0xfcbf('0x169'),_0x573d2e));}else{return this[_0xfcbf('0xe')]['setVariable'](_0x573d2e,_0x2bfdb2);}};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0xb')]=function(_0x442ffa){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x16a'),_0x442ffa['label']));if(_0x442ffa['retry']===0x0){return this[_0xfcbf('0xa8')](_0x442ffa);}_0x442ffa[_0xfcbf('0xa9')]-=0x1;if(!this[_0xfcbf('0x89')](_0x442ffa[_0xfcbf('0x118')])){return this['channel'][_0xfcbf('0x2e')](_0x442ffa,_0xfcbf('0x119'));}var _0x111c04=this['getSound'][_0xfcbf('0xc4')](this,_0x442ffa['file_id']);if(!_0x111c04){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x442ffa,_0xfcbf('0x11a'));}var _0x4dc831=this[_0xfcbf('0xe')][_0xfcbf('0x11b')](_0x111c04,_0x442ffa[_0xfcbf('0x11c')],_0x442ffa[_0xfcbf('0x16b')]);var _0x46111b=_0x4dc831['result'];if(_0x4dc831['result']===-0x1){this[_0xfcbf('0x37')]['sync'](this,_0x442ffa,'-1');return _0x4dc831;}else if(_0x4dc831[_0xfcbf('0xa6')]==='timeout'){_0x4dc831['result']=_0x4dc831[_0xfcbf('0xaf')][_0xfcbf('0x9e')]>0x0?_0x4dc831['result']:'t';}else if(_[_0xfcbf('0x45')](_0x4dc831['result'])){_0x4dc831[_0xfcbf('0xaf')]='#';_0x46111b='#';}if(!this['isConfigured'](_0x442ffa['variable_id'])){this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x4334e4=this[_0xfcbf('0xa5')][_0xfcbf('0xc4')](this,_0x442ffa[_0xfcbf('0xe0')]);if(!_0x4334e4){return this['channel'][_0xfcbf('0x2e')](_0x442ffa,_0xfcbf('0xe2'));}this[_0xfcbf('0xe')][_0xfcbf('0xa2')](_0x4334e4,_0x46111b);}this[_0xfcbf('0x37')][_0xfcbf('0xc4')](this,_0x442ffa,_0x46111b);return _0x4dc831;};AGIVertices[_0xfcbf('0x11')]['noop']=function(_0x18095b){logger['info'](util[_0xfcbf('0x2b')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x18095b[_0xfcbf('0x39')]));return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0x18095b[_0xfcbf('0x16c')]||_0x18095b[_0xfcbf('0x39')]);};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x16d')]=function(_0xb5fd06){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x16e'),_0xb5fd06['label']));if(!this[_0xfcbf('0x89')](_0xb5fd06['findBy'])){return this[_0xfcbf('0xe')]['error'](_0xb5fd06,_0xfcbf('0x15d'));}logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x15e'),this['channel'][_0xfcbf('0x3c')],_0xb5fd06[_0xfcbf('0x15c')]));var _0x2e2d7a=this[_0xfcbf('0x50')]['sync'](this,_0xb5fd06[_0xfcbf('0x16f')]);var _0x18a77e=this[_0xfcbf('0x52')][_0xfcbf('0xc4')](this,_0xb5fd06[_0xfcbf('0x15c')],_0x2e2d7a);if(_0x18a77e){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x15f'),this[_0xfcbf('0xe')]['callerid'],_0xb5fd06[_0xfcbf('0x15c')]));this[_0xfcbf('0xe')]['noop'](util[_0xfcbf('0x2b')](_0xfcbf('0x15f'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0xb5fd06['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xfcbf('0x30')](util['format'](_0xfcbf('0x160'),this['channel'][_0xfcbf('0x3c')],_0xb5fd06['findBy']));this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x15f'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0xb5fd06[_0xfcbf('0x15c')]));return{'code':0xc8,'result':_0xfcbf('0x161')};}};AGIVertices[_0xfcbf('0x11')]['playback']=function(_0x43ba92){logger['info'](util[_0xfcbf('0x2b')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x43ba92['label']));if(!this[_0xfcbf('0x89')](_0x43ba92['file_id'])){return this['channel'][_0xfcbf('0x2e')](_0x43ba92,'no\x20file\x20audio\x20selected');}var _0x4ff322=this[_0xfcbf('0x1f')][_0xfcbf('0xc4')](this,_0x43ba92[_0xfcbf('0x118')]);if(!_0x4ff322){return this['channel'][_0xfcbf('0x2e')](_0x43ba92,_0xfcbf('0x11a'));}var _0x34bf88=this[_0xfcbf('0xe')]['exec'](_0xfcbf('0x170'),[_0x4ff322,_0x43ba92['opts']]);if(_0x34bf88[_0xfcbf('0xaf')]===-0x1){return _0x34bf88;}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0xca'),_0xfcbf('0x170'),_0x4ff322));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x171')]=function(_0x16bafc){logger['info'](util[_0xfcbf('0x2b')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x16bafc['label']));if(!this[_0xfcbf('0x89')](_0x16bafc[_0xfcbf('0x172')])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x16bafc,_0xfcbf('0x173'));}var _0x588d35='';var _0x4c2c01=parseInt(_0x16bafc['queue_id'],0xa);if(isNaN(_0x4c2c01)){_0x588d35=_0x16bafc[_0xfcbf('0x172')];}else{_0x588d35=this[_0xfcbf('0x174')][_0xfcbf('0xc4')](this,_0x16bafc[_0xfcbf('0x172')]);if(!_0x588d35){return this[_0xfcbf('0xe')]['error'](_0x16bafc,_0xfcbf('0x175'));}}var _0x3510dc='';if(this[_0xfcbf('0x89')](_0x16bafc[_0xfcbf('0x118')])){var _0x120ef7=this['getSound']['sync'](this,_0x16bafc[_0xfcbf('0x118')]);if(_0x120ef7){_0x3510dc=_0x120ef7;}}this[_0xfcbf('0x37')][_0xfcbf('0xc4')](this,_0x16bafc,_0x588d35);if(_0x16bafc[_0xfcbf('0xef')]['indexOf']('x')<0x0){_0x16bafc[_0xfcbf('0xef')]+='x';}if(_0x16bafc[_0xfcbf('0xef')][_0xfcbf('0x176')]('X')<0x0){_0x16bafc[_0xfcbf('0xef')]+='X';}this[_0xfcbf('0xe')][_0xfcbf('0xa2')](_0xfcbf('0x177'),_0x588d35?_0x588d35['toLowerCase']():'');var _0x162e2f=this[_0xfcbf('0xe')]['exec'](_0xfcbf('0x178'),[_0x588d35,_0x16bafc[_0xfcbf('0xef')],_0x16bafc[_0xfcbf('0x73')],_0x3510dc,_0x16bafc[_0xfcbf('0x67')],_0x16bafc[_0xfcbf('0x7')],_0x16bafc[_0xfcbf('0x179')],_0x16bafc[_0xfcbf('0x17a')],'',_0x16bafc[_0xfcbf('0x17b')]]);if(_0x162e2f['result']===-0x1){return _0x162e2f;}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util['format']('Executed\x20command\x20%s\x20%s',_0xfcbf('0x178'),_0x588d35));};AGIVertices[_0xfcbf('0x11')]['record']=function(_0x5b871f){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x17c'),_0x5b871f[_0xfcbf('0x39')]));var _0x44342e=_0x5b871f[_0xfcbf('0x17d')]||_0xfcbf('0x154');var _0x362b5d=util['format'](_0xfcbf('0x17e'),this[_0xfcbf('0xe')][_0xfcbf('0x38')],rs['generate'](0x5));var _0x409bc2=util[_0xfcbf('0x2b')](_0xfcbf('0x17f'),FILES_PATH,_0x362b5d,_0x44342e);var _0x273fa2=util[_0xfcbf('0x2b')]('%s/recordings/%s',FILES_PATH,_0x362b5d);this[_0xfcbf('0x3d')][_0xfcbf('0xc4')](this,_0x5b871f,_0x362b5d,_0x409bc2);this[_0xfcbf('0xe')]['setVariable'](_0xfcbf('0x180'),_0x362b5d);logger[_0xfcbf('0x30')](_0xfcbf('0x181'),_0x273fa2,_0x44342e,_0x5b871f['escape_digits'],_0x5b871f[_0xfcbf('0x67')]);return this[_0xfcbf('0xe')][_0xfcbf('0x13e')](_0x273fa2,_0x44342e,_0x5b871f['escape_digits'],_0x5b871f[_0xfcbf('0x67')],undefined,!![]);};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x182')]=function(_0x79f870){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x183'),_0x79f870['label']));if(!this[_0xfcbf('0x89')](_0x79f870['url'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x184'));}var _0x861df9=this[_0xfcbf('0x66')]['sync'](this,_0x79f870);logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x185'),util[_0xfcbf('0x186')](_0x861df9,{'showHidden':![],'depth':null})));if(!this[_0xfcbf('0x89')](_0x79f870[_0xfcbf('0xe0')])){return this['channel']['noop'](_0xfcbf('0x187'));}var _0x18f064=this['getVariable']['sync'](this,_0x79f870[_0xfcbf('0xe0')]);if(!_0x18f064){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x79f870,_0xfcbf('0xe2'));}this[_0xfcbf('0xe')][_0xfcbf('0xa2')](util['format'](_0xfcbf('0x188'),_0x18f064),_0x861df9['statusCode']?_0x861df9[_0xfcbf('0x77')]:_0xfcbf('0x189'));this[_0xfcbf('0xe')][_0xfcbf('0xa2')](util['format']('%s_STATUS_MESSAGE',_0x18f064),_0x861df9[_0xfcbf('0x18a')]?_0x861df9[_0xfcbf('0x18a')]:'OK');if(_0x861df9[_0xfcbf('0x6c')]){try{this['saveRestApiResult'](_0x861df9[_0xfcbf('0x6c')],_0x18f064);}catch(_0x4b48f8){logger[_0xfcbf('0x2e')](util[_0xfcbf('0x2b')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x18f064));}}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')]('variable\x20%s\x20set',_0x18f064));};AGIVertices['prototype']['saydigits']=function(_0x34e7af){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x18b'),_0x34e7af[_0xfcbf('0x39')]));return this[_0xfcbf('0xe')][_0xfcbf('0x18c')](_0x34e7af[_0xfcbf('0x18d')][_0xfcbf('0x5b')](/\s+/g,''),_0x34e7af[_0xfcbf('0x18e')]);};AGIVertices['prototype']['saynumber']=function(_0x1b2b89){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x18f'),_0x1b2b89[_0xfcbf('0x39')]));return this['channel'][_0xfcbf('0x190')](_0x1b2b89[_0xfcbf('0x68')][_0xfcbf('0x5b')](/\s+/g,''),_0x1b2b89[_0xfcbf('0x18e')]);};AGIVertices['prototype'][_0xfcbf('0x191')]=function(_0x591033){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x192'),_0x591033[_0xfcbf('0x39')]));return this[_0xfcbf('0xe')][_0xfcbf('0x193')](_0x591033[_0xfcbf('0x64')],_0x591033[_0xfcbf('0x18e')]);};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x194')]=function(_0x840e2d){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x195'),_0x840e2d[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x840e2d[_0xfcbf('0x196')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x197'));}var _0x5375ed=this[_0xfcbf('0x22')][_0xfcbf('0xc4')](this,_0x840e2d[_0xfcbf('0x196')]);if(!_0x5375ed||!_0x5375ed[_0xfcbf('0x198')]){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x840e2d,_0xfcbf('0x199'));}var _0x54a274={'from':util[_0xfcbf('0x2b')](_0xfcbf('0x19a'),_0x5375ed[_0xfcbf('0x13')],_0x5375ed[_0xfcbf('0x19b')]||_0x5375ed[_0xfcbf('0x198')]['user']),'to':_0x840e2d['to']||'','cc':_0x840e2d['cc']||'','bcc':_0x840e2d[_0xfcbf('0x19c')]||'','subject':_0x840e2d[_0xfcbf('0x19d')],'html':_0x840e2d[_0xfcbf('0x64')],'text':_0x840e2d[_0xfcbf('0x64')]};var _0x41380e={'tls':{'rejectUnauthorized':![]}};if(_0x5375ed[_0xfcbf('0x198')]['service']){_0x41380e[_0xfcbf('0x19e')]=_0x5375ed['Smtp'][_0xfcbf('0x19e')];}else{_0x41380e[_0xfcbf('0x19f')]=_0x5375ed[_0xfcbf('0x198')]['host'];_0x41380e['port']=_0x5375ed[_0xfcbf('0x198')]['port'];_0x41380e[_0xfcbf('0x1a0')]=_0x5375ed[_0xfcbf('0x198')]['secure'];}if(_0x5375ed['Smtp'][_0xfcbf('0x1a1')]){_0x41380e[_0xfcbf('0x1a2')]={'user':_0x5375ed[_0xfcbf('0x198')]['user'],'pass':_0x5375ed[_0xfcbf('0x198')][_0xfcbf('0x1a3')]};}if(this[_0xfcbf('0x89')](_0x840e2d['template_id'])){}logger[_0xfcbf('0xe8')](_0xfcbf('0x1a4'),JSON[_0xfcbf('0x75')](_0x54a274));this[_0xfcbf('0x37')]['sync'](this,_0x840e2d,_0x840e2d[_0xfcbf('0x196')]);this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x1a5'),_0x5375ed['name']));this[_0xfcbf('0x24')]['sync'](this,_0x41380e,_0x54a274);return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x1a6'));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x1a7')]=function(_0x5e8af2){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x5e8af2[_0xfcbf('0x39')]));return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x1a8'));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x1a9')]=function(_0x1b4181){logger['info'](util[_0xfcbf('0x2b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x1b4181['label']));if(!this[_0xfcbf('0x89')](_0x1b4181[_0xfcbf('0x1aa')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x1ab'));}var _0x2aec34=this[_0xfcbf('0x34')][_0xfcbf('0xc4')](this,_0x1b4181[_0xfcbf('0x1aa')]);if(!_0x2aec34){return this[_0xfcbf('0xe')]['error'](_0x1b4181,_0xfcbf('0x1ac'));}var _0x1a30ca={'body':_0x1b4181['sms_text'],'phone':_0x1b4181['to']||'','SmsAccountId':_0x2aec34['id']};logger[_0xfcbf('0xe8')](_0xfcbf('0x1ad'),JSON[_0xfcbf('0x75')](_0x1a30ca));this[_0xfcbf('0x37')][_0xfcbf('0xc4')](this,_0x1b4181,_0x1b4181['sms_account_id']);this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x1ae'),_0x2aec34['name']));this[_0xfcbf('0x36')][_0xfcbf('0xc4')](this,_0x1a30ca);return this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x1af'));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x1b0')]=function(_0x3945f3){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x3945f3[_0xfcbf('0x39')]));if(!this['isConfigured'](_0x3945f3[_0xfcbf('0xe0')])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x3945f3,_0xfcbf('0x1b1'));}var _0x386787=this[_0xfcbf('0xa5')][_0xfcbf('0xc4')](this,_0x3945f3[_0xfcbf('0xe0')]);if(!_0x386787){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x3945f3,'no\x20variable\x20found');}return this[_0xfcbf('0xe')][_0xfcbf('0xa2')](_0x386787,_0x3945f3[_0xfcbf('0x1b2')]);};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x1b3')]=function(_0x3ea359){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x1b4'),_0x3ea359[_0xfcbf('0x39')]));this[_0xfcbf('0xe')][_0xfcbf('0xac')](_0xfcbf('0x1b5'));if(_0x3ea359[_0xfcbf('0xbd')]===_0xfcbf('0x1b6')){this[_0xfcbf('0xe')][_0xfcbf('0xac')]('Answer');return this[_0xfcbf('0xe')][_0xfcbf('0xbd')]();}return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xfcbf('0x1b7')]=function(_0x51be59){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x51be59[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x51be59[_0xfcbf('0x1b8')])){return this[_0xfcbf('0xe')]['error'](_0x51be59,_0xfcbf('0x1b9'));}var _0x2974df=this['getSquareProject'][_0xfcbf('0xc4')](this,_0x51be59[_0xfcbf('0x1b8')]);if(!this[_0xfcbf('0x89')](_0x2974df)){return this['channel']['error'](_0x51be59,util[_0xfcbf('0x2b')](_0xfcbf('0x1ba'),_0x51be59[_0xfcbf('0x1b8')]));}if(_0x2974df===this[_0xfcbf('0xe')]['arg_1']){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x51be59,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xfcbf('0x37')]['sync'](this,_0x51be59,_0x2974df);var _0x546781=this[_0xfcbf('0xe')][_0xfcbf('0x5a')](_0xfcbf('0x1bb'),util[_0xfcbf('0x2b')](_0xfcbf('0x1bc'),config['agi']['host']||_0xfcbf('0x1bd'),_0x2974df,this['channel'][_0xfcbf('0x3b')]));if(_0x546781['result']===-0x1){return _0x546781;}return this['channel'][_0xfcbf('0xac')](util['format'](_0xfcbf('0xca'),_0xfcbf('0x1bb'),_0x2974df));};AGIVertices[_0xfcbf('0x11')]['system']=function(_0x14a4b3){logger['info'](util[_0xfcbf('0x2b')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x14a4b3['label']));var _0x393bb5=this[_0xfcbf('0x59')][_0xfcbf('0xc4')](this,_0x14a4b3[_0xfcbf('0xbb')]);this[_0xfcbf('0x37')][_0xfcbf('0xc4')](this,_0x14a4b3,_0x14a4b3[_0xfcbf('0xbb')]);if(this['isConfigured'](_0x14a4b3[_0xfcbf('0xe0')])){var _0x5e2ed3=this[_0xfcbf('0xa5')][_0xfcbf('0xc4')](this,_0x14a4b3['variable_id']);if(_0x5e2ed3){this['channel']['setVariable'](_0x5e2ed3,_0x393bb5);return this['channel'][_0xfcbf('0xac')](util[_0xfcbf('0x2b')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x14a4b3[_0xfcbf('0xbb')],_0x5e2ed3));}}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x14a4b3['command']));};AGIVertices[_0xfcbf('0x11')]['google_cloud_tts']=function(_0x2606e8){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x1be'),_0x2606e8['label']));_0x2606e8['text']=_0x2606e8[_0xfcbf('0x64')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x2606e8[_0xfcbf('0x5d')])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20apiKey\x20configured');}if(!this[_0xfcbf('0x89')](_0x2606e8[_0xfcbf('0x64')])){return this['channel'][_0xfcbf('0xac')](_0xfcbf('0xad'));}this['channel'][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x1bf'),_0x2606e8[_0xfcbf('0x64')]));var _0xccabb2=this[_0xfcbf('0x5c')][_0xfcbf('0xc4')](this,_0x2606e8);if(_0xccabb2){this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x1c0'),_0xccabb2));var _0x2e9ba7=this[_0xfcbf('0xe')][_0xfcbf('0x1c1')](_0xccabb2);try{fs[_0xfcbf('0x109')](_0xccabb2+'.wav');}catch(_0xdb20fe){logger[_0xfcbf('0x2e')](_0xdb20fe);}return _0x2e9ba7;}return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x2606e8,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['tts']=function(_0x3f2008){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x1c2'),_0x3f2008[_0xfcbf('0x39')]));_0x3f2008[_0xfcbf('0x64')]=_0x3f2008[_0xfcbf('0x64')][_0xfcbf('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3f2008['text'])){return this[_0xfcbf('0xe')][_0xfcbf('0xac')]('no\x20text\x20configured');}this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')]('Trying\x20Google\x20TTS\x20%s',_0x3f2008[_0xfcbf('0x64')]));var _0x15a7f4=this[_0xfcbf('0x63')]['sync'](this,_0x3f2008);if(_0x15a7f4){this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x1c3'),_0x15a7f4));var _0x596173=this[_0xfcbf('0xe')][_0xfcbf('0x1c1')](_0x15a7f4);try{fs['unlink'](_0x15a7f4+_0xfcbf('0x10a'));}catch(_0x173513){logger[_0xfcbf('0x2e')](_0x173513);}return _0x596173;}return this['channel'][_0xfcbf('0x2e')](_0x3f2008,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x1c4')]=function(_0x3d2b36){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x1c5'),_0x3d2b36[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x3d2b36[_0xfcbf('0x15c')])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x3d2b36,_0xfcbf('0x15d'));}logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x15e'),this['channel'][_0xfcbf('0x3c')],_0x3d2b36[_0xfcbf('0x15c')]));var _0xa34dca=this[_0xfcbf('0x54')][_0xfcbf('0xc4')](this,_0x3d2b36['findBy']);if(_0xa34dca){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x15f'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0x3d2b36[_0xfcbf('0x15c')]));this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x15f'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0x3d2b36[_0xfcbf('0x15c')]));return{'code':0xc8,'result':'success'};}else{logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x160'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0x3d2b36[_0xfcbf('0x15c')]));this[_0xfcbf('0xe')][_0xfcbf('0xac')](util[_0xfcbf('0x2b')](_0xfcbf('0x160'),this[_0xfcbf('0xe')][_0xfcbf('0x3c')],_0x3d2b36[_0xfcbf('0x15c')]));return{'code':0xc8,'result':_0xfcbf('0x161')};}};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x1c6')]=function(_0x5d4e12){logger[_0xfcbf('0x30')](util[_0xfcbf('0x2b')](_0xfcbf('0x1c7'),_0x5d4e12['label']));var _0x409765=this[_0xfcbf('0xe')]['exec']('VOICEMAIL',[_0x5d4e12['mailbox'],_0x5d4e12[_0xfcbf('0x7a')]]);if(_0x409765[_0xfcbf('0xaf')]===-0x1){return _0x409765;}return this[_0xfcbf('0xe')][_0xfcbf('0xac')](util['format'](_0xfcbf('0xca'),_0xfcbf('0x1c8'),_0x5d4e12[_0xfcbf('0x1c9')]));};AGIVertices[_0xfcbf('0x11')][_0xfcbf('0x1ca')]=function(_0x575d32){logger['info'](util[_0xfcbf('0x2b')](_0xfcbf('0x1cb'),_0x575d32[_0xfcbf('0x39')]));if(!this[_0xfcbf('0x89')](_0x575d32[_0xfcbf('0xe0')])){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x575d32,_0xfcbf('0x1b1'));}var _0x1c333d=this[_0xfcbf('0xa5')][_0xfcbf('0xc4')](this,_0x575d32['variable_id']);if(!_0x1c333d){return this[_0xfcbf('0xe')][_0xfcbf('0x2e')](_0x575d32,'no\x20variable\x20found');}var _0x1dccf7=this[_0xfcbf('0xe')][_0xfcbf('0xa5')](_0x1c333d);return{'code':0xc8,'result':_0x1dccf7['extra']?_0x1dccf7[_0xfcbf('0xa6')]:'-'};};String[_0xfcbf('0x11')]['replaceAll']=function(_0x4fd823,_0x359500){return this['split'](_0x4fd823)[_0xfcbf('0x1cc')](_0x359500);};module[_0xfcbf('0x1cd')]=AGIVertices;
\ No newline at end of file
index fd1f72e..992ae79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x268f=['[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[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]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','syncHangupRequest','hangup','bind','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','updateAcw','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error'];(function(_0x102470,_0x199a01){var _0x558eaa=function(_0x12c74a){while(--_0x12c74a){_0x102470['push'](_0x102470['shift']());}};_0x558eaa(++_0x199a01);}(_0x268f,0x78));var _0xf268=function(_0x43dc5d,_0x1bf79b){_0x43dc5d=_0x43dc5d-0x0;var _0x277cc3=_0x268f[_0x43dc5d];return _0x277cc3;};'use strict';var util=require(_0xf268('0x0'));var _=require(_0xf268('0x1'));var moment=require(_0xf268('0x2'));var ami=require(_0xf268('0x3'));var logger=require('../../../config/logger')(_0xf268('0x4'));var RpcUser=require(_0xf268('0x5'));var RpcVoiceAgentReport=require(_0xf268('0x6'));function Acw(_0xf0e635){this[_0xf268('0x7')]=_0xf0e635[_0xf268('0x7')];this[_0xf268('0x8')]=_0xf0e635[_0xf268('0x8')];this['timers']=_0xf0e635[_0xf268('0x9')];this[_0xf268('0xa')]={};ami['on'](_0xf268('0xb'),this[_0xf268('0xc')]['bind'](this));ami['on']('hanguprequest',this[_0xf268('0xd')]['bind'](this));ami['on'](_0xf268('0xe'),this['syncHangup'][_0xf268('0xf')](this));ami['on'](_0xf268('0x10'),this[_0xf268('0x11')]['bind'](this));ami['on']('attendedtransfer',this[_0xf268('0x12')][_0xf268('0xf')](this));ami['on'](_0xf268('0x13'),this[_0xf268('0x14')][_0xf268('0xf')](this));ami['on'](_0xf268('0x15'),this[_0xf268('0x16')][_0xf268('0xf')](this));}function getDiff(_0x9cd9fd){var _0x1fbe25=moment()[_0xf268('0x17')](0x0);var _0x539700=moment(_0x9cd9fd)[_0xf268('0x17')](0x0);return _0x1fbe25[_0xf268('0x18')](_0x539700,_0xf268('0x19'));}Acw[_0xf268('0x1a')][_0xf268('0x1b')]=function(_0x24e22f){try{var _0x201dad=this;var _0x10294a=this[_0xf268('0xa')][_0x24e22f][_0xf268('0x1c')];var _0x4289f3=this['channels'][_0x24e22f][_0xf268('0x1d')];var _0xfc18e7=this[_0xf268('0x7')][_0x4289f3];var _0xc14772=![];var _0x3cb8f9=_0xf268('0x1e');if(_0xfc18e7[_0xf268('0x1f')]){if(_0xfc18e7[_0xf268('0x20')][_0xf268('0x21')]){_0xc14772=!![];_0x3cb8f9=_0xfc18e7[_0xf268('0x20')][_0xf268('0x21')];}}ami[_0xf268('0x22')]({'action':_0xf268('0x23'),'interface':_0x10294a,'paused':!![],'reason':_0x3cb8f9})[_0xf268('0x24')](function(_0x28c371){if(_0x201dad[_0xf268('0x8')][_0x10294a]){return RpcUser['getAgent'](_0x201dad['agents'][_0x10294a]['id'])[_0xf268('0x24')](function(_0x3002bd){if(_0x3002bd&&!_0x3002bd['voicePause']){logger['info'](_0xf268('0x25'),_0x24e22f,_0x10294a,_0x4289f3);var _0x377e14=_0x201dad[_0xf268('0xa')][_0x24e22f][_0xf268('0x26')]&&_0x201dad['channels'][_0x24e22f]['destlinkedid']?_0x201dad[_0xf268('0xa')][_0x24e22f][_0xf268('0x27')]:_0x24e22f;return RpcUser['savePause'](_0x201dad['agents'][_0x10294a],_0x3cb8f9,_0x377e14)[_0xf268('0x24')](function(_0x88cd7b){if(!_0xc14772){_0x201dad[_0xf268('0x9')][_0x10294a]={};logger[_0xf268('0x28')](_0xf268('0x29'),_0x24e22f,_0x201dad[_0xf268('0x7')][_0x4289f3][_0xf268('0x2a')],_0x10294a,_0x4289f3);_0x201dad[_0xf268('0x9')][_0x10294a]['timer']=setTimeout(_0x201dad[_0xf268('0x2b')][_0xf268('0xf')](_0x201dad,_0x10294a),_0x201dad[_0xf268('0x7')][_0x4289f3][_0xf268('0x2a')]*0x3e8);_0x201dad[_0xf268('0x9')][_0x10294a][_0xf268('0x2c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x201dad[_0xf268('0x9')][_0x10294a]['uniqueid']=_0x24e22f;_0x201dad[_0xf268('0x9')][_0x10294a][_0xf268('0x1d')]=_0x4289f3;_0x201dad[_0xf268('0x9')][_0x10294a][_0xf268('0x2d')]=function(){var _0x23cfe6=getDiff(_0x201dad[_0xf268('0x9')][_0x10294a]['lastPauseAt']);clearTimeout(_0x201dad[_0xf268('0x9')][_0x10294a][_0xf268('0x2e')]);_0x201dad[_0xf268('0x9')][_0x10294a]['timer']=![];RpcVoiceAgentReport[_0xf268('0x2f')]({'acwtime':_0x23cfe6},_0x201dad[_0xf268('0x9')][_0x10294a][_0xf268('0x30')],_0x10294a)[_0xf268('0x24')](function(_0x521c41){logger['info'](_0xf268('0x31'),_0x24e22f,_0x23cfe6,_0x521c41);})[_0xf268('0x32')](function(_0x20d6b6){logger[_0xf268('0x33')](_0xf268('0x34'),_0x24e22f,_0x20d6b6);});delete _0x201dad['timers'][_0x10294a];};}});}else{logger[_0xf268('0x28')](_0xf268('0x35'),_0x24e22f,_0x10294a,_0x4289f3);}});}})[_0xf268('0x32')](function(_0x446619){logger[_0xf268('0x33')](_0xf268('0x29'),_0x24e22f,_0x201dad[_0xf268('0x7')][_0x4289f3][_0xf268('0x2a')],_0x10294a,_0x4289f3);})['finally'](function(){delete _0x201dad[_0xf268('0xa')][_0x24e22f];});}catch(_0x1a9bcc){logger[_0xf268('0x33')](_0xf268('0x36'),_0x1a9bcc[_0xf268('0x37')]);}};Acw['prototype']['stopAcw']=function(_0x12a24c){try{var _0x1f7b30=this;if(_0x1f7b30[_0xf268('0x9')][_0x12a24c]){_0x1f7b30[_0xf268('0x9')][_0x12a24c][_0xf268('0x2e')]=![];var _0x2dab85=_0x1f7b30[_0xf268('0x9')][_0x12a24c][_0xf268('0x30')];var _0x33c269=_0x1f7b30[_0xf268('0x9')][_0x12a24c][_0xf268('0x1d')];var _0x16b093=_0x1f7b30['voiceQueues'][_0x33c269][_0xf268('0x2a')];logger[_0xf268('0x28')]('[%s][TIMER][STOP][AGENT:%s]',_0x2dab85,_0x12a24c);RpcUser['saveUnpause'](this['agents'][_0x12a24c]);RpcVoiceAgentReport[_0xf268('0x2f')]({'acwtime':_0x16b093,'agentacw':!![]},_0x2dab85,_0x12a24c)[_0xf268('0x24')](function(_0x37ab35){logger[_0xf268('0x28')](_0xf268('0x31'),_0x2dab85,_0x16b093,_0x37ab35);})[_0xf268('0x32')](function(_0xcc3e55){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x2dab85,_0xcc3e55);});}else{logger[_0xf268('0x33')](_0xf268('0x38'),_0x12a24c);if(_0x1f7b30['timers']){logger[_0xf268('0x28')](_0xf268('0x39'),JSON[_0xf268('0x3a')](_0x1f7b30[_0xf268('0x9')]));}}}catch(_0xca67ba){logger[_0xf268('0x33')](_0xf268('0x3b'),_0xca67ba[_0xf268('0x37')]);}};Acw[_0xf268('0x1a')][_0xf268('0xc')]=function(_0x1acbe0){try{if(this['voiceQueues'][_0x1acbe0[_0xf268('0x1d')]]&&(this[_0xf268('0x7')][_0x1acbe0[_0xf268('0x1d')]][_0xf268('0x4')]||this[_0xf268('0x7')][_0x1acbe0[_0xf268('0x1d')]][_0xf268('0x1f')])){if(this[_0xf268('0x8')][_0x1acbe0[_0xf268('0x1c')]]){this[_0xf268('0xa')][_0x1acbe0[_0xf268('0x30')]]={'queue':_0x1acbe0[_0xf268('0x1d')],'interface':_0x1acbe0[_0xf268('0x1c')],'destlinkedid':_0x1acbe0[_0xf268('0x27')]};}}}catch(_0xa69926){logger[_0xf268('0x33')](_0xf268('0x3c'),_0xa69926[_0xf268('0x37')]);}};Acw[_0xf268('0x1a')][_0xf268('0x16')]=function(_0x4ee5ba){try{if(this[_0xf268('0x7')][_0x4ee5ba[_0xf268('0x1d')]]&&(this[_0xf268('0x7')][_0x4ee5ba[_0xf268('0x1d')]][_0xf268('0x4')]||this['voiceQueues'][_0x4ee5ba[_0xf268('0x1d')]][_0xf268('0x1f')])){if(this[_0xf268('0x8')][_0x4ee5ba[_0xf268('0x1c')]]){this[_0xf268('0xa')][_0x4ee5ba['uniqueid']]={'queue':_0x4ee5ba['queue'],'interface':_0x4ee5ba['interface']};}}}catch(_0x18795c){logger['error'](_0xf268('0x3d'),_0x18795c[_0xf268('0x37')]);}};Acw['prototype'][_0xf268('0xd')]=function(_0x22ad10){try{if(this[_0xf268('0xa')][_0x22ad10['uniqueid']]&&_[_0xf268('0x3e')](this[_0xf268('0xa')][_0x22ad10[_0xf268('0x30')]]['attended'])){logger[_0xf268('0x28')](_0xf268('0x3f'),_0x22ad10[_0xf268('0x30')]);this[_0xf268('0x1b')](_0x22ad10[_0xf268('0x30')]);}else if(this[_0xf268('0xa')][_0x22ad10[_0xf268('0x40')]]&&_['isUndefined'](this[_0xf268('0xa')][_0x22ad10[_0xf268('0x40')]][_0xf268('0x26')])){logger[_0xf268('0x28')](_0xf268('0x41'),_0x22ad10[_0xf268('0x40')]);this['startAcw'](_0x22ad10[_0xf268('0x40')]);}}catch(_0x1ece88){logger[_0xf268('0x33')](_0xf268('0x42'),_0x1ece88[_0xf268('0x37')]);}};Acw['prototype'][_0xf268('0x43')]=function(_0x3ea0e3){try{if(this[_0xf268('0xa')][_0x3ea0e3[_0xf268('0x30')]]&&this['channels'][_0x3ea0e3['uniqueid']][_0xf268('0x26')]){logger[_0xf268('0x28')](_0xf268('0x44'),_0x3ea0e3[_0xf268('0x30')]);this['startAcw'](_0x3ea0e3['uniqueid']);}else if(this['channels'][_0x3ea0e3[_0xf268('0x40')]]&&this['channels'][_0x3ea0e3[_0xf268('0x40')]][_0xf268('0x26')]){logger[_0xf268('0x28')](_0xf268('0x45'),_0x3ea0e3['linkedid']);this[_0xf268('0x1b')](_0x3ea0e3[_0xf268('0x40')]);}}catch(_0xeb10c9){logger[_0xf268('0x33')](_0xf268('0x46'),_0xeb10c9[_0xf268('0x37')]);}};Acw[_0xf268('0x1a')][_0xf268('0x12')]=function(_0x173c99){try{if(!_[_0xf268('0x47')](this[_0xf268('0xa')][_0x173c99[_0xf268('0x48')]])){this[_0xf268('0x1b')](_0x173c99[_0xf268('0x48')]);if(this[_0xf268('0xa')][_0x173c99['secondtransfereruniqueid']]){this['channels'][_0x173c99['secondtransfereruniqueid']][_0xf268('0x26')]=!![];this[_0xf268('0xa')][_0x173c99[_0xf268('0x49')]]=this[_0xf268('0xa')][_0x173c99['secondtransfereruniqueid']];delete this[_0xf268('0xa')][_0x173c99['secondtransfereruniqueid']];}}else if(!_[_0xf268('0x47')](this[_0xf268('0xa')][_0x173c99[_0xf268('0x49')]])){this[_0xf268('0x1b')](_0x173c99['transfertargetuniqueid']);if(this[_0xf268('0xa')][_0x173c99[_0xf268('0x4a')]]){this['channels'][_0x173c99[_0xf268('0x4a')]][_0xf268('0x26')]=!![];this['channels'][_0x173c99[_0xf268('0x48')]]=this[_0xf268('0xa')][_0x173c99[_0xf268('0x4a')]];delete this['channels'][_0x173c99[_0xf268('0x4a')]];}}}catch(_0x709534){logger[_0xf268('0x33')](_0xf268('0x4b'),_0x709534[_0xf268('0x37')]);}};Acw[_0xf268('0x1a')]['syncBlindTransfer']=function(_0x3660ee){try{if(this[_0xf268('0xa')][_0x3660ee[_0xf268('0x4c')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xf268('0x3a')](_0x3660ee[_0xf268('0x4c')]));this[_0xf268('0x1b')](_0x3660ee[_0xf268('0x4c')]);}else if(this[_0xf268('0xa')][_0x3660ee[_0xf268('0x4d')]]){logger[_0xf268('0x28')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xf268('0x3a')](_0x3660ee['transfererlinkedid']));this['startAcw'](_0x3660ee[_0xf268('0x4d')]);}}catch(_0x4b21bc){logger[_0xf268('0x33')](_0xf268('0x4e'),_0x4b21bc[_0xf268('0x37')]);}};Acw[_0xf268('0x1a')][_0xf268('0x11')]=function(_0x57abb8){try{if(this[_0xf268('0x7')][_0x57abb8[_0xf268('0x1d')]]&&this[_0xf268('0x7')][_0x57abb8[_0xf268('0x1d')]][_0xf268('0x4f')]===_0xf268('0x50')){if(this[_0xf268('0x8')][_0x57abb8['interface']]){logger['info'](_0xf268('0x51'),_0x57abb8[_0xf268('0x30')],_0x57abb8[_0xf268('0x1c')],_0x57abb8['queue']);return RpcUser[_0xf268('0x52')](this['agents'][_0x57abb8['interface']],_0xf268('0x53'),_0x57abb8['uniqueid']);}}}catch(_0x3bcb21){logger['error'](_0xf268('0x54'),_0x3bcb21[_0xf268('0x37')]);}};module[_0xf268('0x55')]=Acw;
\ No newline at end of file
+var _0xdb22=['../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','interface','channels','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','prototype','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','acw','../rpc/user'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xdb22,0x16e));var _0x2db2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xdb22[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0x2db2('0x0'));var _=require(_0x2db2('0x1'));var moment=require('moment');var ami=require(_0x2db2('0x2'));var logger=require(_0x2db2('0x3'))(_0x2db2('0x4'));var RpcUser=require(_0x2db2('0x5'));var RpcVoiceAgentReport=require(_0x2db2('0x6'));function Acw(_0x57e26b){this[_0x2db2('0x7')]=_0x57e26b[_0x2db2('0x7')];this[_0x2db2('0x8')]=_0x57e26b[_0x2db2('0x8')];this[_0x2db2('0x9')]=_0x57e26b[_0x2db2('0x9')];this['channels']={};ami['on'](_0x2db2('0xa'),this[_0x2db2('0xb')][_0x2db2('0xc')](this));ami['on'](_0x2db2('0xd'),this[_0x2db2('0xe')][_0x2db2('0xc')](this));ami['on'](_0x2db2('0xf'),this[_0x2db2('0x10')][_0x2db2('0xc')](this));ami['on'](_0x2db2('0x11'),this[_0x2db2('0x12')]['bind'](this));ami['on'](_0x2db2('0x13'),this[_0x2db2('0x14')]['bind'](this));ami['on'](_0x2db2('0x15'),this[_0x2db2('0x16')][_0x2db2('0xc')](this));ami['on'](_0x2db2('0x17'),this['syncAgentConnectPreview'][_0x2db2('0xc')](this));}function getDiff(_0x12cb49){var _0x1b905e=moment()[_0x2db2('0x18')](0x0);var _0x3be669=moment(_0x12cb49)[_0x2db2('0x18')](0x0);return _0x1b905e[_0x2db2('0x19')](_0x3be669,_0x2db2('0x1a'));}Acw['prototype']['startAcw']=function(_0x12fcf8){try{var _0x17bee7=this;var _0x30da5a=this['channels'][_0x12fcf8][_0x2db2('0x1b')];var _0x2942a9=this[_0x2db2('0x1c')][_0x12fcf8][_0x2db2('0x1d')];var _0xce715c=this[_0x2db2('0x7')][_0x2942a9];var _0x1688ef=![];var _0x168ab3=_0x2db2('0x1e');if(_0xce715c[_0x2db2('0x1f')]){if(_0xce715c[_0x2db2('0x20')][_0x2db2('0x21')]){_0x1688ef=!![];_0x168ab3=_0xce715c[_0x2db2('0x20')][_0x2db2('0x21')];}}ami[_0x2db2('0x22')]({'action':_0x2db2('0x23'),'interface':_0x30da5a,'paused':!![],'reason':_0x168ab3})[_0x2db2('0x24')](function(_0x3505e5){if(_0x17bee7[_0x2db2('0x8')][_0x30da5a]){return RpcUser[_0x2db2('0x25')](_0x17bee7[_0x2db2('0x8')][_0x30da5a]['id'])['then'](function(_0x1e4852){if(_0x1e4852&&!_0x1e4852[_0x2db2('0x26')]){logger[_0x2db2('0x27')](_0x2db2('0x28'),_0x12fcf8,_0x30da5a,_0x2942a9);var _0x43158d=_0x17bee7['channels'][_0x12fcf8][_0x2db2('0x29')]&&_0x17bee7['channels'][_0x12fcf8][_0x2db2('0x2a')]?_0x17bee7[_0x2db2('0x1c')][_0x12fcf8][_0x2db2('0x2a')]:_0x12fcf8;return RpcUser[_0x2db2('0x2b')](_0x17bee7['agents'][_0x30da5a],_0x168ab3,_0x43158d)['then'](function(_0x1a424d){if(!_0x1688ef){_0x17bee7['timers'][_0x30da5a]={};logger['info'](_0x2db2('0x2c'),_0x12fcf8,_0x17bee7[_0x2db2('0x7')][_0x2942a9][_0x2db2('0x2d')],_0x30da5a,_0x2942a9);_0x17bee7[_0x2db2('0x9')][_0x30da5a][_0x2db2('0x2e')]=setTimeout(_0x17bee7[_0x2db2('0x2f')][_0x2db2('0xc')](_0x17bee7,_0x30da5a),_0x17bee7[_0x2db2('0x7')][_0x2942a9][_0x2db2('0x2d')]*0x3e8);_0x17bee7[_0x2db2('0x9')][_0x30da5a][_0x2db2('0x30')]=moment()[_0x2db2('0x31')](_0x2db2('0x32'));_0x17bee7[_0x2db2('0x9')][_0x30da5a][_0x2db2('0x33')]=_0x12fcf8;_0x17bee7[_0x2db2('0x9')][_0x30da5a][_0x2db2('0x1d')]=_0x2942a9;_0x17bee7[_0x2db2('0x9')][_0x30da5a][_0x2db2('0x34')]=function(){var _0x499a79=getDiff(_0x17bee7[_0x2db2('0x9')][_0x30da5a]['lastPauseAt']);clearTimeout(_0x17bee7[_0x2db2('0x9')][_0x30da5a][_0x2db2('0x2e')]);_0x17bee7['timers'][_0x30da5a][_0x2db2('0x2e')]=![];RpcVoiceAgentReport[_0x2db2('0x35')]({'acwtime':_0x499a79},_0x17bee7[_0x2db2('0x9')][_0x30da5a][_0x2db2('0x33')],_0x30da5a)[_0x2db2('0x24')](function(_0xac85ac){logger[_0x2db2('0x27')](_0x2db2('0x36'),_0x12fcf8,_0x499a79,_0xac85ac);})[_0x2db2('0x37')](function(_0x1134c8){logger['error'](_0x2db2('0x38'),_0x12fcf8,_0x1134c8);});delete _0x17bee7['timers'][_0x30da5a];};}});}else{logger[_0x2db2('0x27')](_0x2db2('0x39'),_0x12fcf8,_0x30da5a,_0x2942a9);}});}})[_0x2db2('0x37')](function(_0x192dc3){logger[_0x2db2('0x3a')](_0x2db2('0x2c'),_0x12fcf8,_0x17bee7[_0x2db2('0x7')][_0x2942a9][_0x2db2('0x2d')],_0x30da5a,_0x2942a9);})[_0x2db2('0x3b')](function(){delete _0x17bee7['channels'][_0x12fcf8];});}catch(_0x4cc1cf){logger[_0x2db2('0x3a')](_0x2db2('0x3c'),_0x4cc1cf['message']);}};Acw[_0x2db2('0x3d')][_0x2db2('0x2f')]=function(_0x10774e){try{var _0x4cec14=this;if(_0x4cec14[_0x2db2('0x9')][_0x10774e]){_0x4cec14[_0x2db2('0x9')][_0x10774e][_0x2db2('0x2e')]=![];var _0x2b0e74=_0x4cec14[_0x2db2('0x9')][_0x10774e][_0x2db2('0x33')];var _0x4472e8=_0x4cec14['timers'][_0x10774e][_0x2db2('0x1d')];var _0xd546fe=_0x4cec14[_0x2db2('0x7')][_0x4472e8][_0x2db2('0x2d')];logger[_0x2db2('0x27')]('[%s][TIMER][STOP][AGENT:%s]',_0x2b0e74,_0x10774e);RpcUser[_0x2db2('0x3e')](this[_0x2db2('0x8')][_0x10774e]);RpcVoiceAgentReport[_0x2db2('0x35')]({'acwtime':_0xd546fe,'agentacw':!![]},_0x2b0e74,_0x10774e)['then'](function(_0x2f91ea){logger['info'](_0x2db2('0x36'),_0x2b0e74,_0xd546fe,_0x2f91ea);})[_0x2db2('0x37')](function(_0x5176d7){logger['error'](_0x2db2('0x38'),_0x2b0e74,_0x5176d7);});}else{logger['error'](_0x2db2('0x3f'),_0x10774e);if(_0x4cec14[_0x2db2('0x9')]){logger['info'](_0x2db2('0x40'),JSON[_0x2db2('0x41')](_0x4cec14[_0x2db2('0x9')]));}}}catch(_0x2de3f1){logger[_0x2db2('0x3a')](_0x2db2('0x42'),_0x2de3f1[_0x2db2('0x43')]);}};Acw['prototype'][_0x2db2('0xb')]=function(_0x1f42f5){try{if(this[_0x2db2('0x7')][_0x1f42f5['queue']]&&(this[_0x2db2('0x7')][_0x1f42f5[_0x2db2('0x1d')]][_0x2db2('0x4')]||this[_0x2db2('0x7')][_0x1f42f5[_0x2db2('0x1d')]]['mandatoryDisposition'])){if(this[_0x2db2('0x8')][_0x1f42f5[_0x2db2('0x1b')]]){this[_0x2db2('0x1c')][_0x1f42f5[_0x2db2('0x33')]]={'queue':_0x1f42f5[_0x2db2('0x1d')],'interface':_0x1f42f5['interface'],'destlinkedid':_0x1f42f5['destlinkedid']};}}}catch(_0x4b6400){logger[_0x2db2('0x3a')](_0x2db2('0x44'),_0x4b6400['message']);}};Acw[_0x2db2('0x3d')][_0x2db2('0x45')]=function(_0x1075a4){try{if(this['voiceQueues'][_0x1075a4['queue']]&&(this[_0x2db2('0x7')][_0x1075a4['queue']][_0x2db2('0x4')]||this[_0x2db2('0x7')][_0x1075a4['queue']]['mandatoryDisposition'])){if(this['agents'][_0x1075a4[_0x2db2('0x1b')]]){this[_0x2db2('0x1c')][_0x1075a4[_0x2db2('0x33')]]={'queue':_0x1075a4[_0x2db2('0x1d')],'interface':_0x1075a4['interface']};}}}catch(_0x156720){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x156720['message']);}};Acw[_0x2db2('0x3d')]['syncHangupRequest']=function(_0x40fae2){try{if(this['channels'][_0x40fae2[_0x2db2('0x33')]]&&_[_0x2db2('0x46')](this[_0x2db2('0x1c')][_0x40fae2[_0x2db2('0x33')]]['attended'])){logger[_0x2db2('0x27')](_0x2db2('0x47'),_0x40fae2[_0x2db2('0x33')]);this[_0x2db2('0x48')](_0x40fae2[_0x2db2('0x33')]);}else if(this[_0x2db2('0x1c')][_0x40fae2[_0x2db2('0x49')]]&&_['isUndefined'](this[_0x2db2('0x1c')][_0x40fae2['linkedid']][_0x2db2('0x29')])){logger[_0x2db2('0x27')](_0x2db2('0x4a'),_0x40fae2[_0x2db2('0x49')]);this['startAcw'](_0x40fae2[_0x2db2('0x49')]);}}catch(_0x3521e2){logger[_0x2db2('0x3a')](_0x2db2('0x4b'),_0x3521e2[_0x2db2('0x43')]);}};Acw[_0x2db2('0x3d')]['syncHangup']=function(_0x40608e){try{if(this[_0x2db2('0x1c')][_0x40608e[_0x2db2('0x33')]]&&this['channels'][_0x40608e[_0x2db2('0x33')]][_0x2db2('0x29')]){logger[_0x2db2('0x27')](_0x2db2('0x4c'),_0x40608e[_0x2db2('0x33')]);this['startAcw'](_0x40608e[_0x2db2('0x33')]);}else if(this[_0x2db2('0x1c')][_0x40608e['linkedid']]&&this[_0x2db2('0x1c')][_0x40608e['linkedid']][_0x2db2('0x29')]){logger[_0x2db2('0x27')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x40608e[_0x2db2('0x49')]);this[_0x2db2('0x48')](_0x40608e[_0x2db2('0x49')]);}}catch(_0xc09c95){logger[_0x2db2('0x3a')]('[ACW][syncHangup]\x20%s',_0xc09c95[_0x2db2('0x43')]);}};Acw[_0x2db2('0x3d')][_0x2db2('0x14')]=function(_0x30ed3b){try{if(!_['isNil'](this[_0x2db2('0x1c')][_0x30ed3b[_0x2db2('0x4d')]])){this[_0x2db2('0x48')](_0x30ed3b[_0x2db2('0x4d')]);if(this[_0x2db2('0x1c')][_0x30ed3b[_0x2db2('0x4e')]]){this[_0x2db2('0x1c')][_0x30ed3b[_0x2db2('0x4e')]]['attended']=!![];this[_0x2db2('0x1c')][_0x30ed3b['transfertargetuniqueid']]=this[_0x2db2('0x1c')][_0x30ed3b[_0x2db2('0x4e')]];delete this[_0x2db2('0x1c')][_0x30ed3b['secondtransfereruniqueid']];}}else if(!_[_0x2db2('0x4f')](this['channels'][_0x30ed3b[_0x2db2('0x50')]])){this[_0x2db2('0x48')](_0x30ed3b[_0x2db2('0x50')]);if(this[_0x2db2('0x1c')][_0x30ed3b[_0x2db2('0x51')]]){this[_0x2db2('0x1c')][_0x30ed3b['origtransfereruniqueid']][_0x2db2('0x29')]=!![];this[_0x2db2('0x1c')][_0x30ed3b[_0x2db2('0x4d')]]=this[_0x2db2('0x1c')][_0x30ed3b[_0x2db2('0x51')]];delete this['channels'][_0x30ed3b[_0x2db2('0x51')]];}}}catch(_0x5268af){logger['error'](_0x2db2('0x52'),_0x5268af['message']);}};Acw[_0x2db2('0x3d')]['syncBlindTransfer']=function(_0x1e0250){try{if(this[_0x2db2('0x1c')][_0x1e0250['transfereruniqueid']]){logger[_0x2db2('0x27')](_0x2db2('0x53'),JSON['stringify'](_0x1e0250[_0x2db2('0x54')]));this[_0x2db2('0x48')](_0x1e0250['transfereruniqueid']);}else if(this[_0x2db2('0x1c')][_0x1e0250['transfererlinkedid']]){logger[_0x2db2('0x27')](_0x2db2('0x55'),JSON[_0x2db2('0x41')](_0x1e0250[_0x2db2('0x56')]));this[_0x2db2('0x48')](_0x1e0250['transfererlinkedid']);}}catch(_0x5606b9){logger['error'](_0x2db2('0x57'),_0x5606b9['message']);}};Acw[_0x2db2('0x3d')]['syncAgentRingNoAnswer']=function(_0x21bf87){try{if(this[_0x2db2('0x7')][_0x21bf87[_0x2db2('0x1d')]]&&this['voiceQueues'][_0x21bf87[_0x2db2('0x1d')]][_0x2db2('0x58')]==='all'){if(this[_0x2db2('0x8')][_0x21bf87[_0x2db2('0x1b')]]){logger[_0x2db2('0x27')](_0x2db2('0x59'),_0x21bf87[_0x2db2('0x33')],_0x21bf87[_0x2db2('0x1b')],_0x21bf87['queue']);return RpcUser[_0x2db2('0x2b')](this[_0x2db2('0x8')][_0x21bf87[_0x2db2('0x1b')]],_0x2db2('0x5a'),_0x21bf87[_0x2db2('0x33')]);}}}catch(_0x4036dd){logger[_0x2db2('0x3a')](_0x2db2('0x5b'),_0x4036dd[_0x2db2('0x43')]);}};module[_0x2db2('0x5c')]=Acw;
\ No newline at end of file
index f52f683..082dbd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bb1=['username','keepConnected','Action','promisify','format','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','actionCoreShowChannels','log','bluebird','moment','util','ami','../../config/environment','asterisk','port'];(function(_0x2efccf,_0x6d7311){var _0x433d78=function(_0xc68641){while(--_0xc68641){_0x2efccf['push'](_0x2efccf['shift']());}};_0x433d78(++_0x6d7311);}(_0x2bb1,0x81));var _0x12bb=function(_0x43a349,_0x5bc430){_0x43a349=_0x43a349-0x0;var _0x4e6923=_0x2bb1[_0x43a349];return _0x4e6923;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x12bb('0x0'));var moment=require(_0x12bb('0x1'));var util=require(_0x12bb('0x2'));var _=require('lodash');var logger=require('../../config/logger')(_0x12bb('0x3'));var config=require(_0x12bb('0x4'));var ami=new Manager(config[_0x12bb('0x5')][_0x12bb('0x6')],config[_0x12bb('0x5')]['ip'],config[_0x12bb('0x5')][_0x12bb('0x7')],config['asterisk']['password'],!![]);ami[_0x12bb('0x8')]();ami[_0x12bb('0x9')]=BPromise[_0x12bb('0xa')](ami['action']);function error(_0x5011f7){logger['error'](util[_0x12bb('0xb')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x12bb('0x7')],config['asterisk']['ip'],config[_0x12bb('0x5')][_0x12bb('0x6')],util[_0x12bb('0xc')](_0x5011f7,![],null)));}function close(){logger[_0x12bb('0xd')](util[_0x12bb('0xb')](_0x12bb('0xe'),config[_0x12bb('0x5')][_0x12bb('0x7')],config[_0x12bb('0x5')]['ip'],config[_0x12bb('0x5')][_0x12bb('0x6')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x12bb('0x9')]({'action':'sipshowregistry'});};};ami[_0x12bb('0xf')]=function(){return function(){return ami[_0x12bb('0x9')]({'action':_0x12bb('0x10')});};};ami[_0x12bb('0x11')]=function(){return function(){return ami[_0x12bb('0x9')]({'action':_0x12bb('0x12')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x12bb('0x9')]({'action':_0x12bb('0x13')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x12bb('0x9')]({'action':_0x12bb('0x14')});};};function connect(_0x4e46b4){logger[_0x12bb('0x15')](util[_0x12bb('0xb')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk']['username'],config['asterisk']['ip'],config['asterisk']['port']));ami['once'](_0x12bb('0xd'),error);ami[_0x12bb('0x16')](_0x12bb('0x17'),close);}ami['on'](_0x12bb('0x18'),connect);ami['on'](_0x12bb('0x19'),function(_0x1a3361){logger[_0x12bb('0x15')](util[_0x12bb('0xb')](_0x12bb('0x1a'),config[_0x12bb('0x5')]['username'],config['asterisk']['ip'],config[_0x12bb('0x5')]['port'],util[_0x12bb('0xc')](_0x1a3361,![],null)));});ami['on'](_0x12bb('0x1b'),function(_0x13da60){logger[_0x12bb('0x15')](util[_0x12bb('0xb')](_0x12bb('0x1c'),config[_0x12bb('0x5')]['username'],config['asterisk']['ip'],config['asterisk'][_0x12bb('0x6')]));return BPromise[_0x12bb('0x1d')]()['then'](ami['actionSipShowRegistry']())[_0x12bb('0x1e')](ami['actionDeviceStateList']())[_0x12bb('0x1e')](ami[_0x12bb('0x11')]())['then'](ami[_0x12bb('0x1f')]())[_0x12bb('0x1e')](ami[_0x12bb('0x20')]())['catch'](function(_0x3ef1d0){console[_0x12bb('0x21')](_0x3ef1d0);});});ami['once']('error',error);ami[_0x12bb('0x16')]('close',close);module['exports']=ami;
\ No newline at end of file
+var _0x5247=['close','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionQueueSummary','log','exports','asterisk-manager','moment','util','lodash','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','format','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','queuesummary','actionCoreShowChannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once'];(function(_0x4d48b3,_0x107ba9){var _0xa18c6d=function(_0x2d169b){while(--_0x2d169b){_0x4d48b3['push'](_0x4d48b3['shift']());}};_0xa18c6d(++_0x107ba9);}(_0x5247,0x1a2));var _0x7524=function(_0xde069d,_0x17643c){_0xde069d=_0xde069d-0x0;var _0x4938f2=_0x5247[_0xde069d];return _0x4938f2;};'use strict';var Manager=require(_0x7524('0x0'));var BPromise=require('bluebird');var moment=require(_0x7524('0x1'));var util=require(_0x7524('0x2'));var _=require(_0x7524('0x3'));var logger=require('../../config/logger')('ami');var config=require(_0x7524('0x4'));var ami=new Manager(config[_0x7524('0x5')][_0x7524('0x6')],config[_0x7524('0x5')]['ip'],config[_0x7524('0x5')][_0x7524('0x7')],config[_0x7524('0x5')][_0x7524('0x8')],!![]);ami[_0x7524('0x9')]();ami[_0x7524('0xa')]=BPromise[_0x7524('0xb')](ami[_0x7524('0xc')]);function error(_0x4b8df7){logger['error'](util[_0x7524('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x7524('0x5')][_0x7524('0x7')],config[_0x7524('0x5')]['ip'],config[_0x7524('0x5')][_0x7524('0x6')],util[_0x7524('0xe')](_0x4b8df7,![],null)));}function close(){logger[_0x7524('0xf')](util['format'](_0x7524('0x10'),config['asterisk'][_0x7524('0x7')],config['asterisk']['ip'],config[_0x7524('0x5')][_0x7524('0x6')]));}ami[_0x7524('0x11')]=function(){return function(){return ami[_0x7524('0xa')]({'action':'sipshowregistry'});};};ami[_0x7524('0x12')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0x7524('0x13')]=function(){return function(){return ami[_0x7524('0xa')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x7524('0xa')]({'action':_0x7524('0x14')});};};ami[_0x7524('0x15')]=function(){return function(){return ami[_0x7524('0xa')]({'action':'coreshowchannels'});};};function connect(_0x47a474){logger['info'](util['format'](_0x7524('0x16'),config[_0x7524('0x5')]['username'],config['asterisk']['ip'],config[_0x7524('0x5')][_0x7524('0x6')]));ami['once'](_0x7524('0xf'),error);ami[_0x7524('0x17')](_0x7524('0x18'),close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x2bc107){logger[_0x7524('0x19')](util[_0x7524('0xd')](_0x7524('0x1a'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x7524('0x5')][_0x7524('0x6')],util[_0x7524('0xe')](_0x2bc107,![],null)));});ami['on'](_0x7524('0x1b'),function(_0x4def3d){logger[_0x7524('0x19')](util[_0x7524('0xd')](_0x7524('0x1c'),config[_0x7524('0x5')][_0x7524('0x7')],config[_0x7524('0x5')]['ip'],config[_0x7524('0x5')]['port']));return BPromise[_0x7524('0x1d')]()[_0x7524('0x1e')](ami[_0x7524('0x11')]())[_0x7524('0x1e')](ami[_0x7524('0x12')]())[_0x7524('0x1e')](ami[_0x7524('0x13')]())[_0x7524('0x1e')](ami[_0x7524('0x1f')]())[_0x7524('0x1e')](ami['actionCoreShowChannels']())['catch'](function(_0x4438fa){console[_0x7524('0x20')](_0x4438fa);});});ami[_0x7524('0x17')]('error',error);ami[_0x7524('0x17')](_0x7524('0x18'),close);module[_0x7524('0x21')]=ami;
\ No newline at end of file
index 5bc99c7..8c17617 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x57d740,_0x50be99){var _0x6607ef=function(_0x908bd0){while(--_0x908bd0){_0x57d740['push'](_0x57d740['shift']());}};_0x6607ef(++_0x50be99);}(_0xac4a,0x13f));var _0xaac4=function(_0x58323d,_0x349609){_0x58323d=_0x58323d-0x0;var _0x344626=_0xac4a[_0x58323d];return _0x344626;};'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
+var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x24d73d,_0x53f0e6){var _0xa5ad95=function(_0x3d5e46){while(--_0x3d5e46){_0x24d73d['push'](_0x24d73d['shift']());}};_0xa5ad95(++_0x53f0e6);}(_0xaa88,0x137));var _0x8aa8=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xaa88[_0x1a36a5];return _0x746243;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client;
\ No newline at end of file
index cc5e403..f4c2d2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7467=['substring','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','format','callback','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x7467,0x1e3));var _0x7746=function(_0x150023,_0x2807a5){_0x150023=_0x150023-0x0;var _0x344bb3=_0x7467[_0x150023];return _0x344bb3;};'use strict';var util=require(_0x7746('0x0'));var _=require(_0x7746('0x1'));var moment=require('moment');function checkNameSurname(_0x4bbf5c,_0x4c2098,_0x494c40){var _0x1b370e='';if(!_[_0x7746('0x2')](_0x4c2098)&&_0x7746('0x3')===typeof _0x4c2098){_0x1b370e+=_0x4c2098;}if(!_[_0x7746('0x2')](_0x494c40)&&_0x7746('0x3')===typeof _0x494c40){_0x1b370e+='\x20'+_0x494c40;}if(_0x1b370e!==''){return _0x1b370e;}return _0x4bbf5c;}function Action(_0x4b2ea5,_0x7f8f1a,_0x1acd10){this[_0x7746('0x4')]=_0x4b2ea5;this[_0x7746('0x5')]=_0x1acd10||undefined;this[_0x7746('0x6')]=checkNameSurname(_0x7f8f1a[_0x7746('0x7')][_0x7746('0x8')],_0x7f8f1a[_0x7746('0x7')][_0x7746('0x9')],_0x7f8f1a[_0x7746('0x7')][_0x7746('0xa')]);this[_0x7746('0xb')]=_0x7f8f1a[_0x7746('0x7')][_0x7746('0x8')];this[_0x7746('0xc')]=_0x4b2ea5[_0x7746('0x6')];this[_0x7746('0xd')]=_0x7f8f1a['active']||![];this[_0x7746('0xe')]=_0x4b2ea5[_0x7746('0xe')];this[_0x7746('0xf')]=_0x4b2ea5[_0x7746('0xf')]||0x3;this[_0x7746('0x10')]=_0x7f8f1a[_0x7746('0x10')];this[_0x7746('0x11')]=_0x7f8f1a[_0x7746('0x11')];this[_0x7746('0x12')]=_0x7f8f1a['countcongestionretry'];this[_0x7746('0x13')]=_0x7f8f1a[_0x7746('0x13')];this['countnosuchnumberretry']=_0x7f8f1a[_0x7746('0x14')];this[_0x7746('0x15')]=_0x7f8f1a[_0x7746('0x15')];this['countabandonedretry']=_0x7f8f1a[_0x7746('0x16')];this[_0x7746('0x17')]=_0x7f8f1a[_0x7746('0x17')];this['countagentrejectretry']=_0x7f8f1a['countagentrejectretry'];this['ContactId']=_0x7f8f1a['ContactId'];this[_0x7746('0x18')]=_0x7f8f1a['ListId'];this[_0x7746('0x19')]=_0x7f8f1a[_0x7746('0x19')];this[_0x7746('0x1a')]=_0x7f8f1a[_0x7746('0x1a')];this[_0x7746('0x1b')]=_0x7f8f1a[_0x7746('0x1b')];this['idHopper']=_0x7f8f1a['id'];this[_0x7746('0x1c')]=_0x7f8f1a[_0x7746('0x7')][_0x7746('0x9')]||'';this['starttime']=moment()[_0x7746('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7746('0x1e')]=_0x7f8f1a[_0x7746('0x1e')];this['callbackuniqueid']=_0x7f8f1a['callbackuniqueid'];this[_0x7746('0x1f')]=_0x7f8f1a[_0x7746('0x1f')];this[_0x7746('0x20')]=_0x7f8f1a['recallme'];this[_0x7746('0x21')]='';this['originatecalleridname']='';}Action[_0x7746('0x22')][_0x7746('0x23')]=function(){return util[_0x7746('0x1d')](_0x7746('0x24'),this['name'],this[_0x7746('0x4')]['dialCutDigit']>0x0?this[_0x7746('0xb')][_0x7746('0x25')](this['voiceQueue']['dialCutDigit']):this['number']);};Action['prototype'][_0x7746('0x26')]=function(){return this['queue'];};module[_0x7746('0x27')]=Action;
\ No newline at end of file
+var _0x9e9f=['queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','util','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','lastName','number'];(function(_0x522d9d,_0x13104a){var _0x377218=function(_0x5f59ba){while(--_0x5f59ba){_0x522d9d['push'](_0x522d9d['shift']());}};_0x377218(++_0x13104a);}(_0x9e9f,0x103));var _0xf9e9=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x9e9f[_0x4cd21c];return _0x5d8e5e;};'use strict';var util=require(_0xf9e9('0x0'));var _=require(_0xf9e9('0x1'));var moment=require(_0xf9e9('0x2'));function checkNameSurname(_0x4443c0,_0x2dde35,_0x49bfec){var _0x20a63f='';if(!_['isNil'](_0x2dde35)&&'string'===typeof _0x2dde35){_0x20a63f+=_0x2dde35;}if(!_[_0xf9e9('0x3')](_0x49bfec)&&_0xf9e9('0x4')===typeof _0x49bfec){_0x20a63f+='\x20'+_0x49bfec;}if(_0x20a63f!==''){return _0x20a63f;}return _0x4443c0;}function Action(_0x2cdf46,_0x1cf289,_0xc60e31){this[_0xf9e9('0x5')]=_0x2cdf46;this['uniqueid']=_0xc60e31||undefined;this[_0xf9e9('0x6')]=checkNameSurname(_0x1cf289[_0xf9e9('0x7')][_0xf9e9('0x8')],_0x1cf289[_0xf9e9('0x7')]['firstName'],_0x1cf289[_0xf9e9('0x7')][_0xf9e9('0x9')]);this[_0xf9e9('0xa')]=_0x1cf289[_0xf9e9('0x7')][_0xf9e9('0x8')];this[_0xf9e9('0xb')]=_0x2cdf46[_0xf9e9('0x6')];this[_0xf9e9('0xc')]=_0x1cf289[_0xf9e9('0xc')]||![];this[_0xf9e9('0xd')]=_0x2cdf46[_0xf9e9('0xd')];this[_0xf9e9('0xe')]=_0x2cdf46[_0xf9e9('0xe')]||0x3;this[_0xf9e9('0xf')]=_0x1cf289[_0xf9e9('0xf')];this[_0xf9e9('0x10')]=_0x1cf289[_0xf9e9('0x10')];this['countcongestionretry']=_0x1cf289[_0xf9e9('0x11')];this[_0xf9e9('0x12')]=_0x1cf289[_0xf9e9('0x12')];this[_0xf9e9('0x13')]=_0x1cf289[_0xf9e9('0x13')];this['countdropretry']=_0x1cf289[_0xf9e9('0x14')];this[_0xf9e9('0x15')]=_0x1cf289[_0xf9e9('0x15')];this[_0xf9e9('0x16')]=_0x1cf289[_0xf9e9('0x16')];this[_0xf9e9('0x17')]=_0x1cf289[_0xf9e9('0x17')];this[_0xf9e9('0x18')]=_0x1cf289[_0xf9e9('0x18')];this['ListId']=_0x1cf289['ListId'];this[_0xf9e9('0x19')]=_0x1cf289[_0xf9e9('0x19')];this['VoiceQueueId']=_0x1cf289[_0xf9e9('0x1a')];this['CampaignId']=_0x1cf289[_0xf9e9('0x1b')];this[_0xf9e9('0x1c')]=_0x1cf289['id'];this[_0xf9e9('0x1d')]=_0x1cf289[_0xf9e9('0x7')][_0xf9e9('0x1e')]||'';this[_0xf9e9('0x1f')]=moment()[_0xf9e9('0x20')](_0xf9e9('0x21'));this[_0xf9e9('0x22')]=_0x1cf289[_0xf9e9('0x22')];this[_0xf9e9('0x23')]=_0x1cf289[_0xf9e9('0x23')];this['callbackat']=_0x1cf289[_0xf9e9('0x24')];this[_0xf9e9('0x25')]=_0x1cf289[_0xf9e9('0x25')];this[_0xf9e9('0x26')]='';this['originatecalleridname']='';}Action[_0xf9e9('0x27')][_0xf9e9('0x28')]=function(){return util[_0xf9e9('0x20')](_0xf9e9('0x29'),this[_0xf9e9('0x6')],this[_0xf9e9('0x5')][_0xf9e9('0x2a')]>0x0?this[_0xf9e9('0xa')][_0xf9e9('0x2b')](this['voiceQueue']['dialCutDigit']):this[_0xf9e9('0xa')]);};Action[_0xf9e9('0x27')][_0xf9e9('0x2c')]=function(){return this['queue'];};module['exports']=Action;
\ No newline at end of file
index 350c271..b175d01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x020b=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','holdtime','answertime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime'];(function(_0xfcdda0,_0x32479b){var _0x17ebe3=function(_0x5bfaa3){while(--_0x5bfaa3){_0xfcdda0['push'](_0xfcdda0['shift']());}};_0x17ebe3(++_0x32479b);}(_0x020b,0x1d8));var _0xb020=function(_0x100181,_0x1a9463){_0x100181=_0x100181-0x0;var _0xa7d72a=_0x020b[_0x100181];return _0xa7d72a;};'use strict';var util=require(_0xb020('0x0'));var _=require(_0xb020('0x1'));var moment=require('moment');function getSeconds(_0x5f294f,_0x49d604){var _0x149515=moment(_0x5f294f)[_0xb020('0x2')](0x0);var _0x4980e0=moment(_0x49d604)[_0xb020('0x2')](0x0);return _0x149515[_0xb020('0x3')](_0x4980e0,_0xb020('0x4'));}function AgentComplete(_0x2978f7,_0x5736d1){this[_0xb020('0x5')]=0x4;this['statedesc']='Answer';this[_0xb020('0x6')]=_0x2978f7['scheduledat'];this['type']=_0x2978f7['type'];this[_0xb020('0x7')]=_0x2978f7[_0xb020('0x8')]===_0xb020('0x9')?'queue':_0x2978f7[_0xb020('0x8')];this[_0xb020('0xa')]=_0x2978f7[_0xb020('0xa')];this[_0xb020('0xb')]=_0x2978f7[_0xb020('0xb')];this[_0xb020('0xc')]=_0x2978f7[_0xb020('0xc')];this['countglobal']=_0x2978f7[_0xb020('0xa')]+_0x2978f7[_0xb020('0xb')]+_0x2978f7[_0xb020('0xc')]+_0x2978f7[_0xb020('0xd')]+_0x2978f7[_0xb020('0xe')]+_0x2978f7[_0xb020('0xf')]+_0x2978f7[_0xb020('0x10')]+_0x2978f7['countagentrejectretry'];this[_0xb020('0xd')]=_0x2978f7[_0xb020('0xd')];this['countdropretry']=_0x2978f7['countdropretry'];this[_0xb020('0xf')]=_0x2978f7[_0xb020('0xf')];this[_0xb020('0x10')]=_0x2978f7[_0xb020('0x10')];this[_0xb020('0x11')]=_0x2978f7[_0xb020('0x11')];this['uniqueid']=_0x5736d1[_0xb020('0x12')];this[_0xb020('0x13')]=_0x2978f7['name'];this[_0xb020('0x14')]=_0x2978f7[_0xb020('0x15')];this[_0xb020('0x16')]=_0x2978f7['starttime'];this['responsetime']=_0x2978f7['responsetime'];this['answertime']=_0x2978f7['answertime'];this[_0xb020('0x17')]=moment()[_0xb020('0x18')](_0xb020('0x19'));this[_0xb020('0x1a')]=getSeconds(_0x2978f7[_0xb020('0x1b')],_0x2978f7['starttime']);this[_0xb020('0x1c')]=getSeconds(_0x2978f7[_0xb020('0x1d')],_0x2978f7[_0xb020('0x1b')]);this[_0xb020('0x1e')]=getSeconds(this[_0xb020('0x17')],_0x2978f7[_0xb020('0x1d')]);this[_0xb020('0x1f')]=_0x5736d1[_0xb020('0x1f')];this[_0xb020('0x20')]=_0x5736d1[_0xb020('0x20')];this[_0xb020('0x21')]=_0x5736d1[_0xb020('0x21')];this['callback']=_0x2978f7[_0xb020('0x22')];this[_0xb020('0x23')]=_0x2978f7[_0xb020('0x23')];this[_0xb020('0x24')]=_0x2978f7[_0xb020('0x24')];this[_0xb020('0x25')]=_0x2978f7['recallme'];this[_0xb020('0x26')]=_0x2978f7[_0xb020('0x26')];this[_0xb020('0x27')]=_0x2978f7[_0xb020('0x27')];this[_0xb020('0x28')]=_0x2978f7['UserId'];this['VoiceQueueId']=_0x2978f7['VoiceQueueId'];this[_0xb020('0x29')]=_0x2978f7[_0xb020('0x29')];this[_0xb020('0x2a')]=_0x2978f7[_0xb020('0x2a')]||'';this[_0xb020('0x2b')]=_0x2978f7['originatecalleridname']||'';}module[_0xb020('0x2c')]=AgentComplete;
\ No newline at end of file
+var _0xa3bd=['diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds'];(function(_0x37d3f3,_0xca010f){var _0x185c9c=function(_0x5e2bf2){while(--_0x5e2bf2){_0x37d3f3['push'](_0x37d3f3['shift']());}};_0x185c9c(++_0xca010f);}(_0xa3bd,0x1d3));var _0xda3b=function(_0x4cae04,_0x10055c){_0x4cae04=_0x4cae04-0x0;var _0x47d2af=_0xa3bd[_0x4cae04];return _0x47d2af;};'use strict';var util=require('util');var _=require(_0xda3b('0x0'));var moment=require(_0xda3b('0x1'));function getSeconds(_0x17aa54,_0x4feb21){var _0x1a4f6b=moment(_0x17aa54)[_0xda3b('0x2')](0x0);var _0x38217c=moment(_0x4feb21)[_0xda3b('0x2')](0x0);return _0x1a4f6b[_0xda3b('0x3')](_0x38217c,'seconds');}function AgentComplete(_0x288946,_0xad13f){this[_0xda3b('0x4')]=0x4;this[_0xda3b('0x5')]=_0xda3b('0x6');this[_0xda3b('0x7')]=_0x288946[_0xda3b('0x7')];this[_0xda3b('0x8')]=_0x288946[_0xda3b('0x8')];this[_0xda3b('0x9')]=_0x288946[_0xda3b('0x8')]===_0xda3b('0xa')?_0xda3b('0xb'):_0x288946['type'];this[_0xda3b('0xc')]=_0x288946[_0xda3b('0xc')];this[_0xda3b('0xd')]=_0x288946['countcongestionretry'];this[_0xda3b('0xe')]=_0x288946[_0xda3b('0xe')];this[_0xda3b('0xf')]=_0x288946[_0xda3b('0xc')]+_0x288946['countcongestionretry']+_0x288946[_0xda3b('0xe')]+_0x288946[_0xda3b('0x10')]+_0x288946[_0xda3b('0x11')]+_0x288946[_0xda3b('0x12')]+_0x288946[_0xda3b('0x13')]+_0x288946[_0xda3b('0x14')];this[_0xda3b('0x10')]=_0x288946[_0xda3b('0x10')];this[_0xda3b('0x11')]=_0x288946[_0xda3b('0x11')];this['countabandonedretry']=_0x288946[_0xda3b('0x12')];this[_0xda3b('0x13')]=_0x288946[_0xda3b('0x13')];this[_0xda3b('0x14')]=_0x288946[_0xda3b('0x14')];this['uniqueid']=_0xad13f[_0xda3b('0x15')];this[_0xda3b('0x16')]=_0x288946[_0xda3b('0x17')];this[_0xda3b('0x18')]=_0x288946[_0xda3b('0x19')];this['starttime']=_0x288946[_0xda3b('0x1a')];this[_0xda3b('0x1b')]=_0x288946['responsetime'];this[_0xda3b('0x1c')]=_0x288946[_0xda3b('0x1c')];this[_0xda3b('0x1d')]=moment()[_0xda3b('0x1e')](_0xda3b('0x1f'));this[_0xda3b('0x20')]=getSeconds(_0x288946['responsetime'],_0x288946[_0xda3b('0x1a')]);this[_0xda3b('0x21')]=getSeconds(_0x288946[_0xda3b('0x1c')],_0x288946['responsetime']);this[_0xda3b('0x22')]=getSeconds(this[_0xda3b('0x1d')],_0x288946['answertime']);this['queue']=_0xad13f[_0xda3b('0xb')];this[_0xda3b('0x23')]=_0xad13f[_0xda3b('0x23')];this[_0xda3b('0x24')]=_0xad13f[_0xda3b('0x24')];this[_0xda3b('0x25')]=_0x288946[_0xda3b('0x25')];this['callbackuniqueid']=_0x288946[_0xda3b('0x26')];this['callbackat']=_0x288946['callbackat'];this[_0xda3b('0x27')]=_0x288946[_0xda3b('0x27')];this[_0xda3b('0x28')]=_0x288946[_0xda3b('0x28')];this['ListId']=_0x288946['ListId'];this['UserId']=_0x288946[_0xda3b('0x29')];this['VoiceQueueId']=_0x288946[_0xda3b('0x2a')];this[_0xda3b('0x2b')]=_0x288946[_0xda3b('0x2b')];this[_0xda3b('0x2c')]=_0x288946[_0xda3b('0x2c')]||'';this[_0xda3b('0x2d')]=_0x288946[_0xda3b('0x2d')]||'';}module[_0xda3b('0x2e')]=AgentComplete;
\ No newline at end of file
index 9a1154f..c937281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5178=['queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry'];(function(_0x1b51ea,_0x394fd9){var _0x18bbdc=function(_0x45b83f){while(--_0x45b83f){_0x1b51ea['push'](_0x1b51ea['shift']());}};_0x18bbdc(++_0x394fd9);}(_0x5178,0x171));var _0x8517=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x5178[_0x2d7f0e];return _0x110b07;};'use strict';var util=require('util');var _=require(_0x8517('0x0'));var moment=require(_0x8517('0x1'));function getSeconds(_0x27662b,_0x2dc28f){var _0x38d5b3=moment(_0x27662b)['milliseconds'](0x0);var _0x483381=moment(_0x2dc28f)[_0x8517('0x2')](0x0);return _0x38d5b3[_0x8517('0x3')](_0x483381,'seconds');}function Final(_0xd4b0){this['uniqueid']=_0xd4b0[_0x8517('0x4')];this[_0x8517('0x5')]=_0xd4b0[_0x8517('0x5')];this[_0x8517('0x6')]=_0xd4b0[_0x8517('0x6')];this['campaigntype']=_0xd4b0[_0x8517('0x6')]==='outbound'?'queue':_0xd4b0[_0x8517('0x6')];this[_0x8517('0x7')]=_0xd4b0['countbusyretry'];this[_0x8517('0x8')]=_0xd4b0[_0x8517('0x8')];this[_0x8517('0x9')]=_0xd4b0[_0x8517('0x9')];this[_0x8517('0xa')]=_0xd4b0[_0x8517('0x7')]+_0xd4b0[_0x8517('0x8')]+_0xd4b0[_0x8517('0x9')]+_0xd4b0['countnosuchnumberretry']+_0xd4b0[_0x8517('0xb')]+_0xd4b0[_0x8517('0xc')]+_0xd4b0[_0x8517('0xd')]+_0xd4b0[_0x8517('0xe')];this[_0x8517('0xf')]=_0xd4b0['countnosuchnumberretry'];this[_0x8517('0xb')]=_0xd4b0[_0x8517('0xb')];this[_0x8517('0xc')]=_0xd4b0[_0x8517('0xc')];this[_0x8517('0xd')]=_0xd4b0[_0x8517('0xd')];this[_0x8517('0xe')]=_0xd4b0[_0x8517('0xe')];this[_0x8517('0x10')]=_0xd4b0[_0x8517('0x10')];this[_0x8517('0x11')]=_0xd4b0[_0x8517('0x11')];this['calleridnum']=_0xd4b0[_0x8517('0x12')];this[_0x8517('0x13')]=_0xd4b0[_0x8517('0x13')];this[_0x8517('0x14')]=_0xd4b0[_0x8517('0x14')];this[_0x8517('0x15')]=_0xd4b0[_0x8517('0x14')];this['ringtime']=_0xd4b0[_0x8517('0x16')]||0x0;this['holdtime']=_0xd4b0['holdtime']||0x0;this[_0x8517('0x17')]=_0xd4b0[_0x8517('0x17')]||0x0;this[_0x8517('0x18')]=_0xd4b0[_0x8517('0x18')];this[_0x8517('0x19')]=_0xd4b0[_0x8517('0x19')];this['callbackat']=_0xd4b0['callbackat'];this[_0x8517('0x1a')]=_0xd4b0[_0x8517('0x1a')];this[_0x8517('0x1b')]=_0xd4b0[_0x8517('0x1b')];this[_0x8517('0x1c')]=_0xd4b0[_0x8517('0x1c')];this['UserId']=_0xd4b0[_0x8517('0x1d')];this[_0x8517('0x1e')]=_0xd4b0['VoiceQueueId'];this[_0x8517('0x1f')]=_0xd4b0[_0x8517('0x1f')];this[_0x8517('0x20')]=_0xd4b0['originatecalleridnum']||'';this[_0x8517('0x21')]=_0xd4b0['originatecalleridname']||'';}module[_0x8517('0x22')]=Final;
\ No newline at end of file
+var _0xdc97=['CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdc97,0x13b));var _0x7dc9=function(_0x38ba20,_0x50624e){_0x38ba20=_0x38ba20-0x0;var _0x15c699=_0xdc97[_0x38ba20];return _0x15c699;};'use strict';var util=require(_0x7dc9('0x0'));var _=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));function getSeconds(_0x5f1f64,_0x2913e6){var _0x4f5c88=moment(_0x5f1f64)[_0x7dc9('0x3')](0x0);var _0x2b86da=moment(_0x2913e6)['milliseconds'](0x0);return _0x4f5c88[_0x7dc9('0x4')](_0x2b86da,_0x7dc9('0x5'));}function Final(_0xb15a0b){this[_0x7dc9('0x6')]=_0xb15a0b['uniqueid'];this[_0x7dc9('0x7')]=_0xb15a0b['scheduledat'];this['type']=_0xb15a0b[_0x7dc9('0x8')];this[_0x7dc9('0x9')]=_0xb15a0b[_0x7dc9('0x8')]===_0x7dc9('0xa')?_0x7dc9('0xb'):_0xb15a0b['type'];this[_0x7dc9('0xc')]=_0xb15a0b[_0x7dc9('0xc')];this[_0x7dc9('0xd')]=_0xb15a0b[_0x7dc9('0xd')];this[_0x7dc9('0xe')]=_0xb15a0b[_0x7dc9('0xe')];this[_0x7dc9('0xf')]=_0xb15a0b['countbusyretry']+_0xb15a0b['countcongestionretry']+_0xb15a0b['countnoanswerretry']+_0xb15a0b['countnosuchnumberretry']+_0xb15a0b[_0x7dc9('0x10')]+_0xb15a0b[_0x7dc9('0x11')]+_0xb15a0b['countmachineretry']+_0xb15a0b[_0x7dc9('0x12')];this[_0x7dc9('0x13')]=_0xb15a0b[_0x7dc9('0x13')];this[_0x7dc9('0x10')]=_0xb15a0b[_0x7dc9('0x10')];this[_0x7dc9('0x11')]=_0xb15a0b['countabandonedretry'];this[_0x7dc9('0x14')]=_0xb15a0b[_0x7dc9('0x14')];this[_0x7dc9('0x12')]=_0xb15a0b[_0x7dc9('0x12')];this[_0x7dc9('0xb')]=_0xb15a0b[_0x7dc9('0xb')];this[_0x7dc9('0x15')]=_0xb15a0b[_0x7dc9('0x15')];this[_0x7dc9('0x16')]=_0xb15a0b['calleridnum'];this[_0x7dc9('0x17')]=_0xb15a0b['starttime'];this[_0x7dc9('0x18')]=_0xb15a0b[_0x7dc9('0x18')];this['endtime']=_0xb15a0b[_0x7dc9('0x18')];this[_0x7dc9('0x19')]=_0xb15a0b[_0x7dc9('0x19')]||0x0;this[_0x7dc9('0x1a')]=_0xb15a0b[_0x7dc9('0x1a')]||0x0;this[_0x7dc9('0x1b')]=_0xb15a0b[_0x7dc9('0x1b')]||0x0;this[_0x7dc9('0x1c')]=_0xb15a0b[_0x7dc9('0x1c')];this[_0x7dc9('0x1d')]=_0xb15a0b['callbackuniqueid'];this['callbackat']=_0xb15a0b[_0x7dc9('0x1e')];this[_0x7dc9('0x1f')]=_0xb15a0b['recallme'];this[_0x7dc9('0x20')]=_0xb15a0b[_0x7dc9('0x20')];this['ListId']=_0xb15a0b[_0x7dc9('0x21')];this[_0x7dc9('0x22')]=_0xb15a0b[_0x7dc9('0x22')];this['VoiceQueueId']=_0xb15a0b[_0x7dc9('0x23')];this[_0x7dc9('0x24')]=_0xb15a0b[_0x7dc9('0x24')];this['originatecalleridnum']=_0xb15a0b['originatecalleridnum']||'';this['originatecalleridname']=_0xb15a0b[_0x7dc9('0x25')]||'';}module[_0x7dc9('0x26')]=Final;
\ No newline at end of file
index 0da4504..73becfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ef=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','IVR','cause-txt','callbackuniqueid','callbackat'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xd2ef,0x13a));var _0xfd2e=function(_0x3f4684,_0x3ebef8){_0x3f4684=_0x3f4684-0x0;var _0x350fb5=_0xd2ef[_0x3f4684];return _0x350fb5;};'use strict';var util=require(_0xfd2e('0x0'));var _=require(_0xfd2e('0x1'));var moment=require(_0xfd2e('0x2'));function getSeconds(_0x848d39,_0x1c412a){var _0x4eddde=moment(_0x848d39)['milliseconds'](0x0);var _0x47f8f6=moment(_0x1c412a)[_0xfd2e('0x3')](0x0);return _0x4eddde[_0xfd2e('0x4')](_0x47f8f6,_0xfd2e('0x5'));}function Hangup(_0x5538bf,_0x13e9cd){this[_0xfd2e('0x6')]=0x4;this[_0xfd2e('0x7')]=_0xfd2e('0x8');this[_0xfd2e('0x9')]=_0x5538bf[_0xfd2e('0x9')];this[_0xfd2e('0xa')]=_0x5538bf['type'];this[_0xfd2e('0xb')]=_0x5538bf[_0xfd2e('0xa')]===_0xfd2e('0xc')?_0xfd2e('0xd'):_0x5538bf[_0xfd2e('0xa')];this[_0xfd2e('0xe')]=_0x5538bf['countbusyretry'];this[_0xfd2e('0xf')]=_0x5538bf[_0xfd2e('0xf')];this[_0xfd2e('0x10')]=_0x5538bf[_0xfd2e('0x10')];this[_0xfd2e('0x11')]=_0x5538bf['countbusyretry']+_0x5538bf[_0xfd2e('0xf')]+_0x5538bf[_0xfd2e('0x10')]+_0x5538bf[_0xfd2e('0x12')]+_0x5538bf[_0xfd2e('0x13')]+_0x5538bf['countabandonedretry']+_0x5538bf[_0xfd2e('0x14')]+_0x5538bf['countagentrejectretry'];this[_0xfd2e('0x12')]=_0x5538bf['countnosuchnumberretry'];this[_0xfd2e('0x13')]=_0x5538bf[_0xfd2e('0x13')];this['countabandonedretry']=_0x5538bf[_0xfd2e('0x15')];this[_0xfd2e('0x14')]=_0x5538bf[_0xfd2e('0x14')];this[_0xfd2e('0x16')]=_0x5538bf[_0xfd2e('0x16')];this['uniqueid']=_0x13e9cd[_0xfd2e('0x17')];this['calleridname']=_0x5538bf[_0xfd2e('0x18')];this[_0xfd2e('0x19')]=_0x5538bf['number'];this[_0xfd2e('0x1a')]=_0x5538bf[_0xfd2e('0x1a')];this[_0xfd2e('0x1b')]=_0x5538bf[_0xfd2e('0x1b')];this[_0xfd2e('0x1c')]=moment()[_0xfd2e('0x1d')](_0xfd2e('0x1e'));this['ringtime']=getSeconds(_0x5538bf['responsetime'],_0x5538bf[_0xfd2e('0x1a')]);this[_0xfd2e('0x1f')]=0x0;this[_0xfd2e('0x20')]=getSeconds(this[_0xfd2e('0x1c')],_0x5538bf[_0xfd2e('0x1b')]);this['queue']=_0x5538bf[_0xfd2e('0xd')];this[_0xfd2e('0x21')]=_0xfd2e('0x22');this['reason']=_0x13e9cd[_0xfd2e('0x23')];this['callback']=_0x5538bf['callback'];this[_0xfd2e('0x24')]=_0x5538bf[_0xfd2e('0x24')];this[_0xfd2e('0x25')]=_0x5538bf['callbackat'];this['recallme']=_0x5538bf['recallme'];this[_0xfd2e('0x26')]=_0x5538bf[_0xfd2e('0x26')];this[_0xfd2e('0x27')]=_0x5538bf[_0xfd2e('0x27')];this[_0xfd2e('0x28')]=_0x5538bf['UserId'];this[_0xfd2e('0x29')]=_0x5538bf[_0xfd2e('0x29')];this[_0xfd2e('0x2a')]=_0x5538bf['CampaignId'];}module[_0xfd2e('0x2b')]=Hangup;
\ No newline at end of file
+var _0x92e2=['VoiceQueueId','moment','milliseconds','diff','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x5c4b6a,_0x3e4163){var _0x2dec05=function(_0x17017e){while(--_0x17017e){_0x5c4b6a['push'](_0x5c4b6a['shift']());}};_0x2dec05(++_0x3e4163);}(_0x92e2,0x9d));var _0x292e=function(_0x356c42,_0x5b3403){_0x356c42=_0x356c42-0x0;var _0x299154=_0x92e2[_0x356c42];return _0x299154;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x292e('0x0'));function getSeconds(_0x798f78,_0x4a91fe){var _0x1911d1=moment(_0x798f78)[_0x292e('0x1')](0x0);var _0x457bc4=moment(_0x4a91fe)[_0x292e('0x1')](0x0);return _0x1911d1[_0x292e('0x2')](_0x457bc4,'seconds');}function Hangup(_0x573b88,_0x4eb030){this[_0x292e('0x3')]=0x4;this['statedesc']=_0x292e('0x4');this['scheduledat']=_0x573b88[_0x292e('0x5')];this[_0x292e('0x6')]=_0x573b88[_0x292e('0x6')];this[_0x292e('0x7')]=_0x573b88[_0x292e('0x6')]===_0x292e('0x8')?'queue':_0x573b88['type'];this[_0x292e('0x9')]=_0x573b88[_0x292e('0x9')];this[_0x292e('0xa')]=_0x573b88[_0x292e('0xa')];this[_0x292e('0xb')]=_0x573b88[_0x292e('0xb')];this[_0x292e('0xc')]=_0x573b88['countbusyretry']+_0x573b88[_0x292e('0xa')]+_0x573b88[_0x292e('0xb')]+_0x573b88[_0x292e('0xd')]+_0x573b88['countdropretry']+_0x573b88[_0x292e('0xe')]+_0x573b88['countmachineretry']+_0x573b88[_0x292e('0xf')];this[_0x292e('0xd')]=_0x573b88['countnosuchnumberretry'];this[_0x292e('0x10')]=_0x573b88['countdropretry'];this[_0x292e('0xe')]=_0x573b88[_0x292e('0xe')];this[_0x292e('0x11')]=_0x573b88['countmachineretry'];this[_0x292e('0xf')]=_0x573b88[_0x292e('0xf')];this[_0x292e('0x12')]=_0x4eb030[_0x292e('0x12')];this[_0x292e('0x13')]=_0x573b88['name'];this[_0x292e('0x14')]=_0x573b88[_0x292e('0x15')];this[_0x292e('0x16')]=_0x573b88['starttime'];this[_0x292e('0x17')]=_0x573b88[_0x292e('0x17')];this[_0x292e('0x18')]=moment()[_0x292e('0x19')](_0x292e('0x1a'));this['ringtime']=getSeconds(_0x573b88[_0x292e('0x17')],_0x573b88[_0x292e('0x16')]);this['holdtime']=0x0;this[_0x292e('0x1b')]=getSeconds(this[_0x292e('0x18')],_0x573b88['responsetime']);this['queue']=_0x573b88['queue'];this[_0x292e('0x1c')]=_0x292e('0x1d');this['reason']=_0x4eb030[_0x292e('0x1e')];this[_0x292e('0x1f')]=_0x573b88[_0x292e('0x1f')];this['callbackuniqueid']=_0x573b88[_0x292e('0x20')];this[_0x292e('0x21')]=_0x573b88['callbackat'];this[_0x292e('0x22')]=_0x573b88[_0x292e('0x22')];this[_0x292e('0x23')]=_0x573b88[_0x292e('0x23')];this['ListId']=_0x573b88[_0x292e('0x24')];this[_0x292e('0x25')]=_0x573b88['UserId'];this[_0x292e('0x26')]=_0x573b88[_0x292e('0x26')];this['CampaignId']=_0x573b88['CampaignId'];}module['exports']=Hangup;
\ No newline at end of file
index 56c575f..c26020f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f28=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x15539c,_0x58726e){var _0x556f64=function(_0x1e4589){while(--_0x1e4589){_0x15539c['push'](_0x15539c['shift']());}};_0x556f64(++_0x58726e);}(_0x4f28,0x16e));var _0x84f2=function(_0x1fa841,_0x37a70c){_0x1fa841=_0x1fa841-0x0;var _0x384b67=_0x4f28[_0x1fa841];return _0x384b67;};'use strict';var util=require(_0x84f2('0x0'));var _=require(_0x84f2('0x1'));var moment=require('moment');function getSeconds(_0x5613c7,_0x62d3df){var _0x4003a7=moment(_0x5613c7)['milliseconds'](0x0);var _0x350584=moment(_0x62d3df)[_0x84f2('0x2')](0x0);return _0x4003a7['diff'](_0x350584,_0x84f2('0x3'));}function History(_0x37fe6b){this[_0x84f2('0x4')]=_0x37fe6b[_0x84f2('0x4')];this[_0x84f2('0x5')]=_0x37fe6b[_0x84f2('0x5')]||undefined;this[_0x84f2('0x6')]=_0x37fe6b[_0x84f2('0x6')];this[_0x84f2('0x7')]=_0x37fe6b[_0x84f2('0x6')]===_0x84f2('0x8')?_0x84f2('0x9'):_0x37fe6b[_0x84f2('0x6')];this[_0x84f2('0xa')]=_0x37fe6b['countbusyretry'];this['countcongestionretry']=_0x37fe6b['countcongestionretry'];this[_0x84f2('0xb')]=_0x37fe6b[_0x84f2('0xb')];this[_0x84f2('0xc')]=_0x37fe6b[_0x84f2('0xa')]+_0x37fe6b[_0x84f2('0xd')]+_0x37fe6b['countnoanswerretry']+_0x37fe6b[_0x84f2('0xe')]+_0x37fe6b[_0x84f2('0xf')]+_0x37fe6b['countabandonedretry']+_0x37fe6b[_0x84f2('0x10')]+_0x37fe6b[_0x84f2('0x11')];this[_0x84f2('0xe')]=_0x37fe6b['countnosuchnumberretry'];this[_0x84f2('0xf')]=_0x37fe6b[_0x84f2('0xf')];this[_0x84f2('0x12')]=_0x37fe6b['countabandonedretry'];this[_0x84f2('0x10')]=_0x37fe6b[_0x84f2('0x10')];this[_0x84f2('0x11')]=_0x37fe6b[_0x84f2('0x11')];this['queue']=_0x37fe6b[_0x84f2('0x9')];this[_0x84f2('0x13')]=_0x37fe6b[_0x84f2('0x14')];this[_0x84f2('0x15')]=_0x37fe6b[_0x84f2('0x16')];this['starttime']=_0x37fe6b[_0x84f2('0x17')];this[_0x84f2('0x18')]=_0x37fe6b['responsetime'];this[_0x84f2('0x19')]=_0x37fe6b['responsetime'];this[_0x84f2('0x1a')]=getSeconds(_0x37fe6b[_0x84f2('0x18')],_0x37fe6b['starttime']);this['holdtime']=0x0;this[_0x84f2('0x1b')]=0x0;this['callback']=_0x37fe6b[_0x84f2('0x1c')];this[_0x84f2('0x1d')]=_0x37fe6b[_0x84f2('0x1d')];this[_0x84f2('0x1e')]=_0x37fe6b[_0x84f2('0x1e')];this[_0x84f2('0x1f')]=_0x37fe6b[_0x84f2('0x1f')];this[_0x84f2('0x20')]=_0x37fe6b[_0x84f2('0x20')];this[_0x84f2('0x21')]=_0x37fe6b[_0x84f2('0x21')];this[_0x84f2('0x22')]=_0x37fe6b['UserId'];this[_0x84f2('0x23')]=_0x37fe6b[_0x84f2('0x23')];this[_0x84f2('0x24')]=_0x37fe6b['CampaignId'];this[_0x84f2('0x25')]=_0x37fe6b[_0x84f2('0x25')]||'';this[_0x84f2('0x26')]=_0x37fe6b[_0x84f2('0x26')]||'';}module[_0x84f2('0x27')]=History;
\ No newline at end of file
+var _0x213f=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','queue','calleridname','name','starttime','responsetime','endtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x553145,_0x4f9ab8){var _0x11cfbd=function(_0x2e7702){while(--_0x2e7702){_0x553145['push'](_0x553145['shift']());}};_0x11cfbd(++_0x4f9ab8);}(_0x213f,0xdf));var _0xf213=function(_0x3671a2,_0x22cd7c){_0x3671a2=_0x3671a2-0x0;var _0x3558b8=_0x213f[_0x3671a2];return _0x3558b8;};'use strict';var util=require(_0xf213('0x0'));var _=require('lodash');var moment=require(_0xf213('0x1'));function getSeconds(_0x305983,_0x101df3){var _0xcf90f8=moment(_0x305983)[_0xf213('0x2')](0x0);var _0x3a2ffa=moment(_0x101df3)[_0xf213('0x2')](0x0);return _0xcf90f8['diff'](_0x3a2ffa,_0xf213('0x3'));}function History(_0x3ed991){this[_0xf213('0x4')]=_0x3ed991[_0xf213('0x4')];this['scheduledat']=_0x3ed991[_0xf213('0x5')]||undefined;this[_0xf213('0x6')]=_0x3ed991[_0xf213('0x6')];this[_0xf213('0x7')]=_0x3ed991[_0xf213('0x6')]==='outbound'?'queue':_0x3ed991[_0xf213('0x6')];this[_0xf213('0x8')]=_0x3ed991['countbusyretry'];this[_0xf213('0x9')]=_0x3ed991[_0xf213('0x9')];this[_0xf213('0xa')]=_0x3ed991[_0xf213('0xa')];this[_0xf213('0xb')]=_0x3ed991[_0xf213('0x8')]+_0x3ed991[_0xf213('0x9')]+_0x3ed991['countnoanswerretry']+_0x3ed991[_0xf213('0xc')]+_0x3ed991['countdropretry']+_0x3ed991[_0xf213('0xd')]+_0x3ed991[_0xf213('0xe')]+_0x3ed991[_0xf213('0xf')];this[_0xf213('0xc')]=_0x3ed991[_0xf213('0xc')];this[_0xf213('0x10')]=_0x3ed991[_0xf213('0x10')];this['countabandonedretry']=_0x3ed991[_0xf213('0xd')];this['countmachineretry']=_0x3ed991[_0xf213('0xe')];this[_0xf213('0xf')]=_0x3ed991[_0xf213('0xf')];this['queue']=_0x3ed991[_0xf213('0x11')];this[_0xf213('0x12')]=_0x3ed991[_0xf213('0x13')];this['calleridnum']=_0x3ed991['number'];this[_0xf213('0x14')]=_0x3ed991[_0xf213('0x14')];this[_0xf213('0x15')]=_0x3ed991['responsetime'];this[_0xf213('0x16')]=_0x3ed991[_0xf213('0x15')];this['ringtime']=getSeconds(_0x3ed991[_0xf213('0x15')],_0x3ed991['starttime']);this[_0xf213('0x17')]=0x0;this[_0xf213('0x18')]=0x0;this['callback']=_0x3ed991['callback'];this[_0xf213('0x19')]=_0x3ed991[_0xf213('0x19')];this[_0xf213('0x1a')]=_0x3ed991[_0xf213('0x1a')];this[_0xf213('0x1b')]=_0x3ed991['recallme'];this[_0xf213('0x1c')]=_0x3ed991[_0xf213('0x1c')];this[_0xf213('0x1d')]=_0x3ed991['ListId'];this['UserId']=_0x3ed991[_0xf213('0x1e')];this['VoiceQueueId']=_0x3ed991[_0xf213('0x1f')];this[_0xf213('0x20')]=_0x3ed991[_0xf213('0x20')];this[_0xf213('0x21')]=_0x3ed991[_0xf213('0x21')]||'';this[_0xf213('0x22')]=_0x3ed991[_0xf213('0x22')]||'';}module[_0xf213('0x23')]=History;
\ No newline at end of file
index f5ee4fb..96d00ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9090=['\x22\x22\x20<>','error','inspect','stack','undefined','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','starttime','clearZombieChannels','[uniqueid]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','resolve','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','state','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason\x2019\x20machine....','add','YYYY-MM-DD\x20HH:mm:ss','[syncHangupInAMDIvr]','reason19\x20machine....','dialMachineMaxRetry','minutes','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','strategy','actionid','locked','paused','stateinterface','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','timezones','content','indexOf','true','command','all','some','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','checkDialMethod','dialMethod','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','responsetime','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','createStateFinal','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalTotalCalls','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','[booked][checkContactBlack]','queuestatus','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','dialOrderByScheduledAt','RUNNING','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','syncNewExten','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Interval','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','info','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\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','erlangAbandonmentRate','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string'];(function(_0x57e512,_0x1aacce){var _0x416853=function(_0x17883d){while(--_0x17883d){_0x57e512['push'](_0x57e512['shift']());}};_0x416853(++_0x1aacce);}(_0x9090,0x17f));var _0x0909=function(_0x265e6e,_0x463d80){_0x265e6e=_0x265e6e-0x0;var _0xaa3c8d=_0x9090[_0x265e6e];return _0xaa3c8d;};'use strict';var util=require(_0x0909('0x0'));var _=require(_0x0909('0x1'));var BPromise=require(_0x0909('0x2'));var uuid=require(_0x0909('0x3'));var moment=require(_0x0909('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0x0909('0x5'));var config=require(_0x0909('0x6'));var logger=require(_0x0909('0x7'))('dialer');var loggerBooked=require(_0x0909('0x7'))(_0x0909('0x8'));var loggerPredictive=require(_0x0909('0x7'))(_0x0909('0x9'));var loggerPredictiveCalls=require(_0x0909('0x7'))(_0x0909('0xa'));var loggerSyncQueueSummary=require(_0x0909('0x7'))('syncQueueSummary');var ami=require(_0x0909('0xb'));config[_0x0909('0xc')]=_['defaults'](config[_0x0909('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x0909('0xd'))(new Redis(config[_0x0909('0xc')]));var cmHopper=require(_0x0909('0xe'));var cmHopperHistory=require(_0x0909('0xf'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x0909('0x10'));var Action=require(_0x0909('0x11'));var History=require(_0x0909('0x12'));var Final=require(_0x0909('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x0909('0x14'));var Hangup=require(_0x0909('0x15'));var ipAgi=process[_0x0909('0x16')][_0x0909('0x17')]||_0x0909('0x18');var strategy={'rrmemory':_0x0909('0x19'),'roundrobin':_0x0909('0x1a')};var Sequence=function(){};Sequence[_0x0909('0x1b')][_0x0909('0x1c')]=function(_0x2e9bcf){this['tail']=this[_0x0909('0x1d')]?this[_0x0909('0x1d')][_0x0909('0x1e')](_0x2e9bcf):_0x2e9bcf();};function Dialer(_0x2b4a82,_0x448e9c){this[_0x0909('0x1f')]=new Sequence();this[_0x0909('0x20')]=_0x448e9c;this[_0x0909('0x21')]=_0x2b4a82['voiceQueues'];this[_0x0909('0x22')]=_0x2b4a82[_0x0909('0x22')];this[_0x0909('0x23')]=_0x2b4a82['agents'];this[_0x0909('0x24')]=_0x2b4a82[_0x0909('0x24')];this[_0x0909('0x25')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x0909('0x26')]={};this['contactsId']={};this[_0x0909('0x27')]={};this[_0x0909('0x28')]={};this[_0x0909('0x29')]={};this[_0x0909('0x2a')]={};this[_0x0909('0x2b')]={};this[_0x0909('0x2c')]={};this['queueBookedRR']={};ami['on'](_0x0909('0x2d'),this['syncAgentConnect'][_0x0909('0x2e')](this));ami['on'](_0x0909('0x2f'),this[_0x0909('0x30')][_0x0909('0x2e')](this));ami['on'](_0x0909('0x31'),this['syncOriginateResponse'][_0x0909('0x2e')](this));ami['on'](_0x0909('0x32'),this[_0x0909('0x33')][_0x0909('0x2e')](this));ami['on'](_0x0909('0x34'),this[_0x0909('0x35')][_0x0909('0x2e')](this));ami['on'](_0x0909('0x36'),this[_0x0909('0x37')][_0x0909('0x2e')](this));ami['on']('newexten',this[_0x0909('0x38')]['bind'](this));ami['on']('varset',this[_0x0909('0x39')][_0x0909('0x2e')](this));ami['on']('queuemember',this[_0x0909('0x3a')][_0x0909('0x2e')](this));ami['on'](_0x0909('0x3b'),this['syncQueueStatusComplete'][_0x0909('0x2e')](this));this[_0x0909('0x3c')]();this[_0x0909('0x3d')]();}function isNotNull(_0xeaa356){return _0xeaa356!==null&&!_[_0x0909('0x3e')](_0xeaa356);}function checkIsLoggedIn(_0x5470e4,_0x1bd9ae){return function(){if(_0x1bd9ae<=0x0){_0x5470e4['message']=_0x0909('0x3f');throw _0x5470e4[_0x0909('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0xc06157){return _0xc06157;}function checkIsActive(_0xac751f,_0x558c2e){return function(){if(!isActive(_0x558c2e)){_0xac751f[_0x0909('0x41')]=_0x0909('0x42');throw _0xac751f[_0x0909('0x40')]+_0x0909('0x43');}};}function checkInterval(_0x201356){return function(){if(!isNotNull(_0x201356['Interval'])){_0x201356[_0x0909('0x41')]=_0x0909('0x44');throw _0x201356[_0x0909('0x40')]+_0x0909('0x45');}if(!isNotNull(_0x201356['Interval'][_0x0909('0x46')])){_0x201356[_0x0909('0x41')]=_0x0909('0x44');throw _0x201356[_0x0909('0x40')]+_0x0909('0x45');}if(!isNotNull(_[_0x0909('0x47')](_0x201356[_0x0909('0x48')]['Intervals']))){_0x201356['message']=_0x0909('0x44');throw _0x201356[_0x0909('0x40')]+_0x0909('0x45');}};}function msgResponse(_0x905e5,_0x203ef5,_0x5bb313){return{'action':_0x905e5,'response':_0x203ef5,'message':_0x5bb313,'stack':_0x5bb313};}function myreject(_0x3cc952){return function(_0x5b4bc5){return _0x3cc952(msgResponse(_0x0909('0x49'),_0x0909('0x4a'),JSON[_0x0909('0x4b')](_0x5b4bc5)));};}function getSeconds(_0x441252,_0x2c7b1d){var _0x5ad952=moment(_0x441252)[_0x0909('0x4c')](0x0);var _0x553f36=moment(_0x2c7b1d)[_0x0909('0x4c')](0x0);return _0x5ad952[_0x0909('0x4d')](_0x553f36,_0x0909('0x4e'));}function emit(_0x2cf32f,_0x3288f3,_0x3d0897){io['to'](_0x2cf32f)[_0x0909('0x4f')](_0x3288f3,_0x3d0897);}function emitVoiceQueueSummary(_0x224c65){if(_0x224c65[_0x0909('0x50')]===_0x0909('0x51')){var _0x547a66={'id':_0x224c65['id'],'name':_0x224c65[_0x0909('0x40')],'strategy':_0x224c65['strategy'],'answered':_0x224c65[_0x0909('0x52')],'available':_0x224c65['available'],'loggedIn':_0x224c65[_0x0909('0x53')],'pTalking':_0x224c65[_0x0909('0x54')],'sumBillable':_0x224c65[_0x0909('0x55')],'sumDuration':_0x224c65[_0x0909('0x56')],'sumHoldTime':_0x224c65[_0x0909('0x57')]||0x0,'talking':_0x224c65[_0x0909('0x58')],'total':_0x224c65[_0x0909('0x59')],'type':_0x224c65[_0x0909('0x50')],'unmanaged':_0x224c65[_0x0909('0x5a')],'abandoned':_0x224c65['abandoned'],'waiting':_0x224c65[_0x0909('0x5b')],'loggedInDb':_0x224c65['loggedInDb'],'dialActive':_0x224c65[_0x0909('0x5c')],'dialMethod':_0x224c65['dialMethod'],'dialOriginateCallerIdName':_0x224c65[_0x0909('0x5d')],'dialOriginateCallerIdNumber':_0x224c65[_0x0909('0x5e')],'dialOriginateTimeout':_0x224c65[_0x0909('0x5f')],'dialPrefix':_0x224c65[_0x0909('0x60')],'outboundAnswerAgiCallsDay':_0x224c65['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x224c65[_0x0909('0x61')],'outboundBlacklistCallsDay':_0x224c65[_0x0909('0x62')],'outboundBusyCallsDay':_0x224c65[_0x0909('0x63')],'outboundCongestionCallsDay':_0x224c65[_0x0909('0x64')],'outboundDropCallsDayACS':_0x224c65[_0x0909('0x65')],'outboundDropCallsDayCallersExit':_0x224c65['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x224c65[_0x0909('0x66')],'outboundNoAnswerCallsDay':_0x224c65[_0x0909('0x67')],'outboundNoSuchCallsDay':_0x224c65['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x224c65[_0x0909('0x68')],'outboundReCallsDay':_0x224c65['outboundReCallsDay'],'outboundRejectCallsDay':_0x224c65[_0x0909('0x69')],'outboundUnknownCallsDay':_0x224c65['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x224c65['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x224c65[_0x0909('0x6a')],'predictiveIntervalAvgTalktime':_0x224c65[_0x0909('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x224c65['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x224c65['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x224c65[_0x0909('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x224c65['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x224c65[_0x0909('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x224c65[_0x0909('0x6e')],'predictiveIntervalPauses':_0x224c65['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x224c65['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x224c65['predictiveIntervalTotalCalls'],'message':_0x224c65[_0x0909('0x41')],'originated':_0x224c65[_0x0909('0x6f')],'erlangCalls':_0x224c65[_0x0909('0x70')],'erlangCallToSecond':_0x224c65[_0x0909('0x71')],'erlangAbandonmentRate':_0x224c65['erlangAbandonmentRate'],'erlangBusyFactor':_0x224c65[_0x0909('0x72')],'startPredictive':_0x224c65[_0x0909('0x29')],'startProgressive':_0x224c65[_0x0909('0x2a')]};if(_0x224c65[_0x0909('0x73')]){_0x547a66['Trunk']={'id':_0x224c65['Trunk']['id'],'name':_0x224c65[_0x0909('0x73')][_0x0909('0x40')],'active':_0x224c65[_0x0909('0x73')][_0x0909('0x74')],'callerid':_0x224c65[_0x0909('0x73')][_0x0909('0x75')]};}if(_0x224c65[_0x0909('0x48')]){_0x547a66[_0x0909('0x48')]={'id':_0x224c65['Interval']['id'],'name':_0x224c65[_0x0909('0x48')][_0x0909('0x40')]};}var _0x5e8f34=md5(JSON[_0x0909('0x4b')](_0x547a66));if(_0x224c65['md5']!==_0x5e8f34){_0x224c65[_0x0909('0x76')]=_0x5e8f34;emit(util[_0x0909('0x77')](_0x0909('0x78'),_0x547a66[_0x0909('0x40')]),_0x0909('0x79'),_0x547a66);}}}function emitCampaignSummary(_0x29f155){if(_0x29f155[_0x0909('0x50')]==='ivr'){emit(util[_0x0909('0x77')](_0x0909('0x7a'),_0x29f155[_0x0909('0x40')]),_0x0909('0x7b'),_0x29f155);}}function checkGetDataPredictive(_0x2e7099){if(isNotNull(_0x2e7099)&&!_[_0x0909('0x47')](_0x2e7099)){loggerPredictive['info'](_0x0909('0x7c'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e7099['predictiveIntervalTotalCalls']);loggerPredictive['info'](_0x0909('0x7d'),_0x2e7099[_0x0909('0x7e')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e7099[_0x0909('0x7f')]);loggerPredictive[_0x0909('0x80')](_0x0909('0x81'),_0x2e7099[_0x0909('0x82')]);loggerPredictive[_0x0909('0x80')](_0x0909('0x83'),_0x2e7099[_0x0909('0x6a')]);loggerPredictive[_0x0909('0x80')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e7099['predictiveIntervalAvgTalktime']);loggerPredictive[_0x0909('0x80')]('---------------------------');if(_0x2e7099['predictiveIntervalTotalCalls']>0x0){if(!_[_0x0909('0x3e')](_0x2e7099[_0x0909('0x6b')])&&_0x2e7099[_0x0909('0x6b')]>0x0){return!![];}loggerPredictive[_0x0909('0x80')](_0x0909('0x84'));if(!_[_0x0909('0x3e')](_0x2e7099[_0x0909('0x6a')])&&_0x2e7099[_0x0909('0x6a')]>0x0){return!![];}loggerPredictive[_0x0909('0x80')](_0x0909('0x85'));}else{loggerPredictive['info'](_0x0909('0x86'));}}else{loggerPredictive[_0x0909('0x80')](_0x0909('0x87'));}return![];}function mergeDataErlangB(_0x269fff){return function(_0x4a0e8e){loggerPredictive[_0x0909('0x80')]('---------\x20ErlangB\x20---------');loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a0e8e[_0x0909('0x70')]);loggerPredictive[_0x0909('0x80')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a0e8e['erlangCallToSecond']);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a0e8e['erlangAbandonmentRate']);loggerPredictive[_0x0909('0x80')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a0e8e[_0x0909('0x72')]);loggerPredictive[_0x0909('0x80')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4a0e8e[_0x0909('0x88')]);loggerPredictive[_0x0909('0x80')](_0x0909('0x89'));_[_0x0909('0x8a')](_0x269fff,_0x4a0e8e);};}function getDiff(_0x3800a6){var _0x4b8906=moment()[_0x0909('0x4c')](0x0);var _0x118dcd=moment(_0x3800a6)[_0x0909('0x4c')](0x0);return _0x4b8906[_0x0909('0x4d')](_0x118dcd,'seconds');}function ifInterval(_0x378d41,_0x15c5ec){if(_['isUndefined'](_0x15c5ec)){return![];}return getDiff(_0x15c5ec)<_0x378d41*0x3c;}function freeVariablesPredictive(_0x3d2192){if(isNotNull(_0x3d2192)){if(!_[_0x0909('0x3e')](_0x3d2192[_0x0909('0x2a')])){_0x3d2192[_0x0909('0x2a')]=undefined;loggerPredictive[_0x0909('0x80')](_0x3d2192[_0x0909('0x40')],_0x0909('0x8b'));}if(!_[_0x0909('0x3e')](_0x3d2192['startPredictive'])){_0x3d2192[_0x0909('0x29')]=undefined;loggerPredictive[_0x0909('0x80')](_0x3d2192['name'],_0x0909('0x8c'));}if(!_['isUndefined'](_0x3d2192[_0x0909('0x8d')])){clearInterval(_0x3d2192['handlePredictive']);_0x3d2192[_0x0909('0x8d')]=undefined;loggerPredictive[_0x0909('0x80')](_0x3d2192[_0x0909('0x40')],_0x0909('0x8e'));}}}function erlangb(_0x1cb6ba,_0x36d7fc){if(_0x36d7fc===0x0){return 0x0;}var _0x1e260b=0x1;for(var _0x5c040c=0x1;_0x5c040c<=_0x36d7fc;_0x5c040c+=0x1){_0x1e260b=0x1+_0x1e260b*_0x5c040c/_0x1cb6ba;}return 0x1/_0x1e260b;}function isVoiceQueueOutbound(_0x145903){return _0x145903==='outbound';}function isNotPreview(_0x20b9b6){return _0x20b9b6!==_0x0909('0x20');}function isCampaignIvr(_0x51870d){return _0x51870d===_0x0909('0x8f');}function getCallerId(_0x11e595,_0x5c40ab,_0x2639e7){if(!_['isUndefined'](_0x2639e7)&&typeof _0x2639e7===_0x0909('0x90')&&!_[_0x0909('0x47')](_0x2639e7)){if(!_[_0x0909('0x3e')](_0x5c40ab)&&typeof _0x5c40ab===_0x0909('0x90')&&!_[_0x0909('0x47')](_0x5c40ab)){return util[_0x0909('0x77')]('\x22%s\x22\x20<%s>',_0x5c40ab,_0x2639e7);}return util[_0x0909('0x77')]('\x22%s\x22\x20<%s>',_0x2639e7,_0x2639e7);}if(!_[_0x0909('0x3e')](_0x11e595)&&typeof _0x11e595===_0x0909('0x90')&&!_['isEmpty'](_0x11e595)){return _0x11e595;}return _0x0909('0x91');}function loggerCatchQueueSummary(_0x34f216,_0x5ea554){return function(_0x45b993){freeVariablesPredictive(_0x5ea554);emitVoiceQueueSummary(_0x5ea554);emitCampaignSummary(_0x5ea554);loggerSyncQueueSummary[_0x0909('0x92')](_0x34f216,util[_0x0909('0x93')](_0x45b993,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x436a3d,_0x2bd77d){return function(_0x2cddbf){loggerPredictive[_0x0909('0x92')](_0x2bd77d[_0x0909('0x40')],_0x436a3d);loggerPredictive[_0x0909('0x92')](_0x2cddbf[_0x0909('0x94')]);freeVariablesPredictive(_0x2bd77d);};}function loggerCatch(_0x54335b){return function(_0x2d6a36){logger[_0x0909('0x92')](_0x54335b,util[_0x0909('0x93')](_0x2d6a36,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4647de){return _0x4647de&&!_[_0x0909('0x3e')](_0x4647de)&&_0x4647de['length']>0x0;}function decremetOriginate(_0x11811e){if(!_['isUndefined'](_0x11811e)&&_0x11811e!==null){if(typeof _0x11811e['originated']!==_0x0909('0x95')){if(_0x11811e[_0x0909('0x6f')]>0x0){_0x11811e['originated']-=0x1;}else{logger[_0x0909('0x92')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x0909('0x92')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x1b06ee,_0x563282,_0x19a471){if(_0x563282>_0x19a471){for(var _0x4e7e8d=0x0;_0x4e7e8d<_0x563282-_0x19a471;_0x4e7e8d+=0x1){decremetOriginate(_0x1b06ee);}}}function loggerGetContactDialer(_0xe6b52,_0x1e22e7,_0x23781b){return function(_0x20993f){checkContactLowerLimitOriginate(_0x1e22e7,_0x23781b,0x0);logger[_0x0909('0x92')](_0xe6b52,util[_0x0909('0x93')](_0x20993f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5c4a1e){return function(_0x161173){if(isNotNull(_0x161173)&&isNotNull(_0x161173[0x0])){if(_0x161173[0x0][_0x0909('0x96')]>0x0){_0x5c4a1e[_0x0909('0x41')]='RESCHEDULED_CONTACTS';logger[_0x0909('0x80')]('[getContactDialer2][ReScheduled]'+_0x5c4a1e['name'],_0x161173[0x0][_0x0909('0x96')],'contacts');}else{_0x5c4a1e[_0x0909('0x41')]=_0x0909('0x97');logger['info'](_0x0909('0x98')+_0x5c4a1e[_0x0909('0x40')]);}}};}function notSendMessagesQueue(_0x20e17e){if(_0x20e17e[_0x0909('0x99')]){freeVariablesPredictive(_0x20e17e);if(_0x20e17e[_0x0909('0x6f')]===0x0&&_0x20e17e[_0x0909('0x58')]===0x0&&_0x20e17e[_0x0909('0x5b')]===0x0&&(_0x20e17e[_0x0909('0x54')]||0x0)===0x0){_0x20e17e['sendMessageOneNotActive']=![];_0x20e17e[_0x0909('0x9a')]=0x0;_0x20e17e[_0x0909('0x41')]=_0x0909('0x42');loggerSyncQueueSummary[_0x0909('0x92')](_0x0909('0x9b'),_0x20e17e['name'],_0x0909('0x9c'));}else{_0x20e17e[_0x0909('0x41')]=_0x0909('0x9d');loggerSyncQueueSummary[_0x0909('0x92')](_0x0909('0x9b'),_0x20e17e[_0x0909('0x40')],_0x0909('0x9e'));}emitVoiceQueueSummary(_0x20e17e);}}function notSendMessagesCampaign(_0x66d838){if(_0x66d838['sendMessageOneNotActive']){if(_0x66d838[_0x0909('0x6f')]===0x0){_0x66d838['sendMessageOneNotActive']=![];_0x66d838[_0x0909('0x41')]=_0x0909('0x42');loggerSyncQueueSummary[_0x0909('0x92')](_0x0909('0x9f'),_0x66d838[_0x0909('0x40')],'is\x20not\x20active');}else{_0x66d838[_0x0909('0x41')]=_0x0909('0x9d');loggerSyncQueueSummary[_0x0909('0x92')](_0x0909('0x9f'),_0x66d838['name'],_0x0909('0x9e'));}emitCampaignSummary(_0x66d838);}}function createObjHistory(_0x6215e9,_0x3061ae,_0x2546dc,_0x11b779,_0x152084){_0x6215e9[_0x0909('0x41')]=_0x2546dc;var _0x5e15b4=new Action(_0x6215e9,_0x3061ae);var _0x3de76e=new History(_0x5e15b4);_0x3de76e['state']=_0x11b779;_0x3de76e[_0x0909('0xa0')]=_0x152084;_0x3de76e['endtime']=_0x5e15b4[_0x0909('0xa1')];return _0x3de76e;}Dialer[_0x0909('0x1b')][_0x0909('0x3d')]=function(){var _0x221715=this;setInterval(function(){_0x221715[_0x0909('0xa2')](_0x221715[_0x0909('0x27')],_0x0909('0xa3'));_0x221715[_0x0909('0xa2')](_0x221715[_0x0909('0x26')],'[actions]');},0x32c8);};Dialer[_0x0909('0x1b')][_0x0909('0xa2')]=function(_0x42b7fe,_0x4315f5){var _0x5880fd=this;for(var _0x39f63b in _0x42b7fe){if(typeof _0x42b7fe[_0x39f63b]!==_0x0909('0x95')){this[_0x0909('0x1f')][_0x0909('0x1c')](function(){if(!_[_0x0909('0xa4')](_0x42b7fe[_0x39f63b])){return ami[_0x0909('0xa5')]({'action':_0x0909('0xa6'),'channel':_0x42b7fe[_0x39f63b][_0x0909('0xa7')]})[_0x0909('0xa8')](function(_0x41c43b){if(_0x41c43b[_0x0909('0x41')]===_0x0909('0xa9')){setTimeout(function(){if(_0x42b7fe[_0x39f63b]&&_0x42b7fe[_0x39f63b][_0x0909('0x50')]!==_0x0909('0x8f')){_0x5880fd[_0x0909('0xaa')](_0x5880fd[_0x0909('0x21')][_0x42b7fe[_0x39f63b][_0x0909('0xab')]]);logger[_0x0909('0x92')](_0x0909('0xac'),_0x4315f5,_0x39f63b,_0x42b7fe[_0x39f63b]['queue']);delete _0x42b7fe[_0x39f63b];}if(_0x42b7fe[_0x39f63b]&&_0x42b7fe[_0x39f63b][_0x0909('0x50')]===_0x0909('0x8f')){_0x5880fd[_0x0909('0xaa')](_0x5880fd[_0x0909('0x22')][_0x42b7fe[_0x39f63b]['queue']]);logger[_0x0909('0x92')](_0x0909('0xad'),_0x4315f5,_0x39f63b,_0x42b7fe[_0x39f63b][_0x0909('0xab')]);delete _0x42b7fe[_0x39f63b];}},0x2328);}});}});}}};Dialer[_0x0909('0x1b')][_0x0909('0xae')]=function(_0x3d389d){return BPromise['resolve']()[_0x0909('0xaf')](cmHopper[_0x0909('0xae')](_0x3d389d))[_0x0909('0xa8')](loggerCatch(_0x0909('0xb0')));};Dialer[_0x0909('0x1b')][_0x0909('0xb1')]=function(_0xa4f2a9){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0xa4f2a9))[_0x0909('0xa8')](loggerCatch(_0x0909('0xb2')));};Dialer[_0x0909('0x1b')][_0x0909('0xb3')]=function(_0x4b1ee4){return BPromise[_0x0909('0xb4')]()[_0x0909('0xaf')](cmHopperBlack['checkIsBlackListIvr'](_0x4b1ee4))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x0909('0x1b')][_0x0909('0xb5')]=function(_0x17bc2f){return BPromise[_0x0909('0xb4')]()[_0x0909('0xaf')](cmHopperHistory[_0x0909('0xb6')](_0x17bc2f))[_0x0909('0xa8')](loggerCatch(_0x0909('0xb7')));};Dialer['prototype']['rescheduleContact']=function(_0x42d15c){return BPromise[_0x0909('0xb4')]()[_0x0909('0xaf')](cmHopper[_0x0909('0xb8')](_0x42d15c))[_0x0909('0xa8')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x0909('0x1b')]['unlockContact']=function(_0x508df2,_0x4af886,_0x18d5d2){return BPromise[_0x0909('0xb4')]()[_0x0909('0xaf')](cmHopper[_0x0909('0xb9')](_0x508df2,_0x4af886,_0x18d5d2))['catch'](loggerCatch(_0x0909('0xba')));};Dialer['prototype'][_0x0909('0xbb')]=function(_0x78a395,_0x490600,_0xa110af,_0x310e3e,_0x332a01){return BPromise[_0x0909('0xb4')]()[_0x0909('0xaf')](cmHopper[_0x0909('0xbb')](_0x78a395,_0x490600,_0xa110af,_0x310e3e))[_0x0909('0xa8')](function(_0x4d7a32){_0x332a01['temp']-=_0xa110af;_0x332a01['temp']=_0x332a01[_0x0909('0xbc')]>0x0?_0x332a01[_0x0909('0xbc')]:0x0;loggerCatch(_0x0909('0xbd'))(_0x4d7a32);});};Dialer['prototype']['getContactDialerIvr']=function(_0x31e956,_0xadbbd8,_0x2094bd,_0x406e06){return BPromise[_0x0909('0xb4')]()['then'](cmHopper[_0x0909('0xbe')](_0x31e956,_0xadbbd8,_0x2094bd))[_0x0909('0xa8')](function(_0xaaa7d0){_0x406e06[_0x0909('0xbc')]-=_0xadbbd8;_0x406e06[_0x0909('0xbc')]=_0x406e06['temp']>0x0?_0x406e06[_0x0909('0xbc')]:0x0;loggerCatch(_0x0909('0xbf'))(_0xaaa7d0);});};Dialer[_0x0909('0x1b')][_0x0909('0xc0')]=function(_0x3b6050){return BPromise[_0x0909('0xb4')]()[_0x0909('0xaf')](voiceQueueRt[_0x0909('0xc0')](_0x3b6050))[_0x0909('0xa8')](loggerCatch(_0x0909('0xc1')));};Dialer[_0x0909('0x1b')][_0x0909('0xc2')]=function(_0x4bccf2){return BPromise[_0x0909('0xb4')]()['then'](cmHopper[_0x0909('0xc2')](_0x4bccf2))[_0x0909('0xa8')](loggerCatch(_0x0909('0xc3')));};Dialer['prototype'][_0x0909('0xc4')]=function(_0x35e6f6){return BPromise[_0x0909('0xb4')]()[_0x0909('0xaf')](cmHopperHistory[_0x0909('0xc4')](_0x35e6f6))[_0x0909('0xa8')](loggerCatch(_0x0909('0xc5')));};Dialer['prototype'][_0x0909('0xaa')]=function(_0x4a96a1){if(!_[_0x0909('0x3e')](_0x4a96a1)&&_0x4a96a1!==null){if(typeof _0x4a96a1['originated']!==_0x0909('0x95')){if(_0x4a96a1['originated']>0x0){_0x4a96a1[_0x0909('0x6f')]-=0x1;}else{logger[_0x0909('0x92')](_0x0909('0xc6'));}}}else{logger[_0x0909('0x92')](_0x0909('0xc7'));}};Dialer[_0x0909('0x1b')][_0x0909('0xc8')]=function(_0x3fbdb4,_0x435ff3){var _0x565be3=this;return function(_0x16e29a){_0x565be3[_0x0909('0xaa')](_0x435ff3);logger[_0x0909('0x92')](_0x3fbdb4,util[_0x0909('0x93')](_0x16e29a,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x0909('0xc9')]=function(_0x33b5b6,_0x28df60,_0x2013e9){var _0xf3e560={'state':0x19,'statedesc':'notFound'};this[_0x0909('0xaa')](_0x28df60);this[_0x0909('0xca')](_[_0x0909('0x8a')](_0xf3e560,_[_0x0909('0xcb')](_0x2013e9,[_0x0909('0xcc'),_0x0909('0xcd'),'UserId',_0x0909('0xce'),_0x0909('0xcf')])),_0x0909('0xd0'),_0x0909('0xd1'));logger[_0x0909('0x92')](_0x33b5b6);};Dialer[_0x0909('0x1b')][_0x0909('0xd2')]=function(_0x1cc669){return _0x1cc669===_0x0909('0xd3');};Dialer['prototype'][_0x0909('0xd4')]=function(_0x2bd754){return!_[_0x0909('0x3e')](_0x2bd754)&&_0x2bd754&&!_['isUndefined'](_0x2bd754[_0x0909('0x40')])&&!_[_0x0909('0x3e')](_0x2bd754[_0x0909('0x74')])&&_0x2bd754[_0x0909('0x74')]&&(this['trunks'][util['format'](_0x0909('0xd5'),_0x2bd754['name'])][_0x0909('0xa6')]===_0x0909('0xd6')||this[_0x0909('0x24')][util['format'](_0x0909('0xd5'),_0x2bd754[_0x0909('0x40')])][_0x0909('0xa6')]===_0x0909('0xd7'));};Dialer['prototype']['saveInDb']=function(_0x1cffb7,_0x46ec6f,_0x18f048){this[_0x0909('0xc4')](_0x1cffb7)[_0x0909('0xa8')](loggerCatch(_0x46ec6f));this[_0x0909('0xc2')](_0x1cffb7)[_0x0909('0xa8')](loggerCatch(_0x18f048));};Dialer[_0x0909('0x1b')][_0x0909('0x39')]=function(_0xcf2246){var _0x97b51d=this[_0x0909('0x27')][_0xcf2246[_0x0909('0xd8')]];var _0x286604;if(!_[_0x0909('0xa4')](_0xcf2246)&&!_[_0x0909('0xa4')](_0xcf2246[_0x0909('0xd9')])&&!_[_0x0909('0xa4')](_0xcf2246['variable']['amdstatus'])&&_0xcf2246[_0x0909('0xda')]===_0x0909('0xdb')&&_0x97b51d){if(_0x97b51d['type']!==_0x0909('0x8f')&&this[_0x0909('0x21')][_0x97b51d[_0x0909('0xab')]][_0x0909('0xdc')]&&_0xcf2246[_0x0909('0xdd')]===_0x0909('0xde')){delete this['uniqueId'][_0xcf2246[_0x0909('0xd8')]];this[_0x0909('0xaa')](this[_0x0909('0x21')][_0x97b51d[_0x0909('0xab')]]);this[_0x0909('0x21')][_0x97b51d[_0x0909('0xab')]][_0x0909('0x61')]+=0x1;this['voiceQueues'][_0x97b51d[_0x0909('0xab')]]['outboundAnswerAgiCallsDay']+=0x1;_0x286604=new Hangup(_0x97b51d,_0xcf2246);_0x286604[_0x0909('0xdf')]=0x12;_0x286604[_0x0909('0xa0')]=_0x0909('0xe0');_0x286604[_0x0909('0xe1')]=_0x0909('0xe2');ami[_0x0909('0x4f')](_0x0909('0xe3'),ut[_0x0909('0xe4')](_0x286604,_0x0909('0xe5')));this[_0x0909('0xca')](_0x286604,_0x0909('0xe6'),_0x0909('0xe7'));}if(_0x97b51d[_0x0909('0x50')]!==_0x0909('0x8f')&&this[_0x0909('0x21')][_0x97b51d[_0x0909('0xab')]][_0x0909('0xdc')]&&_0xcf2246['value']===_0x0909('0xe8')){var _0x1a9e7e=this;return new BPromise(function(_0x2ffa58,_0x2366ab){delete _0x1a9e7e['uniqueId'][_0xcf2246[_0x0909('0xd8')]];_0x1a9e7e[_0x0909('0xaa')](_0x1a9e7e[_0x0909('0x21')][_0x97b51d[_0x0909('0xab')]]);_0x1a9e7e[_0x0909('0x21')][_0x97b51d['queue']][_0x0909('0x61')]+=0x1;_0x1a9e7e['voiceQueues'][_0x97b51d[_0x0909('0xab')]][_0x0909('0xe9')]+=0x1;var _0x34c94d=_0x1a9e7e[_0x0909('0x21')][_0x97b51d[_0x0909('0xab')]];var _0x1c12d8=new Hangup(_0x97b51d,_0xcf2246);_0x1c12d8[_0x0909('0xdf')]=0x13;_0x1c12d8['statedesc']=_0x0909('0xea');_0x1c12d8['membername']=_0x0909('0xe2');_0x1c12d8[_0x0909('0xeb')]+=0x1;_0x1c12d8[_0x0909('0xec')]+=0x1;_0x1c12d8[_0x0909('0xe5')]=!![];ami['emit'](_0x0909('0xe3'),ut[_0x0909('0xe4')](_0x1c12d8,_0x0909('0xe5')));_0x1a9e7e[_0x0909('0xc4')](_0x1c12d8)['catch'](loggerCatch(_0x0909('0xed')));if(_0x1c12d8[_0x0909('0xee')]+_0x1c12d8[_0x0909('0xef')]+_0x1c12d8[_0x0909('0xf0')]+_0x1c12d8[_0x0909('0xf1')]+_0x1c12d8[_0x0909('0xf2')]+_0x1c12d8[_0x0909('0xf3')]+_0x1c12d8[_0x0909('0xeb')]+_0x1c12d8[_0x0909('0xf4')]>=_0x34c94d[_0x0909('0xf5')]){_0x1a9e7e[_0x0909('0xf6')](_0x1c12d8,_0x2ffa58,_0x2366ab,'reason19\x20machine....');}else{if(_0x1c12d8[_0x0909('0xeb')]>=_0x34c94d['dialMachineMaxRetry']){_0x1a9e7e['createStateFinal'](_0x1c12d8,_0x2ffa58,_0x2366ab,_0x0909('0xf7'));}else{_0x1a9e7e[_0x0909('0xb8')]({'active':![],'countmachineretry':_0x1c12d8[_0x0909('0xeb')],'scheduledat':moment()[_0x0909('0xf8')](_0x34c94d['dialMachineRetryFrequency'],'minutes')[_0x0909('0x77')](_0x0909('0xf9')),'ContactId':_0x1c12d8[_0x0909('0xcc')],'ListId':_0x1c12d8[_0x0909('0xcd')],'VoiceQueueId':_0x1c12d8[_0x0909('0xce')]||undefined,'CampaignId':_0x1c12d8[_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch('[rescheduleContact][Machine]'));_0x2ffa58({'reschedule':0x1});}}});}if(_0x97b51d[_0x0909('0x50')]===_0x0909('0x8f')&&this[_0x0909('0x22')][_0x97b51d[_0x0909('0xab')]][_0x0909('0xdc')]&&_0xcf2246['value']===_0x0909('0xde')){delete this[_0x0909('0x27')][_0xcf2246[_0x0909('0xd8')]];this['updateOriginated'](this['campaigns'][_0x97b51d[_0x0909('0xab')]]);_0x286604=new Hangup(_0x97b51d,_0xcf2246);_0x286604[_0x0909('0xdf')]=0x12;_0x286604['statedesc']=_0x0909('0xe0');_0x286604[_0x0909('0xe1')]='AMD';ami[_0x0909('0x4f')](_0x0909('0xe3'),ut[_0x0909('0xe4')](_0x286604,_0x0909('0xe5')));this[_0x0909('0xca')](_0x286604,'[syncHangupInAMDIvr][createHistory]',_0x0909('0xfa'));}if(_0x97b51d[_0x0909('0x50')]===_0x0909('0x8f')&&this[_0x0909('0x22')][_0x97b51d[_0x0909('0xab')]][_0x0909('0xdc')]&&_0xcf2246['value']===_0x0909('0xe8')){var _0x1a9e7e=this;return new BPromise(function(_0x21ac02,_0x1d0a53){delete _0x1a9e7e[_0x0909('0x27')][_0xcf2246[_0x0909('0xd8')]];_0x1a9e7e[_0x0909('0xaa')](_0x1a9e7e[_0x0909('0x22')][_0x97b51d[_0x0909('0xab')]]);_0x1a9e7e['campaigns'][_0x97b51d['queue']][_0x0909('0x61')]+=0x1;_0x1a9e7e['campaigns'][_0x97b51d[_0x0909('0xab')]][_0x0909('0xe9')]+=0x1;var _0xd60e47=_0x1a9e7e[_0x0909('0x22')][_0x97b51d['queue']];var _0x3c407c=new Hangup(_0x97b51d,_0xcf2246);_0x3c407c[_0x0909('0xdf')]=0x13;_0x3c407c[_0x0909('0xa0')]='Machine';_0x3c407c[_0x0909('0xe1')]='AMD';_0x3c407c[_0x0909('0xeb')]+=0x1;_0x3c407c[_0x0909('0xec')]+=0x1;_0x3c407c[_0x0909('0xe5')]=!![];ami[_0x0909('0x4f')]('custom:amd',ut['buildObj'](_0x3c407c,'amd'));_0x1a9e7e[_0x0909('0xc4')](_0x3c407c)[_0x0909('0xa8')](loggerCatch(_0x0909('0xed')));if(_0x3c407c[_0x0909('0xee')]+_0x3c407c[_0x0909('0xef')]+_0x3c407c[_0x0909('0xf0')]+_0x3c407c[_0x0909('0xf1')]+_0x3c407c[_0x0909('0xf2')]+_0x3c407c['countabandonedretry']+_0x3c407c['countmachineretry']+_0x3c407c[_0x0909('0xf4')]>=_0xd60e47['dialGlobalMaxRetry']){_0x1a9e7e[_0x0909('0xf6')](_0x3c407c,_0x21ac02,_0x1d0a53,_0x0909('0xfb'));}else{if(_0x3c407c['countmachineretry']>=_0xd60e47[_0x0909('0xfc')]){_0x1a9e7e['createStateFinal'](_0x3c407c,_0x21ac02,_0x1d0a53,_0x0909('0xf7'));}else{_0x1a9e7e['rescheduleContact']({'active':![],'countmachineretry':_0x3c407c[_0x0909('0xeb')],'scheduledat':moment()['add'](_0xd60e47['dialMachineRetryFrequency'],_0x0909('0xfd'))[_0x0909('0x77')](_0x0909('0xf9')),'ContactId':_0x3c407c[_0x0909('0xcc')],'ListId':_0x3c407c[_0x0909('0xcd')],'VoiceQueueId':_0x3c407c['VoiceQueueId']||undefined,'CampaignId':_0x3c407c[_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch(_0x0909('0xfe')));_0x21ac02({'reschedule':0x1});}}});}}};Dialer[_0x0909('0x1b')][_0x0909('0x37')]=function(_0x245bcc){var _0x360d14=this['uniqueId'][_0x245bcc['uniqueid']];var _0x487f9e=this;var _0x52a93d;if(_0x360d14&&_0x360d14[_0x0909('0x50')]===_0x0909('0x8f')){delete this[_0x0909('0x27')][_0x245bcc[_0x0909('0xd8')]];this['updateOriginated'](this[_0x0909('0x22')][_0x360d14[_0x0909('0xab')]]);this[_0x0909('0x22')][_0x360d14['queue']][_0x0909('0xff')]+=0x1;_0x52a93d=new Hangup(_0x360d14,_0x245bcc);this[_0x0909('0xc4')](_0x52a93d)['catch'](loggerCatch(_0x0909('0x100')));this[_0x0909('0xc2')](_0x52a93d)[_0x0909('0xa8')](loggerCatch(_0x0909('0x101')));}if(_0x360d14&&_0x360d14[_0x0909('0x50')]!==_0x0909('0x8f')&&isNotNull(this[_0x0909('0x21')][_0x360d14[_0x0909('0xab')]]['dialQueueProject'])){delete this['uniqueId'][_0x245bcc[_0x0909('0xd8')]];this[_0x0909('0xaa')](this[_0x0909('0x21')][_0x360d14[_0x0909('0xab')]]);this[_0x0909('0x21')][_0x360d14[_0x0909('0xab')]][_0x0909('0x61')]+=0x1;this['voiceQueues'][_0x360d14[_0x0909('0xab')]][_0x0909('0xe9')]+=0x1;_0x52a93d=new Hangup(_0x360d14,_0x245bcc);_0x52a93d['state']=0x10;_0x52a93d[_0x0909('0xa0')]='AnswerAGI';_0x52a93d[_0x0909('0xe1')]=_0x0909('0x102');this[_0x0909('0xc4')](_0x52a93d)[_0x0909('0xa8')](loggerCatch(_0x0909('0x100')));this['moveContactManagedDialer'](_0x52a93d)[_0x0909('0xa8')](loggerCatch(_0x0909('0x101')));}if(_0x360d14&&_0x360d14[_0x0909('0x50')]!==_0x0909('0x8f')&&!isNotNull(this[_0x0909('0x21')][_0x360d14[_0x0909('0xab')]][_0x0909('0x103')])){delete this[_0x0909('0x27')][_0x245bcc['uniqueid']];this[_0x0909('0xaa')](this[_0x0909('0x21')][_0x360d14[_0x0909('0xab')]]);this[_0x0909('0x21')][_0x360d14[_0x0909('0xab')]][_0x0909('0x104')]+=0x1;_0x52a93d=new Hangup(_0x360d14,_0x245bcc);_0x52a93d[_0x0909('0xdf')]=0xc;_0x52a93d[_0x0909('0xa0')]=_0x245bcc[_0x0909('0x105')];_0x52a93d['membername']='Unknow';this[_0x0909('0xc4')](_0x52a93d)[_0x0909('0xa8')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x0909('0xc2')](_0x52a93d)['catch'](loggerCatch(_0x0909('0x101')));}};Dialer['prototype'][_0x0909('0x33')]=function(_0x395da8){var _0xf51301=this[_0x0909('0x27')][_0x395da8[_0x0909('0xd8')]];var _0xe7c0ca=this;if(this[_0x0909('0x21')][_0x395da8[_0x0909('0xab')]]){if(_0xf51301&&_0xf51301[_0x0909('0x50')]!==_0x0909('0x8f')){delete this['uniqueId'][_0x395da8[_0x0909('0xd8')]];this[_0x0909('0x21')][_0x395da8[_0x0909('0xab')]][_0x0909('0x61')]+=0x1;var _0x3df875=new AgentComplete(_0xf51301,_0x395da8);if(_0x395da8[_0x0909('0x106')]===_0x0909('0x107')){_0x3df875[_0x0909('0x108')]=this['voiceQueues'][_0x395da8[_0x0909('0xab')]][_0x0909('0x109')]&&this['voiceQueues'][_0x395da8[_0x0909('0xab')]][_0x0909('0x10a')]?moment()['format'](_0x0909('0xf9')):undefined;}this['createHistory'](_0x3df875)[_0x0909('0xa8')](loggerCatch(_0x0909('0x10b')));this[_0x0909('0xc2')](_0x3df875)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x0909('0x1b')][_0x0909('0x10c')]=function(_0x1102f7){if(this[_0x0909('0x21')][_0x1102f7[_0x0909('0xab')]]){if(this[_0x0909('0x27')][_0x1102f7['uniqueid']]&&this[_0x0909('0x27')][_0x1102f7[_0x0909('0xd8')]]['type']!=='ivr'){this[_0x0909('0xaa')](this[_0x0909('0x21')][_0x1102f7[_0x0909('0xab')]]);this[_0x0909('0x27')][_0x1102f7['uniqueid']][_0x0909('0x10d')]=moment()[_0x0909('0x77')](_0x0909('0xf9'));}}};Dialer[_0x0909('0x1b')][_0x0909('0x10e')]=function(_0x125d33){this[_0x0909('0xc4')](_0x125d33)[_0x0909('0xa8')](loggerCatch(_0x0909('0x10b')));this['moveContactManagedDialer'](_0x125d33)['catch'](loggerCatch(_0x0909('0x10f')));};Dialer['prototype'][_0x0909('0x30')]=function(_0x274955){var _0x5b59dd=this[_0x0909('0x27')][_0x274955[_0x0909('0xd8')]];var _0x106dfe=this;if(this[_0x0909('0x21')][_0x274955[_0x0909('0xab')]]){if(_0x5b59dd&&_0x5b59dd[_0x0909('0x50')]!=='ivr'){delete this[_0x0909('0x27')][_0x274955[_0x0909('0xd8')]];this[_0x0909('0xaa')](this[_0x0909('0x21')][_0x274955[_0x0909('0xab')]]);_0x5b59dd[_0x0909('0x110')]=moment()[_0x0909('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x10e4f5=new QueueCallerAbandon(_0x5b59dd,_0x274955);if(getSeconds(_0x5b59dd[_0x0909('0x110')],_0x5b59dd['responsetime'])>=_0x5b59dd['dialQueueTimeout']){this['voiceQueues'][_0x274955[_0x0909('0xab')]][_0x0909('0x7f')]+=0x1;this['voiceQueues'][_0x274955[_0x0909('0xab')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x0909('0x21')][_0x274955[_0x0909('0xab')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x10e4f5['state']=0xa;_0x10e4f5['statedesc']=_0x0909('0x111');_0x10e4f5[_0x0909('0x112')]=_0x0909('0x113');_0x10e4f5[_0x0909('0x108')]=this[_0x0909('0x21')][_0x274955['queue']][_0x0909('0x109')]?moment()[_0x0909('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x10e4f5['countdropretry']+=0x1;_0x10e4f5['countglobal']+=0x1;if(_0x10e4f5['countdropretry']>=this[_0x0909('0x21')][_0x274955['queue']][_0x0909('0x114')]){this[_0x0909('0x10e')](_0x10e4f5);}else{this[_0x0909('0xb8')]({'active':![],'countdropretry':_0x10e4f5[_0x0909('0xf2')],'scheduledat':moment()[_0x0909('0xf8')](this[_0x0909('0x21')][_0x274955[_0x0909('0xab')]][_0x0909('0x115')],_0x0909('0xfd'))[_0x0909('0x77')](_0x0909('0xf9')),'ContactId':_0x5b59dd[_0x0909('0xcc')],'ListId':_0x5b59dd[_0x0909('0xcd')],'VoiceQueueId':_0x5b59dd[_0x0909('0xce')]||undefined,'CampaignId':_0x5b59dd[_0x0909('0xcf')]||undefined})['catch'](loggerCatch(_0x0909('0x116')));var _0x172a51=new History(_0x10e4f5);_0x172a51['state']=0xa;_0x172a51['statedesc']='Drop';_0x172a51['starttime']=moment()[_0x0909('0x77')](_0x0909('0xf9'));_0x172a51[_0x0909('0x117')]=_0x172a51[_0x0909('0xa1')];_0x172a51[_0x0909('0x118')]=_0x10e4f5[_0x0909('0x118')];_0x172a51[_0x0909('0x119')]=_0x10e4f5['calleridnum'];this[_0x0909('0xc4')](_0x172a51)['catch'](loggerCatch(_0x0909('0x11a')));}}else{this[_0x0909('0x21')][_0x274955[_0x0909('0xab')]][_0x0909('0x82')]+=0x1;this[_0x0909('0x21')][_0x274955[_0x0909('0xab')]]['outboundDropCallsDayCallersExit']+=0x1;_0x10e4f5[_0x0909('0xdf')]=0xb;_0x10e4f5[_0x0909('0xa0')]=_0x0909('0x11b');_0x10e4f5['dropreason']=_0x0909('0x11c');_0x10e4f5[_0x0909('0xf3')]+=0x1;_0x10e4f5[_0x0909('0xec')]+=0x1;if(_0x10e4f5['countabandonedretry']>=this[_0x0909('0x21')][_0x274955['queue']][_0x0909('0x11d')]){this[_0x0909('0x10e')](_0x10e4f5);}else{this[_0x0909('0xb8')]({'active':![],'countabandonedretry':_0x10e4f5['countabandonedretry'],'scheduledat':moment()['add'](this[_0x0909('0x21')][_0x274955['queue']][_0x0909('0x11e')],_0x0909('0xfd'))[_0x0909('0x77')](_0x0909('0xf9')),'ContactId':_0x5b59dd[_0x0909('0xcc')],'ListId':_0x5b59dd[_0x0909('0xcd')],'VoiceQueueId':_0x5b59dd[_0x0909('0xce')]||undefined,'CampaignId':_0x5b59dd[_0x0909('0xcf')]||undefined})['catch'](loggerCatch(_0x0909('0x11f')));var _0x172a51=new History(_0x10e4f5);_0x172a51[_0x0909('0xdf')]=0xb;_0x172a51[_0x0909('0xa0')]=_0x0909('0x11b');_0x172a51[_0x0909('0xa1')]=moment()['format'](_0x0909('0xf9'));_0x172a51[_0x0909('0x117')]=_0x172a51[_0x0909('0xa1')];_0x172a51[_0x0909('0x118')]=_0x10e4f5['calleridname'];_0x172a51['calleridnum']=_0x10e4f5[_0x0909('0x119')];this[_0x0909('0xc4')](_0x172a51)[_0x0909('0xa8')](loggerCatch(_0x0909('0x120')));}}}}};Dialer[_0x0909('0x1b')][_0x0909('0x38')]=function(_0x5b9a2c){if(this[_0x0909('0x26')][_0x5b9a2c[_0x0909('0xd8')]]){this[_0x0909('0x26')][_0x5b9a2c[_0x0909('0xd8')]][_0x0909('0xa7')]=_0x5b9a2c[_0x0909('0xa7')];}if(this[_0x0909('0x27')][_0x5b9a2c[_0x0909('0xd8')]]){this[_0x0909('0x27')][_0x5b9a2c[_0x0909('0xd8')]][_0x0909('0xa7')]=_0x5b9a2c[_0x0909('0xa7')];}};Dialer['prototype'][_0x0909('0x3a')]=function(_0x37db67){if(strategy[this[_0x0909('0x21')][this['actions'][_0x37db67['actionid']][_0x0909('0xab')]][_0x0909('0x121')]]===_0x0909('0x1a')){if(this[_0x0909('0x26')][_0x37db67['actionid']]&&_[_0x0909('0xa4')](this[_0x0909('0x26')][_0x37db67[_0x0909('0x122')]][_0x0909('0x123')])&&_0x37db67[_0x0909('0xa6')]==='1'&&_0x37db67[_0x0909('0x124')]==='0'){if(this['agents'][_0x37db67[_0x0909('0x125')]]){if(!this[_0x0909('0x23')][_0x37db67[_0x0909('0x125')]][_0x0909('0x123')]){this['agents'][_0x37db67[_0x0909('0x125')]]['locked']=!![];this[_0x0909('0x26')][_0x37db67['actionid']][_0x0909('0x123')]=!![];this['actions'][_0x37db67[_0x0909('0x122')]][_0x0909('0x125')]=_0x37db67['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x0909('0x26')][_0x37db67[_0x0909('0x122')]][_0x0909('0xab')]][_0x0909('0x121')]]||_0x0909('0x19'))===_0x0909('0x19')){if(this[_0x0909('0x26')][_0x37db67[_0x0909('0x122')]]){if(this['agents'][_0x37db67['stateinterface']]){this[_0x0909('0x26')][_0x37db67[_0x0909('0x122')]][_0x0909('0x125')]=_0x37db67[_0x0909('0x125')];if(_[_0x0909('0xa4')](this[_0x0909('0x2c')][this['actions'][_0x37db67['actionid']][_0x0909('0xab')]])){this[_0x0909('0x2c')][this[_0x0909('0x26')][_0x37db67['actionid']][_0x0909('0xab')]]=[];}this[_0x0909('0x2c')][this[_0x0909('0x26')][_0x37db67[_0x0909('0x122')]][_0x0909('0xab')]][_0x0909('0x126')](_[_0x0909('0x8a')](_[_0x0909('0xcb')](this[_0x0909('0x26')][_0x37db67['actionid']],[_0x0909('0x127'),_0x0909('0x125')]),{'status':_0x37db67[_0x0909('0xa6')],'paused':_0x37db67['paused']}));}}}};function unlockQueueStatus(_0x3dde17,_0x62c427){setTimeout(function(){if(_['isUndefined'](_0x3dde17['queueStatusComplete'])){loggerBooked[_0x0909('0x92')](_0x0909('0x128'),_0x62c427);}_0x3dde17[_0x0909('0x129')]=!![];loggerBooked[_0x0909('0x80')]('[booked][unlockQueueStatus]',_0x62c427,JSON['stringify'](_[_0x0909('0xcb')](_0x3dde17,[_0x0909('0x40'),_0x0909('0x129')])));},0x1f3);}Dialer[_0x0909('0x1b')][_0x0909('0x12a')]=function(_0x2ef48e){var _0x4462c0=this;var _0x3d4849=_0x4462c0[_0x0909('0x21')][_0x4462c0['actions'][_0x2ef48e[_0x0909('0x122')]]['queue']];if(strategy[this[_0x0909('0x21')][this['actions'][_0x2ef48e[_0x0909('0x122')]]['queue']]['strategy']]===_0x0909('0x1a')){if(this['actions'][_0x2ef48e[_0x0909('0x122')]]&&this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0x125')]){this[_0x0909('0x20')][_0x0909('0x12b')](this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0x127')],this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0x125')])[_0x0909('0xa8')](function(_0x255f81){logger[_0x0909('0x92')](_0x0909('0x12c'),util[_0x0909('0x93')](_0x255f81,{'showHidden':![],'depth':null}));})[_0x0909('0x1e')](function(){_0x4462c0['updateOriginated'](_0x4462c0[_0x0909('0x21')][_0x4462c0[_0x0909('0x26')][_0x2ef48e['actionid']]['queue']]);_0x4462c0[_0x0909('0x23')][_0x4462c0[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]]['stateinterface']][_0x0909('0x123')]=![];delete _0x4462c0[_0x0909('0x26')][_0x2ef48e['actionid']];unlockQueueStatus(_0x3d4849);});}else{this[_0x0909('0xaa')](this['voiceQueues'][this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]]);this[_0x0909('0xb8')]({'active':![],'ContactId':this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xcc')],'ListId':this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xcd')],'VoiceQueueId':this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xce')]||undefined,'CampaignId':this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch(_0x0909('0x12d')));delete this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]];unlockQueueStatus(_0x3d4849);}}else if((strategy[this[_0x0909('0x21')][this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]][_0x0909('0x121')]]||_0x0909('0x19'))===_0x0909('0x19')){var _0x569c6d;if(this['actions'][_0x2ef48e[_0x0909('0x122')]]&&!_[_0x0909('0x47')](this['queueBooked'][this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]])){if(this[_0x0909('0x12e')][_0x4462c0[_0x0909('0x26')][_0x2ef48e['actionid']]['queue']]){this[_0x0909('0x12e')][_0x4462c0[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]]=this[_0x0909('0x12e')][this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]]?this[_0x0909('0x12e')][this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]]['queue']]:this[_0x0909('0x2c')][this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]]['queue']]?this[_0x0909('0x2c')][this[_0x0909('0x26')][_0x2ef48e['actionid']][_0x0909('0xab')]][_0x0909('0x12f')]||0x0:0x0;}this[_0x0909('0x2c')][this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]][_0x0909('0x12f')]=this[_0x0909('0x12e')][this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]];for(var _0x5dae2d=0x0;_0x5dae2d<this[_0x0909('0x2c')][this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]][_0x0909('0x130')];_0x5dae2d+=0x1){_0x569c6d=rr(this[_0x0909('0x2c')][this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]]);this[_0x0909('0x12e')][_0x4462c0[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]]=this[_0x0909('0x2c')][this[_0x0909('0x26')][_0x2ef48e['actionid']][_0x0909('0xab')]][_0x0909('0x12f')];if(_0x569c6d[_0x0909('0xa6')]==='1'&&_0x569c6d[_0x0909('0x124')]==='0'){break;}}if(!_[_0x0909('0xa4')](_0x569c6d)){this[_0x0909('0x23')][_0x569c6d[_0x0909('0x125')]][_0x0909('0x131')]=_[_0x0909('0x3e')](this[_0x0909('0x23')][_0x569c6d[_0x0909('0x125')]][_0x0909('0x131')])?!![]:this[_0x0909('0x23')][_0x569c6d[_0x0909('0x125')]]['unlockRR'];}loggerBooked[_0x0909('0x80')](_0x0909('0x132'),_0x2ef48e['actionid'],_0x0909('0x133'),JSON[_0x0909('0x4b')](_[_0x0909('0xcb')](this['agents'][_0x569c6d['stateinterface']],[_0x0909('0x40'),_0x0909('0x131')])),_0x0909('0x134'),JSON['stringify'](_0x569c6d['idHopper']));if(!_[_0x0909('0xa4')](_0x569c6d)&&_0x569c6d[_0x0909('0xa6')]==='1'&&_0x569c6d[_0x0909('0x124')]==='0'&&this['agents'][_0x569c6d[_0x0909('0x125')]][_0x0909('0x131')]){this[_0x0909('0x23')][_0x569c6d[_0x0909('0x125')]][_0x0909('0x131')]=![];this[_0x0909('0x2c')][_0x4462c0[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]]=[];this[_0x0909('0x20')][_0x0909('0x12b')](_0x569c6d[_0x0909('0x127')],_0x569c6d['stateinterface'])[_0x0909('0xa8')](function(_0x559f46){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x0909('0x93')](_0x559f46,{'showHidden':![],'depth':null}));})['finally'](function(){_0x4462c0[_0x0909('0xaa')](_0x4462c0[_0x0909('0x21')][_0x4462c0[_0x0909('0x26')][_0x2ef48e['actionid']][_0x0909('0xab')]]);setTimeout(function(){_0x4462c0[_0x0909('0x23')][_0x569c6d[_0x0909('0x125')]]['unlockRR']=!![];loggerBooked['info'](_0x0909('0x135'),_0x2ef48e[_0x0909('0x122')],_0x0909('0x133'),JSON[_0x0909('0x4b')](_[_0x0909('0xcb')](_0x4462c0[_0x0909('0x23')][_0x569c6d['stateinterface']],[_0x0909('0x40'),_0x0909('0x131')])),_0x0909('0x134'),JSON['stringify'](_0x569c6d['idHopper']));},0xc7);delete _0x4462c0[_0x0909('0x26')][_0x2ef48e['actionid']];unlockQueueStatus(_0x3d4849,_0x2ef48e[_0x0909('0x122')]);});}else{loggerBooked[_0x0909('0x80')](_0x0909('0x136'));this[_0x0909('0xaa')](this['voiceQueues'][this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]]['queue']]);this[_0x0909('0xb8')]({'active':![],'ContactId':this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xcc')],'ListId':this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]]['ListId'],'VoiceQueueId':this['actions'][_0x2ef48e['actionid']][_0x0909('0xce')]||undefined,'CampaignId':this[_0x0909('0x26')][_0x2ef48e['actionid']][_0x0909('0xcf')]||undefined})['catch'](loggerCatch(_0x0909('0x12d')));delete this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]];unlockQueueStatus(_0x3d4849);}}else{loggerBooked[_0x0909('0x80')]('[booked][unlock2]');this['updateOriginated'](this[_0x0909('0x21')][this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xab')]]);this[_0x0909('0xb8')]({'active':![],'ContactId':this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xcc')],'ListId':this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xcd')],'VoiceQueueId':this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xce')]||undefined,'CampaignId':this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x0909('0x26')][_0x2ef48e['actionid']];unlockQueueStatus(_0x3d4849);}}else{loggerBooked['info'](_0x0909('0x137'));this[_0x0909('0xaa')](this[_0x0909('0x21')][this[_0x0909('0x26')][_0x2ef48e['actionid']][_0x0909('0xab')]]);this[_0x0909('0xb8')]({'active':![],'ContactId':this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xcc')],'ListId':this['actions'][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xcd')],'VoiceQueueId':this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xce')]||undefined,'CampaignId':this[_0x0909('0x26')][_0x2ef48e[_0x0909('0x122')]][_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch(_0x0909('0x138')));delete this[_0x0909('0x26')][_0x2ef48e['actionid']];unlockQueueStatus(_0x3d4849);}};Dialer['prototype'][_0x0909('0x3c')]=function(){var _0x36a4f=this;setInterval(function(){_0x36a4f['syncCampaigns']();},0x3e8);};Dialer['prototype'][_0x0909('0x139')]=function(_0x4ae018){var _0x22fb5c=this;return function(){if(!_0x22fb5c['isTrunkReachable'](_0x4ae018[_0x0909('0x73')])){if(!_0x22fb5c[_0x0909('0xd4')](_0x4ae018[_0x0909('0x13a')])){_0x4ae018[_0x0909('0x41')]='TRUNK_IS_NOT_REACHABLE';throw _0x4ae018[_0x0909('0x40')]+_0x0909('0x13b');}}};};Dialer[_0x0909('0x1b')]['checkIfTime']=function(_0x4a5f57,_0x3084ee,_0x247196,_0x14562d){var _0x1c6057=this;return function(){var _0x1743fc=!![];return _0x1c6057[_0x0909('0x13c')](_0x4a5f57,_0x3084ee,_0x247196,_0x14562d,_0x1743fc);};};Dialer['prototype'][_0x0909('0x13d')]=function(_0x25687c,_0x338439,_0x436b8f,_0x86d912){var _0x1c4180=this;return function(){var _0x1e10a4=![];return _0x1c4180[_0x0909('0x13c')](_0x25687c[_0x0909('0x46')],_0x338439,_0x436b8f,_0x86d912,_0x1e10a4);};};Dialer[_0x0909('0x1b')][_0x0909('0x13c')]=function(_0x1bebd1,_0x139924,_0x16b6e9,_0x11cb7c,_0x1cc081){var _0xdc1563=[];return new BPromise(function(_0x1ddd68,_0x113cd2){if(!isNotNull(_0x1bebd1)){_0x11cb7c[_0x0909('0x41')]='INTERVAL_IS_NULL';return _0x113cd2(msgResponse(_0x0909('0x13c'),_0x0909('0x13e'),_0x16b6e9+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x0909('0x47')](_0x1bebd1)){_0x11cb7c['message']=_0x0909('0x13f');return _0x113cd2(msgResponse('ifTime',_0x0909('0x13e'),_0x16b6e9+'\x20Intervals\x20is\x20empty\x20'));}if(_0x139924&&_[_0x0909('0x3e')](config['timezones'][_0x139924])){_0x11cb7c[_0x0909('0x41')]=_0x0909('0x140');return _0x113cd2(msgResponse(_0x0909('0x13c'),_0x0909('0x13e'),_0x16b6e9+_0x0909('0x141')+_0x139924));}if(_[_0x0909('0x142')](_0x1bebd1)){for(var _0x33ea41=0x0;_0x33ea41<_0x1bebd1[_0x0909('0x130')];_0x33ea41+=0x1){_0xdc1563['push'](ami['Action']({'action':'command','command':util[_0x0909('0x77')](_0x0909('0x143'),_0x1bebd1[_0x33ea41][_0x0909('0x144')],!_[_0x0909('0x3e')](config[_0x0909('0x145')][_0x139924])?_0x139924:'')})[_0x0909('0xaf')](function(_0x2f5efc){return _0x2f5efc[_0x0909('0x146')][_0x0909('0x147')](_0x0909('0x148'))>=0x0;})[_0x0909('0xa8')](myreject(_0x113cd2)));}}else{_0xdc1563[_0x0909('0x126')](ami[_0x0909('0xa5')]({'action':_0x0909('0x149'),'command':util[_0x0909('0x77')](_0x0909('0x143'),_0x1bebd1,!_[_0x0909('0x3e')](config[_0x0909('0x145')][_0x139924])?_0x139924:'')})['then'](function(_0x428e25){return _0x428e25[_0x0909('0x146')][_0x0909('0x147')](_0x0909('0x148'))>=0x0;})[_0x0909('0xa8')](myreject(_0x113cd2)));}BPromise[_0x0909('0x14a')](_0xdc1563)['then'](function(_0x115472){var _0x2074f8=_[_0x0909('0x14b')](_0x115472);if(_0x2074f8){return _0x1ddd68(_0x2074f8);}else{_0x11cb7c[_0x0909('0x41')]=_0x1cc081?_0x0909('0x14c'):'INTERVAL_IS_OVERTIME';return _0x113cd2(msgResponse('[ifTime][promiseAll]',_0x0909('0x13e'),_0x0909('0x14d')+_0x1cc081+'\x20'+_0x16b6e9+'\x20Interval\x20is\x20overtime:\x20'+util[_0x0909('0x93')](_0x1bebd1,{'showHidden':![],'depth':null})+_0x0909('0x14e')+_0x139924));}})[_0x0909('0xa8')](function(_0x3e6abb){return _0x113cd2(msgResponse(_0x0909('0x13c'),_0x0909('0x13e'),JSON[_0x0909('0x4b')](_0x3e6abb)));});});};Dialer[_0x0909('0x1b')][_0x0909('0x14f')]=function(_0x19c637){var _0x1d8598=this;return function(){switch(_0x19c637[_0x0909('0x150')]){case'progressive':freeVariablesPredictive(_0x19c637);_0x1d8598['handlePower'](_0x19c637,0x1);break;case'power':freeVariablesPredictive(_0x19c637);_0x1d8598[_0x0909('0x151')](_0x19c637,_0x19c637[_0x0909('0x152')]);break;case _0x0909('0x9'):_0x1d8598[_0x0909('0x9')](_0x19c637);break;case _0x0909('0x8'):freeVariablesPredictive(_0x19c637);_0x1d8598[_0x0909('0x151')](_0x19c637,0x1);break;default:freeVariablesPredictive(_0x19c637);logger['error'](_0x0909('0x153'),_0x19c637['name'],_0x0909('0x154'));}};};Dialer[_0x0909('0x1b')][_0x0909('0x155')]=function(_0x2dbf6d){var _0x3f6474=this;return function(){_0x3f6474[_0x0909('0x156')](_0x2dbf6d);};};Dialer[_0x0909('0x1b')][_0x0909('0x35')]=function(_0x39f19c){var _0xf8fd5f=this;if(isNotPreview(_0x39f19c['dialMethod'])){if(isVoiceQueueOutbound(_0x39f19c['type'])&&isActive(_0x39f19c[_0x0909('0x5c')])){_0x39f19c['sendMessageOneNotActive']=!![];BPromise[_0x0909('0xb4')]()['then'](checkIsLoggedIn(_0x39f19c,_0x39f19c[_0x0909('0x53')]))[_0x0909('0xaf')](checkIsActive(_0x39f19c,_0x39f19c['dialActive']))[_0x0909('0xaf')](checkInterval(_0x39f19c))[_0x0909('0xaf')](_0xf8fd5f[_0x0909('0x139')](_0x39f19c))['then'](_0xf8fd5f['checkIfTime'](_0x39f19c[_0x0909('0x157')],_0x39f19c[_0x0909('0x158')],_0x39f19c[_0x0909('0x40')],_0x39f19c))['then'](_0xf8fd5f['checkIfTimeIntervals'](_0x39f19c[_0x0909('0x48')],_0x39f19c[_0x0909('0x158')],_0x39f19c[_0x0909('0x40')],_0x39f19c))['then'](_0xf8fd5f[_0x0909('0x14f')](_0x39f19c))[_0x0909('0xa8')](loggerCatchQueueSummary(_0x0909('0x159'),_0x39f19c));}else{notSendMessagesQueue(_0x39f19c);}}else{freeVariablesPredictive(_0x39f19c);}};Dialer[_0x0909('0x1b')][_0x0909('0x15a')]=function(){var _0x2d0b21=this;var _0x6ee07a;for(var _0x2892f0 in this['campaigns']){if(typeof this[_0x0909('0x22')][_0x2892f0]!==_0x0909('0x95')){_0x6ee07a=this[_0x0909('0x22')][_0x2892f0];if(isCampaignIvr(_0x6ee07a[_0x0909('0x50')])&&isActive(_0x6ee07a[_0x0909('0x74')])){_0x6ee07a[_0x0909('0x99')]=!![];BPromise[_0x0909('0xb4')]()[_0x0909('0xaf')](checkIsActive(_0x6ee07a,_0x6ee07a['active']))[_0x0909('0xaf')](checkInterval(_0x6ee07a))[_0x0909('0xaf')](_0x2d0b21[_0x0909('0x139')](_0x6ee07a))[_0x0909('0xaf')](_0x2d0b21['checkIfTime'](_0x6ee07a['dialGlobalInterval'],_0x6ee07a[_0x0909('0x158')],_0x6ee07a[_0x0909('0x40')],_0x6ee07a))[_0x0909('0xaf')](_0x2d0b21['checkIfTimeIntervals'](_0x6ee07a[_0x0909('0x48')],_0x6ee07a[_0x0909('0x158')],_0x6ee07a[_0x0909('0x40')],_0x6ee07a))[_0x0909('0xaf')](_0x2d0b21[_0x0909('0x155')](_0x6ee07a))[_0x0909('0xa8')](loggerCatchQueueSummary(_0x0909('0x15b'),_0x6ee07a));}else{notSendMessagesCampaign(_0x6ee07a);}}}};function getCallerIdRandom(_0x1d92f3,_0x469b3e){var _0x115724;var _0x185625;var _0x821511;if(_0x469b3e<=0x0){_0x469b3e=0x1;}_0x115724=new RegExp(_0x0909('0x15c')+_0x469b3e+'}$');_0x185625=Math[_0x0909('0x15d')](0xa,_0x469b3e-0x1);_0x821511=Math[_0x0909('0x15d')](0xa,_0x469b3e)-0x1;return util[_0x0909('0x77')]('%s',_[_0x0909('0x15e')](_0x1d92f3,_0x115724,_[_0x0909('0x15f')](_0x185625,_0x821511)));}function extractCalleridName(_0x5b1311){var _0x2490c1=_0x5b1311[_0x0909('0x160')](/"(.*?)"/);return _0x2490c1?_0x2490c1[0x1]:_0x5b1311;}function extractCalleridNumber(_0x206183){var _0xbf9211=_0x206183[_0x0909('0x160')](/<(.*?)>/);return _0xbf9211?_0xbf9211[0x1]:_0x206183;}Dialer['prototype'][_0x0909('0x161')]=function(_0x1ea864,_0x640d83){var _0x234478=this;var _0x40f4d9=uuid['v4']();this[_0x0909('0x26')][_0x40f4d9]=new Action(_0x1ea864,_0x640d83,_0x40f4d9);return new BPromise(function(_0x47d707,_0x1304d2){if(_['isUndefined'](_0x1ea864)&&typeof _0x1ea864!==_0x0909('0x162')){return _0x1304d2(msgResponse('originate','Failure','voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x640d83[_0x0909('0x163')][_0x0909('0x164')])||_0x640d83[_0x0909('0x163')][_0x0909('0x164')]===null){return _0x1304d2(msgResponse(_0x0909('0x165'),_0x0909('0x13e'),_0x0909('0x166')));}var _0x149d4e={'XMD-CALLERID':_0x234478[_0x0909('0x26')][_0x40f4d9][_0x0909('0x167')](),'XMD-AGI':_0x1ea864[_0x0909('0x103')]?util[_0x0909('0x77')](_0x0909('0x168'),ipAgi,_0x1ea864[_0x0909('0x103')]):_0x0909('0x169'),'XMD-AGIAFTER':_0x1ea864[_0x0909('0x109')]?util['format'](_0x0909('0x168'),ipAgi,_0x1ea864[_0x0909('0x109')]):'NONE','XMD-QUEUE':_0x1ea864[_0x0909('0x50')]===_0x0909('0x51')?util[_0x0909('0x77')]('\x22%s,%s%s,,,%s\x22',_0x1ea864[_0x0909('0x40')],_0x1ea864[_0x0909('0x16a')]||'',_0x1ea864[_0x0909('0x10a')]?'c':'',_0x1ea864[_0x0909('0x16b')]||0x3):_0x0909('0x169'),'XMD-CONTACTID':_0x640d83['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x234478[_0x0909('0x26')][_0x40f4d9]['getCaller'](),'XMD-AMD':_0x1ea864[_0x0909('0xdc')]?_0x0909('0x16c'):_0x0909('0x169'),'XMD-DESTINATION':_0x0909('0xdb')};if(_0x1ea864['dialAMDActive']){_0x149d4e[_0x0909('0x16d')]=_0x1ea864['dialAMDInitialSilence']||0x9c4;_0x149d4e[_0x0909('0x16e')]=_0x1ea864[_0x0909('0x16f')]||0x5dc;_0x149d4e['XMD-AMDAFTERGREETINGSILENCE']=_0x1ea864[_0x0909('0x170')]||0x320;_0x149d4e[_0x0909('0x171')]=_0x1ea864['dialAMDTotalAnalysisTime']||0x1388;_0x149d4e['XMD-AMDMINWORDLENGTH']=_0x1ea864[_0x0909('0x172')]||0x64;_0x149d4e[_0x0909('0x173')]=_0x1ea864[_0x0909('0x174')]||0x32;_0x149d4e[_0x0909('0x175')]=_0x1ea864[_0x0909('0x176')]||0x3;_0x149d4e[_0x0909('0x177')]=_0x1ea864[_0x0909('0x178')]||0x100;_0x149d4e['XMD-AMDMAXIMUMWORDLENGTH']=_0x1ea864['dialAMDMaximumWordLength']||0x1388;}if(_0x1ea864[_0x0909('0x50')]===_0x0909('0x51')){_0x149d4e[_0x0909('0x179')]=_0x640d83[_0x0909('0xce')];}else{_0x149d4e[_0x0909('0x17a')]=_0x640d83[_0x0909('0xcf')];}for(var _0x2a3441 in _0x640d83[_0x0909('0x163')]){if(typeof _0x640d83[_0x0909('0x163')][_0x2a3441]!==_0x0909('0x95')){if(isNotNull(_0x640d83['Contact'][_0x2a3441])&&_0x2a3441!=='id'&&_0x2a3441!=='tags'&&_0x2a3441!=='createdAt'&&_0x2a3441!=='updatedAt'){_0x149d4e[util[_0x0909('0x77')]('%s%s',_0x0909('0x17b'),_[_0x0909('0x17c')](_0x2a3441))]=_0x640d83['Contact'][_0x2a3441];}}}var _0x3c592f=_0x234478[_0x0909('0xd4')](_0x1ea864[_0x0909('0x73')])?getCallerId(_0x1ea864['Trunk'][_0x0909('0x75')],_0x1ea864[_0x0909('0x5d')],_0x1ea864[_0x0909('0x17d')]>0x0?getCallerIdRandom(_0x1ea864['dialOriginateCallerIdNumber'],_0x1ea864[_0x0909('0x17d')]):_0x1ea864[_0x0909('0x5e')]):getCallerId(_['isNil'](_0x1ea864[_0x0909('0x13a')])?_0x1ea864[_0x0909('0x73')][_0x0909('0x75')]:_0x1ea864[_0x0909('0x13a')][_0x0909('0x75')],_0x1ea864[_0x0909('0x5d')],_0x1ea864[_0x0909('0x17d')]>0x0?getCallerIdRandom(_0x1ea864[_0x0909('0x5e')],_0x1ea864['dialRandomLastDigitCallerIdNumber']):_0x1ea864[_0x0909('0x5e')]);if(_0x3c592f){_0x149d4e['XMD-ORIGINATECALLERIDNAME']=_0x234478[_0x0909('0x26')][_0x40f4d9][_0x0909('0x17e')]=extractCalleridName(_0x3c592f);_0x149d4e[_0x0909('0x17f')]=_0x234478[_0x0909('0x26')][_0x40f4d9][_0x0909('0x180')]=extractCalleridNumber(_0x3c592f);}return ami[_0x0909('0xa5')]({'actionid':_0x40f4d9,'action':_0x0909('0x165'),'channel':_0x234478[_0x0909('0xd4')](_0x1ea864[_0x0909('0x73')])?util['format'](_0x0909('0x181'),_0x1ea864[_0x0909('0x73')]['name'],isNotNull(_0x1ea864[_0x0909('0x60')])?_0x1ea864[_0x0909('0x60')][_0x0909('0x182')]()||'':'',_0x1ea864['dialCutDigit']>0x0?_0x640d83[_0x0909('0x163')][_0x0909('0x164')][_0x0909('0x183')](_0x1ea864[_0x0909('0x184')]):_0x640d83['Contact'][_0x0909('0x164')]):util[_0x0909('0x77')]('SIP/%s/%s%s',_[_0x0909('0xa4')](_0x1ea864[_0x0909('0x13a')])?_0x1ea864[_0x0909('0x73')][_0x0909('0x40')]:_0x1ea864['TrunkBackup'][_0x0909('0x40')],isNotNull(_0x1ea864['dialPrefix'])?_0x1ea864[_0x0909('0x60')]['trim']()||'':'',_0x1ea864['dialCutDigit']>0x0?_0x640d83[_0x0909('0x163')]['phone'][_0x0909('0x183')](_0x1ea864[_0x0909('0x184')]):_0x640d83['Contact'][_0x0909('0x164')]),'callerid':_0x3c592f,'Exten':_0x0909('0xdb'),'Context':_0x0909('0x185'),'Priority':'1','variable':_0x149d4e,'timeout':(_0x1ea864[_0x0909('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x40f4d9})[_0x0909('0xaf')](function(_0x4be95d){return _0x47d707(_0x4be95d);})['catch'](function(_0x217dc9){_0x1ea864[_0x0909('0x68')]+=0x1;var _0x50dbd1=new History(_0x234478[_0x0909('0x26')][_0x40f4d9]);logger['error'](util[_0x0909('0x77')](_0x0909('0x186'),JSON['stringify'](_0x217dc9)));_0x50dbd1[_0x0909('0xdf')]=0xe;_0x50dbd1[_0x0909('0xa0')]=_0x0909('0x187');_0x50dbd1['starttime']=moment()[_0x0909('0x77')](_0x0909('0xf9'));_0x50dbd1[_0x0909('0x117')]=_0x50dbd1[_0x0909('0xa1')];_0x234478[_0x0909('0xc4')](_0x50dbd1)[_0x0909('0xa8')](loggerCatch(_0x0909('0x188')));_0x234478[_0x0909('0xc2')](_0x50dbd1)[_0x0909('0xa8')](loggerCatch('[originate][error]'))[_0x0909('0x1e')](function(){delete _0x234478[_0x0909('0x26')][_0x40f4d9];return _0x1304d2(msgResponse(_0x0909('0x165'),'Error',_0x0909('0x189')));});});});};Dialer['prototype'][_0x0909('0x18a')]=function(_0x5e7dbf){var _0x56f2b1=this[_0x0909('0x26')][_0x5e7dbf[_0x0909('0x122')]];if(_0x56f2b1){delete this['actions'][_0x5e7dbf['actionid']];_0x56f2b1[_0x0909('0x18b')]=moment()['format'](_0x0909('0xf9'));var _0x500bc6=_0x56f2b1[_0x0909('0x50')]===_0x0909('0x8f')?this[_0x0909('0x22')][_0x56f2b1[_0x0909('0xab')]]:this['voiceQueues'][_0x56f2b1['getQueue']()];if(!this[_0x0909('0xd2')](_0x5e7dbf[_0x0909('0x18c')])){this[_0x0909('0xaa')](_0x500bc6);return this[_0x0909('0x18d')](_0x56f2b1,_0x500bc6,_0x5e7dbf)[_0x0909('0xa8')](loggerCatch(_0x0909('0x18e')));}this[_0x0909('0x27')][_0x5e7dbf[_0x0909('0xd8')]]=_0x56f2b1;}};Dialer[_0x0909('0x1b')][_0x0909('0x18f')]=function(_0x49f40d,_0x29f4cf,_0xc3a03e){var _0x40f682=new History(_0x29f4cf);if(_0x40f682[_0x0909('0xee')]+_0x40f682[_0x0909('0xef')]+_0x40f682['countnoanswerretry']+_0x40f682[_0x0909('0xf1')]+_0x40f682[_0x0909('0xf2')]+_0x40f682[_0x0909('0xf3')]+_0x40f682[_0x0909('0xeb')]+_0x40f682['countagentrejectretry']>=_0xc3a03e[_0x0909('0xf5')]-0x1){return!![];}switch(_0x49f40d){case 0x3:if(_0x40f682['countnoanswerretry']>=_0xc3a03e[_0x0909('0x190')]-0x1){return!![];}this[_0x0909('0xb8')]({'active':![],'countnoanswerretry':_0x40f682['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x0909('0xf8')](_0xc3a03e[_0x0909('0x191')],_0x0909('0xfd'))[_0x0909('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40f682['ContactId'],'ListId':_0x40f682[_0x0909('0xcd')],'VoiceQueueId':_0x40f682[_0x0909('0xce')]||undefined,'CampaignId':_0x40f682[_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch(_0x0909('0x192')));break;case 0x5:if(_0x40f682['countbusyretry']>=_0xc3a03e[_0x0909('0x193')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x40f682[_0x0909('0xee')]+=0x1,'scheduledat':moment()[_0x0909('0xf8')](_0xc3a03e[_0x0909('0x194')],_0x0909('0xfd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40f682['ContactId'],'ListId':_0x40f682[_0x0909('0xcd')],'VoiceQueueId':_0x40f682[_0x0909('0xce')]||undefined,'CampaignId':_0x40f682[_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch(_0x0909('0x195')));break;case 0x8:if(_0x40f682['countcongestionretry']>=_0xc3a03e[_0x0909('0x196')]-0x1){return!![];}this[_0x0909('0xb8')]({'active':![],'countcongestionretry':_0x40f682['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0xc3a03e[_0x0909('0x197')],_0x0909('0xfd'))[_0x0909('0x77')](_0x0909('0xf9')),'ContactId':_0x40f682[_0x0909('0xcc')],'ListId':_0x40f682['ListId'],'VoiceQueueId':_0x40f682[_0x0909('0xce')]||undefined,'CampaignId':_0x40f682[_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch(_0x0909('0x198')));break;case 0x0:if(_0x40f682[_0x0909('0xf1')]>=_0xc3a03e[_0x0909('0x199')]-0x1){return!![];}else{this[_0x0909('0xb8')]({'active':![],'countnosuchnumberretry':_0x40f682[_0x0909('0xf1')]+=0x1,'scheduledat':moment()[_0x0909('0xf8')](_0xc3a03e['dialNoSuchNumberRetryFrequency'],_0x0909('0xfd'))['format'](_0x0909('0xf9')),'ContactId':_0x40f682[_0x0909('0xcc')],'ListId':_0x40f682[_0x0909('0xcd')],'VoiceQueueId':_0x40f682['VoiceQueueId']||undefined,'CampaignId':_0x40f682[_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch(_0x0909('0x19a')));}break;case 0xa:if(_0x40f682[_0x0909('0xf2')]>=_0xc3a03e[_0x0909('0x114')]-0x1){return!![];}this[_0x0909('0xb8')]({'active':![],'countdropretry':_0x40f682['countdropretry']+=0x1,'scheduledat':moment()[_0x0909('0xf8')](_0xc3a03e['dialDropRetryFrequency'],_0x0909('0xfd'))[_0x0909('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40f682[_0x0909('0xcc')],'ListId':_0x40f682[_0x0909('0xcd')],'VoiceQueueId':_0x40f682[_0x0909('0xce')]||undefined,'CampaignId':_0x40f682['CampaignId']||undefined})[_0x0909('0xa8')](loggerCatch(_0x0909('0x116')));break;case 0xb:if(_0x40f682['countabandonedretry']>=_0xc3a03e['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x0909('0xb8')]({'active':![],'countabandonedretry':_0x40f682[_0x0909('0xf3')]+=0x1,'scheduledat':moment()[_0x0909('0xf8')](_0xc3a03e[_0x0909('0x11e')],_0x0909('0xfd'))['format'](_0x0909('0xf9')),'ContactId':_0x40f682[_0x0909('0xcc')],'ListId':_0x40f682['ListId'],'VoiceQueueId':_0x40f682[_0x0909('0xce')]||undefined,'CampaignId':_0x40f682[_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x40f682[_0x0909('0xeb')]>=_0xc3a03e[_0x0909('0xfc')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x40f682[_0x0909('0xeb')]+=0x1,'scheduledat':moment()[_0x0909('0xf8')](_0xc3a03e[_0x0909('0x19b')],_0x0909('0xfd'))[_0x0909('0x77')](_0x0909('0xf9')),'ContactId':_0x40f682['ContactId'],'ListId':_0x40f682['ListId'],'VoiceQueueId':_0x40f682[_0x0909('0xce')]||undefined,'CampaignId':_0x40f682[_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x40f682[_0x0909('0xf4')]>=_0xc3a03e[_0x0909('0x19c')]-0x1){return!![];}this[_0x0909('0xb8')]({'active':![],'countagentrejectretry':_0x40f682[_0x0909('0xf4')]+=0x1,'scheduledat':moment()[_0x0909('0xf8')](_0xc3a03e[_0x0909('0x19d')],_0x0909('0xfd'))[_0x0909('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40f682[_0x0909('0xcc')],'ListId':_0x40f682[_0x0909('0xcd')],'VoiceQueueId':_0x40f682[_0x0909('0xce')]||undefined,'CampaignId':_0x40f682[_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x0909('0x1b')][_0x0909('0x18d')]=function(_0x56476a,_0x51cab5,_0x4e666d){var _0x571adc=this;var _0xd4a68d=new History(_0x56476a);return new BPromise(function(_0x180922,_0x52ad19){if(_[_0x0909('0x3e')](_0x51cab5)&&typeof _0x51cab5!=='object'){return _0x52ad19(msgResponse(_0x0909('0x19e'),_0x0909('0x13e'),_0x0909('0x19f')));}if(_['isUndefined'](_0x4e666d)&&typeof _0x4e666d!=='object'){return _0x52ad19(msgResponse(_0x0909('0x19e'),_0x0909('0x13e'),_0x0909('0x1a0')));}switch(_0x4e666d['reason']){case'0':_0x51cab5['outboundNoSuchCallsDay']+=0x1;_0xd4a68d['state']=0x0;_0xd4a68d[_0x0909('0xa0')]=_0x0909('0x1a1');_0xd4a68d['countnosuchnumberretry']+=0x1;_0xd4a68d[_0x0909('0xec')]+=0x1;ami[_0x0909('0x4f')]('custom:agentnosuchnumber',ut[_0x0909('0xe4')](_0x56476a,_0x0909('0x1a2')));_0x571adc[_0x0909('0xc4')](_0xd4a68d)[_0x0909('0xa8')](loggerCatch(_0x0909('0xed')));if(_0x571adc[_0x0909('0x18f')](0x0,_0x56476a,_0x51cab5)){if(_0xd4a68d[_0x0909('0xf1')]>=_0x51cab5[_0x0909('0x199')]){_0x571adc[_0x0909('0x1a3')](_0xd4a68d,_0x180922,_0x52ad19,'reason\x200\x20no\x20such\x20number....');}else{_0x571adc[_0x0909('0xf6')](_0xd4a68d,_0x180922,_0x52ad19,_0x0909('0x1a4'));}}break;case'3':_0x51cab5[_0x0909('0x67')]+=0x1;_0xd4a68d[_0x0909('0xdf')]=0x3;_0xd4a68d[_0x0909('0xa0')]=_0x0909('0x1a5');_0xd4a68d['countnoanswerretry']+=0x1;_0xd4a68d[_0x0909('0xec')]+=0x1;ami[_0x0909('0x4f')](_0x0909('0x1a6'),ut[_0x0909('0xe4')](_0x56476a,_0x0909('0x1a7')));_0x571adc[_0x0909('0xc4')](_0xd4a68d)['catch'](loggerCatch(_0x0909('0x1a8')));if(_0x571adc[_0x0909('0x18f')](0x3,_0x56476a,_0x51cab5)){if(_0xd4a68d[_0x0909('0xf0')]>=_0x51cab5[_0x0909('0x190')]){_0x571adc[_0x0909('0x1a3')](_0xd4a68d,_0x180922,_0x52ad19,_0x0909('0x1a9'));}else{_0x571adc[_0x0909('0xf6')](_0xd4a68d,_0x180922,_0x52ad19,_0x0909('0x1a9'));}}break;case'5':_0x51cab5[_0x0909('0x63')]+=0x1;_0xd4a68d[_0x0909('0xdf')]=0x5;_0xd4a68d[_0x0909('0xa0')]=_0x0909('0x1aa');_0xd4a68d[_0x0909('0xee')]+=0x1;_0xd4a68d[_0x0909('0xec')]+=0x1;ami[_0x0909('0x4f')]('custom:agentbusy',ut[_0x0909('0xe4')](_0x56476a,_0x0909('0x1ab')));_0x571adc[_0x0909('0xc4')](_0xd4a68d)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x571adc[_0x0909('0x18f')](0x5,_0x56476a,_0x51cab5)){if(_0xd4a68d[_0x0909('0xee')]>=_0x51cab5['dialBusyMaxRetry']){_0x571adc['createStateFinal'](_0xd4a68d,_0x180922,_0x52ad19,_0x0909('0x1ac'));}else{_0x571adc[_0x0909('0xf6')](_0xd4a68d,_0x180922,_0x52ad19,_0x0909('0x1ac'));}}break;case'8':_0x51cab5[_0x0909('0x64')]+=0x1;_0xd4a68d[_0x0909('0xdf')]=0x8;_0xd4a68d[_0x0909('0xa0')]=_0x0909('0x1ad');_0xd4a68d[_0x0909('0xef')]+=0x1;_0xd4a68d[_0x0909('0xec')]+=0x1;ami[_0x0909('0x4f')](_0x0909('0x1ae'),ut[_0x0909('0xe4')](_0x56476a,_0x0909('0x1af')));_0x571adc[_0x0909('0xc4')](_0xd4a68d)['catch'](loggerCatch(_0x0909('0x1b0')));if(_0x571adc[_0x0909('0x18f')](0x8,_0x56476a,_0x51cab5)){if(_0xd4a68d[_0x0909('0xef')]>=_0x51cab5[_0x0909('0x196')]){_0x571adc[_0x0909('0x1a3')](_0xd4a68d,_0x180922,_0x52ad19,'reason\x208\x20congestion');}else{_0x571adc[_0x0909('0xf6')](_0xd4a68d,_0x180922,_0x52ad19,_0x0909('0x1b1'));}}break;case'11':_0x51cab5[_0x0909('0x1b2')]+=0x1;_0xd4a68d[_0x0909('0xdf')]=0xb;_0xd4a68d[_0x0909('0xa0')]=_0x0909('0x11b');_0xd4a68d[_0x0909('0xf3')]+=0x1;_0xd4a68d['countglobal']+=0x1;_0x571adc[_0x0909('0xc4')](_0xd4a68d)['catch'](loggerCatch(_0x0909('0x120')));if(_0x571adc[_0x0909('0x18f')](0xb,_0x56476a,_0x51cab5)){if(_0xd4a68d[_0x0909('0xf3')]>=_0x51cab5[_0x0909('0x11d')]){_0x571adc[_0x0909('0x1a3')](_0xd4a68d,_0x180922,_0x52ad19,_0x0909('0x1b3'));}else{_0x571adc['stateGlobal'](_0xd4a68d,_0x180922,_0x52ad19,'reason\x2011\x20abandoned');}}break;case'20':_0x51cab5['outboundRejectCallsDay']+=0x1;_0xd4a68d[_0x0909('0xdf')]=0x14;_0xd4a68d[_0x0909('0xa0')]=_0x0909('0x1b4');_0xd4a68d[_0x0909('0xf4')]+=0x1;_0xd4a68d[_0x0909('0xec')]+=0x1;ami[_0x0909('0x4f')](_0x0909('0x1b5'),ut[_0x0909('0xe4')](_0x56476a,'agentreject'));_0x571adc[_0x0909('0xc4')](_0xd4a68d)[_0x0909('0xa8')](loggerCatch(_0x0909('0x1b6')));if(_0x571adc[_0x0909('0x18f')](0x14,_0x56476a,_0x51cab5)){if(_0xd4a68d[_0x0909('0xf4')]>=_0x51cab5['dialAgentRejectMaxRetry']){_0x571adc[_0x0909('0x1a3')](_0xd4a68d,_0x180922,_0x52ad19,_0x0909('0x1b7'));}else{_0x571adc[_0x0909('0xf6')](_0xd4a68d,_0x180922,_0x52ad19,_0x0909('0x1b7'));}}break;default:_0x51cab5['outboundUnknownCallsDay']+=0x1;_0xd4a68d['state']=0xc;_0xd4a68d[_0x0909('0xa0')]=_0x4e666d[_0x0909('0x106')];_0x571adc[_0x0909('0xc4')](_0xd4a68d)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x571adc[_0x0909('0x18f')](_0x4e666d[_0x0909('0x106')],_0x56476a,_0x51cab5)){if(_0xd4a68d[_0x0909('0xee')]+_0xd4a68d[_0x0909('0xef')]+_0xd4a68d['countnoanswerretry']+_0xd4a68d[_0x0909('0xf1')]+_0xd4a68d[_0x0909('0xf2')]+_0xd4a68d[_0x0909('0xf3')]+_0xd4a68d[_0x0909('0xeb')]+_0xd4a68d[_0x0909('0xf4')]>=_0x51cab5[_0x0909('0xf5')]){_0x571adc[_0x0909('0xf6')](_0xd4a68d,_0x180922,_0x52ad19,_0x4e666d[_0x0909('0x106')]);}else{_0x571adc['createStateFinal'](_0xd4a68d,_0x180922,_0x52ad19,_0x4e666d[_0x0909('0x106')]);}}}});};Dialer[_0x0909('0x1b')][_0x0909('0xf6')]=function(_0x3cc28f,_0x2bd8d4,_0xc6f4f4,_0x87638){var _0x54b4a3=new Final(_0x3cc28f);_0x54b4a3[_0x0909('0xdf')]=0xf;_0x54b4a3[_0x0909('0xa0')]='Global';this[_0x0909('0x1a3')](_0x54b4a3,_0x2bd8d4,_0xc6f4f4,_0x87638);};Dialer[_0x0909('0x1b')][_0x0909('0x1a3')]=function(_0x173f29,_0x273a68,_0x233d1f,_0x14ed39){this[_0x0909('0xc2')](_0x173f29)[_0x0909('0xaf')](function(){return _0x273a68(msgResponse(_0x0909('0x19e'),_0x0909('0xd3'),_0x14ed39));})[_0x0909('0xa8')](function(){return _0x233d1f(msgResponse(_0x0909('0x1b8'),_0x0909('0x13e'),_0x0909('0x1b9')));});};Dialer[_0x0909('0x1b')][_0x0909('0x9')]=function(_0x455bad){var _0x53489f=_0x455bad[_0x0909('0x1ba')]/0x64;var _0x4933a5=_0x455bad[_0x0909('0x66')]/(_0x455bad[_0x0909('0x66')]+_0x455bad[_0x0909('0x61')]);var _0x1536d6=Math['round'](_0x455bad[_0x0909('0x1bb')]*(_0x455bad[_0x0909('0x1bc')]/0x64));var _0x235603=Math[_0x0909('0x1bd')](_0x455bad[_0x0909('0x1bb')]*(_0x455bad[_0x0909('0x1be')]/0x64));var _0x7f87f9=_0x455bad[_0x0909('0x9a')]+_0x455bad[_0x0909('0x58')];var _0x5c4c1b=Math[_0x0909('0x1bf')](_0x455bad['erlangCalls']*_0x455bad['erlangAbandonmentRate']*_0x455bad[_0x0909('0x6d')]*_0x455bad[_0x0909('0x6e')]);if(_[_0x0909('0x3e')](_0x455bad['startProgressive'])){if(!_[_0x0909('0x3e')](_0x455bad[_0x0909('0x29')])){_0x455bad[_0x0909('0x29')]=undefined;loggerPredictive[_0x0909('0x92')](_0x0909('0x1c0'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x0909('0x3e')](_0x455bad[_0x0909('0x8d')])){loggerPredictive[_0x0909('0x92')](_0x0909('0x1c0'),_0x0909('0x1c1'));clearInterval(_0x455bad[_0x0909('0x8d')]);_0x455bad[_0x0909('0x8d')]=undefined;}_0x455bad[_0x0909('0x2a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0909('0x80')](_0x455bad['name'],_0x0909('0x1c2'),_0x455bad[_0x0909('0x2a')]);this[_0x0909('0x151')](_0x455bad,0x1);}else if(ifInterval(_0x455bad['dialPredictiveInterval'],_0x455bad[_0x0909('0x2a')])){this[_0x0909('0x151')](_0x455bad,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x455bad[_0x0909('0x2a')],_0x455bad[_0x0909('0x40')]);_0x455bad[_0x0909('0x70')]=0x0;_0x455bad[_0x0909('0x1c3')]=0x0;}else if(_0x53489f<_0x4933a5&&_0x455bad[_0x0909('0x1c4')]===_0x0909('0x1c5')){freeVariablesPredictive(_0x455bad);loggerPredictive[_0x0909('0x80')](_0x0909('0x1c6'),'Dropped\x20calls\x20day',_0x4933a5,'startProgressive',_0x455bad['name']);}else if(_0x5c4c1b<_0x455bad[_0x0909('0x1c3')]&&_0x455bad[_0x0909('0x1c4')]===_0x0909('0x1c5')){freeVariablesPredictive(_0x455bad);loggerPredictive[_0x0909('0x80')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x0909('0x1c7'),_0x5c4c1b,_0x0909('0x1c8'),_0x455bad[_0x0909('0x1c3')],_0x0909('0x2a'),_0x455bad['name']);}else if(!ifInterval(_0x455bad[_0x0909('0x1c9')],_0x455bad[_0x0909('0x2a')])&&_[_0x0909('0x3e')](_0x455bad['startPredictive'])&&!_[_0x0909('0x3e')](_0x455bad[_0x0909('0x2a')])){_0x455bad[_0x0909('0x29')]=moment()[_0x0909('0x77')](_0x0909('0xf9'));loggerPredictive[_0x0909('0x80')](_0x455bad[_0x0909('0x40')],_0x0909('0x1ca'),_0x455bad['startPredictive']);this[_0x0909('0xb5')](_0x455bad['dialPredictiveInterval'])[_0x0909('0xaf')](this[_0x0909('0x1cb')](_0x455bad))[_0x0909('0xaf')](mergeDataErlangB(_0x455bad))[_0x0909('0xaf')](this[_0x0909('0x1cc')](_0x455bad))[_0x0909('0xa8')](loggerCatchPredictive(_0x0909('0x1cd'),_0x455bad));}else if(!ifInterval(_0x455bad[_0x0909('0x1c9')],_0x455bad[_0x0909('0x29')])){_0x455bad['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x455bad['startPredictive']=moment()[_0x0909('0x77')](_0x0909('0xf9'));loggerPredictive['info'](_0x455bad['name'],_0x0909('0x1ce'),_0x455bad[_0x0909('0x29')]);clearInterval(_0x455bad[_0x0909('0x8d')]);_0x455bad['handlePredictive']=undefined;this[_0x0909('0xb5')](_0x455bad[_0x0909('0x1c9')])[_0x0909('0xaf')](this[_0x0909('0x1cb')](_0x455bad))[_0x0909('0xaf')](mergeDataErlangB(_0x455bad))[_0x0909('0xaf')](this['startMethodPredictive'](_0x455bad))[_0x0909('0xa8')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x455bad));}else if(_0x455bad[_0x0909('0x1bb')]&&_0x7f87f9<_0x455bad[_0x0909('0x1bb')]-_0x235603){freeVariablesPredictive(_0x455bad);loggerPredictive[_0x0909('0x80')](_0x455bad['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x7f87f9,_0x0909('0x1cf'),_0x455bad[_0x0909('0x1bb')],'-',_0x235603,'=',_0x455bad['predictiveIntervalAvailable']-_0x235603,')');}else if(_0x455bad[_0x0909('0x1bb')]&&_0x7f87f9>_0x455bad['predictiveIntervalAvailable']+_0x1536d6){freeVariablesPredictive(_0x455bad);loggerPredictive['info'](_0x455bad['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x7f87f9,_0x0909('0x1d0'),_0x455bad[_0x0909('0x1bb')],'+',_0x1536d6,'=',_0x455bad['predictiveIntervalAvailable']+_0x1536d6,')');}};Dialer[_0x0909('0x1b')][_0x0909('0x1cb')]=function(_0x5bca78){var _0x3cdb97=this;return function(_0x11ac40){return new BPromise(function(_0x702d1f,_0x918f75){_[_0x0909('0x8a')](_0x5bca78,_0x11ac40[0x0]);if(checkGetDataPredictive(_0x11ac40[0x0])){var _0x3a2ee9=_0x5bca78['predictiveIntervalAvailable']=_0x5bca78[_0x0909('0x58')]+_0x5bca78[_0x0909('0x9a')];var _0x20d9c1=_0x5bca78[_0x0909('0x1c9')]*0x3c;var _0x471b07=_0x11ac40[0x0][_0x0909('0x6b')]+_0x11ac40[0x0][_0x0909('0x6a')];var _0x414ea0=(_0x11ac40[0x0][_0x0909('0x7e')]+_0x11ac40[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x11ac40[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x11ac40[0x0][_0x0909('0x1d1')];_0x5bca78['predictiveIntervalHitRate']=_0x414ea0>0x0?_0x414ea0:0x1;switch(_0x5bca78['dialPredictiveOptimization']){case _0x0909('0x1c5'):var _0x8e074d=_0x5bca78['dialPredictiveOptimizationPercentage']/0x64;return _0x3cdb97[_0x0909('0x1d2')](_0x3a2ee9,_0x20d9c1,_0x471b07,_0x414ea0,_0x8e074d)[_0x0909('0xaf')](function(_0x3a3831){return _0x702d1f(_0x3a3831);});case'agentBusyFactor':var _0x4dbffc=_0x5bca78[_0x0909('0x1ba')]/0x64;return _0x3cdb97[_0x0909('0x1d3')](_0x3a2ee9,_0x20d9c1,_0x471b07,_0x414ea0,_0x4dbffc)['then'](function(_0x5229de){return _0x702d1f(_0x5229de);});default:return _0x918f75(msgResponse(_0x0909('0x1d4'),_0x0909('0x13e'),_0x0909('0x1d5')));}}else{return _0x918f75(msgResponse('[getDataPredictive]','Failure',_0x0909('0x1d6')));}});};};Dialer[_0x0909('0x1b')][_0x0909('0x1d7')]=function(_0x43e478){var _0x2aeacd=this;return function(_0x371d32){return new BPromise(function(_0x213615,_0x45fd8b){_['merge'](_0x43e478,_0x371d32[0x0]);if(checkGetDataPredictive(_0x371d32[0x0])){loggerPredictive['info'](JSON[_0x0909('0x4b')](_0x371d32[0x0]));if(_0x43e478[_0x0909('0x1c4')]===_0x0909('0x1c5')){return _0x2aeacd[_0x0909('0xc0')](_0x43e478['id'])[_0x0909('0xaf')](function(_0x54ff81){var _0x56741e=_0x43e478['loggedIn']-_0x54ff81[0x0][_0x0909('0x1d8')];var _0x58acb8=_0x43e478[_0x0909('0x1c9')]*0x3c;var _0x379671=_0x371d32[0x0][_0x0909('0x6b')]+_0x371d32[0x0][_0x0909('0x6a')];var _0x29c479=(_0x371d32[0x0]['predictiveIntervalAnsweredCalls']+_0x371d32[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x371d32[0x0][_0x0909('0x82')])/_0x371d32[0x0]['predictiveIntervalTotalCalls'];var _0x264d39=_0x43e478[_0x0909('0x1ba')]/0x64;_0x43e478[_0x0909('0x1d9')]=_0x54ff81[0x0][_0x0909('0x1d8')]||0x0;_0x43e478[_0x0909('0x6d')]=_0x29c479>0x0?_0x29c479:0x1;return _0x2aeacd[_0x0909('0x1d2')](_0x56741e,_0x58acb8,_0x379671,_0x29c479,_0x264d39);})[_0x0909('0xaf')](function(_0x530a65){return _0x213615(_0x530a65);})[_0x0909('0xa8')](function(_0x460e43){return _0x45fd8b(msgResponse('[CatchErlangB]',_0x0909('0x13e'),JSON[_0x0909('0x4b')](_0x460e43)));});}if(_0x43e478[_0x0909('0x1c4')]==='agentBusyFactor'){return _0x2aeacd[_0x0909('0xc0')](_0x43e478['id'])[_0x0909('0xaf')](function(_0x44323f){var _0x32a34a=_0x43e478[_0x0909('0x53')]-_0x44323f[0x0][_0x0909('0x1d8')];var _0x1841d5=_0x43e478[_0x0909('0x1c9')]*0x3c;var _0x128ce2=_0x371d32[0x0][_0x0909('0x6b')]+_0x371d32[0x0]['predictiveIntervalAvgHoldtime'];var _0x19652b=(_0x371d32[0x0][_0x0909('0x7e')]+_0x371d32[0x0][_0x0909('0x7f')]+_0x371d32[0x0][_0x0909('0x82')])/_0x371d32[0x0]['predictiveIntervalTotalCalls'];var _0x488f27=_0x43e478[_0x0909('0x1ba')]/0x64;_0x43e478[_0x0909('0x1d9')]=_0x44323f[0x0][_0x0909('0x1d8')]||0x0;_0x43e478['predictiveIntervalHitRate']=_0x19652b>0x0?_0x19652b:0x1;return _0x2aeacd['busyFactor'](_0x32a34a,_0x1841d5,_0x128ce2,_0x19652b,_0x488f27);})[_0x0909('0xaf')](function(_0x572ce7){return _0x213615(_0x572ce7);})['catch'](function(_0x2a5a54){return _0x45fd8b(msgResponse(_0x0909('0x1da'),_0x0909('0x13e'),JSON[_0x0909('0x4b')](_0x2a5a54)));});}}else{return _0x45fd8b(msgResponse('[getDataPredictive]','Failure',_0x0909('0x1d6')));}});};};Dialer[_0x0909('0x1b')][_0x0909('0x1cc')]=function(_0x63d796){var _0x28ddc2=this;return function(){var _0x1eef4e=0x0;var _0x428a85=Math[_0x0909('0x1bf')](_0x63d796[_0x0909('0x71')]*0x3e8);if(_0x428a85>0x0){_0x428a85=_0x428a85<0x64?0x64:_0x428a85;loggerPredictive[_0x0909('0x80')](_0x63d796[_0x0909('0x40')],_0x0909('0x1db'),_0x428a85,_0x0909('0x4c'));_0x63d796[_0x0909('0x8d')]=setInterval(function(){_0x28ddc2[_0x0909('0x8d')](_0x63d796);loggerPredictiveCalls[_0x0909('0x80')]('[handlePredictive]',_0x1eef4e+=0x1);},_0x428a85);}else{loggerPredictive[_0x0909('0x80')](_0x63d796['name'],_0x0909('0x1dc'));}};};Dialer['prototype'][_0x0909('0x1dd')]=function(_0x2b93b8,_0x566b60){var _0x597eb6=this;return function(_0x5926eb){if(_['isEmpty'](_0x5926eb)){if(_[_0x0909('0xa4')](_0x566b60[_0x0909('0x1de')])||!_0x566b60['recallme']){if(_0x2b93b8[_0x0909('0x150')]==='booked'){_0x2b93b8[_0x0909('0x129')]=_['isUndefined'](_0x2b93b8[_0x0909('0x129')])?!![]:_0x2b93b8[_0x0909('0x129')];var _0x4fb496=uuid['v4']();_0x597eb6[_0x0909('0x26')][_0x4fb496]=new Action(_0x2b93b8,_0x566b60,_0x4fb496);loggerBooked[_0x0909('0x80')](_0x0909('0x1df'),_0x4fb496,'queueStatusComplete:\x20',JSON[_0x0909('0x4b')](_0x2b93b8[_0x0909('0x129')]),'Queue:\x20',_0x2b93b8[_0x0909('0x40')]);if(_0x2b93b8[_0x0909('0x129')]){_0x2b93b8['queueStatusComplete']=![];_0x597eb6[_0x0909('0x2c')][_0x597eb6[_0x0909('0x26')][_0x4fb496][_0x0909('0xab')]]=[];ami[_0x0909('0xa5')]({'actionid':_0x4fb496,'action':_0x0909('0x1e0'),'queue':_0x2b93b8[_0x0909('0x40')]})[_0x0909('0xa8')](function(){_0x597eb6[_0x0909('0xaa')](_0x2b93b8);_0x597eb6[_0x0909('0xb8')]({'active':![],'ContactId':_0x597eb6['actions'][_0x4fb496][_0x0909('0xcc')],'ListId':_0x597eb6[_0x0909('0x26')][_0x4fb496][_0x0909('0xcd')],'VoiceQueueId':_0x597eb6[_0x0909('0x26')][_0x4fb496][_0x0909('0xce')]||undefined,'CampaignId':_0x597eb6['actions'][_0x4fb496][_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x597eb6[_0x0909('0x26')][_0x4fb496];});}else{loggerBooked[_0x0909('0x80')](_0x0909('0x1e1'),JSON[_0x0909('0x4b')](_0x2b93b8[_0x0909('0x129')]),_0x0909('0x1e2'),_0x2b93b8[_0x0909('0x40')]);_0x597eb6[_0x0909('0xaa')](_0x2b93b8);_0x597eb6[_0x0909('0xb8')]({'active':![],'ContactId':_0x597eb6['actions'][_0x4fb496][_0x0909('0xcc')],'ListId':_0x597eb6[_0x0909('0x26')][_0x4fb496]['ListId'],'VoiceQueueId':_0x597eb6[_0x0909('0x26')][_0x4fb496][_0x0909('0xce')]||undefined,'CampaignId':_0x597eb6[_0x0909('0x26')][_0x4fb496]['CampaignId']||undefined})[_0x0909('0xa8')](loggerCatch(_0x0909('0x1e3')));delete _0x597eb6[_0x0909('0x26')][_0x4fb496];}}else{return _0x597eb6[_0x0909('0x161')](_0x2b93b8,_0x566b60);}}else{if(getDiff(_0x566b60[_0x0909('0x1e4')])<_0x2b93b8[_0x0909('0x1e5')]*0x3c){if(_0x566b60[_0x0909('0x1e6')]&&!_0x566b60['Agent'][_0x0909('0x1e7')]){_0x597eb6[_0x0909('0x20')][_0x0909('0x12b')](_0x566b60['id'])[_0x0909('0x1e')](function(){_0x597eb6['updateOriginated'](_0x2b93b8);});}else{_0x597eb6['unlockContact']({'active':![]},_0x566b60['id'],0x1)[_0x0909('0x1e')](function(){_0x597eb6['updateOriginated'](_0x2b93b8);});}}else{_0x2b93b8[_0x0909('0x1e8')]+=0x1;_0x597eb6['updateOriginated'](_0x2b93b8);if(_0x2b93b8['dialRecallInQueue']){_0x597eb6[_0x0909('0xb8')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x566b60['ContactId'],'ListId':_0x566b60[_0x0909('0xcd')],'VoiceQueueId':_0x566b60['VoiceQueueId']||undefined,'CampaignId':_0x566b60[_0x0909('0xcf')]||undefined})[_0x0909('0xa8')](loggerCatch(_0x0909('0x1e9')));_0x597eb6['createHistory'](createObjHistory(_0x2b93b8,_0x566b60,_0x0909('0x1ea'),0x17,_0x0909('0x1eb')))[_0x0909('0xa8')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x597eb6[_0x0909('0xca')](createObjHistory(_0x2b93b8,_0x566b60,_0x0909('0x1ec'),0x16,_0x0909('0x1ed')),_0x0909('0x1ee'),_0x0909('0x1ef'));}}}}else{_0x2b93b8[_0x0909('0x62')]+=0x1;_0x597eb6[_0x0909('0xca')](createObjHistory(_0x2b93b8,_0x566b60,_0x0909('0x1f0'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0x0909('0x1f1'));throw _0x0909('0x1f2');}};};Dialer[_0x0909('0x1b')][_0x0909('0x156')]=function(_0x50a3a7){var _0x1b476d=this;var _0xbbd2c9=_0x50a3a7['limitCalls']-_0x50a3a7[_0x0909('0x6f')]-_0x50a3a7[_0x0909('0xbc')];emitCampaignSummary(_0x50a3a7);if(_0xbbd2c9>0x0){if(_0xbbd2c9>this['maxNumberOriginate']){_0xbbd2c9=this['maxNumberOriginate'];}_0x50a3a7[_0x0909('0xbc')]+=_0xbbd2c9;this[_0x0909('0xbe')](_0x50a3a7['id'],_0xbbd2c9,_0x50a3a7['dialOrderByScheduledAt'],_0x50a3a7)[_0x0909('0xaf')](function(_0x2cfd20){_0x50a3a7[_0x0909('0xbc')]-=_0xbbd2c9;_0x50a3a7[_0x0909('0xbc')]=_0x50a3a7['temp']>0x0?_0x50a3a7[_0x0909('0xbc')]:0x0;if(!checkContactEmpty(_0x2cfd20)){_0x50a3a7[_0x0909('0x41')]=_0x0909('0x97');logger[_0x0909('0x80')](_0x0909('0x1f3')+_0x50a3a7[_0x0909('0x40')]);}else{_0x50a3a7[_0x0909('0x6f')]+=_0x2cfd20[_0x0909('0x130')];_0x50a3a7['message']='RUNNING';for(var _0x1bdb73=0x0;_0x1bdb73<_0x2cfd20[_0x0909('0x130')];_0x1bdb73+=0x1){_0x50a3a7[_0x0909('0x1f4')]+=0x1;if(_['isNil'](_0x2cfd20[_0x1bdb73])||_[_0x0909('0xa4')](_0x2cfd20[_0x1bdb73][_0x0909('0x163')])||_[_0x0909('0xa4')](_0x2cfd20[_0x1bdb73][_0x0909('0x163')][_0x0909('0x164')])){_0x1b476d[_0x0909('0xc9')](_0x0909('0x1f5'),_0x50a3a7,_0x2cfd20[_0x1bdb73]);}else{_0x1b476d['checkIsBlackListIvr'](_['pick'](_0x2cfd20[_0x1bdb73],['CampaignId',_0x0909('0x1f6')]))[_0x0909('0xaf')](_0x1b476d[_0x0909('0x1dd')](_0x50a3a7,_0x2cfd20[_0x1bdb73]))[_0x0909('0xa8')](_0x1b476d['loggerHandler'](_0x0909('0x1f7'),_0x50a3a7));}}}})[_0x0909('0xa8')](loggerGetContactDialer('[getContactCampaign2]',_0x50a3a7,_0xbbd2c9));}};Dialer[_0x0909('0x1b')][_0x0909('0x151')]=function(_0x51e7fb,_0x4e82da){var _0x2313b9=this;var _0x45c9b9=[];var _0x1ba170=_0x4e82da>=0x1?_0x4e82da:0x1;if(_0x51e7fb[_0x0909('0x150')]===_0x0909('0x8')){_0x1ba170=0x1;}var _0x50834a=Math['floor'](_0x51e7fb[_0x0909('0x9a')]*_0x1ba170)-_0x51e7fb['originated']-_0x51e7fb[_0x0909('0xbc')];emitVoiceQueueSummary(_0x51e7fb);if(_0x51e7fb[_0x0909('0x1f8')]>0x0){var _0x3c0e44=_0x51e7fb['dialLimitQueue']-_0x51e7fb[_0x0909('0x6f')]-_0x51e7fb[_0x0909('0x58')]-_0x51e7fb[_0x0909('0xbc')]-_0x51e7fb[_0x0909('0x54')];if(_0x50834a>_0x3c0e44){_0x50834a=_0x3c0e44;}}if(_0x50834a>0x0){if(_0x51e7fb[_0x0909('0x150')]===_0x0909('0x8')){_0x50834a=0x1;}if(_0x50834a>this[_0x0909('0x25')]){_0x50834a=this[_0x0909('0x25')];}_0x51e7fb[_0x0909('0xbc')]+=_0x50834a;for(var _0x1b3217 in this[_0x0909('0x23')]){if(typeof this[_0x0909('0x23')][_0x1b3217]!==_0x0909('0x95')){if(this[_0x0909('0x23')][_0x1b3217][_0x0909('0xdf')]===_0x0909('0x1f9')&&this[_0x0909('0x23')][_0x1b3217]['status']===_0x0909('0xd6')){_0x45c9b9[_0x0909('0x126')](this[_0x0909('0x23')][_0x1b3217]['id']);}}}this[_0x0909('0xbb')](_0x51e7fb['id'],_0x45c9b9,_0x50834a,_0x51e7fb[_0x0909('0x1fa')],_0x51e7fb)[_0x0909('0xaf')](function(_0x2aef55){_0x51e7fb[_0x0909('0xbc')]-=_0x50834a;_0x51e7fb[_0x0909('0xbc')]=_0x51e7fb['temp']>0x0?_0x51e7fb['temp']:0x0;if(!checkContactEmpty(_0x2aef55)){_0x2313b9[_0x0909('0xae')](_0x51e7fb)[_0x0909('0xaf')](sendMessageReschedule(_0x51e7fb))['catch'](loggerCatch(_0x0909('0xb0')));}else{_0x51e7fb[_0x0909('0x6f')]+=_0x2aef55['length'];_0x51e7fb[_0x0909('0x41')]=_0x51e7fb[_0x0909('0x150')]==='booked'?'ACTIVE':_0x0909('0x1fb');for(var _0x1d1957=0x0;_0x1d1957<_0x2aef55[_0x0909('0x130')];_0x1d1957+=0x1){if(_[_0x0909('0xa4')](_0x2aef55[_0x1d1957])||_['isNil'](_0x2aef55[_0x1d1957][_0x0909('0x163')])||_[_0x0909('0xa4')](_0x2aef55[_0x1d1957][_0x0909('0x163')][_0x0909('0x164')])){_0x2313b9[_0x0909('0xc9')](_0x0909('0x1f5'),_0x51e7fb,_0x2aef55[_0x1d1957]);}else{_0x2313b9['checkIsBlackList'](_[_0x0909('0xcb')](_0x2aef55[_0x1d1957],['VoiceQueueId',_0x0909('0x1f6')]))[_0x0909('0xaf')](_0x2313b9['checkContactBlack'](_0x51e7fb,_0x2aef55[_0x1d1957]))[_0x0909('0xa8')](_0x2313b9['loggerHandler'](_0x0909('0x1f5'),_0x51e7fb));}}}})[_0x0909('0xa8')](loggerGetContactDialer(_0x0909('0x1fc'),_0x51e7fb,_0x50834a));}};Dialer[_0x0909('0x1b')][_0x0909('0x8d')]=function(_0x12b8e5){if(_0x12b8e5[_0x0909('0x1f8')]>0x0){var _0x2f3a09=_0x12b8e5[_0x0909('0x1f8')]-_0x12b8e5[_0x0909('0x6f')]-_0x12b8e5['talking'];if(_0x2f3a09>0x0){this['tryOriginatePredictive'](_0x12b8e5);}else{loggerPredictiveCalls[_0x0909('0x80')](_0x0909('0x1fd'));}}else{this[_0x0909('0x1fe')](_0x12b8e5);}};Dialer[_0x0909('0x1b')]['tryOriginatePredictive']=function(_0x3e4c2d){var _0x32b7ed=this;var _0x3a876a=[];_0x3e4c2d[_0x0909('0x6f')]+=0x1;for(var _0xf9c2b0 in this[_0x0909('0x23')]){if(typeof this[_0x0909('0x23')][_0xf9c2b0]!==_0x0909('0x95')){if(this[_0x0909('0x23')][_0xf9c2b0][_0x0909('0xdf')]===_0x0909('0x1f9')&&this['agents'][_0xf9c2b0]['status']===_0x0909('0xd6')){_0x3a876a[_0x0909('0x126')](this[_0x0909('0x23')][_0xf9c2b0]['id']);}}}this[_0x0909('0xbb')](_0x3e4c2d['id'],_0x3a876a,0x1,_0x3e4c2d[_0x0909('0x1fa')],_0x3e4c2d)[_0x0909('0xaf')](function(_0x101f79){if(!checkContactEmpty(_0x101f79)){checkContactLowerLimitOriginate(_0x3e4c2d,0x1,0x0);_0x32b7ed[_0x0909('0xae')](_0x3e4c2d)[_0x0909('0xaf')](sendMessageReschedule(_0x3e4c2d))[_0x0909('0xa8')](loggerCatch(_0x0909('0xb0')));}else{_0x3e4c2d[_0x0909('0x41')]=_0x0909('0x1fb');if(_[_0x0909('0xa4')](_0x101f79[0x0])||_[_0x0909('0xa4')](_0x101f79[0x0][_0x0909('0x163')])||_[_0x0909('0xa4')](_0x101f79[0x0][_0x0909('0x163')][_0x0909('0x164')])){_0x32b7ed[_0x0909('0xc9')](_0x0909('0x1f5'),_0x3e4c2d,_0x101f79[0x0]);}else{_0x32b7ed[_0x0909('0xb1')](_[_0x0909('0xcb')](_0x101f79[0x0],[_0x0909('0xce'),_0x0909('0x1f6')]))[_0x0909('0xaf')](_0x32b7ed[_0x0909('0x1dd')](_0x3e4c2d,_0x101f79[0x0]))[_0x0909('0xa8')](_0x32b7ed['loggerHandler'](_0x0909('0x1ff'),_0x3e4c2d));}}})[_0x0909('0xa8')](loggerGetContactDialer(_0x0909('0x200'),_0x3e4c2d,0x1));emitVoiceQueueSummary(_0x3e4c2d);};Dialer['prototype'][_0x0909('0x1d2')]=function(_0x2f261d,_0x82976f,_0x420ebe,_0x42eafb,_0x2aac88,_0x4726ca){loggerPredictive['info'](_0x0909('0x201'));loggerPredictive['info'](_0x0909('0x202'),_0x2f261d);loggerPredictive[_0x0909('0x80')](_0x0909('0x203'),_0x82976f);loggerPredictive[_0x0909('0x80')](_0x0909('0x204'),_0x420ebe);loggerPredictive['info'](_0x0909('0x205'),_0x42eafb);loggerPredictive[_0x0909('0x80')](_0x0909('0x206'),_0x2aac88);loggerPredictive[_0x0909('0x80')]('---------------------------');return new BPromise(function(_0x14e097,_0x59cb6d){if(_0x2f261d<=0x0||isNaN(_0x2f261d)){return _0x59cb6d(msgResponse(_0x0909('0x207'),_0x0909('0x4a'),_0x0909('0x208')+_0x2f261d));}if(_0x420ebe<=0x0||isNaN(_0x420ebe)){return _0x59cb6d(msgResponse(_0x0909('0x207'),_0x0909('0x4a'),_0x0909('0x209')+_0x420ebe));}if(_0x42eafb<=0x0||isNaN(_0x42eafb)){return _0x59cb6d(msgResponse(_0x0909('0x207'),_0x0909('0x4a'),_0x0909('0x20a')+_0x42eafb));}if(_0x82976f<=0x0||isNaN(_0x82976f)){return _0x59cb6d(msgResponse('[abandonmentRate]',_0x0909('0x4a'),_0x0909('0x20b')+_0x82976f));}if(_0x2aac88<=0x0||isNaN(_0x2aac88)){return _0x59cb6d(msgResponse(_0x0909('0x207'),_0x0909('0x4a'),'Amax\x20=\x20'+_0x2aac88));}_0x4726ca=_0x4726ca||0x0;var _0x5cc303=0x1/_0x420ebe;var _0x122aae=0x0;var _0xc1adae=0x0;var _0x5b21f1=0x0;var _0x820af5=0x0;for(var _0x9747e0=0x0;_0x5b21f1<_0x2aac88;_0x9747e0+=0x1){_0xc1adae=_0x9747e0/_0x82976f;_0x122aae=(_0x42eafb*_0xc1adae+_0x4726ca)/_0x5cc303;_0x5b21f1=erlangb(_0x122aae,_0x2f261d);_0x820af5=_0x122aae/_0x2f261d*(0x1-erlangb(_0x122aae,_0x2f261d));}return _0x14e097({'erlangCalls':_0x9747e0,'erlangCallToSecond':_0x82976f/_0x9747e0,'erlangAbandonmentRate':_0x5b21f1,'erlangBusyFactor':_0x820af5});});};Dialer[_0x0909('0x1b')][_0x0909('0x1d3')]=function(_0x5dc494,_0x596cd4,_0x2d8e20,_0x3c8d3b,_0x5366a6,_0x3ed97f){loggerPredictive[_0x0909('0x80')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x0909('0x80')]('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',_0x5dc494);loggerPredictive[_0x0909('0x80')](_0x0909('0x203'),_0x596cd4);loggerPredictive['info'](_0x0909('0x204'),_0x2d8e20);loggerPredictive['info'](_0x0909('0x205'),_0x3c8d3b);loggerPredictive[_0x0909('0x80')](_0x0909('0x20c'),_0x5366a6);loggerPredictive[_0x0909('0x80')](_0x0909('0x89'));return new BPromise(function(_0xddad6e,_0x1e2207){if(_0x5dc494<=0x0||isNaN(_0x5dc494)){return _0x1e2207(msgResponse(_0x0909('0x20d'),_0x0909('0x4a'),'m\x20=\x20'+_0x5dc494));}if(_0x2d8e20<=0x0||isNaN(_0x2d8e20)){return _0x1e2207(msgResponse(_0x0909('0x20d'),_0x0909('0x4a'),_0x0909('0x209')+_0x2d8e20));}if(_0x3c8d3b<=0x0||isNaN(_0x3c8d3b)){return _0x1e2207(msgResponse(_0x0909('0x20d'),_0x0909('0x4a'),_0x0909('0x20a')+_0x3c8d3b));}if(_0x596cd4<=0x0||isNaN(_0x596cd4)){return _0x1e2207(msgResponse(_0x0909('0x20d'),'Error',_0x0909('0x20b')+_0x596cd4));}if(_0x5366a6<=0x0||isNaN(_0x5366a6)){return _0x1e2207(msgResponse(_0x0909('0x20d'),'Error',_0x0909('0x20e')+_0x5366a6));}_0x3ed97f=_0x3ed97f||0x0;var _0x508208=0x1/_0x2d8e20;var _0x1b656c=0x0;var _0x4cc1c0=0x0;var _0x1d52ae=0x0;var _0x48a2cf=0x0;for(var _0x26641f=0x0;_0x48a2cf<_0x5366a6;_0x26641f+=0x1){_0x4cc1c0=_0x26641f/_0x596cd4;_0x1b656c=(_0x3c8d3b*_0x4cc1c0+_0x3ed97f)/_0x508208;_0x1d52ae=erlangb(_0x1b656c,_0x5dc494);_0x48a2cf=_0x1b656c/_0x5dc494*(0x1-erlangb(_0x1b656c,_0x5dc494));}return _0xddad6e({'erlangCalls':_0x26641f,'erlangCallToSecond':_0x596cd4/_0x26641f,'erlangAbandonmentRate':_0x1d52ae,'erlangBusyFactor':_0x48a2cf});});};module[_0x0909('0x20f')]=Dialer;
\ No newline at end of file
+var _0x6931=['dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','response','[callProgressDetecting]\x20','checkRetriveMax','countnosuchnumberretry','dialNoAnswerMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','[rescheduleContact][Drop]','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','dialPredictiveInterval','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','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','predictiveIntervalPauses','outboundQueuePauses','loggedIn','[CatchErlangB]','one\x20call\x20every:','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','available','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','sequence','isNil','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','amd','custom:amd','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','statedesc','AMD','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','reason19\x20machine....','createStateFinal','YYYY-MM-DD\x20HH:mm:ss','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','Unknow','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','droptime','responsetime','Drop','dropreason','dialDropRetryFrequency','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','countabandonedretry','dialAbandonedMaxRetry','queueCallerAbandonCreateState','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','locked','stateinterface','rrmemory','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','Action','command','interval','timezones','indexOf','iftime\x20%s,%s','content','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','pow','replace','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE'];(function(_0x12877b,_0x8650cf){var _0x3549ff=function(_0x4f96b7){while(--_0x4f96b7){_0x12877b['push'](_0x12877b['shift']());}};_0x3549ff(++_0x8650cf);}(_0x6931,0xa5));var _0x1693=function(_0x592a5f,_0x388f99){_0x592a5f=_0x592a5f-0x0;var _0x3f6b50=_0x6931[_0x592a5f];return _0x3f6b50;};'use strict';var util=require(_0x1693('0x0'));var _=require(_0x1693('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x1693('0x2'));var rr=require('rr');var md5=require(_0x1693('0x3'));var Redis=require(_0x1693('0x4'));var ut=require('../preview/util/util');var config=require(_0x1693('0x5'));var logger=require(_0x1693('0x6'))(_0x1693('0x7'));var loggerBooked=require('../../../config/logger')(_0x1693('0x8'));var loggerPredictive=require('../../../config/logger')(_0x1693('0x9'));var loggerPredictiveCalls=require(_0x1693('0x6'))(_0x1693('0xa'));var loggerSyncQueueSummary=require(_0x1693('0x6'))(_0x1693('0xb'));var ami=require(_0x1693('0xc'));config[_0x1693('0xd')]=_[_0x1693('0xe')](config[_0x1693('0xd')],{'host':_0x1693('0xf'),'port':0x18eb});var io=require(_0x1693('0x10'))(new Redis(config[_0x1693('0xd')]));var cmHopper=require(_0x1693('0x11'));var cmHopperHistory=require(_0x1693('0x12'));var cmHopperBlack=require(_0x1693('0x13'));var voiceQueueRt=require(_0x1693('0x14'));var Action=require('./action');var History=require(_0x1693('0x15'));var Final=require('./final');var AgentComplete=require(_0x1693('0x16'));var QueueCallerAbandon=require(_0x1693('0x17'));var Hangup=require('./hangup');var ipAgi=process[_0x1693('0x18')][_0x1693('0x19')]||_0x1693('0x1a');var strategy={'rrmemory':'rrmemory','roundrobin':_0x1693('0x1b')};var Sequence=function(){};Sequence[_0x1693('0x1c')][_0x1693('0x1d')]=function(_0x53f429){this[_0x1693('0x1e')]=this[_0x1693('0x1e')]?this[_0x1693('0x1e')][_0x1693('0x1f')](_0x53f429):_0x53f429();};function Dialer(_0x17cdb8,_0x306dbc){this['sequence']=new Sequence();this[_0x1693('0x20')]=_0x306dbc;this['voiceQueues']=_0x17cdb8[_0x1693('0x21')];this[_0x1693('0x22')]=_0x17cdb8[_0x1693('0x22')];this[_0x1693('0x23')]=_0x17cdb8[_0x1693('0x23')];this[_0x1693('0x24')]=_0x17cdb8[_0x1693('0x24')];this[_0x1693('0x25')]=config[_0x1693('0x25')]||0x2;this[_0x1693('0x26')]={};this[_0x1693('0x27')]={};this[_0x1693('0x28')]={};this[_0x1693('0x29')]={};this[_0x1693('0x2a')]={};this[_0x1693('0x2b')]={};this[_0x1693('0x2c')]={};this['ivrOriginated']={};this[_0x1693('0x2d')]={};this[_0x1693('0x2e')]={};ami['on']('agentconnect',this[_0x1693('0x2f')][_0x1693('0x30')](this));ami['on'](_0x1693('0x31'),this[_0x1693('0x32')][_0x1693('0x30')](this));ami['on']('originateresponse',this[_0x1693('0x33')][_0x1693('0x30')](this));ami['on'](_0x1693('0x34'),this['syncAgentComplete'][_0x1693('0x30')](this));ami['on'](_0x1693('0x35'),this['syncQueueSummary'][_0x1693('0x30')](this));ami['on'](_0x1693('0x36'),this['syncHangup']['bind'](this));ami['on']('newexten',this[_0x1693('0x37')]['bind'](this));ami['on'](_0x1693('0x38'),this[_0x1693('0x39')][_0x1693('0x30')](this));ami['on'](_0x1693('0x3a'),this['syncQueueMember'][_0x1693('0x30')](this));ami['on'](_0x1693('0x3b'),this['syncQueueStatusComplete'][_0x1693('0x30')](this));this[_0x1693('0x3c')]();this[_0x1693('0x3d')]();}function isNotNull(_0x4d30f4){return _0x4d30f4!==null&&!_[_0x1693('0x3e')](_0x4d30f4);}function checkIsLoggedIn(_0x1655b5,_0x33ecf5){return function(){if(_0x33ecf5<=0x0){_0x1655b5[_0x1693('0x3f')]=_0x1693('0x40');throw _0x1655b5[_0x1693('0x41')]+_0x1693('0x42');}};}function isActive(_0x476313){return _0x476313;}function checkIsActive(_0x1ee4e2,_0x4ef268){return function(){if(!isActive(_0x4ef268)){_0x1ee4e2['message']='NOT_ACTIVE';throw _0x1ee4e2[_0x1693('0x41')]+_0x1693('0x43');}};}function checkInterval(_0x56bcbc){return function(){if(!isNotNull(_0x56bcbc[_0x1693('0x44')])){_0x56bcbc[_0x1693('0x3f')]='INTERVAL_IS_NULL';throw _0x56bcbc[_0x1693('0x41')]+_0x1693('0x45');}if(!isNotNull(_0x56bcbc[_0x1693('0x44')][_0x1693('0x46')])){_0x56bcbc['message']=_0x1693('0x47');throw _0x56bcbc['name']+_0x1693('0x45');}if(!isNotNull(_[_0x1693('0x48')](_0x56bcbc['Interval'][_0x1693('0x46')]))){_0x56bcbc['message']='INTERVAL_IS_NULL';throw _0x56bcbc['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x5670b9,_0x402f19,_0x229b58){return{'action':_0x5670b9,'response':_0x402f19,'message':_0x229b58,'stack':_0x229b58};}function myreject(_0x15b3f7){return function(_0x53efad){return _0x15b3f7(msgResponse(_0x1693('0x49'),_0x1693('0x4a'),JSON[_0x1693('0x4b')](_0x53efad)));};}function getSeconds(_0x2b9744,_0x29dabc){var _0x3c15b9=moment(_0x2b9744)['milliseconds'](0x0);var _0x178465=moment(_0x29dabc)[_0x1693('0x4c')](0x0);return _0x3c15b9[_0x1693('0x4d')](_0x178465,_0x1693('0x4e'));}function emit(_0x4d9fec,_0xa3c55,_0x597b0c){io['to'](_0x4d9fec)[_0x1693('0x4f')](_0xa3c55,_0x597b0c);}function emitVoiceQueueSummary(_0x1d58f1){if(_0x1d58f1[_0x1693('0x50')]===_0x1693('0x51')){var _0x23ac0e={'id':_0x1d58f1['id'],'name':_0x1d58f1[_0x1693('0x41')],'strategy':_0x1d58f1[_0x1693('0x52')],'answered':_0x1d58f1[_0x1693('0x53')],'available':_0x1d58f1['available'],'loggedIn':_0x1d58f1['loggedIn'],'pTalking':_0x1d58f1[_0x1693('0x54')],'sumBillable':_0x1d58f1[_0x1693('0x55')],'sumDuration':_0x1d58f1['sumDuration'],'sumHoldTime':_0x1d58f1[_0x1693('0x56')]||0x0,'talking':_0x1d58f1[_0x1693('0x57')],'total':_0x1d58f1[_0x1693('0x58')],'type':_0x1d58f1[_0x1693('0x50')],'unmanaged':_0x1d58f1[_0x1693('0x59')],'abandoned':_0x1d58f1['abandoned'],'waiting':_0x1d58f1[_0x1693('0x5a')],'loggedInDb':_0x1d58f1[_0x1693('0x5b')],'dialActive':_0x1d58f1['dialActive'],'dialMethod':_0x1d58f1[_0x1693('0x5c')],'dialOriginateCallerIdName':_0x1d58f1[_0x1693('0x5d')],'dialOriginateCallerIdNumber':_0x1d58f1[_0x1693('0x5e')],'dialOriginateTimeout':_0x1d58f1[_0x1693('0x5f')],'dialPrefix':_0x1d58f1[_0x1693('0x60')],'outboundAnswerAgiCallsDay':_0x1d58f1['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1d58f1[_0x1693('0x61')],'outboundBlacklistCallsDay':_0x1d58f1[_0x1693('0x62')],'outboundBusyCallsDay':_0x1d58f1[_0x1693('0x63')],'outboundCongestionCallsDay':_0x1d58f1[_0x1693('0x64')],'outboundDropCallsDayACS':_0x1d58f1[_0x1693('0x65')],'outboundDropCallsDayCallersExit':_0x1d58f1[_0x1693('0x66')],'outboundDropCallsDayTimeout':_0x1d58f1['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x1d58f1[_0x1693('0x67')],'outboundNoSuchCallsDay':_0x1d58f1[_0x1693('0x68')],'outboundOriginateFailureCallsDay':_0x1d58f1[_0x1693('0x69')],'outboundReCallsDay':_0x1d58f1[_0x1693('0x6a')],'outboundRejectCallsDay':_0x1d58f1['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1d58f1['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x1d58f1[_0x1693('0x6b')],'predictiveIntervalAvgHoldtime':_0x1d58f1[_0x1693('0x6c')],'predictiveIntervalAvgTalktime':_0x1d58f1[_0x1693('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x1d58f1['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1d58f1[_0x1693('0x6e')],'predictiveIntervalErlangCalls':_0x1d58f1[_0x1693('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x1d58f1[_0x1693('0x70')],'predictiveIntervalHitRate':_0x1d58f1[_0x1693('0x71')],'predictiveIntervalMultiplicativeFactor':_0x1d58f1[_0x1693('0x72')],'predictiveIntervalPauses':_0x1d58f1['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1d58f1[_0x1693('0x73')],'predictiveIntervalTotalCalls':_0x1d58f1[_0x1693('0x74')],'message':_0x1d58f1['message'],'originated':_0x1d58f1[_0x1693('0x75')],'erlangCalls':_0x1d58f1[_0x1693('0x76')],'erlangCallToSecond':_0x1d58f1[_0x1693('0x77')],'erlangAbandonmentRate':_0x1d58f1[_0x1693('0x78')],'erlangBusyFactor':_0x1d58f1[_0x1693('0x79')],'startPredictive':_0x1d58f1['startPredictive'],'startProgressive':_0x1d58f1[_0x1693('0x2c')]};if(_0x1d58f1['Trunk']){_0x23ac0e[_0x1693('0x7a')]={'id':_0x1d58f1[_0x1693('0x7a')]['id'],'name':_0x1d58f1[_0x1693('0x7a')][_0x1693('0x41')],'active':_0x1d58f1[_0x1693('0x7a')][_0x1693('0x7b')],'callerid':_0x1d58f1[_0x1693('0x7a')][_0x1693('0x7c')]};}if(_0x1d58f1[_0x1693('0x44')]){_0x23ac0e['Interval']={'id':_0x1d58f1['Interval']['id'],'name':_0x1d58f1['Interval'][_0x1693('0x41')]};}var _0x36b9f1=md5(JSON['stringify'](_0x23ac0e));if(_0x1d58f1[_0x1693('0x3')]!==_0x36b9f1){_0x1d58f1['md5']=_0x36b9f1;emit(util[_0x1693('0x7d')](_0x1693('0x7e'),_0x23ac0e[_0x1693('0x41')]),_0x1693('0x7f'),_0x23ac0e);}}}function emitCampaignSummary(_0x266d4f){if(_0x266d4f[_0x1693('0x50')]==='ivr'){emit(util[_0x1693('0x7d')](_0x1693('0x80'),_0x266d4f['name']),_0x1693('0x81'),_0x266d4f);}}function checkGetDataPredictive(_0x4e8c7b){if(isNotNull(_0x4e8c7b)&&!_['isEmpty'](_0x4e8c7b)){loggerPredictive['info'](_0x1693('0x82'));loggerPredictive[_0x1693('0x83')](_0x1693('0x84'),_0x4e8c7b[_0x1693('0x74')]);loggerPredictive['info'](_0x1693('0x85'),_0x4e8c7b[_0x1693('0x6b')]);loggerPredictive[_0x1693('0x83')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e8c7b[_0x1693('0x6e')]);loggerPredictive[_0x1693('0x83')](_0x1693('0x86'),_0x4e8c7b[_0x1693('0x87')]);loggerPredictive[_0x1693('0x83')](_0x1693('0x88'),_0x4e8c7b[_0x1693('0x6c')]);loggerPredictive[_0x1693('0x83')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e8c7b[_0x1693('0x6d')]);loggerPredictive[_0x1693('0x83')]('---------------------------');if(_0x4e8c7b[_0x1693('0x74')]>0x0){if(!_[_0x1693('0x3e')](_0x4e8c7b[_0x1693('0x6d')])&&_0x4e8c7b[_0x1693('0x6d')]>0x0){return!![];}loggerPredictive[_0x1693('0x83')](_0x1693('0x89'));if(!_[_0x1693('0x3e')](_0x4e8c7b[_0x1693('0x6c')])&&_0x4e8c7b['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x1693('0x83')](_0x1693('0x8a'));}else{loggerPredictive[_0x1693('0x83')](_0x1693('0x8b'));}}else{loggerPredictive[_0x1693('0x83')](_0x1693('0x8c'));}return![];}function mergeDataErlangB(_0xd16514){return function(_0x193a62){loggerPredictive[_0x1693('0x83')](_0x1693('0x8d'));loggerPredictive[_0x1693('0x83')](_0x1693('0x8e'),_0x193a62[_0x1693('0x76')]);loggerPredictive[_0x1693('0x83')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x193a62[_0x1693('0x77')]);loggerPredictive[_0x1693('0x83')](_0x1693('0x8f'),_0x193a62[_0x1693('0x78')]);loggerPredictive[_0x1693('0x83')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x193a62[_0x1693('0x79')]);loggerPredictive['info'](_0x1693('0x8f'),_0x193a62[_0x1693('0x78')]);loggerPredictive[_0x1693('0x83')](_0x1693('0x90'));_[_0x1693('0x91')](_0xd16514,_0x193a62);};}function getDiff(_0x427595){var _0x431c0e=moment()[_0x1693('0x4c')](0x0);var _0x59711f=moment(_0x427595)[_0x1693('0x4c')](0x0);return _0x431c0e['diff'](_0x59711f,_0x1693('0x4e'));}function ifInterval(_0x5ea130,_0xa1f853){if(_['isUndefined'](_0xa1f853)){return![];}return getDiff(_0xa1f853)<_0x5ea130*0x3c;}function freeVariablesPredictive(_0xec5b33){if(isNotNull(_0xec5b33)){if(!_[_0x1693('0x3e')](_0xec5b33[_0x1693('0x2c')])){_0xec5b33[_0x1693('0x2c')]=undefined;loggerPredictive['info'](_0xec5b33['name'],_0x1693('0x92'));}if(!_['isUndefined'](_0xec5b33[_0x1693('0x2b')])){_0xec5b33[_0x1693('0x2b')]=undefined;loggerPredictive[_0x1693('0x83')](_0xec5b33['name'],_0x1693('0x93'));}if(!_[_0x1693('0x3e')](_0xec5b33[_0x1693('0x94')])){clearInterval(_0xec5b33[_0x1693('0x94')]);_0xec5b33[_0x1693('0x94')]=undefined;loggerPredictive[_0x1693('0x83')](_0xec5b33[_0x1693('0x41')],_0x1693('0x95'));}}}function erlangb(_0x488cb5,_0x26a7f1){if(_0x26a7f1===0x0){return 0x0;}var _0x39465d=0x1;for(var _0x93e816=0x1;_0x93e816<=_0x26a7f1;_0x93e816+=0x1){_0x39465d=0x1+_0x39465d*_0x93e816/_0x488cb5;}return 0x1/_0x39465d;}function isVoiceQueueOutbound(_0x3d4cec){return _0x3d4cec==='outbound';}function isNotPreview(_0x8b037d){return _0x8b037d!==_0x1693('0x20');}function isCampaignIvr(_0x3cfe8a){return _0x3cfe8a===_0x1693('0x96');}function getCallerId(_0x5efb0e,_0x5f3b22,_0xf24f96){if(!_[_0x1693('0x3e')](_0xf24f96)&&typeof _0xf24f96==='string'&&!_[_0x1693('0x48')](_0xf24f96)){if(!_['isUndefined'](_0x5f3b22)&&typeof _0x5f3b22===_0x1693('0x97')&&!_['isEmpty'](_0x5f3b22)){return util[_0x1693('0x7d')](_0x1693('0x98'),_0x5f3b22,_0xf24f96);}return util['format']('\x22%s\x22\x20<%s>',_0xf24f96,_0xf24f96);}if(!_[_0x1693('0x3e')](_0x5efb0e)&&typeof _0x5efb0e===_0x1693('0x97')&&!_['isEmpty'](_0x5efb0e)){return _0x5efb0e;}return _0x1693('0x99');}function loggerCatchQueueSummary(_0x429bb7,_0x345f69){return function(_0x369e5c){freeVariablesPredictive(_0x345f69);emitVoiceQueueSummary(_0x345f69);emitCampaignSummary(_0x345f69);loggerSyncQueueSummary[_0x1693('0x9a')](_0x429bb7,util[_0x1693('0x9b')](_0x369e5c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1ac7af,_0x4a077e){return function(_0xc38539){loggerPredictive[_0x1693('0x9a')](_0x4a077e['name'],_0x1ac7af);loggerPredictive[_0x1693('0x9a')](_0xc38539[_0x1693('0x9c')]);freeVariablesPredictive(_0x4a077e);};}function loggerCatch(_0x31508b){return function(_0xd60a3a){logger['error'](_0x31508b,util[_0x1693('0x9b')](_0xd60a3a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3d87d7){return _0x3d87d7&&!_[_0x1693('0x3e')](_0x3d87d7)&&_0x3d87d7[_0x1693('0x9d')]>0x0;}function decremetOriginate(_0x374f3d){if(!_['isUndefined'](_0x374f3d)&&_0x374f3d!==null){if(typeof _0x374f3d[_0x1693('0x75')]!==_0x1693('0x9e')){if(_0x374f3d[_0x1693('0x75')]>0x0){_0x374f3d[_0x1693('0x75')]-=0x1;}else{logger[_0x1693('0x9a')](_0x1693('0x9f'));}}}else{logger[_0x1693('0x9a')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x6b2a11,_0x1c4bb8,_0x159408){if(_0x1c4bb8>_0x159408){for(var _0x5f2bb1=0x0;_0x5f2bb1<_0x1c4bb8-_0x159408;_0x5f2bb1+=0x1){decremetOriginate(_0x6b2a11);}}}function loggerGetContactDialer(_0x4d2d28,_0x286d4e,_0x4d5c8c){return function(_0x40b229){checkContactLowerLimitOriginate(_0x286d4e,_0x4d5c8c,0x0);logger[_0x1693('0x9a')](_0x4d2d28,util[_0x1693('0x9b')](_0x40b229,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5389d1){return function(_0x18b54c){if(isNotNull(_0x18b54c)&&isNotNull(_0x18b54c[0x0])){if(_0x18b54c[0x0][_0x1693('0xa0')]>0x0){_0x5389d1[_0x1693('0x3f')]=_0x1693('0xa1');logger[_0x1693('0x83')]('[getContactDialer2][ReScheduled]'+_0x5389d1[_0x1693('0x41')],_0x18b54c[0x0][_0x1693('0xa0')],_0x1693('0xa2'));}else{_0x5389d1[_0x1693('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x1693('0x83')](_0x1693('0xa3')+_0x5389d1[_0x1693('0x41')]);}}};}function notSendMessagesQueue(_0x40d5a8){if(_0x40d5a8[_0x1693('0xa4')]){freeVariablesPredictive(_0x40d5a8);if(_0x40d5a8[_0x1693('0x75')]===0x0&&_0x40d5a8[_0x1693('0x57')]===0x0&&_0x40d5a8[_0x1693('0x5a')]===0x0&&(_0x40d5a8[_0x1693('0x54')]||0x0)===0x0){_0x40d5a8[_0x1693('0xa4')]=![];_0x40d5a8[_0x1693('0xa5')]=0x0;_0x40d5a8['message']=_0x1693('0xa6');loggerSyncQueueSummary[_0x1693('0x9a')](_0x1693('0xa7'),_0x40d5a8[_0x1693('0x41')],_0x1693('0xa8'));}else{_0x40d5a8[_0x1693('0x3f')]=_0x1693('0xa9');loggerSyncQueueSummary[_0x1693('0x9a')](_0x1693('0xa7'),_0x40d5a8[_0x1693('0x41')],_0x1693('0xaa'));}emitVoiceQueueSummary(_0x40d5a8);}}function notSendMessagesCampaign(_0x157d02){if(_0x157d02[_0x1693('0xa4')]){if(_0x157d02[_0x1693('0x75')]===0x0){_0x157d02['sendMessageOneNotActive']=![];_0x157d02[_0x1693('0x3f')]=_0x1693('0xa6');loggerSyncQueueSummary[_0x1693('0x9a')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x157d02[_0x1693('0x41')],_0x1693('0xa8'));}else{_0x157d02[_0x1693('0x3f')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x1693('0x9a')](_0x1693('0xab'),_0x157d02[_0x1693('0x41')],_0x1693('0xaa'));}emitCampaignSummary(_0x157d02);}}function createObjHistory(_0x4bafee,_0x203292,_0x13fb32,_0x8b1933,_0x3c817f){_0x4bafee[_0x1693('0x3f')]=_0x13fb32;var _0x43c497=new Action(_0x4bafee,_0x203292);var _0x3b43ec=new History(_0x43c497);_0x3b43ec[_0x1693('0xac')]=_0x8b1933;_0x3b43ec['statedesc']=_0x3c817f;_0x3b43ec[_0x1693('0xad')]=_0x43c497[_0x1693('0xae')];return _0x3b43ec;}Dialer['prototype'][_0x1693('0x3d')]=function(){var _0x111d16=this;setInterval(function(){_0x111d16[_0x1693('0xaf')](_0x111d16[_0x1693('0x29')],_0x1693('0xb0'));_0x111d16['clearZombieChannels'](_0x111d16[_0x1693('0x27')],_0x1693('0xb1'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0xe3f39e,_0x59ce4e){var _0x861b35=this;for(var _0x41d21d in _0xe3f39e){if(typeof _0xe3f39e[_0x41d21d]!==_0x1693('0x9e')){this[_0x1693('0xb2')][_0x1693('0x1d')](function(){if(!_[_0x1693('0xb3')](_0xe3f39e[_0x41d21d])){return ami['Action']({'action':_0x1693('0xb4'),'channel':_0xe3f39e[_0x41d21d]['channel']})[_0x1693('0xb5')](function(_0x533670){if(_0x533670['message']===_0x1693('0xb6')){setTimeout(function(){if(_0xe3f39e[_0x41d21d]&&_0xe3f39e[_0x41d21d][_0x1693('0x50')]!==_0x1693('0x96')){_0x861b35[_0x1693('0xb7')](_0x861b35['voiceQueues'][_0xe3f39e[_0x41d21d][_0x1693('0xb8')]]);logger[_0x1693('0x9a')](_0x1693('0xb9'),_0x59ce4e,_0x41d21d,_0xe3f39e[_0x41d21d][_0x1693('0xb8')]);delete _0xe3f39e[_0x41d21d];}if(_0xe3f39e[_0x41d21d]&&_0xe3f39e[_0x41d21d][_0x1693('0x50')]===_0x1693('0x96')){_0x861b35['updateOriginated'](_0x861b35[_0x1693('0x22')][_0xe3f39e[_0x41d21d]['queue']]);logger[_0x1693('0x9a')](_0x1693('0xba'),_0x59ce4e,_0x41d21d,_0xe3f39e[_0x41d21d][_0x1693('0xb8')]);delete _0xe3f39e[_0x41d21d];}},0x2328);}});}});}}};Dialer[_0x1693('0x1c')][_0x1693('0xbb')]=function(_0x103705){return BPromise['resolve']()[_0x1693('0xbc')](cmHopper[_0x1693('0xbb')](_0x103705))[_0x1693('0xb5')](loggerCatch(_0x1693('0xbd')));};Dialer[_0x1693('0x1c')]['checkIsBlackList']=function(_0x27bab1){return BPromise[_0x1693('0xbe')]()[_0x1693('0xbc')](cmHopperBlack[_0x1693('0xbf')](_0x27bab1))[_0x1693('0xb5')](loggerCatch(_0x1693('0xc0')));};Dialer[_0x1693('0x1c')][_0x1693('0xc1')]=function(_0x5027dd){return BPromise[_0x1693('0xbe')]()[_0x1693('0xbc')](cmHopperBlack[_0x1693('0xc1')](_0x5027dd))['catch'](loggerCatch(_0x1693('0xc2')));};Dialer[_0x1693('0x1c')]['averageHandleTime']=function(_0x3f2c2f){return BPromise['resolve']()[_0x1693('0xbc')](cmHopperHistory['avgHandleTime'](_0x3f2c2f))[_0x1693('0xb5')](loggerCatch(_0x1693('0xc3')));};Dialer[_0x1693('0x1c')][_0x1693('0xc4')]=function(_0x245b40){return BPromise[_0x1693('0xbe')]()['then'](cmHopper['rescheduleContact'](_0x245b40))[_0x1693('0xb5')](loggerCatch(_0x1693('0xc5')));};Dialer[_0x1693('0x1c')][_0x1693('0xc6')]=function(_0x1c9562,_0x484c15,_0xb66152){return BPromise['resolve']()['then'](cmHopper[_0x1693('0xc6')](_0x1c9562,_0x484c15,_0xb66152))[_0x1693('0xb5')](loggerCatch(_0x1693('0xc7')));};Dialer[_0x1693('0x1c')][_0x1693('0xc8')]=function(_0x461c9e,_0x3ea789,_0x4bb376,_0x29a04c,_0x4999e2){return BPromise[_0x1693('0xbe')]()[_0x1693('0xbc')](cmHopper[_0x1693('0xc8')](_0x461c9e,_0x3ea789,_0x4bb376,_0x29a04c))[_0x1693('0xb5')](function(_0x2460f8){_0x4999e2['temp']-=_0x4bb376;_0x4999e2[_0x1693('0xc9')]=_0x4999e2[_0x1693('0xc9')]>0x0?_0x4999e2[_0x1693('0xc9')]:0x0;loggerCatch(_0x1693('0xca'))(_0x2460f8);});};Dialer[_0x1693('0x1c')][_0x1693('0xcb')]=function(_0x373f5c,_0x5cc611,_0x14be8e,_0x290674){return BPromise['resolve']()['then'](cmHopper[_0x1693('0xcb')](_0x373f5c,_0x5cc611,_0x14be8e))[_0x1693('0xb5')](function(_0x5c4d18){_0x290674['temp']-=_0x5cc611;_0x290674[_0x1693('0xc9')]=_0x290674['temp']>0x0?_0x290674[_0x1693('0xc9')]:0x0;loggerCatch(_0x1693('0xcc'))(_0x5c4d18);});};Dialer[_0x1693('0x1c')]['getVoiceQueueRtPauses']=function(_0x456916){return BPromise[_0x1693('0xbe')]()[_0x1693('0xbc')](voiceQueueRt[_0x1693('0xcd')](_0x456916))[_0x1693('0xb5')](loggerCatch(_0x1693('0xce')));};Dialer['prototype'][_0x1693('0xcf')]=function(_0x6f5e8d){return BPromise[_0x1693('0xbe')]()['then'](cmHopper[_0x1693('0xcf')](_0x6f5e8d))[_0x1693('0xb5')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x1693('0x1c')]['createHistory']=function(_0x4cd14e){return BPromise['resolve']()[_0x1693('0xbc')](cmHopperHistory[_0x1693('0xd0')](_0x4cd14e))['catch'](loggerCatch(_0x1693('0xd1')));};Dialer[_0x1693('0x1c')]['updateOriginated']=function(_0xc045fa){if(!_['isUndefined'](_0xc045fa)&&_0xc045fa!==null){if(typeof _0xc045fa[_0x1693('0x75')]!=='undefined'){if(_0xc045fa['originated']>0x0){_0xc045fa[_0x1693('0x75')]-=0x1;}else{logger[_0x1693('0x9a')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x1693('0x9a')](_0x1693('0xd2'));}};Dialer[_0x1693('0x1c')]['loggerHandler']=function(_0x2535a1,_0x4eba4c){var _0x368736=this;return function(_0x4cbd94){_0x368736[_0x1693('0xb7')](_0x4eba4c);logger[_0x1693('0x9a')](_0x2535a1,util[_0x1693('0x9b')](_0x4cbd94,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x1693('0xd3')]=function(_0x8c57fe,_0x3869f5,_0x1af33b){var _0x20a261={'state':0x19,'statedesc':_0x1693('0xd4')};this[_0x1693('0xb7')](_0x3869f5);this['saveInDb'](_[_0x1693('0x91')](_0x20a261,_[_0x1693('0xd5')](_0x1af33b,[_0x1693('0xd6'),_0x1693('0xd7'),_0x1693('0xd8'),_0x1693('0xd9'),_0x1693('0xda')])),_0x1693('0xdb'),_0x1693('0xdc'));logger[_0x1693('0x9a')](_0x8c57fe);};Dialer[_0x1693('0x1c')][_0x1693('0xdd')]=function(_0x2fba1a){return _0x2fba1a===_0x1693('0xde');};Dialer[_0x1693('0x1c')][_0x1693('0xdf')]=function(_0x16c057){return!_[_0x1693('0x3e')](_0x16c057)&&_0x16c057&&!_['isUndefined'](_0x16c057['name'])&&!_[_0x1693('0x3e')](_0x16c057[_0x1693('0x7b')])&&_0x16c057[_0x1693('0x7b')]&&(this['trunks'][util[_0x1693('0x7d')](_0x1693('0xe0'),_0x16c057[_0x1693('0x41')])][_0x1693('0xb4')]===_0x1693('0xe1')||this[_0x1693('0x24')][util['format']('SIP/%s',_0x16c057[_0x1693('0x41')])][_0x1693('0xb4')]===_0x1693('0xe2'));};Dialer[_0x1693('0x1c')]['saveInDb']=function(_0x5dcdb2,_0x18a68e,_0x2ff983){this[_0x1693('0xd0')](_0x5dcdb2)[_0x1693('0xb5')](loggerCatch(_0x18a68e));this[_0x1693('0xcf')](_0x5dcdb2)[_0x1693('0xb5')](loggerCatch(_0x2ff983));};Dialer['prototype'][_0x1693('0x39')]=function(_0x290662){var _0x5b8a88=this['uniqueId'][_0x290662[_0x1693('0xe3')]];var _0x24a651;if(!_[_0x1693('0xb3')](_0x290662)&&!_[_0x1693('0xb3')](_0x290662[_0x1693('0xe4')])&&!_['isNil'](_0x290662[_0x1693('0xe4')][_0x1693('0xe5')])&&_0x290662[_0x1693('0xe6')]===_0x1693('0xe7')&&_0x5b8a88){if(_0x5b8a88[_0x1693('0x50')]!=='ivr'&&this['voiceQueues'][_0x5b8a88['queue']][_0x1693('0xe8')]&&_0x290662[_0x1693('0xe9')]===_0x1693('0xea')){delete this[_0x1693('0x29')][_0x290662['uniqueid']];this[_0x1693('0xb7')](this['voiceQueues'][_0x5b8a88[_0x1693('0xb8')]]);this[_0x1693('0x21')][_0x5b8a88['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x5b8a88[_0x1693('0xb8')]][_0x1693('0xeb')]+=0x1;_0x24a651=new Hangup(_0x5b8a88,_0x290662);_0x24a651[_0x1693('0xac')]=0x12;_0x24a651['statedesc']=_0x1693('0xec');_0x24a651[_0x1693('0xed')]='AMD';ami[_0x1693('0x4f')]('custom:amd',ut[_0x1693('0xee')](_0x24a651,'amd'));this[_0x1693('0xef')](_0x24a651,_0x1693('0xf0'),_0x1693('0xf1'));}if(_0x5b8a88['type']!==_0x1693('0x96')&&this[_0x1693('0x21')][_0x5b8a88[_0x1693('0xb8')]]['dialAMDActive']&&_0x290662[_0x1693('0xe9')]===_0x1693('0xf2')){var _0x1fe113=this;return new BPromise(function(_0x31a04b,_0x1afaa1){delete _0x1fe113[_0x1693('0x29')][_0x290662['uniqueid']];_0x1fe113[_0x1693('0xb7')](_0x1fe113['voiceQueues'][_0x5b8a88[_0x1693('0xb8')]]);_0x1fe113[_0x1693('0x21')][_0x5b8a88['queue']][_0x1693('0x61')]+=0x1;_0x1fe113[_0x1693('0x21')][_0x5b8a88[_0x1693('0xb8')]][_0x1693('0xeb')]+=0x1;var _0x50ede6=_0x1fe113[_0x1693('0x21')][_0x5b8a88[_0x1693('0xb8')]];var _0x2501d3=new Hangup(_0x5b8a88,_0x290662);_0x2501d3[_0x1693('0xac')]=0x13;_0x2501d3['statedesc']=_0x1693('0xf3');_0x2501d3[_0x1693('0xed')]='AMD';_0x2501d3[_0x1693('0xf4')]+=0x1;_0x2501d3[_0x1693('0xf5')]+=0x1;_0x2501d3[_0x1693('0xf6')]=!![];ami[_0x1693('0x4f')](_0x1693('0xf7'),ut[_0x1693('0xee')](_0x2501d3,_0x1693('0xf6')));_0x1fe113[_0x1693('0xd0')](_0x2501d3)[_0x1693('0xb5')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2501d3[_0x1693('0xf8')]+_0x2501d3[_0x1693('0xf9')]+_0x2501d3[_0x1693('0xfa')]+_0x2501d3['countnosuchnumberretry']+_0x2501d3[_0x1693('0xfb')]+_0x2501d3['countabandonedretry']+_0x2501d3['countmachineretry']+_0x2501d3[_0x1693('0xfc')]>=_0x50ede6[_0x1693('0xfd')]){_0x1fe113[_0x1693('0xfe')](_0x2501d3,_0x31a04b,_0x1afaa1,'reason19\x20machine....');}else{if(_0x2501d3['countmachineretry']>=_0x50ede6[_0x1693('0xff')]){_0x1fe113['createStateFinal'](_0x2501d3,_0x31a04b,_0x1afaa1,_0x1693('0x100'));}else{_0x1fe113[_0x1693('0xc4')]({'active':![],'countmachineretry':_0x2501d3[_0x1693('0xf4')],'scheduledat':moment()[_0x1693('0x101')](_0x50ede6[_0x1693('0x102')],_0x1693('0x103'))[_0x1693('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2501d3[_0x1693('0xd6')],'ListId':_0x2501d3[_0x1693('0xd7')],'VoiceQueueId':_0x2501d3[_0x1693('0xd9')]||undefined,'CampaignId':_0x2501d3[_0x1693('0xda')]||undefined})[_0x1693('0xb5')](loggerCatch(_0x1693('0x104')));_0x31a04b({'reschedule':0x1});}}});}if(_0x5b8a88[_0x1693('0x50')]===_0x1693('0x96')&&this[_0x1693('0x22')][_0x5b8a88[_0x1693('0xb8')]][_0x1693('0xe8')]&&_0x290662[_0x1693('0xe9')]===_0x1693('0xea')){delete this['uniqueId'][_0x290662[_0x1693('0xe3')]];this[_0x1693('0xb7')](this['campaigns'][_0x5b8a88[_0x1693('0xb8')]]);_0x24a651=new Hangup(_0x5b8a88,_0x290662);_0x24a651[_0x1693('0xac')]=0x12;_0x24a651[_0x1693('0x105')]='HangupInAMD';_0x24a651[_0x1693('0xed')]=_0x1693('0x106');ami[_0x1693('0x4f')]('custom:amd',ut['buildObj'](_0x24a651,_0x1693('0xf6')));this[_0x1693('0xef')](_0x24a651,'[syncHangupInAMDIvr][createHistory]',_0x1693('0x107'));}if(_0x5b8a88[_0x1693('0x50')]==='ivr'&&this['campaigns'][_0x5b8a88[_0x1693('0xb8')]][_0x1693('0xe8')]&&_0x290662[_0x1693('0xe9')]===_0x1693('0xf2')){var _0x1fe113=this;return new BPromise(function(_0x204b04,_0x1fbd9f){delete _0x1fe113[_0x1693('0x29')][_0x290662['uniqueid']];_0x1fe113[_0x1693('0xb7')](_0x1fe113[_0x1693('0x22')][_0x5b8a88[_0x1693('0xb8')]]);_0x1fe113[_0x1693('0x22')][_0x5b8a88[_0x1693('0xb8')]][_0x1693('0x61')]+=0x1;_0x1fe113['campaigns'][_0x5b8a88['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x5d106c=_0x1fe113[_0x1693('0x22')][_0x5b8a88[_0x1693('0xb8')]];var _0x3a818c=new Hangup(_0x5b8a88,_0x290662);_0x3a818c[_0x1693('0xac')]=0x13;_0x3a818c[_0x1693('0x105')]=_0x1693('0xf3');_0x3a818c[_0x1693('0xed')]=_0x1693('0x106');_0x3a818c['countmachineretry']+=0x1;_0x3a818c['countglobal']+=0x1;_0x3a818c[_0x1693('0xf6')]=!![];ami['emit']('custom:amd',ut['buildObj'](_0x3a818c,_0x1693('0xf6')));_0x1fe113[_0x1693('0xd0')](_0x3a818c)['catch'](loggerCatch(_0x1693('0x108')));if(_0x3a818c[_0x1693('0xf8')]+_0x3a818c[_0x1693('0xf9')]+_0x3a818c[_0x1693('0xfa')]+_0x3a818c['countnosuchnumberretry']+_0x3a818c[_0x1693('0xfb')]+_0x3a818c['countabandonedretry']+_0x3a818c[_0x1693('0xf4')]+_0x3a818c[_0x1693('0xfc')]>=_0x5d106c['dialGlobalMaxRetry']){_0x1fe113[_0x1693('0xfe')](_0x3a818c,_0x204b04,_0x1fbd9f,_0x1693('0x109'));}else{if(_0x3a818c['countmachineretry']>=_0x5d106c['dialMachineMaxRetry']){_0x1fe113[_0x1693('0x10a')](_0x3a818c,_0x204b04,_0x1fbd9f,_0x1693('0x100'));}else{_0x1fe113[_0x1693('0xc4')]({'active':![],'countmachineretry':_0x3a818c[_0x1693('0xf4')],'scheduledat':moment()[_0x1693('0x101')](_0x5d106c[_0x1693('0x102')],'minutes')[_0x1693('0x7d')](_0x1693('0x10b')),'ContactId':_0x3a818c[_0x1693('0xd6')],'ListId':_0x3a818c[_0x1693('0xd7')],'VoiceQueueId':_0x3a818c[_0x1693('0xd9')]||undefined,'CampaignId':_0x3a818c[_0x1693('0xda')]||undefined})[_0x1693('0xb5')](loggerCatch('[rescheduleContact][Machine]'));_0x204b04({'reschedule':0x1});}}});}}};Dialer[_0x1693('0x1c')]['syncHangup']=function(_0x16eb38){var _0x1ed2b3=this['uniqueId'][_0x16eb38['uniqueid']];var _0x52e4c0=this;var _0x3707dd;if(_0x1ed2b3&&_0x1ed2b3[_0x1693('0x50')]==='ivr'){delete this['uniqueId'][_0x16eb38[_0x1693('0xe3')]];this[_0x1693('0xb7')](this['campaigns'][_0x1ed2b3[_0x1693('0xb8')]]);this['campaigns'][_0x1ed2b3[_0x1693('0xb8')]]['ivrAnswerCallsDay']+=0x1;_0x3707dd=new Hangup(_0x1ed2b3,_0x16eb38);this[_0x1693('0xd0')](_0x3707dd)[_0x1693('0xb5')](loggerCatch(_0x1693('0x10c')));this[_0x1693('0xcf')](_0x3707dd)[_0x1693('0xb5')](loggerCatch(_0x1693('0x10d')));}if(_0x1ed2b3&&_0x1ed2b3[_0x1693('0x50')]!=='ivr'&&isNotNull(this[_0x1693('0x21')][_0x1ed2b3[_0x1693('0xb8')]][_0x1693('0x10e')])){delete this[_0x1693('0x29')][_0x16eb38['uniqueid']];this[_0x1693('0xb7')](this['voiceQueues'][_0x1ed2b3['queue']]);this[_0x1693('0x21')][_0x1ed2b3[_0x1693('0xb8')]][_0x1693('0x61')]+=0x1;this[_0x1693('0x21')][_0x1ed2b3[_0x1693('0xb8')]][_0x1693('0xeb')]+=0x1;_0x3707dd=new Hangup(_0x1ed2b3,_0x16eb38);_0x3707dd['state']=0x10;_0x3707dd['statedesc']='AnswerAGI';_0x3707dd['membername']=_0x1693('0x10f');this[_0x1693('0xd0')](_0x3707dd)[_0x1693('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x1693('0xcf')](_0x3707dd)[_0x1693('0xb5')](loggerCatch('[syncHangupIvr]'));}if(_0x1ed2b3&&_0x1ed2b3['type']!==_0x1693('0x96')&&!isNotNull(this['voiceQueues'][_0x1ed2b3[_0x1693('0xb8')]]['dialQueueProject'])){delete this[_0x1693('0x29')][_0x16eb38['uniqueid']];this['updateOriginated'](this[_0x1693('0x21')][_0x1ed2b3['queue']]);this[_0x1693('0x21')][_0x1ed2b3[_0x1693('0xb8')]][_0x1693('0x110')]+=0x1;_0x3707dd=new Hangup(_0x1ed2b3,_0x16eb38);_0x3707dd[_0x1693('0xac')]=0xc;_0x3707dd[_0x1693('0x105')]=_0x16eb38[_0x1693('0x111')];_0x3707dd[_0x1693('0xed')]=_0x1693('0x112');this[_0x1693('0xd0')](_0x3707dd)[_0x1693('0xb5')](loggerCatch(_0x1693('0x10c')));this['moveContactManagedDialer'](_0x3707dd)[_0x1693('0xb5')](loggerCatch(_0x1693('0x10d')));}};Dialer[_0x1693('0x1c')]['syncAgentComplete']=function(_0x265106){var _0x5e6e29=this[_0x1693('0x29')][_0x265106[_0x1693('0xe3')]];var _0x330eb6=this;if(this[_0x1693('0x21')][_0x265106[_0x1693('0xb8')]]){if(_0x5e6e29&&_0x5e6e29[_0x1693('0x50')]!=='ivr'){delete this[_0x1693('0x29')][_0x265106[_0x1693('0xe3')]];this['voiceQueues'][_0x265106[_0x1693('0xb8')]][_0x1693('0x61')]+=0x1;var _0x24f138=new AgentComplete(_0x5e6e29,_0x265106);if(_0x265106['reason']===_0x1693('0x113')){_0x24f138['agiafterat']=this['voiceQueues'][_0x265106['queue']][_0x1693('0x114')]&&this[_0x1693('0x21')][_0x265106[_0x1693('0xb8')]][_0x1693('0x115')]?moment()[_0x1693('0x7d')](_0x1693('0x10b')):undefined;}this['createHistory'](_0x24f138)[_0x1693('0xb5')](loggerCatch(_0x1693('0x116')));this['moveContactManagedDialer'](_0x24f138)['catch'](loggerCatch(_0x1693('0x117')));}}};Dialer[_0x1693('0x1c')][_0x1693('0x2f')]=function(_0x3b7ff0){if(this['voiceQueues'][_0x3b7ff0[_0x1693('0xb8')]]){if(this[_0x1693('0x29')][_0x3b7ff0[_0x1693('0xe3')]]&&this['uniqueId'][_0x3b7ff0['uniqueid']][_0x1693('0x50')]!==_0x1693('0x96')){this[_0x1693('0xb7')](this['voiceQueues'][_0x3b7ff0[_0x1693('0xb8')]]);this[_0x1693('0x29')][_0x3b7ff0['uniqueid']][_0x1693('0x118')]=moment()[_0x1693('0x7d')](_0x1693('0x10b'));}}};Dialer[_0x1693('0x1c')]['queueCallerAbandonCreateState']=function(_0x1a3e41){this[_0x1693('0xd0')](_0x1a3e41)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x1693('0xcf')](_0x1a3e41)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x1693('0x1c')][_0x1693('0x32')]=function(_0x51bc25){var _0x4d5620=this[_0x1693('0x29')][_0x51bc25[_0x1693('0xe3')]];var _0x353b7d=this;if(this[_0x1693('0x21')][_0x51bc25[_0x1693('0xb8')]]){if(_0x4d5620&&_0x4d5620[_0x1693('0x50')]!==_0x1693('0x96')){delete this[_0x1693('0x29')][_0x51bc25[_0x1693('0xe3')]];this[_0x1693('0xb7')](this['voiceQueues'][_0x51bc25['queue']]);_0x4d5620[_0x1693('0x119')]=moment()[_0x1693('0x7d')](_0x1693('0x10b'));var _0x52df71=new QueueCallerAbandon(_0x4d5620,_0x51bc25);if(getSeconds(_0x4d5620[_0x1693('0x119')],_0x4d5620[_0x1693('0x11a')])>=_0x4d5620['dialQueueTimeout']){this[_0x1693('0x21')][_0x51bc25[_0x1693('0xb8')]][_0x1693('0x6e')]+=0x1;this[_0x1693('0x21')][_0x51bc25[_0x1693('0xb8')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x51bc25[_0x1693('0xb8')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x52df71[_0x1693('0xac')]=0xa;_0x52df71['statedesc']=_0x1693('0x11b');_0x52df71[_0x1693('0x11c')]='TIMEOUT';_0x52df71['agiafterat']=this[_0x1693('0x21')][_0x51bc25['queue']][_0x1693('0x114')]?moment()[_0x1693('0x7d')](_0x1693('0x10b')):undefined;_0x52df71['countdropretry']+=0x1;_0x52df71[_0x1693('0xf5')]+=0x1;if(_0x52df71[_0x1693('0xfb')]>=this[_0x1693('0x21')][_0x51bc25['queue']]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x52df71);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x52df71[_0x1693('0xfb')],'scheduledat':moment()[_0x1693('0x101')](this['voiceQueues'][_0x51bc25['queue']][_0x1693('0x11d')],_0x1693('0x103'))[_0x1693('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4d5620[_0x1693('0xd6')],'ListId':_0x4d5620[_0x1693('0xd7')],'VoiceQueueId':_0x4d5620[_0x1693('0xd9')]||undefined,'CampaignId':_0x4d5620['CampaignId']||undefined})[_0x1693('0xb5')](loggerCatch('[rescheduleContact][Drop]'));var _0x5b7d12=new History(_0x52df71);_0x5b7d12['state']=0xa;_0x5b7d12['statedesc']=_0x1693('0x11b');_0x5b7d12[_0x1693('0xae')]=moment()[_0x1693('0x7d')](_0x1693('0x10b'));_0x5b7d12[_0x1693('0xad')]=_0x5b7d12[_0x1693('0xae')];_0x5b7d12[_0x1693('0x11e')]=_0x52df71[_0x1693('0x11e')];_0x5b7d12['calleridnum']=_0x52df71[_0x1693('0x11f')];this[_0x1693('0xd0')](_0x5b7d12)['catch'](loggerCatch(_0x1693('0x120')));}}else{this[_0x1693('0x21')][_0x51bc25['queue']][_0x1693('0x87')]+=0x1;this[_0x1693('0x21')][_0x51bc25['queue']][_0x1693('0x66')]+=0x1;_0x52df71[_0x1693('0xac')]=0xb;_0x52df71['statedesc']=_0x1693('0x121');_0x52df71[_0x1693('0x11c')]='CALLEREXIT';_0x52df71[_0x1693('0x122')]+=0x1;_0x52df71[_0x1693('0xf5')]+=0x1;if(_0x52df71[_0x1693('0x122')]>=this[_0x1693('0x21')][_0x51bc25[_0x1693('0xb8')]][_0x1693('0x123')]){this[_0x1693('0x124')](_0x52df71);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x52df71[_0x1693('0x122')],'scheduledat':moment()[_0x1693('0x101')](this['voiceQueues'][_0x51bc25[_0x1693('0xb8')]][_0x1693('0x125')],_0x1693('0x103'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4d5620[_0x1693('0xd6')],'ListId':_0x4d5620[_0x1693('0xd7')],'VoiceQueueId':_0x4d5620[_0x1693('0xd9')]||undefined,'CampaignId':_0x4d5620['CampaignId']||undefined})[_0x1693('0xb5')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x5b7d12=new History(_0x52df71);_0x5b7d12[_0x1693('0xac')]=0xb;_0x5b7d12[_0x1693('0x105')]=_0x1693('0x121');_0x5b7d12[_0x1693('0xae')]=moment()[_0x1693('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b7d12[_0x1693('0xad')]=_0x5b7d12[_0x1693('0xae')];_0x5b7d12[_0x1693('0x11e')]=_0x52df71[_0x1693('0x11e')];_0x5b7d12[_0x1693('0x11f')]=_0x52df71[_0x1693('0x11f')];this[_0x1693('0xd0')](_0x5b7d12)[_0x1693('0xb5')](loggerCatch(_0x1693('0x126')));}}}}};Dialer[_0x1693('0x1c')][_0x1693('0x37')]=function(_0x79eee8){if(this[_0x1693('0x27')][_0x79eee8[_0x1693('0xe3')]]){this[_0x1693('0x27')][_0x79eee8[_0x1693('0xe3')]]['channel']=_0x79eee8['channel'];}if(this[_0x1693('0x29')][_0x79eee8[_0x1693('0xe3')]]){this[_0x1693('0x29')][_0x79eee8['uniqueid']][_0x1693('0x127')]=_0x79eee8[_0x1693('0x127')];}};Dialer[_0x1693('0x1c')][_0x1693('0x128')]=function(_0x3b7cfe){if(strategy[this['voiceQueues'][this[_0x1693('0x27')][_0x3b7cfe[_0x1693('0x129')]][_0x1693('0xb8')]]['strategy']]==='roundrobin'){if(this[_0x1693('0x27')][_0x3b7cfe[_0x1693('0x129')]]&&_[_0x1693('0xb3')](this['actions'][_0x3b7cfe[_0x1693('0x129')]][_0x1693('0x12a')])&&_0x3b7cfe['status']==='1'&&_0x3b7cfe['paused']==='0'){if(this[_0x1693('0x23')][_0x3b7cfe[_0x1693('0x12b')]]){if(!this['agents'][_0x3b7cfe[_0x1693('0x12b')]][_0x1693('0x12a')]){this[_0x1693('0x23')][_0x3b7cfe[_0x1693('0x12b')]][_0x1693('0x12a')]=!![];this[_0x1693('0x27')][_0x3b7cfe[_0x1693('0x129')]][_0x1693('0x12a')]=!![];this[_0x1693('0x27')][_0x3b7cfe['actionid']]['stateinterface']=_0x3b7cfe[_0x1693('0x12b')];}}}}else if((strategy[this[_0x1693('0x21')][this[_0x1693('0x27')][_0x3b7cfe[_0x1693('0x129')]][_0x1693('0xb8')]][_0x1693('0x52')]]||_0x1693('0x12c'))==='rrmemory'){if(this['actions'][_0x3b7cfe[_0x1693('0x129')]]){if(this[_0x1693('0x23')][_0x3b7cfe[_0x1693('0x12b')]]){this[_0x1693('0x27')][_0x3b7cfe[_0x1693('0x129')]][_0x1693('0x12b')]=_0x3b7cfe[_0x1693('0x12b')];if(_['isNil'](this[_0x1693('0x2d')][this['actions'][_0x3b7cfe['actionid']][_0x1693('0xb8')]])){this[_0x1693('0x2d')][this['actions'][_0x3b7cfe[_0x1693('0x129')]][_0x1693('0xb8')]]=[];}this['queueBooked'][this[_0x1693('0x27')][_0x3b7cfe[_0x1693('0x129')]][_0x1693('0xb8')]][_0x1693('0x12d')](_['merge'](_[_0x1693('0xd5')](this['actions'][_0x3b7cfe['actionid']],[_0x1693('0x12e'),_0x1693('0x12b')]),{'status':_0x3b7cfe['status'],'paused':_0x3b7cfe[_0x1693('0x12f')]}));}}}};function unlockQueueStatus(_0x151b45,_0x519067){setTimeout(function(){if(_[_0x1693('0x3e')](_0x151b45[_0x1693('0x130')])){loggerBooked[_0x1693('0x9a')](_0x1693('0x131'),_0x519067);}_0x151b45['queueStatusComplete']=!![];loggerBooked[_0x1693('0x83')](_0x1693('0x132'),_0x519067,JSON['stringify'](_[_0x1693('0xd5')](_0x151b45,[_0x1693('0x41'),_0x1693('0x130')])));},0x1f3);}Dialer[_0x1693('0x1c')]['syncQueueStatusComplete']=function(_0x4b50d6){var _0x406d65=this;var _0x157fcb=_0x406d65[_0x1693('0x21')][_0x406d65['actions'][_0x4b50d6[_0x1693('0x129')]]['queue']];if(strategy[this[_0x1693('0x21')][this[_0x1693('0x27')][_0x4b50d6['actionid']][_0x1693('0xb8')]][_0x1693('0x52')]]===_0x1693('0x1b')){if(this[_0x1693('0x27')][_0x4b50d6['actionid']]&&this['actions'][_0x4b50d6[_0x1693('0x129')]]['stateinterface']){this['preview'][_0x1693('0x133')](this['actions'][_0x4b50d6['actionid']][_0x1693('0x12e')],this['actions'][_0x4b50d6[_0x1693('0x129')]][_0x1693('0x12b')])[_0x1693('0xb5')](function(_0x1745d1){logger[_0x1693('0x9a')](_0x1693('0x134'),util[_0x1693('0x9b')](_0x1745d1,{'showHidden':![],'depth':null}));})[_0x1693('0x1f')](function(){_0x406d65[_0x1693('0xb7')](_0x406d65[_0x1693('0x21')][_0x406d65['actions'][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]]);_0x406d65[_0x1693('0x23')][_0x406d65[_0x1693('0x27')][_0x4b50d6['actionid']][_0x1693('0x12b')]][_0x1693('0x12a')]=![];delete _0x406d65[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]];unlockQueueStatus(_0x157fcb);});}else{this[_0x1693('0xb7')](this[_0x1693('0x21')][this['actions'][_0x4b50d6['actionid']][_0x1693('0xb8')]]);this[_0x1693('0xc4')]({'active':![],'ContactId':this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xd6')],'ListId':this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xd7')],'VoiceQueueId':this[_0x1693('0x27')][_0x4b50d6['actionid']][_0x1693('0xd9')]||undefined,'CampaignId':this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]]['CampaignId']||undefined})[_0x1693('0xb5')](loggerCatch(_0x1693('0x135')));delete this[_0x1693('0x27')][_0x4b50d6['actionid']];unlockQueueStatus(_0x157fcb);}}else if((strategy[this[_0x1693('0x21')][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]]['queue']]['strategy']]||'rrmemory')==='rrmemory'){var _0x581958;if(this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]]&&!_[_0x1693('0x48')](this['queueBooked'][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]]['queue']])){if(this[_0x1693('0x2e')][_0x406d65['actions'][_0x4b50d6[_0x1693('0x129')]]['queue']]){this[_0x1693('0x2e')][_0x406d65[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]]=this['queueBookedRR'][this['actions'][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]]?this['queueBookedRR'][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]]:this[_0x1693('0x2d')][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]]?this[_0x1693('0x2d')][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]]['queue']][_0x1693('0x136')]||0x0:0x0;}this[_0x1693('0x2d')][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]][_0x1693('0x136')]=this[_0x1693('0x2e')][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]];for(var _0x205b12=0x0;_0x205b12<this['queueBooked'][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]]['length'];_0x205b12+=0x1){_0x581958=rr(this['queueBooked'][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]]['queue']]);this[_0x1693('0x2e')][_0x406d65[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]]['queue']]=this[_0x1693('0x2d')][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]][_0x1693('0x136')];if(_0x581958['status']==='1'&&_0x581958[_0x1693('0x12f')]==='0'){break;}}if(!_[_0x1693('0xb3')](_0x581958)){this['agents'][_0x581958['stateinterface']]['unlockRR']=_['isUndefined'](this['agents'][_0x581958[_0x1693('0x12b')]][_0x1693('0x137')])?!![]:this[_0x1693('0x23')][_0x581958['stateinterface']]['unlockRR'];}loggerBooked[_0x1693('0x83')](_0x1693('0x138'),_0x4b50d6[_0x1693('0x129')],_0x1693('0x139'),JSON[_0x1693('0x4b')](_['pick'](this[_0x1693('0x23')][_0x581958[_0x1693('0x12b')]],[_0x1693('0x41'),'unlockRR'])),_0x1693('0x13a'),JSON[_0x1693('0x4b')](_0x581958[_0x1693('0x12e')]));if(!_[_0x1693('0xb3')](_0x581958)&&_0x581958[_0x1693('0xb4')]==='1'&&_0x581958['paused']==='0'&&this['agents'][_0x581958[_0x1693('0x12b')]][_0x1693('0x137')]){this['agents'][_0x581958['stateinterface']][_0x1693('0x137')]=![];this[_0x1693('0x2d')][_0x406d65[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]]=[];this['preview']['run'](_0x581958[_0x1693('0x12e')],_0x581958[_0x1693('0x12b')])[_0x1693('0xb5')](function(_0x552695){logger[_0x1693('0x9a')](_0x1693('0x134'),util[_0x1693('0x9b')](_0x552695,{'showHidden':![],'depth':null}));})[_0x1693('0x1f')](function(){_0x406d65[_0x1693('0xb7')](_0x406d65['voiceQueues'][_0x406d65[_0x1693('0x27')][_0x4b50d6['actionid']][_0x1693('0xb8')]]);setTimeout(function(){_0x406d65[_0x1693('0x23')][_0x581958[_0x1693('0x12b')]]['unlockRR']=!![];loggerBooked[_0x1693('0x83')]('[booked][RR][finaly]',_0x4b50d6[_0x1693('0x129')],_0x1693('0x139'),JSON['stringify'](_[_0x1693('0xd5')](_0x406d65[_0x1693('0x23')][_0x581958[_0x1693('0x12b')]],[_0x1693('0x41'),_0x1693('0x137')])),_0x1693('0x13a'),JSON['stringify'](_0x581958[_0x1693('0x12e')]));},0xc7);delete _0x406d65[_0x1693('0x27')][_0x4b50d6['actionid']];unlockQueueStatus(_0x157fcb,_0x4b50d6[_0x1693('0x129')]);});}else{loggerBooked['info']('[booked][unlock]');this[_0x1693('0xb7')](this[_0x1693('0x21')][this['actions'][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]]);this[_0x1693('0xc4')]({'active':![],'ContactId':this[_0x1693('0x27')][_0x4b50d6['actionid']][_0x1693('0xd6')],'ListId':this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xd7')],'VoiceQueueId':this['actions'][_0x4b50d6['actionid']][_0x1693('0xd9')]||undefined,'CampaignId':this['actions'][_0x4b50d6['actionid']][_0x1693('0xda')]||undefined})['catch'](loggerCatch(_0x1693('0x135')));delete this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]];unlockQueueStatus(_0x157fcb);}}else{loggerBooked[_0x1693('0x83')](_0x1693('0x13b'));this[_0x1693('0xb7')](this[_0x1693('0x21')][this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xb8')]]);this[_0x1693('0xc4')]({'active':![],'ContactId':this['actions'][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xd6')],'ListId':this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]]['ListId'],'VoiceQueueId':this[_0x1693('0x27')][_0x4b50d6['actionid']][_0x1693('0xd9')]||undefined,'CampaignId':this[_0x1693('0x27')][_0x4b50d6['actionid']][_0x1693('0xda')]||undefined})['catch'](loggerCatch(_0x1693('0x13c')));delete this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]];unlockQueueStatus(_0x157fcb);}}else{loggerBooked[_0x1693('0x83')](_0x1693('0x13d'));this[_0x1693('0xb7')](this['voiceQueues'][this['actions'][_0x4b50d6['actionid']][_0x1693('0xb8')]]);this[_0x1693('0xc4')]({'active':![],'ContactId':this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xd6')],'ListId':this['actions'][_0x4b50d6['actionid']][_0x1693('0xd7')],'VoiceQueueId':this[_0x1693('0x27')][_0x4b50d6['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]][_0x1693('0xda')]||undefined})[_0x1693('0xb5')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x1693('0x27')][_0x4b50d6[_0x1693('0x129')]];unlockQueueStatus(_0x157fcb);}};Dialer['prototype'][_0x1693('0x3c')]=function(){var _0x45d332=this;setInterval(function(){_0x45d332['syncCampaigns']();},0x3e8);};Dialer[_0x1693('0x1c')][_0x1693('0x13e')]=function(_0x14866d){var _0x46c310=this;return function(){if(!_0x46c310[_0x1693('0xdf')](_0x14866d[_0x1693('0x7a')])){if(!_0x46c310[_0x1693('0xdf')](_0x14866d[_0x1693('0x13f')])){_0x14866d[_0x1693('0x3f')]=_0x1693('0x140');throw _0x14866d[_0x1693('0x41')]+_0x1693('0x141');}}};};Dialer[_0x1693('0x1c')][_0x1693('0x142')]=function(_0x3fac89,_0x499c59,_0x526a70,_0x5a1aa7){var _0x525b74=this;return function(){var _0x1be2e7=!![];return _0x525b74[_0x1693('0x143')](_0x3fac89,_0x499c59,_0x526a70,_0x5a1aa7,_0x1be2e7);};};Dialer[_0x1693('0x1c')][_0x1693('0x144')]=function(_0x50ec01,_0x5757f2,_0x451c6c,_0x563572){var _0x268ebb=this;return function(){var _0xa8a0d0=![];return _0x268ebb[_0x1693('0x143')](_0x50ec01[_0x1693('0x46')],_0x5757f2,_0x451c6c,_0x563572,_0xa8a0d0);};};Dialer[_0x1693('0x1c')]['ifTime']=function(_0x5f32cb,_0x2587fb,_0x5265e0,_0x349fa9,_0x5eb29c){var _0x2b9da6=[];return new BPromise(function(_0x303fac,_0x360537){if(!isNotNull(_0x5f32cb)){_0x349fa9['message']=_0x1693('0x47');return _0x360537(msgResponse(_0x1693('0x143'),_0x1693('0x145'),_0x5265e0+_0x1693('0x146')));}if(_[_0x1693('0x48')](_0x5f32cb)){_0x349fa9[_0x1693('0x3f')]='INTERVAL_IS_EMPTY';return _0x360537(msgResponse('ifTime',_0x1693('0x145'),_0x5265e0+'\x20Intervals\x20is\x20empty\x20'));}if(_0x2587fb&&_[_0x1693('0x3e')](config['timezones'][_0x2587fb])){_0x349fa9[_0x1693('0x3f')]=_0x1693('0x147');return _0x360537(msgResponse(_0x1693('0x143'),_0x1693('0x145'),_0x5265e0+_0x1693('0x148')+_0x2587fb));}if(_['isArray'](_0x5f32cb)){for(var _0x135fdc=0x0;_0x135fdc<_0x5f32cb[_0x1693('0x9d')];_0x135fdc+=0x1){_0x2b9da6[_0x1693('0x12d')](ami[_0x1693('0x149')]({'action':_0x1693('0x14a'),'command':util['format']('iftime\x20%s,%s',_0x5f32cb[_0x135fdc][_0x1693('0x14b')],!_[_0x1693('0x3e')](config[_0x1693('0x14c')][_0x2587fb])?_0x2587fb:'')})['then'](function(_0x38f352){return _0x38f352['content'][_0x1693('0x14d')]('true')>=0x0;})[_0x1693('0xb5')](myreject(_0x360537)));}}else{_0x2b9da6[_0x1693('0x12d')](ami[_0x1693('0x149')]({'action':_0x1693('0x14a'),'command':util['format'](_0x1693('0x14e'),_0x5f32cb,!_[_0x1693('0x3e')](config[_0x1693('0x14c')][_0x2587fb])?_0x2587fb:'')})['then'](function(_0x4e67b5){return _0x4e67b5[_0x1693('0x14f')][_0x1693('0x14d')](_0x1693('0x150'))>=0x0;})[_0x1693('0xb5')](myreject(_0x360537)));}BPromise[_0x1693('0x151')](_0x2b9da6)[_0x1693('0xbc')](function(_0x248b79){var _0x4f4ef9=_[_0x1693('0x152')](_0x248b79);if(_0x4f4ef9){return _0x303fac(_0x4f4ef9);}else{_0x349fa9[_0x1693('0x3f')]=_0x5eb29c?_0x1693('0x153'):_0x1693('0x154');return _0x360537(msgResponse(_0x1693('0x155'),_0x1693('0x145'),'Global:\x20'+_0x5eb29c+'\x20'+_0x5265e0+_0x1693('0x156')+util[_0x1693('0x9b')](_0x5f32cb,{'showHidden':![],'depth':null})+_0x1693('0x157')+_0x2587fb));}})['catch'](function(_0xbeb642){return _0x360537(msgResponse(_0x1693('0x143'),_0x1693('0x145'),JSON['stringify'](_0xbeb642)));});});};Dialer['prototype'][_0x1693('0x158')]=function(_0x1b10cf){var _0x54f1ef=this;return function(){switch(_0x1b10cf['dialMethod']){case _0x1693('0x159'):freeVariablesPredictive(_0x1b10cf);_0x54f1ef[_0x1693('0x15a')](_0x1b10cf,0x1);break;case _0x1693('0x15b'):freeVariablesPredictive(_0x1b10cf);_0x54f1ef[_0x1693('0x15a')](_0x1b10cf,_0x1b10cf[_0x1693('0x15c')]);break;case'predictive':_0x54f1ef[_0x1693('0x9')](_0x1b10cf);break;case _0x1693('0x8'):freeVariablesPredictive(_0x1b10cf);_0x54f1ef[_0x1693('0x15a')](_0x1b10cf,0x1);break;default:freeVariablesPredictive(_0x1b10cf);logger[_0x1693('0x9a')](_0x1693('0x15d'),_0x1b10cf[_0x1693('0x41')],_0x1693('0x15e'));}};};Dialer['prototype'][_0x1693('0x15f')]=function(_0x155428){var _0x501572=this;return function(){_0x501572[_0x1693('0x160')](_0x155428);};};Dialer[_0x1693('0x1c')]['syncQueueSummary']=function(_0x1dc524){var _0x43e0ab=this;if(isNotPreview(_0x1dc524[_0x1693('0x5c')])){if(isVoiceQueueOutbound(_0x1dc524['type'])&&isActive(_0x1dc524['dialActive'])){_0x1dc524['sendMessageOneNotActive']=!![];BPromise[_0x1693('0xbe')]()[_0x1693('0xbc')](checkIsLoggedIn(_0x1dc524,_0x1dc524['loggedIn']))[_0x1693('0xbc')](checkIsActive(_0x1dc524,_0x1dc524[_0x1693('0x161')]))['then'](checkInterval(_0x1dc524))['then'](_0x43e0ab['checkIsTrunkReachable'](_0x1dc524))[_0x1693('0xbc')](_0x43e0ab['checkIfTime'](_0x1dc524[_0x1693('0x162')],_0x1dc524[_0x1693('0x163')],_0x1dc524[_0x1693('0x41')],_0x1dc524))[_0x1693('0xbc')](_0x43e0ab[_0x1693('0x144')](_0x1dc524[_0x1693('0x44')],_0x1dc524[_0x1693('0x163')],_0x1dc524['name'],_0x1dc524))[_0x1693('0xbc')](_0x43e0ab['checkDialMethod'](_0x1dc524))[_0x1693('0xb5')](loggerCatchQueueSummary(_0x1693('0x164'),_0x1dc524));}else{notSendMessagesQueue(_0x1dc524);}}else{freeVariablesPredictive(_0x1dc524);}};Dialer[_0x1693('0x1c')]['syncCampaigns']=function(){var _0x21defb=this;var _0x183f5a;for(var _0x534085 in this['campaigns']){if(typeof this[_0x1693('0x22')][_0x534085]!==_0x1693('0x9e')){_0x183f5a=this[_0x1693('0x22')][_0x534085];if(isCampaignIvr(_0x183f5a[_0x1693('0x50')])&&isActive(_0x183f5a[_0x1693('0x7b')])){_0x183f5a[_0x1693('0xa4')]=!![];BPromise[_0x1693('0xbe')]()[_0x1693('0xbc')](checkIsActive(_0x183f5a,_0x183f5a[_0x1693('0x7b')]))[_0x1693('0xbc')](checkInterval(_0x183f5a))[_0x1693('0xbc')](_0x21defb[_0x1693('0x13e')](_0x183f5a))['then'](_0x21defb['checkIfTime'](_0x183f5a['dialGlobalInterval'],_0x183f5a[_0x1693('0x163')],_0x183f5a[_0x1693('0x41')],_0x183f5a))[_0x1693('0xbc')](_0x21defb[_0x1693('0x144')](_0x183f5a['Interval'],_0x183f5a[_0x1693('0x163')],_0x183f5a['name'],_0x183f5a))['then'](_0x21defb[_0x1693('0x15f')](_0x183f5a))[_0x1693('0xb5')](loggerCatchQueueSummary(_0x1693('0x165'),_0x183f5a));}else{notSendMessagesCampaign(_0x183f5a);}}}};function getCallerIdRandom(_0x3540f8,_0x9d3a09){var _0x4322af;var _0x4760b9;var _0x2ab449;if(_0x9d3a09<=0x0){_0x9d3a09=0x1;}_0x4322af=new RegExp('\x5cw{0,'+_0x9d3a09+'}$');_0x4760b9=Math['pow'](0xa,_0x9d3a09-0x1);_0x2ab449=Math[_0x1693('0x166')](0xa,_0x9d3a09)-0x1;return util[_0x1693('0x7d')]('%s',_[_0x1693('0x167')](_0x3540f8,_0x4322af,_['random'](_0x4760b9,_0x2ab449)));}function extractCalleridName(_0x4fc0a0){var _0x2f1ba7=_0x4fc0a0[_0x1693('0x168')](/"(.*?)"/);return _0x2f1ba7?_0x2f1ba7[0x1]:_0x4fc0a0;}function extractCalleridNumber(_0x15f772){var _0x42709f=_0x15f772['match'](/<(.*?)>/);return _0x42709f?_0x42709f[0x1]:_0x15f772;}Dialer[_0x1693('0x1c')][_0x1693('0x169')]=function(_0x30225b,_0x5edfbf){var _0x474892=this;var _0x1f835d=uuid['v4']();this[_0x1693('0x27')][_0x1f835d]=new Action(_0x30225b,_0x5edfbf,_0x1f835d);return new BPromise(function(_0x1c49da,_0x4f242d){if(_['isUndefined'](_0x30225b)&&typeof _0x30225b!==_0x1693('0x16a')){return _0x4f242d(msgResponse(_0x1693('0x16b'),_0x1693('0x145'),_0x1693('0x16c')));}if(_['isUndefined'](_0x5edfbf[_0x1693('0x16d')][_0x1693('0x16e')])||_0x5edfbf[_0x1693('0x16d')]['phone']===null){return _0x4f242d(msgResponse(_0x1693('0x16b'),'Failure','contact\x20is\x20undefine'));}var _0x4a894c={'XMD-CALLERID':_0x474892[_0x1693('0x27')][_0x1f835d][_0x1693('0x16f')](),'XMD-AGI':_0x30225b['dialQueueProject']?util[_0x1693('0x7d')](_0x1693('0x170'),ipAgi,_0x30225b[_0x1693('0x10e')]):_0x1693('0x171'),'XMD-AGIAFTER':_0x30225b['dialQueueProject2']?util[_0x1693('0x7d')](_0x1693('0x170'),ipAgi,_0x30225b[_0x1693('0x114')]):'NONE','XMD-QUEUE':_0x30225b['type']===_0x1693('0x51')?util[_0x1693('0x7d')](_0x1693('0x172'),_0x30225b[_0x1693('0x41')],_0x30225b[_0x1693('0x173')]||'',_0x30225b[_0x1693('0x115')]?'c':'',_0x30225b['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x5edfbf[_0x1693('0xd6')],'XMD-CDRTYPE':_0x1693('0x7'),'CALLERID(all)':_0x474892[_0x1693('0x27')][_0x1f835d][_0x1693('0x16f')](),'XMD-AMD':_0x30225b[_0x1693('0xe8')]?_0x1693('0x174'):_0x1693('0x171'),'XMD-DESTINATION':_0x1693('0xe7')};if(_0x30225b[_0x1693('0xe8')]){_0x4a894c[_0x1693('0x175')]=_0x30225b[_0x1693('0x176')]||0x9c4;_0x4a894c[_0x1693('0x177')]=_0x30225b[_0x1693('0x178')]||0x5dc;_0x4a894c[_0x1693('0x179')]=_0x30225b[_0x1693('0x17a')]||0x320;_0x4a894c[_0x1693('0x17b')]=_0x30225b[_0x1693('0x17c')]||0x1388;_0x4a894c[_0x1693('0x17d')]=_0x30225b[_0x1693('0x17e')]||0x64;_0x4a894c[_0x1693('0x17f')]=_0x30225b[_0x1693('0x180')]||0x32;_0x4a894c[_0x1693('0x181')]=_0x30225b[_0x1693('0x182')]||0x3;_0x4a894c[_0x1693('0x183')]=_0x30225b[_0x1693('0x184')]||0x100;_0x4a894c['XMD-AMDMAXIMUMWORDLENGTH']=_0x30225b['dialAMDMaximumWordLength']||0x1388;}if(_0x30225b['type']===_0x1693('0x51')){_0x4a894c[_0x1693('0x185')]=_0x5edfbf[_0x1693('0xd9')];}else{_0x4a894c['XMD-CAMPAIGNID']=_0x5edfbf['CampaignId'];}for(var _0x14c789 in _0x5edfbf[_0x1693('0x16d')]){if(typeof _0x5edfbf[_0x1693('0x16d')][_0x14c789]!=='undefined'){if(isNotNull(_0x5edfbf[_0x1693('0x16d')][_0x14c789])&&_0x14c789!=='id'&&_0x14c789!==_0x1693('0x186')&&_0x14c789!==_0x1693('0x187')&&_0x14c789!==_0x1693('0x188')){_0x4a894c[util[_0x1693('0x7d')]('%s%s','XMD-',_[_0x1693('0x189')](_0x14c789))]=_0x5edfbf[_0x1693('0x16d')][_0x14c789];}}}var _0x4d28c7=_0x474892['isTrunkReachable'](_0x30225b[_0x1693('0x7a')])?getCallerId(_0x30225b[_0x1693('0x7a')][_0x1693('0x7c')],_0x30225b['dialOriginateCallerIdName'],_0x30225b[_0x1693('0x18a')]>0x0?getCallerIdRandom(_0x30225b[_0x1693('0x5e')],_0x30225b[_0x1693('0x18a')]):_0x30225b[_0x1693('0x5e')]):getCallerId(_[_0x1693('0xb3')](_0x30225b[_0x1693('0x13f')])?_0x30225b[_0x1693('0x7a')]['callerid']:_0x30225b['TrunkBackup'][_0x1693('0x7c')],_0x30225b[_0x1693('0x5d')],_0x30225b['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x30225b[_0x1693('0x5e')],_0x30225b['dialRandomLastDigitCallerIdNumber']):_0x30225b[_0x1693('0x5e')]);if(_0x4d28c7){_0x4a894c[_0x1693('0x18b')]=_0x474892[_0x1693('0x27')][_0x1f835d][_0x1693('0x18c')]=extractCalleridName(_0x4d28c7);_0x4a894c[_0x1693('0x18d')]=_0x474892[_0x1693('0x27')][_0x1f835d][_0x1693('0x18e')]=extractCalleridNumber(_0x4d28c7);}return ami[_0x1693('0x149')]({'actionid':_0x1f835d,'action':'originate','channel':_0x474892[_0x1693('0xdf')](_0x30225b[_0x1693('0x7a')])?util[_0x1693('0x7d')](_0x1693('0x18f'),_0x30225b[_0x1693('0x7a')][_0x1693('0x41')],isNotNull(_0x30225b[_0x1693('0x60')])?_0x30225b[_0x1693('0x60')][_0x1693('0x190')]()||'':'',_0x30225b[_0x1693('0x191')]>0x0?_0x5edfbf['Contact'][_0x1693('0x16e')][_0x1693('0x192')](_0x30225b[_0x1693('0x191')]):_0x5edfbf['Contact']['phone']):util[_0x1693('0x7d')](_0x1693('0x18f'),_[_0x1693('0xb3')](_0x30225b['TrunkBackup'])?_0x30225b[_0x1693('0x7a')][_0x1693('0x41')]:_0x30225b[_0x1693('0x13f')]['name'],isNotNull(_0x30225b['dialPrefix'])?_0x30225b['dialPrefix'][_0x1693('0x190')]()||'':'',_0x30225b[_0x1693('0x191')]>0x0?_0x5edfbf['Contact']['phone'][_0x1693('0x192')](_0x30225b[_0x1693('0x191')]):_0x5edfbf[_0x1693('0x16d')][_0x1693('0x16e')]),'callerid':_0x4d28c7,'Exten':'xcally-motion-dialer','Context':_0x1693('0x193'),'Priority':'1','variable':_0x4a894c,'timeout':(_0x30225b[_0x1693('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1f835d})['then'](function(_0x1cecb3){return _0x1c49da(_0x1cecb3);})[_0x1693('0xb5')](function(_0x71ac66){_0x30225b[_0x1693('0x69')]+=0x1;var _0x59b1dc=new History(_0x474892[_0x1693('0x27')][_0x1f835d]);logger[_0x1693('0x9a')](util[_0x1693('0x7d')](_0x1693('0x194'),JSON[_0x1693('0x4b')](_0x71ac66)));_0x59b1dc[_0x1693('0xac')]=0xe;_0x59b1dc[_0x1693('0x105')]=_0x1693('0x195');_0x59b1dc[_0x1693('0xae')]=moment()[_0x1693('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');_0x59b1dc[_0x1693('0xad')]=_0x59b1dc[_0x1693('0xae')];_0x474892[_0x1693('0xd0')](_0x59b1dc)[_0x1693('0xb5')](loggerCatch(_0x1693('0x196')));_0x474892[_0x1693('0xcf')](_0x59b1dc)[_0x1693('0xb5')](loggerCatch(_0x1693('0x196')))[_0x1693('0x1f')](function(){delete _0x474892[_0x1693('0x27')][_0x1f835d];return _0x4f242d(msgResponse('originate',_0x1693('0x4a'),_0x1693('0x197')));});});});};Dialer['prototype'][_0x1693('0x33')]=function(_0x463977){var _0x249da9=this[_0x1693('0x27')][_0x463977[_0x1693('0x129')]];if(_0x249da9){delete this[_0x1693('0x27')][_0x463977['actionid']];_0x249da9[_0x1693('0x11a')]=moment()[_0x1693('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2f8b41=_0x249da9['type']==='ivr'?this[_0x1693('0x22')][_0x249da9['queue']]:this[_0x1693('0x21')][_0x249da9['getQueue']()];if(!this['isSuccess'](_0x463977[_0x1693('0x198')])){this[_0x1693('0xb7')](_0x2f8b41);return this['callProgressDetecting'](_0x249da9,_0x2f8b41,_0x463977)[_0x1693('0xb5')](loggerCatch(_0x1693('0x199')));}this[_0x1693('0x29')][_0x463977['uniqueid']]=_0x249da9;}};Dialer[_0x1693('0x1c')][_0x1693('0x19a')]=function(_0x4c0fdc,_0x2f79af,_0x55570b){var _0x23eba5=new History(_0x2f79af);if(_0x23eba5[_0x1693('0xf8')]+_0x23eba5[_0x1693('0xf9')]+_0x23eba5['countnoanswerretry']+_0x23eba5[_0x1693('0x19b')]+_0x23eba5[_0x1693('0xfb')]+_0x23eba5['countabandonedretry']+_0x23eba5[_0x1693('0xf4')]+_0x23eba5[_0x1693('0xfc')]>=_0x55570b[_0x1693('0xfd')]-0x1){return!![];}switch(_0x4c0fdc){case 0x3:if(_0x23eba5[_0x1693('0xfa')]>=_0x55570b[_0x1693('0x19c')]-0x1){return!![];}this[_0x1693('0xc4')]({'active':![],'countnoanswerretry':_0x23eba5[_0x1693('0xfa')]+=0x1,'scheduledat':moment()[_0x1693('0x101')](_0x55570b['dialNoAnswerRetryFrequency'],_0x1693('0x103'))['format'](_0x1693('0x10b')),'ContactId':_0x23eba5[_0x1693('0xd6')],'ListId':_0x23eba5['ListId'],'VoiceQueueId':_0x23eba5[_0x1693('0xd9')]||undefined,'CampaignId':_0x23eba5['CampaignId']||undefined})[_0x1693('0xb5')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x23eba5['countbusyretry']>=_0x55570b[_0x1693('0x19d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x23eba5['countbusyretry']+=0x1,'scheduledat':moment()[_0x1693('0x101')](_0x55570b[_0x1693('0x19e')],'minutes')[_0x1693('0x7d')](_0x1693('0x10b')),'ContactId':_0x23eba5['ContactId'],'ListId':_0x23eba5[_0x1693('0xd7')],'VoiceQueueId':_0x23eba5['VoiceQueueId']||undefined,'CampaignId':_0x23eba5['CampaignId']||undefined})[_0x1693('0xb5')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x23eba5[_0x1693('0xf9')]>=_0x55570b['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x23eba5['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x55570b[_0x1693('0x19f')],_0x1693('0x103'))[_0x1693('0x7d')](_0x1693('0x10b')),'ContactId':_0x23eba5[_0x1693('0xd6')],'ListId':_0x23eba5['ListId'],'VoiceQueueId':_0x23eba5[_0x1693('0xd9')]||undefined,'CampaignId':_0x23eba5[_0x1693('0xda')]||undefined})[_0x1693('0xb5')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x23eba5[_0x1693('0x19b')]>=_0x55570b[_0x1693('0x1a0')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x23eba5[_0x1693('0x19b')]+=0x1,'scheduledat':moment()[_0x1693('0x101')](_0x55570b['dialNoSuchNumberRetryFrequency'],'minutes')[_0x1693('0x7d')](_0x1693('0x10b')),'ContactId':_0x23eba5[_0x1693('0xd6')],'ListId':_0x23eba5[_0x1693('0xd7')],'VoiceQueueId':_0x23eba5[_0x1693('0xd9')]||undefined,'CampaignId':_0x23eba5[_0x1693('0xda')]||undefined})['catch'](loggerCatch(_0x1693('0x1a1')));}break;case 0xa:if(_0x23eba5[_0x1693('0xfb')]>=_0x55570b[_0x1693('0x1a2')]-0x1){return!![];}this[_0x1693('0xc4')]({'active':![],'countdropretry':_0x23eba5['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x55570b[_0x1693('0x11d')],_0x1693('0x103'))['format'](_0x1693('0x10b')),'ContactId':_0x23eba5[_0x1693('0xd6')],'ListId':_0x23eba5[_0x1693('0xd7')],'VoiceQueueId':_0x23eba5['VoiceQueueId']||undefined,'CampaignId':_0x23eba5['CampaignId']||undefined})[_0x1693('0xb5')](loggerCatch(_0x1693('0x1a3')));break;case 0xb:if(_0x23eba5[_0x1693('0x122')]>=_0x55570b[_0x1693('0x123')]-0x1){return!![];}this[_0x1693('0xc4')]({'active':![],'countabandonedretry':_0x23eba5['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x55570b[_0x1693('0x125')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x23eba5[_0x1693('0xd6')],'ListId':_0x23eba5[_0x1693('0xd7')],'VoiceQueueId':_0x23eba5['VoiceQueueId']||undefined,'CampaignId':_0x23eba5['CampaignId']||undefined})['catch'](loggerCatch(_0x1693('0x1a4')));break;case 0x13:if(_0x23eba5['countmachineretry']>=_0x55570b[_0x1693('0xff')]-0x1){return!![];}this[_0x1693('0xc4')]({'active':![],'countmachineretry':_0x23eba5[_0x1693('0xf4')]+=0x1,'scheduledat':moment()[_0x1693('0x101')](_0x55570b[_0x1693('0x102')],_0x1693('0x103'))[_0x1693('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x23eba5['ContactId'],'ListId':_0x23eba5['ListId'],'VoiceQueueId':_0x23eba5['VoiceQueueId']||undefined,'CampaignId':_0x23eba5['CampaignId']||undefined})[_0x1693('0xb5')](loggerCatch(_0x1693('0x104')));break;case 0x14:if(_0x23eba5[_0x1693('0xfc')]>=_0x55570b[_0x1693('0x1a5')]-0x1){return!![];}this[_0x1693('0xc4')]({'active':![],'countagentrejectretry':_0x23eba5['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x1693('0x101')](_0x55570b[_0x1693('0x1a6')],_0x1693('0x103'))[_0x1693('0x7d')](_0x1693('0x10b')),'ContactId':_0x23eba5['ContactId'],'ListId':_0x23eba5['ListId'],'VoiceQueueId':_0x23eba5[_0x1693('0xd9')]||undefined,'CampaignId':_0x23eba5[_0x1693('0xda')]||undefined})[_0x1693('0xb5')](loggerCatch(_0x1693('0x1a7')));break;default:return!![];}};Dialer[_0x1693('0x1c')][_0x1693('0x1a8')]=function(_0x1cbc37,_0x3937a3,_0x40335e){var _0x31cae1=this;var _0x261443=new History(_0x1cbc37);return new BPromise(function(_0x4322f0,_0x2c71e7){if(_[_0x1693('0x3e')](_0x3937a3)&&typeof _0x3937a3!=='object'){return _0x2c71e7(msgResponse(_0x1693('0x1a9'),'Failure',_0x1693('0x1aa')));}if(_[_0x1693('0x3e')](_0x40335e)&&typeof _0x40335e!==_0x1693('0x16a')){return _0x2c71e7(msgResponse(_0x1693('0x1a9'),_0x1693('0x145'),_0x1693('0x1ab')));}switch(_0x40335e[_0x1693('0x1ac')]){case'0':_0x3937a3[_0x1693('0x68')]+=0x1;_0x261443[_0x1693('0xac')]=0x0;_0x261443[_0x1693('0x105')]=_0x1693('0x1ad');_0x261443[_0x1693('0x19b')]+=0x1;_0x261443[_0x1693('0xf5')]+=0x1;ami[_0x1693('0x4f')](_0x1693('0x1ae'),ut['buildObj'](_0x1cbc37,_0x1693('0x1af')));_0x31cae1[_0x1693('0xd0')](_0x261443)['catch'](loggerCatch(_0x1693('0x108')));if(_0x31cae1[_0x1693('0x19a')](0x0,_0x1cbc37,_0x3937a3)){if(_0x261443[_0x1693('0x19b')]>=_0x3937a3[_0x1693('0x1a0')]){_0x31cae1['createStateFinal'](_0x261443,_0x4322f0,_0x2c71e7,_0x1693('0x1b0'));}else{_0x31cae1[_0x1693('0xfe')](_0x261443,_0x4322f0,_0x2c71e7,_0x1693('0x1b0'));}}break;case'3':_0x3937a3[_0x1693('0x67')]+=0x1;_0x261443[_0x1693('0xac')]=0x3;_0x261443[_0x1693('0x105')]='NoAnswer';_0x261443['countnoanswerretry']+=0x1;_0x261443['countglobal']+=0x1;ami[_0x1693('0x4f')](_0x1693('0x1b1'),ut[_0x1693('0xee')](_0x1cbc37,_0x1693('0x1b2')));_0x31cae1[_0x1693('0xd0')](_0x261443)[_0x1693('0xb5')](loggerCatch(_0x1693('0x1b3')));if(_0x31cae1[_0x1693('0x19a')](0x3,_0x1cbc37,_0x3937a3)){if(_0x261443['countnoanswerretry']>=_0x3937a3[_0x1693('0x19c')]){_0x31cae1[_0x1693('0x10a')](_0x261443,_0x4322f0,_0x2c71e7,'reason\x203\x20ringing\x20no\x20answer');}else{_0x31cae1[_0x1693('0xfe')](_0x261443,_0x4322f0,_0x2c71e7,_0x1693('0x1b4'));}}break;case'5':_0x3937a3[_0x1693('0x63')]+=0x1;_0x261443[_0x1693('0xac')]=0x5;_0x261443[_0x1693('0x105')]=_0x1693('0x1b5');_0x261443[_0x1693('0xf8')]+=0x1;_0x261443[_0x1693('0xf5')]+=0x1;ami['emit'](_0x1693('0x1b6'),ut[_0x1693('0xee')](_0x1cbc37,'busy'));_0x31cae1[_0x1693('0xd0')](_0x261443)[_0x1693('0xb5')](loggerCatch(_0x1693('0x1b7')));if(_0x31cae1['checkRetriveMax'](0x5,_0x1cbc37,_0x3937a3)){if(_0x261443['countbusyretry']>=_0x3937a3[_0x1693('0x19d')]){_0x31cae1['createStateFinal'](_0x261443,_0x4322f0,_0x2c71e7,'reason\x205\x20busy');}else{_0x31cae1[_0x1693('0xfe')](_0x261443,_0x4322f0,_0x2c71e7,'reason\x205\x20busy');}}break;case'8':_0x3937a3[_0x1693('0x64')]+=0x1;_0x261443[_0x1693('0xac')]=0x8;_0x261443['statedesc']='Congestion';_0x261443[_0x1693('0xf9')]+=0x1;_0x261443[_0x1693('0xf5')]+=0x1;ami[_0x1693('0x4f')](_0x1693('0x1b8'),ut[_0x1693('0xee')](_0x1cbc37,_0x1693('0x1b9')));_0x31cae1[_0x1693('0xd0')](_0x261443)[_0x1693('0xb5')](loggerCatch(_0x1693('0x1ba')));if(_0x31cae1[_0x1693('0x19a')](0x8,_0x1cbc37,_0x3937a3)){if(_0x261443[_0x1693('0xf9')]>=_0x3937a3[_0x1693('0x1bb')]){_0x31cae1[_0x1693('0x10a')](_0x261443,_0x4322f0,_0x2c71e7,_0x1693('0x1bc'));}else{_0x31cae1['stateGlobal'](_0x261443,_0x4322f0,_0x2c71e7,'reason\x208\x20congestion');}}break;case'11':_0x3937a3[_0x1693('0x1bd')]+=0x1;_0x261443['state']=0xb;_0x261443[_0x1693('0x105')]=_0x1693('0x121');_0x261443[_0x1693('0x122')]+=0x1;_0x261443['countglobal']+=0x1;_0x31cae1[_0x1693('0xd0')](_0x261443)[_0x1693('0xb5')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x31cae1[_0x1693('0x19a')](0xb,_0x1cbc37,_0x3937a3)){if(_0x261443[_0x1693('0x122')]>=_0x3937a3['dialAbandonedMaxRetry']){_0x31cae1[_0x1693('0x10a')](_0x261443,_0x4322f0,_0x2c71e7,_0x1693('0x1be'));}else{_0x31cae1[_0x1693('0xfe')](_0x261443,_0x4322f0,_0x2c71e7,'reason\x2011\x20abandoned');}}break;case'20':_0x3937a3[_0x1693('0x1bf')]+=0x1;_0x261443[_0x1693('0xac')]=0x14;_0x261443[_0x1693('0x105')]=_0x1693('0x1c0');_0x261443[_0x1693('0xfc')]+=0x1;_0x261443[_0x1693('0xf5')]+=0x1;ami['emit']('custom:agentreject',ut[_0x1693('0xee')](_0x1cbc37,_0x1693('0x1c1')));_0x31cae1[_0x1693('0xd0')](_0x261443)[_0x1693('0xb5')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x31cae1[_0x1693('0x19a')](0x14,_0x1cbc37,_0x3937a3)){if(_0x261443['countagentrejectretry']>=_0x3937a3[_0x1693('0x1a5')]){_0x31cae1[_0x1693('0x10a')](_0x261443,_0x4322f0,_0x2c71e7,_0x1693('0x1c2'));}else{_0x31cae1[_0x1693('0xfe')](_0x261443,_0x4322f0,_0x2c71e7,_0x1693('0x1c2'));}}break;default:_0x3937a3[_0x1693('0x110')]+=0x1;_0x261443[_0x1693('0xac')]=0xc;_0x261443[_0x1693('0x105')]=_0x40335e[_0x1693('0x1ac')];_0x31cae1['createHistory'](_0x261443)['catch'](loggerCatch(_0x1693('0x1c3')));if(_0x31cae1[_0x1693('0x19a')](_0x40335e[_0x1693('0x1ac')],_0x1cbc37,_0x3937a3)){if(_0x261443[_0x1693('0xf8')]+_0x261443[_0x1693('0xf9')]+_0x261443['countnoanswerretry']+_0x261443[_0x1693('0x19b')]+_0x261443[_0x1693('0xfb')]+_0x261443[_0x1693('0x122')]+_0x261443[_0x1693('0xf4')]+_0x261443[_0x1693('0xfc')]>=_0x3937a3[_0x1693('0xfd')]){_0x31cae1[_0x1693('0xfe')](_0x261443,_0x4322f0,_0x2c71e7,_0x40335e[_0x1693('0x1ac')]);}else{_0x31cae1[_0x1693('0x10a')](_0x261443,_0x4322f0,_0x2c71e7,_0x40335e[_0x1693('0x1ac')]);}}}});};Dialer['prototype'][_0x1693('0xfe')]=function(_0x437e8c,_0x13b2c1,_0x164c32,_0x54e136){var _0x27a4e2=new Final(_0x437e8c);_0x27a4e2['state']=0xf;_0x27a4e2['statedesc']=_0x1693('0x1c4');this['createStateFinal'](_0x27a4e2,_0x13b2c1,_0x164c32,_0x54e136);};Dialer[_0x1693('0x1c')][_0x1693('0x10a')]=function(_0x344fc5,_0x54c8ba,_0x4f2d33,_0x3b645a){this[_0x1693('0xcf')](_0x344fc5)[_0x1693('0xbc')](function(){return _0x54c8ba(msgResponse(_0x1693('0x1a9'),_0x1693('0xde'),_0x3b645a));})[_0x1693('0xb5')](function(){return _0x4f2d33(msgResponse('[moveContactManagedDialer][0]',_0x1693('0x145'),_0x1693('0x1c5')));});};Dialer['prototype'][_0x1693('0x9')]=function(_0x2f1ff7){var _0x33c2e2=_0x2f1ff7[_0x1693('0x1c6')]/0x64;var _0x881990=_0x2f1ff7[_0x1693('0x1c7')]/(_0x2f1ff7[_0x1693('0x1c7')]+_0x2f1ff7[_0x1693('0x61')]);var _0x207a74=Math[_0x1693('0x1c8')](_0x2f1ff7[_0x1693('0x73')]*(_0x2f1ff7[_0x1693('0x1c9')]/0x64));var _0x3b3a28=Math[_0x1693('0x1c8')](_0x2f1ff7[_0x1693('0x73')]*(_0x2f1ff7[_0x1693('0x1ca')]/0x64));var _0x1447c7=_0x2f1ff7['available']+_0x2f1ff7[_0x1693('0x57')];var _0x28dfa2=Math[_0x1693('0x1cb')](_0x2f1ff7['erlangCalls']*_0x2f1ff7['erlangAbandonmentRate']*_0x2f1ff7[_0x1693('0x71')]*_0x2f1ff7['predictiveIntervalMultiplicativeFactor']);if(_[_0x1693('0x3e')](_0x2f1ff7[_0x1693('0x2c')])){if(!_[_0x1693('0x3e')](_0x2f1ff7[_0x1693('0x2b')])){_0x2f1ff7['startPredictive']=undefined;loggerPredictive[_0x1693('0x9a')](_0x1693('0x1cc'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x1693('0x3e')](_0x2f1ff7[_0x1693('0x94')])){loggerPredictive[_0x1693('0x9a')](_0x1693('0x1cc'),_0x1693('0x1cd'));clearInterval(_0x2f1ff7[_0x1693('0x94')]);_0x2f1ff7[_0x1693('0x94')]=undefined;}_0x2f1ff7[_0x1693('0x2c')]=moment()[_0x1693('0x7d')](_0x1693('0x10b'));loggerPredictive[_0x1693('0x83')](_0x2f1ff7[_0x1693('0x41')],_0x1693('0x1ce'),_0x2f1ff7[_0x1693('0x2c')]);this[_0x1693('0x15a')](_0x2f1ff7,0x1);}else if(ifInterval(_0x2f1ff7['dialPredictiveInterval'],_0x2f1ff7[_0x1693('0x2c')])){this[_0x1693('0x15a')](_0x2f1ff7,0x1);loggerPredictiveCalls[_0x1693('0x83')]('[startMethodPredictive][StartProgressive][Loop]',_0x2f1ff7['startProgressive'],_0x2f1ff7[_0x1693('0x41')]);_0x2f1ff7[_0x1693('0x76')]=0x0;_0x2f1ff7[_0x1693('0x70')]=0x0;}else if(_0x33c2e2<_0x881990&&_0x2f1ff7['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x2f1ff7);loggerPredictive[_0x1693('0x83')](_0x1693('0x1cf'),_0x1693('0x1d0'),_0x881990,_0x1693('0x2c'),_0x2f1ff7['name']);}else if(_0x28dfa2<_0x2f1ff7[_0x1693('0x70')]&&_0x2f1ff7['dialPredictiveOptimization']===_0x1693('0x1d1')){freeVariablesPredictive(_0x2f1ff7);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x1693('0x1d2'),_0x28dfa2,'Drop\x20in\x20this\x20interval',_0x2f1ff7[_0x1693('0x70')],_0x1693('0x2c'),_0x2f1ff7[_0x1693('0x41')]);}else if(!ifInterval(_0x2f1ff7[_0x1693('0x1d3')],_0x2f1ff7[_0x1693('0x2c')])&&_[_0x1693('0x3e')](_0x2f1ff7['startPredictive'])&&!_[_0x1693('0x3e')](_0x2f1ff7[_0x1693('0x2c')])){_0x2f1ff7[_0x1693('0x2b')]=moment()['format'](_0x1693('0x10b'));loggerPredictive['info'](_0x2f1ff7[_0x1693('0x41')],_0x1693('0x1d4'),_0x2f1ff7[_0x1693('0x2b')]);this[_0x1693('0x1d5')](_0x2f1ff7[_0x1693('0x1d3')])[_0x1693('0xbc')](this[_0x1693('0x1d6')](_0x2f1ff7))['then'](mergeDataErlangB(_0x2f1ff7))[_0x1693('0xbc')](this[_0x1693('0x1d7')](_0x2f1ff7))[_0x1693('0xb5')](loggerCatchPredictive(_0x1693('0x1d8'),_0x2f1ff7));}else if(!ifInterval(_0x2f1ff7[_0x1693('0x1d3')],_0x2f1ff7['startPredictive'])){_0x2f1ff7['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2f1ff7[_0x1693('0x2b')]=moment()[_0x1693('0x7d')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x2f1ff7[_0x1693('0x41')],_0x1693('0x1d9'),_0x2f1ff7[_0x1693('0x2b')]);clearInterval(_0x2f1ff7[_0x1693('0x94')]);_0x2f1ff7[_0x1693('0x94')]=undefined;this[_0x1693('0x1d5')](_0x2f1ff7[_0x1693('0x1d3')])['then'](this[_0x1693('0x1d6')](_0x2f1ff7))['then'](mergeDataErlangB(_0x2f1ff7))[_0x1693('0xbc')](this[_0x1693('0x1d7')](_0x2f1ff7))[_0x1693('0xb5')](loggerCatchPredictive(_0x1693('0x1da'),_0x2f1ff7));}else if(_0x2f1ff7['predictiveIntervalAvailable']&&_0x1447c7<_0x2f1ff7['predictiveIntervalAvailable']-_0x3b3a28){freeVariablesPredictive(_0x2f1ff7);loggerPredictive[_0x1693('0x83')](_0x2f1ff7[_0x1693('0x41')],_0x1693('0x1db'),_0x1447c7,_0x1693('0x1dc'),_0x2f1ff7[_0x1693('0x73')],'-',_0x3b3a28,'=',_0x2f1ff7[_0x1693('0x73')]-_0x3b3a28,')');}else if(_0x2f1ff7[_0x1693('0x73')]&&_0x1447c7>_0x2f1ff7[_0x1693('0x73')]+_0x207a74){freeVariablesPredictive(_0x2f1ff7);loggerPredictive[_0x1693('0x83')](_0x2f1ff7[_0x1693('0x41')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1447c7,_0x1693('0x1dd'),_0x2f1ff7['predictiveIntervalAvailable'],'+',_0x207a74,'=',_0x2f1ff7[_0x1693('0x73')]+_0x207a74,')');}};Dialer['prototype'][_0x1693('0x1d6')]=function(_0x32135a){var _0x55d0d1=this;return function(_0x31bcd0){return new BPromise(function(_0x46c0cb,_0x49cbe5){_[_0x1693('0x91')](_0x32135a,_0x31bcd0[0x0]);if(checkGetDataPredictive(_0x31bcd0[0x0])){var _0x14c52d=_0x32135a[_0x1693('0x73')]=_0x32135a[_0x1693('0x57')]+_0x32135a[_0x1693('0xa5')];var _0x16447f=_0x32135a[_0x1693('0x1d3')]*0x3c;var _0x348470=_0x31bcd0[0x0]['predictiveIntervalAvgTalktime']+_0x31bcd0[0x0][_0x1693('0x6c')];var _0x581ba6=(_0x31bcd0[0x0][_0x1693('0x6b')]+_0x31bcd0[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x31bcd0[0x0][_0x1693('0x87')])/_0x31bcd0[0x0][_0x1693('0x74')];_0x32135a['predictiveIntervalHitRate']=_0x581ba6>0x0?_0x581ba6:0x1;switch(_0x32135a['dialPredictiveOptimization']){case _0x1693('0x1d1'):var _0x245f5e=_0x32135a['dialPredictiveOptimizationPercentage']/0x64;return _0x55d0d1[_0x1693('0x1de')](_0x14c52d,_0x16447f,_0x348470,_0x581ba6,_0x245f5e)[_0x1693('0xbc')](function(_0x32c779){return _0x46c0cb(_0x32c779);});case _0x1693('0x1df'):var _0x4fd882=_0x32135a[_0x1693('0x1c6')]/0x64;return _0x55d0d1[_0x1693('0x1e0')](_0x14c52d,_0x16447f,_0x348470,_0x581ba6,_0x4fd882)[_0x1693('0xbc')](function(_0x36c8c4){return _0x46c0cb(_0x36c8c4);});default:return _0x49cbe5(msgResponse(_0x1693('0x1e1'),_0x1693('0x145'),_0x1693('0x1e2')));}}else{return _0x49cbe5(msgResponse(_0x1693('0x1e1'),_0x1693('0x145'),_0x1693('0x1e3')));}});};};Dialer[_0x1693('0x1c')][_0x1693('0x1e4')]=function(_0x235b16){var _0x52cc1f=this;return function(_0x2726b5){return new BPromise(function(_0x250115,_0x3d1948){_[_0x1693('0x91')](_0x235b16,_0x2726b5[0x0]);if(checkGetDataPredictive(_0x2726b5[0x0])){loggerPredictive[_0x1693('0x83')](JSON[_0x1693('0x4b')](_0x2726b5[0x0]));if(_0x235b16['dialPredictiveOptimization']===_0x1693('0x1d1')){return _0x52cc1f['getVoiceQueueRtPauses'](_0x235b16['id'])[_0x1693('0xbc')](function(_0x10bf20){var _0x2ddc98=_0x235b16['loggedIn']-_0x10bf20[0x0]['outboundQueuePauses'];var _0x53dcec=_0x235b16[_0x1693('0x1d3')]*0x3c;var _0x4ba09b=_0x2726b5[0x0][_0x1693('0x6d')]+_0x2726b5[0x0][_0x1693('0x6c')];var _0x26c9d4=(_0x2726b5[0x0][_0x1693('0x6b')]+_0x2726b5[0x0][_0x1693('0x6e')]+_0x2726b5[0x0][_0x1693('0x87')])/_0x2726b5[0x0]['predictiveIntervalTotalCalls'];var _0x53399f=_0x235b16[_0x1693('0x1c6')]/0x64;_0x235b16[_0x1693('0x1e5')]=_0x10bf20[0x0][_0x1693('0x1e6')]||0x0;_0x235b16[_0x1693('0x71')]=_0x26c9d4>0x0?_0x26c9d4:0x1;return _0x52cc1f[_0x1693('0x1de')](_0x2ddc98,_0x53dcec,_0x4ba09b,_0x26c9d4,_0x53399f);})[_0x1693('0xbc')](function(_0x16311d){return _0x250115(_0x16311d);})[_0x1693('0xb5')](function(_0x935876){return _0x3d1948(msgResponse('[CatchErlangB]',_0x1693('0x145'),JSON['stringify'](_0x935876)));});}if(_0x235b16['dialPredictiveOptimization']===_0x1693('0x1df')){return _0x52cc1f[_0x1693('0xcd')](_0x235b16['id'])[_0x1693('0xbc')](function(_0x2bb42e){var _0x5bd7f4=_0x235b16[_0x1693('0x1e7')]-_0x2bb42e[0x0][_0x1693('0x1e6')];var _0x3b55f4=_0x235b16['dialPredictiveInterval']*0x3c;var _0x55da65=_0x2726b5[0x0][_0x1693('0x6d')]+_0x2726b5[0x0][_0x1693('0x6c')];var _0x3f3b5e=(_0x2726b5[0x0][_0x1693('0x6b')]+_0x2726b5[0x0][_0x1693('0x6e')]+_0x2726b5[0x0][_0x1693('0x87')])/_0x2726b5[0x0][_0x1693('0x74')];var _0x12967a=_0x235b16['dialPredictiveOptimizationPercentage']/0x64;_0x235b16[_0x1693('0x1e5')]=_0x2bb42e[0x0][_0x1693('0x1e6')]||0x0;_0x235b16[_0x1693('0x71')]=_0x3f3b5e>0x0?_0x3f3b5e:0x1;return _0x52cc1f[_0x1693('0x1e0')](_0x5bd7f4,_0x3b55f4,_0x55da65,_0x3f3b5e,_0x12967a);})[_0x1693('0xbc')](function(_0x954249){return _0x250115(_0x954249);})[_0x1693('0xb5')](function(_0x81689d){return _0x3d1948(msgResponse(_0x1693('0x1e8'),_0x1693('0x145'),JSON[_0x1693('0x4b')](_0x81689d)));});}}else{return _0x3d1948(msgResponse('[getDataPredictive]',_0x1693('0x145'),'check\x20failure'));}});};};Dialer[_0x1693('0x1c')][_0x1693('0x1d7')]=function(_0x3d9c44){var _0x4f73d9=this;return function(){var _0x4546f6=0x0;var _0x480f29=Math[_0x1693('0x1cb')](_0x3d9c44[_0x1693('0x77')]*0x3e8);if(_0x480f29>0x0){_0x480f29=_0x480f29<0x64?0x64:_0x480f29;loggerPredictive[_0x1693('0x83')](_0x3d9c44[_0x1693('0x41')],_0x1693('0x1e9'),_0x480f29,'milliseconds');_0x3d9c44['handlePredictive']=setInterval(function(){_0x4f73d9[_0x1693('0x94')](_0x3d9c44);loggerPredictiveCalls['info']('[handlePredictive]',_0x4546f6+=0x1);},_0x480f29);}else{loggerPredictive[_0x1693('0x83')](_0x3d9c44[_0x1693('0x41')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x1693('0x1c')][_0x1693('0x1ea')]=function(_0x373659,_0x51687f){var _0x4d731b=this;return function(_0x4d3745){if(_[_0x1693('0x48')](_0x4d3745)){if(_[_0x1693('0xb3')](_0x51687f[_0x1693('0xd8')])||!_0x51687f[_0x1693('0x1eb')]){if(_0x373659[_0x1693('0x5c')]===_0x1693('0x8')){_0x373659['queueStatusComplete']=_[_0x1693('0x3e')](_0x373659[_0x1693('0x130')])?!![]:_0x373659[_0x1693('0x130')];var _0x21f4bf=uuid['v4']();_0x4d731b['actions'][_0x21f4bf]=new Action(_0x373659,_0x51687f,_0x21f4bf);loggerBooked[_0x1693('0x83')]('[booked][checkContactBlack]',_0x21f4bf,_0x1693('0x1ec'),JSON[_0x1693('0x4b')](_0x373659[_0x1693('0x130')]),_0x1693('0x1ed'),_0x373659[_0x1693('0x41')]);if(_0x373659[_0x1693('0x130')]){_0x373659[_0x1693('0x130')]=![];_0x4d731b[_0x1693('0x2d')][_0x4d731b['actions'][_0x21f4bf][_0x1693('0xb8')]]=[];ami[_0x1693('0x149')]({'actionid':_0x21f4bf,'action':_0x1693('0x1ee'),'queue':_0x373659[_0x1693('0x41')]})[_0x1693('0xb5')](function(){_0x4d731b[_0x1693('0xb7')](_0x373659);_0x4d731b[_0x1693('0xc4')]({'active':![],'ContactId':_0x4d731b[_0x1693('0x27')][_0x21f4bf][_0x1693('0xd6')],'ListId':_0x4d731b[_0x1693('0x27')][_0x21f4bf][_0x1693('0xd7')],'VoiceQueueId':_0x4d731b['actions'][_0x21f4bf]['VoiceQueueId']||undefined,'CampaignId':_0x4d731b[_0x1693('0x27')][_0x21f4bf][_0x1693('0xda')]||undefined})[_0x1693('0xb5')](loggerCatch(_0x1693('0x1ef')));delete _0x4d731b['actions'][_0x21f4bf];});}else{loggerBooked[_0x1693('0x83')](_0x1693('0x1f0'),JSON[_0x1693('0x4b')](_0x373659[_0x1693('0x130')]),_0x1693('0x1ed'),_0x373659['name']);_0x4d731b[_0x1693('0xb7')](_0x373659);_0x4d731b[_0x1693('0xc4')]({'active':![],'ContactId':_0x4d731b[_0x1693('0x27')][_0x21f4bf]['ContactId'],'ListId':_0x4d731b[_0x1693('0x27')][_0x21f4bf][_0x1693('0xd7')],'VoiceQueueId':_0x4d731b[_0x1693('0x27')][_0x21f4bf][_0x1693('0xd9')]||undefined,'CampaignId':_0x4d731b[_0x1693('0x27')][_0x21f4bf]['CampaignId']||undefined})[_0x1693('0xb5')](loggerCatch(_0x1693('0x1ef')));delete _0x4d731b[_0x1693('0x27')][_0x21f4bf];}}else{return _0x4d731b[_0x1693('0x169')](_0x373659,_0x51687f);}}else{if(getDiff(_0x51687f[_0x1693('0x1f1')])<_0x373659[_0x1693('0x1f2')]*0x3c){if(_0x51687f['Agent']&&!_0x51687f[_0x1693('0x1f3')][_0x1693('0x1f4')]){_0x4d731b['preview']['run'](_0x51687f['id'])[_0x1693('0x1f')](function(){_0x4d731b[_0x1693('0xb7')](_0x373659);});}else{_0x4d731b[_0x1693('0xc6')]({'active':![]},_0x51687f['id'],0x1)['finally'](function(){_0x4d731b[_0x1693('0xb7')](_0x373659);});}}else{_0x373659[_0x1693('0x6a')]+=0x1;_0x4d731b['updateOriginated'](_0x373659);if(_0x373659[_0x1693('0x1f5')]){_0x4d731b[_0x1693('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x51687f[_0x1693('0xd6')],'ListId':_0x51687f['ListId'],'VoiceQueueId':_0x51687f[_0x1693('0xd9')]||undefined,'CampaignId':_0x51687f[_0x1693('0xda')]||undefined})['catch'](loggerCatch(_0x1693('0x1f6')));_0x4d731b[_0x1693('0xd0')](createObjHistory(_0x373659,_0x51687f,_0x1693('0x1f7'),0x17,_0x1693('0x1f8')))[_0x1693('0xb5')](loggerCatch(_0x1693('0x1f9')));}else{_0x4d731b['saveInDb'](createObjHistory(_0x373659,_0x51687f,'RECALLFAILEDTIMEOUT',0x16,_0x1693('0x1fa')),_0x1693('0x1fb'),_0x1693('0x1fc'));}}}}else{_0x373659[_0x1693('0x62')]+=0x1;_0x4d731b[_0x1693('0xef')](createObjHistory(_0x373659,_0x51687f,_0x1693('0x1fd'),0xd,'Blacklist'),_0x1693('0x1fe'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x1693('0x1c')][_0x1693('0x160')]=function(_0x1d4b01){var _0x3e5fff=this;var _0x5e2c25=_0x1d4b01[_0x1693('0x1ff')]-_0x1d4b01[_0x1693('0x75')]-_0x1d4b01['temp'];emitCampaignSummary(_0x1d4b01);if(_0x5e2c25>0x0){if(_0x5e2c25>this[_0x1693('0x25')]){_0x5e2c25=this[_0x1693('0x25')];}_0x1d4b01[_0x1693('0xc9')]+=_0x5e2c25;this[_0x1693('0xcb')](_0x1d4b01['id'],_0x5e2c25,_0x1d4b01[_0x1693('0x200')],_0x1d4b01)['then'](function(_0x399996){_0x1d4b01['temp']-=_0x5e2c25;_0x1d4b01[_0x1693('0xc9')]=_0x1d4b01[_0x1693('0xc9')]>0x0?_0x1d4b01[_0x1693('0xc9')]:0x0;if(!checkContactEmpty(_0x399996)){_0x1d4b01[_0x1693('0x3f')]=_0x1693('0x201');logger[_0x1693('0x83')](_0x1693('0x202')+_0x1d4b01[_0x1693('0x41')]);}else{_0x1d4b01['originated']+=_0x399996[_0x1693('0x9d')];_0x1d4b01[_0x1693('0x3f')]=_0x1693('0x203');for(var _0x197827=0x0;_0x197827<_0x399996['length'];_0x197827+=0x1){_0x1d4b01['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x399996[_0x197827])||_[_0x1693('0xb3')](_0x399996[_0x197827][_0x1693('0x16d')])||_[_0x1693('0xb3')](_0x399996[_0x197827][_0x1693('0x16d')][_0x1693('0x16e')])){_0x3e5fff[_0x1693('0xd3')]('[actionOriginate]\x20',_0x1d4b01,_0x399996[_0x197827]);}else{_0x3e5fff[_0x1693('0xc1')](_[_0x1693('0xd5')](_0x399996[_0x197827],[_0x1693('0xda'),_0x1693('0x204')]))[_0x1693('0xbc')](_0x3e5fff[_0x1693('0x1ea')](_0x1d4b01,_0x399996[_0x197827]))['catch'](_0x3e5fff[_0x1693('0x205')](_0x1693('0x206'),_0x1d4b01));}}}})[_0x1693('0xb5')](loggerGetContactDialer('[getContactCampaign2]',_0x1d4b01,_0x5e2c25));}};Dialer[_0x1693('0x1c')][_0x1693('0x15a')]=function(_0x2a4643,_0x14ceab){var _0x177780=this;var _0x5ae826=[];var _0xabeb6f=_0x14ceab>=0x1?_0x14ceab:0x1;if(_0x2a4643[_0x1693('0x5c')]===_0x1693('0x8')){_0xabeb6f=0x1;}var _0x109534=Math[_0x1693('0x1cb')](_0x2a4643[_0x1693('0xa5')]*_0xabeb6f)-_0x2a4643[_0x1693('0x75')]-_0x2a4643[_0x1693('0xc9')];emitVoiceQueueSummary(_0x2a4643);if(_0x2a4643[_0x1693('0x207')]>0x0){var _0x179111=_0x2a4643[_0x1693('0x207')]-_0x2a4643[_0x1693('0x75')]-_0x2a4643[_0x1693('0x57')]-_0x2a4643[_0x1693('0xc9')]-_0x2a4643[_0x1693('0x54')];if(_0x109534>_0x179111){_0x109534=_0x179111;}}if(_0x109534>0x0){if(_0x2a4643['dialMethod']==='booked'){_0x109534=0x1;}if(_0x109534>this[_0x1693('0x25')]){_0x109534=this[_0x1693('0x25')];}_0x2a4643['temp']+=_0x109534;for(var _0xf31d39 in this[_0x1693('0x23')]){if(typeof this[_0x1693('0x23')][_0xf31d39]!==_0x1693('0x9e')){if(this[_0x1693('0x23')][_0xf31d39]['state']==='not_inuse'&&this[_0x1693('0x23')][_0xf31d39][_0x1693('0xb4')]===_0x1693('0xe1')){_0x5ae826[_0x1693('0x12d')](this[_0x1693('0x23')][_0xf31d39]['id']);}}}this[_0x1693('0xc8')](_0x2a4643['id'],_0x5ae826,_0x109534,_0x2a4643[_0x1693('0x200')],_0x2a4643)[_0x1693('0xbc')](function(_0x14b34d){_0x2a4643[_0x1693('0xc9')]-=_0x109534;_0x2a4643[_0x1693('0xc9')]=_0x2a4643[_0x1693('0xc9')]>0x0?_0x2a4643[_0x1693('0xc9')]:0x0;if(!checkContactEmpty(_0x14b34d)){_0x177780[_0x1693('0xbb')](_0x2a4643)[_0x1693('0xbc')](sendMessageReschedule(_0x2a4643))[_0x1693('0xb5')](loggerCatch(_0x1693('0xbd')));}else{_0x2a4643[_0x1693('0x75')]+=_0x14b34d[_0x1693('0x9d')];_0x2a4643[_0x1693('0x3f')]=_0x2a4643[_0x1693('0x5c')]==='booked'?_0x1693('0x174'):_0x1693('0x203');for(var _0x5ede3f=0x0;_0x5ede3f<_0x14b34d[_0x1693('0x9d')];_0x5ede3f+=0x1){if(_[_0x1693('0xb3')](_0x14b34d[_0x5ede3f])||_[_0x1693('0xb3')](_0x14b34d[_0x5ede3f][_0x1693('0x16d')])||_['isNil'](_0x14b34d[_0x5ede3f][_0x1693('0x16d')][_0x1693('0x16e')])){_0x177780['emptyContact'](_0x1693('0x208'),_0x2a4643,_0x14b34d[_0x5ede3f]);}else{_0x177780[_0x1693('0xbf')](_[_0x1693('0xd5')](_0x14b34d[_0x5ede3f],[_0x1693('0xd9'),_0x1693('0x204')]))['then'](_0x177780[_0x1693('0x1ea')](_0x2a4643,_0x14b34d[_0x5ede3f]))[_0x1693('0xb5')](_0x177780[_0x1693('0x205')](_0x1693('0x208'),_0x2a4643));}}}})['catch'](loggerGetContactDialer(_0x1693('0x209'),_0x2a4643,_0x109534));}};Dialer[_0x1693('0x1c')][_0x1693('0x94')]=function(_0x406985){if(_0x406985['dialLimitQueue']>0x0){var _0x3e11ed=_0x406985['dialLimitQueue']-_0x406985[_0x1693('0x75')]-_0x406985[_0x1693('0x57')];if(_0x3e11ed>0x0){this[_0x1693('0x20a')](_0x406985);}else{loggerPredictiveCalls['info'](_0x1693('0x20b'));}}else{this[_0x1693('0x20a')](_0x406985);}};Dialer[_0x1693('0x1c')][_0x1693('0x20a')]=function(_0x349b9e){var _0x4c8c03=this;var _0x1c6c8b=[];_0x349b9e[_0x1693('0x75')]+=0x1;for(var _0x543e18 in this[_0x1693('0x23')]){if(typeof this[_0x1693('0x23')][_0x543e18]!==_0x1693('0x9e')){if(this['agents'][_0x543e18][_0x1693('0xac')]===_0x1693('0x20c')&&this[_0x1693('0x23')][_0x543e18][_0x1693('0xb4')]==='reachable'){_0x1c6c8b[_0x1693('0x12d')](this[_0x1693('0x23')][_0x543e18]['id']);}}}this[_0x1693('0xc8')](_0x349b9e['id'],_0x1c6c8b,0x1,_0x349b9e['dialOrderByScheduledAt'],_0x349b9e)[_0x1693('0xbc')](function(_0x18d952){if(!checkContactEmpty(_0x18d952)){checkContactLowerLimitOriginate(_0x349b9e,0x1,0x0);_0x4c8c03[_0x1693('0xbb')](_0x349b9e)['then'](sendMessageReschedule(_0x349b9e))[_0x1693('0xb5')](loggerCatch(_0x1693('0xbd')));}else{_0x349b9e[_0x1693('0x3f')]=_0x1693('0x203');if(_[_0x1693('0xb3')](_0x18d952[0x0])||_[_0x1693('0xb3')](_0x18d952[0x0][_0x1693('0x16d')])||_[_0x1693('0xb3')](_0x18d952[0x0]['Contact'][_0x1693('0x16e')])){_0x4c8c03[_0x1693('0xd3')]('[actionOriginate]\x20',_0x349b9e,_0x18d952[0x0]);}else{_0x4c8c03[_0x1693('0xbf')](_[_0x1693('0xd5')](_0x18d952[0x0],['VoiceQueueId',_0x1693('0x204')]))[_0x1693('0xbc')](_0x4c8c03[_0x1693('0x1ea')](_0x349b9e,_0x18d952[0x0]))[_0x1693('0xb5')](_0x4c8c03[_0x1693('0x205')](_0x1693('0x20d'),_0x349b9e));}}})['catch'](loggerGetContactDialer(_0x1693('0x20e'),_0x349b9e,0x1));emitVoiceQueueSummary(_0x349b9e);};Dialer['prototype'][_0x1693('0x1de')]=function(_0x4f20e5,_0x475a6c,_0xc51ce4,_0x538b6c,_0x433551,_0x407c6c){loggerPredictive[_0x1693('0x83')](_0x1693('0x20f'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4f20e5);loggerPredictive['info'](_0x1693('0x210'),_0x475a6c);loggerPredictive['info'](_0x1693('0x211'),_0xc51ce4);loggerPredictive['info'](_0x1693('0x212'),_0x538b6c);loggerPredictive[_0x1693('0x83')](_0x1693('0x213'),_0x433551);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x502e78,_0x4c5b02){if(_0x4f20e5<=0x0||isNaN(_0x4f20e5)){return _0x4c5b02(msgResponse('[abandonmentRate]',_0x1693('0x4a'),_0x1693('0x214')+_0x4f20e5));}if(_0xc51ce4<=0x0||isNaN(_0xc51ce4)){return _0x4c5b02(msgResponse(_0x1693('0x215'),_0x1693('0x4a'),_0x1693('0x216')+_0xc51ce4));}if(_0x538b6c<=0x0||isNaN(_0x538b6c)){return _0x4c5b02(msgResponse(_0x1693('0x215'),_0x1693('0x4a'),_0x1693('0x217')+_0x538b6c));}if(_0x475a6c<=0x0||isNaN(_0x475a6c)){return _0x4c5b02(msgResponse('[abandonmentRate]',_0x1693('0x4a'),_0x1693('0x218')+_0x475a6c));}if(_0x433551<=0x0||isNaN(_0x433551)){return _0x4c5b02(msgResponse('[abandonmentRate]',_0x1693('0x4a'),_0x1693('0x219')+_0x433551));}_0x407c6c=_0x407c6c||0x0;var _0x3a183e=0x1/_0xc51ce4;var _0x51eff7=0x0;var _0x3ee6f2=0x0;var _0x1f96ca=0x0;var _0x2aa629=0x0;for(var _0x21dfc5=0x0;_0x1f96ca<_0x433551;_0x21dfc5+=0x1){_0x3ee6f2=_0x21dfc5/_0x475a6c;_0x51eff7=(_0x538b6c*_0x3ee6f2+_0x407c6c)/_0x3a183e;_0x1f96ca=erlangb(_0x51eff7,_0x4f20e5);_0x2aa629=_0x51eff7/_0x4f20e5*(0x1-erlangb(_0x51eff7,_0x4f20e5));}return _0x502e78({'erlangCalls':_0x21dfc5,'erlangCallToSecond':_0x475a6c/_0x21dfc5,'erlangAbandonmentRate':_0x1f96ca,'erlangBusyFactor':_0x2aa629});});};Dialer[_0x1693('0x1c')][_0x1693('0x1e0')]=function(_0x3089bf,_0x23b5ae,_0x3fcc5c,_0x299f6e,_0x35a4c2,_0x58ec98){loggerPredictive[_0x1693('0x83')](_0x1693('0x21a'));loggerPredictive['info'](_0x1693('0x21b'),_0x3089bf);loggerPredictive[_0x1693('0x83')](_0x1693('0x210'),_0x23b5ae);loggerPredictive[_0x1693('0x83')](_0x1693('0x211'),_0x3fcc5c);loggerPredictive[_0x1693('0x83')](_0x1693('0x212'),_0x299f6e);loggerPredictive[_0x1693('0x83')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35a4c2);loggerPredictive[_0x1693('0x83')](_0x1693('0x90'));return new BPromise(function(_0x988418,_0x3f4de5){if(_0x3089bf<=0x0||isNaN(_0x3089bf)){return _0x3f4de5(msgResponse(_0x1693('0x21c'),_0x1693('0x4a'),_0x1693('0x214')+_0x3089bf));}if(_0x3fcc5c<=0x0||isNaN(_0x3fcc5c)){return _0x3f4de5(msgResponse('[busyFactor]',_0x1693('0x4a'),_0x1693('0x216')+_0x3fcc5c));}if(_0x299f6e<=0x0||isNaN(_0x299f6e)){return _0x3f4de5(msgResponse(_0x1693('0x21c'),_0x1693('0x4a'),_0x1693('0x217')+_0x299f6e));}if(_0x23b5ae<=0x0||isNaN(_0x23b5ae)){return _0x3f4de5(msgResponse('[busyFactor]',_0x1693('0x4a'),_0x1693('0x218')+_0x23b5ae));}if(_0x35a4c2<=0x0||isNaN(_0x35a4c2)){return _0x3f4de5(msgResponse(_0x1693('0x21c'),_0x1693('0x4a'),_0x1693('0x21d')+_0x35a4c2));}_0x58ec98=_0x58ec98||0x0;var _0x14048d=0x1/_0x3fcc5c;var _0x778121=0x0;var _0x1a0cb4=0x0;var _0x19cfa8=0x0;var _0x398bc2=0x0;for(var _0x57697e=0x0;_0x398bc2<_0x35a4c2;_0x57697e+=0x1){_0x1a0cb4=_0x57697e/_0x23b5ae;_0x778121=(_0x299f6e*_0x1a0cb4+_0x58ec98)/_0x14048d;_0x19cfa8=erlangb(_0x778121,_0x3089bf);_0x398bc2=_0x778121/_0x3089bf*(0x1-erlangb(_0x778121,_0x3089bf));}return _0x988418({'erlangCalls':_0x57697e,'erlangCallToSecond':_0x23b5ae/_0x57697e,'erlangAbandonmentRate':_0x19cfa8,'erlangBusyFactor':_0x398bc2});});};module[_0x1693('0x21e')]=Dialer;
\ No newline at end of file
index 26e91ef..9632af3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0d7=['droptime','holdtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime'];(function(_0x5dce85,_0x1a5102){var _0xf20074=function(_0x2ed09b){while(--_0x2ed09b){_0x5dce85['push'](_0x5dce85['shift']());}};_0xf20074(++_0x1a5102);}(_0xb0d7,0xb0));var _0x7b0d=function(_0x57d36d,_0x556070){_0x57d36d=_0x57d36d-0x0;var _0x2682eb=_0xb0d7[_0x57d36d];return _0x2682eb;};'use strict';var util=require(_0x7b0d('0x0'));var _=require('lodash');var moment=require(_0x7b0d('0x1'));function getSeconds(_0x5adf94,_0x146871){var _0x5c546c=moment(_0x5adf94)[_0x7b0d('0x2')](0x0);var _0x12c3dc=moment(_0x146871)[_0x7b0d('0x2')](0x0);return _0x5c546c[_0x7b0d('0x3')](_0x12c3dc,_0x7b0d('0x4'));}function QueueCallerAbandon(_0x286e10,_0x42803d){this['scheduledat']=_0x286e10[_0x7b0d('0x5')];this[_0x7b0d('0x6')]=_0x286e10[_0x7b0d('0x6')];this[_0x7b0d('0x7')]=_0x286e10[_0x7b0d('0x6')]===_0x7b0d('0x8')?'queue':_0x286e10[_0x7b0d('0x6')];this[_0x7b0d('0x9')]=_0x286e10[_0x7b0d('0x9')];this[_0x7b0d('0xa')]=_0x286e10[_0x7b0d('0xa')];this['countnoanswerretry']=_0x286e10[_0x7b0d('0xb')];this[_0x7b0d('0xc')]=_0x286e10['countbusyretry']+_0x286e10[_0x7b0d('0xa')]+_0x286e10[_0x7b0d('0xb')]+_0x286e10['countnosuchnumberretry']+_0x286e10[_0x7b0d('0xd')]+_0x286e10[_0x7b0d('0xe')]+_0x286e10[_0x7b0d('0xf')]+_0x286e10['countagentrejectretry'];this[_0x7b0d('0x10')]=_0x286e10['countnosuchnumberretry'];this[_0x7b0d('0xd')]=_0x286e10[_0x7b0d('0xd')];this[_0x7b0d('0xe')]=_0x286e10[_0x7b0d('0xe')];this[_0x7b0d('0xf')]=_0x286e10[_0x7b0d('0xf')];this[_0x7b0d('0x11')]=_0x286e10[_0x7b0d('0x11')];this['uniqueid']=_0x42803d[_0x7b0d('0x12')];this[_0x7b0d('0x13')]=_0x286e10[_0x7b0d('0x14')];this['calleridnum']=_0x286e10[_0x7b0d('0x15')];this[_0x7b0d('0x16')]=_0x286e10[_0x7b0d('0x16')];this[_0x7b0d('0x17')]=_0x286e10[_0x7b0d('0x17')];this['droptime']=_0x286e10[_0x7b0d('0x18')];this['endtime']=this[_0x7b0d('0x18')];this['ringtime']=getSeconds(_0x286e10['responsetime'],_0x286e10['starttime']);this[_0x7b0d('0x19')]=getSeconds(this[_0x7b0d('0x18')],_0x286e10[_0x7b0d('0x17')]);this['talktime']=0x0;this[_0x7b0d('0x1a')]=_0x42803d[_0x7b0d('0x1a')];this[_0x7b0d('0x1b')]=_0x42803d['connectedlinename'];this[_0x7b0d('0x1c')]=_0x42803d[_0x7b0d('0x1c')];this[_0x7b0d('0x1d')]=_0x286e10[_0x7b0d('0x1d')];this[_0x7b0d('0x1e')]=_0x286e10['callbackuniqueid'];this[_0x7b0d('0x1f')]=_0x286e10[_0x7b0d('0x1f')];this['recallme']=_0x286e10[_0x7b0d('0x20')];this['ContactId']=_0x286e10['ContactId'];this[_0x7b0d('0x21')]=_0x286e10['ListId'];this['UserId']=_0x286e10[_0x7b0d('0x22')];this[_0x7b0d('0x23')]=_0x286e10[_0x7b0d('0x23')];this['CampaignId']=_0x286e10[_0x7b0d('0x24')];this[_0x7b0d('0x25')]=_0x286e10[_0x7b0d('0x25')]||'';this[_0x7b0d('0x26')]=_0x286e10[_0x7b0d('0x26')]||'';}module[_0x7b0d('0x27')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x70ef=['uniqueid','calleridname','name','calleridnum','responsetime','droptime','endtime','ringtime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x70ef,0x6a));var _0xf70e=function(_0x1f4d75,_0x14871e){_0x1f4d75=_0x1f4d75-0x0;var _0xb8f974=_0x70ef[_0x1f4d75];return _0xb8f974;};'use strict';var util=require(_0xf70e('0x0'));var _=require(_0xf70e('0x1'));var moment=require(_0xf70e('0x2'));function getSeconds(_0x3b1d1c,_0x1f8cf1){var _0xdd8ff6=moment(_0x3b1d1c)['milliseconds'](0x0);var _0x3d8ee4=moment(_0x1f8cf1)[_0xf70e('0x3')](0x0);return _0xdd8ff6[_0xf70e('0x4')](_0x3d8ee4,_0xf70e('0x5'));}function QueueCallerAbandon(_0x23012,_0xa79090){this['scheduledat']=_0x23012[_0xf70e('0x6')];this[_0xf70e('0x7')]=_0x23012[_0xf70e('0x7')];this[_0xf70e('0x8')]=_0x23012[_0xf70e('0x7')]===_0xf70e('0x9')?_0xf70e('0xa'):_0x23012[_0xf70e('0x7')];this[_0xf70e('0xb')]=_0x23012[_0xf70e('0xb')];this['countcongestionretry']=_0x23012[_0xf70e('0xc')];this['countnoanswerretry']=_0x23012[_0xf70e('0xd')];this[_0xf70e('0xe')]=_0x23012[_0xf70e('0xb')]+_0x23012[_0xf70e('0xc')]+_0x23012['countnoanswerretry']+_0x23012['countnosuchnumberretry']+_0x23012[_0xf70e('0xf')]+_0x23012['countabandonedretry']+_0x23012[_0xf70e('0x10')]+_0x23012['countagentrejectretry'];this[_0xf70e('0x11')]=_0x23012[_0xf70e('0x11')];this['countdropretry']=_0x23012['countdropretry'];this['countabandonedretry']=_0x23012[_0xf70e('0x12')];this[_0xf70e('0x10')]=_0x23012[_0xf70e('0x10')];this[_0xf70e('0x13')]=_0x23012['countagentrejectretry'];this['uniqueid']=_0xa79090[_0xf70e('0x14')];this[_0xf70e('0x15')]=_0x23012[_0xf70e('0x16')];this[_0xf70e('0x17')]=_0x23012['number'];this['starttime']=_0x23012['starttime'];this['responsetime']=_0x23012[_0xf70e('0x18')];this[_0xf70e('0x19')]=_0x23012[_0xf70e('0x19')];this[_0xf70e('0x1a')]=this[_0xf70e('0x19')];this[_0xf70e('0x1b')]=getSeconds(_0x23012[_0xf70e('0x18')],_0x23012['starttime']);this[_0xf70e('0x1c')]=getSeconds(this[_0xf70e('0x19')],_0x23012[_0xf70e('0x18')]);this[_0xf70e('0x1d')]=0x0;this[_0xf70e('0xa')]=_0xa79090[_0xf70e('0xa')];this['membername']=_0xa79090[_0xf70e('0x1e')];this[_0xf70e('0x1f')]=_0xa79090[_0xf70e('0x1f')];this[_0xf70e('0x20')]=_0x23012[_0xf70e('0x20')];this[_0xf70e('0x21')]=_0x23012[_0xf70e('0x21')];this[_0xf70e('0x22')]=_0x23012['callbackat'];this[_0xf70e('0x23')]=_0x23012[_0xf70e('0x23')];this[_0xf70e('0x24')]=_0x23012['ContactId'];this['ListId']=_0x23012[_0xf70e('0x25')];this['UserId']=_0x23012[_0xf70e('0x26')];this[_0xf70e('0x27')]=_0x23012[_0xf70e('0x27')];this['CampaignId']=_0x23012[_0xf70e('0x28')];this[_0xf70e('0x29')]=_0x23012[_0xf70e('0x29')]||'';this['originatecalleridname']=_0x23012['originatecalleridname']||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
index 371a250..6563e08 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(_0x48727a,_0x5b0441){var _0xe17b36=function(_0x3b6509){while(--_0x3b6509){_0x48727a['push'](_0x48727a['shift']());}};_0xe17b36(++_0x5b0441);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
+var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x11497e,_0x58decf){var _0x557863=function(_0x4225c4){while(--_0x4225c4){_0x11497e['push'](_0x11497e['shift']());}};_0x557863(++_0x58decf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 55ef063..9046f98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5167=['[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','lodash','bluebird','uuid','tiff2pdf','../../../config/logger','fax','./rpcDb','./channel','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','prototype','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','then','notify','catch','error','stringify','\x20receiveFax\x20','merge','reason','update','AttachmentId','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','faxpages','faxstatus','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Empty\x20Fax'];(function(_0x1cb950,_0xc06e73){var _0x1bef44=function(_0x3a7760){while(--_0x3a7760){_0x1cb950['push'](_0x1cb950['shift']());}};_0x1bef44(++_0xc06e73);}(_0x5167,0x1c3));var _0x7516=function(_0x2b9ad3,_0x5afd5d){_0x2b9ad3=_0x2b9ad3-0x0;var _0x1ca327=_0x5167[_0x2b9ad3];return _0x1ca327;};'use strict';var util=require('util');var _=require(_0x7516('0x0'));var BPromise=require(_0x7516('0x1'));var uuid=require(_0x7516('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require(_0x7516('0x3'));var gs=require('./util/gs');var logger=require(_0x7516('0x4'))(_0x7516('0x5'));var ami=require('../ami');var rpcDb=require(_0x7516('0x6'));var Channel=require(_0x7516('0x7'));var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0x7516('0x8'));var attachment=require(_0x7516('0x9'));var faxMessage=require(_0x7516('0xa'));function Fax(_0x2cb413){this[_0x7516('0xb')]={};this[_0x7516('0xc')]=_0x2cb413[_0x7516('0xc')];this['trunks']=_0x2cb413[_0x7516('0xd')];this[_0x7516('0xe')]={};ami['on'](_0x7516('0xf'),this[_0x7516('0x10')][_0x7516('0x11')](this));ami['on'](_0x7516('0x12'),this[_0x7516('0x13')][_0x7516('0x11')](this));ami['on'](_0x7516('0x14'),this['syncNewState']['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x7516('0x11')](this));ami['on']('faxstatus',this[_0x7516('0x15')][_0x7516('0x11')](this));ami['on'](_0x7516('0x16'),this[_0x7516('0x17')][_0x7516('0x11')](this));ami['on']('hangup',this[_0x7516('0x18')][_0x7516('0x11')](this));ami['on']('originateresponse',this[_0x7516('0x19')][_0x7516('0x11')](this));}Fax['prototype'][_0x7516('0x10')]=function(_0x1820ff){if(_0x1820ff[_0x7516('0x1a')]===_0x7516('0x1b')){for(var _0xdc86ab in this[_0x7516('0xc')]){if(this[_0x7516('0xc')][_0x7516('0x1c')](_0xdc86ab)){if(_0x1820ff[_0x7516('0x1d')]===this[_0x7516('0xc')][_0xdc86ab][_0x7516('0x1e')]){this[_0x7516('0xb')][_0x1820ff[_0x7516('0x1f')]]={};this[_0x7516('0xb')][_0x1820ff[_0x7516('0x1f')]][_0x7516('0x20')]=_0x1820ff[_0x7516('0x20')];this[_0x7516('0xb')][_0x1820ff[_0x7516('0x1f')]]['id']=this[_0x7516('0xc')][_0xdc86ab]['id'];this[_0x7516('0xb')][_0x1820ff[_0x7516('0x1f')]][_0x7516('0x21')]=this[_0x7516('0xc')][_0xdc86ab][_0x7516('0x21')];logger['info'](_0x1820ff['uniqueid'],_0x7516('0x22'));}}}}if(this[_0x7516('0xe')][_0x1820ff[_0x7516('0x1f')]]){this['channels'][_0x1820ff['uniqueid']]={};this['channels'][_0x1820ff['uniqueid']][_0x7516('0x20')]=_0x1820ff['channel'];logger[_0x7516('0x23')](_0x1820ff['uniqueid'],_0x7516('0x22'));}};Fax[_0x7516('0x24')][_0x7516('0x13')]=function(_0x480997){if(this[_0x7516('0xb')][_0x480997[_0x7516('0x1f')]]){for(var _0x58e817 in _0x480997['variable']){if(_0x480997[_0x7516('0x25')]['hasOwnProperty'](_0x58e817)){this['channels'][_0x480997[_0x7516('0x1f')]][_0x58e817]=_0x480997[_0x7516('0x26')];}}}};Fax[_0x7516('0x24')]['syncNewState']=function(_0x59546b){if(this[_0x7516('0xb')][_0x59546b[_0x7516('0x1f')]]){this[_0x7516('0xb')][_0x59546b['uniqueid']]['channelstate']=_0x59546b[_0x7516('0x27')];this[_0x7516('0xb')][_0x59546b[_0x7516('0x1f')]]['channelstatedesc']=_0x59546b[_0x7516('0x28')];}};Fax['prototype'][_0x7516('0x29')]=function(_0x1aeec5){if(this['channels'][_0x1aeec5[_0x7516('0x1f')]]){for(var _0x58b63b in _0x1aeec5[_0x7516('0x25')]){if(_0x1aeec5[_0x7516('0x25')][_0x7516('0x1c')](_0x58b63b)){this[_0x7516('0xb')][_0x1aeec5['uniqueid']][_0x58b63b]=_0x1aeec5[_0x7516('0x26')];}}}};Fax[_0x7516('0x24')][_0x7516('0x15')]=function(_0x19e013){if(this[_0x7516('0xb')][_0x19e013[_0x7516('0x1f')]]){this[_0x7516('0xb')][_0x19e013[_0x7516('0x1f')]][_0x7516('0x2a')]=_0x19e013[_0x7516('0x2a')];this[_0x7516('0xb')][_0x19e013['uniqueid']][_0x7516('0x2b')]=_0x19e013['status'];this['channels'][_0x19e013[_0x7516('0x1f')]][_0x7516('0x1e')]=_0x19e013[_0x7516('0x1e')];this[_0x7516('0xb')][_0x19e013[_0x7516('0x1f')]][_0x7516('0x2c')]=_0x19e013[_0x7516('0x2c')];logger['info'](_0x19e013['uniqueid'],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x7516('0x17')]=function(_0x3c593c){var _0x24ca69=this;if(this[_0x7516('0xb')][_0x3c593c[_0x7516('0x1f')]]){var _0x1a229a=this[_0x7516('0xb')][_0x3c593c[_0x7516('0x1f')]]['id'];this[_0x7516('0xb')][_0x3c593c[_0x7516('0x1f')]][_0x7516('0x2d')]=_0x3c593c['remotestationid'];this[_0x7516('0xb')][_0x3c593c[_0x7516('0x1f')]][_0x7516('0x2e')]=_0x3c593c[_0x7516('0x2e')];this[_0x7516('0xb')][_0x3c593c[_0x7516('0x1f')]]['localstationid']=_0x3c593c['localstationid'];this[_0x7516('0xb')][_0x3c593c[_0x7516('0x1f')]]['resolution']=_0x3c593c[_0x7516('0x2f')];this[_0x7516('0xb')][_0x3c593c[_0x7516('0x1f')]][_0x7516('0x30')]=_0x3c593c['transferrate'];this[_0x7516('0xb')][_0x3c593c['uniqueid']]['filename']=_0x3c593c[_0x7516('0x2c')];this[_0x7516('0xb')][_0x3c593c[_0x7516('0x1f')]][_0x7516('0x31')]=_0x3c593c[_0x7516('0x31')];if(this[_0x7516('0xb')][_0x3c593c[_0x7516('0x1f')]][_0x7516('0x2e')]>0x0){tiff2pdf(_0x3c593c[_0x7516('0x2c')],_0x7516('0x32'),function(_0x411fdb){logger[_0x7516('0x23')](_0x3c593c[_0x7516('0x1f')],_0x7516('0x33'),_0x411fdb[_0x7516('0x34')]);attachment[_0x7516('0x35')]({'name':path[_0x7516('0x36')](_0x3c593c[_0x7516('0x2c')])['name'],'basename':path[_0x7516('0x36')](_0x3c593c[_0x7516('0x2c')])['name']+'.pdf','type':'application/pdf'})[_0x7516('0x37')](function(_0x281b5a){faxAccount[_0x7516('0x38')](_0x1a229a,{'from':_0x3c593c[_0x7516('0x31')],'mapKey':_0x7516('0x5'),'body':path['parse'](_0x3c593c[_0x7516('0x2c')])[_0x7516('0x21')]+'.pdf','AttachmentId':_0x281b5a['id']})[_0x7516('0x39')](function(_0x3380d3){logger[_0x7516('0x3a')](_0x3c593c[_0x7516('0x1f')],'\x20notify\x20',JSON[_0x7516('0x3b')](_0x3380d3));});})[_0x7516('0x39')](function(_0x5e6992){logger[_0x7516('0x3a')](_0x3c593c[_0x7516('0x1f')],_0x7516('0x3c'),JSON['stringify'](_0x5e6992));});});}logger[_0x7516('0x23')](_0x3c593c[_0x7516('0x1f')],_0x7516('0x3c'));}};Fax[_0x7516('0x24')]['syncOriginateResponse']=function(_0x4a9d0a){if(this[_0x7516('0xe')][_0x4a9d0a[_0x7516('0x1f')]]){_[_0x7516('0x3d')](this[_0x7516('0xb')][_0x4a9d0a['uniqueid']],_['pick'](_0x4a9d0a,['response',_0x7516('0x3e')]));}};function updateStatus(_0xf2d7cb){if(_0xf2d7cb['AttachmentId']){faxMessage[_0x7516('0x3f')](_0xf2d7cb[_0x7516('0x40')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x7516('0x37')](function(_0x205992){ut['logger'](_0x7516('0x41'),_0x205992);})[_0x7516('0x39')](function(_0x333f08){ut[_0x7516('0x42')](_0x7516('0x43'),_0x333f08);});}else{ut[_0x7516('0x42')](_0x7516('0x44'));}}Fax['prototype'][_0x7516('0x45')]=function(_0x13c77a,_0x3a9514,_0x4e7285){var _0xaaf24=this;var _0x8584d={};if(_0x3a9514){_0x8584d={'read':_0x3a9514};}else{_0x8584d={'failMessage':_0x4e7285};}if(this[_0x7516('0xe')][_0x13c77a][_0x7516('0x40')]){faxMessage[_0x7516('0x3f')](this['actions'][_0x13c77a][_0x7516('0x40')],_0x8584d)[_0x7516('0x37')](function(_0x379627){ut[_0x7516('0x42')](_0x7516('0x46'),_0x379627);})[_0x7516('0x39')](function(_0x4dac74){ut['logger'](_0x7516('0x47'),_0x4dac74);})['finally'](function(){delete _0xaaf24[_0x7516('0xb')][_0x13c77a];delete _0xaaf24[_0x7516('0xe')][_0x13c77a];});}else{ut['logger'](_0x7516('0x48'));delete this[_0x7516('0xb')][_0x13c77a];delete this['actions'][_0x13c77a];}};Fax[_0x7516('0x24')][_0x7516('0x18')]=function(_0x3c3233){var _0x31b6e5=this;if(this[_0x7516('0xb')][_0x3c3233[_0x7516('0x1f')]]){if(this['actions'][_0x3c3233[_0x7516('0x1f')]]){this['channels'][_0x3c3233[_0x7516('0x1f')]]['id']=this[_0x7516('0xe')][_0x3c3233[_0x7516('0x1f')]]['id'];this['channels'][_0x3c3233[_0x7516('0x1f')]]['name']=this[_0x7516('0xe')][_0x3c3233[_0x7516('0x1f')]][_0x7516('0x21')];}logger[_0x7516('0x23')](_0x3c3233[_0x7516('0x1f')],this[_0x7516('0xe')][_0x3c3233['uniqueid']]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x7516('0x3b')](this[_0x7516('0xb')][_0x3c3233[_0x7516('0x1f')]]));if(this[_0x7516('0xe')][_0x3c3233['uniqueid']]){if(this[_0x7516('0xb')][_0x3c3233[_0x7516('0x1f')]][_0x7516('0x49')]>0x0&&this[_0x7516('0xb')][_0x3c3233['uniqueid']][_0x7516('0x4a')]===_0x7516('0x4b')){this['updateStatus'](_0x3c3233[_0x7516('0x1f')],!![]);}else{this[_0x7516('0x45')](_0x3c3233[_0x7516('0x1f')],![],this['channels'][_0x3c3233['uniqueid']]['faxstatusstring']?_0x7516('0x4c')+this['channels'][_0x3c3233[_0x7516('0x1f')]][_0x7516('0x4d')]:_0x7516('0x4e'));}}}};Fax[_0x7516('0x24')][_0x7516('0x4f')]=function(_0x1f8ecb){var _0x599b63=this;return new BPromise(function(_0xe0f85,_0xcf9c3c){_0x599b63[_0x7516('0x50')](_0x1f8ecb,_0x599b63[_0x7516('0xc')][_0x1f8ecb[_0x7516('0x51')]])[_0x7516('0x37')](function(_0x526449){ut['logger']('[Fax][execOriginate][success]',_0x526449);_0xe0f85(ut[_0x7516('0x34')](_0x7516('0x52')));})[_0x7516('0x39')](function(_0x32e9ee){ut[_0x7516('0x42')](_0x7516('0x53'),_0x32e9ee);updateStatus(_0x1f8ecb);_0xcf9c3c(ut[_0x7516('0x34')](_0x7516('0x54')));});});};Fax[_0x7516('0x24')][_0x7516('0x55')]=function(_0x5142fe){var _0x10845f=this;return new BPromise(function(_0x39a74a,_0x11547b){var _0x5bb1b0=_0x10845f[_0x7516('0x56')](_0x10845f['faxAccounts'][_0x5142fe[_0x7516('0x51')]][_0x7516('0x57')],_0x5142fe);if(_0x5bb1b0['isValid']){_0x39a74a(ut[_0x7516('0x34')](_0x7516('0x58')));}else{_0x11547b(ut['message'](_0x5bb1b0[_0x7516('0x34')]));}});};function originate(_0x25eb74,_0x1f0998,_0x38b7b8){return new BPromise(function(_0x184a7b,_0x2b6bb3){if(_0x38b7b8){var _0x552701=util[_0x7516('0x59')](_0x7516('0x5a'),path[_0x7516('0x36')](_0x25eb74[_0x7516('0x5b')])[_0x7516('0x21')],_0x25eb74['path']);gs[_0x7516('0x5c')](_0x552701)['then'](function(){_0x25eb74[_0x7516('0x5b')]=util[_0x7516('0x59')]('%s/%s.tif',path[_0x7516('0x36')](_0x25eb74[_0x7516('0x5b')])[_0x7516('0x5d')],path[_0x7516('0x36')](_0x25eb74['path'])[_0x7516('0x21')]);_0x1f0998[_0x7516('0x5e')]=_0x25eb74[_0x7516('0x5b')];ut['logger'](_0x7516('0x5f'),'');ami[_0x7516('0x60')](ut[_0x7516('0x61')](_0x25eb74,_0x1f0998))[_0x7516('0x37')](function(_0x8da291){_0x184a7b(_0x8da291);})[_0x7516('0x39')](function(_0x4e68de){_0x2b6bb3(_0x4e68de);});})[_0x7516('0x39')](function(_0x2e5667){_0x2b6bb3(_0x2e5667);});}else{ami[_0x7516('0x60')](ut[_0x7516('0x61')](_0x25eb74,_0x1f0998))[_0x7516('0x37')](function(_0x4a8056){_0x184a7b(_0x4a8056);})[_0x7516('0x39')](function(_0x45633e){_0x2b6bb3(_0x45633e);});}});}Fax[_0x7516('0x24')]['execOriginate']=function(_0xc3c812,_0x17fc49){var _0xd0ab00=this;return new BPromise(function(_0x23ecd2,_0x2ce35c){var _0x3b7bf0=uuid['v4']();var _0x2e99d7=ut[_0x7516('0x62')](_0xc3c812,_0x17fc49);_0xd0ab00[_0x7516('0xe')][_0x3b7bf0]=new Action(_0x3b7bf0,_0x17fc49,_0xc3c812);var _0x5a5b4d=_0xd0ab00[_0x7516('0xe')][_0x3b7bf0];if(path[_0x7516('0x36')](_0xc3c812['path'])[_0x7516('0x63')]===_0x7516('0x64')){originate(_0x5a5b4d,_0x2e99d7,!![])[_0x7516('0x37')](function(_0x13e692){_0x23ecd2(_0x13e692);})[_0x7516('0x39')](function(_0x27ea01){_0x2ce35c(_0x27ea01);});}else{originate(_0x5a5b4d,_0x2e99d7,![])['then'](function(_0x21f2da){_0x23ecd2(_0x21f2da);})[_0x7516('0x39')](function(_0x1aa104){_0x2ce35c(_0x1aa104);});}});};Fax[_0x7516('0x24')][_0x7516('0x65')]=function(_0x439bd8){return!_[_0x7516('0x66')](_0x439bd8)&&!_[_0x7516('0x66')](_0x439bd8[_0x7516('0x21')])&&!_['isNil'](_0x439bd8[_0x7516('0x67')])&&_0x439bd8[_0x7516('0x67')]&&!_[_0x7516('0x66')](this[_0x7516('0xd')][util[_0x7516('0x59')]('SIP/%s',_0x439bd8['name'])])&&!_['isNil'](this[_0x7516('0xd')][util[_0x7516('0x59')](_0x7516('0x68'),_0x439bd8['name'])][_0x7516('0x2b')])&&(this['trunks'][util['format']('SIP/%s',_0x439bd8['name'])][_0x7516('0x2b')]===_0x7516('0x69')||this[_0x7516('0xd')][util[_0x7516('0x59')](_0x7516('0x68'),_0x439bd8[_0x7516('0x21')])][_0x7516('0x2b')]===_0x7516('0x6a'));};Fax[_0x7516('0x24')]['checkTrunk']=function(_0x3773c8,_0x55db96){if(!this[_0x7516('0x65')](_0x3773c8)){ut[_0x7516('0x42')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x7516('0x66')](_0x3773c8)?'':_0x3773c8[_0x7516('0x21')]+_0x7516('0x6b'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_['isNil'](_0x55db96['fax'])){ut[_0x7516('0x42')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x7516('0x3b')](_0x55db96));return{'isValid':![],'message':_0x7516('0x6c')};}if(_['isNil'](_0x55db96[_0x7516('0x5b')])){ut[_0x7516('0x42')](_0x7516('0x6d'),JSON[_0x7516('0x3b')](_0x55db96));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x7516('0x6e')};};module[_0x7516('0x6f')]=Fax;
\ No newline at end of file
+var _0xc992=['error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','path','execute','XMF-PATH','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','moment','tiff2pdf','../../../config/logger','../ami','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','localstationid','uniqueid','channel','channels','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','hasOwnProperty','status','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','parse','filename','.pdf','application/pdf','notify','calleridnum','fax','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc992,0x190));var _0x2c99=function(_0x3eed0e,_0x50c447){_0x3eed0e=_0x3eed0e-0x0;var _0x352a49=_0xc992[_0x3eed0e];return _0x352a49;};'use strict';var util=require('util');var _=require(_0x2c99('0x0'));var BPromise=require(_0x2c99('0x1'));var uuid=require(_0x2c99('0x2'));var moment=require(_0x2c99('0x3'));var path=require('path');var tiff2pdf=require(_0x2c99('0x4'));var gs=require('./util/gs');var logger=require(_0x2c99('0x5'))('fax');var ami=require(_0x2c99('0x6'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x2c99('0x7'));var Action=require(_0x2c99('0x8'));var faxAccount=require(_0x2c99('0x9'));var attachment=require(_0x2c99('0xa'));var faxMessage=require(_0x2c99('0xb'));function Fax(_0xaab0da){this['channels']={};this[_0x2c99('0xc')]=_0xaab0da[_0x2c99('0xc')];this[_0x2c99('0xd')]=_0xaab0da[_0x2c99('0xd')];this[_0x2c99('0xe')]={};ami['on']('newchannel',this[_0x2c99('0xf')][_0x2c99('0x10')](this));ami['on'](_0x2c99('0x11'),this[_0x2c99('0x12')][_0x2c99('0x10')](this));ami['on'](_0x2c99('0x13'),this[_0x2c99('0x14')][_0x2c99('0x10')](this));ami['on'](_0x2c99('0x15'),this[_0x2c99('0x16')][_0x2c99('0x10')](this));ami['on'](_0x2c99('0x17'),this[_0x2c99('0x18')]['bind'](this));ami['on'](_0x2c99('0x19'),this[_0x2c99('0x1a')][_0x2c99('0x10')](this));ami['on'](_0x2c99('0x1b'),this[_0x2c99('0x1c')][_0x2c99('0x10')](this));ami['on'](_0x2c99('0x1d'),this[_0x2c99('0x1e')]['bind'](this));}Fax[_0x2c99('0x1f')]['syncNewchannel']=function(_0x392106){if(_0x392106['context']===_0x2c99('0x20')){for(var _0x409d72 in this[_0x2c99('0xc')]){if(this[_0x2c99('0xc')]['hasOwnProperty'](_0x409d72)){if(_0x392106['exten']===this['faxAccounts'][_0x409d72][_0x2c99('0x21')]){this['channels'][_0x392106['uniqueid']]={};this['channels'][_0x392106[_0x2c99('0x22')]]['channel']=_0x392106[_0x2c99('0x23')];this['channels'][_0x392106[_0x2c99('0x22')]]['id']=this[_0x2c99('0xc')][_0x409d72]['id'];this[_0x2c99('0x24')][_0x392106[_0x2c99('0x22')]][_0x2c99('0x25')]=this['faxAccounts'][_0x409d72][_0x2c99('0x25')];logger[_0x2c99('0x26')](_0x392106[_0x2c99('0x22')],_0x2c99('0x27'));}}}}if(this[_0x2c99('0xe')][_0x392106['uniqueid']]){this['channels'][_0x392106['uniqueid']]={};this[_0x2c99('0x24')][_0x392106['uniqueid']]['channel']=_0x392106[_0x2c99('0x23')];logger['info'](_0x392106[_0x2c99('0x22')],_0x2c99('0x27'));}};Fax[_0x2c99('0x1f')]['syncVarSet']=function(_0x5e8834){if(this[_0x2c99('0x24')][_0x5e8834[_0x2c99('0x22')]]){for(var _0x402b26 in _0x5e8834[_0x2c99('0x28')]){if(_0x5e8834[_0x2c99('0x28')]['hasOwnProperty'](_0x402b26)){this[_0x2c99('0x24')][_0x5e8834[_0x2c99('0x22')]][_0x402b26]=_0x5e8834[_0x2c99('0x29')];}}}};Fax['prototype'][_0x2c99('0x14')]=function(_0x44481f){if(this[_0x2c99('0x24')][_0x44481f['uniqueid']]){this[_0x2c99('0x24')][_0x44481f[_0x2c99('0x22')]][_0x2c99('0x2a')]=_0x44481f[_0x2c99('0x2a')];this['channels'][_0x44481f['uniqueid']][_0x2c99('0x2b')]=_0x44481f[_0x2c99('0x2b')];}};Fax['prototype'][_0x2c99('0x16')]=function(_0x1bec01){if(this[_0x2c99('0x24')][_0x1bec01['uniqueid']]){for(var _0x13be57 in _0x1bec01[_0x2c99('0x28')]){if(_0x1bec01['variable'][_0x2c99('0x2c')](_0x13be57)){this['channels'][_0x1bec01[_0x2c99('0x22')]][_0x13be57]=_0x1bec01[_0x2c99('0x29')];}}}};Fax[_0x2c99('0x1f')][_0x2c99('0x18')]=function(_0xc4578e){if(this[_0x2c99('0x24')][_0xc4578e[_0x2c99('0x22')]]){this[_0x2c99('0x24')][_0xc4578e[_0x2c99('0x22')]]['operation']=_0xc4578e['operation'];this['channels'][_0xc4578e[_0x2c99('0x22')]][_0x2c99('0x2d')]=_0xc4578e[_0x2c99('0x2d')];this[_0x2c99('0x24')][_0xc4578e[_0x2c99('0x22')]][_0x2c99('0x21')]=_0xc4578e[_0x2c99('0x21')];this['channels'][_0xc4578e[_0x2c99('0x22')]]['filename']=_0xc4578e['filename'];logger[_0x2c99('0x26')](_0xc4578e[_0x2c99('0x22')],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x2c99('0x1a')]=function(_0x891a6){var _0x2ab2d1=this;if(this[_0x2c99('0x24')][_0x891a6[_0x2c99('0x22')]]){var _0x289679=this[_0x2c99('0x24')][_0x891a6[_0x2c99('0x22')]]['id'];this[_0x2c99('0x24')][_0x891a6[_0x2c99('0x22')]]['remotestationid']=_0x891a6[_0x2c99('0x2e')];this[_0x2c99('0x24')][_0x891a6['uniqueid']][_0x2c99('0x2f')]=_0x891a6[_0x2c99('0x2f')];this[_0x2c99('0x24')][_0x891a6['uniqueid']][_0x2c99('0x21')]=_0x891a6[_0x2c99('0x21')];this[_0x2c99('0x24')][_0x891a6['uniqueid']][_0x2c99('0x30')]=_0x891a6[_0x2c99('0x30')];this[_0x2c99('0x24')][_0x891a6[_0x2c99('0x22')]][_0x2c99('0x31')]=_0x891a6[_0x2c99('0x31')];this['channels'][_0x891a6[_0x2c99('0x22')]]['filename']=_0x891a6['filename'];this['channels'][_0x891a6['uniqueid']]['calleridnum']=_0x891a6['calleridnum'];if(this[_0x2c99('0x24')][_0x891a6[_0x2c99('0x22')]][_0x2c99('0x2f')]>0x0){tiff2pdf(_0x891a6['filename'],_0x2c99('0x32'),function(_0x1977a7){logger['info'](_0x891a6[_0x2c99('0x22')],_0x2c99('0x33'),_0x1977a7['message']);attachment['create']({'name':path[_0x2c99('0x34')](_0x891a6[_0x2c99('0x35')])[_0x2c99('0x25')],'basename':path[_0x2c99('0x34')](_0x891a6['filename'])[_0x2c99('0x25')]+_0x2c99('0x36'),'type':_0x2c99('0x37')})['then'](function(_0x3c928e){faxAccount[_0x2c99('0x38')](_0x289679,{'from':_0x891a6[_0x2c99('0x39')],'mapKey':_0x2c99('0x3a'),'body':path[_0x2c99('0x34')](_0x891a6[_0x2c99('0x35')])[_0x2c99('0x25')]+'.pdf','AttachmentId':_0x3c928e['id']})[_0x2c99('0x3b')](function(_0x2e89d7){logger[_0x2c99('0x3c')](_0x891a6[_0x2c99('0x22')],_0x2c99('0x3d'),JSON[_0x2c99('0x3e')](_0x2e89d7));});})['catch'](function(_0x25907e){logger['error'](_0x891a6[_0x2c99('0x22')],_0x2c99('0x3f'),JSON[_0x2c99('0x3e')](_0x25907e));});});}logger[_0x2c99('0x26')](_0x891a6[_0x2c99('0x22')],_0x2c99('0x3f'));}};Fax[_0x2c99('0x1f')][_0x2c99('0x1e')]=function(_0x4a4fb0){if(this[_0x2c99('0xe')][_0x4a4fb0[_0x2c99('0x22')]]){_[_0x2c99('0x40')](this['channels'][_0x4a4fb0['uniqueid']],_[_0x2c99('0x41')](_0x4a4fb0,[_0x2c99('0x42'),_0x2c99('0x43')]));}};function updateStatus(_0x42c7f7){if(_0x42c7f7[_0x2c99('0x44')]){faxMessage[_0x2c99('0x45')](_0x42c7f7[_0x2c99('0x44')],{'failMessage':_0x2c99('0x46')})[_0x2c99('0x47')](function(_0x1038bb){ut['logger']('[Fax][Message][Error][Updated]',_0x1038bb);})['catch'](function(_0x5c1f66){ut[_0x2c99('0x48')](_0x2c99('0x49'),_0x5c1f66);});}else{ut['logger'](_0x2c99('0x4a'));}}Fax[_0x2c99('0x1f')][_0x2c99('0x4b')]=function(_0x1c3b41,_0x47c2bc,_0x3c7b71){var _0x26352=this;var _0x1671f3={};if(_0x47c2bc){_0x1671f3={'read':_0x47c2bc};}else{_0x1671f3={'failMessage':_0x3c7b71};}if(this[_0x2c99('0xe')][_0x1c3b41][_0x2c99('0x44')]){faxMessage[_0x2c99('0x45')](this[_0x2c99('0xe')][_0x1c3b41][_0x2c99('0x44')],_0x1671f3)[_0x2c99('0x47')](function(_0x4cbcd6){ut[_0x2c99('0x48')](_0x2c99('0x4c'),_0x4cbcd6);})[_0x2c99('0x3b')](function(_0x34f9bc){ut[_0x2c99('0x48')]('[Fax][Message][NoUpdate1]',_0x34f9bc);})[_0x2c99('0x4d')](function(){delete _0x26352['channels'][_0x1c3b41];delete _0x26352['actions'][_0x1c3b41];});}else{ut[_0x2c99('0x48')](_0x2c99('0x4e'));delete this[_0x2c99('0x24')][_0x1c3b41];delete this[_0x2c99('0xe')][_0x1c3b41];}};Fax[_0x2c99('0x1f')][_0x2c99('0x1c')]=function(_0x559e4e){var _0x4ab2e7=this;if(this[_0x2c99('0x24')][_0x559e4e[_0x2c99('0x22')]]){if(this[_0x2c99('0xe')][_0x559e4e['uniqueid']]){this['channels'][_0x559e4e[_0x2c99('0x22')]]['id']=this['actions'][_0x559e4e[_0x2c99('0x22')]]['id'];this['channels'][_0x559e4e[_0x2c99('0x22')]][_0x2c99('0x25')]=this[_0x2c99('0xe')][_0x559e4e[_0x2c99('0x22')]][_0x2c99('0x25')];}logger[_0x2c99('0x26')](_0x559e4e[_0x2c99('0x22')],this['actions'][_0x559e4e[_0x2c99('0x22')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0x2c99('0x24')][_0x559e4e[_0x2c99('0x22')]]));if(this[_0x2c99('0xe')][_0x559e4e[_0x2c99('0x22')]]){if(this[_0x2c99('0x24')][_0x559e4e[_0x2c99('0x22')]][_0x2c99('0x4f')]>0x0&&this['channels'][_0x559e4e[_0x2c99('0x22')]][_0x2c99('0x17')]===_0x2c99('0x50')){this[_0x2c99('0x4b')](_0x559e4e[_0x2c99('0x22')],!![]);}else{this['updateStatus'](_0x559e4e[_0x2c99('0x22')],![],this[_0x2c99('0x24')][_0x559e4e[_0x2c99('0x22')]][_0x2c99('0x51')]?_0x2c99('0x52')+this['channels'][_0x559e4e[_0x2c99('0x22')]][_0x2c99('0x51')]:_0x2c99('0x53'));}}}};Fax['prototype']['send']=function(_0x5ac457){var _0x133b34=this;return new BPromise(function(_0x44f215,_0x1fb241){_0x133b34[_0x2c99('0x54')](_0x5ac457,_0x133b34[_0x2c99('0xc')][_0x5ac457[_0x2c99('0x55')]])[_0x2c99('0x47')](function(_0x23ab78){ut[_0x2c99('0x48')](_0x2c99('0x56'),_0x23ab78);_0x44f215(ut[_0x2c99('0x57')]('Fax\x20received'));})[_0x2c99('0x3b')](function(_0x1d01f1){ut[_0x2c99('0x48')](_0x2c99('0x58'),_0x1d01f1);updateStatus(_0x5ac457);_0x1fb241(ut[_0x2c99('0x57')](_0x2c99('0x59')));});});};Fax['prototype'][_0x2c99('0x5a')]=function(_0x736470){var _0x3b1a3f=this;return new BPromise(function(_0x31af29,_0x46ddc8){var _0x473636=_0x3b1a3f['checkTrunk'](_0x3b1a3f[_0x2c99('0xc')][_0x736470['FaxAccountId']][_0x2c99('0x5b')],_0x736470);if(_0x473636[_0x2c99('0x5c')]){_0x31af29(ut[_0x2c99('0x57')](_0x2c99('0x5d')));}else{_0x46ddc8(ut[_0x2c99('0x57')](_0x473636[_0x2c99('0x57')]));}});};function originate(_0x538851,_0x141ffe,_0x4279b7){return new BPromise(function(_0x5bf1bb,_0x5bb967){if(_0x4279b7){var _0x1586c3=util[_0x2c99('0x5e')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x2c99('0x34')](_0x538851[_0x2c99('0x5f')])['name'],_0x538851[_0x2c99('0x5f')]);gs[_0x2c99('0x60')](_0x1586c3)['then'](function(){_0x538851['path']=util[_0x2c99('0x5e')]('%s/%s.tif',path['parse'](_0x538851['path'])['dir'],path[_0x2c99('0x34')](_0x538851['path'])['name']);_0x141ffe[_0x2c99('0x61')]=_0x538851[_0x2c99('0x5f')];ut[_0x2c99('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0x2c99('0x62')](ut[_0x2c99('0x63')](_0x538851,_0x141ffe))[_0x2c99('0x47')](function(_0x3263cc){_0x5bf1bb(_0x3263cc);})[_0x2c99('0x3b')](function(_0x11d52d){_0x5bb967(_0x11d52d);});})['catch'](function(_0x3beec1){_0x5bb967(_0x3beec1);});}else{ami[_0x2c99('0x62')](ut[_0x2c99('0x63')](_0x538851,_0x141ffe))[_0x2c99('0x47')](function(_0x2311d2){_0x5bf1bb(_0x2311d2);})[_0x2c99('0x3b')](function(_0x196e83){_0x5bb967(_0x196e83);});}});}Fax[_0x2c99('0x1f')]['execOriginate']=function(_0x39be6c,_0x16a613){var _0x1c0175=this;return new BPromise(function(_0x1360fe,_0x29a4ae){var _0x3a2c64=uuid['v4']();var _0x369c70=ut[_0x2c99('0x64')](_0x39be6c,_0x16a613);_0x1c0175[_0x2c99('0xe')][_0x3a2c64]=new Action(_0x3a2c64,_0x16a613,_0x39be6c);var _0x130418=_0x1c0175['actions'][_0x3a2c64];if(path[_0x2c99('0x34')](_0x39be6c['path'])['ext']==='.pdf'){originate(_0x130418,_0x369c70,!![])[_0x2c99('0x47')](function(_0x5adc96){_0x1360fe(_0x5adc96);})['catch'](function(_0x4c77f1){_0x29a4ae(_0x4c77f1);});}else{originate(_0x130418,_0x369c70,![])[_0x2c99('0x47')](function(_0x98efbf){_0x1360fe(_0x98efbf);})[_0x2c99('0x3b')](function(_0x3bb690){_0x29a4ae(_0x3bb690);});}});};Fax[_0x2c99('0x1f')][_0x2c99('0x65')]=function(_0x330b78){return!_[_0x2c99('0x66')](_0x330b78)&&!_['isNil'](_0x330b78[_0x2c99('0x25')])&&!_['isNil'](_0x330b78[_0x2c99('0x67')])&&_0x330b78[_0x2c99('0x67')]&&!_['isNil'](this[_0x2c99('0xd')][util[_0x2c99('0x5e')](_0x2c99('0x68'),_0x330b78[_0x2c99('0x25')])])&&!_['isNil'](this[_0x2c99('0xd')][util['format'](_0x2c99('0x68'),_0x330b78[_0x2c99('0x25')])][_0x2c99('0x2d')])&&(this[_0x2c99('0xd')][util[_0x2c99('0x5e')](_0x2c99('0x68'),_0x330b78['name'])][_0x2c99('0x2d')]===_0x2c99('0x69')||this[_0x2c99('0xd')][util[_0x2c99('0x5e')]('SIP/%s',_0x330b78[_0x2c99('0x25')])][_0x2c99('0x2d')]===_0x2c99('0x6a'));};Fax['prototype']['checkTrunk']=function(_0x1e20da,_0x39eed9){if(!this['isTrunkReachable'](_0x1e20da)){ut[_0x2c99('0x48')](_0x2c99('0x6b'),_['isNil'](_0x1e20da)?'':_0x1e20da[_0x2c99('0x25')]+_0x2c99('0x6c'));return{'isValid':![],'message':_0x2c99('0x6d')};}if(_[_0x2c99('0x66')](_0x39eed9[_0x2c99('0x3a')])){ut[_0x2c99('0x48')](_0x2c99('0x6e'),JSON[_0x2c99('0x3e')](_0x39eed9));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x2c99('0x66')](_0x39eed9[_0x2c99('0x5f')])){ut[_0x2c99('0x48')](_0x2c99('0x6f'),JSON[_0x2c99('0x3e')](_0x39eed9));return{'isValid':![],'message':_0x2c99('0x70')};}return{'isValid':!![],'message':_0x2c99('0x71')};};module[_0x2c99('0x72')]=Fax;
\ No newline at end of file
index afffd56..9032390 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x520e=['then','catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','error','inspect','notify','resolve'];(function(_0x522ef1,_0x1ff255){var _0x29aa2c=function(_0x200aa6){while(--_0x200aa6){_0x522ef1['push'](_0x522ef1['shift']());}};_0x29aa2c(++_0x1ff255);}(_0x520e,0x116));var _0xe520=function(_0x5ad190,_0xd39c9e){_0x5ad190=_0x5ad190-0x0;var _0x518ed3=_0x520e[_0x5ad190];return _0x518ed3;};'use strict';var util=require('util');var BPromise=require(_0xe520('0x0'));var logger=require(_0xe520('0x1'))(_0xe520('0x2'));var _=require(_0xe520('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x60a074){return function(_0xc11f4c){logger[_0xe520('0x4')](_0x60a074,util[_0xe520('0x5')](_0xc11f4c,{'showHidden':![],'depth':null}));};}exports[_0xe520('0x6')]=function(_0x4f8237,_0x53dff1){return BPromise[_0xe520('0x7')]()[_0xe520('0x8')](faxAccount[_0xe520('0x6')](_0x4f8237,_0x53dff1))[_0xe520('0x9')](loggerCatch(_0xe520('0xa')));};
\ No newline at end of file
+var _0xa5a8=['error','inspect','resolve','[Notify]\x20','util','../../../config/logger','lodash','../rpc/faxAccount'];(function(_0x2b26c5,_0x547bea){var _0xfc7f7f=function(_0x2280b9){while(--_0x2280b9){_0x2b26c5['push'](_0x2b26c5['shift']());}};_0xfc7f7f(++_0x547bea);}(_0xa5a8,0xbc));var _0x8a5a=function(_0x3a1625,_0x398d59){_0x3a1625=_0x3a1625-0x0;var _0x5adc45=_0xa5a8[_0x3a1625];return _0x5adc45;};'use strict';var util=require(_0x8a5a('0x0'));var BPromise=require('bluebird');var logger=require(_0x8a5a('0x1'))('preview');var _=require(_0x8a5a('0x2'));var faxAccount=require(_0x8a5a('0x3'));function loggerCatch(_0x4c5669){return function(_0x3fc4d2){logger[_0x8a5a('0x4')](_0x4c5669,util[_0x8a5a('0x5')](_0x3fc4d2,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x2f27b4,_0x50089d){return BPromise[_0x8a5a('0x6')]()['then'](faxAccount['notify'](_0x2f27b4,_0x50089d))['catch'](loggerCatch(_0x8a5a('0x7')));};
\ No newline at end of file
index 302ed3e..b6ae601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c8d=['child_process','execute','info','Exec\x20gs','inspect','util','../../../../config/logger','fax','bluebird'];(function(_0x4151ca,_0x473036){var _0x353f3a=function(_0x555312){while(--_0x555312){_0x4151ca['push'](_0x4151ca['shift']());}};_0x353f3a(++_0x473036);}(_0x3c8d,0xb0));var _0xd3c8=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x3c8d[_0x2f3848];return _0x102668;};'use strict';var util=require(_0xd3c8('0x0'));var logger=require(_0xd3c8('0x1'))(_0xd3c8('0x2'));var BPromise=require(_0xd3c8('0x3'));var exec=require(_0xd3c8('0x4'))['exec'];exports[_0xd3c8('0x5')]=function(_0x444c4a){return new BPromise(function(_0x51b229,_0x420575){exec(_0x444c4a,function(_0x184782,_0x399ae4,_0x5345f1){logger[_0xd3c8('0x6')](_0xd3c8('0x7'),_0x399ae4);if(_0x184782){logger[_0xd3c8('0x6')](_0xd3c8('0x7'),'\x20Error\x20:',util[_0xd3c8('0x8')](_0x184782,{'showHidden':![],'depth':null}),_0x399ae4,_0x5345f1);_0x420575(_0x184782);}_0x51b229(_0x399ae4);});});};
\ No newline at end of file
+var _0x1077=['\x20Error\x20:','util','../../../../config/logger','fax','bluebird','execute','info','Exec\x20gs'];(function(_0x4af6c7,_0x10c4fc){var _0x51f285=function(_0x45579c){while(--_0x45579c){_0x4af6c7['push'](_0x4af6c7['shift']());}};_0x51f285(++_0x10c4fc);}(_0x1077,0x1e9));var _0x7107=function(_0x590e43,_0x42b578){_0x590e43=_0x590e43-0x0;var _0x3b3c01=_0x1077[_0x590e43];return _0x3b3c01;};'use strict';var util=require(_0x7107('0x0'));var logger=require(_0x7107('0x1'))(_0x7107('0x2'));var BPromise=require(_0x7107('0x3'));var exec=require('child_process')['exec'];exports[_0x7107('0x4')]=function(_0x288b52){return new BPromise(function(_0x25a775,_0x4c9c7e){exec(_0x288b52,function(_0x551c04,_0x5a6470,_0x15dc09){logger[_0x7107('0x5')](_0x7107('0x6'),_0x5a6470);if(_0x551c04){logger[_0x7107('0x5')]('Exec\x20gs',_0x7107('0x7'),util['inspect'](_0x551c04,{'showHidden':![],'depth':null}),_0x5a6470,_0x15dc09);_0x4c9c7e(_0x551c04);}_0x25a775(_0x5a6470);});});};
\ No newline at end of file
index c6740aa..d98fffd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bec=['format','\x22%s\x22','modem','faxdetect','t38timeout','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','localstationid','util','lodash','moment','../../../../config/logger','message','logger','info','inspect','headerinfo','minrate'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x1bec,0x7a));var _0xc1be=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0x1bec[_0x1dd532];return _0x3732aa;};'use strict';var util=require(_0xc1be('0x0'));var _=require(_0xc1be('0x1'));var moment=require(_0xc1be('0x2'));var logger=require(_0xc1be('0x3'))('fax');exports[_0xc1be('0x4')]=function(_0x55c97f){return{'message':_0x55c97f};};exports[_0xc1be('0x5')]=function(_0x32293a,_0x20cfb3){logger[_0xc1be('0x6')](_0x32293a,util[_0xc1be('0x7')](_0x20cfb3,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x1f4d46,_0x4edaef){var _0x249a44={'XMF-ECM':_0x4edaef['ecm'],'XMF-HEADERINFO':_0x4edaef[_0xc1be('0x8')],'XMF-MINRATE':_0x4edaef[_0xc1be('0x9')],'XMF-MAXRATE':_0x4edaef['maxrate'],'XMF-MODEM':util[_0xc1be('0xa')](_0xc1be('0xb'),_0x4edaef[_0xc1be('0xc')]),'XMF-GATEWAY':_0x4edaef['gateway'],'XMF-FAXDETECT':_0x4edaef[_0xc1be('0xd')],'XMF-T38TIMEOUT':_0x4edaef[_0xc1be('0xe')],'XMF-LOCALSTATIONID':_0x4edaef['localstationid'],'XMF-PATH':_0x1f4d46[_0xc1be('0xf')]};return _0x249a44;};exports['variablesAction']=function(_0x50c2b5,_0x4053ff){return{'actionid':_0x50c2b5[_0xc1be('0x10')],'action':_0xc1be('0x11'),'channel':_0x50c2b5[_0xc1be('0x12')],'Exten':_0xc1be('0x13'),'Context':_0xc1be('0x14'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x50c2b5[_0xc1be('0x8')]?_0x50c2b5['headerinfo']:'',_0x50c2b5[_0xc1be('0x15')]),'variable':_0x4053ff,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x50c2b5[_0xc1be('0x10')]};};
\ No newline at end of file
+var _0xf9d4=['\x22%s\x22\x20<%s>','localstationid','lodash','moment','../../../../config/logger','fax','message','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','gateway','faxdetect','t38timeout','path','uniqueid','originate','channel','xcally-motion-fax','from-sip'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf9d4,0x98));var _0x4f9d=function(_0x331b98,_0x2fc737){_0x331b98=_0x331b98-0x0;var _0x3480e3=_0xf9d4[_0x331b98];return _0x3480e3;};'use strict';var util=require('util');var _=require(_0x4f9d('0x0'));var moment=require(_0x4f9d('0x1'));var logger=require(_0x4f9d('0x2'))(_0x4f9d('0x3'));exports[_0x4f9d('0x4')]=function(_0x3d1dcd){return{'message':_0x3d1dcd};};exports[_0x4f9d('0x5')]=function(_0x37c9b9,_0x30b8fd){logger['info'](_0x37c9b9,util[_0x4f9d('0x6')](_0x30b8fd,{'showHidden':![],'depth':null}));};exports[_0x4f9d('0x7')]=function(_0x46ddf0,_0x3ac1af){var _0x527e84={'XMF-ECM':_0x3ac1af[_0x4f9d('0x8')],'XMF-HEADERINFO':_0x3ac1af[_0x4f9d('0x9')],'XMF-MINRATE':_0x3ac1af[_0x4f9d('0xa')],'XMF-MAXRATE':_0x3ac1af[_0x4f9d('0xb')],'XMF-MODEM':util[_0x4f9d('0xc')]('\x22%s\x22',_0x3ac1af[_0x4f9d('0xd')]),'XMF-GATEWAY':_0x3ac1af[_0x4f9d('0xe')],'XMF-FAXDETECT':_0x3ac1af[_0x4f9d('0xf')],'XMF-T38TIMEOUT':_0x3ac1af[_0x4f9d('0x10')],'XMF-LOCALSTATIONID':_0x3ac1af['localstationid'],'XMF-PATH':_0x46ddf0[_0x4f9d('0x11')]};return _0x527e84;};exports['variablesAction']=function(_0x49ce32,_0x1c1752){return{'actionid':_0x49ce32[_0x4f9d('0x12')],'action':_0x4f9d('0x13'),'channel':_0x49ce32[_0x4f9d('0x14')],'Exten':_0x4f9d('0x15'),'Context':_0x4f9d('0x16'),'Priority':'1','callerid':util[_0x4f9d('0xc')](_0x4f9d('0x17'),_0x49ce32['headerinfo']?_0x49ce32['headerinfo']:'',_0x49ce32[_0x4f9d('0x18')]),'variable':_0x1c1752,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x49ce32[_0x4f9d('0x12')]};};
\ No newline at end of file
index 6286eed..6e6a8cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bf3=['sync','log','bluebird','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch'];(function(_0x39dcec,_0x4c9c56){var _0xb98bd8=function(_0x305205){while(--_0x305205){_0x39dcec['push'](_0x39dcec['shift']());}};_0xb98bd8(++_0x4c9c56);}(_0x2bf3,0x194));var _0x32bf=function(_0x4af0b0,_0xe95cab){_0x4af0b0=_0x4af0b0-0x0;var _0x1a80ac=_0x2bf3[_0x4af0b0];return _0x1a80ac;};'use strict';var BPromise=require(_0x32bf('0x0'));var util=require(_0x32bf('0x1'));var moment=require(_0x32bf('0x2'));var server=require(_0x32bf('0x3'));var Realtime=require(_0x32bf('0x4'));var Report=require(_0x32bf('0x5'));var Acw=require(_0x32bf('0x6'));var Trigger=require('./trigger');var Dialer=require(_0x32bf('0x7'));var Preview=require(_0x32bf('0x8'));var Fax=require(_0x32bf('0x9'));var user=require(_0x32bf('0xa'));var voiceQueue=require(_0x32bf('0xb'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x32bf('0xc'));var trunk=require('./rpc/trunk');var trigger=require(_0x32bf('0xd'));var template=require(_0x32bf('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x32bf('0xf'));var voiceExtension=require(_0x32bf('0x10'));var faxAccount=require(_0x32bf('0x11'));var zendesk=require(_0x32bf('0x12'));var salesforce=require(_0x32bf('0x13'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x32bf('0x14'));var desk=require(_0x32bf('0x15'));var zoho=require(_0x32bf('0x16'));var vtiger=require(_0x32bf('0x17'));var freshsales=require(_0x32bf('0x18'));var servicenow=require(_0x32bf('0x19'));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()[_0x32bf('0x1a')](_0x32bf('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x32bf('0x1a')](_0x32bf('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x32bf('0x1c')]()[_0x32bf('0x1d')](user['getAgents']())[_0x32bf('0x1d')](realtime[_0x32bf('0x1e')]())[_0x32bf('0x1d')](user[_0x32bf('0x1f')]())[_0x32bf('0x1d')](realtime[_0x32bf('0x20')]())[_0x32bf('0x1d')](trunk[_0x32bf('0x21')]())[_0x32bf('0x1d')](realtime[_0x32bf('0x22')]())[_0x32bf('0x1d')](voiceQueue['getVoiceQueues']())[_0x32bf('0x1d')](realtime[_0x32bf('0x23')]())['then'](trigger['getTriggers']())[_0x32bf('0x1d')](realtime[_0x32bf('0x24')]())['then'](template[_0x32bf('0x25')]())['then'](realtime[_0x32bf('0x26')]())[_0x32bf('0x1d')](zendesk[_0x32bf('0x27')]())[_0x32bf('0x1d')](realtime[_0x32bf('0x28')]())[_0x32bf('0x1d')](salesforce[_0x32bf('0x29')]())['then'](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x32bf('0x2a')]())['then'](realtime[_0x32bf('0x2b')]())[_0x32bf('0x1d')](freshdesk[_0x32bf('0x2c')]())[_0x32bf('0x1d')](realtime[_0x32bf('0x2d')]())[_0x32bf('0x1d')](desk['getDeskAccounts']())[_0x32bf('0x1d')](realtime[_0x32bf('0x2e')]())['then'](zoho['getZohoAccounts']())[_0x32bf('0x1d')](realtime[_0x32bf('0x2f')]())['then'](vtiger[_0x32bf('0x30')]())[_0x32bf('0x1d')](realtime['initVtigerAccounts']())['then'](freshsales['getFreshsalesAccounts']())[_0x32bf('0x1d')](realtime['initFreshsalesAccounts']())[_0x32bf('0x1d')](servicenow[_0x32bf('0x31')]())[_0x32bf('0x1d')](realtime[_0x32bf('0x32')]())[_0x32bf('0x1d')](dynamics365[_0x32bf('0x33')]())[_0x32bf('0x1d')](realtime[_0x32bf('0x34')]())[_0x32bf('0x1d')](campaign['getCampaigns']())[_0x32bf('0x1d')](realtime[_0x32bf('0x35')]())['then'](voiceExtension['getVoiceExtensions']())[_0x32bf('0x1d')](realtime[_0x32bf('0x36')]())['then'](faxAccount[_0x32bf('0x37')]())[_0x32bf('0x1d')](realtime[_0x32bf('0x38')]())[_0x32bf('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x32bf('0x1c')]()['then'](voiceQueueReport[_0x32bf('0x39')]())[_0x32bf('0x1d')](realtime[_0x32bf('0x3a')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x32bf('0x3b')]())[_0x32bf('0x1d')](cmHopperHistory[_0x32bf('0x3c')]())[_0x32bf('0x1d')](realtime[_0x32bf('0x3d')]())[_0x32bf('0x1d')](voiceCallReport[_0x32bf('0x3e')]())[_0x32bf('0x1d')](realtime[_0x32bf('0x3f')]())[_0x32bf('0x1d')](function(_0x299c2a){})[_0x32bf('0x40')](function(_0x231f54){console['log'](_0x231f54);});}function main(){return server['listen'](realtime,preview,fax)[_0x32bf('0x1d')](function(_0x17849e){return initRealtime();})[_0x32bf('0x1d')](function(){return initParams();})[_0x32bf('0x1d')](function(){report[_0x32bf('0x41')]();setInterval(initRealtime,0x1388);})[_0x32bf('0x40')](function(_0x4488d4){console[_0x32bf('0x42')](_0x4488d4);});}main();
\ No newline at end of file
+var _0x1ef5=['./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','sync','bluebird','util','moment','./server','./report','./acw','./dialer'];(function(_0x452968,_0x31e391){var _0xb6f9ae=function(_0x263987){while(--_0x263987){_0x452968['push'](_0x452968['shift']());}};_0xb6f9ae(++_0x31e391);}(_0x1ef5,0x1ab));var _0x51ef=function(_0x10d1f9,_0x42aaa8){_0x10d1f9=_0x10d1f9-0x0;var _0x1a1fd2=_0x1ef5[_0x10d1f9];return _0x1a1fd2;};'use strict';var BPromise=require(_0x51ef('0x0'));var util=require(_0x51ef('0x1'));var moment=require(_0x51ef('0x2'));var server=require(_0x51ef('0x3'));var Realtime=require('./realtime');var Report=require(_0x51ef('0x4'));var Acw=require(_0x51ef('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x51ef('0x6'));var Preview=require('./preview');var Fax=require(_0x51ef('0x7'));var user=require(_0x51ef('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x51ef('0x9'));var voiceCallReport=require(_0x51ef('0xa'));var trunk=require(_0x51ef('0xb'));var trigger=require(_0x51ef('0xc'));var template=require(_0x51ef('0xd'));var cmHopperHistory=require(_0x51ef('0xe'));var campaign=require(_0x51ef('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x51ef('0x10'));var desk=require(_0x51ef('0x11'));var zoho=require(_0x51ef('0x12'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x51ef('0x13'));var dynamics365=require(_0x51ef('0x14'));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()[_0x51ef('0x15')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x51ef('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x51ef('0x17')]()[_0x51ef('0x18')](user[_0x51ef('0x19')]())[_0x51ef('0x18')](realtime['initAgents']())[_0x51ef('0x18')](user[_0x51ef('0x1a')]())[_0x51ef('0x18')](realtime['initTelephones']())[_0x51ef('0x18')](trunk[_0x51ef('0x1b')]())[_0x51ef('0x18')](realtime[_0x51ef('0x1c')]())[_0x51ef('0x18')](voiceQueue[_0x51ef('0x1d')]())['then'](realtime[_0x51ef('0x1e')]())[_0x51ef('0x18')](trigger[_0x51ef('0x1f')]())[_0x51ef('0x18')](realtime[_0x51ef('0x20')]())[_0x51ef('0x18')](template[_0x51ef('0x21')]())[_0x51ef('0x18')](realtime[_0x51ef('0x22')]())['then'](zendesk[_0x51ef('0x23')]())[_0x51ef('0x18')](realtime[_0x51ef('0x24')]())[_0x51ef('0x18')](salesforce[_0x51ef('0x25')]())[_0x51ef('0x18')](realtime[_0x51ef('0x26')]())[_0x51ef('0x18')](sugarcrm['getSugarcrmAccounts']())[_0x51ef('0x18')](realtime[_0x51ef('0x27')]())[_0x51ef('0x18')](freshdesk['getFreshdeskAccounts']())[_0x51ef('0x18')](realtime[_0x51ef('0x28')]())[_0x51ef('0x18')](desk[_0x51ef('0x29')]())[_0x51ef('0x18')](realtime[_0x51ef('0x2a')]())['then'](zoho[_0x51ef('0x2b')]())[_0x51ef('0x18')](realtime[_0x51ef('0x2c')]())[_0x51ef('0x18')](vtiger['getVtigerAccounts']())[_0x51ef('0x18')](realtime['initVtigerAccounts']())[_0x51ef('0x18')](freshsales['getFreshsalesAccounts']())[_0x51ef('0x18')](realtime['initFreshsalesAccounts']())['then'](servicenow[_0x51ef('0x2d')]())['then'](realtime['initServicenowAccounts']())[_0x51ef('0x18')](dynamics365[_0x51ef('0x2e')]())[_0x51ef('0x18')](realtime[_0x51ef('0x2f')]())[_0x51ef('0x18')](campaign[_0x51ef('0x30')]())[_0x51ef('0x18')](realtime[_0x51ef('0x31')]())[_0x51ef('0x18')](voiceExtension[_0x51ef('0x32')]())[_0x51ef('0x18')](realtime[_0x51ef('0x33')]())[_0x51ef('0x18')](faxAccount[_0x51ef('0x34')]())[_0x51ef('0x18')](realtime[_0x51ef('0x35')]())[_0x51ef('0x18')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x51ef('0x18')](voiceQueueReport[_0x51ef('0x36')]())['then'](realtime[_0x51ef('0x37')]())[_0x51ef('0x18')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x51ef('0x18')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x51ef('0x38')]())[_0x51ef('0x18')](realtime[_0x51ef('0x39')]())[_0x51ef('0x18')](voiceCallReport[_0x51ef('0x3a')]())[_0x51ef('0x18')](realtime['initVoiceCallReports']())[_0x51ef('0x18')](function(_0x1cf126){})[_0x51ef('0x3b')](function(_0xc3ade8){console[_0x51ef('0x3c')](_0xc3ade8);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x37fa6a){return initRealtime();})[_0x51ef('0x18')](function(){return initParams();})[_0x51ef('0x18')](function(){report[_0x51ef('0x3d')]();setInterval(initRealtime,0x1388);})[_0x51ef('0x3b')](function(_0x5e508e){console[_0x51ef('0x3c')](_0x5e508e);});}main();
\ No newline at end of file
index df682ae..0f00e33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent;
\ No newline at end of file
+var _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x18e3e7,_0x39886c){var _0x211dee=function(_0x1dc34b){while(--_0x1dc34b){_0x18e3e7['push'](_0x18e3e7['shift']());}};_0x211dee(++_0x39886c);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent;
\ No newline at end of file
index d60139c..4d6981c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x526a=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','active'];(function(_0x4a7151,_0xf0fc74){var _0x1fb3b9=function(_0x4df943){while(--_0x4df943){_0x4a7151['push'](_0x4a7151['shift']());}};_0x1fb3b9(++_0xf0fc74);}(_0x526a,0x178));var _0xa526=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x526a[_0x4709c0];return _0x13348b;};'use strict';function Campaign(_0x56a605){this['id']=_0x56a605['id']||0x0;this[_0xa526('0x0')]=_0x56a605['name']||'';this['type']=_0x56a605[_0xa526('0x1')]||_0xa526('0x2');this[_0xa526('0x3')]=0x0;this[_0xa526('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xa526('0x5')]=0x0;this[_0xa526('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0xa526('0x7')]=_0x56a605[_0xa526('0x7')];this['limitCalls']=_0x56a605[_0xa526('0x8')];this[_0xa526('0x9')]=_0x56a605['dialTimezone']||null;this['dialGlobalInterval']=_0x56a605[_0xa526('0xa')]?_0x56a605[_0xa526('0xa')]:null;this[_0xa526('0xb')]=_0x56a605[_0xa526('0xb')];this['dialOriginateCallerIdNumber']=_0x56a605[_0xa526('0xc')];this[_0xa526('0xd')]=_0x56a605[_0xa526('0xd')]||0x1e;this[_0xa526('0xe')]=_0x56a605[_0xa526('0xe')];this[_0xa526('0xf')]=_0x56a605[_0xa526('0xf')];this['dialBusyMaxRetry']=_0x56a605['dialBusyMaxRetry'];this[_0xa526('0x10')]=_0x56a605[_0xa526('0x10')];this[_0xa526('0x11')]=_0x56a605[_0xa526('0x11')];this[_0xa526('0x12')]=_0x56a605[_0xa526('0x12')];this[_0xa526('0x13')]=_0x56a605[_0xa526('0x13')];this[_0xa526('0x14')]=_0x56a605[_0xa526('0x14')]||0x3;this[_0xa526('0x15')]=_0x56a605[_0xa526('0x15')]||0x96;this[_0xa526('0x16')]=_0x56a605[_0xa526('0x16')]||0x3;this['dialDropRetryFrequency']=_0x56a605['dialDropRetryFrequency']||0x96;this[_0xa526('0x17')]=_0x56a605['dialAbandonedMaxRetry']||0x3;this[_0xa526('0x18')]=_0x56a605[_0xa526('0x18')]||0x96;this['dialMachineMaxRetry']=_0x56a605[_0xa526('0x19')]||0x3;this[_0xa526('0x1a')]=_0x56a605[_0xa526('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0x56a605['dialAgentRejectMaxRetry']||0x3;this[_0xa526('0x1b')]=_0x56a605[_0xa526('0x1b')]||0x96;this['dialOrderByScheduledAt']=_0x56a605['dialOrderByScheduledAt']||_0xa526('0x1c');this[_0xa526('0x1d')]=_0x56a605[_0xa526('0x1d')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x56a605[_0xa526('0x1e')]||undefined;this[_0xa526('0x1f')]=_0x56a605[_0xa526('0x1f')]||undefined;this[_0xa526('0x20')]=_0x56a605[_0xa526('0x20')]?_0x56a605[_0xa526('0x20')]:undefined;this['Trunk']=_0x56a605[_0xa526('0x21')]?_0x56a605['Trunk']:undefined;this[_0xa526('0x22')]=_0x56a605[_0xa526('0x22')]?_0x56a605['Interval']:undefined;this[_0xa526('0x23')]=_0x56a605[_0xa526('0x23')]?_0x56a605['SquareProject']:undefined;this[_0xa526('0x24')]=_0x56a605[_0xa526('0x23')]?_0x56a605[_0xa526('0x23')][_0xa526('0x0')]:undefined;this[_0xa526('0x25')]=_0x56a605['dialAMDActive']||![];this[_0xa526('0x26')]=_0x56a605[_0xa526('0x26')];this['dialAMDGreeting']=_0x56a605[_0xa526('0x27')];this[_0xa526('0x28')]=_0x56a605[_0xa526('0x28')];this[_0xa526('0x29')]=_0x56a605[_0xa526('0x29')];this['dialAMDMinWordLength']=_0x56a605[_0xa526('0x2a')];this[_0xa526('0x2b')]=_0x56a605['dialAMDBetweenWordsSilence'];this[_0xa526('0x2c')]=_0x56a605[_0xa526('0x2c')];this[_0xa526('0x2d')]=_0x56a605[_0xa526('0x2d')];this[_0xa526('0x2e')]=_0x56a605[_0xa526('0x2e')];}module[_0xa526('0x2f')]=Campaign;
\ No newline at end of file
+var _0xc947=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0xe63d62,_0x3c94c5){var _0x46065e=function(_0x2d2ca5){while(--_0x2d2ca5){_0xe63d62['push'](_0xe63d62['shift']());}};_0x46065e(++_0x3c94c5);}(_0xc947,0x12a));var _0x7c94=function(_0x5981e5,_0x561f9e){_0x5981e5=_0x5981e5-0x0;var _0x54a0fd=_0xc947[_0x5981e5];return _0x54a0fd;};'use strict';function Campaign(_0x4f6bf4){this['id']=_0x4f6bf4['id']||0x0;this[_0x7c94('0x0')]=_0x4f6bf4['name']||'';this[_0x7c94('0x1')]=_0x4f6bf4['type']||_0x7c94('0x2');this[_0x7c94('0x3')]=0x0;this[_0x7c94('0x4')]=0x0;this[_0x7c94('0x5')]=0x0;this[_0x7c94('0x6')]=0x0;this[_0x7c94('0x7')]='';this[_0x7c94('0x8')]=!![];this[_0x7c94('0x9')]=_0x4f6bf4[_0x7c94('0x9')];this[_0x7c94('0xa')]=_0x4f6bf4[_0x7c94('0xa')];this[_0x7c94('0xb')]=_0x4f6bf4[_0x7c94('0xb')]||null;this[_0x7c94('0xc')]=_0x4f6bf4[_0x7c94('0xc')]?_0x4f6bf4[_0x7c94('0xc')]:null;this[_0x7c94('0xd')]=_0x4f6bf4[_0x7c94('0xd')];this[_0x7c94('0xe')]=_0x4f6bf4[_0x7c94('0xe')];this[_0x7c94('0xf')]=_0x4f6bf4[_0x7c94('0xf')]||0x1e;this[_0x7c94('0x10')]=_0x4f6bf4['dialCongestionMaxRetry'];this[_0x7c94('0x11')]=_0x4f6bf4[_0x7c94('0x11')];this['dialBusyMaxRetry']=_0x4f6bf4[_0x7c94('0x12')];this[_0x7c94('0x13')]=_0x4f6bf4[_0x7c94('0x13')];this[_0x7c94('0x14')]=_0x4f6bf4['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x4f6bf4[_0x7c94('0x15')];this[_0x7c94('0x16')]=_0x4f6bf4['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x4f6bf4['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4f6bf4['dialNoSuchNumberRetryFrequency']||0x96;this[_0x7c94('0x17')]=_0x4f6bf4['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x4f6bf4['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x4f6bf4[_0x7c94('0x18')]||0x3;this[_0x7c94('0x19')]=_0x4f6bf4[_0x7c94('0x19')]||0x96;this[_0x7c94('0x1a')]=_0x4f6bf4[_0x7c94('0x1a')]||0x3;this[_0x7c94('0x1b')]=_0x4f6bf4['dialMachineRetryFrequency']||0x96;this[_0x7c94('0x1c')]=_0x4f6bf4[_0x7c94('0x1c')]||0x3;this[_0x7c94('0x1d')]=_0x4f6bf4[_0x7c94('0x1d')]||0x96;this[_0x7c94('0x1e')]=_0x4f6bf4[_0x7c94('0x1e')]||_0x7c94('0x1f');this[_0x7c94('0x20')]=_0x4f6bf4['dialPrefix']||undefined;this[_0x7c94('0x21')]=_0x4f6bf4[_0x7c94('0x21')]||undefined;this[_0x7c94('0x22')]=_0x4f6bf4[_0x7c94('0x22')]||undefined;this[_0x7c94('0x23')]=_0x4f6bf4[_0x7c94('0x23')]?_0x4f6bf4[_0x7c94('0x23')]:undefined;this[_0x7c94('0x24')]=_0x4f6bf4[_0x7c94('0x24')]?_0x4f6bf4[_0x7c94('0x24')]:undefined;this[_0x7c94('0x25')]=_0x4f6bf4[_0x7c94('0x25')]?_0x4f6bf4['Interval']:undefined;this[_0x7c94('0x26')]=_0x4f6bf4['SquareProject']?_0x4f6bf4[_0x7c94('0x26')]:undefined;this['dialQueueProject']=_0x4f6bf4[_0x7c94('0x26')]?_0x4f6bf4['SquareProject'][_0x7c94('0x0')]:undefined;this['dialAMDActive']=_0x4f6bf4[_0x7c94('0x27')]||![];this[_0x7c94('0x28')]=_0x4f6bf4[_0x7c94('0x28')];this['dialAMDGreeting']=_0x4f6bf4['dialAMDGreeting'];this[_0x7c94('0x29')]=_0x4f6bf4[_0x7c94('0x29')];this[_0x7c94('0x2a')]=_0x4f6bf4[_0x7c94('0x2a')];this[_0x7c94('0x2b')]=_0x4f6bf4[_0x7c94('0x2b')];this[_0x7c94('0x2c')]=_0x4f6bf4[_0x7c94('0x2c')];this[_0x7c94('0x2d')]=_0x4f6bf4[_0x7c94('0x2d')];this[_0x7c94('0x2e')]=_0x4f6bf4[_0x7c94('0x2e')];this[_0x7c94('0x2f')]=_0x4f6bf4[_0x7c94('0x2f')];}module[_0x7c94('0x30')]=Campaign;
\ No newline at end of file
index 18b5123..65bc22b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dd8=['duration','billableseconds','tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','lastapplication','lastdata'];(function(_0x4cbc9d,_0x5471b6){var _0x375b2e=function(_0x5d88be){while(--_0x5d88be){_0x4cbc9d['push'](_0x4cbc9d['shift']());}};_0x375b2e(++_0x5471b6);}(_0x2dd8,0x143));var _0x82dd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2dd8[_0x19e35c];return _0x3e1fe8;};'use strict';function Channel(){this[_0x82dd('0x0')]=null;this[_0x82dd('0x1')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0x82dd('0x2')]='';this[_0x82dd('0x3')]=undefined;this[_0x82dd('0x4')]=undefined;this[_0x82dd('0x5')]=0x0;this[_0x82dd('0x6')]='';this[_0x82dd('0x7')]=0x0;this[_0x82dd('0x8')]=0x0;this['exten']=0x0;this[_0x82dd('0x9')]=![];this[_0x82dd('0xa')]=null;this[_0x82dd('0xb')]=null;this[_0x82dd('0xc')]=![];this['abandoned']=![];this[_0x82dd('0xd')]='';this[_0x82dd('0xe')]='';this[_0x82dd('0xf')]=0x0;this[_0x82dd('0x10')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0x82dd('0x11')]=null;this['disposition']=null;this[_0x82dd('0x12')]=![];this[_0x82dd('0x13')]=null;this[_0x82dd('0x14')]=null;this[_0x82dd('0x15')]=[];this[_0x82dd('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x82dd('0x17')]=undefined;this[_0x82dd('0x18')]=0x0;}module[_0x82dd('0x19')]=Channel;
\ No newline at end of file
+var _0x8cda=['connectedlinename','context','uniqueid','linkedid','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','tag','monitor','monitorFilename','monitors','transfercalleridnum','mohtime','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum'];(function(_0x48cbc1,_0x33694e){var _0x228f2e=function(_0x5fd992){while(--_0x5fd992){_0x48cbc1['push'](_0x48cbc1['shift']());}};_0x228f2e(++_0x33694e);}(_0x8cda,0x1db));var _0xa8cd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8cda[_0x20a584];return _0x4b41a8;};'use strict';function Channel(){this['starttime']=null;this[_0xa8cd('0x0')]='';this[_0xa8cd('0x1')]='';this[_0xa8cd('0x2')]=0x0;this[_0xa8cd('0x3')]='';this[_0xa8cd('0x4')]=undefined;this[_0xa8cd('0x5')]=undefined;this['accountcode']=0x0;this[_0xa8cd('0x6')]='';this[_0xa8cd('0x7')]=0x0;this[_0xa8cd('0x8')]=0x0;this['exten']=0x0;this[_0xa8cd('0x9')]=![];this[_0xa8cd('0xa')]=null;this[_0xa8cd('0xb')]=null;this[_0xa8cd('0xc')]=![];this[_0xa8cd('0xd')]=![];this[_0xa8cd('0xe')]='';this[_0xa8cd('0xf')]='';this[_0xa8cd('0x10')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this['type']=null;this[_0xa8cd('0x11')]=null;this['disposition']=null;this[_0xa8cd('0x12')]=![];this[_0xa8cd('0x13')]=null;this['queue']=null;this[_0xa8cd('0x14')]=[];this[_0xa8cd('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0xa8cd('0x16')]=0x0;}module[_0xa8cd('0x17')]=Channel;
\ No newline at end of file
index b1e5518..6f0c0bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30e8=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x257017,_0x330627){var _0x38536d=function(_0xdf92e){while(--_0xdf92e){_0x257017['push'](_0x257017['shift']());}};_0x38536d(++_0x330627);}(_0x30e8,0x6e));var _0x830e=function(_0xcaf072,_0x4f49dd){_0xcaf072=_0xcaf072-0x0;var _0x446615=_0x30e8[_0xcaf072];return _0x446615;};'use strict';function DeskAccount(_0x1324ab){this['id']=_0x1324ab['id']||0x0;this[_0x830e('0x0')]=_0x1324ab[_0x830e('0x0')]||'';this[_0x830e('0x1')]=_0x1324ab['username']||'';this[_0x830e('0x2')]=_0x1324ab[_0x830e('0x2')]||'';this[_0x830e('0x3')]=_0x1324ab[_0x830e('0x3')]||'';this[_0x830e('0x4')]=_0x1324ab[_0x830e('0x4')]||'';this['consumerKey']=_0x1324ab[_0x830e('0x5')]||'';this[_0x830e('0x6')]=_0x1324ab[_0x830e('0x6')]||'';this['token']=_0x1324ab[_0x830e('0x7')]||'';this[_0x830e('0x8')]=_0x1324ab[_0x830e('0x8')]||'';this[_0x830e('0x9')]=_0x1324ab[_0x830e('0x9')]||'';this[_0x830e('0xa')]=_0x1324ab['serverUrl']||'';this[_0x830e('0xb')]=_0x1324ab[_0x830e('0xb')]||{};}module[_0x830e('0xc')]=DeskAccount;
\ No newline at end of file
+var _0xa012=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x312cd8,_0x426245){var _0x137254=function(_0x3affd3){while(--_0x3affd3){_0x312cd8['push'](_0x312cd8['shift']());}};_0x137254(++_0x426245);}(_0xa012,0xc4));var _0x2a01=function(_0x6cbe6d,_0x37bba3){_0x6cbe6d=_0x6cbe6d-0x0;var _0x25e1c9=_0xa012[_0x6cbe6d];return _0x25e1c9;};'use strict';function DeskAccount(_0xdc9882){this['id']=_0xdc9882['id']||0x0;this[_0x2a01('0x0')]=_0xdc9882[_0x2a01('0x0')]||'';this['username']=_0xdc9882[_0x2a01('0x1')]||'';this[_0x2a01('0x2')]=_0xdc9882[_0x2a01('0x2')]||'';this[_0x2a01('0x3')]=_0xdc9882[_0x2a01('0x3')]||'';this['password']=_0xdc9882[_0x2a01('0x4')]||'';this[_0x2a01('0x5')]=_0xdc9882['consumerKey']||'';this[_0x2a01('0x6')]=_0xdc9882[_0x2a01('0x6')]||'';this['token']=_0xdc9882[_0x2a01('0x7')]||'';this[_0x2a01('0x8')]=_0xdc9882[_0x2a01('0x8')]||'';this[_0x2a01('0x9')]=_0xdc9882['type']||'';this[_0x2a01('0xa')]=_0xdc9882[_0x2a01('0xa')]||'';this[_0x2a01('0xb')]=_0xdc9882[_0x2a01('0xb')]||{};}module[_0x2a01('0xc')]=DeskAccount;
\ No newline at end of file
index 90d6be0..4d9f980 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c00=['serverUrl','Configurations','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4a53e2,_0x13321e){_0x4a53e2=_0x4a53e2-0x0;var _0x3f2d76=_0x9c00[_0x4a53e2];return _0x3f2d76;};'use strict';function Dynamics365Account(_0x1aed38){this['id']=_0x1aed38['id']||0x0;this[_0x09c0('0x0')]=_0x1aed38['name']||'';this['username']=_0x1aed38[_0x09c0('0x1')]||'';this[_0x09c0('0x2')]=_0x1aed38['password']||'';this[_0x09c0('0x3')]=_0x1aed38[_0x09c0('0x3')]||'';this[_0x09c0('0x4')]=_0x1aed38[_0x09c0('0x4')]||'';this[_0x09c0('0x5')]=_0x1aed38['clientId']||'';this['clientSecret']=_0x1aed38[_0x09c0('0x6')]||{};this[_0x09c0('0x7')]=_0x1aed38[_0x09c0('0x7')]||'';this[_0x09c0('0x8')]=_0x1aed38[_0x09c0('0x8')]||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
+var _0x2750=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x215cba,_0x242e65){var _0x372a2e=function(_0x23bb1c){while(--_0x23bb1c){_0x215cba['push'](_0x215cba['shift']());}};_0x372a2e(++_0x242e65);}(_0x2750,0x13b));var _0x0275=function(_0x183a9f,_0x1400de){_0x183a9f=_0x183a9f-0x0;var _0xd69b98=_0x2750[_0x183a9f];return _0xd69b98;};'use strict';function Dynamics365Account(_0x1c9f4d){this['id']=_0x1c9f4d['id']||0x0;this['name']=_0x1c9f4d[_0x0275('0x0')]||'';this[_0x0275('0x1')]=_0x1c9f4d[_0x0275('0x1')]||'';this[_0x0275('0x2')]=_0x1c9f4d[_0x0275('0x2')]||'';this[_0x0275('0x3')]=_0x1c9f4d[_0x0275('0x3')]||'';this[_0x0275('0x4')]=_0x1c9f4d[_0x0275('0x4')]||'';this[_0x0275('0x5')]=_0x1c9f4d['clientId']||'';this[_0x0275('0x6')]=_0x1c9f4d[_0x0275('0x6')]||{};this[_0x0275('0x7')]=_0x1c9f4d[_0x0275('0x7')]||'';this['Configurations']=_0x1c9f4d[_0x0275('0x8')]||{};}module[_0x0275('0x9')]=Dynamics365Account;
\ No newline at end of file
index a0c56d3..1d18911 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x218f=['tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x4606d8,_0x3a3702){var _0x5e85cf=function(_0x1d9da2){while(--_0x1d9da2){_0x4606d8['push'](_0x4606d8['shift']());}};_0x5e85cf(++_0x3a3702);}(_0x218f,0xe3));var _0xf218=function(_0x5a00cb,_0x28a939){_0x5a00cb=_0x5a00cb-0x0;var _0x3ca981=_0x218f[_0x5a00cb];return _0x3ca981;};'use strict';function FaxAccount(_0x43433f){this['id']=_0x43433f['id']||0x0;this[_0xf218('0x0')]=_0x43433f[_0xf218('0x0')]||'';this['description']=_0x43433f[_0xf218('0x1')];this[_0xf218('0x2')]=_0x43433f[_0xf218('0x2')];this[_0xf218('0x3')]=_0x43433f[_0xf218('0x3')];this[_0xf218('0x4')]=_0x43433f['localstationid'];this[_0xf218('0x5')]=_0x43433f[_0xf218('0x5')]||0x960;this[_0xf218('0x6')]=_0x43433f['maxrate']||0x3840;this[_0xf218('0x7')]=_0x43433f['modem']||_0xf218('0x8');this[_0xf218('0x9')]=_0x43433f['gateway']||'no';this['faxdetect']=_0x43433f[_0xf218('0xa')]||'no';this['t38timeout']=_0x43433f['t38timeout']||0x1388;this[_0xf218('0xb')]=_0x43433f['tech']||_0xf218('0xc');this[_0xf218('0xd')]=_0x43433f['Trunk']?_0x43433f[_0xf218('0xd')]:undefined;this['ListId']=_0x43433f[_0xf218('0xe')];this['key']=_0x43433f[_0xf218('0xf')];}module[_0xf218('0x10')]=FaxAccount;
\ No newline at end of file
+var _0xceef=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x1f426a,_0xbc24ff){var _0x77e8f3=function(_0x1e624e){while(--_0x1e624e){_0x1f426a['push'](_0x1f426a['shift']());}};_0x77e8f3(++_0xbc24ff);}(_0xceef,0x107));var _0xfcee=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0xceef[_0x3a8db5];return _0x2c03cd;};'use strict';function FaxAccount(_0x28405f){this['id']=_0x28405f['id']||0x0;this[_0xfcee('0x0')]=_0x28405f[_0xfcee('0x0')]||'';this[_0xfcee('0x1')]=_0x28405f[_0xfcee('0x1')];this['ecm']=_0x28405f['ecm'];this['headerinfo']=_0x28405f['headerinfo'];this['localstationid']=_0x28405f[_0xfcee('0x2')];this[_0xfcee('0x3')]=_0x28405f['minrate']||0x960;this['maxrate']=_0x28405f[_0xfcee('0x4')]||0x3840;this[_0xfcee('0x5')]=_0x28405f[_0xfcee('0x5')]||_0xfcee('0x6');this[_0xfcee('0x7')]=_0x28405f['gateway']||'no';this[_0xfcee('0x8')]=_0x28405f['faxdetect']||'no';this['t38timeout']=_0x28405f[_0xfcee('0x9')]||0x1388;this[_0xfcee('0xa')]=_0x28405f[_0xfcee('0xa')]||_0xfcee('0xb');this[_0xfcee('0xc')]=_0x28405f[_0xfcee('0xc')]?_0x28405f[_0xfcee('0xc')]:undefined;this[_0xfcee('0xd')]=_0x28405f[_0xfcee('0xd')];this[_0xfcee('0xe')]=_0x28405f[_0xfcee('0xe')];}module[_0xfcee('0xf')]=FaxAccount;
\ No newline at end of file
index cd774d1..cde6118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cad=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xbbf797,_0x3b9352){var _0xb96834=function(_0x409546){while(--_0x409546){_0xbbf797['push'](_0xbbf797['shift']());}};_0xb96834(++_0x3b9352);}(_0x9cad,0x17f));var _0xd9ca=function(_0x26efac,_0x21ab8a){_0x26efac=_0x26efac-0x0;var _0x8482e4=_0x9cad[_0x26efac];return _0x8482e4;};'use strict';function FreshdeskAccount(_0x1d6a02){this['id']=_0x1d6a02['id']||0x0;this[_0xd9ca('0x0')]=_0x1d6a02[_0xd9ca('0x0')]||'';this['username']=_0x1d6a02[_0xd9ca('0x1')]||'';this['apiKey']=_0x1d6a02[_0xd9ca('0x2')]||'';this['remoteUri']=_0x1d6a02[_0xd9ca('0x3')]||'';this[_0xd9ca('0x4')]=_0x1d6a02[_0xd9ca('0x4')]||'';this[_0xd9ca('0x5')]=_0x1d6a02[_0xd9ca('0x5')]||{};}module[_0xd9ca('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0xf5d5=['exports','name','username','apiKey','token','remoteUri','Configurations'];(function(_0x1c0781,_0x4a19f1){var _0x1f577e=function(_0x396577){while(--_0x396577){_0x1c0781['push'](_0x1c0781['shift']());}};_0x1f577e(++_0x4a19f1);}(_0xf5d5,0x78));var _0x5f5d=function(_0x55e0f7,_0x2d49c7){_0x55e0f7=_0x55e0f7-0x0;var _0x2f0aed=_0xf5d5[_0x55e0f7];return _0x2f0aed;};'use strict';function FreshdeskAccount(_0x277f18){this['id']=_0x277f18['id']||0x0;this[_0x5f5d('0x0')]=_0x277f18[_0x5f5d('0x0')]||'';this['username']=_0x277f18[_0x5f5d('0x1')]||'';this[_0x5f5d('0x2')]=_0x277f18[_0x5f5d('0x3')]||'';this[_0x5f5d('0x4')]=_0x277f18[_0x5f5d('0x4')]||'';this['serverUrl']=_0x277f18['serverUrl']||'';this[_0x5f5d('0x5')]=_0x277f18[_0x5f5d('0x5')]||{};}module[_0x5f5d('0x6')]=FreshdeskAccount;
\ No newline at end of file
index 9580801..f4c2eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4986=['token','remoteUri','serverUrl','Configurations','exports','name','apiKey'];(function(_0x4250d7,_0x244484){var _0x1aabec=function(_0x593efc){while(--_0x593efc){_0x4250d7['push'](_0x4250d7['shift']());}};_0x1aabec(++_0x244484);}(_0x4986,0x6e));var _0x6498=function(_0x5ae7db,_0x24034d){_0x5ae7db=_0x5ae7db-0x0;var _0x3912c3=_0x4986[_0x5ae7db];return _0x3912c3;};'use strict';function FreshsalesAccount(_0x5e3825){this['id']=_0x5e3825['id']||0x0;this[_0x6498('0x0')]=_0x5e3825[_0x6498('0x0')]||'';this['username']=_0x5e3825['username']||'';this[_0x6498('0x1')]=_0x5e3825[_0x6498('0x2')]||'';this['remoteUri']=_0x5e3825[_0x6498('0x3')]||'';this[_0x6498('0x4')]=_0x5e3825[_0x6498('0x4')]||'';this[_0x6498('0x5')]=_0x5e3825[_0x6498('0x5')]||{};}module[_0x6498('0x6')]=FreshsalesAccount;
\ No newline at end of file
+var _0x8098=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8098,0x1ba));var _0x8809=function(_0x5c56ac,_0x351987){_0x5c56ac=_0x5c56ac-0x0;var _0x1334d0=_0x8098[_0x5c56ac];return _0x1334d0;};'use strict';function FreshsalesAccount(_0x13f993){this['id']=_0x13f993['id']||0x0;this['name']=_0x13f993[_0x8809('0x0')]||'';this[_0x8809('0x1')]=_0x13f993[_0x8809('0x1')]||'';this[_0x8809('0x2')]=_0x13f993[_0x8809('0x3')]||'';this['remoteUri']=_0x13f993[_0x8809('0x4')]||'';this[_0x8809('0x5')]=_0x13f993[_0x8809('0x5')]||'';this[_0x8809('0x6')]=_0x13f993['Configurations']||{};}module[_0x8809('0x7')]=FreshsalesAccount;
\ No newline at end of file
index 110961e..5134fbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc61a=['accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','channel'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xc61a,0x11e));var _0xac61=function(_0x2b5587,_0x2de0c0){_0x2b5587=_0x2b5587-0x0;var _0x317e3a=_0xc61a[_0x2b5587];return _0x317e3a;};'use strict';function QueueReport(){this[_0xac61('0x0')]=_0xac61('0x1');this[_0xac61('0x2')]='';this[_0xac61('0x3')]='';this[_0xac61('0x4')]='';this[_0xac61('0x5')]='';this[_0xac61('0x6')]=null;this['queuecallerleaveAt']=null;this[_0xac61('0x7')]=0x1;this[_0xac61('0x8')]=0x1;this[_0xac61('0x9')]=![];this[_0xac61('0xa')]=null;this[_0xac61('0xb')]=![];this[_0xac61('0xc')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this['originalposition']=0x1;this[_0xac61('0xd')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0xac61('0xe')]='';this[_0xac61('0xf')]='';this[_0xac61('0x10')]='';this[_0xac61('0x11')]='';this[_0xac61('0x12')]=0x0;this[_0xac61('0x13')]=![];this[_0xac61('0x14')]='';this[_0xac61('0x15')]=_0xac61('0x16');this[_0xac61('0x17')]=0x0;this['variables']={};}module[_0xac61('0x18')]=QueueReport;
\ No newline at end of file
+var _0x1ff7=['type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','context','holdtime','assigned','motionChannel','voice','mohtime','variables','exports'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x1ff7,0x68));var _0x71ff=function(_0x2bbfe8,_0x77cac5){_0x2bbfe8=_0x2bbfe8-0x0;var _0x206e2e=_0x1ff7[_0x2bbfe8];return _0x206e2e;};'use strict';function QueueReport(){this[_0x71ff('0x0')]=_0x71ff('0x1');this[_0x71ff('0x2')]='';this[_0x71ff('0x3')]='';this[_0x71ff('0x4')]='';this[_0x71ff('0x5')]='';this[_0x71ff('0x6')]=null;this[_0x71ff('0x7')]=null;this[_0x71ff('0x8')]=0x1;this[_0x71ff('0x9')]=0x1;this[_0x71ff('0xa')]=![];this[_0x71ff('0xb')]=null;this[_0x71ff('0xc')]=![];this[_0x71ff('0xd')]=null;this['queuecallerexit']=![];this[_0x71ff('0xe')]=null;this[_0x71ff('0xf')]=0x1;this[_0x71ff('0x10')]='';this[_0x71ff('0x11')]='';this['connectedlinename']='';this['accountcode']='';this[_0x71ff('0x12')]='';this['exten']='';this['priority']='';this[_0x71ff('0x13')]=0x0;this[_0x71ff('0x14')]=![];this['lastAssignedTo']='';this[_0x71ff('0x15')]=_0x71ff('0x16');this[_0x71ff('0x17')]=0x0;this[_0x71ff('0x18')]={};}module[_0x71ff('0x19')]=QueueReport;
\ No newline at end of file
index f059d75..760f315 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ff9=['name','username','remoteUri','clientId','clientSecret','securityToken','type','Configurations','exports'];(function(_0x26caf4,_0x20929d){var _0x3b06d6=function(_0x3cd254){while(--_0x3cd254){_0x26caf4['push'](_0x26caf4['shift']());}};_0x3b06d6(++_0x20929d);}(_0x4ff9,0xe1));var _0x94ff=function(_0x38a96b,_0x4c9309){_0x38a96b=_0x38a96b-0x0;var _0x43a16d=_0x4ff9[_0x38a96b];return _0x43a16d;};'use strict';function SalesforceAccount(_0x5824c8){this['id']=_0x5824c8['id']||0x0;this[_0x94ff('0x0')]=_0x5824c8[_0x94ff('0x0')]||'';this['username']=_0x5824c8[_0x94ff('0x1')]||'';this[_0x94ff('0x2')]=_0x5824c8[_0x94ff('0x2')]||'';this['password']=_0x5824c8['password']||'';this['clientId']=_0x5824c8[_0x94ff('0x3')]||'';this[_0x94ff('0x4')]=_0x5824c8[_0x94ff('0x4')]||'';this['securityToken']=_0x5824c8[_0x94ff('0x5')]||'';this[_0x94ff('0x6')]=_0x5824c8['type']||'integrationTab';this['serverUrl']=_0x5824c8['serverUrl']||'';this[_0x94ff('0x7')]=_0x5824c8['Configurations']||{};}module[_0x94ff('0x8')]=SalesforceAccount;
\ No newline at end of file
+var _0x2a23=['username','remoteUri','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name'];(function(_0xb875ee,_0x583042){var _0x4c7f3a=function(_0x1f6661){while(--_0x1f6661){_0xb875ee['push'](_0xb875ee['shift']());}};_0x4c7f3a(++_0x583042);}(_0x2a23,0x8b));var _0x32a2=function(_0x3831cd,_0xeb549c){_0x3831cd=_0x3831cd-0x0;var _0x2fb23f=_0x2a23[_0x3831cd];return _0x2fb23f;};'use strict';function SalesforceAccount(_0x2d1a6a){this['id']=_0x2d1a6a['id']||0x0;this['name']=_0x2d1a6a[_0x32a2('0x0')]||'';this[_0x32a2('0x1')]=_0x2d1a6a['username']||'';this[_0x32a2('0x2')]=_0x2d1a6a['remoteUri']||'';this['password']=_0x2d1a6a['password']||'';this['clientId']=_0x2d1a6a[_0x32a2('0x3')]||'';this[_0x32a2('0x4')]=_0x2d1a6a[_0x32a2('0x4')]||'';this[_0x32a2('0x5')]=_0x2d1a6a[_0x32a2('0x5')]||'';this[_0x32a2('0x6')]=_0x2d1a6a[_0x32a2('0x6')]||'integrationTab';this[_0x32a2('0x7')]=_0x2d1a6a['serverUrl']||'';this[_0x32a2('0x8')]=_0x2d1a6a[_0x32a2('0x8')]||{};}module[_0x32a2('0x9')]=SalesforceAccount;
\ No newline at end of file
index 88ab8bd..a3b6b70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a28=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x5b33be,_0x20b6e7){var _0x1497f4=function(_0x1e5014){while(--_0x1e5014){_0x5b33be['push'](_0x5b33be['shift']());}};_0x1497f4(++_0x20b6e7);}(_0x8a28,0x1d2));var _0x88a2=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x8a28[_0x37bd26];return _0xe83dc4;};'use strict';function ServicenowAccount(_0x456c6a){this['id']=_0x456c6a['id']||0x0;this['name']=_0x456c6a[_0x88a2('0x0')]||'';this[_0x88a2('0x1')]=_0x456c6a['username']||'';this[_0x88a2('0x2')]=_0x456c6a[_0x88a2('0x2')]||'';this[_0x88a2('0x3')]=_0x456c6a[_0x88a2('0x3')]||'';this[_0x88a2('0x4')]=_0x456c6a['serverUrl']||'';this[_0x88a2('0x5')]=_0x456c6a[_0x88a2('0x5')]||{};}module[_0x88a2('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0xf01e=['remoteUri','serverUrl','Configurations','exports','username','password'];(function(_0x48e01b,_0xadf6cd){var _0x16a2d9=function(_0x4a3dae){while(--_0x4a3dae){_0x48e01b['push'](_0x48e01b['shift']());}};_0x16a2d9(++_0xadf6cd);}(_0xf01e,0x1de));var _0xef01=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0xf01e[_0x256d6a];return _0x460058;};'use strict';function ServicenowAccount(_0xb9aa77){this['id']=_0xb9aa77['id']||0x0;this['name']=_0xb9aa77['name']||'';this[_0xef01('0x0')]=_0xb9aa77[_0xef01('0x0')]||'';this['password']=_0xb9aa77[_0xef01('0x1')]||'';this[_0xef01('0x2')]=_0xb9aa77[_0xef01('0x2')]||'';this[_0xef01('0x3')]=_0xb9aa77[_0xef01('0x3')]||'';this[_0xef01('0x4')]=_0xb9aa77['Configurations']||{};}module[_0xef01('0x5')]=ServicenowAccount;
\ No newline at end of file
index 8ad50bd..f7954ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba59=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x3a628b,_0x1d6307){var _0x27d01d=function(_0x24273d){while(--_0x24273d){_0x3a628b['push'](_0x3a628b['shift']());}};_0x27d01d(++_0x1d6307);}(_0xba59,0x1a8));var _0x9ba5=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0xba59[_0x23c73d];return _0x36ba47;};'use strict';function SugarcrmAccount(_0x4d4ce7){this['id']=_0x4d4ce7['id']||0x0;this['name']=_0x4d4ce7[_0x9ba5('0x0')]||'';this[_0x9ba5('0x1')]=_0x4d4ce7['username']||'';this[_0x9ba5('0x2')]=_0x4d4ce7[_0x9ba5('0x2')]||'';this['remoteUri']=_0x4d4ce7[_0x9ba5('0x3')]||'';this['serverUrl']=_0x4d4ce7[_0x9ba5('0x4')]||'';this[_0x9ba5('0x5')]=_0x4d4ce7[_0x9ba5('0x5')]||{};}module[_0x9ba5('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0x7bed=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x524332,_0x1555cf){var _0x4acb91=function(_0x1c4b14){while(--_0x1c4b14){_0x524332['push'](_0x524332['shift']());}};_0x4acb91(++_0x1555cf);}(_0x7bed,0x1e8));var _0xd7be=function(_0x237508,_0x44c7fd){_0x237508=_0x237508-0x0;var _0x1039fe=_0x7bed[_0x237508];return _0x1039fe;};'use strict';function SugarcrmAccount(_0x2f639f){this['id']=_0x2f639f['id']||0x0;this[_0xd7be('0x0')]=_0x2f639f[_0xd7be('0x0')]||'';this[_0xd7be('0x1')]=_0x2f639f[_0xd7be('0x1')]||'';this[_0xd7be('0x2')]=_0x2f639f['password']||'';this[_0xd7be('0x3')]=_0x2f639f['remoteUri']||'';this[_0xd7be('0x4')]=_0x2f639f[_0xd7be('0x4')]||'';this[_0xd7be('0x5')]=_0x2f639f[_0xd7be('0x5')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
index 47e6093..291f4cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e64=['name','accountcode','state','unknown','stateTime','status','address'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x4e64,0x165));var _0x44e6=function(_0x5b8a39,_0x18eb9c){_0x5b8a39=_0x5b8a39-0x0;var _0x12394d=_0x4e64[_0x5b8a39];return _0x12394d;};'use strict';function Telephone(_0x4d3229){this['id']=_0x4d3229['id']||0x0;this['name']=_0x4d3229[_0x44e6('0x0')]||'';this[_0x44e6('0x1')]=_0x4d3229[_0x44e6('0x1')]||'';this[_0x44e6('0x2')]=_0x44e6('0x3');this[_0x44e6('0x4')]=0x0;this[_0x44e6('0x5')]='unknown';this[_0x44e6('0x6')]='';}module['exports']=Telephone;
\ No newline at end of file
+var _0x2aa2=['status','unknown','name','accountcode','stateTime'];(function(_0x2233bc,_0x5241fe){var _0x8e4746=function(_0x4d65da){while(--_0x4d65da){_0x2233bc['push'](_0x2233bc['shift']());}};_0x8e4746(++_0x5241fe);}(_0x2aa2,0x75));var _0x22aa=function(_0x29d357,_0x13e097){_0x29d357=_0x29d357-0x0;var _0x5ba6ae=_0x2aa2[_0x29d357];return _0x5ba6ae;};'use strict';function Telephone(_0x59ba7b){this['id']=_0x59ba7b['id']||0x0;this[_0x22aa('0x0')]=_0x59ba7b[_0x22aa('0x0')]||'';this[_0x22aa('0x1')]=_0x59ba7b[_0x22aa('0x1')]||'';this['state']='unknown';this[_0x22aa('0x2')]=0x0;this[_0x22aa('0x3')]=_0x22aa('0x4');this['address']='';}module['exports']=Telephone;
\ No newline at end of file
index 0d54fb6..3754978 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x1e2a51,_0x511875){var _0x2a6db7=function(_0x120d0f){while(--_0x120d0f){_0x1e2a51['push'](_0x1e2a51['shift']());}};_0x2a6db7(++_0x511875);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x152e9a,_0x2fa62e){var _0x195f51=function(_0x27c631){while(--_0x27c631){_0x152e9a['push'](_0x152e9a['shift']());}};_0x195f51(++_0x2fa62e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 4ba1050..ae0d7b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x4c8358,_0x4c889d){var _0x2bcd2d=function(_0x12de12){while(--_0x12de12){_0x4c8358['push'](_0x4c8358['shift']());}};_0x2bcd2d(++_0x4c889d);}(_0xda2d,0x102));var _0xdda2=function(_0x4fad9c,_0x332073){_0x4fad9c=_0x4fad9c-0x0;var _0x4174f8=_0xda2d[_0x4fad9c];return _0x4174f8;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger;
\ No newline at end of file
+var _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x4ffc9b,_0x2d549a){var _0x680ee=function(_0x1f835c){while(--_0x1f835c){_0x4ffc9b['push'](_0x4ffc9b['shift']());}};_0x680ee(++_0x2d549a);}(_0x14a0,0x8e));var _0x014a=function(_0x2ae219,_0x5ae8a1){_0x2ae219=_0x2ae219-0x0;var _0x3855eb=_0x14a0[_0x2ae219];return _0x3855eb;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger;
\ No newline at end of file
index e7306d7..6d9ba3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8003=['refresh','stateRegistry','address','defaultuser','exports','active','name','unknown','stateTime','indexOf','registry','split','host','port','domain','domainport'];(function(_0x6f4e96,_0x296366){var _0x4edc79=function(_0x5d8cfb){while(--_0x5d8cfb){_0x6f4e96['push'](_0x6f4e96['shift']());}};_0x4edc79(++_0x296366);}(_0x8003,0x1e5));var _0x3800=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x8003[_0x133277];return _0x5b4a22;};'use strict';function Trunk(_0x417bd6){this['id']=_0x417bd6['id']||0x0;this[_0x3800('0x0')]=_0x417bd6[_0x3800('0x0')]||![];this[_0x3800('0x1')]=_0x417bd6['name']||'';this['state']=_0x3800('0x2');this[_0x3800('0x3')]=0x0;this['status']=_0x3800('0x2');this['registry']=_0x417bd6['registry']&&_0x417bd6['registry'][_0x3800('0x4')](':')?_0x417bd6[_0x3800('0x5')][_0x3800('0x6')](':')[0x0]:'';this[_0x3800('0x7')]='';this[_0x3800('0x8')]='';this[_0x3800('0x9')]='';this[_0x3800('0xa')]='';this[_0x3800('0xb')]='';this[_0x3800('0xc')]=_0x3800('0x2');this['registrationtime']='';this[_0x3800('0xd')]='';this[_0x3800('0xe')]=_0x417bd6[_0x3800('0xe')]||'';}module[_0x3800('0xf')]=Trunk;
\ No newline at end of file
+var _0xf9b1=['indexOf','split','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','stateTime','status','unknown','registry'];(function(_0x454115,_0x445349){var _0x538e12=function(_0xf8863d){while(--_0xf8863d){_0x454115['push'](_0x454115['shift']());}};_0x538e12(++_0x445349);}(_0xf9b1,0x1f1));var _0x1f9b=function(_0x4c995d,_0x5d4844){_0x4c995d=_0x4c995d-0x0;var _0xae6874=_0xf9b1[_0x4c995d];return _0xae6874;};'use strict';function Trunk(_0x897f7e){this['id']=_0x897f7e['id']||0x0;this[_0x1f9b('0x0')]=_0x897f7e['active']||![];this[_0x1f9b('0x1')]=_0x897f7e[_0x1f9b('0x1')]||'';this[_0x1f9b('0x2')]='unknown';this[_0x1f9b('0x3')]=0x0;this[_0x1f9b('0x4')]=_0x1f9b('0x5');this[_0x1f9b('0x6')]=_0x897f7e[_0x1f9b('0x6')]&&_0x897f7e[_0x1f9b('0x6')][_0x1f9b('0x7')](':')?_0x897f7e['registry'][_0x1f9b('0x8')](':')[0x0]:'';this['host']='';this[_0x1f9b('0x9')]='';this[_0x1f9b('0xa')]='';this[_0x1f9b('0xb')]='';this[_0x1f9b('0xc')]='';this[_0x1f9b('0xd')]='unknown';this[_0x1f9b('0xe')]='';this[_0x1f9b('0xf')]='';this['defaultuser']=_0x897f7e[_0x1f9b('0x10')]||'';}module[_0x1f9b('0x11')]=Trunk;
\ No newline at end of file
index 67a71fe..bc5ff61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x793d=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x6aa13f,_0x307474){var _0x5e2413=function(_0x2016d3){while(--_0x2016d3){_0x6aa13f['push'](_0x6aa13f['shift']());}};_0x5e2413(++_0x307474);}(_0x793d,0x13f));var _0xd793=function(_0x1e1117,_0x3e264d){_0x1e1117=_0x1e1117-0x0;var _0x852bc6=_0x793d[_0x1e1117];return _0x852bc6;};'use strict';function voiceExtension(_0x296045){this['id']=_0x296045['id']||0x0;this[_0xd793('0x0')]=_0x296045[_0xd793('0x0')]||'';this['recordingFormat']=_0x296045[_0xd793('0x1')]||_0xd793('0x2');this[_0xd793('0x3')]=_0x296045[_0xd793('0x3')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0x005e=['recordingFormat','none','mandatoryDisposition','exten'];(function(_0x54a154,_0x1e6a06){var _0x25d7ca=function(_0x14aa1b){while(--_0x14aa1b){_0x54a154['push'](_0x54a154['shift']());}};_0x25d7ca(++_0x1e6a06);}(_0x005e,0xb3));var _0xe005=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x005e[_0xd0b415];return _0x2bdf2c;};'use strict';function voiceExtension(_0xd1e3c8){this['id']=_0xd1e3c8['id']||0x0;this[_0xe005('0x0')]=_0xd1e3c8[_0xe005('0x0')]||'';this[_0xe005('0x1')]=_0xd1e3c8['recordingFormat']||_0xe005('0x2');this[_0xe005('0x3')]=_0xd1e3c8['mandatoryDisposition']||![];}module['exports']=voiceExtension;
\ No newline at end of file
index 096e99b..6de13f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e5b=['dialPrefix','Interval','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup'];(function(_0x47dfd6,_0x2a2d26){var _0x5e8634=function(_0xfaad58){while(--_0xfaad58){_0x47dfd6['push'](_0x47dfd6['shift']());}};_0x5e8634(++_0x2a2d26);}(_0x7e5b,0x9f));var _0xb7e5=function(_0x32bc40,_0x177988){_0x32bc40=_0x32bc40-0x0;var _0x463ccc=_0x7e5b[_0x32bc40];return _0x463ccc;};'use strict';var statusDesc=[_0xb7e5('0x0'),_0xb7e5('0x1'),_0xb7e5('0x2'),_0xb7e5('0x3'),_0xb7e5('0x4'),_0xb7e5('0x5'),_0xb7e5('0x6'),_0xb7e5('0x7'),_0xb7e5('0x8')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0xb7e5('0x9')};var strategy={'rrmemory':_0xb7e5('0xa'),'roundrobin':_0xb7e5('0xb')};function VoiceQueue(_0x38e169){this['id']=_0x38e169['id']||0x0;this['name']=_0x38e169[_0xb7e5('0xc')]||'';this[_0xb7e5('0xd')]=_0x38e169[_0xb7e5('0xd')]||'';this[_0xb7e5('0xe')]=_0x38e169['type']||'inbound';this[_0xb7e5('0xf')]=0x0;this['talking']=0x0;this['total']=0x0;this['answered']=0x0;this[_0xb7e5('0x10')]=0x0;this[_0xb7e5('0x11')]=0x0;this[_0xb7e5('0x12')]=0x0;this['unmanaged']=0x0;this[_0xb7e5('0x13')]=0x0;this[_0xb7e5('0x14')]=0x0;this['available']=0x0;this['acw']=_0x38e169[_0xb7e5('0x15')]||![];this[_0xb7e5('0x16')]=_0x38e169[_0xb7e5('0x16')]||0xa;this[_0xb7e5('0x17')]=_0x38e169['autopause']||'no';this[_0xb7e5('0x18')]=!![];this[_0xb7e5('0x19')]='';this[_0xb7e5('0x1a')]=0x0;this[_0xb7e5('0x1b')]=0x0;this[_0xb7e5('0x1c')]=_0x38e169['dialTimezone']||null;this[_0xb7e5('0x1d')]=_0x38e169[_0xb7e5('0x1d')]?_0x38e169['dialGlobalInterval']:null;this[_0xb7e5('0x1e')]=_0x38e169[_0xb7e5('0x1e')];this[_0xb7e5('0x1f')]=_0x38e169[_0xb7e5('0x1f')]||_0xb7e5('0x20');this['dialLimitChannel']=_0x38e169[_0xb7e5('0x21')]||0x0;this['dialLimitQueue']=_0x38e169[_0xb7e5('0x22')]||0x0;this[_0xb7e5('0x23')]=_0x38e169[_0xb7e5('0x23')]||0x1;this[_0xb7e5('0x24')]=_0x38e169[_0xb7e5('0x24')]||_0xb7e5('0x25');this[_0xb7e5('0x26')]=_0x38e169[_0xb7e5('0x26')]||0.03;this['dialPredictiveInterval']=_0x38e169[_0xb7e5('0x27')]||0x258;this[_0xb7e5('0x28')]=_0x38e169[_0xb7e5('0x28')]||_0xb7e5('0x29');this[_0xb7e5('0x2a')]=_0x38e169['dialOriginateCallerIdNumber']||'anonymous';this[_0xb7e5('0x2b')]=_0x38e169[_0xb7e5('0x2b')]||0x1e;this[_0xb7e5('0x2c')]=_0x38e169[_0xb7e5('0x2c')]||_0xb7e5('0x2d');this[_0xb7e5('0x2e')]=_0x38e169[_0xb7e5('0x2e')]||0x3;this['dialQueueProject']=_0x38e169[_0xb7e5('0x2f')]||undefined;this[_0xb7e5('0x30')]=_0x38e169[_0xb7e5('0x30')]||0x3;this[_0xb7e5('0x31')]=_0x38e169[_0xb7e5('0x31')]||0x96;this['dialBusyMaxRetry']=_0x38e169[_0xb7e5('0x32')]||0x3;this[_0xb7e5('0x33')]=_0x38e169[_0xb7e5('0x33')]||0x96;this['dialNoAnswerMaxRetry']=_0x38e169[_0xb7e5('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x38e169[_0xb7e5('0x35')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x38e169[_0xb7e5('0x36')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x38e169[_0xb7e5('0x37')]||0x96;this[_0xb7e5('0x38')]=_0x38e169[_0xb7e5('0x38')]||0x3;this[_0xb7e5('0x39')]=_0x38e169['dialDropRetryFrequency']||0x96;this[_0xb7e5('0x3a')]=_0x38e169[_0xb7e5('0x3a')]||0x3;this[_0xb7e5('0x3b')]=_0x38e169[_0xb7e5('0x3b')]||0x96;this[_0xb7e5('0x3c')]=_0x38e169['dialMachineMaxRetry']||0x3;this[_0xb7e5('0x3d')]=_0x38e169[_0xb7e5('0x3d')]||0x96;this[_0xb7e5('0x3e')]=_0x38e169[_0xb7e5('0x3e')]||0x3;this['dialAgentRejectRetryFrequency']=_0x38e169[_0xb7e5('0x3f')]||0x96;this[_0xb7e5('0x40')]=_0x38e169['dialGlobalMaxRetry']||0x4;this[_0xb7e5('0x41')]=_0x38e169[_0xb7e5('0x41')]?_0x38e169[_0xb7e5('0x41')]:undefined;this['TrunkBackup']=_0x38e169[_0xb7e5('0x42')]?_0x38e169[_0xb7e5('0x42')]:undefined;this[_0xb7e5('0x43')]=_0x38e169[_0xb7e5('0x43')]||undefined;this[_0xb7e5('0x44')]=_0x38e169[_0xb7e5('0x44')]?_0x38e169[_0xb7e5('0x44')]:undefined;this['dialOrderByScheduledAt']=_0x38e169['dialOrderByScheduledAt']||_0xb7e5('0x45');this[_0xb7e5('0x46')]=_0x38e169[_0xb7e5('0x46')]||undefined;this[_0xb7e5('0x47')]=_0x38e169[_0xb7e5('0x47')]||undefined;this[_0xb7e5('0x48')]=strategy[_0x38e169[_0xb7e5('0x48')]]||'rrmemory';this[_0xb7e5('0x49')]=!![];this[_0xb7e5('0x4a')]=_0x38e169[_0xb7e5('0x4a')]||![];this['dialAMDInitialSilence']=_0x38e169[_0xb7e5('0x4b')];this[_0xb7e5('0x4c')]=_0x38e169['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x38e169[_0xb7e5('0x4d')];this[_0xb7e5('0x4e')]=_0x38e169[_0xb7e5('0x4e')];this[_0xb7e5('0x4f')]=_0x38e169[_0xb7e5('0x4f')];this['dialAMDBetweenWordsSilence']=_0x38e169['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x38e169['dialAMDMaximumNumberOfWords'];this[_0xb7e5('0x50')]=_0x38e169['dialAMDSilenceThreshold'];this[_0xb7e5('0x51')]=_0x38e169[_0xb7e5('0x51')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0xb7e5('0x52')]=_0x38e169[_0xb7e5('0x52')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xb7e5('0x53')]=0x0;this[_0xb7e5('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xb7e5('0x55')]=0x0;this[_0xb7e5('0x56')]=0x0;this[_0xb7e5('0x57')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xb7e5('0x58')]=0x0;this[_0xb7e5('0x59')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0xb7e5('0x5a')]=undefined;this[_0xb7e5('0x5b')]=undefined;this[_0xb7e5('0x5c')]=undefined;this[_0xb7e5('0x5d')]=1.05;this[_0xb7e5('0x5e')]=0x0;this[_0xb7e5('0x5f')]=0x0;this[_0xb7e5('0x60')]=0x0;this[_0xb7e5('0x61')]=0x0;this[_0xb7e5('0x62')]=0x0;this[_0xb7e5('0x63')]=0x0;this[_0xb7e5('0x64')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x38e169[_0xb7e5('0x65')]||0x14;this[_0xb7e5('0x66')]=_0x38e169[_0xb7e5('0x65')]||0xa;this[_0xb7e5('0x67')]=0x0;this[_0xb7e5('0x68')]=0x0;this[_0xb7e5('0x69')]=0x1;this[_0xb7e5('0x6a')]=0x0;this[_0xb7e5('0x6b')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0xb7e5('0x6c')]=_0x38e169['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x38e169['dialRecallInQueue']||![];this[_0xb7e5('0x6d')]=_0x38e169[_0xb7e5('0x6d')]||undefined;this[_0xb7e5('0x6e')]=_0x38e169[_0xb7e5('0x6e')]||![];this['dialAgiAfterHangupAgent']=_0x38e169['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x38e169[_0xb7e5('0xd')]]?monitorFormat[_0x38e169['monitor_format']]:undefined;this[_0xb7e5('0x6f')]=_0x38e169['mandatoryDisposition']||![];this[_0xb7e5('0x70')]=_0x38e169['mandatoryDispositionPause']?_0x38e169['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
+var _0x283b=['outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','roundrobin','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x283b,0x188));var _0xb283=function(_0x59602c,_0x31958d){_0x59602c=_0x59602c-0x0;var _0x54eda2=_0x283b[_0x59602c];return _0x54eda2;};'use strict';var statusDesc=[_0xb283('0x0'),_0xb283('0x1'),_0xb283('0x2'),_0xb283('0x3'),_0xb283('0x4'),_0xb283('0x5'),_0xb283('0x6'),_0xb283('0x7'),'onhold'];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0xb283('0x8')};function VoiceQueue(_0x3e3642){this['id']=_0x3e3642['id']||0x0;this['name']=_0x3e3642['name']||'';this[_0xb283('0x9')]=_0x3e3642[_0xb283('0x9')]||'';this[_0xb283('0xa')]=_0x3e3642[_0xb283('0xa')]||_0xb283('0xb');this[_0xb283('0xc')]=0x0;this[_0xb283('0xd')]=0x0;this[_0xb283('0xe')]=0x0;this[_0xb283('0xf')]=0x0;this[_0xb283('0x10')]=0x0;this[_0xb283('0x11')]=0x0;this[_0xb283('0x12')]=0x0;this[_0xb283('0x13')]=0x0;this[_0xb283('0x14')]=0x0;this[_0xb283('0x15')]=0x0;this[_0xb283('0x16')]=0x0;this[_0xb283('0x17')]=_0x3e3642[_0xb283('0x17')]||![];this[_0xb283('0x18')]=_0x3e3642['acwTimeout']||0xa;this[_0xb283('0x19')]=_0x3e3642['autopause']||'no';this[_0xb283('0x1a')]=!![];this[_0xb283('0x1b')]='';this[_0xb283('0x1c')]=0x0;this[_0xb283('0x1d')]=0x0;this[_0xb283('0x1e')]=_0x3e3642[_0xb283('0x1e')]||null;this[_0xb283('0x1f')]=_0x3e3642[_0xb283('0x1f')]?_0x3e3642[_0xb283('0x1f')]:null;this['dialActive']=_0x3e3642[_0xb283('0x20')];this[_0xb283('0x21')]=_0x3e3642[_0xb283('0x21')]||_0xb283('0x22');this[_0xb283('0x23')]=_0x3e3642[_0xb283('0x23')]||0x0;this[_0xb283('0x24')]=_0x3e3642['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x3e3642[_0xb283('0x25')]||0x1;this[_0xb283('0x26')]=_0x3e3642[_0xb283('0x26')]||_0xb283('0x27');this[_0xb283('0x28')]=_0x3e3642[_0xb283('0x28')]||0.03;this[_0xb283('0x29')]=_0x3e3642['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x3e3642[_0xb283('0x2a')]||_0xb283('0x2b');this[_0xb283('0x2c')]=_0x3e3642['dialOriginateCallerIdNumber']||_0xb283('0x2b');this[_0xb283('0x2d')]=_0x3e3642[_0xb283('0x2d')]||0x1e;this[_0xb283('0x2e')]=_0x3e3642['dialQueueOptions']||_0xb283('0x2f');this[_0xb283('0x30')]=_0x3e3642['dialQueueTimeout']||0x3;this[_0xb283('0x31')]=_0x3e3642[_0xb283('0x31')]||undefined;this['dialCongestionMaxRetry']=_0x3e3642[_0xb283('0x32')]||0x3;this[_0xb283('0x33')]=_0x3e3642[_0xb283('0x33')]||0x96;this[_0xb283('0x34')]=_0x3e3642[_0xb283('0x34')]||0x3;this['dialBusyRetryFrequency']=_0x3e3642[_0xb283('0x35')]||0x96;this['dialNoAnswerMaxRetry']=_0x3e3642['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x3e3642['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x3e3642[_0xb283('0x36')]||0x3;this[_0xb283('0x37')]=_0x3e3642[_0xb283('0x37')]||0x96;this[_0xb283('0x38')]=_0x3e3642[_0xb283('0x38')]||0x3;this[_0xb283('0x39')]=_0x3e3642[_0xb283('0x39')]||0x96;this['dialAbandonedMaxRetry']=_0x3e3642[_0xb283('0x3a')]||0x3;this[_0xb283('0x3b')]=_0x3e3642[_0xb283('0x3b')]||0x96;this[_0xb283('0x3c')]=_0x3e3642['dialMachineMaxRetry']||0x3;this[_0xb283('0x3d')]=_0x3e3642[_0xb283('0x3d')]||0x96;this[_0xb283('0x3e')]=_0x3e3642['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x3e3642['dialAgentRejectRetryFrequency']||0x96;this[_0xb283('0x3f')]=_0x3e3642['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x3e3642['Trunk']?_0x3e3642[_0xb283('0x40')]:undefined;this[_0xb283('0x41')]=_0x3e3642[_0xb283('0x41')]?_0x3e3642[_0xb283('0x41')]:undefined;this[_0xb283('0x42')]=_0x3e3642[_0xb283('0x42')]||undefined;this[_0xb283('0x43')]=_0x3e3642[_0xb283('0x43')]?_0x3e3642[_0xb283('0x43')]:undefined;this[_0xb283('0x44')]=_0x3e3642['dialOrderByScheduledAt']||'DESC';this[_0xb283('0x45')]=_0x3e3642['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x3e3642[_0xb283('0x46')]||undefined;this['strategy']=strategy[_0x3e3642['strategy']]||'rrmemory';this[_0xb283('0x47')]=!![];this['dialAMDActive']=_0x3e3642[_0xb283('0x48')]||![];this['dialAMDInitialSilence']=_0x3e3642[_0xb283('0x49')];this[_0xb283('0x4a')]=_0x3e3642[_0xb283('0x4a')];this['dialAMDAfterGreetingSilence']=_0x3e3642['dialAMDAfterGreetingSilence'];this[_0xb283('0x4b')]=_0x3e3642['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x3e3642[_0xb283('0x4c')];this[_0xb283('0x4d')]=_0x3e3642[_0xb283('0x4d')];this[_0xb283('0x4e')]=_0x3e3642[_0xb283('0x4e')];this[_0xb283('0x4f')]=_0x3e3642[_0xb283('0x4f')];this[_0xb283('0x50')]=_0x3e3642[_0xb283('0x50')];this[_0xb283('0x51')]=0x0;this[_0xb283('0x52')]=0x0;this[_0xb283('0x53')]=_0x3e3642[_0xb283('0x53')];this[_0xb283('0x54')]=0x0;this[_0xb283('0x55')]=0x0;this[_0xb283('0x56')]=0x0;this[_0xb283('0x57')]=0x0;this[_0xb283('0x58')]=0x0;this[_0xb283('0x59')]=0x0;this[_0xb283('0x5a')]=0x0;this[_0xb283('0x5b')]=0x0;this[_0xb283('0x5c')]=0x0;this[_0xb283('0x5d')]=0x0;this[_0xb283('0x5e')]=0x0;this[_0xb283('0x5f')]=0x0;this['outboundReCallsDay']=0x0;this[_0xb283('0x60')]=0x0;this[_0xb283('0x61')]=undefined;this[_0xb283('0x62')]=undefined;this[_0xb283('0x63')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xb283('0x64')]=0x0;this[_0xb283('0x65')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xb283('0x66')]=0x0;this[_0xb283('0x67')]=0x0;this[_0xb283('0x68')]=0x0;this[_0xb283('0x69')]=0x0;this[_0xb283('0x6a')]=_0x3e3642['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x3e3642[_0xb283('0x6b')]||0xa;this[_0xb283('0x6c')]=0x0;this[_0xb283('0x6d')]=0x0;this[_0xb283('0x6e')]=0x1;this[_0xb283('0x6f')]=0x0;this[_0xb283('0x70')]=0x0;this[_0xb283('0x71')]=0x0;this[_0xb283('0x72')]=0x0;this[_0xb283('0x73')]=_0x3e3642[_0xb283('0x73')]||0x1e;this['dialRecallInQueue']=_0x3e3642[_0xb283('0x74')]||![];this[_0xb283('0x75')]=_0x3e3642[_0xb283('0x75')]||undefined;this['dialAgiAfterHangupClient']=_0x3e3642[_0xb283('0x76')]||![];this['dialAgiAfterHangupAgent']=_0x3e3642['dialAgiAfterHangupAgent']||![];this[_0xb283('0x9')]=monitorFormat[_0x3e3642[_0xb283('0x9')]]?monitorFormat[_0x3e3642[_0xb283('0x9')]]:undefined;this['mandatoryDisposition']=_0x3e3642[_0xb283('0x77')]||![];this['mandatoryDispositionPause']=_0x3e3642[_0xb283('0x78')]?_0x3e3642[_0xb283('0x78')]:undefined;}module[_0xb283('0x79')]=VoiceQueue;
\ No newline at end of file
index 9f658bf..1c3eee6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb36=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x4b2030,_0x4a89f2){var _0x5711eb=function(_0x40b060){while(--_0x40b060){_0x4b2030['push'](_0x4b2030['shift']());}};_0x5711eb(++_0x4a89f2);}(_0xbb36,0x105));var _0x6bb3=function(_0x4f8ee8,_0x4a55aa){_0x4f8ee8=_0x4f8ee8-0x0;var _0x3f162c=_0xbb36[_0x4f8ee8];return _0x3f162c;};'use strict';function VtigerAccount(_0x55b017){this['id']=_0x55b017['id']||0x0;this[_0x6bb3('0x0')]=_0x55b017[_0x6bb3('0x0')]||'';this['username']=_0x55b017[_0x6bb3('0x1')]||'';this[_0x6bb3('0x2')]=_0x55b017[_0x6bb3('0x2')]||'';this['remoteUri']=_0x55b017[_0x6bb3('0x3')]||'';this[_0x6bb3('0x4')]=_0x55b017[_0x6bb3('0x4')]||'';this[_0x6bb3('0x5')]=_0x55b017[_0x6bb3('0x5')]||{};}module[_0x6bb3('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0xde6c=['serverUrl','exports','name','username','accessKey','remoteUri'];(function(_0x4d2794,_0x4dc3c5){var _0x4bda64=function(_0x276b35){while(--_0x276b35){_0x4d2794['push'](_0x4d2794['shift']());}};_0x4bda64(++_0x4dc3c5);}(_0xde6c,0x7a));var _0xcde6=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xde6c[_0x18ab2a];return _0x16dcee;};'use strict';function VtigerAccount(_0x405d5f){this['id']=_0x405d5f['id']||0x0;this['name']=_0x405d5f[_0xcde6('0x0')]||'';this[_0xcde6('0x1')]=_0x405d5f[_0xcde6('0x1')]||'';this[_0xcde6('0x2')]=_0x405d5f[_0xcde6('0x2')]||'';this[_0xcde6('0x3')]=_0x405d5f[_0xcde6('0x3')]||'';this['serverUrl']=_0x405d5f[_0xcde6('0x4')]||'';this['Configurations']=_0x405d5f['Configurations']||{};}module[_0xcde6('0x5')]=VtigerAccount;
\ No newline at end of file
index 87aa02d..c43a7d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5efe=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password','token'];(function(_0x4265b6,_0x37fe58){var _0x5a871c=function(_0xd47aeb){while(--_0xd47aeb){_0x4265b6['push'](_0x4265b6['shift']());}};_0x5a871c(++_0x37fe58);}(_0x5efe,0x88));var _0xe5ef=function(_0x11bafb,_0x2ea524){_0x11bafb=_0x11bafb-0x0;var _0x9acd52=_0x5efe[_0x11bafb];return _0x9acd52;};'use strict';function ZendeskAccount(_0x2e59df){this['id']=_0x2e59df['id']||0x0;this[_0xe5ef('0x0')]=_0x2e59df[_0xe5ef('0x0')]||'';this[_0xe5ef('0x1')]=_0x2e59df[_0xe5ef('0x1')]||'';this[_0xe5ef('0x2')]=_0x2e59df['password']||'';this[_0xe5ef('0x3')]=_0x2e59df[_0xe5ef('0x3')]||'';this[_0xe5ef('0x4')]=_0x2e59df['remoteUri']||'';this[_0xe5ef('0x5')]=_0x2e59df[_0xe5ef('0x5')]||'';this['type']=_0x2e59df[_0xe5ef('0x6')]||_0xe5ef('0x7');this[_0xe5ef('0x8')]=_0x2e59df[_0xe5ef('0x8')]||'';this[_0xe5ef('0x9')]=_0x2e59df[_0xe5ef('0x9')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
+var _0x83d0=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name'];(function(_0x38b70b,_0x1c2961){var _0x1a8a18=function(_0xf726c2){while(--_0xf726c2){_0x38b70b['push'](_0x38b70b['shift']());}};_0x1a8a18(++_0x1c2961);}(_0x83d0,0x1df));var _0x083d=function(_0x25a8c1,_0x49f476){_0x25a8c1=_0x25a8c1-0x0;var _0x3c53b8=_0x83d0[_0x25a8c1];return _0x3c53b8;};'use strict';function ZendeskAccount(_0x1fe5ef){this['id']=_0x1fe5ef['id']||0x0;this[_0x083d('0x0')]=_0x1fe5ef[_0x083d('0x0')]||'';this[_0x083d('0x1')]=_0x1fe5ef[_0x083d('0x1')]||'';this[_0x083d('0x2')]=_0x1fe5ef[_0x083d('0x2')]||'';this[_0x083d('0x3')]=_0x1fe5ef[_0x083d('0x3')]||'';this[_0x083d('0x4')]=_0x1fe5ef[_0x083d('0x4')]||'';this[_0x083d('0x5')]=_0x1fe5ef['authType']||'';this[_0x083d('0x6')]=_0x1fe5ef[_0x083d('0x6')]||_0x083d('0x7');this[_0x083d('0x8')]=_0x1fe5ef['serverUrl']||'';this[_0x083d('0x9')]=_0x1fe5ef[_0x083d('0x9')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
index d843a72..c9b6f09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba2e=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x5a5981,_0x1ac7a0){var _0x59dd78=function(_0x144963){while(--_0x144963){_0x5a5981['push'](_0x5a5981['shift']());}};_0x59dd78(++_0x1ac7a0);}(_0xba2e,0x18e));var _0xeba2=function(_0x2e08c9,_0x3bdd19){_0x2e08c9=_0x2e08c9-0x0;var _0x5be3df=_0xba2e[_0x2e08c9];return _0x5be3df;};'use strict';function ZohoAccount(_0x2c684f){this['id']=_0x2c684f['id']||0x0;this[_0xeba2('0x0')]=_0x2c684f[_0xeba2('0x0')]||'';this[_0xeba2('0x1')]=_0x2c684f['description']||'';this[_0xeba2('0x2')]=_0x2c684f['host']||'';this['zone']=_0x2c684f[_0xeba2('0x3')]||'';this[_0xeba2('0x4')]=_0x2c684f[_0xeba2('0x4')]||'';this[_0xeba2('0x5')]=_0x2c684f[_0xeba2('0x5')]||'';this['serverUrl']=_0x2c684f[_0xeba2('0x6')]||'';this[_0xeba2('0x7')]=_0x2c684f['code']||'';this[_0xeba2('0x8')]=_0x2c684f[_0xeba2('0x8')]||'';this[_0xeba2('0x9')]=_0x2c684f[_0xeba2('0x9')]||{};}module[_0xeba2('0xa')]=ZohoAccount;
\ No newline at end of file
+var _0xc61d=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone'];(function(_0x47d3a4,_0x5b1e1c){var _0x2650c5=function(_0x413d57){while(--_0x413d57){_0x47d3a4['push'](_0x47d3a4['shift']());}};_0x2650c5(++_0x5b1e1c);}(_0xc61d,0xec));var _0xdc61=function(_0x32ecca,_0xc50e5e){_0x32ecca=_0x32ecca-0x0;var _0x28d753=_0xc61d[_0x32ecca];return _0x28d753;};'use strict';function ZohoAccount(_0x3233a2){this['id']=_0x3233a2['id']||0x0;this[_0xdc61('0x0')]=_0x3233a2[_0xdc61('0x0')]||'';this['description']=_0x3233a2[_0xdc61('0x1')]||'';this[_0xdc61('0x2')]=_0x3233a2[_0xdc61('0x2')]||'';this[_0xdc61('0x3')]=_0x3233a2[_0xdc61('0x3')]||'';this['clientId']=_0x3233a2[_0xdc61('0x4')]||'';this['clientSecret']=_0x3233a2[_0xdc61('0x5')]||'';this[_0xdc61('0x6')]=_0x3233a2['serverUrl']||'';this[_0xdc61('0x7')]=_0x3233a2[_0xdc61('0x7')]||'';this['refreshToken']=_0x3233a2[_0xdc61('0x8')]||'';this[_0xdc61('0x9')]=_0x3233a2['Configurations']||{};}module['exports']=ZohoAccount;
\ No newline at end of file
index 9645199..b3bc1f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde3d=['campaigntype','dialAnswer','membername','Agent','format','SIP/%s','Contact','phone','lastName','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util','moment','isNil','idContact','queue','name','type'];(function(_0x8750d4,_0x4d5340){var _0x284e99=function(_0x33dfcc){while(--_0x33dfcc){_0x8750d4['push'](_0x8750d4['shift']());}};_0x284e99(++_0x4d5340);}(_0xde3d,0x1bc));var _0xdde3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xde3d[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0xdde3('0x0'));var _=require('lodash');var moment=require(_0xdde3('0x1'));function checkNameSurname(_0x5b77c2,_0x3eff6d,_0x52b606){var _0x14ca68='';if(!_[_0xdde3('0x2')](_0x3eff6d)&&'string'===typeof _0x3eff6d){_0x14ca68+=_0x3eff6d;}if(!_[_0xdde3('0x2')](_0x52b606)&&'string'===typeof _0x52b606){_0x14ca68+='\x20'+_0x52b606;}if(_0x14ca68!==''){return _0x14ca68;}return _0x5b77c2;}function Action(_0x31de54,_0x942ad1,_0x16a4c6,_0x327d51,_0x20b166){this['uniqueid']=_0x16a4c6||undefined;this[_0xdde3('0x3')]=_0x31de54['id'];this[_0xdde3('0x4')]=_0x942ad1[_0xdde3('0x5')];this[_0xdde3('0x6')]=_0x942ad1['type'];this[_0xdde3('0x7')]=_0xdde3('0x4');this[_0xdde3('0x8')]=![];this[_0xdde3('0x9')]=_[_0xdde3('0x2')](_0x31de54[_0xdde3('0xa')])?undefined:_0x31de54['Agent']['name'];this['channelAgent']=this[_0xdde3('0x9')]?util[_0xdde3('0xb')](_0xdde3('0xc'),this[_0xdde3('0x9')]):_0x327d51||undefined;this['calleridname']=checkNameSurname(_0x31de54[_0xdde3('0xd')][_0xdde3('0xe')],_0x31de54[_0xdde3('0xd')]['firstName'],_0x31de54[_0xdde3('0xd')][_0xdde3('0xf')]);this['active']=_0x31de54['active']||![];this[_0xdde3('0x10')]=_0x31de54[_0xdde3('0xd')][_0xdde3('0xe')];this[_0xdde3('0x11')]=_0x31de54[_0xdde3('0x11')];this[_0xdde3('0x12')]=_0x31de54[_0xdde3('0x12')]||0x0;this[_0xdde3('0x13')]=_0x31de54['countcongestionretry']||0x0;this[_0xdde3('0x14')]=_0x31de54['countnoanswerretry']||0x0;this[_0xdde3('0x15')]=(_0x31de54['countbusyretry']||0x0)+(_0x31de54[_0xdde3('0x13')]||0x0)+(_0x31de54[_0xdde3('0x14')]||0x0)+(_0x31de54['countnosuchnumberretry']||0x0)+(_0x31de54[_0xdde3('0x16')]||0x0)+(_0x31de54[_0xdde3('0x17')]||0x0)+(_0x31de54[_0xdde3('0x18')]||0x0)+(_0x31de54['countagentrejectretry']||0x0);this[_0xdde3('0x19')]=_0x31de54[_0xdde3('0x19')]||0x0;this['countdropretry']=_0x31de54[_0xdde3('0x16')]||0x0;this['countabandonedretry']=_0x31de54[_0xdde3('0x17')]||0x0;this[_0xdde3('0x18')]=_0x31de54['countmachineretry']||0x0;this[_0xdde3('0x1a')]=_0x31de54[_0xdde3('0x1a')]||0x0;this['callback']=_0x31de54[_0xdde3('0x1b')];this[_0xdde3('0x1c')]=_0x31de54[_0xdde3('0x1c')];this[_0xdde3('0x1d')]=_0x31de54[_0xdde3('0x1d')];this['recallme']=_0x31de54[_0xdde3('0x1e')];this['ContactId']=_0x31de54[_0xdde3('0x1f')];this[_0xdde3('0x20')]=_0x31de54[_0xdde3('0x20')];this[_0xdde3('0x21')]=_[_0xdde3('0x2')](_0x31de54[_0xdde3('0xa')])?_0x31de54[_0xdde3('0x21')]:_0x31de54['Agent']['id'];this[_0xdde3('0x22')]=_0x31de54[_0xdde3('0x22')];this[_0xdde3('0x23')]='';this[_0xdde3('0x24')]='';}Action[_0xdde3('0x25')][_0xdde3('0x26')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0xdde3('0x27')]);};module[_0xdde3('0x28')]=Action;
\ No newline at end of file
+var _0x0dbd=['countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','util','lodash','moment','isNil','idContact','name','type','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry'];(function(_0x28b930,_0x19b05f){var _0x112256=function(_0x3b3f61){while(--_0x3b3f61){_0x28b930['push'](_0x28b930['shift']());}};_0x112256(++_0x19b05f);}(_0x0dbd,0x1d3));var _0xd0db=function(_0x7e0713,_0x46794c){_0x7e0713=_0x7e0713-0x0;var _0x434d46=_0x0dbd[_0x7e0713];return _0x434d46;};'use strict';var util=require(_0xd0db('0x0'));var _=require(_0xd0db('0x1'));var moment=require(_0xd0db('0x2'));function checkNameSurname(_0x79b5d8,_0x18fcab,_0x670516){var _0xb0e6fe='';if(!_[_0xd0db('0x3')](_0x18fcab)&&'string'===typeof _0x18fcab){_0xb0e6fe+=_0x18fcab;}if(!_[_0xd0db('0x3')](_0x670516)&&'string'===typeof _0x670516){_0xb0e6fe+='\x20'+_0x670516;}if(_0xb0e6fe!==''){return _0xb0e6fe;}return _0x79b5d8;}function Action(_0x487d36,_0x56e857,_0xcb3222,_0xe325be,_0x2e955c){this['uniqueid']=_0xcb3222||undefined;this[_0xd0db('0x4')]=_0x487d36['id'];this['queue']=_0x56e857[_0xd0db('0x5')];this[_0xd0db('0x6')]=_0x56e857[_0xd0db('0x6')];this['campaigntype']=_0xd0db('0x7');this[_0xd0db('0x8')]=![];this[_0xd0db('0x9')]=_['isNil'](_0x487d36['Agent'])?undefined:_0x487d36[_0xd0db('0xa')][_0xd0db('0x5')];this[_0xd0db('0xb')]=this[_0xd0db('0x9')]?util[_0xd0db('0xc')](_0xd0db('0xd'),this[_0xd0db('0x9')]):_0xe325be||undefined;this[_0xd0db('0xe')]=checkNameSurname(_0x487d36['Contact'][_0xd0db('0xf')],_0x487d36['Contact'][_0xd0db('0x10')],_0x487d36[_0xd0db('0x11')][_0xd0db('0x12')]);this[_0xd0db('0x13')]=_0x487d36[_0xd0db('0x13')]||![];this[_0xd0db('0x14')]=_0x487d36[_0xd0db('0x11')][_0xd0db('0xf')];this[_0xd0db('0x15')]=_0x487d36[_0xd0db('0x15')];this[_0xd0db('0x16')]=_0x487d36[_0xd0db('0x16')]||0x0;this[_0xd0db('0x17')]=_0x487d36[_0xd0db('0x17')]||0x0;this['countnoanswerretry']=_0x487d36[_0xd0db('0x18')]||0x0;this[_0xd0db('0x19')]=(_0x487d36[_0xd0db('0x16')]||0x0)+(_0x487d36['countcongestionretry']||0x0)+(_0x487d36[_0xd0db('0x18')]||0x0)+(_0x487d36['countnosuchnumberretry']||0x0)+(_0x487d36[_0xd0db('0x1a')]||0x0)+(_0x487d36[_0xd0db('0x1b')]||0x0)+(_0x487d36[_0xd0db('0x1c')]||0x0)+(_0x487d36[_0xd0db('0x1d')]||0x0);this[_0xd0db('0x1e')]=_0x487d36['countnosuchnumberretry']||0x0;this[_0xd0db('0x1a')]=_0x487d36[_0xd0db('0x1a')]||0x0;this[_0xd0db('0x1b')]=_0x487d36[_0xd0db('0x1b')]||0x0;this[_0xd0db('0x1c')]=_0x487d36['countmachineretry']||0x0;this[_0xd0db('0x1d')]=_0x487d36['countagentrejectretry']||0x0;this[_0xd0db('0x1f')]=_0x487d36[_0xd0db('0x1f')];this[_0xd0db('0x20')]=_0x487d36[_0xd0db('0x20')];this['callbackat']=_0x487d36[_0xd0db('0x21')];this[_0xd0db('0x22')]=_0x487d36[_0xd0db('0x22')];this[_0xd0db('0x23')]=_0x487d36[_0xd0db('0x23')];this[_0xd0db('0x24')]=_0x487d36['ListId'];this['UserId']=_[_0xd0db('0x3')](_0x487d36['Agent'])?_0x487d36[_0xd0db('0x25')]:_0x487d36[_0xd0db('0xa')]['id'];this['VoiceQueueId']=_0x487d36[_0xd0db('0x26')];this[_0xd0db('0x27')]='';this[_0xd0db('0x28')]='';}Action[_0xd0db('0x29')][_0xd0db('0x2a')]=function(){return util[_0xd0db('0xc')](_0xd0db('0x2b'),this['calleridname'],this[_0xd0db('0x2c')]);};module['exports']=Action;
\ No newline at end of file
index 54412b9..fd67bc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3621=['substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','channelAgent','destconnectedlinenum','user:%s','user:agentconnect','calleridnum','[originated][increment]','OriginateError','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','statedesc','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','addVariable','variables','variable','keys','value','[syncVarSet][Preview]','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','emit','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','pick','contactId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','size','agentReadyId','then','getDiff','dialRecallMeTimeout','voicePause','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','\x20Queue','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','custom:agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','trunks','SIP/%s','status','reachable','execRun','unlockContact','disableContact','getContactPreview','recallme','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','Agent','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit'];(function(_0x908d80,_0xce02a1){var _0x1e4827=function(_0x2775f1){while(--_0x2775f1){_0x908d80['push'](_0x908d80['shift']());}};_0x1e4827(++_0xce02a1);}(_0x3621,0x178));var _0x1362=function(_0x22aca6,_0x47daed){_0x22aca6=_0x22aca6-0x0;var _0x3ccd15=_0x3621[_0x22aca6];return _0x3ccd15;};'use strict';var util=require(_0x1362('0x0'));var _=require(_0x1362('0x1'));var BPromise=require(_0x1362('0x2'));var uuid=require(_0x1362('0x3'));var moment=require(_0x1362('0x4'));var md5=require(_0x1362('0x5'));var Redis=require(_0x1362('0x6'));var config=require('../../../config/environment');var logger=require(_0x1362('0x7'))(_0x1362('0x8'));var loggerAction=require('../../../config/logger')(_0x1362('0x9'));var ami=require(_0x1362('0xa'));var rpcDb=require(_0x1362('0xb'));var Action=require('./action');var ut=require(_0x1362('0xc'));config[_0x1362('0xd')]=_['defaults'](config['redis'],{'host':_0x1362('0xe'),'port':0x18eb});var io=require(_0x1362('0xf'))(new Redis(config[_0x1362('0xd')]));var Sequence=function(){};Sequence[_0x1362('0x10')][_0x1362('0x11')]=function(_0x14a699){this['tail']=this['tail']?this[_0x1362('0x12')][_0x1362('0x13')](_0x14a699):_0x14a699();};function Preview(_0x344710){this[_0x1362('0x14')]=new Sequence();this[_0x1362('0x15')]=_0x344710['voiceQueues'];this['trunks']=_0x344710['trunks'];this[_0x1362('0x16')]={};this[_0x1362('0x17')]=_0x344710[_0x1362('0x17')];this[_0x1362('0x18')]=0x0;ami['on'](_0x1362('0x19'),this['syncOriginateResponse'][_0x1362('0x1a')](this));ami['on'](_0x1362('0x1b'),this[_0x1362('0x1c')][_0x1362('0x1a')](this));ami['on'](_0x1362('0x1d'),this[_0x1362('0x1e')][_0x1362('0x1a')](this));ami['on']('dialend',this[_0x1362('0x1f')][_0x1362('0x1a')](this));ami['on'](_0x1362('0x20'),this[_0x1362('0x21')][_0x1362('0x1a')](this));ami['on'](_0x1362('0x22'),this[_0x1362('0x23')][_0x1362('0x1a')](this));ami['on'](_0x1362('0x24'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x1362('0x25'),this[_0x1362('0x26')][_0x1362('0x1a')](this));this[_0x1362('0x27')](this[_0x1362('0x15')]);}function emit(_0x5c4316,_0x20ff92,_0x4761f0){io['to'](_0x5c4316)['emit'](_0x20ff92,_0x4761f0);}function emitCampaignPreview(_0x320456){if(_0x320456[_0x1362('0x28')]===_0x1362('0x29')){var _0x5e41ca={'id':_0x320456['id'],'name':_0x320456[_0x1362('0x2a')],'strategy':_0x320456[_0x1362('0x2b')],'answered':_0x320456[_0x1362('0x2c')],'available':_0x320456[_0x1362('0x2d')],'loggedIn':_0x320456[_0x1362('0x2e')],'pTalking':_0x320456[_0x1362('0x2f')],'sumBillable':_0x320456[_0x1362('0x30')],'sumDuration':_0x320456[_0x1362('0x31')],'sumHoldTime':_0x320456[_0x1362('0x32')]||0x0,'talking':_0x320456[_0x1362('0x33')],'total':_0x320456[_0x1362('0x34')],'type':_0x320456[_0x1362('0x28')],'unmanaged':_0x320456[_0x1362('0x35')],'abandoned':_0x320456[_0x1362('0x36')],'waiting':_0x320456[_0x1362('0x37')],'loggedInDb':_0x320456['loggedInDb'],'dialActive':_0x320456[_0x1362('0x38')],'dialMethod':_0x320456[_0x1362('0x39')],'dialOriginateCallerIdName':_0x320456['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x320456[_0x1362('0x3a')],'dialOriginateTimeout':_0x320456[_0x1362('0x3b')],'dialPrefix':_0x320456['dialPrefix'],'outboundAnswerAgiCallsDay':_0x320456['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x320456[_0x1362('0x3c')],'outboundBlacklistCallsDay':_0x320456[_0x1362('0x3d')],'outboundBusyCallsDay':_0x320456[_0x1362('0x3e')],'outboundCongestionCallsDay':_0x320456['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x320456[_0x1362('0x3f')],'outboundDropCallsDayCallersExit':_0x320456[_0x1362('0x40')],'outboundDropCallsDayTimeout':_0x320456[_0x1362('0x41')],'outboundNoAnswerCallsDay':_0x320456[_0x1362('0x42')],'outboundNoSuchCallsDay':_0x320456[_0x1362('0x43')],'outboundOriginateFailureCallsDay':_0x320456[_0x1362('0x44')],'outboundReCallsDay':_0x320456['outboundReCallsDay'],'outboundRejectCallsDay':_0x320456[_0x1362('0x45')],'outboundUnknownCallsDay':_0x320456[_0x1362('0x46')],'outboundAbandonedCallsDay':_0x320456[_0x1362('0x47')],'predictiveIntervalAnsweredCalls':_0x320456['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x320456[_0x1362('0x48')],'predictiveIntervalAvgTalktime':_0x320456['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x320456[_0x1362('0x49')],'predictiveIntervalDroppedCallsTimeout':_0x320456[_0x1362('0x4a')],'predictiveIntervalErlangCalls':_0x320456[_0x1362('0x4b')],'predictiveIntervalErlangCallsDroppedCalls':_0x320456[_0x1362('0x4c')],'predictiveIntervalHitRate':_0x320456['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x320456['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x320456[_0x1362('0x4d')],'predictiveIntervalAvailable':_0x320456[_0x1362('0x4e')],'predictiveIntervalTotalCalls':_0x320456[_0x1362('0x4f')],'message':_0x320456['message'],'originated':_0x320456[_0x1362('0x50')],'erlangCalls':_0x320456[_0x1362('0x51')],'erlangCallToSecond':_0x320456[_0x1362('0x52')],'erlangAbandonmentRate':_0x320456[_0x1362('0x53')],'erlangBusyFactor':_0x320456[_0x1362('0x54')],'startPredictive':_0x320456[_0x1362('0x55')],'startProgressive':_0x320456[_0x1362('0x56')]};if(_0x320456[_0x1362('0x57')]){_0x5e41ca['Trunk']={'id':_0x320456['Trunk']['id'],'name':_0x320456[_0x1362('0x57')][_0x1362('0x2a')],'active':_0x320456['Trunk'][_0x1362('0x58')],'callerid':_0x320456[_0x1362('0x57')][_0x1362('0x59')]};}if(_0x320456[_0x1362('0x5a')]){_0x5e41ca['Interval']={'id':_0x320456['Interval']['id'],'name':_0x320456['Interval'][_0x1362('0x2a')]};}var _0x1a6c3a=md5(JSON[_0x1362('0x5b')](_0x5e41ca));if(_0x320456['md5']!==_0x1a6c3a){_0x320456[_0x1362('0x5')]=_0x1a6c3a;emit(util[_0x1362('0x5c')]('voice:queue:%s',_0x5e41ca['name']),'voice_queue:save',_0x5e41ca);}}}function emitVoiceQueueChannelRemove(_0xcd549c){logger[_0x1362('0x5d')](_0x1362('0x5e'),JSON[_0x1362('0x5b')](_0xcd549c));emit(util[_0x1362('0x5c')](_0x1362('0x5f'),_0xcd549c['name']),_0x1362('0x60'),_0xcd549c);io[_0x1362('0x61')](_0x1362('0x62'),_0xcd549c);}function notSendMessagesQueue(_0x46d171){if(_0x46d171['sendMessageOneNotActive']){if(_0x46d171['originated']===0x0&&_0x46d171[_0x1362('0x2f')]===0x0){_0x46d171[_0x1362('0x63')]=![];_0x46d171[_0x1362('0x2d')]=0x0;_0x46d171[_0x1362('0x64')]=0x0;_0x46d171[_0x1362('0x65')]=_0x1362('0x66');ut[_0x1362('0x67')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x46d171['name']+'\x20is\x20not\x20active');}else{_0x46d171['message']='IS_DISACTIVED';ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x46d171['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x46d171);}}Preview['prototype'][_0x1362('0x27')]=function(){var _0x5e6ff4=this;setInterval(function(){_0x5e6ff4[_0x1362('0x68')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x48dcc1=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0xecc81a in _0x48dcc1){if(_0x48dcc1[_0x1362('0x69')](_0xecc81a)&&(_0x48dcc1[_0xecc81a][_0x1362('0x39')]===_0x1362('0x8')||_0x48dcc1[_0xecc81a][_0x1362('0x39')]===_0x1362('0x6a'))&&_0x48dcc1[_0xecc81a][_0x1362('0x28')]===_0x1362('0x29')){if(this[_0x1362('0x18')]>0x7){this[_0x1362('0x18')]=0x0;this[_0x1362('0x6b')]();}}if(_0x48dcc1[_0x1362('0x69')](_0xecc81a)&&_0x48dcc1[_0xecc81a][_0x1362('0x39')]===_0x1362('0x8')&&_0x48dcc1[_0xecc81a][_0x1362('0x28')]==='outbound'){if(_0x48dcc1[_0xecc81a][_0x1362('0x38')]){this[_0x1362('0x6c')](_0x48dcc1[_0xecc81a]);this[_0x1362('0x6d')](_0x48dcc1[_0xecc81a]);}else{notSendMessagesQueue(_0x48dcc1[_0xecc81a]);}}}};Preview['prototype'][_0x1362('0x6e')]=function(_0x27c154){var _0x548fda=this;this['sequence'][_0x1362('0x11')](function(){if(!_[_0x1362('0x6f')](_0x548fda[_0x1362('0x16')][_0x27c154])){loggerAction[_0x1362('0x5d')](_0x1362('0x70'),_0x27c154,'Queue',_0x548fda[_0x1362('0x16')][_0x27c154][_0x1362('0x71')],_0x1362('0x72'),JSON[_0x1362('0x5b')](_0x548fda[_0x1362('0x15')][_0x548fda[_0x1362('0x16')][_0x27c154][_0x1362('0x71')]][_0x1362('0x50')]),_0x1362('0x73'),JSON[_0x1362('0x5b')](_0x548fda[_0x1362('0x15')][_0x548fda[_0x1362('0x16')][_0x27c154][_0x1362('0x71')]][_0x1362('0x2f')]),JSON[_0x1362('0x5b')](_0x548fda[_0x1362('0x16')][_0x27c154]['dialAnswer']),JSON[_0x1362('0x5b')](_[_0x1362('0x74')](_0x548fda[_0x1362('0x16')][_0x27c154],[_0x1362('0x75'),'UserId',_0x1362('0x76'),_0x1362('0x77')])));return ami[_0x1362('0x78')]({'action':'status','channel':_0x548fda[_0x1362('0x16')][_0x27c154][_0x1362('0x79')]})[_0x1362('0x7a')](function(_0x17a005){if(_0x17a005['message']===_0x1362('0x7b')){setTimeout(function(){if(_0x548fda[_0x1362('0x16')][_0x27c154]){ut[_0x1362('0x7c')](_0x548fda[_0x1362('0x15')][_0x548fda[_0x1362('0x16')][_0x27c154][_0x1362('0x71')]],_0x1362('0x7d'));if(_0x548fda[_0x1362('0x16')][_0x27c154][_0x1362('0x7e')]===!![]){ut[_0x1362('0x7f')](_0x548fda[_0x1362('0x15')][_0x548fda['actions'][_0x27c154]['queue']],'[clearZombieChannel]');ut[_0x1362('0x80')]('[Dialer][checkChannel][pTalking][Preview]'+_0x27c154,_0x548fda[_0x1362('0x16')][_0x27c154][_0x1362('0x71')]);}ut[_0x1362('0x80')](_0x1362('0x81')+_0x27c154,_0x548fda[_0x1362('0x16')][_0x27c154][_0x1362('0x71')]);delete _0x548fda[_0x1362('0x16')][_0x27c154];}},0x2328);}});}});};Preview['prototype'][_0x1362('0x6b')]=function(){var _0x30103c=this;loggerAction[_0x1362('0x5d')]('[action]',_[_0x1362('0x82')](this[_0x1362('0x16')]));for(var _0x2f0bda in this['actions']){if(_0x30103c[_0x1362('0x16')][_0x1362('0x69')](_0x2f0bda)){_0x30103c[_0x1362('0x6e')](_0x2f0bda);}}};Preview['prototype'][_0x1362('0x6d')]=function(_0x12fd68){var _0x431482=this;rpcDb['getContactRecallMe'](_0x12fd68['id'],ut[_0x1362('0x83')](this[_0x1362('0x17')]))[_0x1362('0x84')](function(_0x2bd717){if(!_[_0x1362('0x6f')](_0x2bd717)){for(var _0x130694=0x0;_0x130694<_0x2bd717['length'];_0x130694+=0x1){if(ut[_0x1362('0x85')](_0x2bd717[_0x130694]['scheduledat'])<_0x12fd68[_0x1362('0x86')]*0x3c){if(_0x2bd717[_0x130694]['Agent']&&!_0x2bd717[_0x130694]['Agent'][_0x1362('0x87')]){_0x431482['run'](_0x2bd717[_0x130694]['id'])['then'](ut[_0x1362('0x88')]('[RecallMe]'))[_0x1362('0x7a')](ut[_0x1362('0x88')](_0x1362('0x89')));}else{rpcDb['disableContact'](_0x2bd717[_0x130694]['id']);}}else{var _0x149a57=new Action(_0x2bd717[_0x130694],_0x12fd68);_0x149a57['starttime']=moment()[_0x1362('0x5c')](_0x1362('0x8a'));_0x12fd68[_0x1362('0x8b')]+=0x1;ut[_0x1362('0x8c')](_0x149a57,0x17,_0x1362('0x8d'));if(_0x12fd68[_0x1362('0x8e')]){rpcDb[_0x1362('0x8f')](ut[_0x1362('0x90')](_0x2bd717[_0x130694]));rpcDb[_0x1362('0x91')](_0x149a57,_0x1362('0x92'));}else{ut['logCustomer'](_0x149a57,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x149a57,_0x1362('0x93'));rpcDb[_0x1362('0x94')](_0x149a57,'[HistoryRecallClose]');}}}}})[_0x1362('0x7a')](ut[_0x1362('0x88')](_0x1362('0x95')));};Preview[_0x1362('0x10')][_0x1362('0x6c')]=function(_0x3443ea){_0x3443ea['sendMessageOneNotActive']=!![];if(ut[_0x1362('0x96')](_0x3443ea['loggedIn'])){_0x3443ea[_0x1362('0x65')]='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x3443ea[_0x1362('0x38')])){_0x3443ea[_0x1362('0x65')]=_0x1362('0x66');}else if(!this[_0x1362('0x97')](_0x3443ea[_0x1362('0x57')])){if(!this[_0x1362('0x97')](_0x3443ea[_0x1362('0x98')])){_0x3443ea['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x3443ea[_0x1362('0x65')]=_0x1362('0x99');}}else{_0x3443ea['message']='ACTIVE';}emitCampaignPreview(_0x3443ea);};Preview['prototype'][_0x1362('0x9a')]=function(_0x57d3e5,_0xe7c877,_0x5ebd7b){var _0x4844bd=this;var _0x27faf3=this[_0x1362('0x16')][_0xe7c877];var _0x2b93d3=this[_0x1362('0x15')][_0x27faf3[_0x1362('0x71')]];var _0x22c87c;if(_0x2b93d3){switch(_0x5ebd7b){case'1':_0x2b93d3['outboundNoSuchCallsDay']+=0x1;_0x27faf3[_0x1362('0x9b')]+=0x1;_0x27faf3[_0x1362('0x9c')]=ut[_0x1362('0x9d')](_0x27faf3);ut['logCustomer'](_0x27faf3,0x0,_0x1362('0x9e'));ami['emit']('custom:agentnosuchnumber',ut[_0x1362('0x9f')](_0x27faf3,_0x1362('0xa0')));rpcDb[_0x1362('0x91')](_0x27faf3,_0x1362('0xa1'));if(ut[_0x1362('0x9d')](_0x27faf3)>=_0x2b93d3[_0x1362('0xa2')]){_0x22c87c=ut[_0x1362('0xa3')](_0x27faf3,0xf,_0x1362('0xa4'));rpcDb[_0x1362('0x94')](_0x22c87c,_0x1362('0xa5'));}else{if(_0x27faf3[_0x1362('0x9b')]>=_0x2b93d3[_0x1362('0xa6')]){rpcDb[_0x1362('0x94')](_0x27faf3,_0x1362('0xa5'));}else{rpcDb[_0x1362('0xa7')](ut[_0x1362('0xa8')](_0x27faf3,'countnosuchnumberretry',_0x2b93d3[_0x1362('0xa9')]),_0x27faf3[_0x1362('0xaa')],_0x27faf3['activeContact']);}}delete this[_0x1362('0x16')][_0x57d3e5[_0x1362('0xab')]];break;case _0x1362('0xac'):var _0x24a6da=moment()[_0x1362('0x5c')](_0x1362('0x8a'));_0x27faf3[_0x1362('0xad')]=_0x24a6da;_0x27faf3[_0x1362('0xae')]=_0x24a6da;_0x27faf3[_0x1362('0x7e')]=!![];_0x2b93d3[_0x1362('0x2f')]+=0x1;logger[_0x1362('0x5d')](_0x1362('0xaf'),_0x27faf3['uniqueid'],_0x1362('0xb0'),_0x2b93d3[_0x1362('0x2a')],_0x1362('0x73'),_0x2b93d3['pTalking']);ami['emit']('custom:agentconnect',ut[_0x1362('0x9f')](_0x27faf3,_0x1362('0xb1'),this['campaignsPreview'][_0x27faf3[_0x1362('0x71')]]));if(_0x2b93d3['acw']){ami['emit'](_0x1362('0xb2'),ut[_0x1362('0xb3')](_0x27faf3));}break;case'16':ami['emit'](_0x1362('0xb4'),ut[_0x1362('0x9f')](_0x27faf3,_0x1362('0xb5'),this['campaignsPreview'][_0x27faf3[_0x1362('0x71')]]));emitVoiceQueueChannelRemove(ut[_0x1362('0x9f')](_0x27faf3,_0x1362('0xb5')));_0x2b93d3['outboundAnswerCallsDay']+=0x1;_0x2b93d3['total']+=0x1;_0x2b93d3[_0x1362('0x2c')]+=0x1;ut[_0x1362('0x7f')](_0x2b93d3,_0x1362('0xb6'));_0x27faf3[_0x1362('0x9c')]=ut[_0x1362('0x9d')](_0x27faf3);ut[_0x1362('0x8c')](_0x27faf3,0x4,_0x1362('0xb7'));rpcDb['createCustomerHistory'](_0x27faf3,_0x1362('0xb8'));rpcDb[_0x1362('0x94')](_0x27faf3,_0x1362('0xb9'));rpcDb[_0x1362('0xba')](_0x27faf3);_0x2b93d3[_0x1362('0x31')]+=_0x27faf3[_0x1362('0xbb')];_0x2b93d3[_0x1362('0x30')]+=_0x27faf3[_0x1362('0xbb')];logger[_0x1362('0x5d')](_0x1362('0xbc'),_0x27faf3['uniqueid'],'\x20Queue',_0x2b93d3[_0x1362('0x2a')],'pTalking:\x20',_0x2b93d3[_0x1362('0x2f')]);delete this['actions'][_0x57d3e5[_0x1362('0xab')]];break;case'BUSY':_0x2b93d3[_0x1362('0x3e')]+=0x1;_0x27faf3[_0x1362('0xbd')]+=0x1;_0x27faf3[_0x1362('0x9c')]=ut[_0x1362('0x9d')](_0x27faf3);ut[_0x1362('0x8c')](_0x27faf3,0x5,_0x1362('0xbe'));ami['emit'](_0x1362('0xbf'),ut[_0x1362('0x9f')](_0x27faf3,'busy'));rpcDb['createCustomerHistory'](_0x27faf3,_0x1362('0xc0'));if(ut[_0x1362('0x9d')](_0x27faf3)>=_0x2b93d3[_0x1362('0xa2')]){_0x22c87c=ut[_0x1362('0xa3')](_0x27faf3,0xf,'Global');rpcDb[_0x1362('0x94')](_0x22c87c,_0x1362('0xc1'));}else{if(_0x27faf3[_0x1362('0xbd')]>=_0x2b93d3[_0x1362('0xc2')]){rpcDb['createCustomerFinal'](_0x27faf3,_0x1362('0xc0'));}else{rpcDb[_0x1362('0xa7')](ut[_0x1362('0xa8')](_0x27faf3,_0x1362('0xbd'),_0x2b93d3[_0x1362('0xc3')]),_0x27faf3[_0x1362('0xaa')],_0x27faf3[_0x1362('0xc4')]);}}break;case _0x1362('0xc5'):_0x2b93d3[_0x1362('0x42')]+=0x1;_0x27faf3[_0x1362('0xc6')]+=0x1;_0x27faf3[_0x1362('0x9c')]=ut[_0x1362('0x9d')](_0x27faf3);ut[_0x1362('0x8c')](_0x27faf3,0x3,_0x1362('0xc7'));ami[_0x1362('0x61')](_0x1362('0xc8'),ut[_0x1362('0x9f')](_0x27faf3,_0x1362('0xc9')));rpcDb[_0x1362('0x91')](_0x27faf3,_0x1362('0xca'));if(ut['totalGlobal'](_0x27faf3)>=_0x2b93d3[_0x1362('0xa2')]){_0x22c87c=ut[_0x1362('0xa3')](_0x27faf3,0xf,_0x1362('0xa4'));rpcDb[_0x1362('0x94')](_0x22c87c,_0x1362('0xcb'));}else{if(_0x27faf3[_0x1362('0xc6')]>=_0x2b93d3[_0x1362('0xcc')]){rpcDb[_0x1362('0x94')](_0x27faf3,_0x1362('0xca'));}else{rpcDb[_0x1362('0xa7')](ut[_0x1362('0xa8')](_0x27faf3,_0x1362('0xc6'),_0x2b93d3[_0x1362('0xcd')]),_0x27faf3[_0x1362('0xaa')],_0x27faf3[_0x1362('0xc4')]);}}break;case _0x1362('0xce'):_0x2b93d3['outboundCongestionCallsDay']+=0x1;_0x27faf3[_0x1362('0xcf')]+=0x1;_0x27faf3['countglobal']=ut[_0x1362('0x9d')](_0x27faf3);ut[_0x1362('0x8c')](_0x27faf3,0x8,'Congestion');ami[_0x1362('0x61')](_0x1362('0xd0'),ut[_0x1362('0x9f')](_0x27faf3,_0x1362('0xd1')));rpcDb[_0x1362('0x91')](_0x27faf3,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x1362('0x9d')](_0x27faf3)>=_0x2b93d3[_0x1362('0xa2')]){_0x22c87c=ut[_0x1362('0xa3')](_0x27faf3,0xf,_0x1362('0xa4'));rpcDb[_0x1362('0x94')](_0x22c87c,_0x1362('0xd2'));}else{if(_0x27faf3[_0x1362('0xcf')]>=_0x2b93d3[_0x1362('0xd3')]){rpcDb['createCustomerFinal'](_0x27faf3,_0x1362('0xd4'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x27faf3,_0x1362('0xcf'),_0x2b93d3[_0x1362('0xc3')]),_0x27faf3[_0x1362('0xaa')],_0x27faf3[_0x1362('0xc4')]);}}break;case _0x1362('0xd5'):_0x2b93d3['outboundRejectCallsDay']+=0x1;_0x27faf3[_0x1362('0xd6')]+=0x1;_0x27faf3['countglobal']=ut['totalGlobal'](_0x27faf3);ut[_0x1362('0x8c')](_0x27faf3,0x14,'AgentReject');ami[_0x1362('0x61')](_0x1362('0xd7'),ut[_0x1362('0x9f')](_0x27faf3,'agentreject'));rpcDb[_0x1362('0x91')](_0x27faf3,_0x1362('0xd8'));if(ut[_0x1362('0x9d')](_0x27faf3)>=_0x2b93d3[_0x1362('0xa2')]){_0x22c87c=ut[_0x1362('0xa3')](_0x27faf3,0x14,_0x1362('0xd9'));rpcDb[_0x1362('0x94')](_0x22c87c,_0x1362('0xda'));}else{if(_0x27faf3[_0x1362('0xd6')]>=_0x2b93d3['dialAgentRejectMaxRetry']){rpcDb[_0x1362('0x94')](_0x27faf3,_0x1362('0xda'));}else{rpcDb[_0x1362('0xa7')](ut[_0x1362('0xa8')](_0x27faf3,_0x1362('0xd6'),_0x2b93d3['dialAgentRejectRetryFrequency']),_0x27faf3[_0x1362('0xaa')],_0x27faf3[_0x1362('0xc4')]);}}break;case _0x1362('0xdb'):_0x2b93d3[_0x1362('0x47')]+=0x1;_0x27faf3[_0x1362('0xdc')]+=0x1;_0x27faf3[_0x1362('0x9c')]=ut[_0x1362('0x9d')](_0x27faf3);ut[_0x1362('0x8c')](_0x27faf3,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x27faf3,_0x1362('0xdd'));if(ut[_0x1362('0x9d')](_0x27faf3)>=_0x2b93d3['dialGlobalMaxRetry']){_0x22c87c=ut['cloneAction'](_0x27faf3,0xf,'Global');rpcDb[_0x1362('0x94')](_0x22c87c,_0x1362('0xdd'));}else{if(_0x27faf3[_0x1362('0xde')]>=_0x2b93d3[_0x1362('0xdf')]){rpcDb[_0x1362('0x94')](_0x27faf3,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x27faf3,'countabandonedretry',_0x2b93d3[_0x1362('0xe0')]),_0x27faf3[_0x1362('0xaa')],_0x27faf3['activeContact']);}}break;case'18':_0x2b93d3[_0x1362('0x46')]+=0x1;_0x27faf3['countmachineretry']+=0x1;_0x27faf3[_0x1362('0x9c')]=ut[_0x1362('0x9d')](_0x27faf3);ut[_0x1362('0x8c')](_0x27faf3,0x12,_0x57d3e5[_0x1362('0xe1')]||_0x57d3e5[_0x1362('0xe2')]);ami[_0x1362('0x61')](_0x1362('0xe3'),ut[_0x1362('0x9f')](_0x27faf3,_0x1362('0xe4')));rpcDb[_0x1362('0x91')](_0x27faf3,_0x1362('0xe5'));if(ut['totalGlobal'](_0x27faf3)>=_0x2b93d3[_0x1362('0xa2')]){_0x22c87c=ut[_0x1362('0xa3')](_0x27faf3,0xf,_0x1362('0xa4'));rpcDb['createCustomerFinal'](_0x22c87c,_0x1362('0xe5'));}else{rpcDb[_0x1362('0x94')](_0x27faf3,_0x1362('0xe5'));}delete this[_0x1362('0x16')][_0x57d3e5['linkedid']];break;case'19':_0x2b93d3[_0x1362('0x46')]+=0x1;_0x27faf3[_0x1362('0x9c')]=ut[_0x1362('0x9d')](_0x27faf3);ut[_0x1362('0x8c')](_0x27faf3,0x13,_0x57d3e5[_0x1362('0xe1')]||_0x57d3e5[_0x1362('0xe2')]);ami[_0x1362('0x61')]('custom:amd',ut['buildObj'](_0x27faf3,_0x1362('0xe4')));rpcDb[_0x1362('0x91')](_0x27faf3,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x27faf3)>=_0x2b93d3[_0x1362('0xa2')]){_0x22c87c=ut[_0x1362('0xa3')](_0x27faf3,0xf,_0x1362('0xa4'));rpcDb[_0x1362('0x94')](_0x22c87c,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x1362('0x94')](_0x27faf3,_0x1362('0xe6'));}delete this[_0x1362('0x16')][_0x57d3e5[_0x1362('0xab')]];break;default:if(_0x27faf3[_0x1362('0x7e')]){ut[_0x1362('0x7f')](_0x2b93d3,_0x1362('0xe7'));ut[_0x1362('0x80')](_0x1362('0xe8')+_0x2b93d3[_0x1362('0x2a')],_0x57d3e5);}_0x2b93d3[_0x1362('0x46')]+=0x1;_0x27faf3[_0x1362('0x9c')]=ut['totalGlobal'](_0x27faf3);ut[_0x1362('0x8c')](_0x27faf3,0xc,_0x57d3e5[_0x1362('0xe1')]||_0x57d3e5[_0x1362('0xe2')]);rpcDb[_0x1362('0x91')](_0x27faf3,_0x1362('0xe9'));if(ut[_0x1362('0x9d')](_0x27faf3)>=_0x2b93d3[_0x1362('0xa2')]){_0x22c87c=ut[_0x1362('0xa3')](_0x27faf3,0xf,_0x1362('0xa4'));rpcDb[_0x1362('0x94')](_0x22c87c,_0x1362('0xea'));}else{rpcDb[_0x1362('0x94')](_0x27faf3,_0x1362('0xea'));}delete this[_0x1362('0x16')][_0x57d3e5[_0x1362('0xab')]];}if(!(_0x27faf3['dialAnswer']&&_0x5ebd7b==='16')){ut[_0x1362('0x7c')](_0x2b93d3,'[callProgressDetectingCustomer]');logger[_0x1362('0x5d')](_0x1362('0xeb'),_0x27faf3[_0x1362('0xec')],_0x1362('0xb0'),_0x2b93d3['name'],_0x1362('0x72'),_0x2b93d3[_0x1362('0x50')]);}if(_0x5ebd7b!==_0x1362('0xac')){delete this['actions'][_0x57d3e5['linkedid']];delete this[_0x1362('0x16')][_0x57d3e5['destlinkedid']];}}};Preview[_0x1362('0x10')]['callProgressDetectingAgent']=function(_0x40d924,_0x546ed1,_0x147b09){if(_[_0x1362('0xed')](_0x546ed1)&&_0x1362('0xee')!==typeof _0x546ed1){return;}if(_[_0x1362('0xed')](_0x147b09)&&'object'!==typeof _0x147b09){return;}switch(_0x147b09[_0x1362('0xef')]){case'0':ut[_0x1362('0xf0')](_0x40d924,0x0,_0x1362('0x9e'));rpcDb[_0x1362('0xf1')](_0x40d924,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x1362('0xf0')](_0x40d924,0x3,_0x1362('0xc7'));rpcDb['createAgentHistory'](_0x40d924,_0x1362('0xf2'));break;case'5':ut[_0x1362('0xf0')](_0x40d924,0x5,_0x1362('0xbe'));rpcDb[_0x1362('0xf1')](_0x40d924,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x1362('0xf0')](_0x40d924,0x8,'Congestion');rpcDb[_0x1362('0xf1')](_0x40d924,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x1362('0xf0')](_0x40d924,0x16,_0x1362('0xf3'));rpcDb[_0x1362('0xf1')](_0x40d924,_0x1362('0xf4'));break;default:ut[_0x1362('0xf0')](_0x40d924,0xc,_0x147b09[_0x1362('0xef')]);rpcDb[_0x1362('0xf1')](_0x40d924,'[callProgressDetectingAgent][logCongestion]');}ut[_0x1362('0x7c')](_0x546ed1,'[callProgressDetectingAgent]');logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x40d924['uniqueid'],_0x1362('0xb0'),_0x546ed1[_0x1362('0x2a')],_0x1362('0x72'),_0x546ed1[_0x1362('0x50')]);delete this['actions'][_0x40d924['uniqueid']];};Preview[_0x1362('0x10')][_0x1362('0xf5')]=function(_0x5d2e82,_0x52f7aa,_0x5aa9a6,_0x37b599,_0x22318f){var _0x1df4e4=this;return new BPromise(function(_0x35a1e7,_0x48a20b){if(_[_0x1362('0x6f')](_0x52f7aa)||_['isNil'](_0x52f7aa[_0x1362('0xf6')])||_[_0x1362('0x6f')](_0x52f7aa[_0x1362('0xf6')][_0x1362('0xf7')])||_['isNil'](_0x52f7aa['VoiceQueueId'])){_0x48a20b(ut[_0x1362('0x65')](_0x1362('0xf8'),_0x37b599,_0x22318f));return;}var _0x3e6ddd=uuid['v4']();var _0x295b97=_0x1df4e4[_0x1362('0x15')][_0x52f7aa[_0x1362('0xf9')][_0x1362('0x2a')]];var _0x1d00e8=_0x5aa9a6?_0x1df4e4[_0x1362('0x17')][_0x5aa9a6]['id']:undefined;_0x1df4e4[_0x1362('0x16')][_0x3e6ddd]=new Action(_0x52f7aa,_0x295b97,_0x3e6ddd,_0x5aa9a6,_0x1d00e8);var _0x1713f0=_0x1df4e4[_0x1362('0x16')][_0x3e6ddd];_0x1713f0[_0x1362('0xaa')]=_0x37b599;_0x1713f0[_0x1362('0xc4')]=_0x22318f;_0x1713f0[_0x1362('0xfa')]=_0x5aa9a6;if(_['isEmpty'](_0x5d2e82)){_0x1df4e4[_0x1362('0xfb')](_0x1713f0,_0x295b97,_0x52f7aa,_0x5aa9a6)[_0x1362('0x84')](function(_0x442222){logger['info']('[Preview][execCall][success]',_0x1362('0xfc')+_0x1713f0[_0x1362('0x71')]+_0x1362('0xfd')+_0x1713f0[_0x1362('0xfe')],JSON[_0x1362('0x5b')](_0x442222));ami[_0x1362('0x61')](_0x1362('0xff'),ut[_0x1362('0x9f')](_0x1713f0,_0x1362('0x100'),_0x1df4e4[_0x1362('0x15')][_0x1713f0['queue']]));_0x35a1e7(ut[_0x1362('0x65')]('Calling'));})['catch'](function(_0x2877a8){ut[_0x1362('0x67')](_0x1362('0x101'),_0x2877a8);_0x48a20b(ut[_0x1362('0x65')]('Call\x20failed',_0x37b599,_0x22318f));});}else{_0x295b97[_0x1362('0x3d')]+=0x1;ut[_0x1362('0x102')](_0x1713f0);rpcDb[_0x1362('0x103')](_0x1713f0,_0x1362('0x104'));delete _0x1df4e4['actions'][_0x3e6ddd];_0x48a20b(ut[_0x1362('0x65')](_0x1362('0x105'),_0x37b599,_0x22318f));}});};Preview[_0x1362('0x10')][_0x1362('0x97')]=function(_0x32d9ef){return!_[_0x1362('0x6f')](_0x32d9ef)&&!_[_0x1362('0x6f')](_0x32d9ef[_0x1362('0x2a')])&&!_[_0x1362('0x6f')](_0x32d9ef[_0x1362('0x58')])&&_0x32d9ef[_0x1362('0x58')]&&!_[_0x1362('0x6f')](this[_0x1362('0x106')][util[_0x1362('0x5c')](_0x1362('0x107'),_0x32d9ef[_0x1362('0x2a')])])&&!_[_0x1362('0x6f')](this[_0x1362('0x106')][util[_0x1362('0x5c')](_0x1362('0x107'),_0x32d9ef['name'])][_0x1362('0x108')])&&(this[_0x1362('0x106')][util[_0x1362('0x5c')](_0x1362('0x107'),_0x32d9ef[_0x1362('0x2a')])]['status']===_0x1362('0x109')||this[_0x1362('0x106')][util['format'](_0x1362('0x107'),_0x32d9ef[_0x1362('0x2a')])][_0x1362('0x108')]==='unmonitored');};Preview[_0x1362('0x10')]['run']=function(_0x239b35,_0x4928f1){var _0x2e40ee=this;return new BPromise(function(_0x31749d,_0x198df1){_0x2e40ee[_0x1362('0x10a')](_0x239b35,_0x4928f1)[_0x1362('0x84')](function(_0x37bf02){_0x31749d(_[_0x1362('0x74')](_0x37bf02,[_0x1362('0x65')]));})['catch'](function(_0x296ae0){if(_0x296ae0['unlock']){rpcDb[_0x1362('0x10b')](_0x239b35);}if(_0x296ae0[_0x1362('0x58')]){rpcDb[_0x1362('0x10c')](_0x239b35);}_0x198df1(_[_0x1362('0x74')](_0x296ae0,[_0x1362('0x65')]));});});};Preview[_0x1362('0x10')][_0x1362('0x10a')]=function(_0x36a0ff,_0x12892f){var _0x157e39=this;return new BPromise(function(_0x3e88cc,_0x803b6f){var _0x2d79bd,_0x548e14;rpcDb[_0x1362('0x10d')](_0x36a0ff)['then'](function(_0x25fd1e){if(!_[_0x1362('0x6f')](_0x25fd1e[0x0])){_0x548e14=_0x25fd1e[0x0]['recallme']?![]:!![];_0x2d79bd=_0x25fd1e[0x0][_0x1362('0x10e')]?!![]:![];_0x2d79bd=_0x12892f?!![]:_0x2d79bd;}var _0x2412f4=_0x157e39['validateContact'](_0x25fd1e);if(_0x2412f4['isValid']){rpcDb[_0x1362('0x10f')](_[_0x1362('0x74')](_0x25fd1e[0x0],[_0x1362('0x76'),_0x1362('0x110')]))[_0x1362('0x84')](function(_0x4d3612){_0x157e39[_0x1362('0xf5')](_0x4d3612,_0x25fd1e[0x0],_0x12892f,_0x548e14,_0x2d79bd)['then'](function(_0x55d172){_0x3e88cc(_0x55d172);})[_0x1362('0x7a')](function(_0x136c57){_0x803b6f(_0x136c57);});})['catch'](function(_0x17a7b9){ut[_0x1362('0x67')]('[Preview][checkIsBlackList]',_0x17a7b9);_0x803b6f(ut[_0x1362('0x65')](_0x1362('0x111'),_0x548e14,_0x2d79bd));});}else{_0x803b6f(ut[_0x1362('0x65')](_0x2412f4[_0x1362('0x65')],_0x548e14,_0x2d79bd));}})[_0x1362('0x7a')](function(_0x24668d){ut[_0x1362('0x67')](_0x1362('0x112'),_0x24668d);_0x803b6f(ut[_0x1362('0x65')](_0x1362('0x111'),![],!![]));});});};Preview['prototype'][_0x1362('0x113')]=function(_0x589870){if(_['isNil'](_0x589870)||_['isEmpty'](_0x589870)||!_[_0x1362('0x6f')](_0x589870[0x0][_0x1362('0x114')])&&_[_0x1362('0x6f')](_0x589870[0x0][_0x1362('0x114')][_0x1362('0x2a')])){ut[_0x1362('0x67')]('[Preview][validateContact][Empty\x20Contact]',_0x589870);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x409980=this[_0x1362('0x15')][_0x589870[0x0]['Queue'][_0x1362('0x2a')]];_0x409980[_0x1362('0x65')]=_0x1362('0x99');if(_[_0x1362('0x6f')](_0x409980)){ut['logger'](_0x1362('0x115'),_0x409980);return{'isValid':![],'message':_0x1362('0x116')};}if(!this[_0x1362('0x97')](_0x409980[_0x1362('0x57')])){ut['logger'](_0x1362('0x117'),_0x1362('0x118')+_0x409980[_0x1362('0x2a')]+_0x1362('0x119'));if(!this['isTrunkReachable'](_0x409980['TrunkBackup'])){ut['logger'](_0x1362('0x117'),_0x409980[_0x1362('0x2a')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x1362('0x11a')};}}if(!ut[_0x1362('0x11b')](_0x409980[_0x1362('0x38')])){ut[_0x1362('0x67')]('[Preview][validateContact][Campaign\x20Active]',_0x409980[_0x1362('0x2a')]+_0x1362('0x11c'));return{'isValid':![],'message':_0x1362('0x118')+_0x409980[_0x1362('0x2a')]+_0x1362('0x11c')};}return{'isValid':!![],'message':_0x1362('0x11d')};};Preview[_0x1362('0x10')]['execCall']=function(_0x40b160,_0x38ab56,_0x46f0d8,_0x4afff8){var _0x160eeb=this;return new BPromise(function(_0x907ddd,_0x381300){var _0x177073=_0x40b160[_0x1362('0xec')];var _0x26f9bb=_0x160eeb['isTrunkReachable'](_0x38ab56[_0x1362('0x57')])?util[_0x1362('0x5c')](_0x1362('0x11e'),_0x38ab56[_0x1362('0x57')][_0x1362('0x2a')],_[_0x1362('0x6f')](_0x38ab56[_0x1362('0x11f')])?'':_0x38ab56[_0x1362('0x11f')][_0x1362('0x120')]()||'',_0x38ab56[_0x1362('0x121')]>0x0?_0x46f0d8['Contact']['phone'][_0x1362('0x122')](_0x38ab56[_0x1362('0x121')]):_0x46f0d8[_0x1362('0xf6')][_0x1362('0xf7')]):util[_0x1362('0x5c')]('SIP/%s/%s%s',_[_0x1362('0x6f')](_0x38ab56[_0x1362('0x98')])?_0x38ab56[_0x1362('0x57')][_0x1362('0x2a')]:_0x38ab56[_0x1362('0x98')][_0x1362('0x2a')],_['isNil'](_0x38ab56[_0x1362('0x11f')])?'':_0x38ab56['dialPrefix'][_0x1362('0x120')]()||'',_0x38ab56[_0x1362('0x121')]>0x0?_0x46f0d8['Contact']['phone'][_0x1362('0x122')](_0x38ab56[_0x1362('0x121')]):_0x46f0d8[_0x1362('0xf6')][_0x1362('0xf7')]);var _0x15879e=_0x160eeb[_0x1362('0x97')](_0x38ab56[_0x1362('0x57')])?ut[_0x1362('0x123')](_0x38ab56[_0x1362('0x57')][_0x1362('0x59')],_0x38ab56[_0x1362('0x124')],_0x38ab56[_0x1362('0x125')]>0x0?ut['getCallerIdRandom'](_0x38ab56[_0x1362('0x3a')],_0x38ab56[_0x1362('0x125')]):_0x38ab56['dialOriginateCallerIdNumber']):ut[_0x1362('0x123')](_[_0x1362('0x6f')](_0x38ab56[_0x1362('0x98')])?_0x38ab56[_0x1362('0x57')][_0x1362('0x59')]:_0x38ab56['TrunkBackup'][_0x1362('0x59')],_0x38ab56[_0x1362('0x124')],_0x38ab56['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x38ab56[_0x1362('0x3a')],_0x38ab56[_0x1362('0x125')]):_0x38ab56['dialOriginateCallerIdNumber']);if(_0x15879e){_0x40b160[_0x1362('0x126')]=ut[_0x1362('0x127')](_0x15879e);_0x40b160[_0x1362('0x128')]=ut[_0x1362('0x129')](_0x15879e);}var _0x56087b=ut[_0x1362('0x12a')](_0x38ab56,_0x46f0d8,_0x26f9bb,_0x15879e,_0x177073,_0x40b160);_[_0x1362('0x12b')](_0x40b160,ut[_0x1362('0x12c')](_0x56087b));_0x40b160[_0x1362('0x12d')]=moment()[_0x1362('0x5c')](_0x1362('0x8a'));ami[_0x1362('0x78')](ut['variablesAction'](_0x40b160,_0x38ab56,_0x56087b,_0x40b160['activeContact'],_0x4afff8))[_0x1362('0x84')](function(_0x2632aa){var _0xdab474=_0x40b160[_0x1362('0x12e')];if(!_['isNil'](_0xdab474)){if(!_[_0x1362('0x6f')](_0x160eeb[_0x1362('0x17')][_0xdab474])){_0x160eeb['agents'][_0xdab474][_0x1362('0x12f')]=_0x40b160['calleridnum'];emit(util[_0x1362('0x5c')](_0x1362('0x130'),_0x160eeb[_0x1362('0x17')][_0xdab474][_0x1362('0x2a')]),_0x1362('0x131'),{'destaccountcode':_0x160eeb[_0x1362('0x17')][_0xdab474]['accountcode'],'destconnectedlinenum':_0x40b160[_0x1362('0x132')]});}}_0x38ab56[_0x1362('0x50')]+=0x1;logger['info'](_0x1362('0x133'),_0x177073,'\x20Queue',_0x38ab56[_0x1362('0x2a')],_0x1362('0x72'),_0x38ab56[_0x1362('0x50')]);_0x907ddd(_0x2632aa);})['catch'](function(_0x358a2b){ut[_0x1362('0xf0')](_0x40b160,0xe,_0x1362('0x134'));rpcDb[_0x1362('0xf1')](_0x40b160,'[originateFailure][logOriginateFailure]');_0x381300(_0x358a2b);});});};Preview['prototype'][_0x1362('0x21')]=function(_0x206d31){if(this[_0x1362('0x16')][_0x206d31[_0x1362('0xab')]]){this[_0x1362('0x16')][_0x206d31['linkedid']][_0x1362('0x79')]=_0x206d31['channel'];}};Preview['prototype']['syncOriginateResponse']=function(_0x17137d){var _0x27971c=this;var _0x3aa74d=this[_0x1362('0x16')][_0x17137d[_0x1362('0x135')]];if(_0x3aa74d){if(_0x3aa74d['lookAgent']&&this[_0x1362('0x17')][_0x3aa74d['lookAgent']]){ut[_0x1362('0x136')](_0x3aa74d,this[_0x1362('0x17')][_0x3aa74d['lookAgent']]['name'],this[_0x1362('0x17')][_0x3aa74d['lookAgent']]['id']);}var _0x644b0a=_[_0x1362('0x137')](_0x3aa74d);_0x644b0a[_0x1362('0xad')]=moment()[_0x1362('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x15b22e=_0x27971c[_0x1362('0x15')][_0x3aa74d[_0x1362('0x71')]];if(ut[_0x1362('0x138')](_0x17137d[_0x1362('0x139')])){if(_0x3aa74d[_0x1362('0xaa')]){rpcDb[_0x1362('0x10b')](_0x3aa74d['idContact']);}if(_0x3aa74d[_0x1362('0xc4')]){rpcDb[_0x1362('0x10c')](_0x3aa74d[_0x1362('0xfe')]);}ami[_0x1362('0x61')](_0x1362('0x13a'),ut['buildObj'](_0x3aa74d,'rejected',this[_0x1362('0x15')][_0x3aa74d['queue']]));this[_0x1362('0x13b')](_0x644b0a,_0x15b22e,_0x17137d);}else{_0x3aa74d[_0x1362('0x12d')]=moment()[_0x1362('0x5c')](_0x1362('0x8a'));ut[_0x1362('0xf0')](_0x644b0a,0x4,'Answer');rpcDb[_0x1362('0xf1')](_0x644b0a,_0x1362('0x13c'));}}};Preview[_0x1362('0x10')][_0x1362('0x1c')]=function(_0x1a7b41){var _0x56e4c5=this;var _0xb8761e=this['actions'][_0x1a7b41['linkedid']];var _0x315def;if(_0xb8761e){_0x315def=this['campaignsPreview'][_0xb8761e[_0x1362('0x71')]];logger['info']('[syncHangup][talking]',_0x1a7b41[_0x1362('0xab')],_0x1362('0xb0'),_0x315def[_0x1362('0x2a')],_0x1362('0x73'),_0x315def['pTalking']);}if(this[_0x1362('0x16')][_0x1a7b41[_0x1362('0xab')]]&&_0x1a7b41[_0x1362('0xab')]!==_0x1a7b41['uniqueid']){if(_0x1a7b41[_0x1362('0x13d')]==='16'&&this[_0x1362('0x16')][_0x1a7b41[_0x1362('0xab')]][_0x1362('0x7e')]){this['callProgressDetectingCustomer'](_0x1a7b41,_0x1a7b41[_0x1362('0xab')],_0x1a7b41[_0x1362('0x13d')]);}else if(this[_0x1362('0x16')][_0x1a7b41['linkedid']][_0x1362('0x7e')]){logger[_0x1362('0x5d')]('[syncHangup][talking][cause]',_0x1a7b41['linkedid'],_0x1a7b41['cause'],_0x1362('0xb0'),_0x315def[_0x1362('0x2a')],_0x1362('0x73'),_0x315def[_0x1362('0x2f')]);this[_0x1362('0x9a')](_0x1a7b41,_0x1a7b41[_0x1362('0xab')],_0x1a7b41[_0x1362('0x13d')]);}}else if(_0xb8761e&&_[_0x1362('0x6f')](_0xb8761e[_0x1362('0x13e')])&&_0x315def['dialQueueProject']&&_0x1a7b41[_0x1362('0xab')]===_0x1a7b41[_0x1362('0xec')]&&_[_0x1362('0x6f')](_0x1a7b41[_0x1362('0xef')])&&_0x1a7b41[_0x1362('0x13d')]==='16'&&_0x1a7b41['channelstate']==='6'&&_[_0x1362('0xed')](_0xb8761e[_0x1362('0x13f')])){if(_0xb8761e['unlockAgent']){rpcDb[_0x1362('0x10b')](_0xb8761e[_0x1362('0xfe')]);}if(_0xb8761e[_0x1362('0xc4')]){rpcDb['disableContact'](_0xb8761e[_0x1362('0xfe')]);}_0x1a7b41[_0x1362('0xef')]='22';this['callProgressDetectingAgent'](_0xb8761e,_0x315def,_0x1a7b41);}else if(_0xb8761e&&_0xb8761e[_0x1362('0x13f')]){if(_0x1a7b41['cause']==='16'&&this[_0x1362('0x16')][_0x1a7b41[_0x1362('0xab')]][_0x1362('0x7e')]){logger[_0x1362('0x5d')](_0x1362('0x140'),_0x1a7b41[_0x1362('0xab')],_0x1a7b41[_0x1362('0x13d')],'\x20Queue',_0x315def[_0x1362('0x2a')],_0x1362('0x73'),_0x315def[_0x1362('0x2f')]);this[_0x1362('0x9a')](_0x1a7b41,_0x1a7b41['linkedid'],_0x1a7b41[_0x1362('0x13d')]);}else if(this['actions'][_0x1a7b41[_0x1362('0xab')]][_0x1362('0x7e')]){logger[_0x1362('0x5d')](_0x1362('0x141'),_0x1a7b41[_0x1362('0xab')],_0x1a7b41['cause'],'\x20Queue',_0x315def['name'],_0x1362('0x73'),_0x315def[_0x1362('0x2f')]);this[_0x1362('0x9a')](_0x1a7b41,_0x1a7b41[_0x1362('0xab')],_0x1a7b41[_0x1362('0x13d')]);}}};Preview[_0x1362('0x10')][_0x1362('0x1f')]=function(_0x23d5a3){if(this[_0x1362('0x16')][_0x23d5a3['destlinkedid']]&&_0x23d5a3[_0x1362('0x142')]!==_0x23d5a3['destuniqueid']){this[_0x1362('0x9a')](_0x23d5a3,_0x23d5a3['destlinkedid'],_0x23d5a3['dialstatus']);}};Preview[_0x1362('0x10')][_0x1362('0x1e')]=function(_0x1209c0){if(this[_0x1362('0x16')][_0x1209c0['linkedid']]&&_0x1209c0[_0x1362('0xab')]!==_0x1209c0[_0x1362('0xec')]&&!this[_0x1362('0x16')][_0x1209c0['linkedid']][_0x1362('0x7e')]){if(_0x1209c0[_0x1362('0x13d')]==='1'){this[_0x1362('0x9a')](_0x1209c0,_0x1209c0[_0x1362('0xab')],_0x1209c0[_0x1362('0x13d')]);}}};Preview[_0x1362('0x10')][_0x1362('0x143')]=function(_0x3c5e30,_0x5cff2d,_0x15e828){if(this[_0x1362('0x16')][_0x3c5e30]){if(_[_0x1362('0x6f')](this['actions'][_0x3c5e30][_0x1362('0x144')])){this[_0x1362('0x16')][_0x3c5e30]['variables']={};}this[_0x1362('0x16')][_0x3c5e30]['variables'][_0x5cff2d]=_0x15e828;}};Preview[_0x1362('0x10')][_0x1362('0x23')]=function(_0x36efa7){try{if(!_[_0x1362('0x6f')](_0x36efa7)){if(ut['filterKey'](_['keys'](_0x36efa7[_0x1362('0x145')])[0x0])){this[_0x1362('0x143')](_0x36efa7[_0x1362('0xec')],_[_0x1362('0x146')](_0x36efa7[_0x1362('0x145')])[0x0],_0x36efa7[_0x1362('0x147')]);}}}catch(_0x3f9626){logger['error'](_0x1362('0x148'),util['inspect'](_0x3f9626,{'showHidden':![],'depth':null}));}};Preview[_0x1362('0x10')][_0x1362('0x149')]=function(_0x5d1df2){if(_0x5d1df2){if(this[_0x1362('0x16')][_0x5d1df2[_0x1362('0x14a')]]){this[_0x1362('0x16')][_0x5d1df2[_0x1362('0x14a')]][_0x1362('0x13f')]=!![];}}};Preview[_0x1362('0x10')][_0x1362('0x26')]=function(_0x2d10b0){if(_0x2d10b0){if(this[_0x1362('0x16')][_0x2d10b0[_0x1362('0x14b')]]){this[_0x1362('0x16')][_0x2d10b0['transfererlinkedid']][_0x1362('0x13f')]=!![];}}};module[_0x1362('0x14c')]=Preview;
\ No newline at end of file
+var _0x4f85=['[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','[syncHangup][talking][decrement]','\x20Queue','BUSY','Busy','custom:agentbusy','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','rescheduleContact','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedretry','cause-txt','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','NoSuchNumber','createAgentHistory','NoAnswer','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Queue','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','phone','substring','trim','getCallerId','callerid','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','channelAgent','calleridnum','user:%s','[originated][increment]','actionid','lookAgent','clone','response','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','cause','statedesc','dialQueueProject','reason','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfer','syncBlindTransfer','transfererlinkedid','util','uuid','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','sequence','voiceQueues','trunks','actions','agents','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','outbound','name','strategy','answered','available','sumDuration','total','type','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','\x20is\x20disactive','prototype','syncCampaigns','campaignsPreview','clockClearZombieChannels','hasOwnProperty','dialMethod','clearZombieChannels','dialActive','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','originated:\x20','pTalking:\x20','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','loggerError','[action]','agentReadyId','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','activeContact','linkedid','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','decrementTalkink','Answer'];(function(_0x385768,_0x401edc){var _0x2c44e8=function(_0x2bbda5){while(--_0x2bbda5){_0x385768['push'](_0x385768['shift']());}};_0x2c44e8(++_0x401edc);}(_0x4f85,0x8f));var _0x54f8=function(_0x2d5fcd,_0x5753c0){_0x2d5fcd=_0x2d5fcd-0x0;var _0x585835=_0x4f85[_0x2d5fcd];return _0x585835;};'use strict';var util=require(_0x54f8('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x54f8('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x54f8('0x2'));var config=require('../../../config/environment');var logger=require(_0x54f8('0x3'))(_0x54f8('0x4'));var loggerAction=require(_0x54f8('0x3'))(_0x54f8('0x5'));var ami=require(_0x54f8('0x6'));var rpcDb=require(_0x54f8('0x7'));var Action=require(_0x54f8('0x8'));var ut=require(_0x54f8('0x9'));config[_0x54f8('0xa')]=_[_0x54f8('0xb')](config[_0x54f8('0xa')],{'host':_0x54f8('0xc'),'port':0x18eb});var io=require(_0x54f8('0xd'))(new Redis(config[_0x54f8('0xa')]));var Sequence=function(){};Sequence['prototype'][_0x54f8('0xe')]=function(_0x6fc66a){this['tail']=this[_0x54f8('0xf')]?this['tail']['finally'](_0x6fc66a):_0x6fc66a();};function Preview(_0x1c8250){this[_0x54f8('0x10')]=new Sequence();this['campaignsPreview']=_0x1c8250[_0x54f8('0x11')];this[_0x54f8('0x12')]=_0x1c8250[_0x54f8('0x12')];this[_0x54f8('0x13')]={};this[_0x54f8('0x14')]=_0x1c8250[_0x54f8('0x14')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0x54f8('0x15')][_0x54f8('0x16')](this));ami['on']('hangup',this['syncHangup'][_0x54f8('0x16')](this));ami['on'](_0x54f8('0x17'),this[_0x54f8('0x18')][_0x54f8('0x16')](this));ami['on'](_0x54f8('0x19'),this[_0x54f8('0x1a')][_0x54f8('0x16')](this));ami['on'](_0x54f8('0x1b'),this[_0x54f8('0x1c')]['bind'](this));ami['on']('varset',this[_0x54f8('0x1d')][_0x54f8('0x16')](this));ami['on'](_0x54f8('0x1e'),this[_0x54f8('0x1f')]['bind'](this));ami['on'](_0x54f8('0x20'),this['syncBlindTransfer']['bind'](this));this[_0x54f8('0x21')](this['campaignsPreview']);}function emit(_0x3ea99a,_0x20185d,_0x477236){io['to'](_0x3ea99a)[_0x54f8('0x22')](_0x20185d,_0x477236);}function emitCampaignPreview(_0x5468e8){if(_0x5468e8['type']===_0x54f8('0x23')){var _0x429adf={'id':_0x5468e8['id'],'name':_0x5468e8[_0x54f8('0x24')],'strategy':_0x5468e8[_0x54f8('0x25')],'answered':_0x5468e8[_0x54f8('0x26')],'available':_0x5468e8[_0x54f8('0x27')],'loggedIn':_0x5468e8['loggedIn'],'pTalking':_0x5468e8['pTalking'],'sumBillable':_0x5468e8['sumBillable'],'sumDuration':_0x5468e8[_0x54f8('0x28')],'sumHoldTime':_0x5468e8['sumHoldTime']||0x0,'talking':_0x5468e8['talking'],'total':_0x5468e8[_0x54f8('0x29')],'type':_0x5468e8[_0x54f8('0x2a')],'unmanaged':_0x5468e8['unmanaged'],'abandoned':_0x5468e8['abandoned'],'waiting':_0x5468e8['waiting'],'loggedInDb':_0x5468e8['loggedInDb'],'dialActive':_0x5468e8['dialActive'],'dialMethod':_0x5468e8['dialMethod'],'dialOriginateCallerIdName':_0x5468e8[_0x54f8('0x2b')],'dialOriginateCallerIdNumber':_0x5468e8[_0x54f8('0x2c')],'dialOriginateTimeout':_0x5468e8[_0x54f8('0x2d')],'dialPrefix':_0x5468e8[_0x54f8('0x2e')],'outboundAnswerAgiCallsDay':_0x5468e8['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x5468e8[_0x54f8('0x2f')],'outboundBlacklistCallsDay':_0x5468e8[_0x54f8('0x30')],'outboundBusyCallsDay':_0x5468e8[_0x54f8('0x31')],'outboundCongestionCallsDay':_0x5468e8['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x5468e8[_0x54f8('0x32')],'outboundDropCallsDayCallersExit':_0x5468e8[_0x54f8('0x33')],'outboundDropCallsDayTimeout':_0x5468e8[_0x54f8('0x34')],'outboundNoAnswerCallsDay':_0x5468e8[_0x54f8('0x35')],'outboundNoSuchCallsDay':_0x5468e8[_0x54f8('0x36')],'outboundOriginateFailureCallsDay':_0x5468e8[_0x54f8('0x37')],'outboundReCallsDay':_0x5468e8['outboundReCallsDay'],'outboundRejectCallsDay':_0x5468e8[_0x54f8('0x38')],'outboundUnknownCallsDay':_0x5468e8[_0x54f8('0x39')],'outboundAbandonedCallsDay':_0x5468e8[_0x54f8('0x3a')],'predictiveIntervalAnsweredCalls':_0x5468e8[_0x54f8('0x3b')],'predictiveIntervalAvgHoldtime':_0x5468e8['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x5468e8[_0x54f8('0x3c')],'predictiveIntervalDroppedCallsCallersExit':_0x5468e8['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5468e8[_0x54f8('0x3d')],'predictiveIntervalErlangCalls':_0x5468e8['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5468e8[_0x54f8('0x3e')],'predictiveIntervalHitRate':_0x5468e8[_0x54f8('0x3f')],'predictiveIntervalMultiplicativeFactor':_0x5468e8[_0x54f8('0x40')],'predictiveIntervalPauses':_0x5468e8['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x5468e8['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5468e8[_0x54f8('0x41')],'message':_0x5468e8[_0x54f8('0x42')],'originated':_0x5468e8[_0x54f8('0x43')],'erlangCalls':_0x5468e8[_0x54f8('0x44')],'erlangCallToSecond':_0x5468e8[_0x54f8('0x45')],'erlangAbandonmentRate':_0x5468e8[_0x54f8('0x46')],'erlangBusyFactor':_0x5468e8[_0x54f8('0x47')],'startPredictive':_0x5468e8[_0x54f8('0x48')],'startProgressive':_0x5468e8[_0x54f8('0x49')]};if(_0x5468e8[_0x54f8('0x4a')]){_0x429adf[_0x54f8('0x4a')]={'id':_0x5468e8[_0x54f8('0x4a')]['id'],'name':_0x5468e8[_0x54f8('0x4a')]['name'],'active':_0x5468e8['Trunk'][_0x54f8('0x4b')],'callerid':_0x5468e8[_0x54f8('0x4a')]['callerid']};}if(_0x5468e8['Interval']){_0x429adf[_0x54f8('0x4c')]={'id':_0x5468e8[_0x54f8('0x4c')]['id'],'name':_0x5468e8[_0x54f8('0x4c')][_0x54f8('0x24')]};}var _0x2b9916=md5(JSON[_0x54f8('0x4d')](_0x429adf));if(_0x5468e8['md5']!==_0x2b9916){_0x5468e8['md5']=_0x2b9916;emit(util['format'](_0x54f8('0x4e'),_0x429adf['name']),'voice_queue:save',_0x429adf);}}}function emitVoiceQueueChannelRemove(_0x48d501){logger[_0x54f8('0x4f')](_0x54f8('0x50'),JSON[_0x54f8('0x4d')](_0x48d501));emit(util[_0x54f8('0x51')](_0x54f8('0x4e'),_0x48d501[_0x54f8('0x24')]),_0x54f8('0x52'),_0x48d501);io['emit'](_0x54f8('0x53'),_0x48d501);}function notSendMessagesQueue(_0x5385c0){if(_0x5385c0[_0x54f8('0x54')]){if(_0x5385c0[_0x54f8('0x43')]===0x0&&_0x5385c0[_0x54f8('0x55')]===0x0){_0x5385c0[_0x54f8('0x54')]=![];_0x5385c0[_0x54f8('0x27')]=0x0;_0x5385c0[_0x54f8('0x56')]=0x0;_0x5385c0[_0x54f8('0x42')]=_0x54f8('0x57');ut['logger'](_0x54f8('0x58'),_0x5385c0[_0x54f8('0x24')]+_0x54f8('0x59'));}else{_0x5385c0[_0x54f8('0x42')]=_0x54f8('0x5a');ut[_0x54f8('0x5b')](_0x54f8('0x58'),_0x5385c0[_0x54f8('0x24')]+_0x54f8('0x5c'));}emitCampaignPreview(_0x5385c0);}}Preview[_0x54f8('0x5d')][_0x54f8('0x21')]=function(){var _0x3ae413=this;setInterval(function(){_0x3ae413['syncCampaigns']();},0x7cf);};Preview['prototype'][_0x54f8('0x5e')]=function(){var _0x12f6ad=this[_0x54f8('0x5f')];this[_0x54f8('0x60')]+=0x1;for(var _0x5b816d in _0x12f6ad){if(_0x12f6ad[_0x54f8('0x61')](_0x5b816d)&&(_0x12f6ad[_0x5b816d]['dialMethod']===_0x54f8('0x4')||_0x12f6ad[_0x5b816d][_0x54f8('0x62')]==='booked')&&_0x12f6ad[_0x5b816d][_0x54f8('0x2a')]===_0x54f8('0x23')){if(this[_0x54f8('0x60')]>0x7){this[_0x54f8('0x60')]=0x0;this[_0x54f8('0x63')]();}}if(_0x12f6ad[_0x54f8('0x61')](_0x5b816d)&&_0x12f6ad[_0x5b816d][_0x54f8('0x62')]===_0x54f8('0x4')&&_0x12f6ad[_0x5b816d][_0x54f8('0x2a')]===_0x54f8('0x23')){if(_0x12f6ad[_0x5b816d][_0x54f8('0x64')]){this['setMessage'](_0x12f6ad[_0x5b816d]);this[_0x54f8('0x65')](_0x12f6ad[_0x5b816d]);}else{notSendMessagesQueue(_0x12f6ad[_0x5b816d]);}}}};Preview[_0x54f8('0x5d')][_0x54f8('0x66')]=function(_0x5a93df){var _0x5839f7=this;this[_0x54f8('0x10')][_0x54f8('0xe')](function(){if(!_[_0x54f8('0x67')](_0x5839f7[_0x54f8('0x13')][_0x5a93df])){loggerAction[_0x54f8('0x4f')](_0x54f8('0x68'),_0x5a93df,'Queue',_0x5839f7[_0x54f8('0x13')][_0x5a93df]['queue'],_0x54f8('0x69'),JSON[_0x54f8('0x4d')](_0x5839f7[_0x54f8('0x5f')][_0x5839f7['actions'][_0x5a93df]['queue']][_0x54f8('0x43')]),_0x54f8('0x6a'),JSON[_0x54f8('0x4d')](_0x5839f7[_0x54f8('0x5f')][_0x5839f7[_0x54f8('0x13')][_0x5a93df][_0x54f8('0x6b')]][_0x54f8('0x55')]),JSON[_0x54f8('0x4d')](_0x5839f7['actions'][_0x5a93df][_0x54f8('0x6c')]),JSON[_0x54f8('0x4d')](_[_0x54f8('0x6d')](_0x5839f7['actions'][_0x5a93df],[_0x54f8('0x6e'),_0x54f8('0x6f'),_0x54f8('0x70'),_0x54f8('0x71')])));return ami[_0x54f8('0x72')]({'action':_0x54f8('0x73'),'channel':_0x5839f7[_0x54f8('0x13')][_0x5a93df][_0x54f8('0x74')]})[_0x54f8('0x75')](function(_0x2eff0a){if(_0x2eff0a['message']===_0x54f8('0x76')){setTimeout(function(){if(_0x5839f7[_0x54f8('0x13')][_0x5a93df]){ut[_0x54f8('0x77')](_0x5839f7[_0x54f8('0x5f')][_0x5839f7['actions'][_0x5a93df][_0x54f8('0x6b')]],'[clearZombieChannel]');if(_0x5839f7['actions'][_0x5a93df][_0x54f8('0x6c')]===!![]){ut['decrementTalkink'](_0x5839f7[_0x54f8('0x5f')][_0x5839f7[_0x54f8('0x13')][_0x5a93df][_0x54f8('0x6b')]],'[clearZombieChannel]');ut[_0x54f8('0x78')]('[Dialer][checkChannel][pTalking][Preview]'+_0x5a93df,_0x5839f7['actions'][_0x5a93df]['queue']);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x5a93df,_0x5839f7[_0x54f8('0x13')][_0x5a93df]['queue']);delete _0x5839f7[_0x54f8('0x13')][_0x5a93df];}},0x2328);}});}});};Preview[_0x54f8('0x5d')][_0x54f8('0x63')]=function(){var _0x499b49=this;loggerAction['info'](_0x54f8('0x79'),_['size'](this[_0x54f8('0x13')]));for(var _0x497a77 in this[_0x54f8('0x13')]){if(_0x499b49[_0x54f8('0x13')][_0x54f8('0x61')](_0x497a77)){_0x499b49[_0x54f8('0x66')](_0x497a77);}}};Preview[_0x54f8('0x5d')][_0x54f8('0x65')]=function(_0x4733de){var _0x433819=this;rpcDb['getContactRecallMe'](_0x4733de['id'],ut[_0x54f8('0x7a')](this[_0x54f8('0x14')]))[_0x54f8('0x7b')](function(_0x1aa171){if(!_[_0x54f8('0x67')](_0x1aa171)){for(var _0x514163=0x0;_0x514163<_0x1aa171[_0x54f8('0x7c')];_0x514163+=0x1){if(ut[_0x54f8('0x7d')](_0x1aa171[_0x514163][_0x54f8('0x7e')])<_0x4733de['dialRecallMeTimeout']*0x3c){if(_0x1aa171[_0x514163][_0x54f8('0x7f')]&&!_0x1aa171[_0x514163][_0x54f8('0x7f')][_0x54f8('0x80')]){_0x433819[_0x54f8('0x81')](_0x1aa171[_0x514163]['id'])[_0x54f8('0x7b')](ut[_0x54f8('0x82')]('[RecallMe]'))[_0x54f8('0x75')](ut[_0x54f8('0x82')]('[RecallMe]'));}else{rpcDb[_0x54f8('0x83')](_0x1aa171[_0x514163]['id']);}}else{var _0x245d9f=new Action(_0x1aa171[_0x514163],_0x4733de);_0x245d9f[_0x54f8('0x84')]=moment()[_0x54f8('0x51')](_0x54f8('0x85'));_0x4733de[_0x54f8('0x86')]+=0x1;ut[_0x54f8('0x87')](_0x245d9f,0x17,_0x54f8('0x88'));if(_0x4733de[_0x54f8('0x89')]){rpcDb[_0x54f8('0x8a')](ut[_0x54f8('0x8b')](_0x1aa171[_0x514163]));rpcDb[_0x54f8('0x8c')](_0x245d9f,_0x54f8('0x8d'));}else{ut[_0x54f8('0x87')](_0x245d9f,0x16,'RecallFailedTimeout');rpcDb[_0x54f8('0x8c')](_0x245d9f,'[HistoryRecallClose]');rpcDb[_0x54f8('0x8e')](_0x245d9f,_0x54f8('0x8f'));}}}}})[_0x54f8('0x75')](ut[_0x54f8('0x82')](_0x54f8('0x90')));};Preview[_0x54f8('0x5d')][_0x54f8('0x91')]=function(_0x51a3bb){_0x51a3bb[_0x54f8('0x54')]=!![];if(ut[_0x54f8('0x92')](_0x51a3bb[_0x54f8('0x93')])){_0x51a3bb[_0x54f8('0x42')]=_0x54f8('0x94');}else if(!ut[_0x54f8('0x95')](_0x51a3bb['dialActive'])){_0x51a3bb[_0x54f8('0x42')]='NOT_ACTIVE';}else if(!this[_0x54f8('0x96')](_0x51a3bb[_0x54f8('0x4a')])){if(!this[_0x54f8('0x96')](_0x51a3bb[_0x54f8('0x97')])){_0x51a3bb[_0x54f8('0x42')]=_0x54f8('0x98');}else{_0x51a3bb[_0x54f8('0x42')]=_0x54f8('0x99');}}else{_0x51a3bb[_0x54f8('0x42')]='ACTIVE';}emitCampaignPreview(_0x51a3bb);};Preview['prototype'][_0x54f8('0x9a')]=function(_0x7e0108,_0x286de3,_0x3715d4){var _0x437938=this;var _0x3f695a=this[_0x54f8('0x13')][_0x286de3];var _0x53569d=this[_0x54f8('0x5f')][_0x3f695a['queue']];var _0x47fee1;if(_0x53569d){switch(_0x3715d4){case'1':_0x53569d[_0x54f8('0x36')]+=0x1;_0x3f695a[_0x54f8('0x9b')]+=0x1;_0x3f695a[_0x54f8('0x9c')]=ut['totalGlobal'](_0x3f695a);ut[_0x54f8('0x87')](_0x3f695a,0x0,'NoSuchNumber');ami[_0x54f8('0x22')]('custom:agentnosuchnumber',ut[_0x54f8('0x9d')](_0x3f695a,_0x54f8('0x9e')));rpcDb[_0x54f8('0x8c')](_0x3f695a,_0x54f8('0x9f'));if(ut[_0x54f8('0xa0')](_0x3f695a)>=_0x53569d[_0x54f8('0xa1')]){_0x47fee1=ut[_0x54f8('0xa2')](_0x3f695a,0xf,_0x54f8('0xa3'));rpcDb['createCustomerFinal'](_0x47fee1,_0x54f8('0xa4'));}else{if(_0x3f695a[_0x54f8('0x9b')]>=_0x53569d[_0x54f8('0xa5')]){rpcDb[_0x54f8('0x8e')](_0x3f695a,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut[_0x54f8('0xa6')](_0x3f695a,_0x54f8('0x9b'),_0x53569d['dialNoSuchNumberRetryFrequency']),_0x3f695a[_0x54f8('0xa7')],_0x3f695a[_0x54f8('0xa8')]);}}delete this['actions'][_0x7e0108[_0x54f8('0xa9')]];break;case'ANSWER':var _0xde7da7=moment()[_0x54f8('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x3f695a[_0x54f8('0xaa')]=_0xde7da7;_0x3f695a[_0x54f8('0xab')]=_0xde7da7;_0x3f695a[_0x54f8('0x6c')]=!![];_0x53569d[_0x54f8('0x55')]+=0x1;logger['info'](_0x54f8('0xac'),_0x3f695a[_0x54f8('0xad')],'\x20Queue',_0x53569d['name'],_0x54f8('0x6a'),_0x53569d[_0x54f8('0x55')]);ami['emit'](_0x54f8('0xae'),ut[_0x54f8('0x9d')](_0x3f695a,_0x54f8('0xaf'),this[_0x54f8('0x5f')][_0x3f695a[_0x54f8('0x6b')]]));if(_0x53569d[_0x54f8('0xb0')]){ami[_0x54f8('0x22')](_0x54f8('0xb1'),ut[_0x54f8('0xb2')](_0x3f695a));}break;case'16':ami[_0x54f8('0x22')](_0x54f8('0xb3'),ut[_0x54f8('0x9d')](_0x3f695a,_0x54f8('0xb4'),this[_0x54f8('0x5f')][_0x3f695a[_0x54f8('0x6b')]]));emitVoiceQueueChannelRemove(ut[_0x54f8('0x9d')](_0x3f695a,_0x54f8('0xb4')));_0x53569d[_0x54f8('0x2f')]+=0x1;_0x53569d[_0x54f8('0x29')]+=0x1;_0x53569d[_0x54f8('0x26')]+=0x1;ut[_0x54f8('0xb5')](_0x53569d,'[16]');_0x3f695a['countglobal']=ut[_0x54f8('0xa0')](_0x3f695a);ut[_0x54f8('0x87')](_0x3f695a,0x4,_0x54f8('0xb6'));rpcDb[_0x54f8('0x8c')](_0x3f695a,_0x54f8('0xb7'));rpcDb[_0x54f8('0x8e')](_0x3f695a,_0x54f8('0xb8'));rpcDb[_0x54f8('0xb9')](_0x3f695a);_0x53569d[_0x54f8('0x28')]+=_0x3f695a['talktime'];_0x53569d['sumBillable']+=_0x3f695a['talktime'];logger[_0x54f8('0x4f')](_0x54f8('0xba'),_0x3f695a[_0x54f8('0xad')],_0x54f8('0xbb'),_0x53569d['name'],_0x54f8('0x6a'),_0x53569d[_0x54f8('0x55')]);delete this[_0x54f8('0x13')][_0x7e0108[_0x54f8('0xa9')]];break;case _0x54f8('0xbc'):_0x53569d[_0x54f8('0x31')]+=0x1;_0x3f695a['countbusyretry']+=0x1;_0x3f695a[_0x54f8('0x9c')]=ut[_0x54f8('0xa0')](_0x3f695a);ut[_0x54f8('0x87')](_0x3f695a,0x5,_0x54f8('0xbd'));ami[_0x54f8('0x22')](_0x54f8('0xbe'),ut['buildObj'](_0x3f695a,'busy'));rpcDb[_0x54f8('0x8c')](_0x3f695a,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x54f8('0xa0')](_0x3f695a)>=_0x53569d[_0x54f8('0xa1')]){_0x47fee1=ut['cloneAction'](_0x3f695a,0xf,_0x54f8('0xa3'));rpcDb['createCustomerFinal'](_0x47fee1,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x3f695a[_0x54f8('0xbf')]>=_0x53569d[_0x54f8('0xc0')]){rpcDb[_0x54f8('0x8e')](_0x3f695a,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3f695a,'countbusyretry',_0x53569d[_0x54f8('0xc1')]),_0x3f695a[_0x54f8('0xa7')],_0x3f695a[_0x54f8('0xa8')]);}}break;case _0x54f8('0xc2'):_0x53569d['outboundNoAnswerCallsDay']+=0x1;_0x3f695a['countnoanswerretry']+=0x1;_0x3f695a['countglobal']=ut[_0x54f8('0xa0')](_0x3f695a);ut[_0x54f8('0x87')](_0x3f695a,0x3,'NoAnswer');ami[_0x54f8('0x22')](_0x54f8('0xc3'),ut[_0x54f8('0x9d')](_0x3f695a,_0x54f8('0xc4')));rpcDb[_0x54f8('0x8c')](_0x3f695a,_0x54f8('0xc5'));if(ut['totalGlobal'](_0x3f695a)>=_0x53569d[_0x54f8('0xa1')]){_0x47fee1=ut[_0x54f8('0xa2')](_0x3f695a,0xf,'Global');rpcDb[_0x54f8('0x8e')](_0x47fee1,_0x54f8('0xc6'));}else{if(_0x3f695a[_0x54f8('0xc7')]>=_0x53569d[_0x54f8('0xc8')]){rpcDb['createCustomerFinal'](_0x3f695a,_0x54f8('0xc5'));}else{rpcDb[_0x54f8('0xc9')](ut[_0x54f8('0xa6')](_0x3f695a,_0x54f8('0xc7'),_0x53569d[_0x54f8('0xca')]),_0x3f695a[_0x54f8('0xa7')],_0x3f695a[_0x54f8('0xa8')]);}}break;case _0x54f8('0xcb'):_0x53569d['outboundCongestionCallsDay']+=0x1;_0x3f695a[_0x54f8('0xcc')]+=0x1;_0x3f695a['countglobal']=ut[_0x54f8('0xa0')](_0x3f695a);ut['logCustomer'](_0x3f695a,0x8,_0x54f8('0xcd'));ami[_0x54f8('0x22')](_0x54f8('0xce'),ut[_0x54f8('0x9d')](_0x3f695a,_0x54f8('0xcf')));rpcDb[_0x54f8('0x8c')](_0x3f695a,_0x54f8('0xd0'));if(ut[_0x54f8('0xa0')](_0x3f695a)>=_0x53569d[_0x54f8('0xa1')]){_0x47fee1=ut[_0x54f8('0xa2')](_0x3f695a,0xf,_0x54f8('0xa3'));rpcDb[_0x54f8('0x8e')](_0x47fee1,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x3f695a[_0x54f8('0xcc')]>=_0x53569d[_0x54f8('0xd1')]){rpcDb[_0x54f8('0x8e')](_0x3f695a,_0x54f8('0xd0'));}else{rpcDb[_0x54f8('0xc9')](ut[_0x54f8('0xa6')](_0x3f695a,_0x54f8('0xcc'),_0x53569d[_0x54f8('0xc1')]),_0x3f695a['unlockAgent'],_0x3f695a[_0x54f8('0xa8')]);}}break;case'CANCEL':_0x53569d[_0x54f8('0x38')]+=0x1;_0x3f695a['countagentrejectretry']+=0x1;_0x3f695a[_0x54f8('0x9c')]=ut[_0x54f8('0xa0')](_0x3f695a);ut[_0x54f8('0x87')](_0x3f695a,0x14,_0x54f8('0xd2'));ami[_0x54f8('0x22')](_0x54f8('0xd3'),ut[_0x54f8('0x9d')](_0x3f695a,_0x54f8('0xd4')));rpcDb['createCustomerHistory'](_0x3f695a,_0x54f8('0xd5'));if(ut[_0x54f8('0xa0')](_0x3f695a)>=_0x53569d[_0x54f8('0xa1')]){_0x47fee1=ut[_0x54f8('0xa2')](_0x3f695a,0x14,'AgentReject');rpcDb[_0x54f8('0x8e')](_0x47fee1,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3f695a[_0x54f8('0xd6')]>=_0x53569d[_0x54f8('0xd7')]){rpcDb['createCustomerFinal'](_0x3f695a,_0x54f8('0xd8'));}else{rpcDb[_0x54f8('0xc9')](ut[_0x54f8('0xa6')](_0x3f695a,_0x54f8('0xd6'),_0x53569d[_0x54f8('0xd9')]),_0x3f695a[_0x54f8('0xa7')],_0x3f695a[_0x54f8('0xa8')]);}}break;case _0x54f8('0xda'):_0x53569d['outboundAbandonedCallsDay']+=0x1;_0x3f695a['countabandonedretry']+=0x1;_0x3f695a['countglobal']=ut[_0x54f8('0xa0')](_0x3f695a);ut[_0x54f8('0x87')](_0x3f695a,0xb,_0x54f8('0xdb'));rpcDb[_0x54f8('0x8c')](_0x3f695a,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x54f8('0xa0')](_0x3f695a)>=_0x53569d[_0x54f8('0xa1')]){_0x47fee1=ut[_0x54f8('0xa2')](_0x3f695a,0xf,'Global');rpcDb[_0x54f8('0x8e')](_0x47fee1,_0x54f8('0xdc'));}else{if(_0x3f695a['countabandonedetry']>=_0x53569d['dialAbandonedMaxRety']){rpcDb[_0x54f8('0x8e')](_0x3f695a,_0x54f8('0xdc'));}else{rpcDb['rescheduleContact'](ut[_0x54f8('0xa6')](_0x3f695a,_0x54f8('0xdd'),_0x53569d['dialAbandonedRetryFrequency']),_0x3f695a[_0x54f8('0xa7')],_0x3f695a[_0x54f8('0xa8')]);}}break;case'18':_0x53569d['outboundUnknownCallsDay']+=0x1;_0x3f695a['countmachineretry']+=0x1;_0x3f695a[_0x54f8('0x9c')]=ut['totalGlobal'](_0x3f695a);ut[_0x54f8('0x87')](_0x3f695a,0x12,_0x7e0108[_0x54f8('0xde')]||_0x7e0108['dialstatus']);ami['emit']('custom:amd',ut['buildObj'](_0x3f695a,'amd'));rpcDb[_0x54f8('0x8c')](_0x3f695a,_0x54f8('0xdf'));if(ut[_0x54f8('0xa0')](_0x3f695a)>=_0x53569d['dialGlobalMaxRetry']){_0x47fee1=ut[_0x54f8('0xa2')](_0x3f695a,0xf,'Global');rpcDb[_0x54f8('0x8e')](_0x47fee1,_0x54f8('0xdf'));}else{rpcDb[_0x54f8('0x8e')](_0x3f695a,_0x54f8('0xdf'));}delete this[_0x54f8('0x13')][_0x7e0108[_0x54f8('0xa9')]];break;case'19':_0x53569d[_0x54f8('0x39')]+=0x1;_0x3f695a[_0x54f8('0x9c')]=ut[_0x54f8('0xa0')](_0x3f695a);ut['logCustomer'](_0x3f695a,0x13,_0x7e0108[_0x54f8('0xde')]||_0x7e0108[_0x54f8('0xe0')]);ami['emit']('custom:amd',ut[_0x54f8('0x9d')](_0x3f695a,'amd'));rpcDb['createCustomerHistory'](_0x3f695a,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x3f695a)>=_0x53569d[_0x54f8('0xa1')]){_0x47fee1=ut[_0x54f8('0xa2')](_0x3f695a,0xf,_0x54f8('0xa3'));rpcDb[_0x54f8('0x8e')](_0x47fee1,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x54f8('0x8e')](_0x3f695a,'[callProgressDetectingCustomer][machine]');}delete this[_0x54f8('0x13')][_0x7e0108[_0x54f8('0xa9')]];break;default:if(_0x3f695a[_0x54f8('0x6c')]){ut[_0x54f8('0xb5')](_0x53569d,_0x54f8('0xe1'));ut[_0x54f8('0x78')](_0x54f8('0xe2')+_0x53569d[_0x54f8('0x24')],_0x7e0108);}_0x53569d[_0x54f8('0x39')]+=0x1;_0x3f695a['countglobal']=ut[_0x54f8('0xa0')](_0x3f695a);ut[_0x54f8('0x87')](_0x3f695a,0xc,_0x7e0108['cause-txt']||_0x7e0108[_0x54f8('0xe0')]);rpcDb['createCustomerHistory'](_0x3f695a,_0x54f8('0xe3'));if(ut[_0x54f8('0xa0')](_0x3f695a)>=_0x53569d[_0x54f8('0xa1')]){_0x47fee1=ut[_0x54f8('0xa2')](_0x3f695a,0xf,'Global');rpcDb[_0x54f8('0x8e')](_0x47fee1,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x54f8('0x8e')](_0x3f695a,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x7e0108['linkedid']];}if(!(_0x3f695a[_0x54f8('0x6c')]&&_0x3715d4==='16')){ut[_0x54f8('0x77')](_0x53569d,_0x54f8('0xe4'));logger[_0x54f8('0x4f')](_0x54f8('0xe5'),_0x3f695a[_0x54f8('0xad')],_0x54f8('0xbb'),_0x53569d[_0x54f8('0x24')],'originated:\x20',_0x53569d[_0x54f8('0x43')]);}if(_0x3715d4!==_0x54f8('0xe6')){delete this[_0x54f8('0x13')][_0x7e0108[_0x54f8('0xa9')]];delete this[_0x54f8('0x13')][_0x7e0108[_0x54f8('0xe7')]];}}};Preview[_0x54f8('0x5d')][_0x54f8('0xe8')]=function(_0x241d24,_0x58e421,_0x4ac50d){if(_[_0x54f8('0xe9')](_0x58e421)&&_0x54f8('0xea')!==typeof _0x58e421){return;}if(_[_0x54f8('0xe9')](_0x4ac50d)&&_0x54f8('0xea')!==typeof _0x4ac50d){return;}switch(_0x4ac50d['reason']){case'0':ut[_0x54f8('0xeb')](_0x241d24,0x0,_0x54f8('0xec'));rpcDb[_0x54f8('0xed')](_0x241d24,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x241d24,0x3,_0x54f8('0xee'));rpcDb[_0x54f8('0xed')](_0x241d24,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x54f8('0xeb')](_0x241d24,0x5,_0x54f8('0xbd'));rpcDb[_0x54f8('0xed')](_0x241d24,_0x54f8('0xef'));break;case'8':ut[_0x54f8('0xeb')](_0x241d24,0x8,_0x54f8('0xcd'));rpcDb[_0x54f8('0xed')](_0x241d24,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x54f8('0xeb')](_0x241d24,0x16,_0x54f8('0xf0'));rpcDb[_0x54f8('0xed')](_0x241d24,_0x54f8('0xf1'));break;default:ut[_0x54f8('0xeb')](_0x241d24,0xc,_0x4ac50d['reason']);rpcDb[_0x54f8('0xed')](_0x241d24,_0x54f8('0xf2'));}ut[_0x54f8('0x77')](_0x58e421,'[callProgressDetectingAgent]');logger[_0x54f8('0x4f')](_0x54f8('0xf3'),_0x241d24[_0x54f8('0xad')],_0x54f8('0xbb'),_0x58e421[_0x54f8('0x24')],_0x54f8('0x69'),_0x58e421[_0x54f8('0x43')]);delete this['actions'][_0x241d24[_0x54f8('0xad')]];};Preview['prototype'][_0x54f8('0xf4')]=function(_0x23d224,_0x190a4f,_0x334db6,_0x596232,_0x48290c){var _0x29d34b=this;return new BPromise(function(_0x45fb8f,_0x2f5eec){if(_[_0x54f8('0x67')](_0x190a4f)||_[_0x54f8('0x67')](_0x190a4f[_0x54f8('0xf5')])||_[_0x54f8('0x67')](_0x190a4f[_0x54f8('0xf5')]['phone'])||_[_0x54f8('0x67')](_0x190a4f[_0x54f8('0x70')])){_0x2f5eec(ut['message']('Contact\x20is\x20undefined',_0x596232,_0x48290c));return;}var _0x4d2378=uuid['v4']();var _0x5ca4f5=_0x29d34b[_0x54f8('0x5f')][_0x190a4f[_0x54f8('0xf6')]['name']];var _0x455744=_0x334db6?_0x29d34b[_0x54f8('0x14')][_0x334db6]['id']:undefined;_0x29d34b[_0x54f8('0x13')][_0x4d2378]=new Action(_0x190a4f,_0x5ca4f5,_0x4d2378,_0x334db6,_0x455744);var _0x29bdc6=_0x29d34b[_0x54f8('0x13')][_0x4d2378];_0x29bdc6['unlockAgent']=_0x596232;_0x29bdc6[_0x54f8('0xa8')]=_0x48290c;_0x29bdc6['lookAgent']=_0x334db6;if(_[_0x54f8('0xf7')](_0x23d224)){_0x29d34b[_0x54f8('0xf8')](_0x29bdc6,_0x5ca4f5,_0x190a4f,_0x334db6)['then'](function(_0x49482b){logger[_0x54f8('0x4f')](_0x54f8('0xf9'),_0x54f8('0xfa')+_0x29bdc6[_0x54f8('0x6b')]+'\x20IdHopper:\x20'+_0x29bdc6[_0x54f8('0xfb')],JSON['stringify'](_0x49482b));ami['emit'](_0x54f8('0xfc'),ut[_0x54f8('0x9d')](_0x29bdc6,_0x54f8('0xfd'),_0x29d34b['campaignsPreview'][_0x29bdc6['queue']]));_0x45fb8f(ut[_0x54f8('0x42')]('Calling'));})[_0x54f8('0x75')](function(_0x7a99ab){ut['logger'](_0x54f8('0xfe'),_0x7a99ab);_0x2f5eec(ut[_0x54f8('0x42')](_0x54f8('0xff'),_0x596232,_0x48290c));});}else{_0x5ca4f5[_0x54f8('0x30')]+=0x1;ut[_0x54f8('0x100')](_0x29bdc6);rpcDb[_0x54f8('0x101')](_0x29bdc6,_0x54f8('0x102'));delete _0x29d34b[_0x54f8('0x13')][_0x4d2378];_0x2f5eec(ut[_0x54f8('0x42')](_0x54f8('0x103'),_0x596232,_0x48290c));}});};Preview[_0x54f8('0x5d')][_0x54f8('0x96')]=function(_0x3f0ebd){return!_[_0x54f8('0x67')](_0x3f0ebd)&&!_['isNil'](_0x3f0ebd[_0x54f8('0x24')])&&!_['isNil'](_0x3f0ebd[_0x54f8('0x4b')])&&_0x3f0ebd[_0x54f8('0x4b')]&&!_['isNil'](this[_0x54f8('0x12')][util[_0x54f8('0x51')]('SIP/%s',_0x3f0ebd[_0x54f8('0x24')])])&&!_[_0x54f8('0x67')](this[_0x54f8('0x12')][util['format'](_0x54f8('0x104'),_0x3f0ebd['name'])][_0x54f8('0x73')])&&(this[_0x54f8('0x12')][util[_0x54f8('0x51')](_0x54f8('0x104'),_0x3f0ebd[_0x54f8('0x24')])][_0x54f8('0x73')]===_0x54f8('0x105')||this[_0x54f8('0x12')][util[_0x54f8('0x51')](_0x54f8('0x104'),_0x3f0ebd['name'])][_0x54f8('0x73')]===_0x54f8('0x106'));};Preview[_0x54f8('0x5d')][_0x54f8('0x81')]=function(_0x233663,_0x3fbb24){var _0x4f31a6=this;return new BPromise(function(_0x87c976,_0x23b3b0){_0x4f31a6[_0x54f8('0x107')](_0x233663,_0x3fbb24)[_0x54f8('0x7b')](function(_0x5649de){_0x87c976(_[_0x54f8('0x6d')](_0x5649de,[_0x54f8('0x42')]));})[_0x54f8('0x75')](function(_0x3279d9){if(_0x3279d9[_0x54f8('0x108')]){rpcDb['unlockContact'](_0x233663);}if(_0x3279d9['active']){rpcDb[_0x54f8('0x83')](_0x233663);}_0x23b3b0(_[_0x54f8('0x6d')](_0x3279d9,['message']));});});};Preview[_0x54f8('0x5d')][_0x54f8('0x107')]=function(_0x2990b4,_0x587209){var _0x2a92e8=this;return new BPromise(function(_0x5b3d01,_0x780ee2){var _0x4eae7d,_0x1f0b98;rpcDb['getContactPreview'](_0x2990b4)[_0x54f8('0x7b')](function(_0x2a26fc){if(!_[_0x54f8('0x67')](_0x2a26fc[0x0])){_0x1f0b98=_0x2a26fc[0x0][_0x54f8('0x109')]?![]:!![];_0x4eae7d=_0x2a26fc[0x0][_0x54f8('0x109')]?!![]:![];_0x4eae7d=_0x587209?!![]:_0x4eae7d;}var _0x5853d8=_0x2a92e8[_0x54f8('0x10a')](_0x2a26fc);if(_0x5853d8[_0x54f8('0x10b')]){rpcDb[_0x54f8('0x10c')](_[_0x54f8('0x6d')](_0x2a26fc[0x0],[_0x54f8('0x70'),_0x54f8('0x10d')]))['then'](function(_0x44c78a){_0x2a92e8[_0x54f8('0xf4')](_0x44c78a,_0x2a26fc[0x0],_0x587209,_0x1f0b98,_0x4eae7d)[_0x54f8('0x7b')](function(_0x22fcbb){_0x5b3d01(_0x22fcbb);})[_0x54f8('0x75')](function(_0x1467df){_0x780ee2(_0x1467df);});})['catch'](function(_0x585d4a){ut[_0x54f8('0x5b')](_0x54f8('0x10e'),_0x585d4a);_0x780ee2(ut[_0x54f8('0x42')](_0x54f8('0x10f'),_0x1f0b98,_0x4eae7d));});}else{_0x780ee2(ut[_0x54f8('0x42')](_0x5853d8['message'],_0x1f0b98,_0x4eae7d));}})[_0x54f8('0x75')](function(_0x219da0){ut[_0x54f8('0x5b')](_0x54f8('0x110'),_0x219da0);_0x780ee2(ut[_0x54f8('0x42')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x54f8('0x5d')]['validateContact']=function(_0x458a28){if(_['isNil'](_0x458a28)||_[_0x54f8('0xf7')](_0x458a28)||!_[_0x54f8('0x67')](_0x458a28[0x0][_0x54f8('0x7f')])&&_['isNil'](_0x458a28[0x0]['Agent'][_0x54f8('0x24')])){ut['logger'](_0x54f8('0x111'),_0x458a28);return{'isValid':![],'message':_0x54f8('0x112')};}var _0x5dd273=this['campaignsPreview'][_0x458a28[0x0]['Queue']['name']];_0x5dd273[_0x54f8('0x42')]=_0x54f8('0x99');if(_[_0x54f8('0x67')](_0x5dd273)){ut[_0x54f8('0x5b')](_0x54f8('0x113'),_0x5dd273);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x5dd273[_0x54f8('0x4a')])){ut[_0x54f8('0x5b')]('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0x5dd273[_0x54f8('0x24')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x54f8('0x96')](_0x5dd273[_0x54f8('0x97')])){ut[_0x54f8('0x5b')](_0x54f8('0x114'),_0x5dd273['name']+_0x54f8('0x115'));return{'isValid':![],'message':_0x54f8('0x116')};}}if(!ut[_0x54f8('0x95')](_0x5dd273[_0x54f8('0x64')])){ut[_0x54f8('0x5b')](_0x54f8('0x117'),_0x5dd273[_0x54f8('0x24')]+_0x54f8('0x118'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x5dd273[_0x54f8('0x24')]+_0x54f8('0x118')};}return{'isValid':!![],'message':_0x54f8('0x119')};};Preview['prototype'][_0x54f8('0xf8')]=function(_0x46820b,_0x48bde7,_0x443b5a,_0x5f1fc7){var _0x4bab9b=this;return new BPromise(function(_0x144a97,_0x1635dd){var _0x5f1742=_0x46820b[_0x54f8('0xad')];var _0x14571a=_0x4bab9b[_0x54f8('0x96')](_0x48bde7[_0x54f8('0x4a')])?util[_0x54f8('0x51')](_0x54f8('0x11a'),_0x48bde7[_0x54f8('0x4a')][_0x54f8('0x24')],_[_0x54f8('0x67')](_0x48bde7[_0x54f8('0x2e')])?'':_0x48bde7['dialPrefix']['trim']()||'',_0x48bde7[_0x54f8('0x11b')]>0x0?_0x443b5a[_0x54f8('0xf5')][_0x54f8('0x11c')][_0x54f8('0x11d')](_0x48bde7[_0x54f8('0x11b')]):_0x443b5a['Contact'][_0x54f8('0x11c')]):util[_0x54f8('0x51')]('SIP/%s/%s%s',_[_0x54f8('0x67')](_0x48bde7[_0x54f8('0x97')])?_0x48bde7[_0x54f8('0x4a')]['name']:_0x48bde7[_0x54f8('0x97')][_0x54f8('0x24')],_[_0x54f8('0x67')](_0x48bde7[_0x54f8('0x2e')])?'':_0x48bde7[_0x54f8('0x2e')][_0x54f8('0x11e')]()||'',_0x48bde7['dialCutDigit']>0x0?_0x443b5a['Contact'][_0x54f8('0x11c')][_0x54f8('0x11d')](_0x48bde7[_0x54f8('0x11b')]):_0x443b5a[_0x54f8('0xf5')]['phone']);var _0x4533e1=_0x4bab9b[_0x54f8('0x96')](_0x48bde7[_0x54f8('0x4a')])?ut[_0x54f8('0x11f')](_0x48bde7[_0x54f8('0x4a')][_0x54f8('0x120')],_0x48bde7['dialOriginateCallerIdName'],_0x48bde7['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x54f8('0x121')](_0x48bde7[_0x54f8('0x2c')],_0x48bde7[_0x54f8('0x122')]):_0x48bde7[_0x54f8('0x2c')]):ut[_0x54f8('0x11f')](_[_0x54f8('0x67')](_0x48bde7[_0x54f8('0x97')])?_0x48bde7[_0x54f8('0x4a')][_0x54f8('0x120')]:_0x48bde7['TrunkBackup'][_0x54f8('0x120')],_0x48bde7[_0x54f8('0x2b')],_0x48bde7[_0x54f8('0x122')]>0x0?ut[_0x54f8('0x121')](_0x48bde7[_0x54f8('0x2c')],_0x48bde7[_0x54f8('0x122')]):_0x48bde7[_0x54f8('0x2c')]);if(_0x4533e1){_0x46820b[_0x54f8('0x123')]=ut[_0x54f8('0x124')](_0x4533e1);_0x46820b[_0x54f8('0x125')]=ut[_0x54f8('0x126')](_0x4533e1);}var _0xac715e=ut[_0x54f8('0x127')](_0x48bde7,_0x443b5a,_0x14571a,_0x4533e1,_0x5f1742,_0x46820b);_['merge'](_0x46820b,ut[_0x54f8('0x128')](_0xac715e));_0x46820b[_0x54f8('0x84')]=moment()[_0x54f8('0x51')](_0x54f8('0x85'));ami[_0x54f8('0x72')](ut['variablesAction'](_0x46820b,_0x48bde7,_0xac715e,_0x46820b[_0x54f8('0xa8')],_0x5f1fc7))[_0x54f8('0x7b')](function(_0x24a628){var _0xde6bf3=_0x46820b[_0x54f8('0x129')];if(!_[_0x54f8('0x67')](_0xde6bf3)){if(!_['isNil'](_0x4bab9b[_0x54f8('0x14')][_0xde6bf3])){_0x4bab9b[_0x54f8('0x14')][_0xde6bf3]['destconnectedlinenum']=_0x46820b[_0x54f8('0x12a')];emit(util[_0x54f8('0x51')](_0x54f8('0x12b'),_0x4bab9b[_0x54f8('0x14')][_0xde6bf3][_0x54f8('0x24')]),'user:agentconnect',{'destaccountcode':_0x4bab9b[_0x54f8('0x14')][_0xde6bf3]['accountcode'],'destconnectedlinenum':_0x46820b['calleridnum']});}}_0x48bde7[_0x54f8('0x43')]+=0x1;logger[_0x54f8('0x4f')](_0x54f8('0x12c'),_0x5f1742,_0x54f8('0xbb'),_0x48bde7[_0x54f8('0x24')],_0x54f8('0x69'),_0x48bde7['originated']);_0x144a97(_0x24a628);})['catch'](function(_0x1801c2){ut[_0x54f8('0xeb')](_0x46820b,0xe,'OriginateError');rpcDb[_0x54f8('0xed')](_0x46820b,'[originateFailure][logOriginateFailure]');_0x1635dd(_0x1801c2);});});};Preview['prototype'][_0x54f8('0x1c')]=function(_0x5edc42){if(this['actions'][_0x5edc42['linkedid']]){this[_0x54f8('0x13')][_0x5edc42[_0x54f8('0xa9')]][_0x54f8('0x74')]=_0x5edc42['channel'];}};Preview[_0x54f8('0x5d')]['syncOriginateResponse']=function(_0x20c9a1){var _0x52323c=this;var _0x461206=this[_0x54f8('0x13')][_0x20c9a1[_0x54f8('0x12d')]];if(_0x461206){if(_0x461206[_0x54f8('0x12e')]&&this[_0x54f8('0x14')][_0x461206[_0x54f8('0x12e')]]){ut['logLookAgent'](_0x461206,this[_0x54f8('0x14')][_0x461206[_0x54f8('0x12e')]][_0x54f8('0x24')],this['agents'][_0x461206[_0x54f8('0x12e')]]['id']);}var _0x587785=_[_0x54f8('0x12f')](_0x461206);_0x587785[_0x54f8('0xaa')]=moment()[_0x54f8('0x51')]('YYYY-MM-DD\x20HH:mm:ss');var _0x33cfcb=_0x52323c[_0x54f8('0x5f')][_0x461206[_0x54f8('0x6b')]];if(ut['isFailure'](_0x20c9a1[_0x54f8('0x130')])){if(_0x461206[_0x54f8('0xa7')]){rpcDb[_0x54f8('0x131')](_0x461206[_0x54f8('0xfb')]);}if(_0x461206[_0x54f8('0xa8')]){rpcDb['disableContact'](_0x461206[_0x54f8('0xfb')]);}ami[_0x54f8('0x22')](_0x54f8('0x132'),ut['buildObj'](_0x461206,_0x54f8('0x133'),this['campaignsPreview'][_0x461206['queue']]));this['callProgressDetectingAgent'](_0x587785,_0x33cfcb,_0x20c9a1);}else{_0x461206[_0x54f8('0x84')]=moment()[_0x54f8('0x51')](_0x54f8('0x85'));ut[_0x54f8('0xeb')](_0x587785,0x4,_0x54f8('0xb6'));rpcDb[_0x54f8('0xed')](_0x587785,_0x54f8('0x134'));}}};Preview['prototype'][_0x54f8('0x135')]=function(_0x84ffbd){var _0xeb1a9f=this;var _0x42c449=this[_0x54f8('0x13')][_0x84ffbd[_0x54f8('0xa9')]];var _0x45eee4;if(_0x42c449){_0x45eee4=this[_0x54f8('0x5f')][_0x42c449[_0x54f8('0x6b')]];logger[_0x54f8('0x4f')]('[syncHangup][talking]',_0x84ffbd['linkedid'],_0x54f8('0xbb'),_0x45eee4[_0x54f8('0x24')],_0x54f8('0x6a'),_0x45eee4[_0x54f8('0x55')]);}if(this[_0x54f8('0x13')][_0x84ffbd[_0x54f8('0xa9')]]&&_0x84ffbd[_0x54f8('0xa9')]!==_0x84ffbd[_0x54f8('0xad')]){if(_0x84ffbd[_0x54f8('0x136')]==='16'&&this[_0x54f8('0x13')][_0x84ffbd[_0x54f8('0xa9')]][_0x54f8('0x6c')]){this[_0x54f8('0x9a')](_0x84ffbd,_0x84ffbd[_0x54f8('0xa9')],_0x84ffbd[_0x54f8('0x136')]);}else if(this['actions'][_0x84ffbd[_0x54f8('0xa9')]][_0x54f8('0x6c')]){logger[_0x54f8('0x4f')]('[syncHangup][talking][cause]',_0x84ffbd[_0x54f8('0xa9')],_0x84ffbd['cause'],'\x20Queue',_0x45eee4[_0x54f8('0x24')],_0x54f8('0x6a'),_0x45eee4[_0x54f8('0x55')]);this[_0x54f8('0x9a')](_0x84ffbd,_0x84ffbd[_0x54f8('0xa9')],_0x84ffbd[_0x54f8('0x136')]);}}else if(_0x42c449&&_[_0x54f8('0x67')](_0x42c449[_0x54f8('0x137')])&&_0x45eee4[_0x54f8('0x138')]&&_0x84ffbd[_0x54f8('0xa9')]===_0x84ffbd[_0x54f8('0xad')]&&_[_0x54f8('0x67')](_0x84ffbd[_0x54f8('0x139')])&&_0x84ffbd[_0x54f8('0x136')]==='16'&&_0x84ffbd['channelstate']==='6'&&_['isUndefined'](_0x42c449['transfer'])){if(_0x42c449[_0x54f8('0xa7')]){rpcDb[_0x54f8('0x131')](_0x42c449[_0x54f8('0xfb')]);}if(_0x42c449[_0x54f8('0xa8')]){rpcDb[_0x54f8('0x83')](_0x42c449['idContact']);}_0x84ffbd['reason']='22';this[_0x54f8('0xe8')](_0x42c449,_0x45eee4,_0x84ffbd);}else if(_0x42c449&&_0x42c449['transfer']){if(_0x84ffbd[_0x54f8('0x136')]==='16'&&this[_0x54f8('0x13')][_0x84ffbd[_0x54f8('0xa9')]][_0x54f8('0x6c')]){logger['info']('[syncHangup][talking][transfer]',_0x84ffbd[_0x54f8('0xa9')],_0x84ffbd[_0x54f8('0x136')],_0x54f8('0xbb'),_0x45eee4['name'],'pTalking:\x20',_0x45eee4[_0x54f8('0x55')]);this['callProgressDetectingCustomer'](_0x84ffbd,_0x84ffbd[_0x54f8('0xa9')],_0x84ffbd[_0x54f8('0x136')]);}else if(this[_0x54f8('0x13')][_0x84ffbd[_0x54f8('0xa9')]][_0x54f8('0x6c')]){logger[_0x54f8('0x4f')]('[syncHangup][talking][cause]',_0x84ffbd[_0x54f8('0xa9')],_0x84ffbd['cause'],_0x54f8('0xbb'),_0x45eee4[_0x54f8('0x24')],_0x54f8('0x6a'),_0x45eee4[_0x54f8('0x55')]);this[_0x54f8('0x9a')](_0x84ffbd,_0x84ffbd[_0x54f8('0xa9')],_0x84ffbd[_0x54f8('0x136')]);}}};Preview['prototype'][_0x54f8('0x1a')]=function(_0x57b523){if(this['actions'][_0x57b523[_0x54f8('0xe7')]]&&_0x57b523['destlinkedid']!==_0x57b523['destuniqueid']){this[_0x54f8('0x9a')](_0x57b523,_0x57b523[_0x54f8('0xe7')],_0x57b523[_0x54f8('0xe0')]);}};Preview[_0x54f8('0x5d')][_0x54f8('0x18')]=function(_0x2e5b04){if(this['actions'][_0x2e5b04[_0x54f8('0xa9')]]&&_0x2e5b04[_0x54f8('0xa9')]!==_0x2e5b04[_0x54f8('0xad')]&&!this['actions'][_0x2e5b04[_0x54f8('0xa9')]][_0x54f8('0x6c')]){if(_0x2e5b04[_0x54f8('0x136')]==='1'){this['callProgressDetectingCustomer'](_0x2e5b04,_0x2e5b04['linkedid'],_0x2e5b04[_0x54f8('0x136')]);}}};Preview[_0x54f8('0x5d')][_0x54f8('0x13a')]=function(_0x21c8da,_0x13271b,_0x1e1bba){if(this[_0x54f8('0x13')][_0x21c8da]){if(_[_0x54f8('0x67')](this[_0x54f8('0x13')][_0x21c8da][_0x54f8('0x13b')])){this[_0x54f8('0x13')][_0x21c8da]['variables']={};}this[_0x54f8('0x13')][_0x21c8da][_0x54f8('0x13b')][_0x13271b]=_0x1e1bba;}};Preview[_0x54f8('0x5d')][_0x54f8('0x1d')]=function(_0x4ae9f7){try{if(!_['isNil'](_0x4ae9f7)){if(ut[_0x54f8('0x13c')](_[_0x54f8('0x13d')](_0x4ae9f7[_0x54f8('0x13e')])[0x0])){this[_0x54f8('0x13a')](_0x4ae9f7[_0x54f8('0xad')],_[_0x54f8('0x13d')](_0x4ae9f7['variable'])[0x0],_0x4ae9f7[_0x54f8('0x13f')]);}}}catch(_0x42874d){logger[_0x54f8('0x140')](_0x54f8('0x141'),util['inspect'](_0x42874d,{'showHidden':![],'depth':null}));}};Preview[_0x54f8('0x5d')][_0x54f8('0x1f')]=function(_0x1bc9fa){if(_0x1bc9fa){if(this[_0x54f8('0x13')][_0x1bc9fa[_0x54f8('0x142')]]){this[_0x54f8('0x13')][_0x1bc9fa[_0x54f8('0x142')]][_0x54f8('0x143')]=!![];}}};Preview[_0x54f8('0x5d')][_0x54f8('0x144')]=function(_0x5674d4){if(_0x5674d4){if(this[_0x54f8('0x13')][_0x5674d4[_0x54f8('0x145')]]){this[_0x54f8('0x13')][_0x5674d4[_0x54f8('0x145')]]['transfer']=!![];}}};module['exports']=Preview;
\ No newline at end of file
index 965a7d2..c9b5916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93a7=['../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview'];(function(_0x2ffd05,_0x1840e3){var _0x5038bf=function(_0xe7e075){while(--_0xe7e075){_0x2ffd05['push'](_0x2ffd05['shift']());}};_0x5038bf(++_0x1840e3);}(_0x93a7,0x110));var _0x793a=function(_0x395639,_0x16eb65){_0x395639=_0x395639-0x0;var _0x11e4cb=_0x93a7[_0x395639];return _0x11e4cb;};'use strict';var util=require(_0x793a('0x0'));var BPromise=require(_0x793a('0x1'));var logger=require(_0x793a('0x2'))(_0x793a('0x3'));var _=require(_0x793a('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x793a('0x5'));var voiceQueueRt=require(_0x793a('0x6'));var agentReportPreview=require(_0x793a('0x7'));var voiceQueueReport=require(_0x793a('0x8'));function loggerCatch(_0x4de313){return function(_0x13cef9){logger[_0x793a('0x9')](_0x4de313,util[_0x793a('0xa')](_0x13cef9,{'showHidden':![],'depth':null}));};}function create(_0x18ff42){return BPromise[_0x793a('0xb')]()[_0x793a('0xc')](cmHopperHistory[_0x793a('0xd')](_0x18ff42))[_0x793a('0xe')](loggerCatch(_0x793a('0xf')));}function createAgent(_0x1eb1b4){return BPromise['resolve']()[_0x793a('0xc')](agentReportPreview[_0x793a('0xd')](_0x1eb1b4))[_0x793a('0xe')](loggerCatch(_0x793a('0xf')));}function moveContact(_0x4ca66d){return BPromise[_0x793a('0xb')]()[_0x793a('0xc')](cmHopper[_0x793a('0x10')](_0x4ca66d,!![]))[_0x793a('0xe')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x793a('0x11')]=function(_0x82d6ba){return BPromise[_0x793a('0xb')]()[_0x793a('0xc')](cmHopperBlack['checkIsBlackList'](_0x82d6ba))['catch'](loggerCatch(_0x793a('0x12')));};exports[_0x793a('0x13')]=function(_0x23f95d){return BPromise['resolve']()[_0x793a('0xc')](cmHopper[_0x793a('0x13')](_0x23f95d))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0x793a('0xd')]=function(_0x491b81,_0x52a829){create(_0x491b81)['catch'](loggerCatch(_0x52a829));moveContact(_0x491b81)['catch'](loggerCatch(_0x52a829));};exports[_0x793a('0x14')]=function(_0x3c0f65,_0x43510a){createAgent(_0x3c0f65)[_0x793a('0xe')](loggerCatch(_0x43510a));};exports[_0x793a('0x15')]=function(_0x3b81e6,_0x3814ad){create(_0x3b81e6)[_0x793a('0xe')](loggerCatch(_0x3814ad));};exports['createCustomerFinal']=function(_0x4849e8,_0x5662bd){moveContact(_0x4849e8)[_0x793a('0xe')](loggerCatch(_0x5662bd));};exports[_0x793a('0x16')]=function(_0x3ccbfe,_0x5cea45,_0x1cc488){if(_0x5cea45){_0x3ccbfe[_0x793a('0x17')]=null;}if(_0x1cc488){_0x3ccbfe[_0x793a('0x18')]=![];}return BPromise[_0x793a('0xb')]()['then'](cmHopper[_0x793a('0x16')](_0x3ccbfe))[_0x793a('0xe')](loggerCatch(_0x793a('0x19')));};exports[_0x793a('0x1a')]=function(_0x3c9997){return BPromise['resolve']()[_0x793a('0xc')](cmHopper['countReScheduled'](_0x3c9997))[_0x793a('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x793a('0x1b')]=function(_0x3e45fe){return BPromise[_0x793a('0xb')]()['then'](cmHopper[_0x793a('0x1b')]({'UserId':null},_0x3e45fe,0x1))[_0x793a('0xe')](loggerCatch('[unlockContact]\x20'));};exports[_0x793a('0x1c')]=function(_0x3b9f0c){return BPromise[_0x793a('0xb')]()[_0x793a('0xc')](cmHopper[_0x793a('0x1b')]({'active':![]},_0x3b9f0c,0x1))['catch'](loggerCatch(_0x793a('0x1d')));};exports[_0x793a('0x1e')]=function(_0x213c4b){var _0x3345d3={};_0x3345d3['type']=_0x213c4b[_0x793a('0x1f')];_0x3345d3[_0x793a('0x20')]=_0x213c4b[_0x793a('0x20')];_0x3345d3[_0x793a('0x21')]=_0x213c4b[_0x793a('0x21')];_0x3345d3[_0x793a('0x22')]=_0x213c4b[_0x793a('0x22')];_0x3345d3['queue']=_0x213c4b[_0x793a('0x23')];_0x3345d3[_0x793a('0x24')]=_0x213c4b[_0x793a('0x25')];_0x3345d3[_0x793a('0x26')]=_0x213c4b[_0x793a('0x25')];_0x3345d3[_0x793a('0x27')]=0x1;_0x3345d3[_0x793a('0x28')]=_0x213c4b[_0x793a('0x29')];_0x3345d3[_0x793a('0x2a')]=_0x213c4b[_0x793a('0x2b')];_0x3345d3[_0x793a('0x2c')]='from-sip';_0x3345d3['exten']=_0x793a('0x2d');_0x3345d3[_0x793a('0x2e')]=0x0;_0x3345d3[_0x793a('0x2f')]=0x1;_0x3345d3[_0x793a('0x30')]=_0x213c4b[_0x793a('0x2b')];_0x3345d3[_0x793a('0x31')]=_0x793a('0x32');return BPromise[_0x793a('0xb')]()[_0x793a('0xc')](voiceQueueReport[_0x793a('0x33')](_0x3345d3))['catch'](loggerCatch(_0x793a('0x34')));};exports['getContactRecallMe']=function(_0xc62229,_0xbba485){return BPromise[_0x793a('0xb')]()[_0x793a('0xc')](cmHopper[_0x793a('0x35')](_0xc62229,_0xbba485))[_0x793a('0xe')](loggerCatch(_0x793a('0x36')));};exports['rescheduleContactInQueue']=function(_0x194f3d){return BPromise['resolve']()[_0x793a('0xc')](cmHopper['rescheduleContact'](_0x194f3d,!![],!![]))['catch'](loggerCatch(_0x793a('0x37')));};
\ No newline at end of file
+var _0x4d23=['getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0x4d23,0xae));var _0x34d2=function(_0x794802,_0x2fa62f){_0x794802=_0x794802-0x0;var _0x224e4e=_0x4d23[_0x794802];return _0x224e4e;};'use strict';var util=require('util');var BPromise=require(_0x34d2('0x0'));var logger=require(_0x34d2('0x1'))('preview');var _=require(_0x34d2('0x2'));var cmHopper=require(_0x34d2('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x34d2('0x4'));var cmHopperBlack=require(_0x34d2('0x5'));var voiceQueueRt=require(_0x34d2('0x6'));var agentReportPreview=require(_0x34d2('0x7'));var voiceQueueReport=require(_0x34d2('0x8'));function loggerCatch(_0x1ac27b){return function(_0x57ad36){logger[_0x34d2('0x9')](_0x1ac27b,util['inspect'](_0x57ad36,{'showHidden':![],'depth':null}));};}function create(_0x5479da){return BPromise[_0x34d2('0xa')]()[_0x34d2('0xb')](cmHopperHistory[_0x34d2('0xc')](_0x5479da))[_0x34d2('0xd')](loggerCatch(_0x34d2('0xe')));}function createAgent(_0x319df3){return BPromise[_0x34d2('0xa')]()['then'](agentReportPreview[_0x34d2('0xc')](_0x319df3))[_0x34d2('0xd')](loggerCatch(_0x34d2('0xe')));}function moveContact(_0x5e54f6){return BPromise[_0x34d2('0xa')]()['then'](cmHopper[_0x34d2('0xf')](_0x5e54f6,!![]))[_0x34d2('0xd')](loggerCatch(_0x34d2('0x10')));}exports['checkIsBlackList']=function(_0x23241b){return BPromise[_0x34d2('0xa')]()[_0x34d2('0xb')](cmHopperBlack[_0x34d2('0x11')](_0x23241b))['catch'](loggerCatch(_0x34d2('0x12')));};exports[_0x34d2('0x13')]=function(_0x203b82){return BPromise[_0x34d2('0xa')]()[_0x34d2('0xb')](cmHopper[_0x34d2('0x13')](_0x203b82))['catch'](loggerCatch(_0x34d2('0x14')));};exports['createHistory']=function(_0xcb2bb3,_0x448e9e){create(_0xcb2bb3)[_0x34d2('0xd')](loggerCatch(_0x448e9e));moveContact(_0xcb2bb3)[_0x34d2('0xd')](loggerCatch(_0x448e9e));};exports[_0x34d2('0x15')]=function(_0x338d15,_0x31decf){createAgent(_0x338d15)['catch'](loggerCatch(_0x31decf));};exports[_0x34d2('0x16')]=function(_0x4d225d,_0x16f035){create(_0x4d225d)[_0x34d2('0xd')](loggerCatch(_0x16f035));};exports[_0x34d2('0x17')]=function(_0xedf39,_0x1d38c8){moveContact(_0xedf39)[_0x34d2('0xd')](loggerCatch(_0x1d38c8));};exports[_0x34d2('0x18')]=function(_0x1c31f9,_0x126bee,_0x5e4781){if(_0x126bee){_0x1c31f9[_0x34d2('0x19')]=null;}if(_0x5e4781){_0x1c31f9['active']=![];}return BPromise[_0x34d2('0xa')]()[_0x34d2('0xb')](cmHopper[_0x34d2('0x18')](_0x1c31f9))[_0x34d2('0xd')](loggerCatch(_0x34d2('0x1a')));};exports['countReScheduled']=function(_0x3303af){return BPromise[_0x34d2('0xa')]()[_0x34d2('0xb')](cmHopper[_0x34d2('0x1b')](_0x3303af))[_0x34d2('0xd')](loggerCatch(_0x34d2('0x1c')));};exports[_0x34d2('0x1d')]=function(_0x2e5aa7){return BPromise['resolve']()[_0x34d2('0xb')](cmHopper[_0x34d2('0x1d')]({'UserId':null},_0x2e5aa7,0x1))[_0x34d2('0xd')](loggerCatch(_0x34d2('0x1e')));};exports[_0x34d2('0x1f')]=function(_0x25c787){return BPromise[_0x34d2('0xa')]()[_0x34d2('0xb')](cmHopper[_0x34d2('0x1d')]({'active':![]},_0x25c787,0x1))['catch'](loggerCatch(_0x34d2('0x20')));};exports[_0x34d2('0x21')]=function(_0x91d383){var _0xf0af76={};_0xf0af76[_0x34d2('0x22')]=_0x91d383[_0x34d2('0x22')];_0xf0af76[_0x34d2('0x23')]=_0x91d383[_0x34d2('0x23')];_0xf0af76[_0x34d2('0x24')]=_0x91d383[_0x34d2('0x24')];_0xf0af76[_0x34d2('0x25')]=_0x91d383[_0x34d2('0x25')];_0xf0af76['queue']=_0x91d383[_0x34d2('0x26')];_0xf0af76['queuecallerjoinAt']=_0x91d383[_0x34d2('0x27')];_0xf0af76[_0x34d2('0x28')]=_0x91d383['answertime'];_0xf0af76[_0x34d2('0x29')]=0x1;_0xf0af76['queuecallercompleteAt']=_0x91d383[_0x34d2('0x2a')];_0xf0af76[_0x34d2('0x2b')]=_0x91d383[_0x34d2('0x2c')];_0xf0af76[_0x34d2('0x2d')]=_0x34d2('0x2e');_0xf0af76[_0x34d2('0x2f')]=_0x34d2('0x30');_0xf0af76[_0x34d2('0x31')]=0x0;_0xf0af76[_0x34d2('0x32')]=0x1;_0xf0af76[_0x34d2('0x33')]=_0x91d383[_0x34d2('0x2c')];_0xf0af76['queuecallerexitreason']=_0x34d2('0x34');return BPromise['resolve']()['then'](voiceQueueReport[_0x34d2('0x35')](_0xf0af76))[_0x34d2('0xd')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x34d2('0x36')]=function(_0x3063f8,_0x1fa000){return BPromise['resolve']()[_0x34d2('0xb')](cmHopper[_0x34d2('0x36')](_0x3063f8,_0x1fa000))['catch'](loggerCatch(_0x34d2('0x37')));};exports['rescheduleContactInQueue']=function(_0x308649){return BPromise[_0x34d2('0xa')]()[_0x34d2('0xb')](cmHopper['rescheduleContact'](_0x308649,!![],!![]))[_0x34d2('0xd')](loggerCatch(_0x34d2('0x38')));};
\ No newline at end of file
index 95edf73..2923ada 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5749=['originated','error','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','starttime','logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','timeout','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','interface','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','push','getDiff','diff','createBody','filterKey','idContact','type','dialAnswer','calleridnum','callbackuniqueid','recallme','sipcallid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','getCallerIdRandom','\x5cw{0,','pow','match','util','lodash','moment','../../../../config/logger','preview','milliseconds','seconds','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toLowerVariables'];(function(_0x4803b0,_0x50f19e){var _0x171685=function(_0x5a4114){while(--_0x5a4114){_0x4803b0['push'](_0x4803b0['shift']());}};_0x171685(++_0x50f19e);}(_0x5749,0x1e0));var _0x9574=function(_0x5df760,_0x1fa2d6){_0x5df760=_0x5df760-0x0;var _0x3b9406=_0x5749[_0x5df760];return _0x3b9406;};'use strict';var util=require(_0x9574('0x0'));var _=require(_0x9574('0x1'));var moment=require(_0x9574('0x2'));var logger=require(_0x9574('0x3'))(_0x9574('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x55d126,_0x8ca6bd){var _0x2a3bd8=moment(_0x55d126)[_0x9574('0x5')](0x0);var _0xf3aaba=moment(_0x8ca6bd)[_0x9574('0x5')](0x0);return _0x2a3bd8['diff'](_0xf3aaba,_0x9574('0x6'));}exports['loggerCatch']=function(_0x34a719){return function(_0x19c851){logger['error'](_0x34a719,util[_0x9574('0x7')](_0x19c851,{'showHidden':![],'depth':null}));};};exports[_0x9574('0x8')]=function(_0x4c7035,_0x2e51b1){logger[_0x9574('0x9')](_0x4c7035,util[_0x9574('0x7')](_0x2e51b1,{'showHidden':![],'depth':null}));};exports[_0x9574('0xa')]=function(_0x3d9b60,_0x2cf5c5){logger['error'](_0x3d9b60,util[_0x9574('0x7')](_0x2cf5c5,{'showHidden':![],'depth':null}));};exports[_0x9574('0xb')]=function(_0x2fd82c){return function(_0x2f3885){logger[_0x9574('0x9')](_0x2fd82c,util['inspect'](_0x2f3885,{'showHidden':![],'depth':null}));};};exports[_0x9574('0xc')]=function(_0x4c2fc6,_0xaac08c,_0x411d1e){return{'message':_0x4c2fc6,'unlock':_0xaac08c,'active':_0x411d1e};};exports[_0x9574('0xd')]=function(_0x58c5ea,_0x47c16f,_0x396d4c){if(!_[_0x9574('0xe')](_0x396d4c)&&'string'===typeof _0x396d4c&&!_[_0x9574('0xf')](_0x396d4c)){if(!_[_0x9574('0xe')](_0x47c16f)&&'string'===typeof _0x47c16f&&!_[_0x9574('0xf')](_0x47c16f)){return util[_0x9574('0x10')]('\x22%s\x22\x20<%s>',_0x47c16f,_0x396d4c);}return util[_0x9574('0x10')](_0x9574('0x11'),_0x396d4c,_0x396d4c);}if(!_[_0x9574('0xe')](_0x58c5ea)&&_0x9574('0x12')===typeof _0x58c5ea&&!_[_0x9574('0xf')](_0x58c5ea)){return _0x58c5ea;}return _0x9574('0x13');};exports[_0x9574('0x14')]=function(_0x5aded7){if(_[_0x9574('0x15')](_0x5aded7)){return![];}return _0x5aded7;};exports[_0x9574('0x16')]=function(_0x2dd2aa,_0x2979ad,_0x4e3720,_0x34b60e,_0x2f50aa,_0x4610f3){var _0x3a2c9d={'XMD-QUEUE':_0x2979ad[_0x9574('0x17')]?_0x2979ad[_0x9574('0x17')][_0x9574('0x18')]:'','XMD-CALLERID':_0x34b60e,'XMD-CALLERID-PREVIEW':_0x4610f3?util['format'](_0x9574('0x11'),_0x4610f3['calleridname'],_0x4610f3['calleridnum']):_0x34b60e,'XMD-DIALID':_0x2f50aa,'XMD-CONTACTID':_0x2979ad[_0x9574('0x19')],'XMD-CDRTYPE':_0x9574('0x1a'),'CALLERID(all)':_0x34b60e,'XMD-VOICEQUEUEID':_0x2979ad[_0x9574('0x1b')],'XMD-DIALCHANNEL':_0x4e3720,'XMD-DIALTIMEOUT':_0x2dd2aa[_0x9574('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x9574('0x10')](_0x9574('0x1d'),_0x2dd2aa[_0x9574('0x1e')]?'g':'',_[_0x9574('0xf')](_0x2dd2aa['monitor_format'])?'':_0x9574('0x1f')),'XMD-DIALURL':_0x2dd2aa[_0x9574('0x20')]||'','XMD-AGI':_0x2dd2aa[_0x9574('0x21')]?util[_0x9574('0x10')](_0x9574('0x22'),ipAgi,_0x2dd2aa['dialQueueProject']):_0x9574('0x23'),'XMD-AGIAFTER':_0x2dd2aa[_0x9574('0x1e')]?util[_0x9574('0x10')](_0x9574('0x22'),ipAgi,_0x2dd2aa[_0x9574('0x1e')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x4610f3?_0x4610f3['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x4610f3?_0x4610f3[_0x9574('0x24')]:'','XMD-DESTINATION':_0x9574('0x25')};if(!_[_0x9574('0xf')](_0x2dd2aa[_0x9574('0x26')])){_0x3a2c9d[util[_0x9574('0x10')]('%s',_0x9574('0x27'))]=_0x2dd2aa[_0x9574('0x26')];_0x3a2c9d[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2f50aa;}if(_0x2979ad&&_0x2979ad[_0x9574('0x28')]){for(var _0x458718 in _0x2979ad[_0x9574('0x28')]){if(_0x2979ad[_0x9574('0x28')][_0x9574('0x29')](_0x458718)){if(!_[_0x9574('0x15')](_0x2979ad[_0x9574('0x28')][_0x458718])&&_0x458718!=='id'&&_0x458718!==_0x9574('0x2a')&&_0x458718!==_0x9574('0x2b')&&_0x458718!==_0x9574('0x2c')){_0x3a2c9d[util[_0x9574('0x10')](_0x9574('0x2d'),_0x9574('0x2e'),_['toUpper'](_0x458718))]=_0x2979ad[_0x9574('0x28')][_0x458718];}}}}return _0x3a2c9d;};exports[_0x9574('0x2f')]=function(_0x328491){var _0x348c76={};for(var _0x34c2cd in _0x328491){if(_0x328491[_0x9574('0x29')](_0x34c2cd)){_0x348c76[util[_0x9574('0x10')]('%s',_['toLower'](_0x34c2cd))]=_0x328491[_0x34c2cd];}}return{'variables':_0x348c76};};exports['updateOriginated']=function(_0xd91f30,_0x1b8d2c){if(!_['isNil'](_0xd91f30)){if(_0xd91f30[_0x9574('0x29')](_0x9574('0x30'))){if(_0xd91f30[_0x9574('0x30')]>0x0){_0xd91f30[_0x9574('0x30')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x1b8d2c);}}}else{logger[_0x9574('0x31')](_0x9574('0x32'),_0x1b8d2c);}};exports[_0x9574('0x33')]=function(_0x91f718){var _0x57bd2=moment()[_0x9574('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x91f718[_0x9574('0x34')]=0xd;_0x91f718[_0x9574('0x35')]=_0x9574('0x36');_0x91f718['starttime']=_0x57bd2;_0x91f718['responsetime']=_0x57bd2;_0x91f718[_0x9574('0x37')]=_0x57bd2;};exports[_0x9574('0x38')]=function(_0x5e3218,_0x4a9d8c,_0x22b43d){var _0x3868d7=moment()['format'](_0x9574('0x39'));_0x5e3218[_0x9574('0x34')]=_0x4a9d8c;_0x5e3218[_0x9574('0x35')]=_0x22b43d;_0x5e3218['responsetime']=_0x3868d7;_0x5e3218[_0x9574('0x3a')]=getSeconds(_0x5e3218[_0x9574('0x3b')],_0x5e3218[_0x9574('0x3c')]);};exports[_0x9574('0x3d')]=function(_0x5d6af6,_0x706225,_0x5308a2){_0x5d6af6['membername']=_0x706225;_0x5d6af6[_0x9574('0x3e')]=_0x5308a2;};exports[_0x9574('0x3f')]=function(_0x1d3b48,_0x412e18,_0x3285d2){var _0x370964=moment()[_0x9574('0x10')](_0x9574('0x39'));_0x1d3b48[_0x9574('0x34')]=_0x412e18;_0x1d3b48['statedesc']=_0x3285d2;_0x1d3b48[_0x9574('0x3b')]=_0x1d3b48[_0x9574('0x3b')]?_0x1d3b48[_0x9574('0x3b')]:_0x370964;_0x1d3b48[_0x9574('0x37')]=_0x1d3b48[_0x9574('0x37')]?_0x1d3b48[_0x9574('0x37')]:_0x370964;_0x1d3b48['ringtime']=getSeconds(_0x1d3b48['responsetime']||0x0,_0x1d3b48[_0x9574('0x3c')]||0x0);_0x1d3b48[_0x9574('0x40')]=_0x1d3b48[_0x9574('0x41')]?getSeconds(_0x1d3b48[_0x9574('0x37')],_0x1d3b48['answertime']):0x0;};exports[_0x9574('0x42')]=function(_0x3a2056){return _0x3a2056===_0x9574('0x43');};exports[_0x9574('0x44')]=function(_0x413147,_0x2d24d9,_0x368f5f,_0x501cd2,_0x2dbf7b){var _0xc88939=_0x501cd2?_0x9574('0x45'):_0x413147[_0x9574('0x46')];_0xc88939=_0x2dbf7b?_0x9574('0x47'):_0xc88939;return{'actionid':_0x413147[_0x9574('0x48')],'action':_0x9574('0x49'),'channel':_0x413147[_0x9574('0x4a')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0xc88939,_0x413147['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x368f5f,'timeout':(_0x2d24d9[_0x9574('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x413147['uniqueid']};};exports['totalGlobal']=function(_0x49117e){return _0x49117e[_0x9574('0x4c')]+_0x49117e['countcongestionretry']+_0x49117e[_0x9574('0x4d')]+_0x49117e[_0x9574('0x4e')]+_0x49117e[_0x9574('0x4f')];};exports[_0x9574('0x50')]=function(_0x37129e){var _0x8de091=_[_0x9574('0x51')](_0x37129e);_0x8de091[_0x9574('0x34')]=0xf;_0x8de091[_0x9574('0x35')]=_0x9574('0x52');return _0x8de091;};exports[_0x9574('0x53')]=function(_0x2b4c1b,_0x26fed0,_0x34a38b){var _0x44ef11={};_0x44ef11[_0x26fed0]=_0x2b4c1b[_0x26fed0];_0x44ef11[_0x9574('0x54')]=![];_0x44ef11[_0x9574('0x55')]=moment()[_0x9574('0x56')](_0x34a38b,'minutes')['format'](_0x9574('0x39'));_0x44ef11[_0x9574('0x19')]=_0x2b4c1b[_0x9574('0x19')];_0x44ef11[_0x9574('0x57')]=_0x2b4c1b['ListId'];_0x44ef11[_0x9574('0x1b')]=_0x2b4c1b[_0x9574('0x1b')]||undefined;return _0x44ef11;};exports['decrementTalkink']=function(_0x372a1a,_0x178610){if(!_[_0x9574('0x15')](_0x372a1a)){if(_0x372a1a[_0x9574('0x58')]>0x0){_0x372a1a[_0x9574('0x58')]-=0x1;}else{logger[_0x9574('0x31')](_0x178610,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x9574('0x31')](_0x178610,_0x9574('0x59'));}};exports['IsNotLoggedIn']=function(_0x45094a){if(_0x45094a<=0x0){return!![];}return![];};exports['buildObj']=function(_0x2bf84d,_0x1ad2c2,_0x4c8416){_0x2bf84d[_0x9574('0x5a')]=_0x1ad2c2;_0x2bf84d[_0x9574('0x18')]=_0x2bf84d['queue'];_0x2bf84d[_0x9574('0x5b')]=_0x2bf84d[_0x9574('0x4a')];_0x2bf84d['motionChannel']=_0x9574('0x5c');if(_0x4c8416){_0x2bf84d['mandatoryDisposition']=_0x4c8416[_0x9574('0x5d')];}return _0x2bf84d;};exports[_0x9574('0x5e')]=function(_0x445e54){var _0x3467e3={};_0x3467e3['queue']=_0x445e54[_0x9574('0x5f')];_0x3467e3[_0x9574('0x5b')]=_0x445e54['channelAgent'];_0x3467e3[_0x9574('0x48')]=_0x445e54[_0x9574('0x48')];return _0x3467e3;};exports[_0x9574('0x60')]=function(_0x237e88){var _0x237330=[];for(var _0xdd4775 in _0x237e88){if(_0x237e88[_0x9574('0x29')](_0xdd4775)){if(!_[_0x9574('0x15')](_0x237e88[_0xdd4775])&&_0x237e88[_0xdd4775][_0x9574('0x34')]===_0x9574('0x61')&&_0x237e88[_0xdd4775][_0x9574('0x62')]==='reachable'){_0x237330[_0x9574('0x63')](_0x237e88[_0xdd4775]['id']);}}}return _0x237330;};exports[_0x9574('0x64')]=function(_0x57a9a3){var _0x2c6b24=moment()[_0x9574('0x5')](0x0);var _0x22d265=moment(_0x57a9a3)['milliseconds'](0x0);return _0x2c6b24[_0x9574('0x65')](_0x22d265,'seconds');};exports[_0x9574('0x66')]=function(_0xa80a52){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xa80a52[_0x9574('0x19')],'ListId':_0xa80a52['ListId'],'VoiceQueueId':_0xa80a52[_0x9574('0x1b')]||undefined,'CampaignId':_0xa80a52['CampaignId']||undefined};};exports[_0x9574('0x67')]=function(_0x59c718){if(_0x59c718===_0x9574('0x48')||_0x59c718===_0x9574('0x68')||_0x59c718===_0x9574('0x5f')||_0x59c718===_0x9574('0x69')||_0x59c718==='campaigntype'||_0x59c718===_0x9574('0x6a')||_0x59c718==='membername'||_0x59c718==='channelAgent'||_0x59c718===_0x9574('0x46')||_0x59c718==='active'||_0x59c718===_0x9574('0x6b')||_0x59c718===_0x9574('0x55')||_0x59c718===_0x9574('0x4c')||_0x59c718==='countcongestionretry'||_0x59c718===_0x9574('0x4d')||_0x59c718==='countglobal'||_0x59c718==='callback'||_0x59c718===_0x9574('0x6c')||_0x59c718==='callbackat'||_0x59c718===_0x9574('0x6d')||_0x59c718===_0x9574('0x19')||_0x59c718===_0x9574('0x57')||_0x59c718===_0x9574('0x3e')||_0x59c718===_0x9574('0x1b')||_0x59c718===_0x9574('0x6e')||_0x59c718==='xmd-voicequeueid'||_0x59c718===_0x9574('0x6f')||_0x59c718===_0x9574('0x70')||_0x59c718==='xmd-listid'||_0x59c718===_0x9574('0x71')||_0x59c718===_0x9574('0x72')||_0x59c718==='xmd-dialoptions'||_0x59c718===_0x9574('0x73')||_0x59c718===_0x9574('0x74')||_0x59c718===_0x9574('0x75')||_0x59c718===_0x9574('0x76')||_0x59c718===_0x9574('0x77')||_0x59c718==='xmd-agiafter'||_0x59c718===_0x9574('0x78')||_0x59c718==='rtpaudioqos'||_0x59c718===_0x9574('0x79')||_0x59c718===_0x9574('0x7a')||_0x59c718===_0x9574('0x7b')||_0x59c718===_0x9574('0x7c')||_0x59c718===_0x9574('0x7d')||_0x59c718===_0x9574('0x7e')||_0x59c718===_0x9574('0x7f')||_0x59c718==='rtpaudioqos'||_0x59c718==='rtpaudioqosbridged'||_0x59c718===_0x9574('0x7a')||_0x59c718===_0x9574('0x7b')||_0x59c718===_0x9574('0x7c')||_0x59c718==='rtpaudioqoslossbridged'||_0x59c718===_0x9574('0x7e')||_0x59c718===_0x9574('0x7f')||_0x59c718==='bridgepeer'||_0x59c718==='bridgepvtcallid'||_0x59c718===_0x9574('0x34')||_0x59c718===_0x9574('0x35')){return![];}return!![];};exports[_0x9574('0x80')]=function(_0x238769,_0xfbfedf){var _0x415502,_0x5cbb5f,_0x1c6746;if(_0xfbfedf<=0x0){_0xfbfedf=0x1;}_0x415502=new RegExp(_0x9574('0x81')+_0xfbfedf+'}$');_0x5cbb5f=Math[_0x9574('0x82')](0xa,_0xfbfedf-0x1);_0x1c6746=Math[_0x9574('0x82')](0xa,_0xfbfedf)-0x1;return util[_0x9574('0x10')]('%s',_['replace'](_0x238769,_0x415502,_['random'](_0x5cbb5f,_0x1c6746)));};exports['extractCalleridName']=function(_0x184ef5){var _0x578909=_0x184ef5[_0x9574('0x83')](/"(.*?)"/);return _0x578909?_0x578909[0x1]:_0x184ef5;};exports['extractCalleridNumber']=function(_0x1519cf){var _0x545190=_0x1519cf[_0x9574('0x83')](/<(.*?)>/);return _0x545190?_0x545190[0x1]:_0x1519cf;};
\ No newline at end of file
+var _0xd823=['xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosjitter','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','pow','replace','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','error','info','inspect','loggerError','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','logAgent','ringtime','starttime','logLookAgent','endtime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','name','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','channelAgent','not_inuse','status','reachable','push','diff','CampaignId','filterKey','idContact','type','campaigntype','membername','active','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout'];(function(_0x40b10c,_0x2cab30){var _0x3d1a3b=function(_0x518658){while(--_0x518658){_0x40b10c['push'](_0x40b10c['shift']());}};_0x3d1a3b(++_0x2cab30);}(_0xd823,0xa5));var _0x3d82=function(_0x5c1449,_0x2af4b4){_0x5c1449=_0x5c1449-0x0;var _0x270473=_0xd823[_0x5c1449];return _0x270473;};'use strict';var util=require(_0x3d82('0x0'));var _=require(_0x3d82('0x1'));var moment=require(_0x3d82('0x2'));var logger=require(_0x3d82('0x3'))(_0x3d82('0x4'));var ipAgi=process[_0x3d82('0x5')][_0x3d82('0x6')]||_0x3d82('0x7');function getSeconds(_0xda95db,_0x4537e9){var _0x53cfd3=moment(_0xda95db)['milliseconds'](0x0);var _0x319270=moment(_0x4537e9)[_0x3d82('0x8')](0x0);return _0x53cfd3['diff'](_0x319270,_0x3d82('0x9'));}exports['loggerCatch']=function(_0x2d48b4){return function(_0x24b212){logger[_0x3d82('0xa')](_0x2d48b4,util['inspect'](_0x24b212,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0xb77f7a,_0x1e0a3d){logger[_0x3d82('0xb')](_0xb77f7a,util[_0x3d82('0xc')](_0x1e0a3d,{'showHidden':![],'depth':null}));};exports[_0x3d82('0xd')]=function(_0xf1bdfc,_0x147a65){logger[_0x3d82('0xa')](_0xf1bdfc,util[_0x3d82('0xc')](_0x147a65,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x38b5f4){return function(_0x4f4aab){logger[_0x3d82('0xb')](_0x38b5f4,util[_0x3d82('0xc')](_0x4f4aab,{'showHidden':![],'depth':null}));};};exports[_0x3d82('0xe')]=function(_0x3596b3,_0x4a28e1,_0x3018be){return{'message':_0x3596b3,'unlock':_0x4a28e1,'active':_0x3018be};};exports['getCallerId']=function(_0x103bbd,_0x5d53ec,_0x12032a){if(!_[_0x3d82('0xf')](_0x12032a)&&_0x3d82('0x10')===typeof _0x12032a&&!_[_0x3d82('0x11')](_0x12032a)){if(!_[_0x3d82('0xf')](_0x5d53ec)&&'string'===typeof _0x5d53ec&&!_[_0x3d82('0x11')](_0x5d53ec)){return util[_0x3d82('0x12')](_0x3d82('0x13'),_0x5d53ec,_0x12032a);}return util['format']('\x22%s\x22\x20<%s>',_0x12032a,_0x12032a);}if(!_[_0x3d82('0xf')](_0x103bbd)&&_0x3d82('0x10')===typeof _0x103bbd&&!_['isEmpty'](_0x103bbd)){return _0x103bbd;}return _0x3d82('0x14');};exports['isActive']=function(_0x44bb0d){if(_[_0x3d82('0x15')](_0x44bb0d)){return![];}return _0x44bb0d;};exports[_0x3d82('0x16')]=function(_0xa0823a,_0x1c52ca,_0x56392c,_0x221fc5,_0x126fc1,_0x396439){var _0x448c16={'XMD-QUEUE':_0x1c52ca[_0x3d82('0x17')]?_0x1c52ca[_0x3d82('0x17')]['name']:'','XMD-CALLERID':_0x221fc5,'XMD-CALLERID-PREVIEW':_0x396439?util[_0x3d82('0x12')](_0x3d82('0x13'),_0x396439['calleridname'],_0x396439[_0x3d82('0x18')]):_0x221fc5,'XMD-DIALID':_0x126fc1,'XMD-CONTACTID':_0x1c52ca[_0x3d82('0x19')],'XMD-CDRTYPE':_0x3d82('0x1a'),'CALLERID(all)':_0x221fc5,'XMD-VOICEQUEUEID':_0x1c52ca[_0x3d82('0x1b')],'XMD-DIALCHANNEL':_0x56392c,'XMD-DIALTIMEOUT':_0xa0823a['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x3d82('0x12')](_0x3d82('0x1c'),_0xa0823a[_0x3d82('0x1d')]?'g':'',_[_0x3d82('0x11')](_0xa0823a['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0xa0823a[_0x3d82('0x1e')]||'','XMD-AGI':_0xa0823a[_0x3d82('0x1f')]?util[_0x3d82('0x12')](_0x3d82('0x20'),ipAgi,_0xa0823a[_0x3d82('0x1f')]):_0x3d82('0x21'),'XMD-AGIAFTER':_0xa0823a[_0x3d82('0x1d')]?util[_0x3d82('0x12')](_0x3d82('0x20'),ipAgi,_0xa0823a['dialQueueProject2']):_0x3d82('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x396439?_0x396439[_0x3d82('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x396439?_0x396439[_0x3d82('0x23')]:'','XMD-DESTINATION':_0x3d82('0x24')};if(!_[_0x3d82('0x11')](_0xa0823a[_0x3d82('0x25')])){_0x448c16[util[_0x3d82('0x12')]('%s',_0x3d82('0x26'))]=_0xa0823a['monitor_format'];_0x448c16[util[_0x3d82('0x12')]('%s',_0x3d82('0x27'))]=_0x126fc1;}if(_0x1c52ca&&_0x1c52ca[_0x3d82('0x28')]){for(var _0x58386c in _0x1c52ca[_0x3d82('0x28')]){if(_0x1c52ca['Contact'][_0x3d82('0x29')](_0x58386c)){if(!_[_0x3d82('0x15')](_0x1c52ca[_0x3d82('0x28')][_0x58386c])&&_0x58386c!=='id'&&_0x58386c!==_0x3d82('0x2a')&&_0x58386c!==_0x3d82('0x2b')&&_0x58386c!==_0x3d82('0x2c')){_0x448c16[util['format'](_0x3d82('0x2d'),'XMD-',_[_0x3d82('0x2e')](_0x58386c))]=_0x1c52ca[_0x3d82('0x28')][_0x58386c];}}}}return _0x448c16;};exports[_0x3d82('0x2f')]=function(_0x521035){var _0xc4ab67={};for(var _0x18d729 in _0x521035){if(_0x521035[_0x3d82('0x29')](_0x18d729)){_0xc4ab67[util[_0x3d82('0x12')]('%s',_[_0x3d82('0x30')](_0x18d729))]=_0x521035[_0x18d729];}}return{'variables':_0xc4ab67};};exports['updateOriginated']=function(_0x4f2bc6,_0x1352c2){if(!_['isNil'](_0x4f2bc6)){if(_0x4f2bc6[_0x3d82('0x29')](_0x3d82('0x31'))){if(_0x4f2bc6[_0x3d82('0x31')]>0x0){_0x4f2bc6['originated']-=0x1;}else{logger[_0x3d82('0xa')](_0x3d82('0x32'),_0x1352c2);}}}else{logger[_0x3d82('0xa')](_0x3d82('0x33'),_0x1352c2);}};exports[_0x3d82('0x34')]=function(_0x239fb6){var _0x772365=moment()['format'](_0x3d82('0x35'));_0x239fb6[_0x3d82('0x36')]=0xd;_0x239fb6[_0x3d82('0x37')]='Blacklist';_0x239fb6['starttime']=_0x772365;_0x239fb6[_0x3d82('0x38')]=_0x772365;_0x239fb6['endtime']=_0x772365;};exports[_0x3d82('0x39')]=function(_0x5d336f,_0x572a27,_0x8b5174){var _0x23d60c=moment()[_0x3d82('0x12')](_0x3d82('0x35'));_0x5d336f['state']=_0x572a27;_0x5d336f[_0x3d82('0x37')]=_0x8b5174;_0x5d336f['responsetime']=_0x23d60c;_0x5d336f[_0x3d82('0x3a')]=getSeconds(_0x5d336f[_0x3d82('0x38')],_0x5d336f[_0x3d82('0x3b')]);};exports[_0x3d82('0x3c')]=function(_0x3ab447,_0x2ab114,_0x606c4a){_0x3ab447['membername']=_0x2ab114;_0x3ab447['UserId']=_0x606c4a;};exports['logCustomer']=function(_0x5b2143,_0x1045e8,_0x21f8da){var _0x159289=moment()[_0x3d82('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x5b2143['state']=_0x1045e8;_0x5b2143['statedesc']=_0x21f8da;_0x5b2143[_0x3d82('0x38')]=_0x5b2143[_0x3d82('0x38')]?_0x5b2143[_0x3d82('0x38')]:_0x159289;_0x5b2143['endtime']=_0x5b2143['endtime']?_0x5b2143[_0x3d82('0x3d')]:_0x159289;_0x5b2143[_0x3d82('0x3a')]=getSeconds(_0x5b2143['responsetime']||0x0,_0x5b2143[_0x3d82('0x3b')]||0x0);_0x5b2143['talktime']=_0x5b2143[_0x3d82('0x3e')]?getSeconds(_0x5b2143[_0x3d82('0x3d')],_0x5b2143['answertime']):0x0;};exports[_0x3d82('0x3f')]=function(_0x5a1dd6){return _0x5a1dd6===_0x3d82('0x40');};exports[_0x3d82('0x41')]=function(_0x31aeb3,_0xd83c2e,_0x51d211,_0x3aeff0,_0x2977fb){var _0x4e948e=_0x3aeff0?_0x3d82('0x42'):_0x31aeb3[_0x3d82('0x43')];_0x4e948e=_0x2977fb?_0x3d82('0x44'):_0x4e948e;return{'actionid':_0x31aeb3[_0x3d82('0x45')],'action':'originate','channel':_0x31aeb3['channelAgent'],'callerid':util[_0x3d82('0x12')](_0x3d82('0x13'),_0x4e948e,_0x31aeb3[_0x3d82('0x18')]),'Exten':_0x3d82('0x24'),'Context':'from-sip','Priority':'1','variable':_0x51d211,'timeout':(_0xd83c2e[_0x3d82('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x31aeb3[_0x3d82('0x45')]};};exports[_0x3d82('0x47')]=function(_0x46f8dd){return _0x46f8dd[_0x3d82('0x48')]+_0x46f8dd[_0x3d82('0x49')]+_0x46f8dd[_0x3d82('0x4a')]+_0x46f8dd['countagentrejectretry']+_0x46f8dd[_0x3d82('0x4b')];};exports[_0x3d82('0x4c')]=function(_0x42d367){var _0x456e5f=_[_0x3d82('0x4d')](_0x42d367);_0x456e5f[_0x3d82('0x36')]=0xf;_0x456e5f[_0x3d82('0x37')]=_0x3d82('0x4e');return _0x456e5f;};exports[_0x3d82('0x4f')]=function(_0x1803d2,_0x48f910,_0x2bb43d){var _0x436fb9={};_0x436fb9[_0x48f910]=_0x1803d2[_0x48f910];_0x436fb9['active']=![];_0x436fb9[_0x3d82('0x50')]=moment()[_0x3d82('0x51')](_0x2bb43d,_0x3d82('0x52'))[_0x3d82('0x12')](_0x3d82('0x35'));_0x436fb9[_0x3d82('0x19')]=_0x1803d2[_0x3d82('0x19')];_0x436fb9[_0x3d82('0x53')]=_0x1803d2['ListId'];_0x436fb9['VoiceQueueId']=_0x1803d2[_0x3d82('0x1b')]||undefined;return _0x436fb9;};exports[_0x3d82('0x54')]=function(_0x480ed3,_0x31d61d){if(!_[_0x3d82('0x15')](_0x480ed3)){if(_0x480ed3[_0x3d82('0x55')]>0x0){_0x480ed3['pTalking']-=0x1;}else{logger[_0x3d82('0xa')](_0x31d61d,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x3d82('0xa')](_0x31d61d,_0x3d82('0x56'));}};exports[_0x3d82('0x57')]=function(_0x33e1f5){if(_0x33e1f5<=0x0){return!![];}return![];};exports[_0x3d82('0x58')]=function(_0x1e6699,_0x3b88f0,_0x3b76cb){_0x1e6699['lastevent']=_0x3b88f0;_0x1e6699[_0x3d82('0x59')]=_0x1e6699['queue'];_0x1e6699[_0x3d82('0x5a')]=_0x1e6699['channelAgent'];_0x1e6699[_0x3d82('0x5b')]=_0x3d82('0x5c');if(_0x3b76cb){_0x1e6699[_0x3d82('0x5d')]=_0x3b76cb[_0x3d82('0x5d')];}return _0x1e6699;};exports[_0x3d82('0x5e')]=function(_0x17d571){var _0x5636ff={};_0x5636ff['queue']=_0x17d571[_0x3d82('0x5f')];_0x5636ff[_0x3d82('0x5a')]=_0x17d571[_0x3d82('0x60')];_0x5636ff[_0x3d82('0x45')]=_0x17d571[_0x3d82('0x45')];return _0x5636ff;};exports['agentReadyId']=function(_0x32f917){var _0x41ad8d=[];for(var _0x2f3ad3 in _0x32f917){if(_0x32f917[_0x3d82('0x29')](_0x2f3ad3)){if(!_[_0x3d82('0x15')](_0x32f917[_0x2f3ad3])&&_0x32f917[_0x2f3ad3][_0x3d82('0x36')]===_0x3d82('0x61')&&_0x32f917[_0x2f3ad3][_0x3d82('0x62')]===_0x3d82('0x63')){_0x41ad8d[_0x3d82('0x64')](_0x32f917[_0x2f3ad3]['id']);}}}return _0x41ad8d;};exports['getDiff']=function(_0x348aa1){var _0x4406f0=moment()[_0x3d82('0x8')](0x0);var _0x4ed3a9=moment(_0x348aa1)['milliseconds'](0x0);return _0x4406f0[_0x3d82('0x65')](_0x4ed3a9,_0x3d82('0x9'));};exports['createBody']=function(_0x4843e3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4843e3[_0x3d82('0x19')],'ListId':_0x4843e3[_0x3d82('0x53')],'VoiceQueueId':_0x4843e3[_0x3d82('0x1b')]||undefined,'CampaignId':_0x4843e3[_0x3d82('0x66')]||undefined};};exports[_0x3d82('0x67')]=function(_0x2f835e){if(_0x2f835e===_0x3d82('0x45')||_0x2f835e===_0x3d82('0x68')||_0x2f835e==='queue'||_0x2f835e===_0x3d82('0x69')||_0x2f835e===_0x3d82('0x6a')||_0x2f835e==='dialAnswer'||_0x2f835e===_0x3d82('0x6b')||_0x2f835e==='channelAgent'||_0x2f835e===_0x3d82('0x43')||_0x2f835e===_0x3d82('0x6c')||_0x2f835e===_0x3d82('0x18')||_0x2f835e==='scheduledat'||_0x2f835e===_0x3d82('0x48')||_0x2f835e==='countcongestionretry'||_0x2f835e==='countnoanswerretry'||_0x2f835e==='countglobal'||_0x2f835e===_0x3d82('0x6d')||_0x2f835e===_0x3d82('0x6e')||_0x2f835e===_0x3d82('0x6f')||_0x2f835e===_0x3d82('0x70')||_0x2f835e===_0x3d82('0x19')||_0x2f835e==='ListId'||_0x2f835e===_0x3d82('0x71')||_0x2f835e==='VoiceQueueId'||_0x2f835e===_0x3d82('0x72')||_0x2f835e===_0x3d82('0x73')||_0x2f835e===_0x3d82('0x74')||_0x2f835e===_0x3d82('0x75')||_0x2f835e===_0x3d82('0x76')||_0x2f835e===_0x3d82('0x77')||_0x2f835e===_0x3d82('0x78')||_0x2f835e===_0x3d82('0x79')||_0x2f835e===_0x3d82('0x7a')||_0x2f835e===_0x3d82('0x7b')||_0x2f835e===_0x3d82('0x7c')||_0x2f835e===_0x3d82('0x7d')||_0x2f835e===_0x3d82('0x7e')||_0x2f835e===_0x3d82('0x7f')||_0x2f835e===_0x3d82('0x80')||_0x2f835e===_0x3d82('0x81')||_0x2f835e===_0x3d82('0x82')||_0x2f835e==='rtpaudioqosjitter'||_0x2f835e===_0x3d82('0x83')||_0x2f835e===_0x3d82('0x84')||_0x2f835e===_0x3d82('0x85')||_0x2f835e===_0x3d82('0x86')||_0x2f835e==='rtpaudioqosrttbridged'||_0x2f835e===_0x3d82('0x81')||_0x2f835e===_0x3d82('0x82')||_0x2f835e===_0x3d82('0x87')||_0x2f835e===_0x3d82('0x83')||_0x2f835e===_0x3d82('0x84')||_0x2f835e===_0x3d82('0x85')||_0x2f835e===_0x3d82('0x86')||_0x2f835e===_0x3d82('0x88')||_0x2f835e==='bridgepeer'||_0x2f835e===_0x3d82('0x89')||_0x2f835e==='state'||_0x2f835e===_0x3d82('0x37')){return![];}return!![];};exports[_0x3d82('0x8a')]=function(_0x362479,_0x1e354a){var _0xc5eb20,_0x2d138c,_0x456e45;if(_0x1e354a<=0x0){_0x1e354a=0x1;}_0xc5eb20=new RegExp('\x5cw{0,'+_0x1e354a+'}$');_0x2d138c=Math[_0x3d82('0x8b')](0xa,_0x1e354a-0x1);_0x456e45=Math[_0x3d82('0x8b')](0xa,_0x1e354a)-0x1;return util['format']('%s',_[_0x3d82('0x8c')](_0x362479,_0xc5eb20,_['random'](_0x2d138c,_0x456e45)));};exports[_0x3d82('0x8d')]=function(_0xf0fb6b){var _0x140674=_0xf0fb6b[_0x3d82('0x8e')](/"(.*?)"/);return _0x140674?_0x140674[0x1]:_0xf0fb6b;};exports['extractCalleridNumber']=function(_0x51ecb8){var _0x251773=_0x51ecb8[_0x3d82('0x8e')](/<(.*?)>/);return _0x251773?_0x251773[0x1]:_0x51ecb8;};
\ No newline at end of file
index daf7dc7..a73de9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cc3=['queueadd','string','boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x3d7e6c,_0x26b9b3){var _0x31a0a4=function(_0x21bc57){while(--_0x21bc57){_0x3d7e6c['push'](_0x3d7e6c['shift']());}};_0x31a0a4(++_0x26b9b3);}(_0x9cc3,0x138));var _0x39cc=function(_0x42c1cb,_0x62928e){_0x42c1cb=_0x42c1cb-0x0;var _0x25b8b2=_0x9cc3[_0x42c1cb];return _0x25b8b2;};'use strict';exports[_0x39cc('0x0')]={'queue':{'type':_0x39cc('0x1'),'required':!![]},'interface':{'type':_0x39cc('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x39cc('0x2'),'required':![]}};exports[_0x39cc('0x3')]={'queue':{'type':_0x39cc('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x39cc('0x4')]={'interface':{'type':_0x39cc('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x39cc('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x39cc('0x1'),'required':![]}};exports[_0x39cc('0x5')]={'uniqueid':{'type':_0x39cc('0x1'),'required':!![]}};exports[_0x39cc('0x6')]={'uniqueid':{'type':_0x39cc('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x39cc('0x1')},'mixmonitorid':{'type':_0x39cc('0x1')}};exports[_0x39cc('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x39cc('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x39cc('0x1')}};
\ No newline at end of file
+var _0x559d=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove','queuepause','voicequeuechannel'];(function(_0x49fb23,_0x5340d4){var _0x4ef27b=function(_0xe79ef4){while(--_0xe79ef4){_0x49fb23['push'](_0x49fb23['shift']());}};_0x4ef27b(++_0x5340d4);}(_0x559d,0x108));var _0xd559=function(_0x5d0d1b,_0x44b391){_0x5d0d1b=_0x5d0d1b-0x0;var _0x196810=_0x559d[_0x5d0d1b];return _0x196810;};'use strict';exports['queueadd']={'queue':{'type':_0xd559('0x0'),'required':!![]},'interface':{'type':_0xd559('0x0'),'required':!![]},'membername':{'type':_0xd559('0x0'),'required':!![]},'penalty':{'type':_0xd559('0x1'),'required':![]},'paused':{'type':_0xd559('0x2'),'required':![]}};exports[_0xd559('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xd559('0x0'),'required':!![]}};exports[_0xd559('0x4')]={'interface':{'type':_0xd559('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0xd559('0x0'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0xd559('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xd559('0x6')]={'uniqueid':{'type':_0xd559('0x0'),'required':!![]},'filename':{'type':_0xd559('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0xd559('0x0')}};exports[_0xd559('0x7')]={'uniqueid':{'type':_0xd559('0x0'),'required':!![]}};exports[_0xd559('0x8')]={'uniqueid':{'type':_0xd559('0x0'),'required':!![]},'exten':{'type':_0xd559('0x0'),'required':!![]},'context':{'type':_0xd559('0x0')}};
\ No newline at end of file
index d210b03..978328a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f99=['unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','initAgents','length','isUndefined','mergeFromDatabase','initTrunks','initVoiceQueues','initTemplates','initFreshdeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','sumDuration','queuecallercompleteAt','queuecallerexitAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initFaxAccounts','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','isNil','name','interface','hasOwnProperty','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays'];(function(_0x1b8514,_0x133d49){var _0xf5a1f8=function(_0x15265e){while(--_0x15265e){_0x1b8514['push'](_0x1b8514['shift']());}};_0xf5a1f8(++_0x133d49);}(_0x5f99,0x1bc));var _0x95f9=function(_0x3d1d5e,_0x481920){_0x3d1d5e=_0x3d1d5e-0x0;var _0x2226aa=_0x5f99[_0x3d1d5e];return _0x2226aa;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x95f9('0x0'));var moment=require(_0x95f9('0x1'));var Agent=require(_0x95f9('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x95f9('0x3'));var VoiceQueue=require(_0x95f9('0x4'));var Trigger=require(_0x95f9('0x5'));var Template=require(_0x95f9('0x6'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x95f9('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x95f9('0x8'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x95f9('0x9'));var VtigerAccount=require(_0x95f9('0xa'));var ServicenowAccount=require(_0x95f9('0xb'));var Dynamics365Account=require(_0x95f9('0xc'));var FreshsalesAccount=require(_0x95f9('0xd'));var FaxAccount=require(_0x95f9('0xe'));var Realtime=function(){this[_0x95f9('0xf')]={};this[_0x95f9('0x10')]={};this[_0x95f9('0x11')]={};this[_0x95f9('0x12')]={};this[_0x95f9('0x13')]={};this[_0x95f9('0x14')]={};this[_0x95f9('0x15')]={};this[_0x95f9('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x95f9('0x17')]={};this[_0x95f9('0x18')]={};this[_0x95f9('0x19')]={};this[_0x95f9('0x1a')]={};this[_0x95f9('0x1b')]={};this[_0x95f9('0x1c')]={};this[_0x95f9('0x1d')]={};this[_0x95f9('0x1e')]={};this[_0x95f9('0x1f')]={};this[_0x95f9('0x20')]={};this['deskAccounts']={};this[_0x95f9('0x21')]={};this[_0x95f9('0x22')]={};this[_0x95f9('0x23')]={};this[_0x95f9('0x24')]={};this[_0x95f9('0x25')]={};};function freeIsNotKey(_0xd62c45,_0x3d1c16,_0x2f108d){var _0xb3419d=_[_0x95f9('0x26')](_0xd62c45,function(_0x65dab5,_0x132d8d){return _0x65dab5[_0x2f108d];});for(var _0x45b54e in _0x3d1c16){if(_0x3d1c16['hasOwnProperty'](_0x45b54e)){if(!_0xb3419d[_0x45b54e]){delete _0x3d1c16[_0x45b54e];}}}}function freeIsNotKeySip(_0xe9478c,_0x4a7b0f){var _0x414989=_[_0x95f9('0x26')](_0xe9478c,function(_0x58b9f9,_0x50c03b){return util[_0x95f9('0x27')](_0x95f9('0x28'),_0x58b9f9['name']);});for(var _0x12cc94 in _0x4a7b0f){if(_0x4a7b0f['hasOwnProperty'](_0x12cc94)){if(!_0x414989[_0x12cc94]){delete _0x4a7b0f[_0x12cc94];}}}}function freeIsNotKeyAgent(_0x49cdd,_0x5f4fe5){var _0x3226cc=_['mapKeys'](_0x49cdd,function(_0x1f61b1,_0x371304){var _0x4d2efb=_[_0x95f9('0x29')](_0x1f61b1['interface'])?util['format']('SIP/%s',_0x1f61b1[_0x95f9('0x2a')]):_0x1f61b1[_0x95f9('0x2b')];return _0x4d2efb;});for(var _0x2c505d in _0x5f4fe5){if(_0x5f4fe5[_0x95f9('0x2c')](_0x2c505d)){if(!_0x3226cc[_0x2c505d]){delete _0x5f4fe5[_0x2c505d];}}}}function clearVoiceCallReports(_0x1bc609){_0x1bc609[_0x95f9('0x2d')]=0x0;_0x1bc609[_0x95f9('0x2e')]=0x0;_0x1bc609[_0x95f9('0x2f')]=0x0;_0x1bc609['sumDuration']=0x0;_0x1bc609[_0x95f9('0x30')]=0x0;}function clearCampaigns(_0x3afc10){if(!_[_0x95f9('0x31')](_0x3afc10)){for(var _0x1a5536 in _0x3afc10){if(_0x3afc10[_0x95f9('0x2c')](_0x1a5536)){_0x3afc10[_0x1a5536][_0x95f9('0x32')]=0x0;_0x3afc10[_0x1a5536]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2f001f){if(!_[_0x95f9('0x31')](_0x2f001f)){for(var _0x2d070d in _0x2f001f){if(_0x2f001f[_0x95f9('0x2c')](_0x2d070d)){_0x2f001f[_0x2d070d][_0x95f9('0x2d')]=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x2e')]=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x33')]=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x34')]=0x0;_0x2f001f[_0x2d070d]['sumHoldTime']=0x0;_0x2f001f[_0x2d070d]['sumDuration']=0x0;_0x2f001f[_0x2d070d]['sumBillable']=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x35')]=0x0;_0x2f001f[_0x2d070d]['outboundNoAnswerCallsDay']=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x36')]=0x0;_0x2f001f[_0x2d070d]['outboundCongestionCallsDay']=0x0;_0x2f001f[_0x2d070d]['outboundNoSuchCallsDay']=0x0;_0x2f001f[_0x2d070d]['outboundUnknownCallsDay']=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x37')]=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x38')]=0x0;_0x2f001f[_0x2d070d]['outboundBlacklistCallsDay']=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x39')]=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x3a')]=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x3b')]=0x0;_0x2f001f[_0x2d070d]['outboundAnswerAgiCallsDay']=0x0;_0x2f001f[_0x2d070d][_0x95f9('0x3c')]=0x0;_0x2f001f[_0x2d070d]['queueStatusComplete']=!![];}}}}Realtime[_0x95f9('0x3d')]['mergeFromDatabase']=function(_0xc06bd5,_0x497870){for(var _0x50196d in _0x497870){if(_0xc06bd5[_0x95f9('0x2c')](_0x50196d)){_0xc06bd5[_0x50196d]=_0x497870[_0x50196d];}}};Realtime['prototype'][_0x95f9('0x3e')]=function(){var _0x2d9f0e=this;return function(_0x585fc9){if(_0x585fc9){freeIsNotKeyAgent(_0x585fc9,_0x2d9f0e[_0x95f9('0xf')]);for(var _0x445f3e=0x0,_0x2de30c={},_0x595b14={};_0x445f3e<_0x585fc9[_0x95f9('0x3f')];_0x445f3e+=0x1){_0x2de30c=_0x585fc9[_0x445f3e];var _0x1c0f61=_[_0x95f9('0x29')](_0x2de30c[_0x95f9('0x2b')])?util['format'](_0x95f9('0x28'),_0x2de30c['name']):_0x2de30c[_0x95f9('0x2b')];if(_[_0x95f9('0x40')](_0x2d9f0e[_0x95f9('0xf')][_0x1c0f61])){_0x2d9f0e[_0x95f9('0xf')][_0x1c0f61]=new Agent(_0x2de30c);}else{_0x2d9f0e[_0x95f9('0x41')](_0x2d9f0e[_0x95f9('0xf')][_0x1c0f61],_0x2de30c);}}}return _0x2d9f0e['agents'];};};Realtime[_0x95f9('0x3d')]['initTelephones']=function(){var _0x2a5f20=this;return function(_0x1cc099){if(_0x1cc099){freeIsNotKeySip(_0x1cc099,_0x2a5f20[_0x95f9('0x10')]);for(var _0x5b4b39=0x0,_0x2c82da={},_0xf528af={};_0x5b4b39<_0x1cc099[_0x95f9('0x3f')];_0x5b4b39+=0x1){_0x2c82da=_0x1cc099[_0x5b4b39];if(_[_0x95f9('0x40')](_0x2a5f20[_0x95f9('0x10')][util[_0x95f9('0x27')]('SIP/%s',_0x2c82da[_0x95f9('0x2a')])])){_0x2a5f20[_0x95f9('0x10')][util['format'](_0x95f9('0x28'),_0x2c82da[_0x95f9('0x2a')])]=new Telephone(_0x2c82da);}else{_0x2a5f20[_0x95f9('0x41')](_0x2a5f20[_0x95f9('0x10')][util[_0x95f9('0x27')]('SIP/%s',_0x2c82da[_0x95f9('0x2a')])],_0x2c82da);}}}return _0x2a5f20['telephones'];};};Realtime[_0x95f9('0x3d')][_0x95f9('0x42')]=function(){var _0xfb0d4c=this;return function(_0x5f4ec2){if(_0x5f4ec2){freeIsNotKeySip(_0x5f4ec2,_0xfb0d4c[_0x95f9('0x11')]);for(var _0x234fb4=0x0,_0x5501b3={},_0x3910f2={};_0x234fb4<_0x5f4ec2[_0x95f9('0x3f')];_0x234fb4+=0x1){_0x5501b3=_0x5f4ec2[_0x234fb4];if(_[_0x95f9('0x40')](_0xfb0d4c[_0x95f9('0x11')][util[_0x95f9('0x27')]('SIP/%s',_0x5501b3['name'])])){_0xfb0d4c[_0x95f9('0x11')][util[_0x95f9('0x27')](_0x95f9('0x28'),_0x5501b3[_0x95f9('0x2a')])]=new Trunk(_0x5501b3);}else{_0xfb0d4c[_0x95f9('0x41')](_0xfb0d4c['trunks'][util['format'](_0x95f9('0x28'),_0x5501b3[_0x95f9('0x2a')])],_0x5501b3);}}}return _0xfb0d4c[_0x95f9('0x11')];};};Realtime['prototype'][_0x95f9('0x43')]=function(){var _0x35b47b=this;return function(_0x2d72ee){if(_0x2d72ee){freeIsNotKey(_0x2d72ee,_0x35b47b[_0x95f9('0x12')],_0x95f9('0x2a'));for(var _0x29adc8=0x0,_0x57ceda={},_0xf4be4={};_0x29adc8<_0x2d72ee[_0x95f9('0x3f')];_0x29adc8+=0x1){_0x57ceda=_0x2d72ee[_0x29adc8];if(_[_0x95f9('0x40')](_0x35b47b[_0x95f9('0x12')][_0x57ceda[_0x95f9('0x2a')]])){_0x35b47b[_0x95f9('0x12')][_0x57ceda[_0x95f9('0x2a')]]=new VoiceQueue(_0x57ceda);}else{_0x35b47b[_0x95f9('0x41')](_0x35b47b[_0x95f9('0x12')][_0x57ceda[_0x95f9('0x2a')]],_0x57ceda);}}}return _0x35b47b[_0x95f9('0x12')];};};Realtime[_0x95f9('0x3d')]['initTriggers']=function(){var _0x4f0e54=this;return function(_0x3f71f4){if(_0x3f71f4){freeIsNotKey(_0x3f71f4,_0x4f0e54[_0x95f9('0x13')],'id');for(var _0x46226f=0x0,_0x32288e={},_0x30d8d0={};_0x46226f<_0x3f71f4[_0x95f9('0x3f')];_0x46226f+=0x1){_0x32288e=_0x3f71f4[_0x46226f];if(_[_0x95f9('0x40')](_0x4f0e54['triggers'][_0x32288e['id']])){_0x4f0e54[_0x95f9('0x13')][_0x32288e['id']]=new Trigger(_0x32288e);}else{_0x4f0e54[_0x95f9('0x41')](_0x4f0e54[_0x95f9('0x13')][_0x32288e['id']],_0x32288e);}}}return _0x4f0e54[_0x95f9('0x13')];};};Realtime['prototype'][_0x95f9('0x44')]=function(){var _0x33b77c=this;return function(_0x9dc4c2){if(_0x9dc4c2){freeIsNotKey(_0x9dc4c2,_0x33b77c[_0x95f9('0x15')],'id');for(var _0x338641=0x0,_0x5a562a={},_0x10dd10={};_0x338641<_0x9dc4c2[_0x95f9('0x3f')];_0x338641+=0x1){_0x5a562a=_0x9dc4c2[_0x338641];if(_[_0x95f9('0x40')](_0x33b77c[_0x95f9('0x15')][_0x5a562a['id']])){_0x33b77c['templates'][_0x5a562a['id']]=new Template(_0x5a562a);}else{_0x33b77c[_0x95f9('0x41')](_0x33b77c[_0x95f9('0x15')][_0x5a562a['id']],_0x5a562a);}}}return _0x33b77c['templates'];};};Realtime[_0x95f9('0x3d')]['initZendeskAccounts']=function(){var _0x38ac86=this;return function(_0x58f3b1){if(_0x58f3b1){freeIsNotKey(_0x58f3b1,_0x38ac86[_0x95f9('0x1c')],'id');for(var _0x3be305=0x0,_0x361488={},_0x231ed8={};_0x3be305<_0x58f3b1[_0x95f9('0x3f')];_0x3be305+=0x1){_0x361488=_0x58f3b1[_0x3be305];if(_[_0x95f9('0x40')](_0x38ac86[_0x95f9('0x1c')][_0x361488['id']])){_0x38ac86['zendeskAccounts'][_0x361488['id']]=new ZendeskAccount(_0x361488);}else{_0x38ac86[_0x95f9('0x41')](_0x38ac86[_0x95f9('0x1c')][_0x361488['id']],_0x361488);}}}return _0x38ac86['zendeskAccounts'];};};Realtime[_0x95f9('0x3d')]['initSalesforceAccounts']=function(){var _0x1f917a=this;return function(_0x235c42){if(_0x235c42){freeIsNotKey(_0x235c42,_0x1f917a[_0x95f9('0x1d')],'id');for(var _0x544f5c=0x0,_0x5a02d0={},_0x5000a3={};_0x544f5c<_0x235c42['length'];_0x544f5c+=0x1){_0x5a02d0=_0x235c42[_0x544f5c];if(_[_0x95f9('0x40')](_0x1f917a[_0x95f9('0x1d')][_0x5a02d0['id']])){_0x1f917a[_0x95f9('0x1d')][_0x5a02d0['id']]=new SalesforceAccount(_0x5a02d0);}else{_0x1f917a[_0x95f9('0x41')](_0x1f917a['salesforceAccounts'][_0x5a02d0['id']],_0x5a02d0);}}}return _0x1f917a[_0x95f9('0x1d')];};};Realtime['prototype'][_0x95f9('0x45')]=function(){var _0x1416e3=this;return function(_0x464423){if(_0x464423){freeIsNotKey(_0x464423,_0x1416e3[_0x95f9('0x1f')],'id');for(var _0x46f3a4=0x0,_0xfc9b4d={},_0x160c45={};_0x46f3a4<_0x464423[_0x95f9('0x3f')];_0x46f3a4+=0x1){_0xfc9b4d=_0x464423[_0x46f3a4];if(_[_0x95f9('0x40')](_0x1416e3['freshdeskAccounts'][_0xfc9b4d['id']])){_0x1416e3[_0x95f9('0x1f')][_0xfc9b4d['id']]=new FreshdeskAccount(_0xfc9b4d);}else{_0x1416e3[_0x95f9('0x41')](_0x1416e3[_0x95f9('0x1f')][_0xfc9b4d['id']],_0xfc9b4d);}}}return _0x1416e3[_0x95f9('0x1f')];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x402edc=this;return function(_0x5b427b){if(_0x5b427b){freeIsNotKey(_0x5b427b,_0x402edc[_0x95f9('0x20')],'id');for(var _0x5a37b1=0x0,_0x4b9125={},_0x272881={};_0x5a37b1<_0x5b427b[_0x95f9('0x3f')];_0x5a37b1+=0x1){_0x4b9125=_0x5b427b[_0x5a37b1];if(_['isUndefined'](_0x402edc[_0x95f9('0x20')][_0x4b9125['id']])){_0x402edc[_0x95f9('0x20')][_0x4b9125['id']]=new ZohoAccount(_0x4b9125);}else{_0x402edc[_0x95f9('0x41')](_0x402edc[_0x95f9('0x20')][_0x4b9125['id']],_0x4b9125);}}}return _0x402edc[_0x95f9('0x20')];};};Realtime[_0x95f9('0x3d')]['initDeskAccounts']=function(){var _0x4cd2f7=this;return function(_0x185e29){if(_0x185e29){freeIsNotKey(_0x185e29,_0x4cd2f7[_0x95f9('0x46')],'id');for(var _0x549f89=0x0,_0x3edf75={},_0xf1f3bb={};_0x549f89<_0x185e29[_0x95f9('0x3f')];_0x549f89+=0x1){_0x3edf75=_0x185e29[_0x549f89];if(_[_0x95f9('0x40')](_0x4cd2f7['deskAccounts'][_0x3edf75['id']])){_0x4cd2f7[_0x95f9('0x46')][_0x3edf75['id']]=new DeskAccount(_0x3edf75);}else{_0x4cd2f7[_0x95f9('0x41')](_0x4cd2f7['deskAccounts'][_0x3edf75['id']],_0x3edf75);}}}return _0x4cd2f7[_0x95f9('0x46')];};};Realtime[_0x95f9('0x3d')][_0x95f9('0x47')]=function(){var _0x8cb284=this;return function(_0x12cf71){if(_0x12cf71){freeIsNotKey(_0x12cf71,_0x8cb284[_0x95f9('0x1e')],'id');for(var _0x599088=0x0,_0x54e95f={},_0x13abc4={};_0x599088<_0x12cf71[_0x95f9('0x3f')];_0x599088+=0x1){_0x54e95f=_0x12cf71[_0x599088];if(_[_0x95f9('0x40')](_0x8cb284[_0x95f9('0x1e')][_0x54e95f['id']])){_0x8cb284['sugarcrmAccounts'][_0x54e95f['id']]=new SugarcrmAccount(_0x54e95f);}else{_0x8cb284['mergeFromDatabase'](_0x8cb284[_0x95f9('0x1e')][_0x54e95f['id']],_0x54e95f);}}}return _0x8cb284[_0x95f9('0x1e')];};};Realtime[_0x95f9('0x3d')][_0x95f9('0x48')]=function(){var _0x4ea141=this;return function(_0x2efb9a){if(_0x2efb9a){freeIsNotKey(_0x2efb9a,_0x4ea141[_0x95f9('0x21')],'id');for(var _0x1dcf6c=0x0,_0x71d075={},_0x32c82d={};_0x1dcf6c<_0x2efb9a[_0x95f9('0x3f')];_0x1dcf6c+=0x1){_0x71d075=_0x2efb9a[_0x1dcf6c];if(_[_0x95f9('0x40')](_0x4ea141[_0x95f9('0x21')][_0x71d075['id']])){_0x4ea141[_0x95f9('0x21')][_0x71d075['id']]=new VtigerAccount(_0x71d075);}else{_0x4ea141[_0x95f9('0x41')](_0x4ea141[_0x95f9('0x21')][_0x71d075['id']],_0x71d075);}}}return _0x4ea141[_0x95f9('0x21')];};};Realtime[_0x95f9('0x3d')][_0x95f9('0x49')]=function(){var _0x1282d9=this;return function(_0x49885c){if(_0x49885c){freeIsNotKey(_0x49885c,_0x1282d9[_0x95f9('0x22')],'id');for(var _0x25c52e=0x0,_0x368494={},_0x2f019a={};_0x25c52e<_0x49885c[_0x95f9('0x3f')];_0x25c52e+=0x1){_0x368494=_0x49885c[_0x25c52e];if(_[_0x95f9('0x40')](_0x1282d9[_0x95f9('0x22')][_0x368494['id']])){_0x1282d9[_0x95f9('0x22')][_0x368494['id']]=new ServicenowAccount(_0x368494);}else{_0x1282d9[_0x95f9('0x41')](_0x1282d9[_0x95f9('0x22')][_0x368494['id']],_0x368494);}}}return _0x1282d9[_0x95f9('0x22')];};};Realtime[_0x95f9('0x3d')][_0x95f9('0x4a')]=function(){var _0xd225d2=this;return function(_0x4dc614){if(_0x4dc614){freeIsNotKey(_0x4dc614,_0xd225d2[_0x95f9('0x23')],'id');for(var _0x16bccd=0x0,_0x5e3050={},_0x2bc7b8={};_0x16bccd<_0x4dc614['length'];_0x16bccd+=0x1){_0x5e3050=_0x4dc614[_0x16bccd];if(_[_0x95f9('0x40')](_0xd225d2[_0x95f9('0x23')][_0x5e3050['id']])){_0xd225d2[_0x95f9('0x23')][_0x5e3050['id']]=new Dynamics365Account(_0x5e3050);}else{_0xd225d2[_0x95f9('0x41')](_0xd225d2[_0x95f9('0x23')][_0x5e3050['id']],_0x5e3050);}}}return _0xd225d2[_0x95f9('0x23')];};};Realtime[_0x95f9('0x3d')][_0x95f9('0x4b')]=function(){var _0x5e66fc=this;return function(_0x1f15b0){if(_0x1f15b0){freeIsNotKey(_0x1f15b0,_0x5e66fc['freshsalesAccounts'],'id');for(var _0x4b383a=0x0,_0x57d934={},_0x10e59c={};_0x4b383a<_0x1f15b0[_0x95f9('0x3f')];_0x4b383a+=0x1){_0x57d934=_0x1f15b0[_0x4b383a];if(_[_0x95f9('0x40')](_0x5e66fc['freshsalesAccounts'][_0x57d934['id']])){_0x5e66fc[_0x95f9('0x24')][_0x57d934['id']]=new FreshsalesAccount(_0x57d934);}else{_0x5e66fc['mergeFromDatabase'](_0x5e66fc[_0x95f9('0x24')][_0x57d934['id']],_0x57d934);}}}return _0x5e66fc[_0x95f9('0x24')];};};Realtime['prototype'][_0x95f9('0x4c')]=function(){var _0xd92e27=this;return function(_0x815456){for(var _0x3411d4=0x0;_0x3411d4<_0x815456[_0x95f9('0x3f')];_0x3411d4+=0x1){_[_0x95f9('0x4d')](_0xd92e27['voiceQueues'][_0x815456[_0x3411d4][_0x95f9('0x2a')]],_0x815456[_0x3411d4]);}return _0xd92e27[_0x95f9('0x12')];};};Realtime['prototype'][_0x95f9('0x4e')]=function(){var _0x3bfb2a=this;return function(_0x23e671){clearVoiceQueues(_0x3bfb2a['voiceQueues']);if(_0x23e671){_0x23e671=_[_0x95f9('0x4f')](_0x23e671,'uniqueid');for(var _0x2b7dbb in _0x23e671){if(_0x23e671[_0x95f9('0x2c')](_0x2b7dbb)){var _0x241aea={};for(var _0x52fae8=0x0;_0x52fae8<_0x23e671[_0x2b7dbb][_0x95f9('0x3f')];_0x52fae8+=0x1){var _0x2f77ef=_0x23e671[_0x2b7dbb][_0x52fae8]['queue'];if(_0x3bfb2a['voiceQueues'][_0x2f77ef]){if(_0x23e671[_0x2b7dbb][_0x52fae8]['queuecallerexit']){_0x3bfb2a['voiceQueues'][_0x2f77ef][_0x95f9('0x33')]+=0x1;}if(_0x23e671[_0x2b7dbb][_0x52fae8][_0x95f9('0x50')]){_0x3bfb2a[_0x95f9('0x12')][_0x2f77ef][_0x95f9('0x34')]+=0x1;}_0x3bfb2a[_0x95f9('0x12')][_0x2f77ef][_0x95f9('0x2f')]+=moment(_0x23e671[_0x2b7dbb][_0x52fae8][_0x95f9('0x51')])[_0x95f9('0x52')](moment(_0x23e671[_0x2b7dbb][_0x52fae8][_0x95f9('0x53')]),_0x95f9('0x54'))||0x0;if(_0x52fae8===_0x23e671[_0x2b7dbb][_0x95f9('0x3f')]-0x1){_0x3bfb2a[_0x95f9('0x12')][_0x2f77ef][_0x95f9('0x55')]+=moment(_0x23e671[_0x2b7dbb][_0x52fae8][_0x95f9('0x56')]||_0x23e671[_0x2b7dbb][_0x52fae8]['queuecallerabandonAt']||_0x23e671[_0x2b7dbb][_0x52fae8][_0x95f9('0x57')])[_0x95f9('0x52')](moment(_0x23e671[_0x2b7dbb][_0x52fae8]['queuecallerjoinAt']),'seconds')||0x0;_0x3bfb2a[_0x95f9('0x12')][_0x2f77ef]['total']+=0x1;if(_0x23e671[_0x2b7dbb][_0x52fae8]['queuecallercomplete']){_0x3bfb2a['voiceQueues'][_0x2f77ef][_0x95f9('0x2e')]+=0x1;_0x3bfb2a[_0x95f9('0x12')][_0x2f77ef]['sumBillable']+=moment(_0x23e671[_0x2b7dbb][_0x52fae8]['queuecallercompleteAt'])[_0x95f9('0x52')](moment(_0x23e671[_0x2b7dbb][_0x52fae8]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x3bfb2a[_0x95f9('0x12')][_0x2f77ef][_0x95f9('0x55')]+=_0x3bfb2a[_0x95f9('0x12')][_0x2f77ef][_0x95f9('0x2f')]||0x0;}}}}}}return _0x3bfb2a[_0x95f9('0x12')];};};Realtime[_0x95f9('0x3d')][_0x95f9('0x58')]=function(){var _0x491493=this;return function(_0x39a361){clearVoiceCallReports(_0x491493[_0x95f9('0x16')]);if(_0x39a361){for(var _0x3d6054=0x0;_0x3d6054<_0x39a361[_0x95f9('0x3f')];_0x3d6054+=0x1){_0x491493[_0x95f9('0x16')][_0x95f9('0x2d')]+=0x1;_0x491493[_0x95f9('0x16')][_0x95f9('0x55')]+=_0x39a361[_0x3d6054][_0x95f9('0x59')];if(_0x39a361[_0x3d6054][_0x95f9('0x5a')]===_0x95f9('0x5b')){_0x491493[_0x95f9('0x16')][_0x95f9('0x2e')]+=0x1;_0x491493[_0x95f9('0x16')]['sumHoldTime']+=_0x39a361[_0x3d6054][_0x95f9('0x59')]-_0x39a361[_0x3d6054]['billableseconds']||0x0;_0x491493[_0x95f9('0x16')][_0x95f9('0x30')]+=_0x39a361[_0x3d6054][_0x95f9('0x5c')];}}}return _0x491493[_0x95f9('0x16')];};};Realtime[_0x95f9('0x3d')][_0x95f9('0x5d')]=function(){var _0x5a838d=this;return function(_0x3a6bca){if(_0x3a6bca){freeIsNotKey(_0x3a6bca,_0x5a838d[_0x95f9('0x14')],_0x95f9('0x2a'));for(var _0x4cd090=0x0,_0xf5329f={};_0x4cd090<_0x3a6bca[_0x95f9('0x3f')];_0x4cd090+=0x1){_0xf5329f=_0x3a6bca[_0x4cd090];if(_['isUndefined'](_0x5a838d[_0x95f9('0x14')][_0xf5329f[_0x95f9('0x2a')]])){_0x5a838d[_0x95f9('0x14')][_0xf5329f[_0x95f9('0x2a')]]=new Campaign(_0xf5329f);}else{_0x5a838d[_0x95f9('0x41')](_0x5a838d[_0x95f9('0x14')][_0xf5329f[_0x95f9('0x2a')]],_0xf5329f);_0x5a838d['campaigns'][_0xf5329f[_0x95f9('0x2a')]][_0x95f9('0x5e')]=_0xf5329f[_0x95f9('0x5f')]?_0xf5329f['SquareProject']['name']:undefined;}}}return _0x5a838d[_0x95f9('0x14')];};};Realtime[_0x95f9('0x3d')][_0x95f9('0x60')]=function(){var _0x5e7788=this;return function(_0x3e6c13){if(_0x3e6c13){freeIsNotKey(_0x3e6c13,_0x5e7788[_0x95f9('0x61')],'id');for(var _0x4a57e4=0x0,_0x563145={};_0x4a57e4<_0x3e6c13[_0x95f9('0x3f')];_0x4a57e4+=0x1){_0x563145=_0x3e6c13[_0x4a57e4];if(_['isUndefined'](_0x5e7788[_0x95f9('0x61')][_0x563145['id']])){_0x5e7788[_0x95f9('0x61')][_0x563145['id']]=new VoiceExtension(_0x563145);}else{_0x5e7788[_0x95f9('0x41')](_0x5e7788['voiceExtensions'][_0x563145['id']],_0x563145);}}}return _0x5e7788[_0x95f9('0x61')];};};Realtime[_0x95f9('0x3d')]['initCampaignHopperHistory']=function(){var _0x30036b=this;return function(_0x2e8c42){clearCampaigns(_0x30036b[_0x95f9('0x14')]);for(var _0x2d6be7=0x0;_0x2d6be7<_0x2e8c42['length'];_0x2d6be7+=0x1){_['merge'](_0x30036b[_0x95f9('0x14')][_0x2e8c42[_0x2d6be7][_0x95f9('0x2a')]],_0x2e8c42[_0x2d6be7]);}return _0x30036b[_0x95f9('0x14')];};};Realtime[_0x95f9('0x3d')][_0x95f9('0x62')]=function(){var _0x5a4d31=this;return function(_0x4f421e){if(_0x4f421e){freeIsNotKey(_0x4f421e,_0x5a4d31['faxAccounts'],'id');for(var _0x30eb69=0x0,_0x50be96={},_0xab53ef={};_0x30eb69<_0x4f421e[_0x95f9('0x3f')];_0x30eb69+=0x1){_0x50be96=_0x4f421e[_0x30eb69];if(_[_0x95f9('0x40')](_0x5a4d31[_0x95f9('0x25')][_0x50be96['id']])){_0x5a4d31[_0x95f9('0x25')][_0x50be96['id']]=new FaxAccount(_0x50be96);}else{_0x5a4d31[_0x95f9('0x41')](_0x5a4d31[_0x95f9('0x25')][_0x50be96['id']],_0x50be96);}}}return _0x5a4d31[_0x95f9('0x25')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0xe16d=['../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','outboundChannels','timers','settings','salesforceAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','SIP/%s','interface','format','name','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','telephones','initTrunks','trunks','initVoiceQueues','initTriggers','initTemplates','templates','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zohoAccount'];(function(_0x3e7804,_0x121853){var _0x56efda=function(_0x1996f3){while(--_0x1996f3){_0x3e7804['push'](_0x3e7804['shift']());}};_0x56efda(++_0x121853);}(_0xe16d,0xc9));var _0xde16=function(_0x4cdfe9,_0x426b3e){_0x4cdfe9=_0x4cdfe9-0x0;var _0x1c6034=_0xe16d[_0x4cdfe9];return _0x1c6034;};'use strict';var BPromise=require('bluebird');var util=require(_0xde16('0x0'));var _=require(_0xde16('0x1'));var moment=require(_0xde16('0x2'));var Agent=require(_0xde16('0x3'));var Telephone=require(_0xde16('0x4'));var Trunk=require(_0xde16('0x5'));var VoiceQueue=require(_0xde16('0x6'));var Trigger=require(_0xde16('0x7'));var Template=require(_0xde16('0x8'));var Campaign=require(_0xde16('0x9'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xde16('0xa'));var DeskAccount=require(_0xde16('0xb'));var VtigerAccount=require(_0xde16('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xde16('0xd'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xde16('0xe'));var Realtime=function(){this[_0xde16('0xf')]={};this['telephones']={};this['trunks']={};this[_0xde16('0x10')]={};this[_0xde16('0x11')]={};this[_0xde16('0x12')]={};this['templates']={};this[_0xde16('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xde16('0x14')]={};this[_0xde16('0x15')]={};this['queueChannels']={};this[_0xde16('0x16')]={};this[_0xde16('0x17')]={};this[_0xde16('0x18')]={};this['zendeskAccounts']={};this[_0xde16('0x19')]={};this['sugarcrmAccounts']={};this[_0xde16('0x1a')]={};this['zohoAccounts']={};this[_0xde16('0x1b')]={};this['vtigerAccounts']={};this[_0xde16('0x1c')]={};this['dynamics365Accounts']={};this[_0xde16('0x1d')]={};this[_0xde16('0x1e')]={};};function freeIsNotKey(_0x33d1d0,_0x354313,_0x5b7cec){var _0x3636dd=_['mapKeys'](_0x33d1d0,function(_0x3c6a8f,_0x567fd3){return _0x3c6a8f[_0x5b7cec];});for(var _0x2bde9d in _0x354313){if(_0x354313[_0xde16('0x1f')](_0x2bde9d)){if(!_0x3636dd[_0x2bde9d]){delete _0x354313[_0x2bde9d];}}}}function freeIsNotKeySip(_0x155991,_0x279da0){var _0x7db16e=_[_0xde16('0x20')](_0x155991,function(_0x3532d8,_0xbfefe){return util['format'](_0xde16('0x21'),_0x3532d8['name']);});for(var _0x44017c in _0x279da0){if(_0x279da0['hasOwnProperty'](_0x44017c)){if(!_0x7db16e[_0x44017c]){delete _0x279da0[_0x44017c];}}}}function freeIsNotKeyAgent(_0x269084,_0x333a1a){var _0x44d86b=_[_0xde16('0x20')](_0x269084,function(_0x27fbbe,_0x10df92){var _0x8a00f8=_['isNil'](_0x27fbbe[_0xde16('0x22')])?util[_0xde16('0x23')](_0xde16('0x21'),_0x27fbbe[_0xde16('0x24')]):_0x27fbbe[_0xde16('0x22')];return _0x8a00f8;});for(var _0x48cc12 in _0x333a1a){if(_0x333a1a['hasOwnProperty'](_0x48cc12)){if(!_0x44d86b[_0x48cc12]){delete _0x333a1a[_0x48cc12];}}}}function clearVoiceCallReports(_0x349d98){_0x349d98[_0xde16('0x25')]=0x0;_0x349d98[_0xde16('0x26')]=0x0;_0x349d98[_0xde16('0x27')]=0x0;_0x349d98[_0xde16('0x28')]=0x0;_0x349d98[_0xde16('0x29')]=0x0;}function clearCampaigns(_0x4fc6a0){if(!_['isEmpty'](_0x4fc6a0)){for(var _0xd038c6 in _0x4fc6a0){if(_0x4fc6a0[_0xde16('0x1f')](_0xd038c6)){_0x4fc6a0[_0xd038c6][_0xde16('0x2a')]=0x0;_0x4fc6a0[_0xd038c6][_0xde16('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x100dd3){if(!_[_0xde16('0x2c')](_0x100dd3)){for(var _0xdad4d5 in _0x100dd3){if(_0x100dd3[_0xde16('0x1f')](_0xdad4d5)){_0x100dd3[_0xdad4d5][_0xde16('0x25')]=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x26')]=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x2d')]=0x0;_0x100dd3[_0xdad4d5]['abandoned']=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x27')]=0x0;_0x100dd3[_0xdad4d5]['sumDuration']=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x29')]=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x2e')]=0x0;_0x100dd3[_0xdad4d5]['outboundNoAnswerCallsDay']=0x0;_0x100dd3[_0xdad4d5]['outboundBusyCallsDay']=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x2f')]=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x30')]=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x31')]=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x32')]=0x0;_0x100dd3[_0xdad4d5]['outboundDropCallsDayCallersExit']=0x0;_0x100dd3[_0xdad4d5]['outboundBlacklistCallsDay']=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x33')]=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x34')]=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x35')]=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x2e')]=0x0;_0x100dd3[_0xdad4d5][_0xde16('0x36')]=0x0;_0x100dd3[_0xdad4d5]['queueStatusComplete']=!![];}}}}Realtime[_0xde16('0x37')][_0xde16('0x38')]=function(_0x4f5a97,_0x586858){for(var _0x5ca2d1 in _0x586858){if(_0x4f5a97[_0xde16('0x1f')](_0x5ca2d1)){_0x4f5a97[_0x5ca2d1]=_0x586858[_0x5ca2d1];}}};Realtime['prototype'][_0xde16('0x39')]=function(){var _0x2676f6=this;return function(_0xaea027){if(_0xaea027){freeIsNotKeyAgent(_0xaea027,_0x2676f6[_0xde16('0xf')]);for(var _0x432675=0x0,_0xc4f626={},_0x34ffbc={};_0x432675<_0xaea027[_0xde16('0x3a')];_0x432675+=0x1){_0xc4f626=_0xaea027[_0x432675];var _0x1c530a=_[_0xde16('0x3b')](_0xc4f626['interface'])?util[_0xde16('0x23')](_0xde16('0x21'),_0xc4f626[_0xde16('0x24')]):_0xc4f626['interface'];if(_[_0xde16('0x3c')](_0x2676f6[_0xde16('0xf')][_0x1c530a])){_0x2676f6['agents'][_0x1c530a]=new Agent(_0xc4f626);}else{_0x2676f6[_0xde16('0x38')](_0x2676f6[_0xde16('0xf')][_0x1c530a],_0xc4f626);}}}return _0x2676f6[_0xde16('0xf')];};};Realtime[_0xde16('0x37')][_0xde16('0x3d')]=function(){var _0x9c26ab=this;return function(_0x411598){if(_0x411598){freeIsNotKeySip(_0x411598,_0x9c26ab[_0xde16('0x3e')]);for(var _0x190406=0x0,_0x29012e={},_0x12fe58={};_0x190406<_0x411598[_0xde16('0x3a')];_0x190406+=0x1){_0x29012e=_0x411598[_0x190406];if(_[_0xde16('0x3c')](_0x9c26ab[_0xde16('0x3e')][util[_0xde16('0x23')](_0xde16('0x21'),_0x29012e[_0xde16('0x24')])])){_0x9c26ab['telephones'][util[_0xde16('0x23')](_0xde16('0x21'),_0x29012e[_0xde16('0x24')])]=new Telephone(_0x29012e);}else{_0x9c26ab[_0xde16('0x38')](_0x9c26ab[_0xde16('0x3e')][util[_0xde16('0x23')](_0xde16('0x21'),_0x29012e['name'])],_0x29012e);}}}return _0x9c26ab[_0xde16('0x3e')];};};Realtime[_0xde16('0x37')][_0xde16('0x3f')]=function(){var _0x2cd457=this;return function(_0x112751){if(_0x112751){freeIsNotKeySip(_0x112751,_0x2cd457[_0xde16('0x40')]);for(var _0x520918=0x0,_0x1c0565={},_0xa782f6={};_0x520918<_0x112751[_0xde16('0x3a')];_0x520918+=0x1){_0x1c0565=_0x112751[_0x520918];if(_[_0xde16('0x3c')](_0x2cd457['trunks'][util['format'](_0xde16('0x21'),_0x1c0565[_0xde16('0x24')])])){_0x2cd457['trunks'][util[_0xde16('0x23')](_0xde16('0x21'),_0x1c0565[_0xde16('0x24')])]=new Trunk(_0x1c0565);}else{_0x2cd457[_0xde16('0x38')](_0x2cd457[_0xde16('0x40')][util['format'](_0xde16('0x21'),_0x1c0565[_0xde16('0x24')])],_0x1c0565);}}}return _0x2cd457[_0xde16('0x40')];};};Realtime[_0xde16('0x37')][_0xde16('0x41')]=function(){var _0x5d99df=this;return function(_0x3b7b18){if(_0x3b7b18){freeIsNotKey(_0x3b7b18,_0x5d99df['voiceQueues'],_0xde16('0x24'));for(var _0x5c098c=0x0,_0x58b707={},_0x4aed8d={};_0x5c098c<_0x3b7b18[_0xde16('0x3a')];_0x5c098c+=0x1){_0x58b707=_0x3b7b18[_0x5c098c];if(_[_0xde16('0x3c')](_0x5d99df[_0xde16('0x10')][_0x58b707['name']])){_0x5d99df[_0xde16('0x10')][_0x58b707[_0xde16('0x24')]]=new VoiceQueue(_0x58b707);}else{_0x5d99df[_0xde16('0x38')](_0x5d99df[_0xde16('0x10')][_0x58b707[_0xde16('0x24')]],_0x58b707);}}}return _0x5d99df[_0xde16('0x10')];};};Realtime[_0xde16('0x37')][_0xde16('0x42')]=function(){var _0x4bf792=this;return function(_0x20bdf5){if(_0x20bdf5){freeIsNotKey(_0x20bdf5,_0x4bf792[_0xde16('0x11')],'id');for(var _0x944139=0x0,_0x512c37={},_0x193d0b={};_0x944139<_0x20bdf5['length'];_0x944139+=0x1){_0x512c37=_0x20bdf5[_0x944139];if(_['isUndefined'](_0x4bf792['triggers'][_0x512c37['id']])){_0x4bf792['triggers'][_0x512c37['id']]=new Trigger(_0x512c37);}else{_0x4bf792[_0xde16('0x38')](_0x4bf792[_0xde16('0x11')][_0x512c37['id']],_0x512c37);}}}return _0x4bf792[_0xde16('0x11')];};};Realtime[_0xde16('0x37')][_0xde16('0x43')]=function(){var _0x224afe=this;return function(_0x595880){if(_0x595880){freeIsNotKey(_0x595880,_0x224afe['templates'],'id');for(var _0x53badb=0x0,_0xe6b39c={},_0x447634={};_0x53badb<_0x595880[_0xde16('0x3a')];_0x53badb+=0x1){_0xe6b39c=_0x595880[_0x53badb];if(_[_0xde16('0x3c')](_0x224afe[_0xde16('0x44')][_0xe6b39c['id']])){_0x224afe[_0xde16('0x44')][_0xe6b39c['id']]=new Template(_0xe6b39c);}else{_0x224afe[_0xde16('0x38')](_0x224afe[_0xde16('0x44')][_0xe6b39c['id']],_0xe6b39c);}}}return _0x224afe[_0xde16('0x44')];};};Realtime[_0xde16('0x37')]['initZendeskAccounts']=function(){var _0x2f983e=this;return function(_0x3e679e){if(_0x3e679e){freeIsNotKey(_0x3e679e,_0x2f983e[_0xde16('0x45')],'id');for(var _0x2f5a0a=0x0,_0x1cea73={},_0x13fa09={};_0x2f5a0a<_0x3e679e[_0xde16('0x3a')];_0x2f5a0a+=0x1){_0x1cea73=_0x3e679e[_0x2f5a0a];if(_[_0xde16('0x3c')](_0x2f983e['zendeskAccounts'][_0x1cea73['id']])){_0x2f983e[_0xde16('0x45')][_0x1cea73['id']]=new ZendeskAccount(_0x1cea73);}else{_0x2f983e[_0xde16('0x38')](_0x2f983e['zendeskAccounts'][_0x1cea73['id']],_0x1cea73);}}}return _0x2f983e[_0xde16('0x45')];};};Realtime['prototype'][_0xde16('0x46')]=function(){var _0x339b72=this;return function(_0x17d38e){if(_0x17d38e){freeIsNotKey(_0x17d38e,_0x339b72[_0xde16('0x19')],'id');for(var _0x35c32e=0x0,_0x63b933={},_0x5e0003={};_0x35c32e<_0x17d38e[_0xde16('0x3a')];_0x35c32e+=0x1){_0x63b933=_0x17d38e[_0x35c32e];if(_[_0xde16('0x3c')](_0x339b72[_0xde16('0x19')][_0x63b933['id']])){_0x339b72[_0xde16('0x19')][_0x63b933['id']]=new SalesforceAccount(_0x63b933);}else{_0x339b72[_0xde16('0x38')](_0x339b72[_0xde16('0x19')][_0x63b933['id']],_0x63b933);}}}return _0x339b72[_0xde16('0x19')];};};Realtime['prototype'][_0xde16('0x47')]=function(){var _0x39a2fe=this;return function(_0x5f10c9){if(_0x5f10c9){freeIsNotKey(_0x5f10c9,_0x39a2fe[_0xde16('0x1a')],'id');for(var _0x2c048d=0x0,_0x2d5114={},_0xcc9cbc={};_0x2c048d<_0x5f10c9[_0xde16('0x3a')];_0x2c048d+=0x1){_0x2d5114=_0x5f10c9[_0x2c048d];if(_[_0xde16('0x3c')](_0x39a2fe['freshdeskAccounts'][_0x2d5114['id']])){_0x39a2fe[_0xde16('0x1a')][_0x2d5114['id']]=new FreshdeskAccount(_0x2d5114);}else{_0x39a2fe[_0xde16('0x38')](_0x39a2fe[_0xde16('0x1a')][_0x2d5114['id']],_0x2d5114);}}}return _0x39a2fe[_0xde16('0x1a')];};};Realtime[_0xde16('0x37')][_0xde16('0x48')]=function(){var _0x3cbaa9=this;return function(_0x4968a0){if(_0x4968a0){freeIsNotKey(_0x4968a0,_0x3cbaa9[_0xde16('0x49')],'id');for(var _0x206994=0x0,_0x44b07b={},_0x1b6cc0={};_0x206994<_0x4968a0[_0xde16('0x3a')];_0x206994+=0x1){_0x44b07b=_0x4968a0[_0x206994];if(_[_0xde16('0x3c')](_0x3cbaa9[_0xde16('0x49')][_0x44b07b['id']])){_0x3cbaa9[_0xde16('0x49')][_0x44b07b['id']]=new ZohoAccount(_0x44b07b);}else{_0x3cbaa9[_0xde16('0x38')](_0x3cbaa9[_0xde16('0x49')][_0x44b07b['id']],_0x44b07b);}}}return _0x3cbaa9['zohoAccounts'];};};Realtime[_0xde16('0x37')][_0xde16('0x4a')]=function(){var _0x231205=this;return function(_0x23239c){if(_0x23239c){freeIsNotKey(_0x23239c,_0x231205[_0xde16('0x1b')],'id');for(var _0x2a934d=0x0,_0x3f7fa7={},_0x53ea55={};_0x2a934d<_0x23239c[_0xde16('0x3a')];_0x2a934d+=0x1){_0x3f7fa7=_0x23239c[_0x2a934d];if(_[_0xde16('0x3c')](_0x231205[_0xde16('0x1b')][_0x3f7fa7['id']])){_0x231205[_0xde16('0x1b')][_0x3f7fa7['id']]=new DeskAccount(_0x3f7fa7);}else{_0x231205[_0xde16('0x38')](_0x231205[_0xde16('0x1b')][_0x3f7fa7['id']],_0x3f7fa7);}}}return _0x231205[_0xde16('0x1b')];};};Realtime[_0xde16('0x37')][_0xde16('0x4b')]=function(){var _0x4baa64=this;return function(_0xb6dafd){if(_0xb6dafd){freeIsNotKey(_0xb6dafd,_0x4baa64[_0xde16('0x4c')],'id');for(var _0x31f9ce=0x0,_0x54f197={},_0x24da85={};_0x31f9ce<_0xb6dafd[_0xde16('0x3a')];_0x31f9ce+=0x1){_0x54f197=_0xb6dafd[_0x31f9ce];if(_[_0xde16('0x3c')](_0x4baa64['sugarcrmAccounts'][_0x54f197['id']])){_0x4baa64['sugarcrmAccounts'][_0x54f197['id']]=new SugarcrmAccount(_0x54f197);}else{_0x4baa64[_0xde16('0x38')](_0x4baa64[_0xde16('0x4c')][_0x54f197['id']],_0x54f197);}}}return _0x4baa64[_0xde16('0x4c')];};};Realtime['prototype'][_0xde16('0x4d')]=function(){var _0x48d441=this;return function(_0x226780){if(_0x226780){freeIsNotKey(_0x226780,_0x48d441[_0xde16('0x4e')],'id');for(var _0x4ecf2c=0x0,_0x1e2e55={},_0x2062d7={};_0x4ecf2c<_0x226780[_0xde16('0x3a')];_0x4ecf2c+=0x1){_0x1e2e55=_0x226780[_0x4ecf2c];if(_['isUndefined'](_0x48d441[_0xde16('0x4e')][_0x1e2e55['id']])){_0x48d441[_0xde16('0x4e')][_0x1e2e55['id']]=new VtigerAccount(_0x1e2e55);}else{_0x48d441['mergeFromDatabase'](_0x48d441[_0xde16('0x4e')][_0x1e2e55['id']],_0x1e2e55);}}}return _0x48d441['vtigerAccounts'];};};Realtime[_0xde16('0x37')][_0xde16('0x4f')]=function(){var _0x55949d=this;return function(_0xecf33a){if(_0xecf33a){freeIsNotKey(_0xecf33a,_0x55949d['servicenowAccounts'],'id');for(var _0x517e0b=0x0,_0x1d036d={},_0x160f2f={};_0x517e0b<_0xecf33a[_0xde16('0x3a')];_0x517e0b+=0x1){_0x1d036d=_0xecf33a[_0x517e0b];if(_['isUndefined'](_0x55949d[_0xde16('0x1c')][_0x1d036d['id']])){_0x55949d['servicenowAccounts'][_0x1d036d['id']]=new ServicenowAccount(_0x1d036d);}else{_0x55949d[_0xde16('0x38')](_0x55949d[_0xde16('0x1c')][_0x1d036d['id']],_0x1d036d);}}}return _0x55949d['servicenowAccounts'];};};Realtime[_0xde16('0x37')][_0xde16('0x50')]=function(){var _0x582a8b=this;return function(_0x5c24af){if(_0x5c24af){freeIsNotKey(_0x5c24af,_0x582a8b[_0xde16('0x51')],'id');for(var _0x1623c3=0x0,_0x2227fb={},_0x16b5d0={};_0x1623c3<_0x5c24af[_0xde16('0x3a')];_0x1623c3+=0x1){_0x2227fb=_0x5c24af[_0x1623c3];if(_[_0xde16('0x3c')](_0x582a8b[_0xde16('0x51')][_0x2227fb['id']])){_0x582a8b[_0xde16('0x51')][_0x2227fb['id']]=new Dynamics365Account(_0x2227fb);}else{_0x582a8b[_0xde16('0x38')](_0x582a8b[_0xde16('0x51')][_0x2227fb['id']],_0x2227fb);}}}return _0x582a8b[_0xde16('0x51')];};};Realtime[_0xde16('0x37')]['initFreshsalesAccounts']=function(){var _0x304d4d=this;return function(_0x3c0f09){if(_0x3c0f09){freeIsNotKey(_0x3c0f09,_0x304d4d['freshsalesAccounts'],'id');for(var _0x3400c4=0x0,_0x302c1b={},_0x4469b2={};_0x3400c4<_0x3c0f09[_0xde16('0x3a')];_0x3400c4+=0x1){_0x302c1b=_0x3c0f09[_0x3400c4];if(_['isUndefined'](_0x304d4d['freshsalesAccounts'][_0x302c1b['id']])){_0x304d4d[_0xde16('0x1d')][_0x302c1b['id']]=new FreshsalesAccount(_0x302c1b);}else{_0x304d4d[_0xde16('0x38')](_0x304d4d[_0xde16('0x1d')][_0x302c1b['id']],_0x302c1b);}}}return _0x304d4d[_0xde16('0x1d')];};};Realtime[_0xde16('0x37')][_0xde16('0x52')]=function(){var _0x4e6a4f=this;return function(_0x1c03e4){for(var _0x3a69b4=0x0;_0x3a69b4<_0x1c03e4[_0xde16('0x3a')];_0x3a69b4+=0x1){_['merge'](_0x4e6a4f[_0xde16('0x10')][_0x1c03e4[_0x3a69b4]['name']],_0x1c03e4[_0x3a69b4]);}return _0x4e6a4f[_0xde16('0x10')];};};Realtime[_0xde16('0x37')][_0xde16('0x53')]=function(){var _0x37e549=this;return function(_0x9d404b){clearVoiceQueues(_0x37e549[_0xde16('0x10')]);if(_0x9d404b){_0x9d404b=_[_0xde16('0x54')](_0x9d404b,_0xde16('0x55'));for(var _0x199840 in _0x9d404b){if(_0x9d404b[_0xde16('0x1f')](_0x199840)){var _0x4c52f6={};for(var _0x1b8e83=0x0;_0x1b8e83<_0x9d404b[_0x199840][_0xde16('0x3a')];_0x1b8e83+=0x1){var _0x24856b=_0x9d404b[_0x199840][_0x1b8e83][_0xde16('0x56')];if(_0x37e549[_0xde16('0x10')][_0x24856b]){if(_0x9d404b[_0x199840][_0x1b8e83][_0xde16('0x57')]){_0x37e549[_0xde16('0x10')][_0x24856b][_0xde16('0x2d')]+=0x1;}if(_0x9d404b[_0x199840][_0x1b8e83][_0xde16('0x58')]){_0x37e549[_0xde16('0x10')][_0x24856b][_0xde16('0x59')]+=0x1;}_0x37e549['voiceQueues'][_0x24856b][_0xde16('0x27')]+=moment(_0x9d404b[_0x199840][_0x1b8e83][_0xde16('0x5a')])[_0xde16('0x5b')](moment(_0x9d404b[_0x199840][_0x1b8e83][_0xde16('0x5c')]),_0xde16('0x5d'))||0x0;if(_0x1b8e83===_0x9d404b[_0x199840][_0xde16('0x3a')]-0x1){_0x37e549[_0xde16('0x10')][_0x24856b][_0xde16('0x28')]+=moment(_0x9d404b[_0x199840][_0x1b8e83][_0xde16('0x5e')]||_0x9d404b[_0x199840][_0x1b8e83]['queuecallerabandonAt']||_0x9d404b[_0x199840][_0x1b8e83][_0xde16('0x5f')])[_0xde16('0x5b')](moment(_0x9d404b[_0x199840][_0x1b8e83][_0xde16('0x5c')]),_0xde16('0x5d'))||0x0;_0x37e549[_0xde16('0x10')][_0x24856b][_0xde16('0x25')]+=0x1;if(_0x9d404b[_0x199840][_0x1b8e83]['queuecallercomplete']){_0x37e549['voiceQueues'][_0x24856b][_0xde16('0x26')]+=0x1;_0x37e549[_0xde16('0x10')][_0x24856b][_0xde16('0x29')]+=moment(_0x9d404b[_0x199840][_0x1b8e83][_0xde16('0x5e')])[_0xde16('0x5b')](moment(_0x9d404b[_0x199840][_0x1b8e83][_0xde16('0x5a')]),_0xde16('0x5d'))||0x0;}}else{_0x37e549['voiceQueues'][_0x24856b][_0xde16('0x28')]+=_0x37e549['voiceQueues'][_0x24856b][_0xde16('0x27')]||0x0;}}}}}}return _0x37e549[_0xde16('0x10')];};};Realtime[_0xde16('0x37')]['initVoiceCallReports']=function(){var _0x355f86=this;return function(_0x3ad0){clearVoiceCallReports(_0x355f86[_0xde16('0x13')]);if(_0x3ad0){for(var _0x1a9083=0x0;_0x1a9083<_0x3ad0[_0xde16('0x3a')];_0x1a9083+=0x1){_0x355f86['outbound'][_0xde16('0x25')]+=0x1;_0x355f86['outbound']['sumDuration']+=_0x3ad0[_0x1a9083][_0xde16('0x60')];if(_0x3ad0[_0x1a9083]['disposition']==='ANSWERED'){_0x355f86['outbound']['answered']+=0x1;_0x355f86[_0xde16('0x13')][_0xde16('0x27')]+=_0x3ad0[_0x1a9083][_0xde16('0x60')]-_0x3ad0[_0x1a9083][_0xde16('0x61')]||0x0;_0x355f86[_0xde16('0x13')]['sumBillable']+=_0x3ad0[_0x1a9083][_0xde16('0x61')];}}}return _0x355f86['outbound'];};};Realtime['prototype'][_0xde16('0x62')]=function(){var _0x3213d7=this;return function(_0x4eebbf){if(_0x4eebbf){freeIsNotKey(_0x4eebbf,_0x3213d7[_0xde16('0x12')],_0xde16('0x24'));for(var _0xf73c44=0x0,_0x5152ee={};_0xf73c44<_0x4eebbf['length'];_0xf73c44+=0x1){_0x5152ee=_0x4eebbf[_0xf73c44];if(_[_0xde16('0x3c')](_0x3213d7[_0xde16('0x12')][_0x5152ee[_0xde16('0x24')]])){_0x3213d7[_0xde16('0x12')][_0x5152ee[_0xde16('0x24')]]=new Campaign(_0x5152ee);}else{_0x3213d7['mergeFromDatabase'](_0x3213d7[_0xde16('0x12')][_0x5152ee[_0xde16('0x24')]],_0x5152ee);_0x3213d7[_0xde16('0x12')][_0x5152ee[_0xde16('0x24')]][_0xde16('0x63')]=_0x5152ee[_0xde16('0x64')]?_0x5152ee['SquareProject']['name']:undefined;}}}return _0x3213d7[_0xde16('0x12')];};};Realtime[_0xde16('0x37')][_0xde16('0x65')]=function(){var _0x6bde6=this;return function(_0x1c8755){if(_0x1c8755){freeIsNotKey(_0x1c8755,_0x6bde6[_0xde16('0x14')],'id');for(var _0x255387=0x0,_0x2d34d3={};_0x255387<_0x1c8755[_0xde16('0x3a')];_0x255387+=0x1){_0x2d34d3=_0x1c8755[_0x255387];if(_[_0xde16('0x3c')](_0x6bde6[_0xde16('0x14')][_0x2d34d3['id']])){_0x6bde6[_0xde16('0x14')][_0x2d34d3['id']]=new VoiceExtension(_0x2d34d3);}else{_0x6bde6[_0xde16('0x38')](_0x6bde6['voiceExtensions'][_0x2d34d3['id']],_0x2d34d3);}}}return _0x6bde6[_0xde16('0x14')];};};Realtime[_0xde16('0x37')][_0xde16('0x66')]=function(){var _0x198913=this;return function(_0x4362a2){clearCampaigns(_0x198913[_0xde16('0x12')]);for(var _0x47e6f3=0x0;_0x47e6f3<_0x4362a2[_0xde16('0x3a')];_0x47e6f3+=0x1){_[_0xde16('0x67')](_0x198913[_0xde16('0x12')][_0x4362a2[_0x47e6f3][_0xde16('0x24')]],_0x4362a2[_0x47e6f3]);}return _0x198913[_0xde16('0x12')];};};Realtime[_0xde16('0x37')][_0xde16('0x68')]=function(){var _0x5b372f=this;return function(_0x47fe11){if(_0x47fe11){freeIsNotKey(_0x47fe11,_0x5b372f[_0xde16('0x1e')],'id');for(var _0x32af92=0x0,_0x5a9088={},_0x1c575a={};_0x32af92<_0x47fe11[_0xde16('0x3a')];_0x32af92+=0x1){_0x5a9088=_0x47fe11[_0x32af92];if(_[_0xde16('0x3c')](_0x5b372f[_0xde16('0x1e')][_0x5a9088['id']])){_0x5b372f[_0xde16('0x1e')][_0x5a9088['id']]=new FaxAccount(_0x5a9088);}else{_0x5b372f[_0xde16('0x38')](_0x5b372f[_0xde16('0x1e')][_0x5a9088['id']],_0x5a9088);}}}return _0x5b372f[_0xde16('0x1e')];};};module[_0xde16('0x69')]=Realtime;
\ No newline at end of file
index ebb024e..4d693f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74d0=['calleridname','connectedlinename','voiceAgentReport','isArray','forEach','voiceDialReport','Local','indexOf','phone','substring','lastIndexOf','transfererlinkedid','attendedTransfer','exports','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','name','isNil','interface','format','SIP/%s','prototype','connectedlinenum','accountcode','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','disposition','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','create','monitor','monitors','length','filename','createdAt','exten'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0x74d0,0xb8));var _0x074d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x74d0[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x074d('0x0'));var config=require('../../../config/environment');var ami=require(_0x074d('0x1'));var RpcVoiceAgentReport=require(_0x074d('0x2'));var RpcVoiceCallReport=require(_0x074d('0x3'));var RpcVoiceDialReport=require(_0x074d('0x4'));var RpcMemberReport=require(_0x074d('0x5'));var RpcVoiceQueueReport=require(_0x074d('0x6'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x074d('0x7'));var VoiceCallReport=require(_0x074d('0x8'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x074d('0x9'));var UserReport=require(_0x074d('0xa'));function Report(_0x2db8e2){this['realtime']=_0x2db8e2;this['agents']=_0x2db8e2[_0x074d('0xb')];this[_0x074d('0xc')]=_0x2db8e2['telephones'];}Report['prototype'][_0x074d('0xd')]=function(_0x249582){var _0x2f9bb5=new VoiceQueueReport(this[_0x074d('0xe')]);var _0x53531b=new VoiceAgentReport(this[_0x074d('0xe')]);var _0x2dde1a=new VoiceDialReport(this['realtime']);var _0x126814=new VoiceCallReport(this['realtime']);var _0x4a9177=new UserReport(this['realtime']);if(config[_0x074d('0xf')]&&config['xdr']['disabled']){ami['on'](_0x074d('0x10'),this[_0x074d('0x11')][_0x074d('0x12')](this));ami['on'](_0x074d('0x13'),this[_0x074d('0x14')][_0x074d('0x12')](this));ami['on'](_0x074d('0x15'),this['voiceAgentReport'][_0x074d('0x12')](this));ami['on'](_0x074d('0x16'),this['voiceDialReport'][_0x074d('0x12')](this));ami['on'](_0x074d('0x17'),this[_0x074d('0x18')][_0x074d('0x12')](this));ami['on'](_0x074d('0x19'),this['attendedTransfer'][_0x074d('0x12')](this));}};Report['prototype'][_0x074d('0x1a')]=function(_0x1dc39b){var _0x5bb85c;_0x5bb85c=_[_0x074d('0x1b')](this[_0x074d('0xb')],function(_0x439137){return _0x439137['accountcode']==_0x1dc39b||_0x439137[_0x074d('0x1c')]==_0x1dc39b;});if(_[_0x074d('0x1d')](_0x5bb85c)){var _0x59fd72=_[_0x074d('0x1b')](this[_0x074d('0xc')],function(_0x2928ac){return _0x2928ac['accountcode']==_0x1dc39b||_0x2928ac[_0x074d('0x1c')]==_0x1dc39b;});if(_0x59fd72){_0x5bb85c=_['find'](this[_0x074d('0xb')],function(_0x31b93c){return _0x31b93c[_0x074d('0x1e')]==util[_0x074d('0x1f')](_0x074d('0x20'),_0x59fd72[_0x074d('0x1c')]);});}}return _0x5bb85c;};Report[_0x074d('0x21')][_0x074d('0x11')]=function(_0x54939a){for(var _0x540475=0x0;_0x540475<_0x54939a['length'];_0x540475+=0x1){var _0x5dfdbd=this[_0x074d('0x1a')](_0x54939a[_0x540475][_0x074d('0x22')]);if(_0x5dfdbd){_0x54939a[_0x540475][_0x074d('0x23')]=_0x5dfdbd['accountcode'];_0x54939a[_0x540475][_0x074d('0x24')]=!![];_0x54939a[_0x540475][_0x074d('0x25')]=_0x5dfdbd[_0x074d('0x1c')];_0x54939a[_0x540475]['interface']=_[_0x074d('0x1d')](_0x5dfdbd[_0x074d('0x1e')])?util[_0x074d('0x1f')]('SIP/%s',_0x5dfdbd[_0x074d('0x1c')]):_0x5dfdbd['interface'];if(_0x54939a[_0x540475][_0x074d('0x26')]){_0x54939a[_0x540475][_0x074d('0x27')]=moment()[_0x074d('0x1f')](_0x074d('0x28'));}if(_0x54939a[_0x540475]['queuecallerexit']){_0x54939a[_0x540475][_0x074d('0x29')]=moment()[_0x074d('0x1f')](_0x074d('0x28'));}RpcMemberReport[_0x074d('0x11')](_0x54939a[_0x540475]);}RpcVoiceQueueReport['create'](_0x54939a[_0x540475]);}};function extractCalleridNumber(_0xafc0b3){var _0x5824d3=_0xafc0b3[_0x074d('0x2a')](/<(.*?)>/);return _0x5824d3?_0x5824d3[0x1]:_0xafc0b3;}Report[_0x074d('0x21')][_0x074d('0x14')]=function(_0x6a68b){_0x6a68b[_0x074d('0x2b')]=_0x6a68b[_0x074d('0x2b')]||_0x6a68b['exten'];if(_0x6a68b[_0x074d('0x2c')]==_0x074d('0x2d')){_0x6a68b[_0x074d('0x2e')]=_0x074d('0x2f');_0x6a68b[_0x074d('0x30')]=_0x6a68b[_0x074d('0x2f')];if(_0x6a68b[_0x074d('0x31')]==_0x074d('0x32')){_0x6a68b['accountcode']='';_0x6a68b[_0x074d('0x2b')]=extractCalleridNumber(_0x6a68b[_0x074d('0x33')]);}else if(_0x6a68b[_0x074d('0x31')]=='from-sip'){if(_0x6a68b[_0x074d('0x2b')]==_0x074d('0x34')){_0x6a68b['destination']=extractCalleridNumber(_0x6a68b[_0x074d('0x35')]);_0x6a68b[_0x074d('0x36')]=_0x6a68b[_0x074d('0x37')];_0x6a68b['destinationchannel']=[_0x6a68b[_0x074d('0x38')],_0x6a68b['channel']=_0x6a68b[_0x074d('0x39')]][0x0];_0x6a68b[_0x074d('0x33')]=_0x6a68b[_0x074d('0x35')];}else{_0x6a68b['destination']=_0x6a68b[_0x074d('0x36')];_0x6a68b['calleridnum']=_0x6a68b['originatecalleridnum'];if(_0x6a68b[_0x074d('0x3a')]=='ANSWERED'){_0x6a68b[_0x074d('0x23')]=_0x6a68b[_0x074d('0x22')];}else{_0x6a68b[_0x074d('0x23')]='';}}}}else{_0x6a68b[_0x074d('0x33')]=util[_0x074d('0x1f')](_0x074d('0x3b'),_0x6a68b['calleridname'],_0x6a68b[_0x074d('0x36')]);}if(RpcVoiceTransferReport[_0x074d('0x3c')][_0x6a68b[_0x074d('0x3d')]]){var _0x26c681=RpcVoiceTransferReport[_0x074d('0x3c')][_0x6a68b['linkedid']];_0x26c681[_0x074d('0x3e')]=_0x6a68b[_0x074d('0x3f')];RpcVoiceTransferReport[_0x074d('0x18')](_0x26c681);delete RpcVoiceTransferReport[_0x074d('0x3c')][_0x6a68b[_0x074d('0x3d')]];}RpcVoiceCallReport[_0x074d('0x40')](_0x6a68b);if(_0x6a68b[_0x074d('0x41')]){for(var _0x2c894f=0x0;_0x2c894f<_0x6a68b[_0x074d('0x42')][_0x074d('0x43')];_0x2c894f+=0x1){_0x6a68b['monitorFilename']=_0x6a68b[_0x074d('0x42')][_0x2c894f][_0x074d('0x44')];_0x6a68b[_0x074d('0x45')]=_0x6a68b[_0x074d('0x42')][_0x2c894f][_0x074d('0x45')];if(_0x6a68b[_0x074d('0x46')]==_0x074d('0x34')){_0x6a68b[_0x074d('0x36')]=_0x6a68b['connectedlinenum'];_0x6a68b[_0x074d('0x47')]=_0x6a68b[_0x074d('0x48')];_0x6a68b['connectedlinenum']=_0x6a68b[_0x074d('0x23')];_0x6a68b['connectedlinename']=_0x6a68b['membername'];_0x6a68b['exten']=_0x6a68b[_0x074d('0x37')];}else if(_0x6a68b['exten']=='xcally-motion-dialer'){_0x6a68b[_0x074d('0x36')]=_0x6a68b['destination'];_0x6a68b[_0x074d('0x46')]=_0x6a68b[_0x074d('0x37')];}RpcVoiceRecording[_0x074d('0x40')](_0x6a68b);}}};Report[_0x074d('0x21')][_0x074d('0x49')]=function(_0x3d8996){if(_[_0x074d('0x4a')](_0x3d8996)){_0x3d8996[_0x074d('0x4b')](function(_0x241a6a){RpcVoiceAgentReport[_0x074d('0x40')](_0x241a6a);});}else{RpcVoiceAgentReport['create'](_0x3d8996);}};Report[_0x074d('0x21')][_0x074d('0x4c')]=function(_0xec9198){RpcVoiceDialReport[_0x074d('0x40')](_0xec9198);var _0x22ccf5;var _0x5d8662;var _0x1d66c8=_0xec9198[_0x074d('0x38')];if(_['startsWith'](_0x1d66c8,_0x074d('0x4d'))){_0x5d8662=_0x1d66c8['substring'](_0x1d66c8[_0x074d('0x4e')]('/')+0x1,_0x1d66c8[_0x074d('0x4e')]('@'));_0x22ccf5=_[_0x074d('0x1b')](this[_0x074d('0xb')],function(_0xf2e2ef){return _0xf2e2ef['mobile']==_0x5d8662||_0xf2e2ef[_0x074d('0x4f')]==_0x5d8662||_0xf2e2ef[_0x074d('0x23')]==_0x5d8662;});}else{_0x5d8662=_0x1d66c8[_0x074d('0x50')](_0x1d66c8[_0x074d('0x4e')]('/')+0x1,_0x1d66c8[_0x074d('0x51')]('-'));_0x22ccf5=this[_0x074d('0x1a')](_0x5d8662);}if(_0x22ccf5){_0xec9198[_0x074d('0x1e')]=_[_0x074d('0x1d')](_0x22ccf5[_0x074d('0x1e')])?util[_0x074d('0x1f')](_0x074d('0x20'),_0x22ccf5[_0x074d('0x1c')]):_0x22ccf5[_0x074d('0x1e')];_0xec9198['membername']=_0x22ccf5['name'];_0xec9198['accountcode']=_0x22ccf5[_0x074d('0x23')];RpcMemberReport[_0x074d('0x4c')](_0xec9198);}};Report[_0x074d('0x21')][_0x074d('0x18')]=function(_0xe4996){RpcVoiceTransferReport[_0x074d('0x3c')][_0xe4996[_0x074d('0x52')]]=_0xe4996;};Report[_0x074d('0x21')][_0x074d('0x53')]=function(_0xf0ce76){RpcVoiceTransferReport[_0x074d('0x53')](_0xf0ce76);};module[_0x074d('0x54')]=Report;
\ No newline at end of file
+var _0xff99=['disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','originatecalleridnum','isArray','forEach','Local','substring','indexOf','mobile','lastIndexOf','SIP/%s','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','find','accountcode','isNil','name','interface','format','voiceQueueReport','length','findAgent','connectedlinenum','assigned','queuecallercomplete','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','channel','callerid'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xff99,0xc4));var _0x9ff9=function(_0x40b8fe,_0x3dcda0){_0x40b8fe=_0x40b8fe-0x0;var _0x530429=_0xff99[_0x40b8fe];return _0x530429;};'use strict';var _=require(_0x9ff9('0x0'));var moment=require(_0x9ff9('0x1'));var util=require(_0x9ff9('0x2'));var config=require(_0x9ff9('0x3'));var ami=require(_0x9ff9('0x4'));var RpcVoiceAgentReport=require(_0x9ff9('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x9ff9('0x6'));var RpcMemberReport=require(_0x9ff9('0x7'));var RpcVoiceQueueReport=require(_0x9ff9('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x9ff9('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x9ff9('0xa'));var UserReport=require(_0x9ff9('0xb'));function Report(_0x1babdf){this[_0x9ff9('0xc')]=_0x1babdf;this[_0x9ff9('0xd')]=_0x1babdf[_0x9ff9('0xd')];this['telephones']=_0x1babdf[_0x9ff9('0xe')];}Report[_0x9ff9('0xf')][_0x9ff9('0x10')]=function(_0x567cb3){var _0x2b995e=new VoiceQueueReport(this[_0x9ff9('0xc')]);var _0x384f67=new VoiceAgentReport(this[_0x9ff9('0xc')]);var _0x2432c2=new VoiceDialReport(this[_0x9ff9('0xc')]);var _0x10122a=new VoiceCallReport(this[_0x9ff9('0xc')]);var _0x132fd9=new UserReport(this[_0x9ff9('0xc')]);if(config['xdr']&&config[_0x9ff9('0x11')][_0x9ff9('0x12')]){ami['on'](_0x9ff9('0x13'),this['voiceQueueReport'][_0x9ff9('0x14')](this));ami['on'](_0x9ff9('0x15'),this[_0x9ff9('0x16')][_0x9ff9('0x14')](this));ami['on'](_0x9ff9('0x17'),this['voiceAgentReport']['bind'](this));ami['on'](_0x9ff9('0x18'),this[_0x9ff9('0x19')][_0x9ff9('0x14')](this));ami['on'](_0x9ff9('0x1a'),this['blindTransfer'][_0x9ff9('0x14')](this));ami['on'](_0x9ff9('0x1b'),this[_0x9ff9('0x1c')][_0x9ff9('0x14')](this));}};Report[_0x9ff9('0xf')]['findAgent']=function(_0x2f6d94){var _0x502933;_0x502933=_[_0x9ff9('0x1d')](this['agents'],function(_0x648fd7){return _0x648fd7[_0x9ff9('0x1e')]==_0x2f6d94||_0x648fd7['name']==_0x2f6d94;});if(_[_0x9ff9('0x1f')](_0x502933)){var _0x56b1c5=_[_0x9ff9('0x1d')](this[_0x9ff9('0xe')],function(_0x2b5f8e){return _0x2b5f8e[_0x9ff9('0x1e')]==_0x2f6d94||_0x2b5f8e[_0x9ff9('0x20')]==_0x2f6d94;});if(_0x56b1c5){_0x502933=_[_0x9ff9('0x1d')](this[_0x9ff9('0xd')],function(_0x2da057){return _0x2da057[_0x9ff9('0x21')]==util[_0x9ff9('0x22')]('SIP/%s',_0x56b1c5['name']);});}}return _0x502933;};Report[_0x9ff9('0xf')][_0x9ff9('0x23')]=function(_0x289639){for(var _0x1d510c=0x0;_0x1d510c<_0x289639[_0x9ff9('0x24')];_0x1d510c+=0x1){var _0x22f792=this[_0x9ff9('0x25')](_0x289639[_0x1d510c][_0x9ff9('0x26')]);if(_0x22f792){_0x289639[_0x1d510c][_0x9ff9('0x1e')]=_0x22f792['accountcode'];_0x289639[_0x1d510c][_0x9ff9('0x27')]=!![];_0x289639[_0x1d510c]['lastAssignedTo']=_0x22f792[_0x9ff9('0x20')];_0x289639[_0x1d510c]['interface']=_['isNil'](_0x22f792['interface'])?util['format']('SIP/%s',_0x22f792['name']):_0x22f792[_0x9ff9('0x21')];if(_0x289639[_0x1d510c][_0x9ff9('0x28')]){_0x289639[_0x1d510c]['queuecallercompleteAt']=moment()[_0x9ff9('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x289639[_0x1d510c][_0x9ff9('0x29')]){_0x289639[_0x1d510c][_0x9ff9('0x2a')]=moment()[_0x9ff9('0x22')](_0x9ff9('0x2b'));}RpcMemberReport[_0x9ff9('0x23')](_0x289639[_0x1d510c]);}RpcVoiceQueueReport[_0x9ff9('0x2c')](_0x289639[_0x1d510c]);}};function extractCalleridNumber(_0x151854){var _0xc1cab7=_0x151854[_0x9ff9('0x2d')](/<(.*?)>/);return _0xc1cab7?_0xc1cab7[0x1]:_0x151854;}Report[_0x9ff9('0xf')]['voiceCallReport']=function(_0x54faeb){_0x54faeb[_0x9ff9('0x2e')]=_0x54faeb['destination']||_0x54faeb[_0x9ff9('0x2f')];if(_0x54faeb[_0x9ff9('0x30')]==_0x9ff9('0x31')){_0x54faeb[_0x9ff9('0x32')]=_0x9ff9('0x33');_0x54faeb[_0x9ff9('0x34')]=_0x54faeb[_0x9ff9('0x33')];if(_0x54faeb['context']==_0x9ff9('0x35')){_0x54faeb[_0x9ff9('0x1e')]='';_0x54faeb[_0x9ff9('0x2e')]=extractCalleridNumber(_0x54faeb['callerid']);}else if(_0x54faeb[_0x9ff9('0x36')]==_0x9ff9('0x37')){if(_0x54faeb[_0x9ff9('0x2e')]==_0x9ff9('0x38')){_0x54faeb[_0x9ff9('0x2e')]=extractCalleridNumber(_0x54faeb[_0x9ff9('0x39')]);_0x54faeb[_0x9ff9('0x3a')]=_0x54faeb['originatecalleridnum'];_0x54faeb[_0x9ff9('0x3b')]=[_0x54faeb['channel'],_0x54faeb[_0x9ff9('0x3c')]=_0x54faeb[_0x9ff9('0x3b')]][0x0];_0x54faeb[_0x9ff9('0x3d')]=_0x54faeb[_0x9ff9('0x39')];}else{_0x54faeb[_0x9ff9('0x2e')]=_0x54faeb[_0x9ff9('0x3a')];_0x54faeb[_0x9ff9('0x3a')]=_0x54faeb['originatecalleridnum'];if(_0x54faeb[_0x9ff9('0x3e')]==_0x9ff9('0x3f')){_0x54faeb[_0x9ff9('0x1e')]=_0x54faeb[_0x9ff9('0x26')];}else{_0x54faeb['accountcode']='';}}}}else{_0x54faeb['callerid']=util[_0x9ff9('0x22')]('\x22%s\x22\x20<%s>',_0x54faeb[_0x9ff9('0x40')],_0x54faeb[_0x9ff9('0x3a')]);}if(RpcVoiceTransferReport[_0x9ff9('0x41')][_0x54faeb[_0x9ff9('0x42')]]){var _0x37982b=RpcVoiceTransferReport[_0x9ff9('0x41')][_0x54faeb[_0x9ff9('0x42')]];_0x37982b[_0x9ff9('0x43')]=_0x54faeb[_0x9ff9('0x44')];RpcVoiceTransferReport[_0x9ff9('0x45')](_0x37982b);delete RpcVoiceTransferReport[_0x9ff9('0x41')][_0x54faeb[_0x9ff9('0x42')]];}RpcVoiceCallReport['create'](_0x54faeb);if(_0x54faeb['monitor']){for(var _0x59ce59=0x0;_0x59ce59<_0x54faeb[_0x9ff9('0x46')][_0x9ff9('0x24')];_0x59ce59+=0x1){_0x54faeb[_0x9ff9('0x47')]=_0x54faeb[_0x9ff9('0x46')][_0x59ce59][_0x9ff9('0x48')];_0x54faeb[_0x9ff9('0x49')]=_0x54faeb[_0x9ff9('0x46')][_0x59ce59][_0x9ff9('0x49')];if(_0x54faeb[_0x9ff9('0x2f')]==_0x9ff9('0x38')){_0x54faeb['calleridnum']=_0x54faeb['connectedlinenum'];_0x54faeb[_0x9ff9('0x40')]=_0x54faeb[_0x9ff9('0x4a')];_0x54faeb['connectedlinenum']=_0x54faeb[_0x9ff9('0x1e')];_0x54faeb[_0x9ff9('0x4a')]=_0x54faeb[_0x9ff9('0x4b')];_0x54faeb[_0x9ff9('0x2f')]=_0x54faeb[_0x9ff9('0x4c')];}else if(_0x54faeb[_0x9ff9('0x2f')]=='xcally-motion-dialer'){_0x54faeb[_0x9ff9('0x3a')]=_0x54faeb[_0x9ff9('0x2e')];_0x54faeb['exten']=_0x54faeb[_0x9ff9('0x4c')];}RpcVoiceRecording[_0x9ff9('0x2c')](_0x54faeb);}}};Report['prototype']['voiceAgentReport']=function(_0x3bdfea){if(_[_0x9ff9('0x4d')](_0x3bdfea)){_0x3bdfea[_0x9ff9('0x4e')](function(_0xe979be){RpcVoiceAgentReport[_0x9ff9('0x2c')](_0xe979be);});}else{RpcVoiceAgentReport[_0x9ff9('0x2c')](_0x3bdfea);}};Report[_0x9ff9('0xf')]['voiceDialReport']=function(_0x194ec1){RpcVoiceDialReport[_0x9ff9('0x2c')](_0x194ec1);var _0x2696aa;var _0x57463c;var _0x349c9a=_0x194ec1[_0x9ff9('0x3c')];if(_['startsWith'](_0x349c9a,_0x9ff9('0x4f'))){_0x57463c=_0x349c9a[_0x9ff9('0x50')](_0x349c9a[_0x9ff9('0x51')]('/')+0x1,_0x349c9a[_0x9ff9('0x51')]('@'));_0x2696aa=_[_0x9ff9('0x1d')](this[_0x9ff9('0xd')],function(_0x421de0){return _0x421de0[_0x9ff9('0x52')]==_0x57463c||_0x421de0['phone']==_0x57463c||_0x421de0[_0x9ff9('0x1e')]==_0x57463c;});}else{_0x57463c=_0x349c9a[_0x9ff9('0x50')](_0x349c9a[_0x9ff9('0x51')]('/')+0x1,_0x349c9a[_0x9ff9('0x53')]('-'));_0x2696aa=this[_0x9ff9('0x25')](_0x57463c);}if(_0x2696aa){_0x194ec1[_0x9ff9('0x21')]=_['isNil'](_0x2696aa[_0x9ff9('0x21')])?util['format'](_0x9ff9('0x54'),_0x2696aa['name']):_0x2696aa[_0x9ff9('0x21')];_0x194ec1['membername']=_0x2696aa['name'];_0x194ec1[_0x9ff9('0x1e')]=_0x2696aa[_0x9ff9('0x1e')];RpcMemberReport[_0x9ff9('0x19')](_0x194ec1);}};Report[_0x9ff9('0xf')][_0x9ff9('0x45')]=function(_0x5cbf17){RpcVoiceTransferReport[_0x9ff9('0x41')][_0x5cbf17['transfererlinkedid']]=_0x5cbf17;};Report[_0x9ff9('0xf')][_0x9ff9('0x1c')]=function(_0x520aae){RpcVoiceTransferReport[_0x9ff9('0x1c')](_0x520aae);};module[_0x9ff9('0x55')]=Report;
\ No newline at end of file
index 2e45024..224b9aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeba=['device','inuse','local','stateTime','format','toLowerCase','toNumber','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','startsWith','Local','indexOf','mobile','accountcode','updateStatusRealtime','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','exports','lodash','util','bluebird','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','then','[userReport][devicestatelist]','inspect','error','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','merge','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','emit','trunk:%s','name','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0xaeba,0x1ce));var _0xaaeb=function(_0x1d3ae6,_0x65a32a){_0x1d3ae6=_0x1d3ae6-0x0;var _0x8cbcb0=_0xaeba[_0x1d3ae6];return _0x8cbcb0;};'use strict';var _=require(_0xaaeb('0x0'));var moment=require('moment');var util=require(_0xaaeb('0x1'));var Redis=require('ioredis');var BPromise=require(_0xaaeb('0x2'));var config=require('../../../config/environment');var logger=require(_0xaaeb('0x3'))(_0xaaeb('0x4'));var ami=require(_0xaaeb('0x5'));config[_0xaaeb('0x6')]=_[_0xaaeb('0x7')](config[_0xaaeb('0x6')],{'host':_0xaaeb('0x8'),'port':0x18eb});var io=require(_0xaaeb('0x9'))(new Redis(config[_0xaaeb('0x6')]));function UserReport(_0x4f77ad){this[_0xaaeb('0xa')]=_0x4f77ad[_0xaaeb('0xa')];this[_0xaaeb('0xb')]=_0x4f77ad[_0xaaeb('0xb')];this['telephones']=_0x4f77ad[_0xaaeb('0xc')];ami['on'](_0xaaeb('0xd'),this[_0xaaeb('0xe')][_0xaaeb('0xf')](this));ami['on'](_0xaaeb('0x10'),this[_0xaaeb('0xe')][_0xaaeb('0xf')](this));ami['on'](_0xaaeb('0x11'),this[_0xaaeb('0x12')]['bind'](this));ami['on'](_0xaaeb('0x13'),this[_0xaaeb('0x14')]['bind'](this));return this[_0xaaeb('0x15')]();}function showSipRegistrations(){Promise[_0xaaeb('0x16')]()['then'](ami[_0xaaeb('0x17')]())[_0xaaeb('0x18')](function(_0x4a1398){logger['error']('[userReport][sipshowregistry]',util['inspect'](_0x4a1398,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xaaeb('0x19')](ami['actionDeviceStateList']())[_0xaaeb('0x18')](function(_0x2e78cb){logger['error'](_0xaaeb('0x1a'),util[_0xaaeb('0x1b')](_0x2e78cb,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xaaeb('0x16')]()[_0xaaeb('0x19')](ami['actionSipPeerStatus']())[_0xaaeb('0x18')](function(_0x4d5e59){logger[_0xaaeb('0x1c')](_0xaaeb('0x1d'),util[_0xaaeb('0x1b')](_0x4d5e59,{'showHidden':![],'depth':null}));});}UserReport['prototype']['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xaaeb('0x16')]()[_0xaaeb('0x19')](showSipRegistrations())['then'](listDeviceStates())[_0xaaeb('0x19')](showPeersStatus());},0x32c8);};UserReport[_0xaaeb('0x1e')][_0xaaeb('0x1f')]=function(_0x2c33d9){return _0x2c33d9!==null&&!_[_0xaaeb('0x20')](_0x2c33d9);};UserReport['prototype']['emit']=function(_0x5ea019,_0x476198,_0x5ad6f5){io['to'](_0x5ea019)['emit'](_0x476198,_0x5ad6f5);};UserReport['prototype'][_0xaaeb('0xe')]=function(_0x46ea65){try{if(this['isNotNull'](_0x46ea65)){logger[_0xaaeb('0x21')](_0xaaeb('0x22'),_0x46ea65[_0xaaeb('0x23')],_0x46ea65[_0xaaeb('0x24')]);logger[_0xaaeb('0x25')](_0xaaeb('0x26'),util[_0xaaeb('0x1b')](_0x46ea65,{'showHidden':![],'depth':null}));var _0x5a9902=_[_0xaaeb('0x27')](this[_0xaaeb('0xa')],{'defaultuser':_0x46ea65[_0xaaeb('0x23')]});if(_0x5a9902){_0x46ea65['stateRegistry']=_0x46ea65[_0xaaeb('0x24')];_[_0xaaeb('0x28')](_0x5a9902,_[_0xaaeb('0x29')](_0x46ea65,['event',_0xaaeb('0x2a'),_0xaaeb('0x23'),'state']));logger[_0xaaeb('0x25')](_0xaaeb('0x2b'),util['inspect'](_0x5a9902,{'showHidden':![],'depth':null}));this[_0xaaeb('0x2c')](util['format'](_0xaaeb('0x2d'),_0x5a9902[_0xaaeb('0x2e')]),'trunk:save',_0x5a9902);}}}catch(_0x7211fc){logger[_0xaaeb('0x1c')](_0xaaeb('0x26'),util['inspect'](_0x7211fc,{'showHidden':![],'depth':null}));}};UserReport[_0xaaeb('0x1e')][_0xaaeb('0x12')]=function(_0x246809){try{if(this[_0xaaeb('0x1f')](_0x246809)){logger['info'](_0xaaeb('0x2f'),_0x246809['device'],_0x246809[_0xaaeb('0x24')]);logger[_0xaaeb('0x25')](_0xaaeb('0x30'),util['inspect'](_0x246809,{'showHidden':![],'depth':null}));if(this['agents'][_0x246809[_0xaaeb('0x31')]]){if(!this[_0xaaeb('0xb')][_0x246809[_0xaaeb('0x31')]]['local']||_0x246809[_0xaaeb('0x24')]['toLowerCase']()==_0xaaeb('0x32')){this[_0xaaeb('0xb')][_0x246809[_0xaaeb('0x31')]][_0xaaeb('0x33')]=![];if(this['agents'][_0x246809[_0xaaeb('0x31')]][_0xaaeb('0x24')]!==_0x246809[_0xaaeb('0x24')]['toLowerCase']()){this[_0xaaeb('0xb')][_0x246809['device']][_0xaaeb('0x34')]=_['toNumber'](moment()[_0xaaeb('0x35')]('x'));}this[_0xaaeb('0xb')][_0x246809[_0xaaeb('0x31')]][_0xaaeb('0x24')]=_0x246809['state']['toLowerCase']();this[_0xaaeb('0xb')][_0x246809['device']]['updateStatusRealtime'](_0x246809);}}else if(this[_0xaaeb('0xc')][_0x246809[_0xaaeb('0x31')]]){if(this['telephones'][_0x246809[_0xaaeb('0x31')]][_0xaaeb('0x24')]!==_0x246809['state'][_0xaaeb('0x36')]()){this[_0xaaeb('0xc')][_0x246809[_0xaaeb('0x31')]][_0xaaeb('0x34')]=_[_0xaaeb('0x37')](moment()['format']('x'));}this['telephones'][_0x246809[_0xaaeb('0x31')]]['state']=_0x246809[_0xaaeb('0x24')][_0xaaeb('0x36')]();logger[_0xaaeb('0x25')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0xaaeb('0xc')][_0x246809[_0xaaeb('0x31')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xaaeb('0x35')]('telephone:%s',this[_0xaaeb('0xc')][_0x246809[_0xaaeb('0x31')]]['name']),_0xaaeb('0x38'),this['telephones'][_0x246809['device']]);}else if(this[_0xaaeb('0xa')][_0x246809['device']]){if(this['trunks'][_0x246809[_0xaaeb('0x31')]][_0xaaeb('0x24')]!==_0x246809[_0xaaeb('0x24')][_0xaaeb('0x36')]()){this[_0xaaeb('0xa')][_0x246809[_0xaaeb('0x31')]][_0xaaeb('0x34')]=_[_0xaaeb('0x37')](moment()[_0xaaeb('0x35')]('x'));}this[_0xaaeb('0xa')][_0x246809[_0xaaeb('0x31')]][_0xaaeb('0x24')]=_0x246809[_0xaaeb('0x24')][_0xaaeb('0x36')]();logger['debug'](_0xaaeb('0x39'),util[_0xaaeb('0x1b')](this[_0xaaeb('0xa')][_0x246809[_0xaaeb('0x31')]],{'showHidden':![],'depth':null}));this[_0xaaeb('0x2c')](util[_0xaaeb('0x35')](_0xaaeb('0x2d'),this['trunks'][_0x246809[_0xaaeb('0x31')]][_0xaaeb('0x2e')]),_0xaaeb('0x3a'),this[_0xaaeb('0xa')][_0x246809[_0xaaeb('0x31')]]);}else if(_[_0xaaeb('0x3b')](_0x246809[_0xaaeb('0x31')],_0xaaeb('0x3c'))){var _0x7a6a77=_0x246809['device'];var _0x355dad=_0x7a6a77['substring'](_0x7a6a77[_0xaaeb('0x3d')]('/')+0x1,_0x7a6a77[_0xaaeb('0x3d')]('@'));var _0x227354=_[_0xaaeb('0x27')](this[_0xaaeb('0xb')],function(_0x513192){return _0x513192[_0xaaeb('0x3e')]==_0x355dad||_0x513192['phone']==_0x355dad||_0x513192[_0xaaeb('0x3f')]==_0x355dad;});if(_0x227354){if(_0x227354[_0xaaeb('0x24')]!==_0x246809[_0xaaeb('0x24')]['toLowerCase']()){_0x227354[_0xaaeb('0x34')]=_[_0xaaeb('0x37')](moment()[_0xaaeb('0x35')]('x'));}_0x227354[_0xaaeb('0x24')]=_0x246809[_0xaaeb('0x24')]['toLowerCase']();_0x227354['local']=!![];_0x227354[_0xaaeb('0x40')](_0x246809);}}}}catch(_0x5afeb5){logger['error']('[userReport][devicestatechange]',util[_0xaaeb('0x1b')](_0x5afeb5,{'showHidden':![],'depth':null}));}};UserReport[_0xaaeb('0x1e')][_0xaaeb('0x14')]=function(_0x6a26af){try{if(this[_0xaaeb('0x1f')](_0x6a26af)&&this[_0xaaeb('0x1f')](_0x6a26af[_0xaaeb('0x13')])){logger[_0xaaeb('0x21')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x6a26af[_0xaaeb('0x41')],_0x6a26af[_0xaaeb('0x42')],_0x6a26af[_0xaaeb('0x13')]);logger[_0xaaeb('0x25')](_0xaaeb('0x43'),util[_0xaaeb('0x1b')](_0x6a26af,{'showHidden':![],'depth':null}));if(this[_0xaaeb('0xb')][_0x6a26af['peer']]){if(!this[_0xaaeb('0xb')][_0x6a26af[_0xaaeb('0x41')]]['local']||_0x6a26af[_0xaaeb('0x13')]['toLowerCase']()==_0xaaeb('0x44')){this[_0xaaeb('0xb')][_0x6a26af['peer']][_0xaaeb('0x33')]=![];this[_0xaaeb('0xb')][_0x6a26af['peer']][_0xaaeb('0x45')]=_0x6a26af[_0xaaeb('0x13')][_0xaaeb('0x36')]();this['agents'][_0x6a26af[_0xaaeb('0x41')]][_0xaaeb('0x42')]=_0x6a26af[_0xaaeb('0x42')];this[_0xaaeb('0xb')][_0x6a26af[_0xaaeb('0x41')]][_0xaaeb('0x40')](_0x6a26af);}}else if(this['telephones'][_0x6a26af[_0xaaeb('0x41')]]){this[_0xaaeb('0xc')][_0x6a26af[_0xaaeb('0x41')]]['status']=_0x6a26af[_0xaaeb('0x13')]['toLowerCase']();this[_0xaaeb('0xc')][_0x6a26af[_0xaaeb('0x41')]][_0xaaeb('0x42')]=_0x6a26af[_0xaaeb('0x42')];logger[_0xaaeb('0x25')](_0xaaeb('0x46'),util['inspect'](this[_0xaaeb('0xc')][_0x6a26af[_0xaaeb('0x41')]],{'showHidden':![],'depth':null}));this[_0xaaeb('0x2c')](util['format'](_0xaaeb('0x47'),this[_0xaaeb('0xc')][_0x6a26af[_0xaaeb('0x41')]][_0xaaeb('0x2e')]),_0xaaeb('0x38'),this[_0xaaeb('0xc')][_0x6a26af[_0xaaeb('0x41')]]);}else if(this[_0xaaeb('0xa')][_0x6a26af[_0xaaeb('0x41')]]){this['trunks'][_0x6a26af[_0xaaeb('0x41')]][_0xaaeb('0x45')]=_0x6a26af[_0xaaeb('0x13')][_0xaaeb('0x36')]();this['trunks'][_0x6a26af['peer']][_0xaaeb('0x42')]=_0x6a26af['address'];logger['debug']('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util['inspect'](this[_0xaaeb('0xa')][_0x6a26af[_0xaaeb('0x41')]],{'showHidden':![],'depth':null}));this[_0xaaeb('0x2c')](util[_0xaaeb('0x35')](_0xaaeb('0x2d'),this[_0xaaeb('0xa')][_0x6a26af[_0xaaeb('0x41')]][_0xaaeb('0x2e')]),_0xaaeb('0x3a'),this['trunks'][_0x6a26af[_0xaaeb('0x41')]]);}}}catch(_0xdf851e){logger[_0xaaeb('0x1c')](_0xaaeb('0x43'),util['inspect'](_0xdf851e,{'showHidden':![],'depth':null}));}};module[_0xaaeb('0x48')]=UserReport;
\ No newline at end of file
+var _0x898b=['name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','accountcode','local','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','find','stateRegistry','merge','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s'];(function(_0x53d01b,_0x1d5d9c){var _0x5973bd=function(_0x210bc1){while(--_0x210bc1){_0x53d01b['push'](_0x53d01b['shift']());}};_0x5973bd(++_0x1d5d9c);}(_0x898b,0x160));var _0xb898=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x898b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb898('0x0'));var moment=require(_0xb898('0x1'));var util=require('util');var Redis=require(_0xb898('0x2'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0xb898('0x3'))(_0xb898('0x4'));var ami=require(_0xb898('0x5'));config[_0xb898('0x6')]=_[_0xb898('0x7')](config[_0xb898('0x6')],{'host':_0xb898('0x8'),'port':0x18eb});var io=require(_0xb898('0x9'))(new Redis(config[_0xb898('0x6')]));function UserReport(_0x1ed742){this[_0xb898('0xa')]=_0x1ed742[_0xb898('0xa')];this[_0xb898('0xb')]=_0x1ed742['agents'];this[_0xb898('0xc')]=_0x1ed742[_0xb898('0xc')];ami['on'](_0xb898('0xd'),this[_0xb898('0xe')][_0xb898('0xf')](this));ami['on'](_0xb898('0x10'),this[_0xb898('0xe')]['bind'](this));ami['on'](_0xb898('0x11'),this[_0xb898('0x12')][_0xb898('0xf')](this));ami['on'](_0xb898('0x13'),this[_0xb898('0x14')]['bind'](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0xb898('0x15')]()['then'](ami[_0xb898('0x16')]())[_0xb898('0x17')](function(_0x588e34){logger[_0xb898('0x18')](_0xb898('0x19'),util[_0xb898('0x1a')](_0x588e34,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xb898('0x15')]()[_0xb898('0x1b')](ami['actionDeviceStateList']())[_0xb898('0x17')](function(_0x2dba53){logger[_0xb898('0x18')]('[userReport][devicestatelist]',util[_0xb898('0x1a')](_0x2dba53,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xb898('0x15')]()[_0xb898('0x1b')](ami[_0xb898('0x1c')]())[_0xb898('0x17')](function(_0x379bba){logger['error'](_0xb898('0x1d'),util[_0xb898('0x1a')](_0x379bba,{'showHidden':![],'depth':null}));});}UserReport[_0xb898('0x1e')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xb898('0x15')]()['then'](showSipRegistrations())[_0xb898('0x1b')](listDeviceStates())[_0xb898('0x1b')](showPeersStatus());},0x32c8);};UserReport[_0xb898('0x1e')][_0xb898('0x1f')]=function(_0x457d2d){return _0x457d2d!==null&&!_[_0xb898('0x20')](_0x457d2d);};UserReport[_0xb898('0x1e')][_0xb898('0x21')]=function(_0x394e5b,_0x5bbeed,_0x3cdd11){io['to'](_0x394e5b)['emit'](_0x5bbeed,_0x3cdd11);};UserReport[_0xb898('0x1e')][_0xb898('0xe')]=function(_0x96717e){try{if(this['isNotNull'](_0x96717e)){logger[_0xb898('0x22')](_0xb898('0x23'),_0x96717e[_0xb898('0x24')],_0x96717e[_0xb898('0x25')]);logger['debug']('[userReport][registry]',util[_0xb898('0x1a')](_0x96717e,{'showHidden':![],'depth':null}));var _0x187645=_[_0xb898('0x26')](this[_0xb898('0xa')],{'defaultuser':_0x96717e['username']});if(_0x187645){_0x96717e[_0xb898('0x27')]=_0x96717e[_0xb898('0x25')];_[_0xb898('0x28')](_0x187645,_[_0xb898('0x29')](_0x96717e,[_0xb898('0x2a'),_0xb898('0x2b'),_0xb898('0x24'),_0xb898('0x25')]));logger[_0xb898('0x2c')](_0xb898('0x2d'),util[_0xb898('0x1a')](_0x187645,{'showHidden':![],'depth':null}));this[_0xb898('0x21')](util[_0xb898('0x2e')](_0xb898('0x2f'),_0x187645[_0xb898('0x30')]),_0xb898('0x31'),_0x187645);}}}catch(_0x4da70c){logger[_0xb898('0x18')](_0xb898('0x32'),util[_0xb898('0x1a')](_0x4da70c,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xb898('0x12')]=function(_0x3a90b1){try{if(this['isNotNull'](_0x3a90b1)){logger[_0xb898('0x22')](_0xb898('0x33'),_0x3a90b1['device'],_0x3a90b1[_0xb898('0x25')]);logger['debug'](_0xb898('0x34'),util[_0xb898('0x1a')](_0x3a90b1,{'showHidden':![],'depth':null}));if(this['agents'][_0x3a90b1[_0xb898('0x35')]]){if(!this[_0xb898('0xb')][_0x3a90b1[_0xb898('0x35')]]['local']||_0x3a90b1[_0xb898('0x25')][_0xb898('0x36')]()==_0xb898('0x37')){this['agents'][_0x3a90b1['device']]['local']=![];if(this['agents'][_0x3a90b1[_0xb898('0x35')]][_0xb898('0x25')]!==_0x3a90b1[_0xb898('0x25')][_0xb898('0x36')]()){this['agents'][_0x3a90b1[_0xb898('0x35')]][_0xb898('0x38')]=_[_0xb898('0x39')](moment()[_0xb898('0x2e')]('x'));}this['agents'][_0x3a90b1['device']][_0xb898('0x25')]=_0x3a90b1['state'][_0xb898('0x36')]();this[_0xb898('0xb')][_0x3a90b1[_0xb898('0x35')]]['updateStatusRealtime'](_0x3a90b1);}}else if(this[_0xb898('0xc')][_0x3a90b1[_0xb898('0x35')]]){if(this[_0xb898('0xc')][_0x3a90b1[_0xb898('0x35')]][_0xb898('0x25')]!==_0x3a90b1['state'][_0xb898('0x36')]()){this[_0xb898('0xc')][_0x3a90b1[_0xb898('0x35')]]['stateTime']=_['toNumber'](moment()[_0xb898('0x2e')]('x'));}this['telephones'][_0x3a90b1['device']][_0xb898('0x25')]=_0x3a90b1[_0xb898('0x25')]['toLowerCase']();logger[_0xb898('0x2c')](_0xb898('0x3a'),util[_0xb898('0x1a')](this['telephones'][_0x3a90b1[_0xb898('0x35')]],{'showHidden':![],'depth':null}));this[_0xb898('0x21')](util['format'](_0xb898('0x3b'),this[_0xb898('0xc')][_0x3a90b1[_0xb898('0x35')]][_0xb898('0x30')]),_0xb898('0x3c'),this[_0xb898('0xc')][_0x3a90b1[_0xb898('0x35')]]);}else if(this['trunks'][_0x3a90b1[_0xb898('0x35')]]){if(this[_0xb898('0xa')][_0x3a90b1[_0xb898('0x35')]]['state']!==_0x3a90b1['state'][_0xb898('0x36')]()){this[_0xb898('0xa')][_0x3a90b1[_0xb898('0x35')]][_0xb898('0x38')]=_[_0xb898('0x39')](moment()[_0xb898('0x2e')]('x'));}this[_0xb898('0xa')][_0x3a90b1[_0xb898('0x35')]][_0xb898('0x25')]=_0x3a90b1['state'][_0xb898('0x36')]();logger[_0xb898('0x2c')](_0xb898('0x3d'),util[_0xb898('0x1a')](this[_0xb898('0xa')][_0x3a90b1['device']],{'showHidden':![],'depth':null}));this[_0xb898('0x21')](util[_0xb898('0x2e')](_0xb898('0x2f'),this[_0xb898('0xa')][_0x3a90b1[_0xb898('0x35')]]['name']),_0xb898('0x31'),this[_0xb898('0xa')][_0x3a90b1[_0xb898('0x35')]]);}else if(_[_0xb898('0x3e')](_0x3a90b1[_0xb898('0x35')],_0xb898('0x3f'))){var _0x5c2a83=_0x3a90b1[_0xb898('0x35')];var _0x5106fc=_0x5c2a83[_0xb898('0x40')](_0x5c2a83['indexOf']('/')+0x1,_0x5c2a83[_0xb898('0x41')]('@'));var _0x27c22d=_['find'](this[_0xb898('0xb')],function(_0x2b3c2b){return _0x2b3c2b[_0xb898('0x42')]==_0x5106fc||_0x2b3c2b[_0xb898('0x43')]==_0x5106fc||_0x2b3c2b[_0xb898('0x44')]==_0x5106fc;});if(_0x27c22d){if(_0x27c22d['state']!==_0x3a90b1['state'][_0xb898('0x36')]()){_0x27c22d['stateTime']=_[_0xb898('0x39')](moment()[_0xb898('0x2e')]('x'));}_0x27c22d['state']=_0x3a90b1[_0xb898('0x25')][_0xb898('0x36')]();_0x27c22d[_0xb898('0x45')]=!![];_0x27c22d[_0xb898('0x46')](_0x3a90b1);}}}}catch(_0x33f8a1){logger[_0xb898('0x18')](_0xb898('0x34'),util[_0xb898('0x1a')](_0x33f8a1,{'showHidden':![],'depth':null}));}};UserReport[_0xb898('0x1e')][_0xb898('0x14')]=function(_0x25262a){try{if(this['isNotNull'](_0x25262a)&&this[_0xb898('0x1f')](_0x25262a['peerstatus'])){logger[_0xb898('0x22')](_0xb898('0x47'),_0x25262a[_0xb898('0x48')],_0x25262a[_0xb898('0x49')],_0x25262a[_0xb898('0x13')]);logger[_0xb898('0x2c')]('[userReport][peerstatus]',util['inspect'](_0x25262a,{'showHidden':![],'depth':null}));if(this[_0xb898('0xb')][_0x25262a[_0xb898('0x48')]]){if(!this[_0xb898('0xb')][_0x25262a[_0xb898('0x48')]]['local']||_0x25262a[_0xb898('0x13')][_0xb898('0x36')]()==_0xb898('0x4a')){this[_0xb898('0xb')][_0x25262a[_0xb898('0x48')]][_0xb898('0x45')]=![];this[_0xb898('0xb')][_0x25262a['peer']][_0xb898('0x4b')]=_0x25262a[_0xb898('0x13')][_0xb898('0x36')]();this['agents'][_0x25262a['peer']][_0xb898('0x49')]=_0x25262a[_0xb898('0x49')];this[_0xb898('0xb')][_0x25262a[_0xb898('0x48')]]['updateStatusRealtime'](_0x25262a);}}else if(this[_0xb898('0xc')][_0x25262a[_0xb898('0x48')]]){this[_0xb898('0xc')][_0x25262a[_0xb898('0x48')]][_0xb898('0x4b')]=_0x25262a[_0xb898('0x13')][_0xb898('0x36')]();this[_0xb898('0xc')][_0x25262a[_0xb898('0x48')]][_0xb898('0x49')]=_0x25262a[_0xb898('0x49')];logger[_0xb898('0x2c')](_0xb898('0x4c'),util[_0xb898('0x1a')](this['telephones'][_0x25262a[_0xb898('0x48')]],{'showHidden':![],'depth':null}));this[_0xb898('0x21')](util['format'](_0xb898('0x3b'),this['telephones'][_0x25262a[_0xb898('0x48')]][_0xb898('0x30')]),_0xb898('0x3c'),this[_0xb898('0xc')][_0x25262a[_0xb898('0x48')]]);}else if(this[_0xb898('0xa')][_0x25262a[_0xb898('0x48')]]){this[_0xb898('0xa')][_0x25262a[_0xb898('0x48')]][_0xb898('0x4b')]=_0x25262a['peerstatus'][_0xb898('0x36')]();this[_0xb898('0xa')][_0x25262a['peer']][_0xb898('0x49')]=_0x25262a['address'];logger['debug'](_0xb898('0x4d'),util[_0xb898('0x1a')](this['trunks'][_0x25262a[_0xb898('0x48')]],{'showHidden':![],'depth':null}));this[_0xb898('0x21')](util['format']('trunk:%s',this[_0xb898('0xa')][_0x25262a[_0xb898('0x48')]][_0xb898('0x30')]),_0xb898('0x31'),this[_0xb898('0xa')][_0x25262a[_0xb898('0x48')]]);}}}catch(_0x29f3c0){logger[_0xb898('0x18')](_0xb898('0x4e'),util[_0xb898('0x1a')](_0x29f3c0,{'showHidden':![],'depth':null}));}};module[_0xb898('0x4f')]=UserReport;
\ No newline at end of file
index 7c0d8bb..839aecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2675=['isUndefined','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','format','called','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','privilege','debug','inspect','custom:agentcalled','user:%s','user:called','error','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','agentconnectAt','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','voiceChannels','routealias','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswer','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','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','YYYY-MM-DD\x20HH:mm:ss','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','talktime','acw','acwtime','acwTimeout','agentacw','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','membercalls','memberlastcall','memberpenalty','isNil','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','[%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','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','bind','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull'];(function(_0x46c318,_0x3a5b3f){var _0x143050=function(_0x38a645){while(--_0x38a645){_0x46c318['push'](_0x46c318['shift']());}};_0x143050(++_0x3a5b3f);}(_0x2675,0x75));var _0x5267=function(_0x1525dc,_0x219150){_0x1525dc=_0x1525dc-0x0;var _0x12e524=_0x2675[_0x1525dc];return _0x12e524;};'use strict';var _=require(_0x5267('0x0'));var moment=require('moment');var util=require('util');var Redis=require('ioredis');var config=require(_0x5267('0x1'));var logger=require(_0x5267('0x2'))('ami');var ami=require(_0x5267('0x3'));config[_0x5267('0x4')]=_['defaults'](config[_0x5267('0x4')],{'host':_0x5267('0x5'),'port':0x18eb});var io=require(_0x5267('0x6'))(new Redis(config[_0x5267('0x4')]));function VoiceAgentReport(_0x20f065){this[_0x5267('0x7')]={};this['voiceChannels']=_0x20f065[_0x5267('0x7')];this[_0x5267('0x8')]=_0x20f065['voiceQueues'];this[_0x5267('0x9')]=_0x20f065['agents'];this[_0x5267('0xa')]={};ami['on'](_0x5267('0xb'),this[_0x5267('0xc')]['bind'](this));ami['on'](_0x5267('0xd'),this['syncAgentConnect'][_0x5267('0xe')](this));ami['on']('agentringnoanswer',this[_0x5267('0xf')][_0x5267('0xe')](this));ami['on'](_0x5267('0x10'),this[_0x5267('0x11')][_0x5267('0xe')](this));ami['on'](_0x5267('0x12'),this[_0x5267('0x13')][_0x5267('0xe')](this));ami['on'](_0x5267('0x14'),this[_0x5267('0x15')][_0x5267('0xe')](this));ami['on'](_0x5267('0x16'),this[_0x5267('0x17')]['bind'](this));ami['on']('musiconholdstart',this[_0x5267('0x18')][_0x5267('0xe')](this));ami['on'](_0x5267('0x19'),this[_0x5267('0x1a')][_0x5267('0xe')](this));ami['on'](_0x5267('0x1b'),this[_0x5267('0x1c')][_0x5267('0xe')](this));ami['on'](_0x5267('0x1d'),this[_0x5267('0x1e')][_0x5267('0xe')](this));}VoiceAgentReport[_0x5267('0x1f')]['emit']=function(_0x18f32e,_0x2afd38,_0x5069e8){io['to'](_0x18f32e)[_0x5267('0x20')](_0x2afd38,_0x5069e8);};VoiceAgentReport['prototype'][_0x5267('0x21')]=function(_0x1019e7){return _0x1019e7!==null&&!_[_0x5267('0x22')](_0x1019e7);};VoiceAgentReport[_0x5267('0x1f')][_0x5267('0xc')]=function(_0x4dd637){try{if(this[_0x5267('0x21')](_0x4dd637)){logger['info'](_0x5267('0x23'),_0x4dd637[_0x5267('0x24')],_0x4dd637[_0x5267('0x25')],_0x4dd637['destuniqueid']);logger['debug']('[%s][voiceAgentReport][agentcalled]\x20event:',_0x4dd637['uniqueid'],util['inspect'](_0x4dd637,{'showHidden':![],'depth':null}));if(_[_0x5267('0x22')](this[_0x5267('0x7')][_0x4dd637[_0x5267('0x24')]])){this[_0x5267('0x7')][_0x4dd637[_0x5267('0x24')]]={};}if(_[_0x5267('0x22')](this[_0x5267('0x7')][_0x4dd637[_0x5267('0x24')]][_0x4dd637[_0x5267('0x26')]])){this['channels'][_0x4dd637['uniqueid']][_0x4dd637[_0x5267('0x26')]]={'agentcalledAt':moment()[_0x5267('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x5267('0x28'),'mandatoryDisposition':this['voiceQueues'][_0x4dd637['queue']]?this[_0x5267('0x8')][_0x4dd637[_0x5267('0x29')]][_0x5267('0x2a')]||![]:![],'type':this[_0x5267('0x8')][_0x4dd637[_0x5267('0x29')]]?this['voiceQueues'][_0x4dd637['queue']][_0x5267('0x2b')]||_0x5267('0x2c'):_0x5267('0x2c'),'variables':this['variables'][_0x4dd637['uniqueid']],'motionChannel':_0x5267('0x2d')};}_[_0x5267('0x2e')](this[_0x5267('0x7')][_0x4dd637['uniqueid']][_0x4dd637['destuniqueid']],_[_0x5267('0x2f')](_0x4dd637,[_0x5267('0x30'),_0x5267('0x31')]));logger[_0x5267('0x32')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x4dd637[_0x5267('0x24')],util[_0x5267('0x33')](this[_0x5267('0x7')][_0x4dd637[_0x5267('0x24')]][_0x4dd637[_0x5267('0x26')]],{'showHidden':![],'depth':null}));ami[_0x5267('0x20')](_0x5267('0x34'),this[_0x5267('0x7')][_0x4dd637['uniqueid']][_0x4dd637['destuniqueid']]);logger[_0x5267('0x32')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x4dd637[_0x5267('0x24')],util[_0x5267('0x33')](this[_0x5267('0x7')][_0x4dd637[_0x5267('0x24')]][_0x4dd637['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x5267('0x20')](util[_0x5267('0x27')](_0x5267('0x35'),_0x4dd637[_0x5267('0x25')]),_0x5267('0x36'),this[_0x5267('0x7')][_0x4dd637[_0x5267('0x24')]][_0x4dd637[_0x5267('0x26')]]);}}catch(_0x484b77){logger[_0x5267('0x37')]('[%s][voiceAgentReport][agentcalled]',_0x4dd637[_0x5267('0x24')],util[_0x5267('0x33')](_0x484b77,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5267('0x1f')][_0x5267('0x38')]=function(_0x41e58b){try{if(this[_0x5267('0x21')](_0x41e58b)){if(this[_0x5267('0x7')][_0x41e58b['uniqueid']]){logger[_0x5267('0x32')](_0x5267('0x39'),_0x41e58b[_0x5267('0x24')],util[_0x5267('0x33')](_0x41e58b,{'showHidden':![],'depth':null}));for(var _0x82cea7 in this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]]){if(this['channels'][_0x41e58b[_0x5267('0x24')]]['hasOwnProperty'](_0x82cea7)){if(_0x41e58b[_0x5267('0x26')]===_0x82cea7){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x41e58b['uniqueid'],_0x41e58b[_0x5267('0x25')],_0x41e58b['destuniqueid']);this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x3a')]=moment()[_0x5267('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7]['connectedlinename']=_0x41e58b['connectedlinename'];this[_0x5267('0x7')][_0x41e58b['uniqueid']][_0x82cea7][_0x5267('0x3b')]=_0x41e58b[_0x5267('0x3b')];this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x3c')]=_0x41e58b[_0x5267('0x3c')];this[_0x5267('0x7')][_0x41e58b['uniqueid']][_0x82cea7]['destchannelstatedesc']=_0x41e58b[_0x5267('0x3d')];this['channels'][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x3e')]=_0x41e58b['holdtime'];this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x3f')]=_0x5267('0x40');if(this[_0x5267('0x41')][this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x24')]]){var _0x1a9106=this['voiceChannels'][this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x24')]][_0x5267('0x42')];this[_0x5267('0x7')][_0x41e58b['uniqueid']][_0x82cea7][_0x5267('0x42')]=_0x1a9106;_0x41e58b['routealias']=_0x1a9106;}_[_0x5267('0x2e')](this['agents'][_0x41e58b['interface']],_[_0x5267('0x43')](_0x41e58b,['queue',_0x5267('0x44'),_0x5267('0x42')]));logger[_0x5267('0x32')](_0x5267('0x45'),_0x41e58b['uniqueid'],util[_0x5267('0x33')](this['channels'][_0x41e58b['uniqueid']][_0x41e58b[_0x5267('0x26')]],{'showHidden':![],'depth':null}));ami[_0x5267('0x20')]('custom:agentconnect',this['channels'][_0x41e58b[_0x5267('0x24')]][_0x41e58b[_0x5267('0x26')]]);logger[_0x5267('0x32')](_0x5267('0x46'),_0x41e58b[_0x5267('0x24')],util[_0x5267('0x33')](this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x41e58b[_0x5267('0x26')]],{'showHidden':![],'depth':null}));this[_0x5267('0x20')](util[_0x5267('0x27')](_0x5267('0x35'),_0x41e58b[_0x5267('0x25')]),_0x5267('0x47'),this['channels'][_0x41e58b[_0x5267('0x24')]][_0x41e58b[_0x5267('0x26')]]);}else if(!this[_0x5267('0x7')][_0x41e58b['uniqueid']][_0x82cea7][_0x5267('0x48')]&&!this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x12')]){logger[_0x5267('0x49')](_0x5267('0x4a'),_0x41e58b['uniqueid'],this[_0x5267('0x7')][_0x41e58b['uniqueid']][_0x82cea7][_0x5267('0x25')],_0x82cea7);this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x48')]=!![];this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x4b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7]['answeredelsewheredestinationuniqueid']=_0x41e58b[_0x5267('0x26')];this['channels'][_0x41e58b['uniqueid']][_0x82cea7][_0x5267('0x4c')]=_0x41e58b[_0x5267('0x25')];this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x3f')]=_0x5267('0x4d');this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7][_0x5267('0x4e')]=_0x5267('0x4d');logger['debug'](_0x5267('0x4f'),_0x41e58b[_0x5267('0x24')],util[_0x5267('0x33')](this[_0x5267('0x7')][_0x41e58b[_0x5267('0x24')]][_0x82cea7],{'showHidden':![],'depth':null}));ami[_0x5267('0x20')]('custom:agentansweredelsewhere',this[_0x5267('0x7')][_0x41e58b['uniqueid']][_0x82cea7]);}}}}}}catch(_0x1522d6){logger[_0x5267('0x37')](_0x5267('0x50'),_0x41e58b['uniqueid'],util[_0x5267('0x33')](_0x1522d6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5267('0x1f')][_0x5267('0xf')]=function(_0x213bdc){try{if(this[_0x5267('0x21')](_0x213bdc)){logger[_0x5267('0x32')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x213bdc[_0x5267('0x24')],util[_0x5267('0x33')](_0x213bdc,{'showHidden':![],'depth':null}));if(this[_0x5267('0x7')][_0x213bdc[_0x5267('0x24')]]&&this['channels'][_0x213bdc['uniqueid']][_0x213bdc[_0x5267('0x26')]]){logger['info'](_0x5267('0x51'),_0x213bdc[_0x5267('0x24')],_0x213bdc['membername'],_0x213bdc['destuniqueid']);this[_0x5267('0x7')][_0x213bdc[_0x5267('0x24')]][_0x213bdc[_0x5267('0x26')]]['agentringnoanswer']=!![];this[_0x5267('0x7')][_0x213bdc[_0x5267('0x24')]][_0x213bdc[_0x5267('0x26')]][_0x5267('0x4b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x213bdc[_0x5267('0x24')]][_0x213bdc[_0x5267('0x26')]][_0x5267('0x3f')]=_0x5267('0x52');this[_0x5267('0x7')][_0x213bdc[_0x5267('0x24')]][_0x213bdc[_0x5267('0x26')]][_0x5267('0x4e')]='rejected';logger[_0x5267('0x32')](_0x5267('0x53'),_0x213bdc['uniqueid'],util[_0x5267('0x33')](this[_0x5267('0x7')][_0x213bdc[_0x5267('0x24')]][_0x213bdc[_0x5267('0x26')]],{'showHidden':![],'depth':null}));ami[_0x5267('0x20')](_0x5267('0x54'),this['channels'][_0x213bdc[_0x5267('0x24')]][_0x213bdc[_0x5267('0x26')]]);}}}catch(_0x30d638){logger[_0x5267('0x37')](_0x5267('0x55'),_0x213bdc[_0x5267('0x24')],util['inspect'](_0x30d638,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5267('0x1f')][_0x5267('0x11')]=function(_0x30e8d5){try{if(this[_0x5267('0x21')](_0x30e8d5)){logger[_0x5267('0x32')](_0x5267('0x56'),_0x30e8d5['uniqueid'],util[_0x5267('0x33')](_0x30e8d5,{'showHidden':![],'depth':null}));if(this[_0x5267('0x7')][_0x30e8d5[_0x5267('0x24')]]){for(var _0x3bedcf in this['channels'][_0x30e8d5['uniqueid']]){if(this['channels'][_0x30e8d5[_0x5267('0x24')]]['hasOwnProperty'](_0x3bedcf)&&!this[_0x5267('0x7')][_0x30e8d5['uniqueid']][_0x3bedcf][_0x5267('0x48')]&&!this[_0x5267('0x7')][_0x30e8d5[_0x5267('0x24')]][_0x3bedcf][_0x5267('0x12')]){logger[_0x5267('0x49')](_0x5267('0x57'),_0x30e8d5[_0x5267('0x24')],this[_0x5267('0x7')][_0x30e8d5['uniqueid']][_0x3bedcf]['membername'],_0x3bedcf);this['channels'][_0x30e8d5[_0x5267('0x24')]][_0x3bedcf][_0x5267('0x48')]=!![];this[_0x5267('0x7')][_0x30e8d5[_0x5267('0x24')]][_0x3bedcf]['agentringnoanswerAt']=moment()[_0x5267('0x27')](_0x5267('0x58'));this[_0x5267('0x7')][_0x30e8d5[_0x5267('0x24')]][_0x3bedcf]['lastevent']=_0x5267('0x59');this[_0x5267('0x7')][_0x30e8d5['uniqueid']][_0x3bedcf][_0x5267('0x4e')]=_0x5267('0x59');logger['debug']('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x30e8d5[_0x5267('0x24')],util[_0x5267('0x33')](this['channels'][_0x30e8d5['uniqueid']][_0x3bedcf],{'showHidden':![],'depth':null}));ami[_0x5267('0x20')](_0x5267('0x5a'),this[_0x5267('0x7')][_0x30e8d5[_0x5267('0x24')]][_0x3bedcf]);}}}}}catch(_0x30563f){logger['error'](_0x5267('0x5b'),_0x30e8d5[_0x5267('0x24')],util['inspect'](_0x30563f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5267('0x1f')][_0x5267('0x13')]=function(_0x3de6de){try{if(this[_0x5267('0x21')](_0x3de6de)){logger[_0x5267('0x32')](_0x5267('0x5c'),_0x3de6de[_0x5267('0x24')],util[_0x5267('0x33')](_0x3de6de,{'showHidden':![],'depth':null}));if(this['channels'][_0x3de6de['uniqueid']]){for(var _0x1ac20f in this[_0x5267('0x7')][_0x3de6de[_0x5267('0x24')]]){if(this[_0x5267('0x7')][_0x3de6de['uniqueid']][_0x5267('0x5d')](_0x1ac20f)){if(this['channels'][_0x3de6de[_0x5267('0x24')]][_0x1ac20f][_0x5267('0x3a')]&&!this[_0x5267('0x7')][_0x3de6de[_0x5267('0x24')]][_0x1ac20f]['agentcomplete']){logger['info'](_0x5267('0x5e'),_0x3de6de[_0x5267('0x24')],this[_0x5267('0x7')][_0x3de6de[_0x5267('0x24')]][_0x1ac20f][_0x5267('0x25')],_0x1ac20f);this[_0x5267('0x7')][_0x3de6de['uniqueid']][_0x1ac20f][_0x5267('0x12')]=!![];this['channels'][_0x3de6de[_0x5267('0x24')]][_0x1ac20f]['agentcompleteAt']=moment()[_0x5267('0x27')](_0x5267('0x58'));this[_0x5267('0x7')][_0x3de6de[_0x5267('0x24')]][_0x1ac20f][_0x5267('0x3f')]=_0x5267('0x5f');this[_0x5267('0x7')][_0x3de6de[_0x5267('0x24')]][_0x1ac20f][_0x5267('0x4e')]=_0x3de6de[_0x5267('0x4e')]==_0x5267('0x60')?'agent':_0x3de6de[_0x5267('0x4e')];this[_0x5267('0x7')][_0x3de6de['uniqueid']][_0x1ac20f][_0x5267('0x61')]=_0x3de6de[_0x5267('0x61')];if(this[_0x5267('0x8')][_0x3de6de[_0x5267('0x29')]]&&this[_0x5267('0x8')][_0x3de6de[_0x5267('0x29')]][_0x5267('0x62')]){this['channels'][_0x3de6de[_0x5267('0x24')]][_0x1ac20f][_0x5267('0x63')]=this[_0x5267('0x8')][_0x3de6de[_0x5267('0x29')]][_0x5267('0x64')];this['channels'][_0x3de6de['uniqueid']][_0x1ac20f][_0x5267('0x65')]=!![];}this[_0x5267('0x9')][_0x3de6de[_0x5267('0x66')]]=_[_0x5267('0x2f')](this['agents'][_0x3de6de[_0x5267('0x66')]],[_0x5267('0x29'),_0x5267('0x44')]);logger[_0x5267('0x32')](_0x5267('0x67'),_0x3de6de[_0x5267('0x24')],util[_0x5267('0x33')](this[_0x5267('0x7')][_0x3de6de[_0x5267('0x24')]][_0x1ac20f],{'showHidden':![],'depth':null}));ami[_0x5267('0x20')](_0x5267('0x68'),this[_0x5267('0x7')][_0x3de6de[_0x5267('0x24')]][_0x1ac20f]);logger['debug'](_0x5267('0x69'),_0x3de6de[_0x5267('0x24')],util[_0x5267('0x33')](this[_0x5267('0x7')][_0x3de6de[_0x5267('0x24')]][_0x1ac20f],{'showHidden':![],'depth':null}));this[_0x5267('0x20')](util[_0x5267('0x27')](_0x5267('0x35'),_0x3de6de[_0x5267('0x25')]),_0x5267('0x6a'),this[_0x5267('0x7')][_0x3de6de[_0x5267('0x24')]][_0x1ac20f]);}}}}}}catch(_0x204570){logger[_0x5267('0x37')](_0x5267('0x6b'),_0x3de6de[_0x5267('0x24')],util[_0x5267('0x33')](_0x204570,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5267('0x1f')][_0x5267('0x15')]=function(_0x676556){try{if(this[_0x5267('0x21')](_0x676556)){logger[_0x5267('0x32')](_0x5267('0x6c'),_0x676556['uniqueid'],util[_0x5267('0x33')](_0x676556,{'showHidden':![],'depth':null}));this[_0x5267('0x6d')](_0x676556[_0x5267('0x24')],_[_0x5267('0x6e')](_0x676556[_0x5267('0x6f')])[0x0],_0x676556['value']);if(this[_0x5267('0x7')][_0x676556[_0x5267('0x24')]]){for(var _0x4c68cd in this['channels'][_0x676556['uniqueid']]){if(this[_0x5267('0x7')][_0x676556['uniqueid']][_0x5267('0x5d')](_0x4c68cd)){logger['info']('[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s',_0x676556[_0x5267('0x24')],_0x4c68cd,_[_0x5267('0x6e')](_0x676556[_0x5267('0x6f')])[0x0],_0x676556[_0x5267('0x70')]);if(_[_0x5267('0x22')](this['channels'][_0x676556['uniqueid']][_0x4c68cd][_0x5267('0xa')])){this[_0x5267('0x7')][_0x676556[_0x5267('0x24')]][_0x4c68cd][_0x5267('0xa')]={};}this[_0x5267('0x7')][_0x676556['uniqueid']][_0x4c68cd][_0x5267('0xa')]=this['variables'][_0x676556['uniqueid']];}}}}}catch(_0x3dfd8d){logger['error']('[%s][voiceAgentReport][varset]',_0x676556[_0x5267('0x24')],util[_0x5267('0x33')](_0x3dfd8d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x5c5f44,_0xaaf010,_0x5ec381){var _0x1706c=['rtpaudioqos',_0x5267('0x71'),_0x5267('0x72'),'rtpaudioqosjitterbridged',_0x5267('0x73'),_0x5267('0x74'),_0x5267('0x75'),_0x5267('0x76'),_0x5267('0x77'),_0x5267('0x78'),'bridgepeer','bridgepvtcallid',_0x5267('0x79'),'memberdynamic','memberinterface',_0x5267('0x7a'),'membername',_0x5267('0x7b'),'memberrealtime'];if(!_[_0x5267('0x7c')](_0xaaf010)&&!_['includes'](_0x1706c,_0xaaf010)){if(_[_0x5267('0x22')](this[_0x5267('0xa')][_0x5c5f44])){this[_0x5267('0xa')][_0x5c5f44]={};}this[_0x5267('0xa')][_0x5c5f44][_0xaaf010]=_0x5ec381;}};VoiceAgentReport[_0x5267('0x1f')][_0x5267('0x17')]=function(_0x24b696){try{if(this['isNotNull'](_0x24b696)){logger['debug'](_0x5267('0x7d'),_0x24b696['uniqueid'],util['inspect'](_0x24b696,{'showHidden':![],'depth':null}));if(this['channels'][_0x24b696['uniqueid']]){for(var _0x568878 in this['channels'][_0x24b696[_0x5267('0x24')]]){if(this[_0x5267('0x7')][_0x24b696[_0x5267('0x24')]][_0x5267('0x5d')](_0x568878)){if(this[_0x5267('0x7')][_0x24b696[_0x5267('0x24')]][_0x568878][_0x5267('0x4e')]==_0x5267('0x60')&&this['channels'][_0x24b696['uniqueid']][_0x568878]['agentcomplete']){logger[_0x5267('0x49')](_0x5267('0x7e'),_0x24b696['uniqueid'],_0x568878);this[_0x5267('0x7')][_0x24b696[_0x5267('0x24')]][_0x568878][_0x5267('0x7f')]=moment()[_0x5267('0x27')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x5267('0x80'),_0x24b696[_0x5267('0x24')],util[_0x5267('0x33')](_[_0x5267('0x81')](this[_0x5267('0x7')][_0x24b696[_0x5267('0x24')]]),{'showHidden':![],'depth':null}));ami[_0x5267('0x20')]('custom:voiceAgentReport',_['values'](this['channels'][_0x24b696[_0x5267('0x24')]]));delete this[_0x5267('0x7')][_0x24b696[_0x5267('0x24')]];}if(this[_0x5267('0xa')][_0x24b696[_0x5267('0x24')]]){delete this[_0x5267('0xa')][_0x24b696['uniqueid']];}}}catch(_0x25aaaa){logger['error'](_0x5267('0x82'),_0x24b696[_0x5267('0x24')],util[_0x5267('0x33')](_0x25aaaa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5267('0x1f')][_0x5267('0x1c')]=function(_0x4eb17c){try{if(this[_0x5267('0x21')](_0x4eb17c)){logger[_0x5267('0x32')](_0x5267('0x83'),_0x4eb17c['uniqueid'],util['inspect'](_0x4eb17c,{'showHidden':![],'depth':null}));if(this['channels'][_0x4eb17c[_0x5267('0x84')]]){for(var _0x24b5d7 in this[_0x5267('0x7')][_0x4eb17c[_0x5267('0x84')]]){if(this['channels'][_0x4eb17c['transfereeuniqueid']][_0x5267('0x5d')](_0x24b5d7)){if(_0x4eb17c[_0x5267('0x85')]===_0x24b5d7){logger['info'](_0x5267('0x86'),_0x4eb17c[_0x5267('0x24')],this['channels'][_0x4eb17c['transfereeuniqueid']][_0x24b5d7][_0x5267('0x25')],_0x24b5d7);var _0x11a6f4=moment();this['channels'][_0x4eb17c[_0x5267('0x84')]][_0x24b5d7][_0x5267('0x12')]=!![];this[_0x5267('0x7')][_0x4eb17c[_0x5267('0x84')]][_0x24b5d7][_0x5267('0x7f')]=moment()[_0x5267('0x27')](_0x5267('0x58'));this[_0x5267('0x7')][_0x4eb17c[_0x5267('0x84')]][_0x24b5d7]['lastevent']='complete';this[_0x5267('0x7')][_0x4eb17c['transfereeuniqueid']][_0x24b5d7][_0x5267('0x4e')]=_0x5267('0x60');this[_0x5267('0x7')][_0x4eb17c[_0x5267('0x84')]][_0x24b5d7][_0x5267('0x61')]=_0x11a6f4[_0x5267('0x87')](this[_0x5267('0x7')][_0x4eb17c[_0x5267('0x84')]][_0x24b5d7][_0x5267('0x3a')],_0x5267('0x88'));}}}}if(this[_0x5267('0x7')][_0x4eb17c[_0x5267('0x89')]]){var _0x5909b3=this[_0x5267('0x7')][_0x4eb17c['secondtransfereruniqueid']];this['channels'][_0x4eb17c[_0x5267('0x89')]]=this[_0x5267('0x7')][_0x4eb17c[_0x5267('0x84')]];this['channels'][_0x4eb17c[_0x5267('0x84')]]=_0x5909b3;}}}catch(_0x158a62){logger[_0x5267('0x37')](_0x5267('0x8a'),_0x4eb17c[_0x5267('0x24')],util[_0x5267('0x33')](_0x158a62,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5267('0x1f')][_0x5267('0x1e')]=function(_0xedb646){try{if(this[_0x5267('0x21')](_0xedb646)){logger[_0x5267('0x32')](_0x5267('0x8b'),_0xedb646['uniqueid'],util[_0x5267('0x33')](_0xedb646,{'showHidden':![],'depth':null}));if(this[_0x5267('0x7')][_0xedb646['transfereeuniqueid']]){for(var _0x262af9 in this[_0x5267('0x7')][_0xedb646[_0x5267('0x84')]]){if(this[_0x5267('0x7')][_0xedb646['transfereeuniqueid']][_0x5267('0x5d')](_0x262af9)){if(_0xedb646[_0x5267('0x8c')]===_0x262af9){logger[_0x5267('0x49')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xedb646[_0x5267('0x24')],this[_0x5267('0x7')][_0xedb646[_0x5267('0x84')]][_0x262af9][_0x5267('0x25')],_0x262af9);var _0xc0af94=moment();this[_0x5267('0x7')][_0xedb646[_0x5267('0x84')]][_0x262af9][_0x5267('0x12')]=!![];this[_0x5267('0x7')][_0xedb646['transfereeuniqueid']][_0x262af9][_0x5267('0x7f')]=_0xc0af94;this[_0x5267('0x7')][_0xedb646['transfereeuniqueid']][_0x262af9][_0x5267('0x3f')]='complete';this[_0x5267('0x7')][_0xedb646['transfereeuniqueid']][_0x262af9][_0x5267('0x4e')]=_0x5267('0x60');this['channels'][_0xedb646['transfereeuniqueid']][_0x262af9][_0x5267('0x61')]=_0xc0af94[_0x5267('0x87')](this[_0x5267('0x7')][_0xedb646[_0x5267('0x84')]][_0x262af9][_0x5267('0x3a')],'seconds');}}}}}}catch(_0x3dcf73){logger['error']('[%s][voiceAgentReport][blindtransfer]',_0xedb646['uniqueid'],util[_0x5267('0x33')](_0x3dcf73,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5267('0x1f')][_0x5267('0x18')]=function(_0x7fd23a){var _0x470e7c='';try{if(this[_0x5267('0x21')](_0x7fd23a)){logger[_0x5267('0x32')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x7fd23a['uniqueid'],util[_0x5267('0x33')](_0x7fd23a,{'showHidden':![],'depth':null}));if(_0x7fd23a[_0x5267('0x8d')]){_0x470e7c=_0x7fd23a[_0x5267('0x8d')][_0x5267('0x8e')](0x0,_0x7fd23a[_0x5267('0x8d')]['lastIndexOf']('-'));if(this[_0x5267('0x9')][_0x470e7c]){logger[_0x5267('0x49')](_0x5267('0x8f'),_0x7fd23a[_0x5267('0x24')],_0x470e7c);this[_0x5267('0x9')][_0x470e7c]['onhold']=!![];}}}}catch(_0x3ab097){logger[_0x5267('0x37')](_0x5267('0x90'),_0x7fd23a['uniqueid'],util[_0x5267('0x33')](_0x3ab097,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5267('0x1a')]=function(_0x2974d2){var _0x47caa2='';try{if(this[_0x5267('0x21')](_0x2974d2)){logger['debug'](_0x5267('0x91'),_0x2974d2[_0x5267('0x24')],util['inspect'](_0x2974d2,{'showHidden':![],'depth':null}));if(_0x2974d2[_0x5267('0x8d')]){_0x47caa2=_0x2974d2[_0x5267('0x8d')]['substring'](0x0,_0x2974d2[_0x5267('0x8d')][_0x5267('0x92')]('-'));if(this[_0x5267('0x9')][_0x47caa2]){logger[_0x5267('0x49')](_0x5267('0x93'),_0x2974d2['uniqueid'],_0x47caa2);this['agents'][_0x47caa2][_0x5267('0x94')]=![];}}}}catch(_0x4117c1){logger['error'](_0x5267('0x95'),_0x2974d2['uniqueid'],util[_0x5267('0x33')](_0x4117c1,{'showHidden':![],'depth':null}));}};module[_0x5267('0x96')]=VoiceAgentReport;
\ No newline at end of file
+var _0xed08=['called','queue','mandatoryDisposition','merge','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','interface','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent: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:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','complete','reason','agent','talktime','acw','acwtime','acwTimeout','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]','addVariable','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][blindtransfer]','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','prototype','emit','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','isUndefined','destuniqueid','format'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0xed08,0x67));var _0x8ed0=function(_0x2a914c,_0x403f27){_0x2a914c=_0x2a914c-0x0;var _0x278961=_0xed08[_0x2a914c];return _0x278961;};'use strict';var _=require('lodash');var moment=require(_0x8ed0('0x0'));var util=require(_0x8ed0('0x1'));var Redis=require(_0x8ed0('0x2'));var config=require(_0x8ed0('0x3'));var logger=require(_0x8ed0('0x4'))(_0x8ed0('0x5'));var ami=require(_0x8ed0('0x6'));config[_0x8ed0('0x7')]=_[_0x8ed0('0x8')](config[_0x8ed0('0x7')],{'host':_0x8ed0('0x9'),'port':0x18eb});var io=require(_0x8ed0('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x15f266){this[_0x8ed0('0xb')]={};this[_0x8ed0('0xc')]=_0x15f266[_0x8ed0('0xb')];this[_0x8ed0('0xd')]=_0x15f266[_0x8ed0('0xd')];this[_0x8ed0('0xe')]=_0x15f266['agents'];this[_0x8ed0('0xf')]={};ami['on'](_0x8ed0('0x10'),this[_0x8ed0('0x11')][_0x8ed0('0x12')](this));ami['on']('agentconnect',this[_0x8ed0('0x13')][_0x8ed0('0x12')](this));ami['on'](_0x8ed0('0x14'),this[_0x8ed0('0x15')][_0x8ed0('0x12')](this));ami['on'](_0x8ed0('0x16'),this[_0x8ed0('0x17')][_0x8ed0('0x12')](this));ami['on'](_0x8ed0('0x18'),this[_0x8ed0('0x19')]['bind'](this));ami['on'](_0x8ed0('0x1a'),this[_0x8ed0('0x1b')]['bind'](this));ami['on'](_0x8ed0('0x1c'),this[_0x8ed0('0x1d')]['bind'](this));ami['on'](_0x8ed0('0x1e'),this[_0x8ed0('0x1f')]['bind'](this));ami['on'](_0x8ed0('0x20'),this[_0x8ed0('0x21')]['bind'](this));ami['on'](_0x8ed0('0x22'),this[_0x8ed0('0x23')][_0x8ed0('0x12')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0x8ed0('0x24')][_0x8ed0('0x25')]=function(_0x32977d,_0x32e6c3,_0x3548a2){io['to'](_0x32977d)[_0x8ed0('0x25')](_0x32e6c3,_0x3548a2);};VoiceAgentReport[_0x8ed0('0x24')][_0x8ed0('0x26')]=function(_0x27fbe4){return _0x27fbe4!==null&&!_['isUndefined'](_0x27fbe4);};VoiceAgentReport['prototype'][_0x8ed0('0x11')]=function(_0x23e6c2){try{if(this['isNotNull'](_0x23e6c2)){logger[_0x8ed0('0x27')](_0x8ed0('0x28'),_0x23e6c2[_0x8ed0('0x29')],_0x23e6c2[_0x8ed0('0x2a')],_0x23e6c2['destuniqueid']);logger[_0x8ed0('0x2b')](_0x8ed0('0x2c'),_0x23e6c2['uniqueid'],util[_0x8ed0('0x2d')](_0x23e6c2,{'showHidden':![],'depth':null}));if(_[_0x8ed0('0x2e')](this[_0x8ed0('0xb')][_0x23e6c2[_0x8ed0('0x29')]])){this[_0x8ed0('0xb')][_0x23e6c2[_0x8ed0('0x29')]]={};}if(_['isUndefined'](this['channels'][_0x23e6c2[_0x8ed0('0x29')]][_0x23e6c2[_0x8ed0('0x2f')]])){this[_0x8ed0('0xb')][_0x23e6c2[_0x8ed0('0x29')]][_0x23e6c2[_0x8ed0('0x2f')]]={'agentcalledAt':moment()[_0x8ed0('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x8ed0('0x31'),'mandatoryDisposition':this[_0x8ed0('0xd')][_0x23e6c2['queue']]?this[_0x8ed0('0xd')][_0x23e6c2[_0x8ed0('0x32')]][_0x8ed0('0x33')]||![]:![],'type':this[_0x8ed0('0xd')][_0x23e6c2[_0x8ed0('0x32')]]?this[_0x8ed0('0xd')][_0x23e6c2[_0x8ed0('0x32')]]['type']||'inbound':'inbound','variables':this[_0x8ed0('0xf')][_0x23e6c2[_0x8ed0('0x29')]],'motionChannel':'voice'};}_[_0x8ed0('0x34')](this['channels'][_0x23e6c2[_0x8ed0('0x29')]][_0x23e6c2[_0x8ed0('0x2f')]],_['omit'](_0x23e6c2,['event',_0x8ed0('0x35')]));logger[_0x8ed0('0x2b')](_0x8ed0('0x36'),_0x23e6c2['uniqueid'],util[_0x8ed0('0x2d')](this['channels'][_0x23e6c2[_0x8ed0('0x29')]][_0x23e6c2[_0x8ed0('0x2f')]],{'showHidden':![],'depth':null}));ami[_0x8ed0('0x25')](_0x8ed0('0x37'),this[_0x8ed0('0xb')][_0x23e6c2['uniqueid']][_0x23e6c2[_0x8ed0('0x2f')]]);logger['debug'](_0x8ed0('0x38'),_0x23e6c2[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](this[_0x8ed0('0xb')][_0x23e6c2[_0x8ed0('0x29')]][_0x23e6c2[_0x8ed0('0x2f')]],{'showHidden':![],'depth':null}));this[_0x8ed0('0x25')](util[_0x8ed0('0x30')](_0x8ed0('0x39'),_0x23e6c2[_0x8ed0('0x2a')]),_0x8ed0('0x3a'),this[_0x8ed0('0xb')][_0x23e6c2[_0x8ed0('0x29')]][_0x23e6c2['destuniqueid']]);}}catch(_0x3ddeb4){logger['error'](_0x8ed0('0x3b'),_0x23e6c2['uniqueid'],util[_0x8ed0('0x2d')](_0x3ddeb4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed0('0x24')][_0x8ed0('0x13')]=function(_0x57fcc1){try{if(this[_0x8ed0('0x26')](_0x57fcc1)){if(this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]]){logger['debug']('[%s][voiceAgentReport][agentconnect]\x20event:',_0x57fcc1[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x57fcc1,{'showHidden':![],'depth':null}));for(var _0x7e32b0 in this[_0x8ed0('0xb')][_0x57fcc1['uniqueid']]){if(this[_0x8ed0('0xb')][_0x57fcc1['uniqueid']][_0x8ed0('0x3c')](_0x7e32b0)){if(_0x57fcc1[_0x8ed0('0x2f')]===_0x7e32b0){logger['info'](_0x8ed0('0x3d'),_0x57fcc1[_0x8ed0('0x29')],_0x57fcc1[_0x8ed0('0x2a')],_0x57fcc1[_0x8ed0('0x2f')]);this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0][_0x8ed0('0x3e')]=moment()['format'](_0x8ed0('0x3f'));this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0][_0x8ed0('0x40')]=_0x57fcc1[_0x8ed0('0x40')];this[_0x8ed0('0xb')][_0x57fcc1['uniqueid']][_0x7e32b0][_0x8ed0('0x41')]=_0x57fcc1[_0x8ed0('0x41')];this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0][_0x8ed0('0x42')]=_0x57fcc1[_0x8ed0('0x42')];this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0][_0x8ed0('0x43')]=_0x57fcc1[_0x8ed0('0x43')];this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0]['holdtime']=_0x57fcc1[_0x8ed0('0x44')];this['channels'][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0][_0x8ed0('0x45')]='connect';if(this['voiceChannels'][this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0]['uniqueid']]){var _0x28b259=this[_0x8ed0('0xc')][this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0][_0x8ed0('0x29')]][_0x8ed0('0x46')];this[_0x8ed0('0xb')][_0x57fcc1['uniqueid']][_0x7e32b0][_0x8ed0('0x46')]=_0x28b259;_0x57fcc1[_0x8ed0('0x46')]=_0x28b259;}_[_0x8ed0('0x34')](this[_0x8ed0('0xe')][_0x57fcc1[_0x8ed0('0x47')]],_['pick'](_0x57fcc1,[_0x8ed0('0x32'),'destconnectedlinenum',_0x8ed0('0x46')]));logger[_0x8ed0('0x2b')](_0x8ed0('0x48'),_0x57fcc1[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x57fcc1['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x8ed0('0x25')](_0x8ed0('0x49'),this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x57fcc1['destuniqueid']]);logger[_0x8ed0('0x2b')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x57fcc1[_0x8ed0('0x29')],util['inspect'](this[_0x8ed0('0xb')][_0x57fcc1['uniqueid']][_0x57fcc1[_0x8ed0('0x2f')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x8ed0('0x30')]('user:%s',_0x57fcc1[_0x8ed0('0x2a')]),'user:agentconnect',this['channels'][_0x57fcc1[_0x8ed0('0x29')]][_0x57fcc1[_0x8ed0('0x2f')]]);}else if(!this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0][_0x8ed0('0x14')]&&!this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0]['agentcomplete']){logger[_0x8ed0('0x27')](_0x8ed0('0x4a'),_0x57fcc1[_0x8ed0('0x29')],this[_0x8ed0('0xb')][_0x57fcc1['uniqueid']][_0x7e32b0][_0x8ed0('0x2a')],_0x7e32b0);this['channels'][_0x57fcc1['uniqueid']][_0x7e32b0][_0x8ed0('0x14')]=!![];this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0][_0x8ed0('0x4b')]=moment()[_0x8ed0('0x30')](_0x8ed0('0x3f'));this[_0x8ed0('0xb')][_0x57fcc1['uniqueid']][_0x7e32b0][_0x8ed0('0x4c')]=_0x57fcc1[_0x8ed0('0x2f')];this['channels'][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0][_0x8ed0('0x4d')]=_0x57fcc1[_0x8ed0('0x2a')];this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0][_0x8ed0('0x45')]=_0x8ed0('0x4e');this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0]['reason']='answered_elsewhere';logger[_0x8ed0('0x2b')](_0x8ed0('0x4f'),_0x57fcc1[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0],{'showHidden':![],'depth':null}));ami[_0x8ed0('0x25')](_0x8ed0('0x50'),this[_0x8ed0('0xb')][_0x57fcc1[_0x8ed0('0x29')]][_0x7e32b0]);}}}}}}catch(_0x43631c){logger[_0x8ed0('0x51')](_0x8ed0('0x52'),_0x57fcc1[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x43631c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed0('0x24')][_0x8ed0('0x15')]=function(_0x4e86bd){try{if(this[_0x8ed0('0x26')](_0x4e86bd)){logger['debug'](_0x8ed0('0x53'),_0x4e86bd[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x4e86bd,{'showHidden':![],'depth':null}));if(this['channels'][_0x4e86bd[_0x8ed0('0x29')]]&&this['channels'][_0x4e86bd[_0x8ed0('0x29')]][_0x4e86bd['destuniqueid']]){logger[_0x8ed0('0x27')](_0x8ed0('0x54'),_0x4e86bd[_0x8ed0('0x29')],_0x4e86bd['membername'],_0x4e86bd[_0x8ed0('0x2f')]);this[_0x8ed0('0xb')][_0x4e86bd[_0x8ed0('0x29')]][_0x4e86bd[_0x8ed0('0x2f')]][_0x8ed0('0x14')]=!![];this[_0x8ed0('0xb')][_0x4e86bd['uniqueid']][_0x4e86bd[_0x8ed0('0x2f')]][_0x8ed0('0x4b')]=moment()[_0x8ed0('0x30')](_0x8ed0('0x3f'));this['channels'][_0x4e86bd['uniqueid']][_0x4e86bd[_0x8ed0('0x2f')]][_0x8ed0('0x45')]='rejected';this['channels'][_0x4e86bd[_0x8ed0('0x29')]][_0x4e86bd['destuniqueid']]['reason']='rejected';logger[_0x8ed0('0x2b')](_0x8ed0('0x55'),_0x4e86bd[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](this['channels'][_0x4e86bd[_0x8ed0('0x29')]][_0x4e86bd[_0x8ed0('0x2f')]],{'showHidden':![],'depth':null}));ami[_0x8ed0('0x25')](_0x8ed0('0x56'),this[_0x8ed0('0xb')][_0x4e86bd[_0x8ed0('0x29')]][_0x4e86bd[_0x8ed0('0x2f')]]);}}}catch(_0x387fed){logger[_0x8ed0('0x51')](_0x8ed0('0x57'),_0x4e86bd['uniqueid'],util[_0x8ed0('0x2d')](_0x387fed,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed0('0x24')]['syncQueueCallerAbandon']=function(_0x34f7d6){try{if(this['isNotNull'](_0x34f7d6)){logger[_0x8ed0('0x2b')](_0x8ed0('0x58'),_0x34f7d6[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x34f7d6,{'showHidden':![],'depth':null}));if(this[_0x8ed0('0xb')][_0x34f7d6[_0x8ed0('0x29')]]){for(var _0x1dcd7d in this[_0x8ed0('0xb')][_0x34f7d6[_0x8ed0('0x29')]]){if(this[_0x8ed0('0xb')][_0x34f7d6[_0x8ed0('0x29')]][_0x8ed0('0x3c')](_0x1dcd7d)&&!this[_0x8ed0('0xb')][_0x34f7d6[_0x8ed0('0x29')]][_0x1dcd7d][_0x8ed0('0x14')]&&!this[_0x8ed0('0xb')][_0x34f7d6[_0x8ed0('0x29')]][_0x1dcd7d]['agentcomplete']){logger[_0x8ed0('0x27')](_0x8ed0('0x59'),_0x34f7d6[_0x8ed0('0x29')],this[_0x8ed0('0xb')][_0x34f7d6[_0x8ed0('0x29')]][_0x1dcd7d][_0x8ed0('0x2a')],_0x1dcd7d);this[_0x8ed0('0xb')][_0x34f7d6[_0x8ed0('0x29')]][_0x1dcd7d]['agentringnoanswer']=!![];this[_0x8ed0('0xb')][_0x34f7d6[_0x8ed0('0x29')]][_0x1dcd7d][_0x8ed0('0x4b')]=moment()[_0x8ed0('0x30')](_0x8ed0('0x3f'));this[_0x8ed0('0xb')][_0x34f7d6['uniqueid']][_0x1dcd7d][_0x8ed0('0x45')]=_0x8ed0('0x5a');this[_0x8ed0('0xb')][_0x34f7d6[_0x8ed0('0x29')]][_0x1dcd7d]['reason']=_0x8ed0('0x5a');logger[_0x8ed0('0x2b')](_0x8ed0('0x5b'),_0x34f7d6[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](this['channels'][_0x34f7d6['uniqueid']][_0x1dcd7d],{'showHidden':![],'depth':null}));ami[_0x8ed0('0x25')](_0x8ed0('0x5c'),this[_0x8ed0('0xb')][_0x34f7d6[_0x8ed0('0x29')]][_0x1dcd7d]);}}}}}catch(_0x1d19ac){logger[_0x8ed0('0x51')]('[%s][voiceAgentReport][queuecallerabandon]',_0x34f7d6[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x1d19ac,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed0('0x24')]['syncAgentComplete']=function(_0x32d79a){try{if(this[_0x8ed0('0x26')](_0x32d79a)){logger[_0x8ed0('0x2b')](_0x8ed0('0x5d'),_0x32d79a[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x32d79a,{'showHidden':![],'depth':null}));if(this['channels'][_0x32d79a[_0x8ed0('0x29')]]){for(var _0x2ec35e in this[_0x8ed0('0xb')][_0x32d79a[_0x8ed0('0x29')]]){if(this['channels'][_0x32d79a[_0x8ed0('0x29')]][_0x8ed0('0x3c')](_0x2ec35e)){if(this['channels'][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e]['agentconnectAt']&&!this[_0x8ed0('0xb')][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e][_0x8ed0('0x18')]){logger[_0x8ed0('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x32d79a[_0x8ed0('0x29')],this[_0x8ed0('0xb')][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e][_0x8ed0('0x2a')],_0x2ec35e);this[_0x8ed0('0xb')][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e][_0x8ed0('0x18')]=!![];this['channels'][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8ed0('0xb')][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e][_0x8ed0('0x45')]=_0x8ed0('0x5e');this[_0x8ed0('0xb')][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e]['reason']=_0x32d79a[_0x8ed0('0x5f')]=='transfer'?_0x8ed0('0x60'):_0x32d79a[_0x8ed0('0x5f')];this['channels'][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e][_0x8ed0('0x61')]=_0x32d79a['talktime'];if(this['voiceQueues'][_0x32d79a[_0x8ed0('0x32')]]&&this[_0x8ed0('0xd')][_0x32d79a[_0x8ed0('0x32')]][_0x8ed0('0x62')]){this['channels'][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e][_0x8ed0('0x63')]=this[_0x8ed0('0xd')][_0x32d79a[_0x8ed0('0x32')]][_0x8ed0('0x64')];this[_0x8ed0('0xb')][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e]['agentacw']=!![];}this['agents'][_0x32d79a[_0x8ed0('0x47')]]=_['omit'](this[_0x8ed0('0xe')][_0x32d79a[_0x8ed0('0x47')]],['queue',_0x8ed0('0x65')]);logger['debug'](_0x8ed0('0x66'),_0x32d79a['uniqueid'],util[_0x8ed0('0x2d')](this[_0x8ed0('0xb')][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e],{'showHidden':![],'depth':null}));ami[_0x8ed0('0x25')](_0x8ed0('0x67'),this[_0x8ed0('0xb')][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e]);logger[_0x8ed0('0x2b')](_0x8ed0('0x68'),_0x32d79a['uniqueid'],util['inspect'](this[_0x8ed0('0xb')][_0x32d79a[_0x8ed0('0x29')]][_0x2ec35e],{'showHidden':![],'depth':null}));this['emit'](util[_0x8ed0('0x30')](_0x8ed0('0x39'),_0x32d79a[_0x8ed0('0x2a')]),'user:agentcomplete',this[_0x8ed0('0xb')][_0x32d79a['uniqueid']][_0x2ec35e]);}}}}}}catch(_0x11f4df){logger[_0x8ed0('0x51')](_0x8ed0('0x69'),_0x32d79a[_0x8ed0('0x29')],util['inspect'](_0x11f4df,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8ed0('0x1b')]=function(_0x12c6b8){try{if(this[_0x8ed0('0x26')](_0x12c6b8)){logger[_0x8ed0('0x2b')]('[%s][voiceAgentReport][varset]\x20event:',_0x12c6b8[_0x8ed0('0x29')],util['inspect'](_0x12c6b8,{'showHidden':![],'depth':null}));this[_0x8ed0('0x6a')](_0x12c6b8[_0x8ed0('0x29')],_['keys'](_0x12c6b8[_0x8ed0('0x6b')])[0x0],_0x12c6b8[_0x8ed0('0x6c')]);if(this[_0x8ed0('0xb')][_0x12c6b8[_0x8ed0('0x29')]]){for(var _0x538219 in this['channels'][_0x12c6b8[_0x8ed0('0x29')]]){if(this['channels'][_0x12c6b8['uniqueid']]['hasOwnProperty'](_0x538219)){logger[_0x8ed0('0x27')](_0x8ed0('0x6d'),_0x12c6b8[_0x8ed0('0x29')],_0x538219,_[_0x8ed0('0x6e')](_0x12c6b8[_0x8ed0('0x6b')])[0x0],_0x12c6b8['value']);if(_[_0x8ed0('0x2e')](this[_0x8ed0('0xb')][_0x12c6b8['uniqueid']][_0x538219][_0x8ed0('0xf')])){this[_0x8ed0('0xb')][_0x12c6b8[_0x8ed0('0x29')]][_0x538219][_0x8ed0('0xf')]={};}this[_0x8ed0('0xb')][_0x12c6b8[_0x8ed0('0x29')]][_0x538219][_0x8ed0('0xf')]=this[_0x8ed0('0xf')][_0x12c6b8[_0x8ed0('0x29')]];}}}}}catch(_0x579437){logger[_0x8ed0('0x51')](_0x8ed0('0x6f'),_0x12c6b8[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x579437,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed0('0x24')][_0x8ed0('0x6a')]=function(_0xce3ef4,_0x1f311f,_0x114107){var _0x2f52f9=['rtpaudioqos',_0x8ed0('0x70'),'rtpaudioqosjitter',_0x8ed0('0x71'),_0x8ed0('0x72'),_0x8ed0('0x73'),'rtpaudioqosrtt',_0x8ed0('0x74'),_0x8ed0('0x75'),_0x8ed0('0x76'),_0x8ed0('0x77'),'bridgepvtcallid',_0x8ed0('0x78'),_0x8ed0('0x79'),_0x8ed0('0x7a'),_0x8ed0('0x7b'),'membername',_0x8ed0('0x7c'),'memberrealtime'];if(!_['isNil'](_0x1f311f)&&!_[_0x8ed0('0x7d')](_0x2f52f9,_0x1f311f)){if(_['isUndefined'](this['variables'][_0xce3ef4])){this[_0x8ed0('0xf')][_0xce3ef4]={};}this[_0x8ed0('0xf')][_0xce3ef4][_0x1f311f]=_0x114107;}};VoiceAgentReport[_0x8ed0('0x24')][_0x8ed0('0x1d')]=function(_0x35e4ba){try{if(this[_0x8ed0('0x26')](_0x35e4ba)){logger[_0x8ed0('0x2b')](_0x8ed0('0x7e'),_0x35e4ba[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x35e4ba,{'showHidden':![],'depth':null}));if(this[_0x8ed0('0xb')][_0x35e4ba['uniqueid']]){for(var _0x47be85 in this['channels'][_0x35e4ba[_0x8ed0('0x29')]]){if(this[_0x8ed0('0xb')][_0x35e4ba[_0x8ed0('0x29')]][_0x8ed0('0x3c')](_0x47be85)){if(this[_0x8ed0('0xb')][_0x35e4ba[_0x8ed0('0x29')]][_0x47be85][_0x8ed0('0x5f')]==_0x8ed0('0x7f')&&this[_0x8ed0('0xb')][_0x35e4ba[_0x8ed0('0x29')]][_0x47be85]['agentcomplete']){logger['info'](_0x8ed0('0x80'),_0x35e4ba[_0x8ed0('0x29')],_0x47be85);this[_0x8ed0('0xb')][_0x35e4ba[_0x8ed0('0x29')]][_0x47be85]['agentcompleteAt']=moment()[_0x8ed0('0x30')](_0x8ed0('0x3f'));}}}logger[_0x8ed0('0x2b')](_0x8ed0('0x81'),_0x35e4ba[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_[_0x8ed0('0x82')](this['channels'][_0x35e4ba[_0x8ed0('0x29')]]),{'showHidden':![],'depth':null}));ami[_0x8ed0('0x25')](_0x8ed0('0x83'),_[_0x8ed0('0x82')](this[_0x8ed0('0xb')][_0x35e4ba[_0x8ed0('0x29')]]));delete this[_0x8ed0('0xb')][_0x35e4ba[_0x8ed0('0x29')]];}if(this[_0x8ed0('0xf')][_0x35e4ba[_0x8ed0('0x29')]]){delete this[_0x8ed0('0xf')][_0x35e4ba['uniqueid']];}}}catch(_0x31d26e){logger[_0x8ed0('0x51')]('[%s][voiceAgentReport][hangup]',_0x35e4ba[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x31d26e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed0('0x24')][_0x8ed0('0x23')]=function(_0x4b7a3b){try{if(this[_0x8ed0('0x26')](_0x4b7a3b)){logger[_0x8ed0('0x2b')](_0x8ed0('0x84'),_0x4b7a3b['uniqueid'],util['inspect'](_0x4b7a3b,{'showHidden':![],'depth':null}));if(this['channels'][_0x4b7a3b[_0x8ed0('0x85')]]){for(var _0x558e3a in this[_0x8ed0('0xb')][_0x4b7a3b[_0x8ed0('0x85')]]){if(this[_0x8ed0('0xb')][_0x4b7a3b['transfereeuniqueid']][_0x8ed0('0x3c')](_0x558e3a)){if(_0x4b7a3b[_0x8ed0('0x86')]===_0x558e3a){logger['info'](_0x8ed0('0x87'),_0x4b7a3b['uniqueid'],this[_0x8ed0('0xb')][_0x4b7a3b[_0x8ed0('0x85')]][_0x558e3a][_0x8ed0('0x2a')],_0x558e3a);var _0x240262=moment();this[_0x8ed0('0xb')][_0x4b7a3b['transfereeuniqueid']][_0x558e3a][_0x8ed0('0x18')]=!![];this[_0x8ed0('0xb')][_0x4b7a3b[_0x8ed0('0x85')]][_0x558e3a][_0x8ed0('0x88')]=moment()['format'](_0x8ed0('0x3f'));this['channels'][_0x4b7a3b[_0x8ed0('0x85')]][_0x558e3a][_0x8ed0('0x45')]=_0x8ed0('0x5e');this[_0x8ed0('0xb')][_0x4b7a3b[_0x8ed0('0x85')]][_0x558e3a][_0x8ed0('0x5f')]=_0x8ed0('0x7f');this[_0x8ed0('0xb')][_0x4b7a3b[_0x8ed0('0x85')]][_0x558e3a][_0x8ed0('0x61')]=_0x240262[_0x8ed0('0x89')](this[_0x8ed0('0xb')][_0x4b7a3b[_0x8ed0('0x85')]][_0x558e3a][_0x8ed0('0x3e')],'seconds');}}}}if(this[_0x8ed0('0xb')][_0x4b7a3b[_0x8ed0('0x8a')]]){var _0x555a40=this[_0x8ed0('0xb')][_0x4b7a3b['secondtransfereruniqueid']];this[_0x8ed0('0xb')][_0x4b7a3b[_0x8ed0('0x8a')]]=this[_0x8ed0('0xb')][_0x4b7a3b['transfereeuniqueid']];this[_0x8ed0('0xb')][_0x4b7a3b[_0x8ed0('0x85')]]=_0x555a40;}}}catch(_0x406d6e){logger[_0x8ed0('0x51')](_0x8ed0('0x8b'),_0x4b7a3b[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x406d6e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed0('0x24')]['syncBlindTransfer']=function(_0xd3e44d){try{if(this['isNotNull'](_0xd3e44d)){logger[_0x8ed0('0x2b')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0xd3e44d[_0x8ed0('0x29')],util['inspect'](_0xd3e44d,{'showHidden':![],'depth':null}));if(this[_0x8ed0('0xb')][_0xd3e44d[_0x8ed0('0x85')]]){for(var _0x310783 in this[_0x8ed0('0xb')][_0xd3e44d[_0x8ed0('0x85')]]){if(this[_0x8ed0('0xb')][_0xd3e44d[_0x8ed0('0x85')]][_0x8ed0('0x3c')](_0x310783)){if(_0xd3e44d[_0x8ed0('0x8c')]===_0x310783){logger[_0x8ed0('0x27')](_0x8ed0('0x8d'),_0xd3e44d[_0x8ed0('0x29')],this[_0x8ed0('0xb')][_0xd3e44d['transfereeuniqueid']][_0x310783][_0x8ed0('0x2a')],_0x310783);var _0x51fcae=moment();this[_0x8ed0('0xb')][_0xd3e44d[_0x8ed0('0x85')]][_0x310783][_0x8ed0('0x18')]=!![];this['channels'][_0xd3e44d['transfereeuniqueid']][_0x310783]['agentcompleteAt']=_0x51fcae;this['channels'][_0xd3e44d[_0x8ed0('0x85')]][_0x310783][_0x8ed0('0x45')]='complete';this[_0x8ed0('0xb')][_0xd3e44d[_0x8ed0('0x85')]][_0x310783][_0x8ed0('0x5f')]=_0x8ed0('0x7f');this[_0x8ed0('0xb')][_0xd3e44d[_0x8ed0('0x85')]][_0x310783][_0x8ed0('0x61')]=_0x51fcae[_0x8ed0('0x89')](this['channels'][_0xd3e44d[_0x8ed0('0x85')]][_0x310783]['agentconnectAt'],_0x8ed0('0x8e'));}}}}}}catch(_0x10951f){logger[_0x8ed0('0x51')](_0x8ed0('0x8f'),_0xd3e44d[_0x8ed0('0x29')],util['inspect'](_0x10951f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed0('0x24')][_0x8ed0('0x1f')]=function(_0x52d18a){var _0x4ec2aa='';try{if(this[_0x8ed0('0x26')](_0x52d18a)){logger[_0x8ed0('0x2b')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x52d18a[_0x8ed0('0x29')],util['inspect'](_0x52d18a,{'showHidden':![],'depth':null}));if(_0x52d18a[_0x8ed0('0x90')]){_0x4ec2aa=_0x52d18a[_0x8ed0('0x90')][_0x8ed0('0x91')](0x0,_0x52d18a['channel']['lastIndexOf']('-'));if(this[_0x8ed0('0xe')][_0x4ec2aa]){logger[_0x8ed0('0x27')](_0x8ed0('0x92'),_0x52d18a[_0x8ed0('0x29')],_0x4ec2aa);this[_0x8ed0('0xe')][_0x4ec2aa][_0x8ed0('0x93')]=!![];}}}}catch(_0x884b64){logger[_0x8ed0('0x51')](_0x8ed0('0x94'),_0x52d18a[_0x8ed0('0x29')],util[_0x8ed0('0x2d')](_0x884b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8ed0('0x24')][_0x8ed0('0x21')]=function(_0x256001){var _0x5e6f22='';try{if(this[_0x8ed0('0x26')](_0x256001)){logger['debug'](_0x8ed0('0x95'),_0x256001['uniqueid'],util[_0x8ed0('0x2d')](_0x256001,{'showHidden':![],'depth':null}));if(_0x256001['channel']){_0x5e6f22=_0x256001[_0x8ed0('0x90')][_0x8ed0('0x91')](0x0,_0x256001['channel'][_0x8ed0('0x96')]('-'));if(this[_0x8ed0('0xe')][_0x5e6f22]){logger[_0x8ed0('0x27')](_0x8ed0('0x97'),_0x256001[_0x8ed0('0x29')],_0x5e6f22);this[_0x8ed0('0xe')][_0x5e6f22][_0x8ed0('0x93')]=![];}}}}catch(_0x3ae979){logger['error']('[%s][voiceAgentReport][musiconholdstop]',_0x256001['uniqueid'],util['inspect'](_0x3ae979,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
index 2a1c29b..e9e1a86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x956a=['startsWith','CDR(routeAlias)','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','lastdata','match','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','xcally-motion-preview','connectedlinename','UserId','membername','channelstate','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','xmd-originatecalleridnum','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','holdtime','omit','isEmpty','getSettings','then','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','destinationchannel','finally','webbar:stopmonitors','event','BlindTransfer','type','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','queue','dial','NO\x20ANSWER','FAILED','ANSWERED','defaults','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','bind','newchannel','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','[%s][voiceCallReport][newcallerid]\x20event:','merge','pick','keys','context','from-sip','channel','split','destconnectedlinenum','connectedlinenum','format','name','user:agentconnect','accountcode','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','appdata'];(function(_0x215998,_0x3635a3){var _0x16edb4=function(_0x1bd0fd){while(--_0x1bd0fd){_0x215998['push'](_0x215998['shift']());}};_0x16edb4(++_0x3635a3);}(_0x956a,0x143));var _0xa956=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x956a[_0x21a9d9];return _0x46adce;};'use strict';var BPromise=require(_0xa956('0x0'));var _=require(_0xa956('0x1'));var moment=require(_0xa956('0x2'));var util=require(_0xa956('0x3'));var path=require('path');var Redis=require(_0xa956('0x4'));var config=require(_0xa956('0x5'));var logger=require(_0xa956('0x6'))(_0xa956('0x7'));var ami=require(_0xa956('0x8'));var Channel=require(_0xa956('0x9'));var RpcSetting=require(_0xa956('0xa'));var statusDesc=[_0xa956('0xb'),_0xa956('0xc'),_0xa956('0xd'),_0xa956('0xe'),_0xa956('0xf'),'unavailable',_0xa956('0x10'),_0xa956('0x11'),_0xa956('0x12')];var applications=['set',_0xa956('0x13'),'agi',_0xa956('0x14'),'playback','voicemail'];var dispositions=[_0xa956('0x15'),_0xa956('0x16'),_0xa956('0x16'),'NO\x20ANSWER',_0xa956('0x15'),_0xa956('0x15'),_0xa956('0x17'),'BUSY',_0xa956('0x16'),'FAILED',_0xa956('0x16')];var actions={};config['redis']=_[_0xa956('0x18')](config[_0xa956('0x19')],{'host':_0xa956('0x1a'),'port':0x18eb});var io=require(_0xa956('0x1b'))(new Redis(config[_0xa956('0x19')]));function VoiceCallReport(_0xc95454){this['channels']=_0xc95454[_0xa956('0x1c')];this[_0xa956('0x1d')]=_0xc95454[_0xa956('0x1d')];this[_0xa956('0x1e')]={};ami['on'](_0xa956('0x1f'),this['syncNewExten'][_0xa956('0x20')](this));ami['on']('newexten',this['syncNewExten'][_0xa956('0x20')](this));ami['on'](_0xa956('0x21'),this['syncNewChannel'][_0xa956('0x20')](this));ami['on']('newstate',this[_0xa956('0x22')]['bind'](this));ami['on'](_0xa956('0x23'),this[_0xa956('0x24')][_0xa956('0x20')](this));ami['on'](_0xa956('0x25'),this[_0xa956('0x26')]['bind'](this));ami['on'](_0xa956('0x27'),this[_0xa956('0x28')]['bind'](this));ami['on'](_0xa956('0x29'),this[_0xa956('0x2a')]['bind'](this));ami['on'](_0xa956('0x2b'),this['syncBlindTransfer'][_0xa956('0x20')](this));ami['on'](_0xa956('0x2c'),this['syncMusicOnHoldStart'][_0xa956('0x20')](this));ami['on']('musiconholdstop',this[_0xa956('0x2d')][_0xa956('0x20')](this));try{logger[_0xa956('0x2e')](_0xa956('0x2f'));ami[_0xa956('0x30')]();}catch(_0x29ace0){logger[_0xa956('0x31')](_0xa956('0x32'),util[_0xa956('0x33')](_0x29ace0,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xa956('0x34')][_0xa956('0x35')]=function(_0x401a44){return _0x401a44!==null&&!_[_0xa956('0x36')](_0x401a44);};VoiceCallReport[_0xa956('0x34')][_0xa956('0x37')]=function(_0x29510d,_0x4a4c1a,_0x41223b){io['to'](_0x29510d)[_0xa956('0x37')](_0x4a4c1a,_0x41223b);};VoiceCallReport['prototype'][_0xa956('0x28')]=function(_0x4393bc){try{if(this[_0xa956('0x35')](_0x4393bc)){logger[_0xa956('0x2e')](_0xa956('0x38'),_0x4393bc[_0xa956('0x39')],_0x4393bc['calleridname'],_0x4393bc['calleridnum']);logger['debug'](_0xa956('0x3a'),_0x4393bc['uniqueid'],util['inspect'](_0x4393bc,{'showHidden':![],'depth':null}));if(_0x4393bc[_0xa956('0x39')]===_0x4393bc['linkedid']){if(!_['isUndefined'](this['channels'][_0x4393bc[_0xa956('0x39')]])){_[_0xa956('0x3b')](this['channels'][_0x4393bc[_0xa956('0x39')]],_[_0xa956('0x3c')](_0x4393bc,_[_0xa956('0x3d')](this[_0xa956('0x1c')][_0x4393bc[_0xa956('0x39')]])));}}if(_0x4393bc[_0xa956('0x3e')]===_0xa956('0x3f')){if(this[_0xa956('0x1d')][_0x4393bc[_0xa956('0x40')]['split']('-')[0x0]]){if(_0x4393bc['exten']=='xcally-motion-preview'){this[_0xa956('0x1d')][_0x4393bc['channel'][_0xa956('0x41')]('-')[0x0]][_0xa956('0x42')]=_0x4393bc[_0xa956('0x43')];this[_0xa956('0x37')](util[_0xa956('0x44')]('user:%s',this[_0xa956('0x1d')][_0x4393bc[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]][_0xa956('0x45')]),_0xa956('0x46'),{'destaccountcode':this[_0xa956('0x1d')][_0x4393bc[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]][_0xa956('0x47')],'destconnectedlinenum':_0x4393bc['connectedlinenum']});}}}}}catch(_0x239fc3){logger[_0xa956('0x31')]('[%s][voiceCallReport][newcallerid]',_0x4393bc['uniqueid'],util[_0xa956('0x33')](_0x239fc3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa956('0x34')][_0xa956('0x48')]=function(_0x2f66ab){try{if(this['isNotNull'](_0x2f66ab)){logger[_0xa956('0x49')](_0xa956('0x4a'),_0x2f66ab[_0xa956('0x39')],util[_0xa956('0x33')](_0x2f66ab,{'showHidden':![],'depth':null}));if(_0x2f66ab[_0xa956('0x39')]===_0x2f66ab[_0xa956('0x4b')]&&_0x2f66ab['channel']!=_0xa956('0x4c')){if(_['isUndefined'](this[_0xa956('0x1c')][_0x2f66ab[_0xa956('0x39')]])){logger[_0xa956('0x2e')](_0xa956('0x4d'),_0x2f66ab[_0xa956('0x39')],_0x2f66ab['context'],_0x2f66ab[_0xa956('0x4e')]);this[_0xa956('0x1c')][_0x2f66ab[_0xa956('0x39')]]=new Channel();this[_0xa956('0x1c')][_0x2f66ab[_0xa956('0x39')]][_0xa956('0x4f')]=moment()[_0xa956('0x44')](_0xa956('0x50'));this[_0xa956('0x1c')][_0x2f66ab[_0xa956('0x39')]][_0xa956('0x51')]=dispositions[_[_0xa956('0x52')](_0x2f66ab['channelstate'])];_['merge'](this['channels'][_0x2f66ab['uniqueid']],_[_0xa956('0x3c')](_0x2f66ab,_['keys'](this[_0xa956('0x1c')][_0x2f66ab[_0xa956('0x39')]])));if(_0x2f66ab['context']===_0xa956('0x3f')){if(this['agents'][_0x2f66ab[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]]){if(_[_0xa956('0x36')](this[_0xa956('0x1d')][_0x2f66ab[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]][_0xa956('0x42')])){this[_0xa956('0x1d')][_0x2f66ab[_0xa956('0x40')]['split']('-')[0x0]][_0xa956('0x42')]=_0x2f66ab['exten'];logger[_0xa956('0x49')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x2f66ab[_0xa956('0x39')],util[_0xa956('0x33')]({'destaccountcode':this['agents'][_0x2f66ab[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]][_0xa956('0x47')],'destconnectedlinenum':_0x2f66ab[_0xa956('0x4e')]},{'showHidden':![],'depth':null}));this[_0xa956('0x37')](util[_0xa956('0x44')](_0xa956('0x53'),this['agents'][_0x2f66ab[_0xa956('0x40')]['split']('-')[0x0]][_0xa956('0x45')]),_0xa956('0x46'),{'destaccountcode':this[_0xa956('0x1d')][_0x2f66ab['channel'][_0xa956('0x41')]('-')[0x0]][_0xa956('0x47')],'destconnectedlinenum':_0x2f66ab['exten']});}}}}}}}catch(_0x27b7ba){logger[_0xa956('0x31')](_0xa956('0x54'),_0x2f66ab[_0xa956('0x39')],util[_0xa956('0x33')](_0x27b7ba,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa956('0x34')]['syncNewExten']=function(_0x26202d){try{if(this[_0xa956('0x35')](_0x26202d)){logger['debug'](_0xa956('0x55'),_0x26202d['uniqueid'],util[_0xa956('0x33')](_0x26202d,{'showHidden':![],'depth':null}));if(_0x26202d['uniqueid']===_0x26202d[_0xa956('0x4b')]&&_0x26202d[_0xa956('0x4e')]!='h'&&_0x26202d[_0xa956('0x40')]!='OutgoingSpoolFailed'){_0x26202d[_0xa956('0x56')]=_0x26202d[_0xa956('0x56')][_0xa956('0x57')]();_0x26202d['applicationdata']=_0x26202d['appdata']&&_0x26202d[_0xa956('0x58')][_0xa956('0x59')](_0xa956('0x5a'))?_0x26202d[_0xa956('0x58')]:(_0x26202d['appdata']||_0x26202d[_0xa956('0x5b')])[_0xa956('0x57')]();logger[_0xa956('0x2e')](_0xa956('0x5c'),_0x26202d[_0xa956('0x39')],_0x26202d[_0xa956('0x56')],_0x26202d['applicationdata']);if(_[_0xa956('0x36')](this[_0xa956('0x1c')][_0x26202d[_0xa956('0x39')]])){this[_0xa956('0x1c')][_0x26202d[_0xa956('0x39')]]=new Channel();this[_0xa956('0x1c')][_0x26202d[_0xa956('0x39')]]['starttime']=_0x26202d[_0xa956('0x5d')]?moment()[_0xa956('0x5e')](moment[_0xa956('0x5d')](_0x26202d[_0xa956('0x5d')])[_0xa956('0x5f')](),_0xa956('0x5f'))[_0xa956('0x44')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xa956('0x44')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa956('0x1c')][_0x26202d[_0xa956('0x39')]][_0xa956('0x51')]=_0xa956('0x15');}_[_0xa956('0x3b')](this['channels'][_0x26202d[_0xa956('0x39')]],_[_0xa956('0x3c')](_0x26202d,_[_0xa956('0x3d')](this[_0xa956('0x1c')][_0x26202d['uniqueid']])));if(_[_0xa956('0x60')](applications,_0x26202d[_0xa956('0x56')])){this[_0xa956('0x1c')][_0x26202d[_0xa956('0x39')]][_0xa956('0x61')]=_0x26202d[_0xa956('0x56')];this[_0xa956('0x1c')][_0x26202d[_0xa956('0x39')]][_0xa956('0x62')]=_0x26202d[_0xa956('0x5b')];if(_0x26202d[_0xa956('0x56')]==='set'&&_[_0xa956('0x59')](_0x26202d[_0xa956('0x5b')][_0xa956('0x57')](),'cdr(')){var _0x39a1b4=_0x26202d[_0xa956('0x5b')][_0xa956('0x41')]('=');var _0xcb25e7=_0x39a1b4[0x0][_0xa956('0x57')]()[_0xa956('0x63')](/cdr\((.*)\)/);if(_0xcb25e7){this[_0xa956('0x1c')][_0x26202d[_0xa956('0x39')]][_0xcb25e7[0x1]]=_0x39a1b4[0x1];}}else if(_0x26202d[_0xa956('0x56')]==='queue'){this[_0xa956('0x1c')][_0x26202d[_0xa956('0x39')]]['queue']=_0x26202d[_0xa956('0x5b')]['split'](',')[0x0];}}}}}catch(_0x418494){logger[_0xa956('0x31')]('[%s][voiceCallReport][newexten]',_0x26202d['uniqueid'],util[_0xa956('0x33')](_0x418494,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa956('0x34')][_0xa956('0x22')]=function(_0x162aca){try{if(this[_0xa956('0x35')](_0x162aca)){logger[_0xa956('0x2e')](_0xa956('0x64'),_0x162aca[_0xa956('0x39')],_0x162aca[_0xa956('0x4b')],_0x162aca[_0xa956('0x65')],_0x162aca[_0xa956('0x66')]);logger[_0xa956('0x49')](_0xa956('0x67'),_0x162aca['uniqueid'],util['inspect'](_0x162aca,{'showHidden':![],'depth':null}));if(_0x162aca[_0xa956('0x39')]!==_0x162aca[_0xa956('0x4b')]){if(this[_0xa956('0x1c')][_0x162aca['linkedid']]){if(_0x162aca['channelstate']==='6'){if(!this[_0xa956('0x1c')][_0x162aca[_0xa956('0x4b')]]['answered']){var _0x465ed8=moment();this[_0xa956('0x1c')][_0x162aca[_0xa956('0x4b')]][_0xa956('0x68')]=!![];this[_0xa956('0x1c')][_0x162aca['linkedid']][_0xa956('0x69')]=_0x465ed8[_0xa956('0x44')](_0xa956('0x50'));if(this[_0xa956('0x1c')][_0x162aca[_0xa956('0x4b')]]['starttime']){this[_0xa956('0x1c')][_0x162aca['linkedid']]['holdtime']=_0x465ed8[_0xa956('0x6a')](this[_0xa956('0x1c')][_0x162aca['linkedid']]['starttime'],_0xa956('0x5f'));}}this[_0xa956('0x1c')][_0x162aca['linkedid']][_0xa956('0x4b')]=_0x162aca['uniqueid'];if(_0x162aca[_0xa956('0x66')]!==_0xa956('0x6b')){this['channels'][_0x162aca[_0xa956('0x4b')]][_0xa956('0x43')]=_0x162aca[_0xa956('0x66')];}this[_0xa956('0x1c')][_0x162aca[_0xa956('0x4b')]][_0xa956('0x6c')]=_0x162aca[_0xa956('0x65')];this['channels'][_0x162aca[_0xa956('0x4b')]]['destinationchannel']=_0x162aca['channel'];this[_0xa956('0x1c')][_0x162aca[_0xa956('0x4b')]][_0xa956('0x51')]=dispositions[_['toNumber'](_0x162aca['channelstate'])];if(this[_0xa956('0x1d')][_0x162aca[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]]){this[_0xa956('0x1c')][_0x162aca[_0xa956('0x4b')]][_0xa956('0x6d')]=this[_0xa956('0x1d')][_0x162aca[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]]['id'];this['channels'][_0x162aca[_0xa956('0x4b')]][_0xa956('0x6e')]=this[_0xa956('0x1d')][_0x162aca[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]]['name'];}}}}else{if(this[_0xa956('0x1c')][_0x162aca[_0xa956('0x39')]]){if(_0x162aca[_0xa956('0x6f')]==='6'){if(this['agents'][_0x162aca[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]]){this[_0xa956('0x1c')][_0x162aca[_0xa956('0x39')]][_0xa956('0x6d')]=this[_0xa956('0x1d')][_0x162aca['channel'][_0xa956('0x41')]('-')[0x0]]['id'];this[_0xa956('0x1c')][_0x162aca['uniqueid']][_0xa956('0x6e')]=this[_0xa956('0x1d')][_0x162aca[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]]['name'];}}}}if(_0x162aca[_0xa956('0x6f')]==='6'&&_0x162aca['context']===_0xa956('0x3f')){if(this[_0xa956('0x1d')][_0x162aca[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]]){this[_0xa956('0x1d')][_0x162aca[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]]['destconnectedlinenum']=_0x162aca[_0xa956('0x4e')];var _0x24dcdc;if(this[_0xa956('0x1c')][_0x162aca['uniqueid']])_0x24dcdc=this[_0xa956('0x1c')][_0x162aca[_0xa956('0x39')]][_0xa956('0x70')];else if(this[_0xa956('0x1c')][_0x162aca['linkedid']])_0x24dcdc=this['channels'][_0x162aca[_0xa956('0x4b')]][_0xa956('0x70')];logger['debug'](_0xa956('0x71'),_0x162aca['uniqueid'],util['inspect']({'destaccountcode':this[_0xa956('0x1d')][_0x162aca[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x162aca['exten'],'routealias':_0x24dcdc},{'showHidden':![],'depth':null}));this['emit'](util[_0xa956('0x44')](_0xa956('0x53'),this[_0xa956('0x1d')][_0x162aca[_0xa956('0x40')]['split']('-')[0x0]][_0xa956('0x45')]),'user:agentconnect',{'destaccountcode':this[_0xa956('0x1d')][_0x162aca[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x162aca[_0xa956('0x4e')],'routealias':_0x24dcdc});}}}}catch(_0x2d3c61){logger[_0xa956('0x31')]('[%s][voiceCallReport][newstate]',_0x162aca[_0xa956('0x39')],util['inspect'](_0x2d3c61,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa956('0x34')][_0xa956('0x72')]=function(_0x3495ba,_0x5833a0){try{if(this['channels'][_0x3495ba]){logger[_0xa956('0x2e')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x3495ba,_0x5833a0);this[_0xa956('0x1c')][_0x3495ba][_0xa956('0x73')]=!![];if(_[_0xa956('0x74')](_0x5833a0,_0xa956('0x75'))){_0x5833a0=_0x5833a0[_0xa956('0x76')](_0xa956('0x75'),_0xa956('0x77'));}this[_0xa956('0x1c')][_0x3495ba][_0xa956('0x78')]=_0x5833a0;var _0x476426=_[_0xa956('0x79')](this[_0xa956('0x1c')][_0x3495ba][_0xa956('0x7a')],{'filename':_0x5833a0});if(_[_0xa956('0x7b')](_0x476426)){this['channels'][_0x3495ba][_0xa956('0x7a')][_0xa956('0x7c')]({'filename':_0x5833a0,'createdAt':moment()['format'](_0xa956('0x50')),'mixmonitorid':'','status':'rec'});}}}catch(_0x394bd2){logger[_0xa956('0x31')](_0xa956('0x7d'),_0x3495ba,util['inspect'](_0x394bd2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa956('0x34')][_0xa956('0x24')]=function(_0x131ac7){try{if(this['isNotNull'](_0x131ac7)){logger[_0xa956('0x49')](_0xa956('0x7e'),_0x131ac7[_0xa956('0x39')],util['inspect'](_0x131ac7,{'showHidden':![],'depth':null}));if(this[_0xa956('0x1c')][_0x131ac7['uniqueid']]&&_0x131ac7[_0xa956('0x40')]!=_0xa956('0x4c')){if(this[_0xa956('0x35')](_0x131ac7[_0xa956('0x7f')])){if(this[_0xa956('0x35')](_0x131ac7[_0xa956('0x7f')][_0xa956('0x80')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x131ac7[_0xa956('0x39')],_0x131ac7[_0xa956('0x81')]);this[_0xa956('0x72')](_0x131ac7[_0xa956('0x39')],_0x131ac7['value']);}else if(this[_0xa956('0x35')](_0x131ac7[_0xa956('0x7f')][_0xa956('0x82')])){logger[_0xa956('0x2e')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x131ac7[_0xa956('0x39')],_0x131ac7[_0xa956('0x81')]);this[_0xa956('0x1c')][_0x131ac7[_0xa956('0x39')]][_0xa956('0x66')]=_0x131ac7[_0xa956('0x81')];}else if(this[_0xa956('0x35')](_0x131ac7[_0xa956('0x7f')][_0xa956('0x83')])){logger[_0xa956('0x2e')](_0xa956('0x84'),_0x131ac7['uniqueid'],_0x131ac7[_0xa956('0x81')]);this[_0xa956('0x1c')][_0x131ac7['uniqueid']][_0xa956('0x85')]=_0x131ac7['value'];}else if(this[_0xa956('0x35')](_0x131ac7[_0xa956('0x7f')][_0xa956('0x86')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x131ac7[_0xa956('0x39')],_0x131ac7[_0xa956('0x81')]);this[_0xa956('0x1c')][_0x131ac7[_0xa956('0x39')]]['type']=_0x131ac7[_0xa956('0x81')];}else if(this[_0xa956('0x35')](_0x131ac7[_0xa956('0x7f')]['xmd-queue'])){logger[_0xa956('0x2e')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x131ac7[_0xa956('0x39')],_0x131ac7['value'][_0xa956('0x41')](',')[0x0]);this[_0xa956('0x1c')][_0x131ac7['uniqueid']]['queue']=_0x131ac7[_0xa956('0x81')]['split'](',')[0x0];}else if(this[_0xa956('0x35')](_0x131ac7['variable'][_0xa956('0x87')])){logger[_0xa956('0x2e')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x131ac7[_0xa956('0x39')],_0x131ac7[_0xa956('0x81')]);this['channels'][_0x131ac7[_0xa956('0x39')]][_0xa956('0x88')]=_0x131ac7[_0xa956('0x81')];}else if(this[_0xa956('0x35')](_0x131ac7[_0xa956('0x7f')]['xmd-destination'])){logger[_0xa956('0x2e')](_0xa956('0x89'),_0x131ac7[_0xa956('0x39')],_0x131ac7['value']);this['channels'][_0x131ac7['uniqueid']][_0xa956('0x8a')]=_0x131ac7['value'];}else if(this['isNotNull'](_0x131ac7[_0xa956('0x7f')][_0xa956('0x8b')])){logger['info'](_0xa956('0x8c'),_0x131ac7['uniqueid'],_0x131ac7[_0xa956('0x81')]);this[_0xa956('0x1c')][_0x131ac7['uniqueid']][_0xa956('0x8d')]=_0x131ac7[_0xa956('0x81')];}else if(this[_0xa956('0x35')](_0x131ac7[_0xa956('0x7f')]['xmcs-queue'])){logger[_0xa956('0x2e')](_0xa956('0x8e'),_0x131ac7[_0xa956('0x39')],_0x131ac7['value']);this[_0xa956('0x1c')][_0x131ac7[_0xa956('0x39')]]['queue']=_0x131ac7[_0xa956('0x81')];}else if(this['isNotNull'](_0x131ac7[_0xa956('0x7f')][_0xa956('0x8f')])){logger[_0xa956('0x2e')](_0xa956('0x90'),_0x131ac7[_0xa956('0x39')],_0x131ac7[_0xa956('0x81')]);this[_0xa956('0x1c')][_0x131ac7[_0xa956('0x39')]]['sipcalluniqueid']=_0x131ac7[_0xa956('0x81')];}}}else if(this['isNotNull'](_0x131ac7[_0xa956('0x7f')]['mixmonitor_filename'])){if(_0x131ac7[_0xa956('0x81')]){var _0x374372=path[_0xa956('0x91')](_0x131ac7[_0xa956('0x81')])[_0xa956('0x45')];logger['info'](_0xa956('0x92'),_0x374372,_0x131ac7[_0xa956('0x81')]);this['syncMixMonitorFilename'](_0x374372,_0x131ac7[_0xa956('0x81')]);}}else if(this[_0xa956('0x1c')][_0x131ac7[_0xa956('0x4b')]]){if(this[_0xa956('0x35')](_0x131ac7[_0xa956('0x7f')])){if(this['isNotNull'](_0x131ac7[_0xa956('0x7f')][_0xa956('0x8f')])){logger['info'](_0xa956('0x90'),_0x131ac7['linkedid'],_0x131ac7['value']);this[_0xa956('0x1c')][_0x131ac7[_0xa956('0x4b')]][_0xa956('0x93')]=_0x131ac7[_0xa956('0x81')];}}}}}catch(_0x3b0c03){logger[_0xa956('0x31')](_0xa956('0x94'),_0x131ac7['uniqueid'],util[_0xa956('0x33')](_0x3b0c03,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa956('0x34')][_0xa956('0x26')]=function(_0x28b2a6){try{if(this[_0xa956('0x35')](_0x28b2a6)){logger[_0xa956('0x49')](_0xa956('0x95'),_0x28b2a6[_0xa956('0x39')],util[_0xa956('0x33')](_0x28b2a6,{'showHidden':![],'depth':null}));if(this[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]]){logger['info'](_0xa956('0x96'),_0x28b2a6[_0xa956('0x39')],_0x28b2a6[_0xa956('0x97')]);var _0x2baecb=moment();this[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]][_0xa956('0x98')]=_0x2baecb[_0xa956('0x44')](_0xa956('0x50'));this['channels'][_0x28b2a6[_0xa956('0x39')]][_0xa956('0x5d')]=_0x2baecb[_0xa956('0x6a')](this[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]][_0xa956('0x4f')],'seconds');if(this['channels'][_0x28b2a6[_0xa956('0x39')]][_0xa956('0x68')]){this['channels'][_0x28b2a6[_0xa956('0x39')]][_0xa956('0x99')]=_0x2baecb[_0xa956('0x6a')](this[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]][_0xa956('0x69')],_0xa956('0x5f'));this[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]][_0xa956('0x9a')]=this[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]]['duration']-this[_0xa956('0x1c')][_0x28b2a6['uniqueid']][_0xa956('0x99')];}if(_0x28b2a6[_0xa956('0x3e')]===_0xa956('0x3f')){if(this[_0xa956('0x1d')][_0x28b2a6[_0xa956('0x40')]['split']('-')[0x0]]){this[_0xa956('0x1d')][_0x28b2a6[_0xa956('0x40')]['split']('-')[0x0]]=_[_0xa956('0x9b')](this[_0xa956('0x1d')][_0x28b2a6[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]],['destconnectedlinenum']);logger[_0xa956('0x49')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x28b2a6['uniqueid'],util[_0xa956('0x33')]({'id':this[_0xa956('0x1d')][_0x28b2a6['channel'][_0xa956('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0xa956('0x1d')][_0x28b2a6[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]][_0xa956('0x47')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xa956('0x44')](_0xa956('0x53'),this[_0xa956('0x1d')][_0x28b2a6[_0xa956('0x40')][_0xa956('0x41')]('-')[0x0]][_0xa956('0x45')]),'user:agentcomplete',{'id':this['agents'][_0x28b2a6[_0xa956('0x40')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xa956('0x1d')][_0x28b2a6['channel'][_0xa956('0x41')]('-')[0x0]][_0xa956('0x47')]});}}var _0xce9bd7=this;Promise['resolve']()['then'](function(){var _0x417d12=_0xce9bd7['channels'][_0x28b2a6['uniqueid']];if(typeof _0x417d12['transferType']==='undefined')return;if(_[_0xa956('0x9c')](_0x417d12[_0xa956('0x7a')]))return;return RpcSetting[_0xa956('0x9d')]()[_0xa956('0x9e')](function(_0x4f8369){if(!_0x4f8369[_0xa956('0x9f')])return;return Promise[_0xa956('0xa0')]()[_0xa956('0x9e')](function(){return ami[_0xa956('0xa1')]({'action':_0xa956('0xa2'),'channel':_0x417d12['channel']})[_0xa956('0xa3')](function(){});})[_0xa956('0x9e')](function(){return ami[_0xa956('0xa1')]({'action':_0xa956('0xa2'),'channel':_0x417d12[_0xa956('0xa4')]})[_0xa956('0xa3')](function(){})[_0xa956('0xa5')](function(){var _0x1a6cea=_0xce9bd7['agents'][_0x417d12['destinationchannel'][_0xa956('0x41')]('-')[0x0]];if(!_0x1a6cea)return;io[_0xa956('0x37')](_0xa956('0xa6'),{'agentId':_0x1a6cea['id'],'uniqueid':_0x417d12[_0xa956('0x39')]});});});});})[_0xa956('0x9e')](function(){if(_0x28b2a6[_0xa956('0xa7')]===_0xa956('0xa8')){_0xce9bd7['blindTransfers'][_0x28b2a6[_0xa956('0x39')]]=_0xce9bd7[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]];}else{if(_0xce9bd7[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]][_0xa956('0xa9')]==='outbound'&&_0xce9bd7[_0xa956('0x1e')][_0x28b2a6['uniqueid']]){_0xce9bd7[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]][_0xa956('0x39')]=[_0xce9bd7[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]]['linkedid'],_0xce9bd7[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]][_0xa956('0x4b')]=_0xce9bd7['channels'][_0x28b2a6[_0xa956('0x39')]][_0xa956('0x39')]][0x0];delete _0xce9bd7[_0xa956('0x1e')][_0x28b2a6[_0xa956('0x39')]];}}logger['debug'](_0xa956('0xaa'),_0x28b2a6[_0xa956('0x39')],util[_0xa956('0x33')](_0xce9bd7[_0xa956('0x1c')][_0x28b2a6[_0xa956('0x39')]],{'showHidden':![],'depth':null}));ami[_0xa956('0x37')]('custom:voiceCallReport',_0xce9bd7[_0xa956('0x1c')][_0x28b2a6['uniqueid']]);delete _0xce9bd7[_0xa956('0x1c')][_0x28b2a6['uniqueid']];});}}}catch(_0x2a661c){logger['error'](_0xa956('0xab'),_0x28b2a6[_0xa956('0x39')],util[_0xa956('0x33')](_0x2a661c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa956('0x34')][_0xa956('0x2a')]=function(_0x2ee82f){try{if(this['isNotNull'](_0x2ee82f)){logger[_0xa956('0x2e')](_0xa956('0xac'),_0x2ee82f[_0xa956('0x39')],_0x2ee82f['origtransferercalleridnum'],_0x2ee82f['transfertargetcalleridnum']);logger[_0xa956('0x49')](_0xa956('0xad'),_0x2ee82f[_0xa956('0x39')],util[_0xa956('0x33')](_0x2ee82f,{'showHidden':![],'depth':null}));if(this['channels'][_0x2ee82f[_0xa956('0xae')]]){this['channels'][_0x2ee82f[_0xa956('0xae')]][_0xa956('0xaf')]=_0x2ee82f[_0xa956('0xb0')];this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xae')]][_0xa956('0xb1')]=_0x2ee82f['transfertargetcalleridnum'];if(this['channels'][_0x2ee82f[_0xa956('0xb2')]]){var _0x1c098a=this[_0xa956('0x1c')][_0x2ee82f['secondtransfereruniqueid']];this['channels'][_0x2ee82f['secondtransfereruniqueid']]=this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xae')]];this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xae')]]=_0x1c098a;}}else if(this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb3')]]){this['channels'][_0x2ee82f[_0xa956('0xb3')]]['transfercalleridnum']=_0x2ee82f[_0xa956('0xb0')];this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb3')]][_0xa956('0xb1')]=_0x2ee82f[_0xa956('0xb4')];if(this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb5')]]){var _0x1c098a=this[_0xa956('0x1c')][_0x2ee82f['origtransfereruniqueid']];this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb5')]]=this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb3')]];this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb3')]]=_0x1c098a;}}if((this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb5')]]||this['channels'][_0x2ee82f[_0xa956('0xb6')]])&&this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb2')]]){var _0x3592f8=_[_0xa956('0xb7')]([this[_0xa956('0x1c')][_0x2ee82f['origtransfereruniqueid']],this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb6')]],this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb2')]]],function(_0x385b66){return _0x385b66&&_0x385b66[_0xa956('0xa9')]===_0xa956('0xb8')&&_0x385b66[_0xa956('0xb9')];});if(_0x3592f8){if(this[_0xa956('0x1c')][_0x2ee82f['origtransfereruniqueid']])this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb5')]][_0xa956('0xba')]=_0xa956('0xbb');if(this[_0xa956('0x1c')][_0x2ee82f[_0xa956('0xb6')]])this['channels'][_0x2ee82f[_0xa956('0xb6')]][_0xa956('0xba')]=_0xa956('0xbb');this[_0xa956('0x1c')][_0x2ee82f['secondtransfereruniqueid']]['transferType']=_0xa956('0xbb');}}}}catch(_0x452e43){logger['error'](_0xa956('0xbc'),_0x2ee82f[_0xa956('0x39')],util[_0xa956('0x33')](_0x452e43,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa956('0x34')][_0xa956('0xbd')]=function(_0x4da466){try{if(this[_0xa956('0x35')](_0x4da466)){logger[_0xa956('0x2e')](_0xa956('0xbe'),_0x4da466[_0xa956('0x39')],_0x4da466[_0xa956('0xbf')],_0x4da466['extension']);logger[_0xa956('0x49')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x4da466[_0xa956('0x39')],util['inspect'](_0x4da466,{'showHidden':![],'depth':null}));if(this[_0xa956('0x1c')][_0x4da466[_0xa956('0xae')]]){this['channels'][_0x4da466[_0xa956('0xae')]][_0xa956('0xaf')]=_0x4da466[_0xa956('0xbf')];this[_0xa956('0x1c')][_0x4da466[_0xa956('0xae')]][_0xa956('0xb1')]=_0x4da466[_0xa956('0xc0')];this[_0xa956('0x1c')][_0x4da466[_0xa956('0xae')]][_0xa956('0xba')]=_0xa956('0xc1');this[_0xa956('0x26')]({'event':_0xa956('0xa8'),'uniqueid':_0x4da466[_0xa956('0xae')],'context':_0x4da466[_0xa956('0x3e')],'channel':_0x4da466[_0xa956('0xc2')]});}else{this[_0xa956('0x1c')][_0x4da466[_0xa956('0xc3')]][_0xa956('0xba')]=_0xa956('0xc1');}}}catch(_0xac3da8){logger[_0xa956('0x31')](_0xa956('0xc4'),_0x4da466[_0xa956('0x39')],util[_0xa956('0x33')](_0xac3da8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa956('0x34')][_0xa956('0xc5')]=function(_0x1c9b6f){try{if(this[_0xa956('0x35')](_0x1c9b6f)){logger[_0xa956('0x49')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x1c9b6f[_0xa956('0x39')],util[_0xa956('0x33')](_0x1c9b6f,{'showHidden':![],'depth':null}));if(this[_0xa956('0x1c')][_0x1c9b6f[_0xa956('0x39')]]){if(!_['isNil'](this[_0xa956('0x1c')][_0x1c9b6f[_0xa956('0x39')]]['answertime'])){this[_0xa956('0x1c')][_0x1c9b6f['uniqueid']][_0xa956('0xc6')]=moment()[_0xa956('0x44')](_0xa956('0x50'));logger[_0xa956('0x2e')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x1c9b6f[_0xa956('0x39')],this[_0xa956('0x1c')][_0x1c9b6f['uniqueid']][_0xa956('0xc6')]);}}}}catch(_0x117b57){logger[_0xa956('0x31')](_0xa956('0xc7'),_0x1c9b6f[_0xa956('0x39')],util[_0xa956('0x33')](_0x117b57,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa956('0x34')][_0xa956('0x2d')]=function(_0x4ddc88){try{if(this[_0xa956('0x35')](_0x4ddc88)){logger[_0xa956('0x49')](_0xa956('0xc8'),_0x4ddc88[_0xa956('0x39')],util['inspect'](_0x4ddc88,{'showHidden':![],'depth':null}));if(this[_0xa956('0x1c')][_0x4ddc88['uniqueid']]){if(!_[_0xa956('0x7b')](this['channels'][_0x4ddc88[_0xa956('0x39')]][_0xa956('0xc6')])){this[_0xa956('0x1c')][_0x4ddc88[_0xa956('0x39')]]['mohtime']+=moment()[_0xa956('0xc9')](0x0)['diff'](this[_0xa956('0x1c')][_0x4ddc88['uniqueid']][_0xa956('0xc6')],_0xa956('0x5f'));logger[_0xa956('0x2e')](_0xa956('0xca'),_0x4ddc88['uniqueid'],this[_0xa956('0x1c')][_0x4ddc88[_0xa956('0x39')]][_0xa956('0xcb')]);delete this[_0xa956('0x1c')][_0x4ddc88[_0xa956('0x39')]][_0xa956('0xc6')];}}}}catch(_0x8d3174){logger[_0xa956('0x31')](_0xa956('0xcc'),_0x4ddc88[_0xa956('0x39')],util[_0xa956('0x33')](_0x8d3174,{'showHidden':![],'depth':null}));}};module[_0xa956('0xcd')]=VoiceCallReport;
\ No newline at end of file
+var _0xa959=['startsWith','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20event:','answered','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','monitorFilename','find','monitors','isNil','push','[%s][voiceCallReport][varset]\x20event:','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','variable','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcalluniqueid','parse','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','syncHangup','[%s][voiceCallReport][hangup]\x20reason:%s','diff','holdtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','undefined','isEmpty','getSettings','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','BlindTransfer','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetcalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','transferType','ATTENDED','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','extension','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','answertime','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','bluebird','lodash','path','ioredis','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','blindTransfers','coreshowchannel','bind','newexten','syncNewExten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','OutgoingSpoolFailed','info','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','pick','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','subtract','duration','seconds','includes','lastapplication','lastdata'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xa959,0x1ef));var _0x9a95=function(_0x21d94d,_0x204a39){_0x21d94d=_0x21d94d-0x0;var _0x3c7d34=_0xa959[_0x21d94d];return _0x3c7d34;};'use strict';var BPromise=require(_0x9a95('0x0'));var _=require(_0x9a95('0x1'));var moment=require('moment');var util=require('util');var path=require(_0x9a95('0x2'));var Redis=require(_0x9a95('0x3'));var config=require('../../../config/environment');var logger=require(_0x9a95('0x4'))(_0x9a95('0x5'));var ami=require(_0x9a95('0x6'));var Channel=require(_0x9a95('0x7'));var RpcSetting=require(_0x9a95('0x8'));var statusDesc=[_0x9a95('0x9'),_0x9a95('0xa'),_0x9a95('0xb'),_0x9a95('0xc'),_0x9a95('0xd'),'unavailable',_0x9a95('0xe'),_0x9a95('0xf'),'onhold'];var applications=[_0x9a95('0x10'),_0x9a95('0x11'),_0x9a95('0x12'),_0x9a95('0x13'),_0x9a95('0x14'),_0x9a95('0x15')];var dispositions=[_0x9a95('0x16'),_0x9a95('0x17'),_0x9a95('0x17'),'NO\x20ANSWER',_0x9a95('0x16'),_0x9a95('0x16'),_0x9a95('0x18'),_0x9a95('0x19'),_0x9a95('0x17'),_0x9a95('0x17'),_0x9a95('0x17')];var actions={};config[_0x9a95('0x1a')]=_[_0x9a95('0x1b')](config['redis'],{'host':_0x9a95('0x1c'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9a95('0x1a')]));function VoiceCallReport(_0x39de82){this[_0x9a95('0x1d')]=_0x39de82[_0x9a95('0x1d')];this['agents']=_0x39de82[_0x9a95('0x1e')];this[_0x9a95('0x1f')]={};ami['on'](_0x9a95('0x20'),this['syncNewExten'][_0x9a95('0x21')](this));ami['on'](_0x9a95('0x22'),this[_0x9a95('0x23')][_0x9a95('0x21')](this));ami['on'](_0x9a95('0x24'),this[_0x9a95('0x25')][_0x9a95('0x21')](this));ami['on'](_0x9a95('0x26'),this[_0x9a95('0x27')][_0x9a95('0x21')](this));ami['on'](_0x9a95('0x28'),this['syncVarSet'][_0x9a95('0x21')](this));ami['on']('hangup',this['syncHangup'][_0x9a95('0x21')](this));ami['on']('newcallerid',this[_0x9a95('0x29')][_0x9a95('0x21')](this));ami['on'](_0x9a95('0x2a'),this[_0x9a95('0x2b')][_0x9a95('0x21')](this));ami['on'](_0x9a95('0x2c'),this['syncBlindTransfer']['bind'](this));ami['on'](_0x9a95('0x2d'),this[_0x9a95('0x2e')][_0x9a95('0x21')](this));ami['on']('musiconholdstop',this[_0x9a95('0x2f')][_0x9a95('0x21')](this));try{logger['info'](_0x9a95('0x30'));ami[_0x9a95('0x31')]();}catch(_0x3e85be){logger[_0x9a95('0x32')](_0x9a95('0x33'),util[_0x9a95('0x34')](_0x3e85be,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9a95('0x35')][_0x9a95('0x36')]=function(_0x51b893){return _0x51b893!==null&&!_[_0x9a95('0x37')](_0x51b893);};VoiceCallReport[_0x9a95('0x35')][_0x9a95('0x38')]=function(_0xb1bcc8,_0x50e467,_0xebf10c){io['to'](_0xb1bcc8)['emit'](_0x50e467,_0xebf10c);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x470eab){try{if(this[_0x9a95('0x36')](_0x470eab)){logger['info']('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x470eab[_0x9a95('0x39')],_0x470eab[_0x9a95('0x3a')],_0x470eab[_0x9a95('0x3b')]);logger[_0x9a95('0x3c')](_0x9a95('0x3d'),_0x470eab[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x470eab,{'showHidden':![],'depth':null}));if(_0x470eab[_0x9a95('0x39')]===_0x470eab[_0x9a95('0x3e')]){if(!_[_0x9a95('0x37')](this[_0x9a95('0x1d')][_0x470eab[_0x9a95('0x39')]])){_['merge'](this[_0x9a95('0x1d')][_0x470eab[_0x9a95('0x39')]],_['pick'](_0x470eab,_[_0x9a95('0x3f')](this['channels'][_0x470eab[_0x9a95('0x39')]])));}}if(_0x470eab[_0x9a95('0x40')]===_0x9a95('0x41')){if(this[_0x9a95('0x1e')][_0x470eab[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]]){if(_0x470eab[_0x9a95('0x44')]==_0x9a95('0x45')){this[_0x9a95('0x1e')][_0x470eab[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x46')]=_0x470eab[_0x9a95('0x47')];this[_0x9a95('0x38')](util[_0x9a95('0x48')](_0x9a95('0x49'),this[_0x9a95('0x1e')][_0x470eab['channel'][_0x9a95('0x43')]('-')[0x0]]['name']),_0x9a95('0x4a'),{'destaccountcode':this['agents'][_0x470eab[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x4b')],'destconnectedlinenum':_0x470eab[_0x9a95('0x47')]});}}}}}catch(_0x2e9786){logger[_0x9a95('0x32')](_0x9a95('0x4c'),_0x470eab[_0x9a95('0x39')],util['inspect'](_0x2e9786,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a95('0x35')][_0x9a95('0x25')]=function(_0x2f9329){try{if(this['isNotNull'](_0x2f9329)){logger[_0x9a95('0x3c')]('[%s][voiceCallReport][newchannel]\x20event:',_0x2f9329[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x2f9329,{'showHidden':![],'depth':null}));if(_0x2f9329[_0x9a95('0x39')]===_0x2f9329[_0x9a95('0x3e')]&&_0x2f9329[_0x9a95('0x42')]!=_0x9a95('0x4d')){if(_[_0x9a95('0x37')](this[_0x9a95('0x1d')][_0x2f9329[_0x9a95('0x39')]])){logger[_0x9a95('0x4e')](_0x9a95('0x4f'),_0x2f9329['uniqueid'],_0x2f9329[_0x9a95('0x40')],_0x2f9329[_0x9a95('0x44')]);this[_0x9a95('0x1d')][_0x2f9329['uniqueid']]=new Channel();this[_0x9a95('0x1d')][_0x2f9329[_0x9a95('0x39')]][_0x9a95('0x50')]=moment()[_0x9a95('0x48')](_0x9a95('0x51'));this[_0x9a95('0x1d')][_0x2f9329['uniqueid']][_0x9a95('0x52')]=dispositions[_[_0x9a95('0x53')](_0x2f9329[_0x9a95('0x54')])];_[_0x9a95('0x55')](this[_0x9a95('0x1d')][_0x2f9329[_0x9a95('0x39')]],_[_0x9a95('0x56')](_0x2f9329,_['keys'](this['channels'][_0x2f9329[_0x9a95('0x39')]])));if(_0x2f9329['context']===_0x9a95('0x41')){if(this[_0x9a95('0x1e')][_0x2f9329[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]]){if(_[_0x9a95('0x37')](this[_0x9a95('0x1e')][_0x2f9329[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x46')])){this[_0x9a95('0x1e')][_0x2f9329[_0x9a95('0x42')]['split']('-')[0x0]][_0x9a95('0x46')]=_0x2f9329[_0x9a95('0x44')];logger[_0x9a95('0x3c')](_0x9a95('0x57'),_0x2f9329[_0x9a95('0x39')],util[_0x9a95('0x34')]({'destaccountcode':this['agents'][_0x2f9329[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x4b')],'destconnectedlinenum':_0x2f9329[_0x9a95('0x44')]},{'showHidden':![],'depth':null}));this[_0x9a95('0x38')](util[_0x9a95('0x48')]('user:%s',this[_0x9a95('0x1e')][_0x2f9329['channel'][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x58')]),_0x9a95('0x4a'),{'destaccountcode':this[_0x9a95('0x1e')][_0x2f9329[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x4b')],'destconnectedlinenum':_0x2f9329[_0x9a95('0x44')]});}}}}}}}catch(_0x20c1e1){logger[_0x9a95('0x32')](_0x9a95('0x59'),_0x2f9329[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x20c1e1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a95('0x35')][_0x9a95('0x23')]=function(_0x45a99a){try{if(this[_0x9a95('0x36')](_0x45a99a)){logger[_0x9a95('0x3c')]('[%s][voiceCallReport][newexten]\x20event:',_0x45a99a[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x45a99a,{'showHidden':![],'depth':null}));if(_0x45a99a[_0x9a95('0x39')]===_0x45a99a[_0x9a95('0x3e')]&&_0x45a99a[_0x9a95('0x44')]!='h'&&_0x45a99a['channel']!='OutgoingSpoolFailed'){_0x45a99a[_0x9a95('0x5a')]=_0x45a99a['application'][_0x9a95('0x5b')]();_0x45a99a[_0x9a95('0x5c')]=_0x45a99a[_0x9a95('0x5d')]&&_0x45a99a['appdata']['startsWith'](_0x9a95('0x5e'))?_0x45a99a[_0x9a95('0x5d')]:(_0x45a99a[_0x9a95('0x5d')]||_0x45a99a['applicationdata'])[_0x9a95('0x5b')]();logger['info'](_0x9a95('0x5f'),_0x45a99a[_0x9a95('0x39')],_0x45a99a['application'],_0x45a99a['applicationdata']);if(_[_0x9a95('0x37')](this[_0x9a95('0x1d')][_0x45a99a[_0x9a95('0x39')]])){this[_0x9a95('0x1d')][_0x45a99a[_0x9a95('0x39')]]=new Channel();this[_0x9a95('0x1d')][_0x45a99a['uniqueid']][_0x9a95('0x50')]=_0x45a99a['duration']?moment()[_0x9a95('0x60')](moment['duration'](_0x45a99a[_0x9a95('0x61')])[_0x9a95('0x62')](),'seconds')[_0x9a95('0x48')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x9a95('0x48')](_0x9a95('0x51'));this[_0x9a95('0x1d')][_0x45a99a[_0x9a95('0x39')]]['disposition']=_0x9a95('0x16');}_[_0x9a95('0x55')](this[_0x9a95('0x1d')][_0x45a99a[_0x9a95('0x39')]],_[_0x9a95('0x56')](_0x45a99a,_[_0x9a95('0x3f')](this[_0x9a95('0x1d')][_0x45a99a[_0x9a95('0x39')]])));if(_[_0x9a95('0x63')](applications,_0x45a99a[_0x9a95('0x5a')])){this[_0x9a95('0x1d')][_0x45a99a['uniqueid']][_0x9a95('0x64')]=_0x45a99a[_0x9a95('0x5a')];this[_0x9a95('0x1d')][_0x45a99a['uniqueid']][_0x9a95('0x65')]=_0x45a99a['applicationdata'];if(_0x45a99a[_0x9a95('0x5a')]==='set'&&_[_0x9a95('0x66')](_0x45a99a['applicationdata'][_0x9a95('0x5b')](),_0x9a95('0x67'))){var _0x4896af=_0x45a99a[_0x9a95('0x5c')][_0x9a95('0x43')]('=');var _0x2abd39=_0x4896af[0x0][_0x9a95('0x5b')]()[_0x9a95('0x68')](/cdr\((.*)\)/);if(_0x2abd39){this[_0x9a95('0x1d')][_0x45a99a[_0x9a95('0x39')]][_0x2abd39[0x1]]=_0x4896af[0x1];}}else if(_0x45a99a['application']==='queue'){this[_0x9a95('0x1d')][_0x45a99a[_0x9a95('0x39')]]['queue']=_0x45a99a[_0x9a95('0x5c')][_0x9a95('0x43')](',')[0x0];}}}}}catch(_0x5a7851){logger[_0x9a95('0x32')](_0x9a95('0x69'),_0x45a99a[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x5a7851,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a95('0x35')][_0x9a95('0x27')]=function(_0xa2464d){try{if(this[_0x9a95('0x36')](_0xa2464d)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0xa2464d['uniqueid'],_0xa2464d['linkedid'],_0xa2464d['calleridname'],_0xa2464d[_0x9a95('0x3b')]);logger['debug'](_0x9a95('0x6a'),_0xa2464d[_0x9a95('0x39')],util[_0x9a95('0x34')](_0xa2464d,{'showHidden':![],'depth':null}));if(_0xa2464d[_0x9a95('0x39')]!==_0xa2464d[_0x9a95('0x3e')]){if(this[_0x9a95('0x1d')][_0xa2464d[_0x9a95('0x3e')]]){if(_0xa2464d['channelstate']==='6'){if(!this[_0x9a95('0x1d')][_0xa2464d[_0x9a95('0x3e')]]['answered']){var _0x34b97f=moment();this[_0x9a95('0x1d')][_0xa2464d['linkedid']][_0x9a95('0x6b')]=!![];this['channels'][_0xa2464d[_0x9a95('0x3e')]]['answertime']=_0x34b97f[_0x9a95('0x48')](_0x9a95('0x51'));if(this[_0x9a95('0x1d')][_0xa2464d[_0x9a95('0x3e')]]['starttime']){this['channels'][_0xa2464d[_0x9a95('0x3e')]]['holdtime']=_0x34b97f['diff'](this['channels'][_0xa2464d[_0x9a95('0x3e')]]['starttime'],_0x9a95('0x62'));}}this[_0x9a95('0x1d')][_0xa2464d[_0x9a95('0x3e')]][_0x9a95('0x3e')]=_0xa2464d['uniqueid'];if(_0xa2464d[_0x9a95('0x3b')]!==_0x9a95('0x45')){this[_0x9a95('0x1d')][_0xa2464d[_0x9a95('0x3e')]][_0x9a95('0x47')]=_0xa2464d[_0x9a95('0x3b')];}this['channels'][_0xa2464d[_0x9a95('0x3e')]][_0x9a95('0x6c')]=_0xa2464d[_0x9a95('0x3a')];this[_0x9a95('0x1d')][_0xa2464d[_0x9a95('0x3e')]][_0x9a95('0x6d')]=_0xa2464d[_0x9a95('0x42')];this[_0x9a95('0x1d')][_0xa2464d[_0x9a95('0x3e')]][_0x9a95('0x52')]=dispositions[_['toNumber'](_0xa2464d[_0x9a95('0x54')])];if(this[_0x9a95('0x1e')][_0xa2464d[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]]){this[_0x9a95('0x1d')][_0xa2464d[_0x9a95('0x3e')]][_0x9a95('0x6e')]=this[_0x9a95('0x1e')][_0xa2464d[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]]['id'];this['channels'][_0xa2464d[_0x9a95('0x3e')]][_0x9a95('0x6f')]=this[_0x9a95('0x1e')][_0xa2464d[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x58')];}}}}else{if(this['channels'][_0xa2464d[_0x9a95('0x39')]]){if(_0xa2464d[_0x9a95('0x54')]==='6'){if(this[_0x9a95('0x1e')][_0xa2464d['channel'][_0x9a95('0x43')]('-')[0x0]]){this[_0x9a95('0x1d')][_0xa2464d['uniqueid']][_0x9a95('0x6e')]=this[_0x9a95('0x1e')][_0xa2464d[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]]['id'];this['channels'][_0xa2464d[_0x9a95('0x39')]][_0x9a95('0x6f')]=this[_0x9a95('0x1e')][_0xa2464d['channel'][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x58')];}}}}if(_0xa2464d[_0x9a95('0x54')]==='6'&&_0xa2464d[_0x9a95('0x40')]===_0x9a95('0x41')){if(this['agents'][_0xa2464d[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]]){this[_0x9a95('0x1e')][_0xa2464d[_0x9a95('0x42')]['split']('-')[0x0]][_0x9a95('0x46')]=_0xa2464d[_0x9a95('0x44')];var _0x3eb40f;if(this['channels'][_0xa2464d[_0x9a95('0x39')]])_0x3eb40f=this[_0x9a95('0x1d')][_0xa2464d[_0x9a95('0x39')]]['routealias'];else if(this[_0x9a95('0x1d')][_0xa2464d['linkedid']])_0x3eb40f=this[_0x9a95('0x1d')][_0xa2464d[_0x9a95('0x3e')]][_0x9a95('0x70')];logger['debug'](_0x9a95('0x71'),_0xa2464d['uniqueid'],util[_0x9a95('0x34')]({'destaccountcode':this[_0x9a95('0x1e')][_0xa2464d[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x4b')],'destconnectedlinenum':_0xa2464d[_0x9a95('0x44')],'routealias':_0x3eb40f},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x9a95('0x49'),this[_0x9a95('0x1e')][_0xa2464d[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x9a95('0x1e')][_0xa2464d[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x4b')],'destconnectedlinenum':_0xa2464d['exten'],'routealias':_0x3eb40f});}}}}catch(_0x2bfea1){logger[_0x9a95('0x32')](_0x9a95('0x72'),_0xa2464d[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x2bfea1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a95('0x35')][_0x9a95('0x73')]=function(_0x387ed8,_0x57604a){try{if(this[_0x9a95('0x1d')][_0x387ed8]){logger['info'](_0x9a95('0x74'),_0x387ed8,_0x57604a);this[_0x9a95('0x1d')][_0x387ed8][_0x9a95('0x75')]=!![];if(_[_0x9a95('0x76')](_0x57604a,_0x9a95('0x77'))){_0x57604a=_0x57604a['replace']('.wav49',_0x9a95('0x78'));}this[_0x9a95('0x1d')][_0x387ed8][_0x9a95('0x79')]=_0x57604a;var _0x5f4cd5=_[_0x9a95('0x7a')](this[_0x9a95('0x1d')][_0x387ed8][_0x9a95('0x7b')],{'filename':_0x57604a});if(_[_0x9a95('0x7c')](_0x5f4cd5)){this[_0x9a95('0x1d')][_0x387ed8][_0x9a95('0x7b')][_0x9a95('0x7d')]({'filename':_0x57604a,'createdAt':moment()[_0x9a95('0x48')](_0x9a95('0x51')),'mixmonitorid':'','status':'rec'});}}}catch(_0x525fd3){logger[_0x9a95('0x32')]('[%s][voiceCallReport][mixMonitorFilename]',_0x387ed8,util['inspect'](_0x525fd3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a95('0x35')]['syncVarSet']=function(_0x51ea17){try{if(this[_0x9a95('0x36')](_0x51ea17)){logger[_0x9a95('0x3c')](_0x9a95('0x7e'),_0x51ea17[_0x9a95('0x39')],util['inspect'](_0x51ea17,{'showHidden':![],'depth':null}));if(this[_0x9a95('0x1d')][_0x51ea17[_0x9a95('0x39')]]&&_0x51ea17['channel']!=_0x9a95('0x4d')){if(this[_0x9a95('0x36')](_0x51ea17['variable'])){if(this[_0x9a95('0x36')](_0x51ea17['variable'][_0x9a95('0x7f')])){logger[_0x9a95('0x4e')](_0x9a95('0x80'),_0x51ea17[_0x9a95('0x39')],_0x51ea17[_0x9a95('0x81')]);this[_0x9a95('0x73')](_0x51ea17[_0x9a95('0x39')],_0x51ea17['value']);}else if(this[_0x9a95('0x36')](_0x51ea17[_0x9a95('0x82')]['xmd-phone'])){logger[_0x9a95('0x4e')](_0x9a95('0x83'),_0x51ea17[_0x9a95('0x39')],_0x51ea17[_0x9a95('0x81')]);this[_0x9a95('0x1d')][_0x51ea17['uniqueid']][_0x9a95('0x3b')]=_0x51ea17[_0x9a95('0x81')];}else if(this['isNotNull'](_0x51ea17[_0x9a95('0x82')]['xmd-callerid'])){logger[_0x9a95('0x4e')](_0x9a95('0x84'),_0x51ea17[_0x9a95('0x39')],_0x51ea17[_0x9a95('0x81')]);this[_0x9a95('0x1d')][_0x51ea17[_0x9a95('0x39')]][_0x9a95('0x85')]=_0x51ea17['value'];}else if(this[_0x9a95('0x36')](_0x51ea17[_0x9a95('0x82')][_0x9a95('0x86')])){logger['info'](_0x9a95('0x87'),_0x51ea17[_0x9a95('0x39')],_0x51ea17[_0x9a95('0x81')]);this[_0x9a95('0x1d')][_0x51ea17[_0x9a95('0x39')]][_0x9a95('0x88')]=_0x51ea17[_0x9a95('0x81')];}else if(this[_0x9a95('0x36')](_0x51ea17[_0x9a95('0x82')][_0x9a95('0x89')])){logger[_0x9a95('0x4e')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x51ea17['uniqueid'],_0x51ea17[_0x9a95('0x81')][_0x9a95('0x43')](',')[0x0]);this[_0x9a95('0x1d')][_0x51ea17[_0x9a95('0x39')]][_0x9a95('0x11')]=_0x51ea17['value'][_0x9a95('0x43')](',')[0x0];}else if(this[_0x9a95('0x36')](_0x51ea17['variable'][_0x9a95('0x8a')])){logger[_0x9a95('0x4e')](_0x9a95('0x8b'),_0x51ea17['uniqueid'],_0x51ea17[_0x9a95('0x81')]);this['channels'][_0x51ea17[_0x9a95('0x39')]][_0x9a95('0x8c')]=_0x51ea17[_0x9a95('0x81')];}else if(this[_0x9a95('0x36')](_0x51ea17[_0x9a95('0x82')][_0x9a95('0x8d')])){logger[_0x9a95('0x4e')](_0x9a95('0x8e'),_0x51ea17[_0x9a95('0x39')],_0x51ea17[_0x9a95('0x81')]);this[_0x9a95('0x1d')][_0x51ea17[_0x9a95('0x39')]][_0x9a95('0x8f')]=_0x51ea17[_0x9a95('0x81')];}else if(this[_0x9a95('0x36')](_0x51ea17[_0x9a95('0x82')][_0x9a95('0x90')])){logger[_0x9a95('0x4e')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x51ea17['uniqueid'],_0x51ea17['value']);this[_0x9a95('0x1d')][_0x51ea17['uniqueid']][_0x9a95('0x91')]=_0x51ea17[_0x9a95('0x81')];}else if(this[_0x9a95('0x36')](_0x51ea17[_0x9a95('0x82')]['xmcs-queue'])){logger[_0x9a95('0x4e')](_0x9a95('0x92'),_0x51ea17['uniqueid'],_0x51ea17[_0x9a95('0x81')]);this[_0x9a95('0x1d')][_0x51ea17['uniqueid']][_0x9a95('0x11')]=_0x51ea17[_0x9a95('0x81')];}else if(this['isNotNull'](_0x51ea17[_0x9a95('0x82')]['sipcallid'])){logger[_0x9a95('0x4e')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x51ea17[_0x9a95('0x39')],_0x51ea17[_0x9a95('0x81')]);this['channels'][_0x51ea17[_0x9a95('0x39')]][_0x9a95('0x93')]=_0x51ea17['value'];}}}else if(this[_0x9a95('0x36')](_0x51ea17[_0x9a95('0x82')][_0x9a95('0x7f')])){if(_0x51ea17['value']){var _0x4468be=path[_0x9a95('0x94')](_0x51ea17['value'])['name'];logger[_0x9a95('0x4e')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x4468be,_0x51ea17[_0x9a95('0x81')]);this['syncMixMonitorFilename'](_0x4468be,_0x51ea17['value']);}}else if(this[_0x9a95('0x1d')][_0x51ea17[_0x9a95('0x3e')]]){if(this[_0x9a95('0x36')](_0x51ea17['variable'])){if(this[_0x9a95('0x36')](_0x51ea17[_0x9a95('0x82')]['sipcallid'])){logger[_0x9a95('0x4e')](_0x9a95('0x95'),_0x51ea17['linkedid'],_0x51ea17[_0x9a95('0x81')]);this[_0x9a95('0x1d')][_0x51ea17[_0x9a95('0x3e')]]['sipcalllinkedid']=_0x51ea17[_0x9a95('0x81')];}}}}}catch(_0x195527){logger[_0x9a95('0x32')]('[%s][voiceCallReport][varset]',_0x51ea17[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x195527,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a95('0x35')][_0x9a95('0x96')]=function(_0x4d2303){try{if(this[_0x9a95('0x36')](_0x4d2303)){logger[_0x9a95('0x3c')]('[%s][voiceCallReport][hangup]\x20event:',_0x4d2303['uniqueid'],util[_0x9a95('0x34')](_0x4d2303,{'showHidden':![],'depth':null}));if(this[_0x9a95('0x1d')][_0x4d2303['uniqueid']]){logger[_0x9a95('0x4e')](_0x9a95('0x97'),_0x4d2303[_0x9a95('0x39')],_0x4d2303['cause-txt']);var _0x563a46=moment();this[_0x9a95('0x1d')][_0x4d2303[_0x9a95('0x39')]]['endtime']=_0x563a46[_0x9a95('0x48')](_0x9a95('0x51'));this['channels'][_0x4d2303['uniqueid']]['duration']=_0x563a46[_0x9a95('0x98')](this[_0x9a95('0x1d')][_0x4d2303['uniqueid']][_0x9a95('0x50')],'seconds');if(this[_0x9a95('0x1d')][_0x4d2303['uniqueid']]['answered']){this[_0x9a95('0x1d')][_0x4d2303[_0x9a95('0x39')]]['billableseconds']=_0x563a46['diff'](this['channels'][_0x4d2303[_0x9a95('0x39')]]['answertime'],_0x9a95('0x62'));this[_0x9a95('0x1d')][_0x4d2303[_0x9a95('0x39')]][_0x9a95('0x99')]=this[_0x9a95('0x1d')][_0x4d2303['uniqueid']][_0x9a95('0x61')]-this[_0x9a95('0x1d')][_0x4d2303[_0x9a95('0x39')]][_0x9a95('0x9a')];}if(_0x4d2303['context']===_0x9a95('0x41')){if(this['agents'][_0x4d2303[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]]){this[_0x9a95('0x1e')][_0x4d2303[_0x9a95('0x42')]['split']('-')[0x0]]=_[_0x9a95('0x9b')](this[_0x9a95('0x1e')][_0x4d2303[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]],['destconnectedlinenum']);logger[_0x9a95('0x3c')](_0x9a95('0x9c'),_0x4d2303[_0x9a95('0x39')],util[_0x9a95('0x34')]({'id':this[_0x9a95('0x1e')][_0x4d2303['channel'][_0x9a95('0x43')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4d2303[_0x9a95('0x42')]['split']('-')[0x0]][_0x9a95('0x4b')]},{'showHidden':![],'depth':null}));this[_0x9a95('0x38')](util[_0x9a95('0x48')](_0x9a95('0x49'),this[_0x9a95('0x1e')][_0x4d2303[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]][_0x9a95('0x58')]),_0x9a95('0x9d'),{'id':this[_0x9a95('0x1e')][_0x4d2303[_0x9a95('0x42')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x9a95('0x1e')][_0x4d2303[_0x9a95('0x42')][_0x9a95('0x43')]('-')[0x0]]['accountcode']});}}var _0x923d51=this;Promise[_0x9a95('0x9e')]()[_0x9a95('0x9f')](function(){var _0x5895b1=_0x923d51[_0x9a95('0x1d')][_0x4d2303[_0x9a95('0x39')]];if(typeof _0x5895b1['transferType']===_0x9a95('0xa0'))return;if(_[_0x9a95('0xa1')](_0x5895b1['monitors']))return;return RpcSetting[_0x9a95('0xa2')]()[_0x9a95('0x9f')](function(_0x20ecf2){if(!_0x20ecf2['stopRecordingOnTransfer'])return;return Promise[_0x9a95('0x9e')]()['then'](function(){return ami[_0x9a95('0xa3')]({'action':_0x9a95('0xa4'),'channel':_0x5895b1[_0x9a95('0x42')]})['catch'](function(){});})['then'](function(){return ami[_0x9a95('0xa3')]({'action':_0x9a95('0xa4'),'channel':_0x5895b1[_0x9a95('0x6d')]})[_0x9a95('0xa5')](function(){})[_0x9a95('0xa6')](function(){var _0x8fcd74=_0x923d51[_0x9a95('0x1e')][_0x5895b1['destinationchannel']['split']('-')[0x0]];if(!_0x8fcd74)return;io[_0x9a95('0x38')](_0x9a95('0xa7'),{'agentId':_0x8fcd74['id'],'uniqueid':_0x5895b1[_0x9a95('0x39')]});});});});})[_0x9a95('0x9f')](function(){if(_0x4d2303['event']===_0x9a95('0xa8')){_0x923d51[_0x9a95('0x1f')][_0x4d2303[_0x9a95('0x39')]]=_0x923d51[_0x9a95('0x1d')][_0x4d2303['uniqueid']];}else{if(_0x923d51['channels'][_0x4d2303[_0x9a95('0x39')]][_0x9a95('0x88')]==='outbound'&&_0x923d51['blindTransfers'][_0x4d2303[_0x9a95('0x39')]]){_0x923d51[_0x9a95('0x1d')][_0x4d2303['uniqueid']][_0x9a95('0x39')]=[_0x923d51[_0x9a95('0x1d')][_0x4d2303['uniqueid']]['linkedid'],_0x923d51[_0x9a95('0x1d')][_0x4d2303[_0x9a95('0x39')]][_0x9a95('0x3e')]=_0x923d51['channels'][_0x4d2303['uniqueid']]['uniqueid']][0x0];delete _0x923d51['blindTransfers'][_0x4d2303[_0x9a95('0x39')]];}}logger[_0x9a95('0x3c')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x4d2303['uniqueid'],util['inspect'](_0x923d51[_0x9a95('0x1d')][_0x4d2303[_0x9a95('0x39')]],{'showHidden':![],'depth':null}));ami[_0x9a95('0x38')](_0x9a95('0xa9'),_0x923d51[_0x9a95('0x1d')][_0x4d2303[_0x9a95('0x39')]]);delete _0x923d51['channels'][_0x4d2303['uniqueid']];});}}}catch(_0x7860a2){logger[_0x9a95('0x32')](_0x9a95('0xaa'),_0x4d2303[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x7860a2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a95('0x35')][_0x9a95('0x2b')]=function(_0x337b99){try{if(this['isNotNull'](_0x337b99)){logger[_0x9a95('0x4e')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x337b99[_0x9a95('0x39')],_0x337b99[_0x9a95('0xab')],_0x337b99['transfertargetcalleridnum']);logger['debug'](_0x9a95('0xac'),_0x337b99['uniqueid'],util[_0x9a95('0x34')](_0x337b99,{'showHidden':![],'depth':null}));if(this[_0x9a95('0x1d')][_0x337b99[_0x9a95('0xad')]]){this['channels'][_0x337b99[_0x9a95('0xad')]][_0x9a95('0xae')]=_0x337b99[_0x9a95('0xab')];this[_0x9a95('0x1d')][_0x337b99[_0x9a95('0xad')]][_0x9a95('0xaf')]=_0x337b99['transfertargetcalleridnum'];if(this[_0x9a95('0x1d')][_0x337b99[_0x9a95('0xb0')]]){var _0x1d4709=this[_0x9a95('0x1d')][_0x337b99['secondtransfereruniqueid']];this[_0x9a95('0x1d')][_0x337b99['secondtransfereruniqueid']]=this[_0x9a95('0x1d')][_0x337b99['transfereeuniqueid']];this[_0x9a95('0x1d')][_0x337b99[_0x9a95('0xad')]]=_0x1d4709;}}else if(this[_0x9a95('0x1d')][_0x337b99['transfertargetuniqueid']]){this[_0x9a95('0x1d')][_0x337b99['transfertargetuniqueid']][_0x9a95('0xae')]=_0x337b99[_0x9a95('0xab')];this['channels'][_0x337b99['transfertargetuniqueid']][_0x9a95('0xaf')]=_0x337b99[_0x9a95('0xb1')];if(this['channels'][_0x337b99[_0x9a95('0xb2')]]){var _0x1d4709=this[_0x9a95('0x1d')][_0x337b99[_0x9a95('0xb2')]];this['channels'][_0x337b99[_0x9a95('0xb2')]]=this[_0x9a95('0x1d')][_0x337b99['transfertargetuniqueid']];this['channels'][_0x337b99['transfertargetuniqueid']]=_0x1d4709;}}if((this[_0x9a95('0x1d')][_0x337b99[_0x9a95('0xb2')]]||this[_0x9a95('0x1d')][_0x337b99[_0x9a95('0xb3')]])&&this['channels'][_0x337b99[_0x9a95('0xb0')]]){var _0x5ec267=_[_0x9a95('0xb4')]([this[_0x9a95('0x1d')][_0x337b99[_0x9a95('0xb2')]],this[_0x9a95('0x1d')][_0x337b99['origtransfererlinkedid']],this['channels'][_0x337b99[_0x9a95('0xb0')]]],function(_0x3bc222){return _0x3bc222&&_0x3bc222[_0x9a95('0x88')]==='outbound'&&_0x3bc222[_0x9a95('0xb5')];});if(_0x5ec267){if(this[_0x9a95('0x1d')][_0x337b99[_0x9a95('0xb2')]])this['channels'][_0x337b99[_0x9a95('0xb2')]][_0x9a95('0xb6')]=_0x9a95('0xb7');if(this[_0x9a95('0x1d')][_0x337b99['origtransfererlinkedid']])this['channels'][_0x337b99[_0x9a95('0xb3')]][_0x9a95('0xb6')]=_0x9a95('0xb7');this[_0x9a95('0x1d')][_0x337b99[_0x9a95('0xb0')]]['transferType']=_0x9a95('0xb7');}}}}catch(_0x28f3a9){logger[_0x9a95('0x32')]('[%s][voiceCallReport][attendedtransfer]',_0x337b99[_0x9a95('0x39')],util['inspect'](_0x28f3a9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a95('0x35')][_0x9a95('0xb8')]=function(_0x4652ff){try{if(this[_0x9a95('0x36')](_0x4652ff)){logger[_0x9a95('0x4e')](_0x9a95('0xb9'),_0x4652ff[_0x9a95('0x39')],_0x4652ff[_0x9a95('0xba')],_0x4652ff['extension']);logger[_0x9a95('0x3c')](_0x9a95('0xbb'),_0x4652ff[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x4652ff,{'showHidden':![],'depth':null}));if(this[_0x9a95('0x1d')][_0x4652ff[_0x9a95('0xad')]]){this[_0x9a95('0x1d')][_0x4652ff[_0x9a95('0xad')]][_0x9a95('0xae')]=_0x4652ff['transfereecalleridnum'];this[_0x9a95('0x1d')][_0x4652ff[_0x9a95('0xad')]]['transferconnectedlinenum']=_0x4652ff[_0x9a95('0xbc')];this[_0x9a95('0x1d')][_0x4652ff[_0x9a95('0xad')]][_0x9a95('0xb6')]=_0x9a95('0xbd');this['syncHangup']({'event':_0x9a95('0xa8'),'uniqueid':_0x4652ff[_0x9a95('0xad')],'context':_0x4652ff[_0x9a95('0x40')],'channel':_0x4652ff['transfererchannel']});}else{this[_0x9a95('0x1d')][_0x4652ff[_0x9a95('0xbe')]][_0x9a95('0xb6')]=_0x9a95('0xbd');}}}catch(_0x1980ef){logger['error'](_0x9a95('0xbf'),_0x4652ff[_0x9a95('0x39')],util['inspect'](_0x1980ef,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a95('0x35')][_0x9a95('0x2e')]=function(_0x5e4d48){try{if(this['isNotNull'](_0x5e4d48)){logger['debug'](_0x9a95('0xc0'),_0x5e4d48[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x5e4d48,{'showHidden':![],'depth':null}));if(this[_0x9a95('0x1d')][_0x5e4d48[_0x9a95('0x39')]]){if(!_['isNil'](this[_0x9a95('0x1d')][_0x5e4d48[_0x9a95('0x39')]][_0x9a95('0xc1')])){this['channels'][_0x5e4d48['uniqueid']][_0x9a95('0xc2')]=moment()[_0x9a95('0x48')](_0x9a95('0x51'));logger[_0x9a95('0x4e')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x5e4d48[_0x9a95('0x39')],this[_0x9a95('0x1d')][_0x5e4d48[_0x9a95('0x39')]][_0x9a95('0xc2')]);}}}}catch(_0x348be8){logger[_0x9a95('0x32')](_0x9a95('0xc3'),_0x5e4d48[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x348be8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9a95('0x35')][_0x9a95('0x2f')]=function(_0x4cefa9){try{if(this[_0x9a95('0x36')](_0x4cefa9)){logger['debug'](_0x9a95('0xc4'),_0x4cefa9[_0x9a95('0x39')],util[_0x9a95('0x34')](_0x4cefa9,{'showHidden':![],'depth':null}));if(this[_0x9a95('0x1d')][_0x4cefa9['uniqueid']]){if(!_[_0x9a95('0x7c')](this['channels'][_0x4cefa9[_0x9a95('0x39')]][_0x9a95('0xc2')])){this['channels'][_0x4cefa9[_0x9a95('0x39')]][_0x9a95('0xc5')]+=moment()['milliseconds'](0x0)[_0x9a95('0x98')](this['channels'][_0x4cefa9[_0x9a95('0x39')]][_0x9a95('0xc2')],'seconds');logger[_0x9a95('0x4e')](_0x9a95('0xc6'),_0x4cefa9['uniqueid'],this[_0x9a95('0x1d')][_0x4cefa9['uniqueid']]['mohtime']);delete this[_0x9a95('0x1d')][_0x4cefa9['uniqueid']][_0x9a95('0xc2')];}}}}catch(_0x3ccc5f){logger[_0x9a95('0x32')]('[%s][voiceCallReport][musiconholdstop]',_0x4cefa9['uniqueid'],util[_0x9a95('0x34')](_0x3ccc5f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
index 784bcdd..47e3fcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x716e=['uniqueid','inspect','channels','merge','called','channel','substring','lastIndexOf','omit','privilege','[%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]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','format','YYYY-MM-DD\x20HH:mm:ss','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','variable','value','outboundrouteid','info','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','starttime','seconds','lastevent','complete','answertime','answered','diff','billableseconds','sumHoldTime','holdtime','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','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]','application','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','split','match','[%s][voiceDialReport][newexten]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','outboundChannels','outbound','applications','variables','bind','dialend','syncDialEnd','varset','syncVarSet','newexten','syncNewExten','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:'];(function(_0x282472,_0x4a1242){var _0x4f30a7=function(_0x2ccbcd){while(--_0x2ccbcd){_0x282472['push'](_0x282472['shift']());}};_0x4f30a7(++_0x4a1242);}(_0x716e,0x1ce));var _0xe716=function(_0x20bc55,_0xa97d5){_0x20bc55=_0x20bc55-0x0;var _0x5d12b9=_0x716e[_0x20bc55];return _0x5d12b9;};'use strict';var _=require(_0xe716('0x0'));var moment=require(_0xe716('0x1'));var util=require('util');var Redis=require(_0xe716('0x2'));var config=require(_0xe716('0x3'));var logger=require(_0xe716('0x4'))(_0xe716('0x5'));var ami=require(_0xe716('0x6'));config['redis']=_[_0xe716('0x7')](config[_0xe716('0x8')],{'host':_0xe716('0x9'),'port':0x18eb});var io=require(_0xe716('0xa'))(new Redis(config[_0xe716('0x8')]));function VoiceDialReport(_0x29e645){this['channels']=_0x29e645[_0xe716('0xb')];this[_0xe716('0xc')]=_0x29e645['outbound'];this[_0xe716('0xd')]={};this[_0xe716('0xe')]={};ami['on']('dialbegin',this['syncDialBegin'][_0xe716('0xf')](this));ami['on'](_0xe716('0x10'),this[_0xe716('0x11')][_0xe716('0xf')](this));ami['on'](_0xe716('0x12'),this[_0xe716('0x13')][_0xe716('0xf')](this));ami['on'](_0xe716('0x14'),this[_0xe716('0x15')][_0xe716('0xf')](this));ami['on'](_0xe716('0x16'),this[_0xe716('0x17')][_0xe716('0xf')](this));}VoiceDialReport[_0xe716('0x18')][_0xe716('0x19')]=function(_0x172d6d){return _0x172d6d!==null&&!_[_0xe716('0x1a')](_0x172d6d);};VoiceDialReport['prototype'][_0xe716('0x1b')]=function(_0xe4f22a,_0x41fa03,_0x2dd892){io['to'](_0xe4f22a)[_0xe716('0x1b')](_0x41fa03,_0x2dd892);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x19239f){try{if(this['isNotNull'](_0x19239f)){logger[_0xe716('0x1c')](_0xe716('0x1d'),_0x19239f[_0xe716('0x1e')],util[_0xe716('0x1f')](_0x19239f,{'showHidden':![],'depth':null}));if(this[_0xe716('0x20')][_0x19239f[_0xe716('0x1e')]]){_[_0xe716('0x21')](this[_0xe716('0x20')][_0x19239f['uniqueid']],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xe716('0x22'),'interface':_0x19239f[_0xe716('0x23')][_0xe716('0x24')](0x0,_0x19239f[_0xe716('0x23')][_0xe716('0x25')]('-')),'membername':_0x19239f['channel'][_0xe716('0x24')](_0x19239f[_0xe716('0x23')]['lastIndexOf']('/')+0x1,_0x19239f[_0xe716('0x23')][_0xe716('0x25')]('-'))},_[_0xe716('0x26')](_0x19239f,['event',_0xe716('0x27')]));logger['info'](_0xe716('0x28'),_0x19239f['uniqueid'],this[_0xe716('0x20')][_0x19239f[_0xe716('0x1e')]][_0xe716('0x29')],this[_0xe716('0x20')][_0x19239f[_0xe716('0x1e')]]['interface']);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x19239f[_0xe716('0x1e')],util[_0xe716('0x1f')](this['channels'][_0x19239f['uniqueid']],{'showHidden':![],'depth':null}));if(this['applications'][_0x19239f[_0xe716('0x1e')]])_[_0xe716('0x21')](this['channels'][_0x19239f[_0xe716('0x1e')]],this[_0xe716('0xd')][_0x19239f[_0xe716('0x1e')]]);this[_0xe716('0x1b')](_0xe716('0x2a'),_0xe716('0x2b'),this['channels'][_0x19239f[_0xe716('0x1e')]]);logger[_0xe716('0x1c')](_0xe716('0x2c'),_0x19239f[_0xe716('0x1e')],util['inspect'](this[_0xe716('0x20')][_0x19239f[_0xe716('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xe716('0x1b')](_0xe716('0x2d'),this[_0xe716('0x20')][_0x19239f[_0xe716('0x1e')]]);}}}catch(_0x16ca2){logger[_0xe716('0x2e')](_0xe716('0x2f'),_0x19239f[_0xe716('0x1e')],util[_0xe716('0x1f')](_0x16ca2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe716('0x18')][_0xe716('0x11')]=function(_0x17e3de){try{if(this['isNotNull'](_0x17e3de)){logger[_0xe716('0x1c')](_0xe716('0x30'),_0x17e3de[_0xe716('0x1e')],util['inspect'](_0x17e3de,{'showHidden':![],'depth':null}));if(this['channels'][_0x17e3de['uniqueid']]){this[_0xe716('0x20')][_0x17e3de['uniqueid']][_0xe716('0x31')]=_0x17e3de[_0xe716('0x31')];if(_0x17e3de[_0xe716('0x31')]==='ANSWER'){this[_0xe716('0x20')][_0x17e3de[_0xe716('0x1e')]]['connectedlinenum']=_0x17e3de[_0xe716('0x32')];this['channels'][_0x17e3de[_0xe716('0x1e')]]['connectedlinename']=_0x17e3de[_0xe716('0x33')];this[_0xe716('0x20')][_0x17e3de[_0xe716('0x1e')]]['answertime']=moment()[_0xe716('0x34')](_0xe716('0x35'));this['channels'][_0x17e3de[_0xe716('0x1e')]]['lastevent']='connect';logger['info'](_0xe716('0x36'),_0x17e3de[_0xe716('0x1e')],_0x17e3de[_0xe716('0x23')][_0xe716('0x24')](_0x17e3de[_0xe716('0x23')][_0xe716('0x25')]('/')+0x1,_0x17e3de[_0xe716('0x23')][_0xe716('0x25')]('-')));logger['debug'](_0xe716('0x37'),_0x17e3de[_0xe716('0x1e')],util[_0xe716('0x1f')](this[_0xe716('0x20')][_0x17e3de[_0xe716('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xe716('0x1b')](_0xe716('0x38'),this[_0xe716('0x20')][_0x17e3de['uniqueid']]);}logger[_0xe716('0x1c')](_0xe716('0x39'),_0x17e3de['uniqueid'],util[_0xe716('0x1f')](this[_0xe716('0x20')][_0x17e3de[_0xe716('0x1e')]],{'showHidden':![],'depth':null}));this[_0xe716('0x1b')](_0xe716('0x2a'),_0xe716('0x2b'),this['channels'][_0x17e3de[_0xe716('0x1e')]]);}}}catch(_0x7c9de8){logger['error'](_0xe716('0x3a'),_0x17e3de[_0xe716('0x1e')],util[_0xe716('0x1f')](_0x7c9de8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe716('0x18')]['syncVarSet']=function(_0x33d490){try{if(this[_0xe716('0x19')](_0x33d490)){logger['debug'](_0xe716('0x3b'),_0x33d490[_0xe716('0x1e')],util[_0xe716('0x1f')](_0x33d490,{'showHidden':![],'depth':null}));this['addVariable'](_0x33d490[_0xe716('0x1e')],_[_0xe716('0x3c')](_0x33d490[_0xe716('0x3d')])[0x0],_0x33d490[_0xe716('0x3e')]);if(this['isNotNull'](_0x33d490['variable'])&&this[_0xe716('0x19')](_0x33d490[_0xe716('0x3d')][_0xe716('0x3f')])){if(_[_0xe716('0x1a')](this['channels'][_0x33d490['uniqueid']])){this['channels'][_0x33d490[_0xe716('0x1e')]]={'routeId':_0x33d490['value'],'variables':this[_0xe716('0xe')][_0x33d490[_0xe716('0x1e')]],'motionChannel':'voice'};logger[_0xe716('0x40')](_0xe716('0x41'),_0x33d490[_0xe716('0x1e')],_0x33d490[_0xe716('0x3d')]['outboundrouteid'],_['keys'](_0x33d490[_0xe716('0x3d')])[0x0],_0x33d490[_0xe716('0x3e')]);logger[_0xe716('0x1c')](_0xe716('0x42'),_0x33d490[_0xe716('0x1e')],util[_0xe716('0x1f')](this[_0xe716('0x20')][_0x33d490[_0xe716('0x1e')]],{'showHidden':![],'depth':null}));this[_0xe716('0x1b')](_0xe716('0x2a'),_0xe716('0x2b'),this['channels'][_0x33d490[_0xe716('0x1e')]]);}}}}catch(_0x4f0972){logger[_0xe716('0x2e')](_0xe716('0x43'),_0x33d490['uniqueid'],util[_0xe716('0x1f')](_0x4f0972,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe716('0x18')][_0xe716('0x44')]=function(_0x5a78ce,_0x5aec96,_0x5bd270){var _0x2ac29d=[_0xe716('0x45'),_0xe716('0x46'),_0xe716('0x47'),'rtpaudioqosjitterbridged',_0xe716('0x48'),_0xe716('0x49'),_0xe716('0x4a'),'rtpaudioqosrttbridged',_0xe716('0x4b'),_0xe716('0x4c'),'bridgepeer',_0xe716('0x4d'),'membercalls',_0xe716('0x4e'),_0xe716('0x4f'),_0xe716('0x50'),_0xe716('0x29'),_0xe716('0x51'),_0xe716('0x52')];if(!_[_0xe716('0x53')](_0x5aec96)&&!_[_0xe716('0x54')](_0x2ac29d,_0x5aec96)){if(_[_0xe716('0x1a')](this[_0xe716('0xe')][_0x5a78ce])){this[_0xe716('0xe')][_0x5a78ce]={};}this['variables'][_0x5a78ce][_0x5aec96]=_0x5bd270;}};VoiceDialReport[_0xe716('0x18')]['syncHangup']=function(_0x538c1f){try{if(this[_0xe716('0x19')](_0x538c1f)){logger['debug'](_0xe716('0x55'),_0x538c1f[_0xe716('0x1e')],util[_0xe716('0x1f')](_0x538c1f,{'showHidden':![],'depth':null}));if(this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]]){logger[_0xe716('0x40')](_0xe716('0x56'),_0x538c1f[_0xe716('0x1e')],_0x538c1f[_0xe716('0x57')]);this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]][_0xe716('0x58')]=moment()[_0xe716('0x34')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]][_0xe716('0x59')]=moment(this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]][_0xe716('0x58')])['diff'](this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]][_0xe716('0x5a')],_0xe716('0x5b'));this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]][_0xe716('0x5c')]=_0xe716('0x5d');this[_0xe716('0xc')]['total']+=0x1;if(this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]][_0xe716('0x5e')]){this[_0xe716('0xc')][_0xe716('0x5f')]+=0x1;this[_0xe716('0x20')][_0x538c1f['uniqueid']]['holdtime']=moment(this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]][_0xe716('0x5e')])[_0xe716('0x60')](this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]][_0xe716('0x5a')],_0xe716('0x5b'));this[_0xe716('0x20')][_0x538c1f['uniqueid']][_0xe716('0x61')]=moment(this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]][_0xe716('0x58')])[_0xe716('0x60')](this['channels'][_0x538c1f[_0xe716('0x1e')]][_0xe716('0x5e')],'seconds');this[_0xe716('0xc')][_0xe716('0x62')]+=this[_0xe716('0x20')][_0x538c1f['uniqueid']][_0xe716('0x63')]||0x0;this[_0xe716('0xc')][_0xe716('0x64')]+=this['channels'][_0x538c1f['uniqueid']][_0xe716('0x61')];}this['outbound']['sumDuration']+=this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]]['duration'];logger[_0xe716('0x1c')](_0xe716('0x65'),_0x538c1f[_0xe716('0x1e')],util[_0xe716('0x1f')](this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]],{'showHidden':![],'depth':null}));ami['emit'](_0xe716('0x66'),this['channels'][_0x538c1f[_0xe716('0x1e')]]);logger['debug'](_0xe716('0x67'),_0x538c1f[_0xe716('0x1e')],util[_0xe716('0x1f')](this['channels'][_0x538c1f[_0xe716('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xe716('0x1b')](_0xe716('0x68'),this[_0xe716('0x20')][_0x538c1f['uniqueid']]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x538c1f[_0xe716('0x1e')],util[_0xe716('0x1f')](this['channels'][_0x538c1f['uniqueid']],{'showHidden':![],'depth':null}));this[_0xe716('0x1b')]('voice:outbound',_0xe716('0x69'),this[_0xe716('0xc')]);logger[_0xe716('0x40')](_0xe716('0x6a'),JSON[_0xe716('0x6b')](this['channels'][_0x538c1f[_0xe716('0x1e')]]));logger[_0xe716('0x1c')](_0xe716('0x6c'),_0x538c1f[_0xe716('0x1e')],util[_0xe716('0x1f')](this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]],{'showHidden':![],'depth':null}));this[_0xe716('0x1b')](_0xe716('0x2a'),_0xe716('0x6d'),this['channels'][_0x538c1f[_0xe716('0x1e')]]);delete this[_0xe716('0x20')][_0x538c1f[_0xe716('0x1e')]];}else if(this[_0xe716('0x20')][_0x538c1f['linkedid']]){this['channels'][_0x538c1f[_0xe716('0x6e')]]['uniqueid']=this[_0xe716('0x20')][_0x538c1f[_0xe716('0x6e')]][_0xe716('0x6f')];}if(this[_0xe716('0xe')][_0x538c1f[_0xe716('0x1e')]]){delete this['variables'][_0x538c1f[_0xe716('0x1e')]];}}}catch(_0x45cfc0){logger['error'](_0xe716('0x70'),_0x538c1f['uniqueid'],util[_0xe716('0x1f')](_0x45cfc0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe716('0x18')][_0xe716('0x15')]=function(_0x21f243){try{if(this[_0xe716('0x19')](_0x21f243)){logger[_0xe716('0x1c')]('[%s][voiceDialReport][newexten]\x20event:',_0x21f243['uniqueid'],util[_0xe716('0x1f')](_0x21f243,{'showHidden':![],'depth':null}));if(_0x21f243[_0xe716('0x71')][_0xe716('0x72')]()===_0xe716('0x73')){_0x21f243[_0xe716('0x74')]=(_0x21f243[_0xe716('0x75')]||_0x21f243['applicationdata'])[_0xe716('0x72')]();if(_[_0xe716('0x76')](_0x21f243['applicationdata'],_0xe716('0x77'))){if(_[_0xe716('0x1a')](this[_0xe716('0xd')][_0x21f243[_0xe716('0x1e')]]))this[_0xe716('0xd')][_0x21f243[_0xe716('0x1e')]]={};logger[_0xe716('0x40')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x21f243[_0xe716('0x1e')],_0x21f243[_0xe716('0x71')],_0x21f243['applicationdata']);var _0x44adb5=_0x21f243[_0xe716('0x74')][_0xe716('0x78')]('=');var _0x2a7def=_0x44adb5[0x0][_0xe716('0x79')](/cdr\((.*)\)/);if(_0x2a7def)this[_0xe716('0xd')][_0x21f243['uniqueid']][_0x2a7def[0x1]]=_0x44adb5[0x1];}}}}catch(_0x4083a4){logger['error'](_0xe716('0x7a'),_0x21f243[_0xe716('0x1e')],util['inspect'](_0x4083a4,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
+var _0xa0e7=['[%s][voiceDialReport][hangup]','application','toLowerCase','set','applicationdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outbound','variables','dialbegin','syncDialEnd','bind','varset','newexten','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','called','channel','substring','lastIndexOf','omit','event','privilege','info','membername','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','applications','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','dialstatus','connectedlinenum','connectedlinename','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','syncVarSet','[%s][voiceDialReport][varset]\x20event:','keys','value','variable','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','cause-txt','endtime','diff','starttime','seconds','complete','total','answertime','holdtime','sumHoldTime','sumBillable','sumDuration','duration','[%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','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid'];(function(_0x103a8e,_0x943267){var _0x4477dc=function(_0x4ab832){while(--_0x4ab832){_0x103a8e['push'](_0x103a8e['shift']());}};_0x4477dc(++_0x943267);}(_0xa0e7,0x7f));var _0x7a0e=function(_0x25e761,_0x2b96e1){_0x25e761=_0x25e761-0x0;var _0x43aca5=_0xa0e7[_0x25e761];return _0x43aca5;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var Redis=require('ioredis');var config=require(_0x7a0e('0x0'));var logger=require(_0x7a0e('0x1'))(_0x7a0e('0x2'));var ami=require(_0x7a0e('0x3'));config[_0x7a0e('0x4')]=_[_0x7a0e('0x5')](config[_0x7a0e('0x4')],{'host':_0x7a0e('0x6'),'port':0x18eb});var io=require(_0x7a0e('0x7'))(new Redis(config['redis']));function VoiceDialReport(_0x1ebdc2){this[_0x7a0e('0x8')]=_0x1ebdc2['outboundChannels'];this[_0x7a0e('0x9')]=_0x1ebdc2[_0x7a0e('0x9')];this['applications']={};this[_0x7a0e('0xa')]={};ami['on'](_0x7a0e('0xb'),this['syncDialBegin']['bind'](this));ami['on']('dialend',this[_0x7a0e('0xc')][_0x7a0e('0xd')](this));ami['on'](_0x7a0e('0xe'),this['syncVarSet']['bind'](this));ami['on'](_0x7a0e('0xf'),this['syncNewExten'][_0x7a0e('0xd')](this));ami['on'](_0x7a0e('0x10'),this[_0x7a0e('0x11')][_0x7a0e('0xd')](this));}VoiceDialReport[_0x7a0e('0x12')][_0x7a0e('0x13')]=function(_0x35b7d9){return _0x35b7d9!==null&&!_[_0x7a0e('0x14')](_0x35b7d9);};VoiceDialReport[_0x7a0e('0x12')][_0x7a0e('0x15')]=function(_0x2fa35a,_0x14eb79,_0x2fe4e8){io['to'](_0x2fa35a)[_0x7a0e('0x15')](_0x14eb79,_0x2fe4e8);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x394d3d){try{if(this[_0x7a0e('0x13')](_0x394d3d)){logger[_0x7a0e('0x16')](_0x7a0e('0x17'),_0x394d3d[_0x7a0e('0x18')],util[_0x7a0e('0x19')](_0x394d3d,{'showHidden':![],'depth':null}));if(this[_0x7a0e('0x8')][_0x394d3d[_0x7a0e('0x18')]]){_[_0x7a0e('0x1a')](this[_0x7a0e('0x8')][_0x394d3d['uniqueid']],{'starttime':moment()[_0x7a0e('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x7a0e('0x1c'),'interface':_0x394d3d[_0x7a0e('0x1d')][_0x7a0e('0x1e')](0x0,_0x394d3d[_0x7a0e('0x1d')]['lastIndexOf']('-')),'membername':_0x394d3d['channel'][_0x7a0e('0x1e')](_0x394d3d[_0x7a0e('0x1d')]['lastIndexOf']('/')+0x1,_0x394d3d[_0x7a0e('0x1d')][_0x7a0e('0x1f')]('-'))},_[_0x7a0e('0x20')](_0x394d3d,[_0x7a0e('0x21'),_0x7a0e('0x22')]));logger[_0x7a0e('0x23')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x394d3d[_0x7a0e('0x18')],this[_0x7a0e('0x8')][_0x394d3d[_0x7a0e('0x18')]][_0x7a0e('0x24')],this[_0x7a0e('0x8')][_0x394d3d['uniqueid']]['interface']);logger['debug'](_0x7a0e('0x25'),_0x394d3d[_0x7a0e('0x18')],util[_0x7a0e('0x19')](this[_0x7a0e('0x8')][_0x394d3d[_0x7a0e('0x18')]],{'showHidden':![],'depth':null}));if(this[_0x7a0e('0x26')][_0x394d3d[_0x7a0e('0x18')]])_[_0x7a0e('0x1a')](this['channels'][_0x394d3d[_0x7a0e('0x18')]],this[_0x7a0e('0x26')][_0x394d3d[_0x7a0e('0x18')]]);this[_0x7a0e('0x15')](_0x7a0e('0x27'),_0x7a0e('0x28'),this[_0x7a0e('0x8')][_0x394d3d[_0x7a0e('0x18')]]);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x394d3d[_0x7a0e('0x18')],util[_0x7a0e('0x19')](this[_0x7a0e('0x8')][_0x394d3d[_0x7a0e('0x18')]],{'showHidden':![],'depth':null}));ami[_0x7a0e('0x15')](_0x7a0e('0x29'),this[_0x7a0e('0x8')][_0x394d3d[_0x7a0e('0x18')]]);}}}catch(_0x4081a1){logger[_0x7a0e('0x2a')]('[%s][voiceDialReport][dialbegin]',_0x394d3d[_0x7a0e('0x18')],util[_0x7a0e('0x19')](_0x4081a1,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7a0e('0x12')][_0x7a0e('0xc')]=function(_0x812ff8){try{if(this[_0x7a0e('0x13')](_0x812ff8)){logger[_0x7a0e('0x16')]('[%s][voiceDialReport][dialend]\x20event:',_0x812ff8['uniqueid'],util[_0x7a0e('0x19')](_0x812ff8,{'showHidden':![],'depth':null}));if(this[_0x7a0e('0x8')][_0x812ff8[_0x7a0e('0x18')]]){this[_0x7a0e('0x8')][_0x812ff8[_0x7a0e('0x18')]][_0x7a0e('0x2b')]=_0x812ff8[_0x7a0e('0x2b')];if(_0x812ff8[_0x7a0e('0x2b')]==='ANSWER'){this[_0x7a0e('0x8')][_0x812ff8['uniqueid']]['connectedlinenum']=_0x812ff8[_0x7a0e('0x2c')];this[_0x7a0e('0x8')][_0x812ff8[_0x7a0e('0x18')]]['connectedlinename']=_0x812ff8[_0x7a0e('0x2d')];this[_0x7a0e('0x8')][_0x812ff8['uniqueid']]['answertime']=moment()['format'](_0x7a0e('0x2e'));this[_0x7a0e('0x8')][_0x812ff8[_0x7a0e('0x18')]][_0x7a0e('0x2f')]=_0x7a0e('0x30');logger[_0x7a0e('0x23')](_0x7a0e('0x31'),_0x812ff8['uniqueid'],_0x812ff8['channel'][_0x7a0e('0x1e')](_0x812ff8['channel'][_0x7a0e('0x1f')]('/')+0x1,_0x812ff8[_0x7a0e('0x1d')][_0x7a0e('0x1f')]('-')));logger[_0x7a0e('0x16')](_0x7a0e('0x32'),_0x812ff8[_0x7a0e('0x18')],util['inspect'](this[_0x7a0e('0x8')][_0x812ff8[_0x7a0e('0x18')]],{'showHidden':![],'depth':null}));ami[_0x7a0e('0x15')](_0x7a0e('0x33'),this[_0x7a0e('0x8')][_0x812ff8['uniqueid']]);}logger[_0x7a0e('0x16')](_0x7a0e('0x34'),_0x812ff8[_0x7a0e('0x18')],util[_0x7a0e('0x19')](this[_0x7a0e('0x8')][_0x812ff8[_0x7a0e('0x18')]],{'showHidden':![],'depth':null}));this['emit'](_0x7a0e('0x27'),_0x7a0e('0x28'),this['channels'][_0x812ff8[_0x7a0e('0x18')]]);}}}catch(_0x6dd451){logger[_0x7a0e('0x2a')]('[%s][voiceDialReport][dialend]',_0x812ff8['uniqueid'],util[_0x7a0e('0x19')](_0x6dd451,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7a0e('0x12')][_0x7a0e('0x35')]=function(_0x2f8f92){try{if(this['isNotNull'](_0x2f8f92)){logger[_0x7a0e('0x16')](_0x7a0e('0x36'),_0x2f8f92[_0x7a0e('0x18')],util[_0x7a0e('0x19')](_0x2f8f92,{'showHidden':![],'depth':null}));this['addVariable'](_0x2f8f92[_0x7a0e('0x18')],_[_0x7a0e('0x37')](_0x2f8f92['variable'])[0x0],_0x2f8f92[_0x7a0e('0x38')]);if(this['isNotNull'](_0x2f8f92[_0x7a0e('0x39')])&&this[_0x7a0e('0x13')](_0x2f8f92[_0x7a0e('0x39')]['outboundrouteid'])){if(_[_0x7a0e('0x14')](this[_0x7a0e('0x8')][_0x2f8f92[_0x7a0e('0x18')]])){this[_0x7a0e('0x8')][_0x2f8f92[_0x7a0e('0x18')]]={'routeId':_0x2f8f92[_0x7a0e('0x38')],'variables':this[_0x7a0e('0xa')][_0x2f8f92['uniqueid']],'motionChannel':_0x7a0e('0x3a')};logger[_0x7a0e('0x23')](_0x7a0e('0x3b'),_0x2f8f92[_0x7a0e('0x18')],_0x2f8f92[_0x7a0e('0x39')][_0x7a0e('0x3c')],_[_0x7a0e('0x37')](_0x2f8f92[_0x7a0e('0x39')])[0x0],_0x2f8f92['value']);logger['debug'](_0x7a0e('0x3d'),_0x2f8f92[_0x7a0e('0x18')],util[_0x7a0e('0x19')](this[_0x7a0e('0x8')][_0x2f8f92[_0x7a0e('0x18')]],{'showHidden':![],'depth':null}));this['emit'](_0x7a0e('0x27'),_0x7a0e('0x28'),this['channels'][_0x2f8f92[_0x7a0e('0x18')]]);}}}}catch(_0x1321f4){logger[_0x7a0e('0x2a')](_0x7a0e('0x3e'),_0x2f8f92[_0x7a0e('0x18')],util[_0x7a0e('0x19')](_0x1321f4,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x7a0e('0x3f')]=function(_0x5ddcab,_0x240083,_0x461190){var _0x2a016c=[_0x7a0e('0x40'),_0x7a0e('0x41'),_0x7a0e('0x42'),'rtpaudioqosjitterbridged',_0x7a0e('0x43'),_0x7a0e('0x44'),'rtpaudioqosrtt',_0x7a0e('0x45'),_0x7a0e('0x46'),_0x7a0e('0x47'),_0x7a0e('0x48'),_0x7a0e('0x49'),_0x7a0e('0x4a'),_0x7a0e('0x4b'),'memberinterface',_0x7a0e('0x4c'),_0x7a0e('0x24'),_0x7a0e('0x4d'),_0x7a0e('0x4e')];if(!_[_0x7a0e('0x4f')](_0x240083)&&!_[_0x7a0e('0x50')](_0x2a016c,_0x240083)){if(_[_0x7a0e('0x14')](this[_0x7a0e('0xa')][_0x5ddcab])){this[_0x7a0e('0xa')][_0x5ddcab]={};}this[_0x7a0e('0xa')][_0x5ddcab][_0x240083]=_0x461190;}};VoiceDialReport[_0x7a0e('0x12')][_0x7a0e('0x11')]=function(_0x120641){try{if(this[_0x7a0e('0x13')](_0x120641)){logger[_0x7a0e('0x16')](_0x7a0e('0x51'),_0x120641[_0x7a0e('0x18')],util[_0x7a0e('0x19')](_0x120641,{'showHidden':![],'depth':null}));if(this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]]){logger[_0x7a0e('0x23')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x120641[_0x7a0e('0x18')],_0x120641[_0x7a0e('0x52')]);this[_0x7a0e('0x8')][_0x120641['uniqueid']]['endtime']=moment()[_0x7a0e('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x120641[_0x7a0e('0x18')]]['duration']=moment(this[_0x7a0e('0x8')][_0x120641['uniqueid']][_0x7a0e('0x53')])[_0x7a0e('0x54')](this['channels'][_0x120641[_0x7a0e('0x18')]][_0x7a0e('0x55')],_0x7a0e('0x56'));this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]]['lastevent']=_0x7a0e('0x57');this[_0x7a0e('0x9')][_0x7a0e('0x58')]+=0x1;if(this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]][_0x7a0e('0x59')]){this['outbound']['answered']+=0x1;this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]][_0x7a0e('0x5a')]=moment(this['channels'][_0x120641[_0x7a0e('0x18')]]['answertime'])[_0x7a0e('0x54')](this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]]['starttime'],_0x7a0e('0x56'));this['channels'][_0x120641[_0x7a0e('0x18')]]['billableseconds']=moment(this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]][_0x7a0e('0x53')])[_0x7a0e('0x54')](this[_0x7a0e('0x8')][_0x120641['uniqueid']][_0x7a0e('0x59')],_0x7a0e('0x56'));this[_0x7a0e('0x9')][_0x7a0e('0x5b')]+=this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]][_0x7a0e('0x5a')]||0x0;this[_0x7a0e('0x9')][_0x7a0e('0x5c')]+=this[_0x7a0e('0x8')][_0x120641['uniqueid']]['billableseconds'];}this[_0x7a0e('0x9')][_0x7a0e('0x5d')]+=this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]][_0x7a0e('0x5e')];logger[_0x7a0e('0x16')](_0x7a0e('0x5f'),_0x120641[_0x7a0e('0x18')],util[_0x7a0e('0x19')](this['channels'][_0x120641['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x7a0e('0x15')](_0x7a0e('0x60'),this[_0x7a0e('0x8')][_0x120641['uniqueid']]);logger[_0x7a0e('0x16')](_0x7a0e('0x61'),_0x120641[_0x7a0e('0x18')],util[_0x7a0e('0x19')](this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]],{'showHidden':![],'depth':null}));ami[_0x7a0e('0x15')](_0x7a0e('0x62'),this['channels'][_0x120641[_0x7a0e('0x18')]]);logger[_0x7a0e('0x16')](_0x7a0e('0x63'),_0x120641[_0x7a0e('0x18')],util['inspect'](this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]],{'showHidden':![],'depth':null}));this[_0x7a0e('0x15')](_0x7a0e('0x27'),_0x7a0e('0x64'),this[_0x7a0e('0x9')]);logger[_0x7a0e('0x23')](_0x7a0e('0x65'),JSON['stringify'](this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]]));logger[_0x7a0e('0x16')](_0x7a0e('0x66'),_0x120641['uniqueid'],util[_0x7a0e('0x19')](this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]],{'showHidden':![],'depth':null}));this[_0x7a0e('0x15')](_0x7a0e('0x27'),_0x7a0e('0x67'),this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]]);delete this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x18')]];}else if(this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x68')]]){this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x68')]]['uniqueid']=this[_0x7a0e('0x8')][_0x120641[_0x7a0e('0x68')]]['destuniqueid'];}if(this[_0x7a0e('0xa')][_0x120641[_0x7a0e('0x18')]]){delete this[_0x7a0e('0xa')][_0x120641['uniqueid']];}}}catch(_0x6df9f9){logger[_0x7a0e('0x2a')](_0x7a0e('0x69'),_0x120641[_0x7a0e('0x18')],util['inspect'](_0x6df9f9,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7a0e('0x12')]['syncNewExten']=function(_0x233d55){try{if(this[_0x7a0e('0x13')](_0x233d55)){logger['debug']('[%s][voiceDialReport][newexten]\x20event:',_0x233d55[_0x7a0e('0x18')],util[_0x7a0e('0x19')](_0x233d55,{'showHidden':![],'depth':null}));if(_0x233d55[_0x7a0e('0x6a')][_0x7a0e('0x6b')]()===_0x7a0e('0x6c')){_0x233d55[_0x7a0e('0x6d')]=(_0x233d55['appdata']||_0x233d55['applicationdata'])[_0x7a0e('0x6b')]();if(_[_0x7a0e('0x6e')](_0x233d55[_0x7a0e('0x6d')],_0x7a0e('0x6f'))){if(_['isUndefined'](this[_0x7a0e('0x26')][_0x233d55[_0x7a0e('0x18')]]))this['applications'][_0x233d55[_0x7a0e('0x18')]]={};logger['info'](_0x7a0e('0x70'),_0x233d55['uniqueid'],_0x233d55[_0x7a0e('0x6a')],_0x233d55[_0x7a0e('0x6d')]);var _0x36feee=_0x233d55[_0x7a0e('0x6d')][_0x7a0e('0x71')]('=');var _0xc2d3ea=_0x36feee[0x0][_0x7a0e('0x72')](/cdr\((.*)\)/);if(_0xc2d3ea)this['applications'][_0x233d55[_0x7a0e('0x18')]][_0xc2d3ea[0x1]]=_0x36feee[0x1];}}}}catch(_0x3e364e){logger['error'](_0x7a0e('0x73'),_0x233d55[_0x7a0e('0x18')],util[_0x7a0e('0x19')](_0x3e364e,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
index cd7dbc5..b0522ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad53=['[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','startsWith','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','exports','lodash','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','defaults','localhost','enqueue','tail','finally','sequence','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','pTalking','waiting','unlockRR','prototype','clearZombieChannels','switch','isNil','Action','status','channel','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','sumBillable','sumDuration','sumHoldTime','type','unmanaged','abandoned','Trunk','callerid','Interval','stringify',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','queues','[voiceQueueReport][queues]','[voiceQueueReport][queuesummary]','isNotNull','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','queue','callers','toNumber','loggedin','loggedIn','talking','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','membername','queuecallerexit','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','toLowerCase','local/','queuecallerexitAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','linkedid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','value','variable','CONTINUE','TIMEOUT','lastevent','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','length','diff','milliseconds','total','answered','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][hangup]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','mohtime'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xad53,0x1ea));var _0x3ad5=function(_0x99139,_0x15f70e){_0x99139=_0x99139-0x0;var _0x53a48e=_0xad53[_0x99139];return _0x53a48e;};'use strict';var _=require(_0x3ad5('0x0'));var moment=require(_0x3ad5('0x1'));var util=require(_0x3ad5('0x2'));var md5=require(_0x3ad5('0x3'));var Redis=require(_0x3ad5('0x4'));var config=require(_0x3ad5('0x5'));var logger=require(_0x3ad5('0x6'))(_0x3ad5('0x7'));var ami=require('../ami');var QueueReport=require(_0x3ad5('0x8'));config[_0x3ad5('0x9')]=_[_0x3ad5('0xa')](config[_0x3ad5('0x9')],{'host':_0x3ad5('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x3ad5('0xc')]=function(_0x1262a4){this[_0x3ad5('0xd')]=this[_0x3ad5('0xd')]?this[_0x3ad5('0xd')][_0x3ad5('0xe')](_0x1262a4):_0x1262a4();};function VoiceQueueReport(_0x1d7191){this[_0x3ad5('0xf')]=new Sequence();this['queueReports']={};this[_0x3ad5('0x10')]=_0x1d7191[_0x3ad5('0x10')];this[_0x3ad5('0x11')]=_0x1d7191[_0x3ad5('0x12')];this['voiceQueues']=_0x1d7191[_0x3ad5('0x13')];this[_0x3ad5('0x14')]=!![];this[_0x3ad5('0x15')]=_0x1d7191['campaigns'];this[_0x3ad5('0x16')]={};ami['on'](_0x3ad5('0x17'),this[_0x3ad5('0x18')][_0x3ad5('0x19')](this));ami['on'](_0x3ad5('0x1a'),this[_0x3ad5('0x1b')]['bind'](this));ami['on']('queuecallerjoin',this[_0x3ad5('0x1c')][_0x3ad5('0x19')](this));ami['on'](_0x3ad5('0x1d'),this[_0x3ad5('0x1e')][_0x3ad5('0x19')](this));ami['on'](_0x3ad5('0x1f'),this['syncQueueCallerLeave']['bind'](this));ami['on'](_0x3ad5('0x20'),this[_0x3ad5('0x21')]['bind'](this));ami['on']('agentconnect',this[_0x3ad5('0x22')][_0x3ad5('0x19')](this));ami['on'](_0x3ad5('0x23'),this[_0x3ad5('0x24')]['bind'](this));ami['on'](_0x3ad5('0x25'),this[_0x3ad5('0x26')][_0x3ad5('0x19')](this));ami['on'](_0x3ad5('0x27'),this[_0x3ad5('0x28')][_0x3ad5('0x19')](this));ami['on'](_0x3ad5('0x29'),this[_0x3ad5('0x2a')][_0x3ad5('0x19')](this));ami['on']('musiconholdstart',this[_0x3ad5('0x2b')]['bind'](this));ami['on'](_0x3ad5('0x2c'),this['syncMusicOnHoldStop'][_0x3ad5('0x19')](this));ami['on'](_0x3ad5('0x2d'),this[_0x3ad5('0x2e')][_0x3ad5('0x19')](this));ami['on'](_0x3ad5('0x2f'),this[_0x3ad5('0x30')]['bind'](this));this[_0x3ad5('0x31')]();this[_0x3ad5('0x32')]();}function clearChannels(_0x4d1a4c){if(!_[_0x3ad5('0x33')](_0x4d1a4c)){for(var _0x24f7e1 in _0x4d1a4c){if(_0x4d1a4c[_0x3ad5('0x34')](_0x24f7e1)){delete _0x4d1a4c[_0x24f7e1];}}}}function clearCampaigns(_0x494adf){if(!_[_0x3ad5('0x33')](_0x494adf)){for(var _0x429ea6 in _0x494adf){if(_0x494adf[_0x3ad5('0x34')](_0x429ea6)){_0x494adf[_0x429ea6]['originated']=0x0;}}}}function clearVoiceQueues(_0x512d41){if(!_['isEmpty'](_0x512d41)){for(var _0x33c53e in _0x512d41){if(_0x512d41[_0x3ad5('0x34')](_0x33c53e)){_0x512d41[_0x33c53e][_0x3ad5('0x35')]=0x0;_0x512d41[_0x33c53e]['talking']=0x0;_0x512d41[_0x33c53e][_0x3ad5('0x36')]=0x0;_0x512d41[_0x33c53e][_0x3ad5('0x37')]=0x0;_0x512d41[_0x33c53e]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x4c66f7){if(!_[_0x3ad5('0x33')](_0x4c66f7)){for(var _0x5c2d1e in _0x4c66f7){if(_0x4c66f7[_0x3ad5('0x34')](_0x5c2d1e)){_0x4c66f7[_0x5c2d1e][_0x3ad5('0x38')]=!![];}}}}VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0x3a')]=function(){var _0x1fb6f3=this;for(var _0x4b4a88 in this['channels']){if(this[_0x3ad5('0x11')][_0x3ad5('0x34')](_0x4b4a88)&&!this[_0x3ad5('0x11')][_0x4b4a88][_0x3ad5('0x3b')]){this['sequence'][_0x3ad5('0xc')](function(){if(!_[_0x3ad5('0x3c')](_0x1fb6f3[_0x3ad5('0x11')][_0x4b4a88])){return ami[_0x3ad5('0x3d')]({'action':_0x3ad5('0x3e'),'channel':_0x1fb6f3[_0x3ad5('0x11')][_0x4b4a88][_0x3ad5('0x3f')]})[_0x3ad5('0x40')](function(_0x30705f){if(_0x30705f[_0x3ad5('0x41')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1fb6f3[_0x3ad5('0x11')][_0x4b4a88]){delete _0x1fb6f3[_0x3ad5('0x11')][_0x4b4a88];logger[_0x3ad5('0x42')](_0x3ad5('0x43'),_0x4b4a88,util[_0x3ad5('0x44')](_0x30705f,{'showHidden':![],'depth':null}));}if(_0x1fb6f3[_0x3ad5('0x45')][_0x4b4a88]){delete _0x1fb6f3[_0x3ad5('0x45')][_0x4b4a88];logger['error']('[%s][voiceQueueReport][checkQueueReport]',_0x4b4a88,util[_0x3ad5('0x44')](_0x30705f,{'showHidden':![],'depth':null}));}if(_0x1fb6f3[_0x3ad5('0x16')][_0x4b4a88]){delete _0x1fb6f3['variables'][_0x4b4a88];logger[_0x3ad5('0x42')](_0x3ad5('0x46'),_0x4b4a88,util[_0x3ad5('0x44')](_0x30705f,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0x28')]=function(){logger[_0x3ad5('0x42')](_0x3ad5('0x47'));clearChannels(this[_0x3ad5('0x11')]);this[_0x3ad5('0x48')](this[_0x3ad5('0x45')]);clearAgentBooked(this[_0x3ad5('0x10')]);clearVoiceQueues(this[_0x3ad5('0x13')]);clearCampaigns(this[_0x3ad5('0x15')]);};VoiceQueueReport['prototype'][_0x3ad5('0x48')]=function(_0x5cf352){var _0xe693b=this;if(!_[_0x3ad5('0x33')](_0x5cf352)){for(var _0x18359f in _0x5cf352){if(_0x5cf352[_0x3ad5('0x34')](_0x18359f)){_0xe693b[_0x3ad5('0x49')](_0x5cf352[_0x18359f],_0x3ad5('0x4a'));delete _0x5cf352[_0x18359f];}}}};VoiceQueueReport[_0x3ad5('0x39')]['emit']=function(_0x5847ac,_0x23e76d,_0x12e0da){io['to'](_0x5847ac)[_0x3ad5('0x4b')](_0x23e76d,_0x12e0da);};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0x4c')]=function(_0x2108ed,_0x274661){logger[_0x3ad5('0x4d')](_0x3ad5('0x4e')+_0x274661+_0x3ad5('0x4f'),_0x2108ed[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x2108ed,{'showHidden':![],'depth':null}));this[_0x3ad5('0x4b')](util[_0x3ad5('0x51')](_0x3ad5('0x52'),_0x2108ed[_0x3ad5('0x53')]),_0x3ad5('0x54'),_0x2108ed);io[_0x3ad5('0x4b')]('voice_queue_presence:save',_0x2108ed);};VoiceQueueReport['prototype'][_0x3ad5('0x49')]=function(_0x6d237e,_0x550c1c){logger[_0x3ad5('0x4d')]('[%s][voiceQueueReport]['+_0x550c1c+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x6d237e[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x6d237e,{'showHidden':![],'depth':null}));this[_0x3ad5('0x4b')](util[_0x3ad5('0x51')](_0x3ad5('0x52'),_0x6d237e[_0x3ad5('0x53')]),_0x3ad5('0x55'),_0x6d237e);io['emit'](_0x3ad5('0x56'),_0x6d237e);};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0x57')]=function(_0x2e39e3,_0xe49e70){if(_0x2e39e3['type']===_0x3ad5('0x58')){var _0x4de10b={'id':_0x2e39e3['id'],'name':_0x2e39e3[_0x3ad5('0x53')],'strategy':_0x2e39e3[_0x3ad5('0x59')],'answered':_0x2e39e3['answered'],'available':_0x2e39e3['available'],'loggedIn':_0x2e39e3['loggedIn'],'pTalking':_0x2e39e3[_0x3ad5('0x36')],'sumBillable':_0x2e39e3[_0x3ad5('0x5a')],'sumDuration':_0x2e39e3[_0x3ad5('0x5b')],'sumHoldTime':_0x2e39e3[_0x3ad5('0x5c')]||0x0,'talking':_0x2e39e3['talking'],'total':_0x2e39e3['total'],'type':_0x2e39e3[_0x3ad5('0x5d')],'unmanaged':_0x2e39e3[_0x3ad5('0x5e')],'abandoned':_0x2e39e3[_0x3ad5('0x5f')],'waiting':_0x2e39e3['waiting']};if(_0x2e39e3[_0x3ad5('0x60')]){_0x4de10b[_0x3ad5('0x60')]={'id':_0x2e39e3['Trunk']['id'],'name':_0x2e39e3[_0x3ad5('0x60')][_0x3ad5('0x53')],'active':_0x2e39e3[_0x3ad5('0x60')]['active'],'callerid':_0x2e39e3['Trunk'][_0x3ad5('0x61')]};}if(_0x2e39e3['Interval']){_0x4de10b[_0x3ad5('0x62')]={'id':_0x2e39e3['Interval']['id'],'name':_0x2e39e3[_0x3ad5('0x62')][_0x3ad5('0x53')]};}var _0x4cddc5=md5(JSON[_0x3ad5('0x63')](_0x4de10b));if(_0x2e39e3[_0x3ad5('0x3')]!==_0x4cddc5){_0x2e39e3[_0x3ad5('0x3')]=_0x4cddc5;logger['debug']('[voiceQueueReport]['+_0xe49e70+_0x3ad5('0x64'),util[_0x3ad5('0x44')](_0x4de10b,{'showHidden':![],'depth':null}));this[_0x3ad5('0x4b')](util[_0x3ad5('0x51')](_0x3ad5('0x52'),_0x4de10b['name']),_0x3ad5('0x65'),_0x4de10b);}}};VoiceQueueReport[_0x3ad5('0x39')]['isNotNull']=function(_0x43bf0e){return _0x43bf0e!==null&&!_['isUndefined'](_0x43bf0e);};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0x32')]=function(){var _0x28ca27=this;setInterval(function(){_0x28ca27[_0x3ad5('0x3a')]();ami[_0x3ad5('0x3d')]({'action':_0x3ad5('0x66')})[_0x3ad5('0x40')](function(_0x3b4609){logger[_0x3ad5('0x42')](_0x3ad5('0x67'),util['inspect'](_0x3b4609,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0x31')]=function(){var _0x57177c=this;setInterval(function(){if(_0x57177c[_0x3ad5('0x14')]){return ami['Action']({'action':_0x3ad5('0x17')})['then'](function(_0x358570){_0x57177c[_0x3ad5('0x14')]=![];})['catch'](function(_0x2f2231){logger['error'](_0x3ad5('0x68'),util[_0x3ad5('0x44')](_0x2f2231,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x3ad5('0x39')]['syncQueueSummary']=function(_0x45474a){try{if(this['isNotNull'](_0x45474a)&&this[_0x3ad5('0x69')](_0x45474a['queue'])){logger[_0x3ad5('0x4d')](_0x3ad5('0x6a'),util[_0x3ad5('0x44')](_0x45474a,{'showHidden':![],'depth':null}));if(this[_0x3ad5('0x13')][_0x45474a['queue']]){logger['info'](_0x3ad5('0x6b'),_0x45474a[_0x3ad5('0x6c')]);var _0x4282f5=_['countBy'](this['channels'],_0x3ad5('0x6c'))[_0x45474a[_0x3ad5('0x6c')]]||0x0;var _0x2096ca=_0x4282f5-_0x45474a[_0x3ad5('0x6d')];if(this['voiceQueues'][_0x45474a[_0x3ad5('0x6c')]][_0x3ad5('0x37')]!==_[_0x3ad5('0x6e')](_0x45474a[_0x3ad5('0x6d')])||this[_0x3ad5('0x13')][_0x45474a[_0x3ad5('0x6c')]]['loggedIn']!==_['toNumber'](_0x45474a[_0x3ad5('0x6f')])||this[_0x3ad5('0x13')][_0x45474a[_0x3ad5('0x6c')]]['available']!==_['toNumber'](_0x45474a['available'])||this['voiceQueues'][_0x45474a['queue']]['talking']!==_0x2096ca){this[_0x3ad5('0x13')][_0x45474a['queue']][_0x3ad5('0x37')]=_['toNumber'](_0x45474a[_0x3ad5('0x6d')]);this[_0x3ad5('0x13')][_0x45474a[_0x3ad5('0x6c')]][_0x3ad5('0x70')]=_[_0x3ad5('0x6e')](_0x45474a[_0x3ad5('0x6f')]);this['voiceQueues'][_0x45474a[_0x3ad5('0x6c')]]['available']=_['toNumber'](_0x45474a['available']);this[_0x3ad5('0x13')][_0x45474a[_0x3ad5('0x6c')]][_0x3ad5('0x71')]=_0x2096ca>0x0?_0x2096ca:0x0;this[_0x3ad5('0x13')][_0x45474a[_0x3ad5('0x6c')]][_0x3ad5('0x71')]=this['voiceQueues'][_0x45474a[_0x3ad5('0x6c')]][_0x3ad5('0x71')]>_[_0x3ad5('0x6e')](_0x45474a[_0x3ad5('0x6f')])?_[_0x3ad5('0x6e')](_0x45474a[_0x3ad5('0x6f')]):this[_0x3ad5('0x13')][_0x45474a[_0x3ad5('0x6c')]]['talking'];this[_0x3ad5('0x57')](this['voiceQueues'][_0x45474a[_0x3ad5('0x6c')]],_0x3ad5('0x17'));}logger[_0x3ad5('0x4d')](_0x3ad5('0x72'),util[_0x3ad5('0x44')](this[_0x3ad5('0x13')][_0x45474a[_0x3ad5('0x6c')]],{'showHidden':![],'depth':null}));ami[_0x3ad5('0x4b')]('custom:queuesummary',this['voiceQueues'][_0x45474a[_0x3ad5('0x6c')]]);}}}catch(_0x27c32e){logger['error']('[voiceQueueReport][queuesummary]',util[_0x3ad5('0x44')](_0x27c32e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0x1b')]=function(_0x5678b2){logger[_0x3ad5('0x4d')](_0x3ad5('0x73'),util[_0x3ad5('0x44')](_0x5678b2,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x3ad5('0x1c')]=function(_0x33726b){try{if(this[_0x3ad5('0x69')](_0x33726b)){logger[_0x3ad5('0x4d')](_0x3ad5('0x74'),_0x33726b[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x33726b,{'showHidden':![],'depth':null}));if(_[_0x3ad5('0x75')](this[_0x3ad5('0x45')][_0x33726b[_0x3ad5('0x50')]]))this[_0x3ad5('0x45')][_0x33726b[_0x3ad5('0x50')]]=[];if(_[_0x3ad5('0x75')](this[_0x3ad5('0x11')][_0x33726b[_0x3ad5('0x50')]]))this[_0x3ad5('0x11')][_0x33726b['uniqueid']]={};var _0x280cdc=new QueueReport();_0x280cdc[_0x3ad5('0x53')]=_0x33726b['queue'];_0x280cdc[_0x3ad5('0x5d')]=this[_0x3ad5('0x13')][_0x280cdc[_0x3ad5('0x53')]]&&this[_0x3ad5('0x13')][_0x280cdc[_0x3ad5('0x53')]]['type']?this[_0x3ad5('0x13')][_0x280cdc['name']]['type']||_0x3ad5('0x58'):'inbound';_0x280cdc[_0x3ad5('0x6c')]=_0x33726b['queue'];_0x280cdc[_0x3ad5('0x76')]=moment()[_0x3ad5('0x51')](_0x3ad5('0x77'));_0x280cdc[_0x3ad5('0x78')]=_0x33726b[_0x3ad5('0x78')];_0x280cdc['count']=_0x33726b['count'];_0x280cdc[_0x3ad5('0x50')]=_0x33726b[_0x3ad5('0x50')];_0x280cdc[_0x3ad5('0x79')]=this[_0x3ad5('0x11')][_0x33726b['uniqueid']][_0x3ad5('0x79')];logger[_0x3ad5('0x7a')](_0x3ad5('0x7b'),_0x280cdc[_0x3ad5('0x53')],_0x280cdc[_0x3ad5('0x5d')]);_[_0x3ad5('0x7c')](_0x280cdc,_[_0x3ad5('0x7d')](_0x33726b,_['keys'](_0x280cdc)));this['queueReports'][_0x33726b[_0x3ad5('0x50')]]['push'](_0x280cdc);this['channels'][_0x33726b['uniqueid']]=_0x280cdc;this['emitVoiceQueueChannelSave'](_0x280cdc,_0x3ad5('0x7e'));}}catch(_0x1f4ce6){logger[_0x3ad5('0x42')](_0x3ad5('0x74'),_0x33726b[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x1f4ce6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0x1e')]=function(_0x13958a){try{if(this['isNotNull'](_0x13958a)){logger[_0x3ad5('0x4d')](_0x3ad5('0x7f'),_0x13958a[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x13958a,{'showHidden':![],'depth':null}));if(this[_0x3ad5('0x45')][_0x13958a[_0x3ad5('0x50')]]){var _0x270241=_[_0x3ad5('0x80')](this[_0x3ad5('0x45')][_0x13958a['uniqueid']]);_0x270241[_0x3ad5('0x81')]=![];_0x270241['queuecallercompleteAt']=null;_0x270241[_0x3ad5('0x82')]=_0x13958a[_0x3ad5('0x82')];_0x270241[_0x3ad5('0x83')]=_0x13958a[_0x3ad5('0x83')];_0x270241[_0x3ad5('0x1d')]=!![];_0x270241['queuecallerabandonAt']=moment()['format'](_0x3ad5('0x77'));_0x270241[_0x3ad5('0x84')]=_0x3ad5('0x85');_0x270241[_0x3ad5('0x86')]=null;logger['info'](_0x3ad5('0x87'),_0x270241[_0x3ad5('0x53')],_0x270241['type']);this[_0x3ad5('0x11')][_0x13958a[_0x3ad5('0x50')]]=_0x270241;this[_0x3ad5('0x49')](_0x270241,'queuecallerabandon');}}}catch(_0x452633){logger['error'](_0x3ad5('0x7f'),_0x13958a[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x452633,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x3845d){try{if(this[_0x3ad5('0x69')](_0x3845d)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x3845d[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x3845d,{'showHidden':![],'depth':null}));if(this[_0x3ad5('0x45')][_0x3845d['uniqueid']]){var _0x4fda54=_['last'](this[_0x3ad5('0x45')][_0x3845d[_0x3ad5('0x50')]]);_0x4fda54[_0x3ad5('0x88')]=moment()[_0x3ad5('0x51')](_0x3ad5('0x77'));_0x4fda54[_0x3ad5('0x89')]=_0x3845d[_0x3ad5('0x89')];_0x4fda54[_0x3ad5('0x8a')]=_0x3845d[_0x3ad5('0x8a')];logger['info'](_0x3ad5('0x8b'),_0x4fda54[_0x3ad5('0x53')],_0x4fda54[_0x3ad5('0x5d')],_0x3845d['connectedlinenum'],_0x3845d['connectedlinename']);this[_0x3ad5('0x11')][_0x3845d[_0x3ad5('0x50')]]=_0x4fda54;this[_0x3ad5('0x4c')](_0x4fda54,_0x3ad5('0x1f'));}}}catch(_0x371079){logger[_0x3ad5('0x42')](_0x3ad5('0x8c'),_0x3845d[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x371079,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3ad5('0x22')]=function(_0xa33217){try{if(this[_0x3ad5('0x69')](_0xa33217)){logger[_0x3ad5('0x4d')]('[%s][voiceQueueReport][agentconnect]',_0xa33217['uniqueid'],util[_0x3ad5('0x44')](_0xa33217,{'showHidden':![],'depth':null}));if(this[_0x3ad5('0x45')][_0xa33217['uniqueid']]){var _0x6b8889=_['last'](this[_0x3ad5('0x45')][_0xa33217[_0x3ad5('0x50')]]);_0x6b8889[_0x3ad5('0x81')]=!![];_0x6b8889[_0x3ad5('0x84')]='COMPLETEDBYAGENT';logger[_0x3ad5('0x7a')](_0x3ad5('0x8d'),_0x6b8889['name'],_0x6b8889['type']);}}}catch(_0x535bc6){logger[_0x3ad5('0x42')]('[%s][voiceQueueReport][agentconnect]',_0xa33217[_0x3ad5('0x50')],util['inspect'](_0x535bc6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3ad5('0x21')]=function(_0x4e7ae9){try{if(this[_0x3ad5('0x69')](_0x4e7ae9)){logger[_0x3ad5('0x4d')](_0x3ad5('0x8e'),_0x4e7ae9[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x4e7ae9,{'showHidden':![],'depth':null}));if(this[_0x3ad5('0x45')][_0x4e7ae9[_0x3ad5('0x50')]]){var _0x382cdb=_['last'](this[_0x3ad5('0x45')][_0x4e7ae9[_0x3ad5('0x50')]]);_0x382cdb[_0x3ad5('0x1d')]=![];_0x382cdb[_0x3ad5('0x8f')]=null;_0x382cdb[_0x3ad5('0x90')]=!![];_0x382cdb[_0x3ad5('0x86')]=_0x4e7ae9[_0x3ad5('0x91')];_0x382cdb[_0x3ad5('0x82')]=_0x4e7ae9['holdtime'];_0x382cdb[_0x3ad5('0x81')]=!![];_0x382cdb[_0x3ad5('0x92')]=![];_0x382cdb['queuecallerexitAt']=null;if(!_0x382cdb[_0x3ad5('0x93')]){if(_0x4e7ae9[_0x3ad5('0x94')]=='transfer'){_0x382cdb[_0x3ad5('0x84')]='COMPLETED';logger[_0x3ad5('0x7a')](_0x3ad5('0x95'),_0x382cdb['name'],_0x382cdb[_0x3ad5('0x5d')]);}else{if(_['startsWith'](_0x4e7ae9[_0x3ad5('0x3f')][_0x3ad5('0x96')](),_0x3ad5('0x97'))){if(this[_0x3ad5('0x45')][_0x4e7ae9['linkedid']]){var _0x269b1a=_[_0x3ad5('0x80')](this[_0x3ad5('0x45')][_0x4e7ae9['linkedid']]);_0x269b1a[_0x3ad5('0x81')]=![];_0x269b1a['queuecallerexit']=!![];_0x269b1a[_0x3ad5('0x98')]=moment(_0x382cdb['queuecallerjoinAt'])[_0x3ad5('0x99')](_0x4e7ae9[_0x3ad5('0x82')],_0x3ad5('0x9a'))[_0x3ad5('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x269b1a[_0x3ad5('0x84')]=_0x3ad5('0x9b');_0x269b1a[_0x3ad5('0x93')]=!![];_0x269b1a[_0x3ad5('0x9c')]=_0x3ad5('0x9d');_0x269b1a[_0x3ad5('0x9e')]=_0x4e7ae9[_0x3ad5('0x9f')];_0x269b1a[_0x3ad5('0xa0')]=_0x4e7ae9['uniqueid'];logger[_0x3ad5('0x7a')](_0x3ad5('0xa1'),_0x269b1a['name'],_0x269b1a[_0x3ad5('0x5d')]);var _0x1fff9b=this[_0x3ad5('0x45')][_0x4e7ae9[_0x3ad5('0xa2')]];this[_0x3ad5('0x45')][_0x4e7ae9[_0x3ad5('0xa2')]]=this['queueReports'][_0x4e7ae9[_0x3ad5('0x50')]];this[_0x3ad5('0x45')][_0x4e7ae9['uniqueid']]=_0x1fff9b;}}else{_0x382cdb[_0x3ad5('0x84')]=_0x3ad5('0xa3')+_0x4e7ae9[_0x3ad5('0x94')][_0x3ad5('0xa4')]();logger[_0x3ad5('0x7a')](_0x3ad5('0xa5'),_0x382cdb[_0x3ad5('0x53')],_0x382cdb['type'],_0x382cdb['queuecallerexitreason']);}}}this['channels'][_0x4e7ae9[_0x3ad5('0x50')]]=_0x382cdb;this['emitVoiceQueueChannelRemove'](_0x382cdb,_0x3ad5('0x20'));}}}catch(_0x58fb0c){logger[_0x3ad5('0x42')]('[%s][voiceQueueReport][agentcomplete]',_0x4e7ae9[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x58fb0c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3ad5('0x24')]=function(_0x2afd30){try{if(this[_0x3ad5('0x69')](_0x2afd30)){logger['debug'](_0x3ad5('0xa6'),_0x2afd30[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x2afd30,{'showHidden':![],'depth':null}));this['addVariable'](_0x2afd30[_0x3ad5('0x50')],_['keys'](_0x2afd30['variable'])[0x0],_0x2afd30[_0x3ad5('0xa7')]);if(this[_0x3ad5('0x45')][_0x2afd30[_0x3ad5('0x50')]]){var _0x5dee23=_[_0x3ad5('0x80')](this[_0x3ad5('0x45')][_0x2afd30[_0x3ad5('0x50')]]);if(_0x5dee23){if(this[_0x3ad5('0x69')](_0x2afd30['variable'])&&this[_0x3ad5('0x69')](_0x2afd30[_0x3ad5('0xa8')]['queuestatus'])){switch(_0x2afd30[_0x3ad5('0xa7')]){case _0x3ad5('0xa9'):_0x5dee23[_0x3ad5('0x92')]=![];_0x5dee23[_0x3ad5('0x98')]=null;break;case _0x3ad5('0xaa'):_0x5dee23[_0x3ad5('0xab')]='timeout';_0x5dee23[_0x3ad5('0x92')]=!![];_0x5dee23[_0x3ad5('0x98')]=moment()[_0x3ad5('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x5dee23[_0x3ad5('0x88')]=moment()[_0x3ad5('0x51')](_0x3ad5('0x77'));logger[_0x3ad5('0x4d')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x2afd30['uniqueid'],util[_0x3ad5('0x44')](_0x5dee23,{'showHidden':![],'depth':null}));ami[_0x3ad5('0x4b')](_0x3ad5('0xac'),_0x5dee23);break;default:_0x5dee23['queuecallerexit']=!![];_0x5dee23[_0x3ad5('0x98')]=moment()['format'](_0x3ad5('0x77'));_0x5dee23[_0x3ad5('0x88')]=moment()[_0x3ad5('0x51')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5dee23[_0x3ad5('0x1d')]=![];_0x5dee23[_0x3ad5('0x8f')]=null;_0x5dee23['queuecallerexitreason']=_0x2afd30['value'];this[_0x3ad5('0x11')][_0x2afd30[_0x3ad5('0x50')]]=_0x5dee23;this['emitVoiceQueueChannelRemove'](_0x5dee23,_0x3ad5('0x23'));}else if(this['isNotNull'](_0x2afd30['variable'])&&this[_0x3ad5('0x69')](_0x2afd30[_0x3ad5('0xa8')][_0x3ad5('0xad')])){if(!_0x5dee23[_0x3ad5('0x1d')]){_0x5dee23[_0x3ad5('0x92')]=!![];_0x5dee23[_0x3ad5('0x98')]=moment()[_0x3ad5('0x51')](_0x3ad5('0x77'));_0x5dee23['queuecallerexitreason']=_0x3ad5('0xae');_0x5dee23[_0x3ad5('0x88')]=moment()[_0x3ad5('0x51')](_0x3ad5('0x77'));this[_0x3ad5('0x11')][_0x2afd30[_0x3ad5('0x50')]]=_0x5dee23;}}logger['info'](_0x3ad5('0xaf'),_0x2afd30['uniqueid'],_0x5dee23[_0x3ad5('0x53')],_0x5dee23[_0x3ad5('0x5d')],_['keys'](_0x2afd30[_0x3ad5('0xa8')])[0x0],_0x2afd30[_0x3ad5('0xa7')]);_0x5dee23[_0x3ad5('0x16')]=this[_0x3ad5('0x16')][_0x2afd30[_0x3ad5('0x50')]];}}}}catch(_0x1842dd){logger['error'](_0x3ad5('0xa6'),_0x2afd30[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x1842dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0xb0')]=function(_0x3d8a88,_0xdce191,_0x379795){var _0x435fa6=[_0x3ad5('0xb1'),'rtpaudioqosbridged',_0x3ad5('0xb2'),_0x3ad5('0xb3'),_0x3ad5('0xb4'),_0x3ad5('0xb5'),_0x3ad5('0xb6'),_0x3ad5('0xb7'),_0x3ad5('0xb8'),'sipuri',_0x3ad5('0xb9'),'bridgepvtcallid',_0x3ad5('0xba'),_0x3ad5('0xbb'),_0x3ad5('0xbc'),_0x3ad5('0xbd'),'membername',_0x3ad5('0xbe'),_0x3ad5('0xbf')];if(!_['isNil'](_0xdce191)&&!_[_0x3ad5('0xc0')](_0x435fa6,_0xdce191)){if(_[_0x3ad5('0x75')](this[_0x3ad5('0x16')][_0x3d8a88])){this[_0x3ad5('0x16')][_0x3d8a88]={};}this[_0x3ad5('0x16')][_0x3d8a88][_0xdce191]=_0x379795;}};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0x26')]=function(_0x20054e){try{if(this['isNotNull'](_0x20054e)){logger[_0x3ad5('0x4d')]('[%s][voiceQueueReport][hangup]',_0x20054e[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x20054e,{'showHidden':![],'depth':null}));if(this[_0x3ad5('0x45')][_0x20054e[_0x3ad5('0x50')]]){for(var _0x2318e6=0x0,_0x2682eb={};_0x2318e6<this['queueReports'][_0x20054e[_0x3ad5('0x50')]][_0x3ad5('0xc1')];_0x2318e6+=0x1){_0x2682eb=this[_0x3ad5('0x45')][_0x20054e['uniqueid']][_0x2318e6];if(this[_0x3ad5('0x13')][_0x2682eb['queue']]){if(_0x2682eb[_0x3ad5('0x92')]&&_0x2682eb['transfer']!=!![]){this[_0x3ad5('0x13')][_0x2682eb[_0x3ad5('0x6c')]][_0x3ad5('0x5e')]+=0x1;}if(_0x2682eb[_0x3ad5('0x1d')]){this[_0x3ad5('0x13')][_0x2682eb[_0x3ad5('0x6c')]][_0x3ad5('0x5f')]+=0x1;}this[_0x3ad5('0x13')][_0x2682eb['queue']][_0x3ad5('0x5c')]+=moment(_0x2682eb['queuecallerleaveAt'])[_0x3ad5('0xc2')](_0x2682eb[_0x3ad5('0x76')],_0x3ad5('0x9a'))||0x0;if(_0x2318e6===this[_0x3ad5('0x45')][_0x20054e[_0x3ad5('0x50')]][_0x3ad5('0xc1')]-0x1){this[_0x3ad5('0x13')][_0x2682eb[_0x3ad5('0x6c')]][_0x3ad5('0x5b')]+=moment()[_0x3ad5('0xc3')](0x0)[_0x3ad5('0xc2')](_0x2682eb[_0x3ad5('0x76')],_0x3ad5('0x9a'));this[_0x3ad5('0x13')][_0x2682eb[_0x3ad5('0x6c')]][_0x3ad5('0xc4')]+=0x1;if(_0x2682eb[_0x3ad5('0x81')]){this[_0x3ad5('0x13')][_0x2682eb[_0x3ad5('0x6c')]][_0x3ad5('0xc5')]+=0x1;this['voiceQueues'][_0x2682eb[_0x3ad5('0x6c')]][_0x3ad5('0x5a')]+=moment()['milliseconds'](0x0)['diff'](_0x2682eb[_0x3ad5('0x88')],_0x3ad5('0x9a'));_0x2682eb[_0x3ad5('0xc6')]=moment()[_0x3ad5('0x51')](_0x3ad5('0x77'));_0x2682eb['queuecallerexit']=![];_0x2682eb['queuecallerexitAt']=null;}if(_0x2682eb[_0x3ad5('0x92')]&&_0x2682eb[_0x3ad5('0x93')]!=!![]){_0x2682eb[_0x3ad5('0xab')]=_0x3ad5('0x5e');logger['debug'](_0x3ad5('0xc7'),_0x20054e[_0x3ad5('0x50')],util['inspect'](_0x2682eb,{'showHidden':![],'depth':null}));ami[_0x3ad5('0x4b')](_0x3ad5('0xc8'),_0x2682eb);}if(_0x2682eb['queuecallerabandon']){_0x2682eb[_0x3ad5('0xab')]=_0x3ad5('0x5f');logger['debug'](_0x3ad5('0xc9'),_0x20054e['uniqueid'],util[_0x3ad5('0x44')](_0x2682eb,{'showHidden':![],'depth':null}));ami[_0x3ad5('0x4b')](_0x3ad5('0xca'),_0x2682eb);}}else{this[_0x3ad5('0x13')][_0x2682eb[_0x3ad5('0x6c')]][_0x3ad5('0x5b')]+=this[_0x3ad5('0x13')][_0x2682eb[_0x3ad5('0x6c')]][_0x3ad5('0x5c')];}logger[_0x3ad5('0x7a')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x20054e[_0x3ad5('0x50')],_0x2682eb['name'],_0x2682eb[_0x3ad5('0x5d')],_0x20054e[_0x3ad5('0xcb')]);this[_0x3ad5('0x11')][_0x20054e[_0x3ad5('0x50')]]=_0x2682eb;this[_0x3ad5('0x49')](_0x2682eb,'hangup');this[_0x3ad5('0x57')](this[_0x3ad5('0x13')][_0x2682eb[_0x3ad5('0x6c')]],_0x3ad5('0x25'));}}logger['debug'](_0x3ad5('0xcc'),_0x20054e[_0x3ad5('0x50')],util[_0x3ad5('0x44')](this[_0x3ad5('0x45')][_0x20054e[_0x3ad5('0x50')]],{'showHidden':![],'depth':null}));ami[_0x3ad5('0x4b')]('custom:voiceQueueReport',this[_0x3ad5('0x45')][_0x20054e[_0x3ad5('0x50')]]);delete this[_0x3ad5('0x45')][_0x20054e[_0x3ad5('0x50')]];delete this[_0x3ad5('0x11')][_0x20054e[_0x3ad5('0x50')]];}if(this[_0x3ad5('0x16')][_0x20054e[_0x3ad5('0x50')]]){delete this[_0x3ad5('0x16')][_0x20054e[_0x3ad5('0x50')]];}}}catch(_0x961d8a){logger[_0x3ad5('0x42')](_0x3ad5('0xcd'),_0x20054e[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x961d8a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3ad5('0x39')]['syncAttendedTransfer']=function(_0x2f3d93){try{if(this[_0x3ad5('0x69')](_0x2f3d93)){logger[_0x3ad5('0x4d')]('[%s][voiceQueueReport][attendedtransfer]',_0x2f3d93['uniqueid'],util[_0x3ad5('0x44')](_0x2f3d93,{'showHidden':![],'depth':null}));var _0x5e45b3;if(this['queueReports'][_0x2f3d93[_0x3ad5('0xce')]]){_0x5e45b3=_['last'](this[_0x3ad5('0x45')][_0x2f3d93[_0x3ad5('0xce')]]);_0x5e45b3['transferexten']=_0x2f3d93[_0x3ad5('0xcf')];_0x5e45b3[_0x3ad5('0xa0')]=_0x2f3d93[_0x3ad5('0xd0')];_0x5e45b3[_0x3ad5('0x84')]=_0x3ad5('0xd1');_0x5e45b3[_0x3ad5('0x93')]=!![];_0x5e45b3[_0x3ad5('0x9c')]=_0x3ad5('0xd2');if(this[_0x3ad5('0x45')][_0x2f3d93[_0x3ad5('0xd0')]]){var _0x2a265f=this[_0x3ad5('0x45')][_0x2f3d93['secondtransfereruniqueid']];this[_0x3ad5('0x45')][_0x2f3d93[_0x3ad5('0xd0')]]=this['queueReports'][_0x2f3d93[_0x3ad5('0xce')]];this['queueReports'][_0x2f3d93['transfereeuniqueid']]=_0x2a265f;var _0x5b81d5=_[_0x3ad5('0x80')](this[_0x3ad5('0x45')][_0x2f3d93['transfereeuniqueid']]);_0x5b81d5[_0x3ad5('0x3b')]=!![];}logger['info'](_0x3ad5('0xd3'),_0x2f3d93[_0x3ad5('0x50')],_0x5e45b3[_0x3ad5('0x53')],_0x5e45b3[_0x3ad5('0x5d')],_0x5e45b3['transferexten'],_0x5e45b3[_0x3ad5('0xa0')]);}else if(this[_0x3ad5('0x45')][_0x2f3d93['transfertargetuniqueid']]){_0x5e45b3=_[_0x3ad5('0x80')](this[_0x3ad5('0x45')][_0x2f3d93[_0x3ad5('0xd4')]]);_0x5e45b3[_0x3ad5('0x9e')]=_0x2f3d93[_0x3ad5('0xd5')];_0x5e45b3['transferuniqueid']=_0x2f3d93[_0x3ad5('0xd6')];_0x5e45b3[_0x3ad5('0x84')]=_0x3ad5('0xd1');_0x5e45b3[_0x3ad5('0x93')]=!![];_0x5e45b3['transfertype']=_0x3ad5('0xd2');if(this['queueReports'][_0x2f3d93[_0x3ad5('0xd6')]]){var _0x2a265f=this['queueReports'][_0x2f3d93[_0x3ad5('0xd6')]];this[_0x3ad5('0x45')][_0x2f3d93['origtransfereruniqueid']]=this[_0x3ad5('0x45')][_0x2f3d93['transfertargetuniqueid']];this[_0x3ad5('0x45')][_0x2f3d93[_0x3ad5('0xd4')]]=_0x2a265f;var _0x5b81d5=_[_0x3ad5('0x80')](this['queueReports'][_0x2f3d93['transfertargetuniqueid']]);_0x5b81d5[_0x3ad5('0x3b')]=!![];}logger[_0x3ad5('0x7a')](_0x3ad5('0xd3'),_0x2f3d93[_0x3ad5('0x50')],_0x5e45b3[_0x3ad5('0x53')],_0x5e45b3[_0x3ad5('0x5d')],_0x5e45b3[_0x3ad5('0x9e')],_0x5e45b3['transferuniqueid']);}}}catch(_0x52ef52){logger[_0x3ad5('0x42')](_0x3ad5('0xd7'),_0x2f3d93[_0x3ad5('0x50')],util['inspect'](_0x52ef52,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3ad5('0x39')]['syncBlindTransfer']=function(_0x1ffb80){try{if(this[_0x3ad5('0x69')](_0x1ffb80)){logger[_0x3ad5('0x4d')]('[%s][voiceQueueReport][blindtransfer]',_0x1ffb80[_0x3ad5('0x50')],util['inspect'](_0x1ffb80,{'showHidden':![],'depth':null}));if(this[_0x3ad5('0x45')][_0x1ffb80[_0x3ad5('0xce')]]){var _0x512033=_[_0x3ad5('0x80')](this['queueReports'][_0x1ffb80['transfereeuniqueid']]);_0x512033[_0x3ad5('0x84')]=_0x3ad5('0xd8');_0x512033[_0x3ad5('0x93')]=!![];_0x512033[_0x3ad5('0x9c')]=_0x3ad5('0xd9');_0x512033['transferexten']=_0x1ffb80[_0x3ad5('0xda')];_0x512033['transferuniqueid']=_0x1ffb80[_0x3ad5('0xce')];logger[_0x3ad5('0x7a')]('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x1ffb80[_0x3ad5('0x50')],_0x512033[_0x3ad5('0x53')],_0x512033[_0x3ad5('0x5d')],_0x512033['transferexten'],_0x512033[_0x3ad5('0xa0')]);this[_0x3ad5('0x26')]({'event':_0x3ad5('0xdb'),'uniqueid':_0x1ffb80['transfereeuniqueid'],'context':_0x1ffb80[_0x3ad5('0xdc')],'channel':_0x1ffb80['transfererchannel']});}}}catch(_0x389fd0){logger[_0x3ad5('0x42')](_0x3ad5('0xdd'),_0x1ffb80['uniqueid'],util['inspect'](_0x389fd0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0x2b')]=function(_0x1c659f){try{if(this[_0x3ad5('0x69')](_0x1c659f)){logger['debug'](_0x3ad5('0xde'),_0x1c659f['uniqueid'],util[_0x3ad5('0x44')](_0x1c659f,{'showHidden':![],'depth':null}));if(this[_0x3ad5('0x45')][_0x1c659f[_0x3ad5('0x50')]]){var _0x2abb55=_[_0x3ad5('0x80')](this[_0x3ad5('0x45')][_0x1c659f[_0x3ad5('0x50')]]);if(!_[_0x3ad5('0x3c')](_0x2abb55['queuecallerleaveAt'])){_0x2abb55[_0x3ad5('0xdf')]=moment()[_0x3ad5('0x51')](_0x3ad5('0x77'));logger[_0x3ad5('0x7a')](_0x3ad5('0xe0'),_0x1c659f[_0x3ad5('0x50')],_0x2abb55[_0x3ad5('0xdf')]);}}}}catch(_0x3936c8){logger[_0x3ad5('0x42')]('[%s][voiceQueueReport][musiconholdstart]',_0x1c659f[_0x3ad5('0x50')],util['inspect'](_0x3936c8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3ad5('0x39')][_0x3ad5('0xe1')]=function(_0x2257f4){try{if(this[_0x3ad5('0x69')](_0x2257f4)){logger[_0x3ad5('0x4d')]('[%s][voiceQueueReport][musiconholdstop]',_0x2257f4[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x2257f4,{'showHidden':![],'depth':null}));if(this[_0x3ad5('0x45')][_0x2257f4[_0x3ad5('0x50')]]){var _0x4cb1d6=_[_0x3ad5('0x80')](this['queueReports'][_0x2257f4['uniqueid']]);if(!_['isNil'](_0x4cb1d6[_0x3ad5('0xdf')])){_0x4cb1d6[_0x3ad5('0xe2')]+=moment()[_0x3ad5('0xc3')](0x0)['diff'](_0x4cb1d6[_0x3ad5('0xdf')],_0x3ad5('0x9a'));logger[_0x3ad5('0x7a')](_0x3ad5('0xe3'),_0x2257f4['uniqueid'],_0x4cb1d6[_0x3ad5('0xe2')]);delete _0x4cb1d6[_0x3ad5('0xdf')];}}}}catch(_0x323855){logger[_0x3ad5('0x42')]('[%s][voiceQueueReport][musiconholdstop]',_0x2257f4['uniqueid'],util[_0x3ad5('0x44')](_0x323855,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3ad5('0x2a')]=function(_0x4ae3ba){try{if(this[_0x3ad5('0x69')](_0x4ae3ba)){logger[_0x3ad5('0x4d')](_0x3ad5('0xe4'),_0x4ae3ba[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x4ae3ba,{'showHidden':![],'depth':null}));if(_0x4ae3ba[_0x3ad5('0xe5')][_0x3ad5('0x96')]()===_0x3ad5('0xe6')){_0x4ae3ba[_0x3ad5('0xe7')]=_0x4ae3ba[_0x3ad5('0xe8')]&&_0x4ae3ba[_0x3ad5('0xe8')][_0x3ad5('0xe9')](_0x3ad5('0xea'))?_0x4ae3ba[_0x3ad5('0xe8')]:(_0x4ae3ba[_0x3ad5('0xe8')]||_0x4ae3ba['applicationdata'])[_0x3ad5('0x96')]();if(_['startsWith'](_0x4ae3ba[_0x3ad5('0xe7')][_0x3ad5('0x96')](),_0x3ad5('0xeb'))){logger[_0x3ad5('0x7a')](_0x3ad5('0xec'),_0x4ae3ba[_0x3ad5('0x50')],_0x4ae3ba[_0x3ad5('0xe5')],_0x4ae3ba[_0x3ad5('0xe7')]);if(_[_0x3ad5('0x75')](this['channels'][_0x4ae3ba[_0x3ad5('0x50')]]))this[_0x3ad5('0x11')][_0x4ae3ba[_0x3ad5('0x50')]]={};var _0x34c1f2=_0x4ae3ba['applicationdata']['split']('=');var _0x2fc1c1=_0x34c1f2[0x0]['toLowerCase']()[_0x3ad5('0xed')](/cdr\((.*)\)/);if(_0x2fc1c1)this[_0x3ad5('0x11')][_0x4ae3ba[_0x3ad5('0x50')]][_0x2fc1c1[0x1]]=_0x34c1f2[0x1];}}}}catch(_0x22be91){logger[_0x3ad5('0x42')]('[%s][voiceQueueReport][newexten]',_0x4ae3ba[_0x3ad5('0x50')],util[_0x3ad5('0x44')](_0x22be91,{'showHidden':![],'depth':null}));}};module[_0x3ad5('0xee')]=VoiceQueueReport;
\ No newline at end of file
+var _0xb11e=['loggedin','queuesummary','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','[%s][voiceQueueReport][queuecallerjoin]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','ABANDONED','lastAssignedTo','[%s][voiceQueueReport][queuecallerabandon]','syncQueueCallerLeave','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][queuecallerleave]','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','toLowerCase','local/','add','transfertype','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','linkedid','toUpperCase','syncVarSet','addVariable','keys','variable','value','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','includes','length','unmanaged','queuecallerjoinAt','seconds','milliseconds','sumBillable','diff','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferuniqueid','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','syncMusicOnHoldStart','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','ioredis','ami','../ami','../model/queueReport','redis','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','syncAgentComplete','agentconnect','varset','hangup','syncHangup','syncFullyBooted','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','hasOwnProperty','isEmpty','originated','pTalking','waiting','unlockRR','prototype','clearZombieChannels','enqueue','isNil','status','channel','catch','message','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','talking','total','type','abandoned','Trunk','callerid','Interval','stringify','[voiceQueueReport][','isUndefined','Action','queues','[voiceQueueReport][queues]','loopQueueSummary','then','[voiceQueueReport][queuesummary]','isNotNull','[voiceQueueReport][queuesummary]\x20event:','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb11e,0x7d));var _0xeb11=function(_0x1e9a07,_0x2848d0){_0x1e9a07=_0x1e9a07-0x0;var _0x3f45c9=_0xb11e[_0x1e9a07];return _0x3f45c9;};'use strict';var _=require(_0xeb11('0x0'));var moment=require(_0xeb11('0x1'));var util=require(_0xeb11('0x2'));var md5=require(_0xeb11('0x3'));var Redis=require(_0xeb11('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xeb11('0x5'));var ami=require(_0xeb11('0x6'));var QueueReport=require(_0xeb11('0x7'));config[_0xeb11('0x8')]=_['defaults'](config[_0xeb11('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xeb11('0x8')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0xfa9ff7){this[_0xeb11('0x9')]=this[_0xeb11('0x9')]?this['tail'][_0xeb11('0xa')](_0xfa9ff7):_0xfa9ff7();};function VoiceQueueReport(_0x2e3052){this[_0xeb11('0xb')]=new Sequence();this[_0xeb11('0xc')]={};this[_0xeb11('0xd')]=_0x2e3052[_0xeb11('0xd')];this[_0xeb11('0xe')]=_0x2e3052[_0xeb11('0xf')];this['voiceQueues']=_0x2e3052[_0xeb11('0x10')];this[_0xeb11('0x11')]=!![];this[_0xeb11('0x12')]=_0x2e3052['campaigns'];this[_0xeb11('0x13')]={};ami['on']('queuesummary',this[_0xeb11('0x14')]['bind'](this));ami['on']('queuesummarycomplete',this[_0xeb11('0x15')][_0xeb11('0x16')](this));ami['on'](_0xeb11('0x17'),this[_0xeb11('0x18')]['bind'](this));ami['on']('queuecallerabandon',this[_0xeb11('0x19')][_0xeb11('0x16')](this));ami['on'](_0xeb11('0x1a'),this['syncQueueCallerLeave'][_0xeb11('0x16')](this));ami['on']('agentcomplete',this[_0xeb11('0x1b')][_0xeb11('0x16')](this));ami['on'](_0xeb11('0x1c'),this['syncAgentConnect'][_0xeb11('0x16')](this));ami['on'](_0xeb11('0x1d'),this['syncVarSet']['bind'](this));ami['on'](_0xeb11('0x1e'),this[_0xeb11('0x1f')]['bind'](this));ami['on']('fullybooted',this[_0xeb11('0x20')][_0xeb11('0x16')](this));ami['on']('newexten',this['syncNewExten'][_0xeb11('0x16')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xeb11('0x21'),this[_0xeb11('0x22')]['bind'](this));ami['on'](_0xeb11('0x23'),this[_0xeb11('0x24')]['bind'](this));ami['on'](_0xeb11('0x25'),this[_0xeb11('0x26')][_0xeb11('0x16')](this));this['loopQueueSummary']();this[_0xeb11('0x27')]();}function clearChannels(_0x4c2d23){if(!_['isEmpty'](_0x4c2d23)){for(var _0x8af064 in _0x4c2d23){if(_0x4c2d23[_0xeb11('0x28')](_0x8af064)){delete _0x4c2d23[_0x8af064];}}}}function clearCampaigns(_0x14d7a1){if(!_['isEmpty'](_0x14d7a1)){for(var _0x4d8cf8 in _0x14d7a1){if(_0x14d7a1[_0xeb11('0x28')](_0x4d8cf8)){_0x14d7a1[_0x4d8cf8]['originated']=0x0;}}}}function clearVoiceQueues(_0x39c0da){if(!_[_0xeb11('0x29')](_0x39c0da)){for(var _0x377abf in _0x39c0da){if(_0x39c0da[_0xeb11('0x28')](_0x377abf)){_0x39c0da[_0x377abf][_0xeb11('0x2a')]=0x0;_0x39c0da[_0x377abf]['talking']=0x0;_0x39c0da[_0x377abf][_0xeb11('0x2b')]=0x0;_0x39c0da[_0x377abf][_0xeb11('0x2c')]=0x0;_0x39c0da[_0x377abf]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x104561){if(!_['isEmpty'](_0x104561)){for(var _0xa18410 in _0x104561){if(_0x104561[_0xeb11('0x28')](_0xa18410)){_0x104561[_0xa18410][_0xeb11('0x2d')]=!![];}}}}VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x2f')]=function(){var _0x80f0d9=this;for(var _0x26ca49 in this[_0xeb11('0xe')]){if(this[_0xeb11('0xe')]['hasOwnProperty'](_0x26ca49)&&!this[_0xeb11('0xe')][_0x26ca49]['switch']){this[_0xeb11('0xb')][_0xeb11('0x30')](function(){if(!_[_0xeb11('0x31')](_0x80f0d9['channels'][_0x26ca49])){return ami['Action']({'action':_0xeb11('0x32'),'channel':_0x80f0d9[_0xeb11('0xe')][_0x26ca49][_0xeb11('0x33')]})[_0xeb11('0x34')](function(_0x5cf5cd){if(_0x5cf5cd[_0xeb11('0x35')]===_0xeb11('0x36')){setTimeout(function(){if(_0x80f0d9[_0xeb11('0xe')][_0x26ca49]){delete _0x80f0d9['channels'][_0x26ca49];logger[_0xeb11('0x37')]('[%s][voiceQueueReport][checkChannel]',_0x26ca49,util[_0xeb11('0x38')](_0x5cf5cd,{'showHidden':![],'depth':null}));}if(_0x80f0d9['queueReports'][_0x26ca49]){delete _0x80f0d9[_0xeb11('0xc')][_0x26ca49];logger[_0xeb11('0x37')](_0xeb11('0x39'),_0x26ca49,util[_0xeb11('0x38')](_0x5cf5cd,{'showHidden':![],'depth':null}));}if(_0x80f0d9[_0xeb11('0x13')][_0x26ca49]){delete _0x80f0d9[_0xeb11('0x13')][_0x26ca49];logger[_0xeb11('0x37')]('[%s][voiceQueueReport][checkVariables]',_0x26ca49,util[_0xeb11('0x38')](_0x5cf5cd,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0xeb11('0x20')]=function(){logger['error'](_0xeb11('0x3a'));clearChannels(this[_0xeb11('0xe')]);this[_0xeb11('0x3b')](this[_0xeb11('0xc')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xeb11('0x10')]);clearCampaigns(this[_0xeb11('0x12')]);};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x3b')]=function(_0x25fb56){var _0x5ba5b6=this;if(!_[_0xeb11('0x29')](_0x25fb56)){for(var _0x3a462a in _0x25fb56){if(_0x25fb56[_0xeb11('0x28')](_0x3a462a)){_0x5ba5b6[_0xeb11('0x3c')](_0x25fb56[_0x3a462a],_0xeb11('0x3d'));delete _0x25fb56[_0x3a462a];}}}};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x3e')]=function(_0x36f9b1,_0x1fdc11,_0x5bdf58){io['to'](_0x36f9b1)[_0xeb11('0x3e')](_0x1fdc11,_0x5bdf58);};VoiceQueueReport['prototype'][_0xeb11('0x3f')]=function(_0xcdf358,_0x485660){logger['debug'](_0xeb11('0x40')+_0x485660+_0xeb11('0x41'),_0xcdf358[_0xeb11('0x42')],util[_0xeb11('0x38')](_0xcdf358,{'showHidden':![],'depth':null}));this['emit'](util[_0xeb11('0x43')](_0xeb11('0x44'),_0xcdf358[_0xeb11('0x45')]),_0xeb11('0x46'),_0xcdf358);io['emit']('voice_queue_presence:save',_0xcdf358);};VoiceQueueReport[_0xeb11('0x2e')]['emitVoiceQueueChannelRemove']=function(_0x7b589,_0xa750bf){logger[_0xeb11('0x47')](_0xeb11('0x40')+_0xa750bf+_0xeb11('0x48'),_0x7b589[_0xeb11('0x42')],util['inspect'](_0x7b589,{'showHidden':![],'depth':null}));this['emit'](util[_0xeb11('0x43')](_0xeb11('0x44'),_0x7b589[_0xeb11('0x45')]),'voice_queue_channel:remove',_0x7b589);io[_0xeb11('0x3e')](_0xeb11('0x49'),_0x7b589);};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x4a')]=function(_0x30e891,_0x57b9f8){if(_0x30e891['type']===_0xeb11('0x4b')){var _0x5482d4={'id':_0x30e891['id'],'name':_0x30e891[_0xeb11('0x45')],'strategy':_0x30e891[_0xeb11('0x4c')],'answered':_0x30e891[_0xeb11('0x4d')],'available':_0x30e891[_0xeb11('0x4e')],'loggedIn':_0x30e891[_0xeb11('0x4f')],'pTalking':_0x30e891[_0xeb11('0x2b')],'sumBillable':_0x30e891['sumBillable'],'sumDuration':_0x30e891[_0xeb11('0x50')],'sumHoldTime':_0x30e891[_0xeb11('0x51')]||0x0,'talking':_0x30e891[_0xeb11('0x52')],'total':_0x30e891[_0xeb11('0x53')],'type':_0x30e891[_0xeb11('0x54')],'unmanaged':_0x30e891['unmanaged'],'abandoned':_0x30e891[_0xeb11('0x55')],'waiting':_0x30e891[_0xeb11('0x2c')]};if(_0x30e891['Trunk']){_0x5482d4[_0xeb11('0x56')]={'id':_0x30e891[_0xeb11('0x56')]['id'],'name':_0x30e891[_0xeb11('0x56')][_0xeb11('0x45')],'active':_0x30e891[_0xeb11('0x56')]['active'],'callerid':_0x30e891['Trunk'][_0xeb11('0x57')]};}if(_0x30e891['Interval']){_0x5482d4[_0xeb11('0x58')]={'id':_0x30e891[_0xeb11('0x58')]['id'],'name':_0x30e891[_0xeb11('0x58')][_0xeb11('0x45')]};}var _0x4940b3=md5(JSON[_0xeb11('0x59')](_0x5482d4));if(_0x30e891[_0xeb11('0x3')]!==_0x4940b3){_0x30e891[_0xeb11('0x3')]=_0x4940b3;logger[_0xeb11('0x47')](_0xeb11('0x5a')+_0x57b9f8+']\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x5482d4,{'showHidden':![],'depth':null}));this['emit'](util[_0xeb11('0x43')](_0xeb11('0x44'),_0x5482d4['name']),'voice_queue:save',_0x5482d4);}}};VoiceQueueReport[_0xeb11('0x2e')]['isNotNull']=function(_0x146e2a){return _0x146e2a!==null&&!_[_0xeb11('0x5b')](_0x146e2a);};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x27')]=function(){var _0x24ecdc=this;setInterval(function(){_0x24ecdc[_0xeb11('0x2f')]();ami[_0xeb11('0x5c')]({'action':_0xeb11('0x5d')})[_0xeb11('0x34')](function(_0x270c74){logger[_0xeb11('0x37')](_0xeb11('0x5e'),util[_0xeb11('0x38')](_0x270c74,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x5f')]=function(){var _0x2618ed=this;setInterval(function(){if(_0x2618ed[_0xeb11('0x11')]){return ami[_0xeb11('0x5c')]({'action':'queuesummary'})[_0xeb11('0x60')](function(_0x30f4fc){_0x2618ed[_0xeb11('0x11')]=![];})['catch'](function(_0x20b4ee){logger[_0xeb11('0x37')](_0xeb11('0x61'),util[_0xeb11('0x38')](_0x20b4ee,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xeb11('0x14')]=function(_0x6813d2){try{if(this[_0xeb11('0x62')](_0x6813d2)&&this['isNotNull'](_0x6813d2['queue'])){logger[_0xeb11('0x47')](_0xeb11('0x63'),util[_0xeb11('0x38')](_0x6813d2,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x6813d2[_0xeb11('0x64')]]){logger[_0xeb11('0x65')](_0xeb11('0x66'),_0x6813d2['queue']);var _0x3045c6=_[_0xeb11('0x67')](this[_0xeb11('0xe')],_0xeb11('0x64'))[_0x6813d2['queue']]||0x0;var _0x35b286=_0x3045c6-_0x6813d2[_0xeb11('0x68')];if(this[_0xeb11('0x10')][_0x6813d2[_0xeb11('0x64')]][_0xeb11('0x2c')]!==_[_0xeb11('0x69')](_0x6813d2[_0xeb11('0x68')])||this[_0xeb11('0x10')][_0x6813d2[_0xeb11('0x64')]]['loggedIn']!==_[_0xeb11('0x69')](_0x6813d2[_0xeb11('0x6a')])||this[_0xeb11('0x10')][_0x6813d2['queue']]['available']!==_['toNumber'](_0x6813d2[_0xeb11('0x4e')])||this[_0xeb11('0x10')][_0x6813d2[_0xeb11('0x64')]][_0xeb11('0x52')]!==_0x35b286){this[_0xeb11('0x10')][_0x6813d2['queue']]['waiting']=_['toNumber'](_0x6813d2['callers']);this[_0xeb11('0x10')][_0x6813d2[_0xeb11('0x64')]][_0xeb11('0x4f')]=_[_0xeb11('0x69')](_0x6813d2['loggedin']);this['voiceQueues'][_0x6813d2['queue']][_0xeb11('0x4e')]=_[_0xeb11('0x69')](_0x6813d2[_0xeb11('0x4e')]);this[_0xeb11('0x10')][_0x6813d2['queue']][_0xeb11('0x52')]=_0x35b286>0x0?_0x35b286:0x0;this[_0xeb11('0x10')][_0x6813d2[_0xeb11('0x64')]][_0xeb11('0x52')]=this['voiceQueues'][_0x6813d2['queue']][_0xeb11('0x52')]>_[_0xeb11('0x69')](_0x6813d2[_0xeb11('0x6a')])?_['toNumber'](_0x6813d2['loggedin']):this[_0xeb11('0x10')][_0x6813d2[_0xeb11('0x64')]][_0xeb11('0x52')];this[_0xeb11('0x4a')](this['voiceQueues'][_0x6813d2[_0xeb11('0x64')]],_0xeb11('0x6b'));}logger['debug'](_0xeb11('0x6c'),util[_0xeb11('0x38')](this[_0xeb11('0x10')][_0x6813d2['queue']],{'showHidden':![],'depth':null}));ami[_0xeb11('0x3e')](_0xeb11('0x6d'),this[_0xeb11('0x10')][_0x6813d2[_0xeb11('0x64')]]);}}}catch(_0x2a6db1){logger[_0xeb11('0x37')](_0xeb11('0x61'),util[_0xeb11('0x38')](_0x2a6db1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x15')]=function(_0x8cf461){logger[_0xeb11('0x47')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xeb11('0x38')](_0x8cf461,{'showHidden':![],'depth':null}));this[_0xeb11('0x11')]=!![];};VoiceQueueReport[_0xeb11('0x2e')]['syncQueueCallerJoin']=function(_0x37a2b7){try{if(this[_0xeb11('0x62')](_0x37a2b7)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x37a2b7[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x37a2b7,{'showHidden':![],'depth':null}));if(_[_0xeb11('0x5b')](this[_0xeb11('0xc')][_0x37a2b7['uniqueid']]))this[_0xeb11('0xc')][_0x37a2b7[_0xeb11('0x42')]]=[];if(_[_0xeb11('0x5b')](this['channels'][_0x37a2b7['uniqueid']]))this['channels'][_0x37a2b7[_0xeb11('0x42')]]={};var _0x1e1f23=new QueueReport();_0x1e1f23['name']=_0x37a2b7[_0xeb11('0x64')];_0x1e1f23[_0xeb11('0x54')]=this[_0xeb11('0x10')][_0x1e1f23[_0xeb11('0x45')]]&&this[_0xeb11('0x10')][_0x1e1f23[_0xeb11('0x45')]][_0xeb11('0x54')]?this[_0xeb11('0x10')][_0x1e1f23[_0xeb11('0x45')]]['type']||_0xeb11('0x4b'):_0xeb11('0x4b');_0x1e1f23[_0xeb11('0x64')]=_0x37a2b7[_0xeb11('0x64')];_0x1e1f23['queuecallerjoinAt']=moment()[_0xeb11('0x43')](_0xeb11('0x6e'));_0x1e1f23[_0xeb11('0x6f')]=_0x37a2b7[_0xeb11('0x6f')];_0x1e1f23[_0xeb11('0x70')]=_0x37a2b7['count'];_0x1e1f23[_0xeb11('0x42')]=_0x37a2b7[_0xeb11('0x42')];_0x1e1f23[_0xeb11('0x71')]=this[_0xeb11('0xe')][_0x37a2b7[_0xeb11('0x42')]]['routealias'];logger[_0xeb11('0x65')](_0xeb11('0x72'),_0x1e1f23[_0xeb11('0x45')],_0x1e1f23[_0xeb11('0x54')]);_[_0xeb11('0x73')](_0x1e1f23,_[_0xeb11('0x74')](_0x37a2b7,_['keys'](_0x1e1f23)));this[_0xeb11('0xc')][_0x37a2b7[_0xeb11('0x42')]]['push'](_0x1e1f23);this[_0xeb11('0xe')][_0x37a2b7[_0xeb11('0x42')]]=_0x1e1f23;this[_0xeb11('0x3f')](_0x1e1f23,_0xeb11('0x17'));}}catch(_0x103f17){logger['error'](_0xeb11('0x75'),_0x37a2b7[_0xeb11('0x42')],util['inspect'](_0x103f17,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x19')]=function(_0x4b6450){try{if(this[_0xeb11('0x62')](_0x4b6450)){logger[_0xeb11('0x47')]('[%s][voiceQueueReport][queuecallerabandon]',_0x4b6450['uniqueid'],util[_0xeb11('0x38')](_0x4b6450,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4b6450['uniqueid']]){var _0x558e0d=_['last'](this[_0xeb11('0xc')][_0x4b6450[_0xeb11('0x42')]]);_0x558e0d[_0xeb11('0x76')]=![];_0x558e0d[_0xeb11('0x77')]=null;_0x558e0d[_0xeb11('0x78')]=_0x4b6450['holdtime'];_0x558e0d[_0xeb11('0x79')]=_0x4b6450[_0xeb11('0x79')];_0x558e0d[_0xeb11('0x7a')]=!![];_0x558e0d['queuecallerabandonAt']=moment()[_0xeb11('0x43')](_0xeb11('0x6e'));_0x558e0d['queuecallerexitreason']=_0xeb11('0x7b');_0x558e0d[_0xeb11('0x7c')]=null;logger[_0xeb11('0x65')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x558e0d[_0xeb11('0x45')],_0x558e0d[_0xeb11('0x54')]);this[_0xeb11('0xe')][_0x4b6450[_0xeb11('0x42')]]=_0x558e0d;this[_0xeb11('0x3c')](_0x558e0d,'queuecallerabandon');}}}catch(_0x42cbf3){logger[_0xeb11('0x37')](_0xeb11('0x7d'),_0x4b6450[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x42cbf3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x7e')]=function(_0x268363){try{if(this[_0xeb11('0x62')](_0x268363)){logger[_0xeb11('0x47')]('[%s][voiceQueueReport][queuecallerleave]',_0x268363['uniqueid'],util[_0xeb11('0x38')](_0x268363,{'showHidden':![],'depth':null}));if(this[_0xeb11('0xc')][_0x268363[_0xeb11('0x42')]]){var _0x44caa9=_[_0xeb11('0x7f')](this['queueReports'][_0x268363[_0xeb11('0x42')]]);_0x44caa9[_0xeb11('0x80')]=moment()[_0xeb11('0x43')](_0xeb11('0x6e'));_0x44caa9[_0xeb11('0x81')]=_0x268363[_0xeb11('0x81')];_0x44caa9[_0xeb11('0x82')]=_0x268363[_0xeb11('0x82')];logger[_0xeb11('0x65')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x44caa9[_0xeb11('0x45')],_0x44caa9[_0xeb11('0x54')],_0x268363[_0xeb11('0x81')],_0x268363[_0xeb11('0x82')]);this[_0xeb11('0xe')][_0x268363[_0xeb11('0x42')]]=_0x44caa9;this[_0xeb11('0x3f')](_0x44caa9,'queuecallerleave');}}}catch(_0x420dac){logger[_0xeb11('0x37')](_0xeb11('0x83'),_0x268363[_0xeb11('0x42')],util['inspect'](_0x420dac,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeb11('0x84')]=function(_0x3064e8){try{if(this['isNotNull'](_0x3064e8)){logger['debug'](_0xeb11('0x85'),_0x3064e8[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x3064e8,{'showHidden':![],'depth':null}));if(this[_0xeb11('0xc')][_0x3064e8[_0xeb11('0x42')]]){var _0x5d6446=_['last'](this['queueReports'][_0x3064e8[_0xeb11('0x42')]]);_0x5d6446['queuecallercomplete']=!![];_0x5d6446[_0xeb11('0x86')]=_0xeb11('0x87');logger[_0xeb11('0x65')](_0xeb11('0x88'),_0x5d6446[_0xeb11('0x45')],_0x5d6446['type']);}}}catch(_0x436716){logger[_0xeb11('0x37')](_0xeb11('0x85'),_0x3064e8[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x436716,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x1b')]=function(_0x1e9ece){try{if(this[_0xeb11('0x62')](_0x1e9ece)){logger[_0xeb11('0x47')](_0xeb11('0x89'),_0x1e9ece['uniqueid'],util[_0xeb11('0x38')](_0x1e9ece,{'showHidden':![],'depth':null}));if(this[_0xeb11('0xc')][_0x1e9ece[_0xeb11('0x42')]]){var _0x1a3b04=_['last'](this[_0xeb11('0xc')][_0x1e9ece['uniqueid']]);_0x1a3b04[_0xeb11('0x7a')]=![];_0x1a3b04[_0xeb11('0x8a')]=null;_0x1a3b04[_0xeb11('0x8b')]=!![];_0x1a3b04[_0xeb11('0x7c')]=_0x1e9ece['membername'];_0x1a3b04[_0xeb11('0x78')]=_0x1e9ece['holdtime'];_0x1a3b04[_0xeb11('0x76')]=!![];_0x1a3b04[_0xeb11('0x8c')]=![];_0x1a3b04[_0xeb11('0x8d')]=null;if(!_0x1a3b04[_0xeb11('0x8e')]){if(_0x1e9ece[_0xeb11('0x8f')]==_0xeb11('0x8e')){_0x1a3b04[_0xeb11('0x86')]=_0xeb11('0x90');logger[_0xeb11('0x65')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x1a3b04[_0xeb11('0x45')],_0x1a3b04['type']);}else{if(_['startsWith'](_0x1e9ece[_0xeb11('0x33')][_0xeb11('0x91')](),_0xeb11('0x92'))){if(this[_0xeb11('0xc')][_0x1e9ece['linkedid']]){var _0x1ce983=_['last'](this[_0xeb11('0xc')][_0x1e9ece['linkedid']]);_0x1ce983['queuecallercomplete']=![];_0x1ce983[_0xeb11('0x8c')]=!![];_0x1ce983[_0xeb11('0x8d')]=moment(_0x1a3b04['queuecallerjoinAt'])[_0xeb11('0x93')](_0x1e9ece['holdtime'],'seconds')[_0xeb11('0x43')](_0xeb11('0x6e'));_0x1ce983[_0xeb11('0x86')]='FORWARDTRANSFER';_0x1ce983[_0xeb11('0x8e')]=!![];_0x1ce983[_0xeb11('0x94')]='FORWARD';_0x1ce983[_0xeb11('0x95')]=_0x1e9ece[_0xeb11('0x96')];_0x1ce983['transferuniqueid']=_0x1e9ece[_0xeb11('0x42')];logger[_0xeb11('0x65')](_0xeb11('0x97'),_0x1ce983[_0xeb11('0x45')],_0x1ce983['type']);var _0x33f28b=this[_0xeb11('0xc')][_0x1e9ece[_0xeb11('0x98')]];this[_0xeb11('0xc')][_0x1e9ece[_0xeb11('0x98')]]=this[_0xeb11('0xc')][_0x1e9ece['uniqueid']];this[_0xeb11('0xc')][_0x1e9ece[_0xeb11('0x42')]]=_0x33f28b;}}else{_0x1a3b04['queuecallerexitreason']='COMPLETEDBY'+_0x1e9ece[_0xeb11('0x8f')][_0xeb11('0x99')]();logger[_0xeb11('0x65')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x1a3b04[_0xeb11('0x45')],_0x1a3b04[_0xeb11('0x54')],_0x1a3b04[_0xeb11('0x86')]);}}}this[_0xeb11('0xe')][_0x1e9ece[_0xeb11('0x42')]]=_0x1a3b04;this[_0xeb11('0x3c')](_0x1a3b04,'agentcomplete');}}}catch(_0x189ae6){logger['error'](_0xeb11('0x89'),_0x1e9ece[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x189ae6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x9a')]=function(_0x55d066){try{if(this['isNotNull'](_0x55d066)){logger[_0xeb11('0x47')]('[%s][voiceQueueReport][varset]',_0x55d066[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x55d066,{'showHidden':![],'depth':null}));this[_0xeb11('0x9b')](_0x55d066[_0xeb11('0x42')],_[_0xeb11('0x9c')](_0x55d066[_0xeb11('0x9d')])[0x0],_0x55d066[_0xeb11('0x9e')]);if(this[_0xeb11('0xc')][_0x55d066['uniqueid']]){var _0x101497=_['last'](this[_0xeb11('0xc')][_0x55d066[_0xeb11('0x42')]]);if(_0x101497){if(this[_0xeb11('0x62')](_0x55d066[_0xeb11('0x9d')])&&this['isNotNull'](_0x55d066[_0xeb11('0x9d')]['queuestatus'])){switch(_0x55d066[_0xeb11('0x9e')]){case _0xeb11('0x9f'):_0x101497[_0xeb11('0x8c')]=![];_0x101497[_0xeb11('0x8d')]=null;break;case _0xeb11('0xa0'):_0x101497[_0xeb11('0xa1')]=_0xeb11('0xa2');_0x101497[_0xeb11('0x8c')]=!![];_0x101497[_0xeb11('0x8d')]=moment()[_0xeb11('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x101497[_0xeb11('0x80')]=moment()[_0xeb11('0x43')](_0xeb11('0x6e'));logger[_0xeb11('0x47')](_0xeb11('0xa3'),_0x55d066[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x101497,{'showHidden':![],'depth':null}));ami['emit'](_0xeb11('0xa4'),_0x101497);break;default:_0x101497[_0xeb11('0x8c')]=!![];_0x101497['queuecallerexitAt']=moment()['format'](_0xeb11('0x6e'));_0x101497[_0xeb11('0x80')]=moment()[_0xeb11('0x43')](_0xeb11('0x6e'));}_0x101497[_0xeb11('0x7a')]=![];_0x101497[_0xeb11('0x8a')]=null;_0x101497['queuecallerexitreason']=_0x55d066['value'];this[_0xeb11('0xe')][_0x55d066['uniqueid']]=_0x101497;this[_0xeb11('0x3c')](_0x101497,_0xeb11('0x1d'));}else if(this[_0xeb11('0x62')](_0x55d066[_0xeb11('0x9d')])&&this[_0xeb11('0x62')](_0x55d066['variable'][_0xeb11('0xa5')])){if(!_0x101497['queuecallerabandon']){_0x101497[_0xeb11('0x8c')]=!![];_0x101497[_0xeb11('0x8d')]=moment()[_0xeb11('0x43')](_0xeb11('0x6e'));_0x101497['queuecallerexitreason']=_0xeb11('0xa6');_0x101497[_0xeb11('0x80')]=moment()[_0xeb11('0x43')](_0xeb11('0x6e'));this[_0xeb11('0xe')][_0x55d066[_0xeb11('0x42')]]=_0x101497;}}logger['info'](_0xeb11('0xa7'),_0x55d066[_0xeb11('0x42')],_0x101497[_0xeb11('0x45')],_0x101497[_0xeb11('0x54')],_[_0xeb11('0x9c')](_0x55d066[_0xeb11('0x9d')])[0x0],_0x55d066[_0xeb11('0x9e')]);_0x101497[_0xeb11('0x13')]=this[_0xeb11('0x13')][_0x55d066['uniqueid']];}}}}catch(_0xefe075){logger[_0xeb11('0x37')](_0xeb11('0xa8'),_0x55d066['uniqueid'],util[_0xeb11('0x38')](_0xefe075,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x9b')]=function(_0x22a2ec,_0x3b5ac8,_0x35463f){var _0x31f56e=[_0xeb11('0xa9'),'rtpaudioqosbridged',_0xeb11('0xaa'),_0xeb11('0xab'),_0xeb11('0xac'),_0xeb11('0xad'),_0xeb11('0xae'),_0xeb11('0xaf'),'sipcallid',_0xeb11('0xb0'),_0xeb11('0xb1'),_0xeb11('0xb2'),'membercalls',_0xeb11('0xb3'),'memberinterface',_0xeb11('0xb4'),_0xeb11('0xb5'),_0xeb11('0xb6'),_0xeb11('0xb7')];if(!_[_0xeb11('0x31')](_0x3b5ac8)&&!_[_0xeb11('0xb8')](_0x31f56e,_0x3b5ac8)){if(_['isUndefined'](this[_0xeb11('0x13')][_0x22a2ec])){this['variables'][_0x22a2ec]={};}this[_0xeb11('0x13')][_0x22a2ec][_0x3b5ac8]=_0x35463f;}};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0x1f')]=function(_0x498b00){try{if(this[_0xeb11('0x62')](_0x498b00)){logger[_0xeb11('0x47')]('[%s][voiceQueueReport][hangup]',_0x498b00['uniqueid'],util['inspect'](_0x498b00,{'showHidden':![],'depth':null}));if(this[_0xeb11('0xc')][_0x498b00[_0xeb11('0x42')]]){for(var _0x34c683=0x0,_0x947ecc={};_0x34c683<this[_0xeb11('0xc')][_0x498b00['uniqueid']][_0xeb11('0xb9')];_0x34c683+=0x1){_0x947ecc=this['queueReports'][_0x498b00['uniqueid']][_0x34c683];if(this[_0xeb11('0x10')][_0x947ecc[_0xeb11('0x64')]]){if(_0x947ecc[_0xeb11('0x8c')]&&_0x947ecc[_0xeb11('0x8e')]!=!![]){this['voiceQueues'][_0x947ecc['queue']][_0xeb11('0xba')]+=0x1;}if(_0x947ecc[_0xeb11('0x7a')]){this[_0xeb11('0x10')][_0x947ecc[_0xeb11('0x64')]]['abandoned']+=0x1;}this[_0xeb11('0x10')][_0x947ecc['queue']][_0xeb11('0x51')]+=moment(_0x947ecc[_0xeb11('0x80')])['diff'](_0x947ecc[_0xeb11('0xbb')],_0xeb11('0xbc'))||0x0;if(_0x34c683===this[_0xeb11('0xc')][_0x498b00['uniqueid']][_0xeb11('0xb9')]-0x1){this[_0xeb11('0x10')][_0x947ecc[_0xeb11('0x64')]][_0xeb11('0x50')]+=moment()[_0xeb11('0xbd')](0x0)['diff'](_0x947ecc[_0xeb11('0xbb')],_0xeb11('0xbc'));this[_0xeb11('0x10')][_0x947ecc[_0xeb11('0x64')]][_0xeb11('0x53')]+=0x1;if(_0x947ecc[_0xeb11('0x76')]){this[_0xeb11('0x10')][_0x947ecc[_0xeb11('0x64')]][_0xeb11('0x4d')]+=0x1;this[_0xeb11('0x10')][_0x947ecc['queue']][_0xeb11('0xbe')]+=moment()[_0xeb11('0xbd')](0x0)[_0xeb11('0xbf')](_0x947ecc[_0xeb11('0x80')],_0xeb11('0xbc'));_0x947ecc[_0xeb11('0x77')]=moment()['format'](_0xeb11('0x6e'));_0x947ecc[_0xeb11('0x8c')]=![];_0x947ecc[_0xeb11('0x8d')]=null;}if(_0x947ecc[_0xeb11('0x8c')]&&_0x947ecc[_0xeb11('0x8e')]!=!![]){_0x947ecc['lastevent']=_0xeb11('0xba');logger[_0xeb11('0x47')](_0xeb11('0xc0'),_0x498b00[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x947ecc,{'showHidden':![],'depth':null}));ami[_0xeb11('0x3e')]('custom:queuecallerunmanaged',_0x947ecc);}if(_0x947ecc['queuecallerabandon']){_0x947ecc[_0xeb11('0xa1')]=_0xeb11('0x55');logger[_0xeb11('0x47')](_0xeb11('0xc1'),_0x498b00['uniqueid'],util[_0xeb11('0x38')](_0x947ecc,{'showHidden':![],'depth':null}));ami[_0xeb11('0x3e')](_0xeb11('0xc2'),_0x947ecc);}}else{this[_0xeb11('0x10')][_0x947ecc['queue']][_0xeb11('0x50')]+=this[_0xeb11('0x10')][_0x947ecc[_0xeb11('0x64')]][_0xeb11('0x51')];}logger[_0xeb11('0x65')](_0xeb11('0xc3'),_0x498b00[_0xeb11('0x42')],_0x947ecc[_0xeb11('0x45')],_0x947ecc[_0xeb11('0x54')],_0x498b00[_0xeb11('0xc4')]);this['channels'][_0x498b00[_0xeb11('0x42')]]=_0x947ecc;this['emitVoiceQueueChannelRemove'](_0x947ecc,_0xeb11('0x1e'));this[_0xeb11('0x4a')](this[_0xeb11('0x10')][_0x947ecc[_0xeb11('0x64')]],_0xeb11('0x1e'));}}logger[_0xeb11('0x47')](_0xeb11('0xc5'),_0x498b00[_0xeb11('0x42')],util[_0xeb11('0x38')](this[_0xeb11('0xc')][_0x498b00[_0xeb11('0x42')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceQueueReport',this[_0xeb11('0xc')][_0x498b00[_0xeb11('0x42')]]);delete this['queueReports'][_0x498b00[_0xeb11('0x42')]];delete this['channels'][_0x498b00[_0xeb11('0x42')]];}if(this['variables'][_0x498b00[_0xeb11('0x42')]]){delete this['variables'][_0x498b00[_0xeb11('0x42')]];}}}catch(_0x120709){logger['error']('[%s][voiceQueueReport][hangup]',_0x498b00[_0xeb11('0x42')],util['inspect'](_0x120709,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb11('0x2e')]['syncAttendedTransfer']=function(_0x583be9){try{if(this['isNotNull'](_0x583be9)){logger[_0xeb11('0x47')](_0xeb11('0xc6'),_0x583be9[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x583be9,{'showHidden':![],'depth':null}));var _0x548405;if(this[_0xeb11('0xc')][_0x583be9[_0xeb11('0xc7')]]){_0x548405=_[_0xeb11('0x7f')](this[_0xeb11('0xc')][_0x583be9[_0xeb11('0xc7')]]);_0x548405[_0xeb11('0x95')]=_0x583be9['secondtransfererexten'];_0x548405[_0xeb11('0xc8')]=_0x583be9['secondtransfereruniqueid'];_0x548405[_0xeb11('0x86')]=_0xeb11('0xc9');_0x548405[_0xeb11('0x8e')]=!![];_0x548405[_0xeb11('0x94')]=_0xeb11('0xca');if(this['queueReports'][_0x583be9[_0xeb11('0xcb')]]){var _0x19cc95=this[_0xeb11('0xc')][_0x583be9[_0xeb11('0xcb')]];this['queueReports'][_0x583be9[_0xeb11('0xcb')]]=this[_0xeb11('0xc')][_0x583be9[_0xeb11('0xc7')]];this[_0xeb11('0xc')][_0x583be9[_0xeb11('0xc7')]]=_0x19cc95;var _0x433ca7=_['last'](this['queueReports'][_0x583be9['transfereeuniqueid']]);_0x433ca7[_0xeb11('0xcc')]=!![];}logger[_0xeb11('0x65')](_0xeb11('0xcd'),_0x583be9[_0xeb11('0x42')],_0x548405[_0xeb11('0x45')],_0x548405[_0xeb11('0x54')],_0x548405[_0xeb11('0x95')],_0x548405[_0xeb11('0xc8')]);}else if(this[_0xeb11('0xc')][_0x583be9[_0xeb11('0xce')]]){_0x548405=_[_0xeb11('0x7f')](this[_0xeb11('0xc')][_0x583be9[_0xeb11('0xce')]]);_0x548405['transferexten']=_0x583be9['origtransfererexten'];_0x548405[_0xeb11('0xc8')]=_0x583be9[_0xeb11('0xcf')];_0x548405[_0xeb11('0x86')]=_0xeb11('0xc9');_0x548405[_0xeb11('0x8e')]=!![];_0x548405[_0xeb11('0x94')]=_0xeb11('0xca');if(this['queueReports'][_0x583be9[_0xeb11('0xcf')]]){var _0x19cc95=this[_0xeb11('0xc')][_0x583be9[_0xeb11('0xcf')]];this['queueReports'][_0x583be9['origtransfereruniqueid']]=this['queueReports'][_0x583be9[_0xeb11('0xce')]];this[_0xeb11('0xc')][_0x583be9[_0xeb11('0xce')]]=_0x19cc95;var _0x433ca7=_[_0xeb11('0x7f')](this['queueReports'][_0x583be9[_0xeb11('0xce')]]);_0x433ca7[_0xeb11('0xcc')]=!![];}logger[_0xeb11('0x65')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x583be9['uniqueid'],_0x548405['name'],_0x548405[_0xeb11('0x54')],_0x548405['transferexten'],_0x548405[_0xeb11('0xc8')]);}}}catch(_0x36b61e){logger[_0xeb11('0x37')]('[%s][voiceQueueReport][attendedtransfer]',_0x583be9[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x36b61e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeb11('0x26')]=function(_0x32df76){try{if(this[_0xeb11('0x62')](_0x32df76)){logger[_0xeb11('0x47')](_0xeb11('0xd0'),_0x32df76[_0xeb11('0x42')],util['inspect'](_0x32df76,{'showHidden':![],'depth':null}));if(this[_0xeb11('0xc')][_0x32df76[_0xeb11('0xc7')]]){var _0x538d80=_[_0xeb11('0x7f')](this[_0xeb11('0xc')][_0x32df76['transfereeuniqueid']]);_0x538d80[_0xeb11('0x86')]='BLINDTRANSFER';_0x538d80[_0xeb11('0x8e')]=!![];_0x538d80[_0xeb11('0x94')]=_0xeb11('0xd1');_0x538d80['transferexten']=_0x32df76[_0xeb11('0xd2')];_0x538d80['transferuniqueid']=_0x32df76[_0xeb11('0xc7')];logger['info'](_0xeb11('0xd3'),_0x32df76[_0xeb11('0x42')],_0x538d80['name'],_0x538d80[_0xeb11('0x54')],_0x538d80[_0xeb11('0x95')],_0x538d80[_0xeb11('0xc8')]);this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x32df76[_0xeb11('0xc7')],'context':_0x32df76[_0xeb11('0xd4')],'channel':_0x32df76[_0xeb11('0xd5')]});}}}catch(_0x333adc){logger[_0xeb11('0x37')](_0xeb11('0xd0'),_0x32df76[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x333adc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb11('0x2e')][_0xeb11('0xd6')]=function(_0x5a3543){try{if(this['isNotNull'](_0x5a3543)){logger[_0xeb11('0x47')]('[%s][voiceQueueReport][musiconholdstart]',_0x5a3543['uniqueid'],util['inspect'](_0x5a3543,{'showHidden':![],'depth':null}));if(this[_0xeb11('0xc')][_0x5a3543[_0xeb11('0x42')]]){var _0x3d036a=_['last'](this['queueReports'][_0x5a3543[_0xeb11('0x42')]]);if(!_['isNil'](_0x3d036a[_0xeb11('0x80')])){_0x3d036a[_0xeb11('0xd7')]=moment()[_0xeb11('0x43')](_0xeb11('0x6e'));logger[_0xeb11('0x65')](_0xeb11('0xd8'),_0x5a3543[_0xeb11('0x42')],_0x3d036a[_0xeb11('0xd7')]);}}}}catch(_0x274362){logger[_0xeb11('0x37')](_0xeb11('0xd9'),_0x5a3543[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x274362,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeb11('0x22')]=function(_0x470941){try{if(this[_0xeb11('0x62')](_0x470941)){logger[_0xeb11('0x47')]('[%s][voiceQueueReport][musiconholdstop]',_0x470941[_0xeb11('0x42')],util['inspect'](_0x470941,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x470941[_0xeb11('0x42')]]){var _0x57cee4=_[_0xeb11('0x7f')](this[_0xeb11('0xc')][_0x470941['uniqueid']]);if(!_[_0xeb11('0x31')](_0x57cee4[_0xeb11('0xd7')])){_0x57cee4[_0xeb11('0xda')]+=moment()[_0xeb11('0xbd')](0x0)['diff'](_0x57cee4[_0xeb11('0xd7')],_0xeb11('0xbc'));logger[_0xeb11('0x65')](_0xeb11('0xdb'),_0x470941[_0xeb11('0x42')],_0x57cee4[_0xeb11('0xda')]);delete _0x57cee4[_0xeb11('0xd7')];}}}}catch(_0x57ce40){logger[_0xeb11('0x37')]('[%s][voiceQueueReport][musiconholdstop]',_0x470941['uniqueid'],util[_0xeb11('0x38')](_0x57ce40,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncNewExten']=function(_0x1d9a9f){try{if(this['isNotNull'](_0x1d9a9f)){logger[_0xeb11('0x47')](_0xeb11('0xdc'),_0x1d9a9f[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x1d9a9f,{'showHidden':![],'depth':null}));if(_0x1d9a9f[_0xeb11('0xdd')][_0xeb11('0x91')]()===_0xeb11('0xde')){_0x1d9a9f[_0xeb11('0xdf')]=_0x1d9a9f[_0xeb11('0xe0')]&&_0x1d9a9f[_0xeb11('0xe0')]['startsWith']('CDR(routeAlias)')?_0x1d9a9f[_0xeb11('0xe0')]:(_0x1d9a9f[_0xeb11('0xe0')]||_0x1d9a9f['applicationdata'])['toLowerCase']();if(_[_0xeb11('0xe1')](_0x1d9a9f[_0xeb11('0xdf')][_0xeb11('0x91')](),_0xeb11('0xe2'))){logger[_0xeb11('0x65')](_0xeb11('0xe3'),_0x1d9a9f[_0xeb11('0x42')],_0x1d9a9f[_0xeb11('0xdd')],_0x1d9a9f[_0xeb11('0xdf')]);if(_[_0xeb11('0x5b')](this[_0xeb11('0xe')][_0x1d9a9f['uniqueid']]))this[_0xeb11('0xe')][_0x1d9a9f[_0xeb11('0x42')]]={};var _0x3ba452=_0x1d9a9f[_0xeb11('0xdf')][_0xeb11('0xe4')]('=');var _0x132cc1=_0x3ba452[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x132cc1)this[_0xeb11('0xe')][_0x1d9a9f['uniqueid']][_0x132cc1[0x1]]=_0x3ba452[0x1];}}}}catch(_0x19f22a){logger[_0xeb11('0x37')](_0xeb11('0xe5'),_0x1d9a9f[_0xeb11('0x42')],util[_0xeb11('0x38')](_0x19f22a,{'showHidden':![],'depth':null}));}};module[_0xeb11('0xe6')]=VoiceQueueReport;
\ No newline at end of file
index 8ab73ed..58d3fd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d28=['campaign','queue','Request','CreateReportAgentPreview','../client','createHistory'];(function(_0x5c2c8a,_0x160c22){var _0x38aa9f=function(_0x51a17f){while(--_0x51a17f){_0x5c2c8a['push'](_0x5c2c8a['shift']());}};_0x38aa9f(++_0x160c22);}(_0x0d28,0x184));var _0x80d2=function(_0x3a6922,_0xc728be){_0x3a6922=_0x3a6922-0x0;var _0x9c1b44=_0x0d28[_0x3a6922];return _0x9c1b44;};'use strict';var client=require(_0x80d2('0x0'));exports[_0x80d2('0x1')]=function(_0x5b8d4b){return function(){_0x5b8d4b[_0x80d2('0x2')]=_0x5b8d4b[_0x80d2('0x3')];return client[_0x80d2('0x4')]('CreateReportAgentPreview',{'body':_0x5b8d4b,'log':_0x80d2('0x5')});};};
\ No newline at end of file
+var _0x7a6f=['CreateReportAgentPreview','campaign','Request'];(function(_0x1d0440,_0x3bdbc0){var _0x34bc10=function(_0x131426){while(--_0x131426){_0x1d0440['push'](_0x1d0440['shift']());}};_0x34bc10(++_0x3bdbc0);}(_0x7a6f,0x88));var _0xf7a6=function(_0x478f28,_0x2b17be){_0x478f28=_0x478f28-0x0;var _0x448a80=_0x7a6f[_0x478f28];return _0x448a80;};'use strict';var client=require('../client');exports['createHistory']=function(_0x78c1ab){return function(){_0x78c1ab[_0xf7a6('0x0')]=_0x78c1ab['queue'];return client[_0xf7a6('0x1')](_0xf7a6('0x2'),{'body':_0x78c1ab,'log':_0xf7a6('0x2')});};};
\ No newline at end of file
index 8fa7f2f..2eebb5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f11=['create','CreateAttachment','../client'];(function(_0x53fcd7,_0x2a13af){var _0x433330=function(_0x22a0c7){while(--_0x22a0c7){_0x53fcd7['push'](_0x53fcd7['shift']());}};_0x433330(++_0x2a13af);}(_0x5f11,0x98));var _0x15f1=function(_0x1bdd28,_0x3c22ce){_0x1bdd28=_0x1bdd28-0x0;var _0x341d66=_0x5f11[_0x1bdd28];return _0x341d66;};'use strict';var client=require(_0x15f1('0x0'));exports[_0x15f1('0x1')]=function(_0x26c4d1){return client['Request'](_0x15f1('0x2'),{'body':_0x26c4d1,'log':_0x15f1('0x2')});};
\ No newline at end of file
+var _0x3149=['CreateAttachment','../client','Request'];(function(_0x6ca268,_0x4b068a){var _0x334047=function(_0x34ce00){while(--_0x34ce00){_0x6ca268['push'](_0x6ca268['shift']());}};_0x334047(++_0x4b068a);}(_0x3149,0x181));var _0x9314=function(_0x20ca05,_0x3fa4c4){_0x20ca05=_0x20ca05-0x0;var _0x3da1e9=_0x3149[_0x20ca05];return _0x3da1e9;};'use strict';var client=require(_0x9314('0x0'));exports['create']=function(_0x905bad){return client[_0x9314('0x1')](_0x9314('0x2'),{'body':_0x905bad,'log':_0x9314('0x2')});};
\ No newline at end of file
index 79c7209..5bebc29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','callerid','active','Interval','Intervals','interval','SquareProject','../client','getCampaigns','Request','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry'];(function(_0x42b271,_0x814b58){var _0x74bba6=function(_0x145124){while(--_0x145124){_0x42b271['push'](_0x42b271['shift']());}};_0x74bba6(++_0x814b58);}(_0x7a54,0x106));var _0x47a5=function(_0x2c97b3,_0x2629da){_0x2c97b3=_0x2c97b3-0x0;var _0x2569e8=_0x7a54[_0x2c97b3];return _0x2569e8;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(){return function(){return client[_0x47a5('0x2')]('GetCampaign',{'options':{'raw':![],'attributes':['id',_0x47a5('0x3'),_0x47a5('0x4'),'active',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'dialCongestionRetryFrequency',_0x47a5('0xa'),'dialBusyRetryFrequency',_0x47a5('0xb'),_0x47a5('0xc'),'dialGlobalMaxRetry',_0x47a5('0xd'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x47a5('0xe'),_0x47a5('0xf'),'dialMachineMaxRetry',_0x47a5('0x10'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'dialAMDMinWordLength',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e'),_0x47a5('0x1f')],'include':[{'model':'Trunk','as':_0x47a5('0x20'),'attributes':['id',_0x47a5('0x3'),_0x47a5('0x21'),_0x47a5('0x22')]},{'model':_0x47a5('0x20'),'as':'TrunkBackup','attributes':['id','name',_0x47a5('0x21'),'active']},{'model':'Interval','as':_0x47a5('0x23'),'attributes':['id',_0x47a5('0x3')],'include':[{'model':_0x47a5('0x23'),'as':_0x47a5('0x24'),'attributes':['id',_0x47a5('0x3'),_0x47a5('0x25')]}]},{'model':_0x47a5('0x26'),'as':_0x47a5('0x26'),'attributes':['id',_0x47a5('0x3')]}]},'log':'getCampaign'});};};
\ No newline at end of file
+var _0xadb5=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialCutDigit','Trunk','callerid','active','TrunkBackup','Interval','SquareProject','getCampaign','getCampaigns','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength'];(function(_0x2beb99,_0x1fb2c0){var _0x418ad3=function(_0x276a53){while(--_0x276a53){_0x2beb99['push'](_0x2beb99['shift']());}};_0x418ad3(++_0x1fb2c0);}(_0xadb5,0xad));var _0x5adb=function(_0x58ca96,_0x2d5e2f){_0x58ca96=_0x58ca96-0x0;var _0x3869cd=_0xadb5[_0x58ca96];return _0x3869cd;};'use strict';var client=require('../client');exports[_0x5adb('0x0')]=function(){return function(){return client['Request'](_0x5adb('0x1'),{'options':{'raw':![],'attributes':['id',_0x5adb('0x2'),_0x5adb('0x3'),'active',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'dialOriginateTimeout',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'dialAMDActive',_0x5adb('0x18'),'dialAMDGreeting',_0x5adb('0x19'),'dialAMDTotalAnalysisTime',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'dialAMDSilenceThreshold',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'dialRandomLastDigitCallerIdNumber',_0x5adb('0x20')],'include':[{'model':'Trunk','as':_0x5adb('0x21'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0x22'),_0x5adb('0x23')]},{'model':_0x5adb('0x21'),'as':_0x5adb('0x24'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0x22'),_0x5adb('0x23')]},{'model':'Interval','as':_0x5adb('0x25'),'attributes':['id','name'],'include':[{'model':_0x5adb('0x25'),'as':'Intervals','attributes':['id',_0x5adb('0x2'),'interval']}]},{'model':'SquareProject','as':_0x5adb('0x26'),'attributes':['id',_0x5adb('0x2')]}]},'log':_0x5adb('0x27')});};};
\ No newline at end of file
index 7e979ee..ea3e035 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8968=['Request','CreateCmContact','GetCmContact','../client'];(function(_0x181ed9,_0x30181f){var _0x509a4b=function(_0x491405){while(--_0x491405){_0x181ed9['push'](_0x181ed9['shift']());}};_0x509a4b(++_0x30181f);}(_0x8968,0x19b));var _0x8896=function(_0x5d3550,_0x107033){_0x5d3550=_0x5d3550-0x0;var _0x5d1299=_0x8968[_0x5d3550];return _0x5d1299;};'use strict';var client=require(_0x8896('0x0'));exports['createContact']=function(_0x4390ec){return function(){return client[_0x8896('0x1')](_0x8896('0x2'),{'body':_0x4390ec,'log':_0x8896('0x2')});};};exports['getContacts']=function(_0x37c06b){return function(){return client[_0x8896('0x1')](_0x8896('0x3'),{'options':_0x37c06b,'log':_0x8896('0x3')});};};
\ No newline at end of file
+var _0xb9a4=['CreateCmContact','getContacts','GetCmContact','../client','Request'];(function(_0x1cdadb,_0x266fc3){var _0x18f956=function(_0x1207d6){while(--_0x1207d6){_0x1cdadb['push'](_0x1cdadb['shift']());}};_0x18f956(++_0x266fc3);}(_0xb9a4,0xe9));var _0x4b9a=function(_0x5eb9da,_0x410348){_0x5eb9da=_0x5eb9da-0x0;var _0x585cca=_0xb9a4[_0x5eb9da];return _0x585cca;};'use strict';var client=require(_0x4b9a('0x0'));exports['createContact']=function(_0x390094){return function(){return client[_0x4b9a('0x1')](_0x4b9a('0x2'),{'body':_0x390094,'log':_0x4b9a('0x2')});};};exports[_0x4b9a('0x3')]=function(_0x40a2ad){return function(){return client['Request'](_0x4b9a('0x4'),{'options':_0x40a2ad,'log':_0x4b9a('0x4')});};};
\ No newline at end of file
index 67dcd51..7af7000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e14=['Request','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','format','priority','ASC','getContactDialerIvr','DESC','scheduledat','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','ContactId','VoiceQueueId','CampaignId','CountReScheduled','countReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','VoiceQueue','unlockContact','getContactRecallMe','GetContactRecallMe','db.CmHopper.UserId','lodash','getContacts'];(function(_0x3ceb54,_0x5bddfd){var _0x26d8a6=function(_0x32e484){while(--_0x32e484){_0x3ceb54['push'](_0x3ceb54['shift']());}};_0x26d8a6(++_0x5bddfd);}(_0x9e14,0x10f));var _0x49e1=function(_0x5a6f2a,_0x505712){_0x5a6f2a=_0x5a6f2a-0x0;var _0x197f82=_0x9e14[_0x5a6f2a];return _0x197f82;};'use strict';var client=require('../client');var moment=require('moment');var _=require(_0x49e1('0x0'));exports[_0x49e1('0x1')]=function(_0x54f162,_0x4f62ed){return function(){return client[_0x49e1('0x2')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x54f162},'include':[{'model':_0x49e1('0x3'),'as':_0x49e1('0x4')}],'limit':_0x4f62ed,'raw':![]},'log':_0x49e1('0x5')});};};exports[_0x49e1('0x6')]=function(_0xe3b222,_0x1afa08,_0x5615a5){return function(){return client[_0x49e1('0x2')](_0x49e1('0x7'),{'body':_0xe3b222,'options':{'where':{'VoiceQueueId':_0x1afa08,'scheduledat':{'$lte':moment()['format'](_0x49e1('0x8'))}},'limit':_0x5615a5},'log':_0x49e1('0x7')});};};exports[_0x49e1('0x9')]=function(_0x140735){return function(){return client['Request'](_0x49e1('0x7'),{'body':_0x140735,'options':{'where':{'ContactId':_0x140735['ContactId'],'ListId':_0x140735['ListId'],'VoiceQueueId':_0x140735['VoiceQueueId'],'CampaignId':_0x140735['CampaignId']}},'log':'rescheduleContact'});};};exports[_0x49e1('0xa')]=function(_0x34c8ba,_0x5cfd62,_0x31d215){return function(){return client[_0x49e1('0x2')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x34c8ba,'ListId':_0x5cfd62,'ContactId':_0x31d215}},'log':_0x49e1('0xb')});};};exports[_0x49e1('0xc')]=function(_0x2189c1,_0x45b423,_0xfc97fb,_0x5f5228){return function(){return client[_0x49e1('0x2')](_0x49e1('0xd'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x2189c1,'active':![],'scheduledat':{'$lte':moment()[_0x49e1('0xe')](_0x49e1('0x8'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x45b423}}]},'order':[[_0x49e1('0xf'),'DESC'],['scheduledat',_0x5f5228],['id',_0x49e1('0x10')]],'raw':!![],'limit':_0xfc97fb},'log':_0x49e1('0xd')});};};exports[_0x49e1('0x11')]=function(_0xe9c6ba,_0x1c36bb,_0x78de57){return function(){return client[_0x49e1('0x2')](_0x49e1('0xd'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0xe9c6ba,'active':![],'scheduledat':{'$lte':moment()[_0x49e1('0xe')](_0x49e1('0x8'))}},'include':[{'model':_0x49e1('0x3'),'as':_0x49e1('0x4')}],'order':[['priority',_0x49e1('0x12')],[_0x49e1('0x13'),_0x78de57],['id','ASC']],'raw':!![],'limit':_0x1c36bb},'log':_0x49e1('0x14')});};};exports[_0x49e1('0x15')]=function(_0xf35148,_0x49994e){return function(){_0xf35148[_0x49e1('0x16')]=_0xf35148[_0x49e1('0x17')];return client[_0x49e1('0x2')]('MoveContactManagedDialer',{'body':_0xf35148,'options':{'where':{'ContactId':_0xf35148[_0x49e1('0x18')],'ListId':_0xf35148['ListId'],'VoiceQueueId':_0xf35148[_0x49e1('0x19')],'CampaignId':_0xf35148[_0x49e1('0x1a')],'active':_0x49994e?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports['countReScheduled']=function(_0x136a15){return function(){return client[_0x49e1('0x2')](_0x49e1('0x1b'),{'options':{'where':{'VoiceQueueId':_0x136a15['id']?_0x136a15['id']||null:null}},'log':_0x49e1('0x1c')});};};exports[_0x49e1('0x1d')]=function(_0x236fe2){return function(){return client[_0x49e1('0x2')](_0x49e1('0x1e'),{'options':{'where':{'id':_0x236fe2},'include':[{'model':_0x49e1('0x3'),'as':_0x49e1('0x4')},{'model':_0x49e1('0x1f'),'as':_0x49e1('0x20'),'attributes':['id',_0x49e1('0x21')]},{'model':_0x49e1('0x22'),'as':'Queue','attributes':['id','name']}],'raw':!![]},'log':_0x49e1('0x5')});};};exports[_0x49e1('0x23')]=function(_0x3e1740,_0x2ccc33,_0x121d61){return function(){return client[_0x49e1('0x2')](_0x49e1('0x7'),{'body':_0x3e1740,'options':{'where':{'id':_0x2ccc33},'limit':_0x121d61},'log':_0x49e1('0x7')});};};exports[_0x49e1('0x24')]=function(_0x4a738b,_0x5fa43){return function(){return client[_0x49e1('0x2')](_0x49e1('0x25'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x4a738b,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x49e1('0xe')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x5fa43}},'order':[[_0x49e1('0xf'),'DESC'],[_0x49e1('0x13'),_0x49e1('0x12')],['id',_0x49e1('0x10')]],'include':[{'model':'CmContact','as':_0x49e1('0x4')},{'model':_0x49e1('0x1f'),'as':_0x49e1('0x20'),'attributes':['id',_0x49e1('0x21'),'voicePause']}],'group':_0x49e1('0x26'),'raw':!![]},'log':'GetContactDialer'});};};
\ No newline at end of file
+var _0xc116=['GetContactDialer','YYYY-MM-DD\x20HH:mm:ss','DESC','scheduledat','ASC','getContactDialerIvr','format','CmContact','priority','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','VoiceQueueId','countReScheduled','CountReScheduled','getContactPreview','Contact','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','User','Agent','db.CmHopper.UserId','../client','moment','lodash','getContacts','Request','GetCmHopper','getCmHopper','updateContacts','UpdateCmHopper','rescheduleContact','ListId','CampaignId','DestroyCmHopper'];(function(_0x34342a,_0x3e16f5){var _0x427cdf=function(_0x6aafbd){while(--_0x6aafbd){_0x34342a['push'](_0x34342a['shift']());}};_0x427cdf(++_0x3e16f5);}(_0xc116,0x1b6));var _0x6c11=function(_0xcc4acf,_0x37b91c){_0xcc4acf=_0xcc4acf-0x0;var _0x380a90=_0xc116[_0xcc4acf];return _0x380a90;};'use strict';var client=require(_0x6c11('0x0'));var moment=require(_0x6c11('0x1'));var _=require(_0x6c11('0x2'));exports[_0x6c11('0x3')]=function(_0x476643,_0x5978dc){return function(){return client[_0x6c11('0x4')](_0x6c11('0x5'),{'options':{'where':{'VoiceQueueId':_0x476643},'include':[{'model':'CmContact','as':'Contact'}],'limit':_0x5978dc,'raw':![]},'log':_0x6c11('0x6')});};};exports[_0x6c11('0x7')]=function(_0x539f7e,_0x1d6e4c,_0x1b02ca){return function(){return client[_0x6c11('0x4')](_0x6c11('0x8'),{'body':_0x539f7e,'options':{'where':{'VoiceQueueId':_0x1d6e4c,'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x1b02ca},'log':_0x6c11('0x8')});};};exports[_0x6c11('0x9')]=function(_0x129e9c){return function(){return client[_0x6c11('0x4')](_0x6c11('0x8'),{'body':_0x129e9c,'options':{'where':{'ContactId':_0x129e9c['ContactId'],'ListId':_0x129e9c[_0x6c11('0xa')],'VoiceQueueId':_0x129e9c['VoiceQueueId'],'CampaignId':_0x129e9c[_0x6c11('0xb')]}},'log':_0x6c11('0x9')});};};exports['destroyContact']=function(_0x125f91,_0x3c751f,_0x2d2d16){return function(){return client['Request'](_0x6c11('0xc'),{'options':{'where':{'VoiceQueueId':_0x125f91,'ListId':_0x3c751f,'ContactId':_0x2d2d16}},'log':_0x6c11('0xc')});};};exports['getContactDialer']=function(_0x1cb761,_0x3e6fc0,_0x5e83c9,_0x39d237){return function(){return client[_0x6c11('0x4')](_0x6c11('0xd'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x1cb761,'active':![],'scheduledat':{'$lte':moment()['format'](_0x6c11('0xe'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x3e6fc0}}]},'order':[['priority',_0x6c11('0xf')],[_0x6c11('0x10'),_0x39d237],['id',_0x6c11('0x11')]],'raw':!![],'limit':_0x5e83c9},'log':_0x6c11('0xd')});};};exports[_0x6c11('0x12')]=function(_0x2e43b1,_0x34ea0d,_0x54ea2b){return function(){return client[_0x6c11('0x4')](_0x6c11('0xd'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2e43b1,'active':![],'scheduledat':{'$lte':moment()[_0x6c11('0x13')](_0x6c11('0xe'))}},'include':[{'model':_0x6c11('0x14'),'as':'Contact'}],'order':[[_0x6c11('0x15'),_0x6c11('0xf')],[_0x6c11('0x10'),_0x54ea2b],['id','ASC']],'raw':!![],'limit':_0x34ea0d},'log':_0x6c11('0x16')});};};exports[_0x6c11('0x17')]=function(_0x2dcb98,_0x555544){return function(){_0x2dcb98[_0x6c11('0x18')]=_0x2dcb98[_0x6c11('0x19')];return client[_0x6c11('0x4')](_0x6c11('0x1a'),{'body':_0x2dcb98,'options':{'where':{'ContactId':_0x2dcb98['ContactId'],'ListId':_0x2dcb98[_0x6c11('0xa')],'VoiceQueueId':_0x2dcb98[_0x6c11('0x1b')],'CampaignId':_0x2dcb98[_0x6c11('0xb')],'active':_0x555544?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0x6c11('0x1c')]=function(_0x58117a){return function(){return client['Request'](_0x6c11('0x1d'),{'options':{'where':{'VoiceQueueId':_0x58117a['id']?_0x58117a['id']||null:null}},'log':_0x6c11('0x1c')});};};exports[_0x6c11('0x1e')]=function(_0xae8d39){return function(){return client[_0x6c11('0x4')]('GetCmHopperPreview',{'options':{'where':{'id':_0xae8d39},'include':[{'model':_0x6c11('0x14'),'as':_0x6c11('0x1f')},{'model':'User','as':'Agent','attributes':['id',_0x6c11('0x20')]},{'model':_0x6c11('0x21'),'as':_0x6c11('0x22'),'attributes':['id','name']}],'raw':!![]},'log':_0x6c11('0x6')});};};exports[_0x6c11('0x23')]=function(_0x469706,_0x21de23,_0x1a11fb){return function(){return client[_0x6c11('0x4')](_0x6c11('0x8'),{'body':_0x469706,'options':{'where':{'id':_0x21de23},'limit':_0x1a11fb},'log':_0x6c11('0x8')});};};exports[_0x6c11('0x24')]=function(_0x33e076,_0x4febb5){return function(){return client['Request'](_0x6c11('0x25'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x33e076,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x6c11('0x13')](_0x6c11('0xe'))},'UserId':{'$in':_0x4febb5}},'order':[[_0x6c11('0x15'),_0x6c11('0xf')],['scheduledat','DESC'],['id','ASC']],'include':[{'model':'CmContact','as':_0x6c11('0x1f')},{'model':_0x6c11('0x26'),'as':_0x6c11('0x27'),'attributes':['id','name','voicePause']}],'group':_0x6c11('0x28'),'raw':!![]},'log':_0x6c11('0xd')});};};
\ No newline at end of file
index 47735e4..ef3c8ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e81=['GetCmHopperBlack','checkIsBlackListIvr','Request','GetCmHopperBlackIvr','../client','checkIsBlackList','Contact','phone'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0x4e81,0x1bc));var _0x14e8=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0x4e81[_0x1a3e23];return _0x5ee0d8;};'use strict';var client=require(_0x14e8('0x0'));exports[_0x14e8('0x1')]=function(_0x354aac){return function(){return client['Request']('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x354aac['VoiceQueueId'],'phone':_0x354aac[_0x14e8('0x2')][_0x14e8('0x3')]},'raw':![]},'log':_0x14e8('0x4')});};};exports[_0x14e8('0x5')]=function(_0x325325){return function(){return client[_0x14e8('0x6')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x325325['CampaignId'],'phone':_0x325325[_0x14e8('0x2')][_0x14e8('0x3')]},'raw':![]},'log':_0x14e8('0x7')});};};
\ No newline at end of file
+var _0x6b20=['GetCmHopperBlack','CampaignId','../client','checkIsBlackList','Request','VoiceQueueId','Contact','phone','checkIsBlackListIvr'];(function(_0x45b0cc,_0x4e2ad5){var _0x1798ed=function(_0x31a0df){while(--_0x31a0df){_0x45b0cc['push'](_0x45b0cc['shift']());}};_0x1798ed(++_0x4e2ad5);}(_0x6b20,0xd1));var _0x06b2=function(_0x158747,_0x2c8376){_0x158747=_0x158747-0x0;var _0xa44d1e=_0x6b20[_0x158747];return _0xa44d1e;};'use strict';var client=require(_0x06b2('0x0'));exports[_0x06b2('0x1')]=function(_0x52753b){return function(){return client[_0x06b2('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x52753b[_0x06b2('0x3')],'phone':_0x52753b[_0x06b2('0x4')][_0x06b2('0x5')]},'raw':![]},'log':'GetCmHopperBlack'});};};exports[_0x06b2('0x6')]=function(_0x3ea357){return function(){return client[_0x06b2('0x2')](_0x06b2('0x7'),{'options':{'where':{'CampaignId':_0x3ea357[_0x06b2('0x8')],'phone':_0x3ea357[_0x06b2('0x4')][_0x06b2('0x5')]},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
index fe09d34..a0d2b34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa73=['campaign','Request','CreateCmHopperFinal','../client'];(function(_0x399c12,_0x48738c){var _0x4f0ace=function(_0x9d5880){while(--_0x9d5880){_0x399c12['push'](_0x399c12['shift']());}};_0x4f0ace(++_0x48738c);}(_0xfa73,0x193));var _0x3fa7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfa73[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x3fa7('0x0'));exports['createContact']=function(_0x42866e){return function(){_0x42866e[_0x3fa7('0x1')]=_0x42866e['queue'];return client[_0x3fa7('0x2')](_0x3fa7('0x3'),{'body':_0x42866e,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
+var _0xaba7=['CreateCmHopperFinal','../client','createContact','queue'];(function(_0x59fae9,_0x1abc81){var _0xc4e2fe=function(_0x1df9dc){while(--_0x1df9dc){_0x59fae9['push'](_0x59fae9['shift']());}};_0xc4e2fe(++_0x1abc81);}(_0xaba7,0x1e1));var _0x7aba=function(_0x224ce5,_0x380a5c){_0x224ce5=_0x224ce5-0x0;var _0x57cb43=_0xaba7[_0x224ce5];return _0x57cb43;};'use strict';var client=require(_0x7aba('0x0'));exports[_0x7aba('0x1')]=function(_0x29ab00){return function(){_0x29ab00['campaign']=_0x29ab00[_0x7aba('0x2')];return client['Request'](_0x7aba('0x3'),{'body':_0x29ab00,'log':_0x7aba('0x3')});};};
\ No newline at end of file
index e6709b8..5e03f46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0be=['YYYY-MM-DD\x20HH:mm:ss','day','endOf','GetVoiceQueueHopperHistory','getCampaignHopperHistory','format','ivr','GetCampaignHopperHistory','../client','moment','createHistory','campaign','queue','Request','avgHandleTime','subtract','minutes'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd0be,0xb2));var _0xed0b=function(_0x4ec69a,_0x2826de){_0x4ec69a=_0x4ec69a-0x0;var _0x280921=_0xd0be[_0x4ec69a];return _0x280921;};'use strict';var client=require(_0xed0b('0x0'));var moment=require(_0xed0b('0x1'));exports[_0xed0b('0x2')]=function(_0x3aacd7){return function(){_0x3aacd7[_0xed0b('0x3')]=_0x3aacd7[_0xed0b('0x4')];return client[_0xed0b('0x5')]('CreateCmHopperHistory',{'body':_0x3aacd7,'log':'CreateCmHopperHistory'});};};exports[_0xed0b('0x6')]=function(_0x23967e){return function(){return client[_0xed0b('0x5')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0xed0b('0x7')](_0x23967e,_0xed0b('0x8'))['format'](_0xed0b('0x9')),moment()['format'](_0xed0b('0x9'))]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports['getVoiceQueueHopperHistory']=function(_0x3cb6a8){return function(){return client[_0xed0b('0x5')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xed0b('0xa'))['format'](_0xed0b('0x9')),moment()[_0xed0b('0xb')](_0xed0b('0xa'))['format'](_0xed0b('0x9'))]},'campaigntype':_0xed0b('0x4')},'raw':![]},'log':_0xed0b('0xc')});};};exports[_0xed0b('0xd')]=function(_0x52b185){return function(){return client[_0xed0b('0x5')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xed0b('0xa'))[_0xed0b('0xe')](_0xed0b('0x9')),moment()['endOf'](_0xed0b('0xa'))[_0xed0b('0xe')](_0xed0b('0x9'))]},'campaigntype':_0xed0b('0xf')},'raw':![]},'log':_0xed0b('0x10')});};};
\ No newline at end of file
+var _0x0a67=['AvgHandleTime','subtract','minutes','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','startOf','format','endOf','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','day','ivr','../client','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime'];(function(_0x12b689,_0x319458){var _0x1a2848=function(_0x4b816d){while(--_0x4b816d){_0x12b689['push'](_0x12b689['shift']());}};_0x1a2848(++_0x319458);}(_0x0a67,0x148));var _0x70a6=function(_0x5b11f5,_0x2884b8){_0x5b11f5=_0x5b11f5-0x0;var _0x38a290=_0x0a67[_0x5b11f5];return _0x38a290;};'use strict';var client=require(_0x70a6('0x0'));var moment=require(_0x70a6('0x1'));exports[_0x70a6('0x2')]=function(_0x5ee7b4){return function(){_0x5ee7b4[_0x70a6('0x3')]=_0x5ee7b4[_0x70a6('0x4')];return client[_0x70a6('0x5')]('CreateCmHopperHistory',{'body':_0x5ee7b4,'log':_0x70a6('0x6')});};};exports[_0x70a6('0x7')]=function(_0x248956){return function(){return client['Request'](_0x70a6('0x8'),{'options':{'where':{'endtime':{'$between':[moment()[_0x70a6('0x9')](_0x248956,_0x70a6('0xa'))['format'](_0x70a6('0xb')),moment()['format'](_0x70a6('0xb'))]}},'raw':![]},'log':_0x70a6('0xc')});};};exports[_0x70a6('0xd')]=function(_0x32bc71){return function(){return client[_0x70a6('0x5')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x70a6('0xe')]('day')[_0x70a6('0xf')](_0x70a6('0xb')),moment()[_0x70a6('0x10')]('day')[_0x70a6('0xf')](_0x70a6('0xb'))]},'campaigntype':_0x70a6('0x4')},'raw':![]},'log':_0x70a6('0x11')});};};exports['getCampaignHopperHistory']=function(_0x2da001){return function(){return client['Request'](_0x70a6('0x12'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x70a6('0xe')](_0x70a6('0x13'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x70a6('0x10')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x70a6('0x14')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
index 88998c6..a691eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2581=['localstationid','minrate','maxrate','modem','gateway','faxdetect','tech','TrunkId','ListId','key','Trunk','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','name','ecm','headerinfo'];(function(_0x4ca284,_0x5c890d){var _0x3583dd=function(_0x515f00){while(--_0x515f00){_0x4ca284['push'](_0x4ca284['shift']());}};_0x3583dd(++_0x5c890d);}(_0x2581,0xcb));var _0x1258=function(_0x1df2b2,_0xfcc9e7){_0x1df2b2=_0x1df2b2-0x0;var _0x59c740=_0x2581[_0x1df2b2];return _0x59c740;};'use strict';var client=require(_0x1258('0x0'));exports[_0x1258('0x1')]=function(){return function(){return client[_0x1258('0x2')](_0x1258('0x3'),{'options':{'raw':![],'attributes':['id',_0x1258('0x4'),'description',_0x1258('0x5'),_0x1258('0x6'),_0x1258('0x7'),_0x1258('0x8'),_0x1258('0x9'),_0x1258('0xa'),_0x1258('0xb'),_0x1258('0xc'),'t38timeout',_0x1258('0xd'),_0x1258('0xe'),_0x1258('0xf'),_0x1258('0x10')],'include':[{'model':_0x1258('0x11'),'as':_0x1258('0x11'),'attributes':['id',_0x1258('0x4'),'callerid','active']}]},'log':_0x1258('0x12')});};};exports[_0x1258('0x13')]=function(_0x15eea2,_0x1fe32a){return client['Request'](_0x1258('0x14'),{'account':{'id':_0x15eea2},'body':_0x1fe32a,'log':_0x1258('0x14')});};
\ No newline at end of file
+var _0x2ffe=['Trunk','callerid','active','getFaxAccount','notify','NotifyFaxAccount','getFaxAccounts','Request','GetFaxAccount','name','description','headerinfo','localstationid','modem','gateway','faxdetect','tech','TrunkId','ListId','key'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x2ffe,0x6a));var _0xe2ff=function(_0x4c095f,_0x44e9bd){_0x4c095f=_0x4c095f-0x0;var _0x278d87=_0x2ffe[_0x4c095f];return _0x278d87;};'use strict';var client=require('../client');exports[_0xe2ff('0x0')]=function(){return function(){return client[_0xe2ff('0x1')](_0xe2ff('0x2'),{'options':{'raw':![],'attributes':['id',_0xe2ff('0x3'),_0xe2ff('0x4'),'ecm',_0xe2ff('0x5'),_0xe2ff('0x6'),'minrate','maxrate',_0xe2ff('0x7'),_0xe2ff('0x8'),_0xe2ff('0x9'),'t38timeout',_0xe2ff('0xa'),_0xe2ff('0xb'),_0xe2ff('0xc'),_0xe2ff('0xd')],'include':[{'model':_0xe2ff('0xe'),'as':_0xe2ff('0xe'),'attributes':['id',_0xe2ff('0x3'),_0xe2ff('0xf'),_0xe2ff('0x10')]}]},'log':_0xe2ff('0x11')});};};exports[_0xe2ff('0x12')]=function(_0x2ac0fb,_0x242ed1){return client[_0xe2ff('0x1')](_0xe2ff('0x13'),{'account':{'id':_0x2ac0fb},'body':_0x242ed1,'log':_0xe2ff('0x13')});};
\ No newline at end of file
index 21abc67..2433b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c21=['update','Request','UpdateFaxMessage','../client'];(function(_0x43d701,_0x4bb2e9){var _0x2ec4c6=function(_0x4d9765){while(--_0x4d9765){_0x43d701['push'](_0x43d701['shift']());}};_0x2ec4c6(++_0x4bb2e9);}(_0x2c21,0x11f));var _0x12c2=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0x2c21[_0xce93c];return _0x230720;};'use strict';var client=require(_0x12c2('0x0'));exports[_0x12c2('0x1')]=function(_0x3389f0,_0x3ccf53){return client[_0x12c2('0x2')](_0x12c2('0x3'),{'body':_0x3ccf53,'options':{'where':{'AttachmentId':_0x3389f0}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0x27c5=['update','Request','UpdateFaxMessage'];(function(_0x40b840,_0xa6f3d7){var _0x416035=function(_0x1a77db){while(--_0x1a77db){_0x40b840['push'](_0x40b840['shift']());}};_0x416035(++_0xa6f3d7);}(_0x27c5,0x8d));var _0x527c=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x27c5[_0x3e32a8];return _0x2997b0;};'use strict';var client=require('../client');exports[_0x527c('0x0')]=function(_0x27c863,_0x3f3a4c){return client[_0x527c('0x1')](_0x527c('0x2'),{'body':_0x3f3a4c,'options':{'where':{'AttachmentId':_0x27c863}},'log':_0x527c('0x2')});};
\ No newline at end of file
index 699e930..0b08aae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8420=['Subjects','Variable','Descriptions','content','key','keyContent','variableName','Fields','idField','nameField','Tag','Tags','../../client','getDeskAccounts','GetDeskAccount','name','description','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','DeskField'];(function(_0x590d43,_0x39d32d){var _0x2d3bfc=function(_0x4eddfd){while(--_0x4eddfd){_0x590d43['push'](_0x590d43['shift']());}};_0x2d3bfc(++_0x39d32d);}(_0x8420,0x16a));var _0x0842=function(_0x554651,_0x33b329){_0x554651=_0x554651-0x0;var _0x53fb5a=_0x8420[_0x554651];return _0x53fb5a;};'use strict';var client=require(_0x0842('0x0'));exports[_0x0842('0x1')]=function(){return function(_0x1f30f5){return client['Request'](_0x0842('0x2'),{'options':{'raw':![],'attributes':['id',_0x0842('0x3'),_0x0842('0x4'),_0x0842('0x5'),_0x0842('0x6'),_0x0842('0x7'),_0x0842('0x8'),_0x0842('0x9'),_0x0842('0xa')],'include':[{'model':_0x0842('0xb'),'as':'Configurations','attributes':['id',_0x0842('0x3')],'include':[{'model':_0x0842('0xc'),'as':_0x0842('0xd'),'attributes':['id','type','content','variableName'],'include':[{'model':_0x0842('0xe'),'as':_0x0842('0xe'),'attributes':['id','name']}]},{'model':_0x0842('0xc'),'as':_0x0842('0xf'),'attributes':['id',_0x0842('0x9'),_0x0842('0x10'),_0x0842('0x11'),'keyType',_0x0842('0x12'),_0x0842('0x13')],'include':[{'model':_0x0842('0xe'),'as':_0x0842('0xe'),'attributes':['id',_0x0842('0x3')]}]},{'model':'DeskField','as':_0x0842('0x14'),'attributes':['id','type','content',_0x0842('0x15'),_0x0842('0x16'),'customField',_0x0842('0x13')],'include':[{'model':'Variable','as':_0x0842('0xe'),'attributes':['id','name']}]},{'model':_0x0842('0x17'),'as':_0x0842('0x18'),'attributes':['id','name']}]}]},'log':_0x0842('0x2')});};};
\ No newline at end of file
+var _0x9b90=['content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','customField','Tags','../../client','Request','GetDeskAccount','description','username','remoteUri','authType','type','serverUrl','DeskConfiguration','name','DeskField','Subjects'];(function(_0x15f99c,_0x2170ff){var _0x8c25e8=function(_0x22cccc){while(--_0x22cccc){_0x15f99c['push'](_0x15f99c['shift']());}};_0x8c25e8(++_0x2170ff);}(_0x9b90,0x11f));var _0x09b9=function(_0x572e11,_0x5263ac){_0x572e11=_0x572e11-0x0;var _0xec3b62=_0x9b90[_0x572e11];return _0xec3b62;};'use strict';var client=require(_0x09b9('0x0'));exports['getDeskAccounts']=function(){return function(_0x5a5a69){return client[_0x09b9('0x1')](_0x09b9('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x09b9('0x3'),_0x09b9('0x4'),'password',_0x09b9('0x5'),_0x09b9('0x6'),_0x09b9('0x7'),_0x09b9('0x8')],'include':[{'model':_0x09b9('0x9'),'as':'Configurations','attributes':['id',_0x09b9('0xa')],'include':[{'model':_0x09b9('0xb'),'as':_0x09b9('0xc'),'attributes':['id',_0x09b9('0x7'),_0x09b9('0xd'),_0x09b9('0xe')],'include':[{'model':_0x09b9('0xf'),'as':_0x09b9('0xf'),'attributes':['id',_0x09b9('0xa')]}]},{'model':_0x09b9('0xb'),'as':_0x09b9('0x10'),'attributes':['id',_0x09b9('0x7'),_0x09b9('0xd'),_0x09b9('0x11'),_0x09b9('0x12'),_0x09b9('0x13'),_0x09b9('0xe')],'include':[{'model':'Variable','as':_0x09b9('0xf'),'attributes':['id',_0x09b9('0xa')]}]},{'model':_0x09b9('0xb'),'as':_0x09b9('0x14'),'attributes':['id',_0x09b9('0x7'),_0x09b9('0xd'),_0x09b9('0x15'),_0x09b9('0x16'),_0x09b9('0x17'),_0x09b9('0xe')],'include':[{'model':_0x09b9('0xf'),'as':_0x09b9('0xf'),'attributes':['id',_0x09b9('0xa')]}]},{'model':'Tag','as':_0x09b9('0x18'),'attributes':['id',_0x09b9('0xa')]}]}]},'log':_0x09b9('0x2')});};};
\ No newline at end of file
index f77c817..435055b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9a1=['Configurations','ticketType','Dynamics365Field','Subjects','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','type','idField','nameField','customField','../../client','Request','GetDynamics365Account','name','username','password','clientId','clientSecret','Dynamics365Configuration'];(function(_0x27c20d,_0x389582){var _0x2871a2=function(_0x3af732){while(--_0x3af732){_0x27c20d['push'](_0x27c20d['shift']());}};_0x2871a2(++_0x389582);}(_0xf9a1,0x155));var _0x1f9a=function(_0x255cf6,_0x1163ea){_0x255cf6=_0x255cf6-0x0;var _0x2c6be4=_0xf9a1[_0x255cf6];return _0x2c6be4;};'use strict';var client=require(_0x1f9a('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x4d8339){return client[_0x1f9a('0x1')](_0x1f9a('0x2'),{'options':{'raw':![],'attributes':['id',_0x1f9a('0x3'),_0x1f9a('0x4'),_0x1f9a('0x5'),'remoteUri','tenantId',_0x1f9a('0x6'),_0x1f9a('0x7'),'serverUrl','description'],'include':[{'model':_0x1f9a('0x8'),'as':_0x1f9a('0x9'),'attributes':['id',_0x1f9a('0x3'),_0x1f9a('0xa')],'include':[{'model':_0x1f9a('0xb'),'as':_0x1f9a('0xc'),'attributes':['id','type',_0x1f9a('0xd'),_0x1f9a('0xe')],'include':[{'model':_0x1f9a('0xf'),'as':_0x1f9a('0xf'),'attributes':['id',_0x1f9a('0x3')]}]},{'model':_0x1f9a('0xb'),'as':_0x1f9a('0x10'),'attributes':['id','type','content',_0x1f9a('0x11'),_0x1f9a('0x12'),_0x1f9a('0x13'),_0x1f9a('0xe')],'include':[{'model':_0x1f9a('0xf'),'as':_0x1f9a('0xf'),'attributes':['id','name']}]},{'model':_0x1f9a('0xb'),'as':_0x1f9a('0x14'),'attributes':['id',_0x1f9a('0x15'),_0x1f9a('0xd'),_0x1f9a('0x16'),_0x1f9a('0x17'),_0x1f9a('0x18'),_0x1f9a('0xe')],'include':[{'model':_0x1f9a('0xf'),'as':_0x1f9a('0xf'),'attributes':['id',_0x1f9a('0x3')]}]}]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
+var _0x7be9=['Configurations','ticketType','Dynamics365Field','Subjects','type','content','variableName','Variable','key','keyType','keyContent','Fields','nameField','customField','../../client','getDynamics365Accounts','Request','GetDynamics365Account','name','remoteUri','tenantId','clientId','clientSecret','serverUrl','description','Dynamics365Configuration'];(function(_0xc6fe11,_0x2bf30f){var _0x2ba389=function(_0x3f8964){while(--_0x3f8964){_0xc6fe11['push'](_0xc6fe11['shift']());}};_0x2ba389(++_0x2bf30f);}(_0x7be9,0x112));var _0x97be=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x7be9[_0x17406a];return _0x1501ff;};'use strict';var client=require(_0x97be('0x0'));exports[_0x97be('0x1')]=function(){return function(_0x48c9ac){return client[_0x97be('0x2')](_0x97be('0x3'),{'options':{'raw':![],'attributes':['id',_0x97be('0x4'),'username','password',_0x97be('0x5'),_0x97be('0x6'),_0x97be('0x7'),_0x97be('0x8'),_0x97be('0x9'),_0x97be('0xa')],'include':[{'model':_0x97be('0xb'),'as':_0x97be('0xc'),'attributes':['id',_0x97be('0x4'),_0x97be('0xd')],'include':[{'model':_0x97be('0xe'),'as':_0x97be('0xf'),'attributes':['id',_0x97be('0x10'),_0x97be('0x11'),_0x97be('0x12')],'include':[{'model':_0x97be('0x13'),'as':_0x97be('0x13'),'attributes':['id',_0x97be('0x4')]}]},{'model':_0x97be('0xe'),'as':'Descriptions','attributes':['id',_0x97be('0x10'),_0x97be('0x11'),_0x97be('0x14'),_0x97be('0x15'),_0x97be('0x16'),'variableName'],'include':[{'model':_0x97be('0x13'),'as':_0x97be('0x13'),'attributes':['id',_0x97be('0x4')]}]},{'model':'Dynamics365Field','as':_0x97be('0x17'),'attributes':['id',_0x97be('0x10'),_0x97be('0x11'),'idField',_0x97be('0x18'),_0x97be('0x19'),'variableName'],'include':[{'model':'Variable','as':_0x97be('0x13'),'attributes':['id',_0x97be('0x4')]}]}]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
index 64a6391..b3ac199 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4517=['customField','getFreshdeskAccounts','GetFreshdeskAccount','name','username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','nameField'];(function(_0xee1f20,_0x5455d8){var _0xd46cf1=function(_0x1ff378){while(--_0x1ff378){_0xee1f20['push'](_0xee1f20['shift']());}};_0xd46cf1(++_0x5455d8);}(_0x4517,0x112));var _0x7451=function(_0x1dd261,_0x161998){_0x1dd261=_0x1dd261-0x0;var _0x3a33ff=_0x4517[_0x1dd261];return _0x3a33ff;};'use strict';var client=require('../../client');exports[_0x7451('0x0')]=function(){return function(_0x24ebb4){return client['Request'](_0x7451('0x1'),{'options':{'raw':![],'attributes':['id',_0x7451('0x2'),_0x7451('0x3'),_0x7451('0x4'),_0x7451('0x5'),_0x7451('0x6')],'include':[{'model':_0x7451('0x7'),'as':_0x7451('0x8'),'attributes':['id',_0x7451('0x2')],'include':[{'model':_0x7451('0x9'),'attributes':['id',_0x7451('0x2')]},{'model':_0x7451('0xa'),'as':_0x7451('0xb'),'attributes':['id',_0x7451('0xc'),_0x7451('0xd'),_0x7451('0xe')],'include':[{'model':_0x7451('0xf'),'as':'Variable','attributes':['id',_0x7451('0x2')]}]},{'model':_0x7451('0xa'),'as':_0x7451('0x10'),'attributes':['id',_0x7451('0xc'),_0x7451('0xd'),_0x7451('0x11'),_0x7451('0x12'),'keyContent','variableName'],'include':[{'model':_0x7451('0xf'),'as':'Variable','attributes':['id',_0x7451('0x2')]}]},{'model':_0x7451('0xa'),'as':'Fields','attributes':['id',_0x7451('0xc'),_0x7451('0xd'),'idField',_0x7451('0x13'),_0x7451('0x14'),_0x7451('0xe')],'include':[{'model':_0x7451('0xf'),'as':'Variable','attributes':['id',_0x7451('0x2')]}]}]}]},'log':_0x7451('0x1')});};};
\ No newline at end of file
+var _0x693f=['username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','Subjects','content','Variable','type','key','keyType','keyContent','variableName','FreshdeskField','Fields','idField','GetFreshdeskAccount','../../client','getFreshdeskAccounts','Request','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xf693('0x0'));exports[_0xf693('0x1')]=function(){return function(_0x3511a1){return client[_0xf693('0x2')]('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0xf693('0x3'),_0xf693('0x4'),_0xf693('0x5'),_0xf693('0x6'),_0xf693('0x7')],'include':[{'model':_0xf693('0x8'),'as':_0xf693('0x9'),'attributes':['id','name'],'include':[{'model':_0xf693('0xa'),'attributes':['id',_0xf693('0x3')]},{'model':'FreshdeskField','as':_0xf693('0xb'),'attributes':['id','type',_0xf693('0xc'),'variableName'],'include':[{'model':_0xf693('0xd'),'as':_0xf693('0xd'),'attributes':['id','name']}]},{'model':'FreshdeskField','as':'Descriptions','attributes':['id',_0xf693('0xe'),'content',_0xf693('0xf'),_0xf693('0x10'),_0xf693('0x11'),_0xf693('0x12')],'include':[{'model':_0xf693('0xd'),'as':'Variable','attributes':['id','name']}]},{'model':_0xf693('0x13'),'as':_0xf693('0x14'),'attributes':['id','type',_0xf693('0xc'),_0xf693('0x15'),'nameField','customField',_0xf693('0x12')],'include':[{'model':_0xf693('0xd'),'as':_0xf693('0xd'),'attributes':['id',_0xf693('0x3')]}]}]}]},'log':_0xf693('0x16')});};};
\ No newline at end of file
index fed5605..358bd47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf072=['content','variableName','Variable','Descriptions','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','GetFreshsalesAccount','username','apiKey','remoteUri','FreshsalesConfiguration','Configurations','name','FreshsalesField','Subjects','type'];(function(_0x4c6cb5,_0x5ba13e){var _0x3bb21d=function(_0x53c505){while(--_0x53c505){_0x4c6cb5['push'](_0x4c6cb5['shift']());}};_0x3bb21d(++_0x5ba13e);}(_0xf072,0x1cf));var _0x2f07=function(_0x580b83,_0x369735){_0x580b83=_0x580b83-0x0;var _0x5eba77=_0xf072[_0x580b83];return _0x5eba77;};'use strict';var client=require(_0x2f07('0x0'));exports[_0x2f07('0x1')]=function(){return function(_0x304ea5){return client['Request'](_0x2f07('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x2f07('0x3'),_0x2f07('0x4'),_0x2f07('0x5'),'serverUrl'],'include':[{'model':_0x2f07('0x6'),'as':_0x2f07('0x7'),'attributes':['id',_0x2f07('0x8')],'include':[{'model':_0x2f07('0x9'),'as':_0x2f07('0xa'),'attributes':['id',_0x2f07('0xb'),_0x2f07('0xc'),_0x2f07('0xd')],'include':[{'model':_0x2f07('0xe'),'as':_0x2f07('0xe'),'attributes':['id',_0x2f07('0x8')]}]},{'model':_0x2f07('0x9'),'as':_0x2f07('0xf'),'attributes':['id',_0x2f07('0xb'),_0x2f07('0xc'),'key',_0x2f07('0x10'),_0x2f07('0x11'),_0x2f07('0xd')],'include':[{'model':_0x2f07('0xe'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x2f07('0x12')});};};
\ No newline at end of file
+var _0x6657=['keyType','keyContent','GetFreshsalesccount','../../client','Request','GetFreshsalesAccount','name','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','content','variableName','Variable','Descriptions','type','key'];(function(_0x367ed2,_0x17a712){var _0x2ae821=function(_0xaedd07){while(--_0xaedd07){_0x367ed2['push'](_0x367ed2['shift']());}};_0x2ae821(++_0x17a712);}(_0x6657,0x17f));var _0x7665=function(_0x18d6bf,_0x5fb49b){_0x18d6bf=_0x18d6bf-0x0;var _0x28dac7=_0x6657[_0x18d6bf];return _0x28dac7;};'use strict';var client=require(_0x7665('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x1b588b){return client[_0x7665('0x1')](_0x7665('0x2'),{'options':{'raw':![],'attributes':['id',_0x7665('0x3'),'username',_0x7665('0x4'),_0x7665('0x5'),_0x7665('0x6')],'include':[{'model':_0x7665('0x7'),'as':_0x7665('0x8'),'attributes':['id',_0x7665('0x3')],'include':[{'model':_0x7665('0x9'),'as':_0x7665('0xa'),'attributes':['id','type',_0x7665('0xb'),_0x7665('0xc')],'include':[{'model':_0x7665('0xd'),'as':_0x7665('0xd'),'attributes':['id',_0x7665('0x3')]}]},{'model':_0x7665('0x9'),'as':_0x7665('0xe'),'attributes':['id',_0x7665('0xf'),'content',_0x7665('0x10'),_0x7665('0x11'),_0x7665('0x12'),'variableName'],'include':[{'model':_0x7665('0xd'),'as':'Variable','attributes':['id',_0x7665('0x3')]}]}]}]},'log':_0x7665('0x13')});};};
\ No newline at end of file
index 103602d..9b6a71d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dd7=['clientSecret','securityToken','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead','Subjects','Variable','SalesforceField','Descriptions','Fields','../../client','getSalesforceAccounts','Request','name','username','password','clientId'];(function(_0x2af959,_0x59c5c4){var _0x2e650b=function(_0x763e5d){while(--_0x763e5d){_0x2af959['push'](_0x2af959['shift']());}};_0x2e650b(++_0x59c5c4);}(_0x3dd7,0xe9));var _0x73dd=function(_0x5a2583,_0x562aa1){_0x5a2583=_0x5a2583-0x0;var _0x55db5a=_0x3dd7[_0x5a2583];return _0x55db5a;};'use strict';var client=require(_0x73dd('0x0'));exports[_0x73dd('0x1')]=function(){return function(_0x627ca2){return client[_0x73dd('0x2')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0x73dd('0x3'),_0x73dd('0x4'),_0x73dd('0x5'),'remoteUri',_0x73dd('0x6'),_0x73dd('0x7'),_0x73dd('0x8'),'serverUrl',_0x73dd('0x9')],'include':[{'model':_0x73dd('0xa'),'as':_0x73dd('0xb'),'attributes':['id',_0x73dd('0x3'),_0x73dd('0xc'),_0x73dd('0xd'),_0x73dd('0xe'),_0x73dd('0xf'),_0x73dd('0x10'),_0x73dd('0x11'),_0x73dd('0x12')],'include':[{'model':'SalesforceField','as':_0x73dd('0x13'),'include':[{'model':'Variable','as':_0x73dd('0x14'),'attributes':['id','name']}]},{'model':_0x73dd('0x15'),'as':_0x73dd('0x16'),'include':[{'model':_0x73dd('0x14'),'as':_0x73dd('0x14'),'attributes':['id',_0x73dd('0x3')]}]},{'model':_0x73dd('0x15'),'as':_0x73dd('0x17'),'include':[{'model':_0x73dd('0x14'),'as':'Variable','attributes':['id','name']}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0xcdb4=['GetSalesforceAccount','name','username','password','remoteUri','clientId','clientSecret','securityToken','Configurations','moduleSearch','ticketType','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead','SalesforceField','Subjects','Variable','Fields','../../client'];(function(_0x3d1969,_0x57745e){var _0x5da1f2=function(_0xaa1995){while(--_0xaa1995){_0x3d1969['push'](_0x3d1969['shift']());}};_0x5da1f2(++_0x57745e);}(_0xcdb4,0x1f3));var _0x4cdb=function(_0xe48526,_0x190708){_0xe48526=_0xe48526-0x0;var _0x255488=_0xcdb4[_0xe48526];return _0x255488;};'use strict';var client=require(_0x4cdb('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x5929be){return client['Request'](_0x4cdb('0x1'),{'options':{'raw':![],'attributes':['id',_0x4cdb('0x2'),_0x4cdb('0x3'),_0x4cdb('0x4'),_0x4cdb('0x5'),_0x4cdb('0x6'),_0x4cdb('0x7'),_0x4cdb('0x8'),'serverUrl','type'],'include':[{'model':'SalesforceConfiguration','as':_0x4cdb('0x9'),'attributes':['id','name',_0x4cdb('0xa'),'moduleCreate',_0x4cdb('0xb'),_0x4cdb('0xc'),_0x4cdb('0xd'),_0x4cdb('0xe'),_0x4cdb('0xf')],'include':[{'model':_0x4cdb('0x10'),'as':_0x4cdb('0x11'),'include':[{'model':'Variable','as':_0x4cdb('0x12'),'attributes':['id','name']}]},{'model':_0x4cdb('0x10'),'as':'Descriptions','include':[{'model':_0x4cdb('0x12'),'as':_0x4cdb('0x12'),'attributes':['id',_0x4cdb('0x2')]}]},{'model':_0x4cdb('0x10'),'as':_0x4cdb('0x13'),'include':[{'model':_0x4cdb('0x12'),'as':_0x4cdb('0x12'),'attributes':['id',_0x4cdb('0x2')]}]}]}]},'log':_0x4cdb('0x1')});};};
\ No newline at end of file
index 4093b70..8197b21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2675=['ServicenowField','type','content','Variable','Descriptions','keyType','variableName','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','GetServicenowAccount','name','username','password','remoteUri','serverUrl','ServicenowConfiguration','Configurations'];(function(_0x444dce,_0x2016c5){var _0x7a56be=function(_0x3fa8d1){while(--_0x3fa8d1){_0x444dce['push'](_0x444dce['shift']());}};_0x7a56be(++_0x2016c5);}(_0x2675,0x75));var _0x5267=function(_0x45f8fd,_0x150795){_0x45f8fd=_0x45f8fd-0x0;var _0x33b55a=_0x2675[_0x45f8fd];return _0x33b55a;};'use strict';var client=require(_0x5267('0x0'));exports['getServicenowAccounts']=function(){return function(_0x53e71f){return client['Request'](_0x5267('0x1'),{'options':{'raw':![],'attributes':['id',_0x5267('0x2'),'description',_0x5267('0x3'),_0x5267('0x4'),'email',_0x5267('0x5'),_0x5267('0x6')],'include':[{'model':_0x5267('0x7'),'as':_0x5267('0x8'),'attributes':['id',_0x5267('0x2')],'include':[{'model':_0x5267('0x9'),'as':'Subjects','attributes':['id',_0x5267('0xa'),_0x5267('0xb'),'variableName'],'include':[{'model':_0x5267('0xc'),'as':'Variable','attributes':['id',_0x5267('0x2')]}]},{'model':_0x5267('0x9'),'as':_0x5267('0xd'),'attributes':['id','type',_0x5267('0xb'),'key',_0x5267('0xe'),'keyContent',_0x5267('0xf')],'include':[{'model':_0x5267('0xc'),'as':_0x5267('0xc'),'attributes':['id',_0x5267('0x2')]}]},{'model':_0x5267('0x9'),'as':_0x5267('0x10'),'attributes':['id',_0x5267('0xa'),_0x5267('0xb'),_0x5267('0x11'),_0x5267('0x12'),_0x5267('0x13'),_0x5267('0xf')],'include':[{'model':_0x5267('0xc'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x5267('0x14')});};};
\ No newline at end of file
+var _0xba34=['keyContent','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','name','Subjects','type','content','variableName','Variable','ServicenowField','Descriptions','keyType'];(function(_0x1d0d72,_0x536772){var _0x2aa4e0=function(_0x3e3e63){while(--_0x3e3e63){_0x1d0d72['push'](_0x1d0d72['shift']());}};_0x2aa4e0(++_0x536772);}(_0xba34,0x119));var _0x4ba3=function(_0x2470f5,_0x5f00db){_0x2470f5=_0x2470f5-0x0;var _0x1b0d7b=_0xba34[_0x2470f5];return _0x1b0d7b;};'use strict';var client=require(_0x4ba3('0x0'));exports[_0x4ba3('0x1')]=function(){return function(_0xb04f7b){return client[_0x4ba3('0x2')](_0x4ba3('0x3'),{'options':{'raw':![],'attributes':['id','name','description','username',_0x4ba3('0x4'),_0x4ba3('0x5'),_0x4ba3('0x6'),_0x4ba3('0x7')],'include':[{'model':_0x4ba3('0x8'),'as':_0x4ba3('0x9'),'attributes':['id',_0x4ba3('0xa')],'include':[{'model':'ServicenowField','as':_0x4ba3('0xb'),'attributes':['id',_0x4ba3('0xc'),_0x4ba3('0xd'),_0x4ba3('0xe')],'include':[{'model':_0x4ba3('0xf'),'as':_0x4ba3('0xf'),'attributes':['id',_0x4ba3('0xa')]}]},{'model':_0x4ba3('0x10'),'as':_0x4ba3('0x11'),'attributes':['id',_0x4ba3('0xc'),_0x4ba3('0xd'),'key',_0x4ba3('0x12'),_0x4ba3('0x13'),'variableName'],'include':[{'model':_0x4ba3('0xf'),'as':'Variable','attributes':['id',_0x4ba3('0xa')]}]},{'model':'ServicenowField','as':_0x4ba3('0x14'),'attributes':['id',_0x4ba3('0xc'),_0x4ba3('0xd'),_0x4ba3('0x15'),_0x4ba3('0x16'),_0x4ba3('0x17'),_0x4ba3('0xe')],'include':[{'model':_0x4ba3('0xf'),'as':_0x4ba3('0xf'),'attributes':['id',_0x4ba3('0xa')]}]}]}]},'log':_0x4ba3('0x18')});};};
\ No newline at end of file
index ba1654f..fd646a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['remoteUri','serverUrl','SugarcrmConfiguration','Configurations','name','SugarcrmField','Subjects','Variable','Descriptions','content','key','keyType','variableName','Fields','customField','GetSugarcrmAccount','../../client','Request','username','password'];(function(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0x0295,0x1f0));var _0x5029=function(_0x119e4a,_0x1c87aa){_0x119e4a=_0x119e4a-0x0;var _0xe18cb0=_0x0295[_0x119e4a];return _0xe18cb0;};'use strict';var client=require(_0x5029('0x0'));exports['getSugarcrmAccounts']=function(){return function(_0x5e71d0){return client[_0x5029('0x1')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id','name',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5')],'include':[{'model':_0x5029('0x6'),'as':_0x5029('0x7'),'attributes':['id',_0x5029('0x8')],'include':[{'model':_0x5029('0x9'),'as':_0x5029('0xa'),'attributes':['id','type','content','variableName'],'include':[{'model':_0x5029('0xb'),'as':'Variable','attributes':['id',_0x5029('0x8')]}]},{'model':'SugarcrmField','as':_0x5029('0xc'),'attributes':['id','type',_0x5029('0xd'),_0x5029('0xe'),_0x5029('0xf'),'keyContent',_0x5029('0x10')],'include':[{'model':_0x5029('0xb'),'as':_0x5029('0xb'),'attributes':['id','name']}]},{'model':_0x5029('0x9'),'as':_0x5029('0x11'),'attributes':['id','type','content','idField','nameField',_0x5029('0x12'),_0x5029('0x10')],'include':[{'model':_0x5029('0xb'),'as':_0x5029('0xb'),'attributes':['id',_0x5029('0x8')]}]}]}]},'log':_0x5029('0x13')});};};
\ No newline at end of file
+var _0xda2d=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField'];(function(_0x2d5934,_0x1acc4f){var _0x5807c8=function(_0x326cc5){while(--_0x326cc5){_0x2d5934['push'](_0x2d5934['shift']());}};_0x5807c8(++_0x1acc4f);}(_0xda2d,0x102));var _0xdda2=function(_0x1567dd,_0x377d49){_0x1567dd=_0x1567dd-0x0;var _0x3e0c13=_0xda2d[_0x1567dd];return _0x3e0c13;};'use strict';var client=require('../../client');exports[_0xdda2('0x0')]=function(){return function(_0x35f029){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'options':{'raw':![],'attributes':['id',_0xdda2('0x3'),'username','password','remoteUri',_0xdda2('0x4')],'include':[{'model':_0xdda2('0x5'),'as':_0xdda2('0x6'),'attributes':['id',_0xdda2('0x3')],'include':[{'model':_0xdda2('0x7'),'as':_0xdda2('0x8'),'attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]},{'model':_0xdda2('0x7'),'as':'Descriptions','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xd'),_0xdda2('0xe'),_0xdda2('0xf'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':_0xdda2('0xc'),'attributes':['id','name']}]},{'model':'SugarcrmField','as':'Fields','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0x10'),_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
index 2e801c5..3f14680 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c64=['name','description','username','accessKey','serverUrl','Configurations','VtigerField','Subjects','type','content','Variable','Descriptions','key','keyType','keyContent','idField','nameField','customField','variableName','getVtigerAccounts','GetVtigerAccount'];(function(_0x8b2856,_0x4aca19){var _0x161141=function(_0x3e9d83){while(--_0x3e9d83){_0x8b2856['push'](_0x8b2856['shift']());}};_0x161141(++_0x4aca19);}(_0x6c64,0xd0));var _0x46c6=function(_0x14c169,_0x4aa349){_0x14c169=_0x14c169-0x0;var _0x34074e=_0x6c64[_0x14c169];return _0x34074e;};'use strict';var client=require('../../client');exports[_0x46c6('0x0')]=function(){return function(_0x583974){return client['Request'](_0x46c6('0x1'),{'options':{'raw':![],'attributes':['id',_0x46c6('0x2'),_0x46c6('0x3'),_0x46c6('0x4'),_0x46c6('0x5'),'remoteUri',_0x46c6('0x6')],'include':[{'model':'VtigerConfiguration','as':_0x46c6('0x7'),'attributes':['id','name'],'include':[{'model':_0x46c6('0x8'),'as':_0x46c6('0x9'),'attributes':['id',_0x46c6('0xa'),_0x46c6('0xb'),'variableName'],'include':[{'model':_0x46c6('0xc'),'as':_0x46c6('0xc'),'attributes':['id','name']}]},{'model':_0x46c6('0x8'),'as':_0x46c6('0xd'),'attributes':['id',_0x46c6('0xa'),_0x46c6('0xb'),_0x46c6('0xe'),_0x46c6('0xf'),_0x46c6('0x10'),'variableName'],'include':[{'model':_0x46c6('0xc'),'as':_0x46c6('0xc'),'attributes':['id',_0x46c6('0x2')]}]},{'model':_0x46c6('0x8'),'as':'Fields','attributes':['id','type',_0x46c6('0xb'),_0x46c6('0x11'),_0x46c6('0x12'),_0x46c6('0x13'),_0x46c6('0x14')],'include':[{'model':_0x46c6('0xc'),'as':_0x46c6('0xc'),'attributes':['id',_0x46c6('0x2')]}]}]}]},'log':_0x46c6('0x1')});};};
\ No newline at end of file
+var _0xb3e2=['serverUrl','Configurations','VtigerField','Subjects','type','content','variableName','Variable','key','keyType','keyContent','Fields','idField','customField','Request','GetVtigerAccount','name','description','accessKey','remoteUri'];(function(_0x1bb126,_0x2b65f7){var _0x5b95d6=function(_0x7ff569){while(--_0x7ff569){_0x1bb126['push'](_0x1bb126['shift']());}};_0x5b95d6(++_0x2b65f7);}(_0xb3e2,0x1b2));var _0x2b3e=function(_0x1b979d,_0x1207d2){_0x1b979d=_0x1b979d-0x0;var _0x5aa467=_0xb3e2[_0x1b979d];return _0x5aa467;};'use strict';var client=require('../../client');exports['getVtigerAccounts']=function(){return function(_0x48c2b2){return client[_0x2b3e('0x0')](_0x2b3e('0x1'),{'options':{'raw':![],'attributes':['id',_0x2b3e('0x2'),_0x2b3e('0x3'),'username',_0x2b3e('0x4'),_0x2b3e('0x5'),_0x2b3e('0x6')],'include':[{'model':'VtigerConfiguration','as':_0x2b3e('0x7'),'attributes':['id',_0x2b3e('0x2')],'include':[{'model':_0x2b3e('0x8'),'as':_0x2b3e('0x9'),'attributes':['id',_0x2b3e('0xa'),_0x2b3e('0xb'),_0x2b3e('0xc')],'include':[{'model':_0x2b3e('0xd'),'as':_0x2b3e('0xd'),'attributes':['id',_0x2b3e('0x2')]}]},{'model':_0x2b3e('0x8'),'as':'Descriptions','attributes':['id',_0x2b3e('0xa'),_0x2b3e('0xb'),_0x2b3e('0xe'),_0x2b3e('0xf'),_0x2b3e('0x10'),_0x2b3e('0xc')],'include':[{'model':_0x2b3e('0xd'),'as':_0x2b3e('0xd'),'attributes':['id',_0x2b3e('0x2')]}]},{'model':'VtigerField','as':_0x2b3e('0x11'),'attributes':['id',_0x2b3e('0xa'),_0x2b3e('0xb'),_0x2b3e('0x12'),'nameField',_0x2b3e('0x13'),_0x2b3e('0xc')],'include':[{'model':_0x2b3e('0xd'),'as':'Variable','attributes':['id',_0x2b3e('0x2')]}]}]}]},'log':_0x2b3e('0x1')});};};
\ No newline at end of file
index 2abddfe..5094b02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2426=['ZendeskField','content','variableName','Variable','key','keyType','idField','nameField','GetZendeskAccount','../../client','getZendeskAccounts','name','username','password','token','serverUrl','type','ZendeskConfiguration','Configurations'];(function(_0x47750c,_0x52d1cd){var _0x276574=function(_0x4962de){while(--_0x4962de){_0x47750c['push'](_0x47750c['shift']());}};_0x276574(++_0x52d1cd);}(_0x2426,0xb4));var _0x6242=function(_0x417e05,_0xd1e6ca){_0x417e05=_0x417e05-0x0;var _0x38bfda=_0x2426[_0x417e05];return _0x38bfda;};'use strict';var client=require(_0x6242('0x0'));exports[_0x6242('0x1')]=function(){return function(_0x1cfa34){return client['Request']('GetZendeskAccount',{'options':{'raw':![],'attributes':['id',_0x6242('0x2'),_0x6242('0x3'),_0x6242('0x4'),_0x6242('0x5'),'remoteUri','authType',_0x6242('0x6'),_0x6242('0x7')],'include':[{'model':_0x6242('0x8'),'as':_0x6242('0x9'),'attributes':['id',_0x6242('0x2')],'include':[{'model':'Tag','attributes':['id',_0x6242('0x2')]},{'model':_0x6242('0xa'),'as':'Subjects','attributes':['id','type',_0x6242('0xb'),_0x6242('0xc')],'include':[{'model':_0x6242('0xd'),'as':_0x6242('0xd'),'attributes':['id',_0x6242('0x2')]}]},{'model':_0x6242('0xa'),'as':'Descriptions','attributes':['id',_0x6242('0x7'),_0x6242('0xb'),_0x6242('0xe'),_0x6242('0xf'),'keyContent','variableName'],'include':[{'model':_0x6242('0xd'),'as':_0x6242('0xd'),'attributes':['id',_0x6242('0x2')]}]},{'model':_0x6242('0xa'),'as':'Fields','attributes':['id',_0x6242('0x7'),'content',_0x6242('0x10'),_0x6242('0x11'),'customField','variableName'],'include':[{'model':_0x6242('0xd'),'as':_0x6242('0xd'),'attributes':['id','name']}]}]}]},'log':_0x6242('0x12')});};};
\ No newline at end of file
+var _0xcbfb=['nameField','getZendeskAccounts','Request','GetZendeskAccount','name','username','token','remoteUri','authType','serverUrl','ZendeskConfiguration','Configurations','Tag','ZendeskField','Subjects','type','content','variableName','Variable','Descriptions','Fields','idField'];(function(_0x572156,_0xb11cdf){var _0x4c0640=function(_0x410e99){while(--_0x410e99){_0x572156['push'](_0x572156['shift']());}};_0x4c0640(++_0xb11cdf);}(_0xcbfb,0xf3));var _0xbcbf=function(_0x28a55a,_0x1490bb){_0x28a55a=_0x28a55a-0x0;var _0x176d8c=_0xcbfb[_0x28a55a];return _0x176d8c;};'use strict';var client=require('../../client');exports[_0xbcbf('0x0')]=function(){return function(_0x3f6473){return client[_0xbcbf('0x1')](_0xbcbf('0x2'),{'options':{'raw':![],'attributes':['id',_0xbcbf('0x3'),_0xbcbf('0x4'),'password',_0xbcbf('0x5'),_0xbcbf('0x6'),_0xbcbf('0x7'),_0xbcbf('0x8'),'type'],'include':[{'model':_0xbcbf('0x9'),'as':_0xbcbf('0xa'),'attributes':['id',_0xbcbf('0x3')],'include':[{'model':_0xbcbf('0xb'),'attributes':['id',_0xbcbf('0x3')]},{'model':_0xbcbf('0xc'),'as':_0xbcbf('0xd'),'attributes':['id',_0xbcbf('0xe'),_0xbcbf('0xf'),_0xbcbf('0x10')],'include':[{'model':_0xbcbf('0x11'),'as':_0xbcbf('0x11'),'attributes':['id','name']}]},{'model':'ZendeskField','as':_0xbcbf('0x12'),'attributes':['id',_0xbcbf('0xe'),_0xbcbf('0xf'),'key','keyType','keyContent',_0xbcbf('0x10')],'include':[{'model':_0xbcbf('0x11'),'as':_0xbcbf('0x11'),'attributes':['id',_0xbcbf('0x3')]}]},{'model':_0xbcbf('0xc'),'as':_0xbcbf('0x13'),'attributes':['id',_0xbcbf('0xe'),_0xbcbf('0xf'),_0xbcbf('0x14'),_0xbcbf('0x15'),'customField',_0xbcbf('0x10')],'include':[{'model':_0xbcbf('0x11'),'as':_0xbcbf('0x11'),'attributes':['id',_0xbcbf('0x3')]}]}]}]},'log':_0xbcbf('0x2')});};};
\ No newline at end of file
index ed6c3f7..b21d1cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffe6=['customField','../../client','getZohoAccounts','GetZohoAccount','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','moduleSearch','ZohoField','Subjects','type','content','variableName','Variable','key','keyType','keyContent','Fields','nameField'];(function(_0x326e5e,_0x491c33){var _0x4d0fde=function(_0xcbcedc){while(--_0xcbcedc){_0x326e5e['push'](_0x326e5e['shift']());}};_0x4d0fde(++_0x491c33);}(_0xffe6,0xd1));var _0x6ffe=function(_0x350bdd,_0x49924b){_0x350bdd=_0x350bdd-0x0;var _0x5b26b9=_0xffe6[_0x350bdd];return _0x5b26b9;};'use strict';var client=require(_0x6ffe('0x0'));exports[_0x6ffe('0x1')]=function(){return function(_0x44f22b){return client['Request'](_0x6ffe('0x2'),{'options':{'raw':![],'attributes':['id',_0x6ffe('0x3'),_0x6ffe('0x4'),_0x6ffe('0x5'),_0x6ffe('0x6'),_0x6ffe('0x7'),_0x6ffe('0x8'),_0x6ffe('0x9'),_0x6ffe('0xa'),_0x6ffe('0xb')],'include':[{'model':'ZohoConfiguration','as':_0x6ffe('0xc'),'attributes':['id',_0x6ffe('0x3'),'moduleCreate',_0x6ffe('0xd'),_0x6ffe('0x4')],'include':[{'model':_0x6ffe('0xe'),'as':_0x6ffe('0xf'),'attributes':['id',_0x6ffe('0x10'),_0x6ffe('0x11'),_0x6ffe('0x12')],'include':[{'model':_0x6ffe('0x13'),'as':_0x6ffe('0x13'),'attributes':['id',_0x6ffe('0x3')]}]},{'model':_0x6ffe('0xe'),'as':'Descriptions','attributes':['id',_0x6ffe('0x10'),_0x6ffe('0x11'),_0x6ffe('0x14'),_0x6ffe('0x15'),_0x6ffe('0x16'),_0x6ffe('0x12')],'include':[{'model':_0x6ffe('0x13'),'as':_0x6ffe('0x13'),'attributes':['id',_0x6ffe('0x3')]}]},{'model':_0x6ffe('0xe'),'as':_0x6ffe('0x17'),'attributes':['id','type',_0x6ffe('0x11'),'idField',_0x6ffe('0x18'),_0x6ffe('0x19'),_0x6ffe('0x12')],'include':[{'model':_0x6ffe('0x13'),'as':_0x6ffe('0x13'),'attributes':['id',_0x6ffe('0x3')]}]}]}]},'log':_0x6ffe('0x2')});};};
\ No newline at end of file
+var _0x6432=['clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','Subjects','content','variableName','Variable','name','ZohoField','key','keyContent','Fields','type','nameField','customField','../../client','getZohoAccounts','Request','GetZohoAccount','description','host'];(function(_0x3c2812,_0x40e7e7){var _0x296bf5=function(_0x549b2e){while(--_0x549b2e){_0x3c2812['push'](_0x3c2812['shift']());}};_0x296bf5(++_0x40e7e7);}(_0x6432,0x1ee));var _0x2643=function(_0x25b7a9,_0x94e301){_0x25b7a9=_0x25b7a9-0x0;var _0x66ac34=_0x6432[_0x25b7a9];return _0x66ac34;};'use strict';var client=require(_0x2643('0x0'));exports[_0x2643('0x1')]=function(){return function(_0x15d44c){return client[_0x2643('0x2')](_0x2643('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2643('0x4'),_0x2643('0x5'),'zone','clientId',_0x2643('0x6'),_0x2643('0x7'),_0x2643('0x8'),_0x2643('0x9')],'include':[{'model':_0x2643('0xa'),'as':_0x2643('0xb'),'attributes':['id','name',_0x2643('0xc'),'moduleSearch',_0x2643('0x4')],'include':[{'model':'ZohoField','as':_0x2643('0xd'),'attributes':['id','type',_0x2643('0xe'),_0x2643('0xf')],'include':[{'model':'Variable','as':_0x2643('0x10'),'attributes':['id',_0x2643('0x11')]}]},{'model':_0x2643('0x12'),'as':'Descriptions','attributes':['id','type',_0x2643('0xe'),_0x2643('0x13'),'keyType',_0x2643('0x14'),'variableName'],'include':[{'model':'Variable','as':_0x2643('0x10'),'attributes':['id',_0x2643('0x11')]}]},{'model':_0x2643('0x12'),'as':_0x2643('0x15'),'attributes':['id',_0x2643('0x16'),_0x2643('0xe'),'idField',_0x2643('0x17'),_0x2643('0x18'),_0x2643('0xf')],'include':[{'model':_0x2643('0x10'),'as':_0x2643('0x10'),'attributes':['id',_0x2643('0x11')]}]}]}]},'log':_0x2643('0x3')});};};
\ No newline at end of file
index 37b7564..75bb0a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb9b=['voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','inbound','exten','queue','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','Request','membername','starttime','seconds','outbound','dialstring','agent','moment','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt'];(function(_0x1f1e31,_0x27b5c3){var _0x229b56=function(_0x16db77){while(--_0x16db77){_0x1f1e31['push'](_0x1f1e31['shift']());}};_0x229b56(++_0x27b5c3);}(_0xdb9b,0x1da));var _0xbdb9=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xdb9b[_0x2d7f0e];return _0x110b07;};'use strict';var moment=require(_0xbdb9('0x0'));var _=require(_0xbdb9('0x1'));var util=require(_0xbdb9('0x2'));var client=require(_0xbdb9('0x3'));exports['voiceQueueReport']=function(_0x3cf47c){var _0x63f6fd=_0x3cf47c[_0xbdb9('0x4')]||_0x3cf47c[_0xbdb9('0x5')];return client['Request']('CreateMemberReport',{'body':{'channel':_0xbdb9('0x6'),'membername':_0x3cf47c[_0xbdb9('0x7')],'interface':_[_0xbdb9('0x8')](_0x3cf47c[_0xbdb9('0x9')])?util[_0xbdb9('0xa')](_0xbdb9('0xb'),_0x3cf47c[_0xbdb9('0x7')]):_0x3cf47c['interface'],'type':_0xbdb9('0xc'),'enterAt':_0x3cf47c[_0xbdb9('0xd')],'exitAt':_0x63f6fd,'duration':moment(_0x63f6fd)[_0xbdb9('0xe')](_0x3cf47c[_0xbdb9('0xd')],'seconds'),'data1':_0xbdb9('0xf'),'data2':_0x3cf47c['calleridnum'],'data3':_0x3cf47c[_0xbdb9('0x10')],'data4':null,'data5':_0x3cf47c[_0xbdb9('0x11')],'role':'agent','internal':_0x3cf47c[_0xbdb9('0x12')]?_[_0xbdb9('0x13')](_0x3cf47c[_0xbdb9('0x12')]):undefined,'uniqueid':_0x3cf47c[_0xbdb9('0x14')]},'log':_0xbdb9('0x15')});};exports[_0xbdb9('0x16')]=function(_0x5c8a7a){return client[_0xbdb9('0x17')]('CreateMemberReport',{'body':{'channel':_0xbdb9('0x6'),'membername':_0x5c8a7a[_0xbdb9('0x18')],'interface':_0x5c8a7a[_0xbdb9('0x9')],'type':_0xbdb9('0xc'),'enterAt':_0x5c8a7a[_0xbdb9('0x19')],'exitAt':_0x5c8a7a['endtime'],'duration':moment(_0x5c8a7a['endtime'])['diff'](_0x5c8a7a[_0xbdb9('0x19')],_0xbdb9('0x1a'))>=0x0?moment(_0x5c8a7a['endtime'])[_0xbdb9('0xe')](_0x5c8a7a[_0xbdb9('0x19')],_0xbdb9('0x1a')):null,'data1':_0xbdb9('0x1b'),'data2':_0x5c8a7a['accountcode'],'data3':_0x5c8a7a[_0xbdb9('0x10')],'data4':_0x5c8a7a[_0xbdb9('0x1c')]||null,'role':_0xbdb9('0x1d'),'internal':_0x5c8a7a[_0xbdb9('0x12')]?_[_0xbdb9('0x13')](_0x5c8a7a[_0xbdb9('0x12')]):undefined,'uniqueid':_0x5c8a7a[_0xbdb9('0x14')]},'log':_0xbdb9('0x15')});};
\ No newline at end of file
+var _0x14d0=['queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','uniqueid','voiceDialReport','starttime','endtime','diff','moment','lodash','voiceQueueReport'];(function(_0x3644b9,_0x20d7df){var _0x178168=function(_0x3431b2){while(--_0x3431b2){_0x3644b9['push'](_0x3644b9['shift']());}};_0x178168(++_0x20d7df);}(_0x14d0,0x183));var _0x014d=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0x14d0[_0x261522];return _0x98a25a;};'use strict';var moment=require(_0x014d('0x0'));var _=require(_0x014d('0x1'));var util=require('util');var client=require('../client');exports[_0x014d('0x2')]=function(_0x183ca8){var _0x5212bb=_0x183ca8[_0x014d('0x3')]||_0x183ca8[_0x014d('0x4')];return client[_0x014d('0x5')](_0x014d('0x6'),{'body':{'channel':_0x014d('0x7'),'membername':_0x183ca8[_0x014d('0x8')],'interface':_['isNil'](_0x183ca8[_0x014d('0x9')])?util[_0x014d('0xa')](_0x014d('0xb'),_0x183ca8[_0x014d('0x8')]):_0x183ca8[_0x014d('0x9')],'type':_0x014d('0xc'),'enterAt':_0x183ca8[_0x014d('0xd')],'exitAt':_0x5212bb,'duration':moment(_0x5212bb)['diff'](_0x183ca8[_0x014d('0xd')],_0x014d('0xe')),'data1':_0x014d('0xf'),'data2':_0x183ca8[_0x014d('0x10')],'data3':_0x183ca8[_0x014d('0x11')],'data4':null,'data5':_0x183ca8['queue'],'role':_0x014d('0x12'),'internal':_0x183ca8[_0x014d('0x13')]?_[_0x014d('0x14')](_0x183ca8['accountcode']):undefined,'uniqueid':_0x183ca8[_0x014d('0x15')]},'log':_0x014d('0x6')});};exports[_0x014d('0x16')]=function(_0x2c378a){return client['Request'](_0x014d('0x6'),{'body':{'channel':_0x014d('0x7'),'membername':_0x2c378a['membername'],'interface':_0x2c378a[_0x014d('0x9')],'type':'TALKING','enterAt':_0x2c378a[_0x014d('0x17')],'exitAt':_0x2c378a['endtime'],'duration':moment(_0x2c378a[_0x014d('0x18')])[_0x014d('0x19')](_0x2c378a[_0x014d('0x17')],_0x014d('0xe'))>=0x0?moment(_0x2c378a[_0x014d('0x18')])['diff'](_0x2c378a['starttime'],_0x014d('0xe')):null,'data1':'outbound','data2':_0x2c378a['accountcode'],'data3':_0x2c378a['exten'],'data4':_0x2c378a['dialstring']||null,'role':'agent','internal':_0x2c378a['accountcode']?_[_0x014d('0x14')](_0x2c378a[_0x014d('0x13')]):undefined,'uniqueid':_0x2c378a[_0x014d('0x15')]},'log':_0x014d('0x6')});};
\ No newline at end of file
index 2a4a06f..91756cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80df=['ShowSetting','GetSettings','../client','getSettings','Request'];(function(_0xee18e4,_0x1835eb){var _0x5993a8=function(_0x1af87c){while(--_0x1af87c){_0xee18e4['push'](_0xee18e4['shift']());}};_0x5993a8(++_0x1835eb);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xf80d('0x0'));exports[_0xf80d('0x1')]=function(){return client[_0xf80d('0x2')](_0xf80d('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xf80d('0x4')});};
\ No newline at end of file
+var _0x4c68=['../client','getSettings','Request','ShowSetting'];(function(_0x21ef85,_0x2d9f4f){var _0x5b9a7d=function(_0x5b5f13){while(--_0x5b5f13){_0x21ef85['push'](_0x21ef85['shift']());}};_0x5b9a7d(++_0x2d9f4f);}(_0x4c68,0x198));var _0x84c6=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0x4c68[_0x366388];return _0x41c97e;};'use strict';var client=require(_0x84c6('0x0'));exports[_0x84c6('0x1')]=function(){return client[_0x84c6('0x2')](_0x84c6('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':'GetSettings'});};
\ No newline at end of file
index de5d4e0..31fd8d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf97=['name','html','getTemplates','GetTemplate'];(function(_0x55e6ff,_0x571109){var _0x33382e=function(_0x2e7e15){while(--_0x2e7e15){_0x55e6ff['push'](_0x55e6ff['shift']());}};_0x33382e(++_0x571109);}(_0xdf97,0x1ce));var _0x7df9=function(_0xb1e62b,_0x237410){_0xb1e62b=_0xb1e62b-0x0;var _0x45c369=_0xdf97[_0xb1e62b];return _0x45c369;};'use strict';var client=require('../client');exports[_0x7df9('0x0')]=function(_0x101ec9){return function(_0x277a61){return client['Request'](_0x7df9('0x1'),{'options':{'raw':!![],'attributes':['id',_0x7df9('0x2'),_0x7df9('0x3')]},'log':'GetTemplate'});};};
\ No newline at end of file
+var _0x1ae7=['Request','GetTemplate','name','../client','getTemplates'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1ae7,0xc6));var _0x71ae=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x1ae7[_0x2bf141];return _0x48277b;};'use strict';var client=require(_0x71ae('0x0'));exports[_0x71ae('0x1')]=function(_0x181944){return function(_0x57ade7){return client[_0x71ae('0x2')](_0x71ae('0x3'),{'options':{'raw':!![],'attributes':['id',_0x71ae('0x4'),'html']},'log':'GetTemplate'});};};
\ No newline at end of file
index d701113..01e6ba5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f73=['AnyConditions','Action','Actions','action','data2','data3','data5','data7','../client','getTriggers','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value'];(function(_0x553117,_0x168e97){var _0x530c41=function(_0xccb772){while(--_0xccb772){_0x553117['push'](_0x553117['shift']());}};_0x530c41(++_0x168e97);}(_0x5f73,0x7a));var _0x35f7=function(_0x32aacc,_0x1db2dc){_0x32aacc=_0x32aacc-0x0;var _0x413f89=_0x5f73[_0x32aacc];return _0x413f89;};'use strict';var client=require(_0x35f7('0x0'));exports[_0x35f7('0x1')]=function(_0xb07765){return function(_0x1a1852){return client['Request'](_0x35f7('0x2'),{'options':{'raw':![],'attributes':['id',_0x35f7('0x3'),_0x35f7('0x4'),_0x35f7('0x5')],'include':[{'model':_0x35f7('0x6'),'as':_0x35f7('0x7'),'attributes':['id',_0x35f7('0x8'),_0x35f7('0x9'),_0x35f7('0xa')]},{'model':'Condition','as':_0x35f7('0xb'),'attributes':['id',_0x35f7('0x8'),_0x35f7('0x9'),_0x35f7('0xa')]},{'model':_0x35f7('0xc'),'as':_0x35f7('0xd'),'attributes':['id',_0x35f7('0xe'),'data1',_0x35f7('0xf'),_0x35f7('0x10'),'data4',_0x35f7('0x11'),'data6',_0x35f7('0x12')]}]},'log':_0x35f7('0x2')});};};
\ No newline at end of file
+var _0x3e86=['data7','../client','getTriggers','GetTrigger','channel','AllConditions','operator','value','Condition','AnyConditions','Action','Actions','data3','data5','data6'];(function(_0x3e86d3,_0x35a4d7){var _0x4eb606=function(_0x301417){while(--_0x301417){_0x3e86d3['push'](_0x3e86d3['shift']());}};_0x4eb606(++_0x35a4d7);}(_0x3e86,0x178));var _0x63e8=function(_0x22222a,_0x3b7ad0){_0x22222a=_0x22222a-0x0;var _0x39fae4=_0x3e86[_0x22222a];return _0x39fae4;};'use strict';var client=require(_0x63e8('0x0'));exports[_0x63e8('0x1')]=function(_0x44d3dd){return function(_0x44a2cb){return client['Request'](_0x63e8('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x63e8('0x3'),'status'],'include':[{'model':'Condition','as':_0x63e8('0x4'),'attributes':['id','field',_0x63e8('0x5'),_0x63e8('0x6')]},{'model':_0x63e8('0x7'),'as':_0x63e8('0x8'),'attributes':['id','field','operator',_0x63e8('0x6')]},{'model':_0x63e8('0x9'),'as':_0x63e8('0xa'),'attributes':['id','action','data1','data2',_0x63e8('0xb'),'data4',_0x63e8('0xc'),_0x63e8('0xd'),_0x63e8('0xe')]}]},'log':_0x63e8('0x2')});};};
\ No newline at end of file
index 97988c5..d6fe12b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb079=['defaultuser','getTrunks','Request','GetTrunk','name','registry'];(function(_0x4f7e4b,_0x5bbdb2){var _0x55a507=function(_0x3c96f0){while(--_0x3c96f0){_0x4f7e4b['push'](_0x4f7e4b['shift']());}};_0x55a507(++_0x5bbdb2);}(_0xb079,0x1c9));var _0x9b07=function(_0x12c280,_0x51dd07){_0x12c280=_0x12c280-0x0;var _0x3638d3=_0xb079[_0x12c280];return _0x3638d3;};'use strict';var client=require('../client');exports[_0x9b07('0x0')]=function(_0x578a3a){return function(_0x447b2d){return client[_0x9b07('0x1')](_0x9b07('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9b07('0x3'),_0x9b07('0x4'),_0x9b07('0x5')]},'log':_0x9b07('0x2')});};};
\ No newline at end of file
+var _0x94ca=['Request','GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x5005a2,_0x4dd727){var _0x53f81c=function(_0x38add5){while(--_0x38add5){_0x5005a2['push'](_0x5005a2['shift']());}};_0x53f81c(++_0x4dd727);}(_0x94ca,0xde));var _0xa94c=function(_0x5b278c,_0x57d406){_0x5b278c=_0x5b278c-0x0;var _0x3c1eff=_0x94ca[_0x5b278c];return _0x3c1eff;};'use strict';var client=require(_0xa94c('0x0'));exports[_0xa94c('0x1')]=function(_0xd39fb2){return function(_0x2ecc99){return client[_0xa94c('0x2')](_0xa94c('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa94c('0x4'),_0xa94c('0x5'),_0xa94c('0x6')]},'log':_0xa94c('0x3')});};};
\ No newline at end of file
index c640f60..c34ac33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x25cab1,_0xdef3e5){var _0x366ddd=function(_0x1c7656){while(--_0x1c7656){_0x25cab1['push'](_0x25cab1['shift']());}};_0x366ddd(++_0xdef3e5);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'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
+var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
index adeb792..a39f73a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe256=['../client','create','CreateVoiceAgentReport','Request','UpdateVoiceAgentReport'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xe256,0x19a));var _0x6e25=function(_0xd79075,_0x494a63){_0xd79075=_0xd79075-0x0;var _0xa44283=_0xe256[_0xd79075];return _0xa44283;};'use strict';var client=require(_0x6e25('0x0'));exports[_0x6e25('0x1')]=function(_0x5a9e87){return client['Request'](_0x6e25('0x2'),{'body':_0x5a9e87,'log':_0x6e25('0x2')});};exports['update']=function(_0x363ef4,_0x29b40b,_0xcb5e54){return client[_0x6e25('0x3')](_0x6e25('0x4'),{'body':_0x363ef4,'options':{'where':{'uniqueid':_0x29b40b,'interface':_0xcb5e54,'agentcomplete':!![]}},'log':_0x6e25('0x4')});};
\ No newline at end of file
+var _0x102c=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x35dc0c,_0xcb5b2a){var _0x1c1d71=function(_0x351574){while(--_0x351574){_0x35dc0c['push'](_0x35dc0c['shift']());}};_0x1c1d71(++_0xcb5b2a);}(_0x102c,0xd5));var _0xc102=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x102c[_0x15bc81];return _0x59440e;};'use strict';var client=require(_0xc102('0x0'));exports['create']=function(_0x1d01bd){return client[_0xc102('0x1')](_0xc102('0x2'),{'body':_0x1d01bd,'log':_0xc102('0x2')});};exports['update']=function(_0xaf18fb,_0x4436fa,_0x2fd336){return client[_0xc102('0x1')](_0xc102('0x3'),{'body':_0xaf18fb,'options':{'where':{'uniqueid':_0x4436fa,'interface':_0x2fd336,'agentcomplete':!![]}},'log':_0xc102('0x3')});};
\ No newline at end of file
index a56c699..f2f258f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcc9=['context','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','YYYY-MM-DD\x20HH:mm:ss','endOf','day','format','type','disposition','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x215d1a,_0x3ed8d3){var _0x4cb722=function(_0x549f86){while(--_0x549f86){_0x215d1a['push'](_0x215d1a['shift']());}};_0x4cb722(++_0x3ed8d3);}(_0xfcc9,0x6f));var _0x9fcc=function(_0x415429,_0x1e15b8){_0x415429=_0x415429-0x0;var _0x5f3cc5=_0xfcc9[_0x415429];return _0x5f3cc5;};'use strict';var moment=require(_0x9fcc('0x0'));var util=require(_0x9fcc('0x1'));var _=require(_0x9fcc('0x2'));var client=require(_0x9fcc('0x3'));exports[_0x9fcc('0x4')]=function(_0x4b60f8){return client[_0x9fcc('0x5')](_0x9fcc('0x6'),{'body':_[_0x9fcc('0x7')](_0x4b60f8,{'source':_0x4b60f8[_0x9fcc('0x8')],'destinationcontext':_0x4b60f8[_0x9fcc('0x9')],'callerid':_0x4b60f8['callerid'],'amaflags':_0x9fcc('0xa')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0x9fcc('0x5')](_0x9fcc('0xb'),{'options':{'where':{'type':[_0x9fcc('0xc')],'createdAt':{'$between':[moment()[_0x9fcc('0xd')]('day')['format'](_0x9fcc('0xe')),moment()[_0x9fcc('0xf')](_0x9fcc('0x10'))[_0x9fcc('0x11')](_0x9fcc('0xe'))]}},'attributes':[_0x9fcc('0x12'),_0x9fcc('0x13'),'duration','billableseconds']},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
+var _0x29b8=['context','callerid','DOCUMENTATION','outbound','YYYY-MM-DD\x20HH:mm:ss','endOf','day','format','type','duration','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','merge'];(function(_0x16716c,_0x25cf52){var _0xfe2809=function(_0x3ea14d){while(--_0x3ea14d){_0x16716c['push'](_0x16716c['shift']());}};_0xfe2809(++_0x25cf52);}(_0x29b8,0x103));var _0x829b=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0x29b8[_0x912d27];return _0x31b918;};'use strict';var moment=require(_0x829b('0x0'));var util=require(_0x829b('0x1'));var _=require('lodash');var client=require(_0x829b('0x2'));exports[_0x829b('0x3')]=function(_0x26da3f){return client[_0x829b('0x4')](_0x829b('0x5'),{'body':_[_0x829b('0x6')](_0x26da3f,{'source':_0x26da3f['calleridnum'],'destinationcontext':_0x26da3f[_0x829b('0x7')],'callerid':_0x26da3f[_0x829b('0x8')],'amaflags':_0x829b('0x9')}),'log':_0x829b('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x829b('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x829b('0xa')],'createdAt':{'$between':[moment()['startOf']('day')['format'](_0x829b('0xb')),moment()[_0x829b('0xc')](_0x829b('0xd'))[_0x829b('0xe')](_0x829b('0xb'))]}},'attributes':[_0x829b('0xf'),'disposition',_0x829b('0x10'),_0x829b('0x11')]},'log':_0x829b('0x12')});};};
\ No newline at end of file
index 1e4c6e3..23b02ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae82=['../client','Request','CreateVoiceDialReport'];(function(_0xfbc402,_0x5185fb){var _0x331507=function(_0x49db27){while(--_0x49db27){_0xfbc402['push'](_0xfbc402['shift']());}};_0x331507(++_0x5185fb);}(_0xae82,0x6c));var _0x2ae8=function(_0x1c4945,_0x23232a){_0x1c4945=_0x1c4945-0x0;var _0x430659=_0xae82[_0x1c4945];return _0x430659;};'use strict';var client=require(_0x2ae8('0x0'));exports['create']=function(_0x482978){return client[_0x2ae8('0x1')]('CreateVoiceDialReport',{'body':_0x482978,'log':_0x2ae8('0x2')});};
\ No newline at end of file
+var _0x502b=['Request','CreateVoiceDialReport','../client','create'];(function(_0x522f89,_0x2f9213){var _0x3146b0=function(_0x77a1a){while(--_0x77a1a){_0x522f89['push'](_0x522f89['shift']());}};_0x3146b0(++_0x2f9213);}(_0x502b,0xde));var _0xb502=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0x502b[_0x454018];return _0x24697d;};'use strict';var client=require(_0xb502('0x0'));exports[_0xb502('0x1')]=function(_0x48ba2b){return client[_0xb502('0x2')]('CreateVoiceDialReport',{'body':_0x48ba2b,'log':_0xb502('0x3')});};
\ No newline at end of file
index f355f2a..899deae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c0d=['recordingFormat','getVoiceExtensions','GetVoiceExtension','exten'];(function(_0x1b75cb,_0x1e6e09){var _0x484e47=function(_0x5334e2){while(--_0x5334e2){_0x1b75cb['push'](_0x1b75cb['shift']());}};_0x484e47(++_0x1e6e09);}(_0x3c0d,0xf6));var _0xd3c0=function(_0x1b41dc,_0x16751a){_0x1b41dc=_0x1b41dc-0x0;var _0x5842de=_0x3c0d[_0x1b41dc];return _0x5842de;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0xd3c0('0x0'),{'options':{'raw':!![],'attributes':['id',_0xd3c0('0x1'),_0xd3c0('0x2')],'where':{'VoiceExtensionId':null}},'log':_0xd3c0('0x3')});};};
\ No newline at end of file
+var _0x4483=['getVoiceExtensions','Request','exten','recordingFormat','../client'];(function(_0x530f1d,_0x1d4053){var _0x4aa47a=function(_0x3cbbe1){while(--_0x3cbbe1){_0x530f1d['push'](_0x530f1d['shift']());}};_0x4aa47a(++_0x1d4053);}(_0x4483,0x1a3));var _0x3448=function(_0x34e56b,_0x3ef8a3){_0x34e56b=_0x34e56b-0x0;var _0x49f764=_0x4483[_0x34e56b];return _0x49f764;};'use strict';var client=require(_0x3448('0x0'));exports[_0x3448('0x1')]=function(){return function(){return client[_0x3448('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x3448('0x3'),_0x3448('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x3448('0x1')});};};
\ No newline at end of file
index 8ffca7d..49f7ee4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c6d=['TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','type','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','mandatoryDispositionPause'];(function(_0x33c14b,_0x1a8d18){var _0x19d431=function(_0x20d0c4){while(--_0x20d0c4){_0x33c14b['push'](_0x33c14b['shift']());}};_0x19d431(++_0x1a8d18);}(_0x8c6d,0xab));var _0xd8c6=function(_0x1dc031,_0x1b8a34){_0x1dc031=_0x1dc031-0x0;var _0x171632=_0x8c6d[_0x1dc031];return _0x171632;};'use strict';var client=require(_0xd8c6('0x0'));exports[_0xd8c6('0x1')]=function(){return function(){return client[_0xd8c6('0x2')](_0xd8c6('0x3'),{'options':{'raw':![],'attributes':['id',_0xd8c6('0x4'),_0xd8c6('0x5'),'acwTimeout',_0xd8c6('0x6'),_0xd8c6('0x7'),_0xd8c6('0x8'),'dialActive','dialMethod',_0xd8c6('0x9'),_0xd8c6('0xa'),_0xd8c6('0xb'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0xd8c6('0xc'),_0xd8c6('0xd'),'dialOriginateTimeout',_0xd8c6('0xe'),_0xd8c6('0xf'),_0xd8c6('0x10'),'dialCongestionMaxRetry',_0xd8c6('0x11'),_0xd8c6('0x12'),_0xd8c6('0x13'),_0xd8c6('0x14'),'dialNoAnswerRetryFrequency',_0xd8c6('0x15'),_0xd8c6('0x16'),'dialGlobalInterval',_0xd8c6('0x17'),_0xd8c6('0x18'),_0xd8c6('0x19'),_0xd8c6('0x1a'),_0xd8c6('0x1b'),_0xd8c6('0x1c'),'dialAMDTotalAnalysisTime',_0xd8c6('0x1d'),_0xd8c6('0x1e'),_0xd8c6('0x1f'),_0xd8c6('0x20'),'dialAMDMaximumWordLength',_0xd8c6('0x21'),'dialRecallMeTimeout','dialRecallInQueue',_0xd8c6('0x22'),_0xd8c6('0x23'),'dialAgiAfterHangupClient',_0xd8c6('0x24'),'monitor_format',_0xd8c6('0x25'),_0xd8c6('0x26'),'dialCutDigit',_0xd8c6('0x27'),_0xd8c6('0x28'),_0xd8c6('0x29'),_0xd8c6('0x2a'),'dialAbandonedMaxRetry',_0xd8c6('0x2b'),_0xd8c6('0x2c'),_0xd8c6('0x2d'),'dialAgentRejectMaxRetry',_0xd8c6('0x2e'),'mandatoryDisposition',_0xd8c6('0x2f'),_0xd8c6('0x30')],'include':[{'model':_0xd8c6('0x31'),'as':_0xd8c6('0x31'),'attributes':['id',_0xd8c6('0x4'),_0xd8c6('0x32'),'active']},{'model':_0xd8c6('0x33'),'as':_0xd8c6('0x34'),'attributes':['id',_0xd8c6('0x4')]},{'model':_0xd8c6('0x31'),'as':_0xd8c6('0x35'),'attributes':['id',_0xd8c6('0x4'),'callerid','active']},{'model':_0xd8c6('0x36'),'as':'Interval','attributes':['id',_0xd8c6('0x4')],'include':[{'model':_0xd8c6('0x36'),'as':_0xd8c6('0x37'),'attributes':['id',_0xd8c6('0x4'),'interval']}]}]},'log':_0xd8c6('0x1')});};};
\ No newline at end of file
+var _0xcfed=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xcfed,0x1b2));var _0xdcfe=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xcfed[_0x432682];return _0x463d05;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0xdcfe('0x0')](_0xdcfe('0x1'),{'options':{'raw':![],'attributes':['id',_0xdcfe('0x2'),_0xdcfe('0x3'),_0xdcfe('0x4'),'autopause',_0xdcfe('0x5'),'type',_0xdcfe('0x6'),'dialMethod',_0xdcfe('0x7'),_0xdcfe('0x8'),_0xdcfe('0x9'),_0xdcfe('0xa'),_0xdcfe('0xb'),'dialPredictiveInterval',_0xdcfe('0xc'),_0xdcfe('0xd'),_0xdcfe('0xe'),_0xdcfe('0xf'),_0xdcfe('0x10'),_0xdcfe('0x11'),_0xdcfe('0x12'),_0xdcfe('0x13'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xdcfe('0x14'),_0xdcfe('0x15'),'dialGlobalMaxRetry',_0xdcfe('0x16'),_0xdcfe('0x17'),'dialPrefix','dialCheckDuplicateType',_0xdcfe('0x18'),'dialAMDInitialSilence',_0xdcfe('0x19'),_0xdcfe('0x1a'),_0xdcfe('0x1b'),_0xdcfe('0x1c'),_0xdcfe('0x1d'),'dialAMDMaximumNumberOfWords',_0xdcfe('0x1e'),_0xdcfe('0x1f'),'timeout','dialRecallMeTimeout',_0xdcfe('0x20'),_0xdcfe('0x21'),'dialAgiAfterHangupAgent',_0xdcfe('0x22'),'dialQueueProject2','monitor_format',_0xdcfe('0x23'),'dialRandomLastDigitCallerIdNumber',_0xdcfe('0x24'),_0xdcfe('0x25'),_0xdcfe('0x26'),_0xdcfe('0x27'),_0xdcfe('0x28'),'dialAbandonedMaxRetry',_0xdcfe('0x29'),_0xdcfe('0x2a'),'dialMachineRetryFrequency',_0xdcfe('0x2b'),_0xdcfe('0x2c'),_0xdcfe('0x2d'),_0xdcfe('0x2e'),_0xdcfe('0x2f')],'include':[{'model':_0xdcfe('0x30'),'as':_0xdcfe('0x30'),'attributes':['id',_0xdcfe('0x2'),_0xdcfe('0x31'),_0xdcfe('0x32')]},{'model':_0xdcfe('0x33'),'as':_0xdcfe('0x34'),'attributes':['id',_0xdcfe('0x2')]},{'model':_0xdcfe('0x30'),'as':_0xdcfe('0x35'),'attributes':['id','name','callerid',_0xdcfe('0x32')]},{'model':_0xdcfe('0x36'),'as':_0xdcfe('0x36'),'attributes':['id',_0xdcfe('0x2')],'include':[{'model':_0xdcfe('0x36'),'as':_0xdcfe('0x37'),'attributes':['id',_0xdcfe('0x2'),_0xdcfe('0x38')]}]}]},'log':_0xdcfe('0x39')});};};
\ No newline at end of file
index 499093f..94dcd4f 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(_0x1edb3a,_0x626685){var _0x494950=function(_0x4155ed){while(--_0x4155ed){_0x1edb3a['push'](_0x1edb3a['shift']());}};_0x494950(++_0x626685);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x212758,_0x4aa68d){var _0x10fc41=function(_0x479d79){while(--_0x479d79){_0x212758['push'](_0x212758['shift']());}};_0x10fc41(++_0x4aa68d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
index d1e6db7..68b2d72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7ba=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x356e8d,_0x24c719){var _0x39e65a=function(_0x27ecc2){while(--_0x27ecc2){_0x356e8d['push'](_0x356e8d['shift']());}};_0x39e65a(++_0x24c719);}(_0xa7ba,0x7b));var _0xaa7b=function(_0x40638d,_0x36889c){_0x40638d=_0x40638d-0x0;var _0x1ed9ba=_0xa7ba[_0x40638d];return _0x1ed9ba;};'use strict';var client=require('../client');exports[_0xaa7b('0x0')]=function(_0x5b1b10){return function(){return client[_0xaa7b('0x1')](_0xaa7b('0x2'),{'options':{'where':{'VoiceQueueId':_0x5b1b10,'paused':!![]},'raw':!![]},'log':_0xaa7b('0x0')});};};
\ No newline at end of file
+var _0x9ccb=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x9ccb,0x145));var _0xb9cc=function(_0x19b981,_0x50edd4){_0x19b981=_0x19b981-0x0;var _0x1cd2d3=_0x9ccb[_0x19b981];return _0x1cd2d3;};'use strict';var client=require(_0xb9cc('0x0'));exports[_0xb9cc('0x1')]=function(_0x156c67){return function(){return client[_0xb9cc('0x2')](_0xb9cc('0x3'),{'options':{'where':{'VoiceQueueId':_0x156c67,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index 4463858..a391a2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x560668,_0x1e4a80){var _0x2e7c8d=function(_0x44c070){while(--_0x44c070){_0x560668['push'](_0x560668['shift']());}};_0x2e7c8d(++_0x1e4a80);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x25cc9b,_0x22a370){var _0x31e4ef=function(_0x2bae65){while(--_0x2bae65){_0x25cc9b['push'](_0x25cc9b['shift']());}};_0x31e4ef(++_0x22a370);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
index 3efcf51..2645ef8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde14=['blind','CreateVoiceTransferReport','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','transfererchannel','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension'];(function(_0x147af5,_0x520b7c){var _0x32ebb9=function(_0x28cf49){while(--_0x28cf49){_0x147af5['push'](_0x147af5['shift']());}};_0x32ebb9(++_0x520b7c);}(_0xde14,0x97));var _0x4de1=function(_0x5c394f,_0x416067){_0x5c394f=_0x5c394f-0x0;var _0x4c7dcd=_0xde14[_0x5c394f];return _0x4c7dcd;};'use strict';var client=require(_0x4de1('0x0'));exports[_0x4de1('0x1')]={};exports[_0x4de1('0x2')]=function(_0x1f727e){return client[_0x4de1('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x1f727e['result'],'transfererchannel':_0x1f727e[_0x4de1('0x4')],'transferercalleridnum':_0x1f727e['transferercalleridnum'],'transferercalleridname':_0x1f727e[_0x4de1('0x5')],'transfererconnectedlinenum':_0x1f727e[_0x4de1('0x6')],'transfererconnectedlinename':_0x1f727e['transfererconnectedlinename'],'transfereraccountcode':_0x1f727e['transfereraccountcode'],'transferercontext':_0x1f727e[_0x4de1('0x7')],'transfererexten':_0x1f727e[_0x4de1('0x8')],'transfererlinkedid':_0x1f727e[_0x4de1('0x9')],'transfereechannel':_0x1f727e[_0x4de1('0xa')],'transfereecalleridnum':_0x1f727e[_0x4de1('0xb')],'transfereecalleridname':_0x1f727e[_0x4de1('0xc')],'transfereeconnectedlinenum':_0x1f727e[_0x4de1('0xd')],'transfereeconnectedlinename':_0x1f727e[_0x4de1('0xe')],'transfereeaccountcode':_0x1f727e[_0x4de1('0xf')],'transfereecontext':_0x1f727e[_0x4de1('0x10')],'transfereeexten':_0x1f727e['transfereeexten'],'transfereelinkedid':_0x1f727e[_0x4de1('0x11')],'isexternal':_0x1f727e[_0x4de1('0x12')],'context':_0x1f727e[_0x4de1('0x13')],'extension':_0x1f727e[_0x4de1('0x14')],'type':_0x4de1('0x15')},'log':_0x4de1('0x16')});};exports[_0x4de1('0x17')]=function(_0x171ddf){return client[_0x4de1('0x3')](_0x4de1('0x16'),{'body':{'result':_0x171ddf['result'],'transfererchannel':_0x171ddf['origtransfererchannel'],'transferercalleridnum':_0x171ddf[_0x4de1('0x18')],'transferercalleridname':_0x171ddf[_0x4de1('0x19')],'transfererconnectedlinenum':_0x171ddf[_0x4de1('0x1a')],'transfererconnectedlinename':_0x171ddf[_0x4de1('0x1b')],'transfereraccountcode':_0x171ddf[_0x4de1('0x1c')],'transferercontext':_0x171ddf[_0x4de1('0x1d')],'transfererexten':_0x171ddf[_0x4de1('0x1e')],'transfererlinkedid':_0x171ddf[_0x4de1('0x1f')],'transfereechannel':_0x171ddf['transfertargetchannel'],'transfereecalleridnum':_0x171ddf[_0x4de1('0x20')],'transfereecalleridname':_0x171ddf[_0x4de1('0x21')],'transfereeconnectedlinenum':_0x171ddf[_0x4de1('0x22')],'transfereeconnectedlinename':_0x171ddf[_0x4de1('0x23')],'transfereeaccountcode':_0x171ddf[_0x4de1('0x24')],'transfereecontext':_0x171ddf[_0x4de1('0x25')],'transfereeexten':_0x171ddf[_0x4de1('0x26')],'transfereelinkedid':_0x171ddf[_0x4de1('0x27')],'isexternal':_0x171ddf[_0x4de1('0x12')],'context':_0x171ddf[_0x4de1('0x28')],'extension':_0x171ddf[_0x4de1('0x29')],'type':_0x4de1('0x2a')},'log':_0x4de1('0x16')});};
\ No newline at end of file
+var _0x3ad3=['origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererlinkedid','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten'];(function(_0x1f2043,_0x21b709){var _0x2dc8b0=function(_0x258f39){while(--_0x258f39){_0x1f2043['push'](_0x1f2043['shift']());}};_0x2dc8b0(++_0x21b709);}(_0x3ad3,0xb2));var _0x33ad=function(_0x30dc31,_0x3bba03){_0x30dc31=_0x30dc31-0x0;var _0x54ad0e=_0x3ad3[_0x30dc31];return _0x54ad0e;};'use strict';var client=require(_0x33ad('0x0'));exports['transfers']={};exports[_0x33ad('0x1')]=function(_0x1a4085){return client['Request'](_0x33ad('0x2'),{'body':{'result':_0x1a4085[_0x33ad('0x3')],'transfererchannel':_0x1a4085[_0x33ad('0x4')],'transferercalleridnum':_0x1a4085[_0x33ad('0x5')],'transferercalleridname':_0x1a4085[_0x33ad('0x6')],'transfererconnectedlinenum':_0x1a4085[_0x33ad('0x7')],'transfererconnectedlinename':_0x1a4085[_0x33ad('0x8')],'transfereraccountcode':_0x1a4085['transfereraccountcode'],'transferercontext':_0x1a4085[_0x33ad('0x9')],'transfererexten':_0x1a4085['transfererexten'],'transfererlinkedid':_0x1a4085[_0x33ad('0xa')],'transfereechannel':_0x1a4085['transfereechannel'],'transfereecalleridnum':_0x1a4085['transfereecalleridnum'],'transfereecalleridname':_0x1a4085[_0x33ad('0xb')],'transfereeconnectedlinenum':_0x1a4085[_0x33ad('0xc')],'transfereeconnectedlinename':_0x1a4085[_0x33ad('0xd')],'transfereeaccountcode':_0x1a4085[_0x33ad('0xe')],'transfereecontext':_0x1a4085[_0x33ad('0xf')],'transfereeexten':_0x1a4085[_0x33ad('0x10')],'transfereelinkedid':_0x1a4085[_0x33ad('0x11')],'isexternal':_0x1a4085[_0x33ad('0x12')],'context':_0x1a4085[_0x33ad('0x13')],'extension':_0x1a4085[_0x33ad('0x14')],'type':_0x33ad('0x15')},'log':'CreateVoiceTransferReport'});};exports[_0x33ad('0x16')]=function(_0x4cee72){return client[_0x33ad('0x17')](_0x33ad('0x2'),{'body':{'result':_0x4cee72[_0x33ad('0x3')],'transfererchannel':_0x4cee72[_0x33ad('0x18')],'transferercalleridnum':_0x4cee72[_0x33ad('0x19')],'transferercalleridname':_0x4cee72[_0x33ad('0x1a')],'transfererconnectedlinenum':_0x4cee72[_0x33ad('0x1b')],'transfererconnectedlinename':_0x4cee72[_0x33ad('0x1c')],'transfereraccountcode':_0x4cee72[_0x33ad('0x1d')],'transferercontext':_0x4cee72[_0x33ad('0x1e')],'transfererexten':_0x4cee72[_0x33ad('0x1f')],'transfererlinkedid':_0x4cee72[_0x33ad('0x20')],'transfereechannel':_0x4cee72[_0x33ad('0x21')],'transfereecalleridnum':_0x4cee72[_0x33ad('0x22')],'transfereecalleridname':_0x4cee72[_0x33ad('0x23')],'transfereeconnectedlinenum':_0x4cee72[_0x33ad('0x24')],'transfereeconnectedlinename':_0x4cee72['transfertargetconnectedlinename'],'transfereeaccountcode':_0x4cee72['transfertargetaccountcode'],'transfereecontext':_0x4cee72[_0x33ad('0x25')],'transfereeexten':_0x4cee72[_0x33ad('0x26')],'transfereelinkedid':_0x4cee72[_0x33ad('0x27')],'isexternal':_0x4cee72[_0x33ad('0x12')],'context':_0x4cee72[_0x33ad('0x28')],'extension':_0x4cee72[_0x33ad('0x29')],'type':'attended'},'log':_0x33ad('0x2')});};
\ No newline at end of file
index 26e242f..503173f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8506=['loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','length','find','omit','undefined','channels','voicechannel','map','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','push','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','values','queueChannels','voicequeuechannel','Hangup','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','validate','moment','../properties','../ami','listen','format','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','module','action','Reload','Action','then','message','catch','ami\x20disconnected','command','Command','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','unmanaged','abandoned'];(function(_0x4eb150,_0x982e59){var _0x7aaf25=function(_0x124e06){while(--_0x124e06){_0x4eb150['push'](_0x4eb150['shift']());}};_0x7aaf25(++_0x982e59);}(_0x8506,0xe8));var _0x6850=function(_0x4e82e7,_0x1cd0f9){_0x4e82e7=_0x4e82e7-0x0;var _0x4c1216=_0x8506[_0x4e82e7];return _0x4c1216;};'use strict';var _=require('lodash');var util=require(_0x6850('0x0'));var jayson=require('jayson/promise');var schema=require(_0x6850('0x1'));var BPromise=require('bluebird');var moment=require(_0x6850('0x2'));var config=require('../../../config/environment');var properties=require(_0x6850('0x3'));var ami=require(_0x6850('0x4'));exports[_0x6850('0x5')]=function(_0x5e9ff2,_0x13731e,_0x372f0b){return new BPromise(function(_0x232459,_0x3c301f){var _0x5858ca={'QueuePause':function(_0x51c0ad){return new Promise(function(_0x5466ee,_0x117706){var _0x1db15d=util[_0x6850('0x6')]('%s/%s','SIP',_0x51c0ad[_0x6850('0x7')]);if(_0x5e9ff2[_0x6850('0x8')]&&_0x5e9ff2[_0x6850('0x8')][_0x1db15d]&&_0x5e9ff2[_0x6850('0x8')][_0x1db15d][_0x6850('0x9')]){_0x5e9ff2['timers'][_0x1db15d][_0x6850('0xa')]();}if(_0x5e9ff2[_0x6850('0xb')][_0x1db15d]){_0x5e9ff2[_0x6850('0xb')][_0x1db15d][_0x6850('0xc')]({'statePause':_0x51c0ad[_0x6850('0xd')]?!![]:![]});}_0x5466ee({'code':0xc8,'message':_0x6850('0xe')});});},'Reload':function(_0x4e63c4){var _0x44d3da=this;return new Promise(function(_0x3373c1,_0x3b4dc5){if(ami[_0x6850('0xf')]()==![]){return _0x3b4dc5(_0x44d3da[_0x6850('0x10')](0x1f4,[config[_0x6850('0x11')]['ip'],config['asterisk'][_0x6850('0x12')],'ami\x20disconnected'][_0x6850('0x13')]('\x20')));}_0x4e63c4=_[_0x6850('0x14')](_0x4e63c4,_[_0x6850('0x15')](properties[_0x6850('0x16')]));_0x4e63c4[_0x6850('0x17')]=_0x6850('0x18');return ami[_0x6850('0x19')](_0x4e63c4)[_0x6850('0x1a')](function(_0x426c0a){_0x3373c1({'code':0xc8,'message':_0x426c0a[_0x6850('0x1b')]});})[_0x6850('0x1c')](function(_0x145dbb){_0x3b4dc5(_0x44d3da[_0x6850('0x10')](0x1f5,_0x145dbb[_0x6850('0x1b')]));});});},'Command':function(_0x521874){var _0x4885f6=this;return new Promise(function(_0x76764b,_0x18b994){if(ami[_0x6850('0xf')]()==![]){return _0x18b994(_0x4885f6[_0x6850('0x10')](0x1f4,[config[_0x6850('0x11')]['ip'],config[_0x6850('0x11')]['username'],_0x6850('0x1d')][_0x6850('0x13')]('\x20')));}_0x521874=_[_0x6850('0x14')](_0x521874,_0x6850('0x1e'));_0x521874[_0x6850('0x17')]=_0x6850('0x1f');return ami[_0x6850('0x19')](_0x521874)[_0x6850('0x1a')](function(_0x34c5f6){_0x76764b({'code':0xc8,'message':_0x34c5f6[_0x6850('0x20')]});})[_0x6850('0x1c')](function(_0x15ab81){_0x18b994(_0x4885f6[_0x6850('0x10')](0x1f5,_0x15ab81[_0x6850('0x1b')]));});});},'VoiceQueues':function(_0x46a82d){return new Promise(function(_0xeef1ff,_0x574bdd){var _0xaa3dba=[];for(var _0x5734ea in _0x5e9ff2['voiceQueues']){if(_0x5e9ff2[_0x6850('0x21')][_0x6850('0x22')](_0x5734ea)){var _0x423799=_0x5e9ff2[_0x6850('0x21')][_0x5734ea];var _0x5bf392={'id':_0x423799['id'],'name':_0x423799[_0x6850('0x7')],'strategy':_0x423799[_0x6850('0x23')],'answered':_0x423799['answered'],'available':_0x423799[_0x6850('0x24')],'loggedIn':_0x423799[_0x6850('0x25')],'pTalking':_0x423799[_0x6850('0x26')],'sumBillable':_0x423799[_0x6850('0x27')],'sumDuration':_0x423799['sumDuration'],'sumHoldTime':_0x423799[_0x6850('0x28')]||0x0,'talking':_0x423799[_0x6850('0x29')],'total':_0x423799['total'],'type':_0x423799['type'],'unmanaged':_0x423799[_0x6850('0x2a')],'abandoned':_0x423799[_0x6850('0x2b')],'waiting':_0x423799['waiting'],'loggedInDb':_0x423799[_0x6850('0x2c')]};if(_0x423799[_0x6850('0x2d')]===_0x6850('0x2e')){_0x5bf392[_0x6850('0x2f')]=_0x423799[_0x6850('0x2f')];_0x5bf392[_0x6850('0x30')]=_0x423799[_0x6850('0x30')];_0x5bf392[_0x6850('0x31')]=_0x423799['dialOriginateCallerIdName'];_0x5bf392['dialOriginateCallerIdNumber']=_0x423799[_0x6850('0x32')];_0x5bf392[_0x6850('0x33')]=_0x423799[_0x6850('0x33')];_0x5bf392[_0x6850('0x34')]=_0x423799[_0x6850('0x34')];_0x5bf392[_0x6850('0x35')]=_0x423799[_0x6850('0x35')];_0x5bf392['outboundAnswerAgiCallsDay']=_0x423799[_0x6850('0x36')];_0x5bf392[_0x6850('0x37')]=_0x423799[_0x6850('0x37')];_0x5bf392[_0x6850('0x38')]=_0x423799[_0x6850('0x38')];_0x5bf392[_0x6850('0x39')]=_0x423799[_0x6850('0x39')];_0x5bf392[_0x6850('0x3a')]=_0x423799['outboundCongestionCallsDay'];_0x5bf392[_0x6850('0x3b')]=_0x423799[_0x6850('0x3b')];_0x5bf392[_0x6850('0x3c')]=_0x423799['outboundDropCallsDayCallersExit'];_0x5bf392[_0x6850('0x3d')]=_0x423799['outboundDropCallsDayTimeout'];_0x5bf392[_0x6850('0x3e')]=_0x423799[_0x6850('0x3e')];_0x5bf392['outboundNoSuchCallsDay']=_0x423799[_0x6850('0x3f')];_0x5bf392[_0x6850('0x40')]=_0x423799[_0x6850('0x40')];_0x5bf392['outboundReCallsDay']=_0x423799['outboundReCallsDay'];_0x5bf392[_0x6850('0x41')]=_0x423799[_0x6850('0x41')];_0x5bf392[_0x6850('0x42')]=_0x423799['outboundUnknownCallsDay'];_0x5bf392[_0x6850('0x43')]=_0x423799['predictiveIntervalAnsweredCalls'];_0x5bf392[_0x6850('0x44')]=_0x423799['predictiveIntervalAvgHoldtime'];_0x5bf392[_0x6850('0x45')]=_0x423799[_0x6850('0x45')];_0x5bf392[_0x6850('0x46')]=_0x423799[_0x6850('0x46')];_0x5bf392[_0x6850('0x47')]=_0x423799['predictiveIntervalDroppedCallsTimeout'];_0x5bf392[_0x6850('0x48')]=_0x423799[_0x6850('0x48')];_0x5bf392['predictiveIntervalErlangCallsDroppedCalls']=_0x423799['predictiveIntervalErlangCallsDroppedCalls'];_0x5bf392['predictiveIntervalHitRate']=_0x423799['predictiveIntervalHitRate'];_0x5bf392[_0x6850('0x49')]=_0x423799['predictiveIntervalMultiplicativeFactor'];_0x5bf392[_0x6850('0x4a')]=_0x423799['predictiveIntervalPauses'];_0x5bf392[_0x6850('0x4b')]=_0x423799[_0x6850('0x4b')];_0x5bf392[_0x6850('0x4c')]=_0x423799['predictiveIntervalTotalCalls'];_0x5bf392['message']=_0x423799['message'];_0x5bf392[_0x6850('0x4d')]=_0x423799[_0x6850('0x4d')];_0x5bf392[_0x6850('0x4e')]=_0x423799[_0x6850('0x4e')];_0x5bf392[_0x6850('0x4f')]=_0x423799[_0x6850('0x4f')];_0x5bf392[_0x6850('0x50')]=_0x423799[_0x6850('0x50')];_0x5bf392['erlangBusyFactor']=_0x423799[_0x6850('0x51')];_0x5bf392[_0x6850('0x52')]=_0x423799[_0x6850('0x52')];_0x5bf392[_0x6850('0x53')]=_0x423799[_0x6850('0x53')];}if(_0x423799[_0x6850('0x54')]){_0x5bf392[_0x6850('0x54')]={'id':_0x423799[_0x6850('0x54')]['id'],'name':_0x423799[_0x6850('0x54')]['name'],'active':_0x423799[_0x6850('0x54')]['active'],'callerid':_0x423799[_0x6850('0x54')][_0x6850('0x55')]};}if(_0x423799[_0x6850('0x56')]){_0x5bf392[_0x6850('0x56')]={'id':_0x423799[_0x6850('0x56')]['id'],'name':_0x423799[_0x6850('0x56')][_0x6850('0x7')]};}_0xaa3dba['push'](_0x5bf392);}}_0xeef1ff({'count':_0xaa3dba[_0x6850('0x57')],'rows':_0xaa3dba});});},'UpdateVoiceQueue':function(_0x470a1d){return new Promise(function(_0x41641b,_0x5b22d5){var _0xc45293=_[_0x6850('0x58')](_0x5e9ff2['voiceQueues'],{'id':parseInt(_0x470a1d['id'])});var _0x558530=_[_0x6850('0x59')](_0x470a1d,['id']);if(_0xc45293){for(var _0x2c6bf7 in _0x558530){if(typeof _0x558530[_0x2c6bf7]!==_0x6850('0x5a')&&typeof _0xc45293[_0x2c6bf7]!==_0x6850('0x5a')){_0xc45293[_0x2c6bf7]=_0x558530[_0x2c6bf7];}}_0x41641b(_0xc45293);}else{_0x5b22d5();}});},'VoiceChannels':function(_0x50b33a){return new Promise(function(_0x352c91,_0x19b4aa){var _0x30d44b=_['values'](_0x5e9ff2[_0x6850('0x5b')]);_0x352c91({'count':_0x30d44b[_0x6850('0x57')],'rows':_0x30d44b});});},'VoiceChannelMixMonitor':function(_0x41230d){var _0x40d650=this;return new Promise(function(_0x5117dd,_0x42b794){if(ami[_0x6850('0xf')]()==![]){return _0x42b794(_0x40d650['error'](0x1f4,[config['asterisk']['ip'],config[_0x6850('0x11')]['username'],_0x6850('0x1d')]['join']('\x20')));}var _0x2274d6=schema(properties[_0x6850('0x5c')])[_0x6850('0x1')](_0x41230d);if(_0x2274d6[_0x6850('0x57')]>0x0){return _0x42b794(_0x40d650['error'](0x1f4,_[_0x6850('0x5d')](_0x2274d6,_0x6850('0x1b'))[_0x6850('0x13')](',\x20')));}var _0xed27df=_[_0x6850('0x58')](_0x5e9ff2[_0x6850('0x5b')],{'uniqueid':_0x41230d[_0x6850('0x5e')]});if(_0xed27df&&_0xed27df['channel']){var _0x402698=util[_0x6850('0x6')](_0x6850('0x5f'),_0x41230d[_0x6850('0x60')]||_0x41230d['uniqueid'],_0x41230d[_0x6850('0x6')]||_0x6850('0x61'));return ami[_0x6850('0x19')]({'action':_0x6850('0x62'),'channel':_0xed27df[_0x6850('0x63')],'file':_0x402698,'options':_0x6850('0x64')})['then'](function(_0x400942){var _0x1f87f9=_[_0x6850('0x58')](_0xed27df[_0x6850('0x65')],{'filename':_0x6850('0x66')+_0x402698[_0x6850('0x67')]()});if(_['isNil'](_0x1f87f9)){_0xed27df[_0x6850('0x65')][_0x6850('0x68')]({'filename':'/var/spool/asterisk/monitor/'+_0x402698[_0x6850('0x67')](),'createdAt':moment()[_0x6850('0x6')](_0x6850('0x69')),'mixmonitorid':_0x400942['mixmonitorid'],'status':_0x6850('0x6a')});}else{_0x1f87f9[_0x6850('0x6b')]=_0x400942[_0x6850('0x6b')];_0x1f87f9[_0x6850('0x6c')]=_0x6850('0x6a');}_0x5117dd({'code':0xc8,'message':[_0x41230d[_0x6850('0x5e')],_0x6850('0x6d'),_0x400942['mixmonitorid']]['join']('\x20'),'mixmonitorid':_0x400942[_0x6850('0x6b')]});})['catch'](function(_0x257467){_0x42b794(_0x40d650['error'](0x1f5,[_0x41230d['uniqueid'],_0x257467[_0x6850('0x1b')][_0x6850('0x67')]()][_0x6850('0x13')]('\x20')));});}else{return _0x42b794(_0x40d650[_0x6850('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x5dc181){var _0x26427b=this;return new Promise(function(_0x155b89,_0x311118){if(ami[_0x6850('0xf')]()==![]){return _0x311118(_0x26427b[_0x6850('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x6850('0x11')][_0x6850('0x12')],_0x6850('0x1d')][_0x6850('0x13')]('\x20')));}var _0x1366ed=schema(properties[_0x6850('0x5c')])[_0x6850('0x1')](_0x5dc181);if(_0x1366ed['length']>0x0){return _0x311118(_0x26427b[_0x6850('0x10')](0x1f4,_[_0x6850('0x5d')](_0x1366ed,_0x6850('0x1b'))['join'](',\x20')));}var _0x52ce5b=_['find'](_0x5e9ff2[_0x6850('0x5b')],{'uniqueid':_0x5dc181[_0x6850('0x5e')]});if(_0x52ce5b){return BPromise[_0x6850('0x6e')]()[_0x6850('0x1a')](function(){if(_0x52ce5b['channel']){return ami['Action']({'action':_0x6850('0x6f'),'channel':_0x52ce5b[_0x6850('0x63')],'mixmonitorid':_0x5dc181[_0x6850('0x6b')]})[_0x6850('0x1c')](function(_0x9aadf){});}})[_0x6850('0x1a')](function(){if(_0x52ce5b[_0x6850('0x70')]){return ami[_0x6850('0x19')]({'action':_0x6850('0x6f'),'channel':_0x52ce5b[_0x6850('0x70')],'mixmonitorid':_0x5dc181[_0x6850('0x6b')]})[_0x6850('0x1c')](function(_0x20a044){});}})['then'](function(_0x2194b5){var _0x32de15=_[_0x6850('0x58')](_0x52ce5b[_0x6850('0x65')],{'mixmonitorid':_0x5dc181[_0x6850('0x6b')]});if(_0x32de15){_0x32de15[_0x6850('0x6c')]=_0x6850('0x71');}})[_0x6850('0x1a')](function(){var _0x5930df=util[_0x6850('0x6')]('%s.%s',_0x5dc181[_0x6850('0x60')]||_0x5dc181['uniqueid'],_0x5dc181[_0x6850('0x6')]||_0x6850('0x61'));var _0x4acd58=_[_0x6850('0x58')](_0x52ce5b[_0x6850('0x65')],{'filename':_0x6850('0x66')+_0x5930df[_0x6850('0x67')]()});if(_0x4acd58){_0x4acd58['status']=_0x6850('0x71');}})[_0x6850('0x1a')](function(){_0x155b89({'code':0xc8,'message':[_0x5dc181['uniqueid'],_0x6850('0x72')][_0x6850('0x13')]('\x20')});})[_0x6850('0x1c')](function(_0x359cb7){_0x311118(_0x26427b['error'](0x1f5,[_0x5dc181[_0x6850('0x5e')],_0x359cb7[_0x6850('0x1b')][_0x6850('0x67')]()]['join']('\x20')));});}else{return _0x311118(_0x26427b[_0x6850('0x10')](0x1f5,_0x6850('0x73')));}});},'VoiceQueuesChannels':function(_0x142287){return new Promise(function(_0x51da3e,_0x5cf928){var _0x1ad2ac=_[_0x6850('0x74')](_0x5e9ff2[_0x6850('0x75')]);_0x51da3e({'count':_0x1ad2ac['length'],'rows':_0x1ad2ac});});},'VoiceQueuesChannel':function(_0x4d4898){var _0x424533=this;return new Promise(function(_0x3d5841,_0x400e86){var _0x268a9d=schema(properties[_0x6850('0x76')])['validate'](_0x4d4898);if(_0x268a9d[_0x6850('0x57')]>0x0){return _0x400e86(_0x424533['error'](0x1f4,_[_0x6850('0x5d')](_0x268a9d,_0x6850('0x1b'))[_0x6850('0x13')](',\x20')));}var _0x1a9b7c=_['find'](_0x5e9ff2[_0x6850('0x75')],{'uniqueid':_0x4d4898[_0x6850('0x5e')]});if(_0x1a9b7c){_0x3d5841(_0x1a9b7c);}else{return _0x400e86(_0x424533[_0x6850('0x10')](0x1f5,_0x6850('0x73')));}});},'VoiceQueuesChannelHangup':function(_0x579d70){var _0x1c7895=this;return new Promise(function(_0xb746d5,_0x352d12){if(ami[_0x6850('0xf')]()==![]){return _0x352d12(_0x1c7895['error'](0x1f4,[config[_0x6850('0x11')]['ip'],config[_0x6850('0x11')][_0x6850('0x12')],_0x6850('0x1d')][_0x6850('0x13')]('\x20')));}var _0x1e62c8=schema(properties['voicequeuechannelhangup'])[_0x6850('0x1')](_0x579d70);if(_0x1e62c8['length']>0x0){return _0x352d12(_0x1c7895[_0x6850('0x10')](0x1f4,_['map'](_0x1e62c8,'message')['join'](',\x20')));}var _0x15e872=_[_0x6850('0x58')](_0x5e9ff2[_0x6850('0x75')],{'uniqueid':_0x579d70[_0x6850('0x5e')]});if(_0x15e872&&_0x15e872['channel']){return ami['Action']({'action':_0x6850('0x77'),'channel':_0x15e872[_0x6850('0x63')]})[_0x6850('0x1a')](function(_0x42f262){_0xb746d5({'code':0xc8,'message':[_0x579d70[_0x6850('0x5e')],_0x42f262[_0x6850('0x1b')][_0x6850('0x67')]()][_0x6850('0x13')]('\x20')});})[_0x6850('0x1c')](function(_0x3deaad){_0x352d12(_0x1c7895[_0x6850('0x10')](0x1f5,[_0x579d70[_0x6850('0x5e')],_0x3deaad[_0x6850('0x1b')][_0x6850('0x67')]()]['join']('\x20')));});}else{return _0x352d12(_0x1c7895[_0x6850('0x10')](0x1f5,_0x6850('0x73')));}});},'VoiceQueuesChannelRedirect':function(_0x5d3874){var _0x1f30a6=this;return new Promise(function(_0x43158a,_0x5bd7e9){if(ami['isConnected']()==![]){return _0x5bd7e9(_0x1f30a6[_0x6850('0x10')](0x1f4,[config[_0x6850('0x11')]['ip'],config[_0x6850('0x11')]['username'],_0x6850('0x1d')]['join']('\x20')));}var _0xc9ef84=schema(properties['voicequeuechannelredirect'])['validate'](_0x5d3874);if(_0xc9ef84[_0x6850('0x57')]>0x0){return _0x5bd7e9(_0x1f30a6[_0x6850('0x10')](0x1f4,_[_0x6850('0x5d')](_0xc9ef84,_0x6850('0x1b'))['join'](',\x20')));}var _0xc1d534=_[_0x6850('0x58')](_0x5e9ff2[_0x6850('0x75')],{'uniqueid':_0x5d3874['uniqueid']});if(_0xc1d534&&_0xc1d534[_0x6850('0x63')]){return ami['Action']({'action':'Redirect','channel':_0xc1d534[_0x6850('0x63')],'exten':_0x5d3874[_0x6850('0x78')],'context':_0x5d3874[_0x6850('0x79')]||_0xc1d534[_0x6850('0x79')],'priority':0x1})[_0x6850('0x1a')](function(_0x2bc8f7){_0x43158a({'code':0xc8,'message':[_0x5d3874[_0x6850('0x5e')],_0x2bc8f7[_0x6850('0x1b')][_0x6850('0x67')]()][_0x6850('0x13')]('\x20')});})['catch'](function(_0x2f1b80){_0x5bd7e9(_0x1f30a6[_0x6850('0x10')](0x1f5,[_0x5d3874[_0x6850('0x5e')],_0x2f1b80[_0x6850('0x1b')][_0x6850('0x67')]()][_0x6850('0x13')]('\x20')));});}else{return _0x5bd7e9(_0x1f30a6[_0x6850('0x10')](0x1f5,_0x6850('0x73')));}});},'Agents':function(_0x448088){return new Promise(function(_0x1374c0,_0x349fa9){var _0xb0adac=_[_0x6850('0x74')](_0x5e9ff2[_0x6850('0xb')]);_0x1374c0({'count':_0xb0adac[_0x6850('0x57')],'rows':_0xb0adac});});},'Telephones':function(_0x16193d){return new Promise(function(_0x1faf64,_0x3ded62){var _0x350497=_[_0x6850('0x74')](_0x5e9ff2[_0x6850('0x7a')]);_0x1faf64({'count':_0x350497[_0x6850('0x57')],'rows':_0x350497});});},'Trunks':function(_0x30db5d){return new Promise(function(_0x3f871b,_0xa5272d){var _0x555875=_[_0x6850('0x74')](_0x5e9ff2[_0x6850('0x7b')]);_0x3f871b({'count':_0x555875[_0x6850('0x57')],'rows':_0x555875});});},'OutboundChannels':function(_0x10c8b2){return new Promise(function(_0x264a95,_0x5a7c2f){var _0x48f67c=_[_0x6850('0x74')](_0x5e9ff2[_0x6850('0x7c')]);_0x264a95({'count':_0x48f67c[_0x6850('0x57')],'rows':_0x48f67c});});},'Outbound':function(_0x2956a1){return new Promise(function(_0x354ebd,_0x4653a8){_0x354ebd(_0x5e9ff2[_0x6850('0x2e')]);});},'Campaigns':function(_0x4b8a7c){return new Promise(function(_0x23fb03,_0x57367a){var _0x5dec9d=_['values'](_0x5e9ff2[_0x6850('0x7d')]);_0x23fb03({'count':_0x5dec9d[_0x6850('0x57')],'rows':_0x5dec9d});});},'VoiceQueuesPreview':function(_0x49b884){var _0x3446f5=this;return new Promise(function(_0x166c1a,_0x1fa6c5){_0x13731e[_0x6850('0x7e')](_0x49b884['id'])['then'](function(_0x26ac86){_0x166c1a({'code':0xc8,'message':_0x26ac86[_0x6850('0x1b')]});})[_0x6850('0x1c')](function(_0x3c58fc){_0x1fa6c5(_0x3446f5['error'](0x1f4,_0x3c58fc[_0x6850('0x1b')]));});});},'EventManager':function(_0x105f85){var _0x1114dc=this;return new Promise(function(_0x32c462,_0x2a08d2){if(!_0x105f85[_0x6850('0x7f')]){return _0x2a08d2(_0x1114dc[_0x6850('0x10')](0x1f4,_0x6850('0x80')));}ami[_0x6850('0x81')]('custom:'+_0x105f85[_0x6850('0x7f')],_0x105f85[_0x6850('0x1b')]);_0x32c462({'code':0xc8,'message':_0x105f85});});},'FaxAccounts':function(_0x1527b8){return new Promise(function(_0x318364,_0xda652e){var _0x4f6f4e=_[_0x6850('0x74')](_0x5e9ff2[_0x6850('0x82')]);_0x318364({'count':_0x4f6f4e['length'],'rows':_0x4f6f4e});});},'SendFax':function(_0x2a118e){var _0x18b112=this;return new Promise(function(_0xd23614,_0x4d9942){_0x372f0b[_0x6850('0x83')](_0x2a118e)[_0x6850('0x1a')](function(_0x545188){_0xd23614({'code':0xc8,'message':_0x545188['message']});})[_0x6850('0x1c')](function(_0x4b9713){_0x4d9942(_0x18b112[_0x6850('0x10')](0x1f4,_0x4b9713[_0x6850('0x1b')]));});});},'CheckAfterSend':function(_0x376cf5){var _0x5124ce=this;return new Promise(function(_0x439a59,_0x434f89){_0x372f0b['checkAfterSend'](_0x376cf5)[_0x6850('0x1a')](function(_0x3c6f85){_0x439a59({'code':0xc8,'message':_0x3c6f85['message']});})[_0x6850('0x1c')](function(_0x3e52ab){_0x434f89(_0x5124ce['error'](0x1f4,_0x3e52ab[_0x6850('0x1b')]));});});}};var _0x2b6a56=jayson[_0x6850('0x84')](_0x5858ca)[_0x6850('0x85')]();_0x2b6a56['on'](_0x6850('0x10'),function(_0x2d8738){return _0x3c301f(_0x2d8738);});_0x2b6a56['listen'](0x232a,_0x6850('0x86'),function(){console[_0x6850('0x87')](_0x6850('0x88'),0x232a);return _0x232459(_0x6850('0x89')+0x232a);});});};
\ No newline at end of file
+var _0x36c3=['checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','pick','module','Reload','then','message','command','action','Command','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','sumHoldTime','talking','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','join','channel','%s.%s','uniqueid','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','catch','Channel\x20doesn\x27t\x20exist','map','resolve','Action','StopMixMonitor','destinationchannel','status','stop','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','faxAccounts','send'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x36c3,0x1a6));var _0x336c=function(_0x4e7c2,_0x3b3347){_0x4e7c2=_0x4e7c2-0x0;var _0x84bb35=_0x36c3[_0x4e7c2];return _0x84bb35;};'use strict';var _=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var jayson=require('jayson/promise');var schema=require(_0x336c('0x2'));var BPromise=require(_0x336c('0x3'));var moment=require(_0x336c('0x4'));var config=require(_0x336c('0x5'));var properties=require(_0x336c('0x6'));var ami=require(_0x336c('0x7'));exports[_0x336c('0x8')]=function(_0x4e4c07,_0x3b27e0,_0x2e0016){return new BPromise(function(_0x2097a8,_0x29a202){var _0x295b22={'QueuePause':function(_0x4d1e4f){return new Promise(function(_0x108bb0,_0x1e6f42){var _0x3b4f93=util[_0x336c('0x9')](_0x336c('0xa'),_0x336c('0xb'),_0x4d1e4f[_0x336c('0xc')]);if(_0x4e4c07[_0x336c('0xd')]&&_0x4e4c07[_0x336c('0xd')][_0x3b4f93]&&_0x4e4c07[_0x336c('0xd')][_0x3b4f93][_0x336c('0xe')]){_0x4e4c07[_0x336c('0xd')][_0x3b4f93][_0x336c('0xf')]();}if(_0x4e4c07[_0x336c('0x10')][_0x3b4f93]){_0x4e4c07[_0x336c('0x10')][_0x3b4f93][_0x336c('0x11')]({'statePause':_0x4d1e4f[_0x336c('0x12')]?!![]:![]});}_0x108bb0({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x592a5b){var _0x1c3961=this;return new Promise(function(_0x577bd6,_0x10dba2){if(ami[_0x336c('0x13')]()==![]){return _0x10dba2(_0x1c3961[_0x336c('0x14')](0x1f4,[config[_0x336c('0x15')]['ip'],config['asterisk'][_0x336c('0x16')],_0x336c('0x17')]['join']('\x20')));}_0x592a5b=_[_0x336c('0x18')](_0x592a5b,_['keys'](properties[_0x336c('0x19')]));_0x592a5b['action']=_0x336c('0x1a');return ami['Action'](_0x592a5b)[_0x336c('0x1b')](function(_0x2c2b16){_0x577bd6({'code':0xc8,'message':_0x2c2b16['message']});})['catch'](function(_0x13db87){_0x10dba2(_0x1c3961[_0x336c('0x14')](0x1f5,_0x13db87[_0x336c('0x1c')]));});});},'Command':function(_0x221408){var _0x366182=this;return new Promise(function(_0x4fde93,_0x327e10){if(ami['isConnected']()==![]){return _0x327e10(_0x366182['error'](0x1f4,[config['asterisk']['ip'],config[_0x336c('0x15')][_0x336c('0x16')],_0x336c('0x17')]['join']('\x20')));}_0x221408=_['pick'](_0x221408,_0x336c('0x1d'));_0x221408[_0x336c('0x1e')]=_0x336c('0x1f');return ami['Action'](_0x221408)[_0x336c('0x1b')](function(_0x421929){_0x4fde93({'code':0xc8,'message':_0x421929[_0x336c('0x20')]});})['catch'](function(_0x473164){_0x327e10(_0x366182[_0x336c('0x14')](0x1f5,_0x473164[_0x336c('0x1c')]));});});},'VoiceQueues':function(_0xc46031){return new Promise(function(_0x4bd54c,_0x401660){var _0x9dc9bc=[];for(var _0x412a00 in _0x4e4c07[_0x336c('0x21')]){if(_0x4e4c07[_0x336c('0x21')][_0x336c('0x22')](_0x412a00)){var _0x567bfa=_0x4e4c07[_0x336c('0x21')][_0x412a00];var _0x3d2442={'id':_0x567bfa['id'],'name':_0x567bfa[_0x336c('0xc')],'strategy':_0x567bfa[_0x336c('0x23')],'answered':_0x567bfa['answered'],'available':_0x567bfa[_0x336c('0x24')],'loggedIn':_0x567bfa[_0x336c('0x25')],'pTalking':_0x567bfa['pTalking'],'sumBillable':_0x567bfa['sumBillable'],'sumDuration':_0x567bfa['sumDuration'],'sumHoldTime':_0x567bfa[_0x336c('0x26')]||0x0,'talking':_0x567bfa[_0x336c('0x27')],'total':_0x567bfa['total'],'type':_0x567bfa['type'],'unmanaged':_0x567bfa['unmanaged'],'abandoned':_0x567bfa[_0x336c('0x28')],'waiting':_0x567bfa[_0x336c('0x29')],'loggedInDb':_0x567bfa[_0x336c('0x2a')]};if(_0x567bfa[_0x336c('0x2b')]===_0x336c('0x2c')){_0x3d2442[_0x336c('0x2d')]=_0x567bfa[_0x336c('0x2d')];_0x3d2442['dialMethod']=_0x567bfa[_0x336c('0x2e')];_0x3d2442[_0x336c('0x2f')]=_0x567bfa[_0x336c('0x2f')];_0x3d2442[_0x336c('0x30')]=_0x567bfa['dialOriginateCallerIdNumber'];_0x3d2442[_0x336c('0x31')]=_0x567bfa[_0x336c('0x31')];_0x3d2442['dialPrefix']=_0x567bfa[_0x336c('0x32')];_0x3d2442[_0x336c('0x33')]=_0x567bfa['temp'];_0x3d2442[_0x336c('0x34')]=_0x567bfa[_0x336c('0x34')];_0x3d2442[_0x336c('0x35')]=_0x567bfa[_0x336c('0x35')];_0x3d2442[_0x336c('0x36')]=_0x567bfa[_0x336c('0x36')];_0x3d2442[_0x336c('0x37')]=_0x567bfa[_0x336c('0x37')];_0x3d2442['outboundCongestionCallsDay']=_0x567bfa[_0x336c('0x38')];_0x3d2442[_0x336c('0x39')]=_0x567bfa[_0x336c('0x39')];_0x3d2442[_0x336c('0x3a')]=_0x567bfa[_0x336c('0x3a')];_0x3d2442[_0x336c('0x3b')]=_0x567bfa[_0x336c('0x3b')];_0x3d2442[_0x336c('0x3c')]=_0x567bfa[_0x336c('0x3c')];_0x3d2442[_0x336c('0x3d')]=_0x567bfa['outboundNoSuchCallsDay'];_0x3d2442[_0x336c('0x3e')]=_0x567bfa[_0x336c('0x3e')];_0x3d2442[_0x336c('0x3f')]=_0x567bfa[_0x336c('0x3f')];_0x3d2442[_0x336c('0x40')]=_0x567bfa[_0x336c('0x40')];_0x3d2442[_0x336c('0x41')]=_0x567bfa[_0x336c('0x41')];_0x3d2442[_0x336c('0x42')]=_0x567bfa[_0x336c('0x42')];_0x3d2442['predictiveIntervalAvgHoldtime']=_0x567bfa[_0x336c('0x43')];_0x3d2442[_0x336c('0x44')]=_0x567bfa[_0x336c('0x44')];_0x3d2442['predictiveIntervalDroppedCallsCallersExit']=_0x567bfa[_0x336c('0x45')];_0x3d2442[_0x336c('0x46')]=_0x567bfa[_0x336c('0x46')];_0x3d2442[_0x336c('0x47')]=_0x567bfa['predictiveIntervalErlangCalls'];_0x3d2442[_0x336c('0x48')]=_0x567bfa[_0x336c('0x48')];_0x3d2442['predictiveIntervalHitRate']=_0x567bfa[_0x336c('0x49')];_0x3d2442[_0x336c('0x4a')]=_0x567bfa[_0x336c('0x4a')];_0x3d2442['predictiveIntervalPauses']=_0x567bfa[_0x336c('0x4b')];_0x3d2442[_0x336c('0x4c')]=_0x567bfa[_0x336c('0x4c')];_0x3d2442[_0x336c('0x4d')]=_0x567bfa[_0x336c('0x4d')];_0x3d2442[_0x336c('0x1c')]=_0x567bfa[_0x336c('0x1c')];_0x3d2442[_0x336c('0x4e')]=_0x567bfa[_0x336c('0x4e')];_0x3d2442[_0x336c('0x4f')]=_0x567bfa['erlangCalls'];_0x3d2442[_0x336c('0x50')]=_0x567bfa[_0x336c('0x50')];_0x3d2442[_0x336c('0x51')]=_0x567bfa['erlangAbandonmentRate'];_0x3d2442[_0x336c('0x52')]=_0x567bfa[_0x336c('0x52')];_0x3d2442['startPredictive']=_0x567bfa[_0x336c('0x53')];_0x3d2442[_0x336c('0x54')]=_0x567bfa[_0x336c('0x54')];}if(_0x567bfa[_0x336c('0x55')]){_0x3d2442['Trunk']={'id':_0x567bfa[_0x336c('0x55')]['id'],'name':_0x567bfa[_0x336c('0x55')]['name'],'active':_0x567bfa[_0x336c('0x55')][_0x336c('0x56')],'callerid':_0x567bfa['Trunk'][_0x336c('0x57')]};}if(_0x567bfa[_0x336c('0x58')]){_0x3d2442[_0x336c('0x58')]={'id':_0x567bfa[_0x336c('0x58')]['id'],'name':_0x567bfa['Interval'][_0x336c('0xc')]};}_0x9dc9bc[_0x336c('0x59')](_0x3d2442);}}_0x4bd54c({'count':_0x9dc9bc[_0x336c('0x5a')],'rows':_0x9dc9bc});});},'UpdateVoiceQueue':function(_0x222804){return new Promise(function(_0x1c2359,_0x3b68c4){var _0x11ff51=_[_0x336c('0x5b')](_0x4e4c07[_0x336c('0x21')],{'id':parseInt(_0x222804['id'])});var _0x4c27c6=_[_0x336c('0x5c')](_0x222804,['id']);if(_0x11ff51){for(var _0x46b61b in _0x4c27c6){if(typeof _0x4c27c6[_0x46b61b]!==_0x336c('0x5d')&&typeof _0x11ff51[_0x46b61b]!==_0x336c('0x5d')){_0x11ff51[_0x46b61b]=_0x4c27c6[_0x46b61b];}}_0x1c2359(_0x11ff51);}else{_0x3b68c4();}});},'VoiceChannels':function(_0x107b6f){return new Promise(function(_0x1f2f8f,_0x41e794){var _0xbfac47=_[_0x336c('0x5e')](_0x4e4c07[_0x336c('0x5f')]);_0x1f2f8f({'count':_0xbfac47[_0x336c('0x5a')],'rows':_0xbfac47});});},'VoiceChannelMixMonitor':function(_0x1aee22){var _0x3b5965=this;return new Promise(function(_0x58d26c,_0x26ea9e){if(ami['isConnected']()==![]){return _0x26ea9e(_0x3b5965['error'](0x1f4,[config[_0x336c('0x15')]['ip'],config['asterisk']['username'],_0x336c('0x17')]['join']('\x20')));}var _0x31f2bd=schema(properties[_0x336c('0x60')])[_0x336c('0x2')](_0x1aee22);if(_0x31f2bd[_0x336c('0x5a')]>0x0){return _0x26ea9e(_0x3b5965['error'](0x1f4,_['map'](_0x31f2bd,_0x336c('0x1c'))[_0x336c('0x61')](',\x20')));}var _0x4b70ba=_[_0x336c('0x5b')](_0x4e4c07[_0x336c('0x5f')],{'uniqueid':_0x1aee22['uniqueid']});if(_0x4b70ba&&_0x4b70ba[_0x336c('0x62')]){var _0x337ae7=util[_0x336c('0x9')](_0x336c('0x63'),_0x1aee22['filename']||_0x1aee22[_0x336c('0x64')],_0x1aee22[_0x336c('0x9')]||'wav');return ami['Action']({'action':'MixMonitor','channel':_0x4b70ba['channel'],'file':_0x337ae7,'options':'ai(mixmonitorid)'})[_0x336c('0x1b')](function(_0x31683b){var _0x265784=_[_0x336c('0x5b')](_0x4b70ba['monitors'],{'filename':_0x336c('0x65')+_0x337ae7[_0x336c('0x66')]()});if(_[_0x336c('0x67')](_0x265784)){_0x4b70ba[_0x336c('0x68')]['push']({'filename':_0x336c('0x65')+_0x337ae7['toLowerCase'](),'createdAt':moment()[_0x336c('0x9')](_0x336c('0x69')),'mixmonitorid':_0x31683b[_0x336c('0x6a')],'status':_0x336c('0x6b')});}else{_0x265784[_0x336c('0x6a')]=_0x31683b[_0x336c('0x6a')];_0x265784['status']='rec';}_0x58d26c({'code':0xc8,'message':[_0x1aee22[_0x336c('0x64')],_0x336c('0x6c'),_0x31683b['mixmonitorid']][_0x336c('0x61')]('\x20'),'mixmonitorid':_0x31683b[_0x336c('0x6a')]});})[_0x336c('0x6d')](function(_0x534f82){_0x26ea9e(_0x3b5965['error'](0x1f5,[_0x1aee22[_0x336c('0x64')],_0x534f82[_0x336c('0x1c')][_0x336c('0x66')]()][_0x336c('0x61')]('\x20')));});}else{return _0x26ea9e(_0x3b5965[_0x336c('0x14')](0x1f5,_0x336c('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x4dae78){var _0xd1a98b=this;return new Promise(function(_0x442bfb,_0x45d69d){if(ami['isConnected']()==![]){return _0x45d69d(_0xd1a98b['error'](0x1f4,[config[_0x336c('0x15')]['ip'],config[_0x336c('0x15')][_0x336c('0x16')],_0x336c('0x17')][_0x336c('0x61')]('\x20')));}var _0x2842c3=schema(properties[_0x336c('0x60')])[_0x336c('0x2')](_0x4dae78);if(_0x2842c3[_0x336c('0x5a')]>0x0){return _0x45d69d(_0xd1a98b[_0x336c('0x14')](0x1f4,_[_0x336c('0x6f')](_0x2842c3,_0x336c('0x1c'))[_0x336c('0x61')](',\x20')));}var _0x54643d=_['find'](_0x4e4c07['channels'],{'uniqueid':_0x4dae78['uniqueid']});if(_0x54643d){return BPromise[_0x336c('0x70')]()[_0x336c('0x1b')](function(){if(_0x54643d['channel']){return ami[_0x336c('0x71')]({'action':_0x336c('0x72'),'channel':_0x54643d[_0x336c('0x62')],'mixmonitorid':_0x4dae78[_0x336c('0x6a')]})[_0x336c('0x6d')](function(_0x16b975){});}})['then'](function(){if(_0x54643d[_0x336c('0x73')]){return ami['Action']({'action':_0x336c('0x72'),'channel':_0x54643d[_0x336c('0x73')],'mixmonitorid':_0x4dae78[_0x336c('0x6a')]})['catch'](function(_0x145b5c){});}})[_0x336c('0x1b')](function(_0x579607){var _0x22ad33=_['find'](_0x54643d[_0x336c('0x68')],{'mixmonitorid':_0x4dae78[_0x336c('0x6a')]});if(_0x22ad33){_0x22ad33[_0x336c('0x74')]=_0x336c('0x75');}})[_0x336c('0x1b')](function(){var _0x147c47=util['format'](_0x336c('0x63'),_0x4dae78['filename']||_0x4dae78['uniqueid'],_0x4dae78['format']||'wav');var _0x49ec12=_['find'](_0x54643d[_0x336c('0x68')],{'filename':_0x336c('0x65')+_0x147c47[_0x336c('0x66')]()});if(_0x49ec12){_0x49ec12[_0x336c('0x74')]=_0x336c('0x75');}})[_0x336c('0x1b')](function(){_0x442bfb({'code':0xc8,'message':[_0x4dae78[_0x336c('0x64')],'StopMixMonitor\x20Success'][_0x336c('0x61')]('\x20')});})[_0x336c('0x6d')](function(_0x45428d){_0x45d69d(_0xd1a98b[_0x336c('0x14')](0x1f5,[_0x4dae78['uniqueid'],_0x45428d[_0x336c('0x1c')][_0x336c('0x66')]()][_0x336c('0x61')]('\x20')));});}else{return _0x45d69d(_0xd1a98b['error'](0x1f5,_0x336c('0x6e')));}});},'VoiceQueuesChannels':function(_0x23ca9d){return new Promise(function(_0x134d6f,_0x13f919){var _0x2332c6=_[_0x336c('0x5e')](_0x4e4c07[_0x336c('0x76')]);_0x134d6f({'count':_0x2332c6['length'],'rows':_0x2332c6});});},'VoiceQueuesChannel':function(_0x5908b9){var _0x1d3ab9=this;return new Promise(function(_0x413412,_0x35f7f2){var _0x8e1b7=schema(properties[_0x336c('0x77')])[_0x336c('0x2')](_0x5908b9);if(_0x8e1b7[_0x336c('0x5a')]>0x0){return _0x35f7f2(_0x1d3ab9[_0x336c('0x14')](0x1f4,_['map'](_0x8e1b7,_0x336c('0x1c'))[_0x336c('0x61')](',\x20')));}var _0x58eb23=_[_0x336c('0x5b')](_0x4e4c07[_0x336c('0x76')],{'uniqueid':_0x5908b9['uniqueid']});if(_0x58eb23){_0x413412(_0x58eb23);}else{return _0x35f7f2(_0x1d3ab9['error'](0x1f5,_0x336c('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x548c39){var _0x21241d=this;return new Promise(function(_0x10436f,_0x4e2776){if(ami[_0x336c('0x13')]()==![]){return _0x4e2776(_0x21241d[_0x336c('0x14')](0x1f4,[config[_0x336c('0x15')]['ip'],config[_0x336c('0x15')]['username'],_0x336c('0x17')][_0x336c('0x61')]('\x20')));}var _0x2e4785=schema(properties['voicequeuechannelhangup'])['validate'](_0x548c39);if(_0x2e4785['length']>0x0){return _0x4e2776(_0x21241d['error'](0x1f4,_['map'](_0x2e4785,_0x336c('0x1c'))['join'](',\x20')));}var _0x67330a=_['find'](_0x4e4c07['queueChannels'],{'uniqueid':_0x548c39[_0x336c('0x64')]});if(_0x67330a&&_0x67330a[_0x336c('0x62')]){return ami['Action']({'action':_0x336c('0x78'),'channel':_0x67330a['channel']})[_0x336c('0x1b')](function(_0x3e0fdf){_0x10436f({'code':0xc8,'message':[_0x548c39[_0x336c('0x64')],_0x3e0fdf[_0x336c('0x1c')][_0x336c('0x66')]()]['join']('\x20')});})[_0x336c('0x6d')](function(_0x45ec3a){_0x4e2776(_0x21241d[_0x336c('0x14')](0x1f5,[_0x548c39['uniqueid'],_0x45ec3a[_0x336c('0x1c')][_0x336c('0x66')]()][_0x336c('0x61')]('\x20')));});}else{return _0x4e2776(_0x21241d[_0x336c('0x14')](0x1f5,_0x336c('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x3090a9){var _0x309604=this;return new Promise(function(_0x912ff4,_0x573512){if(ami[_0x336c('0x13')]()==![]){return _0x573512(_0x309604[_0x336c('0x14')](0x1f4,[config[_0x336c('0x15')]['ip'],config[_0x336c('0x15')]['username'],_0x336c('0x17')]['join']('\x20')));}var _0x752a4d=schema(properties[_0x336c('0x79')])[_0x336c('0x2')](_0x3090a9);if(_0x752a4d[_0x336c('0x5a')]>0x0){return _0x573512(_0x309604[_0x336c('0x14')](0x1f4,_[_0x336c('0x6f')](_0x752a4d,'message')[_0x336c('0x61')](',\x20')));}var _0x5221ce=_['find'](_0x4e4c07[_0x336c('0x76')],{'uniqueid':_0x3090a9[_0x336c('0x64')]});if(_0x5221ce&&_0x5221ce[_0x336c('0x62')]){return ami[_0x336c('0x71')]({'action':_0x336c('0x7a'),'channel':_0x5221ce[_0x336c('0x62')],'exten':_0x3090a9[_0x336c('0x7b')],'context':_0x3090a9[_0x336c('0x7c')]||_0x5221ce[_0x336c('0x7c')],'priority':0x1})[_0x336c('0x1b')](function(_0x4d930d){_0x912ff4({'code':0xc8,'message':[_0x3090a9[_0x336c('0x64')],_0x4d930d[_0x336c('0x1c')][_0x336c('0x66')]()][_0x336c('0x61')]('\x20')});})[_0x336c('0x6d')](function(_0xb158ca){_0x573512(_0x309604[_0x336c('0x14')](0x1f5,[_0x3090a9[_0x336c('0x64')],_0xb158ca[_0x336c('0x1c')]['toLowerCase']()][_0x336c('0x61')]('\x20')));});}else{return _0x573512(_0x309604[_0x336c('0x14')](0x1f5,_0x336c('0x6e')));}});},'Agents':function(_0x25ba0e){return new Promise(function(_0x3a85fd,_0x5f08a9){var _0xf82a02=_['values'](_0x4e4c07[_0x336c('0x10')]);_0x3a85fd({'count':_0xf82a02[_0x336c('0x5a')],'rows':_0xf82a02});});},'Telephones':function(_0x24c878){return new Promise(function(_0x49ebc7,_0x28e708){var _0x314fa0=_[_0x336c('0x5e')](_0x4e4c07[_0x336c('0x7d')]);_0x49ebc7({'count':_0x314fa0['length'],'rows':_0x314fa0});});},'Trunks':function(_0x1a47ba){return new Promise(function(_0x5b4540,_0x533c90){var _0x50ae9c=_['values'](_0x4e4c07[_0x336c('0x7e')]);_0x5b4540({'count':_0x50ae9c['length'],'rows':_0x50ae9c});});},'OutboundChannels':function(_0x52a554){return new Promise(function(_0xf46d71,_0x518e58){var _0x1280d5=_['values'](_0x4e4c07[_0x336c('0x7f')]);_0xf46d71({'count':_0x1280d5[_0x336c('0x5a')],'rows':_0x1280d5});});},'Outbound':function(_0x27a6fd){return new Promise(function(_0x17e944,_0x51d6e2){_0x17e944(_0x4e4c07[_0x336c('0x2c')]);});},'Campaigns':function(_0x57b686){return new Promise(function(_0x446702,_0x2c6a8f){var _0x3f33f=_[_0x336c('0x5e')](_0x4e4c07[_0x336c('0x80')]);_0x446702({'count':_0x3f33f['length'],'rows':_0x3f33f});});},'VoiceQueuesPreview':function(_0x336311){var _0x3fef9c=this;return new Promise(function(_0x33ce7d,_0xfa9158){_0x3b27e0['run'](_0x336311['id'])[_0x336c('0x1b')](function(_0x3024ad){_0x33ce7d({'code':0xc8,'message':_0x3024ad[_0x336c('0x1c')]});})[_0x336c('0x6d')](function(_0x533db0){_0xfa9158(_0x3fef9c[_0x336c('0x14')](0x1f4,_0x533db0[_0x336c('0x1c')]));});});},'EventManager':function(_0x3b4484){var _0xf247c5=this;return new Promise(function(_0x1ab058,_0x7aed56){if(!_0x3b4484[_0x336c('0x81')]){return _0x7aed56(_0xf247c5[_0x336c('0x14')](0x1f4,_0x336c('0x82')));}ami['emit'](_0x336c('0x83')+_0x3b4484[_0x336c('0x81')],_0x3b4484['message']);_0x1ab058({'code':0xc8,'message':_0x3b4484});});},'FaxAccounts':function(_0x25a1aa){return new Promise(function(_0x21ac11,_0xabd53f){var _0x22eae7=_[_0x336c('0x5e')](_0x4e4c07[_0x336c('0x84')]);_0x21ac11({'count':_0x22eae7[_0x336c('0x5a')],'rows':_0x22eae7});});},'SendFax':function(_0x31f9de){var _0x25b6c1=this;return new Promise(function(_0x469fae,_0x18b96d){_0x2e0016[_0x336c('0x85')](_0x31f9de)[_0x336c('0x1b')](function(_0xb21d9e){_0x469fae({'code':0xc8,'message':_0xb21d9e['message']});})[_0x336c('0x6d')](function(_0x142c3c){_0x18b96d(_0x25b6c1['error'](0x1f4,_0x142c3c[_0x336c('0x1c')]));});});},'CheckAfterSend':function(_0x2cce98){var _0x100188=this;return new Promise(function(_0x44e759,_0x16762a){_0x2e0016[_0x336c('0x86')](_0x2cce98)['then'](function(_0x1b150e){_0x44e759({'code':0xc8,'message':_0x1b150e[_0x336c('0x1c')]});})[_0x336c('0x6d')](function(_0x4a686f){_0x16762a(_0x100188['error'](0x1f4,_0x4a686f['message']));});});}};var _0x534cd3=jayson[_0x336c('0x87')](_0x295b22)['http']();_0x534cd3['on'](_0x336c('0x14'),function(_0x1c8a04){return _0x29a202(_0x1c8a04);});_0x534cd3[_0x336c('0x8')](0x232a,_0x336c('0x88'),function(){console[_0x336c('0x89')](_0x336c('0x8a'),0x232a);return _0x2097a8('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index 4a15dec..370aa3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','<unknown>','calleridname'];(function(_0x14f5af,_0x40fc1f){var _0x274c72=function(_0x292ce8){while(--_0x292ce8){_0x14f5af['push'](_0x14f5af['shift']());}};_0x274c72(++_0x40fc1f);}(_0x81bd,0x7c));var _0xd81b=function(_0xbc2d9e,_0x40ef4f){_0xbc2d9e=_0xbc2d9e-0x0;var _0x2e315c=_0x81bd[_0xbc2d9e];return _0x2e315c;};'use strict';var _=require(_0xd81b('0x0'));var BPromise=require(_0xd81b('0x1'));var Redis=require(_0xd81b('0x2'));var util=require(_0xd81b('0x3'));var config=require(_0xd81b('0x4'));var logger=require(_0xd81b('0x5'))(_0xd81b('0x6'));var cmContactRpc=require('../../rpc/cmContact');config[_0xd81b('0x7')]=_[_0xd81b('0x8')](config[_0xd81b('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd81b('0x9'))(new Redis(config[_0xd81b('0x7')]));function emit(_0x1f3f2c,_0x562084,_0x5e14e8,_0xa4cf97,_0x5468d5){logger[_0xd81b('0xa')](_0xd81b('0xb'),_0x1f3f2c,_0x562084['id'],_0x5e14e8,_0xa4cf97,JSON[_0xd81b('0xc')](_0x5468d5));io['to'](_0x5e14e8)[_0xd81b('0xd')](_0xa4cf97,_0x5468d5);}exports[_0xd81b('0xe')]=function(_0x1ff60f,_0x4391be,_0x17e09f,_0x2090e1){var _0x23c789,_0x215b92;var _0x3914f7={};var _0x1afb8f=Number(_0x17e09f['data1']);var _0x21dfff=_0x17e09f['data2']?Boolean(Number(_0x17e09f[_0xd81b('0xf')])):![];var _0xe75568;var _0x5f0b6b=![];if(!_[_0xd81b('0x10')](_0x17e09f['data5'])){if(_0x17e09f[_0xd81b('0x11')]=='1')_0x5f0b6b=!![];}if(!_0x5f0b6b){if(_0x2090e1[_0xd81b('0x12')]){_0x3914f7['id']=_0x2090e1[_0xd81b('0x12')];}}if(!_0x3914f7['id']){_0x3914f7[_0xd81b('0x13')]=_0x1afb8f;_0xe75568=_0x17e09f[_0xd81b('0x14')]&&_0x17e09f['data3']!=='0'?_0x17e09f[_0xd81b('0x14')][_0xd81b('0x15')](','):['phone'];_0x3914f7[_0xd81b('0x16')]=_[_0xd81b('0x17')](_0xe75568,function(_0x4657cf){var _0x15e860={};_0x15e860[_0x4657cf]=_0x2090e1[_0xd81b('0x18')]?_0x2090e1[_0xd81b('0x19')]:_0x2090e1[_0xd81b('0x1a')];return _0x15e860;});}var _0x3d4d34=['id',_0xd81b('0x1b'),_0xd81b('0x1c'),_0xd81b('0x1d'),_0xd81b('0x1e'),_0xd81b('0x1f'),_0xd81b('0x13'),_0xd81b('0x20'),_0xd81b('0x21'),'updatedAt'];var _0x4d566e=_[_0xd81b('0x22')](_0x3d4d34,_0xe75568);BPromise[_0xd81b('0x23')]()[_0xd81b('0x24')](cmContactRpc['getContacts']({'attributes':_0x4d566e,'where':_0x3914f7}))[_0xd81b('0x24')](function(_0x6571a6){_0x215b92=_0x6571a6;if(!_['isEmpty'](_0x215b92)){if(_0x215b92[_0xd81b('0x25')]===0x1){_0x23c789=_0x215b92[0x0];logger[_0xd81b('0xa')](_0xd81b('0x26'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id'],_0x23c789['id']);}else{logger[_0xd81b('0xa')](_0xd81b('0x28'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id'],_[_0xd81b('0x17')](_0x215b92,'id')[_0xd81b('0x29')](','));}return;}else{logger[_0xd81b('0xa')](_0xd81b('0x2a'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id']);var _0x596389={'ListId':_0x1afb8f};var _0x28768f=_0x17e09f[_0xd81b('0x2b')]&&_0x17e09f[_0xd81b('0x2b')]!=='0'?_0x17e09f[_0xd81b('0x2b')]:_0xd81b('0x1d');if(_0x21dfff){logger[_0xd81b('0xa')](_0xd81b('0x2c'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id']);_0x596389[_0x28768f]=_[_0xd81b('0x10')](_0x2090e1['routeId'])?_0x2090e1[_0xd81b('0x1a')]:_0x2090e1['destcalleridnum'];if(_['isNil'](_0x2090e1[_0xd81b('0x18')])){_0x596389[_0xd81b('0x1b')]=_0x2090e1['calleridname']&&_0x2090e1['calleridname']!==_0xd81b('0x2d')?_0x2090e1[_0xd81b('0x2e')]:_0xd81b('0x2f');}else{_0x596389[_0xd81b('0x1b')]=_0x2090e1[_0xd81b('0x30')]&&_0x2090e1[_0xd81b('0x30')]!=='<unknown>'?_0x2090e1[_0xd81b('0x30')]:_0xd81b('0x2f');}return BPromise['resolve']()['then'](cmContactRpc[_0xd81b('0x31')](_0x596389))[_0xd81b('0x24')](function(_0x50472a){_0x23c789=_0x50472a;_0x215b92['push'](_0x50472a);if(_0x23c789){logger['info'](_0xd81b('0x32'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id'],_0x23c789['id']);}return;});}else{logger[_0xd81b('0xa')](_0xd81b('0x33'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id']);_0x596389[_0x28768f]=_[_0xd81b('0x10')](_0x2090e1[_0xd81b('0x18')])?_0x2090e1['calleridnum']:_0x2090e1[_0xd81b('0x19')];if(_['isNil'](_0x2090e1[_0xd81b('0x18')])){_0x596389[_0xd81b('0x1b')]=_0x2090e1[_0xd81b('0x2e')]&&_0x2090e1[_0xd81b('0x2e')]!==_0xd81b('0x2d')?_0x2090e1[_0xd81b('0x2e')]:_0xd81b('0x2f');}else{_0x596389[_0xd81b('0x1b')]=_0x2090e1[_0xd81b('0x30')]&&_0x2090e1[_0xd81b('0x30')]!==_0xd81b('0x2d')?_0x2090e1[_0xd81b('0x30')]:_0xd81b('0x2f');}_0x23c789=_0x596389;_0x215b92['push'](_0x596389);return;}}})['then'](function(){if(_0x1ff60f){emit(_0x2090e1[_0xd81b('0x27')],_0x4391be,util[_0xd81b('0x34')](_0xd81b('0x35'),_0x1ff60f['name']),util[_0xd81b('0x34')](_0xd81b('0x36'),_0x17e09f['action'][_0xd81b('0x37')]()),{'evt':_[_0xd81b('0x38')](_0x2090e1,{'autoCreate':_0x21dfff}),'contact':_0x23c789===undefined?{}:_0x23c789,'contacts':_0x215b92['length']===0x0?undefined:_0x215b92});}});};
\ No newline at end of file
+var _0x7bae=['data5','xmd-contactid','ListId','data3','map','firstName','lastName','phone','mobile','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridnum','routeId','<unknown>','calleridname','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','destcalleridnum','format','user:%s','trigger:%s','action','toLowerCase','merge','ioredis','util','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil'];(function(_0x205cd0,_0x4f5829){var _0x768507=function(_0x38eb06){while(--_0x38eb06){_0x205cd0['push'](_0x205cd0['shift']());}};_0x768507(++_0x4f5829);}(_0x7bae,0x13b));var _0xe7ba=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x7bae[_0x31cb5f];return _0x586042;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var config=require('../../../../config/environment');var logger=require(_0xe7ba('0x2'))('trigger');var cmContactRpc=require(_0xe7ba('0x3'));config[_0xe7ba('0x4')]=_[_0xe7ba('0x5')](config[_0xe7ba('0x4')],{'host':_0xe7ba('0x6'),'port':0x18eb});var io=require(_0xe7ba('0x7'))(new Redis(config[_0xe7ba('0x4')]));function emit(_0x3c5e59,_0x10b307,_0x34fb18,_0x160565,_0x27b1d5){logger[_0xe7ba('0x8')](_0xe7ba('0x9'),_0x3c5e59,_0x10b307['id'],_0x34fb18,_0x160565,JSON['stringify'](_0x27b1d5));io['to'](_0x34fb18)[_0xe7ba('0xa')](_0x160565,_0x27b1d5);}exports[_0xe7ba('0xb')]=function(_0x375ebb,_0x276bc3,_0x15083a,_0x1672f0){var _0x99a86f,_0x448bcc;var _0x194447={};var _0x4b6597=Number(_0x15083a[_0xe7ba('0xc')]);var _0x588c8b=_0x15083a[_0xe7ba('0xd')]?Boolean(Number(_0x15083a[_0xe7ba('0xd')])):![];var _0x390596;var _0x17e4e6=![];if(!_[_0xe7ba('0xe')](_0x15083a[_0xe7ba('0xf')])){if(_0x15083a['data5']=='1')_0x17e4e6=!![];}if(!_0x17e4e6){if(_0x1672f0['xmd-contactid']){_0x194447['id']=_0x1672f0[_0xe7ba('0x10')];}}if(!_0x194447['id']){_0x194447[_0xe7ba('0x11')]=_0x4b6597;_0x390596=_0x15083a[_0xe7ba('0x12')]&&_0x15083a['data3']!=='0'?_0x15083a[_0xe7ba('0x12')]['split'](','):['phone'];_0x194447['$or']=_[_0xe7ba('0x13')](_0x390596,function(_0x4e87f5){var _0x41a773={};_0x41a773[_0x4e87f5]=_0x1672f0['routeId']?_0x1672f0['destcalleridnum']:_0x1672f0['calleridnum'];return _0x41a773;});}var _0x3f326a=['id',_0xe7ba('0x14'),_0xe7ba('0x15'),_0xe7ba('0x16'),_0xe7ba('0x17'),'fax',_0xe7ba('0x11'),_0xe7ba('0x18'),_0xe7ba('0x19'),_0xe7ba('0x1a')];var _0x4aaf35=_[_0xe7ba('0x1b')](_0x3f326a,_0x390596);BPromise[_0xe7ba('0x1c')]()['then'](cmContactRpc[_0xe7ba('0x1d')]({'attributes':_0x4aaf35,'where':_0x194447}))[_0xe7ba('0x1e')](function(_0x27c882){_0x448bcc=_0x27c882;if(!_[_0xe7ba('0x1f')](_0x448bcc)){if(_0x448bcc[_0xe7ba('0x20')]===0x1){_0x99a86f=_0x448bcc[0x0];logger[_0xe7ba('0x8')](_0xe7ba('0x21'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id'],_0x99a86f['id']);}else{logger[_0xe7ba('0x8')](_0xe7ba('0x23'),_0x1672f0['uniqueid'],_0x276bc3['id'],_['map'](_0x448bcc,'id')['join'](','));}return;}else{logger['info'](_0xe7ba('0x24'),_0x1672f0['uniqueid'],_0x276bc3['id']);var _0x4ecc0d={'ListId':_0x4b6597};var _0x5ece11=_0x15083a[_0xe7ba('0x25')]&&_0x15083a[_0xe7ba('0x25')]!=='0'?_0x15083a[_0xe7ba('0x25')]:_0xe7ba('0x16');if(_0x588c8b){logger[_0xe7ba('0x8')](_0xe7ba('0x26'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id']);_0x4ecc0d[_0x5ece11]=_[_0xe7ba('0xe')](_0x1672f0['routeId'])?_0x1672f0[_0xe7ba('0x27')]:_0x1672f0['destcalleridnum'];if(_[_0xe7ba('0xe')](_0x1672f0[_0xe7ba('0x28')])){_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0['calleridname']&&_0x1672f0['calleridname']!==_0xe7ba('0x29')?_0x1672f0[_0xe7ba('0x2a')]:_0xe7ba('0x2b');}else{_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0[_0xe7ba('0x2c')]&&_0x1672f0['destcalleridname']!==_0xe7ba('0x29')?_0x1672f0[_0xe7ba('0x2c')]:'Unknown';}return BPromise[_0xe7ba('0x1c')]()['then'](cmContactRpc['createContact'](_0x4ecc0d))[_0xe7ba('0x1e')](function(_0x134f21){_0x99a86f=_0x134f21;_0x448bcc[_0xe7ba('0x2d')](_0x134f21);if(_0x99a86f){logger['info'](_0xe7ba('0x2e'),_0x1672f0['uniqueid'],_0x276bc3['id'],_0x99a86f['id']);}return;});}else{logger[_0xe7ba('0x8')](_0xe7ba('0x2f'),_0x1672f0[_0xe7ba('0x22')],_0x276bc3['id']);_0x4ecc0d[_0x5ece11]=_[_0xe7ba('0xe')](_0x1672f0[_0xe7ba('0x28')])?_0x1672f0['calleridnum']:_0x1672f0[_0xe7ba('0x30')];if(_[_0xe7ba('0xe')](_0x1672f0['routeId'])){_0x4ecc0d[_0xe7ba('0x14')]=_0x1672f0[_0xe7ba('0x2a')]&&_0x1672f0[_0xe7ba('0x2a')]!=='<unknown>'?_0x1672f0[_0xe7ba('0x2a')]:_0xe7ba('0x2b');}else{_0x4ecc0d['firstName']=_0x1672f0[_0xe7ba('0x2c')]&&_0x1672f0[_0xe7ba('0x2c')]!==_0xe7ba('0x29')?_0x1672f0['destcalleridname']:_0xe7ba('0x2b');}_0x99a86f=_0x4ecc0d;_0x448bcc[_0xe7ba('0x2d')](_0x4ecc0d);return;}}})['then'](function(){if(_0x375ebb){emit(_0x1672f0[_0xe7ba('0x22')],_0x276bc3,util[_0xe7ba('0x31')](_0xe7ba('0x32'),_0x375ebb['name']),util['format'](_0xe7ba('0x33'),_0x15083a[_0xe7ba('0x34')][_0xe7ba('0x35')]()),{'evt':_[_0xe7ba('0x36')](_0x1672f0,{'autoCreate':_0x588c8b}),'contact':_0x99a86f===undefined?{}:_0x99a86f,'contacts':_0x448bcc[_0xe7ba('0x20')]===0x0?undefined:_0x448bcc});}});};
\ No newline at end of file
index 9974449..a8c081e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4aa8=['voice','prototype','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','buildUri','data3','isNil','data4','location','uriLocation','data5','800','windowHeight','600','data6','winApplication','winArguments','format','user:%s','trigger:%s:%s','toLowerCase','jscripty','name','trigger:%s','exec','integration','voiceQueues','queue','routeId','script','parse','query','replace','AllConditions','checkConditions','channel','AnyConditions','length','some','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','exports','util','lodash','url','mustache','ioredis','./integration','./script','../../../config/logger','trigger','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','info','stringify','emit','clone','motionChannel','undefined'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x4aa8,0x13d));var _0x84aa=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x4aa8[_0x3ea913];return _0x2b4f28;};'use strict';var util=require(_0x84aa('0x0'));var _=require(_0x84aa('0x1'));var url=require(_0x84aa('0x2'));var Mustache=require(_0x84aa('0x3'));var Redis=require(_0x84aa('0x4'));var urlforward=require('./urlforward');var integration=require(_0x84aa('0x5'));var cmContact=require('./cmContact');var script=require(_0x84aa('0x6'));var config=require('../../../config/environment');var logger=require(_0x84aa('0x7'))(_0x84aa('0x8'));var ami=require('../ami');config[_0x84aa('0x9')]=_['defaults'](config['redis'],{'host':_0x84aa('0xa'),'port':0x18eb});var io=require(_0x84aa('0xb'))(new Redis(config[_0x84aa('0x9')]));var operators={'equals':function(_0x148c17,_0x1f49b5){return _0x148c17==_0x1f49b5;},'not_equals':function(_0x1a9ef3,_0x4b9645){return _0x1a9ef3!=_0x4b9645;}};var barAndWebActions=[_0x84aa('0xc'),'url',_0x84aa('0xd')];function Trigger(_0x38c9a6){this[_0x84aa('0xe')]=_0x38c9a6[_0x84aa('0xe')];this[_0x84aa('0xf')]=_0x38c9a6[_0x84aa('0xf')];this['voiceQueues']=_0x38c9a6['voiceQueues'];this[_0x84aa('0x10')]=_0x38c9a6[_0x84aa('0x10')];this[_0x84aa('0x11')]=_0x38c9a6[_0x84aa('0x11')];this[_0x84aa('0x12')]=_0x38c9a6[_0x84aa('0x12')];this[_0x84aa('0x13')]=_0x38c9a6['freshdeskAccounts'];this[_0x84aa('0x14')]=_0x38c9a6[_0x84aa('0x14')];this['sugarcrmAccounts']=_0x38c9a6[_0x84aa('0x15')];this[_0x84aa('0x16')]=_0x38c9a6[_0x84aa('0x16')];this['deskAccounts']=_0x38c9a6[_0x84aa('0x17')];this[_0x84aa('0x18')]=_0x38c9a6[_0x84aa('0x18')];this[_0x84aa('0x19')]=_0x38c9a6['servicenowAccounts'];this['dynamics365Accounts']=_0x38c9a6[_0x84aa('0x1a')];this[_0x84aa('0x1b')]=_0x38c9a6['freshsalesAccounts'];this[_0x84aa('0x1c')]={'zendesk':this[_0x84aa('0x12')],'salesforce':this[_0x84aa('0x14')],'freshdesk':this[_0x84aa('0x13')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x84aa('0x16')],'desk':this[_0x84aa('0x17')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x84aa('0x1a')],'freshsales':this[_0x84aa('0x1b')],'servicenow':this[_0x84aa('0x19')]};ami['on'](_0x84aa('0x1d'),this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x20'),this['syncCustomEvent']['bind'](this));ami['on'](_0x84aa('0x21'),this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on']('custom:agentcomplete',this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x22'),this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x23'),this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x24'),this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on']('custom:agentcongestion',this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x25'),this[_0x84aa('0x1e')]['bind'](this));ami['on']('custom:amd',this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x26'),this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x27'),this[_0x84aa('0x1e')]['bind'](this));ami['on']('custom:dialbegin',this[_0x84aa('0x28')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x29'),this['syncAgentDial'][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x2a'),this[_0x84aa('0x28')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x2b'),this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x2c'),this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x2d'),this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x2e'),this['syncCustomEvent'][_0x84aa('0x1f')](this));ami['on']('custom:outgoingmessage',this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x2f'),this[_0x84aa('0x1e')][_0x84aa('0x1f')](this));ami['on'](_0x84aa('0x30'),this['syncCustomEvent'][_0x84aa('0x1f')](this));}Trigger['prototype']['emit']=function(_0x9869a6,_0x1e4f77,_0x14c038){logger[_0x84aa('0x31')](_0x9869a6,_0x1e4f77,JSON[_0x84aa('0x32')](_0x14c038));io['to'](_0x9869a6)[_0x84aa('0x33')](_0x1e4f77,_0x14c038);};Trigger['prototype'][_0x84aa('0x1e')]=function(_0x31ce3b){var _0x5b45fe=_[_0x84aa('0x34')](_0x31ce3b);if(typeof _0x5b45fe[_0x84aa('0x35')]===_0x84aa('0x36')){_0x5b45fe[_0x84aa('0x35')]=_0x84aa('0x37');}this['checkTriggers'](_0x5b45fe);};Trigger[_0x84aa('0x38')][_0x84aa('0x28')]=function(_0x38fa72){if(this[_0x84aa('0xf')][_0x38fa72[_0x84aa('0x39')]]){this[_0x84aa('0x1e')](_0x38fa72);}};Trigger[_0x84aa('0x38')][_0x84aa('0x3a')]=function(_0x4f4f0c){var _0x20cf3b;for(var _0x1c1a08 in this['triggers']){if(this[_0x84aa('0xe')][_0x84aa('0x3b')](_0x1c1a08)){if(this[_0x84aa('0xe')][_0x1c1a08][_0x84aa('0x3c')]){_0x20cf3b=this[_0x84aa('0x3d')](this[_0x84aa('0xe')][_0x1c1a08],_0x4f4f0c);if(_0x20cf3b){_[_0x84aa('0x3e')](_0x4f4f0c,_0x4f4f0c[_0x84aa('0x3f')]);for(var _0xe1733f=0x0,_0x31fbdb,_0x14f66a,_0x2d5759;_0xe1733f<this[_0x84aa('0xe')][_0x1c1a08]['Actions']['length'];_0xe1733f+=0x1){_0x31fbdb=this[_0x84aa('0xe')][_0x1c1a08][_0x84aa('0x40')][_0xe1733f];if(this[_0x84aa('0xf')][_0x4f4f0c['interface']]){switch(_0x31fbdb[_0x84aa('0x41')]['toLowerCase']()){case _0x84aa('0x42'):break;case _0x84aa('0x43'):case _0x84aa('0x44'):var _0x2cd065={};switch(barAndWebActions[_0x31fbdb[_0x84aa('0x45')]]){case _0x84aa('0xc'):_0x2cd065[_0x84aa('0x46')]=_0x31fbdb[_0x84aa('0x47')];_0x2cd065[_0x84aa('0x48')]=this[_0x84aa('0x10')][_0x31fbdb[_0x84aa('0x47')]]?Mustache[_0x84aa('0x49')](this['templates'][_0x31fbdb['data2']]['html'],_0x4f4f0c):_0x84aa('0x4a');break;case _0x84aa('0x2'):_0x2cd065['uri']=this[_0x84aa('0x4b')](_0x31fbdb[_0x84aa('0x47')],_0x4f4f0c,_['isNil'](_0x31fbdb[_0x84aa('0x4c')])?!![]:parseInt(_0x31fbdb[_0x84aa('0x4c')],0xa));if(_[_0x84aa('0x4d')](_0x31fbdb[_0x84aa('0x4e')])){_0x2cd065[_0x84aa('0x4f')]='0';}else{_0x2cd065[_0x84aa('0x50')]=_0x31fbdb[_0x84aa('0x4e')];_0x2cd065['windowWidth']=_[_0x84aa('0x4d')](_0x31fbdb[_0x84aa('0x51')])?_0x84aa('0x52'):_0x31fbdb[_0x84aa('0x51')];_0x2cd065[_0x84aa('0x53')]=_['isNil'](_0x31fbdb['data6'])?_0x84aa('0x54'):_0x31fbdb[_0x84aa('0x55')];}break;case _0x84aa('0xd'):_0x2cd065[_0x84aa('0x56')]=_0x31fbdb[_0x84aa('0x47')]?Mustache[_0x84aa('0x49')](_0x31fbdb['data2'],_0x4f4f0c):'';_0x2cd065[_0x84aa('0x57')]=_0x31fbdb[_0x84aa('0x4c')]?Mustache[_0x84aa('0x49')](_0x31fbdb[_0x84aa('0x4c')],_0x4f4f0c):'';break;}this['emit'](util[_0x84aa('0x58')](_0x84aa('0x59'),this[_0x84aa('0xf')][_0x4f4f0c[_0x84aa('0x39')]]['name']),util[_0x84aa('0x58')](_0x84aa('0x5a'),_0x31fbdb[_0x84aa('0x41')][_0x84aa('0x5b')](),barAndWebActions[_0x31fbdb[_0x84aa('0x45')]]),_[_0x84aa('0x3e')](_0x2cd065,_0x4f4f0c));break;case _0x84aa('0x5c'):this[_0x84aa('0x33')](util[_0x84aa('0x58')](_0x84aa('0x59'),this[_0x84aa('0xf')][_0x4f4f0c[_0x84aa('0x39')]][_0x84aa('0x5d')]),util[_0x84aa('0x58')](_0x84aa('0x5e'),_0x31fbdb[_0x84aa('0x41')]['toLowerCase']()),_[_0x84aa('0x3e')]({'ProjectId':parseInt(_0x31fbdb[_0x84aa('0x45')],0xa)},_0x4f4f0c));break;default:this[_0x84aa('0x33')](util['format'](_0x84aa('0x59'),this[_0x84aa('0xf')][_0x4f4f0c[_0x84aa('0x39')]]['name']),util[_0x84aa('0x58')](_0x84aa('0x5e'),_0x31fbdb[_0x84aa('0x41')]['toLowerCase']()),_[_0x84aa('0x3e')]({},_0x31fbdb,_0x4f4f0c));}}switch(_0x31fbdb[_0x84aa('0x41')][_0x84aa('0x5b')]()){case _0x84aa('0x42'):cmContact[_0x84aa('0x5f')](this[_0x84aa('0xf')][_0x4f4f0c[_0x84aa('0x39')]],this[_0x84aa('0xe')][_0x1c1a08],_0x31fbdb,_0x4f4f0c);break;case _0x84aa('0x60'):integration['exec'](_0x31fbdb,_0x4f4f0c,this[_0x84aa('0x1c')],this[_0x84aa('0xf')][_0x4f4f0c['interface']],this[_0x84aa('0x61')][_0x4f4f0c[_0x84aa('0x62')]],this['voiceExtensions'][_0x4f4f0c[_0x84aa('0x63')]]);break;case'urlforward':urlforward['exec'](_0x31fbdb,_0x4f4f0c);break;case _0x84aa('0x64'):script['exec'](_0x31fbdb,_0x4f4f0c);break;}}}}}}};Trigger[_0x84aa('0x38')][_0x84aa('0x4b')]=function(_0x1c1204,_0x4c6c6a,_0x5090ec){var _0x31fb85=url[_0x84aa('0x65')](Mustache[_0x84aa('0x49')](_0x1c1204,_0x4c6c6a),!![]);if(_0x5090ec){_[_0x84aa('0x3e')](_0x31fb85[_0x84aa('0x66')],_0x4c6c6a);}delete _0x31fb85['search'];var _0x2d32b5=url[_0x84aa('0x58')](_0x31fb85);_0x2d32b5=_0x2d32b5[_0x84aa('0x67')](/\/\?/g,'?');return _0x2d32b5;};Trigger[_0x84aa('0x38')][_0x84aa('0x3d')]=function(_0x1858db,_0x36ae24){var _0x25b761=!![];var _0x50db66=!![];var _0x3bca62=![];if(_0x1858db['channel']===_0x36ae24[_0x84aa('0x35')]){_0x3bca62=!![];}if(_0x1858db[_0x84aa('0x68')]['length']){_0x25b761=_['every'](_0x1858db[_0x84aa('0x68')],this[_0x84aa('0x69')](_0x36ae24,_0x1858db[_0x84aa('0x6a')]));}if(_0x1858db[_0x84aa('0x6b')][_0x84aa('0x6c')]){_0x50db66=_[_0x84aa('0x6d')](_0x1858db[_0x84aa('0x6b')],this['checkConditions'](_0x36ae24,_0x1858db[_0x84aa('0x6a')]));}return _0x3bca62&&_0x25b761&&_0x50db66;};Trigger[_0x84aa('0x38')][_0x84aa('0x69')]=function(_0x278f7f,_0x5ed240){return function(_0x43c16c){switch(_0x43c16c['field']){case _0x84aa('0x6e'):if(_0x278f7f['channel']===_0x5ed240){if(_0x5ed240===_0x84aa('0x6f')){return _0x278f7f[_0x84aa('0x70')]?operators[_0x43c16c[_0x84aa('0x71')]](Number(_0x43c16c[_0x84aa('0x72')]),_0x278f7f[_0x84aa('0x70')]):![];}else{return _0x278f7f[_[_0x84aa('0x73')](_0x5ed240)+_0x84aa('0x74')]?operators[_0x43c16c[_0x84aa('0x71')]](Number(_0x43c16c['value']),_0x278f7f[_[_0x84aa('0x73')](_0x5ed240)+_0x84aa('0x74')]):![];}}break;case _0x84aa('0x75'):case _0x84aa('0x76'):if(_0x278f7f['channel']===_0x5ed240){return _0x278f7f['event']?operators[_0x43c16c[_0x84aa('0x71')]](_0x43c16c[_0x84aa('0x72')],_0x278f7f[_0x84aa('0x77')]):![];}break;case _0x84aa('0x62'):return _0x278f7f[_0x84aa('0x62')]?operators[_0x43c16c['operator']](_0x43c16c['value'],_0x278f7f['queue']):![];case _0x84aa('0x78'):return _0x278f7f['membername']?operators[_0x43c16c[_0x84aa('0x71')]](_0x43c16c[_0x84aa('0x72')],_0x278f7f[_0x84aa('0x79')]):![];case'lastevent':return _0x278f7f[_0x84aa('0x7a')]?operators[_0x43c16c[_0x84aa('0x71')]](_0x43c16c[_0x84aa('0x72')],_0x278f7f[_0x84aa('0x7a')]):![];case _0x84aa('0x63'):return _0x278f7f[_0x84aa('0x63')]?operators[_0x43c16c['operator']](_0x43c16c[_0x84aa('0x72')],_0x278f7f[_0x84aa('0x63')]):![];}return![];};};module[_0x84aa('0x7b')]=Trigger;
\ No newline at end of file
+var _0x0703=['redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','prototype','emit','stringify','clone','undefined','motionChannel','voice','interface','hasOwnProperty','status','checkTrigger','merge','Actions','length','action','toLowerCase','contactmanager','motionbar','data1','data2','html','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','data5','800','windowHeight','600','winApplication','render','winArguments','format','user:%s','jscripty','name','trigger:%s','exec','integration','routeId','urlforward','script','parse','query','search','replace','every','checkConditions','some','AnyConditions','channel','chat','ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','message','queue','agent','membername','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','trigger','../ami'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0703,0x1d0));var _0x3070=function(_0x59a0e4,_0x492f2c){_0x59a0e4=_0x59a0e4-0x0;var _0x64e2f9=_0x0703[_0x59a0e4];return _0x64e2f9;};'use strict';var util=require(_0x3070('0x0'));var _=require(_0x3070('0x1'));var url=require(_0x3070('0x2'));var Mustache=require(_0x3070('0x3'));var Redis=require(_0x3070('0x4'));var urlforward=require(_0x3070('0x5'));var integration=require(_0x3070('0x6'));var cmContact=require(_0x3070('0x7'));var script=require(_0x3070('0x8'));var config=require(_0x3070('0x9'));var logger=require('../../../config/logger')(_0x3070('0xa'));var ami=require(_0x3070('0xb'));config[_0x3070('0xc')]=_[_0x3070('0xd')](config[_0x3070('0xc')],{'host':_0x3070('0xe'),'port':0x18eb});var io=require(_0x3070('0xf'))(new Redis(config[_0x3070('0xc')]));var operators={'equals':function(_0x5cc9a7,_0x3cf4ff){return _0x5cc9a7==_0x3cf4ff;},'not_equals':function(_0x12c91d,_0x1a0f36){return _0x12c91d!=_0x1a0f36;}};var barAndWebActions=[_0x3070('0x10'),_0x3070('0x2'),'winapp'];function Trigger(_0x2b1a0b){this[_0x3070('0x11')]=_0x2b1a0b['triggers'];this[_0x3070('0x12')]=_0x2b1a0b['agents'];this[_0x3070('0x13')]=_0x2b1a0b[_0x3070('0x13')];this[_0x3070('0x14')]=_0x2b1a0b[_0x3070('0x14')];this[_0x3070('0x15')]=_0x2b1a0b[_0x3070('0x15')];this[_0x3070('0x16')]=_0x2b1a0b[_0x3070('0x16')];this[_0x3070('0x17')]=_0x2b1a0b[_0x3070('0x17')];this[_0x3070('0x18')]=_0x2b1a0b[_0x3070('0x18')];this[_0x3070('0x19')]=_0x2b1a0b['sugarcrmAccounts'];this[_0x3070('0x1a')]=_0x2b1a0b['zohoAccounts'];this['deskAccounts']=_0x2b1a0b[_0x3070('0x1b')];this['vtigerAccounts']=_0x2b1a0b['vtigerAccounts'];this['servicenowAccounts']=_0x2b1a0b[_0x3070('0x1c')];this[_0x3070('0x1d')]=_0x2b1a0b[_0x3070('0x1d')];this[_0x3070('0x1e')]=_0x2b1a0b['freshsalesAccounts'];this[_0x3070('0x1f')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x3070('0x18')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x3070('0x19')],'zoho':this[_0x3070('0x1a')],'desk':this[_0x3070('0x1b')],'vtiger':this[_0x3070('0x20')],'dynamics365':this[_0x3070('0x1d')],'freshsales':this[_0x3070('0x1e')],'servicenow':this[_0x3070('0x1c')]};ami['on'](_0x3070('0x21'),this[_0x3070('0x22')][_0x3070('0x23')](this));ami['on'](_0x3070('0x24'),this['syncCustomEvent'][_0x3070('0x23')](this));ami['on'](_0x3070('0x25'),this[_0x3070('0x22')]['bind'](this));ami['on'](_0x3070('0x26'),this['syncCustomEvent'][_0x3070('0x23')](this));ami['on'](_0x3070('0x27'),this[_0x3070('0x22')][_0x3070('0x23')](this));ami['on'](_0x3070('0x28'),this[_0x3070('0x22')][_0x3070('0x23')](this));ami['on']('custom:agentbusy',this[_0x3070('0x22')][_0x3070('0x23')](this));ami['on'](_0x3070('0x29'),this[_0x3070('0x22')]['bind'](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0x3070('0x23')](this));ami['on'](_0x3070('0x2a'),this[_0x3070('0x22')][_0x3070('0x23')](this));ami['on'](_0x3070('0x2b'),this[_0x3070('0x22')][_0x3070('0x23')](this));ami['on'](_0x3070('0x2c'),this[_0x3070('0x22')][_0x3070('0x23')](this));ami['on'](_0x3070('0x2d'),this['syncAgentDial'][_0x3070('0x23')](this));ami['on'](_0x3070('0x2e'),this[_0x3070('0x2f')][_0x3070('0x23')](this));ami['on'](_0x3070('0x30'),this[_0x3070('0x2f')]['bind'](this));ami['on']('custom:newinteraction',this['syncCustomEvent']['bind'](this));ami['on'](_0x3070('0x31'),this['syncCustomEvent']['bind'](this));ami['on']('custom:substatus',this[_0x3070('0x22')][_0x3070('0x23')](this));ami['on']('custom:incomingmessage',this[_0x3070('0x22')][_0x3070('0x23')](this));ami['on'](_0x3070('0x32'),this[_0x3070('0x22')][_0x3070('0x23')](this));ami['on'](_0x3070('0x33'),this['syncCustomEvent'][_0x3070('0x23')](this));ami['on']('custom:rejectmessage',this[_0x3070('0x22')][_0x3070('0x23')](this));}Trigger[_0x3070('0x34')][_0x3070('0x35')]=function(_0x1aecfa,_0x2bc1d5,_0x307a26){logger['info'](_0x1aecfa,_0x2bc1d5,JSON[_0x3070('0x36')](_0x307a26));io['to'](_0x1aecfa)['emit'](_0x2bc1d5,_0x307a26);};Trigger[_0x3070('0x34')][_0x3070('0x22')]=function(_0xa5f4a7){var _0x5ab2d8=_[_0x3070('0x37')](_0xa5f4a7);if(typeof _0x5ab2d8['motionChannel']===_0x3070('0x38')){_0x5ab2d8[_0x3070('0x39')]=_0x3070('0x3a');}this['checkTriggers'](_0x5ab2d8);};Trigger['prototype'][_0x3070('0x2f')]=function(_0x3edba3){if(this[_0x3070('0x12')][_0x3edba3[_0x3070('0x3b')]]){this['syncCustomEvent'](_0x3edba3);}};Trigger[_0x3070('0x34')]['checkTriggers']=function(_0x40f307){var _0xf9358b;for(var _0x55fd7d in this['triggers']){if(this[_0x3070('0x11')][_0x3070('0x3c')](_0x55fd7d)){if(this[_0x3070('0x11')][_0x55fd7d][_0x3070('0x3d')]){_0xf9358b=this[_0x3070('0x3e')](this['triggers'][_0x55fd7d],_0x40f307);if(_0xf9358b){_[_0x3070('0x3f')](_0x40f307,_0x40f307['variables']);for(var _0x55bba3=0x0,_0x16d403,_0x3404f2,_0x3b4b1a;_0x55bba3<this['triggers'][_0x55fd7d][_0x3070('0x40')][_0x3070('0x41')];_0x55bba3+=0x1){_0x16d403=this['triggers'][_0x55fd7d][_0x3070('0x40')][_0x55bba3];if(this['agents'][_0x40f307['interface']]){switch(_0x16d403[_0x3070('0x42')][_0x3070('0x43')]()){case _0x3070('0x44'):break;case _0x3070('0x45'):case'browser':var _0x164f7d={};switch(barAndWebActions[_0x16d403[_0x3070('0x46')]]){case _0x3070('0x10'):_0x164f7d['TemplateId']=_0x16d403[_0x3070('0x47')];_0x164f7d[_0x3070('0x48')]=this[_0x3070('0x14')][_0x16d403[_0x3070('0x47')]]?Mustache['render'](this['templates'][_0x16d403[_0x3070('0x47')]][_0x3070('0x48')],_0x40f307):_0x3070('0x49');break;case _0x3070('0x2'):_0x164f7d['uri']=this[_0x3070('0x4a')](_0x16d403[_0x3070('0x47')],_0x40f307,_[_0x3070('0x4b')](_0x16d403['data3'])?!![]:parseInt(_0x16d403[_0x3070('0x4c')],0xa));if(_[_0x3070('0x4b')](_0x16d403[_0x3070('0x4d')])){_0x164f7d[_0x3070('0x4e')]='0';}else{_0x164f7d[_0x3070('0x4f')]=_0x16d403[_0x3070('0x4d')];_0x164f7d['windowWidth']=_['isNil'](_0x16d403[_0x3070('0x50')])?_0x3070('0x51'):_0x16d403[_0x3070('0x50')];_0x164f7d[_0x3070('0x52')]=_[_0x3070('0x4b')](_0x16d403['data6'])?_0x3070('0x53'):_0x16d403['data6'];}break;case'winapp':_0x164f7d[_0x3070('0x54')]=_0x16d403[_0x3070('0x47')]?Mustache[_0x3070('0x55')](_0x16d403[_0x3070('0x47')],_0x40f307):'';_0x164f7d[_0x3070('0x56')]=_0x16d403[_0x3070('0x4c')]?Mustache[_0x3070('0x55')](_0x16d403[_0x3070('0x4c')],_0x40f307):'';break;}this[_0x3070('0x35')](util[_0x3070('0x57')](_0x3070('0x58'),this[_0x3070('0x12')][_0x40f307[_0x3070('0x3b')]]['name']),util[_0x3070('0x57')]('trigger:%s:%s',_0x16d403[_0x3070('0x42')][_0x3070('0x43')](),barAndWebActions[_0x16d403['data1']]),_[_0x3070('0x3f')](_0x164f7d,_0x40f307));break;case _0x3070('0x59'):this[_0x3070('0x35')](util[_0x3070('0x57')]('user:%s',this[_0x3070('0x12')][_0x40f307[_0x3070('0x3b')]][_0x3070('0x5a')]),util['format'](_0x3070('0x5b'),_0x16d403[_0x3070('0x42')][_0x3070('0x43')]()),_[_0x3070('0x3f')]({'ProjectId':parseInt(_0x16d403[_0x3070('0x46')],0xa)},_0x40f307));break;default:this[_0x3070('0x35')](util[_0x3070('0x57')]('user:%s',this[_0x3070('0x12')][_0x40f307[_0x3070('0x3b')]][_0x3070('0x5a')]),util[_0x3070('0x57')]('trigger:%s',_0x16d403[_0x3070('0x42')][_0x3070('0x43')]()),_[_0x3070('0x3f')]({},_0x16d403,_0x40f307));}}switch(_0x16d403[_0x3070('0x42')][_0x3070('0x43')]()){case _0x3070('0x44'):cmContact[_0x3070('0x5c')](this[_0x3070('0x12')][_0x40f307[_0x3070('0x3b')]],this[_0x3070('0x11')][_0x55fd7d],_0x16d403,_0x40f307);break;case _0x3070('0x5d'):integration[_0x3070('0x5c')](_0x16d403,_0x40f307,this['accounts'],this['agents'][_0x40f307['interface']],this['voiceQueues'][_0x40f307['queue']],this['voiceExtensions'][_0x40f307[_0x3070('0x5e')]]);break;case _0x3070('0x5f'):urlforward[_0x3070('0x5c')](_0x16d403,_0x40f307);break;case _0x3070('0x60'):script[_0x3070('0x5c')](_0x16d403,_0x40f307);break;}}}}}}};Trigger[_0x3070('0x34')][_0x3070('0x4a')]=function(_0x3fbc1d,_0x57fd49,_0x171b69){var _0x48c545=url[_0x3070('0x61')](Mustache[_0x3070('0x55')](_0x3fbc1d,_0x57fd49),!![]);if(_0x171b69){_[_0x3070('0x3f')](_0x48c545[_0x3070('0x62')],_0x57fd49);}delete _0x48c545[_0x3070('0x63')];var _0x2223cf=url[_0x3070('0x57')](_0x48c545);_0x2223cf=_0x2223cf[_0x3070('0x64')](/\/\?/g,'?');return _0x2223cf;};Trigger[_0x3070('0x34')]['checkTrigger']=function(_0x6938b9,_0x25d6a0){var _0x4f33c5=!![];var _0x5d0481=!![];var _0x3e9dcd=![];if(_0x6938b9['channel']===_0x25d6a0['motionChannel']){_0x3e9dcd=!![];}if(_0x6938b9['AllConditions'][_0x3070('0x41')]){_0x4f33c5=_[_0x3070('0x65')](_0x6938b9['AllConditions'],this[_0x3070('0x66')](_0x25d6a0,_0x6938b9['channel']));}if(_0x6938b9['AnyConditions'][_0x3070('0x41')]){_0x5d0481=_[_0x3070('0x67')](_0x6938b9[_0x3070('0x68')],this['checkConditions'](_0x25d6a0,_0x6938b9['channel']));}return _0x3e9dcd&&_0x4f33c5&&_0x5d0481;};Trigger[_0x3070('0x34')][_0x3070('0x66')]=function(_0x97fd96,_0x4f96d3){return function(_0x4eb7f1){switch(_0x4eb7f1['field']){case'account':if(_0x97fd96[_0x3070('0x69')]===_0x4f96d3){if(_0x4f96d3===_0x3070('0x6a')){return _0x97fd96[_0x3070('0x6b')]?operators[_0x4eb7f1[_0x3070('0x6c')]](Number(_0x4eb7f1[_0x3070('0x6d')]),_0x97fd96[_0x3070('0x6b')]):![];}else{return _0x97fd96[_['upperFirst'](_0x4f96d3)+_0x3070('0x6e')]?operators[_0x4eb7f1[_0x3070('0x6c')]](Number(_0x4eb7f1[_0x3070('0x6d')]),_0x97fd96[_[_0x3070('0x6f')](_0x4f96d3)+'AccountId']):![];}}break;case _0x3070('0x70'):case _0x3070('0x71'):if(_0x97fd96['channel']===_0x4f96d3){return _0x97fd96['event']?operators[_0x4eb7f1[_0x3070('0x6c')]](_0x4eb7f1[_0x3070('0x6d')],_0x97fd96['event']):![];}break;case _0x3070('0x72'):return _0x97fd96[_0x3070('0x72')]?operators[_0x4eb7f1[_0x3070('0x6c')]](_0x4eb7f1['value'],_0x97fd96[_0x3070('0x72')]):![];case _0x3070('0x73'):return _0x97fd96['membername']?operators[_0x4eb7f1[_0x3070('0x6c')]](_0x4eb7f1['value'],_0x97fd96[_0x3070('0x74')]):![];case _0x3070('0x75'):return _0x97fd96[_0x3070('0x75')]?operators[_0x4eb7f1[_0x3070('0x6c')]](_0x4eb7f1['value'],_0x97fd96[_0x3070('0x75')]):![];case'routeId':return _0x97fd96[_0x3070('0x5e')]?operators[_0x4eb7f1[_0x3070('0x6c')]](_0x4eb7f1[_0x3070('0x6d')],_0x97fd96[_0x3070('0x5e')]):![];}return![];};};module[_0x3070('0x76')]=Trigger;
\ No newline at end of file
index 174c4f9..c1eb236 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x43f4f9,_0x394f1b){var _0x5ab5de=function(_0x314353){while(--_0x314353){_0x43f4f9['push'](_0x43f4f9['shift']());}};_0x5ab5de(++_0x394f1b);}(_0x3e74,0x175));var _0x43e7=function(_0x4ec497,_0x44f487){_0x4ec497=_0x4ec497-0x0;var _0xea33f9=_0x3e74[_0x4ec497];return _0xea33f9;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});};
\ No newline at end of file
+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(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x326f,0xd1));var _0xf326=function(_0x595007,_0x3e5e01){_0x595007=_0x595007-0x0;var _0xf2f3da=_0x326f[_0x595007];return _0xf2f3da;};'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 ca8976e..55c2f30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7359=['type','nameField','customField','idField','toLowerCase','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','callDirection','queue','lastIndexOf','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','4.0','value','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','calleridnum','contacts','Bearer\x20','headers','odata-entityid','enduserId','outbound','destcalleridnum','replace','%2b','contactid',']\x20Enduser\x20Created!','forEach','includes','string','picklist'];(function(_0x36644d,_0x2b0bd5){var _0x18617b=function(_0xbb855c){while(--_0xbb855c){_0x36644d['push'](_0x36644d['shift']());}};_0x18617b(++_0x2b0bd5);}(_0x7359,0x167));var _0x9735=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7359[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x9735('0x0'));var BPromise=require(_0x9735('0x1'));var rp=require(_0x9735('0x2'));var util=require(_0x9735('0x3'));var intUtil=require(_0x9735('0x4'));var md5=require(_0x9735('0x5'));var Redis=require(_0x9735('0x6'));var logger=require('../../../../config/logger')(_0x9735('0x7'));var config=require(_0x9735('0x8'));config[_0x9735('0x9')]=_[_0x9735('0xa')](config[_0x9735('0x9')],{'host':_0x9735('0xb'),'port':0x18eb});var io=require(_0x9735('0xc'))(new Redis(config['redis']));function getAuthToken(_0x2475ef,_0x2deb51,_0x5ed3d8){var _0x5ed1a1={'method':_0x9735('0xd'),'uri':_0x2deb51,'form':{'client_id':_0x2475ef[_0x9735('0xe')],'resource':_0x2475ef['remoteUri'],'username':_0x2475ef[_0x9735('0xf')],'password':_0x2475ef[_0x9735('0x10')],'grant_type':_0x9735('0x10'),'client_secret':_0x2475ef['clientSecret']},'json':!![]};return rp(_0x5ed1a1)[_0x9735('0x11')](function(_0x3d2e5a){return _0x3d2e5a[_0x9735('0x12')];})[_0x9735('0x13')](function(_0x615fae){logger[_0x9735('0x14')]('['+[_0x5ed3d8[_0x9735('0x15')]()]+_0x9735('0x16'));return _0x615fae[_0x9735('0x17')];});}function getUser(_0x5b588e,_0x4f4a94,_0x5393cc,_0x53c946,_0x38e382,_0x42f70e){return new BPromise(function(_0x31fb09,_0x4cb4e8){return getAuthToken(_0x4f4a94,_0x53c946,_0x42f70e)[_0x9735('0x11')](function(_0x54fc71){var _0x63b10b={'method':_0x9735('0x18'),'uri':_0x38e382+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x54fc71,'OData-Version':_0x9735('0x19')},'json':!![]};return rp(_0x63b10b);})['then'](function(_0x465b02){var _0x24c25c=_0x465b02[_0x9735('0x1a')];var _0x5e6a51=![];var _0x25d878=null;if(!_['isNil'](_0x5393cc)){if(intUtil['validateEmail'](_0x5393cc[_0x9735('0x1b')])){_0x5b588e[_0x9735('0x1c')]=_0x5393cc[_0x9735('0x1b')];for(_0x25d878=0x0;_0x25d878<_0x24c25c[_0x9735('0x1d')];_0x25d878++){if(_0x24c25c[_0x25d878][_0x9735('0x1e')]===_0x5393cc[_0x9735('0x1b')]&&!_0x24c25c[_0x25d878][_0x9735('0x1f')]){_0x5e6a51=!![];logger[_0x9735('0x20')]('['+[_0x42f70e['toUpperCase']()]+_0x9735('0x21')+_0x24c25c[_0x25d878][_0x9735('0x22')]+'!');_0x5b588e[_0x9735('0x23')]=_0x24c25c[_0x25d878][_0x9735('0x22')];}}}}if(!_0x5e6a51){logger[_0x9735('0x20')]('['+[_0x42f70e[_0x9735('0x15')]()]+_0x9735('0x24'));_0x5b588e[_0x9735('0x1c')]=_0x4f4a94[_0x9735('0xf')];for(_0x25d878=0x0;_0x25d878<_0x24c25c[_0x9735('0x1d')];_0x25d878++){if(_0x24c25c[_0x25d878][_0x9735('0x1e')]===_0x4f4a94['username']){_0x5b588e[_0x9735('0x23')]=_0x24c25c[_0x25d878][_0x9735('0x22')];}}}_0x31fb09(_0x5b588e);})['catch'](function(_0x4e22a0){_0x4cb4e8(_0x4e22a0[_0x9735('0x17')]);});});}function createEndUser(_0x295c82,_0x105d97,_0x4a3062,_0x46b2e9,_0x364d6,_0x46f0b9){return new BPromise(function(_0x3ac1d9,_0x19dc32){return getAuthToken(_0x105d97,_0x4a3062,_0x46f0b9)[_0x9735('0x11')](function(_0xbe536){var _0x34c443=_0x46f0b9['toLowerCase']()==='outbound'?_0x364d6['destcalleridnum']:_0x364d6[_0x9735('0x25')];var _0x23f64a={'method':_0x9735('0xd'),'uri':_0x46b2e9+_0x9735('0x26'),'body':{'telephone1':_0x34c443,'fullname':_0x34c443,'firstname':_0x34c443,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x295c82[_0x9735('0x23')]+')'},'headers':{'Authorization':_0x9735('0x27')+_0xbe536,'OData-Version':_0x9735('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x23f64a);})['then'](function(_0x5106f4){var _0x259d1c=_0x5106f4[_0x9735('0x28')][_0x9735('0x29')];var _0x4dff14=_0x259d1c['substring'](_0x259d1c['lastIndexOf']('(')+0x1,_0x259d1c['lastIndexOf'](')'));_0x295c82[_0x9735('0x2a')]=_0x4dff14;_0x3ac1d9(_0x295c82);})[_0x9735('0x13')](function(_0x18a484){_0x19dc32(_0x18a484[_0x9735('0x17')]);});});}function getEndUser(_0x21646b,_0xcb0343,_0x25a9fb,_0x1f9ddd,_0x8a1177,_0x17e066){return new BPromise(function(_0x1fd961,_0x1292e9){var _0x933c6e=_0x17e066['toLowerCase']()===_0x9735('0x2b')?_0x8a1177[_0x9735('0x2c')]:_0x8a1177[_0x9735('0x25')];return getAuthToken(_0xcb0343,_0x25a9fb,_0x17e066)[_0x9735('0x11')](function(_0x5dffef){var _0xa3af34={'method':_0x9735('0x18'),'uri':_0x1f9ddd+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x933c6e[_0x9735('0x2d')]('+',_0x9735('0x2e'))+'\x27','headers':{'Authorization':_0x9735('0x27')+_0x5dffef,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xa3af34);})[_0x9735('0x11')](function(_0x299174){var _0x5be385=null;if(_0x299174){var _0x213288=_0x299174[_0x9735('0x1a')];var _0xc278d4=![];for(_0x5be385=0x0;_0x5be385<_0x213288[_0x9735('0x1d')];_0x5be385++){if(_0x213288[_0x5be385]['telephone1']===_0x933c6e){_0xc278d4=!![];_0x21646b[_0x9735('0x2a')]=_0x213288[_0x5be385][_0x9735('0x2f')];}}if(_0xc278d4){_0x1fd961(_0x21646b);}else{return createEndUser(_0x21646b,_0xcb0343,_0x25a9fb,_0x1f9ddd,_0x8a1177,_0x17e066)['then'](function(_0x184072){logger[_0x9735('0x20')]('['+[_0x17e066[_0x9735('0x15')]()]+']\x20Enduser\x20created!',_0x184072[_0x9735('0x2a')]);_0x1fd961(_0x184072);});}}else{return createEndUser(_0x21646b,_0xcb0343,_0x25a9fb,_0x1f9ddd,_0x8a1177,_0x17e066)[_0x9735('0x11')](function(_0x21a102){logger['info']('['+[_0x17e066[_0x9735('0x15')]()]+_0x9735('0x30'),_0x21a102[_0x9735('0x2a')]);_0x1fd961(_0x21a102);});}});});}function getCustomFields(_0x496fb4,_0xb356f5,_0x556768){var _0x4b1cb2={};if(_0x496fb4['length']>0x0){_[_0x9735('0x31')](_0x496fb4,function(_0x1798f6){if(_[_0x9735('0x32')]([_0x9735('0x33'),_0x9735('0x34')],_0x1798f6[_0x9735('0x35')])&&_0x1798f6[_0x9735('0x36')]&&!_0x1798f6[_0x9735('0x37')]){var _0x2b51c9=_0x1798f6[_0x9735('0x38')][_0x9735('0x39')]();var _0x212898=_0x2b51c9[_0x9735('0x3a')](0x0,_0x2b51c9[_0x9735('0x3b')]('_'));var _0x411a50=_0x2b51c9['substring'](_0x2b51c9['indexOf']('_')+0x1);if(_0x212898===_0x556768){_0x4b1cb2[_0x411a50]=_0x1798f6[_0x9735('0x3c')];}}});}return _0x4b1cb2;}function getTicket(_0x2634df,_0x2d5d5b,_0x90ec9b,_0x3f5896,_0x187449,_0x423682,_0x220bf0){return new BPromise(function(_0x29b732,_0xf1fdc6){var _0x2328df;return getAuthToken(_0x2d5d5b,_0x90ec9b,_0x220bf0)[_0x9735('0x11')](function(_0x1c9fb6){if(_0x423682[_0x9735('0x3d')]===_0x9735('0x3e')){_0x2328df={'method':_0x9735('0xd'),'uri':_0x3f5896+_0x9735('0x3f'),'body':Object[_0x9735('0x40')]({},{'title':intUtil[_0x9735('0x41')](_0x423682[_0x9735('0x42')],_0x187449,'\x20'),'description':intUtil[_0x9735('0x41')](_0x423682[_0x9735('0x43')],_0x187449,'\x0a'),'customerid_contact@odata.bind':_0x9735('0x44')+_0x2634df[_0x9735('0x2a')]+')','ownerid@odata.bind':_0x9735('0x45')+_0x2634df[_0x9735('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x423682[_0x9735('0x46')],_0x187449,_0x423682[_0x9735('0x3d')])),'headers':{'Authorization':'Bearer\x20'+_0x1c9fb6,'OData-Version':_0x9735('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x423682['ticketType']===_0x9735('0x47')){_0x2328df={'method':_0x9735('0xd'),'uri':_0x3f5896+'phonecalls','body':Object['assign']({},{'subject':intUtil['getString'](_0x423682[_0x9735('0x42')],_0x187449,'\x20'),'phonenumber':String(_0x187449['calleridnum']),'description':intUtil[_0x9735('0x41')](_0x423682[_0x9735('0x43')],_0x187449,'\x0a'),'regardingobjectid_contact@odata.bind':_0x9735('0x44')+_0x2634df['enduserId']+')','ownerid@odata.bind':_0x9735('0x45')+_0x2634df[_0x9735('0x23')]+')','directioncode':_0x2634df[_0x9735('0x48')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2634df['userId']+')','participationtypemask':_0x2634df[_0x9735('0x48')]===_0x9735('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x9735('0x44')+_0x2634df[_0x9735('0x2a')]+')','participationtypemask':_0x2634df[_0x9735('0x48')]===_0x9735('0x49')?0x1:0x2}]},getCustomFields(_0x423682[_0x9735('0x46')],_0x187449,_0x423682[_0x9735('0x3d')])),'headers':{'Authorization':_0x9735('0x27')+_0x1c9fb6,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2328df);})[_0x9735('0x11')](function(_0x4aedf3){var _0x3395a1=_0x4aedf3[_0x9735('0x28')]['odata-entityid'];var _0x1e4d94=_0x3395a1[_0x9735('0x3a')](_0x3395a1[_0x9735('0x4a')]('(')+0x1,_0x3395a1[_0x9735('0x4a')](')'));_0x2634df[_0x9735('0x4b')]=_0x1e4d94;_0x29b732(_0x2634df);})[_0x9735('0x13')](function(_0x5ab875){_0xf1fdc6(_0x5ab875[_0x9735('0x17')]);});});}function emit(_0x59a44f,_0x1dee5a,_0x2a258f,_0x76e899){var _0x356826={'uri':util[_0x9735('0x4c')](_0x9735('0x4d'),_0x59a44f,_0x2a258f,_0x76e899)};io['to'](util[_0x9735('0x4c')](_0x9735('0x4e'),_0x1dee5a))[_0x9735('0x4f')](_0x9735('0x50'),_0x356826);}exports['cs']=function(_0x42c8ae,_0x5ed3b9,_0x5b9c98,_0xe1680e,_0x3cb8e3,_0x31b706,_0x757971,_0x48eba3){var _0x980344={};_0x31b706[_0x9735('0x51')]=intUtil['stripTrailingSlash'](_0x31b706[_0x9735('0x51')]);_0x31b706['serverUrl']=intUtil[_0x9735('0x52')](_0x31b706[_0x9735('0x53')]);_0x980344[_0x9735('0x48')]=_0x48eba3===_0x9735('0x49')||_0x48eba3===_0x9735('0x54')?_0x9735('0x49'):_0x9735('0x2b');var _0xd25f21=util[_0x9735('0x4c')]('%s/api/data/v9.0/',_0x31b706[_0x9735('0x51')]);var _0x325e5b=util['format'](_0x9735('0x55'),_0x31b706[_0x9735('0x56')]);var _0x703634=util['format'](_0x9735('0x57'),_0x31b706[_0x9735('0x53')],_0x5ed3b9[_0x9735('0x58')],md5(_0x5ed3b9[_0x9735('0x58')]));if(_0x3cb8e3&&_0x3cb8e3[_0x9735('0x59')]){logger[_0x9735('0x20')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5ed3b9[_0x9735('0x5a')]=_0x703634;}else if(_0x757971&&_0x757971[_0x9735('0x5b')]&&_0x757971[_0x9735('0x5b')]!==_0x9735('0x5c')){logger[_0x9735('0x20')](_0x9735('0x5d'),_0x9735('0x5e'));_0x5ed3b9['recordingURL']=_0x703634;}else{_0x5ed3b9[_0x9735('0x5a')]='';}return getUser(_0x980344,_0x31b706,_0xe1680e,_0x325e5b,_0xd25f21,_0x48eba3)[_0x9735('0x11')](function(_0x2d3eda){logger[_0x9735('0x20')]('['+_0x48eba3[_0x9735('0x15')]()+_0x9735('0x5f'),_0x2d3eda['userId']);logger['info']('['+_0x48eba3[_0x9735('0x15')]()+_0x9735('0x60'),_0x2d3eda[_0x9735('0x1c')]);return getEndUser(_0x2d3eda,_0x31b706,_0x325e5b,_0xd25f21,_0x5ed3b9,_0x48eba3);})[_0x9735('0x11')](function(_0x1954a2){logger[_0x9735('0x20')]('['+_0x48eba3[_0x9735('0x15')]()+_0x9735('0x61'),_0x1954a2[_0x9735('0x2a')]);logger[_0x9735('0x20')]('['+_0x48eba3[_0x9735('0x15')]()+_0x9735('0x62'),_0x5ed3b9[_0x9735('0x25')]);return getTicket(_0x1954a2,_0x31b706,_0x325e5b,_0xd25f21,_0x5ed3b9,_0x5b9c98,_0x48eba3);})[_0x9735('0x11')](function(_0xbe5904){logger[_0x9735('0x20')](util['format']('['+_0x48eba3[_0x9735('0x15')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x5b9c98[_0x9735('0x3d')],_0xbe5904[_0x9735('0x4b')]));logger[_0x9735('0x20')](util[_0x9735('0x4c')]('['+_0x48eba3[_0x9735('0x15')]()+_0x9735('0x63'),_0x48eba3));if(_0x48eba3!==_0x9735('0x54')){logger[_0x9735('0x20')]('['+_0x48eba3[_0x9735('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x31b706[_0x9735('0x51')],_0xe1680e[_0x9735('0x64')],_0x5b9c98[_0x9735('0x3d')],_0xbe5904[_0x9735('0x4b')]);}})[_0x9735('0x13')](function(_0x1976df){logger[_0x9735('0x14')]('['+_0x48eba3[_0x9735('0x15')]()+_0x9735('0x65'),util[_0x9735('0x66')](_0x1976df,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x4859=['callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','access_token','catch','error','toUpperCase','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','contactid','info',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','type','customField','idField','indexOf','content','incidents','Subjects','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls'];(function(_0x1f1146,_0xbc0dad){var _0x34f57d=function(_0x1dee02){while(--_0x1dee02){_0x1f1146['push'](_0x1f1146['shift']());}};_0x34f57d(++_0xbc0dad);}(_0x4859,0xf3));var _0x9485=function(_0x3e8859,_0x909b61){_0x3e8859=_0x3e8859-0x0;var _0x41d468=_0x4859[_0x3e8859];return _0x41d468;};'use strict';var _=require(_0x9485('0x0'));var BPromise=require(_0x9485('0x1'));var rp=require(_0x9485('0x2'));var util=require(_0x9485('0x3'));var intUtil=require(_0x9485('0x4'));var md5=require(_0x9485('0x5'));var Redis=require(_0x9485('0x6'));var logger=require('../../../../config/logger')(_0x9485('0x7'));var config=require(_0x9485('0x8'));config[_0x9485('0x9')]=_[_0x9485('0xa')](config[_0x9485('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x9485('0xb'))(new Redis(config[_0x9485('0x9')]));function getAuthToken(_0x3a799e,_0x1395db,_0x32bcfd){var _0x308549={'method':_0x9485('0xc'),'uri':_0x1395db,'form':{'client_id':_0x3a799e[_0x9485('0xd')],'resource':_0x3a799e[_0x9485('0xe')],'username':_0x3a799e[_0x9485('0xf')],'password':_0x3a799e[_0x9485('0x10')],'grant_type':_0x9485('0x10'),'client_secret':_0x3a799e[_0x9485('0x11')]},'json':!![]};return rp(_0x308549)['then'](function(_0xeb35c8){return _0xeb35c8[_0x9485('0x12')];})[_0x9485('0x13')](function(_0xed8b5b){logger[_0x9485('0x14')]('['+[_0x32bcfd[_0x9485('0x15')]()]+']\x20Wrong\x20credentials!');return _0xed8b5b[_0x9485('0x16')];});}function getUser(_0x2f7557,_0x48f680,_0x5c7783,_0x40e030,_0x562f42,_0x316cd5){return new BPromise(function(_0x4103bf,_0x449e9f){return getAuthToken(_0x48f680,_0x40e030,_0x316cd5)[_0x9485('0x17')](function(_0x262979){var _0x246c9a={'method':_0x9485('0x18'),'uri':_0x562f42+_0x9485('0x19'),'headers':{'Authorization':_0x9485('0x1a')+_0x262979,'OData-Version':_0x9485('0x1b')},'json':!![]};return rp(_0x246c9a);})['then'](function(_0xe131cd){var _0x4cc3dc=_0xe131cd[_0x9485('0x1c')];var _0x57c318=![];var _0x236135=null;if(!_[_0x9485('0x1d')](_0x5c7783)){if(intUtil[_0x9485('0x1e')](_0x5c7783[_0x9485('0x1f')])){_0x2f7557[_0x9485('0x20')]=_0x5c7783[_0x9485('0x1f')];for(_0x236135=0x0;_0x236135<_0x4cc3dc[_0x9485('0x21')];_0x236135++){if(_0x4cc3dc[_0x236135][_0x9485('0x22')]===_0x5c7783['email']&&!_0x4cc3dc[_0x236135][_0x9485('0x23')]){_0x57c318=!![];logger['info']('['+[_0x316cd5[_0x9485('0x15')]()]+_0x9485('0x24')+_0x4cc3dc[_0x236135][_0x9485('0x25')]+'!');_0x2f7557[_0x9485('0x26')]=_0x4cc3dc[_0x236135][_0x9485('0x25')];}}}}if(!_0x57c318){logger['info']('['+[_0x316cd5[_0x9485('0x15')]()]+_0x9485('0x27'));_0x2f7557['userEmail']=_0x48f680[_0x9485('0xf')];for(_0x236135=0x0;_0x236135<_0x4cc3dc['length'];_0x236135++){if(_0x4cc3dc[_0x236135][_0x9485('0x22')]===_0x48f680['username']){_0x2f7557[_0x9485('0x26')]=_0x4cc3dc[_0x236135][_0x9485('0x25')];}}}_0x4103bf(_0x2f7557);})[_0x9485('0x13')](function(_0xc360d0){_0x449e9f(_0xc360d0[_0x9485('0x16')]);});});}function createEndUser(_0x279694,_0x6bd413,_0x30c4d6,_0x651d92,_0x4414ce,_0x294291){return new BPromise(function(_0x3eafb1,_0x544be4){return getAuthToken(_0x6bd413,_0x30c4d6,_0x294291)[_0x9485('0x17')](function(_0x2a8b4b){var _0x43b86b=_0x294291[_0x9485('0x28')]()===_0x9485('0x29')?_0x4414ce[_0x9485('0x2a')]:_0x4414ce[_0x9485('0x2b')];var _0x2d8af2={'method':_0x9485('0xc'),'uri':_0x651d92+_0x9485('0x2c'),'body':{'telephone1':_0x43b86b,'fullname':_0x43b86b,'firstname':_0x43b86b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x9485('0x2d')+_0x279694[_0x9485('0x26')]+')'},'headers':{'Authorization':_0x9485('0x1a')+_0x2a8b4b,'OData-Version':_0x9485('0x1b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2d8af2);})[_0x9485('0x17')](function(_0x24bd00){var _0x5bc16d=_0x24bd00[_0x9485('0x2e')][_0x9485('0x2f')];var _0x4b9681=_0x5bc16d[_0x9485('0x30')](_0x5bc16d[_0x9485('0x31')]('(')+0x1,_0x5bc16d[_0x9485('0x31')](')'));_0x279694[_0x9485('0x32')]=_0x4b9681;_0x3eafb1(_0x279694);})[_0x9485('0x13')](function(_0x448a46){_0x544be4(_0x448a46['message']);});});}function getEndUser(_0x2b5980,_0x1ae37c,_0x474de7,_0x4a5c2c,_0x30a0f6,_0xb5c775){return new BPromise(function(_0x7e317f,_0x41b3c0){var _0x19bf6a=_0xb5c775[_0x9485('0x28')]()==='outbound'?_0x30a0f6[_0x9485('0x2a')]:_0x30a0f6[_0x9485('0x2b')];return getAuthToken(_0x1ae37c,_0x474de7,_0xb5c775)['then'](function(_0x4fb05d){var _0x1989b5={'method':_0x9485('0x18'),'uri':_0x4a5c2c+_0x9485('0x33')+_0x19bf6a[_0x9485('0x34')]('+',_0x9485('0x35'))+'\x27','headers':{'Authorization':_0x9485('0x1a')+_0x4fb05d,'If-None-Match':null,'OData-Version':_0x9485('0x1b')},'json':!![]};return rp(_0x1989b5);})[_0x9485('0x17')](function(_0x367d9c){var _0x28b086=null;if(_0x367d9c){var _0x54e09e=_0x367d9c['value'];var _0x2fbd69=![];for(_0x28b086=0x0;_0x28b086<_0x54e09e[_0x9485('0x21')];_0x28b086++){if(_0x54e09e[_0x28b086]['telephone1']===_0x19bf6a){_0x2fbd69=!![];_0x2b5980['enduserId']=_0x54e09e[_0x28b086][_0x9485('0x36')];}}if(_0x2fbd69){_0x7e317f(_0x2b5980);}else{return createEndUser(_0x2b5980,_0x1ae37c,_0x474de7,_0x4a5c2c,_0x30a0f6,_0xb5c775)[_0x9485('0x17')](function(_0xca8e4f){logger[_0x9485('0x37')]('['+[_0xb5c775[_0x9485('0x15')]()]+_0x9485('0x38'),_0xca8e4f[_0x9485('0x32')]);_0x7e317f(_0xca8e4f);});}}else{return createEndUser(_0x2b5980,_0x1ae37c,_0x474de7,_0x4a5c2c,_0x30a0f6,_0xb5c775)[_0x9485('0x17')](function(_0x1b6e64){logger[_0x9485('0x37')]('['+[_0xb5c775['toUpperCase']()]+_0x9485('0x39'),_0x1b6e64[_0x9485('0x32')]);_0x7e317f(_0x1b6e64);});}});});}function getCustomFields(_0x3779a0,_0x1550ee,_0x2a9bfc){var _0x479f1e={};if(_0x3779a0['length']>0x0){_[_0x9485('0x3a')](_0x3779a0,function(_0x92d431){if(_[_0x9485('0x3b')]([_0x9485('0x3c'),'picklist'],_0x92d431[_0x9485('0x3d')])&&_0x92d431['nameField']&&!_0x92d431[_0x9485('0x3e')]){var _0xd12447=_0x92d431[_0x9485('0x3f')][_0x9485('0x28')]();var _0x5af48e=_0xd12447['substring'](0x0,_0xd12447['indexOf']('_'));var _0x581a63=_0xd12447['substring'](_0xd12447[_0x9485('0x40')]('_')+0x1);if(_0x5af48e===_0x2a9bfc){_0x479f1e[_0x581a63]=_0x92d431[_0x9485('0x41')];}}});}return _0x479f1e;}function getTicket(_0x4f7994,_0x3ee832,_0x17adc0,_0xf971c7,_0x2bdeaa,_0x8b8ed4,_0x46ab5e){return new BPromise(function(_0x596f63,_0x50ea8d){var _0x1cd44b;return getAuthToken(_0x3ee832,_0x17adc0,_0x46ab5e)['then'](function(_0x531524){if(_0x8b8ed4['ticketType']==='incident'){_0x1cd44b={'method':_0x9485('0xc'),'uri':_0xf971c7+_0x9485('0x42'),'body':Object['assign']({},{'title':intUtil['getString'](_0x8b8ed4[_0x9485('0x43')],_0x2bdeaa,'\x20'),'description':intUtil[_0x9485('0x44')](_0x8b8ed4[_0x9485('0x45')],_0x2bdeaa,'\x0a'),'customerid_contact@odata.bind':_0x9485('0x46')+_0x4f7994[_0x9485('0x32')]+')','ownerid@odata.bind':_0x9485('0x2d')+_0x4f7994[_0x9485('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x8b8ed4[_0x9485('0x47')],_0x2bdeaa,_0x8b8ed4[_0x9485('0x48')])),'headers':{'Authorization':_0x9485('0x1a')+_0x531524,'OData-Version':_0x9485('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x8b8ed4[_0x9485('0x48')]===_0x9485('0x49')){_0x1cd44b={'method':_0x9485('0xc'),'uri':_0xf971c7+_0x9485('0x4a'),'body':Object['assign']({},{'subject':intUtil[_0x9485('0x44')](_0x8b8ed4[_0x9485('0x43')],_0x2bdeaa,'\x20'),'phonenumber':String(_0x2bdeaa[_0x9485('0x2b')]),'description':intUtil[_0x9485('0x44')](_0x8b8ed4[_0x9485('0x45')],_0x2bdeaa,'\x0a'),'regardingobjectid_contact@odata.bind':_0x9485('0x46')+_0x4f7994[_0x9485('0x32')]+')','ownerid@odata.bind':'/systemusers('+_0x4f7994[_0x9485('0x26')]+')','directioncode':_0x4f7994[_0x9485('0x4b')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x9485('0x2d')+_0x4f7994[_0x9485('0x26')]+')','participationtypemask':_0x4f7994[_0x9485('0x4b')]===_0x9485('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x9485('0x46')+_0x4f7994[_0x9485('0x32')]+')','participationtypemask':_0x4f7994['callDirection']===_0x9485('0x4c')?0x1:0x2}]},getCustomFields(_0x8b8ed4[_0x9485('0x47')],_0x2bdeaa,_0x8b8ed4['ticketType'])),'headers':{'Authorization':_0x9485('0x1a')+_0x531524,'OData-Version':_0x9485('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1cd44b);})[_0x9485('0x17')](function(_0x406290){var _0x2d4872=_0x406290[_0x9485('0x2e')][_0x9485('0x2f')];var _0x3d867f=_0x2d4872[_0x9485('0x30')](_0x2d4872[_0x9485('0x31')]('(')+0x1,_0x2d4872[_0x9485('0x31')](')'));_0x4f7994[_0x9485('0x4d')]=_0x3d867f;_0x596f63(_0x4f7994);})[_0x9485('0x13')](function(_0x3e30f8){_0x50ea8d(_0x3e30f8['message']);});});}function emit(_0x1bf1f0,_0x39b557,_0x5e0ab2,_0x28620){var _0x4a5793={'uri':util[_0x9485('0x4e')](_0x9485('0x4f'),_0x1bf1f0,_0x5e0ab2,_0x28620)};io['to'](util[_0x9485('0x4e')](_0x9485('0x50'),_0x39b557))[_0x9485('0x51')](_0x9485('0x52'),_0x4a5793);}exports['cs']=function(_0x21c704,_0x2b6045,_0x5e32a7,_0x1c66a3,_0x40baa4,_0x1069e9,_0x36c1bc,_0x20c0dc){var _0x3453d5={};_0x1069e9[_0x9485('0xe')]=intUtil[_0x9485('0x53')](_0x1069e9[_0x9485('0xe')]);_0x1069e9[_0x9485('0x54')]=intUtil[_0x9485('0x53')](_0x1069e9[_0x9485('0x54')]);_0x3453d5['callDirection']=_0x20c0dc==='queue'||_0x20c0dc===_0x9485('0x55')?'queue':_0x9485('0x29');var _0x28d136=util[_0x9485('0x4e')](_0x9485('0x56'),_0x1069e9[_0x9485('0xe')]);var _0x37fcc4=util[_0x9485('0x4e')](_0x9485('0x57'),_0x1069e9[_0x9485('0x58')]);var _0x4f5309=util[_0x9485('0x4e')](_0x9485('0x59'),_0x1069e9[_0x9485('0x54')],_0x2b6045['uniqueid'],md5(_0x2b6045[_0x9485('0x5a')]));if(_0x40baa4&&_0x40baa4[_0x9485('0x5b')]){logger[_0x9485('0x37')](_0x9485('0x5c'),_0x9485('0x5d'));_0x2b6045[_0x9485('0x5e')]=_0x4f5309;}else if(_0x36c1bc&&_0x36c1bc[_0x9485('0x5f')]&&_0x36c1bc[_0x9485('0x5f')]!=='none'){logger[_0x9485('0x37')](_0x9485('0x60'),'Recording\x20is\x20enabled!');_0x2b6045['recordingURL']=_0x4f5309;}else{_0x2b6045[_0x9485('0x5e')]='';}return getUser(_0x3453d5,_0x1069e9,_0x1c66a3,_0x37fcc4,_0x28d136,_0x20c0dc)[_0x9485('0x17')](function(_0x5b6827){logger[_0x9485('0x37')]('['+_0x20c0dc[_0x9485('0x15')]()+_0x9485('0x61'),_0x5b6827[_0x9485('0x26')]);logger[_0x9485('0x37')]('['+_0x20c0dc[_0x9485('0x15')]()+_0x9485('0x62'),_0x5b6827[_0x9485('0x20')]);return getEndUser(_0x5b6827,_0x1069e9,_0x37fcc4,_0x28d136,_0x2b6045,_0x20c0dc);})[_0x9485('0x17')](function(_0x5e6f95){logger[_0x9485('0x37')]('['+_0x20c0dc['toUpperCase']()+_0x9485('0x63'),_0x5e6f95[_0x9485('0x32')]);logger['info']('['+_0x20c0dc[_0x9485('0x15')]()+_0x9485('0x64'),_0x2b6045[_0x9485('0x2b')]);return getTicket(_0x5e6f95,_0x1069e9,_0x37fcc4,_0x28d136,_0x2b6045,_0x5e32a7,_0x20c0dc);})['then'](function(_0x15ea8d){logger[_0x9485('0x37')](util['format']('['+_0x20c0dc[_0x9485('0x15')]()+_0x9485('0x65'),_0x5e32a7[_0x9485('0x48')],_0x15ea8d['ticketId']));logger['info'](util[_0x9485('0x4e')]('['+_0x20c0dc[_0x9485('0x15')]()+_0x9485('0x66'),_0x20c0dc));if(_0x20c0dc!=='unmanaged'){logger['info']('['+_0x20c0dc[_0x9485('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1069e9[_0x9485('0xe')],_0x1c66a3[_0x9485('0x67')],_0x5e32a7[_0x9485('0x48')],_0x15ea8d[_0x9485('0x4d')]);}})[_0x9485('0x13')](function(_0x580c30){logger[_0x9485('0x14')]('['+_0x20c0dc['toUpperCase']()+_0x9485('0x68'),util[_0x9485('0x69')](_0x580c30,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index b02a733..fef06f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49e1=['variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','socket.io-emitter','application/json','emit','info','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','<br>','Tags','Fields','mapValues','custom_fields','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable'];(function(_0x227cd2,_0x15a7c0){var _0x52763e=function(_0x430a2e){while(--_0x430a2e){_0x227cd2['push'](_0x227cd2['shift']());}};_0x52763e(++_0x15a7c0);}(_0x49e1,0x80));var _0x149e=function(_0xb4ddae,_0x3f50f4){_0xb4ddae=_0xb4ddae-0x0;var _0x596270=_0x49e1[_0xb4ddae];return _0x596270;};'use strict';var _=require(_0x149e('0x0'));var rp=require(_0x149e('0x1'));var md5=require('md5');var util=require(_0x149e('0x2'));var Redis=require(_0x149e('0x3'));var intUtil=require(_0x149e('0x4'));var config=require(_0x149e('0x5'));var logger=require(_0x149e('0x6'))(_0x149e('0x7'));config[_0x149e('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x149e('0x9'))(new Redis(config[_0x149e('0x8')]));var headers={'Content-Type':_0x149e('0xa'),'Accept':_0x149e('0xa')};function emit(_0x49413f,_0x5887ee,_0x5151f6){io['to'](_0x49413f)[_0x149e('0xb')](_0x5887ee,_0x5151f6);}function getTicket(_0x1d8a9f,_0x334f3c,_0x52a112,_0x3dde4b,_0x1a2cfb){logger[_0x149e('0xc')]('Creating\x20new\x20ticket...');var _0x31d4d4=_['merge']({'responder_id':_0x334f3c['id'],'requester_id':_0x52a112['id'],'name':util[_0x149e('0xd')](_0x149e('0xe'),_0x1a2cfb[_0x149e('0xf')]),'phone':_0x1a2cfb['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x149e('0x10')](_0x3dde4b[_0x149e('0x11')],_0x1a2cfb,'\x20'),'description':intUtil[_0x149e('0x10')](_0x3dde4b[_0x149e('0x12')],_0x1a2cfb,_0x149e('0x13')),'tags':getTags(_0x3dde4b[_0x149e('0x14')],'name')},getCustomFields(_0x3dde4b[_0x149e('0x15')],_0x1a2cfb));_0x31d4d4['custom_fields']=_[_0x149e('0x16')](_['keyBy'](_0x31d4d4[_0x149e('0x17')],'id'),'value');return request({'uri':util[_0x149e('0xd')](_0x149e('0x18'),_0x1d8a9f[_0x149e('0x19')]),'method':_0x149e('0x1a'),'body':_0x31d4d4})[_0x149e('0x1b')](function(_0x23dbea){logger[_0x149e('0xc')](_0x149e('0x1c'));return _0x23dbea;});}function getUser(_0x2f5202,_0x250add){if(intUtil[_0x149e('0x1d')](_0x250add)){return request({'uri':util['format'](_0x149e('0x1e'),_0x2f5202['remoteUri']),'qs':{'email':_0x250add}})['then'](function(_0x56b18a){if(_0x56b18a[_0x149e('0x1f')]){logger[_0x149e('0xc')](_0x149e('0x20'));return _[_0x149e('0x21')](_0x56b18a,function(_0x5aa6c9){return _0x5aa6c9[_0x149e('0x22')]['email']===_0x250add;});}else{logger[_0x149e('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x149e('0x23'),_0x2f5202[_0x149e('0x19')])})['then'](function(_0x1459b2){logger[_0x149e('0xc')](_0x149e('0x24'));return _0x1459b2;});}});}else{logger['info'](_0x149e('0x25'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x2f5202[_0x149e('0x19')])})[_0x149e('0x1b')](function(_0x334be5){logger['info']('Admin\x20account\x20selected.');return _0x334be5;});}}function getEndUser(_0x2297ca,_0x344c51,_0x3216c8){logger[_0x149e('0xc')](_0x149e('0x26'),_0x3216c8);return request({'uri':util[_0x149e('0xd')](_0x149e('0x27'),_0x2297ca[_0x149e('0x19')]),'qs':{'phone':_0x3216c8}})[_0x149e('0x1b')](function(_0x421ab7){if(_0x421ab7[_0x149e('0x1f')]){logger['info'](_0x149e('0x28'));return _[_0x149e('0x21')](_0x421ab7,{'phone':_0x3216c8});}else{logger[_0x149e('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/api/v2/contacts',_0x2297ca[_0x149e('0x19')]),'method':_0x149e('0x1a'),'body':{'name':_0x344c51,'phone':_0x3216c8}})['then'](function(_0x4ceb8d){logger['info'](_0x149e('0x29'));return _0x4ceb8d;});}});}function getAuth(_0x50657){return util[_0x149e('0xd')](_0x149e('0x2a'),new Buffer(_0x50657[_0x149e('0x2b')]+':X')[_0x149e('0x2c')](_0x149e('0x2d')));}function request(_0x3ef57b){logger[_0x149e('0x2e')](_0x149e('0x2f'),JSON[_0x149e('0x30')](_0x3ef57b));return rp(_[_0x149e('0x31')](_0x3ef57b,{'method':_0x149e('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x5b366e,_0x552631){var _0x3bd329=[];if(_0x5b366e&&_0x5b366e['length']>0x0){_0x3bd329=_[_0x149e('0x33')](_0x5b366e,_0x552631);}return _0x3bd329;}function getCustomFields(_0xf0f665,_0xb6063b){var _0x7c1695=[];var _0x2712f7={'custom_fields':[]};if(_0xf0f665[_0x149e('0x1f')]>0x0){_[_0x149e('0x34')](_0xf0f665,function(_0x1ee037){if(_[_0x149e('0x35')]([_0x149e('0x36'),_0x149e('0x37')],_0x1ee037[_0x149e('0x38')])&&_0x1ee037[_0x149e('0x39')]&&!_0x1ee037[_0x149e('0x3a')]){_0x2712f7[_0x1ee037['nameField'][_0x149e('0x3b')]()]=_0x1ee037[_0x149e('0x3c')][_0x149e('0x2c')]();}else if(_['includes']([_0x149e('0x36'),_0x149e('0x37')],_0x1ee037[_0x149e('0x38')])&&_0x1ee037[_0x149e('0x3d')]&&_0x1ee037[_0x149e('0x3a')]){_0x2712f7[_0x149e('0x17')][_0x149e('0x3e')]({'id':_0x1ee037['idField'],'value':_0x1ee037['content'][_0x149e('0x2c')]()});}else if(_0x1ee037[_0x149e('0x38')]===_0x149e('0x3f')&&_0x1ee037[_0x149e('0x40')]&&_0x1ee037[_0x149e('0x3d')]&&_0x1ee037['customField']){_0xb6063b[_0x1ee037['variableName']]&&_0x2712f7[_0x149e('0x17')][_0x149e('0x3e')]({'id':_0x1ee037[_0x149e('0x3d')],'value':_0xb6063b[_0x1ee037['variableName']]['toString']()});}else if(_0x1ee037[_0x149e('0x38')]===_0x149e('0x41')&&_0x1ee037[_0x149e('0x42')]&&_0x1ee037[_0x149e('0x42')][_0x149e('0x43')]&&_0x1ee037[_0x149e('0x3d')]&&_0x1ee037[_0x149e('0x3a')]){_0xb6063b[_0x1ee037[_0x149e('0x42')][_0x149e('0x43')][_0x149e('0x3b')]()]&&_0x2712f7['custom_fields'][_0x149e('0x3e')]({'id':_0x1ee037['idField'],'value':_0xb6063b[_0x1ee037[_0x149e('0x42')][_0x149e('0x43')]['toLowerCase']()][_0x149e('0x2c')]()});}});}return _0x2712f7;}exports[_0x149e('0x44')]=function(_0x204a59,_0x5f0ed8,_0x42249d,_0x4623ef,_0x447946,_0x2a7e7f){var _0xfc33a6,_0x6a8532;_0x2a7e7f[_0x149e('0x19')]=intUtil[_0x149e('0x45')](_0x2a7e7f[_0x149e('0x19')]);_0x2a7e7f[_0x149e('0x46')]=intUtil[_0x149e('0x45')](_0x2a7e7f[_0x149e('0x46')]);if(_0x447946&&_0x447946[_0x149e('0x47')]){logger[_0x149e('0xc')](_0x149e('0x48'),_0x149e('0x49'));_0x5f0ed8['recordingURL']=util[_0x149e('0xd')](_0x149e('0x4a'),_0x2a7e7f['serverUrl'],_0x5f0ed8[_0x149e('0x4b')],md5(_0x5f0ed8['uniqueid']));}else{_0x5f0ed8[_0x149e('0x4c')]='';}headers[_0x149e('0x4d')]=getAuth(_0x2a7e7f);return getUser(_0x2a7e7f,_0x4623ef[_0x149e('0x4e')])['then'](function(_0x3f1d3d){_0xfc33a6=_0x3f1d3d;logger[_0x149e('0xc')](_0x149e('0x4f'),_0xfc33a6['id']);return getEndUser(_0x2a7e7f,_0x5f0ed8[_0x149e('0xf')],_0x5f0ed8[_0x149e('0x50')]);})[_0x149e('0x1b')](function(_0x261003){_0x6a8532=_0x261003;logger[_0x149e('0xc')](_0x149e('0x51'),_0x6a8532['id']);return getTicket(_0x2a7e7f,_0xfc33a6,_0x6a8532,_0x42249d,_0x5f0ed8);})[_0x149e('0x1b')](function(_0x422642){if(_0x422642&&_0x422642['id']){logger['info'](_0x149e('0x1c'));logger[_0x149e('0xc')](_0x149e('0x52'),_0x422642['id']);logger[_0x149e('0xc')](_0x149e('0x48'),_0x149e('0x53'));emit(util['format'](_0x149e('0x54'),_0x4623ef[_0x149e('0x43')]),_0x149e('0x55'),{'uri':util[_0x149e('0xd')]('%s/helpdesk/tickets/%d',_0x2a7e7f['remoteUri'],_0x422642['id'])});}})[_0x149e('0x56')](function(_0x3dc59a){logger[_0x149e('0x57')]('[QUEUE]',JSON['stringify'](_0x3dc59a));});};exports[_0x149e('0x58')]=function(_0x194f0d,_0x1d7320,_0x1efa5c,_0x211753,_0x746b4a,_0x35abd5,_0x972953){var _0x58004e,_0x1947f4;_0x35abd5[_0x149e('0x19')]=intUtil['stripTrailingSlash'](_0x35abd5[_0x149e('0x19')]);_0x35abd5[_0x149e('0x46')]=intUtil['stripTrailingSlash'](_0x35abd5[_0x149e('0x46')]);if(_0x972953&&_0x972953['recordingFormat']&&_0x972953[_0x149e('0x59')]!==_0x149e('0x5a')){logger[_0x149e('0xc')](_0x149e('0x5b'),_0x149e('0x49'));_0x1d7320['recordingURL']=util[_0x149e('0xd')](_0x149e('0x4a'),_0x35abd5[_0x149e('0x46')],_0x1d7320[_0x149e('0x4b')],md5(_0x1d7320[_0x149e('0x4b')]));}headers[_0x149e('0x4d')]=getAuth(_0x35abd5);return getUser(_0x35abd5,_0x211753[_0x149e('0x4e')])[_0x149e('0x1b')](function(_0x302600){_0x58004e=_0x302600;logger['info'](_0x149e('0x4f'),_0x58004e['id']);return getEndUser(_0x35abd5,_0x1d7320[_0x149e('0x5c')],_0x1d7320['destcalleridnum']);})[_0x149e('0x1b')](function(_0x16ac06){_0x1947f4=_0x16ac06;logger[_0x149e('0xc')](_0x149e('0x51'),_0x1947f4['id']);return getTicket(_0x35abd5,_0x58004e,_0x1947f4,_0x1efa5c,_0x1d7320);})[_0x149e('0x1b')](function(_0x30e9ae){if(_0x30e9ae&&_0x30e9ae['id']){logger[_0x149e('0xc')](_0x149e('0x1c'));logger[_0x149e('0xc')](_0x149e('0x52'),_0x30e9ae['id']);logger[_0x149e('0xc')](_0x149e('0x5b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x149e('0xd')](_0x149e('0x54'),_0x211753['name']),'trigger:browser:url',{'uri':util[_0x149e('0xd')]('%s/helpdesk/tickets/%d',_0x35abd5[_0x149e('0x19')],_0x30e9ae['id'])});}})['catch'](function(_0x4021f6){logger[_0x149e('0x57')](_0x149e('0x5b'),JSON[_0x149e('0x30')](_0x4021f6));});};exports[_0x149e('0x5d')]=function(_0x1ae1e8,_0x290304,_0x2aeb9a,_0x2fdfa7,_0x178772,_0x2ffb92){var _0x51dc33,_0x4e7444;_0x2ffb92['remoteUri']=intUtil[_0x149e('0x45')](_0x2ffb92[_0x149e('0x19')]);_0x2ffb92[_0x149e('0x46')]=intUtil[_0x149e('0x45')](_0x2ffb92[_0x149e('0x46')]);if(_0x178772&&_0x178772['monitor_format']){logger[_0x149e('0xc')]('['+_0x290304[_0x149e('0x5e')][_0x149e('0x5f')]()+']',_0x149e('0x49'));_0x290304[_0x149e('0x4c')]=util[_0x149e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ffb92[_0x149e('0x46')],_0x290304[_0x149e('0x4b')],md5(_0x290304[_0x149e('0x4b')]));}else{_0x290304[_0x149e('0x4c')]='';}headers[_0x149e('0x4d')]=getAuth(_0x2ffb92);return getUser(_0x2ffb92,'')[_0x149e('0x1b')](function(_0x3a2d14){_0x51dc33=_0x3a2d14;logger['info'](_0x149e('0x4f'),_0x51dc33['id']);return getEndUser(_0x2ffb92,_0x290304[_0x149e('0xf')],_0x290304[_0x149e('0x50')]);})[_0x149e('0x1b')](function(_0x50bcb4){_0x4e7444=_0x50bcb4;logger[_0x149e('0xc')](_0x149e('0x51'),_0x4e7444['id']);return getTicket(_0x2ffb92,_0x51dc33,_0x4e7444,_0x2aeb9a,_0x290304);})[_0x149e('0x1b')](function(_0xbfb56f){if(_0xbfb56f){logger[_0x149e('0xc')](_0x149e('0x1c'));logger[_0x149e('0xc')](_0x149e('0x52'),_0xbfb56f['id']);}})[_0x149e('0x56')](function(_0x8e7ce7){logger['error']('['+_0x290304[_0x149e('0x5e')][_0x149e('0x5f')]()+']',JSON[_0x149e('0x30')](_0x8e7ce7));});};
\ No newline at end of file
+var _0x425f=['md5','util','ioredis','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','<br>','name','mapValues','keyBy','custom_fields','value','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','GET','forEach','includes','string','picklist','type','nameField','toLowerCase','idField','customField','push','content','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','stringify','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','monitor_format','toUpperCase','The\x20Enduser\x20ID\x20is:','lastevent','lodash','request-promise'];(function(_0x36bfdd,_0x425a87){var _0x2f60c0=function(_0x384135){while(--_0x384135){_0x36bfdd['push'](_0x36bfdd['shift']());}};_0x2f60c0(++_0x425a87);}(_0x425f,0x15e));var _0xf425=function(_0x4dfe14,_0x52db14){_0x4dfe14=_0x4dfe14-0x0;var _0x504843=_0x425f[_0x4dfe14];return _0x504843;};'use strict';var _=require(_0xf425('0x0'));var rp=require(_0xf425('0x1'));var md5=require(_0xf425('0x2'));var util=require(_0xf425('0x3'));var Redis=require(_0xf425('0x4'));var intUtil=require('./util');var config=require(_0xf425('0x5'));var logger=require('../../../../config/logger')('freshdesk');config['redis']=_[_0xf425('0x6')](config[_0xf425('0x7')],{'host':_0xf425('0x8'),'port':0x18eb});var io=require(_0xf425('0x9'))(new Redis(config[_0xf425('0x7')]));var headers={'Content-Type':'application/json','Accept':_0xf425('0xa')};function emit(_0x3672a6,_0x1031bd,_0x14a55e){io['to'](_0x3672a6)[_0xf425('0xb')](_0x1031bd,_0x14a55e);}function getTicket(_0x2d5078,_0x5ab973,_0x1f5337,_0x33bb6b,_0x2bcf1d){logger[_0xf425('0xc')](_0xf425('0xd'));var _0x2b843f=_['merge']({'responder_id':_0x5ab973['id'],'requester_id':_0x1f5337['id'],'name':util[_0xf425('0xe')](_0xf425('0xf'),_0x2bcf1d[_0xf425('0x10')]),'phone':_0x2bcf1d[_0xf425('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf425('0x12')](_0x33bb6b[_0xf425('0x13')],_0x2bcf1d,'\x20'),'description':intUtil['getString'](_0x33bb6b[_0xf425('0x14')],_0x2bcf1d,_0xf425('0x15')),'tags':getTags(_0x33bb6b['Tags'],_0xf425('0x16'))},getCustomFields(_0x33bb6b['Fields'],_0x2bcf1d));_0x2b843f['custom_fields']=_[_0xf425('0x17')](_[_0xf425('0x18')](_0x2b843f[_0xf425('0x19')],'id'),_0xf425('0x1a'));return request({'uri':util[_0xf425('0xe')]('%s/api/v2/tickets',_0x2d5078[_0xf425('0x1b')]),'method':_0xf425('0x1c'),'body':_0x2b843f})[_0xf425('0x1d')](function(_0x3979e3){logger[_0xf425('0xc')](_0xf425('0x1e'));return _0x3979e3;});}function getUser(_0xea88a4,_0xe7466d){if(intUtil['validateEmail'](_0xe7466d)){return request({'uri':util[_0xf425('0xe')](_0xf425('0x1f'),_0xea88a4[_0xf425('0x1b')]),'qs':{'email':_0xe7466d}})[_0xf425('0x1d')](function(_0x51368a){if(_0x51368a[_0xf425('0x20')]){logger[_0xf425('0xc')](_0xf425('0x21'));return _[_0xf425('0x22')](_0x51368a,function(_0x30c15c){return _0x30c15c[_0xf425('0x23')][_0xf425('0x24')]===_0xe7466d;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf425('0xe')](_0xf425('0x25'),_0xea88a4[_0xf425('0x1b')])})['then'](function(_0x41b6a9){logger[_0xf425('0xc')](_0xf425('0x26'));return _0x41b6a9;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xf425('0x25'),_0xea88a4[_0xf425('0x1b')])})[_0xf425('0x1d')](function(_0x4a7c40){logger[_0xf425('0xc')](_0xf425('0x26'));return _0x4a7c40;});}}function getEndUser(_0x13cb5c,_0x246349,_0x4bed53){logger[_0xf425('0xc')](_0xf425('0x27'),_0x4bed53);return request({'uri':util[_0xf425('0xe')]('%s/api/v2/contacts',_0x13cb5c['remoteUri']),'qs':{'phone':_0x4bed53}})[_0xf425('0x1d')](function(_0x4ef839){if(_0x4ef839[_0xf425('0x20')]){logger['info']('Enduser\x20found!');return _[_0xf425('0x22')](_0x4ef839,{'phone':_0x4bed53});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xf425('0x28'),_0x13cb5c[_0xf425('0x1b')]),'method':_0xf425('0x1c'),'body':{'name':_0x246349,'phone':_0x4bed53}})[_0xf425('0x1d')](function(_0x5117af){logger[_0xf425('0xc')](_0xf425('0x29'));return _0x5117af;});}});}function getAuth(_0x34fda2){return util[_0xf425('0xe')](_0xf425('0x2a'),new Buffer(_0x34fda2[_0xf425('0x2b')]+':X')[_0xf425('0x2c')](_0xf425('0x2d')));}function request(_0x2e279e){logger[_0xf425('0x2e')](_0xf425('0x2f'),JSON['stringify'](_0x2e279e));return rp(_['defaults'](_0x2e279e,{'method':_0xf425('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x1b27c3,_0x21d352){var _0xbc7efc=[];if(_0x1b27c3&&_0x1b27c3['length']>0x0){_0xbc7efc=_['map'](_0x1b27c3,_0x21d352);}return _0xbc7efc;}function getCustomFields(_0x86b44d,_0x47712f){var _0x2f60e8=[];var _0xa2ce79={'custom_fields':[]};if(_0x86b44d[_0xf425('0x20')]>0x0){_[_0xf425('0x31')](_0x86b44d,function(_0x4144fb){if(_[_0xf425('0x32')]([_0xf425('0x33'),_0xf425('0x34')],_0x4144fb[_0xf425('0x35')])&&_0x4144fb[_0xf425('0x36')]&&!_0x4144fb['customField']){_0xa2ce79[_0x4144fb[_0xf425('0x36')][_0xf425('0x37')]()]=_0x4144fb['content'][_0xf425('0x2c')]();}else if(_[_0xf425('0x32')]([_0xf425('0x33'),_0xf425('0x34')],_0x4144fb['type'])&&_0x4144fb[_0xf425('0x38')]&&_0x4144fb[_0xf425('0x39')]){_0xa2ce79[_0xf425('0x19')][_0xf425('0x3a')]({'id':_0x4144fb[_0xf425('0x38')],'value':_0x4144fb[_0xf425('0x3b')][_0xf425('0x2c')]()});}else if(_0x4144fb[_0xf425('0x35')]===_0xf425('0x3c')&&_0x4144fb[_0xf425('0x3d')]&&_0x4144fb[_0xf425('0x38')]&&_0x4144fb[_0xf425('0x39')]){_0x47712f[_0x4144fb[_0xf425('0x3d')]]&&_0xa2ce79[_0xf425('0x19')][_0xf425('0x3a')]({'id':_0x4144fb['idField'],'value':_0x47712f[_0x4144fb[_0xf425('0x3d')]][_0xf425('0x2c')]()});}else if(_0x4144fb[_0xf425('0x35')]===_0xf425('0x3e')&&_0x4144fb['Variable']&&_0x4144fb[_0xf425('0x3f')][_0xf425('0x16')]&&_0x4144fb[_0xf425('0x38')]&&_0x4144fb[_0xf425('0x39')]){_0x47712f[_0x4144fb[_0xf425('0x3f')]['name'][_0xf425('0x37')]()]&&_0xa2ce79['custom_fields'][_0xf425('0x3a')]({'id':_0x4144fb['idField'],'value':_0x47712f[_0x4144fb[_0xf425('0x3f')][_0xf425('0x16')][_0xf425('0x37')]()]['toString']()});}});}return _0xa2ce79;}exports['queue']=function(_0x1a1edb,_0x6e6f65,_0x1ed274,_0x32776e,_0x5d6290,_0x999d61){var _0x2b868b,_0xebb839;_0x999d61['remoteUri']=intUtil[_0xf425('0x40')](_0x999d61[_0xf425('0x1b')]);_0x999d61[_0xf425('0x41')]=intUtil[_0xf425('0x40')](_0x999d61['serverUrl']);if(_0x5d6290&&_0x5d6290['monitor_format']){logger['info'](_0xf425('0x42'),'Recording\x20is\x20enabled!');_0x6e6f65[_0xf425('0x43')]=util[_0xf425('0xe')](_0xf425('0x44'),_0x999d61[_0xf425('0x41')],_0x6e6f65[_0xf425('0x45')],md5(_0x6e6f65[_0xf425('0x45')]));}else{_0x6e6f65[_0xf425('0x43')]='';}headers[_0xf425('0x46')]=getAuth(_0x999d61);return getUser(_0x999d61,_0x32776e[_0xf425('0x24')])[_0xf425('0x1d')](function(_0x48f8d0){_0x2b868b=_0x48f8d0;logger['info'](_0xf425('0x47'),_0x2b868b['id']);return getEndUser(_0x999d61,_0x6e6f65[_0xf425('0x10')],_0x6e6f65[_0xf425('0x11')]);})[_0xf425('0x1d')](function(_0xe5337e){_0xebb839=_0xe5337e;logger[_0xf425('0xc')]('The\x20Enduser\x20ID\x20is:',_0xebb839['id']);return getTicket(_0x999d61,_0x2b868b,_0xebb839,_0x1ed274,_0x6e6f65);})[_0xf425('0x1d')](function(_0x36c41a){if(_0x36c41a&&_0x36c41a['id']){logger[_0xf425('0xc')](_0xf425('0x1e'));logger[_0xf425('0xc')](_0xf425('0x48'),_0x36c41a['id']);logger['info'](_0xf425('0x42'),_0xf425('0x49'));emit(util[_0xf425('0xe')](_0xf425('0x4a'),_0x32776e[_0xf425('0x16')]),_0xf425('0x4b'),{'uri':util[_0xf425('0xe')]('%s/helpdesk/tickets/%d',_0x999d61[_0xf425('0x1b')],_0x36c41a['id'])});}})[_0xf425('0x4c')](function(_0x316f93){logger[_0xf425('0x4d')]('[QUEUE]',JSON[_0xf425('0x4e')](_0x316f93));});};exports[_0xf425('0x4f')]=function(_0x35f9b0,_0x4e9990,_0x1da650,_0x182ffb,_0x68fba4,_0x7d5e37,_0x2fdf33){var _0x3a4342,_0xc9b536;_0x7d5e37[_0xf425('0x1b')]=intUtil[_0xf425('0x40')](_0x7d5e37[_0xf425('0x1b')]);_0x7d5e37[_0xf425('0x41')]=intUtil[_0xf425('0x40')](_0x7d5e37[_0xf425('0x41')]);if(_0x2fdf33&&_0x2fdf33[_0xf425('0x50')]&&_0x2fdf33['recordingFormat']!=='none'){logger[_0xf425('0xc')](_0xf425('0x51'),_0xf425('0x52'));_0x4e9990[_0xf425('0x43')]=util['format'](_0xf425('0x44'),_0x7d5e37['serverUrl'],_0x4e9990['uniqueid'],md5(_0x4e9990[_0xf425('0x45')]));}headers[_0xf425('0x46')]=getAuth(_0x7d5e37);return getUser(_0x7d5e37,_0x182ffb[_0xf425('0x24')])[_0xf425('0x1d')](function(_0x217dc4){_0x3a4342=_0x217dc4;logger[_0xf425('0xc')](_0xf425('0x47'),_0x3a4342['id']);return getEndUser(_0x7d5e37,_0x4e9990[_0xf425('0x53')],_0x4e9990['destcalleridnum']);})[_0xf425('0x1d')](function(_0x53fe7d){_0xc9b536=_0x53fe7d;logger[_0xf425('0xc')]('The\x20Enduser\x20ID\x20is:',_0xc9b536['id']);return getTicket(_0x7d5e37,_0x3a4342,_0xc9b536,_0x1da650,_0x4e9990);})[_0xf425('0x1d')](function(_0x426850){if(_0x426850&&_0x426850['id']){logger[_0xf425('0xc')](_0xf425('0x1e'));logger[_0xf425('0xc')](_0xf425('0x48'),_0x426850['id']);logger[_0xf425('0xc')](_0xf425('0x51'),_0xf425('0x49'));emit(util[_0xf425('0xe')](_0xf425('0x4a'),_0x182ffb[_0xf425('0x16')]),_0xf425('0x4b'),{'uri':util[_0xf425('0xe')]('%s/helpdesk/tickets/%d',_0x7d5e37[_0xf425('0x1b')],_0x426850['id'])});}})[_0xf425('0x4c')](function(_0x45cc09){logger[_0xf425('0x4d')](_0xf425('0x51'),JSON[_0xf425('0x4e')](_0x45cc09));});};exports['unmanaged']=function(_0x2ea515,_0x48e4e5,_0x331a40,_0x4ad161,_0x26f062,_0x7f547){var _0x58662d,_0x50b6c8;_0x7f547['remoteUri']=intUtil[_0xf425('0x40')](_0x7f547['remoteUri']);_0x7f547[_0xf425('0x41')]=intUtil[_0xf425('0x40')](_0x7f547[_0xf425('0x41')]);if(_0x26f062&&_0x26f062[_0xf425('0x54')]){logger[_0xf425('0xc')]('['+_0x48e4e5['lastevent'][_0xf425('0x55')]()+']','Recording\x20is\x20enabled!');_0x48e4e5['recordingURL']=util['format'](_0xf425('0x44'),_0x7f547[_0xf425('0x41')],_0x48e4e5[_0xf425('0x45')],md5(_0x48e4e5[_0xf425('0x45')]));}else{_0x48e4e5[_0xf425('0x43')]='';}headers[_0xf425('0x46')]=getAuth(_0x7f547);return getUser(_0x7f547,'')[_0xf425('0x1d')](function(_0x43f6f5){_0x58662d=_0x43f6f5;logger[_0xf425('0xc')]('The\x20User\x20ID\x20is:',_0x58662d['id']);return getEndUser(_0x7f547,_0x48e4e5[_0xf425('0x10')],_0x48e4e5['calleridnum']);})[_0xf425('0x1d')](function(_0x25089f){_0x50b6c8=_0x25089f;logger[_0xf425('0xc')](_0xf425('0x56'),_0x50b6c8['id']);return getTicket(_0x7f547,_0x58662d,_0x50b6c8,_0x331a40,_0x48e4e5);})[_0xf425('0x1d')](function(_0x533241){if(_0x533241){logger['info'](_0xf425('0x1e'));logger[_0xf425('0xc')]('The\x20Ticket\x20ID\x20is:',_0x533241['id']);}})['catch'](function(_0x4c8f76){logger['error']('['+_0x48e4e5[_0xf425('0x57')][_0xf425('0x55')]()+']',JSON[_0xf425('0x4e')](_0x4c8f76));});};
\ No newline at end of file
index 0e06c35..fe66b9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb687=['error','toUpperCase','message','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','adminEmail','/api/lookup?q=','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','endUserId','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','calleridnum','callDirection','unmanaged','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','length','email','adminId','Requested\x20Resource\x20not\x20Found','catch'];(function(_0x234143,_0x1c76fd){var _0x1317be=function(_0x4718cf){while(--_0x4718cf){_0x234143['push'](_0x234143['shift']());}};_0x1317be(++_0x1c76fd);}(_0xb687,0x13d));var _0x7b68=function(_0x265ad5,_0x1930b0){_0x265ad5=_0x265ad5-0x0;var _0x53671c=_0xb687[_0x265ad5];return _0x53671c;};'use strict';var _=require('lodash');var rp=require(_0x7b68('0x0'));var md5=require(_0x7b68('0x1'));var util=require(_0x7b68('0x2'));var moment=require('moment');var Promise=require(_0x7b68('0x3'));var Redis=require(_0x7b68('0x4'));var intUtil=require(_0x7b68('0x5'));var config=require(_0x7b68('0x6'));var logger=require('../../../../config/logger')(_0x7b68('0x7'));config[_0x7b68('0x8')]=_[_0x7b68('0x9')](config['redis'],{'host':_0x7b68('0xa'),'port':0x18eb});var io=require(_0x7b68('0xb'))(new Redis(config[_0x7b68('0x8')]));function getAdminId(_0x22f882,_0x423c1f,_0x5377e5,_0x7befd0){return new Promise(function(_0x3848d2,_0x3149cb){var _0x4340e9=![];var _0x5035d3={'method':_0x7b68('0xc'),'uri':_0x7befd0+_0x7b68('0xd'),'json':!![]};_0x5035d3[_0x7b68('0xe')]=_0x5377e5;logger[_0x7b68('0xf')](_0x7b68('0x10'));return rp(_0x5035d3)['then'](function(_0x43f2a5){if(_0x43f2a5){var _0x48ec05=_0x43f2a5[_0x7b68('0x11')];var _0x224dba=null;for(_0x224dba=0x0;_0x224dba<_0x48ec05[_0x7b68('0x12')];_0x224dba++){if(_0x48ec05[_0x224dba][_0x7b68('0x13')]===_0x22f882['adminEmail']){_0x22f882[_0x7b68('0x14')]=_0x48ec05[_0x224dba]['id'];_0x4340e9=!![];}}if(_0x4340e9){logger['info']('Admin\x20found:',_0x22f882[_0x7b68('0x14')]);_0x3848d2(_0x22f882);}else{_0x3149cb({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3149cb({'statusCode':0x194,'message':_0x7b68('0x15')});}})[_0x7b68('0x16')](function(_0x17be9b){logger[_0x7b68('0x17')]('['+[_0x423c1f[_0x7b68('0x18')]()]+']',_0x17be9b[_0x7b68('0x19')]);_0x3149cb(_0x17be9b);});});}function getUser(_0x1c078a,_0x357ee5,_0x9d3fcc){return function(_0x3f44d9){return new Promise(function(_0x35b952,_0x4ed75c){var _0x164045={'method':'GET','uri':_0x9d3fcc+_0x7b68('0xd'),'json':!![]};_0x164045['headers']=_0x357ee5;logger['info'](_0x7b68('0x1a'));return rp(_0x164045)[_0x7b68('0x1b')](function(_0x297033){if(_0x297033){var _0x36156e=_0x297033[_0x7b68('0x11')];var _0x303485=![];var _0x3d8879=null;if(_0x3f44d9[_0x7b68('0x1c')]!==null){logger[_0x7b68('0xf')](_0x7b68('0x1d'),_0x3f44d9['agentEmail']);_0x3f44d9[_0x7b68('0x1e')]=_0x3f44d9[_0x7b68('0x1c')];for(_0x3d8879=0x0;_0x3d8879<_0x36156e[_0x7b68('0x12')];_0x3d8879++){if(_0x36156e[_0x3d8879][_0x7b68('0x13')]===_0x3f44d9[_0x7b68('0x1c')]){_0x303485=!![];_0x3f44d9[_0x7b68('0x1f')]=_0x36156e[_0x3d8879]['id'];logger[_0x7b68('0xf')]('User\x20found:',_0x3f44d9[_0x7b68('0x1f')]);}}}if(!_0x303485){logger[_0x7b68('0xf')](_0x7b68('0x20'));_0x3f44d9[_0x7b68('0x1e')]=_0x3f44d9[_0x7b68('0x21')];_0x3f44d9['userId']=_0x3f44d9[_0x7b68('0x14')];_0x303485=!![];}if(_0x303485){_0x35b952(_0x3f44d9);}else{_0x4ed75c({'statusCode':0x194,'message':_0x7b68('0x15')});}}else{_0x4ed75c({'statusCode':0x194,'message':_0x7b68('0x15')});}})[_0x7b68('0x16')](function(_0xdea2ca){logger[_0x7b68('0x17')]('['+[_0x1c078a['toUpperCase']()]+']',_0xdea2ca[_0x7b68('0x19')]);_0x4ed75c(_0xdea2ca);});});};}function searchContact(_0x485350,_0x74755c,_0x15c0c3,_0x1aa605){return new Promise(function(_0x459390,_0x2165c8){var _0x3f45a0={'method':_0x7b68('0xc'),'headers':_0x74755c,'uri':_0x485350+_0x7b68('0x22')+_0x1aa605+_0x7b68('0x23')+_0x15c0c3+'&entities=contact','json':!![]};rp(_0x3f45a0)[_0x7b68('0x1b')](function(_0x348b20){var _0x49659b=_[_0x7b68('0x24')](_0x348b20[_0x7b68('0x25')][_0x7b68('0x25')],[_0x15c0c3,_0x1aa605]);_0x459390(_0x49659b);})[_0x7b68('0x16')](function(_0x2b5830){_0x2165c8(_0x2b5830);});});}function getEndUser(_0x2f6794,_0x145e1e,_0x47e24f){return function(_0x539007){return new Promise(function(_0x1f95dd,_0x1d3069){logger[_0x7b68('0xf')](util[_0x7b68('0x26')](_0x7b68('0x27'),_0x539007[_0x7b68('0x28')]));searchContact(_0x47e24f,_0x145e1e,_0x7b68('0x29'),_0x539007[_0x7b68('0x28')])['then'](function(_0x3d87a0){if(_0x3d87a0){_0x539007['endUserId']=_0x3d87a0['id'];logger[_0x7b68('0xf')](_0x7b68('0x2a'),_0x539007['endUserId']);return _0x1f95dd(_0x539007);}searchContact(_0x47e24f,_0x145e1e,'work_number',_0x539007['contactNumber'])[_0x7b68('0x1b')](function(_0x1c7e70){if(_0x1c7e70){_0x539007['endUserId']=_0x1c7e70['id'];logger[_0x7b68('0xf')](_0x7b68('0x2b'),_0x539007['endUserId']);return _0x1f95dd(_0x539007);}createEndUser(_0x539007,_0x2f6794,_0x145e1e,_0x47e24f)[_0x7b68('0x1b')](function(_0x4157c9){logger[_0x7b68('0xf')](_0x7b68('0x2c'),_0x4157c9[_0x7b68('0x2d')]);return _0x1f95dd(_0x4157c9);});});})['catch'](function(_0x36684d){_0x1d3069(_0x36684d);});});};}function createEndUser(_0x543d79,_0x10e6db,_0x4bd655,_0x274787){return new Promise(function(_0x2068f7,_0x5df94a){var _0x38dc1d=moment();var _0x5d0ded={'method':_0x7b68('0x2e'),'uri':_0x274787+_0x7b68('0x2f'),'body':{'contact':{'last_name':_0x543d79[_0x7b68('0x28')],'work_number':_0x543d79[_0x7b68('0x28')],'mobile_number':_0x543d79[_0x7b68('0x28')],'owner_id':_0x543d79[_0x7b68('0x1f')],'created_at':_0x38dc1d['format'](_0x7b68('0x30'))}},'json':!![]};_0x5d0ded[_0x7b68('0xe')]=_0x4bd655;logger['info'](_0x7b68('0x31'));return rp(_0x5d0ded)[_0x7b68('0x1b')](function(_0x4c3a6c){_0x543d79[_0x7b68('0x2d')]=_0x4c3a6c[_0x7b68('0x32')]['id'];_0x2068f7(_0x543d79);})[_0x7b68('0x16')](function(_0x40edc7){logger[_0x7b68('0x17')]('['+[_0x10e6db['toUpperCase']()]+']',_0x40edc7[_0x7b68('0x19')]);_0x5df94a(_0x40edc7['message']);});});}function getTicket(_0x329529,_0x4e5abc,_0x5b1fb6,_0x16a20d,_0x3c25d7){return function(_0x221da4){logger['info'](_0x7b68('0x33'));return new Promise(function(_0x4131a4,_0x1451af){var _0x1aca90=moment();var _0x431381={'method':_0x7b68('0x2e'),'uri':_0x5b1fb6+_0x7b68('0x34'),'body':{'title':intUtil[_0x7b68('0x35')](_0x16a20d[_0x7b68('0x36')],_0x3c25d7,'\x20'),'description':intUtil['getString'](_0x16a20d[_0x7b68('0x37')],_0x3c25d7,'\x0a'),'owner_id':_0x221da4[_0x7b68('0x1f')],'creater_id':_0x221da4[_0x7b68('0x14')],'targetable_id':_0x221da4[_0x7b68('0x2d')],'targetable_type':_0x7b68('0x38'),'created_at':_0x1aca90['format'](_0x7b68('0x30')),'due_date':_0x1aca90[_0x7b68('0x39')](0x1e,'m')['format'](_0x7b68('0x30'))},'json':!![]};_0x431381[_0x7b68('0xe')]=_0x4e5abc;return rp(_0x431381)[_0x7b68('0x1b')](function(_0x31ea1e){_0x221da4[_0x7b68('0x3a')]=_0x31ea1e[_0x7b68('0x3b')]['id'];logger[_0x7b68('0xf')](_0x7b68('0x3c'),_0x221da4[_0x7b68('0x3a')]);_0x4131a4(_0x221da4);})[_0x7b68('0x16')](function(_0x2b3496){logger['error']('['+[_0x329529[_0x7b68('0x18')]()]+']',_0x2b3496[_0x7b68('0x19')]);_0x1451af(_0x2b3496[_0x7b68('0x19')]);});});};}function emit(_0x258878,_0x410da9,_0x284987){var _0x4a5993={'uri':_0x258878+'/contacts/'+_0x284987};io['to'](util[_0x7b68('0x26')]('user:%s',_0x410da9))[_0x7b68('0x3d')]('trigger:browser:url',_0x4a5993);}exports['cs']=function(_0x26a78f,_0x357580,_0x1982d4,_0x106ec1,_0x192a72,_0x3a645f,_0x15f1f6,_0x2b4ae4){var _0x3a479a={};var _0x134979={'Authorization':_0x7b68('0x3e')+_0x3a645f[_0x7b68('0x3f')]};_0x3a645f[_0x7b68('0x40')]=intUtil[_0x7b68('0x41')](_0x3a645f[_0x7b68('0x40')]);_0x3a645f[_0x7b68('0x42')]=intUtil[_0x7b68('0x41')](_0x3a645f[_0x7b68('0x42')]);var _0x28d0e9=_0x3a645f[_0x7b68('0x40')];_0x3a479a[_0x7b68('0x21')]=_0x3a645f[_0x7b68('0x43')];_0x3a479a[_0x7b68('0x28')]=_0x2b4ae4['toLowerCase']()===_0x7b68('0x44')?_0x357580['destcalleridnum']:_0x357580[_0x7b68('0x45')];_0x3a479a[_0x7b68('0x46')]=_0x2b4ae4==='queue'||_0x2b4ae4===_0x7b68('0x47')?_0x7b68('0x48'):_0x7b68('0x44');if(_0x106ec1){_0x3a479a['agentEmail']=_0x106ec1[_0x7b68('0x13')];}var _0x2628b9=util[_0x7b68('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3a645f[_0x7b68('0x42')],_0x357580['uniqueid'],md5(_0x357580[_0x7b68('0x49')]));if(_0x192a72&&_0x192a72[_0x7b68('0x4a')]){logger['info'](_0x7b68('0x4b'),_0x7b68('0x4c'));_0x357580[_0x7b68('0x4d')]=_0x2628b9;}else if(_0x15f1f6&&_0x15f1f6['recordingFormat']&&_0x15f1f6[_0x7b68('0x4e')]!==_0x7b68('0x4f')){logger[_0x7b68('0xf')](_0x7b68('0x50'),_0x7b68('0x4c'));_0x357580[_0x7b68('0x4d')]=_0x2628b9;}else{_0x357580['recordingURL']='';}return getAdminId(_0x3a479a,_0x2b4ae4,_0x134979,_0x28d0e9)['then'](getUser(_0x2b4ae4,_0x134979,_0x28d0e9))[_0x7b68('0x1b')](getEndUser(_0x2b4ae4,_0x134979,_0x28d0e9))[_0x7b68('0x1b')](getTicket(_0x2b4ae4,_0x134979,_0x28d0e9,_0x1982d4,_0x357580))[_0x7b68('0x1b')](function(_0x160c72){logger[_0x7b68('0xf')](util[_0x7b68('0x26')]('The\x20ticket\x20ID\x20is:\x20%s',_0x160c72[_0x7b68('0x3a')]));if(_0x2b4ae4!==_0x7b68('0x47')){logger['info']('['+[_0x2b4ae4['toUpperCase']()]+']',_0x7b68('0x51'));emit(_0x28d0e9,_0x106ec1[_0x7b68('0x52')],_0x160c72['endUserId']);}})[_0x7b68('0x16')](function(_0x3ba219){logger[_0x7b68('0x17')]('['+[_0x2b4ae4['toUpperCase']()]+_0x7b68('0x53'),util[_0x7b68('0x54')](_0x3ba219,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x2318=['catch','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','serverUrl','remoteUri','username','toLowerCase','outbound','calleridnum','queue','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/environment','freshsales','defaults','socket.io-emitter','redis','GET','/api/selector/owners','headers','info','then','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','message','Getting\x20user\x20list','users','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','toUpperCase','/api/lookup?q=','&f=','&entities=contact','contacts'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x2318,0x17f));var _0x8231=function(_0x552785,_0x467676){_0x552785=_0x552785-0x0;var _0x3f4c94=_0x2318[_0x552785];return _0x3f4c94;};'use strict';var _=require(_0x8231('0x0'));var rp=require(_0x8231('0x1'));var md5=require(_0x8231('0x2'));var util=require(_0x8231('0x3'));var moment=require(_0x8231('0x4'));var Promise=require(_0x8231('0x5'));var Redis=require('ioredis');var intUtil=require(_0x8231('0x6'));var config=require(_0x8231('0x7'));var logger=require('../../../../config/logger')(_0x8231('0x8'));config['redis']=_[_0x8231('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8231('0xa'))(new Redis(config[_0x8231('0xb')]));function getAdminId(_0x4b95be,_0x2f406e,_0x121437,_0x32e57a){return new Promise(function(_0x35d606,_0x5de1fd){var _0x1fb785=![];var _0x6b240d={'method':_0x8231('0xc'),'uri':_0x32e57a+_0x8231('0xd'),'json':!![]};_0x6b240d[_0x8231('0xe')]=_0x121437;logger[_0x8231('0xf')]('Getting\x20admin\x20information');return rp(_0x6b240d)[_0x8231('0x10')](function(_0x4ed81a){if(_0x4ed81a){var _0xa557aa=_0x4ed81a['users'];var _0x5e7745=null;for(_0x5e7745=0x0;_0x5e7745<_0xa557aa[_0x8231('0x11')];_0x5e7745++){if(_0xa557aa[_0x5e7745][_0x8231('0x12')]===_0x4b95be[_0x8231('0x13')]){_0x4b95be[_0x8231('0x14')]=_0xa557aa[_0x5e7745]['id'];_0x1fb785=!![];}}if(_0x1fb785){logger[_0x8231('0xf')](_0x8231('0x15'),_0x4b95be[_0x8231('0x14')]);_0x35d606(_0x4b95be);}else{_0x5de1fd({'statusCode':0x194,'message':_0x8231('0x16')});}}else{_0x5de1fd({'statusCode':0x194,'message':_0x8231('0x16')});}})['catch'](function(_0x1ac446){logger[_0x8231('0x17')]('['+[_0x2f406e['toUpperCase']()]+']',_0x1ac446[_0x8231('0x18')]);_0x5de1fd(_0x1ac446);});});}function getUser(_0x3de41c,_0x155c5b,_0x34c41e){return function(_0x19ea59){return new Promise(function(_0x3ad821,_0x192e3f){var _0x17c875={'method':_0x8231('0xc'),'uri':_0x34c41e+_0x8231('0xd'),'json':!![]};_0x17c875[_0x8231('0xe')]=_0x155c5b;logger[_0x8231('0xf')](_0x8231('0x19'));return rp(_0x17c875)['then'](function(_0x5529ce){if(_0x5529ce){var _0x2faae6=_0x5529ce[_0x8231('0x1a')];var _0x22e399=![];var _0x3ae208=null;if(_0x19ea59[_0x8231('0x1b')]!==null){logger[_0x8231('0xf')]('Getting\x20user\x20with\x20email',_0x19ea59[_0x8231('0x1b')]);_0x19ea59[_0x8231('0x1c')]=_0x19ea59['agentEmail'];for(_0x3ae208=0x0;_0x3ae208<_0x2faae6[_0x8231('0x11')];_0x3ae208++){if(_0x2faae6[_0x3ae208][_0x8231('0x12')]===_0x19ea59[_0x8231('0x1b')]){_0x22e399=!![];_0x19ea59[_0x8231('0x1d')]=_0x2faae6[_0x3ae208]['id'];logger[_0x8231('0xf')](_0x8231('0x1e'),_0x19ea59[_0x8231('0x1d')]);}}}if(!_0x22e399){logger[_0x8231('0xf')](_0x8231('0x1f'));_0x19ea59[_0x8231('0x1c')]=_0x19ea59[_0x8231('0x13')];_0x19ea59[_0x8231('0x1d')]=_0x19ea59[_0x8231('0x14')];_0x22e399=!![];}if(_0x22e399){_0x3ad821(_0x19ea59);}else{_0x192e3f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x192e3f({'statusCode':0x194,'message':_0x8231('0x16')});}})['catch'](function(_0x381aed){logger['error']('['+[_0x3de41c[_0x8231('0x20')]()]+']',_0x381aed[_0x8231('0x18')]);_0x192e3f(_0x381aed);});});};}function searchContact(_0x362c4e,_0x402760,_0x1fbdbe,_0x5ef861){return new Promise(function(_0x4a9df2,_0x24ad76){var _0x52b744={'method':_0x8231('0xc'),'headers':_0x402760,'uri':_0x362c4e+_0x8231('0x21')+_0x5ef861+_0x8231('0x22')+_0x1fbdbe+_0x8231('0x23'),'json':!![]};rp(_0x52b744)[_0x8231('0x10')](function(_0x12b7c1){var _0x28c9ba=_['find'](_0x12b7c1[_0x8231('0x24')][_0x8231('0x24')],[_0x1fbdbe,_0x5ef861]);_0x4a9df2(_0x28c9ba);})[_0x8231('0x25')](function(_0x693669){_0x24ad76(_0x693669);});});}function getEndUser(_0x17ff81,_0x32e0d7,_0x2cf00b){return function(_0xefefc5){return new Promise(function(_0xe76411,_0x1448b6){logger[_0x8231('0xf')](util[_0x8231('0x26')](_0x8231('0x27'),_0xefefc5[_0x8231('0x28')]));searchContact(_0x2cf00b,_0x32e0d7,_0x8231('0x29'),_0xefefc5[_0x8231('0x28')])[_0x8231('0x10')](function(_0x4acb9d){if(_0x4acb9d){_0xefefc5[_0x8231('0x2a')]=_0x4acb9d['id'];logger['info'](_0x8231('0x2b'),_0xefefc5[_0x8231('0x2a')]);return _0xe76411(_0xefefc5);}searchContact(_0x2cf00b,_0x32e0d7,_0x8231('0x2c'),_0xefefc5[_0x8231('0x28')])[_0x8231('0x10')](function(_0x3dec8d){if(_0x3dec8d){_0xefefc5['endUserId']=_0x3dec8d['id'];logger['info'](_0x8231('0x2d'),_0xefefc5[_0x8231('0x2a')]);return _0xe76411(_0xefefc5);}createEndUser(_0xefefc5,_0x17ff81,_0x32e0d7,_0x2cf00b)[_0x8231('0x10')](function(_0xed8cc8){logger[_0x8231('0xf')](_0x8231('0x2e'),_0xed8cc8[_0x8231('0x2a')]);return _0xe76411(_0xed8cc8);});});})[_0x8231('0x25')](function(_0x3eeb1c){_0x1448b6(_0x3eeb1c);});});};}function createEndUser(_0x242be4,_0x4e979d,_0x464544,_0x5e5602){return new Promise(function(_0x42f943,_0x4b8dca){var _0x29f201=moment();var _0x3af3e1={'method':'POST','uri':_0x5e5602+'/api/contacts','body':{'contact':{'last_name':_0x242be4[_0x8231('0x28')],'work_number':_0x242be4['contactNumber'],'mobile_number':_0x242be4['contactNumber'],'owner_id':_0x242be4[_0x8231('0x1d')],'created_at':_0x29f201['format'](_0x8231('0x2f'))}},'json':!![]};_0x3af3e1[_0x8231('0xe')]=_0x464544;logger[_0x8231('0xf')](_0x8231('0x30'));return rp(_0x3af3e1)[_0x8231('0x10')](function(_0x153623){_0x242be4['endUserId']=_0x153623[_0x8231('0x31')]['id'];_0x42f943(_0x242be4);})[_0x8231('0x25')](function(_0x481a00){logger['error']('['+[_0x4e979d[_0x8231('0x20')]()]+']',_0x481a00[_0x8231('0x18')]);_0x4b8dca(_0x481a00[_0x8231('0x18')]);});});}function getTicket(_0x13fc88,_0x22c3fa,_0x2d811f,_0x1d9672,_0x1ffc9b){return function(_0x406bae){logger[_0x8231('0xf')](_0x8231('0x32'));return new Promise(function(_0xb18b30,_0x5edcf3){var _0x377626=moment();var _0x1fd354={'method':_0x8231('0x33'),'uri':_0x2d811f+_0x8231('0x34'),'body':{'title':intUtil[_0x8231('0x35')](_0x1d9672[_0x8231('0x36')],_0x1ffc9b,'\x20'),'description':intUtil[_0x8231('0x35')](_0x1d9672['Descriptions'],_0x1ffc9b,'\x0a'),'owner_id':_0x406bae['userId'],'creater_id':_0x406bae['adminId'],'targetable_id':_0x406bae[_0x8231('0x2a')],'targetable_type':_0x8231('0x37'),'created_at':_0x377626['format'](_0x8231('0x2f')),'due_date':_0x377626[_0x8231('0x38')](0x1e,'m')[_0x8231('0x26')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x1fd354[_0x8231('0xe')]=_0x22c3fa;return rp(_0x1fd354)[_0x8231('0x10')](function(_0x3a768e){_0x406bae[_0x8231('0x39')]=_0x3a768e[_0x8231('0x3a')]['id'];logger[_0x8231('0xf')](_0x8231('0x3b'),_0x406bae[_0x8231('0x39')]);_0xb18b30(_0x406bae);})[_0x8231('0x25')](function(_0x5a19f4){logger[_0x8231('0x17')]('['+[_0x13fc88[_0x8231('0x20')]()]+']',_0x5a19f4['message']);_0x5edcf3(_0x5a19f4[_0x8231('0x18')]);});});};}function emit(_0x4c24ac,_0x51f297,_0x5a933a){var _0x5ef062={'uri':_0x4c24ac+_0x8231('0x3c')+_0x5a933a};io['to'](util[_0x8231('0x26')](_0x8231('0x3d'),_0x51f297))[_0x8231('0x3e')](_0x8231('0x3f'),_0x5ef062);}exports['cs']=function(_0x542732,_0x2400eb,_0x5af8ae,_0x154801,_0x490e21,_0x23e608,_0x38e784,_0x383dcd){var _0x462a38={};var _0x5725ef={'Authorization':_0x8231('0x40')+_0x23e608[_0x8231('0x41')]};_0x23e608['remoteUri']=intUtil['stripTrailingSlash'](_0x23e608['remoteUri']);_0x23e608[_0x8231('0x42')]=intUtil['stripTrailingSlash'](_0x23e608[_0x8231('0x42')]);var _0x465a20=_0x23e608[_0x8231('0x43')];_0x462a38['adminEmail']=_0x23e608[_0x8231('0x44')];_0x462a38['contactNumber']=_0x383dcd[_0x8231('0x45')]()===_0x8231('0x46')?_0x2400eb['destcalleridnum']:_0x2400eb[_0x8231('0x47')];_0x462a38['callDirection']=_0x383dcd===_0x8231('0x48')||_0x383dcd==='unmanaged'?_0x8231('0x48'):_0x8231('0x46');if(_0x154801){_0x462a38[_0x8231('0x1b')]=_0x154801[_0x8231('0x12')];}var _0x1e441d=util[_0x8231('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x23e608[_0x8231('0x42')],_0x2400eb['uniqueid'],md5(_0x2400eb['uniqueid']));if(_0x490e21&&_0x490e21[_0x8231('0x49')]){logger[_0x8231('0xf')](_0x8231('0x4a'),'Recording\x20is\x20enabled!');_0x2400eb[_0x8231('0x4b')]=_0x1e441d;}else if(_0x38e784&&_0x38e784[_0x8231('0x4c')]&&_0x38e784[_0x8231('0x4c')]!==_0x8231('0x4d')){logger[_0x8231('0xf')](_0x8231('0x4e'),'Recording\x20is\x20enabled!');_0x2400eb[_0x8231('0x4b')]=_0x1e441d;}else{_0x2400eb['recordingURL']='';}return getAdminId(_0x462a38,_0x383dcd,_0x5725ef,_0x465a20)['then'](getUser(_0x383dcd,_0x5725ef,_0x465a20))[_0x8231('0x10')](getEndUser(_0x383dcd,_0x5725ef,_0x465a20))[_0x8231('0x10')](getTicket(_0x383dcd,_0x5725ef,_0x465a20,_0x5af8ae,_0x2400eb))['then'](function(_0x46e93c){logger[_0x8231('0xf')](util[_0x8231('0x26')]('The\x20ticket\x20ID\x20is:\x20%s',_0x46e93c['ticketId']));if(_0x383dcd!==_0x8231('0x4f')){logger['info']('['+[_0x383dcd[_0x8231('0x20')]()]+']',_0x8231('0x50'));emit(_0x465a20,_0x154801[_0x8231('0x51')],_0x46e93c['endUserId']);}})[_0x8231('0x25')](function(_0x126471){logger['error']('['+[_0x383dcd[_0x8231('0x20')]()]+_0x8231('0x52'),util[_0x8231('0x53')](_0x126471,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 1486b67..b83129b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5482=['dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','zoho','vtiger','freshsales','servicenow','exec','data1','data2','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','toLowerCase','salesforce','sugarcrm','freshdesk','desk'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5482,0x7d));var _0x2548=function(_0xa43a44,_0x336af6){_0xa43a44=_0xa43a44-0x0;var _0x53ac8a=_0x5482[_0xa43a44];return _0x53ac8a;};'use strict';var _=require(_0x2548('0x0'));var util=require(_0x2548('0x1'));var zendesk=require(_0x2548('0x2'));var salesforce=require(_0x2548('0x3'));var sugarcrm=require(_0x2548('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x2548('0x5'));var desk=require(_0x2548('0x6'));var vtiger=require(_0x2548('0x7'));var servicenow=require(_0x2548('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0x2548('0x9'));var integrations=[_0x2548('0xa'),'salesforce','sugarcrm','freshdesk',_0x2548('0xb'),'desk',_0x2548('0xc'),'dynamics365',_0x2548('0xd'),_0x2548('0xe')];exports[_0x2548('0xf')]=function(_0x30ab85,_0x6469d8,_0x5314ba,_0x2dd4b6,_0x3dfd87,_0x2ccb97){if(_0x5314ba){if(_['includes'](integrations,_0x30ab85[_0x2548('0x10')]['toLowerCase']())){try{var _0x3a6438=null;var _0x5367d7='';var _0x185d15=_0x5314ba[_0x30ab85[_0x2548('0x10')]['toLowerCase']()];if(_0x185d15){var _0x51f94e=_0x185d15[_0x30ab85[_0x2548('0x11')]];if(_0x51f94e){var _0x5e8afb=_[_0x2548('0x12')](_0x51f94e['Configurations'],{'id':parseInt(_0x30ab85[_0x2548('0x13')],0xa)});if(_0x5e8afb){if(_0x2dd4b6){if(_0x3dfd87&&_0x6469d8['queue']){_0x5367d7=_0x2548('0x14');}else if(_0x6469d8[_0x2548('0x15')]){_0x5367d7=_0x2548('0x16');}else{console[_0x2548('0x17')](_0x2548('0x18'),_0x6469d8);}}else{_0x5367d7=_0x2548('0x19');}switch(_0x30ab85['data1'][_0x2548('0x1a')]()){case _0x2548('0xa'):zendesk[_0x5367d7](_0x30ab85,_0x6469d8,_0x5e8afb,_0x2dd4b6,_0x3dfd87,_0x51f94e,_0x2ccb97);break;case _0x2548('0x1b'):salesforce[_0x5367d7](_0x30ab85,_0x6469d8,_0x5e8afb,_0x2dd4b6,_0x3dfd87,_0x51f94e,_0x2ccb97);break;case _0x2548('0x1c'):sugarcrm[_0x5367d7](_0x30ab85,_0x6469d8,_0x5e8afb,_0x2dd4b6,_0x3dfd87,_0x51f94e,_0x2ccb97);break;case _0x2548('0x1d'):freshdesk[_0x5367d7](_0x30ab85,_0x6469d8,_0x5e8afb,_0x2dd4b6,_0x3dfd87,_0x51f94e,_0x2ccb97);break;case'zoho':zoho[_0x5367d7](_0x30ab85,_0x6469d8,_0x5e8afb,_0x2dd4b6,_0x3dfd87,_0x51f94e,_0x2ccb97);break;case _0x2548('0x1e'):desk[_0x5367d7](_0x30ab85,_0x6469d8,_0x5e8afb,_0x2dd4b6,_0x3dfd87,_0x51f94e,_0x2ccb97);break;case'vtiger':vtiger[_0x5367d7](_0x30ab85,_0x6469d8,_0x5e8afb,_0x2dd4b6,_0x3dfd87,_0x51f94e,_0x2ccb97);break;case _0x2548('0xd'):freshsales['cs'](_0x30ab85,_0x6469d8,_0x5e8afb,_0x2dd4b6,_0x3dfd87,_0x51f94e,_0x2ccb97,_0x5367d7);break;case _0x2548('0xe'):servicenow['cs'](_0x30ab85,_0x6469d8,_0x5e8afb,_0x2dd4b6,_0x3dfd87,_0x51f94e,_0x2ccb97,_0x5367d7);break;case _0x2548('0x1f'):dynamics365['cs'](_0x30ab85,_0x6469d8,_0x5e8afb,_0x2dd4b6,_0x3dfd87,_0x51f94e,_0x2ccb97,_0x5367d7);break;default:console[_0x2548('0x17')](_0x2548('0x20'));}}else{_0x3a6438=require(_0x2548('0x21'))(_0x30ab85[_0x2548('0x10')][_0x2548('0x1a')]());_0x3a6438[_0x2548('0x22')](_0x2548('0x23'),util[_0x2548('0x24')](_0x2548('0x25'),_0x30ab85['data1']['toLowerCase'](),_0x30ab85[_0x2548('0x13')]));}}else{_0x3a6438=require(_0x2548('0x21'))(_0x30ab85['data1']['toLowerCase']());_0x3a6438[_0x2548('0x22')]('[EXEC]',util[_0x2548('0x24')](_0x2548('0x26'),_0x30ab85[_0x2548('0x10')][_0x2548('0x1a')](),_0x30ab85[_0x2548('0x11')]));}}else{}}catch(_0x10e0e1){console[_0x2548('0x22')](_0x10e0e1);}}}};
\ No newline at end of file
+var _0x651e=['sugarcrm','zoho','desk','dynamics365','freshsales','servicenow','includes','toLowerCase','data1','find','Configurations','data3','queue','routeId','log','unmanaged','freshdesk','vtiger','unknown\x20integration','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','error','format','data2','lodash','util','./zendesk','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','./freshsales','zendesk','salesforce'];(function(_0x109dd8,_0x1b0c8e){var _0xd790ec=function(_0x484e0e){while(--_0x484e0e){_0x109dd8['push'](_0x109dd8['shift']());}};_0xd790ec(++_0x1b0c8e);}(_0x651e,0x15d));var _0xe651=function(_0xc94ae6,_0x5b0051){_0xc94ae6=_0xc94ae6-0x0;var _0x5013ef=_0x651e[_0xc94ae6];return _0x5013ef;};'use strict';var _=require(_0xe651('0x0'));var util=require(_0xe651('0x1'));var zendesk=require(_0xe651('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xe651('0x3'));var zoho=require(_0xe651('0x4'));var desk=require(_0xe651('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0xe651('0x6'));var dynamics365=require(_0xe651('0x7'));var freshsales=require(_0xe651('0x8'));var integrations=[_0xe651('0x9'),_0xe651('0xa'),_0xe651('0xb'),'freshdesk',_0xe651('0xc'),_0xe651('0xd'),'vtiger',_0xe651('0xe'),_0xe651('0xf'),_0xe651('0x10')];exports['exec']=function(_0x51996a,_0x39e50f,_0x51f055,_0x2274b7,_0x19e359,_0x426101){if(_0x51f055){if(_[_0xe651('0x11')](integrations,_0x51996a['data1'][_0xe651('0x12')]())){try{var _0x4f0ad3=null;var _0x425db1='';var _0x44eda7=_0x51f055[_0x51996a[_0xe651('0x13')]['toLowerCase']()];if(_0x44eda7){var _0x483f46=_0x44eda7[_0x51996a['data2']];if(_0x483f46){var _0x15116e=_[_0xe651('0x14')](_0x483f46[_0xe651('0x15')],{'id':parseInt(_0x51996a[_0xe651('0x16')],0xa)});if(_0x15116e){if(_0x2274b7){if(_0x19e359&&_0x39e50f[_0xe651('0x17')]){_0x425db1=_0xe651('0x17');}else if(_0x39e50f[_0xe651('0x18')]){_0x425db1='outbound';}else{console[_0xe651('0x19')]('EVENT\x20UNKNOWN',_0x39e50f);}}else{_0x425db1=_0xe651('0x1a');}switch(_0x51996a[_0xe651('0x13')][_0xe651('0x12')]()){case _0xe651('0x9'):zendesk[_0x425db1](_0x51996a,_0x39e50f,_0x15116e,_0x2274b7,_0x19e359,_0x483f46,_0x426101);break;case _0xe651('0xa'):salesforce[_0x425db1](_0x51996a,_0x39e50f,_0x15116e,_0x2274b7,_0x19e359,_0x483f46,_0x426101);break;case _0xe651('0xb'):sugarcrm[_0x425db1](_0x51996a,_0x39e50f,_0x15116e,_0x2274b7,_0x19e359,_0x483f46,_0x426101);break;case _0xe651('0x1b'):freshdesk[_0x425db1](_0x51996a,_0x39e50f,_0x15116e,_0x2274b7,_0x19e359,_0x483f46,_0x426101);break;case _0xe651('0xc'):zoho[_0x425db1](_0x51996a,_0x39e50f,_0x15116e,_0x2274b7,_0x19e359,_0x483f46,_0x426101);break;case _0xe651('0xd'):desk[_0x425db1](_0x51996a,_0x39e50f,_0x15116e,_0x2274b7,_0x19e359,_0x483f46,_0x426101);break;case _0xe651('0x1c'):vtiger[_0x425db1](_0x51996a,_0x39e50f,_0x15116e,_0x2274b7,_0x19e359,_0x483f46,_0x426101);break;case _0xe651('0xf'):freshsales['cs'](_0x51996a,_0x39e50f,_0x15116e,_0x2274b7,_0x19e359,_0x483f46,_0x426101,_0x425db1);break;case _0xe651('0x10'):servicenow['cs'](_0x51996a,_0x39e50f,_0x15116e,_0x2274b7,_0x19e359,_0x483f46,_0x426101,_0x425db1);break;case _0xe651('0xe'):dynamics365['cs'](_0x51996a,_0x39e50f,_0x15116e,_0x2274b7,_0x19e359,_0x483f46,_0x426101,_0x425db1);break;default:console[_0xe651('0x19')](_0xe651('0x1d'));}}else{_0x4f0ad3=require('../../../../config/logger')(_0x51996a[_0xe651('0x13')][_0xe651('0x12')]());_0x4f0ad3['error'](_0xe651('0x1e'),util['format'](_0xe651('0x1f'),_0x51996a[_0xe651('0x13')][_0xe651('0x12')](),_0x51996a[_0xe651('0x16')]));}}else{_0x4f0ad3=require(_0xe651('0x20'))(_0x51996a[_0xe651('0x13')][_0xe651('0x12')]());_0x4f0ad3[_0xe651('0x21')]('[EXEC]',util[_0xe651('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x51996a[_0xe651('0x13')][_0xe651('0x12')](),_0x51996a[_0xe651('0x23')]));}}else{}}catch(_0x587695){console[_0xe651('0x21')](_0x587695);}}}};
\ No newline at end of file
index 3004da7..33b37e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef96=['remoteUri','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','outbound','[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','unmanaged','toUpperCase','Recording\x20is\x20enabled!','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','ActivityDate','IsRecurrence','endUserType','contact','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','Company','upperFirst','forEach','includes','string','picklist','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','https://login.salesforce.com','clientId','login','username','Connection\x20established.','serverUrl','stripTrailingSlash'];(function(_0x3f7104,_0x4b8fed){var _0x450622=function(_0x4a5b0b){while(--_0x4a5b0b){_0x3f7104['push'](_0x3f7104['shift']());}};_0x450622(++_0x4b8fed);}(_0xef96,0x19d));var _0x6ef9=function(_0x1ecbfc,_0x7897ad){_0x1ecbfc=_0x1ecbfc-0x0;var _0x1e3142=_0xef96[_0x1ecbfc];return _0x1e3142;};'use strict';var _=require('lodash');var rp=require(_0x6ef9('0x0'));var moment=require(_0x6ef9('0x1'));var BPromise=require(_0x6ef9('0x2'));var md5=require(_0x6ef9('0x3'));var jsforce=require('jsforce');var util=require(_0x6ef9('0x4'));var Redis=require(_0x6ef9('0x5'));var intUtil=require(_0x6ef9('0x6'));var config=require('../../../../config/environment');var logger=require(_0x6ef9('0x7'))(_0x6ef9('0x8'));config[_0x6ef9('0x9')]=_[_0x6ef9('0xa')](config[_0x6ef9('0x9')],{'host':_0x6ef9('0xb'),'port':0x18eb});var io=require(_0x6ef9('0xc'))(new Redis(config[_0x6ef9('0x9')]));function emit(_0x1ced17,_0x25b1f1,_0x3240d3){io['to'](_0x1ced17)[_0x6ef9('0xd')](_0x25b1f1,_0x3240d3);}function getTicket(_0x4b7b57,_0x1fa8b0,_0x48bf92,_0x284014,_0x4598d8,_0x2205c4,_0x3e18ec,_0x53cc6e){var _0x1d3a5e=Object['assign']({},{'OwnerId':_0x1fa8b0['id'],'Subject':intUtil[_0x6ef9('0xe')](_0x284014[_0x6ef9('0xf')],_0x4598d8,'\x20'),'Description':intUtil[_0x6ef9('0xe')](_0x284014[_0x6ef9('0x10')],_0x4598d8,'\x0a')},getCustomFields(_0x2205c4,_0x4598d8));if(_0x48bf92){if(_0x284014[_0x6ef9('0x11')]==='Task'){_0x1d3a5e[_0x6ef9('0x12')]=moment['utc']();_0x1d3a5e['IsReminderSet']=![];_0x1d3a5e[_0x6ef9('0x13')]=![];if(_0x48bf92[_0x6ef9('0x14')]===_0x6ef9('0x15')||_0x48bf92['endUserType']==='lead'){_0x1d3a5e[_0x6ef9('0x16')]=_0x48bf92['id'];}else if(_0x48bf92[_0x6ef9('0x14')]===_0x6ef9('0x17')){_0x1d3a5e[_0x6ef9('0x18')]=_0x48bf92['id'];}}else if(_0x284014['ticketType']===_0x6ef9('0x19')){if(_0x48bf92[_0x6ef9('0x14')]===_0x6ef9('0x15')){_0x1d3a5e[_0x6ef9('0x1a')]=_0x48bf92['id'];}else if(_0x48bf92[_0x6ef9('0x14')]==='account'){_0x1d3a5e[_0x6ef9('0x1b')]=_0x48bf92['id'];}else if(_0x48bf92['endUserType']==='lead'&&_0x284014[_0x6ef9('0x1c')]){_0x1d3a5e[_0x284014[_0x6ef9('0x1c')]]=_0x48bf92['id'];}else{logger[_0x6ef9('0x1d')](_0x6ef9('0x1e'));}}}return _0x3e18ec[_0x6ef9('0x1f')](_0x284014[_0x6ef9('0x11')])[_0x6ef9('0x20')](_0x1d3a5e);}function getUser(_0x11dc40,_0x13be56,_0x4e2472){if(!_[_0x6ef9('0x21')](_0x13be56)&&intUtil[_0x6ef9('0x22')](_0x13be56)){var _0x19a79b={'Email':_0x13be56};var _0x1c14d5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4e2472[_0x6ef9('0x1f')](_0x6ef9('0x23'))[_0x6ef9('0x24')](_0x19a79b,_0x1c14d5)[_0x6ef9('0x25')]()[_0x6ef9('0x26')](function(_0x7bad20){if(_0x7bad20[_0x6ef9('0x27')]){var _0x3ee243=_[_0x6ef9('0x24')](_0x7bad20,function(_0x200762){return _0x200762['Email']===_0x13be56;});if(_0x3ee243){logger[_0x6ef9('0x1d')]('Agent\x20%s\x20found.',_0x13be56);return BPromise[_0x6ef9('0x28')]({'id':_0x3ee243['Id'],'name':_0x3ee243[_0x6ef9('0x29')]});}}else{logger[_0x6ef9('0x1d')](_0x6ef9('0x2a'),_0x13be56);return _0x4e2472[_0x6ef9('0x2b')]()[_0x6ef9('0x26')](function(_0x2df233){return BPromise[_0x6ef9('0x28')]({'id':_0x2df233[_0x6ef9('0x2c')],'name':_0x2df233[_0x6ef9('0x2d')]});});}});}else{logger[_0x6ef9('0x1d')](_0x6ef9('0x2a'),_0x13be56);return _0x4e2472[_0x6ef9('0x2b')]()[_0x6ef9('0x26')](function(_0x398de0){return BPromise['resolve']({'id':_0x398de0[_0x6ef9('0x2c')],'name':_0x398de0[_0x6ef9('0x2d')]});});}}function getEndUser(_0x2e0087,_0x448bae,_0x4f73a6,_0x19537f,_0x3032a1){var _0x35d70a={'$or':{'Phone':_0x19537f}};var _0x4ca9c6={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6ef9('0x28')]()[_0x6ef9('0x26')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x19537f,_0x448bae[_0x6ef9('0x2e')]);switch(_0x448bae[_0x6ef9('0x2e')]){case _0x6ef9('0x2f'):var _0x5d95a5=_[_0x6ef9('0x30')](_0x35d70a);if(_0x448bae[_0x6ef9('0x31')]){var _0x212dda={};_0x212dda[_0x448bae['additionalSearchContact']]=_0x19537f;_['merge'](_0x5d95a5[_0x6ef9('0x32')],_0x212dda);}return _0x3032a1[_0x6ef9('0x1f')]('Contact')['find'](_0x5d95a5,_0x4ca9c6)[_0x6ef9('0x25')]()[_0x6ef9('0x26')](function(_0x10972e){if(_0x10972e&&_0x10972e[_0x6ef9('0x27')]){return _0x10972e;}else{var _0x181881=_[_0x6ef9('0x30')](_0x35d70a);if(_0x448bae[_0x6ef9('0x33')]){var _0x9bf475={};_0x9bf475[_0x448bae[_0x6ef9('0x33')]]=_0x19537f;_[_0x6ef9('0x34')](_0x181881['$or'],_0x9bf475);}return _0x3032a1[_0x6ef9('0x1f')](_0x6ef9('0x35'))['find'](_0x181881,_0x4ca9c6);}});case _0x6ef9('0x36'):var _0x460ccb=_[_0x6ef9('0x30')](_0x35d70a);if(_0x448bae['additionalSearchAccount']){var _0x212dda={};_0x212dda[_0x448bae[_0x6ef9('0x37')]]=_0x19537f;_[_0x6ef9('0x34')](_0x460ccb[_0x6ef9('0x32')],_0x212dda);}return _0x3032a1[_0x6ef9('0x1f')](_0x6ef9('0x38'))[_0x6ef9('0x24')](_0x460ccb,_0x4ca9c6)['execute']()['then'](function(_0x3e804b){if(_0x3e804b&&_0x3e804b[_0x6ef9('0x27')]){return _0x3e804b;}else{var _0x29689b=_[_0x6ef9('0x30')](_0x35d70a);if(_0x448bae[_0x6ef9('0x31')]){var _0xd317c7={};_0xd317c7[_0x448bae[_0x6ef9('0x31')]]=_0x19537f;_[_0x6ef9('0x34')](_0x29689b[_0x6ef9('0x32')],_0xd317c7);}return _0x3032a1['sobject'](_0x6ef9('0x39'))[_0x6ef9('0x24')](_0x29689b,_0x4ca9c6)[_0x6ef9('0x26')](function(_0x3f72bd){if(_0x3f72bd&&_0x3f72bd[_0x6ef9('0x27')]){return _0x3f72bd;}else{var _0x201dda=_[_0x6ef9('0x30')](_0x35d70a);if(_0x448bae[_0x6ef9('0x33')]){var _0x47d8d3={};_0x47d8d3[_0x448bae[_0x6ef9('0x33')]]=_0x19537f;_[_0x6ef9('0x34')](_0x201dda['$or'],_0x47d8d3);}return _0x3032a1[_0x6ef9('0x1f')](_0x6ef9('0x35'))[_0x6ef9('0x24')](_0x201dda,_0x4ca9c6);}});}});case _0x6ef9('0x15'):var _0x5d95a5=_[_0x6ef9('0x30')](_0x35d70a);if(_0x448bae['additionalSearchContact']){var _0x212dda={};_0x212dda[_0x448bae[_0x6ef9('0x31')]]=_0x19537f;_[_0x6ef9('0x34')](_0x5d95a5['$or'],_0x212dda);}return _0x3032a1[_0x6ef9('0x1f')](_0x6ef9('0x39'))['find'](_0x5d95a5,_0x4ca9c6)[_0x6ef9('0x25')]();case'lead':var _0x55cb8f=_[_0x6ef9('0x30')](_0x35d70a);if(_0x448bae[_0x6ef9('0x33')]){var _0x212dda={};_0x212dda[_0x448bae[_0x6ef9('0x33')]]=_0x19537f;_[_0x6ef9('0x34')](_0x55cb8f[_0x6ef9('0x32')],_0x212dda);}return _0x3032a1[_0x6ef9('0x1f')](_0x6ef9('0x35'))['find'](_0x55cb8f,_0x4ca9c6);case _0x6ef9('0x17'):var _0x460ccb=_[_0x6ef9('0x30')](_0x35d70a);if(_0x448bae[_0x6ef9('0x37')]){var _0x212dda={};_0x212dda[_0x448bae[_0x6ef9('0x37')]]=_0x19537f;_[_0x6ef9('0x34')](_0x460ccb[_0x6ef9('0x32')],_0x212dda);}return _0x3032a1['sobject'](_0x6ef9('0x38'))[_0x6ef9('0x24')](_0x460ccb,_0x4ca9c6);default:return null;}})[_0x6ef9('0x26')](function(_0x206db5){if(_0x206db5&&_0x206db5[_0x6ef9('0x27')]){var _0x5b9630=_[_0x6ef9('0x3a')](_0x206db5);if(_0x5b9630){return BPromise['resolve']({'id':_0x5b9630['Id'],'name':_0x5b9630[_0x6ef9('0x29')],'phone':_0x5b9630[_0x6ef9('0x3b')],'endUserType':_0x5b9630[_0x6ef9('0x3c')][_0x6ef9('0x3d')][_0x6ef9('0x3e')]()});}}})[_0x6ef9('0x26')](function(_0x1b0ccc){if(_0x1b0ccc){logger[_0x6ef9('0x1d')](_0x6ef9('0x3f'),_0x1b0ccc[_0x6ef9('0x14')],_0x19537f);return BPromise[_0x6ef9('0x28')](_0x1b0ccc);}else{logger[_0x6ef9('0x1d')](_0x6ef9('0x40'),_0x19537f);var _0xf7625f={'Phone':_0x19537f};if(_0x448bae[_0x6ef9('0x41')]){if(_0x448bae[_0x6ef9('0x41')]==='contact'){logger[_0x6ef9('0x1d')](_0x6ef9('0x42'),_0x19537f,_0x448bae['moduleCreate']);_0xf7625f[_0x6ef9('0x43')]=_0x4f73a6!==_0x6ef9('0x44')?_0x4f73a6:util[_0x6ef9('0x45')]('Caller\x20-\x20%s',_0x19537f);}else if(_0x448bae[_0x6ef9('0x41')]==='lead'){logger[_0x6ef9('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x19537f,_0x448bae[_0x6ef9('0x41')]);_0xf7625f[_0x6ef9('0x43')]=_0x4f73a6!=='<unknown>'?_0x4f73a6:util[_0x6ef9('0x45')](_0x6ef9('0x46'),_0x19537f);_0xf7625f[_0x6ef9('0x47')]='No\x20Company';}else if(_0x448bae[_0x6ef9('0x41')]===_0x6ef9('0x17')){logger[_0x6ef9('0x1d')](_0x6ef9('0x42'),_0x19537f,_0x448bae[_0x6ef9('0x41')]);_0xf7625f['Name']=_0x4f73a6!==_0x6ef9('0x44')?_0x4f73a6:util[_0x6ef9('0x45')]('Caller\x20-\x20%s',_0x19537f);}else{return null;}}return _0x3032a1[_0x6ef9('0x1f')](_[_0x6ef9('0x48')](_0x448bae[_0x6ef9('0x41')]))[_0x6ef9('0x20')](_0xf7625f)['then'](function(_0x93f0fc){return BPromise[_0x6ef9('0x28')]({'id':_0x93f0fc['id'],'endUserType':_0x448bae[_0x6ef9('0x41')]});});}});}function getCustomFields(_0x5348ed,_0x21527c){var _0x4a3ee5={};if(_0x5348ed['length']>0x0){_[_0x6ef9('0x49')](_0x5348ed,function(_0x174645){if(_[_0x6ef9('0x4a')]([_0x6ef9('0x4b'),_0x6ef9('0x4c')],_0x174645[_0x6ef9('0x3d')])&&_0x174645[_0x6ef9('0x4d')]){_0x4a3ee5[_0x174645[_0x6ef9('0x4d')]]=_0x174645['content'][_0x6ef9('0x4e')]();}else if(_0x174645[_0x6ef9('0x3d')]===_0x6ef9('0x4f')&&_0x174645[_0x6ef9('0x50')]&&_0x174645[_0x6ef9('0x4d')]){_0x21527c[_0x174645[_0x6ef9('0x50')]]&&(_0x4a3ee5[_0x174645[_0x6ef9('0x4d')]]=_0x21527c[_0x174645[_0x6ef9('0x50')]]['toString']());}else if(_0x174645[_0x6ef9('0x3d')]===_0x6ef9('0x51')&&_0x174645[_0x6ef9('0x52')]&&_0x174645[_0x6ef9('0x52')][_0x6ef9('0x53')]&&_0x174645[_0x6ef9('0x4d')]){_0x21527c[_0x174645[_0x6ef9('0x52')][_0x6ef9('0x53')]['toLowerCase']()]&&(_0x4a3ee5[_0x174645[_0x6ef9('0x4d')]]=_0x21527c[_0x174645[_0x6ef9('0x52')][_0x6ef9('0x53')][_0x6ef9('0x3e')]()][_0x6ef9('0x4e')]());}});}return _0x4a3ee5;}function getConnection(_0x17ca26){var _0x3a95b4=_0x17ca26[_0x6ef9('0x54')][_0x6ef9('0x55')](_0x17ca26[_0x6ef9('0x56')]);var _0x4cbc50=new jsforce[(_0x6ef9('0x57'))]({'oauth2':{'loginUrl':_0x17ca26['remoteUri']||_0x6ef9('0x58'),'clientId':_0x17ca26[_0x6ef9('0x59')],'clientSecret':_0x17ca26['clientSecret']}});return _0x4cbc50[_0x6ef9('0x5a')](_0x17ca26[_0x6ef9('0x5b')],_0x3a95b4)[_0x6ef9('0x26')](function(){logger['info'](_0x6ef9('0x5c'));return _0x4cbc50;});}exports['queue']=function(_0x5865e8,_0x415b85,_0x3ca509,_0x33dc4a,_0xf3dd18,_0x1793ac){var _0x3806e1,_0x2ebcd9,_0x434702,_0xa1af5c;_0x1793ac[_0x6ef9('0x5d')]=intUtil[_0x6ef9('0x5e')](_0x1793ac[_0x6ef9('0x5d')]);_0x1793ac[_0x6ef9('0x5f')]=intUtil[_0x6ef9('0x5e')](_0x1793ac[_0x6ef9('0x5f')]);if(_0xf3dd18&&_0xf3dd18['monitor_format']){logger[_0x6ef9('0x1d')]('[QUEUE]','Recording\x20is\x20enabled!');_0x415b85['recordingURL']=util['format'](_0x6ef9('0x60'),_0x1793ac['serverUrl'],_0x415b85[_0x6ef9('0x61')],md5(_0x415b85[_0x6ef9('0x61')]));}else{_0x415b85['recordingURL']='';}return getConnection(_0x1793ac)[_0x6ef9('0x26')](function(_0x89081c){_0xa1af5c=_0x89081c;return getUser(_0x1793ac,_0x33dc4a[_0x6ef9('0x62')],_0xa1af5c);})['then'](function(_0x35547a){_0x3806e1=_0x35547a;return getEndUser(_0x1793ac,_0x3ca509,_0x415b85['calleridname'],_0x415b85[_0x6ef9('0x63')],_0xa1af5c);})[_0x6ef9('0x26')](function(_0x3a3f16){_0x2ebcd9=_0x3a3f16;return getTicket(_0x1793ac,_0x3806e1,_0x2ebcd9,_0x3ca509,_0x415b85,_0x3ca509[_0x6ef9('0x64')],_0xa1af5c,'queue');})[_0x6ef9('0x26')](function(_0x13106c){_0x434702=_0x13106c;logger['info'](_0x6ef9('0x65'),_0x434702['id']);logger[_0x6ef9('0x1d')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x434702['id'],_0x33dc4a[_0x6ef9('0x53')],_0x1793ac[_0x6ef9('0x3d')]);switch(_0x1793ac[_0x6ef9('0x3d')]){case'integrationTab':emit(util[_0x6ef9('0x45')]('user:%s',_0x33dc4a[_0x6ef9('0x53')]),_0x6ef9('0x66'),{'recordId':_0x434702['id']});break;case'newTab':emit(util[_0x6ef9('0x45')](_0x6ef9('0x67'),_0x33dc4a[_0x6ef9('0x53')]),_0x6ef9('0x68'),{'uri':util[_0x6ef9('0x45')](_0x6ef9('0x69'),_0xa1af5c[_0x6ef9('0x6a')],_0x434702['id'])});break;default:logger[_0x6ef9('0x6b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x11e831){logger['error'](_0x6ef9('0x6c'),_0x11e831);});};exports['outbound']=function(_0x4e4da4,_0x49fca8,_0x9f2a15,_0x1f4d68,_0x348f87,_0x28feee,_0x47a219){var _0x2df51e,_0x5bf59d,_0x3a6129,_0x47e3ba;_0x28feee[_0x6ef9('0x5d')]=intUtil[_0x6ef9('0x5e')](_0x28feee['serverUrl']);_0x28feee[_0x6ef9('0x5f')]=intUtil['stripTrailingSlash'](_0x28feee[_0x6ef9('0x5f')]);if(_0x47a219&&_0x47a219[_0x6ef9('0x6d')]&&_0x47a219[_0x6ef9('0x6d')]!==_0x6ef9('0x6e')){logger[_0x6ef9('0x1d')](_0x6ef9('0x6f'),'Recording\x20is\x20enabled!');_0x49fca8[_0x6ef9('0x70')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x28feee['serverUrl'],_0x49fca8[_0x6ef9('0x61')],md5(_0x49fca8[_0x6ef9('0x61')]));}return getConnection(_0x28feee)['then'](function(_0x4c40ca){_0x47e3ba=_0x4c40ca;return getUser(_0x28feee,_0x1f4d68['email'],_0x47e3ba);})[_0x6ef9('0x26')](function(_0x597b74){_0x2df51e=_0x597b74;return getEndUser(_0x28feee,_0x9f2a15,_0x49fca8[_0x6ef9('0x71')],_0x49fca8[_0x6ef9('0x72')],_0x47e3ba);})['then'](function(_0x4433fa){_0x5bf59d=_0x4433fa;return getTicket(_0x28feee,_0x2df51e,_0x5bf59d,_0x9f2a15,_0x49fca8,_0x9f2a15[_0x6ef9('0x64')],_0x47e3ba,_0x6ef9('0x73'));})[_0x6ef9('0x26')](function(_0x44f79d){_0x3a6129=_0x44f79d;logger[_0x6ef9('0x1d')](_0x6ef9('0x74'),_0x3a6129['id']);logger[_0x6ef9('0x1d')](_0x6ef9('0x75'),_0x3a6129['id'],_0x1f4d68[_0x6ef9('0x53')],_0x28feee[_0x6ef9('0x3d')]);switch(_0x28feee[_0x6ef9('0x3d')]){case'integrationTab':emit(util[_0x6ef9('0x45')](_0x6ef9('0x67'),_0x1f4d68[_0x6ef9('0x53')]),_0x6ef9('0x66'),{'recordId':_0x3a6129['id']});break;case _0x6ef9('0x76'):emit(util['format']('user:%s',_0x1f4d68['name']),'trigger:browser:url',{'uri':util[_0x6ef9('0x45')](_0x6ef9('0x69'),_0x47e3ba[_0x6ef9('0x6a')],_0x3a6129['id'])});break;default:logger[_0x6ef9('0x6b')](_0x6ef9('0x6f'),_0x6ef9('0x77'));}})[_0x6ef9('0x78')](function(_0x213327){logger[_0x6ef9('0x6b')]('[OUTBOUND]',_0x213327);});};exports[_0x6ef9('0x79')]=function(_0x1c526c,_0xa8fc0e,_0x43023a,_0x1d3857,_0x12c4e5,_0x41fab5){var _0x45c032,_0x1aa13b,_0x2fcb9a,_0x310618;_0x41fab5[_0x6ef9('0x5d')]=intUtil[_0x6ef9('0x5e')](_0x41fab5[_0x6ef9('0x5d')]);_0x41fab5[_0x6ef9('0x5f')]=intUtil[_0x6ef9('0x5e')](_0x41fab5['remoteUri']);if(_0x12c4e5&&_0x12c4e5['monitor_format']){logger[_0x6ef9('0x1d')]('['+_0xa8fc0e['lastevent'][_0x6ef9('0x7a')]()+']',_0x6ef9('0x7b'));_0xa8fc0e['recordingURL']=util[_0x6ef9('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41fab5['serverUrl'],_0xa8fc0e['uniqueid'],md5(_0xa8fc0e['uniqueid']));}else{_0xa8fc0e['recordingURL']='';}return getConnection(_0x41fab5)[_0x6ef9('0x26')](function(_0x4d95b1){_0x310618=_0x4d95b1;if(!_[_0x6ef9('0x21')](_0x1d3857)){return getUser(_0x41fab5,_0x1d3857[_0x6ef9('0x53')],_0x310618);}else{return getUser(_0x41fab5,null,_0x310618);}})[_0x6ef9('0x26')](function(_0x3f2e4e){_0x45c032=_0x3f2e4e;return getEndUser(_0x41fab5,_0x43023a,_0xa8fc0e['calleridname'],_0xa8fc0e[_0x6ef9('0x63')],_0x310618);})[_0x6ef9('0x26')](function(_0x45e8a9){_0x1aa13b=_0x45e8a9;return getTicket(_0x41fab5,_0x45c032,_0x1aa13b,_0x43023a,_0xa8fc0e,_0x43023a['Fields'],_0x310618);})[_0x6ef9('0x26')](function(_0x46df6d){_0x2fcb9a=_0x46df6d;logger['info']('['+_0xa8fc0e[_0x6ef9('0x7c')][_0x6ef9('0x7a')]()+_0x6ef9('0x7d'),_0x2fcb9a['id']);logger[_0x6ef9('0x1d')]('['+_0xa8fc0e[_0x6ef9('0x7c')][_0x6ef9('0x7a')]()+_0x6ef9('0x7e'),_0x41fab5['type']);})[_0x6ef9('0x78')](function(_0x448b2e){logger['error']('['+_0xa8fc0e[_0x6ef9('0x7c')][_0x6ef9('0x7a')]()+']',_0x448b2e);});};
\ No newline at end of file
+var _0xf8db=['first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','<unknown>','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','[OUTBOUND]','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','./util','../../../../config/logger','salesforce','redis','defaults','emit','getString','Subjects','Descriptions','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','account','WhatId','Case','ContactId','AccountId','lead','leadId','info','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account'];(function(_0x41d838,_0x150c4d){var _0x117855=function(_0x2b50d9){while(--_0x2b50d9){_0x41d838['push'](_0x41d838['shift']());}};_0x117855(++_0x150c4d);}(_0xf8db,0xc8));var _0xbf8d=function(_0x5e69f3,_0x2f6457){_0x5e69f3=_0x5e69f3-0x0;var _0xef6033=_0xf8db[_0x5e69f3];return _0xef6033;};'use strict';var _=require(_0xbf8d('0x0'));var rp=require(_0xbf8d('0x1'));var moment=require(_0xbf8d('0x2'));var BPromise=require('bluebird');var md5=require(_0xbf8d('0x3'));var jsforce=require(_0xbf8d('0x4'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xbf8d('0x5'));var config=require('../../../../config/environment');var logger=require(_0xbf8d('0x6'))(_0xbf8d('0x7'));config[_0xbf8d('0x8')]=_[_0xbf8d('0x9')](config[_0xbf8d('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xe5c6bd,_0x429d99,_0x574ed3){io['to'](_0xe5c6bd)[_0xbf8d('0xa')](_0x429d99,_0x574ed3);}function getTicket(_0x127042,_0x239803,_0x33de11,_0x23985b,_0x42a805,_0x3c5218,_0x5f3add,_0x598c65){var _0x36e2ba=Object['assign']({},{'OwnerId':_0x239803['id'],'Subject':intUtil[_0xbf8d('0xb')](_0x23985b[_0xbf8d('0xc')],_0x42a805,'\x20'),'Description':intUtil[_0xbf8d('0xb')](_0x23985b[_0xbf8d('0xd')],_0x42a805,'\x0a')},getCustomFields(_0x3c5218,_0x42a805));if(_0x33de11){if(_0x23985b[_0xbf8d('0xe')]===_0xbf8d('0xf')){_0x36e2ba['ActivityDate']=moment[_0xbf8d('0x10')]();_0x36e2ba[_0xbf8d('0x11')]=![];_0x36e2ba[_0xbf8d('0x12')]=![];if(_0x33de11[_0xbf8d('0x13')]===_0xbf8d('0x14')||_0x33de11[_0xbf8d('0x13')]==='lead'){_0x36e2ba[_0xbf8d('0x15')]=_0x33de11['id'];}else if(_0x33de11['endUserType']===_0xbf8d('0x16')){_0x36e2ba[_0xbf8d('0x17')]=_0x33de11['id'];}}else if(_0x23985b[_0xbf8d('0xe')]===_0xbf8d('0x18')){if(_0x33de11['endUserType']===_0xbf8d('0x14')){_0x36e2ba[_0xbf8d('0x19')]=_0x33de11['id'];}else if(_0x33de11[_0xbf8d('0x13')]===_0xbf8d('0x16')){_0x36e2ba[_0xbf8d('0x1a')]=_0x33de11['id'];}else if(_0x33de11[_0xbf8d('0x13')]===_0xbf8d('0x1b')&&_0x23985b[_0xbf8d('0x1c')]){_0x36e2ba[_0x23985b[_0xbf8d('0x1c')]]=_0x33de11['id'];}else{logger[_0xbf8d('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x5f3add[_0xbf8d('0x1e')](_0x23985b[_0xbf8d('0xe')])[_0xbf8d('0x1f')](_0x36e2ba);}function getUser(_0x10f6cc,_0x4e8f61,_0x3aa9b9){if(!_[_0xbf8d('0x20')](_0x4e8f61)&&intUtil[_0xbf8d('0x21')](_0x4e8f61)){var _0x5a3a5a={'Email':_0x4e8f61};var _0x2897e6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3aa9b9[_0xbf8d('0x1e')](_0xbf8d('0x22'))[_0xbf8d('0x23')](_0x5a3a5a,_0x2897e6)[_0xbf8d('0x24')]()[_0xbf8d('0x25')](function(_0x201beb){if(_0x201beb[_0xbf8d('0x26')]){var _0x4913ba=_['find'](_0x201beb,function(_0x4a7a42){return _0x4a7a42[_0xbf8d('0x27')]===_0x4e8f61;});if(_0x4913ba){logger[_0xbf8d('0x1d')](_0xbf8d('0x28'),_0x4e8f61);return BPromise[_0xbf8d('0x29')]({'id':_0x4913ba['Id'],'name':_0x4913ba[_0xbf8d('0x2a')]});}}else{logger[_0xbf8d('0x1d')](_0xbf8d('0x2b'),_0x4e8f61);return _0x3aa9b9['identity']()['then'](function(_0x391afd){return BPromise[_0xbf8d('0x29')]({'id':_0x391afd[_0xbf8d('0x2c')],'name':_0x391afd['display_name']});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4e8f61);return _0x3aa9b9[_0xbf8d('0x2d')]()[_0xbf8d('0x25')](function(_0x4fb8ac){return BPromise[_0xbf8d('0x29')]({'id':_0x4fb8ac[_0xbf8d('0x2c')],'name':_0x4fb8ac['display_name']});});}}function getEndUser(_0x500488,_0x4904b8,_0x167337,_0x3bea04,_0xb10ce6){var _0x591bc6={'$or':{'Phone':_0x3bea04}};var _0x4a8cdc={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xbf8d('0x25')](function(){logger[_0xbf8d('0x1d')](_0xbf8d('0x2e'),_0x3bea04,_0x4904b8[_0xbf8d('0x2f')]);switch(_0x4904b8[_0xbf8d('0x2f')]){case'contact_lead':var _0x3c44a4=_[_0xbf8d('0x30')](_0x591bc6);if(_0x4904b8[_0xbf8d('0x31')]){var _0x2d53a4={};_0x2d53a4[_0x4904b8[_0xbf8d('0x31')]]=_0x3bea04;_[_0xbf8d('0x32')](_0x3c44a4[_0xbf8d('0x33')],_0x2d53a4);}return _0xb10ce6[_0xbf8d('0x1e')](_0xbf8d('0x34'))[_0xbf8d('0x23')](_0x3c44a4,_0x4a8cdc)['execute']()[_0xbf8d('0x25')](function(_0x3630bf){if(_0x3630bf&&_0x3630bf['length']){return _0x3630bf;}else{var _0x5d4375=_[_0xbf8d('0x30')](_0x591bc6);if(_0x4904b8[_0xbf8d('0x35')]){var _0x45424e={};_0x45424e[_0x4904b8[_0xbf8d('0x35')]]=_0x3bea04;_[_0xbf8d('0x32')](_0x5d4375[_0xbf8d('0x33')],_0x45424e);}return _0xb10ce6[_0xbf8d('0x1e')](_0xbf8d('0x36'))[_0xbf8d('0x23')](_0x5d4375,_0x4a8cdc);}});case _0xbf8d('0x37'):var _0x500c75=_[_0xbf8d('0x30')](_0x591bc6);if(_0x4904b8[_0xbf8d('0x38')]){var _0x2d53a4={};_0x2d53a4[_0x4904b8['additionalSearchAccount']]=_0x3bea04;_['merge'](_0x500c75[_0xbf8d('0x33')],_0x2d53a4);}return _0xb10ce6['sobject'](_0xbf8d('0x39'))[_0xbf8d('0x23')](_0x500c75,_0x4a8cdc)[_0xbf8d('0x24')]()[_0xbf8d('0x25')](function(_0x2b7dc0){if(_0x2b7dc0&&_0x2b7dc0['length']){return _0x2b7dc0;}else{var _0x487c87=_[_0xbf8d('0x30')](_0x591bc6);if(_0x4904b8[_0xbf8d('0x31')]){var _0x166e7d={};_0x166e7d[_0x4904b8[_0xbf8d('0x31')]]=_0x3bea04;_[_0xbf8d('0x32')](_0x487c87['$or'],_0x166e7d);}return _0xb10ce6['sobject'](_0xbf8d('0x34'))['find'](_0x487c87,_0x4a8cdc)[_0xbf8d('0x25')](function(_0x38e0a5){if(_0x38e0a5&&_0x38e0a5[_0xbf8d('0x26')]){return _0x38e0a5;}else{var _0x41c322=_[_0xbf8d('0x30')](_0x591bc6);if(_0x4904b8['additionalSearchLead']){var _0x597771={};_0x597771[_0x4904b8[_0xbf8d('0x35')]]=_0x3bea04;_[_0xbf8d('0x32')](_0x41c322['$or'],_0x597771);}return _0xb10ce6[_0xbf8d('0x1e')]('Lead')['find'](_0x41c322,_0x4a8cdc);}});}});case _0xbf8d('0x14'):var _0x3c44a4=_[_0xbf8d('0x30')](_0x591bc6);if(_0x4904b8['additionalSearchContact']){var _0x2d53a4={};_0x2d53a4[_0x4904b8[_0xbf8d('0x31')]]=_0x3bea04;_[_0xbf8d('0x32')](_0x3c44a4[_0xbf8d('0x33')],_0x2d53a4);}return _0xb10ce6[_0xbf8d('0x1e')](_0xbf8d('0x34'))['find'](_0x3c44a4,_0x4a8cdc)[_0xbf8d('0x24')]();case'lead':var _0x21474c=_[_0xbf8d('0x30')](_0x591bc6);if(_0x4904b8[_0xbf8d('0x35')]){var _0x2d53a4={};_0x2d53a4[_0x4904b8[_0xbf8d('0x35')]]=_0x3bea04;_[_0xbf8d('0x32')](_0x21474c[_0xbf8d('0x33')],_0x2d53a4);}return _0xb10ce6[_0xbf8d('0x1e')](_0xbf8d('0x36'))[_0xbf8d('0x23')](_0x21474c,_0x4a8cdc);case _0xbf8d('0x16'):var _0x500c75=_[_0xbf8d('0x30')](_0x591bc6);if(_0x4904b8[_0xbf8d('0x38')]){var _0x2d53a4={};_0x2d53a4[_0x4904b8[_0xbf8d('0x38')]]=_0x3bea04;_['merge'](_0x500c75[_0xbf8d('0x33')],_0x2d53a4);}return _0xb10ce6['sobject'](_0xbf8d('0x39'))['find'](_0x500c75,_0x4a8cdc);default:return null;}})[_0xbf8d('0x25')](function(_0x548254){if(_0x548254&&_0x548254[_0xbf8d('0x26')]){var _0x41df7c=_[_0xbf8d('0x3a')](_0x548254);if(_0x41df7c){return BPromise[_0xbf8d('0x29')]({'id':_0x41df7c['Id'],'name':_0x41df7c[_0xbf8d('0x2a')],'phone':_0x41df7c[_0xbf8d('0x3b')],'endUserType':_0x41df7c[_0xbf8d('0x3c')]['type'][_0xbf8d('0x3d')]()});}}})[_0xbf8d('0x25')](function(_0xf6b2ea){if(_0xf6b2ea){logger['info'](_0xbf8d('0x3e'),_0xf6b2ea[_0xbf8d('0x13')],_0x3bea04);return BPromise[_0xbf8d('0x29')](_0xf6b2ea);}else{logger['info'](_0xbf8d('0x3f'),_0x3bea04);var _0x570e79={'Phone':_0x3bea04};if(_0x4904b8[_0xbf8d('0x40')]){if(_0x4904b8[_0xbf8d('0x40')]===_0xbf8d('0x14')){logger[_0xbf8d('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3bea04,_0x4904b8['moduleCreate']);_0x570e79[_0xbf8d('0x41')]=_0x167337!==_0xbf8d('0x42')?_0x167337:util[_0xbf8d('0x43')](_0xbf8d('0x44'),_0x3bea04);}else if(_0x4904b8['moduleCreate']===_0xbf8d('0x1b')){logger[_0xbf8d('0x1d')](_0xbf8d('0x45'),_0x3bea04,_0x4904b8[_0xbf8d('0x40')]);_0x570e79[_0xbf8d('0x41')]=_0x167337!==_0xbf8d('0x42')?_0x167337:util[_0xbf8d('0x43')](_0xbf8d('0x44'),_0x3bea04);_0x570e79[_0xbf8d('0x46')]=_0xbf8d('0x47');}else if(_0x4904b8[_0xbf8d('0x40')]===_0xbf8d('0x16')){logger[_0xbf8d('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3bea04,_0x4904b8[_0xbf8d('0x40')]);_0x570e79[_0xbf8d('0x2a')]=_0x167337!==_0xbf8d('0x42')?_0x167337:util[_0xbf8d('0x43')](_0xbf8d('0x44'),_0x3bea04);}else{return null;}}return _0xb10ce6[_0xbf8d('0x1e')](_[_0xbf8d('0x48')](_0x4904b8['moduleCreate']))[_0xbf8d('0x1f')](_0x570e79)[_0xbf8d('0x25')](function(_0x13591c){return BPromise[_0xbf8d('0x29')]({'id':_0x13591c['id'],'endUserType':_0x4904b8[_0xbf8d('0x40')]});});}});}function getCustomFields(_0x5a1c70,_0x5a08f6){var _0x4c2052={};if(_0x5a1c70[_0xbf8d('0x26')]>0x0){_[_0xbf8d('0x49')](_0x5a1c70,function(_0x3f82b0){if(_[_0xbf8d('0x4a')]([_0xbf8d('0x4b'),'picklist'],_0x3f82b0['type'])&&_0x3f82b0[_0xbf8d('0x4c')]){_0x4c2052[_0x3f82b0['idField']]=_0x3f82b0[_0xbf8d('0x4d')][_0xbf8d('0x4e')]();}else if(_0x3f82b0[_0xbf8d('0x4f')]===_0xbf8d('0x50')&&_0x3f82b0[_0xbf8d('0x51')]&&_0x3f82b0[_0xbf8d('0x4c')]){_0x5a08f6[_0x3f82b0[_0xbf8d('0x51')]]&&(_0x4c2052[_0x3f82b0['idField']]=_0x5a08f6[_0x3f82b0[_0xbf8d('0x51')]][_0xbf8d('0x4e')]());}else if(_0x3f82b0[_0xbf8d('0x4f')]==='customVariable'&&_0x3f82b0[_0xbf8d('0x52')]&&_0x3f82b0[_0xbf8d('0x52')][_0xbf8d('0x53')]&&_0x3f82b0[_0xbf8d('0x4c')]){_0x5a08f6[_0x3f82b0[_0xbf8d('0x52')][_0xbf8d('0x53')]['toLowerCase']()]&&(_0x4c2052[_0x3f82b0['idField']]=_0x5a08f6[_0x3f82b0[_0xbf8d('0x52')]['name'][_0xbf8d('0x3d')]()]['toString']());}});}return _0x4c2052;}function getConnection(_0x1ff806){var _0x59ab32=_0x1ff806[_0xbf8d('0x54')][_0xbf8d('0x55')](_0x1ff806[_0xbf8d('0x56')]);var _0x51be8f=new jsforce[(_0xbf8d('0x57'))]({'oauth2':{'loginUrl':_0x1ff806[_0xbf8d('0x58')]||_0xbf8d('0x59'),'clientId':_0x1ff806[_0xbf8d('0x5a')],'clientSecret':_0x1ff806['clientSecret']}});return _0x51be8f[_0xbf8d('0x5b')](_0x1ff806[_0xbf8d('0x5c')],_0x59ab32)[_0xbf8d('0x25')](function(){logger[_0xbf8d('0x1d')](_0xbf8d('0x5d'));return _0x51be8f;});}exports[_0xbf8d('0x5e')]=function(_0x349f50,_0x11c682,_0x2485bf,_0x37be15,_0x5458ee,_0x4b34fa){var _0x6744c5,_0x2f2646,_0x41f7fc,_0x11490b;_0x4b34fa[_0xbf8d('0x5f')]=intUtil[_0xbf8d('0x60')](_0x4b34fa['serverUrl']);_0x4b34fa[_0xbf8d('0x58')]=intUtil[_0xbf8d('0x60')](_0x4b34fa[_0xbf8d('0x58')]);if(_0x5458ee&&_0x5458ee[_0xbf8d('0x61')]){logger[_0xbf8d('0x1d')](_0xbf8d('0x62'),_0xbf8d('0x63'));_0x11c682[_0xbf8d('0x64')]=util['format'](_0xbf8d('0x65'),_0x4b34fa[_0xbf8d('0x5f')],_0x11c682['uniqueid'],md5(_0x11c682[_0xbf8d('0x66')]));}else{_0x11c682[_0xbf8d('0x64')]='';}return getConnection(_0x4b34fa)[_0xbf8d('0x25')](function(_0x3ae924){_0x11490b=_0x3ae924;return getUser(_0x4b34fa,_0x37be15[_0xbf8d('0x67')],_0x11490b);})['then'](function(_0x15e660){_0x6744c5=_0x15e660;return getEndUser(_0x4b34fa,_0x2485bf,_0x11c682[_0xbf8d('0x68')],_0x11c682[_0xbf8d('0x69')],_0x11490b);})['then'](function(_0x40b619){_0x2f2646=_0x40b619;return getTicket(_0x4b34fa,_0x6744c5,_0x2f2646,_0x2485bf,_0x11c682,_0x2485bf[_0xbf8d('0x6a')],_0x11490b,'queue');})[_0xbf8d('0x25')](function(_0x14247b){_0x41f7fc=_0x14247b;logger[_0xbf8d('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x41f7fc['id']);logger['info'](_0xbf8d('0x6b'),_0x41f7fc['id'],_0x37be15['name'],_0x4b34fa[_0xbf8d('0x4f')]);switch(_0x4b34fa[_0xbf8d('0x4f')]){case'integrationTab':emit(util[_0xbf8d('0x43')](_0xbf8d('0x6c'),_0x37be15['name']),_0xbf8d('0x6d'),{'recordId':_0x41f7fc['id']});break;case _0xbf8d('0x6e'):emit(util[_0xbf8d('0x43')](_0xbf8d('0x6c'),_0x37be15[_0xbf8d('0x53')]),_0xbf8d('0x6f'),{'uri':util['format'](_0xbf8d('0x70'),_0x11490b[_0xbf8d('0x71')],_0x41f7fc['id'])});break;default:logger[_0xbf8d('0x72')](_0xbf8d('0x73'));}})[_0xbf8d('0x74')](function(_0x4779cb){logger['error']('[QUEUE]',_0x4779cb);});};exports['outbound']=function(_0x129e2b,_0x28f374,_0x40fd3b,_0x50a3c5,_0x577c82,_0x470466,_0x34c9b9){var _0x5db158,_0x56bef2,_0x4869dd,_0x72c153;_0x470466[_0xbf8d('0x5f')]=intUtil[_0xbf8d('0x60')](_0x470466['serverUrl']);_0x470466[_0xbf8d('0x58')]=intUtil[_0xbf8d('0x60')](_0x470466['remoteUri']);if(_0x34c9b9&&_0x34c9b9[_0xbf8d('0x75')]&&_0x34c9b9['recordingFormat']!=='none'){logger['info']('[OUTBOUND]',_0xbf8d('0x63'));_0x28f374[_0xbf8d('0x64')]=util[_0xbf8d('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x470466[_0xbf8d('0x5f')],_0x28f374[_0xbf8d('0x66')],md5(_0x28f374['uniqueid']));}return getConnection(_0x470466)[_0xbf8d('0x25')](function(_0x563744){_0x72c153=_0x563744;return getUser(_0x470466,_0x50a3c5['email'],_0x72c153);})[_0xbf8d('0x25')](function(_0x160613){_0x5db158=_0x160613;return getEndUser(_0x470466,_0x40fd3b,_0x28f374[_0xbf8d('0x76')],_0x28f374[_0xbf8d('0x77')],_0x72c153);})[_0xbf8d('0x25')](function(_0x4fc642){_0x56bef2=_0x4fc642;return getTicket(_0x470466,_0x5db158,_0x56bef2,_0x40fd3b,_0x28f374,_0x40fd3b[_0xbf8d('0x6a')],_0x72c153,'outbound');})[_0xbf8d('0x25')](function(_0x3750b9){_0x4869dd=_0x3750b9;logger[_0xbf8d('0x1d')](_0xbf8d('0x78'),_0x4869dd['id']);logger['info'](_0xbf8d('0x79'),_0x4869dd['id'],_0x50a3c5[_0xbf8d('0x53')],_0x470466[_0xbf8d('0x4f')]);switch(_0x470466[_0xbf8d('0x4f')]){case _0xbf8d('0x7a'):emit(util[_0xbf8d('0x43')](_0xbf8d('0x6c'),_0x50a3c5[_0xbf8d('0x53')]),'trigger:salesforce:display',{'recordId':_0x4869dd['id']});break;case _0xbf8d('0x6e'):emit(util[_0xbf8d('0x43')]('user:%s',_0x50a3c5['name']),_0xbf8d('0x6f'),{'uri':util[_0xbf8d('0x43')](_0xbf8d('0x70'),_0x72c153['instanceUrl'],_0x4869dd['id'])});break;default:logger[_0xbf8d('0x72')](_0xbf8d('0x7b'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xbf8d('0x74')](function(_0x1c9ee4){logger[_0xbf8d('0x72')](_0xbf8d('0x7b'),_0x1c9ee4);});};exports[_0xbf8d('0x7c')]=function(_0x4a02d4,_0x1afade,_0x33492a,_0x1c8eff,_0x4297ff,_0xc94d62){var _0xc56fa0,_0x39da06,_0x427ec5,_0xd65d99;_0xc94d62['serverUrl']=intUtil[_0xbf8d('0x60')](_0xc94d62[_0xbf8d('0x5f')]);_0xc94d62[_0xbf8d('0x58')]=intUtil[_0xbf8d('0x60')](_0xc94d62[_0xbf8d('0x58')]);if(_0x4297ff&&_0x4297ff[_0xbf8d('0x61')]){logger[_0xbf8d('0x1d')]('['+_0x1afade['lastevent'][_0xbf8d('0x7d')]()+']',_0xbf8d('0x63'));_0x1afade[_0xbf8d('0x64')]=util[_0xbf8d('0x43')](_0xbf8d('0x65'),_0xc94d62['serverUrl'],_0x1afade[_0xbf8d('0x66')],md5(_0x1afade[_0xbf8d('0x66')]));}else{_0x1afade['recordingURL']='';}return getConnection(_0xc94d62)['then'](function(_0x40cf2f){_0xd65d99=_0x40cf2f;if(!_[_0xbf8d('0x20')](_0x1c8eff)){return getUser(_0xc94d62,_0x1c8eff[_0xbf8d('0x53')],_0xd65d99);}else{return getUser(_0xc94d62,null,_0xd65d99);}})[_0xbf8d('0x25')](function(_0x384fe1){_0xc56fa0=_0x384fe1;return getEndUser(_0xc94d62,_0x33492a,_0x1afade['calleridname'],_0x1afade[_0xbf8d('0x69')],_0xd65d99);})[_0xbf8d('0x25')](function(_0x475528){_0x39da06=_0x475528;return getTicket(_0xc94d62,_0xc56fa0,_0x39da06,_0x33492a,_0x1afade,_0x33492a[_0xbf8d('0x6a')],_0xd65d99);})['then'](function(_0x54c35b){_0x427ec5=_0x54c35b;logger[_0xbf8d('0x1d')]('['+_0x1afade[_0xbf8d('0x7e')]['toUpperCase']()+_0xbf8d('0x7f'),_0x427ec5['id']);logger['info']('['+_0x1afade['lastevent'][_0xbf8d('0x7d')]()+_0xbf8d('0x80'),_0xc94d62[_0xbf8d('0x4f')]);})[_0xbf8d('0x74')](function(_0x27550a){logger[_0xbf8d('0x72')]('['+_0x1afade[_0xbf8d('0x7e')][_0xbf8d('0x7d')]()+']',_0x27550a);});};
\ No newline at end of file
index 281d7f5..cbd27d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7376=['],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toString','toLowerCase','content','variable','variableName','idField','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','serverUrl','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','remoteUri',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','then','result','length','sys_id','],\x20getAdminUser\x20crm','error','toUpperCase','message','],\x20getUser\x20input\x20crm','userEmail','info','],\x20getUser\x20entity','active','true','userId','adminId','],\x20getUser\x20crm','catch','adminEmail','POST','sys_user?','endUserNumber','user','System'];(function(_0x5b40d8,_0x24e49a){var _0x74dbf2=function(_0x3d8e06){while(--_0x3d8e06){_0x5b40d8['push'](_0x5b40d8['shift']());}};_0x74dbf2(++_0x24e49a);}(_0x7376,0x1e4));var _0x6737=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7376[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x6737('0x0'));var Promise=require(_0x6737('0x1'));var rp=require('request-promise');var util=require(_0x6737('0x2'));var md5=require('md5');var Redis=require(_0x6737('0x3'));var intUtil=require('./util');var config=require(_0x6737('0x4'));var logger=require(_0x6737('0x5'))(_0x6737('0x6'));config[_0x6737('0x7')]=_[_0x6737('0x8')](config[_0x6737('0x7')],{'host':_0x6737('0x9'),'port':0x18eb});var io=require(_0x6737('0xa'))(new Redis(config[_0x6737('0x7')]));function getAdminUser(_0x6b9b07,_0x5263e5,_0x36e82c,_0x771d1e,_0x462330,_0x1ffdcc){return new Promise(function(_0x4316dc,_0x40651){var _0x32a4a5={'method':_0x6737('0xb'),'uri':_0x771d1e+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x462330+'&'+_0x1ffdcc,'auth':_0x5263e5,'json':!![]};return rp(_0x32a4a5)[_0x6737('0xc')](function(_0x3a2d63){if(_0x3a2d63[_0x6737('0xd')][_0x6737('0xe')]>0x0){_0x36e82c['adminId']=_0x3a2d63[_0x6737('0xd')][0x0][_0x6737('0xf')];}logger['info']('['+[_0x6b9b07['toUpperCase']()]+_0x6737('0x10'),_0x36e82c);_0x4316dc(_0x36e82c);})['catch'](function(_0x118a2e){logger[_0x6737('0x11')]('['+[_0x6b9b07[_0x6737('0x12')]()]+']',_0x118a2e[_0x6737('0x13')]);_0x40651(_0x118a2e[_0x6737('0x13')]);});});}function getUser(_0x8a33fb,_0x1a7345,_0x51996b,_0x41737c,_0x4c204a){return function(_0x4e2d90){logger['info']('['+[_0x8a33fb[_0x6737('0x12')]()]+_0x6737('0x14'),_0x4e2d90);return new Promise(function(_0x4c73be,_0x2f1717){if(intUtil['validateEmail'](_0x4e2d90['userEmail'])){var _0x5440d3={'method':_0x6737('0xb'),'uri':_0x51996b+'sys_user?sysparm_query=email%3D'+_0x4e2d90[_0x6737('0x15')]+'&'+_0x41737c+'&'+_0x4c204a,'auth':_0x1a7345,'json':!![]};logger['info']('['+[_0x8a33fb[_0x6737('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x5440d3);return rp(_0x5440d3)['then'](function(_0x467052){logger[_0x6737('0x16')]('['+[_0x8a33fb[_0x6737('0x12')]()]+_0x6737('0x17'),_0x467052);if(_0x467052[_0x6737('0xd')]['length']>0x0&&String(_0x467052[_0x6737('0xd')][0x0][_0x6737('0x18')])===_0x6737('0x19')){_0x4e2d90['userId']=_0x467052[_0x6737('0xd')][0x0][_0x6737('0xf')];}else{_0x4e2d90[_0x6737('0x1a')]=_0x4e2d90[_0x6737('0x1b')];_0x4e2d90[_0x6737('0x15')]=_0x4e2d90['adminEmail'];}logger[_0x6737('0x16')]('['+[_0x8a33fb[_0x6737('0x12')]()]+_0x6737('0x1c'),_0x4e2d90);_0x4c73be(_0x4e2d90);})[_0x6737('0x1d')](function(_0x21f9f5){logger[_0x6737('0x11')]('['+[_0x8a33fb['toUpperCase']()]+']',_0x21f9f5[_0x6737('0x13')]);_0x2f1717(_0x21f9f5['message']);});}else{logger[_0x6737('0x16')]('['+[_0x8a33fb[_0x6737('0x12')]()]+']\x20using\x20admin\x20profile');_0x4e2d90[_0x6737('0x1a')]=_0x4e2d90[_0x6737('0x1b')];_0x4e2d90[_0x6737('0x15')]=_0x4e2d90[_0x6737('0x1e')];_0x4c73be(_0x4e2d90);}});};}function createEndUser(_0x13134a,_0x4bfa88,_0x3ec7ad,_0x403680,_0xe657b2){logger[_0x6737('0x16')]('['+[_0x13134a[_0x6737('0x12')]()]+'],\x20createEndUser\x20input\x20crm',_0x3ec7ad);return new Promise(function(_0x1842c4,_0x160e42){var _0xb8bdce={'method':_0x6737('0x1f'),'uri':_0x403680+_0x6737('0x20')+_0xe657b2,'body':{'user_name':_0x3ec7ad[_0x6737('0x21')],'roles':_0x6737('0x22'),'first_name':_0x3ec7ad[_0x6737('0x21')],'active':'true','date_format':_0x6737('0x23'),'phone':_0x3ec7ad['endUserNumber']},'auth':_0x4bfa88,'json':!![]};return rp(_0xb8bdce)[_0x6737('0xc')](function(_0x5ec578){logger[_0x6737('0x16')]('['+[_0x13134a[_0x6737('0x12')]()]+_0x6737('0x24'),_0x5ec578[_0x6737('0xd')]);_0x3ec7ad['endUserId']=_0x5ec578[_0x6737('0xd')][_0x6737('0xf')];_0x1842c4(_0x3ec7ad);})[_0x6737('0x1d')](function(_0x588ab6){logger['error']('['+[_0x13134a['toUpperCase']()]+']',_0x588ab6['message']);_0x160e42(_0x588ab6['message']);});});}function getEndUser(_0x1a67db,_0x1c4a71,_0x591c67,_0x2eae0d,_0x4b318f){return function(_0x374a46){logger[_0x6737('0x16')]('['+[_0x1a67db[_0x6737('0x12')]()]+_0x6737('0x25'),_0x374a46);return new Promise(function(_0xdda9c8,_0x497d5b){var _0x34bf6d={'method':_0x6737('0xb'),'uri':_0x591c67+_0x6737('0x26')+_0x374a46[_0x6737('0x21')]+'&'+_0x2eae0d+'&'+_0x4b318f,'auth':_0x1c4a71,'json':!![]};return rp(_0x34bf6d)['then'](function(_0x20684f){if(_0x20684f[_0x6737('0xd')][_0x6737('0xe')]>0x0){_0x374a46[_0x6737('0x27')]=_0x20684f['result'][0x0][_0x6737('0xf')];logger[_0x6737('0x16')]('['+[_0x1a67db[_0x6737('0x12')]()]+_0x6737('0x28'),_0x374a46);_0xdda9c8(_0x374a46);}else{return createEndUser(_0x1a67db,_0x1c4a71,_0x374a46,_0x591c67,_0x2eae0d)['then'](function(_0x16c8fb){logger['info']('['+[_0x1a67db['toUpperCase']()]+_0x6737('0x29'),_0x16c8fb);_0xdda9c8(_0x16c8fb);});}})[_0x6737('0x1d')](function(_0x4f53ef){logger[_0x6737('0x11')]('['+[_0x1a67db[_0x6737('0x12')]()]+']',_0x4f53ef[_0x6737('0x13')]);_0x497d5b(_0x4f53ef[_0x6737('0x13')]);});});};}function getCustomFields(_0x484324,_0x5d5062){var _0x177f6c={};if(_0x484324[_0x6737('0xe')]>0x0){_[_0x6737('0x2a')](_0x484324,function(_0x44dd01){if(_[_0x6737('0x2b')]([_0x6737('0x2c'),_0x6737('0x2d')],_0x44dd01[_0x6737('0x2e')])&&_0x44dd01[_0x6737('0x2f')]&&!_0x44dd01[_0x6737('0x30')]){_0x177f6c[_0x44dd01[_0x6737('0x2f')]['toLowerCase']()]=_0x44dd01['content'][_0x6737('0x31')]();}else if(_[_0x6737('0x2b')](['string',_0x6737('0x2d')],_0x44dd01[_0x6737('0x2e')])&&_0x44dd01['idField']&&_0x44dd01['customField']){_0x177f6c[_0x44dd01['idField'][_0x6737('0x32')]()]=_0x44dd01[_0x6737('0x33')]['toString']();}else if(_0x44dd01[_0x6737('0x2e')]===_0x6737('0x34')&&_0x44dd01[_0x6737('0x35')]&&_0x44dd01['idField']&&_0x44dd01['customField']){_0x177f6c[_0x44dd01[_0x6737('0x36')]['toLowerCase']()]=_0x5d5062[_0x44dd01[_0x6737('0x35')]][_0x6737('0x31')]();}else if(_0x44dd01[_0x6737('0x2e')]===_0x6737('0x37')&&_0x44dd01[_0x6737('0x38')]&&_0x44dd01[_0x6737('0x38')]['name']&&_0x44dd01['idField']&&_0x44dd01['customField']){_0x177f6c[_0x44dd01[_0x6737('0x36')][_0x6737('0x32')]()]=_0x5d5062[_0x44dd01[_0x6737('0x38')][_0x6737('0x39')][_0x6737('0x32')]()][_0x6737('0x31')]();}});}return _0x177f6c;}function getTicket(_0x58592c,_0x36f7a2,_0x115335,_0x55f393,_0x5b1799,_0x5939b9){return function(_0x5af630){logger[_0x6737('0x16')]('['+[_0x58592c[_0x6737('0x12')]()]+_0x6737('0x3a'),_0x5af630);return new Promise(function(_0x234510,_0x5a0bca){var _0x5ec81b=_0x58592c['toLowerCase']()===_0x6737('0x3b')?_0x5af630[_0x6737('0x1a')]:_0x5af630[_0x6737('0x27')];var _0x3f4e9c={'method':_0x6737('0x1f'),'uri':_0x115335+_0x6737('0x3c')+'?'+_0x5939b9,'body':Object[_0x6737('0x3d')]({},{'active':_0x6737('0x19'),'caller_id':_0x5ec81b,'assigned_to':_0x5af630[_0x6737('0x1a')],'short_description':intUtil[_0x6737('0x3e')](_0x55f393['Subjects'],_0x5b1799,'\x20'),'description':intUtil[_0x6737('0x3e')](_0x55f393[_0x6737('0x3f')],_0x5b1799,'\x0a')},getCustomFields(_0x55f393['Fields'],_0x5b1799)),'auth':_0x36f7a2,'json':!![]};return rp(_0x3f4e9c)[_0x6737('0xc')](function(_0x4c240f){logger[_0x6737('0x16')]('['+[_0x58592c[_0x6737('0x12')]()]+_0x6737('0x40'),_0x4c240f[_0x6737('0xd')]);_0x5af630[_0x6737('0x41')]=_0x4c240f[_0x6737('0xd')][_0x6737('0xf')];_0x5af630['ticketNumber']=_0x4c240f[_0x6737('0xd')]['number'];logger['info']('['+[_0x58592c[_0x6737('0x12')]()]+_0x6737('0x42'),_0x5af630);_0x234510(_0x5af630);})[_0x6737('0x1d')](function(_0x22ca4c){logger['error']('['+[_0x58592c['toUpperCase']()]+']',_0x22ca4c[_0x6737('0x13')]);_0x5a0bca(_0x22ca4c['message']);});});};}function createRemoteTag(_0x282d07,_0x4af984,_0x4a60c4,_0x265216){return new Promise(function(_0x441a94,_0x5c1c20){var _0x4e3363={'method':_0x6737('0x1f'),'uri':_0x4a60c4+_0x6737('0x43')+'?'+_0x265216,'body':{'short_description':_0x282d07,'global':!![],'active':!![],'name':_0x282d07},'auth':_0x4af984,'json':!![]};return rp(_0x4e3363)[_0x6737('0xc')](function(_0x3ea9ab){var _0x347025=_0x3ea9ab[_0x6737('0xd')][_0x6737('0xf')];_0x441a94(_0x347025);});});}function getRemoteTag(_0x42977b,_0x21a88a,_0x5d691c,_0x305ee3,_0x5f291f){return new Promise(function(_0x226d55,_0x1d9b72){var _0x515656={'method':_0x6737('0xb'),'uri':_0x5d691c+_0x6737('0x43')+_0x6737('0x44')+_0x42977b+'&'+_0x305ee3,'auth':_0x21a88a,'json':!![]};return rp(_0x515656)[_0x6737('0xc')](function(_0x514c99){if(_0x514c99['result'][_0x6737('0xe')]>0x0){var _0x13cd48=_0x514c99[_0x6737('0xd')][0x0][_0x6737('0xf')];_0x226d55(_0x13cd48);}else{return createRemoteTag(_0x42977b,_0x21a88a,_0x5d691c,_0x305ee3)[_0x6737('0xc')](function(_0x2d54e4){_0x226d55(_0x2d54e4);});}});});}function assignTagToIncident(_0x1b9a8a,_0x55951e,_0x5084bb,_0x183208,_0x4a95e6){return new Promise(function(_0x52770a,_0x3f2a73){var _0x2f4820={'method':_0x6737('0x1f'),'uri':_0x5084bb+_0x6737('0x45')+'?'+_0x4a95e6,'body':{'label':_0x1b9a8a,'table':_0x6737('0x3c'),'id_type':'Incident','table_key':_0x183208[_0x6737('0x41')],'title':_0x6737('0x46')+_0x183208['ticketNumber'],'id_display':_0x183208['ticketNumber']},'auth':_0x55951e,'json':!![]};return rp(_0x2f4820)['then'](function(_0x41095e){_0x52770a();})[_0x6737('0x1d')](function(){_0x52770a();});});}function manageTags(_0x595f86,_0x1d27ab,_0x57ca9b,_0xcff7cd,_0x5bde9b,_0x4e2d32,_0x667f2b){return new Promise(function(_0x23a0c4,_0x28b7d2){var _0x230ea4=[];_0x1d27ab[_0x6737('0x2a')](function(_0x1340b1){_0x230ea4[_0x6737('0x47')](getRemoteTag(_0x1340b1,_0x57ca9b,_0xcff7cd,_0x4e2d32,_0x667f2b));});return Promise[_0x6737('0x48')](_0x230ea4)[_0x6737('0xc')](function(_0x4bb0f4){if(_0x4bb0f4[_0x6737('0xe')]){logger[_0x6737('0x16')]('['+[_0x595f86[_0x6737('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x4bb0f4);var _0x383bff=[];_0x4bb0f4[_0x6737('0x2a')](function(_0x374604){_0x383bff[_0x6737('0x47')](assignTagToIncident(_0x374604,_0x57ca9b,_0xcff7cd,_0x5bde9b,_0x4e2d32));});return Promise[_0x6737('0x48')](_0x383bff)['then'](function(){_0x23a0c4();})[_0x6737('0x1d')](function(){_0x23a0c4();});}else{_0x23a0c4();}});});}function getTags(_0x4173e1,_0x3790ed,_0x134acf,_0x565825,_0x349208,_0x10b314){return function(_0x5083c0){return new Promise(function(_0xfc302a,_0x1932f5){var _0x4ae534=[];var _0x22d9ed=_0x565825[_0x6737('0x49')];if(_0x22d9ed&&_0x22d9ed[_0x6737('0xe')]>0x0){_0x4ae534=_[_0x6737('0x4a')](_0x22d9ed,_0x6737('0x39'));}if(_0x4ae534[_0x6737('0xe')]>0x0){return manageTags(_0x4173e1,_0x4ae534,_0x3790ed,_0x134acf,_0x5083c0,_0x349208,_0x10b314)[_0x6737('0xc')](function(){_0xfc302a(_0x5083c0);});}else{_0xfc302a(_0x5083c0);}});};}function emit(_0x376a68,_0x270428,_0xb40d07){var _0x4e705a=_0x6737('0x4b')+_0x6737('0x4c')+_0x6737('0x4d')+'%255EORDERBYDESCnumber';var _0x5997c6={'uri':_0x376a68+_0x6737('0x4e')+_0xb40d07+_0x4e705a};io['to'](util[_0x6737('0x4f')](_0x6737('0x50'),_0x270428))['emit']('trigger:browser:url',_0x5997c6);}exports['cs']=function(_0x24d903,_0x961d,_0x488410,_0x242190,_0x127037,_0x5ad7ba,_0x48f0d0,_0x4552bb){var _0x29c080={};var _0x7371bd={'user':_0x5ad7ba[_0x6737('0x51')],'pass':_0x5ad7ba[_0x6737('0x52')]};var _0x2fb326=_0x6737('0x53');var _0x5e13dd=_0x6737('0x54');_0x5ad7ba['remoteUri']=intUtil[_0x6737('0x55')](_0x5ad7ba['remoteUri']);_0x5ad7ba['serverUrl']=intUtil['stripTrailingSlash'](_0x5ad7ba[_0x6737('0x56')]);var _0x505fc0=util[_0x6737('0x4f')]('%s/api/now/table/',_0x5ad7ba['remoteUri']);_0x29c080['userEmail']=!_['isNil'](_0x242190)?_0x242190[_0x6737('0x57')]:null;_0x29c080[_0x6737('0x1e')]=_0x5ad7ba[_0x6737('0x57')];_0x29c080[_0x6737('0x21')]=_0x4552bb[_0x6737('0x32')]()===_0x6737('0x3b')?_0x961d[_0x6737('0x58')]:_0x961d[_0x6737('0x59')];_0x29c080['callDirection']=_0x4552bb===_0x6737('0x5a')||_0x4552bb===_0x6737('0x5b')?_0x6737('0x5a'):'outbound';var _0x59ffeb=util['format'](_0x6737('0x5c'),_0x5ad7ba[_0x6737('0x56')],_0x961d['uniqueid'],md5(_0x961d[_0x6737('0x5d')]));if(_0x127037&&_0x127037[_0x6737('0x5e')]){logger[_0x6737('0x16')](_0x6737('0x5f'),'Recording\x20is\x20enabled!');_0x961d[_0x6737('0x60')]=_0x59ffeb;}else if(_0x48f0d0&&_0x48f0d0[_0x6737('0x61')]&&_0x48f0d0[_0x6737('0x61')]!==_0x6737('0x62')){logger[_0x6737('0x16')]('[OUTBOUND]',_0x6737('0x63'));_0x961d[_0x6737('0x60')]=_0x59ffeb;}else{_0x961d[_0x6737('0x60')]='';}return getAdminUser(_0x4552bb,_0x7371bd,_0x29c080,_0x505fc0,_0x5e13dd,_0x2fb326)[_0x6737('0xc')](getUser(_0x4552bb,_0x7371bd,_0x505fc0,_0x5e13dd,_0x2fb326))[_0x6737('0xc')](getEndUser(_0x4552bb,_0x7371bd,_0x505fc0,_0x5e13dd,_0x2fb326))[_0x6737('0xc')](getTicket(_0x4552bb,_0x7371bd,_0x505fc0,_0x488410,_0x961d,_0x5e13dd))[_0x6737('0xc')](function(_0x291757){logger[_0x6737('0x16')](util[_0x6737('0x4f')](_0x6737('0x64'),_0x291757[_0x6737('0x41')]));logger[_0x6737('0x16')](util[_0x6737('0x4f')]('call\x20direction:\x20%s',_0x4552bb));if(_0x4552bb!==_0x6737('0x5b')){logger['info']('['+[_0x4552bb[_0x6737('0x12')]()]+']',_0x6737('0x65'));emit(_0x5ad7ba[_0x6737('0x66')],_0x242190['name'],_0x291757[_0x6737('0x41')]);}})[_0x6737('0x1d')](function(_0x5b1aec){logger[_0x6737('0x11')]('['+[_0x4552bb['toUpperCase']()]+_0x6737('0x67'),util['inspect'](_0x5b1aec,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xe725=['../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','includes','picklist','type','customField','nameField','toString','string','idField','toLowerCase','content','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','bluebird','request-promise','util','md5','ioredis','./util'];(function(_0xbfa847,_0x53305b){var _0x1f756a=function(_0x4c04b8){while(--_0x4c04b8){_0xbfa847['push'](_0xbfa847['shift']());}};_0x1f756a(++_0x53305b);}(_0xe725,0x147));var _0x5e72=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe725[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var Promise=require(_0x5e72('0x0'));var rp=require(_0x5e72('0x1'));var util=require(_0x5e72('0x2'));var md5=require(_0x5e72('0x3'));var Redis=require(_0x5e72('0x4'));var intUtil=require(_0x5e72('0x5'));var config=require(_0x5e72('0x6'));var logger=require(_0x5e72('0x7'))('servicenow');config['redis']=_[_0x5e72('0x8')](config[_0x5e72('0x9')],{'host':_0x5e72('0xa'),'port':0x18eb});var io=require(_0x5e72('0xb'))(new Redis(config[_0x5e72('0x9')]));function getAdminUser(_0x486332,_0x12acc6,_0x3b47a2,_0x3feb19,_0x396011,_0x34db31){return new Promise(function(_0x56444e,_0x1ab207){var _0x3591d3={'method':_0x5e72('0xc'),'uri':_0x3feb19+_0x5e72('0xd')+'&'+_0x396011+'&'+_0x34db31,'auth':_0x12acc6,'json':!![]};return rp(_0x3591d3)[_0x5e72('0xe')](function(_0x995699){if(_0x995699[_0x5e72('0xf')][_0x5e72('0x10')]>0x0){_0x3b47a2['adminId']=_0x995699[_0x5e72('0xf')][0x0][_0x5e72('0x11')];}logger[_0x5e72('0x12')]('['+[_0x486332[_0x5e72('0x13')]()]+'],\x20getAdminUser\x20crm',_0x3b47a2);_0x56444e(_0x3b47a2);})[_0x5e72('0x14')](function(_0x2b02a6){logger[_0x5e72('0x15')]('['+[_0x486332[_0x5e72('0x13')]()]+']',_0x2b02a6[_0x5e72('0x16')]);_0x1ab207(_0x2b02a6[_0x5e72('0x16')]);});});}function getUser(_0x428791,_0x5adbac,_0x22ecbd,_0x4a6a33,_0x47334a){return function(_0x8b4283){logger[_0x5e72('0x12')]('['+[_0x428791[_0x5e72('0x13')]()]+_0x5e72('0x17'),_0x8b4283);return new Promise(function(_0x3a2c96,_0x3be389){if(intUtil[_0x5e72('0x18')](_0x8b4283[_0x5e72('0x19')])){var _0x1c51f4={'method':_0x5e72('0xc'),'uri':_0x22ecbd+_0x5e72('0x1a')+_0x8b4283['userEmail']+'&'+_0x4a6a33+'&'+_0x47334a,'auth':_0x5adbac,'json':!![]};logger[_0x5e72('0x12')]('['+[_0x428791[_0x5e72('0x13')]()]+_0x5e72('0x1b'),_0x1c51f4);return rp(_0x1c51f4)[_0x5e72('0xe')](function(_0x1dec79){logger[_0x5e72('0x12')]('['+[_0x428791[_0x5e72('0x13')]()]+_0x5e72('0x1c'),_0x1dec79);if(_0x1dec79[_0x5e72('0xf')]['length']>0x0&&String(_0x1dec79[_0x5e72('0xf')][0x0][_0x5e72('0x1d')])===_0x5e72('0x1e')){_0x8b4283[_0x5e72('0x1f')]=_0x1dec79['result'][0x0]['sys_id'];}else{_0x8b4283['userId']=_0x8b4283[_0x5e72('0x20')];_0x8b4283[_0x5e72('0x19')]=_0x8b4283[_0x5e72('0x21')];}logger['info']('['+[_0x428791[_0x5e72('0x13')]()]+_0x5e72('0x22'),_0x8b4283);_0x3a2c96(_0x8b4283);})[_0x5e72('0x14')](function(_0x4bcb68){logger[_0x5e72('0x15')]('['+[_0x428791['toUpperCase']()]+']',_0x4bcb68['message']);_0x3be389(_0x4bcb68[_0x5e72('0x16')]);});}else{logger[_0x5e72('0x12')]('['+[_0x428791[_0x5e72('0x13')]()]+_0x5e72('0x23'));_0x8b4283[_0x5e72('0x1f')]=_0x8b4283[_0x5e72('0x20')];_0x8b4283[_0x5e72('0x19')]=_0x8b4283[_0x5e72('0x21')];_0x3a2c96(_0x8b4283);}});};}function createEndUser(_0x6cc0f0,_0x20808b,_0x491393,_0x209b17,_0x154df3){logger[_0x5e72('0x12')]('['+[_0x6cc0f0[_0x5e72('0x13')]()]+_0x5e72('0x24'),_0x491393);return new Promise(function(_0x453e80,_0x23830b){var _0x3ffa37={'method':_0x5e72('0x25'),'uri':_0x209b17+'sys_user?'+_0x154df3,'body':{'user_name':_0x491393[_0x5e72('0x26')],'roles':_0x5e72('0x27'),'first_name':_0x491393[_0x5e72('0x26')],'active':'true','date_format':_0x5e72('0x28'),'phone':_0x491393['endUserNumber']},'auth':_0x20808b,'json':!![]};return rp(_0x3ffa37)[_0x5e72('0xe')](function(_0x2471b3){logger[_0x5e72('0x12')]('['+[_0x6cc0f0[_0x5e72('0x13')]()]+'],\x20EndUser\x20schema',_0x2471b3[_0x5e72('0xf')]);_0x491393[_0x5e72('0x29')]=_0x2471b3['result'][_0x5e72('0x11')];_0x453e80(_0x491393);})[_0x5e72('0x14')](function(_0x16441f){logger[_0x5e72('0x15')]('['+[_0x6cc0f0[_0x5e72('0x13')]()]+']',_0x16441f[_0x5e72('0x16')]);_0x23830b(_0x16441f[_0x5e72('0x16')]);});});}function getEndUser(_0x833e1f,_0x4998c6,_0x12957f,_0x56a2ae,_0x5b5d4d){return function(_0x521f8e){logger['info']('['+[_0x833e1f[_0x5e72('0x13')]()]+_0x5e72('0x2a'),_0x521f8e);return new Promise(function(_0x31d59b,_0x4e5e16){var _0x169815={'method':_0x5e72('0xc'),'uri':_0x12957f+_0x5e72('0x2b')+_0x521f8e[_0x5e72('0x26')]+'&'+_0x56a2ae+'&'+_0x5b5d4d,'auth':_0x4998c6,'json':!![]};return rp(_0x169815)[_0x5e72('0xe')](function(_0x43f530){if(_0x43f530[_0x5e72('0xf')]['length']>0x0){_0x521f8e[_0x5e72('0x29')]=_0x43f530[_0x5e72('0xf')][0x0][_0x5e72('0x11')];logger[_0x5e72('0x12')]('['+[_0x833e1f[_0x5e72('0x13')]()]+_0x5e72('0x2c'),_0x521f8e);_0x31d59b(_0x521f8e);}else{return createEndUser(_0x833e1f,_0x4998c6,_0x521f8e,_0x12957f,_0x56a2ae)[_0x5e72('0xe')](function(_0x1e1b90){logger['info']('['+[_0x833e1f[_0x5e72('0x13')]()]+'],\x20createEndUser\x20crm',_0x1e1b90);_0x31d59b(_0x1e1b90);});}})[_0x5e72('0x14')](function(_0x120a80){logger['error']('['+[_0x833e1f['toUpperCase']()]+']',_0x120a80[_0x5e72('0x16')]);_0x4e5e16(_0x120a80['message']);});});};}function getCustomFields(_0x1f4f95,_0x196fa0){var _0x22c98f={};if(_0x1f4f95[_0x5e72('0x10')]>0x0){_['forEach'](_0x1f4f95,function(_0x4ba0a2){if(_[_0x5e72('0x2d')](['string',_0x5e72('0x2e')],_0x4ba0a2[_0x5e72('0x2f')])&&_0x4ba0a2['nameField']&&!_0x4ba0a2[_0x5e72('0x30')]){_0x22c98f[_0x4ba0a2[_0x5e72('0x31')]['toLowerCase']()]=_0x4ba0a2['content'][_0x5e72('0x32')]();}else if(_['includes']([_0x5e72('0x33'),_0x5e72('0x2e')],_0x4ba0a2['type'])&&_0x4ba0a2['idField']&&_0x4ba0a2[_0x5e72('0x30')]){_0x22c98f[_0x4ba0a2[_0x5e72('0x34')][_0x5e72('0x35')]()]=_0x4ba0a2[_0x5e72('0x36')][_0x5e72('0x32')]();}else if(_0x4ba0a2[_0x5e72('0x2f')]===_0x5e72('0x37')&&_0x4ba0a2[_0x5e72('0x38')]&&_0x4ba0a2[_0x5e72('0x34')]&&_0x4ba0a2[_0x5e72('0x30')]){_0x22c98f[_0x4ba0a2[_0x5e72('0x34')][_0x5e72('0x35')]()]=_0x196fa0[_0x4ba0a2[_0x5e72('0x38')]][_0x5e72('0x32')]();}else if(_0x4ba0a2['type']==='customVariable'&&_0x4ba0a2['Variable']&&_0x4ba0a2['Variable']['name']&&_0x4ba0a2[_0x5e72('0x34')]&&_0x4ba0a2['customField']){_0x22c98f[_0x4ba0a2[_0x5e72('0x34')][_0x5e72('0x35')]()]=_0x196fa0[_0x4ba0a2[_0x5e72('0x39')][_0x5e72('0x3a')]['toLowerCase']()][_0x5e72('0x32')]();}});}return _0x22c98f;}function getTicket(_0x573a35,_0x25b76f,_0x21a328,_0x11ed5b,_0x203127,_0x4b87a0){return function(_0x4fd18e){logger['info']('['+[_0x573a35[_0x5e72('0x13')]()]+_0x5e72('0x3b'),_0x4fd18e);return new Promise(function(_0xfe1d1d,_0x503b0c){var _0xcb9c29=_0x573a35[_0x5e72('0x35')]()===_0x5e72('0x3c')?_0x4fd18e[_0x5e72('0x1f')]:_0x4fd18e[_0x5e72('0x29')];var _0x3c88a0={'method':_0x5e72('0x25'),'uri':_0x21a328+_0x5e72('0x3d')+'?'+_0x4b87a0,'body':Object[_0x5e72('0x3e')]({},{'active':_0x5e72('0x1e'),'caller_id':_0xcb9c29,'assigned_to':_0x4fd18e[_0x5e72('0x1f')],'short_description':intUtil[_0x5e72('0x3f')](_0x11ed5b['Subjects'],_0x203127,'\x20'),'description':intUtil['getString'](_0x11ed5b['Descriptions'],_0x203127,'\x0a')},getCustomFields(_0x11ed5b[_0x5e72('0x40')],_0x203127)),'auth':_0x25b76f,'json':!![]};return rp(_0x3c88a0)[_0x5e72('0xe')](function(_0x1bc414){logger[_0x5e72('0x12')]('['+[_0x573a35[_0x5e72('0x13')]()]+_0x5e72('0x41'),_0x1bc414['result']);_0x4fd18e[_0x5e72('0x42')]=_0x1bc414[_0x5e72('0xf')][_0x5e72('0x11')];_0x4fd18e[_0x5e72('0x43')]=_0x1bc414[_0x5e72('0xf')][_0x5e72('0x44')];logger[_0x5e72('0x12')]('['+[_0x573a35[_0x5e72('0x13')]()]+_0x5e72('0x45'),_0x4fd18e);_0xfe1d1d(_0x4fd18e);})[_0x5e72('0x14')](function(_0x290984){logger[_0x5e72('0x15')]('['+[_0x573a35[_0x5e72('0x13')]()]+']',_0x290984['message']);_0x503b0c(_0x290984[_0x5e72('0x16')]);});});};}function createRemoteTag(_0x348201,_0x2f0df3,_0x1e666e,_0x11a064){return new Promise(function(_0x23d80d,_0x3bc9c6){var _0x32f756={'method':_0x5e72('0x25'),'uri':_0x1e666e+_0x5e72('0x46')+'?'+_0x11a064,'body':{'short_description':_0x348201,'global':!![],'active':!![],'name':_0x348201},'auth':_0x2f0df3,'json':!![]};return rp(_0x32f756)[_0x5e72('0xe')](function(_0x241c14){var _0x1185a7=_0x241c14[_0x5e72('0xf')][_0x5e72('0x11')];_0x23d80d(_0x1185a7);});});}function getRemoteTag(_0x284966,_0x75ca8f,_0x364f93,_0x44e277,_0x175c04){return new Promise(function(_0x25f12f,_0x1a320c){var _0x4a7bfc={'method':_0x5e72('0xc'),'uri':_0x364f93+'label'+'?sysparm_query=name%3D'+_0x284966+'&'+_0x44e277,'auth':_0x75ca8f,'json':!![]};return rp(_0x4a7bfc)['then'](function(_0x3e133d){if(_0x3e133d[_0x5e72('0xf')][_0x5e72('0x10')]>0x0){var _0x4e40f3=_0x3e133d[_0x5e72('0xf')][0x0][_0x5e72('0x11')];_0x25f12f(_0x4e40f3);}else{return createRemoteTag(_0x284966,_0x75ca8f,_0x364f93,_0x44e277)[_0x5e72('0xe')](function(_0x5618c0){_0x25f12f(_0x5618c0);});}});});}function assignTagToIncident(_0x1ebfe5,_0xec1f3a,_0x572c63,_0x497f43,_0x2eafce){return new Promise(function(_0xc4ca07,_0x547cfd){var _0x3147cd={'method':_0x5e72('0x25'),'uri':_0x572c63+_0x5e72('0x47')+'?'+_0x2eafce,'body':{'label':_0x1ebfe5,'table':_0x5e72('0x3d'),'id_type':_0x5e72('0x48'),'table_key':_0x497f43['ticketId'],'title':'Incident\x20-\x20'+_0x497f43[_0x5e72('0x43')],'id_display':_0x497f43[_0x5e72('0x43')]},'auth':_0xec1f3a,'json':!![]};return rp(_0x3147cd)[_0x5e72('0xe')](function(_0x390965){_0xc4ca07();})[_0x5e72('0x14')](function(){_0xc4ca07();});});}function manageTags(_0x52572f,_0x21c740,_0x278425,_0x42d8aa,_0x3cf4f0,_0x30aba7,_0xb2c3f9){return new Promise(function(_0x7ade66,_0x5a24c1){var _0x389b67=[];_0x21c740['forEach'](function(_0x561dea){_0x389b67[_0x5e72('0x49')](getRemoteTag(_0x561dea,_0x278425,_0x42d8aa,_0x30aba7,_0xb2c3f9));});return Promise[_0x5e72('0x4a')](_0x389b67)['then'](function(_0xb7eec0){if(_0xb7eec0[_0x5e72('0x10')]){logger['info']('['+[_0x52572f['toUpperCase']()]+_0x5e72('0x4b'),_0xb7eec0);var _0x29636b=[];_0xb7eec0['forEach'](function(_0x2586b7){_0x29636b[_0x5e72('0x49')](assignTagToIncident(_0x2586b7,_0x278425,_0x42d8aa,_0x3cf4f0,_0x30aba7));});return Promise[_0x5e72('0x4a')](_0x29636b)[_0x5e72('0xe')](function(){_0x7ade66();})[_0x5e72('0x14')](function(){_0x7ade66();});}else{_0x7ade66();}});});}function getTags(_0x40e5dd,_0x2845a2,_0x51e781,_0x259579,_0x3a53c5,_0x3919db){return function(_0x56e8b4){return new Promise(function(_0x516873,_0x36e572){var _0x4e3104=[];var _0x208153=_0x259579[_0x5e72('0x4c')];if(_0x208153&&_0x208153['length']>0x0){_0x4e3104=_[_0x5e72('0x4d')](_0x208153,'name');}if(_0x4e3104[_0x5e72('0x10')]>0x0){return manageTags(_0x40e5dd,_0x4e3104,_0x2845a2,_0x51e781,_0x56e8b4,_0x3a53c5,_0x3919db)[_0x5e72('0xe')](function(){_0x516873(_0x56e8b4);});}else{_0x516873(_0x56e8b4);}});};}function emit(_0x2bf619,_0x2e78e4,_0x357d8b){var _0x28860c=_0x5e72('0x4e')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x5e72('0x4f')+_0x5e72('0x50');var _0x5264cd={'uri':_0x2bf619+_0x5e72('0x51')+_0x357d8b+_0x28860c};io['to'](util['format'](_0x5e72('0x52'),_0x2e78e4))[_0x5e72('0x53')](_0x5e72('0x54'),_0x5264cd);}exports['cs']=function(_0x599cf8,_0x5808f9,_0x1f0fb1,_0x202345,_0x50e4be,_0x21dab7,_0x47ec8d,_0x52fce0){var _0xe74bf0={};var _0x1d00ff={'user':_0x21dab7[_0x5e72('0x55')],'pass':_0x21dab7[_0x5e72('0x56')]};var _0x27da58='sysparm_limit=1';var _0x44a421='sysparm_display_value=true';_0x21dab7[_0x5e72('0x57')]=intUtil[_0x5e72('0x58')](_0x21dab7[_0x5e72('0x57')]);_0x21dab7['serverUrl']=intUtil[_0x5e72('0x58')](_0x21dab7[_0x5e72('0x59')]);var _0x1457c7=util[_0x5e72('0x5a')](_0x5e72('0x5b'),_0x21dab7['remoteUri']);_0xe74bf0[_0x5e72('0x19')]=!_[_0x5e72('0x5c')](_0x202345)?_0x202345[_0x5e72('0x5d')]:null;_0xe74bf0[_0x5e72('0x21')]=_0x21dab7[_0x5e72('0x5d')];_0xe74bf0[_0x5e72('0x26')]=_0x52fce0[_0x5e72('0x35')]()===_0x5e72('0x3c')?_0x5808f9[_0x5e72('0x5e')]:_0x5808f9[_0x5e72('0x5f')];_0xe74bf0['callDirection']=_0x52fce0==='queue'||_0x52fce0===_0x5e72('0x60')?_0x5e72('0x61'):_0x5e72('0x3c');var _0x4c0d33=util['format'](_0x5e72('0x62'),_0x21dab7[_0x5e72('0x59')],_0x5808f9[_0x5e72('0x63')],md5(_0x5808f9[_0x5e72('0x63')]));if(_0x50e4be&&_0x50e4be[_0x5e72('0x64')]){logger[_0x5e72('0x12')](_0x5e72('0x65'),_0x5e72('0x66'));_0x5808f9[_0x5e72('0x67')]=_0x4c0d33;}else if(_0x47ec8d&&_0x47ec8d[_0x5e72('0x68')]&&_0x47ec8d['recordingFormat']!==_0x5e72('0x69')){logger[_0x5e72('0x12')](_0x5e72('0x6a'),_0x5e72('0x66'));_0x5808f9['recordingURL']=_0x4c0d33;}else{_0x5808f9[_0x5e72('0x67')]='';}return getAdminUser(_0x52fce0,_0x1d00ff,_0xe74bf0,_0x1457c7,_0x44a421,_0x27da58)[_0x5e72('0xe')](getUser(_0x52fce0,_0x1d00ff,_0x1457c7,_0x44a421,_0x27da58))[_0x5e72('0xe')](getEndUser(_0x52fce0,_0x1d00ff,_0x1457c7,_0x44a421,_0x27da58))['then'](getTicket(_0x52fce0,_0x1d00ff,_0x1457c7,_0x1f0fb1,_0x5808f9,_0x44a421))[_0x5e72('0xe')](function(_0x35712d){logger[_0x5e72('0x12')](util[_0x5e72('0x5a')](_0x5e72('0x6b'),_0x35712d[_0x5e72('0x42')]));logger[_0x5e72('0x12')](util[_0x5e72('0x5a')](_0x5e72('0x6c'),_0x52fce0));if(_0x52fce0!==_0x5e72('0x60')){logger[_0x5e72('0x12')]('['+[_0x52fce0['toUpperCase']()]+']',_0x5e72('0x6d'));emit(_0x21dab7[_0x5e72('0x57')],_0x202345[_0x5e72('0x3a')],_0x35712d[_0x5e72('0x42')]);}})[_0x5e72('0x14')](function(_0x43f10c){logger['error']('['+[_0x52fce0[_0x5e72('0x13')]()]+_0x5e72('0x6e'),util['inspect'](_0x43f10c,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index cf8af9b..a1d05f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe389=['set_relationship','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','remoteUri','monitor_format','Recording\x20is\x20enabled!','uniqueid','recordingURL','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','user:%s','error','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','uri','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','forEach','variableName','push','idField','set_entry','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','user_name','length','entry_list','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','customField','toLowerCase','content','custom_fields','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xe389,0x117));var _0x9e38=function(_0x237a0a,_0x48aee6){_0x237a0a=_0x237a0a-0x0;var _0x5d274e=_0xe389[_0x237a0a];return _0x5d274e;};'use strict';var _=require('lodash');var rp=require(_0x9e38('0x0'));var BPromise=require('bluebird');var md5=require(_0x9e38('0x1'));var util=require(_0x9e38('0x2'));var Redis=require(_0x9e38('0x3'));var intUtil=require(_0x9e38('0x4'));var config=require(_0x9e38('0x5'));var logger=require(_0x9e38('0x6'))(_0x9e38('0x7'));config[_0x9e38('0x8')]=_[_0x9e38('0x9')](config[_0x9e38('0x8')],{'host':_0x9e38('0xa'),'port':0x18eb});var io=require(_0x9e38('0xb'))(new Redis(config[_0x9e38('0x8')]));var def={'method':_0x9e38('0xc'),'json':!![]};function emit(_0x8eaf52,_0x1a98a1,_0x354b68){io['to'](_0x8eaf52)[_0x9e38('0xd')](_0x1a98a1,_0x354b68);}function getTicket(_0x322f2b,_0x2ad1ed,_0x3fdc4d,_0x5dc581,_0x37a3dd,_0x498d40,_0x1d50f8,_0x142b1d){logger[_0x9e38('0xe')](_0x9e38('0xf'));var _0x47bfa2=new Date();var _0x3c85bd=[{'name':_0x9e38('0x10'),'value':intUtil[_0x9e38('0x11')](_0x5dc581[_0x9e38('0x12')],_0x37a3dd,'\x20')},{'name':'assigned_user_id','value':_0x2ad1ed['id']},{'name':_0x9e38('0x13'),'value':_0x2ad1ed['id']},{'name':_0x9e38('0x14'),'value':intUtil[_0x9e38('0x11')](_0x5dc581[_0x9e38('0x15')],_0x37a3dd,'\x0a')},{'name':_0x9e38('0x16'),'value':_0x47bfa2[_0x9e38('0x17')]()[_0x9e38('0x18')](0x0,0x13)[_0x9e38('0x19')]('T','\x20')},{'name':_0x9e38('0x1a'),'value':'0'},{'name':_0x9e38('0x1b'),'value':'15'},{'name':_0x9e38('0x1c'),'value':_0x3fdc4d['id']},{'name':_0x9e38('0x1d'),'value':_0x9e38('0x1e')},{'name':_0x9e38('0x1f'),'value':_0x3fdc4d['name']},{'name':'direction','value':_0x142b1d}];if(_0x498d40['length']){_[_0x9e38('0x20')](_0x498d40,function(_0x1011cd){if(_0x37a3dd[_0x1011cd[_0x9e38('0x21')]]){_0x3c85bd[_0x9e38('0x22')]({'name':_0x1011cd[_0x9e38('0x23')],'value':_0x37a3dd[_0x1011cd[_0x9e38('0x21')]]});}});}return request({'form':{'method':_0x9e38('0x24'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x9e38('0x25')]({'session':_0x1d50f8['id'],'module_name':_0x9e38('0x26'),'name_value_list':_0x3c85bd})}});}function getAuth(_0x459e26){return util[_0x9e38('0x27')](_0x9e38('0x28'),new Buffer(_0x459e26[_0x9e38('0x29')]+':X')[_0x9e38('0x2a')](_0x9e38('0x2b')));}function getServerInfo(_0x3cb861){return request({'form':{'method':_0x9e38('0x2c'),'input_type':_0x9e38('0x2d'),'response_type':_0x9e38('0x2d'),'rest_data':JSON[_0x9e38('0x25')]({'session':_0x3cb861['id']})}});}function getUser(_0x3ad834,_0x585b66,_0x4d4ceb){if(!_[_0x9e38('0x2e')](_0x585b66)){logger[_0x9e38('0xe')](_0x9e38('0x2f'),_0x585b66);return request({'form':{'method':'get_entry_list','input_type':_0x9e38('0x2d'),'response_type':_0x9e38('0x2d'),'rest_data':JSON[_0x9e38('0x25')]({'session':_0x4d4ceb['id'],'module_name':'Employees','query':util[_0x9e38('0x27')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x585b66),'order_by':'','offset':'0','select_fields':['id','name',_0x9e38('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3d3dac){if(_0x3d3dac['entry_list'][_0x9e38('0x31')]){var _0x14c5f4=_['find'](_0x3d3dac[_0x9e38('0x32')],function(_0x632c7){return _0x632c7[_0x9e38('0x33')]['user_name'][_0x9e38('0x34')]===_0x585b66;});if(_0x14c5f4){logger[_0x9e38('0xe')]('Agent\x20found!');return BPromise[_0x9e38('0x35')]({'id':_0x14c5f4[_0x9e38('0x33')]['id'][_0x9e38('0x34')],'name':_0x14c5f4['name_value_list'][_0x9e38('0x10')][_0x9e38('0x34')]});}}logger[_0x9e38('0xe')](_0x9e38('0x36'));return BPromise[_0x9e38('0x35')]({'id':_0x4d4ceb['name_value_list']['user_id'][_0x9e38('0x34')],'name':_0x4d4ceb[_0x9e38('0x33')]['user_name'][_0x9e38('0x34')]});});}else{logger[_0x9e38('0xe')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x4d4ceb['name_value_list']['user_id'][_0x9e38('0x34')],'name':_0x4d4ceb[_0x9e38('0x33')][_0x9e38('0x30')][_0x9e38('0x34')]});}}function getEndUser(_0xb8106b,_0x2b1a2f,_0x28ce92,_0x26b50a){logger[_0x9e38('0xe')](_0x9e38('0x37'),_0x28ce92);return request({'form':{'method':_0x9e38('0x38'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x9e38('0x25')]({'session':_0x26b50a['id'],'module_name':_0x9e38('0x1e'),'query':util[_0x9e38('0x27')](_0x9e38('0x39'),_0x28ce92),'order_by':'','offset':'0','select_fields':['id','name',_0x9e38('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9e38('0x3b')](function(_0x60ec93){if(_0x60ec93[_0x9e38('0x32')][_0x9e38('0x31')]){var _0x145ecf=_['find'](_0x60ec93[_0x9e38('0x32')],function(_0x4393be){return _0x4393be[_0x9e38('0x33')][_0x9e38('0x3a')]['value']===_0x28ce92;});if(_0x145ecf){logger[_0x9e38('0xe')](_0x9e38('0x3c'));return BPromise[_0x9e38('0x35')]({'id':_0x145ecf[_0x9e38('0x33')]['id']['value'],'name':_0x145ecf[_0x9e38('0x33')]['name'][_0x9e38('0x34')],'phone':_0x145ecf[_0x9e38('0x33')][_0x9e38('0x3a')][_0x9e38('0x34')]});}}else{logger[_0x9e38('0xe')](_0x9e38('0x3d'));return request({'form':{'method':_0x9e38('0x24'),'input_type':_0x9e38('0x2d'),'response_type':_0x9e38('0x2d'),'rest_data':JSON[_0x9e38('0x25')]({'session':_0x26b50a['id'],'module_name':'Contacts','name_value_list':[{'name':_0x9e38('0x3e'),'value':_0x2b1a2f!==_0x9e38('0x3f')?_0x2b1a2f:util[_0x9e38('0x27')](_0x9e38('0x40'),_0x28ce92)},{'name':_0x9e38('0x3a'),'value':_0x28ce92}]})}})['then'](function(_0x4959f0){logger[_0x9e38('0xe')](_0x9e38('0x41'));return BPromise['resolve']({'id':_0x4959f0['id'],'name':_0x4959f0[_0x9e38('0x32')]['first_name'][_0x9e38('0x34')],'phone':_0x4959f0['entry_list'][_0x9e38('0x3a')][_0x9e38('0x34')]});});}});}function request(_0x4e2822){logger[_0x9e38('0x42')](_0x9e38('0x43'),JSON[_0x9e38('0x25')](_0x4e2822));return rp(_['merge'](def,_0x4e2822));}function getTags(_0x54da90,_0x31c6fb){var _0x2dc77c=[];if(_0x54da90&&_0x54da90[_0x9e38('0x31')]>0x0){_0x2dc77c=_[_0x9e38('0x44')](_0x54da90,_0x31c6fb);}return _0x2dc77c;}function getCustomFields(_0x52a7d3,_0x37c7b9){var _0x2e62b3=[];var _0x463015={'custom_fields':[]};if(_0x52a7d3['length']>0x0){_[_0x9e38('0x20')](_0x52a7d3,function(_0x13f36d){if(_0x13f36d[_0x9e38('0x45')]===_0x9e38('0x46')&&_0x13f36d[_0x9e38('0x47')]&&!_0x13f36d[_0x9e38('0x48')]){_0x463015[_0x13f36d[_0x9e38('0x47')][_0x9e38('0x49')]()]=_0x13f36d['content'][_0x9e38('0x2a')]();}else if(_0x13f36d['type']===_0x9e38('0x46')&&_0x13f36d[_0x9e38('0x23')]&&_0x13f36d['customField']){_0x463015['custom_fields'][_0x9e38('0x22')]({'id':_0x13f36d[_0x9e38('0x23')],'value':_0x13f36d[_0x9e38('0x4a')][_0x9e38('0x2a')]()});}else if(_0x13f36d[_0x9e38('0x45')]==='variable'&&_0x13f36d['variableName']&&_0x13f36d['idField']&&_0x13f36d[_0x9e38('0x48')]){_0x37c7b9[_0x13f36d[_0x9e38('0x21')]]&&_0x463015[_0x9e38('0x4b')][_0x9e38('0x22')]({'id':_0x13f36d[_0x9e38('0x23')],'value':_0x37c7b9[_0x13f36d[_0x9e38('0x21')]][_0x9e38('0x2a')]()});}else if(_0x13f36d[_0x9e38('0x45')]===_0x9e38('0x4c')&&_0x13f36d[_0x9e38('0x4d')]&&_0x13f36d['Variable'][_0x9e38('0x10')]&&_0x13f36d[_0x9e38('0x23')]&&_0x13f36d[_0x9e38('0x48')]){_0x37c7b9[_0x13f36d[_0x9e38('0x4d')][_0x9e38('0x10')][_0x9e38('0x49')]()]&&_0x463015['custom_fields']['push']({'id':_0x13f36d['idField'],'value':_0x37c7b9[_0x13f36d[_0x9e38('0x4d')][_0x9e38('0x10')][_0x9e38('0x49')]()]['toString']()});}});}return _0x463015;}function getConnection(_0x35d58b){return request({'method':'POST','form':{'method':_0x9e38('0x4e'),'input_type':_0x9e38('0x2d'),'response_type':_0x9e38('0x2d'),'rest_data':JSON[_0x9e38('0x25')]({'user_auth':{'user_name':_0x35d58b[_0x9e38('0x4f')],'password':_0x35d58b['password'],'encryption':_0x9e38('0x50')},'application':_0x9e38('0x51')})}})['then'](function(_0x5ddf54){var _0x4f50d7=_0x5ddf54;if(_0x4f50d7['id']){def[_0x9e38('0x52')]=_0x4f50d7['id'];return BPromise['resolve'](_0x4f50d7);}else{throw new Error(util[_0x9e38('0x27')](_0x9e38('0x53'),_0x35d58b['id']));}});}function setRelationship(_0x5c3e71,_0x3a9d1a,_0x19d7e0,_0x5c9b23){return request({'form':{'method':_0x9e38('0x54'),'input_type':_0x9e38('0x2d'),'response_type':_0x9e38('0x2d'),'rest_data':JSON[_0x9e38('0x25')]({'session':_0x5c3e71['id'],'module_name':_0x9e38('0x26'),'module_id':_0x19d7e0['id'],'link_field_name':_0x5c9b23,'related_ids':[_0x3a9d1a['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x3ead3c,_0x4f4935,_0x26002c,_0x2788de,_0x4c3e58,_0x4809bc){var _0x249d3a,_0x4e28ad,_0x2a4015,_0x243c1d;_0x4809bc['remoteUri']=intUtil[_0x9e38('0x55')](_0x4809bc['remoteUri']);_0x4809bc[_0x9e38('0x56')]=intUtil['stripTrailingSlash'](_0x4809bc[_0x9e38('0x56')]);def['uri']=util[_0x9e38('0x27')](_0x9e38('0x57'),_0x4809bc[_0x9e38('0x58')]);if(_0x4c3e58&&_0x4c3e58[_0x9e38('0x59')]){logger[_0x9e38('0xe')]('[QUEUE]',_0x9e38('0x5a'));_0x4f4935['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4809bc[_0x9e38('0x56')],_0x4f4935[_0x9e38('0x5b')],md5(_0x4f4935[_0x9e38('0x5b')]));}else{_0x4f4935[_0x9e38('0x5c')]='';}return getConnection(_0x4809bc)[_0x9e38('0x3b')](function(_0x379e83){_0x243c1d=_0x379e83;return getUser(_0x4809bc,_0x2788de['name'],_0x243c1d);})[_0x9e38('0x3b')](function(_0x204f4d){_0x249d3a=_0x204f4d;logger[_0x9e38('0xe')]('The\x20User\x20ID\x20is:',_0x249d3a['id']);return getEndUser(_0x4809bc,_0x4f4935[_0x9e38('0x5d')],_0x4f4935[_0x9e38('0x5e')],_0x243c1d);})[_0x9e38('0x3b')](function(_0x4f8b7e){_0x4e28ad=_0x4f8b7e;logger[_0x9e38('0xe')]('The\x20Enduser\x20ID\x20is:',_0x4e28ad['id']);return getTicket(_0x4809bc,_0x249d3a,_0x4e28ad,_0x26002c,_0x4f4935,_0x26002c[_0x9e38('0x5f')],_0x243c1d,_0x9e38('0x60'));})['then'](function(_0x25415c){_0x2a4015=_0x25415c;logger[_0x9e38('0xe')](_0x9e38('0x61'));logger[_0x9e38('0xe')](_0x9e38('0x62'),_0x2a4015['id']);return setRelationship(_0x243c1d,_0x249d3a,_0x2a4015,_0x9e38('0x63'));})['then'](function(){return setRelationship(_0x243c1d,_0x4e28ad,_0x2a4015,_0x9e38('0x64'));})['then'](function(){return getServerInfo(_0x243c1d);})[_0x9e38('0x3b')](function(_0x2d0d83){var _0x1d2111=parseInt(_0x2d0d83[_0x9e38('0x65')][_0x9e38('0x66')](0x0));var _0x4df9c2=util['format'](_0x9e38('0x67'),_0x4809bc[_0x9e38('0x58')],_0x2a4015['id']);if(_0x1d2111>0x6){_0x4df9c2=util[_0x9e38('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4809bc[_0x9e38('0x58')],_0x2a4015['id']);}logger[_0x9e38('0xe')](_0x9e38('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x9e38('0x69'),_0x2788de['name']),'trigger:browser:url',{'uri':_0x4df9c2});})['catch'](function(_0x4ab75d){logger[_0x9e38('0x6a')](_0x9e38('0x68'),JSON['stringify'](_0x4ab75d));});};exports['outbound']=function(_0x1f395a,_0x4bfa6b,_0x2aec77,_0x5257ff,_0x48ce3d,_0x2a00ae,_0x4b4186){var _0x4c2b0b,_0x39fa4c,_0x2658c7,_0x1db3ff;_0x2a00ae[_0x9e38('0x58')]=intUtil[_0x9e38('0x55')](_0x2a00ae[_0x9e38('0x58')]);_0x2a00ae[_0x9e38('0x56')]=intUtil[_0x9e38('0x55')](_0x2a00ae[_0x9e38('0x56')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x2a00ae['remoteUri']);if(_0x4b4186&&_0x4b4186[_0x9e38('0x6b')]&&_0x4b4186[_0x9e38('0x6b')]!=='none'){logger[_0x9e38('0xe')](_0x9e38('0x6c'),_0x9e38('0x5a'));_0x4bfa6b['recordingURL']=util[_0x9e38('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a00ae[_0x9e38('0x56')],_0x4bfa6b['uniqueid'],md5(_0x4bfa6b['uniqueid']));}return getConnection(_0x2a00ae)[_0x9e38('0x3b')](function(_0x4932c7){_0x1db3ff=_0x4932c7;return getUser(_0x2a00ae,_0x5257ff[_0x9e38('0x10')],_0x1db3ff);})[_0x9e38('0x3b')](function(_0x7291c1){_0x4c2b0b=_0x7291c1;logger[_0x9e38('0xe')](_0x9e38('0x6d'),_0x4c2b0b['id']);return getEndUser(_0x2a00ae,_0x4bfa6b[_0x9e38('0x6e')],_0x4bfa6b[_0x9e38('0x6f')],_0x1db3ff);})[_0x9e38('0x3b')](function(_0xa184b6){_0x39fa4c=_0xa184b6;logger[_0x9e38('0xe')](_0x9e38('0x70'),_0x39fa4c['id']);return getTicket(_0x2a00ae,_0x4c2b0b,_0x39fa4c,_0x2aec77,_0x4bfa6b,_0x2aec77[_0x9e38('0x5f')],_0x1db3ff,_0x9e38('0x71'));})[_0x9e38('0x3b')](function(_0x48e424){_0x2658c7=_0x48e424;logger['info']('Ticket\x20created!');logger[_0x9e38('0xe')](_0x9e38('0x62'),_0x2658c7['id']);return setRelationship(_0x1db3ff,_0x4c2b0b,_0x2658c7,_0x9e38('0x63'));})['then'](function(){return setRelationship(_0x1db3ff,_0x39fa4c,_0x2658c7,_0x9e38('0x64'));})[_0x9e38('0x3b')](function(){return getServerInfo(_0x1db3ff);})[_0x9e38('0x3b')](function(_0x1e5990){var _0x143e2e=parseInt(_0x1e5990[_0x9e38('0x65')][_0x9e38('0x66')](0x0));var _0x4cce6d=util[_0x9e38('0x27')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2a00ae[_0x9e38('0x58')],_0x2658c7['id']);if(_0x143e2e>0x6){_0x4cce6d=util[_0x9e38('0x27')](_0x9e38('0x72'),_0x2a00ae['remoteUri'],_0x2658c7['id']);}logger[_0x9e38('0xe')](_0x9e38('0x6c'),_0x9e38('0x73'));emit(util[_0x9e38('0x27')](_0x9e38('0x69'),_0x5257ff[_0x9e38('0x10')]),'trigger:browser:url',{'uri':_0x4cce6d});})[_0x9e38('0x74')](function(_0x1ff0ed){logger[_0x9e38('0x6a')](_0x9e38('0x6c'),JSON['stringify'](_0x1ff0ed));});};exports['unmanaged']=function(_0x168e36,_0x4946a2,_0x2d6ef3,_0x18637d,_0x4c1afa,_0x12ca0a){var _0x409b33,_0x4f0a9e,_0xc2fac1,_0x5297f8;_0x12ca0a[_0x9e38('0x58')]=intUtil[_0x9e38('0x55')](_0x12ca0a[_0x9e38('0x58')]);_0x12ca0a[_0x9e38('0x56')]=intUtil['stripTrailingSlash'](_0x12ca0a[_0x9e38('0x56')]);def[_0x9e38('0x75')]=util[_0x9e38('0x27')](_0x9e38('0x57'),_0x12ca0a[_0x9e38('0x58')]);if(_0x4c1afa&&_0x4c1afa['monitor_format']){logger[_0x9e38('0xe')]('['+_0x4946a2[_0x9e38('0x76')][_0x9e38('0x77')]()+']','Recording\x20is\x20enabled!');_0x4946a2[_0x9e38('0x5c')]=util[_0x9e38('0x27')](_0x9e38('0x78'),_0x12ca0a[_0x9e38('0x56')],_0x4946a2['uniqueid'],md5(_0x4946a2[_0x9e38('0x5b')]));}else{_0x4946a2[_0x9e38('0x5c')]='';}return getConnection(_0x12ca0a)[_0x9e38('0x3b')](function(_0x413885){_0x5297f8=_0x413885;if(!_[_0x9e38('0x2e')](_0x18637d)){return getUser(_0x12ca0a,_0x18637d[_0x9e38('0x10')],_0x5297f8);}else{return getUser(_0x12ca0a,null,_0x5297f8);}})[_0x9e38('0x3b')](function(_0x123b50){_0x409b33=_0x123b50;logger[_0x9e38('0xe')](_0x9e38('0x6d'),_0x409b33['id']);return getEndUser(_0x12ca0a,_0x4946a2['calleridname'],_0x4946a2[_0x9e38('0x5e')],_0x5297f8);})[_0x9e38('0x3b')](function(_0xcb3aae){_0x4f0a9e=_0xcb3aae;logger[_0x9e38('0xe')](_0x9e38('0x70'),_0x4f0a9e['id']);return getTicket(_0x12ca0a,_0x409b33,_0x4f0a9e,_0x2d6ef3,_0x4946a2,_0x2d6ef3['Fields'],_0x5297f8,'Inbound');})['then'](function(_0x27d69b){_0xc2fac1=_0x27d69b;logger[_0x9e38('0xe')](_0x9e38('0x61'));logger[_0x9e38('0xe')](_0x9e38('0x62'),_0xc2fac1['id']);return setRelationship(_0x5297f8,_0x409b33,_0xc2fac1,_0x9e38('0x63'));})['then'](function(){return setRelationship(_0x5297f8,_0x4f0a9e,_0xc2fac1,_0x9e38('0x64'));})[_0x9e38('0x3b')](function(){return getServerInfo(_0x5297f8);})['catch'](function(_0xf7413f){logger['error']('['+_0x4946a2[_0x9e38('0x76')][_0x9e38('0x77')]()+']',JSON['stringify'](_0xf7413f));});};
\ No newline at end of file
+var _0x654f=['push','variable','customVariable','Variable','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','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','calleridnum','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','catch','unmanaged','lastevent','toUpperCase','Ticket\x20created!','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','info','name','Subjects','assigned_user_id','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','parent_name','direction','length','forEach','variableName','idField','JSON','stringify','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','customField','toLowerCase','content','custom_fields'];(function(_0x87d22d,_0x2a1fbe){var _0xa23cba=function(_0x263555){while(--_0x263555){_0x87d22d['push'](_0x87d22d['shift']());}};_0xa23cba(++_0x2a1fbe);}(_0x654f,0xb3));var _0xf654=function(_0x16ae30,_0x1d5b3e){_0x16ae30=_0x16ae30-0x0;var _0x39a30a=_0x654f[_0x16ae30];return _0x39a30a;};'use strict';var _=require(_0xf654('0x0'));var rp=require(_0xf654('0x1'));var BPromise=require(_0xf654('0x2'));var md5=require(_0xf654('0x3'));var util=require(_0xf654('0x4'));var Redis=require(_0xf654('0x5'));var intUtil=require(_0xf654('0x6'));var config=require(_0xf654('0x7'));var logger=require(_0xf654('0x8'))(_0xf654('0x9'));config[_0xf654('0xa')]=_['defaults'](config[_0xf654('0xa')],{'host':_0xf654('0xb'),'port':0x18eb});var io=require(_0xf654('0xc'))(new Redis(config[_0xf654('0xa')]));var def={'method':_0xf654('0xd'),'json':!![]};function emit(_0x3e79b6,_0x209829,_0x5f1265){io['to'](_0x3e79b6)['emit'](_0x209829,_0x5f1265);}function getTicket(_0x5b784d,_0x424dd2,_0x2f6697,_0x244fcb,_0x5e1e17,_0x537486,_0x1cc7e1,_0x2a9b46){logger[_0xf654('0xe')]('Creating\x20new\x20ticket...');var _0x15c62b=new Date();var _0x34782b=[{'name':_0xf654('0xf'),'value':intUtil['getString'](_0x244fcb[_0xf654('0x10')],_0x5e1e17,'\x20')},{'name':_0xf654('0x11'),'value':_0x424dd2['id']},{'name':'created_by','value':_0x424dd2['id']},{'name':_0xf654('0x12'),'value':intUtil[_0xf654('0x13')](_0x244fcb[_0xf654('0x14')],_0x5e1e17,'\x0a')},{'name':_0xf654('0x15'),'value':_0x15c62b[_0xf654('0x16')]()[_0xf654('0x17')](0x0,0x13)[_0xf654('0x18')]('T','\x20')},{'name':_0xf654('0x19'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xf654('0x1a'),'value':_0x2f6697['id']},{'name':_0xf654('0x1b'),'value':'Contacts'},{'name':_0xf654('0x1c'),'value':_0x2f6697[_0xf654('0xf')]},{'name':_0xf654('0x1d'),'value':_0x2a9b46}];if(_0x537486[_0xf654('0x1e')]){_[_0xf654('0x1f')](_0x537486,function(_0x446847){if(_0x5e1e17[_0x446847[_0xf654('0x20')]]){_0x34782b['push']({'name':_0x446847[_0xf654('0x21')],'value':_0x5e1e17[_0x446847[_0xf654('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xf654('0x22'),'response_type':_0xf654('0x22'),'rest_data':JSON[_0xf654('0x23')]({'session':_0x1cc7e1['id'],'module_name':'Calls','name_value_list':_0x34782b})}});}function getAuth(_0x6da7dc){return util[_0xf654('0x24')](_0xf654('0x25'),new Buffer(_0x6da7dc[_0xf654('0x26')]+':X')[_0xf654('0x27')]('base64'));}function getServerInfo(_0x374b27){return request({'form':{'method':_0xf654('0x28'),'input_type':_0xf654('0x22'),'response_type':_0xf654('0x22'),'rest_data':JSON[_0xf654('0x23')]({'session':_0x374b27['id']})}});}function getUser(_0x4de6c9,_0x2b7419,_0x5b0e84){if(!_[_0xf654('0x29')](_0x2b7419)){logger['info']('Getting\x20agent\x20with\x20name',_0x2b7419);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xf654('0x23')]({'session':_0x5b0e84['id'],'module_name':'Employees','query':util[_0xf654('0x24')](_0xf654('0x2a'),_0x2b7419),'order_by':'','offset':'0','select_fields':['id',_0xf654('0xf'),_0xf654('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf654('0x2c')](function(_0x45e437){if(_0x45e437[_0xf654('0x2d')][_0xf654('0x1e')]){var _0x5e34e6=_[_0xf654('0x2e')](_0x45e437[_0xf654('0x2d')],function(_0x2774d0){return _0x2774d0[_0xf654('0x2f')][_0xf654('0x2b')]['value']===_0x2b7419;});if(_0x5e34e6){logger[_0xf654('0xe')](_0xf654('0x30'));return BPromise[_0xf654('0x31')]({'id':_0x5e34e6['name_value_list']['id'][_0xf654('0x32')],'name':_0x5e34e6[_0xf654('0x2f')]['name'][_0xf654('0x32')]});}}logger[_0xf654('0xe')](_0xf654('0x33'));return BPromise['resolve']({'id':_0x5b0e84[_0xf654('0x2f')][_0xf654('0x34')]['value'],'name':_0x5b0e84[_0xf654('0x2f')][_0xf654('0x2b')][_0xf654('0x32')]});});}else{logger[_0xf654('0xe')](_0xf654('0x35'));return BPromise['resolve']({'id':_0x5b0e84[_0xf654('0x2f')]['user_id'][_0xf654('0x32')],'name':_0x5b0e84[_0xf654('0x2f')][_0xf654('0x2b')][_0xf654('0x32')]});}}function getEndUser(_0x101923,_0x4340e8,_0x460f1e,_0x2e53f9){logger[_0xf654('0xe')](_0xf654('0x36'),_0x460f1e);return request({'form':{'method':_0xf654('0x37'),'input_type':_0xf654('0x22'),'response_type':_0xf654('0x22'),'rest_data':JSON[_0xf654('0x23')]({'session':_0x2e53f9['id'],'module_name':_0xf654('0x38'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x460f1e),'order_by':'','offset':'0','select_fields':['id',_0xf654('0xf'),_0xf654('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf654('0x2c')](function(_0x49b1cb){if(_0x49b1cb[_0xf654('0x2d')][_0xf654('0x1e')]){var _0x532048=_[_0xf654('0x2e')](_0x49b1cb[_0xf654('0x2d')],function(_0xc23ee4){return _0xc23ee4[_0xf654('0x2f')][_0xf654('0x39')]['value']===_0x460f1e;});if(_0x532048){logger[_0xf654('0xe')](_0xf654('0x3a'));return BPromise[_0xf654('0x31')]({'id':_0x532048['name_value_list']['id']['value'],'name':_0x532048[_0xf654('0x2f')][_0xf654('0xf')][_0xf654('0x32')],'phone':_0x532048[_0xf654('0x2f')]['phone_home'][_0xf654('0x32')]});}}else{logger[_0xf654('0xe')](_0xf654('0x3b'));return request({'form':{'method':_0xf654('0x3c'),'input_type':_0xf654('0x22'),'response_type':_0xf654('0x22'),'rest_data':JSON[_0xf654('0x23')]({'session':_0x2e53f9['id'],'module_name':_0xf654('0x38'),'name_value_list':[{'name':_0xf654('0x3d'),'value':_0x4340e8!==_0xf654('0x3e')?_0x4340e8:util[_0xf654('0x24')](_0xf654('0x3f'),_0x460f1e)},{'name':_0xf654('0x39'),'value':_0x460f1e}]})}})[_0xf654('0x2c')](function(_0x22f04a){logger[_0xf654('0xe')](_0xf654('0x40'));return BPromise[_0xf654('0x31')]({'id':_0x22f04a['id'],'name':_0x22f04a[_0xf654('0x2d')][_0xf654('0x3d')][_0xf654('0x32')],'phone':_0x22f04a[_0xf654('0x2d')]['phone_home']['value']});});}});}function request(_0x2969a4){logger[_0xf654('0x41')](_0xf654('0x42'),JSON[_0xf654('0x23')](_0x2969a4));return rp(_[_0xf654('0x43')](def,_0x2969a4));}function getTags(_0xddbc,_0x3705d2){var _0x42173a=[];if(_0xddbc&&_0xddbc['length']>0x0){_0x42173a=_[_0xf654('0x44')](_0xddbc,_0x3705d2);}return _0x42173a;}function getCustomFields(_0x38cbcc,_0x2e3824){var _0x1f61a4=[];var _0x49b1b5={'custom_fields':[]};if(_0x38cbcc['length']>0x0){_[_0xf654('0x1f')](_0x38cbcc,function(_0x4674e7){if(_0x4674e7[_0xf654('0x45')]===_0xf654('0x46')&&_0x4674e7['nameField']&&!_0x4674e7[_0xf654('0x47')]){_0x49b1b5[_0x4674e7['nameField'][_0xf654('0x48')]()]=_0x4674e7[_0xf654('0x49')]['toString']();}else if(_0x4674e7['type']==='string'&&_0x4674e7[_0xf654('0x21')]&&_0x4674e7[_0xf654('0x47')]){_0x49b1b5[_0xf654('0x4a')][_0xf654('0x4b')]({'id':_0x4674e7[_0xf654('0x21')],'value':_0x4674e7[_0xf654('0x49')][_0xf654('0x27')]()});}else if(_0x4674e7[_0xf654('0x45')]===_0xf654('0x4c')&&_0x4674e7[_0xf654('0x20')]&&_0x4674e7[_0xf654('0x21')]&&_0x4674e7[_0xf654('0x47')]){_0x2e3824[_0x4674e7[_0xf654('0x20')]]&&_0x49b1b5['custom_fields']['push']({'id':_0x4674e7['idField'],'value':_0x2e3824[_0x4674e7['variableName']]['toString']()});}else if(_0x4674e7[_0xf654('0x45')]===_0xf654('0x4d')&&_0x4674e7[_0xf654('0x4e')]&&_0x4674e7[_0xf654('0x4e')][_0xf654('0xf')]&&_0x4674e7[_0xf654('0x21')]&&_0x4674e7[_0xf654('0x47')]){_0x2e3824[_0x4674e7[_0xf654('0x4e')][_0xf654('0xf')][_0xf654('0x48')]()]&&_0x49b1b5[_0xf654('0x4a')]['push']({'id':_0x4674e7[_0xf654('0x21')],'value':_0x2e3824[_0x4674e7[_0xf654('0x4e')][_0xf654('0xf')][_0xf654('0x48')]()][_0xf654('0x27')]()});}});}return _0x49b1b5;}function getConnection(_0x58e782){return request({'method':'POST','form':{'method':_0xf654('0x4f'),'input_type':'JSON','response_type':_0xf654('0x22'),'rest_data':JSON[_0xf654('0x23')]({'user_auth':{'user_name':_0x58e782[_0xf654('0x50')],'password':_0x58e782[_0xf654('0x51')],'encryption':_0xf654('0x52')},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x58cadc){var _0x2cc8a6=_0x58cadc;if(_0x2cc8a6['id']){def[_0xf654('0x53')]=_0x2cc8a6['id'];return BPromise[_0xf654('0x31')](_0x2cc8a6);}else{throw new Error(util['format'](_0xf654('0x54'),_0x58e782['id']));}});}function setRelationship(_0x16d3ec,_0x5669bc,_0x2ae05f,_0x4a262e){return request({'form':{'method':_0xf654('0x55'),'input_type':_0xf654('0x22'),'response_type':_0xf654('0x22'),'rest_data':JSON[_0xf654('0x23')]({'session':_0x16d3ec['id'],'module_name':_0xf654('0x56'),'module_id':_0x2ae05f['id'],'link_field_name':_0x4a262e,'related_ids':[_0x5669bc['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xf654('0x57')]=function(_0xfd6610,_0x568db2,_0x22c0ff,_0xf4beb5,_0x5a155b,_0x5cbdfc){var _0x4eada7,_0x279961,_0x45dc91,_0x2585f3;_0x5cbdfc[_0xf654('0x58')]=intUtil['stripTrailingSlash'](_0x5cbdfc['remoteUri']);_0x5cbdfc['serverUrl']=intUtil[_0xf654('0x59')](_0x5cbdfc[_0xf654('0x5a')]);def[_0xf654('0x5b')]=util['format'](_0xf654('0x5c'),_0x5cbdfc[_0xf654('0x58')]);if(_0x5a155b&&_0x5a155b[_0xf654('0x5d')]){logger[_0xf654('0xe')](_0xf654('0x5e'),_0xf654('0x5f'));_0x568db2[_0xf654('0x60')]=util['format'](_0xf654('0x61'),_0x5cbdfc[_0xf654('0x5a')],_0x568db2[_0xf654('0x62')],md5(_0x568db2[_0xf654('0x62')]));}else{_0x568db2[_0xf654('0x60')]='';}return getConnection(_0x5cbdfc)[_0xf654('0x2c')](function(_0x4a2f22){_0x2585f3=_0x4a2f22;return getUser(_0x5cbdfc,_0xf4beb5['name'],_0x2585f3);})[_0xf654('0x2c')](function(_0x24b6b7){_0x4eada7=_0x24b6b7;logger[_0xf654('0xe')](_0xf654('0x63'),_0x4eada7['id']);return getEndUser(_0x5cbdfc,_0x568db2[_0xf654('0x64')],_0x568db2[_0xf654('0x65')],_0x2585f3);})['then'](function(_0x35f48b){_0x279961=_0x35f48b;logger[_0xf654('0xe')]('The\x20Enduser\x20ID\x20is:',_0x279961['id']);return getTicket(_0x5cbdfc,_0x4eada7,_0x279961,_0x22c0ff,_0x568db2,_0x22c0ff[_0xf654('0x66')],_0x2585f3,_0xf654('0x67'));})[_0xf654('0x2c')](function(_0x1c2433){_0x45dc91=_0x1c2433;logger[_0xf654('0xe')]('Ticket\x20created!');logger[_0xf654('0xe')](_0xf654('0x68'),_0x45dc91['id']);return setRelationship(_0x2585f3,_0x4eada7,_0x45dc91,_0xf654('0x69'));})[_0xf654('0x2c')](function(){return setRelationship(_0x2585f3,_0x279961,_0x45dc91,_0xf654('0x6a'));})[_0xf654('0x2c')](function(){return getServerInfo(_0x2585f3);})[_0xf654('0x2c')](function(_0x1a778d){var _0x55222b=parseInt(_0x1a778d[_0xf654('0x6b')][_0xf654('0x6c')](0x0));var _0x447b4a=util[_0xf654('0x24')](_0xf654('0x6d'),_0x5cbdfc['remoteUri'],_0x45dc91['id']);if(_0x55222b>0x6){_0x447b4a=util['format'](_0xf654('0x6e'),_0x5cbdfc[_0xf654('0x58')],_0x45dc91['id']);}logger[_0xf654('0xe')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf654('0x24')](_0xf654('0x6f'),_0xf4beb5[_0xf654('0xf')]),_0xf654('0x70'),{'uri':_0x447b4a});})['catch'](function(_0x1215dc){logger[_0xf654('0x71')]('[QUEUE]',JSON[_0xf654('0x23')](_0x1215dc));});};exports[_0xf654('0x72')]=function(_0x35eecf,_0x300849,_0x135c2d,_0xd8d734,_0x53d128,_0x8184d2,_0x54693a){var _0x2c48fe,_0x184db9,_0x7d4e1f,_0x1a78f4;_0x8184d2[_0xf654('0x58')]=intUtil[_0xf654('0x59')](_0x8184d2[_0xf654('0x58')]);_0x8184d2[_0xf654('0x5a')]=intUtil[_0xf654('0x59')](_0x8184d2[_0xf654('0x5a')]);def['uri']=util[_0xf654('0x24')]('%s/service/v4_1/rest.php',_0x8184d2['remoteUri']);if(_0x54693a&&_0x54693a[_0xf654('0x73')]&&_0x54693a[_0xf654('0x73')]!==_0xf654('0x74')){logger[_0xf654('0xe')](_0xf654('0x75'),'Recording\x20is\x20enabled!');_0x300849['recordingURL']=util['format'](_0xf654('0x61'),_0x8184d2[_0xf654('0x5a')],_0x300849[_0xf654('0x62')],md5(_0x300849['uniqueid']));}return getConnection(_0x8184d2)[_0xf654('0x2c')](function(_0x5d4737){_0x1a78f4=_0x5d4737;return getUser(_0x8184d2,_0xd8d734[_0xf654('0xf')],_0x1a78f4);})[_0xf654('0x2c')](function(_0x1adb8c){_0x2c48fe=_0x1adb8c;logger[_0xf654('0xe')]('The\x20User\x20ID\x20is:',_0x2c48fe['id']);return getEndUser(_0x8184d2,_0x300849[_0xf654('0x76')],_0x300849[_0xf654('0x77')],_0x1a78f4);})[_0xf654('0x2c')](function(_0xcea686){_0x184db9=_0xcea686;logger[_0xf654('0xe')](_0xf654('0x78'),_0x184db9['id']);return getTicket(_0x8184d2,_0x2c48fe,_0x184db9,_0x135c2d,_0x300849,_0x135c2d[_0xf654('0x66')],_0x1a78f4,_0xf654('0x79'));})['then'](function(_0x33d721){_0x7d4e1f=_0x33d721;logger['info']('Ticket\x20created!');logger[_0xf654('0xe')](_0xf654('0x68'),_0x7d4e1f['id']);return setRelationship(_0x1a78f4,_0x2c48fe,_0x7d4e1f,_0xf654('0x69'));})[_0xf654('0x2c')](function(){return setRelationship(_0x1a78f4,_0x184db9,_0x7d4e1f,'contacts');})[_0xf654('0x2c')](function(){return getServerInfo(_0x1a78f4);})['then'](function(_0x312230){var _0x2db364=parseInt(_0x312230[_0xf654('0x6b')][_0xf654('0x6c')](0x0));var _0x1da92e=util[_0xf654('0x24')](_0xf654('0x6d'),_0x8184d2[_0xf654('0x58')],_0x7d4e1f['id']);if(_0x2db364>0x6){_0x1da92e=util[_0xf654('0x24')](_0xf654('0x6e'),_0x8184d2['remoteUri'],_0x7d4e1f['id']);}logger['info'](_0xf654('0x75'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf654('0x24')](_0xf654('0x6f'),_0xd8d734['name']),_0xf654('0x70'),{'uri':_0x1da92e});})[_0xf654('0x7a')](function(_0x3deaf9){logger[_0xf654('0x71')](_0xf654('0x75'),JSON['stringify'](_0x3deaf9));});};exports[_0xf654('0x7b')]=function(_0x22257d,_0x5a76fd,_0x3beb19,_0xb6dcbb,_0x2fd948,_0x514478){var _0x1344be,_0x50758d,_0xffc8bf,_0x2a6b11;_0x514478[_0xf654('0x58')]=intUtil['stripTrailingSlash'](_0x514478[_0xf654('0x58')]);_0x514478[_0xf654('0x5a')]=intUtil[_0xf654('0x59')](_0x514478[_0xf654('0x5a')]);def[_0xf654('0x5b')]=util[_0xf654('0x24')](_0xf654('0x5c'),_0x514478[_0xf654('0x58')]);if(_0x2fd948&&_0x2fd948['monitor_format']){logger[_0xf654('0xe')]('['+_0x5a76fd[_0xf654('0x7c')][_0xf654('0x7d')]()+']',_0xf654('0x5f'));_0x5a76fd[_0xf654('0x60')]=util[_0xf654('0x24')](_0xf654('0x61'),_0x514478[_0xf654('0x5a')],_0x5a76fd[_0xf654('0x62')],md5(_0x5a76fd[_0xf654('0x62')]));}else{_0x5a76fd[_0xf654('0x60')]='';}return getConnection(_0x514478)['then'](function(_0x2f8cb1){_0x2a6b11=_0x2f8cb1;if(!_[_0xf654('0x29')](_0xb6dcbb)){return getUser(_0x514478,_0xb6dcbb[_0xf654('0xf')],_0x2a6b11);}else{return getUser(_0x514478,null,_0x2a6b11);}})['then'](function(_0x4a8a56){_0x1344be=_0x4a8a56;logger[_0xf654('0xe')]('The\x20User\x20ID\x20is:',_0x1344be['id']);return getEndUser(_0x514478,_0x5a76fd['calleridname'],_0x5a76fd[_0xf654('0x65')],_0x2a6b11);})[_0xf654('0x2c')](function(_0x21ef00){_0x50758d=_0x21ef00;logger['info']('The\x20Enduser\x20ID\x20is:',_0x50758d['id']);return getTicket(_0x514478,_0x1344be,_0x50758d,_0x3beb19,_0x5a76fd,_0x3beb19['Fields'],_0x2a6b11,_0xf654('0x67'));})[_0xf654('0x2c')](function(_0x43a8f6){_0xffc8bf=_0x43a8f6;logger[_0xf654('0xe')](_0xf654('0x7e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0xffc8bf['id']);return setRelationship(_0x2a6b11,_0x1344be,_0xffc8bf,_0xf654('0x69'));})[_0xf654('0x2c')](function(){return setRelationship(_0x2a6b11,_0x50758d,_0xffc8bf,_0xf654('0x6a'));})['then'](function(){return getServerInfo(_0x2a6b11);})[_0xf654('0x7a')](function(_0x450298){logger[_0xf654('0x71')]('['+_0x5a76fd['lastevent'][_0xf654('0x7d')]()+']',JSON[_0xf654('0x23')](_0x450298));});};
\ No newline at end of file
index 8becdf4..1e8bd47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a20=['slice','lastIndexOf','isNil','test','lodash','getString','length','sortBy','type','string','push','content','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','key','format','keyContent','keyType','variable','%s:\x20%s','join','stripTrailingSlash'];(function(_0x5ae80f,_0x48952e){var _0x45ce09=function(_0x1fd0f9){while(--_0x1fd0f9){_0x5ae80f['push'](_0x5ae80f['shift']());}};_0x45ce09(++_0x48952e);}(_0x8a20,0x1b4));var _0x08a2=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8a20[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x08a2('0x0'));var util=require('util');exports[_0x08a2('0x1')]=function(_0x3e0fc4,_0x1ada37,_0x1b549c){var _0x17f0a4=[];if(_0x3e0fc4[_0x08a2('0x2')]>0x0){var _0x20390a=_[_0x08a2('0x3')](_0x3e0fc4,['id']);for(var _0x1c0a51=0x0;_0x1c0a51<_0x20390a[_0x08a2('0x2')];_0x1c0a51++){var _0x48c2f6=_0x20390a[_0x1c0a51];if(_0x48c2f6[_0x08a2('0x4')]===_0x08a2('0x5')){_0x17f0a4[_0x08a2('0x6')](_0x48c2f6[_0x08a2('0x7')]);}else if(_0x48c2f6['type']==='variable'&&_0x48c2f6[_0x08a2('0x8')]){_0x1ada37[_0x48c2f6[_0x08a2('0x8')]]&&_0x17f0a4[_0x08a2('0x6')](_0x1ada37[_0x48c2f6['variableName']]['toString']());}else if(_0x48c2f6[_0x08a2('0x4')]===_0x08a2('0x9')&&_0x48c2f6[_0x08a2('0xa')]&&_0x48c2f6[_0x08a2('0xa')][_0x08a2('0xb')]){_0x1ada37[_0x48c2f6['Variable'][_0x08a2('0xb')][_0x08a2('0xc')]()]&&_0x17f0a4[_0x08a2('0x6')](_0x1ada37[_0x48c2f6[_0x08a2('0xa')][_0x08a2('0xb')][_0x08a2('0xc')]()][_0x08a2('0xd')]());}else if(_0x48c2f6[_0x08a2('0x4')]===_0x08a2('0xe')){if(_0x48c2f6['keyType']===_0x08a2('0x5')&&_0x48c2f6[_0x08a2('0xf')]){_0x17f0a4[_0x08a2('0x6')](util[_0x08a2('0x10')]('%s:\x20%s',_0x48c2f6[_0x08a2('0xf')],_0x48c2f6[_0x08a2('0x11')]));}else if(_0x48c2f6[_0x08a2('0x12')]===_0x08a2('0x13')&&_0x48c2f6[_0x08a2('0x8')]&&_0x48c2f6[_0x08a2('0xf')]){_0x1ada37[_0x48c2f6[_0x08a2('0x8')]]&&_0x17f0a4[_0x08a2('0x6')](util[_0x08a2('0x10')](_0x08a2('0x14'),_0x48c2f6[_0x08a2('0xf')],_0x1ada37[_0x48c2f6[_0x08a2('0x8')]]));}else if(_0x48c2f6[_0x08a2('0x12')]===_0x08a2('0x9')&&_0x48c2f6[_0x08a2('0xa')]&&_0x48c2f6[_0x08a2('0xa')]['name']&&_0x48c2f6[_0x08a2('0xf')]){_0x1ada37[_0x48c2f6[_0x08a2('0xa')][_0x08a2('0xb')][_0x08a2('0xc')]()]&&_0x17f0a4[_0x08a2('0x6')](util['format'](_0x08a2('0x14'),_0x48c2f6['key'],_0x1ada37[_0x48c2f6[_0x08a2('0xa')]['name'][_0x08a2('0xc')]()]));}}}}return _0x17f0a4[_0x08a2('0x15')](_0x1b549c);};exports[_0x08a2('0x16')]=function(_0x304ada){var _0x1dd06d=_0x304ada[_0x08a2('0x17')](-0x1);if(_0x1dd06d==='/'){_0x304ada=_0x304ada['substring'](0x0,_0x304ada[_0x08a2('0x18')](_0x1dd06d));}return _0x304ada;};exports['validateEmail']=function(_0x1b1f15){if(!_[_0x08a2('0x19')](_0x1b1f15)&&_0x1b1f15!==''){var _0x5380d0=/^(([^<>()\[\]\\.,;:\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 _0x5380d0[_0x08a2('0x1a')](String(_0x1b1f15)[_0x08a2('0xc')]());}else{return![];}};
\ No newline at end of file
+var _0x30a8=['keyType','%s:\x20%s','keyContent','key','format','join','stripTrailingSlash','slice','validateEmail','isNil','test','util','getString','length','type','string','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue'];(function(_0x4f1734,_0x302cf8){var _0x3b67e3=function(_0x51cc60){while(--_0x51cc60){_0x4f1734['push'](_0x4f1734['shift']());}};_0x3b67e3(++_0x302cf8);}(_0x30a8,0x150));var _0x830a=function(_0x443260,_0x533f7e){_0x443260=_0x443260-0x0;var _0x2df0b0=_0x30a8[_0x443260];return _0x2df0b0;};'use strict';var _=require('lodash');var util=require(_0x830a('0x0'));exports[_0x830a('0x1')]=function(_0x42ca11,_0x1dd8cd,_0x5c7338){var _0x274f16=[];if(_0x42ca11[_0x830a('0x2')]>0x0){var _0x227298=_['sortBy'](_0x42ca11,['id']);for(var _0x54d98a=0x0;_0x54d98a<_0x227298[_0x830a('0x2')];_0x54d98a++){var _0x1b5cbb=_0x227298[_0x54d98a];if(_0x1b5cbb[_0x830a('0x3')]===_0x830a('0x4')){_0x274f16[_0x830a('0x5')](_0x1b5cbb[_0x830a('0x6')]);}else if(_0x1b5cbb['type']===_0x830a('0x7')&&_0x1b5cbb[_0x830a('0x8')]){_0x1dd8cd[_0x1b5cbb['variableName']]&&_0x274f16[_0x830a('0x5')](_0x1dd8cd[_0x1b5cbb[_0x830a('0x8')]][_0x830a('0x9')]());}else if(_0x1b5cbb[_0x830a('0x3')]==='customVariable'&&_0x1b5cbb[_0x830a('0xa')]&&_0x1b5cbb[_0x830a('0xa')][_0x830a('0xb')]){_0x1dd8cd[_0x1b5cbb['Variable'][_0x830a('0xb')][_0x830a('0xc')]()]&&_0x274f16[_0x830a('0x5')](_0x1dd8cd[_0x1b5cbb[_0x830a('0xa')][_0x830a('0xb')][_0x830a('0xc')]()]['toString']());}else if(_0x1b5cbb[_0x830a('0x3')]===_0x830a('0xd')){if(_0x1b5cbb[_0x830a('0xe')]===_0x830a('0x4')&&_0x1b5cbb['key']){_0x274f16[_0x830a('0x5')](util['format'](_0x830a('0xf'),_0x1b5cbb['key'],_0x1b5cbb[_0x830a('0x10')]));}else if(_0x1b5cbb[_0x830a('0xe')]==='variable'&&_0x1b5cbb['variableName']&&_0x1b5cbb[_0x830a('0x11')]){_0x1dd8cd[_0x1b5cbb[_0x830a('0x8')]]&&_0x274f16['push'](util[_0x830a('0x12')](_0x830a('0xf'),_0x1b5cbb[_0x830a('0x11')],_0x1dd8cd[_0x1b5cbb[_0x830a('0x8')]]));}else if(_0x1b5cbb[_0x830a('0xe')]==='customVariable'&&_0x1b5cbb[_0x830a('0xa')]&&_0x1b5cbb[_0x830a('0xa')][_0x830a('0xb')]&&_0x1b5cbb[_0x830a('0x11')]){_0x1dd8cd[_0x1b5cbb['Variable'][_0x830a('0xb')][_0x830a('0xc')]()]&&_0x274f16[_0x830a('0x5')](util[_0x830a('0x12')]('%s:\x20%s',_0x1b5cbb[_0x830a('0x11')],_0x1dd8cd[_0x1b5cbb[_0x830a('0xa')][_0x830a('0xb')]['toLowerCase']()]));}}}}return _0x274f16[_0x830a('0x13')](_0x5c7338);};exports[_0x830a('0x14')]=function(_0x692e17){var _0x525ae4=_0x692e17[_0x830a('0x15')](-0x1);if(_0x525ae4==='/'){_0x692e17=_0x692e17['substring'](0x0,_0x692e17['lastIndexOf'](_0x525ae4));}return _0x692e17;};exports[_0x830a('0x16')]=function(_0x50e2ee){if(!_[_0x830a('0x17')](_0x50e2ee)&&_0x50e2ee!==''){var _0x44ad96=/^(([^<>()\[\]\\.,;:\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 _0x44ad96[_0x830a('0x18')](String(_0x50e2ee)[_0x830a('0xc')]());}else{return![];}};
\ No newline at end of file
index c183771..cdd85fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
+var _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(_0x1a77e8,_0x374c98){var _0x1ea975=function(_0x5e8217){while(--_0x5e8217){_0x1a77e8['push'](_0x1a77e8['shift']());}};_0x1ea975(++_0x374c98);}(_0xe706,0xa3));var _0x6e70=function(_0x4c4042,_0x1ea485){_0x4c4042=_0x4c4042-0x0;var _0xbd10dc=_0xe706[_0x4c4042];return _0xbd10dc;};'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 b9369c1..a7b9a0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb86f=['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.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','user','authType','password','%s:%s','token','%s/token:%s','username','base64','debug','[HTTP]','stringify','GET','map','forEach','string','picklist','nameField','customField','toLowerCase','toString','includes','type','custom_fields','push','idField','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','replace','/api/v2','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','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','remoteUri','POST','Tags','name','getString','Descriptions','then','Ticket\x20created!','ticket','validateEmail','%s/search.json'];(function(_0x3706bb,_0x2679e1){var _0x5c498b=function(_0x310c52){while(--_0x310c52){_0x3706bb['push'](_0x3706bb['shift']());}};_0x5c498b(++_0x2679e1);}(_0xb86f,0x1a8));var _0xfb86=function(_0x3946b5,_0x69ada){_0x3946b5=_0x3946b5-0x0;var _0x304e7b=_0xb86f[_0x3946b5];return _0x304e7b;};'use strict';var _=require(_0xfb86('0x0'));var rp=require('request-promise');var md5=require(_0xfb86('0x1'));var util=require(_0xfb86('0x2'));var Redis=require(_0xfb86('0x3'));var intUtil=require(_0xfb86('0x4'));var config=require(_0xfb86('0x5'));var logger=require(_0xfb86('0x6'))('zendesk');config[_0xfb86('0x7')]=_[_0xfb86('0x8')](config[_0xfb86('0x7')],{'host':_0xfb86('0x9'),'port':0x18eb});var io=require(_0xfb86('0xa'))(new Redis(config[_0xfb86('0x7')]));function emit(_0x557403,_0x209da1,_0x47ac25){io['to'](_0x557403)[_0xfb86('0xb')](_0x209da1,_0x47ac25);}var headers={'Content-Type':_0xfb86('0xc'),'Accept':'application/json'};function getTicket(_0x36c000,_0x288b0b,_0x467b1b,_0x1c12a5,_0x4f3a8a){logger[_0xfb86('0xd')](_0xfb86('0xe'));return request({'uri':util[_0xfb86('0xf')](_0xfb86('0x10'),_0x36c000[_0xfb86('0x11')]),'method':_0xfb86('0x12'),'body':{'ticket':_['merge']({'requester_id':_0x467b1b['id'],'submitter_id':_0x288b0b?_0x288b0b['id']:undefined,'assignee_id':_0x288b0b?_0x288b0b['id']:undefined,'tags':getTags(_0x1c12a5[_0xfb86('0x13')],_0xfb86('0x14')),'subject':intUtil['getString'](_0x1c12a5['Subjects'],_0x4f3a8a,'\x20'),'description':intUtil[_0xfb86('0x15')](_0x1c12a5[_0xfb86('0x16')],_0x4f3a8a,'\x0a'),'comment':{'public':![],'body':intUtil[_0xfb86('0x15')](_0x1c12a5['Descriptions'],_0x4f3a8a,'\x0a')}},getCustomFields(_0x1c12a5['Fields'],_0x4f3a8a))}})[_0xfb86('0x17')](function(_0xee47c5){logger[_0xfb86('0xd')](_0xfb86('0x18'));return _0xee47c5[_0xfb86('0x19')];});}function getUser(_0x454324,_0x5c3923){if(intUtil[_0xfb86('0x1a')](_0x5c3923)){logger['info']('Getting\x20agent\x20with\x20email',_0x5c3923);return request({'uri':util['format'](_0xfb86('0x1b'),_0x454324['remoteUri']),'qs':{'query':util['format'](_0xfb86('0x1c'),_0x5c3923)}})['then'](function(_0x1681c6){if(_0x1681c6[_0xfb86('0x1d')]){logger['info'](_0xfb86('0x1e'));return _[_0xfb86('0x1f')](_0x1681c6[_0xfb86('0x20')],{'email':_0x5c3923,'role':_0xfb86('0x21')});}else{logger[_0xfb86('0xd')](_0xfb86('0x22'));return request({'uri':util['format'](_0xfb86('0x23'),_0x454324[_0xfb86('0x11')])})['then'](function(_0x29ab6c){logger[_0xfb86('0xd')](_0xfb86('0x24'));return _0x29ab6c['user'];});}});}else{logger['info'](_0xfb86('0x22'));return request({'uri':util[_0xfb86('0xf')](_0xfb86('0x23'),_0x454324['remoteUri'])})[_0xfb86('0x17')](function(_0x4eb241){logger[_0xfb86('0xd')](_0xfb86('0x24'));return _0x4eb241['user'];});}}function getEndUser(_0x1ad572,_0x43db57,_0x59d08a){logger['info'](_0xfb86('0x25'),_0x59d08a);return request({'uri':util[_0xfb86('0xf')](_0xfb86('0x1b'),_0x1ad572[_0xfb86('0x11')]),'qs':{'query':util[_0xfb86('0xf')](_0xfb86('0x26'),_0x59d08a)}})['then'](function(_0x3b3db5){var _0xbd19f8;if(_0x3b3db5[_0xfb86('0x20')][_0xfb86('0x27')]){_0x3b3db5['results']=_['filter'](_0x3b3db5[_0xfb86('0x20')],{'suspended':![],'role':_0xfb86('0x28')});if(_0x3b3db5[_0xfb86('0x20')][_0xfb86('0x27')]){_0xbd19f8=_[_0xfb86('0x29')](_0x3b3db5[_0xfb86('0x20')]);}}if(_0xbd19f8){logger[_0xfb86('0xd')]('Enduser\x20found!');return _0xbd19f8;}else{logger[_0xfb86('0xd')](_0xfb86('0x2a'));return request({'uri':util[_0xfb86('0xf')](_0xfb86('0x2b'),_0x1ad572[_0xfb86('0x11')]),'method':_0xfb86('0x12'),'body':{'user':{'role':_0xfb86('0x28'),'name':util[_0xfb86('0xf')](_0xfb86('0x2c'),_0x43db57||_0x59d08a),'phone':_0x59d08a}}})['then'](function(_0x48e682){logger[_0xfb86('0xd')](_0xfb86('0x2d'));return _0x48e682[_0xfb86('0x2e')];});}});}function getAuth(_0x7e168b){var _0x19aae9;if(_0x7e168b[_0xfb86('0x2f')]===_0xfb86('0x30')){_0x19aae9=util[_0xfb86('0xf')](_0xfb86('0x31'),_0x7e168b['username'],_0x7e168b[_0xfb86('0x30')]);}else if(_0x7e168b[_0xfb86('0x2f')]===_0xfb86('0x32')){_0x19aae9=util[_0xfb86('0xf')](_0xfb86('0x33'),_0x7e168b[_0xfb86('0x34')],_0x7e168b[_0xfb86('0x32')]);}return util['format']('Basic\x20%s',new Buffer(_0x19aae9)['toString'](_0xfb86('0x35')));}function request(_0x582c19){logger[_0xfb86('0x36')](_0xfb86('0x37'),JSON[_0xfb86('0x38')](_0x582c19));return rp(_[_0xfb86('0x8')](_0x582c19,{'method':_0xfb86('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x178434,_0x1e6e32){var _0x385836=[];if(_0x178434&&_0x178434[_0xfb86('0x27')]>0x0){_0x385836=_[_0xfb86('0x3a')](_0x178434,_0x1e6e32);}return _0x385836;}function getCustomFields(_0x39d03d,_0x1cf85e){var _0x2a11c0=[];var _0x596835={'custom_fields':[]};if(_0x39d03d['length']>0x0){_[_0xfb86('0x3b')](_0x39d03d,function(_0x24cc0b){if(_['includes']([_0xfb86('0x3c'),_0xfb86('0x3d')],_0x24cc0b['type'])&&_0x24cc0b[_0xfb86('0x3e')]&&!_0x24cc0b[_0xfb86('0x3f')]){_0x596835[_0x24cc0b[_0xfb86('0x3e')][_0xfb86('0x40')]()]=_0x24cc0b['content'][_0xfb86('0x41')]();}else if(_[_0xfb86('0x42')]([_0xfb86('0x3c'),_0xfb86('0x3d')],_0x24cc0b[_0xfb86('0x43')])&&_0x24cc0b['idField']&&_0x24cc0b['customField']){_0x596835[_0xfb86('0x44')][_0xfb86('0x45')]({'id':_0x24cc0b[_0xfb86('0x46')],'value':_0x24cc0b['content'][_0xfb86('0x41')]()});}else if(_0x24cc0b[_0xfb86('0x43')]===_0xfb86('0x47')&&_0x24cc0b[_0xfb86('0x48')]&&_0x24cc0b[_0xfb86('0x46')]&&_0x24cc0b[_0xfb86('0x3f')]){_0x1cf85e[_0x24cc0b['variableName']]&&_0x596835[_0xfb86('0x44')][_0xfb86('0x45')]({'id':_0x24cc0b[_0xfb86('0x46')],'value':_0x1cf85e[_0x24cc0b[_0xfb86('0x48')]][_0xfb86('0x41')]()});}else if(_0x24cc0b[_0xfb86('0x43')]==='customVariable'&&_0x24cc0b[_0xfb86('0x49')]&&_0x24cc0b[_0xfb86('0x49')]['name']&&_0x24cc0b[_0xfb86('0x46')]&&_0x24cc0b[_0xfb86('0x3f')]){_0x1cf85e[_0x24cc0b[_0xfb86('0x49')][_0xfb86('0x14')][_0xfb86('0x40')]()]&&_0x596835[_0xfb86('0x44')][_0xfb86('0x45')]({'id':_0x24cc0b[_0xfb86('0x46')],'value':_0x1cf85e[_0x24cc0b[_0xfb86('0x49')][_0xfb86('0x14')][_0xfb86('0x40')]()][_0xfb86('0x41')]()});}});}return _0x596835;}exports[_0xfb86('0x4a')]=function(_0x3fb585,_0x7b6668,_0x30afcb,_0x563d57,_0x264cf4,_0x2b8b76){var _0xc08e92,_0x51279c;_0x2b8b76[_0xfb86('0x11')]=intUtil[_0xfb86('0x4b')](_0x2b8b76[_0xfb86('0x11')]);_0x2b8b76[_0xfb86('0x4c')]=intUtil[_0xfb86('0x4b')](_0x2b8b76[_0xfb86('0x4c')]);if(_0x264cf4&&_0x264cf4[_0xfb86('0x4d')]){logger['info'](_0xfb86('0x4e'),_0xfb86('0x4f'));_0x7b6668[_0xfb86('0x50')]=util[_0xfb86('0xf')](_0xfb86('0x51'),_0x2b8b76['serverUrl'],_0x7b6668[_0xfb86('0x52')],md5(_0x7b6668[_0xfb86('0x52')]));}else{_0x7b6668[_0xfb86('0x50')]='';}headers[_0xfb86('0x53')]=getAuth(_0x2b8b76);return getUser(_0x2b8b76,_0x563d57[_0xfb86('0x54')])['then'](function(_0x36bda9){_0xc08e92=_0x36bda9;logger[_0xfb86('0xd')]('The\x20User\x20ID\x20is:',_0xc08e92['id']);return getEndUser(_0x2b8b76,_0x7b6668[_0xfb86('0x55')],_0x7b6668[_0xfb86('0x56')]);})[_0xfb86('0x17')](function(_0x592384){_0x51279c=_0x592384;logger['info'](_0xfb86('0x57'),_0x51279c['id']);return getTicket(_0x2b8b76,_0xc08e92,_0x51279c,_0x30afcb,_0x7b6668);})['then'](function(_0x2c3dce){if(_0x2c3dce){logger['info'](_0xfb86('0x58'),_0x2c3dce['id']);switch(_0x2b8b76[_0xfb86('0x43')]){case _0xfb86('0x59'):logger['info'](_0xfb86('0x4e'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xfb86('0xf')](_0xfb86('0x5a'),_0x2b8b76[_0xfb86('0x11')],_0xc08e92['id'],_0x2c3dce['id']),'method':'POST'});case _0xfb86('0x5b'):logger[_0xfb86('0xd')](_0xfb86('0x4e'),_0xfb86('0x5c'));emit(util['format'](_0xfb86('0x5d'),_0x563d57[_0xfb86('0x14')]),_0xfb86('0x5e'),{'uri':util[_0xfb86('0xf')](_0xfb86('0x5f'),_0x2b8b76[_0xfb86('0x11')]['replace']('/api/v2',''),_0x2c3dce['id'])});break;default:logger[_0xfb86('0x60')](_0xfb86('0x4e'),_0xfb86('0x61'));}}})['catch'](function(_0x179941){logger[_0xfb86('0x60')](_0xfb86('0x62'),util[_0xfb86('0x63')](_0x179941,{'showHidden':!![],'depth':null}));});};exports[_0xfb86('0x64')]=function(_0x42747f,_0x3d8e1a,_0xbd088d,_0x1a4cee,_0x54c49a,_0x488db2,_0x34b6b){var _0x2e2d5f,_0x4676fb;_0x488db2[_0xfb86('0x11')]=intUtil[_0xfb86('0x4b')](_0x488db2[_0xfb86('0x11')]);_0x488db2[_0xfb86('0x4c')]=intUtil[_0xfb86('0x4b')](_0x488db2[_0xfb86('0x4c')]);if(_0x34b6b&&_0x34b6b[_0xfb86('0x65')]&&_0x34b6b[_0xfb86('0x65')]!==_0xfb86('0x66')){logger[_0xfb86('0xd')](_0xfb86('0x67'),_0xfb86('0x4f'));_0x3d8e1a[_0xfb86('0x50')]=util[_0xfb86('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x488db2[_0xfb86('0x4c')],_0x3d8e1a['uniqueid'],md5(_0x3d8e1a[_0xfb86('0x52')]));}headers[_0xfb86('0x53')]=getAuth(_0x488db2);return getUser(_0x488db2,_0x1a4cee[_0xfb86('0x54')])[_0xfb86('0x17')](function(_0x3a8598){_0x2e2d5f=_0x3a8598;logger[_0xfb86('0xd')](_0xfb86('0x68'),_0x2e2d5f['id']);return getEndUser(_0x488db2,_0x3d8e1a['destcalleridname'],_0x3d8e1a['destcalleridnum']);})[_0xfb86('0x17')](function(_0x3983b9){_0x4676fb=_0x3983b9;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4676fb['id']);return getTicket(_0x488db2,_0x2e2d5f,_0x4676fb,_0xbd088d,_0x3d8e1a);})[_0xfb86('0x17')](function(_0x278cfa){if(_0x278cfa){logger[_0xfb86('0xd')](_0xfb86('0x58'),_0x278cfa['id']);switch(_0x488db2['type']){case _0xfb86('0x59'):logger['info'](_0xfb86('0x67'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xfb86('0xf')](_0xfb86('0x5a'),_0x488db2[_0xfb86('0x11')],_0x2e2d5f['id'],_0x278cfa['id']),'method':_0xfb86('0x12')});case'newTab':logger[_0xfb86('0xd')](_0xfb86('0x67'),_0xfb86('0x5c'));emit(util[_0xfb86('0xf')](_0xfb86('0x5d'),_0x1a4cee[_0xfb86('0x14')]),'trigger:browser:url',{'uri':util[_0xfb86('0xf')](_0xfb86('0x5f'),_0x488db2[_0xfb86('0x11')][_0xfb86('0x69')](_0xfb86('0x6a'),''),_0x278cfa['id'])});break;default:logger[_0xfb86('0x60')](_0xfb86('0x67'),_0xfb86('0x61'));}}})[_0xfb86('0x6b')](function(_0x27eb18){logger[_0xfb86('0x60')](_0xfb86('0x6c'),util[_0xfb86('0x63')](_0x27eb18,{'showHidden':!![],'depth':null}));});};exports[_0xfb86('0x6d')]=function(_0x52fdb2,_0x495fec,_0x287a01,_0x57f966,_0x5c6001,_0x5c0127){var _0x31b798,_0x1d0924;_0x5c0127[_0xfb86('0x11')]=intUtil[_0xfb86('0x4b')](_0x5c0127[_0xfb86('0x11')]);_0x5c0127['serverUrl']=intUtil[_0xfb86('0x4b')](_0x5c0127[_0xfb86('0x4c')]);if(_0x5c6001&&_0x5c6001['monitor_format']){logger['info']('['+_0x495fec[_0xfb86('0x6e')][_0xfb86('0x6f')]()+']',_0xfb86('0x4f'));_0x495fec[_0xfb86('0x50')]=util[_0xfb86('0xf')](_0xfb86('0x51'),_0x5c0127['serverUrl'],_0x495fec[_0xfb86('0x52')],md5(_0x495fec[_0xfb86('0x52')]));}else{_0x495fec[_0xfb86('0x50')]='';}headers[_0xfb86('0x53')]=getAuth(_0x5c0127);return getUser(_0x5c0127)[_0xfb86('0x17')](function(_0x50c746){_0x31b798=_0x50c746;logger[_0xfb86('0xd')](_0xfb86('0x68'),_0x31b798['id']);return getEndUser(_0x5c0127,_0x495fec[_0xfb86('0x55')],_0x495fec[_0xfb86('0x56')]);})['then'](function(_0x2d4bfa){_0x1d0924=_0x2d4bfa;logger[_0xfb86('0xd')](_0xfb86('0x57'),_0x1d0924['id']);return getTicket(_0x5c0127,_0x31b798,_0x1d0924,_0x287a01,_0x495fec);})[_0xfb86('0x17')](function(_0x528e33){if(_0x528e33){logger['info']('The\x20Ticket\x20ID\x20is:',_0x528e33['id']);}})[_0xfb86('0x6b')](function(_0x41611c){logger[_0xfb86('0x60')]('['+_0x495fec[_0xfb86('0x6e')][_0xfb86('0x6f')]()+']'+_0xfb86('0x70'),util['inspect'](_0x41611c,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xc3c1=['ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','Tags','name','Subjects','getString','Descriptions','Fields','Ticket\x20created!','%s/search.json','type:user\x20role:agent\x20email:%s','count','info','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','then','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','toString','debug','stringify','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','variableName','custom_fields','customVariable','Variable','push','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','user:%s','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util'];(function(_0x2b95bc,_0x2c6ae3){var _0x3c734b=function(_0x47dbe9){while(--_0x47dbe9){_0x2b95bc['push'](_0x2b95bc['shift']());}};_0x3c734b(++_0x2c6ae3);}(_0xc3c1,0xd9));var _0x1c3c=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xc3c1[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0x1c3c('0x0'));var rp=require(_0x1c3c('0x1'));var md5=require('md5');var util=require(_0x1c3c('0x2'));var Redis=require(_0x1c3c('0x3'));var intUtil=require(_0x1c3c('0x4'));var config=require(_0x1c3c('0x5'));var logger=require(_0x1c3c('0x6'))(_0x1c3c('0x7'));config[_0x1c3c('0x8')]=_[_0x1c3c('0x9')](config[_0x1c3c('0x8')],{'host':_0x1c3c('0xa'),'port':0x18eb});var io=require(_0x1c3c('0xb'))(new Redis(config[_0x1c3c('0x8')]));function emit(_0x56c986,_0x532784,_0x425ce9){io['to'](_0x56c986)[_0x1c3c('0xc')](_0x532784,_0x425ce9);}var headers={'Content-Type':_0x1c3c('0xd'),'Accept':'application/json'};function getTicket(_0xbff0be,_0x4b8a0e,_0x5dee09,_0x2431b5,_0xdaa083){logger['info'](_0x1c3c('0xe'));return request({'uri':util[_0x1c3c('0xf')](_0x1c3c('0x10'),_0xbff0be[_0x1c3c('0x11')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x5dee09['id'],'submitter_id':_0x4b8a0e?_0x4b8a0e['id']:undefined,'assignee_id':_0x4b8a0e?_0x4b8a0e['id']:undefined,'tags':getTags(_0x2431b5[_0x1c3c('0x12')],_0x1c3c('0x13')),'subject':intUtil['getString'](_0x2431b5[_0x1c3c('0x14')],_0xdaa083,'\x20'),'description':intUtil[_0x1c3c('0x15')](_0x2431b5[_0x1c3c('0x16')],_0xdaa083,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1c3c('0x15')](_0x2431b5[_0x1c3c('0x16')],_0xdaa083,'\x0a')}},getCustomFields(_0x2431b5[_0x1c3c('0x17')],_0xdaa083))}})['then'](function(_0x15b724){logger['info'](_0x1c3c('0x18'));return _0x15b724['ticket'];});}function getUser(_0x56fba9,_0x3fdd6f){if(intUtil['validateEmail'](_0x3fdd6f)){logger['info']('Getting\x20agent\x20with\x20email',_0x3fdd6f);return request({'uri':util[_0x1c3c('0xf')](_0x1c3c('0x19'),_0x56fba9[_0x1c3c('0x11')]),'qs':{'query':util['format'](_0x1c3c('0x1a'),_0x3fdd6f)}})['then'](function(_0xf8b5fe){if(_0xf8b5fe[_0x1c3c('0x1b')]){logger[_0x1c3c('0x1c')](_0x1c3c('0x1d'));return _[_0x1c3c('0x1e')](_0xf8b5fe[_0x1c3c('0x1f')],{'email':_0x3fdd6f,'role':_0x1c3c('0x20')});}else{logger[_0x1c3c('0x1c')](_0x1c3c('0x21'));return request({'uri':util[_0x1c3c('0xf')](_0x1c3c('0x22'),_0x56fba9[_0x1c3c('0x11')])})['then'](function(_0xe2d414){logger['info'](_0x1c3c('0x23'));return _0xe2d414['user'];});}});}else{logger[_0x1c3c('0x1c')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1c3c('0xf')](_0x1c3c('0x22'),_0x56fba9[_0x1c3c('0x11')])})[_0x1c3c('0x24')](function(_0x179a0a){logger[_0x1c3c('0x1c')](_0x1c3c('0x23'));return _0x179a0a[_0x1c3c('0x25')];});}}function getEndUser(_0x5d4f75,_0x19015c,_0x12674d){logger['info'](_0x1c3c('0x26'),_0x12674d);return request({'uri':util[_0x1c3c('0xf')]('%s/search.json',_0x5d4f75[_0x1c3c('0x11')]),'qs':{'query':util[_0x1c3c('0xf')](_0x1c3c('0x27'),_0x12674d)}})['then'](function(_0x3ee445){var _0x2b2a65;if(_0x3ee445[_0x1c3c('0x1f')][_0x1c3c('0x28')]){_0x3ee445[_0x1c3c('0x1f')]=_['filter'](_0x3ee445['results'],{'suspended':![],'role':_0x1c3c('0x29')});if(_0x3ee445[_0x1c3c('0x1f')][_0x1c3c('0x28')]){_0x2b2a65=_[_0x1c3c('0x2a')](_0x3ee445[_0x1c3c('0x1f')]);}}if(_0x2b2a65){logger[_0x1c3c('0x1c')]('Enduser\x20found!');return _0x2b2a65;}else{logger[_0x1c3c('0x1c')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x1c3c('0x2b'),_0x5d4f75[_0x1c3c('0x11')]),'method':_0x1c3c('0x2c'),'body':{'user':{'role':_0x1c3c('0x29'),'name':util[_0x1c3c('0xf')](_0x1c3c('0x2d'),_0x19015c||_0x12674d),'phone':_0x12674d}}})[_0x1c3c('0x24')](function(_0x5e8dd0){logger[_0x1c3c('0x1c')](_0x1c3c('0x2e'));return _0x5e8dd0[_0x1c3c('0x25')];});}});}function getAuth(_0x3a7548){var _0x33bb7b;if(_0x3a7548[_0x1c3c('0x2f')]===_0x1c3c('0x30')){_0x33bb7b=util[_0x1c3c('0xf')](_0x1c3c('0x31'),_0x3a7548[_0x1c3c('0x32')],_0x3a7548[_0x1c3c('0x30')]);}else if(_0x3a7548[_0x1c3c('0x2f')]==='token'){_0x33bb7b=util[_0x1c3c('0xf')](_0x1c3c('0x33'),_0x3a7548[_0x1c3c('0x32')],_0x3a7548[_0x1c3c('0x34')]);}return util[_0x1c3c('0xf')](_0x1c3c('0x35'),new Buffer(_0x33bb7b)[_0x1c3c('0x36')]('base64'));}function request(_0x27315b){logger[_0x1c3c('0x37')]('[HTTP]',JSON[_0x1c3c('0x38')](_0x27315b));return rp(_[_0x1c3c('0x9')](_0x27315b,{'method':_0x1c3c('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x5d7a0f,_0x941b5e){var _0x58b3bd=[];if(_0x5d7a0f&&_0x5d7a0f['length']>0x0){_0x58b3bd=_['map'](_0x5d7a0f,_0x941b5e);}return _0x58b3bd;}function getCustomFields(_0xff3062,_0x57f091){var _0x154957=[];var _0x4ac813={'custom_fields':[]};if(_0xff3062[_0x1c3c('0x28')]>0x0){_[_0x1c3c('0x3a')](_0xff3062,function(_0x4cea66){if(_[_0x1c3c('0x3b')]([_0x1c3c('0x3c'),_0x1c3c('0x3d')],_0x4cea66[_0x1c3c('0x3e')])&&_0x4cea66[_0x1c3c('0x3f')]&&!_0x4cea66[_0x1c3c('0x40')]){_0x4ac813[_0x4cea66[_0x1c3c('0x3f')][_0x1c3c('0x41')]()]=_0x4cea66['content']['toString']();}else if(_[_0x1c3c('0x3b')]([_0x1c3c('0x3c'),_0x1c3c('0x3d')],_0x4cea66[_0x1c3c('0x3e')])&&_0x4cea66[_0x1c3c('0x42')]&&_0x4cea66[_0x1c3c('0x40')]){_0x4ac813['custom_fields']['push']({'id':_0x4cea66[_0x1c3c('0x42')],'value':_0x4cea66['content'][_0x1c3c('0x36')]()});}else if(_0x4cea66[_0x1c3c('0x3e')]==='variable'&&_0x4cea66[_0x1c3c('0x43')]&&_0x4cea66[_0x1c3c('0x42')]&&_0x4cea66[_0x1c3c('0x40')]){_0x57f091[_0x4cea66[_0x1c3c('0x43')]]&&_0x4ac813[_0x1c3c('0x44')]['push']({'id':_0x4cea66['idField'],'value':_0x57f091[_0x4cea66[_0x1c3c('0x43')]][_0x1c3c('0x36')]()});}else if(_0x4cea66[_0x1c3c('0x3e')]===_0x1c3c('0x45')&&_0x4cea66[_0x1c3c('0x46')]&&_0x4cea66[_0x1c3c('0x46')]['name']&&_0x4cea66[_0x1c3c('0x42')]&&_0x4cea66[_0x1c3c('0x40')]){_0x57f091[_0x4cea66[_0x1c3c('0x46')][_0x1c3c('0x13')][_0x1c3c('0x41')]()]&&_0x4ac813[_0x1c3c('0x44')][_0x1c3c('0x47')]({'id':_0x4cea66[_0x1c3c('0x42')],'value':_0x57f091[_0x4cea66[_0x1c3c('0x46')][_0x1c3c('0x13')][_0x1c3c('0x41')]()]['toString']()});}});}return _0x4ac813;}exports[_0x1c3c('0x48')]=function(_0x40d15a,_0x2da227,_0x745f87,_0x197639,_0x232c27,_0x4264e1){var _0x12be4e,_0x3d36e3;_0x4264e1[_0x1c3c('0x11')]=intUtil[_0x1c3c('0x49')](_0x4264e1[_0x1c3c('0x11')]);_0x4264e1[_0x1c3c('0x4a')]=intUtil[_0x1c3c('0x49')](_0x4264e1[_0x1c3c('0x4a')]);if(_0x232c27&&_0x232c27['monitor_format']){logger[_0x1c3c('0x1c')](_0x1c3c('0x4b'),_0x1c3c('0x4c'));_0x2da227[_0x1c3c('0x4d')]=util[_0x1c3c('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4264e1[_0x1c3c('0x4a')],_0x2da227[_0x1c3c('0x4e')],md5(_0x2da227['uniqueid']));}else{_0x2da227['recordingURL']='';}headers[_0x1c3c('0x4f')]=getAuth(_0x4264e1);return getUser(_0x4264e1,_0x197639[_0x1c3c('0x50')])[_0x1c3c('0x24')](function(_0x12c649){_0x12be4e=_0x12c649;logger[_0x1c3c('0x1c')](_0x1c3c('0x51'),_0x12be4e['id']);return getEndUser(_0x4264e1,_0x2da227[_0x1c3c('0x52')],_0x2da227[_0x1c3c('0x53')]);})['then'](function(_0x3939aa){_0x3d36e3=_0x3939aa;logger[_0x1c3c('0x1c')](_0x1c3c('0x54'),_0x3d36e3['id']);return getTicket(_0x4264e1,_0x12be4e,_0x3d36e3,_0x745f87,_0x2da227);})[_0x1c3c('0x24')](function(_0x2e4b2b){if(_0x2e4b2b){logger[_0x1c3c('0x1c')](_0x1c3c('0x55'),_0x2e4b2b['id']);switch(_0x4264e1['type']){case _0x1c3c('0x56'):logger[_0x1c3c('0x1c')](_0x1c3c('0x4b'),_0x1c3c('0x57'));return request({'uri':util[_0x1c3c('0xf')](_0x1c3c('0x58'),_0x4264e1[_0x1c3c('0x11')],_0x12be4e['id'],_0x2e4b2b['id']),'method':_0x1c3c('0x2c')});case _0x1c3c('0x59'):logger[_0x1c3c('0x1c')](_0x1c3c('0x4b'),_0x1c3c('0x5a'));emit(util[_0x1c3c('0xf')]('user:%s',_0x197639['name']),'trigger:browser:url',{'uri':util[_0x1c3c('0xf')]('%s/agent/tickets/%s',_0x4264e1[_0x1c3c('0x11')][_0x1c3c('0x5b')](_0x1c3c('0x5c'),''),_0x2e4b2b['id'])});break;default:logger[_0x1c3c('0x5d')]('[QUEUE]',_0x1c3c('0x5e'));}}})[_0x1c3c('0x5f')](function(_0x93aaf7){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x1c3c('0x60')](_0x93aaf7,{'showHidden':!![],'depth':null}));});};exports[_0x1c3c('0x61')]=function(_0x3405cb,_0x3be17b,_0x5edd74,_0x173c46,_0x4276a5,_0x292b83,_0x5d00c3){var _0x2f7dd5,_0x23dac6;_0x292b83[_0x1c3c('0x11')]=intUtil[_0x1c3c('0x49')](_0x292b83[_0x1c3c('0x11')]);_0x292b83[_0x1c3c('0x4a')]=intUtil['stripTrailingSlash'](_0x292b83[_0x1c3c('0x4a')]);if(_0x5d00c3&&_0x5d00c3[_0x1c3c('0x62')]&&_0x5d00c3[_0x1c3c('0x62')]!==_0x1c3c('0x63')){logger[_0x1c3c('0x1c')](_0x1c3c('0x64'),_0x1c3c('0x4c'));_0x3be17b[_0x1c3c('0x4d')]=util[_0x1c3c('0xf')](_0x1c3c('0x65'),_0x292b83[_0x1c3c('0x4a')],_0x3be17b[_0x1c3c('0x4e')],md5(_0x3be17b[_0x1c3c('0x4e')]));}headers['Authorization']=getAuth(_0x292b83);return getUser(_0x292b83,_0x173c46['email'])[_0x1c3c('0x24')](function(_0x76e57b){_0x2f7dd5=_0x76e57b;logger[_0x1c3c('0x1c')](_0x1c3c('0x51'),_0x2f7dd5['id']);return getEndUser(_0x292b83,_0x3be17b[_0x1c3c('0x66')],_0x3be17b['destcalleridnum']);})[_0x1c3c('0x24')](function(_0x5c7989){_0x23dac6=_0x5c7989;logger[_0x1c3c('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x23dac6['id']);return getTicket(_0x292b83,_0x2f7dd5,_0x23dac6,_0x5edd74,_0x3be17b);})[_0x1c3c('0x24')](function(_0x1090a0){if(_0x1090a0){logger[_0x1c3c('0x1c')](_0x1c3c('0x55'),_0x1090a0['id']);switch(_0x292b83[_0x1c3c('0x3e')]){case _0x1c3c('0x56'):logger[_0x1c3c('0x1c')](_0x1c3c('0x64'),_0x1c3c('0x57'));return request({'uri':util[_0x1c3c('0xf')](_0x1c3c('0x58'),_0x292b83[_0x1c3c('0x11')],_0x2f7dd5['id'],_0x1090a0['id']),'method':_0x1c3c('0x2c')});case _0x1c3c('0x59'):logger['info']('[OUTBOUND]',_0x1c3c('0x5a'));emit(util[_0x1c3c('0xf')](_0x1c3c('0x67'),_0x173c46['name']),_0x1c3c('0x68'),{'uri':util[_0x1c3c('0xf')]('%s/agent/tickets/%s',_0x292b83[_0x1c3c('0x11')][_0x1c3c('0x5b')]('/api/v2',''),_0x1090a0['id'])});break;default:logger[_0x1c3c('0x5d')](_0x1c3c('0x64'),_0x1c3c('0x5e'));}}})[_0x1c3c('0x5f')](function(_0xf4498b){logger[_0x1c3c('0x5d')](_0x1c3c('0x69'),util[_0x1c3c('0x60')](_0xf4498b,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x160ddf,_0x39e57a,_0x33c469,_0xcf7282,_0x17af92,_0x2a5d52){var _0x10d90b,_0x34562b;_0x2a5d52[_0x1c3c('0x11')]=intUtil['stripTrailingSlash'](_0x2a5d52[_0x1c3c('0x11')]);_0x2a5d52[_0x1c3c('0x4a')]=intUtil[_0x1c3c('0x49')](_0x2a5d52[_0x1c3c('0x4a')]);if(_0x17af92&&_0x17af92[_0x1c3c('0x6a')]){logger[_0x1c3c('0x1c')]('['+_0x39e57a[_0x1c3c('0x6b')][_0x1c3c('0x6c')]()+']',_0x1c3c('0x4c'));_0x39e57a['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a5d52[_0x1c3c('0x4a')],_0x39e57a[_0x1c3c('0x4e')],md5(_0x39e57a[_0x1c3c('0x4e')]));}else{_0x39e57a[_0x1c3c('0x4d')]='';}headers[_0x1c3c('0x4f')]=getAuth(_0x2a5d52);return getUser(_0x2a5d52)['then'](function(_0x208062){_0x10d90b=_0x208062;logger[_0x1c3c('0x1c')]('The\x20User\x20ID\x20is:',_0x10d90b['id']);return getEndUser(_0x2a5d52,_0x39e57a[_0x1c3c('0x52')],_0x39e57a['calleridnum']);})[_0x1c3c('0x24')](function(_0x3fc3f2){_0x34562b=_0x3fc3f2;logger['info'](_0x1c3c('0x54'),_0x34562b['id']);return getTicket(_0x2a5d52,_0x10d90b,_0x34562b,_0x33c469,_0x39e57a);})[_0x1c3c('0x24')](function(_0x2bd798){if(_0x2bd798){logger['info'](_0x1c3c('0x55'),_0x2bd798['id']);}})[_0x1c3c('0x5f')](function(_0x564c65){logger['error']('['+_0x39e57a[_0x1c3c('0x6b')][_0x1c3c('0x6c')]()+']'+_0x1c3c('0x6d'),util[_0x1c3c('0x60')](_0x564c65,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 352faf5..492f12d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96dd=['called','Call_Result','Called','complete','connect','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','data','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','/api/voice/recordings/','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','none','[OUTBOUND]','Recording\x20is\x20enabled!','uniqueid','zoho.eu','destcalleridname','destcalleridnum','Outbound','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','recordingURL','calleridnum','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','access_token','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','seconds','catch','error','stack','info','Search\x20user','GET','format','ActiveUsers','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','details','moduleCreate','Error:\x20','log','Zoho-oauthtoken\x20','moduleSearch','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent'];(function(_0x4d9f8a,_0x38105a){var _0x27aaae=function(_0x21e53a){while(--_0x21e53a){_0x4d9f8a['push'](_0x4d9f8a['shift']());}};_0x27aaae(++_0x38105a);}(_0x96dd,0x162));var _0xd96d=function(_0x4bce52,_0x56c627){_0x4bce52=_0x4bce52-0x0;var _0x241cca=_0x96dd[_0x4bce52];return _0x241cca;};'use strict';var _=require('lodash');var rp=require(_0xd96d('0x0'));var md5=require(_0xd96d('0x1'));var util=require(_0xd96d('0x2'));var intUtil=require(_0xd96d('0x3'));var moment=require(_0xd96d('0x4'));var Redis=require(_0xd96d('0x5'));var BPromise=require('bluebird');var config=require(_0xd96d('0x6'));var logger=require('../../../../config/logger')(_0xd96d('0x7'));config['redis']=_['defaults'](config[_0xd96d('0x8')],{'host':_0xd96d('0x9'),'port':0x18eb});var io=require(_0xd96d('0xa'))(new Redis(config[_0xd96d('0x8')]));function emit(_0x25b124,_0x2aae83,_0x53b8d1){io['to'](_0x25b124)[_0xd96d('0xb')](_0x2aae83,_0x53b8d1);}function request(_0x5cbf78){logger[_0xd96d('0xc')](_0xd96d('0xd'),JSON[_0xd96d('0xe')](_0x5cbf78));return rp(_0x5cbf78);}function getCustomFields(_0x4557e8,_0x13c562){var _0x2cc83b={};if(_0x4557e8[_0xd96d('0xf')]>0x0){_[_0xd96d('0x10')](_0x4557e8,function(_0x2691a6){if(_[_0xd96d('0x11')]([_0xd96d('0x12'),_0xd96d('0x13')],_0x2691a6[_0xd96d('0x14')])&&_0x2691a6[_0xd96d('0x15')]){_0x2cc83b[_0x2691a6['idField']]=_0x2691a6[_0xd96d('0x16')][_0xd96d('0x17')]();}else if(_0x2691a6['type']==='variable'&&_0x2691a6[_0xd96d('0x18')]&&_0x2691a6[_0xd96d('0x15')]&&_0x13c562[_0x2691a6[_0xd96d('0x18')]]){_0x2cc83b[_0x2691a6[_0xd96d('0x15')]]=_0x13c562[_0x2691a6[_0xd96d('0x18')]]['toString']();}else if(_0x2691a6[_0xd96d('0x14')]===_0xd96d('0x19')&&_0x2691a6[_0xd96d('0x1a')]&&_0x2691a6[_0xd96d('0x1a')]['name']&&_0x2691a6[_0xd96d('0x15')]&&_0x13c562[_0x2691a6[_0xd96d('0x1a')][_0xd96d('0x1b')][_0xd96d('0x1c')]()]){_0x2cc83b[_0x2691a6['idField']]=_0x13c562[_0x2691a6[_0xd96d('0x1a')]['name'][_0xd96d('0x1c')]()][_0xd96d('0x17')]();}});}return _0x2cc83b;}function getName(_0xe13aa2){if(_0xe13aa2['indexOf']('\x20')>0x0){var _0x3c4be1=_0xe13aa2[_0xd96d('0x1d')](/ (.+)/);if(_0x3c4be1[0x1]){return _0x3c4be1;}}return[_0xe13aa2,_0xe13aa2];}var accountsTokens={};function getAccessToken(_0x5a5918){return new Promise(function(_0x44a0e4,_0x572be3){if(!_['isNil'](accountsTokens[_0x5a5918['id']])&&!_[_0xd96d('0x1e')](accountsTokens[_0x5a5918['id']]['access_token'])){if(moment()[_0xd96d('0x1f')](accountsTokens[_0x5a5918['id']][_0xd96d('0x20')])){_0x44a0e4(accountsTokens[_0x5a5918['id']][_0xd96d('0x21')]);}}var _0x50eace;switch(_0x5a5918['zone']){case'US':_0x50eace=_0xd96d('0x22');break;case'AU':_0x50eace=_0xd96d('0x23');break;case'EU':_0x50eace=_0xd96d('0x24');break;case'IN':_0x50eace=_0xd96d('0x25');break;case'CN':_0x50eace=_0xd96d('0x26');break;default:_0x50eace=_0xd96d('0x24');break;}var _0x395fe8={'method':_0xd96d('0x27'),'uri':_0x50eace+'/oauth/v2/token','qs':{'refresh_token':_0x5a5918[_0xd96d('0x28')],'client_id':_0x5a5918[_0xd96d('0x29')],'client_secret':_0x5a5918[_0xd96d('0x2a')],'grant_type':_0xd96d('0x2b')},'json':!![]};return rp(_0x395fe8)['then'](function(_0x49caf9){accountsTokens[_0x5a5918['id']]={'access_token':_0x49caf9[_0xd96d('0x21')],'expires_in':moment()['add'](_0x49caf9[_0xd96d('0x20')],_0xd96d('0x2c'))};_0x44a0e4(_0x49caf9[_0xd96d('0x21')]);})[_0xd96d('0x2d')](function(_0x349a94){logger[_0xd96d('0x2e')]('Failing\x20creating\x20the\x20access_token',_0x349a94[_0xd96d('0x2f')]);_0x572be3(_0x349a94);});});}function getUser(_0x178924,_0xee9ff1,_0x5ebe2f,_0x53a5dc){logger[_0xd96d('0x30')](_0xd96d('0x31'));return request({'method':_0xd96d('0x32'),'uri':util[_0xd96d('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0xee9ff1),'qs':{'type':_0xd96d('0x34')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x178924},'json':!![]})[_0xd96d('0x35')](function(_0x1db239){if(_0x1db239[_0xd96d('0x36')]){var _0x24d9aa=-0x1;if(_[_0xd96d('0x37')](_0x1db239[_0xd96d('0x36')])){if(!_[_0xd96d('0x1e')](_0x53a5dc)){_0x24d9aa=_[_0xd96d('0x38')](_0x1db239[_0xd96d('0x36')],function(_0xbdd624){return _0xbdd624[_0xd96d('0x39')]===_0x53a5dc;});}if(_0x24d9aa>=0x0){logger[_0xd96d('0x30')](_0xd96d('0x3a'));}else{logger[_0xd96d('0x30')]('Using\x20the\x20admin\x20account!');_0x24d9aa=_[_0xd96d('0x38')](_0x1db239[_0xd96d('0x36')],function(_0x37a815){return _0x37a815[_0xd96d('0x3b')][_0xd96d('0x1b')]===_0xd96d('0x3c');});}return _0x1db239[_0xd96d('0x36')][_0x24d9aa];}else{if(_0x1db239[_0xd96d('0x3d')]['profile'][_0xd96d('0x1b')]===_0xd96d('0x3c')){logger[_0xd96d('0x30')](_0xd96d('0x3e'));user=_0x1db239['user'];return user;}else{logger[_0xd96d('0x2e')]('The\x20failing\x20result\x20is',JSON[_0xd96d('0xe')](_0x1db239));throw new Error(_0xd96d('0x3f')+JSON[_0xd96d('0xe')](_0x1db239));}}}else{logger['error'](_0xd96d('0x40'),JSON[_0xd96d('0xe')](_0x1db239));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xd96d('0xe')](_0x1db239));}})['catch'](function(_0x500049){console[_0xd96d('0x2e')](_0x500049);});}function getZohoUser(_0x2f55ce,_0x4b282f){return new BPromise(function(_0x42ba1e,_0x1d6f25){request(_0x2f55ce)[_0xd96d('0x35')](function(_0x976e8c){var _0x5292bf=null;if(_0x976e8c){_0x5292bf=_0x976e8c['data'][0x0];_0x5292bf[_0xd96d('0x41')]=_0x4b282f;}_0x42ba1e(_0x5292bf);})['catch'](function(_0x28b1eb){_0x1d6f25(_0x28b1eb);});});}function createEndUser(_0xf41e62,_0x53c13e,_0x4626a1,_0x44f79a,_0x5dd1c1,_0x52c85f){var _0x4626a1=getName(_0x4626a1);return request({'method':_0xd96d('0x27'),'uri':_0xd96d('0x42')+_0x53c13e+_0xd96d('0x43')+_[_0xd96d('0x44')](_0x52c85f['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4626a1[0x1],'First_Name':_0x4626a1[0x0],'Phone':_0x44f79a,'Owner':{'name':!_['isNil'](_0x5dd1c1[_0xd96d('0x45')]['name'])?_0x5dd1c1[_0xd96d('0x45')][_0xd96d('0x1b')]:!_[_0xd96d('0x1e')](_0x5dd1c1['first_name'])?_0x5dd1c1[_0xd96d('0x46')]+'\x20'+_0x5dd1c1['last_name']:_0x5dd1c1[_0xd96d('0x47')],'id':_0x5dd1c1['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xf41e62},'json':!![]})[_0xd96d('0x35')](function(_0x31c288){if(_0x31c288&&_0x31c288['data'][0x0][_0xd96d('0x48')]===_0xd96d('0x49')){var _0x47c76c=_0x31c288['data'][0x0][_0xd96d('0x4a')];_0x47c76c[_0xd96d('0x41')]=_[_0xd96d('0x44')](_0x52c85f[_0xd96d('0x4b')])+'s';return _0x47c76c;}logger[_0xd96d('0x2e')]('The\x20failing\x20result\x20is',JSON[_0xd96d('0xe')](data));throw new Error(_0xd96d('0x4c')+JSON[_0xd96d('0xe')](data));})[_0xd96d('0x2d')](function(_0x214087){console[_0xd96d('0x4d')]('CREATE\x20ERROR',_0x214087);});}function getEndUser(_0x6baf99,_0x4f1a5f,_0x28d6e2,_0x4c0353,_0x218320,_0x554c22,_0x3a9165){var _0x441096={'method':'GET','uri':'','headers':{'Authorization':_0xd96d('0x4e')+_0x6baf99},'json':!![]};switch(_0x3a9165[_0xd96d('0x4f')]){case _0xd96d('0x50'):_0x441096[_0xd96d('0x51')]=_0xd96d('0x42')+_0x4f1a5f+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x218320+'))';return getZohoUser(_0x441096,'Contacts')[_0xd96d('0x35')](function(_0x50a79a){if(_0x50a79a)return _0x50a79a;_0x441096[_0xd96d('0x51')]=_0xd96d('0x42')+_0x4f1a5f+_0xd96d('0x52')+_0x218320+'))';return getZohoUser(_0x441096,_0xd96d('0x53'))[_0xd96d('0x35')](function(_0xdc602d){if(_0xdc602d)return _0xdc602d;if(_0x3a9165[_0xd96d('0x4b')]!='nothing'){return createEndUser(_0x6baf99,_0x4f1a5f,_0x4c0353,_0x218320,_0x554c22,_0x3a9165);}else{return{};}});});break;case _0xd96d('0x54'):_0x441096[_0xd96d('0x51')]='https://www.zohoapis.'+_0x4f1a5f+_0xd96d('0x55')+_0x218320+'))';return getZohoUser(_0x441096,'Contacts')[_0xd96d('0x35')](function(_0x19ac9e){if(_0x19ac9e)return _0x19ac9e;if(_0x3a9165[_0xd96d('0x4b')]!=_0xd96d('0x56')){return createEndUser(_0x6baf99,_0x4f1a5f,_0x4c0353,_0x218320,_0x554c22,_0x3a9165);}else{return{};}});break;case'lead':_0x441096[_0xd96d('0x51')]=_0xd96d('0x42')+_0x4f1a5f+_0xd96d('0x52')+_0x218320+'))';return getZohoUser(_0x441096,_0xd96d('0x53'))['then'](function(_0xba6c12){if(_0xba6c12)return _0xba6c12;if(_0x3a9165[_0xd96d('0x4b')]!=_0xd96d('0x56')){return createEndUser(_0x6baf99,_0x4f1a5f,_0x4c0353,_0x218320,_0x554c22,_0x3a9165);}else{return{};}});break;}}function getCall(_0x2c5974,_0x4d9f1a,_0x2ff567,_0x27c761,_0x536536,_0x1eb96e,_0x5b7737,_0x4a0735){logger['info'](_0xd96d('0x57'));var _0xf52bfd={};_0xf52bfd[_0xd96d('0x58')]={'name':!_[_0xd96d('0x1e')](_0x27c761[_0xd96d('0x45')][_0xd96d('0x1b')])&&!_[_0xd96d('0x1e')](_0x27c761[_0xd96d('0x3b')][_0xd96d('0x1b')])&&_0x27c761[_0xd96d('0x3b')][_0xd96d('0x1b')]===_0xd96d('0x59')?_0x27c761[_0xd96d('0x45')][_0xd96d('0x1b')]:!_['isNil'](_0x27c761[_0xd96d('0x46')])?_0x27c761[_0xd96d('0x46')]+'\x20'+_0x27c761[_0xd96d('0x47')]:_0x27c761[_0xd96d('0x47')],'id':_0x27c761['id']};_0xf52bfd[_0xd96d('0x5a')]=intUtil['getString'](_0x1eb96e[_0xd96d('0x5b')],_0x5b7737,'\x20');_0xf52bfd['Description']=intUtil['getString'](_0x1eb96e[_0xd96d('0x5c')],_0x5b7737,'\x0a');if(_0x536536[_0xd96d('0x41')]==='Contacts'){_0xf52bfd['Who_Id']={'name':!_['isNil'](_0x536536[_0xd96d('0x5d')])?_0x536536[_0xd96d('0x5d')]:!_[_0xd96d('0x1e')](_0x536536['First_Name'])?_0x536536[_0xd96d('0x5e')]+'\x20'+_0x536536[_0xd96d('0x5f')]:_0x536536[_0xd96d('0x5f')],'id':_0x536536['id']};}if(_0x536536[_0xd96d('0x41')]===_0xd96d('0x53')){_0xf52bfd[_0xd96d('0x60')]={'name':!_[_0xd96d('0x1e')](_0x536536[_0xd96d('0x5d')])?_0x536536[_0xd96d('0x5d')]:!_[_0xd96d('0x1e')](_0x536536[_0xd96d('0x5e')])?_0x536536[_0xd96d('0x5e')]+'\x20'+_0x536536[_0xd96d('0x5f')]:_0x536536[_0xd96d('0x5f')],'id':_0x536536['id']};_0xf52bfd[_0xd96d('0x61')]=_[_0xd96d('0x44')](_0x536536['enduserType']);}if(_0x5b7737[_0xd96d('0x62')]){_0xf52bfd[_0xd96d('0x63')]=moment[_0xd96d('0x64')](parseInt(_0x5b7737[_0xd96d('0x62')])*0x3e8)[_0xd96d('0x33')](_0xd96d('0x65'));}else if(_0x5b7737[_0xd96d('0x66')]&&_0x5b7737[_0xd96d('0x67')]){_0xf52bfd[_0xd96d('0x63')]=moment['utc'](moment(_0x5b7737[_0xd96d('0x67')],_0xd96d('0x68'))[_0xd96d('0x69')](moment(_0x5b7737[_0xd96d('0x6a')],'YYYY-MM-DDTHH:mm:ss')))[_0xd96d('0x33')](_0xd96d('0x65'));}switch(_0x5b7737[_0xd96d('0x6b')]){case _0xd96d('0x6c'):_0xf52bfd[_0xd96d('0x6d')]=_0xd96d('0x6e');break;case _0xd96d('0x6f'):case _0xd96d('0x70'):_0xf52bfd[_0xd96d('0x6d')]='Answered';break;case'rejected':_0xf52bfd[_0xd96d('0x6d')]=_0xd96d('0x71');break;case _0xd96d('0x72'):_0xf52bfd[_0xd96d('0x6d')]=_0xd96d('0x73');break;case'timeout':_0xf52bfd[_0xd96d('0x6d')]=_0xd96d('0x74');default:}_0xf52bfd[_0xd96d('0x75')]=(_0x4a0735==='outbound'?moment(_0x5b7737[_0xd96d('0x6a')])[_0xd96d('0x33')](_0xd96d('0x68')):moment(_0x5b7737[_0xd96d('0x76')])[_0xd96d('0x33')](_0xd96d('0x68')))||moment()['format'](_0xd96d('0x68'));_0xf52bfd[_0xd96d('0x77')]=_0x4a0735||_0xd96d('0x78');_0xf52bfd=_[_0xd96d('0x79')](_0xf52bfd,getCustomFields(_0x1eb96e[_0xd96d('0x7a')],_0x5b7737));return request({'method':_0xd96d('0x27'),'uri':_0xd96d('0x42')+_0x4d9f1a+_0xd96d('0x7b'),'headers':{'Authorization':_0xd96d('0x4e')+_0x2c5974},'body':{'data':[_0xf52bfd]},'json':!![]})[_0xd96d('0x35')](function(_0x1b3bae){if(_0x1b3bae&&_0x1b3bae[_0xd96d('0x7c')][0x0]['code']===_0xd96d('0x49')){logger[_0xd96d('0x30')]('Call\x20created!');return{'id':_0x1b3bae['data'][0x0][_0xd96d('0x4a')]['id']};}})[_0xd96d('0x2d')](function(_0x47e6ea){logger['info'](_0xd96d('0x7d'),_0x47e6ea['stack']);console['log']('err',_0x47e6ea);});}exports['queue']=function(_0x4a184c,_0x36be76,_0x19423d,_0x86027a,_0x233017,_0x11eb34){var _0x14dc3e,_0x25e626,_0x28f876;_0x11eb34[_0xd96d('0x7e')]=intUtil[_0xd96d('0x7f')](_0x11eb34[_0xd96d('0x7e')]);_0x11eb34[_0xd96d('0x80')]=intUtil['stripTrailingSlash'](_0x11eb34[_0xd96d('0x80')]);if(_0x233017&&_0x233017[_0xd96d('0x81')]){logger[_0xd96d('0x30')](_0xd96d('0x82'),'Recording\x20is\x20enabled!');_0x36be76['recordingURL']=_0x11eb34[_0xd96d('0x80')]+_0xd96d('0x83')+_0x36be76['uniqueid']+_0xd96d('0x84')+md5(_0x36be76['uniqueid']);}else{_0x36be76['recordingURL']='';}var _0x3d5501=_0x11eb34[_0xd96d('0x7e')]==='zoho.eu'?'eu':_0xd96d('0x85');return getAccessToken(_0x11eb34)[_0xd96d('0x35')](function(_0x21b7e7){_0x28f876=_0x21b7e7;return getUser(_0x28f876,_0x3d5501,_0x11eb34,_0x86027a[_0xd96d('0x39')]);})['then'](function(_0xbf732d){_0x14dc3e=_0xbf732d;logger[_0xd96d('0x30')](_0xd96d('0x86'),_0x14dc3e['id']);return getEndUser(_0x28f876,_0x3d5501,_0x11eb34,_0x36be76[_0xd96d('0x87')],_0x36be76['calleridnum'],_0x14dc3e,_0x19423d);})[_0xd96d('0x35')](function(_0x5048e0){_0x25e626=_0x5048e0;return getCall(_0x28f876,_0x3d5501,_0x11eb34,_0x14dc3e,_0x25e626,_0x19423d,_0x36be76,'Inbound');})['then'](function(_0x555039){if(_0x555039){logger[_0xd96d('0x30')](_0xd96d('0x88'),_0x555039['id']);logger[_0xd96d('0x30')](_0xd96d('0x82'),_0xd96d('0x89'));emit(util[_0xd96d('0x33')](_0xd96d('0x8a'),_0x86027a['name']),_0xd96d('0x8b'),{'uri':'https://crm.'+_0x11eb34['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x555039['id']});}})['catch'](function(_0x440046){logger[_0xd96d('0x2e')]('[QUEUE]',JSON['stringify'](_0x440046));});};exports[_0xd96d('0x8c')]=function(_0x3700a8,_0x3db40b,_0x227e02,_0x422a3a,_0x15036f,_0x3eed1a,_0x2d33d4){var _0x57200b,_0x36397c,_0x4ba967;_0x3eed1a[_0xd96d('0x7e')]=intUtil['stripTrailingSlash'](_0x3eed1a['host']);_0x3eed1a[_0xd96d('0x80')]=intUtil[_0xd96d('0x7f')](_0x3eed1a[_0xd96d('0x80')]);if(_0x2d33d4&&_0x2d33d4['recordingFormat']&&_0x2d33d4['recordingFormat']!==_0xd96d('0x8d')){logger[_0xd96d('0x30')](_0xd96d('0x8e'),_0xd96d('0x8f'));_0x3db40b['recordingURL']=_0x3eed1a[_0xd96d('0x80')]+_0xd96d('0x83')+_0x3db40b['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x3db40b[_0xd96d('0x90')]);}var _0xe88b18=_0x3eed1a[_0xd96d('0x7e')]===_0xd96d('0x91')?'eu':'com';return getAccessToken(_0x3eed1a)[_0xd96d('0x35')](function(_0x57bc6c){_0x4ba967=_0x57bc6c;return getUser(_0x4ba967,_0xe88b18,_0x3eed1a,_0x422a3a['email']);})[_0xd96d('0x35')](function(_0x3ad182){_0x57200b=_0x3ad182;logger[_0xd96d('0x30')](_0xd96d('0x86'),_0x57200b['id']);return getEndUser(_0x4ba967,_0xe88b18,_0x3eed1a,_0x3db40b[_0xd96d('0x92')],_0x3db40b[_0xd96d('0x93')],_0x57200b,_0x227e02);})[_0xd96d('0x35')](function(_0x4061a3){_0x36397c=_0x4061a3;return getCall(_0x4ba967,_0xe88b18,_0x3eed1a,_0x57200b,_0x36397c,_0x227e02,_0x3db40b,_0xd96d('0x94'));})[_0xd96d('0x35')](function(_0x3aa491){if(_0x3aa491){logger[_0xd96d('0x30')](_0xd96d('0x88'),_0x3aa491['id']);logger[_0xd96d('0x30')](_0xd96d('0x8e'),_0xd96d('0x89'));emit(util[_0xd96d('0x33')]('user:%s',_0x422a3a[_0xd96d('0x1b')]),_0xd96d('0x8b'),{'uri':'https://crm.'+_0x3eed1a[_0xd96d('0x7e')]+_0xd96d('0x95')+_0x3aa491['id']});}})['catch'](function(_0x4401eb){logger[_0xd96d('0x2e')](_0xd96d('0x8e'),JSON[_0xd96d('0xe')](_0x4401eb));});};exports[_0xd96d('0x96')]=function(_0x30d936,_0x1cdd69,_0x2b98c6,_0x540438,_0x3b2157,_0x150a78){var _0x2ff622,_0x22db58,_0x153878;_0x150a78[_0xd96d('0x7e')]=intUtil[_0xd96d('0x7f')](_0x150a78[_0xd96d('0x7e')]);_0x150a78[_0xd96d('0x80')]=intUtil[_0xd96d('0x7f')](_0x150a78[_0xd96d('0x80')]);if(_0x3b2157&&_0x3b2157[_0xd96d('0x81')]){logger[_0xd96d('0x30')]('['+_0x1cdd69[_0xd96d('0x6b')][_0xd96d('0x97')]()+']',_0xd96d('0x8f'));_0x1cdd69[_0xd96d('0x98')]=_0x150a78['serverUrl']+_0xd96d('0x83')+_0x1cdd69[_0xd96d('0x90')]+_0xd96d('0x84')+md5(_0x1cdd69[_0xd96d('0x90')]);}else{_0x1cdd69[_0xd96d('0x98')]='';}var _0x399dca=_0x150a78[_0xd96d('0x7e')]===_0xd96d('0x91')?'eu':_0xd96d('0x85');return getAccessToken(_0x150a78)[_0xd96d('0x35')](function(_0x59c05e){_0x153878=_0x59c05e;return getUser(_0x153878,_0x399dca,_0x150a78);})[_0xd96d('0x35')](function(_0x5f1991){_0x2ff622=_0x5f1991;logger['info'](_0xd96d('0x86'),_0x2ff622['id']);return getEndUser(_0x153878,_0x399dca,_0x150a78,_0x1cdd69['calleridname'],_0x1cdd69[_0xd96d('0x99')],_0x2ff622,_0x2b98c6);})[_0xd96d('0x35')](function(_0x22673a){_0x22db58=_0x22673a;return getCall(_0x153878,_0x399dca,_0x150a78,_0x2ff622,_0x22db58,_0x2b98c6,_0x1cdd69,_0xd96d('0x78'));})[_0xd96d('0x35')](function(_0x1272a4){if(_0x1272a4){logger['info'](_0xd96d('0x88'),_0x1272a4['id']);}})[_0xd96d('0x2d')](function(_0x3f93cf){logger[_0xd96d('0x2e')]('['+_0x1cdd69[_0xd96d('0x6b')][_0xd96d('0x97')]()+']',JSON[_0xd96d('0xe')](_0x3f93cf));});};
\ No newline at end of file
+var _0xd45b=['https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','ActiveUsers','then','users','findIndex','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','Zoho-oauthtoken\x20','moduleSearch','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','administrator','Subject','getString','Subjects','Description','Descriptions','enduserType','Contacts','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','com','email','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','trigger:browser:url','unmanaged','toUpperCase','The\x20Call\x20ID\x20is:','lodash','request-promise','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','length','forEach','includes','string','picklist','idField','content','type','variable','variableName','toString','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au'];(function(_0x5df049,_0x260c2a){var _0x4886e2=function(_0x346d66){while(--_0x346d66){_0x5df049['push'](_0x5df049['shift']());}};_0x4886e2(++_0x260c2a);}(_0xd45b,0x11f));var _0xbd45=function(_0x4728b6,_0x5ee0cb){_0x4728b6=_0x4728b6-0x0;var _0x33303f=_0xd45b[_0x4728b6];return _0x33303f;};'use strict';var _=require(_0xbd45('0x0'));var rp=require(_0xbd45('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0xbd45('0x2'));var moment=require(_0xbd45('0x3'));var Redis=require(_0xbd45('0x4'));var BPromise=require('bluebird');var config=require(_0xbd45('0x5'));var logger=require(_0xbd45('0x6'))(_0xbd45('0x7'));config[_0xbd45('0x8')]=_[_0xbd45('0x9')](config[_0xbd45('0x8')],{'host':_0xbd45('0xa'),'port':0x18eb});var io=require(_0xbd45('0xb'))(new Redis(config['redis']));function emit(_0x22ec27,_0x21a2e7,_0x32d082){io['to'](_0x22ec27)[_0xbd45('0xc')](_0x21a2e7,_0x32d082);}function request(_0x5551af){logger[_0xbd45('0xd')](_0xbd45('0xe'),JSON['stringify'](_0x5551af));return rp(_0x5551af);}function getCustomFields(_0x514610,_0x1c5063){var _0x3e16ac={};if(_0x514610[_0xbd45('0xf')]>0x0){_[_0xbd45('0x10')](_0x514610,function(_0x1d2d74){if(_[_0xbd45('0x11')]([_0xbd45('0x12'),_0xbd45('0x13')],_0x1d2d74['type'])&&_0x1d2d74[_0xbd45('0x14')]){_0x3e16ac[_0x1d2d74[_0xbd45('0x14')]]=_0x1d2d74[_0xbd45('0x15')]['toString']();}else if(_0x1d2d74[_0xbd45('0x16')]===_0xbd45('0x17')&&_0x1d2d74[_0xbd45('0x18')]&&_0x1d2d74[_0xbd45('0x14')]&&_0x1c5063[_0x1d2d74['variableName']]){_0x3e16ac[_0x1d2d74[_0xbd45('0x14')]]=_0x1c5063[_0x1d2d74[_0xbd45('0x18')]][_0xbd45('0x19')]();}else if(_0x1d2d74[_0xbd45('0x16')]==='customVariable'&&_0x1d2d74[_0xbd45('0x1a')]&&_0x1d2d74[_0xbd45('0x1a')][_0xbd45('0x1b')]&&_0x1d2d74['idField']&&_0x1c5063[_0x1d2d74[_0xbd45('0x1a')][_0xbd45('0x1b')][_0xbd45('0x1c')]()]){_0x3e16ac[_0x1d2d74[_0xbd45('0x14')]]=_0x1c5063[_0x1d2d74[_0xbd45('0x1a')]['name'][_0xbd45('0x1c')]()][_0xbd45('0x19')]();}});}return _0x3e16ac;}function getName(_0xb6d9c){if(_0xb6d9c[_0xbd45('0x1d')]('\x20')>0x0){var _0x4137a3=_0xb6d9c[_0xbd45('0x1e')](/ (.+)/);if(_0x4137a3[0x1]){return _0x4137a3;}}return[_0xb6d9c,_0xb6d9c];}var accountsTokens={};function getAccessToken(_0x55e8ee){return new Promise(function(_0x56f138,_0x5b8b03){if(!_[_0xbd45('0x1f')](accountsTokens[_0x55e8ee['id']])&&!_['isNil'](accountsTokens[_0x55e8ee['id']][_0xbd45('0x20')])){if(moment()[_0xbd45('0x21')](accountsTokens[_0x55e8ee['id']]['expires_in'])){_0x56f138(accountsTokens[_0x55e8ee['id']][_0xbd45('0x20')]);}}var _0x2e81aa;switch(_0x55e8ee[_0xbd45('0x22')]){case'US':_0x2e81aa=_0xbd45('0x23');break;case'AU':_0x2e81aa=_0xbd45('0x24');break;case'EU':_0x2e81aa='https://accounts.zoho.eu';break;case'IN':_0x2e81aa=_0xbd45('0x25');break;case'CN':_0x2e81aa=_0xbd45('0x26');break;default:_0x2e81aa=_0xbd45('0x27');break;}var _0x2520f0={'method':'POST','uri':_0x2e81aa+_0xbd45('0x28'),'qs':{'refresh_token':_0x55e8ee[_0xbd45('0x29')],'client_id':_0x55e8ee[_0xbd45('0x2a')],'client_secret':_0x55e8ee[_0xbd45('0x2b')],'grant_type':_0xbd45('0x2c')},'json':!![]};return rp(_0x2520f0)['then'](function(_0x5f1428){accountsTokens[_0x55e8ee['id']]={'access_token':_0x5f1428[_0xbd45('0x20')],'expires_in':moment()['add'](_0x5f1428['expires_in'],_0xbd45('0x2d'))};_0x56f138(_0x5f1428[_0xbd45('0x20')]);})[_0xbd45('0x2e')](function(_0x282e75){logger['error'](_0xbd45('0x2f'),_0x282e75[_0xbd45('0x30')]);_0x5b8b03(_0x282e75);});});}function getUser(_0x1f5798,_0x436149,_0xc46e47,_0x3e29c0){logger['info'](_0xbd45('0x31'));return request({'method':_0xbd45('0x32'),'uri':util[_0xbd45('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x436149),'qs':{'type':_0xbd45('0x34')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1f5798},'json':!![]})[_0xbd45('0x35')](function(_0xcdd655){if(_0xcdd655[_0xbd45('0x36')]){var _0x2c47c4=-0x1;if(_['isArrayLikeObject'](_0xcdd655[_0xbd45('0x36')])){if(!_[_0xbd45('0x1f')](_0x3e29c0)){_0x2c47c4=_[_0xbd45('0x37')](_0xcdd655['users'],function(_0x220f6a){return _0x220f6a['email']===_0x3e29c0;});}if(_0x2c47c4>=0x0){logger[_0xbd45('0x38')](_0xbd45('0x39'));}else{logger[_0xbd45('0x38')](_0xbd45('0x3a'));_0x2c47c4=_[_0xbd45('0x37')](_0xcdd655[_0xbd45('0x36')],function(_0x3ffbf6){return _0x3ffbf6[_0xbd45('0x3b')][_0xbd45('0x1b')]==='Administrator';});}return _0xcdd655['users'][_0x2c47c4];}else{if(_0xcdd655[_0xbd45('0x3c')]['profile'][_0xbd45('0x1b')]===_0xbd45('0x3d')){logger[_0xbd45('0x38')](_0xbd45('0x3a'));user=_0xcdd655[_0xbd45('0x3c')];return user;}else{logger[_0xbd45('0x3e')](_0xbd45('0x3f'),JSON['stringify'](_0xcdd655));throw new Error(_0xbd45('0x40')+JSON[_0xbd45('0x41')](_0xcdd655));}}}else{logger[_0xbd45('0x3e')](_0xbd45('0x3f'),JSON[_0xbd45('0x41')](_0xcdd655));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xbd45('0x41')](_0xcdd655));}})[_0xbd45('0x2e')](function(_0x20604a){console[_0xbd45('0x3e')](_0x20604a);});}function getZohoUser(_0x1ed78d,_0x4bff56){return new BPromise(function(_0x35be58,_0x33aa27){request(_0x1ed78d)['then'](function(_0x4535a7){var _0x263589=null;if(_0x4535a7){_0x263589=_0x4535a7[_0xbd45('0x42')][0x0];_0x263589['enduserType']=_0x4bff56;}_0x35be58(_0x263589);})[_0xbd45('0x2e')](function(_0x55fa4){_0x33aa27(_0x55fa4);});});}function createEndUser(_0x212877,_0x5ac253,_0x200cd9,_0x419d11,_0x470fe6,_0x5c61a3){var _0x200cd9=getName(_0x200cd9);return request({'method':'POST','uri':_0xbd45('0x43')+_0x5ac253+_0xbd45('0x44')+_[_0xbd45('0x45')](_0x5c61a3[_0xbd45('0x46')])+'s','body':{'data':[{'Last_Name':_0x200cd9[0x1],'First_Name':_0x200cd9[0x0],'Phone':_0x419d11,'Owner':{'name':!_['isNil'](_0x470fe6['role']['name'])?_0x470fe6[_0xbd45('0x47')][_0xbd45('0x1b')]:!_[_0xbd45('0x1f')](_0x470fe6[_0xbd45('0x48')])?_0x470fe6['first_name']+'\x20'+_0x470fe6['last_name']:_0x470fe6[_0xbd45('0x49')],'id':_0x470fe6['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x212877},'json':!![]})['then'](function(_0x134b91){if(_0x134b91&&_0x134b91[_0xbd45('0x42')][0x0][_0xbd45('0x4a')]===_0xbd45('0x4b')){var _0x36047b=_0x134b91['data'][0x0][_0xbd45('0x4c')];_0x36047b['enduserType']=_[_0xbd45('0x45')](_0x5c61a3[_0xbd45('0x46')])+'s';return _0x36047b;}logger['error'](_0xbd45('0x3f'),JSON[_0xbd45('0x41')](data));throw new Error(_0xbd45('0x4d')+JSON[_0xbd45('0x41')](data));})[_0xbd45('0x2e')](function(_0x297f98){console['log']('CREATE\x20ERROR',_0x297f98);});}function getEndUser(_0x51b84d,_0x1ee6f5,_0x36bef1,_0x26950f,_0x101b1f,_0x4f31cf,_0x2b85e6){var _0x21e870={'method':_0xbd45('0x32'),'uri':'','headers':{'Authorization':_0xbd45('0x4e')+_0x51b84d},'json':!![]};switch(_0x2b85e6[_0xbd45('0x4f')]){case _0xbd45('0x50'):_0x21e870['uri']=_0xbd45('0x43')+_0x1ee6f5+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x101b1f+'))';return getZohoUser(_0x21e870,'Contacts')[_0xbd45('0x35')](function(_0x3549b0){if(_0x3549b0)return _0x3549b0;_0x21e870[_0xbd45('0x51')]=_0xbd45('0x43')+_0x1ee6f5+_0xbd45('0x52')+_0x101b1f+'))';return getZohoUser(_0x21e870,_0xbd45('0x53'))[_0xbd45('0x35')](function(_0x4d9c3a){if(_0x4d9c3a)return _0x4d9c3a;if(_0x2b85e6[_0xbd45('0x46')]!=_0xbd45('0x54')){return createEndUser(_0x51b84d,_0x1ee6f5,_0x26950f,_0x101b1f,_0x4f31cf,_0x2b85e6);}else{return{};}});});break;case _0xbd45('0x55'):_0x21e870[_0xbd45('0x51')]=_0xbd45('0x43')+_0x1ee6f5+_0xbd45('0x56')+_0x101b1f+'))';return getZohoUser(_0x21e870,'Contacts')[_0xbd45('0x35')](function(_0x106295){if(_0x106295)return _0x106295;if(_0x2b85e6[_0xbd45('0x46')]!=_0xbd45('0x54')){return createEndUser(_0x51b84d,_0x1ee6f5,_0x26950f,_0x101b1f,_0x4f31cf,_0x2b85e6);}else{return{};}});break;case _0xbd45('0x57'):_0x21e870[_0xbd45('0x51')]=_0xbd45('0x43')+_0x1ee6f5+_0xbd45('0x52')+_0x101b1f+'))';return getZohoUser(_0x21e870,'Leads')[_0xbd45('0x35')](function(_0x4f61bd){if(_0x4f61bd)return _0x4f61bd;if(_0x2b85e6[_0xbd45('0x46')]!=_0xbd45('0x54')){return createEndUser(_0x51b84d,_0x1ee6f5,_0x26950f,_0x101b1f,_0x4f31cf,_0x2b85e6);}else{return{};}});break;}}function getCall(_0x5bc5b6,_0x2b872b,_0x38fb26,_0x3a543c,_0x3dbd44,_0x2cf245,_0x36d32b,_0x602bcf){logger['info'](_0xbd45('0x58'));var _0x317b5c={};_0x317b5c['Owner']={'name':!_['isNil'](_0x3a543c['role'][_0xbd45('0x1b')])&&!_[_0xbd45('0x1f')](_0x3a543c[_0xbd45('0x3b')][_0xbd45('0x1b')])&&_0x3a543c['profile'][_0xbd45('0x1b')]===_0xbd45('0x59')?_0x3a543c[_0xbd45('0x47')][_0xbd45('0x1b')]:!_[_0xbd45('0x1f')](_0x3a543c[_0xbd45('0x48')])?_0x3a543c['first_name']+'\x20'+_0x3a543c[_0xbd45('0x49')]:_0x3a543c[_0xbd45('0x49')],'id':_0x3a543c['id']};_0x317b5c[_0xbd45('0x5a')]=intUtil[_0xbd45('0x5b')](_0x2cf245[_0xbd45('0x5c')],_0x36d32b,'\x20');_0x317b5c[_0xbd45('0x5d')]=intUtil['getString'](_0x2cf245[_0xbd45('0x5e')],_0x36d32b,'\x0a');if(_0x3dbd44[_0xbd45('0x5f')]===_0xbd45('0x60')){_0x317b5c['Who_Id']={'name':!_[_0xbd45('0x1f')](_0x3dbd44[_0xbd45('0x61')])?_0x3dbd44[_0xbd45('0x61')]:!_[_0xbd45('0x1f')](_0x3dbd44[_0xbd45('0x62')])?_0x3dbd44[_0xbd45('0x62')]+'\x20'+_0x3dbd44[_0xbd45('0x63')]:_0x3dbd44['Last_Name'],'id':_0x3dbd44['id']};}if(_0x3dbd44['enduserType']===_0xbd45('0x53')){_0x317b5c[_0xbd45('0x64')]={'name':!_['isNil'](_0x3dbd44[_0xbd45('0x61')])?_0x3dbd44[_0xbd45('0x61')]:!_['isNil'](_0x3dbd44['First_Name'])?_0x3dbd44[_0xbd45('0x62')]+'\x20'+_0x3dbd44[_0xbd45('0x63')]:_0x3dbd44[_0xbd45('0x63')],'id':_0x3dbd44['id']};_0x317b5c[_0xbd45('0x65')]=_[_0xbd45('0x45')](_0x3dbd44[_0xbd45('0x5f')]);}if(_0x36d32b[_0xbd45('0x66')]){_0x317b5c[_0xbd45('0x67')]=moment[_0xbd45('0x68')](parseInt(_0x36d32b[_0xbd45('0x66')])*0x3e8)[_0xbd45('0x33')](_0xbd45('0x69'));}else if(_0x36d32b[_0xbd45('0x6a')]&&_0x36d32b[_0xbd45('0x6b')]){_0x317b5c['Call_Duration']=moment[_0xbd45('0x68')](moment(_0x36d32b[_0xbd45('0x6b')],_0xbd45('0x6c'))['diff'](moment(_0x36d32b[_0xbd45('0x6d')],_0xbd45('0x6c'))))[_0xbd45('0x33')]('mm:ss');}switch(_0x36d32b[_0xbd45('0x6e')]){case _0xbd45('0x6f'):_0x317b5c[_0xbd45('0x70')]=_0xbd45('0x71');break;case _0xbd45('0x72'):case _0xbd45('0x73'):_0x317b5c[_0xbd45('0x70')]=_0xbd45('0x74');break;case _0xbd45('0x75'):_0x317b5c[_0xbd45('0x70')]=_0xbd45('0x76');break;case'abandoned':_0x317b5c[_0xbd45('0x70')]=_0xbd45('0x77');break;case'timeout':_0x317b5c['Call_Result']=_0xbd45('0x78');default:}_0x317b5c[_0xbd45('0x79')]=(_0x602bcf===_0xbd45('0x7a')?moment(_0x36d32b[_0xbd45('0x6d')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x36d32b[_0xbd45('0x7b')])[_0xbd45('0x33')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0xbd45('0x6c'));_0x317b5c[_0xbd45('0x7c')]=_0x602bcf||_0xbd45('0x7d');_0x317b5c=_[_0xbd45('0x7e')](_0x317b5c,getCustomFields(_0x2cf245[_0xbd45('0x7f')],_0x36d32b));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x2b872b+_0xbd45('0x80'),'headers':{'Authorization':_0xbd45('0x4e')+_0x5bc5b6},'body':{'data':[_0x317b5c]},'json':!![]})['then'](function(_0x17ebbb){if(_0x17ebbb&&_0x17ebbb[_0xbd45('0x42')][0x0]['code']===_0xbd45('0x4b')){logger[_0xbd45('0x38')](_0xbd45('0x81'));return{'id':_0x17ebbb[_0xbd45('0x42')][0x0]['details']['id']};}})[_0xbd45('0x2e')](function(_0x2ab86b){logger[_0xbd45('0x38')](_0xbd45('0x82'),_0x2ab86b[_0xbd45('0x30')]);console[_0xbd45('0x83')]('err',_0x2ab86b);});}exports['queue']=function(_0x584582,_0x7dc085,_0x552104,_0x485b95,_0x38605d,_0x35a409){var _0x3a1f81,_0x48dfb2,_0x2e7fb5;_0x35a409[_0xbd45('0x84')]=intUtil['stripTrailingSlash'](_0x35a409[_0xbd45('0x84')]);_0x35a409['serverUrl']=intUtil[_0xbd45('0x85')](_0x35a409[_0xbd45('0x86')]);if(_0x38605d&&_0x38605d[_0xbd45('0x87')]){logger[_0xbd45('0x38')](_0xbd45('0x88'),_0xbd45('0x89'));_0x7dc085[_0xbd45('0x8a')]=_0x35a409['serverUrl']+_0xbd45('0x8b')+_0x7dc085['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x7dc085[_0xbd45('0x8c')]);}else{_0x7dc085['recordingURL']='';}var _0x31c0f1=_0x35a409[_0xbd45('0x84')]==='zoho.eu'?'eu':_0xbd45('0x8d');return getAccessToken(_0x35a409)[_0xbd45('0x35')](function(_0x153428){_0x2e7fb5=_0x153428;return getUser(_0x2e7fb5,_0x31c0f1,_0x35a409,_0x485b95[_0xbd45('0x8e')]);})[_0xbd45('0x35')](function(_0x4950d0){_0x3a1f81=_0x4950d0;logger[_0xbd45('0x38')]('The\x20User\x20ID\x20is:',_0x3a1f81['id']);return getEndUser(_0x2e7fb5,_0x31c0f1,_0x35a409,_0x7dc085[_0xbd45('0x8f')],_0x7dc085[_0xbd45('0x90')],_0x3a1f81,_0x552104);})['then'](function(_0x47c2b0){_0x48dfb2=_0x47c2b0;return getCall(_0x2e7fb5,_0x31c0f1,_0x35a409,_0x3a1f81,_0x48dfb2,_0x552104,_0x7dc085,_0xbd45('0x7d'));})[_0xbd45('0x35')](function(_0x8953f4){if(_0x8953f4){logger['info']('The\x20Call\x20ID\x20is:',_0x8953f4['id']);logger['info']('[QUEUE]',_0xbd45('0x91'));emit(util['format'](_0xbd45('0x92'),_0x485b95['name']),'trigger:browser:url',{'uri':_0xbd45('0x93')+_0x35a409[_0xbd45('0x84')]+_0xbd45('0x94')+_0x8953f4['id']});}})[_0xbd45('0x2e')](function(_0x3903fc){logger[_0xbd45('0x3e')]('[QUEUE]',JSON[_0xbd45('0x41')](_0x3903fc));});};exports[_0xbd45('0x7a')]=function(_0x4f6854,_0x27aab4,_0x10876a,_0x10e0c7,_0x220e13,_0x28c3f5,_0x55a041){var _0x67436d,_0x3886cf,_0x30f0cf;_0x28c3f5[_0xbd45('0x84')]=intUtil[_0xbd45('0x85')](_0x28c3f5['host']);_0x28c3f5[_0xbd45('0x86')]=intUtil['stripTrailingSlash'](_0x28c3f5[_0xbd45('0x86')]);if(_0x55a041&&_0x55a041[_0xbd45('0x95')]&&_0x55a041['recordingFormat']!==_0xbd45('0x96')){logger[_0xbd45('0x38')]('[OUTBOUND]',_0xbd45('0x89'));_0x27aab4[_0xbd45('0x8a')]=_0x28c3f5[_0xbd45('0x86')]+_0xbd45('0x8b')+_0x27aab4['uniqueid']+_0xbd45('0x97')+md5(_0x27aab4[_0xbd45('0x8c')]);}var _0x2e783b=_0x28c3f5['host']===_0xbd45('0x98')?'eu':_0xbd45('0x8d');return getAccessToken(_0x28c3f5)[_0xbd45('0x35')](function(_0xccf5fa){_0x30f0cf=_0xccf5fa;return getUser(_0x30f0cf,_0x2e783b,_0x28c3f5,_0x10e0c7[_0xbd45('0x8e')]);})[_0xbd45('0x35')](function(_0x42d879){_0x67436d=_0x42d879;logger['info'](_0xbd45('0x99'),_0x67436d['id']);return getEndUser(_0x30f0cf,_0x2e783b,_0x28c3f5,_0x27aab4[_0xbd45('0x9a')],_0x27aab4[_0xbd45('0x9b')],_0x67436d,_0x10876a);})[_0xbd45('0x35')](function(_0x323fd3){_0x3886cf=_0x323fd3;return getCall(_0x30f0cf,_0x2e783b,_0x28c3f5,_0x67436d,_0x3886cf,_0x10876a,_0x27aab4,_0xbd45('0x9c'));})['then'](function(_0x5e53a4){if(_0x5e53a4){logger['info']('The\x20Call\x20ID\x20is:',_0x5e53a4['id']);logger[_0xbd45('0x38')](_0xbd45('0x9d'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbd45('0x33')](_0xbd45('0x92'),_0x10e0c7[_0xbd45('0x1b')]),_0xbd45('0x9e'),{'uri':_0xbd45('0x93')+_0x28c3f5['host']+_0xbd45('0x94')+_0x5e53a4['id']});}})[_0xbd45('0x2e')](function(_0x35dcfc){logger[_0xbd45('0x3e')](_0xbd45('0x9d'),JSON[_0xbd45('0x41')](_0x35dcfc));});};exports[_0xbd45('0x9f')]=function(_0x5f10f4,_0x471848,_0x3198d8,_0x3c460a,_0xb34802,_0xb03def){var _0x5744db,_0x2bcb42,_0x47bae5;_0xb03def[_0xbd45('0x84')]=intUtil[_0xbd45('0x85')](_0xb03def['host']);_0xb03def['serverUrl']=intUtil[_0xbd45('0x85')](_0xb03def['serverUrl']);if(_0xb34802&&_0xb34802[_0xbd45('0x87')]){logger[_0xbd45('0x38')]('['+_0x471848[_0xbd45('0x6e')][_0xbd45('0xa0')]()+']','Recording\x20is\x20enabled!');_0x471848[_0xbd45('0x8a')]=_0xb03def[_0xbd45('0x86')]+_0xbd45('0x8b')+_0x471848['uniqueid']+_0xbd45('0x97')+md5(_0x471848['uniqueid']);}else{_0x471848['recordingURL']='';}var _0x3394e4=_0xb03def[_0xbd45('0x84')]===_0xbd45('0x98')?'eu':_0xbd45('0x8d');return getAccessToken(_0xb03def)[_0xbd45('0x35')](function(_0x18dd47){_0x47bae5=_0x18dd47;return getUser(_0x47bae5,_0x3394e4,_0xb03def);})[_0xbd45('0x35')](function(_0x294156){_0x5744db=_0x294156;logger[_0xbd45('0x38')](_0xbd45('0x99'),_0x5744db['id']);return getEndUser(_0x47bae5,_0x3394e4,_0xb03def,_0x471848['calleridname'],_0x471848['calleridnum'],_0x5744db,_0x3198d8);})[_0xbd45('0x35')](function(_0x7f2ff5){_0x2bcb42=_0x7f2ff5;return getCall(_0x47bae5,_0x3394e4,_0xb03def,_0x5744db,_0x2bcb42,_0x3198d8,_0x471848,_0xbd45('0x7d'));})[_0xbd45('0x35')](function(_0x13a688){if(_0x13a688){logger['info'](_0xbd45('0xa1'),_0x13a688['id']);}})['catch'](function(_0x171ef8){logger[_0xbd45('0x3e')]('['+_0x471848[_0xbd45('0x6e')][_0xbd45('0xa0')]()+']',JSON[_0xbd45('0x41')](_0x171ef8));});};
\ No newline at end of file
index 0ddb64a..79c2f8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5552=['data2','Script','data3','exec','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger'];(function(_0x2fb704,_0x322d48){var _0x10cdfd=function(_0x49bbb2){while(--_0x49bbb2){_0x2fb704['push'](_0x2fb704['shift']());}};_0x10cdfd(++_0x322d48);}(_0x5552,0x1da));var _0x2555=function(_0x226a33,_0x7b219d){_0x226a33=_0x226a33-0x0;var _0x1d2b34=_0x5552[_0x226a33];return _0x1d2b34;};'use strict';var util=require(_0x2555('0x0'));var sh=require(_0x2555('0x1'));var Mustache=require('mustache');var logger=require(_0x2555('0x2'))('trigger');exports['exec']=function(_0x5964d4,_0x5be33e){var _0x647655=_0x5964d4[_0x2555('0x3')]?_0x5964d4['data2']:_0x2555('0x4');var _0x17f885=_0x5964d4[_0x2555('0x5')]?Mustache['render'](_0x5964d4[_0x2555('0x5')],_0x5be33e):_0x5be33e;sh[_0x2555('0x6')](_0x17f885,function(_0x19f64e,_0x2fae8c,_0x4dd3e5){if(_0x19f64e!==0x0){logger['error'](util['format'](_0x2555('0x7'),_0x647655,_0x17f885,_0x19f64e,_0x4dd3e5));}else{logger['info'](util['format'](_0x2555('0x8'),_0x647655,_0x17f885,_0x2fae8c));}});};
\ No newline at end of file
+var _0x951d=['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','shelljs','mustache','trigger','exec','data2','render'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x951d,0x132));var _0xd951=function(_0x22fb94,_0x9a235c){_0x22fb94=_0x22fb94-0x0;var _0x33da77=_0x951d[_0x22fb94];return _0x33da77;};'use strict';var util=require('util');var sh=require(_0xd951('0x0'));var Mustache=require(_0xd951('0x1'));var logger=require('../../../../config/logger')(_0xd951('0x2'));exports[_0xd951('0x3')]=function(_0x49ff16,_0x4aef5f){var _0x4f1342=_0x49ff16[_0xd951('0x4')]?_0x49ff16[_0xd951('0x4')]:'Script';var _0x22a3c5=_0x49ff16['data3']?Mustache[_0xd951('0x5')](_0x49ff16[_0xd951('0x6')],_0x4aef5f):_0x4aef5f;sh[_0xd951('0x3')](_0x22a3c5,function(_0x4c654a,_0xd6c682,_0xd88d2c){if(_0x4c654a!==0x0){logger[_0xd951('0x7')](util[_0xd951('0x8')](_0xd951('0x9'),_0x4f1342,_0x22a3c5,_0x4c654a,_0xd88d2c));}else{logger[_0xd951('0xa')](util[_0xd951('0x8')](_0xd951('0xb'),_0x4f1342,_0x22a3c5,_0xd6c682));}});};
\ No newline at end of file
index 4f1b8f2..edfe4c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf128=['info','format','stringify','then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','request-promise','lodash','mustache','../../../../config/logger','render','data2','data5','number','data6','parse','error','stack','data1','toUpperCase','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format'];(function(_0x181f29,_0x14b975){var _0x120a5f=function(_0x327e64){while(--_0x327e64){_0x181f29['push'](_0x181f29['shift']());}};_0x120a5f(++_0x14b975);}(_0xf128,0xe8));var _0x8f12=function(_0x37e343,_0x5dbfea){_0x37e343=_0x37e343-0x0;var _0xf688dc=_0xf128[_0x37e343];return _0xf688dc;};'use strict';var rp=require(_0x8f12('0x0'));var util=require('util');var _=require(_0x8f12('0x1'));var Mustache=require(_0x8f12('0x2'));var logger=require(_0x8f12('0x3'))('trigger');exports['exec']=function(_0x673c28,_0x519821){var _0x3876a5,_0x4a553a;var _0x3bed56={'method':_0x673c28['data1']['toUpperCase'](),'uri':Mustache[_0x8f12('0x4')](_0x673c28[_0x8f12('0x5')],_0x519821),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x673c28[_0x8f12('0x6')])===_0x8f12('0x7')&&parseInt(_0x673c28['data5'])>=0x1&&parseInt(_0x673c28[_0x8f12('0x6')])<=0xa?parseInt(_0x673c28['data5'])*0x3e8:0x5*0x3e8};try{_0x3bed56['headers']=_0x673c28[_0x8f12('0x8')]?JSON[_0x8f12('0x9')](Mustache[_0x8f12('0x4')](_0x673c28[_0x8f12('0x8')],_0x519821)):{};}catch(_0x544089){logger[_0x8f12('0xa')](_0x544089[_0x8f12('0xb')]);}switch(_0x673c28[_0x8f12('0xc')][_0x8f12('0xd')]()){case'GET':case _0x8f12('0xe'):_0x3876a5=null;_0x3bed56['qs']=_0x519821;break;case _0x8f12('0xf'):case _0x8f12('0x10'):if(_0x673c28['data7']){try{_0x3876a5=JSON['parse'](Mustache['render'](_0x673c28[_0x8f12('0x11')],_0x519821));_0x3bed56[_0x8f12('0x12')]=_0x3876a5;}catch(_0x1d18f){logger[_0x8f12('0xa')](_0x1d18f[_0x8f12('0xb')]);logger['error'](_0x8f12('0x13'));}}else{_0x3876a5=_0x519821;_0x3bed56[_0x8f12('0x12')]=_0x3876a5;}break;}logger[_0x8f12('0x14')](util[_0x8f12('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x673c28[_0x8f12('0xc')],_0x673c28['data2'],JSON[_0x8f12('0x16')](_0x3bed56)));rp(_0x3bed56)[_0x8f12('0x17')](function(_0x54b013){_0x3876a5=!_[_0x8f12('0x18')](_0x3876a5)?',\x20request\x20body:\x20'+_0x3876a5:'';_0x4a553a=typeof _0x54b013[_0x8f12('0x12')]==='object'?JSON[_0x8f12('0x16')](_0x54b013[_0x8f12('0x12')]):_0x54b013[_0x8f12('0x12')];logger[_0x8f12('0x14')](util[_0x8f12('0x15')](_0x8f12('0x19'),_0x673c28[_0x8f12('0xc')],_0x673c28[_0x8f12('0x5')],_0x54b013[_0x8f12('0x1a')],_0x4a553a));})[_0x8f12('0x1b')](function(_0x3ef26c){logger[_0x8f12('0xa')](util[_0x8f12('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x673c28[_0x8f12('0xc')],_0x673c28[_0x8f12('0x5')],_0x3ef26c[_0x8f12('0x1a')],_0x3ef26c['name'],_0x3ef26c['message']));});};
\ No newline at end of file
+var _0x82fb=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','render','data2','data5','number','headers','data6','parse','error','data1','toUpperCase','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','object','info','format'];(function(_0x62fdf6,_0x3d6d1e){var _0x3510df=function(_0x4256c4){while(--_0x4256c4){_0x62fdf6['push'](_0x62fdf6['shift']());}};_0x3510df(++_0x3d6d1e);}(_0x82fb,0xfa));var _0xb82f=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x82fb[_0x2be8c2];return _0x97f531;};'use strict';var rp=require(_0xb82f('0x0'));var util=require(_0xb82f('0x1'));var _=require(_0xb82f('0x2'));var Mustache=require(_0xb82f('0x3'));var logger=require(_0xb82f('0x4'))(_0xb82f('0x5'));exports['exec']=function(_0x473eb4,_0xb9f3c1){var _0x2f5618,_0xf06139;var _0x207763={'method':_0x473eb4['data1']['toUpperCase'](),'uri':Mustache[_0xb82f('0x6')](_0x473eb4[_0xb82f('0x7')],_0xb9f3c1),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x473eb4[_0xb82f('0x8')])===_0xb82f('0x9')&&parseInt(_0x473eb4[_0xb82f('0x8')])>=0x1&&parseInt(_0x473eb4[_0xb82f('0x8')])<=0xa?parseInt(_0x473eb4[_0xb82f('0x8')])*0x3e8:0x5*0x3e8};try{_0x207763[_0xb82f('0xa')]=_0x473eb4[_0xb82f('0xb')]?JSON[_0xb82f('0xc')](Mustache['render'](_0x473eb4['data6'],_0xb9f3c1)):{};}catch(_0x426e5d){logger[_0xb82f('0xd')](_0x426e5d['stack']);}switch(_0x473eb4[_0xb82f('0xe')][_0xb82f('0xf')]()){case _0xb82f('0x10'):case _0xb82f('0x11'):_0x2f5618=null;_0x207763['qs']=_0xb9f3c1;break;case _0xb82f('0x12'):case _0xb82f('0x13'):if(_0x473eb4['data7']){try{_0x2f5618=JSON[_0xb82f('0xc')](Mustache['render'](_0x473eb4[_0xb82f('0x14')],_0xb9f3c1));_0x207763[_0xb82f('0x15')]=_0x2f5618;}catch(_0x37ff68){logger[_0xb82f('0xd')](_0x37ff68['stack']);logger[_0xb82f('0xd')](_0xb82f('0x16'));}}else{_0x2f5618=_0xb9f3c1;_0x207763[_0xb82f('0x15')]=_0x2f5618;}break;}logger['info'](util['format'](_0xb82f('0x17'),_0x473eb4[_0xb82f('0xe')],_0x473eb4[_0xb82f('0x7')],JSON[_0xb82f('0x18')](_0x207763)));rp(_0x207763)['then'](function(_0x1251a5){_0x2f5618=!_[_0xb82f('0x19')](_0x2f5618)?_0xb82f('0x1a')+_0x2f5618:'';_0xf06139=typeof _0x1251a5['body']===_0xb82f('0x1b')?JSON[_0xb82f('0x18')](_0x1251a5[_0xb82f('0x15')]):_0x1251a5[_0xb82f('0x15')];logger[_0xb82f('0x1c')](util[_0xb82f('0x1d')](_0xb82f('0x1e'),_0x473eb4[_0xb82f('0xe')],_0x473eb4[_0xb82f('0x7')],_0x1251a5[_0xb82f('0x1f')],_0xf06139));})[_0xb82f('0x20')](function(_0x30968c){logger[_0xb82f('0xd')](util[_0xb82f('0x1d')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x473eb4['data1'],_0x473eb4['data2'],_0x30968c[_0xb82f('0x1f')],_0x30968c[_0xb82f('0x21')],_0x30968c[_0xb82f('0x22')]));});};
\ No newline at end of file
index 0766f76..6cda2f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa232=['then','rpc','error','result','catch','exports','jayson/promise','../../config/logger','routing','http','request'];(function(_0x2cfa89,_0x1f1712){var _0x1a21e5=function(_0x5c5d18){while(--_0x5c5d18){_0x2cfa89['push'](_0x2cfa89['shift']());}};_0x1a21e5(++_0x1f1712);}(_0xa232,0x145));var _0x2a23=function(_0x334fa2,_0x147cc6){_0x334fa2=_0x334fa2-0x0;var _0x3a1066=_0xa232[_0x334fa2];return _0x3a1066;};'use strict';var jayson=require(_0x2a23('0x0'));var BPromise=require('bluebird');var logger=require(_0x2a23('0x1'))(_0x2a23('0x2'));var client=jayson['client'][_0x2a23('0x3')]({'port':0x2329});client['Request']=function(_0x5514ff,_0x7a2d81){return new BPromise(function(_0x2aad37,_0x23d70b){return client[_0x2a23('0x4')](_0x5514ff,_0x7a2d81)[_0x2a23('0x5')](function(_0x2e3f65){logger['debug'](_0x2a23('0x6'),_0x2a23('0x2'),_0x5514ff,_0x7a2d81,_0x2e3f65);if(_0x2e3f65['error']){logger[_0x2a23('0x7')](_0x2a23('0x6'),_0x2a23('0x2'),_0x5514ff,_0x2e3f65[_0x2a23('0x7')]['message'],_0x7a2d81);return _0x23d70b(_0x2e3f65[_0x2a23('0x7')]['message']);}else{return _0x2aad37(_0x2e3f65[_0x2a23('0x8')]);}})[_0x2a23('0x9')](function(_0x6a4a7f){logger['error']('rpc',_0x2a23('0x2'),_0x5514ff,_0x6a4a7f,_0x7a2d81);return _0x23d70b(_0x6a4a7f);});});};module[_0x2a23('0xa')]=client;
\ No newline at end of file
+var _0x265b=['http','Request','request','then','debug','rpc','error','message','catch','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0x469b49,_0x1d4cd4){var _0x5860ca=function(_0x32cc6b){while(--_0x32cc6b){_0x469b49['push'](_0x469b49['shift']());}};_0x5860ca(++_0x1d4cd4);}(_0x265b,0x1bb));var _0xb265=function(_0x43ddc6,_0x206399){_0x43ddc6=_0x43ddc6-0x0;var _0xc565a1=_0x265b[_0x43ddc6];return _0xc565a1;};'use strict';var jayson=require(_0xb265('0x0'));var BPromise=require(_0xb265('0x1'));var logger=require(_0xb265('0x2'))(_0xb265('0x3'));var client=jayson[_0xb265('0x4')][_0xb265('0x5')]({'port':0x2329});client[_0xb265('0x6')]=function(_0x5b14bf,_0x1094e2){return new BPromise(function(_0x19becb,_0x2fa687){return client[_0xb265('0x7')](_0x5b14bf,_0x1094e2)[_0xb265('0x8')](function(_0x552aa7){logger[_0xb265('0x9')](_0xb265('0xa'),_0xb265('0x3'),_0x5b14bf,_0x1094e2,_0x552aa7);if(_0x552aa7['error']){logger[_0xb265('0xb')](_0xb265('0xa'),_0xb265('0x3'),_0x5b14bf,_0x552aa7[_0xb265('0xb')][_0xb265('0xc')],_0x1094e2);return _0x2fa687(_0x552aa7[_0xb265('0xb')]['message']);}else{return _0x19becb(_0x552aa7['result']);}})[_0xb265('0xd')](function(_0x16cbb2){logger[_0xb265('0xb')](_0xb265('0xa'),_0xb265('0x3'),_0x5b14bf,_0x16cbb2,_0x1094e2);return _0x2fa687(_0x16cbb2);});});};module['exports']=client;
\ No newline at end of file
index 33fba9f..6e68de9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd48a=['then','initMailAccounts','refresh','getSettings','loginMailFrequency','catch','log','bluebird','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve'];(function(_0x27132d,_0x1789e9){var _0x4c6030=function(_0x38597d){while(--_0x38597d){_0x27132d['push'](_0x27132d['shift']());}};_0x4c6030(++_0x1789e9);}(_0xd48a,0x96));var _0xad48=function(_0x9e3680,_0x2dcac5){_0x9e3680=_0x9e3680-0x0;var _0x46f0dc=_0xd48a[_0x9e3680];return _0x46f0dc;};'use strict';var BPromise=require(_0xad48('0x0'));var server=require('./server');var Realtime=require(_0xad48('0x1'));var EmailChannel=require(_0xad48('0x2'));var mailAccount=require(_0xad48('0x3'));var setting=require(_0xad48('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xad48('0x5')]()[_0xad48('0x6')](mailAccount['getMailAccounts']())[_0xad48('0x6')](realtime[_0xad48('0x7')]())['then'](function(){email[_0xad48('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0xad48('0x6')](function(){return setting[_0xad48('0x9')]();})[_0xad48('0x6')](function(_0x14b61d){return setInterval(initRealtime,_0x14b61d[_0xad48('0xa')]*0x3e8);})[_0xad48('0xb')](function(_0xfd61fd){console[_0xad48('0xc')](_0xfd61fd);});}main();
\ No newline at end of file
+var _0xedb7=['./lib/email','./rpc/mailAccount','./rpc/setting','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','./server'];(function(_0x4fb73e,_0x17f37d){var _0x14de68=function(_0xf5eeed){while(--_0xf5eeed){_0x4fb73e['push'](_0x4fb73e['shift']());}};_0x14de68(++_0x17f37d);}(_0xedb7,0x8b));var _0x7edb=function(_0x8687a2,_0x2948cc){_0x8687a2=_0x8687a2-0x0;var _0x321914=_0xedb7[_0x8687a2];return _0x321914;};'use strict';var BPromise=require('bluebird');var server=require(_0x7edb('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x7edb('0x1'));var mailAccount=require(_0x7edb('0x2'));var setting=require(_0x7edb('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x7edb('0x4')](mailAccount[_0x7edb('0x5')]())[_0x7edb('0x4')](realtime[_0x7edb('0x6')]())['then'](function(){email[_0x7edb('0x7')](realtime[_0x7edb('0x8')]);return realtime;});}function main(){return server[_0x7edb('0x9')](realtime,email)['then'](function(){return initRealtime();})[_0x7edb('0x4')](function(){return setting[_0x7edb('0xa')]();})['then'](function(_0x4c6f40){return setInterval(initRealtime,_0x4c6f40[_0x7edb('0xb')]*0x3e8);})[_0x7edb('0xc')](function(_0x48c162){console[_0x7edb('0xd')](_0x48c162);});}main();
\ No newline at end of file
index ae6ea86..5accc84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x745e=['localhost','socket.io-emitter','./smtp','mailAccounts','smtp','emit','key','active','Imap','status','total','isNil','stringify','mailAccount:update','hasOwnProperty','imapAccounts','handleImapBox','handleImapEmail','end','handleImapEnd','error','handleImapError','bind','messageStatus','prototype','connected','name','messages','info','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verified','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x745e,0xc7));var _0xe745=function(_0x3eae20,_0x3078d9){_0x3eae20=_0x3eae20-0x0;var _0x58921b=_0x745e[_0x3eae20];return _0x58921b;};'use strict';var _=require(_0xe745('0x0'));var moment=require(_0xe745('0x1'));var BPromise=require(_0xe745('0x2'));var md5=require(_0xe745('0x3'));var Redis=require(_0xe745('0x4'));var config=require('../../../config/environment');var logger=require(_0xe745('0x5'))(_0xe745('0x6'));config[_0xe745('0x7')]=_[_0xe745('0x8')](config[_0xe745('0x7')],{'host':_0xe745('0x9'),'port':0x18eb});var io=require(_0xe745('0xa'))(new Redis(config[_0xe745('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xe745('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x4d2096){logger['info']('start\x20email\x20channel');this[_0xe745('0xc')]=_0x4d2096[_0xe745('0xc')];this['imapAccounts']={};this[_0xe745('0xd')]=new EmailSmtp();}EmailChannel['prototype'][_0xe745('0xe')]=function(_0x12b276){var _0x1f0b80=this[_0xe745('0xc')][_0x12b276];var _0x368cf5={'id':_0x1f0b80['id'],'name':_0x1f0b80['name'],'key':_0x1f0b80[_0xe745('0xf')],'active':_0x1f0b80[_0xe745('0x10')],'Imap':{'status':_0x1f0b80[_0xe745('0x11')][_0xe745('0x12')],'messageStatus':_0x1f0b80[_0xe745('0x11')]['messageStatus'],'total':_0x1f0b80[_0xe745('0x11')][_0xe745('0x13')]}};if(_[_0xe745('0x14')](md5Accounts[_0x12b276])){md5Accounts[_0x12b276]={};}var _0x397c6f=md5(JSON[_0xe745('0x15')](_0x368cf5));if(md5Accounts[_0x12b276]['md5']!==_0x397c6f){md5Accounts[_0x12b276]['md5']=_0x397c6f;io[_0xe745('0xe')](_0xe745('0x16'),_0x368cf5);}};EmailChannel['prototype']['refresh']=function(_0x299a4e){for(var _0xb00a7d in _0x299a4e){if(_0x299a4e[_0xe745('0x17')](_0xb00a7d)){if(_0x299a4e[_0xb00a7d][_0xe745('0x11')]&&_0x299a4e[_0xb00a7d]['active']){var _0xb39643=_0x299a4e[_0xb00a7d][_0xe745('0x11')];if(!this[_0xe745('0x18')][_0xe745('0x17')](_0xb39643['id'])){this['imapAccounts'][_0xb39643['id']]=new EmailImap(_0xb39643,_0x299a4e[_0xb00a7d]['email']);this[_0xe745('0x18')][_0xb39643['id']]['on']('box',this[_0xe745('0x19')]['bind'](this,_0xb00a7d));this[_0xe745('0x18')][_0xb39643['id']]['on'](_0xe745('0x6'),this[_0xe745('0x1a')]['bind'](this,_0xb00a7d));this[_0xe745('0x18')][_0xb39643['id']]['on'](_0xe745('0x1b'),this[_0xe745('0x1c')]['bind'](this,_0xb00a7d));this[_0xe745('0x18')][_0xb39643['id']]['on'](_0xe745('0x1d'),this[_0xe745('0x1e')][_0xe745('0x1f')](this,_0xb00a7d));}}else{if(_[_0xe745('0x14')](this['mailAccounts'][_0xb00a7d][_0xe745('0x11')])){this['mailAccounts'][_0xb00a7d][_0xe745('0x11')]={};}this[_0xe745('0xc')][_0xb00a7d][_0xe745('0x11')][_0xe745('0x12')]='disabled';this[_0xe745('0xc')][_0xb00a7d][_0xe745('0x11')][_0xe745('0x20')]='';this[_0xe745('0xe')](_0xb00a7d);}}}};EmailChannel[_0xe745('0x21')][_0xe745('0x19')]=function(_0x40f303,_0x18f737){if(this['mailAccounts'][_0x40f303]){this[_0xe745('0xc')][_0x40f303]['Imap'][_0xe745('0x12')]=_0xe745('0x22');this[_0xe745('0xc')][_0x40f303]['Imap'][_0xe745('0x20')]=_0x18f737[_0xe745('0x23')];if(_0x18f737[_0xe745('0x24')]){this[_0xe745('0xc')][_0x40f303][_0xe745('0x11')][_0xe745('0x13')]=_0x18f737[_0xe745('0x24')][_0xe745('0x13')];}return this['emit'](_0x40f303);}};EmailChannel['prototype'][_0xe745('0x1a')]=function(_0xd73598,_0x257541){logger[_0xe745('0x25')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x257541['firstName'],_0x257541[_0xe745('0x26')],_0x257541['from'],_0xd73598);if(this[_0xe745('0xc')][_0xd73598]){return mailAccount[_0xe745('0x27')](_0xd73598,_0x257541)[_0xe745('0x28')](function(_0xe87d55){if(_0xe87d55){logger[_0xe745('0x25')](_0xe745('0x29'));}})[_0xe745('0x2a')](function(_0x835a27){logger[_0xe745('0x1d')](_0xe745('0x2b'),JSON['stringify'](_0x835a27));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x2e2d21){if(this['mailAccounts'][_0x2e2d21]&&this[_0xe745('0xc')][_0x2e2d21][_0xe745('0x11')]){if(this['imapAccounts'][this[_0xe745('0xc')][_0x2e2d21][_0xe745('0x11')]['id']]){delete this[_0xe745('0x18')][this[_0xe745('0xc')][_0x2e2d21][_0xe745('0x11')]['id']];}this[_0xe745('0xc')][_0x2e2d21][_0xe745('0x11')][_0xe745('0x2c')]=moment();this[_0xe745('0xe')](_0x2e2d21);}};EmailChannel[_0xe745('0x21')][_0xe745('0x1e')]=function(_0x122fb,_0x22f993){if(this[_0xe745('0xc')][_0x122fb]){this['mailAccounts'][_0x122fb]['Imap']['status']='error';this[_0xe745('0xc')][_0x122fb][_0xe745('0x11')][_0xe745('0x20')]=_0x22f993;return this[_0xe745('0xe')](_0x122fb);}};EmailChannel['prototype'][_0xe745('0x2d')]=function(_0x46a579,_0x32a0a5){return this[_0xe745('0xd')][_0xe745('0x2e')](_0x46a579,_0x32a0a5);};EmailChannel[_0xe745('0x21')][_0xe745('0x2f')]=function(_0xc6ba34){var _0x4a5fc9=this;if(this[_0xe745('0xc')][_0xc6ba34['id']]){if(_['isNil'](this[_0xe745('0xc')][_0xc6ba34['id']][_0xe745('0x30')])){this[_0xe745('0xc')][_0xc6ba34['id']][_0xe745('0x30')]={};}this[_0xe745('0xc')][_0xc6ba34['id']][_0xe745('0x30')][_0xe745('0x2c')]=moment();return new BPromise(function(_0x4ed598,_0x148f4f){return _0x4a5fc9[_0xe745('0xd')]['verify'](_0xc6ba34)['then'](function(_0x1a90d1){_0x4a5fc9[_0xe745('0xc')][_0xc6ba34['id']][_0xe745('0x30')]['status']=_0xe745('0x31');_0x4a5fc9[_0xe745('0xc')][_0xc6ba34['id']][_0xe745('0x30')][_0xe745('0x20')]='';_0x4a5fc9[_0xe745('0xe')](_0xc6ba34['id']);_0x4ed598(_0x1a90d1);})[_0xe745('0x2a')](function(_0x55a2aa){_0x4a5fc9[_0xe745('0xc')][_0xc6ba34['id']][_0xe745('0x30')][_0xe745('0x12')]=_0xe745('0x1d');_0x4a5fc9[_0xe745('0xc')][_0xc6ba34['id']]['Smtp'][_0xe745('0x20')]=_0x55a2aa;_0x4a5fc9['emit'](_0xc6ba34['id']);_0x148f4f(_0x55a2aa);});});}return this['smtp'][_0xe745('0x32')](_0xc6ba34);};module[_0xe745('0x33')]=EmailChannel;
\ No newline at end of file
+var _0x6b03=['defaults','redis','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','imapAccounts','smtp','prototype','emit','key','Imap','messageStatus','total','isNil','mailAccount:update','hasOwnProperty','active','email','box','handleImapBox','bind','handleImapEmail','end','mailAccounts','disabled','status','name','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','then','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync','handleImapError','sendMail','verifySmtp','Smtp','verify','verified','exports','bluebird','md5','ioredis','../../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b03,0x153));var _0x36b0=function(_0x3efed2,_0x50be5d){_0x3efed2=_0x3efed2-0x0;var _0x431cdd=_0x6b03[_0x3efed2];return _0x431cdd;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x36b0('0x0'));var md5=require(_0x36b0('0x1'));var Redis=require(_0x36b0('0x2'));var config=require(_0x36b0('0x3'));var logger=require('../../../config/logger')('email');config['redis']=_[_0x36b0('0x4')](config[_0x36b0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x36b0('0x6'))(new Redis(config[_0x36b0('0x5')]));var EmailImap=require(_0x36b0('0x7'));var EmailSmtp=require(_0x36b0('0x8'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0xa92e80){logger[_0x36b0('0x9')](_0x36b0('0xa'));this['mailAccounts']=_0xa92e80['mailAccounts'];this[_0x36b0('0xb')]={};this[_0x36b0('0xc')]=new EmailSmtp();}EmailChannel[_0x36b0('0xd')][_0x36b0('0xe')]=function(_0x22daac){var _0x333d75=this['mailAccounts'][_0x22daac];var _0x54b597={'id':_0x333d75['id'],'name':_0x333d75['name'],'key':_0x333d75[_0x36b0('0xf')],'active':_0x333d75['active'],'Imap':{'status':_0x333d75[_0x36b0('0x10')]['status'],'messageStatus':_0x333d75[_0x36b0('0x10')][_0x36b0('0x11')],'total':_0x333d75['Imap'][_0x36b0('0x12')]}};if(_[_0x36b0('0x13')](md5Accounts[_0x22daac])){md5Accounts[_0x22daac]={};}var _0x576d45=md5(JSON['stringify'](_0x54b597));if(md5Accounts[_0x22daac][_0x36b0('0x1')]!==_0x576d45){md5Accounts[_0x22daac]['md5']=_0x576d45;io['emit'](_0x36b0('0x14'),_0x54b597);}};EmailChannel[_0x36b0('0xd')]['refresh']=function(_0x7f8364){for(var _0x4c529e in _0x7f8364){if(_0x7f8364[_0x36b0('0x15')](_0x4c529e)){if(_0x7f8364[_0x4c529e][_0x36b0('0x10')]&&_0x7f8364[_0x4c529e][_0x36b0('0x16')]){var _0x2e1fea=_0x7f8364[_0x4c529e][_0x36b0('0x10')];if(!this[_0x36b0('0xb')][_0x36b0('0x15')](_0x2e1fea['id'])){this[_0x36b0('0xb')][_0x2e1fea['id']]=new EmailImap(_0x2e1fea,_0x7f8364[_0x4c529e][_0x36b0('0x17')]);this['imapAccounts'][_0x2e1fea['id']]['on'](_0x36b0('0x18'),this[_0x36b0('0x19')][_0x36b0('0x1a')](this,_0x4c529e));this[_0x36b0('0xb')][_0x2e1fea['id']]['on']('email',this[_0x36b0('0x1b')]['bind'](this,_0x4c529e));this[_0x36b0('0xb')][_0x2e1fea['id']]['on'](_0x36b0('0x1c'),this['handleImapEnd'][_0x36b0('0x1a')](this,_0x4c529e));this[_0x36b0('0xb')][_0x2e1fea['id']]['on']('error',this['handleImapError'][_0x36b0('0x1a')](this,_0x4c529e));}}else{if(_[_0x36b0('0x13')](this[_0x36b0('0x1d')][_0x4c529e][_0x36b0('0x10')])){this[_0x36b0('0x1d')][_0x4c529e][_0x36b0('0x10')]={};}this[_0x36b0('0x1d')][_0x4c529e][_0x36b0('0x10')]['status']=_0x36b0('0x1e');this[_0x36b0('0x1d')][_0x4c529e][_0x36b0('0x10')][_0x36b0('0x11')]='';this[_0x36b0('0xe')](_0x4c529e);}}}};EmailChannel[_0x36b0('0xd')]['handleImapBox']=function(_0x25585d,_0x587f26){if(this['mailAccounts'][_0x25585d]){this[_0x36b0('0x1d')][_0x25585d][_0x36b0('0x10')][_0x36b0('0x1f')]='connected';this[_0x36b0('0x1d')][_0x25585d]['Imap']['messageStatus']=_0x587f26[_0x36b0('0x20')];if(_0x587f26['messages']){this[_0x36b0('0x1d')][_0x25585d][_0x36b0('0x10')][_0x36b0('0x12')]=_0x587f26['messages'][_0x36b0('0x12')];}return this[_0x36b0('0xe')](_0x25585d);}};EmailChannel[_0x36b0('0xd')][_0x36b0('0x1b')]=function(_0x2458eb,_0x5b0a88){logger['info'](_0x36b0('0x21'),_0x5b0a88['firstName'],_0x5b0a88[_0x36b0('0x22')],_0x5b0a88['from'],_0x2458eb);if(this[_0x36b0('0x1d')][_0x2458eb]){return mailAccount['notify'](_0x2458eb,_0x5b0a88)[_0x36b0('0x23')](function(_0x10d038){if(_0x10d038){logger[_0x36b0('0x9')]('Mail\x20accepted\x20from\x20routing');}})[_0x36b0('0x24')](function(_0x5f0cdc){logger[_0x36b0('0x25')](_0x36b0('0x26'),JSON[_0x36b0('0x27')](_0x5f0cdc));});}};EmailChannel[_0x36b0('0xd')][_0x36b0('0x28')]=function(_0x2ed40f){if(this[_0x36b0('0x1d')][_0x2ed40f]&&this[_0x36b0('0x1d')][_0x2ed40f][_0x36b0('0x10')]){if(this[_0x36b0('0xb')][this[_0x36b0('0x1d')][_0x2ed40f][_0x36b0('0x10')]['id']]){delete this[_0x36b0('0xb')][this[_0x36b0('0x1d')][_0x2ed40f][_0x36b0('0x10')]['id']];}this[_0x36b0('0x1d')][_0x2ed40f]['Imap'][_0x36b0('0x29')]=moment();this['emit'](_0x2ed40f);}};EmailChannel[_0x36b0('0xd')][_0x36b0('0x2a')]=function(_0x1a2db7,_0xb60d14){if(this[_0x36b0('0x1d')][_0x1a2db7]){this[_0x36b0('0x1d')][_0x1a2db7]['Imap'][_0x36b0('0x1f')]=_0x36b0('0x25');this['mailAccounts'][_0x1a2db7]['Imap'][_0x36b0('0x11')]=_0xb60d14;return this['emit'](_0x1a2db7);}};EmailChannel[_0x36b0('0xd')][_0x36b0('0x2b')]=function(_0x478e53,_0x5bee74){return this[_0x36b0('0xc')]['send'](_0x478e53,_0x5bee74);};EmailChannel[_0x36b0('0xd')][_0x36b0('0x2c')]=function(_0x3d2c02){var _0x2b12b1=this;if(this['mailAccounts'][_0x3d2c02['id']]){if(_['isNil'](this[_0x36b0('0x1d')][_0x3d2c02['id']][_0x36b0('0x2d')])){this[_0x36b0('0x1d')][_0x3d2c02['id']]['Smtp']={};}this[_0x36b0('0x1d')][_0x3d2c02['id']][_0x36b0('0x2d')]['lastSync']=moment();return new BPromise(function(_0x19662e,_0x39b0a0){return _0x2b12b1['smtp'][_0x36b0('0x2e')](_0x3d2c02)['then'](function(_0x97df4f){_0x2b12b1[_0x36b0('0x1d')][_0x3d2c02['id']][_0x36b0('0x2d')][_0x36b0('0x1f')]=_0x36b0('0x2f');_0x2b12b1[_0x36b0('0x1d')][_0x3d2c02['id']][_0x36b0('0x2d')]['messageStatus']='';_0x2b12b1[_0x36b0('0xe')](_0x3d2c02['id']);_0x19662e(_0x97df4f);})[_0x36b0('0x24')](function(_0x8b2163){_0x2b12b1['mailAccounts'][_0x3d2c02['id']][_0x36b0('0x2d')]['status']=_0x36b0('0x25');_0x2b12b1[_0x36b0('0x1d')][_0x3d2c02['id']][_0x36b0('0x2d')]['messageStatus']=_0x8b2163;_0x2b12b1[_0x36b0('0xe')](_0x3d2c02['id']);_0x39b0a0(_0x8b2163);});});}return this[_0x36b0('0xc')][_0x36b0('0x2e')](_0x3d2c02);};module[_0x36b0('0x30')]=EmailChannel;
\ No newline at end of file
index 2c71ae0..9f22208 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21c2=['handleReadUnseen','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','stringify','hasOwnProperty','upperFirst','exports','imap','randomstring','mailparser','simpleParser','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','connTimeout','service','authentication','user','password','host','port','tls','autotls','required','anonymous@xcally.com','prototype','handleOpenBox','emit','box','readUnseen','search','UNSEEN'];(function(_0x1b3341,_0x1f1a98){var _0x4d6f59=function(_0x318a82){while(--_0x318a82){_0x1b3341['push'](_0x1b3341['shift']());}};_0x4d6f59(++_0x1f1a98);}(_0x21c2,0x86));var _0x221c=function(_0x22399b,_0x5b89cf){_0x22399b=_0x22399b-0x0;var _0x3f2352=_0x21c2[_0x22399b];return _0x3f2352;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var Imap=require(_0x221c('0x0'));var _=require('lodash');var rs=require(_0x221c('0x1'));var simpleParser=require(_0x221c('0x2'))[_0x221c('0x3')];var Iconv=require('iconv')['Iconv'];var EventEmitter=require(_0x221c('0x4'))[_0x221c('0x5')];var utils=require(_0x221c('0x6'));var logger=require(_0x221c('0x7'))(_0x221c('0x8'));function EmailImap(_0x12dff8,_0x178153){this[_0x221c('0x9')]='INBOX';this[_0x221c('0xa')]=this[_0x221c('0xb')](_0x12dff8,_0x178153);this[_0x221c('0x0')]=new Imap(this['account']);this[_0x221c('0x0')][_0x221c('0xc')](_0x221c('0xd'),this[_0x221c('0xe')][_0x221c('0xf')](this));this['imap'][_0x221c('0xc')](_0x221c('0x10'),this[_0x221c('0x11')][_0x221c('0xf')](this));this[_0x221c('0x0')]['on'](_0x221c('0x12'),this[_0x221c('0x13')]['bind'](this));this[_0x221c('0x0')][_0x221c('0x14')]();}util[_0x221c('0x15')](EmailImap,EventEmitter);EmailImap['prototype'][_0x221c('0xb')]=function(_0x555d6d,_0xc92dc4){var _0x5221e9={'connTimeout':_0x555d6d[_0x221c('0x16')]?_0x555d6d[_0x221c('0x16')]*0x3e8:0x2710,'authTimeout':_0x555d6d['authTimeout']?_0x555d6d['authTimeout']*0x3e8:0x1388};if(_['isNil'](_0x555d6d[_0x221c('0x17')])){if(_0x555d6d[_0x221c('0x18')]){_0x5221e9[_0x221c('0x19')]=_0x555d6d[_0x221c('0x19')];_0x5221e9[_0x221c('0x1a')]=_0x555d6d[_0x221c('0x1a')];}_0x5221e9['host']=_0x555d6d[_0x221c('0x1b')];_0x5221e9[_0x221c('0x1c')]=_0x555d6d[_0x221c('0x1c')]||0x3e1;if(_0x555d6d[_0x221c('0x1d')]){_0x5221e9[_0x221c('0x1d')]=!![];}else{_0x5221e9['tls']=![];_0x5221e9[_0x221c('0x1e')]=_0x221c('0x1f');}}else{_0x5221e9[_0x221c('0x19')]=_0x555d6d[_0x221c('0x19')];_0x5221e9[_0x221c('0x1a')]=_0x555d6d['password'];_0x5221e9[_0x221c('0x1b')]=utils['getHost'](_0x555d6d['service']);_0x5221e9[_0x221c('0x1c')]=0x3e1;_0x5221e9['tls']=!![];}_0x5221e9[_0x221c('0x8')]=_0xc92dc4||_0x555d6d[_0x221c('0x19')]||_0x221c('0x20');return _0x5221e9;};EmailImap[_0x221c('0x21')][_0x221c('0xe')]=function(){this[_0x221c('0x0')]['openBox'](this['mailbox'],![],this[_0x221c('0x22')][_0x221c('0xf')](this));};EmailImap[_0x221c('0x21')][_0x221c('0x22')]=function(_0x3ddba8,_0x3e15f5){if(_0x3ddba8){this[_0x221c('0x13')](_0x3ddba8,!![]);}else{this[_0x221c('0x23')](_0x221c('0x24'),_0x3e15f5);this[_0x221c('0x25')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x5bb7a0){if(_0x5bb7a0){this[_0x221c('0x13')](_0x5bb7a0,!![]);}else{this[_0x221c('0x0')]['end']();}};EmailImap[_0x221c('0x21')][_0x221c('0x25')]=function(){this[_0x221c('0x0')][_0x221c('0x26')]([_0x221c('0x27')],this[_0x221c('0x28')]['bind'](this));};EmailImap[_0x221c('0x21')][_0x221c('0x28')]=function(_0xe7d9d8,_0x7334af){if(_0xe7d9d8){this[_0x221c('0x13')](_0xe7d9d8,!![]);}else{if(_0x7334af['length']){try{var _0x189abe=this[_0x221c('0x0')][_0x221c('0x29')](_0x7334af,{'bodies':'','markSeen':!![]});_0x189abe['on'](_0x221c('0x2a'),this['handleFetchMessage']['bind'](this));_0x189abe[_0x221c('0xc')](_0x221c('0x12'),this[_0x221c('0x2b')]['bind'](this));_0x189abe[_0x221c('0xc')](_0x221c('0x10'),this[_0x221c('0x2c')][_0x221c('0xf')](this));}catch(_0x8710c2){logger['error'](_0x8710c2);}}else{this[_0x221c('0x0')][_0x221c('0x2d')](!![],this[_0x221c('0x2e')][_0x221c('0xf')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x10e348,_0x42f56d){_0x10e348['on'](_0x221c('0x2f'),this['handleMessageBody']['bind'](this));_0x10e348[_0x221c('0xc')](_0x221c('0x30'),this[_0x221c('0x31')][_0x221c('0xf')](this));_0x10e348[_0x221c('0xc')](_0x221c('0x10'),this[_0x221c('0x32')]['bind'](this));};EmailImap[_0x221c('0x21')][_0x221c('0x33')]=function(_0x37fe2d,_0x1091c5){simpleParser(_0x37fe2d,{'Iconv':Iconv},this[_0x221c('0x34')][_0x221c('0xf')](this));};EmailImap[_0x221c('0x21')][_0x221c('0x31')]=function(_0x5e417f){};EmailImap[_0x221c('0x21')]['handleMessageEnd']=function(){};EmailImap[_0x221c('0x21')][_0x221c('0x34')]=function(_0x2dc1f9,_0x1ee15a){if(_0x2dc1f9){logger[_0x221c('0x12')](_0x2dc1f9);}else{var _0x3fc94c=this;utils[_0x221c('0x35')](this[_0x221c('0xa')],_0x1ee15a,function(_0x4deb65){_0x3fc94c[_0x221c('0x23')](_0x221c('0x8'),_0x4deb65);});}};EmailImap[_0x221c('0x21')][_0x221c('0x2c')]=function(){this[_0x221c('0x0')][_0x221c('0x2d')](!![],this[_0x221c('0x2e')][_0x221c('0xf')](this));};EmailImap[_0x221c('0x21')][_0x221c('0x2b')]=function(_0x4d439d){this[_0x221c('0x13')](_0x4d439d);this['imap'][_0x221c('0x2d')](!![],this['handleCloseBox'][_0x221c('0xf')](this));};EmailImap[_0x221c('0x21')][_0x221c('0x11')]=function(){this[_0x221c('0x23')](_0x221c('0x10'));};EmailImap[_0x221c('0x21')]['handleError']=function(_0x48757b,_0x57ac0c){logger['error'](_0x221c('0x13'),this[_0x221c('0xa')][_0x221c('0x8')],JSON[_0x221c('0x36')](_0x48757b));var _0x369c16='';if(_0x48757b){if(_0x48757b['textCode']){_0x369c16=_0x48757b['textCode'];}else{for(var _0x36dda3 in _0x48757b){if(_0x48757b[_0x221c('0x37')](_0x36dda3)){_0x369c16+=_[_0x221c('0x38')](_0x36dda3)+':\x20'+_0x48757b[_0x36dda3]+'\x0a';}}}}if(_0x57ac0c){this[_0x221c('0x0')][_0x221c('0x10')]();}else{this[_0x221c('0x23')](_0x221c('0x12'),_0x369c16);this[_0x221c('0x23')](_0x221c('0x10'));}};module[_0x221c('0x39')]=EmailImap;
\ No newline at end of file
+var _0x5651=['handleCloseBox','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','Iconv','EventEmitter','./utils','email','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','openBox','mailbox','handleOpenBox','emit','box','readUnseen'];(function(_0x2ec18a,_0x5caca4){var _0x8d89f2=function(_0x3a3d00){while(--_0x3a3d00){_0x2ec18a['push'](_0x2ec18a['shift']());}};_0x8d89f2(++_0x5caca4);}(_0x5651,0x8d));var _0x1565=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0x5651[_0x28578d];return _0x524826;};'use strict';var fs=require('fs');var path=require(_0x1565('0x0'));var util=require(_0x1565('0x1'));var Imap=require(_0x1565('0x2'));var _=require(_0x1565('0x3'));var rs=require(_0x1565('0x4'));var simpleParser=require(_0x1565('0x5'))['simpleParser'];var Iconv=require('iconv')[_0x1565('0x6')];var EventEmitter=require('events')[_0x1565('0x7')];var utils=require(_0x1565('0x8'));var logger=require('../../../config/logger')(_0x1565('0x9'));function EmailImap(_0x40123a,_0x55ce62){this['mailbox']=_0x1565('0xa');this[_0x1565('0xb')]=this[_0x1565('0xc')](_0x40123a,_0x55ce62);this[_0x1565('0x2')]=new Imap(this[_0x1565('0xb')]);this[_0x1565('0x2')][_0x1565('0xd')](_0x1565('0xe'),this[_0x1565('0xf')][_0x1565('0x10')](this));this[_0x1565('0x2')][_0x1565('0xd')](_0x1565('0x11'),this[_0x1565('0x12')][_0x1565('0x10')](this));this['imap']['on'](_0x1565('0x13'),this[_0x1565('0x14')][_0x1565('0x10')](this));this[_0x1565('0x2')][_0x1565('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x1565('0x16')][_0x1565('0xc')]=function(_0x285097,_0x340648){var _0x3f93f7={'connTimeout':_0x285097[_0x1565('0x17')]?_0x285097[_0x1565('0x17')]*0x3e8:0x2710,'authTimeout':_0x285097[_0x1565('0x18')]?_0x285097[_0x1565('0x18')]*0x3e8:0x1388};if(_[_0x1565('0x19')](_0x285097[_0x1565('0x1a')])){if(_0x285097[_0x1565('0x1b')]){_0x3f93f7[_0x1565('0x1c')]=_0x285097[_0x1565('0x1c')];_0x3f93f7[_0x1565('0x1d')]=_0x285097[_0x1565('0x1d')];}_0x3f93f7[_0x1565('0x1e')]=_0x285097[_0x1565('0x1e')];_0x3f93f7[_0x1565('0x1f')]=_0x285097['port']||0x3e1;if(_0x285097[_0x1565('0x20')]){_0x3f93f7['tls']=!![];}else{_0x3f93f7['tls']=![];_0x3f93f7[_0x1565('0x21')]='required';}}else{_0x3f93f7[_0x1565('0x1c')]=_0x285097['user'];_0x3f93f7[_0x1565('0x1d')]=_0x285097[_0x1565('0x1d')];_0x3f93f7[_0x1565('0x1e')]=utils[_0x1565('0x22')](_0x285097[_0x1565('0x1a')]);_0x3f93f7[_0x1565('0x1f')]=0x3e1;_0x3f93f7[_0x1565('0x20')]=!![];}_0x3f93f7[_0x1565('0x9')]=_0x340648||_0x285097[_0x1565('0x1c')]||_0x1565('0x23');return _0x3f93f7;};EmailImap[_0x1565('0x16')][_0x1565('0xf')]=function(){this[_0x1565('0x2')][_0x1565('0x24')](this[_0x1565('0x25')],![],this[_0x1565('0x26')]['bind'](this));};EmailImap['prototype'][_0x1565('0x26')]=function(_0x443be3,_0x125fe9){if(_0x443be3){this[_0x1565('0x14')](_0x443be3,!![]);}else{this[_0x1565('0x27')](_0x1565('0x28'),_0x125fe9);this[_0x1565('0x29')]();}};EmailImap['prototype'][_0x1565('0x2a')]=function(_0x55f0fa){if(_0x55f0fa){this[_0x1565('0x14')](_0x55f0fa,!![]);}else{this[_0x1565('0x2')][_0x1565('0x11')]();}};EmailImap[_0x1565('0x16')][_0x1565('0x29')]=function(){this[_0x1565('0x2')]['search']([_0x1565('0x2b')],this[_0x1565('0x2c')][_0x1565('0x10')](this));};EmailImap[_0x1565('0x16')][_0x1565('0x2c')]=function(_0x3d2deb,_0x146c96){if(_0x3d2deb){this[_0x1565('0x14')](_0x3d2deb,!![]);}else{if(_0x146c96[_0x1565('0x2d')]){try{var _0x5afc44=this[_0x1565('0x2')]['fetch'](_0x146c96,{'bodies':'','markSeen':!![]});_0x5afc44['on'](_0x1565('0x2e'),this[_0x1565('0x2f')][_0x1565('0x10')](this));_0x5afc44[_0x1565('0xd')](_0x1565('0x13'),this[_0x1565('0x30')]['bind'](this));_0x5afc44[_0x1565('0xd')](_0x1565('0x11'),this[_0x1565('0x31')][_0x1565('0x10')](this));}catch(_0x361275){logger[_0x1565('0x13')](_0x361275);}}else{this[_0x1565('0x2')][_0x1565('0x32')](!![],this[_0x1565('0x2a')][_0x1565('0x10')](this));}}};EmailImap['prototype'][_0x1565('0x2f')]=function(_0x40ea9a,_0x4e23bf){_0x40ea9a['on']('body',this[_0x1565('0x33')][_0x1565('0x10')](this));_0x40ea9a[_0x1565('0xd')](_0x1565('0x34'),this[_0x1565('0x35')][_0x1565('0x10')](this));_0x40ea9a['once']('end',this[_0x1565('0x36')][_0x1565('0x10')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x56e6e4,_0x11b02e){simpleParser(_0x56e6e4,{'Iconv':Iconv},this[_0x1565('0x37')][_0x1565('0x10')](this));};EmailImap[_0x1565('0x16')][_0x1565('0x35')]=function(_0x30993f){};EmailImap['prototype'][_0x1565('0x36')]=function(){};EmailImap[_0x1565('0x16')][_0x1565('0x37')]=function(_0x27c6ce,_0x4cf413){if(_0x27c6ce){logger[_0x1565('0x13')](_0x27c6ce);}else{var _0x2bd557=this;utils[_0x1565('0x38')](this[_0x1565('0xb')],_0x4cf413,function(_0x2f9585){_0x2bd557[_0x1565('0x27')]('email',_0x2f9585);});}};EmailImap[_0x1565('0x16')]['handleFetchEnd']=function(){this[_0x1565('0x2')]['closeBox'](!![],this[_0x1565('0x2a')][_0x1565('0x10')](this));};EmailImap[_0x1565('0x16')][_0x1565('0x30')]=function(_0x4898f5){this[_0x1565('0x14')](_0x4898f5);this['imap']['closeBox'](!![],this[_0x1565('0x2a')][_0x1565('0x10')](this));};EmailImap[_0x1565('0x16')]['handleEnd']=function(){this[_0x1565('0x27')](_0x1565('0x11'));};EmailImap[_0x1565('0x16')]['handleError']=function(_0x516979,_0x547a3c){logger[_0x1565('0x13')](_0x1565('0x14'),this['account']['email'],JSON[_0x1565('0x39')](_0x516979));var _0x3b29d2='';if(_0x516979){if(_0x516979['textCode']){_0x3b29d2=_0x516979[_0x1565('0x3a')];}else{for(var _0x103d59 in _0x516979){if(_0x516979['hasOwnProperty'](_0x103d59)){_0x3b29d2+=_[_0x1565('0x3b')](_0x103d59)+':\x20'+_0x516979[_0x103d59]+'\x0a';}}}}if(_0x547a3c){this[_0x1565('0x2')][_0x1565('0x11')]();}else{this['emit']('error',_0x3b29d2);this[_0x1565('0x27')]('end');}};module[_0x1565('0x3c')]=EmailImap;
\ No newline at end of file
index 5e32a56..ad631f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19ab=['createTransport','use','compile','toString','verify','Not\x20verifired','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x496335,_0x11ff18){var _0x2b6099=function(_0x151641){while(--_0x151641){_0x496335['push'](_0x496335['shift']());}};_0x2b6099(++_0x11ff18);}(_0x19ab,0x74));var _0xb19a=function(_0x585be3,_0xde677e){_0x585be3=_0x585be3-0x0;var _0x3bbe37=_0x19ab[_0x585be3];return _0x3bbe37;};'use strict';var nodemailer=require(_0xb19a('0x0'));var BPromise=require(_0xb19a('0x1'));var inlineBase64=require(_0xb19a('0x2'));function EmailSmtp(){}EmailSmtp[_0xb19a('0x3')][_0xb19a('0x4')]=function(_0x15f558,_0x436c33){return new BPromise(function(_0x2b2aee,_0x1bb305){var _0x358e94=nodemailer[_0xb19a('0x5')](_0x15f558);_0x358e94[_0xb19a('0x6')](_0xb19a('0x7'),inlineBase64());_0x358e94['sendMail'](_0x436c33,function(_0x44915e,_0x34f725){if(_0x44915e){_0x1bb305(_0x44915e[_0xb19a('0x8')]());}else{_0x2b2aee(_0x34f725);}});});};EmailSmtp[_0xb19a('0x3')][_0xb19a('0x9')]=function(_0x15f953){return new BPromise(function(_0x40b462,_0x32fe92){var _0x5da83c=nodemailer[_0xb19a('0x5')](_0x15f953);_0x5da83c[_0xb19a('0x9')](function(_0x3b6e14,_0x4d4ee9){if(_0x3b6e14){_0x32fe92(_0x3b6e14[_0xb19a('0x8')]());}else{if(_0x4d4ee9){_0x40b462(_0x4d4ee9);}else{_0x32fe92(_0xb19a('0xa'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
+var _0xb98e=['send','createTransport','compile','toString','prototype','verify','Not\x20verifired','exports','nodemailer','bluebird'];(function(_0x1afabf,_0x56fdcc){var _0x497ff1=function(_0x2f6104){while(--_0x2f6104){_0x1afabf['push'](_0x1afabf['shift']());}};_0x497ff1(++_0x56fdcc);}(_0xb98e,0x184));var _0xeb98=function(_0x4c4bf6,_0x41dc82){_0x4c4bf6=_0x4c4bf6-0x0;var _0x1b5f44=_0xb98e[_0x4c4bf6];return _0x1b5f44;};'use strict';var nodemailer=require(_0xeb98('0x0'));var BPromise=require(_0xeb98('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xeb98('0x2')]=function(_0x38aea4,_0xd4c1d6){return new BPromise(function(_0x593414,_0x2f6eb1){var _0x329ec1=nodemailer[_0xeb98('0x3')](_0x38aea4);_0x329ec1['use'](_0xeb98('0x4'),inlineBase64());_0x329ec1['sendMail'](_0xd4c1d6,function(_0x4a7e79,_0x47c83f){if(_0x4a7e79){_0x2f6eb1(_0x4a7e79[_0xeb98('0x5')]());}else{_0x593414(_0x47c83f);}});});};EmailSmtp[_0xeb98('0x6')][_0xeb98('0x7')]=function(_0x9dce59){return new BPromise(function(_0x20e072,_0x2f0e2e){var _0x2669bb=nodemailer[_0xeb98('0x3')](_0x9dce59);_0x2669bb['verify'](function(_0x28483,_0x8b537e){if(_0x28483){_0x2f0e2e(_0x28483[_0xeb98('0x5')]());}else{if(_0x8b537e){_0x20e072(_0x8b537e);}else{_0x2f0e2e(_0xeb98('0x8'));}}});});};module[_0xeb98('0x9')]=EmailSmtp;
\ No newline at end of file
index 7845cf4..a7dca56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6edc=['isAutoreply','parser','from','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','outlook.office365.com','lodash','moment','randomstring','path','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','indexOf','split','slice','length','generate','html','replace','includes','<img','push','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','isEmpty','originCc','bcc','attachments','type','format','%s-%s','now','join','root','server/files/attachments/','contentType','headerLines','Auto-Submitted:\x20auto-replied','line'];(function(_0x693ec3,_0x3c3959){var _0x26835b=function(_0x3c3b1d){while(--_0x3c3b1d){_0x693ec3['push'](_0x693ec3['shift']());}};_0x26835b(++_0x3c3959);}(_0x6edc,0x138));var _0xc6ed=function(_0x28184f,_0x510eae){_0x28184f=_0x28184f-0x0;var _0x1f5483=_0x6edc[_0x28184f];return _0x1f5483;};'use strict';var _=require(_0xc6ed('0x0'));var moment=require(_0xc6ed('0x1'));var random=require(_0xc6ed('0x2'));var fs=require('fs');var path=require(_0xc6ed('0x3'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0xc6ed('0x4'))(_0xc6ed('0x5'));var config=require(_0xc6ed('0x6'));function getAddress(_0x235ca6){var _0x4a2886=_[_0xc6ed('0x7')](_0x235ca6[_0xc6ed('0x8')]);return _0x4a2886&&_0x4a2886[_0xc6ed('0x9')]?_0x4a2886['address']:_0xc6ed('0xa')+random['generate'](0x6)+_0xc6ed('0xb');}function getFirstName(_0x13fed0){var _0x31049e=_[_0xc6ed('0x7')](_0x13fed0['value']);if(_0x31049e&&_0x31049e[_0xc6ed('0xc')]){if(_0x31049e[_0xc6ed('0xc')]==_0x31049e[_0xc6ed('0x9')]){return _0x31049e['name']['substring'](0x0,_0x31049e[_0xc6ed('0xc')][_0xc6ed('0xd')]('@'));}var _0x2719ea=_0x31049e[_0xc6ed('0xc')][_0xc6ed('0xe')](/\s+/);return _0x2719ea['length']>0x1?_0x2719ea[_0xc6ed('0xf')](0x0,-0x1)['join']('\x20'):_0x31049e[_0xc6ed('0xc')];}return'Anonymous';}function getLastName(_0x470cbf){var _0x39d8dd=_[_0xc6ed('0x7')](_0x470cbf['value']);if(_0x39d8dd&&_0x39d8dd[_0xc6ed('0xc')]){var _0x282ea6=_0x39d8dd[_0xc6ed('0xc')]['split'](/\s+/);return _0x282ea6[_0xc6ed('0x10')]>0x1?_0x282ea6['pop']():'';}return'';}function getMails(_0x130bff,_0x35e1d8){var _0x16ee41='';for(var _0x5346fe=0x0;_0x5346fe<_0x35e1d8[_0xc6ed('0x8')][_0xc6ed('0x10')];_0x5346fe+=0x1){if(_0x35e1d8[_0xc6ed('0x8')][_0x5346fe][_0xc6ed('0x9')]!==_0x130bff){if(!_['isEmpty'](_0x16ee41)){_0x16ee41+=',';}_0x16ee41+=_0x35e1d8['value'][_0x5346fe][_0xc6ed('0xc')]||_0x35e1d8[_0xc6ed('0x8')][_0x5346fe][_0xc6ed('0x9')]||'';_0x16ee41+='\x20<';_0x16ee41+=_0x35e1d8[_0xc6ed('0x8')][_0x5346fe][_0xc6ed('0x9')]?_0x35e1d8[_0xc6ed('0x8')][_0x5346fe][_0xc6ed('0x9')]:_0xc6ed('0xa')+random[_0xc6ed('0x11')](0x6)+_0xc6ed('0xb');_0x16ee41+='>';}}return _0x16ee41;}function parseEmail(_0x2fd9e9,_0x776f5,_0x2664a9){if(_0x776f5[_0xc6ed('0x12')]){var _0x587699=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x587699['test'](_0x776f5[_0xc6ed('0x12')])){_0x776f5['html']=_0x776f5['html'][_0xc6ed('0x13')](_0x587699,'');}if(_0x776f5['html'][_0xc6ed('0x14')](_0xc6ed('0x15'))){var _0x4682c5=[];_0x776f5['attachments']['forEach'](_0x4b5d2d=>{_0x4682c5[_0xc6ed('0x16')](_0x4b5d2d[_0xc6ed('0x17')]);});var _0x34f312=/<img.*? _SRC(.*?)[^>]+>/g;var _0x33a3c2=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1c78bf=_0x776f5[_0xc6ed('0x12')][_0xc6ed('0x13')](_0x33a3c2,_0xc6ed('0x18'));var _0x10e2a6=_0x1c78bf[_0xc6ed('0x13')](_0x34f312,_0xc6ed('0x19'));for(let _0x1abee=0x0;_0x1abee<_0x4682c5['length'];_0x1abee++){var _0x499163=_0x10e2a6[_0xc6ed('0x13')](_0xc6ed('0x19'),_0xc6ed('0x1a')+_0x4682c5[_0x1abee]+_0xc6ed('0x1b'));_0x10e2a6=_0x499163;}_0x776f5['html']=_0x10e2a6;}_0x2664a9[_0xc6ed('0x1c')]=_0x776f5[_0xc6ed('0x12')];}else{_0x2664a9[_0xc6ed('0x1c')]=_0x776f5[_0xc6ed('0x1d')];}if(_0x2664a9[_0xc6ed('0x1c')]){_0x2664a9['body']=_0x2664a9[_0xc6ed('0x1c')][_0xc6ed('0x13')](/<a\s+/gi,_0xc6ed('0x1e'));}if(_0x776f5['to']){_0x2664a9[_0xc6ed('0x1f')][_0xc6ed('0x20')]=getMails(null,_0x776f5['to']);var _0xa91fc=getMails(_0x2fd9e9[_0xc6ed('0x5')],_0x776f5['to']);if(!_[_0xc6ed('0x21')](_0xa91fc)){_0x2664a9[_0xc6ed('0x1f')]['cc']+=_0xa91fc;}}if(_0x776f5['cc']){_0x2664a9[_0xc6ed('0x1f')][_0xc6ed('0x22')]=getMails(null,_0x776f5['cc']);var _0x4d5559=getMails(_0x2fd9e9[_0xc6ed('0x5')],_0x776f5['cc']);if(!_[_0xc6ed('0x21')](_0x4d5559)){if(!_[_0xc6ed('0x21')](_0x2664a9[_0xc6ed('0x1f')]['cc'])){_0x2664a9[_0xc6ed('0x1f')]['cc']+=',';}_0x2664a9['message']['cc']+=_0x4d5559;}}if(!_[_0xc6ed('0x14')](_0x2664a9['message'][_0xc6ed('0x20')],_0x2fd9e9[_0xc6ed('0x5')])&&!_['includes'](_0x2664a9['message'][_0xc6ed('0x22')],_0x2fd9e9[_0xc6ed('0x5')])){_0x2664a9['message'][_0xc6ed('0x23')]=_0x2fd9e9[_0xc6ed('0x5')];}if(_0x776f5['attachments']&&_0x776f5['attachments'][_0xc6ed('0x10')]){_0x2664a9[_0xc6ed('0x1f')]['attach']=_0x776f5[_0xc6ed('0x24')][_0xc6ed('0x10')];for(var _0x2a4db2=0x0,_0x119d5b,_0x3e95f2,_0x449b41;_0x2a4db2<_0x776f5[_0xc6ed('0x24')][_0xc6ed('0x10')];_0x2a4db2+=0x1){if(_0x776f5['attachments'][_0x2a4db2][_0xc6ed('0x25')]==='attachment'){_0x449b41=_0x776f5[_0xc6ed('0x24')][_0x2a4db2][_0xc6ed('0x17')]||'attachment-'+_0x2a4db2;_0x119d5b=util[_0xc6ed('0x26')](_0xc6ed('0x27'),Date[_0xc6ed('0x28')](),_0x449b41);_0x3e95f2=path[_0xc6ed('0x29')](config[_0xc6ed('0x2a')],_0xc6ed('0x2b'),_0x119d5b);fs['writeFileSync'](_0x3e95f2,_0x776f5[_0xc6ed('0x24')][_0x2a4db2]['content']);_0x2664a9[_0xc6ed('0x1f')][_0xc6ed('0x24')]['push']({'name':_0x449b41,'basename':_0x119d5b,'type':_0x776f5['attachments'][_0x2a4db2][_0xc6ed('0x2c')],'filepath':_0x3e95f2});}}}if(_0x776f5[_0xc6ed('0x2d')]&&_0x776f5[_0xc6ed('0x2d')][_0xc6ed('0x10')]>0x0){var _0x3ef554=[_0xc6ed('0x2e'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x471582=0x0;_0x471582<_0x776f5[_0xc6ed('0x2d')][_0xc6ed('0x10')];_0x471582++){var _0x22b53b=_[_0xc6ed('0xd')](_0x3ef554,_0x776f5[_0xc6ed('0x2d')][_0x471582][_0xc6ed('0x2f')]);if(_0x22b53b>=0x0){_0x2664a9[_0xc6ed('0x30')]=!![];}}}return _0x2664a9;}exports[_0xc6ed('0x31')]=function(_0x447112,_0x5d5afc,_0x384851){var _0x1686b4={'from':getAddress(_0x5d5afc['from']),'firstName':getFirstName(_0x5d5afc[_0xc6ed('0x32')]),'lastName':getLastName(_0x5d5afc['from']),'mapKey':_0xc6ed('0x5'),'message':{'from':getMails(_0x447112[_0xc6ed('0x5')],_0x5d5afc[_0xc6ed('0x32')]),'to':_0x447112[_0xc6ed('0x5')],'cc':'','subject':_0x5d5afc['subject']||'','messageId':_0x5d5afc[_0xc6ed('0x33')],'inReplyTo':_0x5d5afc[_0xc6ed('0x34')],'sentAt':moment(_0x5d5afc['date'])[_0xc6ed('0x26')](_0xc6ed('0x35')),'attach':![],'attachments':[]}};if(!_0x5d5afc['html']&&!_0x5d5afc[_0xc6ed('0x1d')]){var _0x12c63e=_[_0xc6ed('0x36')](_0x5d5afc[_0xc6ed('0x24')],{'contentType':_0xc6ed('0x37')});if(_0x12c63e[_0xc6ed('0x10')]){logger[_0xc6ed('0x38')](util[_0xc6ed('0x26')](_0xc6ed('0x39'),_0x5d5afc['messageId']));tnef[_0xc6ed('0x3a')](_[_0xc6ed('0x3b')](_0x12c63e)[_0xc6ed('0x3c')],function(_0x5735fe,_0x2bd58f){if(_0x2bd58f){_0x5d5afc[_0xc6ed('0x12')]=_0x2bd58f[_0xc6ed('0x3d')]||_0xc6ed('0x3e');if(_0x2bd58f[_0xc6ed('0x3f')]){for(var _0x448577=0x0;_0x448577<_0x2bd58f['Attachments'][_0xc6ed('0x10')];_0x448577++){var _0x1a8f0c=_0x2bd58f['Attachments'][_0x448577];_0x1686b4['message'][_0xc6ed('0x24')]['push']({'filename':_0x1a8f0c[_0xc6ed('0x40')],'content':Buffer[_0xc6ed('0x32')](_0x1a8f0c[_0xc6ed('0x41')])});}}}_0x384851(parseEmail(_0x447112,_0x5d5afc,_0x1686b4));});}else{_0x5d5afc[_0xc6ed('0x12')]=_0xc6ed('0x3e');_0x384851(parseEmail(_0x447112,_0x5d5afc,_0x1686b4));}}else{_0x384851(parseEmail(_0x447112,_0x5d5afc,_0x1686b4));}};exports[_0xc6ed('0x42')]=function(_0x466519){switch(_0x466519){case _0xc6ed('0x43'):return _0xc6ed('0x44');case _0xc6ed('0x45'):return _0xc6ed('0x46');case'hotmail':return'imap-mail.outlook.com';case'outlook365':return _0xc6ed('0x47');}return'127.0.0.1';};
\ No newline at end of file
+var _0x6a58=['generate','@xcally.com','value','name','indexOf','split','slice','join','Anonymous','pop','isEmpty','anonymous','test','replace','html','includes','attachments','forEach','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','bcc','attach','length','attachment','attachment-','format','now','root','writeFileSync','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','<p>Empty\x20message</p>','Attachments','Title','Data','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','lodash','moment','path','node-tnef','email','../../../config/environment','head','address'];(function(_0x5851f4,_0x1689c2){var _0x406c27=function(_0x4dfdb4){while(--_0x4dfdb4){_0x5851f4['push'](_0x5851f4['shift']());}};_0x406c27(++_0x1689c2);}(_0x6a58,0x120));var _0x86a5=function(_0x5093e9,_0x5154d0){_0x5093e9=_0x5093e9-0x0;var _0x4c9a22=_0x6a58[_0x5093e9];return _0x4c9a22;};'use strict';var _=require(_0x86a5('0x0'));var moment=require(_0x86a5('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x86a5('0x2'));var util=require('util');var tnef=require(_0x86a5('0x3'));var logger=require('../../../config/logger')(_0x86a5('0x4'));var config=require(_0x86a5('0x5'));function getAddress(_0x3395dd){var _0x754dc7=_[_0x86a5('0x6')](_0x3395dd['value']);return _0x754dc7&&_0x754dc7[_0x86a5('0x7')]?_0x754dc7[_0x86a5('0x7')]:'anonymous'+random[_0x86a5('0x8')](0x6)+_0x86a5('0x9');}function getFirstName(_0x43a1a2){var _0x1a5aac=_[_0x86a5('0x6')](_0x43a1a2[_0x86a5('0xa')]);if(_0x1a5aac&&_0x1a5aac[_0x86a5('0xb')]){if(_0x1a5aac[_0x86a5('0xb')]==_0x1a5aac[_0x86a5('0x7')]){return _0x1a5aac[_0x86a5('0xb')]['substring'](0x0,_0x1a5aac['name'][_0x86a5('0xc')]('@'));}var _0x52dc46=_0x1a5aac[_0x86a5('0xb')][_0x86a5('0xd')](/\s+/);return _0x52dc46['length']>0x1?_0x52dc46[_0x86a5('0xe')](0x0,-0x1)[_0x86a5('0xf')]('\x20'):_0x1a5aac['name'];}return _0x86a5('0x10');}function getLastName(_0x1324b3){var _0x57730b=_[_0x86a5('0x6')](_0x1324b3[_0x86a5('0xa')]);if(_0x57730b&&_0x57730b[_0x86a5('0xb')]){var _0x80785c=_0x57730b[_0x86a5('0xb')]['split'](/\s+/);return _0x80785c['length']>0x1?_0x80785c[_0x86a5('0x11')]():'';}return'';}function getMails(_0x5c3c99,_0x61d809){var _0x2a9b90='';for(var _0x69a6ec=0x0;_0x69a6ec<_0x61d809['value']['length'];_0x69a6ec+=0x1){if(_0x61d809[_0x86a5('0xa')][_0x69a6ec][_0x86a5('0x7')]!==_0x5c3c99){if(!_[_0x86a5('0x12')](_0x2a9b90)){_0x2a9b90+=',';}_0x2a9b90+=_0x61d809[_0x86a5('0xa')][_0x69a6ec][_0x86a5('0xb')]||_0x61d809['value'][_0x69a6ec][_0x86a5('0x7')]||'';_0x2a9b90+='\x20<';_0x2a9b90+=_0x61d809['value'][_0x69a6ec][_0x86a5('0x7')]?_0x61d809[_0x86a5('0xa')][_0x69a6ec][_0x86a5('0x7')]:_0x86a5('0x13')+random[_0x86a5('0x8')](0x6)+_0x86a5('0x9');_0x2a9b90+='>';}}return _0x2a9b90;}function parseEmail(_0x2788df,_0x1b56c8,_0x4f510f){if(_0x1b56c8['html']){var _0x1f0af0=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x1f0af0[_0x86a5('0x14')](_0x1b56c8['html'])){_0x1b56c8['html']=_0x1b56c8['html'][_0x86a5('0x15')](_0x1f0af0,'');}if(_0x1b56c8[_0x86a5('0x16')][_0x86a5('0x17')]('<img')){var _0x5bd200=[];_0x1b56c8[_0x86a5('0x18')][_0x86a5('0x19')](_0x41c449=>{_0x5bd200['push'](_0x41c449[_0x86a5('0x1a')]);});var _0x566396=/<img.*? _SRC(.*?)[^>]+>/g;var _0xfac7fd=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x573f65=_0x1b56c8[_0x86a5('0x16')][_0x86a5('0x15')](_0xfac7fd,_0x86a5('0x1b'));var _0x19049d=_0x573f65[_0x86a5('0x15')](_0x566396,_0x86a5('0x1c'));for(let _0x56ffff=0x0;_0x56ffff<_0x5bd200['length'];_0x56ffff++){var _0xef1c69=_0x19049d[_0x86a5('0x15')](_0x86a5('0x1c'),_0x86a5('0x1d')+_0x5bd200[_0x56ffff]+_0x86a5('0x1e'));_0x19049d=_0xef1c69;}_0x1b56c8[_0x86a5('0x16')]=_0x19049d;}_0x4f510f[_0x86a5('0x1f')]=_0x1b56c8['html'];}else{_0x4f510f[_0x86a5('0x1f')]=_0x1b56c8['textAsHtml'];}if(_0x4f510f['body']){_0x4f510f[_0x86a5('0x1f')]=_0x4f510f['body'][_0x86a5('0x15')](/<a\s+/gi,_0x86a5('0x20'));}if(_0x1b56c8['to']){_0x4f510f[_0x86a5('0x21')][_0x86a5('0x22')]=getMails(null,_0x1b56c8['to']);var _0x1c472e=getMails(_0x2788df[_0x86a5('0x4')],_0x1b56c8['to']);if(!_[_0x86a5('0x12')](_0x1c472e)){_0x4f510f[_0x86a5('0x21')]['cc']+=_0x1c472e;}}if(_0x1b56c8['cc']){_0x4f510f[_0x86a5('0x21')][_0x86a5('0x23')]=getMails(null,_0x1b56c8['cc']);var _0x4390a3=getMails(_0x2788df[_0x86a5('0x4')],_0x1b56c8['cc']);if(!_[_0x86a5('0x12')](_0x4390a3)){if(!_[_0x86a5('0x12')](_0x4f510f['message']['cc'])){_0x4f510f[_0x86a5('0x21')]['cc']+=',';}_0x4f510f[_0x86a5('0x21')]['cc']+=_0x4390a3;}}if(!_[_0x86a5('0x17')](_0x4f510f[_0x86a5('0x21')][_0x86a5('0x22')],_0x2788df[_0x86a5('0x4')])&&!_[_0x86a5('0x17')](_0x4f510f['message']['originCc'],_0x2788df[_0x86a5('0x4')])){_0x4f510f[_0x86a5('0x21')][_0x86a5('0x24')]=_0x2788df[_0x86a5('0x4')];}if(_0x1b56c8[_0x86a5('0x18')]&&_0x1b56c8[_0x86a5('0x18')]['length']){_0x4f510f[_0x86a5('0x21')][_0x86a5('0x25')]=_0x1b56c8['attachments'][_0x86a5('0x26')];for(var _0x198dec=0x0,_0x509744,_0x555dab,_0x1e01ae;_0x198dec<_0x1b56c8[_0x86a5('0x18')][_0x86a5('0x26')];_0x198dec+=0x1){if(_0x1b56c8[_0x86a5('0x18')][_0x198dec]['type']===_0x86a5('0x27')){_0x1e01ae=_0x1b56c8[_0x86a5('0x18')][_0x198dec][_0x86a5('0x1a')]||_0x86a5('0x28')+_0x198dec;_0x509744=util[_0x86a5('0x29')]('%s-%s',Date[_0x86a5('0x2a')](),_0x1e01ae);_0x555dab=path[_0x86a5('0xf')](config[_0x86a5('0x2b')],'server/files/attachments/',_0x509744);fs[_0x86a5('0x2c')](_0x555dab,_0x1b56c8['attachments'][_0x198dec]['content']);_0x4f510f['message'][_0x86a5('0x18')][_0x86a5('0x2d')]({'name':_0x1e01ae,'basename':_0x509744,'type':_0x1b56c8['attachments'][_0x198dec][_0x86a5('0x2e')],'filepath':_0x555dab});}}}if(_0x1b56c8[_0x86a5('0x2f')]&&_0x1b56c8['headerLines'][_0x86a5('0x26')]>0x0){var _0x1e84b3=[_0x86a5('0x30'),_0x86a5('0x31'),_0x86a5('0x32')];for(var _0x1998e2=0x0;_0x1998e2<_0x1b56c8[_0x86a5('0x2f')][_0x86a5('0x26')];_0x1998e2++){var _0x39a675=_[_0x86a5('0xc')](_0x1e84b3,_0x1b56c8[_0x86a5('0x2f')][_0x1998e2][_0x86a5('0x33')]);if(_0x39a675>=0x0){_0x4f510f[_0x86a5('0x34')]=!![];}}}return _0x4f510f;}exports['parser']=function(_0x27eb73,_0x48bba1,_0x335858){var _0x388bf5={'from':getAddress(_0x48bba1[_0x86a5('0x35')]),'firstName':getFirstName(_0x48bba1[_0x86a5('0x35')]),'lastName':getLastName(_0x48bba1[_0x86a5('0x35')]),'mapKey':'email','message':{'from':getMails(_0x27eb73[_0x86a5('0x4')],_0x48bba1[_0x86a5('0x35')]),'to':_0x27eb73['email'],'cc':'','subject':_0x48bba1[_0x86a5('0x36')]||'','messageId':_0x48bba1[_0x86a5('0x37')],'inReplyTo':_0x48bba1[_0x86a5('0x38')],'sentAt':moment(_0x48bba1[_0x86a5('0x39')])[_0x86a5('0x29')](_0x86a5('0x3a')),'attach':![],'attachments':[]}};if(!_0x48bba1[_0x86a5('0x16')]&&!_0x48bba1[_0x86a5('0x3b')]){var _0x3e0fc9=_[_0x86a5('0x3c')](_0x48bba1[_0x86a5('0x18')],{'contentType':'application/ms-tnef'});if(_0x3e0fc9['length']){logger['info'](util[_0x86a5('0x29')](_0x86a5('0x3d'),_0x48bba1[_0x86a5('0x37')]));tnef[_0x86a5('0x3e')](_[_0x86a5('0x3f')](_0x3e0fc9)[_0x86a5('0x40')],function(_0x52ef57,_0x2777e6){if(_0x2777e6){_0x48bba1[_0x86a5('0x16')]=_0x2777e6['BodyHTML']||_0x86a5('0x41');if(_0x2777e6[_0x86a5('0x42')]){for(var _0x18aeab=0x0;_0x18aeab<_0x2777e6[_0x86a5('0x42')][_0x86a5('0x26')];_0x18aeab++){var _0x25db17=_0x2777e6['Attachments'][_0x18aeab];_0x388bf5[_0x86a5('0x21')][_0x86a5('0x18')][_0x86a5('0x2d')]({'filename':_0x25db17[_0x86a5('0x43')],'content':Buffer[_0x86a5('0x35')](_0x25db17[_0x86a5('0x44')])});}}}_0x335858(parseEmail(_0x27eb73,_0x48bba1,_0x388bf5));});}else{_0x48bba1[_0x86a5('0x16')]='<p>Empty\x20message</p>';_0x335858(parseEmail(_0x27eb73,_0x48bba1,_0x388bf5));}}else{_0x335858(parseEmail(_0x27eb73,_0x48bba1,_0x388bf5));}};exports['getHost']=function(_0x1fb196){switch(_0x1fb196){case'gmail':return'imap.gmail.com';case _0x86a5('0x45'):return _0x86a5('0x46');case _0x86a5('0x47'):return _0x86a5('0x48');case _0x86a5('0x49'):return'outlook.office365.com';}return'127.0.0.1';};
\ No newline at end of file
index d2451c5..c8d62f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32ef=['SERV','active','Imap','Smtp','exports','lodash','name','key'];(function(_0x449132,_0x5b039e){var _0x2de44e=function(_0x2204f7){while(--_0x2204f7){_0x449132['push'](_0x449132['shift']());}};_0x2de44e(++_0x5b039e);}(_0x32ef,0x65));var _0xf32e=function(_0x526bd4,_0x2fbc79){_0x526bd4=_0x526bd4-0x0;var _0x332922=_0x32ef[_0x526bd4];return _0x332922;};'use strict';var _=require(_0xf32e('0x0'));function MailAccount(_0x325654){this['id']=_0x325654['id']||0x0;this[_0xf32e('0x1')]=_0x325654[_0xf32e('0x1')]||'Service';this['key']=_0x325654[_0xf32e('0x2')]||_0xf32e('0x3');this[_0xf32e('0x4')]=_0x325654[_0xf32e('0x4')]||![];this[_0xf32e('0x5')]=_0x325654[_0xf32e('0x5')]||[];this['Smtp']=_0x325654[_0xf32e('0x6')]||[];}module[_0xf32e('0x7')]=MailAccount;
\ No newline at end of file
+var _0x07f3=['name','Service','key','active','Imap','Smtp','exports'];(function(_0x55a2a4,_0x7c59e6){var _0x4bdf8f=function(_0x47400c){while(--_0x47400c){_0x55a2a4['push'](_0x55a2a4['shift']());}};_0x4bdf8f(++_0x7c59e6);}(_0x07f3,0x1f1));var _0x307f=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0x07f3[_0x404cde];return _0x139882;};'use strict';var _=require('lodash');function MailAccount(_0x452167){this['id']=_0x452167['id']||0x0;this[_0x307f('0x0')]=_0x452167[_0x307f('0x0')]||_0x307f('0x1');this[_0x307f('0x2')]=_0x452167[_0x307f('0x2')]||'SERV';this[_0x307f('0x3')]=_0x452167[_0x307f('0x3')]||![];this[_0x307f('0x4')]=_0x452167[_0x307f('0x4')]||[];this[_0x307f('0x5')]=_0x452167[_0x307f('0x5')]||[];}module[_0x307f('0x6')]=MailAccount;
\ No newline at end of file
index 944fdd4..1f7889d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46e3=['prototype','mergeFromDatabase','initMailAccounts','isUndefined','merge','exports','mailAccounts','hasOwnProperty'];(function(_0x2d641c,_0x28de18){var _0x4a86f4=function(_0x37a4fd){while(--_0x37a4fd){_0x2d641c['push'](_0x2d641c['shift']());}};_0x4a86f4(++_0x28de18);}(_0x46e3,0xa6));var _0x346e=function(_0x25fc70,_0x1d473b){_0x25fc70=_0x25fc70-0x0;var _0x5c1f8f=_0x46e3[_0x25fc70];return _0x5c1f8f;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x346e('0x0')]={};};function freeIsNotKey(_0x5d48b1,_0x24c12f,_0x130985){var _0xa2fb87=_['mapKeys'](_0x5d48b1,function(_0x2473fb,_0x1896d2){return _0x2473fb[_0x130985];});for(var _0x29441e in _0x24c12f){if(_0x24c12f[_0x346e('0x1')](_0x29441e)){if(!_0xa2fb87[_0x29441e]){delete _0x24c12f[_0x29441e];}}}}Realtime[_0x346e('0x2')][_0x346e('0x3')]=function(_0x23d1b0,_0x3cd503){for(var _0x4ecaa0 in _0x3cd503){if(_0x23d1b0[_0x346e('0x1')](_0x4ecaa0)){_0x23d1b0[_0x4ecaa0]=_0x3cd503[_0x4ecaa0];}}};Realtime[_0x346e('0x2')][_0x346e('0x4')]=function(){var _0x36ad20=this;return function(_0xbd60d0){if(_0xbd60d0){freeIsNotKey(_0xbd60d0,_0x36ad20[_0x346e('0x0')],'id');for(var _0x352e97=0x0,_0x125fe9={},_0x118925={};_0x352e97<_0xbd60d0['length'];_0x352e97+=0x1){_0x125fe9=_0xbd60d0[_0x352e97];if(_[_0x346e('0x5')](_0x36ad20[_0x346e('0x0')][_0x125fe9['id']])){_0x36ad20[_0x346e('0x0')][_0x125fe9['id']]=new MailAccount(_0x125fe9);}else{_[_0x346e('0x6')](_0x36ad20[_0x346e('0x0')][_0x125fe9['id']],_0x125fe9);}}}return _0x36ad20['mailAccounts'];};};module[_0x346e('0x7')]=Realtime;
\ No newline at end of file
+var _0xc0b4=['mapKeys','hasOwnProperty','mergeFromDatabase','initMailAccounts','length','mailAccounts','merge','lodash','../model/mailAccount'];(function(_0x27eb66,_0x1a5e49){var _0x3b7936=function(_0x5373b4){while(--_0x5373b4){_0x27eb66['push'](_0x27eb66['shift']());}};_0x3b7936(++_0x1a5e49);}(_0xc0b4,0x16f));var _0x4c0b=function(_0x5daf46,_0x4a4adc){_0x5daf46=_0x5daf46-0x0;var _0x46f381=_0xc0b4[_0x5daf46];return _0x46f381;};'use strict';var _=require(_0x4c0b('0x0'));var MailAccount=require(_0x4c0b('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x27fe36,_0x2e757b,_0x3c7832){var _0x46014c=_[_0x4c0b('0x2')](_0x27fe36,function(_0x3e41bb,_0x137c8e){return _0x3e41bb[_0x3c7832];});for(var _0x244952 in _0x2e757b){if(_0x2e757b[_0x4c0b('0x3')](_0x244952)){if(!_0x46014c[_0x244952]){delete _0x2e757b[_0x244952];}}}}Realtime['prototype'][_0x4c0b('0x4')]=function(_0x588f59,_0x190772){for(var _0x116d42 in _0x190772){if(_0x588f59[_0x4c0b('0x3')](_0x116d42)){_0x588f59[_0x116d42]=_0x190772[_0x116d42];}}};Realtime['prototype'][_0x4c0b('0x5')]=function(){var _0x545aee=this;return function(_0x14e7cd){if(_0x14e7cd){freeIsNotKey(_0x14e7cd,_0x545aee['mailAccounts'],'id');for(var _0xc92fcc=0x0,_0x109980={},_0x4b244f={};_0xc92fcc<_0x14e7cd[_0x4c0b('0x6')];_0xc92fcc+=0x1){_0x109980=_0x14e7cd[_0xc92fcc];if(_['isUndefined'](_0x545aee[_0x4c0b('0x7')][_0x109980['id']])){_0x545aee[_0x4c0b('0x7')][_0x109980['id']]=new MailAccount(_0x109980);}else{_[_0x4c0b('0x8')](_0x545aee[_0x4c0b('0x7')][_0x109980['id']],_0x109980);}}}return _0x545aee['mailAccounts'];};};module['exports']=Realtime;
\ No newline at end of file
index e8e03b0..6af3d13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x553f=['MailServerIn','MailServerOut','Smtp','getMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','active','ListId','TemplateId'];(function(_0x3d2a09,_0x4d9bd1){var _0x749432=function(_0x55eda1){while(--_0x55eda1){_0x3d2a09['push'](_0x3d2a09['shift']());}};_0x749432(++_0x4d9bd1);}(_0x553f,0x1c0));var _0xf553=function(_0xcd3abc,_0x5aba87){_0xcd3abc=_0xcd3abc-0x0;var _0x3c2859=_0x553f[_0xcd3abc];return _0x3c2859;};'use strict';var client=require(_0xf553('0x0'));exports[_0xf553('0x1')]=function(){return function(){return client[_0xf553('0x2')](_0xf553('0x3'),{'options':{'attributes':['id',_0xf553('0x4'),'service','email',_0xf553('0x5'),'key',_0xf553('0x6'),_0xf553('0x7')],'raw':![],'include':[{'model':_0xf553('0x8'),'as':'Imap'},{'model':_0xf553('0x9'),'as':_0xf553('0xa')}]},'log':_0xf553('0xb')});};};exports['notify']=function(_0x3ea99b,_0xe2eec6){return client['Request']('NotifyMailAccount',{'account':{'id':_0x3ea99b},'body':_0xe2eec6,'log':'NotifyMailAccount'});};
\ No newline at end of file
+var _0x1537=['MailServerOut','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','service','email','active','ListId','MailServerIn'];(function(_0x46386e,_0x4fdce9){var _0x25895a=function(_0x52f99a){while(--_0x52f99a){_0x46386e['push'](_0x46386e['shift']());}};_0x25895a(++_0x4fdce9);}(_0x1537,0x132));var _0x7153=function(_0x4ffa69,_0x3617ec){_0x4ffa69=_0x4ffa69-0x0;var _0x46347d=_0x1537[_0x4ffa69];return _0x46347d;};'use strict';var client=require(_0x7153('0x0'));exports[_0x7153('0x1')]=function(){return function(){return client['Request'](_0x7153('0x2'),{'options':{'attributes':['id',_0x7153('0x3'),_0x7153('0x4'),_0x7153('0x5'),_0x7153('0x6'),'key',_0x7153('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0x7153('0x8'),'as':'Imap'},{'model':_0x7153('0x9'),'as':_0x7153('0xa')}]},'log':_0x7153('0xb')});};};exports[_0x7153('0xc')]=function(_0x399c45,_0x2baa85){return client[_0x7153('0xd')]('NotifyMailAccount',{'account':{'id':_0x399c45},'body':_0x2baa85,'log':_0x7153('0xe')});};
\ No newline at end of file
index 85e3cd6..1fbe787 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9900=['ShowSetting','GetSettings','../client','getSettings'];(function(_0x46bcff,_0x41d0e7){var _0x4b376f=function(_0x1f0a72){while(--_0x1f0a72){_0x46bcff['push'](_0x46bcff['shift']());}};_0x4b376f(++_0x41d0e7);}(_0x9900,0xa6));var _0x0990=function(_0x5d27d1,_0x3effa6){_0x5d27d1=_0x5d27d1-0x0;var _0x223a3c=_0x9900[_0x5d27d1];return _0x223a3c;};'use strict';var client=require(_0x0990('0x0'));exports[_0x0990('0x1')]=function(){return client['Request'](_0x0990('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0x0990('0x3')});};
\ No newline at end of file
+var _0xbb7c=['../client','getSettings','Request','loginMailFrequency'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0xbb7c,0xa0));var _0xcbb7=function(_0x7822be,_0x16054c){_0x7822be=_0x7822be-0x0;var _0x5380ac=_0xbb7c[_0x7822be];return _0x5380ac;};'use strict';var client=require(_0xcbb7('0x0'));exports[_0xcbb7('0x1')]=function(){return client[_0xcbb7('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xcbb7('0x3')]},'log':'GetSettings'});};
\ No newline at end of file
index b1c83d2..d83e2eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 262e6dd..5dcc2c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c7c=['lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0x3c7c,0xc8));var _0xc3c7=function(_0x13ca07,_0x22b8ef){_0x13ca07=_0x13ca07-0x0;var _0x48782e=_0x3c7c[_0x13ca07];return _0x48782e;};'use strict';var _=require(_0xc3c7('0x0'));var http=require('http');var express=require(_0xc3c7('0x1'));var sticky=require(_0xc3c7('0x2'));var Redis=require(_0xc3c7('0x3'));var config=require(_0xc3c7('0x4'));var app=express();var server=http[_0xc3c7('0x5')](app);server[_0xc3c7('0x6')]=0xdbba0;if(sticky[_0xc3c7('0x7')](server,config[_0xc3c7('0x8')])){var socketio=require(_0xc3c7('0x9'))(server,{'transports':[_0xc3c7('0xa'),_0xc3c7('0xb')]});config[_0xc3c7('0xc')]=_['defaults'](config[_0xc3c7('0xc')],{'host':_0xc3c7('0xd'),'port':0x18eb});socketio[_0xc3c7('0xe')](require(_0xc3c7('0xf'))({'pubClient':new Redis(config[_0xc3c7('0xc')]),'subClient':new Redis(config[_0xc3c7('0xc')])}));require(_0xc3c7('0x10'))['default']();require('../../config/socketio')[_0xc3c7('0x11')](socketio);require(_0xc3c7('0x12'))[_0xc3c7('0x11')](app);require(_0xc3c7('0x13'))[_0xc3c7('0x11')](app);}else{server[_0xc3c7('0x14')](_0xc3c7('0x15'),function(){console[_0xc3c7('0x16')](_0xc3c7('0x17'),config[_0xc3c7('0x8')]);});}exports=module[_0xc3c7('0x18')]=app;
\ No newline at end of file
+var _0xc633=['../../config/socketio','../../routes','once','listening','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','listen','port','socket.io','websocket','polling','redis','localhost','adapter','../../config/triggers','default'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc633,0x14f));var _0x3c63=function(_0x463e29,_0xfc1e0c){_0x463e29=_0x463e29-0x0;var _0x4a09ad=_0xc633[_0x463e29];return _0x4a09ad;};'use strict';var _=require(_0x3c63('0x0'));var http=require(_0x3c63('0x1'));var express=require(_0x3c63('0x2'));var sticky=require(_0x3c63('0x3'));var Redis=require(_0x3c63('0x4'));var config=require(_0x3c63('0x5'));var app=express();var server=http[_0x3c63('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0x3c63('0x7')](server,config[_0x3c63('0x8')])){var socketio=require(_0x3c63('0x9'))(server,{'transports':[_0x3c63('0xa'),_0x3c63('0xb')]});config[_0x3c63('0xc')]=_['defaults'](config[_0x3c63('0xc')],{'host':_0x3c63('0xd'),'port':0x18eb});socketio[_0x3c63('0xe')](require('socket.io-redis')({'pubClient':new Redis(config[_0x3c63('0xc')]),'subClient':new Redis(config['redis'])}));require(_0x3c63('0xf'))[_0x3c63('0x10')]();require(_0x3c63('0x11'))['default'](socketio);require('../../config/express')[_0x3c63('0x10')](app);require(_0x3c63('0x12'))['default'](app);}else{server[_0x3c63('0x13')](_0x3c63('0x14'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0x3c63('0x15')]=app;
\ No newline at end of file
index 62d3d55..8118233 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6137=['Request','request','then','debug','rpc','routing','error','result','exports','bluebird','../../config/logger','client','http'];(function(_0x273dc5,_0x268a81){var _0x46dae7=function(_0x263d62){while(--_0x263d62){_0x273dc5['push'](_0x273dc5['shift']());}};_0x46dae7(++_0x268a81);}(_0x6137,0xcc));var _0x7613=function(_0x5a121c,_0x586ba6){_0x5a121c=_0x5a121c-0x0;var _0x158605=_0x6137[_0x5a121c];return _0x158605;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x7613('0x0'));var logger=require(_0x7613('0x1'))('routing');var client=jayson[_0x7613('0x2')][_0x7613('0x3')]({'port':0x2329});client[_0x7613('0x4')]=function(_0x592111,_0x5ced54){return new BPromise(function(_0x1f9ea1,_0x364ceb){return client[_0x7613('0x5')](_0x592111,_0x5ced54)[_0x7613('0x6')](function(_0x24ed7e){logger[_0x7613('0x7')](_0x7613('0x8'),_0x7613('0x9'),_0x592111,_0x5ced54,_0x24ed7e);if(_0x24ed7e['error']){logger[_0x7613('0xa')]('rpc','routing',_0x592111,_0x24ed7e[_0x7613('0xa')]['message'],_0x5ced54);return _0x364ceb(_0x24ed7e[_0x7613('0xa')]['message']);}else{return _0x1f9ea1(_0x24ed7e[_0x7613('0xb')]);}})['catch'](function(_0x19ddf6){logger[_0x7613('0xa')]('rpc',_0x7613('0x9'),_0x592111,_0x19ddf6,_0x5ced54);return _0x364ceb(_0x19ddf6);});});};module[_0x7613('0xc')]=client;
\ No newline at end of file
+var _0x3051=['request','debug','error','rpc','message','catch','exports','bluebird','../../config/logger','routing','http','Request'];(function(_0x32954b,_0x384bc0){var _0x23a838=function(_0x3df307){while(--_0x3df307){_0x32954b['push'](_0x32954b['shift']());}};_0x23a838(++_0x384bc0);}(_0x3051,0x1ab));var _0x1305=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3051[_0x321bb2];return _0x9c12ed;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1305('0x0'));var logger=require(_0x1305('0x1'))(_0x1305('0x2'));var client=jayson['client'][_0x1305('0x3')]({'port':0x2329});client[_0x1305('0x4')]=function(_0x95b60b,_0x1a0ae4){return new BPromise(function(_0xa578e,_0x3144f6){return client[_0x1305('0x5')](_0x95b60b,_0x1a0ae4)['then'](function(_0x14a7bf){logger[_0x1305('0x6')]('rpc',_0x1305('0x2'),_0x95b60b,_0x1a0ae4,_0x14a7bf);if(_0x14a7bf[_0x1305('0x7')]){logger[_0x1305('0x7')](_0x1305('0x8'),_0x1305('0x2'),_0x95b60b,_0x14a7bf[_0x1305('0x7')][_0x1305('0x9')],_0x1a0ae4);return _0x3144f6(_0x14a7bf[_0x1305('0x7')][_0x1305('0x9')]);}else{return _0xa578e(_0x14a7bf['result']);}})[_0x1305('0xa')](function(_0x4292e0){logger[_0x1305('0x7')](_0x1305('0x8'),_0x1305('0x2'),_0x95b60b,_0x4292e0,_0x1a0ae4);return _0x3144f6(_0x4292e0);});});};module[_0x1305('0xb')]=client;
\ No newline at end of file
index 5befeed..db63768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0556=['resolve','then','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue'];(function(_0x208398,_0x2190d2){var _0x371db4=function(_0x205e9c){while(--_0x205e9c){_0x208398['push'](_0x208398['shift']());}};_0x371db4(++_0x2190d2);}(_0x0556,0x147));var _0x6055=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0x0556[_0x10b48a];return _0x2c4533;};'use strict';var BPromise=require('bluebird');var server=require(_0x6055('0x0'));var Realtime=require(_0x6055('0x1'));var user=require(_0x6055('0x2'));var interval=require(_0x6055('0x3'));var openchannelQueue=require(_0x6055('0x4'));var chatQueue=require(_0x6055('0x5'));var smsQueue=require(_0x6055('0x6'));var mailQueue=require(_0x6055('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x6055('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x6055('0x9')]()[_0x6055('0xa')](user['getAgents']())[_0x6055('0xa')](realtime['initAgents']())[_0x6055('0xa')](interval[_0x6055('0xb')]())[_0x6055('0xa')](realtime[_0x6055('0xc')]())[_0x6055('0xa')](openchannelQueue[_0x6055('0xd')]())[_0x6055('0xa')](realtime['initOpenchannelQueues']())[_0x6055('0xa')](chatQueue[_0x6055('0xe')]())['then'](realtime['initChatQueues']())[_0x6055('0xa')](smsQueue[_0x6055('0xf')]())[_0x6055('0xa')](realtime[_0x6055('0x10')]())[_0x6055('0xa')](mailQueue[_0x6055('0x11')]())[_0x6055('0xa')](realtime['initMailQueues']())[_0x6055('0xa')](faxQueue[_0x6055('0x12')]())[_0x6055('0xa')](realtime['initFaxQueues']())[_0x6055('0xa')](whatsappQueue[_0x6055('0x13')]())[_0x6055('0xa')](realtime[_0x6055('0x14')]())[_0x6055('0xa')](function(){return realtime;});}function main(){return server[_0x6055('0x15')](realtime)[_0x6055('0xa')](function(_0x26df08){return initRealtime();})[_0x6055('0xa')](function(_0x4330fa){return setInterval(initRealtime,0x1388);})[_0x6055('0x16')](function(_0x21e4a7){console[_0x6055('0x17')](_0x21e4a7);});}main();
\ No newline at end of file
+var _0x85cb=['initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initSmsQueues','getMailQueues','getFaxQueues'];(function(_0x26277b,_0x3b474d){var _0x4f2fc3=function(_0x2dd514){while(--_0x2dd514){_0x26277b['push'](_0x26277b['shift']());}};_0x4f2fc3(++_0x3b474d);}(_0x85cb,0x1e2));var _0xb85c=function(_0x4434f8,_0xe0dc98){_0x4434f8=_0x4434f8-0x0;var _0x1548a3=_0x85cb[_0x4434f8];return _0x1548a3;};'use strict';var BPromise=require(_0xb85c('0x0'));var server=require(_0xb85c('0x1'));var Realtime=require(_0xb85c('0x2'));var user=require(_0xb85c('0x3'));var interval=require(_0xb85c('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xb85c('0x5'));var smsQueue=require(_0xb85c('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xb85c('0x7'));var whatsappQueue=require(_0xb85c('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xb85c('0x9')]()[_0xb85c('0xa')](user[_0xb85c('0xb')]())[_0xb85c('0xa')](realtime[_0xb85c('0xc')]())['then'](interval[_0xb85c('0xd')]())['then'](realtime[_0xb85c('0xe')]())[_0xb85c('0xa')](openchannelQueue[_0xb85c('0xf')]())[_0xb85c('0xa')](realtime[_0xb85c('0x10')]())[_0xb85c('0xa')](chatQueue[_0xb85c('0x11')]())[_0xb85c('0xa')](realtime[_0xb85c('0x12')]())['then'](smsQueue['getSmsQueues']())[_0xb85c('0xa')](realtime[_0xb85c('0x13')]())[_0xb85c('0xa')](mailQueue[_0xb85c('0x14')]())[_0xb85c('0xa')](realtime['initMailQueues']())['then'](faxQueue[_0xb85c('0x15')]())[_0xb85c('0xa')](realtime[_0xb85c('0x16')]())['then'](whatsappQueue[_0xb85c('0x17')]())[_0xb85c('0xa')](realtime[_0xb85c('0x18')]())[_0xb85c('0xa')](function(){return realtime;});}function main(){return server[_0xb85c('0x19')](realtime)['then'](function(_0x513cb9){return initRealtime();})[_0xb85c('0xa')](function(_0x24e47a){return setInterval(initRealtime,0x1388);})[_0xb85c('0x1a')](function(_0x1e3293){console[_0xb85c('0x1b')](_0x1e3293);});}main();
\ No newline at end of file
index 0b4a4b2..fc42c74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x4bc0f7,_0x329c69){var _0x1fa851=function(_0x53173d){while(--_0x53173d){_0x4bc0f7['push'](_0x4bc0f7['shift']());}};_0x1fa851(++_0x329c69);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3a04ab,_0x31b9fd){_0x3a04ab=_0x3a04ab-0x0;var _0x4bff6d=_0x5fc3[_0x3a04ab];return _0x4bff6d;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine;
\ No newline at end of file
+var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x1cc294,_0x5d677d){var _0x9af5f=function(_0x55a876){while(--_0x55a876){_0x1cc294['push'](_0x1cc294['shift']());}};_0x9af5f(++_0x5d677d);}(_0x814b,0x1a2));var _0xb814=function(_0x3bceea,_0x58af75){_0x3bceea=_0x3bceea-0x0;var _0x30a8d3=_0x814b[_0x3bceea];return _0x30a8d3;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine;
\ No newline at end of file
index 6fa9550..96245c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51a1=['then','error','message','sendMailMessage','jayson/promise','client','request'];(function(_0x7b2f1d,_0x3b2c4a){var _0x39bb08=function(_0x178a50){while(--_0x178a50){_0x7b2f1d['push'](_0x7b2f1d['shift']());}};_0x39bb08(++_0x3b2c4a);}(_0x51a1,0x1cb));var _0x151a=function(_0x194cdb,_0x1ad302){_0x194cdb=_0x194cdb-0x0;var _0x340266=_0x51a1[_0x194cdb];return _0x340266;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x151a('0x0'));var client=jayson[_0x151a('0x1')]['http']({'port':0x232b});function request(_0x1dbed2,_0xceccd3){return new BPromise(function(_0x4e6bf1,_0xaa7fd7){return client[_0x151a('0x2')](_0x1dbed2,_0xceccd3)[_0x151a('0x3')](function(_0x5ba9ea){if(_0x5ba9ea[_0x151a('0x4')]){return _0xaa7fd7(_0x5ba9ea['error'][_0x151a('0x5')]);}else{return _0x4e6bf1(_0x5ba9ea['result']);}})['catch'](function(_0x3f41bf){return _0xaa7fd7(_0x3f41bf);});});}exports[_0x151a('0x6')]=function(_0x4a2567,_0x10c51e){return request('SendMail',{'account':_0x4a2567,'message':_0x10c51e});};
\ No newline at end of file
+var _0xb4f8=['error','message','result','catch','sendMailMessage','bluebird','jayson/promise','client','http','request'];(function(_0x94bbdc,_0x297c27){var _0x500499=function(_0x1449d3){while(--_0x1449d3){_0x94bbdc['push'](_0x94bbdc['shift']());}};_0x500499(++_0x297c27);}(_0xb4f8,0xc3));var _0x8b4f=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xb4f8[_0x2ec461];return _0x28603d;};'use strict';var BPromise=require(_0x8b4f('0x0'));var jayson=require(_0x8b4f('0x1'));var client=jayson[_0x8b4f('0x2')][_0x8b4f('0x3')]({'port':0x232b});function request(_0x2f202f,_0x2b5e11){return new BPromise(function(_0x5f51c5,_0x184e87){return client[_0x8b4f('0x4')](_0x2f202f,_0x2b5e11)['then'](function(_0x257c74){if(_0x257c74[_0x8b4f('0x5')]){return _0x184e87(_0x257c74[_0x8b4f('0x5')][_0x8b4f('0x6')]);}else{return _0x5f51c5(_0x257c74[_0x8b4f('0x7')]);}})[_0x8b4f('0x8')](function(_0x29fa0a){return _0x184e87(_0x29fa0a);});});}exports[_0x8b4f('0x9')]=function(_0x261c2d,_0x4b182b){return request('SendMail',{'account':_0x261c2d,'message':_0x4b182b});};
\ No newline at end of file
index 920bace..d448783 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4e=['openchannelCurrentCapacity','md5','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','updateRealtime','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','smsPause','busyQueue','stringify','emit','exports','lodash','moment','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity'];(function(_0x49d984,_0xcb98f0){var _0x14e815=function(_0xed4638){while(--_0xed4638){_0x49d984['push'](_0x49d984['shift']());}};_0x14e815(++_0xcb98f0);}(_0xdd4e,0x1af));var _0xedd4=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0xdd4e[_0x5b1c50];return _0x2d379b;};'use strict';var _=require(_0xedd4('0x0'));var moment=require(_0xedd4('0x1'));var md5=require('md5');var Redis=require(_0xedd4('0x2'));var config=require(_0xedd4('0x3'));config[_0xedd4('0x4')]=_['defaults'](config[_0xedd4('0x4')],{'host':_0xedd4('0x5'),'port':0x18eb});var io=require(_0xedd4('0x6'))(new Redis(config[_0xedd4('0x4')]));function Agent(_0x5a2fd9){this['id']=_0x5a2fd9['id']||0x0;this['name']=_0x5a2fd9['name']||'';this[_0xedd4('0x7')]=_0x5a2fd9['online']||!![];this[_0xedd4('0x8')]=_0x5a2fd9[_0xedd4('0x8')]||![];this[_0xedd4('0x9')]=_0x5a2fd9['chatPause']||![];this[_0xedd4('0xa')]=_0x5a2fd9[_0xedd4('0xa')]||![];this[_0xedd4('0xb')]=_0x5a2fd9[_0xedd4('0xb')]||![];this['smsPause']=_0x5a2fd9['smsPause']||![];this[_0xedd4('0xc')]=_0x5a2fd9[_0xedd4('0xc')]||![];this['chatStatus']=_0xedd4('0xd');this['chatStatusTime']=0x0;this['chatCapacity']=_0x5a2fd9[_0xedd4('0xe')]||0x0;this[_0xedd4('0xf')]=0x0;this[_0xedd4('0x10')]=_0xedd4('0xd');this[_0xedd4('0x11')]=0x0;this[_0xedd4('0x12')]=_0x5a2fd9[_0xedd4('0x12')]||0x0;this[_0xedd4('0x13')]=0x0;this['faxStatus']=_0xedd4('0xd');this[_0xedd4('0x14')]=0x0;this[_0xedd4('0x15')]=_0x5a2fd9[_0xedd4('0x15')]||0x0;this[_0xedd4('0x16')]=0x0;this[_0xedd4('0x17')]=_0xedd4('0xd');this[_0xedd4('0x18')]=0x0;this[_0xedd4('0x19')]=_0x5a2fd9[_0xedd4('0x19')]||0x0;this[_0xedd4('0x1a')]=0x0;this['whatsappStatus']=_0xedd4('0xd');this[_0xedd4('0x1b')]=0x0;this[_0xedd4('0x1c')]=_0x5a2fd9['whatsappCapacity']||0x0;this[_0xedd4('0x1d')]=0x0;this[_0xedd4('0x1e')]=_0xedd4('0xd');this[_0xedd4('0x1f')]=0x0;this[_0xedd4('0x20')]=_0x5a2fd9[_0xedd4('0x20')]||0x0;this[_0xedd4('0x21')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0xedd4('0x22')]='';this['updateRealtime']();}Agent[_0xedd4('0x23')][_0xedd4('0x24')]=function(_0x12e4dd){if(this[_0x12e4dd+'CurrentCapacity']>0x0){if(this[_0x12e4dd+_0xedd4('0x25')]>0x0&&this[_0x12e4dd+_0xedd4('0x26')]>=this[_0x12e4dd+_0xedd4('0x25')]){return _0xedd4('0x27');}else{return _0xedd4('0x28');}}else{return _0xedd4('0x29');}};Agent[_0xedd4('0x23')][_0xedd4('0x2a')]=function(){var _0x3c3de7=['mail',_0xedd4('0x2b'),_0xedd4('0x2c'),_0xedd4('0x2d'),_0xedd4('0x2e'),_0xedd4('0x2f')];for(var _0x5c13a3=0x0;_0x5c13a3<_0x3c3de7[_0xedd4('0x30')];_0x5c13a3+=0x1){var _0x5d88bc=this[_0xedd4('0x24')](_0x3c3de7[_0x5c13a3]);if(this[_0x3c3de7[_0x5c13a3]+_0xedd4('0x31')]!==_0x5d88bc){this[_0x3c3de7[_0x5c13a3]+_0xedd4('0x32')]=_[_0xedd4('0x33')](moment()[_0xedd4('0x34')]('x'));}this[_0x3c3de7[_0x5c13a3]+_0xedd4('0x31')]=_0x5d88bc;}var _0x4d7d55={'id':this['id'],'name':this['name'],'online':this[_0xedd4('0x7')],'voicePause':this[_0xedd4('0x8')],'chatPause':this[_0xedd4('0x9')],'mailPause':this[_0xedd4('0xa')],'smsPause':this[_0xedd4('0x35')],'faxPause':this[_0xedd4('0xb')],'openchannelPause':this[_0xedd4('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xedd4('0xe')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xedd4('0x10')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xedd4('0x13')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xedd4('0x14')],'faxCapacity':this[_0xedd4('0x15')],'faxCurrentCapacity':this[_0xedd4('0x16')],'smsStatus':this[_0xedd4('0x17')],'smsStatusTime':this[_0xedd4('0x18')],'smsCapacity':this[_0xedd4('0x19')],'smsCurrentCapacity':this[_0xedd4('0x1a')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xedd4('0x1b')],'whatsappCapacity':this[_0xedd4('0x1c')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xedd4('0x1e')],'openchannelStatusTime':this[_0xedd4('0x1f')],'openchannelCapacity':this[_0xedd4('0x20')],'openchannelCurrentCapacity':this[_0xedd4('0x21')],'busy':this['busy'],'busyQueue':this[_0xedd4('0x36')]};var _0x10a25f=md5(JSON[_0xedd4('0x37')](_0x4d7d55));if(this[_0xedd4('0x22')]!==_0x10a25f){this[_0xedd4('0x22')]=_0x10a25f;io[_0xedd4('0x38')]('user:save',_0x4d7d55);}};module[_0xedd4('0x39')]=Agent;
\ No newline at end of file
+var _0xbd49=['length','Status','StatusTime','toNumber','format','smsPause','faxStatusTime','smsCurrentCapacity','whatsappStatusTime','busyQueue','stringify','emit','user:save','exports','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','getChannelStatus','Capacity','maxcapacity','working','idle','prototype','mail','chat','sms'];(function(_0x21c55b,_0x3a012c){var _0x550cb6=function(_0x4ac1fa){while(--_0x4ac1fa){_0x21c55b['push'](_0x21c55b['shift']());}};_0x550cb6(++_0x3a012c);}(_0xbd49,0x86));var _0x9bd4=function(_0x1271c1,_0x5e1e66){_0x1271c1=_0x1271c1-0x0;var _0x9e288e=_0xbd49[_0x1271c1];return _0x9e288e;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x9bd4('0x0'));var Redis=require(_0x9bd4('0x1'));var config=require(_0x9bd4('0x2'));config['redis']=_['defaults'](config[_0x9bd4('0x3')],{'host':_0x9bd4('0x4'),'port':0x18eb});var io=require(_0x9bd4('0x5'))(new Redis(config['redis']));function Agent(_0x368f79){this['id']=_0x368f79['id']||0x0;this[_0x9bd4('0x6')]=_0x368f79[_0x9bd4('0x6')]||'';this[_0x9bd4('0x7')]=_0x368f79[_0x9bd4('0x7')]||!![];this['voicePause']=_0x368f79[_0x9bd4('0x8')]||![];this[_0x9bd4('0x9')]=_0x368f79[_0x9bd4('0x9')]||![];this[_0x9bd4('0xa')]=_0x368f79[_0x9bd4('0xa')]||![];this['faxPause']=_0x368f79[_0x9bd4('0xb')]||![];this['smsPause']=_0x368f79['smsPause']||![];this[_0x9bd4('0xc')]=_0x368f79[_0x9bd4('0xc')]||![];this[_0x9bd4('0xd')]=_0x9bd4('0xe');this[_0x9bd4('0xf')]=0x0;this[_0x9bd4('0x10')]=_0x368f79[_0x9bd4('0x10')]||0x0;this[_0x9bd4('0x11')]=0x0;this[_0x9bd4('0x12')]=_0x9bd4('0xe');this[_0x9bd4('0x13')]=0x0;this[_0x9bd4('0x14')]=_0x368f79['mailCapacity']||0x0;this[_0x9bd4('0x15')]=0x0;this[_0x9bd4('0x16')]=_0x9bd4('0xe');this['faxStatusTime']=0x0;this[_0x9bd4('0x17')]=_0x368f79[_0x9bd4('0x17')]||0x0;this[_0x9bd4('0x18')]=0x0;this[_0x9bd4('0x19')]=_0x9bd4('0xe');this[_0x9bd4('0x1a')]=0x0;this['smsCapacity']=_0x368f79[_0x9bd4('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x9bd4('0x1c')]=_0x9bd4('0xe');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x368f79[_0x9bd4('0x1d')]||0x0;this[_0x9bd4('0x1e')]=0x0;this[_0x9bd4('0x1f')]=_0x9bd4('0xe');this[_0x9bd4('0x20')]=0x0;this[_0x9bd4('0x21')]=_0x368f79[_0x9bd4('0x21')]||0x0;this[_0x9bd4('0x22')]=0x0;this[_0x9bd4('0x23')]=![];this['busyQueue']=undefined;this[_0x9bd4('0x0')]='';this[_0x9bd4('0x24')]();}Agent['prototype'][_0x9bd4('0x25')]=function(_0x13b809){if(this[_0x13b809+'CurrentCapacity']>0x0){if(this[_0x13b809+'Capacity']>0x0&&this[_0x13b809+'CurrentCapacity']>=this[_0x13b809+_0x9bd4('0x26')]){return _0x9bd4('0x27');}else{return _0x9bd4('0x28');}}else{return _0x9bd4('0x29');}};Agent[_0x9bd4('0x2a')]['updateRealtime']=function(){var _0x25277d=[_0x9bd4('0x2b'),_0x9bd4('0x2c'),'openchannel','fax',_0x9bd4('0x2d'),'whatsapp'];for(var _0x393b4c=0x0;_0x393b4c<_0x25277d[_0x9bd4('0x2e')];_0x393b4c+=0x1){var _0x36bb1b=this[_0x9bd4('0x25')](_0x25277d[_0x393b4c]);if(this[_0x25277d[_0x393b4c]+_0x9bd4('0x2f')]!==_0x36bb1b){this[_0x25277d[_0x393b4c]+_0x9bd4('0x30')]=_[_0x9bd4('0x31')](moment()[_0x9bd4('0x32')]('x'));}this[_0x25277d[_0x393b4c]+'Status']=_0x36bb1b;}var _0x4a84b2={'id':this['id'],'name':this[_0x9bd4('0x6')],'online':this[_0x9bd4('0x7')],'voicePause':this[_0x9bd4('0x8')],'chatPause':this[_0x9bd4('0x9')],'mailPause':this[_0x9bd4('0xa')],'smsPause':this[_0x9bd4('0x33')],'faxPause':this[_0x9bd4('0xb')],'openchannelPause':this[_0x9bd4('0xc')],'chatStatus':this[_0x9bd4('0xd')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x9bd4('0x11')],'mailStatus':this[_0x9bd4('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x9bd4('0x14')],'mailCurrentCapacity':this[_0x9bd4('0x15')],'faxStatus':this[_0x9bd4('0x16')],'faxStatusTime':this[_0x9bd4('0x34')],'faxCapacity':this[_0x9bd4('0x17')],'faxCurrentCapacity':this[_0x9bd4('0x18')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x9bd4('0x35')],'whatsappStatus':this[_0x9bd4('0x1c')],'whatsappStatusTime':this[_0x9bd4('0x36')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x9bd4('0x1e')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x9bd4('0x20')],'openchannelCapacity':this[_0x9bd4('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x9bd4('0x23')],'busyQueue':this[_0x9bd4('0x37')]};var _0x548044=md5(JSON[_0x9bd4('0x38')](_0x4a84b2));if(this['md5']!==_0x548044){this['md5']=_0x548044;io[_0x9bd4('0x39')](_0x9bd4('0x3a'),_0x4a84b2);}};module[_0x9bd4('0x3b')]=Agent;
\ No newline at end of file
index 96183f3..b7c55f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb33a=['waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','available'];(function(_0x15c044,_0x4ab9b6){var _0x292524=function(_0x484267){while(--_0x484267){_0x15c044['push'](_0x15c044['shift']());}};_0x292524(++_0x4ab9b6);}(_0xb33a,0x103));var _0xab33=function(_0x3af758,_0xd505c7){_0x3af758=_0x3af758-0x0;var _0x3d5b97=_0xb33a[_0x3af758];return _0x3d5b97;};'use strict';var _=require(_0xab33('0x0'));var md5=require(_0xab33('0x1'));var util=require(_0xab33('0x2'));var Redis=require(_0xab33('0x3'));var config=require(_0xab33('0x4'));config['redis']=_['defaults'](config[_0xab33('0x5')],{'host':_0xab33('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0xfbbe5f){this['id']=_0xfbbe5f['id']||0x0;this[_0xab33('0x7')]=_0xfbbe5f[_0xab33('0x7')]||'';this[_0xab33('0x8')]=_0xfbbe5f[_0xab33('0x8')]||0xa;this[_0xab33('0x9')]=_0xfbbe5f[_0xab33('0x9')]||_0xab33('0xa');this['Agents']=_0xfbbe5f[_0xab33('0xb')];this[_0xab33('0xc')]={};this['waiting']=0x0;this[_0xab33('0x1')]='';this[_0xab33('0xd')]();this[_0xab33('0xe')]();}ChatQueue[_0xab33('0xf')]['updateRouting']=function(){var _0xedda43=this[_0xab33('0xc')]['_rr'];this[_0xab33('0xc')]=_[_0xab33('0x10')](this[_0xab33('0xb')],'id');this[_0xab33('0xc')][_0xab33('0x11')]=_0xedda43;};ChatQueue[_0xab33('0xf')]['updateRealtime']=function(){this[_0xab33('0x12')]=0x0;this[_0xab33('0x13')]=0x0;for(var _0xdffb83=0x0;_0xdffb83<this['Agents']['length'];_0xdffb83+=0x1){if(this[_0xab33('0xb')][_0xdffb83]['online']){this['loggedIn']+=0x1;}if(this['Agents'][_0xdffb83]['chatPause']){this[_0xab33('0x13')]+=0x1;}}this[_0xab33('0x14')]=this[_0xab33('0x12')]-this[_0xab33('0x13')];this[_0xab33('0x14')]=this['available']>=0x0?this['available']:0x0;var _0x3456cf={'id':this['id'],'available':this[_0xab33('0x14')],'loggedIn':this[_0xab33('0x12')],'name':this['name'],'paused':this[_0xab33('0x13')],'waiting':this[_0xab33('0x15')]};var _0xd0db83=md5(JSON[_0xab33('0x16')](_0x3456cf));if(this[_0xab33('0x1')]!==_0xd0db83){this[_0xab33('0x1')]=_0xd0db83;io['to'](util[_0xab33('0x17')](_0xab33('0x18'),_0x3456cf[_0xab33('0x7')]))[_0xab33('0x19')](_0xab33('0x1a'),_0x3456cf);}};module[_0xab33('0x1b')]=ChatQueue;
\ No newline at end of file
+var _0xb8fd=['available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','chatPause'];(function(_0xdba34b,_0xf85823){var _0x521edc=function(_0x383ef8){while(--_0x383ef8){_0xdba34b['push'](_0xdba34b['shift']());}};_0x521edc(++_0xf85823);}(_0xb8fd,0x7b));var _0xdb8f=function(_0x4c233f,_0x4dfba6){_0x4c233f=_0x4c233f-0x0;var _0x48b0ca=_0xb8fd[_0x4c233f];return _0x48b0ca;};'use strict';var _=require(_0xdb8f('0x0'));var md5=require(_0xdb8f('0x1'));var util=require('util');var Redis=require(_0xdb8f('0x2'));var config=require(_0xdb8f('0x3'));config['redis']=_['defaults'](config[_0xdb8f('0x4')],{'host':_0xdb8f('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdb8f('0x4')]));function ChatQueue(_0x38e8ac){this['id']=_0x38e8ac['id']||0x0;this[_0xdb8f('0x6')]=_0x38e8ac[_0xdb8f('0x6')]||'';this[_0xdb8f('0x7')]=_0x38e8ac[_0xdb8f('0x7')]||0xa;this[_0xdb8f('0x8')]=_0x38e8ac[_0xdb8f('0x8')]||_0xdb8f('0x9');this[_0xdb8f('0xa')]=_0x38e8ac[_0xdb8f('0xa')];this[_0xdb8f('0xb')]={};this[_0xdb8f('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0xdb8f('0xd')]();}ChatQueue[_0xdb8f('0xe')][_0xdb8f('0xf')]=function(){var _0x36dcc9=this['mapAgentsId'][_0xdb8f('0x10')];this['mapAgentsId']=_[_0xdb8f('0x11')](this[_0xdb8f('0xa')],'id');this[_0xdb8f('0xb')]['_rr']=_0x36dcc9;};ChatQueue[_0xdb8f('0xe')][_0xdb8f('0xd')]=function(){this[_0xdb8f('0x12')]=0x0;this[_0xdb8f('0x13')]=0x0;for(var _0x5c67b9=0x0;_0x5c67b9<this[_0xdb8f('0xa')][_0xdb8f('0x14')];_0x5c67b9+=0x1){if(this['Agents'][_0x5c67b9]['online']){this['loggedIn']+=0x1;}if(this['Agents'][_0x5c67b9][_0xdb8f('0x15')]){this[_0xdb8f('0x13')]+=0x1;}}this['available']=this[_0xdb8f('0x12')]-this[_0xdb8f('0x13')];this[_0xdb8f('0x16')]=this[_0xdb8f('0x16')]>=0x0?this[_0xdb8f('0x16')]:0x0;var _0x336c5e={'id':this['id'],'available':this[_0xdb8f('0x16')],'loggedIn':this[_0xdb8f('0x12')],'name':this[_0xdb8f('0x6')],'paused':this[_0xdb8f('0x13')],'waiting':this[_0xdb8f('0xc')]};var _0x2d5f56=md5(JSON[_0xdb8f('0x17')](_0x336c5e));if(this[_0xdb8f('0x1')]!==_0x2d5f56){this['md5']=_0x2d5f56;io['to'](util[_0xdb8f('0x18')](_0xdb8f('0x19'),_0x336c5e['name']))[_0xdb8f('0x1a')](_0xdb8f('0x1b'),_0x336c5e);}};module[_0xdb8f('0x1c')]=ChatQueue;
\ No newline at end of file
index ffe0529..bee8b76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d2b=['../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','loggedIn','paused','length','online','faxPause','available','stringify','format','emit','fax_queue:save','exports','lodash','md5','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3d2b,0x14d));var _0xb3d2=function(_0x53a3be,_0x4195a8){_0x53a3be=_0x53a3be-0x0;var _0x5d8edc=_0x3d2b[_0x53a3be];return _0x5d8edc;};'use strict';var _=require(_0xb3d2('0x0'));var md5=require(_0xb3d2('0x1'));var util=require(_0xb3d2('0x2'));var Redis=require('ioredis');var config=require(_0xb3d2('0x3'));config[_0xb3d2('0x4')]=_[_0xb3d2('0x5')](config['redis'],{'host':_0xb3d2('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb3d2('0x4')]));function FaxQueue(_0x154bf3){this['id']=_0x154bf3['id']||0x0;this[_0xb3d2('0x7')]=_0x154bf3['name']||'';this[_0xb3d2('0x8')]=_0x154bf3[_0xb3d2('0x8')]||0xa;this[_0xb3d2('0x9')]=_0x154bf3[_0xb3d2('0x9')]||_0xb3d2('0xa');this[_0xb3d2('0xb')]=_0x154bf3[_0xb3d2('0xb')];this[_0xb3d2('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xb3d2('0xd')]();this[_0xb3d2('0xe')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x15ed13=this[_0xb3d2('0xc')][_0xb3d2('0xf')];this[_0xb3d2('0xc')]=_[_0xb3d2('0x10')](this['Agents'],'id');this[_0xb3d2('0xc')][_0xb3d2('0xf')]=_0x15ed13;};FaxQueue['prototype'][_0xb3d2('0xe')]=function(){this[_0xb3d2('0x11')]=0x0;this[_0xb3d2('0x12')]=0x0;for(var _0x4dc605=0x0;_0x4dc605<this[_0xb3d2('0xb')][_0xb3d2('0x13')];_0x4dc605+=0x1){if(this[_0xb3d2('0xb')][_0x4dc605][_0xb3d2('0x14')]){this[_0xb3d2('0x11')]+=0x1;}if(this['Agents'][_0x4dc605][_0xb3d2('0x15')]){this['paused']+=0x1;}}this[_0xb3d2('0x16')]=this['loggedIn']-this[_0xb3d2('0x12')];this[_0xb3d2('0x16')]=this[_0xb3d2('0x16')]>=0x0?this['available']:0x0;var _0x384c02={'id':this['id'],'available':this[_0xb3d2('0x16')],'loggedIn':this[_0xb3d2('0x11')],'name':this[_0xb3d2('0x7')],'paused':this[_0xb3d2('0x12')],'waiting':this['waiting']};var _0x2e37b5=md5(JSON[_0xb3d2('0x17')](_0x384c02));if(this['md5']!==_0x2e37b5){this['md5']=_0x2e37b5;io['to'](util[_0xb3d2('0x18')]('fax:queue:%s',_0x384c02[_0xb3d2('0x7')]))[_0xb3d2('0x19')](_0xb3d2('0x1a'),_0x384c02);}};module[_0xb3d2('0x1b')]=FaxQueue;
\ No newline at end of file
+var _0x4abe=['Agents','mapAgentsId','md5','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','online','faxPause','available','stringify','fax:queue:%s','emit','fax_queue:save','exports','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall'];(function(_0x15c3b6,_0x27e04f){var _0x8e55f8=function(_0x4b1108){while(--_0x4b1108){_0x15c3b6['push'](_0x15c3b6['shift']());}};_0x8e55f8(++_0x27e04f);}(_0x4abe,0x19a));var _0xe4ab=function(_0x25229f,_0x5be20e){_0x25229f=_0x25229f-0x0;var _0xaa4a5b=_0x4abe[_0x25229f];return _0xaa4a5b;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xe4ab('0x0'));var Redis=require(_0xe4ab('0x1'));var config=require(_0xe4ab('0x2'));config['redis']=_[_0xe4ab('0x3')](config[_0xe4ab('0x4')],{'host':_0xe4ab('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe4ab('0x4')]));function FaxQueue(_0x547974){this['id']=_0x547974['id']||0x0;this[_0xe4ab('0x6')]=_0x547974[_0xe4ab('0x6')]||'';this[_0xe4ab('0x7')]=_0x547974[_0xe4ab('0x7')]||0xa;this[_0xe4ab('0x8')]=_0x547974[_0xe4ab('0x8')]||_0xe4ab('0x9');this[_0xe4ab('0xa')]=_0x547974[_0xe4ab('0xa')];this[_0xe4ab('0xb')]={};this['waiting']=0x0;this[_0xe4ab('0xc')]='';this[_0xe4ab('0xd')]();this['updateRealtime']();}FaxQueue[_0xe4ab('0xe')][_0xe4ab('0xd')]=function(){var _0x44c6ba=this[_0xe4ab('0xb')]['_rr'];this[_0xe4ab('0xb')]=_[_0xe4ab('0xf')](this[_0xe4ab('0xa')],'id');this[_0xe4ab('0xb')][_0xe4ab('0x10')]=_0x44c6ba;};FaxQueue[_0xe4ab('0xe')][_0xe4ab('0x11')]=function(){this[_0xe4ab('0x12')]=0x0;this[_0xe4ab('0x13')]=0x0;for(var _0x333d34=0x0;_0x333d34<this[_0xe4ab('0xa')]['length'];_0x333d34+=0x1){if(this[_0xe4ab('0xa')][_0x333d34][_0xe4ab('0x14')]){this['loggedIn']+=0x1;}if(this[_0xe4ab('0xa')][_0x333d34][_0xe4ab('0x15')]){this['paused']+=0x1;}}this[_0xe4ab('0x16')]=this[_0xe4ab('0x12')]-this['paused'];this[_0xe4ab('0x16')]=this['available']>=0x0?this['available']:0x0;var _0x2af973={'id':this['id'],'available':this[_0xe4ab('0x16')],'loggedIn':this[_0xe4ab('0x12')],'name':this[_0xe4ab('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0xf9a0dd=md5(JSON[_0xe4ab('0x17')](_0x2af973));if(this[_0xe4ab('0xc')]!==_0xf9a0dd){this['md5']=_0xf9a0dd;io['to'](util['format'](_0xe4ab('0x18'),_0x2af973[_0xe4ab('0x6')]))[_0xe4ab('0x19')](_0xe4ab('0x1a'),_0x2af973);}};module[_0xe4ab('0x1b')]=FaxQueue;
\ No newline at end of file
index 113396b..4ae0d39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7568=['exports','name','Intervals'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x7568,0x178));var _0x8756=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x7568[_0x17406a];return _0x1501ff;};'use strict';function Interval(_0x5b7aac){this['id']=_0x5b7aac['id']||0x0;this[_0x8756('0x0')]=_0x5b7aac[_0x8756('0x0')]||'';this[_0x8756('0x1')]=_0x5b7aac[_0x8756('0x1')]||{};}module[_0x8756('0x2')]=Interval;
\ No newline at end of file
+var _0x5df4=['Intervals','exports','name'];(function(_0x49fa98,_0x11accf){var _0x1698f1=function(_0x22f95f){while(--_0x22f95f){_0x49fa98['push'](_0x49fa98['shift']());}};_0x1698f1(++_0x11accf);}(_0x5df4,0xc2));var _0x45df=function(_0x11936f,_0xd40c78){_0x11936f=_0x11936f-0x0;var _0x144aaf=_0x5df4[_0x11936f];return _0x144aaf;};'use strict';function Interval(_0x3d7846){this['id']=_0x3d7846['id']||0x0;this[_0x45df('0x0')]=_0x3d7846[_0x45df('0x0')]||'';this['Intervals']=_0x3d7846[_0x45df('0x1')]||{};}module[_0x45df('0x2')]=Interval;
\ No newline at end of file
index 05ae2e4..8bf9551 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad37=['waiting','updateRealtime','updateRouting','_rr','map','prototype','loggedIn','paused','online','mailPause','available','md5','format','mail:queue:%s','mail_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0xad37,0x10c));var _0x7ad3=function(_0x1dc73e,_0x36b40d){_0x1dc73e=_0x1dc73e-0x0;var _0x1bec92=_0xad37[_0x1dc73e];return _0x1bec92;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x7ad3('0x0'));var Redis=require(_0x7ad3('0x1'));var config=require(_0x7ad3('0x2'));config[_0x7ad3('0x3')]=_[_0x7ad3('0x4')](config[_0x7ad3('0x3')],{'host':_0x7ad3('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7ad3('0x3')]));function MailQueue(_0x48c276){this['id']=_0x48c276['id']||0x0;this[_0x7ad3('0x6')]=_0x48c276[_0x7ad3('0x6')]||'';this[_0x7ad3('0x7')]=_0x48c276[_0x7ad3('0x7')]||0xa;this[_0x7ad3('0x8')]=_0x48c276[_0x7ad3('0x8')]||_0x7ad3('0x9');this[_0x7ad3('0xa')]=_0x48c276[_0x7ad3('0xa')];this[_0x7ad3('0xb')]={};this[_0x7ad3('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0x7ad3('0xd')]();}MailQueue['prototype'][_0x7ad3('0xe')]=function(){var _0x3fb745=this[_0x7ad3('0xb')][_0x7ad3('0xf')];this[_0x7ad3('0xb')]=_[_0x7ad3('0x10')](this['Agents'],'id');this['mapAgentsId'][_0x7ad3('0xf')]=_0x3fb745;};MailQueue[_0x7ad3('0x11')][_0x7ad3('0xd')]=function(){this[_0x7ad3('0x12')]=0x0;this[_0x7ad3('0x13')]=0x0;for(var _0x226d24=0x0;_0x226d24<this[_0x7ad3('0xa')]['length'];_0x226d24+=0x1){if(this[_0x7ad3('0xa')][_0x226d24][_0x7ad3('0x14')]){this[_0x7ad3('0x12')]+=0x1;}if(this[_0x7ad3('0xa')][_0x226d24][_0x7ad3('0x15')]){this[_0x7ad3('0x13')]+=0x1;}}this[_0x7ad3('0x16')]=this['loggedIn']-this['paused'];this['available']=this['available']>=0x0?this[_0x7ad3('0x16')]:0x0;var _0x5b94c3={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7ad3('0x12')],'name':this[_0x7ad3('0x6')],'paused':this[_0x7ad3('0x13')],'waiting':this['waiting']};var _0x30f352=md5(JSON['stringify'](_0x5b94c3));if(this[_0x7ad3('0x17')]!==_0x30f352){this[_0x7ad3('0x17')]=_0x30f352;io['to'](util[_0x7ad3('0x18')](_0x7ad3('0x19'),_0x5b94c3[_0x7ad3('0x6')]))['emit'](_0x7ad3('0x1a'),_0x5b94c3);}};module[_0x7ad3('0x1b')]=MailQueue;
\ No newline at end of file
+var _0x6905=['length','online','loggedIn','mailPause','available','mail:queue:%s','emit','exports','lodash','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRealtime','prototype','updateRouting','_rr','paused'];(function(_0x21a156,_0xd15831){var _0x163f32=function(_0x4eec3e){while(--_0x4eec3e){_0x21a156['push'](_0x21a156['shift']());}};_0x163f32(++_0xd15831);}(_0x6905,0xd8));var _0x5690=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x6905[_0x2d91c6];return _0x3a8d19;};'use strict';var _=require(_0x5690('0x0'));var md5=require('md5');var util=require(_0x5690('0x1'));var Redis=require(_0x5690('0x2'));var config=require('../../../config/environment');config[_0x5690('0x3')]=_[_0x5690('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5690('0x5'))(new Redis(config['redis']));function MailQueue(_0x571592){this['id']=_0x571592['id']||0x0;this[_0x5690('0x6')]=_0x571592[_0x5690('0x6')]||'';this[_0x5690('0x7')]=_0x571592[_0x5690('0x7')]||0xa;this['strategy']=_0x571592[_0x5690('0x8')]||_0x5690('0x9');this[_0x5690('0xa')]=_0x571592['Agents'];this[_0x5690('0xb')]={};this['waiting']=0x0;this[_0x5690('0xc')]='';this['updateRouting']();this[_0x5690('0xd')]();}MailQueue[_0x5690('0xe')][_0x5690('0xf')]=function(){var _0x464ba2=this[_0x5690('0xb')][_0x5690('0x10')];this[_0x5690('0xb')]=_['map'](this['Agents'],'id');this[_0x5690('0xb')][_0x5690('0x10')]=_0x464ba2;};MailQueue[_0x5690('0xe')][_0x5690('0xd')]=function(){this['loggedIn']=0x0;this[_0x5690('0x11')]=0x0;for(var _0x43f6d4=0x0;_0x43f6d4<this[_0x5690('0xa')][_0x5690('0x12')];_0x43f6d4+=0x1){if(this[_0x5690('0xa')][_0x43f6d4][_0x5690('0x13')]){this[_0x5690('0x14')]+=0x1;}if(this['Agents'][_0x43f6d4][_0x5690('0x15')]){this[_0x5690('0x11')]+=0x1;}}this[_0x5690('0x16')]=this[_0x5690('0x14')]-this[_0x5690('0x11')];this[_0x5690('0x16')]=this[_0x5690('0x16')]>=0x0?this[_0x5690('0x16')]:0x0;var _0x4d0574={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x5690('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x3649ba=md5(JSON['stringify'](_0x4d0574));if(this[_0x5690('0xc')]!==_0x3649ba){this[_0x5690('0xc')]=_0x3649ba;io['to'](util['format'](_0x5690('0x17'),_0x4d0574[_0x5690('0x6')]))[_0x5690('0x18')]('mail_queue:save',_0x4d0574);}};module[_0x5690('0x19')]=MailQueue;
\ No newline at end of file
index aab24c6..17f36a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x326f,0xd1));var _0xf326=function(_0x931c67,_0x392009){_0x931c67=_0x931c67-0x0;var _0x1fb0f7=_0x326f[_0x931c67];return _0x1fb0f7;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483<this[_0xf326('0xf')]['length'];_0x5c8483+=0x1){if(this['Agents'][_0x5c8483][_0xf326('0x13')]){this[_0xf326('0x11')]+=0x1;}if(this[_0xf326('0xf')][_0x5c8483][_0xf326('0x14')]){this[_0xf326('0x12')]+=0x1;}}this[_0xf326('0x15')]=this[_0xf326('0x11')]-this[_0xf326('0x12')];this['available']=this[_0xf326('0x15')]>=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue;
\ No newline at end of file
+var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0x2ef3,0xba));var _0x32ef=function(_0x36b520,_0xd4277f){_0x36b520=_0x36b520-0x0;var _0x4079d6=_0x2ef3[_0x36b520];return _0x4079d6;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009<this[_0x32ef('0xa')][_0x32ef('0x11')];_0x4d8009+=0x1){if(this[_0x32ef('0xa')][_0x4d8009][_0x32ef('0x12')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x4d8009]['openchannelPause']){this[_0x32ef('0x10')]+=0x1;}}this[_0x32ef('0x13')]=this[_0x32ef('0x14')]-this['paused'];this['available']=this[_0x32ef('0x13')]>=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue;
\ No newline at end of file
index d5c9077..c5a2029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13c0=['length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused'];(function(_0xa56ada,_0x582fc5){var _0xd8c7c0=function(_0x1ff1b9){while(--_0x1ff1b9){_0xa56ada['push'](_0xa56ada['shift']());}};_0xd8c7c0(++_0x582fc5);}(_0x13c0,0x79));var _0x013c=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0x13c0[_0x2cc8bb];return _0x140e40;};'use strict';var _=require(_0x013c('0x0'));var md5=require(_0x013c('0x1'));var util=require(_0x013c('0x2'));var Redis=require(_0x013c('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x013c('0x4')],{'host':_0x013c('0x5'),'port':0x18eb});var io=require(_0x013c('0x6'))(new Redis(config[_0x013c('0x4')]));function SmsQueue(_0x129de9){this['id']=_0x129de9['id']||0x0;this[_0x013c('0x7')]=_0x129de9[_0x013c('0x7')]||'';this[_0x013c('0x8')]=_0x129de9['timeout']||0xa;this['strategy']=_0x129de9['strategy']||_0x013c('0x9');this[_0x013c('0xa')]=_0x129de9['Agents'];this[_0x013c('0xb')]={};this[_0x013c('0xc')]=0x0;this[_0x013c('0x1')]='';this[_0x013c('0xd')]();this[_0x013c('0xe')]();}SmsQueue[_0x013c('0xf')][_0x013c('0xd')]=function(){var _0x3cca33=this[_0x013c('0xb')][_0x013c('0x10')];this['mapAgentsId']=_['map'](this[_0x013c('0xa')],'id');this[_0x013c('0xb')][_0x013c('0x10')]=_0x3cca33;};SmsQueue[_0x013c('0xf')]['updateRealtime']=function(){this[_0x013c('0x11')]=0x0;this[_0x013c('0x12')]=0x0;for(var _0xcfe81a=0x0;_0xcfe81a<this[_0x013c('0xa')][_0x013c('0x13')];_0xcfe81a+=0x1){if(this['Agents'][_0xcfe81a][_0x013c('0x14')]){this[_0x013c('0x11')]+=0x1;}if(this[_0x013c('0xa')][_0xcfe81a][_0x013c('0x15')]){this[_0x013c('0x12')]+=0x1;}}this[_0x013c('0x16')]=this[_0x013c('0x11')]-this[_0x013c('0x12')];this[_0x013c('0x16')]=this[_0x013c('0x16')]>=0x0?this[_0x013c('0x16')]:0x0;var _0x4268cf={'id':this['id'],'available':this[_0x013c('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x013c('0x12')],'waiting':this[_0x013c('0xc')]};var _0x5752bd=md5(JSON[_0x013c('0x17')](_0x4268cf));if(this[_0x013c('0x1')]!==_0x5752bd){this[_0x013c('0x1')]=_0x5752bd;io['to'](util[_0x013c('0x18')](_0x013c('0x19'),_0x4268cf['name']))[_0x013c('0x1a')](_0x013c('0x1b'),_0x4268cf);}};module['exports']=SmsQueue;
\ No newline at end of file
+var _0x6e16=['emit','sms_queue:save','exports','util','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','map','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e16,0x1d3));var _0x66e1=function(_0x1443f2,_0xf857b6){_0x1443f2=_0x1443f2-0x0;var _0x45d96a=_0x6e16[_0x1443f2];return _0x45d96a;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x66e1('0x0'));var Redis=require('ioredis');var config=require(_0x66e1('0x1'));config['redis']=_[_0x66e1('0x2')](config[_0x66e1('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x66e1('0x4'))(new Redis(config['redis']));function SmsQueue(_0x46894a){this['id']=_0x46894a['id']||0x0;this[_0x66e1('0x5')]=_0x46894a[_0x66e1('0x5')]||'';this['timeout']=_0x46894a[_0x66e1('0x6')]||0xa;this[_0x66e1('0x7')]=_0x46894a[_0x66e1('0x7')]||_0x66e1('0x8');this[_0x66e1('0x9')]=_0x46894a[_0x66e1('0x9')];this[_0x66e1('0xa')]={};this[_0x66e1('0xb')]=0x0;this[_0x66e1('0xc')]='';this[_0x66e1('0xd')]();this[_0x66e1('0xe')]();}SmsQueue[_0x66e1('0xf')][_0x66e1('0xd')]=function(){var _0x412648=this['mapAgentsId']['_rr'];this[_0x66e1('0xa')]=_[_0x66e1('0x10')](this[_0x66e1('0x9')],'id');this['mapAgentsId']['_rr']=_0x412648;};SmsQueue[_0x66e1('0xf')]['updateRealtime']=function(){this[_0x66e1('0x11')]=0x0;this[_0x66e1('0x12')]=0x0;for(var _0x5b802b=0x0;_0x5b802b<this[_0x66e1('0x9')][_0x66e1('0x13')];_0x5b802b+=0x1){if(this['Agents'][_0x5b802b][_0x66e1('0x14')]){this[_0x66e1('0x11')]+=0x1;}if(this[_0x66e1('0x9')][_0x5b802b][_0x66e1('0x15')]){this['paused']+=0x1;}}this[_0x66e1('0x16')]=this[_0x66e1('0x11')]-this[_0x66e1('0x12')];this[_0x66e1('0x16')]=this[_0x66e1('0x16')]>=0x0?this['available']:0x0;var _0x590552={'id':this['id'],'available':this[_0x66e1('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x66e1('0x5')],'paused':this[_0x66e1('0x12')],'waiting':this[_0x66e1('0xb')]};var _0x1792a5=md5(JSON[_0x66e1('0x17')](_0x590552));if(this['md5']!==_0x1792a5){this[_0x66e1('0xc')]=_0x1792a5;io['to'](util[_0x66e1('0x18')](_0x66e1('0x19'),_0x590552[_0x66e1('0x5')]))[_0x66e1('0x1a')](_0x66e1('0x1b'),_0x590552);}};module[_0x66e1('0x1c')]=SmsQueue;
\ No newline at end of file
index b87d055..c0777d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda4e=['../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','map','prototype','paused','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','exports','lodash','md5','util','ioredis'];(function(_0x3eb211,_0x4a2e7f){var _0xb32a15=function(_0xff52ec){while(--_0xff52ec){_0x3eb211['push'](_0x3eb211['shift']());}};_0xb32a15(++_0x4a2e7f);}(_0xda4e,0xef));var _0xeda4=function(_0x2c3c23,_0x3609b5){_0x2c3c23=_0x2c3c23-0x0;var _0x24e0ee=_0xda4e[_0x2c3c23];return _0x24e0ee;};'use strict';var _=require(_0xeda4('0x0'));var md5=require(_0xeda4('0x1'));var util=require(_0xeda4('0x2'));var Redis=require(_0xeda4('0x3'));var config=require(_0xeda4('0x4'));config[_0xeda4('0x5')]=_[_0xeda4('0x6')](config['redis'],{'host':_0xeda4('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xeda4('0x5')]));function WhatsappQueue(_0x548ad0){this['id']=_0x548ad0['id']||0x0;this[_0xeda4('0x8')]=_0x548ad0['name']||'';this[_0xeda4('0x9')]=_0x548ad0[_0xeda4('0x9')]||0xa;this[_0xeda4('0xa')]=_0x548ad0[_0xeda4('0xa')]||'beepall';this[_0xeda4('0xb')]=_0x548ad0[_0xeda4('0xb')];this[_0xeda4('0xc')]={};this[_0xeda4('0xd')]=0x0;this[_0xeda4('0x1')]='';this[_0xeda4('0xe')]();this[_0xeda4('0xf')]();}WhatsappQueue['prototype'][_0xeda4('0xe')]=function(){var _0x20ed17=this[_0xeda4('0xc')]['_rr'];this[_0xeda4('0xc')]=_[_0xeda4('0x10')](this['Agents'],'id');this[_0xeda4('0xc')]['_rr']=_0x20ed17;};WhatsappQueue[_0xeda4('0x11')][_0xeda4('0xf')]=function(){this['loggedIn']=0x0;this[_0xeda4('0x12')]=0x0;for(var _0x5772fd=0x0;_0x5772fd<this['Agents']['length'];_0x5772fd+=0x1){if(this['Agents'][_0x5772fd][_0xeda4('0x13')]){this[_0xeda4('0x14')]+=0x1;}if(this[_0xeda4('0xb')][_0x5772fd][_0xeda4('0x15')]){this[_0xeda4('0x12')]+=0x1;}}this[_0xeda4('0x16')]=this['loggedIn']-this[_0xeda4('0x12')];this[_0xeda4('0x16')]=this['available']>=0x0?this[_0xeda4('0x16')]:0x0;var _0x2863b7={'id':this['id'],'available':this['available'],'loggedIn':this[_0xeda4('0x14')],'name':this[_0xeda4('0x8')],'paused':this[_0xeda4('0x12')],'waiting':this[_0xeda4('0xd')]};var _0x2f7759=md5(JSON[_0xeda4('0x17')](_0x2863b7));if(this[_0xeda4('0x1')]!==_0x2f7759){this[_0xeda4('0x1')]=_0x2f7759;io['to'](util[_0xeda4('0x18')](_0xeda4('0x19'),_0x2863b7[_0xeda4('0x8')]))['emit']('whatsapp_queue:save',_0x2863b7);}};module[_0xeda4('0x1a')]=WhatsappQueue;
\ No newline at end of file
+var _0x80c0=['Agents','mapAgentsId','updateRouting','prototype','map','_rr','loggedIn','paused','length','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall'];(function(_0x51dcce,_0x415159){var _0x3b9939=function(_0x57db10){while(--_0x57db10){_0x51dcce['push'](_0x51dcce['shift']());}};_0x3b9939(++_0x415159);}(_0x80c0,0x117));var _0x080c=function(_0xb1964f,_0x132e2a){_0xb1964f=_0xb1964f-0x0;var _0x133f05=_0x80c0[_0xb1964f];return _0x133f05;};'use strict';var _=require(_0x080c('0x0'));var md5=require(_0x080c('0x1'));var util=require('util');var Redis=require(_0x080c('0x2'));var config=require(_0x080c('0x3'));config['redis']=_[_0x080c('0x4')](config[_0x080c('0x5')],{'host':_0x080c('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x080c('0x5')]));function WhatsappQueue(_0x31718e){this['id']=_0x31718e['id']||0x0;this[_0x080c('0x7')]=_0x31718e['name']||'';this['timeout']=_0x31718e[_0x080c('0x8')]||0xa;this[_0x080c('0x9')]=_0x31718e[_0x080c('0x9')]||_0x080c('0xa');this[_0x080c('0xb')]=_0x31718e['Agents'];this[_0x080c('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x080c('0xd')]();this['updateRealtime']();}WhatsappQueue[_0x080c('0xe')][_0x080c('0xd')]=function(){var _0x452f96=this[_0x080c('0xc')]['_rr'];this[_0x080c('0xc')]=_[_0x080c('0xf')](this[_0x080c('0xb')],'id');this[_0x080c('0xc')][_0x080c('0x10')]=_0x452f96;};WhatsappQueue['prototype']['updateRealtime']=function(){this[_0x080c('0x11')]=0x0;this[_0x080c('0x12')]=0x0;for(var _0x443b02=0x0;_0x443b02<this[_0x080c('0xb')][_0x080c('0x13')];_0x443b02+=0x1){if(this[_0x080c('0xb')][_0x443b02]['online']){this[_0x080c('0x11')]+=0x1;}if(this[_0x080c('0xb')][_0x443b02][_0x080c('0x14')]){this[_0x080c('0x12')]+=0x1;}}this[_0x080c('0x15')]=this[_0x080c('0x11')]-this[_0x080c('0x12')];this[_0x080c('0x15')]=this[_0x080c('0x15')]>=0x0?this[_0x080c('0x15')]:0x0;var _0x4cb426={'id':this['id'],'available':this[_0x080c('0x15')],'loggedIn':this[_0x080c('0x11')],'name':this['name'],'paused':this[_0x080c('0x12')],'waiting':this[_0x080c('0x16')]};var _0x384946=md5(JSON[_0x080c('0x17')](_0x4cb426));if(this[_0x080c('0x1')]!==_0x384946){this['md5']=_0x384946;io['to'](util[_0x080c('0x18')](_0x080c('0x19'),_0x4cb426[_0x080c('0x7')]))[_0x080c('0x1a')](_0x080c('0x1b'),_0x4cb426);}};module[_0x080c('0x1c')]=WhatsappQueue;
\ No newline at end of file
index 3ee9da0..f0d5c49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x15240a,_0x3c12cd){var _0x65e216=function(_0x23332a){while(--_0x23332a){_0x15240a['push'](_0x15240a['shift']());}};_0x65e216(++_0x3c12cd);}(_0xb10b,0x12a));var _0xbb10=function(_0x2570b1,_0x3fed7f){_0x2570b1=_0x2570b1-0x0;var _0x5b4e74=_0xb10b[_0x2570b1];return _0x5b4e74;};'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 3cbf30e..24f60c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd49b=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x428788,_0x3beaab){var _0x12172a=function(_0x50c402){while(--_0x50c402){_0x428788['push'](_0x428788['shift']());}};_0x12172a(++_0x3beaab);}(_0xd49b,0x1f4));var _0xbd49=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0xd49b[_0x41bdd4];return _0x5c03a6;};'use strict';var client=require(_0xbd49('0x0'));exports['update']=function(_0x3a4322,_0xc35bb3){return client[_0xbd49('0x1')](_0xbd49('0x2'),{'body':_0xc35bb3,'options':{'where':{'id':_0x3a4322}},'log':_0xbd49('0x3')});};exports['addTags']=function(_0x4151a9,_0x49a6b1){return client['Request'](_0xbd49('0x4'),{'body':_0x49a6b1,'options':{'where':{'id':_0x4151a9}},'log':_0xbd49('0x5')});};
\ No newline at end of file
+var _0x6e4d=['../client','update','Request','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x40da6f,_0x4953b4){var _0x24246a=function(_0x13c4fc){while(--_0x13c4fc){_0x40da6f['push'](_0x40da6f['shift']());}};_0x24246a(++_0x4953b4);}(_0x6e4d,0x114));var _0xd6e4=function(_0x2792ef,_0x459a02){_0x2792ef=_0x2792ef-0x0;var _0x1d6d06=_0x6e4d[_0x2792ef];return _0x1d6d06;};'use strict';var client=require(_0xd6e4('0x0'));exports[_0xd6e4('0x1')]=function(_0xf2b58b,_0x3139bd){return client[_0xd6e4('0x2')]('UpdateChatInteraction',{'body':_0x3139bd,'options':{'where':{'id':_0xf2b58b}},'log':'updateChatInteraction'});};exports[_0xd6e4('0x3')]=function(_0x4f401c,_0xf5d2c9){return client['Request'](_0xd6e4('0x4'),{'body':_0xf5d2c9,'options':{'where':{'id':_0x4f401c}},'log':_0xd6e4('0x5')});};
\ No newline at end of file
index 4c73fb0..d37e1b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7699=['../client','Request','createChatMessage'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x7699,0x13e));var _0x9769=function(_0x1aa883,_0x50f53b){_0x1aa883=_0x1aa883-0x0;var _0x5e9fb5=_0x7699[_0x1aa883];return _0x5e9fb5;};'use strict';var client=require(_0x9769('0x0'));exports['create']=function(_0x57e3b9){return client[_0x9769('0x1')]('CreateChatMessage',{'body':_0x57e3b9,'log':_0x9769('0x2')});};
\ No newline at end of file
+var _0x7f7f=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x675fb0,_0xba4ffe){var _0x45b62e=function(_0x45614d){while(--_0x45614d){_0x675fb0['push'](_0x675fb0['shift']());}};_0x45b62e(++_0xba4ffe);}(_0x7f7f,0xb7));var _0xf7f7=function(_0x2e440c,_0x1519d2){_0x2e440c=_0x2e440c-0x0;var _0x2671d0=_0x7f7f[_0x2e440c];return _0x2671d0;};'use strict';var client=require(_0xf7f7('0x0'));exports[_0xf7f7('0x1')]=function(_0x498327){return client[_0xf7f7('0x2')](_0xf7f7('0x3'),{'body':_0x498327,'log':_0xf7f7('0x4')});};
\ No newline at end of file
index 17c5787..cea3758 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1052=['strategy','User','Agents','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x1052,0xf4));var _0x2105=function(_0x3cb86b,_0x3c75f6){_0x3cb86b=_0x3cb86b-0x0;var _0x3c10a0=_0x1052[_0x3cb86b];return _0x3c10a0;};'use strict';var client=require(_0x2105('0x0'));exports[_0x2105('0x1')]=function(){return function(){return client[_0x2105('0x2')](_0x2105('0x3'),{'options':{'raw':![],'attributes':['id',_0x2105('0x4'),_0x2105('0x5'),_0x2105('0x6')],'include':[{'model':_0x2105('0x7'),'as':_0x2105('0x8'),'attributes':['id','name','online',_0x2105('0x9')]}]},'log':'getChatQueues'});};};
\ No newline at end of file
+var _0x740a=['GetChatQueue','name','timeout','strategy','User','../client','getChatQueues','Request'];(function(_0x516002,_0x241c22){var _0x230e35=function(_0x419fdd){while(--_0x419fdd){_0x516002['push'](_0x516002['shift']());}};_0x230e35(++_0x241c22);}(_0x740a,0x175));var _0xa740=function(_0x194db2,_0x539750){_0x194db2=_0x194db2-0x0;var _0x15b2ca=_0x740a[_0x194db2];return _0x15b2ca;};'use strict';var client=require(_0xa740('0x0'));exports[_0xa740('0x1')]=function(){return function(){return client[_0xa740('0x2')](_0xa740('0x3'),{'options':{'raw':![],'attributes':['id',_0xa740('0x4'),_0xa740('0x5'),_0xa740('0x6')],'include':[{'model':_0xa740('0x7'),'as':'Agents','attributes':['id',_0xa740('0x4'),'online','chatPause']}]},'log':_0xa740('0x1')});};};
\ No newline at end of file
index 28254d5..e8747e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f10=['update','Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5f10,0xd5));var _0x05f1=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0x5f10[_0xee5d2a];return _0x346948;};'use strict';var client=require(_0x05f1('0x0'));exports[_0x05f1('0x1')]=function(_0x4ce609){return client['Request']('CreateChatQueueReport',{'body':_0x4ce609,'log':_0x05f1('0x2')});};exports[_0x05f1('0x3')]=function(_0x2eaff1,_0xcb88e1){return client[_0x05f1('0x4')](_0x05f1('0x5'),{'body':_0xcb88e1,'options':{'where':{'uniqueid':_0x2eaff1},'order':[['id','DESC']],'limit':0x1},'log':_0x05f1('0x5')});};
\ No newline at end of file
+var _0x5fc7=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x1da3ef,_0x26db1d){var _0x55f8bf=function(_0x34de84){while(--_0x34de84){_0x1da3ef['push'](_0x1da3ef['shift']());}};_0x55f8bf(++_0x26db1d);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x5fc7[_0x54defc];return _0x1955d3;};'use strict';var client=require(_0x75fc('0x0'));exports[_0x75fc('0x1')]=function(_0x13ae0d){return client[_0x75fc('0x2')](_0x75fc('0x3'),{'body':_0x13ae0d,'log':_0x75fc('0x3')});};exports[_0x75fc('0x4')]=function(_0x34103c,_0x756c32){return client[_0x75fc('0x2')](_0x75fc('0x5'),{'body':_0x756c32,'options':{'where':{'uniqueid':_0x34103c},'order':[['id',_0x75fc('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});};
\ No newline at end of file
index 61930bc..2d7159b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0x7a54,0x106));var _0x47a5=function(_0xc21fa1,_0x26b005){_0xc21fa1=_0xc21fa1-0x0;var _0x84f141=_0x7a54[_0xc21fa1];return _0x84f141;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
+var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x43c5cc,_0x228c2a){var _0x1d2cf8=function(_0x167d12){while(--_0x167d12){_0x43c5cc['push'](_0x43c5cc['shift']());}};_0x1d2cf8(++_0x228c2a);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
index f41a4c7..3faa2d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca0a=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x1cee55,_0xe75188){var _0x4f640a=function(_0x550c43){while(--_0x550c43){_0x1cee55['push'](_0x1cee55['shift']());}};_0x4f640a(++_0xe75188);}(_0xca0a,0x1bf));var _0xaca0=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xca0a[_0xe66cf2];return _0x2d84e7;};'use strict';var client=require(_0xaca0('0x0'));exports[_0xaca0('0x1')]=function(_0x4a3a7b){return client[_0xaca0('0x2')](_0xaca0('0x3'),{'body':_0x4a3a7b,'log':_0xaca0('0x4')});};
\ No newline at end of file
+var _0x2f8d=['createFaxMessage','../client','create'];(function(_0x35c506,_0x18351c){var _0x4d025c=function(_0x4f8b02){while(--_0x4f8b02){_0x35c506['push'](_0x35c506['shift']());}};_0x4d025c(++_0x18351c);}(_0x2f8d,0x1cc));var _0xd2f8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2f8d[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0xd2f8('0x0'));exports[_0xd2f8('0x1')]=function(_0x1037cd){return client['Request']('CreateFaxMessage',{'body':_0x1037cd,'log':_0xd2f8('0x2')});};
\ No newline at end of file
index c5f288f..bc4255d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8efa=['Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','strategy','User'];(function(_0x38aa1d,_0x4faf18){var _0x2fb75d=function(_0x14ee14){while(--_0x14ee14){_0x38aa1d['push'](_0x38aa1d['shift']());}};_0x2fb75d(++_0x4faf18);}(_0x8efa,0xc1));var _0xa8ef=function(_0x56b6dc,_0x10a5b3){_0x56b6dc=_0x56b6dc-0x0;var _0x40a5e9=_0x8efa[_0x56b6dc];return _0x40a5e9;};'use strict';var client=require(_0xa8ef('0x0'));exports[_0xa8ef('0x1')]=function(){return function(){return client[_0xa8ef('0x2')](_0xa8ef('0x3'),{'options':{'raw':![],'attributes':['id',_0xa8ef('0x4'),'timeout',_0xa8ef('0x5')],'include':[{'model':_0xa8ef('0x6'),'as':_0xa8ef('0x7'),'attributes':['id',_0xa8ef('0x4'),_0xa8ef('0x8'),_0xa8ef('0x9')]}]},'log':_0xa8ef('0x1')});};};
\ No newline at end of file
+var _0x0b55=['getFaxQueues','GetFaxQueue','name','timeout','Agents','online','faxPause'];(function(_0x2b6d5d,_0x176399){var _0x2ea6e0=function(_0xc37931){while(--_0xc37931){_0x2b6d5d['push'](_0x2b6d5d['shift']());}};_0x2ea6e0(++_0x176399);}(_0x0b55,0x1b9));var _0x50b5=function(_0x3c3db6,_0x572ecb){_0x3c3db6=_0x3c3db6-0x0;var _0x51f851=_0x0b55[_0x3c3db6];return _0x51f851;};'use strict';var client=require('../client');exports[_0x50b5('0x0')]=function(){return function(){return client['Request'](_0x50b5('0x1'),{'options':{'raw':![],'attributes':['id',_0x50b5('0x2'),_0x50b5('0x3'),'strategy'],'include':[{'model':'User','as':_0x50b5('0x4'),'attributes':['id',_0x50b5('0x2'),_0x50b5('0x5'),_0x50b5('0x6')]}]},'log':_0x50b5('0x0')});};};
\ No newline at end of file
index db98baa..41443fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cf1=['create','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x4b70da,_0x406594){var _0x5dcdb8=function(_0x9153e3){while(--_0x9153e3){_0x4b70da['push'](_0x4b70da['shift']());}};_0x5dcdb8(++_0x406594);}(_0x8cf1,0x83));var _0x18cf=function(_0x2f2b97,_0x1db275){_0x2f2b97=_0x2f2b97-0x0;var _0x566a05=_0x8cf1[_0x2f2b97];return _0x566a05;};'use strict';var client=require(_0x18cf('0x0'));exports[_0x18cf('0x1')]=function(_0x197777){return client['Request']('CreateFaxQueueReport',{'body':_0x197777,'log':_0x18cf('0x2')});};exports[_0x18cf('0x3')]=function(_0x4bf1b0,_0x2536b6){return client['Request'](_0x18cf('0x4'),{'body':_0x2536b6,'options':{'where':{'uniqueid':_0x4bf1b0},'order':[['id',_0x18cf('0x5')]],'limit':0x1},'log':_0x18cf('0x4')});};
\ No newline at end of file
+var _0xbb77=['Request','update','UpdateFaxQueueReport','DESC'];(function(_0x44d348,_0x538e7a){var _0x1dd512=function(_0x5f9fbc){while(--_0x5f9fbc){_0x44d348['push'](_0x44d348['shift']());}};_0x1dd512(++_0x538e7a);}(_0xbb77,0x8c));var _0x7bb7=function(_0x3e0779,_0x3f5c8d){_0x3e0779=_0x3e0779-0x0;var _0x1ee99e=_0xbb77[_0x3e0779];return _0x1ee99e;};'use strict';var client=require('../client');exports['create']=function(_0x10c85f){return client[_0x7bb7('0x0')]('CreateFaxQueueReport',{'body':_0x10c85f,'log':'CreateFaxQueueReport'});};exports[_0x7bb7('0x1')]=function(_0xae8472,_0x507a98){return client[_0x7bb7('0x0')](_0x7bb7('0x2'),{'body':_0x507a98,'options':{'where':{'uniqueid':_0xae8472},'order':[['id',_0x7bb7('0x3')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
index d9abb79..87419fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa09d=['name','interval','getIntervals','../client','Request','GetInterval','Interval','Intervals'];(function(_0x1365e0,_0x139a9a){var _0x108557=function(_0x543b0e){while(--_0x543b0e){_0x1365e0['push'](_0x1365e0['shift']());}};_0x108557(++_0x139a9a);}(_0xa09d,0xdb));var _0xda09=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xa09d[_0xef8146];return _0x5a6cb0;};'use strict';var client=require(_0xda09('0x0'));exports['getIntervals']=function(){return function(){return client[_0xda09('0x1')](_0xda09('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xda09('0x3'),'as':_0xda09('0x4'),'attributes':['id',_0xda09('0x5'),_0xda09('0x6')]}]},'log':_0xda09('0x7')});};};
\ No newline at end of file
+var _0x7027=['GetInterval','name','Intervals','../client','getIntervals','Request'];(function(_0x364e23,_0x150ecb){var _0x1f7948=function(_0x300e99){while(--_0x300e99){_0x364e23['push'](_0x364e23['shift']());}};_0x1f7948(++_0x150ecb);}(_0x7027,0x165));var _0x7702=function(_0x262bfa,_0x1865eb){_0x262bfa=_0x262bfa-0x0;var _0x222938=_0x7027[_0x262bfa];return _0x222938;};'use strict';var client=require(_0x7702('0x0'));exports[_0x7702('0x1')]=function(){return function(){return client[_0x7702('0x2')](_0x7702('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7702('0x4')],'include':[{'model':'Interval','as':_0x7702('0x5'),'attributes':['id','name','interval']}]},'log':_0x7702('0x1')});};};
\ No newline at end of file
index fada747..2d4fafc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77e6=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0x77e6,0x1a6));var _0x677e=function(_0x38845c,_0x24aefb){_0x38845c=_0x38845c-0x0;var _0x71da99=_0x77e6[_0x38845c];return _0x71da99;};'use strict';var client=require(_0x677e('0x0'));exports[_0x677e('0x1')]=function(_0x3855c7,_0xa48f0c){return client[_0x677e('0x2')](_0x677e('0x3'),{'body':_0xa48f0c,'options':{'where':{'id':_0x3855c7}},'log':_0x677e('0x4')});};exports[_0x677e('0x5')]=function(_0x50231c,_0x2f0307){return client[_0x677e('0x2')]('AddTagsToMailInteraction',{'body':_0x2f0307,'options':{'where':{'id':_0x50231c}},'log':_0x677e('0x6')});};
\ No newline at end of file
+var _0x6343=['AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x448772,_0xfafbc3){var _0x4a6f03=function(_0x103e01){while(--_0x103e01){_0x448772['push'](_0x448772['shift']());}};_0x4a6f03(++_0xfafbc3);}(_0x6343,0x168));var _0x3634=function(_0x362479,_0x1ab2c1){_0x362479=_0x362479-0x0;var _0x3c8f72=_0x6343[_0x362479];return _0x3c8f72;};'use strict';var client=require('../client');exports['update']=function(_0x35bd8f,_0x26d852){return client['Request']('UpdateMailInteraction',{'body':_0x26d852,'options':{'where':{'id':_0x35bd8f}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x403aba,_0x420510){return client['Request'](_0x3634('0x0'),{'body':_0x420510,'options':{'where':{'id':_0x403aba}},'log':_0x3634('0x1')});};
\ No newline at end of file
index 8c4f51e..cee3e4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9615=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x58de1d,_0x3ffdad){var _0x338640=function(_0x1b8267){while(--_0x1b8267){_0x58de1d['push'](_0x58de1d['shift']());}};_0x338640(++_0x3ffdad);}(_0x9615,0x86));var _0x5961=function(_0x140666,_0xbe5732){_0x140666=_0x140666-0x0;var _0x446463=_0x9615[_0x140666];return _0x446463;};'use strict';var client=require(_0x5961('0x0'));exports[_0x5961('0x1')]=function(_0x137856){return client[_0x5961('0x2')](_0x5961('0x3'),{'body':_0x137856,'log':_0x5961('0x4')});};
\ No newline at end of file
+var _0x92c5=['Request','CreateMailMessage','createMailMessage','../client'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x92c5,0xdb));var _0x592c=function(_0x38a069,_0x1b4c5c){_0x38a069=_0x38a069-0x0;var _0x33455a=_0x92c5[_0x38a069];return _0x33455a;};'use strict';var client=require(_0x592c('0x0'));exports['create']=function(_0x18ed82){return client[_0x592c('0x1')](_0x592c('0x2'),{'body':_0x18ed82,'log':_0x592c('0x3')});};
\ No newline at end of file
index 6e15a56..1e62fd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c1=['User','Agents','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe0c1,0x175));var _0x1e0c=function(_0x38e5c4,_0x49981a){_0x38e5c4=_0x38e5c4-0x0;var _0x2c75f1=_0xe0c1[_0x38e5c4];return _0x2c75f1;};'use strict';var client=require(_0x1e0c('0x0'));exports[_0x1e0c('0x1')]=function(){return function(){return client[_0x1e0c('0x2')](_0x1e0c('0x3'),{'options':{'raw':![],'attributes':['id',_0x1e0c('0x4'),_0x1e0c('0x5'),_0x1e0c('0x6')],'include':[{'model':_0x1e0c('0x7'),'as':_0x1e0c('0x8'),'attributes':['id',_0x1e0c('0x4'),'online',_0x1e0c('0x9')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
+var _0x5225=['online','mailPause','getMailQueues','../client','Request','strategy','User','Agents','name'];(function(_0x1f39f4,_0x34f46b){var _0x5ea637=function(_0x4f6226){while(--_0x4f6226){_0x1f39f4['push'](_0x1f39f4['shift']());}};_0x5ea637(++_0x34f46b);}(_0x5225,0x66));var _0x5522=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x5225[_0x349148];return _0x2f2b0f;};'use strict';var client=require(_0x5522('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x5522('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x5522('0x2')],'include':[{'model':_0x5522('0x3'),'as':_0x5522('0x4'),'attributes':['id',_0x5522('0x5'),_0x5522('0x6'),_0x5522('0x7')]}]},'log':_0x5522('0x8')});};};
\ No newline at end of file
index 0303439..861bab9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e73=['create','Request','update','DESC','UpdateMailQueueReport','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e73,0x89));var _0x32e7=function(_0x2998db,_0x3424f1){_0x2998db=_0x2998db-0x0;var _0x115fea=_0x2e73[_0x2998db];return _0x115fea;};'use strict';var client=require(_0x32e7('0x0'));exports[_0x32e7('0x1')]=function(_0x3468d7){return client[_0x32e7('0x2')]('CreateMailQueueReport',{'body':_0x3468d7,'log':'CreateMailQueueReport'});};exports[_0x32e7('0x3')]=function(_0x36bfb1,_0x33f849){return client[_0x32e7('0x2')]('UpdateMailQueueReport',{'body':_0x33f849,'options':{'where':{'uniqueid':_0x36bfb1},'order':[['id',_0x32e7('0x4')]],'limit':0x1},'log':_0x32e7('0x5')});};
\ No newline at end of file
+var _0xe3b8=['../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport','DESC'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe3b8,0x10e));var _0x8e3b=function(_0x2744eb,_0x2a1f98){_0x2744eb=_0x2744eb-0x0;var _0x483e2e=_0xe3b8[_0x2744eb];return _0x483e2e;};'use strict';var client=require(_0x8e3b('0x0'));exports[_0x8e3b('0x1')]=function(_0x3d27b1){return client[_0x8e3b('0x2')](_0x8e3b('0x3'),{'body':_0x3d27b1,'log':_0x8e3b('0x3')});};exports['update']=function(_0x5d8fbb,_0x193faf){return client[_0x8e3b('0x2')](_0x8e3b('0x4'),{'body':_0x193faf,'options':{'where':{'uniqueid':_0x5d8fbb},'order':[['id',_0x8e3b('0x5')]],'limit':0x1},'log':_0x8e3b('0x4')});};
\ No newline at end of file
index ad22636..662c6bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdba9=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client','update'];(function(_0x4754a1,_0x390f25){var _0x3240a3=function(_0x1ab36f){while(--_0x1ab36f){_0x4754a1['push'](_0x4754a1['shift']());}};_0x3240a3(++_0x390f25);}(_0xdba9,0xad));var _0x9dba=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0xdba9[_0x122e9b];return _0x22c247;};'use strict';var client=require(_0x9dba('0x0'));exports[_0x9dba('0x1')]=function(_0x27d4ae,_0x58f54){return client[_0x9dba('0x2')](_0x9dba('0x3'),{'body':_0x58f54,'options':{'where':{'id':_0x27d4ae}},'log':_0x9dba('0x4')});};exports[_0x9dba('0x5')]=function(_0x49693f,_0xa0bc27){return client[_0x9dba('0x2')](_0x9dba('0x6'),{'body':_0xa0bc27,'options':{'where':{'id':_0x49693f}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0xfdd2=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x1cbf4b,_0x645d4a){var _0x5bb944=function(_0x4180a1){while(--_0x4180a1){_0x1cbf4b['push'](_0x1cbf4b['shift']());}};_0x5bb944(++_0x645d4a);}(_0xfdd2,0x109));var _0x2fdd=function(_0x4032e3,_0x6d6449){_0x4032e3=_0x4032e3-0x0;var _0x34f51a=_0xfdd2[_0x4032e3];return _0x34f51a;};'use strict';var client=require('../client');exports[_0x2fdd('0x0')]=function(_0x55f707,_0x599332){return client[_0x2fdd('0x1')](_0x2fdd('0x2'),{'body':_0x599332,'options':{'where':{'id':_0x55f707}},'log':'updateOpenchannelInteraction'});};exports[_0x2fdd('0x3')]=function(_0x1480e6,_0x265061){return client[_0x2fdd('0x1')](_0x2fdd('0x4'),{'body':_0x265061,'options':{'where':{'id':_0x1480e6}},'log':_0x2fdd('0x5')});};
\ No newline at end of file
index 3904334..d610b24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffae=['../client','CreateOpenchannelMessage'];(function(_0x770f7,_0x3af003){var _0xe797c6=function(_0x47d92a){while(--_0x47d92a){_0x770f7['push'](_0x770f7['shift']());}};_0xe797c6(++_0x3af003);}(_0xffae,0xec));var _0xeffa=function(_0x3de79c,_0x517195){_0x3de79c=_0x3de79c-0x0;var _0xefe69b=_0xffae[_0x3de79c];return _0xefe69b;};'use strict';var client=require(_0xeffa('0x0'));exports['create']=function(_0x4e70d7){return client['Request'](_0xeffa('0x1'),{'body':_0x4e70d7,'log':'createOpenchannelMessage'});};
\ No newline at end of file
+var _0x291d=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x38bb34,_0x2e1c6b){var _0xdf1945=function(_0x24b6ba){while(--_0x24b6ba){_0x38bb34['push'](_0x38bb34['shift']());}};_0xdf1945(++_0x2e1c6b);}(_0x291d,0x177));var _0xd291=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x291d[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0xd291('0x0'));exports[_0xd291('0x1')]=function(_0x15e328){return client[_0xd291('0x2')](_0xd291('0x3'),{'body':_0x15e328,'log':_0xd291('0x4')});};
\ No newline at end of file
index 6d45a9e..162a880 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe608=['User','Agents','online','../client','getOpenchannelQueues','GetOpenchannelQueue','name'];(function(_0x446f7c,_0x1871e2){var _0x3d6bd3=function(_0x1bf725){while(--_0x1bf725){_0x446f7c['push'](_0x446f7c['shift']());}};_0x3d6bd3(++_0x1871e2);}(_0xe608,0x129));var _0x8e60=function(_0x507c81,_0x3e1b56){_0x507c81=_0x507c81-0x0;var _0x368a25=_0xe608[_0x507c81];return _0x368a25;};'use strict';var client=require(_0x8e60('0x0'));exports[_0x8e60('0x1')]=function(){return function(){return client['Request'](_0x8e60('0x2'),{'options':{'raw':![],'attributes':['id',_0x8e60('0x3'),'timeout','strategy'],'include':[{'model':_0x8e60('0x4'),'as':_0x8e60('0x5'),'attributes':['id','name',_0x8e60('0x6'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};};
\ No newline at end of file
+var _0x55ea=['User','Agents','online','../client','getOpenchannelQueues','Request','name','timeout','strategy'];(function(_0x226dd1,_0xbcfdac){var _0x2ca68b=function(_0x4c704f){while(--_0x4c704f){_0x226dd1['push'](_0x226dd1['shift']());}};_0x2ca68b(++_0xbcfdac);}(_0x55ea,0xc9));var _0xa55e=function(_0x1d5ba5,_0x34ce73){_0x1d5ba5=_0x1d5ba5-0x0;var _0x47010e=_0x55ea[_0x1d5ba5];return _0x47010e;};'use strict';var client=require(_0xa55e('0x0'));exports[_0xa55e('0x1')]=function(){return function(){return client[_0xa55e('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xa55e('0x3'),_0xa55e('0x4'),_0xa55e('0x5')],'include':[{'model':_0xa55e('0x6'),'as':_0xa55e('0x7'),'attributes':['id','name',_0xa55e('0x8'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};};
\ No newline at end of file
index 24304de..8ba7e3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3bb=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x10db16,_0x154cce){var _0x5c30ff=function(_0x1145a0){while(--_0x1145a0){_0x10db16['push'](_0x10db16['shift']());}};_0x5c30ff(++_0x154cce);}(_0xf3bb,0x129));var _0xbf3b=function(_0x44ca81,_0x1c0f99){_0x44ca81=_0x44ca81-0x0;var _0x19280f=_0xf3bb[_0x44ca81];return _0x19280f;};'use strict';var client=require(_0xbf3b('0x0'));exports[_0xbf3b('0x1')]=function(_0x1a20fd){return client[_0xbf3b('0x2')](_0xbf3b('0x3'),{'body':_0x1a20fd,'log':_0xbf3b('0x3')});};exports['update']=function(_0x3f098e,_0x2a31df){return client[_0xbf3b('0x2')](_0xbf3b('0x4'),{'body':_0x2a31df,'options':{'where':{'uniqueid':_0x3f098e},'order':[['id',_0xbf3b('0x5')]],'limit':0x1},'log':_0xbf3b('0x4')});};
\ No newline at end of file
+var _0x1a5b=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x216682,_0x455e5b){var _0x542971=function(_0x531ab6){while(--_0x531ab6){_0x216682['push'](_0x216682['shift']());}};_0x542971(++_0x455e5b);}(_0x1a5b,0x153));var _0xb1a5=function(_0x2f4ac6,_0x2566b1){_0x2f4ac6=_0x2f4ac6-0x0;var _0x58572e=_0x1a5b[_0x2f4ac6];return _0x58572e;};'use strict';var client=require(_0xb1a5('0x0'));exports[_0xb1a5('0x1')]=function(_0x3c320f){return client[_0xb1a5('0x2')](_0xb1a5('0x3'),{'body':_0x3c320f,'log':'CreateOpenchannelQueueReport'});};exports[_0xb1a5('0x4')]=function(_0x264128,_0xf23675){return client[_0xb1a5('0x2')](_0xb1a5('0x5'),{'body':_0xf23675,'options':{'where':{'uniqueid':_0x264128},'order':[['id',_0xb1a5('0x6')]],'limit':0x1},'log':_0xb1a5('0x5')});};
\ No newline at end of file
index a1e7625..8107d5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f17=['updateSmsInteraction','addTags','addTagsToSmsInteraction','../client','UpdateSmsInteraction'];(function(_0x3f1729,_0x299637){var _0x59efe2=function(_0x48541a){while(--_0x48541a){_0x3f1729['push'](_0x3f1729['shift']());}};_0x59efe2(++_0x299637);}(_0x4f17,0x9e));var _0x74f1=function(_0x469ae2,_0x24cd30){_0x469ae2=_0x469ae2-0x0;var _0x5e33e4=_0x4f17[_0x469ae2];return _0x5e33e4;};'use strict';var client=require(_0x74f1('0x0'));exports['update']=function(_0xc7f009,_0xfcf99c){return client['Request'](_0x74f1('0x1'),{'body':_0xfcf99c,'options':{'where':{'id':_0xc7f009}},'log':_0x74f1('0x2')});};exports[_0x74f1('0x3')]=function(_0x62251d,_0x2d1ff2){return client['Request']('AddTagsToSmsInteraction',{'body':_0x2d1ff2,'options':{'where':{'id':_0x62251d}},'log':_0x74f1('0x4')});};
\ No newline at end of file
+var _0xe4d9=['AddTagsToSmsInteraction','../client','update','Request','addTags'];(function(_0x4cb2d2,_0x1d70bb){var _0xe67050=function(_0xbaa1f7){while(--_0xbaa1f7){_0x4cb2d2['push'](_0x4cb2d2['shift']());}};_0xe67050(++_0x1d70bb);}(_0xe4d9,0x141));var _0x9e4d=function(_0x4c9b76,_0x4f5b09){_0x4c9b76=_0x4c9b76-0x0;var _0x500b42=_0xe4d9[_0x4c9b76];return _0x500b42;};'use strict';var client=require(_0x9e4d('0x0'));exports[_0x9e4d('0x1')]=function(_0x1dadc1,_0x484e02){return client[_0x9e4d('0x2')]('UpdateSmsInteraction',{'body':_0x484e02,'options':{'where':{'id':_0x1dadc1}},'log':'updateSmsInteraction'});};exports[_0x9e4d('0x3')]=function(_0x228328,_0x581985){return client[_0x9e4d('0x2')](_0x9e4d('0x4'),{'body':_0x581985,'options':{'where':{'id':_0x228328}},'log':'addTagsToSmsInteraction'});};
\ No newline at end of file
index f218779..dc7ffa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x852c=['createSmsMessage','../client','create','Request'];(function(_0x4a8c45,_0x384f11){var _0x4f57fb=function(_0x3edac5){while(--_0x3edac5){_0x4a8c45['push'](_0x4a8c45['shift']());}};_0x4f57fb(++_0x384f11);}(_0x852c,0x1e5));var _0xc852=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x852c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc852('0x0'));exports[_0xc852('0x1')]=function(_0x5b6a31){return client[_0xc852('0x2')]('CreateSmsMessage',{'body':_0x5b6a31,'log':_0xc852('0x3')});};
\ No newline at end of file
+var _0xdbe4=['create','CreateSmsMessage'];(function(_0xe80a30,_0x50adab){var _0x45ec21=function(_0x47cc86){while(--_0x47cc86){_0xe80a30['push'](_0xe80a30['shift']());}};_0x45ec21(++_0x50adab);}(_0xdbe4,0x17c));var _0x4dbe=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xdbe4[_0x4e676e];return _0x336a3c;};'use strict';var client=require('../client');exports[_0x4dbe('0x0')]=function(_0x5849dd){return client['Request'](_0x4dbe('0x1'),{'body':_0x5849dd,'log':'createSmsMessage'});};
\ No newline at end of file
index 446bedf..e241e86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x437a98,_0x5aba7c){var _0x2eee15=function(_0x1bec59){while(--_0x1bec59){_0x437a98['push'](_0x437a98['shift']());}};_0x2eee15(++_0x5aba7c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x232ec0,_0x45fdd0){_0x232ec0=_0x232ec0-0x0;var _0x356705=_0xcb91[_0x232ec0];return _0x356705;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x484bf4,_0x2b975c){var _0x31c683=function(_0x1cdda2){while(--_0x1cdda2){_0x484bf4['push'](_0x484bf4['shift']());}};_0x31c683(++_0x2b975c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};};
\ No newline at end of file
index 0dd5101..686a667 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x38d309,_0x17e52d){var _0x2cc9b3=function(_0xa13fec){while(--_0xa13fec){_0x38d309['push'](_0x38d309['shift']());}};_0x2cc9b3(++_0x17e52d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});};
\ No newline at end of file
+var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x263a2f,_0x1e81e3){var _0x8020e8=function(_0x39f91a){while(--_0x39f91a){_0x263a2f['push'](_0x263a2f['shift']());}};_0x8020e8(++_0x1e81e3);}(_0xedd9,0xfc));var _0x9edd=function(_0x4a22c5,_0x5ac44b){_0x4a22c5=_0x4a22c5-0x0;var _0x5ba569=_0xedd9[_0x4a22c5];return _0x5ba569;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});};
\ No newline at end of file
index 2aa86ab..ca17df0 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(_0x2bc5ab,_0x5ceb6c){var _0x2c51a6=function(_0x93fd23){while(--_0x93fd23){_0x2bc5ab['push'](_0x2bc5ab['shift']());}};_0x2c51a6(++_0x5ceb6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0xf9332a,_0xb2f99b){var _0x2654ce=function(_0x4f2cb3){while(--_0x4f2cb3){_0xf9332a['push'](_0xf9332a['shift']());}};_0x2654ce(++_0xb2f99b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 086f9f0..9892a69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdded=['../client','update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x3cc625,_0x4e6bc4){var _0x47249c=function(_0x5f352d){while(--_0x5f352d){_0x3cc625['push'](_0x3cc625['shift']());}};_0x47249c(++_0x4e6bc4);}(_0xdded,0x17a));var _0xddde=function(_0x3af92b,_0x14e3e3){_0x3af92b=_0x3af92b-0x0;var _0xdb2df9=_0xdded[_0x3af92b];return _0xdb2df9;};'use strict';var client=require(_0xddde('0x0'));exports[_0xddde('0x1')]=function(_0x2833a6,_0x436a35){return client[_0xddde('0x2')](_0xddde('0x3'),{'body':_0x436a35,'options':{'where':{'id':_0x2833a6}},'log':'updateWhatsappInteraction'});};exports[_0xddde('0x4')]=function(_0x276cc6,_0x44468e){return client[_0xddde('0x2')](_0xddde('0x5'),{'body':_0x44468e,'options':{'where':{'id':_0x276cc6}},'log':_0xddde('0x6')});};
\ No newline at end of file
+var _0x29b1=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0xb96f30,_0x1ec6a1){var _0xd8d174=function(_0x10bb33){while(--_0x10bb33){_0xb96f30['push'](_0xb96f30['shift']());}};_0xd8d174(++_0x1ec6a1);}(_0x29b1,0x13b));var _0x129b=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x29b1[_0x50aa2e];return _0x5e07f0;};'use strict';var client=require('../client');exports['update']=function(_0x18f31b,_0x193a3c){return client[_0x129b('0x0')](_0x129b('0x1'),{'body':_0x193a3c,'options':{'where':{'id':_0x18f31b}},'log':_0x129b('0x2')});};exports[_0x129b('0x3')]=function(_0x404e5a,_0xde8313){return client[_0x129b('0x0')](_0x129b('0x4'),{'body':_0xde8313,'options':{'where':{'id':_0x404e5a}},'log':_0x129b('0x5')});};
\ No newline at end of file
index c11857d..1551d06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5745=['createWhatsappMessage','../client'];(function(_0x3c995f,_0x3cf81c){var _0x1fc960=function(_0xe0fc8){while(--_0xe0fc8){_0x3c995f['push'](_0x3c995f['shift']());}};_0x1fc960(++_0x3cf81c);}(_0x5745,0x199));var _0x5574=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5745[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x5574('0x0'));exports['create']=function(_0x1c9e77){return client['Request']('CreateWhatsappMessage',{'body':_0x1c9e77,'log':_0x5574('0x1')});};
\ No newline at end of file
+var _0x5ca8=['Request','CreateWhatsappMessage','../client','create'];(function(_0xae08f1,_0x5a1a63){var _0x504c81=function(_0x3761e3){while(--_0x3761e3){_0xae08f1['push'](_0xae08f1['shift']());}};_0x504c81(++_0x5a1a63);}(_0x5ca8,0xea));var _0x85ca=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ca8[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x85ca('0x0'));exports[_0x85ca('0x1')]=function(_0xe1abf2){return client[_0x85ca('0x2')](_0x85ca('0x3'),{'body':_0xe1abf2,'log':'createWhatsappMessage'});};
\ No newline at end of file
index 014cf8b..5c2992d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa40d=['getWhatsappQueues','Request','name','timeout','strategy','Agents','online','whatsappPause','../client'];(function(_0x54defc,_0x627178){var _0x1955d3=function(_0x299afe){while(--_0x299afe){_0x54defc['push'](_0x54defc['shift']());}};_0x1955d3(++_0x627178);}(_0xa40d,0x167));var _0xda40=function(_0xc831c6,_0x542b00){_0xc831c6=_0xc831c6-0x0;var _0x5063a7=_0xa40d[_0xc831c6];return _0x5063a7;};'use strict';var client=require(_0xda40('0x0'));exports[_0xda40('0x1')]=function(){return function(){return client[_0xda40('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xda40('0x3'),_0xda40('0x4'),_0xda40('0x5')],'include':[{'model':'User','as':_0xda40('0x6'),'attributes':['id',_0xda40('0x3'),_0xda40('0x7'),_0xda40('0x8')]}]},'log':_0xda40('0x1')});};};
\ No newline at end of file
+var _0xd199=['name','timeout','User','online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue'];(function(_0x122629,_0x11d4b1){var _0x2f278e=function(_0x1d26aa){while(--_0x1d26aa){_0x122629['push'](_0x122629['shift']());}};_0x2f278e(++_0x11d4b1);}(_0xd199,0x1ed));var _0x9d19=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd199[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x9d19('0x0'));exports[_0x9d19('0x1')]=function(){return function(){return client['Request'](_0x9d19('0x2'),{'options':{'raw':![],'attributes':['id',_0x9d19('0x3'),_0x9d19('0x4'),'strategy'],'include':[{'model':_0x9d19('0x5'),'as':'Agents','attributes':['id','name',_0x9d19('0x6'),_0x9d19('0x7')]}]},'log':_0x9d19('0x1')});};};
\ No newline at end of file
index 8535dc7..ea4ff94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2934=['UpdateWhatsappQueueReport','DESC','../client','CreateWhatsappQueueReport','Request'];(function(_0x45f40e,_0x3dc9b0){var _0x107af4=function(_0x4ab911){while(--_0x4ab911){_0x45f40e['push'](_0x45f40e['shift']());}};_0x107af4(++_0x3dc9b0);}(_0x2934,0x89));var _0x4293=function(_0x1965a0,_0x55adeb){_0x1965a0=_0x1965a0-0x0;var _0x4db58c=_0x2934[_0x1965a0];return _0x4db58c;};'use strict';var client=require(_0x4293('0x0'));exports['create']=function(_0x50efaa){return client['Request']('CreateWhatsappQueueReport',{'body':_0x50efaa,'log':_0x4293('0x1')});};exports['update']=function(_0xca19d4,_0x239ba8){return client[_0x4293('0x2')](_0x4293('0x3'),{'body':_0x239ba8,'options':{'where':{'uniqueid':_0xca19d4},'order':[['id',_0x4293('0x4')]],'limit':0x1},'log':_0x4293('0x3')});};
\ No newline at end of file
+var _0xf304=['DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0xedf622,_0x5a854d){var _0x245b71=function(_0x2058a2){while(--_0x2058a2){_0xedf622['push'](_0xedf622['shift']());}};_0x245b71(++_0x5a854d);}(_0xf304,0xa3));var _0x4f30=function(_0x34ebc6,_0x201e65){_0x34ebc6=_0x34ebc6-0x0;var _0x16f800=_0xf304[_0x34ebc6];return _0x16f800;};'use strict';var client=require(_0x4f30('0x0'));exports[_0x4f30('0x1')]=function(_0x24fe50){return client[_0x4f30('0x2')]('CreateWhatsappQueueReport',{'body':_0x24fe50,'log':_0x4f30('0x3')});};exports[_0x4f30('0x4')]=function(_0x2618f5,_0x3a31c3){return client[_0x4f30('0x2')]('UpdateWhatsappQueueReport',{'body':_0x3a31c3,'options':{'where':{'uniqueid':_0x2618f5},'order':[['id',_0x4f30('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
index 887677e..196dc32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37b7=['message','join','stop','find','timeout','atimeout','channel','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','map'];(function(_0x565866,_0x16fec7){var _0x418140=function(_0x7461ac){while(--_0x7461ac){_0x565866['push'](_0x565866['shift']());}};_0x418140(++_0x16fec7);}(_0x37b7,0x9a));var _0x737b=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0x37b7[_0x6e1239];return _0x418150;};'use strict';var schema=require(_0x737b('0x0'));var _=require(_0x737b('0x1'));var util=require(_0x737b('0x2'));var seqqueue=require(_0x737b('0x3'));var logger=require(_0x737b('0x4'))('routing');var strategy=require(_0x737b('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x737b('0x6')},'timeout':{'type':_0x737b('0x7'),'message':_0x737b('0x8')}});function writeLog(_0x5e83ea,_0x42d3cb,_0x5c8cd){return logger['info'](util[_0x737b('0x9')](_0x737b('0xa'),_0x5e83ea,_0x42d3cb[_0x737b('0xb')],_0x5c8cd));}function handleFindAgent(_0x42e0db){return function(_0x1d80fa){return _0x1d80fa[_0x737b('0xb')]['toLowerCase']()===_0x42e0db[_0x737b('0xc')]();};}exports['consequence']=function(_0x2ab70a,_0x2c5814,_0x71d495,_0xb7fe35){return function(_0x3cbbea){try{var _0x147ea3={'name':_0x2c5814[0x0],'timeout':_0x2c5814[0x1]};var _0x212fd9=queue[_0x737b('0x0')](_0x147ea3,{'typecast':!![]});if(_0x212fd9[_0x737b('0xd')]){logger[_0x737b('0xe')]('[%s][AGENT]\x20%s',_0x2ab70a,_[_0x737b('0xf')](_0x212fd9,_0x737b('0x10'))[_0x737b('0x11')](',\x20'));_0x3cbbea[_0x737b('0x12')]();}else{var _0x435759=_[_0x737b('0x13')](_0x71d495['agents'],handleFindAgent(_0x147ea3[_0x737b('0xb')]));if(_0x435759){var _0x1c8683=(_0x147ea3[_0x737b('0x14')]||0xa)*0x3e8;var _0x4829e8,_0x3650c5;var _0x2293b7=seqqueue['createQueue'](_0x1c8683);_0x2293b7['id']=_0x2ab70a;_0x2293b7[_0x737b('0x15')]=_0x1c8683;_0x2293b7[_0x737b('0x16')]=_0xb7fe35[_0x737b('0x16')];writeLog(_0x2ab70a,_0x435759,util[_0x737b('0x9')]('START:%s',_0x1c8683));_0x71d495[_0x737b('0x17')][_0x2ab70a]['on'](_0x737b('0x18'),function(){logger[_0x737b('0x19')](_0x737b('0x1a'),_0x2ab70a);clearTimeout(_0x3650c5);_0x3650c5=undefined;_0x2293b7[_0x737b('0x1b')]();if(_0x71d495['rules'][_0x2ab70a]){delete _0x71d495['rules'][_0x2ab70a];}_0x3cbbea['stop']();});_0x71d495[_0x737b('0x17')][_0x2ab70a]['on'](_0x737b('0x1c'),function(){if(_0x71d495[_0x737b('0x17')][_0x2ab70a]){delete _0x71d495[_0x737b('0x17')][_0x2ab70a];}});_0x3650c5=setTimeout(function(){logger[_0x737b('0x19')](_0x737b('0x1d'),_0x2ab70a);clearTimeout(_0x3650c5);_0x2293b7['close']();_0x3cbbea['next']();},_0x1c8683);strategy['agent'](_0x2293b7,_0x435759,_0x71d495,_0xb7fe35);}else{logger[_0x737b('0xe')](_0x737b('0x1e'),_0x2ab70a,_0x147ea3[_0x737b('0xb')]);_0x3cbbea[_0x737b('0x12')]();}}}catch(_0x1bd58b){console[_0x737b('0x1f')](_0x1bd58b);logger['error'](_0x737b('0x20'),_0x2ab70a,_0x1bd58b[_0x737b('0x21')]);_0x3cbbea['stop']();}};};
\ No newline at end of file
+var _0x44e4=['[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','createQueue','atimeout','START:%s','rules','info','close','complete','[%s][AGENT]\x20ROUTING\x20END','log','validate','lodash','util','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0x44e4,0x9c));var _0x444e=function(_0x6ca7f4,_0x51a5df){_0x6ca7f4=_0x6ca7f4-0x0;var _0x494fa6=_0x44e4[_0x6ca7f4];return _0x494fa6;};'use strict';var schema=require(_0x444e('0x0'));var _=require(_0x444e('0x1'));var util=require(_0x444e('0x2'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0x444e('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x444e('0x4'),'required':!![],'message':_0x444e('0x5')},'timeout':{'type':_0x444e('0x6'),'message':_0x444e('0x7')}});function writeLog(_0x27137a,_0x3869f2,_0x113c06){return logger['info'](util['format'](_0x444e('0x8'),_0x27137a,_0x3869f2[_0x444e('0x9')],_0x113c06));}function handleFindAgent(_0x5ed0da){return function(_0x2421b5){return _0x2421b5[_0x444e('0x9')][_0x444e('0xa')]()===_0x5ed0da['toLowerCase']();};}exports['consequence']=function(_0x380c6e,_0x2585fe,_0x5951d0,_0x407fcf){return function(_0x4c62b3){try{var _0x3c3af5={'name':_0x2585fe[0x0],'timeout':_0x2585fe[0x1]};var _0x454eec=queue[_0x444e('0x0')](_0x3c3af5,{'typecast':!![]});if(_0x454eec['length']){logger[_0x444e('0xb')](_0x444e('0xc'),_0x380c6e,_[_0x444e('0xd')](_0x454eec,'message')[_0x444e('0xe')](',\x20'));_0x4c62b3[_0x444e('0xf')]();}else{var _0x425283=_[_0x444e('0x10')](_0x5951d0[_0x444e('0x11')],handleFindAgent(_0x3c3af5[_0x444e('0x9')]));if(_0x425283){var _0x38a73f=(_0x3c3af5[_0x444e('0x12')]||0xa)*0x3e8;var _0x5a0556,_0x11b6cc;var _0x3acefd=seqqueue[_0x444e('0x13')](_0x38a73f);_0x3acefd['id']=_0x380c6e;_0x3acefd[_0x444e('0x14')]=_0x38a73f;_0x3acefd['channel']=_0x407fcf['channel'];writeLog(_0x380c6e,_0x425283,util['format'](_0x444e('0x15'),_0x38a73f));_0x5951d0[_0x444e('0x16')][_0x380c6e]['on']('end',function(){logger[_0x444e('0x17')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x380c6e);clearTimeout(_0x11b6cc);_0x11b6cc=undefined;_0x3acefd[_0x444e('0x18')]();if(_0x5951d0['rules'][_0x380c6e]){delete _0x5951d0['rules'][_0x380c6e];}_0x4c62b3[_0x444e('0xf')]();});_0x5951d0[_0x444e('0x16')][_0x380c6e]['on'](_0x444e('0x19'),function(){if(_0x5951d0[_0x444e('0x16')][_0x380c6e]){delete _0x5951d0['rules'][_0x380c6e];}});_0x11b6cc=setTimeout(function(){logger[_0x444e('0x17')](_0x444e('0x1a'),_0x380c6e);clearTimeout(_0x11b6cc);_0x3acefd[_0x444e('0x18')]();_0x4c62b3['next']();},_0x38a73f);strategy['agent'](_0x3acefd,_0x425283,_0x5951d0,_0x407fcf);}else{logger[_0x444e('0xb')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x380c6e,_0x3c3af5['name']);_0x4c62b3[_0x444e('0xf')]();}}}catch(_0x2e9b5c){console[_0x444e('0x1b')](_0x2e9b5c);logger[_0x444e('0xb')]('[%s][QUEUE]\x20%s',_0x380c6e,_0x2e9b5c['stack']);_0x4c62b3[_0x444e('0xf')]();}};};
\ No newline at end of file
index a0a6bd6..a8ad8ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81d7=['dialogState','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','create','then','stringify','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','toString','postText','error','providerName','amazonlex'];(function(_0x1bdc52,_0x4876a9){var _0xdf3fa3=function(_0x2a3ba4){while(--_0x2a3ba4){_0x1bdc52['push'](_0x1bdc52['shift']());}};_0xdf3fa3(++_0x4876a9);}(_0x81d7,0xc2));var _0x781d=function(_0x30c1dd,_0x4c4d55){_0x30c1dd=_0x30c1dd-0x0;var _0x4d9fc5=_0x81d7[_0x30c1dd];return _0x4d9fc5;};'use strict';var _=require(_0x781d('0x0'));var moment=require(_0x781d('0x1'));var AWS=require(_0x781d('0x2'));var utils=require(_0x781d('0x3'));var logger=require('../../../../config/logger')(_0x781d('0x4'));var rpc={'chatMessage':require(_0x781d('0x5')),'openchannelMessage':require(_0x781d('0x6')),'mailMessage':require(_0x781d('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x781d('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x781d('0x9')]=function(_0x3315b0,_0x32b512){return function(_0x2ee570){try{if(!_[_0x781d('0xa')](this['interaction'][_0x781d('0xb')])){logger['info'](_0x781d('0xc'),_0x3315b0,_0x781d('0xd'));return _0x2ee570[_0x781d('0xe')]();}var _0x397661={'ContactId':this[_0x781d('0xf')]['id'],'sentAt':moment()[_0x781d('0x10')](_0x781d('0x11')),'direction':_0x781d('0x12')};if(this['channel']===_0x781d('0x13')||this[_0x781d('0x14')]==='whatsapp'){_0x397661[_0x781d('0x15')]=this['interaction'][_0x781d('0x15')];}var _0x57d53a=this['channel'];if(_0x57d53a==='chat'){_0x397661[_0x781d('0x16')]=this[_0x781d('0x17')]['id'];}else{_0x397661[_['upperFirst'](_0x57d53a)+_0x781d('0x18')]=this[_0x781d('0x17')]['id'];}_0x397661[_[_0x781d('0x19')](_0x57d53a)+_0x781d('0x1a')]=this[_0x781d('0x1b')]['id'];if(this[_0x781d('0x1b')][_0x781d('0x1c')]){var _0x1f5c38=_0x32b512[0x4];if(!_[_0x781d('0x1d')](_0x1f5c38)){_0x397661[_0x781d('0x1e')]=utils[_0x781d('0x1f')](_0x1f5c38,this);return rpc[_0x57d53a+_0x781d('0x20')][_0x781d('0x21')](_0x397661)[_0x781d('0x22')](function(_0x4b3560){logger['info'](_0x781d('0xc'),_0x3315b0,_0x397661[_0x781d('0x1e')]);})['catch'](function(_0x263a22){logger['error'](_0x781d('0xc'),_0x3315b0,JSON[_0x781d('0x23')](_0x263a22));})['finally'](function(){logger[_0x781d('0x24')](_0x781d('0x25'),_0x3315b0);_0x2ee570[_0x781d('0x26')]();});}else{logger[_0x781d('0x24')](_0x781d('0x27'),_0x3315b0);_0x2ee570[_0x781d('0x26')]();}}else{var _0x43bec5=this;var _0x517118=new AWS['LexRuntime']({'accessKeyId':_0x32b512[0x0],'secretAccessKey':_0x32b512[0x1],'region':_0x32b512[0x2]});var _0x21023c={'botAlias':'$LATEST','botName':_0x32b512[0x3],'inputText':this[_0x781d('0x28')][_0x781d('0x1e')],'userId':this[_0x781d('0x14')]+':'+this[_0x781d('0x1b')]['id'][_0x781d('0x29')]()};_0x517118[_0x781d('0x2a')](_0x21023c,function(_0x2577c5,_0x35aae8){if(_0x2577c5){logger[_0x781d('0x2b')](_0x781d('0xc'),_0x3315b0,_0x2577c5[_0x781d('0x28')]);_0x2ee570[_0x781d('0xe')]();}else if(_0x35aae8&&_0x35aae8[_0x781d('0x28')]){_0x43bec5[_0x781d('0x1e')]['amazonlex']=_0x35aae8;_0x397661[_0x781d('0x1e')]=_0x35aae8[_0x781d('0x28')];_0x397661[_0x781d('0x2c')]=_0x781d('0x2d');_0x397661['providerResponse']=JSON[_0x781d('0x23')](_0x35aae8);return rpc[_0x57d53a+_0x781d('0x20')]['create'](_0x397661)[_0x781d('0x22')](function(_0x17bf49){logger[_0x781d('0x24')]('[%s][AMAZONLEX]\x20%s',_0x3315b0,_0x397661['body']);if(_0x35aae8[_0x781d('0x2e')]==_0x781d('0x2f')){_0x2ee570['next']();}else{_0x2ee570[_0x781d('0x26')]();}})['catch'](function(_0x3eab22){logger[_0x781d('0x2b')](_0x781d('0xc'),_0x3315b0,JSON[_0x781d('0x23')](_0x3eab22));_0x2ee570[_0x781d('0xe')]();});}else{_0x2ee570[_0x781d('0xe')]();}});}}catch(_0x4db40b){logger['error'](_0x781d('0xc'),_0x3315b0,JSON[_0x781d('0x23')](_0x4db40b));_0x2ee570['stop']();}};};
\ No newline at end of file
+var _0x153b=['LexRuntime','$LATEST','message','toString','amazonlex','Message','dialogState','Failed','stop','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','then','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x4c7d45,_0x405465){var _0x4bd3ee=function(_0x26a39d){while(--_0x26a39d){_0x4c7d45['push'](_0x4c7d45['shift']());}};_0x4bd3ee(++_0x405465);}(_0x153b,0x9a));var _0xb153=function(_0x90f3cc,_0x43dec5){_0x90f3cc=_0x90f3cc-0x0;var _0x23a7e1=_0x153b[_0x90f3cc];return _0x23a7e1;};'use strict';var _=require(_0xb153('0x0'));var moment=require(_0xb153('0x1'));var AWS=require(_0xb153('0x2'));var utils=require(_0xb153('0x3'));var logger=require(_0xb153('0x4'))(_0xb153('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb153('0x6')),'mailMessage':require(_0xb153('0x7')),'smsMessage':require(_0xb153('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb153('0x9'))};exports[_0xb153('0xa')]=function(_0x5c594a,_0x2ad2b5){return function(_0x2db896){try{if(!_[_0xb153('0xb')](this[_0xb153('0xc')]['UserId'])){logger[_0xb153('0xd')](_0xb153('0xe'),_0x5c594a,_0xb153('0xf'));return _0x2db896[_0xb153('0x10')]();}var _0x4363e8={'ContactId':this[_0xb153('0x11')]['id'],'sentAt':moment()[_0xb153('0x12')](_0xb153('0x13')),'direction':_0xb153('0x14')};if(this[_0xb153('0x15')]===_0xb153('0x16')||this[_0xb153('0x15')]===_0xb153('0x17')){_0x4363e8['phone']=this[_0xb153('0xc')][_0xb153('0x18')];}var _0x1c71d0=this[_0xb153('0x15')];if(_0x1c71d0==='chat'){_0x4363e8['ChatWebsiteId']=this[_0xb153('0x19')]['id'];}else{_0x4363e8[_['upperFirst'](_0x1c71d0)+_0xb153('0x1a')]=this[_0xb153('0x19')]['id'];}_0x4363e8[_['upperFirst'](_0x1c71d0)+_0xb153('0x1b')]=this[_0xb153('0xc')]['id'];if(this['interaction'][_0xb153('0x1c')]){var _0x10c174=_0x2ad2b5[0x4];if(!_[_0xb153('0x1d')](_0x10c174)){_0x4363e8[_0xb153('0x1e')]=utils[_0xb153('0x1f')](_0x10c174,this);return rpc[_0x1c71d0+'Message'][_0xb153('0x20')](_0x4363e8)[_0xb153('0x21')](function(_0x5a9d2b){logger[_0xb153('0xd')](_0xb153('0xe'),_0x5c594a,_0x4363e8[_0xb153('0x1e')]);})['catch'](function(_0x56021d){logger[_0xb153('0x22')]('[%s][AMAZONLEX]\x20%s',_0x5c594a,JSON[_0xb153('0x23')](_0x56021d));})['finally'](function(){logger[_0xb153('0xd')](_0xb153('0x24'),_0x5c594a);_0x2db896['stop']();});}else{logger[_0xb153('0xd')](_0xb153('0x25'),_0x5c594a);_0x2db896['stop']();}}else{var _0x50bc98=this;var _0xbc574e=new AWS[(_0xb153('0x26'))]({'accessKeyId':_0x2ad2b5[0x0],'secretAccessKey':_0x2ad2b5[0x1],'region':_0x2ad2b5[0x2]});var _0x1ee272={'botAlias':_0xb153('0x27'),'botName':_0x2ad2b5[0x3],'inputText':this[_0xb153('0x28')][_0xb153('0x1e')],'userId':this['channel']+':'+this[_0xb153('0xc')]['id'][_0xb153('0x29')]()};_0xbc574e['postText'](_0x1ee272,function(_0x5e70e4,_0x838dc3){if(_0x5e70e4){logger['error'](_0xb153('0xe'),_0x5c594a,_0x5e70e4[_0xb153('0x28')]);_0x2db896['next']();}else if(_0x838dc3&&_0x838dc3[_0xb153('0x28')]){_0x50bc98[_0xb153('0x1e')]['amazonlex']=_0x838dc3;_0x4363e8[_0xb153('0x1e')]=_0x838dc3['message'];_0x4363e8['providerName']=_0xb153('0x2a');_0x4363e8['providerResponse']=JSON[_0xb153('0x23')](_0x838dc3);return rpc[_0x1c71d0+_0xb153('0x2b')][_0xb153('0x20')](_0x4363e8)[_0xb153('0x21')](function(_0x6965b1){logger[_0xb153('0xd')](_0xb153('0xe'),_0x5c594a,_0x4363e8[_0xb153('0x1e')]);if(_0x838dc3[_0xb153('0x2c')]==_0xb153('0x2d')){_0x2db896['next']();}else{_0x2db896[_0xb153('0x2e')]();}})[_0xb153('0x2f')](function(_0x458cd8){logger['error'](_0xb153('0xe'),_0x5c594a,JSON['stringify'](_0x458cd8));_0x2db896['next']();});}else{_0x2db896['next']();}});}}catch(_0x3511d4){logger[_0xb153('0x22')]('[%s][AMAZONLEX]\x20%s',_0x5c594a,JSON[_0xb153('0x23')](_0x3511d4));_0x2db896[_0xb153('0x2e')]();}};};
\ No newline at end of file
index d0c1ee6..7bad642 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd86b=['update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Message','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','info','[%s][AUTOREPLY]\x20%s','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto-replied','All','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','finally','resolve','Interaction'];(function(_0x190fec,_0x2e4527){var _0x51eef7=function(_0x52d898){while(--_0x52d898){_0x190fec['push'](_0x190fec['shift']());}};_0x51eef7(++_0x2e4527);}(_0xd86b,0xeb));var _0xbd86=function(_0x17266e,_0x5d273d){_0x17266e=_0x17266e-0x0;var _0x8eeaf4=_0xd86b[_0x17266e];return _0x8eeaf4;};'use strict';var _=require(_0xbd86('0x0'));var moment=require('moment');var utils=require(_0xbd86('0x1'));var logger=require(_0xbd86('0x2'))(_0xbd86('0x3'));var rpc={'chatMessage':require(_0xbd86('0x4')),'openchannelMessage':require(_0xbd86('0x5')),'mailMessage':require(_0xbd86('0x6')),'smsMessage':require(_0xbd86('0x7')),'faxMessage':require(_0xbd86('0x8')),'whatsappMessage':require(_0xbd86('0x9')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xbd86('0xa')),'mailInteraction':require(_0xbd86('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xbd86('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xbd86('0xd'));exports[_0xbd86('0xe')]=function(_0x39ea31,_0x101454,_0x45ac9a,_0x150c60){return function(_0x109bda){try{var _0xa7e1ed=this[_0xbd86('0xf')];if(_0xa7e1ed===_0xbd86('0x10')&&_0x150c60['body']['isAutoreply']){logger[_0xbd86('0x11')](_0xbd86('0x12'),_0x39ea31,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x109bda['next']();}if(_0x101454[0x0]==='1'&&(_[_0xbd86('0x13')](this[_0xbd86('0x14')][_0xbd86('0x15')])||!this[_0xbd86('0x14')][_0xbd86('0x15')])){logger['info'](_0xbd86('0x12'),_0x39ea31,_0xbd86('0x16'));return _0x109bda[_0xbd86('0x17')]();}if(_0x101454[0x0]==='2'&&this[_0xbd86('0x14')][_0xbd86('0x18')]){logger['info'](_0xbd86('0x19'),_0x39ea31,_0xbd86('0x1a'));return _0x109bda[_0xbd86('0x17')]();}var _0x5a5a2c={'ContactId':this[_0xbd86('0x1b')]['id'],'sentAt':moment()[_0xbd86('0x1c')](_0xbd86('0x1d')),'direction':_0xbd86('0x1e')};if(this[_0xbd86('0xf')]===_0xbd86('0x10')){_0x5a5a2c[_0xbd86('0x1f')]=utils[_0xbd86('0x20')](_0x101454[0x2],this);}else{_0x5a5a2c[_0xbd86('0x1f')]=utils[_0xbd86('0x20')](_0x101454[0x1],this);}if(this[_0xbd86('0x21')]){_0x5a5a2c['to']=this['message'][_0xbd86('0x22')]||'';if(this[_0xbd86('0xf')]==='mail'&&_0x101454[0x1]==='1'){_0x5a5a2c['cc']=this['message']['cc']||'';}_0x5a5a2c[_0xbd86('0x22')]=this['message']['to']||'';_0x5a5a2c[_0xbd86('0x23')]=this[_0xbd86('0x21')]['phone']||'';_0x5a5a2c[_0xbd86('0x24')]=!![];if(this['message'][_0xbd86('0x25')]){_0x5a5a2c[_0xbd86('0x25')]='';_0x5a5a2c[_0xbd86('0x25')]+=_[_0xbd86('0x26')](this[_0xbd86('0x21')]['subject'],'Re:')?'':_0xbd86('0x27');_0x5a5a2c[_0xbd86('0x25')]+=this['message']['subject'];}}if(this[_0xbd86('0xf')]===_0xbd86('0x28')){_0x5a5a2c[_0xbd86('0x29')]=this['account']['id'];}else{_0x5a5a2c[_[_0xbd86('0x2a')](this[_0xbd86('0xf')])+_0xbd86('0x2b')]=this[_0xbd86('0x2c')]['id'];}_0x5a5a2c[_['upperFirst'](this['channel'])+_0xbd86('0x2d')]=this['interaction']['id'];var _0xf0592e=this[_0xbd86('0x14')];if(rpc[this[_0xbd86('0xf')]+'Message']){if(this[_0xbd86('0xf')]===_0xbd86('0x10')){var _0x458bc7={'tls':{'rejectUnauthorized':![]}};if(this[_0xbd86('0x2c')][_0xbd86('0x2e')][_0xbd86('0x2f')]){_0x458bc7['service']=this[_0xbd86('0x2c')][_0xbd86('0x2e')]['service'];}else{_0x458bc7[_0xbd86('0x30')]=this[_0xbd86('0x2c')][_0xbd86('0x2e')][_0xbd86('0x30')];_0x458bc7[_0xbd86('0x31')]=this[_0xbd86('0x2c')]['Smtp'][_0xbd86('0x31')];_0x458bc7[_0xbd86('0x32')]=this[_0xbd86('0x2c')]['Smtp'][_0xbd86('0x32')];}if(this[_0xbd86('0x2c')][_0xbd86('0x2e')]['authentication']){_0x458bc7[_0xbd86('0x33')]={'user':this['account'][_0xbd86('0x2e')][_0xbd86('0x34')],'pass':this[_0xbd86('0x2c')][_0xbd86('0x2e')][_0xbd86('0x35')]};}_0x5a5a2c[_0xbd86('0x36')]=this[_0xbd86('0x21')][_0xbd86('0x37')];_0x5a5a2c[_0xbd86('0x38')]='<div\x20id=\x22xm-mail-content\x22>'+_['replace'](_0x5a5a2c[_0xbd86('0x1f')],_0xbd86('0x39'),_0xbd86('0x3a'))+_0xbd86('0x3b');_0x5a5a2c[_0xbd86('0x3c')]={'Auto-Submitted':_0xbd86('0x3d'),'X-Auto-Response-Suppress':_0xbd86('0x3e'),'Precedence':'auto_reply'};return mailRpc[_0xbd86('0x3f')](_0x458bc7,_0x5a5a2c)['then'](function(_0x3ef270){logger[_0xbd86('0x11')](_0xbd86('0x40'),_0x39ea31);_0x5a5a2c['messageId']=_0x3ef270[_0xbd86('0x21')][_0xbd86('0x37')];return rpc[_0xa7e1ed+'Message'][_0xbd86('0x41')](_0x5a5a2c);})[_0xbd86('0x42')](function(_0x46c7a4){logger[_0xbd86('0x11')](_0xbd86('0x12'),_0x39ea31,JSON[_0xbd86('0x43')](_0x46c7a4));})[_0xbd86('0x44')](function(_0x5ed7b1){logger[_0xbd86('0x45')]('[RPC][%s][AUTOREPLY]\x20%s',_0x39ea31,JSON[_0xbd86('0x43')](_0x5ed7b1));})[_0xbd86('0x46')](function(){Promise[_0xbd86('0x47')]()['then'](function(){if(_0x101454[0x0]!=='2'||_0xf0592e[_0xbd86('0x18')])return;return rpc[_0xa7e1ed+_0xbd86('0x48')][_0xbd86('0x49')](_0xf0592e['id'],{'autoreplyExecuted':!![]})[_0xbd86('0x42')](function(_0x10ec9b){logger['info'](_0xbd86('0x19'),_0x39ea31,JSON[_0xbd86('0x43')](_0x10ec9b));})[_0xbd86('0x44')](function(_0x1230f5){logger[_0xbd86('0x45')](_0xbd86('0x4a'),_0x39ea31,JSON[_0xbd86('0x43')](_0x1230f5));});})[_0xbd86('0x42')](function(){_0x109bda['next']();});});}else{return rpc[this['channel']+_0xbd86('0x4b')][_0xbd86('0x41')](_0x5a5a2c)['then'](function(_0x5963ec){logger[_0xbd86('0x11')](_0xbd86('0x12'),_0x39ea31,_0x5a5a2c['body']);})[_0xbd86('0x44')](function(_0xb1604c){logger[_0xbd86('0x45')](_0xbd86('0x12'),_0x39ea31,JSON[_0xbd86('0x43')](_0xb1604c));})[_0xbd86('0x46')](function(){Promise[_0xbd86('0x47')]()[_0xbd86('0x42')](function(){if(_0x101454[0x0]!=='2'||_0xf0592e[_0xbd86('0x18')])return;return rpc[_0xa7e1ed+_0xbd86('0x48')]['update'](_0xf0592e['id'],{'autoreplyExecuted':!![]})[_0xbd86('0x42')](function(_0x4b4d96){logger[_0xbd86('0x11')](_0xbd86('0x19'),_0x39ea31,JSON['stringify'](_0x4b4d96));})[_0xbd86('0x44')](function(_0x4ea59c){logger[_0xbd86('0x45')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x39ea31,JSON[_0xbd86('0x43')](_0x4ea59c));});})[_0xbd86('0x42')](function(){_0x109bda[_0xbd86('0x17')]();});});}}}catch(_0x14a17d){logger['error']('[%s][AUTOREPLY]\x20%s',_0x39ea31,JSON[_0xbd86('0x43')](_0x14a17d));_0x109bda[_0xbd86('0x4c')]();}};};
\ No newline at end of file
+var _0x03e3=['../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','getMustacheRender','message','from','phone','read','subject','Re:','account','upperFirst','AccountId','InteractionId','Message','service','host','port','Smtp','secure','authentication','auth','pass','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto-replied','All','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','stop','lodash','moment','./utils','routing','../../rpc/mailMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction'];(function(_0x294f30,_0x4cdb4c){var _0x39cd8b=function(_0xd61d6){while(--_0xd61d6){_0x294f30['push'](_0x294f30['shift']());}};_0x39cd8b(++_0x4cdb4c);}(_0x03e3,0x1a2));var _0x303e=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x03e3[_0x279d37];return _0x530173;};'use strict';var _=require(_0x303e('0x0'));var moment=require(_0x303e('0x1'));var utils=require(_0x303e('0x2'));var logger=require('../../../../config/logger')(_0x303e('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x303e('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x303e('0x5')),'openchannelInteraction':require(_0x303e('0x6')),'mailInteraction':require(_0x303e('0x7')),'smsInteraction':require(_0x303e('0x8')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x303e('0x9'))};var mailRpc=require(_0x303e('0xa'));exports[_0x303e('0xb')]=function(_0x467be6,_0x46c895,_0x38aa46,_0x18c3ec){return function(_0x5799ea){try{var _0x4bb56b=this['channel'];if(_0x4bb56b===_0x303e('0xc')&&_0x18c3ec[_0x303e('0xd')]['isAutoreply']){logger['info'](_0x303e('0xe'),_0x467be6,_0x303e('0xf'));return _0x5799ea[_0x303e('0x10')]();}if(_0x46c895[0x0]==='1'&&(_[_0x303e('0x11')](this[_0x303e('0x12')]['created'])||!this['interaction'][_0x303e('0x13')])){logger[_0x303e('0x14')]('[%s][AUTOREPLY]\x20%s',_0x467be6,'Autoreply\x20already\x20sent');return _0x5799ea[_0x303e('0x10')]();}if(_0x46c895[0x0]==='2'&&this['interaction'][_0x303e('0x15')]){logger[_0x303e('0x14')](_0x303e('0x16'),_0x467be6,_0x303e('0x17'));return _0x5799ea[_0x303e('0x10')]();}var _0x5dd624={'ContactId':this[_0x303e('0x18')]['id'],'sentAt':moment()['format'](_0x303e('0x19')),'direction':_0x303e('0x1a')};if(this[_0x303e('0x1b')]==='mail'){_0x5dd624[_0x303e('0xd')]=utils[_0x303e('0x1c')](_0x46c895[0x2],this);}else{_0x5dd624[_0x303e('0xd')]=utils[_0x303e('0x1c')](_0x46c895[0x1],this);}if(this[_0x303e('0x1d')]){_0x5dd624['to']=this['message']['from']||'';if(this[_0x303e('0x1b')]==='mail'&&_0x46c895[0x1]==='1'){_0x5dd624['cc']=this['message']['cc']||'';}_0x5dd624[_0x303e('0x1e')]=this['message']['to']||'';_0x5dd624[_0x303e('0x1f')]=this[_0x303e('0x1d')]['phone']||'';_0x5dd624[_0x303e('0x20')]=!![];if(this[_0x303e('0x1d')][_0x303e('0x21')]){_0x5dd624['subject']='';_0x5dd624[_0x303e('0x21')]+=_['startsWith'](this[_0x303e('0x1d')][_0x303e('0x21')],_0x303e('0x22'))?'':'Re:\x20';_0x5dd624[_0x303e('0x21')]+=this[_0x303e('0x1d')][_0x303e('0x21')];}}if(this[_0x303e('0x1b')]==='chat'){_0x5dd624['ChatWebsiteId']=this[_0x303e('0x23')]['id'];}else{_0x5dd624[_[_0x303e('0x24')](this[_0x303e('0x1b')])+_0x303e('0x25')]=this[_0x303e('0x23')]['id'];}_0x5dd624[_[_0x303e('0x24')](this[_0x303e('0x1b')])+_0x303e('0x26')]=this[_0x303e('0x12')]['id'];var _0x2fcecc=this['interaction'];if(rpc[this[_0x303e('0x1b')]+_0x303e('0x27')]){if(this[_0x303e('0x1b')]===_0x303e('0xc')){var _0x2677f3={'tls':{'rejectUnauthorized':![]}};if(this[_0x303e('0x23')]['Smtp'][_0x303e('0x28')]){_0x2677f3[_0x303e('0x28')]=this[_0x303e('0x23')]['Smtp']['service'];}else{_0x2677f3[_0x303e('0x29')]=this[_0x303e('0x23')]['Smtp'][_0x303e('0x29')];_0x2677f3[_0x303e('0x2a')]=this[_0x303e('0x23')][_0x303e('0x2b')][_0x303e('0x2a')];_0x2677f3[_0x303e('0x2c')]=this[_0x303e('0x23')][_0x303e('0x2b')][_0x303e('0x2c')];}if(this[_0x303e('0x23')]['Smtp'][_0x303e('0x2d')]){_0x2677f3[_0x303e('0x2e')]={'user':this[_0x303e('0x23')][_0x303e('0x2b')]['user'],'pass':this[_0x303e('0x23')][_0x303e('0x2b')][_0x303e('0x2f')]};}_0x5dd624['inReplyTo']=this['message'][_0x303e('0x30')];_0x5dd624[_0x303e('0x31')]=_0x303e('0x32')+_[_0x303e('0x33')](_0x5dd624['body'],_0x303e('0x34'),_0x303e('0x35'))+_0x303e('0x36');_0x5dd624[_0x303e('0x37')]={'Auto-Submitted':_0x303e('0x38'),'X-Auto-Response-Suppress':_0x303e('0x39'),'Precedence':'auto_reply'};return mailRpc[_0x303e('0x3a')](_0x2677f3,_0x5dd624)[_0x303e('0x3b')](function(_0x219253){logger[_0x303e('0x14')](_0x303e('0x3c'),_0x467be6);_0x5dd624[_0x303e('0x30')]=_0x219253[_0x303e('0x1d')][_0x303e('0x30')];return rpc[_0x4bb56b+_0x303e('0x27')][_0x303e('0x3d')](_0x5dd624);})[_0x303e('0x3b')](function(_0x4dc41e){logger[_0x303e('0x14')](_0x303e('0xe'),_0x467be6,JSON[_0x303e('0x3e')](_0x4dc41e));})[_0x303e('0x3f')](function(_0x569895){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x467be6,JSON['stringify'](_0x569895));})[_0x303e('0x40')](function(){Promise[_0x303e('0x41')]()[_0x303e('0x3b')](function(){if(_0x46c895[0x0]!=='2'||_0x2fcecc['autoreplyExecuted'])return;return rpc[_0x4bb56b+_0x303e('0x42')][_0x303e('0x43')](_0x2fcecc['id'],{'autoreplyExecuted':!![]})[_0x303e('0x3b')](function(_0x2da74d){logger[_0x303e('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x467be6,JSON[_0x303e('0x3e')](_0x2da74d));})[_0x303e('0x3f')](function(_0x3af601){logger['error'](_0x303e('0x44'),_0x467be6,JSON[_0x303e('0x3e')](_0x3af601));});})['then'](function(){_0x5799ea[_0x303e('0x10')]();});});}else{return rpc[this[_0x303e('0x1b')]+_0x303e('0x27')][_0x303e('0x3d')](_0x5dd624)[_0x303e('0x3b')](function(_0x57b1f6){logger['info'](_0x303e('0xe'),_0x467be6,_0x5dd624[_0x303e('0xd')]);})['catch'](function(_0x26b297){logger['error'](_0x303e('0xe'),_0x467be6,JSON[_0x303e('0x3e')](_0x26b297));})[_0x303e('0x40')](function(){Promise['resolve']()[_0x303e('0x3b')](function(){if(_0x46c895[0x0]!=='2'||_0x2fcecc[_0x303e('0x15')])return;return rpc[_0x4bb56b+_0x303e('0x42')][_0x303e('0x43')](_0x2fcecc['id'],{'autoreplyExecuted':!![]})['then'](function(_0x522dcf){logger['info'](_0x303e('0x16'),_0x467be6,JSON[_0x303e('0x3e')](_0x522dcf));})[_0x303e('0x3f')](function(_0x3524f2){logger[_0x303e('0x45')](_0x303e('0x44'),_0x467be6,JSON[_0x303e('0x3e')](_0x3524f2));});})[_0x303e('0x3b')](function(){_0x5799ea['next']();});});}}}catch(_0x2a0f73){logger[_0x303e('0x45')](_0x303e('0xe'),_0x467be6,JSON[_0x303e('0x3e')](_0x2a0f73));_0x5799ea[_0x303e('0x46')]();}};};
\ No newline at end of file
index 87947c3..c52c7a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa87f=['finally','stop','error','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','format','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','stringify'];(function(_0x269241,_0x2b2a02){var _0x22d8f5=function(_0x42352e){while(--_0x42352e){_0x269241['push'](_0x269241['shift']());}};_0x22d8f5(++_0x2b2a02);}(_0xa87f,0x82));var _0xfa87=function(_0x4df3e7,_0x10f2e5){_0x4df3e7=_0x4df3e7-0x0;var _0x2305d6=_0xa87f[_0x4df3e7];return _0x2305d6;};'use strict';var moment=require(_0xfa87('0x0'));var logger=require(_0xfa87('0x1'))(_0xfa87('0x2'));var rpc={'chatInteraction':require(_0xfa87('0x3')),'openchannelInteraction':require(_0xfa87('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xfa87('0x5')),'faxInteraction':require(_0xfa87('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xfa87('0x7')]=function(_0x30c00e,_0x5f0a48,_0x2326f4,_0x47111c){return function(_0x320058){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x30c00e,_0x5f0a48[0x0]);var _0x51b658={'closed':0x1,'closedAt':moment()[_0xfa87('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xfa87('0x9'),'disposition':_0x5f0a48[0x0]};if(rpc[_0x47111c[_0xfa87('0xa')]+'Interaction']){rpc[_0x47111c[_0xfa87('0xa')]+_0xfa87('0xb')]['update'](_0x47111c[_0xfa87('0xc')]['id'],_0x51b658)[_0xfa87('0xd')](function(_0x338eac){logger['info'](_0xfa87('0xe'),_0x30c00e,_0x47111c[_0xfa87('0xc')]['id']);})[_0xfa87('0xf')](function(_0x9881c0){logger['error']('[%s][CLOSE]\x20%s',_0x30c00e,JSON[_0xfa87('0x10')](_0x9881c0));})[_0xfa87('0x11')](function(){_0x320058[_0xfa87('0x12')]();});}}catch(_0x1cc349){logger[_0xfa87('0x13')](_0xfa87('0x14'),_0x30c00e,JSON[_0xfa87('0x10')](_0x1cc349));_0x320058['stop']();}};};
\ No newline at end of file
+var _0xe262=['system','channel','Interaction','interaction','then','error','[%s][CLOSE]\x20%s','stringify','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x35760c,_0x2000e2){var _0x4ce343=function(_0x5a29b6){while(--_0x5a29b6){_0x35760c['push'](_0x35760c['shift']());}};_0x4ce343(++_0x2000e2);}(_0xe262,0x194));var _0x2e26=function(_0x4f6003,_0x4ba9fe){_0x4f6003=_0x4f6003-0x0;var _0x2db378=_0xe262[_0x4f6003];return _0x2db378;};'use strict';var moment=require('moment');var logger=require(_0x2e26('0x0'))(_0x2e26('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x2e26('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x2e26('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x2e26('0x4'))};exports[_0x2e26('0x5')]=function(_0xcd6f5b,_0x4aea4c,_0x323cf9,_0x1f6898){return function(_0x1ed1a1){try{logger[_0x2e26('0x6')](_0x2e26('0x7'),_0xcd6f5b,_0x4aea4c[0x0]);var _0x5627cb={'closed':0x1,'closedAt':moment()[_0x2e26('0x8')](_0x2e26('0x9')),'closeReason':_0x2e26('0xa'),'disposition':_0x4aea4c[0x0]};if(rpc[_0x1f6898[_0x2e26('0xb')]+_0x2e26('0xc')]){rpc[_0x1f6898[_0x2e26('0xb')]+'Interaction']['update'](_0x1f6898[_0x2e26('0xd')]['id'],_0x5627cb)[_0x2e26('0xe')](function(_0x321106){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xcd6f5b,_0x1f6898[_0x2e26('0xd')]['id']);})['catch'](function(_0xcdc565){logger[_0x2e26('0xf')](_0x2e26('0x10'),_0xcd6f5b,JSON[_0x2e26('0x11')](_0xcdc565));})['finally'](function(){_0x1ed1a1['stop']();});}}catch(_0x89eec8){logger[_0x2e26('0xf')]('[%s][CLOSE]\x20%s',_0xcd6f5b,JSON[_0x2e26('0x11')](_0x89eec8));_0x1ed1a1['stop']();}};};
\ No newline at end of file
index 9e97b85..de90787 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9829=['lodash','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','body','Message','create','catch','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','then','dialogflow','result','fulfillment','speech','providerName','providerResponse','error'];(function(_0x1578ad,_0x5cdd6c){var _0x5b84c2=function(_0x597acc){while(--_0x597acc){_0x1578ad['push'](_0x1578ad['shift']());}};_0x5b84c2(++_0x5cdd6c);}(_0x9829,0xc4));var _0x9982=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9829[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x9982('0x0'));var moment=require(_0x9982('0x1'));var apiai=require(_0x9982('0x2'));var md5=require(_0x9982('0x3'));var utils=require(_0x9982('0x4'));var logger=require('../../../../config/logger')(_0x9982('0x5'));var rpc={'chatMessage':require(_0x9982('0x6')),'openchannelMessage':require(_0x9982('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x9982('0x8')),'faxMessage':require(_0x9982('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x340d62,_0x35a93f){return function(_0x5d0824){try{if(!_[_0x9982('0xa')](this[_0x9982('0xb')][_0x9982('0xc')])){logger[_0x9982('0xd')](_0x9982('0xe'),_0x340d62,_0x9982('0xf'));return _0x5d0824[_0x9982('0x10')]();}var _0x4047be={'ContactId':this[_0x9982('0x11')]['id'],'sentAt':moment()[_0x9982('0x12')](_0x9982('0x13')),'direction':_0x9982('0x14')};if(this[_0x9982('0x15')]===_0x9982('0x16')||this[_0x9982('0x15')]===_0x9982('0x17')){_0x4047be[_0x9982('0x18')]=this[_0x9982('0xb')]['phone'];}var _0x13424a=this[_0x9982('0x15')];if(_0x13424a==='chat'){_0x4047be[_0x9982('0x19')]=this['account']['id'];}else{_0x4047be[_[_0x9982('0x1a')](_0x13424a)+_0x9982('0x1b')]=this[_0x9982('0x1c')]['id'];}_0x4047be[_[_0x9982('0x1a')](_0x13424a)+_0x9982('0x1d')]=this[_0x9982('0xb')]['id'];if(this[_0x9982('0xb')][_0x9982('0x1e')]){var _0x1b8ecd=_0x35a93f[0x2];if(!_['isEmpty'](_0x1b8ecd)){_0x4047be[_0x9982('0x1f')]=utils['getMustacheRender'](_0x1b8ecd,this);return rpc[_0x13424a+_0x9982('0x20')][_0x9982('0x21')](_0x4047be)['then'](function(_0x2558e1){logger[_0x9982('0xd')](_0x9982('0xe'),_0x340d62,_0x4047be[_0x9982('0x1f')]);})[_0x9982('0x22')](function(_0x400fb2){logger['error'](_0x9982('0xe'),_0x340d62,JSON[_0x9982('0x23')](_0x400fb2));})['finally'](function(){logger[_0x9982('0xd')](_0x9982('0x24'),_0x340d62);_0x5d0824[_0x9982('0x25')]();});}else{logger[_0x9982('0xd')](_0x9982('0x26'),_0x340d62);_0x5d0824[_0x9982('0x25')]();}}else{var _0xfde29b=this;var _0x541cc8=apiai(_0x35a93f[0x0],{'language':_0x35a93f[0x1]||'en'});return _0x541cc8[_0x9982('0x27')](this[_0x9982('0x28')][_0x9982('0x1f')],{'sessionId':md5(this[_0x9982('0xb')]['id'])})[_0x9982('0x29')](function(_0x4a27d6){_0xfde29b[_0x9982('0x1f')][_0x9982('0x2a')]=_0x4a27d6;_0x4047be[_0x9982('0x1f')]=_0x4a27d6[_0x9982('0x2b')][_0x9982('0x2c')][_0x9982('0x2d')];_0x4047be[_0x9982('0x2e')]=_0x9982('0x2a');_0x4047be[_0x9982('0x2f')]=JSON[_0x9982('0x23')](_0x4a27d6);return rpc[_0x13424a+_0x9982('0x20')][_0x9982('0x21')](_0x4047be)[_0x9982('0x29')](function(_0x2dc1ba){logger[_0x9982('0xd')](_0x9982('0xe'),_0x340d62,_0x4047be[_0x9982('0x1f')]);if(_0x4a27d6[_0x9982('0x2b')]['metadata']['endConversation']){_0x5d0824[_0x9982('0x10')]();}else{_0x5d0824[_0x9982('0x25')]();}})[_0x9982('0x22')](function(_0x3c0596){logger[_0x9982('0x30')](_0x9982('0xe'),_0x340d62,JSON[_0x9982('0x23')](_0x3c0596));_0x5d0824[_0x9982('0x10')]();});})[_0x9982('0x22')](function(_0x26a999){logger[_0x9982('0x30')](_0x9982('0xe'),_0x340d62,_0x26a999['message']);_0x5d0824[_0x9982('0x10')]();});}}catch(_0x9776e4){logger[_0x9982('0x30')](_0x9982('0xe'),_0x340d62,JSON[_0x9982('0x23')](_0x9776e4));_0x5d0824[_0x9982('0x25')]();}};};
\ No newline at end of file
+var _0x9300=['catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','Message','metadata','endConversation','error','lodash','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','whatsapp','phone','interaction','upperFirst','account','InteractionId','created','isEmpty','body','create','then','[%s][DIALOGFLOW]\x20%s'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x9300,0x153));var _0x0930=function(_0x17e771,_0x55fd17){_0x17e771=_0x17e771-0x0;var _0x1f3a6d=_0x9300[_0x17e771];return _0x1f3a6d;};'use strict';var _=require(_0x0930('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x0930('0x1'));var utils=require(_0x0930('0x2'));var logger=require(_0x0930('0x3'))(_0x0930('0x4'));var rpc={'chatMessage':require(_0x0930('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0930('0x6')),'smsMessage':require(_0x0930('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x0930('0x8'))};exports[_0x0930('0x9')]=function(_0x45705a,_0x34c693){return function(_0x2c0f94){try{if(!_[_0x0930('0xa')](this['interaction']['UserId'])){logger[_0x0930('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x45705a,_0x0930('0xc'));return _0x2c0f94[_0x0930('0xd')]();}var _0x5055c7={'ContactId':this[_0x0930('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x0930('0xf')};if(this[_0x0930('0x10')]==='sms'||this['channel']===_0x0930('0x11')){_0x5055c7[_0x0930('0x12')]=this[_0x0930('0x13')][_0x0930('0x12')];}var _0xaf27d=this[_0x0930('0x10')];if(_0xaf27d==='chat'){_0x5055c7['ChatWebsiteId']=this['account']['id'];}else{_0x5055c7[_[_0x0930('0x14')](_0xaf27d)+'AccountId']=this[_0x0930('0x15')]['id'];}_0x5055c7[_[_0x0930('0x14')](_0xaf27d)+_0x0930('0x16')]=this[_0x0930('0x13')]['id'];if(this[_0x0930('0x13')][_0x0930('0x17')]){var _0x58e36c=_0x34c693[0x2];if(!_[_0x0930('0x18')](_0x58e36c)){_0x5055c7[_0x0930('0x19')]=utils['getMustacheRender'](_0x58e36c,this);return rpc[_0xaf27d+'Message'][_0x0930('0x1a')](_0x5055c7)[_0x0930('0x1b')](function(_0x469be7){logger[_0x0930('0xb')](_0x0930('0x1c'),_0x45705a,_0x5055c7['body']);})[_0x0930('0x1d')](function(_0x16c5fb){logger['error'](_0x0930('0x1c'),_0x45705a,JSON[_0x0930('0x1e')](_0x16c5fb));})[_0x0930('0x1f')](function(){logger[_0x0930('0xb')](_0x0930('0x20'),_0x45705a);_0x2c0f94[_0x0930('0x21')]();});}else{logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x45705a);_0x2c0f94[_0x0930('0x21')]();}}else{var _0x5061a5=this;var _0xd9a9df=apiai(_0x34c693[0x0],{'language':_0x34c693[0x1]||'en'});return _0xd9a9df[_0x0930('0x22')](this[_0x0930('0x23')][_0x0930('0x19')],{'sessionId':md5(this[_0x0930('0x13')]['id'])})['then'](function(_0x6e9f46){_0x5061a5[_0x0930('0x19')]['dialogflow']=_0x6e9f46;_0x5055c7['body']=_0x6e9f46[_0x0930('0x24')][_0x0930('0x25')][_0x0930('0x26')];_0x5055c7[_0x0930('0x27')]=_0x0930('0x28');_0x5055c7[_0x0930('0x29')]=JSON['stringify'](_0x6e9f46);return rpc[_0xaf27d+_0x0930('0x2a')][_0x0930('0x1a')](_0x5055c7)[_0x0930('0x1b')](function(_0x100278){logger[_0x0930('0xb')](_0x0930('0x1c'),_0x45705a,_0x5055c7[_0x0930('0x19')]);if(_0x6e9f46[_0x0930('0x24')][_0x0930('0x2b')][_0x0930('0x2c')]){_0x2c0f94['next']();}else{_0x2c0f94[_0x0930('0x21')]();}})['catch'](function(_0x421a95){logger[_0x0930('0x2d')](_0x0930('0x1c'),_0x45705a,JSON['stringify'](_0x421a95));_0x2c0f94[_0x0930('0xd')]();});})['catch'](function(_0x4f3475){logger[_0x0930('0x2d')]('[%s][DIALOGFLOW]\x20%s',_0x45705a,_0x4f3475[_0x0930('0x23')]);_0x2c0f94[_0x0930('0xd')]();});}}catch(_0x69224d){logger[_0x0930('0x2d')](_0x0930('0x1c'),_0x45705a,JSON[_0x0930('0x1e')](_0x69224d));_0x2c0f94['stop']();}};};
\ No newline at end of file
index 495af9f..7c97488 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe314=['sms','channel','whatsapp','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerResponse','push','all','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','clone','body','Message','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','next','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe314,0x7c));var _0x4e31=function(_0x1a6046,_0x2354b3){_0x1a6046=_0x1a6046-0x0;var _0x1dd6a4=_0xe314[_0x1a6046];return _0x1dd6a4;};'use strict';var _=require('lodash');var dialogflow=require(_0x4e31('0x0'));var md5=require(_0x4e31('0x1'));var moment=require(_0x4e31('0x2'));var Promise=require(_0x4e31('0x3'));var logger=require(_0x4e31('0x4'))(_0x4e31('0x5'));var utils=require(_0x4e31('0x6'));var rpc={'chatMessage':require(_0x4e31('0x7')),'openchannelMessage':require(_0x4e31('0x8')),'mailMessage':require(_0x4e31('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x4e31('0xa'))};function createMessage(_0x29d63d,_0x608c4d,_0x311a10,_0x430fb9){return new Promise(function(_0x11e865,_0x4b4c25){var _0x2bc015=_[_0x4e31('0xb')](_0x311a10);_0x2bc015[_0x4e31('0xc')]=_0x430fb9;return rpc[_0x608c4d+_0x4e31('0xd')]['create'](_0x2bc015)[_0x4e31('0xe')](function(){logger[_0x4e31('0xf')](_0x4e31('0x10'),_0x29d63d,_0x2bc015[_0x4e31('0xc')]);_0x11e865();})[_0x4e31('0x11')](function(_0x3459ba){logger[_0x4e31('0x12')](_0x4e31('0x10'),_0x29d63d,JSON[_0x4e31('0x13')](_0x3459ba));_0x4b4c25(_0x3459ba);});});}exports[_0x4e31('0x14')]=function(_0x41abc8,_0x2033df){return function(_0x44fbd5){try{if(!_[_0x4e31('0x15')](this[_0x4e31('0x16')][_0x4e31('0x17')])){logger[_0x4e31('0xf')](_0x4e31('0x10'),_0x41abc8,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x44fbd5[_0x4e31('0x18')]();}var _0x2e8651={'ContactId':this['contact']['id'],'sentAt':moment()[_0x4e31('0x19')](_0x4e31('0x1a')),'direction':_0x4e31('0x1b')};if(this['channel']===_0x4e31('0x1c')||this[_0x4e31('0x1d')]===_0x4e31('0x1e')){_0x2e8651['phone']=this[_0x4e31('0x16')][_0x4e31('0x1f')];}var _0x2cbafa=this['channel'];if(_0x2cbafa===_0x4e31('0x20')){_0x2e8651[_0x4e31('0x21')]=this['account']['id'];}else{_0x2e8651[_['upperFirst'](_0x2cbafa)+_0x4e31('0x22')]=this[_0x4e31('0x23')]['id'];}_0x2e8651[_[_0x4e31('0x24')](_0x2cbafa)+_0x4e31('0x25')]=this[_0x4e31('0x16')]['id'];if(this[_0x4e31('0x16')][_0x4e31('0x26')]){var _0x5ea84e=_0x2033df[0x4];if(!_[_0x4e31('0x27')](_0x5ea84e)){_0x2e8651[_0x4e31('0xc')]=utils[_0x4e31('0x28')](_0x5ea84e,this);return rpc[_0x2cbafa+'Message'][_0x4e31('0x29')](_0x2e8651)[_0x4e31('0xe')](function(_0x171a42){logger[_0x4e31('0xf')](_0x4e31('0x10'),_0x41abc8,_0x2e8651['body']);})[_0x4e31('0x11')](function(_0x269469){logger[_0x4e31('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x41abc8,JSON[_0x4e31('0x13')](_0x269469));})[_0x4e31('0x2a')](function(){logger[_0x4e31('0xf')](_0x4e31('0x2b'),_0x41abc8);_0x44fbd5[_0x4e31('0x2c')]();});}else{logger[_0x4e31('0xf')](_0x4e31('0x2d'),_0x41abc8);_0x44fbd5[_0x4e31('0x2c')]();}}else{var _0x24b4e5=this;var _0x856589=_0x2033df[0x2][_0x4e31('0x2e')](/\\n/g,'\x0a');var _0x558c17={'credentials':{'private_key':_0x856589,'client_email':_0x2033df[0x1]}};var _0x17fd13=new dialogflow[(_0x4e31('0x2f'))](_0x558c17);var _0x55cb05=_0x17fd13[_0x4e31('0x30')](_0x2033df[0x0],md5(_0x24b4e5[_0x4e31('0x16')]['id']));var _0x522374={'session':_0x55cb05,'queryInput':{'text':{'text':_0x24b4e5[_0x4e31('0x31')]['body'],'languageCode':_0x2033df[0x3]||'en'}}};return _0x17fd13[_0x4e31('0x32')](_0x522374)[_0x4e31('0xe')](function(_0x50a23d){if(_0x50a23d&&_0x50a23d[_0x4e31('0x33')]){_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x34')]=_0x50a23d;var _0x1e9371=_0x50a23d[0x0];var _0x340a1e=_0x1e9371[_0x4e31('0x35')][_0x4e31('0x36')]&&_0x1e9371[_0x4e31('0x35')][_0x4e31('0x36')][_0x4e31('0x37')]?_0x1e9371['queryResult'][_0x4e31('0x36')][_0x4e31('0x37')]['end_conversation'][_0x4e31('0x38')]:![];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x39')]=_0x1e9371['queryResult'][_0x4e31('0x3a')];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x3b')]=_0x1e9371[_0x4e31('0x35')]['allRequiredParamsPresent'];_0x24b4e5[_0x4e31('0xc')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x1e9371['queryResult'][_0x4e31('0x36')]&&_0x1e9371[_0x4e31('0x35')]['diagnosticInfo']['fields']?_0x1e9371[_0x4e31('0x35')][_0x4e31('0x36')]['fields']['end_conversation'][_0x4e31('0x38')]:![];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x3c')]=_0x1e9371[_0x4e31('0x35')]['intent'][_0x4e31('0x3d')];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x3e')]=_0x1e9371['queryResult']['intent'][_0x4e31('0x3f')];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x40')]=_0x1e9371[_0x4e31('0x35')][_0x4e31('0x41')][_0x4e31('0x42')];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x43')]=_0x1e9371[_0x4e31('0x35')][_0x4e31('0x44')];_0x24b4e5[_0x4e31('0xc')][_0x4e31('0x45')]=_0x1e9371['queryResult'][_0x4e31('0x46')];_0x24b4e5['body'][_0x4e31('0x47')]=_0x1e9371[_0x4e31('0x35')][_0x4e31('0x48')];_0x2e8651['providerName']=_0x4e31('0x34');_0x2e8651[_0x4e31('0x49')]=JSON[_0x4e31('0x13')](_0x50a23d);var _0xe9ad2e=[];for(var _0x457183=0x0;_0x457183<_0x50a23d['length'];_0x457183++){var _0x41e4ac=_0x50a23d[_0x457183];if(_0x41e4ac&&_0x41e4ac[_0x4e31('0x35')]&&_0x41e4ac[_0x4e31('0x35')]['fulfillmentText']){_0xe9ad2e[_0x4e31('0x4a')](createMessage(_0x41abc8,_0x2cbafa,_0x2e8651,_0x41e4ac[_0x4e31('0x35')]['fulfillmentText']));}}return Promise[_0x4e31('0x4b')](_0xe9ad2e)[_0x4e31('0xe')](function(){if(_0x340a1e){_0x44fbd5['next']();}else{_0x44fbd5['stop']();}})[_0x4e31('0x11')](function(_0x4af4a0){logger['error'](_0x4e31('0x10'),_0x41abc8,JSON[_0x4e31('0x13')](_0x4af4a0));_0x44fbd5[_0x4e31('0x18')]();});}})[_0x4e31('0x11')](function(_0x57794d){logger[_0x4e31('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x41abc8,_0x57794d[_0x4e31('0x31')]);_0x44fbd5[_0x4e31('0x18')]();});}}catch(_0x3d4dfc){logger['error'](_0x4e31('0x10'),_0x41abc8,JSON['stringify'](_0x3d4dfc));_0x44fbd5[_0x4e31('0x2c')]();}};};
\ No newline at end of file
+var _0x19b3=['DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','length','fulfillmentText','all','dialogflow','md5','bluebird','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','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','ChatWebsiteId','account','AccountId','upperFirst','created','isEmpty','getMustacheRender','catch','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','detectIntent','dialogflowV2','diagnosticInfo','queryResult','fields','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','boolValue','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x19b3,0x194));var _0x319b=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x19b3[_0x4c7b20];return _0x4872bd;};'use strict';var _=require('lodash');var dialogflow=require(_0x319b('0x0'));var md5=require(_0x319b('0x1'));var moment=require('moment');var Promise=require(_0x319b('0x2'));var logger=require('../../../../config/logger')('routing');var utils=require(_0x319b('0x3'));var rpc={'chatMessage':require(_0x319b('0x4')),'openchannelMessage':require(_0x319b('0x5')),'mailMessage':require(_0x319b('0x6')),'smsMessage':require(_0x319b('0x7')),'faxMessage':require(_0x319b('0x8')),'whatsappMessage':require(_0x319b('0x9'))};function createMessage(_0x384ff2,_0x165f68,_0x5aa3c6,_0x23ec89){return new Promise(function(_0x2d1f6f,_0x2985c8){var _0x56fe47=_[_0x319b('0xa')](_0x5aa3c6);_0x56fe47[_0x319b('0xb')]=_0x23ec89;return rpc[_0x165f68+_0x319b('0xc')][_0x319b('0xd')](_0x56fe47)[_0x319b('0xe')](function(){logger[_0x319b('0xf')](_0x319b('0x10'),_0x384ff2,_0x56fe47[_0x319b('0xb')]);_0x2d1f6f();})['catch'](function(_0x1b98e3){logger[_0x319b('0x11')](_0x319b('0x10'),_0x384ff2,JSON[_0x319b('0x12')](_0x1b98e3));_0x2985c8(_0x1b98e3);});});}exports['consequence']=function(_0x5196ec,_0x110515){return function(_0x2c1fd6){try{if(!_[_0x319b('0x13')](this[_0x319b('0x14')][_0x319b('0x15')])){logger['info'](_0x319b('0x10'),_0x5196ec,_0x319b('0x16'));return _0x2c1fd6[_0x319b('0x17')]();}var _0x318811={'ContactId':this[_0x319b('0x18')]['id'],'sentAt':moment()[_0x319b('0x19')](_0x319b('0x1a')),'direction':_0x319b('0x1b')};if(this[_0x319b('0x1c')]===_0x319b('0x1d')||this[_0x319b('0x1c')]===_0x319b('0x1e')){_0x318811[_0x319b('0x1f')]=this[_0x319b('0x14')][_0x319b('0x1f')];}var _0x3daa5a=this[_0x319b('0x1c')];if(_0x3daa5a==='chat'){_0x318811[_0x319b('0x20')]=this[_0x319b('0x21')]['id'];}else{_0x318811[_['upperFirst'](_0x3daa5a)+_0x319b('0x22')]=this[_0x319b('0x21')]['id'];}_0x318811[_[_0x319b('0x23')](_0x3daa5a)+'InteractionId']=this['interaction']['id'];if(this[_0x319b('0x14')][_0x319b('0x24')]){var _0x215d29=_0x110515[0x4];if(!_[_0x319b('0x25')](_0x215d29)){_0x318811['body']=utils[_0x319b('0x26')](_0x215d29,this);return rpc[_0x3daa5a+'Message'][_0x319b('0xd')](_0x318811)[_0x319b('0xe')](function(_0x3ad606){logger['info'](_0x319b('0x10'),_0x5196ec,_0x318811[_0x319b('0xb')]);})[_0x319b('0x27')](function(_0x160408){logger[_0x319b('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x5196ec,JSON[_0x319b('0x12')](_0x160408));})['finally'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5196ec);_0x2c1fd6[_0x319b('0x28')]();});}else{logger[_0x319b('0xf')](_0x319b('0x29'),_0x5196ec);_0x2c1fd6[_0x319b('0x28')]();}}else{var _0x18ea81=this;var _0x5dce57=_0x110515[0x2][_0x319b('0x2a')](/\\n/g,'\x0a');var _0x63a6bc={'credentials':{'private_key':_0x5dce57,'client_email':_0x110515[0x1]}};var _0x3bd1f1=new dialogflow[(_0x319b('0x2b'))](_0x63a6bc);var _0x5e9ee2=_0x3bd1f1['sessionPath'](_0x110515[0x0],md5(_0x18ea81['interaction']['id']));var _0x1f7dc6={'session':_0x5e9ee2,'queryInput':{'text':{'text':_0x18ea81['message'][_0x319b('0xb')],'languageCode':_0x110515[0x3]||'en'}}};return _0x3bd1f1[_0x319b('0x2c')](_0x1f7dc6)[_0x319b('0xe')](function(_0x2d413d){if(_0x2d413d&&_0x2d413d['length']){_0x18ea81['body'][_0x319b('0x2d')]=_0x2d413d;var _0x4919df=_0x2d413d[0x0];var _0x369d1b=_0x4919df['queryResult'][_0x319b('0x2e')]&&_0x4919df[_0x319b('0x2f')]['diagnosticInfo'][_0x319b('0x30')]?_0x4919df['queryResult']['diagnosticInfo']['fields']['end_conversation']['boolValue']:![];_0x18ea81[_0x319b('0xb')][_0x319b('0x31')]=_0x4919df[_0x319b('0x2f')]['action'];_0x18ea81[_0x319b('0xb')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x4919df['queryResult'][_0x319b('0x32')];_0x18ea81['body'][_0x319b('0x33')]=_0x4919df[_0x319b('0x2f')][_0x319b('0x2e')]&&_0x4919df['queryResult'][_0x319b('0x2e')][_0x319b('0x30')]?_0x4919df['queryResult'][_0x319b('0x2e')][_0x319b('0x30')][_0x319b('0x34')][_0x319b('0x35')]:![];_0x18ea81[_0x319b('0xb')][_0x319b('0x36')]=_0x4919df['queryResult'][_0x319b('0x37')]['name'];_0x18ea81[_0x319b('0xb')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x4919df[_0x319b('0x2f')][_0x319b('0x37')]['displayName'];_0x18ea81[_0x319b('0xb')][_0x319b('0x38')]=_0x4919df['queryResult'][_0x319b('0x37')]['isFallback'];_0x18ea81['body'][_0x319b('0x39')]=_0x4919df[_0x319b('0x2f')]['languageCode'];_0x18ea81[_0x319b('0xb')][_0x319b('0x3a')]=_0x4919df[_0x319b('0x2f')]['queryText'];_0x18ea81[_0x319b('0xb')][_0x319b('0x3b')]=_0x4919df[_0x319b('0x2f')][_0x319b('0x3c')];_0x318811[_0x319b('0x3d')]=_0x319b('0x2d');_0x318811[_0x319b('0x3e')]=JSON[_0x319b('0x12')](_0x2d413d);var _0x4eeca0=[];for(var _0x3d6fad=0x0;_0x3d6fad<_0x2d413d[_0x319b('0x3f')];_0x3d6fad++){var _0x19c25f=_0x2d413d[_0x3d6fad];if(_0x19c25f&&_0x19c25f[_0x319b('0x2f')]&&_0x19c25f['queryResult'][_0x319b('0x40')]){_0x4eeca0['push'](createMessage(_0x5196ec,_0x3daa5a,_0x318811,_0x19c25f[_0x319b('0x2f')][_0x319b('0x40')]));}}return Promise[_0x319b('0x41')](_0x4eeca0)[_0x319b('0xe')](function(){if(_0x369d1b){_0x2c1fd6[_0x319b('0x17')]();}else{_0x2c1fd6[_0x319b('0x28')]();}})['catch'](function(_0x36982b){logger[_0x319b('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x5196ec,JSON['stringify'](_0x36982b));_0x2c1fd6[_0x319b('0x17')]();});}})[_0x319b('0x27')](function(_0x1e51ea){logger[_0x319b('0x11')](_0x319b('0x10'),_0x5196ec,_0x1e51ea['message']);_0x2c1fd6[_0x319b('0x17')]();});}}catch(_0x4af073){logger['error'](_0x319b('0x10'),_0x5196ec,JSON['stringify'](_0x4af073));_0x2c1fd6[_0x319b('0x28')]();}};};
\ No newline at end of file
index fef1a98..cf93a03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b1e=['[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','error','message','join','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex'];(function(_0x353bb0,_0xd0dd0a){var _0x4de3bb=function(_0x4a62d1){while(--_0x4a62d1){_0x353bb0['push'](_0x353bb0['shift']());}};_0x4de3bb(++_0xd0dd0a);}(_0x8b1e,0x86));var _0xe8b1=function(_0x3f807f,_0xd2f607){_0x3f807f=_0x3f807f-0x0;var _0x269f9b=_0x8b1e[_0x3f807f];return _0x269f9b;};'use strict';var schema=require(_0xe8b1('0x0'));var _=require(_0xe8b1('0x1'));var htmlToText=require(_0xe8b1('0x2'));var utils=require(_0xe8b1('0x3'));var logger=require(_0xe8b1('0x4'))(_0xe8b1('0x5'));var gotoif=schema({'condition':{'type':_0xe8b1('0x6'),'required':!![],'message':_0xe8b1('0x7')},'priorityTrue':{'type':_0xe8b1('0x8'),'message':_0xe8b1('0x9')},'priorityFalse':{'type':_0xe8b1('0x8'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xe8b1('0xa')]=function(_0x28abca,_0x2bda2e){return function(_0x3e0137){try{var _0x4e22b5={'condition':htmlToText[_0xe8b1('0xb')](utils['getMustacheRender'](_0x2bda2e[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2bda2e[0x1],'priorityFalse':_0x2bda2e[0x2]};var _0xc1026d=gotoif[_0xe8b1('0x0')](_0x4e22b5,{'typecast':!![]});if(_0xc1026d['length']){logger[_0xe8b1('0xc')]('[%s][GOTOIF]\x20%s',_0x28abca,_['map'](_0xc1026d,_0xe8b1('0xd'))[_0xe8b1('0xe')](',\x20'));_0x3e0137[_0xe8b1('0xf')]();}else{try{var _0x37534f=eval('('+_0x4e22b5[_0xe8b1('0x10')]+')');var _0x51b534=_0x37534f?_0x4e22b5[_0xe8b1('0x11')]:_0x4e22b5['priorityFalse'];logger[_0xe8b1('0x12')](_0xe8b1('0x13'),_0x28abca,_0x4e22b5[_0xe8b1('0x10')],_0x37534f,_0x51b534||_0xe8b1('0x14'));if(_0x51b534){var _0x3756f=_[_0xe8b1('0x15')](_0x3e0137['rules'](),{'p':_0x51b534});if(_0x3756f>=0x0){logger[_0xe8b1('0x12')](_0xe8b1('0x16'),_0x28abca,_0x51b534||_0xe8b1('0x14'),_0x3756f);_0x3e0137[_0xe8b1('0x14')](_0x3756f);}else{logger[_0xe8b1('0x12')](_0xe8b1('0x17'),_0x28abca,_0x51b534||'next');_0x3e0137[_0xe8b1('0xf')]();}}else{_0x3e0137[_0xe8b1('0x14')]();}}catch(_0x3ec4a4){logger[_0xe8b1('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x28abca,_0x3ec4a4[_0xe8b1('0xd')]);_0x3e0137[_0xe8b1('0xf')]();}}}catch(_0x1431cf){logger[_0xe8b1('0xc')](_0xe8b1('0x18'),_0x28abca,JSON[_0xe8b1('0x19')](_0x1431cf));_0x3e0137[_0xe8b1('0xf')]();}};};
\ No newline at end of file
+var _0x799d=['condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','number','fromString','getMustacheRender','replace','validate','length','error','[%s][GOTOIF]\x20%s','map','join','stop'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x799d,0x1de));var _0xd799=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x799d[_0x59ee6f];return _0x4c0979;};'use strict';var schema=require('validate');var _=require(_0xd799('0x0'));var htmlToText=require(_0xd799('0x1'));var utils=require(_0xd799('0x2'));var logger=require(_0xd799('0x3'))(_0xd799('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xd799('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xd799('0x5'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x3eef4a,_0x1ca478){return function(_0x2db213){try{var _0x5dffec={'condition':htmlToText[_0xd799('0x6')](utils[_0xd799('0x7')](_0x1ca478[0x0],this),{'wordwrap':![]})[_0xd799('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1ca478[0x1],'priorityFalse':_0x1ca478[0x2]};var _0x151675=gotoif[_0xd799('0x9')](_0x5dffec,{'typecast':!![]});if(_0x151675[_0xd799('0xa')]){logger[_0xd799('0xb')](_0xd799('0xc'),_0x3eef4a,_[_0xd799('0xd')](_0x151675,'message')[_0xd799('0xe')](',\x20'));_0x2db213[_0xd799('0xf')]();}else{try{var _0x37f5e3=eval('('+_0x5dffec[_0xd799('0x10')]+')');var _0x3da426=_0x37f5e3?_0x5dffec['priorityTrue']:_0x5dffec[_0xd799('0x11')];logger[_0xd799('0x12')](_0xd799('0x13'),_0x3eef4a,_0x5dffec[_0xd799('0x10')],_0x37f5e3,_0x3da426||'next');if(_0x3da426){var _0x559745=_[_0xd799('0x14')](_0x2db213['rules'](),{'p':_0x3da426});if(_0x559745>=0x0){logger[_0xd799('0x12')](_0xd799('0x15'),_0x3eef4a,_0x3da426||_0xd799('0x16'),_0x559745);_0x2db213[_0xd799('0x16')](_0x559745);}else{logger[_0xd799('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x3eef4a,_0x3da426||_0xd799('0x16'));_0x2db213[_0xd799('0xf')]();}}else{_0x2db213[_0xd799('0x16')]();}}catch(_0x539a9b){logger[_0xd799('0xb')](_0xd799('0x17'),_0x3eef4a,_0x539a9b[_0xd799('0x18')]);_0x2db213[_0xd799('0xf')]();}}}catch(_0x11c69b){logger['error'](_0xd799('0xc'),_0x3eef4a,JSON[_0xd799('0x19')](_0x11c69b));_0x2db213[_0xd799('0xf')]();}};};
\ No newline at end of file
index 3514282..72a4cb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9c5=['lodash','../../../../config/logger','number','consequence','validate','length','error','map','message','join','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop'];(function(_0x39a7b3,_0x9c5210){var _0x1e25e2=function(_0x530d86){while(--_0x530d86){_0x39a7b3['push'](_0x39a7b3['shift']());}};_0x1e25e2(++_0x9c5210);}(_0xb9c5,0xd1));var _0x5b9c=function(_0x1c8567,_0x5180c6){_0x1c8567=_0x1c8567-0x0;var _0x5309fd=_0xb9c5[_0x1c8567];return _0x5309fd;};'use strict';var schema=require('validate');var _=require(_0x5b9c('0x0'));var logger=require(_0x5b9c('0x1'))('routing');var gotop=schema({'priority':{'type':_0x5b9c('0x2'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x5b9c('0x3')]=function(_0x2494e7,_0x2d0bce){return function(_0x3ee444){try{var _0x4450e6={'priority':_0x2d0bce[0x0]};var _0x39a752=gotop[_0x5b9c('0x4')](_0x4450e6,{'typecast':!![]});if(_0x39a752[_0x5b9c('0x5')]){logger[_0x5b9c('0x6')]('[%s][GOTOP]\x20%s',_0x2494e7,_[_0x5b9c('0x7')](_0x39a752,_0x5b9c('0x8'))[_0x5b9c('0x9')](',\x20'));_0x3ee444['stop']();}else{logger['info'](_0x5b9c('0xa'),_0x2494e7,_0x4450e6['priority']);if(_0x4450e6[_0x5b9c('0xb')]){var _0x5b7f54=_[_0x5b9c('0xc')](_0x3ee444[_0x5b9c('0xd')](),{'p':_0x4450e6['priority']});if(_0x5b7f54>=0x0){logger[_0x5b9c('0xe')](_0x5b9c('0xf'),_0x2494e7,_0x4450e6[_0x5b9c('0xb')]||_0x5b9c('0x10'),_0x5b7f54);_0x3ee444[_0x5b9c('0x10')](_0x5b7f54);}else{logger[_0x5b9c('0xe')](_0x5b9c('0x11'),_0x2494e7,_0x4450e6[_0x5b9c('0xb')]||_0x5b9c('0x10'));_0x3ee444[_0x5b9c('0x12')]();}}else{_0x3ee444[_0x5b9c('0x10')]();}}}catch(_0x433563){logger[_0x5b9c('0x6')]('[%s][GOTOP]\x20%s',_0x2494e7,JSON['stringify'](_0x433563));_0x3ee444[_0x5b9c('0x12')]();}};};
\ No newline at end of file
+var _0x3b1d=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','priority','findIndex','rules','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','stop','validate','lodash','../../../../config/logger','routing'];(function(_0x49eb06,_0x47d2b6){var _0x4b8d67=function(_0xe1161e){while(--_0xe1161e){_0x49eb06['push'](_0x49eb06['shift']());}};_0x4b8d67(++_0x47d2b6);}(_0x3b1d,0x1b5));var _0xd3b1=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3b1d[_0x53ccf2];return _0x5a2964;};'use strict';var schema=require(_0xd3b1('0x0'));var _=require(_0xd3b1('0x1'));var logger=require(_0xd3b1('0x2'))(_0xd3b1('0x3'));var gotop=schema({'priority':{'type':_0xd3b1('0x4'),'required':!![],'message':_0xd3b1('0x5')}});exports[_0xd3b1('0x6')]=function(_0x1f2e77,_0x11301b){return function(_0x2a2df8){try{var _0x3e8cd7={'priority':_0x11301b[0x0]};var _0x19d53a=gotop[_0xd3b1('0x0')](_0x3e8cd7,{'typecast':!![]});if(_0x19d53a[_0xd3b1('0x7')]){logger[_0xd3b1('0x8')]('[%s][GOTOP]\x20%s',_0x1f2e77,_[_0xd3b1('0x9')](_0x19d53a,_0xd3b1('0xa'))[_0xd3b1('0xb')](',\x20'));_0x2a2df8['stop']();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x1f2e77,_0x3e8cd7[_0xd3b1('0xc')]);if(_0x3e8cd7[_0xd3b1('0xc')]){var _0x372cf6=_[_0xd3b1('0xd')](_0x2a2df8[_0xd3b1('0xe')](),{'p':_0x3e8cd7[_0xd3b1('0xc')]});if(_0x372cf6>=0x0){logger[_0xd3b1('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1f2e77,_0x3e8cd7[_0xd3b1('0xc')]||_0xd3b1('0x10'),_0x372cf6);_0x2a2df8['next'](_0x372cf6);}else{logger[_0xd3b1('0xf')](_0xd3b1('0x11'),_0x1f2e77,_0x3e8cd7[_0xd3b1('0xc')]||_0xd3b1('0x10'));_0x2a2df8['stop']();}}else{_0x2a2df8[_0xd3b1('0x10')]();}}}catch(_0x321716){logger[_0xd3b1('0x8')](_0xd3b1('0x12'),_0x1f2e77,JSON[_0xd3b1('0x13')](_0x321716));_0x2a2df8[_0xd3b1('0x14')]();}};};
\ No newline at end of file
index 66f0a21..afa84a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x105f=['Message','create','[%s][MESSAGE]\x20%s','body','next','stringify','stop','error','./utils','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','interaction'];(function(_0x1c3265,_0x4b0973){var _0x1b6a3d=function(_0x33d28d){while(--_0x33d28d){_0x1c3265['push'](_0x1c3265['shift']());}};_0x1b6a3d(++_0x4b0973);}(_0x105f,0x71));var _0xf105=function(_0x7a985b,_0xb2f429){_0x7a985b=_0x7a985b-0x0;var _0x1e92be=_0x105f[_0x7a985b];return _0x1e92be;};'use strict';var _=require('lodash');var utils=require(_0xf105('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xf105('0x1')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf105('0x2')),'faxMessage':require(_0xf105('0x3')),'whatsappMessage':require(_0xf105('0x4'))};exports[_0xf105('0x5')]=function(_0x58224e,_0x374059){return function(_0x100675){try{var _0x5f4946={'body':utils[_0xf105('0x6')](_0x374059[0x0],this),'ContactId':this['contact']['id']};if(this[_0xf105('0x7')]===_0xf105('0x8')){_0x5f4946[_0xf105('0x9')]=this[_0xf105('0xa')]['id'];}else{_0x5f4946[_['upperFirst'](this['channel'])+'AccountId']=this['account']['id'];}_0x5f4946[_[_0xf105('0xb')](this[_0xf105('0x7')])+'InteractionId']=this[_0xf105('0xc')]['id'];if(rpc[this[_0xf105('0x7')]+_0xf105('0xd')]){return rpc[this[_0xf105('0x7')]+_0xf105('0xd')][_0xf105('0xe')](_0x5f4946)['then'](function(_0x2f2dd5){logger['info'](_0xf105('0xf'),_0x58224e,_0x5f4946[_0xf105('0x10')]);_0x100675[_0xf105('0x11')]();})['catch'](function(_0x26b7b6){logger['error']('[%s][MESSAGE]\x20%s',_0x58224e,JSON[_0xf105('0x12')](_0x26b7b6));_0x100675[_0xf105('0x13')]();});}}catch(_0x24dd40){logger[_0xf105('0x14')](_0xf105('0xf'),_0x58224e,JSON['stringify'](_0x24dd40));_0x100675[_0xf105('0x13')]();}};};
\ No newline at end of file
+var _0x3ba2=['../../rpc/whatsappMessage','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0xa41afd,_0x1e5bcf){var _0x35172b=function(_0x40cda){while(--_0x40cda){_0xa41afd['push'](_0xa41afd['shift']());}};_0x35172b(++_0x1e5bcf);}(_0x3ba2,0x158));var _0x23ba=function(_0x6bc1bd,_0x4067e3){_0x6bc1bd=_0x6bc1bd-0x0;var _0x2526ed=_0x3ba2[_0x6bc1bd];return _0x2526ed;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x23ba('0x0'))(_0x23ba('0x1'));var rpc={'chatMessage':require(_0x23ba('0x2')),'openchannelMessage':require(_0x23ba('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x23ba('0x4')),'faxMessage':require(_0x23ba('0x5')),'whatsappMessage':require(_0x23ba('0x6'))};exports['consequence']=function(_0x5f0431,_0x5b530a){return function(_0x79511b){try{var _0x57e256={'body':utils[_0x23ba('0x7')](_0x5b530a[0x0],this),'ContactId':this[_0x23ba('0x8')]['id']};if(this[_0x23ba('0x9')]==='chat'){_0x57e256[_0x23ba('0xa')]=this[_0x23ba('0xb')]['id'];}else{_0x57e256[_[_0x23ba('0xc')](this[_0x23ba('0x9')])+_0x23ba('0xd')]=this[_0x23ba('0xb')]['id'];}_0x57e256[_[_0x23ba('0xc')](this[_0x23ba('0x9')])+_0x23ba('0xe')]=this[_0x23ba('0xf')]['id'];if(rpc[this['channel']+_0x23ba('0x10')]){return rpc[this[_0x23ba('0x9')]+_0x23ba('0x10')][_0x23ba('0x11')](_0x57e256)[_0x23ba('0x12')](function(_0x2246cc){logger['info'](_0x23ba('0x13'),_0x5f0431,_0x57e256[_0x23ba('0x14')]);_0x79511b[_0x23ba('0x15')]();})['catch'](function(_0x11f606){logger[_0x23ba('0x16')](_0x23ba('0x13'),_0x5f0431,JSON[_0x23ba('0x17')](_0x11f606));_0x79511b['stop']();});}}catch(_0x1f08df){logger[_0x23ba('0x16')]('[%s][MESSAGE]\x20%s',_0x5f0431,JSON['stringify'](_0x1f08df));_0x79511b[_0x23ba('0x18')]();}};};
\ No newline at end of file
index e21ab12..1dbb6f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1283=['routing','[%s][NOOP]\x20%s','getMustacheRender','next','error','stop','./utils','../../../../config/logger'];(function(_0x321c6d,_0x6e6f64){var _0x2f36da=function(_0x11c29a){while(--_0x11c29a){_0x321c6d['push'](_0x321c6d['shift']());}};_0x2f36da(++_0x6e6f64);}(_0x1283,0xe6));var _0x3128=function(_0x272156,_0x5e4b0d){_0x272156=_0x272156-0x0;var _0x1071d0=_0x1283[_0x272156];return _0x1071d0;};'use strict';var utils=require(_0x3128('0x0'));var logger=require(_0x3128('0x1'))(_0x3128('0x2'));exports['consequence']=function(_0x3b736e,_0x5910af){return function(_0x14eea2){try{logger['info'](_0x3128('0x3'),_0x3b736e,utils[_0x3128('0x4')](_0x5910af[0x0],this));_0x14eea2[_0x3128('0x5')]();}catch(_0x37874f){logger[_0x3128('0x6')](_0x3128('0x3'),_0x3b736e,JSON['stringify'](_0x37874f));_0x14eea2[_0x3128('0x7')]();}};};
\ No newline at end of file
+var _0xc065=['stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0xff5786,_0x2f0888){var _0x1da7ed=function(_0x454728){while(--_0x454728){_0xff5786['push'](_0xff5786['shift']());}};_0x1da7ed(++_0x2f0888);}(_0xc065,0xf2));var _0x5c06=function(_0x2e550d,_0x1f17d7){_0x2e550d=_0x2e550d-0x0;var _0x45d6bb=_0xc065[_0x2e550d];return _0x45d6bb;};'use strict';var utils=require(_0x5c06('0x0'));var logger=require(_0x5c06('0x1'))(_0x5c06('0x2'));exports[_0x5c06('0x3')]=function(_0x33d0f0,_0x5099e5){return function(_0x2d20a1){try{logger[_0x5c06('0x4')](_0x5c06('0x5'),_0x33d0f0,utils[_0x5c06('0x6')](_0x5099e5[0x0],this));_0x2d20a1[_0x5c06('0x7')]();}catch(_0x40c6fb){logger['error'](_0x5c06('0x5'),_0x33d0f0,JSON[_0x5c06('0x8')](_0x40c6fb));_0x2d20a1[_0x5c06('0x9')]();}};};
\ No newline at end of file
index 67f23c0..d3e78ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b5e=['catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','atimeout','qtimeout','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create'];(function(_0x2af504,_0x46a924){var _0x2abb2e=function(_0x53f705){while(--_0x53f705){_0x2af504['push'](_0x2af504['shift']());}};_0x2abb2e(++_0x46a924);}(_0x5b5e,0x151));var _0xe5b5=function(_0x2d9115,_0x121953){_0x2d9115=_0x2d9115-0x0;var _0x176ce4=_0x5b5e[_0x2d9115];return _0x176ce4;};'use strict';var schema=require(_0xe5b5('0x0'));var _=require('lodash');var util=require(_0xe5b5('0x1'));var seqqueue=require(_0xe5b5('0x2'));var moment=require(_0xe5b5('0x3'));var Redis=require('ioredis');var config=require(_0xe5b5('0x4'));var logger=require(_0xe5b5('0x5'))(_0xe5b5('0x6'));var strategy=require(_0xe5b5('0x7'));config['redis']=_[_0xe5b5('0x8')](config[_0xe5b5('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xe5b5('0xa'))(new Redis(config[_0xe5b5('0x9')]));var attributes=['id',_0xe5b5('0xb'),_0xe5b5('0xc'),_0xe5b5('0xd'),_0xe5b5('0xe'),_0xe5b5('0xf')];function emit(_0x4c26e7,_0x63af80,_0xce7b7c){io['to'](_0x4c26e7)[_0xe5b5('0x10')](_0x63af80,_0xce7b7c);}function emitChannelQueueInteraction(_0x24712e,_0x295745,_0x10206c,_0x9e4952,_0x5b7119,_0x2d17fe,_0x44210c,_0x4c86b6){var _0x44849a=_[_0xe5b5('0x11')](_0x10206c);_0x44849a[_0xe5b5('0xb')]=_0x4c86b6;_0x44849a[_0xe5b5('0xd')]=_0x295745;_0x44849a['account']=_0x9e4952;_0x44849a['id']=_0x5b7119;if(_0x2d17fe){_0x44210c[util[_0xe5b5('0x12')](_0xe5b5('0x13'),_0x24712e)][_0x5b7119]=_['pick'](_0x44849a,attributes);}else{delete _0x44210c[util['format'](_0xe5b5('0x13'),_0x24712e)][_0x5b7119];}emit(util[_0xe5b5('0x12')]('%s:queue:%s',_0x24712e,_0x295745),util[_0xe5b5('0x12')](_0xe5b5('0x14'),_0x24712e,_0x2d17fe?'save':'remove'),_[_0xe5b5('0x15')](_0x44849a,attributes));}var rpc={'openchannelQueueReport':require(_0xe5b5('0x16')),'mailQueueReport':require(_0xe5b5('0x17')),'chatQueueReport':require(_0xe5b5('0x18')),'smsQueueReport':require(_0xe5b5('0x19')),'faxQueueReport':require(_0xe5b5('0x1a')),'whatsappQueueReport':require(_0xe5b5('0x1b'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xe5b5('0x1c'),'message':_0xe5b5('0x1d')}});function startRouting(_0x5857aa,_0x4363ba,_0x136f14,_0x12532a){if(_0x5857aa&&_0x4363ba&&_0x136f14){_0x4363ba[_0xe5b5('0x1e')]+=0x1;var _0x26680b={'uniqueid':_0x5857aa,'from':_0x136f14[_0xe5b5('0x1f')]?_0x136f14[_0xe5b5('0x1f')]['from']:'','joinAt':moment()[_0xe5b5('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x136f14[_0xe5b5('0x20')]?_0x136f14['contact']['id']:null,'ListId':_0x136f14[_0xe5b5('0x21')]?_0x136f14[_0xe5b5('0x21')]['id']:null};_0x26680b[_[_0xe5b5('0x22')](_0x136f14[_0xe5b5('0x23')])+_0xe5b5('0x24')]=_0x4363ba['id']||null;_0x26680b[_[_0xe5b5('0x22')](_0x136f14[_0xe5b5('0x23')])+_0xe5b5('0x25')]=_0x136f14[_0xe5b5('0x26')]?_0x136f14[_0xe5b5('0x26')]['id']:null;_0x26680b[_[_0xe5b5('0x22')](_0x136f14[_0xe5b5('0x23')])+'MessageId']=_0x136f14[_0xe5b5('0x27')]?_0x136f14[_0xe5b5('0x27')]['id']:null;_0x26680b[_[_0xe5b5('0x22')](_0x136f14[_0xe5b5('0x23')])+(_0x136f14[_0xe5b5('0x23')]!==_0xe5b5('0x28')?_0xe5b5('0x29'):_0xe5b5('0x2a'))]=_0x136f14[_0xe5b5('0xc')]?_0x136f14['account']['id']:null;logger[_0xe5b5('0x2b')](util['format'](_0xe5b5('0x2c'),_0x5857aa,_0x4363ba[_0xe5b5('0x2d')]));emitChannelQueueInteraction(_0x136f14[_0xe5b5('0x23')],_0x4363ba[_0xe5b5('0x2d')],_0x26680b,_0x136f14[_0xe5b5('0xc')][_0xe5b5('0x2d')],_0x136f14[_0xe5b5('0x27')]['id'],!![],_0x12532a,_0x4363ba['id']);if(rpc[_0x136f14['channel']+_0xe5b5('0x2e')]){return rpc[_0x136f14[_0xe5b5('0x23')]+'QueueReport'][_0xe5b5('0x2f')](_0x26680b)[_0xe5b5('0x30')](function(_0x26a1f6){logger[_0xe5b5('0x31')](_0xe5b5('0x32'));});}}}function stopRouting(_0x363703,_0x52d8cd,_0x54b898,_0x501609){if(_0x363703&&_0x52d8cd){_0x52d8cd[_0xe5b5('0x1e')]-=0x1;var _0x22ae77={'leaveAt':moment()[_0xe5b5('0x12')](_0xe5b5('0x33')),'acceptAt':moment()[_0xe5b5('0x12')](_0xe5b5('0x33')),'reason':_0xe5b5('0x34')};logger[_0xe5b5('0x2b')](util['format'](_0xe5b5('0x35'),_0x363703,_0x52d8cd['name']));emitChannelQueueInteraction(_0x54b898['channel'],_0x52d8cd[_0xe5b5('0x2d')],_0x54b898[_0xe5b5('0x1f')],_0x54b898[_0xe5b5('0xc')][_0xe5b5('0x2d')],_0x54b898[_0xe5b5('0x27')]['id'],![],_0x501609,_0x52d8cd['id']);if(rpc[_0x54b898[_0xe5b5('0x23')]+_0xe5b5('0x2e')]){return rpc[_0x54b898[_0xe5b5('0x23')]+'QueueReport']['update'](_0x363703,_0x22ae77)[_0xe5b5('0x30')](function(_0x2b6e46){logger[_0xe5b5('0x31')](_0xe5b5('0x36'));});}}}function endRouting(_0x264841,_0x3524e0,_0x308c54,_0x401b90){if(_0x264841&&_0x3524e0){_0x3524e0[_0xe5b5('0x1e')]-=0x1;var _0x1fff68={'leaveAt':moment()[_0xe5b5('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0xe5b5('0x33')),'reason':_0xe5b5('0x37')};logger['info'](util[_0xe5b5('0x12')]('[%s][END:QUEUE][NAME:%s]',_0x264841,_0x3524e0[_0xe5b5('0x2d')]));emitChannelQueueInteraction(_0x308c54[_0xe5b5('0x23')],_0x3524e0[_0xe5b5('0x2d')],_0x308c54['body'],_0x308c54[_0xe5b5('0xc')][_0xe5b5('0x2d')],_0x308c54[_0xe5b5('0x27')]['id'],![],_0x401b90);if(rpc[_0x308c54[_0xe5b5('0x23')]+_0xe5b5('0x2e')]){return rpc[_0x308c54[_0xe5b5('0x23')]+_0xe5b5('0x2e')][_0xe5b5('0x38')](_0x264841,_0x1fff68)[_0xe5b5('0x30')](function(_0x1a35a8){logger[_0xe5b5('0x31')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x40f056){return function(_0x5c5d62){return _0x5c5d62[_0xe5b5('0x2d')][_0xe5b5('0x39')]()===_0x40f056[_0xe5b5('0x39')]();};}exports[_0xe5b5('0x3a')]=function(_0x5c17de,_0x3242a5,_0x4de3e4,_0x5f02ee){return function(_0x375653){try{var _0x4cc302={'name':_0x3242a5[0x0],'timeout':_0x3242a5[0x1]};var _0x56185a=queue['validate'](_0x4cc302,{'typecast':!![]});if(_0x56185a[_0xe5b5('0x3b')]){logger[_0xe5b5('0x31')](_0xe5b5('0x3c'),_0x5c17de,_[_0xe5b5('0x3d')](_0x56185a,_0xe5b5('0x27'))['join'](',\x20'));_0x375653[_0xe5b5('0x3e')]();}else{var _0x46b790=_[_0xe5b5('0x3f')](_0x4de3e4[_0x5f02ee[_0xe5b5('0x23')]+_0xe5b5('0x40')],handleFindQueue(_0x4cc302[_0xe5b5('0x2d')]));if(_0x46b790){startRouting(_0x5c17de,_0x46b790,_0x5f02ee,_0x4de3e4);var _0x21b8df=(_0x46b790['timeout']||0xa)*0x3e8;var _0x2a7a73=(_0x4cc302[_0xe5b5('0x37')]||0x14)*0x3e8;var _0x51e22b,_0x48e4bb;if(_0x21b8df>_0x2a7a73){_0x2a7a73=_0x21b8df;}var _0xc02849=seqqueue['createQueue'](_0x21b8df);_0xc02849['id']=_0x5c17de;_0xc02849[_0xe5b5('0x41')]=_0x21b8df;_0xc02849[_0xe5b5('0x42')]=_0x2a7a73;_0xc02849[_0xe5b5('0x23')]=_0x5f02ee[_0xe5b5('0x23')];_0x4de3e4['rules'][_0x5c17de]['on']('end',function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x5c17de);stopRouting(_0x5c17de,_0x46b790,_0x5f02ee,_0x4de3e4);clearTimeout(_0x51e22b);_0x51e22b=undefined;_0xc02849[_0xe5b5('0x43')](!![]);if(_0x4de3e4[_0xe5b5('0x44')][_0x5c17de]){delete _0x4de3e4[_0xe5b5('0x44')][_0x5c17de];}_0x375653[_0xe5b5('0x3e')]();});_0x4de3e4[_0xe5b5('0x44')][_0x5c17de]['on'](_0xe5b5('0x45'),function(){if(_0x4de3e4[_0xe5b5('0x44')][_0x5c17de]){delete _0x4de3e4[_0xe5b5('0x44')][_0x5c17de];}});_0x51e22b=setTimeout(function(){logger['info'](_0xe5b5('0x46'),_0x5c17de);endRouting(_0x5c17de,_0x46b790,_0x5f02ee,_0x4de3e4);clearTimeout(_0x51e22b);_0xc02849[_0xe5b5('0x43')](!![]);_0x375653['next']();},_0x2a7a73);switch(_0x46b790[_0xe5b5('0x47')]){case _0xe5b5('0x48'):strategy['rrmemory'](_0xc02849,_0x46b790,_0x4de3e4,_0x5f02ee);break;default:strategy[_0xe5b5('0x49')](_0xc02849,_0x46b790,_0x4de3e4,_0x5f02ee);}}else{logger[_0xe5b5('0x31')](_0xe5b5('0x4a'),_0x5c17de,_0x4cc302[_0xe5b5('0x2d')]);_0x375653[_0xe5b5('0x3e')]();}}}catch(_0x2f59c9){console[_0xe5b5('0x4b')](_0x2f59c9);logger[_0xe5b5('0x31')](_0xe5b5('0x3c'),_0x5c17de,_0x2f59c9[_0xe5b5('0x4c')]);_0x375653[_0xe5b5('0x3e')]();}};};
\ No newline at end of file
+var _0x9fd3=['from','joinAt','clone','queue_id','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fd3,0x8e));var _0x39fd=function(_0x4d2a06,_0x6148f6){_0x4d2a06=_0x4d2a06-0x0;var _0x519c46=_0x9fd3[_0x4d2a06];return _0x519c46;};'use strict';var schema=require(_0x39fd('0x0'));var _=require(_0x39fd('0x1'));var util=require(_0x39fd('0x2'));var seqqueue=require(_0x39fd('0x3'));var moment=require(_0x39fd('0x4'));var Redis=require('ioredis');var config=require(_0x39fd('0x5'));var logger=require('../../../../config/logger')(_0x39fd('0x6'));var strategy=require(_0x39fd('0x7'));config[_0x39fd('0x8')]=_[_0x39fd('0x9')](config[_0x39fd('0x8')],{'host':_0x39fd('0xa'),'port':0x18eb});var io=require(_0x39fd('0xb'))(new Redis(config['redis']));var attributes=['id','queue_id',_0x39fd('0xc'),_0x39fd('0xd'),_0x39fd('0xe'),_0x39fd('0xf')];function emit(_0x39576f,_0x545ef8,_0x327b0f){io['to'](_0x39576f)['emit'](_0x545ef8,_0x327b0f);}function emitChannelQueueInteraction(_0x525f43,_0x5543f9,_0x48b174,_0x4ec872,_0x52ba89,_0x4dbd8d,_0x1b9731,_0x36f359){var _0x333e97=_[_0x39fd('0x10')](_0x48b174);_0x333e97[_0x39fd('0x11')]=_0x36f359;_0x333e97[_0x39fd('0xd')]=_0x5543f9;_0x333e97[_0x39fd('0xc')]=_0x4ec872;_0x333e97['id']=_0x52ba89;if(_0x4dbd8d){_0x1b9731[util[_0x39fd('0x12')](_0x39fd('0x13'),_0x525f43)][_0x52ba89]=_[_0x39fd('0x14')](_0x333e97,attributes);}else{delete _0x1b9731[util['format'](_0x39fd('0x13'),_0x525f43)][_0x52ba89];}emit(util[_0x39fd('0x12')](_0x39fd('0x15'),_0x525f43,_0x5543f9),util['format'](_0x39fd('0x16'),_0x525f43,_0x4dbd8d?_0x39fd('0x17'):'remove'),_['pick'](_0x333e97,attributes));}var rpc={'openchannelQueueReport':require(_0x39fd('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x39fd('0x19')),'smsQueueReport':require(_0x39fd('0x1a')),'faxQueueReport':require(_0x39fd('0x1b')),'whatsappQueueReport':require(_0x39fd('0x1c'))};var queue=schema({'name':{'type':_0x39fd('0x1d'),'required':!![],'message':_0x39fd('0x1e')},'timeout':{'type':_0x39fd('0x1f'),'message':_0x39fd('0x20')}});function startRouting(_0xaf64fe,_0x5e10f4,_0x37fc13,_0xd69fdb){if(_0xaf64fe&&_0x5e10f4&&_0x37fc13){_0x5e10f4[_0x39fd('0x21')]+=0x1;var _0x295fac={'uniqueid':_0xaf64fe,'from':_0x37fc13[_0x39fd('0x22')]?_0x37fc13['body'][_0x39fd('0xe')]:'','joinAt':moment()[_0x39fd('0x12')](_0x39fd('0x23')),'ContactId':_0x37fc13[_0x39fd('0x24')]?_0x37fc13['contact']['id']:null,'ListId':_0x37fc13[_0x39fd('0x25')]?_0x37fc13['list']['id']:null};_0x295fac[_[_0x39fd('0x26')](_0x37fc13[_0x39fd('0x27')])+_0x39fd('0x28')]=_0x5e10f4['id']||null;_0x295fac[_['upperFirst'](_0x37fc13[_0x39fd('0x27')])+_0x39fd('0x29')]=_0x37fc13[_0x39fd('0x2a')]?_0x37fc13[_0x39fd('0x2a')]['id']:null;_0x295fac[_[_0x39fd('0x26')](_0x37fc13[_0x39fd('0x27')])+_0x39fd('0x2b')]=_0x37fc13[_0x39fd('0x2c')]?_0x37fc13['message']['id']:null;_0x295fac[_[_0x39fd('0x26')](_0x37fc13[_0x39fd('0x27')])+(_0x37fc13[_0x39fd('0x27')]!==_0x39fd('0x2d')?'AccountId':'WebsiteId')]=_0x37fc13['account']?_0x37fc13[_0x39fd('0xc')]['id']:null;logger[_0x39fd('0x2e')](util[_0x39fd('0x12')](_0x39fd('0x2f'),_0xaf64fe,_0x5e10f4[_0x39fd('0x30')]));emitChannelQueueInteraction(_0x37fc13[_0x39fd('0x27')],_0x5e10f4[_0x39fd('0x30')],_0x295fac,_0x37fc13[_0x39fd('0xc')]['name'],_0x37fc13[_0x39fd('0x2c')]['id'],!![],_0xd69fdb,_0x5e10f4['id']);if(rpc[_0x37fc13[_0x39fd('0x27')]+_0x39fd('0x31')]){return rpc[_0x37fc13[_0x39fd('0x27')]+_0x39fd('0x31')][_0x39fd('0x32')](_0x295fac)[_0x39fd('0x33')](function(_0x1c30c8){logger[_0x39fd('0x34')]('create\x20queue\x20report');});}}}function stopRouting(_0x54abca,_0x17dd0f,_0x1de273,_0x29d000){if(_0x54abca&&_0x17dd0f){_0x17dd0f[_0x39fd('0x21')]-=0x1;var _0x1954aa={'leaveAt':moment()['format'](_0x39fd('0x23')),'acceptAt':moment()[_0x39fd('0x12')](_0x39fd('0x23')),'reason':_0x39fd('0x35')};logger[_0x39fd('0x2e')](util[_0x39fd('0x12')](_0x39fd('0x36'),_0x54abca,_0x17dd0f[_0x39fd('0x30')]));emitChannelQueueInteraction(_0x1de273[_0x39fd('0x27')],_0x17dd0f[_0x39fd('0x30')],_0x1de273[_0x39fd('0x22')],_0x1de273[_0x39fd('0xc')][_0x39fd('0x30')],_0x1de273[_0x39fd('0x2c')]['id'],![],_0x29d000,_0x17dd0f['id']);if(rpc[_0x1de273[_0x39fd('0x27')]+_0x39fd('0x31')]){return rpc[_0x1de273[_0x39fd('0x27')]+'QueueReport'][_0x39fd('0x37')](_0x54abca,_0x1954aa)[_0x39fd('0x33')](function(_0x103c85){logger[_0x39fd('0x34')](_0x39fd('0x38'));});}}}function endRouting(_0x15eab1,_0x47081b,_0x227c8d,_0xbad20a){if(_0x15eab1&&_0x47081b){_0x47081b[_0x39fd('0x21')]-=0x1;var _0x53c25b={'leaveAt':moment()[_0x39fd('0x12')](_0x39fd('0x23')),'exitAt':moment()[_0x39fd('0x12')](_0x39fd('0x23')),'reason':_0x39fd('0x39')};logger[_0x39fd('0x2e')](util[_0x39fd('0x12')](_0x39fd('0x3a'),_0x15eab1,_0x47081b['name']));emitChannelQueueInteraction(_0x227c8d[_0x39fd('0x27')],_0x47081b['name'],_0x227c8d['body'],_0x227c8d[_0x39fd('0xc')][_0x39fd('0x30')],_0x227c8d[_0x39fd('0x2c')]['id'],![],_0xbad20a);if(rpc[_0x227c8d[_0x39fd('0x27')]+'QueueReport']){return rpc[_0x227c8d[_0x39fd('0x27')]+_0x39fd('0x31')]['update'](_0x15eab1,_0x53c25b)['catch'](function(_0x5e7284){logger[_0x39fd('0x34')](_0x39fd('0x38'));});}}}function handleFindQueue(_0x55f5eb){return function(_0x13439b){return _0x13439b[_0x39fd('0x30')][_0x39fd('0x3b')]()===_0x55f5eb[_0x39fd('0x3b')]();};}exports[_0x39fd('0x3c')]=function(_0x2f5dec,_0xa9adcf,_0x1a470d,_0x34ebf8){return function(_0x5c36be){try{var _0x479515={'name':_0xa9adcf[0x0],'timeout':_0xa9adcf[0x1]};var _0x25ecab=queue[_0x39fd('0x0')](_0x479515,{'typecast':!![]});if(_0x25ecab[_0x39fd('0x3d')]){logger['error'](_0x39fd('0x3e'),_0x2f5dec,_[_0x39fd('0x3f')](_0x25ecab,_0x39fd('0x2c'))[_0x39fd('0x40')](',\x20'));_0x5c36be['stop']();}else{var _0x3397f5=_['find'](_0x1a470d[_0x34ebf8['channel']+'Queues'],handleFindQueue(_0x479515[_0x39fd('0x30')]));if(_0x3397f5){startRouting(_0x2f5dec,_0x3397f5,_0x34ebf8,_0x1a470d);var _0x5bb149=(_0x3397f5[_0x39fd('0x39')]||0xa)*0x3e8;var _0x4d2744=(_0x479515[_0x39fd('0x39')]||0x14)*0x3e8;var _0x1831dd,_0x137b66;if(_0x5bb149>_0x4d2744){_0x4d2744=_0x5bb149;}var _0xc8082e=seqqueue['createQueue'](_0x5bb149);_0xc8082e['id']=_0x2f5dec;_0xc8082e['atimeout']=_0x5bb149;_0xc8082e[_0x39fd('0x41')]=_0x4d2744;_0xc8082e[_0x39fd('0x27')]=_0x34ebf8[_0x39fd('0x27')];_0x1a470d['rules'][_0x2f5dec]['on'](_0x39fd('0x42'),function(){logger['info'](_0x39fd('0x43'),_0x2f5dec);stopRouting(_0x2f5dec,_0x3397f5,_0x34ebf8,_0x1a470d);clearTimeout(_0x1831dd);_0x1831dd=undefined;_0xc8082e[_0x39fd('0x44')](!![]);if(_0x1a470d[_0x39fd('0x45')][_0x2f5dec]){delete _0x1a470d[_0x39fd('0x45')][_0x2f5dec];}_0x5c36be[_0x39fd('0x46')]();});_0x1a470d[_0x39fd('0x45')][_0x2f5dec]['on'](_0x39fd('0x47'),function(){if(_0x1a470d[_0x39fd('0x45')][_0x2f5dec]){delete _0x1a470d[_0x39fd('0x45')][_0x2f5dec];}});_0x1831dd=setTimeout(function(){logger[_0x39fd('0x2e')](_0x39fd('0x48'),_0x2f5dec);endRouting(_0x2f5dec,_0x3397f5,_0x34ebf8,_0x1a470d);clearTimeout(_0x1831dd);_0xc8082e[_0x39fd('0x44')](!![]);_0x5c36be[_0x39fd('0x49')]();},_0x4d2744);switch(_0x3397f5[_0x39fd('0x4a')]){case _0x39fd('0x4b'):strategy[_0x39fd('0x4b')](_0xc8082e,_0x3397f5,_0x1a470d,_0x34ebf8);break;default:strategy[_0x39fd('0x4c')](_0xc8082e,_0x3397f5,_0x1a470d,_0x34ebf8);}}else{logger[_0x39fd('0x34')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x2f5dec,_0x479515[_0x39fd('0x30')]);_0x5c36be[_0x39fd('0x46')]();}}}catch(_0x404dce){console['log'](_0x404dce);logger[_0x39fd('0x34')](_0x39fd('0x3e'),_0x2f5dec,_0x404dce[_0x39fd('0x4d')]);_0x5c36be['stop']();}};};
\ No newline at end of file
index 2fcec56..391a658 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x332c=['writeLog','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','timeout','handleTimeout','handleDrained','prototype','info','agent','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','busyQueue','showNotification',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification'];(function(_0x21a342,_0x1ffe7d){var _0x4fc401=function(_0x298cb5){while(--_0x298cb5){_0x21a342['push'](_0x21a342['shift']());}};_0x4fc401(++_0x1ffe7d);}(_0x332c,0x1e2));var _0xc332=function(_0x224a1e,_0x60c18e){_0x224a1e=_0x224a1e-0x0;var _0x3d0457=_0x332c[_0x224a1e];return _0x3d0457;};'use strict';var _=require(_0xc332('0x0'));var uuid=require(_0xc332('0x1'));var util=require(_0xc332('0x2'));var logger=require(_0xc332('0x3'))(_0xc332('0x4'));var Agent=function(_0x8f33e8,_0x3e99bc,_0x1da37d,_0x5cdf32){this[_0xc332('0x5')]=uuid['v4']();this[_0xc332('0x6')]=_0x8f33e8;this['agent']=_0x3e99bc;this[_0xc332('0x7')]=_0x1da37d;this[_0xc332('0x4')]=_0x5cdf32;this['squeue'][_0xc332('0x8')](this[_0xc332('0x9')][_0xc332('0xa')](this),this['handleTimeout']['bind'](this));this[_0xc332('0x6')]['on'](_0xc332('0xb'),this[_0xc332('0xc')]['bind'](this));this[_0xc332('0x6')]['on']('drained',this[_0xc332('0xd')][_0xc332('0xa')](this));};Agent['prototype'][_0xc332('0x8')]=function(){this['squeue']['push'](this[_0xc332('0x9')][_0xc332('0xa')](this),this[_0xc332('0xc')][_0xc332('0xa')](this));};Agent[_0xc332('0xe')][_0xc332('0xd')]=function(){this[_0xc332('0xc')](!![]);};Agent[_0xc332('0xe')][_0xc332('0x9')]=function(_0x5647f5){logger[_0xc332('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xc332('0x6')]['id'],this[_0xc332('0x10')]['id']);if(_['isNil'](this[_0xc332('0x7')][_0xc332('0x11')][this[_0xc332('0x10')]['id']])){logger['info'](_0xc332('0x12'),this[_0xc332('0x6')]['id'],this[_0xc332('0x10')]['id']);setTimeout(this[_0xc332('0x8')][_0xc332('0xa')](this),0x3e8);}else{if(this[_0xc332('0x4')][_0xc332('0x13')]||util[_0xc332('0x14')](this[_0xc332('0x6')]['id'],this[_0xc332('0x7')][_0xc332('0x11')][this[_0xc332('0x10')]['id']],this[_0xc332('0x6')]['channel'],![])){this[_0xc332('0x7')][_0xc332('0x11')][this[_0xc332('0x10')]['id']][_0xc332('0x15')]=!![];this['realtime'][_0xc332('0x11')][this['agent']['id']][_0xc332('0x16')]=undefined;util[_0xc332('0x17')](this['notificationId'],this[_0xc332('0x6')]['id'],this[_0xc332('0x7')][_0xc332('0x11')][this['agent']['id']],null,this['routing']);util['writeLog'](this[_0xc332('0x6')]['id'],this[_0xc332('0x7')][_0xc332('0x11')][this[_0xc332('0x10')]['id']],'RINGING'+(this[_0xc332('0x4')]['forcedOwnership']?_0xc332('0x18'):''));}else{logger[_0xc332('0xf')](_0xc332('0x19'),this[_0xc332('0x6')]['id'],this[_0xc332('0x10')]['id']);setTimeout(this[_0xc332('0x8')][_0xc332('0xa')](this),0x3e8);}}};Agent[_0xc332('0xe')][_0xc332('0xc')]=function(_0x1bd3d7){if(_['isNil'](this['realtime']['agents'][this[_0xc332('0x10')]['id']])){return logger['info'](_0xc332('0x12'),this['squeue']['id'],this[_0xc332('0x10')]['id']);}else{logger[_0xc332('0xf')](_0xc332('0x1a'),this[_0xc332('0x6')]['id'],this[_0xc332('0x10')]['id']);util[_0xc332('0x1b')](this['notificationId'],this['squeue']['id'],this['realtime']['agents'][this[_0xc332('0x10')]['id']],null,this['routing']);this[_0xc332('0x7')]['agents'][this[_0xc332('0x10')]['id']]['busy']=![];this[_0xc332('0x7')][_0xc332('0x11')][this[_0xc332('0x10')]['id']]['busyQueue']=undefined;util[_0xc332('0x1c')](this[_0xc332('0x6')]['id'],this[_0xc332('0x7')][_0xc332('0x11')][this['agent']['id']],_0x1bd3d7?'STOP':_0xc332('0x1d'));}if(!_0x1bd3d7){setTimeout(this[_0xc332('0x8')][_0xc332('0xa')](this),0x3e8);}};function agent(_0xb7ed3e,_0x44fc4c,_0x447405,_0x14cdd4){return new Agent(_0xb7ed3e,_0x44fc4c,_0x447405,_0x14cdd4);}module['exports']=agent;
\ No newline at end of file
+var _0x1703=['[%s][AGENT]\x20try\x20with\x20%s','agents','info','forcedOwnership','isAgentAvailable','busy','busyQueue','writeLog',':FORCED','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','exports','uuid','../../../../../config/logger','routing','notificationId','agent','realtime','push','handleRun','bind','handleTimeout','squeue','timeout','drained','handleDrained','prototype'];(function(_0x36d831,_0x6c602a){var _0x5bc013=function(_0x1b0e7f){while(--_0x1b0e7f){_0x36d831['push'](_0x36d831['shift']());}};_0x5bc013(++_0x6c602a);}(_0x1703,0x16a));var _0x3170=function(_0x1f6258,_0x3c15b7){_0x1f6258=_0x1f6258-0x0;var _0x365378=_0x1703[_0x1f6258];return _0x365378;};'use strict';var _=require('lodash');var uuid=require(_0x3170('0x0'));var util=require('./util');var logger=require(_0x3170('0x1'))(_0x3170('0x2'));var Agent=function(_0x3b4615,_0xfc5f94,_0x1440e6,_0x4c3c67){this[_0x3170('0x3')]=uuid['v4']();this['squeue']=_0x3b4615;this[_0x3170('0x4')]=_0xfc5f94;this[_0x3170('0x5')]=_0x1440e6;this[_0x3170('0x2')]=_0x4c3c67;this['squeue'][_0x3170('0x6')](this[_0x3170('0x7')][_0x3170('0x8')](this),this[_0x3170('0x9')][_0x3170('0x8')](this));this[_0x3170('0xa')]['on'](_0x3170('0xb'),this[_0x3170('0x9')]['bind'](this));this[_0x3170('0xa')]['on'](_0x3170('0xc'),this[_0x3170('0xd')][_0x3170('0x8')](this));};Agent['prototype'][_0x3170('0x6')]=function(){this['squeue'][_0x3170('0x6')](this[_0x3170('0x7')]['bind'](this),this[_0x3170('0x9')]['bind'](this));};Agent[_0x3170('0xe')][_0x3170('0xd')]=function(){this[_0x3170('0x9')](!![]);};Agent[_0x3170('0xe')][_0x3170('0x7')]=function(_0x3a651a){logger['info'](_0x3170('0xf'),this[_0x3170('0xa')]['id'],this[_0x3170('0x4')]['id']);if(_['isNil'](this[_0x3170('0x5')][_0x3170('0x10')][this[_0x3170('0x4')]['id']])){logger[_0x3170('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x3170('0x4')]['id']);setTimeout(this[_0x3170('0x6')][_0x3170('0x8')](this),0x3e8);}else{if(this[_0x3170('0x2')][_0x3170('0x12')]||util[_0x3170('0x13')](this['squeue']['id'],this[_0x3170('0x5')][_0x3170('0x10')][this[_0x3170('0x4')]['id']],this[_0x3170('0xa')]['channel'],![])){this[_0x3170('0x5')][_0x3170('0x10')][this['agent']['id']][_0x3170('0x14')]=!![];this['realtime']['agents'][this[_0x3170('0x4')]['id']][_0x3170('0x15')]=undefined;util['showNotification'](this[_0x3170('0x3')],this['squeue']['id'],this['realtime']['agents'][this['agent']['id']],null,this[_0x3170('0x2')]);util[_0x3170('0x16')](this['squeue']['id'],this[_0x3170('0x5')][_0x3170('0x10')][this[_0x3170('0x4')]['id']],'RINGING'+(this[_0x3170('0x2')][_0x3170('0x12')]?_0x3170('0x17'):''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x3170('0xa')]['id'],this[_0x3170('0x4')]['id']);setTimeout(this[_0x3170('0x6')][_0x3170('0x8')](this),0x3e8);}}};Agent[_0x3170('0xe')][_0x3170('0x9')]=function(_0x562193){if(_[_0x3170('0x18')](this[_0x3170('0x5')][_0x3170('0x10')][this[_0x3170('0x4')]['id']])){return logger[_0x3170('0x11')](_0x3170('0x19'),this[_0x3170('0xa')]['id'],this['agent']['id']);}else{logger[_0x3170('0x11')](_0x3170('0x1a'),this[_0x3170('0xa')]['id'],this['agent']['id']);util['hideNotification'](this[_0x3170('0x3')],this['squeue']['id'],this['realtime'][_0x3170('0x10')][this[_0x3170('0x4')]['id']],null,this[_0x3170('0x2')]);this[_0x3170('0x5')][_0x3170('0x10')][this[_0x3170('0x4')]['id']][_0x3170('0x14')]=![];this[_0x3170('0x5')][_0x3170('0x10')][this[_0x3170('0x4')]['id']]['busyQueue']=undefined;util[_0x3170('0x16')](this[_0x3170('0xa')]['id'],this['realtime']['agents'][this[_0x3170('0x4')]['id']],_0x562193?_0x3170('0x1b'):'TIMEOUT');}if(!_0x562193){setTimeout(this[_0x3170('0x6')][_0x3170('0x8')](this),0x3e8);}};function agent(_0x4d4142,_0x57d8f7,_0x22388c,_0x29f92f){return new Agent(_0x4d4142,_0x57d8f7,_0x22388c,_0x29f92f);}module[_0x3170('0x1c')]=agent;
\ No newline at end of file
index cdd52e5..91223ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cc=['name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','queue','Agents','length','isNil','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','busyQueue'];(function(_0x266d04,_0x3932cf){var _0x1c2550=function(_0x2fbdbd){while(--_0x2fbdbd){_0x266d04['push'](_0x266d04['shift']());}};_0x1c2550(++_0x3932cf);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x2e81c9,_0x15a07c){_0x2e81c9=_0x2e81c9-0x0;var _0x217cf2=_0xf3cc[_0x2e81c9];return _0x217cf2;};'use strict';var _=require(_0xcf3c('0x0'));var uuid=require(_0xcf3c('0x1'));var util=require(_0xcf3c('0x2'));var logger=require(_0xcf3c('0x3'))('routing');var Beepall=function(_0x3b60ce,_0x14ec9a,_0x2bc6a3,_0x582153){this[_0xcf3c('0x4')]=uuid['v4']();this[_0xcf3c('0x5')]=_0x3b60ce;this['queue']=_0x14ec9a;this[_0xcf3c('0x6')]=_0x2bc6a3;this[_0xcf3c('0x7')]=_0x582153;this[_0xcf3c('0x5')][_0xcf3c('0x8')](this[_0xcf3c('0x9')][_0xcf3c('0xa')](this),this[_0xcf3c('0xb')][_0xcf3c('0xa')](this));this[_0xcf3c('0x5')]['on'](_0xcf3c('0xc'),this['handleTimeout']['bind'](this));this[_0xcf3c('0x5')]['on'](_0xcf3c('0xd'),this[_0xcf3c('0xe')][_0xcf3c('0xa')](this));};Beepall[_0xcf3c('0xf')][_0xcf3c('0x8')]=function(){this[_0xcf3c('0x5')][_0xcf3c('0x8')](this['handleRun'][_0xcf3c('0xa')](this),this[_0xcf3c('0xb')]['bind'](this));};Beepall[_0xcf3c('0xf')]['handleDrained']=function(_0x55ef34){this['handleTimeout'](!![]);};Beepall[_0xcf3c('0xf')]['handleRun']=function(_0x2f387b){var _0x1a3565=!![];if(!_['isNil'](this[_0xcf3c('0x10')])&&!_['isNil'](this[_0xcf3c('0x10')][_0xcf3c('0x11')])&&this[_0xcf3c('0x10')]['Agents'][_0xcf3c('0x12')]>0x0){for(var _0x190c8c=0x0,_0x395159;_0x190c8c<this[_0xcf3c('0x10')]['Agents'][_0xcf3c('0x12')];_0x190c8c+=0x1){_0x395159=this[_0xcf3c('0x10')][_0xcf3c('0x11')][_0x190c8c]['id'];if(_[_0xcf3c('0x13')](this[_0xcf3c('0x6')][_0xcf3c('0x14')][_0x395159])){logger[_0xcf3c('0x15')](_0xcf3c('0x16'),this[_0xcf3c('0x5')]['id'],_0x395159);}else{if(util[_0xcf3c('0x17')](this[_0xcf3c('0x5')]['id'],this[_0xcf3c('0x6')]['agents'][_0x395159],this[_0xcf3c('0x5')]['channel'],!![])){_0x1a3565=![];util[_0xcf3c('0x18')](this[_0xcf3c('0x5')]['id'],this['realtime'][_0xcf3c('0x14')][_0x395159],_0xcf3c('0x19'));this[_0xcf3c('0x6')][_0xcf3c('0x14')][_0x395159][_0xcf3c('0x1a')]=!![];this[_0xcf3c('0x6')][_0xcf3c('0x14')][_0x395159][_0xcf3c('0x1b')]=this['queue'][_0xcf3c('0x1c')];util['showNotification'](this[_0xcf3c('0x4')],this[_0xcf3c('0x5')]['id'],this[_0xcf3c('0x6')][_0xcf3c('0x14')][_0x395159],this[_0xcf3c('0x10')],this[_0xcf3c('0x7')]);}}}if(_0x1a3565){logger['info'](_0xcf3c('0x1d'),this['squeue']['id']);setTimeout(this[_0xcf3c('0x8')][_0xcf3c('0xa')](this),0x3e8);}}else{logger[_0xcf3c('0x15')]('[%s][QUEUE]\x20EMPTY',this[_0xcf3c('0x5')]['id']);setTimeout(this['push'][_0xcf3c('0xa')](this),0x3e8);}};Beepall[_0xcf3c('0xf')][_0xcf3c('0xb')]=function(_0x5bdae3){if(!_['isNil'](this[_0xcf3c('0x10')])&&!_[_0xcf3c('0x13')](this[_0xcf3c('0x10')][_0xcf3c('0x11')])){for(var _0x502bca=0x0,_0x1fae74;_0x502bca<this[_0xcf3c('0x10')][_0xcf3c('0x11')]['length'];_0x502bca+=0x1){_0x1fae74=this[_0xcf3c('0x10')][_0xcf3c('0x11')][_0x502bca]['id'];if(_[_0xcf3c('0x13')](this['realtime'][_0xcf3c('0x14')][_0x1fae74])){logger[_0xcf3c('0x15')](_0xcf3c('0x16'),this[_0xcf3c('0x5')]['id'],_0x1fae74);}else{util[_0xcf3c('0x1e')](this['notificationId'],this[_0xcf3c('0x5')]['id'],this['realtime'][_0xcf3c('0x14')][_0x1fae74],this['queue'],this[_0xcf3c('0x7')]);util[_0xcf3c('0x18')](this[_0xcf3c('0x5')]['id'],this[_0xcf3c('0x6')][_0xcf3c('0x14')][_0x1fae74],_0x5bdae3?_0xcf3c('0x1f'):_0xcf3c('0x20'));this[_0xcf3c('0x6')]['agents'][_0x1fae74][_0xcf3c('0x1a')]=![];this[_0xcf3c('0x6')][_0xcf3c('0x14')][_0x1fae74][_0xcf3c('0x1b')]=undefined;}}}if(!_0x5bdae3){setTimeout(this[_0xcf3c('0x8')][_0xcf3c('0xa')](this),0x3e8);}};function beepall(_0x9a64be,_0xff382e,_0x16f81d,_0x22fed3){return new Beepall(_0x9a64be,_0xff382e,_0x16f81d,_0x22fed3);}module['exports']=beepall;
\ No newline at end of file
+var _0xb4c7=['agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','STOP','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','push','isNil','queue','Agents','length'];(function(_0x412d4e,_0x615fb1){var _0x37995a=function(_0x42a740){while(--_0x42a740){_0x412d4e['push'](_0x412d4e['shift']());}};_0x37995a(++_0x615fb1);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x1a12a8,_0x30348a){_0x1a12a8=_0x1a12a8-0x0;var _0x4fb1ca=_0xb4c7[_0x1a12a8];return _0x4fb1ca;};'use strict';var _=require(_0x7b4c('0x0'));var uuid=require(_0x7b4c('0x1'));var util=require(_0x7b4c('0x2'));var logger=require(_0x7b4c('0x3'))(_0x7b4c('0x4'));var Beepall=function(_0x4bef48,_0x387199,_0x149d55,_0x3ebc75){this[_0x7b4c('0x5')]=uuid['v4']();this[_0x7b4c('0x6')]=_0x4bef48;this['queue']=_0x387199;this[_0x7b4c('0x7')]=_0x149d55;this[_0x7b4c('0x4')]=_0x3ebc75;this[_0x7b4c('0x6')]['push'](this[_0x7b4c('0x8')][_0x7b4c('0x9')](this),this['handleTimeout'][_0x7b4c('0x9')](this));this[_0x7b4c('0x6')]['on'](_0x7b4c('0xa'),this[_0x7b4c('0xb')][_0x7b4c('0x9')](this));this[_0x7b4c('0x6')]['on'](_0x7b4c('0xc'),this[_0x7b4c('0xd')][_0x7b4c('0x9')](this));};Beepall[_0x7b4c('0xe')]['push']=function(){this['squeue'][_0x7b4c('0xf')](this[_0x7b4c('0x8')][_0x7b4c('0x9')](this),this[_0x7b4c('0xb')][_0x7b4c('0x9')](this));};Beepall[_0x7b4c('0xe')][_0x7b4c('0xd')]=function(_0x40c830){this[_0x7b4c('0xb')](!![]);};Beepall[_0x7b4c('0xe')]['handleRun']=function(_0x2edb77){var _0x3d8362=!![];if(!_[_0x7b4c('0x10')](this[_0x7b4c('0x11')])&&!_[_0x7b4c('0x10')](this[_0x7b4c('0x11')][_0x7b4c('0x12')])&&this[_0x7b4c('0x11')]['Agents'][_0x7b4c('0x13')]>0x0){for(var _0xe71d88=0x0,_0x15a5a9;_0xe71d88<this[_0x7b4c('0x11')]['Agents'][_0x7b4c('0x13')];_0xe71d88+=0x1){_0x15a5a9=this[_0x7b4c('0x11')][_0x7b4c('0x12')][_0xe71d88]['id'];if(_[_0x7b4c('0x10')](this[_0x7b4c('0x7')][_0x7b4c('0x14')][_0x15a5a9])){logger[_0x7b4c('0x15')](_0x7b4c('0x16'),this[_0x7b4c('0x6')]['id'],_0x15a5a9);}else{if(util['isAgentAvailable'](this[_0x7b4c('0x6')]['id'],this[_0x7b4c('0x7')][_0x7b4c('0x14')][_0x15a5a9],this[_0x7b4c('0x6')][_0x7b4c('0x17')],!![])){_0x3d8362=![];util[_0x7b4c('0x18')](this[_0x7b4c('0x6')]['id'],this[_0x7b4c('0x7')][_0x7b4c('0x14')][_0x15a5a9],_0x7b4c('0x19'));this['realtime'][_0x7b4c('0x14')][_0x15a5a9][_0x7b4c('0x1a')]=!![];this[_0x7b4c('0x7')][_0x7b4c('0x14')][_0x15a5a9][_0x7b4c('0x1b')]=this[_0x7b4c('0x11')][_0x7b4c('0x1c')];util[_0x7b4c('0x1d')](this[_0x7b4c('0x5')],this[_0x7b4c('0x6')]['id'],this[_0x7b4c('0x7')][_0x7b4c('0x14')][_0x15a5a9],this[_0x7b4c('0x11')],this['routing']);}}}if(_0x3d8362){logger[_0x7b4c('0x15')](_0x7b4c('0x1e'),this[_0x7b4c('0x6')]['id']);setTimeout(this[_0x7b4c('0xf')][_0x7b4c('0x9')](this),0x3e8);}}else{logger[_0x7b4c('0x15')](_0x7b4c('0x1f'),this[_0x7b4c('0x6')]['id']);setTimeout(this[_0x7b4c('0xf')][_0x7b4c('0x9')](this),0x3e8);}};Beepall[_0x7b4c('0xe')][_0x7b4c('0xb')]=function(_0x3544bc){if(!_[_0x7b4c('0x10')](this[_0x7b4c('0x11')])&&!_[_0x7b4c('0x10')](this[_0x7b4c('0x11')][_0x7b4c('0x12')])){for(var _0x9d3d31=0x0,_0x4f0d33;_0x9d3d31<this['queue']['Agents'][_0x7b4c('0x13')];_0x9d3d31+=0x1){_0x4f0d33=this[_0x7b4c('0x11')][_0x7b4c('0x12')][_0x9d3d31]['id'];if(_[_0x7b4c('0x10')](this['realtime'][_0x7b4c('0x14')][_0x4f0d33])){logger[_0x7b4c('0x15')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x7b4c('0x6')]['id'],_0x4f0d33);}else{util['hideNotification'](this[_0x7b4c('0x5')],this[_0x7b4c('0x6')]['id'],this[_0x7b4c('0x7')]['agents'][_0x4f0d33],this[_0x7b4c('0x11')],this[_0x7b4c('0x4')]);util['writeLog'](this[_0x7b4c('0x6')]['id'],this[_0x7b4c('0x7')][_0x7b4c('0x14')][_0x4f0d33],_0x3544bc?_0x7b4c('0x20'):'TIMEOUT');this['realtime'][_0x7b4c('0x14')][_0x4f0d33][_0x7b4c('0x1a')]=![];this['realtime'][_0x7b4c('0x14')][_0x4f0d33]['busyQueue']=undefined;}}}if(!_0x3544bc){setTimeout(this['push'][_0x7b4c('0x9')](this),0x3e8);}};function beepall(_0x16ae89,_0x39d69a,_0x250901,_0x5ba56a){return new Beepall(_0x16ae89,_0x39d69a,_0x250901,_0x5ba56a);}module[_0x7b4c('0x21')]=beepall;
\ No newline at end of file
index d65ae7c..b92185a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec31=['./beepall','./agent','./rrmemory'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xec31,0xcb));var _0x1ec3=function(_0x265e14,_0x1ff56c){_0x265e14=_0x265e14-0x0;var _0x363512=_0xec31[_0x265e14];return _0x363512;};'use strict';module['exports']={'rrmemory':require(_0x1ec3('0x0')),'beepall':require(_0x1ec3('0x1')),'agent':require(_0x1ec3('0x2'))};
\ No newline at end of file
+var _0xfa62=['./beepall','./agent','exports','./rrmemory'];(function(_0x35c8f5,_0x399f44){var _0xb5c718=function(_0x50450c){while(--_0x50450c){_0x35c8f5['push'](_0x35c8f5['shift']());}};_0xb5c718(++_0x399f44);}(_0xfa62,0xfa));var _0x2fa6=function(_0x662de8,_0x3053c8){_0x662de8=_0x662de8-0x0;var _0x3ffc92=_0xfa62[_0x662de8];return _0x3ffc92;};'use strict';module[_0x2fa6('0x0')]={'rrmemory':require(_0x2fa6('0x1')),'beepall':require(_0x2fa6('0x2')),'agent':require(_0x2fa6('0x3'))};
\ No newline at end of file
index 67849da..a3b89ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72b9=['name','showNotification','routing','writeLog','RINGING','[%s][QUEUE]\x20timeout\x20with\x20%s','intervals','hideNotification','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','notificationId','squeue','queue','realtime','push','bind','handleTimeout','module','timeout','handleDrained','prototype','handleRun','handleCheckReject','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','done','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue'];(function(_0x38d888,_0x13215c){var _0xaa50b5=function(_0x3521a5){while(--_0x3521a5){_0x38d888['push'](_0x38d888['shift']());}};_0xaa50b5(++_0x13215c);}(_0x72b9,0x17c));var _0x972b=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0x72b9[_0x38987f];return _0x4cb697;};'use strict';var rr=require('rr');var _=require(_0x972b('0x0'));var uuid=require(_0x972b('0x1'));var util=require('./util');var logger=require(_0x972b('0x2'))('routing');var RRMemory=function(_0x1a9ea3,_0x15484f,_0x4f9663,_0x181d67){this[_0x972b('0x3')]=uuid['v4']();this[_0x972b('0x4')]=_0x1a9ea3;this[_0x972b('0x5')]=_0x15484f;this[_0x972b('0x6')]=_0x4f9663;this['routing']=_0x181d67;this['intervals']={};this[_0x972b('0x4')][_0x972b('0x7')](this['handleRun'][_0x972b('0x8')](this),this[_0x972b('0x9')][_0x972b('0x8')](this),this[_0x972b('0xa')]);this[_0x972b('0x4')]['on'](_0x972b('0xb'),this[_0x972b('0x9')]['bind'](this));this['squeue']['on']('drained',this[_0x972b('0xc')]['bind'](this));};RRMemory[_0x972b('0xd')][_0x972b('0x7')]=function(){this[_0x972b('0x4')][_0x972b('0x7')](this[_0x972b('0xe')][_0x972b('0x8')](this),this[_0x972b('0x9')][_0x972b('0x8')](this));};RRMemory[_0x972b('0xd')][_0x972b('0xc')]=function(_0x390999){this[_0x972b('0x9')](!![]);};RRMemory[_0x972b('0xd')][_0x972b('0xf')]=function(_0x3ffd9a){if(util['isAgentAvailable'](this['squeue']['id'],this[_0x972b('0x6')][_0x972b('0x10')][this[_0x972b('0x11')]],this[_0x972b('0x4')][_0x972b('0x12')],!![])){logger[_0x972b('0x13')](_0x972b('0x14'),this[_0x972b('0x4')]['id'],this['agentId']);clearInterval(this['intervals'][this[_0x972b('0x11')]]);_0x3ffd9a[_0x972b('0x15')]();setTimeout(this[_0x972b('0x7')][_0x972b('0x8')](this),0x3e8);}};RRMemory[_0x972b('0xd')][_0x972b('0xe')]=function(_0x13f78b){this[_0x972b('0x11')]=rr(this[_0x972b('0x5')]['mapAgentsId']);logger[_0x972b('0x13')](_0x972b('0x16'),this[_0x972b('0x4')]['id'],this[_0x972b('0x11')]);if(_[_0x972b('0x17')](this[_0x972b('0x6')]['agents'][this[_0x972b('0x11')]])){logger[_0x972b('0x13')](_0x972b('0x18'),this[_0x972b('0x4')]['id'],this[_0x972b('0x11')]);_0x13f78b[_0x972b('0x15')]();setTimeout(this[_0x972b('0x7')]['bind'](this),0x3e8);}else{if(util['isAgentAvailable'](this['squeue']['id'],this['realtime'][_0x972b('0x10')][this[_0x972b('0x11')]],this[_0x972b('0x4')][_0x972b('0x12')],!![])){this['realtime']['agents'][this[_0x972b('0x11')]][_0x972b('0x19')]=!![];this['realtime'][_0x972b('0x10')][this['agentId']][_0x972b('0x1a')]=this['queue'][_0x972b('0x1b')];util[_0x972b('0x1c')](this['notificationId'],this[_0x972b('0x4')]['id'],this[_0x972b('0x6')]['agents'][this[_0x972b('0x11')]],this[_0x972b('0x5')],this[_0x972b('0x1d')]);util[_0x972b('0x1e')](this[_0x972b('0x4')]['id'],this['realtime'][_0x972b('0x10')][this[_0x972b('0x11')]],_0x972b('0x1f'));this['intervals'][this[_0x972b('0x11')]]=setInterval(this['handleCheckReject'][_0x972b('0x8')](this,_0x13f78b),0x3e8);}else{logger[_0x972b('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0x972b('0x4')]['id'],this[_0x972b('0x11')]);_0x13f78b[_0x972b('0x15')]();setTimeout(this[_0x972b('0x7')]['bind'](this),0x3e8);}}};RRMemory['prototype'][_0x972b('0x9')]=function(_0x47d296){logger[_0x972b('0x13')](_0x972b('0x20'),this[_0x972b('0x4')]['id'],this[_0x972b('0x11')]);if(_[_0x972b('0x17')](this['realtime'][_0x972b('0x10')][this[_0x972b('0x11')]])){logger[_0x972b('0x13')](_0x972b('0x18'),this[_0x972b('0x4')]['id'],this[_0x972b('0x11')]);}else{clearInterval(this[_0x972b('0x21')][this[_0x972b('0x11')]]);util[_0x972b('0x22')](this['notificationId'],this[_0x972b('0x4')]['id'],this[_0x972b('0x6')][_0x972b('0x10')][this[_0x972b('0x11')]],this[_0x972b('0x5')],this[_0x972b('0x1d')]);util[_0x972b('0x1e')](this[_0x972b('0x4')]['id'],this[_0x972b('0x6')][_0x972b('0x10')][this[_0x972b('0x11')]],_0x972b('0x23'));this['realtime'][_0x972b('0x10')][this[_0x972b('0x11')]][_0x972b('0x19')]=![];this[_0x972b('0x6')]['agents'][this[_0x972b('0x11')]][_0x972b('0x1a')]=undefined;}if(!_0x47d296){setTimeout(this[_0x972b('0x7')]['bind'](this),0x3e8);}};function rrmemory(_0x3b3eac,_0x29b8fa,_0x5d0d30,_0x38d4dc){return new RRMemory(_0x3b3eac,_0x29b8fa,_0x5d0d30,_0x38d4dc);}module[_0x972b('0x24')]=rrmemory;
\ No newline at end of file
+var _0x3475=['notificationId','squeue','queue','realtime','routing','intervals','push','handleRun','bind','handleTimeout','module','timeout','handleDrained','prototype','handleCheckReject','isAgentAvailable','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','[%s][QUEUE]\x20try\x20with\x20%s','isNil','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busyQueue','name','showNotification','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','done','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','writeLog','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger'];(function(_0x2944d3,_0x26adc7){var _0x38cac9=function(_0x30cebe){while(--_0x30cebe){_0x2944d3['push'](_0x2944d3['shift']());}};_0x38cac9(++_0x26adc7);}(_0x3475,0xba));var _0x5347=function(_0x51b74f,_0x5a67fd){_0x51b74f=_0x51b74f-0x0;var _0xe7fd47=_0x3475[_0x51b74f];return _0xe7fd47;};'use strict';var rr=require('rr');var _=require(_0x5347('0x0'));var uuid=require(_0x5347('0x1'));var util=require(_0x5347('0x2'));var logger=require(_0x5347('0x3'))('routing');var RRMemory=function(_0x33e9b9,_0x27271b,_0x3e3dc2,_0x59032){this[_0x5347('0x4')]=uuid['v4']();this[_0x5347('0x5')]=_0x33e9b9;this[_0x5347('0x6')]=_0x27271b;this[_0x5347('0x7')]=_0x3e3dc2;this[_0x5347('0x8')]=_0x59032;this[_0x5347('0x9')]={};this[_0x5347('0x5')][_0x5347('0xa')](this[_0x5347('0xb')][_0x5347('0xc')](this),this[_0x5347('0xd')][_0x5347('0xc')](this),this[_0x5347('0xe')]);this[_0x5347('0x5')]['on'](_0x5347('0xf'),this[_0x5347('0xd')]['bind'](this));this[_0x5347('0x5')]['on']('drained',this[_0x5347('0x10')]['bind'](this));};RRMemory[_0x5347('0x11')][_0x5347('0xa')]=function(){this[_0x5347('0x5')]['push'](this[_0x5347('0xb')]['bind'](this),this[_0x5347('0xd')][_0x5347('0xc')](this));};RRMemory[_0x5347('0x11')][_0x5347('0x10')]=function(_0x133539){this[_0x5347('0xd')](!![]);};RRMemory['prototype'][_0x5347('0x12')]=function(_0x2c9ca8){if(util[_0x5347('0x13')](this['squeue']['id'],this['realtime']['agents'][this[_0x5347('0x14')]],this['squeue'][_0x5347('0x15')],!![])){logger[_0x5347('0x16')](_0x5347('0x17'),this['squeue']['id'],this['agentId']);clearInterval(this[_0x5347('0x9')][this[_0x5347('0x14')]]);_0x2c9ca8['done']();setTimeout(this[_0x5347('0xa')][_0x5347('0xc')](this),0x3e8);}};RRMemory['prototype'][_0x5347('0xb')]=function(_0x27dceb){this[_0x5347('0x14')]=rr(this[_0x5347('0x6')]['mapAgentsId']);logger[_0x5347('0x16')](_0x5347('0x18'),this['squeue']['id'],this[_0x5347('0x14')]);if(_[_0x5347('0x19')](this[_0x5347('0x7')][_0x5347('0x1a')][this['agentId']])){logger['info'](_0x5347('0x1b'),this[_0x5347('0x5')]['id'],this[_0x5347('0x14')]);_0x27dceb['done']();setTimeout(this[_0x5347('0xa')][_0x5347('0xc')](this),0x3e8);}else{if(util[_0x5347('0x13')](this[_0x5347('0x5')]['id'],this[_0x5347('0x7')]['agents'][this[_0x5347('0x14')]],this[_0x5347('0x5')][_0x5347('0x15')],!![])){this[_0x5347('0x7')][_0x5347('0x1a')][this[_0x5347('0x14')]]['busy']=!![];this[_0x5347('0x7')][_0x5347('0x1a')][this[_0x5347('0x14')]][_0x5347('0x1c')]=this[_0x5347('0x6')][_0x5347('0x1d')];util[_0x5347('0x1e')](this['notificationId'],this[_0x5347('0x5')]['id'],this[_0x5347('0x7')][_0x5347('0x1a')][this[_0x5347('0x14')]],this[_0x5347('0x6')],this[_0x5347('0x8')]);util['writeLog'](this[_0x5347('0x5')]['id'],this[_0x5347('0x7')][_0x5347('0x1a')][this[_0x5347('0x14')]],'RINGING');this[_0x5347('0x9')][this[_0x5347('0x14')]]=setInterval(this[_0x5347('0x12')][_0x5347('0xc')](this,_0x27dceb),0x3e8);}else{logger['info'](_0x5347('0x1f'),this[_0x5347('0x5')]['id'],this['agentId']);_0x27dceb[_0x5347('0x20')]();setTimeout(this[_0x5347('0xa')][_0x5347('0xc')](this),0x3e8);}}};RRMemory[_0x5347('0x11')][_0x5347('0xd')]=function(_0x13191e){logger[_0x5347('0x16')](_0x5347('0x21'),this[_0x5347('0x5')]['id'],this['agentId']);if(_[_0x5347('0x19')](this[_0x5347('0x7')][_0x5347('0x1a')][this[_0x5347('0x14')]])){logger[_0x5347('0x16')](_0x5347('0x1b'),this[_0x5347('0x5')]['id'],this[_0x5347('0x14')]);}else{clearInterval(this[_0x5347('0x9')][this['agentId']]);util[_0x5347('0x22')](this[_0x5347('0x4')],this[_0x5347('0x5')]['id'],this['realtime']['agents'][this[_0x5347('0x14')]],this[_0x5347('0x6')],this['routing']);util[_0x5347('0x23')](this[_0x5347('0x5')]['id'],this['realtime'][_0x5347('0x1a')][this[_0x5347('0x14')]],_0x5347('0x24'));this[_0x5347('0x7')][_0x5347('0x1a')][this['agentId']]['busy']=![];this[_0x5347('0x7')]['agents'][this[_0x5347('0x14')]]['busyQueue']=undefined;}if(!_0x13191e){setTimeout(this[_0x5347('0xa')][_0x5347('0xc')](this),0x3e8);}};function rrmemory(_0x2b6090,_0x2564e8,_0x44e6f0,_0x525bfa){return new RRMemory(_0x2b6090,_0x2564e8,_0x44e6f0,_0x525bfa);}module[_0x5347('0x25')]=rrmemory;
\ No newline at end of file
index 33e7712..035a28d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a55=['notificationSound','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','ioredis','routing','defaults','localhost','socket.io-emitter','redis','emit','format','user:%s','name','user:save','split','\x20interaction','account'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x6a55,0xdb));var _0x56a5=function(_0x8b1a5e,_0x2744eb){_0x8b1a5e=_0x8b1a5e-0x0;var _0x1146b1=_0x6a55[_0x8b1a5e];return _0x1146b1;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0x56a5('0x1'));var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')(_0x56a5('0x2'));config['redis']=_[_0x56a5('0x3')](config['redis'],{'host':_0x56a5('0x4'),'port':0x18eb});var io=require(_0x56a5('0x5'))(new Redis(config[_0x56a5('0x6')]));function emit(_0x293ea1,_0x444c65,_0x2272d9){io['to'](_0x293ea1)[_0x56a5('0x7')](_0x444c65,_0x2272d9);}function sendNotification(_0x387dcb,_0x586f7a,_0x1c9e7a,_0xf15490,_0x3c8283,_0x4370c2){io['to'](util[_0x56a5('0x8')](_0x56a5('0x9'),_0xf15490[_0x56a5('0xa')]))[_0x56a5('0x7')](_0x56a5('0xb'),_0xf15490);var _0x4cd7c4=_0x4370c2||{};var _0x49711d=_0x1c9e7a[_0x56a5('0xc')]('.');var _0x21dfee={'uniqueid':_0x586f7a,'channel':_0x49711d[0x0],'id':_0x49711d[0x1],'title':_0x49711d[0x0]+_0x56a5('0xd'),'interactionId':_0x49711d[0x2],'queue':_0x3c8283?_0x3c8283[_0x56a5('0xa')]:null,'sound':_0x4cd7c4[_0x56a5('0xe')][_0x56a5('0xf')],'shake':_0x4cd7c4['account']['notificationShake']};try{if(!_0x4cd7c4[_0x56a5('0x10')]){_0x4cd7c4[_0x56a5('0x10')]={};}if(_0x3c8283){_0x4cd7c4[_0x56a5('0x10')][_0x56a5('0x11')]=_0x3c8283;}else if(_0x4cd7c4[_0x56a5('0x10')][_0x56a5('0x11')]){delete _0x4cd7c4[_0x56a5('0x10')]['queue'];}_0x21dfee[_0x56a5('0x12')]=utils['getMustacheRender'](_0x4cd7c4[_0x56a5('0xe')]['notificationTemplate'],_0x4cd7c4);}catch(_0x14ab5b){_0x21dfee[_0x56a5('0x12')]=_0x56a5('0x13');logger[_0x56a5('0x14')](util[_0x56a5('0x8')](_0x56a5('0x15'),_0x586f7a,_0x14ab5b[_0x56a5('0x16')]));}io['to'](util['format'](_0x56a5('0x9'),_0xf15490[_0x56a5('0xa')]))[_0x56a5('0x7')](util[_0x56a5('0x8')]('notification:%s',_0x387dcb?_0x56a5('0x17'):_0x56a5('0x18')),_0x21dfee);}function writeLog(_0xa274f4,_0x15e469,_0x155d3b){return logger['info'](util['format'](_0x56a5('0x19'),_0xa274f4,_0x15e469[_0x56a5('0xa')],_0x155d3b));}exports['isAgentAvailable']=function(_0x1556eb,_0x309fa5,_0x615d49,_0x15d9f8){if(_0x309fa5[_0x56a5('0x1a')]){writeLog(_0x1556eb,_0x309fa5,_0x56a5('0x1b'));return![];}if(!_0x309fa5[_0x56a5('0x1c')]){writeLog(_0x1556eb,_0x309fa5,_0x56a5('0x1d'));return![];}if(_0x309fa5[_0x615d49+_0x56a5('0x1e')]){writeLog(_0x1556eb,_0x309fa5,_0x56a5('0x1f'));return![];}if(_0x15d9f8&&_0x309fa5[_0x56a5('0x20')](_0x615d49+_0x56a5('0x21'))&&_0x309fa5[_0x56a5('0x20')](_0x615d49+'CurrentCapacity')){if(_0x309fa5[_0x615d49+_0x56a5('0x21')]>0x0&&_0x309fa5[_0x615d49+_0x56a5('0x22')]>=_0x309fa5[_0x615d49+_0x56a5('0x21')]){writeLog(_0x1556eb,_0x309fa5,_0x615d49[_0x56a5('0x23')]()+_0x56a5('0x24'));return![];}}return!![];};exports['showNotification']=function(_0x18e863,_0x54ec36,_0x2efde7,_0x3c6ac1,_0x1b27b5){return sendNotification(!![],_0x18e863,_0x54ec36,_0x2efde7,_0x3c6ac1,_0x1b27b5);};exports[_0x56a5('0x25')]=function(_0x4e7afd,_0x3b55e6,_0x1f7aeb,_0x178f11,_0x51ef6f){return sendNotification(![],_0x4e7afd,_0x3b55e6,_0x1f7aeb,_0x178f11,_0x51ef6f);};exports[_0x56a5('0x26')]=writeLog;
\ No newline at end of file
+var _0x9536=['util','../utils','mustache','../../../../../config/environment','routing','redis','defaults','localhost','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','Pause','PAUSE','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash'];(function(_0x16a223,_0x31b6e8){var _0x5ded66=function(_0x25eb5f){while(--_0x25eb5f){_0x16a223['push'](_0x16a223['shift']());}};_0x5ded66(++_0x31b6e8);}(_0x9536,0x179));var _0x6953=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x9536[_0x4b6830];return _0x239e4a;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var utils=require(_0x6953('0x2'));var Mustache=require(_0x6953('0x3'));var Redis=require('ioredis');var config=require(_0x6953('0x4'));var logger=require('../../../../../config/logger')(_0x6953('0x5'));config[_0x6953('0x6')]=_[_0x6953('0x7')](config[_0x6953('0x6')],{'host':_0x6953('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6953('0x6')]));function emit(_0x2bb026,_0x385f2d,_0x3e1aff){io['to'](_0x2bb026)[_0x6953('0x9')](_0x385f2d,_0x3e1aff);}function sendNotification(_0x58ac30,_0x3e8786,_0x36bc9e,_0x449acb,_0x4b505f,_0x41f41b){io['to'](util[_0x6953('0xa')](_0x6953('0xb'),_0x449acb[_0x6953('0xc')]))[_0x6953('0x9')](_0x6953('0xd'),_0x449acb);var _0x246534=_0x41f41b||{};var _0x2144c5=_0x36bc9e[_0x6953('0xe')]('.');var _0x57652e={'uniqueid':_0x3e8786,'channel':_0x2144c5[0x0],'id':_0x2144c5[0x1],'title':_0x2144c5[0x0]+_0x6953('0xf'),'interactionId':_0x2144c5[0x2],'queue':_0x4b505f?_0x4b505f['name']:null,'sound':_0x246534[_0x6953('0x10')][_0x6953('0x11')],'shake':_0x246534[_0x6953('0x10')][_0x6953('0x12')]};try{if(!_0x246534[_0x6953('0x13')]){_0x246534[_0x6953('0x13')]={};}if(_0x4b505f){_0x246534[_0x6953('0x13')][_0x6953('0x14')]=_0x4b505f;}else if(_0x246534[_0x6953('0x13')][_0x6953('0x14')]){delete _0x246534[_0x6953('0x13')]['queue'];}_0x57652e['msg']=utils[_0x6953('0x15')](_0x246534[_0x6953('0x10')][_0x6953('0x16')],_0x246534);}catch(_0x16251d){_0x57652e['msg']=_0x6953('0x17');logger[_0x6953('0x18')](util['format'](_0x6953('0x19'),_0x3e8786,_0x16251d[_0x6953('0x1a')]));}io['to'](util[_0x6953('0xa')](_0x6953('0xb'),_0x449acb[_0x6953('0xc')]))['emit'](util[_0x6953('0xa')](_0x6953('0x1b'),_0x58ac30?_0x6953('0x1c'):_0x6953('0x1d')),_0x57652e);}function writeLog(_0x41f021,_0x5e33ec,_0xf96d07){return logger[_0x6953('0x1e')](util['format'](_0x6953('0x1f'),_0x41f021,_0x5e33ec[_0x6953('0xc')],_0xf96d07));}exports[_0x6953('0x20')]=function(_0x171dd8,_0x53640a,_0x37f339,_0x231cb2){if(_0x53640a[_0x6953('0x21')]){writeLog(_0x171dd8,_0x53640a,'BUSY');return![];}if(!_0x53640a['online']){writeLog(_0x171dd8,_0x53640a,'OFFLINE');return![];}if(_0x53640a[_0x37f339+_0x6953('0x22')]){writeLog(_0x171dd8,_0x53640a,_0x6953('0x23'));return![];}if(_0x231cb2&&_0x53640a['hasOwnProperty'](_0x37f339+_0x6953('0x24'))&&_0x53640a['hasOwnProperty'](_0x37f339+_0x6953('0x25'))){if(_0x53640a[_0x37f339+_0x6953('0x24')]>0x0&&_0x53640a[_0x37f339+_0x6953('0x25')]>=_0x53640a[_0x37f339+_0x6953('0x24')]){writeLog(_0x171dd8,_0x53640a,_0x37f339[_0x6953('0x26')]()+_0x6953('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x3dd890,_0x3c1075,_0x527b9a,_0x3be82d,_0x4af39d){return sendNotification(!![],_0x3dd890,_0x3c1075,_0x527b9a,_0x3be82d,_0x4af39d);};exports[_0x6953('0x28')]=function(_0x3b1175,_0x426c7c,_0x4b0325,_0x131992,_0x3d7b04){return sendNotification(![],_0x3b1175,_0x426c7c,_0x4b0325,_0x131992,_0x3d7b04);};exports[_0x6953('0x29')]=writeLog;
\ No newline at end of file
index 3d6cb99..0fc5952 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa43d=['map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','shelljs','lodash','./utils','string','consequence','validate','length','error'];(function(_0x568db3,_0x24395d){var _0x58c38b=function(_0x594b94){while(--_0x594b94){_0x568db3['push'](_0x568db3['shift']());}};_0x58c38b(++_0x24395d);}(_0xa43d,0x172));var _0xda43=function(_0x1e4483,_0x12d73e){_0x1e4483=_0x1e4483-0x0;var _0x2ab5be=_0xa43d[_0x1e4483];return _0x2ab5be;};'use strict';var schema=require('validate');var sh=require(_0xda43('0x0'));var _=require(_0xda43('0x1'));var utils=require(_0xda43('0x2'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':_0xda43('0x3'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xda43('0x4')]=function(_0x492d51,_0x2b94d6){return function(_0x10f3c8){try{var _0x3f188b={'command':_0x2b94d6[0x0]};var _0x16a8ed=system[_0xda43('0x5')](_0x3f188b,{'typecast':!![]});if(_0x16a8ed[_0xda43('0x6')]){logger[_0xda43('0x7')]('[%s][SYSTEM]\x20%s',_0x492d51,_[_0xda43('0x8')](_0x16a8ed,_0xda43('0x9'))[_0xda43('0xa')](',\x20'));logger[_0xda43('0xb')](_0xda43('0xc'),_0x492d51);_0x10f3c8[_0xda43('0xd')]();}else{var _0x216e40=this;var _0x4e3a3e=utils[_0xda43('0xe')](_0x2b94d6[0x0],this);logger[_0xda43('0xb')](_0xda43('0xf'),_0x492d51,_0x4e3a3e);sh['exec'](_[_0xda43('0x10')](_0x4e3a3e),function(_0x155164,_0x4cf453){logger[_0xda43('0xb')](_0xda43('0x11'),_0x492d51,_0x155164);if(_0x155164==0x0){var _0x569760=_0x4cf453[_0xda43('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xda43('0x13')](_0x2b94d6[0x1])||_[_0xda43('0x14')](_0x2b94d6[0x1])){logger[_0xda43('0xb')](_0xda43('0x15'),_0x492d51);_0x216e40[_0xda43('0x16')][_0x2b94d6[0x1]]=_0x569760;}else{logger[_0xda43('0xb')](_0xda43('0x17'),_0x492d51,_0x2b94d6[0x1],_0x569760);_0x216e40[_0xda43('0x16')][_0x2b94d6[0x1]]=_0x569760;}}_0x10f3c8[_0xda43('0xd')]();});}}catch(_0x2326c4){logger[_0xda43('0x7')](_0xda43('0x18'),_0x492d51,_[_0xda43('0x19')](_0x2326c4)?JSON[_0xda43('0x1a')](_0x2326c4):_0x2326c4);logger[_0xda43('0xb')](_0xda43('0xc'),_0x492d51);_0x10f3c8[_0xda43('0xd')]();}};};
\ No newline at end of file
+var _0x9bfa=['map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','stringify','validate','shelljs','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s'];(function(_0x299e52,_0x185080){var _0x2d7c83=function(_0x4dd1cf){while(--_0x4dd1cf){_0x299e52['push'](_0x299e52['shift']());}};_0x2d7c83(++_0x185080);}(_0x9bfa,0x167));var _0xa9bf=function(_0x30c272,_0x1d3f4d){_0x30c272=_0x30c272-0x0;var _0xa5fed7=_0x9bfa[_0x30c272];return _0xa5fed7;};'use strict';var schema=require(_0xa9bf('0x0'));var sh=require(_0xa9bf('0x1'));var _=require('lodash');var utils=require(_0xa9bf('0x2'));var logger=require(_0xa9bf('0x3'))(_0xa9bf('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0xa9bf('0x5')}});exports[_0xa9bf('0x6')]=function(_0x1eea41,_0x299341){return function(_0x414cdb){try{var _0x237c67={'command':_0x299341[0x0]};var _0x411115=system[_0xa9bf('0x0')](_0x237c67,{'typecast':!![]});if(_0x411115['length']){logger[_0xa9bf('0x7')](_0xa9bf('0x8'),_0x1eea41,_[_0xa9bf('0x9')](_0x411115,_0xa9bf('0xa'))['join'](',\x20'));logger[_0xa9bf('0xb')](_0xa9bf('0xc'),_0x1eea41);_0x414cdb['next']();}else{var _0x5beef3=this;var _0x5b1641=utils['getMustacheRender'](_0x299341[0x0],this);logger[_0xa9bf('0xb')](_0xa9bf('0xd'),_0x1eea41,_0x5b1641);sh['exec'](_[_0xa9bf('0xe')](_0x5b1641),function(_0x41f345,_0x1f155b){logger[_0xa9bf('0xb')](_0xa9bf('0xf'),_0x1eea41,_0x41f345);if(_0x41f345==0x0){var _0x277f91=_0x1f155b[_0xa9bf('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0xa9bf('0x11')](_0x299341[0x1])||_[_0xa9bf('0x12')](_0x299341[0x1])){logger[_0xa9bf('0xb')](_0xa9bf('0x13'),_0x1eea41);_0x5beef3[_0xa9bf('0x14')][_0x299341[0x1]]=_0x277f91;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x1eea41,_0x299341[0x1],_0x277f91);_0x5beef3['body'][_0x299341[0x1]]=_0x277f91;}}_0x414cdb[_0xa9bf('0x15')]();});}}catch(_0x1c6182){logger[_0xa9bf('0x7')](_0xa9bf('0x8'),_0x1eea41,_['isObject'](_0x1c6182)?JSON[_0xa9bf('0x16')](_0x1c6182):_0x1c6182);logger[_0xa9bf('0xb')](_0xa9bf('0xc'),_0x1eea41);_0x414cdb[_0xa9bf('0x15')]();}};};
\ No newline at end of file
index a1d7095..fb7d386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc613=['join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s'];(function(_0x3fd2e0,_0x17e542){var _0x4043c9=function(_0x1cf309){while(--_0x1cf309){_0x3fd2e0['push'](_0x3fd2e0['shift']());}};_0x4043c9(++_0x17e542);}(_0xc613,0xf6));var _0x3c61=function(_0x338214,_0x63daa0){_0x338214=_0x338214-0x0;var _0x5d7445=_0xc613[_0x338214];return _0x5d7445;};'use strict';var schema=require(_0x3c61('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x3c61('0x1')),'openchannelInteraction':require(_0x3c61('0x2')),'smsInteraction':require(_0x3c61('0x3')),'mailInteraction':require(_0x3c61('0x4')),'faxInteraction':require(_0x3c61('0x5')),'whatsappInteraction':require(_0x3c61('0x6'))};var logger=require(_0x3c61('0x7'))('routing');var tag=schema({'tag':{'type':_0x3c61('0x8'),'required':!![],'message':_0x3c61('0x9')}});exports[_0x3c61('0xa')]=function(_0x4dd09f,_0x1621f0,_0x13f316,_0x29027c){return function(_0x5f3279){try{var _0x493bc0={'tag':_0x1621f0[0x0]};var _0x379388=tag[_0x3c61('0x0')](_0x493bc0,{'typecast':!![]});if(_0x379388[_0x3c61('0xb')]){logger[_0x3c61('0xc')](_0x3c61('0xd'),_0x4dd09f,_['map'](_0x379388,'message')[_0x3c61('0xe')](',\x20'));logger[_0x3c61('0xf')](_0x3c61('0x10'),_0x4dd09f);_0x5f3279[_0x3c61('0x11')]();}else{var _0x4a9763={'ids':[_0x1621f0[0x0]]};if(rpc[_0x29027c['channel']+_0x3c61('0x12')]){rpc[_0x29027c[_0x3c61('0x13')]+'Interaction']['addTags'](_0x29027c[_0x3c61('0x14')]['id'],_0x4a9763)['then'](function(_0x494e6f){logger[_0x3c61('0xf')](_0x3c61('0x15'),_0x4dd09f,_0x1621f0[0x1],_0x29027c['channel'],_0x29027c[_0x3c61('0x14')]['id']);})[_0x3c61('0x16')](function(_0x1703c9){logger['error'](_0x3c61('0xd'),_0x4dd09f,JSON[_0x3c61('0x17')](_0x1703c9));logger[_0x3c61('0xf')](_0x3c61('0x10'),_0x4dd09f);})[_0x3c61('0x18')](function(){_0x5f3279[_0x3c61('0x11')]();});}}}catch(_0xc93ad3){logger['error'](_0x3c61('0xd'),_0x4dd09f,_[_0x3c61('0x19')](_0xc93ad3)?JSON[_0x3c61('0x17')](_0xc93ad3):_0xc93ad3);logger['info'](_0x3c61('0x10'),_0x4dd09f);_0x5f3279[_0x3c61('0x11')]();}};};
\ No newline at end of file
+var _0x19c2=['../../rpc/whatsappInteraction','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','catch','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x11e200,_0x1263bb){var _0x2d4e64=function(_0x5e41f9){while(--_0x5e41f9){_0x11e200['push'](_0x11e200['shift']());}};_0x2d4e64(++_0x1263bb);}(_0x19c2,0xaf));var _0x219c=function(_0x127bb2,_0x849c5f){_0x127bb2=_0x127bb2-0x0;var _0x596034=_0x19c2[_0x127bb2];return _0x596034;};'use strict';var schema=require(_0x219c('0x0'));var _=require(_0x219c('0x1'));var rpc={'chatInteraction':require(_0x219c('0x2')),'openchannelInteraction':require(_0x219c('0x3')),'smsInteraction':require(_0x219c('0x4')),'mailInteraction':require(_0x219c('0x5')),'faxInteraction':require(_0x219c('0x6')),'whatsappInteraction':require(_0x219c('0x7'))};var logger=require('../../../../config/logger')(_0x219c('0x8'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x219c('0x9')}});exports[_0x219c('0xa')]=function(_0x3b0430,_0x5e51e6,_0x9b9816,_0x5aa4dd){return function(_0x1f0ae6){try{var _0xa3399d={'tag':_0x5e51e6[0x0]};var _0x3163c6=tag[_0x219c('0x0')](_0xa3399d,{'typecast':!![]});if(_0x3163c6['length']){logger[_0x219c('0xb')](_0x219c('0xc'),_0x3b0430,_[_0x219c('0xd')](_0x3163c6,_0x219c('0xe'))[_0x219c('0xf')](',\x20'));logger[_0x219c('0x10')](_0x219c('0x11'),_0x3b0430);_0x1f0ae6[_0x219c('0x12')]();}else{var _0x393ec4={'ids':[_0x5e51e6[0x0]]};if(rpc[_0x5aa4dd[_0x219c('0x13')]+'Interaction']){rpc[_0x5aa4dd[_0x219c('0x13')]+_0x219c('0x14')][_0x219c('0x15')](_0x5aa4dd[_0x219c('0x16')]['id'],_0x393ec4)[_0x219c('0x17')](function(_0x46b2a6){logger[_0x219c('0x10')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x3b0430,_0x5e51e6[0x1],_0x5aa4dd[_0x219c('0x13')],_0x5aa4dd[_0x219c('0x16')]['id']);})[_0x219c('0x18')](function(_0x58f577){logger['error'](_0x219c('0xc'),_0x3b0430,JSON['stringify'](_0x58f577));logger['info'](_0x219c('0x11'),_0x3b0430);})['finally'](function(){_0x1f0ae6[_0x219c('0x12')]();});}}}catch(_0x1fe4ab){logger[_0x219c('0xb')]('[%s][TAG]\x20%s',_0x3b0430,_[_0x219c('0x19')](_0x1fe4ab)?JSON['stringify'](_0x1fe4ab):_0x1fe4ab);logger[_0x219c('0x10')](_0x219c('0x11'),_0x3b0430);_0x1f0ae6[_0x219c('0x12')]();}};};
\ No newline at end of file
index b0bcd50..a959ca7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0670=['stop','error','[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','../../../../config/logger','routing','consequence','replace','includes','push','urlOnAnswer','?params=','title','jsonrpc','method','stringify','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s'];(function(_0x3296e2,_0x4a0782){var _0x294d22=function(_0x534384){while(--_0x534384){_0x3296e2['push'](_0x3296e2['shift']());}};_0x294d22(++_0x4a0782);}(_0x0670,0xf4));var _0x0067=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x0670[_0x43b08];return _0x5e05f4;};'use strict';var rp=require(_0x0067('0x0'));var logger=require(_0x0067('0x1'))(_0x0067('0x2'));var arr=[];exports[_0x0067('0x3')]=function(_0x10f20d,_0x5c10f8){return function(_0x56e5da){var _0x51af7d=_0x5c10f8[0xa];var _0x50ec3e=_0x5c10f8[0xb];var _0x408999=_0x5c10f8[0xc];var _0x23f15f=_0x5c10f8[0xd];var _0x54a538=_0x5c10f8[0xe];var _0x5f5561=_0x5c10f8[0xf][_0x0067('0x4')](/\n/g,'\x20-\x20');var _0x4fbc87=_0x5c10f8[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x0067('0x5')](_0x50ec3e)){arr[_0x0067('0x6')](_0x50ec3e);var _0x333590=_0x5c10f8[0x3];var _0x457488=_0x5c10f8[0x4];var _0x3b109a=_0x5c10f8[0x1];var _0x136709=_0x5c10f8[0x0];var _0x221ffe={};_0x221ffe[_0x0067('0x7')]=_0x5c10f8[0x8]+_0x0067('0x8')+_0x408999+'|'+_0x51af7d+'|'+_0x23f15f+'|'+_0x50ec3e+'|'+_0x54a538;_0x221ffe['urlOnRing']=_0x5c10f8[0x7]+_0x0067('0x8')+_0x408999+'|'+_0x51af7d+'|'+_0x23f15f+'|'+_0x50ec3e+'|'+_0x54a538+'|'+_0x5f5561+'|'+_0x4fbc87;_0x221ffe[_0x0067('0x9')]=_0x5c10f8[0x9];var _0x2e7516={};_0x2e7516[_0x0067('0xa')]='2.0';_0x2e7516[_0x0067('0xb')]='login';var _0x2ebc8a=[];_0x2ebc8a[_0x0067('0x6')](_0x5c10f8[0x2]);_0x2ebc8a['push'](_0x5c10f8[0x5]);_0x2ebc8a[_0x0067('0x6')](_0x5c10f8[0x6]);_0x2e7516['params']=_0x2ebc8a;_0x2e7516['id']=0x1;var _0x2e0ea4=JSON[_0x0067('0xc')](_0x2e7516);var _0x55dd55={'encoding':'utf8','method':_0x0067('0xd'),'timeout':0x2710,'url':_0x333590,'headers':{'Content-Type':_0x0067('0xe')},'body':_0x2e0ea4};return rp(_0x55dd55)[_0x0067('0xf')](function(_0x85d88a){const _0x2b8064=JSON[_0x0067('0x10')](_0x85d88a);if(!_0x2b8064[_0x0067('0x11')][_0x0067('0x12')]){throw new Error(_0x0067('0x13'));}var _0x3a5e34=_0x50ec3e;var _0x3e47ed=_0x0067('0x14')+_0x3b109a+_0x0067('0x15')+_0x136709+_0x0067('0x16')+_0x3a5e34+_0x0067('0x17')+JSON[_0x0067('0xc')](_0x221ffe);var _0x113e03=_0x457488+'?'+_0x3e47ed;return rp(_0x113e03);})[_0x0067('0xf')](function(_0xb60418){logger[_0x0067('0x18')](_0x0067('0x19'),_0x10f20d,_0xb60418);_0x56e5da[_0x0067('0x1a')]();})['catch'](function(_0x1f35b7){logger[_0x0067('0x1b')](_0x0067('0x1c'),_0x10f20d,_['isObject'](_0x1f35b7)?JSON[_0x0067('0xc')](_0x1f35b7):_0x1f35b7);_0x56e5da[_0x0067('0x1a')]();});}else{logger[_0x0067('0x18')](_0x0067('0x1d'),_0x10f20d);_0x56e5da['next']();}};};
\ No newline at end of file
+var _0xfd04=['logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','stringify','stop','[%s][TVOX]\x20%s','info','next','../../../../config/logger','routing','consequence','replace','\x20-\x20','includes','title','jsonrpc','method','login','push','params','POST','then','result'];(function(_0x2c7e75,_0x557e99){var _0x15a803=function(_0x22f639){while(--_0x22f639){_0x2c7e75['push'](_0x2c7e75['shift']());}};_0x15a803(++_0x557e99);}(_0xfd04,0x136));var _0x4fd0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfd04[_0x321bb2];return _0x9c12ed;};'use strict';var rp=require('request-promise');var logger=require(_0x4fd0('0x0'))(_0x4fd0('0x1'));var arr=[];exports[_0x4fd0('0x2')]=function(_0x2793dd,_0x4941bc){return function(_0x886d87){var _0x38d8c3=_0x4941bc[0xa];var _0x236e95=_0x4941bc[0xb];var _0x4eb56f=_0x4941bc[0xc];var _0x47f9aa=_0x4941bc[0xd];var _0x5649a0=_0x4941bc[0xe];var _0x3e6e12=_0x4941bc[0xf][_0x4fd0('0x3')](/\n/g,_0x4fd0('0x4'));var _0x403b8e=_0x4941bc[0x10][_0x4fd0('0x3')](/\n/g,'\x20');if(!arr[_0x4fd0('0x5')](_0x236e95)){arr['push'](_0x236e95);var _0x4e1b76=_0x4941bc[0x3];var _0x293a52=_0x4941bc[0x4];var _0x4f393d=_0x4941bc[0x1];var _0x2ba943=_0x4941bc[0x0];var _0x2b65fa={};_0x2b65fa['urlOnAnswer']=_0x4941bc[0x8]+'?params='+_0x4eb56f+'|'+_0x38d8c3+'|'+_0x47f9aa+'|'+_0x236e95+'|'+_0x5649a0;_0x2b65fa['urlOnRing']=_0x4941bc[0x7]+'?params='+_0x4eb56f+'|'+_0x38d8c3+'|'+_0x47f9aa+'|'+_0x236e95+'|'+_0x5649a0+'|'+_0x3e6e12+'|'+_0x403b8e;_0x2b65fa[_0x4fd0('0x6')]=_0x4941bc[0x9];var _0x214155={};_0x214155[_0x4fd0('0x7')]='2.0';_0x214155[_0x4fd0('0x8')]=_0x4fd0('0x9');var _0x751bc8=[];_0x751bc8[_0x4fd0('0xa')](_0x4941bc[0x2]);_0x751bc8[_0x4fd0('0xa')](_0x4941bc[0x5]);_0x751bc8['push'](_0x4941bc[0x6]);_0x214155[_0x4fd0('0xb')]=_0x751bc8;_0x214155['id']=0x1;var _0x8c339=JSON['stringify'](_0x214155);var _0xa94218={'encoding':'utf8','method':_0x4fd0('0xc'),'timeout':0x2710,'url':_0x4e1b76,'headers':{'Content-Type':'application/json-rpc'},'body':_0x8c339};return rp(_0xa94218)[_0x4fd0('0xd')](function(_0xfef488){const _0x4f138c=JSON['parse'](_0xfef488);if(!_0x4f138c[_0x4fd0('0xe')][_0x4fd0('0xf')]){throw new Error(_0x4fd0('0x10'));}var _0x46bc7e=_0x236e95;var _0x54133c=_0x4fd0('0x11')+_0x4f393d+_0x4fd0('0x12')+_0x2ba943+'&sessionId='+_0x46bc7e+_0x4fd0('0x13')+JSON[_0x4fd0('0x14')](_0x2b65fa);var _0xb51c5d=_0x293a52+'?'+_0x54133c;return rp(_0xb51c5d);})[_0x4fd0('0xd')](function(_0x2c488c){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x2793dd,_0x2c488c);_0x886d87[_0x4fd0('0x15')]();})['catch'](function(_0x4eab22){logger['error'](_0x4fd0('0x16'),_0x2793dd,_['isObject'](_0x4eab22)?JSON[_0x4fd0('0x14')](_0x4eab22):_0x4eab22);_0x886d87[_0x4fd0('0x15')]();});}else{logger[_0x4fd0('0x17')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x2793dd);_0x886d87[_0x4fd0('0x18')]();}};};
\ No newline at end of file
index 13eec52..d274763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x3b050f,_0x163d0){var _0x10637d=function(_0x69fdba){while(--_0x69fdba){_0x3b050f['push'](_0x3b050f['shift']());}};_0x10637d(++_0x163d0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
+var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x55bd61,_0x2104ac){var _0x425d65=function(_0x33e372){while(--_0x33e372){_0x55bd61['push'](_0x55bd61['shift']());}};_0x425d65(++_0x2104ac);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
index 8b08c41..e8b6369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x878f=['dialogflowv2','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','format','./interval','condition','intervals','./applications/','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agents','busy','agent','busyQueue','QueueReport','update','UserId','catch','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','name','waiting','mailQueues','loggedIn','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','.js','toLowerCase','autoreply','appdata','split','push','slice','join','dialogflow'];(function(_0x18685b,_0x23b7fa){var _0x5203b5=function(_0x4e4f2a){while(--_0x4e4f2a){_0x18685b['push'](_0x18685b['shift']());}};_0x5203b5(++_0x23b7fa);}(_0x878f,0x173));var _0xf878=function(_0x5a9f03,_0x2e229e){_0x5a9f03=_0x5a9f03-0x0;var _0x4ccfda=_0x878f[_0x5a9f03];return _0x4ccfda;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var fs=require('fs');var jayson=require(_0xf878('0x2'));var BPromise=require(_0xf878('0x3'));var uuid=require(_0xf878('0x4'));var utils=require(_0xf878('0x5'));var config=require(_0xf878('0x6'));var logger=require(_0xf878('0x7'))(_0xf878('0x8'));var rpc={'openchannelQueueReport':require(_0xf878('0x9')),'mailQueueReport':require(_0xf878('0xa')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xf878('0xb')),'whatsappQueueReport':require(_0xf878('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x52851e,_0x530767,_0x3329df){return util['format']('%s.%s.%s',_0x52851e,_0x530767||0x0,_0x3329df||0x0);}function getIntervals(_0x307653,_0x2e6931){var _0x223504=[];if(!_['isNil'](_0x2e6931[_0xf878('0xd')])&&!_[_0xf878('0xe')](_0x307653[_0x2e6931['IntervalId']])&&!_[_0xf878('0xe')](_0x307653[_0x2e6931['IntervalId']][_0xf878('0xf')])){_0x223504=_[_0xf878('0x10')](_0x307653[_0x2e6931[_0xf878('0xd')]]['Intervals'],_0xf878('0x11'));}else if(!_[_0xf878('0xe')](_0x2e6931[_0xf878('0x11')])){_0x223504=[_0x2e6931['interval']];}return _0x223504;}exports[_0xf878('0x12')]=function(_0x3902f7){_0x3902f7[_0xf878('0x13')]={};return new BPromise(function(_0x492260,_0x568a3a){var _0x4c0948={'Start':function(_0x35ff2d){var _0x31d888=this;return new Promise(function(_0x6dbeca,_0x44aacc){if(_0x35ff2d){try{var _0x186a02=[];var _0x415056=getId(_0x35ff2d[_0xf878('0x14')],_0x35ff2d[_0xf878('0x15')]?_0x35ff2d[_0xf878('0x15')]['id']:0x0,_0x35ff2d[_0xf878('0x16')]?_0x35ff2d['interaction']['id']:0x0);if(_0x35ff2d[_0xf878('0x17')]&&_[_0xf878('0x18')](_0x35ff2d[_0xf878('0x17')])&&_0x35ff2d[_0xf878('0x17')][_0xf878('0x19')]){for(var _0x237d15=0x0;_0x237d15<_0x35ff2d[_0xf878('0x17')]['length'];_0x237d15+=0x1){var _0x73f6bf=_0x35ff2d[_0xf878('0x17')][_0x237d15];if(fs[_0xf878('0x1a')](path['join'](__dirname,_0xf878('0x17'),_0x73f6bf[_0xf878('0x1b')]+_0xf878('0x1c')))){var _0x392822=[];switch(_0x73f6bf[_0xf878('0x1b')][_0xf878('0x1d')]()){case _0xf878('0x1e'):var _0x466c6b=_0x73f6bf[_0xf878('0x1f')][_0xf878('0x20')](',');if(_0x35ff2d[_0xf878('0x14')]==='mail'){_0x392822[_0xf878('0x21')](_0x466c6b[0x0]);_0x392822['push'](_0x466c6b[0x1]);_0x392822[_0xf878('0x21')](_0x466c6b[_0xf878('0x22')](0x2,_0x466c6b[_0xf878('0x19')])[_0xf878('0x23')](','));}else{_0x392822[_0xf878('0x21')](_0x466c6b[0x0]);_0x392822['push'](_0x466c6b['slice'](0x1,_0x466c6b['length'])[_0xf878('0x23')](','));}break;case _0xf878('0x24'):var _0x38fa87=_0x73f6bf['appdata'][_0xf878('0x20')](',');_0x392822[_0xf878('0x21')](_0x38fa87[0x0]);_0x392822[_0xf878('0x21')](_0x38fa87[0x1]);_0x392822[_0xf878('0x21')](_0x38fa87[_0xf878('0x22')](0x2,_0x38fa87['length'])['join'](','));break;case _0xf878('0x25'):var _0x5d9c97=_0x73f6bf['appdata'][_0xf878('0x20')](',');_0x392822['push'](_0x5d9c97[0x0]);_0x392822[_0xf878('0x21')](_0x5d9c97[0x1]);_0x392822['push'](_0x5d9c97[0x2]);_0x392822[_0xf878('0x21')](_0x5d9c97[0x3]);_0x392822['push'](_0x5d9c97[_0xf878('0x22')](0x4,_0x5d9c97['length'])[_0xf878('0x23')](','));break;case _0xf878('0x26'):var _0x233a00=_0x73f6bf[_0xf878('0x1f')][_0xf878('0x20')](',');_0x392822[_0xf878('0x21')](_0x233a00[0x0]);_0x392822['push'](_0x233a00[0x1]);_0x392822[_0xf878('0x21')](_0x233a00[0x2]);_0x392822[_0xf878('0x21')](_0x233a00[0x3]);_0x392822[_0xf878('0x21')](_0x233a00[_0xf878('0x22')](0x4,_0x233a00[_0xf878('0x19')])['join'](','));break;case _0xf878('0x15'):_0x392822[_0xf878('0x21')](_0x73f6bf['appdata']);break;case _0xf878('0x27'):_0x392822[_0xf878('0x21')](_0x73f6bf[_0xf878('0x28')]);_0x392822[_0xf878('0x21')](_0x73f6bf[_0xf878('0x1f')]);break;case'tvox':var _0x11d669=utils[_0xf878('0x29')](_0x35ff2d[_0xf878('0x2a')][_0xf878('0x2b')],_0x35ff2d);var _0x579c91=_0x73f6bf[_0xf878('0x1f')]['split'](',');_0x392822['push'](_0x579c91[0x0]);_0x392822[_0xf878('0x21')](_0x579c91[0x1]);_0x392822[_0xf878('0x21')](_0x579c91[0x2]);_0x392822[_0xf878('0x21')](_0x579c91[0x3]);_0x392822[_0xf878('0x21')](_0x579c91[0x4]);_0x392822[_0xf878('0x21')](_0x579c91[0x5]);_0x392822['push'](_0x579c91[0x6]);_0x392822[_0xf878('0x21')](_0x579c91[0x7]);_0x392822['push'](_0x579c91[0x8]);_0x392822[_0xf878('0x21')](_0x579c91[0x9]);_0x392822[_0xf878('0x21')](_0x579c91[0xa]);_0x392822['push'](_0x35ff2d[_0xf878('0x16')]['id']);_0x392822[_0xf878('0x21')](_0x35ff2d['message']['id']);_0x392822[_0xf878('0x21')](_0x73f6bf[_0xf878('0x2c')]);_0x392822['push'](_0x35ff2d[_0xf878('0x16')][_0xf878('0x2d')]);_0x392822[_0xf878('0x21')](_0x35ff2d[_0xf878('0x2e')][_0xf878('0x2e')]);_0x392822[_0xf878('0x21')](_0x11d669);break;default:_0x392822=_[_0xf878('0xe')](_0x73f6bf['appdata'])?[]:_0x73f6bf[_0xf878('0x1f')][_0xf878('0x20')](',');}var _0x47ec1b={'id':util[_0xf878('0x2f')]('%s:%s:%s',_0x415056,_0x73f6bf['id'],_0x73f6bf['app']),'condition':require(_0xf878('0x30'))[_0xf878('0x31')](_0x415056,getIntervals(_0x3902f7[_0xf878('0x32')],_0x73f6bf),_0x3902f7),'consequence':require(_0xf878('0x33')+_0x73f6bf[_0xf878('0x1b')])['consequence'](_0x415056,_0x392822,_0x3902f7,_0x35ff2d),'p':_0x73f6bf[_0xf878('0x34')]||0x0};logger['info'](_0xf878('0x35'),_0x47ec1b['id'],_0xf878('0x36'),getIntervals(_0x3902f7['intervals'],_0x73f6bf)['join'](_0xf878('0x37')));_0x186a02[_0xf878('0x21')](_0x47ec1b);}else{logger[_0xf878('0x38')](_0xf878('0x39'),path[_0xf878('0x23')](__dirname,_0xf878('0x17'),_0x73f6bf[_0xf878('0x1b')]+_0xf878('0x1c')));}}_0x3902f7[_0xf878('0x13')][_0x415056]=new RuleEngine(_0x186a02);_0x3902f7['rules'][_0x415056][_0xf878('0x3a')](_0x35ff2d,function(_0x21b4fb){logger[_0xf878('0x3b')](_0xf878('0x3c'),JSON[_0xf878('0x3d')](_0x21b4fb[_0xf878('0x3e')]));if(_0x3902f7['rules'][_0x415056]){_0x3902f7[_0xf878('0x13')][_0x415056][_0xf878('0x3f')](_0xf878('0x40'));}});return _0x6dbeca({'code':0xc8,'message':_0x35ff2d});}else{logger[_0xf878('0x3b')](_0xf878('0x41'));return _0x6dbeca({'code':0xc8,'message':_0x35ff2d});}}catch(_0x570f08){logger[_0xf878('0x38')](_0x570f08[_0xf878('0x42')]);return _0x44aacc(_0x31d888[_0xf878('0x38')](0x1f4,_0x570f08));}}return _0x44aacc(_0xf878('0x43'));});},'AcceptMessage':function(_0x4ddff7){var _0x327a73=this;return new Promise(function(_0x2e7f4a,_0x327e40){if(_0x4ddff7['agent']&&_0x4ddff7['agent']['id']){if(_0x3902f7[_0xf878('0x44')][_0x4ddff7['agent']['id']]){_0x3902f7['agents'][_0x4ddff7['agent']['id']][_0xf878('0x45')]=![];_0x3902f7['agents'][_0x4ddff7[_0xf878('0x46')]['id']][_0xf878('0x47')]=undefined;}}if(_0x4ddff7[_0xf878('0x15')]&&_0x4ddff7[_0xf878('0x15')]['id']){try{var _0x367554=getId(_0x4ddff7[_0xf878('0x14')],_0x4ddff7[_0xf878('0x15')]?_0x4ddff7['message']['id']:0x0,_0x4ddff7[_0xf878('0x16')]?_0x4ddff7[_0xf878('0x16')]['id']:0x0);if(_0x3902f7[_0xf878('0x13')][_0x367554]){_0x3902f7[_0xf878('0x13')][_0x367554][_0xf878('0x3f')]('end');if(rpc[_0x4ddff7['channel']+_0xf878('0x48')]){rpc[_0x4ddff7[_0xf878('0x14')]+'QueueReport'][_0xf878('0x49')](_0x367554,{'UserId':_0x4ddff7['message'][_0xf878('0x4a')]})[_0xf878('0x4b')](function(_0x379912){logger[_0xf878('0x38')]('error\x20update\x20queue\x20report');});}}return _0x2e7f4a({'code':0xc8,'message':_0x4ddff7});}catch(_0xf0d960){logger[_0xf878('0x38')](_0xf0d960[_0xf878('0x42')]);return _0x327e40(_0x327a73['error'](0x1f4,_0xf0d960));}}logger[_0xf878('0x38')](_0xf878('0x4c'));return _0x327e40(_0x327a73[_0xf878('0x38')](0x1f4,_0xf878('0x4c')));});},'RejectMessage':function(_0x53e3c3){var _0x112f2a=this;return new Promise(function(_0x181f09,_0x3f9fce){if(_0x53e3c3['agent']&&_0x53e3c3[_0xf878('0x46')]['id']){try{if(_0x3902f7[_0xf878('0x44')][_0x53e3c3[_0xf878('0x46')]['id']]){_0x3902f7[_0xf878('0x44')][_0x53e3c3['agent']['id']]['busy']=![];_0x3902f7['agents'][_0x53e3c3[_0xf878('0x46')]['id']]['busyQueue']=undefined;}return _0x181f09({'code':0xc8,'message':_0x53e3c3});}catch(_0x516345){logger['error'](_0x516345[_0xf878('0x42')]);return _0x3f9fce(_0x112f2a[_0xf878('0x38')](0x1f4,_0x516345));}}logger['error'](_0xf878('0x4c'));return _0x3f9fce(_0x112f2a[_0xf878('0x38')](0x1f4,_0xf878('0x4c')));});},'AbandonInteraction':function(_0x4ce441){var _0x5eab57=this;return new Promise(function(_0x46c927,_0x4b8a8c){if(_0x4ce441[_0xf878('0x14')]&&_0x4ce441[_0xf878('0x16')]&&_0x4ce441[_0xf878('0x16')]['id']){try{var _0x402b45=getId(_0x4ce441[_0xf878('0x14')],_0x4ce441[_0xf878('0x15')]?_0x4ce441['message']['id']:0x0,_0x4ce441[_0xf878('0x16')]?_0x4ce441[_0xf878('0x16')]['id']:0x0);if(_0x3902f7['rules'][_0x402b45]){_0x3902f7[_0xf878('0x13')][_0x402b45][_0xf878('0x3f')](_0xf878('0x4d'));}return _0x46c927({'code':0xc8,'message':_0x4ce441});}catch(_0x282985){logger[_0xf878('0x38')](_0x282985[_0xf878('0x42')]);return _0x4b8a8c(_0x5eab57[_0xf878('0x38')](0x1f4,_0x282985));}}logger['error'](_0xf878('0x4c'));return _0x4b8a8c(_0x5eab57[_0xf878('0x38')](0x1f4,_0xf878('0x4c')));});},'AgentCapacity':function(_0x52b94e){var _0x392242=this;return new Promise(function(_0x560e0b,_0x44325d){if(_0x3902f7[_0xf878('0x44')][_0xf878('0x4e')](_0x52b94e['id'])){for(var _0x42de64 in _0x52b94e[_0xf878('0x4f')]){if(_0x52b94e[_0xf878('0x4f')][_0xf878('0x4e')](_0x42de64)){if(_0x3902f7[_0xf878('0x44')][_0x52b94e['id']][_0xf878('0x4e')](_0x42de64+_0xf878('0x50'))){_0x3902f7['agents'][_0x52b94e['id']][_0x42de64+'CurrentCapacity']=parseInt(_0x52b94e['capacity'][_0x42de64],0xa);}}}_0x3902f7[_0xf878('0x44')][_0x52b94e['id']]['updateRealtime']();return _0x560e0b({'code':0xc8,'message':_0x3902f7[_0xf878('0x44')][_0x52b94e['id']]});}else{return _0x44325d(_0x392242[_0xf878('0x38')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x5b14ce){return new Promise(function(_0xb6293c,_0x424465){var _0x3340c1=_[_0xf878('0x51')](_0x3902f7[_0xf878('0x44')]);_0xb6293c({'count':_0x3340c1[_0xf878('0x19')],'rows':_0x3340c1});});},'ChatQueues':function(_0x3e78fc){return new Promise(function(_0x302258,_0x1602ed){var _0x28c263=[];for(var _0x3fe873 in _0x3902f7[_0xf878('0x52')]){if(_0x3902f7[_0xf878('0x52')][_0xf878('0x4e')](_0x3fe873)){var _0x3a6393=_0x3902f7[_0xf878('0x52')][_0x3fe873];var _0x1254dd={'id':_0x3a6393['id'],'available':_0x3a6393[_0xf878('0x53')],'loggedIn':_0x3a6393['loggedIn'],'name':_0x3a6393[_0xf878('0x54')],'paused':_0x3a6393['paused'],'waiting':_0x3a6393[_0xf878('0x55')]};_0x28c263[_0xf878('0x21')](_0x1254dd);}}_0x302258({'count':_0x28c263[_0xf878('0x19')],'rows':_0x28c263});});},'MailQueues':function(_0x910e78){return new Promise(function(_0x392177,_0x27b3de){var _0x13c6a6=[];for(var _0x1ae62b in _0x3902f7[_0xf878('0x56')]){if(_0x3902f7['mailQueues'][_0xf878('0x4e')](_0x1ae62b)){var _0x138133=_0x3902f7[_0xf878('0x56')][_0x1ae62b];var _0x42f705={'id':_0x138133['id'],'available':_0x138133['available'],'loggedIn':_0x138133[_0xf878('0x57')],'name':_0x138133[_0xf878('0x54')],'paused':_0x138133[_0xf878('0x58')],'waiting':_0x138133[_0xf878('0x55')]};_0x13c6a6[_0xf878('0x21')](_0x42f705);}}_0x392177({'count':_0x13c6a6['length'],'rows':_0x13c6a6});});},'OpenchannelQueues':function(_0x5860f6){return new Promise(function(_0x453644,_0x1b0230){var _0x193f6c=[];for(var _0x251613 in _0x3902f7[_0xf878('0x59')]){if(_0x3902f7[_0xf878('0x59')][_0xf878('0x4e')](_0x251613)){var _0x3bae55=_0x3902f7[_0xf878('0x59')][_0x251613];var _0x42f157={'id':_0x3bae55['id'],'available':_0x3bae55[_0xf878('0x53')],'loggedIn':_0x3bae55[_0xf878('0x57')],'name':_0x3bae55[_0xf878('0x54')],'paused':_0x3bae55[_0xf878('0x58')],'waiting':_0x3bae55[_0xf878('0x55')]};_0x193f6c[_0xf878('0x21')](_0x42f157);}}_0x453644({'count':_0x193f6c[_0xf878('0x19')],'rows':_0x193f6c});});},'SmsQueues':function(_0x580d40){return new Promise(function(_0x3ee3e0,_0x138730){var _0x288235=[];for(var _0x2291d9 in _0x3902f7[_0xf878('0x5a')]){if(_0x3902f7[_0xf878('0x5a')][_0xf878('0x4e')](_0x2291d9)){var _0xfb4a92=_0x3902f7[_0xf878('0x5a')][_0x2291d9];var _0x589c90={'id':_0xfb4a92['id'],'available':_0xfb4a92[_0xf878('0x53')],'loggedIn':_0xfb4a92[_0xf878('0x57')],'name':_0xfb4a92[_0xf878('0x54')],'paused':_0xfb4a92[_0xf878('0x58')],'waiting':_0xfb4a92[_0xf878('0x55')]};_0x288235[_0xf878('0x21')](_0x589c90);}}_0x3ee3e0({'count':_0x288235[_0xf878('0x19')],'rows':_0x288235});});},'FaxQueues':function(_0x4d8104){return new Promise(function(_0x591b5e,_0x12859b){var _0x54ecdd=[];for(var _0x338e77 in _0x3902f7[_0xf878('0x5b')]){if(_0x3902f7[_0xf878('0x5b')][_0xf878('0x4e')](_0x338e77)){var _0x5c50b0=_0x3902f7[_0xf878('0x5b')][_0x338e77];var _0x41e140={'id':_0x5c50b0['id'],'available':_0x5c50b0[_0xf878('0x53')],'loggedIn':_0x5c50b0[_0xf878('0x57')],'name':_0x5c50b0['name'],'paused':_0x5c50b0[_0xf878('0x58')],'waiting':_0x5c50b0['waiting']};_0x54ecdd[_0xf878('0x21')](_0x41e140);}}_0x591b5e({'count':_0x54ecdd[_0xf878('0x19')],'rows':_0x54ecdd});});},'WhatsappQueues':function(_0x1f935a){return new Promise(function(_0x1d7c1f,_0x416c48){var _0x58b64b=[];for(var _0x186f76 in _0x3902f7[_0xf878('0x5c')]){if(_0x3902f7[_0xf878('0x5c')][_0xf878('0x4e')](_0x186f76)){var _0x52b43e=_0x3902f7[_0xf878('0x5c')][_0x186f76];var _0x58584f={'id':_0x52b43e['id'],'available':_0x52b43e[_0xf878('0x53')],'loggedIn':_0x52b43e[_0xf878('0x57')],'name':_0x52b43e[_0xf878('0x54')],'paused':_0x52b43e[_0xf878('0x58')],'waiting':_0x52b43e[_0xf878('0x55')]};_0x58b64b[_0xf878('0x21')](_0x58584f);}}_0x1d7c1f({'count':_0x58b64b[_0xf878('0x19')],'rows':_0x58b64b});});},'ChatQueuesWaitingInteractions':function(_0x2ad2e2){return new Promise(function(_0x4e98db,_0x57cf7e){var _0x47bf8f=_[_0xf878('0x51')](_0x3902f7[_0xf878('0x5d')]);_0x4e98db({'count':_0x47bf8f['length'],'rows':_0x47bf8f});});},'MailQueuesWaitingInteractions':function(_0x4876e3){return new Promise(function(_0x2f1882,_0x59056c){var _0x1a73da=_[_0xf878('0x51')](_0x3902f7[_0xf878('0x5e')]);_0x2f1882({'count':_0x1a73da[_0xf878('0x19')],'rows':_0x1a73da});});},'OpenchannelQueuesWaitingInteractions':function(_0x2be42d){return new Promise(function(_0x1d4827,_0xc49d9e){var _0xff0f3c=_[_0xf878('0x51')](_0x3902f7['openchannelQueuesWaitingInteractions']);_0x1d4827({'count':_0xff0f3c[_0xf878('0x19')],'rows':_0xff0f3c});});},'SmsQueuesWaitingInteractions':function(_0x170a6a){return new Promise(function(_0x27766e,_0x4800cc){var _0x15f893=_[_0xf878('0x51')](_0x3902f7['smsQueuesWaitingInteractions']);_0x27766e({'count':_0x15f893[_0xf878('0x19')],'rows':_0x15f893});});},'FaxQueuesWaitingInteractions':function(_0x40c76a){return new Promise(function(_0x2b548d,_0x257e42){var _0x1b7b43=_[_0xf878('0x51')](_0x3902f7[_0xf878('0x5f')]);_0x2b548d({'count':_0x1b7b43[_0xf878('0x19')],'rows':_0x1b7b43});});},'WhatsappQueuesWaitingInteractions':function(_0x5c1e38){return new Promise(function(_0x34531b,_0x5888b5){var _0x58f8d8=_[_0xf878('0x51')](_0x3902f7[_0xf878('0x60')]);_0x34531b({'count':_0x58f8d8['length'],'rows':_0x58f8d8});});}};var _0x12a57f=jayson[_0xf878('0x61')](_0x4c0948)[_0xf878('0x62')]();_0x12a57f['on'](_0xf878('0x38'),function(_0x1382c0){logger['error'](JSON[_0xf878('0x3d')](_0x1382c0));return _0x568a3a(_0x1382c0);});_0x12a57f[_0xf878('0x12')](0x232c,'127.0.0.1',function(){console[_0xf878('0x63')](_0xf878('0x64'),0x232c);return _0x492260(_0xf878('0x65')+0x232c);});});};
\ No newline at end of file
+var _0xbfcc=['Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','uuid','./applications/utils','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','mail','push','slice','join','dialogflow','appdata','split','dialogflowv2','amazonlex','TagId','tvox','getMustacheRender','account','ChatWebsiteId','body','format','%s:%s:%s','./interval','condition','intervals','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','.js','execute','info','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','log'];(function(_0x217ef3,_0x56c439){var _0x17708d=function(_0x2eec67){while(--_0x2eec67){_0x217ef3['push'](_0x217ef3['shift']());}};_0x17708d(++_0x56c439);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xbfcc[_0x355ce8];return _0x1db8b8;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0xcbfc('0x1'));var BPromise=require(_0xcbfc('0x2'));var uuid=require(_0xcbfc('0x3'));var utils=require(_0xcbfc('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xcbfc('0x5')),'chatQueueReport':require(_0xcbfc('0x6')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xcbfc('0x7')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0xcbfc('0x8'));function getId(_0x1f8b71,_0x1b1377,_0xa1c83b){return util['format'](_0xcbfc('0x9'),_0x1f8b71,_0x1b1377||0x0,_0xa1c83b||0x0);}function getIntervals(_0x3be6f9,_0x36bdb8){var _0x25786f=[];if(!_[_0xcbfc('0xa')](_0x36bdb8[_0xcbfc('0xb')])&&!_['isNil'](_0x3be6f9[_0x36bdb8[_0xcbfc('0xb')]])&&!_[_0xcbfc('0xa')](_0x3be6f9[_0x36bdb8[_0xcbfc('0xb')]][_0xcbfc('0xc')])){_0x25786f=_[_0xcbfc('0xd')](_0x3be6f9[_0x36bdb8['IntervalId']][_0xcbfc('0xc')],_0xcbfc('0xe'));}else if(!_[_0xcbfc('0xa')](_0x36bdb8['interval'])){_0x25786f=[_0x36bdb8[_0xcbfc('0xe')]];}return _0x25786f;}exports[_0xcbfc('0xf')]=function(_0x2f2bdd){_0x2f2bdd[_0xcbfc('0x10')]={};return new BPromise(function(_0x16b659,_0x53a7ea){var _0x3c69ed={'Start':function(_0x1963de){var _0x1ec8c4=this;return new Promise(function(_0x4317e4,_0x50c6b6){if(_0x1963de){try{var _0x565301=[];var _0x418f18=getId(_0x1963de[_0xcbfc('0x11')],_0x1963de[_0xcbfc('0x12')]?_0x1963de['message']['id']:0x0,_0x1963de['interaction']?_0x1963de[_0xcbfc('0x13')]['id']:0x0);if(_0x1963de[_0xcbfc('0x14')]&&_[_0xcbfc('0x15')](_0x1963de['applications'])&&_0x1963de[_0xcbfc('0x14')]['length']){for(var _0x28f7fb=0x0;_0x28f7fb<_0x1963de[_0xcbfc('0x14')][_0xcbfc('0x16')];_0x28f7fb+=0x1){var _0x2fdc5c=_0x1963de[_0xcbfc('0x14')][_0x28f7fb];if(fs[_0xcbfc('0x17')](path['join'](__dirname,_0xcbfc('0x14'),_0x2fdc5c[_0xcbfc('0x18')]+'.js'))){var _0x1da958=[];switch(_0x2fdc5c['app']['toLowerCase']()){case'autoreply':var _0x41bce0=_0x2fdc5c['appdata']['split'](',');if(_0x1963de[_0xcbfc('0x11')]===_0xcbfc('0x19')){_0x1da958[_0xcbfc('0x1a')](_0x41bce0[0x0]);_0x1da958[_0xcbfc('0x1a')](_0x41bce0[0x1]);_0x1da958['push'](_0x41bce0[_0xcbfc('0x1b')](0x2,_0x41bce0['length'])[_0xcbfc('0x1c')](','));}else{_0x1da958[_0xcbfc('0x1a')](_0x41bce0[0x0]);_0x1da958['push'](_0x41bce0[_0xcbfc('0x1b')](0x1,_0x41bce0[_0xcbfc('0x16')])['join'](','));}break;case _0xcbfc('0x1d'):var _0x3c3afd=_0x2fdc5c[_0xcbfc('0x1e')][_0xcbfc('0x1f')](',');_0x1da958['push'](_0x3c3afd[0x0]);_0x1da958[_0xcbfc('0x1a')](_0x3c3afd[0x1]);_0x1da958[_0xcbfc('0x1a')](_0x3c3afd['slice'](0x2,_0x3c3afd[_0xcbfc('0x16')])[_0xcbfc('0x1c')](','));break;case _0xcbfc('0x20'):var _0x388d41=_0x2fdc5c[_0xcbfc('0x1e')][_0xcbfc('0x1f')](',');_0x1da958[_0xcbfc('0x1a')](_0x388d41[0x0]);_0x1da958['push'](_0x388d41[0x1]);_0x1da958[_0xcbfc('0x1a')](_0x388d41[0x2]);_0x1da958[_0xcbfc('0x1a')](_0x388d41[0x3]);_0x1da958[_0xcbfc('0x1a')](_0x388d41[_0xcbfc('0x1b')](0x4,_0x388d41['length'])[_0xcbfc('0x1c')](','));break;case _0xcbfc('0x21'):var _0x1c4970=_0x2fdc5c[_0xcbfc('0x1e')][_0xcbfc('0x1f')](',');_0x1da958[_0xcbfc('0x1a')](_0x1c4970[0x0]);_0x1da958[_0xcbfc('0x1a')](_0x1c4970[0x1]);_0x1da958['push'](_0x1c4970[0x2]);_0x1da958[_0xcbfc('0x1a')](_0x1c4970[0x3]);_0x1da958[_0xcbfc('0x1a')](_0x1c4970['slice'](0x4,_0x1c4970[_0xcbfc('0x16')])[_0xcbfc('0x1c')](','));break;case _0xcbfc('0x12'):_0x1da958['push'](_0x2fdc5c['appdata']);break;case'tag':_0x1da958[_0xcbfc('0x1a')](_0x2fdc5c[_0xcbfc('0x22')]);_0x1da958[_0xcbfc('0x1a')](_0x2fdc5c[_0xcbfc('0x1e')]);break;case _0xcbfc('0x23'):var _0x1157ba=utils[_0xcbfc('0x24')](_0x1963de[_0xcbfc('0x25')]['notificationTemplate'],_0x1963de);var _0x2f14ff=_0x2fdc5c[_0xcbfc('0x1e')]['split'](',');_0x1da958[_0xcbfc('0x1a')](_0x2f14ff[0x0]);_0x1da958['push'](_0x2f14ff[0x1]);_0x1da958[_0xcbfc('0x1a')](_0x2f14ff[0x2]);_0x1da958[_0xcbfc('0x1a')](_0x2f14ff[0x3]);_0x1da958[_0xcbfc('0x1a')](_0x2f14ff[0x4]);_0x1da958['push'](_0x2f14ff[0x5]);_0x1da958[_0xcbfc('0x1a')](_0x2f14ff[0x6]);_0x1da958['push'](_0x2f14ff[0x7]);_0x1da958['push'](_0x2f14ff[0x8]);_0x1da958[_0xcbfc('0x1a')](_0x2f14ff[0x9]);_0x1da958[_0xcbfc('0x1a')](_0x2f14ff[0xa]);_0x1da958[_0xcbfc('0x1a')](_0x1963de[_0xcbfc('0x13')]['id']);_0x1da958[_0xcbfc('0x1a')](_0x1963de[_0xcbfc('0x12')]['id']);_0x1da958[_0xcbfc('0x1a')](_0x2fdc5c[_0xcbfc('0x26')]);_0x1da958['push'](_0x1963de[_0xcbfc('0x13')]['ContactId']);_0x1da958[_0xcbfc('0x1a')](_0x1963de[_0xcbfc('0x27')][_0xcbfc('0x27')]);_0x1da958[_0xcbfc('0x1a')](_0x1157ba);break;default:_0x1da958=_['isNil'](_0x2fdc5c['appdata'])?[]:_0x2fdc5c[_0xcbfc('0x1e')][_0xcbfc('0x1f')](',');}var _0x404f46={'id':util[_0xcbfc('0x28')](_0xcbfc('0x29'),_0x418f18,_0x2fdc5c['id'],_0x2fdc5c['app']),'condition':require(_0xcbfc('0x2a'))[_0xcbfc('0x2b')](_0x418f18,getIntervals(_0x2f2bdd[_0xcbfc('0x2c')],_0x2fdc5c),_0x2f2bdd),'consequence':require('./applications/'+_0x2fdc5c[_0xcbfc('0x18')])[_0xcbfc('0x2d')](_0x418f18,_0x1da958,_0x2f2bdd,_0x1963de),'p':_0x2fdc5c[_0xcbfc('0x2e')]||0x0};logger['info'](_0xcbfc('0x2f'),_0x404f46['id'],_0xcbfc('0x30'),getIntervals(_0x2f2bdd[_0xcbfc('0x2c')],_0x2fdc5c)[_0xcbfc('0x1c')](_0xcbfc('0x31')));_0x565301[_0xcbfc('0x1a')](_0x404f46);}else{logger[_0xcbfc('0x32')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xcbfc('0x1c')](__dirname,_0xcbfc('0x14'),_0x2fdc5c['app']+_0xcbfc('0x33')));}}_0x2f2bdd[_0xcbfc('0x10')][_0x418f18]=new RuleEngine(_0x565301);_0x2f2bdd[_0xcbfc('0x10')][_0x418f18][_0xcbfc('0x34')](_0x1963de,function(_0xd609ec){logger[_0xcbfc('0x35')](_0xcbfc('0x36'),JSON[_0xcbfc('0x37')](_0xd609ec['matchPath']));if(_0x2f2bdd[_0xcbfc('0x10')][_0x418f18]){_0x2f2bdd[_0xcbfc('0x10')][_0x418f18][_0xcbfc('0x38')](_0xcbfc('0x39'));}});return _0x4317e4({'code':0xc8,'message':_0x1963de});}else{logger[_0xcbfc('0x35')](_0xcbfc('0x3a'));return _0x4317e4({'code':0xc8,'message':_0x1963de});}}catch(_0x1c4d87){logger['error'](_0x1c4d87[_0xcbfc('0x3b')]);return _0x50c6b6(_0x1ec8c4[_0xcbfc('0x32')](0x1f4,_0x1c4d87));}}return _0x50c6b6('routing\x20is\x20empty');});},'AcceptMessage':function(_0x16c12f){var _0x3426b9=this;return new Promise(function(_0x3a118f,_0x4d222b){if(_0x16c12f[_0xcbfc('0x3c')]&&_0x16c12f[_0xcbfc('0x3c')]['id']){if(_0x2f2bdd[_0xcbfc('0x3d')][_0x16c12f[_0xcbfc('0x3c')]['id']]){_0x2f2bdd[_0xcbfc('0x3d')][_0x16c12f[_0xcbfc('0x3c')]['id']][_0xcbfc('0x3e')]=![];_0x2f2bdd['agents'][_0x16c12f['agent']['id']][_0xcbfc('0x3f')]=undefined;}}if(_0x16c12f[_0xcbfc('0x12')]&&_0x16c12f[_0xcbfc('0x12')]['id']){try{var _0x35e294=getId(_0x16c12f['channel'],_0x16c12f['message']?_0x16c12f[_0xcbfc('0x12')]['id']:0x0,_0x16c12f[_0xcbfc('0x13')]?_0x16c12f[_0xcbfc('0x13')]['id']:0x0);if(_0x2f2bdd['rules'][_0x35e294]){_0x2f2bdd[_0xcbfc('0x10')][_0x35e294][_0xcbfc('0x38')](_0xcbfc('0x40'));if(rpc[_0x16c12f['channel']+_0xcbfc('0x41')]){rpc[_0x16c12f[_0xcbfc('0x11')]+_0xcbfc('0x41')][_0xcbfc('0x42')](_0x35e294,{'UserId':_0x16c12f[_0xcbfc('0x12')][_0xcbfc('0x43')]})[_0xcbfc('0x44')](function(_0x374998){logger[_0xcbfc('0x32')](_0xcbfc('0x45'));});}}return _0x3a118f({'code':0xc8,'message':_0x16c12f});}catch(_0x48b5c8){logger[_0xcbfc('0x32')](_0x48b5c8[_0xcbfc('0x3b')]);return _0x4d222b(_0x3426b9[_0xcbfc('0x32')](0x1f4,_0x48b5c8));}}logger['error'](_0xcbfc('0x46'));return _0x4d222b(_0x3426b9[_0xcbfc('0x32')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x54de8){var _0x5ce8e3=this;return new Promise(function(_0x38db76,_0x25e48d){if(_0x54de8['agent']&&_0x54de8[_0xcbfc('0x3c')]['id']){try{if(_0x2f2bdd[_0xcbfc('0x3d')][_0x54de8['agent']['id']]){_0x2f2bdd[_0xcbfc('0x3d')][_0x54de8[_0xcbfc('0x3c')]['id']][_0xcbfc('0x3e')]=![];_0x2f2bdd[_0xcbfc('0x3d')][_0x54de8[_0xcbfc('0x3c')]['id']][_0xcbfc('0x3f')]=undefined;}return _0x38db76({'code':0xc8,'message':_0x54de8});}catch(_0x43a943){logger[_0xcbfc('0x32')](_0x43a943[_0xcbfc('0x3b')]);return _0x25e48d(_0x5ce8e3[_0xcbfc('0x32')](0x1f4,_0x43a943));}}logger['error'](_0xcbfc('0x46'));return _0x25e48d(_0x5ce8e3['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x4a10e6){var _0x4239da=this;return new Promise(function(_0xe141a3,_0x179258){if(_0x4a10e6[_0xcbfc('0x11')]&&_0x4a10e6[_0xcbfc('0x13')]&&_0x4a10e6[_0xcbfc('0x13')]['id']){try{var _0x21d4fa=getId(_0x4a10e6[_0xcbfc('0x11')],_0x4a10e6['message']?_0x4a10e6[_0xcbfc('0x12')]['id']:0x0,_0x4a10e6[_0xcbfc('0x13')]?_0x4a10e6[_0xcbfc('0x13')]['id']:0x0);if(_0x2f2bdd['rules'][_0x21d4fa]){_0x2f2bdd[_0xcbfc('0x10')][_0x21d4fa][_0xcbfc('0x38')](_0xcbfc('0x40'));}return _0xe141a3({'code':0xc8,'message':_0x4a10e6});}catch(_0x3b526f){logger[_0xcbfc('0x32')](_0x3b526f[_0xcbfc('0x3b')]);return _0x179258(_0x4239da[_0xcbfc('0x32')](0x1f4,_0x3b526f));}}logger['error'](_0xcbfc('0x46'));return _0x179258(_0x4239da['error'](0x1f4,_0xcbfc('0x46')));});},'AgentCapacity':function(_0x3daf82){var _0x5de047=this;return new Promise(function(_0x2c6b23,_0x5673e5){if(_0x2f2bdd[_0xcbfc('0x3d')][_0xcbfc('0x47')](_0x3daf82['id'])){for(var _0x13fe03 in _0x3daf82[_0xcbfc('0x48')]){if(_0x3daf82[_0xcbfc('0x48')][_0xcbfc('0x47')](_0x13fe03)){if(_0x2f2bdd['agents'][_0x3daf82['id']][_0xcbfc('0x47')](_0x13fe03+_0xcbfc('0x49'))){_0x2f2bdd['agents'][_0x3daf82['id']][_0x13fe03+_0xcbfc('0x49')]=parseInt(_0x3daf82[_0xcbfc('0x48')][_0x13fe03],0xa);}}}_0x2f2bdd[_0xcbfc('0x3d')][_0x3daf82['id']][_0xcbfc('0x4a')]();return _0x2c6b23({'code':0xc8,'message':_0x2f2bdd[_0xcbfc('0x3d')][_0x3daf82['id']]});}else{return _0x5673e5(_0x5de047[_0xcbfc('0x32')](0x1f4,_0xcbfc('0x4b')));}});},'Agents':function(_0xdc4ed9){return new Promise(function(_0x5d45b1,_0x307b50){var _0x3f01da=_[_0xcbfc('0x4c')](_0x2f2bdd[_0xcbfc('0x3d')]);_0x5d45b1({'count':_0x3f01da[_0xcbfc('0x16')],'rows':_0x3f01da});});},'ChatQueues':function(_0x2fb0c2){return new Promise(function(_0x209d61,_0x380539){var _0x3fa35b=[];for(var _0x32846f in _0x2f2bdd['chatQueues']){if(_0x2f2bdd[_0xcbfc('0x4d')][_0xcbfc('0x47')](_0x32846f)){var _0x48a201=_0x2f2bdd[_0xcbfc('0x4d')][_0x32846f];var _0x510a43={'id':_0x48a201['id'],'available':_0x48a201['available'],'loggedIn':_0x48a201[_0xcbfc('0x4e')],'name':_0x48a201[_0xcbfc('0x4f')],'paused':_0x48a201[_0xcbfc('0x50')],'waiting':_0x48a201[_0xcbfc('0x51')]};_0x3fa35b[_0xcbfc('0x1a')](_0x510a43);}}_0x209d61({'count':_0x3fa35b['length'],'rows':_0x3fa35b});});},'MailQueues':function(_0x53babd){return new Promise(function(_0xe5fe7b,_0x2f5d8a){var _0x2a3fcb=[];for(var _0x26cb3a in _0x2f2bdd[_0xcbfc('0x52')]){if(_0x2f2bdd['mailQueues'][_0xcbfc('0x47')](_0x26cb3a)){var _0x46fe20=_0x2f2bdd[_0xcbfc('0x52')][_0x26cb3a];var _0x4a62fc={'id':_0x46fe20['id'],'available':_0x46fe20['available'],'loggedIn':_0x46fe20['loggedIn'],'name':_0x46fe20[_0xcbfc('0x4f')],'paused':_0x46fe20['paused'],'waiting':_0x46fe20['waiting']};_0x2a3fcb[_0xcbfc('0x1a')](_0x4a62fc);}}_0xe5fe7b({'count':_0x2a3fcb['length'],'rows':_0x2a3fcb});});},'OpenchannelQueues':function(_0x99068f){return new Promise(function(_0x34e671,_0xed28ff){var _0x461e5b=[];for(var _0x16d91a in _0x2f2bdd[_0xcbfc('0x53')]){if(_0x2f2bdd[_0xcbfc('0x53')][_0xcbfc('0x47')](_0x16d91a)){var _0x1140d1=_0x2f2bdd['openchannelQueues'][_0x16d91a];var _0xa490ee={'id':_0x1140d1['id'],'available':_0x1140d1[_0xcbfc('0x54')],'loggedIn':_0x1140d1[_0xcbfc('0x4e')],'name':_0x1140d1['name'],'paused':_0x1140d1[_0xcbfc('0x50')],'waiting':_0x1140d1[_0xcbfc('0x51')]};_0x461e5b[_0xcbfc('0x1a')](_0xa490ee);}}_0x34e671({'count':_0x461e5b[_0xcbfc('0x16')],'rows':_0x461e5b});});},'SmsQueues':function(_0xaec3f7){return new Promise(function(_0x161558,_0x723b68){var _0x562380=[];for(var _0xe2671a in _0x2f2bdd['smsQueues']){if(_0x2f2bdd[_0xcbfc('0x55')][_0xcbfc('0x47')](_0xe2671a)){var _0x12e57e=_0x2f2bdd['smsQueues'][_0xe2671a];var _0x267b37={'id':_0x12e57e['id'],'available':_0x12e57e['available'],'loggedIn':_0x12e57e[_0xcbfc('0x4e')],'name':_0x12e57e[_0xcbfc('0x4f')],'paused':_0x12e57e[_0xcbfc('0x50')],'waiting':_0x12e57e[_0xcbfc('0x51')]};_0x562380[_0xcbfc('0x1a')](_0x267b37);}}_0x161558({'count':_0x562380[_0xcbfc('0x16')],'rows':_0x562380});});},'FaxQueues':function(_0x1bdfa0){return new Promise(function(_0x5aef23,_0x247ca4){var _0x229bb7=[];for(var _0x1d0d4f in _0x2f2bdd['faxQueues']){if(_0x2f2bdd[_0xcbfc('0x56')]['hasOwnProperty'](_0x1d0d4f)){var _0x189a3a=_0x2f2bdd[_0xcbfc('0x56')][_0x1d0d4f];var _0xfe478={'id':_0x189a3a['id'],'available':_0x189a3a['available'],'loggedIn':_0x189a3a[_0xcbfc('0x4e')],'name':_0x189a3a[_0xcbfc('0x4f')],'paused':_0x189a3a['paused'],'waiting':_0x189a3a[_0xcbfc('0x51')]};_0x229bb7['push'](_0xfe478);}}_0x5aef23({'count':_0x229bb7[_0xcbfc('0x16')],'rows':_0x229bb7});});},'WhatsappQueues':function(_0x4ee84e){return new Promise(function(_0x5f96e1,_0x32d645){var _0x4f4c64=[];for(var _0x1dfec7 in _0x2f2bdd['whatsappQueues']){if(_0x2f2bdd[_0xcbfc('0x57')][_0xcbfc('0x47')](_0x1dfec7)){var _0x2ddf3c=_0x2f2bdd[_0xcbfc('0x57')][_0x1dfec7];var _0x5301a7={'id':_0x2ddf3c['id'],'available':_0x2ddf3c[_0xcbfc('0x54')],'loggedIn':_0x2ddf3c['loggedIn'],'name':_0x2ddf3c[_0xcbfc('0x4f')],'paused':_0x2ddf3c[_0xcbfc('0x50')],'waiting':_0x2ddf3c[_0xcbfc('0x51')]};_0x4f4c64[_0xcbfc('0x1a')](_0x5301a7);}}_0x5f96e1({'count':_0x4f4c64[_0xcbfc('0x16')],'rows':_0x4f4c64});});},'ChatQueuesWaitingInteractions':function(_0x34d1c6){return new Promise(function(_0x17c41f,_0x1929a0){var _0xc20ddf=_[_0xcbfc('0x4c')](_0x2f2bdd[_0xcbfc('0x58')]);_0x17c41f({'count':_0xc20ddf[_0xcbfc('0x16')],'rows':_0xc20ddf});});},'MailQueuesWaitingInteractions':function(_0x780a98){return new Promise(function(_0x1ff371,_0xe8aaf){var _0x2c90fe=_[_0xcbfc('0x4c')](_0x2f2bdd['mailQueuesWaitingInteractions']);_0x1ff371({'count':_0x2c90fe[_0xcbfc('0x16')],'rows':_0x2c90fe});});},'OpenchannelQueuesWaitingInteractions':function(_0x59725a){return new Promise(function(_0x46bc6b,_0x58d0f0){var _0x37f09a=_[_0xcbfc('0x4c')](_0x2f2bdd[_0xcbfc('0x59')]);_0x46bc6b({'count':_0x37f09a[_0xcbfc('0x16')],'rows':_0x37f09a});});},'SmsQueuesWaitingInteractions':function(_0x386156){return new Promise(function(_0x36eab3,_0x1b05a3){var _0x4f38cb=_[_0xcbfc('0x4c')](_0x2f2bdd['smsQueuesWaitingInteractions']);_0x36eab3({'count':_0x4f38cb[_0xcbfc('0x16')],'rows':_0x4f38cb});});},'FaxQueuesWaitingInteractions':function(_0x1d8745){return new Promise(function(_0x567807,_0x50212e){var _0x54f47c=_[_0xcbfc('0x4c')](_0x2f2bdd[_0xcbfc('0x5a')]);_0x567807({'count':_0x54f47c[_0xcbfc('0x16')],'rows':_0x54f47c});});},'WhatsappQueuesWaitingInteractions':function(_0x511463){return new Promise(function(_0x4f298c,_0xae54ec){var _0x180609=_[_0xcbfc('0x4c')](_0x2f2bdd[_0xcbfc('0x5b')]);_0x4f298c({'count':_0x180609[_0xcbfc('0x16')],'rows':_0x180609});});}};var _0x52fdc5=jayson['server'](_0x3c69ed)['http']();_0x52fdc5['on'](_0xcbfc('0x32'),function(_0x1905b1){logger[_0xcbfc('0x32')](JSON[_0xcbfc('0x37')](_0x1905b1));return _0x53a7ea(_0x1905b1);});_0x52fdc5['listen'](0x232c,'127.0.0.1',function(){console[_0xcbfc('0x5c')](_0xcbfc('0x5d'),0x232c);return _0x16b659(_0xcbfc('0x5e')+0x232c);});});};
\ No newline at end of file
index 1b4772a..6b84a2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96b0=['Command','format','iftime\x20%s','indexOf','true','all','some','join','log','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','stack','bluebird','../../../config/logger','routing','client','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push'];(function(_0x443594,_0x343113){var _0x2befaf=function(_0x2cc803){while(--_0x2cc803){_0x443594['push'](_0x443594['shift']());}};_0x2befaf(++_0x343113);}(_0x96b0,0x98));var _0x096b=function(_0x5380ac,_0x2437d1){_0x5380ac=_0x5380ac-0x0;var _0x4bc728=_0x96b0[_0x5380ac];return _0x4bc728;};'use strict';var util=require('util');var BPromise=require(_0x096b('0x0'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x096b('0x1'))(_0x096b('0x2'));var client=jayson[_0x096b('0x3')]['http']({'port':0x232a});function request(_0x21a8e9,_0x34d6a7){return new BPromise(function(_0xb92eef,_0x61ed74){return client[_0x096b('0x4')](_0x21a8e9,_0x34d6a7)[_0x096b('0x5')](function(_0x2659b0){if(_0x2659b0[_0x096b('0x6')]){return _0x61ed74(_0x2659b0[_0x096b('0x6')][_0x096b('0x7')]);}else{return _0xb92eef(_0x2659b0[_0x096b('0x8')]);}})[_0x096b('0x9')](function(_0x5b2079){return _0x61ed74(_0x5b2079);});});}exports[_0x096b('0xa')]=function(_0x1e1580,_0x30aa37,_0x1e166e){return function(_0x2b76f0){if(_0x1e166e[_0x096b('0xb')]&&!_0x1e166e[_0x096b('0xb')][_0x1e1580]){logger[_0x096b('0xc')](_0x096b('0xd'),_0x1e1580);return _0x2b76f0[_0x096b('0xe')]();}var _0x127022=[];for(var _0x46b83a=0x0;_0x46b83a<_0x30aa37['length'];_0x46b83a+=0x1){_0x127022[_0x096b('0xf')](request(_0x096b('0x10'),{'command':util[_0x096b('0x11')](_0x096b('0x12'),_0x30aa37[_0x46b83a])})['then'](function(_0x3f12e6){return _0x3f12e6&&_0x3f12e6['message']&&_0x3f12e6[_0x096b('0x7')][_0x096b('0x13')](_0x096b('0x14'))>=0x0?!![]:![];})[_0x096b('0x9')](function(_0x5e8f03){logger['error']('[%s][INTERVAL]\x20%s',_0x1e1580,_0x30aa37[_0x46b83a]);}));}BPromise[_0x096b('0x15')](_0x127022)['then'](function(_0x1e509b){var _0x53f141=_[_0x096b('0x16')](_0x1e509b);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x1e1580,_0x30aa37[_0x096b('0x17')]('\x20|\x20'),_0x53f141);_0x2b76f0['when'](_0x53f141);})['catch'](function(_0x8990cb){console[_0x096b('0x18')](_0x8990cb);logger[_0x096b('0x6')](_0x096b('0x19'),_0x1e1580,_0x30aa37[_0x096b('0x17')](_0x096b('0x1a')),_0x8990cb[_0x096b('0x1b')]);_0x2b76f0[_0x096b('0xe')]();});};};
\ No newline at end of file
+var _0x6833=['jayson/promise','lodash','../../../config/logger','client','request','then','error','message','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','util','bluebird'];(function(_0x7af343,_0x4b921a){var _0xa5642f=function(_0x35e819){while(--_0x35e819){_0x7af343['push'](_0x7af343['shift']());}};_0xa5642f(++_0x4b921a);}(_0x6833,0x172));var _0x3683=function(_0x4f15e1,_0x2b9790){_0x4f15e1=_0x4f15e1-0x0;var _0x40254c=_0x6833[_0x4f15e1];return _0x40254c;};'use strict';var util=require(_0x3683('0x0'));var BPromise=require(_0x3683('0x1'));var jayson=require(_0x3683('0x2'));var _=require(_0x3683('0x3'));var logger=require(_0x3683('0x4'))('routing');var client=jayson[_0x3683('0x5')]['http']({'port':0x232a});function request(_0x269cef,_0x57feb7){return new BPromise(function(_0x4823e7,_0x22bdb5){return client[_0x3683('0x6')](_0x269cef,_0x57feb7)[_0x3683('0x7')](function(_0x36a027){if(_0x36a027[_0x3683('0x8')]){return _0x22bdb5(_0x36a027[_0x3683('0x8')][_0x3683('0x9')]);}else{return _0x4823e7(_0x36a027['result']);}})['catch'](function(_0x21241b){return _0x22bdb5(_0x21241b);});});}exports['condition']=function(_0xf7692d,_0x33951d,_0x17a023){return function(_0x3b42b0){if(_0x17a023[_0x3683('0xa')]&&!_0x17a023[_0x3683('0xa')][_0xf7692d]){logger[_0x3683('0xb')](_0x3683('0xc'),_0xf7692d);return _0x3b42b0[_0x3683('0xd')]();}var _0xe0f74f=[];for(var _0x4dab59=0x0;_0x4dab59<_0x33951d[_0x3683('0xe')];_0x4dab59+=0x1){_0xe0f74f[_0x3683('0xf')](request(_0x3683('0x10'),{'command':util[_0x3683('0x11')](_0x3683('0x12'),_0x33951d[_0x4dab59])})[_0x3683('0x7')](function(_0x551f1a){return _0x551f1a&&_0x551f1a['message']&&_0x551f1a[_0x3683('0x9')][_0x3683('0x13')](_0x3683('0x14'))>=0x0?!![]:![];})[_0x3683('0x15')](function(_0x23eeca){logger[_0x3683('0x8')](_0x3683('0x16'),_0xf7692d,_0x33951d[_0x4dab59]);}));}BPromise[_0x3683('0x17')](_0xe0f74f)[_0x3683('0x7')](function(_0x593e53){var _0x2db5c6=_[_0x3683('0x18')](_0x593e53);logger[_0x3683('0xb')](_0x3683('0x19'),_0xf7692d,_0x33951d['join'](_0x3683('0x1a')),_0x2db5c6);_0x3b42b0[_0x3683('0x1b')](_0x2db5c6);})['catch'](function(_0x350a57){console[_0x3683('0x1c')](_0x350a57);logger['error'](_0x3683('0x19'),_0xf7692d,_0x33951d[_0x3683('0x1d')](_0x3683('0x1a')),_0x350a57[_0x3683('0x1e')]);_0x3b42b0[_0x3683('0xd')]();});};};
\ No newline at end of file
index 644f65d..99aad9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9aea=['[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','error','agentringnoanswer','isNil','debug','agentringnoanswerAt','timeout','reason','holdtime','ringtime','[%s][agents][agentringnoanswer]','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','transferexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','format'];(function(_0x49d5c4,_0x46cd2b){var _0x3e4cb6=function(_0x4e43f7){while(--_0x4e43f7){_0x49d5c4['push'](_0x49d5c4['shift']());}};_0x3e4cb6(++_0x46cd2b);}(_0x9aea,0xdd));var _0xa9ae=function(_0x27c47a,_0x3438c1){_0x27c47a=_0x27c47a-0x0;var _0x350651=_0x9aea[_0x27c47a];return _0x350651;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var utils=require(_0xa9ae('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e1d51,_0x2b5e0c){utils[_0xa9ae('0x2')](util['format'](_0xa9ae('0x3'),_0x5e1d51[_0xa9ae('0x4')],_0x5e1d51[_0xa9ae('0x5')],_0x5e1d51[_0xa9ae('0x6')],_0x5e1d51[_0xa9ae('0x7')],_0x5e1d51['interface'],_0x5e1d51[_0xa9ae('0x8')],_0x5e1d51[_0xa9ae('0x9')],_0x5e1d51[_0xa9ae('0xa')]));if(_0x5e1d51['queue']){utils[_0xa9ae('0xb')](_0x5e1d51[_0xa9ae('0x6')])[_0xa9ae('0xc')](function(_0x44cf1b){if(_0x44cf1b){_0x5e1d51[_0xa9ae('0xd')]=_0x44cf1b[_0xa9ae('0xd')];_0x5e1d51[_0xa9ae('0xe')]=_0x5e1d51[_0xa9ae('0xf')]?_0x44cf1b[_0xa9ae('0x10')]:![];_0x5e1d51['acwtime']=_0x5e1d51[_0xa9ae('0xe')]?_0x44cf1b['acwTimeout']:0x0;}utils[_0xa9ae('0x11')](_0xa9ae('0x12'),_0x5e1d51);});}else{utils[_0xa9ae('0x11')](_0xa9ae('0x12'),_0x5e1d51);}if(_0x2b5e0c){delete transfers[_0x5e1d51[_0xa9ae('0x4')]];}else{delete agents[_0x5e1d51[_0xa9ae('0x13')]];}}exports[_0xa9ae('0x14')]=function(_0x2b511a){try{utils['debug'](util[_0xa9ae('0x15')](_0xa9ae('0x16'),_0x2b511a[_0xa9ae('0x4')]),_0x2b511a);agents[_0x2b511a[_0xa9ae('0x13')]]=_0x2b511a;agents[_0x2b511a['destuniqueid']][_0xa9ae('0x17')]=utils[_0xa9ae('0x18')]();agents[_0x2b511a[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x19');agents[_0x2b511a[_0xa9ae('0x13')]]['connectedlinenum']=null;agents[_0x2b511a[_0xa9ae('0x13')]][_0xa9ae('0x1a')]=null;utils[_0xa9ae('0x2')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2b511a[_0xa9ae('0x4')],agents[_0x2b511a['destuniqueid']]['membername'],_0x2b511a[_0xa9ae('0x13')]));}catch(_0x3b8245){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')]('[%s][agents][agentcalled]',_0x2b511a[_0xa9ae('0x4')]),_0x3b8245);}};exports[_0xa9ae('0x1c')]=function(_0x39f133){try{if(!_[_0xa9ae('0x1d')](agents[_0x39f133[_0xa9ae('0x13')]])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')]('[%s][agents][agentringnoanswer]',_0x39f133[_0xa9ae('0x4')]),_0x39f133);utils['info'](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x39f133['uniqueid'],agents[_0x39f133[_0xa9ae('0x13')]]['membername'],_0x39f133[_0xa9ae('0x13')]));agents[_0x39f133['destuniqueid']][_0xa9ae('0x1c')]=!![];agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0x1f')]=utils[_0xa9ae('0x18')]();agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x20');agents[_0x39f133['destuniqueid']][_0xa9ae('0x21')]=_0xa9ae('0x20');agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0x22')]=_0x39f133[_0xa9ae('0x23')]?parseInt(_0x39f133[_0xa9ae('0x23')])/0x3e8:0x0;agents[_0x39f133[_0xa9ae('0x13')]]['talktime']=0x0;unanswered['push'](_0x39f133[_0xa9ae('0x13')]);}}catch(_0x3c324e){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x24'),_0x39f133['uniqueid']),_0x3c324e);}};exports['queuecallerabandon']=function(_0x1892b5){try{_[_0xa9ae('0x25')](agents,function(_0x372ec7,_0x3a48b7){if(_0x372ec7[_0xa9ae('0x4')]==_0x1892b5[_0xa9ae('0x4')]&&!_['includes'](unanswered,_0x372ec7['destuniqueid'])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x26'),_0x1892b5[_0xa9ae('0x4')]),_0x1892b5);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x27'),_0x1892b5[_0xa9ae('0x4')],_0x372ec7['membername'],_0x372ec7[_0xa9ae('0x13')]));_0x372ec7['agentringnoanswer']=!![];_0x372ec7[_0xa9ae('0x1f')]=utils[_0xa9ae('0x18')]();_0x372ec7[_0xa9ae('0xa')]='abandoned';_0x372ec7[_0xa9ae('0x21')]=_0xa9ae('0x28');_0x372ec7[_0xa9ae('0x22')]=_0x1892b5[_0xa9ae('0x22')];_0x372ec7[_0xa9ae('0x29')]=0x0;writeDB(_0x372ec7);}});}catch(_0x4cb3ae){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x26'),_0x1892b5['uniqueid']),_0x4cb3ae);}};exports['agentconnect']=function(_0x2155c8){try{if(agents[_0x2155c8[_0xa9ae('0x13')]]){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')]('[%s][agents][agentconnect]',_0x2155c8[_0xa9ae('0x4')]),_0x2155c8);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x2a'),_0x2155c8[_0xa9ae('0x4')],agents[_0x2155c8['destuniqueid']][_0xa9ae('0x7')],_0x2155c8['destuniqueid']));agents[_0x2155c8[_0xa9ae('0x13')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();agents[_0x2155c8['destuniqueid']][_0xa9ae('0x9')]=_0x2155c8[_0xa9ae('0x9')];agents[_0x2155c8[_0xa9ae('0x13')]]['connectedlinename']=_0x2155c8[_0xa9ae('0x1a')];agents[_0x2155c8[_0xa9ae('0x13')]]['holdtime']=_0x2155c8[_0xa9ae('0x23')];agents[_0x2155c8['destuniqueid']][_0xa9ae('0xa')]=_0xa9ae('0x2c');_['forIn'](agents,function(_0x37da9b,_0x15ce12){if(_0x37da9b[_0xa9ae('0x13')]!=_0x2155c8[_0xa9ae('0x13')]&&_0x37da9b[_0xa9ae('0x4')]==_0x2155c8[_0xa9ae('0x4')]){_0x37da9b['talktime']=0x0;_0x37da9b[_0xa9ae('0x22')]=_0x2155c8[_0xa9ae('0x23')];_0x37da9b['agentringnoanswer']=!![];_0x37da9b['agentringnoanswerAt']=utils[_0xa9ae('0x18')]();_0x37da9b[_0xa9ae('0xa')]=_0xa9ae('0x2d');_0x37da9b[_0xa9ae('0x21')]='answered_elsewhere';_0x37da9b[_0xa9ae('0x2e')]=_0x2155c8[_0xa9ae('0x13')];_0x37da9b[_0xa9ae('0x2f')]=_0x2155c8[_0xa9ae('0x7')];writeDB(_0x37da9b);}});}}catch(_0x23c91d){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')]('[%s][agents][agentconnect]',_0x2155c8[_0xa9ae('0x4')]),_0x23c91d);}};exports[_0xa9ae('0xf')]=function(_0x566cb0){try{if(!_[_0xa9ae('0x1d')](agents[_0x566cb0['destuniqueid']])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x30'),_0x566cb0[_0xa9ae('0x4')]),_0x566cb0);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x31'),_0x566cb0['uniqueid'],agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0x7')],_0x566cb0['destuniqueid']));agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0xf')]=!![];agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0x32')]=utils[_0xa9ae('0x18')]();agents[_0x566cb0[_0xa9ae('0x13')]]['talktime']=utils[_0xa9ae('0x33')](agents[_0x566cb0['destuniqueid']][_0xa9ae('0x32')],agents[_0x566cb0[_0xa9ae('0x13')]]['agentconnectAt']);agents[_0x566cb0['destuniqueid']][_0xa9ae('0x21')]=_0x566cb0[_0xa9ae('0x21')];agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x34');writeDB(agents[_0x566cb0[_0xa9ae('0x13')]]);}}catch(_0x2961e4){utils[_0xa9ae('0x1b')](util['format']('[%s][agents][agentcomplete]',_0x566cb0[_0xa9ae('0x4')]),_0x2961e4);}};exports[_0xa9ae('0x35')]=function(_0x4efe55){try{if(!_[_0xa9ae('0x1d')](agents[_0x4efe55[_0xa9ae('0x36')]])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x37'),_0x4efe55[_0xa9ae('0x4')]),_0x4efe55);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x4efe55[_0xa9ae('0x4')],agents[_0x4efe55[_0xa9ae('0x36')]]['membername'],agents[_0x4efe55[_0xa9ae('0x36')]]['uniqueid']));agents[_0x4efe55['transfereruniqueid']]['transfer']=!![];agents[_0x4efe55[_0xa9ae('0x36')]][_0xa9ae('0x38')]='blind';agents[_0x4efe55['transfereruniqueid']]['transferexten']=_0x4efe55[_0xa9ae('0x39')];agents[_0x4efe55['transfereruniqueid']][_0xa9ae('0x3a')]=agents[_0x4efe55[_0xa9ae('0x36')]]['uniqueid'];}}catch(_0x1be415){utils['error'](util[_0xa9ae('0x15')](_0xa9ae('0x37'),_0x4efe55[_0xa9ae('0x4')]),_0x1be415);}};exports[_0xa9ae('0x3b')]=function(_0x371760){try{utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x3c'),_0x371760[_0xa9ae('0x3d')]),_0x371760);if(_0x371760[_0xa9ae('0x3d')]==_0x371760[_0xa9ae('0x3e')]){if(!_[_0xa9ae('0x1d')](agents[_0x371760['secondtransfereruniqueid']])){utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x3f'),_0x371760[_0xa9ae('0x3d')],agents[_0x371760[_0xa9ae('0x40')]]['membername']));agents[_0x371760['secondtransfereruniqueid']][_0xa9ae('0x41')]=!![];agents[_0x371760[_0xa9ae('0x40')]]['transfertype']='ATTENDED';agents[_0x371760[_0xa9ae('0x40')]]['transferexten']=_0x371760[_0xa9ae('0x42')];agents[_0x371760[_0xa9ae('0x40')]][_0xa9ae('0x3a')]=_0x371760['origtransfereruniqueid'];}if(_0x371760[_0xa9ae('0x43')]&&agents[_0x371760['transfereeuniqueid']]){agents[_0x371760[_0xa9ae('0x43')]]['agententerreason']=0x1;transfers[_0x371760[_0xa9ae('0x43')]]=_[_0xa9ae('0x44')](agents[_0x371760[_0xa9ae('0x43')]]);transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x8')]=agents[_0x371760[_0xa9ae('0x40')]]['calleridnum'];transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x45')]=agents[_0x371760[_0xa9ae('0x40')]][_0xa9ae('0x45')];transfers[_0x371760['transfereeuniqueid']][_0xa9ae('0x17')]=utils[_0xa9ae('0x18')]();transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x22')]=0x0;transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x46')]=0x2;}}else if(_0x371760[_0xa9ae('0x40')]==_0x371760['secondtransfererlinkedid']){if(!_[_0xa9ae('0x1d')](agents[_0x371760[_0xa9ae('0x3d')]])){utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x371760[_0xa9ae('0x3d')],agents[_0x371760[_0xa9ae('0x3d')]]['membername']));agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x41')]=!![];agents[_0x371760[_0xa9ae('0x3d')]]['transfertype']='ATTENDED';agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x47')]=_0x371760['secondtransfererexten'];agents[_0x371760['origtransfereruniqueid']][_0xa9ae('0x3a')]=_0x371760[_0xa9ae('0x40')];}if(_0x371760[_0xa9ae('0x48')]&&agents[_0x371760['transfertargetuniqueid']]){agents[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x46')]=0x1;transfers[_0x371760[_0xa9ae('0x48')]]=_[_0xa9ae('0x44')](agents[_0x371760[_0xa9ae('0x48')]]);transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x8')]=agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x8')];transfers[_0x371760[_0xa9ae('0x48')]]['calleridname']=agents[_0x371760['origtransfereruniqueid']][_0xa9ae('0x45')];transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x17')]=utils['now']();transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();transfers[_0x371760['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x371760[_0xa9ae('0x48')]]['agententerreason']=0x2;}}}catch(_0x14a720){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x3c'),_0x371760[_0xa9ae('0x3d')]),_0x14a720);}};exports[_0xa9ae('0x49')]=function(_0x1bf8e3){try{utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x4a'),_0x1bf8e3['uniqueid']),_0x1bf8e3);if(agents[_0x1bf8e3[_0xa9ae('0x4')]]&&agents[_0x1bf8e3['uniqueid']][_0xa9ae('0x21')]===_0xa9ae('0x20')){if(_0x1bf8e3[_0xa9ae('0x4b')]==='21'){agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')]='rejected';agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]=_0xa9ae('0x4c');}utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf8e3[_0xa9ae('0x4')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x7')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')],agents[_0x1bf8e3['uniqueid']]['lastevent']));writeDB(agents[_0x1bf8e3[_0xa9ae('0x4')]]);var _0x2f4a73=unanswered[_0xa9ae('0x4d')](_0x1bf8e3[_0xa9ae('0x4')]);if(_0x2f4a73>-0x1){unanswered[_0xa9ae('0x4e')](_0x2f4a73,0x1);}}if(transfers[_0x1bf8e3['uniqueid']]){transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0xf')]=!![];transfers[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt']=utils['now']();transfers[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x29')]=utils[_0xa9ae('0x33')](transfers[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt'],transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0x2b')]);transfers[_0x1bf8e3['uniqueid']]['reason']='agent';transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0xa')]=_0xa9ae('0x34');utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf8e3[_0xa9ae('0x4')],transfers[_0x1bf8e3[_0xa9ae('0x4')]]['membername'],transfers[_0x1bf8e3[_0xa9ae('0x4')]]['reason'],transfers[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]));writeDB(transfers[_0x1bf8e3[_0xa9ae('0x4')]],!![]);}if(agents[_0x1bf8e3[_0xa9ae('0x4')]]&&agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x2b')]){agents[_0x1bf8e3['uniqueid']][_0xa9ae('0xf')]=!![];agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x32')]=utils[_0xa9ae('0x18')]();agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x29')]=utils[_0xa9ae('0x33')](agents[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt'],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x2b')]);agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')]=agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x41')]?_0xa9ae('0x41'):_0xa9ae('0x4f');agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]=_0xa9ae('0x34');utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x50'),_0x1bf8e3[_0xa9ae('0x4')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x7')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')],agents[_0x1bf8e3['uniqueid']][_0xa9ae('0xa')]));writeDB(agents[_0x1bf8e3[_0xa9ae('0x4')]]);}}catch(_0x1f6465){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x4a'),_0x1bf8e3[_0xa9ae('0x4')]),_0x1f6465);}};
\ No newline at end of file
+var _0xee5b=['type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','now','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','agentcomplete','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','agentconnectAt','complete','[%s][agents][agentcomplete]','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','diffTime','agent','[%s][agents][hangup]','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','membername','interface','calleridnum','connectedlinenum'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0xee5b,0x1f4));var _0xbee5=function(_0x318444,_0xfbb1f3){_0x318444=_0x318444-0x0;var _0x50746c=_0xee5b[_0x318444];return _0x50746c;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var utils=require(_0xbee5('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x203bba,_0x4f850a){utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x4'),_0x203bba[_0xbee5('0x5')],_0x203bba['channel'],_0x203bba['queue'],_0x203bba[_0xbee5('0x6')],_0x203bba[_0xbee5('0x7')],_0x203bba[_0xbee5('0x8')],_0x203bba[_0xbee5('0x9')],_0x203bba['lastevent']));if(_0x203bba['queue']){utils['getVoiceQueueByName'](_0x203bba['queue'])['then'](function(_0x20c66c){if(_0x20c66c){_0x203bba[_0xbee5('0xa')]=_0x20c66c[_0xbee5('0xa')];_0x203bba[_0xbee5('0xb')]=_0x203bba['agentcomplete']?_0x20c66c[_0xbee5('0xc')]:![];_0x203bba[_0xbee5('0xd')]=_0x203bba[_0xbee5('0xb')]?_0x20c66c[_0xbee5('0xe')]:0x0;}utils[_0xbee5('0xf')](_0xbee5('0x10'),_0x203bba);});}else{utils[_0xbee5('0xf')](_0xbee5('0x10'),_0x203bba);}if(_0x4f850a){delete transfers[_0x203bba[_0xbee5('0x5')]];}else{delete agents[_0x203bba['destuniqueid']];}}exports[_0xbee5('0x11')]=function(_0x532a78){try{utils[_0xbee5('0x12')](util[_0xbee5('0x3')](_0xbee5('0x13'),_0x532a78['uniqueid']),_0x532a78);agents[_0x532a78['destuniqueid']]=_0x532a78;agents[_0x532a78[_0xbee5('0x14')]]['agentcalledAt']=utils[_0xbee5('0x15')]();agents[_0x532a78['destuniqueid']][_0xbee5('0x16')]=_0xbee5('0x17');agents[_0x532a78[_0xbee5('0x14')]]['connectedlinenum']=null;agents[_0x532a78[_0xbee5('0x14')]][_0xbee5('0x18')]=null;utils['info'](util[_0xbee5('0x3')](_0xbee5('0x19'),_0x532a78[_0xbee5('0x5')],agents[_0x532a78[_0xbee5('0x14')]][_0xbee5('0x6')],_0x532a78[_0xbee5('0x14')]));}catch(_0x982404){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x13'),_0x532a78[_0xbee5('0x5')]),_0x982404);}};exports[_0xbee5('0x1b')]=function(_0x35d7d3){try{if(!_[_0xbee5('0x1c')](agents[_0x35d7d3[_0xbee5('0x14')]])){utils['debug'](util['format'](_0xbee5('0x1d'),_0x35d7d3['uniqueid']),_0x35d7d3);utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x1e'),_0x35d7d3[_0xbee5('0x5')],agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x6')],_0x35d7d3[_0xbee5('0x14')]));agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x1b')]=!![];agents[_0x35d7d3['destuniqueid']]['agentringnoanswerAt']=utils['now']();agents[_0x35d7d3['destuniqueid']]['lastevent']=_0xbee5('0x1f');agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x20')]=_0xbee5('0x1f');agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x21')]=_0x35d7d3[_0xbee5('0x22')]?parseInt(_0x35d7d3['ringtime'])/0x3e8:0x0;agents[_0x35d7d3[_0xbee5('0x14')]][_0xbee5('0x23')]=0x0;unanswered[_0xbee5('0x24')](_0x35d7d3[_0xbee5('0x14')]);}}catch(_0x1a8bcc){utils['error'](util[_0xbee5('0x3')](_0xbee5('0x1d'),_0x35d7d3[_0xbee5('0x5')]),_0x1a8bcc);}};exports[_0xbee5('0x25')]=function(_0xa57f85){try{_[_0xbee5('0x26')](agents,function(_0x34b7df,_0x36e8bb){if(_0x34b7df[_0xbee5('0x5')]==_0xa57f85['uniqueid']&&!_[_0xbee5('0x27')](unanswered,_0x34b7df['destuniqueid'])){utils[_0xbee5('0x12')](util['format'](_0xbee5('0x28'),_0xa57f85['uniqueid']),_0xa57f85);utils[_0xbee5('0x2')](util['format'](_0xbee5('0x29'),_0xa57f85[_0xbee5('0x5')],_0x34b7df[_0xbee5('0x6')],_0x34b7df[_0xbee5('0x14')]));_0x34b7df['agentringnoanswer']=!![];_0x34b7df[_0xbee5('0x2a')]=utils[_0xbee5('0x15')]();_0x34b7df[_0xbee5('0x16')]=_0xbee5('0x2b');_0x34b7df['reason']=_0xbee5('0x2b');_0x34b7df[_0xbee5('0x21')]=_0xa57f85[_0xbee5('0x21')];_0x34b7df[_0xbee5('0x23')]=0x0;writeDB(_0x34b7df);}});}catch(_0x4c3428){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x28'),_0xa57f85[_0xbee5('0x5')]),_0x4c3428);}};exports['agentconnect']=function(_0x3c8a87){try{if(agents[_0x3c8a87['destuniqueid']]){utils[_0xbee5('0x12')](util['format']('[%s][agents][agentconnect]',_0x3c8a87['uniqueid']),_0x3c8a87);utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x2c'),_0x3c8a87[_0xbee5('0x5')],agents[_0x3c8a87[_0xbee5('0x14')]][_0xbee5('0x6')],_0x3c8a87[_0xbee5('0x14')]));agents[_0x3c8a87[_0xbee5('0x14')]]['agentconnectAt']=utils[_0xbee5('0x15')]();agents[_0x3c8a87['destuniqueid']][_0xbee5('0x9')]=_0x3c8a87[_0xbee5('0x9')];agents[_0x3c8a87[_0xbee5('0x14')]][_0xbee5('0x18')]=_0x3c8a87['connectedlinename'];agents[_0x3c8a87[_0xbee5('0x14')]]['holdtime']=_0x3c8a87['ringtime'];agents[_0x3c8a87[_0xbee5('0x14')]][_0xbee5('0x16')]=_0xbee5('0x2d');_[_0xbee5('0x26')](agents,function(_0x5a2b14,_0xf3dd5){if(_0x5a2b14[_0xbee5('0x14')]!=_0x3c8a87[_0xbee5('0x14')]&&_0x5a2b14[_0xbee5('0x5')]==_0x3c8a87[_0xbee5('0x5')]){_0x5a2b14[_0xbee5('0x23')]=0x0;_0x5a2b14[_0xbee5('0x21')]=_0x3c8a87[_0xbee5('0x22')];_0x5a2b14[_0xbee5('0x1b')]=!![];_0x5a2b14[_0xbee5('0x2a')]=utils['now']();_0x5a2b14[_0xbee5('0x16')]=_0xbee5('0x2e');_0x5a2b14['reason']=_0xbee5('0x2e');_0x5a2b14[_0xbee5('0x2f')]=_0x3c8a87[_0xbee5('0x14')];_0x5a2b14[_0xbee5('0x30')]=_0x3c8a87['membername'];writeDB(_0x5a2b14);}});}}catch(_0x4cfe54){utils['error'](util[_0xbee5('0x3')](_0xbee5('0x31'),_0x3c8a87[_0xbee5('0x5')]),_0x4cfe54);}};exports[_0xbee5('0x32')]=function(_0x4012fd){try{if(!_[_0xbee5('0x1c')](agents[_0x4012fd[_0xbee5('0x14')]])){utils[_0xbee5('0x12')](util[_0xbee5('0x3')]('[%s][agents][agentcomplete]',_0x4012fd['uniqueid']),_0x4012fd);utils[_0xbee5('0x2')](util['format'](_0xbee5('0x33'),_0x4012fd[_0xbee5('0x5')],agents[_0x4012fd['destuniqueid']][_0xbee5('0x6')],_0x4012fd[_0xbee5('0x14')]));agents[_0x4012fd['destuniqueid']]['agentcomplete']=!![];agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x34')]=utils['now']();agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x23')]=utils['diffTime'](agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x34')],agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x35')]);agents[_0x4012fd[_0xbee5('0x14')]][_0xbee5('0x20')]=_0x4012fd[_0xbee5('0x20')];agents[_0x4012fd['destuniqueid']][_0xbee5('0x16')]=_0xbee5('0x36');writeDB(agents[_0x4012fd[_0xbee5('0x14')]]);}}catch(_0x1d7388){utils['error'](util[_0xbee5('0x3')](_0xbee5('0x37'),_0x4012fd[_0xbee5('0x5')]),_0x1d7388);}};exports['blindtransfer']=function(_0x44d4b1){try{if(!_[_0xbee5('0x1c')](agents[_0x44d4b1['transfereruniqueid']])){utils['debug'](util['format'](_0xbee5('0x38'),_0x44d4b1['uniqueid']),_0x44d4b1);utils[_0xbee5('0x2')](util[_0xbee5('0x3')](_0xbee5('0x39'),_0x44d4b1[_0xbee5('0x5')],agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x6')],agents[_0x44d4b1['transfereruniqueid']][_0xbee5('0x5')]));agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x3b')]=!![];agents[_0x44d4b1[_0xbee5('0x3a')]]['transfertype']=_0xbee5('0x3c');agents[_0x44d4b1['transfereruniqueid']][_0xbee5('0x3d')]=_0x44d4b1[_0xbee5('0x3e')];agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x3f')]=agents[_0x44d4b1[_0xbee5('0x3a')]][_0xbee5('0x5')];}}catch(_0xe8902){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x38'),_0x44d4b1[_0xbee5('0x5')]),_0xe8902);}};exports[_0xbee5('0x40')]=function(_0xeebac7){try{utils[_0xbee5('0x12')](util[_0xbee5('0x3')]('[%s][agents][attendedtransfer]',_0xeebac7[_0xbee5('0x41')]),_0xeebac7);if(_0xeebac7[_0xbee5('0x41')]==_0xeebac7[_0xbee5('0x42')]){if(!_['isNil'](agents[_0xeebac7[_0xbee5('0x43')]])){utils[_0xbee5('0x2')](util[_0xbee5('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0xeebac7[_0xbee5('0x41')],agents[_0xeebac7['secondtransfereruniqueid']][_0xbee5('0x6')]));agents[_0xeebac7['secondtransfereruniqueid']][_0xbee5('0x3b')]=!![];agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x44')]='ATTENDED';agents[_0xeebac7['secondtransfereruniqueid']]['transferexten']=_0xeebac7[_0xbee5('0x45')];agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x3f')]=_0xeebac7['origtransfereruniqueid'];}if(_0xeebac7[_0xbee5('0x46')]&&agents[_0xeebac7['transfereeuniqueid']]){agents[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x47')]=0x1;transfers[_0xeebac7[_0xbee5('0x46')]]=_['clone'](agents[_0xeebac7[_0xbee5('0x46')]]);transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x8')]=agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x8')];transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x48')]=agents[_0xeebac7[_0xbee5('0x43')]][_0xbee5('0x48')];transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x49')]=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x35')]=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x46')]][_0xbee5('0x21')]=0x0;transfers[_0xeebac7['transfereeuniqueid']][_0xbee5('0x47')]=0x2;}}else if(_0xeebac7['secondtransfereruniqueid']==_0xeebac7['secondtransfererlinkedid']){if(!_[_0xbee5('0x1c')](agents[_0xeebac7[_0xbee5('0x41')]])){utils['info'](util['format'](_0xbee5('0x4a'),_0xeebac7['origtransfereruniqueid'],agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x6')]));agents[_0xeebac7['origtransfereruniqueid']][_0xbee5('0x3b')]=!![];agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x44')]=_0xbee5('0x4b');agents[_0xeebac7['origtransfereruniqueid']][_0xbee5('0x3d')]=_0xeebac7['secondtransfererexten'];agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x3f')]=_0xeebac7['secondtransfereruniqueid'];}if(_0xeebac7[_0xbee5('0x4c')]&&agents[_0xeebac7[_0xbee5('0x4c')]]){agents[_0xeebac7['transfertargetuniqueid']][_0xbee5('0x47')]=0x1;transfers[_0xeebac7[_0xbee5('0x4c')]]=_['clone'](agents[_0xeebac7[_0xbee5('0x4c')]]);transfers[_0xeebac7['transfertargetuniqueid']][_0xbee5('0x8')]=agents[_0xeebac7['origtransfereruniqueid']][_0xbee5('0x8')];transfers[_0xeebac7['transfertargetuniqueid']]['calleridname']=agents[_0xeebac7[_0xbee5('0x41')]][_0xbee5('0x48')];transfers[_0xeebac7[_0xbee5('0x4c')]][_0xbee5('0x49')]=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x4c')]]['agentconnectAt']=utils[_0xbee5('0x15')]();transfers[_0xeebac7[_0xbee5('0x4c')]][_0xbee5('0x21')]=0x0;transfers[_0xeebac7[_0xbee5('0x4c')]][_0xbee5('0x47')]=0x2;}}}catch(_0xf77d34){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x4d'),_0xeebac7['origtransfereruniqueid']),_0xf77d34);}};exports[_0xbee5('0x4e')]=function(_0xe9796a){try{utils[_0xbee5('0x12')](util[_0xbee5('0x3')]('[%s][agents][hangup]',_0xe9796a[_0xbee5('0x5')]),_0xe9796a);if(agents[_0xe9796a[_0xbee5('0x5')]]&&agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x20')]===_0xbee5('0x1f')){if(_0xe9796a[_0xbee5('0x4f')]==='21'){agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x20')]=_0xbee5('0x50');agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x16')]=_0xbee5('0x50');}utils['info'](util[_0xbee5('0x3')](_0xbee5('0x51'),_0xe9796a['uniqueid'],agents[_0xe9796a[_0xbee5('0x5')]]['membername'],agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x20')],agents[_0xe9796a['uniqueid']][_0xbee5('0x16')]));writeDB(agents[_0xe9796a['uniqueid']]);var _0x4b7ebc=unanswered['indexOf'](_0xe9796a['uniqueid']);if(_0x4b7ebc>-0x1){unanswered['splice'](_0x4b7ebc,0x1);}}if(transfers[_0xe9796a['uniqueid']]){transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x32')]=!![];transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x34')]=utils[_0xbee5('0x15')]();transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x23')]=utils[_0xbee5('0x52')](transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x34')],transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x35')]);transfers[_0xe9796a['uniqueid']][_0xbee5('0x20')]=_0xbee5('0x53');transfers[_0xe9796a['uniqueid']]['lastevent']=_0xbee5('0x36');utils[_0xbee5('0x2')](util[_0xbee5('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xe9796a[_0xbee5('0x5')],transfers[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x6')],transfers[_0xe9796a['uniqueid']]['reason'],transfers[_0xe9796a['uniqueid']][_0xbee5('0x16')]));writeDB(transfers[_0xe9796a[_0xbee5('0x5')]],!![]);}if(agents[_0xe9796a[_0xbee5('0x5')]]&&agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x35')]){agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x32')]=!![];agents[_0xe9796a[_0xbee5('0x5')]]['agentcompleteAt']=utils['now']();agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x23')]=utils['diffTime'](agents[_0xe9796a['uniqueid']][_0xbee5('0x34')],agents[_0xe9796a['uniqueid']]['agentconnectAt']);agents[_0xe9796a[_0xbee5('0x5')]]['reason']=agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x3b')]?'transfer':_0xbee5('0x53');agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x16')]=_0xbee5('0x36');utils[_0xbee5('0x2')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xe9796a[_0xbee5('0x5')],agents[_0xe9796a['uniqueid']][_0xbee5('0x6')],agents[_0xe9796a['uniqueid']][_0xbee5('0x20')],agents[_0xe9796a[_0xbee5('0x5')]][_0xbee5('0x16')]));writeDB(agents[_0xe9796a[_0xbee5('0x5')]]);}}catch(_0x182207){utils[_0xbee5('0x1a')](util[_0xbee5('0x3')](_0xbee5('0x54'),_0xe9796a[_0xbee5('0x5')]),_0x182207);}};
\ No newline at end of file
index 09e15ed..bde0a67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcac2=['localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lastdata','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','exten','calleridnum','context','DOCUMENTATION','error','newstate','isNil','channelstate','systemanswertime','now','answertime','disposition','toNumber','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','attendedtransfer'];(function(_0x43a2db,_0x399ee0){var _0x5ae09c=function(_0x3a0119){while(--_0x3a0119){_0x43a2db['push'](_0x43a2db['shift']());}};_0x5ae09c(++_0x399ee0);}(_0xcac2,0xa7));var _0x2cac=function(_0x4f08b7,_0x5af590){_0x4f08b7=_0x4f08b7-0x0;var _0x34c4eb=_0xcac2[_0x4f08b7];return _0x34c4eb;};'use strict';var _=require(_0x2cac('0x0'));var util=require(_0x2cac('0x1'));var utils=require(_0x2cac('0x2'));var transfers=require(_0x2cac('0x3'));var dispositions=['NO\x20ANSWER','FAILED',_0x2cac('0x4'),_0x2cac('0x5'),_0x2cac('0x5'),_0x2cac('0x5'),_0x2cac('0x6'),_0x2cac('0x7'),_0x2cac('0x4'),'FAILED',_0x2cac('0x4')];var channels={};function writeDB(_0xc3cee){var _0x51b070;if(transfers[_0x2cac('0x8')][_0xc3cee[_0x2cac('0x9')]]){_0x51b070=_0xc3cee['uniqueid'];_0xc3cee['uniqueid']=transfers['blinds'][_0xc3cee[_0x2cac('0x9')]][_0x2cac('0xa')];}utils['info'](util[_0x2cac('0xb')](_0x2cac('0xc'),_0xc3cee[_0x2cac('0x9')],_0xc3cee[_0x2cac('0xd')],_0xc3cee[_0x2cac('0xe')],_0xc3cee[_0x2cac('0xf')],_0xc3cee['interface'],_0xc3cee['calleridnum'],_0xc3cee[_0x2cac('0x10')],_0xc3cee[_0x2cac('0x11')]));if(_0xc3cee['accountcode']){utils[_0x2cac('0x12')](_0xc3cee[_0x2cac('0x13')])[_0x2cac('0x14')](function(_0x1aacbf){if(_0x1aacbf){_0xc3cee[_0x2cac('0x15')]=_0x1aacbf['id'];}utils[_0x2cac('0x16')](_0x2cac('0x17'),_0xc3cee);});}else{utils[_0x2cac('0x16')]('CreateVoiceCallReport',_0xc3cee);}if(channels[_0xc3cee[_0x2cac('0x9')]]){delete channels[_0xc3cee['uniqueid']];}else if(_0x51b070&&channels[_0x51b070]){delete transfers[_0x2cac('0x8')][_0x51b070];delete channels[_0x51b070];}}exports[_0x2cac('0x18')]=function(_0x5243b6){try{utils[_0x2cac('0x19')](util[_0x2cac('0xb')](_0x2cac('0x1a'),_0x5243b6[_0x2cac('0x9')]),_0x5243b6);if(_0x5243b6[_0x2cac('0x9')]==_0x5243b6[_0x2cac('0x1b')]&&_0x5243b6['channel']!=_0x2cac('0x1c')){utils[_0x2cac('0x1d')](util[_0x2cac('0xb')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x5243b6[_0x2cac('0x9')],_0x5243b6['context'],_0x5243b6[_0x2cac('0x1e')]));channels[_0x5243b6[_0x2cac('0x9')]]={'uniqueid':_0x5243b6[_0x2cac('0x9')],'accountcode':_0x5243b6[_0x2cac('0x13')],'source':_0x5243b6[_0x2cac('0x1f')],'destination':_0x5243b6[_0x2cac('0x1e')],'destinationcontext':_0x5243b6[_0x2cac('0x20')],'channel':_0x5243b6[_0x2cac('0xd')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2cac('0x5'),'amaflags':_0x2cac('0x21')};}}catch(_0x1de51a){utils[_0x2cac('0x22')](util[_0x2cac('0xb')]('[%s][calls][newchannel]',_0x5243b6['uniqueid']),_0x1de51a);}};exports[_0x2cac('0x23')]=function(_0xa0b697){try{utils[_0x2cac('0x19')](util[_0x2cac('0xb')]('[%s][calls][newstate]',_0xa0b697[_0x2cac('0x9')]),_0xa0b697);if(!_[_0x2cac('0x24')](channels[_0xa0b697['uniqueid']])&&_0xa0b697[_0x2cac('0x25')]==0x6){utils[_0x2cac('0x1d')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0xa0b697['uniqueid'],_0xa0b697['context'],_0xa0b697[_0x2cac('0xd')]));if(_[_0x2cac('0x24')](channels[_0xa0b697[_0x2cac('0x9')]][_0x2cac('0x26')])){channels[_0xa0b697[_0x2cac('0x9')]][_0x2cac('0x26')]=utils[_0x2cac('0x27')]();}}else if(!_[_0x2cac('0x24')](channels[_0xa0b697[_0x2cac('0x1b')]])&&_0xa0b697[_0x2cac('0x25')]==0x6&&_0xa0b697[_0x2cac('0x20')]!='transfer'){utils[_0x2cac('0x1d')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0xa0b697[_0x2cac('0x9')],_0xa0b697['linkedid'],_0xa0b697[_0x2cac('0x20')],_0xa0b697[_0x2cac('0xd')]));channels[_0xa0b697['linkedid']][_0x2cac('0x13')]=_0xa0b697['accountcode'];channels[_0xa0b697[_0x2cac('0x1b')]]['destinationchannel']=_0xa0b697['channel'];if(_[_0x2cac('0x24')](channels[_0xa0b697['linkedid']][_0x2cac('0x28')])){channels[_0xa0b697['linkedid']][_0x2cac('0x28')]=utils[_0x2cac('0x27')]();}channels[_0xa0b697[_0x2cac('0x1b')]][_0x2cac('0x29')]=dispositions[_[_0x2cac('0x2a')](_0xa0b697[_0x2cac('0x25')])]||_0x2cac('0x6');}}catch(_0x423b67){utils[_0x2cac('0x22')](util[_0x2cac('0xb')](_0x2cac('0x2b'),_0xa0b697['uniqueid']),_0x423b67);}};exports[_0x2cac('0x2c')]=function(_0x36b36e){try{if(!_[_0x2cac('0x24')](channels[_0x36b36e[_0x2cac('0x9')]])){utils[_0x2cac('0x19')](util[_0x2cac('0xb')](_0x2cac('0x2d'),_0x36b36e[_0x2cac('0x9')]),_0x36b36e);if(_['isNil'](channels[_0x36b36e['uniqueid']][_0x2cac('0x2e')])){channels[_0x36b36e[_0x2cac('0x9')]][_0x2cac('0x2e')]=_0x36b36e[_0x2cac('0x2f')]+'\x20<'+_0x36b36e[_0x2cac('0x1f')]+'>';}utils[_0x2cac('0x1d')](util[_0x2cac('0xb')](_0x2cac('0x30'),_0x36b36e[_0x2cac('0x9')],channels[_0x36b36e[_0x2cac('0x9')]][_0x2cac('0x2e')],_0x36b36e[_0x2cac('0x31')]));channels[_0x36b36e[_0x2cac('0x9')]]['endtime']=utils[_0x2cac('0x27')]();channels[_0x36b36e['uniqueid']][_0x2cac('0x32')]=utils[_0x2cac('0x33')](channels[_0x36b36e[_0x2cac('0x9')]][_0x2cac('0x34')],channels[_0x36b36e[_0x2cac('0x9')]][_0x2cac('0x35')]);channels[_0x36b36e[_0x2cac('0x9')]]['billableseconds']=channels[_0x36b36e['uniqueid']][_0x2cac('0x28')]?utils[_0x2cac('0x33')](channels[_0x36b36e['uniqueid']][_0x2cac('0x34')],channels[_0x36b36e[_0x2cac('0x9')]]['answertime']):0x0;writeDB(channels[_0x36b36e[_0x2cac('0x9')]]);}}catch(_0x29cc5d){utils[_0x2cac('0x22')](util[_0x2cac('0xb')]('[%s][calls][hangup]',_0x36b36e[_0x2cac('0x9')]),_0x29cc5d);}};exports[_0x2cac('0x36')]=function(_0x3c018b){try{if(!_['isNil'](channels[_0x3c018b[_0x2cac('0x37')]])){utils[_0x2cac('0x19')](util['format']('[%s][calls][attendedtransfer]',_0x3c018b['origtransfereruniqueid']),_0x3c018b);if(channels[_0x3c018b[_0x2cac('0x37')]][_0x2cac('0xd')]==_0x3c018b['transfereechannel']){utils[_0x2cac('0x1d')](util[_0x2cac('0xb')](_0x2cac('0x38'),_0x3c018b[_0x2cac('0x39')],_0x3c018b[_0x2cac('0x37')],_0x3c018b[_0x2cac('0x3a')]));channels[_0x3c018b[_0x2cac('0x37')]][_0x2cac('0x3b')]=_0x3c018b[_0x2cac('0x3a')];channels[_0x3c018b[_0x2cac('0x37')]][_0x2cac('0x3c')]=_0x2cac('0x3d');}else if(channels[_0x3c018b[_0x2cac('0x37')]]['channel']=_0x3c018b[_0x2cac('0x3e')]){utils[_0x2cac('0x1d')](util[_0x2cac('0xb')](_0x2cac('0x38'),_0x3c018b[_0x2cac('0x39')],_0x3c018b[_0x2cac('0x37')],_0x3c018b[_0x2cac('0x3f')]));channels[_0x3c018b[_0x2cac('0x37')]][_0x2cac('0x3b')]=_0x3c018b[_0x2cac('0x3f')];channels[_0x3c018b['localtwolinkedid']][_0x2cac('0x3c')]=_0x2cac('0x3d');}}}catch(_0x2f23a4){utils[_0x2cac('0x22')](util[_0x2cac('0xb')]('[%s][calls][attendedtransfer]',_0x3c018b['origtransfereruniqueid']),_0x2f23a4);}};exports[_0x2cac('0x40')]=function(_0x44ccd9){try{if(!_['isNil'](channels[_0x44ccd9['uniqueid']])){utils[_0x2cac('0x19')](util[_0x2cac('0xb')]('[%s][calls][musiconholdstart]',_0x44ccd9[_0x2cac('0x9')]),_0x44ccd9);channels[_0x44ccd9[_0x2cac('0x9')]][_0x2cac('0x41')]=utils[_0x2cac('0x27')]();utils[_0x2cac('0x1d')](util['format'](_0x2cac('0x42'),_0x44ccd9['uniqueid'],channels[_0x44ccd9[_0x2cac('0x9')]][_0x2cac('0x41')]));}}catch(_0x4d852c){utils[_0x2cac('0x22')](util[_0x2cac('0xb')](_0x2cac('0x43'),_0x44ccd9['uniqueid']),_0x4d852c);}};exports[_0x2cac('0x44')]=function(_0x4e3f32){try{if(!_['isNil'](channels[_0x4e3f32[_0x2cac('0x9')]])){utils[_0x2cac('0x19')](util['format'](_0x2cac('0x45'),_0x4e3f32['uniqueid']),_0x4e3f32);if(!_[_0x2cac('0x24')](channels[_0x4e3f32[_0x2cac('0x9')]]['musiconholdstartAt'])){channels[_0x4e3f32[_0x2cac('0x9')]][_0x2cac('0x46')]+=utils['diffTime'](utils[_0x2cac('0x27')](),channels[_0x4e3f32[_0x2cac('0x9')]][_0x2cac('0x41')]);utils[_0x2cac('0x1d')](util[_0x2cac('0xb')](_0x2cac('0x47'),_0x4e3f32[_0x2cac('0x9')],channels[_0x4e3f32[_0x2cac('0x9')]]['mohtime']));delete channels[_0x4e3f32[_0x2cac('0x9')]][_0x2cac('0x41')];}}}catch(_0x3833e3){utils[_0x2cac('0x22')](util['format'](_0x2cac('0x45'),_0x4e3f32[_0x2cac('0x9')]),_0x3833e3);}};exports['varset']=function(_0x6a5fe1){try{if(!_[_0x2cac('0x24')](channels[_0x6a5fe1['uniqueid']])){utils[_0x2cac('0x19')](util['format'](_0x2cac('0x48'),_0x6a5fe1[_0x2cac('0x9')]),_0x6a5fe1);if(!_[_0x2cac('0x24')](_0x6a5fe1[_0x2cac('0x49')][_0x2cac('0x4a')])){utils[_0x2cac('0x1d')](util[_0x2cac('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x6a5fe1[_0x2cac('0x9')],_0x6a5fe1[_0x2cac('0x4b')]));channels[_0x6a5fe1[_0x2cac('0x9')]][_0x2cac('0x4c')]=_0x6a5fe1[_0x2cac('0x4b')];}if(!_[_0x2cac('0x24')](_0x6a5fe1[_0x2cac('0x49')][_0x2cac('0x4d')])){utils[_0x2cac('0x1d')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x6a5fe1[_0x2cac('0x9')],_0x6a5fe1[_0x2cac('0x4b')]));channels[_0x6a5fe1[_0x2cac('0x9')]][_0x2cac('0x4e')]=_0x6a5fe1[_0x2cac('0x4b')];channels[_0x6a5fe1[_0x2cac('0x9')]][_0x2cac('0x2e')]='\x22'+_0x6a5fe1['value']+_0x2cac('0x4f')+_0x6a5fe1[_0x2cac('0x4b')]+'>';}if(!_['isNil'](_0x6a5fe1['variable'][_0x2cac('0x50')])||!_[_0x2cac('0x24')](_0x6a5fe1[_0x2cac('0x49')][_0x2cac('0x51')])){utils['info'](util[_0x2cac('0xb')](_0x2cac('0x52'),_0x6a5fe1[_0x2cac('0x9')],!_[_0x2cac('0x24')](_0x6a5fe1['variable']['xmd-callerid-preview'])?_0x2cac('0x50'):_0x2cac('0x51'),_0x6a5fe1['value']));channels[_0x6a5fe1[_0x2cac('0x9')]][_0x2cac('0x2e')]=_0x6a5fe1[_0x2cac('0x4b')];}if(!_[_0x2cac('0x24')](_0x6a5fe1[_0x2cac('0x49')][_0x2cac('0x53')])||!_['isNil'](_0x6a5fe1[_0x2cac('0x49')][_0x2cac('0x54')])){utils[_0x2cac('0x1d')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x6a5fe1[_0x2cac('0x9')],!_['isNil'](_0x6a5fe1[_0x2cac('0x49')]['xmd-queue'])?_0x2cac('0x53'):'xmcs-queue',_0x6a5fe1['value']));channels[_0x6a5fe1[_0x2cac('0x9')]][_0x2cac('0x55')]='Queue';channels[_0x6a5fe1[_0x2cac('0x9')]]['lastdata']=_0x6a5fe1[_0x2cac('0x4b')];channels[_0x6a5fe1['uniqueid']][_0x2cac('0xe')]=!![];}if(!_[_0x2cac('0x24')](_0x6a5fe1[_0x2cac('0x49')]['xmd-contactid'])){utils[_0x2cac('0x1d')](util['format'](_0x2cac('0x56'),_0x6a5fe1[_0x2cac('0x9')],_0x6a5fe1[_0x2cac('0x4b')]));channels[_0x6a5fe1['uniqueid']][_0x2cac('0x57')]=_0x6a5fe1[_0x2cac('0x4b')];}if(!_['isNil'](_0x6a5fe1['variable'][_0x2cac('0x58')])){utils[_0x2cac('0x1d')](util[_0x2cac('0xb')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x6a5fe1[_0x2cac('0x9')],_0x6a5fe1[_0x2cac('0x4b')]));channels[_0x6a5fe1[_0x2cac('0x9')]]['type']=_0x6a5fe1[_0x2cac('0x4b')];}if(!_['isNil'](_0x6a5fe1['variable'][_0x2cac('0x59')])){utils[_0x2cac('0x1d')](util[_0x2cac('0xb')](_0x2cac('0x5a'),_0x6a5fe1[_0x2cac('0x9')],_0x6a5fe1[_0x2cac('0x4b')]));channels[_0x6a5fe1[_0x2cac('0x9')]][_0x2cac('0x5b')]=_0x6a5fe1['value'];}if(!_['isNil'](_0x6a5fe1['variable'][_0x2cac('0x5c')])){utils[_0x2cac('0x1d')](util['format'](_0x2cac('0x5d'),_0x6a5fe1[_0x2cac('0x9')],_0x6a5fe1[_0x2cac('0x4b')]));channels[_0x6a5fe1['uniqueid']]['sipcallid']=_0x6a5fe1[_0x2cac('0x4b')];}}}catch(_0x1942dc){utils[_0x2cac('0x22')](util['format']('[%s][calls][varset]',_0x6a5fe1['uniqueid']),_0x1942dc);}};exports[_0x2cac('0x5e')]=function(_0x569121){try{if(!_[_0x2cac('0x24')](channels[_0x569121[_0x2cac('0x9')]])){utils[_0x2cac('0x19')](util[_0x2cac('0xb')](_0x2cac('0x5f'),_0x569121['uniqueid']),_0x569121);utils[_0x2cac('0x1d')](util[_0x2cac('0xb')](_0x2cac('0x60'),_0x569121[_0x2cac('0x9')],_0x569121['application'],_0x569121['appdata']));if(_0x569121[_0x2cac('0x61')][_0x2cac('0x62')]()=='set'&&_[_0x2cac('0x63')](_0x569121[_0x2cac('0x64')]['toLowerCase'](),_0x2cac('0x65'))){var _0x176fe3=_0x569121[_0x2cac('0x64')][_0x2cac('0x66')]('=');var _0x343c23=_0x176fe3[0x0][_0x2cac('0x67')](_0x176fe3[0x0][_0x2cac('0x68')]('(')+0x1,_0x176fe3[0x0][_0x2cac('0x68')](')'));var _0x26e2b5=_0x176fe3[0x1];channels[_0x569121['uniqueid']][_0x343c23]=_0x26e2b5;}if(!_[_0x2cac('0x69')]([_0x2cac('0x2c'),_0x2cac('0x6a'),_0x2cac('0x6b'),_0x2cac('0x6c'),_0x2cac('0x6d')],_0x569121['application'][_0x2cac('0x62')]())){channels[_0x569121[_0x2cac('0x9')]]['lastapplication']=_0x569121['application'];channels[_0x569121[_0x2cac('0x9')]][_0x2cac('0x6e')]=_0x569121[_0x2cac('0x64')];}}}catch(_0x13f41f){utils[_0x2cac('0x22')](util[_0x2cac('0xb')](_0x2cac('0x5f'),_0x569121[_0x2cac('0x9')]),_0x13f41f);}};
\ No newline at end of file
+var _0xb965=['\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','noop','execif','gotoif','lodash','util','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','lastevent','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','accountcode','exten','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','channelstate','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','error','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination'];(function(_0x3aa34d,_0x1ec5ef){var _0x246ceb=function(_0x809894){while(--_0x809894){_0x3aa34d['push'](_0x3aa34d['shift']());}};_0x246ceb(++_0x1ec5ef);}(_0xb965,0xfd));var _0x5b96=function(_0x58fad2,_0xb39887){_0x58fad2=_0x58fad2-0x0;var _0x49f947=_0xb965[_0x58fad2];return _0x49f947;};'use strict';var _=require(_0x5b96('0x0'));var util=require(_0x5b96('0x1'));var utils=require('./utils');var transfers=require(_0x5b96('0x2'));var dispositions=['NO\x20ANSWER','FAILED',_0x5b96('0x3'),_0x5b96('0x4'),_0x5b96('0x4'),_0x5b96('0x4'),_0x5b96('0x5'),'BUSY','FAILED',_0x5b96('0x3'),_0x5b96('0x3')];var channels={};function writeDB(_0x38be03){var _0x1cf126;if(transfers['blinds'][_0x38be03[_0x5b96('0x6')]]){_0x1cf126=_0x38be03[_0x5b96('0x6')];_0x38be03[_0x5b96('0x6')]=transfers[_0x5b96('0x7')][_0x38be03[_0x5b96('0x6')]][_0x5b96('0x8')];}utils[_0x5b96('0x9')](util[_0x5b96('0xa')](_0x5b96('0xb'),_0x38be03[_0x5b96('0x6')],_0x38be03[_0x5b96('0xc')],_0x38be03[_0x5b96('0xd')],_0x38be03[_0x5b96('0xe')],_0x38be03[_0x5b96('0xf')],_0x38be03[_0x5b96('0x10')],_0x38be03['connectedlinenum'],_0x38be03[_0x5b96('0x11')]));if(_0x38be03['accountcode']){utils[_0x5b96('0x12')](_0x38be03['accountcode'])[_0x5b96('0x13')](function(_0x1d943c){if(_0x1d943c){_0x38be03[_0x5b96('0x14')]=_0x1d943c['id'];}utils[_0x5b96('0x15')]('CreateVoiceCallReport',_0x38be03);});}else{utils[_0x5b96('0x15')](_0x5b96('0x16'),_0x38be03);}if(channels[_0x38be03[_0x5b96('0x6')]]){delete channels[_0x38be03[_0x5b96('0x6')]];}else if(_0x1cf126&&channels[_0x1cf126]){delete transfers[_0x5b96('0x7')][_0x1cf126];delete channels[_0x1cf126];}}exports[_0x5b96('0x17')]=function(_0x34041b){try{utils[_0x5b96('0x18')](util[_0x5b96('0xa')](_0x5b96('0x19'),_0x34041b['uniqueid']),_0x34041b);if(_0x34041b[_0x5b96('0x6')]==_0x34041b[_0x5b96('0x1a')]&&_0x34041b[_0x5b96('0xc')]!=_0x5b96('0x1b')){utils[_0x5b96('0x9')](util[_0x5b96('0xa')](_0x5b96('0x1c'),_0x34041b['uniqueid'],_0x34041b[_0x5b96('0x1d')],_0x34041b['exten']));channels[_0x34041b[_0x5b96('0x6')]]={'uniqueid':_0x34041b[_0x5b96('0x6')],'accountcode':_0x34041b[_0x5b96('0x1e')],'source':_0x34041b[_0x5b96('0x10')],'destination':_0x34041b[_0x5b96('0x1f')],'destinationcontext':_0x34041b[_0x5b96('0x1d')],'channel':_0x34041b['channel'],'starttime':utils[_0x5b96('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5b96('0x4'),'amaflags':_0x5b96('0x21')};}}catch(_0x3e11b8){utils['error'](util['format'](_0x5b96('0x19'),_0x34041b[_0x5b96('0x6')]),_0x3e11b8);}};exports[_0x5b96('0x22')]=function(_0x4b39da){try{utils['debug'](util[_0x5b96('0xa')](_0x5b96('0x23'),_0x4b39da['uniqueid']),_0x4b39da);if(!_[_0x5b96('0x24')](channels[_0x4b39da[_0x5b96('0x6')]])&&_0x4b39da['channelstate']==0x6){utils[_0x5b96('0x9')](util[_0x5b96('0xa')](_0x5b96('0x25'),_0x4b39da['uniqueid'],_0x4b39da[_0x5b96('0x1d')],_0x4b39da[_0x5b96('0xc')]));if(_[_0x5b96('0x24')](channels[_0x4b39da[_0x5b96('0x6')]][_0x5b96('0x26')])){channels[_0x4b39da[_0x5b96('0x6')]]['systemanswertime']=utils['now']();}}else if(!_[_0x5b96('0x24')](channels[_0x4b39da[_0x5b96('0x1a')]])&&_0x4b39da['channelstate']==0x6&&_0x4b39da[_0x5b96('0x1d')]!='transfer'){utils[_0x5b96('0x9')](util[_0x5b96('0xa')](_0x5b96('0x27'),_0x4b39da[_0x5b96('0x6')],_0x4b39da[_0x5b96('0x1a')],_0x4b39da[_0x5b96('0x1d')],_0x4b39da['channel']));channels[_0x4b39da[_0x5b96('0x1a')]][_0x5b96('0x1e')]=_0x4b39da[_0x5b96('0x1e')];channels[_0x4b39da['linkedid']][_0x5b96('0x28')]=_0x4b39da['channel'];if(_['isNil'](channels[_0x4b39da[_0x5b96('0x1a')]][_0x5b96('0x29')])){channels[_0x4b39da['linkedid']][_0x5b96('0x29')]=utils[_0x5b96('0x20')]();}channels[_0x4b39da['linkedid']][_0x5b96('0x2a')]=dispositions[_['toNumber'](_0x4b39da[_0x5b96('0x2b')])]||'ANSWERED';}}catch(_0x228165){utils['error'](util[_0x5b96('0xa')]('[%s][calls][newstate]',_0x4b39da[_0x5b96('0x6')]),_0x228165);}};exports[_0x5b96('0x2c')]=function(_0x5acfd9){try{if(!_[_0x5b96('0x24')](channels[_0x5acfd9['uniqueid']])){utils[_0x5b96('0x18')](util[_0x5b96('0xa')]('[%s][calls][hangup]',_0x5acfd9[_0x5b96('0x6')]),_0x5acfd9);if(_['isNil'](channels[_0x5acfd9[_0x5b96('0x6')]][_0x5b96('0x2d')])){channels[_0x5acfd9['uniqueid']][_0x5b96('0x2d')]=_0x5acfd9['calleridname']+'\x20<'+_0x5acfd9[_0x5b96('0x10')]+'>';}utils['info'](util['format'](_0x5b96('0x2e'),_0x5acfd9[_0x5b96('0x6')],channels[_0x5acfd9[_0x5b96('0x6')]][_0x5b96('0x2d')],_0x5acfd9[_0x5b96('0x2f')]));channels[_0x5acfd9[_0x5b96('0x6')]][_0x5b96('0x30')]=utils['now']();channels[_0x5acfd9[_0x5b96('0x6')]][_0x5b96('0x31')]=utils[_0x5b96('0x32')](channels[_0x5acfd9[_0x5b96('0x6')]]['endtime'],channels[_0x5acfd9['uniqueid']][_0x5b96('0x33')]);channels[_0x5acfd9[_0x5b96('0x6')]][_0x5b96('0x34')]=channels[_0x5acfd9[_0x5b96('0x6')]][_0x5b96('0x29')]?utils[_0x5b96('0x32')](channels[_0x5acfd9[_0x5b96('0x6')]]['endtime'],channels[_0x5acfd9[_0x5b96('0x6')]]['answertime']):0x0;writeDB(channels[_0x5acfd9['uniqueid']]);}}catch(_0x1865c7){utils[_0x5b96('0x35')](util['format'](_0x5b96('0x36'),_0x5acfd9[_0x5b96('0x6')]),_0x1865c7);}};exports[_0x5b96('0x37')]=function(_0xd54bab){try{if(!_[_0x5b96('0x24')](channels[_0xd54bab['localtwolinkedid']])){utils[_0x5b96('0x18')](util[_0x5b96('0xa')](_0x5b96('0x38'),_0xd54bab[_0x5b96('0x39')]),_0xd54bab);if(channels[_0xd54bab[_0x5b96('0x3a')]]['channel']==_0xd54bab['transfereechannel']){utils[_0x5b96('0x9')](util[_0x5b96('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0xd54bab[_0x5b96('0x39')],_0xd54bab['localtwolinkedid'],_0xd54bab[_0x5b96('0x3b')]));channels[_0xd54bab[_0x5b96('0x3a')]]['destinationchannel']=_0xd54bab['secondtransfererchannel'];channels[_0xd54bab[_0x5b96('0x3a')]][_0x5b96('0x3c')]='_attended';}else if(channels[_0xd54bab[_0x5b96('0x3a')]][_0x5b96('0xc')]=_0xd54bab[_0x5b96('0x3d')]){utils[_0x5b96('0x9')](util[_0x5b96('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0xd54bab[_0x5b96('0x39')],_0xd54bab['localtwolinkedid'],_0xd54bab[_0x5b96('0x3e')]));channels[_0xd54bab[_0x5b96('0x3a')]]['destinationchannel']=_0xd54bab[_0x5b96('0x3e')];channels[_0xd54bab[_0x5b96('0x3a')]][_0x5b96('0x3c')]=_0x5b96('0x3f');}}}catch(_0x10d857){utils['error'](util['format'](_0x5b96('0x38'),_0xd54bab[_0x5b96('0x39')]),_0x10d857);}};exports[_0x5b96('0x40')]=function(_0x5b83dc){try{if(!_['isNil'](channels[_0x5b83dc[_0x5b96('0x6')]])){utils[_0x5b96('0x18')](util[_0x5b96('0xa')](_0x5b96('0x41'),_0x5b83dc[_0x5b96('0x6')]),_0x5b83dc);channels[_0x5b83dc[_0x5b96('0x6')]][_0x5b96('0x42')]=utils[_0x5b96('0x20')]();utils[_0x5b96('0x9')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x5b83dc['uniqueid'],channels[_0x5b83dc['uniqueid']]['musiconholdstartAt']));}}catch(_0x317511){utils['error'](util[_0x5b96('0xa')](_0x5b96('0x41'),_0x5b83dc['uniqueid']),_0x317511);}};exports[_0x5b96('0x43')]=function(_0x426f0f){try{if(!_[_0x5b96('0x24')](channels[_0x426f0f[_0x5b96('0x6')]])){utils['debug'](util[_0x5b96('0xa')](_0x5b96('0x44'),_0x426f0f[_0x5b96('0x6')]),_0x426f0f);if(!_['isNil'](channels[_0x426f0f[_0x5b96('0x6')]][_0x5b96('0x42')])){channels[_0x426f0f[_0x5b96('0x6')]][_0x5b96('0x45')]+=utils[_0x5b96('0x32')](utils[_0x5b96('0x20')](),channels[_0x426f0f['uniqueid']]['musiconholdstartAt']);utils[_0x5b96('0x9')](util[_0x5b96('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x426f0f[_0x5b96('0x6')],channels[_0x426f0f[_0x5b96('0x6')]][_0x5b96('0x45')]));delete channels[_0x426f0f[_0x5b96('0x6')]][_0x5b96('0x42')];}}}catch(_0x856da7){utils[_0x5b96('0x35')](util['format'](_0x5b96('0x44'),_0x426f0f[_0x5b96('0x6')]),_0x856da7);}};exports[_0x5b96('0x46')]=function(_0x210138){try{if(!_[_0x5b96('0x24')](channels[_0x210138[_0x5b96('0x6')]])){utils['debug'](util[_0x5b96('0xa')](_0x5b96('0x47'),_0x210138[_0x5b96('0x6')]),_0x210138);if(!_[_0x5b96('0x24')](_0x210138[_0x5b96('0x48')][_0x5b96('0x49')])){utils['info'](util[_0x5b96('0xa')](_0x5b96('0x4a'),_0x210138['uniqueid'],_0x210138[_0x5b96('0x4b')]));channels[_0x210138['uniqueid']][_0x5b96('0x4c')]=_0x210138['value'];}if(!_[_0x5b96('0x24')](_0x210138[_0x5b96('0x48')][_0x5b96('0x4d')])){utils[_0x5b96('0x9')](util[_0x5b96('0xa')](_0x5b96('0x4e'),_0x210138[_0x5b96('0x6')],_0x210138[_0x5b96('0x4b')]));channels[_0x210138[_0x5b96('0x6')]][_0x5b96('0x4f')]=_0x210138[_0x5b96('0x4b')];channels[_0x210138[_0x5b96('0x6')]][_0x5b96('0x2d')]='\x22'+_0x210138['value']+_0x5b96('0x50')+_0x210138[_0x5b96('0x4b')]+'>';}if(!_[_0x5b96('0x24')](_0x210138['variable'][_0x5b96('0x51')])||!_[_0x5b96('0x24')](_0x210138['variable']['xmd-callerid'])){utils[_0x5b96('0x9')](util[_0x5b96('0xa')](_0x5b96('0x52'),_0x210138[_0x5b96('0x6')],!_[_0x5b96('0x24')](_0x210138[_0x5b96('0x48')][_0x5b96('0x51')])?_0x5b96('0x51'):'xmd-callerid',_0x210138[_0x5b96('0x4b')]));channels[_0x210138[_0x5b96('0x6')]]['callerid']=_0x210138['value'];}if(!_[_0x5b96('0x24')](_0x210138[_0x5b96('0x48')]['xmd-queue'])||!_[_0x5b96('0x24')](_0x210138[_0x5b96('0x48')][_0x5b96('0x53')])){utils[_0x5b96('0x9')](util[_0x5b96('0xa')](_0x5b96('0x52'),_0x210138['uniqueid'],!_[_0x5b96('0x24')](_0x210138[_0x5b96('0x48')][_0x5b96('0x54')])?'xmd-queue':_0x5b96('0x53'),_0x210138['value']));channels[_0x210138[_0x5b96('0x6')]][_0x5b96('0x55')]=_0x5b96('0x56');channels[_0x210138[_0x5b96('0x6')]][_0x5b96('0x57')]=_0x210138[_0x5b96('0x4b')];channels[_0x210138['uniqueid']]['queue']=!![];}if(!_[_0x5b96('0x24')](_0x210138[_0x5b96('0x48')]['xmd-contactid'])){utils[_0x5b96('0x9')](util[_0x5b96('0xa')](_0x5b96('0x58'),_0x210138[_0x5b96('0x6')],_0x210138[_0x5b96('0x4b')]));channels[_0x210138['uniqueid']]['ContactId']=_0x210138[_0x5b96('0x4b')];}if(!_[_0x5b96('0x24')](_0x210138[_0x5b96('0x48')][_0x5b96('0x59')])){utils[_0x5b96('0x9')](util[_0x5b96('0xa')](_0x5b96('0x5a'),_0x210138['uniqueid'],_0x210138[_0x5b96('0x4b')]));channels[_0x210138[_0x5b96('0x6')]]['type']=_0x210138[_0x5b96('0x4b')];}if(!_[_0x5b96('0x24')](_0x210138[_0x5b96('0x48')][_0x5b96('0x5b')])){utils[_0x5b96('0x9')](util['format'](_0x5b96('0x5c'),_0x210138[_0x5b96('0x6')],_0x210138['value']));channels[_0x210138[_0x5b96('0x6')]][_0x5b96('0x5d')]=_0x210138[_0x5b96('0x4b')];}if(!_[_0x5b96('0x24')](_0x210138['variable'][_0x5b96('0x5e')])){utils['info'](util[_0x5b96('0xa')](_0x5b96('0x5f'),_0x210138[_0x5b96('0x6')],_0x210138[_0x5b96('0x4b')]));channels[_0x210138[_0x5b96('0x6')]][_0x5b96('0x5e')]=_0x210138[_0x5b96('0x4b')];}}}catch(_0x5f4d10){utils['error'](util[_0x5b96('0xa')](_0x5b96('0x47'),_0x210138[_0x5b96('0x6')]),_0x5f4d10);}};exports[_0x5b96('0x60')]=function(_0x52d92a){try{if(!_[_0x5b96('0x24')](channels[_0x52d92a['uniqueid']])){utils[_0x5b96('0x18')](util[_0x5b96('0xa')](_0x5b96('0x61'),_0x52d92a['uniqueid']),_0x52d92a);utils[_0x5b96('0x9')](util[_0x5b96('0xa')](_0x5b96('0x62'),_0x52d92a[_0x5b96('0x6')],_0x52d92a[_0x5b96('0x63')],_0x52d92a[_0x5b96('0x64')]));if(_0x52d92a[_0x5b96('0x63')][_0x5b96('0x65')]()==_0x5b96('0x66')&&_[_0x5b96('0x67')](_0x52d92a['appdata'][_0x5b96('0x65')](),_0x5b96('0x68'))){var _0x21401a=_0x52d92a['appdata'][_0x5b96('0x69')]('=');var _0xba63ce=_0x21401a[0x0][_0x5b96('0x6a')](_0x21401a[0x0][_0x5b96('0x6b')]('(')+0x1,_0x21401a[0x0][_0x5b96('0x6b')](')'));var _0x1165e3=_0x21401a[0x1];channels[_0x52d92a[_0x5b96('0x6')]][_0xba63ce]=_0x1165e3;}if(!_['includes']([_0x5b96('0x2c'),_0x5b96('0x6c'),_0x5b96('0x6d'),'set',_0x5b96('0x6e')],_0x52d92a[_0x5b96('0x63')][_0x5b96('0x65')]())){channels[_0x52d92a[_0x5b96('0x6')]][_0x5b96('0x55')]=_0x52d92a[_0x5b96('0x63')];channels[_0x52d92a[_0x5b96('0x6')]][_0x5b96('0x57')]=_0x52d92a[_0x5b96('0x64')];}}}catch(_0x5d6db5){utils[_0x5b96('0x35')](util[_0x5b96('0xa')](_0x5b96('0x61'),_0x52d92a[_0x5b96('0x6')]),_0x5d6db5);}};
\ No newline at end of file
index 510cb90..6545de6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x993f=['error','[core]\x20error','[core]\x20close','managerevent','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted'];(function(_0x578c7a,_0x378072){var _0x3cb20c=function(_0xeec602){while(--_0xeec602){_0x578c7a['push'](_0x578c7a['shift']());}};_0x3cb20c(++_0x378072);}(_0x993f,0x138));var _0xf993=function(_0xc3e016,_0x4a59c6){_0xc3e016=_0xc3e016-0x0;var _0x1a7b6c=_0x993f[_0xc3e016];return _0x1a7b6c;};'use strict';var utils=require('./utils');exports[_0xf993('0x0')]=function(){utils[_0xf993('0x1')](_0xf993('0x2'));};exports[_0xf993('0x3')]=function(){utils[_0xf993('0x1')](_0xf993('0x4'));};exports[_0xf993('0x5')]=function(){utils['info'](_0xf993('0x6'));};exports[_0xf993('0x7')]=function(_0x113fd0){utils['error'](_0xf993('0x8'),_0x113fd0);};exports['close']=function(){utils[_0xf993('0x1')](_0xf993('0x9'));};exports[_0xf993('0xa')]=function(_0x10d78e){};
\ No newline at end of file
+var _0x08e5=['[core]\x20close','info','[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x4a7810,_0x38bf26){var _0x17e510=function(_0xbadd2a){while(--_0xbadd2a){_0x4a7810['push'](_0x4a7810['shift']());}};_0x17e510(++_0x38bf26);}(_0x08e5,0x88));var _0x508e=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x08e5[_0x1694f5];return _0x5b4321;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x508e('0x0')](_0x508e('0x1'));};exports[_0x508e('0x2')]=function(){utils[_0x508e('0x0')](_0x508e('0x3'));};exports['fullybooted']=function(){utils[_0x508e('0x0')](_0x508e('0x4'));};exports[_0x508e('0x5')]=function(_0xb47be1){utils[_0x508e('0x5')](_0x508e('0x6'),_0xb47be1);};exports[_0x508e('0x7')]=function(){utils[_0x508e('0x0')](_0x508e('0x8'));};exports['managerevent']=function(_0x47229f){};
\ No newline at end of file
index fa60dc9..43f6a88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x229c=['calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','appdata','application','toLowerCase','startsWith','cdr(routeid)','split','error','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','assign','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','cause-txt','complete','duration','diffTime','endtime','holdtime','lodash','util','./utils','info','format','uniqueid','channel'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0x229c,0xb1));var _0xc229=function(_0x3e3738,_0x919c54){_0x3e3738=_0x3e3738-0x0;var _0x162b0b=_0x229c[_0x3e3738];return _0x162b0b;};'use strict';var _=require(_0xc229('0x0'));var util=require(_0xc229('0x1'));var utils=require(_0xc229('0x2'));var dials={};function writeDB(_0x56b772){utils[_0xc229('0x3')](util[_0xc229('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x56b772[_0xc229('0x5')],_0x56b772[_0xc229('0x6')],_0x56b772['dialstring'],_0x56b772[_0xc229('0x7')],_0x56b772[_0xc229('0x8')],_0x56b772[_0xc229('0x9')]));utils[_0xc229('0xa')](_0xc229('0xb'),_0x56b772);delete dials[_0x56b772[_0xc229('0x5')]];}exports['newexten']=function(_0x5ec29b){try{utils[_0xc229('0xc')](util[_0xc229('0x4')](_0xc229('0xd'),_0x5ec29b[_0xc229('0x5')]),_0x5ec29b);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x5ec29b[_0xc229('0x5')],_0x5ec29b['application'],_0x5ec29b[_0xc229('0xe')]));if(_0x5ec29b[_0xc229('0xf')][_0xc229('0x10')]()=='set'&&_[_0xc229('0x11')](_0x5ec29b[_0xc229('0xe')][_0xc229('0x10')](),_0xc229('0x12'))){var _0x2aab41=_0x5ec29b[_0xc229('0xe')][_0xc229('0x13')]('=');dials[_0x5ec29b[_0xc229('0x5')]]={'routeId':_0x2aab41[0x1]};}}catch(_0xc8eb95){utils[_0xc229('0x14')](util[_0xc229('0x4')](_0xc229('0xd'),_0x5ec29b[_0xc229('0x5')]),_0xc8eb95);}};exports['varset']=function(_0x27a138){try{utils[_0xc229('0xc')](util[_0xc229('0x4')](_0xc229('0x15'),_0x27a138[_0xc229('0x5')]),_0x27a138);if(!_[_0xc229('0x16')](_0x27a138[_0xc229('0x17')][_0xc229('0x18')])){utils['info'](util[_0xc229('0x4')](_0xc229('0x19'),_0x27a138[_0xc229('0x5')],_0x27a138[_0xc229('0x1a')]));dials[_0x27a138[_0xc229('0x5')]]={'routeId':_0x27a138[_0xc229('0x1a')]};}}catch(_0x1dfb5e){utils['error'](util[_0xc229('0x4')](_0xc229('0x15'),_0x27a138['uniqueid']),_0x1dfb5e);}};exports[_0xc229('0x1b')]=function(_0x3b5514){try{if(!_[_0xc229('0x16')](dials[_0x3b5514[_0xc229('0x5')]])){utils[_0xc229('0xc')](util[_0xc229('0x4')](_0xc229('0x1c'),_0x3b5514['uniqueid']),_0x3b5514);dials[_0x3b5514[_0xc229('0x5')]]=_['assign'](dials[_0x3b5514['uniqueid']],_0x3b5514);dials[_0x3b5514['uniqueid']][_0xc229('0x1d')]=utils[_0xc229('0x1e')]();dials[_0x3b5514['uniqueid']][_0xc229('0x1f')]='called';utils[_0xc229('0x3')](util[_0xc229('0x4')](_0xc229('0x20'),_0x3b5514['uniqueid'],dials[_0x3b5514[_0xc229('0x5')]]['starttime']));}}catch(_0xe869e0){utils[_0xc229('0x14')](util['format'](_0xc229('0x1c'),_0x3b5514[_0xc229('0x5')]),_0xe869e0);}};exports[_0xc229('0x21')]=function(_0x3fdc52){try{if(!_[_0xc229('0x16')](dials[_0x3fdc52['uniqueid']])){utils['debug'](util[_0xc229('0x4')](_0xc229('0x22'),_0x3fdc52['uniqueid']),_0x3fdc52);dials[_0x3fdc52['uniqueid']][_0xc229('0x9')]=_0x3fdc52[_0xc229('0x9')];if(_0x3fdc52['dialstatus']=='ANSWER'){dials[_0x3fdc52[_0xc229('0x5')]]=_[_0xc229('0x23')](dials[_0x3fdc52[_0xc229('0x5')]],_0x3fdc52);dials[_0x3fdc52[_0xc229('0x5')]][_0xc229('0x24')]=utils[_0xc229('0x1e')]();dials[_0x3fdc52[_0xc229('0x5')]][_0xc229('0x1f')]='connect';utils['info'](util[_0xc229('0x4')](_0xc229('0x25'),_0x3fdc52[_0xc229('0x5')],_0x3fdc52[_0xc229('0x9')],dials[_0x3fdc52[_0xc229('0x5')]]['answertime']));}else{utils[_0xc229('0x3')](util['format']('[%s][dials][dialend]\x20dialstatus:%s',_0x3fdc52['uniqueid'],_0x3fdc52['dialstatus']));}}}catch(_0x226aa5){utils[_0xc229('0x14')](util['format'](_0xc229('0x22'),_0x3fdc52[_0xc229('0x5')]),_0x226aa5);}};exports[_0xc229('0x26')]=function(_0x1e0b81){try{if(!_[_0xc229('0x16')](dials[_0x1e0b81[_0xc229('0x5')]])){utils['debug'](util['format'](_0xc229('0x27'),_0x1e0b81['uniqueid']),_0x1e0b81);utils[_0xc229('0x3')](util[_0xc229('0x4')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x1e0b81[_0xc229('0x5')],_0x1e0b81[_0xc229('0x7')],_0x1e0b81['calleridname'],_0x1e0b81[_0xc229('0x28')]));dials[_0x1e0b81[_0xc229('0x5')]]=_[_0xc229('0x23')](dials[_0x1e0b81[_0xc229('0x5')]],{'endtime':utils[_0xc229('0x1e')](),'lastevent':_0xc229('0x29')});dials[_0x1e0b81['uniqueid']][_0xc229('0x2a')]=utils[_0xc229('0x2b')](dials[_0x1e0b81['uniqueid']][_0xc229('0x2c')],dials[_0x1e0b81[_0xc229('0x5')]][_0xc229('0x1d')]);dials[_0x1e0b81[_0xc229('0x5')]][_0xc229('0x2d')]=utils[_0xc229('0x2b')](dials[_0x1e0b81['uniqueid']][_0xc229('0x24')]||dials[_0x1e0b81[_0xc229('0x5')]][_0xc229('0x2c')],dials[_0x1e0b81['uniqueid']]['starttime']);dials[_0x1e0b81[_0xc229('0x5')]]['billableseconds']=dials[_0x1e0b81[_0xc229('0x5')]][_0xc229('0x24')]?utils['diffTime'](dials[_0x1e0b81[_0xc229('0x5')]]['endtime'],dials[_0x1e0b81[_0xc229('0x5')]][_0xc229('0x24')]):0x0;writeDB(dials[_0x1e0b81['uniqueid']]);}}catch(_0x515b36){utils[_0xc229('0x14')](util[_0xc229('0x4')](_0xc229('0x27'),_0x1e0b81['uniqueid']),_0x515b36);}};
\ No newline at end of file
+var _0x3ca1=['[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','request','newexten','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr(routeid)','error','[%s][dials][newexten]','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','debug','[%s][dials][hangup]','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','info','format'];(function(_0xc94644,_0x19720a){var _0x26e33e=function(_0x36d74f){while(--_0x36d74f){_0xc94644['push'](_0xc94644['shift']());}};_0x26e33e(++_0x19720a);}(_0x3ca1,0x129));var _0x13ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ca1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x13ca('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x300534){utils[_0x13ca('0x1')](util[_0x13ca('0x2')](_0x13ca('0x3'),_0x300534[_0x13ca('0x4')],_0x300534[_0x13ca('0x5')],_0x300534['dialstring'],_0x300534[_0x13ca('0x6')],_0x300534['connectedlinenum'],_0x300534['dialstatus']));utils[_0x13ca('0x7')]('CreateVoiceDialReport',_0x300534);delete dials[_0x300534['uniqueid']];}exports[_0x13ca('0x8')]=function(_0x1b8302){try{utils['debug'](util[_0x13ca('0x2')]('[%s][dials][newexten]',_0x1b8302[_0x13ca('0x4')]),_0x1b8302);utils[_0x13ca('0x1')](util[_0x13ca('0x2')](_0x13ca('0x9'),_0x1b8302[_0x13ca('0x4')],_0x1b8302[_0x13ca('0xa')],_0x1b8302['appdata']));if(_0x1b8302[_0x13ca('0xa')][_0x13ca('0xb')]()=='set'&&_[_0x13ca('0xc')](_0x1b8302[_0x13ca('0xd')][_0x13ca('0xb')](),_0x13ca('0xe'))){var _0xbca721=_0x1b8302[_0x13ca('0xd')]['split']('=');dials[_0x1b8302[_0x13ca('0x4')]]={'routeId':_0xbca721[0x1]};}}catch(_0x191079){utils[_0x13ca('0xf')](util['format'](_0x13ca('0x10'),_0x1b8302[_0x13ca('0x4')]),_0x191079);}};exports[_0x13ca('0x11')]=function(_0x4ae5f1){try{utils['debug'](util['format'](_0x13ca('0x12'),_0x4ae5f1['uniqueid']),_0x4ae5f1);if(!_['isNil'](_0x4ae5f1[_0x13ca('0x13')][_0x13ca('0x14')])){utils[_0x13ca('0x1')](util['format'](_0x13ca('0x15'),_0x4ae5f1[_0x13ca('0x4')],_0x4ae5f1[_0x13ca('0x16')]));dials[_0x4ae5f1['uniqueid']]={'routeId':_0x4ae5f1[_0x13ca('0x16')]};}}catch(_0xcb96ea){utils[_0x13ca('0xf')](util['format'](_0x13ca('0x12'),_0x4ae5f1['uniqueid']),_0xcb96ea);}};exports[_0x13ca('0x17')]=function(_0x1a7f32){try{if(!_[_0x13ca('0x18')](dials[_0x1a7f32['uniqueid']])){utils['debug'](util[_0x13ca('0x2')](_0x13ca('0x19'),_0x1a7f32[_0x13ca('0x4')]),_0x1a7f32);dials[_0x1a7f32[_0x13ca('0x4')]]=_[_0x13ca('0x1a')](dials[_0x1a7f32[_0x13ca('0x4')]],_0x1a7f32);dials[_0x1a7f32[_0x13ca('0x4')]]['starttime']=utils[_0x13ca('0x1b')]();dials[_0x1a7f32['uniqueid']][_0x13ca('0x1c')]=_0x13ca('0x1d');utils['info'](util[_0x13ca('0x2')](_0x13ca('0x1e'),_0x1a7f32[_0x13ca('0x4')],dials[_0x1a7f32[_0x13ca('0x4')]][_0x13ca('0x1f')]));}}catch(_0x51234d){utils['error'](util[_0x13ca('0x2')](_0x13ca('0x19'),_0x1a7f32[_0x13ca('0x4')]),_0x51234d);}};exports[_0x13ca('0x20')]=function(_0x1cb34e){try{if(!_[_0x13ca('0x18')](dials[_0x1cb34e[_0x13ca('0x4')]])){utils['debug'](util[_0x13ca('0x2')](_0x13ca('0x21'),_0x1cb34e[_0x13ca('0x4')]),_0x1cb34e);dials[_0x1cb34e[_0x13ca('0x4')]][_0x13ca('0x22')]=_0x1cb34e['dialstatus'];if(_0x1cb34e[_0x13ca('0x22')]==_0x13ca('0x23')){dials[_0x1cb34e[_0x13ca('0x4')]]=_[_0x13ca('0x1a')](dials[_0x1cb34e[_0x13ca('0x4')]],_0x1cb34e);dials[_0x1cb34e['uniqueid']][_0x13ca('0x24')]=utils['now']();dials[_0x1cb34e[_0x13ca('0x4')]][_0x13ca('0x1c')]='connect';utils['info'](util[_0x13ca('0x2')](_0x13ca('0x25'),_0x1cb34e['uniqueid'],_0x1cb34e[_0x13ca('0x22')],dials[_0x1cb34e[_0x13ca('0x4')]]['answertime']));}else{utils[_0x13ca('0x1')](util[_0x13ca('0x2')](_0x13ca('0x26'),_0x1cb34e[_0x13ca('0x4')],_0x1cb34e['dialstatus']));}}}catch(_0x49b93e){utils['error'](util[_0x13ca('0x2')]('[%s][dials][dialend]',_0x1cb34e[_0x13ca('0x4')]),_0x49b93e);}};exports[_0x13ca('0x27')]=function(_0x3d7422){try{if(!_[_0x13ca('0x18')](dials[_0x3d7422[_0x13ca('0x4')]])){utils[_0x13ca('0x28')](util[_0x13ca('0x2')](_0x13ca('0x29'),_0x3d7422['uniqueid']),_0x3d7422);utils[_0x13ca('0x1')](util[_0x13ca('0x2')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x3d7422[_0x13ca('0x4')],_0x3d7422['calleridnum'],_0x3d7422[_0x13ca('0x2a')],_0x3d7422[_0x13ca('0x2b')]));dials[_0x3d7422[_0x13ca('0x4')]]=_[_0x13ca('0x1a')](dials[_0x3d7422[_0x13ca('0x4')]],{'endtime':utils['now'](),'lastevent':_0x13ca('0x2c')});dials[_0x3d7422[_0x13ca('0x4')]][_0x13ca('0x2d')]=utils[_0x13ca('0x2e')](dials[_0x3d7422['uniqueid']][_0x13ca('0x2f')],dials[_0x3d7422[_0x13ca('0x4')]][_0x13ca('0x1f')]);dials[_0x3d7422['uniqueid']][_0x13ca('0x30')]=utils['diffTime'](dials[_0x3d7422[_0x13ca('0x4')]][_0x13ca('0x24')]||dials[_0x3d7422['uniqueid']]['endtime'],dials[_0x3d7422[_0x13ca('0x4')]]['starttime']);dials[_0x3d7422['uniqueid']][_0x13ca('0x31')]=dials[_0x3d7422['uniqueid']]['answertime']?utils[_0x13ca('0x2e')](dials[_0x3d7422['uniqueid']][_0x13ca('0x2f')],dials[_0x3d7422[_0x13ca('0x4')]]['answertime']):0x0;writeDB(dials[_0x3d7422[_0x13ca('0x4')]]);}}catch(_0x587663){utils['error'](util['format'](_0x13ca('0x29'),_0x3d7422[_0x13ca('0x4')]),_0x587663);}};
\ No newline at end of file
index b1f9f85..b8e00d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8208=['xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','agentcalled','format','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','./utils','util','asterisk','port','password','keepConnected'];(function(_0x343b65,_0x39bb3b){var _0x40e53a=function(_0x136cb7){while(--_0x136cb7){_0x343b65['push'](_0x343b65['shift']());}};_0x40e53a(++_0x39bb3b);}(_0x8208,0xbf));var _0x8820=function(_0x5dc492,_0x405d41){_0x5dc492=_0x5dc492-0x0;var _0x152a6b=_0x8208[_0x5dc492];return _0x152a6b;};var AsteriskManager=require(_0x8820('0x0'));var config=require('../../config/environment');var utils=require(_0x8820('0x1'));var util=require(_0x8820('0x2'));var ami=new AsteriskManager(config[_0x8820('0x3')][_0x8820('0x4')],config['asterisk']['ip'],config[_0x8820('0x3')]['username'],config[_0x8820('0x3')][_0x8820('0x5')],!![]);ami[_0x8820('0x6')]();if(config['xdr']&&config[_0x8820('0x7')][_0x8820('0x8')]){utils[_0x8820('0x9')](_0x8820('0xa'));}else{var agents=require(_0x8820('0xb'));var calls=require(_0x8820('0xc'));var queues=require(_0x8820('0xd'));var recordings=require(_0x8820('0xe'));var members=require(_0x8820('0xf'));var dials=require('./dials.controller');var transfers=require(_0x8820('0x10'));var core=require('./core.controller');ami['on'](_0x8820('0x11'),core['connect']);ami['on']('shutdown',core[_0x8820('0x12')]);ami['on']('fullybooted',core[_0x8820('0x13')]);ami['on'](_0x8820('0x14'),core[_0x8820('0x14')]);ami['on'](_0x8820('0x15'),core[_0x8820('0x15')]);ami['on'](_0x8820('0x16'),core[_0x8820('0x16')]);ami['on'](_0x8820('0x17'),function(_0x501f6a){try{utils[_0x8820('0x18')](util['format'](_0x8820('0x19'),_0x501f6a['device']),_0x501f6a);members[_0x8820('0x17')](_0x501f6a);}catch(_0x3e0c71){utils[_0x8820('0x14')](util['format'](_0x8820('0x19'),_0x501f6a[_0x8820('0x1a')]),_0x3e0c71);}});ami['on'](_0x8820('0x1b'),function(_0x3c9de1){try{utils[_0x8820('0x18')](util[_0x8820('0x1c')](_0x8820('0x1d'),_0x3c9de1[_0x8820('0x1e')]),_0x3c9de1);agents[_0x8820('0x1b')](_0x3c9de1);}catch(_0x34a607){utils[_0x8820('0x14')](util[_0x8820('0x1c')](_0x8820('0x1d'),_0x3c9de1[_0x8820('0x1e')]),_0x34a607);}});ami['on'](_0x8820('0x1f'),function(_0x234187){try{utils[_0x8820('0x18')](util[_0x8820('0x1c')](_0x8820('0x20'),_0x234187[_0x8820('0x1e')]),_0x234187);agents[_0x8820('0x1f')](_0x234187);}catch(_0x4c9c06){utils[_0x8820('0x14')](util['format'](_0x8820('0x20'),_0x234187[_0x8820('0x1e')]),_0x4c9c06);}});ami['on']('agentconnect',function(_0x4c53d0){try{utils[_0x8820('0x18')](util['format']('[%s][index][agentconnect]',_0x4c53d0[_0x8820('0x1e')]),_0x4c53d0);agents[_0x8820('0x21')](_0x4c53d0);queues[_0x8820('0x21')](_0x4c53d0);}catch(_0x1c172c){utils[_0x8820('0x14')](util[_0x8820('0x1c')]('[%s][index][agentconnect]',_0x4c53d0[_0x8820('0x1e')]),_0x1c172c);}});ami['on'](_0x8820('0x22'),function(_0x140c04){try{utils[_0x8820('0x18')](util['format']('[%s][index][agentcomplete]',_0x140c04[_0x8820('0x1e')]),_0x140c04);agents[_0x8820('0x22')](_0x140c04);queues[_0x8820('0x22')](_0x140c04);members[_0x8820('0x22')](_0x140c04);}catch(_0x31ff03){utils[_0x8820('0x14')](util[_0x8820('0x1c')](_0x8820('0x23'),_0x140c04[_0x8820('0x1e')]),_0x31ff03);}});ami['on'](_0x8820('0x24'),function(_0x5e5740){try{utils[_0x8820('0x18')](util['format'](_0x8820('0x25'),_0x5e5740[_0x8820('0x1e')]),_0x5e5740);agents[_0x8820('0x24')](_0x5e5740);queues['queuecallerabandon'](_0x5e5740);}catch(_0x5f61c3){utils[_0x8820('0x14')](util[_0x8820('0x1c')](_0x8820('0x25'),_0x5e5740['uniqueid']),_0x5f61c3);}});ami['on'](_0x8820('0x26'),function(_0x37a121){try{utils[_0x8820('0x18')](util[_0x8820('0x1c')](_0x8820('0x27'),_0x37a121[_0x8820('0x1e')]),_0x37a121);queues[_0x8820('0x26')](_0x37a121);recordings[_0x8820('0x26')](_0x37a121);}catch(_0x1687fd){utils['error'](util[_0x8820('0x1c')](_0x8820('0x27'),_0x37a121[_0x8820('0x1e')]),_0x1687fd);}});ami['on'](_0x8820('0x28'),function(_0x121889){try{utils[_0x8820('0x18')](util[_0x8820('0x1c')](_0x8820('0x29'),_0x121889['uniqueid']),_0x121889);queues['queuecallerleave'](_0x121889);}catch(_0x3df134){utils[_0x8820('0x14')](util[_0x8820('0x1c')](_0x8820('0x29'),_0x121889[_0x8820('0x1e')]),_0x3df134);}});ami['on'](_0x8820('0x2a'),function(_0x5f001a){try{utils['debug'](util['format'](_0x8820('0x2b'),_0x5f001a[_0x8820('0x1e')]),_0x5f001a);queues['musiconholdstart'](_0x5f001a);calls['musiconholdstart'](_0x5f001a);}catch(_0x4c9963){utils[_0x8820('0x14')](util['format'](_0x8820('0x2b'),_0x5f001a['uniqueid']),_0x4c9963);}});ami['on'](_0x8820('0x2c'),function(_0x239f70){try{utils['debug'](util[_0x8820('0x1c')](_0x8820('0x2d'),_0x239f70[_0x8820('0x1e')]),_0x239f70);queues[_0x8820('0x2c')](_0x239f70);calls[_0x8820('0x2c')](_0x239f70);}catch(_0xa391ee){utils[_0x8820('0x14')](util[_0x8820('0x1c')](_0x8820('0x2d'),_0x239f70['uniqueid']),_0xa391ee);}});ami['on'](_0x8820('0x2e'),function(_0x1ad5df){try{utils['debug'](util[_0x8820('0x1c')]('[%s][index][newstate]',_0x1ad5df[_0x8820('0x1e')]),_0x1ad5df);calls['newstate'](_0x1ad5df);recordings['newstate'](_0x1ad5df);}catch(_0x11cec9){utils[_0x8820('0x14')](util[_0x8820('0x1c')]('[%s][index][newstate]',_0x1ad5df[_0x8820('0x1e')]),_0x11cec9);}});ami['on'](_0x8820('0x2f'),function(_0x132b17){try{utils[_0x8820('0x18')](util['format'](_0x8820('0x30'),_0x132b17['uniqueid']),_0x132b17);calls[_0x8820('0x2f')](_0x132b17);recordings[_0x8820('0x2f')](_0x132b17);dials[_0x8820('0x2f')](_0x132b17);agents[_0x8820('0x2f')](_0x132b17);queues[_0x8820('0x2f')](_0x132b17);}catch(_0x30fd2e){utils['error'](util[_0x8820('0x1c')](_0x8820('0x30'),_0x132b17[_0x8820('0x1e')]),_0x30fd2e);}});ami['on'](_0x8820('0x31'),function(_0xec0e3a){try{utils[_0x8820('0x18')](util[_0x8820('0x1c')]('[%s][index][cdr]',_0xec0e3a[_0x8820('0x1e')]),_0xec0e3a);members[_0x8820('0x31')](_0xec0e3a);}catch(_0x33a9a4){utils['error'](util[_0x8820('0x1c')](_0x8820('0x32'),_0xec0e3a[_0x8820('0x1e')]),_0x33a9a4);}});ami['on'](_0x8820('0x33'),function(_0x555e2a){try{utils[_0x8820('0x18')](util[_0x8820('0x1c')]('[%s][index][blindtransfer]',_0x555e2a[_0x8820('0x1e')]),_0x555e2a);queues[_0x8820('0x33')](_0x555e2a);agents[_0x8820('0x33')](_0x555e2a);transfers[_0x8820('0x33')](_0x555e2a);}catch(_0x32745a){utils[_0x8820('0x14')](util[_0x8820('0x1c')](_0x8820('0x34'),_0x555e2a['uniqueid']),_0x32745a);}});ami['on'](_0x8820('0x35'),function(_0x331be8){try{utils[_0x8820('0x18')](util[_0x8820('0x1c')]('[%s][index][attendedtransfer]',_0x331be8[_0x8820('0x36')]),_0x331be8);queues[_0x8820('0x35')](_0x331be8);transfers[_0x8820('0x35')](_0x331be8);agents[_0x8820('0x35')](_0x331be8);calls['attendedtransfer'](_0x331be8);}catch(_0x789d5d){utils['error'](util[_0x8820('0x1c')](_0x8820('0x37'),_0x331be8[_0x8820('0x36')]),_0x789d5d);}});ami['on'](_0x8820('0x38'),function(_0x2d0a8a){try{utils[_0x8820('0x18')](util[_0x8820('0x1c')](_0x8820('0x39'),_0x2d0a8a[_0x8820('0x1e')]),_0x2d0a8a);queues[_0x8820('0x38')](_0x2d0a8a);recordings[_0x8820('0x38')](_0x2d0a8a);calls[_0x8820('0x38')](_0x2d0a8a);dials['varset'](_0x2d0a8a);}catch(_0x433dde){utils[_0x8820('0x14')](util[_0x8820('0x1c')](_0x8820('0x39'),_0x2d0a8a[_0x8820('0x1e')]),_0x433dde);}});ami['on'](_0x8820('0x3a'),function(_0x721434){try{utils['debug'](util[_0x8820('0x1c')]('[%s][index][newexten]',_0x721434[_0x8820('0x1e')]),_0x721434);calls[_0x8820('0x3a')](_0x721434);recordings[_0x8820('0x3a')](_0x721434);dials[_0x8820('0x3a')](_0x721434);}catch(_0x18245b){utils[_0x8820('0x14')](util[_0x8820('0x1c')](_0x8820('0x3b'),_0x721434[_0x8820('0x1e')]),_0x18245b);}});ami['on'](_0x8820('0x3c'),function(_0x5119dd){try{utils[_0x8820('0x18')](util['format'](_0x8820('0x3d'),_0x5119dd[_0x8820('0x1e')]),_0x5119dd);calls['newchannel'](_0x5119dd);recordings[_0x8820('0x3c')](_0x5119dd);}catch(_0x889049){utils[_0x8820('0x14')](util['format'](_0x8820('0x3d'),_0x5119dd[_0x8820('0x1e')]),_0x889049);}});ami['on'](_0x8820('0x3e'),function(_0x547329){try{utils[_0x8820('0x18')](util[_0x8820('0x1c')]('[%s][index][dialbegin]',_0x547329[_0x8820('0x1e')]),_0x547329);dials[_0x8820('0x3e')](_0x547329);}catch(_0x2b032f){utils[_0x8820('0x14')](util[_0x8820('0x1c')](_0x8820('0x3f'),_0x547329['uniqueid']),_0x2b032f);}});ami['on']('dialend',function(_0xc2687e){try{utils[_0x8820('0x18')](util['format'](_0x8820('0x40'),_0xc2687e[_0x8820('0x1e')]),_0xc2687e);dials[_0x8820('0x41')](_0xc2687e);}catch(_0x4e6a2f){utils[_0x8820('0x14')](util[_0x8820('0x1c')](_0x8820('0x40'),_0xc2687e['uniqueid']),_0x4e6a2f);}});}
\ No newline at end of file
+var _0x5b67=['[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','util','asterisk','port','password','xdr','info','./queues.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','debug','format','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer'];(function(_0x1230b9,_0xc27ede){var _0x34ebec=function(_0x32f0fc){while(--_0x32f0fc){_0x1230b9['push'](_0x1230b9['shift']());}};_0x34ebec(++_0xc27ede);}(_0x5b67,0x15a));var _0x75b6=function(_0x217b39,_0x21cbff){_0x217b39=_0x217b39-0x0;var _0x352ff6=_0x5b67[_0x217b39];return _0x352ff6;};var AsteriskManager=require(_0x75b6('0x0'));var config=require(_0x75b6('0x1'));var utils=require(_0x75b6('0x2'));var util=require(_0x75b6('0x3'));var ami=new AsteriskManager(config[_0x75b6('0x4')][_0x75b6('0x5')],config[_0x75b6('0x4')]['ip'],config[_0x75b6('0x4')]['username'],config[_0x75b6('0x4')][_0x75b6('0x6')],!![]);ami['keepConnected']();if(config[_0x75b6('0x7')]&&config['xdr']['disabled']){utils[_0x75b6('0x8')]('XDR\x20DISABLED');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0x75b6('0x9'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x75b6('0xa'));var transfers=require(_0x75b6('0xb'));var core=require(_0x75b6('0xc'));ami['on'](_0x75b6('0xd'),core[_0x75b6('0xd')]);ami['on']('shutdown',core[_0x75b6('0xe')]);ami['on'](_0x75b6('0xf'),core[_0x75b6('0xf')]);ami['on'](_0x75b6('0x10'),core[_0x75b6('0x10')]);ami['on']('close',core[_0x75b6('0x11')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x75b6('0x12'),function(_0x45e77e){try{utils[_0x75b6('0x13')](util[_0x75b6('0x14')]('[%s][index][devicestatechange]',_0x45e77e[_0x75b6('0x15')]),_0x45e77e);members[_0x75b6('0x12')](_0x45e77e);}catch(_0x503b85){utils['error'](util['format']('[%s][index][devicestatechange]',_0x45e77e[_0x75b6('0x15')]),_0x503b85);}});ami['on'](_0x75b6('0x16'),function(_0x383b89){try{utils['debug'](util[_0x75b6('0x14')](_0x75b6('0x17'),_0x383b89[_0x75b6('0x18')]),_0x383b89);agents['agentcalled'](_0x383b89);}catch(_0x5f03c9){utils[_0x75b6('0x10')](util[_0x75b6('0x14')](_0x75b6('0x17'),_0x383b89['uniqueid']),_0x5f03c9);}});ami['on'](_0x75b6('0x19'),function(_0x1d7c98){try{utils['debug'](util[_0x75b6('0x14')](_0x75b6('0x1a'),_0x1d7c98[_0x75b6('0x18')]),_0x1d7c98);agents['agentringnoanswer'](_0x1d7c98);}catch(_0x43e48d){utils[_0x75b6('0x10')](util['format'](_0x75b6('0x1a'),_0x1d7c98[_0x75b6('0x18')]),_0x43e48d);}});ami['on']('agentconnect',function(_0xdf0775){try{utils['debug'](util[_0x75b6('0x14')](_0x75b6('0x1b'),_0xdf0775[_0x75b6('0x18')]),_0xdf0775);agents[_0x75b6('0x1c')](_0xdf0775);queues['agentconnect'](_0xdf0775);}catch(_0x5e4699){utils['error'](util[_0x75b6('0x14')](_0x75b6('0x1b'),_0xdf0775[_0x75b6('0x18')]),_0x5e4699);}});ami['on'](_0x75b6('0x1d'),function(_0x2371ee){try{utils[_0x75b6('0x13')](util['format']('[%s][index][agentcomplete]',_0x2371ee[_0x75b6('0x18')]),_0x2371ee);agents[_0x75b6('0x1d')](_0x2371ee);queues['agentcomplete'](_0x2371ee);members['agentcomplete'](_0x2371ee);}catch(_0x59de11){utils[_0x75b6('0x10')](util[_0x75b6('0x14')](_0x75b6('0x1e'),_0x2371ee['uniqueid']),_0x59de11);}});ami['on'](_0x75b6('0x1f'),function(_0x268252){try{utils['debug'](util['format'](_0x75b6('0x20'),_0x268252['uniqueid']),_0x268252);agents['queuecallerabandon'](_0x268252);queues[_0x75b6('0x1f')](_0x268252);}catch(_0x16ae16){utils[_0x75b6('0x10')](util[_0x75b6('0x14')](_0x75b6('0x20'),_0x268252[_0x75b6('0x18')]),_0x16ae16);}});ami['on']('queuecallerjoin',function(_0x41941c){try{utils[_0x75b6('0x13')](util[_0x75b6('0x14')](_0x75b6('0x21'),_0x41941c[_0x75b6('0x18')]),_0x41941c);queues[_0x75b6('0x22')](_0x41941c);recordings['queuecallerjoin'](_0x41941c);}catch(_0x512a95){utils[_0x75b6('0x10')](util['format'](_0x75b6('0x21'),_0x41941c[_0x75b6('0x18')]),_0x512a95);}});ami['on'](_0x75b6('0x23'),function(_0x5648cb){try{utils[_0x75b6('0x13')](util[_0x75b6('0x14')](_0x75b6('0x24'),_0x5648cb[_0x75b6('0x18')]),_0x5648cb);queues[_0x75b6('0x23')](_0x5648cb);}catch(_0x85933f){utils[_0x75b6('0x10')](util['format'](_0x75b6('0x24'),_0x5648cb['uniqueid']),_0x85933f);}});ami['on'](_0x75b6('0x25'),function(_0x351637){try{utils[_0x75b6('0x13')](util[_0x75b6('0x14')]('[%s][index][musiconholdstart]',_0x351637[_0x75b6('0x18')]),_0x351637);queues[_0x75b6('0x25')](_0x351637);calls['musiconholdstart'](_0x351637);}catch(_0x4b5058){utils['error'](util[_0x75b6('0x14')](_0x75b6('0x26'),_0x351637[_0x75b6('0x18')]),_0x4b5058);}});ami['on']('musiconholdstop',function(_0x4e716e){try{utils[_0x75b6('0x13')](util[_0x75b6('0x14')](_0x75b6('0x27'),_0x4e716e[_0x75b6('0x18')]),_0x4e716e);queues['musiconholdstop'](_0x4e716e);calls[_0x75b6('0x28')](_0x4e716e);}catch(_0xf9cff6){utils[_0x75b6('0x10')](util[_0x75b6('0x14')]('[%s][index][musiconholdstop]',_0x4e716e[_0x75b6('0x18')]),_0xf9cff6);}});ami['on'](_0x75b6('0x29'),function(_0x2074ab){try{utils['debug'](util[_0x75b6('0x14')](_0x75b6('0x2a'),_0x2074ab[_0x75b6('0x18')]),_0x2074ab);calls[_0x75b6('0x29')](_0x2074ab);recordings[_0x75b6('0x29')](_0x2074ab);}catch(_0xdb749c){utils[_0x75b6('0x10')](util[_0x75b6('0x14')]('[%s][index][newstate]',_0x2074ab[_0x75b6('0x18')]),_0xdb749c);}});ami['on'](_0x75b6('0x2b'),function(_0x105d6d){try{utils['debug'](util[_0x75b6('0x14')](_0x75b6('0x2c'),_0x105d6d[_0x75b6('0x18')]),_0x105d6d);calls[_0x75b6('0x2b')](_0x105d6d);recordings[_0x75b6('0x2b')](_0x105d6d);dials[_0x75b6('0x2b')](_0x105d6d);agents[_0x75b6('0x2b')](_0x105d6d);queues['hangup'](_0x105d6d);}catch(_0x1a619d){utils[_0x75b6('0x10')](util[_0x75b6('0x14')](_0x75b6('0x2c'),_0x105d6d[_0x75b6('0x18')]),_0x1a619d);}});ami['on'](_0x75b6('0x2d'),function(_0x3f04b5){try{utils[_0x75b6('0x13')](util['format'](_0x75b6('0x2e'),_0x3f04b5[_0x75b6('0x18')]),_0x3f04b5);members[_0x75b6('0x2d')](_0x3f04b5);}catch(_0x24e81b){utils[_0x75b6('0x10')](util[_0x75b6('0x14')](_0x75b6('0x2e'),_0x3f04b5[_0x75b6('0x18')]),_0x24e81b);}});ami['on']('blindtransfer',function(_0x5c26e6){try{utils[_0x75b6('0x13')](util[_0x75b6('0x14')](_0x75b6('0x2f'),_0x5c26e6['uniqueid']),_0x5c26e6);queues[_0x75b6('0x30')](_0x5c26e6);agents[_0x75b6('0x30')](_0x5c26e6);transfers[_0x75b6('0x30')](_0x5c26e6);}catch(_0x2eeae0){utils['error'](util['format'](_0x75b6('0x2f'),_0x5c26e6[_0x75b6('0x18')]),_0x2eeae0);}});ami['on'](_0x75b6('0x31'),function(_0xf9c7c5){try{utils[_0x75b6('0x13')](util['format'](_0x75b6('0x32'),_0xf9c7c5[_0x75b6('0x33')]),_0xf9c7c5);queues[_0x75b6('0x31')](_0xf9c7c5);transfers[_0x75b6('0x31')](_0xf9c7c5);agents[_0x75b6('0x31')](_0xf9c7c5);calls[_0x75b6('0x31')](_0xf9c7c5);}catch(_0x2598d4){utils['error'](util[_0x75b6('0x14')](_0x75b6('0x32'),_0xf9c7c5[_0x75b6('0x33')]),_0x2598d4);}});ami['on']('varset',function(_0x2090bc){try{utils['debug'](util['format']('[%s][index][varset]',_0x2090bc['uniqueid']),_0x2090bc);queues[_0x75b6('0x34')](_0x2090bc);recordings[_0x75b6('0x34')](_0x2090bc);calls[_0x75b6('0x34')](_0x2090bc);dials[_0x75b6('0x34')](_0x2090bc);}catch(_0x48ed4f){utils['error'](util[_0x75b6('0x14')](_0x75b6('0x35'),_0x2090bc[_0x75b6('0x18')]),_0x48ed4f);}});ami['on']('newexten',function(_0x54a8c8){try{utils[_0x75b6('0x13')](util[_0x75b6('0x14')]('[%s][index][newexten]',_0x54a8c8[_0x75b6('0x18')]),_0x54a8c8);calls[_0x75b6('0x36')](_0x54a8c8);recordings[_0x75b6('0x36')](_0x54a8c8);dials[_0x75b6('0x36')](_0x54a8c8);}catch(_0x5d346a){utils['error'](util[_0x75b6('0x14')](_0x75b6('0x37'),_0x54a8c8[_0x75b6('0x18')]),_0x5d346a);}});ami['on'](_0x75b6('0x38'),function(_0x5b2e4c){try{utils[_0x75b6('0x13')](util[_0x75b6('0x14')](_0x75b6('0x39'),_0x5b2e4c[_0x75b6('0x18')]),_0x5b2e4c);calls['newchannel'](_0x5b2e4c);recordings['newchannel'](_0x5b2e4c);}catch(_0x2565bb){utils[_0x75b6('0x10')](util[_0x75b6('0x14')](_0x75b6('0x39'),_0x5b2e4c[_0x75b6('0x18')]),_0x2565bb);}});ami['on']('dialbegin',function(_0xc5f3bb){try{utils[_0x75b6('0x13')](util[_0x75b6('0x14')](_0x75b6('0x3a'),_0xc5f3bb[_0x75b6('0x18')]),_0xc5f3bb);dials['dialbegin'](_0xc5f3bb);}catch(_0x245544){utils[_0x75b6('0x10')](util[_0x75b6('0x14')](_0x75b6('0x3b'),_0xc5f3bb[_0x75b6('0x18')]),_0x245544);}});ami['on']('dialend',function(_0x2f0f68){try{utils[_0x75b6('0x13')](util[_0x75b6('0x14')](_0x75b6('0x3c'),_0x2f0f68[_0x75b6('0x18')]),_0x2f0f68);dials[_0x75b6('0x3d')](_0x2f0f68);}catch(_0x152c26){utils[_0x75b6('0x10')](util['format'](_0x75b6('0x3c'),_0x2f0f68[_0x75b6('0x18')]),_0x152c26);}});}
\ No newline at end of file
index 1ff207f..c0ed6bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e63=['[%s][members][writeDB]','some','startsWith','devicestatechange','device','state','TALKING','now','agent','isNil','duration','diffTime','exitAt','enterAt','[%s][members][devicestatechange]','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','util','Queue:','info','uniqueid','interface','channel','membername','type','getUserByInterface','name','internal','getUserByName','split','CreateMemberReport','catch','error','format'];(function(_0x5e2f52,_0x192ccd){var _0x4381e4=function(_0x1e36cc){while(--_0x1e36cc){_0x5e2f52['push'](_0x5e2f52['shift']());}};_0x4381e4(++_0x192ccd);}(_0x8e63,0x7c));var _0x38e6=function(_0x56a785,_0x24ad68){_0x56a785=_0x56a785-0x0;var _0x264f86=_0x8e63[_0x56a785];return _0x264f86;};'use strict';var _=require('lodash');var util=require(_0x38e6('0x0'));var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0x38e6('0x1')];function writeDB(_0xb2c68b){utils[_0x38e6('0x2')](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0xb2c68b[_0x38e6('0x3')],_0xb2c68b[_0x38e6('0x4')],_0xb2c68b[_0x38e6('0x5')],_0xb2c68b['data2'],_0xb2c68b[_0x38e6('0x6')],_0xb2c68b[_0x38e6('0x7')]));if(_0xb2c68b[_0x38e6('0x4')]){utils[_0x38e6('0x8')](_0xb2c68b['interface'])['then'](function(_0x61cee2){if(_0x61cee2){_0xb2c68b[_0x38e6('0x6')]=_0x61cee2[_0x38e6('0x9')];_0xb2c68b[_0x38e6('0xa')]=_0x61cee2[_0x38e6('0xa')];utils['request']('CreateMemberReport',_0xb2c68b);}else{utils[_0x38e6('0xb')](_0xb2c68b['interface'][_0x38e6('0xc')]('/')[0x1])['then'](function(_0xe94c39){if(_0xe94c39){_0xb2c68b[_0x38e6('0x6')]=_0xe94c39[_0x38e6('0x9')];_0xb2c68b[_0x38e6('0xa')]=_0xe94c39[_0x38e6('0xa')];utils['request'](_0x38e6('0xd'),_0xb2c68b);}});}})[_0x38e6('0xe')](function(_0x575b0b){utils[_0x38e6('0xf')](util[_0x38e6('0x10')](_0x38e6('0x11'),_0xb2c68b[_0x38e6('0x3')]),_0x575b0b);});}delete members[_0xb2c68b[_0x38e6('0x4')]];}function startsWith(_0x46b525,_0x55208f){return _[_0x38e6('0x12')](_0x46b525,function(_0x36a263){return _[_0x38e6('0x13')](_0x55208f,_0x36a263);});}exports[_0x38e6('0x14')]=function(_0x5f9d7e){try{utils['debug'](util[_0x38e6('0x10')]('[%s][members][devicestatechange]',members[_0x5f9d7e[_0x38e6('0x15')]]?members[_0x5f9d7e[_0x38e6('0x15')]][_0x38e6('0x3')]:_0x5f9d7e[_0x38e6('0x15')]),_0x5f9d7e);utils['info'](util[_0x38e6('0x10')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x5f9d7e[_0x38e6('0x15')]]?members[_0x5f9d7e[_0x38e6('0x15')]][_0x38e6('0x3')]:_0x5f9d7e[_0x38e6('0x15')],_0x5f9d7e[_0x38e6('0x16')],_0x5f9d7e[_0x38e6('0x15')]));switch(_0x5f9d7e['state']){case'INUSE':case'BUSY':if(!startsWith(exclude,_0x5f9d7e[_0x38e6('0x15')])){members[_0x5f9d7e['device']]={'channel':'voice','interface':_0x5f9d7e[_0x38e6('0x15')],'type':_0x38e6('0x17'),'enterAt':utils[_0x38e6('0x18')](),'role':_0x38e6('0x19')};}break;case'NOT_INUSE':if(!_[_0x38e6('0x1a')](members[_0x5f9d7e[_0x38e6('0x15')]])){members[_0x5f9d7e[_0x38e6('0x15')]]['exitAt']=utils[_0x38e6('0x18')]();members[_0x5f9d7e[_0x38e6('0x15')]][_0x38e6('0x1b')]=utils[_0x38e6('0x1c')](members[_0x5f9d7e[_0x38e6('0x15')]][_0x38e6('0x1d')],members[_0x5f9d7e[_0x38e6('0x15')]][_0x38e6('0x1e')]);if(members[_0x5f9d7e['device']][_0x38e6('0x3')]){writeDB(members[_0x5f9d7e['device']]);}}break;default:break;}}catch(_0x23902b){utils[_0x38e6('0xf')](util[_0x38e6('0x10')](_0x38e6('0x1f'),members[_0x5f9d7e[_0x38e6('0x15')]]?members[_0x5f9d7e[_0x38e6('0x15')]][_0x38e6('0x3')]:_0x5f9d7e['device']),_0x23902b);}};exports[_0x38e6('0x20')]=function(_0x1980a4){try{if(!_[_0x38e6('0x1a')](members[_0x1980a4[_0x38e6('0x4')]])){utils[_0x38e6('0x21')](util['format'](_0x38e6('0x22'),_0x1980a4[_0x38e6('0x3')]),_0x1980a4);utils[_0x38e6('0x2')](util[_0x38e6('0x10')](_0x38e6('0x23'),_0x1980a4[_0x38e6('0x3')],_0x1980a4[_0x38e6('0x4')],_0x1980a4['queue']));members[_0x1980a4[_0x38e6('0x4')]]=_[_0x38e6('0x24')](members[_0x1980a4[_0x38e6('0x4')]],{'data4':_0x1980a4[_0x38e6('0x25')],'uniqueid':_0x1980a4[_0x38e6('0x3')]});}}catch(_0x1403df){utils[_0x38e6('0xf')](util['format'](_0x38e6('0x22'),_0x1980a4[_0x38e6('0x3')]),_0x1403df);}};exports[_0x38e6('0x26')]=function(_0x1eb9ba){try{utils[_0x38e6('0x21')](util[_0x38e6('0x10')](_0x38e6('0x27'),_0x1eb9ba['uniqueid']),_0x1eb9ba);if(_0x1eb9ba[_0x38e6('0x5')]){var _0x5d58bf=_0x1eb9ba[_0x38e6('0x5')][_0x38e6('0xc')]('-')[0x0];if(!_['isNil'](members[_0x5d58bf])){members[_0x5d58bf]=_[_0x38e6('0x24')](members[_0x5d58bf],{'data1':members[_0x5d58bf][_0x38e6('0x28')]||_0x1eb9ba['type'],'data2':members[_0x5d58bf][_0x38e6('0x29')]||_0x1eb9ba[_0x38e6('0x2a')],'data3':members[_0x5d58bf][_0x38e6('0x2b')]||_0x1eb9ba[_0x38e6('0x2c')],'uniqueid':members[_0x5d58bf]['uniqueid']||_0x1eb9ba[_0x38e6('0x3')]});utils[_0x38e6('0x2')](util[_0x38e6('0x10')](_0x38e6('0x2d'),_0x1eb9ba['uniqueid'],members[_0x5d58bf][_0x38e6('0x28')],members[_0x5d58bf][_0x38e6('0x29')],members[_0x5d58bf][_0x38e6('0x2b')]));if(members[_0x5d58bf][_0x38e6('0x1d')]){writeDB(members[_0x5d58bf]);}}}if(_0x1eb9ba[_0x38e6('0x2e')]){var _0xe1d8ab=_0x1eb9ba[_0x38e6('0x2e')]['split']('-')[0x0];if(!_[_0x38e6('0x1a')](members[_0xe1d8ab])){members[_0xe1d8ab]=_[_0x38e6('0x24')](members[_0xe1d8ab],{'data1':members[_0xe1d8ab]['data1']||_0x1eb9ba['type'],'data2':members[_0xe1d8ab][_0x38e6('0x29')]||_0x1eb9ba[_0x38e6('0x2a')],'data3':members[_0xe1d8ab][_0x38e6('0x2b')]||_0x1eb9ba[_0x38e6('0x2c')],'uniqueid':members[_0xe1d8ab][_0x38e6('0x3')]||_0x1eb9ba[_0x38e6('0x3')]});utils[_0x38e6('0x2')](util[_0x38e6('0x10')](_0x38e6('0x2d'),_0x1eb9ba[_0x38e6('0x3')],members[_0xe1d8ab]['data1'],members[_0xe1d8ab][_0x38e6('0x29')],members[_0xe1d8ab][_0x38e6('0x2b')]));if(members[_0xe1d8ab][_0x38e6('0x1d')]){writeDB(members[_0xe1d8ab]);}}}}catch(_0xb486bb){utils[_0x38e6('0xf')](util['format'](_0x38e6('0x27'),_0x1eb9ba['uniqueid']),_0xb486bb);}};
\ No newline at end of file
+var _0xfba1=['util','./utils','Local/_attended@transfer','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','getUserByName','split','request','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','TALKING','now','agent','NOT_INUSE','isNil','exitAt','enterAt','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','source','destination'];(function(_0x32b9e9,_0x3d3823){var _0xc99915=function(_0x12299c){while(--_0x12299c){_0x32b9e9['push'](_0x32b9e9['shift']());}};_0xc99915(++_0x3d3823);}(_0xfba1,0x132));var _0x1fba=function(_0x2260f4,_0x57c006){_0x2260f4=_0x2260f4-0x0;var _0x59130a=_0xfba1[_0x2260f4];return _0x59130a;};'use strict';var _=require('lodash');var util=require(_0x1fba('0x0'));var utils=require(_0x1fba('0x1'));var members={};var exclude=[_0x1fba('0x2'),'Queue:'];function writeDB(_0x32bc02){utils[_0x1fba('0x3')](util[_0x1fba('0x4')](_0x1fba('0x5'),_0x32bc02[_0x1fba('0x6')],_0x32bc02[_0x1fba('0x7')],_0x32bc02[_0x1fba('0x8')],_0x32bc02[_0x1fba('0x9')],_0x32bc02[_0x1fba('0xa')],_0x32bc02[_0x1fba('0xb')]));if(_0x32bc02['interface']){utils[_0x1fba('0xc')](_0x32bc02['interface'])[_0x1fba('0xd')](function(_0x871e90){if(_0x871e90){_0x32bc02[_0x1fba('0xa')]=_0x871e90[_0x1fba('0xe')];_0x32bc02[_0x1fba('0xf')]=_0x871e90[_0x1fba('0xf')];utils['request']('CreateMemberReport',_0x32bc02);}else{utils[_0x1fba('0x10')](_0x32bc02[_0x1fba('0x7')][_0x1fba('0x11')]('/')[0x1])[_0x1fba('0xd')](function(_0x2f223c){if(_0x2f223c){_0x32bc02[_0x1fba('0xa')]=_0x2f223c[_0x1fba('0xe')];_0x32bc02['internal']=_0x2f223c['internal'];utils[_0x1fba('0x12')](_0x1fba('0x13'),_0x32bc02);}});}})[_0x1fba('0x14')](function(_0x9b4ad9){utils[_0x1fba('0x15')](util[_0x1fba('0x4')](_0x1fba('0x16'),_0x32bc02[_0x1fba('0x6')]),_0x9b4ad9);});}delete members[_0x32bc02[_0x1fba('0x7')]];}function startsWith(_0x20bf75,_0x255055){return _[_0x1fba('0x17')](_0x20bf75,function(_0x305460){return _[_0x1fba('0x18')](_0x255055,_0x305460);});}exports[_0x1fba('0x19')]=function(_0x40fe4c){try{utils['debug'](util['format'](_0x1fba('0x1a'),members[_0x40fe4c['device']]?members[_0x40fe4c['device']][_0x1fba('0x6')]:_0x40fe4c[_0x1fba('0x1b')]),_0x40fe4c);utils['info'](util['format'](_0x1fba('0x1c'),members[_0x40fe4c['device']]?members[_0x40fe4c[_0x1fba('0x1b')]][_0x1fba('0x6')]:_0x40fe4c[_0x1fba('0x1b')],_0x40fe4c['state'],_0x40fe4c[_0x1fba('0x1b')]));switch(_0x40fe4c[_0x1fba('0x1d')]){case _0x1fba('0x1e'):case'BUSY':if(!startsWith(exclude,_0x40fe4c[_0x1fba('0x1b')])){members[_0x40fe4c[_0x1fba('0x1b')]]={'channel':'voice','interface':_0x40fe4c[_0x1fba('0x1b')],'type':_0x1fba('0x1f'),'enterAt':utils[_0x1fba('0x20')](),'role':_0x1fba('0x21')};}break;case _0x1fba('0x22'):if(!_[_0x1fba('0x23')](members[_0x40fe4c[_0x1fba('0x1b')]])){members[_0x40fe4c[_0x1fba('0x1b')]]['exitAt']=utils['now']();members[_0x40fe4c['device']]['duration']=utils['diffTime'](members[_0x40fe4c[_0x1fba('0x1b')]][_0x1fba('0x24')],members[_0x40fe4c[_0x1fba('0x1b')]][_0x1fba('0x25')]);if(members[_0x40fe4c[_0x1fba('0x1b')]][_0x1fba('0x6')]){writeDB(members[_0x40fe4c[_0x1fba('0x1b')]]);}}break;default:break;}}catch(_0x136f91){utils[_0x1fba('0x15')](util[_0x1fba('0x4')](_0x1fba('0x1a'),members[_0x40fe4c['device']]?members[_0x40fe4c[_0x1fba('0x1b')]][_0x1fba('0x6')]:_0x40fe4c[_0x1fba('0x1b')]),_0x136f91);}};exports['agentcomplete']=function(_0x5940cc){try{if(!_[_0x1fba('0x23')](members[_0x5940cc[_0x1fba('0x7')]])){utils[_0x1fba('0x26')](util[_0x1fba('0x4')](_0x1fba('0x27'),_0x5940cc[_0x1fba('0x6')]),_0x5940cc);utils[_0x1fba('0x3')](util['format'](_0x1fba('0x28'),_0x5940cc[_0x1fba('0x6')],_0x5940cc['interface'],_0x5940cc['queue']));members[_0x5940cc[_0x1fba('0x7')]]=_[_0x1fba('0x29')](members[_0x5940cc[_0x1fba('0x7')]],{'data4':_0x5940cc[_0x1fba('0x2a')],'uniqueid':_0x5940cc[_0x1fba('0x6')]});}}catch(_0x35b984){utils[_0x1fba('0x15')](util[_0x1fba('0x4')](_0x1fba('0x27'),_0x5940cc[_0x1fba('0x6')]),_0x35b984);}};exports[_0x1fba('0x2b')]=function(_0x48adcf){try{utils[_0x1fba('0x26')](util[_0x1fba('0x4')](_0x1fba('0x2c'),_0x48adcf[_0x1fba('0x6')]),_0x48adcf);if(_0x48adcf[_0x1fba('0x8')]){var _0x4cea16=_0x48adcf['channel'][_0x1fba('0x11')]('-')[0x0];if(!_[_0x1fba('0x23')](members[_0x4cea16])){members[_0x4cea16]=_[_0x1fba('0x29')](members[_0x4cea16],{'data1':members[_0x4cea16]['data1']||_0x48adcf[_0x1fba('0xb')],'data2':members[_0x4cea16][_0x1fba('0x9')]||_0x48adcf['source'],'data3':members[_0x4cea16][_0x1fba('0x2d')]||_0x48adcf['destination'],'uniqueid':members[_0x4cea16]['uniqueid']||_0x48adcf['uniqueid']});utils[_0x1fba('0x3')](util[_0x1fba('0x4')](_0x1fba('0x2e'),_0x48adcf[_0x1fba('0x6')],members[_0x4cea16][_0x1fba('0x2f')],members[_0x4cea16]['data2'],members[_0x4cea16]['data3']));if(members[_0x4cea16][_0x1fba('0x24')]){writeDB(members[_0x4cea16]);}}}if(_0x48adcf[_0x1fba('0x30')]){var _0x403bcb=_0x48adcf[_0x1fba('0x30')][_0x1fba('0x11')]('-')[0x0];if(!_['isNil'](members[_0x403bcb])){members[_0x403bcb]=_['assign'](members[_0x403bcb],{'data1':members[_0x403bcb][_0x1fba('0x2f')]||_0x48adcf[_0x1fba('0xb')],'data2':members[_0x403bcb][_0x1fba('0x9')]||_0x48adcf[_0x1fba('0x31')],'data3':members[_0x403bcb][_0x1fba('0x2d')]||_0x48adcf[_0x1fba('0x32')],'uniqueid':members[_0x403bcb][_0x1fba('0x6')]||_0x48adcf[_0x1fba('0x6')]});utils[_0x1fba('0x3')](util['format'](_0x1fba('0x2e'),_0x48adcf[_0x1fba('0x6')],members[_0x403bcb][_0x1fba('0x2f')],members[_0x403bcb]['data2'],members[_0x403bcb]['data3']));if(members[_0x403bcb][_0x1fba('0x24')]){writeDB(members[_0x403bcb]);}}}}catch(_0xded1a4){utils[_0x1fba('0x15')](util[_0x1fba('0x4')](_0x1fba('0x2c'),_0x48adcf['uniqueid']),_0xded1a4);}};
\ No newline at end of file
index 513d1d3..a0cf02e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f34=['ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','request','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','transfereeuniqueid','transfertype','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten'];(function(_0xcaa7d4,_0x1f5683){var _0x2b4bd2=function(_0x5ef224){while(--_0x5ef224){_0xcaa7d4['push'](_0xcaa7d4['shift']());}};_0x2b4bd2(++_0x1f5683);}(_0x0f34,0x145));var _0x40f3=function(_0x34c0bf,_0x3b8460){_0x34c0bf=_0x34c0bf-0x0;var _0x315559=_0x0f34[_0x34c0bf];return _0x315559;};'use strict';var _=require(_0x40f3('0x0'));var util=require(_0x40f3('0x1'));var utils=require(_0x40f3('0x2'));var queues={};function writeDB(_0x4fb579){utils[_0x40f3('0x3')](util[_0x40f3('0x4')](_0x40f3('0x5'),_0x4fb579['uniqueid'],_0x4fb579[_0x40f3('0x6')],_0x4fb579[_0x40f3('0x7')],_0x4fb579[_0x40f3('0x8')],_0x4fb579[_0x40f3('0x9')],_0x4fb579[_0x40f3('0xa')],_0x4fb579[_0x40f3('0xb')]));if(_0x4fb579['queue']){utils[_0x40f3('0xc')](_0x4fb579['queue'])['then'](function(_0x135552){if(_0x135552){_0x4fb579[_0x40f3('0xd')]=_0x135552[_0x40f3('0xd')];}utils['request'](_0x40f3('0xe'),_0x4fb579);});}else{utils[_0x40f3('0xf')](_0x40f3('0xe'),_0x4fb579);}if(_0x4fb579[_0x40f3('0x10')]){delete queues[_0x4fb579[_0x40f3('0x10')]];}else{delete queues[_0x4fb579['uniqueid']];}}exports['queuecallerjoin']=function(_0x5514d8){try{utils[_0x40f3('0x11')](util[_0x40f3('0x4')](_0x40f3('0x12'),_0x5514d8[_0x40f3('0x13')]),_0x5514d8);utils[_0x40f3('0x3')](util['format'](_0x40f3('0x14'),_0x5514d8[_0x40f3('0x13')],_0x5514d8[_0x40f3('0x7')],_0x5514d8['position']));queues[_0x5514d8[_0x40f3('0x13')]]=_[_0x40f3('0x15')](_0x5514d8,{'originalposition':_0x5514d8[_0x40f3('0x16')],'queuecallerjoinAt':utils[_0x40f3('0x17')](),'mohtime':0x0});}catch(_0x216fe1){utils[_0x40f3('0x18')](util[_0x40f3('0x4')](_0x40f3('0x12'),_0x5514d8[_0x40f3('0x13')]),_0x216fe1);}};exports[_0x40f3('0x19')]=function(_0x4ca215){try{if(!_['isNil'](queues[_0x4ca215[_0x40f3('0x13')]])){utils['debug'](util['format'](_0x40f3('0x1a'),_0x4ca215[_0x40f3('0x13')]),_0x4ca215);if(queues[_0x4ca215[_0x40f3('0x13')]][_0x40f3('0x1b')]){if(!queues[_0x4ca215['uniqueid']][_0x40f3('0x1c')]&&!queues[_0x4ca215[_0x40f3('0x13')]][_0x40f3('0x1d')]){queues[_0x4ca215[_0x40f3('0x13')]]['queuecallercomplete']=!![];queues[_0x4ca215['uniqueid']][_0x40f3('0x1e')]=utils['now']();queues[_0x4ca215[_0x40f3('0x13')]]['queuecallerexitreason']=_0x40f3('0x1f');}utils['info'](util[_0x40f3('0x4')](_0x40f3('0x20'),_0x4ca215['uniqueid'],queues[_0x4ca215[_0x40f3('0x13')]][_0x40f3('0x21')],queues[_0x4ca215['uniqueid']][_0x40f3('0xb')]));writeDB(queues[_0x4ca215[_0x40f3('0x13')]]);}else if(queues[_0x4ca215[_0x40f3('0x13')]][_0x40f3('0x10')]){utils[_0x40f3('0x3')](util[_0x40f3('0x4')](_0x40f3('0x22'),_0x4ca215[_0x40f3('0x13')],queues[_0x4ca215['uniqueid']][_0x40f3('0x21')],queues[_0x4ca215[_0x40f3('0x13')]]['transfereduniqueid']));queues[queues[_0x4ca215[_0x40f3('0x13')]][_0x40f3('0x10')]]=queues[_0x4ca215[_0x40f3('0x13')]];queues[queues[_0x4ca215['uniqueid']][_0x40f3('0x10')]][_0x40f3('0x23')]=0x2;delete queues[_0x4ca215[_0x40f3('0x13')]];}}}catch(_0x2c8306){utils['error'](util['format'](_0x40f3('0x1a'),_0x4ca215[_0x40f3('0x13')]),_0x2c8306);}};exports[_0x40f3('0x24')]=function(_0x22032f){try{utils[_0x40f3('0x11')](util[_0x40f3('0x4')](_0x40f3('0x25'),_0x22032f[_0x40f3('0x13')]),_0x22032f);if(!_[_0x40f3('0x26')](_0x22032f[_0x40f3('0x27')][_0x40f3('0x28')])&&_0x22032f[_0x40f3('0x29')][_0x40f3('0x2a')]()!=='CONTINUE'){if(!_[_0x40f3('0x26')](queues[_0x22032f[_0x40f3('0x13')]])){queues[_0x22032f[_0x40f3('0x13')]][_0x40f3('0x1c')]=![];queues[_0x22032f['uniqueid']][_0x40f3('0x2b')]=null;queues[_0x22032f[_0x40f3('0x13')]][_0x40f3('0x1d')]=!![];queues[_0x22032f[_0x40f3('0x13')]][_0x40f3('0x2c')]=utils[_0x40f3('0x17')]();queues[_0x22032f['uniqueid']][_0x40f3('0xb')]=_0x22032f[_0x40f3('0x29')][_0x40f3('0x2a')]();utils[_0x40f3('0x3')](util['format'](_0x40f3('0x2d'),_0x22032f[_0x40f3('0x13')],queues[_0x22032f['uniqueid']][_0x40f3('0x21')],_0x22032f[_0x40f3('0x29')],queues[_0x22032f[_0x40f3('0x13')]]['queuecallerexitreason']));writeDB(queues[_0x22032f[_0x40f3('0x13')]]);}}else if(!_[_0x40f3('0x26')](_0x22032f[_0x40f3('0x27')][_0x40f3('0x2e')])){if(!_[_0x40f3('0x26')](queues[_0x22032f['uniqueid']])&&!queues[_0x22032f[_0x40f3('0x13')]][_0x40f3('0x1c')]){queues[_0x22032f[_0x40f3('0x13')]]['queuecallerabandon']=![];queues[_0x22032f[_0x40f3('0x13')]][_0x40f3('0x2b')]=null;queues[_0x22032f[_0x40f3('0x13')]]['queuecallerexit']=!![];queues[_0x22032f[_0x40f3('0x13')]][_0x40f3('0x2c')]=utils[_0x40f3('0x17')]();queues[_0x22032f[_0x40f3('0x13')]]['queuecallerexitreason']=_0x40f3('0x2f');utils[_0x40f3('0x3')](util[_0x40f3('0x4')](_0x40f3('0x30'),_0x22032f[_0x40f3('0x13')],queues[_0x22032f[_0x40f3('0x13')]][_0x40f3('0x21')],_0x22032f[_0x40f3('0x29')],queues[_0x22032f['uniqueid']][_0x40f3('0xb')]));}}}catch(_0x32a012){utils[_0x40f3('0x18')](util['format']('[%s][queues][varset]',_0x22032f['uniqueid']),_0x32a012);}};exports['queuecallerabandon']=function(_0x3a0618){try{if(!_[_0x40f3('0x26')](queues[_0x3a0618[_0x40f3('0x13')]])){utils[_0x40f3('0x11')](util[_0x40f3('0x4')]('[%s][queues][queuecallerabandon]',_0x3a0618['uniqueid']),_0x3a0618);queues[_0x3a0618[_0x40f3('0x13')]][_0x40f3('0x1d')]=![];queues[_0x3a0618[_0x40f3('0x13')]][_0x40f3('0x2c')]=null;queues[_0x3a0618['uniqueid']][_0x40f3('0x1c')]=!![];queues[_0x3a0618[_0x40f3('0x13')]][_0x40f3('0x2b')]=utils[_0x40f3('0x17')]();queues[_0x3a0618[_0x40f3('0x13')]]['queuecallerexitreason']=_0x40f3('0x31');utils[_0x40f3('0x3')](util[_0x40f3('0x4')](_0x40f3('0x32'),_0x3a0618['uniqueid'],queues[_0x3a0618[_0x40f3('0x13')]]['name'],queues[_0x3a0618[_0x40f3('0x13')]]['queuecallerexitreason']));}}catch(_0x421f5f){utils[_0x40f3('0x18')](util[_0x40f3('0x4')](_0x40f3('0x33'),_0x3a0618[_0x40f3('0x13')]),_0x421f5f);}};exports[_0x40f3('0x34')]=function(_0x43b059){try{if(!_['isNil'](queues[_0x43b059[_0x40f3('0x13')]])){utils[_0x40f3('0x11')](util['format']('[%s][queues][queuecallerleave]',_0x43b059[_0x40f3('0x13')]),_0x43b059);utils[_0x40f3('0x3')](util[_0x40f3('0x4')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x43b059[_0x40f3('0x13')],queues[_0x43b059[_0x40f3('0x13')]]['name'],_0x43b059[_0x40f3('0x35')],_0x43b059[_0x40f3('0x36')]));queues[_0x43b059['uniqueid']][_0x40f3('0x34')]=!![];queues[_0x43b059[_0x40f3('0x13')]]['queuecallerleaveAt']=utils[_0x40f3('0x17')]();queues[_0x43b059['uniqueid']]['holdtime']=utils[_0x40f3('0x37')](queues[_0x43b059['uniqueid']][_0x40f3('0x1b')],queues[_0x43b059[_0x40f3('0x13')]][_0x40f3('0x38')]);queues[_0x43b059['uniqueid']]['position']=_0x43b059[_0x40f3('0x16')];queues[_0x43b059['uniqueid']][_0x40f3('0x39')]=_0x43b059[_0x40f3('0x39')];queues[_0x43b059['uniqueid']][_0x40f3('0x35')]=_0x43b059[_0x40f3('0x35')];queues[_0x43b059[_0x40f3('0x13')]][_0x40f3('0x36')]=_0x43b059[_0x40f3('0x36')];}}catch(_0x4e30e4){utils['error'](util[_0x40f3('0x4')](_0x40f3('0x3a'),_0x43b059[_0x40f3('0x13')]),_0x4e30e4);}};exports[_0x40f3('0x3b')]=function(_0x422c0b){try{if(!_['isNil'](queues[_0x422c0b[_0x40f3('0x13')]])){utils[_0x40f3('0x11')](util['format'](_0x40f3('0x3c'),_0x422c0b[_0x40f3('0x13')]),_0x422c0b);utils['info'](util['format'](_0x40f3('0x3d'),_0x422c0b['uniqueid'],queues[_0x422c0b[_0x40f3('0x13')]]['name'],_0x422c0b[_0x40f3('0x3e')],_0x422c0b['destaccountcode']));queues[_0x422c0b['uniqueid']]['queuecallerabandon']=![];queues[_0x422c0b[_0x40f3('0x13')]]['queuecallerabandon']=![];queues[_0x422c0b[_0x40f3('0x13')]][_0x40f3('0x2b')]=null;queues[_0x422c0b[_0x40f3('0x13')]][_0x40f3('0x1d')]=![];queues[_0x422c0b['uniqueid']][_0x40f3('0xb')]=null;queues[_0x422c0b[_0x40f3('0x13')]][_0x40f3('0x2c')]=null;queues[_0x422c0b[_0x40f3('0x13')]][_0x40f3('0x3f')]=!![];queues[_0x422c0b[_0x40f3('0x13')]][_0x40f3('0xa')]=_0x422c0b[_0x40f3('0x40')];queues[_0x422c0b['uniqueid']][_0x40f3('0x8')]=_0x422c0b['membername'];}}catch(_0x26e586){utils['error'](util['format'](_0x40f3('0x3c'),_0x422c0b[_0x40f3('0x13')]),_0x26e586);}};exports[_0x40f3('0x41')]=function(_0x565d3f){try{if(!_[_0x40f3('0x26')](queues[_0x565d3f['uniqueid']])){if(queues[_0x565d3f['uniqueid']][_0x40f3('0x1b')]){utils['debug'](util['format'](_0x40f3('0x42'),_0x565d3f[_0x40f3('0x13')]),_0x565d3f);queues[_0x565d3f[_0x40f3('0x13')]][_0x40f3('0x1c')]=![];queues[_0x565d3f[_0x40f3('0x13')]][_0x40f3('0x1c')]=![];queues[_0x565d3f[_0x40f3('0x13')]][_0x40f3('0x2b')]=null;queues[_0x565d3f['uniqueid']]['queuecallerexit']=![];queues[_0x565d3f['uniqueid']]['queuecallerexitAt']=null;queues[_0x565d3f[_0x40f3('0x13')]][_0x40f3('0x3f')]=!![];queues[_0x565d3f[_0x40f3('0x13')]]['lastAssignedTo']=_0x565d3f[_0x40f3('0x3e')];queues[_0x565d3f['uniqueid']][_0x40f3('0x43')]=!![];queues[_0x565d3f[_0x40f3('0x13')]][_0x40f3('0x1e')]=utils['now']();if(_0x565d3f[_0x40f3('0x44')]==_0x40f3('0x45')){if(!queues[_0x565d3f['uniqueid']][_0x40f3('0x45')]){queues[_0x565d3f[_0x40f3('0x13')]]['queuecallerexitreason']=_0x40f3('0x46');}}else{queues[_0x565d3f[_0x40f3('0x13')]][_0x40f3('0xb')]='COMPLETEDBY'+_0x565d3f[_0x40f3('0x44')][_0x40f3('0x2a')]();}utils[_0x40f3('0x3')](util[_0x40f3('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x565d3f[_0x40f3('0x13')],queues[_0x565d3f[_0x40f3('0x13')]][_0x40f3('0x21')],_0x565d3f[_0x40f3('0x3e')],queues[_0x565d3f[_0x40f3('0x13')]][_0x40f3('0xb')]));writeDB(queues[_0x565d3f[_0x40f3('0x13')]]);}}}catch(_0x5ac7bc){utils[_0x40f3('0x18')](util[_0x40f3('0x4')](_0x40f3('0x42'),_0x565d3f[_0x40f3('0x13')]),_0x5ac7bc);}};exports['blindtransfer']=function(_0x4fd3a0){try{if(!_[_0x40f3('0x26')](queues[_0x4fd3a0['transfereeuniqueid']])){utils[_0x40f3('0x11')](util['format']('[%s][queues][blindtransfer]',_0x4fd3a0[_0x40f3('0x13')]),_0x4fd3a0);queues[_0x4fd3a0[_0x40f3('0x47')]]['transfer']=!![];queues[_0x4fd3a0[_0x40f3('0x47')]][_0x40f3('0x48')]='BLIND';queues[_0x4fd3a0[_0x40f3('0x47')]]['transferexten']=_0x4fd3a0['extension'];queues[_0x4fd3a0[_0x40f3('0x47')]][_0x40f3('0x49')]=_0x4fd3a0[_0x40f3('0x47')];queues[_0x4fd3a0[_0x40f3('0x47')]]['queuecallerexitreason']=_0x40f3('0x4a');utils['info'](util[_0x40f3('0x4')](_0x40f3('0x4b'),_0x4fd3a0[_0x40f3('0x13')],queues[_0x4fd3a0['transfereeuniqueid']][_0x40f3('0x21')],_0x4fd3a0['transfereeuniqueid'],_0x4fd3a0['extension']));}}catch(_0x4955b3){utils[_0x40f3('0x18')](util[_0x40f3('0x4')](_0x40f3('0x4c'),_0x4fd3a0[_0x40f3('0x13')]),_0x4955b3);}};exports[_0x40f3('0x4d')]=function(_0x212f1b){try{utils['debug'](util[_0x40f3('0x4')]('[%s][queues][attendedtransfer]',_0x212f1b[_0x40f3('0x4e')]),_0x212f1b);if(_0x212f1b[_0x40f3('0x4e')]==_0x212f1b[_0x40f3('0x4f')]){if(!_[_0x40f3('0x26')](queues[_0x212f1b[_0x40f3('0x50')]])){utils[_0x40f3('0x3')](util['format'](_0x40f3('0x51'),_0x212f1b['origtransfereruniqueid'],queues[_0x212f1b[_0x40f3('0x50')]][_0x40f3('0x21')],_0x212f1b[_0x40f3('0x52')]));queues[_0x212f1b[_0x40f3('0x50')]][_0x40f3('0x45')]=!![];queues[_0x212f1b[_0x40f3('0x50')]][_0x40f3('0x48')]=_0x40f3('0x53');queues[_0x212f1b[_0x40f3('0x50')]][_0x40f3('0x54')]=_0x212f1b[_0x40f3('0x52')];queues[_0x212f1b[_0x40f3('0x50')]]['transferuniqueid']=_0x212f1b['origtransfereruniqueid'];queues[_0x212f1b[_0x40f3('0x50')]][_0x40f3('0xb')]=_0x40f3('0x55');}if(!_[_0x40f3('0x26')](queues[_0x212f1b['origtransfererlinkedid']])){if(_0x212f1b[_0x40f3('0x56')]&&queues[_0x212f1b[_0x40f3('0x56')]]){queues[_0x212f1b[_0x40f3('0x56')]]['queuecallerenterreason']=0x1;queues[_0x212f1b[_0x40f3('0x47')]]=_[_0x40f3('0x57')](queues[_0x212f1b[_0x40f3('0x56')]]);queues[_0x212f1b[_0x40f3('0x47')]][_0x40f3('0x10')]=_0x212f1b[_0x40f3('0x58')];queues[_0x212f1b[_0x40f3('0x47')]][_0x40f3('0x23')]=0x2;queues[_0x212f1b[_0x40f3('0x47')]][_0x40f3('0x9')]=queues[_0x212f1b[_0x40f3('0x50')]]['calleridnum'];queues[_0x212f1b[_0x40f3('0x47')]][_0x40f3('0x59')]=queues[_0x212f1b[_0x40f3('0x50')]][_0x40f3('0x59')];queues[_0x212f1b[_0x40f3('0x47')]]['queuecallerjoinAt']=utils[_0x40f3('0x17')]();queues[_0x212f1b[_0x40f3('0x47')]][_0x40f3('0x1b')]=utils['now']();queues[_0x212f1b['transfereeuniqueid']]['holdtime']=0x0;queues[_0x212f1b[_0x40f3('0x47')]][_0x40f3('0x5a')]=0x0;utils[_0x40f3('0x3')](util[_0x40f3('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x212f1b['origtransfereruniqueid'],queues[_0x212f1b['transfereeuniqueid']][_0x40f3('0x21')],queues[_0x212f1b[_0x40f3('0x47')]][_0x40f3('0x9')],queues[_0x212f1b[_0x40f3('0x47')]][_0x40f3('0x59')]));}else{utils[_0x40f3('0x3')](util[_0x40f3('0x4')](_0x40f3('0x5b'),_0x212f1b[_0x40f3('0x4e')],queues[_0x212f1b[_0x40f3('0x4f')]]['name'],_0x212f1b['secondtransfererlinkedid']));queues[_0x212f1b[_0x40f3('0x4f')]]['transfereduniqueid']=_0x212f1b['secondtransfererlinkedid'];}}}else if(_0x212f1b[_0x40f3('0x5c')]==_0x212f1b[_0x40f3('0x50')]){if(!_[_0x40f3('0x26')](queues[_0x212f1b['origtransfererlinkedid']])){utils[_0x40f3('0x3')](util[_0x40f3('0x4')](_0x40f3('0x5d'),_0x212f1b['origtransfereruniqueid'],queues[_0x212f1b[_0x40f3('0x4f')]]['name'],_0x212f1b[_0x40f3('0x5c')],_0x212f1b[_0x40f3('0x5e')]));queues[_0x212f1b['origtransfererlinkedid']][_0x40f3('0x45')]=!![];queues[_0x212f1b[_0x40f3('0x4f')]][_0x40f3('0x48')]=_0x40f3('0x53');queues[_0x212f1b[_0x40f3('0x4f')]][_0x40f3('0x54')]=_0x212f1b[_0x40f3('0x5e')];queues[_0x212f1b[_0x40f3('0x4f')]][_0x40f3('0x49')]=_0x212f1b[_0x40f3('0x5c')];queues[_0x212f1b[_0x40f3('0x4f')]][_0x40f3('0xb')]=_0x40f3('0x55');}if(!_['isNil'](queues[_0x212f1b[_0x40f3('0x50')]])){if(_0x212f1b[_0x40f3('0x5f')]&&queues[_0x212f1b[_0x40f3('0x5f')]]){queues[_0x212f1b[_0x40f3('0x5f')]]['queuecallerenterreason']=0x1;queues[_0x212f1b[_0x40f3('0x58')]]=_[_0x40f3('0x57')](queues[_0x212f1b[_0x40f3('0x5f')]]);queues[_0x212f1b[_0x40f3('0x58')]][_0x40f3('0x10')]=_0x212f1b['transfertargetuniqueid'];queues[_0x212f1b[_0x40f3('0x58')]]['queuecallerenterreason']=0x2;queues[_0x212f1b[_0x40f3('0x58')]][_0x40f3('0x9')]=queues[_0x212f1b[_0x40f3('0x4f')]][_0x40f3('0x9')];queues[_0x212f1b[_0x40f3('0x58')]][_0x40f3('0x59')]=queues[_0x212f1b[_0x40f3('0x4f')]]['calleridname'];queues[_0x212f1b[_0x40f3('0x58')]][_0x40f3('0x38')]=utils[_0x40f3('0x17')]();queues[_0x212f1b[_0x40f3('0x58')]][_0x40f3('0x1b')]=utils['now']();queues[_0x212f1b['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x212f1b[_0x40f3('0x58')]][_0x40f3('0x5a')]=0x0;utils[_0x40f3('0x3')](util[_0x40f3('0x4')](_0x40f3('0x60'),_0x212f1b[_0x40f3('0x4e')],queues[_0x212f1b[_0x40f3('0x58')]][_0x40f3('0x21')],queues[_0x212f1b[_0x40f3('0x58')]][_0x40f3('0x10')],queues[_0x212f1b[_0x40f3('0x58')]]['calleridnum'],queues[_0x212f1b[_0x40f3('0x58')]][_0x40f3('0x59')]));}else{utils[_0x40f3('0x3')](util[_0x40f3('0x4')](_0x40f3('0x5b'),_0x212f1b[_0x40f3('0x4e')],queues[_0x212f1b['secondtransfererlinkedid']][_0x40f3('0x21')],_0x212f1b[_0x40f3('0x4f')]));queues[_0x212f1b[_0x40f3('0x50')]][_0x40f3('0x10')]=_0x212f1b['origtransfererlinkedid'];}}}}catch(_0x1027c8){utils['error'](util[_0x40f3('0x4')](_0x40f3('0x61'),_0x212f1b[_0x40f3('0x4e')]),_0x1027c8);}};exports['musiconholdstart']=function(_0x364440){try{if(!_[_0x40f3('0x26')](queues[_0x364440[_0x40f3('0x13')]])){utils[_0x40f3('0x11')](util[_0x40f3('0x4')](_0x40f3('0x62'),_0x364440['uniqueid']),_0x364440);queues[_0x364440[_0x40f3('0x13')]]['musiconholdstartAt']=utils[_0x40f3('0x17')]();utils['info'](util[_0x40f3('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x364440[_0x40f3('0x13')],queues[_0x364440[_0x40f3('0x13')]][_0x40f3('0x21')],queues[_0x364440[_0x40f3('0x13')]][_0x40f3('0x63')]));}}catch(_0x3a3c53){utils[_0x40f3('0x18')](util[_0x40f3('0x4')](_0x40f3('0x62'),_0x364440[_0x40f3('0x13')]),_0x3a3c53);}};exports['musiconholdstop']=function(_0x22c6c1){try{if(!_[_0x40f3('0x26')](queues[_0x22c6c1['uniqueid']])){if(!_['isNil'](queues[_0x22c6c1[_0x40f3('0x13')]]['musiconholdstartAt'])){utils['debug'](util['format'](_0x40f3('0x64'),_0x22c6c1['uniqueid']),_0x22c6c1);queues[_0x22c6c1[_0x40f3('0x13')]][_0x40f3('0x5a')]+=utils[_0x40f3('0x37')](utils[_0x40f3('0x17')](),queues[_0x22c6c1[_0x40f3('0x13')]][_0x40f3('0x63')]);utils[_0x40f3('0x3')](util['format'](_0x40f3('0x65'),_0x22c6c1[_0x40f3('0x13')],queues[_0x22c6c1[_0x40f3('0x13')]]['name'],queues[_0x22c6c1[_0x40f3('0x13')]]['mohtime']));delete queues[_0x22c6c1[_0x40f3('0x13')]]['musiconholdstartAt'];}}}catch(_0x434f53){utils[_0x40f3('0x18')](util['format'](_0x40f3('0x64'),_0x22c6c1[_0x40f3('0x13')]),_0x434f53);}};
\ No newline at end of file
+var _0x9231=['[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','queuecallerjoinAt','count','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','membername','[%s][queues][agentconnect]','reason','transfer','TRANSFER','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x9231,0xc5));var _0x1923=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9231[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1923('0x0'));var util=require(_0x1923('0x1'));var utils=require(_0x1923('0x2'));var queues={};function writeDB(_0x4c65ce){utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x5'),_0x4c65ce[_0x1923('0x6')],_0x4c65ce['channel'],_0x4c65ce[_0x1923('0x7')],_0x4c65ce[_0x1923('0x8')],_0x4c65ce[_0x1923('0x9')],_0x4c65ce[_0x1923('0xa')],_0x4c65ce['queuecallerexitreason']));if(_0x4c65ce[_0x1923('0x7')]){utils[_0x1923('0xb')](_0x4c65ce[_0x1923('0x7')])['then'](function(_0x458f0b){if(_0x458f0b){_0x4c65ce[_0x1923('0xc')]=_0x458f0b[_0x1923('0xc')];}utils[_0x1923('0xd')](_0x1923('0xe'),_0x4c65ce);});}else{utils[_0x1923('0xd')](_0x1923('0xe'),_0x4c65ce);}if(_0x4c65ce['transfereduniqueid']){delete queues[_0x4c65ce[_0x1923('0xf')]];}else{delete queues[_0x4c65ce[_0x1923('0x6')]];}}exports[_0x1923('0x10')]=function(_0x34571a){try{utils[_0x1923('0x11')](util[_0x1923('0x4')](_0x1923('0x12'),_0x34571a[_0x1923('0x6')]),_0x34571a);utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x13'),_0x34571a['uniqueid'],_0x34571a[_0x1923('0x7')],_0x34571a[_0x1923('0x14')]));queues[_0x34571a[_0x1923('0x6')]]=_['assign'](_0x34571a,{'originalposition':_0x34571a['position'],'queuecallerjoinAt':utils[_0x1923('0x15')](),'mohtime':0x0});}catch(_0x46b15d){utils[_0x1923('0x16')](util['format'](_0x1923('0x12'),_0x34571a[_0x1923('0x6')]),_0x46b15d);}};exports['hangup']=function(_0x9c09dd){try{if(!_[_0x1923('0x17')](queues[_0x9c09dd['uniqueid']])){utils[_0x1923('0x11')](util[_0x1923('0x4')](_0x1923('0x18'),_0x9c09dd[_0x1923('0x6')]),_0x9c09dd);if(queues[_0x9c09dd[_0x1923('0x6')]][_0x1923('0x19')]){if(!queues[_0x9c09dd[_0x1923('0x6')]][_0x1923('0x1a')]&&!queues[_0x9c09dd['uniqueid']][_0x1923('0x1b')]){queues[_0x9c09dd['uniqueid']][_0x1923('0x1c')]=!![];queues[_0x9c09dd['uniqueid']][_0x1923('0x1d')]=utils[_0x1923('0x15')]();queues[_0x9c09dd[_0x1923('0x6')]][_0x1923('0x1e')]='COMPLETEDBYAGENT';}utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x1f'),_0x9c09dd[_0x1923('0x6')],queues[_0x9c09dd[_0x1923('0x6')]][_0x1923('0x20')],queues[_0x9c09dd['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x9c09dd[_0x1923('0x6')]]);}else if(queues[_0x9c09dd[_0x1923('0x6')]][_0x1923('0xf')]){utils[_0x1923('0x3')](util['format'](_0x1923('0x21'),_0x9c09dd[_0x1923('0x6')],queues[_0x9c09dd[_0x1923('0x6')]][_0x1923('0x20')],queues[_0x9c09dd['uniqueid']][_0x1923('0xf')]));queues[queues[_0x9c09dd[_0x1923('0x6')]]['transfereduniqueid']]=queues[_0x9c09dd['uniqueid']];queues[queues[_0x9c09dd[_0x1923('0x6')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x9c09dd[_0x1923('0x6')]];}}}catch(_0x212325){utils['error'](util['format'](_0x1923('0x18'),_0x9c09dd[_0x1923('0x6')]),_0x212325);}};exports[_0x1923('0x22')]=function(_0x196bad){try{utils['debug'](util['format']('[%s][queues][varset]',_0x196bad['uniqueid']),_0x196bad);if(!_[_0x1923('0x17')](_0x196bad[_0x1923('0x23')][_0x1923('0x24')])&&_0x196bad['value'][_0x1923('0x25')]()!==_0x1923('0x26')){if(!_[_0x1923('0x17')](queues[_0x196bad[_0x1923('0x6')]])){queues[_0x196bad[_0x1923('0x6')]]['queuecallerabandon']=![];queues[_0x196bad['uniqueid']][_0x1923('0x27')]=null;queues[_0x196bad[_0x1923('0x6')]][_0x1923('0x1b')]=!![];queues[_0x196bad[_0x1923('0x6')]][_0x1923('0x28')]=utils[_0x1923('0x15')]();queues[_0x196bad[_0x1923('0x6')]]['queuecallerexitreason']=_0x196bad['value'][_0x1923('0x25')]();utils[_0x1923('0x3')](util[_0x1923('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x196bad['uniqueid'],queues[_0x196bad[_0x1923('0x6')]]['name'],_0x196bad[_0x1923('0x29')],queues[_0x196bad[_0x1923('0x6')]][_0x1923('0x1e')]));writeDB(queues[_0x196bad[_0x1923('0x6')]]);}}else if(!_['isNil'](_0x196bad[_0x1923('0x23')][_0x1923('0x2a')])){if(!_['isNil'](queues[_0x196bad[_0x1923('0x6')]])&&!queues[_0x196bad[_0x1923('0x6')]][_0x1923('0x1a')]){queues[_0x196bad[_0x1923('0x6')]][_0x1923('0x1a')]=![];queues[_0x196bad[_0x1923('0x6')]][_0x1923('0x27')]=null;queues[_0x196bad['uniqueid']][_0x1923('0x1b')]=!![];queues[_0x196bad['uniqueid']][_0x1923('0x28')]=utils[_0x1923('0x15')]();queues[_0x196bad[_0x1923('0x6')]][_0x1923('0x1e')]=_0x1923('0x2b');utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x2c'),_0x196bad[_0x1923('0x6')],queues[_0x196bad['uniqueid']][_0x1923('0x20')],_0x196bad[_0x1923('0x29')],queues[_0x196bad['uniqueid']][_0x1923('0x1e')]));}}}catch(_0xa62a50){utils[_0x1923('0x16')](util[_0x1923('0x4')]('[%s][queues][varset]',_0x196bad[_0x1923('0x6')]),_0xa62a50);}};exports[_0x1923('0x1a')]=function(_0x42084e){try{if(!_[_0x1923('0x17')](queues[_0x42084e[_0x1923('0x6')]])){utils['debug'](util[_0x1923('0x4')](_0x1923('0x2d'),_0x42084e[_0x1923('0x6')]),_0x42084e);queues[_0x42084e[_0x1923('0x6')]][_0x1923('0x1b')]=![];queues[_0x42084e['uniqueid']]['queuecallerexitAt']=null;queues[_0x42084e[_0x1923('0x6')]][_0x1923('0x1a')]=!![];queues[_0x42084e[_0x1923('0x6')]][_0x1923('0x27')]=utils[_0x1923('0x15')]();queues[_0x42084e['uniqueid']][_0x1923('0x1e')]='ABANDONED';utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x2e'),_0x42084e[_0x1923('0x6')],queues[_0x42084e['uniqueid']]['name'],queues[_0x42084e[_0x1923('0x6')]][_0x1923('0x1e')]));}}catch(_0x1e8cea){utils[_0x1923('0x16')](util[_0x1923('0x4')](_0x1923('0x2d'),_0x42084e[_0x1923('0x6')]),_0x1e8cea);}};exports[_0x1923('0x2f')]=function(_0x187d3c){try{if(!_[_0x1923('0x17')](queues[_0x187d3c[_0x1923('0x6')]])){utils['debug'](util[_0x1923('0x4')](_0x1923('0x30'),_0x187d3c[_0x1923('0x6')]),_0x187d3c);utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x31'),_0x187d3c[_0x1923('0x6')],queues[_0x187d3c[_0x1923('0x6')]][_0x1923('0x20')],_0x187d3c[_0x1923('0x32')],_0x187d3c[_0x1923('0x33')]));queues[_0x187d3c[_0x1923('0x6')]][_0x1923('0x2f')]=!![];queues[_0x187d3c[_0x1923('0x6')]][_0x1923('0x19')]=utils[_0x1923('0x15')]();queues[_0x187d3c['uniqueid']][_0x1923('0x34')]=utils['diffTime'](queues[_0x187d3c[_0x1923('0x6')]][_0x1923('0x19')],queues[_0x187d3c[_0x1923('0x6')]][_0x1923('0x35')]);queues[_0x187d3c[_0x1923('0x6')]][_0x1923('0x14')]=_0x187d3c[_0x1923('0x14')];queues[_0x187d3c[_0x1923('0x6')]][_0x1923('0x36')]=_0x187d3c['count'];queues[_0x187d3c[_0x1923('0x6')]]['connectedlinenum']=_0x187d3c['connectedlinenum'];queues[_0x187d3c[_0x1923('0x6')]][_0x1923('0x33')]=_0x187d3c[_0x1923('0x33')];}}catch(_0x308dea){utils['error'](util[_0x1923('0x4')](_0x1923('0x30'),_0x187d3c['uniqueid']),_0x308dea);}};exports['agentconnect']=function(_0x4572f9){try{if(!_['isNil'](queues[_0x4572f9['uniqueid']])){utils['debug'](util[_0x1923('0x4')]('[%s][queues][agentconnect]',_0x4572f9[_0x1923('0x6')]),_0x4572f9);utils['info'](util['format'](_0x1923('0x37'),_0x4572f9[_0x1923('0x6')],queues[_0x4572f9['uniqueid']][_0x1923('0x20')],_0x4572f9['membername'],_0x4572f9['destaccountcode']));queues[_0x4572f9[_0x1923('0x6')]][_0x1923('0x1a')]=![];queues[_0x4572f9[_0x1923('0x6')]][_0x1923('0x1a')]=![];queues[_0x4572f9[_0x1923('0x6')]]['queuecallerabandonAt']=null;queues[_0x4572f9[_0x1923('0x6')]][_0x1923('0x1b')]=![];queues[_0x4572f9['uniqueid']][_0x1923('0x1e')]=null;queues[_0x4572f9['uniqueid']][_0x1923('0x28')]=null;queues[_0x4572f9[_0x1923('0x6')]][_0x1923('0x38')]=!![];queues[_0x4572f9[_0x1923('0x6')]]['accountcode']=_0x4572f9['destaccountcode'];queues[_0x4572f9[_0x1923('0x6')]][_0x1923('0x8')]=_0x4572f9[_0x1923('0x39')];}}catch(_0x17711e){utils[_0x1923('0x16')](util['format'](_0x1923('0x3a'),_0x4572f9[_0x1923('0x6')]),_0x17711e);}};exports['agentcomplete']=function(_0x2641dd){try{if(!_[_0x1923('0x17')](queues[_0x2641dd[_0x1923('0x6')]])){if(queues[_0x2641dd['uniqueid']]['queuecallerleaveAt']){utils[_0x1923('0x11')](util[_0x1923('0x4')]('[%s][queues][agentcomplete]',_0x2641dd[_0x1923('0x6')]),_0x2641dd);queues[_0x2641dd[_0x1923('0x6')]][_0x1923('0x1a')]=![];queues[_0x2641dd[_0x1923('0x6')]][_0x1923('0x1a')]=![];queues[_0x2641dd['uniqueid']][_0x1923('0x27')]=null;queues[_0x2641dd[_0x1923('0x6')]][_0x1923('0x1b')]=![];queues[_0x2641dd[_0x1923('0x6')]][_0x1923('0x28')]=null;queues[_0x2641dd[_0x1923('0x6')]][_0x1923('0x38')]=!![];queues[_0x2641dd['uniqueid']][_0x1923('0x8')]=_0x2641dd[_0x1923('0x39')];queues[_0x2641dd['uniqueid']][_0x1923('0x1c')]=!![];queues[_0x2641dd['uniqueid']][_0x1923('0x1d')]=utils[_0x1923('0x15')]();if(_0x2641dd[_0x1923('0x3b')]==_0x1923('0x3c')){if(!queues[_0x2641dd[_0x1923('0x6')]]['transfer']){queues[_0x2641dd[_0x1923('0x6')]][_0x1923('0x1e')]=_0x1923('0x3d');}}else{queues[_0x2641dd['uniqueid']][_0x1923('0x1e')]='COMPLETEDBY'+_0x2641dd[_0x1923('0x3b')][_0x1923('0x25')]();}utils[_0x1923('0x3')](util[_0x1923('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2641dd[_0x1923('0x6')],queues[_0x2641dd[_0x1923('0x6')]][_0x1923('0x20')],_0x2641dd[_0x1923('0x39')],queues[_0x2641dd[_0x1923('0x6')]][_0x1923('0x1e')]));writeDB(queues[_0x2641dd['uniqueid']]);}}}catch(_0x372782){utils['error'](util[_0x1923('0x4')]('[%s][queues][agentcomplete]',_0x2641dd['uniqueid']),_0x372782);}};exports[_0x1923('0x3e')]=function(_0x3e84fc){try{if(!_[_0x1923('0x17')](queues[_0x3e84fc[_0x1923('0x3f')]])){utils[_0x1923('0x11')](util[_0x1923('0x4')]('[%s][queues][blindtransfer]',_0x3e84fc[_0x1923('0x6')]),_0x3e84fc);queues[_0x3e84fc[_0x1923('0x3f')]]['transfer']=!![];queues[_0x3e84fc['transfereeuniqueid']][_0x1923('0x40')]=_0x1923('0x41');queues[_0x3e84fc[_0x1923('0x3f')]][_0x1923('0x42')]=_0x3e84fc['extension'];queues[_0x3e84fc[_0x1923('0x3f')]][_0x1923('0x43')]=_0x3e84fc[_0x1923('0x3f')];queues[_0x3e84fc['transfereeuniqueid']][_0x1923('0x1e')]=_0x1923('0x44');utils['info'](util['format'](_0x1923('0x45'),_0x3e84fc[_0x1923('0x6')],queues[_0x3e84fc['transfereeuniqueid']][_0x1923('0x20')],_0x3e84fc['transfereeuniqueid'],_0x3e84fc[_0x1923('0x46')]));}}catch(_0xca6d3){utils[_0x1923('0x16')](util['format']('[%s][queues][blindtransfer]',_0x3e84fc[_0x1923('0x6')]),_0xca6d3);}};exports[_0x1923('0x47')]=function(_0x2db73b){try{utils[_0x1923('0x11')](util[_0x1923('0x4')]('[%s][queues][attendedtransfer]',_0x2db73b[_0x1923('0x48')]),_0x2db73b);if(_0x2db73b[_0x1923('0x48')]==_0x2db73b[_0x1923('0x49')]){if(!_[_0x1923('0x17')](queues[_0x2db73b['secondtransfererlinkedid']])){utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x4a'),_0x2db73b['origtransfereruniqueid'],queues[_0x2db73b['secondtransfererlinkedid']][_0x1923('0x20')],_0x2db73b['origtransfererexten']));queues[_0x2db73b['secondtransfererlinkedid']][_0x1923('0x3c')]=!![];queues[_0x2db73b['secondtransfererlinkedid']][_0x1923('0x40')]='ATTENDED';queues[_0x2db73b[_0x1923('0x4b')]][_0x1923('0x42')]=_0x2db73b['origtransfererexten'];queues[_0x2db73b[_0x1923('0x4b')]][_0x1923('0x43')]=_0x2db73b['origtransfereruniqueid'];queues[_0x2db73b[_0x1923('0x4b')]][_0x1923('0x1e')]=_0x1923('0x4c');}if(!_[_0x1923('0x17')](queues[_0x2db73b['origtransfererlinkedid']])){if(_0x2db73b[_0x1923('0x4d')]&&queues[_0x2db73b['transfereelinkedid']]){queues[_0x2db73b['transfereelinkedid']][_0x1923('0x4e')]=0x1;queues[_0x2db73b[_0x1923('0x3f')]]=_[_0x1923('0x4f')](queues[_0x2db73b[_0x1923('0x4d')]]);queues[_0x2db73b['transfereeuniqueid']][_0x1923('0xf')]=_0x2db73b[_0x1923('0x50')];queues[_0x2db73b[_0x1923('0x3f')]][_0x1923('0x4e')]=0x2;queues[_0x2db73b[_0x1923('0x3f')]][_0x1923('0x9')]=queues[_0x2db73b[_0x1923('0x4b')]][_0x1923('0x9')];queues[_0x2db73b['transfereeuniqueid']][_0x1923('0x51')]=queues[_0x2db73b[_0x1923('0x4b')]]['calleridname'];queues[_0x2db73b[_0x1923('0x3f')]][_0x1923('0x35')]=utils[_0x1923('0x15')]();queues[_0x2db73b['transfereeuniqueid']][_0x1923('0x19')]=utils[_0x1923('0x15')]();queues[_0x2db73b['transfereeuniqueid']][_0x1923('0x34')]=0x0;queues[_0x2db73b['transfereeuniqueid']]['mohtime']=0x0;utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x52'),_0x2db73b[_0x1923('0x48')],queues[_0x2db73b['transfereeuniqueid']]['name'],queues[_0x2db73b[_0x1923('0x3f')]][_0x1923('0x9')],queues[_0x2db73b[_0x1923('0x3f')]]['calleridname']));}else{utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x53'),_0x2db73b[_0x1923('0x48')],queues[_0x2db73b[_0x1923('0x49')]][_0x1923('0x20')],_0x2db73b['secondtransfererlinkedid']));queues[_0x2db73b['origtransfererlinkedid']][_0x1923('0xf')]=_0x2db73b[_0x1923('0x4b')];}}}else if(_0x2db73b['secondtransfereruniqueid']==_0x2db73b[_0x1923('0x4b')]){if(!_[_0x1923('0x17')](queues[_0x2db73b[_0x1923('0x49')]])){utils[_0x1923('0x3')](util[_0x1923('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x2db73b[_0x1923('0x48')],queues[_0x2db73b[_0x1923('0x49')]][_0x1923('0x20')],_0x2db73b['secondtransfereruniqueid'],_0x2db73b[_0x1923('0x54')]));queues[_0x2db73b[_0x1923('0x49')]][_0x1923('0x3c')]=!![];queues[_0x2db73b[_0x1923('0x49')]][_0x1923('0x40')]='ATTENDED';queues[_0x2db73b[_0x1923('0x49')]]['transferexten']=_0x2db73b[_0x1923('0x54')];queues[_0x2db73b[_0x1923('0x49')]][_0x1923('0x43')]=_0x2db73b[_0x1923('0x55')];queues[_0x2db73b['origtransfererlinkedid']][_0x1923('0x1e')]=_0x1923('0x4c');}if(!_['isNil'](queues[_0x2db73b[_0x1923('0x4b')]])){if(_0x2db73b[_0x1923('0x56')]&&queues[_0x2db73b[_0x1923('0x56')]]){queues[_0x2db73b[_0x1923('0x56')]][_0x1923('0x4e')]=0x1;queues[_0x2db73b[_0x1923('0x50')]]=_[_0x1923('0x4f')](queues[_0x2db73b['transfertargetlinkedid']]);queues[_0x2db73b[_0x1923('0x50')]][_0x1923('0xf')]=_0x2db73b[_0x1923('0x50')];queues[_0x2db73b['transfertargetuniqueid']][_0x1923('0x4e')]=0x2;queues[_0x2db73b[_0x1923('0x50')]][_0x1923('0x9')]=queues[_0x2db73b[_0x1923('0x49')]][_0x1923('0x9')];queues[_0x2db73b['transfertargetuniqueid']][_0x1923('0x51')]=queues[_0x2db73b[_0x1923('0x49')]][_0x1923('0x51')];queues[_0x2db73b[_0x1923('0x50')]]['queuecallerjoinAt']=utils[_0x1923('0x15')]();queues[_0x2db73b[_0x1923('0x50')]][_0x1923('0x19')]=utils[_0x1923('0x15')]();queues[_0x2db73b[_0x1923('0x50')]][_0x1923('0x34')]=0x0;queues[_0x2db73b[_0x1923('0x50')]][_0x1923('0x57')]=0x0;utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x58'),_0x2db73b[_0x1923('0x48')],queues[_0x2db73b['transfertargetuniqueid']][_0x1923('0x20')],queues[_0x2db73b[_0x1923('0x50')]][_0x1923('0xf')],queues[_0x2db73b['transfertargetuniqueid']][_0x1923('0x9')],queues[_0x2db73b[_0x1923('0x50')]][_0x1923('0x51')]));}else{utils[_0x1923('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2db73b[_0x1923('0x48')],queues[_0x2db73b[_0x1923('0x4b')]][_0x1923('0x20')],_0x2db73b[_0x1923('0x49')]));queues[_0x2db73b[_0x1923('0x4b')]][_0x1923('0xf')]=_0x2db73b['origtransfererlinkedid'];}}}}catch(_0x5d5733){utils['error'](util[_0x1923('0x4')](_0x1923('0x59'),_0x2db73b[_0x1923('0x48')]),_0x5d5733);}};exports[_0x1923('0x5a')]=function(_0x3b96ff){try{if(!_[_0x1923('0x17')](queues[_0x3b96ff[_0x1923('0x6')]])){utils['debug'](util[_0x1923('0x4')](_0x1923('0x5b'),_0x3b96ff[_0x1923('0x6')]),_0x3b96ff);queues[_0x3b96ff['uniqueid']][_0x1923('0x5c')]=utils['now']();utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x5d'),_0x3b96ff[_0x1923('0x6')],queues[_0x3b96ff[_0x1923('0x6')]][_0x1923('0x20')],queues[_0x3b96ff['uniqueid']][_0x1923('0x5c')]));}}catch(_0x50c4b5){utils['error'](util['format'](_0x1923('0x5b'),_0x3b96ff['uniqueid']),_0x50c4b5);}};exports[_0x1923('0x5e')]=function(_0x556c90){try{if(!_[_0x1923('0x17')](queues[_0x556c90[_0x1923('0x6')]])){if(!_[_0x1923('0x17')](queues[_0x556c90[_0x1923('0x6')]][_0x1923('0x5c')])){utils[_0x1923('0x11')](util[_0x1923('0x4')](_0x1923('0x5f'),_0x556c90[_0x1923('0x6')]),_0x556c90);queues[_0x556c90[_0x1923('0x6')]][_0x1923('0x57')]+=utils[_0x1923('0x60')](utils['now'](),queues[_0x556c90[_0x1923('0x6')]][_0x1923('0x5c')]);utils[_0x1923('0x3')](util[_0x1923('0x4')](_0x1923('0x61'),_0x556c90[_0x1923('0x6')],queues[_0x556c90[_0x1923('0x6')]][_0x1923('0x20')],queues[_0x556c90[_0x1923('0x6')]][_0x1923('0x57')]));delete queues[_0x556c90[_0x1923('0x6')]][_0x1923('0x5c')];}}}catch(_0x5ebd79){utils[_0x1923('0x16')](util[_0x1923('0x4')](_0x1923('0x5f'),_0x556c90['uniqueid']),_0x5ebd79);}};
\ No newline at end of file
index de041a6..c83410a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e89=['mixmonitor_filename','[%s][recordings][varset]','value','endsWith','replace','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','type','outbound','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','substring','lastIndexOf','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable'];(function(_0x4e9817,_0x1c34a8){var _0xfebba2=function(_0x18be8e){while(--_0x18be8e){_0x4e9817['push'](_0x4e9817['shift']());}};_0xfebba2(++_0x1c34a8);}(_0x8e89,0x1c2));var _0x98e8=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0x8e89[_0x5f1cf8];return _0x27d0fa;};'use strict';var _=require(_0x98e8('0x0'));var util=require(_0x98e8('0x1'));var utils=require(_0x98e8('0x2'));var recordings={};function writeDB(_0x407979){utils[_0x98e8('0x3')](util[_0x98e8('0x4')](_0x98e8('0x5'),_0x407979[_0x98e8('0x6')]));if(_0x407979[_0x98e8('0x7')]){utils[_0x98e8('0x8')](_0x407979['accountcode'])[_0x98e8('0x9')](function(_0x546b54){if(_0x546b54){_0x407979[_0x98e8('0xa')]=_0x546b54[_0x98e8('0xb')];_0x407979['UserId']=_0x546b54['id'];}utils[_0x98e8('0xc')](_0x98e8('0xd'),_0x407979);});}else{utils[_0x98e8('0xc')](_0x98e8('0xd'),_0x407979);}}exports[_0x98e8('0xe')]=function(_0x26cd54){try{utils['debug'](util[_0x98e8('0x4')](_0x98e8('0xf'),_0x26cd54['uniqueid']),_0x26cd54);if(_0x26cd54[_0x98e8('0x6')]==_0x26cd54[_0x98e8('0x10')]){utils[_0x98e8('0x3')](util[_0x98e8('0x4')](_0x98e8('0x11'),_0x26cd54['uniqueid'],_0x26cd54['context'],_0x26cd54[_0x98e8('0x12')]));recordings[_0x26cd54[_0x98e8('0x6')]]={'uniqueid':_0x26cd54[_0x98e8('0x6')],'accountcode':_0x26cd54[_0x98e8('0x7')],'exten':_0x26cd54[_0x98e8('0x12')],'context':_0x26cd54[_0x98e8('0x13')],'channel':_0x26cd54[_0x98e8('0x14')],'monitors':[]};}}catch(_0x1cd4ba){utils[_0x98e8('0x15')](util[_0x98e8('0x4')](_0x98e8('0xf'),_0x26cd54[_0x98e8('0x6')]),_0x1cd4ba);}};exports[_0x98e8('0x16')]=function(_0x4d2e0c){try{utils[_0x98e8('0x17')](util[_0x98e8('0x4')](_0x98e8('0x18'),_0x4d2e0c['uniqueid']),_0x4d2e0c);if(!_[_0x98e8('0x19')](recordings[_0x4d2e0c[_0x98e8('0x6')]])&&_0x4d2e0c[_0x98e8('0x1a')]==0x6){utils[_0x98e8('0x3')](util[_0x98e8('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x4d2e0c['uniqueid'],_0x4d2e0c[_0x98e8('0x13')],_0x4d2e0c[_0x98e8('0x14')]));}else if(!_[_0x98e8('0x19')](recordings[_0x4d2e0c[_0x98e8('0x10')]])&&_0x4d2e0c[_0x98e8('0x1a')]==0x6&&_0x4d2e0c['context']!=_0x98e8('0x1b')){utils[_0x98e8('0x3')](util[_0x98e8('0x4')](_0x98e8('0x1c'),_0x4d2e0c[_0x98e8('0x6')],_0x4d2e0c[_0x98e8('0x10')],_0x4d2e0c[_0x98e8('0x13')],_0x4d2e0c[_0x98e8('0x14')]));recordings[_0x4d2e0c[_0x98e8('0x10')]]['accountcode']=_0x4d2e0c[_0x98e8('0x7')];}}catch(_0x11e84b){utils[_0x98e8('0x15')](util[_0x98e8('0x4')](_0x98e8('0x18'),_0x4d2e0c['uniqueid']),_0x11e84b);}};exports['varset']=function(_0x25fe17){try{if(!_['isNil'](_0x25fe17[_0x98e8('0x1d')])&&!_[_0x98e8('0x19')](_0x25fe17[_0x98e8('0x1d')][_0x98e8('0x1e')])){utils['debug'](util[_0x98e8('0x4')](_0x98e8('0x1f'),_0x25fe17['uniqueid']),_0x25fe17);utils[_0x98e8('0x3')](util[_0x98e8('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x25fe17[_0x98e8('0x6')],_0x25fe17[_0x98e8('0x1d')],_0x25fe17[_0x98e8('0x20')]));if(_[_0x98e8('0x21')](_0x25fe17[_0x98e8('0x20')],'.wav49')){_0x25fe17['value']=_0x25fe17['value'][_0x98e8('0x22')]('.wav49','.WAV');}if(recordings[_0x25fe17['linkedid']]){var _0x23f48e=_['find'](recordings[_0x25fe17[_0x98e8('0x10')]][_0x98e8('0x23')],{'value':_0x25fe17[_0x98e8('0x20')]});if(_[_0x98e8('0x19')](_0x23f48e)){recordings[_0x25fe17['linkedid']][_0x98e8('0x23')]['push']({'value':_0x25fe17[_0x98e8('0x20')]});}}}}catch(_0x2d12b8){utils['error'](util[_0x98e8('0x4')](_0x98e8('0x1f'),_0x25fe17['uniqueid']),_0x2d12b8);}};exports[_0x98e8('0x24')]=function(_0x362c99){try{if(!_[_0x98e8('0x19')](recordings[_0x362c99[_0x98e8('0x6')]])){utils['debug'](util['format'](_0x98e8('0x25'),_0x362c99[_0x98e8('0x6')]),_0x362c99);utils['info'](util[_0x98e8('0x4')](_0x98e8('0x26'),_0x362c99[_0x98e8('0x6')],_0x362c99[_0x98e8('0x27')],_0x362c99[_0x98e8('0x28')],_0x362c99[_0x98e8('0x29')]));recordings[_0x362c99['uniqueid']][_0x98e8('0x27')]=_0x362c99[_0x98e8('0x27')];recordings[_0x362c99['uniqueid']][_0x98e8('0x28')]=_0x362c99[_0x98e8('0x28')];recordings[_0x362c99[_0x98e8('0x6')]][_0x98e8('0x2a')]=_0x362c99[_0x98e8('0x2a')];recordings[_0x362c99[_0x98e8('0x6')]]['connectedlinename']=_0x362c99['connectedlinename'];if(recordings[_0x362c99[_0x98e8('0x6')]][_0x98e8('0x2b')]==_0x98e8('0x2c')&&recordings[_0x362c99['uniqueid']]['accountcode']){recordings[_0x362c99[_0x98e8('0x6')]][_0x98e8('0x2a')]=recordings[_0x362c99['uniqueid']][_0x98e8('0x7')];recordings[_0x362c99[_0x98e8('0x6')]][_0x98e8('0x2d')]='';}recordings[_0x362c99[_0x98e8('0x6')]][_0x98e8('0x23')][_0x98e8('0x2e')](function(_0x513cb3){var _0x407708=_[_0x98e8('0x2f')](recordings[_0x362c99['uniqueid']]);_0x407708[_0x98e8('0x20')]=_0x513cb3[_0x98e8('0x20')];writeDB(_0x407708);});delete recordings[_0x362c99[_0x98e8('0x6')]];}}catch(_0x32781f){utils[_0x98e8('0x15')](util[_0x98e8('0x4')](_0x98e8('0x25'),_0x362c99[_0x98e8('0x6')]),_0x32781f);}};exports[_0x98e8('0x30')]=function(_0x52bd73){try{if(!_['isNil'](recordings[_0x52bd73[_0x98e8('0x6')]])){utils[_0x98e8('0x17')](util[_0x98e8('0x4')](_0x98e8('0x31'),_0x52bd73[_0x98e8('0x6')]),_0x52bd73);utils[_0x98e8('0x3')](util[_0x98e8('0x4')](_0x98e8('0x32'),_0x52bd73[_0x98e8('0x6')],_0x52bd73[_0x98e8('0x33')],_0x52bd73[_0x98e8('0x34')]));if(_0x52bd73['application'][_0x98e8('0x35')]()=='set'&&_[_0x98e8('0x36')](_0x52bd73['appdata'][_0x98e8('0x35')](),_0x98e8('0x37'))){var _0x339a05=_0x52bd73['appdata']['split']('=');var _0x15b98a=_0x339a05[0x0][_0x98e8('0x38')](_0x339a05[0x0][_0x98e8('0x39')]('(')+0x1,_0x339a05[0x0][_0x98e8('0x39')](')'));var _0x31fec1=_0x339a05[0x1];recordings[_0x52bd73[_0x98e8('0x6')]][_0x15b98a]=_0x31fec1;}}}catch(_0x20e915){utils[_0x98e8('0x15')](util[_0x98e8('0x4')](_0x98e8('0x31'),_0x52bd73['uniqueid']),_0x20e915);}};exports['queuecallerjoin']=function(_0x168100){try{if(!_['isNil'](recordings[_0x168100[_0x98e8('0x6')]])){utils[_0x98e8('0x17')](util[_0x98e8('0x4')]('[%s][recordings][queuecallerjoin]',_0x168100[_0x98e8('0x6')]),_0x168100);utils[_0x98e8('0x3')](util[_0x98e8('0x4')](_0x98e8('0x3a'),_0x168100[_0x98e8('0x6')],_0x168100[_0x98e8('0x3b')]));recordings[_0x168100[_0x98e8('0x6')]][_0x98e8('0x3b')]=_0x168100[_0x98e8('0x3b')];}}catch(_0x175761){utils[_0x98e8('0x15')](util['format']('[%s][recordings][queuecallerjoin]',_0x168100[_0x98e8('0x6')]),_0x175761);}};
\ No newline at end of file
+var _0xcdfd=['appdata','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','membername','name','CreateVoiceRecording','request','newchannel','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','debug','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','accountcode','variable','mixmonitor_filename','value','.wav49','replace','.WAV','monitors','push','error','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','type','connectedlinename','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase'];(function(_0x241eb1,_0x258058){var _0x43d4c7=function(_0x405546){while(--_0x405546){_0x241eb1['push'](_0x241eb1['shift']());}};_0x43d4c7(++_0x258058);}(_0xcdfd,0x76));var _0xdcdf=function(_0x258586,_0xecdbdb){_0x258586=_0x258586-0x0;var _0x17bdbe=_0xcdfd[_0x258586];return _0x17bdbe;};'use strict';var _=require(_0xdcdf('0x0'));var util=require('util');var utils=require(_0xdcdf('0x1'));var recordings={};function writeDB(_0x1e3c1f){utils[_0xdcdf('0x2')](util[_0xdcdf('0x3')](_0xdcdf('0x4'),_0x1e3c1f[_0xdcdf('0x5')]));if(_0x1e3c1f['accountcode']){utils[_0xdcdf('0x6')](_0x1e3c1f['accountcode'])['then'](function(_0x3fe49a){if(_0x3fe49a){_0x1e3c1f[_0xdcdf('0x7')]=_0x3fe49a[_0xdcdf('0x8')];_0x1e3c1f['UserId']=_0x3fe49a['id'];}utils['request'](_0xdcdf('0x9'),_0x1e3c1f);});}else{utils[_0xdcdf('0xa')](_0xdcdf('0x9'),_0x1e3c1f);}}exports[_0xdcdf('0xb')]=function(_0x503a98){try{utils['debug'](util['format'](_0xdcdf('0xc'),_0x503a98[_0xdcdf('0x5')]),_0x503a98);if(_0x503a98[_0xdcdf('0x5')]==_0x503a98['linkedid']){utils[_0xdcdf('0x2')](util[_0xdcdf('0x3')](_0xdcdf('0xd'),_0x503a98[_0xdcdf('0x5')],_0x503a98['context'],_0x503a98[_0xdcdf('0xe')]));recordings[_0x503a98['uniqueid']]={'uniqueid':_0x503a98['uniqueid'],'accountcode':_0x503a98['accountcode'],'exten':_0x503a98['exten'],'context':_0x503a98[_0xdcdf('0xf')],'channel':_0x503a98[_0xdcdf('0x10')],'monitors':[]};}}catch(_0x37b66b){utils['error'](util[_0xdcdf('0x3')](_0xdcdf('0xc'),_0x503a98[_0xdcdf('0x5')]),_0x37b66b);}};exports['newstate']=function(_0xa575d5){try{utils[_0xdcdf('0x11')](util[_0xdcdf('0x3')](_0xdcdf('0x12'),_0xa575d5[_0xdcdf('0x5')]),_0xa575d5);if(!_['isNil'](recordings[_0xa575d5[_0xdcdf('0x5')]])&&_0xa575d5[_0xdcdf('0x13')]==0x6){utils['info'](util[_0xdcdf('0x3')](_0xdcdf('0x14'),_0xa575d5[_0xdcdf('0x5')],_0xa575d5[_0xdcdf('0xf')],_0xa575d5[_0xdcdf('0x10')]));}else if(!_[_0xdcdf('0x15')](recordings[_0xa575d5['linkedid']])&&_0xa575d5[_0xdcdf('0x13')]==0x6&&_0xa575d5[_0xdcdf('0xf')]!='transfer'){utils[_0xdcdf('0x2')](util['format'](_0xdcdf('0x16'),_0xa575d5[_0xdcdf('0x5')],_0xa575d5[_0xdcdf('0x17')],_0xa575d5['context'],_0xa575d5[_0xdcdf('0x10')]));recordings[_0xa575d5['linkedid']][_0xdcdf('0x18')]=_0xa575d5[_0xdcdf('0x18')];}}catch(_0x187b43){utils['error'](util[_0xdcdf('0x3')](_0xdcdf('0x12'),_0xa575d5[_0xdcdf('0x5')]),_0x187b43);}};exports['varset']=function(_0x272f0b){try{if(!_[_0xdcdf('0x15')](_0x272f0b['variable'])&&!_[_0xdcdf('0x15')](_0x272f0b[_0xdcdf('0x19')][_0xdcdf('0x1a')])){utils['debug'](util['format']('[%s][recordings][varset]',_0x272f0b[_0xdcdf('0x5')]),_0x272f0b);utils[_0xdcdf('0x2')](util[_0xdcdf('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x272f0b[_0xdcdf('0x5')],_0x272f0b[_0xdcdf('0x19')],_0x272f0b[_0xdcdf('0x1b')]));if(_['endsWith'](_0x272f0b['value'],_0xdcdf('0x1c'))){_0x272f0b[_0xdcdf('0x1b')]=_0x272f0b[_0xdcdf('0x1b')][_0xdcdf('0x1d')](_0xdcdf('0x1c'),_0xdcdf('0x1e'));}if(recordings[_0x272f0b[_0xdcdf('0x17')]]){var _0x30d451=_['find'](recordings[_0x272f0b[_0xdcdf('0x17')]][_0xdcdf('0x1f')],{'value':_0x272f0b[_0xdcdf('0x1b')]});if(_[_0xdcdf('0x15')](_0x30d451)){recordings[_0x272f0b[_0xdcdf('0x17')]][_0xdcdf('0x1f')][_0xdcdf('0x20')]({'value':_0x272f0b[_0xdcdf('0x1b')]});}}}}catch(_0x5545ec){utils[_0xdcdf('0x21')](util[_0xdcdf('0x3')](_0xdcdf('0x22'),_0x272f0b[_0xdcdf('0x5')]),_0x5545ec);}};exports[_0xdcdf('0x23')]=function(_0x167c6d){try{if(!_[_0xdcdf('0x15')](recordings[_0x167c6d[_0xdcdf('0x5')]])){utils['debug'](util[_0xdcdf('0x3')](_0xdcdf('0x24'),_0x167c6d['uniqueid']),_0x167c6d);utils[_0xdcdf('0x2')](util[_0xdcdf('0x3')](_0xdcdf('0x25'),_0x167c6d['uniqueid'],_0x167c6d[_0xdcdf('0x26')],_0x167c6d[_0xdcdf('0x27')],_0x167c6d[_0xdcdf('0x28')]));recordings[_0x167c6d['uniqueid']][_0xdcdf('0x26')]=_0x167c6d['calleridnum'];recordings[_0x167c6d[_0xdcdf('0x5')]][_0xdcdf('0x27')]=_0x167c6d[_0xdcdf('0x27')];recordings[_0x167c6d[_0xdcdf('0x5')]][_0xdcdf('0x29')]=_0x167c6d[_0xdcdf('0x29')];recordings[_0x167c6d[_0xdcdf('0x5')]]['connectedlinename']=_0x167c6d['connectedlinename'];if(recordings[_0x167c6d['uniqueid']][_0xdcdf('0x2a')]=='outbound'&&recordings[_0x167c6d['uniqueid']]['accountcode']){recordings[_0x167c6d[_0xdcdf('0x5')]][_0xdcdf('0x29')]=recordings[_0x167c6d[_0xdcdf('0x5')]][_0xdcdf('0x18')];recordings[_0x167c6d[_0xdcdf('0x5')]][_0xdcdf('0x2b')]='';}recordings[_0x167c6d[_0xdcdf('0x5')]]['monitors'][_0xdcdf('0x2c')](function(_0x1135ad){var _0x5979f2=_['clone'](recordings[_0x167c6d[_0xdcdf('0x5')]]);_0x5979f2[_0xdcdf('0x1b')]=_0x1135ad[_0xdcdf('0x1b')];writeDB(_0x5979f2);});delete recordings[_0x167c6d[_0xdcdf('0x5')]];}}catch(_0x1c6a32){utils[_0xdcdf('0x21')](util[_0xdcdf('0x3')]('[%s][recordings][hangup]',_0x167c6d['uniqueid']),_0x1c6a32);}};exports[_0xdcdf('0x2d')]=function(_0x222ed5){try{if(!_[_0xdcdf('0x15')](recordings[_0x222ed5['uniqueid']])){utils['debug'](util['format'](_0xdcdf('0x2e'),_0x222ed5[_0xdcdf('0x5')]),_0x222ed5);utils['info'](util[_0xdcdf('0x3')](_0xdcdf('0x2f'),_0x222ed5[_0xdcdf('0x5')],_0x222ed5[_0xdcdf('0x30')],_0x222ed5['appdata']));if(_0x222ed5[_0xdcdf('0x30')][_0xdcdf('0x31')]()=='set'&&_['startsWith'](_0x222ed5['appdata'][_0xdcdf('0x31')](),'cdr')){var _0x150281=_0x222ed5[_0xdcdf('0x32')][_0xdcdf('0x33')]('=');var _0x3fad81=_0x150281[0x0][_0xdcdf('0x34')](_0x150281[0x0][_0xdcdf('0x35')]('(')+0x1,_0x150281[0x0]['lastIndexOf'](')'));var _0x4fce5a=_0x150281[0x1];recordings[_0x222ed5['uniqueid']][_0x3fad81]=_0x4fce5a;}}}catch(_0x195b13){utils['error'](util[_0xdcdf('0x3')](_0xdcdf('0x2e'),_0x222ed5[_0xdcdf('0x5')]),_0x195b13);}};exports['queuecallerjoin']=function(_0x1189b9){try{if(!_['isNil'](recordings[_0x1189b9[_0xdcdf('0x5')]])){utils[_0xdcdf('0x11')](util[_0xdcdf('0x3')](_0xdcdf('0x36'),_0x1189b9[_0xdcdf('0x5')]),_0x1189b9);utils[_0xdcdf('0x2')](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x1189b9[_0xdcdf('0x5')],_0x1189b9[_0xdcdf('0x37')]));recordings[_0x1189b9[_0xdcdf('0x5')]][_0xdcdf('0x37')]=_0x1189b9['queue'];}}catch(_0x293d63){utils[_0xdcdf('0x21')](util[_0xdcdf('0x3')](_0xdcdf('0x36'),_0x1189b9[_0xdcdf('0x5')]),_0x293d63);}};
\ No newline at end of file
index 7cb6f4e..3270a59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc658=['transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','util','./utils','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','format','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','attended','isNil'];(function(_0x143b74,_0x452bd){var _0x5e636=function(_0x289668){while(--_0x289668){_0x143b74['push'](_0x143b74['shift']());}};_0x5e636(++_0x452bd);}(_0xc658,0xbf));var _0x8c65=function(_0x49ddeb,_0x13921a){_0x49ddeb=_0x49ddeb-0x0;var _0x18f23f=_0xc658[_0x49ddeb];return _0x18f23f;};'use strict';var _=require('lodash');var util=require(_0x8c65('0x0'));var utils=require(_0x8c65('0x1'));function writeDB(_0x2a1ca0){utils['info'](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x2a1ca0[_0x8c65('0x2')]==='attended'?_0x2a1ca0[_0x8c65('0x3')]:_0x2a1ca0[_0x8c65('0x4')],_0x2a1ca0[_0x8c65('0x2')]));utils[_0x8c65('0x5')](_0x8c65('0x6'),_0x2a1ca0);}exports[_0x8c65('0x7')]={};exports[_0x8c65('0x8')]=function(_0x14aee3){try{utils[_0x8c65('0x9')](util[_0x8c65('0xa')](_0x8c65('0xb'),_0x14aee3['uniqueid']),_0x14aee3);utils[_0x8c65('0xc')](util[_0x8c65('0xa')](_0x8c65('0xd'),_0x14aee3[_0x8c65('0x4')],_0x14aee3[_0x8c65('0xe')],_0x14aee3['transferercalleridname'],_0x14aee3[_0x8c65('0xf')],_0x14aee3['transfereecalleridname']));_0x14aee3[_0x8c65('0x2')]=_0x8c65('0x10');exports['blinds'][_0x14aee3[_0x8c65('0x11')]]=_0x14aee3;writeDB(_0x14aee3);}catch(_0x48229e){utils[_0x8c65('0x12')](util[_0x8c65('0xa')](_0x8c65('0xb'),_0x14aee3[_0x8c65('0x4')]),_0x48229e);}};exports[_0x8c65('0x13')]=function(_0x377960){try{utils[_0x8c65('0x9')](util['format']('[%s][transfers][attendedtransfer]',_0x377960[_0x8c65('0x3')]),_0x377960);utils['info'](util[_0x8c65('0xa')](_0x8c65('0x14'),_0x377960[_0x8c65('0x3')],_0x377960[_0x8c65('0x15')],_0x377960[_0x8c65('0x16')],_0x377960[_0x8c65('0x17')],_0x377960['transfertargetcalleridname']));_0x377960=_[_0x8c65('0x18')](_0x377960,{'transfererchannel':_0x377960['origtransfererchannel'],'transferercalleridnum':_0x377960[_0x8c65('0x15')],'transferercalleridname':_0x377960[_0x8c65('0x16')],'transfererconnectedlinenum':_0x377960['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x377960[_0x8c65('0x19')],'transfereraccountcode':_0x377960[_0x8c65('0x1a')],'transferercontext':_0x377960['secondtransferercontext'],'transfererexten':_0x377960['secondtransfererexten'],'transfererlinkedid':_0x377960[_0x8c65('0x1b')],'context':_0x377960[_0x8c65('0x1c')],'extension':_0x377960['origtransfererexten'],'type':_0x8c65('0x1d')});if(_[_0x8c65('0x1e')](_0x377960['transfereechannel'])){_0x377960=_['assign'](_0x377960,{'transfereechannel':_0x377960[_0x8c65('0x1f')],'transfereecalleridnum':_0x377960[_0x8c65('0x17')],'transfereecalleridname':_0x377960['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x377960[_0x8c65('0x20')],'transfereeconnectedlinename':_0x377960['transfertargetconnectedlinename'],'transfereeaccountcode':_0x377960[_0x8c65('0x21')],'transfereecontext':_0x377960['transfertargetcontext'],'transfereeexten':_0x377960[_0x8c65('0x22')],'transfereelinkedid':_0x377960[_0x8c65('0x23')]});}writeDB(_0x377960);}catch(_0xa2e195){utils[_0x8c65('0x12')](util['format'](_0x8c65('0x24'),_0x377960[_0x8c65('0x3')]),_0xa2e195);}};
\ No newline at end of file
+var _0xe34d=['./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blind','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','util'];(function(_0x42d44a,_0x40062d){var _0x440095=function(_0x7bf32c){while(--_0x7bf32c){_0x42d44a['push'](_0x42d44a['shift']());}};_0x440095(++_0x40062d);}(_0xe34d,0x1ab));var _0xde34=function(_0x1138f7,_0x54d42f){_0x1138f7=_0x1138f7-0x0;var _0x20d40b=_0xe34d[_0x1138f7];return _0x20d40b;};'use strict';var _=require(_0xde34('0x0'));var util=require(_0xde34('0x1'));var utils=require(_0xde34('0x2'));function writeDB(_0x71c6fd){utils[_0xde34('0x3')](util[_0xde34('0x4')](_0xde34('0x5'),_0x71c6fd[_0xde34('0x6')]===_0xde34('0x7')?_0x71c6fd[_0xde34('0x8')]:_0x71c6fd[_0xde34('0x9')],_0x71c6fd['type']));utils[_0xde34('0xa')]('CreateVoiceTransferReport',_0x71c6fd);}exports[_0xde34('0xb')]={};exports[_0xde34('0xc')]=function(_0xaab760){try{utils[_0xde34('0xd')](util[_0xde34('0x4')](_0xde34('0xe'),_0xaab760['uniqueid']),_0xaab760);utils[_0xde34('0x3')](util[_0xde34('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xaab760[_0xde34('0x9')],_0xaab760[_0xde34('0xf')],_0xaab760['transferercalleridname'],_0xaab760[_0xde34('0x10')],_0xaab760[_0xde34('0x11')]));_0xaab760['type']=_0xde34('0x12');exports[_0xde34('0xb')][_0xaab760['transfereruniqueid']]=_0xaab760;writeDB(_0xaab760);}catch(_0x5d180f){utils['error'](util[_0xde34('0x4')](_0xde34('0xe'),_0xaab760[_0xde34('0x9')]),_0x5d180f);}};exports['attendedtransfer']=function(_0x383017){try{utils['debug'](util[_0xde34('0x4')](_0xde34('0x13'),_0x383017[_0xde34('0x8')]),_0x383017);utils[_0xde34('0x3')](util['format'](_0xde34('0x14'),_0x383017[_0xde34('0x8')],_0x383017[_0xde34('0x15')],_0x383017[_0xde34('0x16')],_0x383017[_0xde34('0x17')],_0x383017['transfertargetcalleridname']));_0x383017=_[_0xde34('0x18')](_0x383017,{'transfererchannel':_0x383017['origtransfererchannel'],'transferercalleridnum':_0x383017['origtransferercalleridnum'],'transferercalleridname':_0x383017[_0xde34('0x16')],'transfererconnectedlinenum':_0x383017[_0xde34('0x19')],'transfererconnectedlinename':_0x383017[_0xde34('0x1a')],'transfereraccountcode':_0x383017[_0xde34('0x1b')],'transferercontext':_0x383017[_0xde34('0x1c')],'transfererexten':_0x383017[_0xde34('0x1d')],'transfererlinkedid':_0x383017[_0xde34('0x1e')],'context':_0x383017[_0xde34('0x1f')],'extension':_0x383017[_0xde34('0x20')],'type':_0xde34('0x7')});if(_['isNil'](_0x383017[_0xde34('0x21')])){_0x383017=_[_0xde34('0x18')](_0x383017,{'transfereechannel':_0x383017['transfertargetchannel'],'transfereecalleridnum':_0x383017[_0xde34('0x17')],'transfereecalleridname':_0x383017['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x383017[_0xde34('0x22')],'transfereeconnectedlinename':_0x383017[_0xde34('0x23')],'transfereeaccountcode':_0x383017[_0xde34('0x24')],'transfereecontext':_0x383017[_0xde34('0x25')],'transfereeexten':_0x383017['transfertargetexten'],'transfereelinkedid':_0x383017[_0xde34('0x26')]});}writeDB(_0x383017);}catch(_0x3c87e4){utils['error'](util[_0xde34('0x4')](_0xde34('0x13'),_0x383017[_0xde34('0x8')]),_0x3c87e4);}};
\ No newline at end of file
index a0eeeb8..506e6af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc749=['catch','GetUser','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtract','format','diffTime','diff','now','isAfter','isBefore','bluebird','moment','util','client','http','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s'];(function(_0x312958,_0x5c2f3f){var _0x507ab1=function(_0x2b55a3){while(--_0x2b55a3){_0x312958['push'](_0x312958['shift']());}};_0x507ab1(++_0x5c2f3f);}(_0xc749,0x135));var _0x9c74=function(_0x24a361,_0x59977c){_0x24a361=_0x24a361-0x0;var _0x376c2b=_0xc749[_0x24a361];return _0x376c2b;};'use strict';var BPromise=require(_0x9c74('0x0'));var jayson=require('jayson/promise');var moment=require(_0x9c74('0x1'));var util=require(_0x9c74('0x2'));var client=jayson[_0x9c74('0x3')][_0x9c74('0x4')]({'port':0x2329});var logger=require(_0x9c74('0x5'))('xdr');exports['info']=function(_0x337cbe,_0xc17056){logger[_0x9c74('0x6')](_0x337cbe,_0xc17056?util[_0x9c74('0x7')](_0xc17056,{'showHidden':![],'depth':null}):'');};exports[_0x9c74('0x8')]=function(_0x40112d,_0x282750){logger['debug'](_0x40112d,_0x282750?util[_0x9c74('0x7')](_0x282750,{'showHidden':![],'depth':null}):'');};exports[_0x9c74('0x9')]=function(_0xc4000c,_0x99430e){logger[_0x9c74('0x9')](_0xc4000c,_0x99430e?util[_0x9c74('0x7')](_0x99430e,{'showHidden':![],'depth':null}):'');};exports[_0x9c74('0xa')]=function(_0x2e7d93,_0x1b01c5){return client[_0x9c74('0xa')](_0x2e7d93,{'body':_0x1b01c5})[_0x9c74('0xb')](function(_0x741788){logger[_0x9c74('0x8')](_0x9c74('0xc'),_0x2e7d93,_0x741788?util[_0x9c74('0x7')](_0x741788,{'showHidden':![],'depth':null}):'');})[_0x9c74('0xd')](function(_0x286268){logger[_0x9c74('0x9')]('[utils][request]\x20name:%s',_0x2e7d93,_0x286268?util[_0x9c74('0x7')](_0x286268,{'showHidden':![],'depth':null}):'');});};function getUser(_0x54d161){return client[_0x9c74('0xa')](_0x9c74('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x9c74('0xf'),_0x9c74('0x10')],'where':_0x54d161,'limit':0x1}})[_0x9c74('0xb')](function(_0x4ab708){logger[_0x9c74('0x8')](_0x9c74('0x11'),JSON['stringify'](_0x54d161),_0x4ab708?util[_0x9c74('0x7')](_0x4ab708,{'showHidden':![],'depth':null}):'');return _0x4ab708[_0x9c74('0x12')][_0x9c74('0x13')]?_0x4ab708[_0x9c74('0x12')][0x0]:null;});}exports[_0x9c74('0x14')]=function(_0x52b67e){return new BPromise(function(_0x141ec6,_0x4a19af){if(_0x52b67e){return getUser({'internal':_0x52b67e})['then'](function(_0x36e58c){logger[_0x9c74('0x6')](_0x9c74('0x15'),_0x52b67e,_0x36e58c?_0x9c74('0x16'):'notfound');return _0x141ec6(_0x36e58c);})[_0x9c74('0xd')](function(_0x2245a5){logger[_0x9c74('0x9')]('[utils][getUserByInternal]',_0x2245a5?util[_0x9c74('0x7')](_0x2245a5,{'showHidden':![],'depth':null}):'');return _0x141ec6(null);});}return _0x141ec6(null);});};exports[_0x9c74('0x17')]=function(_0xdb1ae2){return new BPromise(function(_0xe7c5ee,_0xeeb604){if(_0xdb1ae2){return getUser({'interface':_0xdb1ae2})[_0x9c74('0xb')](function(_0x58d29e){logger['info'](_0x9c74('0x18'),_0xdb1ae2,_0x58d29e?'found':_0x9c74('0x19'));return _0xe7c5ee(_0x58d29e);})[_0x9c74('0xd')](function(_0x4a1a27){logger[_0x9c74('0x9')]('[utils][getUserByInterface]',_0x4a1a27?util[_0x9c74('0x7')](_0x4a1a27,{'showHidden':![],'depth':null}):'');return _0xe7c5ee(null);});}return _0xe7c5ee(null);});};exports[_0x9c74('0x1a')]=function(_0x21179a){return new BPromise(function(_0x6ab1aa,_0x403429){if(_0x21179a){return getUser({'name':_0x21179a})[_0x9c74('0xb')](function(_0x22a34d){logger[_0x9c74('0x6')](_0x9c74('0x1b'),_0x21179a,_0x22a34d?_0x9c74('0x16'):_0x9c74('0x19'));return _0x6ab1aa(_0x22a34d);})[_0x9c74('0xd')](function(_0x235de2){logger['error'](_0x9c74('0x1c'),_0x235de2?util[_0x9c74('0x7')](_0x235de2,{'showHidden':![],'depth':null}):'');return _0x6ab1aa(null);});}return _0x6ab1aa(null);});};exports['getVoiceQueueByName']=function(_0x4330c4){return new BPromise(function(_0x39a909,_0x1fb508){if(_0x4330c4){return client[_0x9c74('0xa')](_0x9c74('0x1d'),{'options':{'raw':!![],'attributes':['id','name',_0x9c74('0x1e'),_0x9c74('0x1f'),_0x9c74('0x20')],'where':{'name':_0x4330c4},'limit':0x1}})[_0x9c74('0xb')](function(_0x14e009){logger[_0x9c74('0x8')](_0x9c74('0x21'),_0x4330c4,_0x14e009?util[_0x9c74('0x7')](_0x14e009,{'showHidden':![],'depth':null}):'');logger[_0x9c74('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x4330c4,_0x14e009?_0x9c74('0x16'):'notfound');return _0x39a909(_0x14e009[_0x9c74('0x12')][_0x9c74('0x13')]?_0x14e009['result'][0x0]:null);})[_0x9c74('0xd')](function(_0xcba943){logger['error'](_0x9c74('0x22'),_0xcba943?util[_0x9c74('0x7')](_0xcba943,{'showHidden':![],'depth':null}):'');return _0x39a909(null);});}return _0x39a909(null);});};exports[_0x9c74('0x23')]=function(_0x1f782,_0x1b0349){return moment(_0x1f782)[_0x9c74('0x24')](_0x1b0349,_0x9c74('0x25'))['format'](_0x9c74('0x26'));};exports['subtractTime']=function(_0x50bb90,_0x327d0){return moment(_0x50bb90)[_0x9c74('0x27')](_0x327d0,_0x9c74('0x25'))[_0x9c74('0x28')](_0x9c74('0x26'));};exports[_0x9c74('0x29')]=function(_0x5e39e6,_0xfd98ff){return moment(_0x5e39e6)[_0x9c74('0x2a')](moment(_0xfd98ff),_0x9c74('0x25'));};exports['sumTime']=function(_0xe7cee2,_0x27a061){return parseInt(_0xe7cee2,0xa)+parseInt(_0x27a061,0xa);};exports[_0x9c74('0x2b')]=function(){return moment()['format'](_0x9c74('0x26'));};exports[_0x9c74('0x2c')]=function(_0x34b944,_0x92077e){if(_0x92077e){return moment(_0x34b944)[_0x9c74('0x2c')](_0x92077e);}return!![];};exports[_0x9c74('0x2d')]=function(_0x526ae5,_0x21fb4d){if(_0x21fb4d){return moment(_0x526ae5)[_0x9c74('0x2d')](_0x21fb4d);}else if(_0x526ae5){return!![];}return![];};
\ No newline at end of file
+var _0x6717=['info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','format','subtractTime','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','util','client','http','../../config/logger','xdr'];(function(_0x49cfb6,_0x5b615){var _0x4e37a7=function(_0x45ace7){while(--_0x45ace7){_0x49cfb6['push'](_0x49cfb6['shift']());}};_0x4e37a7(++_0x5b615);}(_0x6717,0x1a1));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x7671('0x0'));var moment=require('moment');var util=require(_0x7671('0x1'));var client=jayson[_0x7671('0x2')][_0x7671('0x3')]({'port':0x2329});var logger=require(_0x7671('0x4'))(_0x7671('0x5'));exports['info']=function(_0x507b19,_0x31b648){logger[_0x7671('0x6')](_0x507b19,_0x31b648?util[_0x7671('0x7')](_0x31b648,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x5a84aa,_0x5520e1){logger['debug'](_0x5a84aa,_0x5520e1?util[_0x7671('0x7')](_0x5520e1,{'showHidden':![],'depth':null}):'');};exports[_0x7671('0x8')]=function(_0x3d206b,_0x159794){logger[_0x7671('0x8')](_0x3d206b,_0x159794?util['inspect'](_0x159794,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0xceabdb,_0x167478){return client[_0x7671('0x9')](_0xceabdb,{'body':_0x167478})[_0x7671('0xa')](function(_0x206454){logger[_0x7671('0xb')](_0x7671('0xc'),_0xceabdb,_0x206454?util[_0x7671('0x7')](_0x206454,{'showHidden':![],'depth':null}):'');})[_0x7671('0xd')](function(_0x1d937e){logger[_0x7671('0x8')]('[utils][request]\x20name:%s',_0xceabdb,_0x1d937e?util[_0x7671('0x7')](_0x1d937e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x126b0b){return client[_0x7671('0x9')](_0x7671('0xe'),{'options':{'raw':!![],'attributes':['id','internal','name',_0x7671('0xf')],'where':_0x126b0b,'limit':0x1}})['then'](function(_0x567ccd){logger[_0x7671('0xb')](_0x7671('0x10'),JSON[_0x7671('0x11')](_0x126b0b),_0x567ccd?util['inspect'](_0x567ccd,{'showHidden':![],'depth':null}):'');return _0x567ccd[_0x7671('0x12')][_0x7671('0x13')]?_0x567ccd[_0x7671('0x12')][0x0]:null;});}exports[_0x7671('0x14')]=function(_0x4c11dd){return new BPromise(function(_0x6a55af,_0x2d8d46){if(_0x4c11dd){return getUser({'internal':_0x4c11dd})['then'](function(_0x2888d2){logger[_0x7671('0x6')](_0x7671('0x15'),_0x4c11dd,_0x2888d2?_0x7671('0x16'):_0x7671('0x17'));return _0x6a55af(_0x2888d2);})[_0x7671('0xd')](function(_0x4c2900){logger['error'](_0x7671('0x18'),_0x4c2900?util[_0x7671('0x7')](_0x4c2900,{'showHidden':![],'depth':null}):'');return _0x6a55af(null);});}return _0x6a55af(null);});};exports[_0x7671('0x19')]=function(_0x427274){return new BPromise(function(_0x33ad0c,_0x2f7879){if(_0x427274){return getUser({'interface':_0x427274})[_0x7671('0xa')](function(_0x4cf302){logger[_0x7671('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x427274,_0x4cf302?_0x7671('0x16'):_0x7671('0x17'));return _0x33ad0c(_0x4cf302);})[_0x7671('0xd')](function(_0x4ab527){logger[_0x7671('0x8')]('[utils][getUserByInterface]',_0x4ab527?util[_0x7671('0x7')](_0x4ab527,{'showHidden':![],'depth':null}):'');return _0x33ad0c(null);});}return _0x33ad0c(null);});};exports[_0x7671('0x1a')]=function(_0x590d91){return new BPromise(function(_0x4a3b0d,_0x3b901c){if(_0x590d91){return getUser({'name':_0x590d91})[_0x7671('0xa')](function(_0x5dd269){logger['info'](_0x7671('0x1b'),_0x590d91,_0x5dd269?_0x7671('0x16'):_0x7671('0x17'));return _0x4a3b0d(_0x5dd269);})['catch'](function(_0x2eddb8){logger['error'](_0x7671('0x1c'),_0x2eddb8?util['inspect'](_0x2eddb8,{'showHidden':![],'depth':null}):'');return _0x4a3b0d(null);});}return _0x4a3b0d(null);});};exports['getVoiceQueueByName']=function(_0x1ff3be){return new BPromise(function(_0x3b1263,_0x9f51a1){if(_0x1ff3be){return client[_0x7671('0x9')](_0x7671('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x7671('0x1e'),'type',_0x7671('0x1f'),_0x7671('0x20')],'where':{'name':_0x1ff3be},'limit':0x1}})[_0x7671('0xa')](function(_0x35d270){logger['debug'](_0x7671('0x21'),_0x1ff3be,_0x35d270?util[_0x7671('0x7')](_0x35d270,{'showHidden':![],'depth':null}):'');logger[_0x7671('0x6')](_0x7671('0x22'),_0x1ff3be,_0x35d270?_0x7671('0x16'):_0x7671('0x17'));return _0x3b1263(_0x35d270[_0x7671('0x12')]['length']?_0x35d270[_0x7671('0x12')][0x0]:null);})[_0x7671('0xd')](function(_0x10f791){logger[_0x7671('0x8')](_0x7671('0x23'),_0x10f791?util[_0x7671('0x7')](_0x10f791,{'showHidden':![],'depth':null}):'');return _0x3b1263(null);});}return _0x3b1263(null);});};exports['addTime']=function(_0x37f0ca,_0x11de52){return moment(_0x37f0ca)[_0x7671('0x24')](_0x11de52,_0x7671('0x25'))[_0x7671('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x7671('0x27')]=function(_0x168ba9,_0x5e9b4b){return moment(_0x168ba9)['subtract'](_0x5e9b4b,_0x7671('0x25'))[_0x7671('0x26')](_0x7671('0x28'));};exports[_0x7671('0x29')]=function(_0x2a73f2,_0x267015){return moment(_0x2a73f2)[_0x7671('0x2a')](moment(_0x267015),'seconds');};exports[_0x7671('0x2b')]=function(_0x101f1c,_0x2f552a){return parseInt(_0x101f1c,0xa)+parseInt(_0x2f552a,0xa);};exports[_0x7671('0x2c')]=function(){return moment()[_0x7671('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x7671('0x2d')]=function(_0x1124af,_0x3b5a98){if(_0x3b5a98){return moment(_0x1124af)[_0x7671('0x2d')](_0x3b5a98);}return!![];};exports[_0x7671('0x2e')]=function(_0x459e3a,_0x4a2449){if(_0x4a2449){return moment(_0x459e3a)[_0x7671('0x2e')](_0x4a2449);}else if(_0x459e3a){return!![];}return![];};
\ No newline at end of file